[cpl-plugin-fors] 05/06: New upstream version 4.11.12

Ole Streicher olebole-guest at moszumanska.debian.org
Wed Nov 27 16:09:38 UTC 2013


This is an automated email from the git hooks/post-receive script.

olebole-guest pushed a commit to branch debian
in repository cpl-plugin-fors.

commit 2be41ce155cda13660ed3e958dbcdc10b5a113fd
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Wed Nov 27 17:02:58 2013 +0100

    New upstream version 4.11.12
---
 Makefile.am                                        |     2 +-
 Makefile.in                                        |   587 +-
 Makefile.purify.in                                 |     2 +-
 acinclude.m4                                       |     2 +-
 aclocal.m4                                         |  7284 +---
 admin/compile                                      |   342 +
 admin/config.guess                                 |   529 +-
 admin/config.sub                                   |   379 +-
 admin/depcomp                                      |   343 +-
 admin/install-sh                                   |   538 +-
 admin/ltmain.sh                                    | 14878 ++++----
 admin/missing                                      |   234 +-
 calib/cal/fors2_1453_phot.fits                     |   Bin 8640 -> 11520 bytes
 calib/cal/fors2_1456_phot.fits                     |   Bin 8640 -> 8640 bytes
 calib/cal/fors2_stetson_2010Dec09.fits             |     2 +-
 calib/cal/zeroupdate                               |   111 +
 .../{ESO-DFS-DIC.FORS2_QC => ESO-DFS-DIC.FORS1_QC} |   133 +-
 calib/dic/ESO-DFS-DIC.FORS2_QC                     |    11 +-
 calib/gasgano/config/FORS1.prefs                   |    66 +
 calib/gasgano/config/{FORS.prefs => FORS2.prefs}   |     2 +-
 calib/gasgano/config/{fors.oca => fors1.oca}       |   103 +-
 calib/gasgano/config/{fors.oca => fors2.oca}       |     0
 config.h.in                                        |    32 +-
 configure                                          | 35186 +++++++++----------
 configure.ac                                       |    32 +-
 fors/Makefile.am                                   |    32 +-
 fors/Makefile.in                                   |   694 +-
 fors/create_phot.c                                 |   455 -
 fors/create_stetson.c                              |   225 -
 fors/fors_bias_impl.c                              |    19 +-
 fors/fors_bias_impl.h                              |     6 +-
 fors/fors_dark_impl.c                              |    20 +-
 fors/fors_dark_impl.h                              |     6 +-
 fors/fors_data.c                                   |    16 +-
 fors/fors_data.h                                   |     6 +-
 fors/fors_detected_slits.cc                        |   113 +
 fors/fors_detected_slits.h                         |    49 +
 fors/fors_dfs.c                                    |   171 +-
 fors/fors_dfs.h                                    |    40 +-
 fors/fors_double.c                                 |     6 +-
 fors/fors_double.h                                 |     6 +-
 fors/fors_extract.c                                |     6 +-
 fors/fors_extract.h                                |     6 +-
 fors/fors_flat_normalise.cc                        |   618 +
 fors/fors_flat_normalise.h                         |    52 +
 fors/fors_header.c                                 |     6 +-
 fors/fors_header.h                                 |     6 +-
 fors/fors_identify.c                               |     8 +-
 fors/fors_identify.h                               |    10 +-
 fors/fors_image.c                                  |    41 +-
 fors/fors_image.h                                  |    14 +-
 fors/fors_img_science_impl.c                       |    10 +-
 fors/fors_img_science_impl.h                       |     6 +-
 fors/fors_img_screen_flat_impl.c                   |    30 +-
 fors/fors_img_screen_flat_impl.h                   |     6 +-
 fors/fors_img_sky_flat_impl.c                      |    10 +-
 fors/fors_img_sky_flat_impl.h                      |     6 +-
 fors/fors_instrument.c                             |     6 +-
 fors/fors_instrument.h                             |     6 +-
 fors/fors_overscan.cc                              |   300 +
 .../tests/recipes-test.c => fors/fors_overscan.h   |    37 +-
 fors/fors_paf.c                                    |    19 +-
 fors/fors_paf.h                                    |     6 +-
 fors/fors_pattern.c                                |     6 +-
 fors/fors_pattern.h                                |     6 +-
 fors/fors_pfits.c                                  |     6 +-
 fors/fors_pfits.h                                  |     6 +-
 fors/fors_photometry_impl.c                        |    74 +-
 fors/fors_photometry_impl.h                        |     6 +-
 fors/fors_point.c                                  |     6 +-
 fors/fors_point.h                                  |     6 +-
 fors/fors_polynomial.c                             |     6 +-
 fors/fors_polynomial.h                             |     6 +-
 fors/fors_qc.c                                     |     6 +-
 fors/fors_qc.h                                     |     6 +-
 fors/fors_recipe_impl.h                            |     6 +-
 fors/fors_setting.c                                |     6 +-
 fors/fors_setting.h                                |     6 +-
 fors/fors_stack.c                                  |     6 +-
 fors/fors_stack.h                                  |     6 +-
 fors/fors_star.c                                   |     6 +-
 fors/fors_star.h                                   |     6 +-
 fors/fors_std_cat.c                                |    10 +-
 fors/fors_std_cat.h                                |    10 +-
 fors/fors_std_star.c                               |     6 +-
 fors/fors_std_star.h                               |     6 +-
 fors/fors_tools.c                                  |     6 +-
 fors/fors_tools.h                                  |     6 +-
 fors/fors_utils.c                                  |    10 +-
 fors/fors_utils.h                                  |    12 +-
 fors/fors_zeropoint_impl.c                         |    12 +-
 fors/fors_zeropoint_impl.h                         |     6 +-
 fors/list.c                                        |    20 +-
 fors/list.h                                        |    18 +-
 fors/list_void.h                                   |    14 +-
 fors/moses.c                                       |   353 +-
 fors/moses.h                                       |    44 +-
 fors/tests/Makefile.am                             |     2 -
 fors/tests/Makefile.in                             |   674 +-
 fors/tests/fors-test.c                             |     6 +-
 fors/tests/fors_bias-test.c                        |     6 +-
 fors/tests/fors_cpl_wcs-test.c                     |     6 +-
 fors/tests/fors_dark-test.c                        |    12 +-
 fors/tests/fors_identify-test.c                    |     6 +-
 fors/tests/fors_image-test.c                       |     6 +-
 fors/tests/fors_img_science-test.c                 |     6 +-
 fors/tests/fors_img_screen_flat-test.c             |     6 +-
 fors/tests/fors_img_sky_flat-test.c                |    12 +-
 fors/tests/fors_pattern-test.c                     |     6 +-
 fors/tests/fors_photometry-test.c                  |     6 +-
 fors/tests/fors_point-test.c                       |     6 +-
 fors/tests/fors_qc-test.c                          |     6 +-
 fors/tests/fors_setting-test.c                     |     6 +-
 fors/tests/fors_stack-test.c                       |    12 +-
 fors/tests/fors_star-test.c                        |     6 +-
 fors/tests/fors_std_star-test.c                    |     6 +-
 fors/tests/fors_zeropoint-test.c                   |     6 +-
 fors/tests/list-test.c                             |     6 +-
 fors/tests/my_custom_test_script                   |     6 -
 fors/tests/test_simulate.c                         |     6 +-
 fors/tests/test_simulate.h                         |     6 +-
 html/annotated.html                                |   118 +-
 html/bc_s.png                                      |   Bin 0 -> 676 bytes
 html/bdwn.png                                      |   Bin 0 -> 147 bytes
 html/classes.html                                  |   126 +-
 html/closed.png                                    |   Bin 0 -> 132 bytes
 html/create__phot_8c-source.html                   |   477 -
 html/create__phot_8c_source.html                   |   516 +
 html/create__stetson_8c-source.html                |   247 -
 html/create__stetson_8c_source.html                |   286 +
 html/dir_29caecd79ba0d8cf1bf29f8555ca3deb.html     |    62 +
 html/dir_59b02a80e553296e42791d17a261b792.html     |    72 -
 html/dir_83e1530f94cacc9068c540ba3fc838a8.html     |   169 -
 html/dir_95ba833b8cc26b837be271dc0b58e122.html     |   211 +
 html/dir_9af262a93c54576b7a2b4cc0cd21cc4f.html     |   103 -
 html/dir_aab54b8ed0ffe13455bea30ab0dd47dc.html     |   106 +
 html/dir_b351cdfeb4656d7d168dc72b273024e7.html     |   135 +
 html/dir_f9b8c94f8f09c10447edf4ed11ceb4e6.html     |    28 -
 html/dirs.html                                     |    30 -
 html/doxygen.css                                   |  1428 +-
 html/doxygen.png                                   |   Bin 1281 -> 3779 bytes
 html/dynsections.js                                |    97 +
 html/files.html                                    |   340 +-
 html/fors-test_8c-source.html                      |    72 -
 html/fors-test_8c_source.html                      |   111 +
 html/fors_2fors__extract_8c-source.html            |   855 -
 html/fors_2fors__extract_8c_source.html            |   894 +
 html/fors__align__sky_8c-source.html               |   785 -
 html/fors__align__sky_8c_source.html               |   822 +
 html/fors__align__sky__lss_8c-source.html          |   795 -
 html/fors__align__sky__lss_8c_source.html          |   830 +
 html/fors__bias-test_8c-source.html                |   190 -
 html/fors__bias-test_8c_source.html                |   229 +
 html/fors__bias_8c-source.html                     |   198 -
 html/fors__bias_8c_source.html                     |   237 +
 html/fors__bias__impl_8c-source.html               |   346 -
 html/fors__bias__impl_8c_source.html               |   388 +
 html/fors__bias__impl_8h-source.html               |    67 -
 html/fors__bias__impl_8h_source.html               |   106 +
 html/fors__calib_8c-source.html                    |  2697 --
 html/fors__config_8c-source.html                   |   738 -
 html/fors__config_8c_source.html                   |   777 +
 html/fors__cpl__wcs-test_8c-source.html            |   334 -
 html/fors__cpl__wcs-test_8c_source.html            |   373 +
 html/fors__cpl__wcs_8c-source.html                 |   646 -
 html/fors__cpl__wcs_8c_source.html                 |   685 +
 html/fors__cpl__wcs_8h-source.html                 |    81 -
 html/fors__cpl__wcs_8h_source.html                 |   120 +
 html/fors__dark-test_8c-source.html                |   166 -
 html/fors__dark-test_8c_source.html                |   205 +
 html/fors__dark_8c-source.html                     |   198 -
 html/fors__dark_8c_source.html                     |   237 +
 html/fors__dark__impl_8c-source.html               |   170 -
 html/fors__dark__impl_8c_source.html               |   209 +
 html/fors__dark__impl_8h-source.html               |    67 -
 html/fors__dark__impl_8h_source.html               |   106 +
 html/fors__data_8c-source.html                     |   429 -
 html/fors__data_8c_source.html                     |   468 +
 html/fors__data_8h-source.html                     |    88 -
 html/fors__data_8h_source.html                     |   127 +
 html/fors__detect__objects_8c-source.html          |   429 -
 html/fors__detect__objects_8c_source.html          |   468 +
 html/fors__detect__spectra_8c-source.html          |   815 -
 html/fors__detect__spectra_8c_source.html          |   852 +
 html/fors__detected__slits_8h_source.html          |   110 +
 html/fors__detlin_8c-source.html                   |   235 -
 html/fors__detlin_8c_source.html                   |   274 +
 html/fors__dfs_8c-source.html                      |  1476 -
 html/fors__dfs_8c_source.html                      |  1580 +
 html/fors__dfs_8h-source.html                      |   149 -
 html/fors__dfs_8h_source.html                      |   208 +
 html/fors__double_8c-source.html                   |   158 -
 html/fors__double_8c_source.html                   |   197 +
 html/fors__double_8h-source.html                   |    82 -
 html/fors__double_8h_source.html                   |   121 +
 html/fors__extract_8h-source.html                  |    97 -
 html/fors__extract_8h_source.html                  |   136 +
 html/fors__extract__objects_8c-source.html         |   448 -
 html/fors__extract__objects_8c_source.html         |   487 +
 html/fors__extract__slits_8c-source.html           |   687 -
 html/fors__extract__slits_8c_source.html           |   723 +
 html/fors__flat_8c-source.html                     |   364 -
 html/fors__flat__normalise_8h_source.html          |   113 +
 html/fors__flatfield_8c-source.html                |   360 -
 html/fors__flatfield_8c_source.html                |   399 +
 html/fors__header_8c-source.html                   |   181 -
 html/fors__header_8c_source.html                   |   220 +
 html/fors__header_8h-source.html                   |    69 -
 html/fors__header_8h_source.html                   |   108 +
 html/fors__identify-test_8c-source.html            |   296 -
 html/fors__identify-test_8c_source.html            |   335 +
 html/fors__identify_8c-source.html                 |  1203 -
 html/fors__identify_8c_source.html                 |  1242 +
 html/fors__identify_8h-source.html                 |    79 -
 html/fors__identify_8h_source.html                 |   118 +
 html/fors__image-test_8c-source.html               |   340 -
 html/fors__image-test_8c_source.html               |   379 +
 html/fors__image_8c-source.html                    |  1610 -
 html/fors__image_8c_source.html                    |  1658 +
 html/fors__image_8h-source.html                    |   171 -
 html/fors__image_8h_source.html                    |   214 +
 html/fors__img__science-test_8c-source.html        |   146 -
 html/fors__img__science-test_8c_source.html        |   185 +
 html/fors__img__science_8c-source.html             |   198 -
 html/fors__img__science_8c_source.html             |   237 +
 html/fors__img__science__impl_8c-source.html       |   554 -
 html/fors__img__science__impl_8c_source.html       |   593 +
 html/fors__img__science__impl_8h-source.html       |    67 -
 html/fors__img__science__impl_8h_source.html       |   106 +
 html/fors__img__screen__flat-test_8c-source.html   |   235 -
 html/fors__img__screen__flat-test_8c_source.html   |   274 +
 html/fors__img__screen__flat_8c-source.html        |   198 -
 html/fors__img__screen__flat_8c_source.html        |   237 +
 html/fors__img__screen__flat__impl_8c-source.html  |   854 -
 html/fors__img__screen__flat__impl_8c_source.html  |   897 +
 html/fors__img__screen__flat__impl_8h-source.html  |    67 -
 html/fors__img__screen__flat__impl_8h_source.html  |   106 +
 html/fors__img__sky__flat-test_8c-source.html      |   173 -
 html/fors__img__sky__flat-test_8c_source.html      |   212 +
 html/fors__img__sky__flat_8c-source.html           |   198 -
 html/fors__img__sky__flat_8c_source.html           |   237 +
 html/fors__img__sky__flat__impl_8c-source.html     |   242 -
 html/fors__img__sky__flat__impl_8c_source.html     |   281 +
 html/fors__img__sky__flat__impl_8h-source.html     |    67 -
 html/fors__img__sky__flat__impl_8h_source.html     |   106 +
 html/fors__instrument_8c-source.html               |   183 -
 html/fors__instrument_8c_source.html               |   222 +
 html/fors__instrument_8h-source.html               |    84 -
 html/fors__instrument_8h_source.html               |   123 +
 html/fors__normalise__flat_8c-source.html          |   668 -
 html/fors__normalise__flat_8c_source.html          |   722 +
 html/fors__overscan_8h_source.html                 |   100 +
 html/fors__paf_8c-source.html                      |   750 -
 html/fors__paf_8c_source.html                      |   796 +
 html/fors__paf_8h-source.html                      |   188 -
 html/fors__paf_8h_source.html                      |   227 +
 html/fors__pattern-test_8c-source.html             |   101 -
 html/fors__pattern-test_8c_source.html             |   140 +
 html/fors__pattern_8c-source.html                  |   321 -
 html/fors__pattern_8c_source.html                  |   360 +
 html/fors__pattern_8h-source.html                  |   101 -
 html/fors__pattern_8h_source.html                  |   140 +
 html/fors__pfits_8c-source.html                    |    85 -
 html/fors__pfits_8c_source.html                    |   124 +
 html/fors__pfits_8h-source.html                    |    82 -
 html/fors__pfits_8h_source.html                    |   121 +
 html/fors__photometry-test_8c-source.html          |   183 -
 html/fors__photometry-test_8c_source.html          |   222 +
 html/fors__photometry_8c-source.html               |   198 -
 html/fors__photometry_8c_source.html               |   237 +
 html/fors__photometry__impl_8c-source.html         |  3807 --
 html/fors__photometry__impl_8c_source.html         |  3788 ++
 html/fors__photometry__impl_8h-source.html         |    67 -
 html/fors__photometry__impl_8h_source.html         |   106 +
 html/fors__pmos__calib_8c-source.html              |  2316 --
 html/fors__pmos__calib_8c_source.html              |  2356 ++
 html/fors__pmos__extract_8c-source.html            |  2876 --
 html/fors__pmos__extract_8c_source.html            |  2915 ++
 html/fors__pmos__science_8c-source.html            |  3521 --
 html/fors__pmos__science_8c_source.html            |  3560 ++
 html/fors__point-test_8c-source.html               |    80 -
 html/fors__point-test_8c_source.html               |   119 +
 html/fors__point_8c-source.html                    |   117 -
 html/fors__point_8c_source.html                    |   156 +
 html/fors__point_8h-source.html                    |    81 -
 html/fors__point_8h_source.html                    |   120 +
 html/fors__polynomial_8c-source.html               |   569 -
 html/fors__polynomial_8c_source.html               |   608 +
 html/fors__polynomial_8h-source.html               |    90 -
 html/fors__polynomial_8h_source.html               |   129 +
 html/fors__qc-test_8c-source.html                  |   116 -
 html/fors__qc-test_8c_source.html                  |   155 +
 html/fors__qc_8c-source.html                       |   662 -
 html/fors__qc_8c_source.html                       |   701 +
 html/fors__qc_8h-source.html                       |    88 -
 html/fors__qc_8h_source.html                       |   127 +
 html/fors__recipe_8c-source.html                   |   200 -
 html/fors__recipe_8c_source.html                   |   239 +
 html/fors__recipe__impl_8h-source.html             |    67 -
 html/fors__recipe__impl_8h_source.html             |   106 +
 html/fors__remove__bias_8c-source.html             |   376 -
 html/fors__remove__bias_8c_source.html             |   415 +
 html/fors__resample_8c-source.html                 |   803 -
 html/fors__resample_8c_source.html                 |   839 +
 html/fors__science_8c-source.html                  |  2299 --
 html/fors__science_8c_source.html                  |  2297 ++
 html/fors__setting-test_8c-source.html             |    96 -
 html/fors__setting-test_8c_source.html             |   135 +
 html/fors__setting_8c-source.html                  |   501 -
 html/fors__setting_8c_source.html                  |   540 +
 html/fors__setting_8h-source.html                  |   112 -
 html/fors__setting_8h_source.html                  |   151 +
 html/fors__stack-test_8c-source.html               |   175 -
 html/fors__stack-test_8c_source.html               |   214 +
 html/fors__stack_8c-source.html                    |   334 -
 html/fors__stack_8c_source.html                    |   373 +
 html/fors__stack_8h-source.html                    |    92 -
 html/fors__stack_8h_source.html                    |   131 +
 html/fors__star-test_8c-source.html                |   105 -
 html/fors__star-test_8c_source.html                |   144 +
 html/fors__star_8c-source.html                     |   447 -
 html/fors__star_8c_source.html                     |   486 +
 html/fors__star_8h-source.html                     |   146 -
 html/fors__star_8h_source.html                     |   185 +
 html/fors__std__cat_8c-source.html                 |  1716 -
 html/fors__std__cat_8c_source.html                 |  1755 +
 html/fors__std__cat_8h-source.html                 |    74 -
 html/fors__std__cat_8h_source.html                 |   113 +
 html/fors__std__star-test_8c-source.html           |   186 -
 html/fors__std__star-test_8c_source.html           |   225 +
 html/fors__std__star_8c-source.html                |   470 -
 html/fors__std__star_8c_source.html                |   509 +
 html/fors__std__star_8h-source.html                |   135 -
 html/fors__std__star_8h_source.html                |   174 +
 html/fors__subtract__sky_8c-source.html            |   635 -
 html/fors__subtract__sky_8c_source.html            |   674 +
 html/fors__subtract__sky__lss_8c-source.html       |   418 -
 html/fors__subtract__sky__lss_8c_source.html       |   457 +
 html/fors__sumflux_8c-source.html                  |   644 -
 html/fors__sumflux_8c_source.html                  |   683 +
 html/fors__tools_8c-source.html                    |   403 -
 html/fors__tools_8c_source.html                    |   442 +
 html/fors__tools_8h-source.html                    |    79 -
 html/fors__tools_8h_source.html                    |   118 +
 html/fors__trace__flat_8c-source.html              |   633 -
 html/fors__trace__flat_8c_source.html              |   668 +
 html/fors__utils_8c-source.html                    |   717 -
 html/fors__utils_8c_source.html                    |   756 +
 html/fors__utils_8h-source.html                    |   148 -
 html/fors__utils_8h_source.html                    |   191 +
 html/fors__wave__calib_8c-source.html              |   893 -
 html/fors__wave__calib_8c_source.html              |   929 +
 html/fors__wave__calib__lss_8c-source.html         |   925 -
 html/fors__wave__calib__lss_8c_source.html         |   964 +
 html/fors__zeropoint-test_8c-source.html           |   160 -
 html/fors__zeropoint-test_8c_source.html           |   199 +
 html/fors__zeropoint_8c-source.html                |   198 -
 html/fors__zeropoint_8c_source.html                |   237 +
 html/fors__zeropoint__impl_8c-source.html          |  1537 -
 html/fors__zeropoint__impl_8c_source.html          |  1576 +
 html/fors__zeropoint__impl_8h-source.html          |    67 -
 html/fors__zeropoint__impl_8h_source.html          |   106 +
 html/ftv2blank.png                                 |   Bin 0 -> 86 bytes
 html/ftv2cl.png                                    |   Bin 0 -> 453 bytes
 html/ftv2doc.png                                   |   Bin 0 -> 746 bytes
 html/ftv2folderclosed.png                          |   Bin 0 -> 616 bytes
 html/ftv2folderopen.png                            |   Bin 0 -> 597 bytes
 html/ftv2lastnode.png                              |   Bin 0 -> 86 bytes
 html/ftv2link.png                                  |   Bin 0 -> 746 bytes
 html/ftv2mlastnode.png                             |   Bin 0 -> 246 bytes
 html/ftv2mnode.png                                 |   Bin 0 -> 246 bytes
 html/ftv2mo.png                                    |   Bin 0 -> 403 bytes
 html/ftv2node.png                                  |   Bin 0 -> 86 bytes
 html/ftv2ns.png                                    |   Bin 0 -> 388 bytes
 html/ftv2plastnode.png                             |   Bin 0 -> 229 bytes
 html/ftv2pnode.png                                 |   Bin 0 -> 229 bytes
 html/ftv2splitbar.png                              |   Bin 0 -> 314 bytes
 html/ftv2vertline.png                              |   Bin 0 -> 86 bytes
 html/functions.html                                |   203 -
 html/functions_vars.html                           |   203 -
 html/group__forsPaf.html                           |   743 +-
 html/group__fors__bias.html                        |   533 +-
 html/group__fors__bias__test.html                  |   133 +-
 html/group__fors__cpl__wcs.html                    |   396 +-
 html/group__fors__dark.html                        |   516 +-
 html/group__fors__dark__test.html                  |   133 +-
 html/group__fors__double.html                      |    68 +-
 html/group__fors__extract.html                     |   664 +-
 html/group__fors__identify.html                    |   799 +-
 html/group__fors__identify__test.html              |   143 +-
 html/group__fors__image.html                       |  2886 +-
 html/group__fors__image__test.html                 |   232 +-
 html/group__fors__img__science.html                |   738 +-
 html/group__fors__img__science__test.html          |   125 +-
 html/group__fors__img__screen__flat.html           |   862 +-
 html/group__fors__img__screen__flat__test.html     |   135 +-
 html/group__fors__img__sky__flat.html              |   504 +-
 html/group__fors__img__sky__flat__test.html        |   133 +-
 html/group__fors__pattern__test.html               |    91 +-
 html/group__fors__pfits.html                       |   257 +-
 html/group__fors__photometry.html                  |  2766 +-
 html/group__fors__point.html                       |   362 +-
 html/group__fors__point__test.html                 |   135 +-
 html/group__fors__polynomial.html                  |   797 +-
 html/group__fors__qc__test.html                    |    91 +-
 html/group__fors__recipe.html                      |   295 +-
 html/group__fors__setting.html                     |   354 +-
 html/group__fors__setting__test.html               |   125 +-
 html/group__fors__stack.html                       |   401 +-
 html/group__fors__stack__test.html                 |   131 +-
 html/group__fors__star.html                        |  1346 +-
 html/group__fors__star__test.html                  |   123 +-
 html/group__fors__std__cat__test.html              |   139 +-
 html/group__fors__test.html                        |   156 +-
 html/group__fors__tools.html                       |   450 +-
 html/group__fors__utils.html                       |   982 +-
 html/group__fors__zeropoint.html                   |  1208 +-
 html/group__fors__zeropoint__test.html             |   125 +-
 html/group__forsdfs.html                           |  1866 +-
 html/group__forsqc.html                            |   840 +-
 html/group__list__test.html                        |   113 +-
 html/group__moses.html                             |  6110 ++--
 html/group__multiset.html                          |   546 +-
 html/group__recipes__test.html                     |    83 +-
 html/group__test.html                              |   831 +-
 html/group__test__simulate.html                    |   873 +-
 html/group__vimos__calib__impl.html                |   125 +-
 html/group__vimos__science__impl.html              |    81 +-
 html/index.hhc                                     |  1781 +-
 html/index.hhk                                     |  2475 +-
 html/index.hhp                                     |   318 +-
 html/index.html                                    |    68 +-
 html/jquery.js                                     |     8 +
 html/list-test_8c-source.html                      |   182 -
 html/list-test_8c_source.html                      |   221 +
 html/list_8c-source.html                           |   952 -
 html/list_8c_source.html                           |   991 +
 html/list_8h-source.html                           |   479 -
 html/list_8h_source.html                           |   518 +
 html/list__void_8h-source.html                     |   178 -
 html/list__void_8h_source.html                     |   217 +
 html/modules.html                                  |   170 +-
 html/montecarlo_8c-source.html                     |   456 -
 html/montecarlo_8c_source.html                     |   495 +
 html/moses_8c-source.html                          | 16473 ---------
 html/moses_8c_source.html                          | 16717 +++++++++
 html/moses_8h-source.html                          |   223 -
 html/moses_8h_source.html                          |   276 +
 html/nav_f.png                                     |   Bin 0 -> 153 bytes
 html/nav_g.png                                     |   Bin 0 -> 108 bytes
 html/nav_h.png                                     |   Bin 0 -> 98 bytes
 html/open.png                                      |   Bin 0 -> 123 bytes
 html/recipes-test_8c-source.html                   |    60 -
 html/recipes-test_8c_source.html                   |    99 +
 html/recipes_2fors__extract_8c-source.html         |  1720 -
 html/recipes_2fors__extract_8c_source.html         |  1759 +
 html/struct__FORS__PAF__.html                      |   132 +-
 html/struct__FORS__PAF__RECORD__.html              |   143 +-
 html/struct__extract__method.html                  |   153 +-
 html/struct__fors__cpl__wcs__.html                 |   120 +-
 html/struct__fors__image.html                      |   114 +-
 html/struct__fors__pattern.html                    |   141 +-
 html/struct__fors__point.html                      |   111 +-
 html/struct__fors__setting.html                    |   183 +-
 html/struct__fors__star.html                       |   171 +-
 html/struct__fors__std__star.html                  |   171 +-
 html/struct__identify__method.html                 |   138 +-
 html/struct__stack__method.html                    |   173 +-
 html/structband__jacobian.html                     |   117 +-
 html/structentry.html                              |   150 +-
 html/structfors__extract__sky__stats.html          |   117 +-
 html/structfors__filterlist.html                   |   111 +-
 html/structfors__fit__ncoeff__paropts.html         |   126 +-
 html/structlist.html                               |   138 +-
 html/sync_off.png                                  |   Bin 0 -> 853 bytes
 html/sync_on.png                                   |   Bin 0 -> 845 bytes
 html/tab_a.png                                     |   Bin 0 -> 142 bytes
 html/tab_b.gif                                     |   Bin 35 -> 0 bytes
 html/tab_b.png                                     |   Bin 0 -> 169 bytes
 html/tab_h.png                                     |   Bin 0 -> 177 bytes
 html/tab_l.gif                                     |   Bin 706 -> 0 bytes
 html/tab_r.gif                                     |   Bin 2585 -> 0 bytes
 html/tab_s.png                                     |   Bin 0 -> 184 bytes
 html/tabs.css                                      |   130 +-
 html/test_8c-source.html                           |   406 -
 html/test_8c_source.html                           |   445 +
 html/test_8h-source.html                           |   141 -
 html/test_8h_source.html                           |   180 +
 html/test__hough_8c-source.html                    |   289 -
 html/test__hough_8c_source.html                    |   328 +
 html/test__simulate_8c-source.html                 |   530 -
 html/test__simulate_8c_source.html                 |   569 +
 html/test__simulate_8h-source.html                 |    82 -
 html/test__simulate_8h_source.html                 |   121 +
 html/vimos__calib_8c-source.html                   |   517 -
 html/vimos__calib_8c_source.html                   |   556 +
 html/vimos__calib__impl_8c-source.html             |  2156 --
 html/vimos__calib__impl_8c_source.html             |  2195 ++
 html/vimos__calib__impl_8h-source.html             |    61 -
 html/vimos__calib__impl_8h_source.html             |   100 +
 html/vimos__science_8c-source.html                 |  1128 -
 html/vimos__science_8c_source.html                 |  1167 +
 html/vimos__science__impl_8c-source.html           |  1459 -
 html/vimos__science__impl_8c_source.html           |  1498 +
 html/vimos__science__impl_8h-source.html           |    61 -
 html/vimos__science__impl_8h_source.html           |   100 +
 irplib/Makefile.am                                 |     6 +-
 irplib/Makefile.in                                 |   508 +-
 irplib/irplib_calib.c                              |    58 +-
 irplib/irplib_calib.h                              |     6 +-
 irplib/irplib_cat.c                                |     6 +-
 irplib/irplib_cat.h                                |     6 +-
 irplib/irplib_distortion.c                         |    12 +-
 irplib/irplib_distortion.h                         |    12 +-
 irplib/irplib_flat.c                               |     6 +-
 irplib/irplib_flat.h                               |     6 +-
 irplib/irplib_framelist.c                          |    24 +-
 irplib/irplib_framelist.h                          |     6 +-
 irplib/irplib_hist.c                               |    12 +-
 irplib/irplib_hist.h                               |     6 +-
 irplib/irplib_ksigma_clip.c                        |     6 +-
 irplib/irplib_ksigma_clip.h                        |     6 +-
 irplib/irplib_ksigma_clip_body.h                   |     6 +-
 irplib/irplib_match_cats.c                         |     6 +-
 irplib/irplib_match_cats.h                         |     6 +-
 irplib/irplib_mkmaster.c                           |    12 +-
 irplib/irplib_mkmaster.h                           |     6 +-
 irplib/irplib_oddeven.c                            |     6 +-
 irplib/irplib_oddeven.h                            |     6 +-
 irplib/irplib_plugin.c                             |    19 +-
 irplib/irplib_plugin.h                             |     6 +-
 irplib/irplib_polynomial.c                         |    12 +-
 irplib/irplib_polynomial.h                         |    12 +-
 irplib/irplib_ppm.c                                |     6 +-
 irplib/irplib_ppm.h                                |     6 +-
 irplib/irplib_slitpos.c                            |    12 +-
 irplib/irplib_slitpos.h                            |     6 +-
 irplib/irplib_spectrum.c                           |     6 +-
 irplib/irplib_spectrum.h                           |     6 +-
 irplib/irplib_stdstar.c                            |   553 +-
 irplib/irplib_stdstar.h                            |    26 +-
 irplib/irplib_strehl.c                             |     6 +-
 irplib/irplib_strehl.h                             |     6 +-
 irplib/irplib_utils.c                              |   248 +-
 irplib/irplib_utils.h                              |   106 +-
 irplib/irplib_wavecal.c                            |     6 +-
 irplib/irplib_wavecal.h                            |     6 +-
 irplib/irplib_wavecal_impl.h                       |     6 +-
 irplib/irplib_wcs.c                                |     6 +-
 irplib/irplib_wcs.h                                |     6 +-
 irplib/irplib_wlxcorr.c                            |    12 +-
 irplib/irplib_wlxcorr.h                            |    12 +-
 irplib/tests/Makefile.am                           |    38 +-
 irplib/tests/Makefile.in                           |   518 +-
 irplib/tests/irplib_cat-test.c                     |    12 +-
 irplib/tests/irplib_polynomial-test.c              |    12 +-
 irplib/tests/irplib_utils-test.c                   |    40 +
 irplib/tests/irplib_wcs-test.c                     |    12 +-
 irplib/tests/irplib_wlxcorr-test.c                 |    12 +-
 m4macros/gsl.m4                                    |    23 +
 m4macros/libtool.m4                                |  7986 +++++
 m4macros/ltoptions.m4                              |   384 +
 m4macros/ltsugar.m4                                |   123 +
 m4macros/ltversion.m4                              |    23 +
 m4macros/lt~obsolete.m4                            |    98 +
 mosca/Makefile.am                                  |     2 +-
 mosca/Makefile.in                                  |   405 +-
 mosca/libmosca/Makefile.am                         |    70 +-
 mosca/libmosca/Makefile.in                         |   682 +-
 mosca/libmosca/detected_slit.cpp                   |   172 +
 mosca/libmosca/detected_slit.h                     |   128 +
 mosca/libmosca/detected_slits.cpp                  |   102 +
 .../libmosca/{image_smooth.h => detected_slits.h}  |    28 +-
 mosca/libmosca/flat_combine.h                      |    59 +
 mosca/libmosca/flat_combine.tcc                    |   277 +
 mosca/libmosca/hdrl_bpm.c                          |   198 +
 .../irplib_spectrum.h => mosca/libmosca/hdrl_bpm.h |    55 +-
 mosca/libmosca/hdrl_collapse.c                     |  1229 +
 mosca/libmosca/hdrl_collapse.h                     |   131 +
 mosca/libmosca/hdrl_combine.c                      |   189 +
 mosca/libmosca/hdrl_combine.h                      |    69 +
 mosca/libmosca/hdrl_elemop.c                       |   671 +
 mosca/libmosca/hdrl_elemop.h                       |   207 +
 mosca/libmosca/hdrl_flat.c                         |   735 +
 mosca/libmosca/hdrl_flat.h                         |    71 +
 mosca/libmosca/hdrl_image.c                        |   421 +
 mosca/libmosca/hdrl_image.h                        |   100 +
 .../libmosca/{image_smooth.h => hdrl_image_defs.h} |    33 +-
 mosca/libmosca/hdrl_image_math.c                   |   323 +
 mosca/libmosca/hdrl_image_math.h                   |    56 +
 .../libmosca/hdrl_imagelist.h                      |    61 +-
 mosca/libmosca/hdrl_imagelist_basic.c              |   562 +
 mosca/libmosca/hdrl_imagelist_basic.h              |    83 +
 mosca/libmosca/hdrl_imagelist_basic_body.h         |    83 +
 .../libmosca/hdrl_imagelist_defs.h                 |    41 +-
 mosca/libmosca/hdrl_imagelist_io.c                 |   567 +
 mosca/libmosca/hdrl_imagelist_io.h                 |    79 +
 mosca/libmosca/hdrl_imagelist_view.c               |   137 +
 .../libmosca/hdrl_imagelist_view.h                 |    36 +-
 mosca/libmosca/hdrl_iter.c                         |   211 +
 mosca/libmosca/hdrl_iter.h                         |    91 +
 mosca/libmosca/hdrl_overscan.c                     |  1282 +
 mosca/libmosca/hdrl_overscan.h                     |   145 +
 mosca/libmosca/hdrl_parameter.c                    |   161 +
 mosca/libmosca/hdrl_parameter.h                    |   110 +
 mosca/libmosca/hdrl_prototyping.c                  |  1287 +
 mosca/libmosca/hdrl_prototyping.h                  |    68 +
 mosca/libmosca/hdrl_sigclip.c                      |   576 +
 mosca/libmosca/hdrl_sigclip.h                      |    81 +
 .../irplib_flat.h => mosca/libmosca/hdrl_types.h   |    33 +-
 mosca/libmosca/hdrl_utils.c                        |  1043 +
 mosca/libmosca/hdrl_utils.h                        |   197 +
 mosca/libmosca/image_smooth.cpp                    |    35 +-
 mosca/libmosca/image_smooth.h                      |    21 +-
 .../{image_smooth.h => image_spline_fit.h}         |    24 +-
 mosca/libmosca/image_spline_fit.tcc                |   219 +
 mosca/libmosca/{image_smooth.h => image_utils.h}   |    28 +-
 mosca/libmosca/image_utils.tcc                     |   157 +
 mosca/libmosca/mosca_image.cpp                     |    95 +-
 mosca/libmosca/mosca_image.h                       |    40 +-
 mosca/libmosca/mosca_image.tcc                     |    58 +-
 mosca/libmosca/reduce_method.cpp                   |    68 +
 mosca/libmosca/reduce_method.h                     |   104 +
 mosca/libmosca/tests/Makefile.am                   |    47 +
 mosca/libmosca/tests/Makefile.in                   |   704 +
 mosca/libmosca/tests/flat_combine-test.cpp         |    89 +
 mosca/libmosca/tests/image_smooth-test.cpp         |   372 +
 mosca/libmosca/tests/test_driver                   |     6 +
 mosca/libmosca/type_traits.h                       |    10 +-
 mosca/libmosca/{image_smooth.h => vector_utils.h}  |    31 +-
 mosca/libmosca/vector_utils.tcc                    |    90 +
 mosca/libmosca/wavelength_calibration.cpp          |   178 +
 mosca/libmosca/wavelength_calibration.h            |    71 +
 recipes/Makefile.am                                |   143 +-
 recipes/Makefile.in                                |   900 +-
 recipes/fors_align_sky.c                           |    10 +-
 recipes/fors_align_sky_lss.c                       |    14 +-
 recipes/fors_bias.c                                |     6 +-
 recipes/{fors_calib.c => fors_calib.cc}            |  2310 +-
 recipes/fors_config.c                              |    12 +-
 recipes/fors_dark.c                                |     6 +-
 recipes/fors_detect_objects.c                      |     6 +-
 recipes/fors_detect_spectra.c                      |    18 +-
 recipes/fors_extract.c                             |    10 +-
 recipes/fors_extract_objects.c                     |     6 +-
 recipes/fors_extract_slits.c                       |    11 +-
 recipes/fors_flat.c                                |   388 -
 recipes/fors_flat.cc                               |   586 +
 recipes/fors_flatfield.c                           |     6 +-
 recipes/fors_img_science.c                         |     6 +-
 recipes/fors_img_screen_flat.c                     |     6 +-
 recipes/fors_img_sky_flat.c                        |     6 +-
 recipes/fors_normalise_flat.c                      |   105 +-
 recipes/fors_photometry.c                          |     6 +-
 recipes/fors_pmos_calib.c                          |    21 +-
 recipes/fors_pmos_extract.c                        |    14 +-
 recipes/fors_pmos_science.c                        |    10 +-
 recipes/fors_remove_bias.c                         |     6 +-
 recipes/fors_resample.c                            |    11 +-
 recipes/fors_science.c                             |   155 +-
 recipes/fors_subtract_sky.c                        |     6 +-
 recipes/fors_subtract_sky_lss.c                    |    10 +-
 recipes/fors_sumflux.c                             |     6 +-
 recipes/fors_trace_flat.c                          |    16 +-
 recipes/fors_wave_calib.c                          |    17 +-
 recipes/fors_wave_calib_lss.c                      |    12 +-
 recipes/fors_zeropoint.c                           |     6 +-
 recipes/montecarlo.c                               |     6 +-
 recipes/test_hough.c                               |     6 +-
 recipes/tests/Makefile.in                          |   413 +-
 recipes/tests/recipes-test.c                       |     6 +-
 reflex/ForsSpec.xml.in                             |  4349 ++-
 reflex/Makefile.am                                 |     2 +-
 reflex/Makefile.in                                 |   284 +-
 reflex/fors_calib_interact.py                      |   233 +
 reflex/fors_plot_common.py                         |   210 +
 reflex/fors_science_interact.py                    |   155 +
 setup                                              |     4 +-
 sextractor/Makefile.in                             |   487 +-
 sextractor/aclocal.m4                              |   656 +-
 sextractor/autoconf/depcomp                        |   343 +-
 sextractor/autoconf/install-sh                     |   538 +-
 sextractor/autoconf/missing                        |   234 +-
 sextractor/config.h.in                             |    15 +-
 sextractor/configure                               |  9588 +++--
 sextractor/configure.ac                            |     2 -
 sextractor/man/Makefile.in                         |   163 +-
 sextractor/src/Makefile.in                         |   428 +-
 sextractor/src/fits/Makefile.in                    |   234 +-
 sextractor/src/wcs/Makefile.in                     |   234 +-
 sextractor/src/wcs/cel.c                           |     2 +-
 sextractor/src/wcs/cel.h                           |     2 +-
 sextractor/src/wcs/lin.c                           |     2 +-
 sextractor/src/wcs/lin.h                           |     2 +-
 sextractor/src/wcs/proj.c                          |     2 +-
 sextractor/src/wcs/proj.h                          |     2 +-
 sextractor/src/wcs/sph.c                           |     2 +-
 sextractor/src/wcs/sph.h                           |     2 +-
 sextractor/src/wcs/wcs.c                           |     2 +-
 sextractor/src/wcs/wcs.h                           |     2 +-
 sextractor/src/wcs/wcsmath.h                       |     2 +-
 sextractor/src/wcs/wcstrig.c                       |     2 +-
 sextractor/src/wcs/wcstrig.h                       |     2 +-
 703 files changed, 177869 insertions(+), 148012 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 032e8cd..38db0a0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,7 +17,7 @@
 ##   along with this program; if not, write to the Free Software
 ##   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-AUTOMAKE_OPTIONS = 1.8 foreign
+AUTOMAKE_OPTIONS = 1.8 foreign 
 
 ACLOCAL_AMFLAGS = -I m4macros
 
diff --git a/Makefile.in b/Makefile.in
index b1b6e4e..9bc109f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,29 @@
 
 @SET_MAKE@
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -39,57 +53,129 @@ host_triplet = @host@
 target_triplet = @target@
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/Makefile.purify.in \
-	$(srcdir)/config.h.in $(top_srcdir)/admin/html.am \
-	$(top_srcdir)/configure $(top_srcdir)/doxygen/Doxyfile.in \
-	AUTHORS COPYING ChangeLog INSTALL NEWS TODO admin/config.guess \
-	admin/config.sub admin/depcomp admin/install-sh \
-	admin/ltmain.sh admin/missing
+	$(srcdir)/config.h.in $(top_srcdir)/admin/compile \
+	$(top_srcdir)/admin/config.guess \
+	$(top_srcdir)/admin/config.sub $(top_srcdir)/admin/html.am \
+	$(top_srcdir)/admin/install-sh $(top_srcdir)/admin/ltmain.sh \
+	$(top_srcdir)/admin/missing $(top_srcdir)/configure \
+	$(top_srcdir)/doxygen/Doxyfile.in AUTHORS COPYING ChangeLog \
+	INSTALL NEWS TODO admin/compile admin/config.guess \
+	admin/config.sub admin/install-sh admin/ltmain.sh \
+	admin/missing
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
-	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/purify.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
+ configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES = doxygen/Doxyfile Makefile.purify
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
-	install-exec-recursive install-info-recursive \
-	install-recursive installcheck-recursive installdirs-recursive \
-	pdf-recursive ps-recursive uninstall-info-recursive \
-	uninstall-recursive
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pipedocsdir)"
-pipedocsDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(pipedocs_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	cscope distdir dist dist-all distcheck
 ETAGS = etags
 CTAGS = ctags
+CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d $(distdir) \
-    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr $(distdir); }; }
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
@@ -114,16 +200,17 @@ CX_LDFLAGS = @CX_LDFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOXYGEN = @DOXYGEN@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 FORS_BINARY_AGE = @FORS_BINARY_AGE@
 FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
 FORS_INCLUDES = @FORS_INCLUDES@
@@ -133,12 +220,17 @@ FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
 FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
 FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
 FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
 LATEX = @LATEX@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBCEXT = @LIBCEXT@
 LIBCFITSIO = @LIBCFITSIO@
@@ -154,48 +246,52 @@ LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 LT_AGE = @LT_AGE@
 LT_CURRENT = @LT_CURRENT@
 LT_REVISION = @LT_REVISION@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
 MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
-ONLINE_MODE_FALSE = @ONLINE_MODE_FALSE@
-ONLINE_MODE_TRUE = @ONLINE_MODE_TRUE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PURIFY_CMD = @PURIFY_CMD@
-PURIFY_FALSE = @PURIFY_FALSE@
-PURIFY_TRUE = @PURIFY_TRUE@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 all_includes = @all_includes@
 all_ldflags = @all_ldflags@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -207,8 +303,12 @@ build_alias = @build_alias@
 build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
+builddir = @builddir@
 configdir = @configdir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -221,17 +321,21 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 pipedocsdir = @pipedocsdir@
 plugindir = @plugindir@
 prefix = @prefix@
 privatelibdir = @privatelibdir@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target = @target@
@@ -239,9 +343,12 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 wkfcopydir = @wkfcopydir@
 wkfextradir = @wkfextradir@
-AUTOMAKE_OPTIONS = 1.8 foreign
+AUTOMAKE_OPTIONS = 1.8 foreign 
 ACLOCAL_AMFLAGS = -I m4macros
 DISTCLEANFILES = *~
 SUBDIRS = irplib sextractor mosca fors recipes reflex
@@ -262,21 +369,21 @@ all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-am--refresh:
+am--refresh: Makefile
 	@:
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/admin/html.am $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
-	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
 		&& exit 0; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -287,26 +394,26 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
 	esac;
+$(top_srcdir)/admin/html.am:
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	$(SHELL) ./config.status --recheck
 
 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(srcdir) && $(AUTOCONF)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then \
-	  rm -f stamp-h1; \
-	  $(MAKE) stamp-h1; \
-	else :; fi
+	@if test ! -f $@; then rm -f stamp-h1; else :; fi
+	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
 	cd $(top_builddir) && $(SHELL) ./config.status config.h
 $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
-	cd $(top_srcdir) && $(AUTOHEADER)
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
 	rm -f stamp-h1
 	touch $@
 
@@ -324,34 +431,37 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 distclean-libtool:
-	-rm -f libtool
-uninstall-info-am:
+	-rm -f libtool config.lt
 install-pipedocsDATA: $(pipedocs_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(pipedocsdir)" || $(mkdir_p) "$(DESTDIR)$(pipedocsdir)"
-	@list='$(pipedocs_DATA)'; for p in $$list; do \
+	@list='$(pipedocs_DATA)'; test -n "$(pipedocsdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pipedocsdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pipedocsdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(pipedocsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pipedocsdir)/$$f'"; \
-	  $(pipedocsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pipedocsdir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pipedocsdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pipedocsdir)" || exit $$?; \
 	done
 
 uninstall-pipedocsDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(pipedocs_DATA)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(pipedocsdir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(pipedocsdir)/$$f"; \
-	done
+	@list='$(pipedocs_DATA)'; test -n "$(pipedocsdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(pipedocsdir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@failcom='exit 1'; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
 	  case $$f in \
 	    *=* | --[!k]*);; \
@@ -360,7 +470,11 @@ $(RECURSIVE_TARGETS):
 	done; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -368,51 +482,23 @@ $(RECURSIVE_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-	@failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
 	done
 ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -420,14 +506,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
@@ -439,85 +525,125 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test ! -f $$subdir/TAGS || \
-	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscope: cscope.files
+	test ! -s cscope.files \
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+
+clean-cscope:
+	-rm -f cscope.files
+
+cscope.files: clean-cscope cscopelist-recursive cscopelist
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 @MAINTAINER_MODE_FALSE at dist-hook:
 
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
-	mkdir $(distdir)
-	$(mkdir_p) $(distdir)/. $(distdir)/admin $(distdir)/doxygen $(distdir)/m4macros $(distdir)/reflex
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	test -d "$(distdir)" || mkdir "$(distdir)"
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(mkdir_p) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	    distdir=`$(am__cd) $(distdir) && pwd`; \
-	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
-	    (cd $$subdir && \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
 	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$top_distdir" \
-	        distdir="$$distdir/$$subdir" \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
 	        distdir) \
 	      || exit 1; \
 	  fi; \
@@ -525,35 +651,45 @@ distdir: $(DISTFILES)
 	$(MAKE) $(AM_MAKEFLAGS) \
 	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
 	  dist-hook
-	-find $(distdir) -type d ! -perm -755 -exec chmod a+rwx,go+rx {} \; -o \
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -755 \
+		-exec chmod u+rwx,go+rx {} \; -o \
 	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
 	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
-	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
-	|| chmod -R a+r $(distdir)
+	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
-	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
-	$(am__remove_distdir)
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__post_remove_distdir)
+
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	$(am__post_remove_distdir)
+
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-shar: distdir
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-zip: distdir
 	-rm -f $(distdir).zip
 	zip -rq $(distdir).zip $(distdir)
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
-dist dist-all: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+dist dist-all:
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+	$(am__post_remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
@@ -561,24 +697,31 @@ dist dist-all: distdir
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
-	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	chmod -R a-w $(distdir); chmod u+w $(distdir)
 	mkdir $(distdir)/_build
 	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-	  && cd $(distdir)/_build \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -599,14 +742,24 @@ distcheck: dist
 	  && rm -rf "$$dc_destdir" \
 	  && $(MAKE) $(AM_MAKEFLAGS) dist \
 	  && rm -rf $(DIST_ARCHIVES) \
-	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
-	$(am__remove_distdir)
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
+	$(am__post_remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
-	  sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@cd $(distuninstallcheck_dir) \
-	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
 	          echo "  (check DESTDIR support)"; \
@@ -628,7 +781,7 @@ all-am: Makefile $(DATA) config.h
 installdirs: installdirs-recursive
 installdirs-am:
 	for dir in "$(DESTDIR)$(pipedocsdir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-recursive
 install-exec: install-exec-recursive
@@ -640,16 +793,22 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
@@ -672,18 +831,34 @@ dvi-am:
 
 html: html-recursive
 
+ at MAINTAINER_MODE_FALSE@html-am:
+
 info: info-recursive
 
 info-am:
 
 install-data-am: install-pipedocsDATA
 
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
 install-exec-am:
 
 install-info: install-info-recursive
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -704,26 +879,29 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-local uninstall-pipedocsDATA
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
-	check-am clean clean-generic clean-libtool clean-local \
-	clean-recursive ctags ctags-recursive dist dist-all dist-bzip2 \
-	dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \
-	distclean distclean-generic distclean-hdr distclean-libtool \
-	distclean-recursive distclean-tags distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-exec \
-	install-exec-am install-info install-info-am install-man \
-	install-pipedocsDATA install-strip installcheck \
+uninstall-am: uninstall-local uninstall-pipedocsDATA
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-cscope \
+	clean-generic clean-libtool clean-local cscope cscopelist \
+	cscopelist-recursive ctags ctags-recursive dist dist-all \
+	dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar dist-tarZ \
+	dist-xz dist-zip distcheck distclean distclean-generic \
+	distclean-hdr distclean-libtool distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-pipedocsDATA \
+	install-ps install-ps-am install-strip installcheck \
 	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic maintainer-clean-recursive \
-	mostlyclean mostlyclean-generic mostlyclean-libtool \
-	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am uninstall-info-am uninstall-local \
-	uninstall-pipedocsDATA
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-local uninstall-pipedocsDATA
 
 
 @MAINTAINER_MODE_TRUE at clean-local: clean-html
@@ -807,6 +985,7 @@ $(HTML_RECURSIVE_TARGETS):
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/Makefile.purify.in b/Makefile.purify.in
index 77a6e8f..d9e8a3a 100644
--- a/Makefile.purify.in
+++ b/Makefile.purify.in
@@ -1,7 +1,7 @@
 #*******************************************************************************
 # E.S.O. - VLT project
 #
-# "@(#) $Id: Makefile.purify.in,v 1.1 2007/10/15 16:01:55 jmlarsen Exp $"
+# "@(#) $Id: Makefile.purify.in,v 1.1 2007-10-15 16:01:55 jmlarsen Exp $"
 #
 # Makefile of Pipeline subsystem.
 #
diff --git a/acinclude.m4 b/acinclude.m4
index ddeeab8..69e77e8 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -220,7 +220,7 @@ AC_DEFUN([FORS_CREATE_SYMBOLS],
     AC_REQUIRE([CPL_CHECK_LIBS])
     AC_REQUIRE([ESO_CHECK_EXTRA_LIBS])
 
-    all_includes='$(FORS_INCLUDES) $(CPL_INCLUDES) $(CX_INCLUDES) $(IRPLIB_INCLUDES) $(MOSCA_INCLUDES) $(EXTRA_INCLUDES)'
+    all_includes='$(FORS_INCLUDES) $(MOSCA_INCLUDES) $(CPL_INCLUDES) $(CX_INCLUDES) $(IRPLIB_INCLUDES) $(EXTRA_INCLUDES)'
     all_ldflags='$(FORS_LDFLAGS) $(CPL_LDFLAGS) $(CX_LDFLAGS) $(EXTRA_LDFLAGS)'
 
     AC_SUBST(all_includes)
diff --git a/aclocal.m4 b/aclocal.m4
index 64a54d9..cae1a64 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6445 +1,275 @@
-# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005  Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-
-# serial 48 AC_PROG_LIBTOOL
-
-
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
-         [],
-         [m4_define([AC_PROVIDE_IFELSE],
-	         [m4_ifdef([AC_PROVIDE_$1],
-		           [$2], [$3])])])
-
-
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
-  AC_PROVIDE_IFELSE([AC_PROG_CXX],
-    [AC_LIBTOOL_CXX],
-    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
-  ])])
-dnl And a similar setup for Fortran 77 support
-  AC_PROVIDE_IFELSE([AC_PROG_F77],
-    [AC_LIBTOOL_F77],
-    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
-  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-    [AC_LIBTOOL_GCJ],
-    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-      [AC_LIBTOOL_GCJ],
-      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
-	[AC_LIBTOOL_GCJ],
-      [ifdef([AC_PROG_GCJ],
-	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([A][M_PROG_GCJ],
-	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([LT_AC_PROG_GCJ],
-	     [define([LT_AC_PROG_GCJ],
-		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
-
-
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
-
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
-
-# Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    AC_PATH_MAGIC
-  fi
-  ;;
-esac
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE([libtool-lock],
-    [AC_HELP_STRING([--disable-libtool-lock],
-	[avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-AC_ARG_WITH([pic],
-    [AC_HELP_STRING([--with-pic],
-	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
-    [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
-
-
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-AC_DEFUN([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_LINKER_BOILERPLATE
-
-
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
-
-
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
-	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-	 [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
-
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-[$]*
-EOF
-  exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
-       echo_test_string=`eval $cmd` &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
-
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
-    IFS="$lt_save_ifs"
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-	 test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-	 test "X$echo_testing_string" = "X$echo_test_string"; then
-	# Cool, printf works
-	:
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	export CONFIG_SHELL
-	SHELL="$CONFIG_SHELL"
-	export SHELL
-	echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      else
-	# maybe with a smaller string...
-	prev=:
-
-	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-	  then
-	    break
-	  fi
-	  prev="$cmd"
-	done
-
-	if test "$prev" != 'sed 50q "[$]0"'; then
-	  echo_test_string=`eval $prev`
-	  export echo_test_string
-	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-	else
-	  # Oops.  We lost completely, so just stick with echo.
-	  echo=echo
-	fi
-      fi
-    fi
-  fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
-
-
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-    [AC_HELP_STRING([--disable-libtool-lock],
-	[avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *ELF-32*)
-      HPUX_IA64_MODE="32"
-      ;;
-    *ELF-64*)
-      HPUX_IA64_MODE="64"
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-   if test "$lt_cv_prog_gnu_ld" = yes; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -melf32bsmip"
-      ;;
-    *N32*)
-      LD="${LD-ld} -melf32bmipn32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -melf64bmip"
-      ;;
-    esac
-   else
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
-   fi
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *32-bit*)
-      case $host in
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_i386"
-          ;;
-        ppc64-*linux*|powerpc64-*linux*)
-          LD="${LD-ld} -m elf32ppclinux"
-          ;;
-        s390x-*linux*)
-          LD="${LD-ld} -m elf_s390"
-          ;;
-        sparc64-*linux*)
-          LD="${LD-ld} -m elf32_sparc"
-          ;;
-      esac
-      ;;
-    *64-bit*)
-      case $host in
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          LD="${LD-ld} -m elf64_s390"
-          ;;
-        sparc*-*linux*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_PUSH(C)
-     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-sparc*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
-      *)    LD="${LD-ld} -64" ;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-  ])
-esac
-
-need_locks="$enable_libtool_lock"
-
-])# _LT_AC_LOCK
-
-
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $rm conftest*
-])
-
-if test x"[$]$2" = xyes; then
-    ifelse([$5], , :, [$5])
-else
-    ifelse([$6], , :, [$6])
-fi
-])# AC_LIBTOOL_COMPILER_OPTION
-
-
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                          [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $3"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
-    ifelse([$4], , :, [$4])
-else
-    ifelse([$5], , :, [$5])
-fi
-])# AC_LIBTOOL_LINKER_OPTION
-
-
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
-  i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    # If test is not a shell built-in, we'll probably end up computing a
-    # maximum length that is only half of the actual maximum length, but
-    # we can't tell.
-    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
-	       = "XX$teststring") >/dev/null 2>&1 &&
-	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
-	    lt_cv_sys_max_cmd_len=$new_result &&
-	    test $i != 17 # 1/2 MB should be enough
-    do
-      i=`expr $i + 1`
-      teststring=$teststring$teststring
-    done
-    teststring=
-    # Add a significant safety factor because C++ compilers can tack on massive
-    # amounts of additional arguments before passing them to the linker.
-    # It appears as though 1/2 is a usable value.
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    ;;
-  esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
-  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
-  AC_MSG_RESULT(none)
-fi
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
-
-
-# _LT_AC_CHECK_DLFCN
-# ------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
-
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ---------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-    exit (status);
-}]
-EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_dlunknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-
-# AC_LIBTOOL_DLOPEN_SELF
-# ----------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ])
-   ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
-	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen="dlopen"],
-	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
-	      ])
-	    ])
-	  ])
-	])
-      ])
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-	  lt_cv_dlopen_self, [dnl
-	  _LT_AC_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-    	  lt_cv_dlopen_self_static, [dnl
-	  _LT_AC_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
-
-
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-     fi
-   fi
-   chmod u+w . 2>&AS_MESSAGE_LOG_FD
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-])
-])# AC_LIBTOOL_PROG_CC_C_O
-
-
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
-# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
-
-hard_links="nottested"
-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
-
-
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-])# AC_LIBTOOL_OBJDIR
-
-
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
-# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
-   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
-   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_AC_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
-
-
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         AC_MSG_RESULT([yes])
-       else
-  AC_MSG_RESULT([no])
-fi
-       ;;
-   *)
-  AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
-
-
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix4* | aix5*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[[45]]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[[123]]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
-  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  freebsd*) # from 4.6 on
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix3*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # find out which ABI we are using
-  libsuff=
-  case "$host_cpu" in
-  x86_64*|s390x*|powerpc64*)
-    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-    if AC_TRY_EVAL(ac_compile); then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  esac
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
-    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
-        [include additional configurations @<:@automatic@:>@])],
-    [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
-  if test ! -f "${ofile}"; then
-    AC_MSG_WARN([output file `$ofile' does not exist])
-  fi
-
-  if test -z "$LTCC"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
-    if test -z "$LTCC"; then
-      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
-    else
-      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
-    fi
-  fi
-  if test -z "$LTCFLAGS"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
-  fi
-
-  # Extract list of available tagged configurations in $ofile.
-  # Note that this assumes the entire list is on one line.
-  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
-  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-  for tagname in $tagnames; do
-    IFS="$lt_save_ifs"
-    # Check whether tagname contains only valid characters
-    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
-    "") ;;
-    *)  AC_MSG_ERROR([invalid tag name: $tagname])
-	;;
-    esac
-
-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
-    then
-      AC_MSG_ERROR([tag name \"$tagname\" already exists])
-    fi
-
-    # Update the list of available tags.
-    if test -n "$tagname"; then
-      echo appending configuration tag \"$tagname\" to $ofile
-
-      case $tagname in
-      CXX)
-	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-	    (test "X$CXX" != "Xg++"))) ; then
-	  AC_LIBTOOL_LANG_CXX_CONFIG
-	else
-	  tagname=""
-	fi
-	;;
-
-      F77)
-	if test -n "$F77" && test "X$F77" != "Xno"; then
-	  AC_LIBTOOL_LANG_F77_CONFIG
-	else
-	  tagname=""
-	fi
-	;;
-
-      GCJ)
-	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-	  AC_LIBTOOL_LANG_GCJ_CONFIG
-	else
-	  tagname=""
-	fi
-	;;
-
-      RC)
-	AC_LIBTOOL_LANG_RC_CONFIG
-	;;
-
-      *)
-	AC_MSG_ERROR([Unsupported tag name: $tagname])
-	;;
-      esac
-
-      # Append the new tag name to the list of available tags.
-      if test -n "$tagname" ; then
-      available_tags="$available_tags $tagname"
-    fi
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  # Now substitute the updated list of available tags.
-  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
-    mv "${ofile}T" "$ofile"
-    chmod +x "$ofile"
-  else
-    rm -f "${ofile}T"
-    AC_MSG_ERROR([unable to update list of available tagged configurations.])
-  fi
-fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
-    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-# set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
-    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
-    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
-
-# AC_LIBTOOL_PICMODE([MODE])
-# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
-   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="ifelse([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
-else
-  AC_MSG_RESULT(no)
-fi
-])# AC_PATH_TOOL_PREFIX
-
-
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])# AC_PATH_MAGIC
-
-
-# AC_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
-    [AC_HELP_STRING([--with-gnu-ld],
-	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
-    [with_gnu_ld=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
-
-
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
-
-
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files],
-  lt_cv_ld_reload_flag,
-  [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-])# AC_PROG_LD_RELOAD_FLAG
-
-
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[[45]]*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | kfreebsd*-gnu | dragonfly*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix3*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be Linux ELF.
-linux*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-nto-qnx*)
-  lt_cv_deplibs_check_method=unknown
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-])# AC_DEPLIBS_CHECK_METHOD
-
-
-# AC_PROG_NM
-# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
-
-
-# AC_CHECK_LIBM
-# -------------
-# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
-  # These system don't have libm, or don't need it
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
-  ;;
-esac
-])# AC_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!).  If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  case $enable_ltdl_convenience in
-  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
-  "") enable_ltdl_convenience=yes
-      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
-  esac
-  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
-  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  AC_CHECK_LIB(ltdl, lt_dlinit,
-  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
-  [if test x"$enable_ltdl_install" = xno; then
-     AC_MSG_WARN([libltdl not installed, but installation disabled])
-   else
-     enable_ltdl_install=yes
-   fi
-  ])
-  if test x"$enable_ltdl_install" = x"yes"; then
-    ac_configure_args="$ac_configure_args --enable-ltdl-install"
-    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
-    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  else
-    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
-    LIBLTDL="-lltdl"
-    LTDLINCL=
-  fi
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ------------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
-    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
-      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
-	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
-	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# -------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF
-
-# Report which library types will actually be built
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-
-aix4* | aix5*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-    ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
-  $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
-  lt_cv_path_LD=$lt_cv_path_LDCXX
-else
-  $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
-  # Set up default GNU C++ configuration
-
-  AC_PROG_LD
-
-  # Check if GNU C++ uses GNU ld as the underlying linker, since the
-  # archiving commands below assume that GNU ld is being used.
-  if test "$with_gnu_ld" = yes; then
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-    #     investigate it a little bit more. (MM)
-    wlarc='${wl}'
-
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
-	grep 'no-whole-archive' > /dev/null; then
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    with_gnu_ld=no
-    wlarc=
-
-    # A generic and very simple default shared library creation
-    # command for GNU C++ for the case where it uses the native
-    # linker, instead of GNU ld.  If possible, this setting should
-    # overridden to take advantage of the native linker features on
-    # the platform it is being used on.
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-  fi
-
-  # Commands to make compiler produce verbose output that lists
-  # what "hidden" libraries, object files and flags are used when
-  # linking a shared library.
-  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
-  GXX=no
-  with_gnu_ld=no
-  wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
-  aix3*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  aix4* | aix5*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
-
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
-	for ld_flag in $LDFLAGS; do
-	  case $ld_flag in
-	  *-brtl*)
-	    aix_use_runtimelinking=yes
-	    break
-	    ;;
-	  esac
-	done
-	;;
-      esac
-
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
-
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-    _LT_AC_TAGVAR(archive_cmds, $1)=''
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-    if test "$GXX" = yes; then
-      case $host_os in aix4.[[012]]|aix4.[[012]].*)
-      # We only want to do this on AIX 4.2 and lower, the check
-      # below for broken collect2 doesn't work under 4.3+
-	collect2name=`${CC} -print-prog-name=collect2`
-	if test -f "$collect2name" && \
-	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	then
-	  # We have reworked collect2
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-	else
-	  # We have old collect2
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-	fi
-	;;
-      esac
-      shared_flag='-shared'
-      if test "$aix_use_runtimelinking" = yes; then
-	shared_flag="$shared_flag "'${wl}-G'
-      fi
-    else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	shared_flag='-G'
-      else
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag='${wl}-G'
-	else
-	  shared_flag='${wl}-bM:SRE'
-	fi
-      fi
-    fi
-
-    # It seems that -bexpall does not export symbols beginning with
-    # underscore (_), so it is better to generate a list of symbols to export.
-    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-      # Determine the default libpath from the value encoded in an empty executable.
-      _LT_AC_SYS_LIBPATH_AIX
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-     else
-      if test "$host_cpu" = ia64; then
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-      else
-	# Determine the default libpath from the value encoded in an empty executable.
-	_LT_AC_SYS_LIBPATH_AIX
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	# Warning - without using the other run time loading flags,
-	# -berok will link without error, but may produce a broken library.
-	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	# Exported symbols can be pulled into shared objects from archives
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	# This is similar to how AIX traditionally builds its shared libraries.
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-      fi
-    fi
-    ;;
-
-  beos*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-      # support --undefined.  This deserves some investigation.  FIXME
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-    ;;
-
-  chorus*)
-    case $cc_basename in
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-    # as there is no search path for DLLs.
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-    _LT_AC_TAGVAR(always_export_symbols, $1)=no
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      # If the export-symbols file already is a .def file (1st line
-      # is EXPORTS), use it as is; otherwise, prepend...
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	cp $export_symbols $output_objdir/$soname.def;
-      else
-	echo EXPORTS > $output_objdir/$soname.def;
-	cat $export_symbols >> $output_objdir/$soname.def;
-      fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-  ;;
-      darwin* | rhapsody*)
-        case $host_os in
-        rhapsody* | darwin1.[[012]])
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[[012]])
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-        esac
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-    if test "$GXX" = yes ; then
-      lt_int_apple_cc_single_mod=no
-      output_verbose_link_cmd='echo'
-      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
-       lt_int_apple_cc_single_mod=yes
-      fi
-      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      else
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-        fi
-        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          else
-            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          fi
-            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-      fi
-        ;;
-
-  dgux*)
-    case $cc_basename in
-      ec++*)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      ghcx*)
-	# Green Hills C++ Compiler
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  freebsd[[12]]*)
-    # C++ shared libraries reported to be fairly broken before switch to ELF
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  freebsd-elf*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    ;;
-  freebsd* | kfreebsd*-gnu | dragonfly*)
-    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-    # conventions
-    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-    ;;
-  gnu*)
-    ;;
-  hpux9*)
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-				# but as the default
-				# location of the library.
-
-    case $cc_basename in
-    CC*)
-      # FIXME: insert proper C++ library support
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    aCC*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      #
-      # There doesn't appear to be a way to prevent this compiler from
-      # explicitly linking system object files so we need to strip them
-      # from the output so that they don't get included in the library
-      # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-      ;;
-    *)
-      if test "$GXX" = yes; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-        # FIXME: insert proper C++ library support
-        _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-    ;;
-  hpux10*|hpux11*)
-    if test $with_gnu_ld = no; then
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-      case $host_cpu in
-      hppa*64*|ia64*)
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-        ;;
-      *)
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        ;;
-      esac
-    fi
-    case $host_cpu in
-    hppa*64*|ia64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-    *)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-					      # but as the default
-					      # location of the library.
-      ;;
-    esac
-
-    case $cc_basename in
-      CC*)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      aCC*)
-	case $host_cpu in
-	hppa*64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	esac
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test $with_gnu_ld = no; then
-	    case $host_cpu in
-	    hppa*64*)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    ia64*)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    *)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    esac
-	  fi
-	else
-	  # FIXME: insert proper C++ library support
-	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-    esac
-    ;;
-  interix3*)
-    _LT_AC_TAGVAR(hardcode_direct, $1)=no
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-    # Instead, shared libraries are loaded at an image base (0x10000000 by
-    # default) and relocated if they conflict, which is a slow very memory
-    # consuming and fragmenting process.  To avoid this, we pick a random,
-    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    ;;
-  irix5* | irix6*)
-    case $cc_basename in
-      CC*)
-	# SGI C++
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	# Archives containing C++ object files must be created using
-	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test "$with_gnu_ld" = no; then
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	  else
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
-	  fi
-	fi
-	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-	;;
-    esac
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    ;;
-  linux*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-	;;
-      icpc*)
-	# Intel C++
-	with_gnu_ld=yes
-	# version 8.0 and above of icpc choke on multiply defined symbols
-	# if we add $predep_objects and $postdep_objects, however 7.1 and
-	# earlier do not add the objects themselves.
-	case `$CC -V 2>&1` in
-	*"Version 7."*)
-  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	*)  # Version 8.0 or newer
-	  tmp_idyn=
-	  case $host_cpu in
-	    ia64*) tmp_idyn=' -i_dynamic';;
-	  esac
-  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	esac
-	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	;;
-      pgCC*)
-        # Portland Group C++ compiler
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-        ;;
-      cxx*)
-	# Compaq C++
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-	runpath_var=LD_RUN_PATH
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-    esac
-    ;;
-  lynxos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  m88k*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  mvs*)
-    case $cc_basename in
-      cxx*)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    fi
-    # Workaround some broken pre-1.5 toolchains
-    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-    ;;
-  openbsd2*)
-    # C++ shared libraries are fairly broken
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  openbsd*)
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    fi
-    output_verbose_link_cmd='echo'
-    ;;
-  osf3*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      cxx*)
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-	else
-	  # FIXME: insert proper C++ library support
-	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-    esac
-    ;;
-  osf4* | osf5*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Archives containing C++ object files must be created using
-	# the KAI C++ compiler.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      cxx*)
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	  echo "-hidden">> $lib.exp~
-	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
-	  $rm $lib.exp'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-	else
-	  # FIXME: insert proper C++ library support
-	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-    esac
-    ;;
-  psos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  sunos4*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.x
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      lcc*)
-	# Lucid
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  solaris*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.2, 5.x and Centerline C++
-        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
-	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-	case $host_os in
-	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-	  *)
-	    # The C++ compiler is used as linker so we must use $wl
-	    # flag to pass the commands to the underlying system
-	    # linker. We must also pass each convience library through
-	    # to the system linker between allextract/defaultextract.
-	    # The C++ compiler will combine linker options so we
-	    # cannot just pass the convience library names through
-	    # without $wl.
-	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
-	    ;;
-	esac
-	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-	output_verbose_link_cmd='echo'
-
-	# Archives containing C++ object files must be created using
-	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	;;
-      gcx*)
-	# Green Hills C++ Compiler
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-	# The C++ compiler must be used to create the archive.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	;;
-      *)
-	# GNU C++ compiler with Solaris linker
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-	  if $CC --version | grep -v '^2\.7' > /dev/null; then
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  else
-	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	    # platform.
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  fi
-
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-	fi
-	;;
-    esac
-    ;;
-  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    runpath_var='LD_RUN_PATH'
-
-    case $cc_basename in
-      CC*)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  sysv5* | sco3.2v5* | sco5v6*)
-    # Note: We can NOT use -z defs as we might desire, because we do not
-    # link with -lc, and that would cause any symbols used from libc to
-    # always be unresolved, which means just about no library would
-    # ever link correctly.  If we're not using GNU ld we use -z text
-    # though, which does catch some bad symbols but isn't as heavy-handed
-    # as -z defs.
-    # For security reasons, it is highly recommended that you always
-    # use absolute paths for naming shared libraries, and exclude the
-    # DT_RUNPATH tag from executables and libraries.  But doing so
-    # requires that you compile everything twice, which is a pain.
-    # So that behaviour is only enabled if SCOABSPATH is set to a
-    # non-empty value in the environment.  Most likely only useful for
-    # creating official distributions of packages.
-    # This is a hack until libtool officially supports absolute path
-    # names for shared libraries.
-    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-    runpath_var='LD_RUN_PATH'
-
-    case $cc_basename in
-      CC*)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  tandem*)
-    case $cc_basename in
-      NCC*)
-	# NonStop-UX NCC 3.20
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  *)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library.  It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  # The `*' in the case matches for architectures that use `case' in
-  # $output_verbose_cmd can trigger glob expansion during the loop
-  # eval without this substitution.
-  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
-  for p in `eval $output_verbose_link_cmd`; do
-    case $p in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" \
-	  || test $p = "-R"; then
-	 prev=$p
-	 continue
-       else
-	 prev=
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-	   else
-	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
-	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
-	 else
-	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
-	 fi
-       fi
-       ;;
-
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
-	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
-	 else
-	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
-	 fi
-       else
-	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
-	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
-	 else
-	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
-	 fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-interix3*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  _LT_AC_TAGVAR(predep_objects,$1)=
-  _LT_AC_TAGVAR(postdep_objects,$1)=
-  _LT_AC_TAGVAR(postdeps,$1)=
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC*)
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
-    ;;
-  esac
-  ;;
-esac
-])
-
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="      program t\n      end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-aix4* | aix5*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# -------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars.  Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    _LT_AC_TAGVAR(compiler, $1) \
-    _LT_AC_TAGVAR(CC, $1) \
-    _LT_AC_TAGVAR(LD, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
-    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
-    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
-    _LT_AC_TAGVAR(old_archive_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
-    _LT_AC_TAGVAR(predep_objects, $1) \
-    _LT_AC_TAGVAR(postdep_objects, $1) \
-    _LT_AC_TAGVAR(predeps, $1) \
-    _LT_AC_TAGVAR(postdeps, $1) \
-    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
-    _LT_AC_TAGVAR(archive_cmds, $1) \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(postinstall_cmds, $1) \
-    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
-    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
-    _LT_AC_TAGVAR(no_undefined_flag, $1) \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
-    _LT_AC_TAGVAR(hardcode_automatic, $1) \
-    _LT_AC_TAGVAR(module_cmds, $1) \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
-    _LT_AC_TAGVAR(exclude_expsyms, $1) \
-    _LT_AC_TAGVAR(include_expsyms, $1); do
-
-    case $var in
-    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(module_cmds, $1) | \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\[$]0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
-    ;;
-  esac
-
-ifelse([$1], [],
-  [cfgfile="${ofile}T"
-  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
-  $rm -f "$cfgfile"
-  AC_MSG_NOTICE([creating $ofile])],
-  [cfgfile="$ofile"])
-
-  cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
-  case $host_os in
-  aix3*)
-    cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-EOF
-    ;;
-  esac
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
-  mv -f "$cfgfile" "$ofile" || \
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-])
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
-    lt_cv_prog_compiler_rtti_exceptions,
-    [-fno-rtti -fno-exceptions], [],
-    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*) # Its linker distinguishes data from code symbols
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDEGRST]]'
-  fi
-  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  ;;
-linux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDGIRSTW]]'
-    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
-  ;;
-solaris*)
-  symcode='[[BDRT]]'
-  ;;
-sco3.2v5*)
-  symcode='[[DT]]'
-  ;;
-sysv4.2uw2*)
-  symcode='[[DT]]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[[ABDT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-	mv -f "$nlist"T "$nlist"
-      else
-	rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if grep ' nm_test_var$' "$nlist" >/dev/null; then
-	if grep ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
-	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
-	  cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
-  const char *name;
-  lt_ptr_t address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
-	  cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
-	  # Now try linking the two files.
-	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
-	  LIBS="conftstm.$ac_objext"
-	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
-	    pipe_works=yes
-	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
-	else
-	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
-	fi
-      else
-	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
-    fi
-  else
-    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
-    cat conftest.$ac_ext >&5
-  fi
-  rm -f conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-      ;;
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | os2* | pw32*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-      ;;
-    interix3*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	;;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix4* | aix5*)
-	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
-	  # AIX 5 now supports IA64 processor
-	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	else
-	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-	fi
-	;;
-      chorus*)
-	case $cc_basename in
-	cxch68*)
-	  # Green Hills C++ Compiler
-	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-	  ;;
-	esac
-	;;
-       darwin*)
-         # PIC is the default on this platform
-         # Common symbols not allowed in MH_DYLIB files
-         case $cc_basename in
-           xlc*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           ;;
-         esac
-       ;;
-      dgux*)
-	case $cc_basename in
-	  ec++*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  ghcx*)
-	    # Green Hills C++ Compiler
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      freebsd* | kfreebsd*-gnu | dragonfly*)
-	# FreeBSD uses GNU C++
-	;;
-      hpux9* | hpux10* | hpux11*)
-	case $cc_basename in
-	  CC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
-	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	    fi
-	    ;;
-	  aCC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    case $host_cpu in
-	    hppa*64*|ia64*)
-	      # +Z the default
-	      ;;
-	    *)
-	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	      ;;
-	    esac
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      interix*)
-	# This is c89, which is MS Visual C++ (no shared libs)
-	# Anyone wants to do a port?
-	;;
-      irix5* | irix6* | nonstopux*)
-	case $cc_basename in
-	  CC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    # CC pic flag -KPIC is the default.
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      linux*)
-	case $cc_basename in
-	  KCC*)
-	    # KAI C++ Compiler
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    ;;
-	  icpc* | ecpc*)
-	    # Intel C++
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	    ;;
-	  pgCC*)
-	    # Portland Group C++ compiler.
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  cxx*)
-	    # Compaq C++
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      lynxos*)
-	;;
-      m88k*)
-	;;
-      mvs*)
-	case $cc_basename in
-	  cxx*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      netbsd*)
-	;;
-      osf3* | osf4* | osf5*)
-	case $cc_basename in
-	  KCC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    ;;
-	  RCC*)
-	    # Rational C++ 2.4.1
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  cxx*)
-	    # Digital/Compaq C++
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      psos*)
-	;;
-      solaris*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	    ;;
-	  gcx*)
-	    # Green Hills C++ Compiler
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sunos4*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.x
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  lcc*)
-	    # Lucid
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      tandem*)
-	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	esac
-	;;
-      vxworks*)
-	;;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-	;;
-    esac
-  fi
-],
-[
-  if test "$GCC" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-      ;;
-
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-
-    interix3*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    newsos6)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    linux*)
-      case $cc_basename in
-      icc* | ecc*)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      esac
-      ;;
-
-    osf3* | osf4* | osf5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    solaris*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    unicos*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-
-    uts4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
-    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
-    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
-    ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
-  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
-  $lt_tmp_static_flag,
-  [],
-  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-])
-
-
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
-# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix4* | aix5*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-  ;;
-  cygwin* | mingw*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  *)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-],[
-  runpath_var=
-  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_AC_TAGVAR(archive_cmds, $1)=
-  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
-  _LT_AC_TAGVAR(module_cmds, $1)=
-  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(always_export_symbols, $1)=no
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_AC_TAGVAR(include_expsyms, $1)=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  _LT_CC_BASENAME([$compiler])
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-      fi
-      ;;
-
-    amigaos*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-      # as there is no search path for DLLs.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=no
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    interix3*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	tmp_addflag=
-	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-	if test $supports_anon_versioning = yes; then
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
-	  else
-	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-
-    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
-      runpath_var=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
-
-    aix4* | aix5*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-	else
-	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
-	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      _LT_AC_TAGVAR(archive_cmds, $1)=''
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[[012]]|aix4.[[012]].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	  then
-  	  # We have reworked collect2
-  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-	  else
-  	  # We have old collect2
-  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       _LT_AC_SYS_LIBPATH_AIX
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-	if test "$host_cpu" = ia64; then
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 _LT_AC_SYS_LIBPATH_AIX
-	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      # see comment about different semantics on the GNU ld section
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    bsdi[[45]]*)
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
-      # FIXME: Should let the user specify the lib program.
-      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      ;;
-
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[[012]])
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[[012]])
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-    fi
-      ;;
-
-    dgux*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    freebsd1*)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-	  ;;
-	*)
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 
-    newsos6)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-    openbsd*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      else
-       case $host_os in
-	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	   ;;
-	 *)
-	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	   ;;
-       esac
-      fi
-      ;;
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
 
-    os2*)
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+# 
+# Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
 
-    osf3*)
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
 
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      else
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
 
-	# Both c and cxx compiler support -rpath directly
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes ],
+		     [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
 
-    solaris*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-	wlarc=''
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
-      esac
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
 
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
-    sysv4)
-      case $host_vendor in
-	sni)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-        ;;
-	motorola)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
 
-    sysv4.3*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
 
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
+if test $pkg_failed = yes; then
+   	AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+        else 
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
+	m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
 
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
+$$1_PKG_ERRORS
 
-    uts4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
 
-    *)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-  fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+_PKG_TEXT])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+     	AC_MSG_RESULT([no])
+	m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_AC_TAGVAR(archive_cmds, $1) in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
-        then
-	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-        else
-	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-        fi
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
-      ;;
-    esac
-  fi
-  ;;
-esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
-
-
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# #  ifdef __CYGWIN32__
-# #    define __CYGWIN__ __CYGWIN32__
-# #  endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-#   __hDllInstance_base = hInst;
-#   return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
-
-
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
-
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
-  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-  AC_SUBST(GCJFLAGS)
-])
+_PKG_TEXT
 
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
-])
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	$3
+fi[]dnl
+])# PKG_CHECK_MODULES
 
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
-    done
-  done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
-  fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])
 
-# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 8
+
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
 # generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.12'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.12.2], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
 
 # AM_SET_CURRENT_AUTOMAKE_VERSION
 # -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-	 [AM_AUTOMAKE_VERSION([1.9.6])])
+[AM_AUTOMAKE_VERSION([1.12.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 2
+
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
 #
 # Of course, Automake must honor this variable whenever it calls a
 # tool from the auxiliary directory.  The problem is that $srcdir (and
@@ -6458,7 +288,7 @@ AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
 #
 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
 # are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
+# harmless because $srcdir is '.', but things will broke when you
 # start a VPATH build or use an absolute $srcdir.
 #
 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -6484,24 +314,26 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
+# serial 10
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
 AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
 if $2; then
   $1_TRUE=
   $1_FALSE='#'
@@ -6515,17 +347,15 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
+# serial 17
 
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
 # will think it sees a *use*, and therefore will trigger all it's
 # C support machinery.  Also note that it means that autoscan, seeing
@@ -6535,7 +365,7 @@ fi])])
 # _AM_DEPENDENCIES(NAME)
 # ----------------------
 # See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
 # We try a few techniques and use that to set a single cache variable.
 #
 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -6548,11 +378,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 AC_REQUIRE([AM_DEP_TRACK])dnl
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
 
 AC_CACHE_CHECK([dependency style of $depcc],
                [am_cv_$1_dependencies_compiler_type],
@@ -6560,8 +392,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -6579,6 +412,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
   fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -6590,34 +433,49 @@ AC_CACHE_CHECK([dependency style of $depcc],
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -6650,7 +508,7 @@ AM_CONDITIONAL([am__fastdep$1], [
 # AM_SET_DEPDIR
 # -------------
 # Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
 AC_DEFUN([AM_SET_DEPDIR],
 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -6660,69 +518,86 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 # AM_DEP_TRACK
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 3
+# serial 6
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
 
@@ -6731,7 +606,7 @@ done
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
 # This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
+# is enabled.  FIXME.  This creates each '.P' file that we will
 # need in order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
@@ -6740,43 +615,41 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 ])
 
 
-# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
+# serial 6
 
 AC_DEFUN([AM_WITH_DMALLOC],
 [AC_MSG_CHECKING([if malloc debugging is wanted])
-AC_ARG_WITH(dmalloc,
-[  --with-dmalloc          use dmalloc, as in
-			  http://www.dmalloc.com/dmalloc.tar.gz],
+AC_ARG_WITH([dmalloc],
+[AS_HELP_STRING([--with-dmalloc],
+                [use dmalloc, as in http://www.dmalloc.com])],
 [if test "$withval" = yes; then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(WITH_DMALLOC,1,
+  AC_MSG_RESULT([yes])
+  AC_DEFINE([WITH_DMALLOC], [1],
 	    [Define if using the dmalloc debugging malloc package])
   LIBS="$LIBS -ldmalloc"
   LDFLAGS="$LDFLAGS -g"
 else
-  AC_MSG_RESULT(no)
-fi], [AC_MSG_RESULT(no)])
+  AC_MSG_RESULT([no])
+fi], [AC_MSG_RESULT([no])])
 ])
 
 AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC])
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 12
+# serial 19
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
@@ -6793,16 +666,20 @@ AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC])
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
+[AC_PREREQ([2.62])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
 AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
 fi
 
 # test whether we have cygpath
@@ -6818,48 +695,85 @@ AC_SUBST([CYGPATH_W])
 # Define the identity of the package.
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+[AC_DIAGNOSE([obsolete],
+[$0: two- and three-arguments forms are deprecated.  For more info, see:
+http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
 [_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
 _AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
 
 # Some tools Automake needs.
 AC_REQUIRE([AM_SANITY_CHECK])dnl
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-	      		     [_AM_PROG_TAR([v7])])])
+	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+			     [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-                  [_AM_DEPENDENCIES(CC)],
-                  [define([AC_PROG_CC],
-                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+		  [_AM_DEPENDENCIES([CC])],
+		  [m4_define([AC_PROG_CC],
+			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                  [_AM_DEPENDENCIES(CXX)],
-                  [define([AC_PROG_CXX],
-                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+		  [_AM_DEPENDENCIES([CXX])],
+		  [m4_define([AC_PROG_CXX],
+			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+		  [_AM_DEPENDENCIES([OBJC])],
+		  [m4_define([AC_PROG_OBJC],
+			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+dnl Support for Objective C++ was only introduced in Autoconf 2.65,
+dnl but we still cater to Autoconf 2.62.
+m4_ifdef([AC_PROG_OBJCXX],
+[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+		  [_AM_DEPENDENCIES([OBJCXX])],
+		  [m4_define([AC_PROG_OBJCXX],
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
 ])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
 
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
@@ -6870,32 +784,42 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
 # our stamp files there.
 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
 [# Compute $1's index in $config_headers.
+_am_arg=$1
 _am_stamp_count=1
 for _am_header in $config_headers :; do
   case $_am_header in
-    $1 | $1:* )
+    $_am_arg | $_am_arg:* )
       break ;;
     * )
       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
   esac
 done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 8
+
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST([install_sh])])
 
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -6919,27 +843,38 @@ AC_SUBST([am__leading_dot])])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 7
 
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
 AC_DEFUN([AM_MAINTAINER_MODE],
-[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
-  dnl maintainer-mode is disabled by default
-  AC_ARG_ENABLE(maintainer-mode,
-[  --enable-maintainer-mode  enable make rules and dependencies not useful
-			  (and sometimes confusing) to the casual installer],
-      USE_MAINTAINER_MODE=$enableval,
-      USE_MAINTAINER_MODE=no)
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t at _MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+      am_maintainer_other[ make rules and dependencies not useful
+      (and sometimes confusing) to the casual installer])],
+    [USE_MAINTAINER_MODE=$enableval],
+    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
-  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
   MAINT=$MAINTAINER_MODE_TRUE
-  AC_SUBST(MAINT)dnl
+  AC_SUBST([MAINT])dnl
 ]
 )
 
@@ -6947,13 +882,13 @@ AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
+# serial 5
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -6962,7 +897,7 @@ AC_DEFUN([AM_MAKE_INCLUDE],
 [am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
@@ -6972,24 +907,24 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 AC_SUBST([am__include])
 AC_SUBST([am__quote])
@@ -6997,13 +932,13 @@ AC_MSG_RESULT([$_am_result])
 rm -f confinc confmf
 ])
 
-# Copyright (C) 1999, 2000, 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
+# serial 6
 
 # AM_PROG_CC_C_O
 # --------------
@@ -7011,11 +946,13 @@ rm -f confinc confmf
 AC_DEFUN([AM_PROG_CC_C_O],
 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
 # FIXME: we rely on the cache variable name because
 # there is no other way.
 set dummy $CC
-ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
    # Losing compiler, so override with the script.
    # FIXME: It is wrong to rewrite CC.
    # But if we don't then we get into trouble of one sort or another.
@@ -7023,18 +960,21 @@ if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
    # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
    CC="$am_aux_dir/compile $CC"
 fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
 ])
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 7
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -7050,88 +990,33 @@ AC_SUBST($1)])
 # If it does, set am_missing_run to use it, otherwise, to nothing.
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+  AC_MSG_WARN(['missing' script is too old or missing])
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake.  There are at least two reasons why we must not
-# use `-m 0755':
-#   - it causes special bits like SGID to be ignored,
-#   - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out.  Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
-AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However this is wrong
-  # for two reasons:
-  #  1. if the package is installed by a user who cannot write `.'
-  #     make install will fail,
-  #  2. the above comment should most certainly read
-  #     $(mkdir_p) $(DESTDIR)$(somedir)
-  #     so it does not work when $(somedir) is undefined and
-  #     $(DESTDIR) is not.
-  #  To support the latter case, we have to write
-  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
-  #  so the `.' trick is pointless.
-  mkdir_p='mkdir -p --'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
-  else
-    mkdir_p='$(install_sh) -d'
-  fi
-fi
-AC_SUBST([mkdir_p])])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
+# serial 6
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -7139,16 +1024,16 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
 # -------------------------------------------
@@ -7158,45 +1043,62 @@ AC_DEFUN([_AM_IF_OPTION],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 9
 
 # AM_SANITY_CHECK
 # ---------------
 AC_DEFUN([AM_SANITY_CHECK],
 [AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$[*]" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
+	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment])
+     fi
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$[2]" = conftest.file
    )
 then
@@ -7206,50 +1108,87 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 2
+
 # AM_PROG_INSTALL_STRIP
 # ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# One issue with vendor 'install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
 # is unlikely to handle the host's binaries.
 # Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
+# always use install-sh in "make install-strip", and initialize
 # STRIPPROG with the value of the STRIP variable (set by the user).
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
 if test "$cross_compiling" != no; then
   AC_CHECK_TOOL([STRIP], [strip], :)
 fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
+# Copyright (C) 2006-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
+# serial 3
 
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
 #
 # Substitute a variable $(am__tar) that is a command
 # writing to stdout a FORMAT-tarball containing the directory
@@ -7260,10 +1199,11 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
 m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
      [m4_case([$1], [ustar],, [pax],,
               [m4_fatal([Unknown tar format])])
 AC_MSG_CHECKING([how to create a $1 tar archive])
@@ -7271,7 +1211,7 @@ AC_MSG_CHECKING([how to create a $1 tar archive])
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
 # Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
+# Solaris sh will not grok spaces in the rhs of '-'.
 for _am_tool in $_am_tools
 do
   case $_am_tool in
@@ -7334,5 +1274,11 @@ AC_SUBST([am__untar])
 
 m4_include([m4macros/cpl.m4])
 m4_include([m4macros/eso.m4])
+m4_include([m4macros/gsl.m4])
+m4_include([m4macros/libtool.m4])
+m4_include([m4macros/ltoptions.m4])
+m4_include([m4macros/ltsugar.m4])
+m4_include([m4macros/ltversion.m4])
+m4_include([m4macros/lt~obsolete.m4])
 m4_include([m4macros/purify.m4])
 m4_include([acinclude.m4])
diff --git a/admin/compile b/admin/compile
new file mode 100755
index 0000000..7b4a9a7
--- /dev/null
+++ b/admin/compile
@@ -0,0 +1,342 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-03-05.13; # UTC
+
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/admin/config.guess b/admin/config.guess
index 917bbc5..c0adba9 100755
--- a/admin/config.guess
+++ b/admin/config.guess
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2005-07-08'
+timestamp='2012-06-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -16,9 +17,7 @@ timestamp='2005-07-08'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -26,16 +25,16 @@ timestamp='2005-07-08'
 # the same distribution terms that you use for the rest of that program.
 
 
-# Originally written by Per Bothner <per at bothner.com>.
-# Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Originally written by Per Bothner.  Please send patches (context
+# diff format) to <config-patches at gnu.org> and include a ChangeLog
+# entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
 # exits with 0.  Otherwise, it exits with 1.
 #
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -55,7 +54,8 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -106,7 +106,7 @@ set_cc_for_build='
 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 : ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -143,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 	# switched to ELF, *-*-netbsd* would select the old
 	# object file format.  This provides both forward
@@ -160,6 +160,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
@@ -168,7 +169,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-			| grep __ELF__ >/dev/null
+			| grep -q __ELF__
 		then
 		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
 		    # Return netbsd for either.  FIX?
@@ -178,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		fi
 		;;
 	    *)
-	        os=netbsd
+		os=netbsd
 		;;
 	esac
 	# The OS release
@@ -206,8 +207,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:ekkoBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
 	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
     macppc:MirBSD:*:*)
-	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
 	exit ;;
     *:MirBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
@@ -218,7 +222,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
 		;;
 	*5.*)
-	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 		;;
 	esac
 	# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -264,7 +268,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit ;;
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+	exitcode=$?
+	trap '' 0
+	exit $exitcode ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
@@ -290,7 +297,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo s390-ibm-zvmoe
 	exit ;;
     *:OS400:*:*)
-        echo powerpc-ibm-os400
+	echo powerpc-ibm-os400
 	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
@@ -319,14 +326,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	case `/usr/bin/uname -p` in
 	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
     sun4H:SunOS:5.*:*)
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
-    i86pc:SunOS:5.*:*)
-	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+	echo i386-pc-auroraux${UNAME_RELEASE}
+	exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	eval $set_cc_for_build
+	SUN_ARCH="i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH="x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
@@ -370,23 +396,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+	exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-milan-mint${UNAME_RELEASE}
+	exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-hades-mint${UNAME_RELEASE}
+	exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-unknown-mint${UNAME_RELEASE}
+	exit ;;
     m68k:machten:*:*)
 	echo m68k-apple-machten${UNAME_RELEASE}
 	exit ;;
@@ -456,8 +482,8 @@ EOF
 	echo m88k-motorola-sysv3
 	exit ;;
     AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	# DG/UX returns AViiON for all architectures
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
 	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 	then
 	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -470,7 +496,7 @@ EOF
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit ;;
+	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
 	exit ;;
@@ -527,7 +553,7 @@ EOF
 		echo rs6000-ibm-aix3.2
 	fi
 	exit ;;
-    *:AIX:*:[45])
+    *:AIX:*:[4567])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
@@ -570,52 +596,52 @@ EOF
 	    9000/[678][0-9][0-9])
 		if [ -x /usr/bin/getconf ]; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
+		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+		    case "${sc_cpu_version}" in
+		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+		      532)                      # CPU_PA_RISC2_0
+			case "${sc_kernel_bits}" in
+			  32) HP_ARCH="hppa2.0n" ;;
+			  64) HP_ARCH="hppa2.0w" ;;
 			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
+			esac ;;
+		    esac
 		fi
 		if [ "${HP_ARCH}" = "" ]; then
 		    eval $set_cc_for_build
-		    sed 's/^              //' << EOF >$dummy.c
+		    sed 's/^		//' << EOF >$dummy.c
 
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
+		#define _HPUX_SOURCE
+		#include <stdlib.h>
+		#include <unistd.h>
 
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
+		int main ()
+		{
+		#if defined(_SC_KERNEL_BITS)
+		    long bits = sysconf(_SC_KERNEL_BITS);
+		#endif
+		    long cpu  = sysconf (_SC_CPU_VERSION);
 
-                  switch (cpu)
-              	{
-              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-              	case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-              	    switch (bits)
-              		{
-              		case 64: puts ("hppa2.0w"); break;
-              		case 32: puts ("hppa2.0n"); break;
-              		default: puts ("hppa2.0"); break;
-              		} break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-              	    puts ("hppa2.0"); break;
-              #endif
-              	default: puts ("hppa1.0"); break;
-              	}
-                  exit (0);
-              }
+		    switch (cpu)
+			{
+			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+			case CPU_PA_RISC2_0:
+		#if defined(_SC_KERNEL_BITS)
+			    switch (bits)
+				{
+				case 64: puts ("hppa2.0w"); break;
+				case 32: puts ("hppa2.0n"); break;
+				default: puts ("hppa2.0"); break;
+				} break;
+		#else  /* !defined(_SC_KERNEL_BITS) */
+			    puts ("hppa2.0"); break;
+		#endif
+			default: puts ("hppa1.0"); break;
+			}
+		    exit (0);
+		}
 EOF
 		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -635,7 +661,7 @@ EOF
 	    # => hppa64-hp-hpux11.23
 
 	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-		grep __LP64__ >/dev/null
+		grep -q __LP64__
 	    then
 		HP_ARCH="hppa2.0w"
 	    else
@@ -706,22 +732,22 @@ EOF
 	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit ;;
+	exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-        exit ;;
+	exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit ;;
+	exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit ;;
+	exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit ;;
+	exit ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
@@ -745,14 +771,14 @@ EOF
 	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
     5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -764,27 +790,48 @@ EOF
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 	exit ;;
     *:FreeBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
+	case ${UNAME_PROCESSOR} in
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
 	exit ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit ;;
-    i*:MINGW*:*)
+    *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
+    i*:MSYS*:*)
+	echo ${UNAME_MACHINE}-pc-msys
+	exit ;;
     i*:windows32*:*)
-    	# uname -m includes "-pc" on this system.
-    	echo ${UNAME_MACHINE}-mingw32
+	# uname -m includes "-pc" on this system.
+	echo ${UNAME_MACHINE}-mingw32
 	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit ;;
-    x86:Interix*:[34]*)
-	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-	exit ;;
+    *:Interix*:*)
+	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    authenticamd | genuineintel | EM64T)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	    IA64)
+		echo ia64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 	echo i${UNAME_MACHINE}-pc-mks
 	exit ;;
+    8664:Windows_NT:*)
+	echo x86_64-pc-mks
+	exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -794,7 +841,7 @@ EOF
     i*:UWIN*:*)
 	echo ${UNAME_MACHINE}-pc-uwin
 	exit ;;
-    amd64:CYGWIN*:*:*)
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
 	echo x86_64-unknown-cygwin
 	exit ;;
     p*:CYGWIN*:*)
@@ -814,17 +861,68 @@ EOF
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
+    aarch64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    aarch64_be:Linux:*:*)
+	UNAME_MACHINE=aarch64_be
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+	esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
     arm*:Linux:*:*)
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_EABI__
+	then
+	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	else
+	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+		| grep -q __ARM_PCS_VFP
+	    then
+		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	    else
+		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+	    fi
+	fi
+	exit ;;
+    avr32*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     cris:Linux:*:*)
-	echo cris-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-gnu
 	exit ;;
     crisv32:Linux:*:*)
-	echo crisv32-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-gnu
 	exit ;;
     frv:Linux:*:*)
-    	echo frv-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    hexagon:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    i*86:Linux:*:*)
+	LIBC=gnu
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
 	exit ;;
     ia64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -835,63 +933,33 @@ EOF
     m68*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
-    mips:Linux:*:*)
+    mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
 	#undef CPU
-	#undef mips
-	#undef mipsel
+	#undef ${UNAME_MACHINE}
+	#undef ${UNAME_MACHINE}el
 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=mipsel
+	CPU=${UNAME_MACHINE}el
 	#else
 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=mips
+	CPU=${UNAME_MACHINE}
 	#else
 	CPU=
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
-    mips64:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#undef CPU
-	#undef mips64
-	#undef mips64el
-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=mips64el
-	#else
-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=mips64
-	#else
-	CPU=
-	#endif
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-	;;
-    ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+    or32:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
-    ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-gnu
 	exit ;;
-    alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-	  EV5)   UNAME_MACHINE=alphaev5 ;;
-	  EV56)  UNAME_MACHINE=alphaev56 ;;
-	  PCA56) UNAME_MACHINE=alphapca56 ;;
-	  PCA57) UNAME_MACHINE=alphapca56 ;;
-	  EV6)   UNAME_MACHINE=alphaev6 ;;
-	  EV67)  UNAME_MACHINE=alphaev67 ;;
-	  EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
@@ -901,14 +969,17 @@ EOF
 	  *)    echo hppa-unknown-linux-gnu ;;
 	esac
 	exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux
 	exit ;;
     sh64*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
     sh*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -916,68 +987,18 @@ EOF
     sparc:Linux:*:* | sparc64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
+    tile*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    xtensa*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
-    i*86:Linux:*:*)
-	# The BFD linker knows what the default object file format is, so
-	# first see if it will tell us. cd to the root directory to prevent
-	# problems with other programs or directories called `ld' in the path.
-	# Set LC_ALL=C to ensure ld outputs messages in English.
-	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
-			 | sed -ne '/supported targets:/!d
-				    s/[ 	][ 	]*/ /g
-				    s/.*supported targets: *//
-				    s/ .*//
-				    p'`
-        case "$ld_supported_targets" in
-	  elf32-i386)
-		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-		;;
-	  a.out-i386-linux)
-		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-		exit ;;
-	  coff-i386)
-		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-		exit ;;
-	  "")
-		# Either a pre-BFD a.out linker (linux-gnuoldld) or
-		# one that does not give us useful --help.
-		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-		exit ;;
-	esac
-	# Determine whether the default compiler is a.out or elf
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#include <features.h>
-	#ifdef __ELF__
-	# ifdef __GLIBC__
-	#  if __GLIBC__ >= 2
-	LIBC=gnu
-	#  else
-	LIBC=gnulibc1
-	#  endif
-	# else
-	LIBC=gnulibc1
-	# endif
-	#else
-	#ifdef __INTEL_COMPILER
-	LIBC=gnu
-	#else
-	LIBC=gnuaout
-	#endif
-	#endif
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-	test x"${LIBC}" != x && {
-		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-		exit
-	}
-	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
-	;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 	# earlier versions are messed up and put the nodename in both
@@ -985,11 +1006,11 @@ EOF
 	echo i386-sequent-sysv4
 	exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
+	# Unixware is an offshoot of SVR4, but it has its own version
+	# number series starting with 2...
+	# I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
+	# Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 	exit ;;
     i*86:OS/2:*:*)
@@ -1006,7 +1027,7 @@ EOF
     i*86:syllable:*:*)
 	echo ${UNAME_MACHINE}-pc-syllable
 	exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
 	echo i386-unknown-lynxos${UNAME_RELEASE}
 	exit ;;
     i*86:*DOS:*:*)
@@ -1021,7 +1042,7 @@ EOF
 	fi
 	exit ;;
     i*86:*:5:[678]*)
-    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
@@ -1049,10 +1070,13 @@ EOF
 	exit ;;
     pc:*:*:*)
 	# Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-	echo i386-pc-msdosdjgpp
-        exit ;;
+	# uname -m prints for DJGPP always 'pc', but it prints nothing about
+	# the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
+	exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
 	exit ;;
@@ -1087,8 +1111,18 @@ EOF
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL='.3'
+	test -r /etc/.relid \
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
 	exit ;;
@@ -1101,7 +1135,7 @@ EOF
     rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
 	exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
 	echo powerpc-unknown-lynxos${UNAME_RELEASE}
 	exit ;;
     SM[BE]S:UNIX_SV:*:*)
@@ -1121,10 +1155,10 @@ EOF
 		echo ns32k-sni-sysv
 	fi
 	exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel at ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
+    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+			# says <Richard.M.Bartel at ccMail.Census.GOV>
+	echo i586-unisys-sysv4
+	exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes at openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
@@ -1150,11 +1184,11 @@ EOF
 	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
-	        echo mips-nec-sysv${UNAME_RELEASE}
+		echo mips-nec-sysv${UNAME_RELEASE}
 	else
-	        echo mips-unknown-sysv${UNAME_RELEASE}
+		echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
-        exit ;;
+	exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
 	exit ;;
@@ -1164,6 +1198,9 @@ EOF
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
 	echo i586-pc-beos
 	exit ;;
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+	echo i586-pc-haiku
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
 	exit ;;
@@ -1173,6 +1210,15 @@ EOF
     SX-6:SUPER-UX:*:*)
 	echo sx6-nec-superux${UNAME_RELEASE}
 	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
     Power*:Rhapsody:*:*)
 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
 	exit ;;
@@ -1182,7 +1228,16 @@ EOF
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
 	case $UNAME_PROCESSOR in
-	    *86) UNAME_PROCESSOR=i686 ;;
+	    i386)
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		      grep IS_64BIT_ARCH >/dev/null
+		  then
+		      UNAME_PROCESSOR="x86_64"
+		  fi
+		fi ;;
 	    unknown) UNAME_PROCESSOR=powerpc ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1198,7 +1253,10 @@ EOF
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NEO-?:NONSTOP_KERNEL:*:*)
+	echo neo-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSE-*:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1243,13 +1301,13 @@ EOF
 	echo pdp10-unknown-its
 	exit ;;
     SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
+	echo mips-sei-seiux${UNAME_RELEASE}
 	exit ;;
     *:DragonFly:*:*)
 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 	exit ;;
     *:*VMS:*:*)
-    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 	case "${UNAME_MACHINE}" in
 	    A*) echo alpha-dec-vms ; exit ;;
 	    I*) echo ia64-dec-vms ; exit ;;
@@ -1261,6 +1319,15 @@ EOF
     i*86:skyos:*:*)
 	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
 	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
+    x86_64:VMkernel:*:*)
+	echo ${UNAME_MACHINE}-unknown-esx
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1283,11 +1350,11 @@ main ()
 #include <sys/param.h>
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-          "4"
+	"4"
 #else
-	  ""
+	""
 #endif
-         ); exit (0);
+	); exit (0);
 #endif
 #endif
 
@@ -1421,9 +1488,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 and
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
diff --git a/admin/config.sub b/admin/config.sub
index 1c366df..6205f84 100755
--- a/admin/config.sub
+++ b/admin/config.sub
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2005-07-08'
+timestamp='2012-04-18'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -20,9 +21,7 @@ timestamp='2005-07-08'
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -31,13 +30,16 @@ timestamp='2005-07-08'
 
 
 # Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# diff and a properly formatted GNU ChangeLog entry.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
 # Otherwise, we print the canonical config type on stdout and succeed.
 
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
 # that are meaningful with *any* GNU software.
@@ -71,7 +73,8 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -119,11 +122,18 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
-  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -146,10 +156,13 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray)
+	-apple | -axis | -knuth | -cray | -microblaze)
 		os=
 		basic_machine=$1
 		;;
+	-bluegene*)
+		os=-cnk
+		;;
 	-sim | -cisco | -oki | -wec | -winbond)
 		os=
 		basic_machine=$1
@@ -164,13 +177,17 @@ case $os in
 		os=-chorusos
 		basic_machine=$1
 		;;
- 	-chorusrdb)
- 		os=-chorusrdb
+	-chorusrdb)
+		os=-chorusrdb
 		basic_machine=$1
- 		;;
+		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco5)
 		os=-sco3.2v5
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -187,6 +204,10 @@ case $os in
 		# Don't forget version if it is 3.2v4 or newer.
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco*)
 		os=-sco3.2v2
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -204,6 +225,12 @@ case $os in
 	-isc*)
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-lynx*178)
+		os=-lynxos178
+		;;
+	-lynx*5)
+		os=-lynxos5
+		;;
 	-lynx*)
 		os=-lynxos
 		;;
@@ -228,23 +255,32 @@ case $basic_machine in
 	# Some are omitted here because they have special meanings below.
 	1750a | 580 \
 	| a29k \
+	| aarch64 | aarch64_be \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+        | be32 | be64 \
 	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
-	| fr30 | frv \
+	| epiphany \
+	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
-	| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+	| le32 | le64 \
+	| lm32 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
-	| mips64vr | mips64vrel \
+	| mips64octeon | mips64octeonel \
 	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
 	| mips64vr4100 | mips64vr4100el \
 	| mips64vr4300 | mips64vr4300el \
 	| mips64vr5000 | mips64vr5000el \
@@ -257,35 +293,65 @@ case $basic_machine in
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
-	| ms1 \
+	| moxie \
+	| mt \
 	| msp430 \
+	| nds32 | nds32le | nds32be \
+	| nios | nios2 \
 	| ns16k | ns32k \
+	| open8 \
 	| or32 \
 	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
-	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| rl78 | rx \
+	| score \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b \
-	| strongarm \
-	| tahoe | thumb | tic4x | tic80 | tron \
-	| v850 | v850e \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu \
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+	| ubicom32 \
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
 	| we32k \
-	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
-	| z8k)
+	| x86 | xc16x | xstormy16 | xtensa \
+	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
-	m32c)
-		basic_machine=$basic_machine-unknown
+	c54x)
+		basic_machine=tic54x-unknown
+		;;
+	c55x)
+		basic_machine=tic55x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12)
-		# Motorola 68HC11/12.
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
 	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
 		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
+
+	strongarm | thumb | xscale)
+		basic_machine=arm-unknown
+		;;
+	xgate)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	xscaleeb)
+		basic_machine=armeb-unknown
+		;;
+
+	xscaleel)
+		basic_machine=armel-unknown
+		;;
 
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
@@ -301,29 +367,36 @@ case $basic_machine in
 	# Recognize the basic CPU types with company name.
 	580-* \
 	| a29k-* \
+	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* \
+	| avr-* | avr32-* \
+	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
 	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
-	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
-	| m32r-* | m32rle-* \
+	| le32-* | le64-* \
+	| lm32-* \
+	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
-	| mips64vr-* | mips64vrel-* \
+	| mips64octeon-* | mips64octeonel-* \
 	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
 	| mips64vr4100-* | mips64vr4100el-* \
 	| mips64vr4300-* | mips64vr4300el-* \
 	| mips64vr5000-* | mips64vr5000el-* \
@@ -336,30 +409,38 @@ case $basic_machine in
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
-	| ms1-* \
+	| mt-* \
 	| msp430-* \
+	| nds32-* | nds32le-* | nds32be-* \
+	| nios-* | nios2-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
+	| open8-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pyramid-* \
-	| romp-* | rs6000-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+	| rl78-* | romp-* | rs6000-* | rx-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
-	| tahoe-* | thumb-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| tahoe-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tile*-* \
 	| tron-* \
-	| v850-* | v850e-* | vax-* \
+	| ubicom32-* \
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+	| vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
-	| xstormy16-* | xtensa-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
+	| xstormy16-* | xtensa*-* \
 	| ymp-* \
-	| z8k-*)
+	| z8k-* | z80-*)
 		;;
-	m32c-*)
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=$basic_machine-unknown
 		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
@@ -377,7 +458,7 @@ case $basic_machine in
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-    	abacus)
+	abacus)
 		basic_machine=abacus-unknown
 		;;
 	adobe68k)
@@ -423,6 +504,10 @@ case $basic_machine in
 		basic_machine=m68k-apollo
 		os=-bsd
 		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -431,10 +516,35 @@ case $basic_machine in
 		basic_machine=ns32k-sequent
 		os=-dynix
 		;;
+	blackfin)
+		basic_machine=bfin-unknown
+		os=-linux
+		;;
+	blackfin-*)
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	bluegene*)
+		basic_machine=powerpc-ibm
+		os=-cnk
+		;;
+	c54x-*)
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	c90)
 		basic_machine=c90-cray
 		os=-unicos
 		;;
+	cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=-bsd
@@ -463,8 +573,8 @@ case $basic_machine in
 		basic_machine=craynv-cray
 		os=-unicosmp
 		;;
-	cr16c)
-		basic_machine=cr16c-unknown
+	cr16 | cr16-*)
+		basic_machine=cr16-unknown
 		os=-elf
 		;;
 	crds | unos)
@@ -502,6 +612,10 @@ case $basic_machine in
 		basic_machine=m88k-motorola
 		os=-sysv3
 		;;
+	dicos)
+		basic_machine=i686-pc
+		os=-dicos
+		;;
 	djgpp)
 		basic_machine=i586-pc
 		os=-msdosdjgpp
@@ -617,7 +731,6 @@ case $basic_machine in
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
@@ -656,6 +769,14 @@ case $basic_machine in
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
+	m68knommu)
+		basic_machine=m68k-unknown
+		os=-linux
+		;;
+	m68knommu-*)
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
 	m88k-omron*)
 		basic_machine=m88k-omron
 		;;
@@ -667,10 +788,17 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
+	microblaze)
+		basic_machine=microblaze-xilinx
+		;;
 	mingw32)
 		basic_machine=i386-pc
 		os=-mingw32
 		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
@@ -696,10 +824,21 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-msdos
 		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	msys)
+		basic_machine=i386-pc
+		os=-msys
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
 		;;
+	nacl)
+		basic_machine=le32-unknown
+		os=-nacl
+		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
@@ -764,6 +903,12 @@ case $basic_machine in
 	np1)
 		basic_machine=np1-gould
 		;;
+	neo-tandem)
+		basic_machine=neo-tandem
+		;;
+	nse-tandem)
+		basic_machine=nse-tandem
+		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
@@ -794,6 +939,14 @@ case $basic_machine in
 		basic_machine=i860-intel
 		os=-osf
 		;;
+	parisc)
+		basic_machine=hppa-unknown
+		os=-linux
+		;;
+	parisc-*)
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
 	pbd)
 		basic_machine=sparc-tti
 		;;
@@ -803,6 +956,12 @@ case $basic_machine in
 	pc532 | pc532-*)
 		basic_machine=ns32k-pc532
 		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	pentium | p5 | k5 | k6 | nexgen | viac3)
 		basic_machine=i586-pc
 		;;
@@ -832,9 +991,10 @@ case $basic_machine in
 		;;
 	power)	basic_machine=power-ibm
 		;;
-	ppc)	basic_machine=powerpc-unknown
+	ppc | ppcbe)	basic_machine=powerpc-unknown
 		;;
-	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+	ppc-* | ppcbe-*)
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppcle | powerpclittle | ppc-le | powerpc-little)
 		basic_machine=powerpcle-unknown
@@ -859,6 +1019,10 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
 	rom68k)
 		basic_machine=m68k-rom68k
 		os=-coff
@@ -885,6 +1049,10 @@ case $basic_machine in
 	sb1el)
 		basic_machine=mipsisa64sb1el-unknown
 		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
 	sei)
 		basic_machine=mips-sei
 		os=-seiux
@@ -896,6 +1064,9 @@ case $basic_machine in
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
 	sh64)
 		basic_machine=sh64-unknown
 		;;
@@ -917,6 +1088,9 @@ case $basic_machine in
 		basic_machine=i860-stratus
 		os=-sysv4
 		;;
+	strongarm-* | thumb-*)
+		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	sun2)
 		basic_machine=m68000-sun
 		;;
@@ -973,17 +1147,9 @@ case $basic_machine in
 		basic_machine=t90-cray
 		os=-unicos
 		;;
-	tic54x | c54x*)
-		basic_machine=tic54x-unknown
-		os=-coff
-		;;
-	tic55x | c55x*)
-		basic_machine=tic55x-unknown
-		os=-coff
-		;;
-	tic6x | c6x*)
-		basic_machine=tic6x-unknown
-		os=-coff
+	tile*)
+		basic_machine=$basic_machine-unknown
+		os=-linux-gnu
 		;;
 	tx39)
 		basic_machine=mipstx39-unknown
@@ -1052,6 +1218,9 @@ case $basic_machine in
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
+	xscale-* | xscalee[bl]-*)
+		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+		;;
 	ymp)
 		basic_machine=ymp-cray
 		os=-unicos
@@ -1060,6 +1229,10 @@ case $basic_machine in
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
 	none)
 		basic_machine=none-none
 		os=-none
@@ -1098,10 +1271,10 @@ case $basic_machine in
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b)
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
 		basic_machine=sparc-sun
 		;;
 	cydra)
@@ -1145,9 +1318,12 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+	# First match some system type aliases
+	# that might get confused with valid system types.
 	# -solaris* is a basic system type, with this one exception.
+	-auroraux)
+		os=-auroraux
+		;;
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 		;;
@@ -1168,27 +1344,31 @@ case $os in
 	# Each alternative MUST END IN A *, to match a version number.
 	# -sysv* is not here because it comes later, after sysvr4.
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+	      | -sym* | -kopensolaris* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* \
+	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1227,7 +1407,7 @@ case $os in
 	-opened*)
 		os=-openedition
 		;;
-        -os400*)
+	-os400*)
 		os=-os400
 		;;
 	-wince*)
@@ -1276,7 +1456,7 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
-        -tpf*)
+	-tpf*)
 		os=-tpf
 		;;
 	-triton*)
@@ -1318,6 +1498,11 @@ case $os in
 	-zvmoe)
 		os=-zvmoe
 		;;
+	-dicos*)
+		os=-dicos
+		;;
+	-nacl*)
+		;;
 	-none)
 		;;
 	*)
@@ -1340,6 +1525,12 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
+	score-*)
+		os=-elf
+		;;
+	spu-*)
+		os=-elf
+		;;
 	*-acorn)
 		os=-riscix1.2
 		;;
@@ -1349,9 +1540,21 @@ case $basic_machine in
 	arm*-semi)
 		os=-aout
 		;;
-    c4x-* | tic4x-*)
-        os=-coff
-        ;;
+	c4x-* | tic4x-*)
+		os=-coff
+		;;
+	hexagon-*)
+		os=-elf
+		;;
+	tic54x-*)
+		os=-coff
+		;;
+	tic55x-*)
+		os=-coff
+		;;
+	tic6x-*)
+		os=-coff
+		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
 		os=-tops20
@@ -1370,13 +1573,13 @@ case $basic_machine in
 		;;
 	m68000-sun)
 		os=-sunos3
-		# This also exists in the configure program, but was not the
-		# default.
-		# os=-sunos4
 		;;
 	m68*-cisco)
 		os=-aout
 		;;
+	mep-*)
+		os=-elf
+		;;
 	mips*-cisco)
 		os=-elf
 		;;
@@ -1401,7 +1604,7 @@ case $basic_machine in
 	*-ibm)
 		os=-aix
 		;;
-    	*-knuth)
+	*-knuth)
 		os=-mmixware
 		;;
 	*-wec)
@@ -1506,7 +1709,7 @@ case $basic_machine in
 			-sunos*)
 				vendor=sun
 				;;
-			-aix*)
+			-cnk*|-aix*)
 				vendor=ibm
 				;;
 			-beos*)
diff --git a/admin/depcomp b/admin/depcomp
index 04701da..debb6ff 100755
--- a/admin/depcomp
+++ b/admin/depcomp
@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2005-07-09.11
+scriptversion=2012-03-27.16; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,9 +16,7 @@ scriptversion=2005-07-09.11
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -29,7 +27,7 @@ scriptversion=2005-07-09.11
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
@@ -41,11 +39,11 @@ as side-effects.
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake at gnu.org>.
@@ -58,6 +56,12 @@ EOF
     ;;
 esac
 
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -86,12 +90,48 @@ if test "$depmode" = dashXmstdout; then
    depmode=dashmstdout
 fi
 
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u='sed s,\\\\,/,g'
+   depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+   # This is just like msvc7 but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u='sed s,\\\\,/,g'
+   depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
+   gccflag=-qmakedep=gcc,-MF
+   depmode=gcc
+fi
+
 case "$depmode" in
 gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
 ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
 ## it if -MD -MP comes after the -MF stuff.  Hmm.
-  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
   stat=$?
   if test $stat -eq 0; then :
   else
@@ -127,20 +167,21 @@ gcc)
 ## The second -e expression handles DOS-style file names with drive letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+  tr ' ' "$nl" < "$tmpdepfile" |
+## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+      | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -172,20 +213,17 @@ sgi)
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> $depfile
-    echo >> $depfile
+    tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
 
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> $depfile
+   >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -195,40 +233,51 @@ sgi)
   rm -f "$tmpdepfile"
   ;;
 
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
-  tmpdepfile="$stripped.u"
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
   if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
     "$@" -Wc,-M
   else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
     "$@" -M
   fi
   stat=$?
 
-  if test -f "$tmpdepfile"; then :
-  else
-    stripped=`echo "$stripped" | sed 's,^.*/,,'`
-    tmpdepfile="$stripped.u"
-  fi
-
   if test $stat -eq 0; then :
   else
-    rm -f "$tmpdepfile"
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
 
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
   if test -f "$tmpdepfile"; then
-    outname="$stripped.o"
-    # Each line is of the form `foo.o: dependent.h'.
+    # Each line is of the form 'foo.o: dependent.h'.
     # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
-    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+    # '$object: dependent.h' and one to simply 'dependent.h:'.
+    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -239,23 +288,26 @@ aix)
   ;;
 
 icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
+  # However on
+  #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
   # ICC 7.0 will fill foo.d with something like
   #    foo.o: sub/foo.c
   #    foo.o: sub/foo.h
-  # which is wrong.  We want:
+  # which is wrong.  We want
   #    sub/foo.o: sub/foo.c
   #    sub/foo.o: sub/foo.h
   #    sub/foo.c:
   #    sub/foo.h:
   # ICC 7.1 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using \ :
+  # and will wrap long lines using '\':
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
-
+  # tcc 0.9.26 (FIXME still under development at the moment of writing)
+  # will emit a similar output, but also prepend the continuation lines
+  # with horizontal tabulation characters.
   "$@" -MD -MF "$tmpdepfile"
   stat=$?
   if test $stat -eq 0; then :
@@ -264,23 +316,74 @@ icc)
     exit $stat
   fi
   rm -f "$depfile"
-  # Each line is of the form `foo.o: dependent.h',
-  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Each line is of the form 'foo.o: dependent.h',
+  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
   # Do two passes, one to just change these to
-  # `$object: dependent.h' and one to simply `dependent.h:'.
-  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
-  # Some versions of the HPUX 10.20 sed can't process this invocation
-  # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  # '$object: dependent.h' and one to simply 'dependent.h:'.
+  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
+    < "$tmpdepfile" > "$depfile"
+  sed '
+    s/[ '"$tab"'][ '"$tab"']*/ /g
+    s/^ *//
+    s/ *\\*$//
+    s/^[^:]*: *//
+    /^$/d
+    /:$/d
+    s/$/ :/
+  ' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
+    sed -ne '2,${
+	       s/^ *//
+	       s/ \\*$//
+	       s/$/:/
+	       p
+	     }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
 tru64)
    # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
    # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
+   # dependencies in 'foo.d' instead, so we check for that too.
    # Subdirectories are respected.
    dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    test "x$dir" = "x$object" && dir=
@@ -288,13 +391,13 @@ tru64)
 
    if test "$libtool" = yes; then
       # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mecanism is used in libtool 1.4 series to
+      # static library.  This mechanism is used in libtool 1.4 series to
       # handle both shared and static libraries in a single compilation.
       # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
       #
       # With libtool 1.5 this exception was removed, and libtool now
       # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # compilations output dependencies in $dir.libs/$base.o.d and
       # in $dir$base.o.d.  We have to check for both files, because
       # one of the two compilations can be disabled.  We should prefer
       # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
@@ -326,14 +429,59 @@ tru64)
    done
    if test -f "$tmpdepfile"; then
       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    else
       echo "#dummy" > "$depfile"
    fi
    rm -f "$tmpdepfile"
    ;;
 
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test "$stat" = 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
   # dependency tracking mechanisms from slower ones.
@@ -345,13 +493,13 @@ dashmstdout)
 
   # Remove the call to Libtool.
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -371,15 +519,14 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
+  tr ' ' "$nl" < "$tmpdepfile" | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -396,38 +543,46 @@ makedepend)
   "$@" || exit $?
   # Remove any Libtool call
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
   fi
   # X makedepend
   shift
-  cleared=no
-  for arg in "$@"; do
+  cleared=no eat=no
+  for arg
+  do
     case $cleared in
     no)
       set ""; shift
       cleared=yes ;;
     esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
     case "$arg" in
     -D*|-I*)
       set fnord "$@" "$arg"; shift ;;
     # Strip any option that makedepend may not understand.  Remove
     # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
     -*|$object)
       ;;
     *)
       set fnord "$@" "$arg"; shift ;;
     esac
   done
-  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -441,13 +596,13 @@ cpp)
 
   # Remove the call to Libtool.
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -479,13 +634,27 @@ cpp)
 
 msvisualcpp)
   # Important note: in order to support this mode, a compiler *must*
-  # always write the preprocessed file to stdout, regardless of -o,
-  # because we must use -o when running libtool.
+  # always write the preprocessed file to stdout.
   "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
   IFS=" "
   for arg
   do
     case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
 	set fnord "$@"
 	shift
@@ -498,16 +667,23 @@ msvisualcpp)
 	;;
     esac
   done
-  "$@" -E |
-  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
-  echo "	" >> "$depfile"
-  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
+msvcmsys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 none)
   exec "$@"
   ;;
@@ -526,5 +702,6 @@ exit 0
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/admin/install-sh b/admin/install-sh
index 4d4a951..377bb86 100755
--- a/admin/install-sh
+++ b/admin/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2005-05-14.22
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,42 +35,72 @@ scriptversion=2005-05-14.22
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
 
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
 
-# put in absolute paths if you don't have them in your path; or use env. vars.
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
 
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
 
-chmodcmd="$chmodprog 0755"
-chowncmd=
 chgrpcmd=
-stripcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
 rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
 src=
 dst=
 dir_arg=
-dstarg=
+dst_arg=
+
+copy_on_change=false
 no_target_directory=
 
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
    or: $0 [OPTION]... -t DIRECTORY SRCFILES...
    or: $0 [OPTION]... -d DIRECTORIES...
@@ -80,108 +110,148 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
 In the 4th, create DIRECTORIES.
 
 Options:
--c         (ignored)
--d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
---help     display this help and exit.
---version  display version info and exit.
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
 
 Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
 "
 
-while test -n "$1"; do
+while test $# -ne 0; do
   case $1 in
-    -c) shift
-        continue;;
+    -c) ;;
+
+    -C) copy_on_change=true;;
 
-    -d) dir_arg=true
-        shift
-        continue;;
+    -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
     --help) echo "$usage"; exit $?;;
 
-    -m) chmodcmd="$chmodprog $2"
-        shift
-        shift
-        continue;;
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
 
     -o) chowncmd="$chownprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
-    -s) stripcmd=$stripprog
-        shift
-        continue;;
+    -s) stripcmd=$stripprog;;
 
-    -t) dstarg=$2
-	shift
-	shift
-	continue;;
+    -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
+	shift;;
 
-    -T) no_target_directory=true
-	shift
-	continue;;
+    -T) no_target_directory=true;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    *)  # When -d is used, all remaining arguments are directories to create.
-	# When -t is used, the destination is already specified.
-	test -n "$dir_arg$dstarg" && break
-        # Otherwise, the last argument is the destination.  Remove it from $@.
-	for arg
-	do
-          if test -n "$dstarg"; then
-	    # $@ is not empty: it contains at least $arg.
-	    set fnord "$@" "$dstarg"
-	    shift # fnord
-	  fi
-	  shift # arg
-	  dstarg=$arg
-	done
+    --)	shift
 	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
   esac
+  shift
 done
 
-if test -z "$1"; then
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  done
+fi
+
+if test $# -eq 0; then
   if test -z "$dir_arg"; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src ;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
     dst=$src
-    src=
-
-    if test -d "$dst"; then
-      mkdircmd=:
-      chmodcmd=
-    else
-      mkdircmd=$mkdirprog
-    fi
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
   else
+
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
     # might cause directories to be created, which would be especially bad
     # if $src (and thus $dsttmp) contains '*'.
@@ -190,71 +260,194 @@ do
       exit 1
     fi
 
-    if test -z "$dstarg"; then
+    if test -z "$dst_arg"; then
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
-    dst=$dstarg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst ;;
-    esac
+    dst=$dst_arg
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
       if test -n "$no_target_directory"; then
-	echo "$0: $dstarg: Is a directory" >&2
+	echo "$0: $dst_arg: Is a directory" >&2
 	exit 1
       fi
-      dst=$dst/`basename "$src"`
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
     fi
   fi
 
-  # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
 
-  # Make sure that the destination directory exists.
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
 
-  # Skip lots of stat calls in the usual case.
-  if test ! -d "$dstdir"; then
-    defaultIFS='
-	 '
-    IFS="${IFS-$defaultIFS}"
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
 
-    oIFS=$IFS
-    # Some sh's can't handle IFS=/ for some reason.
-    IFS='%'
-    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-    shift
-    IFS=$oIFS
+      case $dstdir in
+	/*) prefix='/';;
+	[-=\(\)!]*) prefix='./';;
+	*)  prefix='';;
+      esac
 
-    pathcomp=
+      eval "$initialize_posix_glob"
 
-    while test $# -ne 0 ; do
-      pathcomp=$pathcomp$1
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
       shift
-      if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp"
-	# mkdir can fail with a `File exist' error in case several
-	# install-sh are creating the directory concurrently.  This
-	# is OK.
-	test -d "$pathcomp" || exit
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test X"$d" = X && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
       fi
-      pathcomp=$pathcomp/
-    done
+    fi
   fi
 
   if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
-      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
   else
-    dstfile=`basename "$dst"`
 
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
@@ -262,10 +455,9 @@ do
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-    trap '(exit $?); exit' 1 2 13 15
 
     # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -273,51 +465,63 @@ do
     # ignore errors from any of these, just make sure not to ignore
     # errors from the above "$doit $cpprog $src $dsttmp" command.
     #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
-    # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
-      || {
-	   # The rename failed, perhaps because mv can't rename something else
-	   # to itself, or perhaps because mv is so ancient that it does not
-	   # support -f.
-
-	   # Now remove or move aside any old file at destination location.
-	   # We try this two ways since rm can't unlink itself on some
-	   # systems and the destination file might be busy for other
-	   # reasons.  In this case, the final cleanup might fail but the new
-	   # file should still install successfully.
-	   {
-	     if test -f "$dstdir/$dstfile"; then
-	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
-	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
-	       || {
-		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-		 (exit 1); exit 1
-	       }
-	     else
-	       :
-	     fi
-	   } &&
-
-	   # Now rename the file to the real destination.
-	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-	 }
-    }
-  fi || { (exit 1); exit 1; }
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
 done
 
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
-  (exit 0); exit 0
-}
-
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/admin/ltmain.sh b/admin/ltmain.sh
index 0223495..63ae69d 100644
--- a/admin/ltmain.sh
+++ b/admin/ltmain.sh
@@ -1,30 +1,130 @@
-# ltmain.sh - Provide generalized library-building support services.
-# NOTE: Changing this file will not affect anything until you rerun configure.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
+
+# libtool (GNU libtool) 2.4.2
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful, but
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
 #
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+#       --config             show all configuration variables
+#       --debug              enable verbose shell tracing
+#   -n, --dry-run            display commands without modifying any files
+#       --features           display basic configuration information and exit
+#       --mode=MODE          use operation mode MODE
+#       --preserve-dup-deps  don't remove duplicate dependency libraries
+#       --quiet, --silent    don't print informational messages
+#       --no-quiet, --no-silent
+#                            print informational messages (default)
+#       --no-warn            don't display warning messages
+#       --tag=TAG            use configuration variables from tag TAG
+#   -v, --verbose            print more informational messages than default
+#       --no-verbose         don't print the extra informational messages
+#       --version            print version information
+#   -h, --help, --help-all   print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+#         clean              remove files from the build directory
+#         compile            compile a source file into a libtool object
+#         execute            automatically set library path, then run a program
+#         finish             complete the installation of libtool libraries
+#         install            install libraries or executables
+#         link               create a library or an executable
+#         uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.  When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#         host-triplet:	$host
+#         shell:		$SHELL
+#         compiler:		$LTCC
+#         compiler flags:		$LTCFLAGS
+#         linker:		$LD (gnu? $with_gnu_ld)
+#         $progname:	(GNU libtool) 2.4.2
+#         automake:	$automake_version
+#         autoconf:	$autoconf_version
+#
+# Report bugs to <bug-libtool at gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4.2
+TIMESTAMP=""
+package_revision=1.3337
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+          save_$lt_var=\$$lt_var
+          $lt_var=C
+	  export $lt_var
+	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+	fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
 
-basename="s,^.*/,,g"
 
 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 # is ksh but when the shell is invoked as "sh" and the current value of
@@ -33,123 +133,422 @@ basename="s,^.*/,,g"
 # function.
 progpath="$0"
 
-# The name of this program:
-progname=`echo "$progpath" | $SED $basename`
-modename="$progname"
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
 
 # Global variables:
 EXIT_SUCCESS=0
 EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
 
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION=1.5.22
-TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
+exit_status=$EXIT_SUCCESS
 
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" 	$lt_nl"
 
-# Check that we have a working $echo.
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell, and then maybe $echo will work.
-  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
 
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit $EXIT_SUCCESS
-fi
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+} # func_dirname may be replaced by extended shell implementation
 
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
+
+# func_basename file
+func_basename ()
+{
+    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+    # Extract subdirectory from the argument.
+    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+    case ${2} in
+      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+    esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+		s@/\./@/@g
+		t dotsl
+		s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+#             value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+  # Start from root dir and reassemble the path.
+  func_normal_abspath_result=
+  func_normal_abspath_tpath=$1
+  func_normal_abspath_altnamespace=
+  case $func_normal_abspath_tpath in
+    "")
+      # Empty path, that just means $cwd.
+      func_stripname '' '/' "`pwd`"
+      func_normal_abspath_result=$func_stripname_result
+      return
+    ;;
+    # The next three entries are used to spot a run of precisely
+    # two leading slashes without using negated character classes;
+    # we take advantage of case's first-match behaviour.
+    ///*)
+      # Unusual form of absolute path, do nothing.
+    ;;
+    //*)
+      # Not necessarily an ordinary path; POSIX reserves leading '//'
+      # and for example Cygwin uses it to access remote file shares
+      # over CIFS/SMB, so we conserve a leading double slash if found.
+      func_normal_abspath_altnamespace=/
+    ;;
+    /*)
+      # Absolute path, do nothing.
+    ;;
+    *)
+      # Relative path, prepend $cwd.
+      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+    ;;
+  esac
+  # Cancel out all the simple stuff to save iterations.  We also want
+  # the path to end with a slash for ease of parsing, so make sure
+  # there is one (and only one) here.
+  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+  while :; do
+    # Processed it all yet?
+    if test "$func_normal_abspath_tpath" = / ; then
+      # If we ascended to the root using ".." the result may be empty now.
+      if test -z "$func_normal_abspath_result" ; then
+        func_normal_abspath_result=/
+      fi
+      break
+    fi
+    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcar"`
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcdr"`
+    # Figure out what to do with it
+    case $func_normal_abspath_tcomponent in
+      "")
+        # Trailing empty path component, ignore it.
+      ;;
+      ..)
+        # Parent dir; strip last assembled component from result.
+        func_dirname "$func_normal_abspath_result"
+        func_normal_abspath_result=$func_dirname_result
+      ;;
+      *)
+        # Actual path component, append it.
+        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+      ;;
+    esac
+  done
+  # Restore leading double-slash if one was found on entry.
+  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+#             value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+  func_relative_path_result=
+  func_normal_abspath "$1"
+  func_relative_path_tlibdir=$func_normal_abspath_result
+  func_normal_abspath "$2"
+  func_relative_path_tbindir=$func_normal_abspath_result
+
+  # Ascend the tree starting from libdir
+  while :; do
+    # check if we have found a prefix of bindir
+    case $func_relative_path_tbindir in
+      $func_relative_path_tlibdir)
+        # found an exact match
+        func_relative_path_tcancelled=
+        break
+        ;;
+      $func_relative_path_tlibdir*)
+        # found a matching prefix
+        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+        func_relative_path_tcancelled=$func_stripname_result
+        if test -z "$func_relative_path_result"; then
+          func_relative_path_result=.
+        fi
+        break
+        ;;
+      *)
+        func_dirname $func_relative_path_tlibdir
+        func_relative_path_tlibdir=${func_dirname_result}
+        if test "x$func_relative_path_tlibdir" = x ; then
+          # Have to descend all the way to the root!
+          func_relative_path_result=../$func_relative_path_result
+          func_relative_path_tcancelled=$func_relative_path_tbindir
+          break
+        fi
+        func_relative_path_result=../$func_relative_path_result
+        ;;
+    esac
+  done
+
+  # Now calculate path; take care to avoid doubling-up slashes.
+  func_stripname '' '/' "$func_relative_path_result"
+  func_relative_path_result=$func_stripname_result
+  func_stripname '/' '/' "$func_relative_path_tcancelled"
+  if test "x$func_stripname_result" != x ; then
+    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+  fi
+
+  # Normalisation. If bindir is libdir, return empty string,
+  # else relative path ending with a slash; either way, target
+  # file name can be directly appended.
+  if test ! -z "$func_relative_path_result"; then
+    func_stripname './' '' "$func_relative_path_result/"
+    func_relative_path_result=$func_stripname_result
+  fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=${PATH_SEPARATOR-:}
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
 Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  SP2NL='tr \040 \012'
-  NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  SP2NL='tr \100 \n'
-  NL2SP='tr \r\n \100\100'
-  ;;
-esac
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
 
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
-  eval "if test \"\${$lt_var+set}\" = set; then
-         save_$lt_var=\$$lt_var
-         $lt_var=C
-         export $lt_var
-       fi"
-done
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
 
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
 
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-  $echo "$modename: not configured to build any kind of library" 1>&2
-  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-  exit $EXIT_FAILURE
-fi
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
 
-# Global variables.
-mode=$default_mode
-nonopt=
-prev=
-prevopt=
-run=
-show="$echo"
-show_help=
-execute_dlfiles=
-duplicate_deps=no
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+    # bash bug again:
+    :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+	IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
 
-#####################################
-# Shell function definitions:
-# This seems to be the best place for them
 
 # func_mktempdir [string]
 # Make a temporary directory that won't clash with other running
@@ -159,7 +558,7 @@ func_mktempdir ()
 {
     my_template="${TMPDIR-/tmp}/${1-$progname}"
 
-    if test "$run" = ":"; then
+    if test "$opt_dry_run" = ":"; then
       # Return a directory name, but don't create it in dry-run mode
       my_tmpdir="${my_template}-$$"
     else
@@ -168,6321 +567,8882 @@ func_mktempdir ()
       my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
 
       if test ! -d "$my_tmpdir"; then
-	# Failing that, at least try and use $RANDOM to avoid a race
-	my_tmpdir="${my_template}-${RANDOM-0}$$"
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
 
-	save_mktempdir_umask=`umask`
-	umask 0077
-	$mkdir "$my_tmpdir"
-	umask $save_mktempdir_umask
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
       fi
 
       # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || {
-        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
-	exit $EXIT_FAILURE
-      }
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
     fi
 
-    $echo "X$my_tmpdir" | $Xsed
+    $ECHO "$my_tmpdir"
 }
 
 
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-func_win32_libid ()
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
 {
-  win32_libid_type="unknown"
-  win32_fileres=`file -L $1 2>/dev/null`
-  case $win32_fileres in
-  *ar\ archive\ import\ library*) # definitely import
-    win32_libid_type="x86 archive import"
-    ;;
-  *ar\ archive*) # could be an import, or static
-    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
-      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
-      win32_nmres=`eval $NM -f posix -A $1 | \
-	$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
-      case $win32_nmres in
-      import*)  win32_libid_type="x86 archive import";;
-      *)        win32_libid_type="x86 archive static";;
-      esac
-    fi
-    ;;
-  *DLL*)
-    win32_libid_type="x86 DLL"
-    ;;
-  *executable*) # but shell scripts are "executable" too...
-    case $win32_fileres in
-    *MS\ Windows\ PE\ Intel*)
-      win32_libid_type="x86 DLL"
-      ;;
+    case $1 in
+      *[\\\`\"\$]*)
+	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
     esac
-    ;;
-  esac
-  $echo $win32_libid_type
 }
 
 
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
 {
-    if test -n "$available_tags" && test -z "$tagname"; then
-      CC_quoted=
-      for arg in $CC; do
-	case $arg in
-	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-	CC_quoted="$CC_quoted $arg"
-      done
-      case $@ in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
+    case $1 in
+      *[\\\`\"]*)
+	my_arg=`$ECHO "$1" | $SED \
+	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
       *)
-	for z in $available_tags; do
-	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
-	    CC_quoted=
-	    for arg in $CC; do
-	    # Double-quote args containing other shell metacharacters.
-	    case $arg in
-	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	      arg="\"$arg\""
-	      ;;
-	    esac
-	    CC_quoted="$CC_quoted $arg"
-	  done
-	    case "$@ " in
-	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  $echo "$modename: unable to infer tagged configuration"
-	  $echo "$modename: specify a tag with \`--tag'" 1>&2
-	  exit $EXIT_FAILURE
-#        else
-#          $echo "$modename: using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
+        my_arg="$1" ;;
+    esac
+
+    case $my_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        my_arg="\"$my_arg\""
+        ;;
+    esac
+
+    func_quote_for_expand_result="$my_arg"
 }
 
 
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
 {
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
 
-    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
-    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
-    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-     :
-    else
-      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
-      exit $EXIT_FAILURE
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
     fi
 }
 
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
 {
-    my_gentop="$1"; shift
-    my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
-    my_status=""
-
-    $show "${rm}r $my_gentop"
-    $run ${rm}r "$my_gentop"
-    $show "$mkdir $my_gentop"
-    $run $mkdir "$my_gentop"
-    my_status=$?
-    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
-      exit $my_status
-    fi
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
 
-    for my_xlib in $my_oldlibs; do
-      # Extract the objects.
-      case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
-	*) my_xabs=`pwd`"/$my_xlib" ;;
-      esac
-      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
-      my_xlib_u=$my_xlib
-      while :; do
-        case " $extracted_archives " in
-       *" $my_xlib_u "*)
-         extracted_serial=`expr $extracted_serial + 1`
-         my_xlib_u=lt$extracted_serial-$my_xlib ;;
-       *) break ;;
-       esac
-      done
-      extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
 
-      $show "${rm}r $my_xdir"
-      $run ${rm}r "$my_xdir"
-      $show "$mkdir $my_xdir"
-      $run $mkdir "$my_xdir"
-      exit_status=$?
-      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
-	exit $exit_status
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+	    $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
       fi
-      case $host in
-      *-darwin*)
-	$show "Extracting $my_xabs"
-	# Do not bother doing anything if just a dry run
-	if test -z "$run"; then
-	  darwin_orig_dir=`pwd`
-	  cd $my_xdir || exit $?
-	  darwin_archive=$my_xabs
-	  darwin_curdir=`pwd`
-	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
-	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
-	  if test -n "$darwin_arches"; then 
-	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
-	    darwin_arch=
-	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
-	      cd "$darwin_curdir"
-	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
-	    done # $darwin_arches
-      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
-	    darwin_file=
-	    darwin_files=
-	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
-	      lipo -create -output "$darwin_file" $darwin_files
-	    done # $darwin_filelist
-	    ${rm}r unfat-$$
-	    cd "$darwin_orig_dir"
-	  else
-	    cd "$darwin_orig_dir"
- 	    func_extract_an_archive "$my_xdir" "$my_xabs"
-	  fi # $darwin_arches
-	fi # $run
-	;;
-      *)
-        func_extract_an_archive "$my_xdir" "$my_xabs"
-        ;;
-      esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-    done
-    func_extract_archives_result="$my_oldobjs"
+    fi
 }
-# End of Shell function definitions
-#####################################
 
-# Darwin sucks
-eval std_shrext=\"$shrext_cmds\"
-
-disable_libs=no
-
-# Parse our command line options once, thoroughly.
-while test "$#" -gt 0
-do
-  arg="$1"
-  shift
-
-  case $arg in
-  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) optarg= ;;
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+  case $1 in
+  [0-9]* | *[!a-zA-Z0-9_]*)
+    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+    ;;
+  * )
+    func_tr_sh_result=$1
+    ;;
   esac
+}
 
-  # If the previous option needs an argument, assign it.
-  if test -n "$prev"; then
-    case $prev in
-    execute_dlfiles)
-      execute_dlfiles="$execute_dlfiles $arg"
-      ;;
-    tag)
-      tagname="$arg"
-      preserve_args="${preserve_args}=$arg"
-
-      # Check whether tagname contains only valid characters
-      case $tagname in
-      *[!-_A-Za-z0-9,/]*)
-	$echo "$progname: invalid tag name: $tagname" 1>&2
-	exit $EXIT_FAILURE
-	;;
-      esac
 
-      case $tagname in
-      CC)
-	# Don't test for the "default" C tag, as we know, it's there, but
-	# not specially marked.
-	;;
-      *)
-	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
-	  taglist="$taglist $tagname"
-	  # Evaluate the configuration.
-	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
-	else
-	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
-	fi
-	;;
-      esac
-      ;;
-    *)
-      eval "$prev=\$arg"
-      ;;
-    esac
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $opt_debug
+
+    $SED -n '/(C)/!b go
+	:more
+	/\./!{
+	  N
+	  s/\n# / /
+	  b more
+	}
+	:go
+	/^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+	s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
 
-    prev=
-    prevopt=
-    continue
-  fi
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/^#  *.*--help/ {
+        s/^# //
+	s/^# *$//
+	s/\$progname/'$progname'/
+	p
+    }' < "$progpath"
+    echo
+    $ECHO "run \`$progname --help | more' for full usage"
+    exit $?
+}
 
-  # Have we seen a non-optional argument yet?
-  case $arg in
-  --help)
-    show_help=yes
-    ;;
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+	:print
+        s/^# //
+	s/^# *$//
+	s*\$progname*'$progname'*
+	s*\$host*'"$host"'*
+	s*\$SHELL*'"$SHELL"'*
+	s*\$LTCC*'"$LTCC"'*
+	s*\$LTCFLAGS*'"$LTCFLAGS"'*
+	s*\$LD*'"$LD"'*
+	s/\$with_gnu_ld/'"$with_gnu_ld"'/
+	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+	p
+	d
+     }
+     /^# .* home page:/b print
+     /^# General help using/b print
+     ' < "$progpath"
+    ret=$?
+    if test -z "$1"; then
+      exit $ret
+    fi
+}
 
-  --version)
-    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
-    $echo
-    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
-    $echo "This is free software; see the source for copying conditions.  There is NO"
-    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-    exit $?
-    ;;
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    $opt_debug
 
-  --config)
-    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
-    # Now print the configurations for the tags.
-    for tagname in $taglist; do
-      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
-    done
-    exit $?
-    ;;
+    func_error "missing argument for $1."
+    exit_cmd=exit
+}
 
-  --debug)
-    $echo "$progname: enabling shell trace mode"
-    set -x
-    preserve_args="$preserve_args $arg"
-    ;;
 
-  --dry-run | -n)
-    run=:
-    ;;
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
 
-  --features)
-    $echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
-      $echo "enable shared libraries"
-    else
-      $echo "disable shared libraries"
-    fi
-    if test "$build_old_libs" = yes; then
-      $echo "enable static libraries"
-    else
-      $echo "disable static libraries"
-    fi
-    exit $?
-    ;;
+    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
 
-  --finish) mode="finish" ;;
 
-  --mode) prevopt="--mode" prev=mode ;;
-  --mode=*) mode="$optarg" ;;
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+    my_sed_long_arg='1s/^--[^=]*=//'
 
-  --preserve-dup-deps) duplicate_deps="yes" ;;
+    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
 
-  --quiet | --silent)
-    show=:
-    preserve_args="$preserve_args $arg"
-    ;;
+exit_cmd=:
 
-  --tag)
-    prevopt="--tag"
-    prev=tag
-    preserve_args="$preserve_args --tag"
-    ;;
-  --tag=*)
-    set tag "$optarg" ${1+"$@"}
-    shift
-    prev=tag
-    preserve_args="$preserve_args --tag"
-    ;;
 
-  -dlopen)
-    prevopt="-dlopen"
-    prev=execute_dlfiles
-    ;;
 
-  -*)
-    $echo "$modename: unrecognized option \`$arg'" 1>&2
-    $echo "$help" 1>&2
-    exit $EXIT_FAILURE
-    ;;
 
-  *)
-    nonopt="$arg"
-    break
-    ;;
-  esac
-done
 
-if test -n "$prevopt"; then
-  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
-  $echo "$help" 1>&2
-  exit $EXIT_FAILURE
-fi
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
 
-case $disable_libs in
-no) 
-  ;;
-shared)
-  build_libtool_libs=no
-  build_old_libs=yes
-  ;;
-static)
-  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-  ;;
-esac
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
 
 # If this variable is set in any of the actions, the command in it
 # will be execed at the end.  This prevents here-documents from being
 # left over by shells.
 exec_cmd=
 
-if test -z "$show_help"; then
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+    eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
 
-  # Infer the operation mode.
-  if test -z "$mode"; then
-    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
-    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
-    case $nonopt in
-    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
-      mode=link
-      for arg
-      do
-	case $arg in
-	-c)
-	   mode=compile
-	   break
-	   ;;
-	esac
-      done
-      ;;
-    *db | *dbx | *strace | *truss)
-      mode=execute
-      ;;
-    *install*|cp|mv)
-      mode=install
-      ;;
-    *rm)
-      mode=uninstall
-      ;;
-    *)
-      # If we have no mode, but dlfiles were specified, then do execute mode.
-      test -n "$execute_dlfiles" && mode=execute
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+    func_quote_for_eval "${2}"
+    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
 
-      # Just use the default operation mode.
-      if test -z "$mode"; then
-	if test -n "$nonopt"; then
-	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
-	else
-	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
-	fi
-      fi
-      ;;
-    esac
-  fi
 
-  # Only execute mode is allowed to have -dlopen flags.
-  if test -n "$execute_dlfiles" && test "$mode" != execute; then
-    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
-    $echo "$help" 1>&2
-    exit $EXIT_FAILURE
-  fi
+# func_arith arithmetic-term...
+func_arith ()
+{
+    func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
 
-  # Change the help message to a mode-specific one.
-  generic_help="$help"
-  help="Try \`$modename --help --mode=$mode' for more information."
 
-  # These modes are in order of execution frequency so that they run quickly.
-  case $mode in
-  # libtool compile mode
-  compile)
-    modename="$modename: compile"
-    # Get the compilation command and the source file.
-    base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
-    suppress_opt=yes
-    suppress_output=
-    arg_mode=normal
-    libobj=
-    later=
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
 
-    for arg
-    do
-      case $arg_mode in
-      arg  )
-	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
-	arg_mode=normal
-	;;
 
-      target )
-	libobj="$arg"
-	arg_mode=normal
-	continue
-	;;
+# func_lo2o object
+func_lo2o ()
+{
+    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
 
-      normal )
-	# Accept any command-line options.
-	case $arg in
-	-o)
-	  if test -n "$libobj" ; then
-	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	  arg_mode=target
-	  continue
-	  ;;
 
-	-static | -prefer-pic | -prefer-non-pic)
-	  later="$later $arg"
-	  continue
-	  ;;
+# func_xform libobj-or-source
+func_xform ()
+{
+    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
 
-	-no-suppress)
-	  suppress_opt=no
-	  continue
-	  ;;
 
-	-Xcompiler)
-	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
-	  continue      #  The current "srcfile" will either be retained or
-	  ;;            #  replaced later.  I would guess that would be a bug.
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
+}
 
-	-Wc,*)
-	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
-	  lastarg=
-	  save_ifs="$IFS"; IFS=','
- 	  for arg in $args; do
-	    IFS="$save_ifs"
 
-	    # Double-quote args containing other shell metacharacters.
-	    # Many Bourne shells cannot handle close brackets correctly
-	    # in scan sets, so we specify it separately.
-	    case $arg in
-	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	      arg="\"$arg\""
-	      ;;
-	    esac
-	    lastarg="$lastarg $arg"
-	  done
-	  IFS="$save_ifs"
-	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
 
-	  # Add the arguments to base_compile.
-	  base_compile="$base_compile $lastarg"
-	  continue
-	  ;;
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
 
-	* )
-	  # Accept the current argument as the source file.
-	  # The previous "srcfile" becomes the current argument.
-	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
-	  ;;
-	esac  #  case $arg
-	;;
-      esac    #  case $arg_mode
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+    done
 
-      # Aesthetically quote the previous argument.
-      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+    exit $?
+}
 
-      case $lastarg in
-      # Double-quote args containing other shell metacharacters.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, and some SunOS ksh mistreat backslash-escaping
-      # in scan sets (worked around with variable expansion),
-      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
-      # at all, so we specify them separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	lastarg="\"$lastarg\""
-	;;
-      esac
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+    echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      echo "enable static libraries"
+    else
+      echo "disable static libraries"
+    fi
 
-      base_compile="$base_compile $lastarg"
-    done # for arg
+    exit $?
+}
 
-    case $arg_mode in
-    arg)
-      $echo "$modename: you must specify an argument for -Xcompile"
-      exit $EXIT_FAILURE
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+  # Global variable:
+  tagname="$1"
+
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
       ;;
-    target)
-      $echo "$modename: you must specify a target with \`-o'" 1>&2
-      exit $EXIT_FAILURE
-      ;;
-    *)
-      # Get the name of the library object.
-      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
-      ;;
-    esac
-
-    # Recognize several different file suffixes.
-    # If the user specifies -o file.o, it is replaced with file.lo
-    xform='[cCFSifmso]'
-    case $libobj in
-    *.ada) xform=ada ;;
-    *.adb) xform=adb ;;
-    *.ads) xform=ads ;;
-    *.asm) xform=asm ;;
-    *.c++) xform=c++ ;;
-    *.cc) xform=cc ;;
-    *.ii) xform=ii ;;
-    *.class) xform=class ;;
-    *.cpp) xform=cpp ;;
-    *.cxx) xform=cxx ;;
-    *.f90) xform=f90 ;;
-    *.for) xform=for ;;
-    *.java) xform=java ;;
-    *.obj) xform=obj ;;
-    esac
-
-    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+  esac
 
-    case $libobj in
-    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
     *)
-      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
-      exit $EXIT_FAILURE
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	taglist="$taglist $tagname"
+
+	# Evaluate the configuration.  Be careful to quote the path
+	# and the sed script, to avoid splitting on whitespace, but
+	# also don't use non-portable quotes within backquotes within
+	# quotes we have to do it in 2 steps:
+	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	eval "$extractedcf"
+      else
+	func_error "ignoring unknown tag $tagname"
+      fi
       ;;
-    esac
-
-    func_infer_tag $base_compile
-
-    for arg in $later; do
-      case $arg in
-      -static)
-	build_old_libs=yes
-	continue
-	;;
-
-      -prefer-pic)
-	pic_mode=yes
-	continue
-	;;
-
-      -prefer-non-pic)
-	pic_mode=no
-	continue
-	;;
-      esac
-    done
+  esac
+}
 
-    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
-    case $qlibobj in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	qlibobj="\"$qlibobj\"" ;;
-    esac
-    test "X$libobj" != "X$qlibobj" \
-	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
-	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
-    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
-    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
-    if test "X$xdir" = "X$obj"; then
-      xdir=
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      fi
     else
-      xdir=$xdir/
-    fi
-    lobj=${xdir}$objdir/$objname
-
-    if test -z "$base_compile"; then
-      $echo "$modename: you must specify a compilation command" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
     fi
 
-    # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
-      removelist="$obj $lobj $libobj ${libobj}T"
-    else
-      removelist="$lobj $libobj ${libobj}T"
-    fi
+    exit $EXIT_MISMATCH
+  fi
+}
 
-    $run $rm $removelist
-    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
 
-    # On Cygwin there's no "real" PIC flag so we must build both object types
-    case $host_os in
-    cygwin* | mingw* | pw32* | os2*)
-      pic_mode=default
-      ;;
-    esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
-      # non-PIC code in shared libraries is not supported
-      pic_mode=default
-    fi
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+  shift; set dummy --mode clean ${1+"$@"}; shift
+  ;;
+compile|compil|compi|comp|com|co|c)
+  shift; set dummy --mode compile ${1+"$@"}; shift
+  ;;
+execute|execut|execu|exec|exe|ex|e)
+  shift; set dummy --mode execute ${1+"$@"}; shift
+  ;;
+finish|finis|fini|fin|fi|f)
+  shift; set dummy --mode finish ${1+"$@"}; shift
+  ;;
+install|instal|insta|inst|ins|in|i)
+  shift; set dummy --mode install ${1+"$@"}; shift
+  ;;
+link|lin|li|l)
+  shift; set dummy --mode link ${1+"$@"}; shift
+  ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+  shift; set dummy --mode uninstall ${1+"$@"}; shift
+  ;;
+esac
 
-    # Calculate the filename of the output object if compiler does
-    # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
-      removelist="$removelist $output_obj $lockfile"
-      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
-    else
-      output_obj=
-      need_locks=no
-      lockfile=
-    fi
 
-    # Lock this critical section if it is needed
-    # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
-      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
-	$show "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    elif test "$need_locks" = warn; then
-      if test -f "$lockfile"; then
-	$echo "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
 
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
 
-	$run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
-      $echo "$srcfile" > "$lockfile"
-    fi
 
-    if test -n "$fix_srcfile_path"; then
-      eval srcfile=\"$fix_srcfile_path\"
-    fi
-    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
-    case $qsrcfile in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-      qsrcfile="\"$qsrcfile\"" ;;
-    esac
+# Parse options once, thoroughly.  This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+  # this just eases exit handling
+  while test $# -gt 0; do
+    opt="$1"
+    shift
+    case $opt in
+      --debug|-x)	opt_debug='set -x'
+			func_echo "enabling shell trace mode"
+			$opt_debug
+			;;
+      --dry-run|--dryrun|-n)
+			opt_dry_run=:
+			;;
+      --config)
+			opt_config=:
+func_config
+			;;
+      --dlopen|-dlopen)
+			optarg="$1"
+			opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+			shift
+			;;
+      --preserve-dup-deps)
+			opt_preserve_dup_deps=:
+			;;
+      --features)
+			opt_features=:
+func_features
+			;;
+      --finish)
+			opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+			;;
+      --help)
+			opt_help=:
+			;;
+      --help-all)
+			opt_help_all=:
+opt_help=': help-all'
+			;;
+      --mode)
+			test $# = 0 && func_missing_arg $opt && break
+			optarg="$1"
+			opt_mode="$optarg"
+case $optarg in
+  # Valid mode arguments:
+  clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+  # Catch anything else as an error
+  *) func_error "invalid argument for $opt"
+     exit_cmd=exit
+     break
+     ;;
+esac
+			shift
+			;;
+      --no-silent|--no-quiet)
+			opt_silent=false
+func_append preserve_args " $opt"
+			;;
+      --no-warning|--no-warn)
+			opt_warning=false
+func_append preserve_args " $opt"
+			;;
+      --no-verbose)
+			opt_verbose=false
+func_append preserve_args " $opt"
+			;;
+      --silent|--quiet)
+			opt_silent=:
+func_append preserve_args " $opt"
+        opt_verbose=false
+			;;
+      --verbose|-v)
+			opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+			;;
+      --tag)
+			test $# = 0 && func_missing_arg $opt && break
+			optarg="$1"
+			opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+			shift
+			;;
 
-    $run $rm "$libobj" "${libobj}T"
+      -\?|-h)		func_usage				;;
+      --help)		func_help				;;
+      --version)	func_version				;;
 
-    # Create a libtool object file (analogous to a ".la" file),
-    # but don't create it if we're doing a dry run.
-    test -z "$run" && cat > ${libobj}T <<EOF
-# $libobj - a libtool object file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
+      # Separate optargs to long options:
+      --*=*)
+			func_split_long_opt "$opt"
+			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+			shift
+			;;
 
-# Name of the PIC object.
-EOF
+      # Separate non-argument short options:
+      -\?*|-h*|-n*|-v*)
+			func_split_short_opt "$opt"
+			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+			shift
+			;;
 
-    # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
-      # Without this assignment, base_compile gets emptied.
-      fbsd_hideous_sh_bug=$base_compile
+      --)		break					;;
+      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
+      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
+    esac
+  done
 
-      if test "$pic_mode" != no; then
-	command="$base_compile $qsrcfile $pic_flag"
-      else
-	# Don't build PIC code
-	command="$base_compile $qsrcfile"
-      fi
+  # Validate options:
 
-      if test ! -d "${xdir}$objdir"; then
-	$show "$mkdir ${xdir}$objdir"
-	$run $mkdir ${xdir}$objdir
-	exit_status=$?
-	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
-	  exit $exit_status
-	fi
-      fi
+  # save first non-option argument
+  if test "$#" -gt 0; then
+    nonopt="$opt"
+    shift
+  fi
 
-      if test -z "$output_obj"; then
-	# Place PIC objects in $objdir
-	command="$command -o $lobj"
-      fi
+  # preserve --debug
+  test "$opt_debug" = : || func_append preserve_args " --debug"
 
-      $run $rm "$lobj" "$output_obj"
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
+      ;;
+    *)
+      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+      ;;
+  esac
 
-      $show "$command"
-      if $run eval "$command"; then :
-      else
-	test -n "$output_obj" && $run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
+  $opt_help || {
+    # Sanity checks first:
+    func_check_version_match
 
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
+    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+      func_fatal_configuration "not configured to build any kind of library"
+    fi
 
-but it should contain:
-$srcfile
+    # Darwin sucks
+    eval std_shrext=\"$shrext_cmds\"
 
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
+    # Only execute mode is allowed to have -dlopen flags.
+    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+      func_error "unrecognized option \`-dlopen'"
+      $ECHO "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
 
-	$run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
+    # Change the help message to a mode-specific one.
+    generic_help="$help"
+    help="Try \`$progname --help --mode=$opt_mode' for more information."
+  }
 
-      # Just move the object if needed, then go on to compile the next one
-      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
-	$show "$mv $output_obj $lobj"
-	if $run $mv $output_obj $lobj; then :
-	else
-	  error=$?
-	  $run $rm $removelist
-	  exit $error
-	fi
-      fi
 
-      # Append the name of the PIC object to the libtool object file.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object='$objdir/$objname'
+  # Bail if the options were screwed
+  $exit_cmd $EXIT_FAILURE
+}
 
-EOF
 
-      # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
-        suppress_output=' >/dev/null 2>&1'
-      fi
-    else
-      # No PIC object so indicate it doesn't exist in the libtool
-      # object file.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object=none
 
-EOF
-    fi
 
-    # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
-	# Don't build PIC code
-	command="$base_compile $qsrcfile"
-      else
-	command="$base_compile $qsrcfile $pic_flag"
-      fi
-      if test "$compiler_c_o" = yes; then
-	command="$command -o $obj"
-      fi
+## ----------- ##
+##    Main.    ##
+## ----------- ##
 
-      # Suppress compiler output if we already did a PIC compilation.
-      command="$command$suppress_output"
-      $run $rm "$obj" "$output_obj"
-      $show "$command"
-      if $run eval "$command"; then :
-      else
-	$run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
 
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+	for lalib_p_l in 1 2 3 4
+	do
+	    read lalib_p_line
+	    case "$lalib_p_line" in
+		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+	    esac
+	done
+	exec 0<&5 5<&-
+    fi
+    test "$lalib_p" = yes
+}
 
-but it should contain:
-$srcfile
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    func_lalib_p "$1"
+}
 
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
 
-	$run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_dirname_and_basename "$1" "" "."
+    func_stripname '' '.exe' "$func_basename_result"
+    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
 
-      # Just move the object if needed
-      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
-	$show "$mv $output_obj $obj"
-	if $run $mv $output_obj $obj; then :
-	else
-	  error=$?
-	  $run $rm $removelist
-	  exit $error
-	fi
-      fi
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
 
-      # Append the name of the non-PIC object the libtool object file.
-      # Only append if the libtool object file exists.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object='$objname'
 
-EOF
-    else
-      # Append the name of the non-PIC object the libtool object file.
-      # Only append if the libtool object file exists.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object=none
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $opt_debug
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$save_ifs
+      eval cmd=\"$cmd\"
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
 
-EOF
-    fi
 
-    $run $mv "${libobj}T" "${libobj}"
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)	. "$1" ;;
+    *)		. "./$1" ;;
+    esac
+}
 
-    # Unlock the critical section if it was locked
-    if test "$need_locks" != no; then
-      $run $rm "$lockfile"
-    fi
 
-    exit $EXIT_SUCCESS
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot.  Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+  func_resolve_sysroot_result=$1
+  case $func_resolve_sysroot_result in
+  =*)
+    func_stripname '=' '' "$func_resolve_sysroot_result"
+    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
     ;;
+  esac
+}
 
-  # libtool link mode
-  link | relink)
-    modename="$modename: link"
-    case $host in
-    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-      # It is impossible to link a dll without this setting, and
-      # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
-      # flag for every libtool invocation.
-      # allow_undefined=no
-
-      # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
-      # even a static library is built.  For now, we need to specify
-      # -no-undefined on the libtool link line when we can be certain
-      # that all symbols are satisfied, otherwise we get a static library.
-      allow_undefined=yes
-      ;;
-    *)
-      allow_undefined=yes
-      ;;
-    esac
-    libtool_args="$nonopt"
-    base_compile="$nonopt $@"
-    compile_command="$nonopt"
-    finalize_command="$nonopt"
-
-    compile_rpath=
-    finalize_rpath=
-    compile_shlibpath=
-    finalize_shlibpath=
-    convenience=
-    old_convenience=
-    deplibs=
-    old_deplibs=
-    compiler_flags=
-    linker_flags=
-    dllsearchpath=
-    lib_search_path=`pwd`
-    inst_prefix_dir=
-
-    avoid_version=no
-    dlfiles=
-    dlprefiles=
-    dlself=no
-    export_dynamic=no
-    export_symbols=
-    export_symbols_regex=
-    generated=
-    libobjs=
-    ltlibs=
-    module=no
-    no_install=no
-    objs=
-    non_pic_objects=
-    notinst_path= # paths that contain not-installed libtool libraries
-    precious_files_regex=
-    prefer_static_libs=no
-    preload=no
-    prev=
-    prevarg=
-    release=
-    rpath=
-    xrpath=
-    perm_rpath=
-    temp_rpath=
-    thread_safe=no
-    vinfo=
-    vinfo_number=no
-
-    func_infer_tag $base_compile
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+  case "$lt_sysroot:$1" in
+  ?*:"$lt_sysroot"*)
+    func_stripname "$lt_sysroot" '' "$1"
+    func_replace_sysroot_result="=$func_stripname_result"
+    ;;
+  *)
+    # Including no sysroot.
+    func_replace_sysroot_result=$1
+    ;;
+  esac
+}
 
-    # We need to know -static, to get the right output filenames.
-    for arg
-    do
-      case $arg in
-      -all-static | -static | -static-libtool-libs)
-    case $arg in
-    -all-static)
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
-	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
-	  fi
-	  if test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-    -static)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $opt_debug
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+	func_append_quoted CC_quoted "$arg"
+      done
+      CC_expanded=`func_echo_all $CC`
+      CC_quoted_expanded=`func_echo_all $CC_quoted`
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	      # Double-quote args containing other shell metacharacters.
+	      func_append_quoted CC_quoted "$arg"
+	    done
+	    CC_expanded=`func_echo_all $CC`
+	    CC_quoted_expanded=`func_echo_all $CC_quoted`
+	    case "$@ " in
+	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
 	  fi
-	  prefer_static_libs=built
-	  ;;
-    -static-libtool-libs)
-      if test -z "$pic_flag" && test -n "$link_static_flag"; then
-        dlopen_self=$dlopen_self_static
-      fi
-      prefer_static_libs=yes
-      ;;
-    esac
-	build_libtool_libs=no
-	build_old_libs=yes
-	break
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  func_echo "unable to infer tagged configuration"
+	  func_fatal_error "specify a tag with \`--tag'"
+#	else
+#	  func_verbose "using $tagname tagged configuration"
+	fi
 	;;
       esac
-    done
+    fi
+}
 
-    # See if our shared archives depend on static archives.
-    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
 
-    # Go through the arguments, transforming them on the way.
-    while test "$#" -gt 0; do
-      arg="$1"
-      shift
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
-	;;
-      *) qarg=$arg ;;
-      esac
-      libtool_args="$libtool_args $qarg"
 
-      # If the previous option needs an argument, assign it.
-      if test -n "$prev"; then
-	case $prev in
-	output)
-	  compile_command="$compile_command @OUTPUT@"
-	  finalize_command="$finalize_command @OUTPUT@"
-	  ;;
-	esac
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
+    else
+      write_lobj=none
+    fi
 
-	case $prev in
-	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
-	    # Add the symbol object into the linking commands.
-	    compile_command="$compile_command @SYMFILE@"
-	    finalize_command="$finalize_command @SYMFILE@"
-	    preload=yes
-	  fi
-	  case $arg in
-	  *.la | *.lo) ;;  # We handle these cases below.
-	  force)
-	    if test "$dlself" = no; then
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  self)
-	    if test "$prev" = dlprefiles; then
-	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
-	      dlself=yes
-	    else
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  *)
-	    if test "$prev" = dlfiles; then
-	      dlfiles="$dlfiles $arg"
-	    else
-	      dlprefiles="$dlprefiles $arg"
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  esac
-	  ;;
-	expsyms)
-	  export_symbols="$arg"
-	  if test ! -f "$arg"; then
-	    $echo "$modename: symbol file \`$arg' does not exist"
-	    exit $EXIT_FAILURE
-	  fi
-	  prev=
-	  continue
-	  ;;
-	expsyms_regex)
-	  export_symbols_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	inst_prefix)
-	  inst_prefix_dir="$arg"
-	  prev=
-	  continue
-	  ;;
-	precious_regex)
-	  precious_files_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	release)
-	  release="-$arg"
-	  prev=
-	  continue
-	  ;;
-	objectlist)
-	  if test -f "$arg"; then
-	    save_arg=$arg
-	    moreargs=
-	    for fil in `cat $save_arg`
-	    do
-#	      moreargs="$moreargs $fil"
-	      arg=$fil
-	      # A libtool-controlled object.
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
+    else
+      write_oldobj=none
+    fi
 
-	      # Check to see that this really is a libtool object.
-	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-		pic_object=
-		non_pic_object=
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
 
-		# Read the .lo file
-		# If there is no directory component, then add one.
-		case $arg in
-		*/* | *\\*) . $arg ;;
-		*) . ./$arg ;;
-		esac
+# Name of the PIC object.
+pic_object=$write_lobj
 
-		if test -z "$pic_object" || \
-		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none && \
-		   test "$non_pic_object" = none; then
-		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-		  exit $EXIT_FAILURE
-		fi
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
 
-		# Extract subdirectory from the argument.
-		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-		if test "X$xdir" = "X$arg"; then
-		  xdir=
-		else
-		  xdir="$xdir/"
-		fi
+EOF
+      $MV "${write_libobj}T" "${write_libobj}"
+    }
+}
 
-		if test "$pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
 
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		      dlfiles="$dlfiles $pic_object"
-		      prev=
-		      continue
-		    else
-		      # If libtool objects are unsupported, then we need to preload.
-		      prev=dlprefiles
-		    fi
-		  fi
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
 
-		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
-		    # Preload the old-style object.
-		    dlprefiles="$dlprefiles $pic_object"
-		    prev=
-		  fi
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+  $opt_debug
+  func_convert_core_file_wine_to_w32_result="$1"
+  if test -n "$1"; then
+    # Unfortunately, winepath does not exit with a non-zero error code, so we
+    # are forced to check the contents of stdout. On the other hand, if the
+    # command is not found, the shell will set an exit code of 127 and print
+    # *an error message* to stdout. So we must check for both error code of
+    # zero AND non-empty stdout, which explains the odd construction:
+    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+        $SED -e "$lt_sed_naive_backslashify"`
+    else
+      func_convert_core_file_wine_to_w32_result=
+    fi
+  fi
+}
+# end: func_convert_core_file_wine_to_w32
 
-		  # A PIC object.
-		  libobjs="$libobjs $pic_object"
-		  arg="$pic_object"
-		fi
 
-		# Non-PIC object.
-		if test "$non_pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+  $opt_debug
+  # unfortunately, winepath doesn't convert paths, only file names
+  func_convert_core_path_wine_to_w32_result=""
+  if test -n "$1"; then
+    oldIFS=$IFS
+    IFS=:
+    for func_convert_core_path_wine_to_w32_f in $1; do
+      IFS=$oldIFS
+      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+        if test -z "$func_convert_core_path_wine_to_w32_result"; then
+          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+        else
+          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+        fi
+      fi
+    done
+    IFS=$oldIFS
+  fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+  $opt_debug
+  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+    if test "$?" -ne 0; then
+      # on failure, ensure result is empty
+      func_cygpath_result=
+    fi
+  else
+    func_cygpath_result=
+    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+  fi
+}
+#end: func_cygpath
 
-		  # A standard non-PIC object
-		  non_pic_objects="$non_pic_objects $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
-		  fi
-		else
-		  # If the PIC object exists, use it instead.
-		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
-		  non_pic_objects="$non_pic_objects $non_pic_object"
-		fi
-	      else
-		# Only an error if not doing a dry-run.
-		if test -z "$run"; then
-		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-		  exit $EXIT_FAILURE
-		else
-		  # Dry-run case.
 
-		  # Extract subdirectory from the argument.
-		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-		  if test "X$xdir" = "X$arg"; then
-		    xdir=
-		  else
-		    xdir="$xdir/"
-		  fi
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format.  Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+  $opt_debug
+  # awkward: cmd appends spaces to result
+  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
 
-		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
-		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
-		  libobjs="$libobjs $pic_object"
-		  non_pic_objects="$non_pic_objects $non_pic_object"
-		fi
-	      fi
-	    done
-	  else
-	    $echo "$modename: link input file \`$save_arg' does not exist"
-	    exit $EXIT_FAILURE
-	  fi
-	  arg=$save_arg
-	  prev=
-	  continue
-	  ;;
-	rpath | xrpath)
-	  # We need an absolute path.
-	  case $arg in
-	  [\\/]* | [A-Za-z]:[\\/]*) ;;
-	  *)
-	    $echo "$modename: only absolute run-paths are allowed" 1>&2
-	    exit $EXIT_FAILURE
-	    ;;
-	  esac
-	  if test "$prev" = rpath; then
-	    case "$rpath " in
-	    *" $arg "*) ;;
-	    *) rpath="$rpath $arg" ;;
-	    esac
-	  else
-	    case "$xrpath " in
-	    *" $arg "*) ;;
-	    *) xrpath="$xrpath $arg" ;;
-	    esac
-	  fi
-	  prev=
-	  continue
-	  ;;
-	xcompiler)
-	  compiler_flags="$compiler_flags $qarg"
-	  prev=
-	  compile_command="$compile_command $qarg"
-	  finalize_command="$finalize_command $qarg"
-	  continue
-	  ;;
-	xlinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $wl$qarg"
-	  prev=
-	  compile_command="$compile_command $wl$qarg"
-	  finalize_command="$finalize_command $wl$qarg"
-	  continue
-	  ;;
-	xcclinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $qarg"
-	  prev=
-	  compile_command="$compile_command $qarg"
-	  finalize_command="$finalize_command $qarg"
-	  continue
-	  ;;
-	shrext)
-  	  shrext_cmds="$arg"
-	  prev=
-	  continue
-	  ;;
-	darwin_framework|darwin_framework_skip)
-	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
-	  compile_command="$compile_command $arg"
-	  finalize_command="$finalize_command $arg"
-	  prev=
-	  continue
-	  ;;
-	*)
-	  eval "$prev=\"\$arg\""
-	  prev=
-	  continue
-	  ;;
-	esac
-      fi # test -n "$prev"
 
-      prevarg="$arg"
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+  $opt_debug
+  if test -z "$2" && test -n "$1" ; then
+    func_error "Could not determine host file name corresponding to"
+    func_error "  \`$1'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback:
+    func_to_host_file_result="$1"
+  fi
+}
+# end func_convert_file_check
 
-      case $arg in
-      -all-static)
-	if test -n "$link_static_flag"; then
-	  compile_command="$compile_command $link_static_flag"
-	  finalize_command="$finalize_command $link_static_flag"
-	fi
-	continue
-	;;
 
-      -allow-undefined)
-	# FIXME: remove this flag sometime in the future.
-	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
-	continue
-	;;
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+  $opt_debug
+  if test -z "$4" && test -n "$3"; then
+    func_error "Could not determine the host path corresponding to"
+    func_error "  \`$3'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback.  This is a deliberately simplistic "conversion" and
+    # should not be "improved".  See libtool.info.
+    if test "x$1" != "x$2"; then
+      lt_replace_pathsep_chars="s|$1|$2|g"
+      func_to_host_path_result=`echo "$3" |
+        $SED -e "$lt_replace_pathsep_chars"`
+    else
+      func_to_host_path_result="$3"
+    fi
+  fi
+}
+# end func_convert_path_check
 
-      -avoid-version)
-	avoid_version=yes
-	continue
-	;;
 
-      -dlopen)
-	prev=dlfiles
-	continue
-	;;
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+  $opt_debug
+  case $4 in
+  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+    ;;
+  esac
+  case $4 in
+  $2 ) func_append func_to_host_path_result "$3"
+    ;;
+  esac
+}
+# end func_convert_path_front_back_pathsep
 
-      -dlpreopen)
-	prev=dlprefiles
-	continue
-	;;
 
-      -export-dynamic)
-	export_dynamic=yes
-	continue
-	;;
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
 
-      -export-symbols | -export-symbols-regex)
-	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	  $echo "$modename: more than one -exported-symbols argument is not allowed"
-	  exit $EXIT_FAILURE
-	fi
-	if test "X$arg" = "X-export-symbols"; then
-	  prev=expsyms
-	else
-	  prev=expsyms_regex
-	fi
-	continue
-	;;
 
-      -framework|-arch|-isysroot)
-	case " $CC " in
-	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
-		prev=darwin_framework_skip ;;
-	  *) compiler_flags="$compiler_flags $arg"
-	     prev=darwin_framework ;;
-	esac
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
-	continue
-	;;
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+  $opt_debug
+  $to_host_file_cmd "$1"
+}
+# end func_to_host_file
 
-      -inst-prefix-dir)
-	prev=inst_prefix
-	continue
-	;;
 
-      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
-      # so, if we see these flags be careful not to treat them like -L
-      -L[A-Z][A-Z]*:*)
-	case $with_gcc/$host in
-	no/*-*-irix* | /*-*-irix*)
-	  compile_command="$compile_command $arg"
-	  finalize_command="$finalize_command $arg"
-	  ;;
-	esac
-	continue
-	;;
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result.  If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+  $opt_debug
+  case ,$2, in
+    *,"$to_tool_file_cmd",*)
+      func_to_tool_file_result=$1
+      ;;
+    *)
+      $to_tool_file_cmd "$1"
+      func_to_tool_file_result=$func_to_host_file_result
+      ;;
+  esac
+}
+# end func_to_tool_file
 
-      -L*)
-	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  absdir=`cd "$dir" && pwd`
-	  if test -z "$absdir"; then
-	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-	    absdir="$dir"
-	    notinst_path="$notinst_path $dir"
-	  fi
-	  dir="$absdir"
-	  ;;
-	esac
-	case "$deplibs " in
-	*" -L$dir "*) ;;
-	*)
-	  deplibs="$deplibs -L$dir"
-	  lib_search_path="$lib_search_path $dir"
-	  ;;
-	esac
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$dir:"*) ;;
-	  *) dllsearchpath="$dllsearchpath:$dir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
-	  esac
-	  ;;
-	esac
-	continue
-	;;
 
-      -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
-	    # These systems don't actually have a C or math library (as such)
-	    continue
-	    ;;
-	  *-*-os2*)
-	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C and math libraries are in the System framework
-	    deplibs="$deplibs -framework System"
-	    continue
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  esac
-	elif test "X$arg" = "X-lc_r"; then
-	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	   # Do not include libc_r directly, use -pthread flag.
-	   continue
-	   ;;
-	 esac
-	fi
-	deplibs="$deplibs $arg"
-	continue
-	;;
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+  func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
 
-      # Tru64 UNIX uses -model [arg] to determine the layout of C++
-      # classes, name mangling, and exception handling.
-      -model)
-	compile_command="$compile_command $arg"
-	compiler_flags="$compiler_flags $arg"
-	finalize_command="$finalize_command $arg"
-	prev=xcompiler
-	continue
-	;;
 
-     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
-	compiler_flags="$compiler_flags $arg"
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
-	continue
-	;;
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
 
-      -module)
-	module=yes
-	continue
-	;;
 
-      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
-      # -r[0-9][0-9]* specifies the processor on the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
-      # +DA*, +DD* enable 64-bit mode on the HP compiler
-      # -q* pass through compiler args for the IBM compiler
-      # -m* pass through architecture-specific compiler args for GCC
-      # -m*, -t[45]*, -txscale* pass through architecture-specific
-      # compiler args for GCC
-      # -pg pass through profiling flag for GCC
-      # @file GCC response files
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
-      -t[45]*|-txscale*|@*)
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+    # LT_CYGPATH in this case.
+    func_to_host_file_result=`cygpath -m "$1"`
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
 
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-        compile_command="$compile_command $arg"
-        finalize_command="$finalize_command $arg"
-        compiler_flags="$compiler_flags $arg"
-        continue
-        ;;
 
-      -shrext)
-	prev=shrext
-	continue
-	;;
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format.  Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_file_wine_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
 
-      -no-fast-install)
-	fast_install=no
-	continue
-	;;
 
-      -no-install)
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-	  # The PATH hackery in wrapper scripts is required on Windows
-	  # in order for the loader to find any dlls it needs.
-	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
-	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
-	  fast_install=no
-	  ;;
-	*) no_install=yes ;;
-	esac
-	continue
-	;;
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
 
-      -no-undefined)
-	allow_undefined=no
-	continue
-	;;
 
-      -objectlist)
-	prev=objectlist
-	continue
-	;;
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+    func_convert_core_file_wine_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
 
-      -o) prev=output ;;
 
-      -precious-files-regex)
-	prev=precious_regex
-	continue
-	;;
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format.  If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+#   file name conversion function    : func_convert_file_X_to_Y ()
+#   path conversion function         : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same.  If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+  $opt_debug
+  if test -z "$to_host_path_cmd"; then
+    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+  fi
+}
 
-      -release)
-	prev=release
-	continue
-	;;
 
-      -rpath)
-	prev=rpath
-	continue
-	;;
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+  $opt_debug
+  func_init_to_host_path_cmd
+  $to_host_path_cmd "$1"
+}
+# end func_to_host_path
 
-      -R)
-	prev=xrpath
-	continue
-	;;
 
-      -R*)
-	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  $echo "$modename: only absolute run-paths are allowed" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-	case "$xrpath " in
-	*" $dir "*) ;;
-	*) xrpath="$xrpath $dir" ;;
-	esac
-	continue
-	;;
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+  func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
 
-      -static | -static-libtool-libs)
-	# The effects of -static are defined in a previous loop.
-	# We used to do the same as -all-static on platforms that
-	# didn't have a PIC flag, but the assumption that the effects
-	# would be equivalent was wrong.  It would break on at least
-	# Digital Unix and AIX.
-	continue
-	;;
 
-      -thread-safe)
-	thread_safe=yes
-	continue
-	;;
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from ARG.  MSYS
+    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+    # and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_msys_to_w32
 
-      -version-info)
-	prev=vinfo
-	continue
-	;;
-      -version-number)
-	prev=vinfo
-	vinfo_number=yes
-	continue
-	;;
 
-      -Wc,*)
-	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  IFS="$save_ifs"
-	  case $flag in
-	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	    flag="\"$flag\""
-	    ;;
-	  esac
-	  arg="$arg $wl$flag"
-	  compiler_flags="$compiler_flags $flag"
-	done
-	IFS="$save_ifs"
-	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
-	;;
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_cygwin_to_w32
 
-      -Wl,*)
-	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  IFS="$save_ifs"
-	  case $flag in
-	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	    flag="\"$flag\""
-	    ;;
-	  esac
-	  arg="$arg $wl$flag"
-	  compiler_flags="$compiler_flags $wl$flag"
-	  linker_flags="$linker_flags $flag"
-	done
-	IFS="$save_ifs"
-	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
-	;;
 
-      -Xcompiler)
-	prev=xcompiler
-	continue
-	;;
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format.  Requires a wine environment and
+# a working winepath.  Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_nix_to_w32
 
-      -Xlinker)
-	prev=xlinker
-	continue
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from
+    # ARG. msys behavior is inconsistent here, cygpath turns them
+    # into '.;' and ';.', and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $opt_debug
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
 	;;
 
-      -XCClinker)
-	prev=xcclinker
+      target )
+	libobj="$arg"
+	arg_mode=normal
 	continue
 	;;
 
-      # Some other compiler flag.
-      -* | +*)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      normal )
+	# Accept any command-line options.
 	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
+	-o)
+	  test -n "$libobj" && \
+	    func_fatal_error "you cannot specify \`-o' more than once"
+	  arg_mode=target
+	  continue
 	  ;;
-	esac
-	;;
-
-      *.$objext)
-	# A standard object.
-	objs="$objs $arg"
-	;;
-
-      *.lo)
-	# A libtool-controlled object.
 
-	# Check to see that this really is a libtool object.
-	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	  pic_object=
-	  non_pic_object=
+	-pie | -fpie | -fPIE)
+          func_append pie_flag " $arg"
+	  continue
+	  ;;
 
-	  # Read the .lo file
-	  # If there is no directory component, then add one.
-	  case $arg in
-	  */* | *\\*) . $arg ;;
-	  *) . ./$arg ;;
-	  esac
+	-shared | -static | -prefer-pic | -prefer-non-pic)
+	  func_append later " $arg"
+	  continue
+	  ;;
 
-	  if test -z "$pic_object" || \
-	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none && \
-	     test "$non_pic_object" = none; then
-	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
 
-	  # Extract subdirectory from the argument.
-	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-	  if test "X$xdir" = "X$arg"; then
-	    xdir=
- 	  else
-	    xdir="$xdir/"
-	  fi
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
 
-	  if test "$pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
+	-Wc,*)
+	  func_stripname '-Wc,' '' "$arg"
+	  args=$func_stripname_result
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+	  for arg in $args; do
+	    IFS="$save_ifs"
+	    func_append_quoted lastarg "$arg"
+	  done
+	  IFS="$save_ifs"
+	  func_stripname ' ' '' "$lastarg"
+	  lastarg=$func_stripname_result
 
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		dlfiles="$dlfiles $pic_object"
-		prev=
-		continue
-	      else
-		# If libtool objects are unsupported, then we need to preload.
-		prev=dlprefiles
-	      fi
-	    fi
+	  # Add the arguments to base_compile.
+	  func_append base_compile " $lastarg"
+	  continue
+	  ;;
 
-	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
-	      # Preload the old-style object.
-	      dlprefiles="$dlprefiles $pic_object"
-	      prev=
-	    fi
+	*)
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
 
-	    # A PIC object.
-	    libobjs="$libobjs $pic_object"
-	    arg="$pic_object"
-	  fi
+      # Aesthetically quote the previous argument.
+      func_append_quoted base_compile "$lastarg"
+    done # for arg
 
-	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with \`-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+	func_basename "$srcfile"
+	libobj="$func_basename_result"
+      }
+      ;;
+    esac
 
-	    # A standard non-PIC object
-	    non_pic_objects="$non_pic_objects $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
-	    fi
-	  else
-	    # If the PIC object exists, use it instead.
-	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
-	    non_pic_objects="$non_pic_objects $non_pic_object"
-	  fi
-	else
-	  # Only an error if not doing a dry-run.
-	  if test -z "$run"; then
-	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-	    exit $EXIT_FAILURE
-	  else
-	    # Dry-run case.
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
 
-	    # Extract subdirectory from the argument.
-	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-	    if test "X$xdir" = "X$arg"; then
-	      xdir=
-	    else
-	      xdir="$xdir/"
-	    fi
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      ;;
+    esac
 
-	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
-	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
-	    libobjs="$libobjs $pic_object"
-	    non_pic_objects="$non_pic_objects $non_pic_object"
-	  fi
-	fi
-	;;
+    func_infer_tag $base_compile
 
-      *.$libext)
-	# An archive.
-	deplibs="$deplibs $arg"
-	old_deplibs="$old_deplibs $arg"
+    for arg in $later; do
+      case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
 	continue
 	;;
 
-      *.la)
-	# A libtool-controlled library.
+      -static)
+	build_libtool_libs=no
+	build_old_libs=yes
+	continue
+	;;
 
-	if test "$prev" = dlfiles; then
-	  # This library was specified with -dlopen.
-	  dlfiles="$dlfiles $arg"
-	  prev=
-	elif test "$prev" = dlprefiles; then
-	  # The library was specified with -dlpreopen.
-	  dlprefiles="$dlprefiles $arg"
-	  prev=
-	else
-	  deplibs="$deplibs $arg"
-	fi
+      -prefer-pic)
+	pic_mode=yes
 	continue
 	;;
 
-      # Some other compiler argument.
-      *)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
+      -prefer-non-pic)
+	pic_mode=no
+	continue
 	;;
-      esac # arg
+      esac
+    done
 
-      # Now actually substitute the argument into the commands.
-      if test -n "$arg"; then
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
-      fi
-    done # argument parsing loop
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
+    lobj=${xdir}$objdir/$objname
 
-    if test -n "$prev"; then
-      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
 
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
-      eval arg=\"$export_dynamic_flag_spec\"
-      compile_command="$compile_command $arg"
-      finalize_command="$finalize_command $arg"
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
     fi
 
-    oldlibs=
-    # calculate the name of the file, without its directory
-    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
-    libobjs_save="$libobjs"
-
-    if test -n "$shlibpath_var"; then
-      # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
-    else
-      shlib_search_path=
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
     fi
-    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
-    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
-    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
-    if test "X$output_objdir" = "X$output"; then
-      output_objdir="$objdir"
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
     else
-      output_objdir="$output_objdir/$objdir"
+      output_obj=
+      need_locks=no
+      lockfile=
     fi
-    # Create the object directory.
-    if test ! -d "$output_objdir"; then
-      $show "$mkdir $output_objdir"
-      $run $mkdir $output_objdir
-      exit_status=$?
-      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
-	exit $exit_status
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
       fi
+      func_append removelist " $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
     fi
 
-    # Determine the type of output
-    case $output in
-    "")
-      $echo "$modename: you must specify an output file" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-      ;;
-    *.$libext) linkmode=oldlib ;;
-    *.lo | *.$objext) linkmode=obj ;;
-    *.la) linkmode=lib ;;
-    *) linkmode=prog ;; # Anything else should be a program.
-    esac
+    $opt_dry_run || $RM $removelist
+    func_append removelist " $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
 
-    case $host in
-    *cygwin* | *mingw* | *pw32*)
-      # don't eliminate duplications in $postdeps and $predeps
-      duplicate_compiler_generated_deps=yes
-      ;;
-    *)
-      duplicate_compiler_generated_deps=$duplicate_deps
-      ;;
-    esac
-    specialdeplibs=
+    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+    srcfile=$func_to_tool_file_result
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
 
-    libs=
-    # Find all interdependent deplibs by searching for libraries
-    # that are linked more than once (e.g. -la -lb -la)
-    for deplib in $deplibs; do
-      if test "X$duplicate_deps" = "Xyes" ; then
-	case "$libs " in
-	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	esac
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $qsrcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
       fi
-      libs="$libs $deplib"
-    done
 
-    if test "$linkmode" = lib; then
-      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+      func_mkdir_p "$xdir$objdir"
 
-      # Compute libraries that are listed more than once in $predeps
-      # $postdeps and mark them as special (i.e., whose duplicates are
-      # not to be eliminated).
-      pre_post_deps=
-      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
-	for pre_post_dep in $predeps $postdeps; do
-	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
-	  esac
-	  pre_post_deps="$pre_post_deps $pre_post_dep"
-	done
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	func_append command " -o $lobj"
       fi
-      pre_post_deps=
-    fi
 
-    deplibs=
-    newdependency_libs=
-    newlib_search_path=
-    need_relink=no # whether we're linking any uninstalled libtool libraries
-    notinst_deplibs= # not-installed libtool libraries
-    case $linkmode in
-    lib)
-	passes="conv link"
-	for file in $dlfiles $dlprefiles; do
-	  case $file in
-	  *.la) ;;
-	  *)
-	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
-	    exit $EXIT_FAILURE
-	    ;;
-	  esac
-	done
-	;;
-    prog)
-	compile_deplibs=
-	finalize_deplibs=
-	alldeplibs=no
-	newdlfiles=
-	newdlprefiles=
-	passes="conv scan dlopen dlpreopen link"
-	;;
-    *)  passes="conv"
-	;;
-    esac
-    for pass in $passes; do
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
-	deplibs=
+      func_show_eval_locale "$command"	\
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
       fi
-      if test "$linkmode" = prog; then
-	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
-	esac
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	func_show_eval '$MV "$output_obj" "$lobj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
       fi
-      if test "$pass" = dlopen; then
-	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
-	deplibs=
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+	suppress_output=' >/dev/null 2>&1'
       fi
-      for deplib in $libs; do
-	lib=
-	found=no
-	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
-	  if test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    compiler_flags="$compiler_flags $deplib"
-	  fi
-	  continue
-	  ;;
-	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
-	    continue
-	  fi
-	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
-	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
-	    for search_ext in .la $std_shrext .so .a; do
-	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
-	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
-		else
-		  found=no
-		fi
-		break 2
-	      fi
-	    done
-	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
-	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
-	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	      case " $predeps $postdeps " in
-	      *" $deplib "*)
-		if (${SED} -e '2q' $lib |
-                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-		  library_names=
-		  old_library=
-		  case $lib in
-		  */* | *\\*) . $lib ;;
-		  *) . ./$lib ;;
-		  esac
-		  for l in $old_library $library_names; do
-		    ll="$l"
-		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
-		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
-		    test "X$ladir" = "X$lib" && ladir="."
-		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
-		      compile_deplibs="$deplib $compile_deplibs"
-		      finalize_deplibs="$deplib $finalize_deplibs"
-		    else
-		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-		    fi
-		    continue
-		  fi
-		fi
-	        ;;
-	      *) ;;
-	      esac
-	    fi
-	  fi
-	  ;; # -l
-	-L*)
-	  case $linkmode in
-	  lib)
-	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
-	    newdependency_libs="$deplib $newdependency_libs"
-	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
-	    ;;
-	  prog)
-	    if test "$pass" = conv; then
-	      deplibs="$deplib $deplibs"
-	      continue
-	    fi
-	    if test "$pass" = scan; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
-	    ;;
-	  *)
-	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
-	    ;;
-	  esac # linkmode
-	  continue
-	  ;; # -L
-	-R*)
-	  if test "$pass" = link; then
-	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
-	    # Make sure the xrpath contains only unique directories.
-	    case "$xrpath " in
-	    *" $dir "*) ;;
-	    *) xrpath="$xrpath $dir" ;;
-	    esac
-	  fi
-	  deplibs="$deplib $deplibs"
-	  continue
-	  ;;
-	*.la) lib="$deplib" ;;
-	*.$libext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	    continue
-	  fi
-	  case $linkmode in
-	  lib)
-	    valid_a_lib=no
-	    case $deplibs_check_method in
-	      match_pattern*)
-		set dummy $deplibs_check_method
-	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
-		if eval $echo \"$deplib\" 2>/dev/null \
-		    | $SED 10q \
-		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		  valid_a_lib=yes
-		fi
-		;;
-	      pass_all)
-		valid_a_lib=yes
-		;;
-            esac
-	    if test "$valid_a_lib" != yes; then
-	      $echo
-	      $echo "*** Warning: Trying to link with static lib archive $deplib."
-	      $echo "*** I have the capability to make that library automatically link in when"
-	      $echo "*** you link to this library.  But I can only do this if you have a"
-	      $echo "*** shared version of the library, which you do not appear to have"
-	      $echo "*** because the file extensions .$libext of this argument makes me believe"
-	      $echo "*** that it is just a static archive that I should not used here."
-	    else
-	      $echo
-	      $echo "*** Warning: Linking the shared library $output against the"
-	      $echo "*** static library $deplib is not portable!"
-	      deplibs="$deplib $deplibs"
-	    fi
-	    continue
-	    ;;
-	  prog)
-	    if test "$pass" != link; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    continue
-	    ;;
-	  esac # linkmode
-	  ;; # *.$libext
-	*.lo | *.$objext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
-	      # If there is no dlopen support or we're linking statically,
-	      # we need to preload.
-	      newdlprefiles="$newdlprefiles $deplib"
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      newdlfiles="$newdlfiles $deplib"
-	    fi
-	  fi
-	  continue
-	  ;;
-	%DEPLIBS%)
-	  alldeplibs=yes
-	  continue
-	  ;;
-	esac # case $deplib
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
-	  exit $EXIT_FAILURE
-	fi
+    fi
 
-	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-	  exit $EXIT_FAILURE
-	fi
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $qsrcfile$pie_flag"
+      else
+	command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	func_append command " -o $obj"
+      fi
 
-	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$ladir" = "X$lib" && ladir="."
+      # Suppress compiler output if we already did a PIC compilation.
+      func_append command "$suppress_output"
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
-	dlname=
-	dlopen=
-	dlpreopen=
-	libdir=
-	library_names=
-	old_library=
-	# If the library was installed with an old release of libtool,
-	# it will not redefine variables installed, or shouldnotlink
-	installed=yes
-	shouldnotlink=no
-	avoidtemprpath=
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
 
+but it should contain:
+$srcfile
 
-	# Read the .la file
-	case $lib in
-	*/* | *\\*) . $lib ;;
-	*) . ./$lib ;;
-	esac
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
 
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
-	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
-	fi
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
 
-	if test "$pass" = conv; then
-	  # Only check for convenience libraries
-	  deplibs="$lib $deplibs"
-	  if test -z "$libdir"; then
-	    if test -z "$old_library"; then
-	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-	      exit $EXIT_FAILURE
-	    fi
-	    # It is a libtool convenience library, so add in its objects.
-	    convenience="$convenience $ladir/$objdir/$old_library"
-	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
-	    tmp_libs=
-	    for deplib in $dependency_libs; do
-	      deplibs="$deplib $deplibs"
-              if test "X$duplicate_deps" = "Xyes" ; then
-	        case "$tmp_libs " in
-	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	        esac
-              fi
-	      tmp_libs="$tmp_libs $deplib"
-	    done
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	  continue
-	fi # $pass = conv
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	func_show_eval '$MV "$output_obj" "$obj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
 
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
 
-	# Get the name of the library we link against.
-	linklib=
-	for l in $old_library $library_names; do
-	  linklib="$l"
-	done
-	if test -z "$linklib"; then
-	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-	  exit $EXIT_FAILURE
-	fi
+      # Unlock the critical section if it was locked
+      if test "$need_locks" != no; then
+	removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
 
-	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
-	    # If there is no dlname, no dlopen support or we're linking
-	    # statically, we need to preload.  We also need to preload any
-	    # dependent libraries so libltdl's deplib preloader doesn't
-	    # bomb out in the load deplibs phase.
-	    dlprefiles="$dlprefiles $lib $dependency_libs"
-	  else
-	    newdlfiles="$newdlfiles $lib"
-	  fi
-	  continue
-	fi # $pass = dlopen
+    exit $EXIT_SUCCESS
+}
 
-	# We need an absolute path.
-	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
-	*)
-	  abs_ladir=`cd "$ladir" && pwd`
-	  if test -z "$abs_ladir"; then
-	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
-	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
-	    abs_ladir="$ladir"
-	  fi
-	  ;;
-	esac
-	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+$opt_help || {
+  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
 
-	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
-	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
-	  else
-	    dir="$libdir"
-	    absdir="$libdir"
-	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
-	else
-	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    # Remove this search path later
-	    notinst_path="$notinst_path $abs_ladir"
-	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
-	    # Remove this search path later
-	    notinst_path="$notinst_path $abs_ladir"
-	  fi
-	fi # $installed = yes
-	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $opt_mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
 
-	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir"; then
-	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	  # Prefer using a static library (so that no silly _DYNAMIC symbols
-	  # are required to link).
-	  if test -n "$old_library"; then
-	    newdlprefiles="$newdlprefiles $dir/$old_library"
-	  # Otherwise, use the dlname, so that lt_dlopen finds it.
-	  elif test -n "$dlname"; then
-	    newdlprefiles="$newdlprefiles $dir/$dlname"
-	  else
-	    newdlprefiles="$newdlprefiles $dir/$linklib"
-	  fi
-	fi # $pass = dlpreopen
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
 
-	if test -z "$libdir"; then
-	  # Link the convenience library
-	  if test "$linkmode" = lib; then
-	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$dir/$old_library $compile_deplibs"
-	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
-	  else
-	    deplibs="$lib $deplibs" # used for prog,scan pass
-	  fi
-	  continue
-	fi
+Remove files from the build directory.
 
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
 
-	if test "$linkmode" = prog && test "$pass" != link; then
-	  newlib_search_path="$newlib_search_path $ladir"
-	  deplibs="$lib $deplibs"
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
 
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
-	  fi
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
 
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    case $deplib in
-	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
-	    esac
-	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      # Need to hardcode shared library paths
-	      # or/and link against static libraries
-	      newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    if test "X$duplicate_deps" = "Xyes" ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	      esac
-	    fi
-	    tmp_libs="$tmp_libs $deplib"
-	  done # for deplib
-	  continue
-	fi # $linkmode = prog...
+Compile a source file into a libtool library object.
 
-	if test "$linkmode,$pass" = "prog,link"; then
-	  if test -n "$library_names" &&
-         { { test "$prefer_static_libs" = no ||
-             test "$prefer_static_libs,$installed" = "built,yes"; } ||
-           test -z "$old_library"; }; then
-	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
-	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath " in
-	      *" $dir "*) ;;
-	      *" $absdir "*) ;;
-	      *) temp_rpath="$temp_rpath $absdir" ;;
-	      esac
-	    fi
+This mode accepts the following additional options:
 
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) compile_rpath="$compile_rpath $absdir"
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) finalize_rpath="$finalize_rpath $libdir"
-	      esac
-	      ;;
-	    esac
-	  fi # $linkmode,$pass = prog,link...
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to build PIC objects only
+  -prefer-non-pic   try to build non-PIC objects only
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
+  -Wc,FLAG          pass FLAG directly to the compiler
 
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
-		 test -n "$library_names"; }; }; then
-	    # We only need to search for static libraries
-	    continue
-	  fi
-	fi
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
 
-	link_static=no # Whether the deplib will be linked statically
-	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes ; then
-	  use_static_libs=no
-	fi
-	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
-	  if test "$installed" = no; then
-	    notinst_deplibs="$notinst_deplibs $lib"
-	    need_relink=yes
-	  fi
-	  # This is a shared library
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+        ;;
 
-	  # Warn about portability, can't link against -module's on
-	  # some systems (darwin)
-	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
-	    $echo
-	    if test "$linkmode" = prog; then
-	      $echo "*** Warning: Linking the executable $output against the loadable module"
-	    else
-	      $echo "*** Warning: Linking the shared library $output against the loadable module"
-	    fi
-	    $echo "*** $linklib is not portable!"
-	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) compile_rpath="$compile_rpath $absdir"
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) finalize_rpath="$finalize_rpath $libdir"
-	      esac
-	      ;;
-	    esac
-	  fi
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
 
-	  if test -n "$old_archive_from_expsyms_cmds"; then
-	    # figure out the soname
-	    set dummy $library_names
-	    realname="$2"
-	    shift; shift
-	    libname=`eval \\$echo \"$libname_spec\"`
-	    # use dlname if we got it. it's perfectly good, no?
-	    if test -n "$dlname"; then
-	      soname="$dlname"
-	    elif test -n "$soname_spec"; then
-	      # bleh windows
-	      case $host in
-	      *cygwin* | mingw*)
-		major=`expr $current - $age`
-		versuffix="-$major"
-		;;
-	      esac
-	      eval soname=\"$soname_spec\"
-	    else
-	      soname="$realname"
-	    fi
+Automatically set library path, then run a program.
 
-	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
-	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
-	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+This mode accepts the following additional options:
 
-	    # If the library has no export list, then create one now
-	    if test -f "$output_objdir/$soname-def"; then :
-	    else
-	      $show "extracting exported symbol list from \`$soname'"
-	      save_ifs="$IFS"; IFS='~'
-	      cmds=$extract_expsyms_cmds
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd" || exit $?
-	      done
-	      IFS="$save_ifs"
-	    fi
+  -dlopen FILE      add the directory containing FILE to the library path
 
-	    # Create $newlib
-	    if test -f "$output_objdir/$newlib"; then :; else
-	      $show "generating import library for \`$soname'"
-	      save_ifs="$IFS"; IFS='~'
-	      cmds=$old_archive_from_expsyms_cmds
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd" || exit $?
-	      done
-	      IFS="$save_ifs"
-	    fi
-	    # make sure the library variables are pointing to the new library
-	    dir=$output_objdir
-	    linklib=$newlib
-	  fi # test -n "$old_archive_from_expsyms_cmds"
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
 
-	  if test "$linkmode" = prog || test "$mode" != relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    lib_linked=yes
-	    case $hardcode_action in
-	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
-		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
-		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
-		  *-*-darwin* )
-		    # if the lib is a module then we can not link against
-		    # it, someone is ignoring the new warnings I added
-		    if /usr/bin/file -L $add 2> /dev/null |
-                      $EGREP ": [^:]* bundle" >/dev/null ; then
-		      $echo "** Warning, lib $linklib is a module, not a shared library"
-		      if test -z "$old_library" ; then
-		        $echo
-		        $echo "** And there doesn't seem to be a static archive available"
-		        $echo "** The link will probably fail, sorry"
-		      else
-		        add="$dir/$old_library"
-		      fi
-		    fi
-		esac
-	      elif test "$hardcode_minus_L" = no; then
-		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
-		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    relink)
-	      if test "$hardcode_direct" = yes; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$dir"
-		# Try looking first in the location we're being installed to.
-		if test -n "$inst_prefix_dir"; then
-		  case $libdir in
-		    [\\/]*)
-		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
-		      ;;
-		  esac
-		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    *) lib_linked=no ;;
-	    esac
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
 
-	    if test "$lib_linked" != yes; then
-	      $echo "$modename: configuration error: unsupported hardcode properties"
-	      exit $EXIT_FAILURE
-	    fi
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
 
-	    if test -n "$add_shlibpath"; then
-	      case :$compile_shlibpath: in
-	      *":$add_shlibpath:"*) ;;
-	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
-	      esac
-	    fi
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
-	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes && \
-		 test "$hardcode_minus_L" != yes && \
-		 test "$hardcode_shlibpath_var" = yes; then
-		case :$finalize_shlibpath: in
-		*":$libdir:"*) ;;
-		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
-		esac
-	      fi
-	    fi
-	  fi
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
 
-	  if test "$linkmode" = prog || test "$mode" = relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
-	      case :$finalize_shlibpath: in
-	      *":$libdir:"*) ;;
-	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
-	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
-	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-	        add="$inst_prefix_dir$libdir/$linklib"
-	      else
-	        add="$libdir/$linklib"
-	      fi
-	    else
-	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
-	      # Try looking first in the location we're being installed to.
-	      if test -n "$inst_prefix_dir"; then
-		case $libdir in
-		  [\\/]*)
-		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
-		    ;;
-		esac
-	      fi
-	      add="-l$name"
-	    fi
+Complete the installation of libtool libraries.
 
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
-	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	    fi
-	  fi
-	elif test "$linkmode" = prog; then
-	  # Here we assume that one of hardcode_direct or hardcode_minus_L
-	  # is not unsupported.  This is valid on all known static and
-	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
-	    compile_deplibs="$dir/$linklib $compile_deplibs"
-	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
-	  else
-	    compile_deplibs="-l$name -L$dir $compile_deplibs"
-	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
-	  fi
-	elif test "$build_libtool_libs" = yes; then
-	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
-	    # We're trying link a shared library against a static one
-	    # but the system doesn't support it.
+Each LIBDIR is a directory that contains libtool libraries.
 
-	    # Just print a warning and add the library to dependency_libs so
-	    # that the program can be linked against the static library.
-	    $echo
-	    $echo "*** Warning: This system can not link to static lib archive $lib."
-	    $echo "*** I have the capability to make that library automatically link in when"
-	    $echo "*** you link to this library.  But I can only do this if you have a"
-	    $echo "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
-	      $echo "*** But as you try to build a module library, libtool will still create "
-	      $echo "*** a static module, that should work as long as the dlopening application"
-	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
-	      if test -z "$global_symbol_pipe"; then
-		$echo
-		$echo "*** However, this would only work if libtool was able to extract symbol"
-		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-		$echo "*** not find such a program.  So, this module is probably useless."
-		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
-	      fi
-	      if test "$build_old_libs" = no; then
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  else
-	    deplibs="$dir/$old_library $deplibs"
-	    link_static=yes
-	  fi
-	fi # link shared/static library?
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+        ;;
 
-	if test "$linkmode" = lib; then
-	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
-	    # Extract -R from dependency_libs
-	    temp_deplibs=
-	    for libdir in $dependency_libs; do
-	      case $libdir in
-	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
-		   case " $xrpath " in
-		   *" $temp_xrpath "*) ;;
-		   *) xrpath="$xrpath $temp_xrpath";;
-		   esac;;
-	      *) temp_deplibs="$temp_deplibs $libdir";;
-	      esac
-	    done
-	    dependency_libs="$temp_deplibs"
-	  fi
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
 
-	  newlib_search_path="$newlib_search_path $absdir"
-	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
-	  # ... and its dependency_libs
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    newdependency_libs="$deplib $newdependency_libs"
-	    if test "X$duplicate_deps" = "Xyes" ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	      esac
-	    fi
-	    tmp_libs="$tmp_libs $deplib"
-	  done
+Install executables or libraries.
 
-	  if test "$link_all_deplibs" != no; then
-	    # Add the search paths of all dependency libraries
-	    for deplib in $dependency_libs; do
-	      case $deplib in
-	      -L*) path="$deplib" ;;
-	      *.la)
-		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
-		test "X$dir" = "X$deplib" && dir="."
-		# We need an absolute path.
-		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
-		*)
-		  absdir=`cd "$dir" && pwd`
-		  if test -z "$absdir"; then
-		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
-		    absdir="$dir"
-		  fi
-		  ;;
-		esac
-		if grep "^installed=no" $deplib > /dev/null; then
-		  path="$absdir/$objdir"
-		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		  if test -z "$libdir"; then
-		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-		    exit $EXIT_FAILURE
-		  fi
-		  if test "$absdir" != "$libdir"; then
-		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
-		  fi
-		  path="$absdir"
-		fi
-		depdepl=
-		case $host in
-		*-*-darwin*)
-		  # we do not want to link against static libs,
-		  # but need to link against shared
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
-		      depdepl=$tmp
-		    done
-		    if test -f "$path/$depdepl" ; then
-		      depdepl="$path/$depdepl"
-		    fi
-		    # do not add paths which are already there
-		    case " $newlib_search_path " in
-		    *" $path "*) ;;
-		    *) newlib_search_path="$newlib_search_path $path";;
-		    esac
-		  fi
-		  path=""
-		  ;;
-		*)
-		  path="-L$path"
-		  ;;
-		esac
-		;;
-	      -l*)
-		case $host in
-		*-*-darwin*)
-		  # Again, we only want to link against shared libraries
-		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
-		  for tmp in $newlib_search_path ; do
-		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
-		      eval depdepl="$tmp/lib$tmp_libs.dylib"
-		      break
-		    fi
-		  done
-		  path=""
-		  ;;
-		*) continue ;;
-		esac
-		;;
-	      *) continue ;;
-	      esac
-	      case " $deplibs " in
-	      *" $path "*) ;;
-	      *) deplibs="$path $deplibs" ;;
-	      esac
-	      case " $deplibs " in
-	      *" $depdepl "*) ;;
-	      *) deplibs="$depdepl $deplibs" ;;
-	      esac
-	    done
-	  fi # link_all_deplibs != no
-	fi # linkmode = lib
-      done # for deplib in $libs
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
-	# Link the dlpreopened libraries before other libraries
-	for deplib in $save_deplibs; do
-	  deplibs="$deplib $deplibs"
-	done
-      fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
-	  # Make sure lib_search_path contains only unique directories.
-	  lib_search_path=
-	  for dir in $newlib_search_path; do
-	    case "$lib_search_path " in
-	    *" $dir "*) ;;
-	    *) lib_search_path="$lib_search_path $dir" ;;
-	    esac
-	  done
-	  newlib_search_path=
-	fi
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
 
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
-	  vars="compile_deplibs finalize_deplibs"
-	fi
-	for var in $vars dependency_libs; do
-	  # Add libraries to $var in reverse order
-	  eval tmp_libs=\"\$$var\"
-	  new_libs=
-	  for deplib in $tmp_libs; do
-	    # FIXME: Pedantically, this is the right thing to do, so
-	    #        that some nasty dependency loop isn't accidentally
-	    #        broken:
-	    #new_libs="$deplib $new_libs"
-	    # Pragmatically, this seems to cause very few problems in
-	    # practice:
-	    case $deplib in
-	    -L*) new_libs="$deplib $new_libs" ;;
-	    -R*) ;;
-	    *)
-	      # And here is the reason: when a library appears more
-	      # than once as an explicit dependence of a library, or
-	      # is implicitly linked in more than once by the
-	      # compiler, it is considered special, and multiple
-	      # occurrences thereof are not removed.  Compare this
-	      # with having the same library being listed as a
-	      # dependency of multiple other libraries: in this case,
-	      # we know (pedantically, we assume) the library does not
-	      # need to be listed more than once, so we keep only the
-	      # last copy.  This is not always right, but it is rare
-	      # enough that we require users that really mean to play
-	      # such unportable linking tricks to link the library
-	      # using -Wl,-lname, so that libtool does not consider it
-	      # for duplicate removal.
-	      case " $specialdeplibs " in
-	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
-	      *)
-		case " $new_libs " in
-		*" $deplib "*) ;;
-		*) new_libs="$deplib $new_libs" ;;
-		esac
-		;;
-	      esac
-	      ;;
-	    esac
-	  done
-	  tmp_libs=
-	  for deplib in $new_libs; do
-	    case $deplib in
-	    -L*)
-	      case " $tmp_libs " in
-	      *" $deplib "*) ;;
-	      *) tmp_libs="$tmp_libs $deplib" ;;
-	      esac
-	      ;;
-	    *) tmp_libs="$tmp_libs $deplib" ;;
-	    esac
-	  done
-	  eval $var=\"$tmp_libs\"
-	done # for var
-      fi
-      # Last step: remove runtime libs from dependency_libs
-      # (they stay in deplibs)
-      tmp_libs=
-      for i in $dependency_libs ; do
-	case " $predeps $postdeps $compiler_lib_search_path " in
-	*" $i "*)
-	  i=""
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+  -Wc,FLAG
+  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
+  -Wl,FLAG
+  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
+  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode \`$opt_mode'"
+        ;;
+    esac
+
+    echo
+    $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+  if test "$opt_help" = :; then
+    func_mode_help
+  else
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	func_mode_help
+      done
+    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	echo
+	func_mode_help
+      done
+    } |
+    sed '1d
+      /^When reporting/,/^Report/{
+	H
+	d
+      }
+      $x
+      /information about other modes/d
+      /more detailed .*MODE/d
+      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+  fi
+  exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $opt_debug
+    # The first argument is the command name.
+    cmd="$nonopt"
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $opt_dlopen; do
+      test -f "$file" \
+	|| func_fatal_help "\`$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+	func_source "$file"
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && \
+	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  func_append dir "/$objdir"
+	else
+	  if test ! -f "$dir/$dlname"; then
+	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+	;;
+
+      *)
+	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -* | *.la | *.lo ) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if func_ltwrapper_script_p "$file"; then
+	  func_source "$file"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	elif func_ltwrapper_executable_p "$file"; then
+	  func_ltwrapper_scriptname "$file"
+	  func_source "$func_ltwrapper_scriptname_result"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_append_quoted args "$file"
+    done
+
+    if test "X$opt_dry_run" = Xfalse; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+	eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+	      else
+		$lt_unset $lt_var
+	      fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $opt_debug
+    libs=
+    libdirs=
+    admincmds=
+
+    for opt in "$nonopt" ${1+"$@"}
+    do
+      if test -d "$opt"; then
+	func_append libdirs " $opt"
+
+      elif test -f "$opt"; then
+	if func_lalib_unsafe_p "$opt"; then
+	  func_append libs " $opt"
+	else
+	  func_warning "\`$opt' is not a valid libtool archive"
+	fi
+
+      else
+	func_fatal_error "invalid argument \`$opt'"
+      fi
+    done
+
+    if test -n "$libs"; then
+      if test -n "$lt_sysroot"; then
+        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+      else
+        sysroot_cmd=
+      fi
+
+      # Remove sysroot references
+      if $opt_dry_run; then
+        for lib in $libs; do
+          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+        done
+      else
+        tmpdir=`func_mktempdir`
+        for lib in $libs; do
+	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	    > $tmpdir/tmp-la
+	  mv -f $tmpdir/tmp-la $lib
+	done
+        ${RM}r "$tmpdir"
+      fi
+    fi
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $opt_dry_run || eval "$cmds" || func_append admincmds "
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    $opt_silent && exit $EXIT_SUCCESS
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      echo "----------------------------------------------------------------------"
+      echo "Libraries have been installed in:"
+      for libdir in $libdirs; do
+	$ECHO "   $libdir"
+      done
+      echo
+      echo "If you ever happen to want to link against installed libraries"
+      echo "in a given directory, LIBDIR, you must either use libtool, and"
+      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "flag during linking and do at least one of the following:"
+      if test -n "$shlibpath_var"; then
+	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+	echo "     during execution"
+      fi
+      if test -n "$runpath_var"; then
+	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+	echo "     during linking"
+      fi
+      if test -n "$hardcode_libdir_flag_spec"; then
+	libdir=LIBDIR
+	eval flag=\"$hardcode_libdir_flag_spec\"
+
+	$ECHO "   - use the \`$flag' linker flag"
+      fi
+      if test -n "$admincmds"; then
+	$ECHO "   - have your system administrator run these commands:$admincmds"
+      fi
+      if test -f /etc/ld.so.conf; then
+	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+      fi
+      echo
+
+      echo "See any operating system documentation about shared libraries for"
+      case $host in
+	solaris2.[6789]|solaris2.1[0-9])
+	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	  echo "pages."
+	  ;;
+	*)
+	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
+	  ;;
+      esac
+      echo "----------------------------------------------------------------------"
+    fi
+    exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $opt_debug
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       case $nonopt in *shtool*) :;; *) false;; esac; then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    func_append install_prog "$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
+    case " $install_prog " in
+      *[\\\ /]cp\ *) install_cp=: ;;
+      *) install_cp=false ;;
+    esac
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    no_mode=:
+    for arg
+    do
+      arg2=
+      if test -n "$dest"; then
+	func_append files " $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f)
+	if $install_cp; then :; else
+	  prev=$arg
+	fi
+	;;
+      -g | -m | -o)
+	prev=$arg
+	;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	    arg2=$install_override_mode
+	    no_mode=false
+	  fi
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      func_append install_prog " $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+	func_quote_for_eval "$arg2"
+      fi
+      func_append install_shared_prog " $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prev' option requires an argument"
+
+    if test -n "$install_override_mode" && $no_mode; then
+      if $install_cp; then :; else
+	func_quote_for_eval "$install_override_mode"
+	func_append install_shared_prog " -m $func_quote_for_eval_result"
+      fi
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	func_fatal_help "no file or destination specified"
+      else
+	func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+	func_fatal_help "\`$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	func_append staticlibs " $file"
+	;;
+
+      *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$file' is not a valid libtool archive"
+
+	library_names=
+	old_library=
+	relink_command=
+	func_source "$file"
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) func_append current_libdirs " $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) func_append future_libdirs " $libdir" ;;
+	  esac
+	fi
+
+	func_dirname "$file" "/" ""
+	dir="$func_dirname_result"
+	func_append dir "$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  test "$inst_prefix_dir" = "$destdir" && \
+	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  func_warning "relinking \`$file'"
+	  func_show_eval "$relink_command" \
+	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names; shift
+	if test -n "$1"; then
+	  realname="$1"
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+	      'exit $?'
+	  tstripme="$stripme"
+	  case $host_os in
+	  cygwin* | mingw* | pw32* | cegcc*)
+	    case $realname in
+	    *.dll.a)
+	      tstripme=""
+	      ;;
+	    esac
+	    ;;
+	  esac
+	  if test -n "$tstripme" && test -n "$striplib"; then
+	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      test "$linkname" != "$realname" \
+		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  func_execute_cmds "$postinstall_cmds" 'exit $?'
+	fi
+
+	# Install the pseudo-library for information purposes.
+	func_basename "$file"
+	name="$func_basename_result"
+	instname="$dir/$name"i
+	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  func_lo2o "$destfile"
+	  staticdest=$func_lo2o_result
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	test -n "$destfile" && \
+	  func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  func_lo2o "$file"
+	  staticobj=$func_lo2o_result
+	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      func_stripname '' '.exe' "$file"
+	      file=$func_stripname_result
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin* | *mingw*)
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      wrapper=$func_ltwrapper_scriptname_result
+	    else
+	      func_stripname '' '.exe' "$file"
+	      wrapper=$func_stripname_result
+	    fi
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if func_ltwrapper_script_p "$wrapper"; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  func_source "$wrapper"
+
+	  # Check the variables that should have been set.
+	  test -z "$generated_by_libtool_version" && \
+	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      func_source "$lib"
+	    fi
+	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      func_warning "\`$lib' has not been installed in \`$libdir'"
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  func_source "$wrapper"
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    $opt_dry_run || {
+	      if test "$finalize" = yes; then
+	        tmpdir=`func_mktempdir`
+		func_basename "$file$stripped_ext"
+		file="$func_basename_result"
+	        outputname="$tmpdir/$file"
+	        # Replace the output file specification.
+	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+	        $opt_silent || {
+	          func_quote_for_expand "$relink_command"
+		  eval "func_echo $func_quote_for_expand_result"
+	        }
+	        if eval "$relink_command"; then :
+	          else
+		  func_error "error: relink \`$file' with the above command before installing it"
+		  $opt_dry_run || ${RM}r "$tmpdir"
+		  continue
+	        fi
+	        file="$outputname"
+	      else
+	        func_warning "cannot relink \`$file'"
+	      fi
+	    }
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    func_stripname '' '.exe' "$destfile"
+	    destfile=$func_stripname_result
+	    ;;
+	  esac
+	  ;;
+	esac
+	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+	$opt_dry_run || if test -n "$outputname"; then
+	  ${RM}r "$tmpdir"
+	fi
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name="$func_basename_result"
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+      tool_oldlib=$func_to_tool_file_result
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	my_dlsyms="${my_outputname}S.c"
+      else
+	func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+	# Discover the nlist of each of the dlfiles.
+	nlist="$output_objdir/${my_outputname}.nm"
+
+	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+	# Parse the name list into a source file.
+	func_verbose "creating $output_objdir/$my_dlsyms"
+
+	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+	if test "$dlself" = yes; then
+	  func_verbose "generating symbol list for \`$output'"
+
+	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+	  # Add our own program objects to the symbol list.
+	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	  for progfile in $progfiles; do
+	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -n "$exclude_expsyms"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  if test -n "$export_symbols_regex"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  # Prepare the list of exported symbols
+	  if test -z "$export_symbols"; then
+	    export_symbols="$output_objdir/$outputname.exp"
+	    $opt_dry_run || {
+	      $RM $export_symbols
+	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      case $host in
+	      *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+	        ;;
+	      esac
+	    }
+	  else
+	    $opt_dry_run || {
+	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	      case $host in
+	        *cygwin* | *mingw* | *cegcc* )
+	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+	          ;;
+	      esac
+	    }
+	  fi
+	fi
+
+	for dlprefile in $dlprefiles; do
+	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_basename "$dlprefile"
+	  name="$func_basename_result"
+          case $host in
+	    *cygwin* | *mingw* | *cegcc* )
+	      # if an import library, we need to obtain dlname
+	      if func_win32_import_lib_p "$dlprefile"; then
+	        func_tr_sh "$dlprefile"
+	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
+	        dlprefile_dlbasename=""
+	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+	          # Use subshell, to avoid clobbering current variable values
+	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+	          if test -n "$dlprefile_dlname" ; then
+	            func_basename "$dlprefile_dlname"
+	            dlprefile_dlbasename="$func_basename_result"
+	          else
+	            # no lafile. user explicitly requested -dlpreopen <import library>.
+	            $sharedlib_from_linklib_cmd "$dlprefile"
+	            dlprefile_dlbasename=$sharedlib_from_linklib_result
+	          fi
+	        fi
+	        $opt_dry_run || {
+	          if test -n "$dlprefile_dlbasename" ; then
+	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+	          else
+	            func_warning "Could not compute DLL name from $name"
+	            eval '$ECHO ": $name " >> "$nlist"'
+	          fi
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+	        }
+	      else # not an import lib
+	        $opt_dry_run || {
+	          eval '$ECHO ": $name " >> "$nlist"'
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	        }
+	      fi
+	    ;;
+	    *)
+	      $opt_dry_run || {
+	        eval '$ECHO ": $name " >> "$nlist"'
+	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	      }
+	    ;;
+          esac
+	done
+
+	$opt_dry_run || {
+	  # Make sure we have at least an empty file.
+	  test -f "$nlist" || : > "$nlist"
+
+	  if test -n "$exclude_expsyms"; then
+	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	    $MV "$nlist"T "$nlist"
+	  fi
+
+	  # Try sorting and uniquifying the output.
+	  if $GREP -v "^: " < "$nlist" |
+	      if sort -k 3 </dev/null >/dev/null 2>&1; then
+		sort -k 3
+	      else
+		sort +2
+	      fi |
+	      uniq > "$nlist"S; then
+	    :
+	  else
+	    $GREP -v "^: " < "$nlist" > "$nlist"S
+	  fi
+
+	  if test -f "$nlist"S; then
+	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+	  else
+	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	  fi
+
+	  echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+  { \"$my_originator\", (void *) 0 },"
+
+	  case $need_lib_prefix in
+	  no)
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  *)
+	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  esac
+	  echo >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	} # !$opt_dry_run
+
+	pic_flag_for_symtable=
+	case "$compile_command " in
+	*" -static "*) ;;
+	*)
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+	  *-*-hpux*)
+	    pic_flag_for_symtable=" $pic_flag"  ;;
+	  *)
+	    if test "X$my_pic_p" != Xno; then
+	      pic_flag_for_symtable=" $pic_flag"
+	    fi
+	    ;;
+	  esac
+	  ;;
+	esac
+	symtab_cflags=
+	for arg in $LTCFLAGS; do
+	  case $arg in
+	  -pie | -fpie | -fPIE) ;;
+	  *) func_append symtab_cflags " $arg" ;;
+	  esac
+	done
+
+	# Now compile the dynamic symbol file.
+	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+	# Clean up the generated files.
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+	# Transform the symbol file into the correct name.
+	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	case $host in
+	*cygwin* | *mingw* | *cegcc* )
+	  if test -f "$output_objdir/$my_outputname.def"; then
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	  else
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  fi
+	  ;;
+	*)
+	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  ;;
+	esac
+	;;
+      *)
+	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+  $opt_debug
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+      func_to_tool_file "$1" func_convert_file_msys_to_w32
+      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	$SED -n -e '
+	    1,100{
+		/ I /{
+		    s,.*,import,
+		    p
+		    q
+		}
+	    }'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+  $opt_debug
+  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+  $opt_debug
+  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+    $SED '/^Contents of section '"$match_literal"':/{
+      # Place marker at beginning of archive member dllname section
+      s/.*/====MARK====/
+      p
+      d
+    }
+    # These lines can sometimes be longer than 43 characters, but
+    # are always uninteresting
+    /:[	 ]*file format pe[i]\{,1\}-/d
+    /^In archive [^:]*:/d
+    # Ensure marker is printed
+    /^====MARK====/p
+    # Remove all lines with less than 43 characters
+    /^.\{43\}/!d
+    # From remaining lines, remove first 43 characters
+    s/^.\{43\}//' |
+    $SED -n '
+      # Join marker and all lines until next marker into a single line
+      /^====MARK====/ b para
+      H
+      $ b para
+      b
+      :para
+      x
+      s/\n//g
+      # Remove the marker
+      s/^====MARK====//
+      # Remove trailing dots and whitespace
+      s/[\. \t]*$//
+      # Print
+      /./p' |
+    # we now have a list, one entry per line, of the stringified
+    # contents of the appropriate section of all members of the
+    # archive which possess that section. Heuristic: eliminate
+    # all those which have a first or second character that is
+    # a '.' (that is, objdump's representation of an unprintable
+    # character.) This should work for all archives with less than
+    # 0x302f exports -- but will fail for DLLs whose name actually
+    # begins with a literal '.' or a single character followed by
+    # a '.'.
+    #
+    # Of those that remain, print the first one.
+    $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+  $opt_debug
+  if func_cygming_gnu_implib_p "$1" ; then
+    # binutils import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+  elif func_cygming_ms_implib_p "$1" ; then
+    # ms-generated import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+  else
+    # unknown
+    sharedlib_from_linklib_result=""
+  fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    if test "$lock_old_archive_extraction" = yes; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+		   'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test "$lock_old_archive_extraction" = yes; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $opt_debug
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib="$func_basename_result"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+	*" $my_xlib_u "*)
+	  func_arith $extracted_serial + 1
+	  extracted_serial=$func_arith_result
+	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
+	*) break ;;
+	esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+	func_verbose "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	$opt_dry_run || {
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`basename "$darwin_archive"`
+	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+	  if test -n "$darwin_arches"; then
+	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+	      $LIPO -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    $RM -rf unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd $darwin_orig_dir
+	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	} # !$opt_dry_run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+	;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+    done
+
+    func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+	func_emit_wrapper_arg1=${1-no}
+
+	$ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    file=\"\$0\""
+
+    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+    ECHO=\"$qECHO\"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  case \" \$* \" in
+  *\\ --lt-*)
+    for lt_wr_arg
+    do
+      case \$lt_wr_arg in
+      --lt-*) ;;
+      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+      esac
+      shift
+    done ;;
+  esac
+  func_exec_program_core \${1+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+	  $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$ECHO \"\$relink_command_output\" >&2
+	$RM \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+	else
+	  $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# fixup the dll searchpath if we need to.
+	#
+	# Fix the DLL searchpath if we need to.  Do this before prepending
+	# to shlibpath, because on Windows, both are PATH and uninstalled
+	# libraries must come first.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	$ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+      func_exec_program \${1+\"\$@\"}
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+	cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+*/
+EOF
+	    cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+#  define _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+	    cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_path "$temp_rpath"
+	      cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test -n "$dllsearchpath"; then
+              func_to_host_path "$dllsearchpath:"
+	      cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test "$fast_install" = yes; then
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+	    else
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+	    fi
+
+
+	    cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  intptr_t rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  newargz = XMALLOC (char *, argc + 1);
+
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], dumpscript_opt) == 0)
+	{
+EOF
+	    case "$host" in
+	      *mingw* | *cygwin* )
+		# make stdout use "unix" line endings
+		echo "          setmode(1,_O_BINARY);"
+		;;
+	      esac
+
+	    cat <<"EOF"
+	  lt_dump_script (stdout);
+	  return 0;
+	}
+      if (strcmp (argv[i], debug_opt) == 0)
+	{
+          lt_debug = 1;
+          continue;
+	}
+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+		    "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+EOF
+	    cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+	    cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+		  tmp_pathspec);
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+		  actual_cwrapper_path);
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(main) libtool target name: %s\n",
+		  target_name);
+EOF
+
+	    cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+	    cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+	    case $host_os in
+	      mingw*)
+	    cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+	*p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+	*p = '/';
+      }
+  }
+EOF
+	    ;;
+	    esac
+
+	    cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
+     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+     because on Windows, both *_VARNAMEs are PATH but uninstalled
+     libraries must come first. */
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+		  nonnull (lt_argv_zero));
+  for (i = 0; i < newargc; i++)
+    {
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+		      i, nonnull (newargz[i]));
+    }
+
+EOF
+
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  newargz = prepare_spawn (newargz);
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      lt_debugprintf (__FILE__, __LINE__,
+		      "(main) failed to launch target \"%s\": %s\n",
+		      lt_argv_zero, nonnull (strerror (errno)));
+      return 127;
+    }
+  return rval;
+EOF
+		;;
+	      *)
+		cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+		;;
+	    esac
+
+	    cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+			  string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char *concat_name;
+
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+	return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+	{
+	  concat_name = xstrdup (wrapper);
+	  if (check_executable (concat_name))
+	    return concat_name;
+	  XFREE (concat_name);
+	}
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+	has_slash = 1;
+	break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+	{
+	  for (p = path; *p; p = p_next)
+	    {
+	      const char *q;
+	      size_t p_len;
+	      for (q = p; *q; q++)
+		if (IS_PATH_SEPARATOR (*q))
+		  break;
+	      p_len = q - p;
+	      p_next = (*q == '\0' ? q : q + 1);
+	      if (p_len == 0)
+		{
+		  /* empty path: current directory */
+		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              nonnull (strerror (errno)));
+		  tmp_len = strlen (tmp);
+		  concat_name =
+		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, tmp, tmp_len);
+		  concat_name[tmp_len] = '/';
+		  strcpy (concat_name + tmp_len + 1, wrapper);
+		}
+	      else
+		{
+		  concat_name =
+		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, p, p_len);
+		  concat_name[p_len] = '/';
+		  strcpy (concat_name + p_len + 1, wrapper);
+		}
+	      if (check_executable (concat_name))
+		return concat_name;
+	      XFREE (concat_name);
+	    }
+	}
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      lt_debugprintf (__FILE__, __LINE__,
+		      "checking path component for symlinks: %s\n",
+		      tmp_pathspec);
+      if (lstat (tmp_pathspec, &s) == 0)
+	{
+	  if (S_ISLNK (s.st_mode) != 0)
+	    {
+	      has_symlinks = 1;
+	      break;
+	    }
+
+	  /* search backwards for last DIR_SEPARATOR */
+	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    p--;
+	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    {
+	      /* no more DIR_SEPARATORS left */
+	      break;
+	    }
+	  *p = '\0';
+	}
+      else
+	{
+	  lt_fatal (__FILE__, __LINE__,
+		    "error accessing file \"%s\": %s",
+		    tmp_pathspec, nonnull (strerror (errno)));
+	}
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal (__FILE__, __LINE__,
+		"could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (strcmp (str, pat) == 0)
+	*str = '\0';
+    }
+  return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+	       int line, const char *mode,
+	       const char *message, va_list ap)
+{
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+  va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    int len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[len-1] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+EOF
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+	new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+	{
+	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+	  size_t length;
+	  unsigned int backslashes;
+	  const char *s;
+	  char *quoted_string;
+	  char *p;
+
+	  length = 0;
+	  backslashes = 0;
+	  if (quote_around)
+	    length++;
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		length += backslashes + 1;
+	      length++;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    length += backslashes + 1;
+
+	  quoted_string = XMALLOC (char, length + 1);
+
+	  p = quoted_string;
+	  backslashes = 0;
+	  if (quote_around)
+	    *p++ = '"';
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		{
+		  unsigned int j;
+		  for (j = backslashes + 1; j > 0; j--)
+		    *p++ = '\\';
+		}
+	      *p++ = c;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    {
+	      unsigned int j;
+	      for (j = backslashes; j > 0; j--)
+		*p++ = '\\';
+	      *p++ = '"';
+	    }
+	  *p = '\0';
+
+	  new_argv[i] = quoted_string;
+	}
+      else
+	new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+		;;
+	    esac
+
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+	    func_emit_wrapper yes |
+	      $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
+            cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $opt_debug
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $opt_debug
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args=$nonopt
+    base_compile="$nonopt $@"
+    compile_command=$nonopt
+    finalize_command=$nonopt
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+    new_inherited_linker_flags=
+
+    avoid_version=no
+    bindir=
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+    weak_libs=
+    single_module="${wl}-single_module"
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	break
+	;;
+      -all-static | -static | -static-libtool-libs)
+	case $arg in
+	-all-static)
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    func_warning "complete static linking is impossible in this configuration"
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	-static)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=built
+	  ;;
+	-static-libtool-libs)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
 	  ;;
 	esac
-	if test -n "$i" ; then
-	  tmp_libs="$tmp_libs $i"
-	fi
-      done
-      dependency_libs=$tmp_libs
-    done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
-      dlprefiles="$newdlprefiles"
-    fi
-
-    case $linkmode in
-    oldlib)
-      if test -n "$deplibs"; then
-	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
-      fi
-
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
-      fi
-
-      if test -n "$rpath"; then
-	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
-      fi
-
-      if test -n "$xrpath"; then
-	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
-      fi
-
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
-      fi
+	build_libtool_libs=no
+	build_old_libs=yes
+	break
+	;;
+      esac
+    done
 
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
-      fi
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
 
-      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
-      fi
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
 
-      # Now set the variables for building old libraries.
-      build_libtool_libs=no
-      oldlibs="$output"
-      objs="$objs$old_deplibs"
-      ;;
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  func_append compile_command " @OUTPUT@"
+	  func_append finalize_command " @OUTPUT@"
+	  ;;
+	esac
 
-    lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
-      case $outputname in
-      lib*)
-	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
-	eval shared_ext=\"$shrext_cmds\"
-	eval libname=\"$libname_spec\"
-	;;
-      *)
-	if test "$module" = no; then
-	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-	if test "$need_lib_prefix" != no; then
-	  # Add the "lib" prefix for modules if required
-	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
-	  eval shared_ext=\"$shrext_cmds\"
-	  eval libname=\"$libname_spec\"
-	else
-	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
-	fi
-	;;
-      esac
+	case $prev in
+	bindir)
+	  bindir="$arg"
+	  prev=
+	  continue
+	  ;;
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    func_append compile_command " @SYMFILE@"
+	    func_append finalize_command " @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      func_append dlfiles " $arg"
+	    else
+	      func_append dlprefiles " $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  test -f "$arg" \
+	    || func_fatal_error "symbol file \`$arg' does not exist"
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+		*" $qarg.ltframework "*) ;;
+		*) func_append deplibs " $qarg.ltframework" # this is fixed later
+		   ;;
+	      esac
+	      ;;
+	  esac
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat "$save_arg"`
+	    do
+#	      func_append moreargs " $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
 
-      if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
-	  exit $EXIT_FAILURE
-	else
-	  $echo
-	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
-	  $echo "*** objects $objs is not portable!"
-	  libobjs="$libobjs $objs"
-	fi
-      fi
+	      # Check to see that this really is a libtool object.
+	      if func_lalib_unsafe_p "$arg"; then
+		pic_object=
+		non_pic_object=
 
-      if test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
-      fi
+		# Read the .lo file
+		func_source "$arg"
 
-      set dummy $rpath
-      if test "$#" -gt 2; then
-	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
-      fi
-      install_libdir="$2"
+		if test -z "$pic_object" ||
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none &&
+		   test "$non_pic_object" = none; then
+		  func_fatal_error "cannot find name of object for \`$arg'"
+		fi
 
-      oldlibs=
-      if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
-	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
-	  # convenience libraries should have the same extension an
-	  # archive normally would.
-	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
-	  build_libtool_libs=convenience
-	  build_old_libs=yes
-	fi
+		# Extract subdirectory from the argument.
+		func_dirname "$arg" "/" ""
+		xdir="$func_dirname_result"
 
-	if test -n "$vinfo"; then
-	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
-	fi
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
 
-	if test -n "$release"; then
-	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
-	fi
-      else
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      func_append dlfiles " $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
 
-	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
-	set dummy $vinfo 0 0 0
-	IFS="$save_ifs"
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    func_append dlprefiles " $pic_object"
+		    prev=
+		  fi
 
-	if test -n "$8"; then
-	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
+		  # A PIC object.
+		  func_append libobjs " $pic_object"
+		  arg="$pic_object"
+		fi
 
-	# convert absolute version numbers to libtool ages
-	# this retains compatibility with .la files and attempts
-	# to make the code below a bit more comprehensible
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
 
-	case $vinfo_number in
-	yes)
-	  number_major="$2"
-	  number_minor="$3"
-	  number_revision="$4"
-	  #
-	  # There are really only two kinds -- those that
-	  # use the current revision as the major version
-	  # and those that subtract age and use age as
-	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
-	  #
-	  case $version_type in
-	  darwin|linux|osf|windows|none)
-	    current=`expr $number_major + $number_minor`
-	    age="$number_minor"
-	    revision="$number_revision"
-	    ;;
-	  freebsd-aout|freebsd-elf|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
-	    ;;
-	  irix|nonstopux)
-	    current=`expr $number_major + $number_minor - 1`
-	    age="$number_minor"
-	    revision="$number_minor"
+		  # A standard non-PIC object
+		  func_append non_pic_objects " $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object="$pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if $opt_dry_run; then
+		  # Extract subdirectory from the argument.
+		  func_dirname "$arg" "/" ""
+		  xdir="$func_dirname_result"
+
+		  func_lo2o "$arg"
+		  pic_object=$xdir$objdir/$func_lo2o_result
+		  non_pic_object=$xdir$func_lo2o_result
+		  func_append libobjs " $pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+	        else
+		  func_fatal_error "\`$arg' is not a valid libtool object"
+		fi
+	      fi
+	    done
+	  else
+	    func_fatal_error "link input file \`$arg' does not exist"
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    func_fatal_error "only absolute run-paths are allowed"
 	    ;;
 	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) func_append rpath " $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) func_append xrpath " $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
 	  ;;
-	no)
-	  current="$2"
-	  revision="$3"
-	  age="$4"
+	shrext)
+	  shrext_cmds="$arg"
+	  prev=
+	  continue
 	  ;;
-	esac
-
-	# Check that each of the things are valid numbers.
-	case $current in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	weak)
+	  func_append weak_libs " $arg"
+	  prev=
+	  continue
 	  ;;
-	esac
-
-	case $revision in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	xcclinker)
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
 	  ;;
-	esac
-
-	case $age in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	xcompiler)
+	  func_append compiler_flags " $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
 	  ;;
-	esac
-
-	if test "$age" -gt "$current"; then
-	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	# Calculate the version variables.
-	major=
-	versuffix=
-	verstring=
-	case $version_type in
-	none) ;;
-
-	darwin)
-	  # Like Linux, but with the current version available in
-	  # verstring for coding it into the library header
-	  major=.`expr $current - $age`
-	  versuffix="$major.$age.$revision"
-	  # Darwin ld doesn't like 0 for these options...
-	  minor_current=`expr $current + 1`
-	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	xlinker)
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $wl$qarg"
+	  prev=
+	  func_append compile_command " $wl$qarg"
+	  func_append finalize_command " $wl$qarg"
+	  continue
 	  ;;
-
-	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
 	  ;;
+	esac
+      fi # test -n "$prev"
 
-	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current";
-	  ;;
+      prevarg="$arg"
 
-	irix | nonstopux)
-	  major=`expr $current - $age + 1`
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  # See comment for -static flag below, for more details.
+	  func_append compile_command " $link_static_flag"
+	  func_append finalize_command " $link_static_flag"
+	fi
+	continue
+	;;
 
-	  case $version_type in
-	    nonstopux) verstring_prefix=nonstopux ;;
-	    *)         verstring_prefix=sgi ;;
-	  esac
-	  verstring="$verstring_prefix$major.$revision"
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	;;
 
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$revision
-	  while test "$loop" -ne 0; do
-	    iface=`expr $revision - $loop`
-	    loop=`expr $loop - 1`
-	    verstring="$verstring_prefix$major.$iface:$verstring"
-	  done
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
 
-	  # Before this point, $major must not contain `.'.
-	  major=.$major
-	  versuffix="$major.$revision"
-	  ;;
+      -bindir)
+	prev=bindir
+	continue
+	;;
 
-	linux)
-	  major=.`expr $current - $age`
-	  versuffix="$major.$age.$revision"
-	  ;;
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
 
-	osf)
-	  major=.`expr $current - $age`
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
 
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$age
-	  while test "$loop" -ne 0; do
-	    iface=`expr $current - $loop`
-	    loop=`expr $loop - 1`
-	    verstring="$verstring:${iface}.0"
-	  done
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
 
-	  # Make executables depend on our current version.
-	  verstring="$verstring:${current}.0"
-	  ;;
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  func_fatal_error "more than one -exported-symbols argument is not allowed"
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
 
-	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
-	  ;;
+      -framework)
+	prev=framework
+	continue
+	;;
 
-	windows)
-	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
-	  major=`expr $current - $age`
-	  versuffix="-$major"
-	  ;;
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
 
-	*)
-	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
-	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-	  exit $EXIT_FAILURE
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
 	  ;;
 	esac
+	continue
+	;;
 
-	# Clear the version info if we defaulted, and they specified a release.
-	if test -z "$vinfo" && test -n "$release"; then
-	  major=
-	  case $version_type in
-	  darwin)
-	    # we can't check for "0.0" in archive_cmds due to quoting
-	    # problems, so we reset it completely
-	    verstring=
-	    ;;
-	  *)
-	    verstring="0.0"
-	    ;;
-	  esac
-	  if test "$need_version" = no; then
-	    versuffix=
+      -L*)
+	func_stripname "-L" '' "$arg"
+	if test -z "$func_stripname_result"; then
+	  if test "$#" -gt 0; then
+	    func_fatal_error "require no space between \`-L' and \`$1'"
 	  else
-	    versuffix=".0.0"
-	  fi
-	fi
-
-	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
-	  major=
-	  versuffix=
-	  verstring=""
-	fi
-
-	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
-	    build_libtool_libs=no
-	    build_old_libs=yes
+	    func_fatal_error "need path for \`-L' option"
 	  fi
-	else
-	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
-	fi
-      fi
-
-      if test "$mode" != relink; then
-	# Remove our outputs, but don't remove object files since they
-	# may have been created when compiling PIC objects.
-	removelist=
-	tempremovelist=`$echo "$output_objdir/*"`
-	for p in $tempremovelist; do
-	  case $p in
-	    *.$objext)
-	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
-	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-	         then
-		   continue
-		 fi
-	       fi
-	       removelist="$removelist $p"
-	       ;;
-	    *) ;;
-	  esac
-	done
-	if test -n "$removelist"; then
-	  $show "${rm}r $removelist"
-	  $run ${rm}r $removelist
-	fi
-      fi
-
-      # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
-	oldlibs="$oldlibs $output_objdir/$libname.$libext"
-
-	# Transform .lo files to .o files.
-	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
-      fi
-
-      # Eliminate all temporary directories.
-#      for path in $notinst_path; do
-#	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
-#	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
-#	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
-#      done
-
-      if test -n "$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	temp_xrpath=
-	for libdir in $xrpath; do
-	  temp_xrpath="$temp_xrpath -R$libdir"
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
-	  esac
-	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
-	  dependency_libs="$temp_xrpath $dependency_libs"
 	fi
-      fi
-
-      # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
-      dlfiles=
-      for lib in $old_dlfiles; do
-	case " $dlprefiles $dlfiles " in
-	*" $lib "*) ;;
-	*) dlfiles="$dlfiles $lib" ;;
+	func_resolve_sysroot "$func_stripname_result"
+	dir=$func_resolve_sysroot_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  test -z "$absdir" && \
+	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
+	  dir="$absdir"
+	  ;;
 	esac
-      done
-
-      # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
-      dlprefiles=
-      for lib in $old_dlprefiles; do
-	case "$dlprefiles " in
-	*" $lib "*) ;;
-	*) dlprefiles="$dlprefiles $lib" ;;
+	case "$deplibs " in
+	*" -L$dir "* | *" $arg "*)
+	  # Will only happen for absolute or sysroot arguments
+	  ;;
+	*)
+	  # Preserve sysroot, but never include relative directories
+	  case $dir in
+	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+	    *) func_append deplibs " -L$dir" ;;
+	  esac
+	  func_append lib_search_path " $dir"
+	  ;;
 	esac
-      done
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  ::) dllsearchpath=$dir;;
+	  *) func_append dllsearchpath ":$dir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) func_append dllsearchpath ":$testbindir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
 
-      if test "$build_libtool_libs" = yes; then
-	if test -n "$rpath"; then
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
 	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
-	    # these systems don't actually have a c library (as such)!
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C library is in the System framework
-	    deplibs="$deplibs -framework System"
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
 	    ;;
-	  *-*-netbsd*)
-	    # Don't link with libc until the a.out ld.so is fixed.
+	  *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
 	    ;;
 	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    func_append deplibs " System.ltframework"
+	    continue
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
 	    # Causes problems with __ctype
+	    test "X$arg" = "X-lc" && continue
 	    ;;
 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 	    # Compiler inserts libc in the correct place for threads to work
-	    ;;
- 	  *)
-	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
-	      deplibs="$deplibs -lc"
-	    fi
+	    test "X$arg" = "X-lc" && continue
 	    ;;
 	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
 	fi
+	func_append deplibs " $arg"
+	continue
+	;;
 
-	# Transform deplibs into only deplibs that can be linked in shared.
-	name_save=$name
-	libname_save=$libname
-	release_save=$release
-	versuffix_save=$versuffix
-	major_save=$major
-	# I'm not sure if I'm treating the release correctly.  I think
-	# release should show up in the -l (ie -lgmp5) so we don't want to
-	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
-	newdeplibs=
-	droppeddeps=no
-	case $deplibs_check_method in
-	pass_all)
-	  # Don't check for shared/static.  Everything works.
-	  # This might be a little naive.  We might want to check
-	  # whether the library exists or not.  But this is on
-	  # osf3 & osf4 and I'm not really sure... Just
-	  # implementing what was already the behavior.
-	  newdeplibs=$deplibs
-	  ;;
-	test_compile)
-	  # This code stresses the "libraries are programs" paradigm to its
-	  # limits. Maybe even breaks it.  We compile a program, linking it
-	  # against the deplibs as a proxy for the library.  Then we can check
-	  # whether they linked in statically or dynamically with ldd.
-	  $rm conftest.c
-	  cat > conftest.c <<EOF
-	  int main() { return 0; }
-EOF
-	  $rm conftest
-      if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
-	    ldd_output=`ldd conftest`
-	    for i in $deplibs; do
-	      name=`expr $i : '-l\(.*\)'`
-	      # If $name is empty we are operating on a -L argument.
-              if test "$name" != "" && test "$name" != "0"; then
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		  case " $predeps $postdeps " in
-		  *" $i "*)
-		    newdeplibs="$newdeplibs $i"
-		    i=""
-		    ;;
-		  esac
-	        fi
-		if test -n "$i" ; then
-		  libname=`eval \\$echo \"$libname_spec\"`
-		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
-		  set dummy $deplib_matches
-		  deplib_match=$2
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		    newdeplibs="$newdeplibs $i"
-		  else
-		    droppeddeps=yes
-		    $echo
-		    $echo "*** Warning: dynamic linker does not accept needed library $i."
-		    $echo "*** I have the capability to make that library automatically link in when"
-		    $echo "*** you link to this library.  But I can only do this if you have a"
-		    $echo "*** shared version of the library, which I believe you do not have"
-		    $echo "*** because a test_compile did reveal that the linker did not use it for"
-		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
-		  fi
-		fi
-	      else
-		newdeplibs="$newdeplibs $i"
-	      fi
-	    done
-	  else
-	    # Error occurred in the first compile.  Let's try to salvage
-	    # the situation: Compile a separate program for each library.
-	    for i in $deplibs; do
-	      name=`expr $i : '-l\(.*\)'`
-	      # If $name is empty we are operating on a -L argument.
-              if test "$name" != "" && test "$name" != "0"; then
-		$rm conftest
-		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
-		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		    case " $predeps $postdeps " in
-		    *" $i "*)
-		      newdeplibs="$newdeplibs $i"
-		      i=""
-		      ;;
-		    esac
-		  fi
-		  if test -n "$i" ; then
-		    libname=`eval \\$echo \"$libname_spec\"`
-		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
-		    set dummy $deplib_matches
-		    deplib_match=$2
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		      newdeplibs="$newdeplibs $i"
-		    else
-		      droppeddeps=yes
-		      $echo
-		      $echo "*** Warning: dynamic linker does not accept needed library $i."
-		      $echo "*** I have the capability to make that library automatically link in when"
-		      $echo "*** you link to this library.  But I can only do this if you have a"
-		      $echo "*** shared version of the library, which you do not appear to have"
-		      $echo "*** because a test_compile did reveal that the linker did not use this one"
-		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
-		    fi
-		  fi
-		else
-		  droppeddeps=yes
-		  $echo
-		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
-		  $echo "*** make it link in!  You will probably need to install it or some"
-		  $echo "*** library that it depends on before this library will be fully"
-		  $echo "*** functional.  Installing it before continuing would be even better."
-		fi
-	      else
-		newdeplibs="$newdeplibs $i"
-	      fi
-	    done
-	  fi
-	  ;;
-	file_magic*)
-	  set dummy $deplibs_check_method
-	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    name=`expr $a_deplib : '-l\(.*\)'`
-	    # If $name is empty we are operating on a -L argument.
-            if test "$name" != "" && test  "$name" != "0"; then
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  newdeplibs="$newdeplibs $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib" ; then
-		libname=`eval \\$echo \"$libname_spec\"`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-		  for potent_lib in $potential_libs; do
-		      # Follow soft links.
-		      if ls -lLd "$potent_lib" 2>/dev/null \
-			 | grep " -> " >/dev/null; then
-			continue
-		      fi
-		      # The statement above tries to avoid entering an
-		      # endless loop below, in case of cyclic links.
-		      # We might still enter an endless loop, since a link
-		      # loop can be closed while we follow links,
-		      # but so what?
-		      potlib="$potent_lib"
-		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
-			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
-			esac
-		      done
-		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
-			 | ${SED} 10q \
-			 | $EGREP "$file_magic_regex" > /dev/null; then
-			newdeplibs="$newdeplibs $a_deplib"
-			a_deplib=""
-			break 2
-		      fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		$echo
-		$echo "*** Warning: linker path does not have real file for library $a_deplib."
-		$echo "*** I have the capability to make that library automatically link in when"
-		$echo "*** you link to this library.  But I can only do this if you have a"
-		$echo "*** shared version of the library, which you do not appear to have"
-		$echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
-		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
-		else
-		  $echo "*** with $libname and none of the candidates passed a file format test"
-		  $echo "*** using a file magic. Last file checked: $potlib"
-		fi
-	      fi
-	    else
-	      # Add a -L argument.
-	      newdeplibs="$newdeplibs $a_deplib"
-	    fi
-	  done # Gone through all deplibs.
-	  ;;
-	match_pattern*)
-	  set dummy $deplibs_check_method
-	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    name=`expr $a_deplib : '-l\(.*\)'`
-	    # If $name is empty we are operating on a -L argument.
-	    if test -n "$name" && test "$name" != "0"; then
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  newdeplibs="$newdeplibs $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib" ; then
-		libname=`eval \\$echo \"$libname_spec\"`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
-		    if eval $echo \"$potent_lib\" 2>/dev/null \
-		        | ${SED} 10q \
-		        | $EGREP "$match_pattern_regex" > /dev/null; then
-		      newdeplibs="$newdeplibs $a_deplib"
-		      a_deplib=""
-		      break 2
-		    fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		$echo
-		$echo "*** Warning: linker path does not have real file for library $a_deplib."
-		$echo "*** I have the capability to make that library automatically link in when"
-		$echo "*** you link to this library.  But I can only do this if you have a"
-		$echo "*** shared version of the library, which you do not appear to have"
-		$echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
-		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
-		else
-		  $echo "*** with $libname and none of the candidates passed a file format test"
-		  $echo "*** using a regex pattern. Last file checked: $potlib"
-		fi
-	      fi
-	    else
-	      # Add a -L argument.
-	      newdeplibs="$newdeplibs $a_deplib"
-	    fi
-	  done # Gone through all deplibs.
-	  ;;
-	none | unknown | *)
-	  newdeplibs=""
-	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-	    -e 's/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
-	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
-	    done
-	  fi
-	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
-	    | grep . >/dev/null; then
-	    $echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
-	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
-	    else
-	      $echo "*** Warning: inter-library dependencies are not known to be supported."
-	    fi
-	    $echo "*** All declared inter-library dependencies are being dropped."
-	    droppeddeps=yes
-	  fi
-	  ;;
+      -module)
+	module=yes
+	continue
+	;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot|--sysroot)
+	func_append compiler_flags " $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	prev=xcompiler
+	continue
+	;;
+
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+	func_append compiler_flags " $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	case "$new_inherited_linker_flags " in
+	    *" $arg "*) ;;
+	    * ) func_append new_inherited_linker_flags " $arg" ;;
 	esac
-	versuffix=$versuffix_save
-	major=$major_save
-	release=$release_save
-	libname=$libname_save
-	name=$name_save
+	continue
+	;;
+
+      -multi_module)
+	single_module="${wl}-multi_module"
+	continue
+	;;
 
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
 	case $host in
-	*-*-rhapsody* | *-*-darwin1.[012])
-	  # On Rhapsody replace the C library is the System framework
-	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # and Darwin in order for the loader to find any dlls it needs.
+	  func_warning "\`-no-install' is ignored for $host"
+	  func_warning "assuming \`-no-fast-install' instead"
+	  fast_install=no
 	  ;;
+	*) no_install=yes ;;
 	esac
+	continue
+	;;
 
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
-	    $echo
-	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
-	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
-	    $echo "*** a static module, that should work as long as the dlopening"
-	    $echo "*** application is linked with the -dlopen flag."
-	    if test -z "$global_symbol_pipe"; then
-	      $echo
-	      $echo "*** However, this would only work if libtool was able to extract symbol"
-	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-	      $echo "*** not find such a program.  So, this module is probably useless."
-	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
-	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
-	      build_libtool_libs=module
-	      build_old_libs=yes
-	    else
-	      build_libtool_libs=no
-	    fi
-	  else
-	    $echo "*** The inter-library dependencies that have been dropped here will be"
-	    $echo "*** automatically added whenever a program is linked with this library"
-	    $echo "*** or is declared to -dlopen it."
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
 
-	    if test "$allow_undefined" = no; then
-	      $echo
-	      $echo "*** Since this library must not contain undefined symbols,"
-	      $echo "*** because either the platform does not support them or"
-	      $echo "*** it was explicitly requested with -no-undefined,"
-	      $echo "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  fi
-	fi
-	# Done checking deplibs!
-	deplibs=$newdeplibs
-      fi
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
 
+      -o) prev=output ;;
 
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	func_stripname '-R' '' "$arg"
+	dir=$func_stripname_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	=*)
+	  func_stripname '=' '' "$dir"
+	  dir=$lt_sysroot$func_stripname_result
+	  ;;
 	*)
-	  case " $deplibs " in
-	  *" -L$path/$objdir "*)
-	    new_libs="$new_libs -L$path/$objdir" ;;
-	  esac
+	  func_fatal_error "only absolute run-paths are allowed"
 	  ;;
 	esac
-      done
-      for deplib in $deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) new_libs="$new_libs $deplib" ;;
-	  esac
-	  ;;
-	*) new_libs="$new_libs $deplib" ;;
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) func_append xrpath " $dir" ;;
 	esac
-      done
-      deplibs="$new_libs"
+	continue
+	;;
 
+      -shared)
+	# The effects of -shared are defined in a previous loop.
+	continue
+	;;
 
-      # All the library-specific variables (install_libdir is set above).
-      library_names=
-      old_library=
-      dlname=
+      -shrext)
+	prev=shrext
+	continue
+	;;
 
-      # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	if test "$hardcode_into_libs" = yes; then
-	  # Hardcode the library paths
-	  hardcode_libdirs=
-	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$mode" != relink && rpath="$compile_rpath$rpath"
-	  for libdir in $rpath; do
-	    if test -n "$hardcode_libdir_flag_spec"; then
-	      if test -n "$hardcode_libdir_separator"; then
-		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
-		else
-		  # Just accumulate the unique libdirs.
-		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		    ;;
-		  *)
-		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-		    ;;
-		  esac
-		fi
+      -static | -static-libtool-libs)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -weak)
+        prev=weak
+	continue
+	;;
+
+      -Wc,*)
+	func_stripname '-Wc,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+	  func_append arg " $func_quote_for_eval_result"
+	  func_append compiler_flags " $func_quote_for_eval_result"
+	done
+	IFS="$save_ifs"
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Wl,*)
+	func_stripname '-Wl,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+	  func_append arg " $wl$func_quote_for_eval_result"
+	  func_append compiler_flags " $wl$func_quote_for_eval_result"
+	  func_append linker_flags " $func_quote_for_eval_result"
+	done
+	IFS="$save_ifs"
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # -msg_* for osf cc
+      -msg_*)
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      # Flags to be passed through unchanged, with rationale:
+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
+      # -r[0-9][0-9]*        specify processor for the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
+      # -q*                  compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+      # -F/path              path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      # --sysroot=*          for sysroot support
+      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        func_append compiler_flags " $arg"
+        continue
+        ;;
+
+      # Some other compiler flag.
+      -* | +*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      *.$objext)
+	# A standard object.
+	func_append objs " $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if func_lalib_unsafe_p "$arg"; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  func_source "$arg"
+
+	  if test -z "$pic_object" ||
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none &&
+	     test "$non_pic_object" = none; then
+	    func_fatal_error "cannot find name of object for \`$arg'"
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  func_dirname "$arg" "/" ""
+	  xdir="$func_dirname_result"
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		func_append dlfiles " $pic_object"
+		prev=
+		continue
 	      else
-		eval flag=\"$hardcode_libdir_flag_spec\"
-		dep_rpath="$dep_rpath $flag"
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
 	      fi
-	    elif test -n "$runpath_var"; then
-	      case "$perm_rpath " in
-	      *" $libdir "*) ;;
-	      *) perm_rpath="$perm_rpath $libdir" ;;
-	      esac
 	    fi
-	  done
-	  # Substitute the hardcoded libdirs into the rpath.
-	  if test -n "$hardcode_libdir_separator" &&
-	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
-	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
-	    else
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      func_append dlprefiles " $pic_object"
+	      prev=
 	    fi
+
+	    # A PIC object.
+	    func_append libobjs " $pic_object"
+	    arg="$pic_object"
 	  fi
-	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
-	    # We should set the runpath_var.
-	    rpath=
-	    for dir in $perm_rpath; do
-	      rpath="$rpath$dir:"
-	    done
-	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    func_append non_pic_objects " $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object="$pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if $opt_dry_run; then
+	    # Extract subdirectory from the argument.
+	    func_dirname "$arg" "/" ""
+	    xdir="$func_dirname_result"
+
+	    func_lo2o "$arg"
+	    pic_object=$xdir$objdir/$func_lo2o_result
+	    non_pic_object=$xdir$func_lo2o_result
+	    func_append libobjs " $pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  else
+	    func_fatal_error "\`$arg' is not a valid libtool object"
 	  fi
-	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
 	fi
+	;;
 
-	shlibpath="$finalize_shlibpath"
-	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
-	if test -n "$shlibpath"; then
-	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
-	fi
+      *.$libext)
+	# An archive.
+	func_append deplibs " $arg"
+	func_append old_deplibs " $arg"
+	continue
+	;;
 
-	# Get the real and link names of the library.
-	eval shared_ext=\"$shrext_cmds\"
-	eval library_names=\"$library_names_spec\"
-	set dummy $library_names
-	realname="$2"
-	shift; shift
+      *.la)
+	# A libtool-controlled library.
 
-	if test -n "$soname_spec"; then
-	  eval soname=\"$soname_spec\"
+	func_resolve_sysroot "$arg"
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  func_append dlfiles " $func_resolve_sysroot_result"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  func_append dlprefiles " $func_resolve_sysroot_result"
+	  prev=
 	else
-	  soname="$realname"
-	fi
-	if test -z "$dlname"; then
-	  dlname=$soname
+	  func_append deplibs " $func_resolve_sysroot_result"
 	fi
+	continue
+	;;
 
-	lib="$output_objdir/$realname"
-	linknames=
-	for link
-	do
-	  linknames="$linknames $link"
-	done
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+      esac # arg
 
-	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+      fi
+    done # argument parsing loop
 
-	# Prepare the list of exported symbols
-	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    $show "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
-	    $run $rm $export_symbols
-	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
-	    for cmd in $cmds; do
-	      IFS="$save_ifs"
-	      eval cmd=\"$cmd\"
-	      if len=`expr "X$cmd" : ".*"` &&
-	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	        $show "$cmd"
-	        $run eval "$cmd" || exit $?
-	        skipped_export=false
-	      else
-	        # The command line is too long to execute in one step.
-	        $show "using reloadable object file for export list..."
-	        skipped_export=:
-		# Break out early, otherwise skipped_export may be
-		# set to false by a later but shorter cmd.
-		break
-	      fi
-	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex"; then
-	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
-	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
-	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-	fi
+    test -n "$prev" && \
+      func_fatal_help "the \`$prevarg' option requires an argument"
 
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
-	fi
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
+    fi
 
-	tmp_deplibs=
-	for test_deplib in $deplibs; do
-		case " $convenience " in
-		*" $test_deplib "*) ;;
-		*)
-			tmp_deplibs="$tmp_deplibs $test_deplib"
-			;;
-		esac
+    oldlibs=
+    # calculate the name of the file, without its directory
+    func_basename "$output"
+    outputname="$func_basename_result"
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    func_dirname "$output" "/" ""
+    output_objdir="$func_dirname_result$objdir"
+    func_to_tool_file "$output_objdir/"
+    tool_output_objdir=$func_to_tool_file_result
+    # Create the object directory.
+    func_mkdir_p "$output_objdir"
+
+    # Determine the type of output
+    case $output in
+    "")
+      func_fatal_help "you must specify an output file"
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if $opt_preserve_dup_deps ; then
+	case "$libs " in
+	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	esac
+      fi
+      func_append libs " $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if $opt_duplicate_compiler_generated_deps; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+	  esac
+	  func_append pre_post_deps " $pre_post_dep"
 	done
-	deplibs="$tmp_deplibs"
+      fi
+      pre_post_deps=
+    fi
 
-	if test -n "$convenience"; then
-	  if test -n "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	  else
-	    gentop="$output_objdir/${outputname}x"
-	    generated="$generated $gentop"
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
 
-	    func_extract_archives $gentop $convenience
-	    libobjs="$libobjs $func_extract_archives_result"
-	  fi
-	fi
-	
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
-	  eval flag=\"$thread_safe_flag_spec\"
-	  linker_flags="$linker_flags $flag"
-	fi
+    case $linkmode in
+    lib)
+	passes="conv dlpreopen link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
 
-	# Make a backup of the uninstalled library when relinking
-	if test "$mode" = relink; then
-	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
-	fi
+    for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+	## FIXME: Find the place where the list is rebuilt in the wrong
+	##        order, and fix it there properly
+        tmp_deplibs=
+	for deplib in $deplibs; do
+	  tmp_deplibs="$deplib $tmp_deplibs"
+	done
+	deplibs="$tmp_deplibs"
+      fi
 
-	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
-	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	    eval test_cmds=\"$module_expsym_cmds\"
-	    cmds=$module_expsym_cmds
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+	# Collect and forward deplibs of preopened libtool libs
+	for lib in $dlprefiles; do
+	  # Ignore non-libtool-libs
+	  dependency_libs=
+	  func_resolve_sysroot "$lib"
+	  case $lib in
+	  *.la)	func_source "$func_resolve_sysroot_result" ;;
+	  esac
+
+	  # Collect preopened libtool deplibs, except any this library
+	  # has declared as weak libs
+	  for deplib in $dependency_libs; do
+	    func_basename "$deplib"
+            deplib_base=$func_basename_result
+	    case " $weak_libs " in
+	    *" $deplib_base "*) ;;
+	    *) func_append deplibs " $deplib" ;;
+	    esac
+	  done
+	done
+	libs="$dlprefiles"
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
-	    eval test_cmds=\"$module_cmds\"
-	    cmds=$module_cmds
+	    func_append compiler_flags " $deplib"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+		esac
+	    fi
 	  fi
-	else
-	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	  eval test_cmds=\"$archive_expsym_cmds\"
-	  cmds=$archive_expsym_cmds
-	else
-	  eval test_cmds=\"$archive_cmds\"
-	  cmds=$archive_cmds
+	  continue
+	  ;;
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    func_warning "\`-l' is ignored for archives/objects"
+	    continue
 	  fi
-	fi
-
-	if test "X$skipped_export" != "X:" &&
-	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  :
-	else
-	  # The command line is too long to link in one step, link piecewise.
-	  $echo "creating reloadable object files..."
-
-	  # Save the value of $output and $libobjs because we want to
-	  # use them later.  If we have whole_archive_flag_spec, we
-	  # want to use save_libobjs as it was before
-	  # whole_archive_flag_spec was expanded, because we can't
-	  # assume the linker understands whole_archive_flag_spec.
-	  # This may have to be revisited, in case too many
-	  # convenience libraries get linked in and end up exceeding
-	  # the spec.
-	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
+	  func_stripname '-l' '' "$deplib"
+	  name=$func_stripname_result
+	  if test "$linkmode" = lib; then
+	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+	  else
+	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
 	  fi
-	  save_output=$output
-	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
-
-	  # Clear the reloadable object creation command queue and
-	  # initialize k to one.
-	  test_cmds=
-	  concat_cmds=
-	  objlist=
-	  delfiles=
-	  last_robj=
-	  k=1
-	  output=$output_objdir/$output_la-${k}.$objext
-	  # Loop over the list of objects to be linked.
-	  for obj in $save_libobjs
-	  do
-	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
-	    if test "X$objlist" = X ||
-	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-		 test "$len" -le "$max_cmd_len"; }; then
-	      objlist="$objlist $obj"
-	    else
-	      # The command $test_cmds is almost too long, add a
-	      # command to the queue.
-	      if test "$k" -eq 1 ; then
-		# The first file doesn't have a previous command to add.
-		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
-	      else
-		# All subsequent reloadable object files will link in
-		# the last one created.
-		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+	  for searchdir in $searchdirs; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
 	      fi
-	      last_robj=$output_objdir/$output_la-${k}.$objext
-	      k=`expr $k + 1`
-	      output=$output_objdir/$output_la-${k}.$objext
-	      objlist=$obj
-	      len=1
-	    fi
-	  done
-	  # Handle the remaining objects by creating one last
-	  # reloadable object file.  All subsequent reloadable object
-	  # files will link in the last one created.
-	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
-
-	  if ${skipped_export-false}; then
-	    $show "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
-	    $run $rm $export_symbols
-	    libobjs=$output
-	    # Append the command to create the export file.
-	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
-          fi
-
-	  # Set up a command to remove the reloadable object files
-	  # after they are used.
-	  i=0
-	  while test "$i" -lt "$k"
-	  do
-	    i=`expr $i + 1`
-	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
-	  done
-
-	  $echo "creating a temporary reloadable object file: $output"
-
-	  # Loop through the commands generated above and execute them.
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $concat_cmds; do
-	    IFS="$save_ifs"
-	    $show "$cmd"
-	    $run eval "$cmd" || exit $?
+	    done
 	  done
-	  IFS="$save_ifs"
-
-	  libobjs=$output
-	  # Restore the value of output.
-	  output=$save_output
-
-	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	  fi
-	  # Expand the library linking commands again to reset the
-	  # value of $libobjs for piecewise linking.
-
-	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
-	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	      cmds=$module_expsym_cmds
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
 	    else
-	      cmds=$module_cmds
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
 	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if func_lalib_p "$lib"; then
+		  library_names=
+		  old_library=
+		  func_source "$lib"
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    func_dirname "$lib" "" "."
+		    ladir="$func_dirname_result"
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+		;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	*.ltframework)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
-	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	    cmds=$archive_expsym_cmds
-	  else
-	    cmds=$archive_cmds
+	    deplibs="$deplib $deplibs"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+		esac
 	    fi
 	  fi
-
-	  # Append the command to remove the reloadable object files
-	  # to the just-reset $cmds.
-	  eval cmds=\"\$cmds~\$rm $delfiles\"
-	fi
-	save_ifs="$IFS"; IFS='~'
-	for cmd in $cmds; do
-	  IFS="$save_ifs"
-	  eval cmd=\"$cmd\"
-	  $show "$cmd"
-	  $run eval "$cmd" || {
-	    lt_exit=$?
-
-	    # Restore the uninstalled library and exit
-	    if test "$mode" = relink; then
-	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	  continue
+	  ;;
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    func_stripname '-L' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
 	    fi
-
-	    exit $lt_exit
-	  }
-	done
-	IFS="$save_ifs"
-
-	# Restore the uninstalled library and exit
-	if test "$mode" = relink; then
-	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
-
-	  if test -n "$convenience"; then
-	    if test -z "$whole_archive_flag_spec"; then
-	      $show "${rm}r $gentop"
-	      $run ${rm}r "$gentop"
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
 	    fi
+	    func_stripname '-L' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
+	    ;;
+	  *)
+	    func_warning "\`-L' is ignored for archives/objects"
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    func_stripname '-R' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    dir=$func_resolve_sysroot_result
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) func_append xrpath " $dir" ;;
+	    esac
 	  fi
-
-	  exit $EXIT_SUCCESS
-	fi
-
-	# Create links to the real library.
-	for linkname in $linknames; do
-	  if test "$realname" != "$linkname"; then
-	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
-	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la)
+	  func_resolve_sysroot "$deplib"
+	  lib=$func_resolve_sysroot_result
+	  ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
 	  fi
-	done
-
-	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
-	  # On all known operating systems, these are identical.
-	  dlname="$soname"
-	fi
-      fi
-      ;;
-
-    obj)
-      if test -n "$deplibs"; then
-	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
-      fi
-
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
-      fi
-
-      if test -n "$rpath"; then
-	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
-      fi
-
-      if test -n "$xrpath"; then
-	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
-      fi
-
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
-      fi
-
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
-      fi
-
-      case $output in
-      *.lo)
-	if test -n "$objs$old_deplibs"; then
-	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-	libobj="$output"
-	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
-	;;
-      *)
-	libobj=
-	obj="$output"
-	;;
-      esac
-
-      # Delete the old objects.
-      $run $rm $obj $libobj
-
-      # Objects from convenience libraries.  This assumes
-      # single-version convenience libraries.  Whenever we create
-      # different ones for PIC/non-PIC, this we'll have to duplicate
-      # the extraction.
-      reload_conv_objs=
-      gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec and hope we can get by with
-      # turning comma into space..
-      wl=
-
-      if test -n "$convenience"; then
-	if test -n "$whole_archive_flag_spec"; then
-	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-      reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
-	else
-	  gentop="$output_objdir/${obj}x"
-	  generated="$generated $gentop"
-
-	  func_extract_archives $gentop $convenience
-	  reload_conv_objs="$reload_objs $func_extract_archives_result"
-	fi
-      fi
-
-      # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
-      output="$obj"
-      cmds=$reload_cmds
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-	IFS="$save_ifs"
-	eval cmd=\"$cmd\"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-
-      # Exit if we aren't doing a library object file.
-      if test -z "$libobj"; then
-	if test -n "$gentop"; then
-	  $show "${rm}r $gentop"
-	  $run ${rm}r $gentop
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
+	  case $linkmode in
+	  lib)
+	    # Linking convenience modules into shared libraries is allowed,
+	    # but linking other static libraries is non-portable.
+	    case " $dlpreconveniencelibs " in
+	    *" $deplib "*) ;;
+	    *)
+	      valid_a_lib=no
+	      case $deplibs_check_method in
+		match_pattern*)
+		  set dummy $deplibs_check_method; shift
+		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		    valid_a_lib=yes
+		  fi
+		;;
+		pass_all)
+		  valid_a_lib=yes
+		;;
+	      esac
+	      if test "$valid_a_lib" != yes; then
+		echo
+		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because the file extensions .$libext of this argument makes me believe"
+		echo "*** that it is just a static archive that I should not use here."
+	      else
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      fi
+	      ;;
+	    esac
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      func_append newdlprefiles " $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      func_append newdlfiles " $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
 
-      if test "$build_libtool_libs" != yes; then
-	if test -n "$gentop"; then
-	  $show "${rm}r $gentop"
-	  $run ${rm}r $gentop
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
 	fi
 
-	# Create an invalid libtool object if no PIC, so that we don't
-	# accidentally link it into a program.
-	# $show "echo timestamp > $libobj"
-	# $run eval "echo timestamp > $libobj" || exit $?
-	exit $EXIT_SUCCESS
-      fi
-
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
-	# Only do commands if we really have different PIC objects.
-	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
-	cmds=$reload_cmds
-	save_ifs="$IFS"; IFS='~'
-	for cmd in $cmds; do
-	  IFS="$save_ifs"
-	  eval cmd=\"$cmd\"
-	  $show "$cmd"
-	  $run eval "$cmd" || exit $?
-	done
-	IFS="$save_ifs"
-      fi
-
-      if test -n "$gentop"; then
-	$show "${rm}r $gentop"
-	$run ${rm}r $gentop
-      fi
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$lib" \
+	  || func_fatal_error "\`$lib' is not a valid libtool archive"
 
-      exit $EXIT_SUCCESS
-      ;;
+	func_dirname "$lib" "" "."
+	ladir="$func_dirname_result"
 
-    prog)
-      case $host in
-	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
-      esac
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
-      fi
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	inherited_linker_flags=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+	avoidtemprpath=
 
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
-      fi
 
-      if test "$preload" = yes; then
-	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
-	   test "$dlopen_self_static" = unknown; then
-	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+	# Read the .la file
+	func_source "$lib"
+
+	# Convert "-framework foo" to "foo.ltframework"
+	if test -n "$inherited_linker_flags"; then
+	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+	    case " $new_inherited_linker_flags " in
+	      *" $tmp_inherited_linker_flag "*) ;;
+	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+	    esac
+	  done
+	fi
+	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && func_append dlfiles " $dlopen"
+	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 	fi
-      fi
 
-      case $host in
-      *-*-rhapsody* | *-*-darwin1.[012])
-	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
-	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
-	;;
-      esac
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      func_fatal_error "cannot find name of link library for \`$lib'"
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    func_append convenience " $ladir/$objdir/$old_library"
+	    func_append old_convenience " $ladir/$objdir/$old_library"
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    func_fatal_error "\`$lib' is not a convenience library"
+	  fi
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    deplibs="$deplib $deplibs"
+	    if $opt_preserve_dup_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $deplib"
+	  done
+	  continue
+	fi # $pass = conv
 
-      case $host in
-      *darwin*)
-        # Don't allow lazy linking, it breaks C++ global constructors
-        if test "$tagname" = CXX ; then
-        compile_command="$compile_command ${wl}-bind_at_load"
-        finalize_command="$finalize_command ${wl}-bind_at_load"
-        fi
-        ;;
-      esac
 
+	# Get the name of the library we link against.
+	linklib=
+	if test -n "$old_library" &&
+	   { test "$prefer_static_libs" = yes ||
+	     test "$prefer_static_libs,$installed" = "built,no"; }; then
+	  linklib=$old_library
+	else
+	  for l in $old_library $library_names; do
+	    linklib="$l"
+	  done
+	fi
+	if test -z "$linklib"; then
+	  func_fatal_error "cannot find name of link library for \`$lib'"
+	fi
 
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+	  fi
+	  if test -z "$dlname" ||
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    func_append dlprefiles " $lib $dependency_libs"
+	  else
+	    func_append newdlfiles " $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
 	*)
-	  case " $compile_deplibs " in
-	  *" -L$path/$objdir "*)
-	    new_libs="$new_libs -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $compile_deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) new_libs="$new_libs $deplib" ;;
-	  esac
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "passing it literally to the linker, although it might fail"
+	    abs_ladir="$ladir"
+	  fi
 	  ;;
-	*) new_libs="$new_libs $deplib" ;;
 	esac
-      done
-      compile_deplibs="$new_libs"
-
+	func_basename "$lib"
+	laname="$func_basename_result"
 
-      compile_command="$compile_command $compile_deplibs"
-      finalize_command="$finalize_command $finalize_deplibs"
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    func_warning "library \`$lib' was moved."
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$lt_sysroot$libdir"
+	    absdir="$lt_sysroot$libdir"
+	  fi
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	else
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    # Remove this search path later
+	    func_append notinst_path " $abs_ladir"
+	  else
+	    dir="$ladir/$objdir"
+	    absdir="$abs_ladir/$objdir"
+	    # Remove this search path later
+	    func_append notinst_path " $abs_ladir"
+	  fi
+	fi # $installed = yes
+	func_stripname 'lib' '.la' "$laname"
+	name=$func_stripname_result
 
-      if test -n "$rpath$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	for libdir in $rpath $xrpath; do
-	  # This is the magic to use -rpath.
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir" && test "$linkmode" = prog; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	  fi
+	  case "$host" in
+	    # special handling for platforms with PE-DLLs.
+	    *cygwin* | *mingw* | *cegcc* )
+	      # Linker will automatically link against shared library if both
+	      # static and shared are present.  Therefore, ensure we extract
+	      # symbols from the import library if a shared library is present
+	      # (otherwise, the dlopen module name will be incorrect).  We do
+	      # this by putting the import library name into $newdlprefiles.
+	      # We recover the dlopen module name by 'saving' the la file
+	      # name in a special purpose variable, and (later) extracting the
+	      # dlname from the la file.
+	      if test -n "$dlname"; then
+	        func_tr_sh "$dir/$linklib"
+	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+	        func_append newdlprefiles " $dir/$linklib"
+	      else
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      fi
+	    ;;
+	    * )
+	      # Prefer using a static library (so that no silly _DYNAMIC symbols
+	      # are required to link).
+	      if test -n "$old_library"; then
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      # Otherwise, use the dlname, so that lt_dlopen finds it.
+	      elif test -n "$dlname"; then
+	        func_append newdlprefiles " $dir/$dlname"
+	      else
+	        func_append newdlprefiles " $dir/$linklib"
+	      fi
+	    ;;
 	  esac
-	done
-      fi
+	fi # $pass = dlpreopen
 
-      # Now hardcode the library paths
-      rpath=
-      hardcode_libdirs=
-      for libdir in $compile_rpath $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
 	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath="$rpath $flag"
+	    deplibs="$lib $deplibs" # used for prog,scan pass
 	  fi
-	elif test -n "$runpath_var"; then
-	  case "$perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) perm_rpath="$perm_rpath $libdir" ;;
-	  esac
+	  continue
 	fi
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$libdir:"*) ;;
-	  *) dllsearchpath="$dllsearchpath:$libdir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
-	  esac
-	  ;;
-	esac
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      compile_rpath="$rpath"
 
-      rpath=
-      hardcode_libdirs=
-      for libdir in $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  func_append newlib_search_path " $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) func_stripname '-L' '' "$deplib"
+	         func_resolve_sysroot "$func_stripname_result"
+	         func_append newlib_search_path " $func_resolve_sysroot_result"
+		 ;;
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
 	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-		;;
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if $opt_preserve_dup_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { { test "$prefer_static_libs" = no ||
+	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	       test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath:" in
+	      *"$absdir:"*) ;;
+	      *) func_append temp_rpath "$absdir:" ;;
 	      esac
 	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath="$rpath $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$finalize_perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
-	  esac
-	fi
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      finalize_rpath="$rpath"
 
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
-	# Transform all the library objects into standard objects.
-	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-      fi
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) func_append compile_rpath " $absdir" ;;
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append finalize_rpath " $libdir" ;;
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
 
-      dlsyms=
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	  dlsyms="${outputname}S.c"
-	else
-	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
 	fi
-      fi
-
-      if test -n "$dlsyms"; then
-	case $dlsyms in
-	"") ;;
-	*.c)
-	  # Discover the nlist of each of the dlfiles.
-	  nlist="$output_objdir/${outputname}.nm"
 
-	  $show "$rm $nlist ${nlist}S ${nlist}T"
-	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
+	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test "$use_static_libs" = built && test "$installed" = yes; then
+	  use_static_libs=no
+	fi
+	if test -n "$library_names" &&
+	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc*)
+	      # No point in relinking DLLs because paths are not encoded
+	      func_append notinst_deplibs " $lib"
+	      need_relink=no
+	    ;;
+	  *)
+	    if test "$installed" = no; then
+	      func_append notinst_deplibs " $lib"
+	      need_relink=yes
+	    fi
+	    ;;
+	  esac
+	  # This is a shared library
 
-	  # Parse the name list into a source file.
-	  $show "creating $output_objdir/$dlsyms"
+	  # Warn about portability, can't link against -module's on some
+	  # systems (darwin).  Don't bleat about dlopened modules though!
+	  dlopenmodule=""
+	  for dlpremoduletest in $dlprefiles; do
+	    if test "X$dlpremoduletest" = "X$lib"; then
+	      dlopenmodule="$dlpremoduletest"
+	      break
+	    fi
+	  done
+	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	    echo
+	    if test "$linkmode" = prog; then
+	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $ECHO "*** $linklib is not portable!"
+	  fi
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) func_append compile_rpath " $absdir" ;;
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append finalize_rpath " $libdir" ;;
+	      esac
+	      ;;
+	    esac
+	  fi
 
-	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
-/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
-/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    shift
+	    realname="$1"
+	    shift
+	    libname=`eval "\\$ECHO \"$libname_spec\""`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw* | *cegcc*)
+	        func_arith $current - $age
+		major=$func_arith_result
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
 
-#ifdef __cplusplus
-extern \"C\" {
-#endif
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    func_basename "$soroot"
+	    soname="$func_basename_result"
+	    func_stripname 'lib' '.dll' "$soname"
+	    newlib=libimp-$func_stripname_result.a
 
-/* Prevent the only kind of declaration conflicts we can make. */
-#define lt_preloaded_symbols some_other_symbol
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+	    fi
 
-/* External symbol declarations for the compiler. */\
-"
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      func_verbose "generating import library for \`$soname'"
+	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
 
-	  if test "$dlself" = yes; then
-	    $show "generating symbol list for \`$output'"
+	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a (non-dlopened) module then we can not
+		    # link against it, someone is ignoring the earlier warnings
+		    if /usr/bin/file -L $add 2> /dev/null |
+			 $GREP ": [^:]* bundle" >/dev/null ; then
+		      if test "X$dlopenmodule" != "X$lib"; then
+			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
+			if test -z "$old_library" ; then
+			  echo
+			  echo "*** And there doesn't seem to be a static archive available"
+			  echo "*** The link will probably fail, sorry"
+			else
+			  add="$dir/$old_library"
+			fi
+		      elif test -n "$old_library"; then
+			add="$dir/$old_library"
+		      fi
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes &&
+	         test "$hardcode_direct_absolute" = no; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$absdir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case $libdir in
+		    [\\/]*)
+		      func_append add_dir " -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
 
-	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+	    if test "$lib_linked" != yes; then
+	      func_fatal_configuration "unsupported hardcode properties"
+	    fi
 
-	    # Add our own program objects to the symbol list.
-	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	    for arg in $progfiles; do
-	      $show "extracting global C symbols from \`$arg'"
-	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
-	    done
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes &&
+		 test "$hardcode_minus_L" != yes &&
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) func_append finalize_shlibpath "$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
 
-	    if test -n "$exclude_expsyms"; then
-	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-	      $run eval '$mv "$nlist"T "$nlist"'
+	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes &&
+	       test "$hardcode_direct_absolute" = no; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) func_append finalize_shlibpath "$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
+		add="$inst_prefix_dir$libdir/$linklib"
+	      else
+		add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case $libdir in
+		  [\\/]*)
+		    func_append add_dir " -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
 	    fi
 
-	    if test -n "$export_symbols_regex"; then
-	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-	      $run eval '$mv "$nlist"T "$nlist"'
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
 	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
 
-	    # Prepare the list of exported symbols
-	    if test -z "$export_symbols"; then
-	      export_symbols="$output_objdir/$outputname.exp"
-	      $run $rm $export_symbols
-	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-              case $host in
-              *cygwin* | *mingw* )
-	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-                ;;
-              esac
-	    else
-	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-	      $run eval 'mv "$nlist"T "$nlist"'
-              case $host in
-              *cygwin* | *mingw* )
-	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-                ;;
-              esac
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    echo
+	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    echo "*** I have the capability to make that library automatically link in when"
+	    echo "*** you link to this library.  But I can only do this if you have a"
+	    echo "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      echo "*** But as you try to build a module library, libtool will still create "
+	      echo "*** a static module, that should work as long as the dlopening application"
+	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		echo
+		echo "*** However, this would only work if libtool was able to extract symbol"
+		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** not find such a program.  So, this module is probably useless."
+		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
 	    fi
+	  else
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
 	  fi
+	fi # link shared/static library?
 
-	  for arg in $dlprefiles; do
-	    $show "extracting global C symbols from \`$arg'"
-	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
-	    $run eval '$echo ": $name " >> "$nlist"'
-	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
-	  done
-
-	  if test -z "$run"; then
-	    # Make sure we have at least an empty file.
-	    test -f "$nlist" || : > "$nlist"
+	if test "$linkmode" = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
+	       test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) func_stripname '-R' '' "$libdir"
+	           temp_xrpath=$func_stripname_result
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) func_append xrpath " $temp_xrpath";;
+		   esac;;
+	      *) func_append temp_deplibs " $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
 
-	    if test -n "$exclude_expsyms"; then
-	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-	      $mv "$nlist"T "$nlist"
+	  func_append newlib_search_path " $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    case $deplib in
+              -L*) func_stripname '-L' '' "$deplib"
+                   func_resolve_sysroot "$func_stripname_result";;
+              *) func_resolve_sysroot "$deplib" ;;
+            esac
+	    if $opt_preserve_dup_deps ; then
+	      case "$tmp_libs " in
+	      *" $func_resolve_sysroot_result "*)
+                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+	      esac
 	    fi
+	    func_append tmp_libs " $func_resolve_sysroot_result"
+	  done
 
-	    # Try sorting and uniquifying the output.
-	    if grep -v "^: " < "$nlist" |
-		if sort -k 3 </dev/null >/dev/null 2>&1; then
-		  sort -k 3
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      path=
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+	        func_resolve_sysroot "$deplib"
+	        deplib=$func_resolve_sysroot_result
+	        func_dirname "$deplib" "" "."
+		dir=$func_dirname_result
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    func_warning "cannot determine absolute directory name of \`$dir'"
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if $GREP "^installed=no" $deplib > /dev/null; then
+		case $host in
+		*-*-darwin*)
+		  depdepl=
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$absdir/$objdir/$depdepl" ; then
+		      depdepl="$absdir/$objdir/$depdepl"
+		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+		      path=
+		    fi
+		  fi
+		  ;;
+		*)
+		  path="-L$absdir/$objdir"
+		  ;;
+		esac
 		else
-		  sort +2
-		fi |
-		uniq > "$nlist"S; then
-	      :
-	    else
-	      grep -v "^: " < "$nlist" > "$nlist"S
-	    fi
-
-	    if test -f "$nlist"S; then
-	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
-	    else
-	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
-	    fi
-
-	    $echo >> "$output_objdir/$dlsyms" "\
-
-#undef lt_preloaded_symbols
-
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-"
-
-	    case $host in
-	    *cygwin* | *mingw* )
-	  $echo >> "$output_objdir/$dlsyms" "\
-/* DATA imports from DLLs on WIN32 can't be const, because
-   runtime relocations are performed -- see ld's documentation
-   on pseudo-relocs */
-struct {
-"
-	      ;;
-	    * )
-	  $echo >> "$output_objdir/$dlsyms" "\
-const struct {
-"
-	      ;;
-	    esac
-
-
-	  $echo >> "$output_objdir/$dlsyms" "\
-  const char *name;
-  lt_ptr address;
-}
-lt_preloaded_symbols[] =
-{\
-"
-
-	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
-
-	    $echo >> "$output_objdir/$dlsyms" "\
-  {0, (lt_ptr) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
-	  fi
-
-	  pic_flag_for_symtable=
-	  case $host in
-	  # compiling the symbol table file with pic_flag works around
-	  # a FreeBSD bug that causes programs to crash when -lm is
-	  # linked before any other PIC object.  But we must not use
-	  # pic_flag when linking with -static.  The problem exists in
-	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-	    case "$compile_command " in
-	    *" -static "*) ;;
-	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
-	    esac;;
-	  *-*-hpux*)
-	    case "$compile_command " in
-	    *" -static "*) ;;
-	    *) pic_flag_for_symtable=" $pic_flag";;
-	    esac
-	  esac
-
-	  # Now compile the dynamic symbol file.
-	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
-	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
-
-	  # Clean up the generated files.
-	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
-	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
-
-	  # Transform the symbol file into the correct name.
-          case $host in
-          *cygwin* | *mingw* )
-            if test -f "$output_objdir/${outputname}.def" ; then
-              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
-              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
-            else
-              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-             fi
-            ;;
-          * )
-            compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-            finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-            ;;
-          esac
-	  ;;
-	*)
-	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-      else
-	# We keep going just in case the user didn't refer to
-	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-	# really was required.
-
-	# Nullify the symbol file.
-	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
-	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
-      fi
-
-      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-	# Replace the output file specification.
-	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
-	link_command="$compile_command$compile_rpath"
-
-	# We have no uninstalled library dependencies, so finalize right now.
-	$show "$link_command"
-	$run eval "$link_command"
-	exit_status=$?
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  test -z "$libdir" && \
+		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  test "$absdir" != "$libdir" && \
+		    func_warning "\`$deplib' seems to be moved"
 
-	# Delete the generated files.
-	if test -n "$dlsyms"; then
-	  $show "$rm $output_objdir/${outputname}S.${objext}"
-	  $run $rm "$output_objdir/${outputname}S.${objext}"
+		  path="-L$absdir"
+		fi
+		;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      if test "$pass" = link; then
+	if test "$linkmode" = "prog"; then
+	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+	else
+	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	fi
-
-	exit $exit_status
       fi
-
-      if test -n "$shlibpath_var"; then
-	# We should set the shlibpath_var
-	rpath=
-	for dir in $temp_rpath; do
-	  case $dir in
-	  [\\/]* | [A-Za-z]:[\\/]*)
-	    # Absolute path.
-	    rpath="$rpath$dir:"
-	    ;;
-	  *)
-	    # Relative path: add a thisdir entry.
-	    rpath="$rpath\$thisdir/$dir:"
-	    ;;
-	  esac
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
 	done
-	temp_rpath="$rpath"
-      fi
-
-      if test -n "$compile_shlibpath$finalize_shlibpath"; then
-	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
-      fi
-      if test -n "$finalize_shlibpath"; then
-	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
       fi
-
-      compile_var=
-      finalize_var=
-      if test -n "$runpath_var"; then
-	if test -n "$perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $perm_rpath; do
-	    rpath="$rpath$dir:"
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) func_append lib_search_path " $dir" ;;
+	    esac
 	  done
-	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	  newlib_search_path=
 	fi
-	if test -n "$finalize_perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $finalize_perm_rpath; do
-	    rpath="$rpath$dir:"
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) func_append tmp_libs " $deplib" ;;
+	      esac
+	      ;;
+	    *) func_append tmp_libs " $deplib" ;;
+	    esac
 	  done
-	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-      fi
-
-      if test "$no_install" = yes; then
-	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
-	# Replace the output file specification.
-	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
-	# Delete the old output file.
-	$run $rm $output
-	# Link the executable and exit
-	$show "$link_command"
-	$run eval "$link_command" || exit $?
-	exit $EXIT_SUCCESS
+	  eval $var=\"$tmp_libs\"
+	done # for var
       fi
-
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
-
-	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
-	$echo "$modename: \`$output' will be relinked during installation" 1>&2
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  func_append tmp_libs " $i"
 	fi
-      fi
-
-      # Replace the output file specification.
-      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
-      # Delete the old output files.
-      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
-      $show "$link_command"
-      $run eval "$link_command" || exit $?
-
-      # Now create the wrapper script.
-      $show "creating $output"
-
-      # Quote the relink command for shipping.
-      if test -n "$relink_command"; then
-	# Preserve any variables that may affect compiler behavior
-	for var in $variables_saved_for_relink; do
-	  if eval test -z \"\${$var+set}\"; then
-	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
-	  elif eval var_value=\$$var; test -z "$var_value"; then
-	    relink_command="$var=; export $var; $relink_command"
-	  else
-	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
-	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
-	  fi
-	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
-      fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+    fi
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
+      dlprefiles="$newdlprefiles"
+    fi
 
-      # Quote $echo for shipping.
-      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
-	case $progpath in
-	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
-	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
-	esac
-	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
-      else
-	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for archives"
       fi
 
-      # Only actually do things if our run command is non-null.
-      if test -z "$run"; then
-	# win32 will think the script is a binary if it has
-	# a .exe suffix, so we strip it off here.
-	case $output in
-	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
-	esac
-	# test for cygwin because mv fails w/o .exe extensions
-	case $host in
-	  *cygwin*)
-	    exeext=.exe
-	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
-	  *) exeext= ;;
-	esac
-	case $host in
-	  *cygwin* | *mingw* )
-            output_name=`basename $output`
-            output_path=`dirname $output`
-            cwrappersource="$output_path/$objdir/lt-$output_name.c"
-            cwrapper="$output_path/$output_name.exe"
-            $rm $cwrappersource $cwrapper
-            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
-	    cat > $cwrappersource <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-
-   The $output program cannot be directly executed until all the libtool
-   libraries that it depends on are installed.
-
-   This wrapper executable should never be moved out of the build directory.
-   If it is, it will not operate correctly.
-
-   Currently, it simply execs the wrapper *script* "/bin/sh $output",
-   but could eventually absorb all of the scripts functionality and
-   exec $objdir/$outputname directly.
-*/
-EOF
-	    cat >> $cwrappersource<<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+      esac
 
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# ifndef DIR_SEPARATOR_2
-#  define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-#  define PATH_SEPARATOR_2 ';'
-# endif
-#endif
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for archives"
 
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for archives"
 
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
+      test -n "$vinfo" && \
+	func_warning "\`-version-info/-version-number' is ignored for archives"
 
-#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for archives"
 
-/* -DDEBUG is fairly common in CFLAGS.  */
-#undef DEBUG
-#if defined DEBUGWRAPPER
-# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
-#else
-# define DEBUG(format, ...)
-#endif
+      test -n "$export_symbols$export_symbols_regex" && \
+	func_warning "\`-export-symbols' is ignored for archives"
 
-const char *program_name = NULL;
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      func_append objs "$old_deplibs"
+      ;;
 
-void * xmalloc (size_t num);
-char * xstrdup (const char *string);
-const char * base_name (const char *name);
-char * find_executable(const char *wrapper);
-int    check_executable(const char *path);
-char * strendzap(char *str, const char *pat);
-void lt_fatal (const char *message, ...);
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	func_stripname 'lib' '.la' "$outputname"
+	name=$func_stripname_result
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	test "$module" = no && \
+	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
 
-int
-main (int argc, char *argv[])
-{
-  char **newargz;
-  int i;
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  func_stripname '' '.la' "$outputname"
+	  name=$func_stripname_result
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  func_stripname '' '.la' "$outputname"
+	  libname=$func_stripname_result
+	fi
+	;;
+      esac
 
-  program_name = (char *) xstrdup (base_name (argv[0]));
-  DEBUG("(main) argv[0]      : %s\n",argv[0]);
-  DEBUG("(main) program_name : %s\n",program_name);
-  newargz = XMALLOC(char *, argc+2);
-EOF
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	else
+	  echo
+	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+	  $ECHO "*** objects $objs is not portable!"
+	  func_append libobjs " $objs"
+	fi
+      fi
 
-            cat >> $cwrappersource <<EOF
-  newargz[0] = (char *) xstrdup("$SHELL");
-EOF
+      test "$dlself" != no && \
+	func_warning "\`-dlopen self' is ignored for libtool libraries"
 
-            cat >> $cwrappersource <<"EOF"
-  newargz[1] = find_executable(argv[0]);
-  if (newargz[1] == NULL)
-    lt_fatal("Couldn't find %s", argv[0]);
-  DEBUG("(main) found exe at : %s\n",newargz[1]);
-  /* we know the script has the same name, without the .exe */
-  /* so make sure newargz[1] doesn't end in .exe */
-  strendzap(newargz[1],".exe");
-  for (i = 1; i < argc; i++)
-    newargz[i+1] = xstrdup(argv[i]);
-  newargz[argc+1] = NULL;
+      set dummy $rpath
+      shift
+      test "$#" -gt 1 && \
+	func_warning "ignoring multiple \`-rpath's for a libtool library"
 
-  for (i=0; i<argc+1; i++)
-  {
-    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
-    ;
-  }
+      install_libdir="$1"
 
-EOF
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
 
-            case $host_os in
-              mingw*)
-                cat >> $cwrappersource <<EOF
-  execv("$SHELL",(char const **)newargz);
-EOF
-              ;;
-              *)
-                cat >> $cwrappersource <<EOF
-  execv("$SHELL",newargz);
-EOF
-              ;;
-            esac
+	test -n "$vinfo" && \
+	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
 
-            cat >> $cwrappersource <<"EOF"
-  return 127;
-}
+	test -n "$release" && \
+	  func_warning "\`-release' is ignored for convenience libraries"
+      else
 
-void *
-xmalloc (size_t num)
-{
-  void * p = (void *) malloc (num);
-  if (!p)
-    lt_fatal ("Memory exhausted");
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	shift
+	IFS="$save_ifs"
 
-  return p;
-}
+	test -n "$7" && \
+	  func_fatal_help "too many parameters to \`-version-info'"
 
-char *
-xstrdup (const char *string)
-{
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
-;
-}
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
 
-const char *
-base_name (const char *name)
-{
-  const char *base;
+	case $vinfo_number in
+	yes)
+	  number_major="$1"
+	  number_minor="$2"
+	  number_revision="$3"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  # correct linux to gnu/linux during the next big refactor
+	  darwin|linux|osf|windows|none)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|qnx|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age="$number_minor"
+	    revision="$number_minor"
+	    lt_irix_increment=no
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$1"
+	  revision="$2"
+	  age="$3"
+	  ;;
+	esac
 
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
-    name += 2;
-#endif
+	# Check that each of the things are valid numbers.
+	case $current in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "CURRENT \`$current' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
 
-  for (base = name; *name; name++)
-    if (IS_DIR_SEPARATOR (*name))
-      base = name + 1;
-  return base;
-}
+	case $revision in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "REVISION \`$revision' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
 
-int
-check_executable(const char * path)
-{
-  struct stat st;
+	case $age in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "AGE \`$age' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
 
-  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
-  if ((!path) || (!*path))
-    return 0;
+	if test "$age" -gt "$current"; then
+	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	fi
 
-  if ((stat (path, &st) >= 0) &&
-      (
-        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
-#if defined (S_IXOTH)
-       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
-#endif
-#if defined (S_IXGRP)
-       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
-#endif
-       ((st.st_mode & S_IXUSR) == S_IXUSR))
-      )
-    return 1;
-  else
-    return 0;
-}
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
 
-/* Searches for the full path of the wrapper.  Returns
-   newly allocated full path name if found, NULL otherwise */
-char *
-find_executable (const char* wrapper)
-{
-  int has_slash = 0;
-  const char* p;
-  const char* p_next;
-  /* static buffer for getcwd */
-  char tmp[LT_PATHMAX + 1];
-  int tmp_len;
-  char* concat_name;
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  func_arith $current + 1
+	  minor_current=$func_arith_result
+	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+	  ;;
 
-  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
 
-  if ((wrapper == NULL) || (*wrapper == '\0'))
-    return NULL;
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
 
-  /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
-  {
-    concat_name = xstrdup (wrapper);
-    if (check_executable(concat_name))
-      return concat_name;
-    XFREE(concat_name);
-  }
-  else
-  {
-#endif
-    if (IS_DIR_SEPARATOR (wrapper[0]))
-    {
-      concat_name = xstrdup (wrapper);
-      if (check_executable(concat_name))
-        return concat_name;
-      XFREE(concat_name);
-    }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  }
-#endif
+	irix | nonstopux)
+	  if test "X$lt_irix_increment" = "Xno"; then
+	    func_arith $current - $age
+	  else
+	    func_arith $current - $age + 1
+	  fi
+	  major=$func_arith_result
 
-  for (p = wrapper; *p; p++)
-    if (*p == '/')
-    {
-      has_slash = 1;
-      break;
-    }
-  if (!has_slash)
-  {
-    /* no slashes; search PATH */
-    const char* path = getenv ("PATH");
-    if (path != NULL)
-    {
-      for (p = path; *p; p = p_next)
-      {
-        const char* q;
-        size_t p_len;
-        for (q = p; *q; q++)
-          if (IS_PATH_SEPARATOR(*q))
-            break;
-        p_len = q - p;
-        p_next = (*q == '\0' ? q : q + 1);
-        if (p_len == 0)
-        {
-          /* empty path: current directory */
-          if (getcwd (tmp, LT_PATHMAX) == NULL)
-            lt_fatal ("getcwd failed");
-          tmp_len = strlen(tmp);
-          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
-          memcpy (concat_name, tmp, tmp_len);
-          concat_name[tmp_len] = '/';
-          strcpy (concat_name + tmp_len + 1, wrapper);
-        }
-        else
-        {
-          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
-          memcpy (concat_name, p, p_len);
-          concat_name[p_len] = '/';
-          strcpy (concat_name + p_len + 1, wrapper);
-        }
-        if (check_executable(concat_name))
-          return concat_name;
-        XFREE(concat_name);
-      }
-    }
-    /* not found in PATH; assume curdir */
-  }
-  /* Relative path | not found in path: prepend cwd */
-  if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal ("getcwd failed");
-  tmp_len = strlen(tmp);
-  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
-  memcpy (concat_name, tmp, tmp_len);
-  concat_name[tmp_len] = '/';
-  strcpy (concat_name + tmp_len + 1, wrapper);
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
 
-  if (check_executable(concat_name))
-    return concat_name;
-  XFREE(concat_name);
-  return NULL;
-}
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    func_arith $revision - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
 
-char *
-strendzap(char *str, const char *pat)
-{
-  size_t len, patlen;
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
 
-  assert(str != NULL);
-  assert(pat != NULL);
+	linux) # correct to gnu/linux during the next big refactor
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix="$major.$age.$revision"
+	  ;;
 
-  len = strlen(str);
-  patlen = strlen(pat);
+	osf)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
 
-  if (patlen <= len)
-  {
-    str += len - patlen;
-    if (strcmp(str, pat) == 0)
-      *str = '\0';
-  }
-  return str;
-}
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    func_arith $current - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring="$verstring:${iface}.0"
+	  done
 
-static void
-lt_error_core (int exit_status, const char * mode,
-          const char * message, va_list ap)
-{
-  fprintf (stderr, "%s: %s: ", program_name, mode);
-  vfprintf (stderr, message, ap);
-  fprintf (stderr, ".\n");
+	  # Make executables depend on our current version.
+	  func_append verstring ":${current}.0"
+	  ;;
 
-  if (exit_status >= 0)
-    exit (exit_status);
-}
+	qnx)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
 
-void
-lt_fatal (const char *message, ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
-  va_end (ap);
-}
-EOF
-          # we should really use a build-platform specific compiler
-          # here, but OTOH, the wrappers (shell script and this C one)
-          # are only useful if you want to execute the "real" binary.
-          # Since the "real" binary is built for $host, then this
-          # wrapper might as well be built for $host, too.
-          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
-          ;;
-        esac
-        $rm $output
-        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
 
-	$echo > $output "\
-#! $SHELL
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  func_arith $current - $age
+	  major=$func_arith_result
+	  versuffix="-$major"
+	  ;;
 
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
+	*)
+	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  ;;
+	esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
-sed_quote_subst='$sed_quote_subst'
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
 
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
 
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    func_warning "undefined symbols not allowed in $host shared libraries"
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
 
-relink_command=\"$relink_command\"
+      fi
 
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variable:
-  notinst_deplibs='$notinst_deplibs'
-else
-  # When we are sourced in execute mode, \$file and \$echo are already set.
-  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    echo=\"$qecho\"
-    file=\"\$0\"
-    # Make sure echo works.
-    if test \"X\$1\" = X--no-reexec; then
-      # Discard the --no-reexec flag, and continue.
-      shift
-    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
-      # Yippee, \$echo works!
-      :
-    else
-      # Restart under the correct shell, and then maybe \$echo will work.
-      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
-    fi
-  fi\
-"
-	$echo >> $output "\
+      func_generate_dlsyms "$libname" "$libname" "yes"
+      func_append libobjs " $symfileobj"
+      test "X$libobjs" = "X " && libobjs=
 
-  # Find the directory that this script lives in.
-  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+      if test "$opt_mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$ECHO "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext | *.gcno)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       if test "X$precious_files_regex" != "X"; then
+		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+		 then
+		   continue
+		 fi
+	       fi
+	       func_append removelist " $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	test -n "$removelist" && \
+	  func_show_eval "${RM}r \$removelist"
+      fi
 
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	func_append oldlibs " $output_objdir/$libname.$libext"
 
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+      fi
 
-    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
-  done
+      # Eliminate all temporary directories.
+      #for path in $notinst_path; do
+      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+      #done
 
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  func_replace_sysroot "$libdir"
+	  func_append temp_xrpath " -R$func_replace_sysroot_result"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_rpath " $libdir" ;;
+	  esac
+	done
+	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
 
-	if test "$fast_install" = yes; then
-	  $echo >> $output "\
-  program=lt-'$outputname'$exeext
-  progdir=\"\$thisdir/$objdir\"
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) func_append dlfiles " $lib" ;;
+	esac
+      done
 
-  if test ! -f \"\$progdir/\$program\" || \\
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
-       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) func_append dlprefiles " $lib" ;;
+	esac
+      done
 
-    file=\"\$\$-\$program\"
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    func_append deplibs " System.ltframework"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    ;;
+	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      func_append deplibs " -lc"
+	    fi
+	    ;;
+	  esac
+	fi
 
-    if test ! -d \"\$progdir\"; then
-      $mkdir \"\$progdir\"
-    else
-      $rm \"\$progdir/\$file\"
-    fi"
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $opt_dry_run || $RM conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $opt_dry_run || $RM conftest
+	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    func_append newdeplibs " $i"
+		    i=""
+		    ;;
+		  esac
+		fi
+		if test -n "$i" ; then
+		  libname=`eval "\\$ECHO \"$libname_spec\""`
+		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		  set dummy $deplib_matches; shift
+		  deplib_match=$1
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    func_append newdeplibs " $i"
+		  else
+		    droppeddeps=yes
+		    echo
+		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		    echo "*** I have the capability to make that library automatically link in when"
+		    echo "*** you link to this library.  But I can only do this if you have a"
+		    echo "*** shared version of the library, which I believe you do not have"
+		    echo "*** because a test_compile did reveal that the linker did not use it for"
+		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+		;;
+	      *)
+		func_append newdeplibs " $i"
+		;;
+	      esac
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		$opt_dry_run || $RM conftest
+		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      func_append newdeplibs " $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval "\\$ECHO \"$libname_spec\""`
+		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		    set dummy $deplib_matches; shift
+		    deplib_match=$1
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      func_append newdeplibs " $i"
+		    else
+		      droppeddeps=yes
+		      echo
+		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		      echo "*** I have the capability to make that library automatically link in when"
+		      echo "*** you link to this library.  But I can only do this if you have a"
+		      echo "*** shared version of the library, which you do not appear to have"
+		      echo "*** because a test_compile did reveal that the linker did not use this one"
+		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  echo
+		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+		  echo "*** make it link in!  You will probably need to install it or some"
+		  echo "*** library that it depends on before this library will be fully"
+		  echo "*** functional.  Installing it before continuing would be even better."
+		fi
+		;;
+	      *)
+		func_append newdeplibs " $i"
+		;;
+	      esac
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method; shift
+	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  func_append newdeplibs " $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		if test -n "$file_magic_glob"; then
+		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+		else
+		  libnameglob=$libname
+		fi
+		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  if test "$want_nocaseglob" = yes; then
+		    shopt -s nocaseglob
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		    $nocaseglob
+		  else
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		  fi
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null |
+			 $GREP " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+			 $SED -e 10q |
+			 $EGREP "$file_magic_regex" > /dev/null; then
+			func_append newdeplibs " $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		echo
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      func_append newdeplibs " $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method; shift
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  func_append newdeplibs " $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+		       $EGREP "$match_pattern_regex" > /dev/null; then
+		      func_append newdeplibs " $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		echo
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      func_append newdeplibs " $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+	    done
+	  fi
+	  case $tmp_deplibs in
+	  *[!\	\ ]*)
+	    echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	    ;;
+	  esac
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
 
-	  $echo >> $output "\
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library with the System framework
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+	  ;;
+	esac
 
-    # relink executable if necessary
-    if test -n \"\$relink_command\"; then
-      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-      else
-	$echo \"\$relink_command_output\" >&2
-	$rm \"\$progdir/\$file\"
-	exit $EXIT_FAILURE
-      fi
-    fi
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    echo
+	    echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+	    echo "*** a static module, that should work as long as the dlopening"
+	    echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      echo
+	      echo "*** However, this would only work if libtool was able to extract symbol"
+	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** not find such a program.  So, this module is probably useless."
+	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    echo "*** The inter-library dependencies that have been dropped here will be"
+	    echo "*** automatically added whenever a program is linked with this library"
+	    echo "*** or is declared to -dlopen it."
 
-    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
-    { $rm \"\$progdir/\$program\";
-      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
-    $rm \"\$progdir/\$file\"
-  fi"
-	else
-	  $echo >> $output "\
-  program='$outputname'
-  progdir=\"\$thisdir/$objdir\"
-"
+	    if test "$allow_undefined" = no; then
+	      echo
+	      echo "*** Since this library must not contain undefined symbols,"
+	      echo "*** because either the platform does not support them or"
+	      echo "*** it was explicitly requested with -no-undefined,"
+	      echo "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
 	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+	*-*-darwin*)
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  ;;
+      esac
 
-	$echo >> $output "\
-
-  if test -f \"\$progdir/\$program\"; then"
-
-	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-	  $echo >> $output "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    func_append new_libs " -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) func_append new_libs " $deplib" ;;
+	  esac
+	  ;;
+	*) func_append new_libs " $deplib" ;;
+	esac
+      done
+      deplibs="$new_libs"
 
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
 
-    export $shlibpath_var
-"
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	# Remove ${wl} instances when linking with ld.
+	# FIXME: should test the right _cmds variable.
+	case $archive_cmds in
+	  *\$LD\ *) wl= ;;
+        esac
+	if test "$hardcode_into_libs" = yes; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		func_replace_sysroot "$libdir"
+		libdir=$func_replace_sysroot_result
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		func_append dep_rpath " $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append perm_rpath " $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      func_append rpath "$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
 	fi
 
-	# fixup the dll searchpath if we need to.
-	if test -n "$dllsearchpath"; then
-	  $echo >> $output "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
+	shlibpath="$finalize_shlibpath"
+	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 	fi
 
-	$echo >> $output "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-"
-	case $host in
-	# Backslashes separate directories on plain windows
-	*-*-mingw | *-*-os2*)
-	  $echo >> $output "\
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-	  ;;
-
-	*)
-	  $echo >> $output "\
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-	  ;;
-	esac
-	$echo >> $output "\
-      \$echo \"\$0: cannot exec \$program \$*\"
-      exit $EXIT_FAILURE
-    fi
-  else
-    # The program doesn't exist.
-    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
-    \$echo \"This script is just a wrapper for \$program.\" 1>&2
-    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit $EXIT_FAILURE
-  fi
-fi\
-"
-	chmod +x $output
-      fi
-      exit $EXIT_SUCCESS
-      ;;
-    esac
-
-    # See if we need to build an old-fashioned archive.
-    for oldlib in $oldlibs; do
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext_cmds\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	shift
+	realname="$1"
+	shift
 
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
-	  build_libtool_libs=no
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
 	else
-	  oldobjs="$old_deplibs $non_pic_objects"
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
 	fi
-	addlibs="$old_convenience"
-      fi
 
-      if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
-	generated="$generated $gentop"
+	lib="$output_objdir/$realname"
+	linknames=
+	for link
+	do
+	  func_append linknames " $link"
+	done
 
-	func_extract_archives $gentop $addlibs
-	oldobjs="$oldobjs $func_extract_archives_result"
-      fi
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	test "X$libobjs" = "X " && libobjs=
 
-      # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
-       cmds=$old_archive_from_new_cmds
-      else
-	# POSIX demands no paths to be encoded in archives.  We have
-	# to avoid creating archives with duplicate basenames if we
-	# might have to extract them afterwards, e.g., when creating a
-	# static archive out of a convenience library, or when linking
-	# the entirety of a libtool archive into another (currently
-	# not supported by libtool).
-	if (for obj in $oldobjs
-	    do
-	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
-	    done | sort | sort -uc >/dev/null 2>&1); then
-	  :
-	else
-	  $echo "copying selected object files to avoid basename conflicts..."
+	delfiles=
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+	  export_symbols="$output_objdir/$libname.uexp"
+	  func_append delfiles " $export_symbols"
+	fi
 
-	  if test -z "$gentop"; then
-	    gentop="$output_objdir/${outputname}x"
-	    generated="$generated $gentop"
-
-	    $show "${rm}r $gentop"
-	    $run ${rm}r "$gentop"
-	    $show "$mkdir $gentop"
-	    $run $mkdir "$gentop"
-	    exit_status=$?
-	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
-	      exit $exit_status
+	orig_export_symbols=
+	case $host_os in
+	cygwin* | mingw* | cegcc*)
+	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+	    # exporting using user supplied symfile
+	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	      # and it's NOT already a .def file. Must figure out
+	      # which of the given symbols are data symbols and tag
+	      # them as such. So, trigger use of export_symbols_cmds.
+	      # export_symbols gets reassigned inside the "prepare
+	      # the list of exported symbols" if statement, so the
+	      # include_expsyms logic still works.
+	      orig_export_symbols="$export_symbols"
+	      export_symbols=
+	      always_export_symbols=yes
 	    fi
 	  fi
+	  ;;
+	esac
 
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  counter=1
-	  for obj in $save_oldobjs
-	  do
-	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
-	    case " $oldobjs " in
-	    " ") oldobjs=$obj ;;
-	    *[\ /]"$objbase "*)
-	      while :; do
-		# Make sure we don't pick an alternate name that also
-		# overlaps.
-		newobj=lt$counter-$objbase
-		counter=`expr $counter + 1`
-		case " $oldobjs " in
-		*[\ /]"$newobj "*) ;;
-		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
-		esac
-	      done
-	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      $run ln "$obj" "$gentop/$newobj" ||
-	      $run cp "$obj" "$gentop/$newobj"
-	      oldobjs="$oldobjs $gentop/$newobj"
-	      ;;
-	    *) oldobjs="$oldobjs $obj" ;;
-	    esac
-	  done
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $opt_dry_run || $RM $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd1 in $cmds; do
+	      IFS="$save_ifs"
+	      # Take the normal branch if the nm_file_list_spec branch
+	      # doesn't work or if tool conversion is not needed.
+	      case $nm_file_list_spec~$to_tool_file_cmd in
+		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+		  try_normal_branch=yes
+		  eval cmd=\"$cmd1\"
+		  func_len " $cmd"
+		  len=$func_len_result
+		  ;;
+		*)
+		  try_normal_branch=no
+		  ;;
+	      esac
+	      if test "$try_normal_branch" = yes \
+		 && { test "$len" -lt "$max_cmd_len" \
+		      || test "$max_cmd_len" -le -1; }
+	      then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
+	      elif test -n "$nm_file_list_spec"; then
+		func_basename "$output"
+		output_la=$func_basename_result
+		save_libobjs=$libobjs
+		save_output=$output
+		output=${output_objdir}/${output_la}.nm
+		func_to_tool_file "$output"
+		libobjs=$nm_file_list_spec$func_to_tool_file_result
+		func_append delfiles " $output"
+		func_verbose "creating $NM input file list: $output"
+		for obj in $save_libobjs; do
+		  func_to_tool_file "$obj"
+		  $ECHO "$func_to_tool_file_result"
+		done > "$output"
+		eval cmd=\"$cmd1\"
+		func_show_eval "$cmd" 'exit $?'
+		output=$save_output
+		libobjs=$save_libobjs
+		skipped_export=false
+	      else
+		# The command line is too long to execute in one step.
+		func_verbose "using reloadable object file for export list..."
+		skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
 	fi
 
-	eval cmds=\"$old_archive_cmds\"
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  tmp_export_symbols="$export_symbols"
+	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+	fi
 
-	if len=`expr "X$cmds" : ".*"` &&
-	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  cmds=$old_archive_cmds
-	else
-	  # the command line is too long to link in one step, link in parts
-	  $echo "using piecewise archive linking..."
-	  save_RANLIB=$RANLIB
-	  RANLIB=:
-	  objlist=
-	  concat_cmds=
-	  save_oldobjs=$oldobjs
+	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	  # The given exports_symbols file has to be filtered, so filter it.
+	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # though. Also, the filter scales superlinearly with the number of
+	  # global variables. join(1) would be nice here, but unfortunately
+	  # isn't a blessed tool.
+	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+	  export_symbols=$output_objdir/$libname.def
+	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	fi
 
-	  # Is there a better way of finding the last object in the list?
-	  for obj in $save_oldobjs
-	  do
-	    last_oldobj=$obj
-	  done
-	  for obj in $save_oldobjs
-	  do
-	    oldobjs="$objlist $obj"
-	    objlist="$objlist $obj"
-	    eval test_cmds=\"$old_archive_cmds\"
-	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-	       test "$len" -le "$max_cmd_len"; then
-	      :
-	    else
-	      # the above command should be used before it gets too long
-	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
-	        RANLIB=$save_RANLIB
-	      fi
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
-	      objlist=
-	    fi
-	  done
-	  RANLIB=$save_RANLIB
-	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
-	    eval cmds=\"\$concat_cmds\"
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+	  case " $convenience " in
+	  *" $test_deplib "*) ;;
+	  *)
+	    func_append tmp_deplibs " $test_deplib"
+	    ;;
+	  esac
+	done
+	deplibs="$tmp_deplibs"
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec" &&
+	    test "$compiler_needs_object" = yes &&
+	    test -z "$libobjs"; then
+	    # extract the archives, so we have objects to list.
+	    # TODO: could optimize this to just extract one archive.
+	    whole_archive_flag_spec=
+	  fi
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
 	  else
-	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	    gentop="$output_objdir/${outputname}x"
+	    func_append generated " $gentop"
+
+	    func_extract_archives $gentop $convenience
+	    func_append libobjs " $func_extract_archives_result"
+	    test "X$libobjs" = "X " && libobjs=
 	  fi
 	fi
-      fi
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-        eval cmd=\"$cmd\"
-	IFS="$save_ifs"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-    done
 
-    if test -n "$generated"; then
-      $show "${rm}r$generated"
-      $run ${rm}r$generated
-    fi
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  func_append linker_flags " $flag"
+	fi
 
-    # Now create the libtool archive.
-    case $output in
-    *.la)
-      old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
-      $show "creating $output"
+	# Make a backup of the uninstalled library when relinking
+	if test "$opt_mode" = relink; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+	fi
 
-      # Preserve any variables that may affect compiler behavior
-      for var in $variables_saved_for_relink; do
-	if eval test -z \"\${$var+set}\"; then
-	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
-	elif eval var_value=\$$var; test -z "$var_value"; then
-	  relink_command="$var=; export $var; $relink_command"
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
 	else
-	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
-	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval test_cmds=\"$archive_expsym_cmds\"
+	    cmds=$archive_expsym_cmds
+	  else
+	    eval test_cmds=\"$archive_cmds\"
+	    cmds=$archive_cmds
+	  fi
 	fi
-      done
-      # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
-      if test "$hardcode_automatic" = yes ; then
-	relink_command=
-      fi
 
+	if test "X$skipped_export" != "X:" &&
+	   func_len " $test_cmds" &&
+	   len=$func_len_result &&
+	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise
+	  # or, if using GNU ld and skipped_export is not :, use a linker
+	  # script.
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+	  func_basename "$output"
+	  output_la=$func_basename_result
 
-      # Only create the output if not a dry run.
-      if test -z "$run"; then
-	for installed in no yes; do
-	  if test "$installed" = yes; then
-	    if test -z "$install_libdir"; then
-	      break
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  last_robj=
+	  k=1
+
+	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+	    output=${output_objdir}/${output_la}.lnkscript
+	    func_verbose "creating GNU ld script: $output"
+	    echo 'INPUT (' > $output
+	    for obj in $save_libobjs
+	    do
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
+	    done
+	    echo ')' >> $output
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$func_to_tool_file_result
+	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+	    output=${output_objdir}/${output_la}.lnk
+	    func_verbose "creating linker input file list: $output"
+	    : > $output
+	    set x $save_libobjs
+	    shift
+	    firstobj=
+	    if test "$compiler_needs_object" = yes; then
+	      firstobj="$1 "
+	      shift
 	    fi
-	    output="$output_objdir/$outputname"i
-	    # Replace all uninstalled libtool libraries with the installed ones
-	    newdependency_libs=
-	    for deplib in $dependency_libs; do
-	      case $deplib in
-	      *.la)
-		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		if test -z "$libdir"; then
-		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-		  exit $EXIT_FAILURE
-		fi
-		newdependency_libs="$newdependency_libs $libdir/$name"
-		;;
-	      *) newdependency_libs="$newdependency_libs $deplib" ;;
-	      esac
+	    for obj
+	    do
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
 	    done
-	    dependency_libs="$newdependency_libs"
-	    newdlfiles=
-	    for lib in $dlfiles; do
-	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-	      if test -z "$libdir"; then
-		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-		exit $EXIT_FAILURE
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+	  else
+	    if test -n "$save_libobjs"; then
+	      func_verbose "creating reloadable object files..."
+	      output=$output_objdir/$output_la-${k}.$objext
+	      eval test_cmds=\"$reload_cmds\"
+	      func_len " $test_cmds"
+	      len0=$func_len_result
+	      len=$len0
+
+	      # Loop over the list of objects to be linked.
+	      for obj in $save_libobjs
+	      do
+		func_len " $obj"
+		func_arith $len + $func_len_result
+		len=$func_arith_result
+		if test "X$objlist" = X ||
+		   test "$len" -lt "$max_cmd_len"; then
+		  func_append objlist " $obj"
+		else
+		  # The command $test_cmds is almost too long, add a
+		  # command to the queue.
+		  if test "$k" -eq 1 ; then
+		    # The first file doesn't have a previous command to add.
+		    reload_objs=$objlist
+		    eval concat_cmds=\"$reload_cmds\"
+		  else
+		    # All subsequent reloadable object files will link in
+		    # the last one created.
+		    reload_objs="$objlist $last_robj"
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+		  fi
+		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  func_arith $k + 1
+		  k=$func_arith_result
+		  output=$output_objdir/$output_la-${k}.$objext
+		  objlist=" $obj"
+		  func_len " $last_robj"
+		  func_arith $len0 + $func_len_result
+		  len=$func_arith_result
+		fi
+	      done
+	      # Handle the remaining objects by creating one last
+	      # reloadable object file.  All subsequent reloadable object
+	      # files will link in the last one created.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      reload_objs="$objlist $last_robj"
+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+	      if test -n "$last_robj"; then
+	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
 	      fi
-	      newdlfiles="$newdlfiles $libdir/$name"
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-	      if test -z "$libdir"; then
-		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-		exit $EXIT_FAILURE
+	      func_append delfiles " $output"
+
+	    else
+	      output=
+	    fi
+
+	    if ${skipped_export-false}; then
+	      func_verbose "generating symbol list for \`$libname.la'"
+	      export_symbols="$output_objdir/$libname.exp"
+	      $opt_dry_run || $RM $export_symbols
+	      libobjs=$output
+	      # Append the command to create the export file.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+	      if test -n "$last_robj"; then
+		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	      newdlprefiles="$newdlprefiles $libdir/$name"
+	    fi
+
+	    test -n "$save_libobjs" &&
+	      func_verbose "creating a temporary reloadable object file: $output"
+
+	    # Loop through the commands generated above and execute them.
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $concat_cmds; do
+	      IFS="$save_ifs"
+	      $opt_silent || {
+		  func_quote_for_expand "$cmd"
+		  eval "func_echo $func_quote_for_expand_result"
+	      }
+	      $opt_dry_run || eval "$cmd" || {
+		lt_exit=$?
+
+		# Restore the uninstalled library and exit
+		if test "$opt_mode" = relink; then
+		  ( cd "$output_objdir" && \
+		    $RM "${realname}T" && \
+		    $MV "${realname}U" "$realname" )
+		fi
+
+		exit $lt_exit
+	      }
 	    done
-	    dlprefiles="$newdlprefiles"
+	    IFS="$save_ifs"
+
+	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+
+          if ${skipped_export-false}; then
+	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	      tmp_export_symbols="$export_symbols"
+	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+	    fi
+
+	    if test -n "$orig_export_symbols"; then
+	      # The given exports_symbols file has to be filtered, so filter it.
+	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # though. Also, the filter scales superlinearly with the number of
+	      # global variables. join(1) would be nice here, but unfortunately
+	      # isn't a blessed tool.
+	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+	      export_symbols=$output_objdir/$libname.def
+	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	    fi
+	  fi
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test "$module" = yes && test -n "$module_cmds" ; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
 	  else
-	    newdlfiles=
-	    for lib in $dlfiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      newdlfiles="$newdlfiles $abs"
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      newdlprefiles="$newdlprefiles $abs"
-	    done
-	    dlprefiles="$newdlprefiles"
+	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	      cmds=$archive_expsym_cmds
+	    else
+	      cmds=$archive_cmds
+	    fi
 	  fi
-	  $rm $output
-	  # place dlname in correct position for cygwin
-	  tdlname=$dlname
-	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
-	  esac
-	  $echo > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
+	fi
 
-# The name that we can dlopen(3).
-dlname='$tdlname'
+	if test -n "$delfiles"; then
+	  # Append the command to remove temporary files to $cmds.
+	  eval cmds=\"\$cmds~\$RM $delfiles\"
+	fi
 
-# Names of this library.
-library_names='$library_names'
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  func_append generated " $gentop"
 
-# The name of the static archive.
-old_library='$old_library'
+	  func_extract_archives $gentop $dlprefiles
+	  func_append libobjs " $func_extract_archives_result"
+	  test "X$libobjs" = "X " && libobjs=
+	fi
 
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $opt_silent || {
+	    func_quote_for_expand "$cmd"
+	    eval "func_echo $func_quote_for_expand_result"
+	  }
+	  $opt_dry_run || eval "$cmd" || {
+	    lt_exit=$?
 
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
+	    # Restore the uninstalled library and exit
+	    if test "$opt_mode" = relink; then
+	      ( cd "$output_objdir" && \
+	        $RM "${realname}T" && \
+		$MV "${realname}U" "$realname" )
+	    fi
 
-# Is this an already installed library?
-installed=$installed
+	    exit $lt_exit
+	  }
+	done
+	IFS="$save_ifs"
 
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
+	# Restore the uninstalled library and exit
+	if test "$opt_mode" = relink; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      func_show_eval '${RM}r "$gentop"'
+	    fi
+	  fi
 
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
-	    $echo >> $output "\
-relink_command=\"$relink_command\""
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
 	  fi
 	done
-      fi
 
-      # Do a symbolic link so that the libtool archive can be found in
-      # LD_LIBRARY_PATH before the program is installed.
-      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
-      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
       ;;
-    esac
-    exit $EXIT_SUCCESS
-    ;;
 
-  # libtool install mode
-  install)
-    modename="$modename: install"
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for objects"
+      fi
 
-    # There may be an optional sh(1) argument at the beginning of
-    # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
-       # Allow the use of GNU shtool's install command.
-       $echo "X$nonopt" | grep shtool > /dev/null; then
-      # Aesthetically quote it.
-      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	arg="\"$arg\""
-	;;
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "\`-l' and \`-L' are ignored for objects" ;;
       esac
-      install_prog="$arg "
-      arg="$1"
-      shift
-    else
-      install_prog=
-      arg=$nonopt
-    fi
 
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-    case $arg in
-    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-      arg="\"$arg\""
-      ;;
-    esac
-    install_prog="$install_prog$arg"
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for objects"
 
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=no
-    stripme=
-    for arg
-    do
-      if test -n "$dest"; then
-	files="$files $dest"
-	dest=$arg
-	continue
-      fi
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for objects"
 
-      case $arg in
-      -d) isdir=yes ;;
-      -f) 
-      	case " $install_prog " in
-	*[\\\ /]cp\ *) ;;
-	*) prev=$arg ;;
-	esac
-	;;
-      -g | -m | -o) prev=$arg ;;
-      -s)
-	stripme=" -s"
-	continue
-	;;
-      -*)
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for objects"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for objects"
+
+      case $output in
+      *.lo)
+	test -n "$objs$old_deplibs" && \
+	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+	libobj=$output
+	func_lo2o "$libobj"
+	obj=$func_lo2o_result
 	;;
       *)
-	# If the previous option needed an argument, then skip it.
-	if test -n "$prev"; then
-	  prev=
-	else
-	  dest=$arg
-	  continue
-	fi
+	libobj=
+	obj="$output"
 	;;
       esac
 
-      # Aesthetically quote the argument.
-      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	arg="\"$arg\""
-	;;
-      esac
-      install_prog="$install_prog $arg"
-    done
+      # Delete the old objects.
+      $opt_dry_run || $RM $obj $libobj
 
-    if test -z "$install_prog"; then
-      $echo "$modename: you must specify an install program" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
 
-    if test -n "$prev"; then
-      $echo "$modename: the \`$prev' option requires an argument" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	else
+	  gentop="$output_objdir/${obj}x"
+	  func_append generated " $gentop"
 
-    if test -z "$files"; then
-      if test -z "$dest"; then
-	$echo "$modename: no file or destination specified" 1>&2
-      else
-	$echo "$modename: you must specify a destination" 1>&2
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+	fi
       fi
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
 
-    # Strip any trailing slash from the destination.
-    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+      # If we're not building shared, we need to use non_pic_objs
+      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
 
-    # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
-      destname=
-    else
-      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
-      test "X$destdir" = "X$dest" && destdir=.
-      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
-      # Not a directory, so check to see that there is only one file specified.
-      set dummy $files
-      if test "$#" -gt 2; then
-	$echo "$modename: \`$dest' is not a directory" 1>&2
-	$echo "$help" 1>&2
-	exit $EXIT_FAILURE
+      output="$obj"
+      func_execute_cmds "$reload_cmds" 'exit $?'
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	exit $EXIT_SUCCESS
       fi
-    fi
-    case $destdir in
-    [\\/]* | [A-Za-z]:[\\/]*) ;;
-    *)
-      for file in $files; do
-	case $file in
-	*.lo) ;;
-	*)
-	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-      done
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	func_execute_cmds "$reload_cmds" 'exit $?'
+      fi
+
+      if test -n "$gentop"; then
+	func_show_eval '${RM}r "$gentop"'
+      fi
+
+      exit $EXIT_SUCCESS
       ;;
-    esac
 
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
+    prog)
+      case $host in
+	*cygwin*) func_stripname '' '.exe' "$output"
+	          output=$func_stripname_result.exe;;
+      esac
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for programs"
 
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for programs"
 
-      # Do each installation.
-      case $file in
-      *.$libext)
-	# Do the static libraries later.
-	staticlibs="$staticlibs $file"
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+	&& test "$dlopen_self" = unknown \
+	&& test "$dlopen_self_static" = unknown && \
+	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
 	;;
+      esac
 
-      *.la)
-	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
+      case $host in
+      *-*-darwin*)
+	# Don't allow lazy linking, it breaks C++ global constructors
+	# But is supposedly fixed on 10.4 or later (yay!).
+	if test "$tagname" = CXX ; then
+	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+	    10.[0123])
+	      func_append compile_command " ${wl}-bind_at_load"
+	      func_append finalize_command " ${wl}-bind_at_load"
+	    ;;
+	  esac
 	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	;;
+      esac
 
-	library_names=
-	old_library=
-	relink_command=
-	# If there is no directory component, then add one.
-	case $file in
-	*/* | *\\*) . $file ;;
-	*) . ./$file ;;
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    func_append new_libs " -L$path/$objdir" ;;
+	  esac
+	  ;;
 	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) func_append new_libs " $deplib" ;;
+	  esac
+	  ;;
+	*) func_append new_libs " $deplib" ;;
+	esac
+      done
+      compile_deplibs="$new_libs"
 
-	# Add the libdir to current_libdirs if it is the destination.
-	if test "X$destdir" = "X$libdir"; then
-	  case "$current_libdirs " in
+
+      func_append compile_command " $compile_deplibs"
+      func_append finalize_command " $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
 	  *" $libdir "*) ;;
-	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
-	else
-	  # Note the libdir as a future libdir.
-	  case "$future_libdirs " in
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    func_append rpath " $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
 	  *" $libdir "*) ;;
-	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  *) func_append perm_rpath " $libdir" ;;
 	  esac
 	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  ::) dllsearchpath=$libdir;;
+	  *) func_append dllsearchpath ":$libdir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) func_append dllsearchpath ":$testbindir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
 
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
-	test "X$dir" = "X$file/" && dir=
-	dir="$dir$objdir"
-
-	if test -n "$relink_command"; then
-	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
-
-	  # Don't allow the user to place us outside of our expected
-	  # location b/c this prevents finding dependent libraries that
-	  # are installed to the same prefix.
-	  # At present, this check doesn't affect windows .dll's that
-	  # are installed into $libdir/../bin (currently, that works fine)
-	  # but it's something to keep an eye on.
-	  if test "$inst_prefix_dir" = "$destdir"; then
-	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-
-	  if test -n "$inst_prefix_dir"; then
-	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
-	  else
-	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
-	  fi
-
-	  $echo "$modename: warning: relinking \`$file'" 1>&2
-	  $show "$relink_command"
-	  if $run eval "$relink_command"; then :
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
 	  else
-	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-	    exit $EXIT_FAILURE
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    func_append rpath " $flag"
 	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_perm_rpath " $libdir" ;;
+	  esac
 	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
 
-	# See the names of the shared library.
-	set dummy $library_names
-	if test -n "$2"; then
-	  realname="$2"
-	  shift
-	  shift
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+      fi
 
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
 
-	  # Install the shared library and build the symlinks.
-	  $show "$install_prog $dir/$srcname $destdir/$realname"
-	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
-	  if test -n "$stripme" && test -n "$striplib"; then
-	    $show "$striplib $destdir/$realname"
-	    $run eval "$striplib $destdir/$realname" || exit $?
-	  fi
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+	func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
 
-	  if test "$#" -gt 0; then
-	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
-	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
-	    # so we also need to try rm && ln -s.
-	    for linkname
-	    do
-	      if test "$linkname" != "$realname"; then
-                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
-                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
-	      fi
-	    done
-	  fi
+      wrappers_required=yes
+      case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
+      *cygwin* | *mingw* )
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      *)
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      esac
+      if test "$wrappers_required" = no; then
+	# Replace the output file specification.
+	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+	link_command="$compile_command$compile_rpath"
 
-	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
-	  cmds=$postinstall_cmds
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $cmds; do
-	    IFS="$save_ifs"
-	    eval cmd=\"$cmd\"
-	    $show "$cmd"
-	    $run eval "$cmd" || {
-	      lt_exit=$?
-
-	      # Restore the uninstalled library and exit
-	      if test "$mode" = relink; then
-		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
-	      fi
+	# We have no uninstalled library dependencies, so finalize right now.
+	exit_status=0
+	func_show_eval "$link_command" 'exit_status=$?'
 
-	      exit $lt_exit
-	    }
-	  done
-	  IFS="$save_ifs"
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
 	fi
 
-	# Install the pseudo-library for information purposes.
-	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	instname="$dir/$name"i
-	$show "$install_prog $instname $destdir/$name"
-	$run eval "$install_prog $instname $destdir/$name" || exit $?
+	# Delete the generated files.
+	if test -f "$output_objdir/${outputname}S.${objext}"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	fi
 
-	# Maybe install the static library, too.
-	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
-	;;
+	exit $exit_status
+      fi
 
-      *.lo)
-	# Install (i.e. copy) a libtool object.
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
 
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	  destfile="$destdir/$destfile"
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    func_append rpath "$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
 	fi
-
-	# Deduce the name of the destination old-style object file.
-	case $destfile in
-	*.lo)
-	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
-	  ;;
-	*.$objext)
-	  staticdest="$destfile"
-	  destfile=
-	  ;;
-	*)
-	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-
-	# Install the libtool object if requested.
-	if test -n "$destfile"; then
-	  $show "$install_prog $file $destfile"
-	  $run eval "$install_prog $file $destfile" || exit $?
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    func_append rpath "$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
 	fi
+      fi
 
-	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
-	  # Deduce the name of the old-style object file.
-	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$opt_dry_run || $RM $output
+	# Link the executable and exit
+	func_show_eval "$link_command" 'exit $?'
 
-	  $show "$install_prog $staticobj $staticdest"
-	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
 	fi
+
 	exit $EXIT_SUCCESS
-	;;
+      fi
 
-      *)
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	func_warning "this platform does not like uninstalled shared libraries"
+	func_warning "\`$output' will be relinked during installation"
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
 	else
-	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	  destfile="$destdir/$destfile"
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
 	fi
+      fi
 
-	# If the file is missing, and there is a .exe on the end, strip it
-	# because it is most likely a libtool script we actually want to
-	# install
-	stripped_ext=""
-	case $file in
-	  *.exe)
-	    if test ! -f "$file"; then
-	      file=`$echo $file|${SED} 's,.exe$,,'`
-	      stripped_ext=".exe"
-	    fi
-	    ;;
-	esac
+      # Replace the output file specification.
+      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 
-	# Do a test to see if this is really a libtool program.
-	case $host in
-	*cygwin*|*mingw*)
-	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
-	    ;;
-	*)
-	    wrapper=$file
-	    ;;
-	esac
-	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
-	  notinst_deplibs=
-	  relink_command=
+      # Delete the old output files.
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
 
-	  # Note that it is not necessary on cygwin/mingw to append a dot to
-	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
-	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-	  # `FILE.' does not work on cygwin managed mounts.
-	  #
-	  # If there is no directory component, then add one.
-	  case $wrapper in
-	  */* | *\\*) . ${wrapper} ;;
-	  *) . ./${wrapper} ;;
-	  esac
+      func_show_eval "$link_command" 'exit $?'
 
-	  # Check the variables that should have been set.
-	  if test -z "$notinst_deplibs"; then
-	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
+      if test -n "$postlink_cmds"; then
+	func_to_tool_file "$output_objdir/$outputname"
+	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	func_execute_cmds "$postlink_cmds" 'exit $?'
+      fi
 
-	  finalize=yes
-	  for lib in $notinst_deplibs; do
-	    # Check to see that each library is installed.
-	    libdir=
-	    if test -f "$lib"; then
-	      # If there is no directory component, then add one.
-	      case $lib in
-	      */* | *\\*) . $lib ;;
-	      *) . ./$lib ;;
-	      esac
-	    fi
-	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
-	      finalize=no
-	    fi
-	  done
+      # Now create the wrapper script.
+      func_verbose "creating $output"
 
-	  relink_command=
-	  # Note that it is not necessary on cygwin/mingw to append a dot to
-	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
-	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-	  # `FILE.' does not work on cygwin managed mounts.
-	  #
-	  # If there is no directory component, then add one.
-	  case $wrapper in
-	  */* | *\\*) . ${wrapper} ;;
-	  *) . ./${wrapper} ;;
-	  esac
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    func_quote_for_eval "$var_value"
+	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) func_stripname '' '.exe' "$output"
+	         output=$func_stripname_result ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    func_stripname '' '.exe' "$outputname"
+	    outputname=$func_stripname_result ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+	    func_dirname_and_basename "$output" "" "."
+	    output_name=$func_basename_result
+	    output_path=$func_dirname_result
+	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
+	    cwrapper="$output_path/$output_name.exe"
+	    $RM $cwrappersource $cwrapper
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_cwrapperexe_src > $cwrappersource
+
+	    # The wrapper executable is built using the $host compiler,
+	    # because it contains $host paths and files. If cross-
+	    # compiling, it, like the target executable, must be
+	    # executed on the $host or under an emulation environment.
+	    $opt_dry_run || {
+	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+	      $STRIP $cwrapper
+	    }
 
-	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
-	    if test "$finalize" = yes && test -z "$run"; then
-	      tmpdir=`func_mktempdir`
-	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
-	      outputname="$tmpdir/$file"
-	      # Replace the output file specification.
-	      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
-
-	      $show "$relink_command"
-	      if $run eval "$relink_command"; then :
+	    # Now, create the wrapper script for func_source use:
+	    func_ltwrapper_scriptname $cwrapper
+	    $RM $func_ltwrapper_scriptname_result
+	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+	    $opt_dry_run || {
+	      # note: this script will not be executed, so do not chmod.
+	      if test "x$build" = "x$host" ; then
+		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
 	      else
-		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-		${rm}r "$tmpdir"
-		continue
+		func_emit_wrapper no > $func_ltwrapper_scriptname_result
 	      fi
-	      file="$outputname"
-	    else
-	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
-	    fi
-	  else
-	    # Install the binary that we compiled earlier.
-	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
-	  fi
-	fi
+	    }
+	  ;;
+	  * )
+	    $RM $output
+	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
 
-	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyway 
-	case $install_prog,$host in
-	*/usr/bin/install*,*cygwin*)
-	  case $file:$destfile in
-	  *.exe:*.exe)
-	    # this is ok
-	    ;;
-	  *.exe:*)
-	    destfile=$destfile.exe
-	    ;;
-	  *:*.exe)
-	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
-	    ;;
-	  esac
+	    func_emit_wrapper no > $output
+	    chmod +x $output
 	  ;;
 	esac
-	$show "$install_prog$stripme $file $destfile"
-	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
-	test -n "$outputname" && ${rm}r "$tmpdir"
-	;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-
-      # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
+      }
+      exit $EXIT_SUCCESS
+      ;;
+    esac
 
-      $show "$install_prog $file $oldlib"
-      $run eval "$install_prog \$file \$oldlib" || exit $?
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
 
-      if test -n "$stripme" && test -n "$old_striplib"; then
-	$show "$old_striplib $oldlib"
-	$run eval "$old_striplib $oldlib" || exit $?
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save $symfileobj"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	  if test "$preload" = yes && test -f "$symfileobj"; then
+	    func_append oldobjs " $symfileobj"
+	  fi
+	fi
+	addlibs="$old_convenience"
       fi
 
-      # Do each command in the postinstall commands.
-      cmds=$old_postinstall_cmds
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-	IFS="$save_ifs"
-	eval cmd=\"$cmd\"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-    done
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	func_append generated " $gentop"
 
-    if test -n "$future_libdirs"; then
-      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
-    fi
+	func_extract_archives $gentop $addlibs
+	func_append oldobjs " $func_extract_archives_result"
+      fi
 
-    if test -n "$current_libdirs"; then
-      # Maybe just do a dry run.
-      test -n "$run" && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
-    else
-      exit $EXIT_SUCCESS
-    fi
-    ;;
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+	cmds=$old_archive_from_new_cmds
+      else
 
-  # libtool finish mode
-  finish)
-    modename="$modename: finish"
-    libdirs="$nonopt"
-    admincmds=
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  func_append generated " $gentop"
 
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for dir
-      do
-	libdirs="$libdirs $dir"
-      done
+	  func_extract_archives $gentop $dlprefiles
+	  func_append oldobjs " $func_extract_archives_result"
+	fi
 
-      for libdir in $libdirs; do
-	if test -n "$finish_cmds"; then
-	  # Do each command in the finish commands.
-	  cmds=$finish_cmds
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $cmds; do
-	    IFS="$save_ifs"
-	    eval cmd=\"$cmd\"
-	    $show "$cmd"
-	    $run eval "$cmd" || admincmds="$admincmds
-       $cmd"
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      func_basename "$obj"
+	      $ECHO "$func_basename_result"
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  echo "copying selected object files to avoid basename conflicts..."
+	  gentop="$output_objdir/${outputname}x"
+	  func_append generated " $gentop"
+	  func_mkdir_p "$gentop"
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    func_basename "$obj"
+	    objbase="$func_basename_result"
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		func_arith $counter + 1
+		counter=$func_arith_result
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      func_append oldobjs " $gentop/$newobj"
+	      ;;
+	    *) func_append oldobjs " $obj" ;;
+	    esac
 	  done
-	  IFS="$save_ifs"
-	fi
-	if test -n "$finish_eval"; then
-	  # Do the single finish_eval.
-	  eval cmds=\"$finish_eval\"
-	  $run eval "$cmds" || admincmds="$admincmds
-       $cmds"
 	fi
-      done
-    fi
-
-    # Exit here if they wanted silent mode.
-    test "$show" = : && exit $EXIT_SUCCESS
+	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+	tool_oldlib=$func_to_tool_file_result
+	eval cmds=\"$old_archive_cmds\"
 
-    $echo "X----------------------------------------------------------------------" | $Xsed
-    $echo "Libraries have been installed in:"
-    for libdir in $libdirs; do
-      $echo "   $libdir"
+	func_len " $cmds"
+	len=$func_len_result
+	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	elif test -n "$archiver_list_spec"; then
+	  func_verbose "using command file archive linking..."
+	  for obj in $oldobjs
+	  do
+	    func_to_tool_file "$obj"
+	    $ECHO "$func_to_tool_file_result"
+	  done > $output_objdir/$libname.libcmd
+	  func_to_tool_file "$output_objdir/$libname.libcmd"
+	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  func_verbose "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  eval test_cmds=\"$old_archive_cmds\"
+	  func_len " $test_cmds"
+	  len0=$func_len_result
+	  len=$len0
+	  for obj in $save_oldobjs
+	  do
+	    func_len " $obj"
+	    func_arith $len + $func_len_result
+	    len=$func_arith_result
+	    func_append objlist " $obj"
+	    if test "$len" -lt "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+		RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	      len=$len0
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      func_execute_cmds "$cmds" 'exit $?'
     done
-    $echo
-    $echo "If you ever happen to want to link against installed libraries"
-    $echo "in a given directory, LIBDIR, you must either use libtool, and"
-    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
-    $echo "flag during linking and do at least one of the following:"
-    if test -n "$shlibpath_var"; then
-      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-      $echo "     during execution"
-    fi
-    if test -n "$runpath_var"; then
-      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
-      $echo "     during linking"
-    fi
-    if test -n "$hardcode_libdir_flag_spec"; then
-      libdir=LIBDIR
-      eval flag=\"$hardcode_libdir_flag_spec\"
-
-      $echo "   - use the \`$flag' linker flag"
-    fi
-    if test -n "$admincmds"; then
-      $echo "   - have your system administrator run these commands:$admincmds"
-    fi
-    if test -f /etc/ld.so.conf; then
-      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-    fi
-    $echo
-    $echo "See any operating system documentation about shared libraries for"
-    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
-    $echo "X----------------------------------------------------------------------" | $Xsed
-    exit $EXIT_SUCCESS
-    ;;
 
-  # libtool execute mode
-  execute)
-    modename="$modename: execute"
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
 
-    # The first argument is the command name.
-    cmd="$nonopt"
-    if test -z "$cmd"; then
-      $echo "$modename: you must specify a COMMAND" 1>&2
-      $echo "$help"
-      exit $EXIT_FAILURE
-    fi
-
-    # Handle -dlopen flags immediately.
-    for file in $execute_dlfiles; do
-      if test ! -f "$file"; then
-	$echo "$modename: \`$file' is not a file" 1>&2
-	$echo "$help" 1>&2
-	exit $EXIT_FAILURE
-      fi
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      func_verbose "creating $output"
 
-      dir=
-      case $file in
-      *.la)
-	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
 	else
-	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
+	  func_quote_for_eval "$var_value"
+	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
 	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+	relink_command=
+      fi
 
-	# Read the libtool library.
-	dlname=
-	library_names=
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		func_basename "$deplib"
+		name="$func_basename_result"
+		func_resolve_sysroot "$deplib"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      -L*)
+		func_stripname -L '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -L$func_replace_sysroot_result"
+		;;
+	      -R*)
+		func_stripname -R '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -R$func_replace_sysroot_result"
+		;;
+	      *) func_append newdependency_libs " $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
 
-	# If there is no directory component, then add one.
-	case $file in
-	*/* | *\\*) . $file ;;
-	*) . ./$file ;;
-	esac
+	    for lib in $dlfiles; do
+	      case $lib in
+	      *.la)
+	        func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      *) func_append newdlfiles " $lib" ;;
+	      esac
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+	      *.la)
+		# Only pass preopened files to the pseudo-archive (for
+		# eventual linking with the app. that links it) if we
+		# didn't already link the preopened objects directly into
+		# the library:
+		func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      esac
+	    done
+	    dlprefiles="$newdlprefiles"
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      func_append newdlfiles " $abs"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      func_append newdlprefiles " $abs"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $RM $output
+	  # place dlname in correct position for cygwin
+	  # In fact, it would be nice if we could use this code for all target
+	  # systems that can't hard-code library paths into their executables
+	  # and that have no shared library path variable independent of PATH,
+	  # but it turns out we can't easily determine that from inspecting
+	  # libtool variables, so we have to hard-code the OSs to which it
+	  # applies here; at the moment, that means platforms that use the PE
+	  # object format with DLL files.  See the long comment at the top of
+	  # tests/bindir.at for full details.
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+	      # If a -bindir argument was supplied, place the dll there.
+	      if test "x$bindir" != x ;
+	      then
+		func_relative_path "$install_libdir" "$bindir"
+		tdlname=$func_relative_path_result$dlname
+	      else
+		# Otherwise fall back on heuristic.
+		tdlname=../bin/$dlname
+	      fi
+	      ;;
+	  esac
+	  $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
 
-	# Skip this library if it cannot be dlopened.
-	if test -z "$dlname"; then
-	  # Warn if it was a shared library.
-	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
-	  continue
-	fi
+# The name that we can dlopen(3).
+dlname='$tdlname'
 
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$dir" = "X$file" && dir=.
+# Names of this library.
+library_names='$library_names'
 
-	if test -f "$dir/$objdir/$dlname"; then
-	  dir="$dir/$objdir"
-	else
-	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-	;;
+# The name of the static archive.
+old_library='$old_library'
 
-      *.lo)
-	# Just add the directory containing the .lo file.
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$dir" = "X$file" && dir=.
-	;;
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
 
-      *)
-	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
-	continue
-	;;
-      esac
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
 
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
 
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-	eval "$shlibpath_var=\"\$dir\""
-      else
-	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
 
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic="$magic"
+# Is this an already installed library?
+installed=$installed
 
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -*) ;;
-      *)
-	# Do a test to see if this is really a libtool program.
-	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	  # If there is no directory component, then add one.
-	  case $file in
-	  */* | *\\*) . $file ;;
-	  *) . ./$file ;;
-	  esac
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
 
-	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
-	fi
-	;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
-      args="$args \"$file\""
-    done
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
 
-    if test -z "$run"; then
-      if test -n "$shlibpath_var"; then
-	# Export the shlibpath_var.
-	eval "export $shlibpath_var"
-      fi
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes; then
+	    $ECHO >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      }
 
-      # Restore saved environment variables
-      for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-      do
-       eval "if test \"\${save_$lt_var+set}\" = set; then
-               $lt_var=\$save_$lt_var; export $lt_var
-             else
-               $lt_unset $lt_var
-             fi"
-      done
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+}
 
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+    func_mode_link ${1+"$@"}
 
-      # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
-	$echo "export $shlibpath_var"
-      fi
-      $echo "$cmd$args"
-      exit $EXIT_SUCCESS
-    fi
-    ;;
 
-  # libtool clean and uninstall mode
-  clean | uninstall)
-    modename="$modename: $mode"
-    rm="$nonopt"
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $opt_debug
+    RM="$nonopt"
     files=
     rmforce=
     exit_status=0
@@ -6494,44 +9454,41 @@ relink_command=\"$relink_command\""
     for arg
     do
       case $arg in
-      -f) rm="$rm $arg"; rmforce=yes ;;
-      -*) rm="$rm $arg" ;;
-      *) files="$files $arg" ;;
+      -f) func_append RM " $arg"; rmforce=yes ;;
+      -*) func_append RM " $arg" ;;
+      *) func_append files " $arg" ;;
       esac
     done
 
-    if test -z "$rm"; then
-      $echo "$modename: you must specify an RM program" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
 
     rmdirs=
 
-    origobjdir="$objdir"
     for file in $files; do
-      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-      if test "X$dir" = "X$file"; then
-	dir=.
-	objdir="$origobjdir"
+      func_dirname "$file" "" "."
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
+	odir="$objdir"
       else
-	objdir="$dir/$origobjdir"
+	odir="$dir/$objdir"
       fi
-      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-      test "$mode" = uninstall && objdir="$dir"
+      func_basename "$file"
+      name="$func_basename_result"
+      test "$opt_mode" = uninstall && odir="$dir"
 
-      # Remember objdir for removal later, being careful to avoid duplicates
-      if test "$mode" = clean; then
+      # Remember odir for removal later, being careful to avoid duplicates
+      if test "$opt_mode" = clean; then
 	case " $rmdirs " in
-	  *" $objdir "*) ;;
-	  *) rmdirs="$rmdirs $objdir" ;;
+	  *" $odir "*) ;;
+	  *) func_append rmdirs " $odir" ;;
 	esac
       fi
 
       # Don't error if the file doesn't exist and rm -f was used.
-      if (test -L "$file") >/dev/null 2>&1 \
-	|| (test -h "$file") >/dev/null 2>&1 \
-	|| test -f "$file"; then
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+	 { test -h "$file"; } >/dev/null 2>&1 ||
+	 test -f "$file"; then
 	:
       elif test -d "$file"; then
 	exit_status=1
@@ -6545,55 +9502,32 @@ relink_command=\"$relink_command\""
       case $name in
       *.la)
 	# Possibly a libtool archive, so verify it.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	  . $dir/$name
+	if func_lalib_p "$file"; then
+	  func_source $dir/$name
 
 	  # Delete the libtool libraries and symlinks.
 	  for n in $library_names; do
-	    rmfiles="$rmfiles $objdir/$n"
+	    func_append rmfiles " $odir/$n"
 	  done
-	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
-	  case "$mode" in
+	  case "$opt_mode" in
 	  clean)
-	    case "  $library_names " in
-	    # "  " in the beginning catches empty $dlname
+	    case " $library_names " in
 	    *" $dlname "*) ;;
-	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
+	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
 	    esac
-	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
 	    ;;
 	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
-	      cmds=$postuninstall_cmds
-	      save_ifs="$IFS"; IFS='~'
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd"
-		if test "$?" -ne 0 && test "$rmforce" != yes; then
-		  exit_status=1
-		fi
-	      done
-	      IFS="$save_ifs"
+	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
 	    fi
 
 	    if test -n "$old_library"; then
 	      # Do each command in the old_postuninstall commands.
-	      cmds=$old_postuninstall_cmds
-	      save_ifs="$IFS"; IFS='~'
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd"
-		if test "$?" -ne 0 && test "$rmforce" != yes; then
-		  exit_status=1
-		fi
-	      done
-	      IFS="$save_ifs"
+	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
 	    ;;
@@ -6603,288 +9537,95 @@ relink_command=\"$relink_command\""
 
       *.lo)
 	# Possibly a libtool object, so verify it.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	if func_lalib_p "$file"; then
 
 	  # Read the .lo file
-	  . $dir/$name
+	  func_source $dir/$name
 
 	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" \
-	     && test "$pic_object" != none; then
-	    rmfiles="$rmfiles $dir/$pic_object"
+	  if test -n "$pic_object" &&
+	     test "$pic_object" != none; then
+	    func_append rmfiles " $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" \
-	     && test "$non_pic_object" != none; then
-	    rmfiles="$rmfiles $dir/$non_pic_object"
+	  if test -n "$non_pic_object" &&
+	     test "$non_pic_object" != none; then
+	    func_append rmfiles " $dir/$non_pic_object"
 	  fi
 	fi
 	;;
 
       *)
-	if test "$mode" = clean ; then
+	if test "$opt_mode" = clean ; then
 	  noexename=$name
 	  case $file in
 	  *.exe)
-	    file=`$echo $file|${SED} 's,.exe$,,'`
-	    noexename=`$echo $name|${SED} 's,.exe$,,'`
+	    func_stripname '' '.exe' "$file"
+	    file=$func_stripname_result
+	    func_stripname '' '.exe' "$name"
+	    noexename=$func_stripname_result
 	    # $file with .exe has already been added to rmfiles,
 	    # add $file without .exe
-	    rmfiles="$rmfiles $file"
+	    func_append rmfiles " $file"
 	    ;;
 	  esac
 	  # Do a test to see if this is a libtool program.
-	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	    relink_command=
-	    . $dir/$noexename
+	  if func_ltwrapper_p "$file"; then
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      relink_command=
+	      func_source $func_ltwrapper_scriptname_result
+	      func_append rmfiles " $func_ltwrapper_scriptname_result"
+	    else
+	      relink_command=
+	      func_source $dir/$noexename
+	    fi
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
-	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
 	    if test "$fast_install" = yes && test -n "$relink_command"; then
-	      rmfiles="$rmfiles $objdir/lt-$name"
+	      func_append rmfiles " $odir/lt-$name"
 	    fi
 	    if test "X$noexename" != "X$name" ; then
-	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	      func_append rmfiles " $odir/lt-${noexename}.c"
 	    fi
 	  fi
 	fi
 	;;
       esac
-      $show "$rm $rmfiles"
-      $run $rm $rmfiles || exit_status=1
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
-    objdir="$origobjdir"
 
     # Try to remove the ${objdir}s in the directories where we deleted files
     for dir in $rmdirs; do
       if test -d "$dir"; then
-	$show "rmdir $dir"
-	$run rmdir $dir >/dev/null 2>&1
+	func_show_eval "rmdir $dir >/dev/null 2>&1"
       fi
     done
 
     exit $exit_status
-    ;;
+}
 
-  "")
-    $echo "$modename: you must specify a MODE" 1>&2
-    $echo "$generic_help" 1>&2
-    exit $EXIT_FAILURE
-    ;;
-  esac
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
 
-  if test -z "$exec_cmd"; then
-    $echo "$modename: invalid operation mode \`$mode'" 1>&2
-    $echo "$generic_help" 1>&2
-    exit $EXIT_FAILURE
-  fi
-fi # test -z "$show_help"
+test -z "$opt_mode" && {
+  help="$generic_help"
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode \`$opt_mode'"
 
 if test -n "$exec_cmd"; then
-  eval exec $exec_cmd
+  eval exec "$exec_cmd"
   exit $EXIT_FAILURE
 fi
 
-# We need to display help for each of the modes.
-case $mode in
-"") $echo \
-"Usage: $modename [OPTION]... [MODE-ARG]...
-
-Provide generalized library-building support services.
-
-    --config          show all configuration variables
-    --debug           enable verbose shell tracing
--n, --dry-run         display commands without modifying any files
-    --features        display basic configuration information and exit
-    --finish          same as \`--mode=finish'
-    --help            display this help message and exit
-    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
-    --quiet           same as \`--silent'
-    --silent          don't print informational messages
-    --tag=TAG         use configuration variables from tag TAG
-    --version         print version information
-
-MODE must be one of the following:
-
-      clean           remove files from the build directory
-      compile         compile a source file into a libtool object
-      execute         automatically set library path, then run a program
-      finish          complete the installation of libtool libraries
-      install         install libraries or executables
-      link            create a library or an executable
-      uninstall       remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
-a more detailed description of MODE.
-
-Report bugs to <bug-libtool at gnu.org>."
-  exit $EXIT_SUCCESS
-  ;;
-
-clean)
-  $echo \
-"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
-  ;;
-
-compile)
-  $echo \
-"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
-  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-  -prefer-pic       try to building PIC objects only
-  -prefer-non-pic   try to building non-PIC objects only
-  -static           always build a \`.o' file suitable for static linking
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
-  ;;
-
-execute)
-  $echo \
-"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
-  -dlopen FILE      add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-  ;;
-
-finish)
-  $echo \
-"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
-  ;;
-
-install)
-  $echo \
-"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-  ;;
-
-link)
-  $echo \
-"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -avoid-version    do not add a version suffix if possible
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
-  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-  -export-symbols SYMFILE
-                    try to export only the symbols listed in SYMFILE
-  -export-symbols-regex REGEX
-                    try to export only the symbols matching REGEX
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -module           build a library that can dlopened
-  -no-fast-install  disable the fast-install mode
-  -no-install       link a not-installable executable
-  -no-undefined     declare that a library does not refer to external symbols
-  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
-  -precious-files-regex REGEX
-                    don't remove output files matching REGEX
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -static           do not do any dynamic linking of uninstalled libtool libraries
-  -static-libtool-libs
-                    do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-                    specify library version info [each variable defaults to 0]
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename.  Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
-  ;;
-
-uninstall)
-  $echo \
-"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+exit $exit_status
 
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-  ;;
-
-*)
-  $echo "$modename: invalid operation mode \`$mode'" 1>&2
-  $echo "$help" 1>&2
-  exit $EXIT_FAILURE
-  ;;
-esac
-
-$echo
-$echo "Try \`$modename --help' for more information about other modes."
-
-exit $?
 
 # The TAGs below are defined such that we never get into a situation
 # in which we disable both kinds of libraries.  Given conflicting
@@ -6898,14 +9639,17 @@ exit $?
 # configuration.  But we'll never go from static-only to shared-only.
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-disable_libs=shared
+build_libtool_libs=no
+build_old_libs=yes
 # ### END LIBTOOL TAG CONFIG: disable-shared
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
-disable_libs=static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 # ### END LIBTOOL TAG CONFIG: disable-static
 
 # Local Variables:
 # mode:shell-script
 # sh-indentation:2
 # End:
+# vi:sw=2
+
diff --git a/admin/missing b/admin/missing
index 894e786..9a55648 100755
--- a/admin/missing
+++ b/admin/missing
@@ -1,10 +1,9 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2005-06-08.21
+scriptversion=2012-01-06.18; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
-#   Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -18,9 +17,7 @@ scriptversion=2005-06-08.21
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -28,13 +25,15 @@ scriptversion=2005-06-08.21
 # the same distribution terms that you use for the rest of that program.
 
 if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
+  echo 1>&2 "Try '$0 --help' for more information"
   exit 1
 fi
 
 run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
 
-# In the cases where this matters, `missing' is being run in the
+# In the cases where this matters, 'missing' is being run in the
 # srcdir already.
 if test -f configure.ac; then
   configure_ac=configure.ac
@@ -44,7 +43,7 @@ fi
 
 msg="missing on your system"
 
-case "$1" in
+case $1 in
 --run)
   # Try to run requested program, and just exit if it succeeds.
   run=
@@ -65,7 +64,7 @@ case "$1" in
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
 
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
 error status if there is no known handling for PROGRAM.
 
 Options:
@@ -74,17 +73,20 @@ Options:
   --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
+  aclocal      touch file 'aclocal.m4'
+  autoconf     touch file 'configure'
+  autoheader   touch file 'config.h.in'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all 'Makefile.in' files
+  bison        create 'y.tab.[ch]', if possible, from existing .[ch]
+  flex         create 'lex.yy.c', if possible, from existing .c
   help2man     touch the output file
-  lex          create \`lex.yy.c', if possible, from existing .c
+  lex          create 'lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+  yacc         create 'y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
 
 Send bug reports to <bug-automake at gnu.org>."
     exit $?
@@ -96,37 +98,35 @@ Send bug reports to <bug-automake at gnu.org>."
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
+    echo 1>&2 "$0: Unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
 esac
 
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
 # Now exit if we have it, but it failed.  Also exit now if we
 # don't have it and --version was passed (most likely to detect
-# the program).
-case "$1" in
-  lex|yacc)
+# the program).  This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+  lex*|yacc*)
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
   *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
        exit 1
     elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
        # Could not run --version or --help.  This is probably someone
-       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # running '$TOOL --version' or '$TOOL --help' to check whether
        # $TOOL exists and not knowing $TOOL uses missing.
        exit 1
     fi
@@ -135,36 +135,36 @@ esac
 
 # If it does not exist, or fails to run (possibly an outdated version),
 # try to emulate it.
-case "$1" in
+case $program in
   aclocal*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'acinclude.m4' or '${configure_ac}'.  You might want
+         to install the Automake and Perl packages.  Grab them from
          any GNU archive site."
     touch aclocal.m4
     ;;
 
-  autoconf)
+  autoconf*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`${configure_ac}'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+WARNING: '$1' is $msg.  You should only need it if
+         you modified '${configure_ac}'.  You might want to install the
+         Autoconf and GNU m4 packages.  Grab them from any GNU
          archive site."
     touch configure
     ;;
 
-  autoheader)
+  autoheader*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'acconfig.h' or '${configure_ac}'.  You might want
+         to install the Autoconf and GNU m4 packages.  Grab them
          from any GNU archive site."
     files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
     test -z "$files" && files="config.h"
     touch_files=
     for f in $files; do
-      case "$f" in
+      case $f in
       *:*) touch_files="$touch_files "`echo "$f" |
 				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
       *) touch_files="$touch_files $f.in";;
@@ -175,25 +175,25 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   automake*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
-         You might want to install the \`Automake' and \`Perl' packages.
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
+         You might want to install the Automake and Perl packages.
          Grab them from any GNU archive site."
     find . -type f -name Makefile.am -print |
 	   sed 's/\.am$/.in/' |
 	   while read f; do touch "$f"; done
     ;;
 
-  autom4te)
+  autom4te*)
     echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
+WARNING: '$1' is needed, but is $msg.
          You might have modified some files without having the
          proper tools for further handling them.
-         You can get \`$1' as part of \`Autoconf' from any GNU
+         You can get '$1' as part of Autoconf from any GNU
          archive site."
 
-    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
-    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
     if test -f "$file"; then
 	touch $file
     else
@@ -207,93 +207,97 @@ WARNING: \`$1' is needed, but is $msg.
     fi
     ;;
 
-  bison|yacc)
+  bison*|yacc*)
     echo 1>&2 "\
-WARNING: \`$1' $msg.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
+WARNING: '$1' $msg.  You should only need it if
+         you modified a '.y' file.  You may need the Bison package
          in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
+         Bison from any GNU archive site."
     rm -f y.tab.c y.tab.h
-    if [ $# -ne 1 ]; then
-        eval LASTARG="\${$#}"
-	case "$LASTARG" in
+    if test $# -ne 1; then
+        eval LASTARG=\${$#}
+	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" y.tab.c
 	    fi
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" y.tab.h
 	    fi
 	  ;;
 	esac
     fi
-    if [ ! -f y.tab.h ]; then
+    if test ! -f y.tab.h; then
 	echo >y.tab.h
     fi
-    if [ ! -f y.tab.c ]; then
+    if test ! -f y.tab.c; then
 	echo 'main() { return 0; }' >y.tab.c
     fi
     ;;
 
-  lex|flex)
+  lex*|flex*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
+WARNING: '$1' is $msg.  You should only need it if
+         you modified a '.l' file.  You may need the Flex package
          in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
+         Flex from any GNU archive site."
     rm -f lex.yy.c
-    if [ $# -ne 1 ]; then
-        eval LASTARG="\${$#}"
-	case "$LASTARG" in
+    if test $# -ne 1; then
+        eval LASTARG=\${$#}
+	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" lex.yy.c
 	    fi
 	  ;;
 	esac
     fi
-    if [ ! -f lex.yy.c ]; then
+    if test ! -f lex.yy.c; then
 	echo 'main() { return 0; }' >lex.yy.c
     fi
     ;;
 
-  help2man)
+  help2man*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
+WARNING: '$1' is $msg.  You should only need it if
 	 you modified a dependency of a manual page.  You may need the
-	 \`Help2man' package in order for those modifications to take
-	 effect.  You can get \`Help2man' from any GNU archive site."
+	 Help2man package in order for those modifications to take
+	 effect.  You can get Help2man from any GNU archive site."
 
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
-    if test -z "$file"; then
-	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
-    fi
-    if [ -f "$file" ]; then
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
 	touch $file
     else
 	test -z "$file" || exec >$file
 	echo ".ab help2man is required to generate this page"
-	exit 1
+	exit $?
     fi
     ;;
 
-  makeinfo)
+  makeinfo*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
+WARNING: '$1' is $msg.  You should only need it if
+         you modified a '.texi' or '.texinfo' file, or any other file
          indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
+         call might also be the consequence of using a buggy 'make' (AIX,
+         DU, IRIX).  You might want to install the Texinfo package or
+         the GNU make package.  Grab either from any GNU archive site."
     # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
     if test -z "$file"; then
       # ... or it is the one specified with @setfilename ...
       infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      file=`sed -n '
+	/^@setfilename/{
+	  s/.* \([^ ]*\) *$/\1/
+	  p
+	  q
+	}' $infile`
       # ... or it is derived from the source name (dir/f.texi becomes f.info)
       test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
     fi
@@ -303,49 +307,14 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch $file
     ;;
 
-  tar)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case "$firstarg" in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case "$firstarg" in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
   *)
     echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
+WARNING: '$1' is needed, and is $msg.
          You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
+         proper tools for further handling them.  Check the 'README' file,
          it often tells you about the needed prerequisites for installing
          this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
+         some other package would contain this missing '$1' program."
     exit 1
     ;;
 esac
@@ -356,5 +325,6 @@ exit 0
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/calib/cal/fors2_1453_phot.fits b/calib/cal/fors2_1453_phot.fits
index e4f3838..b7bbb91 100644
Binary files a/calib/cal/fors2_1453_phot.fits and b/calib/cal/fors2_1453_phot.fits differ
diff --git a/calib/cal/fors2_1456_phot.fits b/calib/cal/fors2_1456_phot.fits
index dabb780..a29261c 100644
Binary files a/calib/cal/fors2_1456_phot.fits and b/calib/cal/fors2_1456_phot.fits differ
diff --git a/calib/cal/fors2_stetson_2010Dec09.fits b/calib/cal/fors2_stetson_2010Dec09.fits
index 1952a63..31993d1 100644
--- a/calib/cal/fors2_stetson_2010Dec09.fits
+++ b/calib/cal/fors2_stetson_2010Dec09.fits
@@ -1,4 +1,4 @@
-SIMPLE  =                    T / file does conform to FITS standard             BITPIX  =                   16 / number of bits per data pixel                  NAXIS   =                    0 / number of data axes                            EXTEND  =                    T / FITS dataset may contain extensions            COMMENT   FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H DATE    =    [...]
6���+�F9��5tH<�C�A8j;�D�   
+SIMPLE  =                    T / file does conform to FITS standard             BITPIX  =                   16 / number of bits per data pixel                  NAXIS   =                    0 / number of data axes                            EXTEND  =                    T / FITS dataset may contain extensions            COMMENT   FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H DATE    = '2 [...]
6���+�F9��5tH<�C�A8j;�D�   
    
 A.I�<	�'   
   
��  ��          ��  ��          E1_49-V     @5=[vfaO�FR��M�<��
 ACG�;��|   2   2A:ff;k��   0   0A4��<-�   
   
A/�;
IR   
diff --git a/calib/cal/zeroupdate b/calib/cal/zeroupdate
new file mode 100755
index 0000000..bdff6e5
--- /dev/null
+++ b/calib/cal/zeroupdate
@@ -0,0 +1,111 @@
+#!/usr/bin/python
+#
+# usage: zeroupdate input output
+#
+# V1.0 Oct 23, 2011: written by Wolfram Freudling
+# V1.1 Nov 29, 2011: fixed failure in case there is no date in header of input file
+#
+# updates the FORS photometry table with current zero points from the QC
+# database.
+#
+
+from urllib2 import *
+import pyfits 
+import pwd 
+from datetime import date, datetime, timedelta
+
+
+# interpret command line parameters
+try:
+        inphottable= sys.argv[1]
+except:
+        raise SystemExit("usage: zeroupdate input_table < output_table > ")
+
+if len(sys.argv) > 2:
+        outphottable= sys.argv[2]
+else:
+        outphottable= inphottable
+
+# first open input phottable
+phottable = pyfits.open(inphottable)
+photheader= phottable[0].header
+photheader1= phottable[1].header
+photodata = phottable[1].data 
+
+# backup phottable:
+if inphottable == outphottable:
+        datestr= photheader['DATE']
+        backupphottable= inphottable.replace(".fits","")+"_"+datestr+".fits"
+        phottable.writeto(backupphottable, clobber=1)
+
+# build URL for query
+ccdid= photheader['HIERARCH ESO DET CHIP1 ID']  # this is the CCD ID in the fits header
+startdate= str(date.today()-timedelta(180)) # search for data in last 6 month
+print 'searching photometric data for CCD ', ccdid, ' taken since ', startdate, "\n"
+
+# query data base
+url= 'http://archive.eso.org/bin/qc1_cgi?action=qc1_browse_get&table=fors2_photometry&field_civil_date=civil_date&field_mjd_obs=mjd_obs&field_zeropoint=zeropoint&field_zeropoint_err=zeropoint_err&field_colour_term=colour_term&field_colour_term_err=colour_term_err&field_filter_name=filter_name&field_det_chip1_id=det_chip1_id&field_filter_name=filter_name&filter_det_chip1_id='+ccdid+'&from='+startdate+'&to=3000-12-31&output=ascii%27'
+data= urlopen(url)
+
+# rewrite photometric data as a dictionary:
+# If the database returned several rows for any filter, the zeropoints will be
+# updated several time. Since the database returns time sorted data, the last
+# update will be with the most recent zero points.
+rows= data.read().splitlines()
+column= rows[0].split("!")[1:]
+column= [tmp.strip() for tmp in column]
+newdata= {}
+for row in rows:
+        outrow= {}
+        if row[0] != "!":
+                item= row.split()
+                for i in range(len(item)):
+                        outrow[column[i]]= item[i]
+                filter= outrow['filter_name']
+                newdata[filter]= outrow
+
+# update photometric table in fits file.  We simply go row by row through the
+# output from the database query and update the phottable for each row. 
+
+
+for i in range(len(photodata.field('FILTER'))):
+        filter= photodata.field('FILTER')[i]
+        if filter == "R_SPECIAL":
+                filter = "R_SPEC"
+        zpoint= photodata.field('ZPOINT')[i]
+        zpoint_err= photodata.field('DZPOINT')[i]
+        colterm= photodata.field('COL')[i]
+        colterm_err= photodata.field('DCOL')[i]
+        try:
+                zpoint_new= newdata[filter]['zeropoint']
+                zpoint_new_err= newdata[filter]['zeropoint_err']
+                colterm_new= newdata[filter]['colour_term']
+                colterm_new_err= newdata[filter]['colour_term_err']
+                print "updating filter ", filter, ":", zpoint, " -> ", zpoint_new
+                print "                         ", zpoint_err, " -> ", zpoint_new_err
+                print "                         ", colterm, " -> ", colterm_new
+                print "                         ", colterm_err, " -> ", colterm_new_err
+                photodata.field('ZPOINT')[i]= zpoint_new
+                photodata.field('DZPOINT')[i]= zpoint_new_err
+        except:
+                print "failed to update ", filter
+
+# now let's simply write out as a new fits file:
+try:
+        now= str(datetime.now())[0:19].replace(' ','T') # update date string
+except:
+        now= "unknown date"
+
+try:
+        user=pwd.getpwuid(os.getuid()).pw_name
+except:
+        user= "unknown user"
+photheader['DATE']= now # update date string
+photheader1.add_history("File modified by "+user+" with zeroupdate on "+now)
+phottable[1].data=photodata
+phottable[0].header=photheader
+phottable[1].header=photheader1
+phottable.writeto(outphottable, clobber=1)
+
+
+
diff --git a/calib/dic/ESO-DFS-DIC.FORS2_QC b/calib/dic/ESO-DFS-DIC.FORS1_QC
similarity index 90%
copy from calib/dic/ESO-DFS-DIC.FORS2_QC
copy to calib/dic/ESO-DFS-DIC.FORS1_QC
index 67f67ac..07b6e04 100644
--- a/calib/dic/ESO-DFS-DIC.FORS2_QC
+++ b/calib/dic/ESO-DFS-DIC.FORS1_QC
@@ -1,51 +1,36 @@
 #******************************************************************************
 # E.S.O. - VLT project
 #
-# "@(#) $Id: ESO-DFS-DIC.FORS2_QC,v 1.17 2011/10/05 16:03:34 cgarcia Exp $"
+# "@(#) $Id: ESO-DFS-DIC.FORS1_QC,v 1.16 2010-04-27 12:09:46 cizzo Exp $"
 #
-# $Name: fors-4_9_23 $
-# $Revision: 1.17 $
-# $Log: ESO-DFS-DIC.FORS2_QC,v $
-# Revision 1.17  2011/10/05 16:03:34  cgarcia
-# Added keyword QC ZPOINT NSRCEXTRACT to dictionary
-#
-# Revision 1.16  2011/04/01 14:43:06  cizzo
-# Complete add QC.NANGLES
-#
-# Revision 1.15  2011/04/01 14:34:34  cizzo
-# Add QC.NANGLES
-#
-# Revision 1.14  2010/04/27 12:10:46  cizzo
-# Fix incorrect one line doc
-#
-# Revision 1.13  2010/04/26 11:41:29  cizzo
-# Add definition of standard stars related QC parameters for PMOS
-#
-# Revision 1.12  2010/02/10 16:00:11  cizzo
+# $Name: not supported by cvs2svn $
+# $Revision: 1.16 $
+# $Log: not supported by cvs2svn $
+# Revision 1.15  2010/02/10 16:00:37  cizzo
 # Add QCs for spectral efficiency monitoring
 #
-# Revision 1.11  2009/05/04 10:07:09  cizzo
+# Revision 1.14  2009/05/04 10:06:33  cizzo
 # Add new QC, QC.PMOS.CENTRAL.WAVELENGTH
 #
-# Revision 1.10  2009/03/31 10:49:22  cizzo
+# Revision 1.13  2009/03/31 10:48:47  cizzo
 # Add SKYFLAT FLUX MIN/MAX
 #
-# Revision 1.9  2009/02/01 14:26:29  cizzo
+# Revision 1.12  2009/02/01 14:25:48  cizzo
 # Add new parameters QC TRACE MAX CURVATURE and QC TRACE MAX SLOPE
 #
-# Revision 1.8  2008/08/18 14:27:45  cizzo
+# Revision 1.11  2008/08/18 14:27:08  cizzo
 # Rename QC from QC.WAVE.MEAN.ACCURACY to QC.WAVE.ACCURACY, and add new QC QC.WAVE.ACCURACY.ERROR
 #
-# Revision 1.7  2008/07/31 09:12:13  cizzo
+# Revision 1.10  2008/07/31 09:12:03  cizzo
 # Add several new QCs related to atmospheric extinction and wavelength calibration accuracy
 #
-# Revision 1.6  2008/03/14 10:30:57  cizzo
+# Revision 1.9  2008/03/14 10:30:02  cizzo
 # Add QC FLAT FPN REL
 #
-# Revision 1.5  2008/01/29 13:33:38  cizzo
+# Revision 1.8  2008/01/29 13:32:58  cizzo
 # Add QC.EXTCOEFFERR
 #
-# Revision 1.4  2007/11/19 15:09:23  jmlarsen
+# Revision 1.7  2007/11/19 15:09:23  jmlarsen
 # Added QC.MBIAS.LEVEL
 #
 # Revision 1.6  2007/11/02 12:42:56  jmlarsen
@@ -110,7 +95,7 @@
 Dictionary Name:   ESO-DFS-DIC.FORS_QC
 Scope:             QC
 Source:            ESO DFS/DMD
-Version Control:   "@(#) $Id: ESO-DFS-DIC.FORS2_QC,v 1.17 2011/10/05 16:03:34 cgarcia Exp $"
+Version Control:   "@(#) $Id: ESO-DFS-DIC.FORS1_QC,v 1.16 2010-04-27 12:09:46 cizzo Exp $"
 Revision:          1.5
 Date:              2001-02-20
 Status:            draft
@@ -333,16 +318,6 @@ Comment Field:     Number of stars used for zeropoint computation
 Description:       Number of stars used for zeropoint computation by recipe
                    fors_zeropoint.
 
-Parameter Name:    QC ZPOINT NSRCEXTRACT
-Class:             header|qc-log
-Context:           process
-Type:              int
-Value Format:      %d
-Unit:              
-Comment Field:     Number of stars detected in the zeropoint image
-Description:       Number of stars detected by sextractor in the zeropoint image
-                   by recipe fors_zeropoint.
-
 Parameter Name:    QC EXTCOEFF
 Class:             header|qc-log
 Context:           process
@@ -641,7 +616,7 @@ Parameter Name:    QC SKYFLAT FLUX MIN
 Class:             header|qc-log
 Context:           process
 Type:              double
-Value Format:      %e
+Value Format:      %e 
 Unit:              ADU
 Comment Field:     Median level of dimmest input raw sky flat (ADU)
 Description:       This quantity is computed by recipe fors_img_sky_flat_impl.
@@ -685,8 +660,8 @@ Value Format:      %.3f
 Unit:              Angstrom
 Comment Field:     Wavelength at CCD center (Angstrom)
 Description:       After the wavelength calibration is obtained from a PMOS
-                   arc lamp exposure with all slitlets at equal offset 0,
-                   the wavelength corresponding to the central CCD pixel
+                   arc lamp exposure with all slitlets at equal offset 0, 
+                   the wavelength corresponding to the central CCD pixel 
                    is calculated.
 
 Parameter Name:    QC WAVE ACCURACY
@@ -957,77 +932,5 @@ Context:           process
 Type:              double
 Value Format:      %e
 Unit:              Angstrom
-Comment Field:     Wavelength at which the efficiency was measured (Angstrom)
+Comment Field:     Wavelength at which the efficiency was measured. (Angstrom)
 Description:       Wavelength at which the efficiency was measured.
-
-Parameter Name:    QC PMOS BAND
-Class:             header|qc-log
-Context:           process
-Type:              string
-Value Format:      %s
-Unit:              
-Comment Field:     Band where polarisation was measured (U, B, V, R, I)
-Description:       Band where the linear polarisation of a standard
-                   star was measured (U, B, V, R, I)
-
-Parameter Name:    QC PMOS POLARISED
-Class:             header|qc-log
-Context:           process
-Type:              integer
-Value Format:      %d
-Unit:              
-Comment Field:     Polarisation is expected (1 = yes, 0 = no)
-Description:       The standard star is not expected to be linearly 
-                   polarised if this parameter is set to 0.
-
-Parameter Name:    QC PMOS L OFFSET
-Class:             header|qc-log
-Context:           process
-Type:              double
-Value Format:      %e
-Unit:              
-Comment Field:     Deviation from expected linear polarisation.
-Description:       If QC.PMOS.POLARISED = 1, linear polarisation
-                   relative offset (observed minus expected divided
-                   by expected); if QC.PMOS.POLARISED = 0, linear
-                   polarisation absolute offset (observed minus 
-                   expected).
-
-Parameter Name:    QC PMOS L OFFSETERR
-Class:             header|qc-log
-Context:           process
-Type:              double
-Value Format:      %e
-Unit:              
-Comment Field:     Error on QC.PMOS.L.OFFSET
-Description:       Error on QC.PMOS.L.OFFSET
-
-Parameter Name:    QC PMOS ANGLE OFFSET
-Class:             header|qc-log
-Context:           process
-Type:              double
-Value Format:      %e
-Unit:              degrees
-Comment Field:     Polarisation angle offset (degrees)
-Description:       Polarisation angle offset (observed minus expected),
-                   only written if QC.PMOS.POLARISED = 1
-
-Parameter Name:    QC PMOS ANGLE OFFSETERR
-Class:             header|qc-log
-Context:           process
-Type:              double
-Value Format:      %e
-Unit:              degrees
-Comment Field:     Error on QC.PMOS.ANGLE.OFFSET (degrees)
-Description:       Error on QC.PMOS.ANGLE.OFFSET, only written if 
-                   QC.PMOS.POLARISED = 1
-
-Parameter Name:    QC NANGLES OFFSETERR
-Class:             header|qc-log
-Context:           process
-Type:              int
-Value Format:      %e
-Unit:              
-Comment Field:     Number of exposures used for computing Stokes parameter.
-Description:       This parameter is written to the header of images
-                   containing the Q, U, V extracted Stokes parameters.
diff --git a/calib/dic/ESO-DFS-DIC.FORS2_QC b/calib/dic/ESO-DFS-DIC.FORS2_QC
index 67f67ac..d394979 100644
--- a/calib/dic/ESO-DFS-DIC.FORS2_QC
+++ b/calib/dic/ESO-DFS-DIC.FORS2_QC
@@ -1,14 +1,11 @@
 #******************************************************************************
 # E.S.O. - VLT project
 #
-# "@(#) $Id: ESO-DFS-DIC.FORS2_QC,v 1.17 2011/10/05 16:03:34 cgarcia Exp $"
+# "@(#) $Id: ESO-DFS-DIC.FORS2_QC,v 1.17 2011-10-05 16:03:34 cgarcia Exp $"
 #
-# $Name: fors-4_9_23 $
+# $Name: not supported by cvs2svn $
 # $Revision: 1.17 $
-# $Log: ESO-DFS-DIC.FORS2_QC,v $
-# Revision 1.17  2011/10/05 16:03:34  cgarcia
-# Added keyword QC ZPOINT NSRCEXTRACT to dictionary
-#
+# $Log: not supported by cvs2svn $
 # Revision 1.16  2011/04/01 14:43:06  cizzo
 # Complete add QC.NANGLES
 #
@@ -110,7 +107,7 @@
 Dictionary Name:   ESO-DFS-DIC.FORS_QC
 Scope:             QC
 Source:            ESO DFS/DMD
-Version Control:   "@(#) $Id: ESO-DFS-DIC.FORS2_QC,v 1.17 2011/10/05 16:03:34 cgarcia Exp $"
+Version Control:   "@(#) $Id: ESO-DFS-DIC.FORS2_QC,v 1.17 2011-10-05 16:03:34 cgarcia Exp $"
 Revision:          1.5
 Date:              2001-02-20
 Status:            draft
diff --git a/calib/gasgano/config/FORS1.prefs b/calib/gasgano/config/FORS1.prefs
new file mode 100644
index 0000000..31c607e
--- /dev/null
+++ b/calib/gasgano/config/FORS1.prefs
@@ -0,0 +1,66 @@
+# Gasgano Application Properties 
+# Date: Thu Oct 12 08:27:21 UTC 2006
+AUTO_DISPLAY=false
+CLASSRULE_FILE=/cal/fors1/rul/fors1.oca
+#/home/quality/gasgano/config/FORS1.rul
+COMPONENT_FONT=Dialog:14
+CUBE_TO_VIEWER=cubeview
+CUBE_VIEWER_TYPE=SHELLCOMMAND
+DATA_FILES=
+DBOBS_DISPLAY_COLUMNS=CLASSIFICATION:RA:DEC:TPL.EXPNO:TPL.NEXP
+DBOBS_DISPLAY_COLUMNS_SIZE=0:0:0:0:0
+DBOBS_INSTRUMENT=All
+DBOBS_INSTRUMENTS=ISAAC;FORS1;FORS2;UVES;VIMOS;CONICA;EFOSC;CES;SUSI;SOFI;EMMI;WFI;VINCI;MIDI
+DBOBS_PASSWORD=
+DBOBS_PERIOD=66
+DBOBS_REQUIRED=false
+DBOBS_SERVER_ID=
+DBOBS_SERVER_URL=jdbc:sybase:Tds:
+DBOBS_TABLE=
+DBOBS_USERID=
+DB_OBID_FIELD=ob_id
+DB_PID_FIELD=run_id
+DB_SERVER_URL=jdbc:sybase:Tds:wgsdbp.pl.eso.org:5000
+DB_STATUS_FIELD=status
+DB_TABLE=obrep2..obs_blocks
+DB_USER_NAME=ot
+DB_USER_PASSWORD=qcPassword
+DISPLAY_COLUMNS=CLASSIFICATION:DET.WIN1.BINX:DET.READ.CLOCK:INS.GRIS1.NAME:INS.FILT1.NAME:INS.OPTI2.NAME:INS.MOS.CHECKSUM
+DISPLAY_COLUMNS_SIZE=0:0:0:0:0:0:0
+FILE_TO_RTD=./showfile
+FILTER_FILE=filter.rul
+FITS_EXTENSIONS=fits;tfits
+FITS_TO_VIEWER=rtd
+FITS_VIEWER_TYPE=SKYCAT
+FRAME_BOUNDS=2,100,1278,811
+INSTRUMENT_GROUPING=FORS1=DET.CHIP1.ID;
+KEYWORDLIST_DIR=./kw
+LAUNCH_RTD=./startRtd
+MENU_CUSTOM1=
+MENU_CUSTOM1_LBL=Custom  Menu1
+MENU_CUSTOM2=
+MENU_CUSTOM2_LBL=Custom  Menu2
+MENU_CUSTOM3=
+MENU_CUSTOM3_LBL=Custom  Menu3
+MENU_CUSTOM4=
+MENU_CUSTOM4_LBL=Custom  Menu4
+MENU_RETRIEVE=dpclient  -renameschema ARCFILE -outpath 
+MJD_SORTING=false
+OBSTATUS_MAPPING=P:Partially defined D:Defined Q:Queued for scheduling I:Initiated S:Started p:Paused during execution A:Aborted X:Executed R:Reduced C:Complete 
+OB_STATUS_FROM_DB_REQUIRED=false
+OLAS_DAYS=0
+PRINTER_NAME=laser1
+PRINT_FONT=Monospaced:6
+PRINT_ORIENTATION=P
+RADEC_CONVERSION=true
+RB_EXTENSIONS=rb;rX;rY;rZ
+RECIPE_SET=fors_calib=/home/quality/pipelines/fors1/lib/fors1/plugins/fors1-4.9.3/fors_calib.so;fors_science=/home/quality/pipelines/fors1/lib/fors1/plugins/fors1-4.9.3/fors_science.so;fors_sumflux=/home/quality/pipelines/fors1/lib/fors1/plugins/fors1-4.9.3/fors_sumflux.so;fors_extract=/home/quality/pipelines/fors1/lib/fors1/plugins/fors1-4.9.3/fors_extract.so;fors_bias=/home/quality/pipelines/fors1/lib/fors1/plugins/fors1-4.9.3/fors_bias.so;fors_remove_bias=/home/quality/pipelines/fors1 [...]
+SCRIPTS_DIR=gas-scripts
+SHORTEN_FILES_PATH=false
+SHORT_FILENAME=true
+SHOW_EXTENSIONS=true
+TEXTFILE_EXTENSIONS=ascii
+TFITS_TO_VIEWER=tableview
+TFITS_VIEWER_TYPE=SHELLCOMMAND
+UPDATE_TIMER=2
+VERBOSE_LEVEL=0
diff --git a/calib/gasgano/config/FORS.prefs b/calib/gasgano/config/FORS2.prefs
similarity index 62%
rename from calib/gasgano/config/FORS.prefs
rename to calib/gasgano/config/FORS2.prefs
index 74d478d..d48a68b 100644
--- a/calib/gasgano/config/FORS.prefs
+++ b/calib/gasgano/config/FORS2.prefs
@@ -53,7 +53,7 @@ PRINT_FONT=Monospaced:6
 PRINT_ORIENTATION=P
 RADEC_CONVERSION=true
 RB_EXTENSIONS=rb;rX;rY;rZ
-RECIPE_SET=fors_calib=/home/quality/pipelines/fors2/lib/esopipes-plugins/fors2-4.9.22/fors_calib.so;fors_science=/home/quality/pipelines/fors2/lib/esopipes-plugins/fors2-4.9.22/fors_science.so;fors_sumflux=/home/quality/pipelines/fors2/lib/esopipes-plugins/fors2-4.9.22/fors_sumflux.so;fors_extract=/home/quality/pipelines/fors2/lib/esopipes-plugins/fors2-4.9.22/fors_extract.so;fors_bias=/home/quality/pipelines/fors2/lib/esopipes-plugins/fors2-4.9.22/fors_bias.so;fors_remove_bias=/home/qua [...]
+RECIPE_SET=fors_calib=/home/quality/pipelines/fors2/lib/esopipes-plugins/fors2-4.9.21/fors_calib.so;fors_science=/home/quality/pipelines/fors2/lib/esopipes-plugins/fors2-4.9.21/fors_science.so;fors_sumflux=/home/quality/pipelines/fors2/lib/esopipes-plugins/fors2-4.9.21/fors_sumflux.so;fors_extract=/home/quality/pipelines/fors2/lib/esopipes-plugins/fors2-4.9.21/fors_extract.so;fors_bias=/home/quality/pipelines/fors2/lib/esopipes-plugins/fors2-4.9.21/fors_bias.so;fors_remove_bias=/home/qua [...]
 SCRIPTS_DIR=gas-scripts
 SHORTEN_FILES_PATH=false
 SHORT_FILENAME=true
diff --git a/calib/gasgano/config/fors.oca b/calib/gasgano/config/fors1.oca
similarity index 86%
copy from calib/gasgano/config/fors.oca
copy to calib/gasgano/config/fors1.oca
index a25b85b..e384f59 100644
--- a/calib/gasgano/config/fors.oca
+++ b/calib/gasgano/config/fors1.oca
@@ -8,15 +8,11 @@ if DPR.CATG like "%CALIB%" and DPR.TYPE like "%DARK%" then
 }
 if DPR.CATG like "%CALIB%" and DPR.TYPE like "%BIAS%" and DPR.TYPE like "%DETCHECK%" and DPR.TECH like "%IMAGE%" then
 {
-  DO.CATG = "DETMON_LAMP_OFF";
-}
-if DPR.CATG like "%CALIB%" and DPR.TYPE like "%FLAT%" and DPR.TYPE like "%LAMP%" and DPR.TECH like "%IMAGE%" then
-{
-  DO.CATG = "SCREEN_FLAT_IMG";
+  DO.CATG = "DETECTOR_CHECK_BIAS";
 }
 if DPR.CATG like "%CALIB%" and DPR.TYPE like "%FLAT%" and DPR.TYPE like "%LAMP%" and DPR.TYPE like "%DETCHECK%" and DPR.TECH like "%IMAGE%" then
 {
-  DO.CATG = "DETMON_LAMP_ON";
+  DO.CATG = "DETECTOR_CHECK_FLAT";
 }
 if DPR.CATG like "%SCIENCE%" and DPR.TECH like "%IMAGE%" then
 {
@@ -42,6 +38,10 @@ if DPR.CATG like "%CALIB%" and DPR.TYPE like "%SKY%" and DPR.TYPE like "%FLAT%"
 {
   DO.CATG = "SKY_FLAT_IMG";
 }
+if DPR.CATG like "%CALIB%" and DPR.TYPE like "%FLAT%" and DPR.TYPE like "%LAMP%" and DPR.TECH like "%IMAGE%" and TPL.ID like "%FORS1_img_cal_scrflat%" then
+{
+  DO.CATG = "SCREEN_FLAT_IMG";
+}
 if DPR.CATG like "%CALIB%" and DPR.TYPE like "%FLAT%" and DPR.TYPE like "%LAMP%" and DPR.TECH like "%SPECTRUM%" then
 {
   DO.CATG = "SCREEN_FLAT_LSS";
@@ -130,10 +130,6 @@ if PRO.CATG like "GRISM_TABLE" then
 {
   DO.CATG = "GRISM_TABLE";
 }
-if PRO.CATG like "RETARDER_WAVEPLATE_CHROMATISM" then
-{
-  DO.CATG = "RETARDER_WAVEPLATE_CHROMATISM";
-}
 if PRO.CATG like "MASTER_DISTORTION_TABLE" then
 {
   DO.CATG = "MASTER_DISTORTION_TABLE";
@@ -238,14 +234,6 @@ if PRO.CATG like "PHOTOMETRY_TABLE" then
 {
   DO.CATG = "PHOTOMETRY_TABLE";
 }
-if PRO.CATG like "STD_FLUX_TABLE" then
-{
-  DO.CATG = "STD_FLUX_TABLE";
-}
-if PRO.CATG like "STD_PMOS_TABLE" then
-{
-  DO.CATG = "STD_PMOS_TABLE";
-}
 if PRO.CATG like "PHOT_BACKGROUND_IMG" then
 {
   DO.CATG = "PHOT_BACKGROUND_IMG";
@@ -285,8 +273,6 @@ select execute(FORS_IMG_SCREEN_FLAT) from inputFiles where SIG.TEMPLATE == 1 and
 select execute(FORS_ZEROPOINT) from inputFiles where SIG.FRAME == 1 and DO.CATG == "STANDARD_IMG";
 select execute(FORS_IMG_SKY_FLAT) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "SKY_FLAT_IMG";
 select execute(FORS_IMG_SCIENCE) from inputFiles where SIG.FRAME == 1 and DO.CATG == "SCIENCE_IMG";
-select execute(FORS_PMOS_EXTRACT) from inputFiles where SIG.FRAME == 1 and DO.CATG == "STANDARD_PMOS";
-select execute(FORS_PMOS_EXTRACT) from inputFiles where SIG.FRAME == 1 and DO.CATG == "SCIENCE_PMOS";
 select execute(FORS_EXTRACT) from inputFiles where SIG.FRAME == 1 and DO.CATG == "STANDARD_MOS";
 select execute(FORS_EXTRACT) from inputFiles where SIG.FRAME == 1 and DO.CATG == "STANDARD_MXU";
 select execute(FORS_EXTRACT) from inputFiles where SIG.FRAME == 1 and DO.CATG == "STANDARD_LSS";
@@ -301,18 +287,14 @@ select execute(FORS_CALIB) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CAT
 select execute(FORS_CALIB) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "SCREEN_FLAT_MOS";
 select execute(FORS_CALIB) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "SCREEN_FLAT_MXU";
 select execute(FORS_CALIB) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "SCREEN_FLAT_LSS";
-select execute(DETMON_OPT_LG) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "DETMON_LAMP_ON";
-select execute(DETMON_OPT_LG) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "DETMON_LAMP_OFF";
+//select execute(FORS_DETLIN) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "DETECTOR_CHECK_FLAT";
+//select execute(FORS_DETLIN) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "DETECTOR_CHECK_BIAS";
 select execute(FORS_PMOS_CALIB) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "LAMP_PMOS";
 select execute(FORS_PMOS_CALIB) from inputFiles where SIG.TEMPLATE == 1 and LF.DO.CATG == "SCREEN_FLAT_PMOS";
 
-action DETMON_OPT_LG
+action FORS_DETLIN
 {
-  recipe detmon_opt_lg
-  {
-    "--tolerance=0.1" ;
-    "--pix2pix=TRUE" ;
-  }
+recipe none;
 }
 
 action FORS_BIAS
@@ -400,10 +382,10 @@ select file as MASTER_BIAS from calibFiles where DO.CATG == "MASTER_BIAS"
    and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.DET.READ.CLOCK==DET.READ.CLOCK;
 minRet = 1; maxRet = 1;
 select file as MASTER_LINECAT from calibFiles where DO.CATG == "MASTER_LINECAT"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME;
+   and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME;
 minRet = 1; maxRet = 1;
 select file as GRISM_TABLE from calibFiles where DO.CATG == "GRISM_TABLE"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME;
+   and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME and inputFile.DET.CHIP1.NAME==DET.CHIP1.NAME;
 recipe fors_calib;
 }
 
@@ -414,12 +396,12 @@ select file as MASTER_BIAS from calibFiles where DO.CATG == "MASTER_BIAS"
    and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.DET.READ.CLOCK==DET.READ.CLOCK;
 minRet = 1; maxRet = 1;
 select file as MASTER_LINECAT from calibFiles where DO.CATG == "MASTER_LINECAT"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME;
+   and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME;
 minRet = 1; maxRet = 1;
 select file as GRISM_TABLE from calibFiles where DO.CATG == "GRISM_TABLE"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME;
+   and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME and inputFile.DET.CHIP1.NAME==DET.CHIP1.NAME;
 select file as MASTER_DISTORTION_TABLE from calibFiles where DO.CATG == "MASTER_DISTORTION_TABLE"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.DET.CHIP1.ID==DET.CHIP1.ID;
+   and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.DET.CHIP1.ID==DET.CHIP1.ID;
 recipe fors_pmos_calib;
 }
 
@@ -430,43 +412,43 @@ select file as MASTER_BIAS from calibFiles where DO.CATG == "MASTER_BIAS"
    and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.DET.READ.CLOCK==DET.READ.CLOCK;
 minRet = 0; maxRet = 1;
 select file as MASTER_SKYLINECAT from calibFiles where DO.CATG == "MASTER_SKYLINECAT"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID;
+   and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME;
 minRet = 0; maxRet = 1;
 select file as MASTER_NORM_FLAT_MXU from calibFiles where DO.CATG == "MASTER_NORM_FLAT_MXU"
    and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.INS.MASK.ID==INS.MASK.ID and inputFile.DET.READ.CLOCK==DET.READ.CLOCK and ((inputFile.INS.FILT1.NAME is undefined and INS.FILT1.NAME is undefined)
-or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.ID==INS.GRIS1.ID;
+or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME;
 minRet = 0; maxRet = 1;
 select file as MASTER_NORM_FLAT_MOS from calibFiles where DO.CATG == "MASTER_NORM_FLAT_MOS"
    and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.INS.MOS.CHECKSUM==INS.MOS.CHECKSUM and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.DET.READ.CLOCK==DET.READ.CLOCK and ((inputFile.INS.FILT1.NAME is undefined and INS.FILT1.NAME is undefined)
-or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.ID==INS.GRIS1.ID;
+or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME;
 minRet = 0; maxRet = 1;
 select file as MASTER_NORM_FLAT_LSS from calibFiles where DO.CATG == "MASTER_NORM_FLAT_LSS"
    and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.INS.SLIT.NAME==INS.SLIT.NAME and inputFile.DET.READ.CLOCK==DET.READ.CLOCK and ((inputFile.INS.FILT1.NAME is undefined and INS.FILT1.NAME is undefined)
-or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.ID==INS.GRIS1.ID;
+or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME;
 minRet = 0; maxRet = 1;
 select file as DISP_COEFF_MXU from calibFiles where DO.CATG == "DISP_COEFF_MXU"
-   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.MASK.ID==INS.MASK.ID and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.COLL.NAME==INS.COLL.NAME;
+   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.MASK.ID==INS.MASK.ID and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.INS.COLL.NAME==INS.COLL.NAME;
 minRet = 0; maxRet = 1;
 select file as DISP_COEFF_MOS from calibFiles where DO.CATG == "DISP_COEFF_MOS"
-   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.INS.MOS.CHECKSUM==INS.MOS.CHECKSUM and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.DET.WIN1.BINX==DET.WIN1.BINX;
+   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.INS.MOS.CHECKSUM==INS.MOS.CHECKSUM and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.DET.WIN1.BINX==DET.WIN1.BINX;
 minRet = 0; maxRet = 1;
 select file as DISP_COEFF_LSS from calibFiles where DO.CATG == "DISP_COEFF_LSS"
-   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.SLIT.NAME==INS.SLIT.NAME and inputFile.INS.COLL.NAME==INS.COLL.NAME;
+   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.INS.SLIT.NAME==INS.SLIT.NAME and inputFile.INS.COLL.NAME==INS.COLL.NAME;
 minRet = 0; maxRet = 1;
 select file as CURV_COEFF_MXU from calibFiles where DO.CATG == "CURV_COEFF_MXU"
-   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.MASK.ID==INS.MASK.ID and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.COLL.NAME==INS.COLL.NAME;
+   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.MASK.ID==INS.MASK.ID and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.INS.COLL.NAME==INS.COLL.NAME;
 minRet = 0; maxRet = 1;
 select file as CURV_COEFF_MOS from calibFiles where DO.CATG == "CURV_COEFF_MOS"
-   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.INS.MOS.CHECKSUM==INS.MOS.CHECKSUM and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.DET.WIN1.BINX==DET.WIN1.BINX;
+   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.INS.MOS.CHECKSUM==INS.MOS.CHECKSUM and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.DET.WIN1.BINX==DET.WIN1.BINX;
 minRet = 0; maxRet = 1;
 select file as SLIT_LOCATION_MXU from calibFiles where DO.CATG == "SLIT_LOCATION_MXU"
-   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.MASK.ID==INS.MASK.ID and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.COLL.NAME==INS.COLL.NAME;
+   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.MASK.ID==INS.MASK.ID and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.INS.COLL.NAME==INS.COLL.NAME;
 minRet = 0; maxRet = 1;
 select file as SLIT_LOCATION_MOS from calibFiles where DO.CATG == "SLIT_LOCATION_MOS"
-   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.INS.MOS.CHECKSUM==INS.MOS.CHECKSUM and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.DET.WIN1.BINX==DET.WIN1.BINX;
+   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.INS.MOS.CHECKSUM==INS.MOS.CHECKSUM and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.DET.WIN1.BINX==DET.WIN1.BINX;
 minRet = 1; maxRet = 1;
 select file as GRISM_TABLE from calibFiles where DO.CATG == "GRISM_TABLE"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME;
+   and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME and inputFile.DET.CHIP1.NAME==DET.CHIP1.NAME;
 recipe fors_science;
 }
 
@@ -477,43 +459,24 @@ select file as MASTER_BIAS from calibFiles where DO.CATG == "MASTER_BIAS"
    and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.DET.READ.CLOCK==DET.READ.CLOCK;
 minRet = 0; maxRet = 1;
 select file as MASTER_SKYLINECAT from calibFiles where DO.CATG == "MASTER_SKYLINECAT"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID;
+   and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME;
 minRet = 0; maxRet = 1;
 select file as MASTER_NORM_FLAT_MXU from calibFiles where DO.CATG == "MASTER_NORM_FLAT_MXU"
    and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.INS.MASK.ID==INS.MASK.ID and inputFile.DET.READ.CLOCK==DET.READ.CLOCK and ((inputFile.INS.FILT1.NAME is undefined and INS.FILT1.NAME is undefined)
-or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.ID==INS.GRIS1.ID;
+or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME;
 minRet = 0; maxRet = 1;
 select file as MASTER_NORM_FLAT_MOS from calibFiles where DO.CATG == "MASTER_NORM_FLAT_MOS"
    and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.INS.MOS.CHECKSUM==INS.MOS.CHECKSUM and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.DET.READ.CLOCK==DET.READ.CLOCK and ((inputFile.INS.FILT1.NAME is undefined and INS.FILT1.NAME is undefined)
-or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.ID==INS.GRIS1.ID;
+or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME;
 minRet = 0; maxRet = 1;
 select file as MASTER_NORM_FLAT_LSS from calibFiles where DO.CATG == "MASTER_NORM_FLAT_LSS"
    and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.INS.COLL.NAME==INS.COLL.NAME and inputFile.INS.SLIT.NAME==INS.SLIT.NAME and inputFile.DET.READ.CLOCK==DET.READ.CLOCK and ((inputFile.INS.FILT1.NAME is undefined and INS.FILT1.NAME is undefined)
-or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.ID==INS.GRIS1.ID;
+or (inputFile.INS.FILT1.NAME==INS.FILT1.NAME)) and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME;
 minRet = 1; maxRet = 1;
 select file as MASTER_DISTORTION_TABLE from calibFiles where DO.CATG == "MASTER_DISTORTION_TABLE"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.DET.CHIP1.ID==DET.CHIP1.ID;
+   and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.DET.CHIP1.ID==DET.CHIP1.ID;
 minRet = 1; maxRet = 1;
 select file as GRISM_TABLE from calibFiles where DO.CATG == "GRISM_TABLE"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME;
+   and inputFile.INS.GRIS1.NAME==INS.GRIS1.NAME and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME and inputFile.DET.CHIP1.NAME==DET.CHIP1.NAME;
 recipe fors_extract;
 }
-
-action FORS_PMOS_EXTRACT
-{
-minRet = 1; maxRet = 1;
-select file as MASTER_BIAS from calibFiles where DO.CATG == "MASTER_BIAS"
-   and inputFile.DET.WIN1.NX==DET.WIN1.NX and inputFile.DET.WIN1.STRY==DET.WIN1.STRY and inputFile.DET.WIN1.STRX==DET.WIN1.STRX and inputFile.DET.CHIP1.ID==DET.CHIP1.ID and inputFile.DET.WIN1.NY==DET.WIN1.NY and inputFile.DET.OUTPUTS==DET.OUTPUTS and inputFile.DET.WIN1.BINY==DET.WIN1.BINY and inputFile.DET.WIN1.BINX==DET.WIN1.BINX and inputFile.DET.READ.CLOCK==DET.READ.CLOCK;
-minRet = 0; maxRet = 1;
-select file as MASTER_SKYLINECAT from calibFiles where DO.CATG == "MASTER_SKYLINECAT"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID;
-minRet = 1; maxRet = 1;
-select file as MASTER_DISTORTION_TABLE from calibFiles where DO.CATG == "MASTER_DISTORTION_TABLE"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.DET.CHIP1.ID==DET.CHIP1.ID;
-minRet = 1; maxRet = 1;
-select file as GRISM_TABLE from calibFiles where DO.CATG == "GRISM_TABLE"
-   and inputFile.INS.GRIS1.ID==INS.GRIS1.ID and inputFile.INS.OPTI7.NAME==INS.OPTI7.NAME;
-minRet = 1; maxRet = 1;
-select file as RETARDER_WAVEPLATE_CHROMATISM from calibFiles where DO.CATG == "RETARDER_WAVEPLATE_CHROMATISM";
-recipe fors_pmos_extract;
-}
diff --git a/calib/gasgano/config/fors.oca b/calib/gasgano/config/fors2.oca
similarity index 100%
rename from calib/gasgano/config/fors.oca
rename to calib/gasgano/config/fors2.oca
diff --git a/config.h.in b/config.h.in
index d92aa3f..5f7149e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -51,6 +51,9 @@
 /* Define to 1 if you have the `isnan' function. */
 #undef HAVE_ISNAN
 
+/* 1 if GSL present */
+#undef HAVE_LIBGSL
+
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
@@ -90,16 +93,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-
-/*
- * The maximum length, in bytes of an input line. It is set to the
- * POSIX2 value.
- */
-
-#ifndef LINE_LENGTH_MAX
-#  define LINE_LENGTH_MAX  2048
-#endif
-            
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
 
 /* Define to 1 if your C compiler doesn't accept -c and -o together. */
 #undef NO_MINUS_C_MINUS_O
@@ -122,20 +118,12 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-
-/*
- * Define the maximum number of characters a filename including the
- * path may have, excluding the string terminator.
- */
-
-#ifndef PATHNAME_MAX
-#  define PATHNAME_MAX  4096
-#endif
-            
-
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
@@ -154,7 +142,7 @@
 #undef inline
 #endif
 
-/* Define to `unsigned' if <sys/types.h> does not define. */
+/* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
 
 
diff --git a/configure b/configure
index 23469bd..c1ad122 100755
--- a/configure
+++ b/configure
@@ -1,83 +1,470 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for FORS Instrument Pipeline 4.9.23.
+# Generated by GNU Autoconf 2.69 for FORS Instrument Pipeline 4.11.12.
 #
 # Report bugs to <usd-help at eso.org>.
 #
-# Copyright (C) 2003 Free Software Foundation, Inc.
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
   else
-    $as_unset $as_var
+    $as_echo "$0: Please tell bug-autoconf at gnu.org and usd-help at eso.org
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
   fi
-done
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
 
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
 fi
 
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
-# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
-# PATH needs CR, and LINENO needs CR and PATH.
 # Avoid depending upon Character Ranges.
 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -85,146 +472,91 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
 
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
 else
-  as_expr=false
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
 fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
     as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
   fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -232,246 +564,315 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 # Sed expression to map a string onto a valid variable name.
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-
-# Check that we are running under the correct shell.
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-case X$ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
-  ;;
-esac
-
-echo=${ECHO-echo}
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "$0" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
-       echo_test_string=`eval $cmd` &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
-
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
-    IFS="$lt_save_ifs"
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-	 test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-	 test "X$echo_testing_string" = "X$echo_test_string"; then
-	# Cool, printf works
-	:
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	export CONFIG_SHELL
-	SHELL="$CONFIG_SHELL"
-	export SHELL
-	echo="$CONFIG_SHELL $0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	echo="$CONFIG_SHELL $0 --fallback-echo"
-      else
-	# maybe with a smaller string...
-	prev=:
-
-	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
-	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-	  then
-	    break
-	  fi
-	  prev="$cmd"
-	done
-
-	if test "$prev" != 'sed 50q "$0"'; then
-	  echo_test_string=`eval $prev`
-	  export echo_test_string
-	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
-	else
-	  # Oops.  We lost completely, so just stick with echo.
-	  echo=echo
-	fi
-      fi
-    fi
-  fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
-fi
-
-
-
 
-tagnames=${tagnames+${tagnames},}CXX
-
-tagnames=${tagnames+${tagnames},}F77
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
 
 # Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
-exec 6>&1
-
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_clean_files=
 ac_config_libobj_dir=.
+LIBOBJS=
 cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
 
 # Identity of this package.
 PACKAGE_NAME='FORS Instrument Pipeline'
 PACKAGE_TARNAME='fors'
-PACKAGE_VERSION='4.9.23'
-PACKAGE_STRING='FORS Instrument Pipeline 4.9.23'
+PACKAGE_VERSION='4.11.12'
+PACKAGE_STRING='FORS Instrument Pipeline 4.11.12'
 PACKAGE_BUGREPORT='usd-help at eso.org'
+PACKAGE_URL=''
 
 ac_unique_file="Makefile.am"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
 # include <stdlib.h>
 # include <stddef.h>
 #else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
 #  include <stdlib.h>
 # endif
 #endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
 #  include <memory.h>
 # endif
 # include <string.h>
 #endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
 # include <strings.h>
 #endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
 #endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif"
 
-ac_subdirs_all="$ac_subdirs_all sextractor"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INS [...]
+enable_option_checking=no
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+subdirs
+ONLINE_MODE_FALSE
+ONLINE_MODE_TRUE
+all_ldflags
+all_includes
+LIBMOSCA
+MOSCA_INCLUDES
+LIBIRPLIB
+IRPLIB_INCLUDES
+LIBFORS
+FORS_LDFLAGS
+FORS_INCLUDES
+wkfcopydir
+wkfextradir
+configdir
+pipedocsdir
+privatelibdir
+plugindir
+PURIFY_FALSE
+PURIFY_TRUE
+PURIFY_CMD
+GSL_LIBS
+GSL_CFLAGS
+PKG_CONFIG_LIBDIR
+PKG_CONFIG
+PKG_CONFIG_PATH
+CPL_LDFLAGS
+CPL_INCLUDES
+LIBCPLDFS
+LIBCPLUI
+LIBCPLDRS
+LIBCPLCORE
+LIBCEXT
+CX_LDFLAGS
+CX_INCLUDES
+LIBCFITSIO
+CFITSIO_LDFLAGS
+CFITSIO_INCLUDES
+LIBPTHREAD
+PTHREAD_CFLAGS
+LIBTOOL_DEPS
+CXXCPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+SED
+LIBTOOL
+LATEX
+DOXYGEN
+EGREP
+GREP
+ESO_DEBUG_FLAGS
+LN_S
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+LT_AGE
+LT_REVISION
+LT_CURRENT
+FORS_BINARY_AGE
+FORS_BINARY_VERSION
+FORS_INTERFACE_AGE
+FORS_MICRO_VERSION
+FORS_MINOR_VERSION
+FORS_MAJOR_VERSION
+FORS_VERSION
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_debug
+enable_strict
+enable_static
+enable_shared
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+with_cfitsio
+with_cfitsio_includes
+with_cfitsio_libs
+enable_cfitsio_test
+with_cpl
+with_cpl_includes
+with_cpl_libs
+enable_cpl_test
+with_cext
+with_cext_includes
+with_cext_libs
+enable_cext_test
+with_gsl
+enable_purify
+with_extra_includes
+with_extra_libs
+enable_online
+with_dmalloc
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+DOXYGEN
+LATEX
+CXXCPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+GSL_CFLAGS
+GSL_LIBS'
+ac_subdirs_all='sextractor'
 
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 cache_file=/dev/null
@@ -494,34 +895,49 @@ x_libraries=NONE
 # and all the variables that are supposed to be based on exec_prefix
 # by default will actually change.
 # Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
 
 ac_prev=
+ac_dashdash=
 for ac_option
 do
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
+    eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_option in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -543,33 +959,59 @@ do
   --config-cache | -C)
     cache_file=config.cache ;;
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+  -datadir | --datadir | --datadi | --datad)
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
     datadir=$ac_optarg ;;
 
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
   -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
     esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
+    eval enable_$ac_useropt=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -596,6 +1038,12 @@ do
   -host=* | --host=* | --hos=* | --ho=*)
     host_alias=$ac_optarg ;;
 
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
@@ -620,13 +1068,16 @@ do
   | --libexe=* | --libex=* | --libe=*)
     libexecdir=$ac_optarg ;;
 
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
   -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
+  | --localstate | --localstat | --localsta | --localst | --locals)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
     localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -691,6 +1142,16 @@ do
   | --progr-tra=* | --program-tr=* | --program-t=*)
     program_transform_name=$ac_optarg ;;
 
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
@@ -741,26 +1202,36 @@ do
     ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
     esac
-    eval "with_$ac_package='$ac_optarg'" ;;
+    eval with_$ac_useropt=\$ac_optarg ;;
 
   -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -780,27 +1251,26 @@ do
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -808,31 +1278,36 @@ done
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
-done
+fi
 
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-	      localstatedir libdir includedir oldincludedir infodir mandir
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
 do
-  eval ac_val=$`echo $ac_var`
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
   case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -846,8 +1321,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -859,102 +1332,72 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
 test "$silent" = yes && exec 6>/dev/null
 
 
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$0" : 'X\(//\)[^/]' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
-   { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
-  fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
-   { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-ac_env_CXX_set=${CXX+set}
-ac_env_CXX_value=$CXX
-ac_cv_env_CXX_set=${CXX+set}
-ac_cv_env_CXX_value=$CXX
-ac_env_CXXFLAGS_set=${CXXFLAGS+set}
-ac_env_CXXFLAGS_value=$CXXFLAGS
-ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
-ac_cv_env_CXXFLAGS_value=$CXXFLAGS
-ac_env_DOXYGEN_set=${DOXYGEN+set}
-ac_env_DOXYGEN_value=$DOXYGEN
-ac_cv_env_DOXYGEN_set=${DOXYGEN+set}
-ac_cv_env_DOXYGEN_value=$DOXYGEN
-ac_env_LATEX_set=${LATEX+set}
-ac_env_LATEX_value=$LATEX
-ac_cv_env_LATEX_set=${LATEX+set}
-ac_cv_env_LATEX_value=$LATEX
-ac_env_CXXCPP_set=${CXXCPP+set}
-ac_env_CXXCPP_value=$CXXCPP
-ac_cv_env_CXXCPP_set=${CXXCPP+set}
-ac_cv_env_CXXCPP_value=$CXXCPP
-ac_env_F77_set=${F77+set}
-ac_env_F77_value=$F77
-ac_cv_env_F77_set=${F77+set}
-ac_cv_env_F77_value=$F77
-ac_env_FFLAGS_set=${FFLAGS+set}
-ac_env_FFLAGS_value=$FFLAGS
-ac_cv_env_FFLAGS_set=${FFLAGS+set}
-ac_cv_env_FFLAGS_value=$FFLAGS
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
 
 #
 # Report the --help message.
@@ -963,7 +1406,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures FORS Instrument Pipeline 4.9.23 to adapt to many kinds of systems.
+\`configure' configures FORS Instrument Pipeline 4.11.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -977,20 +1420,17 @@ Configuration:
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-_ACEOF
-
-  cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-			  [$ac_default_prefix]
+                          [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-			  [PREFIX]
+                          [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -1000,18 +1440,25 @@ for instance \`--prefix=\$HOME'.
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/fors]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -1030,24 +1477,26 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of FORS Instrument Pipeline 4.9.23:";;
+     short | recursive ) echo "Configuration of FORS Instrument Pipeline 4.11.12:";;
    esac
   cat <<\_ACEOF
 
 Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-maintainer-mode  enable make rules and dependencies not useful
-			  (and sometimes confusing) to the casual installer
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
-  --enable-debug          creates debugging code [default=no]
+  --enable-maintainer-mode
+                          enable make rules and dependencies not useful (and
+                          sometimes confusing) to the casual installer
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
+  --enable-debug          creates debugging code [[default=no]]
   --enable-strict         compiles with strict compiler options (may not
-                          work!) [default=no]
-  --enable-static[=PKGS]
-                          build static libraries [default=no]
-  --enable-shared[=PKGS]
-                          build shared libraries [default=yes]
+                          work!) [[default=no]]
+  --enable-static[=PKGS]  build static libraries [default=no]
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
@@ -1055,16 +1504,16 @@ Optional Features:
   --disable-cpl-test      disables checks for the CPL library and headers
   --disable-cext-test     disables checks for the libcext library and headers
   --disable-purify        disalbes the check for the PURIFY installation
-  --enable-online         enable online support for PSO [default=no]
+  --enable-online         enable online support for PSO [[default=no]]
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-pic              try to use only PIC/non-PIC objects [default=use
+  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
-  --with-tags[=TAGS]
-                          include additional configurations [automatic]
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-sysroot=DIR Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).
   --with-cfitsio          location where cfitsio is installed
   --with-cfitsio-includes location of the cfitsio header files
   --with-cfitsio-libs     location of the cfitsio library
@@ -1074,147 +1523,697 @@ Optional Packages:
   --with-cext             location where libcext is installed
   --with-cext-includes    location of the libcext header files
   --with-cext-libs        location of the libcext library
+  --with-gsl              location where gsl is installed
   --with-extra-includes=DIR
                           adds non standard include paths
   --with-extra-libs=DIR   adds non standard library paths
-  --with-dmalloc          use dmalloc, as in
-			  http://www.dmalloc.com/dmalloc.tar.gz
+  --with-dmalloc          use dmalloc, as in http://www.dmalloc.com
 
 Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-              headers in a nonstandard directory <include dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   DOXYGEN     doxygen command
   LATEX       latex command
   CXXCPP      C++ preprocessor
-  F77         Fortran 77 compiler command
-  FFLAGS      Fortran 77 compiler flags
+  PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
+  GSL_CFLAGS  C compiler flags for GSL, overriding pkg-config
+  GSL_LIBS    linker flags for GSL, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <usd-help at eso.org>.
 _ACEOF
+ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
     ac_builddir=.
 
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-	   test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
     else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd $ac_popdir
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
   done
 fi
 
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-FORS Instrument Pipeline configure 4.9.23
-generated by GNU Autoconf 2.59
+FORS Instrument Pipeline configure 4.11.12
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
-  exit 0
+  exit
 fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ------------------------------- ##
+## Report this to usd-help at eso.org ##
+## ------------------------------- ##"
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by FORS Instrument Pipeline $as_me 4.9.23, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+It was created by FORS Instrument Pipeline $as_me 4.11.12, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
+exec 5>>config.log
 {
 cat <<_ASUNAME
 ## --------- ##
@@ -1233,7 +2232,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown`
 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
@@ -1245,8 +2244,9 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
-done
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
 
 } >&5
 
@@ -1268,7 +2268,6 @@ _ACEOF
 ac_configure_args=
 ac_configure_args0=
 ac_configure_args1=
-ac_sep=
 ac_must_keep_next=false
 for ac_pass in 1 2
 do
@@ -1279,13 +2278,13 @@ do
     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
     2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      as_fn_append ac_configure_args1 " '$ac_arg'"
       if test $ac_must_keep_next = true; then
 	ac_must_keep_next=false # Got value, back to normal.
       else
@@ -1301,104 +2300,115 @@ do
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
+      as_fn_append ac_configure_args " '$ac_arg'"
       ;;
     esac
   done
 done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
   (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       sed -n \
-	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
     *)
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-}
+    esac |
+    sort
+)
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
-	eval ac_val=$`echo $ac_var`
-	echo "$ac_var='"'"'$ac_val'"'"'"
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
-      sed "/^$/d" confdefs.h | sort
+      cat confdefs.h
       echo
     fi
     test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
-     ' 0
+' 0
 for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
 
 # Predefined preprocessor variables.
 
@@ -1406,112 +2416,137 @@ cat >>confdefs.h <<_ACEOF
 #define PACKAGE_NAME "$PACKAGE_NAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
 
 # Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
 fi
-for ac_site_file in $CONFIG_SITE; do
-  if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
 if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
     esac
   fi
 else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-	ac_cache_corrupted=:
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
     esac
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -1523,131 +2558,138 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 ac_aux_dir=
-for ac_dir in admin $srcdir/admin; do
-  if test -f $ac_dir/install-sh; then
+for ac_dir in admin "$srcdir"/admin; do
+  if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
     break
-  elif test -f $ac_dir/install.sh; then
+  elif test -f "$ac_dir/install.sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
-  elif test -f $ac_dir/shtool; then
+  elif test -f "$ac_dir/shtool"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/shtool install -c"
     break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in admin $srcdir/admin" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in admin $srcdir/admin" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in admin \"$srcdir\"/admin" "$LINENO" 5
 fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
 
 
 # Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
-   { (exit 1); exit 1; }; }
-
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
-if test "${ac_cv_build+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
-  ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
-  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
-   { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
 build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
-if test "${ac_cv_host+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
-  ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
 host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6
-if test "${ac_cv_target+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if ${ac_cv_target+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
 else
-  ac_cv_target_alias=$target_alias
-test "x$ac_cv_target_alias" = "x" &&
-  ac_cv_target_alias=$ac_cv_host_alias
-ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
+esac
 target=$ac_cv_target
-target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
 
 
 # The aliases save the names the user supplied, while $host etc.
@@ -1657,7 +2699,8 @@ test -n "$target_alias" &&
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
-am__api_version="1.9"
+am__api_version='1.12'
+
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
@@ -1671,22 +2714,23 @@ am__api_version="1.9"
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -1694,7 +2738,7 @@ case $as_dir/ in
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -1704,30 +2748,43 @@ case $as_dir/ in
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
 	  else
-	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	    break 3
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
 	  fi
 	fi
       done
     done
     ;;
 esac
-done
 
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
     INSTALL=$ac_cv_path_install
   else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
+    # removed, or if the value is a relative name.
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -1737,118 +2794,262 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" >&2;}
-   { (exit 1); exit 1; }; }
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+	&& test "$*" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$2" = conftest.file
    )
 then
    # Ok.
    :
 else
-   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
-   { (exit 1); exit 1; }; }
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
-  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
 test "$program_suffix" != NONE &&
-  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
-# Double any \ or $.  echo might interpret backslashes.
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
 # By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
 
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However this is wrong
-  # for two reasons:
-  #  1. if the package is installed by a user who cannot write `.'
-  #     make install will fail,
-  #  2. the above comment should most certainly read
-  #     $(mkdir_p) $(DESTDIR)$(somedir)
-  #     so it does not work when $(somedir) is undefined and
-  #     $(DESTDIR) is not.
-  #  To support the latter case, we have to write
-  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
-  #  so the `.' trick is pointless.
-  mkdir_p='mkdir -p --'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
   done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
   else
-    mkdir_p='$(install_sh) -d'
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
   fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
 
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
@@ -1858,55 +3059,59 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   test -n "$AWK" && break
 done
 
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
 all:
-	@echo 'ac_maketemp="$(MAKE)"'
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
 rm -f conftest.make
 fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
   SET_MAKE=
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
@@ -1919,12 +3124,14 @@ else
 fi
 rmdir .tst 2>/dev/null
 
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
-   { (exit 1); exit 1; }; }
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
 fi
 
 # test whether we have cygpath
@@ -1939,7 +3146,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='fors'
- VERSION='4.9.23'
+ VERSION='4.11.12'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -1967,125 +3174,40 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  STRIP=$ac_ct_STRIP
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
 
-AMTAR=${AMTAR-"${am_missing_run}tar"}
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 
 
 
+ac_config_headers="$ac_config_headers config.h"
 
-          ac_config_headers="$ac_config_headers config.h"
 
 
-echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
-echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
-    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then
-  enableval="$enable_maintainer_mode"
-  USE_MAINTAINER_MODE=$enableval
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
 else
   USE_MAINTAINER_MODE=no
-fi;
-  echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
-echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
-
+fi
 
-if test $USE_MAINTAINER_MODE = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
   MAINTAINER_MODE_TRUE=
   MAINTAINER_MODE_FALSE='#'
 else
@@ -2217,60 +3339,59 @@ _ACEOF
 # Checks for programs.
 DEPDIR="${am__leading_dot}deps"
 
-          ac_config_commands="$ac_config_commands depfiles"
+ac_config_commands="$ac_config_commands depfiles"
 
 
 am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 
 
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
 rm -f confinc confmf
 
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
-  enableval="$enable_dependency_tracking"
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
 
-fi;
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
+ if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
   AMDEP_FALSE='#'
 else
@@ -2279,7 +3400,6 @@ else
 fi
 
 
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2288,10 +3408,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2301,35 +3421,37 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2339,39 +3461,50 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 else
   CC="$ac_cv_prog_CC"
 fi
 
 if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2381,99 +3514,60 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
+  fi
 fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
 else
+  ac_prog_rejected=no
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
@@ -2491,24 +3585,25 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
+  for ac_prog in cl.exe
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2518,39 +3613,41 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
     test -n "$CC" && break
   done
 fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
-  for ac_prog in cl
+  for ac_prog in cl.exe
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2560,66 +3657,78 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   test -n "$ac_ct_CC" && break
 done
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
 
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2631,112 +3740,108 @@ main ()
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
-	;;
-    conftest.$ac_ext )
-	# This is the source file.
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
 	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
 	# certainly right.
 	break;;
     *.* )
-	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	# FIXME: I believe we export ac_cv_exeext for Libtool,
-	# but it would be cool to find out if it's true.  Does anybody
-	# maintain Libtool? --akim.
-	export ac_cv_exeext
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
 	break;;
     * )
 	break;;
   esac
 done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
 else
-  echo "$as_me: failed program was:" >&5
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-  fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
 
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -2744,38 +3849,90 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  export ac_cv_exeext
 	  break;;
     * ) break;;
   esac
 done
 else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2787,45 +3944,46 @@ main ()
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2839,55 +3997,34 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
+  ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2898,39 +4035,49 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
 
-ac_cv_prog_cc_g=no
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -2946,23 +4093,18 @@ else
     CFLAGS=
   fi
 fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_prog_cc_stdc=no
+  ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -2985,12 +4127,17 @@ static char *f (char * (*g) (char **, int), char **p, ...)
 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    function prototypes and stuff, but not '\xHH' hex character constants.
    These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std1 is added to get
+   as 'x'.  The following induces an error, until -std is added to get
    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std1.  */
+   that's true only with -std.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -3005,205 +4152,37 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   return 0;
 }
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
 fi
-rm -f conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
 CC=$ac_save_CC
 
 fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
   *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
-
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if test "x$ac_cv_prog_cc_c89" != xno; then :
 
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
-fi
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3212,17 +4191,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 depcc="$CC"   am_compiler_list=
 
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -3240,6 +4220,11 @@ else
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -3251,34 +4236,49 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -3302,13 +4302,11 @@ else
 fi
 
 fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
-
-
-if
+ if
   test "x$enable_dependency_tracking" != xno \
   && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
   am__fastdepCC_TRUE=
@@ -3324,15 +4322,15 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -3346,11 +4344,7 @@ do
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -3359,78 +4353,34 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
   break
 fi
 
@@ -3442,8 +4392,8 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -3453,11 +4403,7 @@ do
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -3466,85 +4412,40 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
 else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -3561,10 +4462,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3574,35 +4475,37 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -3612,39 +4515,50 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 else
   CC="$ac_cv_prog_CC"
 fi
 
 if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3654,77 +4568,37 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
 
+  fi
 fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3735,18 +4609,19 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
@@ -3764,24 +4639,25 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
+  for ac_prog in cl.exe
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3791,39 +4667,41 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
     test -n "$CC" && break
   done
 fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
-  for ac_prog in cl
+  for ac_prog in cl.exe
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -3833,71 +4711,83 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   test -n "$ac_ct_CC" && break
 done
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
 
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
 
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3911,55 +4801,34 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
+  ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3970,39 +4839,49 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
 
-ac_cv_prog_cc_g=no
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -4018,23 +4897,18 @@ else
     CFLAGS=
   fi
 fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_prog_cc_stdc=no
+  ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4057,12 +4931,17 @@ static char *f (char * (*g) (char **, int), char **p, ...)
 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    function prototypes and stuff, but not '\xHH' hex character constants.
    These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std1 is added to get
+   as 'x'.  The following induces an error, until -std is added to get
    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std1.  */
+   that's true only with -std.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -4077,205 +4956,37 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   return 0;
 }
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
 fi
-rm -f conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
 CC=$ac_save_CC
 
 fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
   *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
 
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
 fi
 
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4284,17 +4995,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 depcc="$CC"   am_compiler_list=
 
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4312,6 +5024,11 @@ else
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -4323,34 +5040,49 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -4374,13 +5106,11 @@ else
 fi
 
 fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
-
-
-if
+ if
   test "x$enable_dependency_tracking" != xno \
   && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
   am__fastdepCC_TRUE=
@@ -4391,20 +5121,24 @@ else
 fi
 
 
-ac_ext=cc
+ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CXX"; then
   ac_cv_prog_CXX="$CXX" # Let the user override the test.
@@ -4414,39 +5148,41 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CXX=$ac_cv_prog_CXX
 if test -n "$CXX"; then
-  echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
     test -n "$CXX" && break
   done
 fi
 if test -z "$CXX"; then
   ac_ct_CXX=$CXX
-  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CXX"; then
   ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
@@ -4456,64 +5192,77 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
 if test -n "$ac_ct_CXX"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   test -n "$ac_ct_CXX" && break
 done
-test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
 
-  CXX=$ac_ct_CXX
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
 fi
 
-
+  fi
+fi
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
 
-echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -4527,55 +5276,34 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_cxx_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
+  ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
-GXX=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
 ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cxx_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -4586,160 +5314,64 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_cxx_try_compile "$LINENO"; then :
   ac_cv_prog_cxx_g=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-ac_cv_prog_cxx_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
 int
 main ()
 {
-exit (42);
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_cxx_try_compile "$LINENO"; then :
 
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+else
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_declaration
+
 int
 main ()
 {
-exit (42);
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
 fi
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4748,17 +5380,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 depcc="$CXX"  am_compiler_list=
 
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4776,6 +5409,11 @@ else
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -4787,34 +5425,49 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -4838,13 +5491,11 @@ else
 fi
 
 fi
-echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
 
-
-
-if
+ if
   test "x$enable_dependency_tracking" != xno \
   && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
   am__fastdepCXX_TRUE=
@@ -4856,22 +5507,18 @@ fi
 
 
 if test "x$CC" != xcc; then
-  echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
-echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
 else
-  echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
-echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
 fi
-set dummy $CC; ac_cc=`echo $2 |
+set dummy $CC; ac_cc=`$as_echo "$2" |
 		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -4885,38 +5532,65 @@ _ACEOF
 # Make sure it works both with $CC and with simple cc.
 # We do the test twice because some compilers refuse to overwrite an
 # existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5'
-if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-   test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+   test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); };
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
 then
   eval ac_cv_prog_cc_${ac_cc}_c_o=yes
   if test "x$CC" != xcc; then
     # Test first that cc exists at all.
     if { ac_try='cc -c conftest.$ac_ext >&5'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-      ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5'
-      if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+	 test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); };
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
       then
 	# cc works too.
 	:
@@ -4929,27 +5603,26 @@ then
 else
   eval ac_cv_prog_cc_${ac_cc}_c_o=no
 fi
-rm -f conftest*
+rm -f core conftest*
 
 fi
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define NO_MINUS_C_MINUS_O 1
-_ACEOF
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
 
 fi
 
 # FIXME: we rely on the cache variable name because
 # there is no other way.
 set dummy $CC
-ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
    # Losing compiler, so override with the script.
    # FIXME: It is wrong to rewrite CC.
    # But if we don't then we get into trouble of one sort or another.
@@ -4958,38 +5631,39 @@ if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
    CC="$am_aux_dir/compile $CC"
 fi
 
-echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
 fi
 
 
 
 
 
-    # Check whether --enable-debug or --disable-debug was given.
-if test "${enable_debug+set}" = set; then
-  enableval="$enable_debug"
-  eso_enable_debug=$enableval
+    # Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+  enableval=$enable_debug; eso_enable_debug=$enableval
 else
   eso_enable_debug=no
-fi;
+fi
+
 
-    echo "$as_me:$LINENO: checking whether debugging code should be created" >&5
-echo $ECHO_N "checking whether debugging code should be created... $ECHO_C" >&6
-if test "${eso_cv_enable_debug+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether debugging code should be created" >&5
+$as_echo_n "checking whether debugging code should be created... " >&6; }
+if ${eso_cv_enable_debug+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   eso_cv_enable_debug=$eso_enable_debug
 fi
-echo "$as_me:$LINENO: result: $eso_cv_enable_debug" >&5
-echo "${ECHO_T}$eso_cv_enable_debug" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $eso_cv_enable_debug" >&5
+$as_echo "$eso_cv_enable_debug" >&6; }
 
     if test x"$eso_cv_enable_debug" = xyes; then
 
@@ -5002,10 +5676,10 @@ echo "${ECHO_T}$eso_cv_enable_debug" >&6
 
 
     flag=`echo g3 | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports -g3" >&5
-echo $ECHO_N "checking whether $CC supports -g3... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -g3" >&5
+$as_echo_n "checking whether $CC supports -g3... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
                        eval "eso_cv_prog_cc_$flag=no"
@@ -5036,8 +5710,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
     if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
         :
@@ -5062,10 +5737,10 @@ echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
 
 
     flag=`echo ggdb | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports -ggdb" >&5
-echo $ECHO_N "checking whether $CC supports -ggdb... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -ggdb" >&5
+$as_echo_n "checking whether $CC supports -ggdb... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
                        eval "eso_cv_prog_cc_$flag=no"
@@ -5096,8 +5771,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
     if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
         :
@@ -5111,10 +5787,10 @@ echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
 
 
     flag=`echo O0 | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports -O0" >&5
-echo $ECHO_N "checking whether $CC supports -O0... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -O0" >&5
+$as_echo_n "checking whether $CC supports -O0... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
                        eval "eso_cv_prog_cc_$flag=no"
@@ -5145,8 +5821,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
     if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
         :
@@ -5160,10 +5837,10 @@ echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
 
 
     flag=`echo rdynamic | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports -rdynamic" >&5
-echo $ECHO_N "checking whether $CC supports -rdynamic... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -rdynamic" >&5
+$as_echo_n "checking whether $CC supports -rdynamic... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
                        eval "eso_cv_prog_cc_$flag=no"
@@ -5194,8 +5871,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
     if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
         :
@@ -5209,10 +5887,10 @@ echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
 
 
     flag=`echo Wall | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports -Wall" >&5
-echo $ECHO_N "checking whether $CC supports -Wall... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wall" >&5
+$as_echo_n "checking whether $CC supports -Wall... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
                        eval "eso_cv_prog_cc_$flag=no"
@@ -5243,8 +5921,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
     if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
         :
@@ -5258,10 +5937,10 @@ echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
 
 
     flag=`echo W | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports -W" >&5
-echo $ECHO_N "checking whether $CC supports -W... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -W" >&5
+$as_echo_n "checking whether $CC supports -W... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
                        eval "eso_cv_prog_cc_$flag=no"
@@ -5292,8 +5971,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
     if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
         :
@@ -5312,42 +5992,157 @@ echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
 
 
 
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
     fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
 
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
 
 
 
 
 
-    # Check whether --enable-strict or --disable-strict was given.
-if test "${enable_strict+set}" = set; then
-  enableval="$enable_strict"
-  eso_enable_strict=$enableval
+
+    # Check whether --enable-strict was given.
+if test "${enable_strict+set}" = set; then :
+  enableval=$enable_strict; eso_enable_strict=$enableval
 else
   eso_enable_strict=no
-fi;
+fi
 
-    echo "$as_me:$LINENO: checking whether strict compiler options should be used" >&5
-echo $ECHO_N "checking whether strict compiler options should be used... $ECHO_C" >&6
-if test "${eso_cv_enable_strict+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strict compiler options should be used" >&5
+$as_echo_n "checking whether strict compiler options should be used... " >&6; }
+if ${eso_cv_enable_strict+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   eso_cv_enable_strict=$eso_enable_strict
 fi
-echo "$as_me:$LINENO: result: $eso_cv_enable_strict" >&5
-echo "${ECHO_T}$eso_cv_enable_strict" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $eso_cv_enable_strict" >&5
+$as_echo "$eso_cv_enable_strict" >&6; }
 
 
     if test x"$eso_cv_enable_strict" = xyes; then
@@ -5366,10 +6161,10 @@ echo "${ECHO_T}$eso_cv_enable_strict" >&6
 
 
     flag=`echo std=c99 | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports -std=c99" >&5
-echo $ECHO_N "checking whether $CC supports -std=c99... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -std=c99" >&5
+$as_echo_n "checking whether $CC supports -std=c99... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
                        eval "eso_cv_prog_cc_$flag=no"
@@ -5400,8 +6195,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
     if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
         :
@@ -5417,10 +6213,10 @@ echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
 
 
     flag=`echo pedantic | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports -pedantic" >&5
-echo $ECHO_N "checking whether $CC supports -pedantic... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -pedantic" >&5
+$as_echo_n "checking whether $CC supports -pedantic... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
                        eval "eso_cv_prog_cc_$flag=no"
@@ -5451,8 +6247,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
     if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
         :
@@ -5469,10 +6266,10 @@ echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
 
 
     flag=`echo fno-builtin | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports -fno-builtin" >&5
-echo $ECHO_N "checking whether $CC supports -fno-builtin... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-builtin" >&5
+$as_echo_n "checking whether $CC supports -fno-builtin... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
                        eval "eso_cv_prog_cc_$flag=no"
@@ -5503,8 +6300,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
     if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
         :
@@ -5518,10 +6316,10 @@ echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
 
 
     flag=`echo -std=c99 | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports --std=c99" >&5
-echo $ECHO_N "checking whether $CC supports --std=c99... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports --std=c99" >&5
+$as_echo_n "checking whether $CC supports --std=c99... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
                        eval "eso_cv_prog_cc_$flag=no"
@@ -5552,8 +6350,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
     if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
         :
@@ -5568,10 +6367,10 @@ echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
 
     # Extract the first word of "doxygen", so it can be a program name with args.
 set dummy doxygen; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_DOXYGEN+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_DOXYGEN+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   case $DOXYGEN in
   [\\/]* | ?:[\\/]*)
@@ -5583,36 +6382,37 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 DOXYGEN=$ac_cv_path_DOXYGEN
-
 if test -n "$DOXYGEN"; then
-  echo "$as_me:$LINENO: result: $DOXYGEN" >&5
-echo "${ECHO_T}$DOXYGEN" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5
+$as_echo "$DOXYGEN" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 
+
     # Extract the first word of "latex", so it can be a program name with args.
 set dummy latex; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_LATEX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_LATEX+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   case $LATEX in
   [\\/]* | ?:[\\/]*)
@@ -5624,30 +6424,31 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_LATEX="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 LATEX=$ac_cv_path_LATEX
-
 if test -n "$LATEX"; then
-  echo "$as_me:$LINENO: result: $LATEX" >&5
-echo "${ECHO_T}$LATEX" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LATEX" >&5
+$as_echo "$LATEX" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 
+
     if test -z "${DOXYGEN}"; then
         DOXYGEN=":"
     fi
@@ -5658,10 +6459,9 @@ fi
 
 
 
-# Check whether --enable-static or --disable-static was given.
-if test "${enable_static+set}" = set; then
-  enableval="$enable_static"
-  p=${PACKAGE-default}
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
     case $enableval in
     yes) enable_static=yes ;;
     no) enable_static=no ;;
@@ -5680,12 +6480,19 @@ if test "${enable_static+set}" = set; then
     esac
 else
   enable_static=no
-fi;
+fi
+
+
+
+
+
+
 
-# Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
-  enableval="$enable_shared"
-  p=${PACKAGE-default}
+
+
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
     case $enableval in
     yes) enable_shared=yes ;;
     no) enable_shared=no ;;
@@ -5704,120 +6511,307 @@ if test "${enable_shared+set}" = set; then
     esac
 else
   enable_shared=yes
-fi;
+fi
 
 
-# Check whether --enable-fast-install or --disable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
-  enableval="$enable_fast_install"
-  p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_fast_install=yes
-fi;
 
-echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
-if test "${lt_cv_path_SED+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+
+
+case `pwd` in
+  *\ * | *\	*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.2'
+macro_revision='1.3337'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
+    for ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
     done
   done
-done
+  done
 IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
   fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
+else
+  ac_cv_path_SED=$SED
+fi
 
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
 
-SED=$lt_cv_path_SED
 
-echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6
 
 
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
-  withval="$with_gnu_ld"
-  test "$withval" = no || with_gnu_ld=yes
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  with_gnu_ld=no
-fi;
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_FGREP" || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
     # Accept absolute paths.
     [\\/]* | ?:[\\/]*)
       re_direlt='/[^/][^/]*/\.\./'
       # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
       test -z "$LD" && LD="$ac_prog"
       ;;
@@ -5831,14 +6825,14 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
 else
-  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-if test "${lt_cv_path_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
@@ -5868,19 +6862,17 @@ fi
 
 LD="$lt_cv_path_LD"
 if test -n "$LD"; then
-  echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
@@ -5892,40 +6884,22 @@ case `$LD -v 2>&1 </dev/null` in
   ;;
 esac
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
-echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
-if test "${lt_cv_ld_reload_flag+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_ld_reload_flag='-r'
-fi
-echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
 
-echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
-if test "${lt_cv_path_NM+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
   # Let the user override the test.
@@ -5968,1450 +6942,1433 @@ else
     done
     IFS="$lt_save_ifs"
   done
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+  : ${lt_cv_path_NM=no}
 fi
 fi
-echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6
-NM="$lt_cv_path_NM"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
-if test "${lt_cv_deplibs_check_method+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
 else
-  lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-case $host_os in
-aix4* | aix5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-bsdi[45]*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
 
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
+  test -n "$ac_ct_DUMPBIN" && break
+done
 
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
 
-freebsd* | kfreebsd*-gnu | dragonfly*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
       ;;
     esac
-  else
-    lt_cv_deplibs_check_method=pass_all
   fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
 
-interix3*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
-  ;;
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
 
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 
-# This must be Linux ELF.
-linux*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 
-netbsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
-  fi
-  ;;
 
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
 
-nto-qnx*)
-  lt_cv_deplibs_check_method=unknown
-  ;;
 
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
   fi
-  ;;
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
 
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
 
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
 
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
     ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
     ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
     ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
     ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
     ;;
-  esac
-  ;;
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
 
 
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
 
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
 
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
 
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
 
-fi;
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *ELF-32*)
-      HPUX_IA64_MODE="32"
-      ;;
-    *ELF-64*)
-      HPUX_IA64_MODE="64"
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '#line 6204 "configure"' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-   if test "$lt_cv_prog_gnu_ld" = yes; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -melf32bsmip"
-      ;;
-    *N32*)
-      LD="${LD-ld} -melf32bmipn32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -melf64bmip"
-      ;;
-    esac
-   else
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
-   fi
-  fi
-  rm -rf conftest*
-  ;;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
 
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.o` in
-    *32-bit*)
-      case $host in
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_i386"
-          ;;
-        ppc64-*linux*|powerpc64-*linux*)
-          LD="${LD-ld} -m elf32ppclinux"
-          ;;
-        s390x-*linux*)
-          LD="${LD-ld} -m elf_s390"
-          ;;
-        sparc64-*linux*)
-          LD="${LD-ld} -m elf32_sparc"
-          ;;
-      esac
-      ;;
-    *64-bit*)
-      case $host in
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          LD="${LD-ld} -m elf64_s390"
-          ;;
-        sparc*-*linux*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
 
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
-if test "${lt_cv_cc_needs_belf+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
 else
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+  lt_unset=false
+fi
 
-     cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  lt_cv_cc_needs_belf=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-lt_cv_cc_needs_belf=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-     ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
   ;;
-sparc*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
-      *)    LD="${LD-ld} -64" ;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
   ;;
-
-
 esac
 
-need_locks="$enable_libtool_lock"
 
 
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
+  case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
 
 fi
 
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
 
-fi
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
 
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
 
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
 
-fi
 
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
 
 
 
 
 
 
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
 
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-done
-
-
 
-for ac_header in dlfcn.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
 fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to usd-help at eso.org ##
-## ------------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
 fi
 
-done
+test -z "$OBJDUMP" && OBJDUMP=objdump
 
 
 
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
-if test -z "$CXXCPP"; then
-  if test "${ac_cv_prog_CXXCPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-      # Double quotes because CXXCPP needs to be expanded
-    for CXXCPP in "$CXX -E" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_cxx_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_cxx_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  break
-fi
 
-    done
-    ac_cv_prog_CXXCPP=$CXXCPP
 
-fi
-  CXXCPP=$ac_cv_prog_CXXCPP
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_prog_CXXCPP=$CXXCPP
-fi
-echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_cxx_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
   else
-    ac_cpp_err=
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
   fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ;;
 
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
 
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_cxx_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
   else
-    ac_cpp_err=
+    lt_cv_deplibs_check_method=pass_all
   fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
 fi
-rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+    fi
+    ;;
+  esac
 fi
 
-ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
-fi
 
 
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
 if test -n "$ac_tool_prefix"; then
-  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$F77"; then
-  ac_cv_prog_F77="$F77" # Let the user override the test.
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
-  echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-    test -n "$F77" && break
-  done
+
 fi
-if test -z "$F77"; then
-  ac_ct_F77=$F77
-  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_F77"; then
-  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_F77="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
-  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  test -n "$ac_ct_F77" && break
-done
-
-  F77=$ac_ct_F77
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
 fi
 
+test -z "$DLLTOOL" && DLLTOOL=dlltool
 
-# Provide some information about the compiler.
-echo "$as_me:7105:" \
-     "checking for Fortran 77 compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-rm -f a.out
-
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file.  (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
-if test "${ac_cv_f77_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-      program main
-#ifndef __GNUC__
-       choke me
-#endif
 
-      end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_compiler_gnu=yes
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  lt_cv_sharedlib_from_linklib_cmd='unknown'
 
-ac_compiler_gnu=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_f77_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  FFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
-      program main
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
 
-      end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_f77_g=yes
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-ac_cv_prog_f77_g=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
+
+    test -n "$AR" && break
+  done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
-if test "$ac_test_FFLAGS" = set; then
-  FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
-  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
-    FFLAGS="-g -O2"
-  else
-    FFLAGS="-g"
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
 else
-  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
-    FFLAGS="-O2"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
   else
-    FFLAGS=
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
   fi
 fi
 
-G77=`test $ac_compiler_gnu = yes && echo yes`
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+: ${AR=ar}
+: ${AR_FLAGS=cru}
 
 
 
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
 
-# find the maximum length of command line arguments
-echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-    i=0
-  teststring="ABCD"
 
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
 
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
 
-  cygwin* | mingw*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
 
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
 
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
 
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ 	]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    # If test is not a shell built-in, we'll probably end up computing a
-    # maximum length that is only half of the actual maximum length, but
-    # we can't tell.
-    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
-	       = "XX$teststring") >/dev/null 2>&1 &&
-	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
-	    lt_cv_sys_max_cmd_len=$new_result &&
-	    test $i != 17 # 1/2 MB should be enough
-    do
-      i=`expr $i + 1`
-      teststring=$teststring$teststring
-    done
-    teststring=
-    # Add a significant safety factor because C++ compilers can tack on massive
-    # amounts of additional arguments before passing them to the linker.
-    # It appears as though 1/2 is a usable value.
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    ;;
-  esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ar_at_file=no
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+	# Ensure the archiver fails upon bogus file names.
+	rm -f conftest.$ac_objext libconftest.a
+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
 
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-if test -n $lt_cv_sys_max_cmd_len ; then
-  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
 else
-  echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6
+  archiver_list_spec=$lt_cv_ar_at_file
 fi
 
 
 
 
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
 
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
 
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
 
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
 
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[BCDT]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[ABCDGISTW]'
-  ;;
-hpux*) # Its linker distinguishes data from code symbols
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDEGRST]'
-  fi
-  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
   ;;
-linux*)
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
   if test "$host_cpu" = ia64; then
-    symcode='[ABCDGIRSTW]'
-    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+    symcode='[ABCDEGRST]'
   fi
   ;;
 irix* | nonstopux*)
@@ -7437,57 +8394,87 @@ sysv4)
   ;;
 esac
 
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
 # Handle CRLF in mingw tool chain
 opt_cr=
 case $build_os in
 mingw*)
-  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
   ;;
 esac
 
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
+# Try without a prefix underscore, then with it.
 for ac_symprfx in "" "_"; do
 
   # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
   symxfrm="\\1 $ac_symprfx\\2 \\2"
 
   # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
 
   rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
+  cat > conftest.$ac_ext <<_LT_EOF
 #ifdef __cplusplus
 extern "C" {
 #endif
 char nm_test_var;
-void nm_test_func(){}
+void nm_test_func(void);
+void nm_test_func(void){}
 #ifdef __cplusplus
 }
 #endif
 int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
+_LT_EOF
 
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
     # Now try to grab the symbols.
     nlist=conftest.nm
-    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
-  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s "$nlist"; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
       # Try sorting and uniquifying the output.
       if sort "$nlist" | uniq > "$nlist"T; then
 	mv -f "$nlist"T "$nlist"
@@ -7496,57 +8483,71 @@ EOF
       fi
 
       # Make sure that we snagged all the symbols we need.
-      if grep ' nm_test_var$' "$nlist" >/dev/null; then
-	if grep ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<EOF > conftest.$ac_ext
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-EOF
+_LT_EOF
 	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
 
-	  cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
+	  cat <<_LT_EOF >> conftest.$ac_ext
 
-/* The mapping between symbol names and symbols. */
-const struct {
+/* The mapping between symbol names and symbols.  */
+LT_DLSYM_CONST struct {
   const char *name;
-  lt_ptr_t address;
+  void       *address;
 }
-lt_preloaded_symbols[] =
+lt__PROGRAM__LTX_preloaded_symbols[] =
 {
-EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
-	  cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr_t) 0}
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
 };
 
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
 #ifdef __cplusplus
 }
 #endif
-EOF
+_LT_EOF
 	  # Now try linking the two files.
 	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
+	  lt_globsym_save_LIBS=$LIBS
+	  lt_globsym_save_CFLAGS=$CFLAGS
 	  LIBS="conftstm.$ac_objext"
 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
-	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext}; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
 	    pipe_works=yes
 	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
+	  LIBS=$lt_globsym_save_LIBS
+	  CFLAGS=$lt_globsym_save_CFLAGS
 	else
 	  echo "cannot find nm_test_func in $nlist" >&5
 	fi
@@ -7560,7 +8561,7 @@ EOF
     echo "$progname: failed program was:" >&5
     cat conftest.$ac_ext >&5
   fi
-  rm -f conftest* conftst*
+  rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
   if test "$pipe_works" = yes; then
@@ -7576,8806 +8577,3902 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then
   lt_cv_sys_global_symbol_to_cdecl=
 fi
 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
 else
-  echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
 fi
 
-echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6
-if test "${lt_cv_objdir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+  nm_file_list_spec='@'
 fi
-echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6
-objdir=$lt_cv_objdir
 
 
 
 
 
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
 
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
 
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
 
-# Constants:
-rm="rm -f"
 
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot;
+else
+  with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+   ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
+else
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
 
 if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
+  if test -n "$MANIFEST_TOOL"; then
+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AR="${ac_tool_prefix}ar"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+  # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+  if test -n "$ac_ct_MANIFEST_TOOL"; then
+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_AR="ar"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
 fi
 fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  AR=$ac_ct_AR
+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
+    MANIFEST_TOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+  fi
 else
-  AR="$ac_cv_prog_AR"
+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
 fi
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+  lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&5
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
 fi
 fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  RANLIB=$ac_ct_RANLIB
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
 else
-  RANLIB="$ac_cv_prog_RANLIB"
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
 fi
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
 fi
 fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  STRIP=$ac_ct_STRIP
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NMEDIT=$ac_ct_NMEDIT
+  fi
 else
-  STRIP="$ac_cv_prog_STRIP"
+  NMEDIT="$ac_cv_prog_NMEDIT"
 fi
 
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
 
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
 
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
 else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<EOF 1>&2
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
 
-EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL=$ac_ct_OTOOL
+  fi
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  OTOOL="$ac_cv_prog_OTOOL"
 fi
 
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<EOF 1>&2
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
 
-EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
 fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
   else
-    MAGIC_CMD=:
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL64=$ac_ct_OTOOL64
   fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
 fi
 
-  fi
-  ;;
-esac
 
-enable_dlopen=no
-enable_win32_dll=no
 
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
 
-fi;
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
 
-# Check whether --with-pic or --without-pic was given.
-if test "${with_pic+set}" = set; then
-  withval="$with_pic"
-  pic_mode="$withval"
-else
-  pic_mode=default
-fi;
-test -z "$pic_mode" && pic_mode=default
 
-# Use C for the default configuration in the libtool script
-tagname=
-lt_save_CC="$CC"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-# Source file extension for C test sources.
-ac_ext=c
 
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
 
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
 
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
 
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
 
 
 
-lt_prog_compiler_no_builtin_flag=
 
-if test "$GCC" = yes; then
-  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
 
 
-echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_rtti_exceptions=no
-  ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8168: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:8172: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
-     fi
-   fi
-   $rm conftest*
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
 
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
-    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-    :
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	# If there is a non-empty error log, and "single_module"
+	# appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+	  cat conftest.err >&5
+	# Otherwise, if the output was created with a 0 exit code from
+	# the compiler, it worked.
+	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&5
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
 
-fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
+int
+main ()
+{
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
+else
+  lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	LDFLAGS="$save_LDFLAGS"
 
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl='-Wl,'
-    lt_prog_compiler_static='-static'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
 
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static='-Bstatic'
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+	cat conftest.err >&5
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&5
       fi
-      ;;
-
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
-      ;;
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
 
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[012]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
 
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic='-DDLL_EXPORT'
-      ;;
 
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic='-fno-common'
-      ;;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
-    interix3*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
+int
+main ()
+{
 
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared=no
-      enable_shared=no
-      ;;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic=-Kconform_pic
-      fi
-      ;;
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
 
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic='-fPIC'
-	;;
-      esac
-      ;;
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
 
-    *)
-      lt_prog_compiler_pic='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static='-Bstatic'
-      else
-	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic='-qnocommon'
-         lt_prog_compiler_wl='-Wl,'
-         ;;
-       esac
-       ;;
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic='-DDLL_EXPORT'
-      ;;
+fi
 
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='${wl}-a ${wl}archive'
-      ;;
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
 
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static='-non_shared'
-      ;;
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
 
-    newsos6)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
-    linux*)
-      case $cc_basename in
-      icc* | ecc*)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-KPIC'
-	lt_prog_compiler_static='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-fpic'
-	lt_prog_compiler_static='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static='-non_shared'
-        ;;
-      esac
-      ;;
+fi
 
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static='-non_shared'
-      ;;
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
 
-    solaris*)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl='-Wl,';;
-      esac
-      ;;
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
 
-    sunos4*)
-      lt_prog_compiler_wl='-Qoption ld '
-      lt_prog_compiler_pic='-PIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
 
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	lt_prog_compiler_pic='-Kconform_pic'
-	lt_prog_compiler_static='-Bstatic'
-      fi
-      ;;
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
+fi
 
-    unicos*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_can_build_shared=no
-      ;;
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-    uts4*)
-      lt_prog_compiler_pic='-pic'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
 
+fi
+
+done
+
+
+
+
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
+
+
+
+
+
+# Set options
+
+
+
+        enable_dlopen=no
+
+
+  enable_win32_dll=no
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
     *)
-      lt_prog_compiler_can_build_shared=no
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+	IFS="$lt_save_ifs"
+	if test "X$lt_pkg" = "X$lt_p"; then
+	  pic_mode=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
       ;;
     esac
-  fi
+else
+  pic_mode=default
+fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6
 
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
+test -z "$pic_mode" && pic_mode=default
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_pic_works=no
-  ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8436: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:8440: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_prog_compiler_pic_works=yes
-     fi
-   fi
-   $rm conftest*
 
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
 
-if test x"$lt_prog_compiler_pic_works" = xyes; then
-    case $lt_prog_compiler_pic in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
-     esac
-else
-    lt_prog_compiler_pic=
-     lt_prog_compiler_can_build_shared=no
-fi
 
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic=
-    ;;
-  *)
-    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-    ;;
-esac
 
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_prog_compiler_static_works=yes
-       fi
-     else
-       lt_prog_compiler_static_works=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
 
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
 
-if test x"$lt_prog_compiler_static_works" = xyes; then
-    :
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-    lt_prog_compiler_static=
+  enable_fast_install=yes
 fi
 
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8540: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:8544: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
 
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
 
-  runpath_var=
-  allow_undefined_flag=
-  enable_shared_with_static_runtimes=no
-  archive_cmds=
-  archive_expsym_cmds=
-  old_archive_From_new_cmds=
-  old_archive_from_expsyms_cmds=
-  export_dynamic_flag_spec=
-  whole_archive_flag_spec=
-  thread_safe_flag_spec=
-  hardcode_libdir_flag_spec=
-  hardcode_libdir_flag_spec_ld=
-  hardcode_libdir_separator=
-  hardcode_direct=no
-  hardcode_minus_L=no
-  hardcode_shlibpath_var=unsupported
-  link_all_deplibs=unknown
-  hardcode_automatic=no
-  module_cmds=
-  module_expsym_cmds=
-  always_export_symbols=no
-  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
 
-  ld_shlibs=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
 
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
 
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	ld_shlibs=no
-	cat <<EOF 1>&2
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
 
-EOF
-      fi
-      ;;
 
-    amigaos*)
-      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
 
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs=no
-      ;;
 
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
 
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec='-L$libdir'
-      allow_undefined_flag=unsupported
-      always_export_symbols=no
-      enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
 
-    interix3*)
-      hardcode_direct=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
 
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	tmp_addflag=
-	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	ld_shlibs=no
-      fi
-      ;;
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
 
-    solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	ld_shlibs=no
-	cat <<EOF 1>&2
 
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
 
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
 
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-	ld_shlibs=no
-	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
 
-_LT_EOF
-	;;
-	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
-	  else
-	    ld_shlibs=no
-	  fi
-	;;
-      esac
-      ;;
 
-    sunos4*)
-      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
 
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-    esac
 
-    if test "$ld_shlibs" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec=
-      export_dynamic_flag_spec=
-      whole_archive_flag_spec=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag=unsupported
-      always_export_symbols=yes
-      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct=unsupported
-      fi
-      ;;
 
-    aix4* | aix5*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	else
-	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
 
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
-	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
-	  done
-	  ;;
-	esac
 
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
 
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
-      archive_cmds=''
-      hardcode_direct=yes
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
 
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	  then
-  	  # We have reworked collect2
-  	  hardcode_direct=yes
-	  else
-  	  # We have old collect2
-  	  hardcode_direct=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  hardcode_minus_L=yes
-  	  hardcode_libdir_flag_spec='-L$libdir'
-  	  hardcode_libdir_separator=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
 
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+test -z "$LN_S" && LN_S="ln -s"
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag=' ${wl}-bernotok'
-	  allow_undefined_flag=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec='$convenience'
-	  archive_cmds_need_lc=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
 
-    amigaos*)
-      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs=no
-      ;;
 
-    bsdi[45]*)
-      export_dynamic_flag_spec=-rdynamic
-      ;;
 
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec=' '
-      allow_undefined_flag=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes=yes
-      ;;
 
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc=no
-      hardcode_direct=no
-      hardcode_automatic=yes
-      hardcode_shlibpath_var=unsupported
-      whole_archive_flag_spec=''
-      link_all_deplibs=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs=no
-          ;;
-      esac
-    fi
-      ;;
 
-    dgux*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
 
-    freebsd1*)
-      ld_shlibs=no
-      ;;
 
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
 
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
 
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
 
-    hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_direct=yes
 
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L=yes
-      export_dynamic_flag_spec='${wl}-E'
-      ;;
 
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator=:
 
-	hardcode_direct=yes
-	export_dynamic_flag_spec='${wl}-E'
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
 
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	hardcode_minus_L=yes
-      fi
-      ;;
 
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator=:
 
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  hardcode_libdir_flag_spec_ld='+b $libdir'
-	  hardcode_direct=no
-	  hardcode_shlibpath_var=no
-	  ;;
-	*)
-	  hardcode_direct=yes
-	  export_dynamic_flag_spec='${wl}-E'
 
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L=yes
-	  ;;
-	esac
-      fi
-      ;;
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
 
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_ld='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      link_all_deplibs=yes
-      ;;
+# Global variables:
+ofile=libtool
+can_build_shared=yes
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
 
-    newsos6)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_shlibpath_var=no
-      ;;
+with_gnu_ld="$lt_cv_prog_gnu_ld"
 
-    openbsd*)
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec='${wl}-E'
-      else
-       case $host_os in
-	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	   hardcode_libdir_flag_spec='-R$libdir'
-	   ;;
-	 *)
-	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	   ;;
-       esac
-      fi
-      ;;
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
 
-    os2*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      allow_undefined_flag=unsupported
-      archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
 
-    osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      else
-	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
 
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec='-rpath $libdir'
-      fi
-      hardcode_libdir_separator=:
-      ;;
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
 
-    solaris*)
-      no_undefined_flag=' -z text'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-	wlarc=''
-	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_shlibpath_var=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
-      esac
-      link_all_deplibs=yes
-      ;;
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
 
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+_LT_EOF
+	  fi ;;
+	esac
       fi
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
 
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds='$CC -r -o $output$reload_objs'
-	  hardcode_direct=no
-        ;;
-	motorola)
-	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var=no
-      ;;
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-    sysv4.3*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      export_dynamic_flag_spec='-Bexport'
-      ;;
 
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs=yes
-      fi
-      ;;
 
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
-      no_undefined_flag='${wl}-z,text'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
 
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag='${wl}-z,text'
-      allow_undefined_flag='${wl}-z,nodefs'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      export_dynamic_flag_spec='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
       fi
-      ;;
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
 
-    uts4*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-    *)
-      ld_shlibs=no
-      ;;
-    esac
-  fi
 
-echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6
-test "$ld_shlibs" = no && can_build_shared=no
+  else
+    MAGIC_CMD=:
+  fi
+fi
 
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc=yes
+  fi
+  ;;
+esac
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+# Use C for the default configuration in the libtool script
 
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl
-	pic_flag=$lt_prog_compiler_pic
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag
-        allow_undefined_flag=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc=no
-        else
-	  archive_cmds_need_lc=yes
-        fi
-        allow_undefined_flag=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6
-      ;;
-    esac
-  fi
-  ;;
-esac
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
 if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
+
 fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
 
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
+fi
 
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
 
-aix4* | aix5*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
 
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
 
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
 
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
 
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
 
     case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
       fi
       ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
       ;;
-    esac
-    ;;
 
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
 
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
 
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
 
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
 
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='-fPIC'
+	;;
+      esac
       ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
       ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  freebsd*) # from 4.6 on
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
 
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
 
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
 
-interix3*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
 
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
+      lt_prog_compiler_pic='-fPIC'
+      ;;
     esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
 
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
 
-# This must be Linux ELF.
-linux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
 
-  # find out which ABI we are using
-  libsuff=
-  case "$host_cpu" in
-  x86_64*|s390x*|powerpc64*)
-    echo '#line 10009 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
-        ;;
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='+Z'
+	;;
       esac
-    fi
-    rm -rf conftest*
-    ;;
-  esac
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
 
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
 
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='--shared'
+	lt_prog_compiler_static='--static'
+	;;
+      nagfor*)
+	# NAG Fortran compiler
+	lt_prog_compiler_wl='-Wl,-Wl,,'
+	lt_prog_compiler_pic='-PIC'
+	lt_prog_compiler_static='-Bstatic'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-qpic'
+	lt_prog_compiler_static='-qstaticlink'
 	;;
       *)
-	shlibpath_overrides_runpath=yes
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl=''
+	  ;;
+	*Sun\ F* | *Sun*Fortran*)
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl='-Qoption ld '
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl='-Wl,'
+	  ;;
+        *Intel*\ [CF]*Compiler*)
+	  lt_prog_compiler_wl='-Wl,'
+	  lt_prog_compiler_pic='-fPIC'
+	  lt_prog_compiler_static='-static'
+	  ;;
+	*Portland\ Group*)
+	  lt_prog_compiler_wl='-Wl,'
+	  lt_prog_compiler_pic='-fpic'
+	  lt_prog_compiler_static='-Bstatic'
+	  ;;
+	esac
 	;;
       esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
+      ;;
 
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
 
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
 
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
 
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
 
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
       ;;
-    siemens)
-      need_lib_prefix=no
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
       ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
       ;;
-  esac
-  ;;
 
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
 
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
 
-*)
-  dynamic_linker=no
-  ;;
-esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
-test "$dynamic_linker" = no && can_build_shared=no
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
-   test -n "$runpath_var" || \
-   test "X$hardcode_automatic" = "Xyes" ; then
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
 
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
-  fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
 fi
-echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
 
-if test "$hardcode_action" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
 else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
 fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    ;;
-  esac
+
 fi
 
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
 
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
 
-  mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
 
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
 
-  darwin*)
-  # if libdl is installed we need to link against it
-    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
 
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
 
-fi
 
-   ;;
 
-  *)
-    echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
-if test "${ac_cv_func_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define shl_load innocuous_shl_load
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shl_load (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
 
-#undef shl_load
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shl_load) || defined (__stub___shl_load)
-choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
-int
-main ()
-{
-return f != shl_load;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
-if test $ac_cv_func_shl_load = yes; then
-  lt_cv_dlopen="shl_load"
-else
-  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-int
-main ()
-{
-shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_shl_load=yes
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
 
-ac_cv_lib_dld_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
-if test $ac_cv_lib_dld_shl_load = yes; then
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
-  echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
-if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define dlopen innocuous_dlopen
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef dlopen
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
-int
-main ()
-{
-return f != dlopen;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
-if test $ac_cv_func_dlopen = yes; then
-  lt_cv_dlopen="dlopen"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_svld_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
 
-ac_cv_lib_svld_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
-if test $ac_cv_lib_svld_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dld_link ();
-int
-main ()
-{
-dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_dld_link=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dld_dld_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
-if test $ac_cv_lib_dld_dld_link = yes; then
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
 
 
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
 fi
 
 
-fi
-
 
-fi
 
 
-fi
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
 
-fi
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
 
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
     ;;
   esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
+  ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
   fi
 
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
 
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
 
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
 
-    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 10906 "configure"
-#include "confdefs.h"
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
+_LT_EOF
+      fi
+      ;;
 
-#include <stdio.h>
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
 
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=' $pic_flag'
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec=
+	  tmp_sharedflag='--shared' ;;
+	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+	case $cc_basename in
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 11006 "configure"
-#include "confdefs.h"
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
 
-#include <stdio.h>
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
 
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    ld_shlibs=no
+	  fi
+	;;
+      esac
+      ;;
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
     esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
-
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
     fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
 
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
 
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
 
-# Report which library types will actually be built
-echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  hardcode_direct=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L=yes
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_libdir_separator=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
 
-echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
-test "$can_build_shared" = "no" && enable_shared=no
+      export_dynamic_flag_spec='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
+int
+main ()
+{
 
-aix4* | aix5*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
   fi
-    ;;
-esac
-echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6
-
-echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
   fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler \
-    CC \
-    LD \
-    lt_prog_compiler_wl \
-    lt_prog_compiler_pic \
-    lt_prog_compiler_static \
-    lt_prog_compiler_no_builtin_flag \
-    export_dynamic_flag_spec \
-    thread_safe_flag_spec \
-    whole_archive_flag_spec \
-    enable_shared_with_static_runtimes \
-    old_archive_cmds \
-    old_archive_from_new_cmds \
-    predep_objects \
-    postdep_objects \
-    predeps \
-    postdeps \
-    compiler_lib_search_path \
-    archive_cmds \
-    archive_expsym_cmds \
-    postinstall_cmds \
-    postuninstall_cmds \
-    old_archive_from_expsyms_cmds \
-    allow_undefined_flag \
-    no_undefined_flag \
-    export_symbols_cmds \
-    hardcode_libdir_flag_spec \
-    hardcode_libdir_flag_spec_ld \
-    hardcode_libdir_separator \
-    hardcode_automatic \
-    module_cmds \
-    module_expsym_cmds \
-    lt_cv_prog_compiler_c_o \
-    exclude_expsyms \
-    include_expsyms; do
-
-    case $var in
-    old_archive_cmds | \
-    old_archive_from_new_cmds | \
-    archive_cmds | \
-    archive_expsym_cmds | \
-    module_cmds | \
-    module_expsym_cmds | \
-    old_archive_from_expsyms_cmds | \
-    export_symbols_cmds | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
 
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
+fi
 
-cfgfile="${ofile}T"
-  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
-  $rm -f "$cfgfile"
-  { echo "$as_me:$LINENO: creating $ofile" >&5
-echo "$as_me: creating $ofile" >&6;}
+  aix_libpath=$lt_cv_aix_libpath_
+fi
 
-  cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+int
+main ()
+{
 
-# A sed program that does not truncate output.
-SED=$lt_SED
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
 
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
+fi
 
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+  aix_libpath=$lt_cv_aix_libpath_
+fi
 
-# The names of the tagged configurations supported by this script.
-available_tags=
+	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec='$convenience'
+	  fi
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
 
-# ### BEGIN LIBTOOL CONFIG
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
 
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	hardcode_libdir_flag_spec=' '
+	allow_undefined_flag=unsupported
+	always_export_symbols=yes
+	file_list_spec='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+	enable_shared_with_static_runtimes=yes
+	exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	old_postinstall_cmds='chmod 644 $oldlib'
+	postlink_cmds='lt_outputfile="@OUTPUT@"~
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	hardcode_libdir_flag_spec=' '
+	allow_undefined_flag=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	old_archive_from_new_cmds='true'
+	# FIXME: Should let the user specify the lib program.
+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	enable_shared_with_static_runtimes=yes
+	;;
+      esac
+      ;;
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
+    darwin* | rhapsody*)
 
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
 
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+  else
+    whole_archive_flag_spec=''
+  fi
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+  else
+  ld_shlibs=no
+  fi
 
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
+      ;;
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
 
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
-# An ERE matcher.
-EGREP=$lt_EGREP
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
 
-# The linker used to build libraries.
-LD=$lt_LD
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
 
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
 
-# A BSD-compatible nm program.
-NM=$lt_NM
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
 
-# A symbol stripping program
-STRIP=$lt_STRIP
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
 
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+	hardcode_direct=yes
+	hardcode_direct_absolute=yes
+	export_dynamic_flag_spec='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L=yes
+      fi
+      ;;
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
 
-# Used on cygwin: assembler.
-AS="$AS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	*)
+	  hardcode_direct=yes
+	  hardcode_direct_absolute=yes
+	  export_dynamic_flag_spec='${wl}-E'
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
 
-# Old archive suffix (normally "a").
-libext="$libext"
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+	# This should be the same for all languages, so no per-tag cache variable.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	fi
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
 
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
 
-# Executable file suffix (normally "").
-exeext="$exeext"
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
 
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
+    *nto* | *qnx*)
+      ;;
 
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct=yes
+	hardcode_shlibpath_var=no
+	hardcode_direct_absolute=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	  export_dynamic_flag_spec='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     hardcode_libdir_flag_spec='-R$libdir'
+	     ;;
+	   *)
+	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	ld_shlibs=no
+      fi
+      ;;
 
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
 
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
 
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
-# Do we need a version for libraries?
-need_version=$need_version
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
 
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      link_all_deplibs=yes
+      ;;
 
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
 
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
 
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
 
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
 
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
 
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
 
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
 
-# Library versioning type.
-version_type=$version_type
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
 
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
 
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
+    *)
+      ld_shlibs=no
+      ;;
+    esac
 
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
 
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
 
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+with_gnu_ld=$with_gnu_ld
 
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
 
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
 
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
 
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
 
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
 
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
 
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
 
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
 
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
 
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
 
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl
+	  pic_flag=$lt_prog_compiler_pic
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag
+	  allow_undefined_flag=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc=no
+	  else
+	    lt_cv_archive_cmds_need_lc=yes
+	  fi
+	  allow_undefined_flag=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
 
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
 
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
 
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
 
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
 
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
 
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
 
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
 
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
 
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
 
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
 
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic
 
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
 
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
 
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
 
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
 
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
 
-# ### END LIBTOOL CONFIG
 
-__EOF__
 
 
-  case $host_os in
-  aix3*)
-    cat <<\EOF >> "$cfgfile"
 
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-EOF
-    ;;
-  esac
 
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
 
-  mv -f "$cfgfile" "$ofile" || \
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
 
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
 
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC="$lt_save_CC"
 
 
-# Check whether --with-tags or --without-tags was given.
-if test "${with_tags+set}" = set; then
-  withval="$with_tags"
-  tagnames="$withval"
-fi;
 
-if test -f "$ltmain" && test -n "$tagnames"; then
-  if test ! -f "${ofile}"; then
-    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
-  fi
 
-  if test -z "$LTCC"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
-    if test -z "$LTCC"; then
-      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
-    else
-      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
-    fi
-  fi
-  if test -z "$LTCFLAGS"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
-  fi
 
-  # Extract list of available tagged configurations in $ofile.
-  # Note that this assumes the entire list is on one line.
-  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
 
-  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-  for tagname in $tagnames; do
-    IFS="$lt_save_ifs"
-    # Check whether tagname contains only valid characters
-    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
-    "") ;;
-    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
-echo "$as_me: error: invalid tag name: $tagname" >&2;}
-   { (exit 1); exit 1; }; }
-	;;
-    esac
 
-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
-    then
-      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
 
-    # Update the list of available tags.
-    if test -n "$tagname"; then
-      echo appending configuration tag \"$tagname\" to $ofile
 
-      case $tagname in
-      CXX)
-	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-	    (test "X$CXX" != "Xg++"))) ; then
-	  ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 
 
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
 
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
 
-# Source file extension for C++ test sources.
-ac_ext=cpp
 
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
 
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
 
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
 
 
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
-  $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
-  lt_cv_path_LD=$lt_cv_path_LDCXX
-else
-  $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
 
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
-  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-else
-  lt_prog_compiler_no_builtin_flag_CXX=
-fi
 
-if test "$GXX" = yes; then
-  # Set up default GNU C++ configuration
 
 
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
-  withval="$with_gnu_ld"
-  test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi;
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
-else
-  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
-fi
-if test "${lt_cv_path_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
 
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
-with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
 
-  # Check if GNU C++ uses GNU ld as the underlying linker, since the
-  # archiving commands below assume that GNU ld is being used.
-  if test "$with_gnu_ld" = yes; then
-    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
-    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
 
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-    #     investigate it a little bit more. (MM)
-    wlarc='${wl}'
 
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
-	grep 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      whole_archive_flag_spec_CXX=
-    fi
-  else
-    with_gnu_ld=no
-    wlarc=
-
-    # A generic and very simple default shared library creation
-    # command for GNU C++ for the case where it uses the native
-    # linker, instead of GNU ld.  If possible, this setting should
-    # overridden to take advantage of the native linker features on
-    # the platform it is being used on.
-    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-  fi
 
-  # Commands to make compiler produce verbose output that lists
-  # what "hidden" libraries, object files and flags are used when
-  # linking a shared library.
-  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
-else
-  GXX=no
-  with_gnu_ld=no
-  wlarc=
-fi
 
-# PORTME: fill in a description of your system's C++ link characteristics
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
-ld_shlibs_CXX=yes
-case $host_os in
-  aix3*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  aix4* | aix5*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
-
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[23]|aix4.[23].*|aix5*)
-	for ld_flag in $LDFLAGS; do
-	  case $ld_flag in
-	  *-brtl*)
-	    aix_use_runtimelinking=yes
-	    break
-	    ;;
-	  esac
-	done
-	;;
-      esac
 
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
 
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
-    archive_cmds_CXX=''
-    hardcode_direct_CXX=yes
-    hardcode_libdir_separator_CXX=':'
-    link_all_deplibs_CXX=yes
 
-    if test "$GXX" = yes; then
-      case $host_os in aix4.[012]|aix4.[012].*)
-      # We only want to do this on AIX 4.2 and lower, the check
-      # below for broken collect2 doesn't work under 4.3+
-	collect2name=`${CC} -print-prog-name=collect2`
-	if test -f "$collect2name" && \
-	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	then
-	  # We have reworked collect2
-	  hardcode_direct_CXX=yes
-	else
-	  # We have old collect2
-	  hardcode_direct_CXX=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  hardcode_minus_L_CXX=yes
-	  hardcode_libdir_flag_spec_CXX='-L$libdir'
-	  hardcode_libdir_separator_CXX=
-	fi
-	;;
-      esac
-      shared_flag='-shared'
-      if test "$aix_use_runtimelinking" = yes; then
-	shared_flag="$shared_flag "'${wl}-G'
-      fi
-    else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	shared_flag='-G'
-      else
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag='${wl}-G'
-	else
-	  shared_flag='${wl}-bM:SRE'
-	fi
-      fi
-    fi
 
-    # It seems that -bexpall does not export symbols beginning with
-    # underscore (_), so it is better to generate a list of symbols to export.
-    always_export_symbols_CXX=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      allow_undefined_flag_CXX='-berok'
-      # Determine the default libpath from the value encoded in an empty executable.
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-     else
-      if test "$host_cpu" = ia64; then
-	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
-	allow_undefined_flag_CXX="-z nodefs"
-	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-      else
-	# Determine the default libpath from the value encoded in an empty executable.
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-	hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-	# Warning - without using the other run time loading flags,
-	# -berok will link without error, but may produce a broken library.
-	no_undefined_flag_CXX=' ${wl}-bernotok'
-	allow_undefined_flag_CXX=' ${wl}-berok'
-	# Exported symbols can be pulled into shared objects from archives
-	whole_archive_flag_spec_CXX='$convenience'
-	archive_cmds_need_lc_CXX=yes
-	# This is similar to how AIX traditionally builds its shared libraries.
-	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-      fi
-    fi
-    ;;
 
-  beos*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-      allow_undefined_flag_CXX=unsupported
-      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-      # support --undefined.  This deserves some investigation.  FIXME
-      archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    else
-      ld_shlibs_CXX=no
-    fi
-    ;;
 
-  chorus*)
-    case $cc_basename in
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
 
-  cygwin* | mingw* | pw32*)
-    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
-    # as there is no search path for DLLs.
-    hardcode_libdir_flag_spec_CXX='-L$libdir'
-    allow_undefined_flag_CXX=unsupported
-    always_export_symbols_CXX=no
-    enable_shared_with_static_runtimes_CXX=yes
-
-    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      # If the export-symbols file already is a .def file (1st line
-      # is EXPORTS), use it as is; otherwise, prepend...
-      archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	cp $export_symbols $output_objdir/$soname.def;
-      else
-	echo EXPORTS > $output_objdir/$soname.def;
-	cat $export_symbols >> $output_objdir/$soname.def;
-      fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-    else
-      ld_shlibs_CXX=no
-    fi
-  ;;
-      darwin* | rhapsody*)
-        case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-        esac
-      archive_cmds_need_lc_CXX=no
-      hardcode_direct_CXX=no
-      hardcode_automatic_CXX=yes
-      hardcode_shlibpath_var_CXX=unsupported
-      whole_archive_flag_spec_CXX=''
-      link_all_deplibs_CXX=yes
-
-    if test "$GXX" = yes ; then
-      lt_int_apple_cc_single_mod=no
-      output_verbose_link_cmd='echo'
-      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
-       lt_int_apple_cc_single_mod=yes
-      fi
-      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      else
-          archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-        fi
-        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          else
-            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          fi
-            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_CXX=no
-          ;;
-      esac
-      fi
-        ;;
 
-  dgux*)
-    case $cc_basename in
-      ec++*)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      ghcx*)
-	# Green Hills C++ Compiler
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  freebsd[12]*)
-    # C++ shared libraries reported to be fairly broken before switch to ELF
-    ld_shlibs_CXX=no
-    ;;
-  freebsd-elf*)
-    archive_cmds_need_lc_CXX=no
-    ;;
-  freebsd* | kfreebsd*-gnu | dragonfly*)
-    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-    # conventions
-    ld_shlibs_CXX=yes
-    ;;
-  gnu*)
-    ;;
-  hpux9*)
-    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-    hardcode_libdir_separator_CXX=:
-    export_dynamic_flag_spec_CXX='${wl}-E'
-    hardcode_direct_CXX=yes
-    hardcode_minus_L_CXX=yes # Not in the search PATH,
-				# but as the default
-				# location of the library.
 
-    case $cc_basename in
-    CC*)
-      # FIXME: insert proper C++ library support
-      ld_shlibs_CXX=no
-      ;;
-    aCC*)
-      archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      #
-      # There doesn't appear to be a way to prevent this compiler from
-      # explicitly linking system object files so we need to strip them
-      # from the output so that they don't get included in the library
-      # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-      ;;
-    *)
-      if test "$GXX" = yes; then
-        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-      fi
-      ;;
-    esac
-    ;;
-  hpux10*|hpux11*)
-    if test $with_gnu_ld = no; then
-      hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_CXX=:
 
-      case $host_cpu in
-      hppa*64*|ia64*)
-	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
-        ;;
-      *)
-	export_dynamic_flag_spec_CXX='${wl}-E'
-        ;;
-      esac
-    fi
-    case $host_cpu in
-    hppa*64*|ia64*)
-      hardcode_direct_CXX=no
-      hardcode_shlibpath_var_CXX=no
-      ;;
-    *)
-      hardcode_direct_CXX=yes
-      hardcode_minus_L_CXX=yes # Not in the search PATH,
-					      # but as the default
-					      # location of the library.
-      ;;
-    esac
 
-    case $cc_basename in
-      CC*)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      aCC*)
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	esac
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test $with_gnu_ld = no; then
-	    case $host_cpu in
-	    hppa*64*)
-	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    ia64*)
-	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    *)
-	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    esac
-	  fi
-	else
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	fi
-	;;
-    esac
-    ;;
-  interix3*)
-    hardcode_direct_CXX=no
-    hardcode_shlibpath_var_CXX=no
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-    export_dynamic_flag_spec_CXX='${wl}-E'
-    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-    # Instead, shared libraries are loaded at an image base (0x10000000 by
-    # default) and relocated if they conflict, which is a slow very memory
-    # consuming and fragmenting process.  To avoid this, we pick a random,
-    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-    archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    ;;
-  irix5* | irix6*)
-    case $cc_basename in
-      CC*)
-	# SGI C++
-	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	# Archives containing C++ object files must be created using
-	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test "$with_gnu_ld" = no; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	  else
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
-	  fi
-	fi
-	link_all_deplibs_CXX=yes
-	;;
-    esac
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator_CXX=:
-    ;;
-  linux*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
-	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
-	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-	;;
-      icpc*)
-	# Intel C++
-	with_gnu_ld=yes
-	# version 8.0 and above of icpc choke on multiply defined symbols
-	# if we add $predep_objects and $postdep_objects, however 7.1 and
-	# earlier do not add the objects themselves.
-	case `$CC -V 2>&1` in
-	*"Version 7."*)
-  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-  	  archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	*)  # Version 8.0 or newer
-	  tmp_idyn=
-	  case $host_cpu in
-	    ia64*) tmp_idyn=' -i_dynamic';;
-	  esac
-  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	esac
-	archive_cmds_need_lc_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	;;
-      pgCC*)
-        # Portland Group C++ compiler
-	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-  	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
-	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-        ;;
-      cxx*)
-	# Compaq C++
-	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
 
-	runpath_var=LD_RUN_PATH
-	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-    esac
-    ;;
-  lynxos*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  m88k*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  mvs*)
-    case $cc_basename in
-      cxx*)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-      wlarc=
-      hardcode_libdir_flag_spec_CXX='-R$libdir'
-      hardcode_direct_CXX=yes
-      hardcode_shlibpath_var_CXX=no
-    fi
-    # Workaround some broken pre-1.5 toolchains
-    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-    ;;
-  openbsd2*)
-    # C++ shared libraries are fairly broken
-    ld_shlibs_CXX=no
-    ;;
-  openbsd*)
-    hardcode_direct_CXX=yes
-    hardcode_shlibpath_var_CXX=no
-    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-      export_dynamic_flag_spec_CXX='${wl}-E'
-      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    fi
-    output_verbose_link_cmd='echo'
-    ;;
-  osf3*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	hardcode_libdir_separator_CXX=:
 
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
 
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      cxx*)
-	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
-	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	  hardcode_libdir_separator_CXX=:
 
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
-	else
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	fi
-	;;
-    esac
-    ;;
-  osf4* | osf5*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	hardcode_libdir_separator_CXX=:
 
-	# Archives containing C++ object files must be created using
-	# the KAI C++ compiler.
-	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      cxx*)
-	allow_undefined_flag_CXX=' -expect_unresolved \*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	  echo "-hidden">> $lib.exp~
-	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
-	  $rm $lib.exp'
-
-	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
-	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	  hardcode_libdir_separator_CXX=:
 
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
-	else
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	fi
-	;;
-    esac
-    ;;
-  psos*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  sunos4*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.x
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      lcc*)
-	# Lucid
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  solaris*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.2, 5.x and Centerline C++
-        archive_cmds_need_lc_CXX=yes
-	no_undefined_flag_CXX=' -zdefs'
-	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	hardcode_libdir_flag_spec_CXX='-R$libdir'
-	hardcode_shlibpath_var_CXX=no
-	case $host_os in
-	  solaris2.[0-5] | solaris2.[0-5].*) ;;
-	  *)
-	    # The C++ compiler is used as linker so we must use $wl
-	    # flag to pass the commands to the underlying system
-	    # linker. We must also pass each convience library through
-	    # to the system linker between allextract/defaultextract.
-	    # The C++ compiler will combine linker options so we
-	    # cannot just pass the convience library names through
-	    # without $wl.
-	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
-	    ;;
-	esac
-	link_all_deplibs_CXX=yes
 
-	output_verbose_link_cmd='echo'
 
-	# Archives containing C++ object files must be created using
-	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-	;;
-      gcx*)
-	# Green Hills C++ Compiler
-	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
-	# The C++ compiler must be used to create the archive.
-	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	;;
-      *)
-	# GNU C++ compiler with Solaris linker
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
-	  if $CC --version | grep -v '^2\.7' > /dev/null; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  else
-	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	    # platform.
-	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  fi
 
-	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
-	fi
-	;;
-    esac
-    ;;
-  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-    no_undefined_flag_CXX='${wl}-z,text'
-    archive_cmds_need_lc_CXX=no
-    hardcode_shlibpath_var_CXX=no
-    runpath_var='LD_RUN_PATH'
 
-    case $cc_basename in
-      CC*)
-	archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  sysv5* | sco3.2v5* | sco5v6*)
-    # Note: We can NOT use -z defs as we might desire, because we do not
-    # link with -lc, and that would cause any symbols used from libc to
-    # always be unresolved, which means just about no library would
-    # ever link correctly.  If we're not using GNU ld we use -z text
-    # though, which does catch some bad symbols but isn't as heavy-handed
-    # as -z defs.
-    # For security reasons, it is highly recommended that you always
-    # use absolute paths for naming shared libraries, and exclude the
-    # DT_RUNPATH tag from executables and libraries.  But doing so
-    # requires that you compile everything twice, which is a pain.
-    # So that behaviour is only enabled if SCOABSPATH is set to a
-    # non-empty value in the environment.  Most likely only useful for
-    # creating official distributions of packages.
-    # This is a hack until libtool officially supports absolute path
-    # names for shared libraries.
-    no_undefined_flag_CXX='${wl}-z,text'
-    allow_undefined_flag_CXX='${wl}-z,nodefs'
-    archive_cmds_need_lc_CXX=no
-    hardcode_shlibpath_var_CXX=no
-    hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-    hardcode_libdir_separator_CXX=':'
-    link_all_deplibs_CXX=yes
-    export_dynamic_flag_spec_CXX='${wl}-Bexport'
-    runpath_var='LD_RUN_PATH'
 
-    case $cc_basename in
-      CC*)
-	archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  tandem*)
-    case $cc_basename in
-      NCC*)
-	# NonStop-UX NCC 3.20
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  *)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-esac
-echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6
-test "$ld_shlibs_CXX" = no && can_build_shared=no
 
-GCC_CXX="$GXX"
-LD_CXX="$LD"
 
 
-cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-EOF
 
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
 
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
 
-  # The `*' in the case matches for architectures that use `case' in
-  # $output_verbose_cmd can trigger glob expansion during the loop
-  # eval without this substitution.
-  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
 
-  for p in `eval $output_verbose_link_cmd`; do
-    case $p in
 
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" \
-	  || test $p = "-R"; then
-	 prev=$p
-	 continue
-       else
-	 prev=
-       fi
 
-       if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$compiler_lib_search_path_CXX"; then
-	     compiler_lib_search_path_CXX="${prev}${p}"
-	   else
-	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$postdeps_CXX"; then
-	   postdeps_CXX="${prev}${p}"
-	 else
-	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
-	 fi
-       fi
-       ;;
 
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
 
-       if test "$pre_test_object_deps_done" = no; then
-	 if test -z "$predep_objects_CXX"; then
-	   predep_objects_CXX="$p"
-	 else
-	   predep_objects_CXX="$predep_objects_CXX $p"
-	 fi
-       else
-	 if test -z "$postdep_objects_CXX"; then
-	   postdep_objects_CXX="$p"
-	 else
-	   postdep_objects_CXX="$postdep_objects_CXX $p"
-	 fi
-       fi
-       ;;
 
-    *) ;; # Ignore the rest.
 
-    esac
-  done
 
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling CXX test program"
-fi
 
-$rm -f confest.$objext
 
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix3*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  predep_objects_CXX=
-  postdep_objects_CXX=
-  postdeps_CXX=
-  ;;
 
-solaris*)
-  case $cc_basename in
-  CC*)
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    postdeps_CXX='-lCstd -lCrun'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
     ;;
   esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
   ;;
-esac
 
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
 
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
 
-lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
+bsdi[45]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
 
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    lt_prog_compiler_wl_CXX='-Wl,'
-    lt_prog_compiler_static_CXX='-static'
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
 
     case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_CXX='-Bstatic'
-      fi
-      ;;
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
-      ;;
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | os2* | pw32*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_CXX='-fno-common'
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
       ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      lt_prog_compiler_pic_CXX=
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
-    interix3*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_CXX=-Kconform_pic
-      fi
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
       ;;
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	;;
-      *)
-	lt_prog_compiler_pic_CXX='-fPIC'
-	;;
-      esac
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      lt_prog_compiler_pic_CXX='-fPIC'
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
       ;;
     esac
-  else
-    case $host_os in
-      aix4* | aix5*)
-	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
-	  # AIX 5 now supports IA64 processor
-	  lt_prog_compiler_static_CXX='-Bstatic'
-	else
-	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
-	fi
-	;;
-      chorus*)
-	case $cc_basename in
-	cxch68*)
-	  # Green Hills C++ Compiler
-	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-	  ;;
-	esac
-	;;
-       darwin*)
-         # PIC is the default on this platform
-         # Common symbols not allowed in MH_DYLIB files
-         case $cc_basename in
-           xlc*)
-           lt_prog_compiler_pic_CXX='-qnocommon'
-           lt_prog_compiler_wl_CXX='-Wl,'
-           ;;
-         esac
-       ;;
-      dgux*)
-	case $cc_basename in
-	  ec++*)
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    ;;
-	  ghcx*)
-	    # Green Hills C++ Compiler
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      freebsd* | kfreebsd*-gnu | dragonfly*)
-	# FreeBSD uses GNU C++
-	;;
-      hpux9* | hpux10* | hpux11*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
-	      lt_prog_compiler_pic_CXX='+Z'
-	    fi
-	    ;;
-	  aCC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-	    case $host_cpu in
-	    hppa*64*|ia64*)
-	      # +Z the default
-	      ;;
-	    *)
-	      lt_prog_compiler_pic_CXX='+Z'
-	      ;;
-	    esac
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      interix*)
-	# This is c89, which is MS Visual C++ (no shared libs)
-	# Anyone wants to do a port?
-	;;
-      irix5* | irix6* | nonstopux*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    # CC pic flag -KPIC is the default.
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      linux*)
-	case $cc_basename in
-	  KCC*)
-	    # KAI C++ Compiler
-	    lt_prog_compiler_wl_CXX='--backend -Wl,'
-	    lt_prog_compiler_pic_CXX='-fPIC'
-	    ;;
-	  icpc* | ecpc*)
-	    # Intel C++
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-static'
-	    ;;
-	  pgCC*)
-	    # Portland Group C++ compiler.
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-fpic'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	  cxx*)
-	    # Compaq C++
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    lt_prog_compiler_pic_CXX=
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      lynxos*)
-	;;
-      m88k*)
-	;;
-      mvs*)
-	case $cc_basename in
-	  cxx*)
-	    lt_prog_compiler_pic_CXX='-W c,exportall'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      netbsd*)
-	;;
-      osf3* | osf4* | osf5*)
-	case $cc_basename in
-	  KCC*)
-	    lt_prog_compiler_wl_CXX='--backend -Wl,'
-	    ;;
-	  RCC*)
-	    # Rational C++ 2.4.1
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  cxx*)
-	    # Digital/Compaq C++
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    lt_prog_compiler_pic_CXX=
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      psos*)
-	;;
-      solaris*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    lt_prog_compiler_wl_CXX='-Qoption ld '
-	    ;;
-	  gcx*)
-	    # Green Hills C++ Compiler
-	    lt_prog_compiler_pic_CXX='-PIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sunos4*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.x
-	    lt_prog_compiler_pic_CXX='-pic'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	  lcc*)
-	    # Lucid
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      tandem*)
-	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	esac
-	;;
-      vxworks*)
-	;;
-      *)
-	lt_prog_compiler_can_build_shared_CXX=no
-	;;
-    esac
-  fi
-
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_pic_works_CXX=no
-  ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13349: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:13353: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_prog_compiler_pic_works_CXX=yes
-     fi
-   fi
-   $rm conftest*
-
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
-
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
-    case $lt_prog_compiler_pic_CXX in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
-     esac
-else
-    lt_prog_compiler_pic_CXX=
-     lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_CXX=
-    ;;
-  *)
-    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
-    ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_static_works_CXX=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_prog_compiler_static_works_CXX=yes
-       fi
-     else
-       lt_prog_compiler_static_works_CXX=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6
-
-if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
-    :
-else
-    lt_prog_compiler_static_CXX=
-fi
-
-
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_c_o_CXX=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13453: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:13457: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_CXX=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
-
-  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix4* | aix5*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-    else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    export_symbols_cmds_CXX="$ltdll_cmds"
-  ;;
-  cygwin* | mingw*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  *)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-
-echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_CXX=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_CXX in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_CXX
-	pic_flag=$lt_prog_compiler_pic_CXX
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
-        allow_undefined_flag_CXX=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc_CXX=no
-        else
-	  archive_cmds_need_lc_CXX=yes
-        fi
-        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix4* | aix5*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  freebsd*) # from 4.6 on
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix3*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # find out which ABI we are using
-  libsuff=
-  case "$host_cpu" in
-  x86_64*|s390x*|powerpc64*)
-    echo '#line 13989 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  esac
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
-   test -n "$runpath_var_CXX" || \
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_CXX" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_CXX=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_CXX=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_CXX=unsupported
-fi
-echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6
-
-if test "$hardcode_action_CXX" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_CXX \
-    CC_CXX \
-    LD_CXX \
-    lt_prog_compiler_wl_CXX \
-    lt_prog_compiler_pic_CXX \
-    lt_prog_compiler_static_CXX \
-    lt_prog_compiler_no_builtin_flag_CXX \
-    export_dynamic_flag_spec_CXX \
-    thread_safe_flag_spec_CXX \
-    whole_archive_flag_spec_CXX \
-    enable_shared_with_static_runtimes_CXX \
-    old_archive_cmds_CXX \
-    old_archive_from_new_cmds_CXX \
-    predep_objects_CXX \
-    postdep_objects_CXX \
-    predeps_CXX \
-    postdeps_CXX \
-    compiler_lib_search_path_CXX \
-    archive_cmds_CXX \
-    archive_expsym_cmds_CXX \
-    postinstall_cmds_CXX \
-    postuninstall_cmds_CXX \
-    old_archive_from_expsyms_cmds_CXX \
-    allow_undefined_flag_CXX \
-    no_undefined_flag_CXX \
-    export_symbols_cmds_CXX \
-    hardcode_libdir_flag_spec_CXX \
-    hardcode_libdir_flag_spec_ld_CXX \
-    hardcode_libdir_separator_CXX \
-    hardcode_automatic_CXX \
-    module_cmds_CXX \
-    module_expsym_cmds_CXX \
-    lt_cv_prog_compiler_c_o_CXX \
-    exclude_expsyms_CXX \
-    include_expsyms_CXX; do
-
-    case $var in
-    old_archive_cmds_CXX | \
-    old_archive_from_new_cmds_CXX | \
-    archive_cmds_CXX | \
-    archive_expsym_cmds_CXX | \
-    module_cmds_CXX | \
-    module_expsym_cmds_CXX | \
-    old_archive_from_expsyms_cmds_CXX | \
-    export_symbols_cmds_CXX | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
-
-cfgfile="$ofile"
-
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
-
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-
-	else
-	  tagname=""
-	fi
-	;;
-
-      F77)
-	if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="      program t\n      end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6
-
-echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-aix4* | aix5*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-esac
-echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6
-
-echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6
-
-GCC_F77="$G77"
-LD_F77="$LD"
-
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
-
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
-
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl_F77='-Wl,'
-    lt_prog_compiler_static_F77='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_F77='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
-      ;;
-
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_F77='-fno-common'
-      ;;
-
-    interix3*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared_F77=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_F77=-Kconform_pic
-      fi
-      ;;
-
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_F77='-fPIC'
-	;;
-      esac
-      ;;
-
-    *)
-      lt_prog_compiler_pic_F77='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_F77='-Bstatic'
-      else
-	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic_F77='-qnocommon'
-         lt_prog_compiler_wl_F77='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_F77='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
-
-    newsos6)
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    linux*)
-      case $cc_basename in
-      icc* | ecc*)
-	lt_prog_compiler_wl_F77='-Wl,'
-	lt_prog_compiler_pic_F77='-KPIC'
-	lt_prog_compiler_static_F77='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	lt_prog_compiler_wl_F77='-Wl,'
-	lt_prog_compiler_pic_F77='-fpic'
-	lt_prog_compiler_static_F77='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl_F77='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static_F77='-non_shared'
-        ;;
-      esac
-      ;;
-
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
-
-    solaris*)
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl_F77='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl_F77='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      lt_prog_compiler_wl_F77='-Qoption ld '
-      lt_prog_compiler_pic_F77='-PIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	lt_prog_compiler_pic_F77='-Kconform_pic'
-	lt_prog_compiler_static_F77='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    unicos*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_can_build_shared_F77=no
-      ;;
-
-    uts4*)
-      lt_prog_compiler_pic_F77='-pic'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    *)
-      lt_prog_compiler_can_build_shared_F77=no
-      ;;
-    esac
-  fi
-
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
-
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_pic_works_F77=no
-  ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_F77"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15047: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:15051: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_prog_compiler_pic_works_F77=yes
-     fi
-   fi
-   $rm conftest*
-
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
-
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
-    case $lt_prog_compiler_pic_F77 in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
-     esac
-else
-    lt_prog_compiler_pic_F77=
-     lt_prog_compiler_can_build_shared_F77=no
-fi
-
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_F77=
-    ;;
-  *)
-    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
-    ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
-echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_static_works_F77=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_prog_compiler_static_works_F77=yes
-       fi
-     else
-       lt_prog_compiler_static_works_F77=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6
-
-if test x"$lt_prog_compiler_static_works_F77" = xyes; then
-    :
-else
-    lt_prog_compiler_static_F77=
-fi
-
-
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_c_o_F77=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15151: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:15155: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_F77=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
-
-  runpath_var=
-  allow_undefined_flag_F77=
-  enable_shared_with_static_runtimes_F77=no
-  archive_cmds_F77=
-  archive_expsym_cmds_F77=
-  old_archive_From_new_cmds_F77=
-  old_archive_from_expsyms_cmds_F77=
-  export_dynamic_flag_spec_F77=
-  whole_archive_flag_spec_F77=
-  thread_safe_flag_spec_F77=
-  hardcode_libdir_flag_spec_F77=
-  hardcode_libdir_flag_spec_ld_F77=
-  hardcode_libdir_separator_F77=
-  hardcode_direct_F77=no
-  hardcode_minus_L_F77=no
-  hardcode_shlibpath_var_F77=unsupported
-  link_all_deplibs_F77=unknown
-  hardcode_automatic_F77=no
-  module_cmds_F77=
-  module_expsym_cmds_F77=
-  always_export_symbols_F77=no
-  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms_F77=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  ld_shlibs_F77=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_F77='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_F77=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	ld_shlibs_F77=no
-	cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-      fi
-      ;;
-
-    amigaos*)
-      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs_F77=no
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag_F77=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      allow_undefined_flag_F77=unsupported
-      always_export_symbols_F77=no
-      enable_shared_with_static_runtimes_F77=yes
-      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    interix3*)
-      hardcode_direct_F77=no
-      hardcode_shlibpath_var_F77=no
-      hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec_F77='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	tmp_addflag=
-	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	ld_shlibs_F77=no
-	cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-	ld_shlibs_F77=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
-	  else
-	    ld_shlibs_F77=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-    esac
-
-    if test "$ld_shlibs_F77" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec_F77=
-      export_dynamic_flag_spec_F77=
-      whole_archive_flag_spec_F77=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag_F77=unsupported
-      always_export_symbols_F77=yes
-      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L_F77=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct_F77=unsupported
-      fi
-      ;;
-
-    aix4* | aix5*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	else
-	  export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
-	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      archive_cmds_F77=''
-      hardcode_direct_F77=yes
-      hardcode_libdir_separator_F77=':'
-      link_all_deplibs_F77=yes
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	  then
-  	  # We have reworked collect2
-  	  hardcode_direct_F77=yes
-	  else
-  	  # We have old collect2
-  	  hardcode_direct_F77=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  hardcode_minus_L_F77=yes
-  	  hardcode_libdir_flag_spec_F77='-L$libdir'
-  	  hardcode_libdir_separator_F77=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols_F77=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag_F77='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
-      program main
-
-      end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag_F77="-z nodefs"
-	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 cat >conftest.$ac_ext <<_ACEOF
-      program main
-
-      end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-	 hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag_F77=' ${wl}-bernotok'
-	  allow_undefined_flag_F77=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec_F77='$convenience'
-	  archive_cmds_need_lc_F77=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs_F77=no
-      ;;
-
-    bsdi[45]*)
-      export_dynamic_flag_spec_F77=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec_F77=' '
-      allow_undefined_flag_F77=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds_F77='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes_F77=yes
-      ;;
-
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc_F77=no
-      hardcode_direct_F77=no
-      hardcode_automatic_F77=yes
-      hardcode_shlibpath_var_F77=unsupported
-      whole_archive_flag_spec_F77=''
-      link_all_deplibs_F77=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_F77=no
-          ;;
-      esac
-    fi
-      ;;
-
-    dgux*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    freebsd1*)
-      ld_shlibs_F77=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
-      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      hardcode_direct_F77=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L_F77=yes
-      export_dynamic_flag_spec_F77='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_F77=:
-
-	hardcode_direct_F77=yes
-	export_dynamic_flag_spec_F77='${wl}-E'
-
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	hardcode_minus_L_F77=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_F77=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
-	  hardcode_direct_F77=no
-	  hardcode_shlibpath_var_F77=no
-	  ;;
-	*)
-	  hardcode_direct_F77=yes
-	  export_dynamic_flag_spec_F77='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_F77=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      link_all_deplibs_F77=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    newsos6)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      hardcode_shlibpath_var_F77=no
-      ;;
 
-    openbsd*)
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_F77='${wl}-E'
-      else
-       case $host_os in
-	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	   hardcode_libdir_flag_spec_F77='-R$libdir'
-	   ;;
-	 *)
-	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-	   ;;
-       esac
-      fi
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-      allow_undefined_flag_F77=unsupported
-      archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	allow_undefined_flag_F77=' -expect_unresolved \*'
-	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      else
-	allow_undefined_flag_F77=' -expect_unresolved \*'
-	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec_F77='-rpath $libdir'
-      fi
-      hardcode_libdir_separator_F77=:
-      ;;
-
-    solaris*)
-      no_undefined_flag_F77=' -z text'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-	wlarc=''
-	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_shlibpath_var_F77=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
-      esac
-      link_all_deplibs_F77=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_F77=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds_F77='$CC -r -o $output$reload_objs'
-	  hardcode_direct_F77=no
-        ;;
-	motorola)
-	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_F77=no
-      export_dynamic_flag_spec_F77='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var_F77=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs_F77=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
-      no_undefined_flag_F77='${wl}-z,text'
-      archive_cmds_need_lc_F77=no
-      hardcode_shlibpath_var_F77=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag_F77='${wl}-z,text'
-      allow_undefined_flag_F77='${wl}-z,nodefs'
-      archive_cmds_need_lc_F77=no
-      hardcode_shlibpath_var_F77=no
-      hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      hardcode_libdir_separator_F77=':'
-      link_all_deplibs_F77=yes
-      export_dynamic_flag_spec_F77='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    *)
-      ld_shlibs_F77=no
-      ;;
-    esac
-  fi
-
-echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_F77=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_F77 in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_F77
-	pic_flag=$lt_prog_compiler_pic_F77
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
-        allow_undefined_flag_F77=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc_F77=no
-        else
-	  archive_cmds_need_lc_F77=yes
-        fi
-        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix4* | aix5*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
     ;;
 
   *)
+    # Assume MSVC wrapper
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
     ;;
   esac
-  dynamic_linker='Win32 ld.exe'
   # FIXME: first we should search . and the directory the executable is in
   shlibpath_var=PATH
   ;;
@@ -16385,22 +12482,18 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -16408,22 +12501,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -16431,7 +12508,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -16449,7 +12526,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -16461,7 +12538,7 @@ freebsd* | dragonfly*)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
-  freebsd*) # from 4.6 on
+  *) # from 4.6 on, and DragonFly
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
@@ -16469,12 +12546,26 @@ freebsd* | dragonfly*)
   ;;
 
 gnu*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -16500,18 +12591,18 @@ hpux9* | hpux10* | hpux11*)
     fi
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
     shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
@@ -16520,12 +12611,14 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
   postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
   ;;
 
-interix3*)
-  version_type=linux
+interix[3-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -16541,7 +12634,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
 	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
+		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
 	fi ;;
@@ -16578,9 +12671,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
-linux*)
-  version_type=linux
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -16588,36 +12681,54 @@ linux*)
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
   # This implies no fast_install, which is unacceptable.
   # Some rework will be needed to allow for fast_install
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # find out which ABI we are using
-  libsuff=
-  case "$host_cpu" in
-  x86_64*|s390x*|powerpc64*)
-    echo '#line 16600 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  esac
+  # Add ABI-specific directories to the system library path.
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -16629,23 +12740,11 @@ linux*)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
@@ -16660,20 +12759,22 @@ netbsd*)
   ;;
 
 newsos6)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
 
-nto-qnx*)
-  version_type=linux
+*nto* | *qnx*)
+  version_type=qnx
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
   ;;
 
 openbsd*)
@@ -16682,13 +12783,13 @@ openbsd*)
   need_lib_prefix=no
   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
   case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
   esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     case $host_os in
       openbsd2.[89] | openbsd2.[89].*)
 	shlibpath_overrides_runpath=no
@@ -16722,8 +12823,12 @@ osf3* | osf4* | osf5*)
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
+rdos*)
+  dynamic_linker=no
+  ;;
+
 solaris*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -16748,7 +12853,7 @@ sunos4*)
   ;;
 
 sysv4 | sysv4.3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -16756,7 +12861,6 @@ sysv4 | sysv4.3*)
     sni)
       shlibpath_overrides_runpath=no
       need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
       runpath_var=LD_RUN_PATH
       ;;
     siemens)
@@ -16773,7 +12877,7 @@ sysv4 | sysv4.3*)
 
 sysv4*MP*)
   if test -d /usr/nec ;then
-    version_type=linux
+    version_type=linux # correct to gnu/linux during the next big refactor
     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
     soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
@@ -16787,13 +12891,12 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
   if test "$with_gnu_ld" = yes; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
     case $host_os in
       sco3.2v5*)
         sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
@@ -16803,8 +12906,19 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   sys_lib_dlsearch_path_spec='/usr/lib'
   ;;
 
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 uts4*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -16814,8 +12928,8 @@ uts4*)
   dynamic_linker=no
   ;;
 esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
@@ -16823,487 +12937,951 @@ if test "$GCC" = yes; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
-hardcode_action_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
-   test -n "$runpath_var_F77" || \
-   test "X$hardcode_automatic_F77" = "Xyes" ; then
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_F77" != no &&
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
-     test "$hardcode_minus_L_F77" != no; then
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
     # Linking always hardcodes the temporary library directory.
-    hardcode_action_F77=relink
+    hardcode_action=relink
   else
     # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_F77=immediate
+    hardcode_action=immediate
   fi
 else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_F77=unsupported
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
 fi
-echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6
-
-if test "$hardcode_action_F77" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
 
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
 
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_F77 \
-    CC_F77 \
-    LD_F77 \
-    lt_prog_compiler_wl_F77 \
-    lt_prog_compiler_pic_F77 \
-    lt_prog_compiler_static_F77 \
-    lt_prog_compiler_no_builtin_flag_F77 \
-    export_dynamic_flag_spec_F77 \
-    thread_safe_flag_spec_F77 \
-    whole_archive_flag_spec_F77 \
-    enable_shared_with_static_runtimes_F77 \
-    old_archive_cmds_F77 \
-    old_archive_from_new_cmds_F77 \
-    predep_objects_F77 \
-    postdep_objects_F77 \
-    predeps_F77 \
-    postdeps_F77 \
-    compiler_lib_search_path_F77 \
-    archive_cmds_F77 \
-    archive_expsym_cmds_F77 \
-    postinstall_cmds_F77 \
-    postuninstall_cmds_F77 \
-    old_archive_from_expsyms_cmds_F77 \
-    allow_undefined_flag_F77 \
-    no_undefined_flag_F77 \
-    export_symbols_cmds_F77 \
-    hardcode_libdir_flag_spec_F77 \
-    hardcode_libdir_flag_spec_ld_F77 \
-    hardcode_libdir_separator_F77 \
-    hardcode_automatic_F77 \
-    module_cmds_F77 \
-    module_expsym_cmds_F77 \
-    lt_cv_prog_compiler_c_o_F77 \
-    exclude_expsyms_F77 \
-    include_expsyms_F77; do
-
-    case $var in
-    old_archive_cmds_F77 | \
-    old_archive_from_new_cmds_F77 | \
-    archive_cmds_F77 | \
-    archive_expsym_cmds_F77 | \
-    module_cmds_F77 | \
-    module_expsym_cmds_F77 | \
-    old_archive_from_expsyms_cmds_F77 | \
-    export_symbols_cmds_F77 | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
+fi
 
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
     ;;
-  esac
-
-cfgfile="$ofile"
-
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
 
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
+fi
 
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
 
-# A C compiler.
-LTCC=$lt_LTCC
+fi
 
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
 
-# A language-specific compiler.
-CC=$lt_compiler_F77
+fi
 
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
 
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
+fi
 
-# An ERE matcher.
-EGREP=$lt_EGREP
 
-# The linker used to build libraries.
-LD=$lt_LD_F77
+fi
 
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
+    ;;
+  esac
 
-# A BSD-compatible nm program.
-NM=$lt_NM
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
 
-# A symbol stripping program
-STRIP=$lt_STRIP
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
 
-# Used on cygwin: assembler.
-AS="$AS"
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+#include <stdio.h>
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
 
-# Old archive suffix (normally "a").
-libext="$libext"
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
 
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
 
-# Executable file suffix (normally "").
-exeext="$exeext"
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
 
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
 
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
 
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
 
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
 
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
+#include <stdio.h>
 
-# Do we need a version for libraries?
-need_version=$need_version
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
 
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
 
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
 
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
 
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
 
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
 
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
 
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
 
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
 
-# Library versioning type.
-version_type=$version_type
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
 
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
 
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
 
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
 
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
 
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
 
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
 
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
 
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
 
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
 
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
 
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
 
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
 
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
 
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
 
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
 
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
 
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
 
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
 
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
 
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+  # Report which library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
 
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
 
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
 
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
 
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
 
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_F77
 
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
 
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+CC="$lt_save_CC"
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_F77"
+      if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+  if ${ac_cv_prog_CXXCPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
 
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_F77
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
 
-# ### END LIBTOOL TAG CONFIG: $tagname
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-__EOF__
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
 
 else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC="$lt_save_CC"
+else
+  _lt_caught_CXX_error=yes
+fi
 
-	else
-	  tagname=""
-	fi
-	;;
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-      GCJ)
-	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
 
+# Source file extension for C++ test sources.
+ac_ext=cpp
 
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
-# Source file extension for Java test sources.
-ac_ext=java
 
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
@@ -17315,26 +13893,44 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM conftest*
 
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  compiler_CXX=$CC
+  for cc_temp in $compiler""; do
   case $cc_temp in
     compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
     distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
@@ -17342,4511 +13938,4234 @@ for cc_temp in $compiler""; do
     *) break;;
   esac
 done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
-
-old_archive_cmds_GCJ=$old_archive_cmds
 
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+    else
+      lt_prog_compiler_no_builtin_flag_CXX=
+    fi
 
-lt_prog_compiler_no_builtin_flag_GCJ=
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
 
-if test "$GCC" = yes; then
-  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
 
 
-echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
 else
-  lt_cv_prog_compiler_rtti_exceptions=no
-  ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17378: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:17382: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
-     fi
-   fi
-   $rm conftest*
-
+  with_gnu_ld=no
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
 
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
-    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
 else
-    :
-fi
-
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
-
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
-
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl_GCJ='-Wl,'
-    lt_prog_compiler_static_GCJ='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_GCJ='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
-      ;;
-
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_GCJ='-fno-common'
-      ;;
-
-    interix3*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared_GCJ=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_GCJ=-Kconform_pic
-      fi
-      ;;
-
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
 	;;
       *)
-	lt_prog_compiler_pic_GCJ='-fPIC'
+	test "$with_gnu_ld" != yes && break
 	;;
       esac
-      ;;
-
-    *)
-      lt_prog_compiler_pic_GCJ='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_GCJ='-Bstatic'
-      else
-	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic_GCJ='-qnocommon'
-         lt_prog_compiler_wl_GCJ='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
-      ;;
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
 
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_GCJ='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
-      ;;
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static_GCJ='-non_shared'
-      ;;
 
-    newsos6)
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
 
-    linux*)
-      case $cc_basename in
-      icc* | ecc*)
-	lt_prog_compiler_wl_GCJ='-Wl,'
-	lt_prog_compiler_pic_GCJ='-KPIC'
-	lt_prog_compiler_static_GCJ='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	lt_prog_compiler_wl_GCJ='-Wl,'
-	lt_prog_compiler_pic_GCJ='-fpic'
-	lt_prog_compiler_static_GCJ='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl_GCJ='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static_GCJ='-non_shared'
-        ;;
-      esac
-      ;;
 
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static_GCJ='-non_shared'
-      ;;
 
-    solaris*)
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl_GCJ='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl_GCJ='-Wl,';;
-      esac
-      ;;
 
-    sunos4*)
-      lt_prog_compiler_wl_GCJ='-Qoption ld '
-      lt_prog_compiler_pic_GCJ='-PIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	lt_prog_compiler_pic_GCJ='-Kconform_pic'
-	lt_prog_compiler_static_GCJ='-Bstatic'
-      fi
-      ;;
+        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
 
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
 
-    unicos*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_can_build_shared_GCJ=no
-      ;;
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          whole_archive_flag_spec_CXX=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
 
-    uts4*)
-      lt_prog_compiler_pic_GCJ='-pic'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 
-    *)
-      lt_prog_compiler_can_build_shared_GCJ=no
-      ;;
-    esac
-  fi
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+    # PORTME: fill in a description of your system's C++ link characteristics
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+    ld_shlibs_CXX=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+      aix[4-9]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
 
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_pic_works_GCJ=no
-  ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17646: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:17650: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_prog_compiler_pic_works_GCJ=yes
-     fi
-   fi
-   $rm conftest*
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        archive_cmds_CXX=''
+        hardcode_direct_CXX=yes
+        hardcode_direct_absolute_CXX=yes
+        hardcode_libdir_separator_CXX=':'
+        link_all_deplibs_CXX=yes
+        file_list_spec_CXX='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[012]|aix4.[012].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    hardcode_direct_CXX=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    hardcode_minus_L_CXX=yes
+	    hardcode_libdir_flag_spec_CXX='-L$libdir'
+	    hardcode_libdir_separator_CXX=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
 
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+        export_dynamic_flag_spec_CXX='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        always_export_symbols_CXX=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          allow_undefined_flag_CXX='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
-    case $lt_prog_compiler_pic_GCJ in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
-     esac
-else
-    lt_prog_compiler_pic_GCJ=
-     lt_prog_compiler_can_build_shared_GCJ=no
-fi
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
 fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_GCJ=
-    ;;
-  *)
-    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
-    ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
-echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_static_works_GCJ=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_prog_compiler_static_works_GCJ=yes
-       fi
-     else
-       lt_prog_compiler_static_works_GCJ=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+  fi
 
 fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6
 
-if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
-    :
-else
-    lt_prog_compiler_static_GCJ=
+  aix_libpath=$lt_cv_aix_libpath__CXX
 fi
 
+          hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	    allow_undefined_flag_CXX="-z nodefs"
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
 else
-  lt_cv_prog_compiler_c_o_GCJ=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17750: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:17754: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_GCJ=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+  fi
 
+fi
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
+  aix_libpath=$lt_cv_aix_libpath__CXX
 fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    no_undefined_flag_CXX=' ${wl}-bernotok'
+	    allow_undefined_flag_CXX=' ${wl}-berok'
+	    if test "$with_gnu_ld" = yes; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      whole_archive_flag_spec_CXX='$convenience'
+	    fi
+	    archive_cmds_need_lc_CXX=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
 
-  runpath_var=
-  allow_undefined_flag_GCJ=
-  enable_shared_with_static_runtimes_GCJ=no
-  archive_cmds_GCJ=
-  archive_expsym_cmds_GCJ=
-  old_archive_From_new_cmds_GCJ=
-  old_archive_from_expsyms_cmds_GCJ=
-  export_dynamic_flag_spec_GCJ=
-  whole_archive_flag_spec_GCJ=
-  thread_safe_flag_spec_GCJ=
-  hardcode_libdir_flag_spec_GCJ=
-  hardcode_libdir_flag_spec_ld_GCJ=
-  hardcode_libdir_separator_GCJ=
-  hardcode_direct_GCJ=no
-  hardcode_minus_L_GCJ=no
-  hardcode_shlibpath_var_GCJ=unsupported
-  link_all_deplibs_GCJ=unknown
-  hardcode_automatic_GCJ=no
-  module_cmds_GCJ=
-  module_expsym_cmds_GCJ=
-  always_export_symbols_GCJ=no
-  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms_GCJ=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  allow_undefined_flag_CXX=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
 
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+	case $GXX,$cc_basename in
+	,cl* | no,cl*)
+	  # Native MSVC
+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+	  # no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX=' '
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=yes
+	  file_list_spec_CXX='@'
+	  # Tell ltmain to make .lib files, not .a files.
+	  libext=lib
+	  # Tell ltmain to make .dll files, not .so files.
+	  shrext_cmds=".dll"
+	  # FIXME: Setting linknames here is a bad hack.
+	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	  archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	    else
+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	    fi~
+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	    linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+	  enable_shared_with_static_runtimes_CXX=yes
+	  # Don't use ranlib
+	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
+	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
+	    case $lt_outputfile in
+	      *.exe|*.EXE) ;;
+	      *)
+		lt_outputfile="$lt_outputfile.exe"
+		lt_tool_outputfile="$lt_tool_outputfile.exe"
+		;;
+	    esac~
+	    func_to_tool_file "$lt_outputfile"~
+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	      $RM "$lt_outputfile.manifest";
+	    fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=no
+	  enable_shared_with_static_runtimes_CXX=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file (1st line
+	    # is EXPORTS), use it as is; otherwise, prepend...
+	    archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      cp $export_symbols $output_objdir/$soname.def;
+	    else
+	      echo EXPORTS > $output_objdir/$soname.def;
+	      cat $export_symbols >> $output_objdir/$soname.def;
+	    fi~
+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    ld_shlibs_CXX=no
+	  fi
+	  ;;
+	esac
+	;;
+      darwin* | rhapsody*)
 
-  ld_shlibs_GCJ=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
 
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_GCJ=
+  archive_cmds_need_lc_CXX=no
+  hardcode_direct_CXX=no
+  hardcode_automatic_CXX=yes
+  hardcode_shlibpath_var_CXX=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+  else
+    whole_archive_flag_spec_CXX=''
+  fi
+  link_all_deplibs_CXX=yes
+  allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+       if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
     fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
 
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	ld_shlibs_GCJ=no
-	cat <<EOF 1>&2
+  else
+  ld_shlibs_CXX=no
+  fi
 
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+	;;
 
-EOF
-      fi
-      ;;
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
 
-    amigaos*)
-      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs_GCJ=no
-      ;;
+      freebsd2.*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        ld_shlibs_CXX=no
+        ;;
 
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag_GCJ=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
+      freebsd-elf*)
+        archive_cmds_need_lc_CXX=no
+        ;;
 
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      allow_undefined_flag_GCJ=unsupported
-      always_export_symbols_GCJ=no
-      enable_shared_with_static_runtimes_GCJ=yes
-      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        ld_shlibs_CXX=yes
+        ;;
 
-    interix3*)
-      hardcode_direct_GCJ=no
-      hardcode_shlibpath_var_GCJ=no
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec_GCJ='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
+      gnu*)
+        ;;
 
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	tmp_addflag=
-	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      haiku*)
+        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        link_all_deplibs_CXX=yes
+        ;;
 
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
+      hpux9*)
+        hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator_CXX=:
+        export_dynamic_flag_spec_CXX='${wl}-E'
+        hardcode_direct_CXX=yes
+        hardcode_minus_L_CXX=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            ld_shlibs_CXX=no
+            ;;
+          aCC*)
+            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              ld_shlibs_CXX=no
+            fi
+            ;;
+        esac
+        ;;
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
 
-    solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	ld_shlibs_GCJ=no
-	cat <<EOF 1>&2
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      export_dynamic_flag_spec_CXX='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct_CXX=no
+            hardcode_shlibpath_var_CXX=no
+            ;;
+          *)
+            hardcode_direct_CXX=yes
+            hardcode_direct_absolute_CXX=yes
+            hardcode_minus_L_CXX=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
 
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
 
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
+      interix[3-9]*)
+	hardcode_direct_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	      fi
+	    fi
+	    link_all_deplibs_CXX=yes
+	    ;;
+        esac
+        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        hardcode_libdir_separator_CXX=:
+        inherit_rpath_CXX=yes
+        ;;
 
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-	ld_shlibs_GCJ=no
-	cat <<_LT_EOF 1>&2
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    archive_cmds_need_lc_CXX=no
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+	      prelink_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+	      old_archive_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+		$RANLIB $oldlib'
+	      archive_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      archive_expsym_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 and above use weak symbols
+	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    esac
 
-_LT_EOF
+	    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    ;;
+	  xl* | mpixl* | bgxl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      no_undefined_flag_CXX=' -zdefs'
+	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      hardcode_libdir_flag_spec_CXX='-R$libdir'
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      compiler_needs_object_CXX=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='func_echo_all'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
 	;;
-	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
-	  else
-	    ld_shlibs_GCJ=no
-	  fi
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
 	;;
-      esac
-      ;;
 
-    sunos4*)
-      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+      m88k*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+	;;
 
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-    esac
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	esac
+	;;
 
-    if test "$ld_shlibs_GCJ" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec_GCJ=
-      export_dynamic_flag_spec_GCJ=
-      whole_archive_flag_spec_GCJ=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag_GCJ=unsupported
-      always_export_symbols_GCJ=yes
-      archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L_GCJ=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct_GCJ=unsupported
-      fi
-      ;;
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  hardcode_libdir_flag_spec_CXX='-R$libdir'
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
 
-    aix4* | aix5*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+      *nto* | *qnx*)
+        ld_shlibs_CXX=yes
+	;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	ld_shlibs_CXX=no
+	;;
+
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	  hardcode_direct_absolute_CXX=yes
+	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    export_dynamic_flag_spec_CXX='${wl}-E'
+	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=func_echo_all
 	else
-	  export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	  ld_shlibs_CXX=no
 	fi
-	aix_use_runtimelinking=no
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        allow_undefined_flag_CXX=' -expect_unresolved \*'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+		;;
+	    esac
+
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	      hardcode_libdir_separator_CXX=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
 
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
-	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
-	  done
-	  ;;
-	esac
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            archive_cmds_need_lc_CXX=yes
+	    no_undefined_flag_CXX=' -zdefs'
+	    archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    hardcode_libdir_flag_spec_CXX='-R$libdir'
+	    hardcode_shlibpath_var_CXX=no
+	    case $host_os in
+	      solaris2.[0-5] | solaris2.[0-5].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    link_all_deplibs_CXX=yes
 
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
+	    output_verbose_link_cmd='func_echo_all'
 
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
-      archive_cmds_GCJ=''
-      hardcode_direct_GCJ=yes
-      hardcode_libdir_separator_GCJ=':'
-      link_all_deplibs_GCJ=yes
+	    # The C++ compiler must be used to create the archive.
+	    old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      fi
+
+	      hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[0-5] | solaris2.[0-5].*) ;;
+		*)
+		  whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
 
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	  then
-  	  # We have reworked collect2
-  	  hardcode_direct_GCJ=yes
-	  else
-  	  # We have old collect2
-  	  hardcode_direct_GCJ=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  hardcode_minus_L_GCJ=yes
-  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
-  	  hardcode_libdir_separator_GCJ=
-	  fi
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_CXX='${wl}-z,text'
+      archive_cmds_need_lc_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	*)
+	  archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	no_undefined_flag_CXX='${wl}-z,text'
+	allow_undefined_flag_CXX='${wl}-z,nodefs'
+	archive_cmds_need_lc_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+	hardcode_libdir_separator_CXX=':'
+	link_all_deplibs_CXX=yes
+	export_dynamic_flag_spec_CXX='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+	      '"$old_archive_cmds_CXX"
+	    reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+	      '"$reload_cmds_CXX"
+	    ;;
+	  *)
+	    archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
 	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
+      ;;
 
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols_GCJ=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag_GCJ='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
 
-int
-main ()
-{
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+      *)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+    esac
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+    test "$ld_shlibs_CXX" = no && can_build_shared=no
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+    GCC_CXX="$GXX"
+    LD_CXX="$LD"
 
-       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag_GCJ="-z nodefs"
-	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
 
-int
-main ()
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
 {
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
 
-	 hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag_GCJ=' ${wl}-bernotok'
-	  allow_undefined_flag_GCJ=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec_GCJ='$convenience'
-	  archive_cmds_need_lc_GCJ=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
 
-    amigaos*)
-      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs_GCJ=no
-      ;;
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case ${prev}${p} in
 
-    bsdi[45]*)
-      export_dynamic_flag_spec_GCJ=-rdynamic
-      ;;
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       fi
 
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec_GCJ=' '
-      allow_undefined_flag_GCJ=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds_GCJ='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes_GCJ=yes
-      ;;
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test "$pre_test_object_deps_done" = no; then
+	 case ${prev} in
+	 -L | -R)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+	 fi
+       fi
+       prev=
+       ;;
 
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc_GCJ=no
-      hardcode_direct_GCJ=no
-      hardcode_automatic_GCJ=yes
-      hardcode_shlibpath_var_GCJ=unsupported
-      whole_archive_flag_spec_GCJ=''
-      link_all_deplibs_GCJ=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_GCJ=no
-          ;;
-      esac
-    fi
-      ;;
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
 
-    dgux*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
 
-    freebsd1*)
-      ld_shlibs_GCJ=no
-      ;;
+    *) ;; # Ignore the rest.
 
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+    esac
+  done
 
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
 
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
-      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
 
-    hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      hardcode_direct_GCJ=yes
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  predep_objects_CXX=
+  postdep_objects_CXX=
+  postdeps_CXX=
+  ;;
 
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L_GCJ=yes
-      export_dynamic_flag_spec_GCJ='${wl}-E'
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
       ;;
+    esac
 
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_GCJ=:
-
-	hardcode_direct_GCJ=yes
-	export_dynamic_flag_spec_GCJ='${wl}-E'
+    if test "$solaris_use_stlport4" != yes; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
 
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	hardcode_minus_L_GCJ=yes
-      fi
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
       ;;
+    esac
 
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_GCJ=:
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
 
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
-	  hardcode_direct_GCJ=no
-	  hardcode_shlibpath_var_GCJ=no
-	  ;;
-	*)
-	  hardcode_direct_GCJ=yes
-	  export_dynamic_flag_spec_GCJ='${wl}-E'
 
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_GCJ=yes
-	  ;;
-	esac
-      fi
-      ;;
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
 
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      link_all_deplibs_GCJ=yes
-      ;;
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
 
-    newsos6)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      hardcode_shlibpath_var_GCJ=no
-      ;;
 
-    openbsd*)
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_GCJ='${wl}-E'
-      else
-       case $host_os in
-	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
-	   ;;
-	 *)
-	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-	   ;;
-       esac
-      fi
-      ;;
 
-    os2*)
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-      allow_undefined_flag_GCJ=unsupported
-      archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
 
-    osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	allow_undefined_flag_GCJ=' -expect_unresolved \*'
-	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      ;;
 
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      else
-	allow_undefined_flag_GCJ=' -expect_unresolved \*'
-	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
 
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
-      fi
-      hardcode_libdir_separator_GCJ=:
-      ;;
 
-    solaris*)
-      no_undefined_flag_GCJ=' -z text'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-	wlarc=''
-	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
- 	# The compiler driver will combine linker options so we
- 	# cannot just pass the convience library names through
- 	# without $wl, iff we do not link with $LD.
- 	# Luckily, gcc supports the same syntax we need for Sun Studio.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
- 	case $wlarc in
- 	'')
- 	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
- 	*)
- 	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- 	esac ;;
-      esac
-      link_all_deplibs_GCJ=yes
-      ;;
 
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
 
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_GCJ=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
-	  hardcode_direct_GCJ=no
-        ;;
-	motorola)
-	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
 
-    sysv4.3*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_GCJ=no
-      export_dynamic_flag_spec_GCJ='-Bexport'
-      ;;
 
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var_GCJ=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs_GCJ=yes
-      fi
-      ;;
 
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
-      no_undefined_flag_GCJ='${wl}-z,text'
-      archive_cmds_need_lc_GCJ=no
-      hardcode_shlibpath_var_GCJ=no
-      runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
 
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag_GCJ='${wl}-z,text'
-      allow_undefined_flag_GCJ='${wl}-z,nodefs'
-      archive_cmds_need_lc_GCJ=no
-      hardcode_shlibpath_var_GCJ=no
-      hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      hardcode_libdir_separator_GCJ=':'
-      link_all_deplibs_GCJ=yes
-      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
 
-    uts4*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
 
-    *)
-      ld_shlibs_GCJ=no
-      ;;
-    esac
-  fi
 
-echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6
-test "$ld_shlibs_GCJ" = no && can_build_shared=no
 
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_GCJ=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_GCJ in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_GCJ
-	pic_flag=$lt_prog_compiler_pic_GCJ
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
-        allow_undefined_flag_GCJ=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc_GCJ=no
-        else
-	  archive_cmds_need_lc_GCJ=yes
-        fi
-        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
-      ;;
-    esac
-  fi
-  ;;
-esac
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
 
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
 
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
 
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
 
-aix4* | aix5*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
 
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
 
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
 
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
+    lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
 
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
 
     case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
       ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_CXX='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_CXX=
+      ;;
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
       fi
       ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_CXX='-fPIC -shared'
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
       ;;
     esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
+      aix[4-9]*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-qpic'
+	    lt_prog_compiler_static_CXX='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      lt_prog_compiler_pic_CXX='-KPIC'
+	      lt_prog_compiler_static_CXX='-Bstatic'
+	      lt_prog_compiler_wl_CXX='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        lt_prog_compiler_pic_CXX='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
     esac
   fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  freebsd*) # from 4.6 on
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
 
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
     ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
     ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
+esac
 
-interix3*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
 
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_CXX=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $RM conftest*
 
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
 
-# This must be Linux ELF.
-linux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
 
-  # find out which ABI we are using
-  libsuff=
-  case "$host_cpu" in
-  x86_64*|s390x*|powerpc64*)
-    echo '#line 19219 "configure"' > conftest.$ac_ext
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      case `/usr/bin/file conftest.$ac_objext` in
-      *64-bit*)
-        libsuff=64
-        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
-        ;;
-      esac
-    fi
-    rm -rf conftest*
-    ;;
-  esac
+fi
 
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
-  fi
 
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
 
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
 
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
 
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_CXX=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_CXX=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_CXX=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
 
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
 
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+    :
+else
+    lt_prog_compiler_static_CXX=
+fi
 
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
 
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
 
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
 
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
 
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
 
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
 
-*)
-  dynamic_linker=no
-  ;;
-esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
-test "$dynamic_linker" = no && can_build_shared=no
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
-   test -n "$runpath_var_GCJ" || \
-   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
 
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_GCJ" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
-     test "$hardcode_minus_L_GCJ" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_GCJ=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_GCJ=immediate
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
   fi
 else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_GCJ=unsupported
+  need_locks=no
 fi
-echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6
 
-if test "$hardcode_action_GCJ" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
 
 
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_GCJ \
-    CC_GCJ \
-    LD_GCJ \
-    lt_prog_compiler_wl_GCJ \
-    lt_prog_compiler_pic_GCJ \
-    lt_prog_compiler_static_GCJ \
-    lt_prog_compiler_no_builtin_flag_GCJ \
-    export_dynamic_flag_spec_GCJ \
-    thread_safe_flag_spec_GCJ \
-    whole_archive_flag_spec_GCJ \
-    enable_shared_with_static_runtimes_GCJ \
-    old_archive_cmds_GCJ \
-    old_archive_from_new_cmds_GCJ \
-    predep_objects_GCJ \
-    postdep_objects_GCJ \
-    predeps_GCJ \
-    postdeps_GCJ \
-    compiler_lib_search_path_GCJ \
-    archive_cmds_GCJ \
-    archive_expsym_cmds_GCJ \
-    postinstall_cmds_GCJ \
-    postuninstall_cmds_GCJ \
-    old_archive_from_expsyms_cmds_GCJ \
-    allow_undefined_flag_GCJ \
-    no_undefined_flag_GCJ \
-    export_symbols_cmds_GCJ \
-    hardcode_libdir_flag_spec_GCJ \
-    hardcode_libdir_flag_spec_ld_GCJ \
-    hardcode_libdir_separator_GCJ \
-    hardcode_automatic_GCJ \
-    module_cmds_GCJ \
-    module_expsym_cmds_GCJ \
-    lt_cv_prog_compiler_c_o_GCJ \
-    exclude_expsyms_GCJ \
-    include_expsyms_GCJ; do
-
-    case $var in
-    old_archive_cmds_GCJ | \
-    old_archive_from_new_cmds_GCJ | \
-    archive_cmds_GCJ | \
-    archive_expsym_cmds_GCJ | \
-    module_cmds_GCJ | \
-    module_expsym_cmds_GCJ | \
-    old_archive_from_expsyms_cmds_GCJ | \
-    export_symbols_cmds_GCJ | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  case $host_os in
+  aix[4-9]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    cl*)
+      exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
       ;;
     *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
       ;;
     esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
   esac
 
-cfgfile="$ofile"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
 
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+with_gnu_ld_CXX=$with_gnu_ld
 
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
 
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
 
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_CXX
+	  pic_flag=$lt_prog_compiler_pic_CXX
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+	  allow_undefined_flag_CXX=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc_CXX=no
+	  else
+	    lt_cv_archive_cmds_need_lc_CXX=yes
+	  fi
+	  allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+      archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+      ;;
+    esac
+  fi
+  ;;
+esac
 
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
 
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
 
-# A C compiler.
-LTCC=$lt_LTCC
 
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
 
-# A language-specific compiler.
-CC=$lt_compiler_GCJ
 
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
 
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
 
-# An ERE matcher.
-EGREP=$lt_EGREP
 
-# The linker used to build libraries.
-LD=$lt_LD_GCJ
 
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
 
-# A BSD-compatible nm program.
-NM=$lt_NM
 
-# A symbol stripping program
-STRIP=$lt_STRIP
 
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
 
-# Used on cygwin: assembler.
-AS="$AS"
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
 
-# Old archive suffix (normally "a").
-libext="$libext"
 
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
 
-# Executable file suffix (normally "").
-exeext="$exeext"
 
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
-pic_mode=$pic_mode
 
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
 
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
 
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
 
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
 
-# Do we need a version for libraries?
-need_version=$need_version
 
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
 
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
 
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
 
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
 
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
 
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
 
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
 
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
 
-# Library versioning type.
-version_type=$version_type
 
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
 
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
 
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
 
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
 
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
 
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
 
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
 
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_GCJ
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_GCJ
 
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
 
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
 
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
 
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
 
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
 
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
 
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
 
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux # correct to gnu/linux during the next big refactor
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
 
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
 
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
 
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
+  # Add ABI-specific directories to the system library path.
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
 
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
 
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+  fi
 
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
 
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
 
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
 
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
 
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_GCJ
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
 
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
 
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
+rdos*)
+  dynamic_linker=no
+  ;;
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
 
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_GCJ"
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
 
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_GCJ
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
 
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
 
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
 
-# ### END LIBTOOL TAG CONFIG: $tagname
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
 
-__EOF__
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
 
 
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
 
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC="$lt_save_CC"
 
-	else
-	  tagname=""
-	fi
-	;;
 
-      RC)
 
 
 
-# Source file extension for RC test sources.
-ac_ext=rc
 
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
 
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
 
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
 
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
 
 
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_RC \
-    CC_RC \
-    LD_RC \
-    lt_prog_compiler_wl_RC \
-    lt_prog_compiler_pic_RC \
-    lt_prog_compiler_static_RC \
-    lt_prog_compiler_no_builtin_flag_RC \
-    export_dynamic_flag_spec_RC \
-    thread_safe_flag_spec_RC \
-    whole_archive_flag_spec_RC \
-    enable_shared_with_static_runtimes_RC \
-    old_archive_cmds_RC \
-    old_archive_from_new_cmds_RC \
-    predep_objects_RC \
-    postdep_objects_RC \
-    predeps_RC \
-    postdeps_RC \
-    compiler_lib_search_path_RC \
-    archive_cmds_RC \
-    archive_expsym_cmds_RC \
-    postinstall_cmds_RC \
-    postuninstall_cmds_RC \
-    old_archive_from_expsyms_cmds_RC \
-    allow_undefined_flag_RC \
-    no_undefined_flag_RC \
-    export_symbols_cmds_RC \
-    hardcode_libdir_flag_spec_RC \
-    hardcode_libdir_flag_spec_ld_RC \
-    hardcode_libdir_separator_RC \
-    hardcode_automatic_RC \
-    module_cmds_RC \
-    module_expsym_cmds_RC \
-    lt_cv_prog_compiler_c_o_RC \
-    exclude_expsyms_RC \
-    include_expsyms_RC; do
-
-    case $var in
-    old_archive_cmds_RC | \
-    old_archive_from_new_cmds_RC | \
-    archive_cmds_RC | \
-    archive_expsym_cmds_RC | \
-    module_cmds_RC | \
-    module_expsym_cmds_RC | \
-    old_archive_from_expsyms_cmds_RC | \
-    export_symbols_cmds_RC | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
 
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
 
-cfgfile="$ofile"
 
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
 
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
 
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
 
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
 
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
 
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
 
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
 
-# A C compiler.
-LTCC=$lt_LTCC
 
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+   test -n "$runpath_var_CXX" ||
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
 
-# A language-specific compiler.
-CC=$lt_compiler_RC
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
 
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
+if test "$hardcode_action_CXX" = relink ||
+   test "$inherit_rpath_CXX" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
 
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
 
-# An ERE matcher.
-EGREP=$lt_EGREP
 
-# The linker used to build libraries.
-LD=$lt_LD_RC
 
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
 
-# A BSD-compatible nm program.
-NM=$lt_NM
 
-# A symbol stripping program
-STRIP=$lt_STRIP
 
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
+  fi # test -n "$compiler"
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-# Used on cygwin: assembler.
-AS="$AS"
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
 
-# Old archive suffix (normally "a").
-libext="$libext"
 
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
 
-# Executable file suffix (normally "").
-exeext="$exeext"
 
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
 
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
 
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
 
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
 
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
 
-# Do we need a version for libraries?
-need_version=$need_version
 
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
+        ac_config_commands="$ac_config_commands libtool"
 
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
 
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
 
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
 
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+# Only expand once:
 
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
 
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
 
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
 
-# Library versioning type.
-version_type=$version_type
+# Checks for libraries.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
+$as_echo_n "checking for pow in -lm... " >&6; }
+if ${ac_cv_lib_m_pow+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_pow=yes
+else
+  ac_cv_lib_m_pow=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
+$as_echo "$ac_cv_lib_m_pow" >&6; }
+if test "x$ac_cv_lib_m_pow" = xyes; then :
+  LIBS="$LIBS -lm"
+fi
 
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
+$as_echo_n "checking for socket in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_socket+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_socket_socket=yes
+else
+  ac_cv_lib_socket_socket=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
+$as_echo "$ac_cv_lib_socket_socket" >&6; }
+if test "x$ac_cv_lib_socket_socket" = xyes; then :
+  LIBS="$LIBS -lsocket"
+fi
 
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnsl" >&5
+$as_echo_n "checking for inet_ntoa in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_inet_ntoa+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntoa ();
+int
+main ()
+{
+return inet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_nsl_inet_ntoa=yes
+else
+  ac_cv_lib_nsl_inet_ntoa=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntoa" >&5
+$as_echo "$ac_cv_lib_nsl_inet_ntoa" >&6; }
+if test "x$ac_cv_lib_nsl_inet_ntoa" = xyes; then :
+  LIBS="$LIBS -lnsl"
+fi
 
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
 
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
+# Checks for header files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
+int
+main ()
+{
 
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+fi
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
 
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
+fi
 
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
 
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
 
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
 
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+fi
 
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+for ac_header in limits.h string.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+fi
 
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
+done
 
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
 
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
+int
+main ()
+{
 
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this sort of thing.  */
+  typedef int charset[2];
+  const charset cs = { 0, 0 };
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *pcpcc;
+  char **ppc;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  pcpcc = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
 
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+    *t++ = 0;
+    if (s) return 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+    if (!foo) return 0;
+  }
+  return !cs[0] && !zero.x;
+#endif
 
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_const=yes
+else
+  ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
 
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+$as_echo "#define const /**/" >>confdefs.h
 
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
+fi
 
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
 
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
 
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_RC
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
 
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
 
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
 
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+else
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_RC"
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
 
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
+fi
 
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
 
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
+# Checks for library functions.
+for ac_func in floor pow sqrt isinf isnan
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
+fi
+done
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
 
-# ### END LIBTOOL TAG CONFIG: $tagname
 
-__EOF__
 
 
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
 
 
-ac_ext=c
+    ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC="$lt_save_CC"
-
-	;;
-
-      *)
-	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
-echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
-   { (exit 1); exit 1; }; }
-	;;
-      esac
 
-      # Append the new tag name to the list of available tags.
-      if test -n "$tagname" ; then
-      available_tags="$available_tags $tagname"
-    fi
-    fi
-  done
-  IFS="$lt_save_ifs"
+    ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "#include <string.h>
+"
+if test "x$ac_cv_have_decl_strdup" = xyes; then :
 
-  # Now substitute the updated list of available tags.
-  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
-    mv "${ofile}T" "$ofile"
-    chmod +x "$ofile"
-  else
-    rm -f "${ofile}T"
-    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
-echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
-   { (exit 1); exit 1; }; }
-  fi
 fi
 
 
+    eso_save_CFLAGS="$CFLAGS"
 
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+    if test x"$GCC" = xyes; then
+        CFLAGS="$CFLAGS -pedantic-errors"
+    fi
 
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+    ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
+if test "x$ac_cv_func_strdup" = xyes; then :
 
-# Prevent multiple expansion
+fi
 
 
+    CFLAGS="$eso_save_CFLAGS"
 
+    ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+    if test x"$ac_cv_have_decl_strdup" = xyes &&
+       test x"$ac_cv_func_strdup" = xyes; then
+        $as_echo "#define HAVE_STRDUP 1" >>confdefs.h
 
+    fi
 
 
 
 
 
 
+# Check for libraries
 
 
 
 
 
 
+    flag=`echo pthread | sed 'y%.=/+-%___p_%'`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -pthread" >&5
+$as_echo_n "checking whether $CC supports -pthread... " >&6; }
+if eval \${eso_cv_prog_cc_$flag+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                       eval "eso_cv_prog_cc_$flag=no"
+                       ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+                       echo 'int main() { return 0; }' >conftest.$ac_ext
 
-# Checks for libraries.
-echo "$as_me:$LINENO: checking for pow in -lm" >&5
-echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6
-if test "${ac_cv_lib_m_pow+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+                       try_compile="`$CC -pthread -c conftest.$ac_ext 2>&1`"
+                       if test -z "$try_compile"; then
+                           try_link="`$CC -pthread -o conftest$ac_exeext \
+                                    conftest.$ac_ext 2>&1`"
+                           if test -z "$try_link"; then
+                               eval "eso_cv_prog_cc_$flag=yes"
+                           fi
+                       fi
+                       rm -f conftest*
+
+                       ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char pow ();
-int
-main ()
-{
-pow ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_m_pow=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_m_pow=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
-echo "${ECHO_T}$ac_cv_lib_m_pow" >&6
-if test $ac_cv_lib_m_pow = yes; then
-  LIBS="$LIBS -lm"
 fi
+eval ac_res=\$eso_cv_prog_cc_$flag
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
-echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
-echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6
-if test "${ac_cv_lib_socket_socket+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+    if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
+        :
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char socket ();
-int
-main ()
-{
-socket ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_socket_socket=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    else
+        :
+
+    fi
 
-ac_cv_lib_socket_socket=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6
-if test $ac_cv_lib_socket_socket = yes; then
-  LIBS="$LIBS -lsocket"
-fi
 
-echo "$as_me:$LINENO: checking for inet_ntoa in -lnsl" >&5
-echo $ECHO_N "checking for inet_ntoa in -lnsl... $ECHO_C" >&6
-if test "${ac_cv_lib_nsl_inet_ntoa+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char inet_ntoa ();
+char pthread_create ();
 int
 main ()
 {
-inet_ntoa ();
+return pthread_create ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_nsl_inet_ntoa=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_create=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_nsl_inet_ntoa=no
+  ac_cv_lib_pthread_pthread_create=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_inet_ntoa" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_inet_ntoa" >&6
-if test $ac_cv_lib_nsl_inet_ntoa = yes; then
-  LIBS="$LIBS -lnsl"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
+  eso_threads_have_libpthread=yes
+else
+  eso_threads_have_libpthread=no
 fi
 
 
-# Checks for header files.
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+  eso_threads_have_pthread_h=yes
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
+  eso_threads_have_pthread_h=no
+fi
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test x"$eso_threads_have_pthread_h" != xyes; then
+        eso_threads_posix=no
+    else
+        if test x"$eso_threads_have_libpthread" != xyes && \
+          test x"$eso_cv_prog_cc_pthread" != xyes; then
+            eso_threads_posix=no
+        else
+            eso_threads_posix=yes
+        fi
+    fi
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
+    # Setup the POSIX thread symbols
 
-fi
+    if test x"$eso_threads_have_pthread_h" = xyes; then
 
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
+$as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
+    fi
+
+    if test x"$eso_threads_posix" = xyes; then
+
+        if test x"$eso_cv_prog_cc_pthread" = xyes; then
+            PTHREAD_CFLAGS="-pthread"
+        else
+            PTHREAD_CFLAGS=""
+        fi
+
+        if test x"$eso_threads_have_libpthread" = xyes; then
+            LIBPTHREAD="-lpthread"
+        else
+            LIBPTHREAD=""
+        fi
+
+    fi
+
+    if ${eso_cv_threads_posix_header+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_header_stdc=no
+  eso_cv_threads_posix_header=$eso_threads_have_pthread_h
 fi
-rm -f conftest*
 
+    if ${eso_cv_threads_posix_lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eso_cv_threads_posix_lib=$eso_threads_have_libpthread
 fi
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
+    if ${eso_cv_threads_posix_flags+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
+  eso_cv_threads_posix_flags=$eso_cv_prog_cc_pthread
+fi
 
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
+    if ${eso_cv_threads_posix+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
+  eso_cv_threads_posix=$eso_threads_posix
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+
+
+
+
+
+
+
+
+
+    cpl_cfitsio_check_version=""
+    cpl_cfitsio_check_header="fitsio.h"
+    cpl_cfitsio_check_lib="libcfitsio.a"
+
+    cpl_cfitsio_incdirs=""
+    cpl_cfitsio_libdirs=""
+    cpl_cfitsio_includes=""
+    cpl_cfitsio_libraries=""
+
+
+# Check whether --with-cfitsio was given.
+if test "${with_cfitsio+set}" = set; then :
+  withval=$with_cfitsio;
+                    cpl_with_cfitsio=$withval
 
 fi
 
 
 
-for ac_header in limits.h string.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+# Check whether --with-cfitsio-includes was given.
+if test "${with_cfitsio_includes+set}" = set; then :
+  withval=$with_cfitsio_includes; cpl_with_cfitsio_includes=$withval
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+
+
+# Check whether --with-cfitsio-libs was given.
+if test "${with_cfitsio_libs+set}" = set; then :
+  withval=$with_cfitsio_libs; cpl_with_cfitsio_libs=$withval
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
+
+    # Check whether --enable-cfitsio-test was given.
+if test "${enable_cfitsio_test+set}" = set; then :
+  enableval=$enable_cfitsio_test; cpl_enable_cfitsio_test=$enableval
 else
-  ac_cpp_err=yes
+  cpl_enable_cfitsio_test=yes
 fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to usd-help at eso.org ##
-## ------------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+    # We need libpthread for the folloing tests
+
+    if test -z "$LIBPTHREAD"; then
+        as_fn_error $? "POSIX thread library was not found on your system! Please check!" "$LINENO" 5
+    fi
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cfitsio" >&5
+$as_echo_n "checking for cfitsio... " >&6; }
+
+    if test "x$cpl_enable_cfitsio_test" = xyes; then
+
+        # Check for the cfitsio includes
+
+        if test -z "$cpl_with_cfitsio_includes"; then
+
+            if test -z "$cpl_with_cfitsio"; then
+
+                # Try some known system locations
+
+                cpl_cfitsio_incdirs="/opt/cfitsio/include"
+                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/local/include/libcfitsio0"
+                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/local/include/cfitsio"
+                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/local/include"
+                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/include/libcfitsio0"
+                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/include/cfitsio"
+                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/include"
+
+                test -n "$CFITSIODIR" && \
+                    cpl_cfitsio_incdirs="$CFITSIODIR/include/libcfitsio0 \
+                                         $CFITSIODIR/include/cfitsio \
+                                         $CFITSIODIR/include \
+                                         $cpl_cfitsio_incdirs"
+
+                test -n "$CPLDIR" && \
+                    cpl_cfitsio_incdirs="$CPLDIR/include/libcfitsio0 \
+                                         $CPLDIR/include/cfitsio \
+                                         $CPLDIR/include \
+                                         $cpl_cfitsio_incdirs"
+
+            else
+
+                cpl_cfitsio_incdirs="$cpl_with_cfitsio/include/libcfitsio0"
+                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs $cpl_with_cfitsio/include/cfitsio"
+                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs $cpl_with_cfitsio/include"
+
+            fi
+
+        else
+            cpl_cfitsio_incdirs="$cpl_with_cfitsio_includes"
+        fi
+
+
+    cpl_cfitsio_includes=no
+
+    for i in $cpl_cfitsio_incdirs; do
+        for j in $cpl_cfitsio_check_header; do
+
+            echo "configure: 17633: $i/$j" >&5
+
+            if test -r "$i/$j"; then
+                echo "taking that" >&5
+                cpl_cfitsio_includes=$i
+                break 2
+            fi
+        done
+    done
+
+
+
+        # Check for the cfitsio library
 
-fi
+        if test -z "$cpl_with_cfitsio_libs"; then
 
-done
+            if test -z "$cpl_with_cfitsio"; then
 
+                # Try some known system locations
 
-# Checks for typedefs, structures, and compiler characteristics.
-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
-if test "${ac_cv_c_const+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+                cpl_cfitsio_libdirs="/opt/cfitsio/lib"
+                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/local/lib64"
+                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/local/lib"
+                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/local/lib32"
+                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib64"
+                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib"
+                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib32"
 
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
-  typedef int charset[2];
-  const charset x;
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *ccp;
-  char **p;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  ccp = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++ccp;
-  p = (char**) ccp;
-  ccp = (char const *const *) p;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
+                test -n "$CFITSIODIR" && \
+                    cpl_cfitsio_libdirs="$CFITSIODIR/lib64 $CFITSIODIR/lib \
+                                         $CFITSIODIR/lib32 $cpl_cfitsio_libdirs"
 
-    *t++ = 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-  }
-#endif
+                test -n "$CPLDIR" && \
+                    cpl_cfitsio_libdirs="$CPLDIR/lib64 $CPLDIR/lib $CPLDIR/lib32 \
+                                         $cpl_cfitsio_libdirs"
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_const=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+            else
 
-ac_cv_c_const=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
-if test $ac_cv_c_const = no; then
+                cpl_cfitsio_libdirs="$cpl_with_cfitsio/lib64"
+                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs $cpl_with_cfitsio/lib"
+                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs $cpl_with_cfitsio/lib32"
 
-cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
+            fi
 
-fi
+        else
+            cpl_cfitsio_libdirs="$cpl_with_cfitsio_libs"
+        fi
 
-echo "$as_me:$LINENO: checking for inline" >&5
-echo $ECHO_N "checking for inline... $ECHO_C" >&6
-if test "${ac_cv_c_inline+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
 
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_inline=$ac_kw; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    cpl_cfitsio_libraries=no
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
+    for i in $cpl_cfitsio_libdirs; do
+        for j in $cpl_cfitsio_check_lib; do
 
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
-echo "${ECHO_T}$ac_cv_c_inline" >&6
+            echo "configure: 17687: $i/$j" >&5
 
+            if test -r "$i/$j"; then
+                echo "taking that" >&5
+                cpl_cfitsio_libraries=$i
+                break 2
+            fi
+        done
+    done
 
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
-    ;;
-esac
 
 
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
-if test "${ac_cv_type_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((size_t *) 0)
-  return 0;
-if (sizeof (size_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_size_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+        if test x"$cpl_cfitsio_includes" = xno || \
+            test x"$cpl_cfitsio_libraries" = xno; then
+            cpl_cfitsio_notfound=""
 
-ac_cv_type_size_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6
-if test $ac_cv_type_size_t = yes; then
-  :
-else
+            if test x"$cpl_cfitsio_includes" = xno; then
+                if test x"$cpl_cfitsio_libraries" = xno; then
+                    cpl_cfitsio_notfound="(headers and libraries)"
+                else
+                    cpl_cfitsio_notfound="(headers)"
+                fi
+            else
+                cpl_cfitsio_notfound="(libraries)"
+            fi
 
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned
-_ACEOF
+            as_fn_error $? "cfitsio $cpl_cfitsio_notfound was not found on your system. Please check!" "$LINENO" 5
+        else
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $cpl_cfitsio_libraries, headers $cpl_cfitsio_includes" >&5
+$as_echo "libraries $cpl_cfitsio_libraries, headers $cpl_cfitsio_includes" >&6; }
+        fi
 
-fi
+        # Set up the symbols
 
+        # Add '-lz' to the static library symbol, as distributors apparently
+        # remove the libz code from the cfitsio sources.
 
-# Checks for library functions.
+        CFITSIO_INCLUDES="-I$cpl_cfitsio_includes"
+        CFITSIO_LDFLAGS="-L$cpl_cfitsio_libraries"
+        LIBCFITSIO="-lcfitsio"
+        LIBCFITSIO_STATIC="$cpl_cfitsio_libraries/$cpl_cfitsio_check_lib"
 
+        # Do not add redundant libraries
+        echo $LIBS | grep -q -e '-lm' || LIBS="-lm $LIBS"
 
 
+        # Check whether cfitsio can be used
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cfitsio can be used" >&5
+$as_echo_n "checking whether cfitsio can be used... " >&6; }
+        ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-for ac_func in floor pow sqrt isinf isnan
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+        cpl_cfitsio_cflags_save="$CFLAGS"
+        cpl_cfitsio_ldflags_save="$LDFLAGS"
+        cpl_cfitsio_libs_save="$LIBS"
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+        CFLAGS="$CFITSIO_INCLUDES $CFLAGS"
+        LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS"
+        LIBS="$LIBCFITSIO_STATIC $LIBPTHREAD -lm"
 
-#undef $ac_func
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
+                       #include <fitsio.h>
 
 int
 main ()
 {
-return f != $ac_func;
+
+                       float v;
+                       fits_get_version(&v);
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+if ac_fn_c_try_link "$LINENO"; then :
+  cpl_cfitsio_is_usable="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
+  cpl_cfitsio_is_usable="no"
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-fi
-done
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpl_cfitsio_is_usable" >&5
+$as_echo "$cpl_cfitsio_is_usable" >&6; }
 
+        ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+        CFLAGS="$cpl_cfitsio_cflags_save"
+        LDFLAGS="$cpl_cfitsio_ldflags_save"
+        LIBS="$cpl_cfitsio_libs_save"
 
+        if test x"$cpl_cfitsio_is_usable" = xno; then
+            as_fn_error $? "Linking with cfitsio failed! Please check architecture!" "$LINENO" 5
+        fi
 
 
+        # Check cfitsio version
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a cfitsio version >= $cpl_cfitsio_check_version" >&5
+$as_echo_n "checking for a cfitsio version >= $cpl_cfitsio_check_version... " >&6; }
 
-    ac_ext=c
+        ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-    echo "$as_me:$LINENO: checking whether strdup is declared" >&5
-echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6
-if test "${ac_cv_have_decl_strdup+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+        cpl_cfitsio_cflags_save="$CFLAGS"
+        cpl_cfitsio_ldflags_save="$LDFLAGS"
+        cpl_cfitsio_libs_save="$LIBS"
+
+        CFLAGS="$CFITSIO_INCLUDES $CFLAGS"
+        LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS"
+        LIBS="$LIBCFITSIO_STATIC $LIBPTHREAD -lm"
+
+        if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <string.h>
+
+                      #include <stdio.h>
+                      #include <fitsio.h>
 
 int
 main ()
 {
-#ifndef strdup
-  char *p = (char *) strdup;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_have_decl_strdup=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_have_decl_strdup=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5
-echo "${ECHO_T}$ac_cv_have_decl_strdup" >&6
 
+                      int vlib = 0;
+                      int vmin = (int)(1000. * $cpl_cfitsio_check_version + 0.5);
 
-    eso_save_CFLAGS="$CFLAGS"
-
-    if test x"$GCC" = xyes; then
-        CFLAGS="$CFLAGS -pedantic-errors"
-    fi
-
-    echo "$as_me:$LINENO: checking for strdup" >&5
-echo $ECHO_N "checking for strdup... $ECHO_C" >&6
-if test "${ac_cv_func_strdup+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define strdup to an innocuous variant, in case <limits.h> declares strdup.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define strdup innocuous_strdup
+                      float v;
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char strdup (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+                      fits_get_version(&v);
+                      vlib = (int)(v * 1000 + 0.5);
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+                      FILE* f = fopen("conftest.out", "w");
+                      fprintf(f, "%5.3f\n", v);
+                      fclose(f);
 
-#undef strdup
+                      if (vlib < vmin) {
+                          return 1;
+                      }
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char strdup ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_strdup) || defined (__stub___strdup)
-choke me
-#else
-char (*f) () = strdup;
-#endif
-#ifdef __cplusplus
-}
-#endif
+                      return 0;
 
-int
-main ()
-{
-return f != strdup;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_strdup=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  cpl_cfitsio_version="`cat conftest.out`"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_strdup=no
+                       cpl_cfitsio_version="no";
+                       cpl_cfitsio_version_found="`cat conftest.out`"
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_strdup" >&5
-echo "${ECHO_T}$ac_cv_func_strdup" >&6
 
 
-    CFLAGS="$eso_save_CFLAGS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpl_cfitsio_version" >&5
+$as_echo "$cpl_cfitsio_version" >&6; }
 
-    ac_ext=c
+        ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-    if test x"$ac_cv_have_decl_strdup" = xyes &&
-       test x"$ac_cv_func_strdup" = xyes; then
-        cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRDUP 1
-_ACEOF
+        CFLAGS="$cpl_cfitsio_cflags_save"
+        LDFLAGS="$cpl_cfitsio_ldflags_save"
+        LIBS="$cpl_cfitsio_libs_save"
+
+        if test x"$cpl_cfitsio_version" = xno; then
+            as_fn_error $? "Installed cfitsio ($cpl_cfitsio_version_found) is too old. Please update to version $cpl_cfitsio_check_version or newer." "$LINENO" 5
+        fi
+
+
+        # Check whether cfitsio has large file support
+
+        ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-    fi
 
+        cpl_cfitsio_cflags_save="$CFLAGS"
+        cpl_cfitsio_ldflags_save="$LDFLAGS"
+        cpl_cfitsio_libs_save="$LIBS"
 
+        CFLAGS="$CFITSIO_INCLUDES $CFLAGS"
+        LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS"
+        LIBS="$LIBCFITSIO_STATIC -lm $LIBPTHREAD"
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cfitsio provides fits_hdu_getoff()" >&5
+$as_echo_n "checking whether cfitsio provides fits_hdu_getoff()... " >&6; }
 
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+                          #include <fitsio.h>
 
+int
+main ()
+{
 
-# Check for libraries
+                          fitsfile f;
+                          int sts;
+                          fits_get_hduoff(&f, NULL, NULL, NULL, &sts);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cpl_cfitsio_have_fits_get_hduoff="yes"
+else
+  cpl_cfitsio_have_fits_get_hduoff="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpl_cfitsio_have_fits_get_hduoff" >&5
+$as_echo "$cpl_cfitsio_have_fits_get_hduoff" >&6; }
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cfitsio provides fits_get_hduaddrll()" >&5
+$as_echo_n "checking whether cfitsio provides fits_get_hduaddrll()... " >&6; }
 
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+                          #include <fitsio.h>
 
+int
+main ()
+{
 
-    flag=`echo pthread | sed 'y%.=/+-%___p_%'`
-    echo "$as_me:$LINENO: checking whether $CC supports -pthread" >&5
-echo $ECHO_N "checking whether $CC supports -pthread... $ECHO_C" >&6
-if eval "test \"\${eso_cv_prog_cc_$flag+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+                          fitsfile f;
+                          int sts;
+                          fits_get_hduaddrll(&f, NULL, NULL, NULL, &sts);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cpl_cfitsio_have_fits_get_hduaddrll="yes"
 else
+  cpl_cfitsio_have_fits_get_hduaddrll="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-                       eval "eso_cv_prog_cc_$flag=no"
-                       ac_ext=c
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpl_cfitsio_have_fits_get_hduaddrll" >&5
+$as_echo "$cpl_cfitsio_have_fits_get_hduaddrll" >&6; }
+
+        ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-                       echo 'int main() { return 0; }' >conftest.$ac_ext
+        CFLAGS="$cpl_cfitsio_cflags_save"
+        LDFLAGS="$cpl_cfitsio_ldflags_save"
+        LIBS="$cpl_cfitsio_libs_save"
 
-                       try_compile="`$CC -pthread -c conftest.$ac_ext 2>&1`"
-                       if test -z "$try_compile"; then
-                           try_link="`$CC -pthread -o conftest$ac_exeext \
-                                    conftest.$ac_ext 2>&1`"
-                           if test -z "$try_link"; then
-                               eval "eso_cv_prog_cc_$flag=yes"
-                           fi
-                       fi
-                       rm -f conftest*
 
-                       ac_ext=c
+        # Check whether cfitsio is thread-safe
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cfitsio requires libpthread" >&5
+$as_echo_n "checking whether cfitsio requires libpthread... " >&6; }
+        ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'eso_cv_prog_cc_$flag'}'`" >&5
-echo "${ECHO_T}`eval echo '${'eso_cv_prog_cc_$flag'}'`" >&6
-
-    if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then
-        :
+        cpl_cfitsio_cflags_save="$CFLAGS"
+        cpl_cfitsio_ldflags_save="$LDFLAGS"
+        cpl_cfitsio_libs_save="$LIBS"
 
-    else
-        :
+        CFLAGS="$CFITSIO_INCLUDES $CFLAGS"
+        LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS"
+        LIBS="$LIBCFITSIO_STATIC -lm"
 
-    fi
 
+        cpl_cfitsio_provides_pthread="no"
 
-    echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
-if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char pthread_create ();
+                       #include <fitsio.h>
+
 int
 main ()
 {
-pthread_create ();
+
+                       float v;
+                       fits_get_version(&v);
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_pthread_pthread_create=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_pthread_pthread_create=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
-if test $ac_cv_lib_pthread_pthread_create = yes; then
-  eso_threads_have_libpthread=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  cpl_cfitsio_requires_pthread="no"
 else
-  eso_threads_have_libpthread=no
+  cpl_cfitsio_requires_pthread="undefined"
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
+		if test x"$cpl_cfitsio_requires_pthread" = xno; then
 
-    if test "${ac_cv_header_pthread_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for pthread.h" >&5
-echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
-if test "${ac_cv_header_pthread_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
-echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking pthread.h usability" >&5
-echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	    	# If libpthread is not required this means either cfitsio is
+    		# not compiled with thread support, or the library dependencies
+    		# are compiled into cfitsio.
+
+			# Check whether shared library dependencies are present
+			# Don't use pthread_mutex_init/destroy here, since glibc
+			# provides these symbols too! Sigh!
+
+	        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
-#include <pthread.h>
+
+	    	               #include <pthread.h>
+    	    	           #include <fitsio.h>
+
+int
+main ()
+{
+
+	                	   float v;
+    	            	   pthread_mutexattr_t attrb;
+    	            	   pthread_mutexattr_init(&attrb);
+            	           fits_get_version(&v);
+                		   pthread_mutexattr_destroy(&attrb);
+
+  ;
+  return 0;
+}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  cpl_cfitsio_provides_pthread="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  cpl_cfitsio_provides_pthread="no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+        else
 
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+            LIBS="$LIBCFITSIO_STATIC -lm $LIBPTHREAD"
 
-# Is the header present?
-echo "$as_me:$LINENO: checking pthread.h presence" >&5
-echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <pthread.h>
+
+                           #include <fitsio.h>
+
+int
+main ()
+{
+
+                           float v;
+                           fits_get_version(&v);
+
+  ;
+  return 0;
+}
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
+if ac_fn_c_try_link "$LINENO"; then :
+  cpl_cfitsio_requires_pthread="yes"
 else
-  ac_cpp_err=yes
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Cannot link with cfitsio! Please check!
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+        fi
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pthread.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: pthread.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to usd-help at eso.org ##
-## ------------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for pthread.h" >&5
-echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
-if test "${ac_cv_header_pthread_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header_pthread_h=$ac_header_preproc
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
-echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpl_cfitsio_requires_pthread" >&5
+$as_echo "$cpl_cfitsio_requires_pthread" >&6; }
 
-fi
-if test $ac_cv_header_pthread_h = yes; then
-  eso_threads_have_pthread_h=yes
-else
-  eso_threads_have_pthread_h=no
-fi
+        ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+        CFLAGS="$cpl_cfitsio_cflags_save"
+        LDFLAGS="$cpl_cfitsio_ldflags_save"
+        LIBS="$cpl_cfitsio_libs_save"
 
-    if test x"$eso_threads_have_pthread_h" != xyes; then
-        eso_threads_posix=no
-    else
-        if test x"$eso_threads_have_libpthread" != xyes && \
-          test x"$eso_cv_prog_cc_pthread" != xyes; then
-            eso_threads_posix=no
-        else
-            eso_threads_posix=yes
-        fi
-    fi
 
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cfitsio was compiled with thread support" >&5
+$as_echo_n "checking whether cfitsio was compiled with thread support... " >&6; }
 
-    # Setup the POSIX thread symbols
+		if test x"$cpl_cfitsio_requires_pthread" = xyes || \
+			test x"$cpl_cfitsio_provides_pthread" = xyes; then
+			cpl_cfitsio_is_thread_safe=yes
+		else
+			cpl_cfitsio_is_thread_safe=no
+		fi
 
-    if test x"$eso_threads_have_pthread_h" = xyes; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpl_cfitsio_is_thread_safe" >&5
+$as_echo "$cpl_cfitsio_is_thread_safe" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PTHREAD_H 1
-_ACEOF
 
-    fi
+        # Set compiler flags and libraries
 
-    if test x"$eso_threads_posix" = xyes; then
+        if test x"$cpl_cfitsio_have_fits_get_hduoff" = xyes || \
+          test x"$cpl_cfitsio_have_fits_get_hduaddrll" = xyes; then
+
+            CFLAGS="-D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 $CFLAGS"
+
+            if test x"$cpl_cfitsio_have_fits_get_hduoff"; then
+
+$as_echo "#define HAVE_FITS_GET_HDUOFF 1" >>confdefs.h
+
+            else
+
+$as_echo "#define HAVE_FITS_GET_HDUADDRLL 1" >>confdefs.h
+
+            fi
 
-        if test x"$eso_cv_prog_cc_pthread" = xyes; then
-            PTHREAD_CFLAGS="-pthread"
-        else
-            PTHREAD_CFLAGS=""
         fi
 
-        if test x"$eso_threads_have_libpthread" = xyes; then
-            LIBPTHREAD="-lpthread"
-        else
-            LIBPTHREAD=""
+        if test x"$cpl_cfitsio_requires_pthread" = xyes; then
+            echo $LIBS | grep -q -e "$LIBPTHREAD" || LIBS="$LIBPTHREAD $LIBS"
         fi
 
+    else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cfitsio checks have been disabled! This package may not build!" >&5
+$as_echo "$as_me: WARNING: cfitsio checks have been disabled! This package may not build!" >&2;}
+        CFITSIO_INCLUDES=""
+        CFITSIO_LDFLAGS=""
+        LIBCFITSIO=""
+
+        cpl_cfitsio_is_thread_safe="undefined"
+        cpl_cfitsio_requires_pthread="undefined"
     fi
 
-    if test "${eso_cv_threads_posix_header+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+	if ${cpl_cv_cfitsio_requires_pthread+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  eso_cv_threads_posix_header=$eso_threads_have_pthread_h
+  cpl_cv_cfitsio_requires_pthread=$cpl_cfitsio_requires_pthread
 fi
 
-    if test "${eso_cv_threads_posix_lib+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+	if ${cpl_cv_cfitsio_is_thread_safe+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  eso_cv_threads_posix_lib=$eso_threads_have_libpthread
+  cpl_cv_cfitsio_is_thread_safe=$cpl_cfitsio_is_thread_safe
 fi
 
-    if test "${eso_cv_threads_posix_flags+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eso_cv_threads_posix_flags=$eso_cv_prog_cc_pthread
-fi
 
-    if test "${eso_cv_threads_posix+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eso_cv_threads_posix=$eso_threads_posix
-fi
 
 
 
@@ -21854,115 +18173,88 @@ fi
 
 
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CPL" >&5
+$as_echo_n "checking for CPL... " >&6; }
 
+    cpl_check_cpl_header="cpl.h"
+    cpl_check_cpl_lib="libcplcore.a"
 
+    cpl_incdirs=""
+    cpl_libdirs=""
+    cpl_includes=""
+    cpl_libraries=""
 
-    cpl_cfitsio_check_version=""
-    cpl_cfitsio_check_header="fitsio.h"
-    cpl_cfitsio_check_lib="libcfitsio.a"
 
-    cpl_cfitsio_incdirs=""
-    cpl_cfitsio_libdirs=""
-    cpl_cfitsio_includes=""
-    cpl_cfitsio_libraries=""
+# Check whether --with-cpl was given.
+if test "${with_cpl+set}" = set; then :
+  withval=$with_cpl;
+                    cpl_with_cpl=$withval
 
+fi
 
-# Check whether --with-cfitsio or --without-cfitsio was given.
-if test "${with_cfitsio+set}" = set; then
-  withval="$with_cfitsio"
 
-                    cpl_with_cfitsio=$withval
 
-fi;
+# Check whether --with-cpl-includes was given.
+if test "${with_cpl_includes+set}" = set; then :
+  withval=$with_cpl_includes; cpl_with_cpl_includes=$withval
+fi
 
 
-# Check whether --with-cfitsio-includes or --without-cfitsio-includes was given.
-if test "${with_cfitsio_includes+set}" = set; then
-  withval="$with_cfitsio_includes"
-  cpl_with_cfitsio_includes=$withval
-fi;
 
+# Check whether --with-cpl-libs was given.
+if test "${with_cpl_libs+set}" = set; then :
+  withval=$with_cpl_libs; cpl_with_cpl_libs=$withval
+fi
 
-# Check whether --with-cfitsio-libs or --without-cfitsio-libs was given.
-if test "${with_cfitsio_libs+set}" = set; then
-  withval="$with_cfitsio_libs"
-  cpl_with_cfitsio_libs=$withval
-fi;
 
-    # Check whether --enable-cfitsio-test or --disable-cfitsio-test was given.
-if test "${enable_cfitsio_test+set}" = set; then
-  enableval="$enable_cfitsio_test"
-  cpl_enable_cfitsio_test=$enableval
+    # Check whether --enable-cpl-test was given.
+if test "${enable_cpl_test+set}" = set; then :
+  enableval=$enable_cpl_test; cpl_enable_cpl_test=$enableval
 else
-  cpl_enable_cfitsio_test=yes
-fi;
-
-
-    # We need libpthread for the folloing tests
-
-    if test -z "$LIBPTHREAD"; then
-        { { echo "$as_me:$LINENO: error: POSIX thread library was not found on your system! Please check!" >&5
-echo "$as_me: error: POSIX thread library was not found on your system! Please check!" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
+  cpl_enable_cpl_test=yes
+fi
 
 
-    echo "$as_me:$LINENO: checking for cfitsio" >&5
-echo $ECHO_N "checking for cfitsio... $ECHO_C" >&6
 
-    if test "x$cpl_enable_cfitsio_test" = xyes; then
+    if test "x$cpl_enable_cpl_test" = xyes; then
 
-        # Check for the cfitsio includes
+        # Check for the CPL includes
 
-        if test -z "$cpl_with_cfitsio_includes"; then
+        if test -z "$cpl_with_cpl_includes"; then
 
-            if test -z "$cpl_with_cfitsio"; then
+            if test -z "$cpl_with_cpl"; then
 
                 # Try some known system locations
 
-                cpl_cfitsio_incdirs="/opt/cfitsio/include"
-                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/local/include/libcfitsio0"
-                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/local/include/cfitsio"
-                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/local/include"
-                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/include/libcfitsio0"
-                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/include/cfitsio"
-                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/include"
-
-                test -n "$CFITSIODIR" && \
-                    cpl_cfitsio_incdirs="$CFITSIODIR/include/libcfitsio0 \
-                                         $CFITSIODIR/include/cfitsio \
-                                         $CFITSIODIR/include \
-                                         $cpl_cfitsio_incdirs"
+                cpl_incdirs="/opt/cpl/include"
+                cpl_incdirs="$cpl_incdirs /usr/local/include"
+                cpl_incdirs="$cpl_incdirs /usr/include"
 
                 test -n "$CPLDIR" && \
-                    cpl_cfitsio_incdirs="$CPLDIR/include/libcfitsio0 \
-                                         $CPLDIR/include/cfitsio \
-                                         $CPLDIR/include \
-                                         $cpl_cfitsio_incdirs"
+                    cpl_incdirs="$CPLDIR/include \
+                                 $cpl_incdirs"
 
             else
 
-                cpl_cfitsio_incdirs="$cpl_with_cfitsio/include/libcfitsio0"
-                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs $cpl_with_cfitsio/include/cfitsio"
-                cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs $cpl_with_cfitsio/include"
+                cpl_incdirs="$cpl_with_cpl/include"
 
             fi
 
         else
-            cpl_cfitsio_incdirs="$cpl_with_cfitsio_includes"
+            cpl_incdirs="$cpl_with_cpl_includes"
         fi
 
 
-    cpl_cfitsio_includes=no
+    cpl_includes=no
 
-    for i in $cpl_cfitsio_incdirs; do
-        for j in $cpl_cfitsio_check_header; do
+    for i in $cpl_incdirs; do
+        for j in $cpl_check_cpl_header; do
 
-            echo "configure: 21961: $i/$j" >&5
+            echo "configure: 18253: $i/$j" >&5
 
             if test -r "$i/$j"; then
                 echo "taking that" >&5
-                cpl_cfitsio_includes=$i
+                cpl_includes=$i
                 break 2
             fi
         done
@@ -21970,430 +18262,317 @@ echo $ECHO_N "checking for cfitsio... $ECHO_C" >&6
 
 
 
-        # Check for the cfitsio library
+        # Check for the CPL libraries
 
-        if test -z "$cpl_with_cfitsio_libs"; then
+        if test -z "$cpl_with_cpl_libs"; then
 
-            if test -z "$cpl_with_cfitsio"; then
+            if test -z "$cpl_with_cpl"; then
 
                 # Try some known system locations
 
-                cpl_cfitsio_libdirs="/opt/cfitsio/lib"
-                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/local/lib64"
-                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/local/lib"
-                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/local/lib32"
-                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib64"
-                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib"
-                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib32"
-
-                test -n "$CFITSIODIR" && \
-                    cpl_cfitsio_libdirs="$CFITSIODIR/lib64 $CFITSIODIR/lib \
-                                         $CFITSIODIR/lib32 $cpl_cfitsio_libdirs"
+                cpl_libdirs="/opt/cpl/lib"
+                cpl_libdirs="$cpl_libdirs /usr/local/lib64"
+                cpl_libdirs="$cpl_libdirs /usr/local/lib"
+                cpl_libdirs="$cpl_libdirs /usr/local/lib32"
+                cpl_libdirs="$cpl_libdirs /usr/lib64"
+                cpl_libdirs="$cpl_libdirs /usr/lib"
+                cpl_libdirs="$cpl_libdirs /usr/lib32"
 
                 test -n "$CPLDIR" && \
-                    cpl_cfitsio_libdirs="$CPLDIR/lib64 $CPLDIR/lib $CPLDIR/lib32 \
-                                         $cpl_cfitsio_libdirs"
+                    cpl_libdirs="$CPLDIR/lib64 $CPLDIR/lib $CPLDIR/lib32 \
+                                 $cpl_libdirs"
 
             else
 
-                cpl_cfitsio_libdirs="$cpl_with_cfitsio/lib64"
-                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs $cpl_with_cfitsio/lib"
-                cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs $cpl_with_cfitsio/lib32"
+                cpl_libdirs="$cpl_with_cpl/lib64"
+                cpl_libdirs="$cpl_libdirs $cpl_with_cpl/lib"
+                cpl_libdirs="$cpl_libdirs $cpl_with_cpl/lib32"
 
             fi
 
         else
-            cpl_cfitsio_libdirs="$cpl_with_cfitsio_libs"
+            cpl_libdirs="$cpl_with_cpl_libs"
+        fi
+
+
+    cpl_libraries=no
+
+    for i in $cpl_libdirs; do
+        for j in $cpl_check_cpl_lib; do
+
+            echo "configure: 18303: $i/$j" >&5
+
+            if test -r "$i/$j"; then
+                echo "taking that" >&5
+                cpl_libraries=$i
+                break 2
+            fi
+        done
+    done
+
+
+
+        if test x"$cpl_includes" = xno || test x"$cpl_libraries" = xno; then
+            cpl_notfound=""
+
+            if test x"$cpl_includes" = xno; then
+                if test x"$cpl_libraries" = xno; then
+                    cpl_notfound="(headers and libraries)"
+                else
+                    cpl_notfound="(headers)"
+                fi
+            else
+                cpl_notfound="(libraries)"
+            fi
+
+            as_fn_error $? "CPL $cpl_notfound was not found on your system. Please check!" "$LINENO" 5
+        else
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $cpl_libraries, headers $cpl_includes" >&5
+$as_echo "libraries $cpl_libraries, headers $cpl_includes" >&6; }
         fi
 
+    	# The libcext headers are required. By default it part of the
+    	# CPL installation and it is assumed that the cext headers are
+    	# present in the same location as the CPL headers
+
 
-    cpl_cfitsio_libraries=no
 
-    for i in $cpl_cfitsio_libdirs; do
-        for j in $cpl_cfitsio_check_lib; do
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcext" >&5
+$as_echo_n "checking for libcext... " >&6; }
 
-            echo "configure: 22015: $i/$j" >&5
+    cpl_cext_check_header="cxtypes.h"
+    cpl_cext_check_lib="libcext.a"
 
-            if test -r "$i/$j"; then
-                echo "taking that" >&5
-                cpl_cfitsio_libraries=$i
-                break 2
-            fi
-        done
-    done
+    cpl_cext_incdirs=""
+    cpl_cext_libdirs=""
 
+    cpl_cext_includes=""
+    cpl_cext_libraries=""
 
 
-        if test x"$cpl_cfitsio_includes" = xno || \
-            test x"$cpl_cfitsio_libraries" = xno; then
-            cpl_cfitsio_notfound=""
+	# Initialize directory search paths with the arguments provided
 
-            if test x"$cpl_cfitsio_includes" = xno; then
-                if test x"$cpl_cfitsio_libraries" = xno; then
-                    cpl_cfitsio_notfound="(headers and libraries)"
-                else
-                    cpl_cfitsio_notfound="(headers)"
-                fi
-            else
-                cpl_cfitsio_notfound="(libraries)"
-            fi
+	if test -n "$cpl_includes"; then
+		cpl_cext_incdirs="$cpl_includes"
+	fi
 
-            { { echo "$as_me:$LINENO: error: cfitsio $cpl_cfitsio_notfound was not found on your system. Please check!" >&5
-echo "$as_me: error: cfitsio $cpl_cfitsio_notfound was not found on your system. Please check!" >&2;}
-   { (exit 1); exit 1; }; }
-        else
-            echo "$as_me:$LINENO: result: libraries $cpl_cfitsio_libraries, headers $cpl_cfitsio_includes" >&5
-echo "${ECHO_T}libraries $cpl_cfitsio_libraries, headers $cpl_cfitsio_includes" >&6
-        fi
+	if test -n "$cpl_libraries"; then
+		cpl_cext_libdirs="$cpl_libraries"
+	fi
 
-        # Set up the symbols
 
-        # Add '-lz' to the static library symbol, as distributors apparently
-        # remove the libz code from the cfitsio sources.
 
-        CFITSIO_INCLUDES="-I$cpl_cfitsio_includes"
-        CFITSIO_LDFLAGS="-L$cpl_cfitsio_libraries"
-        LIBCFITSIO="-lcfitsio"
-        LIBCFITSIO_STATIC="$cpl_cfitsio_libraries/$cpl_cfitsio_check_lib"
+# Check whether --with-cext was given.
+if test "${with_cext+set}" = set; then :
+  withval=$with_cext;
+                    cpl_with_cext=$withval
 
-        # Do not add redundant libraries
-        echo $LIBS | grep -q -e '-lm' || LIBS="-lm $LIBS"
+fi
 
 
-        # Check whether cfitsio can be used
 
-        echo "$as_me:$LINENO: checking whether cfitsio can be used" >&5
-echo $ECHO_N "checking whether cfitsio can be used... $ECHO_C" >&6
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+# Check whether --with-cext-includes was given.
+if test "${with_cext_includes+set}" = set; then :
+  withval=$with_cext_includes; cpl_with_cext_includes=$withval
+fi
 
 
-        cpl_cfitsio_cflags_save="$CFLAGS"
-        cpl_cfitsio_ldflags_save="$LDFLAGS"
-        cpl_cfitsio_libs_save="$LIBS"
 
-        CFLAGS="$CFITSIO_INCLUDES $CFLAGS"
-        LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS"
-        LIBS="$LIBCFITSIO_STATIC $LIBPTHREAD -lm"
+# Check whether --with-cext-libs was given.
+if test "${with_cext_libs+set}" = set; then :
+  withval=$with_cext_libs; cpl_with_cext_libs=$withval
+fi
 
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-                       #include <fitsio.h>
+    # Check whether --enable-cext-test was given.
+if test "${enable_cext_test+set}" = set; then :
+  enableval=$enable_cext_test; cpl_enable_cext_test=$enableval
+else
+  cpl_enable_cext_test=yes
+fi
 
-int
-main ()
-{
 
-                       float v;
-                       fits_get_version(&v);
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cpl_cfitsio_is_usable="yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    if test "x$cpl_enable_cext_test" = xyes; then
 
-cpl_cfitsio_is_usable="no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+        # Check for the libcext includes
 
-        echo "$as_me:$LINENO: result: $cpl_cfitsio_is_usable" >&5
-echo "${ECHO_T}$cpl_cfitsio_is_usable" >&6
+        if test -z "$cpl_with_cext_includes"; then
 
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+            if test -z "$cpl_with_cext"; then
 
+            	if test -z "$cpl_cext_incdirs"; then
 
-        CFLAGS="$cpl_cfitsio_cflags_save"
-        LDFLAGS="$cpl_cfitsio_ldflags_save"
-        LIBS="$cpl_cfitsio_libs_save"
+	                # Try some known system locations
 
-        if test x"$cpl_cfitsio_is_usable" = xno; then
-            { { echo "$as_me:$LINENO: error: Linking with cfitsio failed! Please check architecture!" >&5
-echo "$as_me: error: Linking with cfitsio failed! Please check architecture!" >&2;}
-   { (exit 1); exit 1; }; }
-        fi
+    	            cpl_cext_incdirs="/opt/cext/include"
+        	        cpl_cext_incdirs="$cpl_cext_incdirs /usr/local/include/cext"
+            	    cpl_cext_incdirs="$cpl_cext_incdirs /usr/local/include"
+                	cpl_cext_incdirs="$cpl_cext_incdirs /usr/include/cext"
+                	cpl_cext_incdirs="$cpl_cext_incdirs /usr/include"
 
+                	test -n "$CPLDIR" && \
+                    	cpl_cext_incdirs="$CPLDIR/include/cext \
+                        	              $CPLDIR/include \
+                            	          $cpl_cext_incdirs"
 
-        # Check cfitsio version
+				fi
 
-        echo "$as_me:$LINENO: checking for a cfitsio version >= $cpl_cfitsio_check_version" >&5
-echo $ECHO_N "checking for a cfitsio version >= $cpl_cfitsio_check_version... $ECHO_C" >&6
+            else
 
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+                cpl_cext_incdirs="$cpl_with_cext/include/cext"
+                cpl_cext_incdirs="$cpl_cext_incdirs $cpl_with_cext/include"
 
+            fi
 
-        cpl_cfitsio_cflags_save="$CFLAGS"
-        cpl_cfitsio_ldflags_save="$LDFLAGS"
-        cpl_cfitsio_libs_save="$LIBS"
+        else
+            cpl_cext_incdirs="$cpl_with_cext_includes"
+        fi
 
-        CFLAGS="$CFITSIO_INCLUDES $CFLAGS"
-        LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS"
-        LIBS="$LIBCFITSIO_STATIC $LIBPTHREAD -lm"
 
-        if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+    cpl_cext_includes=no
 
-                      #include <stdio.h>
-                      #include <fitsio.h>
+    for i in $cpl_cext_incdirs; do
+        for j in $cpl_cext_check_header; do
 
-int
-main ()
-{
+            echo "configure: 18438: $i/$j" >&5
 
-                      int vlib = 0;
-                      int vmin = (int)(1000. * $cpl_cfitsio_check_version + 0.5);
+            if test -r "$i/$j"; then
+                echo "taking that" >&5
+                cpl_cext_includes=$i
+                break 2
+            fi
+        done
+    done
 
-                      float v;
 
-                      fits_get_version(&v);
-                      vlib = (int)(v * 1000 + 0.5);
 
-                      FILE* f = fopen("conftest.out", "w");
-                      fprintf(f, "%5.3f\n", v);
-                      fclose(f);
+        # Check for the libcext library
 
-                      if (vlib < vmin) {
-                          return 1;
-                      }
+        if test -z "$cpl_with_cext_libs"; then
 
-                      return 0;
+            if test -z "$cpl_with_cext"; then
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cpl_cfitsio_version="`cat conftest.out`"
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+            	if test -z "$cpl_cext_libdirs"; then
 
-( exit $ac_status )
+	                # Try some known system locations
 
-                       cpl_cfitsio_version="no";
-                       cpl_cfitsio_version_found="`cat conftest.out`"
+    	            cpl_cext_libdirs="/opt/cext/lib"
+                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/local/lib64"
+                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/local/lib"
+                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/local/lib32"
+                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib64"
+                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib"
+                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib32"
 
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+                	test -n "$CPLDIR" && \
+                    	cpl_cext_libdirs="$CPLDIR/lib64 \
+                    					  $CPLDIR/lib \
+                    					  $CPLDIR/lib32 \
+                                          $cpl_cext_libdirs"
 
-        echo "$as_me:$LINENO: result: $cpl_cfitsio_version" >&5
-echo "${ECHO_T}$cpl_cfitsio_version" >&6
+				fi
 
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+            else
 
+                cpl_cext_libdirs="$cpl_with_cext/lib64"
+                cpl_cext_libdirs="$cpl_cext_libdirs $cpl_with_cext/lib"
+                cpl_cext_libdirs="$cpl_cext_libdirs $cpl_with_cext/lib32"
 
-        CFLAGS="$cpl_cfitsio_cflags_save"
-        LDFLAGS="$cpl_cfitsio_ldflags_save"
-        LIBS="$cpl_cfitsio_libs_save"
+            fi
 
-        if test x"$cpl_cfitsio_version" = xno; then
-            { { echo "$as_me:$LINENO: error: Installed cfitsio ($cpl_cfitsio_version_found) is too old. Please update to version $cpl_cfitsio_check_version or newer." >&5
-echo "$as_me: error: Installed cfitsio ($cpl_cfitsio_version_found) is too old. Please update to version $cpl_cfitsio_check_version or newer." >&2;}
-   { (exit 1); exit 1; }; }
+        else
+            cpl_cext_libdirs="$cpl_with_cext_libs"
         fi
 
 
-        # Check whether cfitsio has large file support
+    cpl_cext_libraries=no
 
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+    for i in $cpl_cext_libdirs; do
+        for j in $cpl_cext_check_lib; do
 
+            echo "configure: 18494: $i/$j" >&5
 
-        cpl_cfitsio_cflags_save="$CFLAGS"
-        cpl_cfitsio_ldflags_save="$LDFLAGS"
-        cpl_cfitsio_libs_save="$LIBS"
+            if test -r "$i/$j"; then
+                echo "taking that" >&5
+                cpl_cext_libraries=$i
+                break 2
+            fi
+        done
+    done
 
-        CFLAGS="$CFITSIO_INCLUDES $CFLAGS"
-        LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS"
-        LIBS="$LIBCFITSIO_STATIC -lm $LIBPTHREAD"
 
-        echo "$as_me:$LINENO: checking whether cfitsio provides fits_hdu_getoff()" >&5
-echo $ECHO_N "checking whether cfitsio provides fits_hdu_getoff()... $ECHO_C" >&6
 
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+        if test x"$cpl_cext_includes" = xno || \
+            test x"$cpl_cext_libraries" = xno; then
+            cpl_cext_notfound=""
 
-                          #include <fitsio.h>
+            if test x"$cpl_cext_includes" = xno; then
+                if test x"$cpl_cext_libraries" = xno; then
+                    cpl_cext_notfound="(headers and libraries)"
+                else
+                    cpl_cext_notfound="(headers)"
+                fi
+            else
+                cpl_cext_notfound="(libraries)"
+            fi
 
-int
-main ()
-{
+            as_fn_error $? "libcext $cpl_cext_notfound was not found on your system. Please check!" "$LINENO" 5
+        else
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $cpl_cext_libraries, headers $cpl_cext_includes" >&5
+$as_echo "libraries $cpl_cext_libraries, headers $cpl_cext_includes" >&6; }
+        fi
+
+
+        # Set up the symbols
+
+        CX_INCLUDES="-I$cpl_cext_includes"
+        CX_LDFLAGS="-L$cpl_cext_libraries"
+        LIBCEXT="-lcext"
 
-                          fitsfile f;
-                          int sts;
-                          fits_get_hduoff(&f, NULL, NULL, NULL, &sts);
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cpl_cfitsio_have_fits_get_hduoff="yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcext can be used" >&5
+$as_echo_n "checking whether libcext can be used... " >&6; }
+        ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-cpl_cfitsio_have_fits_get_hduoff="no"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
-        echo "$as_me:$LINENO: result: $cpl_cfitsio_have_fits_get_hduoff" >&5
-echo "${ECHO_T}$cpl_cfitsio_have_fits_get_hduoff" >&6
+        cpl_cext_cflags_save="$CFLAGS"
+        cpl_cext_ldflags_save="$LDFLAGS"
+        cpl_cext_libs_save="$LIBS"
 
-        echo "$as_me:$LINENO: checking whether cfitsio provides fits_get_hduaddrll()" >&5
-echo $ECHO_N "checking whether cfitsio provides fits_get_hduaddrll()... $ECHO_C" >&6
+        CFLAGS="$CX_INCLUDES $CFLAGS"
+        LDFLAGS="$CX_LDFLAGS $LDFLAGS"
+        LIBS="$LIBCEXT"
 
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-                          #include <fitsio.h>
+                       #include <cxutils.h>
 
 int
 main ()
 {
 
-                          fitsfile f;
-                          int sts;
-                          fits_get_hduaddrll(&f, NULL, NULL, NULL, &sts);
+                       cx_program_set_name("MyProgram");
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cpl_cfitsio_have_fits_get_hduaddrll="yes"
+if ac_fn_c_try_link "$LINENO"; then :
+  cpl_cext_is_usable="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-cpl_cfitsio_have_fits_get_hduaddrll="no"
+  cpl_cext_is_usable="no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-        echo "$as_me:$LINENO: result: $cpl_cfitsio_have_fits_get_hduaddrll" >&5
-echo "${ECHO_T}$cpl_cfitsio_have_fits_get_hduaddrll" >&6
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpl_cext_is_usable" >&5
+$as_echo "$cpl_cext_is_usable" >&6; }
 
         ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -22402,215 +18581,101 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-        CFLAGS="$cpl_cfitsio_cflags_save"
-        LDFLAGS="$cpl_cfitsio_ldflags_save"
-        LIBS="$cpl_cfitsio_libs_save"
+        CFLAGS="$cpl_cext_cflags_save"
+        LDFLAGS="$cpl_cext_ldflags_save"
+        LIBS="$cpl_cext_libs_save"
 
+        if test x"$cpl_cext_is_usable" = xno; then
+            as_fn_error $? "Linking with libcext failed! Please check architecture!" "$LINENO" 5
+        fi
 
-        # Check whether cfitsio is thread-safe
+    else
 
-        echo "$as_me:$LINENO: checking whether cfitsio requires libpthread" >&5
-echo $ECHO_N "checking whether cfitsio requires libpthread... $ECHO_C" >&6
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcext checks have been disabled! This package may not build!" >&5
+$as_echo "$as_me: WARNING: libcext checks have been disabled! This package may not build!" >&2;}
+        CX_INCLUDES=""
+        CX_LDFLAGS=""
+        LIBCEXT=""
 
+    fi
 
-        cpl_cfitsio_cflags_save="$CFLAGS"
-        cpl_cfitsio_ldflags_save="$LDFLAGS"
-        cpl_cfitsio_libs_save="$LIBS"
 
-        CFLAGS="$CFITSIO_INCLUDES $CFLAGS"
-        LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS"
-        LIBS="$LIBCFITSIO_STATIC -lm"
 
 
-        cpl_cfitsio_provides_pthread="no"
 
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-                       #include <fitsio.h>
 
-int
-main ()
-{
 
-                       float v;
-                       fits_get_version(&v);
+        # Set up the symbols
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cpl_cfitsio_requires_pthread="no"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+        CPL_INCLUDES="-I$cpl_includes $CX_INCLUDES $CFITSIO_INCLUDES"
+        CPL_LDFLAGS="-L$cpl_libraries $CX_LDFLAGS $CFITSIO_LDFLAGS"
 
-cpl_cfitsio_requires_pthread="undefined"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
 
-		if test x"$cpl_cfitsio_requires_pthread" = xno; then
+    if test -z ""; then
+        LIBCPLCORE='-lcplcore'
+        LIBCPLDRS='-lcpldrs'
+        LIBCPLUI='-lcplui'
+        LIBCPLDFS='-lcpldfs'
+    else
+        LIBCPLCORE='$(top_builddir)/cplcore/libcplcore.la'
+        LIBCPLDRS='$(top_builddir)/cpldrs/libcpldrs.la'
+        LIBCPLUI='$(top_builddir)/cplui/libcplui.la'
+        LIBCPLDFS='$(top_builddir)/cpldfs/libcpldfs.la'
+    fi
 
-	    	# If libpthread is not required this means either cfitsio is
-    		# not compiled with thread support, or the library dependencies
-    		# are compiled into cfitsio.
 
-			# Check whether shared library dependencies are present
-			# Don't use pthread_mutex_init/destroy here, since glibc
-			# provides these symbols too! Sigh!
 
-	        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-	    	               #include <pthread.h>
-    	    	           #include <fitsio.h>
 
-int
-main ()
-{
 
-	                	   float v;
-    	            	   pthread_mutexattr_t attrb;
-    	            	   pthread_mutexattr_init(&attrb);
-            	           fits_get_version(&v);
-                		   pthread_mutexattr_destroy(&attrb);
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cpl_cfitsio_provides_pthread="yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-cpl_cfitsio_provides_pthread="no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
 
-        else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CPL can be used" >&5
+$as_echo_n "checking whether CPL can be used... " >&6; }
+        ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-            LIBS="$LIBCFITSIO_STATIC -lm $LIBPTHREAD"
 
-            cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+        cpl_cflags_save="$CFLAGS"
+        cpl_ldflags_save="$LDFLAGS"
+        cpl_libs_save="$LIBS"
+
+        CFLAGS="$CPL_INCLUDES $CFLAGS"
+        LDFLAGS="$CPL_LDFLAGS $LDFLAGS"
+        LIBS="$LIBCPLCORE $LIBCEXT $LIBS"
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-                           #include <fitsio.h>
+                       #include <cpl.h>
 
 int
 main ()
 {
 
-                           float v;
-                           fits_get_version(&v);
+                       cpl_init(CPL_INIT_DEFAULT);
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cpl_cfitsio_requires_pthread="yes"
+if ac_fn_c_try_link "$LINENO"; then :
+  cpl_is_usable="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: Cannot link with cfitsio! Please check!
-See \`config.log' for more details." >&5
-echo "$as_me: error: Cannot link with cfitsio! Please check!
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  cpl_is_usable="no"
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-        fi
-
-        echo "$as_me:$LINENO: result: $cpl_cfitsio_requires_pthread" >&5
-echo "${ECHO_T}$cpl_cfitsio_requires_pthread" >&6
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpl_is_usable" >&5
+$as_echo "$cpl_is_usable" >&6; }
 
         ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -22619,2587 +18684,3266 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-        CFLAGS="$cpl_cfitsio_cflags_save"
-        LDFLAGS="$cpl_cfitsio_ldflags_save"
-        LIBS="$cpl_cfitsio_libs_save"
+        CFLAGS="$cpl_cflags_save"
+        LDFLAGS="$cpl_ldflags_save"
+        LIBS="$cpl_libs_save"
 
+        if test x"$cpl_is_usable" = xno; then
+            as_fn_error $? "Linking with CPL failed! Please check architecture!" "$LINENO" 5
+        fi
 
-		echo "$as_me:$LINENO: checking whether cfitsio was compiled with thread support" >&5
-echo $ECHO_N "checking whether cfitsio was compiled with thread support... $ECHO_C" >&6
+    else
 
-		if test x"$cpl_cfitsio_requires_pthread" = xyes || \
-			test x"$cpl_cfitsio_provides_pthread" = xyes; then
-			cpl_cfitsio_is_thread_safe=yes
-		else
-			cpl_cfitsio_is_thread_safe=no
-		fi
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CPL checks have been disabled! This package may not build!" >&5
+$as_echo "$as_me: WARNING: CPL checks have been disabled! This package may not build!" >&2;}
+        CPL_INCLUDES=""
+        CPL_LDFLAGS=""
+        LIBCPLCORE=""
+        LIBCPLDRS=""
+        LIBCPLUI=""
+        LIBCPLDFS=""
+
+    fi
+
+
+
+
+
+
+
+
+
+
+# Check for GSL
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
 
-		echo "$as_me:$LINENO: result: $cpl_cfitsio_is_thread_safe" >&5
-echo "${ECHO_T}$cpl_cfitsio_is_thread_safe" >&6
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		PKG_CONFIG=""
+	fi
+fi
 
 
-        # Set compiler flags and libraries
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gsl" >&5
+$as_echo_n "checking for gsl... " >&6; }
 
-        if test x"$cpl_cfitsio_have_fits_get_hduoff" = xyes || \
-          test x"$cpl_cfitsio_have_fits_get_hduaddrll" = xyes; then
 
-            CFLAGS="-D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 $CFLAGS"
+# Check whether --with-gsl was given.
+if test "${with_gsl+set}" = set; then :
+  withval=$with_gsl;
+                    cpl_gsl_dir=$withval
 
-            if test x"$cpl_cfitsio_have_fits_get_hduoff"; then
+fi
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FITS_GET_HDUOFF 1
-_ACEOF
 
-            else
+    export PKG_CONFIG_PATH="$cpl_gsl_dir/lib/pkgconfig:$GSLDIR/lib/pkgconfig/:$PKG_CONFIG_PATH"
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FITS_GET_HDUADDRLL 1
-_ACEOF
 
-            fi
 
-        fi
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSL" >&5
+$as_echo_n "checking for GSL... " >&6; }
 
-        if test x"$cpl_cfitsio_requires_pthread" = xyes; then
-            echo $LIBS | grep -q -e "$LIBPTHREAD" || LIBS="$LIBPTHREAD $LIBS"
-        fi
+if test -n "$GSL_CFLAGS"; then
+    pkg_cv_GSL_CFLAGS="$GSL_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gsl\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gsl") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GSL_CFLAGS=`$PKG_CONFIG --cflags "gsl" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$GSL_LIBS"; then
+    pkg_cv_GSL_LIBS="$GSL_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gsl\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gsl") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GSL_LIBS=`$PKG_CONFIG --libs "gsl" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
 
-    else
-        echo "$as_me:$LINENO: result: disabled" >&5
-echo "${ECHO_T}disabled" >&6
-        { echo "$as_me:$LINENO: WARNING: cfitsio checks have been disabled! This package may not build!" >&5
-echo "$as_me: WARNING: cfitsio checks have been disabled! This package may not build!" >&2;}
-        CFITSIO_INCLUDES=""
-        CFITSIO_LDFLAGS=""
-        LIBCFITSIO=""
 
-        cpl_cfitsio_is_thread_safe="undefined"
-        cpl_cfitsio_requires_pthread="undefined"
-    fi
 
-	if test "${cpl_cv_cfitsio_requires_pthread+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  cpl_cv_cfitsio_requires_pthread=$cpl_cfitsio_requires_pthread
+        _pkg_short_errors_supported=no
 fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gsl" 2>&1`
+        else
+	        GSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gsl" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GSL_PKG_ERRORS" >&5
 
-	if test "${cpl_cv_cfitsio_is_thread_safe+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+	as_fn_error $? "No GSL available" "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	as_fn_error $? "No GSL available" "$LINENO" 5
 else
-  cpl_cv_cfitsio_is_thread_safe=$cpl_cfitsio_is_thread_safe
+	GSL_CFLAGS=$pkg_cv_GSL_CFLAGS
+	GSL_LIBS=$pkg_cv_GSL_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_LIBGSL 1" >>confdefs.h
+
 fi
 
 
 
+# Check for Purify
 
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PURIFY" >&5
+$as_echo_n "checking for PURIFY... " >&6; }
 
+    # Check whether --enable-purify was given.
+if test "${enable_purify+set}" = set; then :
+  enableval=$enable_purify; enable_purify=$enableval
+else
+  enable_purify=yes
+fi
 
 
+    if test "x$enable_purify" = xyes ; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5
+$as_echo "enabled" >&6; }
+      # Extract the first word of "purify", so it can be a program name with args.
+set dummy purify; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PURIFY_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PURIFY_CMD"; then
+  ac_cv_prog_PURIFY_CMD="$PURIFY_CMD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PURIFY_CMD="command found"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-    echo "$as_me:$LINENO: checking for CPL" >&5
-echo $ECHO_N "checking for CPL... $ECHO_C" >&6
+  test -z "$ac_cv_prog_PURIFY_CMD" && ac_cv_prog_PURIFY_CMD="command not found"
+fi
+fi
+PURIFY_CMD=$ac_cv_prog_PURIFY_CMD
+if test -n "$PURIFY_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PURIFY_CMD" >&5
+$as_echo "$PURIFY_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-    cpl_check_cpl_header="cpl.h"
-    cpl_check_cpl_lib="libcplcore.a"
 
-    cpl_incdirs=""
-    cpl_libdirs=""
-    cpl_includes=""
-    cpl_libraries=""
+      if test "$PURIFY_CMD" = "command not found" ; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling purify support" >&5
+$as_echo "$as_me: WARNING: Disabling purify support" >&2;}
+        enable_purify=no
+      fi
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+    fi
 
+     if test "x$enable_purify" = "xyes"; then
+  PURIFY_TRUE=
+  PURIFY_FALSE='#'
+else
+  PURIFY_TRUE='#'
+  PURIFY_FALSE=
+fi
 
-# Check whether --with-cpl or --without-cpl was given.
-if test "${with_cpl+set}" = set; then
-  withval="$with_cpl"
 
-                    cpl_with_cpl=$withval
 
-fi;
 
 
-# Check whether --with-cpl-includes or --without-cpl-includes was given.
-if test "${with_cpl_includes+set}" = set; then
-  withval="$with_cpl_includes"
-  cpl_with_cpl_includes=$withval
-fi;
+    if test -z "$plugindir"; then
+#        plugindir='${libdir}/${PACKAGE}/plugins/${PACKAGE}-${VERSION}'
+        plugindir='${libdir}/esopipes-plugins/${PACKAGE}-${VERSION}'
+    fi
 
+    if test -z "$privatelibdir"; then
+        privatelibdir='${libdir}/${PACKAGE}-${VERSION}'
+    fi
 
-# Check whether --with-cpl-libs or --without-cpl-libs was given.
-if test "${with_cpl_libs+set}" = set; then
-  withval="$with_cpl_libs"
-  cpl_with_cpl_libs=$withval
-fi;
+    if test -z "$pipedocsdir"; then
+        pipedocsdir='${datadir}/doc/esopipes/${PACKAGE}-${VERSION}/'
+    fi
 
-    # Check whether --enable-cpl-test or --disable-cpl-test was given.
-if test "${enable_cpl_test+set}" = set; then
-  enableval="$enable_cpl_test"
-  cpl_enable_cpl_test=$enableval
-else
-  cpl_enable_cpl_test=yes
-fi;
+    htmldir='${pipedocsdir}/html'
 
+#    if test -z "$htmldir"; then
+#        htmldir='${datadir}/doc/${PACKAGE}/html'
+#    fi
 
-    if test "x$cpl_enable_cpl_test" = xyes; then
+    if test -z "$configdir"; then
+       configdir='${prefix}/share/esopipes/${PACKAGE}-${VERSION}/config'
+    fi
 
-        # Check for the CPL includes
+    if test -z "$wkfextradir"; then
+        wkfextradir='${datadir}/esopipes/${PACKAGE}-${VERSION}/reflex'
+    fi
 
-        if test -z "$cpl_with_cpl_includes"; then
+    if test -z "$wkfcopydir"; then
+        wkfcopydir='${datadir}/reflex/workflows/${PACKAGE}-${VERSION}'
+    fi
 
-            if test -z "$cpl_with_cpl"; then
 
-                # Try some known system locations
 
-                cpl_incdirs="/opt/cpl/include"
-                cpl_incdirs="$cpl_incdirs /usr/local/include"
-                cpl_incdirs="$cpl_incdirs /usr/include"
 
-                test -n "$CPLDIR" && \
-                    cpl_incdirs="$CPLDIR/include \
-                                 $cpl_incdirs"
 
-            else
 
-                cpl_incdirs="$cpl_with_cpl/include"
 
-            fi
 
-        else
-            cpl_incdirs="$cpl_with_cpl_includes"
-        fi
 
 
-    cpl_includes=no
 
-    for i in $cpl_incdirs; do
-        for j in $cpl_check_cpl_header; do
+    # Define a preprocesor symbol for the plugin search paths
 
-            echo "configure: 22778: $i/$j" >&5
+#    AC_DEFINE_UNQUOTED(FORS_PLUGIN_DIR, "${PACKAGE}/plugins",
+#                       [Plugin directory tree prefix])
 
-            if test -r "$i/$j"; then
-                echo "taking that" >&5
-                cpl_includes=$i
-                break 2
-            fi
-        done
-    done
 
+cat >>confdefs.h <<_ACEOF
+#define FORS_PLUGIN_DIR "esopipes-plugins"
+_ACEOF
 
 
-        # Check for the CPL libraries
+    eval plugin_dir="$plugindir"
+    plugin_path=`eval echo $plugin_dir | \
+                sed -e "s/\/${PACKAGE}-${VERSION}.*$//"`
 
-        if test -z "$cpl_with_cpl_libs"; then
 
-            if test -z "$cpl_with_cpl"; then
+cat >>confdefs.h <<_ACEOF
+#define FORS_PLUGIN_PATH "$plugin_path"
+_ACEOF
 
-                # Try some known system locations
 
-                cpl_libdirs="/opt/cpl/lib"
-                cpl_libdirs="$cpl_libdirs /usr/local/lib64"
-                cpl_libdirs="$cpl_libdirs /usr/local/lib"
-                cpl_libdirs="$cpl_libdirs /usr/local/lib32"
-                cpl_libdirs="$cpl_libdirs /usr/lib64"
-                cpl_libdirs="$cpl_libdirs /usr/lib"
-                cpl_libdirs="$cpl_libdirs /usr/lib32"
+    # Define the preprocessor symbols for the sextractor executable
+    # and the configuration files.
 
-                test -n "$CPLDIR" && \
-                    cpl_libdirs="$CPLDIR/lib64 $CPLDIR/lib $CPLDIR/lib32 \
-                                 $cpl_libdirs"
+    eval sext_bindir="${prefix}/lib/${PACKAGE}-${VERSION}/bin"
 
-            else
 
-                cpl_libdirs="$cpl_with_cpl/lib64"
-                cpl_libdirs="$cpl_libdirs $cpl_with_cpl/lib"
-                cpl_libdirs="$cpl_libdirs $cpl_with_cpl/lib32"
+cat >>confdefs.h <<_ACEOF
+#define FORS_SEXTRACTOR_PATH "$sext_bindir"
+_ACEOF
 
-            fi
 
-        else
-            cpl_libdirs="$cpl_with_cpl_libs"
-        fi
+    eval d="$configdir"
+    eval sext_configdir="$d"
 
 
-    cpl_libraries=no
+cat >>confdefs.h <<_ACEOF
+#define FORS_SEXTRACTOR_CONFIG "$sext_configdir"
+_ACEOF
 
-    for i in $cpl_libdirs; do
-        for j in $cpl_check_cpl_lib; do
 
-            echo "configure: 22828: $i/$j" >&5
 
-            if test -r "$i/$j"; then
-                echo "taking that" >&5
-                cpl_libraries=$i
-                break 2
-            fi
-        done
-    done
 
 
 
-        if test x"$cpl_includes" = xno || test x"$cpl_libraries" = xno; then
-            cpl_notfound=""
+# Check whether --with-extra-includes was given.
+if test "${with_extra_includes+set}" = set; then :
+  withval=$with_extra_includes; eso_with_extra_includes=$withval
+else
+  eso_with_extra_includes=NONE
+fi
 
-            if test x"$cpl_includes" = xno; then
-                if test x"$cpl_libraries" = xno; then
-                    cpl_notfound="(headers and libraries)"
-                else
-                    cpl_notfound="(headers)"
-                fi
-            else
-                cpl_notfound="(libraries)"
-            fi
 
-            { { echo "$as_me:$LINENO: error: CPL $cpl_notfound was not found on your system. Please check!" >&5
-echo "$as_me: error: CPL $cpl_notfound was not found on your system. Please check!" >&2;}
-   { (exit 1); exit 1; }; }
-        else
-            echo "$as_me:$LINENO: result: libraries $cpl_libraries, headers $cpl_includes" >&5
-echo "${ECHO_T}libraries $cpl_libraries, headers $cpl_includes" >&6
-        fi
 
-    	# The libcext headers are required. By default it part of the
-    	# CPL installation and it is assumed that the cext headers are
-    	# present in the same location as the CPL headers
+# Check whether --with-extra-libs was given.
+if test "${with_extra_libs+set}" = set; then :
+  withval=$with_extra_libs; eso_with_extra_libs=$withval
+else
+  eso_with_extra_libs=NONE
+fi
 
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra includes" >&5
+$as_echo_n "checking for extra includes... " >&6; }
+    if ${eso_cv_with_extra_includes+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
-    echo "$as_me:$LINENO: checking for libcext" >&5
-echo $ECHO_N "checking for libcext... $ECHO_C" >&6
+                     eso_cv_with_extra_includes=$eso_with_extra_includes
 
-    cpl_cext_check_header="cxtypes.h"
-    cpl_cext_check_lib="libcext.a"
+fi
 
-    cpl_cext_incdirs=""
-    cpl_cext_libdirs=""
 
-    cpl_cext_includes=""
-    cpl_cext_libraries=""
+    if test x"$eso_cv_with_extra_includes" != xNONE; then
+        eso_save_IFS=$IFS
+        IFS=':'
 
+        for dir in $eso_cv_with_extra_includes; do
+            EXTRA_INCLUDES="$EXTRA_INCLUDES -I$dir"
+        done
 
-	# Initialize directory search paths with the arguments provided
+        IFS=$eso_save_IFS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: added" >&5
+$as_echo "added" >&6; }
+    else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
 
-	if test -n "$cpl_includes"; then
-		cpl_cext_incdirs="$cpl_includes"
-	fi
 
-	if test -n "$cpl_libraries"; then
-		cpl_cext_libdirs="$cpl_libraries"
-	fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra libs" >&5
+$as_echo_n "checking for extra libs... " >&6; }
+    if ${eso_cv_with_extra_libs+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                     eso_cv_with_extra_libs=$eso_with_extra_libs
 
+fi
 
-# Check whether --with-cext or --without-cext was given.
-if test "${with_cext+set}" = set; then
-  withval="$with_cext"
 
-                    cpl_with_cext=$withval
+    if test x"$eso_cv_with_extra_libs" != xNONE; then
+        eso_save_IFS=$IFS
+        IFS=':'
+
+        for dir in $eso_cv_with_extra_libs; do
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$dir"
+        done
+
+        IFS=$eso_save_IFS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: added" >&5
+$as_echo "added" >&6; }
+    else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
 
-fi;
 
 
-# Check whether --with-cext-includes or --without-cext-includes was given.
-if test "${with_cext_includes+set}" = set; then
-  withval="$with_cext_includes"
-  cpl_with_cext_includes=$withval
-fi;
 
+    # Symbols for package include file and library search paths
 
-# Check whether --with-cext-libs or --without-cext-libs was given.
-if test "${with_cext_libs+set}" = set; then
-  withval="$with_cext_libs"
-  cpl_with_cext_libs=$withval
-fi;
+    FORS_INCLUDES='-I$(top_srcdir)/fors'
+    FORS_LDFLAGS='-L$(top_builddir)/fors'
+    IRPLIB_INCLUDES='-I$(top_srcdir)/irplib'
+    MOSCA_INCLUDES='-I$(top_srcdir)/mosca/libmosca'
+    # No -L for IRPLIB which is statically linked
 
-    # Check whether --enable-cext-test or --disable-cext-test was given.
-if test "${enable_cext_test+set}" = set; then
-  enableval="$enable_cext_test"
-  cpl_enable_cext_test=$enableval
-else
-  cpl_enable_cext_test=yes
-fi;
+    #WCSLIB_LDFLAGS='-L$(top_builddir)/wcslib-4.2/C'
+    #WCSLIB_INCLUDES='-I$(top_srcdir)/wcslib-4.2/C'
 
+    # Library aliases
 
-    if test "x$cpl_enable_cext_test" = xyes; then
+    LIBFORS='$(top_builddir)/fors/libfors.la'
+    #LIBWCSLIB='$(top_builddir)/wcslib-4.2/C/libwcs-4.2.a'
+    LIBIRPLIB='$(top_builddir)/irplib/libirplib.la'
+    LIBMOSCA='$(top_builddir)/mosca/libmosca/libmosca.la'
 
-        # Check for the libcext includes
+    # Substitute the defined symbols
 
-        if test -z "$cpl_with_cext_includes"; then
 
-            if test -z "$cpl_with_cext"; then
 
-            	if test -z "$cpl_cext_incdirs"; then
 
-	                # Try some known system locations
 
-    	            cpl_cext_incdirs="/opt/cext/include"
-        	        cpl_cext_incdirs="$cpl_cext_incdirs /usr/local/include/cext"
-            	    cpl_cext_incdirs="$cpl_cext_incdirs /usr/local/include"
-                	cpl_cext_incdirs="$cpl_cext_incdirs /usr/include/cext"
-                	cpl_cext_incdirs="$cpl_cext_incdirs /usr/include"
+    #AC_SUBST(WCSLIB_INCLUDES)
+    #AC_SUBST(WCSLIB_LDFLAGS)
+    #AC_SUBST(LIBWCSLIB)
 
-                	test -n "$CPLDIR" && \
-                    	cpl_cext_incdirs="$CPLDIR/include/cext \
-                        	              $CPLDIR/include \
-                            	          $cpl_cext_incdirs"
 
-				fi
 
-            else
 
-                cpl_cext_incdirs="$cpl_with_cext/include/cext"
-                cpl_cext_incdirs="$cpl_cext_incdirs $cpl_with_cext/include"
 
-            fi
 
-        else
-            cpl_cext_incdirs="$cpl_with_cext_includes"
-        fi
 
+    # Check for CPL and user defined libraries
 
-    cpl_cext_includes=no
 
-    for i in $cpl_cext_incdirs; do
-        for j in $cpl_cext_check_header; do
 
-            echo "configure: 22965: $i/$j" >&5
+    all_includes='$(FORS_INCLUDES) $(MOSCA_INCLUDES) $(CPL_INCLUDES) $(CX_INCLUDES) $(IRPLIB_INCLUDES) $(EXTRA_INCLUDES)'
+    all_ldflags='$(FORS_LDFLAGS) $(CPL_LDFLAGS) $(CX_LDFLAGS) $(EXTRA_LDFLAGS)'
 
-            if test -r "$i/$j"; then
-                echo "taking that" >&5
-                cpl_cext_includes=$i
-                break 2
-            fi
-        done
-    done
 
 
 
-        # Check for the libcext library
 
-        if test -z "$cpl_with_cext_libs"; then
 
-            if test -z "$cpl_with_cext"; then
 
-            	if test -z "$cpl_cext_libdirs"; then
 
-	                # Try some known system locations
 
-    	            cpl_cext_libdirs="/opt/cext/lib"
-                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/local/lib64"
-                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/local/lib"
-                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/local/lib32"
-                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib64"
-                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib"
-                	cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib32"
 
-                	test -n "$CPLDIR" && \
-                    	cpl_cext_libdirs="$CPLDIR/lib64 \
-                    					  $CPLDIR/lib \
-                    					  $CPLDIR/lib32 \
-                                          $cpl_cext_libdirs"
+    # Check whether --enable-online was given.
+if test "${enable_online+set}" = set; then :
+  enableval=$enable_online; fors_enable_online=$enableval
+else
+  fors_enable_online=no
+fi
 
-				fi
 
-            else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether an online support should be enabled" >&5
+$as_echo_n "checking whether an online support should be enabled... " >&6; }
+if ${fors_cv_enable_online+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  fors_cv_enable_online=$fors_enable_online
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fors_cv_enable_online" >&5
+$as_echo "$fors_cv_enable_online" >&6; }
 
-                cpl_cext_libdirs="$cpl_with_cext/lib64"
-                cpl_cext_libdirs="$cpl_cext_libdirs $cpl_with_cext/lib"
-                cpl_cext_libdirs="$cpl_cext_libdirs $cpl_with_cext/lib32"
+#
+#    if test x"$fors_cv_enable_online" = xyes; then
+#
+#        PSFEXDIR=psfex
+#        PSFEX_CONFIG="masktoccd.psfex masktoccd_1.sex masktoccd_2.sex"
+#
+#        AC_DEFINE(ONLINE_MODE)
+#
+#    else
+#
+#        PSFEXDIR=""
+#        PSFEX_CONFIG=""
+#
+#    fi
+#
 
-            fi
+     if test x$fors_cv_enable_online = xyes; then
+  ONLINE_MODE_TRUE=
+  ONLINE_MODE_FALSE='#'
+else
+  ONLINE_MODE_TRUE='#'
+  ONLINE_MODE_FALSE=
+fi
 
-        else
-            cpl_cext_libdirs="$cpl_with_cext_libs"
-        fi
 
+#    AC_SUBST(PSFEXDIR)
+#    AC_SUBST(PSFEX_CONFIG)
 
-    cpl_cext_libraries=no
 
-    for i in $cpl_cext_libdirs; do
-        for j in $cpl_cext_check_lib; do
 
-            echo "configure: 23021: $i/$j" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if malloc debugging is wanted" >&5
+$as_echo_n "checking if malloc debugging is wanted... " >&6; }
 
-            if test -r "$i/$j"; then
-                echo "taking that" >&5
-                cpl_cext_libraries=$i
-                break 2
-            fi
-        done
-    done
+# Check whether --with-dmalloc was given.
+if test "${with_dmalloc+set}" = set; then :
+  withval=$with_dmalloc; if test "$withval" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
+$as_echo "#define WITH_DMALLOC 1" >>confdefs.h
 
+  LIBS="$LIBS -ldmalloc"
+  LDFLAGS="$LDFLAGS -g"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-        if test x"$cpl_cext_includes" = xno || \
-            test x"$cpl_cext_libraries" = xno; then
-            cpl_cext_notfound=""
 
-            if test x"$cpl_cext_includes" = xno; then
-                if test x"$cpl_cext_libraries" = xno; then
-                    cpl_cext_notfound="(headers and libraries)"
-                else
-                    cpl_cext_notfound="(headers)"
-                fi
-            else
-                cpl_cext_notfound="(libraries)"
-            fi
 
-            { { echo "$as_me:$LINENO: error: libcext $cpl_cext_notfound was not found on your system. Please check!" >&5
-echo "$as_me: error: libcext $cpl_cext_notfound was not found on your system. Please check!" >&2;}
-   { (exit 1); exit 1; }; }
-        else
-            echo "$as_me:$LINENO: result: libraries $cpl_cext_libraries, headers $cpl_cext_includes" >&5
-echo "${ECHO_T}libraries $cpl_cext_libraries, headers $cpl_cext_includes" >&6
-        fi
 
+    if test "x$exec_prefix" != "xNONE"; then
+        sex_exec_prefix=$exec_prefix/lib/${PACKAGE}-${VERSION}
+        ac_configure_args="$ac_configure_args --exec_prefix $sex_exec_prefix"
+    elif test "x$prefix" != "xNONE"; then
+        sex_exec_prefix=$prefix/lib/${PACKAGE}-${VERSION}
+        ac_configure_args="$ac_configure_args --exec_prefix $sex_exec_prefix"
+    else
+        sex_exec_prefix=$ac_default_prefix/lib/${PACKAGE}-${VERSION}
+        ac_configure_args="$ac_configure_args --exec_prefix $sex_exec_prefix"
+    fi
 
-        # Set up the symbols
 
-        CX_INCLUDES="-I$cpl_cext_includes"
-        CX_LDFLAGS="-L$cpl_cext_libraries"
-        LIBCEXT="-lcext"
 
 
-        echo "$as_me:$LINENO: checking whether libcext can be used" >&5
-echo $ECHO_N "checking whether libcext can be used... $ECHO_C" >&6
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+subdirs="$subdirs sextractor"
 
 
-        cpl_cext_cflags_save="$CFLAGS"
-        cpl_cext_ldflags_save="$LDFLAGS"
-        cpl_cext_libs_save="$LIBS"
+ac_config_files="$ac_config_files Makefile doxygen/Doxyfile mosca/Makefile mosca/libmosca/Makefile mosca/libmosca/tests/Makefile irplib/Makefile irplib/tests/Makefile fors/Makefile fors/tests/Makefile recipes/Makefile recipes/tests/Makefile Makefile.purify reflex/Makefile reflex/ForsSpec.xml"
 
-        CFLAGS="$CX_INCLUDES $CFLAGS"
-        LDFLAGS="$CX_LDFLAGS $LDFLAGS"
-        LIBS="$LIBCEXT"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
 
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-                       #include <cxutils.h>
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
 
-int
-main ()
-{
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
 
-                       cx_program_set_name("MyProgram");
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cpl_cext_is_usable="yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+DEFS=-DHAVE_CONFIG_H
 
-cpl_cext_is_usable="no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
 
-        echo "$as_me:$LINENO: result: $cpl_cext_is_usable" >&5
-echo "${ECHO_T}$cpl_cext_is_usable" >&6
+LTLIBOBJS=$ac_ltlibobjs
 
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
 
-        CFLAGS="$cpl_cext_cflags_save"
-        LDFLAGS="$cpl_cext_ldflags_save"
-        LIBS="$cpl_cext_libs_save"
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${PURIFY_TRUE}" && test -z "${PURIFY_FALSE}"; then
+  as_fn_error $? "conditional \"PURIFY\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ONLINE_MODE_TRUE}" && test -z "${ONLINE_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"ONLINE_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
-        if test x"$cpl_cext_is_usable" = xno; then
-            { { echo "$as_me:$LINENO: error: Linking with libcext failed! Please check architecture!" >&5
-echo "$as_me: error: Linking with libcext failed! Please check architecture!" >&2;}
-   { (exit 1); exit 1; }; }
-        fi
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
 
-    else
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
 
-        echo "$as_me:$LINENO: result: disabled" >&5
-echo "${ECHO_T}disabled" >&6
-        { echo "$as_me:$LINENO: WARNING: libcext checks have been disabled! This package may not build!" >&5
-echo "$as_me: WARNING: libcext checks have been disabled! This package may not build!" >&2;}
-        CX_INCLUDES=""
-        CX_LDFLAGS=""
-        LIBCEXT=""
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
 
-    fi
 
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
 
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
 
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
 
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
 
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-        # Set up the symbols
 
-        CPL_INCLUDES="-I$cpl_includes $CX_INCLUDES $CFITSIO_INCLUDES"
-        CPL_LDFLAGS="-L$cpl_libraries $CX_LDFLAGS $CFITSIO_LDFLAGS"
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
 
 
-    if test -z ""; then
-        LIBCPLCORE='-lcplcore'
-        LIBCPLDRS='-lcpldrs'
-        LIBCPLUI='-lcplui'
-        LIBCPLDFS='-lcpldfs'
-    else
-        LIBCPLCORE='$(top_builddir)/cplcore/libcplcore.la'
-        LIBCPLDRS='$(top_builddir)/cpldrs/libcpldrs.la'
-        LIBCPLUI='$(top_builddir)/cplui/libcplui.la'
-        LIBCPLDFS='$(top_builddir)/cpldfs/libcpldfs.la'
-    fi
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
 
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
 
 
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
 
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
 
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
 
-        echo "$as_me:$LINENO: checking whether CPL can be used" >&5
-echo $ECHO_N "checking whether CPL can be used... $ECHO_C" >&6
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 
-        cpl_cflags_save="$CFLAGS"
-        cpl_ldflags_save="$LDFLAGS"
-        cpl_libs_save="$LIBS"
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
 
-        CFLAGS="$CPL_INCLUDES $CFLAGS"
-        LDFLAGS="$CPL_LDFLAGS $LDFLAGS"
-        LIBS="$LIBCPLCORE $LIBCEXT $LIBS"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-                       #include <cpl.h>
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
 
-int
-main ()
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
 {
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
-                       cpl_init(CPL_INIT_DEFAULT);
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cpl_is_usable="yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
-cpl_is_usable="no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
 
-        echo "$as_me:$LINENO: result: $cpl_is_usable" >&5
-echo "${ECHO_T}$cpl_is_usable" >&6
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by FORS Instrument Pipeline $as_me 4.11.12, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
-        ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
 
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
 
-        CFLAGS="$cpl_cflags_save"
-        LDFLAGS="$cpl_ldflags_save"
-        LIBS="$cpl_libs_save"
+_ACEOF
 
-        if test x"$cpl_is_usable" = xno; then
-            { { echo "$as_me:$LINENO: error: Linking with CPL failed! Please check architecture!" >&5
-echo "$as_me: error: Linking with CPL failed! Please check architecture!" >&2;}
-   { (exit 1); exit 1; }; }
-        fi
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
 
-    else
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
 
-        echo "$as_me:$LINENO: result: disabled" >&5
-echo "${ECHO_T}disabled" >&6
-        { echo "$as_me:$LINENO: WARNING: CPL checks have been disabled! This package may not build!" >&5
-echo "$as_me: WARNING: CPL checks have been disabled! This package may not build!" >&2;}
-        CPL_INCLUDES=""
-        CPL_LDFLAGS=""
-        LIBCPLCORE=""
-        LIBCPLDRS=""
-        LIBCPLUI=""
-        LIBCPLDFS=""
 
-    fi
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
 
+_ACEOF
 
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
 
+Usage: $0 [OPTION]... [TAG]...
 
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
 
+Configuration files:
+$config_files
 
+Configuration headers:
+$config_headers
 
+Configuration commands:
+$config_commands
 
+Report bugs to <usd-help at eso.org>."
 
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+FORS Instrument Pipeline config.status 4.11.12
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
 
-# Check for Purify
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
 
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
 
-    echo "$as_me:$LINENO: checking for PURIFY" >&5
-echo $ECHO_N "checking for PURIFY... $ECHO_C" >&6
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
 
-    # Check whether --enable-purify or --disable-purify was given.
-if test "${enable_purify+set}" = set; then
-  enableval="$enable_purify"
-  enable_purify=$enableval
-else
-  enable_purify=yes
-fi;
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
 
-    if test "x$enable_purify" = xyes ; then
-      echo "$as_me:$LINENO: result: enabled" >&5
-echo "${ECHO_T}enabled" >&6
-      # Extract the first word of "purify", so it can be a program name with args.
-set dummy purify; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_PURIFY_CMD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$PURIFY_CMD"; then
-  ac_cv_prog_PURIFY_CMD="$PURIFY_CMD" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_PURIFY_CMD="command found"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
 
-  test -z "$ac_cv_prog_PURIFY_CMD" && ac_cv_prog_PURIFY_CMD="command not found"
-fi
-fi
-PURIFY_CMD=$ac_cv_prog_PURIFY_CMD
-if test -n "$PURIFY_CMD"; then
-  echo "$as_me:$LINENO: result: $PURIFY_CMD" >&5
-echo "${ECHO_T}$PURIFY_CMD" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
 
-      if test "$PURIFY_CMD" = "command not found" ; then
-        { echo "$as_me:$LINENO: WARNING: Disabling purify support" >&5
-echo "$as_me: WARNING: Disabling purify support" >&2;}
-        enable_purify=no
-      fi
-    else
-      echo "$as_me:$LINENO: result: disabled" >&5
-echo "${ECHO_T}disabled" >&6
-    fi
+  esac
+  shift
+done
 
+ac_configure_extra_args=
 
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
 
-if test "x$enable_purify" = "xyes"; then
-  PURIFY_TRUE=
-  PURIFY_FALSE='#'
-else
-  PURIFY_TRUE='#'
-  PURIFY_FALSE=
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
 fi
 
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
 
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
 
 
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-    if test -z "$plugindir"; then
-#        plugindir='${libdir}/${PACKAGE}/plugins/${PACKAGE}-${VERSION}'
-        plugindir='${libdir}/esopipes-plugins/${PACKAGE}-${VERSION}'
-    fi
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
 
-    if test -z "$privatelibdir"; then
-        privatelibdir='${libdir}/${PACKAGE}-${VERSION}'
-    fi
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+reload_flag_CXX \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_CXX \
+with_gnu_ld_CXX \
+allow_undefined_flag_CXX \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_separator_CXX \
+exclude_expsyms_CXX \
+include_expsyms_CXX \
+file_list_spec_CXX \
+compiler_lib_search_dirs_CXX \
+predep_objects_CXX \
+postdep_objects_CXX \
+predeps_CXX \
+postdeps_CXX \
+compiler_lib_search_path_CXX; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
 
-    if test -z "$pipedocsdir"; then
-        pipedocsdir='${datadir}/doc/esopipes/${PACKAGE}-${VERSION}/'
-    fi
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_CXX \
+archive_expsym_cmds_CXX \
+module_cmds_CXX \
+module_expsym_cmds_CXX \
+export_symbols_cmds_CXX \
+prelink_cmds_CXX \
+postlink_cmds_CXX; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
 
-    htmldir='${pipedocsdir}/html'
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
 
-#    if test -z "$htmldir"; then
-#        htmldir='${datadir}/doc/${PACKAGE}/html'
-#    fi
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
 
-    if test -z "$configdir"; then
-       configdir='${prefix}/share/esopipes/${PACKAGE}-${VERSION}/config'
-    fi
 
-    if test -z "$wkfextradir"; then
-        wkfextradir='${datadir}/esopipes/${PACKAGE}-${VERSION}/reflex'
-    fi
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
 
-    if test -z "$wkfcopydir"; then
-        wkfcopydir='${datadir}/reflex/workflows/${PACKAGE}-${VERSION}'
-    fi
 
 
 
 
+_ACEOF
 
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "doxygen/Doxyfile") CONFIG_FILES="$CONFIG_FILES doxygen/Doxyfile" ;;
+    "mosca/Makefile") CONFIG_FILES="$CONFIG_FILES mosca/Makefile" ;;
+    "mosca/libmosca/Makefile") CONFIG_FILES="$CONFIG_FILES mosca/libmosca/Makefile" ;;
+    "mosca/libmosca/tests/Makefile") CONFIG_FILES="$CONFIG_FILES mosca/libmosca/tests/Makefile" ;;
+    "irplib/Makefile") CONFIG_FILES="$CONFIG_FILES irplib/Makefile" ;;
+    "irplib/tests/Makefile") CONFIG_FILES="$CONFIG_FILES irplib/tests/Makefile" ;;
+    "fors/Makefile") CONFIG_FILES="$CONFIG_FILES fors/Makefile" ;;
+    "fors/tests/Makefile") CONFIG_FILES="$CONFIG_FILES fors/tests/Makefile" ;;
+    "recipes/Makefile") CONFIG_FILES="$CONFIG_FILES recipes/Makefile" ;;
+    "recipes/tests/Makefile") CONFIG_FILES="$CONFIG_FILES recipes/tests/Makefile" ;;
+    "Makefile.purify") CONFIG_FILES="$CONFIG_FILES Makefile.purify" ;;
+    "reflex/Makefile") CONFIG_FILES="$CONFIG_FILES reflex/Makefile" ;;
+    "reflex/ForsSpec.xml") CONFIG_FILES="$CONFIG_FILES reflex/ForsSpec.xml" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
 
 
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
 
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
 
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
-    # Define a preprocesor symbol for the plugin search paths
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
 
-#    AC_DEFINE_UNQUOTED(FORS_PLUGIN_DIR, "${PACKAGE}/plugins",
-#                       [Plugin directory tree prefix])
 
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
 
-cat >>confdefs.h <<_ACEOF
-#define FORS_PLUGIN_DIR "esopipes-plugins"
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
-    eval plugin_dir="$plugindir"
-    plugin_path=`eval echo $plugin_dir | \
-                sed -e "s/\/${PACKAGE}-${VERSION}.*$//"`
-
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
 
-cat >>confdefs.h <<_ACEOF
-#define FORS_PLUGIN_PATH "$plugin_path"
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
 
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
 
-    # Define the preprocessor symbols for the sextractor executable
-    # and the configuration files.
+  print line
+}
 
-    eval sext_bindir="${prefix}/lib/${PACKAGE}-${VERSION}/bin"
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[	 ]*$//
+}'
+fi
 
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
 
-cat >>confdefs.h <<_ACEOF
-#define FORS_SEXTRACTOR_PATH "$sext_bindir"
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
 _ACEOF
 
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
 
-    eval d="$configdir"
-    eval sext_configdir="$d"
-
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
 
-cat >>confdefs.h <<_ACEOF
-#define FORS_SEXTRACTOR_CONFIG "$sext_configdir"
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
 _ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
 
 
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
 
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
 
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
 
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
 
-# Check whether --with-extra-includes or --without-extra-includes was given.
-if test "${with_extra_includes+set}" = set; then
-  withval="$with_extra_includes"
-  eso_with_extra_includes=$withval
-else
-  eso_with_extra_includes=NONE
-fi;
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
 
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
-# Check whether --with-extra-libs or --without-extra-libs was given.
-if test "${with_extra_libs+set}" = set; then
-  withval="$with_extra_libs"
-  eso_with_extra_libs=$withval
-else
-  eso_with_extra_libs=NONE
-fi;
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-    echo "$as_me:$LINENO: checking for extra includes" >&5
-echo $ECHO_N "checking for extra includes... $ECHO_C" >&6
-    if test "${eso_cv_with_extra_includes+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
 
-                     eso_cv_with_extra_includes=$eso_with_extra_includes
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
 
-fi
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
 
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
 
-    if test x"$eso_cv_with_extra_includes" != xNONE; then
-        eso_save_IFS=$IFS
-        IFS=':'
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
 
-        for dir in $eso_cv_with_extra_includes; do
-            EXTRA_INCLUDES="$EXTRA_INCLUDES -I$dir"
-        done
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
 
-        IFS=$eso_save_IFS
-        echo "$as_me:$LINENO: result: added" >&5
-echo "${ECHO_T}added" >&6
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
     else
-        echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+      continue
     fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+    "libtool":C)
 
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
 
-    echo "$as_me:$LINENO: checking for extra libs" >&5
-echo $ECHO_N "checking for extra libs... $ECHO_C" >&6
-    if test "${eso_cv_with_extra_libs+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
 
-                     eso_cv_with_extra_libs=$eso_with_extra_libs
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
 
-fi
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 
-    if test x"$eso_cv_with_extra_libs" != xNONE; then
-        eso_save_IFS=$IFS
-        IFS=':'
+# The names of the tagged configurations supported by this script.
+available_tags="CXX "
 
-        for dir in $eso_cv_with_extra_libs; do
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$dir"
-        done
+# ### BEGIN LIBTOOL CONFIG
 
-        IFS=$eso_save_IFS
-        echo "$as_me:$LINENO: result: added" >&5
-echo "${ECHO_T}added" >&6
-    else
-        echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    fi
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
 
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
 
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
 
+# What type of objects to build.
+pic_mode=$pic_mode
 
-    # Symbols for package include file and library search paths
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
 
-    FORS_INCLUDES='-I$(top_srcdir)/fors'
-    FORS_LDFLAGS='-L$(top_builddir)/fors'
-    IRPLIB_INCLUDES='-I$(top_srcdir)/irplib'
-    MOSCA_INCLUDES='-I$(top_srcdir)/mosca/libmosca'
-    # No -L for IRPLIB which is statically linked
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
 
-    #WCSLIB_LDFLAGS='-L$(top_builddir)/wcslib-4.2/C'
-    #WCSLIB_INCLUDES='-I$(top_srcdir)/wcslib-4.2/C'
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
 
-    # Library aliases
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
 
-    LIBFORS='$(top_builddir)/fors/libfors.la'
-    #LIBWCSLIB='$(top_builddir)/wcslib-4.2/C/libwcs-4.2.a'
-    LIBIRPLIB='$(top_builddir)/irplib/libirplib.la'
-    LIBMOSCA='$(top_builddir)/mosca/libmosca/libmosca.la'
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
 
-    # Substitute the defined symbols
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
+# A sed program that does not truncate output.
+SED=$lt_SED
 
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
 
+# A grep program that handles long lines.
+GREP=$lt_GREP
 
+# An ERE matcher.
+EGREP=$lt_EGREP
 
-    #AC_SUBST(WCSLIB_INCLUDES)
-    #AC_SUBST(WCSLIB_LDFLAGS)
-    #AC_SUBST(LIBWCSLIB)
+# A literal string matcher.
+FGREP=$lt_FGREP
 
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
 
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
 
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
 
+# Object file suffix (normally "o").
+objext=$ac_objext
 
+# Executable file suffix (normally "").
+exeext=$exeext
 
+# whether the shell understands "unset".
+lt_unset=$lt_unset
 
-    # Check for CPL and user defined libraries
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
 
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
 
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
 
-    all_includes='$(FORS_INCLUDES) $(CPL_INCLUDES) $(CX_INCLUDES) $(IRPLIB_INCLUDES) $(MOSCA_INCLUDES) $(EXTRA_INCLUDES)'
-    all_ldflags='$(FORS_LDFLAGS) $(CPL_LDFLAGS) $(CX_LDFLAGS) $(EXTRA_LDFLAGS)'
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
 
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
 
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
 
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
 
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
 
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
 
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
 
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
 
+# The archiver.
+AR=$lt_AR
 
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
 
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
 
-    # Check whether --enable-online or --disable-online was given.
-if test "${enable_online+set}" = set; then
-  enableval="$enable_online"
-  fors_enable_online=$enableval
-else
-  fors_enable_online=no
-fi;
+# A symbol stripping program.
+STRIP=$lt_STRIP
 
-    echo "$as_me:$LINENO: checking whether an online support should be enabled" >&5
-echo $ECHO_N "checking whether an online support should be enabled... $ECHO_C" >&6
-if test "${fors_cv_enable_online+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  fors_cv_enable_online=$fors_enable_online
-fi
-echo "$as_me:$LINENO: result: $fors_cv_enable_online" >&5
-echo "${ECHO_T}$fors_cv_enable_online" >&6
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
-#
-#    if test x"$fors_cv_enable_online" = xyes; then
-#
-#        PSFEXDIR=psfex
-#        PSFEX_CONFIG="masktoccd.psfex masktoccd_1.sex masktoccd_2.sex"
-#
-#        AC_DEFINE(ONLINE_MODE)
-#
-#    else
-#
-#        PSFEXDIR=""
-#        PSFEX_CONFIG=""
-#
-#    fi
-#
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
 
+# A C compiler.
+LTCC=$lt_CC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
 
-if test x$fors_cv_enable_online = xyes; then
-  ONLINE_MODE_TRUE=
-  ONLINE_MODE_FALSE='#'
-else
-  ONLINE_MODE_TRUE='#'
-  ONLINE_MODE_FALSE=
-fi
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
-#    AC_SUBST(PSFEXDIR)
-#    AC_SUBST(PSFEX_CONFIG)
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
 
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
 
-echo "$as_me:$LINENO: checking if malloc debugging is wanted" >&5
-echo $ECHO_N "checking if malloc debugging is wanted... $ECHO_C" >&6
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
 
-# Check whether --with-dmalloc or --without-dmalloc was given.
-if test "${with_dmalloc+set}" = set; then
-  withval="$with_dmalloc"
-  if test "$withval" = yes; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
 
-cat >>confdefs.h <<\_ACEOF
-#define WITH_DMALLOC 1
-_ACEOF
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
 
-  LIBS="$LIBS -ldmalloc"
-  LDFLAGS="$LDFLAGS -g"
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi;
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
 
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
 
-# Add supplementary preprocessor symbols to config.h.in
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
 
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
 
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
 
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
 
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
 
+# Old archive suffix (normally "a").
+libext=$libext
 
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
 
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
-    if test "x$exec_prefix" != "xNONE"; then
-        sex_exec_prefix=$exec_prefix/lib/${PACKAGE}-${VERSION}
-        ac_configure_args="$ac_configure_args --exec_prefix $sex_exec_prefix"
-    elif test "x$prefix" != "xNONE"; then
-        sex_exec_prefix=$prefix/lib/${PACKAGE}-${VERSION}
-        ac_configure_args="$ac_configure_args --exec_prefix $sex_exec_prefix"
-    else
-        sex_exec_prefix=$ac_default_prefix/lib/${PACKAGE}-${VERSION}
-        ac_configure_args="$ac_configure_args --exec_prefix $sex_exec_prefix"
-    fi
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
 
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
 
+# Do we need a version for libraries?
+need_version=$need_version
 
+# Library versioning type.
+version_type=$version_type
 
-subdirs="$subdirs sextractor"
+# Shared library runtime path variable.
+runpath_var=$runpath_var
 
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
 
-                                                                                                                                  ac_config_files="$ac_config_files Makefile doxygen/Doxyfile mosca/Makefile mosca/libmosca/Makefile irplib/Makefile irplib/tests/Makefile fors/Makefile fors/tests/Makefile recipes/Makefile recipes/tests/Makefile Makefile.purify reflex/Makefile reflex/ForsSpec.xml"
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
 
-_ACEOF
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
 
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
-  (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
-      # `set' does not quote correctly, so add quotes (double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \).
-      sed -n \
-	"s/'/'\\\\''/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
-    *)
-      # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-      ;;
-    esac;
-} |
-  sed '
-     t clear
-     : clear
-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
-     t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
-    cat confcache >$cache_file
-  else
-    echo "not updating unwritable cache $cache_file"
-  fi
-fi
-rm -f confcache
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
 
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[	 ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[	 ]*$//;
-}'
-fi
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
 
-DEFS=-DHAVE_CONFIG_H
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
 
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-  # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
 
-LTLIBOBJS=$ac_ltlibobjs
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
 
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
 
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${PURIFY_TRUE}" && test -z "${PURIFY_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"PURIFY\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"PURIFY\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${ONLINE_MODE_TRUE}" && test -z "${ONLINE_MODE_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"ONLINE_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"ONLINE_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
 
 
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
+# The linker used to build libraries.
+LD=$lt_LD
 
-# NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
-  fi
-done
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
 
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
+# A language specific compiler.
+CC=$lt_compiler
 
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
 
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
 
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
 
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
 
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
-    sed '
-      N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
-      t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
-   { (exit 1); exit 1; }; }
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
 
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
-  # Exit status is that of the last command.
-  exit
-}
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
 
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
 
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
 
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
 
-as_executable_p="test -f"
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
 
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
 
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
 
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
-# CDPATH.
-$as_unset CDPATH
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
 
-exec 6>&1
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
 
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
 
-This file was extended by FORS Instrument Pipeline $as_me 4.9.23, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
 
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
 
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
 
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
 
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
 
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
 
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
 
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
 
-Usage: $0 [OPTIONS] [FILE]...
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
 
-  -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
-  -q, --quiet      do not print progress messages
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-		   instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
-		   instantiate the configuration header FILE
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
 
-Configuration files:
-$config_files
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
 
-Configuration headers:
-$config_headers
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
 
-Configuration commands:
-$config_commands
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
 
-Report bugs to <bug-autoconf at gnu.org>."
-_ACEOF
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
 
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-FORS Instrument Pipeline config.status 4.9.23
-configured by $0, generated by GNU Autoconf 2.59,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+# ### END LIBTOOL CONFIG
 
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
-_ACEOF
+_LT_EOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  -*)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
     ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
   esac
 
-  case $ac_option in
-  # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    $ac_shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
-    ac_need_defaults=false;;
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil | --si | --s)
-    ac_cs_silent=: ;;
-
-  # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; } ;;
 
-  *) ac_config_targets="$ac_config_targets $1" ;;
+ltmain="$ac_aux_dir/ltmain.sh"
 
-  esac
-  shift
-done
 
-ac_configure_extra_args=
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  if test x"$xsi_shell" = xyes; then
+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\    # positional parameters, so assign one to ordinary parameter first.\
+\    func_stripname_result=${3}\
+\    func_stripname_result=${func_stripname_result#"${1}"}\
+\    func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\    func_split_long_opt_name=${1%%=*}\
+\    func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\    func_split_short_opt_arg=${1#??}\
+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\    case ${1} in\
+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\      *)    func_lo2o_result=${1} ;;\
+\    esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+    func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+    func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+    func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+    eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\    func_quote_for_eval "${2}"\
+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
 
-if $ac_cs_silent; then
-  exec 6>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
 
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
+    cat <<_LT_EOF >> "$ofile"
 
-_ACEOF
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
 
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS section.
-#
+# The linker used to build libraries.
+LD=$lt_LD_CXX
 
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
 
-_ACEOF
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
 
+# A language specific compiler.
+CC=$lt_compiler_CXX
 
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-  "doxygen/Doxyfile" ) CONFIG_FILES="$CONFIG_FILES doxygen/Doxyfile" ;;
-  "mosca/Makefile" ) CONFIG_FILES="$CONFIG_FILES mosca/Makefile" ;;
-  "mosca/libmosca/Makefile" ) CONFIG_FILES="$CONFIG_FILES mosca/libmosca/Makefile" ;;
-  "irplib/Makefile" ) CONFIG_FILES="$CONFIG_FILES irplib/Makefile" ;;
-  "irplib/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES irplib/tests/Makefile" ;;
-  "fors/Makefile" ) CONFIG_FILES="$CONFIG_FILES fors/Makefile" ;;
-  "fors/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES fors/tests/Makefile" ;;
-  "recipes/Makefile" ) CONFIG_FILES="$CONFIG_FILES recipes/Makefile" ;;
-  "recipes/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES recipes/tests/Makefile" ;;
-  "Makefile.purify" ) CONFIG_FILES="$CONFIG_FILES Makefile.purify" ;;
-  "reflex/Makefile" ) CONFIG_FILES="$CONFIG_FILES reflex/Makefile" ;;
-  "reflex/ForsSpec.xml" ) CONFIG_FILES="$CONFIG_FILES reflex/ForsSpec.xml" ;;
-  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
-  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
-  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
-  esac
-done
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
 
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
 
-# Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
 
-# Create a (secure) tmp directory for tmp files.
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
 
-{
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
-}  ||
-{
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
-} ||
-{
-   echo "$me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
 
-_ACEOF
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
 
-cat >>$CONFIG_STATUS <<_ACEOF
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
 
-#
-# CONFIG_FILES section.
-#
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
 
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s, at SHELL@,$SHELL,;t t
-s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s, at exec_prefix@,$exec_prefix,;t t
-s, at prefix@,$prefix,;t t
-s, at program_transform_name@,$program_transform_name,;t t
-s, at bindir@,$bindir,;t t
-s, at sbindir@,$sbindir,;t t
-s, at libexecdir@,$libexecdir,;t t
-s, at datadir@,$datadir,;t t
-s, at sysconfdir@,$sysconfdir,;t t
-s, at sharedstatedir@,$sharedstatedir,;t t
-s, at localstatedir@,$localstatedir,;t t
-s, at libdir@,$libdir,;t t
-s, at includedir@,$includedir,;t t
-s, at oldincludedir@,$oldincludedir,;t t
-s, at infodir@,$infodir,;t t
-s, at mandir@,$mandir,;t t
-s, at build_alias@,$build_alias,;t t
-s, at host_alias@,$host_alias,;t t
-s, at target_alias@,$target_alias,;t t
-s, at DEFS@,$DEFS,;t t
-s, at ECHO_C@,$ECHO_C,;t t
-s, at ECHO_N@,$ECHO_N,;t t
-s, at ECHO_T@,$ECHO_T,;t t
-s, at LIBS@,$LIBS,;t t
-s, at build@,$build,;t t
-s, at build_cpu@,$build_cpu,;t t
-s, at build_vendor@,$build_vendor,;t t
-s, at build_os@,$build_os,;t t
-s, at host@,$host,;t t
-s, at host_cpu@,$host_cpu,;t t
-s, at host_vendor@,$host_vendor,;t t
-s, at host_os@,$host_os,;t t
-s, at target@,$target,;t t
-s, at target_cpu@,$target_cpu,;t t
-s, at target_vendor@,$target_vendor,;t t
-s, at target_os@,$target_os,;t t
-s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s, at INSTALL_DATA@,$INSTALL_DATA,;t t
-s, at CYGPATH_W@,$CYGPATH_W,;t t
-s, at PACKAGE@,$PACKAGE,;t t
-s, at VERSION@,$VERSION,;t t
-s, at ACLOCAL@,$ACLOCAL,;t t
-s, at AUTOCONF@,$AUTOCONF,;t t
-s, at AUTOMAKE@,$AUTOMAKE,;t t
-s, at AUTOHEADER@,$AUTOHEADER,;t t
-s, at MAKEINFO@,$MAKEINFO,;t t
-s, at install_sh@,$install_sh,;t t
-s, at STRIP@,$STRIP,;t t
-s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s, at INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s, at mkdir_p@,$mkdir_p,;t t
-s, at AWK@,$AWK,;t t
-s, at SET_MAKE@,$SET_MAKE,;t t
-s, at am__leading_dot@,$am__leading_dot,;t t
-s, at AMTAR@,$AMTAR,;t t
-s, at am__tar@,$am__tar,;t t
-s, at am__untar@,$am__untar,;t t
-s, at MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
-s, at MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
-s, at MAINT@,$MAINT,;t t
-s, at FORS_VERSION@,$FORS_VERSION,;t t
-s, at FORS_MAJOR_VERSION@,$FORS_MAJOR_VERSION,;t t
-s, at FORS_MINOR_VERSION@,$FORS_MINOR_VERSION,;t t
-s, at FORS_MICRO_VERSION@,$FORS_MICRO_VERSION,;t t
-s, at FORS_INTERFACE_AGE@,$FORS_INTERFACE_AGE,;t t
-s, at FORS_BINARY_VERSION@,$FORS_BINARY_VERSION,;t t
-s, at FORS_BINARY_AGE@,$FORS_BINARY_AGE,;t t
-s, at LT_CURRENT@,$LT_CURRENT,;t t
-s, at LT_REVISION@,$LT_REVISION,;t t
-s, at LT_AGE@,$LT_AGE,;t t
-s, at CC@,$CC,;t t
-s, at CFLAGS@,$CFLAGS,;t t
-s, at LDFLAGS@,$LDFLAGS,;t t
-s, at CPPFLAGS@,$CPPFLAGS,;t t
-s, at ac_ct_CC@,$ac_ct_CC,;t t
-s, at EXEEXT@,$EXEEXT,;t t
-s, at OBJEXT@,$OBJEXT,;t t
-s, at DEPDIR@,$DEPDIR,;t t
-s, at am__include@,$am__include,;t t
-s, at am__quote@,$am__quote,;t t
-s, at AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s, at AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s, at AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s, at CCDEPMODE@,$CCDEPMODE,;t t
-s, at am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s, at am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s, at CPP@,$CPP,;t t
-s, at CXX@,$CXX,;t t
-s, at CXXFLAGS@,$CXXFLAGS,;t t
-s, at ac_ct_CXX@,$ac_ct_CXX,;t t
-s, at CXXDEPMODE@,$CXXDEPMODE,;t t
-s, at am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
-s, at am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
-s, at LN_S@,$LN_S,;t t
-s, at ESO_DEBUG_FLAGS@,$ESO_DEBUG_FLAGS,;t t
-s, at EGREP@,$EGREP,;t t
-s, at DOXYGEN@,$DOXYGEN,;t t
-s, at LATEX@,$LATEX,;t t
-s, at SED@,$SED,;t t
-s, at ECHO@,$ECHO,;t t
-s, at AR@,$AR,;t t
-s, at ac_ct_AR@,$ac_ct_AR,;t t
-s, at RANLIB@,$RANLIB,;t t
-s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s, at CXXCPP@,$CXXCPP,;t t
-s, at F77@,$F77,;t t
-s, at FFLAGS@,$FFLAGS,;t t
-s, at ac_ct_F77@,$ac_ct_F77,;t t
-s, at LIBTOOL@,$LIBTOOL,;t t
-s, at LIBTOOL_DEPS@,$LIBTOOL_DEPS,;t t
-s, at PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t
-s, at LIBPTHREAD@,$LIBPTHREAD,;t t
-s, at CFITSIO_INCLUDES@,$CFITSIO_INCLUDES,;t t
-s, at CFITSIO_LDFLAGS@,$CFITSIO_LDFLAGS,;t t
-s, at LIBCFITSIO@,$LIBCFITSIO,;t t
-s, at CX_INCLUDES@,$CX_INCLUDES,;t t
-s, at CX_LDFLAGS@,$CX_LDFLAGS,;t t
-s, at LIBCEXT@,$LIBCEXT,;t t
-s, at LIBCPLCORE@,$LIBCPLCORE,;t t
-s, at LIBCPLDRS@,$LIBCPLDRS,;t t
-s, at LIBCPLUI@,$LIBCPLUI,;t t
-s, at LIBCPLDFS@,$LIBCPLDFS,;t t
-s, at CPL_INCLUDES@,$CPL_INCLUDES,;t t
-s, at CPL_LDFLAGS@,$CPL_LDFLAGS,;t t
-s, at PURIFY_CMD@,$PURIFY_CMD,;t t
-s, at PURIFY_TRUE@,$PURIFY_TRUE,;t t
-s, at PURIFY_FALSE@,$PURIFY_FALSE,;t t
-s, at plugindir@,$plugindir,;t t
-s, at privatelibdir@,$privatelibdir,;t t
-s, at htmldir@,$htmldir,;t t
-s, at pipedocsdir@,$pipedocsdir,;t t
-s, at configdir@,$configdir,;t t
-s, at wkfextradir@,$wkfextradir,;t t
-s, at wkfcopydir@,$wkfcopydir,;t t
-s, at FORS_INCLUDES@,$FORS_INCLUDES,;t t
-s, at FORS_LDFLAGS@,$FORS_LDFLAGS,;t t
-s, at LIBFORS@,$LIBFORS,;t t
-s, at IRPLIB_INCLUDES@,$IRPLIB_INCLUDES,;t t
-s, at LIBIRPLIB@,$LIBIRPLIB,;t t
-s, at MOSCA_INCLUDES@,$MOSCA_INCLUDES,;t t
-s, at LIBMOSCA@,$LIBMOSCA,;t t
-s, at all_includes@,$all_includes,;t t
-s, at all_ldflags@,$all_ldflags,;t t
-s, at ONLINE_MODE_TRUE@,$ONLINE_MODE_TRUE,;t t
-s, at ONLINE_MODE_FALSE@,$ONLINE_MODE_FALSE,;t t
-s, at subdirs@,$subdirs,;t t
-s, at LIBOBJS@,$LIBOBJS,;t t
-s, at LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
 
-_ACEOF
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
 
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
-  fi
-fi # test -n "$CONFIG_FILES"
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
 
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
 
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
 
-  ac_builddir=.
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
 
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
 
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
 
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
 
-  case $INSTALL in
-  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
-  esac
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-				     sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-  sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s, at configure_input@,$configure_input,;t t
-s, at srcdir@,$ac_srcdir,;t t
-s, at abs_srcdir@,$ac_abs_srcdir,;t t
-s, at top_srcdir@,$ac_top_srcdir,;t t
-s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s, at builddir@,$ac_builddir,;t t
-s, at abs_builddir@,$ac_abs_builddir,;t t
-s, at top_builddir@,$ac_top_builddir,;t t
-s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
-s, at INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
 
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
 
-#
-# CONFIG_HEADER section.
-#
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
 
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
-ac_dB='[	 ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
 
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 # Do quote $f, to prevent DOS paths from being IFS'd.
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
 
-_ACEOF
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
 
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h.  The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status.  Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless.  Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments.  This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
 
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo '  :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
-do
-  # Write a limited-size here document to $tmp/defines.sed.
-  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#define' lines.
-  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
-  rm -f conftest.defines
-  mv conftest.tail conftest.defines
-done
-rm -f conftest.defines
-echo '  fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
-  # Write a limited-size here document to $tmp/undefs.sed.
-  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#undef'
-  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
-  rm -f conftest.undefs
-  mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
-  if test x"$ac_file" != x-; then
-    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
-      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
-    else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
 
-      rm -f $ac_file
-      mv $tmp/config.h $ac_file
-    fi
-  else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
-  fi
-# Compute $ac_file's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $ac_file | $ac_file:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
-  esac
-done
-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X$ac_file : 'X\(//\)[^/]' \| \
-	 X$ac_file : 'X\(//\)$' \| \
-	 X$ac_file : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X$ac_file |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`/stamp-h$_am_stamp_count
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
 
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
-  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
-  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
-  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_dest" : 'X\(//\)[^/]' \| \
-	 X"$ac_dest" : 'X\(//\)$' \| \
-	 X"$ac_dest" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
 
-  ac_builddir=.
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
 
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
 
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
 
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
 
-  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
-  case $ac_dest in
-    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`(dirname "$mf") 2>/dev/null ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$mf" : 'X\(//\)[^/]' \| \
-	 X"$mf" : 'X\(//\)$' \| \
-	 X"$mf" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$mf" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`(dirname "$file") 2>/dev/null ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$file" : 'X\(//\)[^/]' \| \
-	 X"$file" : 'X\(//\)$' \| \
-	 X"$file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    { if $as_mkdir_p; then
-    mkdir -p $dirpart/$fdir
-  else
-    as_dir=$dirpart/$fdir
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
-   { (exit 1); exit 1; }; }; }
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
 
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
-  done
-done
  ;;
+
   esac
-done
-_ACEOF
+done # for ac_tag
 
-cat >>$CONFIG_STATUS <<\_ACEOF
 
-{ (exit 0); exit 0; }
+as_fn_exit 0
 _ACEOF
-chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
 
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
@@ -25219,7 +21963,7 @@ if test "$no_create" != yes; then
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
+  $ac_cs_success || as_fn_exit 1
 fi
 
 #
@@ -25227,10 +21971,14 @@ fi
 #
 if test "$no_recursion" != yes; then
 
-  # Remove --cache-file and --srcdir arguments so they do not pile up.
+  # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+  # so they do not pile up.
   ac_sub_configure_args=
   ac_prev=
-  for ac_arg in $ac_configure_args; do
+  eval "set x $ac_configure_args"
+  shift
+  for ac_arg
+  do
     if test -n "$ac_prev"; then
       ac_prev=
       continue
@@ -25253,126 +22001,92 @@ if test "$no_recursion" != yes; then
       ac_prev=prefix ;;
     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
       ;;
-    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
+    --disable-option-checking)
+      ;;
+    *)
+      case $ac_arg in
+      *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      esac
+      as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
     esac
   done
 
   # Always prepend --prefix to ensure using the same prefix
   # in subdir configurations.
-  ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args"
+  ac_arg="--prefix=$prefix"
+  case $ac_arg in
+  *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  esac
+  ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
+
+  # Pass --silent
+  if test "$silent" = yes; then
+    ac_sub_configure_args="--silent $ac_sub_configure_args"
+  fi
+
+  # Always prepend --disable-option-checking to silence warnings, since
+  # different subdirs can have different --enable and --with options.
+  ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
 
   ac_popdir=`pwd`
   for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
 
     # Do not complain, so a configure script can configure whichever
     # parts of a large source tree are present.
-    test -d $srcdir/$ac_dir || continue
-
-    { echo "$as_me:$LINENO: configuring in $ac_dir" >&5
-echo "$as_me: configuring in $ac_dir" >&6;}
-    { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
+    test -d "$srcdir/$ac_dir" || continue
 
+    ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+    $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
+    $as_echo "$ac_msg" >&6
+    as_dir="$ac_dir"; as_fn_mkdir_p
     ac_builddir=.
 
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
 
-    cd $ac_dir
+    cd "$ac_dir"
 
     # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'"
-    elif test -f $ac_srcdir/configure; then
-      ac_sub_configure="$SHELL '$ac_srcdir/configure'"
-    elif test -f $ac_srcdir/configure.in; then
-      ac_sub_configure=$ac_configure
+    if test -f "$ac_srcdir/configure.gnu"; then
+      ac_sub_configure=$ac_srcdir/configure.gnu
+    elif test -f "$ac_srcdir/configure"; then
+      ac_sub_configure=$ac_srcdir/configure
+    elif test -f "$ac_srcdir/configure.in"; then
+      # This should be Cygnus configure.
+      ac_sub_configure=$ac_aux_dir/configure
     else
-      { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5
-echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
+$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
       ac_sub_configure=
     fi
 
@@ -25381,21 +22095,23 @@ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
       # Make the cache file name correct relative to the subdirectory.
       case $cache_file in
       [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
-      *) # Relative path.
-	ac_sub_cache_file=$ac_top_builddir$cache_file ;;
+      *) # Relative name.
+	ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
       esac
 
-      { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
-echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
       # The eval makes quoting arguments work.
-      eval $ac_sub_configure $ac_sub_configure_args \
-	   --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir ||
-	{ { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5
-echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
-   { (exit 1); exit 1; }; }
+      eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+	as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
     fi
 
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
 
diff --git a/configure.ac b/configure.ac
index d169cec..c821d78 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script.
 
-AC_INIT([FORS Instrument Pipeline], [4.9.23], [usd-help at eso.org], [fors])
+AC_INIT([FORS Instrument Pipeline], [4.11.12], [usd-help at eso.org], [fors])
 AC_PREREQ([2.59])
 
 AC_CONFIG_SRCDIR([Makefile.am])
@@ -74,6 +74,9 @@ ESO_FUNC_STRDUP
 CPL_CHECK_CFITSIO
 CPL_CHECK_LIBS
 
+# Check for GSL 
+CPL_CHECK_GSL
+
 # Check for Purify
 CHECK_PURIFY
 
@@ -84,32 +87,6 @@ FORS_ENABLE_ONLINE
 
 AM_WITH_DMALLOC
 
-# Add supplementary preprocessor symbols to config.h.in
-AH_VERBATIM([LINE_LENGTH_MAX],
-            [
-/*
- * The maximum length, in bytes of an input line. It is set to the
- * POSIX2 value.
- */
-
-#ifndef LINE_LENGTH_MAX
-#  define LINE_LENGTH_MAX  2048
-#endif
-            ])
-
-AH_VERBATIM([PATHNAME_MAX],
-            [
-/*
- * Define the maximum number of characters a filename including the
- * path may have, excluding the string terminator.
- */
-
-#ifndef PATHNAME_MAX
-#  define PATHNAME_MAX  4096
-#endif
-            ])
-
-
 FORS_SET_SEX_PREFIX
 
 AC_CONFIG_SUBDIRS([sextractor])
@@ -118,6 +95,7 @@ AC_CONFIG_FILES(Makefile
                 doxygen/Doxyfile
                 mosca/Makefile
                 mosca/libmosca/Makefile
+                mosca/libmosca/tests/Makefile
                 irplib/Makefile
                 irplib/tests/Makefile
                 fors/Makefile
diff --git a/fors/Makefile.am b/fors/Makefile.am
index bb5f364..bf66d72 100644
--- a/fors/Makefile.am
+++ b/fors/Makefile.am
@@ -31,14 +31,18 @@ MAINTAINERCLEANFILES = Makefile.in
 endif
 
 
-AM_CPPFLAGS = $(all_includes)
+AM_CPPFLAGS = $(all_includes) $(GSL_CFLAGS)
+
+AM_CXXFLAGS = -Wall -Wextra 
 
 pkginclude_HEADERS = fors_bias_impl.h \
                      fors_dark_impl.h \
                      fors_data.h \
+                     fors_detected_slits.h \
                      fors_dfs.h \
                      fors_double.h \
                      fors_extract.h \
+                     fors_flat_normalise.h \
                      fors_header.h \
                      fors_identify.h \
                      fors_image.h \
@@ -46,6 +50,7 @@ pkginclude_HEADERS = fors_bias_impl.h \
                      fors_img_screen_flat_impl.h \
                      fors_img_sky_flat_impl.h \
                      fors_instrument.h \
+                     fors_overscan.h \
                      fors_paf.h \
                      fors_pattern.h \
                      fors_pfits.h \
@@ -72,9 +77,11 @@ privatelib_LTLIBRARIES = libfors.la
 libfors_la_SOURCES = fors_bias_impl.c \
                      fors_dark_impl.c \
                      fors_data.c \
+                     fors_detected_slits.cc \
                      fors_dfs.c \
                      fors_double.c \
                      fors_extract.c \
+                     fors_flat_normalise.cc \
                      fors_header.c \
                      fors_identify.c \
                      fors_image.c \
@@ -82,6 +89,7 @@ libfors_la_SOURCES = fors_bias_impl.c \
                      fors_img_screen_flat_impl.c \
                      fors_img_sky_flat_impl.c \
                      fors_instrument.c \
+                     fors_overscan.cc \
                      fors_paf.c \
                      fors_pattern.c \
                      fors_pfits.c \
@@ -100,9 +108,9 @@ libfors_la_SOURCES = fors_bias_impl.c \
                      list.c \
                      moses.c
 
-libfors_la_LDFLAGS = $(CPL_LDFLAGS) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-libfors_la_LIBADD = $(LIBIRPLIB) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
-libfors_la_DEPENDENCIES = $(LIBIRPLIB)
+libfors_la_LDFLAGS = $(CPL_LDFLAGS) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined
+libfors_la_LIBADD = $(LIBMOSCA) $(LIBIRPLIB) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
+libfors_la_DEPENDENCIES = $(LIBIRPLIB) $(LIBMOSCA)
 
 # distributed config files
 dist_config_DATA = fors.conv fors.nnw fors.param
@@ -114,16 +122,16 @@ fors.sex: $(srcdir)/fors.sex.tpl
 
 EXTRA_DIST = fors.sex.tpl
 
-noinst_PROGRAMS = create_stetson \
-                  create_phot
+#noinst_PROGRAMS = create_stetson \
+#                  create_phot
 
-create_stetson_LDFLAGS = $(CPL_LDFLAGS)
-create_stetson_LDADD = $(LIBFORS) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
-create_stetson_DEPENDENCIES = libfors.la
+#create_stetson_LDFLAGS = $(CPL_LDFLAGS)
+#create_stetson_LDADD = $(LIBFORS) $(LIBMOSCA) $(GSL_LIBS) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
+#create_stetson_DEPENDENCIES = libfors.la
 
-create_phot_LDFLAGS = $(CPL_LDFLAGS)
-create_phot_LDADD = $(LIBFORS) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
-create_phot_DEPENDENCIES = libfors.la
+#create_phot_LDFLAGS = $(CPL_LDFLAGS)
+#create_phot_LDADD = $(LIBFORS) $(LIBMOSCA) $(GSL_LIBS) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
+#create_phot_DEPENDENCIES = libfors.la
 
 clean-local:
 	$(RM) fors.sex
diff --git a/fors/Makefile.in b/fors/Makefile.in
index 600cd6d..7d9879b 100644
--- a/fors/Makefile.in
+++ b/fors/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,16 +16,29 @@
 
 
 
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,78 +53,146 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-noinst_PROGRAMS = create_stetson$(EXEEXT) create_phot$(EXEEXT)
 subdir = fors
 DIST_COMMON = $(dist_config_DATA) $(pkginclude_HEADERS) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/admin/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
-	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/purify.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(privatelibdir)" \
 	"$(DESTDIR)$(configdir)" "$(DESTDIR)$(configdir)" \
 	"$(DESTDIR)$(pkgincludedir)"
-privatelibLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(privatelib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 am_libfors_la_OBJECTS = fors_bias_impl.lo fors_dark_impl.lo \
-	fors_data.lo fors_dfs.lo fors_double.lo fors_extract.lo \
-	fors_header.lo fors_identify.lo fors_image.lo \
-	fors_img_science_impl.lo fors_img_screen_flat_impl.lo \
-	fors_img_sky_flat_impl.lo fors_instrument.lo fors_paf.lo \
+	fors_data.lo fors_detected_slits.lo fors_dfs.lo fors_double.lo \
+	fors_extract.lo fors_flat_normalise.lo fors_header.lo \
+	fors_identify.lo fors_image.lo fors_img_science_impl.lo \
+	fors_img_screen_flat_impl.lo fors_img_sky_flat_impl.lo \
+	fors_instrument.lo fors_overscan.lo fors_paf.lo \
 	fors_pattern.lo fors_pfits.lo fors_photometry_impl.lo \
 	fors_point.lo fors_polynomial.lo fors_qc.lo fors_setting.lo \
 	fors_stack.lo fors_star.lo fors_std_cat.lo fors_std_star.lo \
 	fors_tools.lo fors_utils.lo fors_zeropoint_impl.lo list.lo \
 	moses.lo
 libfors_la_OBJECTS = $(am_libfors_la_OBJECTS)
-PROGRAMS = $(noinst_PROGRAMS)
-create_phot_SOURCES = create_phot.c
-create_phot_OBJECTS = create_phot.$(OBJEXT)
-create_stetson_SOURCES = create_stetson.c
-create_stetson_OBJECTS = create_stetson.$(OBJEXT)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+libfors_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(libfors_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libfors_la_SOURCES) create_phot.c create_stetson.c
-DIST_SOURCES = $(libfors_la_SOURCES) create_phot.c create_stetson.c
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libfors_la_SOURCES)
+DIST_SOURCES = $(libfors_la_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
-	install-exec-recursive install-info-recursive \
-	install-recursive installcheck-recursive installdirs-recursive \
-	pdf-recursive ps-recursive uninstall-info-recursive \
-	uninstall-recursive
-configDATA_INSTALL = $(INSTALL_DATA)
-dist_configDATA_INSTALL = $(INSTALL_DATA)
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 DATA = $(config_DATA) $(dist_config_DATA)
-pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
 HEADERS = $(pkginclude_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
@@ -136,16 +217,17 @@ CX_LDFLAGS = @CX_LDFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOXYGEN = @DOXYGEN@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 FORS_BINARY_AGE = @FORS_BINARY_AGE@
 FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
 FORS_INCLUDES = @FORS_INCLUDES@
@@ -155,12 +237,17 @@ FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
 FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
 FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
 FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
 LATEX = @LATEX@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBCEXT = @LIBCEXT@
 LIBCFITSIO = @LIBCFITSIO@
@@ -176,48 +263,52 @@ LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 LT_AGE = @LT_AGE@
 LT_CURRENT = @LT_CURRENT@
 LT_REVISION = @LT_REVISION@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
 MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
-ONLINE_MODE_FALSE = @ONLINE_MODE_FALSE@
-ONLINE_MODE_TRUE = @ONLINE_MODE_TRUE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PURIFY_CMD = @PURIFY_CMD@
-PURIFY_FALSE = @PURIFY_FALSE@
-PURIFY_TRUE = @PURIFY_TRUE@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 all_includes = @all_includes@
 all_ldflags = @all_ldflags@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -229,8 +320,12 @@ build_alias = @build_alias@
 build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
+builddir = @builddir@
 configdir = @configdir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -243,17 +338,21 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 pipedocsdir = @pipedocsdir@
 plugindir = @plugindir@
 prefix = @prefix@
 privatelibdir = @privatelibdir@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target = @target@
@@ -261,19 +360,25 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 wkfcopydir = @wkfcopydir@
 wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.8 foreign
 DISTCLEANFILES = *~
 SUBDIRS = . tests
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = $(all_includes)
+AM_CPPFLAGS = $(all_includes) $(GSL_CFLAGS)
+AM_CXXFLAGS = -Wall -Wextra 
 pkginclude_HEADERS = fors_bias_impl.h \
                      fors_dark_impl.h \
                      fors_data.h \
+                     fors_detected_slits.h \
                      fors_dfs.h \
                      fors_double.h \
                      fors_extract.h \
+                     fors_flat_normalise.h \
                      fors_header.h \
                      fors_identify.h \
                      fors_image.h \
@@ -281,6 +386,7 @@ pkginclude_HEADERS = fors_bias_impl.h \
                      fors_img_screen_flat_impl.h \
                      fors_img_sky_flat_impl.h \
                      fors_instrument.h \
+                     fors_overscan.h \
                      fors_paf.h \
                      fors_pattern.h \
                      fors_pfits.h \
@@ -307,9 +413,11 @@ privatelib_LTLIBRARIES = libfors.la
 libfors_la_SOURCES = fors_bias_impl.c \
                      fors_dark_impl.c \
                      fors_data.c \
+                     fors_detected_slits.cc \
                      fors_dfs.c \
                      fors_double.c \
                      fors_extract.c \
+                     fors_flat_normalise.cc \
                      fors_header.c \
                      fors_identify.c \
                      fors_image.c \
@@ -317,6 +425,7 @@ libfors_la_SOURCES = fors_bias_impl.c \
                      fors_img_screen_flat_impl.c \
                      fors_img_sky_flat_impl.c \
                      fors_instrument.c \
+                     fors_overscan.cc \
                      fors_paf.c \
                      fors_pattern.c \
                      fors_pfits.c \
@@ -335,9 +444,9 @@ libfors_la_SOURCES = fors_bias_impl.c \
                      list.c \
                      moses.c
 
-libfors_la_LDFLAGS = $(CPL_LDFLAGS) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-libfors_la_LIBADD = $(LIBIRPLIB) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
-libfors_la_DEPENDENCIES = $(LIBIRPLIB)
+libfors_la_LDFLAGS = $(CPL_LDFLAGS) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined
+libfors_la_LIBADD = $(LIBMOSCA) $(LIBIRPLIB) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
+libfors_la_DEPENDENCIES = $(LIBIRPLIB) $(LIBMOSCA)
 
 # distributed config files
 dist_config_DATA = fors.conv fors.nnw fors.param
@@ -345,28 +454,22 @@ dist_config_DATA = fors.conv fors.nnw fors.param
 # non-distributed config files
 config_DATA = fors.sex
 EXTRA_DIST = fors.sex.tpl
-create_stetson_LDFLAGS = $(CPL_LDFLAGS)
-create_stetson_LDADD = $(LIBFORS) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
-create_stetson_DEPENDENCIES = libfors.la
-create_phot_LDFLAGS = $(CPL_LDFLAGS)
-create_phot_LDADD = $(LIBFORS) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
-create_phot_DEPENDENCIES = libfors.la
 all: all-recursive
 
 .SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
+.SUFFIXES: .c .cc .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  fors/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  fors/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fors/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign fors/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -384,48 +487,43 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 install-privatelibLTLIBRARIES: $(privatelib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(privatelibdir)" || $(mkdir_p) "$(DESTDIR)$(privatelibdir)"
-	@list='$(privatelib_LTLIBRARIES)'; for p in $$list; do \
+	@list='$(privatelib_LTLIBRARIES)'; test -n "$(privatelibdir)" || list=; \
+	list2=; for p in $$list; do \
 	  if test -f $$p; then \
-	    f=$(am__strip_dir) \
-	    echo " $(LIBTOOL) --mode=install $(privatelibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(privatelibdir)/$$f'"; \
-	    $(LIBTOOL) --mode=install $(privatelibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(privatelibdir)/$$f"; \
+	    list2="$$list2 $$p"; \
 	  else :; fi; \
-	done
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(privatelibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(privatelibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(privatelibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(privatelibdir)"; \
+	}
 
 uninstall-privatelibLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@set -x; list='$(privatelib_LTLIBRARIES)'; for p in $$list; do \
-	  p=$(am__strip_dir) \
-	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(privatelibdir)/$$p'"; \
-	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(privatelibdir)/$$p"; \
+	@list='$(privatelib_LTLIBRARIES)'; test -n "$(privatelibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(privatelibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(privatelibdir)/$$f"; \
 	done
 
 clean-privatelibLTLIBRARIES:
 	-test -z "$(privatelib_LTLIBRARIES)" || rm -f $(privatelib_LTLIBRARIES)
-	@list='$(privatelib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libfors.la: $(libfors_la_OBJECTS) $(libfors_la_DEPENDENCIES) 
-	$(LINK) -rpath $(privatelibdir) $(libfors_la_LDFLAGS) $(libfors_la_OBJECTS) $(libfors_la_LIBADD) $(LIBS)
-
-clean-noinstPROGRAMS:
-	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
-	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  echo " rm -f $$p $$f"; \
-	  rm -f $$p $$f ; \
-	done
-create_phot$(EXEEXT): $(create_phot_OBJECTS) $(create_phot_DEPENDENCIES) 
-	@rm -f create_phot$(EXEEXT)
-	$(LINK) $(create_phot_LDFLAGS) $(create_phot_OBJECTS) $(create_phot_LDADD) $(LIBS)
-create_stetson$(EXEEXT): $(create_stetson_OBJECTS) $(create_stetson_DEPENDENCIES) 
-	@rm -f create_stetson$(EXEEXT)
-	$(LINK) $(create_stetson_LDFLAGS) $(create_stetson_OBJECTS) $(create_stetson_LDADD) $(LIBS)
+	@list='$(privatelib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libfors.la: $(libfors_la_OBJECTS) $(libfors_la_DEPENDENCIES) $(EXTRA_libfors_la_DEPENDENCIES) 
+	$(libfors_la_LINK) -rpath $(privatelibdir) $(libfors_la_OBJECTS) $(libfors_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -433,14 +531,14 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/create_phot.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/create_stetson.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_bias_impl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_dark_impl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_data.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_detected_slits.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_dfs.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_double.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_extract.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_flat_normalise.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_header.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_identify.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_image.Plo at am__quote@
@@ -448,6 +546,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_img_screen_flat_impl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_img_sky_flat_impl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_instrument.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_overscan.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_paf.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_pattern.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fors_pfits.Plo at am__quote@
@@ -467,95 +566,124 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/moses.Plo at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
+.cc.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cc.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
 mostlyclean-libtool:
 	-rm -f *.lo
 
 clean-libtool:
 	-rm -rf .libs _libs
-
-distclean-libtool:
-	-rm -f libtool
-uninstall-info-am:
 install-configDATA: $(config_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(configdir)" || $(mkdir_p) "$(DESTDIR)$(configdir)"
-	@list='$(config_DATA)'; for p in $$list; do \
+	@list='$(config_DATA)'; test -n "$(configdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(configdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(configdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(configDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(configdir)/$$f'"; \
-	  $(configDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(configdir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(configdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(configdir)" || exit $$?; \
 	done
 
 uninstall-configDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(config_DATA)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(configdir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(configdir)/$$f"; \
-	done
+	@list='$(config_DATA)'; test -n "$(configdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(configdir)'; $(am__uninstall_files_from_dir)
 install-dist_configDATA: $(dist_config_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(configdir)" || $(mkdir_p) "$(DESTDIR)$(configdir)"
-	@list='$(dist_config_DATA)'; for p in $$list; do \
+	@list='$(dist_config_DATA)'; test -n "$(configdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(configdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(configdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(dist_configDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(configdir)/$$f'"; \
-	  $(dist_configDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(configdir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(configdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(configdir)" || exit $$?; \
 	done
 
 uninstall-dist_configDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(dist_config_DATA)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(configdir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(configdir)/$$f"; \
-	done
+	@list='$(dist_config_DATA)'; test -n "$(configdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(configdir)'; $(am__uninstall_files_from_dir)
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
-	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
-	  $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
 	done
 
 uninstall-pkgincludeHEADERS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
-	done
+	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@failcom='exit 1'; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
 	  case $$f in \
 	    *=* | --[!k]*);; \
@@ -564,7 +692,11 @@ $(RECURSIVE_TARGETS):
 	done; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -572,51 +704,23 @@ $(RECURSIVE_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-	@failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
 	done
 ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -624,14 +728,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
@@ -643,92 +747,123 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test ! -f $$subdir/TAGS || \
-	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(mkdir_p) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	    distdir=`$(am__cd) $(distdir) && pwd`; \
-	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
-	    (cd $$subdir && \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
 	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$top_distdir" \
-	        distdir="$$distdir/$$subdir" \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
 	        distdir) \
 	      || exit 1; \
 	  fi; \
 	done
 check-am: all-am
 check: check-recursive
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS)
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
 installdirs: installdirs-recursive
 installdirs-am:
 	for dir in "$(DESTDIR)$(privatelibdir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(pkgincludedir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-recursive
 install-exec: install-exec-recursive
@@ -740,16 +875,22 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
@@ -758,14 +899,14 @@ maintainer-clean-generic:
 	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 clean: clean-recursive
 
-clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
+clean-am: clean-generic clean-libtool clean-local \
 	clean-privatelibLTLIBRARIES mostlyclean-am
 
 distclean: distclean-recursive
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-libtool distclean-tags
+	distclean-tags
 
 dvi: dvi-recursive
 
@@ -773,6 +914,8 @@ dvi-am:
 
 html: html-recursive
 
+html-am:
+
 info: info-recursive
 
 info-am:
@@ -780,12 +923,30 @@ info-am:
 install-data-am: install-configDATA install-dist_configDATA \
 	install-pkgincludeHEADERS install-privatelibLTLIBRARIES
 
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-recursive
+
+install-html-am:
+
 install-info: install-info-recursive
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -807,36 +968,49 @@ ps: ps-recursive
 ps-am:
 
 uninstall-am: uninstall-configDATA uninstall-dist_configDATA \
-	uninstall-info-am uninstall-pkgincludeHEADERS \
-	uninstall-privatelibLTLIBRARIES
+	uninstall-pkgincludeHEADERS uninstall-privatelibLTLIBRARIES
 
-uninstall-info: uninstall-info-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
-	clean clean-generic clean-libtool clean-local \
-	clean-noinstPROGRAMS clean-privatelibLTLIBRARIES \
-	clean-recursive ctags ctags-recursive distclean \
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	clean-local clean-privatelibLTLIBRARIES cscopelist \
+	cscopelist-recursive ctags ctags-recursive distclean \
 	distclean-compile distclean-generic distclean-libtool \
-	distclean-recursive distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-configDATA \
-	install-data install-data-am install-dist_configDATA \
-	install-exec install-exec-am install-info install-info-am \
-	install-man install-pkgincludeHEADERS \
-	install-privatelibLTLIBRARIES install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic maintainer-clean-recursive \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-configDATA install-data \
+	install-data-am install-dist_configDATA install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-pkgincludeHEADERS \
+	install-privatelibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
 	mostlyclean mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
-	tags tags-recursive uninstall uninstall-am \
-	uninstall-configDATA uninstall-dist_configDATA \
-	uninstall-info-am uninstall-pkgincludeHEADERS \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-configDATA \
+	uninstall-dist_configDATA uninstall-pkgincludeHEADERS \
 	uninstall-privatelibLTLIBRARIES
 
 fors.sex: $(srcdir)/fors.sex.tpl
 	cat $(srcdir)/fors.sex.tpl | sed "s|FORS_SEXTRACTOR_CONFIG|@configdir@|" > fors.sex
 
+#noinst_PROGRAMS = create_stetson \
+#                  create_phot
+
+#create_stetson_LDFLAGS = $(CPL_LDFLAGS)
+#create_stetson_LDADD = $(LIBFORS) $(LIBMOSCA) $(GSL_LIBS) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
+#create_stetson_DEPENDENCIES = libfors.la
+
+#create_phot_LDFLAGS = $(CPL_LDFLAGS)
+#create_phot_LDADD = $(LIBFORS) $(LIBMOSCA) $(GSL_LIBS) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLCORE)
+#create_phot_DEPENDENCIES = libfors.la
+
 clean-local:
 	$(RM) fors.sex
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/fors/create_phot.c b/fors/create_phot.c
deleted file mode 100644
index 55d2e62..0000000
--- a/fors/create_phot.c
+++ /dev/null
@@ -1,455 +0,0 @@
-#include <fors_data.h>
-#include <fors_pfits.h>
-#include <fors_dfs.h>
-
-#include <cpl.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#define HARDCODED 0 /* create same values as MIDAS? */
-
-#define DIE \
-do { \
-    fprintf(stderr, "Error at %s:%d\n", __func__, __LINE__); \
-    if (errno) perror(NULL); \
-    cpl_end(); \
-    exit(EXIT_FAILURE); \
-} while (0)
-
-#define CHECK \
-do { \
-    if (cpl_error_get_code()) { \
-        cpl_msg_error(cpl_func, "%s %s", cpl_error_get_where(), cpl_error_get_message()); \
-        DIE; \
-    } \
-} while (0)
-
-int main(int argc, char *argv[])
-{
-    cpl_init(CPL_INIT_DEFAULT);
-
-    errno = 0;
-
-    if (argc != 1) {
-        fprintf(stderr,
-                "Usage:\n    %s\n", argv[0]);
-        DIE;
-    }
-    
-    /* Numbers and code imported from MIDAS: fspil/pipe/proc/fors_zeropoint.prg */
-
-    // FORS1 data
-//    if (fors1upgraded == 0) {
-
-    /* Old fors1 */
-    double exti_old_u =  0.425;  // Extinction in the U band
-    double exti_old_b =  0.245;  // Extinction in the B band
-    double exti_old_v =  0.125;  // Extinction in the V band
-    double exti_old_r =  0.081;  // Extinction in the R band
-    double exti_old_i =  0.038;  // Extinction in the I band
-  
-    double colo_old_u =  0.067;  // Color term in the U band
-    double colo_old_b = -0.078;  // Color term in the B band
-    double colo_old_v =  0.035;  // Color term in the V band
-    double colo_old_r =  0.042;  // Color term in the R band
-    double colo_old_i = -0.038;  // Color term in the I band
-
-    double exti_old_u_high =  0.000;  // Extinction in the u band
-    double exti_old_b_high =  0.000;  // Extinction in the b band
-    double exti_old_v_high =  0.000;  // Extinction in the v band
-    double exti_old_g_high =  0.000;  // Extinction in the g band
-
-    double colo_old_u_high =  0.000;  // Color term in the u band
-    double colo_old_b_high =  0.000;  // Color term in the b band
-    double colo_old_v_high =  0.000;  // Color term in the v band
-    double colo_old_g_high =  0.000;  // Color term in the g band
-
-    double zero_old_u = 99.99; // not available
-    double zero_old_b = 99.99;
-    double zero_old_v = 99.99;
-    double zero_old_r = 99.99;
-    double zero_old_i = 99.99;
-    double zero_old_g = 99.99;
-
-    struct {
-        const char *instrument;
-        struct {
-            const char *base_filename;
-            const char *chip_id;
-            struct { 
-                const char *filtername;
-                enum filter filter;
-                double exti, dexti;
-                double colo, dcolo;
-                double zero, dzero;
-            } data[9];
-        } chips[2];
-    }
-    dat[] = {
-        /* Old FORS1 */
-        {"FORS1", 
-         {
-             {"fors1_TK", "TK2048EB4-1",
-              {{"U_BESS", FILTER_U, .exti = exti_old_u     , .dexti = 0, .colo = colo_old_u     , .dcolo = 0, .zero = zero_old_u, .dzero = 0},
-               {"u_HIGH", FILTER_U, .exti = exti_old_u_high, .dexti = 0, .colo = colo_old_u_high, .dcolo = 0, .zero = zero_old_u, .dzero = 0},
-               {"B_BESS", FILTER_B, .exti = exti_old_b     , .dexti = 0, .colo = colo_old_b     , .dcolo = 0, .zero = zero_old_b, .dzero = 0},
-               {"b_HIGH", FILTER_B, .exti = exti_old_b_high, .dexti = 0, .colo = colo_old_b_high, .dcolo = 0, .zero = zero_old_b, .dzero = 0},
-               {"g_HIGH", FILTER_G, .exti = exti_old_g_high, .dexti = 0, .colo = colo_old_g_high, .dcolo = 0, .zero = zero_old_g, .dzero = 0},
-               {"V_BESS", FILTER_V, .exti = exti_old_v     , .dexti = 0, .colo = colo_old_v     , .dcolo = 0, .zero = zero_old_v, .dzero = 0},
-               {"v_HIGH", FILTER_V, .exti = exti_old_v_high, .dexti = 0, .colo = colo_old_v_high, .dcolo = 0, .zero = zero_old_v, .dzero = 0},
-               {"R_BESS", FILTER_R, .exti = exti_old_r     , .dexti = 0, .colo = colo_old_r     , .dcolo = 0, .zero = zero_old_r, .dzero = 0},
-               {"I_BESS", FILTER_I, .exti = exti_old_i     , .dexti = 0, .colo = colo_old_i     , .dcolo = 0, .zero = zero_old_i, .dzero = 0}}
-             },
-             {NULL, NULL, /* Not used */
-              {{"U_BESS", FILTER_U, .exti = exti_old_u     , .dexti = 0, .colo = colo_old_u     , .dcolo = 0, .zero = zero_old_u, .dzero = 0},
-               {"u_HIGH", FILTER_U, .exti = exti_old_u_high, .dexti = 0, .colo = colo_old_u_high, .dcolo = 0, .zero = zero_old_u, .dzero = 0},
-               {"B_BESS", FILTER_B, .exti = exti_old_b     , .dexti = 0, .colo = colo_old_b     , .dcolo = 0, .zero = zero_old_b, .dzero = 0},
-               {"b_HIGH", FILTER_B, .exti = exti_old_b_high, .dexti = 0, .colo = colo_old_b_high, .dcolo = 0, .zero = zero_old_b, .dzero = 0},
-               {"g_HIGH", FILTER_G, .exti = exti_old_g_high, .dexti = 0, .colo = colo_old_g_high, .dcolo = 0, .zero = zero_old_g, .dzero = 0},
-               {"V_BESS", FILTER_V, .exti = exti_old_v     , .dexti = 0, .colo = colo_old_v     , .dcolo = 0, .zero = zero_old_v, .dzero = 0},
-               {"v_HIGH", FILTER_V, .exti = exti_old_v_high, .dexti = 0, .colo = colo_old_v_high, .dcolo = 0, .zero = zero_old_v, .dzero = 0},
-               {"R_BESS", FILTER_R, .exti = exti_old_r     , .dexti = 0, .colo = colo_old_r     , .dcolo = 0, .zero = zero_old_r, .dzero = 0},
-               {"I_BESS", FILTER_I, .exti = exti_old_i     , .dexti = 0, .colo = colo_old_i     , .dcolo = 0, .zero = zero_old_i, .dzero = 0}}
-             }
-         }
-        },
-        /* New FORS1 */
-
-#if HARDCODED
-        /* Old values, hardcoded in MIDAS */
-
-        {"FORS1", 
-         {
-             {"fors1_Norma", "Norma III",
-              {{"U_BESS", FILTER_U, .exti = 0.456, .dexti = 0, .colo =  0.091, .dcolo = 0, .zero = 26.080, .dzero = 0.031},
-               {"u_HIGH", FILTER_U, .exti = 0.440, .dexti = 0, .colo =  0.106, .dcolo = 0, .zero = 26.572, .dzero = 0.049},
-               {"B_BESS", FILTER_B, .exti = 0.255, .dexti = 0, .colo = -0.107, .dcolo = 0, .zero = 28.163, .dzero = 0.023},
-               {"b_HIGH", FILTER_B, .exti = 0.230, .dexti = 0, .colo =  0.069, .dcolo = 0, .zero = 28.539, .dzero = 0.031},
-               {"g_HIGH", FILTER_G, .exti = 0.182, .dexti = 0, .colo =  0.031, .dcolo = 0, .zero = 28.867, .dzero = 0.032},
-               {"V_BESS", FILTER_V, .exti = 0.132, .dexti = 0, .colo =  0.020, .dcolo = 0, .zero = 28.227, .dzero = 0.023},
-               {"v_HIGH", FILTER_V, .exti = 0.115, .dexti = 0, .colo =  0.049, .dcolo = 0, .zero = 28.410, .dzero = 0.029},
-               {"R_BESS", FILTER_R, .exti = 0.090, .dexti = 0, .colo =  0.000, .dcolo = 0, .zero = 28.024, .dzero = 0.025},
-               {"I_BESS", FILTER_I, .exti = 0.051, .dexti = 0, .colo = -0.060, .dcolo = 0, .zero = 27.023, .dzero = 0.034}}
-             },
-             {"fors1_Marlene", "Marlene ",
-              {{"U_BESS", FILTER_U, .exti = 0.456, .dexti = 0, .colo =  0.091, .dcolo = 0, .zero = 26.080, .dzero = 0.031},
-               {"u_HIGH", FILTER_U, .exti = 0.440, .dexti = 0, .colo =  0.106, .dcolo = 0, .zero = 26.572, .dzero = 0.049},
-               {"B_BESS", FILTER_B, .exti = 0.255, .dexti = 0, .colo = -0.107, .dcolo = 0, .zero = 28.163, .dzero = 0.023},
-               {"b_HIGH", FILTER_B, .exti = 0.230, .dexti = 0, .colo =  0.069, .dcolo = 0, .zero = 28.539, .dzero = 0.031},
-               {"g_HIGH", FILTER_G, .exti = 0.182, .dexti = 0, .colo =  0.031, .dcolo = 0, .zero = 28.867, .dzero = 0.032},
-               {"V_BESS", FILTER_V, .exti = 0.132, .dexti = 0, .colo =  0.020, .dcolo = 0, .zero = 28.227, .dzero = 0.023},
-               {"v_HIGH", FILTER_V, .exti = 0.115, .dexti = 0, .colo =  0.049, .dcolo = 0, .zero = 28.410, .dzero = 0.029},
-               {"R_BESS", FILTER_R, .exti = 0.090, .dexti = 0, .colo =  0.000, .dcolo = 0, .zero = 28.024, .dzero = 0.025},
-               {"I_BESS", FILTER_I, .exti = 0.051, .dexti = 0, .colo = -0.060, .dcolo = 0, .zero = 27.023, .dzero = 0.034}}
-             },
-         }
-        },
-        
-        {"FORS2",
-         {
-             {"fors2_1453", "CCID20-14-5-3",
-              {{"U_SPECIAL", FILTER_U, .exti = 0.443, .dexti = 0, .colo =  0.076, .dcolo = 0, .zero = 24.365, .dzero = 0.045},
-               {"B_BESS"   , FILTER_B, .exti = 0.217, .dexti = 0, .colo = -0.033, .dcolo = 0, .zero = 27.740, .dzero = 0.032},
-               {"V_BESS"   , FILTER_V, .exti = 0.127, .dexti = 0, .colo =  0.022, .dcolo = 0, .zero = 28.186, .dzero = 0.025},
-               {"R_SPECIAL", FILTER_R, .exti = 0.098, .dexti = 0, .colo = -0.009, .dcolo = 0, .zero = 28.404, .dzero = 0.037},
-               {"I_BESS"   , FILTER_I, .exti = 0.060, .dexti = 0, .colo = -0.017, .dcolo = 0, .zero = 27.773, .dzero = 0.034},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}
-             },
-             
-             {"fors2_1456", "CCID20-14-5-6",
-              {{"U_SPECIAL", FILTER_U, .exti = 0.443, .dexti = 0, .colo =  0.076, .dcolo = 0, .zero = 24.365, .dzero = 0.045},
-               {"B_BESS"   , FILTER_B, .exti = 0.217, .dexti = 0, .colo = -0.033, .dcolo = 0, .zero = 27.740, .dzero = 0.032},
-               {"V_BESS"   , FILTER_V, .exti = 0.127, .dexti = 0, .colo =  0.022, .dcolo = 0, .zero = 28.186, .dzero = 0.025},
-               {"R_SPECIAL", FILTER_R, .exti = 0.098, .dexti = 0, .colo = -0.009, .dcolo = 0, .zero = 28.404, .dzero = 0.037},
-               {"I_BESS"   , FILTER_I, .exti = 0.060, .dexti = 0, .colo = -0.017, .dcolo = 0, .zero = 27.773, .dzero = 0.034},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}
-             }
-         }
-        }
-
-#else
-        /* Numbers from P79 as provided by DFO */
-
-        {"FORS1", 
-         {
-             {"fors1_Norma", "Norma III",
-              {{"U_BESS", FILTER_U, .exti = 0.447, .dexti = 0.018, .colo =  0.043, .dcolo = 0.008, .zero = 26.080, .dzero = 0.031},
-               {"u_HIGH", FILTER_U, .exti = 0.437, .dexti = 0.033, .colo =  0.066, .dcolo = 0.012, .zero = 26.572, .dzero = 0.049},
-               {"B_BESS", FILTER_B, .exti = 0.241, .dexti = 0.013, .colo = -0.128, .dcolo = 0.008, .zero = 28.163, .dzero = 0.023},
-               {"b_HIGH", FILTER_B, .exti = 0.222, .dexti = 0.020, .colo =  0.048, .dcolo = 0.009, .zero = 28.539, .dzero = 0.031},
-               {"g_HIGH", FILTER_G, .exti = 0.209, .dexti = 0.022, .colo = -0.096, .dcolo = 0.008, .zero = 28.867, .dzero = 0.032},
-               {"V_BESS", FILTER_V, .exti = 0.112, .dexti = 0.012, .colo = -0.015, .dcolo = 0.007, .zero = 28.227, .dzero = 0.023},
-               {"v_HIGH", FILTER_V, .exti = 0.139, .dexti = 0.018, .colo =  0.019, .dcolo = 0.008, .zero = 28.410, .dzero = 0.029},
-               {"R_BESS", FILTER_R, .exti = 0.087, .dexti = 0.014, .colo = -0.097, .dcolo = 0.015, .zero = 28.024, .dzero = 0.025},
-               {"I_BESS", FILTER_I, .exti = 0.027, .dexti = 0.021, .colo = -0.101, .dcolo = 0.011, .zero = 27.023, .dzero = 0.034}}
-             },
-             {"fors1_Marlene", "Marlene ",
-              {{"U_BESS", FILTER_U, .exti = 0.470, .dexti = 0.024, .colo =  0.039, .dcolo = 0.013, .zero = 26.069, .dzero = 0.041},
-               {"u_HIGH", FILTER_U, .exti = 0.445, .dexti = 0.051, .colo =  0.063, .dcolo = 0.018, .zero = 26.548, .dzero = 0.070},
-               {"B_BESS", FILTER_B, .exti = 0.316, .dexti = 0.019, .colo = -0.124, .dcolo = 0.012, .zero = 28.221, .dzero = 0.032},
-               {"b_HIGH", FILTER_B, .exti = 0.282, .dexti = 0.036, .colo =  0.059, .dcolo = 0.016, .zero = 28.563, .dzero = 0.052},
-               {"g_HIGH", FILTER_G, .exti = 0.287, .dexti = 0.063, .colo = -0.106, .dcolo = 0.019, .zero = 28.938, .dzero = 0.082},
-               {"V_BESS", FILTER_V, .exti = 0.158, .dexti = 0.018, .colo = -0.011, .dcolo = 0.012, .zero = 28.247, .dzero = 0.033},
-               {"v_HIGH", FILTER_V, .exti = 0.155, .dexti = 0.030, .colo =  0.019, .dcolo = 0.014, .zero = 28.388, .dzero = 0.046},
-               {"R_BESS", FILTER_R, .exti = 0.111, .dexti = 0.018, .colo = -0.047, .dcolo = 0.022, .zero = 28.009, .dzero = 0.033},
-               {"I_BESS", FILTER_I, .exti = 0.037, .dexti = 0.019, .colo = -0.100, .dcolo = 0.012, .zero = 27.038, .dzero = 0.035}}
-             },
-         }
-        },
-        
-        {"FORS2",
-         {
-             {"fors2_1453", "CCID20-14-5-3",
-              {{"U_SPECIAL", FILTER_U, .exti = 0.531, .dexti = 0.025, .colo =  0.069, .dcolo = 0.009, .zero = 24.365, .dzero = 0.045},
-               {"B_BESS"   , FILTER_B, .exti = 0.236, .dexti = 0.015, .colo = -0.026, .dcolo = 0.009, .zero = 27.740, .dzero = 0.032},
-               {"V_BESS"   , FILTER_V, .exti = 0.117, .dexti = 0.012, .colo = -0.002, .dcolo = 0.006, .zero = 28.186, .dzero = 0.025},
-               {"R_SPECIAL", FILTER_R, .exti = 0.067, .dexti = 0.020, .colo = -0.039, .dcolo = 0.016, .zero = 28.404, .dzero = 0.037},
-               {"I_BESS"   , FILTER_I, .exti = 0.049, .dexti = 0.016, .colo = -0.044, .dcolo = 0.007, .zero = 27.773, .dzero = 0.034},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}
-             },
-             
-             {"fors2_1456", "CCID20-14-5-6",
-              {{"U_SPECIAL", FILTER_U, .exti = 0.526, .dexti = 0.042, .colo =  0.067, .dcolo = 0.014, .zero = 24.476, .dzero = 0.066},
-               {"B_BESS"   , FILTER_B, .exti = 0.272, .dexti = 0.023, .colo = -0.062, .dcolo = 0.011, .zero = 27.837, .dzero = 0.040},
-               {"V_BESS"   , FILTER_V, .exti = 0.123, .dexti = 0.014, .colo = -0.008, .dcolo = 0.006, .zero = 28.207, .dzero = 0.028},
-               {"R_SPECIAL", FILTER_R, .exti = 0.065, .dexti = 0.022, .colo = -0.036, .dcolo = 0.013, .zero = 28.400, .dzero = 0.037},
-               {"I_BESS"   , FILTER_I, .exti = 0.023, .dexti = 0.013, .colo = -0.080, .dcolo = 0.008, .zero = 27.777, .dzero = 0.039},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-               {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}
-             }
-         }
-        }
-#endif
-    };
-    
-    CHECK;
-
-#if 1
-
-    /* For each instrument */
-    unsigned i;
-    for(i = 0; i < sizeof(dat) / sizeof(*dat); i++) {
-        
-        /* For each chip */
-        unsigned chips;
-        for(chips = 0; 
-            chips < sizeof(dat[i].chips) / sizeof(*dat[i].chips); 
-            chips++) {
-            
-            if (dat[i].chips[chips].chip_id == NULL) break;
-            
-            cpl_table *t = cpl_table_new(9999);
-            int size = 0;
-        
-            cpl_propertylist *header = cpl_propertylist_new();
-        
-            cpl_propertylist_update_string(header, FORS_PFITS_CHIP_ID, dat[i].chips[chips].chip_id);
-            cpl_propertylist_update_string(header, "ESO PRO CATG", PHOT_TABLE);
-            cpl_propertylist_update_string(header, FORS_PFITS_INSTRUME, dat[i].instrument);
-
-
-            //cpl_table_new_column(t, "Instrument" , CPL_TYPE_STRING);
-            //cpl_table_new_column(t, "Chip" , CPL_TYPE_STRING);
-            cpl_table_new_column(t, FORS_DATA_PHOT_FILTER , CPL_TYPE_STRING);
-            cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);
-            cpl_table_new_column(t, FORS_DATA_PHOT_DEXTCOEFF , CPL_TYPE_DOUBLE);
-            cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);
-            cpl_table_new_column(t, FORS_DATA_PHOT_DCOLORTERM, CPL_TYPE_DOUBLE);
-            cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);
-            cpl_table_new_column(t, FORS_DATA_PHOT_DZEROPOINT, CPL_TYPE_DOUBLE);
-        
-      
-            /* For each filter */
-            unsigned j;
-            for(j = 0; 
-                j < sizeof(dat[i].chips[chips].data) / sizeof(*dat[i].chips[chips].data); 
-                j++)
-                {            
-                    if (dat[i].chips[chips].data[j].filtername == NULL) break;
-                           
-                    //cpl_table_set_string(t, "Instrument", size, dat[i].instrument);
-                    //cpl_table_set_string(t, "Chip", size, dat[i].chips[chips].chip_id);
-                    cpl_table_set_string(t, FORS_DATA_PHOT_FILTER, size, dat[i].chips[chips].data[j].filtername);
-                    cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF , size, 
-                                         dat[i].chips[chips].data[j].exti);
-                    cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, size, 
-                                         dat[i].chips[chips].data[j].colo);
-                    cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, size,
-                                         dat[i].chips[chips].data[j].zero);
-                    cpl_table_set_double(t, FORS_DATA_PHOT_DEXTCOEFF , size, 
-                                         dat[i].chips[chips].data[j].dexti);
-                    cpl_table_set_double(t, FORS_DATA_PHOT_DCOLORTERM, size, 
-                                         dat[i].chips[chips].data[j].dcolo);
-                    cpl_table_set_double(t, FORS_DATA_PHOT_DZEROPOINT, size,
-                                         dat[i].chips[chips].data[j].dzero);
-                    
-                    size++;
-                }
-            
-            cpl_table_set_size(t, size);
-            //cpl_table_dump(t, 0, size, stdout);
-
-#if HARDCODED
-            const char *full_filename = cpl_sprintf("%s_phot_old.fits", 
-                                                    dat[i].chips[chips].base_filename);
-#else
-            const char *full_filename = cpl_sprintf("%s_phot.fits", 
-                                                    dat[i].chips[chips].base_filename);
-#endif
-            
-            cpl_table_save(t, header, NULL, full_filename, CPL_IO_DEFAULT);
-            
-            CHECK;  
-            fprintf(stdout, "Created %s\n", full_filename);
-
-            cpl_table_delete(t); t = NULL;
-            cpl_propertylist_delete(header); header = NULL;
-            cpl_free((void *)full_filename);
-        }  
-    }
-
-#else 
-    /* One big table */
-
-    cpl_table *t = cpl_table_new(9999);
-    int size = 0;
-
-    cpl_propertylist *header = cpl_propertylist_new();
-                
-    cpl_table_new_column(t, "Instrument" , CPL_TYPE_STRING);
-    cpl_table_new_column(t, FORS_DATA_PHOT_FILTER , CPL_TYPE_STRING);
-    cpl_table_new_column(t, "Chip" , CPL_TYPE_STRING);
-    cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);
-    cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);
-    cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);
-    
-    unsigned i;
-    for(i = 0; i < sizeof(dat) / sizeof(*dat); i++) {
-        
-        unsigned j;
-        for(j = 0; 
-            j < sizeof(dat[i].chips[chips].data) / sizeof(*dat[i].chips[chips].data); 
-            j++) {
-            
-            if (dat[i].chips[chips].data[j].filtername == NULL) break;
-            
-            
-            unsigned chips;
-            for(chips = 0; 
-                chips < sizeof(dat[i].chip_id) / sizeof(*dat[i].chip_id); 
-                chips++) {
-                
-                if (dat[i].chip_id[chips] == NULL) break;
-                
-                cpl_table_set_string(t, "Instrument", size, dat[i].instrument);
-                cpl_table_set_string(t, "Chip", size, dat[i].chip_id[chips]);
-                cpl_table_set_string(t, FORS_DATA_PHOT_FILTER, size, dat[i].chips[chips].data[j].filtername);
-                cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF , size, 
-                                     dat[i].chips[chips].data[j].exti);
-                cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, size, 
-                                     dat[i].chips[chips].data[j].colo);
-                cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, size,
-                                     dat[i].chips[chips].data[j].zero);
-                
-                size++;
-                //cpl_table_dump(t, 0, size, stdout);
-            }
-        }
-    }
-    
-    cpl_table_set_size(t, size);
-
-    cpl_table_save(t, NULL, NULL, filename, CPL_IO_DEFAULT);
-
-    CHECK;  
-    fprintf(stdout, "Created %s\n", filename);
-
-
-#endif
-
-
-
-
-
-
-
-#if 0
-
-
-
-
-
-    t = cpl_table_new(FORS_NUM_FILTER);
-
-    /* Here the order must match fors_data.h: enum filter */
-    double *exti[FORS_NUM_FILTER] = {&exti_u,
-                                     &exti_b,
-                                     NULL,   // g
-                                     &exti_v,
-                                     &exti_r,
-                                     &exti_i,
-                                     NULL};   // z
-
-    double *colo[FORS_NUM_FILTER] = {&colo_u,
-                                     &colo_b,
-                                     NULL,   // g
-                                     &colo_v,
-                                     &colo_r,
-                                     &colo_i,
-                                     NULL};   // z
-
-    double *zero[FORS_NUM_FILTER] = {&zero_u,
-                                     &zero_b,
-                                     NULL,
-                                     &zero_v,
-                                     &zero_r,
-                                     &zero_i,
-                                     NULL};
-
-    cpl_table_new_column(t, FORS_DATA_PHOT_FILTER   , CPL_TYPE_STRING);
-    cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);
-    cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);
-    cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);
-
-    int row = 0;
-    {
-        int i;
-        for(i = 0; i < cpl_table_get_nrow(t); i++) {
-            if (exti[i] != NULL && colo[i] != NULL && zero[i] != NULL) {
-                cpl_table_set_string(t, FORS_DATA_PHOT_FILTER  , row, FORS_DATA_STD_MAG[i]);
-                cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF, row, *(exti[i]));
-                cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, row, *(colo[i]));
-                cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, row, *(zero[i]));
-                row++;
-            }
-        }
-    }
-
-    CHECK;
-   
-    cpl_table_set_size(t, row);
-
-    cpl_table_save(t, NULL, NULL, filename, CPL_IO_DEFAULT);
-
-    CHECK;
-    
-    fprintf(stdout, "Created %s\n", filename);
-    cpl_table_delete(t);
-
-#endif
-
-    return 0;
-}
diff --git a/fors/create_stetson.c b/fors/create_stetson.c
deleted file mode 100644
index 0fbbb31..0000000
--- a/fors/create_stetson.c
+++ /dev/null
@@ -1,225 +0,0 @@
-#include<cpl.h>
-
-#include<stdio.h>
-#include<string.h>
-#include<errno.h>
-
-/*
-   This program creates a standard star FITS table from Stetson's list of ASCII data
-
-
-  Usage
-
-  1. Get all Stetson  *.pho and *.pos files
-  2. Filter out headers, append to single file:
-        $ cat *.pho | grep -v "vary?"   > stetson.pho
-        $ cat *.pos | grep -v Reference > stetson.pos
-  3. Convert to FITS
-        $ create_stetson_fits stetson.pho stetson.pos stetson.fits
-     This program will verify that the object names in the 2 ASCII 
-     files match row by row .
-
-*/
-
-/*
-  This research used the facilities of the Canadian Astronomy Data Centre operated
-  by the National Research Council of Canada with the support of the Canadian Space Agency.
-*/
-
-#define DIE \
-do { \
-    fprintf(stderr, "Error at %s:%d\n", __func__, __LINE__); \
-    if (errno) perror(NULL); \
-    cpl_end(); \
-    exit(EXIT_FAILURE); \
-} while (0)
-
-#define CHECK \
-do { \
-    if (cpl_error_get_code()) { \
-        cpl_msg_error(cpl_func, "%s", cpl_error_get_where()); \
-        DIE; \
-    } \
-} while (0)
-
-int main(int argc, char *argv[])
-{
-    cpl_table *table;
-    int size = 0;
-    const int maxsize = 100*1000;
-
-    cpl_init(CPL_INIT_DEFAULT);
-
-    if (argc != 4) {
-        fprintf(stderr,
-                "Usage:\n    %s  [stetson.pho] [stetson.pos]  [stetson.fits]\n", argv[0]);
-        DIE;
-    }
-    
-    const char *filename_pho = argv[1];
-    const char *filename_pos = argv[2];
-    const char *filename_out = argv[3];
-
-    table = cpl_table_new(maxsize);
-    CHECK;
-    
-    struct {
-        const char *colname;
-        cpl_type type;
-        const char *unit;
-    } data[] = {
-
-        {"OBJECT", CPL_TYPE_STRING, NULL},
-
-        {"RA" , CPL_TYPE_DOUBLE, "degree"},
-        {"DEC", CPL_TYPE_DOUBLE, "degree"},
-
-        /* estimated intrinsic variability in magnitude RMS */
-        {"VAR", CPL_TYPE_FLOAT, "mag rms"},
-
-        /*  B:     magnitude */
-        /*  ERR_B: magnitude error */
-        /*  N_B:   number of observations obtained on photometric occasions */
-        /*  n_B:   total number of observations */
-
-        {"B"    , CPL_TYPE_FLOAT, "mag"},
-        {"ERR_B", CPL_TYPE_FLOAT, "mag"},
-        {"N_B"  , CPL_TYPE_INT, NULL},
-        {"n_B"  , CPL_TYPE_INT, NULL},
-
-        {"V"    , CPL_TYPE_FLOAT, "mag"},
-        {"ERR_V", CPL_TYPE_FLOAT, "mag"},
-        {"N_V"  , CPL_TYPE_INT, NULL},
-        {"n_V"  , CPL_TYPE_INT, NULL},
-
-        {"R"    , CPL_TYPE_FLOAT, "mag"},
-        {"ERR_R", CPL_TYPE_FLOAT, "mag"},
-        {"N_R"  , CPL_TYPE_INT, NULL},
-        {"n_R"  , CPL_TYPE_INT, NULL},
-
-        {"I"    , CPL_TYPE_FLOAT, "mag"},
-        {"ERR_I", CPL_TYPE_FLOAT, "mag"},
-        {"N_I"  , CPL_TYPE_INT, NULL},
-        {"n_I"  , CPL_TYPE_INT, NULL}
-        
-    };
-    
-    {
-        unsigned i;
-        for (i = 0; i < sizeof(data) / sizeof(*data); i++) {
-            cpl_table_new_column     (table, data[i].colname, data[i].type);
-            if (data[i].unit != NULL) {
-                cpl_table_set_column_unit(table, data[i].colname, data[i].unit);
-            }
-        }
-    }
-    CHECK;
-
-    {
-        char name_pho[1000];
-        char name_pos[1000];
-        float mag[5];
-        float err[5];
-        int N[5];
-        int n[5];
-        float var;
-        float dummy;
-        int items_assigned;
-
-        FILE *file_pho = fopen(filename_pho, "r");
-        FILE *file_pos = fopen(filename_pos, "r");
-
-        if (file_pho == NULL) DIE;
-        if (file_pos == NULL) DIE;
-        
-        size = 0;
-        while((items_assigned = fscanf(file_pho, 
-                                       "%s"
-                                       "%f %f %d %d "
-                                       "%f %f %d %d "
-                                       "%f %f %d %d "
-                                       "%f %f %d %d "
-                                       "%f",
-                                       name_pho, 
-                                       &mag[0], &err[0], &N[0], &n[0],
-                                       &mag[1], &err[1], &N[1], &n[1],
-                                       &mag[2], &err[2], &N[2], &n[2],
-                                       &mag[3], &err[3], &N[3], &n[3], &var))
-              != EOF) {
-            double ra, dec;
-            int i;
-
-            printf("%d: %s ", items_assigned, name_pho);
-            printf("%f %f %d %d ", mag[0], err[0], N[0], n[0]);
-            printf("%f %f %d %d ", mag[1], err[1], N[1], n[1]);
-            printf("%f %f %d %d ", mag[2], err[2], N[2], n[2]);
-            printf("%f %f %d %d ", mag[3], err[3], N[3], n[3]);
-            printf("%f ", var);
-                
-            if (items_assigned != 18) DIE;
-
-
-            /* Read RA, DEC */
-            if (fscanf(file_pos,
-                       "%lf %lf "
-                       "%f %f %f "
-                       "%f %f %f "
-                       "%f %f %f %f "
-                       "%s",
-                       &ra, &dec,
-                       &dummy, &dummy, &dummy, //hexagesimal RA
-                       &dummy, &dummy, &dummy, //hexagesimal DEC
-                       &dummy, &dummy, &dummy, &dummy,  //offset in arcsecs, pixels
-                       name_pos) != 13) DIE;
-                       
-            printf("%s (%f, %f)", name_pos, ra, dec);
-            printf("\n");
-
-            if (strcmp(name_pho, name_pos) != 0) {
-                fprintf(stderr, "Mismatching OBJECT name: %s (pho), %s (pos)\n",
-                        name_pho, name_pos);
-                DIE;                
-            }
-            
-            cpl_table_set_string(table, data[0].colname, size, name_pho);
-            cpl_table_set_double(table, data[1].colname, size, ra);
-            cpl_table_set_double(table, data[2].colname, size, dec);
-            cpl_table_set_float (table, data[3].colname, size, var);
-            
-            for (i = 0; i < 4; i++) {
-                /* zero or two of N and n must be zero */
-                if (N[i] == 0 && n[i] != 0) DIE;
-                if (N[i] != 0 && n[i] == 0) DIE;
-                
-                if (N[i] != 0) {
-                    cpl_table_set_float (table, data[i*4+4].colname, size, mag[i]);
-                    cpl_table_set_float (table, data[i*4+5].colname, size, err[i]);
-                    cpl_table_set_int   (table, data[i*4+6].colname, size,   N[i]);
-                    cpl_table_set_int   (table, data[i*4+7].colname, size,   n[i]);
-                } else {
-                    cpl_table_set_invalid(table, data[i*4+4].colname, size);
-                    cpl_table_set_invalid(table, data[i*4+5].colname, size);
-                    cpl_table_set_invalid(table, data[i*4+6].colname, size);
-                    cpl_table_set_invalid(table, data[i*4+7].colname, size);
-                }
-            }
-            size++;
-        }
-        fclose(file_pho);
-
-        fclose(file_pos);
-    }
-
-
-    CHECK;
-
-    cpl_table_set_size(table, size);
-   
-    cpl_table_save(table, NULL, NULL, filename_out, CPL_IO_DEFAULT);
-
-    CHECK;
-    
-    fprintf(stdout, "Created %s\n", filename_out);
-
-    return 0;
-}
diff --git a/fors/fors_bias_impl.c b/fors/fors_bias_impl.c
index 5cf993e..b20501d 100644
--- a/fors/fors_bias_impl.c
+++ b/fors/fors_bias_impl.c
@@ -1,4 +1,4 @@
-/* $Id: fors_bias_impl.c,v 1.29 2012/11/06 09:42:15 cgarcia Exp $
+/* $Id: fors_bias_impl.c,v 1.33 2013-09-11 10:00:35 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/11/06 09:42:15 $
- * $Revision: 1.29 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-11 10:00:35 $
+ * $Revision: 1.33 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -133,7 +133,7 @@ void fors_bias(cpl_frameset *frames, const cpl_parameterlist *parameters)
             "No %s provided", BIAS);
 
     /* Get instrument setting */
-    setting = fors_setting_new(cpl_frameset_get_first(bias_frames));
+    setting = fors_setting_new(cpl_frameset_get_position(bias_frames, 0));
     assure( !cpl_error_get_code(), return, "Could not get instrument setting" );
 
     /* Load bias */
@@ -146,13 +146,13 @@ void fors_bias(cpl_frameset *frames, const cpl_parameterlist *parameters)
     
     /* QC */
     write_qc(qc, setting,
-             cpl_frameset_get_first(bias_frames),
+             cpl_frameset_get_position(bias_frames, 0),
              bias, master_bias, sm);
 
     /* Save product */
-    fors_dfs_save_image(frames, master_bias, MASTER_BIAS,
+    fors_dfs_save_image_err(frames, master_bias, MASTER_BIAS,
                         qc, parameters, fors_bias_name, 
-                        cpl_frameset_get_first(bias_frames));
+                        cpl_frameset_get_position(bias_frames, 0));
     assure( !cpl_error_get_code(), return, "Saving %s failed",
             MASTER_BIAS);
     
@@ -180,6 +180,9 @@ write_qc(cpl_propertylist *qc,
     const fors_image *second_raw = fors_image_list_next_const(bias);
     fors_image *image = NULL;
 
+    (void)setting; //Avoid compiler warning
+    (void)first_bias; //Avoid compiler warning
+
     fors_header_write_string(qc,
                              "QC.DID",
                              "2.0",
diff --git a/fors/fors_bias_impl.h b/fors/fors_bias_impl.h
index e840d52..646ae0c 100644
--- a/fors/fors_bias_impl.h
+++ b/fors/fors_bias_impl.h
@@ -1,4 +1,4 @@
-/* $Id: fors_bias_impl.h,v 1.2 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_bias_impl.h,v 1.2 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_BIAS_IMPL_H
diff --git a/fors/fors_dark_impl.c b/fors/fors_dark_impl.c
index 60bbfa9..6097245 100644
--- a/fors/fors_dark_impl.c
+++ b/fors/fors_dark_impl.c
@@ -1,4 +1,4 @@
-/* $Id: fors_dark_impl.c,v 1.15 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_dark_impl.c,v 1.18 2013-09-10 19:12:03 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
- * $Revision: 1.15 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-09-10 19:12:03 $
+ * $Revision: 1.18 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -132,14 +132,14 @@ void fors_dark(cpl_frameset *frames, const cpl_parameterlist *parameters)
     /* Find calibration */
     master_bias_frame = fors_frameset_extract(frames, MASTER_BIAS);
     assure( cpl_frameset_get_size(master_bias_frame) == 1, return, 
-            "One %s required. %d found", 
+            "One %s required. %"CPL_SIZE_FORMAT" found", 
             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame));
 
     /* Get instrument setting */
-    setting = fors_setting_new(cpl_frameset_get_first(dark_frames));
+    setting = fors_setting_new(cpl_frameset_get_position(dark_frames, 0));
     assure( !cpl_error_get_code(), return, "Could not get instrument setting" );
 
-    master_bias = fors_image_load(cpl_frameset_get_first(master_bias_frame), 
+    master_bias = fors_image_load(cpl_frameset_get_position(master_bias_frame, 0), 
                                   NULL, setting,
                                   NULL);
     assure( !cpl_error_get_code(), return, 
@@ -154,9 +154,9 @@ void fors_dark(cpl_frameset *frames, const cpl_parameterlist *parameters)
     assure( !cpl_error_get_code(), return, "Dark stacking failed");
     
     /* Save product */
-    fors_dfs_save_image(frames, master_dark, MASTER_DARK,
+    fors_dfs_save_image_err(frames, master_dark, MASTER_DARK,
                         NULL, parameters, fors_dark_name, 
-                        cpl_frameset_get_first(dark_frames));
+                        cpl_frameset_get_position(dark_frames, 0));
     assure( !cpl_error_get_code(), return, "Saving %s failed",
             MASTER_DARK);
     
diff --git a/fors/fors_dark_impl.h b/fors/fors_dark_impl.h
index d1d8f15..7f6cc95 100644
--- a/fors/fors_dark_impl.h
+++ b/fors/fors_dark_impl.h
@@ -1,4 +1,4 @@
-/* $Id: fors_dark_impl.h,v 1.5 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_dark_impl.h,v 1.5 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_DARK_IMPL_H
diff --git a/fors/fors_data.c b/fors/fors_data.c
index 68286ba..a85d9fa 100644
--- a/fors/fors_data.c
+++ b/fors/fors_data.c
@@ -1,4 +1,4 @@
-/* $Id: fors_data.c,v 1.43 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_data.c,v 1.44 2013-08-07 13:26:50 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
- * $Revision: 1.43 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-08-07 13:26:50 $
+ * $Revision: 1.44 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -122,17 +122,17 @@ fors_std_star_list_apply_wcs(               fors_std_star_list      *stars,
                 "Failed to convert from world to physical coordinates");
 
         assure( cpl_matrix_get_ncol(to) == 2,
-                return, "%d columns, 2 expected",
+                return, "%"CPL_SIZE_FORMAT" columns, 2 expected",
                 cpl_matrix_get_ncol(to));
 
         assure( cpl_matrix_get_nrow(to) == fors_std_star_list_size(stars),
-                return, "%d rows, %d expected",
+                return, "%"CPL_SIZE_FORMAT" rows, %d expected",
                 cpl_matrix_get_nrow(to), fors_std_star_list_size(stars));
         
         assure( status != NULL, return, NULL );
 
         assure( cpl_array_get_size(status) == fors_std_star_list_size(stars),
-                return, "Status array size is %d, %d expected",
+                return, "Status array size is %"CPL_SIZE_FORMAT", %d expected",
                 cpl_array_get_size(status), fors_std_star_list_size(stars));
         
         for (star = fors_std_star_list_first(stars), i = 0;
diff --git a/fors/fors_data.h b/fors/fors_data.h
index 36cd5fa..3d10b89 100644
--- a/fors/fors_data.h
+++ b/fors/fors_data.h
@@ -1,4 +1,4 @@
-/* $Id: fors_data.h,v 1.16 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_data.h,v 1.16 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.16 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_DATA_H
diff --git a/fors/fors_detected_slits.cc b/fors/fors_detected_slits.cc
new file mode 100644
index 0000000..f2d4c10
--- /dev/null
+++ b/fors/fors_detected_slits.cc
@@ -0,0 +1,113 @@
+/* $Id: fors_detected_slits.cc,v 1.1 2013-10-24 14:12:51 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-24 14:12:51 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+
+#include <iostream>
+#include <stdexcept>
+#include <sstream>
+#include <cpl_table.h>
+#include "fors_detected_slits.h"
+
+std::vector<mosca::detected_slit>  
+fors::detected_slits_load_fits(const std::string& fitsfile_slit_loc,
+                               const std::string& fitsfile_curv_coeff,
+                               int image_size_disp)
+{
+    /* We read from extension 1 of slit location table */
+    cpl_table* slit_loc_table = 
+        cpl_table_load(fitsfile_slit_loc.c_str(), 1, 0);
+
+    /* We read from extension 1 of curvature coefficients table */
+    cpl_table* curv_coeff_table = 
+        cpl_table_load(fitsfile_curv_coeff.c_str(), 1, 0);
+
+    return fors::detected_slits_from_tables(slit_loc_table, curv_coeff_table, 
+                                            image_size_disp);
+}
+
+std::vector<mosca::detected_slit>  
+fors::detected_slits_from_tables(cpl_table * slit_loc,
+                                 cpl_table * curv_coeff,
+                                 int image_size_disp)
+{
+    std::vector<mosca::detected_slit> slits;
+    
+    if(2*cpl_table_get_nrow(slit_loc) != cpl_table_get_nrow(curv_coeff))
+        throw std::invalid_argument("Slit and curv coeff Tables do not match");
+    
+    for(cpl_size irow = 0 ; irow < cpl_table_get_nrow(slit_loc); irow++)
+    {
+        int null;
+        int slit_id = cpl_table_get_int(slit_loc, 
+                                        "slit_id", irow, &null); 
+        double disp_bottom = cpl_table_get_double(slit_loc,
+                                               "xbottom", irow, &null); 
+        disp_bottom = 1;
+        double disp_top    = cpl_table_get_double(slit_loc,
+                                               "xtop", irow, &null);
+        disp_top = image_size_disp;
+        double spa_bottom  = cpl_table_get_double(slit_loc, 
+                                               "ybottom", irow, &null); 
+        double spa_top     = cpl_table_get_double(slit_loc, 
+                                               "ytop", irow, &null);
+        
+        int slit_id_check = cpl_table_get_int(curv_coeff, 
+                                              "slit_id", 2*irow, &null);
+        
+        int position_spatial_corrected  = cpl_table_get_int(slit_loc, 
+                                               "position", irow, &null); 
+        int length_spatial_corrected     = cpl_table_get_int(slit_loc, 
+                                               "length", irow, &null);
+        
+        if(slit_id != slit_id_check)
+            throw std::runtime_error("Slit identification doesn't match");
+
+        cpl_size ndegree = cpl_table_get_ncol(curv_coeff) - 1;
+
+        std::vector<double> bottom_trace_coeff;
+        std::vector<double> top_trace_coeff;
+        for(cpl_size idx_coeff = 0; idx_coeff < ndegree; idx_coeff++)
+        {
+            std::ostringstream colname;
+            colname<<std::left<<"c"<<idx_coeff;
+            top_trace_coeff.push_back(cpl_table_get_double
+                    (curv_coeff, colname.str().c_str(), 2*irow, NULL));
+            bottom_trace_coeff.push_back(cpl_table_get_double
+                    (curv_coeff, colname.str().c_str(), 2*irow + 1, NULL));
+        }
+        
+        
+        slits.push_back(mosca::detected_slit(slit_id, disp_bottom, spa_bottom,
+                                             disp_top, spa_top,
+                                             position_spatial_corrected,
+                                             length_spatial_corrected,
+                                             bottom_trace_coeff, 
+                                             top_trace_coeff));
+    }
+    
+    return slits;
+}
diff --git a/fors/fors_detected_slits.h b/fors/fors_detected_slits.h
new file mode 100644
index 0000000..ead8230
--- /dev/null
+++ b/fors/fors_detected_slits.h
@@ -0,0 +1,49 @@
+/* $Id: fors_detected_slits.h,v 1.1 2013-10-24 14:12:51 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-24 14:12:51 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef DETECTED_SLITS_H
+#define DETECTED_SLITS_H
+
+#include <vector>
+#include <string>
+#include "detected_slit.h"
+
+namespace fors
+{
+
+typedef std::vector<mosca::detected_slit> detected_slits;
+
+detected_slits detected_slits_load_fits(const std::string& fitsfile_slit_loc,
+                                        const std::string& fitsfile_curv_coeff,
+                                        int image_size_disp);
+
+detected_slits detected_slits_from_tables(cpl_table * slit_loc,
+                                          cpl_table * curv_coeff,
+                                          int image_size_disp);
+}
+
+#endif
diff --git a/fors/fors_dfs.c b/fors/fors_dfs.c
index ad3f331..2bd393f 100644
--- a/fors/fors_dfs.c
+++ b/fors/fors_dfs.c
@@ -1,4 +1,4 @@
-/* $Id: fors_dfs.c,v 1.40 2013/04/24 14:12:04 cgarcia Exp $
+/* $Id: fors_dfs.c,v 1.47 2013-10-09 15:58:42 cgarcia Exp $
  *
  * This file is part of the FORS library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:12:04 $
- * $Revision: 1.40 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-10-09 15:58:42 $
+ * $Revision: 1.47 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -381,7 +381,7 @@ fors_dfs_pipeline_version(const cpl_propertylist *header,
         *instrument_version = cpl_sprintf("%s", instrume);
     }
     
-    return cpl_sprintf("fors%c/%s", instrume[4], VERSION);
+    return cpl_sprintf("fors%c/%s", instrume[4], PACKAGE_VERSION);
 }
 
 /*----------------------------------------------------------------------------*/
@@ -874,7 +874,7 @@ cpl_image *dfs_load_image(cpl_frameset *frameset, const char *category,
     if (frame) {
         image = cpl_image_load(cpl_frame_get_filename(frame), type, 0, ext);
         if (image == NULL) {
-            cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+            cpl_msg_error(cpl_error_get_where(),"%s", cpl_error_get_message());
             cpl_msg_error(func, "Cannot load image %s",
                           cpl_frame_get_filename(frame));
         }
@@ -929,7 +929,7 @@ cpl_table *dfs_load_table(cpl_frameset *frameset, const char *category, int ext)
     if (frame) {
         table = cpl_table_load(cpl_frame_get_filename(frame), ext, 1);
         if (table == NULL) {
-            cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+            cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
             cpl_msg_error(func, "Cannot load table %s",
                           cpl_frame_get_filename(frame));
         }
@@ -980,7 +980,7 @@ cpl_propertylist *dfs_load_header(cpl_frameset *frameset,
     if (frame) {
         plist = cpl_propertylist_load(cpl_frame_get_filename(frame), ext);
         if (plist == NULL) {
-            cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+            cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
             cpl_msg_error(func, "Cannot load header from %s",
                           cpl_frame_get_filename(frame));
         }
@@ -998,10 +998,10 @@ cpl_propertylist *dfs_load_header(cpl_frameset *frameset,
  */
 /*----------------------------------------------------------------------------*/
 static void
-dfs_save(cpl_frameset *frameset, const void *object, cpl_frame_type type,
+dfs_save(cpl_frameset *frameset, const void *object, fors_type type,
          const char *category, cpl_propertylist *header,
          const cpl_parameterlist *parlist, const char *recipename,
-         const cpl_frame *raw_frame)
+         const cpl_frame *inherit_frame)
 {
     char             *filename;
     cpl_frame        *frame;
@@ -1011,23 +1011,23 @@ dfs_save(cpl_frameset *frameset, const void *object, cpl_frame_type type,
 
 
     if (category == NULL || frameset == NULL || object == NULL || 
-        raw_frame == NULL) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        inherit_frame == NULL) {
+        cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
         return;
     }
 
-    if (type == CPL_FRAME_TYPE_IMAGE) {
-        cpl_msg_debug(cpl_func, "Saving %s image to disk...", category);
+    if (type == FORS_TYPE_TABLE) {
+        cpl_msg_debug(cpl_func, "Saving %s table to disk...", category);
     }
     else {
-        cpl_msg_debug(cpl_func, "Saving %s table to disk...", category);
+        cpl_msg_debug(cpl_func, "Saving %s image to disk...", category);
     }
 
     /* Read instrument version from raw frame */
     {
         const char *raw_filename = 
-            cpl_frame_get_filename(raw_frame);
+            cpl_frame_get_filename(inherit_frame);
         
         raw_header = cpl_propertylist_load(raw_filename, 0);
         if (cpl_error_get_code() != CPL_ERROR_NONE) {
@@ -1058,7 +1058,7 @@ dfs_save(cpl_frameset *frameset, const void *object, cpl_frame_type type,
     cpl_frame_set_group(frame, CPL_FRAME_GROUP_PRODUCT);
     cpl_frame_set_level(frame, CPL_FRAME_LEVEL_FINAL);
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
         cpl_msg_error(cpl_func, "Cannot initialise the product frame");
         cpl_frame_delete(frame);
         cpl_free(filename);
@@ -1076,14 +1076,11 @@ dfs_save(cpl_frameset *frameset, const void *object, cpl_frame_type type,
     else
         plist = header;
 
-#if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(4, 8, 0)
     if (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,
-                                     recipename, version, "PRO-1.15", NULL)) {
-#else 
-    if (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,
-                                     recipename, version, "PRO-1.15")) {
-#endif
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+                                     recipename, version, "PRO-1.15", 
+                                     inherit_frame)) {
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         cpl_msg_error(cpl_func, "Problem with product %s FITS header definition",
                       category);
         if (header == NULL)
@@ -1110,16 +1107,21 @@ dfs_save(cpl_frameset *frameset, const void *object, cpl_frame_type type,
      * Write to disk
      */
     
-    if (type == CPL_FRAME_TYPE_IMAGE) {
+    if (type == FORS_TYPE_IMAGE_ERR) {
         fors_image_save((fors_image *)object, plist, filename);
     }
+    else if (type == FORS_TYPE_IMAGE) {
+        cpl_image_save((cpl_image *)object, filename, CPL_BPP_IEEE_FLOAT, plist,
+                       CPL_IO_DEFAULT);
+    }
     else {
-        cpl_table_save((cpl_table *)object, 
-                       plist, NULL, filename, CPL_IO_DEFAULT);
+            cpl_table_save((cpl_table *)object, 
+                           plist, NULL, filename, CPL_IO_DEFAULT);
     }
     
     if (cpl_error_get_code() != CPL_ERROR_NONE) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         cpl_msg_error(cpl_func, "Cannot save product %s to disk", filename);
         if (header == NULL)
             cpl_propertylist_delete(plist);
@@ -1161,15 +1163,49 @@ dfs_save(cpl_frameset *frameset, const void *object, cpl_frame_type type,
 
 /*----------------------------------------------------------------------------*/
 void
-fors_dfs_save_image(cpl_frameset *frameset, const fors_image *image,
+fors_dfs_save_image(cpl_frameset *frameset, const cpl_image *image,
+                    const char *category, cpl_propertylist *header,
+                    const cpl_parameterlist *parlist, const char *recipename,
+                    const cpl_frame *inherit_frame)
+{
+    dfs_save(frameset, image, FORS_TYPE_IMAGE, 
+             category, header, 
+             parlist, recipename, 
+             inherit_frame);
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+ * @brief
+ *    Save DFS product (image) with it error data
+ *
+ * @param frameset   see dfs_save_image()
+ * @param image      image (containing data and error bars) to save
+ * @param category   see dfs_save_image()
+ * @param header     see dfs_save_image()
+ * @param parlist    see dfs_save_image()
+ * @param recipename see dfs_save_image()
+ * @param raw_frame  any raw frame used for this product
+ *
+ * This function is the same as dfs_save_image(), except the image is saved using
+ * fors_image_save().
+ *
+ * The instrument version number is determined from the header of the
+ * input raw frame.
+ * 
+ */
+
+/*----------------------------------------------------------------------------*/
+void
+fors_dfs_save_image_err(cpl_frameset *frameset, const fors_image *image,
                     const char *category, cpl_propertylist *header,
                     const cpl_parameterlist *parlist, const char *recipename,
-                    const cpl_frame *raw_frame)
+                    const cpl_frame *inherit_frame)
 {
-    dfs_save(frameset, image, CPL_FRAME_TYPE_IMAGE, 
+    dfs_save(frameset, image, FORS_TYPE_IMAGE_ERR, 
              category, header, 
              parlist, recipename, 
-             raw_frame);
+             inherit_frame);
 }
 
 #undef cleanup
@@ -1279,12 +1315,12 @@ void
 fors_dfs_save_table(cpl_frameset *frameset, const cpl_table *table,
                     const char *category, cpl_propertylist *header,
                     const cpl_parameterlist *parlist, const char *recipename,
-                    const cpl_frame *raw_frame)
+                    const cpl_frame *inherit_frame)
 {
-    dfs_save(frameset, table, CPL_FRAME_TYPE_TABLE, 
+    dfs_save(frameset, table, FORS_TYPE_TABLE, 
              category, header, 
              parlist, recipename, 
-             raw_frame);
+             inherit_frame);
 }
 
 /*----------------------------------------------------------------------------*/
@@ -1333,7 +1369,8 @@ int dfs_save_image(cpl_frameset *frameset, const cpl_image *image,
 
 
     if (category == NULL || frameset == NULL || image == NULL) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
         return -1;
     }
@@ -1353,7 +1390,8 @@ int dfs_save_image(cpl_frameset *frameset, const cpl_image *image,
     cpl_frame_set_group(frame, CPL_FRAME_GROUP_PRODUCT);
     cpl_frame_set_level(frame, CPL_FRAME_LEVEL_FINAL);
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         cpl_msg_error(func, "Cannot initialise the product frame");
         cpl_frame_delete(frame);
         cpl_free(filename);
@@ -1377,7 +1415,8 @@ int dfs_save_image(cpl_frameset *frameset, const cpl_image *image,
     if (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,
                                      recipename, version, "PRO-1.15")) {
 #endif
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         cpl_msg_error(func, "Problem with product %s FITS header definition",
                       category);
         if (header == NULL)
@@ -1403,7 +1442,8 @@ int dfs_save_image(cpl_frameset *frameset, const cpl_image *image,
 
     if (cpl_image_save(image, filename, CPL_BPP_IEEE_FLOAT, plist,
                        CPL_IO_DEFAULT)) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         cpl_msg_error(func, "Cannot save product %s to disk", filename);
         if (header == NULL)
             cpl_propertylist_delete(plist);
@@ -1469,7 +1509,8 @@ int dfs_save_table(cpl_frameset *frameset, const cpl_table *table,
 
     if (category == NULL || frameset == NULL || table == NULL) {
         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         return -1;
     }
 
@@ -1495,7 +1536,8 @@ int dfs_save_table(cpl_frameset *frameset, const cpl_table *table,
     cpl_frame_set_group(frame, CPL_FRAME_GROUP_PRODUCT);
     cpl_frame_set_level(frame, CPL_FRAME_LEVEL_FINAL);
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         cpl_msg_error(func, "Cannot initialise the product frame");
         cpl_frame_delete(frame);
         cpl_free(filename);
@@ -1519,7 +1561,8 @@ int dfs_save_table(cpl_frameset *frameset, const cpl_table *table,
     if (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,
                                      recipename, version, "PRO-1.15")) {
 #endif
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         cpl_msg_error(func, "Problem with product %s FITS header definition",
                       category);
         if (header == NULL)
@@ -1545,7 +1588,8 @@ int dfs_save_table(cpl_frameset *frameset, const cpl_table *table,
     
     
     if (cpl_table_save(table, plist, NULL, filename, CPL_IO_DEFAULT)) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         cpl_msg_error(func, "Cannot save product %s to disk", filename);
         if (header == NULL)
             cpl_propertylist_delete(plist);
@@ -1828,4 +1872,45 @@ cpl_error_code dfs_save_image_null(cpl_frameset * frameset,
 
     return error;
 }
+
+cpl_frameset * hawki_extract_frameset(
+        const cpl_frameset  *   in,
+        const char          *   tag)
+{
+    cpl_frameset    *   out ;
+    const cpl_frame *   cur_frame ;
+    cpl_frame       *   loc_frame ;
+    int                 nbframes, nbext ;
+    int                 i ;
+
+    /* Test entries */
+    if (in == NULL) return NULL ;
+    if (tag == NULL) return NULL ;
+
+    /* Initialise */
+    nbframes = cpl_frameset_get_size(in) ;
+
+    /* Count the frames with the tag */
+    if ((nbext = cpl_frameset_count_tags(in, tag)) == 0) return NULL ;
+
+    /* Create the output frameset */
+    out = cpl_frameset_new() ;
+
+    /* Loop on the requested frames and store them in out */
+    nbext = 0 ;
+    for (i=0 ; i<nbframes ; i++) {
+        cur_frame = cpl_frameset_get_frame_const(in, i) ;
+        if (!strcmp(cpl_frame_get_tag(cur_frame), tag)) {
+            loc_frame = cpl_frame_duplicate(cur_frame) ;
+            cpl_frameset_insert(out, loc_frame) ;
+            nbext ++ ;
+        }
+    }
+    return out ;
+}
+
+
+
+
+
 /**@}*/
diff --git a/fors/fors_dfs.h b/fors/fors_dfs.h
index 740f052..f546ff8 100644
--- a/fors/fors_dfs.h
+++ b/fors/fors_dfs.h
@@ -1,4 +1,4 @@
-/* $Id: fors_dfs.h,v 1.32 2013/04/24 14:17:59 cgarcia Exp $
+/* $Id: fors_dfs.h,v 1.35 2013-09-10 19:27:01 cgarcia Exp $
  *
  * This file is part of the FORS Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:17:59 $
- * $Revision: 1.32 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-10 19:27:01 $
+ * $Revision: 1.35 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_DFS_H
@@ -34,6 +34,17 @@
 
 CPL_BEGIN_DECLS
 
+/* Types of data to save */
+enum _fors_type_ {
+
+    FORS_TYPE_IMAGE      = 1 << 0,
+    FORS_TYPE_IMAGE_ERR  = 1 << 1,
+    FORS_TYPE_TABLE      = 1 << 2
+};
+
+typedef enum _fors_type_ fors_type;
+
+
 /* Raw frames */
 #define BIAS                    "BIAS"
 #define DARK                    "DARK"
@@ -92,10 +103,14 @@ void fors_dfs_add_wcs(cpl_propertylist *header, const cpl_frame *frame,
                       const fors_setting *setting);
 void fors_dfs_add_exptime(cpl_propertylist *header, const cpl_frame *frame,
                           double exptime);
-void fors_dfs_save_image(cpl_frameset *frameset, const fors_image *image,
-			 const char *category, cpl_propertylist *header,
-			 const cpl_parameterlist *parlist, const char *recipename,
-			 const cpl_frame *raw_frame);
+void fors_dfs_save_image_err(cpl_frameset *frameset, const fors_image *image,
+             const char *category, cpl_propertylist *header,
+             const cpl_parameterlist *parlist, const char *recipename,
+             const cpl_frame *raw_frame);
+void fors_dfs_save_image(cpl_frameset *frameset, const cpl_image *image,
+             const char *category, cpl_propertylist *header,
+             const cpl_parameterlist *parlist, const char *recipename,
+             const cpl_frame *raw_frame);
 void fors_dfs_save_image_wcs(cpl_frameset *frameset, const fors_image *image,
 			     const char *category, cpl_propertylist *header,
 			     const cpl_parameterlist *parlist, const char *recipename,
@@ -106,10 +121,10 @@ void fors_dfs_save_table(cpl_frameset *frameset, const cpl_table *table,
 			 const cpl_frame *raw_frame);
 int dfs_save_image(cpl_frameset *, const cpl_image *, const char *, 
                    cpl_propertylist *, const cpl_parameterlist *, 
-                   const char *, const char *);
+                   const char *, const char *) CPL_ATTR_DEPRECATED; 
 int dfs_save_table(cpl_frameset *, const cpl_table *, const char *, 
                    cpl_propertylist *, const cpl_parameterlist *, 
-                   const char *, const char *);
+                   const char *, const char *) CPL_ATTR_DEPRECATED;
 int dfs_equal_keyword(cpl_frameset *frameset, const char *keyword);
 void fors_begin(cpl_frameset *frames, const char *description_short);
 int fors_end(const cpl_frameset *frames, cpl_errorstate before_exec);
@@ -122,6 +137,11 @@ cpl_error_code dfs_save_image_null(cpl_frameset *, cpl_parameterlist *,
 				   const char *, const char *,
 				   const char *);
 
+cpl_frameset * hawki_extract_frameset(
+        const cpl_frameset  *   in,
+        const char          *   tag);
+
+
 CPL_END_DECLS
 
 #endif   /* FORS_DFS_H */
diff --git a/fors/fors_double.c b/fors/fors_double.c
index 302bde4..decd819 100644
--- a/fors/fors_double.c
+++ b/fors/fors_double.c
@@ -1,4 +1,4 @@
-/* $Id: fors_double.c,v 1.5 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_double.c,v 1.5 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_double.h b/fors/fors_double.h
index f7c2e42..5bcdd1b 100644
--- a/fors/fors_double.h
+++ b/fors/fors_double.h
@@ -1,4 +1,4 @@
-/* $Id: fors_double.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_double.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_DOUBLE_H
diff --git a/fors/fors_extract.c b/fors/fors_extract.c
index 9ec0943..8fff24a 100644
--- a/fors/fors_extract.c
+++ b/fors/fors_extract.c
@@ -1,4 +1,4 @@
-/* $Id: fors_extract.c,v 1.45 2011/10/13 14:29:24 cgarcia Exp $
+/* $Id: fors_extract.c,v 1.45 2011-10-13 14:29:24 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/13 14:29:24 $
+ * $Date: 2011-10-13 14:29:24 $
  * $Revision: 1.45 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_extract.h b/fors/fors_extract.h
index ec806a9..0061f1b 100644
--- a/fors/fors_extract.h
+++ b/fors/fors_extract.h
@@ -1,4 +1,4 @@
-/* $Id: fors_extract.h,v 1.11 2011/06/11 06:16:24 cizzo Exp $
+/* $Id: fors_extract.h,v 1.11 2011-06-11 06:16:24 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2011/06/11 06:16:24 $
+ * $Date: 2011-06-11 06:16:24 $
  * $Revision: 1.11 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_EXTRACT_H
diff --git a/fors/fors_flat_normalise.cc b/fors/fors_flat_normalise.cc
new file mode 100644
index 0000000..b6ae1d8
--- /dev/null
+++ b/fors/fors_flat_normalise.cc
@@ -0,0 +1,618 @@
+/* $Id: fors_flat_normalise.cc,v 1.9 2013-10-24 16:44:34 cgarcia Exp $
+ *
+ * This file is part of the MOSES library
+ * Copyright (C) 2002-2010 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-24 16:44:34 $
+ * $Revision: 1.9 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <cmath>
+#include <fors_flat_normalise.h>
+#include <moses.h>
+#include <image_smooth.h>
+#include <image_spline_fit.h>
+
+#define STRETCH_FACTOR   (1.20)
+
+/**
+ * @brief 
+ *   Normalise a flat field exposure
+ *  
+ * @param flat        Image containing the original flat field spectra
+ * @param spatial     Spatial calibration image
+ * @param slits       Table with slits positions
+ * @param polytraces  Coefficients of spectral curvature polynomials
+ * @param reference   Reference wavelength
+ * @param blue        Start lambda to process
+ * @param red         End lambda to process
+ * @param dispersion  Mean spectral dispersion
+ * @param sradius     Radius of smoothing box along the dispersion direction
+ * @param polyorder   Order of fitting polynomial along the dispersion
+ *  
+ * @return The smoothed flat field exposure used for normalisation
+ *
+ * The input @em flat frame should be already bias subtracted, and should
+ * be oriented so that the dispersion direction is horizontal with @em blue
+ * on the left and @em red on the right. The flat field spectra are spatially 
+ * rectified, heavily smoothed, and then mapped back on the CCD. The original 
+ * @em flat image is divided IN PLACE by its smoothed counterpart, which is 
+ * also returned. If the polynomial @em polyorder is set to a negative number 
+ * the smoothing consists of a linear fit along the spatial direction 
+ * (excluding 3+3 pixels at the spectral edges), and by a median filtering 
+ * along the dispersion direction using a window with the specified 
+ * @em sradius; alternatively, if @em polyorder is not negative, the smoothing
+ * will consist of a polynomial fitting of the illumination profile along
+ * the dispersion direction, performed independently for each row of the
+ * spatially remapped spectra.
+ */
+ 
+cpl_image *mos_mosflat_normalise(cpl_image *flat, cpl_image *spatial, 
+                                 cpl_table *slits, cpl_table *polytraces, 
+                                 double reference, double blue, double red, 
+                                 double dispersion,
+                                 int spa_smooth_radius, int disp_smooth_radius, 
+                                 int spa_fit_nknots, int disp_fit_nknots,
+                                 double fit_threshold)
+{
+    const char     *func = "mos_mosflat_normalise";
+
+    const char *clab[6] = {"c0", "c1", "c2", "c3", "c4", "c5"};
+                                                 /* Max order is 5 */
+
+    cpl_image      *rectified;
+    cpl_image      *smo_flat;
+    cpl_image      *exslit;
+    cpl_polynomial *polytop;
+    cpl_polynomial *polybot;
+
+    int            *slit_id;
+    float          *sdata;
+    float          *xdata;
+    float          *wdata;
+    double          vtop, vbot, value;
+    double          top, bot;
+    double          coeff;
+    double          ytop, ybot;
+    double          ypos;
+    double          fvalue;
+    int             ivalue;
+    int             yint, yprev = 0;
+    int             npseudo;
+
+    int             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;
+    int             nx, ny;
+    int             xlow, ylow, xhig, yhig;
+    int             nslits;
+    int            *position;
+    int            *length;
+    int             missing_top, missing_bot;
+    int             order;
+    int             null;
+    int             i, j;
+    cpl_size        k;
+
+/*    int             exclude = 5;     Number of excluded pixels at edges */
+
+    /* For debug puposes only: cpl_image      *smo_rectified; */
+
+    if (flat == NULL || slits == NULL || polytraces == NULL) {
+        cpl_error_set(func, CPL_ERROR_NULL_INPUT);
+        return NULL;
+    }
+ 
+    if (dispersion <= 0.0) {
+        cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+
+    if (red - blue < dispersion) {
+        cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+    
+    rectified = mos_spatial_calibration(flat, slits, polytraces, reference,
+                                        blue, red, dispersion, 0, NULL);
+
+    nx = cpl_image_get_size_x(rectified);
+    ny = cpl_image_get_size_y(rectified);
+
+    smo_flat = cpl_image_new(cpl_image_get_size_x(spatial), 
+                             cpl_image_get_size_y(spatial), CPL_TYPE_FLOAT);
+    wdata = cpl_image_get_data_float(smo_flat);
+
+    nslits   = cpl_table_get_nrow(slits);
+    order    = cpl_table_get_ncol(polytraces) - 2;
+    position = cpl_table_get_data_int(slits, "position");
+    length   = cpl_table_get_data_int(slits, "length");
+    slit_id  = cpl_table_get_data_int(slits, "slit_id");
+
+    /*
+     * The spatial resampling is performed for a certain number of
+     * pixels above and below the position of the reference wavelength:
+     */
+    
+    pixel_above = (int)(STRETCH_FACTOR * (red - reference) / dispersion);
+    pixel_below = (int)(STRETCH_FACTOR * (reference - blue) / dispersion);
+
+    xlow = 1;
+    xhig = nx;
+    for (i = 0; i < nslits; i++) {
+
+        if (length[i] == 0)
+            continue;
+
+        /*
+         * We DON'T write:
+         *
+         * ylow = position[i];
+         * yhig = ylow + length[i];
+         *
+         * because the cpl_image pixels are counted from 1, and because in 
+         * cpl_image_extract() the coordinates of the last pixel are inclusive.
+         */
+
+        ylow = position[i] + 1;
+        yhig = ylow + length[i] - 1;
+
+        exslit = cpl_image_extract(rectified, xlow, ylow, xhig, yhig);
+        mosca::image im_slit(exslit);
+
+        if (spa_smooth_radius > 0) 
+        {
+            int  final_spa_smooth_radius;
+            if (im_slit.size_spatial() / 2 < spa_smooth_radius)
+            {
+                final_spa_smooth_radius = im_slit.size_spatial() / 2;
+                cpl_msg_warning(cpl_func, "Slit too narrow for requested "
+                                "smoothing radius %d. Using %d", 
+                                spa_smooth_radius, final_spa_smooth_radius);
+            }
+            else
+                final_spa_smooth_radius = spa_smooth_radius;
+            mosca::image_smooth_1d_median<float>(im_slit, 
+                                                 final_spa_smooth_radius, 
+                                                 mosca::SPATIAL_AXIS);
+        }
+        
+        if (spa_fit_nknots > 0)
+            mosca::image_cubicspline_1d_fit<float>(im_slit, spa_fit_nknots, 
+                                                   fit_threshold,
+                                                   mosca::SPATIAL_AXIS);
+
+        if (disp_smooth_radius > 0)
+            mosca::image_smooth_1d_median<float>(im_slit, 
+                                                 disp_smooth_radius, 
+                                                 mosca::DISPERSION_AXIS);
+        if (disp_fit_nknots > 0)
+            mosca::image_cubicspline_1d_fit<float>(im_slit, disp_fit_nknots, 
+                                                   fit_threshold,
+                                                   mosca::DISPERSION_AXIS);
+        //image_smooth_fit_1d_pol_disp(exslit, disp_fit_polyorder);
+
+        
+        /*
+         * Recover from the table of spectral curvature coefficients
+         * the curvature polynomials.
+         */
+
+        refpixel = (int)(cpl_table_get_double(slits, "xtop", i, NULL));
+
+        start_pixel = refpixel - pixel_below;
+        if (start_pixel < 0)
+            start_pixel = 0;
+
+        end_pixel = refpixel + pixel_above;
+        if (end_pixel > nx)
+            end_pixel = nx;
+
+        missing_top = 0;
+        polytop = cpl_polynomial_new(1);
+        for (k = 0; k <= order; k++) {
+            coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);
+            if (null) {
+                cpl_polynomial_delete(polytop);
+                missing_top = 1;
+                break;
+            }
+            cpl_polynomial_set_coeff(polytop, &k, coeff);
+        }
+
+        missing_bot = 0;
+        polybot = cpl_polynomial_new(1);
+        for (k = 0; k <= order; k++) {
+            coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);
+            if (null) {
+                cpl_polynomial_delete(polybot);
+                missing_bot = 1;
+                break;
+            }
+            cpl_polynomial_set_coeff(polybot, &k, coeff);
+        }
+
+        if (missing_top && missing_bot) {
+            cpl_msg_debug(func, "Slit %d was not traced: no extraction!",
+                          slit_id[i]);
+            continue;
+        }
+
+        /*
+         * In case just one of the two edges was not traced, the other
+         * edge curvature model is duplicated and shifted to the other
+         * end of the slit: better than nothing!
+         */
+
+        if (missing_top) {
+            cpl_msg_debug(func, "Upper edge of slit %d was not traced: "
+                          "the spectral curvature of the lower edge "
+                          "is used instead.", slit_id[i]);
+            polytop = cpl_polynomial_duplicate(polybot);
+            ytop = cpl_table_get_double(slits, "ytop", i, NULL);
+            ybot = cpl_table_get_double(slits, "ybottom", i, NULL);
+            k = 0;
+            coeff = cpl_polynomial_get_coeff(polybot, &k);
+            coeff += ytop - ybot;
+            cpl_polynomial_set_coeff(polytop, &k, coeff);
+        }
+
+        if (missing_bot) {
+            cpl_msg_debug(func, "Lower edge of slit %d was not traced: "
+                          "the spectral curvature of the upper edge "
+                          "is used instead.", slit_id[i]);
+            polybot = cpl_polynomial_duplicate(polytop);
+            ytop = cpl_table_get_double(slits, "ytop", i, NULL);
+            ybot = cpl_table_get_double(slits, "ybottom", i, NULL);
+            k = 0;
+            coeff = cpl_polynomial_get_coeff(polytop, &k);
+            coeff -= ytop - ybot;
+            cpl_polynomial_set_coeff(polybot, &k, coeff);
+        }
+
+
+        /*
+         * Now map smoothed image to CCD.
+         * Note that the npseudo value related to this slit is equal
+         * to the number of spatial pseudo-pixels decreased by 1
+         * (compare with function mos_spatial_calibration()).
+         */
+
+        nx = cpl_image_get_size_x(flat);
+        ny = cpl_image_get_size_y(flat);
+
+        sdata = cpl_image_get_data_float(spatial);
+        xdata = cpl_image_get_data_float(exslit);
+        npseudo = cpl_image_get_size_y(exslit) - 1;
+
+        /*
+         * Write interpolated smoothed values to CCD image
+         */
+
+        for (j = start_pixel; j < end_pixel; j++) {
+            top = cpl_polynomial_eval_1d(polytop, j, NULL);
+            bot = cpl_polynomial_eval_1d(polybot, j, NULL);
+            for (k = 0; k <= npseudo; k++) {
+                ypos = top - k*(top-bot)/npseudo;
+                yint = (int)(ypos);
+
+                /*
+                 * The line:
+                 *     value = sdata[j + nx*yint];
+                 * should be equivalent to:
+                 *     value = npseudo*(top-yint)/(top-bot);
+                 */
+
+                if (yint < 0 || yint >= ny-1) {
+                    yprev = yint;
+                    continue;
+                }
+
+                value = sdata[j + nx*yint];   /* Spatial coordinate on CCD */
+                ivalue = (int)(value);        /* Nearest spatial pixels:   */
+                fvalue = value - ivalue;      /* ivalue and ivalue+1       */
+                if (ivalue < npseudo && ivalue >= 0) {
+                    vtop = xdata[j + nx*(npseudo-ivalue)];
+                    vbot = xdata[j + nx*(npseudo-ivalue-1)];
+                    wdata[j + nx*yint] = vtop*(1-fvalue) + vbot*fvalue;
+
+                    if (k) {
+
+                        /*
+                         * This is added to recover lost pixels on
+                         * the CCD image (pixels are lost because
+                         * the CCD pixels are less than npseudo+1).
+                         */
+
+                        if (yprev - yint > 1) {
+                            value = sdata[j + nx*(yint+1)];
+                            ivalue = (int)(value);
+                            fvalue = value - ivalue;
+                            if (ivalue < npseudo && ivalue >= 0) {
+                                vtop = xdata[j + nx*(npseudo-ivalue)];
+                                vbot = xdata[j + nx*(npseudo-ivalue-1)];
+                                wdata[j + nx*(yint+1)] = vtop*(1-fvalue) 
+                                                       + vbot*fvalue;
+                            }
+                        }
+                    }
+                }
+                yprev = yint;
+            }
+        }
+        cpl_polynomial_delete(polytop);
+        cpl_polynomial_delete(polybot);
+        cpl_image_delete(exslit);
+    }
+    
+    //TODO: What happens with inter-slit flux conservation. In principle the overall level
+    //difference across slits should be conserved.
+
+    cpl_image_delete(rectified);
+
+    cpl_image_divide(flat, smo_flat);
+
+    return smo_flat;
+}
+
+
+/**
+ * @brief 
+ *   Normalise a long slit flat field exposure
+ *  
+ * @param flat        Image containing the original flat field spectra
+ * @param spa_smooth_radius     Radius of smoothing box along the spatial direction
+ * @param disp_smooth_radius     Radius of smoothing box along the dispersion direction
+ * @param spa_fit_polyorder   Order of fitting polynomial along the spatial direction
+ * @param disp_fit_polyorder   Order of fitting polynomial along the dispersion direction
+ *  
+ * @return The smoothed flat field exposure used for normalisation
+ *
+ * The input @em flat frame should be already bias subtracted, and should
+ * be oriented so that the dispersion direction is horizontal with @em blue
+ * on the left and @em red on the right. The original @em flat image is 
+ * divided IN PLACE by its smoothed counterpart, which is also returned. 
+ * For any of the directions, if the polynomial @em polyorder is set to a 
+ * negative number the smoothing consists of a median filtering box of specified
+ * sizes. Alternatively, if @em polyorder is not negative, the smoothing will
+ * consist of a polynomial fitting along the requested direction performed 
+ * independently for each column/row of the image.
+ */
+cpl_image *mos_lssflat_normalise
+(cpl_image *flat, int spa_smooth_radius, int disp_smooth_radius, 
+ int spa_fit_nknots, int disp_fit_nknots,
+ double fit_threshold)
+{
+    const char     *func = "mos_normalise_longflat";
+
+    cpl_image      *smo_flat;
+
+    if (flat == NULL) {
+        cpl_error_set(func, CPL_ERROR_NULL_INPUT);
+        return NULL;
+    }
+ 
+    if (spa_fit_nknots < 1 && spa_smooth_radius < 1) {
+        cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+    if (disp_fit_nknots < 1 && disp_smooth_radius < 1) {
+        cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+
+    smo_flat = cpl_image_duplicate(flat);
+    mosca::image smoothed_flat(smo_flat);
+
+    if (spa_fit_nknots < 0)
+    {
+        mosca::image_smooth_1d_median<float>(smoothed_flat, 
+                                             spa_smooth_radius, 
+                                             mosca::SPATIAL_AXIS);        
+    }
+    else
+        mosca::image_cubicspline_1d_fit<float>(smoothed_flat, spa_fit_nknots, 
+                                               fit_threshold,
+                                               mosca::SPATIAL_AXIS);
+        //image_smooth_fit_1d_pol_spa(smo_flat, spa_fit_polyorder);
+
+    if (disp_fit_nknots < 0) 
+    {
+        mosca::image_smooth_1d_median<float>(smoothed_flat, 
+                                             disp_smooth_radius, 
+                                             mosca::DISPERSION_AXIS);
+    }
+    else 
+        mosca::image_cubicspline_1d_fit<float>(smoothed_flat, disp_fit_nknots, 
+                                               fit_threshold,
+                                               mosca::DISPERSION_AXIS);
+        //image_smooth_fit_1d_pol_disp(smo_flat, disp_fit_polyorder);
+
+    cpl_image_divide(flat, smo_flat);
+
+    return smo_flat;
+}
+
+/**
+ * Smooth an image fitting a polynomial in spatial direction 
+ * @param image       Image to be smoothed
+ * @param polyorder   the order of the polynomial to fit
+ * 
+ * This function will smooth a MOS image in the spatial direction 
+ * (here assumed to be the Y axis) fitting each column with a polynomial. 
+ */
+void image_smooth_fit_1d_pol_spa(cpl_image * image, cpl_size polyorder)
+{
+    /*
+     * Fit with a polynomial the flat field trend column by column.
+     */
+
+    cpl_image_turn(image, -1);   /* For faster memory access */
+
+    cpl_size nx  = cpl_image_get_size_x(image);
+    cpl_size ny  = cpl_image_get_size_y(image);
+    float * data = cpl_image_get_data_float(image);
+
+    cpl_image * profile = cpl_image_collapse_median_create(image, 1, 0, 0);
+    float * level = cpl_image_get_data_float(profile);
+
+    for (cpl_size i = 0; i < ny; i++) {
+
+        /*
+         * First get the size of the vectors to allocate:
+         * eliminate from fit any value more than 20% away
+         * from median level in current column.
+         */
+
+        cpl_size npoints = 0;
+        float * p = data + i*nx;
+        for (cpl_size j = 0; j < nx; j++)
+            if (std::fabs(p[j]/level[i] - 1) < 0.20)
+                npoints++;
+
+        if (npoints > polyorder + 1) {
+
+            /*
+             * Fill the vectors for the fitting
+             */
+
+            cpl_vector * flux = cpl_vector_new(npoints);
+            double * fdata = cpl_vector_get_data(flux);
+            cpl_vector * positions = cpl_vector_new(npoints);
+            double * pdata = cpl_vector_get_data(positions);
+
+            npoints = 0;
+            p = data + i*nx;
+            for (cpl_size j = 0; j < nx; j++) {
+                if (fabs(p[j]/level[i] - 1) < 0.20) {
+                    fdata[npoints] = p[j];
+                    pdata[npoints] = j;
+                    npoints++;
+                }
+            }
+
+            cpl_polynomial * trend = cpl_polynomial_fit_1d_create
+                    (positions, flux, polyorder, NULL);
+
+            cpl_vector_delete(flux);
+            cpl_vector_delete(positions);
+
+            if (trend) {
+                p = data + i*nx;
+                for (cpl_size j = 0; j < nx; j++)
+                    p[j] = cpl_polynomial_eval_1d(trend, j, NULL);
+                cpl_polynomial_delete(trend);
+            }
+            else {
+                cpl_msg_warning(cpl_func, 
+                                "Invalid flat field flux fit (ignored)");
+            }
+        }
+    }
+
+    cpl_image_delete(profile);
+    cpl_image_turn(image, 1);
+}
+
+/**
+ * Smooth an image fitting a polynomial in dispersion direction 
+ * @param image       Image to be smoothed
+ * @param polyorder   the order of the polynomial to fit
+ * 
+ * This function will smooth a MOS image in the dispersion direction 
+ * (here assumed to be the X axis) fitting each row with a polynomial.
+ * TODO: merge this with image_smooth_fit_1d_pol_spa() and place it in MOSCA.  
+ */
+void image_smooth_fit_1d_pol_disp(cpl_image * image, cpl_size polyorder)
+{
+    float          *p;
+    float          *data;
+    double         *fdata;
+    double         *pdata;
+    int             npoints;
+
+    cpl_vector     *positions;
+    cpl_vector     *flux;
+    cpl_polynomial *trend;
+
+    /*
+     * Fit with a polynomial the flat field trend row by row.
+     */
+
+    cpl_size nx = cpl_image_get_size_x(image);
+    cpl_size ny = cpl_image_get_size_y(image);
+    data = cpl_image_get_data_float(image);
+
+    for (cpl_size j = 0; j < ny; j++) {
+
+        /*
+         * First get the size of the vectors to allocate:
+         */
+
+        npoints = 0;
+        p = data + j*nx;
+        for (cpl_size k = 0; k < nx; k++)
+            if (p[k] > 1.0)
+                npoints++;
+
+        if (npoints > polyorder + 1) {
+
+            /*
+             * Fill the vectors for the fitting
+             */
+
+            flux = cpl_vector_new(npoints);
+            fdata = cpl_vector_get_data(flux);
+            positions = cpl_vector_new(npoints);
+            pdata = cpl_vector_get_data(positions);
+
+            npoints = 0;
+            p = data + j*nx;
+            for (cpl_size k = 0; k < nx; k++) {
+                if (p[k] > 1.0) {
+                    fdata[npoints] = p[k];
+                    pdata[npoints] = k;
+                    npoints++;
+                }
+            }
+
+            trend = cpl_polynomial_fit_1d_create(positions, flux, 
+                                                 polyorder, NULL);
+
+            cpl_vector_delete(flux);
+            cpl_vector_delete(positions);
+
+            if (trend) {
+                p = data + j*nx;
+                for (cpl_size k = 0; k < nx; k++)
+                    if (p[k] > 1.0)
+                        p[k] = cpl_polynomial_eval_1d(trend, k, NULL);
+                cpl_polynomial_delete(trend);
+            }
+            else {
+                cpl_msg_warning(cpl_func, "Invalid flat field flux fit "
+                                "(ignored)");
+            }
+        }
+    }
+}
diff --git a/fors/fors_flat_normalise.h b/fors/fors_flat_normalise.h
new file mode 100644
index 0000000..e4d68bc
--- /dev/null
+++ b/fors/fors_flat_normalise.h
@@ -0,0 +1,52 @@
+/* $Id: fors_flat_normalise.h,v 1.3 2013-09-09 12:14:12 cgarcia Exp $
+ *
+ * This file is part of the VIMOS Pipeline
+ * Copyright (C) 2002-2010 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-09-09 12:14:12 $
+ * $Revision: 1.3 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef FORS_FLAT_NORMALISE_H
+#define FORS_FLAT_NORMALISE_H
+
+#include <cpl.h>
+
+CPL_BEGIN_DECLS
+
+cpl_image *mos_mosflat_normalise(cpl_image *flat, cpl_image *spatial, 
+                                 cpl_table *slits, cpl_table *polytraces, 
+                                 double reference, double blue, double red, 
+                                 double dispersion,
+                                 int spa_smooth_radius, int disp_smooth_radius, 
+                                 int spa_fit_nknots, int disp_fit_nknots,
+                                 double fit_threshold);
+cpl_image *mos_lssflat_normalise(cpl_image *flat,
+                                 int spa_smooth_radius, int disp_smooth_radius, 
+                                 int spa_fit_nknots, int disp_fit_nknots,
+                                 double fit_threshold);
+
+void image_smooth_fit_1d_pol_spa(cpl_image * image, cpl_size polyorder);
+void image_smooth_fit_1d_pol_disp(cpl_image * image, cpl_size polyorder);
+
+CPL_END_DECLS
+
+#endif   /* FORS_FLAT_NORMALISE_H */
diff --git a/fors/fors_header.c b/fors/fors_header.c
index 180e2f7..6a4c206 100644
--- a/fors/fors_header.c
+++ b/fors/fors_header.c
@@ -1,4 +1,4 @@
-/* $Id: fors_header.c,v 1.1 2012/11/05 17:11:56 cgarcia Exp $
+/* $Id: fors_header.c,v 1.1 2012-11-05 17:11:56 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/11/05 17:11:56 $
+ * $Date: 2012-11-05 17:11:56 $
  * $Revision: 1.1 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_header.h b/fors/fors_header.h
index 06d7e2e..5e196e4 100644
--- a/fors/fors_header.h
+++ b/fors/fors_header.h
@@ -1,4 +1,4 @@
-/* $Id: fors_header.h,v 1.1 2012/11/05 17:11:40 cgarcia Exp $
+/* $Id: fors_header.h,v 1.1 2012-11-05 17:11:40 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/11/05 17:11:40 $
+ * $Date: 2012-11-05 17:11:40 $
  * $Revision: 1.1 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_HEADER_H
diff --git a/fors/fors_identify.c b/fors/fors_identify.c
index f9edfbf..a11b1e0 100644
--- a/fors/fors_identify.c
+++ b/fors/fors_identify.c
@@ -1,4 +1,4 @@
-/* $Id: fors_identify.c,v 1.56 2012/01/27 18:53:56 cgarcia Exp $
+/* $Id: fors_identify.c,v 1.58 2013-09-10 15:14:44 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/01/27 18:53:56 $
- * $Revision: 1.56 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-10 15:14:44 $
+ * $Revision: 1.58 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_identify.h b/fors/fors_identify.h
index 2fd5c81..ebc7ba5 100644
--- a/fors/fors_identify.h
+++ b/fors/fors_identify.h
@@ -1,4 +1,4 @@
-/* $Id: fors_identify.h,v 1.8 2011/05/09 13:08:59 cizzo Exp $
+/* $Id: fors_identify.h,v 1.10 2013-09-10 15:16:32 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2011/05/09 13:08:59 $
- * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-09-10 15:16:32 $
+ * $Revision: 1.10 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_IDENTIFY_H
diff --git a/fors/fors_image.c b/fors/fors_image.c
index a84b9f0..b6cd077 100644
--- a/fors/fors_image.c
+++ b/fors/fors_image.c
@@ -1,4 +1,4 @@
-/* $Id: fors_image.c,v 1.60 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_image.c,v 1.63 2013-08-07 13:24:40 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
- * $Revision: 1.60 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-08-07 13:24:40 $
+ * $Revision: 1.63 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -132,20 +132,23 @@ fors_image_new(cpl_image *data, cpl_image *variance)
     assure( data != NULL, return NULL, NULL );
     assure( variance != NULL, return NULL, NULL );
     
-    assure( cpl_image_get_type(data) == FORS_IMAGE_TYPE, return NULL,
-            "Provided data image type is %s, must be %s",
-            fors_type_get_string(cpl_image_get_type(data)),
-            fors_type_get_string(FORS_IMAGE_TYPE) );
+//TODO: Changed to allow saving as double. Check the consequences.
+//    assure( cpl_image_get_type(data) == FORS_IMAGE_TYPE, return NULL,
+//            "Provided data image type is %s, must be %s",
+//            fors_type_get_string(cpl_image_get_type(data)),
+//            fors_type_get_string(FORS_IMAGE_TYPE) );
 
-    assure( cpl_image_get_type(variance) == FORS_IMAGE_TYPE, return NULL,
-            "Provided weight image type is %s, must be %s",
-            fors_type_get_string(cpl_image_get_type(variance)),
-            fors_type_get_string(FORS_IMAGE_TYPE) );
+//   assure( cpl_image_get_type(variance) == FORS_IMAGE_TYPE, return NULL,
+//            "Provided weight image type is %s, must be %s",
+//            fors_type_get_string(cpl_image_get_type(variance)),
+//            fors_type_get_string(FORS_IMAGE_TYPE) );
 
     assure( cpl_image_get_size_x(data) == cpl_image_get_size_x(variance) &&
             cpl_image_get_size_y(data) == cpl_image_get_size_y(variance),
             return NULL,
-            "Incompatible data and weight image sizes: %dx%d and %dx%d",
+            "Incompatible data and weight image sizes: "
+            "%"CPL_SIZE_FORMAT"x%"CPL_SIZE_FORMAT
+            " and %"CPL_SIZE_FORMAT"x%"CPL_SIZE_FORMAT,
             cpl_image_get_size_x(data), cpl_image_get_size_y(data),
             cpl_image_get_size_x(variance), cpl_image_get_size_y(variance));
 
@@ -828,7 +831,10 @@ fors_image_multiply_noerr(fors_image *left, const cpl_image *right)
     assure( right != NULL, return, NULL );
     assure( cpl_image_get_size_x(left->data) == cpl_image_get_size_x(right) &&
             cpl_image_get_size_y(left->data) == cpl_image_get_size_y(right),
-            return, "Incompatible image sizes: %dx%d and %dx%d",
+            return,
+            "Incompatible data and weight image sizes: "
+            "%"CPL_SIZE_FORMAT"x%"CPL_SIZE_FORMAT
+            " and %"CPL_SIZE_FORMAT"x%"CPL_SIZE_FORMAT,
             cpl_image_get_size_x(left->data),
             cpl_image_get_size_y(left->data),
             cpl_image_get_size_x(right),
@@ -866,7 +872,10 @@ fors_image_divide_noerr(fors_image *left, cpl_image *right)
     assure( right != NULL, return, NULL );
     assure( cpl_image_get_size_x(left->data) == cpl_image_get_size_x(right) &&
             cpl_image_get_size_y(left->data) == cpl_image_get_size_y(right),
-            return, "Incompatible image sizes: %dx%d and %dx%d",
+            return,
+            "Incompatible data and weight image sizes: "
+            "%"CPL_SIZE_FORMAT"x%"CPL_SIZE_FORMAT
+            " and %"CPL_SIZE_FORMAT"x%"CPL_SIZE_FORMAT,
             cpl_image_get_size_x(left->data),
             cpl_image_get_size_y(left->data),
             cpl_image_get_size_x(right),
diff --git a/fors/fors_image.h b/fors/fors_image.h
index 962670a..8e9afd4 100644
--- a/fors/fors_image.h
+++ b/fors/fors_image.h
@@ -1,4 +1,4 @@
-/* $Id: fors_image.h,v 1.30 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_image.h,v 1.31 2013-07-24 12:59:35 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
- * $Revision: 1.30 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-07-24 12:59:35 $
+ * $Revision: 1.31 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_IMAGE_H
@@ -40,6 +40,8 @@ extern const cpl_type FORS_IMAGE_TYPE;
 #define LIST_ELEM fors_image
 #include <list.h>
 
+CPL_BEGIN_DECLS
+
 /* Constructors */
 fors_image *fors_image_new(cpl_image *data, cpl_image *weights);
 
@@ -146,4 +148,6 @@ double fors_image_get_error_mean(const fors_image *image, double *dmean);
 double fors_image_get_min(const fors_image *image);
 double fors_image_get_max(const fors_image *image);
 
+CPL_END_DECLS
+
 #endif
diff --git a/fors/fors_img_science_impl.c b/fors/fors_img_science_impl.c
index 1a48857..3d15d84 100644
--- a/fors/fors_img_science_impl.c
+++ b/fors/fors_img_science_impl.c
@@ -1,4 +1,4 @@
-/* $Id: fors_img_science_impl.c,v 1.49 2013/02/15 10:54:52 cgarcia Exp $
+/* $Id: fors_img_science_impl.c,v 1.50 2013-09-10 19:16:03 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/02/15 10:54:52 $
- * $Revision: 1.49 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-10 19:16:03 $
+ * $Revision: 1.50 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -409,7 +409,7 @@ void fors_img_science(cpl_frameset *frames, const cpl_parameterlist *parameters)
                      setting);
     fors_dfs_add_exptime(product_header, cpl_frameset_get_first(sci_frame), 0.);
 
-    fors_dfs_save_image(frames, sci, SCIENCE_REDUCED_IMG,
+    fors_dfs_save_image_err(frames, sci, SCIENCE_REDUCED_IMG,
                         qc, parameters, fors_img_science_name, 
                         cpl_frameset_get_first(sci_frame));
     assure( !cpl_error_get_code(), return, "Saving %s failed",
diff --git a/fors/fors_img_science_impl.h b/fors/fors_img_science_impl.h
index 101081f..84a5dd9 100644
--- a/fors/fors_img_science_impl.h
+++ b/fors/fors_img_science_impl.h
@@ -1,4 +1,4 @@
-/* $Id: fors_img_science_impl.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_img_science_impl.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_IMG_SCIENCE_IMPL_H
diff --git a/fors/fors_img_screen_flat_impl.c b/fors/fors_img_screen_flat_impl.c
index 4831fae..0b09e6f 100644
--- a/fors/fors_img_screen_flat_impl.c
+++ b/fors/fors_img_screen_flat_impl.c
@@ -1,4 +1,4 @@
-/* $Id: fors_img_screen_flat_impl.c,v 1.43 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_img_screen_flat_impl.c,v 1.48 2013-09-10 19:16:19 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
- * $Revision: 1.43 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-09-10 19:16:19 $
+ * $Revision: 1.48 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -220,7 +220,7 @@ fors_img_screen_flat(cpl_frameset *frames, const cpl_parameterlist *parameters)
     /* Find calibration */
     master_bias_frame = fors_frameset_extract(frames, MASTER_BIAS);
     assure( cpl_frameset_get_size(master_bias_frame) == 1, return, 
-            "One %s required. %d found", 
+            "One %s required. %"CPL_SIZE_FORMAT" found", 
             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame));
     
     /* Get instrument setting */
@@ -256,13 +256,13 @@ fors_img_screen_flat(cpl_frameset *frames, const cpl_parameterlist *parameters)
     assure( !cpl_error_get_code(), return, "Failed to compute QC");
 
     /* Save products */
-    fors_dfs_save_image(frames, master_screen_flat, MASTER_SCREEN_FLAT_IMG,
+    fors_dfs_save_image_err(frames, master_screen_flat, MASTER_SCREEN_FLAT_IMG,
                         NULL, parameters, fors_img_screen_flat_name, 
                         cpl_frameset_get_first(sflat_frames));
     assure( !cpl_error_get_code(), return, "Saving %s failed",
             MASTER_SCREEN_FLAT_IMG);
     
-    fors_dfs_save_image(frames, master_norm_flat, MASTER_NORM_FLAT_IMG,
+    fors_dfs_save_image_err(frames, master_norm_flat, MASTER_NORM_FLAT_IMG,
                         qc, parameters, fors_img_screen_flat_name, 
                         cpl_frameset_get_first(sflat_frames));
     assure( !cpl_error_get_code(), return, "Saving %s failed",
@@ -311,6 +311,7 @@ remove_large_scale(fors_image *master_screen_flat,
     name = cpl_sprintf("%s.%s", context, "degree");
     const cpl_parameter *param = cpl_parameterlist_find_const(parameters, name);
     int degree = cpl_parameter_get_int(param);
+
     cpl_free((void *)name); name = NULL;
     if (degree >= 0) {
         remove_large_scale_fit(master_screen_flat, parameters, context,
@@ -363,15 +364,16 @@ remove_large_scale(fors_image *master_screen_flat,
     
     assure( !cpl_error_get_code(), return, NULL );
 
-    int DEBUG = 1;
-    if (DEBUG) {
+#ifdef DEBUG
+    {
         const char *filename = "smooth.fits";
 
-        cpl_msg_info(cpl_func, "Saving large scale structure image to %s",
+        cpl_msg_warning(cpl_func, "Saving large scale structure image to %s",
                      filename);
         cpl_image_save(smoothed, filename, CPL_BPP_IEEE_FLOAT,
                        NULL, CPL_IO_DEFAULT);
     }
+#endif
     
     fors_image_divide_noerr(master_screen_flat, smoothed);
     /* smoothed image modified here */
@@ -414,6 +416,7 @@ remove_large_scale_fit(fors_image *master_screen_flat,
     const char *name;
     int step;
     int degree;
+    (void)setting;
 
     cpl_msg_info(cpl_func, "Large scale fitting parameters:");
     
@@ -449,8 +452,8 @@ remove_large_scale_fit(fors_image *master_screen_flat,
     
     assure( !cpl_error_get_code(), return, NULL );
 
-    int DEBUG = 1;
-    if (DEBUG) {
+#ifdef DEBUG
+    {
         const char *filename = "smooth.fits";
 
         cpl_msg_info(cpl_func, "Saving large scale structure image to %s",
@@ -458,6 +461,7 @@ remove_large_scale_fit(fors_image *master_screen_flat,
         cpl_image_save(smoothed, filename, CPL_BPP_IEEE_FLOAT,
                        NULL, CPL_IO_DEFAULT);
     }
+#endif
     
     fors_image_divide_noerr(master_screen_flat, smoothed);
     /* smoothed image modified here */
diff --git a/fors/fors_img_screen_flat_impl.h b/fors/fors_img_screen_flat_impl.h
index ad14ef1..122efc2 100644
--- a/fors/fors_img_screen_flat_impl.h
+++ b/fors/fors_img_screen_flat_impl.h
@@ -1,4 +1,4 @@
-/* $Id: fors_img_screen_flat_impl.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_img_screen_flat_impl.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_IMG_SCREEN_FLAT_IMPL_H
diff --git a/fors/fors_img_sky_flat_impl.c b/fors/fors_img_sky_flat_impl.c
index 04a0c65..e7685cb 100644
--- a/fors/fors_img_sky_flat_impl.c
+++ b/fors/fors_img_sky_flat_impl.c
@@ -1,4 +1,4 @@
-/* $Id: fors_img_sky_flat_impl.c,v 1.25 2013/02/15 10:55:44 cgarcia Exp $
+/* $Id: fors_img_sky_flat_impl.c,v 1.26 2013-09-10 19:16:36 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/02/15 10:55:44 $
- * $Revision: 1.25 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-10 19:16:36 $
+ * $Revision: 1.26 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -226,7 +226,7 @@ void fors_img_sky_flat(cpl_frameset *frames, const cpl_parameterlist *parameters
     fors_qc_end_group();
 
     /* Save product */
-    fors_dfs_save_image(frames, master_sky_flat, MASTER_SKY_FLAT_IMG,
+    fors_dfs_save_image_err(frames, master_sky_flat, MASTER_SKY_FLAT_IMG,
                         qc, parameters, fors_img_sky_flat_name, 
                         cpl_frameset_get_first(sflat_frames));
     assure( !cpl_error_get_code(), return, "Saving %s failed",
diff --git a/fors/fors_img_sky_flat_impl.h b/fors/fors_img_sky_flat_impl.h
index ed35f5a..b25b3e4 100644
--- a/fors/fors_img_sky_flat_impl.h
+++ b/fors/fors_img_sky_flat_impl.h
@@ -1,4 +1,4 @@
-/* $Id: fors_img_sky_flat_impl.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_img_sky_flat_impl.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_IMG_SKY_FLAT_IMPL_H
diff --git a/fors/fors_instrument.c b/fors/fors_instrument.c
index e63feeb..cfef591 100644
--- a/fors/fors_instrument.c
+++ b/fors/fors_instrument.c
@@ -1,4 +1,4 @@
-/* $Id: fors_instrument.c,v 1.4 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_instrument.c,v 1.4 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_instrument.h b/fors/fors_instrument.h
index e5ec13a..62cc09e 100644
--- a/fors/fors_instrument.h
+++ b/fors/fors_instrument.h
@@ -1,4 +1,4 @@
-/* $Id: fors_instrument.h,v 1.3 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_instrument.h,v 1.3 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.3 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_INSTRUMENT_H
diff --git a/fors/fors_overscan.cc b/fors/fors_overscan.cc
new file mode 100644
index 0000000..b462733
--- /dev/null
+++ b/fors/fors_overscan.cc
@@ -0,0 +1,300 @@
+/* $Id: moses.c,v 1.116 2013/10/15 09:27:38 cgarcia Exp $
+ *
+ * This file is part of the MOSES library
+ * Copyright (C) 2002-2010 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013/10/15 09:27:38 $
+ * $Revision: 1.116 $
+ * $Name:  $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <fors_overscan.h>
+#include <hdrl_overscan.h>
+#include <hdrl_parameter.h>
+#include <hdrl_utils.h>
+
+hdrl_parameter ** fors_overscan_get_regions(const cpl_propertylist *header,
+                                            int &nregions);
+hdrl_parameter ** fors_overscan_get_region_newdet(const cpl_propertylist *header);
+hdrl_parameter ** fors_overscan_get_region_olddet(const cpl_propertylist *header);
+
+
+/**
+ * @brief
+ *   Subtract the overscan from a CCD exposure
+ *
+ * @param image       Image containing the data to correct
+ * @param header      Header of the image
+ *
+ * @return A newly allocated overscan subtracted image
+ *
+ */
+cpl_image * fors_remove_overscan(cpl_image * image, cpl_propertylist * header)
+{
+/*    const char *func = "mos_remove_bias";
+
+    cpl_image *unbiased;
+    cpl_image *overscan;
+    double     mean_bias_level;
+    double     mean_overscans_level;
+    int        count;
+    int        nrows;
+    int        xlow, ylow, xhig, yhig;
+*/
+    int        i;
+
+    hdrl_parameter ** overscan_regions;
+    int               nregions;
+    
+    if (image == NULL) 
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+        return NULL;
+    }
+
+    overscan_regions = fors_overscan_get_regions(header, nregions);
+
+    //count = 0;
+    /* We cannot do it with HDRL, since it only accepts one region */
+    //for (i = 0; i < nregions; i++) 
+    //{
+        //xlow = cpl_table_get_int(overscans, "xlow", i, NULL);
+        //ylow = cpl_table_get_int(overscans, "ylow", i, NULL);
+        //xhig = cpl_table_get_int(overscans, "xhig", i, NULL);
+        //yhig = cpl_table_get_int(overscans, "yhig", i, NULL);
+
+        //if (i == 0) 
+        //{
+            //unbiased = cpl_image_extract(image, xlow+1, ylow+1, xhig, yhig);
+            //if (unbiased == NULL) {
+                //cpl_msg_error(func, "Incompatible overscan table");
+                //cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
+                //return NULL;
+            //}
+        //}
+        //else {
+            //overscan = cpl_image_extract(image, xlow+1, ylow+1, xhig, yhig);
+            //if (overscan == NULL) {
+                //cpl_msg_error(func, "Incompatible overscan table");
+                //cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
+                //cpl_image_delete(unbiased);
+       //         return NULL;
+       //     }
+
+            //mean_overscans_level += cpl_image_get_median(overscan);
+            //count++;
+
+            /***
+             * Here the mean level was used: not very robust...
+
+            mean_overscans_level += cpl_image_get_flux(overscan);
+            count += cpl_image_get_size_x(overscan)
+             * cpl_image_get_size_y(overscan);
+             ***/
+            //cpl_image_delete(overscan);
+        //}
+    //}
+
+    /*
+     * Overscan correction
+     */
+
+    //mean_overscans_level /= count;
+
+    //cpl_image_subtract_scalar(unbiased, mean_overscans_level - mean_bias_level);
+
+    //cpl_msg_info(cpl_func, 
+    //             "Difference between mean overscans level "
+    //             "and mean bias level: %.2f",
+    //             mean_overscans_level - mean_bias_level);
+
+    //return unbiased;
+    return NULL;
+
+}
+
+hdrl_parameter ** fors_overscan_get_regions(const cpl_propertylist *header,
+                                            int &nregions)
+{
+    int    nports;
+
+    if (header == NULL) 
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+        return NULL;
+    }
+
+    if (cpl_propertylist_has(header, "ESO DET OUTPUTS"))
+        nports = cpl_propertylist_get_int(header, "ESO DET OUTPUTS");
+
+    if (nports == 4                                        && 
+        cpl_propertylist_has(header, "ESO DET OUT1 PRSCX") &&
+        cpl_propertylist_has(header, "ESO DET WIN1 BINX")) 
+    {
+        //return fors_overscan_get_region_newdet(header);
+    }
+    else 
+    {
+        //return fors_overscan_get_region_olddet(header);
+    }
+
+    return NULL;
+}
+
+hdrl_parameter ** fors_overscan_get_region_newdet(const cpl_propertylist *header)
+{
+
+    int        nx = 0;
+    int        ny = 0;
+    int        px = 0;
+    int        py = 0;
+    int        ox = 0;
+    int        oy = 0;
+    int        rebin;
+    hdrl_parameter ** overscan_regions;
+
+
+    rebin = cpl_propertylist_get_int(header, "ESO DET WIN1 BINX");
+
+    overscan_regions = (hdrl_parameter **)cpl_malloc(3 * sizeof(hdrl_parameter *));
+
+    px = 16 / rebin;
+    ox = 16 / rebin;
+    nx = 2080 / rebin;
+    ny = 2048 / rebin;
+
+    overscan_regions[0] = hdrl_rect_region_parameter_create(px, py,
+                                                            nx - ox, ny - oy);
+    overscan_regions[1] = hdrl_rect_region_parameter_create(0, 0,
+                                                            px, ny);
+    overscan_regions[2] = hdrl_rect_region_parameter_create(nx - ox, 0,
+                                                            nx, ny);
+
+    return overscan_regions;
+}
+
+hdrl_parameter ** fors_overscan_get_region_oldet(const cpl_propertylist *header)
+{
+
+    int        nx = 0;
+    int        ny = 0;
+    int        px = 0;
+    int        py = 0;
+    int        ox = 0;
+    int        oy = 0;
+    size_t     nrows;
+    size_t     irow;
+    hdrl_parameter ** overscan_regions;
+
+    if (cpl_propertylist_has(header, "NAXIS1"))
+        nx = cpl_propertylist_get_int(header, "NAXIS1");
+    if (cpl_propertylist_has(header, "NAXIS2"))
+        ny = cpl_propertylist_get_int(header, "NAXIS2");
+    if (cpl_propertylist_has(header, "ESO DET OUT1 PRSCX"))
+        px = cpl_propertylist_get_int(header, "ESO DET OUT1 PRSCX");
+    if (cpl_propertylist_has(header, "ESO DET OUT1 PRSCY"))
+        py = cpl_propertylist_get_int(header, "ESO DET OUT1 PRSCY");
+    if (cpl_propertylist_has(header, "ESO DET OUT1 OVSCX"))
+        ox = cpl_propertylist_get_int(header, "ESO DET OUT1 OVSCX");
+    if (cpl_propertylist_has(header, "ESO DET OUT1 OVSCY"))
+        oy = cpl_propertylist_get_int(header, "ESO DET OUT1 OVSCY");
+
+    if (cpl_error_get_code() != CPL_ERROR_NONE) 
+    {
+        cpl_msg_error(cpl_func, "Missing overscan keywords in header");
+        cpl_error_set_where(cpl_func);
+        return NULL;
+    }
+
+    if (px < 0 || py < 0 || ox < 0 || oy < 0) 
+    {
+        cpl_msg_error(cpl_func, "Missing overscan keywords in header");
+        cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+
+    nrows = 0;
+    if (px > 0)
+        nrows++;
+    if (ox > 0)
+        nrows++;
+    if (py > 0)
+        nrows++;
+    if (oy > 0)
+        nrows++;
+
+    if (nrows > 2) 
+    {
+        cpl_msg_error(cpl_func, "Unexpected overscan regions "
+                      "(both in X and Y direction)");
+        cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+
+
+    /*
+     * A row is added for the description of the valid region of the
+     * exposure the input header belongs to.
+     */
+
+    nrows++;
+
+    overscan_regions = (hdrl_parameter **)
+                       cpl_malloc(nrows * sizeof(hdrl_parameter *));
+
+    irow = 0;
+    overscan_regions[irow] = hdrl_rect_region_parameter_create(px, py,
+                                                               nx - ox, ny - oy);
+    irow++;
+
+    if (px > 0) 
+    {
+        overscan_regions[irow] = hdrl_rect_region_parameter_create(0, 0,
+                                                                   px, ny);
+        irow++;
+    }
+
+    if (ox > 0) 
+    {
+        overscan_regions[irow] = hdrl_rect_region_parameter_create(nx - ox, 0,
+                                                                   nx, ny);
+        irow++;
+    }
+
+    if (py > 0) 
+    {
+        overscan_regions[irow] = hdrl_rect_region_parameter_create(0, 0,
+                                                                   nx, py);
+        irow++;
+    }
+
+    if (oy > 0) 
+    {
+        overscan_regions[irow] = hdrl_rect_region_parameter_create(0, ny - oy,
+                                                                   nx, ny);
+        irow++;
+    }
+
+    return overscan_regions;
+}
diff --git a/recipes/tests/recipes-test.c b/fors/fors_overscan.h
similarity index 61%
copy from recipes/tests/recipes-test.c
copy to fors/fors_overscan.h
index e868c9e..27f4a19 100644
--- a/recipes/tests/recipes-test.c
+++ b/fors/fors_overscan.h
@@ -1,7 +1,7 @@
-/* $Id: recipes-test.c,v 1.6 2007/10/26 14:02:15 jmlarsen Exp $
+/* $Id: moses.h,v 1.41 2013/09/09 12:19:20 cgarcia Exp $
  *
- * This file is part of the FORS Library
- * Copyright (C) 2002-2006 European Southern Observatory
+ * This file is part of the VIMOS Pipeline
+ * Copyright (C) 2002-2010 European Southern Observatory
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,30 +19,21 @@
  */
 
 /*
- * $Author: jmlarsen $
- * $Date: 2007/10/26 14:02:15 $
- * $Revision: 1.6 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013/09/09 12:19:20 $
+ * $Revision: 1.41 $
+ * $Name:  $
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#ifndef MOSES_H
+#define MOSES_H
 
-#include <stdlib.h>
+#include <cpl.h>
 
-/**
- * @defgroup recipes_test 
- */
+CPL_BEGIN_DECLS
 
-/**@{*/
+cpl_image * fors_remove_overscan(cpl_image * image, cpl_propertylist * header);
 
-/**
- * @brief   Hello world test
- */
-int main(void)
-{
-    exit(EXIT_SUCCESS);
-}
+CPL_END_DECLS
 
-/**@}*/
+#endif   /* FORS_OVERSCAN_H */
diff --git a/fors/fors_paf.c b/fors/fors_paf.c
index 25fc62a..60c981c 100644
--- a/fors/fors_paf.c
+++ b/fors/fors_paf.c
@@ -1,4 +1,4 @@
-/* $Id: fors_paf.c,v 1.3 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_paf.c,v 1.6 2013-08-14 13:28:56 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
- * $Revision: 1.3 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-08-14 13:28:56 $
+ * $Revision: 1.6 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -328,7 +328,9 @@ _forsPAFHeaderCreate(const char *name, const char *type, const char *id,
     user = user == NULL ? getenv("LOGNAME") : user;
 
     if (!user)
+    {
         return NULL;
+    }
 #endif
 
     /* Get timestamp */
@@ -559,12 +561,17 @@ ForsPAF *newForsPAF(const char *name, const char *type, const char *id,
     paf = (ForsPAF *)cpl_malloc(sizeof(ForsPAF));
     if (paf) {
         paf->header = _forsPAFHeaderCreate(name, type, id, desc, &pos);
+        if(paf->header == NULL)
+        {
+            cpl_free(paf);
+            return NULL;
+        }
         paf->records = NULL;
         paf->nh = pos;
         paf->nr = 0;
         paf->name = cpl_strdup(name);
     }
-
+    
     return paf;
 
 }
diff --git a/fors/fors_paf.h b/fors/fors_paf.h
index 1fa210e..50d0870 100644
--- a/fors/fors_paf.h
+++ b/fors/fors_paf.h
@@ -1,4 +1,4 @@
-/* $Id: fors_paf.h,v 1.2 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_paf.h,v 1.2 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
  
 #ifndef FORS_PAF_H
diff --git a/fors/fors_pattern.c b/fors/fors_pattern.c
index db6351d..0d25455 100644
--- a/fors/fors_pattern.c
+++ b/fors/fors_pattern.c
@@ -1,4 +1,4 @@
-/* $Id: fors_pattern.c,v 1.4 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_pattern.c,v 1.4 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_pattern.h b/fors/fors_pattern.h
index 8e6eb60..dae5593 100644
--- a/fors/fors_pattern.h
+++ b/fors/fors_pattern.h
@@ -1,4 +1,4 @@
-/* $Id: fors_pattern.h,v 1.3 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_pattern.h,v 1.3 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.3 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_PATTERN_H
diff --git a/fors/fors_pfits.c b/fors/fors_pfits.c
index c229a0c..e726691 100644
--- a/fors/fors_pfits.c
+++ b/fors/fors_pfits.c
@@ -1,4 +1,4 @@
-/* $Id: fors_pfits.c,v 1.13 2011/10/24 13:08:33 cgarcia Exp $
+/* $Id: fors_pfits.c,v 1.13 2011-10-24 13:08:33 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/24 13:08:33 $
+ * $Date: 2011-10-24 13:08:33 $
  * $Revision: 1.13 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_pfits.h b/fors/fors_pfits.h
index 65b9000..ef051e0 100644
--- a/fors/fors_pfits.h
+++ b/fors/fors_pfits.h
@@ -1,4 +1,4 @@
-/* $Id: fors_pfits.h,v 1.12 2011/10/24 13:08:17 cgarcia Exp $
+/* $Id: fors_pfits.h,v 1.12 2011-10-24 13:08:17 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/24 13:08:17 $
+ * $Date: 2011-10-24 13:08:17 $
  * $Revision: 1.12 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_PFITS_H
diff --git a/fors/fors_photometry_impl.c b/fors/fors_photometry_impl.c
index 2e0df31..2ba06ea 100644
--- a/fors/fors_photometry_impl.c
+++ b/fors/fors_photometry_impl.c
@@ -1,4 +1,4 @@
-/* $Id: fors_photometry_impl.c,v 1.82 2012/01/27 18:53:15 cgarcia Exp $
+/* $Id: fors_photometry_impl.c,v 1.86 2013-09-10 19:17:31 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/01/27 18:53:15 $
- * $Revision: 1.82 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-10 19:17:31 $
+ * $Revision: 1.86 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -1618,64 +1618,6 @@ fors_photometry_check_fitparam_atm_ext(     entry_list      *obsl,
 }
 
 /*----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------*/
-static void
-myprintf(const char *format, ...) 
-{
-    va_list al;
-    
-    va_start(al, format);
-    //vprintf(format, al);
-    va_end(al);
-
-    return;
-}
-
-
-/*----------------------------------------------------------------------------*/
-/* Internal CPL function, duplicated */
-/*----------------------------------------------------------------------------*/
-static cpl_matrix * matrix_product_normal_create(const cpl_matrix * self)
-{
-    double         sum;
-    cpl_matrix   * product;
-    const double * ai = cpl_matrix_get_data_const(self);
-    const double * aj;
-    double       * bwrite;
-    const int      m = cpl_matrix_get_nrow(self);
-    const int      n = cpl_matrix_get_ncol(self);
-    int            i, j, k;
-
-
-    cpl_ensure(self != NULL, CPL_ERROR_NULL_INPUT, NULL);
-
-#if 0
-    /* Initialize all values to zero.
-       This is done to avoid access of uninitilized memory,  in case
-       someone passes the matrix to for example cpl_matrix_dump(). */
-    product = cpl_matrix_new(m, m);
-    bwrite = cpl_matrix_get_data(product);
-#else
-    bwrite = (double *) cpl_malloc(m * m * sizeof(double));
-    product = cpl_matrix_wrap(m, m, bwrite);
-#endif
-
-    /* The result at (i,j) is the dot-product of i'th and j'th row */
-    for (i = 0; i < m; i++, bwrite += m, ai += n) {
-        aj = ai; /* aj points to first entry in j'th row */
-        for (j = i; j < m; j++, aj += n) {
-            sum = 0.0;
-            for (k = 0; k < n; k++) {
-                sum += ai[k] * aj[k];
-            }
-            bwrite[j] = sum;
-        }
-    }
-
-    return product;
-}
-
-/*----------------------------------------------------------------------------*/
 #undef cleanup
 #define cleanup \
 do { \
@@ -1943,7 +1885,7 @@ void fors_photometry(cpl_frameset *frames, const cpl_parameterlist *parameters)
     cassure(cpl_frameset_get_size(phot_table) == 1,
             CPL_ERROR_DATA_NOT_FOUND,
             return, 
-            "One %s required. %d found",
+            "One %s required. %"CPL_SIZE_FORMAT" found",
             PHOT_TABLE, cpl_frameset_get_size(phot_table));
 
     /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -2675,7 +2617,7 @@ void fors_photometry(cpl_frameset *frames, const cpl_parameterlist *parameters)
 
     if (degreef1 > 0) {
     
-        fors_dfs_save_image(frames, correction, CORRECTION_MAP,
+        fors_dfs_save_image_err(frames, correction, CORRECTION_MAP,
                             qc, parameters, fors_photometry_name, 
                             cpl_frameset_get_first_const(master_flat_frame));
 
@@ -2699,7 +2641,7 @@ void fors_photometry(cpl_frameset *frames, const cpl_parameterlist *parameters)
         fors_image_divide_scalar(correction, 
                                  fors_image_get_median(correction, NULL), -1.0);
     
-        fors_dfs_save_image(frames, correction, CORRECTION_FACTOR,
+        fors_dfs_save_image_err(frames, correction, CORRECTION_FACTOR,
                             NULL, parameters, fors_photometry_name, 
                             cpl_frameset_get_first_const(master_flat_frame));
     
@@ -2711,7 +2653,7 @@ void fors_photometry(cpl_frameset *frames, const cpl_parameterlist *parameters)
         cpl_msg_info(cpl_func, "Creating corrected master flat");
         fors_image_multiply(master_flat, correction);
     
-        fors_dfs_save_image(frames, master_flat, MASTER_FLAT_IMG,
+        fors_dfs_save_image_err(frames, master_flat, MASTER_FLAT_IMG,
                             NULL, parameters, fors_photometry_name, 
                             cpl_frameset_get_first_const(master_flat_frame));
         assure( !cpl_error_get_code(), return, "Saving %s failed",
diff --git a/fors/fors_photometry_impl.h b/fors/fors_photometry_impl.h
index bfe7f56..92232c4 100644
--- a/fors/fors_photometry_impl.h
+++ b/fors/fors_photometry_impl.h
@@ -1,4 +1,4 @@
-/* $Id: fors_photometry_impl.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_photometry_impl.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_PHOTOMETRY_IMPL_H
diff --git a/fors/fors_point.c b/fors/fors_point.c
index 6fa5a8d..7b151e2 100644
--- a/fors/fors_point.c
+++ b/fors/fors_point.c
@@ -1,4 +1,4 @@
-/* $Id: fors_point.c,v 1.3 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_point.c,v 1.3 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.3 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_point.h b/fors/fors_point.h
index 0d90382..8f91494 100644
--- a/fors/fors_point.h
+++ b/fors/fors_point.h
@@ -1,4 +1,4 @@
-/* $Id: fors_point.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_point.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_POINT_H
diff --git a/fors/fors_polynomial.c b/fors/fors_polynomial.c
index bff8e38..f66f72b 100644
--- a/fors/fors_polynomial.c
+++ b/fors/fors_polynomial.c
@@ -1,4 +1,4 @@
-/* $Id: fors_polynomial.c,v 1.9 2013/02/15 10:55:19 cgarcia Exp $
+/* $Id: fors_polynomial.c,v 1.9 2013-02-15 10:55:19 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/02/15 10:55:19 $
+ * $Date: 2013-02-15 10:55:19 $
  * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_polynomial.h b/fors/fors_polynomial.h
index 5acc8d9..fe778e5 100644
--- a/fors/fors_polynomial.h
+++ b/fors/fors_polynomial.h
@@ -1,4 +1,4 @@
-/* $Id: fors_polynomial.h,v 1.5 2012/01/27 18:51:59 cgarcia Exp $
+/* $Id: fors_polynomial.h,v 1.5 2012-01-27 18:51:59 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/01/27 18:51:59 $
+ * $Date: 2012-01-27 18:51:59 $
  * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_POLYNOMIAL_H
diff --git a/fors/fors_qc.c b/fors/fors_qc.c
index 39d47c9..1df0b91 100644
--- a/fors/fors_qc.c
+++ b/fors/fors_qc.c
@@ -1,4 +1,4 @@
-/* $Id: fors_qc.c,v 1.10 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_qc.c,v 1.10 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.10 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_qc.h b/fors/fors_qc.h
index 081d4b9..a918c02 100644
--- a/fors/fors_qc.h
+++ b/fors/fors_qc.h
@@ -1,4 +1,4 @@
-/* $Id: fors_qc.h,v 1.6 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_qc.h,v 1.6 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.6 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_QC_H
diff --git a/fors/fors_recipe_impl.h b/fors/fors_recipe_impl.h
index 683829f..6d61158 100644
--- a/fors/fors_recipe_impl.h
+++ b/fors/fors_recipe_impl.h
@@ -1,4 +1,4 @@
-/* $Id: fors_recipe_impl.h,v 1.2 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_recipe_impl.h,v 1.2 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_RECIPE_IMPL_H
diff --git a/fors/fors_setting.c b/fors/fors_setting.c
index 04b4206..0a31fad 100644
--- a/fors/fors_setting.c
+++ b/fors/fors_setting.c
@@ -1,4 +1,4 @@
-/* $Id: fors_setting.c,v 1.19 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_setting.c,v 1.19 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.19 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_setting.h b/fors/fors_setting.h
index 2a7ac8a..4d6812d 100644
--- a/fors/fors_setting.h
+++ b/fors/fors_setting.h
@@ -1,4 +1,4 @@
-/* $Id: fors_setting.h,v 1.16 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_setting.h,v 1.16 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.16 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_SETTING_H
diff --git a/fors/fors_stack.c b/fors/fors_stack.c
index 23e6c88..d954242 100644
--- a/fors/fors_stack.c
+++ b/fors/fors_stack.c
@@ -1,4 +1,4 @@
-/* $Id: fors_stack.c,v 1.17 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_stack.c,v 1.17 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.17 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_stack.h b/fors/fors_stack.h
index a82accb..5bb9bc8 100644
--- a/fors/fors_stack.h
+++ b/fors/fors_stack.h
@@ -1,4 +1,4 @@
-/* $Id: fors_stack.h,v 1.7 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_stack.h,v 1.7 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_STACK_IMPL_H
diff --git a/fors/fors_star.c b/fors/fors_star.c
index 6ddac34..0ba1428 100644
--- a/fors/fors_star.c
+++ b/fors/fors_star.c
@@ -1,4 +1,4 @@
-/* $Id: fors_star.c,v 1.29 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_star.c,v 1.29 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.29 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_star.h b/fors/fors_star.h
index a965cfd..58b7fbf 100644
--- a/fors/fors_star.h
+++ b/fors/fors_star.h
@@ -1,4 +1,4 @@
-/* $Id: fors_star.h,v 1.21 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_star.h,v 1.21 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.21 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_STAR_H
diff --git a/fors/fors_std_cat.c b/fors/fors_std_cat.c
index bfd29df..b8b8ee1 100644
--- a/fors/fors_std_cat.c
+++ b/fors/fors_std_cat.c
@@ -1,4 +1,4 @@
-/* $Id: fors_std_cat.c,v 1.19 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_std_cat.c,v 1.21 2013-09-10 15:19:08 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
- * $Revision: 1.19 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-09-10 15:19:08 $
+ * $Revision: 1.21 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_std_cat.h b/fors/fors_std_cat.h
index b88d9d8..912cb17 100644
--- a/fors/fors_std_cat.h
+++ b/fors/fors_std_cat.h
@@ -1,4 +1,4 @@
-/* $Id: fors_std_cat.h,v 1.11 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_std_cat.h,v 1.13 2013-09-10 15:19:58 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
- * $Revision: 1.11 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-09-10 15:19:58 $
+ * $Revision: 1.13 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_STD_CAT_H
diff --git a/fors/fors_std_star.c b/fors/fors_std_star.c
index f1174fe..ce76f9e 100644
--- a/fors/fors_std_star.c
+++ b/fors/fors_std_star.c
@@ -1,4 +1,4 @@
-/* $Id: fors_std_star.c,v 1.20 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_std_star.c,v 1.20 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.20 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_std_star.h b/fors/fors_std_star.h
index 28f97f1..015a0f9 100644
--- a/fors/fors_std_star.h
+++ b/fors/fors_std_star.h
@@ -1,4 +1,4 @@
-/* $Id: fors_std_star.h,v 1.14 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_std_star.h,v 1.14 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.14 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_STD_STAR_H
diff --git a/fors/fors_tools.c b/fors/fors_tools.c
index 33e424e..79445ad 100644
--- a/fors/fors_tools.c
+++ b/fors/fors_tools.c
@@ -1,4 +1,4 @@
-/* $Id: fors_tools.c,v 1.22 2012/08/07 15:26:53 cgarcia Exp $
+/* $Id: fors_tools.c,v 1.22 2012-08-07 15:26:53 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2012/08/07 15:26:53 $
+ * $Date: 2012-08-07 15:26:53 $
  * $Revision: 1.22 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/fors_tools.h b/fors/fors_tools.h
index b886bd9..4f65b53 100644
--- a/fors/fors_tools.h
+++ b/fors/fors_tools.h
@@ -1,4 +1,4 @@
-/* $Id: fors_tools.h,v 1.7 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_tools.h,v 1.7 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_TOOLS_H
diff --git a/fors/fors_utils.c b/fors/fors_utils.c
index 30cbce7..10f3d45 100644
--- a/fors/fors_utils.c
+++ b/fors/fors_utils.c
@@ -1,4 +1,4 @@
-/* $Id: fors_utils.c,v 1.31 2011/10/13 14:26:54 cgarcia Exp $
+/* $Id: fors_utils.c,v 1.32 2013-10-09 15:58:42 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/13 14:26:54 $
- * $Revision: 1.31 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-10-09 15:58:42 $
+ * $Revision: 1.32 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -675,7 +675,7 @@ void fors_msg_macro(cpl_msg_severity level, const char *fct, const char *format,
     case CPL_MSG_ERROR:   cpl_msg_error  (fct, "%s", message); break;
     default: 
         cpl_msg_error(fct, "Unknown message level: %d", level);
-        cpl_msg_error(fct, message);
+        cpl_msg_error(fct, "%s", message);
         break;
     }
     return;
diff --git a/fors/fors_utils.h b/fors/fors_utils.h
index 969a5ba..356fa68 100644
--- a/fors/fors_utils.h
+++ b/fors/fors_utils.h
@@ -1,4 +1,4 @@
-/* $Id: fors_utils.h,v 1.30 2011/10/13 14:26:38 cgarcia Exp $
+/* $Id: fors_utils.h,v 1.31 2013-07-24 09:56:58 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/13 14:26:38 $
- * $Revision: 1.30 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-07-24 09:56:58 $
+ * $Revision: 1.31 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_UTILS_H
@@ -136,6 +136,8 @@ do if (!(condition)) {                                      \
 
 #define TWOSQRT2LN2 2.35482004503095
 
+CPL_BEGIN_DECLS
+
 extern const double STDEV_PR_MAD;
 
 void fors_print_banner(void);
@@ -173,3 +175,5 @@ __attribute__((format (printf, 3, 4)))
 #endif
 ;
 #endif
+
+CPL_END_DECLS
diff --git a/fors/fors_zeropoint_impl.c b/fors/fors_zeropoint_impl.c
index 09150e6..43419a0 100644
--- a/fors/fors_zeropoint_impl.c
+++ b/fors/fors_zeropoint_impl.c
@@ -1,4 +1,4 @@
-/* $Id: fors_zeropoint_impl.c,v 1.93 2013/02/15 10:56:21 cgarcia Exp $
+/* $Id: fors_zeropoint_impl.c,v 1.96 2013-09-10 19:21:45 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/02/15 10:56:21 $
- * $Revision: 1.93 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-10 19:21:45 $
+ * $Revision: 1.96 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -624,7 +624,7 @@ Moved outside by Carlo - end */
     cpl_image_delete(background); background = NULL;
     
     /* FIXME: FAP: use WCS corrected header */
-    fors_dfs_save_image(frames, std, STANDARD_REDUCED_IMG,
+    fors_dfs_save_image_err(frames, std, STANDARD_REDUCED_IMG,
                         product_header, parameters, fors_zeropoint_name, 
                         cpl_frameset_get_first(std_frame));
     assure( !cpl_error_get_code(), return, "Saving %s failed",
@@ -702,7 +702,7 @@ Moved outside by Carlo - end */
                             10, color);
         }
         /* FIXME: FAP: use WCS corrected header */
-        fors_dfs_save_image(frames, std, "DEBUG",
+        fors_dfs_save_image_err(frames, std, "DEBUG",
                             product_header, parameters, fors_zeropoint_name, 
                             cpl_frameset_get_first(std_frame));
         assure( !cpl_error_get_code(), return, "Saving %s failed",
diff --git a/fors/fors_zeropoint_impl.h b/fors/fors_zeropoint_impl.h
index ef56edb..96cd7a7 100644
--- a/fors/fors_zeropoint_impl.h
+++ b/fors/fors_zeropoint_impl.h
@@ -1,4 +1,4 @@
-/* $Id: fors_zeropoint_impl.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $
+/* $Id: fors_zeropoint_impl.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2010/09/14 07:49:30 $
+ * $Date: 2010-09-14 07:49:30 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef FORS_ZEROPOINT_IMPL_H
diff --git a/fors/list.c b/fors/list.c
index 8d23ad7..a7acbb2 100644
--- a/fors/list.c
+++ b/fors/list.c
@@ -1,4 +1,4 @@
-/* $Id: list.c,v 1.18 2009/03/26 09:28:22 hlorch Exp $
+/* $Id: list.c,v 1.19 2013-05-16 08:40:07 cgarcia Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -16,10 +16,10 @@
  */
 
 /*
- * $Author: hlorch $
- * $Date: 2009/03/26 09:28:22 $
- * $Revision: 1.18 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-05-16 08:40:07 $
+ * $Revision: 1.19 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -160,15 +160,15 @@ list_duplicate(const list *l, void * (*duplicate)(const void *))
  *                  elements are not deleted.
  */
 void
-list_delete_const(const list **l, void (*delete)(void **))
+list_delete_const(const list **l, void (*ldelete)(void **))
 {
     if (l != NULL && *l != NULL) {
 
-        if (delete != NULL) {
+        if (ldelete != NULL) {
             
             int i;
             for (i = 0; i < (*l)->size; i++) {
-                delete(&((*l)->elements[i]));
+                ldelete(&((*l)->elements[i]));
             }
         }
         list_free((*l)->elements);
@@ -178,9 +178,9 @@ list_delete_const(const list **l, void (*delete)(void **))
 }
 
 void
-list_delete(list **l, void (*delete)(void **))
+list_delete(list **l, void (*ldelete)(void **))
 {
-    list_delete_const((const list **)l, delete);
+    list_delete_const((const list **)l, ldelete);
     return;
 }
 
diff --git a/fors/list.h b/fors/list.h
index 26e00c0..b2a7be8 100644
--- a/fors/list.h
+++ b/fors/list.h
@@ -1,4 +1,4 @@
-/* $Id: list.h,v 1.9 2009/02/17 15:23:51 hlorch Exp $
+/* $Id: list.h,v 1.10 2013-05-16 08:40:07 cgarcia Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -16,10 +16,10 @@
  */
 
 /*
- * $Author: hlorch $
- * $Date: 2009/02/17 15:23:51 $
- * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-05-16 08:40:07 $
+ * $Revision: 1.10 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef LIST_ELEM
@@ -76,10 +76,10 @@ LIST_CAT(LIST, duplicate)(const LIST *l,
 
 void
 LIST_CAT(LIST, delete)(LIST **l,
-                                 void (*delete)(LIST_ELEM **))
+                                 void (*ldelete)(LIST_ELEM **))
 #ifdef LIST_DEFINE 
 {
-  list_delete((list **)l, (void (*)(void **))delete);
+  list_delete((list **)l, (void (*)(void **))ldelete);
 }
 #else
 ;
@@ -87,10 +87,10 @@ LIST_CAT(LIST, delete)(LIST **l,
 
 void
 LIST_CAT(LIST, delete_const)(const LIST **l,
-			     void (*delete)(LIST_ELEM **))
+			     void (*ldelete)(LIST_ELEM **))
 #ifdef LIST_DEFINE 
 {
-    list_delete_const((const list **)l, (void (*)(void **))delete);
+    list_delete_const((const list **)l, (void (*)(void **))ldelete);
 }
 #else
 ;
diff --git a/fors/list_void.h b/fors/list_void.h
index fd47895..0a50202 100644
--- a/fors/list_void.h
+++ b/fors/list_void.h
@@ -1,4 +1,4 @@
-/* $Id: list_void.h,v 1.9 2009/02/17 15:23:51 hlorch Exp $
+/* $Id: list_void.h,v 1.10 2013-05-16 08:40:07 cgarcia Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -16,10 +16,10 @@
  */
 
 /*
- * $Author: hlorch $
- * $Date: 2009/02/17 15:23:51 $
- * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-05-16 08:40:07 $
+ * $Revision: 1.10 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef LIST_VOID_H
@@ -46,10 +46,10 @@ list *list_duplicate(const list *l, void *(*duplicate)(const void *));
 
 /* Delete */
 void
-list_delete(list **l, void (*delete)(void **));
+list_delete(list **l, void (*ldelete)(void **));
 
 void
-list_delete_const(const list **l, void (*delete)(void **));
+list_delete_const(const list **l, void (*ldelete)(void **));
 
 int
 list_size(const list *l);
diff --git a/fors/moses.c b/fors/moses.c
index 62f73e1..be36d85 100644
--- a/fors/moses.c
+++ b/fors/moses.c
@@ -1,4 +1,4 @@
-/* $Id: moses.c,v 1.100 2013/02/28 15:11:12 cgarcia Exp $
+/* $Id: moses.c,v 1.116 2013-10-15 09:27:38 cgarcia Exp $
  *
  * This file is part of the MOSES library
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/02/28 15:11:12 $
- * $Revision: 1.100 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-10-15 09:27:38 $
+ * $Revision: 1.116 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -917,7 +917,6 @@ static void mos_extraction(cpl_image *sciwin, cpl_image *skywin,
 {
 
   cpl_vector *vprofile;
-  cpl_matrix *kernel;
   cpl_image  *smowin;
 
   int i, j;
@@ -3524,8 +3523,9 @@ cpl_image *mos_remove_bias(cpl_image *image, cpl_image *bias,
     cpl_image_subtract_scalar(unbiased, mean_overscans_level - mean_bias_level);
 
     cpl_msg_info(cpl_func, 
-                 "Ratio between mean overscans level and mean bias level: %.2f",
-                  mean_overscans_level / mean_bias_level);
+                 "Difference between mean overscans level "
+                 "and mean bias level: %.2f",
+                 mean_overscans_level - mean_bias_level);
 
     return unbiased;
 
@@ -4900,7 +4900,7 @@ cpl_polynomial *mos_poly_wav2pix(cpl_bivector *pixwav, int order,
         *err = sqrt(*err);
     
         if (ids == NULL) {
-            cpl_msg_debug(cpl_error_get_where(), cpl_error_get_message());
+            cpl_msg_debug(cpl_error_get_where(), "%s", cpl_error_get_message());
             cpl_msg_debug(func, "Fitting IDS");
             cpl_error_set_where(func);
             if (rejection) {
@@ -5070,9 +5070,9 @@ cpl_bivector *mos_find_peaks(const float *spectrum, int length,
 
     for (i = 0, j = 0; i < nlines; i++) {
         pixel = cpl_polynomial_eval_1d(ids, data[i]-refwave, NULL) + 0.5;
-        if (pixel - sradius < 0 || pixel + sradius >= length)
+        if (pixel < 0 || pixel - sradius < 0 || pixel + sradius >= length)
             continue;
-        if (0 == peakPosition(spectrum+pixel-sradius, 2*sradius+1, &pos, 1)) {
+        if (peakPosition(spectrum+pixel-sradius, 2*sradius+1, &pos, 1) == 0) {
             pos += pixel - sradius;
             d_pixel[j] = pos;
             d_wavel[j] = data[i];
@@ -5114,6 +5114,7 @@ cpl_bivector *mos_find_peaks(const float *spectrum, int length,
  * @param residuals   Returned residuals image
  * @param restable    Returned residuals table
  * @param refmask     Returned monochromatic image at reference wavelength
+ * @param detected_lines Returned info on lines detected and used for the fit
  *
  * @return Input exposure resampled at constant wavelength step.
  *
@@ -5208,6 +5209,11 @@ cpl_bivector *mos_find_peaks(const float *spectrum, int length,
  * small gaps in the wavelength calibration, a morphological closing
  * (dilation + erosion), followed by a morphological opening
  * (erosion + dilation), is applied.
+ *
+ * If detected_lines table is an input, then a table with the position of
+ * the detected lines, its peak flux, wavelength identified and final xpos
+ * position in the wavelength calibrated image using the wavelength solution
+ *  is returned. The table has to be allocated but empty.
  */
 
 cpl_image *mos_wavelength_calibration_raw(const cpl_image *image,
@@ -5221,7 +5227,8 @@ cpl_image *mos_wavelength_calibration_raw(const cpl_image *image,
                                           cpl_image *calibration,
                                           cpl_image *residuals, 
                                           cpl_table *restable,
-                                          cpl_mask *refmask)
+                                          cpl_mask *refmask,
+                                          cpl_table *detected_lines)
 {
 
     const char *func = "mos_wavelength_calibration_raw";
@@ -5263,6 +5270,7 @@ cpl_image *mos_wavelength_calibration_raw(const cpl_image *image,
     int             in, first, last;
     int             width, uradius;
     int             i, j;
+    int             null;
     cpl_size        k;
 
 
@@ -5344,6 +5352,19 @@ cpl_image *mos_wavelength_calibration_raw(const cpl_image *image,
         }
     }
 
+    if (detected_lines) {
+        cpl_table_set_size(detected_lines, 0);
+        cpl_table_new_column(detected_lines, "xpos", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "ypos", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "xpos_iter", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "ypos_iter", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "peak_flux", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "wave_ident", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "wave_ident_iter", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "xpos_fit_rect_wavecal", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "res_xpos", CPL_TYPE_DOUBLE);
+    }
+
     /*
      * Here is the real thing: detecting and identifying peaks,
      * and then fit the transformation from wavelength to pixel
@@ -5434,6 +5455,62 @@ cpl_image *mos_wavelength_calibration_raw(const cpl_image *image,
                     }
                 }
 
+                if(detected_lines)
+                {
+                    cpl_size newlines = cpl_vector_get_size(peaks); 
+                    cpl_size oldsize = cpl_table_get_nrow(detected_lines); 
+                    cpl_table_set_size(detected_lines, oldsize + newlines);
+                    for(cpl_size iline = 0; iline < newlines; ++iline)
+                    {
+                        cpl_table_set_double(detected_lines, "xpos",
+                             oldsize + iline, cpl_vector_get(peaks, iline) + 1);
+                        cpl_table_set_double(detected_lines, "ypos",
+                             oldsize + iline, (double)i + 1);
+                        cpl_table_set_double(detected_lines, "peak_flux",
+                             oldsize + iline, 
+                             sdata[i*nx+(int)(cpl_vector_get(peaks, iline)+0.5)]);
+                    }
+                }
+
+                //Fill the line identification information in 
+                //the detected_lines table
+                if(detected_lines)
+                {
+                    cpl_size nidentlines = cpl_bivector_get_size(output); 
+                    cpl_size ndetectlines = cpl_vector_get_size(peaks); 
+                    cpl_size totalsize = cpl_table_get_nrow(detected_lines);
+                    for(cpl_size idline = 0; idline < nidentlines; ++idline)
+                    {
+                        for(cpl_size detline = 0; detline < ndetectlines; ++detline)
+                        {
+                            if(cpl_vector_get(peaks, detline) == 
+                               cpl_bivector_get_x_data(output)[idline])
+                            {
+                                cpl_size table_pos = totalsize - ndetectlines + detline;
+                                double wave_ident = cpl_bivector_get_y_data(output)[idline] + refwave;
+                                double xpix_fit = cpl_polynomial_eval_1d(ids,
+                                        wave_ident - refwave, NULL);
+                                double xpos_det = cpl_table_get_double(detected_lines,
+                                        "xpos",
+                                        table_pos, &null);
+                                cpl_table_set_double(detected_lines,
+                                                     "wave_ident",
+                                                     table_pos,
+                                                     wave_ident);
+                                cpl_table_set_double(detected_lines,
+                                                     "xpos_fit_rect_wavecal",
+                                                     table_pos,
+                                                     xpix_fit + 1);
+                                cpl_table_set_double(detected_lines,
+                                                     "res_xpos",
+                                                     table_pos,
+                                                     xpos_det - xpix_fit - 1);
+                               
+                            }
+                        }
+                    }
+                }
+
                 if (sradius > 0) {
 
                     /*
@@ -5518,7 +5595,32 @@ cpl_image *mos_wavelength_calibration_raw(const cpl_image *image,
                             }
                         }
                     }
-
+                    
+                    
+                    if(detected_lines)
+                    {
+                        cpl_size oldsize = cpl_table_get_nrow(detected_lines); 
+                        cpl_size nidentlines = cpl_bivector_get_size(output); 
+                        cpl_table_set_size(detected_lines, oldsize + nidentlines);
+                        for(cpl_size idline = 0; idline < nidentlines ; ++idline)
+                        {
+                            double wave_ident = cpl_bivector_get_y_data(output)[idline] + refwave;
+                            double xpix_fit = cpl_polynomial_eval_1d(ids,
+                                    wave_ident - refwave, NULL);
+                            cpl_table_set_double(detected_lines, "xpos_iter",
+                                 oldsize + idline, cpl_bivector_get_x_data(output)[idline] + 1);
+                            cpl_table_set_double(detected_lines, "ypos_iter",
+                                 oldsize + idline, (double)i + 1);
+                            cpl_table_set_double(detected_lines, "peak_flux",
+                                 oldsize + idline, 
+                                 sdata[i*nx+(int)(cpl_bivector_get_x_data(output)[idline]+0.5)]);
+                            cpl_table_set_double(detected_lines, "wave_ident_iter",
+                                 oldsize + idline, wave_ident);
+                            cpl_table_set_double(detected_lines, "xpos_fit_rect_wavecal",
+                                 oldsize + idline, xpix_fit + 1);
+                        }
+                    }
+                    
                 } /* End of "use ids as a first-guess" */
 
                 if (nlines)
@@ -6365,6 +6467,9 @@ cpl_table *mos_identify_slits(cpl_table *slits, cpl_table *maskslits,
      */
 
     for (i = 0; i < 2; i++) {
+        cpl_size    mindeg2d[] = {0, 0};
+        cpl_size    maxdeg2d[2];
+        cpl_vector  * fitresidual;
         if (i) {
             found_slits = found_slits_top;
             mdata = top_mdata;
@@ -6379,9 +6484,9 @@ cpl_table *mos_identify_slits(cpl_table *slits, cpl_table *maskslits,
         if (found_slits == 0)
             continue;
         else if (found_slits < 10)
-            degree = 1;
+            maxdeg2d[0] = maxdeg2d[1] = 1;
         else
-            degree = 2;
+            maxdeg2d[0] = maxdeg2d[1] = 2;
 
         xpos  = cpl_vector_wrap(found_slits,
                                 cpl_matrix_get_data(mdata)              );
@@ -6392,8 +6497,17 @@ cpl_table *mos_identify_slits(cpl_table *slits, cpl_table *maskslits,
         ympos = cpl_vector_wrap(found_slits,
                                 cpl_matrix_get_data(mpattern) + found_slits);
         mpos  = cpl_bivector_wrap_vectors(xmpos, ympos);
-        xpoly = cpl_polynomial_fit_2d_create(mpos, xpos, degree, &xmse);
-        ypoly = cpl_polynomial_fit_2d_create(mpos, ypos, degree, &ymse);
+        fitresidual = cpl_vector_new(cpl_vector_get_size(xpos));
+        xpoly = cpl_polynomial_new(2);
+        cpl_polynomial_fit(xpoly, mpattern, NULL, xpos, NULL, CPL_FALSE, mindeg2d, maxdeg2d);
+        cpl_vector_fill_polynomial_fit_residual(fitresidual, xpos, NULL, xpoly, mpattern, NULL);
+        xmse = cpl_vector_product(fitresidual, fitresidual)
+                         / cpl_vector_get_size(fitresidual);
+        ypoly = cpl_polynomial_new(2);
+        cpl_polynomial_fit(ypoly, mpattern, NULL, ypos, NULL, CPL_FALSE, mindeg2d, maxdeg2d);
+        cpl_vector_fill_polynomial_fit_residual(fitresidual, ypos, NULL, ypoly, mpattern, NULL);
+        ymse = cpl_vector_product(fitresidual, fitresidual)
+                         / cpl_vector_get_size(fitresidual);
 
         cpl_bivector_unwrap_vectors(mpos);
         cpl_vector_unwrap(xpos);
@@ -6402,6 +6516,7 @@ cpl_table *mos_identify_slits(cpl_table *slits, cpl_table *maskslits,
         cpl_vector_unwrap(ympos);
         cpl_matrix_delete(mdata);
         cpl_matrix_delete(mpattern);
+        cpl_vector_delete(fitresidual);
 
         if (i) {
             top_xpoly = xpoly;
@@ -6492,26 +6607,27 @@ cpl_table *mos_identify_slits(cpl_table *slits, cpl_table *maskslits,
     dpoint = cpl_vector_get_data(point);
 
     for (i = 0; i < nmaskslits; i++) {
-        double position;
+        double position_x;
+        double position_y;
 
         dpoint[0] = cpl_table_get_double(positions, "xmtop", i, NULL);
         dpoint[1] = cpl_table_get_double(positions, "ymtop", i, NULL);
-        position  = cpl_polynomial_eval(xpoly, point);
+        position_x  = cpl_polynomial_eval(xpoly, point);
 //        if (mos_multiplex >= 0) {
 //            if (mos_multiplex != ((int)floor(position)) / mos_region_size) {
 //                cpl_table_unselect_row(positions, i);
 //                continue;
 //            }
 //        }
-        cpl_table_set_double(positions, "xtop", i, position);
-        position  = cpl_polynomial_eval(ypoly, point);
-        cpl_table_set_double(positions, "ytop", i, position);
+        cpl_table_set_double(positions, "xtop", i, position_x);
+        position_y  = cpl_polynomial_eval(ypoly, point);
+        cpl_table_set_double(positions, "ytop", i, position_y);
         dpoint[0] = cpl_table_get_double(positions, "xmbottom", i, NULL);
         dpoint[1] = cpl_table_get_double(positions, "ymbottom", i, NULL);
-        position  = cpl_polynomial_eval(xpoly, point);
-        cpl_table_set_double(positions, "xbottom", i, position);
-        position  = cpl_polynomial_eval(ypoly, point);
-        cpl_table_set_double(positions, "ybottom", i, position);
+        position_x  = cpl_polynomial_eval(xpoly, point);
+        cpl_table_set_double(positions, "xbottom", i, position_x);
+        position_y  = cpl_polynomial_eval(ypoly, point);
+        cpl_table_set_double(positions, "ybottom", i, position_y);
     }
 
 //    if (mos_multiplex >= 0) {
@@ -8458,6 +8574,7 @@ cpl_image *mos_spatial_calibration(cpl_image *spectra, cpl_table *slits,
  * @param calibration Returned wavelength calibration image
  * @param residuals   Returned residuals image
  * @param restable    Returned residuals table
+ * @param detected_lines Returned info on lines detected and used for the fit
  * 
  * @return Input image resampled at constant wavelength step.
  *
@@ -8541,6 +8658,11 @@ cpl_image *mos_spatial_calibration(cpl_image *spectra, cpl_table *slits,
  * be pre-allocated for having it computed, and should as well have the 
  * same size of the input rectified @em image. If @c NULL pointers are 
  * passed, the @em calibration and @em residuals images are not computed.
+ * 
+ * If detected_lines table is an input, then a table with the position of
+ * the detected lines, its peak flux, wavelength identified and final xpos
+ * position in the wavelength calibrated image using the wavelength solution
+ *  is returned. The table has to be allocated but empty.
  */
 
 cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
@@ -8553,7 +8675,8 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                                             cpl_table *idscoeff,
                                             cpl_image *calibration,
                                             cpl_image *residuals,
-                                            cpl_table *restable)
+                                            cpl_table *restable,
+                                            cpl_table *detected_lines)
 {
 
     const char *func = "mos_wavelength_calibration_final";
@@ -8567,7 +8690,7 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
     char            name[MAX_COLNAME];
 
     cpl_image      *resampled;
-    cpl_bivector   *output;
+    cpl_bivector   *peaks_ident;
     cpl_vector     *wavel;
     cpl_vector     *peaks;
     cpl_polynomial *ids;
@@ -8690,6 +8813,20 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
         }
     }
 
+    if (detected_lines) {
+        cpl_table_set_size(detected_lines, 0);
+        cpl_table_new_column(detected_lines, "slit_id", CPL_TYPE_INT);
+        cpl_table_new_column(detected_lines, "xpos_rectified", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "ypos_rectified", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "xpos_rectified_iter", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "ypos_rectified_iter", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "peak_flux", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "wave_ident", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "wave_ident_iter", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "xpos_fit_rect_wavecal", CPL_TYPE_DOUBLE);
+        cpl_table_new_column(detected_lines, "res_xpos", CPL_TYPE_DOUBLE);
+    }
+
 
     /*
      * Process all slits separately.
@@ -8701,6 +8838,9 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
     row_top = ny;
     for (s = 0; s < nslits; s++) {
 
+        int slit_id;
+        slit_id = cpl_table_get_int(slits, "slit_id", s, NULL);
+        
         if (length[s] == 0)
             continue;
 
@@ -8742,13 +8882,31 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
             if (peaks) {
                 int keep_multiplex = mos_multiplex;
                 mos_multiplex = -1;
-                output = mos_identify_peaks(peaks, lines, 
+                if(detected_lines)
+                {
+                    cpl_size newlines = cpl_vector_get_size(peaks); 
+                    cpl_size oldsize = cpl_table_get_nrow(detected_lines); 
+                    cpl_table_set_size(detected_lines, oldsize + newlines);
+                    for(cpl_size iline = 0; iline < newlines; ++iline)
+                    {
+                        cpl_table_set_int(detected_lines, "slit_id",
+                             oldsize + iline, slit_id);
+                        cpl_table_set_double(detected_lines, "xpos_rectified",
+                             oldsize + iline, cpl_vector_get(peaks, iline) + 1);
+                        cpl_table_set_double(detected_lines, "ypos_rectified",
+                             oldsize + iline, (double)i + 1);
+                        cpl_table_set_double(detected_lines, "peak_flux",
+                             oldsize + iline, 
+                             sdata[i*nx+(int)(cpl_vector_get(peaks, iline)+0.5)]);
+                    }
+                }
+                peaks_ident = mos_identify_peaks(peaks, lines, 
                                             min_disp, max_disp, 0.05);
                 mos_multiplex = keep_multiplex;
-                if (output) {
-                    countLines = cpl_bivector_get_size(output);
+                if (peaks_ident) {
+                    countLines = cpl_bivector_get_size(peaks_ident);
                     if (countLines < 4) {
-                        cpl_bivector_delete(output);
+                        cpl_bivector_delete(peaks_ident);
                         cpl_vector_delete(peaks);
                         if (nlines)
                             nlines[i] = 0;
@@ -8761,19 +8919,19 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                      * Set reference wavelength as zero point
                      */
 
-                    wavel = cpl_bivector_get_y(output);
+                    wavel = cpl_bivector_get_y(peaks_ident);
                     cpl_vector_subtract_scalar(wavel, refwave);
 
                     uorder = countLines / 2 - 1;
                     if (uorder > order)
                         uorder = order;
 
-                    ids = mos_poly_wav2pix(output, uorder, reject,
+                    ids = mos_poly_wav2pix(peaks_ident, uorder, reject,
                                            2 * (uorder + 1), &usedLines,
                                            &ids_err);
 
                     if (ids == NULL) {
-                        cpl_bivector_delete(output);
+                        cpl_bivector_delete(peaks_ident);
                         cpl_vector_delete(peaks);
                         if (nlines)
                             nlines[i] = 0;
@@ -8798,10 +8956,10 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                /*   else {   */
                         if (calibration) {
                             pixstart = cpl_polynomial_eval_1d(ids,
-                              cpl_bivector_get_y_data(output)[0], 
+                              cpl_bivector_get_y_data(peaks_ident)[0], 
                               NULL);
                             pixend = cpl_polynomial_eval_1d(ids,
-                              cpl_bivector_get_y_data(output)[countLines-1],
+                              cpl_bivector_get_y_data(peaks_ident)[countLines-1],
                               NULL);
                             extrapolation = (pixend - pixstart) / 5;
                             pixstart -= extrapolation;
@@ -8829,8 +8987,8 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                                           cpl_polynomial_get_coeff(ids, &k));
                             }
                             for (j = 0; j < countLines; j++) {
-                                pixe = cpl_bivector_get_x_data(output)[j];
-                                wave = cpl_bivector_get_y_data(output)[j];
+                                pixe = cpl_bivector_get_x_data(peaks_ident)[j];
+                                wave = cpl_bivector_get_y_data(peaks_ident)[j];
                                 value = pixe 
                                       - cpl_polynomial_eval_1d(ids, wave, NULL);
                                 if (residuals) {
@@ -8874,6 +9032,44 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                                 NULL);
                             }
 ***/
+                            //Fill the line identification information in 
+                            //the detected_lines table
+                            if(detected_lines)
+                            {
+                                cpl_size nidentlines = cpl_bivector_get_size(peaks_ident); 
+                                cpl_size ndetectlines = cpl_vector_get_size(peaks); 
+                                cpl_size totalsize = cpl_table_get_nrow(detected_lines);
+                                for(cpl_size idline = 0; idline < nidentlines; ++idline)
+                                {
+                                    for(cpl_size detline = 0; detline < ndetectlines; ++detline)
+                                    {
+                                        if(cpl_vector_get(peaks, detline) == 
+                                           cpl_bivector_get_x_data(peaks_ident)[idline])
+                                        {
+                                            cpl_size table_pos = totalsize - ndetectlines + detline;
+                                            double wave_ident = cpl_bivector_get_y_data(peaks_ident)[idline] + refwave;
+                                            double xpix_fit = cpl_polynomial_eval_1d(ids,
+                                                    wave_ident - refwave, NULL);
+                                            double xpos_det = cpl_table_get_double(detected_lines,
+                                                    "xpos_rectified",
+                                                    table_pos, &null);
+                                            cpl_table_set_double(detected_lines,
+                                                                 "wave_ident",
+                                                                 table_pos,
+                                                                 wave_ident);
+                                            cpl_table_set_double(detected_lines,
+                                                                 "xpos_fit_rect_wavecal",
+                                                                 table_pos,
+                                                                 xpix_fit + 1);
+                                            cpl_table_set_double(detected_lines,
+                                                                 "res_xpos",
+                                                                 table_pos,
+                                                                  xpos_det - xpix_fit - 1);
+                                        }
+                                    }
+                                }
+                            }
+
                         }
                 /*  }   */
 
@@ -8899,7 +9095,7 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                     }
 
                     cpl_polynomial_delete(ids);
-                    cpl_bivector_delete(output);
+                    cpl_bivector_delete(peaks_ident);
                 }
                 cpl_vector_delete(peaks);
             }
@@ -8958,18 +9154,18 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                         }
                     }
 
-                    output = mos_find_peaks(sdata + i*nx, nx, lines, 
+                    peaks_ident = mos_find_peaks(sdata + i*nx, nx, lines, 
                                             fguess, refwave, uradius);
 
-                    if (output == NULL) {
+                    if (peaks_ident == NULL) {
                         cpl_error_reset();
                         continue;
                     }
 
-                    countLines = cpl_bivector_get_size(output);
+                    countLines = cpl_bivector_get_size(peaks_ident);
 
                     if (countLines < 4) {
-                        cpl_bivector_delete(output);
+                        cpl_bivector_delete(peaks_ident);
                         continue;
                     }
 
@@ -8977,20 +9173,20 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                      * Set reference wavelength as zero point
                      */
 
-                    wavel = cpl_bivector_get_y(output);
+                    wavel = cpl_bivector_get_y(peaks_ident);
                     cpl_vector_subtract_scalar(wavel, refwave);
 
                     uorder = countLines / 2 - 1;
                     if (uorder > order)
                         uorder = order;
 
-                    ids = mos_poly_wav2pix(output, uorder, reject,
+                    ids = mos_poly_wav2pix(peaks_ident, uorder, reject,
                                            2 * (uorder + 1), &usedLines,
                                            &ids_err);
 
                     if (ids == NULL) {
                         cpl_error_reset();
-                        cpl_bivector_delete(output);
+                        cpl_bivector_delete(peaks_ident);
                         continue;
                     }
 
@@ -9001,10 +9197,10 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
 
                     if (calibration) {
                         pixstart = cpl_polynomial_eval_1d(ids,
-                           cpl_bivector_get_y_data(output)[0], 
+                           cpl_bivector_get_y_data(peaks_ident)[0], 
                            NULL);
                         pixend = cpl_polynomial_eval_1d(ids,
-                           cpl_bivector_get_y_data(output)[countLines-1], 
+                           cpl_bivector_get_y_data(peaks_ident)[countLines-1], 
                            NULL);
                         extrapolation = (pixend - pixstart) / 5;
                         pixstart -= extrapolation;
@@ -9032,8 +9228,8 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                                       cpl_polynomial_get_coeff(ids, &k));
                         }
                         for (j = 0; j < countLines; j++) {
-                            pixe = cpl_bivector_get_x_data(output)[j];
-                            wave = cpl_bivector_get_y_data(output)[j];
+                            pixe = cpl_bivector_get_x_data(peaks_ident)[j];
+                            wave = cpl_bivector_get_y_data(peaks_ident)[j];
                             value = pixe
                                   - cpl_polynomial_eval_1d(ids, wave, NULL);
                             if (residuals) {
@@ -9078,6 +9274,33 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                         }
 ***/
                     }
+                    
+                    if(detected_lines)
+                    {
+                        cpl_size oldsize = cpl_table_get_nrow(detected_lines); 
+                        cpl_size nidentlines = cpl_bivector_get_size(peaks_ident); 
+                        cpl_table_set_size(detected_lines, oldsize + nidentlines);
+                        for(cpl_size idline = 0; idline < nidentlines ; ++idline)
+                        {
+                            double wave_ident = cpl_bivector_get_y_data(peaks_ident)[idline] + refwave;
+                            double xpix_fit = cpl_polynomial_eval_1d(ids,
+                                    wave_ident - refwave, NULL);
+                            cpl_table_set_int(detected_lines, "slit_id",
+                                 oldsize + idline, slit_id);
+                            cpl_table_set_double(detected_lines, "xpos_rectified_iter",
+                                 oldsize + idline, cpl_bivector_get_x_data(peaks_ident)[idline] + 1);
+                            cpl_table_set_double(detected_lines, "ypos_rectified_iter",
+                                 oldsize + idline, (double)i + 1);
+                            cpl_table_set_double(detected_lines, "peak_flux",
+                                 oldsize + idline, 
+                                 sdata[i*nx+(int)(cpl_bivector_get_x_data(peaks_ident)[idline]+0.5)]);
+                            cpl_table_set_double(detected_lines, "wave_ident_iter",
+                                 oldsize + idline, wave_ident);
+                            cpl_table_set_double(detected_lines, "xpos_fit_rect_wavecal",
+                                 oldsize + idline, xpix_fit + 1);
+                        }
+                    }
+
 
                     for (k = 0; k <= order; k++) {
                         if (k > uorder) {
@@ -9089,7 +9312,7 @@ cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
                         }
                     }
 
-                    cpl_bivector_delete(output);
+                    cpl_bivector_delete(peaks_ident);
                     cpl_polynomial_delete(ids);
 
                 } /* End of loop "use ids as a first-guess" */
@@ -13792,7 +14015,7 @@ cpl_image **mos_extract_objects(cpl_image *science, cpl_image *sky,
     int         nslits;
     int         nobjects;
     int         maxobjects;
-    int         nx, ny;
+    int         nx;
     int         ylow, yhig;
     int         i, j;
 
@@ -13868,7 +14091,6 @@ cpl_image **mos_extract_objects(cpl_image *science, cpl_image *sky,
         return NULL;
 
     nx = cpl_image_get_size_x(science);
-    ny = cpl_image_get_size_x(science);
 
     output = cpl_calloc(3, sizeof(cpl_image *));
     extracted = output[0] = cpl_image_new(nx, nobjects, CPL_TYPE_FLOAT);
@@ -15705,7 +15927,7 @@ cpl_error_code mos_refmask_find_gaps(cpl_mask  *refmask,
     int        * xpos   = cpl_calloc(sizeof(int), ny);
 
     cpl_image  * filtered = cpl_image_duplicate(master_flat);
-    cpl_mask   * kernel = cpl_mask_new(9, 9);
+    cpl_mask   * kernel = cpl_mask_new(9, 3);
     cpl_vector * v      = cpl_vector_new(ny);
     cpl_vector * truev;
     int          nvalid = 0;
@@ -15715,7 +15937,6 @@ cpl_error_code mos_refmask_find_gaps(cpl_mask  *refmask,
 
     int          i, kill;
 
-
     cpl_mask_not(kernel);
     cpl_image_filter_mask(filtered, master_flat, kernel, 
                           CPL_FILTER_MEDIAN, CPL_BORDER_COPY);
@@ -15999,15 +16220,17 @@ cpl_error_code mos_object_intersect(cpl_table **slitss, cpl_table *origslits,
     for (k = 0; k < nslits; k+=2) {
         int slitmatches = 0;
 
-        if (k == 0) {
-            if (cpl_table_get_int(slitss[0], "pair_id",  0, NULL) !=
-                cpl_table_get_int(slitss[0], "pair_id",  1, NULL)) {
+        if (k + 1 < nslits ) {
+            if (cpl_table_get_int(slitss[0], "pair_id",  k, NULL) !=
+                cpl_table_get_int(slitss[0], "pair_id",  k + 1, NULL)) {
 
                 /*
                  * This is not an ordinary beam - advance to next slit.
                  */
 
-                k++;
+                /* It will be incremented by two, so the effect is like k++ */
+                k--;
+
                 continue;
             }
         }
@@ -16359,9 +16582,7 @@ cpl_error_code mos_object_intersect(cpl_table **slitss, cpl_table *origslits,
     for (k = 0; k < nslits; k++) {
         for (j = 0; j < maxobjs; j++) {
             double object_w, object_r;
-            int    start_w, start_r;
-            int    end_w, end_r;
-            int    row_w, row_r;
+            int    row_w;
 
             char  *object_i = cpl_sprintf("object_%d", j + 1);
             char  *start_i  = cpl_sprintf("start_%d",  j + 1);
@@ -16383,8 +16604,6 @@ cpl_error_code mos_object_intersect(cpl_table **slitss, cpl_table *origslits,
              */
 
             object_w = cpl_table_get_double(origslits, object_i, k, NULL);
-            start_w  = cpl_table_get_int   (origslits, start_i,  k, NULL);
-            end_w    = cpl_table_get_int   (origslits, end_i,    k, NULL);
             row_w    = cpl_table_get_int   (origslits, row_i,    k, NULL);
 
             for (i = 0; i < nscience; i++) {
@@ -16406,9 +16625,7 @@ cpl_error_code mos_object_intersect(cpl_table **slitss, cpl_table *origslits,
                         break;
 
                     object_r = cpl_table_get_double(work[i], object_o, k, NULL);
-                    start_r  = cpl_table_get_int   (work[i], start_o,  k, NULL);
-                    end_r    = cpl_table_get_int   (work[i], end_o,    k, NULL);
-                    row_r    = cpl_table_get_int   (work[i], row_o,    k, NULL);
+                    //row_r    = cpl_table_get_int   (work[i], row_o,    k, NULL);
 
                     diff = fabs(object_w - object_r);
                     if (m) {
@@ -18172,7 +18389,7 @@ int mos_compute_offset(cpl_table *reference, cpl_table *objects, double *offset)
     int       *nref;
     int       *nobj;
     int        corr, maxcorr;
-    int        shift, best_shift;
+    int        best_shift;
     int        i, j, k;
 
     cpl_error_code status = CPL_ERROR_NONE;
diff --git a/fors/moses.h b/fors/moses.h
index 0c9fb70..19e256c 100644
--- a/fors/moses.h
+++ b/fors/moses.h
@@ -1,4 +1,4 @@
-/* $Id: moses.h,v 1.39 2013/02/28 15:10:43 cgarcia Exp $
+/* $Id: moses.h,v 1.41 2013-09-09 12:19:20 cgarcia Exp $
  *
  * This file is part of the VIMOS Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/02/28 15:10:43 $
- * $Revision: 1.39 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-09 12:19:20 $
+ * $Revision: 1.41 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef MOSES_H
@@ -54,11 +54,19 @@ cpl_polynomial *mos_poly_wav2pix(cpl_bivector *, int, double, int,
                                  int *, double *);
 cpl_polynomial *mos_poly_pix2wav(cpl_bivector *, int, double, int,
                                  int *, double *);
-cpl_image *mos_wavelength_calibration_raw(const cpl_image *, cpl_vector *,
-                                          double, float, int, int, double, 
-                                          double, double *, double *, int *, 
-                                          double *, cpl_table *, cpl_image *, 
-                                          cpl_image *, cpl_table *, cpl_mask *);
+cpl_image *mos_wavelength_calibration_raw(const cpl_image *image,
+                                          cpl_vector *lines,
+                                          double dispersion, float level,
+                                          int sradius, int order,
+                                          double reject, double refwave, 
+                                          double *wavestart, double *waveend,
+                                          int *nlines, double *error, 
+                                          cpl_table *idscoeff,
+                                          cpl_image *calibration,
+                                          cpl_image *residuals, 
+                                          cpl_table *restable,
+                                          cpl_mask *refmask,
+                                          cpl_table *detected_lines);
 cpl_error_code mos_interpolate_wavecalib_slit(cpl_table *, cpl_table *, 
                                               int, int);
 cpl_error_code mos_interpolate_wavecalib(cpl_table *, cpl_image *, int, int);
@@ -74,12 +82,18 @@ cpl_error_code mos_global_trace(cpl_table *, cpl_table *, int);
 cpl_image *mos_spatial_calibration(cpl_image *, cpl_table *, cpl_table *, 
                                    double, double, double, double, int,
                                    cpl_image *);
-cpl_image *mos_wavelength_calibration_final(cpl_image *, cpl_table *,
-                                            cpl_vector *, double, float, int, 
-                                            int, double, double, double *, 
-                                            double *, int *, double *, 
-                                            cpl_table *, cpl_image *, 
-                                            cpl_image *, cpl_table *);
+cpl_image *mos_wavelength_calibration_final(cpl_image *image, cpl_table *slits,
+                                            cpl_vector *lines,
+                                            double dispersion, float level,
+                                            int sradius, int order,
+                                            double reject, double refwave,
+                                            double *wavestart, double *waveend,
+                                            int *nlines, double *error, 
+                                            cpl_table *idscoeff,
+                                            cpl_image *calibration,
+                                            cpl_image *residuals,
+                                            cpl_table *restable,
+                                            cpl_table *detected_lines);
 cpl_table *mos_global_distortion(cpl_table *, cpl_table *,
                                  cpl_table *, cpl_table *, double);
 cpl_table *mos_build_slit_location(cpl_table *, cpl_table *, int);
diff --git a/fors/tests/Makefile.am b/fors/tests/Makefile.am
index 3d2dbb9..ce0f938 100644
--- a/fors/tests/Makefile.am
+++ b/fors/tests/Makefile.am
@@ -143,8 +143,6 @@ fors_img_science_test_SOURCES = fors_img_science-test.c
 fors_img_science_test_LDFLAGS = $(CPL_LDFLAGS)
 fors_img_science_test_LDADD = $(LIBTEST) $(LIBCPLCORE) $(LIBCPLUI) $(LIBFORS) $(LIBSIMULATE)
 
-check_SCRIPTS = my_custom_test_script
-EXTRA_DIST = $(check_SCRIPTS)
 
 #TESTS          = $(check_PROGRAMS) $(check_SCRIPTS)
 TESTS          = $(check_PROGRAMS)
diff --git a/fors/tests/Makefile.in b/fors/tests/Makefile.in
index e88c71c..c442eed 100644
--- a/fors/tests/Makefile.in
+++ b/fors/tests/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,15 +15,29 @@
 @SET_MAKE@
 
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -50,16 +64,24 @@ check_PROGRAMS = fors-test$(EXEEXT) list-test$(EXEEXT) \
 	fors_photometry-test$(EXEEXT) fors_img_science-test$(EXEEXT)
 subdir = fors/tests
 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/admin/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
-	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/purify.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 am_libsimulate_la_OBJECTS = test_simulate.lo
 libsimulate_la_OBJECTS = $(am_libsimulate_la_OBJECTS)
@@ -67,113 +89,155 @@ am_libtest_la_OBJECTS = test.lo
 libtest_la_OBJECTS = $(am_libtest_la_OBJECTS)
 am_fors_test_OBJECTS = fors-test.$(OBJEXT)
 fors_test_OBJECTS = $(am_fors_test_OBJECTS)
-am__DEPENDENCIES_1 = libtest.la
-am__DEPENDENCIES_2 =
-fors_test_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2)
+am__DEPENDENCIES_1 =
+fors_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+fors_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_bias_test_OBJECTS = fors_bias-test.$(OBJEXT)
 fors_bias_test_OBJECTS = $(am_fors_bias_test_OBJECTS)
-am__DEPENDENCIES_3 = libsimulate.la
-fors_bias_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_bias_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_bias_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_bias_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_cpl_wcs_test_OBJECTS = fors_cpl_wcs-test.$(OBJEXT)
 fors_cpl_wcs_test_OBJECTS = $(am_fors_cpl_wcs_test_OBJECTS)
-fors_cpl_wcs_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2)
+fors_cpl_wcs_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+fors_cpl_wcs_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_cpl_wcs_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_dark_test_OBJECTS = fors_dark-test.$(OBJEXT)
 fors_dark_test_OBJECTS = $(am_fors_dark_test_OBJECTS)
-fors_dark_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_dark_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_dark_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_dark_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_identify_test_OBJECTS = fors_identify-test.$(OBJEXT)
 fors_identify_test_OBJECTS = $(am_fors_identify_test_OBJECTS)
-fors_identify_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_identify_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_identify_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_identify_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_image_test_OBJECTS = fors_image-test.$(OBJEXT)
 fors_image_test_OBJECTS = $(am_fors_image_test_OBJECTS)
-fors_image_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_image_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_image_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_image_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_img_science_test_OBJECTS = fors_img_science-test.$(OBJEXT)
 fors_img_science_test_OBJECTS = $(am_fors_img_science_test_OBJECTS)
-fors_img_science_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_img_science_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_img_science_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_img_science_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_img_screen_flat_test_OBJECTS =  \
 	fors_img_screen_flat-test.$(OBJEXT)
 fors_img_screen_flat_test_OBJECTS =  \
 	$(am_fors_img_screen_flat_test_OBJECTS)
-fors_img_screen_flat_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_img_screen_flat_test_DEPENDENCIES = $(LIBTEST) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_img_screen_flat_test_LINK = $(LIBTOOL) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(fors_img_screen_flat_test_LDFLAGS) \
+	$(LDFLAGS) -o $@
 am_fors_img_sky_flat_test_OBJECTS = fors_img_sky_flat-test.$(OBJEXT)
 fors_img_sky_flat_test_OBJECTS = $(am_fors_img_sky_flat_test_OBJECTS)
-fors_img_sky_flat_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_img_sky_flat_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_img_sky_flat_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_img_sky_flat_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_pattern_test_OBJECTS = fors_pattern-test.$(OBJEXT)
 fors_pattern_test_OBJECTS = $(am_fors_pattern_test_OBJECTS)
-fors_pattern_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2)
+fors_pattern_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+fors_pattern_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_pattern_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_photometry_test_OBJECTS = fors_photometry-test.$(OBJEXT)
 fors_photometry_test_OBJECTS = $(am_fors_photometry_test_OBJECTS)
-fors_photometry_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_photometry_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_photometry_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_photometry_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_point_test_OBJECTS = fors_point-test.$(OBJEXT)
 fors_point_test_OBJECTS = $(am_fors_point_test_OBJECTS)
-fors_point_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2)
+fors_point_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+fors_point_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_point_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_qc_test_OBJECTS = fors_qc-test.$(OBJEXT)
 fors_qc_test_OBJECTS = $(am_fors_qc_test_OBJECTS)
-fors_qc_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2)
+fors_qc_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+fors_qc_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_qc_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_setting_test_OBJECTS = fors_setting-test.$(OBJEXT)
 fors_setting_test_OBJECTS = $(am_fors_setting_test_OBJECTS)
-fors_setting_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_setting_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_setting_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_setting_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_stack_test_OBJECTS = fors_stack-test.$(OBJEXT)
 fors_stack_test_OBJECTS = $(am_fors_stack_test_OBJECTS)
-fors_stack_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_stack_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_stack_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_stack_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_star_test_OBJECTS = fors_star-test.$(OBJEXT)
 fors_star_test_OBJECTS = $(am_fors_star_test_OBJECTS)
-fors_star_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_star_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_star_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_star_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_std_star_test_OBJECTS = fors_std_star-test.$(OBJEXT)
 fors_std_star_test_OBJECTS = $(am_fors_std_star_test_OBJECTS)
-fors_std_star_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_std_star_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_std_star_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_std_star_test_LDFLAGS) $(LDFLAGS) -o $@
 am_fors_zeropoint_test_OBJECTS = fors_zeropoint-test.$(OBJEXT)
 fors_zeropoint_test_OBJECTS = $(am_fors_zeropoint_test_OBJECTS)
-fors_zeropoint_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+fors_zeropoint_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(LIBSIMULATE)
+fors_zeropoint_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_zeropoint_test_LDFLAGS) $(LDFLAGS) -o $@
 am_list_test_OBJECTS = list-test.$(OBJEXT)
 list_test_OBJECTS = $(am_list_test_OBJECTS)
-list_test_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+list_test_DEPENDENCIES = $(LIBTEST) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+list_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(list_test_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 SOURCES = $(libsimulate_la_SOURCES) $(libtest_la_SOURCES) \
 	$(fors_test_SOURCES) $(fors_bias_test_SOURCES) \
 	$(fors_cpl_wcs_test_SOURCES) $(fors_dark_test_SOURCES) \
@@ -198,21 +262,48 @@ DIST_SOURCES = $(libsimulate_la_SOURCES) $(libtest_la_SOURCES) \
 	$(fors_stack_test_SOURCES) $(fors_star_test_SOURCES) \
 	$(fors_std_star_test_SOURCES) $(fors_zeropoint_test_SOURCES) \
 	$(list_test_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkgincludedir)"
-pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
 HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS)
 ETAGS = etags
 CTAGS = ctags
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = $(am__tty_colors_dummy)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
@@ -237,16 +328,17 @@ CX_LDFLAGS = @CX_LDFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOXYGEN = @DOXYGEN@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 FORS_BINARY_AGE = @FORS_BINARY_AGE@
 FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
 FORS_INCLUDES = @FORS_INCLUDES@
@@ -256,12 +348,17 @@ FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
 FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
 FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
 FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
 LATEX = @LATEX@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBCEXT = @LIBCEXT@
 LIBCFITSIO = @LIBCFITSIO@
@@ -277,48 +374,52 @@ LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 LT_AGE = @LT_AGE@
 LT_CURRENT = @LT_CURRENT@
 LT_REVISION = @LT_REVISION@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
 MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
-ONLINE_MODE_FALSE = @ONLINE_MODE_FALSE@
-ONLINE_MODE_TRUE = @ONLINE_MODE_TRUE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PURIFY_CMD = @PURIFY_CMD@
-PURIFY_FALSE = @PURIFY_FALSE@
-PURIFY_TRUE = @PURIFY_TRUE@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 all_includes = @all_includes@
 all_ldflags = @all_ldflags@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -330,8 +431,12 @@ build_alias = @build_alias@
 build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
+builddir = @builddir@
 configdir = @configdir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -344,17 +449,21 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 pipedocsdir = @pipedocsdir@
 plugindir = @plugindir@
 prefix = @prefix@
 privatelibdir = @privatelibdir@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target = @target@
@@ -362,6 +471,9 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 wkfcopydir = @wkfcopydir@
 wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.8 foreign
@@ -438,8 +550,6 @@ fors_photometry_test_LDADD = $(LIBTEST) $(LIBCPLCORE) $(LIBCPLUI) $(LIBFORS) $(L
 fors_img_science_test_SOURCES = fors_img_science-test.c
 fors_img_science_test_LDFLAGS = $(CPL_LDFLAGS)
 fors_img_science_test_LDADD = $(LIBTEST) $(LIBCPLCORE) $(LIBCPLUI) $(LIBFORS) $(LIBSIMULATE)
-check_SCRIPTS = my_custom_test_script
-EXTRA_DIST = $(check_SCRIPTS)
 
 #TESTS          = $(check_PROGRAMS) $(check_SCRIPTS)
 TESTS = $(check_PROGRAMS)
@@ -463,14 +573,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  fors/tests/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  fors/tests/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fors/tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign fors/tests/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -488,83 +598,88 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 clean-noinstLTLIBRARIES:
 	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libsimulate.la: $(libsimulate_la_OBJECTS) $(libsimulate_la_DEPENDENCIES) 
-	$(LINK)  $(libsimulate_la_LDFLAGS) $(libsimulate_la_OBJECTS) $(libsimulate_la_LIBADD) $(LIBS)
-libtest.la: $(libtest_la_OBJECTS) $(libtest_la_DEPENDENCIES) 
-	$(LINK)  $(libtest_la_LDFLAGS) $(libtest_la_OBJECTS) $(libtest_la_LIBADD) $(LIBS)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libsimulate.la: $(libsimulate_la_OBJECTS) $(libsimulate_la_DEPENDENCIES) $(EXTRA_libsimulate_la_DEPENDENCIES) 
+	$(LINK)  $(libsimulate_la_OBJECTS) $(libsimulate_la_LIBADD) $(LIBS)
+libtest.la: $(libtest_la_OBJECTS) $(libtest_la_DEPENDENCIES) $(EXTRA_libtest_la_DEPENDENCIES) 
+	$(LINK)  $(libtest_la_OBJECTS) $(libtest_la_LIBADD) $(LIBS)
 
 clean-checkPROGRAMS:
-	@list='$(check_PROGRAMS)'; for p in $$list; do \
-	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  echo " rm -f $$p $$f"; \
-	  rm -f $$p $$f ; \
-	done
-fors-test$(EXEEXT): $(fors_test_OBJECTS) $(fors_test_DEPENDENCIES) 
+	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+fors-test$(EXEEXT): $(fors_test_OBJECTS) $(fors_test_DEPENDENCIES) $(EXTRA_fors_test_DEPENDENCIES) 
 	@rm -f fors-test$(EXEEXT)
-	$(LINK) $(fors_test_LDFLAGS) $(fors_test_OBJECTS) $(fors_test_LDADD) $(LIBS)
-fors_bias-test$(EXEEXT): $(fors_bias_test_OBJECTS) $(fors_bias_test_DEPENDENCIES) 
+	$(fors_test_LINK) $(fors_test_OBJECTS) $(fors_test_LDADD) $(LIBS)
+fors_bias-test$(EXEEXT): $(fors_bias_test_OBJECTS) $(fors_bias_test_DEPENDENCIES) $(EXTRA_fors_bias_test_DEPENDENCIES) 
 	@rm -f fors_bias-test$(EXEEXT)
-	$(LINK) $(fors_bias_test_LDFLAGS) $(fors_bias_test_OBJECTS) $(fors_bias_test_LDADD) $(LIBS)
-fors_cpl_wcs-test$(EXEEXT): $(fors_cpl_wcs_test_OBJECTS) $(fors_cpl_wcs_test_DEPENDENCIES) 
+	$(fors_bias_test_LINK) $(fors_bias_test_OBJECTS) $(fors_bias_test_LDADD) $(LIBS)
+fors_cpl_wcs-test$(EXEEXT): $(fors_cpl_wcs_test_OBJECTS) $(fors_cpl_wcs_test_DEPENDENCIES) $(EXTRA_fors_cpl_wcs_test_DEPENDENCIES) 
 	@rm -f fors_cpl_wcs-test$(EXEEXT)
-	$(LINK) $(fors_cpl_wcs_test_LDFLAGS) $(fors_cpl_wcs_test_OBJECTS) $(fors_cpl_wcs_test_LDADD) $(LIBS)
-fors_dark-test$(EXEEXT): $(fors_dark_test_OBJECTS) $(fors_dark_test_DEPENDENCIES) 
+	$(fors_cpl_wcs_test_LINK) $(fors_cpl_wcs_test_OBJECTS) $(fors_cpl_wcs_test_LDADD) $(LIBS)
+fors_dark-test$(EXEEXT): $(fors_dark_test_OBJECTS) $(fors_dark_test_DEPENDENCIES) $(EXTRA_fors_dark_test_DEPENDENCIES) 
 	@rm -f fors_dark-test$(EXEEXT)
-	$(LINK) $(fors_dark_test_LDFLAGS) $(fors_dark_test_OBJECTS) $(fors_dark_test_LDADD) $(LIBS)
-fors_identify-test$(EXEEXT): $(fors_identify_test_OBJECTS) $(fors_identify_test_DEPENDENCIES) 
+	$(fors_dark_test_LINK) $(fors_dark_test_OBJECTS) $(fors_dark_test_LDADD) $(LIBS)
+fors_identify-test$(EXEEXT): $(fors_identify_test_OBJECTS) $(fors_identify_test_DEPENDENCIES) $(EXTRA_fors_identify_test_DEPENDENCIES) 
 	@rm -f fors_identify-test$(EXEEXT)
-	$(LINK) $(fors_identify_test_LDFLAGS) $(fors_identify_test_OBJECTS) $(fors_identify_test_LDADD) $(LIBS)
-fors_image-test$(EXEEXT): $(fors_image_test_OBJECTS) $(fors_image_test_DEPENDENCIES) 
+	$(fors_identify_test_LINK) $(fors_identify_test_OBJECTS) $(fors_identify_test_LDADD) $(LIBS)
+fors_image-test$(EXEEXT): $(fors_image_test_OBJECTS) $(fors_image_test_DEPENDENCIES) $(EXTRA_fors_image_test_DEPENDENCIES) 
 	@rm -f fors_image-test$(EXEEXT)
-	$(LINK) $(fors_image_test_LDFLAGS) $(fors_image_test_OBJECTS) $(fors_image_test_LDADD) $(LIBS)
-fors_img_science-test$(EXEEXT): $(fors_img_science_test_OBJECTS) $(fors_img_science_test_DEPENDENCIES) 
+	$(fors_image_test_LINK) $(fors_image_test_OBJECTS) $(fors_image_test_LDADD) $(LIBS)
+fors_img_science-test$(EXEEXT): $(fors_img_science_test_OBJECTS) $(fors_img_science_test_DEPENDENCIES) $(EXTRA_fors_img_science_test_DEPENDENCIES) 
 	@rm -f fors_img_science-test$(EXEEXT)
-	$(LINK) $(fors_img_science_test_LDFLAGS) $(fors_img_science_test_OBJECTS) $(fors_img_science_test_LDADD) $(LIBS)
-fors_img_screen_flat-test$(EXEEXT): $(fors_img_screen_flat_test_OBJECTS) $(fors_img_screen_flat_test_DEPENDENCIES) 
+	$(fors_img_science_test_LINK) $(fors_img_science_test_OBJECTS) $(fors_img_science_test_LDADD) $(LIBS)
+fors_img_screen_flat-test$(EXEEXT): $(fors_img_screen_flat_test_OBJECTS) $(fors_img_screen_flat_test_DEPENDENCIES) $(EXTRA_fors_img_screen_flat_test_DEPENDENCIES) 
 	@rm -f fors_img_screen_flat-test$(EXEEXT)
-	$(LINK) $(fors_img_screen_flat_test_LDFLAGS) $(fors_img_screen_flat_test_OBJECTS) $(fors_img_screen_flat_test_LDADD) $(LIBS)
-fors_img_sky_flat-test$(EXEEXT): $(fors_img_sky_flat_test_OBJECTS) $(fors_img_sky_flat_test_DEPENDENCIES) 
+	$(fors_img_screen_flat_test_LINK) $(fors_img_screen_flat_test_OBJECTS) $(fors_img_screen_flat_test_LDADD) $(LIBS)
+fors_img_sky_flat-test$(EXEEXT): $(fors_img_sky_flat_test_OBJECTS) $(fors_img_sky_flat_test_DEPENDENCIES) $(EXTRA_fors_img_sky_flat_test_DEPENDENCIES) 
 	@rm -f fors_img_sky_flat-test$(EXEEXT)
-	$(LINK) $(fors_img_sky_flat_test_LDFLAGS) $(fors_img_sky_flat_test_OBJECTS) $(fors_img_sky_flat_test_LDADD) $(LIBS)
-fors_pattern-test$(EXEEXT): $(fors_pattern_test_OBJECTS) $(fors_pattern_test_DEPENDENCIES) 
+	$(fors_img_sky_flat_test_LINK) $(fors_img_sky_flat_test_OBJECTS) $(fors_img_sky_flat_test_LDADD) $(LIBS)
+fors_pattern-test$(EXEEXT): $(fors_pattern_test_OBJECTS) $(fors_pattern_test_DEPENDENCIES) $(EXTRA_fors_pattern_test_DEPENDENCIES) 
 	@rm -f fors_pattern-test$(EXEEXT)
-	$(LINK) $(fors_pattern_test_LDFLAGS) $(fors_pattern_test_OBJECTS) $(fors_pattern_test_LDADD) $(LIBS)
-fors_photometry-test$(EXEEXT): $(fors_photometry_test_OBJECTS) $(fors_photometry_test_DEPENDENCIES) 
+	$(fors_pattern_test_LINK) $(fors_pattern_test_OBJECTS) $(fors_pattern_test_LDADD) $(LIBS)
+fors_photometry-test$(EXEEXT): $(fors_photometry_test_OBJECTS) $(fors_photometry_test_DEPENDENCIES) $(EXTRA_fors_photometry_test_DEPENDENCIES) 
 	@rm -f fors_photometry-test$(EXEEXT)
-	$(LINK) $(fors_photometry_test_LDFLAGS) $(fors_photometry_test_OBJECTS) $(fors_photometry_test_LDADD) $(LIBS)
-fors_point-test$(EXEEXT): $(fors_point_test_OBJECTS) $(fors_point_test_DEPENDENCIES) 
+	$(fors_photometry_test_LINK) $(fors_photometry_test_OBJECTS) $(fors_photometry_test_LDADD) $(LIBS)
+fors_point-test$(EXEEXT): $(fors_point_test_OBJECTS) $(fors_point_test_DEPENDENCIES) $(EXTRA_fors_point_test_DEPENDENCIES) 
 	@rm -f fors_point-test$(EXEEXT)
-	$(LINK) $(fors_point_test_LDFLAGS) $(fors_point_test_OBJECTS) $(fors_point_test_LDADD) $(LIBS)
-fors_qc-test$(EXEEXT): $(fors_qc_test_OBJECTS) $(fors_qc_test_DEPENDENCIES) 
+	$(fors_point_test_LINK) $(fors_point_test_OBJECTS) $(fors_point_test_LDADD) $(LIBS)
+fors_qc-test$(EXEEXT): $(fors_qc_test_OBJECTS) $(fors_qc_test_DEPENDENCIES) $(EXTRA_fors_qc_test_DEPENDENCIES) 
 	@rm -f fors_qc-test$(EXEEXT)
-	$(LINK) $(fors_qc_test_LDFLAGS) $(fors_qc_test_OBJECTS) $(fors_qc_test_LDADD) $(LIBS)
-fors_setting-test$(EXEEXT): $(fors_setting_test_OBJECTS) $(fors_setting_test_DEPENDENCIES) 
+	$(fors_qc_test_LINK) $(fors_qc_test_OBJECTS) $(fors_qc_test_LDADD) $(LIBS)
+fors_setting-test$(EXEEXT): $(fors_setting_test_OBJECTS) $(fors_setting_test_DEPENDENCIES) $(EXTRA_fors_setting_test_DEPENDENCIES) 
 	@rm -f fors_setting-test$(EXEEXT)
-	$(LINK) $(fors_setting_test_LDFLAGS) $(fors_setting_test_OBJECTS) $(fors_setting_test_LDADD) $(LIBS)
-fors_stack-test$(EXEEXT): $(fors_stack_test_OBJECTS) $(fors_stack_test_DEPENDENCIES) 
+	$(fors_setting_test_LINK) $(fors_setting_test_OBJECTS) $(fors_setting_test_LDADD) $(LIBS)
+fors_stack-test$(EXEEXT): $(fors_stack_test_OBJECTS) $(fors_stack_test_DEPENDENCIES) $(EXTRA_fors_stack_test_DEPENDENCIES) 
 	@rm -f fors_stack-test$(EXEEXT)
-	$(LINK) $(fors_stack_test_LDFLAGS) $(fors_stack_test_OBJECTS) $(fors_stack_test_LDADD) $(LIBS)
-fors_star-test$(EXEEXT): $(fors_star_test_OBJECTS) $(fors_star_test_DEPENDENCIES) 
+	$(fors_stack_test_LINK) $(fors_stack_test_OBJECTS) $(fors_stack_test_LDADD) $(LIBS)
+fors_star-test$(EXEEXT): $(fors_star_test_OBJECTS) $(fors_star_test_DEPENDENCIES) $(EXTRA_fors_star_test_DEPENDENCIES) 
 	@rm -f fors_star-test$(EXEEXT)
-	$(LINK) $(fors_star_test_LDFLAGS) $(fors_star_test_OBJECTS) $(fors_star_test_LDADD) $(LIBS)
-fors_std_star-test$(EXEEXT): $(fors_std_star_test_OBJECTS) $(fors_std_star_test_DEPENDENCIES) 
+	$(fors_star_test_LINK) $(fors_star_test_OBJECTS) $(fors_star_test_LDADD) $(LIBS)
+fors_std_star-test$(EXEEXT): $(fors_std_star_test_OBJECTS) $(fors_std_star_test_DEPENDENCIES) $(EXTRA_fors_std_star_test_DEPENDENCIES) 
 	@rm -f fors_std_star-test$(EXEEXT)
-	$(LINK) $(fors_std_star_test_LDFLAGS) $(fors_std_star_test_OBJECTS) $(fors_std_star_test_LDADD) $(LIBS)
-fors_zeropoint-test$(EXEEXT): $(fors_zeropoint_test_OBJECTS) $(fors_zeropoint_test_DEPENDENCIES) 
+	$(fors_std_star_test_LINK) $(fors_std_star_test_OBJECTS) $(fors_std_star_test_LDADD) $(LIBS)
+fors_zeropoint-test$(EXEEXT): $(fors_zeropoint_test_OBJECTS) $(fors_zeropoint_test_DEPENDENCIES) $(EXTRA_fors_zeropoint_test_DEPENDENCIES) 
 	@rm -f fors_zeropoint-test$(EXEEXT)
-	$(LINK) $(fors_zeropoint_test_LDFLAGS) $(fors_zeropoint_test_OBJECTS) $(fors_zeropoint_test_LDADD) $(LIBS)
-list-test$(EXEEXT): $(list_test_OBJECTS) $(list_test_DEPENDENCIES) 
+	$(fors_zeropoint_test_LINK) $(fors_zeropoint_test_OBJECTS) $(fors_zeropoint_test_LDADD) $(LIBS)
+list-test$(EXEEXT): $(list_test_OBJECTS) $(list_test_DEPENDENCIES) $(EXTRA_list_test_DEPENDENCIES) 
 	@rm -f list-test$(EXEEXT)
-	$(LINK) $(list_test_LDFLAGS) $(list_test_OBJECTS) $(list_test_LDADD) $(LIBS)
+	$(list_test_LINK) $(list_test_OBJECTS) $(list_test_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -595,22 +710,22 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_simulate.Plo at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
@@ -620,72 +735,90 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-
-distclean-libtool:
-	-rm -f libtool
-uninstall-info-am:
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
-	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
-	  $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
 	done
 
 uninstall-pkgincludeHEADERS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
-	done
+	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -693,58 +826,73 @@ distclean-tags:
 check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
-	list='$(TESTS)'; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
 	    elif test -f $$tst; then dir=; \
 	    else dir="$(srcdir)/"; fi; \
-	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
 	      all=`expr $$all + 1`; \
 	      case " $(XFAIL_TESTS) " in \
-	      *" $$tst "*) \
+	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
 	      all=`expr $$all + 1`; \
 	      case " $(XFAIL_TESTS) " in \
-	      *" $$tst "*) \
+	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
 	  if test "$$failed" -eq 0; then \
 	    if test "$$xfail" -eq 0; then \
-	      banner="All $$all tests passed"; \
+	      banner="$$All$$all $$tests passed"; \
 	    else \
-	      banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
 	    fi; \
 	  else \
 	    if test "$$xpass" -eq 0; then \
-	      banner="$$failed of $$all tests failed"; \
+	      banner="$$failed of $$all $$tests failed"; \
 	    else \
-	      banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
 	    fi; \
 	  fi; \
 	  dashes="$$banner"; \
 	  skipped=""; \
 	  if test "$$skip" -ne 0; then \
-	    skipped="($$skip tests were not run)"; \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
 	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
 	      dashes="$$skipped"; \
 	  fi; \
@@ -755,49 +903,57 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
-	  echo "$$banner"; \
-	  test -z "$$skipped" || echo "$$skipped"; \
-	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
 check-am: all-am
-	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS)
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
 	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(HEADERS)
 installdirs:
 	for dir in "$(DESTDIR)$(pkgincludedir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
 install-exec: install-exec-am
@@ -809,16 +965,22 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
@@ -834,7 +996,7 @@ distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-libtool distclean-tags
+	distclean-tags
 
 dvi: dvi-am
 
@@ -842,18 +1004,38 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
 
 install-data-am: install-pkgincludeHEADERS
 
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-am
+
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -874,21 +1056,24 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
+uninstall-am: uninstall-pkgincludeHEADERS
+
+.MAKE: check-am install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
 	clean-checkPROGRAMS clean-generic clean-libtool clean-local \
-	clean-noinstLTLIBRARIES ctags distclean distclean-compile \
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-exec install-exec-am \
-	install-info install-info-am install-man \
-	install-pkgincludeHEADERS install-strip installcheck \
+	clean-noinstLTLIBRARIES cscopelist ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-pkgincludeHEADERS \
+	install-ps install-ps-am install-strip installcheck \
 	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-info-am \
-	uninstall-pkgincludeHEADERS
+	tags uninstall uninstall-am uninstall-pkgincludeHEADERS
 
 
 @PURIFY_TRUE at include $(top_builddir)/Makefile.purify
@@ -896,6 +1081,7 @@ uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
 # We need to remove any files that the above tests created.
 clean-local:
 	 $(RM) *.fits *.paf *.log
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/fors/tests/fors-test.c b/fors/tests/fors-test.c
index b55e617..722aeb6 100644
--- a/fors/tests/fors-test.c
+++ b/fors/tests/fors-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors-test.c,v 1.2 2007/07/09 06:59:34 jmlarsen Exp $
+/* $Id: fors-test.c,v 1.2 2007-07-09 06:59:34 jmlarsen Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: jmlarsen $
- * $Date: 2007/07/09 06:59:34 $
+ * $Date: 2007-07-09 06:59:34 $
  * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_bias-test.c b/fors/tests/fors_bias-test.c
index 0db5e55..d549176 100644
--- a/fors/tests/fors_bias-test.c
+++ b/fors/tests/fors_bias-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_bias-test.c,v 1.9 2013/04/25 10:00:19 cgarcia Exp $
+/* $Id: fors_bias-test.c,v 1.9 2013-04-25 10:00:19 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/25 10:00:19 $
+ * $Date: 2013-04-25 10:00:19 $
  * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_cpl_wcs-test.c b/fors/tests/fors_cpl_wcs-test.c
index 875671f..85ee947 100644
--- a/fors/tests/fors_cpl_wcs-test.c
+++ b/fors/tests/fors_cpl_wcs-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_cpl_wcs-test.c,v 1.2 2008/02/07 14:41:21 cizzo Exp $
+/* $Id: fors_cpl_wcs-test.c,v 1.2 2008-02-07 14:41:21 cizzo Exp $
  *
  * This file is part of the ESO Common Pipeline Library
  * Copyright (C) 2001-2004 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2008/02/07 14:41:21 $
+ * $Date: 2008-02-07 14:41:21 $
  * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_WCS
diff --git a/fors/tests/fors_dark-test.c b/fors/tests/fors_dark-test.c
index a3aebab..78813fa 100644
--- a/fors/tests/fors_dark-test.c
+++ b/fors/tests/fors_dark-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_dark-test.c,v 1.3 2007/10/31 17:07:32 jmlarsen Exp $
+/* $Id: fors_dark-test.c,v 1.6 2013-09-11 13:47:53 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: jmlarsen $
- * $Date: 2007/10/31 17:07:32 $
- * $Revision: 1.3 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-09-11 13:47:53 $
+ * $Revision: 1.6 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -87,7 +87,7 @@ test_dark(void)
         }
     }
 
-    setting = fors_setting_new(cpl_frameset_get_first(frames));
+    setting = fors_setting_new(cpl_frameset_get_position(frames, 0));
 
     cpl_frameset_insert(frames, 
                         create_bias("dark_master_bias.fits", 
diff --git a/fors/tests/fors_identify-test.c b/fors/tests/fors_identify-test.c
index e0f2998..3cabcce 100644
--- a/fors/tests/fors_identify-test.c
+++ b/fors/tests/fors_identify-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_identify-test.c,v 1.30 2011/05/10 07:29:10 cizzo Exp $
+/* $Id: fors_identify-test.c,v 1.30 2011-05-10 07:29:10 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2011/05/10 07:29:10 $
+ * $Date: 2011-05-10 07:29:10 $
  * $Revision: 1.30 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_image-test.c b/fors/tests/fors_image-test.c
index 3b86b77..bfa9fce 100644
--- a/fors/tests/fors_image-test.c
+++ b/fors/tests/fors_image-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_image-test.c,v 1.20 2007/11/23 14:24:24 jmlarsen Exp $
+/* $Id: fors_image-test.c,v 1.20 2007-11-23 14:24:24 jmlarsen Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: jmlarsen $
- * $Date: 2007/11/23 14:24:24 $
+ * $Date: 2007-11-23 14:24:24 $
  * $Revision: 1.20 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_img_science-test.c b/fors/tests/fors_img_science-test.c
index 1423584..7c6822d 100644
--- a/fors/tests/fors_img_science-test.c
+++ b/fors/tests/fors_img_science-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_img_science-test.c,v 1.6 2011/07/19 15:50:16 cgarcia Exp $
+/* $Id: fors_img_science-test.c,v 1.6 2011-07-19 15:50:16 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/07/19 15:50:16 $
+ * $Date: 2011-07-19 15:50:16 $
  * $Revision: 1.6 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_img_screen_flat-test.c b/fors/tests/fors_img_screen_flat-test.c
index ef8b9bb..765da69 100644
--- a/fors/tests/fors_img_screen_flat-test.c
+++ b/fors/tests/fors_img_screen_flat-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_img_screen_flat-test.c,v 1.17 2008/08/07 09:38:01 cizzo Exp $
+/* $Id: fors_img_screen_flat-test.c,v 1.17 2008-08-07 09:38:01 cizzo Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cizzo $
- * $Date: 2008/08/07 09:38:01 $
+ * $Date: 2008-08-07 09:38:01 $
  * $Revision: 1.17 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_img_sky_flat-test.c b/fors/tests/fors_img_sky_flat-test.c
index 44b6540..0a5155e 100644
--- a/fors/tests/fors_img_sky_flat-test.c
+++ b/fors/tests/fors_img_sky_flat-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_img_sky_flat-test.c,v 1.7 2007/11/26 14:30:52 jmlarsen Exp $
+/* $Id: fors_img_sky_flat-test.c,v 1.8 2013-09-11 10:04:21 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: jmlarsen $
- * $Date: 2007/11/26 14:30:52 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-09-11 10:04:21 $
+ * $Revision: 1.8 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -91,7 +91,7 @@ test_img_sky_flat(void)
         }
     }
     
-    setting = fors_setting_new(cpl_frameset_get_first(frames));
+    setting = fors_setting_new(cpl_frameset_get_position(frames, 0));
     
     cpl_frameset_insert(frames, 
                         create_bias("img_sky_flat_master_bias.fits", 
diff --git a/fors/tests/fors_pattern-test.c b/fors/tests/fors_pattern-test.c
index 7f69b0e..a1a3e2b 100644
--- a/fors/tests/fors_pattern-test.c
+++ b/fors/tests/fors_pattern-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_pattern-test.c,v 1.2 2007/09/07 11:29:49 jmlarsen Exp $
+/* $Id: fors_pattern-test.c,v 1.2 2007-09-07 11:29:49 jmlarsen Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: jmlarsen $
- * $Date: 2007/09/07 11:29:49 $
+ * $Date: 2007-09-07 11:29:49 $
  * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_photometry-test.c b/fors/tests/fors_photometry-test.c
index 748ce55..d2573b7 100644
--- a/fors/tests/fors_photometry-test.c
+++ b/fors/tests/fors_photometry-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_photometry-test.c,v 1.9 2009/02/17 12:18:28 hlorch Exp $
+/* $Id: fors_photometry-test.c,v 1.9 2009-02-17 12:18:28 hlorch Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: hlorch $
- * $Date: 2009/02/17 12:18:28 $
+ * $Date: 2009-02-17 12:18:28 $
  * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_point-test.c b/fors/tests/fors_point-test.c
index ff8f1e7..047098f 100644
--- a/fors/tests/fors_point-test.c
+++ b/fors/tests/fors_point-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_point-test.c,v 1.1 2007/08/28 13:33:09 jmlarsen Exp $
+/* $Id: fors_point-test.c,v 1.1 2007-08-28 13:33:09 jmlarsen Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: jmlarsen $
- * $Date: 2007/08/28 13:33:09 $
+ * $Date: 2007-08-28 13:33:09 $
  * $Revision: 1.1 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_qc-test.c b/fors/tests/fors_qc-test.c
index f403d8f..ea4d0e2 100644
--- a/fors/tests/fors_qc-test.c
+++ b/fors/tests/fors_qc-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_qc-test.c,v 1.8 2007/10/12 11:17:47 jmlarsen Exp $
+/* $Id: fors_qc-test.c,v 1.8 2007-10-12 11:17:47 jmlarsen Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: jmlarsen $
- * $Date: 2007/10/12 11:17:47 $
+ * $Date: 2007-10-12 11:17:47 $
  * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_setting-test.c b/fors/tests/fors_setting-test.c
index fb45dd5..f4a3609 100644
--- a/fors/tests/fors_setting-test.c
+++ b/fors/tests/fors_setting-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_setting-test.c,v 1.2 2007/09/27 12:48:52 jmlarsen Exp $
+/* $Id: fors_setting-test.c,v 1.2 2007-09-27 12:48:52 jmlarsen Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: jmlarsen $
- * $Date: 2007/09/27 12:48:52 $
+ * $Date: 2007-09-27 12:48:52 $
  * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_stack-test.c b/fors/tests/fors_stack-test.c
index 560d3cb..3c3898f 100644
--- a/fors/tests/fors_stack-test.c
+++ b/fors/tests/fors_stack-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_stack-test.c,v 1.9 2008/02/28 15:06:54 cizzo Exp $
+/* $Id: fors_stack-test.c,v 1.10 2013-09-11 10:04:50 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2008/02/28 15:06:54 $
- * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-09-11 10:04:50 $
+ * $Revision: 1.10 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -89,7 +89,7 @@ test_stack(void)
         cpl_frameset_insert(raw, bias);
     }
 
-    setting = fors_setting_new(cpl_frameset_get_first(raw));
+    setting = fors_setting_new(cpl_frameset_get_position(raw, 0));
 
     ilist = fors_image_load_list(raw, NULL, setting, NULL);
     assure( ilist != NULL, return, "Loading list failed" );
diff --git a/fors/tests/fors_star-test.c b/fors/tests/fors_star-test.c
index afdf147..3d123d1 100644
--- a/fors/tests/fors_star-test.c
+++ b/fors/tests/fors_star-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_star-test.c,v 1.2 2007/10/17 09:17:41 jmlarsen Exp $
+/* $Id: fors_star-test.c,v 1.2 2007-10-17 09:17:41 jmlarsen Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: jmlarsen $
- * $Date: 2007/10/17 09:17:41 $
+ * $Date: 2007-10-17 09:17:41 $
  * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_std_star-test.c b/fors/tests/fors_std_star-test.c
index 6a0cb86..b437601 100644
--- a/fors/tests/fors_std_star-test.c
+++ b/fors/tests/fors_std_star-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_std_star-test.c,v 1.22 2009/03/26 20:23:48 hlorch Exp $
+/* $Id: fors_std_star-test.c,v 1.22 2009-03-26 20:23:48 hlorch Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: hlorch $
- * $Date: 2009/03/26 20:23:48 $
+ * $Date: 2009-03-26 20:23:48 $
  * $Revision: 1.22 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/fors_zeropoint-test.c b/fors/tests/fors_zeropoint-test.c
index 1998a36..f1b42b8 100644
--- a/fors/tests/fors_zeropoint-test.c
+++ b/fors/tests/fors_zeropoint-test.c
@@ -1,4 +1,4 @@
-/* $Id: fors_zeropoint-test.c,v 1.18 2011/07/19 15:49:52 cgarcia Exp $
+/* $Id: fors_zeropoint-test.c,v 1.18 2011-07-19 15:49:52 cgarcia Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/07/19 15:49:52 $
+ * $Date: 2011-07-19 15:49:52 $
  * $Revision: 1.18 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/list-test.c b/fors/tests/list-test.c
index b8eb4bd..cede100 100644
--- a/fors/tests/list-test.c
+++ b/fors/tests/list-test.c
@@ -1,4 +1,4 @@
-/* $Id: list-test.c,v 1.5 2007/09/26 13:31:58 jmlarsen Exp $
+/* $Id: list-test.c,v 1.5 2007-09-26 13:31:58 jmlarsen Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: jmlarsen $
- * $Date: 2007/09/26 13:31:58 $
+ * $Date: 2007-09-26 13:31:58 $
  * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/my_custom_test_script b/fors/tests/my_custom_test_script
deleted file mode 100755
index 2adf919..0000000
--- a/fors/tests/my_custom_test_script
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/perl -sWl
-
-system("ssh -xl jmlarsen bora /home/jmlarsen/reg_tst") == 0 or die;
-
-exit 0
-
diff --git a/fors/tests/test_simulate.c b/fors/tests/test_simulate.c
index b65a522..c11469d 100644
--- a/fors/tests/test_simulate.c
+++ b/fors/tests/test_simulate.c
@@ -1,4 +1,4 @@
-/* $Id: test_simulate.c,v 1.34 2009/02/25 15:34:48 hlorch Exp $
+/* $Id: test_simulate.c,v 1.34 2009-02-25 15:34:48 hlorch Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: hlorch $
- * $Date: 2009/02/25 15:34:48 $
+ * $Date: 2009-02-25 15:34:48 $
  * $Revision: 1.34 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/fors/tests/test_simulate.h b/fors/tests/test_simulate.h
index 5bfe100..16e098e 100644
--- a/fors/tests/test_simulate.h
+++ b/fors/tests/test_simulate.h
@@ -1,4 +1,4 @@
-/* $Id: test_simulate.h,v 1.9 2007/10/18 12:48:12 jmlarsen Exp $
+/* $Id: test_simulate.h,v 1.9 2007-10-18 12:48:12 jmlarsen Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: jmlarsen $
- * $Date: 2007/10/18 12:48:12 $
+ * $Date: 2007-10-18 12:48:12 $
  * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef TEST_SIMULATE_H
diff --git a/html/annotated.html b/html/annotated.html
index 8dac91d..5acdf0f 100644
--- a/html/annotated.html
+++ b/html/annotated.html
@@ -1,46 +1,80 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Data Structures</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li id="current"><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>FORS Pipeline Reference Manual Data Structures</h1>Here are the data structures with brief descriptions:<table>
-  <tr><td class="indexkey"><a class="el" href="struct__extract__method.html">_extract_method</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__fors__cpl__wcs__.html">_fors_cpl_wcs_</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__fors__image.html">_fors_image</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__FORS__PAF__.html">_FORS_PAF_</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__fors__pattern.html">_fors_pattern</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__fors__point.html">_fors_point</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__fors__setting.html">_fors_setting</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__fors__star.html">_fors_star</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__fors__std__star.html">_fors_std_star</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__identify__method.html">_identify_method</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="struct__stack__method.html">_stack_method</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="structband__jacobian.html">band_jacobian</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="structentry.html">entry</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="structfors__filterlist.html">fors_filterlist</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><a class="el" href="structlist.html">list</a></td><td class="indexvalue"></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">Data Structures</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="textblock">Here are the data structures with brief descriptions:</div><div class="directory">
+<table class="directory">
+<tr id="row_0_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__extract__method.html" target="_self">_extract_method</a></td><td class="desc"></td></tr>
+<tr id="row_1_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__fors__cpl__wcs__.html" target="_self">_fors_cpl_wcs_</a></td><td class="desc"></td></tr>
+<tr id="row_2_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__fors__image.html" target="_self">_fors_image</a></td><td class="desc"></td></tr>
+<tr id="row_3_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__FORS__PAF__.html" target="_self">_FORS_PAF_</a></td><td class="desc"></td></tr>
+<tr id="row_4_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__FORS__PAF__RECORD__.html" target="_self">_FORS_PAF_RECORD_</a></td><td class="desc"></td></tr>
+<tr id="row_5_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__fors__pattern.html" target="_self">_fors_pattern</a></td><td class="desc"></td></tr>
+<tr id="row_6_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__fors__point.html" target="_self">_fors_point</a></td><td class="desc"></td></tr>
+<tr id="row_7_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__fors__setting.html" target="_self">_fors_setting</a></td><td class="desc"></td></tr>
+<tr id="row_8_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__fors__star.html" target="_self">_fors_star</a></td><td class="desc"></td></tr>
+<tr id="row_9_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__fors__std__star.html" target="_self">_fors_std_star</a></td><td class="desc"></td></tr>
+<tr id="row_10_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__identify__method.html" target="_self">_identify_method</a></td><td class="desc"></td></tr>
+<tr id="row_11_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="struct__stack__method.html" target="_self">_stack_method</a></td><td class="desc"></td></tr>
+<tr id="row_12_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structband__jacobian.html" target="_self">band_jacobian</a></td><td class="desc"></td></tr>
+<tr id="row_13_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structentry.html" target="_self">entry</a></td><td class="desc"></td></tr>
+<tr id="row_14_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structfors__extract__sky__stats.html" target="_self">fors_extract_sky_stats</a></td><td class="desc"></td></tr>
+<tr id="row_15_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structfors__filterlist.html" target="_self">fors_filterlist</a></td><td class="desc"></td></tr>
+<tr id="row_16_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structfors__fit__ncoeff__paropts.html" target="_self">fors_fit_ncoeff_paropts</a></td><td class="desc"></td></tr>
+<tr id="row_17_"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="structlist.html" target="_self">list</a></td><td class="desc"></td></tr>
+</table>
+</div><!-- directory -->
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/bc_s.png b/html/bc_s.png
new file mode 100644
index 0000000..224b29a
Binary files /dev/null and b/html/bc_s.png differ
diff --git a/html/bdwn.png b/html/bdwn.png
new file mode 100644
index 0000000..940a0b9
Binary files /dev/null and b/html/bdwn.png differ
diff --git a/html/classes.html b/html/classes.html
index fc2ccf6..4a4d877 100644
--- a/html/classes.html
+++ b/html/classes.html
@@ -1,34 +1,96 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: Alphabetical List</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li id="current"><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>FORS Pipeline Reference Manual Data Structure Index</h1><p><div class="qindex"><a class="qindex" href="#letter_B">B</a> | <a class="qindex" href="#letter_E">E</a> | <a class="qindex" href="#letter_F">F</a> | <a class="qindex" href="#letter_L">L</a> | <a class="qindex" href="#letter__">_</a></div><p>
-<table align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
-<tr><td><a name="letter_B"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  B  </div></td></tr></table>
-</td></tr><tr><td><a class="el" href="structband__jacobian.html">band_jacobian</a>   </td></tr><tr><td><a name="letter_E"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  E  </div></td></tr></table>
-</td></tr><tr><td><a class="el" href="structentry.html">entry</a>   </td></tr><tr><td><a name="letter_F"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  F  </div></td></tr></table>
-</td></tr><tr><td><a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a>   </td></tr><tr><td><a class="el" href="structfors__filterlist.html">fors_filterlist</a>   </td></tr><tr><td><a class="el" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>   </td></tr><tr><td><a name="letter_L"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  L  </div> [...]
-</td></tr><tr><td><a class="el" href="structlist.html">list</a>   </td></tr><tr><td><a name="letter__"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  _  </div></td></tr></table>
-</td></tr><tr><td><a class="el" href="struct__extract__method.html">_extract_method</a>   </td></tr><tr><td><a class="el" href="struct__fors__cpl__wcs__.html">_fors_cpl_wcs_</a>   </td></tr><tr><td><a class="el" href="struct__fors__image.html">_fors_image</a>   </td></tr><tr><td><a class="el" href="struct__FORS__PAF__.html">_FORS_PAF_</a>   </td></tr><tr><td><a class="el" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_ [...]
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: Data Structure Index</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">Data Structure Index</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="qindex"><a class="qindex" href="#letter_B">B</a> | <a class="qindex" href="#letter_E">E</a> | <a class="qindex" href="#letter_F">F</a> | <a class="qindex" href="#letter_L">L</a> | <a class="qindex" href="#letter__">_</a></div>
+<table style="margin: 10px; white-space: nowrap;" align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
+<tr><td rowspan="2" valign="bottom"><a name="letter_B"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  B  </div></td></tr></table>
+</td></tr>
+<tr></tr>
+<tr><td valign="top"><a class="el" href="structband__jacobian.html">band_jacobian</a>   </td></tr>
+<tr><td rowspan="2" valign="bottom"><a name="letter_E"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  E  </div></td></tr></table>
+</td></tr>
+<tr></tr>
+<tr><td valign="top"><a class="el" href="structentry.html">entry</a>   </td></tr>
+<tr><td rowspan="2" valign="bottom"><a name="letter_F"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  F  </div></td></tr></table>
+</td></tr>
+<tr></tr>
+<tr><td valign="top"><a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="structfors__filterlist.html">fors_filterlist</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>   </td></tr>
+<tr><td rowspan="2" valign="bottom"><a name="letter_L"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  L  </div></td></tr></table>
+</td></tr>
+<tr></tr>
+<tr><td valign="top"><a class="el" href="structlist.html">list</a>   </td></tr>
+<tr><td rowspan="2" valign="bottom"><a name="letter__"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  _  </div></td></tr></table>
+</td></tr>
+<tr></tr>
+<tr><td valign="top"><a class="el" href="struct__extract__method.html">_extract_method</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__fors__cpl__wcs__.html">_fors_cpl_wcs_</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__fors__image.html">_fors_image</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__FORS__PAF__.html">_FORS_PAF_</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__fors__pattern.html">_fors_pattern</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__fors__point.html">_fors_point</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__fors__setting.html">_fors_setting</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__fors__star.html">_fors_star</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__fors__std__star.html">_fors_std_star</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__identify__method.html">_identify_method</a>   </td></tr>
+<tr><td valign="top"><a class="el" href="struct__stack__method.html">_stack_method</a>   </td></tr>
+<tr><td></td></tr>
+</table>
+<div class="qindex"><a class="qindex" href="#letter_B">B</a> | <a class="qindex" href="#letter_E">E</a> | <a class="qindex" href="#letter_F">F</a> | <a class="qindex" href="#letter_L">L</a> | <a class="qindex" href="#letter__">_</a></div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/closed.png b/html/closed.png
new file mode 100644
index 0000000..98cc2c9
Binary files /dev/null and b/html/closed.png differ
diff --git a/html/create__phot_8c-source.html b/html/create__phot_8c-source.html
deleted file mode 100644
index 2301bfd..0000000
--- a/html/create__phot_8c-source.html
+++ /dev/null
@@ -1,477 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: create_phot.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>create_phot.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include <fors_data.h></span>
-<a name="l00002"></a>00002 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00003"></a>00003 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00004"></a>00004 
-<a name="l00005"></a>00005 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00006"></a>00006 
-<a name="l00007"></a>00007 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00008"></a>00008 <span class="preprocessor">#include <string.h></span>
-<a name="l00009"></a>00009 <span class="preprocessor">#include <errno.h></span>
-<a name="l00010"></a>00010 
-<a name="l00011"></a>00011 <span class="preprocessor">#define HARDCODED 0 </span><span class="comment">/* create same values as MIDAS? */</span>
-<a name="l00012"></a>00012 
-<a name="l00013"></a>00013 <span class="preprocessor">#define DIE \</span>
-<a name="l00014"></a>00014 <span class="preprocessor">do { \</span>
-<a name="l00015"></a>00015 <span class="preprocessor">    fprintf(stderr, "Error at %s:%d\n", __func__, __LINE__); \</span>
-<a name="l00016"></a>00016 <span class="preprocessor">    if (errno) perror(NULL); \</span>
-<a name="l00017"></a>00017 <span class="preprocessor">    cpl_end(); \</span>
-<a name="l00018"></a>00018 <span class="preprocessor">    exit(EXIT_FAILURE); \</span>
-<a name="l00019"></a>00019 <span class="preprocessor">} while (0)</span>
-<a name="l00020"></a>00020 <span class="preprocessor"></span>
-<a name="l00021"></a>00021 <span class="preprocessor">#define CHECK \</span>
-<a name="l00022"></a>00022 <span class="preprocessor">do { \</span>
-<a name="l00023"></a>00023 <span class="preprocessor">    if (cpl_error_get_code()) { \</span>
-<a name="l00024"></a>00024 <span class="preprocessor">        cpl_msg_error(cpl_func, "%s %s", cpl_error_get_where(), cpl_error_get_message()); \</span>
-<a name="l00025"></a>00025 <span class="preprocessor">        DIE; \</span>
-<a name="l00026"></a>00026 <span class="preprocessor">    } \</span>
-<a name="l00027"></a>00027 <span class="preprocessor">} while (0)</span>
-<a name="l00028"></a>00028 <span class="preprocessor"></span>
-<a name="l00029"></a>00029 <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])
-<a name="l00030"></a>00030 {
-<a name="l00031"></a>00031     cpl_init(CPL_INIT_DEFAULT);
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033     errno = 0;
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035     <span class="keywordflow">if</span> (argc != 1) {
-<a name="l00036"></a>00036         fprintf(stderr,
-<a name="l00037"></a>00037                 <span class="stringliteral">"Usage:\n    %s\n"</span>, argv[0]);
-<a name="l00038"></a>00038         DIE;
-<a name="l00039"></a>00039     }
-<a name="l00040"></a>00040     
-<a name="l00041"></a>00041     <span class="comment">/* Numbers and code imported from MIDAS: fspil/pipe/proc/fors_zeropoint.prg */</span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043     <span class="comment">// FORS1 data</span>
-<a name="l00044"></a>00044 <span class="comment">//    if (fors1upgraded == 0) {</span>
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046     <span class="comment">/* Old fors1 */</span>
-<a name="l00047"></a>00047     <span class="keywordtype">double</span> exti_old_u =  0.425;  <span class="comment">// Extinction in the U band</span>
-<a name="l00048"></a>00048     <span class="keywordtype">double</span> exti_old_b =  0.245;  <span class="comment">// Extinction in the B band</span>
-<a name="l00049"></a>00049     <span class="keywordtype">double</span> exti_old_v =  0.125;  <span class="comment">// Extinction in the V band</span>
-<a name="l00050"></a>00050     <span class="keywordtype">double</span> exti_old_r =  0.081;  <span class="comment">// Extinction in the R band</span>
-<a name="l00051"></a>00051     <span class="keywordtype">double</span> exti_old_i =  0.038;  <span class="comment">// Extinction in the I band</span>
-<a name="l00052"></a>00052   
-<a name="l00053"></a>00053     <span class="keywordtype">double</span> colo_old_u =  0.067;  <span class="comment">// Color term in the U band</span>
-<a name="l00054"></a>00054     <span class="keywordtype">double</span> colo_old_b = -0.078;  <span class="comment">// Color term in the B band</span>
-<a name="l00055"></a>00055     <span class="keywordtype">double</span> colo_old_v =  0.035;  <span class="comment">// Color term in the V band</span>
-<a name="l00056"></a>00056     <span class="keywordtype">double</span> colo_old_r =  0.042;  <span class="comment">// Color term in the R band</span>
-<a name="l00057"></a>00057     <span class="keywordtype">double</span> colo_old_i = -0.038;  <span class="comment">// Color term in the I band</span>
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059     <span class="keywordtype">double</span> exti_old_u_high =  0.000;  <span class="comment">// Extinction in the u band</span>
-<a name="l00060"></a>00060     <span class="keywordtype">double</span> exti_old_b_high =  0.000;  <span class="comment">// Extinction in the b band</span>
-<a name="l00061"></a>00061     <span class="keywordtype">double</span> exti_old_v_high =  0.000;  <span class="comment">// Extinction in the v band</span>
-<a name="l00062"></a>00062     <span class="keywordtype">double</span> exti_old_g_high =  0.000;  <span class="comment">// Extinction in the g band</span>
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064     <span class="keywordtype">double</span> colo_old_u_high =  0.000;  <span class="comment">// Color term in the u band</span>
-<a name="l00065"></a>00065     <span class="keywordtype">double</span> colo_old_b_high =  0.000;  <span class="comment">// Color term in the b band</span>
-<a name="l00066"></a>00066     <span class="keywordtype">double</span> colo_old_v_high =  0.000;  <span class="comment">// Color term in the v band</span>
-<a name="l00067"></a>00067     <span class="keywordtype">double</span> colo_old_g_high =  0.000;  <span class="comment">// Color term in the g band</span>
-<a name="l00068"></a>00068 
-<a name="l00069"></a>00069     <span class="keywordtype">double</span> zero_old_u = 99.99; <span class="comment">// not available</span>
-<a name="l00070"></a>00070     <span class="keywordtype">double</span> zero_old_b = 99.99;
-<a name="l00071"></a>00071     <span class="keywordtype">double</span> zero_old_v = 99.99;
-<a name="l00072"></a>00072     <span class="keywordtype">double</span> zero_old_r = 99.99;
-<a name="l00073"></a>00073     <span class="keywordtype">double</span> zero_old_i = 99.99;
-<a name="l00074"></a>00074     <span class="keywordtype">double</span> zero_old_g = 99.99;
-<a name="l00075"></a>00075 
-<a name="l00076"></a>00076     <span class="keyword">struct </span>{
-<a name="l00077"></a>00077         <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument;
-<a name="l00078"></a>00078         <span class="keyword">struct </span>{
-<a name="l00079"></a>00079             <span class="keyword">const</span> <span class="keywordtype">char</span> *base_filename;
-<a name="l00080"></a>00080             <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__test__simulate.html#g8a365694ad27ccccf1a8c2b57d763e35">chip_id</a>;
-<a name="l00081"></a>00081             <span class="keyword">struct </span>{ 
-<a name="l00082"></a>00082                 <span class="keyword">const</span> <span class="keywordtype">char</span> *filtername;
-<a name="l00083"></a>00083                 <span class="keyword">enum</span> filter filter;
-<a name="l00084"></a>00084                 <span class="keywordtype">double</span> exti, dexti;
-<a name="l00085"></a>00085                 <span class="keywordtype">double</span> colo, dcolo;
-<a name="l00086"></a>00086                 <span class="keywordtype">double</span> zero, dzero;
-<a name="l00087"></a>00087             } data[9];
-<a name="l00088"></a>00088         } chips[2];
-<a name="l00089"></a>00089     }
-<a name="l00090"></a>00090     dat[] = {
-<a name="l00091"></a>00091         <span class="comment">/* Old FORS1 */</span>
-<a name="l00092"></a>00092         {<span class="stringliteral">"FORS1"</span>, 
-<a name="l00093"></a>00093          {
-<a name="l00094"></a>00094              {<span class="stringliteral">"fors1_TK"</span>, <span class="stringliteral">"TK2048EB4-1"</span>,
-<a name="l00095"></a>00095               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = exti_old_u     , .dexti = 0, .colo = colo_old_u     , .dcolo = 0, .zero = zero_old_u, .dzero = 0},
-<a name="l00096"></a>00096                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = exti_old_u_high, .dexti = 0, .colo = colo_old_u_high, .dcolo = 0, .zero = zero_old_u, .dzero = 0},
-<a name="l00097"></a>00097                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = exti_old_b     , .dexti = 0, .colo = colo_old_b     , .dcolo = 0, .zero = zero_old_b, .dzero = 0},
-<a name="l00098"></a>00098                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = exti_old_b_high, .dexti = 0, .colo = colo_old_b_high, .dcolo = 0, .zero = zero_old_b, .dzero = 0},
-<a name="l00099"></a>00099                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = exti_old_g_high, .dexti = 0, .colo = colo_old_g_high, .dcolo = 0, .zero = zero_old_g, .dzero = 0},
-<a name="l00100"></a>00100                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = exti_old_v     , .dexti = 0, .colo = colo_old_v     , .dcolo = 0, .zero = zero_old_v, .dzero = 0},
-<a name="l00101"></a>00101                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = exti_old_v_high, .dexti = 0, .colo = colo_old_v_high, .dcolo = 0, .zero = zero_old_v, .dzero = 0},
-<a name="l00102"></a>00102                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = exti_old_r     , .dexti = 0, .colo = colo_old_r     , .dcolo = 0, .zero = zero_old_r, .dzero = 0},
-<a name="l00103"></a>00103                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = exti_old_i     , .dexti = 0, .colo = colo_old_i     , .dcolo = 0, .zero = zero_old_i, .dzero = 0}}
-<a name="l00104"></a>00104              },
-<a name="l00105"></a>00105              {NULL, NULL, <span class="comment">/* Not used */</span>
-<a name="l00106"></a>00106               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = exti_old_u     , .dexti = 0, .colo = colo_old_u     , .dcolo = 0, .zero = zero_old_u, .dzero = 0},
-<a name="l00107"></a>00107                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = exti_old_u_high, .dexti = 0, .colo = colo_old_u_high, .dcolo = 0, .zero = zero_old_u, .dzero = 0},
-<a name="l00108"></a>00108                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = exti_old_b     , .dexti = 0, .colo = colo_old_b     , .dcolo = 0, .zero = zero_old_b, .dzero = 0},
-<a name="l00109"></a>00109                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = exti_old_b_high, .dexti = 0, .colo = colo_old_b_high, .dcolo = 0, .zero = zero_old_b, .dzero = 0},
-<a name="l00110"></a>00110                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = exti_old_g_high, .dexti = 0, .colo = colo_old_g_high, .dcolo = 0, .zero = zero_old_g, .dzero = 0},
-<a name="l00111"></a>00111                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = exti_old_v     , .dexti = 0, .colo = colo_old_v     , .dcolo = 0, .zero = zero_old_v, .dzero = 0},
-<a name="l00112"></a>00112                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = exti_old_v_high, .dexti = 0, .colo = colo_old_v_high, .dcolo = 0, .zero = zero_old_v, .dzero = 0},
-<a name="l00113"></a>00113                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = exti_old_r     , .dexti = 0, .colo = colo_old_r     , .dcolo = 0, .zero = zero_old_r, .dzero = 0},
-<a name="l00114"></a>00114                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = exti_old_i     , .dexti = 0, .colo = colo_old_i     , .dcolo = 0, .zero = zero_old_i, .dzero = 0}}
-<a name="l00115"></a>00115              }
-<a name="l00116"></a>00116          }
-<a name="l00117"></a>00117         },
-<a name="l00118"></a>00118         <span class="comment">/* New FORS1 */</span>
-<a name="l00119"></a>00119 
-<a name="l00120"></a>00120 <span class="preprocessor">#if HARDCODED</span>
-<a name="l00121"></a>00121 <span class="preprocessor"></span>        <span class="comment">/* Old values, hardcoded in MIDAS */</span>
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123         {<span class="stringliteral">"FORS1"</span>, 
-<a name="l00124"></a>00124          {
-<a name="l00125"></a>00125              {<span class="stringliteral">"fors1_Norma"</span>, <span class="stringliteral">"Norma III"</span>,
-<a name="l00126"></a>00126               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = 0.456, .dexti = 0, .colo =  0.091, .dcolo = 0, .zero = 26.080, .dzero = 0.031},
-<a name="l00127"></a>00127                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = 0.440, .dexti = 0, .colo =  0.106, .dcolo = 0, .zero = 26.572, .dzero = 0.049},
-<a name="l00128"></a>00128                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = 0.255, .dexti = 0, .colo = -0.107, .dcolo = 0, .zero = 28.163, .dzero = 0.023},
-<a name="l00129"></a>00129                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = 0.230, .dexti = 0, .colo =  0.069, .dcolo = 0, .zero = 28.539, .dzero = 0.031},
-<a name="l00130"></a>00130                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = 0.182, .dexti = 0, .colo =  0.031, .dcolo = 0, .zero = 28.867, .dzero = 0.032},
-<a name="l00131"></a>00131                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = 0.132, .dexti = 0, .colo =  0.020, .dcolo = 0, .zero = 28.227, .dzero = 0.023},
-<a name="l00132"></a>00132                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = 0.115, .dexti = 0, .colo =  0.049, .dcolo = 0, .zero = 28.410, .dzero = 0.029},
-<a name="l00133"></a>00133                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = 0.090, .dexti = 0, .colo =  0.000, .dcolo = 0, .zero = 28.024, .dzero = 0.025},
-<a name="l00134"></a>00134                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = 0.051, .dexti = 0, .colo = -0.060, .dcolo = 0, .zero = 27.023, .dzero = 0.034}}
-<a name="l00135"></a>00135              },
-<a name="l00136"></a>00136              {<span class="stringliteral">"fors1_Marlene"</span>, <span class="stringliteral">"Marlene "</span>,
-<a name="l00137"></a>00137               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = 0.456, .dexti = 0, .colo =  0.091, .dcolo = 0, .zero = 26.080, .dzero = 0.031},
-<a name="l00138"></a>00138                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = 0.440, .dexti = 0, .colo =  0.106, .dcolo = 0, .zero = 26.572, .dzero = 0.049},
-<a name="l00139"></a>00139                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = 0.255, .dexti = 0, .colo = -0.107, .dcolo = 0, .zero = 28.163, .dzero = 0.023},
-<a name="l00140"></a>00140                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = 0.230, .dexti = 0, .colo =  0.069, .dcolo = 0, .zero = 28.539, .dzero = 0.031},
-<a name="l00141"></a>00141                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = 0.182, .dexti = 0, .colo =  0.031, .dcolo = 0, .zero = 28.867, .dzero = 0.032},
-<a name="l00142"></a>00142                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = 0.132, .dexti = 0, .colo =  0.020, .dcolo = 0, .zero = 28.227, .dzero = 0.023},
-<a name="l00143"></a>00143                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = 0.115, .dexti = 0, .colo =  0.049, .dcolo = 0, .zero = 28.410, .dzero = 0.029},
-<a name="l00144"></a>00144                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = 0.090, .dexti = 0, .colo =  0.000, .dcolo = 0, .zero = 28.024, .dzero = 0.025},
-<a name="l00145"></a>00145                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = 0.051, .dexti = 0, .colo = -0.060, .dcolo = 0, .zero = 27.023, .dzero = 0.034}}
-<a name="l00146"></a>00146              },
-<a name="l00147"></a>00147          }
-<a name="l00148"></a>00148         },
-<a name="l00149"></a>00149         
-<a name="l00150"></a>00150         {<span class="stringliteral">"FORS2"</span>,
-<a name="l00151"></a>00151          {
-<a name="l00152"></a>00152              {<span class="stringliteral">"fors2_1453"</span>, <span class="stringliteral">"CCID20-14-5-3"</span>,
-<a name="l00153"></a>00153               {{<span class="stringliteral">"U_SPECIAL"</span>, FILTER_U, .exti = 0.443, .dexti = 0, .colo =  0.076, .dcolo = 0, .zero = 24.365, .dzero = 0.045},
-<a name="l00154"></a>00154                {<span class="stringliteral">"B_BESS"</span>   , FILTER_B, .exti = 0.217, .dexti = 0, .colo = -0.033, .dcolo = 0, .zero = 27.740, .dzero = 0.032},
-<a name="l00155"></a>00155                {<span class="stringliteral">"V_BESS"</span>   , FILTER_V, .exti = 0.127, .dexti = 0, .colo =  0.022, .dcolo = 0, .zero = 28.186, .dzero = 0.025},
-<a name="l00156"></a>00156                {<span class="stringliteral">"R_SPECIAL"</span>, FILTER_R, .exti = 0.098, .dexti = 0, .colo = -0.009, .dcolo = 0, .zero = 28.404, .dzero = 0.037},
-<a name="l00157"></a>00157                {<span class="stringliteral">"I_BESS"</span>   , FILTER_I, .exti = 0.060, .dexti = 0, .colo = -0.017, .dcolo = 0, .zero = 27.773, .dzero = 0.034},
-<a name="l00158"></a>00158                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00159"></a>00159                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00160"></a>00160                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00161"></a>00161                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}
-<a name="l00162"></a>00162              },
-<a name="l00163"></a>00163              
-<a name="l00164"></a>00164              {<span class="stringliteral">"fors2_1456"</span>, <span class="stringliteral">"CCID20-14-5-6"</span>,
-<a name="l00165"></a>00165               {{<span class="stringliteral">"U_SPECIAL"</span>, FILTER_U, .exti = 0.443, .dexti = 0, .colo =  0.076, .dcolo = 0, .zero = 24.365, .dzero = 0.045},
-<a name="l00166"></a>00166                {<span class="stringliteral">"B_BESS"</span>   , FILTER_B, .exti = 0.217, .dexti = 0, .colo = -0.033, .dcolo = 0, .zero = 27.740, .dzero = 0.032},
-<a name="l00167"></a>00167                {<span class="stringliteral">"V_BESS"</span>   , FILTER_V, .exti = 0.127, .dexti = 0, .colo =  0.022, .dcolo = 0, .zero = 28.186, .dzero = 0.025},
-<a name="l00168"></a>00168                {<span class="stringliteral">"R_SPECIAL"</span>, FILTER_R, .exti = 0.098, .dexti = 0, .colo = -0.009, .dcolo = 0, .zero = 28.404, .dzero = 0.037},
-<a name="l00169"></a>00169                {<span class="stringliteral">"I_BESS"</span>   , FILTER_I, .exti = 0.060, .dexti = 0, .colo = -0.017, .dcolo = 0, .zero = 27.773, .dzero = 0.034},
-<a name="l00170"></a>00170                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00171"></a>00171                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00172"></a>00172                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00173"></a>00173                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}
-<a name="l00174"></a>00174              }
-<a name="l00175"></a>00175          }
-<a name="l00176"></a>00176         }
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178 <span class="preprocessor">#else</span>
-<a name="l00179"></a>00179 <span class="preprocessor"></span>        <span class="comment">/* Numbers from P79 as provided by DFO */</span>
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181         {<span class="stringliteral">"FORS1"</span>, 
-<a name="l00182"></a>00182          {
-<a name="l00183"></a>00183              {<span class="stringliteral">"fors1_Norma"</span>, <span class="stringliteral">"Norma III"</span>,
-<a name="l00184"></a>00184               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = 0.447, .dexti = 0.018, .colo =  0.043, .dcolo = 0.008, .zero = 26.080, .dzero = 0.031},
-<a name="l00185"></a>00185                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = 0.437, .dexti = 0.033, .colo =  0.066, .dcolo = 0.012, .zero = 26.572, .dzero = 0.049},
-<a name="l00186"></a>00186                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = 0.241, .dexti = 0.013, .colo = -0.128, .dcolo = 0.008, .zero = 28.163, .dzero = 0.023},
-<a name="l00187"></a>00187                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = 0.222, .dexti = 0.020, .colo =  0.048, .dcolo = 0.009, .zero = 28.539, .dzero = 0.031},
-<a name="l00188"></a>00188                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = 0.209, .dexti = 0.022, .colo = -0.096, .dcolo = 0.008, .zero = 28.867, .dzero = 0.032},
-<a name="l00189"></a>00189                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = 0.112, .dexti = 0.012, .colo = -0.015, .dcolo = 0.007, .zero = 28.227, .dzero = 0.023},
-<a name="l00190"></a>00190                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = 0.139, .dexti = 0.018, .colo =  0.019, .dcolo = 0.008, .zero = 28.410, .dzero = 0.029},
-<a name="l00191"></a>00191                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = 0.087, .dexti = 0.014, .colo = -0.097, .dcolo = 0.015, .zero = 28.024, .dzero = 0.025},
-<a name="l00192"></a>00192                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = 0.027, .dexti = 0.021, .colo = -0.101, .dcolo = 0.011, .zero = 27.023, .dzero = 0.034}}
-<a name="l00193"></a>00193              },
-<a name="l00194"></a>00194              {<span class="stringliteral">"fors1_Marlene"</span>, <span class="stringliteral">"Marlene "</span>,
-<a name="l00195"></a>00195               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = 0.470, .dexti = 0.024, .colo =  0.039, .dcolo = 0.013, .zero = 26.069, .dzero = 0.041},
-<a name="l00196"></a>00196                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = 0.445, .dexti = 0.051, .colo =  0.063, .dcolo = 0.018, .zero = 26.548, .dzero = 0.070},
-<a name="l00197"></a>00197                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = 0.316, .dexti = 0.019, .colo = -0.124, .dcolo = 0.012, .zero = 28.221, .dzero = 0.032},
-<a name="l00198"></a>00198                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = 0.282, .dexti = 0.036, .colo =  0.059, .dcolo = 0.016, .zero = 28.563, .dzero = 0.052},
-<a name="l00199"></a>00199                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = 0.287, .dexti = 0.063, .colo = -0.106, .dcolo = 0.019, .zero = 28.938, .dzero = 0.082},
-<a name="l00200"></a>00200                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = 0.158, .dexti = 0.018, .colo = -0.011, .dcolo = 0.012, .zero = 28.247, .dzero = 0.033},
-<a name="l00201"></a>00201                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = 0.155, .dexti = 0.030, .colo =  0.019, .dcolo = 0.014, .zero = 28.388, .dzero = 0.046},
-<a name="l00202"></a>00202                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = 0.111, .dexti = 0.018, .colo = -0.047, .dcolo = 0.022, .zero = 28.009, .dzero = 0.033},
-<a name="l00203"></a>00203                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = 0.037, .dexti = 0.019, .colo = -0.100, .dcolo = 0.012, .zero = 27.038, .dzero = 0.035}}
-<a name="l00204"></a>00204              },
-<a name="l00205"></a>00205          }
-<a name="l00206"></a>00206         },
-<a name="l00207"></a>00207         
-<a name="l00208"></a>00208         {<span class="stringliteral">"FORS2"</span>,
-<a name="l00209"></a>00209          {
-<a name="l00210"></a>00210              {<span class="stringliteral">"fors2_1453"</span>, <span class="stringliteral">"CCID20-14-5-3"</span>,
-<a name="l00211"></a>00211               {{<span class="stringliteral">"U_SPECIAL"</span>, FILTER_U, .exti = 0.531, .dexti = 0.025, .colo =  0.069, .dcolo = 0.009, .zero = 24.365, .dzero = 0.045},
-<a name="l00212"></a>00212                {<span class="stringliteral">"B_BESS"</span>   , FILTER_B, .exti = 0.236, .dexti = 0.015, .colo = -0.026, .dcolo = 0.009, .zero = 27.740, .dzero = 0.032},
-<a name="l00213"></a>00213                {<span class="stringliteral">"V_BESS"</span>   , FILTER_V, .exti = 0.117, .dexti = 0.012, .colo = -0.002, .dcolo = 0.006, .zero = 28.186, .dzero = 0.025},
-<a name="l00214"></a>00214                {<span class="stringliteral">"R_SPECIAL"</span>, FILTER_R, .exti = 0.067, .dexti = 0.020, .colo = -0.039, .dcolo = 0.016, .zero = 28.404, .dzero = 0.037},
-<a name="l00215"></a>00215                {<span class="stringliteral">"I_BESS"</span>   , FILTER_I, .exti = 0.049, .dexti = 0.016, .colo = -0.044, .dcolo = 0.007, .zero = 27.773, .dzero = 0.034},
-<a name="l00216"></a>00216                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00217"></a>00217                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00218"></a>00218                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00219"></a>00219                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}
-<a name="l00220"></a>00220              },
-<a name="l00221"></a>00221              
-<a name="l00222"></a>00222              {<span class="stringliteral">"fors2_1456"</span>, <span class="stringliteral">"CCID20-14-5-6"</span>,
-<a name="l00223"></a>00223               {{<span class="stringliteral">"U_SPECIAL"</span>, FILTER_U, .exti = 0.526, .dexti = 0.042, .colo =  0.067, .dcolo = 0.014, .zero = 24.476, .dzero = 0.066},
-<a name="l00224"></a>00224                {<span class="stringliteral">"B_BESS"</span>   , FILTER_B, .exti = 0.272, .dexti = 0.023, .colo = -0.062, .dcolo = 0.011, .zero = 27.837, .dzero = 0.040},
-<a name="l00225"></a>00225                {<span class="stringliteral">"V_BESS"</span>   , FILTER_V, .exti = 0.123, .dexti = 0.014, .colo = -0.008, .dcolo = 0.006, .zero = 28.207, .dzero = 0.028},
-<a name="l00226"></a>00226                {<span class="stringliteral">"R_SPECIAL"</span>, FILTER_R, .exti = 0.065, .dexti = 0.022, .colo = -0.036, .dcolo = 0.013, .zero = 28.400, .dzero = 0.037},
-<a name="l00227"></a>00227                {<span class="stringliteral">"I_BESS"</span>   , FILTER_I, .exti = 0.023, .dexti = 0.013, .colo = -0.080, .dcolo = 0.008, .zero = 27.777, .dzero = 0.039},
-<a name="l00228"></a>00228                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00229"></a>00229                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00230"></a>00230                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},
-<a name="l00231"></a>00231                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}
-<a name="l00232"></a>00232              }
-<a name="l00233"></a>00233          }
-<a name="l00234"></a>00234         }
-<a name="l00235"></a>00235 <span class="preprocessor">#endif</span>
-<a name="l00236"></a>00236 <span class="preprocessor"></span>    };
-<a name="l00237"></a>00237     
-<a name="l00238"></a>00238     CHECK;
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240 <span class="preprocessor">#if 1</span>
-<a name="l00241"></a>00241 <span class="preprocessor"></span>
-<a name="l00242"></a>00242     <span class="comment">/* For each instrument */</span>
-<a name="l00243"></a>00243     <span class="keywordtype">unsigned</span> i;
-<a name="l00244"></a>00244     <span class="keywordflow">for</span>(i = 0; i < <span class="keyword">sizeof</span>(dat) / <span class="keyword">sizeof</span>(*dat); i++) {
-<a name="l00245"></a>00245         
-<a name="l00246"></a>00246         <span class="comment">/* For each chip */</span>
-<a name="l00247"></a>00247         <span class="keywordtype">unsigned</span> chips;
-<a name="l00248"></a>00248         <span class="keywordflow">for</span>(chips = 0; 
-<a name="l00249"></a>00249             chips < <span class="keyword">sizeof</span>(dat[i].chips) / <span class="keyword">sizeof</span>(*dat[i].chips); 
-<a name="l00250"></a>00250             chips++) {
-<a name="l00251"></a>00251             
-<a name="l00252"></a>00252             <span class="keywordflow">if</span> (dat[i].chips[chips].<a class="code" href="group__test__simulate.html#g8a365694ad27ccccf1a8c2b57d763e35">chip_id</a> == NULL) <span class="keywordflow">break</span>;
-<a name="l00253"></a>00253             
-<a name="l00254"></a>00254             cpl_table *t = cpl_table_new(9999);
-<a name="l00255"></a>00255             <span class="keywordtype">int</span> size = 0;
-<a name="l00256"></a>00256         
-<a name="l00257"></a>00257             cpl_propertylist *header = cpl_propertylist_new();
-<a name="l00258"></a>00258         
-<a name="l00259"></a>00259             cpl_propertylist_update_string(header, <a class="code" href="group__fors__pfits.html#g0eb4a071376ffab7bd7fb36186e16dda">FORS_PFITS_CHIP_ID</a>, dat[i].chips[chips].<a class="code" href="group__test__simulate.html#g8a365694ad27ccccf1a8c2b57d763e35">chip_id</a>);
-<a name="l00260"></a>00260             cpl_propertylist_update_string(header, <span class="stringliteral">"ESO PRO CATG"</span>, PHOT_TABLE);
-<a name="l00261"></a>00261             cpl_propertylist_update_string(header, <a class="code" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">FORS_PFITS_INSTRUME</a>, dat[i].instrument);
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263 
-<a name="l00264"></a>00264             <span class="comment">//cpl_table_new_column(t, "Instrument" , CPL_TYPE_STRING);</span>
-<a name="l00265"></a>00265             <span class="comment">//cpl_table_new_column(t, "Chip" , CPL_TYPE_STRING);</span>
-<a name="l00266"></a>00266             cpl_table_new_column(t, FORS_DATA_PHOT_FILTER , CPL_TYPE_STRING);
-<a name="l00267"></a>00267             cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);
-<a name="l00268"></a>00268             cpl_table_new_column(t, FORS_DATA_PHOT_DEXTCOEFF , CPL_TYPE_DOUBLE);
-<a name="l00269"></a>00269             cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);
-<a name="l00270"></a>00270             cpl_table_new_column(t, FORS_DATA_PHOT_DCOLORTERM, CPL_TYPE_DOUBLE);
-<a name="l00271"></a>00271             cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);
-<a name="l00272"></a>00272             cpl_table_new_column(t, FORS_DATA_PHOT_DZEROPOINT, CPL_TYPE_DOUBLE);
-<a name="l00273"></a>00273         
-<a name="l00274"></a>00274       
-<a name="l00275"></a>00275             <span class="comment">/* For each filter */</span>
-<a name="l00276"></a>00276             <span class="keywordtype">unsigned</span> j;
-<a name="l00277"></a>00277             <span class="keywordflow">for</span>(j = 0; 
-<a name="l00278"></a>00278                 j < <span class="keyword">sizeof</span>(dat[i].chips[chips].data) / <span class="keyword">sizeof</span>(*dat[i].chips[chips].data); 
-<a name="l00279"></a>00279                 j++)
-<a name="l00280"></a>00280                 {            
-<a name="l00281"></a>00281                     <span class="keywordflow">if</span> (dat[i].chips[chips].data[j].filtername == NULL) <span class="keywordflow">break</span>;
-<a name="l00282"></a>00282                            
-<a name="l00283"></a>00283                     <span class="comment">//cpl_table_set_string(t, "Instrument", size, dat[i].instrument);</span>
-<a name="l00284"></a>00284                     <span class="comment">//cpl_table_set_string(t, "Chip", size, dat[i].chips[chips].chip_id);</span>
-<a name="l00285"></a>00285                     cpl_table_set_string(t, FORS_DATA_PHOT_FILTER, size, dat[i].chips[chips].data[j].filtername);
-<a name="l00286"></a>00286                     cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF , size, 
-<a name="l00287"></a>00287                                          dat[i].chips[chips].data[j].exti);
-<a name="l00288"></a>00288                     cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, size, 
-<a name="l00289"></a>00289                                          dat[i].chips[chips].data[j].colo);
-<a name="l00290"></a>00290                     cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, size,
-<a name="l00291"></a>00291                                          dat[i].chips[chips].data[j].zero);
-<a name="l00292"></a>00292                     cpl_table_set_double(t, FORS_DATA_PHOT_DEXTCOEFF , size, 
-<a name="l00293"></a>00293                                          dat[i].chips[chips].data[j].dexti);
-<a name="l00294"></a>00294                     cpl_table_set_double(t, FORS_DATA_PHOT_DCOLORTERM, size, 
-<a name="l00295"></a>00295                                          dat[i].chips[chips].data[j].dcolo);
-<a name="l00296"></a>00296                     cpl_table_set_double(t, FORS_DATA_PHOT_DZEROPOINT, size,
-<a name="l00297"></a>00297                                          dat[i].chips[chips].data[j].dzero);
-<a name="l00298"></a>00298                     
-<a name="l00299"></a>00299                     size++;
-<a name="l00300"></a>00300                 }
-<a name="l00301"></a>00301             
-<a name="l00302"></a>00302             cpl_table_set_size(t, size);
-<a name="l00303"></a>00303             <span class="comment">//cpl_table_dump(t, 0, size, stdout);</span>
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305 <span class="preprocessor">#if HARDCODED</span>
-<a name="l00306"></a>00306 <span class="preprocessor"></span>            <span class="keyword">const</span> <span class="keywordtype">char</span> *full_filename = cpl_sprintf(<span class="stringliteral">"%s_phot_old.fits"</span>, 
-<a name="l00307"></a>00307                                                     dat[i].chips[chips].base_filename);
-<a name="l00308"></a>00308 <span class="preprocessor">#else</span>
-<a name="l00309"></a>00309 <span class="preprocessor"></span>            <span class="keyword">const</span> <span class="keywordtype">char</span> *full_filename = cpl_sprintf(<span class="stringliteral">"%s_phot.fits"</span>, 
-<a name="l00310"></a>00310                                                     dat[i].chips[chips].base_filename);
-<a name="l00311"></a>00311 <span class="preprocessor">#endif</span>
-<a name="l00312"></a>00312 <span class="preprocessor"></span>            
-<a name="l00313"></a>00313             cpl_table_save(t, header, NULL, full_filename, CPL_IO_DEFAULT);
-<a name="l00314"></a>00314             
-<a name="l00315"></a>00315             CHECK;  
-<a name="l00316"></a>00316             fprintf(stdout, <span class="stringliteral">"Created %s\n"</span>, full_filename);
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318             cpl_table_delete(t); t = NULL;
-<a name="l00319"></a>00319             cpl_propertylist_delete(header); header = NULL;
-<a name="l00320"></a>00320             cpl_free((<span class="keywordtype">void</span> *)full_filename);
-<a name="l00321"></a>00321         }  
-<a name="l00322"></a>00322     }
-<a name="l00323"></a>00323 
-<a name="l00324"></a>00324 <span class="preprocessor">#else </span>
-<a name="l00325"></a>00325 <span class="preprocessor"></span>    <span class="comment">/* One big table */</span>
-<a name="l00326"></a>00326 
-<a name="l00327"></a>00327     cpl_table *t = cpl_table_new(9999);
-<a name="l00328"></a>00328     <span class="keywordtype">int</span> size = 0;
-<a name="l00329"></a>00329 
-<a name="l00330"></a>00330     cpl_propertylist *header = cpl_propertylist_new();
-<a name="l00331"></a>00331                 
-<a name="l00332"></a>00332     cpl_table_new_column(t, <span class="stringliteral">"Instrument"</span> , CPL_TYPE_STRING);
-<a name="l00333"></a>00333     cpl_table_new_column(t, FORS_DATA_PHOT_FILTER , CPL_TYPE_STRING);
-<a name="l00334"></a>00334     cpl_table_new_column(t, <span class="stringliteral">"Chip"</span> , CPL_TYPE_STRING);
-<a name="l00335"></a>00335     cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);
-<a name="l00336"></a>00336     cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);
-<a name="l00337"></a>00337     cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);
-<a name="l00338"></a>00338     
-<a name="l00339"></a>00339     <span class="keywordtype">unsigned</span> i;
-<a name="l00340"></a>00340     <span class="keywordflow">for</span>(i = 0; i < <span class="keyword">sizeof</span>(dat) / <span class="keyword">sizeof</span>(*dat); i++) {
-<a name="l00341"></a>00341         
-<a name="l00342"></a>00342         <span class="keywordtype">unsigned</span> j;
-<a name="l00343"></a>00343         <span class="keywordflow">for</span>(j = 0; 
-<a name="l00344"></a>00344             j < <span class="keyword">sizeof</span>(dat[i].chips[chips].data) / <span class="keyword">sizeof</span>(*dat[i].chips[chips].data); 
-<a name="l00345"></a>00345             j++) {
-<a name="l00346"></a>00346             
-<a name="l00347"></a>00347             <span class="keywordflow">if</span> (dat[i].chips[chips].data[j].filtername == NULL) <span class="keywordflow">break</span>;
-<a name="l00348"></a>00348             
-<a name="l00349"></a>00349             
-<a name="l00350"></a>00350             <span class="keywordtype">unsigned</span> chips;
-<a name="l00351"></a>00351             <span class="keywordflow">for</span>(chips = 0; 
-<a name="l00352"></a>00352                 chips < <span class="keyword">sizeof</span>(dat[i].chip_id) / <span class="keyword">sizeof</span>(*dat[i].<a class="code" href="group__test__simulate.html#g8a365694ad27ccccf1a8c2b57d763e35">chip_id</a>); 
-<a name="l00353"></a>00353                 chips++) {
-<a name="l00354"></a>00354                 
-<a name="l00355"></a>00355                 <span class="keywordflow">if</span> (dat[i].chip_id[chips] == NULL) <span class="keywordflow">break</span>;
-<a name="l00356"></a>00356                 
-<a name="l00357"></a>00357                 cpl_table_set_string(t, <span class="stringliteral">"Instrument"</span>, size, dat[i].instrument);
-<a name="l00358"></a>00358                 cpl_table_set_string(t, <span class="stringliteral">"Chip"</span>, size, dat[i].chip_id[chips]);
-<a name="l00359"></a>00359                 cpl_table_set_string(t, FORS_DATA_PHOT_FILTER, size, dat[i].chips[chips].data[j].filtername);
-<a name="l00360"></a>00360                 cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF , size, 
-<a name="l00361"></a>00361                                      dat[i].chips[chips].data[j].exti);
-<a name="l00362"></a>00362                 cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, size, 
-<a name="l00363"></a>00363                                      dat[i].chips[chips].data[j].colo);
-<a name="l00364"></a>00364                 cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, size,
-<a name="l00365"></a>00365                                      dat[i].chips[chips].data[j].zero);
-<a name="l00366"></a>00366                 
-<a name="l00367"></a>00367                 size++;
-<a name="l00368"></a>00368                 <span class="comment">//cpl_table_dump(t, 0, size, stdout);</span>
-<a name="l00369"></a>00369             }
-<a name="l00370"></a>00370         }
-<a name="l00371"></a>00371     }
-<a name="l00372"></a>00372     
-<a name="l00373"></a>00373     cpl_table_set_size(t, size);
-<a name="l00374"></a>00374 
-<a name="l00375"></a>00375     cpl_table_save(t, NULL, NULL, filename, CPL_IO_DEFAULT);
-<a name="l00376"></a>00376 
-<a name="l00377"></a>00377     CHECK;  
-<a name="l00378"></a>00378     fprintf(stdout, <span class="stringliteral">"Created %s\n"</span>, filename);
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380 
-<a name="l00381"></a>00381 <span class="preprocessor">#endif</span>
-<a name="l00382"></a>00382 <span class="preprocessor"></span>
-<a name="l00383"></a>00383 
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386 
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389 <span class="preprocessor">#if 0</span>
-<a name="l00390"></a>00390 <span class="preprocessor"></span>
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395     t = cpl_table_new(FORS_NUM_FILTER);
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397     <span class="comment">/* Here the order must match fors_data.h: enum filter */</span>
-<a name="l00398"></a>00398     <span class="keywordtype">double</span> *exti[FORS_NUM_FILTER] = {&exti_u,
-<a name="l00399"></a>00399                                      &exti_b,
-<a name="l00400"></a>00400                                      NULL,   <span class="comment">// g</span>
-<a name="l00401"></a>00401                                      &exti_v,
-<a name="l00402"></a>00402                                      &exti_r,
-<a name="l00403"></a>00403                                      &exti_i,
-<a name="l00404"></a>00404                                      NULL};   <span class="comment">// z</span>
-<a name="l00405"></a>00405 
-<a name="l00406"></a>00406     <span class="keywordtype">double</span> *colo[FORS_NUM_FILTER] = {&colo_u,
-<a name="l00407"></a>00407                                      &colo_b,
-<a name="l00408"></a>00408                                      NULL,   <span class="comment">// g</span>
-<a name="l00409"></a>00409                                      &colo_v,
-<a name="l00410"></a>00410                                      &colo_r,
-<a name="l00411"></a>00411                                      &colo_i,
-<a name="l00412"></a>00412                                      NULL};   <span class="comment">// z</span>
-<a name="l00413"></a>00413 
-<a name="l00414"></a>00414     <span class="keywordtype">double</span> *zero[FORS_NUM_FILTER] = {&zero_u,
-<a name="l00415"></a>00415                                      &zero_b,
-<a name="l00416"></a>00416                                      NULL,
-<a name="l00417"></a>00417                                      &zero_v,
-<a name="l00418"></a>00418                                      &zero_r,
-<a name="l00419"></a>00419                                      &zero_i,
-<a name="l00420"></a>00420                                      NULL};
-<a name="l00421"></a>00421 
-<a name="l00422"></a>00422     cpl_table_new_column(t, FORS_DATA_PHOT_FILTER   , CPL_TYPE_STRING);
-<a name="l00423"></a>00423     cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);
-<a name="l00424"></a>00424     cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);
-<a name="l00425"></a>00425     cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);
-<a name="l00426"></a>00426 
-<a name="l00427"></a>00427     <span class="keywordtype">int</span> row = 0;
-<a name="l00428"></a>00428     {
-<a name="l00429"></a>00429         <span class="keywordtype">int</span> i;
-<a name="l00430"></a>00430         <span class="keywordflow">for</span>(i = 0; i < cpl_table_get_nrow(t); i++) {
-<a name="l00431"></a>00431             <span class="keywordflow">if</span> (exti[i] != NULL && colo[i] != NULL && zero[i] != NULL) {
-<a name="l00432"></a>00432                 cpl_table_set_string(t, FORS_DATA_PHOT_FILTER  , row, FORS_DATA_STD_MAG[i]);
-<a name="l00433"></a>00433                 cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF, row, *(exti[i]));
-<a name="l00434"></a>00434                 cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, row, *(colo[i]));
-<a name="l00435"></a>00435                 cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, row, *(zero[i]));
-<a name="l00436"></a>00436                 row++;
-<a name="l00437"></a>00437             }
-<a name="l00438"></a>00438         }
-<a name="l00439"></a>00439     }
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441     CHECK;
-<a name="l00442"></a>00442    
-<a name="l00443"></a>00443     cpl_table_set_size(t, row);
-<a name="l00444"></a>00444 
-<a name="l00445"></a>00445     cpl_table_save(t, NULL, NULL, filename, CPL_IO_DEFAULT);
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447     CHECK;
-<a name="l00448"></a>00448     
-<a name="l00449"></a>00449     fprintf(stdout, <span class="stringliteral">"Created %s\n"</span>, filename);
-<a name="l00450"></a>00450     cpl_table_delete(t);
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452 <span class="preprocessor">#endif</span>
-<a name="l00453"></a>00453 <span class="preprocessor"></span>
-<a name="l00454"></a>00454     <span class="keywordflow">return</span> 0;
-<a name="l00455"></a>00455 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/create__phot_8c_source.html b/html/create__phot_8c_source.html
new file mode 100644
index 0000000..b22c655
--- /dev/null
+++ b/html/create__phot_8c_source.html
@@ -0,0 +1,516 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: create_phot.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">create_phot.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="preprocessor">#include <fors_data.h></span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> </div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> </div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="preprocessor">#include <errno.h></span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> </div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="preprocessor">#define HARDCODED 0 </span><span class="comment">/* create same values as MIDAS? */</span><span class="preprocessor"></span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="preprocessor">#define DIE \</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="preprocessor">    fprintf(stderr, "Error at %s:%d\n", __func__, __LINE__); \</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="preprocessor">    if (errno) perror(NULL); \</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="preprocessor">    cpl_end(); \</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="preprocessor">    exit(EXIT_FAILURE); \</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="preprocessor">#define CHECK \</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="preprocessor">    if (cpl_error_get_code()) { \</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="preprocessor">        cpl_msg_error(cpl_func, "%s %s", cpl_error_get_where(), cpl_error_get_message()); \</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="preprocessor">        DIE; \</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="preprocessor">    } \</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])</div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> {</div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span>     cpl_init(CPL_INIT_DEFAULT);</div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span>     errno = 0;</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span>     <span class="keywordflow">if</span> (argc != 1) {</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span>         fprintf(stderr,</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span>                 <span class="stringliteral">"Usage:\n    %s\n"</span>, argv[0]);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span>         DIE;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>     }</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>     </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>     <span class="comment">/* Numbers and code imported from MIDAS: fspil/pipe/proc/fors_zeropoint.prg */</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>     <span class="comment">// FORS1 data</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="comment">//    if (fors1upgraded == 0) {</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>     <span class="comment">/* Old fors1 */</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     <span class="keywordtype">double</span> exti_old_u =  0.425;  <span class="comment">// Extinction in the U band</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>     <span class="keywordtype">double</span> exti_old_b =  0.245;  <span class="comment">// Extinction in the B band</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>     <span class="keywordtype">double</span> exti_old_v =  0.125;  <span class="comment">// Extinction in the V band</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>     <span class="keywordtype">double</span> exti_old_r =  0.081;  <span class="comment">// Extinction in the R band</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>     <span class="keywordtype">double</span> exti_old_i =  0.038;  <span class="comment">// Extinction in the I band</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>   </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>     <span class="keywordtype">double</span> colo_old_u =  0.067;  <span class="comment">// Color term in the U band</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>     <span class="keywordtype">double</span> colo_old_b = -0.078;  <span class="comment">// Color term in the B band</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>     <span class="keywordtype">double</span> colo_old_v =  0.035;  <span class="comment">// Color term in the V band</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>     <span class="keywordtype">double</span> colo_old_r =  0.042;  <span class="comment">// Color term in the R band</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>     <span class="keywordtype">double</span> colo_old_i = -0.038;  <span class="comment">// Color term in the I band</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     <span class="keywordtype">double</span> exti_old_u_high =  0.000;  <span class="comment">// Extinction in the u band</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     <span class="keywordtype">double</span> exti_old_b_high =  0.000;  <span class="comment">// Extinction in the b band</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <span class="keywordtype">double</span> exti_old_v_high =  0.000;  <span class="comment">// Extinction in the v band</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>     <span class="keywordtype">double</span> exti_old_g_high =  0.000;  <span class="comment">// Extinction in the g band</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     <span class="keywordtype">double</span> colo_old_u_high =  0.000;  <span class="comment">// Color term in the u band</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     <span class="keywordtype">double</span> colo_old_b_high =  0.000;  <span class="comment">// Color term in the b band</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     <span class="keywordtype">double</span> colo_old_v_high =  0.000;  <span class="comment">// Color term in the v band</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordtype">double</span> colo_old_g_high =  0.000;  <span class="comment">// Color term in the g band</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <span class="keywordtype">double</span> zero_old_u = 99.99; <span class="comment">// not available</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     <span class="keywordtype">double</span> zero_old_b = 99.99;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <span class="keywordtype">double</span> zero_old_v = 99.99;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     <span class="keywordtype">double</span> zero_old_r = 99.99;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <span class="keywordtype">double</span> zero_old_i = 99.99;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <span class="keywordtype">double</span> zero_old_g = 99.99;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument;</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>         <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>             <span class="keyword">const</span> <span class="keywordtype">char</span> *base_filename;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>             <span class="keyword">const</span> <span class="keywordtype">char</span> *chip_id;</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>             <span class="keyword">struct </span>{ </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *filtername;</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                 <span class="keyword">enum</span> filter filter;</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                 <span class="keywordtype">double</span> exti, dexti;</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                 <span class="keywordtype">double</span> colo, dcolo;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                 <span class="keywordtype">double</span> zero, dzero;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>             } data[9];</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>         } chips[2];</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     }</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     dat[] = {</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>         <span class="comment">/* Old FORS1 */</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>         {<span class="stringliteral">"FORS1"</span>, </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>          {</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>              {<span class="stringliteral">"fors1_TK"</span>, <span class="stringliteral">"TK2048EB4-1"</span>,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = exti_old_u     , .dexti = 0, .colo = colo_old_u     , .dcolo = 0, .zero = zero_old_u, .dzero = 0},</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = exti_old_u_high, .dexti = 0, .colo = colo_old_u_high, .dcolo = 0, .zero = zero_old_u, .dzero = 0},</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = exti_old_b     , .dexti = 0, .colo = colo_old_b     , .dcolo = 0, .zero = zero_old_b, .dzero = 0},</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = exti_old_b_high, .dexti = 0, .colo = colo_old_b_high, .dcolo = 0, .zero = zero_old_b, .dzero = 0},</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = exti_old_g_high, .dexti = 0, .colo = colo_old_g_high, .dcolo = 0, .zero = zero_old_g, .dzero = 0},</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = exti_old_v     , .dexti = 0, .colo = colo_old_v     , .dcolo = 0, .zero = zero_old_v, .dzero = 0},</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = exti_old_v_high, .dexti = 0, .colo = colo_old_v_high, .dcolo = 0, .zero = zero_old_v, .dzero = 0},</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = exti_old_r     , .dexti = 0, .colo = colo_old_r     , .dcolo = 0, .zero = zero_old_r, .dzero = 0},</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = exti_old_i     , .dexti = 0, .colo = colo_old_i     , .dcolo = 0, .zero = zero_old_i, .dzero = 0}}</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>              },</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>              {NULL, NULL, <span class="comment">/* Not used */</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = exti_old_u     , .dexti = 0, .colo = colo_old_u     , .dcolo = 0, .zero = zero_old_u, .dzero = 0},</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = exti_old_u_high, .dexti = 0, .colo = colo_old_u_high, .dcolo = 0, .zero = zero_old_u, .dzero = 0},</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = exti_old_b     , .dexti = 0, .colo = colo_old_b     , .dcolo = 0, .zero = zero_old_b, .dzero = 0},</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = exti_old_b_high, .dexti = 0, .colo = colo_old_b_high, .dcolo = 0, .zero = zero_old_b, .dzero = 0},</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = exti_old_g_high, .dexti = 0, .colo = colo_old_g_high, .dcolo = 0, .zero = zero_old_g, .dzero = 0},</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = exti_old_v     , .dexti = 0, .colo = colo_old_v     , .dcolo = 0, .zero = zero_old_v, .dzero = 0},</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = exti_old_v_high, .dexti = 0, .colo = colo_old_v_high, .dcolo = 0, .zero = zero_old_v, .dzero = 0},</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = exti_old_r     , .dexti = 0, .colo = colo_old_r     , .dcolo = 0, .zero = zero_old_r, .dzero = 0},</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = exti_old_i     , .dexti = 0, .colo = colo_old_i     , .dcolo = 0, .zero = zero_old_i, .dzero = 0}}</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>              }</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>          }</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>         },</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         <span class="comment">/* New FORS1 */</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">#if HARDCODED</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor"></span>        <span class="comment">/* Old values, hardcoded in MIDAS */</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>         {<span class="stringliteral">"FORS1"</span>, </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>          {</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>              {<span class="stringliteral">"fors1_Norma"</span>, <span class="stringliteral">"Norma III"</span>,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = 0.456, .dexti = 0, .colo =  0.091, .dcolo = 0, .zero = 26.080, .dzero = 0.031},</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = 0.440, .dexti = 0, .colo =  0.106, .dcolo = 0, .zero = 26.572, .dzero = 0.049},</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = 0.255, .dexti = 0, .colo = -0.107, .dcolo = 0, .zero = 28.163, .dzero = 0.023},</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = 0.230, .dexti = 0, .colo =  0.069, .dcolo = 0, .zero = 28.539, .dzero = 0.031},</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = 0.182, .dexti = 0, .colo =  0.031, .dcolo = 0, .zero = 28.867, .dzero = 0.032},</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = 0.132, .dexti = 0, .colo =  0.020, .dcolo = 0, .zero = 28.227, .dzero = 0.023},</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = 0.115, .dexti = 0, .colo =  0.049, .dcolo = 0, .zero = 28.410, .dzero = 0.029},</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = 0.090, .dexti = 0, .colo =  0.000, .dcolo = 0, .zero = 28.024, .dzero = 0.025},</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = 0.051, .dexti = 0, .colo = -0.060, .dcolo = 0, .zero = 27.023, .dzero = 0.034}}</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>              },</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>              {<span class="stringliteral">"fors1_Marlene"</span>, <span class="stringliteral">"Marlene "</span>,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = 0.456, .dexti = 0, .colo =  0.091, .dcolo = 0, .zero = 26.080, .dzero = 0.031},</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = 0.440, .dexti = 0, .colo =  0.106, .dcolo = 0, .zero = 26.572, .dzero = 0.049},</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = 0.255, .dexti = 0, .colo = -0.107, .dcolo = 0, .zero = 28.163, .dzero = 0.023},</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = 0.230, .dexti = 0, .colo =  0.069, .dcolo = 0, .zero = 28.539, .dzero = 0.031},</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = 0.182, .dexti = 0, .colo =  0.031, .dcolo = 0, .zero = 28.867, .dzero = 0.032},</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = 0.132, .dexti = 0, .colo =  0.020, .dcolo = 0, .zero = 28.227, .dzero = 0.023},</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = 0.115, .dexti = 0, .colo =  0.049, .dcolo = 0, .zero = 28.410, .dzero = 0.029},</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = 0.090, .dexti = 0, .colo =  0.000, .dcolo = 0, .zero = 28.024, .dzero = 0.025},</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = 0.051, .dexti = 0, .colo = -0.060, .dcolo = 0, .zero = 27.023, .dzero = 0.034}}</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>              },</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>          }</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>         },</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>         </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>         {<span class="stringliteral">"FORS2"</span>,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>          {</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>              {<span class="stringliteral">"fors2_1453"</span>, <span class="stringliteral">"CCID20-14-5-3"</span>,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>               {{<span class="stringliteral">"U_SPECIAL"</span>, FILTER_U, .exti = 0.443, .dexti = 0, .colo =  0.076, .dcolo = 0, .zero = 24.365, .dzero = 0.045},</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                {<span class="stringliteral">"B_BESS"</span>   , FILTER_B, .exti = 0.217, .dexti = 0, .colo = -0.033, .dcolo = 0, .zero = 27.740, .dzero = 0.032},</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>                {<span class="stringliteral">"V_BESS"</span>   , FILTER_V, .exti = 0.127, .dexti = 0, .colo =  0.022, .dcolo = 0, .zero = 28.186, .dzero = 0.025},</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>                {<span class="stringliteral">"R_SPECIAL"</span>, FILTER_R, .exti = 0.098, .dexti = 0, .colo = -0.009, .dcolo = 0, .zero = 28.404, .dzero = 0.037},</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                {<span class="stringliteral">"I_BESS"</span>   , FILTER_I, .exti = 0.060, .dexti = 0, .colo = -0.017, .dcolo = 0, .zero = 27.773, .dzero = 0.034},</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>              },</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>              </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>              {<span class="stringliteral">"fors2_1456"</span>, <span class="stringliteral">"CCID20-14-5-6"</span>,</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>               {{<span class="stringliteral">"U_SPECIAL"</span>, FILTER_U, .exti = 0.443, .dexti = 0, .colo =  0.076, .dcolo = 0, .zero = 24.365, .dzero = 0.045},</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                {<span class="stringliteral">"B_BESS"</span>   , FILTER_B, .exti = 0.217, .dexti = 0, .colo = -0.033, .dcolo = 0, .zero = 27.740, .dzero = 0.032},</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                {<span class="stringliteral">"V_BESS"</span>   , FILTER_V, .exti = 0.127, .dexti = 0, .colo =  0.022, .dcolo = 0, .zero = 28.186, .dzero = 0.025},</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>                {<span class="stringliteral">"R_SPECIAL"</span>, FILTER_R, .exti = 0.098, .dexti = 0, .colo = -0.009, .dcolo = 0, .zero = 28.404, .dzero = 0.037},</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>                {<span class="stringliteral">"I_BESS"</span>   , FILTER_I, .exti = 0.060, .dexti = 0, .colo = -0.017, .dcolo = 0, .zero = 27.773, .dzero = 0.034},</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>              }</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>          }</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>         }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="preprocessor"></span>        <span class="comment">/* Numbers from P79 as provided by DFO */</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         {<span class="stringliteral">"FORS1"</span>, </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>          {</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>              {<span class="stringliteral">"fors1_Norma"</span>, <span class="stringliteral">"Norma III"</span>,</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = 0.447, .dexti = 0.018, .colo =  0.043, .dcolo = 0.008, .zero = 26.080, .dzero = 0.031},</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = 0.437, .dexti = 0.033, .colo =  0.066, .dcolo = 0.012, .zero = 26.572, .dzero = 0.049},</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = 0.241, .dexti = 0.013, .colo = -0.128, .dcolo = 0.008, .zero = 28.163, .dzero = 0.023},</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = 0.222, .dexti = 0.020, .colo =  0.048, .dcolo = 0.009, .zero = 28.539, .dzero = 0.031},</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = 0.209, .dexti = 0.022, .colo = -0.096, .dcolo = 0.008, .zero = 28.867, .dzero = 0.032},</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = 0.112, .dexti = 0.012, .colo = -0.015, .dcolo = 0.007, .zero = 28.227, .dzero = 0.023},</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = 0.139, .dexti = 0.018, .colo =  0.019, .dcolo = 0.008, .zero = 28.410, .dzero = 0.029},</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = 0.087, .dexti = 0.014, .colo = -0.097, .dcolo = 0.015, .zero = 28.024, .dzero = 0.025},</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = 0.027, .dexti = 0.021, .colo = -0.101, .dcolo = 0.011, .zero = 27.023, .dzero = 0.034}}</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>              },</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>              {<span class="stringliteral">"fors1_Marlene"</span>, <span class="stringliteral">"Marlene "</span>,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>               {{<span class="stringliteral">"U_BESS"</span>, FILTER_U, .exti = 0.470, .dexti = 0.024, .colo =  0.039, .dcolo = 0.013, .zero = 26.069, .dzero = 0.041},</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                {<span class="stringliteral">"u_HIGH"</span>, FILTER_U, .exti = 0.445, .dexti = 0.051, .colo =  0.063, .dcolo = 0.018, .zero = 26.548, .dzero = 0.070},</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                {<span class="stringliteral">"B_BESS"</span>, FILTER_B, .exti = 0.316, .dexti = 0.019, .colo = -0.124, .dcolo = 0.012, .zero = 28.221, .dzero = 0.032},</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                {<span class="stringliteral">"b_HIGH"</span>, FILTER_B, .exti = 0.282, .dexti = 0.036, .colo =  0.059, .dcolo = 0.016, .zero = 28.563, .dzero = 0.052},</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                {<span class="stringliteral">"g_HIGH"</span>, FILTER_G, .exti = 0.287, .dexti = 0.063, .colo = -0.106, .dcolo = 0.019, .zero = 28.938, .dzero = 0.082},</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                {<span class="stringliteral">"V_BESS"</span>, FILTER_V, .exti = 0.158, .dexti = 0.018, .colo = -0.011, .dcolo = 0.012, .zero = 28.247, .dzero = 0.033},</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                {<span class="stringliteral">"v_HIGH"</span>, FILTER_V, .exti = 0.155, .dexti = 0.030, .colo =  0.019, .dcolo = 0.014, .zero = 28.388, .dzero = 0.046},</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                {<span class="stringliteral">"R_BESS"</span>, FILTER_R, .exti = 0.111, .dexti = 0.018, .colo = -0.047, .dcolo = 0.022, .zero = 28.009, .dzero = 0.033},</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                {<span class="stringliteral">"I_BESS"</span>, FILTER_I, .exti = 0.037, .dexti = 0.019, .colo = -0.100, .dcolo = 0.012, .zero = 27.038, .dzero = 0.035}}</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>              },</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>          }</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>         },</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>         {<span class="stringliteral">"FORS2"</span>,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>          {</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>              {<span class="stringliteral">"fors2_1453"</span>, <span class="stringliteral">"CCID20-14-5-3"</span>,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>               {{<span class="stringliteral">"U_SPECIAL"</span>, FILTER_U, .exti = 0.531, .dexti = 0.025, .colo =  0.069, .dcolo = 0.009, .zero = 24.365, .dzero = 0.045},</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>                {<span class="stringliteral">"B_BESS"</span>   , FILTER_B, .exti = 0.236, .dexti = 0.015, .colo = -0.026, .dcolo = 0.009, .zero = 27.740, .dzero = 0.032},</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>                {<span class="stringliteral">"V_BESS"</span>   , FILTER_V, .exti = 0.117, .dexti = 0.012, .colo = -0.002, .dcolo = 0.006, .zero = 28.186, .dzero = 0.025},</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>                {<span class="stringliteral">"R_SPECIAL"</span>, FILTER_R, .exti = 0.067, .dexti = 0.020, .colo = -0.039, .dcolo = 0.016, .zero = 28.404, .dzero = 0.037},</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                {<span class="stringliteral">"I_BESS"</span>   , FILTER_I, .exti = 0.049, .dexti = 0.016, .colo = -0.044, .dcolo = 0.007, .zero = 27.773, .dzero = 0.034},</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>              },</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>              </div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>              {<span class="stringliteral">"fors2_1456"</span>, <span class="stringliteral">"CCID20-14-5-6"</span>,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>               {{<span class="stringliteral">"U_SPECIAL"</span>, FILTER_U, .exti = 0.526, .dexti = 0.042, .colo =  0.067, .dcolo = 0.014, .zero = 24.476, .dzero = 0.066},</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                {<span class="stringliteral">"B_BESS"</span>   , FILTER_B, .exti = 0.272, .dexti = 0.023, .colo = -0.062, .dcolo = 0.011, .zero = 27.837, .dzero = 0.040},</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                {<span class="stringliteral">"V_BESS"</span>   , FILTER_V, .exti = 0.123, .dexti = 0.014, .colo = -0.008, .dcolo = 0.006, .zero = 28.207, .dzero = 0.028},</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>                {<span class="stringliteral">"R_SPECIAL"</span>, FILTER_R, .exti = 0.065, .dexti = 0.022, .colo = -0.036, .dcolo = 0.013, .zero = 28.400, .dzero = 0.037},</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>                {<span class="stringliteral">"I_BESS"</span>   , FILTER_I, .exti = 0.023, .dexti = 0.013, .colo = -0.080, .dcolo = 0.008, .zero = 27.777, .dzero = 0.039},</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0},</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                {NULL , FILTER_I, 0, 0, 0, 0, 0, 0}}</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>              }</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>          }</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>         }</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> <span class="preprocessor"></span>    };</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     </div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     CHECK;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="preprocessor">#if 1</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     <span class="comment">/* For each instrument */</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     <span class="keywordtype">unsigned</span> i;</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="keywordflow">for</span>(i = 0; i < <span class="keyword">sizeof</span>(dat) / <span class="keyword">sizeof</span>(*dat); i++) {</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>         </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>         <span class="comment">/* For each chip */</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>         <span class="keywordtype">unsigned</span> chips;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>         <span class="keywordflow">for</span>(chips = 0; </div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>             chips < <span class="keyword">sizeof</span>(dat[i].chips) / <span class="keyword">sizeof</span>(*dat[i].chips); </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>             chips++) {</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>             </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>             <span class="keywordflow">if</span> (dat[i].chips[chips].chip_id == NULL) <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>             </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>             cpl_table *t = cpl_table_new(9999);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>             <span class="keywordtype">int</span> size = 0;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>         </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>             cpl_propertylist *header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>         </div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>             cpl_propertylist_update_string(header, FORS_PFITS_CHIP_ID, dat[i].chips[chips].chip_id);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>             cpl_propertylist_update_string(header, <span class="stringliteral">"ESO PRO CATG"</span>, PHOT_TABLE);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>             cpl_propertylist_update_string(header, FORS_PFITS_INSTRUME, dat[i].instrument);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>             <span class="comment">//cpl_table_new_column(t, "Instrument" , CPL_TYPE_STRING);</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>             <span class="comment">//cpl_table_new_column(t, "Chip" , CPL_TYPE_STRING);</span></div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>             cpl_table_new_column(t, FORS_DATA_PHOT_FILTER , CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>             cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>             cpl_table_new_column(t, FORS_DATA_PHOT_DEXTCOEFF , CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>             cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>             cpl_table_new_column(t, FORS_DATA_PHOT_DCOLORTERM, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>             cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>             cpl_table_new_column(t, FORS_DATA_PHOT_DZEROPOINT, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>         </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>       </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>             <span class="comment">/* For each filter */</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>             <span class="keywordtype">unsigned</span> j;</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>             <span class="keywordflow">for</span>(j = 0; </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>                 j < <span class="keyword">sizeof</span>(dat[i].chips[chips].data) / <span class="keyword">sizeof</span>(*dat[i].chips[chips].data); </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>                 j++)</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>                 {            </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>                     <span class="keywordflow">if</span> (dat[i].chips[chips].data[j].filtername == NULL) <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>                            </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>                     <span class="comment">//cpl_table_set_string(t, "Instrument", size, dat[i].instrument);</span></div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>                     <span class="comment">//cpl_table_set_string(t, "Chip", size, dat[i].chips[chips].chip_id);</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>                     cpl_table_set_string(t, FORS_DATA_PHOT_FILTER, size, dat[i].chips[chips].data[j].filtername);</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                     cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF , size, </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>                                          dat[i].chips[chips].data[j].exti);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                     cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, size, </div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                                          dat[i].chips[chips].data[j].colo);</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                     cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, size,</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                                          dat[i].chips[chips].data[j].zero);</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                     cpl_table_set_double(t, FORS_DATA_PHOT_DEXTCOEFF , size, </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                                          dat[i].chips[chips].data[j].dexti);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                     cpl_table_set_double(t, FORS_DATA_PHOT_DCOLORTERM, size, </div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                                          dat[i].chips[chips].data[j].dcolo);</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                     cpl_table_set_double(t, FORS_DATA_PHOT_DZEROPOINT, size,</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                                          dat[i].chips[chips].data[j].dzero);</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                     </div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                     size++;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                 }</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>             </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>             cpl_table_set_size(t, size);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>             <span class="comment">//cpl_table_dump(t, 0, size, stdout);</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> <span class="preprocessor">#if HARDCODED</span></div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> <span class="preprocessor"></span>            <span class="keyword">const</span> <span class="keywordtype">char</span> *full_filename = cpl_sprintf(<span class="stringliteral">"%s_phot_old.fits"</span>, </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>                                                     dat[i].chips[chips].base_filename);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> <span class="preprocessor"></span>            <span class="keyword">const</span> <span class="keywordtype">char</span> *full_filename = cpl_sprintf(<span class="stringliteral">"%s_phot.fits"</span>, </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                                                     dat[i].chips[chips].base_filename);</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> <span class="preprocessor"></span>            </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>             cpl_table_save(t, header, NULL, full_filename, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>             </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>             CHECK;  </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>             fprintf(stdout, <span class="stringliteral">"Created %s\n"</span>, full_filename);</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> </div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>             cpl_table_delete(t); t = NULL;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>             cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>             cpl_free((<span class="keywordtype">void</span> *)full_filename);</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>         }  </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     }</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> <span class="preprocessor">#else </span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> <span class="preprocessor"></span>    <span class="comment">/* One big table */</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> </div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     cpl_table *t = cpl_table_new(9999);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="keywordtype">int</span> size = 0;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     cpl_propertylist *header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>                 </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     cpl_table_new_column(t, <span class="stringliteral">"Instrument"</span> , CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     cpl_table_new_column(t, FORS_DATA_PHOT_FILTER , CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     cpl_table_new_column(t, <span class="stringliteral">"Chip"</span> , CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordtype">unsigned</span> i;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordflow">for</span>(i = 0; i < <span class="keyword">sizeof</span>(dat) / <span class="keyword">sizeof</span>(*dat); i++) {</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>         </div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         <span class="keywordtype">unsigned</span> j;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>         <span class="keywordflow">for</span>(j = 0; </div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>             j < <span class="keyword">sizeof</span>(dat[i].chips[chips].data) / <span class="keyword">sizeof</span>(*dat[i].chips[chips].data); </div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>             j++) {</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>             </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>             <span class="keywordflow">if</span> (dat[i].chips[chips].data[j].filtername == NULL) <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>             </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>             </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>             <span class="keywordtype">unsigned</span> chips;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>             <span class="keywordflow">for</span>(chips = 0; </div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>                 chips < <span class="keyword">sizeof</span>(dat[i].chip_id) / <span class="keyword">sizeof</span>(*dat[i].chip_id); </div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>                 chips++) {</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>                 </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                 <span class="keywordflow">if</span> (dat[i].chip_id[chips] == NULL) <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>                 </div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>                 cpl_table_set_string(t, <span class="stringliteral">"Instrument"</span>, size, dat[i].instrument);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>                 cpl_table_set_string(t, <span class="stringliteral">"Chip"</span>, size, dat[i].chip_id[chips]);</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>                 cpl_table_set_string(t, FORS_DATA_PHOT_FILTER, size, dat[i].chips[chips].data[j].filtername);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF , size, </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>                                      dat[i].chips[chips].data[j].exti);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, size, </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                                      dat[i].chips[chips].data[j].colo);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, size,</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                                      dat[i].chips[chips].data[j].zero);</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                 </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                 size++;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>                 <span class="comment">//cpl_table_dump(t, 0, size, stdout);</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>             }</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>         }</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     }</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     </div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     cpl_table_set_size(t, size);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> </div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     cpl_table_save(t, NULL, NULL, filename, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> </div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     CHECK;  </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     fprintf(stdout, <span class="stringliteral">"Created %s\n"</span>, filename);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> </div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> </div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> </div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="preprocessor">#if 0</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     t = cpl_table_new(FORS_NUM_FILTER);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     <span class="comment">/* Here the order must match fors_data.h: enum filter */</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="keywordtype">double</span> *exti[FORS_NUM_FILTER] = {&exti_u,</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>                                      &exti_b,</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>                                      NULL,   <span class="comment">// g</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>                                      &exti_v,</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>                                      &exti_r,</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>                                      &exti_i,</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>                                      NULL};   <span class="comment">// z</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     <span class="keywordtype">double</span> *colo[FORS_NUM_FILTER] = {&colo_u,</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>                                      &colo_b,</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                                      NULL,   <span class="comment">// g</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>                                      &colo_v,</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                                      &colo_r,</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>                                      &colo_i,</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>                                      NULL};   <span class="comment">// z</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> </div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     <span class="keywordtype">double</span> *zero[FORS_NUM_FILTER] = {&zero_u,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                                      &zero_b,</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>                                      NULL,</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>                                      &zero_v,</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>                                      &zero_r,</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>                                      &zero_i,</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                                      NULL};</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> </div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     cpl_table_new_column(t, FORS_DATA_PHOT_FILTER   , CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> </div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     <span class="keywordtype">int</span> row = 0;</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     {</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>         <span class="keywordflow">for</span>(i = 0; i < cpl_table_get_nrow(t); i++) {</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>             <span class="keywordflow">if</span> (exti[i] != NULL && colo[i] != NULL && zero[i] != NULL) {</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>                 cpl_table_set_string(t, FORS_DATA_PHOT_FILTER  , row, FORS_DATA_STD_MAG[i]);</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF, row, *(exti[i]));</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, row, *(colo[i]));</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, row, *(zero[i]));</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                 row++;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>             }</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>         }</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     }</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     CHECK;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>    </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     cpl_table_set_size(t, row);</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> </div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     cpl_table_save(t, NULL, NULL, filename, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> </div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     CHECK;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     </div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     fprintf(stdout, <span class="stringliteral">"Created %s\n"</span>, filename);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     cpl_table_delete(t);</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> </div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/create__stetson_8c-source.html b/html/create__stetson_8c-source.html
deleted file mode 100644
index add9264..0000000
--- a/html/create__stetson_8c-source.html
+++ /dev/null
@@ -1,247 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: create_stetson.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>create_stetson.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include<cpl.h></span>
-<a name="l00002"></a>00002 
-<a name="l00003"></a>00003 <span class="preprocessor">#include<stdio.h></span>
-<a name="l00004"></a>00004 <span class="preprocessor">#include<string.h></span>
-<a name="l00005"></a>00005 <span class="preprocessor">#include<errno.h></span>
-<a name="l00006"></a>00006 
-<a name="l00007"></a>00007 <span class="comment">/*</span>
-<a name="l00008"></a>00008 <span class="comment">   This program creates a standard star FITS table from Stetson's list of ASCII data</span>
-<a name="l00009"></a>00009 <span class="comment"></span>
-<a name="l00010"></a>00010 <span class="comment"></span>
-<a name="l00011"></a>00011 <span class="comment">  Usage</span>
-<a name="l00012"></a>00012 <span class="comment"></span>
-<a name="l00013"></a>00013 <span class="comment">  1. Get all Stetson  *.pho and *.pos files</span>
-<a name="l00014"></a>00014 <span class="comment">  2. Filter out headers, append to single file:</span>
-<a name="l00015"></a>00015 <span class="comment">        $ cat *.pho | grep -v "vary?"   > stetson.pho</span>
-<a name="l00016"></a>00016 <span class="comment">        $ cat *.pos | grep -v Reference > stetson.pos</span>
-<a name="l00017"></a>00017 <span class="comment">  3. Convert to FITS</span>
-<a name="l00018"></a>00018 <span class="comment">        $ create_stetson_fits stetson.pho stetson.pos stetson.fits</span>
-<a name="l00019"></a>00019 <span class="comment">     This program will verify that the object names in the 2 ASCII </span>
-<a name="l00020"></a>00020 <span class="comment">     files match row by row .</span>
-<a name="l00021"></a>00021 <span class="comment"></span>
-<a name="l00022"></a>00022 <span class="comment">*/</span>
-<a name="l00023"></a>00023 
-<a name="l00024"></a>00024 <span class="comment">/*</span>
-<a name="l00025"></a>00025 <span class="comment">  This research used the facilities of the Canadian Astronomy Data Centre operated</span>
-<a name="l00026"></a>00026 <span class="comment">  by the National Research Council of Canada with the support of the Canadian Space Agency.</span>
-<a name="l00027"></a>00027 <span class="comment">*/</span>
-<a name="l00028"></a>00028 
-<a name="l00029"></a>00029 <span class="preprocessor">#define DIE \</span>
-<a name="l00030"></a>00030 <span class="preprocessor">do { \</span>
-<a name="l00031"></a>00031 <span class="preprocessor">    fprintf(stderr, "Error at %s:%d\n", __func__, __LINE__); \</span>
-<a name="l00032"></a>00032 <span class="preprocessor">    if (errno) perror(NULL); \</span>
-<a name="l00033"></a>00033 <span class="preprocessor">    cpl_end(); \</span>
-<a name="l00034"></a>00034 <span class="preprocessor">    exit(EXIT_FAILURE); \</span>
-<a name="l00035"></a>00035 <span class="preprocessor">} while (0)</span>
-<a name="l00036"></a>00036 <span class="preprocessor"></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#define CHECK \</span>
-<a name="l00038"></a>00038 <span class="preprocessor">do { \</span>
-<a name="l00039"></a>00039 <span class="preprocessor">    if (cpl_error_get_code()) { \</span>
-<a name="l00040"></a>00040 <span class="preprocessor">        cpl_msg_error(cpl_func, "%s", cpl_error_get_where()); \</span>
-<a name="l00041"></a>00041 <span class="preprocessor">        DIE; \</span>
-<a name="l00042"></a>00042 <span class="preprocessor">    } \</span>
-<a name="l00043"></a>00043 <span class="preprocessor">} while (0)</span>
-<a name="l00044"></a>00044 <span class="preprocessor"></span>
-<a name="l00045"></a>00045 <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])
-<a name="l00046"></a>00046 {
-<a name="l00047"></a>00047     cpl_table *table;
-<a name="l00048"></a>00048     <span class="keywordtype">int</span> size = 0;
-<a name="l00049"></a>00049     <span class="keyword">const</span> <span class="keywordtype">int</span> maxsize = 100*1000;
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051     cpl_init(CPL_INIT_DEFAULT);
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053     <span class="keywordflow">if</span> (argc != 4) {
-<a name="l00054"></a>00054         fprintf(stderr,
-<a name="l00055"></a>00055                 <span class="stringliteral">"Usage:\n    %s  [stetson.pho] [stetson.pos]  [stetson.fits]\n"</span>, argv[0]);
-<a name="l00056"></a>00056         DIE;
-<a name="l00057"></a>00057     }
-<a name="l00058"></a>00058     
-<a name="l00059"></a>00059     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_pho = argv[1];
-<a name="l00060"></a>00060     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_pos = argv[2];
-<a name="l00061"></a>00061     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_out = argv[3];
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063     table = cpl_table_new(maxsize);
-<a name="l00064"></a>00064     CHECK;
-<a name="l00065"></a>00065     
-<a name="l00066"></a>00066     <span class="keyword">struct </span>{
-<a name="l00067"></a>00067         <span class="keyword">const</span> <span class="keywordtype">char</span> *colname;
-<a name="l00068"></a>00068         cpl_type type;
-<a name="l00069"></a>00069         <span class="keyword">const</span> <span class="keywordtype">char</span> *unit;
-<a name="l00070"></a>00070     } data[] = {
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072         {<span class="stringliteral">"OBJECT"</span>, CPL_TYPE_STRING, NULL},
-<a name="l00073"></a>00073 
-<a name="l00074"></a>00074         {<span class="stringliteral">"RA"</span> , CPL_TYPE_DOUBLE, <span class="stringliteral">"degree"</span>},
-<a name="l00075"></a>00075         {<span class="stringliteral">"DEC"</span>, CPL_TYPE_DOUBLE, <span class="stringliteral">"degree"</span>},
-<a name="l00076"></a>00076 
-<a name="l00077"></a>00077         <span class="comment">/* estimated intrinsic variability in magnitude RMS */</span>
-<a name="l00078"></a>00078         {<span class="stringliteral">"VAR"</span>, CPL_TYPE_FLOAT, <span class="stringliteral">"mag rms"</span>},
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080         <span class="comment">/*  B:     magnitude */</span>
-<a name="l00081"></a>00081         <span class="comment">/*  ERR_B: magnitude error */</span>
-<a name="l00082"></a>00082         <span class="comment">/*  N_B:   number of observations obtained on photometric occasions */</span>
-<a name="l00083"></a>00083         <span class="comment">/*  n_B:   total number of observations */</span>
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085         {<span class="stringliteral">"B"</span>    , CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},
-<a name="l00086"></a>00086         {<span class="stringliteral">"ERR_B"</span>, CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},
-<a name="l00087"></a>00087         {<span class="stringliteral">"N_B"</span>  , CPL_TYPE_INT, NULL},
-<a name="l00088"></a>00088         {<span class="stringliteral">"n_B"</span>  , CPL_TYPE_INT, NULL},
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090         {<span class="stringliteral">"V"</span>    , CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},
-<a name="l00091"></a>00091         {<span class="stringliteral">"ERR_V"</span>, CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},
-<a name="l00092"></a>00092         {<span class="stringliteral">"N_V"</span>  , CPL_TYPE_INT, NULL},
-<a name="l00093"></a>00093         {<span class="stringliteral">"n_V"</span>  , CPL_TYPE_INT, NULL},
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095         {<span class="stringliteral">"R"</span>    , CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},
-<a name="l00096"></a>00096         {<span class="stringliteral">"ERR_R"</span>, CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},
-<a name="l00097"></a>00097         {<span class="stringliteral">"N_R"</span>  , CPL_TYPE_INT, NULL},
-<a name="l00098"></a>00098         {<span class="stringliteral">"n_R"</span>  , CPL_TYPE_INT, NULL},
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100         {<span class="stringliteral">"I"</span>    , CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},
-<a name="l00101"></a>00101         {<span class="stringliteral">"ERR_I"</span>, CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},
-<a name="l00102"></a>00102         {<span class="stringliteral">"N_I"</span>  , CPL_TYPE_INT, NULL},
-<a name="l00103"></a>00103         {<span class="stringliteral">"n_I"</span>  , CPL_TYPE_INT, NULL}
-<a name="l00104"></a>00104         
-<a name="l00105"></a>00105     };
-<a name="l00106"></a>00106     
-<a name="l00107"></a>00107     {
-<a name="l00108"></a>00108         <span class="keywordtype">unsigned</span> i;
-<a name="l00109"></a>00109         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(data) / <span class="keyword">sizeof</span>(*data); i++) {
-<a name="l00110"></a>00110             cpl_table_new_column     (table, data[i].colname, data[i].type);
-<a name="l00111"></a>00111             <span class="keywordflow">if</span> (data[i].unit != NULL) {
-<a name="l00112"></a>00112                 cpl_table_set_column_unit(table, data[i].colname, data[i].unit);
-<a name="l00113"></a>00113             }
-<a name="l00114"></a>00114         }
-<a name="l00115"></a>00115     }
-<a name="l00116"></a>00116     CHECK;
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118     {
-<a name="l00119"></a>00119         <span class="keywordtype">char</span> name_pho[1000];
-<a name="l00120"></a>00120         <span class="keywordtype">char</span> name_pos[1000];
-<a name="l00121"></a>00121         <span class="keywordtype">float</span> mag[5];
-<a name="l00122"></a>00122         <span class="keywordtype">float</span> err[5];
-<a name="l00123"></a>00123         <span class="keywordtype">int</span> N[5];
-<a name="l00124"></a>00124         <span class="keywordtype">int</span> n[5];
-<a name="l00125"></a>00125         <span class="keywordtype">float</span> var;
-<a name="l00126"></a>00126         <span class="keywordtype">float</span> dummy;
-<a name="l00127"></a>00127         <span class="keywordtype">int</span> items_assigned;
-<a name="l00128"></a>00128 
-<a name="l00129"></a>00129         FILE *file_pho = fopen(filename_pho, <span class="stringliteral">"r"</span>);
-<a name="l00130"></a>00130         FILE *file_pos = fopen(filename_pos, <span class="stringliteral">"r"</span>);
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132         <span class="keywordflow">if</span> (file_pho == NULL) DIE;
-<a name="l00133"></a>00133         <span class="keywordflow">if</span> (file_pos == NULL) DIE;
-<a name="l00134"></a>00134         
-<a name="l00135"></a>00135         size = 0;
-<a name="l00136"></a>00136         <span class="keywordflow">while</span>((items_assigned = fscanf(file_pho, 
-<a name="l00137"></a>00137                                        <span class="stringliteral">"%s"</span>
-<a name="l00138"></a>00138                                        <span class="stringliteral">"%f %f %d %d "</span>
-<a name="l00139"></a>00139                                        <span class="stringliteral">"%f %f %d %d "</span>
-<a name="l00140"></a>00140                                        <span class="stringliteral">"%f %f %d %d "</span>
-<a name="l00141"></a>00141                                        <span class="stringliteral">"%f %f %d %d "</span>
-<a name="l00142"></a>00142                                        <span class="stringliteral">"%f"</span>,
-<a name="l00143"></a>00143                                        name_pho, 
-<a name="l00144"></a>00144                                        &mag[0], &err[0], &N[0], &n[0],
-<a name="l00145"></a>00145                                        &mag[1], &err[1], &N[1], &n[1],
-<a name="l00146"></a>00146                                        &mag[2], &err[2], &N[2], &n[2],
-<a name="l00147"></a>00147                                        &mag[3], &err[3], &N[3], &n[3], &var))
-<a name="l00148"></a>00148               != EOF) {
-<a name="l00149"></a>00149             <span class="keywordtype">double</span> ra, dec;
-<a name="l00150"></a>00150             <span class="keywordtype">int</span> i;
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152             printf(<span class="stringliteral">"%d: %s "</span>, items_assigned, name_pho);
-<a name="l00153"></a>00153             printf(<span class="stringliteral">"%f %f %d %d "</span>, mag[0], err[0], N[0], n[0]);
-<a name="l00154"></a>00154             printf(<span class="stringliteral">"%f %f %d %d "</span>, mag[1], err[1], N[1], n[1]);
-<a name="l00155"></a>00155             printf(<span class="stringliteral">"%f %f %d %d "</span>, mag[2], err[2], N[2], n[2]);
-<a name="l00156"></a>00156             printf(<span class="stringliteral">"%f %f %d %d "</span>, mag[3], err[3], N[3], n[3]);
-<a name="l00157"></a>00157             printf(<span class="stringliteral">"%f "</span>, var);
-<a name="l00158"></a>00158                 
-<a name="l00159"></a>00159             <span class="keywordflow">if</span> (items_assigned != 18) DIE;
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162             <span class="comment">/* Read RA, DEC */</span>
-<a name="l00163"></a>00163             <span class="keywordflow">if</span> (fscanf(file_pos,
-<a name="l00164"></a>00164                        <span class="stringliteral">"%lf %lf "</span>
-<a name="l00165"></a>00165                        <span class="stringliteral">"%f %f %f "</span>
-<a name="l00166"></a>00166                        <span class="stringliteral">"%f %f %f "</span>
-<a name="l00167"></a>00167                        <span class="stringliteral">"%f %f %f %f "</span>
-<a name="l00168"></a>00168                        <span class="stringliteral">"%s"</span>,
-<a name="l00169"></a>00169                        &ra, &dec,
-<a name="l00170"></a>00170                        &dummy, &dummy, &dummy, <span class="comment">//hexagesimal RA</span>
-<a name="l00171"></a>00171                        &dummy, &dummy, &dummy, <span class="comment">//hexagesimal DEC</span>
-<a name="l00172"></a>00172                        &dummy, &dummy, &dummy, &dummy,  <span class="comment">//offset in arcsecs, pixels</span>
-<a name="l00173"></a>00173                        name_pos) != 13) DIE;
-<a name="l00174"></a>00174                        
-<a name="l00175"></a>00175             printf(<span class="stringliteral">"%s (%f, %f)"</span>, name_pos, ra, dec);
-<a name="l00176"></a>00176             printf(<span class="stringliteral">"\n"</span>);
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178             <span class="keywordflow">if</span> (strcmp(name_pho, name_pos) != 0) {
-<a name="l00179"></a>00179                 fprintf(stderr, <span class="stringliteral">"Mismatching OBJECT name: %s (pho), %s (pos)\n"</span>,
-<a name="l00180"></a>00180                         name_pho, name_pos);
-<a name="l00181"></a>00181                 DIE;                
-<a name="l00182"></a>00182             }
-<a name="l00183"></a>00183             
-<a name="l00184"></a>00184             cpl_table_set_string(table, data[0].colname, size, name_pho);
-<a name="l00185"></a>00185             cpl_table_set_double(table, data[1].colname, size, ra);
-<a name="l00186"></a>00186             cpl_table_set_double(table, data[2].colname, size, dec);
-<a name="l00187"></a>00187             cpl_table_set_float (table, data[3].colname, size, var);
-<a name="l00188"></a>00188             
-<a name="l00189"></a>00189             <span class="keywordflow">for</span> (i = 0; i < 4; i++) {
-<a name="l00190"></a>00190                 <span class="comment">/* zero or two of N and n must be zero */</span>
-<a name="l00191"></a>00191                 <span class="keywordflow">if</span> (N[i] == 0 && n[i] != 0) DIE;
-<a name="l00192"></a>00192                 <span class="keywordflow">if</span> (N[i] != 0 && n[i] == 0) DIE;
-<a name="l00193"></a>00193                 
-<a name="l00194"></a>00194                 <span class="keywordflow">if</span> (N[i] != 0) {
-<a name="l00195"></a>00195                     cpl_table_set_float (table, data[i*4+4].colname, size, mag[i]);
-<a name="l00196"></a>00196                     cpl_table_set_float (table, data[i*4+5].colname, size, err[i]);
-<a name="l00197"></a>00197                     cpl_table_set_int   (table, data[i*4+6].colname, size,   N[i]);
-<a name="l00198"></a>00198                     cpl_table_set_int   (table, data[i*4+7].colname, size,   n[i]);
-<a name="l00199"></a>00199                 } <span class="keywordflow">else</span> {
-<a name="l00200"></a>00200                     cpl_table_set_invalid(table, data[i*4+4].colname, size);
-<a name="l00201"></a>00201                     cpl_table_set_invalid(table, data[i*4+5].colname, size);
-<a name="l00202"></a>00202                     cpl_table_set_invalid(table, data[i*4+6].colname, size);
-<a name="l00203"></a>00203                     cpl_table_set_invalid(table, data[i*4+7].colname, size);
-<a name="l00204"></a>00204                 }
-<a name="l00205"></a>00205             }
-<a name="l00206"></a>00206             size++;
-<a name="l00207"></a>00207         }
-<a name="l00208"></a>00208         fclose(file_pho);
-<a name="l00209"></a>00209 
-<a name="l00210"></a>00210         fclose(file_pos);
-<a name="l00211"></a>00211     }
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213 
-<a name="l00214"></a>00214     CHECK;
-<a name="l00215"></a>00215 
-<a name="l00216"></a>00216     cpl_table_set_size(table, size);
-<a name="l00217"></a>00217    
-<a name="l00218"></a>00218     cpl_table_save(table, NULL, NULL, filename_out, CPL_IO_DEFAULT);
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     CHECK;
-<a name="l00221"></a>00221     
-<a name="l00222"></a>00222     fprintf(stdout, <span class="stringliteral">"Created %s\n"</span>, filename_out);
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224     <span class="keywordflow">return</span> 0;
-<a name="l00225"></a>00225 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/create__stetson_8c_source.html b/html/create__stetson_8c_source.html
new file mode 100644
index 0000000..3d47931
--- /dev/null
+++ b/html/create__stetson_8c_source.html
@@ -0,0 +1,286 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: create_stetson.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">create_stetson.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="preprocessor">#include<cpl.h></span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> </div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="preprocessor">#include<stdio.h></span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="preprocessor">#include<string.h></span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="preprocessor">#include<errno.h></span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> </div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment">   This program creates a standard star FITS table from Stetson's list of ASCII data</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"></span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"></span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment">  Usage</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"></span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment">  1. Get all Stetson  *.pho and *.pos files</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment">  2. Filter out headers, append to single file:</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment">        $ cat *.pho | grep -v "vary?"   > stetson.pho</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment">        $ cat *.pos | grep -v Reference > stetson.pos</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment">  3. Convert to FITS</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment">        $ create_stetson_fits stetson.pho stetson.pos stetson.fits</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment">     This program will verify that the object names in the 2 ASCII </span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> <span class="comment">     files match row by row .</span></div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment"></span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> </div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment">  This research used the facilities of the Canadian Astronomy Data Centre operated</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment">  by the National Research Council of Canada with the support of the Canadian Space Agency.</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> </div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor">#define DIE \</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">    fprintf(stderr, "Error at %s:%d\n", __func__, __LINE__); \</span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">    if (errno) perror(NULL); \</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">    cpl_end(); \</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">    exit(EXIT_FAILURE); \</span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#define CHECK \</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">    if (cpl_error_get_code()) { \</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">        cpl_msg_error(cpl_func, "%s", cpl_error_get_where()); \</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">        DIE; \</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">    } \</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> {</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     cpl_table *table;</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>     <span class="keywordtype">int</span> size = 0;</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> maxsize = 100*1000;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>     cpl_init(CPL_INIT_DEFAULT);</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>     <span class="keywordflow">if</span> (argc != 4) {</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>         fprintf(stderr,</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>                 <span class="stringliteral">"Usage:\n    %s  [stetson.pho] [stetson.pos]  [stetson.fits]\n"</span>, argv[0]);</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>         DIE;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>     }</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>     </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_pho = argv[1];</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_pos = argv[2];</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_out = argv[3];</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     table = cpl_table_new(maxsize);</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     CHECK;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *colname;</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>         cpl_type type;</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *unit;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     } data[] = {</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>         {<span class="stringliteral">"OBJECT"</span>, CPL_TYPE_STRING, NULL},</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> </div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>         {<span class="stringliteral">"RA"</span> , CPL_TYPE_DOUBLE, <span class="stringliteral">"degree"</span>},</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>         {<span class="stringliteral">"DEC"</span>, CPL_TYPE_DOUBLE, <span class="stringliteral">"degree"</span>},</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> </div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>         <span class="comment">/* estimated intrinsic variability in magnitude RMS */</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>         {<span class="stringliteral">"VAR"</span>, CPL_TYPE_FLOAT, <span class="stringliteral">"mag rms"</span>},</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>         <span class="comment">/*  B:     magnitude */</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>         <span class="comment">/*  ERR_B: magnitude error */</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>         <span class="comment">/*  N_B:   number of observations obtained on photometric occasions */</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>         <span class="comment">/*  n_B:   total number of observations */</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>         {<span class="stringliteral">"B"</span>    , CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>         {<span class="stringliteral">"ERR_B"</span>, CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>         {<span class="stringliteral">"N_B"</span>  , CPL_TYPE_INT, NULL},</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>         {<span class="stringliteral">"n_B"</span>  , CPL_TYPE_INT, NULL},</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>         {<span class="stringliteral">"V"</span>    , CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>         {<span class="stringliteral">"ERR_V"</span>, CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>         {<span class="stringliteral">"N_V"</span>  , CPL_TYPE_INT, NULL},</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>         {<span class="stringliteral">"n_V"</span>  , CPL_TYPE_INT, NULL},</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>         {<span class="stringliteral">"R"</span>    , CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>         {<span class="stringliteral">"ERR_R"</span>, CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>         {<span class="stringliteral">"N_R"</span>  , CPL_TYPE_INT, NULL},</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>         {<span class="stringliteral">"n_R"</span>  , CPL_TYPE_INT, NULL},</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>         {<span class="stringliteral">"I"</span>    , CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>         {<span class="stringliteral">"ERR_I"</span>, CPL_TYPE_FLOAT, <span class="stringliteral">"mag"</span>},</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>         {<span class="stringliteral">"N_I"</span>  , CPL_TYPE_INT, NULL},</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>         {<span class="stringliteral">"n_I"</span>  , CPL_TYPE_INT, NULL}</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>         </div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     };</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     {</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>         <span class="keywordtype">unsigned</span> i;</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(data) / <span class="keyword">sizeof</span>(*data); i++) {</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>             cpl_table_new_column     (table, data[i].colname, data[i].type);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>             <span class="keywordflow">if</span> (data[i].unit != NULL) {</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                 cpl_table_set_column_unit(table, data[i].colname, data[i].unit);</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>             }</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         }</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     }</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     CHECK;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     {</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         <span class="keywordtype">char</span> name_pho[1000];</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>         <span class="keywordtype">char</span> name_pos[1000];</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>         <span class="keywordtype">float</span> mag[5];</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>         <span class="keywordtype">float</span> err[5];</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>         <span class="keywordtype">int</span> N[5];</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>         <span class="keywordtype">int</span> n[5];</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>         <span class="keywordtype">float</span> var;</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         <span class="keywordtype">float</span> dummy;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>         <span class="keywordtype">int</span> items_assigned;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         FILE *file_pho = fopen(filename_pho, <span class="stringliteral">"r"</span>);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>         FILE *file_pos = fopen(filename_pos, <span class="stringliteral">"r"</span>);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         <span class="keywordflow">if</span> (file_pho == NULL) DIE;</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>         <span class="keywordflow">if</span> (file_pos == NULL) DIE;</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>         size = 0;</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         <span class="keywordflow">while</span>((items_assigned = fscanf(file_pho, </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                                        <span class="stringliteral">"%s"</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                                        <span class="stringliteral">"%f %f %d %d "</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                                        <span class="stringliteral">"%f %f %d %d "</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                                        <span class="stringliteral">"%f %f %d %d "</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                                        <span class="stringliteral">"%f %f %d %d "</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                                        <span class="stringliteral">"%f"</span>,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                                        name_pho, </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                                        &mag[0], &err[0], &N[0], &n[0],</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                                        &mag[1], &err[1], &N[1], &n[1],</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                                        &mag[2], &err[2], &N[2], &n[2],</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                                        &mag[3], &err[3], &N[3], &n[3], &var))</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>               != EOF) {</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>             <span class="keywordtype">double</span> ra, dec;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>             <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>             printf(<span class="stringliteral">"%d: %s "</span>, items_assigned, name_pho);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>             printf(<span class="stringliteral">"%f %f %d %d "</span>, mag[0], err[0], N[0], n[0]);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>             printf(<span class="stringliteral">"%f %f %d %d "</span>, mag[1], err[1], N[1], n[1]);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>             printf(<span class="stringliteral">"%f %f %d %d "</span>, mag[2], err[2], N[2], n[2]);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>             printf(<span class="stringliteral">"%f %f %d %d "</span>, mag[3], err[3], N[3], n[3]);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>             printf(<span class="stringliteral">"%f "</span>, var);</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                 </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>             <span class="keywordflow">if</span> (items_assigned != 18) DIE;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>             <span class="comment">/* Read RA, DEC */</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>             <span class="keywordflow">if</span> (fscanf(file_pos,</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>                        <span class="stringliteral">"%lf %lf "</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                        <span class="stringliteral">"%f %f %f "</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                        <span class="stringliteral">"%f %f %f "</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                        <span class="stringliteral">"%f %f %f %f "</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>                        <span class="stringliteral">"%s"</span>,</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>                        &ra, &dec,</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>                        &dummy, &dummy, &dummy, <span class="comment">//hexagesimal RA</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                        &dummy, &dummy, &dummy, <span class="comment">//hexagesimal DEC</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>                        &dummy, &dummy, &dummy, &dummy,  <span class="comment">//offset in arcsecs, pixels</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>                        name_pos) != 13) DIE;</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>                        </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>             printf(<span class="stringliteral">"%s (%f, %f)"</span>, name_pos, ra, dec);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>             printf(<span class="stringliteral">"\n"</span>);</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>             <span class="keywordflow">if</span> (strcmp(name_pho, name_pos) != 0) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>                 fprintf(stderr, <span class="stringliteral">"Mismatching OBJECT name: %s (pho), %s (pos)\n"</span>,</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                         name_pho, name_pos);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                 DIE;                </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>             }</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>             </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>             cpl_table_set_string(table, data[0].colname, size, name_pho);</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>             cpl_table_set_double(table, data[1].colname, size, ra);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>             cpl_table_set_double(table, data[2].colname, size, dec);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>             cpl_table_set_float (table, data[3].colname, size, var);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>             </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>             <span class="keywordflow">for</span> (i = 0; i < 4; i++) {</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>                 <span class="comment">/* zero or two of N and n must be zero */</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                 <span class="keywordflow">if</span> (N[i] == 0 && n[i] != 0) DIE;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                 <span class="keywordflow">if</span> (N[i] != 0 && n[i] == 0) DIE;</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                 </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                 <span class="keywordflow">if</span> (N[i] != 0) {</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                     cpl_table_set_float (table, data[i*4+4].colname, size, mag[i]);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                     cpl_table_set_float (table, data[i*4+5].colname, size, err[i]);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                     cpl_table_set_int   (table, data[i*4+6].colname, size,   N[i]);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                     cpl_table_set_int   (table, data[i*4+7].colname, size,   n[i]);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                 } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                     cpl_table_set_invalid(table, data[i*4+4].colname, size);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                     cpl_table_set_invalid(table, data[i*4+5].colname, size);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                     cpl_table_set_invalid(table, data[i*4+6].colname, size);</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                     cpl_table_set_invalid(table, data[i*4+7].colname, size);</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                 }</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>             }</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>             size++;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         }</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>         fclose(file_pho);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>         fclose(file_pos);</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     }</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     CHECK;</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> </div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     cpl_table_set_size(table, size);</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>    </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_table_save(table, NULL, NULL, filename_out, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     CHECK;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     </div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     fprintf(stdout, <span class="stringliteral">"Created %s\n"</span>, filename_out);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/dir_29caecd79ba0d8cf1bf29f8555ca3deb.html b/html/dir_29caecd79ba0d8cf1bf29f8555ca3deb.html
new file mode 100644
index 0000000..d4504ee
--- /dev/null
+++ b/html/dir_29caecd79ba0d8cf1bf29f8555ca3deb.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: tests Directory Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li><li class="navelem"><a class="el" href="dir_29caecd79ba0d8cf1bf29f8555ca3deb.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">tests Directory Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
+Files</h2></td></tr>
+<tr class="memitem:recipes-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>recipes-test.c</b> <a href="recipes-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/dir_59b02a80e553296e42791d17a261b792.html b/html/dir_59b02a80e553296e42791d17a261b792.html
deleted file mode 100644
index c8c7bf2..0000000
--- a/html/dir_59b02a80e553296e42791d17a261b792.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: /home/cgarcia/SDD/tmp/4.9.23/forsp/fors/tests/ Directory Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>tests Directory Reference</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Files</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors-test.c</b> <a href="fors-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_bias-test.c</b> <a href="fors__bias-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_cpl_wcs-test.c</b> <a href="fors__cpl__wcs-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dark-test.c</b> <a href="fors__dark-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_identify-test.c</b> <a href="fors__identify-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_image-test.c</b> <a href="fors__image-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_science-test.c</b> <a href="fors__img__science-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat-test.c</b> <a href="fors__img__screen__flat-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat-test.c</b> <a href="fors__img__sky__flat-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pattern-test.c</b> <a href="fors__pattern-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_photometry-test.c</b> <a href="fors__photometry-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_point-test.c</b> <a href="fors__point-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_qc-test.c</b> <a href="fors__qc-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_setting-test.c</b> <a href="fors__setting-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_stack-test.c</b> <a href="fors__stack-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_star-test.c</b> <a href="fors__star-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_std_star-test.c</b> <a href="fors__std__star-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint-test.c</b> <a href="fors__zeropoint-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>list-test.c</b> <a href="list-test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>test.c</b> <a href="test_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>test.h</b> <a href="test_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>test_simulate.c</b> <a href="test__simulate_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>test_simulate.h</b> <a href="test__simulate_8h-source.html">[code]</a></td></tr>
-
-</table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/dir_83e1530f94cacc9068c540ba3fc838a8.html b/html/dir_83e1530f94cacc9068c540ba3fc838a8.html
deleted file mode 100644
index 0d326dd..0000000
--- a/html/dir_83e1530f94cacc9068c540ba3fc838a8.html
+++ /dev/null
@@ -1,169 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: /home/cgarcia/SDD/tmp/4.9.23/forsp/fors/ Directory Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors Directory Reference</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Directories</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">directory  </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Files</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>create_phot.c</b> <a href="create__phot_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>create_stetson.c</b> <a href="create__stetson_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_bias_impl.c</b> <a href="fors__bias__impl_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_bias_impl.h</b> <a href="fors__bias__impl_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_cpl_wcs.c</b> <a href="fors__cpl__wcs_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_cpl_wcs.h</b> <a href="fors__cpl__wcs_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dark_impl.c</b> <a href="fors__dark__impl_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dark_impl.h</b> <a href="fors__dark__impl_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_data.c</b> <a href="fors__data_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_data.h</b> <a href="fors__data_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dfs.c</b> <a href="fors__dfs_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dfs.h</b> <a href="fors__dfs_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_double.c</b> <a href="fors__double_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_double.h</b> <a href="fors__double_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors/fors_extract.c</b> <a href="fors_2fors__extract_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_extract.h</b> <a href="fors__extract_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_header.c</b> <a href="fors__header_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_header.h</b> <a href="fors__header_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_identify.c</b> <a href="fors__identify_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_identify.h</b> <a href="fors__identify_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_image.c</b> <a href="fors__image_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_image.h</b> <a href="fors__image_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_science_impl.c</b> <a href="fors__img__science__impl_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_science_impl.h</b> <a href="fors__img__science__impl_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat_impl.c</b> <a href="fors__img__screen__flat__impl_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat_impl.h</b> <a href="fors__img__screen__flat__impl_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat_impl.c</b> <a href="fors__img__sky__flat__impl_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat_impl.h</b> <a href="fors__img__sky__flat__impl_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_instrument.c</b> <a href="fors__instrument_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_instrument.h</b> <a href="fors__instrument_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_paf.c</b> <a href="fors__paf_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_paf.h</b> <a href="fors__paf_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pattern.c</b> <a href="fors__pattern_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pattern.h</b> <a href="fors__pattern_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pfits.c</b> <a href="fors__pfits_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pfits.h</b> <a href="fors__pfits_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_photometry_impl.c</b> <a href="fors__photometry__impl_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_photometry_impl.h</b> <a href="fors__photometry__impl_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_point.c</b> <a href="fors__point_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_point.h</b> <a href="fors__point_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_polynomial.c</b> <a href="fors__polynomial_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_polynomial.h</b> <a href="fors__polynomial_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_qc.c</b> <a href="fors__qc_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_qc.h</b> <a href="fors__qc_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_recipe_impl.h</b> <a href="fors__recipe__impl_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_setting.c</b> <a href="fors__setting_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_setting.h</b> <a href="fors__setting_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_stack.c</b> <a href="fors__stack_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_stack.h</b> <a href="fors__stack_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_star.c</b> <a href="fors__star_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_star.h</b> <a href="fors__star_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_std_cat.c</b> <a href="fors__std__cat_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_std_cat.h</b> <a href="fors__std__cat_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_std_star.c</b> <a href="fors__std__star_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_std_star.h</b> <a href="fors__std__star_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_tools.c</b> <a href="fors__tools_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_tools.h</b> <a href="fors__tools_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_utils.c</b> <a href="fors__utils_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_utils.h</b> <a href="fors__utils_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint_impl.c</b> <a href="fors__zeropoint__impl_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint_impl.h</b> <a href="fors__zeropoint__impl_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>list.c</b> <a href="list_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>list.h</b> <a href="list_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>list_void.h</b> <a href="list__void_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>moses.c</b> <a href="moses_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>moses.h</b> <a href="moses_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_calib_impl.c</b> <a href="vimos__calib__impl_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_calib_impl.h</b> <a href="vimos__calib__impl_8h-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_science_impl.c</b> <a href="vimos__science__impl_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_science_impl.h</b> <a href="vimos__science__impl_8h-source.html">[code]</a></td></tr>
-
-</table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/dir_95ba833b8cc26b837be271dc0b58e122.html b/html/dir_95ba833b8cc26b837be271dc0b58e122.html
new file mode 100644
index 0000000..5ab1cf4
--- /dev/null
+++ b/html/dir_95ba833b8cc26b837be271dc0b58e122.html
@@ -0,0 +1,211 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors Directory Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors Directory Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a>
+Directories</h2></td></tr>
+<tr class="memitem:dir_aab54b8ed0ffe13455bea30ab0dd47dc"><td class="memItemLeft" align="right" valign="top">directory  </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
+Files</h2></td></tr>
+<tr class="memitem:create__phot_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>create_phot.c</b> <a href="create__phot_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:create__stetson_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>create_stetson.c</b> <a href="create__stetson_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__bias__impl_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_bias_impl.c</b> <a href="fors__bias__impl_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__bias__impl_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_bias_impl.h</b> <a href="fors__bias__impl_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__cpl__wcs_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_cpl_wcs.c</b> <a href="fors__cpl__wcs_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__cpl__wcs_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_cpl_wcs.h</b> <a href="fors__cpl__wcs_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__dark__impl_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dark_impl.c</b> <a href="fors__dark__impl_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__dark__impl_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dark_impl.h</b> <a href="fors__dark__impl_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__data_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_data.c</b> <a href="fors__data_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__data_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_data.h</b> <a href="fors__data_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__detected__slits_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_detected_slits.h</b> <a href="fors__detected__slits_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__dfs_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dfs.c</b> <a href="fors__dfs_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__dfs_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dfs.h</b> <a href="fors__dfs_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__double_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_double.c</b> <a href="fors__double_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__double_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_double.h</b> <a href="fors__double_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors_2fors__extract_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors/fors_extract.c</b> <a href="fors_2fors__extract_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__extract_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_extract.h</b> <a href="fors__extract_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__flat__normalise_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_flat_normalise.h</b> <a href="fors__flat__normalise_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__header_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_header.c</b> <a href="fors__header_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__header_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_header.h</b> <a href="fors__header_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__identify_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_identify.c</b> <a href="fors__identify_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__identify_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_identify.h</b> <a href="fors__identify_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__image_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_image.c</b> <a href="fors__image_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__image_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_image.h</b> <a href="fors__image_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__science__impl_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_science_impl.c</b> <a href="fors__img__science__impl_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__science__impl_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_science_impl.h</b> <a href="fors__img__science__impl_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__screen__flat__impl_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat_impl.c</b> <a href="fors__img__screen__flat__impl_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__screen__flat__impl_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat_impl.h</b> <a href="fors__img__screen__flat__impl_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__sky__flat__impl_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat_impl.c</b> <a href="fors__img__sky__flat__impl_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__sky__flat__impl_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat_impl.h</b> <a href="fors__img__sky__flat__impl_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__instrument_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_instrument.c</b> <a href="fors__instrument_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__instrument_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_instrument.h</b> <a href="fors__instrument_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__overscan_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_overscan.h</b> <a href="fors__overscan_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__paf_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_paf.c</b> <a href="fors__paf_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__paf_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_paf.h</b> <a href="fors__paf_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__pattern_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pattern.c</b> <a href="fors__pattern_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__pattern_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pattern.h</b> <a href="fors__pattern_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__pfits_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pfits.c</b> <a href="fors__pfits_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__pfits_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pfits.h</b> <a href="fors__pfits_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__photometry__impl_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_photometry_impl.c</b> <a href="fors__photometry__impl_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__photometry__impl_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_photometry_impl.h</b> <a href="fors__photometry__impl_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__point_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_point.c</b> <a href="fors__point_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__point_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_point.h</b> <a href="fors__point_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__polynomial_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_polynomial.c</b> <a href="fors__polynomial_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__polynomial_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_polynomial.h</b> <a href="fors__polynomial_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__qc_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_qc.c</b> <a href="fors__qc_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__qc_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_qc.h</b> <a href="fors__qc_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__recipe__impl_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_recipe_impl.h</b> <a href="fors__recipe__impl_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__setting_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_setting.c</b> <a href="fors__setting_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__setting_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_setting.h</b> <a href="fors__setting_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__stack_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_stack.c</b> <a href="fors__stack_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__stack_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_stack.h</b> <a href="fors__stack_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__star_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_star.c</b> <a href="fors__star_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__star_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_star.h</b> <a href="fors__star_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__std__cat_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_std_cat.c</b> <a href="fors__std__cat_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__std__cat_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_std_cat.h</b> <a href="fors__std__cat_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__std__star_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_std_star.c</b> <a href="fors__std__star_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__std__star_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_std_star.h</b> <a href="fors__std__star_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__tools_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_tools.c</b> <a href="fors__tools_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__tools_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_tools.h</b> <a href="fors__tools_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__utils_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_utils.c</b> <a href="fors__utils_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__utils_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_utils.h</b> <a href="fors__utils_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__zeropoint__impl_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint_impl.c</b> <a href="fors__zeropoint__impl_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__zeropoint__impl_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint_impl.h</b> <a href="fors__zeropoint__impl_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:list_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>list.c</b> <a href="list_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:list_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>list.h</b> <a href="list_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:list__void_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>list_void.h</b> <a href="list__void_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:moses_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>moses.c</b> <a href="moses_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:moses_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>moses.h</b> <a href="moses_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:vimos__calib__impl_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_calib_impl.c</b> <a href="vimos__calib__impl_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:vimos__calib__impl_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_calib_impl.h</b> <a href="vimos__calib__impl_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:vimos__science__impl_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_science_impl.c</b> <a href="vimos__science__impl_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:vimos__science__impl_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_science_impl.h</b> <a href="vimos__science__impl_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/dir_9af262a93c54576b7a2b4cc0cd21cc4f.html b/html/dir_9af262a93c54576b7a2b4cc0cd21cc4f.html
deleted file mode 100644
index 8671014..0000000
--- a/html/dir_9af262a93c54576b7a2b4cc0cd21cc4f.html
+++ /dev/null
@@ -1,103 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: /home/cgarcia/SDD/tmp/4.9.23/forsp/recipes/ Directory Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>recipes Directory Reference</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Directories</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">directory  </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_f9b8c94f8f09c10447edf4ed11ceb4e6.html">tests</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Files</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_align_sky.c</b> <a href="fors__align__sky_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_align_sky_lss.c</b> <a href="fors__align__sky__lss_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_bias.c</b> <a href="fors__bias_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_calib.c</b> <a href="fors__calib_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_config.c</b> <a href="fors__config_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dark.c</b> <a href="fors__dark_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_detect_objects.c</b> <a href="fors__detect__objects_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_detect_spectra.c</b> <a href="fors__detect__spectra_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_detlin.c</b> <a href="fors__detlin_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>recipes/fors_extract.c</b> <a href="recipes_2fors__extract_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_extract_objects.c</b> <a href="fors__extract__objects_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_extract_slits.c</b> <a href="fors__extract__slits_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_flat.c</b> <a href="fors__flat_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_flatfield.c</b> <a href="fors__flatfield_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_science.c</b> <a href="fors__img__science_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat.c</b> <a href="fors__img__screen__flat_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat.c</b> <a href="fors__img__sky__flat_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_normalise_flat.c</b> <a href="fors__normalise__flat_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_photometry.c</b> <a href="fors__photometry_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pmos_calib.c</b> <a href="fors__pmos__calib_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pmos_extract.c</b> <a href="fors__pmos__extract_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pmos_science.c</b> <a href="fors__pmos__science_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_recipe.c</b> <a href="fors__recipe_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_remove_bias.c</b> <a href="fors__remove__bias_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_resample.c</b> <a href="fors__resample_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_science.c</b> <a href="fors__science_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_subtract_sky.c</b> <a href="fors__subtract__sky_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_subtract_sky_lss.c</b> <a href="fors__subtract__sky__lss_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_sumflux.c</b> <a href="fors__sumflux_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_trace_flat.c</b> <a href="fors__trace__flat_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_wave_calib.c</b> <a href="fors__wave__calib_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_wave_calib_lss.c</b> <a href="fors__wave__calib__lss_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint.c</b> <a href="fors__zeropoint_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>montecarlo.c</b> <a href="montecarlo_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>test_hough.c</b> <a href="test__hough_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_calib.c</b> <a href="vimos__calib_8c-source.html">[code]</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_science.c</b> <a href="vimos__science_8c-source.html">[code]</a></td></tr>
-
-</table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/dir_aab54b8ed0ffe13455bea30ab0dd47dc.html b/html/dir_aab54b8ed0ffe13455bea30ab0dd47dc.html
new file mode 100644
index 0000000..10ae0ba
--- /dev/null
+++ b/html/dir_aab54b8ed0ffe13455bea30ab0dd47dc.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: tests Directory Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">tests Directory Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
+Files</h2></td></tr>
+<tr class="memitem:fors-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors-test.c</b> <a href="fors-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__bias-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_bias-test.c</b> <a href="fors__bias-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__cpl__wcs-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_cpl_wcs-test.c</b> <a href="fors__cpl__wcs-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__dark-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dark-test.c</b> <a href="fors__dark-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__identify-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_identify-test.c</b> <a href="fors__identify-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__image-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_image-test.c</b> <a href="fors__image-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__science-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_science-test.c</b> <a href="fors__img__science-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__screen__flat-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat-test.c</b> <a href="fors__img__screen__flat-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__sky__flat-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat-test.c</b> <a href="fors__img__sky__flat-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__pattern-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pattern-test.c</b> <a href="fors__pattern-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__photometry-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_photometry-test.c</b> <a href="fors__photometry-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__point-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_point-test.c</b> <a href="fors__point-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__qc-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_qc-test.c</b> <a href="fors__qc-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__setting-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_setting-test.c</b> <a href="fors__setting-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__stack-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_stack-test.c</b> <a href="fors__stack-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__star-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_star-test.c</b> <a href="fors__star-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__std__star-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_std_star-test.c</b> <a href="fors__std__star-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__zeropoint-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint-test.c</b> <a href="fors__zeropoint-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:list-test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>list-test.c</b> <a href="list-test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:test_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>test.c</b> <a href="test_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:test_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>test.h</b> <a href="test_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:test__simulate_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>test_simulate.c</b> <a href="test__simulate_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:test__simulate_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>test_simulate.h</b> <a href="test__simulate_8h_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/dir_b351cdfeb4656d7d168dc72b273024e7.html b/html/dir_b351cdfeb4656d7d168dc72b273024e7.html
new file mode 100644
index 0000000..c1ee67d
--- /dev/null
+++ b/html/dir_b351cdfeb4656d7d168dc72b273024e7.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: recipes Directory Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">recipes Directory Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a>
+Directories</h2></td></tr>
+<tr class="memitem:dir_29caecd79ba0d8cf1bf29f8555ca3deb"><td class="memItemLeft" align="right" valign="top">directory  </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_29caecd79ba0d8cf1bf29f8555ca3deb.html">tests</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
+Files</h2></td></tr>
+<tr class="memitem:fors__align__sky_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_align_sky.c</b> <a href="fors__align__sky_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__align__sky__lss_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_align_sky_lss.c</b> <a href="fors__align__sky__lss_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__bias_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_bias.c</b> <a href="fors__bias_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__config_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_config.c</b> <a href="fors__config_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__dark_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_dark.c</b> <a href="fors__dark_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__detect__objects_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_detect_objects.c</b> <a href="fors__detect__objects_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__detect__spectra_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_detect_spectra.c</b> <a href="fors__detect__spectra_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__detlin_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_detlin.c</b> <a href="fors__detlin_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:recipes_2fors__extract_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>recipes/fors_extract.c</b> <a href="recipes_2fors__extract_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__extract__objects_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_extract_objects.c</b> <a href="fors__extract__objects_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__extract__slits_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_extract_slits.c</b> <a href="fors__extract__slits_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__flatfield_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_flatfield.c</b> <a href="fors__flatfield_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__science_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_science.c</b> <a href="fors__img__science_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__screen__flat_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat.c</b> <a href="fors__img__screen__flat_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__img__sky__flat_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat.c</b> <a href="fors__img__sky__flat_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__normalise__flat_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_normalise_flat.c</b> <a href="fors__normalise__flat_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__photometry_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_photometry.c</b> <a href="fors__photometry_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__pmos__calib_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pmos_calib.c</b> <a href="fors__pmos__calib_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__pmos__extract_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pmos_extract.c</b> <a href="fors__pmos__extract_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__pmos__science_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_pmos_science.c</b> <a href="fors__pmos__science_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__recipe_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_recipe.c</b> <a href="fors__recipe_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__remove__bias_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_remove_bias.c</b> <a href="fors__remove__bias_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__resample_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_resample.c</b> <a href="fors__resample_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__science_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_science.c</b> <a href="fors__science_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__subtract__sky_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_subtract_sky.c</b> <a href="fors__subtract__sky_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__subtract__sky__lss_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_subtract_sky_lss.c</b> <a href="fors__subtract__sky__lss_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__sumflux_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_sumflux.c</b> <a href="fors__sumflux_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__trace__flat_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_trace_flat.c</b> <a href="fors__trace__flat_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__wave__calib_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_wave_calib.c</b> <a href="fors__wave__calib_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__wave__calib__lss_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_wave_calib_lss.c</b> <a href="fors__wave__calib__lss_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:fors__zeropoint_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint.c</b> <a href="fors__zeropoint_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:montecarlo_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>montecarlo.c</b> <a href="montecarlo_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:test__hough_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>test_hough.c</b> <a href="test__hough_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:vimos__calib_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_calib.c</b> <a href="vimos__calib_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:vimos__science_8c"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>vimos_science.c</b> <a href="vimos__science_8c_source.html">[code]</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/dir_f9b8c94f8f09c10447edf4ed11ceb4e6.html b/html/dir_f9b8c94f8f09c10447edf4ed11ceb4e6.html
deleted file mode 100644
index 1cce3b0..0000000
--- a/html/dir_f9b8c94f8f09c10447edf4ed11ceb4e6.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: /home/cgarcia/SDD/tmp/4.9.23/forsp/recipes/tests/ Directory Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a> &raquo <a class="el" href="dir_f9b8c94f8f09c10447edf4ed11ceb4e6.html">tests</a></div>
-<h1>tests Directory Reference</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Files</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><b>recipes-test.c</b> <a href="recipes-test_8c-source.html">[code]</a></td></tr>
-
-</table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/dirs.html b/html/dirs.html
deleted file mode 100644
index 01cb3c5..0000000
--- a/html/dirs.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: Directory Hierarchy</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li id="current"><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>FORS Pipeline Reference Manual Directories</h1>This directory hierarchy is sorted roughly, but not completely, alphabetically:<ul>
-<li><a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a>
-<ul>
-<li><a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a>
-</ul>
-<li><a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a>
-<ul>
-<li><a class="el" href="dir_f9b8c94f8f09c10447edf4ed11ceb4e6.html">tests</a>
-</ul>
-</ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/doxygen.css b/html/doxygen.css
index 5d58369..dabaff2 100644
--- a/html/doxygen.css
+++ b/html/doxygen.css
@@ -1,358 +1,1184 @@
-BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
-	font-family: Geneva, Arial, Helvetica, sans-serif;
+/* The standard CSS for doxygen 1.8.3.1 */
+
+body, table, div, p, dl {
+	font: 400 14px/19px Roboto,sans-serif;
 }
-BODY,TD {
-       font-size: 90%;
+
+/* @group Heading Levels */
+
+h1.groupheader {
+	font-size: 150%;
 }
-H1 {
-	text-align: center;
-       font-size: 160%;
+
+.title {
+	font-size: 150%;
+	font-weight: bold;
+	margin: 10px 2px;
 }
-H2 {
-       font-size: 120%;
+
+h2.groupheader {
+	border-bottom: 1px solid #879ECB;
+	color: #354C7B;
+	font-size: 150%;
+	font-weight: normal;
+	margin-top: 1.75em;
+	padding-top: 8px;
+	padding-bottom: 4px;
+	width: 100%;
 }
-H3 {
-       font-size: 100%;
+
+h3.groupheader {
+	font-size: 100%;
 }
-CAPTION { font-weight: bold }
-DIV.qindex {
-	width: 100%;
-	background-color: #e8eef2;
-	border: 1px solid #84b0c7;
+
+h1, h2, h3, h4, h5, h6 {
+	-webkit-transition: text-shadow 0.5s linear;
+	-moz-transition: text-shadow 0.5s linear;
+	-ms-transition: text-shadow 0.5s linear;
+	-o-transition: text-shadow 0.5s linear;
+	transition: text-shadow 0.5s linear;
+	margin-right: 15px;
+}
+
+h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow {
+	text-shadow: 0 0 15px cyan;
+}
+
+dt {
+	font-weight: bold;
+}
+
+div.multicol {
+	-moz-column-gap: 1em;
+	-webkit-column-gap: 1em;
+	-moz-column-count: 3;
+	-webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+	margin-top: 2px;
+}
+
+p.endli {
+	margin-bottom: 0px;
+}
+
+p.enddd {
+	margin-bottom: 4px;
+}
+
+p.endtd {
+	margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+	font-weight: bold;
+}
+
+span.legend {
+        font-size: 70%;
+        text-align: center;
+}
+
+h3.version {
+        font-size: 90%;
+        text-align: center;
+}
+
+div.qindex, div.navtab{
+	background-color: #EBEFF6;
+	border: 1px solid #A3B4D7;
 	text-align: center;
-	margin: 2px;
-	padding: 2px;
-	line-height: 140%;
 }
-DIV.nav {
+
+div.qindex, div.navpath {
 	width: 100%;
-	background-color: #e8eef2;
-	border: 1px solid #84b0c7;
-	text-align: center;
-	margin: 2px;
-	padding: 2px;
 	line-height: 140%;
 }
-DIV.navtab {
-       background-color: #e8eef2;
-       border: 1px solid #84b0c7;
-       text-align: center;
-       margin: 2px;
-       margin-right: 15px;
-       padding: 2px;
+
+div.navtab {
+	margin-right: 15px;
 }
-TD.navtab {
-       font-size: 70%;
+
+/* @group Link Styling */
+
+a {
+	color: #3D578C;
+	font-weight: normal;
+	text-decoration: none;
 }
-A.qindex {
-       text-decoration: none;
-       font-weight: bold;
-       color: #1A419D;
+
+.contents a:visited {
+	color: #4665A2;
 }
-A.qindex:visited {
-       text-decoration: none;
-       font-weight: bold;
-       color: #1A419D
+
+a:hover {
+	text-decoration: underline;
 }
-A.qindex:hover {
-	text-decoration: none;
-	background-color: #ddddff;
+
+a.qindex {
+	font-weight: bold;
 }
-A.qindexHL {
-	text-decoration: none;
+
+a.qindexHL {
 	font-weight: bold;
-	background-color: #6666cc;
+	background-color: #9CAFD4;
 	color: #ffffff;
-	border: 1px double #9295C2;
+	border: 1px double #869DCA;
 }
-A.qindexHL:hover {
-	text-decoration: none;
-	background-color: #6666cc;
+
+.contents a.qindexHL:visited {
+        color: #ffffff;
+}
+
+a.el {
+	font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code, a.code:visited {
+	color: #4665A2; 
+}
+
+a.codeRef, a.codeRef:visited {
+	color: #4665A2; 
+}
+
+/* @end */
+
+dl.el {
+	margin-left: -1cm;
+}
+
+pre.fragment {
+        border: 1px solid #C4CFE5;
+        background-color: #FBFCFD;
+        padding: 4px 6px;
+        margin: 4px 8px 4px 2px;
+        overflow: auto;
+        word-wrap: break-word;
+        font-size:  9pt;
+        line-height: 125%;
+        font-family: monospace, fixed;
+        font-size: 105%;
+}
+
+div.fragment {
+        padding: 4px;
+        margin: 4px;
+	background-color: #FBFCFD;
+	border: 1px solid #C4CFE5;
+}
+
+div.line {
+	font-family: monospace, fixed;
+        font-size: 13px;
+	min-height: 13px;
+	line-height: 1.0;
+	text-wrap: unrestricted;
+	white-space: -moz-pre-wrap; /* Moz */
+	white-space: -pre-wrap;     /* Opera 4-6 */
+	white-space: -o-pre-wrap;   /* Opera 7 */
+	white-space: pre-wrap;      /* CSS3  */
+	word-wrap: break-word;      /* IE 5.5+ */
+	text-indent: -53px;
+	padding-left: 53px;
+	padding-bottom: 0px;
+	margin: 0px;
+	-webkit-transition-property: background-color, box-shadow;
+	-webkit-transition-duration: 0.5s;
+	-moz-transition-property: background-color, box-shadow;
+	-moz-transition-duration: 0.5s;
+	-ms-transition-property: background-color, box-shadow;
+	-ms-transition-duration: 0.5s;
+	-o-transition-property: background-color, box-shadow;
+	-o-transition-duration: 0.5s;
+	transition-property: background-color, box-shadow;
+	transition-duration: 0.5s;
+}
+
+div.line.glow {
+	background-color: cyan;
+	box-shadow: 0 0 10px cyan;
+}
+
+
+span.lineno {
+	padding-right: 4px;
+	text-align: right;
+	border-right: 2px solid #0F0;
+	background-color: #E8E8E8;
+        white-space: pre;
+}
+span.lineno a {
+	background-color: #D8D8D8;
+}
+
+span.lineno a:hover {
+	background-color: #C8C8C8;
+}
+
+div.ah {
+	background-color: black;
+	font-weight: bold;
 	color: #ffffff;
+	margin-bottom: 3px;
+	margin-top: 3px;
+	padding: 0.2em;
+	border: solid thin #333;
+	border-radius: 0.5em;
+	-webkit-border-radius: .5em;
+	-moz-border-radius: .5em;
+	box-shadow: 2px 2px 3px #999;
+	-webkit-box-shadow: 2px 2px 3px #999;
+	-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+	background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
 }
-A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
-A.el { text-decoration: none; font-weight: bold }
-A.elRef { font-weight: bold }
-A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
-A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
-A.codeRef:link { font-weight: normal; color: #0000FF}
-A.codeRef:visited { font-weight: normal; color: #0000FF}
-A:hover { text-decoration: none; background-color: #f2f2ff }
-DL.el { margin-left: -1cm }
-.fragment {
-       font-family: monospace, fixed;
-       font-size: 95%;
-}
-PRE.fragment {
-	border: 1px solid #CCCCCC;
-	background-color: #f5f5f5;
-	margin-top: 4px;
-	margin-bottom: 4px;
-	margin-left: 2px;
-	margin-right: 8px;
-	padding-left: 6px;
-	padding-right: 6px;
-	padding-top: 4px;
-	padding-bottom: 4px;
+
+div.groupHeader {
+	margin-left: 16px;
+	margin-top: 12px;
+	font-weight: bold;
 }
-DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
 
-DIV.groupHeader {
-       margin-left: 16px;
-       margin-top: 12px;
-       margin-bottom: 6px;
-       font-weight: bold;
+div.groupText {
+	margin-left: 16px;
+	font-style: italic;
 }
-DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% }
-BODY {
-	background: white;
+
+body {
+	background-color: white;
 	color: black;
-	margin-right: 20px;
-	margin-left: 20px;
+        margin: 0;
 }
-TD.indexkey {
-	background-color: #e8eef2;
+
+div.contents {
+	margin-top: 10px;
+	margin-left: 12px;
+	margin-right: 8px;
+}
+
+td.indexkey {
+	background-color: #EBEFF6;
 	font-weight: bold;
-	padding-right  : 10px;
-	padding-top    : 2px;
-	padding-left   : 10px;
-	padding-bottom : 2px;
-	margin-left    : 0px;
-	margin-right   : 0px;
-	margin-top     : 2px;
-	margin-bottom  : 2px;
-	border: 1px solid #CCCCCC;
-}
-TD.indexvalue {
-	background-color: #e8eef2;
-	font-style: italic;
-	padding-right  : 10px;
-	padding-top    : 2px;
-	padding-left   : 10px;
-	padding-bottom : 2px;
-	margin-left    : 0px;
-	margin-right   : 0px;
-	margin-top     : 2px;
-	margin-bottom  : 2px;
-	border: 1px solid #CCCCCC;
-}
-TR.memlist {
-   background-color: #f0f0f0; 
-}
-P.formulaDsp { text-align: center; }
-IMG.formulaDsp { }
-IMG.formulaInl { vertical-align: middle; }
-SPAN.keyword       { color: #008000 }
-SPAN.keywordtype   { color: #604020 }
-SPAN.keywordflow   { color: #e08000 }
-SPAN.comment       { color: #800000 }
-SPAN.preprocessor  { color: #806020 }
-SPAN.stringliteral { color: #002080 }
-SPAN.charliteral   { color: #008080 }
-.mdescLeft {
-       padding: 0px 8px 4px 8px;
-	font-size: 80%;
-	font-style: italic;
-	background-color: #FAFAFA;
-	border-top: 1px none #E0E0E0;
-	border-right: 1px none #E0E0E0;
-	border-bottom: 1px none #E0E0E0;
-	border-left: 1px none #E0E0E0;
-	margin: 0px;
+	border: 1px solid #C4CFE5;
+	margin: 2px 0px 2px 0;
+	padding: 2px 10px;
+        white-space: nowrap;
+        vertical-align: top;
 }
-.mdescRight {
-       padding: 0px 8px 4px 8px;
-	font-size: 80%;
-	font-style: italic;
-	background-color: #FAFAFA;
-	border-top: 1px none #E0E0E0;
-	border-right: 1px none #E0E0E0;
-	border-bottom: 1px none #E0E0E0;
-	border-left: 1px none #E0E0E0;
-	margin: 0px;
+
+td.indexvalue {
+	background-color: #EBEFF6;
+	border: 1px solid #C4CFE5;
+	padding: 2px 10px;
+	margin: 2px 0px;
 }
-.memItemLeft {
-	padding: 1px 0px 0px 8px;
-	margin: 4px;
-	border-top-width: 1px;
-	border-right-width: 1px;
-	border-bottom-width: 1px;
-	border-left-width: 1px;
-	border-top-color: #E0E0E0;
-	border-right-color: #E0E0E0;
-	border-bottom-color: #E0E0E0;
-	border-left-color: #E0E0E0;
-	border-top-style: solid;
-	border-right-style: none;
-	border-bottom-style: none;
-	border-left-style: none;
-	background-color: #FAFAFA;
-	font-size: 80%;
+
+tr.memlist {
+	background-color: #EEF1F7;
 }
-.memItemRight {
-	padding: 1px 8px 0px 8px;
-	margin: 4px;
-	border-top-width: 1px;
-	border-right-width: 1px;
-	border-bottom-width: 1px;
-	border-left-width: 1px;
-	border-top-color: #E0E0E0;
-	border-right-color: #E0E0E0;
-	border-bottom-color: #E0E0E0;
-	border-left-color: #E0E0E0;
-	border-top-style: solid;
-	border-right-style: none;
-	border-bottom-style: none;
-	border-left-style: none;
-	background-color: #FAFAFA;
-	font-size: 80%;
+
+p.formulaDsp {
+	text-align: center;
 }
-.memTemplItemLeft {
-	padding: 1px 0px 0px 8px;
-	margin: 4px;
-	border-top-width: 1px;
-	border-right-width: 1px;
-	border-bottom-width: 1px;
-	border-left-width: 1px;
-	border-top-color: #E0E0E0;
-	border-right-color: #E0E0E0;
-	border-bottom-color: #E0E0E0;
-	border-left-color: #E0E0E0;
-	border-top-style: none;
-	border-right-style: none;
-	border-bottom-style: none;
-	border-left-style: none;
-	background-color: #FAFAFA;
-	font-size: 80%;
+
+img.formulaDsp {
+	
 }
-.memTemplItemRight {
-	padding: 1px 8px 0px 8px;
-	margin: 4px;
-	border-top-width: 1px;
-	border-right-width: 1px;
-	border-bottom-width: 1px;
-	border-left-width: 1px;
-	border-top-color: #E0E0E0;
-	border-right-color: #E0E0E0;
-	border-bottom-color: #E0E0E0;
-	border-left-color: #E0E0E0;
-	border-top-style: none;
-	border-right-style: none;
-	border-bottom-style: none;
-	border-left-style: none;
-	background-color: #FAFAFA;
-	font-size: 80%;
+
+img.formulaInl {
+	vertical-align: middle;
 }
-.memTemplParams {
-	padding: 1px 0px 0px 8px;
-	margin: 4px;
-	border-top-width: 1px;
-	border-right-width: 1px;
-	border-bottom-width: 1px;
-	border-left-width: 1px;
-	border-top-color: #E0E0E0;
-	border-right-color: #E0E0E0;
-	border-bottom-color: #E0E0E0;
-	border-left-color: #E0E0E0;
-	border-top-style: solid;
-	border-right-style: none;
-	border-bottom-style: none;
-	border-left-style: none;
-       color: #606060;
-	background-color: #FAFAFA;
-	font-size: 80%;
+
+div.center {
+	text-align: center;
+        margin-top: 0px;
+        margin-bottom: 0px;
+        padding: 0px;
 }
-.search     { color: #003399;
-              font-weight: bold;
+
+div.center img {
+	border: 0px;
 }
-FORM.search {
-              margin-bottom: 0px;
-              margin-top: 0px;
+
+address.footer {
+	text-align: right;
+	padding-right: 12px;
 }
-INPUT.search { font-size: 75%;
-               color: #000080;
-               font-weight: normal;
-               background-color: #e8eef2;
+
+img.footer {
+	border: 0px;
+	vertical-align: middle;
 }
-TD.tiny      { font-size: 75%;
+
+/* @group Code Colorization */
+
+span.keyword {
+	color: #008000
 }
-a {
-	color: #1A41A8;
+
+span.keywordtype {
+	color: #604020
 }
-a:visited {
-	color: #2A3798;
+
+span.keywordflow {
+	color: #e08000
 }
-.dirtab { padding: 4px;
-          border-collapse: collapse;
-          border: 1px solid #84b0c7;
+
+span.comment {
+	color: #800000
+}
+
+span.preprocessor {
+	color: #806020
+}
+
+span.stringliteral {
+	color: #002080
+}
+
+span.charliteral {
+	color: #008080
+}
+
+span.vhdldigit { 
+	color: #ff00ff 
 }
-TH.dirtab { background: #e8eef2;
-            font-weight: bold;
+
+span.vhdlchar { 
+	color: #000000 
 }
-HR { height: 1px;
-     border: none;
-     border-top: 1px solid black;
+
+span.vhdlkeyword { 
+	color: #700070 
 }
 
-/* Style for detailed member documentation */
+span.vhdllogic { 
+	color: #ff0000 
+}
+
+blockquote {
+        background-color: #F7F8FB;
+        border-left: 2px solid #9CAFD4;
+        margin: 0 24px 0 4px;
+        padding: 0 12px 0 16px;
+}
+
+/* @end */
+
+/*
+.search {
+	color: #003399;
+	font-weight: bold;
+}
+
+form.search {
+	margin-bottom: 0px;
+	margin-top: 0px;
+}
+
+input.search {
+	font-size: 75%;
+	color: #000080;
+	font-weight: normal;
+	background-color: #e8eef2;
+}
+*/
+
+td.tiny {
+	font-size: 75%;
+}
+
+.dirtab {
+	padding: 4px;
+	border-collapse: collapse;
+	border: 1px solid #A3B4D7;
+}
+
+th.dirtab {
+	background: #EBEFF6;
+	font-weight: bold;
+}
+
+hr {
+	height: 0px;
+	border: none;
+	border-top: 1px solid #4A6AAA;
+}
+
+hr.footer {
+	height: 1px;
+}
+
+/* @group Member Descriptions */
+
+table.memberdecls {
+	border-spacing: 0px;
+	padding: 0px;
+}
+
+.memberdecls td, .fieldtable tr {
+	-webkit-transition-property: background-color, box-shadow;
+	-webkit-transition-duration: 0.5s;
+	-moz-transition-property: background-color, box-shadow;
+	-moz-transition-duration: 0.5s;
+	-ms-transition-property: background-color, box-shadow;
+	-ms-transition-duration: 0.5s;
+	-o-transition-property: background-color, box-shadow;
+	-o-transition-duration: 0.5s;
+	transition-property: background-color, box-shadow;
+	transition-duration: 0.5s;
+}
+
+.memberdecls td.glow, .fieldtable tr.glow {
+	background-color: cyan;
+	box-shadow: 0 0 15px cyan;
+}
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+	background-color: #F9FAFC;
+	border: none;
+	margin: 4px;
+	padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+	padding: 0px 8px 4px 8px;
+	color: #555;
+}
+
+.memSeparator {
+        border-bottom: 1px solid #DEE4F0;
+        line-height: 1px;
+        margin: 0px;
+        padding: 0px;
+}
+
+.memItemLeft, .memTemplItemLeft {
+        white-space: nowrap;
+}
+
+.memItemRight {
+	width: 100%;
+}
+
+.memTemplParams {
+	color: #4665A2;
+        white-space: nowrap;
+	font-size: 80%;
+}
+
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
 .memtemplate {
-  font-size: 80%;
-  color: #606060;
-  font-weight: normal;
-} 
-.memnav { 
-  background-color: #e8eef2;
-  border: 1px solid #84b0c7;
-  text-align: center;
-  margin: 2px;
-  margin-right: 15px;
-  padding: 2px;
+	font-size: 80%;
+	color: #4665A2;
+	font-weight: normal;
+	margin-left: 9px;
 }
+
+.memnav {
+	background-color: #EBEFF6;
+	border: 1px solid #A3B4D7;
+	text-align: center;
+	margin: 2px;
+	margin-right: 15px;
+	padding: 2px;
+}
+
+.mempage {
+	width: 100%;
+}
+
 .memitem {
-  padding: 4px;
-  background-color: #eef3f5;
-  border-width: 1px;
-  border-style: solid;
-  border-color: #dedeee;
-  -moz-border-radius: 8px 8px 8px 8px;
+	padding: 0;
+	margin-bottom: 10px;
+	margin-right: 5px;
+        -webkit-transition: box-shadow 0.5s linear;
+        -moz-transition: box-shadow 0.5s linear;
+        -ms-transition: box-shadow 0.5s linear;
+        -o-transition: box-shadow 0.5s linear;
+        transition: box-shadow 0.5s linear;
+        display: table !important;
+        width: 100%;
 }
+
+.memitem.glow {
+         box-shadow: 0 0 15px cyan;
+}
+
 .memname {
-  white-space: nowrap;
-  font-weight: bold;
+        font-weight: bold;
+        margin-left: 6px;
 }
-.memdoc{
-  padding-left: 10px;
+
+.memname td {
+	vertical-align: bottom;
+}
+
+.memproto, dl.reflist dt {
+        border-top: 1px solid #A8B8D9;
+        border-left: 1px solid #A8B8D9;
+        border-right: 1px solid #A8B8D9;
+        padding: 6px 0px 6px 0px;
+        color: #253555;
+        font-weight: bold;
+        text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+        background-image:url('nav_f.png');
+        background-repeat:repeat-x;
+        background-color: #E2E8F2;
+        /* opera specific markup */
+        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        border-top-right-radius: 4px;
+        border-top-left-radius: 4px;
+        /* firefox specific markup */
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+        -moz-border-radius-topright: 4px;
+        -moz-border-radius-topleft: 4px;
+        /* webkit specific markup */
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        -webkit-border-top-right-radius: 4px;
+        -webkit-border-top-left-radius: 4px;
+
 }
-.memproto {
-  background-color: #d5e1e8;
-  width: 100%;
-  border-width: 1px;
-  border-style: solid;
-  border-color: #84b0c7;
-  font-weight: bold;
-  -moz-border-radius: 8px 8px 8px 8px;
+
+.memdoc, dl.reflist dd {
+        border-bottom: 1px solid #A8B8D9;      
+        border-left: 1px solid #A8B8D9;      
+        border-right: 1px solid #A8B8D9; 
+        padding: 6px 10px 2px 10px;
+        background-color: #FBFCFD;
+        border-top-width: 0;
+        background-image:url('nav_g.png');
+        background-repeat:repeat-x;
+        background-color: #FFFFFF;
+        /* opera specific markup */
+        border-bottom-left-radius: 4px;
+        border-bottom-right-radius: 4px;
+        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        /* firefox specific markup */
+        -moz-border-radius-bottomleft: 4px;
+        -moz-border-radius-bottomright: 4px;
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+        /* webkit specific markup */
+        -webkit-border-bottom-left-radius: 4px;
+        -webkit-border-bottom-right-radius: 4px;
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+}
+
+dl.reflist dt {
+        padding: 5px;
 }
+
+dl.reflist dd {
+        margin: 0px 0px 10px 0px;
+        padding: 5px;
+}
+
 .paramkey {
-  text-align: right;
+	text-align: right;
 }
+
 .paramtype {
-  white-space: nowrap;
+	white-space: nowrap;
 }
+
 .paramname {
-  color: #602020;
-  font-style: italic;
-}
-/* End Styling for detailed member documentation */
-
-/* for the tree view */
-.ftvtree {
-	font-family: sans-serif;
-	margin:0.5em;
-}
-.directory { font-size: 9pt; font-weight: bold; }
-.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; }
-.directory > h3 { margin-top: 0; }
-.directory p { margin: 0px; white-space: nowrap; }
-.directory div { display: none; margin: 0px; }
-.directory img { vertical-align: -30%; }
+	color: #602020;
+	white-space: nowrap;
+}
+.paramname em {
+	font-style: normal;
+}
+.paramname code {
+        line-height: 14px;
+}
+
+.params, .retval, .exception, .tparams {
+        margin-left: 0px;
+        padding-left: 0px;
+}       
+
+.params .paramname, .retval .paramname {
+        font-weight: bold;
+        vertical-align: top;
+}
+        
+.params .paramtype {
+        font-style: italic;
+        vertical-align: top;
+}       
+        
+.params .paramdir {
+        font-family: "courier new",courier,monospace;
+        vertical-align: top;
+}
+
+table.mlabels {
+	border-spacing: 0px;
+}
+
+td.mlabels-left {
+	width: 100%;
+	padding: 0px;
+}
+
+td.mlabels-right {
+	vertical-align: bottom;
+	padding: 0px;
+	white-space: nowrap;
+}
+
+span.mlabels {
+        margin-left: 8px;
+}
+
+span.mlabel {
+        background-color: #728DC1;
+        border-top:1px solid #5373B4;
+        border-left:1px solid #5373B4;
+        border-right:1px solid #C4CFE5;
+        border-bottom:1px solid #C4CFE5;
+	text-shadow: none;
+	color: white;
+	margin-right: 4px;
+	padding: 2px 3px;
+	border-radius: 3px;
+	font-size: 7pt;
+	white-space: nowrap;
+	vertical-align: middle;
+}
+
+
+
+/* @end */
+
+/* these are for tree view when not used as main index */
+
+div.directory {
+        margin: 10px 0px;
+        border-top: 1px solid #A8B8D9;
+        border-bottom: 1px solid #A8B8D9;
+        width: 100%;
+}
+
+.directory table {
+        border-collapse:collapse;
+}
+
+.directory td {
+        margin: 0px;
+        padding: 0px;
+	vertical-align: top;
+}
+
+.directory td.entry {
+        white-space: nowrap;
+        padding-right: 6px;
+}
+
+.directory td.entry a {
+        outline:none;
+}
+
+.directory td.entry a img {
+        border: none;
+}
+
+.directory td.desc {
+        width: 100%;
+        padding-left: 6px;
+	padding-right: 6px;
+	padding-top: 3px;
+	border-left: 1px solid rgba(0,0,0,0.05);
+}
+
+.directory tr.even {
+	padding-left: 6px;
+	background-color: #F7F8FB;
+}
+
+.directory img {
+	vertical-align: -30%;
+}
+
+.directory .levels {
+        white-space: nowrap;
+        width: 100%;
+        text-align: right;
+        font-size: 9pt;
+}
+
+.directory .levels span {
+        cursor: pointer;
+        padding-left: 2px;
+        padding-right: 2px;
+	color: #3D578C;
+}
+
+div.dynheader {
+        margin-top: 8px;
+	-webkit-touch-callout: none;
+	-webkit-user-select: none;
+	-khtml-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	user-select: none;
+}
+
+address {
+	font-style: normal;
+	color: #2A3D61;
+}
+
+table.doxtable {
+	border-collapse:collapse;
+        margin-top: 4px;
+        margin-bottom: 4px;
+}
+
+table.doxtable td, table.doxtable th {
+	border: 1px solid #2D4068;
+	padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+	background-color: #374F7F;
+	color: #FFFFFF;
+	font-size: 110%;
+	padding-bottom: 4px;
+	padding-top: 5px;
+}
+
+table.fieldtable {
+        /*width: 100%;*/
+        margin-bottom: 10px;
+        border: 1px solid #A8B8D9;
+        border-spacing: 0px;
+        -moz-border-radius: 4px;
+        -webkit-border-radius: 4px;
+        border-radius: 4px;
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+        -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
+        box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
+}
+
+.fieldtable td, .fieldtable th {
+        padding: 3px 7px 2px;
+}
+
+.fieldtable td.fieldtype, .fieldtable td.fieldname {
+        white-space: nowrap;
+        border-right: 1px solid #A8B8D9;
+        border-bottom: 1px solid #A8B8D9;
+        vertical-align: top;
+}
+
+.fieldtable td.fieldname {
+        padding-top: 5px;
+}
+
+.fieldtable td.fielddoc {
+        border-bottom: 1px solid #A8B8D9;
+        /*width: 100%;*/
+}
+
+.fieldtable td.fielddoc p:first-child {
+        margin-top: 2px;
+}       
+        
+.fieldtable td.fielddoc p:last-child {
+        margin-bottom: 2px;
+}
+
+.fieldtable tr:last-child td {
+        border-bottom: none;
+}
+
+.fieldtable th {
+        background-image:url('nav_f.png');
+        background-repeat:repeat-x;
+        background-color: #E2E8F2;
+        font-size: 90%;
+        color: #253555;
+        padding-bottom: 4px;
+        padding-top: 5px;
+        text-align:left;
+        -moz-border-radius-topleft: 4px;
+        -moz-border-radius-topright: 4px;
+        -webkit-border-top-left-radius: 4px;
+        -webkit-border-top-right-radius: 4px;
+        border-top-left-radius: 4px;
+        border-top-right-radius: 4px;
+        border-bottom: 1px solid #A8B8D9;
+}
+
+
+.tabsearch {
+	top: 0px;
+	left: 10px;
+	height: 36px;
+	background-image: url('tab_b.png');
+	z-index: 101;
+	overflow: hidden;
+	font-size: 13px;
+}
+
+.navpath ul
+{
+	font-size: 11px;
+	background-image:url('tab_b.png');
+	background-repeat:repeat-x;
+	background-position: 0 -5px;
+	height:30px;
+	line-height:30px;
+	color:#8AA0CC;
+	border:solid 1px #C2CDE4;
+	overflow:hidden;
+	margin:0px;
+	padding:0px;
+}
+
+.navpath li
+{
+	list-style-type:none;
+	float:left;
+	padding-left:10px;
+	padding-right:15px;
+	background-image:url('bc_s.png');
+	background-repeat:no-repeat;
+	background-position:right;
+	color:#364D7C;
+}
+
+.navpath li.navelem a
+{
+	height:32px;
+	display:block;
+	text-decoration: none;
+	outline: none;
+	color: #283A5D;
+	font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
+	text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+	text-decoration: none;        
+}
+
+.navpath li.navelem a:hover
+{
+	color:#6884BD;
+}
+
+.navpath li.footer
+{
+        list-style-type:none;
+        float:right;
+        padding-left:10px;
+        padding-right:15px;
+        background-image:none;
+        background-repeat:no-repeat;
+        background-position:right;
+        color:#364D7C;
+        font-size: 8pt;
+}
+
+
+div.summary
+{
+	float: right;
+	font-size: 8pt;
+	padding-right: 5px;
+	width: 50%;
+	text-align: right;
+}       
+
+div.summary a
+{
+	white-space: nowrap;
+}
+
+div.ingroups
+{
+	font-size: 8pt;
+	width: 50%;
+	text-align: left;
+}
+
+div.ingroups a
+{
+	white-space: nowrap;
+}
+
+div.header
+{
+        background-image:url('nav_h.png');
+        background-repeat:repeat-x;
+	background-color: #F9FAFC;
+	margin:  0px;
+	border-bottom: 1px solid #C4CFE5;
+}
+
+div.headertitle
+{
+	padding: 5px 5px 5px 10px;
+}
+
+dl
+{
+        padding: 0 0 0 10px;
+}
+
+/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
+dl.section
+{
+	margin-left: 0px;
+	padding-left: 0px;
+}
+
+dl.note
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #D0C000;
+}
+
+dl.warning, dl.attention
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #FF0000;
+}
+
+dl.pre, dl.post, dl.invariant
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #00D000;
+}
+
+dl.deprecated
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #505050;
+}
+
+dl.todo
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #00C0E0;
+}
+
+dl.test
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #3030E0;
+}
+
+dl.bug
+{
+        margin-left:-7px;
+        padding-left: 3px;
+        border-left:4px solid;
+        border-color: #C08050;
+}
+
+dl.section dd {
+	margin-bottom: 6px;
+}
+
+
+#projectlogo
+{
+	text-align: center;
+	vertical-align: bottom;
+	border-collapse: separate;
+}
+ 
+#projectlogo img
+{ 
+	border: 0px none;
+}
+ 
+#projectname
+{
+	font: 300% Tahoma, Arial,sans-serif;
+	margin: 0px;
+	padding: 2px 0px;
+}
+    
+#projectbrief
+{
+	font: 120% Tahoma, Arial,sans-serif;
+	margin: 0px;
+	padding: 0px;
+}
+
+#projectnumber
+{
+	font: 50% Tahoma, Arial,sans-serif;
+	margin: 0px;
+	padding: 0px;
+}
+
+#titlearea
+{
+	padding: 0px;
+	margin: 0px;
+	width: 100%;
+	border-bottom: 1px solid #5373B4;
+}
+
+.image
+{
+        text-align: center;
+}
+
+.dotgraph
+{
+        text-align: center;
+}
+
+.mscgraph
+{
+        text-align: center;
+}
+
+.caption
+{
+	font-weight: bold;
+}
+
+div.zoom
+{
+	border: 1px solid #90A5CE;
+}
+
+dl.citelist {
+        margin-bottom:50px;
+}
+
+dl.citelist dt {
+        color:#334975;
+        float:left;
+        font-weight:bold;
+        margin-right:10px;
+        padding:5px;
+}
+
+dl.citelist dd {
+        margin:2px 0;
+        padding:5px 0;
+}
+
+div.toc {
+        padding: 14px 25px;
+        background-color: #F4F6FA;
+        border: 1px solid #D8DFEE;
+        border-radius: 7px 7px 7px 7px;
+        float: right;
+        height: auto;
+        margin: 0 20px 10px 10px;
+        width: 200px;
+}
+
+div.toc li {
+        background: url("bdwn.png") no-repeat scroll 0 5px transparent;
+        font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif;
+        margin-top: 5px;
+        padding-left: 10px;
+        padding-top: 2px;
+}
+
+div.toc h3 {
+        font: bold 12px/1.2 Arial,FreeSans,sans-serif;
+	color: #4665A2;
+        border-bottom: 0 none;
+        margin: 0;
+}
+
+div.toc ul {
+        list-style: none outside none;
+        border: medium none;
+        padding: 0px;
+}       
+
+div.toc li.level1 {
+        margin-left: 0px;
+}
+
+div.toc li.level2 {
+        margin-left: 15px;
+}
+
+div.toc li.level3 {
+        margin-left: 30px;
+}
+
+div.toc li.level4 {
+        margin-left: 45px;
+}
+
+.inherit_header {
+        font-weight: bold;
+        color: gray;
+        cursor: pointer;
+	-webkit-touch-callout: none;
+	-webkit-user-select: none;
+	-khtml-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	user-select: none;
+}
+
+.inherit_header td {
+        padding: 6px 0px 2px 5px;
+}
+
+.inherit {
+        display: none;
+}
+
+tr.heading h2 {
+        margin-top: 12px;
+        margin-bottom: 4px;
+}
+
+ at media print
+{
+  #top { display: none; }
+  #side-nav { display: none; }
+  #nav-path { display: none; }
+  body { overflow:visible; }
+  h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
+  .summary { display: none; }
+  .memitem { page-break-inside: avoid; }
+  #doc-content
+  {
+    margin-left:0 !important;
+    height:auto !important;
+    width:auto !important;
+    overflow:inherit;
+    display:inline;
+  }
+}
 
diff --git a/html/doxygen.png b/html/doxygen.png
index f0a274b..3ff17d8 100644
Binary files a/html/doxygen.png and b/html/doxygen.png differ
diff --git a/html/dynsections.js b/html/dynsections.js
new file mode 100644
index 0000000..ed092c7
--- /dev/null
+++ b/html/dynsections.js
@@ -0,0 +1,97 @@
+function toggleVisibility(linkObj)
+{
+ var base = $(linkObj).attr('id');
+ var summary = $('#'+base+'-summary');
+ var content = $('#'+base+'-content');
+ var trigger = $('#'+base+'-trigger');
+ var src=$(trigger).attr('src');
+ if (content.is(':visible')===true) {
+   content.hide();
+   summary.show();
+   $(linkObj).addClass('closed').removeClass('opened');
+   $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
+ } else {
+   content.show();
+   summary.hide();
+   $(linkObj).removeClass('closed').addClass('opened');
+   $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
+ } 
+ return false;
+}
+
+function updateStripes()
+{
+  $('table.directory tr').
+       removeClass('even').filter(':visible:even').addClass('even');
+}
+function toggleLevel(level)
+{
+  $('table.directory tr').each(function(){ 
+    var l = this.id.split('_').length-1;
+    var i = $('#img'+this.id.substring(3));
+    var a = $('#arr'+this.id.substring(3));
+    if (l<level+1) {
+      i.attr('src','ftv2folderopen.png');
+      a.attr('src','ftv2mnode.png');
+      $(this).show();
+    } else if (l==level+1) {
+      i.attr('src','ftv2folderclosed.png');
+      a.attr('src','ftv2pnode.png');
+      $(this).show();
+    } else {
+      $(this).hide();
+    }
+  });
+  updateStripes();
+}
+
+function toggleFolder(id)
+{
+  //The clicked row
+  var currentRow = $('#row_'+id);
+  var currentRowImages = currentRow.find("img");
+
+  //All rows after the clicked row
+  var rows = currentRow.nextAll("tr");
+
+  //Only match elements AFTER this one (can't hide elements before)
+  var childRows = rows.filter(function() {
+    var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
+    return this.id.match(re);
+  });
+
+  //First row is visible we are HIDING
+  if (childRows.filter(':first').is(':visible')===true) {
+    currentRowImages.filter("[id^=arr]").attr('src', 'ftv2pnode.png');
+    currentRowImages.filter("[id^=img]").attr('src', 'ftv2folderclosed.png');
+    rows.filter("[id^=row_"+id+"]").hide();
+  } else { //We are SHOWING
+    //All sub images
+    var childImages = childRows.find("img");
+    var childImg = childImages.filter("[id^=img]");
+    var childArr = childImages.filter("[id^=arr]");
+
+    currentRow.find("[id^=arr]").attr('src', 'ftv2mnode.png'); //open row
+    currentRow.find("[id^=img]").attr('src', 'ftv2folderopen.png'); //open row
+    childImg.attr('src','ftv2folderclosed.png'); //children closed
+    childArr.attr('src','ftv2pnode.png'); //children closed
+    childRows.show(); //show all children
+  }
+  updateStripes();
+}
+
+
+function toggleInherit(id)
+{
+  var rows = $('tr.inherit.'+id);
+  var img = $('tr.inherit_header.'+id+' img');
+  var src = $(img).attr('src');
+  if (rows.filter(':first').is(':visible')===true) {
+    rows.css('display','none');
+    $(img).attr('src',src.substring(0,src.length-8)+'closed.png');
+  } else {
+    rows.css('display','table-row'); // using show() causes jump in firefox
+    $(img).attr('src',src.substring(0,src.length-10)+'open.png');
+  }
+}
+
diff --git a/html/files.html b/html/files.html
index 25c3f56..2d9c727 100644
--- a/html/files.html
+++ b/html/files.html
@@ -1,153 +1,193 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: File Index</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>FORS Pipeline Reference Manual File List</h1>Here is a list of all documented files with brief descriptions:<table>
-  <tr><td class="indexkey"><b>create_phot.c</b> <a href="create__phot_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>create_stetson.c</b> <a href="create__stetson_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors-test.c</b> <a href="fors-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_align_sky.c</b> <a href="fors__align__sky_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_align_sky_lss.c</b> <a href="fors__align__sky__lss_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_bias-test.c</b> <a href="fors__bias-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_bias.c</b> <a href="fors__bias_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_bias_impl.c</b> <a href="fors__bias__impl_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_bias_impl.h</b> <a href="fors__bias__impl_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_calib.c</b> <a href="fors__calib_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_config.c</b> <a href="fors__config_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_cpl_wcs-test.c</b> <a href="fors__cpl__wcs-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_cpl_wcs.c</b> <a href="fors__cpl__wcs_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_cpl_wcs.h</b> <a href="fors__cpl__wcs_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_dark-test.c</b> <a href="fors__dark-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_dark.c</b> <a href="fors__dark_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_dark_impl.c</b> <a href="fors__dark__impl_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_dark_impl.h</b> <a href="fors__dark__impl_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_data.c</b> <a href="fors__data_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_data.h</b> <a href="fors__data_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_detect_objects.c</b> <a href="fors__detect__objects_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_detect_spectra.c</b> <a href="fors__detect__spectra_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_detlin.c</b> <a href="fors__detlin_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_dfs.c</b> <a href="fors__dfs_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_dfs.h</b> <a href="fors__dfs_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_double.c</b> <a href="fors__double_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_double.h</b> <a href="fors__double_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors/fors_extract.c</b> <a href="fors_2fors__extract_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>recipes/fors_extract.c</b> <a href="recipes_2fors__extract_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_extract.h</b> <a href="fors__extract_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_extract_objects.c</b> <a href="fors__extract__objects_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_extract_slits.c</b> <a href="fors__extract__slits_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_flat.c</b> <a href="fors__flat_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_flatfield.c</b> <a href="fors__flatfield_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_header.c</b> <a href="fors__header_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_header.h</b> <a href="fors__header_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_identify-test.c</b> <a href="fors__identify-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_identify.c</b> <a href="fors__identify_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_identify.h</b> <a href="fors__identify_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_image-test.c</b> <a href="fors__image-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_image.c</b> <a href="fors__image_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_image.h</b> <a href="fors__image_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_science-test.c</b> <a href="fors__img__science-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_science.c</b> <a href="fors__img__science_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_science_impl.c</b> <a href="fors__img__science__impl_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_science_impl.h</b> <a href="fors__img__science__impl_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_screen_flat-test.c</b> <a href="fors__img__screen__flat-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_screen_flat.c</b> <a href="fors__img__screen__flat_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_screen_flat_impl.c</b> <a href="fors__img__screen__flat__impl_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_screen_flat_impl.h</b> <a href="fors__img__screen__flat__impl_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_sky_flat-test.c</b> <a href="fors__img__sky__flat-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_sky_flat.c</b> <a href="fors__img__sky__flat_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_sky_flat_impl.c</b> <a href="fors__img__sky__flat__impl_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_img_sky_flat_impl.h</b> <a href="fors__img__sky__flat__impl_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_instrument.c</b> <a href="fors__instrument_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_instrument.h</b> <a href="fors__instrument_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_normalise_flat.c</b> <a href="fors__normalise__flat_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_paf.c</b> <a href="fors__paf_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_paf.h</b> <a href="fors__paf_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_pattern-test.c</b> <a href="fors__pattern-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_pattern.c</b> <a href="fors__pattern_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_pattern.h</b> <a href="fors__pattern_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_pfits.c</b> <a href="fors__pfits_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_pfits.h</b> <a href="fors__pfits_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_photometry-test.c</b> <a href="fors__photometry-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_photometry.c</b> <a href="fors__photometry_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_photometry_impl.c</b> <a href="fors__photometry__impl_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_photometry_impl.h</b> <a href="fors__photometry__impl_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_pmos_calib.c</b> <a href="fors__pmos__calib_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_pmos_extract.c</b> <a href="fors__pmos__extract_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_pmos_science.c</b> <a href="fors__pmos__science_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_point-test.c</b> <a href="fors__point-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_point.c</b> <a href="fors__point_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_point.h</b> <a href="fors__point_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_polynomial.c</b> <a href="fors__polynomial_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_polynomial.h</b> <a href="fors__polynomial_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_qc-test.c</b> <a href="fors__qc-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_qc.c</b> <a href="fors__qc_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_qc.h</b> <a href="fors__qc_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_recipe.c</b> <a href="fors__recipe_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_recipe_impl.h</b> <a href="fors__recipe__impl_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_remove_bias.c</b> <a href="fors__remove__bias_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_resample.c</b> <a href="fors__resample_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_science.c</b> <a href="fors__science_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_setting-test.c</b> <a href="fors__setting-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_setting.c</b> <a href="fors__setting_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_setting.h</b> <a href="fors__setting_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_stack-test.c</b> <a href="fors__stack-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_stack.c</b> <a href="fors__stack_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_stack.h</b> <a href="fors__stack_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_star-test.c</b> <a href="fors__star-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_star.c</b> <a href="fors__star_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_star.h</b> <a href="fors__star_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_std_cat.c</b> <a href="fors__std__cat_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_std_cat.h</b> <a href="fors__std__cat_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_std_star-test.c</b> <a href="fors__std__star-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_std_star.c</b> <a href="fors__std__star_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_std_star.h</b> <a href="fors__std__star_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_subtract_sky.c</b> <a href="fors__subtract__sky_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_subtract_sky_lss.c</b> <a href="fors__subtract__sky__lss_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_sumflux.c</b> <a href="fors__sumflux_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_tools.c</b> <a href="fors__tools_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_tools.h</b> <a href="fors__tools_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_trace_flat.c</b> <a href="fors__trace__flat_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_utils.c</b> <a href="fors__utils_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_utils.h</b> <a href="fors__utils_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_wave_calib.c</b> <a href="fors__wave__calib_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_wave_calib_lss.c</b> <a href="fors__wave__calib__lss_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_zeropoint-test.c</b> <a href="fors__zeropoint-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_zeropoint.c</b> <a href="fors__zeropoint_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_zeropoint_impl.c</b> <a href="fors__zeropoint__impl_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>fors_zeropoint_impl.h</b> <a href="fors__zeropoint__impl_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>list-test.c</b> <a href="list-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>list.c</b> <a href="list_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>list.h</b> <a href="list_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>list_void.h</b> <a href="list__void_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>montecarlo.c</b> <a href="montecarlo_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>moses.c</b> <a href="moses_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>moses.h</b> <a href="moses_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>recipes-test.c</b> <a href="recipes-test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>test.c</b> <a href="test_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>test.h</b> <a href="test_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>test_hough.c</b> <a href="test__hough_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>test_simulate.c</b> <a href="test__simulate_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>test_simulate.h</b> <a href="test__simulate_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>vimos_calib.c</b> <a href="vimos__calib_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>vimos_calib_impl.c</b> <a href="vimos__calib__impl_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>vimos_calib_impl.h</b> <a href="vimos__calib__impl_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>vimos_science.c</b> <a href="vimos__science_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>vimos_science_impl.c</b> <a href="vimos__science__impl_8c-source.html">[code]</a></td><td class="indexvalue"></td></tr>
-  <tr><td class="indexkey"><b>vimos_science_impl.h</b> <a href="vimos__science__impl_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: File List</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li class="current"><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">File List</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="textblock">Here is a list of all documented files with brief descriptions:</div><div class="directory">
+<table class="directory">
+<tr id="row_0_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="create__phot_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>create_phot.c</b></td><td class="desc"></td></tr>
+<tr id="row_1_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="create__stetson_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>create_stetson.c</b></td><td class="desc"></td></tr>
+<tr id="row_2_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_3_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__align__sky_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_align_sky.c</b></td><td class="desc"></td></tr>
+<tr id="row_4_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__align__sky__lss_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_align_sky_lss.c</b></td><td class="desc"></td></tr>
+<tr id="row_5_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__bias-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_bias-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_6_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__bias_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_bias.c</b></td><td class="desc"></td></tr>
+<tr id="row_7_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__bias__impl_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_bias_impl.c</b></td><td class="desc"></td></tr>
+<tr id="row_8_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__bias__impl_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_bias_impl.h</b></td><td class="desc"></td></tr>
+<tr id="row_9_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__config_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_config.c</b></td><td class="desc"></td></tr>
+<tr id="row_10_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__cpl__wcs-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_cpl_wcs-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_11_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__cpl__wcs_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_cpl_wcs.c</b></td><td class="desc"></td></tr>
+<tr id="row_12_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__cpl__wcs_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_cpl_wcs.h</b></td><td class="desc"></td></tr>
+<tr id="row_13_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__dark-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_dark-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_14_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__dark_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_dark.c</b></td><td class="desc"></td></tr>
+<tr id="row_15_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__dark__impl_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_dark_impl.c</b></td><td class="desc"></td></tr>
+<tr id="row_16_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__dark__impl_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_dark_impl.h</b></td><td class="desc"></td></tr>
+<tr id="row_17_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__data_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_data.c</b></td><td class="desc"></td></tr>
+<tr id="row_18_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__data_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_data.h</b></td><td class="desc"></td></tr>
+<tr id="row_19_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__detect__objects_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_detect_objects.c</b></td><td class="desc"></td></tr>
+<tr id="row_20_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__detect__spectra_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_detect_spectra.c</b></td><td class="desc"></td></tr>
+<tr id="row_21_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__detected__slits_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_detected_slits.h</b></td><td class="desc"></td></tr>
+<tr id="row_22_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__detlin_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_detlin.c</b></td><td class="desc"></td></tr>
+<tr id="row_23_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__dfs_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_dfs.c</b></td><td class="desc"></td></tr>
+<tr id="row_24_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__dfs_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_dfs.h</b></td><td class="desc"></td></tr>
+<tr id="row_25_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__double_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_double.c</b></td><td class="desc"></td></tr>
+<tr id="row_26_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__double_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_double.h</b></td><td class="desc"></td></tr>
+<tr id="row_27_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors_2fors__extract_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors/fors_extract.c</b></td><td class="desc"></td></tr>
+<tr id="row_28_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="recipes_2fors__extract_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>recipes/fors_extract.c</b></td><td class="desc"></td></tr>
+<tr id="row_29_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__extract_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_extract.h</b></td><td class="desc"></td></tr>
+<tr id="row_30_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__extract__objects_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_extract_objects.c</b></td><td class="desc"></td></tr>
+<tr id="row_31_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__extract__slits_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_extract_slits.c</b></td><td class="desc"></td></tr>
+<tr id="row_32_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__flat__normalise_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_flat_normalise.h</b></td><td class="desc"></td></tr>
+<tr id="row_33_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__flatfield_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_flatfield.c</b></td><td class="desc"></td></tr>
+<tr id="row_34_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__header_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_header.c</b></td><td class="desc"></td></tr>
+<tr id="row_35_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__header_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_header.h</b></td><td class="desc"></td></tr>
+<tr id="row_36_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__identify-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_identify-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_37_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__identify_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_identify.c</b></td><td class="desc"></td></tr>
+<tr id="row_38_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__identify_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_identify.h</b></td><td class="desc"></td></tr>
+<tr id="row_39_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__image-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_image-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_40_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__image_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_image.c</b></td><td class="desc"></td></tr>
+<tr id="row_41_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__image_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_image.h</b></td><td class="desc"></td></tr>
+<tr id="row_42_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__science-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_science-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_43_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__science_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_science.c</b></td><td class="desc"></td></tr>
+<tr id="row_44_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__science__impl_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_science_impl.c</b></td><td class="desc"></td></tr>
+<tr id="row_45_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__science__impl_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_science_impl.h</b></td><td class="desc"></td></tr>
+<tr id="row_46_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__screen__flat-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_screen_flat-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_47_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__screen__flat_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_screen_flat.c</b></td><td class="desc"></td></tr>
+<tr id="row_48_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__screen__flat__impl_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_screen_flat_impl.c</b></td><td class="desc"></td></tr>
+<tr id="row_49_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__screen__flat__impl_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_screen_flat_impl.h</b></td><td class="desc"></td></tr>
+<tr id="row_50_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__sky__flat-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_sky_flat-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_51_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__sky__flat_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_sky_flat.c</b></td><td class="desc"></td></tr>
+<tr id="row_52_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__sky__flat__impl_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_sky_flat_impl.c</b></td><td class="desc"></td></tr>
+<tr id="row_53_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__img__sky__flat__impl_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_img_sky_flat_impl.h</b></td><td class="desc"></td></tr>
+<tr id="row_54_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__instrument_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_instrument.c</b></td><td class="desc"></td></tr>
+<tr id="row_55_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__instrument_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_instrument.h</b></td><td class="desc"></td></tr>
+<tr id="row_56_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__normalise__flat_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_normalise_flat.c</b></td><td class="desc"></td></tr>
+<tr id="row_57_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__overscan_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_overscan.h</b></td><td class="desc"></td></tr>
+<tr id="row_58_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__paf_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_paf.c</b></td><td class="desc"></td></tr>
+<tr id="row_59_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__paf_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_paf.h</b></td><td class="desc"></td></tr>
+<tr id="row_60_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__pattern-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_pattern-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_61_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__pattern_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_pattern.c</b></td><td class="desc"></td></tr>
+<tr id="row_62_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__pattern_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_pattern.h</b></td><td class="desc"></td></tr>
+<tr id="row_63_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__pfits_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_pfits.c</b></td><td class="desc"></td></tr>
+<tr id="row_64_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__pfits_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_pfits.h</b></td><td class="desc"></td></tr>
+<tr id="row_65_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__photometry-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_photometry-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_66_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__photometry_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_photometry.c</b></td><td class="desc"></td></tr>
+<tr id="row_67_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__photometry__impl_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_photometry_impl.c</b></td><td class="desc"></td></tr>
+<tr id="row_68_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__photometry__impl_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_photometry_impl.h</b></td><td class="desc"></td></tr>
+<tr id="row_69_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__pmos__calib_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_pmos_calib.c</b></td><td class="desc"></td></tr>
+<tr id="row_70_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__pmos__extract_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_pmos_extract.c</b></td><td class="desc"></td></tr>
+<tr id="row_71_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__pmos__science_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_pmos_science.c</b></td><td class="desc"></td></tr>
+<tr id="row_72_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__point-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_point-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_73_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__point_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_point.c</b></td><td class="desc"></td></tr>
+<tr id="row_74_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__point_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_point.h</b></td><td class="desc"></td></tr>
+<tr id="row_75_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__polynomial_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_polynomial.c</b></td><td class="desc"></td></tr>
+<tr id="row_76_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__polynomial_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_polynomial.h</b></td><td class="desc"></td></tr>
+<tr id="row_77_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__qc-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_qc-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_78_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__qc_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_qc.c</b></td><td class="desc"></td></tr>
+<tr id="row_79_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__qc_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_qc.h</b></td><td class="desc"></td></tr>
+<tr id="row_80_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__recipe_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_recipe.c</b></td><td class="desc"></td></tr>
+<tr id="row_81_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__recipe__impl_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_recipe_impl.h</b></td><td class="desc"></td></tr>
+<tr id="row_82_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__remove__bias_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_remove_bias.c</b></td><td class="desc"></td></tr>
+<tr id="row_83_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__resample_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_resample.c</b></td><td class="desc"></td></tr>
+<tr id="row_84_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__science_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_science.c</b></td><td class="desc"></td></tr>
+<tr id="row_85_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__setting-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_setting-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_86_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__setting_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_setting.c</b></td><td class="desc"></td></tr>
+<tr id="row_87_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__setting_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_setting.h</b></td><td class="desc"></td></tr>
+<tr id="row_88_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__stack-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_stack-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_89_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__stack_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_stack.c</b></td><td class="desc"></td></tr>
+<tr id="row_90_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__stack_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_stack.h</b></td><td class="desc"></td></tr>
+<tr id="row_91_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__star-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_star-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_92_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__star_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_star.c</b></td><td class="desc"></td></tr>
+<tr id="row_93_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__star_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_star.h</b></td><td class="desc"></td></tr>
+<tr id="row_94_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__std__cat_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_std_cat.c</b></td><td class="desc"></td></tr>
+<tr id="row_95_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__std__cat_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_std_cat.h</b></td><td class="desc"></td></tr>
+<tr id="row_96_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__std__star-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_std_star-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_97_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__std__star_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_std_star.c</b></td><td class="desc"></td></tr>
+<tr id="row_98_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__std__star_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_std_star.h</b></td><td class="desc"></td></tr>
+<tr id="row_99_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__subtract__sky_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_subtract_sky.c</b></td><td class="desc"></td></tr>
+<tr id="row_100_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__subtract__sky__lss_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_subtract_sky_lss.c</b></td><td class="desc"></td></tr>
+<tr id="row_101_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__sumflux_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_sumflux.c</b></td><td class="desc"></td></tr>
+<tr id="row_102_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__tools_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_tools.c</b></td><td class="desc"></td></tr>
+<tr id="row_103_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__tools_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_tools.h</b></td><td class="desc"></td></tr>
+<tr id="row_104_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__trace__flat_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_trace_flat.c</b></td><td class="desc"></td></tr>
+<tr id="row_105_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__utils_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_utils.c</b></td><td class="desc"></td></tr>
+<tr id="row_106_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__utils_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_utils.h</b></td><td class="desc"></td></tr>
+<tr id="row_107_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__wave__calib_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_wave_calib.c</b></td><td class="desc"></td></tr>
+<tr id="row_108_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__wave__calib__lss_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_wave_calib_lss.c</b></td><td class="desc"></td></tr>
+<tr id="row_109_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__zeropoint-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_zeropoint-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_110_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__zeropoint_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_zeropoint.c</b></td><td class="desc"></td></tr>
+<tr id="row_111_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__zeropoint__impl_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_zeropoint_impl.c</b></td><td class="desc"></td></tr>
+<tr id="row_112_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="fors__zeropoint__impl_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>fors_zeropoint_impl.h</b></td><td class="desc"></td></tr>
+<tr id="row_113_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="list-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>list-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_114_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="list_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>list.c</b></td><td class="desc"></td></tr>
+<tr id="row_115_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="list_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>list.h</b></td><td class="desc"></td></tr>
+<tr id="row_116_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="list__void_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>list_void.h</b></td><td class="desc"></td></tr>
+<tr id="row_117_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="montecarlo_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>montecarlo.c</b></td><td class="desc"></td></tr>
+<tr id="row_118_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="moses_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>moses.c</b></td><td class="desc"></td></tr>
+<tr id="row_119_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="moses_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>moses.h</b></td><td class="desc"></td></tr>
+<tr id="row_120_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="recipes-test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>recipes-test.c</b></td><td class="desc"></td></tr>
+<tr id="row_121_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="test_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>test.c</b></td><td class="desc"></td></tr>
+<tr id="row_122_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="test_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>test.h</b></td><td class="desc"></td></tr>
+<tr id="row_123_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="test__hough_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>test_hough.c</b></td><td class="desc"></td></tr>
+<tr id="row_124_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="test__simulate_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>test_simulate.c</b></td><td class="desc"></td></tr>
+<tr id="row_125_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="test__simulate_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>test_simulate.h</b></td><td class="desc"></td></tr>
+<tr id="row_126_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="vimos__calib_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>vimos_calib.c</b></td><td class="desc"></td></tr>
+<tr id="row_127_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="vimos__calib__impl_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>vimos_calib_impl.c</b></td><td class="desc"></td></tr>
+<tr id="row_128_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="vimos__calib__impl_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>vimos_calib_impl.h</b></td><td class="desc"></td></tr>
+<tr id="row_129_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="vimos__science_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>vimos_science.c</b></td><td class="desc"></td></tr>
+<tr id="row_130_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a href="vimos__science__impl_8c_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>vimos_science_impl.c</b></td><td class="desc"></td></tr>
+<tr id="row_131_"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><a href="vimos__science__impl_8h_source.html"><img src="ftv2doc.png" alt="*" width="24" height="22" /></a><b>vimos_science_impl.h</b></td><td class="desc"></td></tr>
+</table>
+</div><!-- directory -->
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/fors-test_8c-source.html b/html/fors-test_8c-source.html
deleted file mode 100644
index 8838b3c..0000000
--- a/html/fors-test_8c-source.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors-test.c,v 1.2 2007/07/09 06:59:34 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/07/09 06:59:34 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <test.h></span>
-<a name="l00034"></a>00034 
-<a name="l00047"></a>00047 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00048"></a><a class="code" href="group__fors__test.html#g42fa16bf6366aa153d18ccc091115217">00048</a> <a class="code" href="group__fors__test.html#g42fa16bf6366aa153d18ccc091115217">test_version</a>(<span class="keywordtype">void</span>)
-<a name="l00049"></a>00049 {
-<a name="l00050"></a>00050     test_eq(FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>());
-<a name="l00051"></a>00051 }
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 
-<a name="l00057"></a><a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00057</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00058"></a>00058 {
-<a name="l00059"></a>00059     TEST_INIT;
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061     <a class="code" href="group__fors__test.html#g42fa16bf6366aa153d18ccc091115217">test_version</a>();
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063     TEST_END;
-<a name="l00064"></a>00064 }
-<a name="l00065"></a>00065 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors-test_8c_source.html b/html/fors-test_8c_source.html
new file mode 100644
index 0000000..47924ce
--- /dev/null
+++ b/html/fors-test_8c_source.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors-test.c,v 1.2 2007-07-09 06:59:34 jmlarsen Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: jmlarsen $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007-07-09 06:59:34 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.2 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="group__fors__test.html#gaa0b61563ef767d8d2276e7ffe0b14f5e">   48</a></span> <a class="code" href="group__fors__test.html#gaa0b61563ef767d8d2276e7ffe0b14f5e" title="Check version number.">test_version</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> {</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>     test_eq(FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>());</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> }</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe">   57</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> {</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     TEST_INIT;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <a class="code" href="group__fors__test.html#gaa0b61563ef767d8d2276e7ffe0b14f5e" title="Check version number.">test_version</a>();</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     TEST_END;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> }</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors_2fors__extract_8c-source.html b/html/fors_2fors__extract_8c-source.html
deleted file mode 100644
index a87b82a..0000000
--- a/html/fors_2fors__extract_8c-source.html
+++ /dev/null
@@ -1,855 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_extract.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors/fors_extract.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_extract.c,v 1.45 2011/10/13 14:29:24 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/13 14:29:24 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.45 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_extract.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_star.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_tools.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include <string.h></span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include <math.h></span>
-<a name="l00045"></a>00045 
-<a name="l00052"></a>00052 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00053"></a>00053 <span class="comment">    (Proto)types</span>
-<a name="l00054"></a>00054 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00055"></a>00055 
-<a name="l00056"></a><a class="code" href="struct__extract__method.html">00056</a> <span class="keyword">struct </span><a class="code" href="struct__extract__method.html">_extract_method</a>
-<a name="l00057"></a>00057 {
-<a name="l00058"></a>00058     <span class="keyword">enum</span> {SEX, TEST} method;
-<a name="l00059"></a><a class="code" href="struct__extract__method.html#96e7cec5f46b8c296ed4d2d20e884b4a">00059</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="struct__extract__method.html#96e7cec5f46b8c296ed4d2d20e884b4a">sex_exe</a>;
-<a name="l00060"></a><a class="code" href="struct__extract__method.html#e76dd739b557c30e57acc0b8f69440b0">00060</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="struct__extract__method.html#e76dd739b557c30e57acc0b8f69440b0">sex_config</a>;
-<a name="l00061"></a><a class="code" href="struct__extract__method.html#1fee7344ac0997d0b446d6339a7760ad">00061</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="struct__extract__method.html#1fee7344ac0997d0b446d6339a7760ad">sex_mag</a>;
-<a name="l00062"></a><a class="code" href="struct__extract__method.html#9e966f3de33443a13329d9a4d602513e">00062</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="struct__extract__method.html#9e966f3de33443a13329d9a4d602513e">sex_magerr</a>;
-<a name="l00063"></a><a class="code" href="struct__extract__method.html#b690a500e917441e8e043ec876bf40c8">00063</a>     <span class="keywordtype">int</span> <a class="code" href="struct__extract__method.html#b690a500e917441e8e043ec876bf40c8">sex_radius</a>;
-<a name="l00064"></a>00064 };
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="keyword">static</span> fors_star_list *
-<a name="l00067"></a>00067 <a class="code" href="group__fors__extract.html#g5237e1161aeef9d828a973333151a36f">extract_sex</a>(                                <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,
-<a name="l00068"></a>00068                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00069"></a>00069                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_exe,
-<a name="l00070"></a>00070                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_config,
-<a name="l00071"></a>00071                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_mag,
-<a name="l00072"></a>00072                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_magerr,
-<a name="l00073"></a>00073                                             <span class="keywordtype">int</span> radius,
-<a name="l00074"></a>00074                                             <span class="keywordtype">double</span> magsyserr,
-<a name="l00075"></a>00075                                             <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,
-<a name="l00076"></a>00076                                             cpl_image **background,
-<a name="l00077"></a>00077                                             cpl_table **extracted_sources);
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079 <span class="keyword">static</span> fors_star_list *
-<a name="l00080"></a>00080 <a class="code" href="group__fors__extract.html#gedc4ee1e5daa54e4859e929c7ff51f59">extract_test</a>(                               <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,
-<a name="l00081"></a>00081                                             cpl_image **background,
-<a name="l00082"></a>00082                                             cpl_table **extracted_sources);
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00085"></a>00085 <span class="comment">    Implementation</span>
-<a name="l00086"></a>00086 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00098"></a>00098 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00099"></a>00099 <span class="keywordtype">bool</span>
-<a name="l00100"></a><a class="code" href="group__fors__extract.html#gcdd189ebaad6fe5c20ac2dea2eb06dfe">00100</a> <a class="code" href="group__fors__extract.html#gcdd189ebaad6fe5c20ac2dea2eb06dfe">fors_extract_check_sex_flag</a>(                <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    sex_flag)
-<a name="l00101"></a>00101 {
-<a name="l00102"></a>00102     <span class="keywordflow">return</span> (sex_flag == 0x0);
-<a name="l00103"></a>00103 }
-<a name="l00104"></a>00104 
-<a name="l00105"></a>00105 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00120"></a>00120 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00121"></a>00121 <span class="keywordtype">bool</span>
-<a name="l00122"></a><a class="code" href="group__fors__extract.html#g2c649f2f8802860d4693e38bd640032c">00122</a> <a class="code" href="group__fors__extract.html#g2c649f2f8802860d4693e38bd640032c">fors_extract_check_sex_star</a>(                <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star,
-<a name="l00123"></a>00123                                             <span class="keyword">const</span> cpl_image *ref_img)
-<a name="l00124"></a>00124 {
-<a name="l00125"></a>00125     <span class="keywordtype">bool</span>    success = 1;
-<a name="l00126"></a>00126     
-<a name="l00127"></a>00127     <span class="keywordflow">if</span> (star == NULL)
-<a name="l00128"></a>00128         <span class="keywordflow">return</span> 0;
-<a name="l00129"></a>00129     
-<a name="l00130"></a>00130     success &= <a class="code" href="group__fors__star.html#g1ef535783913303ad950792cdd1d59c8">fors_star_check_values</a>(star);
-<a name="l00131"></a>00131     
-<a name="l00132"></a>00132     success &= (star-><a class="code" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">magnitude</a> < 98);
-<a name="l00133"></a>00133     
-<a name="l00134"></a>00134     <span class="keywordflow">if</span> (ref_img != NULL)
-<a name="l00135"></a>00135     {
-<a name="l00136"></a>00136         success &= star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x >= 1;
-<a name="l00137"></a>00137         success &= star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x <= cpl_image_get_size_x(ref_img);
-<a name="l00138"></a>00138         success &= star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y >= 1;
-<a name="l00139"></a>00139         success &= star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y <= cpl_image_get_size_y(ref_img);
-<a name="l00140"></a>00140     }
-<a name="l00141"></a>00141     
-<a name="l00142"></a>00142     <span class="keywordflow">return</span> success;
-<a name="l00143"></a>00143 }
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00151"></a>00151 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00152"></a>00152 <span class="keywordtype">void</span> 
-<a name="l00153"></a><a class="code" href="group__fors__extract.html#gd07fd085541e8be0723f2932a29abdb3">00153</a> <a class="code" href="group__fors__extract.html#gd07fd085541e8be0723f2932a29abdb3">fors_extract_define_parameters</a>(             cpl_parameterlist *parameters, 
-<a name="l00154"></a>00154                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *context)
-<a name="l00155"></a>00155 {
-<a name="l00156"></a>00156     cpl_parameter *p;
-<a name="l00157"></a>00157     <span class="keyword">const</span> <span class="keywordtype">char</span> *full_name = NULL;
-<a name="l00158"></a>00158     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
-<a name="l00159"></a>00159     
-<a name="l00160"></a>00160     <span class="comment">/*</span>
-<a name="l00161"></a>00161 <span class="comment">    name = "extract_method";</span>
-<a name="l00162"></a>00162 <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span>
-<a name="l00163"></a>00163 <span class="comment">    p = cpl_parameter_new_enum(full_name,</span>
-<a name="l00164"></a>00164 <span class="comment">                               CPL_TYPE_STRING,</span>
-<a name="l00165"></a>00165 <span class="comment">                               "Source extraction method",</span>
-<a name="l00166"></a>00166 <span class="comment">                               context,</span>
-<a name="l00167"></a>00167 <span class="comment">                               "sex", 2,</span>
-<a name="l00168"></a>00168 <span class="comment">                               "sex", "test");</span>
-<a name="l00169"></a>00169 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span>
-<a name="l00170"></a>00170 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00171"></a>00171 <span class="comment">    cpl_parameterlist_append(parameters, p);</span>
-<a name="l00172"></a>00172 <span class="comment">    cpl_free((void *)full_name);</span>
-<a name="l00173"></a>00173 <span class="comment">    */</span>
-<a name="l00174"></a>00174 
-<a name="l00175"></a>00175     name = <span class="stringliteral">"sex_exe"</span>;
-<a name="l00176"></a>00176     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00177"></a>00177     p = cpl_parameter_new_value(full_name,
-<a name="l00178"></a>00178                                 CPL_TYPE_STRING,
-<a name="l00179"></a>00179                                 <span class="stringliteral">"SExtractor executable"</span>,
-<a name="l00180"></a>00180                                 context,
-<a name="l00181"></a>00181                                 FORS_SEXTRACTOR_PATH <span class="stringliteral">"/sex"</span>);
-<a name="l00182"></a>00182     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00183"></a>00183     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00184"></a>00184     cpl_parameterlist_append(parameters, p);
-<a name="l00185"></a>00185     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00186"></a>00186     
-<a name="l00187"></a>00187     name = <span class="stringliteral">"sex_config"</span>;
-<a name="l00188"></a>00188     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00189"></a>00189     p = cpl_parameter_new_value(full_name,
-<a name="l00190"></a>00190                                 CPL_TYPE_STRING,
-<a name="l00191"></a>00191                                 <span class="stringliteral">"SExtractor configuration file"</span>,
-<a name="l00192"></a>00192                                 context,
-<a name="l00193"></a>00193                                 FORS_SEXTRACTOR_CONFIG <span class="stringliteral">"/fors.sex"</span>);
-<a name="l00194"></a>00194     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00195"></a>00195     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00196"></a>00196     cpl_parameterlist_append(parameters, p);
-<a name="l00197"></a>00197     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00198"></a>00198     
-<a name="l00199"></a>00199     
-<a name="l00200"></a>00200     name = <span class="stringliteral">"sex_mag"</span>;
-<a name="l00201"></a>00201     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00202"></a>00202     p = cpl_parameter_new_value(full_name,
-<a name="l00203"></a>00203                                 CPL_TYPE_STRING,
-<a name="l00204"></a>00204                                 <span class="stringliteral">"SExtractor magnitude"</span>,
-<a name="l00205"></a>00205                                 context,
-<a name="l00206"></a>00206                                 <span class="stringliteral">"MAG_APER"</span>);
-<a name="l00207"></a>00207     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00208"></a>00208     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00209"></a>00209     cpl_parameterlist_append(parameters, p);
-<a name="l00210"></a>00210     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00211"></a>00211     
-<a name="l00212"></a>00212     name = <span class="stringliteral">"sex_magerr"</span>;
-<a name="l00213"></a>00213     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00214"></a>00214     p = cpl_parameter_new_value(full_name,
-<a name="l00215"></a>00215                                 CPL_TYPE_STRING,
-<a name="l00216"></a>00216                                 <span class="stringliteral">"SExtractor magnitude error"</span>,
-<a name="l00217"></a>00217                                 context,
-<a name="l00218"></a>00218                                 <span class="stringliteral">"MAGERR_APER"</span>);
-<a name="l00219"></a>00219     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00220"></a>00220     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00221"></a>00221     cpl_parameterlist_append(parameters, p);
-<a name="l00222"></a>00222     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224     name = <span class="stringliteral">"sex_radius"</span>;
-<a name="l00225"></a>00225     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00226"></a>00226     p = cpl_parameter_new_value(full_name,
-<a name="l00227"></a>00227                                 CPL_TYPE_INT,
-<a name="l00228"></a>00228                                 <span class="stringliteral">"Background error map median filter "</span>
-<a name="l00229"></a>00229                                 <span class="stringliteral">"radius (unbinned pixels)"</span>,
-<a name="l00230"></a>00230                                 context,
-<a name="l00231"></a>00231                                 64);
-<a name="l00232"></a>00232     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00233"></a>00233     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00234"></a>00234     cpl_parameterlist_append(parameters, p);
-<a name="l00235"></a>00235     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00236"></a>00236     
-<a name="l00237"></a>00237     <span class="keywordflow">return</span>;
-<a name="l00238"></a>00238 }
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00241"></a>00241 <span class="preprocessor">#undef cleanup</span>
-<a name="l00242"></a>00242 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00243"></a>00243 <span class="preprocessor">do { \</span>
-<a name="l00244"></a>00244 <span class="preprocessor">    cpl_free((void *)name); \</span>
-<a name="l00245"></a>00245 <span class="preprocessor">    cpl_free((void *)method); \</span>
-<a name="l00246"></a>00246 <span class="preprocessor">} while (0)</span>
-<a name="l00247"></a>00247 <span class="preprocessor"></span>
-<a name="l00256"></a>00256 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00257"></a>00257 extract_method *
-<a name="l00258"></a><a class="code" href="group__fors__extract.html#g1f3f1af725e7b5fb1c770507eab8ac09">00258</a> <a class="code" href="group__fors__extract.html#g1f3f1af725e7b5fb1c770507eab8ac09">fors_extract_method_new</a>(                    <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00259"></a>00259                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *context)
-<a name="l00260"></a>00260 {
-<a name="l00261"></a>00261     extract_method *em = cpl_malloc(<span class="keyword">sizeof</span>(*em));
-<a name="l00262"></a>00262     <span class="keyword">const</span> <span class="keywordtype">char</span> *name = NULL;
-<a name="l00263"></a>00263     <span class="keyword">const</span> <span class="keywordtype">char</span> *method = NULL;
-<a name="l00264"></a>00264 
-<a name="l00265"></a>00265     cpl_msg_info(cpl_func, <span class="stringliteral">"Extraction method:"</span>);
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267     cpl_msg_indent_more();
-<a name="l00268"></a>00268     <span class="comment">//"sex" method is the default. The parameter won't appear when calling</span>
-<a name="l00269"></a>00269     <span class="comment">//the recipe from esorex, but it will in the unit tests fors_zeropoint-test,</span>
-<a name="l00270"></a>00270     <span class="comment">//fors_img_science-test.</span>
-<a name="l00271"></a>00271     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"extract_method"</span>);
-<a name="l00272"></a>00272     <span class="keywordflow">if</span>(cpl_parameterlist_find_const(parameters, name) == NULL)
-<a name="l00273"></a>00273         method = cpl_sprintf(<span class="stringliteral">"%s"</span>, <span class="stringliteral">"sex"</span>);
-<a name="l00274"></a>00274     <span class="keywordflow">else</span>
-<a name="l00275"></a>00275         method = cpl_sprintf(<span class="stringliteral">"%s"</span>,<a class="code" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">dfs_get_parameter_string_const</a>(parameters, name));
-<a name="l00276"></a>00276     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00277"></a>00277     cpl_msg_indent_less();
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00280"></a>00280     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( method != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282     <span class="keywordflow">if</span> (strcmp(method, <span class="stringliteral">"sex"</span>) == 0) {
-<a name="l00283"></a>00283         em->method = SEX;
-<a name="l00284"></a>00284         
-<a name="l00285"></a>00285         cpl_msg_indent_more();
-<a name="l00286"></a>00286         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sex_exe"</span>);
-<a name="l00287"></a>00287         em->sex_exe = <a class="code" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">dfs_get_parameter_string_const</a>(parameters, 
-<a name="l00288"></a>00288                                                      name);
-<a name="l00289"></a>00289         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00290"></a>00290         cpl_msg_indent_less();
-<a name="l00291"></a>00291 
-<a name="l00292"></a>00292         
-<a name="l00293"></a>00293         cpl_msg_indent_more();
-<a name="l00294"></a>00294         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sex_config"</span>);
-<a name="l00295"></a>00295         em->sex_config = <a class="code" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">dfs_get_parameter_string_const</a>(parameters, 
-<a name="l00296"></a>00296                                                      name);
-<a name="l00297"></a>00297         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00298"></a>00298         cpl_msg_indent_less();
-<a name="l00299"></a>00299 
-<a name="l00300"></a>00300 
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302         cpl_msg_indent_more();
-<a name="l00303"></a>00303         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sex_mag"</span>);
-<a name="l00304"></a>00304         em->sex_mag = <a class="code" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">dfs_get_parameter_string_const</a>(parameters, 
-<a name="l00305"></a>00305                                                      name);
-<a name="l00306"></a>00306         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00307"></a>00307         cpl_msg_indent_less();
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310         cpl_msg_indent_more();
-<a name="l00311"></a>00311         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sex_magerr"</span>);
-<a name="l00312"></a>00312         em->sex_magerr = <a class="code" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">dfs_get_parameter_string_const</a>(parameters, 
-<a name="l00313"></a>00313                                                         name);
-<a name="l00314"></a>00314         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00315"></a>00315         cpl_msg_indent_less();
-<a name="l00316"></a>00316 
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318         cpl_msg_indent_more();
-<a name="l00319"></a>00319         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sex_radius"</span>);
-<a name="l00320"></a>00320         em->sex_radius = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parameters, 
-<a name="l00321"></a>00321                                            name);
-<a name="l00322"></a>00322         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00323"></a>00323         cpl_msg_indent_less();
-<a name="l00324"></a>00324     }
-<a name="l00325"></a>00325     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(method, <span class="stringliteral">"test"</span>) == 0) {
-<a name="l00326"></a>00326         em->method = TEST;
-<a name="l00327"></a>00327     }
-<a name="l00328"></a>00328     <span class="keywordflow">else</span> {
-<a name="l00329"></a>00329         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Unknown extraction method '%s'"</span>, method);
-<a name="l00330"></a>00330     }
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00333"></a>00333     <span class="keywordflow">return</span> em;
-<a name="l00334"></a>00334 }
-<a name="l00335"></a>00335 
-<a name="l00336"></a>00336 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00340"></a>00340 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00341"></a>00341 <span class="keywordtype">void</span>
-<a name="l00342"></a><a class="code" href="group__fors__extract.html#g2f7149d890f135097366c9389cab25fe">00342</a> <a class="code" href="group__fors__extract.html#g2f7149d890f135097366c9389cab25fe">fors_extract_method_delete</a>(                 extract_method **em)
-<a name="l00343"></a>00343 {
-<a name="l00344"></a>00344     <span class="keywordflow">if</span> (em && *em) {
-<a name="l00345"></a>00345         cpl_free(*em); *em = NULL;
-<a name="l00346"></a>00346     }
-<a name="l00347"></a>00347     <span class="keywordflow">return</span>;
-<a name="l00348"></a>00348 }
-<a name="l00349"></a>00349 
-<a name="l00350"></a>00350 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00351"></a>00351 <span class="preprocessor">#undef cleanup</span>
-<a name="l00352"></a>00352 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00353"></a>00353 <span class="preprocessor"></span>
-<a name="l00363"></a>00363 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00364"></a>00364 fors_star_list *
-<a name="l00365"></a><a class="code" href="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1">00365</a> <a class="code" href="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1">fors_extract</a>(                               <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, 
-<a name="l00366"></a>00366                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00367"></a>00367                                             <span class="keyword">const</span> extract_method *em,
-<a name="l00368"></a>00368                                             <span class="keywordtype">double</span> magsyserr,
-<a name="l00369"></a>00369                                             <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,
-<a name="l00370"></a>00370                                             cpl_image **background,
-<a name="l00371"></a>00371                                             cpl_table **extracted_sources)
-<a name="l00372"></a>00372 {
-<a name="l00373"></a>00373     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( em != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00374"></a>00374 
-<a name="l00375"></a>00375     cpl_msg_info(cpl_func, <span class="stringliteral">"Extracting sources"</span>);
-<a name="l00376"></a>00376     
-<a name="l00377"></a>00377     <span class="keywordflow">switch</span> (em->method ) {
-<a name="l00378"></a>00378     <span class="keywordflow">case</span> SEX: <span class="keywordflow">return</span> <a class="code" href="group__fors__extract.html#g5237e1161aeef9d828a973333151a36f">extract_sex</a>(image, setting,
-<a name="l00379"></a>00379                                  em->sex_exe,
-<a name="l00380"></a>00380                                  em->sex_config,
-<a name="l00381"></a>00381                                  em->sex_mag,
-<a name="l00382"></a>00382                                  em->sex_magerr,
-<a name="l00383"></a>00383                                  em->sex_radius,
-<a name="l00384"></a>00384                                  magsyserr,
-<a name="l00385"></a>00385                                  sky_stats,
-<a name="l00386"></a>00386                                  background,
-<a name="l00387"></a>00387                                  extracted_sources); <span class="keywordflow">break</span>;
-<a name="l00388"></a>00388     <span class="keywordflow">case</span> TEST: <span class="keywordflow">return</span> <a class="code" href="group__fors__extract.html#gedc4ee1e5daa54e4859e929c7ff51f59">extract_test</a>(sky_stats, background, extracted_sources); <span class="keywordflow">break</span>;
-<a name="l00389"></a>00389     <span class="keywordflow">default</span>:
-<a name="l00390"></a>00390         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Unknown method %d"</span>, em->method );
-<a name="l00391"></a>00391         <span class="keywordflow">break</span>;
-<a name="l00392"></a>00392     }
-<a name="l00393"></a>00393 }
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00396"></a>00396 <span class="preprocessor">#undef cleanup</span>
-<a name="l00397"></a>00397 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00398"></a>00398 <span class="preprocessor">do { \</span>
-<a name="l00399"></a>00399 <span class="preprocessor">    cpl_table_delete(out); out = NULL; \</span>
-<a name="l00400"></a>00400 <span class="preprocessor">    cpl_free((void *)command); \</span>
-<a name="l00401"></a>00401 <span class="preprocessor">    cpl_image_delete(work_back); work_back = NULL; \</span>
-<a name="l00402"></a>00402 <span class="preprocessor">    cpl_image_delete(bmaxsigma); bmaxsigma = NULL; \</span>
-<a name="l00403"></a>00403 <span class="preprocessor">    cpl_image_delete(bsigma); bsigma = NULL; \</span>
-<a name="l00404"></a>00404 <span class="preprocessor">    fors_image_delete(&fbsigma); \</span>
-<a name="l00405"></a>00405 <span class="preprocessor">} while (0)</span>
-<a name="l00406"></a>00406 <span class="preprocessor"></span>
-<a name="l00429"></a>00429 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00430"></a>00430 <span class="keyword">static</span> fors_star_list *
-<a name="l00431"></a><a class="code" href="group__fors__extract.html#g5237e1161aeef9d828a973333151a36f">00431</a> <a class="code" href="group__fors__extract.html#g5237e1161aeef9d828a973333151a36f">extract_sex</a>(                                <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,
-<a name="l00432"></a>00432                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00433"></a>00433                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_exe,
-<a name="l00434"></a>00434                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_config,
-<a name="l00435"></a>00435                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_mag,
-<a name="l00436"></a>00436                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_magerr,
-<a name="l00437"></a>00437                                             <span class="keywordtype">int</span> radius,
-<a name="l00438"></a>00438                                             <span class="keywordtype">double</span> magsyserr,
-<a name="l00439"></a>00439                                             <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,
-<a name="l00440"></a>00440                                             cpl_image **background,
-<a name="l00441"></a>00441                                             cpl_table **extracted_sources)
-<a name="l00442"></a>00442 {
-<a name="l00443"></a>00443     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_data  = <span class="stringliteral">"sextract_data.fits"</span>;
-<a name="l00444"></a>00444     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_sigma = <span class="stringliteral">"sextract_bkg_sigma.fits"</span>;
-<a name="l00445"></a>00445     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_cat   = <span class="stringliteral">"sextract_cat.fits"</span>;
-<a name="l00446"></a>00446     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_bkg   = <span class="stringliteral">"sextract_bkg.fits"</span>;
-<a name="l00447"></a>00447     cpl_table *out = NULL;
-<a name="l00448"></a>00448     <span class="keyword">const</span> <span class="keywordtype">char</span> *command = NULL;
-<a name="l00449"></a>00449     fors_star_list *stars = NULL;
-<a name="l00450"></a>00450     cpl_image *work_back = NULL;
-<a name="l00451"></a>00451     cpl_image *bmaxsigma = NULL;
-<a name="l00452"></a>00452     cpl_image *bsigma = NULL;
-<a name="l00453"></a>00453     <a class="code" href="struct__fors__image.html">fors_image</a> *fbsigma = NULL;
-<a name="l00454"></a>00454     <a class="code" href="struct__fors__image.html">fors_image</a> *cropped = NULL;
-<a name="l00455"></a>00455     <span class="keywordtype">int</span> croplx, croply, cropux, cropuy;
-<a name="l00456"></a>00456     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_data_full  = <span class="stringliteral">"sextract_data_full.fits"</span>;
-<a name="l00457"></a>00457     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_sigma_full = <span class="stringliteral">"sextract_bkg_sigma_full.fits"</span>;
-<a name="l00458"></a>00458     <span class="keywordtype">int</span>        vignetted = 1;
-<a name="l00459"></a>00459 
-<a name="l00460"></a>00460     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( setting != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( sky_stats != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00465"></a>00465     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( background != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00466"></a>00466 
-<a name="l00467"></a>00467 
-<a name="l00468"></a>00468     <span class="comment">/*</span>
-<a name="l00469"></a>00469 <span class="comment">     * In case of new chips, crop</span>
-<a name="l00470"></a>00470 <span class="comment">     */</span>
-<a name="l00471"></a>00471 
-<a name="l00472"></a>00472     <span class="keywordflow">if</span> (strcmp(setting-><a class="code" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">chip_id</a>, <span class="stringliteral">"CCID20-14-5-6"</span>) == 0) {
-<a name="l00473"></a>00473         croplx =  380 / setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00474"></a>00474         croply =  626 / setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>;
-<a name="l00475"></a>00475         cropux = 3714 / setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00476"></a>00476         cropuy = 2048 / setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>;
-<a name="l00477"></a>00477     }
-<a name="l00478"></a>00478     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(setting-><a class="code" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">chip_id</a>, <span class="stringliteral">"CCID20-14-5-3"</span>) == 0) {
-<a name="l00479"></a>00479         croplx =  380 / setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00480"></a>00480         croply =    2 / setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>;
-<a name="l00481"></a>00481         cropux = 3714 / setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00482"></a>00482         cropuy = 1920 / setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>;
-<a name="l00483"></a>00483     }
-<a name="l00484"></a>00484     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(setting-><a class="code" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">chip_id</a>, <span class="stringliteral">"Marl"</span>, 4) == 0) {
-<a name="l00485"></a>00485         croplx =  380 / setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00486"></a>00486         croply =  694 / setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>;
-<a name="l00487"></a>00487         cropux = 3690 / setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00488"></a>00488         cropuy = 2048 / setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>;
-<a name="l00489"></a>00489     }
-<a name="l00490"></a>00490     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(setting-><a class="code" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">chip_id</a>, <span class="stringliteral">"Norm"</span>, 4) == 0) {
-<a name="l00491"></a>00491         croplx =  380 / setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00492"></a>00492         croply =    2 / setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>;
-<a name="l00493"></a>00493         cropux = 3690 / setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00494"></a>00494         cropuy = 1894 / setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>;
-<a name="l00495"></a>00495     }
-<a name="l00496"></a>00496     <span class="keywordflow">else</span> {
-<a name="l00497"></a>00497         vignetted = 0;
-<a name="l00498"></a>00498     }
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500     cropped = (<a class="code" href="struct__fors__image.html">fors_image</a> *)image;       <span class="comment">/* As a default.... */</span>
-<a name="l00501"></a>00501 
-<a name="l00502"></a>00502     <span class="keywordflow">if</span> (vignetted) {
-<a name="l00503"></a>00503        <a class="code" href="group__fors__image.html#g1ddf7d1b81954a8d2113e4f5174301a8">fors_image_save_sex</a>(image, NULL,
-<a name="l00504"></a>00504                             filename_data_full,
-<a name="l00505"></a>00505                             filename_sigma_full,
-<a name="l00506"></a>00506                             radius);
-<a name="l00507"></a>00507 
-<a name="l00508"></a>00508         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,
-<a name="l00509"></a>00509                 <span class="stringliteral">"Could not save image to %s and %s"</span>,
-<a name="l00510"></a>00510                 filename_data_full, filename_sigma_full);
-<a name="l00511"></a>00511 
-<a name="l00512"></a>00512         cropped = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(image);
-<a name="l00513"></a>00513         <a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a>(cropped, croplx, croply, cropux, cropuy);
-<a name="l00514"></a>00514     }
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516     <span class="comment">/* provide data and error bars in separate files,</span>
-<a name="l00517"></a>00517 <span class="comment">       pass to sextractor */</span>
-<a name="l00518"></a>00518 
-<a name="l00519"></a>00519     <a class="code" href="group__fors__image.html#g1ddf7d1b81954a8d2113e4f5174301a8">fors_image_save_sex</a>(cropped, NULL,
-<a name="l00520"></a>00520                         filename_data,
-<a name="l00521"></a>00521                         filename_sigma,
-<a name="l00522"></a>00522                         radius);
-<a name="l00523"></a>00523     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,
-<a name="l00524"></a>00524             <span class="stringliteral">"Could not save image to %s and %s"</span>,
-<a name="l00525"></a>00525             filename_data, filename_sigma);
-<a name="l00526"></a>00526 
-<a name="l00527"></a>00527     <span class="keywordflow">if</span> (vignetted)
-<a name="l00528"></a>00528         <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&cropped);
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530     
-<a name="l00531"></a>00531     <span class="comment">/*</span>
-<a name="l00532"></a>00532 <span class="comment">     * A = load filename_sigma</span>
-<a name="l00533"></a>00533 <span class="comment">     *</span>
-<a name="l00534"></a>00534 <span class="comment">     * M = fors_image_max_filter(A)</span>
-<a name="l00535"></a>00535 <span class="comment">     *</span>
-<a name="l00536"></a>00536 <span class="comment">     * |A-M|</span>
-<a name="l00537"></a>00537 <span class="comment">     */</span>
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539     command = cpl_sprintf(<span class="stringliteral">"%s %s,%s "</span>
-<a name="l00540"></a>00540                           <span class="stringliteral">"-c %s "</span>
-<a name="l00541"></a>00541                           <span class="comment">/* Use SExtractor's double mode which is probably</span>
-<a name="l00542"></a>00542 <span class="comment">                             more tested and more bugfree than the</span>
-<a name="l00543"></a>00543 <span class="comment">                             single image mode */</span>
-<a name="l00544"></a>00544                           <span class="stringliteral">"-GAIN %f "</span>   <span class="comment">/* Different terminology here:</span>
-<a name="l00545"></a>00545 <span class="comment">                                           SExtractor-gain == ESO-conad,</span>
-<a name="l00546"></a>00546 <span class="comment">                                           unit = e- / ADU</span>
-<a name="l00547"></a>00547 <span class="comment">                                        */</span>
-<a name="l00548"></a>00548                           <span class="stringliteral">"-PIXEL_SCALE %f "</span>
-<a name="l00549"></a>00549                           <span class="stringliteral">"-CHECKIMAGE_TYPE BACKGROUND "</span>
-<a name="l00550"></a>00550                           <span class="stringliteral">"-CHECKIMAGE_NAME %s "</span>
-<a name="l00551"></a>00551                           <span class="stringliteral">"-WEIGHT_TYPE MAP_RMS "</span>
-<a name="l00552"></a>00552                           <span class="stringliteral">"-WEIGHT_IMAGE %s,%s "</span>
-<a name="l00553"></a>00553                           <span class="stringliteral">"-CATALOG_TYPE FITS_1.0 "</span>
-<a name="l00554"></a>00554                           <span class="stringliteral">"-CATALOG_NAME %s"</span>,
-<a name="l00555"></a>00555                           sex_exe,
-<a name="l00556"></a>00556                           filename_data, filename_data,
-<a name="l00557"></a>00557                           sex_config,
-<a name="l00558"></a>00558                           1.0/setting-><a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a>,
-<a name="l00559"></a>00559                           setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>,
-<a name="l00560"></a>00560                           filename_bkg,
-<a name="l00561"></a>00561                           filename_sigma, filename_sigma,
-<a name="l00562"></a>00562                           filename_cat);
-<a name="l00563"></a>00563 
-<a name="l00564"></a>00564     cpl_msg_info(cpl_func, <span class="stringliteral">"Running '%s'"</span>, command);
-<a name="l00565"></a>00565 
-<a name="l00566"></a>00566     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( system(command) == 0, <span class="keywordflow">return</span> stars, <span class="stringliteral">"'%s' failed"</span>, command);
-<a name="l00567"></a>00567 
-<a name="l00568"></a>00568     <span class="comment">/* </span>
-<a name="l00569"></a>00569 <span class="comment">     * The background map is here used just to evaluate a QC parameter,</span>
-<a name="l00570"></a>00570 <span class="comment">     * and is also returned to the caller.</span>
-<a name="l00571"></a>00571 <span class="comment">     */</span>
-<a name="l00572"></a>00572     {
-<a name="l00573"></a>00573         <span class="keywordtype">int</span> plane = 0;
-<a name="l00574"></a>00574         <span class="keywordtype">int</span> extension = 0;
-<a name="l00575"></a>00575 
-<a name="l00576"></a>00576         *background = cpl_image_load(filename_bkg,
-<a name="l00577"></a>00577                                      CPL_TYPE_FLOAT, plane, extension);
-<a name="l00578"></a>00578 
-<a name="l00579"></a>00579         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,
-<a name="l00580"></a>00580                 <span class="stringliteral">"Could not load SExtractor background image %s"</span>,
-<a name="l00581"></a>00581                 filename_bkg );
-<a name="l00582"></a>00582 
-<a name="l00583"></a>00583         <span class="keywordflow">if</span> (vignetted) {
-<a name="l00584"></a>00584             work_back = cpl_image_new(<a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(image), 
-<a name="l00585"></a>00585                                       <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(image),
-<a name="l00586"></a>00586                                       CPL_TYPE_FLOAT);
-<a name="l00587"></a>00587             cpl_image_copy(work_back, *background, croplx, croply);
-<a name="l00588"></a>00588 
-<a name="l00589"></a>00589             <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,
-<a name="l00590"></a>00590                     <span class="stringliteral">"Could not insert background image %s"</span>,
-<a name="l00591"></a>00591                     filename_bkg );
-<a name="l00592"></a>00592 
-<a name="l00593"></a>00593             cpl_image_delete(*background);
-<a name="l00594"></a>00594             *background = work_back;
-<a name="l00595"></a>00595             work_back = NULL;
-<a name="l00596"></a>00596         }
-<a name="l00597"></a>00597         
-<a name="l00598"></a>00598         <span class="comment">/* </span>
-<a name="l00599"></a>00599 <span class="comment">         * To avoid using the non-illuminated parts, use only the central </span>
-<a name="l00600"></a>00600 <span class="comment">         * 100x100 window.</span>
-<a name="l00601"></a>00601 <span class="comment">         *</span>
-<a name="l00602"></a>00602 <span class="comment">         * It does not make too much sense to trend these QC parameters</span>
-<a name="l00603"></a>00603 <span class="comment">         * anyway because they mostly describe the individual science </span>
-<a name="l00604"></a>00604 <span class="comment">         * exposures.</span>
-<a name="l00605"></a>00605 <span class="comment">         */</span>
-<a name="l00606"></a>00606 
-<a name="l00607"></a>00607         <span class="keywordtype">int</span> nx = cpl_image_get_size_x(*background);
-<a name="l00608"></a>00608         <span class="keywordtype">int</span> ny = cpl_image_get_size_y(*background);
-<a name="l00609"></a>00609         <span class="keywordtype">int</span> xlo = nx/2 - 50;
-<a name="l00610"></a>00610         <span class="keywordtype">int</span> xhi = nx/2 + 50;
-<a name="l00611"></a>00611         <span class="keywordtype">int</span> ylo = ny/2 - 50;
-<a name="l00612"></a>00612         <span class="keywordtype">int</span> yhi = ny/2 + 50;
-<a name="l00613"></a>00613         
-<a name="l00614"></a>00614         <span class="keywordflow">if</span> (xlo <   0) xlo = 0;       <span class="comment">/* Just in case... */</span>
-<a name="l00615"></a>00615         <span class="keywordflow">if</span> (xhi >= nx) xhi = nx - 1;
-<a name="l00616"></a>00616         <span class="keywordflow">if</span> (ylo <   0) ylo = 0;
-<a name="l00617"></a>00617         <span class="keywordflow">if</span> (yhi >= ny) yhi = ny - 1;
-<a name="l00618"></a>00618 
-<a name="l00619"></a>00619         work_back = cpl_image_duplicate(*background);
-<a name="l00620"></a>00620         
-<a name="l00621"></a>00621         sky_stats-><a class="code" href="structfors__extract__sky__stats.html#b7ca852023d946aa752ef2d3f4f871b9">mean</a>   = cpl_image_get_mean_window(work_back, 
-<a name="l00622"></a>00622                                                       xlo, ylo, xhi, yhi);
-<a name="l00623"></a>00623         sky_stats-><a class="code" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">median</a> = cpl_image_get_median_window(work_back, 
-<a name="l00624"></a>00624                                                  xlo, ylo, xhi, yhi);
-<a name="l00625"></a>00625         cpl_image_subtract_scalar(work_back, sky_stats-><a class="code" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">median</a>);
-<a name="l00626"></a>00626         cpl_image_abs(work_back);
-<a name="l00627"></a>00627         sky_stats-><a class="code" href="structfors__extract__sky__stats.html#69ed6753cee271b73c8b7e73a016fdeb">rms</a>    = cpl_image_get_median_window(work_back, 
-<a name="l00628"></a>00628                                                         xlo, ylo, xhi, yhi)
-<a name="l00629"></a>00629                           * <a class="code" href="group__fors__utils.html#gea88c3776498f5f3717413a50289af52">STDEV_PR_MAD</a>;
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631         cpl_image_delete(work_back); work_back = NULL;
-<a name="l00632"></a>00632 
-<a name="l00633"></a>00633         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,
-<a name="l00634"></a>00634                 <span class="stringliteral">"Could not calculate sky statistics"</span> );
-<a name="l00635"></a>00635 
-<a name="l00636"></a>00636     }
-<a name="l00637"></a>00637     
-<a name="l00638"></a>00638     cpl_msg_info(cpl_func, <span class="stringliteral">"Background = %f +- %f ADU"</span>,
-<a name="l00639"></a>00639                  sky_stats-><a class="code" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">median</a>, sky_stats-><a class="code" href="structfors__extract__sky__stats.html#69ed6753cee271b73c8b7e73a016fdeb">rms</a>);
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641     <span class="comment">/* </span>
-<a name="l00642"></a>00642 <span class="comment">     * SExtractors background estimation is not reliable near</span>
-<a name="l00643"></a>00643 <span class="comment">     * non-illuminated areas. The underestimated background </span>
-<a name="l00644"></a>00644 <span class="comment">     * leads to false detections.</span>
-<a name="l00645"></a>00645 <span class="comment">     * Therefore, reject sources which are too close to the</span>
-<a name="l00646"></a>00646 <span class="comment">     * illumination edge. The edge is masked using a max filter </span>
-<a name="l00647"></a>00647 <span class="comment">     * on the smoothed variance image of the background map. </span>
-<a name="l00648"></a>00648 <span class="comment">     * The filter must have comparable size to the SExtractor </span>
-<a name="l00649"></a>00649 <span class="comment">     * BACK_SIZE parameter. The discrimination level is half-way</span>
-<a name="l00650"></a>00650 <span class="comment">     * between the high-variance and low-variance regions.</span>
-<a name="l00651"></a>00651 <span class="comment">     */</span>
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653     <span class="keywordtype">float</span> level;
-<a name="l00654"></a>00654     {
-<a name="l00655"></a>00655         <span class="keywordtype">int</span> xradius = 64;
-<a name="l00656"></a>00656         <span class="keywordtype">int</span> yradius = 64;
-<a name="l00657"></a>00657         <span class="keywordtype">int</span> plane = 0;
-<a name="l00658"></a>00658         <span class="keywordtype">int</span> extension = 0;
-<a name="l00659"></a>00659         <span class="keywordtype">float</span> maxima;
-<a name="l00660"></a>00660         <span class="keywordtype">float</span> minima;
-<a name="l00661"></a>00661 
-<a name="l00662"></a>00662         <span class="keywordflow">if</span> (vignetted) {
-<a name="l00663"></a>00663             bsigma = cpl_image_load(filename_sigma_full,
-<a name="l00664"></a>00664                                     CPL_TYPE_FLOAT, plane, extension);
-<a name="l00665"></a>00665         }
-<a name="l00666"></a>00666         <span class="keywordflow">else</span> {
-<a name="l00667"></a>00667             bsigma = cpl_image_load(filename_sigma,
-<a name="l00668"></a>00668                                     CPL_TYPE_FLOAT, plane, extension);
-<a name="l00669"></a>00669         }
-<a name="l00670"></a>00670 
-<a name="l00671"></a>00671         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,
-<a name="l00672"></a>00672                 <span class="stringliteral">"Could not load SExtractor background error image %s"</span>,
-<a name="l00673"></a>00673                 filename_sigma );
-<a name="l00674"></a>00674 
-<a name="l00675"></a>00675         <span class="comment">/*</span>
-<a name="l00676"></a>00676 <span class="comment">         * Duplication is necessary for creating the fors_image</span>
-<a name="l00677"></a>00677 <span class="comment">         * to be passed to fors_image_filter_max_create()</span>
-<a name="l00678"></a>00678 <span class="comment">         */</span>
-<a name="l00679"></a>00679         
-<a name="l00680"></a>00680         <span class="comment">/* this wraps the fors_image around the cpl images,</span>
-<a name="l00681"></a>00681 <span class="comment">         * so set them to NULL */</span>
-<a name="l00682"></a>00682 
-<a name="l00683"></a>00683         fbsigma = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(cpl_image_duplicate(bsigma), bsigma);
-<a name="l00684"></a>00684         bsigma = NULL;
-<a name="l00685"></a>00685 
-<a name="l00686"></a>00686         {
-<a name="l00687"></a>00687             <span class="keywordtype">bool</span> use_variance = <span class="keyword">true</span>;
-<a name="l00688"></a>00688             bmaxsigma = <a class="code" href="group__fors__image.html#g315f5476160ed7db282a7623f0d354b0">fors_image_filter_max_create</a>(fbsigma, xradius, 
-<a name="l00689"></a>00689                                                      yradius, use_variance);
-<a name="l00690"></a>00690 
-<a name="l00691"></a>00691      <span class="comment">/* cpl_image_save(bmaxsigma, "/tmp/test.fits", CPL_BPP_IEEE_FLOAT, NULL,</span>
-<a name="l00692"></a>00692 <span class="comment">                              CPL_IO_DEFAULT); */</span>
-<a name="l00693"></a>00693             
-<a name="l00694"></a>00694         }
-<a name="l00695"></a>00695 
-<a name="l00696"></a>00696         <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&fbsigma);
-<a name="l00697"></a>00697 
-<a name="l00698"></a>00698         <span class="comment">/*</span>
-<a name="l00699"></a>00699 <span class="comment">          This is not robust if there are no non-illuminated areas.</span>
-<a name="l00700"></a>00700 <span class="comment"></span>
-<a name="l00701"></a>00701 <span class="comment">          maxima = cpl_image_get_max(bmaxsigma);</span>
-<a name="l00702"></a>00702 <span class="comment">          minima = cpl_image_get_min(bmaxsigma);</span>
-<a name="l00703"></a>00703 <span class="comment">          level = (maxima + minima) / 2; </span>
-<a name="l00704"></a>00704 <span class="comment">        */</span>
-<a name="l00705"></a>00705         
-<a name="l00706"></a>00706         <span class="comment">/* 5 sigma rejection */</span>
-<a name="l00707"></a>00707         level = cpl_image_get_median(bmaxsigma) * 5;
-<a name="l00708"></a>00708 
-<a name="l00709"></a>00709         cpl_msg_debug(cpl_func, <span class="stringliteral">"Threshold level = %f"</span>,
-<a name="l00710"></a>00710                       level);
-<a name="l00711"></a>00711 
-<a name="l00712"></a>00712     }
-<a name="l00713"></a>00713 
-<a name="l00714"></a>00714     out = cpl_table_load(filename_cat, 1, 1);
-<a name="l00715"></a>00715 
-<a name="l00716"></a>00716     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,
-<a name="l00717"></a>00717             <span class="stringliteral">"Could not load SExtractor output table %s"</span>,
-<a name="l00718"></a>00718             filename_cat); 
-<a name="l00719"></a>00719 
-<a name="l00720"></a>00720     <span class="comment">/* Validate sextractor output */</span>
-<a name="l00721"></a>00721     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"FLAGS"</span>), <span class="keywordflow">return</span> NULL,
-<a name="l00722"></a>00722             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"FLAGS"</span>);
-<a name="l00723"></a>00723 
-<a name="l00724"></a>00724     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"CLASS_STAR"</span>), <span class="keywordflow">return</span> NULL,
-<a name="l00725"></a>00725             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"CLASS_STAR"</span>);
-<a name="l00726"></a>00726 
-<a name="l00727"></a>00727     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"BACKGROUND"</span>), <span class="keywordflow">return</span> NULL,
-<a name="l00728"></a>00728             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"BACKGROUND"</span>);
-<a name="l00729"></a>00729 
-<a name="l00730"></a>00730     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"X_IMAGE"</span>), <span class="keywordflow">return</span> NULL,
-<a name="l00731"></a>00731             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"X_IMAGE"</span>);
-<a name="l00732"></a>00732 
-<a name="l00733"></a>00733     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"Y_IMAGE"</span>), <span class="keywordflow">return</span> NULL,
-<a name="l00734"></a>00734             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"Y_IMAGE"</span>);
-<a name="l00735"></a>00735 
-<a name="l00736"></a>00736     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"FWHM_IMAGE"</span>), <span class="keywordflow">return</span> NULL,
-<a name="l00737"></a>00737             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"FWHM_IMAGE"</span>);
-<a name="l00738"></a>00738 
-<a name="l00739"></a>00739     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"A_IMAGE"</span>), <span class="keywordflow">return</span> NULL,
-<a name="l00740"></a>00740             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"A_IMAGE"</span>);
-<a name="l00741"></a>00741 
-<a name="l00742"></a>00742     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"B_IMAGE"</span>), <span class="keywordflow">return</span> NULL,
-<a name="l00743"></a>00743             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"B_IMAGE"</span>);
-<a name="l00744"></a>00744 
-<a name="l00745"></a>00745     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"THETA_IMAGE"</span>), <span class="keywordflow">return</span> NULL,
-<a name="l00746"></a>00746             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"THETA_IMAGE"</span>);
-<a name="l00747"></a>00747 
-<a name="l00748"></a>00748     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, sex_mag), <span class="keywordflow">return</span> NULL,
-<a name="l00749"></a>00749             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, sex_mag);
-<a name="l00750"></a>00750 
-<a name="l00751"></a>00751     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(out, sex_magerr), <span class="keywordflow">return</span> NULL,
-<a name="l00752"></a>00752             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, sex_magerr);
-<a name="l00753"></a>00753 
-<a name="l00754"></a>00754 
-<a name="l00755"></a>00755     <span class="comment">/* cpl_table_dump_structure(out, stdout); */</span>
-<a name="l00756"></a>00756 
-<a name="l00757"></a>00757     <span class="keywordflow">if</span> (vignetted) {
-<a name="l00758"></a>00758         cpl_table_add_scalar(out, <span class="stringliteral">"X_IMAGE"</span>, croplx - 1);
-<a name="l00759"></a>00759         cpl_table_add_scalar(out, <span class="stringliteral">"Y_IMAGE"</span>, croply - 1);
-<a name="l00760"></a>00760     }
-<a name="l00761"></a>00761 
-<a name="l00762"></a>00762     stars = fors_star_list_new();
-<a name="l00763"></a>00763 
-<a name="l00764"></a>00764     {
-<a name="l00765"></a>00765         <span class="keywordtype">int</span> i;
-<a name="l00766"></a>00766         <span class="keywordtype">int</span> bkg_rejected = 0;
-<a name="l00767"></a>00767         <span class="keywordtype">int</span> rejected = 0;
-<a name="l00768"></a>00768         <span class="keywordtype">float</span> *bdata = cpl_image_get_data(bmaxsigma);
-<a name="l00769"></a>00769         <span class="keywordtype">int</span> nx = cpl_image_get_size_x(bmaxsigma);
-<a name="l00770"></a>00770         <span class="keywordtype">int</span> ny = cpl_image_get_size_y(bmaxsigma);
-<a name="l00771"></a>00771 
-<a name="l00772"></a>00772         <span class="keywordflow">for</span> (i = 0; i < cpl_table_get_nrow(out); i++) {
-<a name="l00773"></a>00773             <a class="code" href="struct__fors__star.html">fors_star</a>       *s = NULL;
-<a name="l00774"></a>00774             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    flags = 0x0;
-<a name="l00775"></a>00775             <span class="keywordtype">int</span>             x, y, tmp;
-<a name="l00776"></a>00776             <span class="keywordtype">double</span>          bg_err;
-<a name="l00777"></a>00777             
-<a name="l00778"></a>00778             s = <a class="code" href="group__fors__star.html#gec880ac28409dd535ec3138e0b5b001c">fors_star_new_from_table</a>(   out,
-<a name="l00779"></a>00779                                             i,
-<a name="l00780"></a>00780                                             <span class="stringliteral">"X_IMAGE"</span>,
-<a name="l00781"></a>00781                                             <span class="stringliteral">"Y_IMAGE"</span>,
-<a name="l00782"></a>00782                                             <span class="stringliteral">"FWHM_IMAGE"</span>,
-<a name="l00783"></a>00783                                             <span class="stringliteral">"A_IMAGE"</span>,
-<a name="l00784"></a>00784                                             <span class="stringliteral">"B_IMAGE"</span>,
-<a name="l00785"></a>00785                                             <span class="stringliteral">"THETA_IMAGE"</span>, 
-<a name="l00786"></a>00786                                             sex_mag,
-<a name="l00787"></a>00787                                             sex_magerr,
-<a name="l00788"></a>00788                                             <span class="stringliteral">"CLASS_STAR"</span>);
-<a name="l00789"></a>00789             (*s).orientation *= M_PI/180;
-<a name="l00790"></a>00790             (*s).semi_major *= setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00791"></a>00791             (*s).semi_minor *= setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00792"></a>00792             (*s).fwhm *= setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>;
-<a name="l00793"></a>00793             (*s).dmagnitude = sqrt((*s).dmagnitude * (*s).dmagnitude + magsyserr * magsyserr);
-<a name="l00794"></a>00794             
-<a name="l00795"></a>00795             flags = cpl_table_get_int(      out, <span class="stringliteral">"FLAGS"</span>, i, NULL);
-<a name="l00796"></a>00796             
-<a name="l00797"></a>00797             x = (int)(s->pixel->x + 0.5);
-<a name="l00798"></a>00798             y = (int)(s->pixel->y + 0.5);
-<a name="l00799"></a>00799             <span class="keywordflow">if</span> (x >= 1 && x <= nx && y >= 1 && y <= ny)
-<a name="l00800"></a>00800                 bg_err = cpl_image_get(bmaxsigma, x, y, &tmp);
-<a name="l00801"></a>00801             <span class="keywordflow">else</span>
-<a name="l00802"></a>00802                 bg_err = -1.0;
-<a name="l00803"></a>00803             
-<a name="l00804"></a>00804             <span class="keywordflow">if</span> (<a class="code" href="group__fors__extract.html#gcdd189ebaad6fe5c20ac2dea2eb06dfe">fors_extract_check_sex_flag</a>(flags)
-<a name="l00805"></a>00805                 && <a class="code" href="group__fors__extract.html#g2c649f2f8802860d4693e38bd640032c">fors_extract_check_sex_star</a>(s, bmaxsigma)
-<a name="l00806"></a>00806                 && bg_err < level)
-<a name="l00807"></a>00807             {
-<a name="l00808"></a>00808                 cpl_msg_debug(              cpl_func,
-<a name="l00809"></a>00809                                             <span class="stringliteral">"Source at (%f, %f): fwhm = %f px"</span>,
-<a name="l00810"></a>00810                                             s->pixel->x, s->pixel->y, s->fwhm);
-<a name="l00811"></a>00811                 <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                     !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,
-<a name="l00812"></a>00812                                             <span class="stringliteral">"Could not read SExtractor "</span>
-<a name="l00813"></a>00813                                             <span class="stringliteral">"output table %s"</span>,
-<a name="l00814"></a>00814                                             filename_cat);
-<a name="l00815"></a>00815                 fors_star_list_insert(stars, s);
-<a name="l00816"></a>00816             }
-<a name="l00817"></a>00817             <span class="keywordflow">else</span>
-<a name="l00818"></a>00818             {
-<a name="l00819"></a>00819                 cpl_msg_debug(              cpl_func,
-<a name="l00820"></a>00820                                             <span class="stringliteral">"Rejecting source at (%f, %f): "</span>
-<a name="l00821"></a>00821                                             <span class="stringliteral">"flags = 0x%x; fwhm = %f pix; "</span>
-<a name="l00822"></a>00822                                             <span class="stringliteral">"background error = %f; "</span>
-<a name="l00823"></a>00823                                             <span class="stringliteral">"level = %f; "</span>
-<a name="l00824"></a>00824                                             <span class="stringliteral">"background = %f"</span>,
-<a name="l00825"></a>00825                                             s->pixel->x, s->pixel->y,
-<a name="l00826"></a>00826                                             flags, s->fwhm,
-<a name="l00827"></a>00827                                             bg_err, level,
-<a name="l00828"></a>00828                                             cpl_table_get_float(
-<a name="l00829"></a>00829                                                 out, <span class="stringliteral">"BACKGROUND"</span>, i, NULL));
-<a name="l00830"></a>00830                 <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>(&s);
-<a name="l00831"></a>00831                 rejected++;
-<a name="l00832"></a>00832                 <span class="keywordflow">if</span> (bg_err >= level)
-<a name="l00833"></a>00833                     bkg_rejected++;
-<a name="l00834"></a>00834             }
-<a name="l00835"></a>00835         }
-<a name="l00836"></a>00836         
-<a name="l00837"></a>00837         cpl_msg_info(cpl_func, <span class="stringliteral">"%d sources sextracted, %d rejected"</span>, 
-<a name="l00838"></a>00838                      fors_star_list_size(stars) + rejected,
-<a name="l00839"></a>00839                      rejected);
-<a name="l00840"></a>00840     }
-<a name="l00841"></a>00841     
-<a name="l00842"></a>00842     <span class="keywordflow">if</span> (extracted_sources != NULL) {
-<a name="l00843"></a>00843         *extracted_sources = cpl_table_duplicate(out);
-<a name="l00844"></a>00844     }
-<a name="l00845"></a>00845     
-<a name="l00846"></a>00846     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00847"></a>00847     <span class="keywordflow">return</span> stars;
-<a name="l00848"></a>00848 }
-<a name="l00849"></a>00849 
-<a name="l00850"></a>00850 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00851"></a>00851 <span class="preprocessor">#undef cleanup</span>
-<a name="l00852"></a><a class="code" href="group__fors__extract.html#g57cf6e6e2826eb178fd2d9c3e5695343">00852</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00853"></a>00853 <span class="preprocessor"></span>
-<a name="l00865"></a>00865 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00866"></a>00866 <span class="keyword">static</span> fors_star_list *
-<a name="l00867"></a><a class="code" href="group__fors__extract.html#gedc4ee1e5daa54e4859e929c7ff51f59">00867</a> <a class="code" href="group__fors__extract.html#gedc4ee1e5daa54e4859e929c7ff51f59">extract_test</a>(                               <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,
-<a name="l00868"></a>00868                                             cpl_image **background,
-<a name="l00869"></a>00869                                             cpl_table **extracted_sources)
-<a name="l00870"></a>00870 {
-<a name="l00871"></a>00871     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( sky_stats != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00872"></a>00872     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( background != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00873"></a>00873     
-<a name="l00874"></a>00874     sky_stats-><a class="code" href="structfors__extract__sky__stats.html#b7ca852023d946aa752ef2d3f4f871b9">mean</a> = 1;
-<a name="l00875"></a>00875     sky_stats-><a class="code" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">median</a> = 2;
-<a name="l00876"></a>00876     sky_stats-><a class="code" href="structfors__extract__sky__stats.html#69ed6753cee271b73c8b7e73a016fdeb">rms</a> = 3;
-<a name="l00877"></a>00877 
-<a name="l00878"></a>00878     *background = cpl_image_new(10, 20, CPL_TYPE_FLOAT); <span class="comment">/* Zero, wrong size */</span>
-<a name="l00879"></a>00879 
-<a name="l00880"></a>00880     fors_star_list *stars = fors_star_list_new();
-<a name="l00881"></a>00881 
-<a name="l00882"></a>00882     <span class="keyword">struct </span>{
-<a name="l00883"></a>00883         <span class="keywordtype">double</span> x, y, magnitude, dmagnitude;
-<a name="l00884"></a>00884     } 
-<a name="l00885"></a>00885     data[] = {
-<a name="l00886"></a>00886         {100 ,  200, -10, 0.01},
-<a name="l00887"></a>00887         {1100,  200, -11, 0.01},
-<a name="l00888"></a>00888         {1   ,  5  , -10, 0.01},
-<a name="l00889"></a>00889         {100 , 1200, -12, 0.01},
-<a name="l00890"></a>00890         {1100, 1200, -13, 0.01}
-<a name="l00891"></a>00891     };
-<a name="l00892"></a>00892        
-<a name="l00893"></a>00893     <span class="keywordtype">int</span> N = <span class="keyword">sizeof</span>(data) / <span class="keyword">sizeof</span>(*data);
-<a name="l00894"></a>00894     <span class="keywordtype">int</span> i;
-<a name="l00895"></a>00895     <span class="keywordtype">double</span> a = 2;
-<a name="l00896"></a>00896     <span class="keywordtype">double</span> b = 1;
-<a name="l00897"></a>00897     <span class="keywordtype">double</span> fwhm = 1.5;
-<a name="l00898"></a>00898     <span class="keywordtype">double</span> orientation = 1.0; <span class="comment">/* radians */</span>
-<a name="l00899"></a>00899 
-<a name="l00900"></a>00900     <span class="keywordflow">for</span> (i = 0; i < N; i++) {
-<a name="l00901"></a>00901         fors_star_list_insert(stars,
-<a name="l00902"></a>00902                               <a class="code" href="group__fors__star.html#g548c477088fd4fbadd74fd84f3becb94">fors_star_new</a>(data[i].x,
-<a name="l00903"></a>00903                                             data[i].y,
-<a name="l00904"></a>00904                                             fwhm,
-<a name="l00905"></a>00905                                             a, b, orientation,
-<a name="l00906"></a>00906                                             data[i].magnitude,
-<a name="l00907"></a>00907                                             data[i].dmagnitude,
-<a name="l00908"></a>00908                                             1.0));
-<a name="l00909"></a>00909     }
-<a name="l00910"></a>00910 
-<a name="l00911"></a>00911     <span class="keywordflow">if</span> (extracted_sources != NULL) {
-<a name="l00912"></a>00912         *extracted_sources = <a class="code" href="group__fors__tools.html#g8138511b64d1d365e21b56eb161f2028">fors_create_sources_table</a>(stars);
-<a name="l00913"></a>00913         
-<a name="l00914"></a>00914         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a> (!cpl_error_get_code(), <span class="keywordflow">return</span> NULL, 
-<a name="l00915"></a>00915                 <span class="stringliteral">"Could not create extracted sources table"</span>);
-<a name="l00916"></a>00916     }
-<a name="l00917"></a>00917     
-<a name="l00918"></a>00918     <span class="keywordflow">return</span> stars;
-<a name="l00919"></a>00919 }
-<a name="l00920"></a>00920 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors_2fors__extract_8c_source.html b/html/fors_2fors__extract_8c_source.html
new file mode 100644
index 0000000..3896e4a
--- /dev/null
+++ b/html/fors_2fors__extract_8c_source.html
@@ -0,0 +1,894 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_extract.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors/fors_extract.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_extract.c,v 1.45 2011-10-13 14:29:24 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-13 14:29:24 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.45 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_extract.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_star.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_tools.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="comment">    (Proto)types</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="struct__extract__method.html">   56</a></span> <span class="keyword">struct </span><a class="code" href="struct__extract__method.html">_extract_method</a></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> {</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>     <span class="keyword">enum</span> {SEX, TEST} method;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_exe;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_config;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_mag;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_magerr;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     <span class="keywordtype">int</span> sex_radius;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> };</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keyword">static</span> fors_star_list *</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <a class="code" href="group__fors__extract.html#ga179ba42491f97607c78d677e432614a7" title="Extract sources using SExtractor.">extract_sex</a>(                                <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_exe,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_config,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_mag,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_magerr,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                                             <span class="keywordtype">int</span> radius,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                                             <span class="keywordtype">double</span> magsyserr,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                                             <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>                                             cpl_image **background,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                                             cpl_table **extracted_sources);</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="keyword">static</span> fors_star_list *</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <a class="code" href="group__fors__extract.html#ga6a2e3af8f65f79d338c6f0c46931b89d" title="Extract sources.">extract_test</a>(                               <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                                             cpl_image **background,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                                             cpl_table **extracted_sources);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="comment">    Implementation</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="group__fors__extract.html#ga0753c9c8f5c40f594ebc0628407df2d4">  100</a></span> <a class="code" href="group__fors__extract.html#ga0753c9c8f5c40f594ebc0628407df2d4" title="Check SExtractor object feature: FLAG.">fors_extract_check_sex_flag</a>(                <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    sex_flag)</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> {</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="keywordflow">return</span> (sex_flag == 0x0);</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> }</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> </div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno"><a class="code" href="group__fors__extract.html#gab2bb9e07066870dd90dadd6044803dd0">  122</a></span> <a class="code" href="group__fors__extract.html#gab2bb9e07066870dd90dadd6044803dd0" title="Check a sextracted star for validity.">fors_extract_check_sex_star</a>(                <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                                             <span class="keyword">const</span> cpl_image *ref_img)</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> {</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="keywordtype">bool</span>    success = 1;</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     <span class="keywordflow">if</span> (star == NULL)</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     success &= <a class="code" href="group__fors__star.html#ga279f39755ddfa24ee9cfad4a03c01cf3" title="Copy constructor.">fors_star_check_values</a>(star);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     success &= (star->magnitude < 98);</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <span class="keywordflow">if</span> (ref_img != NULL)</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     {</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         success &= star->pixel->x >= 1;</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>         success &= star->pixel->x <= cpl_image_get_size_x(ref_img);</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>         success &= star->pixel->y >= 1;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>         success &= star->pixel->y <= cpl_image_get_size_y(ref_img);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     }</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="keywordflow">return</span> success;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> }</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00153"></a><span class="lineno"><a class="code" href="group__fors__extract.html#ga2fe71423afa3cceea5d92dd3b49aca1e">  153</a></span> <a class="code" href="group__fors__extract.html#ga2fe71423afa3cceea5d92dd3b49aca1e" title="Define recipe parameters.">fors_extract_define_parameters</a>(             cpl_parameterlist *parameters, </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *context)</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> {</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *full_name = NULL;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="comment">    name = "extract_method";</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="comment">    p = cpl_parameter_new_enum(full_name,</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="comment">                               CPL_TYPE_STRING,</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="comment">                               "Source extraction method",</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="comment">                               context,</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="comment">                               "sex", 2,</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="comment">                               "sex", "test");</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="comment">    cpl_parameterlist_append(parameters, p);</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="comment">    cpl_free((void *)full_name);</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     name = <span class="stringliteral">"sex_exe"</span>;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>                                 <span class="stringliteral">"SExtractor executable"</span>,</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                                 context,</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                                 FORS_SEXTRACTOR_PATH <span class="stringliteral">"/sex"</span>);</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     name = <span class="stringliteral">"sex_config"</span>;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                                 <span class="stringliteral">"SExtractor configuration file"</span>,</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                                 context,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                                 FORS_SEXTRACTOR_CONFIG <span class="stringliteral">"/fors.sex"</span>);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     </div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     name = <span class="stringliteral">"sex_mag"</span>;</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                                 <span class="stringliteral">"SExtractor magnitude"</span>,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                 context,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                                 <span class="stringliteral">"MAG_APER"</span>);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     </div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     name = <span class="stringliteral">"sex_magerr"</span>;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                                 <span class="stringliteral">"SExtractor magnitude error"</span>,</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                                 context,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                                 <span class="stringliteral">"MAGERR_APER"</span>);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     name = <span class="stringliteral">"sex_radius"</span>;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>                                 <span class="stringliteral">"Background error map median filter "</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>                                 <span class="stringliteral">"radius (unbinned pixels)"</span>,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                                 context,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                 64);</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> }</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="preprocessor">    cpl_free((void *)name); \</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> <span class="preprocessor">    cpl_free((void *)method); \</span></div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> extract_method *</div>
+<div class="line"><a name="l00258"></a><span class="lineno"><a class="code" href="group__fors__extract.html#ga9b1d727905c3cb3f7740900ffaba6b57">  258</a></span> <a class="code" href="group__fors__extract.html#ga9b1d727905c3cb3f7740900ffaba6b57" title="Get extraction method from parameter list.">fors_extract_method_new</a>(                    <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *context)</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> {</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     extract_method *em = cpl_malloc(<span class="keyword">sizeof</span>(*em));</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name = NULL;</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *method = NULL;</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Extraction method:"</span>);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="comment">//"sex" method is the default. The parameter won't appear when calling</span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="comment">//the recipe from esorex, but it will in the unit tests fors_zeropoint-test,</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="comment">//fors_img_science-test.</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"extract_method"</span>);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <span class="keywordflow">if</span>(cpl_parameterlist_find_const(parameters, name) == NULL)</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>         method = cpl_sprintf(<span class="stringliteral">"%s"</span>, <span class="stringliteral">"sex"</span>);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>         method = cpl_sprintf(<span class="stringliteral">"%s"</span>,<a class="code" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">dfs_get_parameter_string_const</a>(parameters, name));</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( method != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordflow">if</span> (strcmp(method, <span class="stringliteral">"sex"</span>) == 0) {</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>         em->method = SEX;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>         </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sex_exe"</span>);</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>         em->sex_exe = <a class="code" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">dfs_get_parameter_string_const</a>(parameters, </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                                                      name);</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> </div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>         </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sex_config"</span>);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>         em->sex_config = <a class="code" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">dfs_get_parameter_string_const</a>(parameters, </div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                                                      name);</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sex_mag"</span>);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>         em->sex_mag = <a class="code" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">dfs_get_parameter_string_const</a>(parameters, </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>                                                      name);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sex_magerr"</span>);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>         em->sex_magerr = <a class="code" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">dfs_get_parameter_string_const</a>(parameters, </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                                                         name);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> </div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sex_radius"</span>);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>         em->sex_radius = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parameters, </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>                                            name);</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     }</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(method, <span class="stringliteral">"test"</span>) == 0) {</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>         em->method = TEST;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     }</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Unknown extraction method '%s'"</span>, method);</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     }</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     cleanup;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keywordflow">return</span> em;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> }</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> </div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00342"></a><span class="lineno"><a class="code" href="group__fors__extract.html#ga11354d3d250769e1adb67e1a2dbc1a96">  342</a></span> <a class="code" href="group__fors__extract.html#ga11354d3d250769e1adb67e1a2dbc1a96" title="Deallocate extraction method and set the pointer to NULL.">fors_extract_method_delete</a>(                 extract_method **em)</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> {</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="keywordflow">if</span> (em && *em) {</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>         cpl_free(*em); *em = NULL;</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     }</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> }</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> fors_star_list *</div>
+<div class="line"><a name="l00365"></a><span class="lineno"><a class="code" href="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05">  365</a></span> <a class="code" href="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05" title="Extract sources.">fors_extract</a>(                               <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                                             <span class="keyword">const</span> extract_method *em,</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>                                             <span class="keywordtype">double</span> magsyserr,</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                                             <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>                                             cpl_image **background,</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>                                             cpl_table **extracted_sources)</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> {</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( em != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> </div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Extracting sources"</span>);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     </div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordflow">switch</span> (em->method ) {</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordflow">case</span> SEX: <span class="keywordflow">return</span> <a class="code" href="group__fors__extract.html#ga179ba42491f97607c78d677e432614a7" title="Extract sources using SExtractor.">extract_sex</a>(image, setting,</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>                                  em->sex_exe,</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>                                  em->sex_config,</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>                                  em->sex_mag,</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>                                  em->sex_magerr,</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>                                  em->sex_radius,</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>                                  magsyserr,</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>                                  sky_stats,</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>                                  background,</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>                                  extracted_sources); <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="keywordflow">case</span> TEST: <span class="keywordflow">return</span> <a class="code" href="group__fors__extract.html#ga6a2e3af8f65f79d338c6f0c46931b89d" title="Extract sources.">extract_test</a>(sky_stats, background, extracted_sources); <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Unknown method %d"</span>, em->method );</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     }</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> }</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="preprocessor">    cpl_table_delete(out); out = NULL; \</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="preprocessor">    cpl_free((void *)command); \</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="preprocessor">    cpl_image_delete(work_back); work_back = NULL; \</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> <span class="preprocessor">    cpl_image_delete(bmaxsigma); bmaxsigma = NULL; \</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> <span class="preprocessor">    cpl_image_delete(bsigma); bsigma = NULL; \</span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="preprocessor">    fors_image_delete(&fbsigma); \</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> <span class="keyword">static</span> fors_star_list *</div>
+<div class="line"><a name="l00431"></a><span class="lineno"><a class="code" href="group__fors__extract.html#ga179ba42491f97607c78d677e432614a7">  431</a></span> <a class="code" href="group__fors__extract.html#ga179ba42491f97607c78d677e432614a7" title="Extract sources using SExtractor.">extract_sex</a>(                                <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_exe,</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_config,</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_mag,</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *sex_magerr,</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                                             <span class="keywordtype">int</span> radius,</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                                             <span class="keywordtype">double</span> magsyserr,</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>                                             <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>                                             cpl_image **background,</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                                             cpl_table **extracted_sources)</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> {</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_data  = <span class="stringliteral">"sextract_data.fits"</span>;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_sigma = <span class="stringliteral">"sextract_bkg_sigma.fits"</span>;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_cat   = <span class="stringliteral">"sextract_cat.fits"</span>;</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_bkg   = <span class="stringliteral">"sextract_bkg.fits"</span>;</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     cpl_table *out = NULL;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *command = NULL;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     fors_star_list *stars = NULL;</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     cpl_image *work_back = NULL;</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     cpl_image *bmaxsigma = NULL;</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     cpl_image *bsigma = NULL;</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *fbsigma = NULL;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *cropped = NULL;</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordtype">int</span> croplx, croply, cropux, cropuy;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_data_full  = <span class="stringliteral">"sextract_data_full.fits"</span>;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename_sigma_full = <span class="stringliteral">"sextract_bkg_sigma_full.fits"</span>;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     <span class="keywordtype">int</span>        vignetted = 1;</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( setting != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( sky_stats != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( background != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> </div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> </div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> <span class="comment">     * In case of new chips, crop</span></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     <span class="keywordflow">if</span> (strcmp(setting->chip_id, <span class="stringliteral">"CCID20-14-5-6"</span>) == 0) {</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         croplx =  380 / setting->binx;</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>         croply =  626 / setting->biny;</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>         cropux = 3714 / setting->binx;</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         cropuy = 2048 / setting->biny;</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     }</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(setting->chip_id, <span class="stringliteral">"CCID20-14-5-3"</span>) == 0) {</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         croplx =  380 / setting->binx;</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>         croply =    2 / setting->biny;</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>         cropux = 3714 / setting->binx;</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>         cropuy = 1920 / setting->biny;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     }</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(setting->chip_id, <span class="stringliteral">"Marl"</span>, 4) == 0) {</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         croplx =  380 / setting->binx;</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         croply =  694 / setting->biny;</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         cropux = 3690 / setting->binx;</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>         cropuy = 2048 / setting->biny;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     }</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(setting->chip_id, <span class="stringliteral">"Norm"</span>, 4) == 0) {</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>         croplx =  380 / setting->binx;</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>         croply =    2 / setting->biny;</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>         cropux = 3690 / setting->binx;</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         cropuy = 1894 / setting->biny;</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     }</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>         vignetted = 0;</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     }</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> </div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     cropped = (<a class="code" href="struct__fors__image.html">fors_image</a> *)image;       <span class="comment">/* As a default.... */</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span> </div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     <span class="keywordflow">if</span> (vignetted) {</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>        <a class="code" href="group__fors__image.html#ga38eebeb331a65efbffbc6dc04304a786" title="Save image in format useable by SExtractor.">fors_image_save_sex</a>(image, NULL,</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                             filename_data_full,</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>                             filename_sigma_full,</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>                             radius);</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> </div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>                 <span class="stringliteral">"Could not save image to %s and %s"</span>,</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>                 filename_data_full, filename_sigma_full);</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>         cropped = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(image);</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>         <a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053" title="Crop image.">fors_image_crop</a>(cropped, croplx, croply, cropux, cropuy);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     }</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     <span class="comment">/* provide data and error bars in separate files,</span></div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> <span class="comment">       pass to sextractor */</span></div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> </div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     <a class="code" href="group__fors__image.html#ga38eebeb331a65efbffbc6dc04304a786" title="Save image in format useable by SExtractor.">fors_image_save_sex</a>(cropped, NULL,</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>                         filename_data,</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>                         filename_sigma,</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>                         radius);</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>             <span class="stringliteral">"Could not save image to %s and %s"</span>,</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>             filename_data, filename_sigma);</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span> </div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     <span class="keywordflow">if</span> (vignetted)</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>         <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&cropped);</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> </div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>     </div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span> <span class="comment">     * A = load filename_sigma</span></div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> <span class="comment">     * M = fors_image_max_filter(A)</span></div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> <span class="comment">     * |A-M|</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     command = cpl_sprintf(<span class="stringliteral">"%s %s,%s "</span></div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>                           <span class="stringliteral">"-c %s "</span></div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>                           <span class="comment">/* Use SExtractor's double mode which is probably</span></div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> <span class="comment">                             more tested and more bugfree than the</span></div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span> <span class="comment">                             single image mode */</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>                           <span class="stringliteral">"-GAIN %f "</span>   <span class="comment">/* Different terminology here:</span></div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span> <span class="comment">                                           SExtractor-gain == ESO-conad,</span></div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span> <span class="comment">                                           unit = e- / ADU</span></div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span> <span class="comment">                                        */</span></div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>                           <span class="stringliteral">"-PIXEL_SCALE %f "</span></div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>                           <span class="stringliteral">"-CHECKIMAGE_TYPE BACKGROUND "</span></div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>                           <span class="stringliteral">"-CHECKIMAGE_NAME %s "</span></div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>                           <span class="stringliteral">"-WEIGHT_TYPE MAP_RMS "</span></div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>                           <span class="stringliteral">"-WEIGHT_IMAGE %s,%s "</span></div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>                           <span class="stringliteral">"-CATALOG_TYPE FITS_1.0 "</span></div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>                           <span class="stringliteral">"-CATALOG_NAME %s"</span>,</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>                           sex_exe,</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>                           filename_data, filename_data,</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>                           sex_config,</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>                           1.0/setting->average_gain,</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>                           setting->pixel_scale,</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>                           filename_bkg,</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>                           filename_sigma, filename_sigma,</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>                           filename_cat);</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Running '%s'"</span>, command);</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span> </div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( system(command) == 0, <span class="keywordflow">return</span> stars, <span class="stringliteral">"'%s' failed"</span>, command);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span> </div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span> <span class="comment">     * The background map is here used just to evaluate a QC parameter,</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span> <span class="comment">     * and is also returned to the caller.</span></div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     {</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>         <span class="keywordtype">int</span> plane = 0;</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         <span class="keywordtype">int</span> extension = 0;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span> </div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>         *background = cpl_image_load(filename_bkg,</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>                                      CPL_TYPE_FLOAT, plane, extension);</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> </div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>                 <span class="stringliteral">"Could not load SExtractor background image %s"</span>,</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>                 filename_bkg );</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> </div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>         <span class="keywordflow">if</span> (vignetted) {</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>             work_back = cpl_image_new(<a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(image), </div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>                                       <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(image),</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>                                       CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>             cpl_image_copy(work_back, *background, croplx, croply);</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span> </div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>             <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>                     <span class="stringliteral">"Could not insert background image %s"</span>,</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>                     filename_bkg );</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span> </div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>             cpl_image_delete(*background);</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>             *background = work_back;</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>             work_back = NULL;</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>         }</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         </div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         <span class="comment">/* </span></div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> <span class="comment">         * To avoid using the non-illuminated parts, use only the central </span></div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span> <span class="comment">         * 100x100 window.</span></div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span> <span class="comment">         * It does not make too much sense to trend these QC parameters</span></div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> <span class="comment">         * anyway because they mostly describe the individual science </span></div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span> <span class="comment">         * exposures.</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>         <span class="keywordtype">int</span> nx = cpl_image_get_size_x(*background);</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>         <span class="keywordtype">int</span> ny = cpl_image_get_size_y(*background);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>         <span class="keywordtype">int</span> xlo = nx/2 - 50;</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         <span class="keywordtype">int</span> xhi = nx/2 + 50;</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>         <span class="keywordtype">int</span> ylo = ny/2 - 50;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>         <span class="keywordtype">int</span> yhi = ny/2 + 50;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>         </div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>         <span class="keywordflow">if</span> (xlo <   0) xlo = 0;       <span class="comment">/* Just in case... */</span></div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         <span class="keywordflow">if</span> (xhi >= nx) xhi = nx - 1;</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         <span class="keywordflow">if</span> (ylo <   0) ylo = 0;</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         <span class="keywordflow">if</span> (yhi >= ny) yhi = ny - 1;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span> </div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>         work_back = cpl_image_duplicate(*background);</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>         </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>         sky_stats->mean   = cpl_image_get_mean_window(work_back, </div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>                                                       xlo, ylo, xhi, yhi);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         sky_stats->median = cpl_image_get_median_window(work_back, </div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>                                                  xlo, ylo, xhi, yhi);</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>         cpl_image_subtract_scalar(work_back, sky_stats->median);</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>         cpl_image_abs(work_back);</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>         sky_stats->rms    = cpl_image_get_median_window(work_back, </div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>                                                         xlo, ylo, xhi, yhi)</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>                           * STDEV_PR_MAD;</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> </div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>         cpl_image_delete(work_back); work_back = NULL;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> </div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>                 <span class="stringliteral">"Could not calculate sky statistics"</span> );</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     }</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     </div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Background = %f +- %f ADU"</span>,</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>                  sky_stats->median, sky_stats->rms);</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> <span class="comment">     * SExtractors background estimation is not reliable near</span></div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> <span class="comment">     * non-illuminated areas. The underestimated background </span></div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> <span class="comment">     * leads to false detections.</span></div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span> <span class="comment">     * Therefore, reject sources which are too close to the</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> <span class="comment">     * illumination edge. The edge is masked using a max filter </span></div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> <span class="comment">     * on the smoothed variance image of the background map. </span></div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span> <span class="comment">     * The filter must have comparable size to the SExtractor </span></div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> <span class="comment">     * BACK_SIZE parameter. The discrimination level is half-way</span></div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span> <span class="comment">     * between the high-variance and low-variance regions.</span></div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> </div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     <span class="keywordtype">float</span> level;</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     {</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         <span class="keywordtype">int</span> xradius = 64;</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>         <span class="keywordtype">int</span> yradius = 64;</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>         <span class="keywordtype">int</span> plane = 0;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>         <span class="keywordtype">int</span> extension = 0;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>         <span class="keywordtype">float</span> maxima;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>         <span class="keywordtype">float</span> minima;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> </div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>         <span class="keywordflow">if</span> (vignetted) {</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>             bsigma = cpl_image_load(filename_sigma_full,</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>                                     CPL_TYPE_FLOAT, plane, extension);</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>         }</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>             bsigma = cpl_image_load(filename_sigma,</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>                                     CPL_TYPE_FLOAT, plane, extension);</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>         }</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> </div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>                 <span class="stringliteral">"Could not load SExtractor background error image %s"</span>,</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>                 filename_sigma );</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> <span class="comment">         * Duplication is necessary for creating the fors_image</span></div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> <span class="comment">         * to be passed to fors_image_filter_max_create()</span></div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>         </div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>         <span class="comment">/* this wraps the fors_image around the cpl images,</span></div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> <span class="comment">         * so set them to NULL */</span></div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> </div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>         fbsigma = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(cpl_image_duplicate(bsigma), bsigma);</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>         bsigma = NULL;</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> </div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>         {</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>             <span class="keywordtype">bool</span> use_variance = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>             bmaxsigma = <a class="code" href="group__fors__image.html#ga21965427a98e2e07cf0b167e4610da1c" title="Max filter image.">fors_image_filter_max_create</a>(fbsigma, xradius, </div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>                                                      yradius, use_variance);</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span> </div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>      <span class="comment">/* cpl_image_save(bmaxsigma, "/tmp/test.fits", CPL_BPP_IEEE_FLOAT, NULL,</span></div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span> <span class="comment">                              CPL_IO_DEFAULT); */</span></div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>             </div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>         }</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span> </div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>         <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&fbsigma);</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> </div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> <span class="comment">          This is not robust if there are no non-illuminated areas.</span></div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span> <span class="comment"></span></div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> <span class="comment">          maxima = cpl_image_get_max(bmaxsigma);</span></div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span> <span class="comment">          minima = cpl_image_get_min(bmaxsigma);</span></div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> <span class="comment">          level = (maxima + minima) / 2; </span></div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>         </div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>         <span class="comment">/* 5 sigma rejection */</span></div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>         level = cpl_image_get_median(bmaxsigma) * 5;</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> </div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"Threshold level = %f"</span>,</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>                       level);</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> </div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     }</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> </div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     out = cpl_table_load(filename_cat, 1, 1);</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> </div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>             <span class="stringliteral">"Could not load SExtractor output table %s"</span>,</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>             filename_cat); </div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> </div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     <span class="comment">/* Validate sextractor output */</span></div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"FLAGS"</span>), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"FLAGS"</span>);</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span> </div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"CLASS_STAR"</span>), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"CLASS_STAR"</span>);</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span> </div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"BACKGROUND"</span>), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"BACKGROUND"</span>);</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span> </div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"X_IMAGE"</span>), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"X_IMAGE"</span>);</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"Y_IMAGE"</span>), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"Y_IMAGE"</span>);</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> </div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"FWHM_IMAGE"</span>), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"FWHM_IMAGE"</span>);</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span> </div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"A_IMAGE"</span>), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"A_IMAGE"</span>);</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> </div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"B_IMAGE"</span>), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"B_IMAGE"</span>);</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> </div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, <span class="stringliteral">"THETA_IMAGE"</span>), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, <span class="stringliteral">"THETA_IMAGE"</span>);</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, sex_mag), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, sex_mag);</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span> </div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(out, sex_magerr), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>             <span class="stringliteral">"%s: Missing column: %s"</span>, filename_cat, sex_magerr);</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span> </div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span> </div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>     <span class="comment">/* cpl_table_dump_structure(out, stdout); */</span></div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span> </div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     <span class="keywordflow">if</span> (vignetted) {</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>         cpl_table_add_scalar(out, <span class="stringliteral">"X_IMAGE"</span>, croplx - 1);</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>         cpl_table_add_scalar(out, <span class="stringliteral">"Y_IMAGE"</span>, croply - 1);</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>     }</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span> </div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>     stars = fors_star_list_new();</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> </div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     {</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>         <span class="keywordtype">int</span> bkg_rejected = 0;</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>         <span class="keywordtype">int</span> rejected = 0;</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>         <span class="keywordtype">float</span> *bdata = cpl_image_get_data(bmaxsigma);</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>         <span class="keywordtype">int</span> nx = cpl_image_get_size_x(bmaxsigma);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>         <span class="keywordtype">int</span> ny = cpl_image_get_size_y(bmaxsigma);</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span> </div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>         <span class="keywordflow">for</span> (i = 0; i < cpl_table_get_nrow(out); i++) {</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>             <a class="code" href="struct__fors__star.html">fors_star</a>       *s = NULL;</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    flags = 0x0;</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>             <span class="keywordtype">int</span>             x, y, tmp;</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>             <span class="keywordtype">double</span>          bg_err;</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>             </div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>             s = <a class="code" href="group__fors__star.html#ga5be8cd6931b5f998692daaf65bcf9755" title="Create a star from a table WITHOUT checking.">fors_star_new_from_table</a>(   out,</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>                                             i,</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>                                             <span class="stringliteral">"X_IMAGE"</span>,</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>                                             <span class="stringliteral">"Y_IMAGE"</span>,</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>                                             <span class="stringliteral">"FWHM_IMAGE"</span>,</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>                                             <span class="stringliteral">"A_IMAGE"</span>,</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>                                             <span class="stringliteral">"B_IMAGE"</span>,</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>                                             <span class="stringliteral">"THETA_IMAGE"</span>, </div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>                                             sex_mag,</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>                                             sex_magerr,</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>                                             <span class="stringliteral">"CLASS_STAR"</span>);</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>             (*s).orientation *= M_PI/180;</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>             (*s).semi_major *= setting->binx;</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>             (*s).semi_minor *= setting->binx;</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>             (*s).fwhm *= setting->binx;</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>             (*s).dmagnitude = sqrt((*s).dmagnitude * (*s).dmagnitude + magsyserr * magsyserr);</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>             </div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>             flags = cpl_table_get_int(      out, <span class="stringliteral">"FLAGS"</span>, i, NULL);</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>             </div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>             x = (int)(s->pixel->x + 0.5);</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>             y = (int)(s->pixel->y + 0.5);</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>             <span class="keywordflow">if</span> (x >= 1 && x <= nx && y >= 1 && y <= ny)</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>                 bg_err = cpl_image_get(bmaxsigma, x, y, &tmp);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>                 bg_err = -1.0;</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>             </div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>             <span class="keywordflow">if</span> (<a class="code" href="group__fors__extract.html#ga0753c9c8f5c40f594ebc0628407df2d4" title="Check SExtractor object feature: FLAG.">fors_extract_check_sex_flag</a>(flags)</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>                 && <a class="code" href="group__fors__extract.html#gab2bb9e07066870dd90dadd6044803dd0" title="Check a sextracted star for validity.">fors_extract_check_sex_star</a>(s, bmaxsigma)</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>                 && bg_err < level)</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>             {</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>                 cpl_msg_debug(              cpl_func,</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>                                             <span class="stringliteral">"Source at (%f, %f): fwhm = %f px"</span>,</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>                                             s->pixel->x, s->pixel->y, s->fwhm);</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>                 <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                     !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>                                             <span class="stringliteral">"Could not read SExtractor "</span></div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>                                             <span class="stringliteral">"output table %s"</span>,</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>                                             filename_cat);</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>                 fors_star_list_insert(stars, s);</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>             }</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>             {</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>                 cpl_msg_debug(              cpl_func,</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>                                             <span class="stringliteral">"Rejecting source at (%f, %f): "</span></div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>                                             <span class="stringliteral">"flags = 0x%x; fwhm = %f pix; "</span></div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>                                             <span class="stringliteral">"background error = %f; "</span></div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>                                             <span class="stringliteral">"level = %f; "</span></div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>                                             <span class="stringliteral">"background = %f"</span>,</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>                                             s->pixel->x, s->pixel->y,</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>                                             flags, s->fwhm,</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>                                             bg_err, level,</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>                                             cpl_table_get_float(</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>                                                 out, <span class="stringliteral">"BACKGROUND"</span>, i, NULL));</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>                 <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>(&s);</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>                 rejected++;</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>                 <span class="keywordflow">if</span> (bg_err >= level)</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>                     bkg_rejected++;</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>             }</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>         }</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>         </div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"%d sources sextracted, %d rejected"</span>, </div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>                      fors_star_list_size(stars) + rejected,</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>                      rejected);</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     }</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     </div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>     <span class="keywordflow">if</span> (extracted_sources != NULL) {</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>         *extracted_sources = cpl_table_duplicate(out);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     }</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>     </div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>     cleanup;</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>     <span class="keywordflow">return</span> stars;</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span> }</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span> </div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span> <span class="keyword">static</span> fors_star_list *</div>
+<div class="line"><a name="l00867"></a><span class="lineno"><a class="code" href="group__fors__extract.html#ga6a2e3af8f65f79d338c6f0c46931b89d">  867</a></span> <a class="code" href="group__fors__extract.html#ga6a2e3af8f65f79d338c6f0c46931b89d" title="Extract sources.">extract_test</a>(                               <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>                                             cpl_image **background,</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>                                             cpl_table **extracted_sources)</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span> {</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( sky_stats != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( background != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>     </div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>     sky_stats->mean = 1;</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>     sky_stats->median = 2;</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>     sky_stats->rms = 3;</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span> </div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>     *background = cpl_image_new(10, 20, CPL_TYPE_FLOAT); <span class="comment">/* Zero, wrong size */</span></div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span> </div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>     fors_star_list *stars = fors_star_list_new();</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span> </div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>         <span class="keywordtype">double</span> x, y, magnitude, dmagnitude;</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>     } </div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>     data[] = {</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>         {100 ,  200, -10, 0.01},</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>         {1100,  200, -11, 0.01},</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>         {1   ,  5  , -10, 0.01},</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>         {100 , 1200, -12, 0.01},</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>         {1100, 1200, -13, 0.01}</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>     };</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>        </div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>     <span class="keywordtype">int</span> N = <span class="keyword">sizeof</span>(data) / <span class="keyword">sizeof</span>(*data);</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>     <span class="keywordtype">double</span> a = 2;</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>     <span class="keywordtype">double</span> b = 1;</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>     <span class="keywordtype">double</span> fwhm = 1.5;</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>     <span class="keywordtype">double</span> orientation = 1.0; <span class="comment">/* radians */</span></div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span> </div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>     <span class="keywordflow">for</span> (i = 0; i < N; i++) {</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>         fors_star_list_insert(stars,</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>                               <a class="code" href="group__fors__star.html#ga7a8b2a60d5685524ffbb762e066c9b01" title="Constructor.">fors_star_new</a>(data[i].x,</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>                                             data[i].y,</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>                                             fwhm,</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>                                             a, b, orientation,</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>                                             data[i].magnitude,</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>                                             data[i].dmagnitude,</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>                                             1.0));</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>     }</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span> </div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>     <span class="keywordflow">if</span> (extracted_sources != NULL) {</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>         *extracted_sources = <a class="code" href="group__fors__tools.html#gabebf30c47320c004ab4e658f837f75db" title="Create product.">fors_create_sources_table</a>(stars);</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>         </div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a> (!cpl_error_get_code(), <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>                 <span class="stringliteral">"Could not create extracted sources table"</span>);</div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>     }</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>     </div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>     <span class="keywordflow">return</span> stars;</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span> }</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__align__sky_8c-source.html b/html/fors__align__sky_8c-source.html
deleted file mode 100644
index 8b1a21d..0000000
--- a/html/fors__align__sky_8c-source.html
+++ /dev/null
@@ -1,785 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_align_sky.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_align_sky.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_align_sky.c,v 1.7 2013/04/24 14:15:36 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:15:36 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_align_sky_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to align the wavelength solution based on the arc\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"lamp exposure on a set of sky lines observed on a scientific exposure.\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"The input rectified frames are produced by the recipe fors_extract_slits.\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"An input catalog of sky lines can be specified, otherwise an internal one\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"is used.\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"This recipe should be applied to multi-slit MOS/MXU data: for LSS or\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"long-slit like data (MOS/MXU with all slits at the same offset) use recipe\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"fors_align_sky_lss instead. Please refer to the FORS Pipeline User's Manual\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"for more details.\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS, and\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"SCI as STD.\n\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  RECTIFIED_ALL_SCI_MXU\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  or RECTIFIED_SKY_SCI_MXU   Calib       Frame with sky lines    Y\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"  SPATIAL_MAP_MXU            Calib       Spatial coordinate map  Y\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      Y\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location on CCD    Y\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  DISP_COEFF_MXU             Calib       Dispersion solution     Y\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  MASTER_SKYLINECAT          Calib       Catalog of sky lines    .\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  SKY_SHIFTS_SLIT_SCI_MXU    FITS table  Observed sky lines offsets\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  WAVELENGTH_MAP_SCI_MXU     FITS image  Wavelength mapped on CCD\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"  DISP_COEFF_SCI_MXU         FITS image  Upgraded dispersion solution\n\n"</span>;
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 <span class="preprocessor">#define fors_align_sky_exit(message)          \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">{                                             \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_image_delete(smapped);                    \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_table_delete(offsets);                    \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">}</span>
-<a name="l00091"></a>00091 <span class="preprocessor"></span>
-<a name="l00092"></a>00092 <span class="preprocessor">#define fors_align_sky_exit_memcheck(message)   \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">{                                               \</span>
-<a name="l00094"></a>00094 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);         \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">cpl_image_delete(wavemap);                      \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);   \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">cpl_image_delete(coordinate);                   \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);         \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">cpl_image_delete(rainbow);                      \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">printf("free smapped (%p)\n", smapped);         \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">cpl_image_delete(smapped);                      \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">cpl_table_delete(grism_table);                  \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">cpl_table_delete(maskslits);                    \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths); \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">cpl_table_delete(wavelengths);                  \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">printf("free offsets (%p)\n", offsets);         \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">cpl_table_delete(offsets);                      \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);       \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">cpl_table_delete(idscoeff);                     \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">cpl_table_delete(slits);                        \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">cpl_table_delete(polytraces);                   \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">printf("free lines (%p)\n", lines);             \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">cpl_vector_delete(lines);                       \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00121"></a>00121 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00123"></a>00123 <span class="preprocessor">}</span>
-<a name="l00124"></a>00124 <span class="preprocessor"></span>
-<a name="l00125"></a>00125 
-<a name="l00137"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00137</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00138"></a>00138 {
-<a name="l00139"></a>00139     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00140"></a>00140     cpl_plugin *plugin = &recipe->interface;
-<a name="l00141"></a>00141 
-<a name="l00142"></a>00142     cpl_plugin_init(plugin,
-<a name="l00143"></a>00143                     CPL_PLUGIN_API,
-<a name="l00144"></a>00144                     FORS_BINARY_VERSION,
-<a name="l00145"></a>00145                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00146"></a>00146                     <span class="stringliteral">"fors_align_sky"</span>,
-<a name="l00147"></a>00147                     <span class="stringliteral">"Upgrade wavelength solution using sky lines"</span>,
-<a name="l00148"></a>00148                     fors_align_sky_description,
-<a name="l00149"></a>00149                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00150"></a>00150                     PACKAGE_BUGREPORT,
-<a name="l00151"></a>00151     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00152"></a>00152     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00153"></a>00153     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00154"></a>00154     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00155"></a>00155     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00156"></a>00156     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00157"></a>00157     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00158"></a>00158     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00159"></a>00159     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00160"></a>00160     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00161"></a>00161     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00162"></a>00162     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00163"></a>00163     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00164"></a>00164                     fors_align_sky_create,
-<a name="l00165"></a>00165                     fors_align_sky_exec,
-<a name="l00166"></a>00166                     fors_align_sky_destroy);
-<a name="l00167"></a>00167 
-<a name="l00168"></a>00168     cpl_pluginlist_append(list, plugin);
-<a name="l00169"></a>00169     
-<a name="l00170"></a>00170     <span class="keywordflow">return</span> 0;
-<a name="l00171"></a>00171 }
-<a name="l00172"></a>00172 
-<a name="l00173"></a>00173 
-<a name="l00184"></a>00184 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_create(cpl_plugin *plugin)
-<a name="l00185"></a>00185 {
-<a name="l00186"></a>00186     cpl_recipe    *recipe;
-<a name="l00187"></a>00187     cpl_parameter *p;
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189     <span class="comment">/* </span>
-<a name="l00190"></a>00190 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00191"></a>00191 <span class="comment">     */</span>
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00194"></a>00194         recipe = (cpl_recipe *)plugin;
-<a name="l00195"></a>00195     <span class="keywordflow">else</span> 
-<a name="l00196"></a>00196         <span class="keywordflow">return</span> -1;
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198     <span class="comment">/* </span>
-<a name="l00199"></a>00199 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00200"></a>00200 <span class="comment">     */</span>
-<a name="l00201"></a>00201 
-<a name="l00202"></a>00202     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204     <span class="comment">/*</span>
-<a name="l00205"></a>00205 <span class="comment">     * Dispersion</span>
-<a name="l00206"></a>00206 <span class="comment">     */</span>
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky.dispersion"</span>,
-<a name="l00209"></a>00209                                 CPL_TYPE_DOUBLE,
-<a name="l00210"></a>00210                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00211"></a>00211                                 <span class="stringliteral">"fors.fors_align_sky"</span>,
-<a name="l00212"></a>00212                                 0.0);
-<a name="l00213"></a>00213     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00214"></a>00214     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00215"></a>00215     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217     <span class="comment">/*</span>
-<a name="l00218"></a>00218 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00219"></a>00219 <span class="comment">     */</span>
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky.startwavelength"</span>,
-<a name="l00222"></a>00222                                 CPL_TYPE_DOUBLE,
-<a name="l00223"></a>00223                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00224"></a>00224                                 <span class="stringliteral">"fors.fors_align_sky"</span>,
-<a name="l00225"></a>00225                                 0.0);
-<a name="l00226"></a>00226     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00227"></a>00227     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00228"></a>00228     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230     <span class="comment">/*</span>
-<a name="l00231"></a>00231 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00232"></a>00232 <span class="comment">     */</span>
-<a name="l00233"></a>00233 
-<a name="l00234"></a>00234     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky.endwavelength"</span>,
-<a name="l00235"></a>00235                                 CPL_TYPE_DOUBLE,
-<a name="l00236"></a>00236                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00237"></a>00237                                 <span class="stringliteral">"fors.fors_align_sky"</span>,
-<a name="l00238"></a>00238                                 0.0);
-<a name="l00239"></a>00239     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00240"></a>00240     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00241"></a>00241     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243     <span class="comment">/*</span>
-<a name="l00244"></a>00244 <span class="comment">     * Sky lines alignment</span>
-<a name="l00245"></a>00245 <span class="comment">     */</span>
-<a name="l00246"></a>00246 
-<a name="l00247"></a>00247     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky.skyalign"</span>,
-<a name="l00248"></a>00248                                 CPL_TYPE_INT,
-<a name="l00249"></a>00249                                 <span class="stringliteral">"Polynomial order for sky lines alignment"</span>,
-<a name="l00250"></a>00250                                 <span class="stringliteral">"fors.fors_align_sky"</span>,
-<a name="l00251"></a>00251                                 0);
-<a name="l00252"></a>00252     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);
-<a name="l00253"></a>00253     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00254"></a>00254     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256     <span class="comment">/*</span>
-<a name="l00257"></a>00257 <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span>
-<a name="l00258"></a>00258 <span class="comment">     */</span>
-<a name="l00259"></a>00259     
-<a name="l00260"></a>00260     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky.wcolumn"</span>,
-<a name="l00261"></a>00261                                 CPL_TYPE_STRING,
-<a name="l00262"></a>00262                                 <span class="stringliteral">"Name of sky line catalog table column "</span>
-<a name="l00263"></a>00263                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00264"></a>00264                                 <span class="stringliteral">"fors.fors_align_sky"</span>,
-<a name="l00265"></a>00265                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00266"></a>00266     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00267"></a>00267     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00268"></a>00268     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     <span class="keywordflow">return</span> 0;
-<a name="l00271"></a>00271 }
-<a name="l00272"></a>00272 
-<a name="l00273"></a>00273 
-<a name="l00282"></a>00282 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_exec(cpl_plugin *plugin)
-<a name="l00283"></a>00283 {
-<a name="l00284"></a>00284     cpl_recipe *recipe;
-<a name="l00285"></a>00285     
-<a name="l00286"></a>00286     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00287"></a>00287         recipe = (cpl_recipe *)plugin;
-<a name="l00288"></a>00288     <span class="keywordflow">else</span> 
-<a name="l00289"></a>00289         <span class="keywordflow">return</span> -1;
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291     <span class="keywordflow">return</span> fors_align_sky(recipe->parameters, recipe->frames);
-<a name="l00292"></a>00292 }
-<a name="l00293"></a>00293 
-<a name="l00294"></a>00294 
-<a name="l00303"></a>00303 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_destroy(cpl_plugin *plugin)
-<a name="l00304"></a>00304 {
-<a name="l00305"></a>00305     cpl_recipe *recipe;
-<a name="l00306"></a>00306     
-<a name="l00307"></a>00307     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00308"></a>00308         recipe = (cpl_recipe *)plugin;
-<a name="l00309"></a>00309     <span class="keywordflow">else</span> 
-<a name="l00310"></a>00310         <span class="keywordflow">return</span> -1;
-<a name="l00311"></a>00311 
-<a name="l00312"></a>00312     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00313"></a>00313 
-<a name="l00314"></a>00314     <span class="keywordflow">return</span> 0;
-<a name="l00315"></a>00315 }
-<a name="l00316"></a>00316 
-<a name="l00317"></a>00317 
-<a name="l00327"></a>00327 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky(cpl_parameterlist *parlist, 
-<a name="l00328"></a>00328                                cpl_frameset *frameset)
-<a name="l00329"></a>00329 {
-<a name="l00330"></a>00330 
-<a name="l00331"></a>00331     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_align_sky"</span>;
-<a name="l00332"></a>00332 
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="comment">/*</span>
-<a name="l00335"></a>00335 <span class="comment">     * Input parameters</span>
-<a name="l00336"></a>00336 <span class="comment">     */</span>
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338     <span class="keywordtype">double</span>      dispersion;
-<a name="l00339"></a>00339     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00340"></a>00340     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00341"></a>00341     <span class="keywordtype">int</span>         skyalign;
-<a name="l00342"></a>00342     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00343"></a>00343 
-<a name="l00344"></a>00344     <span class="comment">/*</span>
-<a name="l00345"></a>00345 <span class="comment">     * CPL objects</span>
-<a name="l00346"></a>00346 <span class="comment">     */</span>
-<a name="l00347"></a>00347 
-<a name="l00348"></a>00348     cpl_image        *rainbow     = NULL;
-<a name="l00349"></a>00349     cpl_image        *wavemap     = NULL;
-<a name="l00350"></a>00350     cpl_image        *smapped     = NULL;
-<a name="l00351"></a>00351     cpl_image        *coordinate  = NULL;
-<a name="l00352"></a>00352     cpl_table        *grism_table = NULL;
-<a name="l00353"></a>00353     cpl_table        *wavelengths = NULL;
-<a name="l00354"></a>00354     cpl_table        *slits       = NULL;
-<a name="l00355"></a>00355     cpl_table        *idscoeff    = NULL;
-<a name="l00356"></a>00356     cpl_table        *polytraces  = NULL;
-<a name="l00357"></a>00357     cpl_table        *maskslits   = NULL;
-<a name="l00358"></a>00358     cpl_table        *offsets     = NULL;
-<a name="l00359"></a>00359     cpl_vector       *lines       = NULL;
-<a name="l00360"></a>00360     cpl_propertylist *header      = NULL;
-<a name="l00361"></a>00361 
-<a name="l00362"></a>00362     <span class="comment">/*</span>
-<a name="l00363"></a>00363 <span class="comment">     * Auxiliary variables</span>
-<a name="l00364"></a>00364 <span class="comment">     */</span>
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     <span class="keywordtype">char</span>        version[80];
-<a name="l00367"></a>00367     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00368"></a>00368     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;
-<a name="l00369"></a>00369     <span class="keyword">const</span> <span class="keywordtype">char</span> *rectified_tag;
-<a name="l00370"></a>00370     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavemap_tag;
-<a name="l00371"></a>00371     <span class="keyword">const</span> <span class="keywordtype">char</span> *shifts_tag;
-<a name="l00372"></a>00372     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_ali_tag;
-<a name="l00373"></a>00373     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;
-<a name="l00374"></a>00374     <span class="keyword">const</span> <span class="keywordtype">char</span> *spatial_map_tag;
-<a name="l00375"></a>00375     <span class="keywordtype">int</span>         nframes;
-<a name="l00376"></a>00376     <span class="keywordtype">int</span>         rebin;
-<a name="l00377"></a>00377     <span class="keywordtype">int</span>         nslits;
-<a name="l00378"></a>00378     <span class="keywordtype">int</span>         nlines;
-<a name="l00379"></a>00379     <span class="keywordtype">int</span>         nx;
-<a name="l00380"></a>00380     <span class="keywordtype">int</span>         highres;
-<a name="l00381"></a>00381     <span class="keywordtype">int</span>         treat_as_lss;
-<a name="l00382"></a>00382     <span class="keywordtype">int</span>         i;
-<a name="l00383"></a>00383     <span class="keywordtype">double</span>      reference;
-<a name="l00384"></a>00384     <span class="keywordtype">double</span>     *xpos;
-<a name="l00385"></a>00385     <span class="keywordtype">double</span>      mxpos;
-<a name="l00386"></a>00386     <span class="keywordtype">double</span>     *line;
-<a name="l00387"></a>00387     <span class="keywordtype">int</span>         mxu, mos;
-<a name="l00388"></a>00388     <span class="keywordtype">int</span>         rec_scia;
-<a name="l00389"></a>00389     <span class="keywordtype">int</span>         rec_stda;
-<a name="l00390"></a>00390     <span class="keywordtype">int</span>         rec_scis;
-<a name="l00391"></a>00391     <span class="keywordtype">int</span>         rec_stds;
-<a name="l00392"></a>00392     <span class="keywordtype">int</span>         nslits_out_det = 0;
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398     cpl_msg_set_indentation(2);
-<a name="l00399"></a>00399 
-<a name="l00400"></a>00400 
-<a name="l00401"></a>00401     <span class="comment">/*</span>
-<a name="l00402"></a>00402 <span class="comment">     * Get configuration parameters</span>
-<a name="l00403"></a>00403 <span class="comment">     */</span>
-<a name="l00404"></a>00404 
-<a name="l00405"></a>00405     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00406"></a>00406     cpl_msg_indent_more();
-<a name="l00407"></a>00407     
-<a name="l00408"></a>00408     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00409"></a>00409         fors_align_sky_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); 
-<a name="l00410"></a>00410 
-<a name="l00411"></a>00411     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00412"></a>00412 
-<a name="l00413"></a>00413     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00414"></a>00414                     <span class="stringliteral">"fors.fors_align_sky.dispersion"</span>, grism_table);
-<a name="l00415"></a>00415 
-<a name="l00416"></a>00416     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00417"></a>00417         fors_align_sky_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00418"></a>00418 
-<a name="l00419"></a>00419     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00420"></a>00420                     <span class="stringliteral">"fors.fors_align_sky.startwavelength"</span>, grism_table);
-<a name="l00421"></a>00421     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00422"></a>00422         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00423"></a>00423             fors_align_sky_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00424"></a>00424 
-<a name="l00425"></a>00425     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00426"></a>00426                     <span class="stringliteral">"fors.fors_align_sky.endwavelength"</span>, grism_table);
-<a name="l00427"></a>00427     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00428"></a>00428         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00429"></a>00429             fors_align_sky_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00430"></a>00430         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00431"></a>00431             fors_align_sky_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00432"></a>00432     }
-<a name="l00433"></a>00433 
-<a name="l00434"></a>00434     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00435"></a>00435         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00436"></a>00436             fors_align_sky_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00437"></a>00437 
-<a name="l00438"></a>00438     skyalign = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00439"></a>00439                     <span class="stringliteral">"fors.fors_align_sky.skyalign"</span>, NULL);
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441     <span class="keywordflow">if</span> (skyalign < 0)
-<a name="l00442"></a>00442         fors_align_sky_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00443"></a>00443     <span class="keywordflow">if</span> (skyalign > 2)
-<a name="l00444"></a>00444         fors_align_sky_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);
-<a name="l00445"></a>00445 
-<a name="l00446"></a>00446     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist,
-<a name="l00447"></a>00447                     <span class="stringliteral">"fors.fors_align_sky.wcolumn"</span>, NULL);
-<a name="l00448"></a>00448 
-<a name="l00449"></a>00449     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00450"></a>00450 
-<a name="l00451"></a>00451     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00452"></a>00452         fors_align_sky_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);
-<a name="l00453"></a>00453 
-<a name="l00454"></a>00454 
-<a name="l00455"></a>00455     cpl_msg_indent_less();
-<a name="l00456"></a>00456     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00457"></a>00457     cpl_msg_indent_more();
-<a name="l00458"></a>00458 
-<a name="l00459"></a>00459     mxu  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SPATIAL_MAP_MXU"</span>);
-<a name="l00460"></a>00460     mos  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SPATIAL_MAP_MOS"</span>);
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     nframes = mos + mxu;
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00465"></a>00465         fors_align_sky_exit(<span class="stringliteral">"Missing input spatial map"</span>);
-<a name="l00466"></a>00466     }
-<a name="l00467"></a>00467     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00468"></a>00468         cpl_msg_error(recipe, 
-<a name="l00469"></a>00469                       <span class="stringliteral">"Too many input spatial maps (%d > 1)"</span>, nframes);
-<a name="l00470"></a>00470         fors_align_sky_exit(NULL);
-<a name="l00471"></a>00471     }
-<a name="l00472"></a>00472 
-<a name="l00473"></a>00473     <span class="keywordflow">if</span> (mxu) {
-<a name="l00474"></a>00474         rec_scia = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>);
-<a name="l00475"></a>00475         rec_stda = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>);
-<a name="l00476"></a>00476         rec_scis = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_SCI_MXU"</span>);
-<a name="l00477"></a>00477         rec_stds = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_STD_MXU"</span>);
-<a name="l00478"></a>00478     }
-<a name="l00479"></a>00479     <span class="keywordflow">else</span> {
-<a name="l00480"></a>00480         rec_scia = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>);
-<a name="l00481"></a>00481         rec_stda = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>);
-<a name="l00482"></a>00482         rec_scis = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_SCI_MOS"</span>);
-<a name="l00483"></a>00483         rec_stds = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_STD_MOS"</span>);
-<a name="l00484"></a>00484     }
-<a name="l00485"></a>00485 
-<a name="l00486"></a>00486     nframes = rec_scia + rec_stda + rec_scis + rec_stds;
-<a name="l00487"></a>00487 
-<a name="l00488"></a>00488     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00489"></a>00489         fors_align_sky_exit(<span class="stringliteral">"Missing input rectified scientific spectra"</span>);
-<a name="l00490"></a>00490     }
-<a name="l00491"></a>00491     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00492"></a>00492         cpl_msg_error(recipe,
-<a name="l00493"></a>00493                       <span class="stringliteral">"Too many input rectified scientific spectra (%d > 1)"</span>, 
-<a name="l00494"></a>00494                       nframes);
-<a name="l00495"></a>00495         fors_align_sky_exit(NULL);
-<a name="l00496"></a>00496     }
-<a name="l00497"></a>00497 
-<a name="l00498"></a>00498     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)
-<a name="l00499"></a>00499         fors_align_sky_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);
-<a name="l00500"></a>00500 
-<a name="l00501"></a>00501     <span class="keywordflow">if</span> (rec_scia) {
-<a name="l00502"></a>00502         <span class="keywordflow">if</span> (mxu) {
-<a name="l00503"></a>00503             rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>;
-<a name="l00504"></a>00504             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;
-<a name="l00505"></a>00505             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MXU"</span>;
-<a name="l00506"></a>00506             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;
-<a name="l00507"></a>00507         }
-<a name="l00508"></a>00508         <span class="keywordflow">else</span> {
-<a name="l00509"></a>00509             rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>;
-<a name="l00510"></a>00510             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;
-<a name="l00511"></a>00511             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MOS"</span>;
-<a name="l00512"></a>00512             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;
-<a name="l00513"></a>00513         }
-<a name="l00514"></a>00514     }
-<a name="l00515"></a>00515     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stda) {
-<a name="l00516"></a>00516         <span class="keywordflow">if</span> (mxu) {
-<a name="l00517"></a>00517             rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>;
-<a name="l00518"></a>00518             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;
-<a name="l00519"></a>00519             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MXU"</span>;
-<a name="l00520"></a>00520             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;
-<a name="l00521"></a>00521         }
-<a name="l00522"></a>00522         <span class="keywordflow">else</span> {
-<a name="l00523"></a>00523             rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>;
-<a name="l00524"></a>00524             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;
-<a name="l00525"></a>00525             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MOS"</span>;
-<a name="l00526"></a>00526             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;
-<a name="l00527"></a>00527         }
-<a name="l00528"></a>00528     }
-<a name="l00529"></a>00529     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_scis) {
-<a name="l00530"></a>00530         <span class="keywordflow">if</span> (mxu) {
-<a name="l00531"></a>00531             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MXU"</span>;
-<a name="l00532"></a>00532             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;
-<a name="l00533"></a>00533             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MXU"</span>;
-<a name="l00534"></a>00534             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;
-<a name="l00535"></a>00535         }
-<a name="l00536"></a>00536         <span class="keywordflow">else</span> {
-<a name="l00537"></a>00537             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MOS"</span>;
-<a name="l00538"></a>00538             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;
-<a name="l00539"></a>00539             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MOS"</span>;
-<a name="l00540"></a>00540             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;
-<a name="l00541"></a>00541         }
-<a name="l00542"></a>00542     }
-<a name="l00543"></a>00543     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stds) {
-<a name="l00544"></a>00544         <span class="keywordflow">if</span> (mxu) {
-<a name="l00545"></a>00545             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MXU"</span>;
-<a name="l00546"></a>00546             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;
-<a name="l00547"></a>00547             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MXU"</span>;
-<a name="l00548"></a>00548             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;
-<a name="l00549"></a>00549         }
-<a name="l00550"></a>00550         <span class="keywordflow">else</span> {
-<a name="l00551"></a>00551             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MOS"</span>;
-<a name="l00552"></a>00552             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;
-<a name="l00553"></a>00553             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MOS"</span>;
-<a name="l00554"></a>00554             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;
-<a name="l00555"></a>00555         }
-<a name="l00556"></a>00556     }
-<a name="l00557"></a>00557 
-<a name="l00558"></a>00558 
-<a name="l00559"></a>00559     <span class="keywordflow">if</span> (mxu) {
-<a name="l00560"></a>00560         disp_coeff_tag    = <span class="stringliteral">"DISP_COEFF_MXU"</span>;
-<a name="l00561"></a>00561         curv_coeff_tag    = <span class="stringliteral">"CURV_COEFF_MXU"</span>;
-<a name="l00562"></a>00562         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00563"></a>00563         spatial_map_tag   = <span class="stringliteral">"SPATIAL_MAP_MXU"</span>;
-<a name="l00564"></a>00564     }
-<a name="l00565"></a>00565     <span class="keywordflow">else</span> {
-<a name="l00566"></a>00566         disp_coeff_tag    = <span class="stringliteral">"DISP_COEFF_MOS"</span>;
-<a name="l00567"></a>00567         curv_coeff_tag    = <span class="stringliteral">"CURV_COEFF_MOS"</span>;
-<a name="l00568"></a>00568         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00569"></a>00569         spatial_map_tag   = <span class="stringliteral">"SPATIAL_MAP_MOS"</span>;
-<a name="l00570"></a>00570     }
-<a name="l00571"></a>00571 
-<a name="l00572"></a>00572     nframes = cpl_frameset_count_tags(frameset, disp_coeff_tag);
-<a name="l00573"></a>00573 
-<a name="l00574"></a>00574     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00575"></a>00575         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s\n"</span>, disp_coeff_tag);
-<a name="l00576"></a>00576         fors_align_sky_exit(NULL);
-<a name="l00577"></a>00577     }
-<a name="l00578"></a>00578     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00579"></a>00579         cpl_msg_error(recipe, 
-<a name="l00580"></a>00580                       <span class="stringliteral">"Too many input %s (%d > 1)"</span>, disp_coeff_tag, nframes);
-<a name="l00581"></a>00581         fors_align_sky_exit(NULL);
-<a name="l00582"></a>00582     }
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584     nframes = cpl_frameset_count_tags(frameset, curv_coeff_tag);
-<a name="l00585"></a>00585 
-<a name="l00586"></a>00586     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00587"></a>00587         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s\n"</span>, curv_coeff_tag);
-<a name="l00588"></a>00588         fors_align_sky_exit(NULL);
-<a name="l00589"></a>00589     }
-<a name="l00590"></a>00590     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00591"></a>00591         cpl_msg_error(recipe,
-<a name="l00592"></a>00592                       <span class="stringliteral">"Too many input %s (%d > 1)"</span>, curv_coeff_tag, nframes);
-<a name="l00593"></a>00593         fors_align_sky_exit(NULL);
-<a name="l00594"></a>00594     }
-<a name="l00595"></a>00595 
-<a name="l00596"></a>00596     nframes = cpl_frameset_count_tags(frameset, spatial_map_tag);
-<a name="l00597"></a>00597 
-<a name="l00598"></a>00598     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00599"></a>00599         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s\n"</span>, spatial_map_tag);
-<a name="l00600"></a>00600         fors_align_sky_exit(NULL);
-<a name="l00601"></a>00601     }
-<a name="l00602"></a>00602     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00603"></a>00603         cpl_msg_error(recipe,
-<a name="l00604"></a>00604                       <span class="stringliteral">"Too many input %s (%d > 1)"</span>, spatial_map_tag, nframes);
-<a name="l00605"></a>00605         fors_align_sky_exit(NULL);
-<a name="l00606"></a>00606     }
-<a name="l00607"></a>00607     
-<a name="l00608"></a>00608 
-<a name="l00609"></a>00609     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, spatial_map_tag, 0);
-<a name="l00610"></a>00610 
-<a name="l00611"></a>00611     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00612"></a>00612         fors_align_sky_exit(<span class="stringliteral">"Cannot load spatial map header"</span>);
-<a name="l00613"></a>00613 
-<a name="l00614"></a>00614     <span class="keywordflow">if</span> (mos)
-<a name="l00615"></a>00615         maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00616"></a>00616     <span class="keywordflow">else</span>
-<a name="l00617"></a>00617         maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00618"></a>00618 
-<a name="l00619"></a>00619     <span class="comment">/*</span>
-<a name="l00620"></a>00620 <span class="comment">     * Check if all slits have the same X offset: in such case, abort!</span>
-<a name="l00621"></a>00621 <span class="comment">     */</span>
-<a name="l00622"></a>00622 
-<a name="l00623"></a>00623     treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l00624"></a>00624 
-<a name="l00625"></a>00625     cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00626"></a>00626 
-<a name="l00627"></a>00627     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00628"></a>00628         cpl_msg_error(recipe, <span class="stringliteral">"All slits have the same offset: %.2f mm\n"</span>
-<a name="l00629"></a>00629                       <span class="stringliteral">"The LSS data reduction strategy must be applied. "</span>
-<a name="l00630"></a>00630                       <span class="stringliteral">"Please use recipe fors_align_sky_lss."</span>, mxpos);
-<a name="l00631"></a>00631         fors_align_sky_exit(NULL);
-<a name="l00632"></a>00632     }
-<a name="l00633"></a>00633 
-<a name="l00634"></a>00634     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00635"></a>00635         fors_align_sky_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00636"></a>00636 
-<a name="l00637"></a>00637     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00638"></a>00638         fors_align_sky_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00639"></a>00639 
-<a name="l00640"></a>00640     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00641"></a>00641         fors_align_sky_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00642"></a>00642 
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644     <span class="comment">/*</span>
-<a name="l00645"></a>00645 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00646"></a>00646 <span class="comment">     * dispersion direction from the reference frame</span>
-<a name="l00647"></a>00647 <span class="comment">     */</span>
-<a name="l00648"></a>00648 
-<a name="l00649"></a>00649     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00650"></a>00650     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00651"></a>00651         fors_align_sky_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span>
-<a name="l00652"></a>00652                             <span class="stringliteral">"header"</span>);
-<a name="l00653"></a>00653 
-<a name="l00654"></a>00654     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00655"></a>00655         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00656"></a>00656     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00657"></a>00657         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00658"></a>00658 
-<a name="l00659"></a>00659     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00660"></a>00660 
-<a name="l00661"></a>00661     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00662"></a>00662         fors_align_sky_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span>
-<a name="l00663"></a>00663                             <span class="stringliteral">"in reference frame header"</span>);
-<a name="l00664"></a>00664 
-<a name="l00665"></a>00665     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l00666"></a>00666         reference *= 10;
-<a name="l00667"></a>00667 
-<a name="l00668"></a>00668     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l00669"></a>00669         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l00670"></a>00670                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in reference frame header"</span>,
-<a name="l00671"></a>00671                       reference);
-<a name="l00672"></a>00672         fors_align_sky_exit(NULL);
-<a name="l00673"></a>00673     }
-<a name="l00674"></a>00674 
-<a name="l00675"></a>00675     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l00676"></a>00676 
-<a name="l00677"></a>00677     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00678"></a>00678 
-<a name="l00679"></a>00679     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00680"></a>00680         fors_align_sky_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00681"></a>00681                             <span class="stringliteral">"in reference frame header"</span>);
-<a name="l00682"></a>00682 
-<a name="l00683"></a>00683     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l00684"></a>00684         dispersion *= rebin;
-<a name="l00685"></a>00685         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l00686"></a>00686                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,
-<a name="l00687"></a>00687                         dispersion);
-<a name="l00688"></a>00688     }
-<a name="l00689"></a>00689 
-<a name="l00690"></a>00690     cpl_msg_indent_less();
-<a name="l00691"></a>00691     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);
-<a name="l00692"></a>00692     cpl_msg_indent_more();
-<a name="l00693"></a>00693 
-<a name="l00694"></a>00694     coordinate = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, spatial_map_tag, 
-<a name="l00695"></a>00695                                 CPL_TYPE_FLOAT, 0, 0);
-<a name="l00696"></a>00696     <span class="keywordflow">if</span> (coordinate == NULL)
-<a name="l00697"></a>00697         fors_align_sky_exit(<span class="stringliteral">"Cannot load input reference frame"</span>);
-<a name="l00698"></a>00698 
-<a name="l00699"></a>00699     slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l00700"></a>00700     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00701"></a>00701         fors_align_sky_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l00702"></a>00702 
-<a name="l00703"></a>00703     polytraces = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, curv_coeff_tag, 1);
-<a name="l00704"></a>00704     <span class="keywordflow">if</span> (polytraces == NULL)
-<a name="l00705"></a>00705         fors_align_sky_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);
-<a name="l00706"></a>00706 
-<a name="l00707"></a>00707     idscoeff = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, disp_coeff_tag, 1);
-<a name="l00708"></a>00708     <span class="keywordflow">if</span> (idscoeff == NULL)
-<a name="l00709"></a>00709         fors_align_sky_exit(<span class="stringliteral">"Cannot load dispersion solution"</span>);
-<a name="l00710"></a>00710 
-<a name="l00711"></a>00711     smapped = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, rectified_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00712"></a>00712     <span class="keywordflow">if</span> (smapped == NULL)
-<a name="l00713"></a>00713         fors_align_sky_exit(<span class="stringliteral">"Cannot load input rectified frame"</span>);
-<a name="l00714"></a>00714 
-<a name="l00715"></a>00715     wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);
-<a name="l00716"></a>00716 
-<a name="l00717"></a>00717     <span class="keywordflow">if</span> (wavelengths) {
-<a name="l00718"></a>00718 
-<a name="l00719"></a>00719         <span class="comment">/*</span>
-<a name="l00720"></a>00720 <span class="comment">         * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l00721"></a>00721 <span class="comment">         */</span>
-<a name="l00722"></a>00722 
-<a name="l00723"></a>00723         nlines = cpl_table_get_nrow(wavelengths);
-<a name="l00724"></a>00724 
-<a name="l00725"></a>00725         <span class="keywordflow">if</span> (nlines == 0)
-<a name="l00726"></a>00726             fors_align_sky_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);
-<a name="l00727"></a>00727 
-<a name="l00728"></a>00728         <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l00729"></a>00729             cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span>
-<a name="l00730"></a>00730                           <span class="stringliteral">"catalog table"</span>, wcolumn);
-<a name="l00731"></a>00731             fors_align_sky_exit(NULL);
-<a name="l00732"></a>00732         }
-<a name="l00733"></a>00733 
-<a name="l00734"></a>00734         line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00735"></a>00735 
-<a name="l00736"></a>00736         <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l00737"></a>00737             line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l00738"></a>00738 
-<a name="l00739"></a>00739         cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l00740"></a>00740 
-<a name="l00741"></a>00741         lines = cpl_vector_wrap(nlines, line);
-<a name="l00742"></a>00742     }
-<a name="l00743"></a>00743     <span class="keywordflow">else</span> {
-<a name="l00744"></a>00744         cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);
-<a name="l00745"></a>00745     }
-<a name="l00746"></a>00746 
-<a name="l00747"></a>00747     <span class="keywordflow">if</span> (skyalign) {
-<a name="l00748"></a>00748         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l00749"></a>00749         <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);
-<a name="l00750"></a>00750     }
-<a name="l00751"></a>00751     <span class="keywordflow">else</span> {
-<a name="l00752"></a>00752         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l00753"></a>00753         <span class="stringliteral">"skylines applying median offset..."</span>);
-<a name="l00754"></a>00754     }
-<a name="l00755"></a>00755 
-<a name="l00756"></a>00756     <span class="keywordflow">if</span> (dispersion > 1.0)
-<a name="l00757"></a>00757         highres = 0;
-<a name="l00758"></a>00758     <span class="keywordflow">else</span>
-<a name="l00759"></a>00759         highres = 1;
-<a name="l00760"></a>00760 
-<a name="l00761"></a>00761     nx = cpl_image_get_size_x(coordinate);
-<a name="l00762"></a>00762 
-<a name="l00763"></a>00763     rainbow = <a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength,
-<a name="l00764"></a>00764                                endwavelength);
-<a name="l00765"></a>00765 
-<a name="l00766"></a>00766     offsets = <a class="code" href="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3">mos_wavelength_align</a>(smapped, slits, reference,
-<a name="l00767"></a>00767                                    startwavelength, endwavelength,
-<a name="l00768"></a>00768                                    idscoeff, lines, highres, skyalign,
-<a name="l00769"></a>00769                                    rainbow, 4);
-<a name="l00770"></a>00770 
-<a name="l00771"></a>00771     cpl_vector_delete(lines); lines = NULL;
-<a name="l00772"></a>00772     cpl_image_delete(smapped); smapped = NULL;
-<a name="l00773"></a>00773 
-<a name="l00774"></a>00774     <span class="keywordflow">if</span> (offsets) {
-<a name="l00775"></a>00775         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, offsets, shifts_tag, NULL,
-<a name="l00776"></a>00776                            parlist, recipe, version))
-<a name="l00777"></a>00777             fors_align_sky_exit(NULL);
-<a name="l00778"></a>00778 
-<a name="l00779"></a>00779         cpl_table_delete(offsets); offsets = NULL;
-<a name="l00780"></a>00780     }
-<a name="l00781"></a>00781     <span class="keywordflow">else</span>
-<a name="l00782"></a>00782         fors_align_sky_exit(<span class="stringliteral">"Alignment of the wavelength solution "</span>
-<a name="l00783"></a>00783                         <span class="stringliteral">"to reference sky lines could not be done!"</span>);
-<a name="l00784"></a>00784 
-<a name="l00785"></a>00785     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_ali_tag, NULL,
-<a name="l00786"></a>00786                        parlist, recipe, version))
-<a name="l00787"></a>00787         fors_align_sky_exit(NULL);
-<a name="l00788"></a>00788 
-<a name="l00789"></a>00789     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l00790"></a>00790 
-<a name="l00791"></a>00791     wavemap = <a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(coordinate, rainbow, slits,
-<a name="l00792"></a>00792                                   polytraces, reference,
-<a name="l00793"></a>00793                                   startwavelength, endwavelength,
-<a name="l00794"></a>00794                                   dispersion);
-<a name="l00795"></a>00795 
-<a name="l00796"></a>00796     cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l00797"></a>00797     cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l00798"></a>00798     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l00799"></a>00799     cpl_table_delete(slits); slits = NULL;
-<a name="l00800"></a>00800 
-<a name="l00801"></a>00801     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, wavemap, wavemap_tag,
-<a name="l00802"></a>00802                        header, parlist, recipe, version))
-<a name="l00803"></a>00803         fors_align_sky_exit(NULL);
-<a name="l00804"></a>00804 
-<a name="l00805"></a>00805     cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l00806"></a>00806     cpl_propertylist_delete(header); header = NULL;
-<a name="l00807"></a>00807 
-<a name="l00808"></a>00808     <span class="keywordflow">return</span> 0;
-<a name="l00809"></a>00809 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__align__sky_8c_source.html b/html/fors__align__sky_8c_source.html
new file mode 100644
index 0000000..d8f1e1e
--- /dev/null
+++ b/html/fors__align__sky_8c_source.html
@@ -0,0 +1,822 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_align_sky.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_align_sky.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_align_sky.c,v 1.8 2013-08-14 16:07:47 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-14 16:07:47 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_align_sky_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to align the wavelength solution based on the arc\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"lamp exposure on a set of sky lines observed on a scientific exposure.\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"The input rectified frames are produced by the recipe fors_extract_slits.\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"An input catalog of sky lines can be specified, otherwise an internal one\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"is used.\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"This recipe should be applied to multi-slit MOS/MXU data: for LSS or\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"long-slit like data (MOS/MXU with all slits at the same offset) use recipe\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"fors_align_sky_lss instead. Please refer to the FORS Pipeline User's Manual\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"for more details.\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS, and\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"SCI as STD.\n\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  RECTIFIED_ALL_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  or RECTIFIED_SKY_SCI_MXU   Calib       Frame with sky lines    Y\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"  SPATIAL_MAP_MXU            Calib       Spatial coordinate map  Y\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      Y\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location on CCD    Y\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  DISP_COEFF_MXU             Calib       Dispersion solution     Y\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  MASTER_SKYLINECAT          Calib       Catalog of sky lines    .\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  SKY_SHIFTS_SLIT_SCI_MXU    FITS table  Observed sky lines offsets\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  WAVELENGTH_MAP_SCI_MXU     FITS image  Wavelength mapped on CCD\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"  DISP_COEFF_SCI_MXU         FITS image  Upgraded dispersion solution\n\n"</span>;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">#define fors_align_sky_exit(message)          \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_image_delete(smapped);                    \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_table_delete(offsets);                    \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">#define fors_align_sky_exit_memcheck(message)   \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);         \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">cpl_image_delete(wavemap);                      \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);   \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">cpl_image_delete(coordinate);                   \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);         \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">cpl_image_delete(rainbow);                      \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">printf("free smapped (%p)\n", smapped);         \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">cpl_image_delete(smapped);                      \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">cpl_table_delete(grism_table);                  \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">cpl_table_delete(maskslits);                    \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths); \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">cpl_table_delete(wavelengths);                  \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">printf("free offsets (%p)\n", offsets);         \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">cpl_table_delete(offsets);                      \</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);       \</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">cpl_table_delete(idscoeff);                     \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">cpl_table_delete(slits);                        \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">cpl_table_delete(polytraces);                   \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">printf("free lines (%p)\n", lines);             \</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor">cpl_vector_delete(lines);                       \</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> {</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                     <span class="stringliteral">"fors_align_sky"</span>,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                     <span class="stringliteral">"Upgrade wavelength solution using sky lines"</span>,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                     fors_align_sky_description,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>                     fors_align_sky_create,</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                     fors_align_sky_exec,</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                     fors_align_sky_destroy);</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> </div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> }</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> {</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky.dispersion"</span>,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                                 <span class="stringliteral">"fors.fors_align_sky"</span>,</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>                                 0.0);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky.startwavelength"</span>,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                                 <span class="stringliteral">"fors.fors_align_sky"</span>,</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                                 0.0);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> </div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky.endwavelength"</span>,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>                                 <span class="stringliteral">"fors.fors_align_sky"</span>,</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>                                 0.0);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="comment">     * Sky lines alignment</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> </div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky.skyalign"</span>,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>                                 <span class="stringliteral">"Polynomial order for sky lines alignment"</span>,</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>                                 <span class="stringliteral">"fors.fors_align_sky"</span>,</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>                                 0);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky.wcolumn"</span>,</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                                 <span class="stringliteral">"Name of sky line catalog table column "</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                                 <span class="stringliteral">"fors.fors_align_sky"</span>,</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> }</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> {</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     <span class="keywordflow">return</span> fors_align_sky(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> }</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> </div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> {</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> </div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> </div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> }</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> </div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> {</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> </div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_align_sky"</span>;</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> </div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordtype">int</span>         skyalign;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> </div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     cpl_image        *rainbow     = NULL;</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     cpl_image        *wavemap     = NULL;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     cpl_image        *smapped     = NULL;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     cpl_image        *coordinate  = NULL;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     cpl_table        *wavelengths = NULL;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     cpl_table        *idscoeff    = NULL;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     cpl_table        *polytraces  = NULL;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     cpl_table        *maskslits   = NULL;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     cpl_table        *offsets     = NULL;</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     cpl_vector       *lines       = NULL;</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *rectified_tag;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavemap_tag;</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *shifts_tag;</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_ali_tag;</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *spatial_map_tag;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     <span class="keywordtype">int</span>         nframes;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordtype">int</span>         nlines;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordtype">int</span>         nx;</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="keywordtype">int</span>         highres;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     <span class="keywordtype">int</span>         treat_as_lss;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="keywordtype">double</span>     *line;</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <span class="keywordtype">int</span>         mxu, mos;</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keywordtype">int</span>         rec_scia;</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     <span class="keywordtype">int</span>         rec_stda;</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="keywordtype">int</span>         rec_scis;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     <span class="keywordtype">int</span>         rec_stds;</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     <span class="keywordtype">int</span>         nslits_out_det = 0;</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> </div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> </div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         fors_align_sky_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); </div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span> </div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> </div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>                     <span class="stringliteral">"fors.fors_align_sky.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> </div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>         fors_align_sky_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>                     <span class="stringliteral">"fors.fors_align_sky.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>             fors_align_sky_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>                     <span class="stringliteral">"fors.fors_align_sky.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>             fors_align_sky_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>             fors_align_sky_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     }</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> </div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>             fors_align_sky_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     skyalign = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                     <span class="stringliteral">"fors.fors_align_sky.skyalign"</span>, NULL);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <span class="keywordflow">if</span> (skyalign < 0)</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>         fors_align_sky_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordflow">if</span> (skyalign > 2)</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         fors_align_sky_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist,</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>                     <span class="stringliteral">"fors.fors_align_sky.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> </div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> </div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         fors_align_sky_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> </div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> </div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     mxu  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SPATIAL_MAP_MXU"</span>);</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     mos  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SPATIAL_MAP_MOS"</span>);</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     nframes = mos + mxu;</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         fors_align_sky_exit(<span class="stringliteral">"Missing input spatial map"</span>);</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     }</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         cpl_msg_error(recipe, </div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>                       <span class="stringliteral">"Too many input spatial maps (%d > 1)"</span>, nframes);</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     }</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         rec_scia = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         rec_stda = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>         rec_scis = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>         rec_stds = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_STD_MXU"</span>);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     }</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         rec_scia = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         rec_stda = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>         rec_scis = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>         rec_stds = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_STD_MOS"</span>);</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     }</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> </div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     nframes = rec_scia + rec_stda + rec_scis + rec_stds;</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span> </div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         fors_align_sky_exit(<span class="stringliteral">"Missing input rectified scientific spectra"</span>);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     }</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>         cpl_msg_error(recipe,</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>                       <span class="stringliteral">"Too many input rectified scientific spectra (%d > 1)"</span>, </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>                       nframes);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     }</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> </div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>         fors_align_sky_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span> </div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     <span class="keywordflow">if</span> (rec_scia) {</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         }</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>         }</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     }</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stda) {</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>;</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MXU"</span>;</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>         }</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>;</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MOS"</span>;</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>         }</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     }</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_scis) {</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>         }</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>         }</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     }</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stds) {</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MXU"</span>;</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         }</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MOS"</span>;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>         }</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     }</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span> </div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>         disp_coeff_tag    = <span class="stringliteral">"DISP_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         curv_coeff_tag    = <span class="stringliteral">"CURV_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>         spatial_map_tag   = <span class="stringliteral">"SPATIAL_MAP_MXU"</span>;</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     }</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         disp_coeff_tag    = <span class="stringliteral">"DISP_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>         curv_coeff_tag    = <span class="stringliteral">"CURV_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>         spatial_map_tag   = <span class="stringliteral">"SPATIAL_MAP_MOS"</span>;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     }</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span> </div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     nframes = cpl_frameset_count_tags(frameset, disp_coeff_tag);</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> </div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s\n"</span>, disp_coeff_tag);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     }</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         cpl_msg_error(recipe, </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>                       <span class="stringliteral">"Too many input %s (%d > 1)"</span>, disp_coeff_tag, nframes);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     }</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span> </div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>     nframes = cpl_frameset_count_tags(frameset, curv_coeff_tag);</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s\n"</span>, curv_coeff_tag);</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     }</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>         cpl_msg_error(recipe,</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>                       <span class="stringliteral">"Too many input %s (%d > 1)"</span>, curv_coeff_tag, nframes);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     }</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span> </div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     nframes = cpl_frameset_count_tags(frameset, spatial_map_tag);</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> </div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s\n"</span>, spatial_map_tag);</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     }</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>         cpl_msg_error(recipe,</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>                       <span class="stringliteral">"Too many input %s (%d > 1)"</span>, spatial_map_tag, nframes);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     }</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     </div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, spatial_map_tag, 0);</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> </div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         fors_align_sky_exit(<span class="stringliteral">"Cannot load spatial map header"</span>);</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span> </div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>         maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span> </div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span> <span class="comment">     * Check if all slits have the same X offset: in such case, abort!</span></div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span> </div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span> </div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>         cpl_msg_error(recipe, <span class="stringliteral">"All slits have the same offset: %.2f mm\n"</span></div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>                       <span class="stringliteral">"The LSS data reduction strategy must be applied. "</span></div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>                       <span class="stringliteral">"Please use recipe fors_align_sky_lss."</span>, mxpos);</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     }</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span> </div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>         fors_align_sky_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span> </div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>         fors_align_sky_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> </div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>         fors_align_sky_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> </div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> <span class="comment">     * dispersion direction from the reference frame</span></div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> </div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>         fors_align_sky_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span></div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>                             <span class="stringliteral">"header"</span>);</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span> </div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> </div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>         fors_align_sky_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span></div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>                             <span class="stringliteral">"in reference frame header"</span>);</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span> </div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>         reference *= 10;</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span> </div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in reference frame header"</span>,</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>                       reference);</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     }</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span> </div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> </div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>         fors_align_sky_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>                             <span class="stringliteral">"in reference frame header"</span>);</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span> </div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>                         dispersion);</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     }</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span> </div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span> </div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     coordinate = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, spatial_map_tag, </div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>                                 CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     <span class="keywordflow">if</span> (coordinate == NULL)</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>         fors_align_sky_exit(<span class="stringliteral">"Cannot load input reference frame"</span>);</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> </div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>         fors_align_sky_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span> </div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>     polytraces = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, curv_coeff_tag, 1);</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     <span class="keywordflow">if</span> (polytraces == NULL)</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>         fors_align_sky_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> </div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     idscoeff = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, disp_coeff_tag, 1);</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>     <span class="keywordflow">if</span> (idscoeff == NULL)</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>         fors_align_sky_exit(<span class="stringliteral">"Cannot load dispersion solution"</span>);</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> </div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     smapped = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, rectified_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     <span class="keywordflow">if</span> (smapped == NULL)</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>         fors_align_sky_exit(<span class="stringliteral">"Cannot load input rectified frame"</span>);</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span> </div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> </div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     <span class="keywordflow">if</span> (wavelengths) {</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span> </div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span> <span class="comment">         * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span> </div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>         nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span> </div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>         <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>             fors_align_sky_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span> </div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>         <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span></div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>                           <span class="stringliteral">"catalog table"</span>, wcolumn);</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>             fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>         }</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span> </div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>         line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span> </div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>         <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>             line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span> </div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>         cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span> </div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>         lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     }</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>         cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     }</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> </div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     <span class="keywordflow">if</span> (skyalign) {</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>         <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     }</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>         <span class="stringliteral">"skylines applying median offset..."</span>);</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     }</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span> </div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     <span class="keywordflow">if</span> (dispersion > 1.0)</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>         highres = 0;</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>         highres = 1;</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span> </div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     nx = cpl_image_get_size_x(coordinate);</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span> </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>     rainbow = <a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength,</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>                                endwavelength);</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> </div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     offsets = <a class="code" href="group__moses.html#ga634eb7408671a139e7015185776f4513" title="Modify the input wavelength solution to match reference sky lines.">mos_wavelength_align</a>(smapped, slits, reference,</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>                                    startwavelength, endwavelength,</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>                                    idscoeff, lines, highres, skyalign,</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>                                    rainbow, 4);</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span> </div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span> </div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>     <span class="keywordflow">if</span> (offsets) {</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, offsets, shifts_tag, NULL,</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>             fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span> </div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>         cpl_table_delete(offsets); offsets = NULL;</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     }</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>         fors_align_sky_exit(<span class="stringliteral">"Alignment of the wavelength solution "</span></div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>                         <span class="stringliteral">"to reference sky lines could not be done!"</span>);</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> </div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, idscoeff, disp_ali_tag, NULL,</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> </div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span> </div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     wavemap = <a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(coordinate, rainbow, slits,</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>                                   polytraces, reference,</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>                                   startwavelength, endwavelength,</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>                                   dispersion);</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span> </div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>     cpl_image_delete(rainbow); rainbow = NULL;</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>     cpl_image_delete(coordinate); coordinate = NULL;</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span> </div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, wavemap, wavemap_tag,</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>                        header, parlist, recipe, version))</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>         fors_align_sky_exit(NULL);</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span> </div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span> </div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__align__sky__lss_8c-source.html b/html/fors__align__sky__lss_8c-source.html
deleted file mode 100644
index 7cbea10..0000000
--- a/html/fors__align__sky__lss_8c-source.html
+++ /dev/null
@@ -1,795 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_align_sky_lss.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_align_sky_lss.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_align_sky_lss.c,v 1.7 2013/04/24 14:15:36 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:15:36 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_align_sky_lss_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to align the wavelength solution based on the arc\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"lamp exposure on a set of sky lines observed on a scientific exposure.\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"The input scientific frames are produced by the recipes fors_remove_bias\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"and fors_flatfield. An input catalog of sky lines can be specified, or\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"an internal one is used.\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"This recipe should be applied to LSS or long-slit like data (MOS/MXU with\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"all slits at the same offset). For multi-slit MOS/MXU data use recipe\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"fors_align_sky instead. Please refer to the FORS PIpeline User's Manual\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"for more details.\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"LSS, and SCI as STD.\n\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  SCIENCE_UNBIAS_MXU\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  or SCIENCE_UNFLAT_MXU\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"  or STANDARD_UNBIAS_MXU\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"  or STANDARD_UNFLAT_MXU     Calib       Frame with sky lines    Y\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"  DISP_COEFF_MXU             Calib       Dispersion solution     Y\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location on CCD    Y\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  MASTER_SKYLINECAT          Calib       Catalog of sky lines    .\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  SKY_SHIFTS_LONG_SCI_MXU    FITS table  Observed sky lines offsets\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  WAVELENGTH_MAP_SCI_MXU     FITS image  Wavelength mapped on CCD\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"  DISP_COEFF_SCI_MXU         FITS image  Upgraded dispersion solution\n\n"</span>;
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 <span class="preprocessor">#define fors_align_sky_lss_exit(message)          \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">{                                             \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">cpl_image_delete(smapped);                    \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">cpl_table_delete(offsets);                    \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">}</span>
-<a name="l00089"></a>00089 <span class="preprocessor"></span>
-<a name="l00090"></a>00090 <span class="preprocessor">#define fors_align_sky_lss_exit_memcheck(message)   \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">{                                               \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);         \</span>
-<a name="l00094"></a>00094 <span class="preprocessor">cpl_image_delete(wavemap);                      \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);         \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">cpl_image_delete(rainbow);                      \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">printf("free smapped (%p)\n", smapped);         \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">cpl_image_delete(smapped);                      \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">cpl_table_delete(grism_table);                  \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">cpl_table_delete(maskslits);                    \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths); \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">cpl_table_delete(wavelengths);                  \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">printf("free offsets (%p)\n", offsets);         \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">cpl_table_delete(offsets);                      \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);       \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">cpl_table_delete(idscoeff);                     \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">cpl_table_delete(slits);                        \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">printf("free lines (%p)\n", lines);             \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">cpl_vector_delete(lines);                       \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">}</span>
-<a name="l00118"></a>00118 <span class="preprocessor"></span>
-<a name="l00119"></a>00119 
-<a name="l00131"></a>00131 <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00132"></a>00132 {
-<a name="l00133"></a>00133     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00134"></a>00134     cpl_plugin *plugin = &recipe->interface;
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     cpl_plugin_init(plugin,
-<a name="l00137"></a>00137                     CPL_PLUGIN_API,
-<a name="l00138"></a>00138                     FORS_BINARY_VERSION,
-<a name="l00139"></a>00139                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00140"></a>00140                     <span class="stringliteral">"fors_align_sky_lss"</span>,
-<a name="l00141"></a>00141                     <span class="stringliteral">"Upgrade wavelength solution using sky lines"</span>,
-<a name="l00142"></a>00142                     fors_align_sky_lss_description,
-<a name="l00143"></a>00143                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00144"></a>00144                     PACKAGE_BUGREPORT,
-<a name="l00145"></a>00145     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00146"></a>00146     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00147"></a>00147     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00148"></a>00148     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00149"></a>00149     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00150"></a>00150     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00151"></a>00151     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00152"></a>00152     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00153"></a>00153     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00154"></a>00154     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00155"></a>00155     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00156"></a>00156     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00157"></a>00157     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00158"></a>00158                     fors_align_sky_lss_create,
-<a name="l00159"></a>00159                     fors_align_sky_lss_exec,
-<a name="l00160"></a>00160                     fors_align_sky_lss_destroy);
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162     cpl_pluginlist_append(list, plugin);
-<a name="l00163"></a>00163     
-<a name="l00164"></a>00164     <span class="keywordflow">return</span> 0;
-<a name="l00165"></a>00165 }
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167 
-<a name="l00178"></a>00178 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_create(cpl_plugin *plugin)
-<a name="l00179"></a>00179 {
-<a name="l00180"></a>00180     cpl_recipe    *recipe;
-<a name="l00181"></a>00181     cpl_parameter *p;
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183     <span class="comment">/* </span>
-<a name="l00184"></a>00184 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00185"></a>00185 <span class="comment">     */</span>
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00188"></a>00188         recipe = (cpl_recipe *)plugin;
-<a name="l00189"></a>00189     <span class="keywordflow">else</span> 
-<a name="l00190"></a>00190         <span class="keywordflow">return</span> -1;
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <span class="comment">/* </span>
-<a name="l00193"></a>00193 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00194"></a>00194 <span class="comment">     */</span>
-<a name="l00195"></a>00195 
-<a name="l00196"></a>00196     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198     <span class="comment">/*</span>
-<a name="l00199"></a>00199 <span class="comment">     * Dispersion</span>
-<a name="l00200"></a>00200 <span class="comment">     */</span>
-<a name="l00201"></a>00201 
-<a name="l00202"></a>00202     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky_lss.dispersion"</span>,
-<a name="l00203"></a>00203                                 CPL_TYPE_DOUBLE,
-<a name="l00204"></a>00204                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00205"></a>00205                                 <span class="stringliteral">"fors.fors_align_sky_lss"</span>,
-<a name="l00206"></a>00206                                 0.0);
-<a name="l00207"></a>00207     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00208"></a>00208     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00209"></a>00209     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211     <span class="comment">/*</span>
-<a name="l00212"></a>00212 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00213"></a>00213 <span class="comment">     */</span>
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky_lss.startwavelength"</span>,
-<a name="l00216"></a>00216                                 CPL_TYPE_DOUBLE,
-<a name="l00217"></a>00217                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00218"></a>00218                                 <span class="stringliteral">"fors.fors_align_sky_lss"</span>,
-<a name="l00219"></a>00219                                 0.0);
-<a name="l00220"></a>00220     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00221"></a>00221     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00222"></a>00222     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224     <span class="comment">/*</span>
-<a name="l00225"></a>00225 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00226"></a>00226 <span class="comment">     */</span>
-<a name="l00227"></a>00227 
-<a name="l00228"></a>00228     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky_lss.endwavelength"</span>,
-<a name="l00229"></a>00229                                 CPL_TYPE_DOUBLE,
-<a name="l00230"></a>00230                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00231"></a>00231                                 <span class="stringliteral">"fors.fors_align_sky_lss"</span>,
-<a name="l00232"></a>00232                                 0.0);
-<a name="l00233"></a>00233     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00234"></a>00234     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00235"></a>00235     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00236"></a>00236 
-<a name="l00237"></a>00237     <span class="comment">/*</span>
-<a name="l00238"></a>00238 <span class="comment">     * Sky lines alignment</span>
-<a name="l00239"></a>00239 <span class="comment">     */</span>
-<a name="l00240"></a>00240 
-<a name="l00241"></a>00241     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky_lss.skyalign"</span>,
-<a name="l00242"></a>00242                                 CPL_TYPE_INT,
-<a name="l00243"></a>00243                                 <span class="stringliteral">"Polynomial order for sky lines alignment"</span>,
-<a name="l00244"></a>00244                                 <span class="stringliteral">"fors.fors_align_sky_lss"</span>,
-<a name="l00245"></a>00245                                 0);
-<a name="l00246"></a>00246     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);
-<a name="l00247"></a>00247     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00248"></a>00248     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250     <span class="comment">/*</span>
-<a name="l00251"></a>00251 <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span>
-<a name="l00252"></a>00252 <span class="comment">     */</span>
-<a name="l00253"></a>00253     
-<a name="l00254"></a>00254     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky_lss.wcolumn"</span>,
-<a name="l00255"></a>00255                                 CPL_TYPE_STRING,
-<a name="l00256"></a>00256                                 <span class="stringliteral">"Name of sky line catalog table column "</span>
-<a name="l00257"></a>00257                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00258"></a>00258                                 <span class="stringliteral">"fors.fors_align_sky_lss"</span>,
-<a name="l00259"></a>00259                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00260"></a>00260     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00261"></a>00261     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00262"></a>00262     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00263"></a>00263 
-<a name="l00264"></a>00264     <span class="keywordflow">return</span> 0;
-<a name="l00265"></a>00265 }
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267 
-<a name="l00276"></a>00276 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_exec(cpl_plugin *plugin)
-<a name="l00277"></a>00277 {
-<a name="l00278"></a>00278     cpl_recipe *recipe;
-<a name="l00279"></a>00279     
-<a name="l00280"></a>00280     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00281"></a>00281         recipe = (cpl_recipe *)plugin;
-<a name="l00282"></a>00282     <span class="keywordflow">else</span> 
-<a name="l00283"></a>00283         <span class="keywordflow">return</span> -1;
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285     <span class="keywordflow">return</span> fors_align_sky_lss(recipe->parameters, recipe->frames);
-<a name="l00286"></a>00286 }
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288 
-<a name="l00297"></a>00297 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_destroy(cpl_plugin *plugin)
-<a name="l00298"></a>00298 {
-<a name="l00299"></a>00299     cpl_recipe *recipe;
-<a name="l00300"></a>00300     
-<a name="l00301"></a>00301     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00302"></a>00302         recipe = (cpl_recipe *)plugin;
-<a name="l00303"></a>00303     <span class="keywordflow">else</span> 
-<a name="l00304"></a>00304         <span class="keywordflow">return</span> -1;
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308     <span class="keywordflow">return</span> 0;
-<a name="l00309"></a>00309 }
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311 
-<a name="l00321"></a>00321 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss(cpl_parameterlist *parlist, 
-<a name="l00322"></a>00322                                cpl_frameset *frameset)
-<a name="l00323"></a>00323 {
-<a name="l00324"></a>00324 
-<a name="l00325"></a>00325     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_align_sky_lss"</span>;
-<a name="l00326"></a>00326 
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328     <span class="comment">/*</span>
-<a name="l00329"></a>00329 <span class="comment">     * Input parameters</span>
-<a name="l00330"></a>00330 <span class="comment">     */</span>
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     <span class="keywordtype">double</span>      dispersion;
-<a name="l00333"></a>00333     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00334"></a>00334     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00335"></a>00335     <span class="keywordtype">int</span>         skyalign;
-<a name="l00336"></a>00336     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338     <span class="comment">/*</span>
-<a name="l00339"></a>00339 <span class="comment">     * CPL objects</span>
-<a name="l00340"></a>00340 <span class="comment">     */</span>
-<a name="l00341"></a>00341 
-<a name="l00342"></a>00342     cpl_image        *rainbow     = NULL;
-<a name="l00343"></a>00343     cpl_image        *wavemap     = NULL;
-<a name="l00344"></a>00344     cpl_image        *smapped     = NULL;
-<a name="l00345"></a>00345     cpl_image        *dummy       = NULL;
-<a name="l00346"></a>00346     cpl_table        *grism_table = NULL;
-<a name="l00347"></a>00347     cpl_table        *wavelengths = NULL;
-<a name="l00348"></a>00348     cpl_table        *slits       = NULL;
-<a name="l00349"></a>00349     cpl_table        *idscoeff    = NULL;
-<a name="l00350"></a>00350     cpl_table        *maskslits   = NULL;
-<a name="l00351"></a>00351     cpl_table        *offsets     = NULL;
-<a name="l00352"></a>00352     cpl_vector       *lines       = NULL;
-<a name="l00353"></a>00353     cpl_propertylist *header      = NULL;
-<a name="l00354"></a>00354 
-<a name="l00355"></a>00355     <span class="comment">/*</span>
-<a name="l00356"></a>00356 <span class="comment">     * Auxiliary variables</span>
-<a name="l00357"></a>00357 <span class="comment">     */</span>
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     <span class="keywordtype">char</span>        version[80];
-<a name="l00360"></a>00360     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00361"></a>00361     <span class="keyword">const</span> <span class="keywordtype">char</span> *rectified_tag;
-<a name="l00362"></a>00362     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavemap_tag;
-<a name="l00363"></a>00363     <span class="keyword">const</span> <span class="keywordtype">char</span> *shifts_tag;
-<a name="l00364"></a>00364     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_ali_tag;
-<a name="l00365"></a>00365     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;
-<a name="l00366"></a>00366     <span class="keywordtype">int</span>         nframes;
-<a name="l00367"></a>00367     <span class="keywordtype">int</span>         rebin;
-<a name="l00368"></a>00368     <span class="keywordtype">int</span>         nslits;
-<a name="l00369"></a>00369     <span class="keywordtype">int</span>         nlines;
-<a name="l00370"></a>00370     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00371"></a>00371     <span class="keywordtype">int</span>         ccd_xsize, ccd_ysize;
-<a name="l00372"></a>00372     <span class="keywordtype">int</span>         first_row, last_row;
-<a name="l00373"></a>00373     <span class="keywordtype">int</span>         ylow, yhig;
-<a name="l00374"></a>00374     <span class="keywordtype">int</span>         highres;
-<a name="l00375"></a>00375     <span class="keywordtype">int</span>         treat_as_lss;
-<a name="l00376"></a>00376     <span class="keywordtype">int</span>         i;
-<a name="l00377"></a>00377     <span class="keywordtype">double</span>      reference;
-<a name="l00378"></a>00378     <span class="keywordtype">double</span>     *xpos;
-<a name="l00379"></a>00379     <span class="keywordtype">double</span>      mxpos;
-<a name="l00380"></a>00380     <span class="keywordtype">double</span>     *line;
-<a name="l00381"></a>00381     <span class="keywordtype">int</span>         mxu, mos, lss;
-<a name="l00382"></a>00382     <span class="keywordtype">int</span>         rec_scib;
-<a name="l00383"></a>00383     <span class="keywordtype">int</span>         rec_stdb;
-<a name="l00384"></a>00384     <span class="keywordtype">int</span>         rec_scif;
-<a name="l00385"></a>00385     <span class="keywordtype">int</span>         rec_stdf;
-<a name="l00386"></a>00386     <span class="keywordtype">int</span>         nslits_out_det = 0;
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390 
-<a name="l00391"></a>00391     cpl_msg_set_indentation(2);
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394     <span class="comment">/*</span>
-<a name="l00395"></a>00395 <span class="comment">     * Get configuration parameters</span>
-<a name="l00396"></a>00396 <span class="comment">     */</span>
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00399"></a>00399     cpl_msg_indent_more();
-<a name="l00400"></a>00400     
-<a name="l00401"></a>00401     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00402"></a>00402         fors_align_sky_lss_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); 
-<a name="l00403"></a>00403 
-<a name="l00404"></a>00404     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00405"></a>00405 
-<a name="l00406"></a>00406     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00407"></a>00407                     <span class="stringliteral">"fors.fors_align_sky_lss.dispersion"</span>, grism_table);
-<a name="l00408"></a>00408 
-<a name="l00409"></a>00409     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00410"></a>00410         fors_align_sky_lss_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00413"></a>00413                     <span class="stringliteral">"fors.fors_align_sky_lss.startwavelength"</span>, grism_table);
-<a name="l00414"></a>00414     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00415"></a>00415         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00416"></a>00416             fors_align_sky_lss_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00417"></a>00417 
-<a name="l00418"></a>00418     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00419"></a>00419                     <span class="stringliteral">"fors.fors_align_sky_lss.endwavelength"</span>, grism_table);
-<a name="l00420"></a>00420     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00421"></a>00421         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00422"></a>00422             fors_align_sky_lss_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00423"></a>00423         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00424"></a>00424             fors_align_sky_lss_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00425"></a>00425     }
-<a name="l00426"></a>00426 
-<a name="l00427"></a>00427     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00428"></a>00428         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00429"></a>00429             fors_align_sky_lss_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00430"></a>00430 
-<a name="l00431"></a>00431     skyalign = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00432"></a>00432                     <span class="stringliteral">"fors.fors_align_sky_lss.skyalign"</span>, NULL);
-<a name="l00433"></a>00433 
-<a name="l00434"></a>00434     <span class="keywordflow">if</span> (skyalign < 0)
-<a name="l00435"></a>00435         fors_align_sky_lss_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00436"></a>00436     <span class="keywordflow">if</span> (skyalign > 2)
-<a name="l00437"></a>00437         fors_align_sky_lss_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);
-<a name="l00438"></a>00438 
-<a name="l00439"></a>00439     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist,
-<a name="l00440"></a>00440                     <span class="stringliteral">"fors.fors_align_sky_lss.wcolumn"</span>, NULL);
-<a name="l00441"></a>00441 
-<a name="l00442"></a>00442     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00443"></a>00443 
-<a name="l00444"></a>00444     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00445"></a>00445         fors_align_sky_lss_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447 
-<a name="l00448"></a>00448     cpl_msg_indent_less();
-<a name="l00449"></a>00449     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00450"></a>00450     cpl_msg_indent_more();
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452     mxu  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MXU"</span>);
-<a name="l00453"></a>00453     mos  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MOS"</span>);
-<a name="l00454"></a>00454     lss  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_LSS"</span>);
-<a name="l00455"></a>00455 
-<a name="l00456"></a>00456     nframes = mos + mxu + lss;
-<a name="l00457"></a>00457 
-<a name="l00458"></a>00458     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00459"></a>00459         fors_align_sky_lss_exit(<span class="stringliteral">"Missing input slit location table"</span>);
-<a name="l00460"></a>00460     }
-<a name="l00461"></a>00461     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00462"></a>00462         cpl_msg_error(recipe, 
-<a name="l00463"></a>00463                       <span class="stringliteral">"Too many input slit location tables (%d > 1)"</span>, nframes);
-<a name="l00464"></a>00464         fors_align_sky_lss_exit(NULL);
-<a name="l00465"></a>00465     }
-<a name="l00466"></a>00466 
-<a name="l00467"></a>00467     <span class="keywordflow">if</span> (mxu) {
-<a name="l00468"></a>00468         rec_scib = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>);
-<a name="l00469"></a>00469         rec_stdb = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>);
-<a name="l00470"></a>00470         rec_scif = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>);
-<a name="l00471"></a>00471         rec_stdf = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>);
-<a name="l00472"></a>00472     }
-<a name="l00473"></a>00473     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00474"></a>00474         rec_scib = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>);
-<a name="l00475"></a>00475         rec_stdb = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>);
-<a name="l00476"></a>00476         rec_scif = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>);
-<a name="l00477"></a>00477         rec_stdf = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>);
-<a name="l00478"></a>00478     }
-<a name="l00479"></a>00479     <span class="keywordflow">else</span> {
-<a name="l00480"></a>00480         rec_scib = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>);
-<a name="l00481"></a>00481         rec_stdb = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>);
-<a name="l00482"></a>00482         rec_scif = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>);
-<a name="l00483"></a>00483         rec_stdf = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>);
-<a name="l00484"></a>00484     }
-<a name="l00485"></a>00485 
-<a name="l00486"></a>00486     nframes = rec_scib + rec_stdb + rec_scif + rec_stdf;
-<a name="l00487"></a>00487 
-<a name="l00488"></a>00488     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00489"></a>00489         fors_align_sky_lss_exit(<span class="stringliteral">"Missing input scientific spectra"</span>);
-<a name="l00490"></a>00490     }
-<a name="l00491"></a>00491     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00492"></a>00492         cpl_msg_error(recipe, <span class="stringliteral">"Too many input scientific spectra (%d > 1)"</span>, 
-<a name="l00493"></a>00493                       nframes);
-<a name="l00494"></a>00494         fors_align_sky_lss_exit(NULL);
-<a name="l00495"></a>00495     }
-<a name="l00496"></a>00496 
-<a name="l00497"></a>00497     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)
-<a name="l00498"></a>00498         fors_align_sky_lss_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500     <span class="keywordflow">if</span> (rec_scib) {
-<a name="l00501"></a>00501         <span class="keywordflow">if</span> (mxu) {
-<a name="l00502"></a>00502             rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;
-<a name="l00503"></a>00503             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;
-<a name="l00504"></a>00504             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MXU"</span>;
-<a name="l00505"></a>00505             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;
-<a name="l00506"></a>00506         }
-<a name="l00507"></a>00507         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00508"></a>00508             rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;
-<a name="l00509"></a>00509             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;
-<a name="l00510"></a>00510             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MOS"</span>;
-<a name="l00511"></a>00511             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;
-<a name="l00512"></a>00512         }
-<a name="l00513"></a>00513         <span class="keywordflow">else</span> {
-<a name="l00514"></a>00514             rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>;
-<a name="l00515"></a>00515             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_LSS"</span>;
-<a name="l00516"></a>00516             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_LSS"</span>;
-<a name="l00517"></a>00517             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>;
-<a name="l00518"></a>00518         }
-<a name="l00519"></a>00519     }
-<a name="l00520"></a>00520     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stdb) {
-<a name="l00521"></a>00521         <span class="keywordflow">if</span> (mxu) {
-<a name="l00522"></a>00522             rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;
-<a name="l00523"></a>00523             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;
-<a name="l00524"></a>00524             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MXU"</span>;
-<a name="l00525"></a>00525             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;
-<a name="l00526"></a>00526         }
-<a name="l00527"></a>00527         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00528"></a>00528             rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;
-<a name="l00529"></a>00529             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;
-<a name="l00530"></a>00530             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MOS"</span>;
-<a name="l00531"></a>00531             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;
-<a name="l00532"></a>00532         }
-<a name="l00533"></a>00533         <span class="keywordflow">else</span> { 
-<a name="l00534"></a>00534             rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>;
-<a name="l00535"></a>00535             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_LSS"</span>;
-<a name="l00536"></a>00536             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_LSS"</span>;
-<a name="l00537"></a>00537             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>;
-<a name="l00538"></a>00538         }
-<a name="l00539"></a>00539     }
-<a name="l00540"></a>00540     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_scif) {
-<a name="l00541"></a>00541         <span class="keywordflow">if</span> (mxu) {
-<a name="l00542"></a>00542             rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>;
-<a name="l00543"></a>00543             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;
-<a name="l00544"></a>00544             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MXU"</span>;
-<a name="l00545"></a>00545             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;
-<a name="l00546"></a>00546         }
-<a name="l00547"></a>00547         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {   
-<a name="l00548"></a>00548             rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>;
-<a name="l00549"></a>00549             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;
-<a name="l00550"></a>00550             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MOS"</span>;
-<a name="l00551"></a>00551             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;
-<a name="l00552"></a>00552         }
-<a name="l00553"></a>00553         <span class="keywordflow">else</span> {
-<a name="l00554"></a>00554             rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>;
-<a name="l00555"></a>00555             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_LSS"</span>;
-<a name="l00556"></a>00556             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_LSS"</span>;
-<a name="l00557"></a>00557             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>;
-<a name="l00558"></a>00558         }
-<a name="l00559"></a>00559     }
-<a name="l00560"></a>00560     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stdf) {
-<a name="l00561"></a>00561         <span class="keywordflow">if</span> (mxu) {
-<a name="l00562"></a>00562             rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>;
-<a name="l00563"></a>00563             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;
-<a name="l00564"></a>00564             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MXU"</span>;
-<a name="l00565"></a>00565             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;
-<a name="l00566"></a>00566         }
-<a name="l00567"></a>00567         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {   
-<a name="l00568"></a>00568             rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>;
-<a name="l00569"></a>00569             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;
-<a name="l00570"></a>00570             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MOS"</span>;
-<a name="l00571"></a>00571             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;
-<a name="l00572"></a>00572         }
-<a name="l00573"></a>00573         <span class="keywordflow">else</span> {
-<a name="l00574"></a>00574             rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>;
-<a name="l00575"></a>00575             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_LSS"</span>;
-<a name="l00576"></a>00576             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_LSS"</span>;
-<a name="l00577"></a>00577             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>;
-<a name="l00578"></a>00578         }
-<a name="l00579"></a>00579     }
-<a name="l00580"></a>00580 
-<a name="l00581"></a>00581     nframes = cpl_frameset_count_tags(frameset, rectified_tag);
-<a name="l00582"></a>00582 
-<a name="l00583"></a>00583     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00584"></a>00584         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s"</span>, rectified_tag);
-<a name="l00585"></a>00585         fors_align_sky_lss_exit(NULL);
-<a name="l00586"></a>00586     }
-<a name="l00587"></a>00587     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00588"></a>00588         cpl_msg_error(recipe, <span class="stringliteral">"Too many input %s (%d > 1)"</span>, rectified_tag,
-<a name="l00589"></a>00589                       nframes);
-<a name="l00590"></a>00590         fors_align_sky_lss_exit(NULL);
-<a name="l00591"></a>00591     }
-<a name="l00592"></a>00592 
-<a name="l00593"></a>00593 
-<a name="l00594"></a>00594     <span class="keywordflow">if</span> (mxu) {
-<a name="l00595"></a>00595         disp_coeff_tag    = <span class="stringliteral">"DISP_COEFF_MXU"</span>;
-<a name="l00596"></a>00596         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00597"></a>00597     }
-<a name="l00598"></a>00598     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00599"></a>00599         disp_coeff_tag    = <span class="stringliteral">"DISP_COEFF_MOS"</span>;
-<a name="l00600"></a>00600         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00601"></a>00601     }
-<a name="l00602"></a>00602     <span class="keywordflow">else</span> {
-<a name="l00603"></a>00603         disp_coeff_tag    = <span class="stringliteral">"DISP_COEFF_LSS"</span>;
-<a name="l00604"></a>00604         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;
-<a name="l00605"></a>00605     }
-<a name="l00606"></a>00606 
-<a name="l00607"></a>00607     nframes = cpl_frameset_count_tags(frameset, disp_coeff_tag);
-<a name="l00608"></a>00608 
-<a name="l00609"></a>00609     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00610"></a>00610         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s"</span>, disp_coeff_tag);
-<a name="l00611"></a>00611         fors_align_sky_lss_exit(NULL);
-<a name="l00612"></a>00612     }
-<a name="l00613"></a>00613     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00614"></a>00614         cpl_msg_error(recipe, <span class="stringliteral">"Too many input %s (%d > 1)"</span>, disp_coeff_tag,
-<a name="l00615"></a>00615                       nframes);
-<a name="l00616"></a>00616         fors_align_sky_lss_exit(NULL);
-<a name="l00617"></a>00617     }
-<a name="l00618"></a>00618 
-<a name="l00619"></a>00619 
-<a name="l00620"></a>00620     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, rectified_tag, 0);
-<a name="l00621"></a>00621 
-<a name="l00622"></a>00622     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00623"></a>00623         fors_align_sky_lss_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l00624"></a>00624 
-<a name="l00625"></a>00625     <span class="keywordflow">if</span> (mos || mxu) {
-<a name="l00626"></a>00626         <span class="keywordflow">if</span> (mos)
-<a name="l00627"></a>00627             maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00628"></a>00628         <span class="keywordflow">else</span>
-<a name="l00629"></a>00629             maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631         <span class="comment">/*</span>
-<a name="l00632"></a>00632 <span class="comment">         * Check if all slits have the same X offset: if not, abort!</span>
-<a name="l00633"></a>00633 <span class="comment">         */</span>
-<a name="l00634"></a>00634 
-<a name="l00635"></a>00635         treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l00636"></a>00636 
-<a name="l00637"></a>00637         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639         <span class="keywordflow">if</span> (!treat_as_lss)
-<a name="l00640"></a>00640             fors_align_sky_lss_exit(<span class="stringliteral">"This is not an LSS observation. "</span>
-<a name="l00641"></a>00641                                     <span class="stringliteral">"Please use recipe fors_align_sky"</span>);
-<a name="l00642"></a>00642     }
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00645"></a>00645         fors_align_sky_lss_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00646"></a>00646 
-<a name="l00647"></a>00647     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00648"></a>00648         fors_align_sky_lss_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00651"></a>00651         fors_align_sky_lss_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653 
-<a name="l00654"></a>00654     <span class="comment">/*</span>
-<a name="l00655"></a>00655 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00656"></a>00656 <span class="comment">     * dispersion direction from the reference frame</span>
-<a name="l00657"></a>00657 <span class="comment">     */</span>
-<a name="l00658"></a>00658 
-<a name="l00659"></a>00659     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00660"></a>00660     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00661"></a>00661         fors_align_sky_lss_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span>
-<a name="l00662"></a>00662                             <span class="stringliteral">"header"</span>);
-<a name="l00663"></a>00663 
-<a name="l00664"></a>00664     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00665"></a>00665         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00666"></a>00666     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00667"></a>00667         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00668"></a>00668 
-<a name="l00669"></a>00669     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00670"></a>00670 
-<a name="l00671"></a>00671     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00672"></a>00672         fors_align_sky_lss_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span>
-<a name="l00673"></a>00673                             <span class="stringliteral">"in reference frame header"</span>);
-<a name="l00674"></a>00674 
-<a name="l00675"></a>00675     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l00676"></a>00676         reference *= 10;
-<a name="l00677"></a>00677 
-<a name="l00678"></a>00678     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l00679"></a>00679         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l00680"></a>00680                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in reference frame header"</span>,
-<a name="l00681"></a>00681                       reference);
-<a name="l00682"></a>00682         fors_align_sky_lss_exit(NULL);
-<a name="l00683"></a>00683     }
-<a name="l00684"></a>00684 
-<a name="l00685"></a>00685     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l00686"></a>00686 
-<a name="l00687"></a>00687     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00688"></a>00688 
-<a name="l00689"></a>00689     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00690"></a>00690         fors_align_sky_lss_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00691"></a>00691                             <span class="stringliteral">"in reference frame header"</span>);
-<a name="l00692"></a>00692 
-<a name="l00693"></a>00693     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l00694"></a>00694         dispersion *= rebin;
-<a name="l00695"></a>00695         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l00696"></a>00696                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,
-<a name="l00697"></a>00697                         dispersion);
-<a name="l00698"></a>00698     }
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700 
-<a name="l00701"></a>00701     cpl_msg_indent_less();
-<a name="l00702"></a>00702     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);
-<a name="l00703"></a>00703     cpl_msg_indent_more();
-<a name="l00704"></a>00704 
-<a name="l00705"></a>00705     smapped = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, rectified_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00706"></a>00706     <span class="keywordflow">if</span> (smapped == NULL)
-<a name="l00707"></a>00707         fors_align_sky_lss_exit(<span class="stringliteral">"Cannot load input scientific frame"</span>);
-<a name="l00708"></a>00708 
-<a name="l00709"></a>00709     slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l00710"></a>00710     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00711"></a>00711         fors_align_sky_lss_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l00712"></a>00712 
-<a name="l00713"></a>00713     first_row = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, 0, NULL);
-<a name="l00714"></a>00714     last_row = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, 0, NULL);
-<a name="l00715"></a>00715 
-<a name="l00716"></a>00716     ylow = first_row + 1;
-<a name="l00717"></a>00717     yhig = last_row + 1;
-<a name="l00718"></a>00718 
-<a name="l00719"></a>00719     ccd_xsize = cpl_image_get_size_x(smapped);
-<a name="l00720"></a>00720     ccd_ysize = cpl_image_get_size_x(smapped);
-<a name="l00721"></a>00721     dummy = cpl_image_extract(smapped, 1, ylow, ccd_xsize, yhig);
-<a name="l00722"></a>00722     cpl_image_delete(smapped); smapped = dummy;
-<a name="l00723"></a>00723     nx = ccd_xsize;
-<a name="l00724"></a>00724     ny = cpl_image_get_size_y(smapped);
-<a name="l00725"></a>00725 
-<a name="l00726"></a>00726     cpl_table_delete(slits); slits = NULL;
-<a name="l00727"></a>00727 
-<a name="l00728"></a>00728     idscoeff = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, disp_coeff_tag, 1);
-<a name="l00729"></a>00729     <span class="keywordflow">if</span> (idscoeff == NULL)
-<a name="l00730"></a>00730         fors_align_sky_lss_exit(<span class="stringliteral">"Cannot load dispersion solution"</span>);
-<a name="l00731"></a>00731 
-<a name="l00732"></a>00732     wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);
-<a name="l00733"></a>00733 
-<a name="l00734"></a>00734     <span class="keywordflow">if</span> (wavelengths) {
-<a name="l00735"></a>00735 
-<a name="l00736"></a>00736         <span class="comment">/*</span>
-<a name="l00737"></a>00737 <span class="comment">         * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l00738"></a>00738 <span class="comment">         */</span>
-<a name="l00739"></a>00739 
-<a name="l00740"></a>00740         nlines = cpl_table_get_nrow(wavelengths);
-<a name="l00741"></a>00741 
-<a name="l00742"></a>00742         <span class="keywordflow">if</span> (nlines == 0)
-<a name="l00743"></a>00743             fors_align_sky_lss_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);
-<a name="l00744"></a>00744 
-<a name="l00745"></a>00745         <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l00746"></a>00746             cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span>
-<a name="l00747"></a>00747                           <span class="stringliteral">"catalog table"</span>, wcolumn);
-<a name="l00748"></a>00748             fors_align_sky_lss_exit(NULL);
-<a name="l00749"></a>00749         }
-<a name="l00750"></a>00750 
-<a name="l00751"></a>00751         line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00752"></a>00752 
-<a name="l00753"></a>00753         <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l00754"></a>00754             line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l00755"></a>00755 
-<a name="l00756"></a>00756         cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l00757"></a>00757 
-<a name="l00758"></a>00758         lines = cpl_vector_wrap(nlines, line);
-<a name="l00759"></a>00759     }
-<a name="l00760"></a>00760     <span class="keywordflow">else</span> {
-<a name="l00761"></a>00761         cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);
-<a name="l00762"></a>00762     }
-<a name="l00763"></a>00763 
-<a name="l00764"></a>00764     <span class="keywordflow">if</span> (skyalign) {
-<a name="l00765"></a>00765         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l00766"></a>00766         <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);
-<a name="l00767"></a>00767     }
-<a name="l00768"></a>00768     <span class="keywordflow">else</span> {
-<a name="l00769"></a>00769         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l00770"></a>00770         <span class="stringliteral">"skylines applying median offset..."</span>);
-<a name="l00771"></a>00771     }
-<a name="l00772"></a>00772 
-<a name="l00773"></a>00773     <span class="keywordflow">if</span> (dispersion > 1.0)
-<a name="l00774"></a>00774         highres = 0;
-<a name="l00775"></a>00775     <span class="keywordflow">else</span>
-<a name="l00776"></a>00776         highres = 1;
-<a name="l00777"></a>00777 
-<a name="l00778"></a>00778     rainbow = <a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength,
-<a name="l00779"></a>00779                                endwavelength);
-<a name="l00780"></a>00780 
-<a name="l00781"></a>00781     offsets = <a class="code" href="group__moses.html#g2523d130beaf8538187729f767c38805">mos_wavelength_align_lss</a>(smapped, reference,
-<a name="l00782"></a>00782                                        startwavelength, endwavelength,
-<a name="l00783"></a>00783                                        idscoeff, lines, highres,
-<a name="l00784"></a>00784                                        skyalign, rainbow, 4);
-<a name="l00785"></a>00785 
-<a name="l00786"></a>00786     cpl_vector_delete(lines); lines = NULL;
-<a name="l00787"></a>00787     cpl_image_delete(smapped); smapped = NULL;
-<a name="l00788"></a>00788 
-<a name="l00789"></a>00789     <span class="keywordflow">if</span> (offsets) {
-<a name="l00790"></a>00790         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, offsets, shifts_tag, NULL,
-<a name="l00791"></a>00791                            parlist, recipe, version))
-<a name="l00792"></a>00792             fors_align_sky_lss_exit(NULL);
-<a name="l00793"></a>00793 
-<a name="l00794"></a>00794         cpl_table_delete(offsets); offsets = NULL;
-<a name="l00795"></a>00795     }
-<a name="l00796"></a>00796     <span class="keywordflow">else</span>
-<a name="l00797"></a>00797         fors_align_sky_lss_exit(<span class="stringliteral">"Alignment of the wavelength solution "</span>
-<a name="l00798"></a>00798                         <span class="stringliteral">"to reference sky lines could not be done!"</span>);
-<a name="l00799"></a>00799 
-<a name="l00800"></a>00800     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_ali_tag, NULL,
-<a name="l00801"></a>00801                        parlist, recipe, version))
-<a name="l00802"></a>00802         fors_align_sky_lss_exit(NULL);
-<a name="l00803"></a>00803 
-<a name="l00804"></a>00804     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l00805"></a>00805 
-<a name="l00806"></a>00806     wavemap = cpl_image_new(ccd_xsize, ccd_ysize, CPL_TYPE_FLOAT);
-<a name="l00807"></a>00807     cpl_image_copy(wavemap, rainbow, 1, ylow);
-<a name="l00808"></a>00808 
-<a name="l00809"></a>00809     cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l00810"></a>00810 
-<a name="l00811"></a>00811     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, wavemap, wavemap_tag,
-<a name="l00812"></a>00812                        header, parlist, recipe, version))
-<a name="l00813"></a>00813         fors_align_sky_lss_exit(NULL);
-<a name="l00814"></a>00814 
-<a name="l00815"></a>00815     cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l00816"></a>00816     cpl_propertylist_delete(header); header = NULL;
-<a name="l00817"></a>00817 
-<a name="l00818"></a>00818     <span class="keywordflow">return</span> 0;
-<a name="l00819"></a>00819 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__align__sky__lss_8c_source.html b/html/fors__align__sky__lss_8c_source.html
new file mode 100644
index 0000000..bc572ac
--- /dev/null
+++ b/html/fors__align__sky__lss_8c_source.html
@@ -0,0 +1,830 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_align_sky_lss.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_align_sky_lss.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_align_sky_lss.c,v 1.9 2013-08-21 14:49:09 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-21 14:49:09 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.9 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_align_sky_lss_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to align the wavelength solution based on the arc\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"lamp exposure on a set of sky lines observed on a scientific exposure.\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"The input scientific frames are produced by the recipes fors_remove_bias\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"and fors_flatfield. An input catalog of sky lines can be specified, or\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"an internal one is used.\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"This recipe should be applied to LSS or long-slit like data (MOS/MXU with\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"all slits at the same offset). For multi-slit MOS/MXU data use recipe\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"fors_align_sky instead. Please refer to the FORS PIpeline User's Manual\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"for more details.\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"LSS, and SCI as STD.\n\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  SCIENCE_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  or SCIENCE_UNFLAT_MXU\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"  or STANDARD_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"  or STANDARD_UNFLAT_MXU     Calib       Frame with sky lines    Y\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"  DISP_COEFF_MXU             Calib       Dispersion solution     Y\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location on CCD    Y\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  MASTER_SKYLINECAT          Calib       Catalog of sky lines    .\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  SKY_SHIFTS_LONG_SCI_MXU    FITS table  Observed sky lines offsets\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  WAVELENGTH_MAP_SCI_MXU     FITS image  Wavelength mapped on CCD\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"  DISP_COEFF_SCI_MXU         FITS image  Upgraded dispersion solution\n\n"</span>;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">#define fors_align_sky_lss_exit(message)          \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">cpl_image_delete(smapped);                    \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">cpl_table_delete(offsets);                    \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">#define fors_align_sky_lss_exit_memcheck(message)   \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);         \</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">cpl_image_delete(wavemap);                      \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);         \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">cpl_image_delete(rainbow);                      \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">printf("free smapped (%p)\n", smapped);         \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">cpl_image_delete(smapped);                      \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">cpl_table_delete(grism_table);                  \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">cpl_table_delete(maskslits);                    \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths); \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">cpl_table_delete(wavelengths);                  \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">printf("free offsets (%p)\n", offsets);         \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">cpl_table_delete(offsets);                      \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);       \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">cpl_table_delete(idscoeff);                     \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">cpl_table_delete(slits);                        \</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor">printf("free lines (%p)\n", lines);             \</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">cpl_vector_delete(lines);                       \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> {</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                     <span class="stringliteral">"fors_align_sky_lss"</span>,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                     <span class="stringliteral">"Upgrade wavelength solution using sky lines"</span>,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                     fors_align_sky_lss_description,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                     fors_align_sky_lss_create,</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                     fors_align_sky_lss_exec,</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>                     fors_align_sky_lss_destroy);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> }</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> {</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky_lss.dispersion"</span>,</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                 <span class="stringliteral">"fors.fors_align_sky_lss"</span>,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                                 0.0);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky_lss.startwavelength"</span>,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                                 <span class="stringliteral">"fors.fors_align_sky_lss"</span>,</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>                                 0.0);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> </div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky_lss.endwavelength"</span>,</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                 <span class="stringliteral">"fors.fors_align_sky_lss"</span>,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                                 0.0);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="comment">     * Sky lines alignment</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> </div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky_lss.skyalign"</span>,</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>                                 <span class="stringliteral">"Polynomial order for sky lines alignment"</span>,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                                 <span class="stringliteral">"fors.fors_align_sky_lss"</span>,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                                 0);</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span></div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_align_sky_lss.wcolumn"</span>,</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>                                 <span class="stringliteral">"Name of sky line catalog table column "</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>                                 <span class="stringliteral">"fors.fors_align_sky_lss"</span>,</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> }</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> {</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     <span class="keywordflow">return</span> fors_align_sky_lss(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> }</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> {</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> }</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_align_sky_lss(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> {</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> </div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_align_sky_lss"</span>;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> </div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keywordtype">int</span>         skyalign;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> </div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     cpl_image        *rainbow     = NULL;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     cpl_image        *wavemap     = NULL;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     cpl_image        *smapped     = NULL;</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     cpl_image        *dummy       = NULL;</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     cpl_table        *wavelengths = NULL;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     cpl_table        *idscoeff    = NULL;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     cpl_table        *maskslits   = NULL;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     cpl_table        *offsets     = NULL;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_vector       *lines       = NULL;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *rectified_tag;</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavemap_tag;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *shifts_tag;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_ali_tag;</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keywordtype">int</span>         nframes;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     <span class="keywordtype">int</span>         nlines;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <span class="keywordtype">int</span>         nx;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="keywordtype">int</span>         ccd_xsize, ccd_ysize;</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keywordtype">int</span>         first_row, last_row;</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     <span class="keywordtype">int</span>         ylow, yhig;</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keywordtype">int</span>         highres;</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     <span class="keywordtype">int</span>         treat_as_lss;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordtype">double</span>     *line;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordtype">int</span>         mxu, mos, lss;</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="keywordtype">int</span>         rec_scib;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     <span class="keywordtype">int</span>         rec_stdb;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="keywordtype">int</span>         rec_scif;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keywordtype">int</span>         rec_stdf;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keywordtype">int</span>         nslits_out_det = 0;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> </div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> </div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); </div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> </div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>                     <span class="stringliteral">"fors.fors_align_sky_lss.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span> </div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                     <span class="stringliteral">"fors.fors_align_sky_lss.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>             fors_align_sky_lss_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>                     <span class="stringliteral">"fors.fors_align_sky_lss.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>             fors_align_sky_lss_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>             fors_align_sky_lss_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     }</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>             fors_align_sky_lss_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     skyalign = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>                     <span class="stringliteral">"fors.fors_align_sky_lss.skyalign"</span>, NULL);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     <span class="keywordflow">if</span> (skyalign < 0)</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keywordflow">if</span> (skyalign > 2)</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist,</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                     <span class="stringliteral">"fors.fors_align_sky_lss.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> </div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> </div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     mxu  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MXU"</span>);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     mos  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MOS"</span>);</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     lss  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_LSS"</span>);</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> </div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     nframes = mos + mxu + lss;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Missing input slit location table"</span>);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     }</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         cpl_msg_error(recipe, </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>                       <span class="stringliteral">"Too many input slit location tables (%d > 1)"</span>, nframes);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>         fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     }</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         rec_scib = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         rec_stdb = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         rec_scif = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>);</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         rec_stdf = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     }</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         rec_scib = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         rec_stdb = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         rec_scif = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>         rec_stdf = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     }</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         rec_scib = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         rec_stdb = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         rec_scif = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>         rec_stdf = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     }</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     nframes = rec_scib + rec_stdb + rec_scif + rec_stdf;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> </div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Missing input scientific spectra"</span>);</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     }</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input scientific spectra (%d > 1)"</span>, </div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>                       nframes);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>         fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     }</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> </div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span> </div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     <span class="keywordflow">if</span> (rec_scib) {</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>             rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>         }</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>             rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         }</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>             rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>         }</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     }</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stdb) {</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>             rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MXU"</span>;</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>         }</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>             rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MOS"</span>;</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>         }</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>         <span class="keywordflow">else</span> { </div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>             rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_LSS"</span>;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_LSS"</span>;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>;</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>         }</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     }</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_scif) {</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>             rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>         }</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {   </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>             rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>;</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         }</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>             rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>         }</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     }</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stdf) {</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>             rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MXU"</span>;</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>         }</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {   </div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>             rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MOS"</span>;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>         }</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>             rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>;</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>             wavemap_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_LSS"</span>;</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>             shifts_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_LSS"</span>;</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>             disp_ali_tag  = <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         }</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     }</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     nframes = cpl_frameset_count_tags(frameset, rectified_tag);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s"</span>, rectified_tag);</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     }</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input %s (%d > 1)"</span>, rectified_tag,</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>                       nframes);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>         fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     }</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span> </div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span> </div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>         disp_coeff_tag    = <span class="stringliteral">"DISP_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     }</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>         disp_coeff_tag    = <span class="stringliteral">"DISP_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     }</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>         disp_coeff_tag    = <span class="stringliteral">"DISP_COEFF_LSS"</span>;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     }</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> </div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     nframes = cpl_frameset_count_tags(frameset, disp_coeff_tag);</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> </div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s"</span>, disp_coeff_tag);</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>         fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     }</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input %s (%d > 1)"</span>, disp_coeff_tag,</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>                       nframes);</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>         fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     }</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> </div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span> </div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, rectified_tag, 0);</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span> </div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span> </div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     <span class="keywordflow">if</span> (mos || mxu) {</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>             maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>             maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span> </div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> <span class="comment">         * Check if all slits have the same X offset: if not, abort!</span></div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span> </div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>         treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span> </div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>         <span class="keywordflow">if</span> (!treat_as_lss)</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>             fors_align_sky_lss_exit(<span class="stringliteral">"This is not an LSS observation. "</span></div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>                                     <span class="stringliteral">"Please use recipe fors_align_sky"</span>);</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>     }</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> </div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> </div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span> </div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span> <span class="comment">     * dispersion direction from the reference frame</span></div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span> </div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span></div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>                             <span class="stringliteral">"header"</span>);</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span> </div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span> </div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> </div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span></div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>                             <span class="stringliteral">"in reference frame header"</span>);</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span> </div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>         reference *= 10;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in reference frame header"</span>,</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>                       reference);</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>         fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     }</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> </div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> </div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> </div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>                             <span class="stringliteral">"in reference frame header"</span>);</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> </div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>                         dispersion);</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     }</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> </div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> </div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> </div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     smapped = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, rectified_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>     <span class="keywordflow">if</span> (smapped == NULL)</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Cannot load input scientific frame"</span>);</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span> </div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>     slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span> </div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     first_row = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, 0, NULL);</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     last_row = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, 0, NULL);</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span> </div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     ylow = first_row + 1;</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     yhig = last_row + 1;</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> </div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     ccd_xsize = cpl_image_get_size_x(smapped);</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     ccd_ysize = cpl_image_get_size_x(smapped);</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     dummy = cpl_image_extract(smapped, 1, ylow, ccd_xsize, yhig);</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     cpl_image_delete(smapped); smapped = dummy;</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     nx = ccd_xsize;</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> </div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span> </div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     idscoeff = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, disp_coeff_tag, 1);</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     <span class="keywordflow">if</span> (idscoeff == NULL)</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Cannot load dispersion solution"</span>);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> </div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span> </div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     <span class="keywordflow">if</span> (wavelengths) {</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span> </div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span> <span class="comment">         * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> </div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>         nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> </div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>         <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>             fors_align_sky_lss_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span> </div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>         <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span></div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>                           <span class="stringliteral">"catalog table"</span>, wcolumn);</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>             fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>         }</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span> </div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>         line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span> </div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>         <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>             line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span> </div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>         cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span> </div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>         lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>     }</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>         cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>     }</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span> </div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>     <span class="keywordflow">if</span> (skyalign) {</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>         <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>     }</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>         <span class="stringliteral">"skylines applying median offset..."</span>);</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     }</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span> </div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     <span class="keywordflow">if</span> (dispersion > 1.0)</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>         highres = 0;</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>         highres = 1;</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span> </div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>     rainbow = <a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength,</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>                                endwavelength);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span> </div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>     offsets = <a class="code" href="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1" title="Modify the input wavelength solution to match reference sky lines (LSS).">mos_wavelength_align_lss</a>(smapped, reference,</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>                                        startwavelength, endwavelength,</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>                                        idscoeff, lines, highres,</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>                                        skyalign, rainbow, 4);</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> </div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>     cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> </div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     <span class="keywordflow">if</span> (offsets) {</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, offsets, shifts_tag, NULL,</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>             fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> </div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>         cpl_table_delete(offsets); offsets = NULL;</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     }</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>         fors_align_sky_lss_exit(<span class="stringliteral">"Alignment of the wavelength solution "</span></div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>                         <span class="stringliteral">"to reference sky lines could not be done!"</span>);</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> </div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, idscoeff, disp_ali_tag, NULL,</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>         fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span> </div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> </div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     wavemap = cpl_image_new(ccd_xsize, ccd_ysize, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     cpl_image_copy(wavemap, rainbow, 1, ylow);</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span> </div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     cpl_image_delete(rainbow); rainbow = NULL;</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span> </div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, wavemap, wavemap_tag,</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>                        header, parlist, recipe, version))</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>         fors_align_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span> </div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span> </div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__bias-test_8c-source.html b/html/fors__bias-test_8c-source.html
deleted file mode 100644
index 9d9ba8b..0000000
--- a/html/fors__bias-test_8c-source.html
+++ /dev/null
@@ -1,190 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_bias-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_bias-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_bias-test.c,v 1.9 2013/04/25 10:00:19 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/25 10:00:19 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.9 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_bias_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <test.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00047"></a>00047 <span class="preprocessor">#undef cleanup</span>
-<a name="l00048"></a><a class="code" href="group__fors__bias__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00048</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">do { \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">    cpl_frameset_delete(frames); \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">    fors_image_delete(&raw_bias); \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">    fors_image_delete(&master_bias); \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">    cpl_propertylist_delete(product_header); \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">} while(0)</span>
-<a name="l00057"></a>00057 <span class="preprocessor"></span>
-<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00062"></a><a class="code" href="group__fors__bias__test.html#g42640f96b5b36b542e3302fee3c97b75">00062</a> <a class="code" href="group__fors__bias__test.html#g42640f96b5b36b542e3302fee3c97b75">test_bias</a>(<span class="keywordtype">void</span>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     <span class="comment">/* Input */</span>
-<a name="l00065"></a>00065     cpl_frameset *frames          = cpl_frameset_new();
-<a name="l00066"></a>00066     cpl_parameterlist *parameters = cpl_parameterlist_new();
-<a name="l00067"></a>00067 
-<a name="l00068"></a>00068     <span class="comment">/* Output */</span>
-<a name="l00069"></a>00069     <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias  = NULL;
-<a name="l00070"></a>00070     <a class="code" href="struct__fors__image.html">fors_image</a> *raw_bias  = NULL;
-<a name="l00071"></a>00071     cpl_propertylist *product_header = NULL;
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075     <span class="comment">/* Simulate data */</span>
-<a name="l00076"></a>00076     <span class="keyword">const</span> <span class="keywordtype">char</span> *bias_filename[] = {<span class="stringliteral">"bias_1.fits"</span>,
-<a name="l00077"></a>00077                                    <span class="stringliteral">"bias_2.fits"</span>,
-<a name="l00078"></a>00078                                    <span class="stringliteral">"bias_3.fits"</span>,
-<a name="l00079"></a>00079                                    <span class="stringliteral">"bias_4.fits"</span>,
-<a name="l00080"></a>00080                                    <span class="stringliteral">"bias_5.fits"</span>};
-<a name="l00081"></a>00081     
-<a name="l00082"></a>00082     {
-<a name="l00083"></a>00083         <span class="keywordtype">unsigned</span> i;
-<a name="l00084"></a>00084         
-<a name="l00085"></a>00085         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(bias_filename)/<span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *); i++) {
-<a name="l00086"></a>00086             cpl_frameset_insert(frames, 
-<a name="l00087"></a>00087                                 <a class="code" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">create_bias</a>(bias_filename[i],
-<a name="l00088"></a>00088                                             BIAS, CPL_FRAME_GROUP_RAW));
-<a name="l00089"></a>00089         }
-<a name="l00090"></a>00090     }
-<a name="l00091"></a>00091 
-<a name="l00092"></a>00092     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_get_position(frames, 0));
-<a name="l00093"></a>00093 
-<a name="l00094"></a>00094     <a class="code" href="group__fors__bias.html#g4a662bfaa15a38c6190fe7ba15ff1bf9">fors_bias_define_parameters</a>(parameters);
-<a name="l00095"></a>00095     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00096"></a>00096             <span class="stringliteral">"Create parameters failed"</span>);
-<a name="l00097"></a>00097     
-<a name="l00098"></a>00098     <a class="code" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">fors_parameterlist_set_defaults</a>(parameters);
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100     <span class="comment">/* Call recipe */</span>
-<a name="l00101"></a>00101     <a class="code" href="group__fors__bias.html#g0eef24525a05bf717023a0380e5931b2">fors_bias</a>(frames, parameters);
-<a name="l00102"></a>00102     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00103"></a>00103             <span class="stringliteral">"Execution error"</span>);
-<a name="l00104"></a>00104 
-<a name="l00105"></a>00105     <span class="comment">/* Test existence of QC + products */</span>
-<a name="l00106"></a>00106     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[] = {MASTER_BIAS};
-<a name="l00107"></a>00107     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[] = 
-<a name="l00108"></a>00108         {<span class="stringliteral">"QC BIAS STRUCT"</span>, <span class="stringliteral">"QC BIAS LEVEL"</span>, <span class="stringliteral">"QC RON"</span>, <span class="stringliteral">"QC BIAS FPN"</span>,
-<a name="l00109"></a>00109          <span class="stringliteral">"QC MBIAS LEVEL"</span>,
-<a name="l00110"></a>00110          <span class="stringliteral">"QC MBIAS RONEXP"</span>, <span class="stringliteral">"QC MBIAS NOISE"</span>, <span class="stringliteral">"QC MBIAS NRATIO"</span>, <span class="stringliteral">"QC MBIAS STRUCT"</span>};
-<a name="l00111"></a>00111     <a class="code" href="group__test.html#ge4730f9510e545e738aef9c8b7459b8b">test_recipe_output</a>(frames, 
-<a name="l00112"></a>00112                        product_tags, <span class="keyword">sizeof</span> product_tags / <span class="keyword">sizeof</span> *product_tags,
-<a name="l00113"></a>00113                MASTER_BIAS,
-<a name="l00114"></a>00114                        qc, <span class="keyword">sizeof</span> qc / <span class="keyword">sizeof</span> *qc);
-<a name="l00115"></a>00115     
-<a name="l00116"></a>00116     <span class="comment">/* Test results */</span>
-<a name="l00117"></a>00117     {
-<a name="l00118"></a>00118         <span class="comment">/* New and previous frames */</span>
-<a name="l00119"></a>00119         test( cpl_frameset_find(frames, BIAS) != NULL );
-<a name="l00120"></a>00120 
-<a name="l00121"></a>00121         master_bias = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00122"></a>00122             cpl_frameset_find(frames, MASTER_BIAS), NULL, setting, NULL);
-<a name="l00123"></a>00123         
-<a name="l00124"></a>00124         raw_bias    = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00125"></a>00125             cpl_frameset_find(frames, BIAS), NULL, setting, NULL);
-<a name="l00126"></a>00126         
-<a name="l00127"></a>00127         <span class="comment">/* Verify that relative error decreased  */</span>
-<a name="l00128"></a>00128         test( <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(master_bias, NULL) /
-<a name="l00129"></a>00129               <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(master_bias, NULL) 
-<a name="l00130"></a>00130               <
-<a name="l00131"></a>00131               <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(raw_bias, NULL) /
-<a name="l00132"></a>00132               <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(raw_bias, NULL));
-<a name="l00133"></a>00133 
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135         <span class="comment">/* QC numbers */</span>
-<a name="l00136"></a>00136         product_header = 
-<a name="l00137"></a>00137             cpl_propertylist_load(cpl_frame_get_filename(
-<a name="l00138"></a>00138                                       cpl_frameset_find(frames,
-<a name="l00139"></a>00139                                                         MASTER_BIAS)),
-<a name="l00140"></a>00140                                   0);
-<a name="l00141"></a>00141         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( product_header != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00142"></a>00142 
-<a name="l00143"></a>00143         test_rel( cpl_propertylist_get_double(product_header,
-<a name="l00144"></a>00144                                               <span class="stringliteral">"ESO QC BIAS LEVEL"</span>),
-<a name="l00145"></a>00145                   <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(master_bias, NULL), 0.01 );
-<a name="l00146"></a>00146         
-<a name="l00147"></a>00147         test_rel( cpl_propertylist_get_double(product_header,
-<a name="l00148"></a>00148                                               <span class="stringliteral">"ESO QC MBIAS LEVEL"</span>),
-<a name="l00149"></a>00149                   <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(master_bias, NULL), 0.01 );
-<a name="l00150"></a>00150         
-<a name="l00151"></a>00151         test_rel( cpl_propertylist_get_double(product_header,
-<a name="l00152"></a>00152                                               <span class="stringliteral">"ESO QC RON"</span>),
-<a name="l00153"></a>00153                   <a class="code" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">fors_image_get_stdev</a>(raw_bias, NULL), 0.10 );
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155         <span class="comment">/* fixed pattern and structure should be zero */</span>
-<a name="l00156"></a>00156         test_abs( cpl_propertylist_get_double(product_header,
-<a name="l00157"></a>00157                                               <span class="stringliteral">"ESO QC BIAS FPN"</span>),
-<a name="l00158"></a>00158                   0, 0.01*<a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(master_bias, NULL));
-<a name="l00159"></a>00159 
-<a name="l00160"></a>00160         test_abs( cpl_propertylist_get_double(product_header,
-<a name="l00161"></a>00161                                               <span class="stringliteral">"ESO QC BIAS STRUCT"</span>),
-<a name="l00162"></a>00162                   0, 0.01*<a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(master_bias, NULL));
-<a name="l00163"></a>00163     }
-<a name="l00164"></a>00164 
-<a name="l00165"></a>00165     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00166"></a>00166     <span class="keywordflow">return</span>;
-<a name="l00167"></a>00167 }
-<a name="l00168"></a>00168 
-<a name="l00172"></a><a class="code" href="group__fors__bias__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00172</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00173"></a>00173 {
-<a name="l00174"></a>00174     TEST_INIT;
-<a name="l00175"></a>00175     
-<a name="l00176"></a>00176     <a class="code" href="group__fors__bias__test.html#g42640f96b5b36b542e3302fee3c97b75">test_bias</a>();
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     TEST_END;
-<a name="l00179"></a>00179 }
-<a name="l00180"></a>00180 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__bias-test_8c_source.html b/html/fors__bias-test_8c_source.html
new file mode 100644
index 0000000..d825589
--- /dev/null
+++ b/html/fors__bias-test_8c_source.html
@@ -0,0 +1,229 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_bias-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_bias-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_bias-test.c,v 1.9 2013-04-25 10:00:19 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-04-25 10:00:19 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.9 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_bias_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">    cpl_frameset_delete(frames); \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">    fors_image_delete(&raw_bias); \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">    fors_image_delete(&master_bias); \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">    cpl_propertylist_delete(product_header); \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__bias__test.html#ga56ca9e6f3e38b35931c68ecb147b1f75">   62</a></span> <a class="code" href="group__fors__bias__test.html#ga56ca9e6f3e38b35931c68ecb147b1f75" title="Test bias recipe.">test_bias</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     <span class="comment">/* Input */</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_frameset *frames          = cpl_frameset_new();</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     cpl_parameterlist *parameters = cpl_parameterlist_new();</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     <span class="comment">/* Output */</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias  = NULL;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *raw_bias  = NULL;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     cpl_propertylist *product_header = NULL;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <span class="comment">/* Simulate data */</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *bias_filename[] = {<span class="stringliteral">"bias_1.fits"</span>,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                                    <span class="stringliteral">"bias_2.fits"</span>,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                    <span class="stringliteral">"bias_3.fits"</span>,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                                    <span class="stringliteral">"bias_4.fits"</span>,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                                    <span class="stringliteral">"bias_5.fits"</span>};</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     {</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>         <span class="keywordtype">unsigned</span> i;</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>         </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(bias_filename)/<span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *); i++) {</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>             cpl_frameset_insert(frames, </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                                 <a class="code" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e" title="Simulate bias image.">create_bias</a>(bias_filename[i],</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                                             BIAS, CPL_FRAME_GROUP_RAW));</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>         }</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     }</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_get_position(frames, 0));</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     <a class="code" href="group__fors__bias.html#ga6573b8822e0f40fbc3872cd034e0b0f4" title="Define recipe parameters.">fors_bias_define_parameters</a>(parameters);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>             <span class="stringliteral">"Create parameters failed"</span>);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <a class="code" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42" title="Set unset parameters to default value.">fors_parameterlist_set_defaults</a>(parameters);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="comment">/* Call recipe */</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <a class="code" href="group__fors__bias.html#ga5d2a46e2354a60d3a45b2c63a665b781" title="Do the processing.">fors_bias</a>(frames, parameters);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>             <span class="stringliteral">"Execution error"</span>);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> </div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     <span class="comment">/* Test existence of QC + products */</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[] = {MASTER_BIAS};</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[] = </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>         {<span class="stringliteral">"QC BIAS STRUCT"</span>, <span class="stringliteral">"QC BIAS LEVEL"</span>, <span class="stringliteral">"QC RON"</span>, <span class="stringliteral">"QC BIAS FPN"</span>,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>          <span class="stringliteral">"QC MBIAS LEVEL"</span>,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>          <span class="stringliteral">"QC MBIAS RONEXP"</span>, <span class="stringliteral">"QC MBIAS NOISE"</span>, <span class="stringliteral">"QC MBIAS NRATIO"</span>, <span class="stringliteral">"QC MBIAS STRUCT"</span>};</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <a class="code" href="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c" title="Test existence of recipe products.">test_recipe_output</a>(frames, </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                        product_tags, <span class="keyword">sizeof</span> product_tags / <span class="keyword">sizeof</span> *product_tags,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                MASTER_BIAS,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                        qc, <span class="keyword">sizeof</span> qc / <span class="keyword">sizeof</span> *qc);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     </div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="comment">/* Test results */</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     {</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         <span class="comment">/* New and previous frames */</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         test( cpl_frameset_find(frames, BIAS) != NULL );</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>         master_bias = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>             cpl_frameset_find(frames, MASTER_BIAS), NULL, setting, NULL);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>         </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>         raw_bias    = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>             cpl_frameset_find(frames, BIAS), NULL, setting, NULL);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>         <span class="comment">/* Verify that relative error decreased  */</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>         test( <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(master_bias, NULL) /</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>               <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(master_bias, NULL) </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>               <</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>               <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(raw_bias, NULL) /</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>               <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(raw_bias, NULL));</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>         <span class="comment">/* QC numbers */</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         product_header = </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>             cpl_propertylist_load(cpl_frame_get_filename(</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                                       cpl_frameset_find(frames,</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                                                         MASTER_BIAS)),</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                                   0);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( product_header != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         test_rel( cpl_propertylist_get_double(product_header,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                                               <span class="stringliteral">"ESO QC BIAS LEVEL"</span>),</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                   <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(master_bias, NULL), 0.01 );</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>         </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>         test_rel( cpl_propertylist_get_double(product_header,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                                               <span class="stringliteral">"ESO QC MBIAS LEVEL"</span>),</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                   <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(master_bias, NULL), 0.01 );</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>         </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>         test_rel( cpl_propertylist_get_double(product_header,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                                               <span class="stringliteral">"ESO QC RON"</span>),</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                   <a class="code" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e" title="Get empirical stdev of data.">fors_image_get_stdev</a>(raw_bias, NULL), 0.10 );</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>         <span class="comment">/* fixed pattern and structure should be zero */</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>         test_abs( cpl_propertylist_get_double(product_header,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                                               <span class="stringliteral">"ESO QC BIAS FPN"</span>),</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                   0, 0.01*<a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(master_bias, NULL));</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>         test_abs( cpl_propertylist_get_double(product_header,</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>                                               <span class="stringliteral">"ESO QC BIAS STRUCT"</span>),</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>                   0, 0.01*<a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(master_bias, NULL));</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     }</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     cleanup;</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> }</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno"><a class="code" href="group__fors__bias__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  172</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> {</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     TEST_INIT;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     <a class="code" href="group__fors__bias__test.html#ga56ca9e6f3e38b35931c68ecb147b1f75" title="Test bias recipe.">test_bias</a>();</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     TEST_END;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> }</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__bias_8c-source.html b/html/fors__bias_8c-source.html
deleted file mode 100644
index 71f0fd5..0000000
--- a/html/fors__bias_8c-source.html
+++ /dev/null
@@ -1,198 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_bias.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_bias.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_bias.c,v 1.9 2011/10/12 14:59:57 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/12 14:59:57 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.9 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_bias_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g7eae9b8d1a50b0e1b4f13e652b2b2510">fors_bias_create</a>(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#gf051ed22200bb5eafa1ce68561ff89ad">fors_bias_exec</a>(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#gbac19e9fec13b72b6b5cf2f7bb5cf67c">fors_bias_destroy</a>(cpl_plugin *);
-<a name="l00041"></a>00041 
-<a name="l00062"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00062</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00065"></a>00065     cpl_plugin *plugin = &recipe->interface;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>())
-<a name="l00068"></a>00068     {
-<a name="l00069"></a>00069         cpl_msg_error(cpl_func, 
-<a name="l00070"></a>00070               <span class="stringliteral">"I am fors_bias version %d, but I am linking "</span>
-<a name="l00071"></a>00071               <span class="stringliteral">"against the FORS library version %d. "</span>
-<a name="l00072"></a>00072               <span class="stringliteral">"This will not work. "</span>
-<a name="l00073"></a>00073               <span class="stringliteral">"Please remove all previous installations "</span>
-<a name="l00074"></a>00074               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,
-<a name="l00075"></a>00075               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>());
-<a name="l00076"></a>00076         <span class="keywordflow">return</span> 1;
-<a name="l00077"></a>00077     }
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079     cpl_plugin_init(plugin,
-<a name="l00080"></a>00080                     CPL_PLUGIN_API,
-<a name="l00081"></a>00081                     FORS_BINARY_VERSION,
-<a name="l00082"></a>00082                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00083"></a>00083                     <a class="code" href="group__fors__bias.html#gd51c822cab169bae87041e5a4fcd66d4">fors_bias_name</a>,
-<a name="l00084"></a>00084                     <a class="code" href="group__fors__bias.html#gea114b7db6295d739326c18b19a7e913">fors_bias_description_short</a>,
-<a name="l00085"></a>00085                     <a class="code" href="group__fors__bias.html#gc1284becbd1c69542318bd9d410756c0">fors_bias_description</a>,
-<a name="l00086"></a>00086                     <a class="code" href="group__fors__bias.html#gac46f7ed3e8a797c8d29848b5cf6b304">fors_bias_author</a>,
-<a name="l00087"></a>00087                     <a class="code" href="group__fors__bias.html#gf0a241a045115f888f5c723675d02e2f">fors_bias_email</a>,
-<a name="l00088"></a>00088                     <a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a>(),
-<a name="l00089"></a>00089                     <a class="code" href="group__fors__bias.html#g7eae9b8d1a50b0e1b4f13e652b2b2510">fors_bias_create</a>,
-<a name="l00090"></a>00090                     <a class="code" href="group__fors__bias.html#gf051ed22200bb5eafa1ce68561ff89ad">fors_bias_exec</a>,
-<a name="l00091"></a>00091                     <a class="code" href="group__fors__bias.html#gbac19e9fec13b72b6b5cf2f7bb5cf67c">fors_bias_destroy</a>);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     cpl_pluginlist_append(list, plugin);
-<a name="l00094"></a>00094     
-<a name="l00095"></a>00095     <span class="keywordflow">return</span> 0;
-<a name="l00096"></a>00096 }
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 
-<a name="l00109"></a><a class="code" href="group__fors__bias.html#g7eae9b8d1a50b0e1b4f13e652b2b2510">00109</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g7eae9b8d1a50b0e1b4f13e652b2b2510">fors_bias_create</a>(cpl_plugin *plugin)
-<a name="l00110"></a>00110 {
-<a name="l00111"></a>00111     cpl_recipe    *recipe;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00114"></a>00114         cpl_msg_error(cpl_func, 
-<a name="l00115"></a>00115                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00116"></a>00116                       <span class="stringliteral">"refusing to create recipe fors_bias"</span>, 
-<a name="l00117"></a>00117                       cpl_error_get_message());
-<a name="l00118"></a>00118         <span class="keywordflow">return</span> 1;
-<a name="l00119"></a>00119     }
-<a name="l00120"></a>00120     
-<a name="l00121"></a>00121     <span class="comment">/* </span>
-<a name="l00122"></a>00122 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00123"></a>00123 <span class="comment">     */</span>
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00126"></a>00126         recipe = (cpl_recipe *)plugin;
-<a name="l00127"></a>00127     }
-<a name="l00128"></a>00128     <span class="keywordflow">else</span> {
-<a name="l00129"></a>00129         <span class="keywordflow">return</span> 1;
-<a name="l00130"></a>00130     }
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* </span>
-<a name="l00133"></a>00133 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00134"></a>00134 <span class="comment">     */</span>
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00137"></a>00137     
-<a name="l00138"></a>00138     <a class="code" href="group__fors__bias.html#g4a662bfaa15a38c6190fe7ba15ff1bf9">fors_bias_define_parameters</a>(recipe->parameters);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00141"></a>00141         cpl_msg_error(cpl_func, 
-<a name="l00142"></a>00142                       <span class="stringliteral">"Could not create fors_bias parameters"</span>);
-<a name="l00143"></a>00143         <span class="keywordflow">return</span> 1;
-<a name="l00144"></a>00144     }
-<a name="l00145"></a>00145         
-<a name="l00146"></a>00146     <span class="keywordflow">return</span> 0;
-<a name="l00147"></a>00147 }
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 
-<a name="l00158"></a><a class="code" href="group__fors__bias.html#gf051ed22200bb5eafa1ce68561ff89ad">00158</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#gf051ed22200bb5eafa1ce68561ff89ad">fors_bias_exec</a>(cpl_plugin *plugin)
-<a name="l00159"></a>00159 {
-<a name="l00160"></a>00160     cpl_recipe *recipe;
-<a name="l00161"></a>00161     cpl_errorstate initial_errorstate = cpl_errorstate_get();
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00164"></a>00164         cpl_msg_error(cpl_func, 
-<a name="l00165"></a>00165                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00166"></a>00166                       <span class="stringliteral">"refusing to execute recipe fors_bias"</span>, 
-<a name="l00167"></a>00167                       cpl_error_get_message());
-<a name="l00168"></a>00168         <span class="keywordflow">return</span> 1;
-<a name="l00169"></a>00169     }
-<a name="l00170"></a>00170     
-<a name="l00171"></a>00171     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00172"></a>00172         recipe = (cpl_recipe *)plugin;
-<a name="l00173"></a>00173     }
-<a name="l00174"></a>00174     <span class="keywordflow">else</span> {
-<a name="l00175"></a>00175         <span class="keywordflow">return</span> 1;
-<a name="l00176"></a>00176     }
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="keywordflow">if</span> (recipe->frames == NULL) {
-<a name="l00179"></a>00179         cpl_msg_error(cpl_func, 
-<a name="l00180"></a>00180                       <span class="stringliteral">"Null frameset"</span>);
-<a name="l00181"></a>00181         <span class="keywordflow">return</span> 1;
-<a name="l00182"></a>00182     }
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">if</span> (recipe->parameters == NULL) {
-<a name="l00185"></a>00185         cpl_msg_error(cpl_func, 
-<a name="l00186"></a>00186                       <span class="stringliteral">"Null parameter list"</span>);
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> 1;
-<a name="l00188"></a>00188     }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a>(recipe->frames,
-<a name="l00191"></a>00191                <a class="code" href="group__fors__bias.html#gea114b7db6295d739326c18b19a7e913">fors_bias_description_short</a>);
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <a class="code" href="group__fors__bias.html#g0eef24525a05bf717023a0380e5931b2">fors_bias</a>(recipe->frames, recipe->parameters);
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a>(recipe->frames, initial_errorstate);
-<a name="l00196"></a>00196 }
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 
-<a name="l00207"></a><a class="code" href="group__fors__bias.html#gbac19e9fec13b72b6b5cf2f7bb5cf67c">00207</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#gbac19e9fec13b72b6b5cf2f7bb5cf67c">fors_bias_destroy</a>(cpl_plugin *plugin)
-<a name="l00208"></a>00208 {
-<a name="l00209"></a>00209     cpl_recipe *recipe;
-<a name="l00210"></a>00210     
-<a name="l00211"></a>00211     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00212"></a>00212         recipe = (cpl_recipe *)plugin;
-<a name="l00213"></a>00213     }
-<a name="l00214"></a>00214     <span class="keywordflow">else</span> {
-<a name="l00215"></a>00215         <span class="keywordflow">return</span> -1;
-<a name="l00216"></a>00216     }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     <span class="keywordflow">return</span> 0;
-<a name="l00221"></a>00221 }
-<a name="l00222"></a>00222 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__bias_8c_source.html b/html/fors__bias_8c_source.html
new file mode 100644
index 0000000..8fae1cd
--- /dev/null
+++ b/html/fors__bias_8c_source.html
@@ -0,0 +1,237 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_bias.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_bias.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_bias.c,v 1.9 2011-10-12 14:59:57 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-12 14:59:57 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.9 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_bias_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#gaad1b25bcaa37dff1e986b001f8d37ba1" title="Setup the recipe options.">fors_bias_create</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga98c9fd3f30badaa1ae4d9ed954f34fcc" title="Execute the plugin instance given by the interface.">fors_bias_exec</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga1db6393658146917d5d8403fd1ed7654" title="Destroy what has been created by the 'create' function.">fors_bias_destroy</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">   62</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>())</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     {</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>               <span class="stringliteral">"I am fors_bias version %d, but I am linking "</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>               <span class="stringliteral">"against the FORS library version %d. "</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>               <span class="stringliteral">"This will not work. "</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>               <span class="stringliteral">"Please remove all previous installations "</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>());</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     }</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                     fors_bias_name,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                     fors_bias_description_short,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     fors_bias_description,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                     fors_bias_author,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                     fors_bias_email,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     <a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87" title="Get the pipeline copyright and license.">fors_get_license</a>(),</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     <a class="code" href="group__fors__bias.html#gaad1b25bcaa37dff1e986b001f8d37ba1" title="Setup the recipe options.">fors_bias_create</a>,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     <a class="code" href="group__fors__bias.html#ga98c9fd3f30badaa1ae4d9ed954f34fcc" title="Execute the plugin instance given by the interface.">fors_bias_exec</a>,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <a class="code" href="group__fors__bias.html#ga1db6393658146917d5d8403fd1ed7654" title="Destroy what has been created by the 'create' function.">fors_bias_destroy</a>);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> }</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="group__fors__bias.html#gaad1b25bcaa37dff1e986b001f8d37ba1">  109</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#gaad1b25bcaa37dff1e986b001f8d37ba1" title="Setup the recipe options.">fors_bias_create</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                       <span class="stringliteral">"refusing to create recipe fors_bias"</span>, </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     }</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     }</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <a class="code" href="group__fors__bias.html#ga6573b8822e0f40fbc3872cd034e0b0f4" title="Define recipe parameters.">fors_bias_define_parameters</a>(recipe->parameters);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                       <span class="stringliteral">"Could not create fors_bias parameters"</span>);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     }</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> }</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="group__fors__bias.html#ga98c9fd3f30badaa1ae4d9ed954f34fcc">  158</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga98c9fd3f30badaa1ae4d9ed954f34fcc" title="Execute the plugin instance given by the interface.">fors_bias_exec</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> {</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_errorstate initial_errorstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                       <span class="stringliteral">"refusing to execute recipe fors_bias"</span>, </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">if</span> (recipe->frames == NULL) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                       <span class="stringliteral">"Null frameset"</span>);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     }</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL) {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                       <span class="stringliteral">"Null parameter list"</span>);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce" title="Start recipe execution.">fors_begin</a>(recipe->frames,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                fors_bias_description_short);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <a class="code" href="group__fors__bias.html#ga5d2a46e2354a60d3a45b2c63a665b781" title="Do the processing.">fors_bias</a>(recipe->frames, recipe->parameters);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9" title="End recipe execution.">fors_end</a>(recipe->frames, initial_errorstate);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> }</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno"><a class="code" href="group__fors__bias.html#ga1db6393658146917d5d8403fd1ed7654">  207</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga1db6393658146917d5d8403fd1ed7654" title="Destroy what has been created by the 'create' function.">fors_bias_destroy</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> {</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     }</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> }</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__bias__impl_8c-source.html b/html/fors__bias__impl_8c-source.html
deleted file mode 100644
index 00c766d..0000000
--- a/html/fors__bias__impl_8c-source.html
+++ /dev/null
@@ -1,346 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_bias_impl.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_bias_impl.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_bias_impl.c,v 1.29 2012/11/06 09:42:15 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/11/06 09:42:15 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.29 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_bias_impl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_stack.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_header.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_tools.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <moses.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#include <string.h></span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include <math.h></span>
-<a name="l00045"></a>00045 
-<a name="l00052"></a><a class="code" href="group__fors__bias.html#gd51c822cab169bae87041e5a4fcd66d4">00052</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__bias.html#gd51c822cab169bae87041e5a4fcd66d4">fors_bias_name</a> = <span class="stringliteral">"fors_bias"</span>;
-<a name="l00053"></a><a class="code" href="group__fors__bias.html#gea114b7db6295d739326c18b19a7e913">00053</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__bias.html#gea114b7db6295d739326c18b19a7e913">fors_bias_description_short</a> = <span class="stringliteral">"Compute the master bias frame"</span>;
-<a name="l00054"></a><a class="code" href="group__fors__bias.html#gac46f7ed3e8a797c8d29848b5cf6b304">00054</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__bias.html#gac46f7ed3e8a797c8d29848b5cf6b304">fors_bias_author</a> = <span class="stringliteral">"Jonas M. Larsen, Carlo Izzo"</span>;
-<a name="l00055"></a><a class="code" href="group__fors__bias.html#gf0a241a045115f888f5c723675d02e2f">00055</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__bias.html#gf0a241a045115f888f5c723675d02e2f">fors_bias_email</a> = PACKAGE_BUGREPORT;
-<a name="l00056"></a><a class="code" href="group__fors__bias.html#gc1284becbd1c69542318bd9d410756c0">00056</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__bias.html#gc1284becbd1c69542318bd9d410756c0">fors_bias_description</a> =
-<a name="l00057"></a>00057 <span class="stringliteral">"This recipe is used to combine input raw BIAS frames into a master bias\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"frame. The overscan regions, if present, are removed from the result.\n\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"  BIAS                       Raw         Bias frame              Y\n\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias frame\n\n"</span>;
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00068"></a>00068 <a class="code" href="group__fors__bias.html#g118f4ff4db4251491395cec26f300577">write_qc</a>(cpl_propertylist *qc,
-<a name="l00069"></a>00069          <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00070"></a>00070          <span class="keyword">const</span> cpl_frame *first_bias,
-<a name="l00071"></a>00071          <span class="keyword">const</span> fors_image_list *bias,
-<a name="l00072"></a>00072          <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias,
-<a name="l00073"></a>00073          <span class="keyword">const</span> stack_method *sm);
-<a name="l00078"></a><a class="code" href="group__fors__bias.html#g4a662bfaa15a38c6190fe7ba15ff1bf9">00078</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__bias.html#g4a662bfaa15a38c6190fe7ba15ff1bf9">fors_bias_define_parameters</a>(cpl_parameterlist *parameters)
-<a name="l00079"></a>00079 {
-<a name="l00080"></a>00080     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__bias.html#gd51c822cab169bae87041e5a4fcd66d4">fors_bias_name</a>);
-<a name="l00081"></a>00081     
-<a name="l00082"></a>00082     <a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a>(parameters, context, <span class="stringliteral">"minmax"</span>);
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084     cpl_free((<span class="keywordtype">void</span> *)context);
-<a name="l00085"></a>00085 
-<a name="l00086"></a>00086     <span class="keywordflow">return</span>;
-<a name="l00087"></a>00087 }
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089 <span class="preprocessor">#undef cleanup</span>
-<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">do { \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">    cpl_frameset_delete(bias_frames); \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">    fors_stack_method_delete(&sm); \</span>
-<a name="l00094"></a>00094 <span class="preprocessor">    cpl_free((void *)context); \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">    fors_image_list_delete_const(&bias, fors_image_delete); \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">    fors_image_delete(&master_bias); \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">    cpl_propertylist_delete(qc); \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">} while (0)</span>
-<a name="l00100"></a>00100 <span class="preprocessor"></span>
-<a name="l00109"></a><a class="code" href="group__fors__bias.html#g0eef24525a05bf717023a0380e5931b2">00109</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__bias.html#g0eef24525a05bf717023a0380e5931b2">fors_bias</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)
-<a name="l00110"></a>00110 {
-<a name="l00111"></a>00111     <span class="comment">/* Raw */</span>
-<a name="l00112"></a>00112     cpl_frameset *bias_frames      = NULL;
-<a name="l00113"></a>00113     <span class="keyword">const</span> fors_image_list *bias    = NULL;
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115     <span class="comment">/* Product */</span>
-<a name="l00116"></a>00116     <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias = NULL;
-<a name="l00117"></a>00117     cpl_propertylist *qc = cpl_propertylist_new();
-<a name="l00118"></a>00118 
-<a name="l00119"></a>00119     <span class="comment">/* Parameters */</span>
-<a name="l00120"></a>00120     stack_method *sm    = NULL;
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122     <span class="comment">/* Other */</span>
-<a name="l00123"></a>00123     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00124"></a>00124     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__bias.html#gd51c822cab169bae87041e5a4fcd66d4">fors_bias_name</a>);
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126     <span class="comment">/* Get parameters */</span>
-<a name="l00127"></a>00127     sm = <a class="code" href="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af">fors_stack_method_new</a>(parameters, context);
-<a name="l00128"></a>00128     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get stacking method"</span>);
-<a name="l00129"></a>00129     
-<a name="l00130"></a>00130     <span class="comment">/* Find raw */</span>
-<a name="l00131"></a>00131     bias_frames = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, BIAS);
-<a name="l00132"></a>00132     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(bias_frames) > 0, <span class="keywordflow">return</span>, 
-<a name="l00133"></a>00133             <span class="stringliteral">"No %s provided"</span>, BIAS);
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     <span class="comment">/* Get instrument setting */</span>
-<a name="l00136"></a>00136     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_get_first(bias_frames));
-<a name="l00137"></a>00137     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139     <span class="comment">/* Load bias */</span>
-<a name="l00140"></a>00140     bias = <a class="code" href="group__fors__image.html#gab0a6629f36c4db609f1a1515d602477">fors_image_load_list_const</a>(bias_frames, NULL, setting, NULL);
-<a name="l00141"></a>00141     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load bias images"</span>);
-<a name="l00142"></a>00142 
-<a name="l00143"></a>00143     <span class="comment">/* Stack */</span>
-<a name="l00144"></a>00144     master_bias = <a class="code" href="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac">fors_stack_const</a>(bias, sm);
-<a name="l00145"></a>00145     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Bias stacking failed"</span>);
-<a name="l00146"></a>00146     
-<a name="l00147"></a>00147     <span class="comment">/* QC */</span>
-<a name="l00148"></a>00148     <a class="code" href="group__fors__bias.html#g118f4ff4db4251491395cec26f300577">write_qc</a>(qc, setting,
-<a name="l00149"></a>00149              cpl_frameset_get_first(bias_frames),
-<a name="l00150"></a>00150              bias, master_bias, sm);
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152     <span class="comment">/* Save product */</span>
-<a name="l00153"></a>00153     <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, master_bias, MASTER_BIAS,
-<a name="l00154"></a>00154                         qc, parameters, <a class="code" href="group__fors__bias.html#gd51c822cab169bae87041e5a4fcd66d4">fors_bias_name</a>, 
-<a name="l00155"></a>00155                         cpl_frameset_get_first(bias_frames));
-<a name="l00156"></a>00156     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00157"></a>00157             MASTER_BIAS);
-<a name="l00158"></a>00158     
-<a name="l00159"></a>00159     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00160"></a>00160     <span class="keywordflow">return</span>;
-<a name="l00161"></a>00161 }
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164 <span class="preprocessor">#undef cleanup</span>
-<a name="l00165"></a><a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">00165</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00166"></a>00166 <span class="preprocessor">do { \</span>
-<a name="l00167"></a>00167 <span class="preprocessor">    fors_image_delete(&image); \</span>
-<a name="l00168"></a>00168 <span class="preprocessor">} while (0)</span>
-<a name="l00169"></a>00169 <span class="preprocessor"></span>
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00172"></a><a class="code" href="group__fors__bias.html#g118f4ff4db4251491395cec26f300577">00172</a> <a class="code" href="group__fors__bias.html#g118f4ff4db4251491395cec26f300577">write_qc</a>(cpl_propertylist *qc,
-<a name="l00173"></a>00173          <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00174"></a>00174          <span class="keyword">const</span> cpl_frame *first_bias,
-<a name="l00175"></a>00175          <span class="keyword">const</span> fors_image_list *bias,
-<a name="l00176"></a>00176          <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias,
-<a name="l00177"></a>00177          <span class="keyword">const</span> stack_method *sm)
-<a name="l00178"></a>00178 {
-<a name="l00179"></a>00179     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *first_raw  = fors_image_list_first_const(bias);
-<a name="l00180"></a>00180     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *second_raw = fors_image_list_next_const(bias);
-<a name="l00181"></a>00181     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183     <a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(qc,
-<a name="l00184"></a>00184                              <span class="stringliteral">"QC.DID"</span>,
-<a name="l00185"></a>00185                              <span class="stringliteral">"2.0"</span>,
-<a name="l00186"></a>00186                              <span class="stringliteral">"QC1 dictionary"</span>);
-<a name="l00187"></a>00187 
-<a name="l00188"></a>00188     
-<a name="l00189"></a>00189     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not write %s QC parameters"</span>, 
-<a name="l00190"></a>00190             MASTER_BIAS);
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qc,
-<a name="l00193"></a>00193                             <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(first_raw, NULL),
-<a name="l00194"></a>00194                             <span class="stringliteral">"QC.BIAS.LEVEL"</span>,
-<a name="l00195"></a>00195                             <span class="stringliteral">"ADU"</span>,
-<a name="l00196"></a>00196                             <span class="stringliteral">"Bias level"</span>);
-<a name="l00197"></a>00197     <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>;
-<a name="l00198"></a>00198     <span class="keywordtype">double</span> fpn;
-<a name="l00199"></a>00199     <span class="keywordflow">if</span> (second_raw != NULL) {
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201         image = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(first_raw);
-<a name="l00202"></a>00202         <a class="code" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">fors_image_subtract</a>(image, second_raw);
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204         ron = <a class="code" href="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b">fors_image_get_stdev_robust</a>(image, 50, NULL) / sqrt(2.0);
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206         fpn = <a class="code" href="group__fors__tools.html#g2e2a80069157183a808349976b3e455a">fors_fixed_pattern_noise_bias</a>(first_raw,
-<a name="l00207"></a>00207                                             second_raw,
-<a name="l00208"></a>00208                                             ron);
-<a name="l00209"></a>00209 <span class="comment">/*</span>
-<a name="l00210"></a>00210 <span class="comment">        fpn = fors_fixed_pattern_noise(first_raw,</span>
-<a name="l00211"></a>00211 <span class="comment">                                       1.0,</span>
-<a name="l00212"></a>00212 <span class="comment">                                       ron);</span>
-<a name="l00213"></a>00213 <span class="comment">*/</span>
-<a name="l00214"></a>00214         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00215"></a>00215                 <span class="stringliteral">"Could not compute fixed pattern noise"</span> );
-<a name="l00216"></a>00216     }
-<a name="l00217"></a>00217     <span class="keywordflow">else</span> {
-<a name="l00218"></a>00218         cpl_msg_warning(cpl_func,
-<a name="l00219"></a>00219                         <span class="stringliteral">"Only %d bias frame(s) provided, "</span>
-<a name="l00220"></a>00220                         <span class="stringliteral">"cannot compute readout noise"</span>, 
-<a name="l00221"></a>00221                         fors_image_list_size(bias));
-<a name="l00222"></a>00222         ron = -1;
-<a name="l00223"></a>00223         fpn = -1;
-<a name="l00224"></a>00224     }
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qc,
-<a name="l00227"></a>00227                             ron,
-<a name="l00228"></a>00228                             <span class="stringliteral">"QC.RON"</span>,
-<a name="l00229"></a>00229                             <span class="stringliteral">"ADU"</span>,
-<a name="l00230"></a>00230                             <span class="stringliteral">"Readout noise"</span>);
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232     <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qc,
-<a name="l00233"></a>00233                             fpn,
-<a name="l00234"></a>00234                             <span class="stringliteral">"QC.BIAS.FPN"</span>,
-<a name="l00235"></a>00235                             <span class="stringliteral">"ADU"</span>,
-<a name="l00236"></a>00236                             <span class="stringliteral">"Bias fixed pattern noise"</span>);
-<a name="l00237"></a>00237 
-<a name="l00238"></a>00238     <span class="keywordtype">double</span> structure = <a class="code" href="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b">fors_image_get_stdev_robust</a>(first_raw, 50, NULL);
-<a name="l00239"></a>00239     <span class="keywordflow">if</span> (structure*structure >= ron*ron + fpn*fpn) {
-<a name="l00240"></a>00240         structure = sqrt(structure*structure - ron*ron - fpn*fpn);
-<a name="l00241"></a>00241     }
-<a name="l00242"></a>00242     <span class="keywordflow">else</span> {
-<a name="l00243"></a>00243         cpl_msg_warning(cpl_func,
-<a name="l00244"></a>00244                         <span class="stringliteral">"Overall bias standard deviation (%f ADU) is less "</span>
-<a name="l00245"></a>00245                         <span class="stringliteral">"than combined readout and fixed pattern noise "</span>
-<a name="l00246"></a>00246                         <span class="stringliteral">"(%f ADU), setting structure to zero"</span>,
-<a name="l00247"></a>00247                         structure , sqrt(ron*ron + fpn*fpn));
-<a name="l00248"></a>00248         structure = 0;
-<a name="l00249"></a>00249     }
-<a name="l00250"></a>00250     
-<a name="l00251"></a>00251     
-<a name="l00252"></a>00252     <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qc,
-<a name="l00253"></a>00253                             structure,
-<a name="l00254"></a>00254                             <span class="stringliteral">"QC.BIAS.STRUCT"</span>,
-<a name="l00255"></a>00255                             <span class="stringliteral">"ADU"</span>,
-<a name="l00256"></a>00256                             <span class="stringliteral">"Bias structure"</span>);
-<a name="l00257"></a>00257 
-<a name="l00258"></a>00258     <span class="comment">/* Master bias QC */</span>
-<a name="l00259"></a>00259 
-<a name="l00260"></a>00260     <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qc,
-<a name="l00261"></a>00261                             <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(master_bias, NULL),
-<a name="l00262"></a>00262                             <span class="stringliteral">"QC.MBIAS.LEVEL"</span>,
-<a name="l00263"></a>00263                             <span class="stringliteral">"ADU"</span>,
-<a name="l00264"></a>00264                             <span class="stringliteral">"Master bias level"</span>);
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266     <span class="keywordtype">double</span> ron_expect = -1;
-<a name="l00267"></a>00267     <span class="keywordflow">if</span> (ron > 0) {
-<a name="l00268"></a>00268 
-<a name="l00269"></a>00269         <span class="keywordtype">int</span> N = fors_image_list_size(bias);
-<a name="l00270"></a>00270 
-<a name="l00271"></a>00271         <span class="comment">/*</span>
-<a name="l00272"></a>00272 <span class="comment">          When median stacking and N >= 3, we need to</span>
-<a name="l00273"></a>00273 <span class="comment">          take into account the fact that the median is more noisy than</span>
-<a name="l00274"></a>00274 <span class="comment">          the mean.</span>
-<a name="l00275"></a>00275 <span class="comment">        */</span>
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277         <span class="keywordflow">if</span> (sm->method == MEDIAN) {
-<a name="l00278"></a>00278             ron_expect = <a class="code" href="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3">fors_utils_median_corr</a>(N) * ron / sqrt(N);
-<a name="l00279"></a>00279         }
-<a name="l00280"></a>00280         <span class="keywordflow">else</span> {
-<a name="l00281"></a>00281             ron_expect = ron / sqrt(N);
-<a name="l00282"></a>00282         }
-<a name="l00283"></a>00283     }
-<a name="l00284"></a>00284     <span class="keywordflow">else</span> cpl_msg_warning(cpl_func,
-<a name="l00285"></a>00285                          <span class="stringliteral">"Cannot compute expected master bias readout noise"</span>);
-<a name="l00286"></a>00286     
-<a name="l00287"></a>00287     <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qc,
-<a name="l00288"></a>00288                             ron_expect,
-<a name="l00289"></a>00289                             <span class="stringliteral">"QC.MBIAS.RONEXP"</span>,
-<a name="l00290"></a>00290                             <span class="stringliteral">"ADU"</span>,
-<a name="l00291"></a>00291                             <span class="stringliteral">"Expected master bias readout noise"</span>);
-<a name="l00292"></a>00292     
-<a name="l00293"></a>00293     <span class="keywordtype">double</span> mbias_noise = -1;
-<a name="l00294"></a>00294     <span class="keywordflow">if</span> (ron_expect > 0) {
-<a name="l00295"></a>00295         mbias_noise =
-<a name="l00296"></a>00296             <a class="code" href="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b">fors_image_get_stdev_robust</a>(master_bias, 3*ron_expect, NULL);
-<a name="l00297"></a>00297     }
-<a name="l00298"></a>00298     <span class="keywordflow">else</span> {
-<a name="l00299"></a>00299         mbias_noise = -1;
-<a name="l00300"></a>00300     }
-<a name="l00301"></a>00301     
-<a name="l00302"></a>00302     <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qc,
-<a name="l00303"></a>00303                             mbias_noise,
-<a name="l00304"></a>00304                             <span class="stringliteral">"QC.MBIAS.NOISE"</span>,
-<a name="l00305"></a>00305                             <span class="stringliteral">"ADU"</span>,
-<a name="l00306"></a>00306                             <span class="stringliteral">"Master bias readout noise"</span>);
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308     <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qc,
-<a name="l00309"></a>00309                             mbias_noise / ron_expect,
-<a name="l00310"></a>00310                             <span class="stringliteral">"QC.MBIAS.NRATIO"</span>,
-<a name="l00311"></a>00311                             NULL,
-<a name="l00312"></a>00312                             <span class="stringliteral">"Master bias observed/expected noise"</span>);
-<a name="l00313"></a>00313     
-<a name="l00314"></a>00314     <span class="keywordtype">double</span> mbias_struct = <a class="code" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">fors_image_get_stdev</a>(master_bias, NULL);
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     <span class="keywordflow">if</span> (mbias_struct * mbias_struct > mbias_noise * mbias_noise) {
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318         cpl_msg_debug(cpl_func, <span class="stringliteral">"Overall standard deviation is %f ADU"</span>,
-<a name="l00319"></a>00319                       mbias_struct);
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321         mbias_struct = sqrt(mbias_struct * mbias_struct - 
-<a name="l00322"></a>00322                             mbias_noise * mbias_noise);
-<a name="l00323"></a>00323     }
-<a name="l00324"></a>00324     <span class="keywordflow">else</span> {
-<a name="l00325"></a>00325         cpl_msg_warning(cpl_func,
-<a name="l00326"></a>00326                         <span class="stringliteral">"Master bias overall standard deviation (%f ADU) is "</span>
-<a name="l00327"></a>00327                         <span class="stringliteral">"greater than master bias noise (%f ADU), "</span>
-<a name="l00328"></a>00328                         <span class="stringliteral">"cannot compute master bias structure"</span>,
-<a name="l00329"></a>00329                         mbias_struct, mbias_noise);
-<a name="l00330"></a>00330         mbias_struct = -1;
-<a name="l00331"></a>00331     }
-<a name="l00332"></a>00332 
-<a name="l00333"></a>00333     <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qc,
-<a name="l00334"></a>00334                             mbias_struct,
-<a name="l00335"></a>00335                             <span class="stringliteral">"QC.MBIAS.STRUCT"</span>,
-<a name="l00336"></a>00336                             <span class="stringliteral">"ADU"</span>,
-<a name="l00337"></a>00337                             <span class="stringliteral">"Structure of master bias"</span>);
-<a name="l00338"></a>00338     
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00341"></a>00341     <span class="keywordflow">return</span>;
-<a name="l00342"></a>00342 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__bias__impl_8c_source.html b/html/fors__bias__impl_8c_source.html
new file mode 100644
index 0000000..f0f41d1
--- /dev/null
+++ b/html/fors__bias__impl_8c_source.html
@@ -0,0 +1,388 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_bias_impl.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_bias_impl.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_bias_impl.c,v 1.33 2013-09-11 10:00:35 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-11 10:00:35 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.33 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_bias_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_stack.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_header.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_tools.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_bias_name = <span class="stringliteral">"fors_bias"</span>;</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_bias_description_short = <span class="stringliteral">"Compute the master bias frame"</span>;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_bias_author = <span class="stringliteral">"Jonas M. Larsen, Carlo Izzo"</span>;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_bias_email = PACKAGE_BUGREPORT;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_bias_description =</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"This recipe is used to combine input raw BIAS frames into a master bias\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"frame. The overscan regions, if present, are removed from the result.\n\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"  BIAS                       Raw         Bias frame              Y\n\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias frame\n\n"</span>;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <a class="code" href="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1" title="Compute QC.">write_qc</a>(cpl_propertylist *qc,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>          <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>          <span class="keyword">const</span> cpl_frame *first_bias,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>          <span class="keyword">const</span> fors_image_list *bias,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>          <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>          <span class="keyword">const</span> stack_method *sm);</div>
+<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="group__fors__bias.html#ga6573b8822e0f40fbc3872cd034e0b0f4">   78</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__bias.html#ga6573b8822e0f40fbc3872cd034e0b0f4" title="Define recipe parameters.">fors_bias_define_parameters</a>(cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> {</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_bias_name);</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     <a class="code" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15" title="Define recipe parameters.">fors_stack_define_parameters</a>(parameters, context, <span class="stringliteral">"minmax"</span>);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     cpl_free((<span class="keywordtype">void</span> *)context);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> </div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> }</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">    cpl_frameset_delete(bias_frames); \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">    fors_stack_method_delete(&sm); \</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">    cpl_free((void *)context); \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">    fors_image_list_delete_const(&bias, fors_image_delete); \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">    fors_image_delete(&master_bias); \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">    cpl_propertylist_delete(qc); \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="group__fors__bias.html#ga5d2a46e2354a60d3a45b2c63a665b781">  109</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__bias.html#ga5d2a46e2354a60d3a45b2c63a665b781" title="Do the processing.">fors_bias</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="comment">/* Raw */</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     cpl_frameset *bias_frames      = NULL;</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keyword">const</span> fors_image_list *bias    = NULL;</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="comment">/* Product */</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias = NULL;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     cpl_propertylist *qc = cpl_propertylist_new();</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="comment">/* Parameters */</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     stack_method *sm    = NULL;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="comment">/* Other */</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_bias_name);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="comment">/* Get parameters */</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     sm = <a class="code" href="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e" title="Get stack method from parameter list.">fors_stack_method_new</a>(parameters, context);</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get stacking method"</span>);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     <span class="comment">/* Find raw */</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     bias_frames = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, BIAS);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(bias_frames) > 0, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>             <span class="stringliteral">"No %s provided"</span>, BIAS);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="comment">/* Get instrument setting */</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_get_position(bias_frames, 0));</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <span class="comment">/* Load bias */</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     bias = <a class="code" href="group__fors__image.html#ga0895dc7573734afe519fa4dff3ea33bd" title="Load imagelist.">fors_image_load_list_const</a>(bias_frames, NULL, setting, NULL);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load bias images"</span>);</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="comment">/* Stack */</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     master_bias = <a class="code" href="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc" title="Stack images.">fors_stack_const</a>(bias, sm);</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Bias stacking failed"</span>);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="comment">/* QC */</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <a class="code" href="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1" title="Compute QC.">write_qc</a>(qc, setting,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>              cpl_frameset_get_position(bias_frames, 0),</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>              bias, master_bias, sm);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="comment">/* Save product */</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, master_bias, MASTER_BIAS,</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                         qc, parameters, fors_bias_name, </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>                         cpl_frameset_get_position(bias_frames, 0));</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>             MASTER_BIAS);</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     cleanup;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> }</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="preprocessor">    fors_image_delete(&image); \</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <a class="code" href="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1" title="Compute QC.">write_qc</a>(cpl_propertylist *qc,</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>          <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>          <span class="keyword">const</span> cpl_frame *first_bias,</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>          <span class="keyword">const</span> fors_image_list *bias,</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>          <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias,</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>          <span class="keyword">const</span> stack_method *sm)</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *first_raw  = fors_image_list_first_const(bias);</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *second_raw = fors_image_list_next_const(bias);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     (void)setting; <span class="comment">//Avoid compiler warning</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     (void)first_bias; <span class="comment">//Avoid compiler warning</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <a class="code" href="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053" title="Write a string value to the active QC1 PAF object and to a header.">fors_header_write_string</a>(qc,</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>                              <span class="stringliteral">"QC.DID"</span>,</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>                              <span class="stringliteral">"2.0"</span>,</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>                              <span class="stringliteral">"QC1 dictionary"</span>);</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not write %s QC parameters"</span>, </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>             MASTER_BIAS);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qc,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                             <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(first_raw, NULL),</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                             <span class="stringliteral">"QC.BIAS.LEVEL"</span>,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                             <span class="stringliteral">"Bias level"</span>);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     <span class="keywordtype">double</span> ron;</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="keywordtype">double</span> fpn;</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     <span class="keywordflow">if</span> (second_raw != NULL) {</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>         image = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(first_raw);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>         <a class="code" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be" title="Subtract images.">fors_image_subtract</a>(image, second_raw);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         ron = <a class="code" href="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10" title="Get robust empirical stdev of data.">fors_image_get_stdev_robust</a>(image, 50, NULL) / sqrt(2.0);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> </div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>         fpn = <a class="code" href="group__fors__tools.html#ga1ea0e4e37d52d6077b39e93ad1c340c3" title="Compute fixed pattern noise in bias.">fors_fixed_pattern_noise_bias</a>(first_raw,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                                             second_raw,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                                             ron);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="comment">        fpn = fors_fixed_pattern_noise(first_raw,</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="comment">                                       1.0,</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="comment">                                       ron);</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                 <span class="stringliteral">"Could not compute fixed pattern noise"</span> );</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     }</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>         cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                         <span class="stringliteral">"Only %d bias frame(s) provided, "</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                         <span class="stringliteral">"cannot compute readout noise"</span>, </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                         fors_image_list_size(bias));</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>         ron = -1;</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>         fpn = -1;</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     }</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qc,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                             ron,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                             <span class="stringliteral">"QC.RON"</span>,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                             <span class="stringliteral">"Readout noise"</span>);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qc,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                             fpn,</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>                             <span class="stringliteral">"QC.BIAS.FPN"</span>,</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>                             <span class="stringliteral">"Bias fixed pattern noise"</span>);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> </div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keywordtype">double</span> structure = <a class="code" href="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10" title="Get robust empirical stdev of data.">fors_image_get_stdev_robust</a>(first_raw, 50, NULL);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     <span class="keywordflow">if</span> (structure*structure >= ron*ron + fpn*fpn) {</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>         structure = sqrt(structure*structure - ron*ron - fpn*fpn);</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     }</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>         cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                         <span class="stringliteral">"Overall bias standard deviation (%f ADU) is less "</span></div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                         <span class="stringliteral">"than combined readout and fixed pattern noise "</span></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>                         <span class="stringliteral">"(%f ADU), setting structure to zero"</span>,</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>                         structure , sqrt(ron*ron + fpn*fpn));</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>         structure = 0;</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     }</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qc,</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>                             structure,</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>                             <span class="stringliteral">"QC.BIAS.STRUCT"</span>,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                             <span class="stringliteral">"Bias structure"</span>);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="comment">/* Master bias QC */</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qc,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                             <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(master_bias, NULL),</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                             <span class="stringliteral">"QC.MBIAS.LEVEL"</span>,</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>                             <span class="stringliteral">"Master bias level"</span>);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="keywordtype">double</span> ron_expect = -1;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="keywordflow">if</span> (ron > 0) {</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>         <span class="keywordtype">int</span> N = fors_image_list_size(bias);</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="comment">          When median stacking and N >= 3, we need to</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="comment">          take into account the fact that the median is more noisy than</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> <span class="comment">          the mean.</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>         <span class="keywordflow">if</span> (sm->method == MEDIAN) {</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>             ron_expect = <a class="code" href="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3" title="median stacking correction factor">fors_utils_median_corr</a>(N) * ron / sqrt(N);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>         }</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>             ron_expect = ron / sqrt(N);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>         }</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     }</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">else</span> cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                          <span class="stringliteral">"Cannot compute expected master bias readout noise"</span>);</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     </div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qc,</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                             ron_expect,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                             <span class="stringliteral">"QC.MBIAS.RONEXP"</span>,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                             <span class="stringliteral">"Expected master bias readout noise"</span>);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     </div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="keywordtype">double</span> mbias_noise = -1;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keywordflow">if</span> (ron_expect > 0) {</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>         mbias_noise =</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>             <a class="code" href="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10" title="Get robust empirical stdev of data.">fors_image_get_stdev_robust</a>(master_bias, 3*ron_expect, NULL);</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     }</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         mbias_noise = -1;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     }</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qc,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>                             mbias_noise,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>                             <span class="stringliteral">"QC.MBIAS.NOISE"</span>,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>                             <span class="stringliteral">"Master bias readout noise"</span>);</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qc,</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>                             mbias_noise / ron_expect,</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                             <span class="stringliteral">"QC.MBIAS.NRATIO"</span>,</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                             NULL,</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>                             <span class="stringliteral">"Master bias observed/expected noise"</span>);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <span class="keywordtype">double</span> mbias_struct = <a class="code" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e" title="Get empirical stdev of data.">fors_image_get_stdev</a>(master_bias, NULL);</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> </div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     <span class="keywordflow">if</span> (mbias_struct * mbias_struct > mbias_noise * mbias_noise) {</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"Overall standard deviation is %f ADU"</span>,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                       mbias_struct);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>         mbias_struct = sqrt(mbias_struct * mbias_struct - </div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>                             mbias_noise * mbias_noise);</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     }</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>                         <span class="stringliteral">"Master bias overall standard deviation (%f ADU) is "</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                         <span class="stringliteral">"greater than master bias noise (%f ADU), "</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>                         <span class="stringliteral">"cannot compute master bias structure"</span>,</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>                         mbias_struct, mbias_noise);</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>         mbias_struct = -1;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     }</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> </div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qc,</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>                             mbias_struct,</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>                             <span class="stringliteral">"QC.MBIAS.STRUCT"</span>,</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>                             <span class="stringliteral">"Structure of master bias"</span>);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     </div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     cleanup;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__bias__impl_8h-source.html b/html/fors__bias__impl_8h-source.html
deleted file mode 100644
index ed35100..0000000
--- a/html/fors__bias__impl_8h-source.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_bias_impl.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_bias_impl.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_bias_impl.h,v 1.2 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_BIAS_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_BIAS_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__bias.html#gd51c822cab169bae87041e5a4fcd66d4">fors_bias_name</a>;
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__bias.html#gea114b7db6295d739326c18b19a7e913">fors_bias_description_short</a>;
-<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__bias.html#gac46f7ed3e8a797c8d29848b5cf6b304">fors_bias_author</a>;
-<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__bias.html#gf0a241a045115f888f5c723675d02e2f">fors_bias_email</a>;
-<a name="l00039"></a>00039 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__bias.html#gc1284becbd1c69542318bd9d410756c0">fors_bias_description</a>;
-<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="group__fors__bias.html#g4a662bfaa15a38c6190fe7ba15ff1bf9">fors_bias_define_parameters</a>(cpl_parameterlist *parameters);
-<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="group__fors__bias.html#g0eef24525a05bf717023a0380e5931b2">fors_bias</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 CPL_END_DECLS
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__bias__impl_8h_source.html b/html/fors__bias__impl_8h_source.html
new file mode 100644
index 0000000..8bd36d9
--- /dev/null
+++ b/html/fors__bias__impl_8h_source.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_bias_impl.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_bias_impl.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_bias_impl.h,v 1.2 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.2 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_BIAS_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_BIAS_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_bias_name;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_bias_description_short;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_bias_author;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_bias_email;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_bias_description;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__bias.html#ga6573b8822e0f40fbc3872cd034e0b0f4" title="Define recipe parameters.">fors_bias_define_parameters</a>(cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__bias.html#ga5d2a46e2354a60d3a45b2c63a665b781" title="Do the processing.">fors_bias</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__calib_8c-source.html b/html/fors__calib_8c-source.html
deleted file mode 100644
index 6b4c5a2..0000000
--- a/html/fors__calib_8c-source.html
+++ /dev/null
@@ -1,2697 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_calib.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_calib.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_calib.c,v 1.29 2013/04/24 14:15:36 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:15:36 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.29 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <string.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <moses.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_stack.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_header.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#ifdef __cplusplus</span>
-<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#endif</span>
-<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist * <a class="code" href="structlist.html">list</a>);
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_calib_create(cpl_plugin *);
-<a name="l00046"></a>00046 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_calib_exec(cpl_plugin *);
-<a name="l00047"></a>00047 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_calib_destroy(cpl_plugin *);
-<a name="l00048"></a>00048 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_calib(cpl_parameterlist *, cpl_frameset *);
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_calib_description[] =
-<a name="l00051"></a>00051 <span class="stringliteral">"This recipe is used to identify reference lines on LSS, MOS and MXU arc lamp\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"exposures, and trace the spectral edges on the corresponding flat field\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"exposures. This information is used to determine the spectral extraction\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"mask to be applied in the scientific data reduction, performed with the\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"recipe fors_science.\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. The input arc lamp and\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"flat field exposures are assumed to be obtained quasi-simultaneously, so\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"that they would be described by exactly the same instrument distortions.\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"A line catalog must be specified, containing the wavelengths of the\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"reference arc lamp lines used for the wavelength calibration. A grism\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"table (typically depending on the instrument mode, and in particular on\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"the grism used) may also be specified: this table contains a default\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"recipe parameter setting to control the way spectra are extracted for\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"a specific instrument mode, as it is used for automatic run of the\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"pipeline on Paranal and in Garching. If this table is specified, it\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"will modify the default recipe parameter setting, with the exception of\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"those parameters which have been explicitly modified on the command line.\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"If a grism table is not specified, the input recipe parameters values\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"will always be read from the command line, or from an esorex configuration\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"file if present, or from their generic default values (that are rarely\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"meaningful). Finally a master bias frame must be input to this recipe.\n"</span> 
-<a name="l00072"></a>00072 <span class="stringliteral">"In the table below the MXU acronym can be read alternatively as MOS\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"and LSS, with the exception of CURV_COEFF_LSS, CURV_TRACES_LSS,\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"SPATIAL_MAP_LSS, SPECTRA_DETECTION_LSS, and and SLIT_MAP_LSS, which are\n"</span> 
-<a name="l00075"></a>00075 <span class="stringliteral">"never created. The products SPECTRA_DETECTION_MXU, SLIT_MAP_MXU, and\n"</span> 
-<a name="l00076"></a>00076 <span class="stringliteral">"DISP_RESIDUALS_MXU, are just created if the --check parameter is set to\n"</span> 
-<a name="l00077"></a>00077 <span class="stringliteral">"true. The product GLOBAL_DISTORTION_TABLE is just created if more than 12\n"</span> 
-<a name="l00078"></a>00078 <span class="stringliteral">"separate spectra are found in the CCD.\n\n"</span>
-<a name="l00079"></a>00079 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00080"></a>00080 <span class="stringliteral">"  DO category:             Type:       Explanation:         Required:\n"</span>
-<a name="l00081"></a>00081 <span class="stringliteral">"  SCREEN_FLAT_MXU          Raw         Flat field exposures    Y\n"</span>
-<a name="l00082"></a>00082 <span class="stringliteral">"  LAMP_MXU                 Raw         Arc lamp exposure       Y\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"  MASTER_BIAS or BIAS      Calib       Bias frame              Y\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"  MASTER_LINECAT           Calib       Line catalog            Y\n"</span>
-<a name="l00085"></a>00085 <span class="stringliteral">"  GRISM_TABLE              Calib       Grism table             .\n\n"</span>
-<a name="l00086"></a>00086 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00087"></a>00087 <span class="stringliteral">"  DO category:             Data type:  Explanation:\n"</span>
-<a name="l00088"></a>00088 <span class="stringliteral">"  MASTER_SCREEN_FLAT_MXU   FITS image  Combined (sum) flat field\n"</span>
-<a name="l00089"></a>00089 <span class="stringliteral">"  MASTER_NORM_FLAT_MXU     FITS image  Normalised flat field\n"</span>
-<a name="l00090"></a>00090 <span class="stringliteral">"  MAPPED_SCREEN_FLAT_MXU   FITS image  Wavelength calibrated flat field\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"  MAPPED_NORM_FLAT_MXU     FITS image  Wavelength calibrated normalised flat\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"  REDUCED_LAMP_MXU         FITS image  Wavelength calibrated arc spectrum\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"  DISP_COEFF_MXU           FITS table  Inverse dispersion coefficients\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"  DISP_RESIDUALS_MXU       FITS image  Residuals in wavelength calibration\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"  DISP_RESIDUALS_TABLE_MXU FITS table  Residuals in wavelength calibration\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"  DELTA_IMAGE_MXU          FITS image  Offset vs linear wavelength calib\n"</span>
-<a name="l00097"></a>00097 <span class="stringliteral">"  WAVELENGTH_MAP_MXU       FITS image  Wavelength for each pixel on CCD\n"</span>
-<a name="l00098"></a>00098 <span class="stringliteral">"  SPECTRA_DETECTION_MXU    FITS image  Check for preliminary detection\n"</span>
-<a name="l00099"></a>00099 <span class="stringliteral">"  SLIT_MAP_MXU             FITS image  Map of central wavelength on CCD\n"</span>
-<a name="l00100"></a>00100 <span class="stringliteral">"  CURV_TRACES_MXU          FITS table  Spectral curvature traces\n"</span>
-<a name="l00101"></a>00101 <span class="stringliteral">"  CURV_COEFF_MXU           FITS table  Spectral curvature coefficients\n"</span>
-<a name="l00102"></a>00102 <span class="stringliteral">"  SPATIAL_MAP_MXU          FITS image  Spatial position along slit on CCD\n"</span>
-<a name="l00103"></a>00103 <span class="stringliteral">"  SPECTRAL_RESOLUTION_MXU  FITS table  Resolution at reference arc lines\n"</span>
-<a name="l00104"></a>00104 <span class="stringliteral">"  SLIT_LOCATION_MXU        FITS table  Slits on product frames and CCD\n"</span>
-<a name="l00105"></a>00105 <span class="stringliteral">"  GLOBAL_DISTORTION_TABLE  FITS table  Global distortions table\n\n"</span>;
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107 <span class="preprocessor">#define fors_calib_exit(message)                      \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">{                                                     \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">if (message != NULL ) cpl_msg_error(recipe, message);  \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">cpl_free(instrume);                                   \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">cpl_free(pipefile);                                   \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">cpl_free(fiterror);                                   \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">cpl_free(fitlines);                                   \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">cpl_image_delete(bias);                               \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">cpl_image_delete(master_bias);                        \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">cpl_image_delete(coordinate);                         \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">cpl_image_delete(checkwave);                          \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">cpl_image_delete(flat);                               \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">cpl_image_delete(master_flat);                        \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">cpl_image_delete(added_flat);                         \</span>
-<a name="l00121"></a>00121 <span class="preprocessor">cpl_image_delete(norm_flat);                          \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">cpl_image_delete(rainbow);                            \</span>
-<a name="l00123"></a>00123 <span class="preprocessor">cpl_image_delete(rectified);                          \</span>
-<a name="l00124"></a>00124 <span class="preprocessor">cpl_image_delete(residual);                           \</span>
-<a name="l00125"></a>00125 <span class="preprocessor">cpl_image_delete(smo_flat);                           \</span>
-<a name="l00126"></a>00126 <span class="preprocessor">cpl_image_delete(spatial);                            \</span>
-<a name="l00127"></a>00127 <span class="preprocessor">cpl_image_delete(spectra);                            \</span>
-<a name="l00128"></a>00128 <span class="preprocessor">cpl_image_delete(wavemap);                            \</span>
-<a name="l00129"></a>00129 <span class="preprocessor">cpl_image_delete(delta);                              \</span>
-<a name="l00130"></a>00130 <span class="preprocessor">cpl_image_delete(rect_flat);                          \</span>
-<a name="l00131"></a>00131 <span class="preprocessor">cpl_image_delete(rect_nflat);                         \</span>
-<a name="l00132"></a>00132 <span class="preprocessor">cpl_image_delete(mapped_flat);                        \</span>
-<a name="l00133"></a>00133 <span class="preprocessor">cpl_image_delete(mapped_nflat);                       \</span>
-<a name="l00134"></a>00134 <span class="preprocessor">cpl_mask_delete(refmask);                             \</span>
-<a name="l00135"></a>00135 <span class="preprocessor">cpl_propertylist_delete(header);                      \</span>
-<a name="l00136"></a>00136 <span class="preprocessor">cpl_propertylist_delete(save_header);                 \</span>
-<a name="l00137"></a>00137 <span class="preprocessor">cpl_propertylist_delete(qclist);                      \</span>
-<a name="l00138"></a>00138 <span class="preprocessor">cpl_table_delete(grism_table);                        \</span>
-<a name="l00139"></a>00139 <span class="preprocessor">cpl_table_delete(idscoeff);                           \</span>
-<a name="l00140"></a>00140 <span class="preprocessor">cpl_table_delete(idscoeff_all);                       \</span>
-<a name="l00141"></a>00141 <span class="preprocessor">cpl_table_delete(restable);                           \</span>
-<a name="l00142"></a>00142 <span class="preprocessor">cpl_table_delete(maskslits);                          \</span>
-<a name="l00143"></a>00143 <span class="preprocessor">cpl_table_delete(overscans);                          \</span>
-<a name="l00144"></a>00144 <span class="preprocessor">cpl_table_delete(traces);                             \</span>
-<a name="l00145"></a>00145 <span class="preprocessor">cpl_table_delete(polytraces);                         \</span>
-<a name="l00146"></a>00146 <span class="preprocessor">cpl_table_delete(slits);                              \</span>
-<a name="l00147"></a>00147 <span class="preprocessor">cpl_table_delete(restab);                             \</span>
-<a name="l00148"></a>00148 <span class="preprocessor">cpl_table_delete(global);                             \</span>
-<a name="l00149"></a>00149 <span class="preprocessor">cpl_table_delete(wavelengths);                        \</span>
-<a name="l00150"></a>00150 <span class="preprocessor">cpl_vector_delete(lines);                             \</span>
-<a name="l00151"></a>00151 <span class="preprocessor">cpl_msg_indent_less();                                \</span>
-<a name="l00152"></a>00152 <span class="preprocessor">return -1;                                            \</span>
-<a name="l00153"></a>00153 <span class="preprocessor">}</span>
-<a name="l00154"></a>00154 <span class="preprocessor"></span>
-<a name="l00155"></a>00155 <span class="preprocessor">#define fors_calib_exit_memcheck(message)              \</span>
-<a name="l00156"></a>00156 <span class="preprocessor">{                                                      \</span>
-<a name="l00157"></a>00157 <span class="preprocessor">if (message !=NULL ) cpl_msg_info(recipe, message);    \</span>
-<a name="l00158"></a>00158 <span class="preprocessor">printf("free instrume (%p)\n", instrume);              \</span>
-<a name="l00159"></a>00159 <span class="preprocessor">cpl_free(instrume);                                    \</span>
-<a name="l00160"></a>00160 <span class="preprocessor">printf("free pipefile (%p)\n", pipefile);              \</span>
-<a name="l00161"></a>00161 <span class="preprocessor">cpl_free(pipefile);                                    \</span>
-<a name="l00162"></a>00162 <span class="preprocessor">printf("free fiterror (%p)\n", fiterror);              \</span>
-<a name="l00163"></a>00163 <span class="preprocessor">cpl_free(fiterror);                                    \</span>
-<a name="l00164"></a>00164 <span class="preprocessor">printf("free fitlines (%p)\n", fitlines);              \</span>
-<a name="l00165"></a>00165 <span class="preprocessor">cpl_free(fitlines);                                    \</span>
-<a name="l00166"></a>00166 <span class="preprocessor">printf("free bias (%p)\n", bias);                      \</span>
-<a name="l00167"></a>00167 <span class="preprocessor">cpl_image_delete(bias);                                \</span>
-<a name="l00168"></a>00168 <span class="preprocessor">printf("free master_bias (%p)\n", master_bias);        \</span>
-<a name="l00169"></a>00169 <span class="preprocessor">cpl_image_delete(master_bias);                         \</span>
-<a name="l00170"></a>00170 <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);          \</span>
-<a name="l00171"></a>00171 <span class="preprocessor">cpl_image_delete(coordinate);                          \</span>
-<a name="l00172"></a>00172 <span class="preprocessor">printf("free checkwave (%p)\n", checkwave);            \</span>
-<a name="l00173"></a>00173 <span class="preprocessor">cpl_image_delete(checkwave);                           \</span>
-<a name="l00174"></a>00174 <span class="preprocessor">printf("free flat (%p)\n", flat);                      \</span>
-<a name="l00175"></a>00175 <span class="preprocessor">cpl_image_delete(flat);                                \</span>
-<a name="l00176"></a>00176 <span class="preprocessor">printf("free master_flat (%p)\n", master_flat);        \</span>
-<a name="l00177"></a>00177 <span class="preprocessor">cpl_image_delete(master_flat);                         \</span>
-<a name="l00178"></a>00178 <span class="preprocessor">printf("free norm_flat (%p)\n", norm_flat);            \</span>
-<a name="l00179"></a>00179 <span class="preprocessor">cpl_image_delete(norm_flat);                           \</span>
-<a name="l00180"></a>00180 <span class="preprocessor">printf("free mapped_flat (%p)\n", mapped_flat);        \</span>
-<a name="l00181"></a>00181 <span class="preprocessor">cpl_image_delete(mapped_flat);                         \</span>
-<a name="l00182"></a>00182 <span class="preprocessor">printf("free mapped_nflat (%p)\n", mapped_nflat);      \</span>
-<a name="l00183"></a>00183 <span class="preprocessor">cpl_image_delete(mapped_nflat);                        \</span>
-<a name="l00184"></a>00184 <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);                \</span>
-<a name="l00185"></a>00185 <span class="preprocessor">cpl_image_delete(rainbow);                             \</span>
-<a name="l00186"></a>00186 <span class="preprocessor">printf("free rectified (%p)\n", rectified);            \</span>
-<a name="l00187"></a>00187 <span class="preprocessor">cpl_image_delete(rectified);                           \</span>
-<a name="l00188"></a>00188 <span class="preprocessor">printf("free residual (%p)\n", residual);              \</span>
-<a name="l00189"></a>00189 <span class="preprocessor">cpl_image_delete(residual);                            \</span>
-<a name="l00190"></a>00190 <span class="preprocessor">printf("free smo_flat (%p)\n", smo_flat);              \</span>
-<a name="l00191"></a>00191 <span class="preprocessor">cpl_image_delete(smo_flat);                            \</span>
-<a name="l00192"></a>00192 <span class="preprocessor">printf("free spatial (%p)\n", spatial);                \</span>
-<a name="l00193"></a>00193 <span class="preprocessor">cpl_image_delete(spatial);                             \</span>
-<a name="l00194"></a>00194 <span class="preprocessor">printf("free spectra (%p)\n", spectra);                \</span>
-<a name="l00195"></a>00195 <span class="preprocessor">cpl_image_delete(spectra);                             \</span>
-<a name="l00196"></a>00196 <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);                \</span>
-<a name="l00197"></a>00197 <span class="preprocessor">cpl_image_delete(wavemap);                             \</span>
-<a name="l00198"></a>00198 <span class="preprocessor">printf("free delta (%p)\n", delta);                    \</span>
-<a name="l00199"></a>00199 <span class="preprocessor">cpl_image_delete(delta);                               \</span>
-<a name="l00200"></a>00200 <span class="preprocessor">printf("free rect_flat (%p)\n", rect_flat);            \</span>
-<a name="l00201"></a>00201 <span class="preprocessor">cpl_image_delete(rect_flat);                           \</span>
-<a name="l00202"></a>00202 <span class="preprocessor">printf("free rect_nflat (%p)\n", rect_nflat);          \</span>
-<a name="l00203"></a>00203 <span class="preprocessor">cpl_image_delete(rect_nflat);                          \</span>
-<a name="l00204"></a>00204 <span class="preprocessor">printf("free refmask (%p)\n", refmask);                \</span>
-<a name="l00205"></a>00205 <span class="preprocessor">cpl_mask_delete(refmask);                              \</span>
-<a name="l00206"></a>00206 <span class="preprocessor">printf("free header (%p)\n", header);                  \</span>
-<a name="l00207"></a>00207 <span class="preprocessor">cpl_propertylist_delete(header);                       \</span>
-<a name="l00208"></a>00208 <span class="preprocessor">printf("free save_header (%p)\n", save_header);        \</span>
-<a name="l00209"></a>00209 <span class="preprocessor">cpl_propertylist_delete(save_header);                  \</span>
-<a name="l00210"></a>00210 <span class="preprocessor">printf("free qclist (%p)\n", qclist);                  \</span>
-<a name="l00211"></a>00211 <span class="preprocessor">cpl_propertylist_delete(qclist);                       \</span>
-<a name="l00212"></a>00212 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table);        \</span>
-<a name="l00213"></a>00213 <span class="preprocessor">cpl_table_delete(grism_table);                         \</span>
-<a name="l00214"></a>00214 <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);              \</span>
-<a name="l00215"></a>00215 <span class="preprocessor">cpl_table_delete(idscoeff);                            \</span>
-<a name="l00216"></a>00216 <span class="preprocessor">printf("free idscoeff_all (%p)\n", idscoeff_all);      \</span>
-<a name="l00217"></a>00217 <span class="preprocessor">cpl_table_delete(idscoeff_all);                        \</span>
-<a name="l00218"></a>00218 <span class="preprocessor">printf("free restable (%p)\n", restable);              \</span>
-<a name="l00219"></a>00219 <span class="preprocessor">cpl_table_delete(restable);                            \</span>
-<a name="l00220"></a>00220 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);            \</span>
-<a name="l00221"></a>00221 <span class="preprocessor">cpl_table_delete(maskslits);                           \</span>
-<a name="l00222"></a>00222 <span class="preprocessor">printf("free overscans (%p)\n", overscans);            \</span>
-<a name="l00223"></a>00223 <span class="preprocessor">cpl_table_delete(overscans);                           \</span>
-<a name="l00224"></a>00224 <span class="preprocessor">printf("free traces (%p)\n", traces);                  \</span>
-<a name="l00225"></a>00225 <span class="preprocessor">cpl_table_delete(traces);                              \</span>
-<a name="l00226"></a>00226 <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);          \</span>
-<a name="l00227"></a>00227 <span class="preprocessor">cpl_table_delete(polytraces);                          \</span>
-<a name="l00228"></a>00228 <span class="preprocessor">printf("free slits (%p)\n", slits);                    \</span>
-<a name="l00229"></a>00229 <span class="preprocessor">cpl_table_delete(slits);                               \</span>
-<a name="l00230"></a>00230 <span class="preprocessor">printf("free restab (%p)\n", restab);                  \</span>
-<a name="l00231"></a>00231 <span class="preprocessor">cpl_table_delete(restab);                              \</span>
-<a name="l00232"></a>00232 <span class="preprocessor">printf("free global (%p)\n", global);                  \</span>
-<a name="l00233"></a>00233 <span class="preprocessor">cpl_table_delete(global);                              \</span>
-<a name="l00234"></a>00234 <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths);        \</span>
-<a name="l00235"></a>00235 <span class="preprocessor">cpl_table_delete(wavelengths);                         \</span>
-<a name="l00236"></a>00236 <span class="preprocessor">printf("free lines (%p)\n", lines);                    \</span>
-<a name="l00237"></a>00237 <span class="preprocessor">cpl_vector_delete(lines);                              \</span>
-<a name="l00238"></a>00238 <span class="preprocessor">cpl_msg_indent_less();                                 \</span>
-<a name="l00239"></a>00239 <span class="preprocessor">return 0;                                              \</span>
-<a name="l00240"></a>00240 <span class="preprocessor">}</span>
-<a name="l00241"></a>00241 <span class="preprocessor"></span>
-<a name="l00242"></a>00242 
-<a name="l00254"></a>00254 <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00255"></a>00255 {
-<a name="l00256"></a>00256     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00257"></a>00257     cpl_plugin *plugin = &recipe->interface;
-<a name="l00258"></a>00258 
-<a name="l00259"></a>00259     cpl_plugin_init(plugin,
-<a name="l00260"></a>00260                     CPL_PLUGIN_API,
-<a name="l00261"></a>00261                     FORS_BINARY_VERSION,
-<a name="l00262"></a>00262                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00263"></a>00263                     <span class="stringliteral">"fors_calib"</span>,
-<a name="l00264"></a>00264                     <span class="stringliteral">"Determination of the extraction mask"</span>,
-<a name="l00265"></a>00265                     fors_calib_description,
-<a name="l00266"></a>00266                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00267"></a>00267                     PACKAGE_BUGREPORT,
-<a name="l00268"></a>00268     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00269"></a>00269     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00270"></a>00270     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00271"></a>00271     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00272"></a>00272     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00273"></a>00273     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00274"></a>00274     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00275"></a>00275     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00276"></a>00276     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00277"></a>00277     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00278"></a>00278     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00279"></a>00279     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00280"></a>00280     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00281"></a>00281                     fors_calib_create,
-<a name="l00282"></a>00282                     fors_calib_exec,
-<a name="l00283"></a>00283                     fors_calib_destroy);
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285     cpl_pluginlist_append(list, plugin);
-<a name="l00286"></a>00286     
-<a name="l00287"></a>00287     <span class="keywordflow">return</span> 0;
-<a name="l00288"></a>00288 }
-<a name="l00289"></a>00289 
-<a name="l00290"></a>00290 
-<a name="l00301"></a>00301 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_calib_create(cpl_plugin *plugin)
-<a name="l00302"></a>00302 {
-<a name="l00303"></a>00303     cpl_recipe    *recipe;
-<a name="l00304"></a>00304     cpl_parameter *p;
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306 
-<a name="l00307"></a>00307     <span class="comment">/* </span>
-<a name="l00308"></a>00308 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00309"></a>00309 <span class="comment">     */</span>
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00312"></a>00312         recipe = (cpl_recipe *)plugin;
-<a name="l00313"></a>00313     <span class="keywordflow">else</span> 
-<a name="l00314"></a>00314         <span class="keywordflow">return</span> -1;
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     <span class="comment">/* </span>
-<a name="l00317"></a>00317 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00318"></a>00318 <span class="comment">     */</span>
-<a name="l00319"></a>00319 
-<a name="l00320"></a>00320     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322 
-<a name="l00323"></a>00323     <span class="comment">/*</span>
-<a name="l00324"></a>00324 <span class="comment">     * Dispersion</span>
-<a name="l00325"></a>00325 <span class="comment">     */</span>
-<a name="l00326"></a>00326 
-<a name="l00327"></a>00327     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.dispersion"</span>,
-<a name="l00328"></a>00328                                 CPL_TYPE_DOUBLE,
-<a name="l00329"></a>00329                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00330"></a>00330                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00331"></a>00331                                 0.0);
-<a name="l00332"></a>00332     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00333"></a>00333     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00334"></a>00334     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00335"></a>00335 
-<a name="l00336"></a>00336     <span class="comment">/*</span>
-<a name="l00337"></a>00337 <span class="comment">     * Peak detection level</span>
-<a name="l00338"></a>00338 <span class="comment">     */</span>
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.peakdetection"</span>,
-<a name="l00341"></a>00341                                 CPL_TYPE_DOUBLE,
-<a name="l00342"></a>00342                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,
-<a name="l00343"></a>00343                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00344"></a>00344                                 0.0);
-<a name="l00345"></a>00345     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);
-<a name="l00346"></a>00346     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00347"></a>00347     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349     <span class="comment">/* </span>
-<a name="l00350"></a>00350 <span class="comment">     * Degree of wavelength calibration polynomial</span>
-<a name="l00351"></a>00351 <span class="comment">     */</span>
-<a name="l00352"></a>00352 
-<a name="l00353"></a>00353     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.wdegree"</span>,
-<a name="l00354"></a>00354                                 CPL_TYPE_INT,
-<a name="l00355"></a>00355                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,
-<a name="l00356"></a>00356                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00357"></a>00357                                 0);
-<a name="l00358"></a>00358     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);
-<a name="l00359"></a>00359     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00360"></a>00360     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00361"></a>00361 
-<a name="l00362"></a>00362     <span class="comment">/*</span>
-<a name="l00363"></a>00363 <span class="comment">     * Reference lines search radius</span>
-<a name="l00364"></a>00364 <span class="comment">     */</span>
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.wradius"</span>,
-<a name="l00367"></a>00367                                 CPL_TYPE_INT,
-<a name="l00368"></a>00368                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span>
-<a name="l00369"></a>00369                                 <span class="stringliteral">"with first-guess method"</span>,
-<a name="l00370"></a>00370                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00371"></a>00371                                 4);
-<a name="l00372"></a>00372     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);
-<a name="l00373"></a>00373     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00374"></a>00374     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     <span class="comment">/*</span>
-<a name="l00377"></a>00377 <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span>
-<a name="l00378"></a>00378 <span class="comment">     */</span>
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.wreject"</span>,
-<a name="l00381"></a>00381                                 CPL_TYPE_DOUBLE,
-<a name="l00382"></a>00382                                 <span class="stringliteral">"Rejection threshold in dispersion "</span>
-<a name="l00383"></a>00383                                 <span class="stringliteral">"relation fit (pixel)"</span>,
-<a name="l00384"></a>00384                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00385"></a>00385                                 0.7);
-<a name="l00386"></a>00386     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);
-<a name="l00387"></a>00387     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00388"></a>00388     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390     <span class="comment">/*</span>
-<a name="l00391"></a>00391 <span class="comment">     * Wavelength solution interpolation (for LSS data)</span>
-<a name="l00392"></a>00392 <span class="comment">     */</span>
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.wmode"</span>,
-<a name="l00395"></a>00395                                 CPL_TYPE_INT,
-<a name="l00396"></a>00396                                 <span class="stringliteral">"Interpolation mode of wavelength solution "</span>
-<a name="l00397"></a>00397                                 <span class="stringliteral">"applicable to LSS-like data (0 = no "</span>
-<a name="l00398"></a>00398                                 <span class="stringliteral">"interpolation, 1 = fill gaps, 2 = global "</span>
-<a name="l00399"></a>00399                                 <span class="stringliteral">"model)"</span>,
-<a name="l00400"></a>00400                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00401"></a>00401                                 2);
-<a name="l00402"></a>00402     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wmode"</span>);
-<a name="l00403"></a>00403     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00404"></a>00404     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00405"></a>00405 
-<a name="l00406"></a>00406     <span class="comment">/*</span>
-<a name="l00407"></a>00407 <span class="comment">     * Wavelength solution interpolation (for MOS data)</span>
-<a name="l00408"></a>00408 <span class="comment">     */</span>
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.wmosmode"</span>,
-<a name="l00411"></a>00411                                 CPL_TYPE_INT,
-<a name="l00412"></a>00412                                 <span class="stringliteral">"Interpolation mode of wavelength solution "</span>
-<a name="l00413"></a>00413                                 <span class="stringliteral">"(0 = no interpolation, 1 = local (slit) "</span>
-<a name="l00414"></a>00414                                 <span class="stringliteral">"solution, 2 = global model)"</span>,
-<a name="l00415"></a>00415                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00416"></a>00416                                 0);
-<a name="l00417"></a>00417     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wmosmode"</span>);
-<a name="l00418"></a>00418     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00419"></a>00419     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00420"></a>00420 
-<a name="l00421"></a>00421     <span class="comment">/*</span>
-<a name="l00422"></a>00422 <span class="comment">     * Line catalog table column containing the reference wavelengths</span>
-<a name="l00423"></a>00423 <span class="comment">     */</span>
-<a name="l00424"></a>00424 
-<a name="l00425"></a>00425     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.wcolumn"</span>,
-<a name="l00426"></a>00426                                 CPL_TYPE_STRING,
-<a name="l00427"></a>00427                                 <span class="stringliteral">"Name of line catalog table column "</span>
-<a name="l00428"></a>00428                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00429"></a>00429                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00430"></a>00430                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00431"></a>00431     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00432"></a>00432     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00433"></a>00433     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435     <span class="comment">/*</span>
-<a name="l00436"></a>00436 <span class="comment">     * Degree of spectral curvature polynomial</span>
-<a name="l00437"></a>00437 <span class="comment">     */</span>
-<a name="l00438"></a>00438 
-<a name="l00439"></a>00439     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.cdegree"</span>,
-<a name="l00440"></a>00440                                 CPL_TYPE_INT,
-<a name="l00441"></a>00441                                 <span class="stringliteral">"Degree of spectral curvature polynomial"</span>,
-<a name="l00442"></a>00442                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00443"></a>00443                                 0);
-<a name="l00444"></a>00444     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cdegree"</span>);
-<a name="l00445"></a>00445     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00446"></a>00446     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00447"></a>00447 
-<a name="l00448"></a>00448     <span class="comment">/*</span>
-<a name="l00449"></a>00449 <span class="comment">     * Curvature solution interpolation (for MOS-like data)</span>
-<a name="l00450"></a>00450 <span class="comment">     */</span>
-<a name="l00451"></a>00451  
-<a name="l00452"></a>00452     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.cmode"</span>,
-<a name="l00453"></a>00453                                 CPL_TYPE_INT,
-<a name="l00454"></a>00454                                 <span class="stringliteral">"Interpolation mode of curvature solution "</span>
-<a name="l00455"></a>00455                                 <span class="stringliteral">"applicable to MOS-like data (0 = no "</span>
-<a name="l00456"></a>00456                                 <span class="stringliteral">"interpolation, 1 = fill gaps, 2 = global "</span>
-<a name="l00457"></a>00457                                 <span class="stringliteral">"model)"</span>,
-<a name="l00458"></a>00458                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00459"></a>00459                                 1);
-<a name="l00460"></a>00460     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cmode"</span>);
-<a name="l00461"></a>00461     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00462"></a>00462     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     <span class="comment">/*</span>
-<a name="l00465"></a>00465 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00466"></a>00466 <span class="comment">     */</span>
-<a name="l00467"></a>00467 
-<a name="l00468"></a>00468     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.startwavelength"</span>,
-<a name="l00469"></a>00469                                 CPL_TYPE_DOUBLE,
-<a name="l00470"></a>00470                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00471"></a>00471                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00472"></a>00472                                 0.0);
-<a name="l00473"></a>00473     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00474"></a>00474     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00475"></a>00475     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00476"></a>00476 
-<a name="l00477"></a>00477     <span class="comment">/*</span>
-<a name="l00478"></a>00478 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00479"></a>00479 <span class="comment">     */</span>
-<a name="l00480"></a>00480 
-<a name="l00481"></a>00481     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.endwavelength"</span>,
-<a name="l00482"></a>00482                                 CPL_TYPE_DOUBLE,
-<a name="l00483"></a>00483                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00484"></a>00484                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00485"></a>00485                                 0.0);
-<a name="l00486"></a>00486     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00487"></a>00487     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00488"></a>00488     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00489"></a>00489 
-<a name="l00490"></a>00490     <span class="comment">/*</span>
-<a name="l00491"></a>00491 <span class="comment">     * Try slit identification</span>
-<a name="l00492"></a>00492 <span class="comment">     */</span>
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.slit_ident"</span>,
-<a name="l00495"></a>00495                                 CPL_TYPE_BOOL,
-<a name="l00496"></a>00496                                 <span class="stringliteral">"Attempt slit identification for MOS or MXU"</span>,
-<a name="l00497"></a>00497                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00498"></a>00498                                 TRUE);
-<a name="l00499"></a>00499     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_ident"</span>);
-<a name="l00500"></a>00500     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00501"></a>00501     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00502"></a>00502 
-<a name="l00503"></a>00503     <span class="comment">/*</span>
-<a name="l00504"></a>00504 <span class="comment">     * Flat field frames stack parameters</span>
-<a name="l00505"></a>00505 <span class="comment">     */</span>
-<a name="l00506"></a>00506 
-<a name="l00507"></a>00507     <a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a>(recipe->parameters, <span class="stringliteral">"fors.fors_calib"</span>, 
-<a name="l00508"></a>00508                                  <span class="stringliteral">"average"</span>);
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510     <span class="comment">/*</span>
-<a name="l00511"></a>00511 <span class="comment">     * Degree of flat field fitting polynomial along spatial direction </span>
-<a name="l00512"></a>00512 <span class="comment">     * (used for LSS data)</span>
-<a name="l00513"></a>00513 <span class="comment">     */</span>
-<a name="l00514"></a>00514 
-<a name="l00515"></a>00515     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.sdegree"</span>,
-<a name="l00516"></a>00516                                 CPL_TYPE_INT,
-<a name="l00517"></a>00517                                 <span class="stringliteral">"Degree of flat field fitting polynomial "</span>
-<a name="l00518"></a>00518                                 <span class="stringliteral">"along spatial direction (used for LSS "</span>
-<a name="l00519"></a>00519                                 <span class="stringliteral">"data only)"</span>,
-<a name="l00520"></a>00520                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00521"></a>00521                                 4);
-<a name="l00522"></a>00522     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sdegree"</span>);
-<a name="l00523"></a>00523     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00524"></a>00524     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526     <span class="comment">/*</span>
-<a name="l00527"></a>00527 <span class="comment">     * Degree of flat field fitting polynomial along dispersion direction</span>
-<a name="l00528"></a>00528 <span class="comment">     * (used for MOS and MXU data)</span>
-<a name="l00529"></a>00529 <span class="comment">     */</span>
-<a name="l00530"></a>00530 
-<a name="l00531"></a>00531     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.ddegree"</span>,
-<a name="l00532"></a>00532                                 CPL_TYPE_INT,
-<a name="l00533"></a>00533                                 <span class="stringliteral">"Degree of flat field fitting polynomial "</span>
-<a name="l00534"></a>00534                                 <span class="stringliteral">"along dispersion direction (used for MOS "</span>
-<a name="l00535"></a>00535                                 <span class="stringliteral">"and MXU data only)"</span>,
-<a name="l00536"></a>00536                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00537"></a>00537                                 -1);
-<a name="l00538"></a>00538     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ddegree"</span>);
-<a name="l00539"></a>00539     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00540"></a>00540     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542     <span class="comment">/*</span>
-<a name="l00543"></a>00543 <span class="comment">     * Smooth box radius for flat field along dispersion direction</span>
-<a name="l00544"></a>00544 <span class="comment">     */</span>
-<a name="l00545"></a>00545 
-<a name="l00546"></a>00546     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.dradius"</span>,
-<a name="l00547"></a>00547                                 CPL_TYPE_INT,
-<a name="l00548"></a>00548                                 <span class="stringliteral">"Smooth box radius for flat field along "</span>
-<a name="l00549"></a>00549                                 <span class="stringliteral">"dispersion direction"</span>,
-<a name="l00550"></a>00550                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00551"></a>00551                                 10);
-<a name="l00552"></a>00552     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dradius"</span>);
-<a name="l00553"></a>00553     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00554"></a>00554     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00555"></a>00555 
-<a name="l00556"></a>00556     <span class="comment">/*</span>
-<a name="l00557"></a>00557 <span class="comment">     * Smooth box radius for flat field along spatial direction</span>
-<a name="l00558"></a>00558 <span class="comment">     * (used for LSS data only)</span>
-<a name="l00559"></a>00559 <span class="comment">     */</span>
-<a name="l00560"></a>00560 
-<a name="l00561"></a>00561     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.sradius"</span>,
-<a name="l00562"></a>00562                                 CPL_TYPE_INT,
-<a name="l00563"></a>00563                                 <span class="stringliteral">"Smooth box radius for flat field along "</span>
-<a name="l00564"></a>00564                                 <span class="stringliteral">"spatial direction"</span>,
-<a name="l00565"></a>00565                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00566"></a>00566                                 10);
-<a name="l00567"></a>00567     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sradius"</span>);
-<a name="l00568"></a>00568     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00569"></a>00569     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00570"></a>00570 
-<a name="l00571"></a>00571     <span class="comment">/*</span>
-<a name="l00572"></a>00572 <span class="comment">     * Computation of QC1 parameters</span>
-<a name="l00573"></a>00573 <span class="comment">     */</span>
-<a name="l00574"></a>00574 
-<a name="l00575"></a>00575     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.qc"</span>,
-<a name="l00576"></a>00576                                 CPL_TYPE_BOOL,
-<a name="l00577"></a>00577                                 <span class="stringliteral">"Compute QC1 parameters"</span>,
-<a name="l00578"></a>00578                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00579"></a>00579                                 TRUE);
-<a name="l00580"></a>00580     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"qc"</span>);
-<a name="l00581"></a>00581     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00582"></a>00582     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584     <span class="comment">/*</span>
-<a name="l00585"></a>00585 <span class="comment">     * Create check products</span>
-<a name="l00586"></a>00586 <span class="comment">     */</span>
-<a name="l00587"></a>00587 
-<a name="l00588"></a>00588     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_calib.check"</span>,
-<a name="l00589"></a>00589                                 CPL_TYPE_BOOL,
-<a name="l00590"></a>00590                                 <span class="stringliteral">"Create intermediate products"</span>,
-<a name="l00591"></a>00591                                 <span class="stringliteral">"fors.fors_calib"</span>,
-<a name="l00592"></a>00592                                 FALSE);
-<a name="l00593"></a>00593     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"check"</span>);
-<a name="l00594"></a>00594     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00595"></a>00595     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00596"></a>00596 
-<a name="l00597"></a>00597     <span class="keywordflow">return</span> 0;
-<a name="l00598"></a>00598 }
-<a name="l00599"></a>00599 
-<a name="l00600"></a>00600 
-<a name="l00609"></a>00609 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_calib_exec(cpl_plugin *plugin)
-<a name="l00610"></a>00610 {
-<a name="l00611"></a>00611     cpl_recipe *recipe;
-<a name="l00612"></a>00612     
-<a name="l00613"></a>00613     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00614"></a>00614         recipe = (cpl_recipe *)plugin;
-<a name="l00615"></a>00615     <span class="keywordflow">else</span> 
-<a name="l00616"></a>00616         <span class="keywordflow">return</span> -1;
-<a name="l00617"></a>00617 
-<a name="l00618"></a>00618     <span class="keywordflow">return</span> fors_calib(recipe->parameters, recipe->frames);
-<a name="l00619"></a>00619 }
-<a name="l00620"></a>00620 
-<a name="l00621"></a>00621 
-<a name="l00630"></a>00630 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_calib_destroy(cpl_plugin *plugin)
-<a name="l00631"></a>00631 {
-<a name="l00632"></a>00632     cpl_recipe *recipe;
-<a name="l00633"></a>00633     
-<a name="l00634"></a>00634     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00635"></a>00635         recipe = (cpl_recipe *)plugin;
-<a name="l00636"></a>00636     <span class="keywordflow">else</span> 
-<a name="l00637"></a>00637         <span class="keywordflow">return</span> -1;
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641     <span class="keywordflow">return</span> 0;
-<a name="l00642"></a>00642 }
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644 
-<a name="l00654"></a>00654 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00655"></a>00655 {
-<a name="l00656"></a>00656 
-<a name="l00657"></a>00657     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_calib"</span>;
-<a name="l00658"></a>00658 
-<a name="l00659"></a>00659 
-<a name="l00660"></a>00660     <span class="comment">/*</span>
-<a name="l00661"></a>00661 <span class="comment">     * Input parameters</span>
-<a name="l00662"></a>00662 <span class="comment">     */</span>
-<a name="l00663"></a>00663 
-<a name="l00664"></a>00664     <span class="keywordtype">double</span>        dispersion;
-<a name="l00665"></a>00665     <span class="keywordtype">double</span>        peakdetection;
-<a name="l00666"></a>00666     <span class="keywordtype">int</span>           wdegree;
-<a name="l00667"></a>00667     <span class="keywordtype">int</span>           wradius;
-<a name="l00668"></a>00668     <span class="keywordtype">double</span>        wreject;
-<a name="l00669"></a>00669     <span class="keywordtype">int</span>           wmode;
-<a name="l00670"></a>00670     <span class="keywordtype">int</span>           wmosmode;
-<a name="l00671"></a>00671     <span class="keyword">const</span> <span class="keywordtype">char</span>   *wcolumn;
-<a name="l00672"></a>00672     <span class="keywordtype">int</span>           cdegree;
-<a name="l00673"></a>00673     <span class="keywordtype">int</span>           cmode;
-<a name="l00674"></a>00674     <span class="keywordtype">double</span>        startwavelength;
-<a name="l00675"></a>00675     <span class="keywordtype">double</span>        endwavelength;
-<a name="l00676"></a>00676     <span class="keywordtype">int</span>           slit_ident;
-<a name="l00677"></a>00677     <span class="keywordtype">int</span>           sdegree;
-<a name="l00678"></a>00678     <span class="keywordtype">int</span>           ddegree;
-<a name="l00679"></a>00679     <span class="keywordtype">int</span>           sradius;
-<a name="l00680"></a>00680     <span class="keywordtype">int</span>           dradius;
-<a name="l00681"></a>00681     <span class="keywordtype">int</span>           qc;
-<a name="l00682"></a>00682     <span class="keywordtype">int</span>           check;
-<a name="l00683"></a>00683     <span class="keyword">const</span> <span class="keywordtype">char</span>   *stack_method;
-<a name="l00684"></a>00684     <span class="keywordtype">int</span>           min_reject;
-<a name="l00685"></a>00685     <span class="keywordtype">int</span>           max_reject;
-<a name="l00686"></a>00686     <span class="keywordtype">double</span>        klow;
-<a name="l00687"></a>00687     <span class="keywordtype">double</span>        khigh;
-<a name="l00688"></a>00688     <span class="keywordtype">int</span>           kiter;
-<a name="l00689"></a>00689 
-<a name="l00690"></a>00690     <span class="comment">/*</span>
-<a name="l00691"></a>00691 <span class="comment">     * CPL objects</span>
-<a name="l00692"></a>00692 <span class="comment">     */</span>
-<a name="l00693"></a>00693 
-<a name="l00694"></a>00694     cpl_imagelist    *biases       = NULL;
-<a name="l00695"></a>00695     cpl_image        *bias         = NULL;
-<a name="l00696"></a>00696     cpl_image        *master_bias  = NULL;
-<a name="l00697"></a>00697     cpl_image        *multi_bias   = NULL;
-<a name="l00698"></a>00698     cpl_image        *flat         = NULL;
-<a name="l00699"></a>00699     cpl_image        *master_flat  = NULL;
-<a name="l00700"></a>00700     cpl_image        *added_flat   = NULL;
-<a name="l00701"></a>00701     cpl_image        *trace_flat   = NULL;
-<a name="l00702"></a>00702     cpl_image        *smo_flat     = NULL;
-<a name="l00703"></a>00703     cpl_image        *norm_flat    = NULL;
-<a name="l00704"></a>00704     cpl_image        *spectra      = NULL;
-<a name="l00705"></a>00705     cpl_image        *wavemap      = NULL;
-<a name="l00706"></a>00706     cpl_image        *delta        = NULL;
-<a name="l00707"></a>00707     cpl_image        *residual     = NULL;
-<a name="l00708"></a>00708     cpl_image        *checkwave    = NULL;
-<a name="l00709"></a>00709     cpl_image        *rectified    = NULL;
-<a name="l00710"></a>00710     cpl_image        *dummy        = NULL;
-<a name="l00711"></a>00711     cpl_image        *add_dummy    = NULL;
-<a name="l00712"></a>00712     cpl_image        *refimage     = NULL;
-<a name="l00713"></a>00713     cpl_image        *coordinate   = NULL;
-<a name="l00714"></a>00714     cpl_image        *rainbow      = NULL;
-<a name="l00715"></a>00715     cpl_image        *spatial      = NULL;
-<a name="l00716"></a>00716     cpl_image        *rect_flat    = NULL;
-<a name="l00717"></a>00717     cpl_image        *rect_nflat   = NULL;
-<a name="l00718"></a>00718     cpl_image        *mapped_flat  = NULL;
-<a name="l00719"></a>00719     cpl_image        *mapped_nflat = NULL;
-<a name="l00720"></a>00720 
-<a name="l00721"></a>00721     cpl_mask         *refmask      = NULL;
-<a name="l00722"></a>00722 
-<a name="l00723"></a>00723     cpl_table        *grism_table  = NULL;
-<a name="l00724"></a>00724     cpl_table        *overscans    = NULL;
-<a name="l00725"></a>00725     cpl_table        *wavelengths  = NULL;
-<a name="l00726"></a>00726     cpl_table        *idscoeff     = NULL;
-<a name="l00727"></a>00727     cpl_table        *idscoeff_all = NULL;
-<a name="l00728"></a>00728     cpl_table        *restable     = NULL;
-<a name="l00729"></a>00729     cpl_table        *slits        = NULL;
-<a name="l00730"></a>00730     cpl_table        *positions    = NULL;
-<a name="l00731"></a>00731     cpl_table        *maskslits    = NULL;
-<a name="l00732"></a>00732     cpl_table        *traces       = NULL;
-<a name="l00733"></a>00733     cpl_table        *polytraces   = NULL;
-<a name="l00734"></a>00734     cpl_table        *restab       = NULL;
-<a name="l00735"></a>00735     cpl_table        *global       = NULL;
-<a name="l00736"></a>00736 
-<a name="l00737"></a>00737     cpl_vector       *lines        = NULL;
-<a name="l00738"></a>00738 
-<a name="l00739"></a>00739     cpl_propertylist *header       = NULL;
-<a name="l00740"></a>00740     cpl_propertylist *save_header  = NULL;
-<a name="l00741"></a>00741     cpl_propertylist *qclist       = NULL;
-<a name="l00742"></a>00742 
-<a name="l00743"></a>00743     <span class="comment">/*</span>
-<a name="l00744"></a>00744 <span class="comment">     * Auxiliary variables</span>
-<a name="l00745"></a>00745 <span class="comment">     */</span>
-<a name="l00746"></a>00746 
-<a name="l00747"></a>00747     <span class="keywordtype">char</span>        version[80];
-<a name="l00748"></a>00748     <span class="keyword">const</span> <span class="keywordtype">char</span> *arc_tag;
-<a name="l00749"></a>00749     <span class="keyword">const</span> <span class="keywordtype">char</span> *flat_tag;
-<a name="l00750"></a>00750     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_screen_flat_tag;
-<a name="l00751"></a>00751     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_norm_flat_tag;
-<a name="l00752"></a>00752     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_lamp_tag;
-<a name="l00753"></a>00753     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_residuals_tag;
-<a name="l00754"></a>00754     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;
-<a name="l00755"></a>00755     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_tag;
-<a name="l00756"></a>00756     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectra_detection_tag;
-<a name="l00757"></a>00757     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectral_resolution_tag;
-<a name="l00758"></a>00758     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_map_tag;
-<a name="l00759"></a>00759     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_traces_tag;
-<a name="l00760"></a>00760     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;
-<a name="l00761"></a>00761     <span class="keyword">const</span> <span class="keywordtype">char</span> *spatial_map_tag;
-<a name="l00762"></a>00762     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00763"></a>00763     <span class="keyword">const</span> <span class="keywordtype">char</span> *global_distortion_tag = <span class="stringliteral">"GLOBAL_DISTORTION_TABLE"</span>;
-<a name="l00764"></a>00764     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_residuals_table_tag;
-<a name="l00765"></a>00765     <span class="keyword">const</span> <span class="keywordtype">char</span> *delta_image_tag;
-<a name="l00766"></a>00766     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_screen_flat_tag;
-<a name="l00767"></a>00767     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_norm_flat_tag;
-<a name="l00768"></a>00768     <span class="keyword">const</span> <span class="keywordtype">char</span> *keyname;
-<a name="l00769"></a>00769     <span class="keywordtype">int</span>         mxu, mos, lss;
-<a name="l00770"></a>00770     <span class="keywordtype">int</span>         treat_as_lss = 0;
-<a name="l00771"></a>00771     <span class="keywordtype">int</span>         nslits;
-<a name="l00772"></a>00772     <span class="keywordtype">float</span>      *data;
-<a name="l00773"></a>00773     <span class="keywordtype">double</span>      mxpos;
-<a name="l00774"></a>00774     <span class="keywordtype">double</span>      mean_rms;
-<a name="l00775"></a>00775     <span class="keywordtype">double</span>      mean_rms_err;
-<a name="l00776"></a>00776     <span class="keywordtype">double</span>      alltime;
-<a name="l00777"></a>00777     <span class="keywordtype">int</span>         nflats;
-<a name="l00778"></a>00778     <span class="keywordtype">int</span>         nbias;
-<a name="l00779"></a>00779     <span class="keywordtype">int</span>         nlines;
-<a name="l00780"></a>00780     <span class="keywordtype">int</span>         rebin;
-<a name="l00781"></a>00781     <span class="keywordtype">double</span>     *line;
-<a name="l00782"></a>00782     <span class="keywordtype">double</span>     *fiterror = NULL;
-<a name="l00783"></a>00783     <span class="keywordtype">int</span>        *fitlines = NULL;
-<a name="l00784"></a>00784     cpl_size    nx, ny;
-<a name="l00785"></a>00785     <span class="keywordtype">double</span>      reference;
-<a name="l00786"></a>00786     <span class="keywordtype">double</span>      gain;
-<a name="l00787"></a>00787     <span class="keywordtype">int</span>         compute_central_wave;
-<a name="l00788"></a>00788     <span class="keywordtype">int</span>         ccd_xsize, ccd_ysize;
-<a name="l00789"></a>00789     <span class="keywordtype">int</span>         i;
-<a name="l00790"></a>00790 
-<a name="l00791"></a>00791     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00792"></a>00792     <span class="keywordtype">char</span>       *pipefile = NULL;
-<a name="l00793"></a>00793     <span class="keywordtype">char</span>       *wheel4;
-<a name="l00794"></a>00794 
-<a name="l00795"></a>00795 
-<a name="l00796"></a>00796     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00797"></a>00797 
-<a name="l00798"></a>00798     cpl_msg_set_indentation(2);
-<a name="l00799"></a>00799 
-<a name="l00800"></a>00800     <span class="comment">/* </span>
-<a name="l00801"></a>00801 <span class="comment">     * Get configuration parameters</span>
-<a name="l00802"></a>00802 <span class="comment">     */</span>
-<a name="l00803"></a>00803 
-<a name="l00804"></a>00804     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00805"></a>00805     cpl_msg_indent_more();
-<a name="l00806"></a>00806 
-<a name="l00807"></a>00807     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00808"></a>00808         fors_calib_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);
-<a name="l00809"></a>00809 
-<a name="l00810"></a>00810     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00811"></a>00811 
-<a name="l00812"></a>00812     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00813"></a>00813                     <span class="stringliteral">"fors.fors_calib.dispersion"</span>, grism_table);
-<a name="l00814"></a>00814 
-<a name="l00815"></a>00815     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00816"></a>00816         fors_calib_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00817"></a>00817 
-<a name="l00818"></a>00818     peakdetection = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00819"></a>00819                     <span class="stringliteral">"fors.fors_calib.peakdetection"</span>, grism_table);
-<a name="l00820"></a>00820     <span class="keywordflow">if</span> (peakdetection <= 0.0)
-<a name="l00821"></a>00821         fors_calib_exit(<span class="stringliteral">"Invalid peak detection level"</span>);
-<a name="l00822"></a>00822 
-<a name="l00823"></a>00823     wdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00824"></a>00824                     <span class="stringliteral">"fors.fors_calib.wdegree"</span>, grism_table);
-<a name="l00825"></a>00825 
-<a name="l00826"></a>00826     <span class="keywordflow">if</span> (wdegree < 1)
-<a name="l00827"></a>00827         fors_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00828"></a>00828 
-<a name="l00829"></a>00829     <span class="keywordflow">if</span> (wdegree > 5)
-<a name="l00830"></a>00830         fors_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00831"></a>00831 
-<a name="l00832"></a>00832     wradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_calib.wradius"</span>, NULL);
-<a name="l00833"></a>00833 
-<a name="l00834"></a>00834     <span class="keywordflow">if</span> (wradius < 0)
-<a name="l00835"></a>00835         fors_calib_exit(<span class="stringliteral">"Invalid search radius"</span>);
-<a name="l00836"></a>00836 
-<a name="l00837"></a>00837     wreject = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00838"></a>00838                                        <span class="stringliteral">"fors.fors_calib.wreject"</span>, NULL);
-<a name="l00839"></a>00839 
-<a name="l00840"></a>00840     <span class="keywordflow">if</span> (wreject <= 0.0)
-<a name="l00841"></a>00841         fors_calib_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);
-<a name="l00842"></a>00842 
-<a name="l00843"></a>00843     wmode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_calib.wmode"</span>, NULL);
-<a name="l00844"></a>00844 
-<a name="l00845"></a>00845     <span class="keywordflow">if</span> (wmode < 0 || wmode > 2)
-<a name="l00846"></a>00846         fors_calib_exit(<span class="stringliteral">"Invalid wavelength solution interpolation mode"</span>);
-<a name="l00847"></a>00847 
-<a name="l00848"></a>00848     wmosmode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00849"></a>00849                                      <span class="stringliteral">"fors.fors_calib.wmosmode"</span>, NULL);
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851     <span class="keywordflow">if</span> (wmosmode < 0 || wmosmode > 2)
-<a name="l00852"></a>00852         fors_calib_exit(<span class="stringliteral">"Invalid wavelength solution interpolation mode"</span>);
-<a name="l00853"></a>00853 
-<a name="l00854"></a>00854     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.fors_calib.wcolumn"</span>, 
-<a name="l00855"></a>00855                                        NULL);
-<a name="l00856"></a>00856 
-<a name="l00857"></a>00857     cdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_calib.cdegree"</span>, 
-<a name="l00858"></a>00858                                     grism_table);
-<a name="l00859"></a>00859 
-<a name="l00860"></a>00860     <span class="keywordflow">if</span> (cdegree < 1)
-<a name="l00861"></a>00861         fors_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00862"></a>00862 
-<a name="l00863"></a>00863     <span class="keywordflow">if</span> (cdegree > 5)
-<a name="l00864"></a>00864         fors_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00865"></a>00865 
-<a name="l00866"></a>00866     cmode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_calib.cmode"</span>, NULL);
-<a name="l00867"></a>00867 
-<a name="l00868"></a>00868     <span class="keywordflow">if</span> (cmode < 0 || cmode > 2)
-<a name="l00869"></a>00869         fors_calib_exit(<span class="stringliteral">"Invalid curvature solution interpolation mode"</span>);
-<a name="l00870"></a>00870 
-<a name="l00871"></a>00871     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00872"></a>00872                     <span class="stringliteral">"fors.fors_calib.startwavelength"</span>, grism_table);
-<a name="l00873"></a>00873     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00874"></a>00874         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00875"></a>00875             fors_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00876"></a>00876 
-<a name="l00877"></a>00877     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00878"></a>00878                     <span class="stringliteral">"fors.fors_calib.endwavelength"</span>, grism_table);
-<a name="l00879"></a>00879     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00880"></a>00880         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00881"></a>00881             fors_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00882"></a>00882         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00883"></a>00883             fors_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00884"></a>00884     }
-<a name="l00885"></a>00885 
-<a name="l00886"></a>00886     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00887"></a>00887         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00888"></a>00888             fors_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00889"></a>00889 
-<a name="l00890"></a>00890     slit_ident = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00891"></a>00891                     <span class="stringliteral">"fors.fors_calib.slit_ident"</span>, NULL);
-<a name="l00892"></a>00892 
-<a name="l00893"></a>00893     stack_method = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00894"></a>00894                                             <span class="stringliteral">"fors.fors_calib.stack_method"</span>, 
-<a name="l00895"></a>00895                                             NULL);
-<a name="l00896"></a>00896 
-<a name="l00897"></a>00897     <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"minmax"</span>) == 0) {
-<a name="l00898"></a>00898         min_reject = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00899"></a>00899                                        <span class="stringliteral">"fors.fors_calib.minrejection"</span>, NULL);
-<a name="l00900"></a>00900         <span class="keywordflow">if</span> (min_reject < 0)
-<a name="l00901"></a>00901             fors_calib_exit(<span class="stringliteral">"Invalid number of lower rejections"</span>);
-<a name="l00902"></a>00902 
-<a name="l00903"></a>00903         max_reject = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00904"></a>00904                                        <span class="stringliteral">"fors.fors_calib.maxrejection"</span>, NULL);
-<a name="l00905"></a>00905         <span class="keywordflow">if</span> (max_reject < 0)
-<a name="l00906"></a>00906             fors_calib_exit(<span class="stringliteral">"Invalid number of upper rejections"</span>);
-<a name="l00907"></a>00907     }
-<a name="l00908"></a>00908 
-<a name="l00909"></a>00909     <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"ksigma"</span>) == 0) {
-<a name="l00910"></a>00910         klow  = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00911"></a>00911                                          <span class="stringliteral">"fors.fors_calib.klow"</span>, NULL);
-<a name="l00912"></a>00912         <span class="keywordflow">if</span> (klow < 0.1)
-<a name="l00913"></a>00913             fors_calib_exit(<span class="stringliteral">"Invalid lower K-sigma"</span>);
-<a name="l00914"></a>00914 
-<a name="l00915"></a>00915         khigh = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00916"></a>00916                                          <span class="stringliteral">"fors.fors_calib.khigh"</span>, NULL);
-<a name="l00917"></a>00917         <span class="keywordflow">if</span> (khigh < 0.1)
-<a name="l00918"></a>00918             fors_calib_exit(<span class="stringliteral">"Invalid lower K-sigma"</span>);
-<a name="l00919"></a>00919 
-<a name="l00920"></a>00920         kiter = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00921"></a>00921                                       <span class="stringliteral">"fors.fors_calib.kiter"</span>, NULL);
-<a name="l00922"></a>00922         <span class="keywordflow">if</span> (kiter < 1)
-<a name="l00923"></a>00923             fors_calib_exit(<span class="stringliteral">"Invalid number of iterations"</span>);
-<a name="l00924"></a>00924     }
-<a name="l00925"></a>00925 
-<a name="l00926"></a>00926     sdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_calib.sdegree"</span>, NULL);
-<a name="l00927"></a>00927     ddegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_calib.ddegree"</span>, NULL);
-<a name="l00928"></a>00928     sradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_calib.sradius"</span>, NULL);
-<a name="l00929"></a>00929     dradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_calib.dradius"</span>, NULL);
-<a name="l00930"></a>00930 
-<a name="l00931"></a>00931     <span class="keywordflow">if</span> (sradius < 1 || dradius < 1)
-<a name="l00932"></a>00932         fors_calib_exit(<span class="stringliteral">"Invalid smoothing box radius"</span>);
-<a name="l00933"></a>00933 
-<a name="l00934"></a>00934     qc = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_calib.qc"</span>, NULL);
-<a name="l00935"></a>00935 
-<a name="l00936"></a>00936     check = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_calib.check"</span>, NULL);
-<a name="l00937"></a>00937 
-<a name="l00938"></a>00938     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00939"></a>00939 
-<a name="l00940"></a>00940     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00941"></a>00941         fors_calib_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00942"></a>00942 
-<a name="l00943"></a>00943 
-<a name="l00944"></a>00944     <span class="comment">/* </span>
-<a name="l00945"></a>00945 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00946"></a>00946 <span class="comment">     */</span>
-<a name="l00947"></a>00947 
-<a name="l00948"></a>00948     cpl_msg_indent_less();
-<a name="l00949"></a>00949     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00950"></a>00950     cpl_msg_indent_more();
-<a name="l00951"></a>00951 
-<a name="l00952"></a>00952     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>)) 
-<a name="l00953"></a>00953         fors_calib_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00954"></a>00954 
-<a name="l00955"></a>00955     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>)) 
-<a name="l00956"></a>00956         fors_calib_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00957"></a>00957 
-<a name="l00958"></a>00958     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>)) 
-<a name="l00959"></a>00959         fors_calib_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00960"></a>00960 
-<a name="l00961"></a>00961     mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_MXU"</span>);
-<a name="l00962"></a>00962     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_MOS"</span>);
-<a name="l00963"></a>00963     lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_LSS"</span>);
-<a name="l00964"></a>00964 
-<a name="l00965"></a>00965     <span class="keywordflow">if</span> (mxu + mos + lss == 0)
-<a name="l00966"></a>00966         fors_calib_exit(<span class="stringliteral">"Missing input arc lamp frame"</span>);
-<a name="l00967"></a>00967 
-<a name="l00968"></a>00968     <span class="keywordflow">if</span> (mxu + mos + lss > 1)
-<a name="l00969"></a>00969         fors_calib_exit(<span class="stringliteral">"Just one input arc lamp frame is allowed"</span>); 
-<a name="l00970"></a>00970 
-<a name="l00971"></a>00971     <span class="keywordflow">if</span> (mxu) {
-<a name="l00972"></a>00972         cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);
-<a name="l00973"></a>00973         arc_tag                  = <span class="stringliteral">"LAMP_MXU"</span>;
-<a name="l00974"></a>00974         flat_tag                 = <span class="stringliteral">"SCREEN_FLAT_MXU"</span>;
-<a name="l00975"></a>00975         master_screen_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_MXU"</span>;
-<a name="l00976"></a>00976         master_norm_flat_tag     = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;
-<a name="l00977"></a>00977         reduced_lamp_tag         = <span class="stringliteral">"REDUCED_LAMP_MXU"</span>;
-<a name="l00978"></a>00978         disp_residuals_tag       = <span class="stringliteral">"DISP_RESIDUALS_MXU"</span>;
-<a name="l00979"></a>00979         disp_coeff_tag           = <span class="stringliteral">"DISP_COEFF_MXU"</span>;
-<a name="l00980"></a>00980         wavelength_map_tag       = <span class="stringliteral">"WAVELENGTH_MAP_MXU"</span>;
-<a name="l00981"></a>00981         spectra_detection_tag    = <span class="stringliteral">"SPECTRA_DETECTION_MXU"</span>;
-<a name="l00982"></a>00982         spectral_resolution_tag  = <span class="stringliteral">"SPECTRAL_RESOLUTION_MXU"</span>;
-<a name="l00983"></a>00983         slit_map_tag             = <span class="stringliteral">"SLIT_MAP_MXU"</span>;
-<a name="l00984"></a>00984         curv_traces_tag          = <span class="stringliteral">"CURV_TRACES_MXU"</span>;
-<a name="l00985"></a>00985         curv_coeff_tag           = <span class="stringliteral">"CURV_COEFF_MXU"</span>;
-<a name="l00986"></a>00986         spatial_map_tag          = <span class="stringliteral">"SPATIAL_MAP_MXU"</span>;
-<a name="l00987"></a>00987         slit_location_tag        = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00988"></a>00988         disp_residuals_table_tag = <span class="stringliteral">"DISP_RESIDUALS_TABLE_MXU"</span>;
-<a name="l00989"></a>00989         delta_image_tag          = <span class="stringliteral">"DELTA_IMAGE_MXU"</span>;
-<a name="l00990"></a>00990         mapped_screen_flat_tag   = <span class="stringliteral">"MAPPED_SCREEN_FLAT_MXU"</span>;
-<a name="l00991"></a>00991         mapped_norm_flat_tag     = <span class="stringliteral">"MAPPED_NORM_FLAT_MXU"</span>;
-<a name="l00992"></a>00992     }
-<a name="l00993"></a>00993 
-<a name="l00994"></a>00994     <span class="keywordflow">if</span> (lss) {
-<a name="l00995"></a>00995         cpl_msg_info(recipe, <span class="stringliteral">"LSS data found"</span>);
-<a name="l00996"></a>00996         arc_tag                  = <span class="stringliteral">"LAMP_LSS"</span>;
-<a name="l00997"></a>00997         flat_tag                 = <span class="stringliteral">"SCREEN_FLAT_LSS"</span>;
-<a name="l00998"></a>00998         master_screen_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_LSS"</span>;
-<a name="l00999"></a>00999         master_norm_flat_tag     = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;
-<a name="l01000"></a>01000         reduced_lamp_tag         = <span class="stringliteral">"REDUCED_LAMP_LSS"</span>;
-<a name="l01001"></a>01001         spectral_resolution_tag  = <span class="stringliteral">"SPECTRAL_RESOLUTION_LSS"</span>;
-<a name="l01002"></a>01002         disp_residuals_tag       = <span class="stringliteral">"DISP_RESIDUALS_LSS"</span>;
-<a name="l01003"></a>01003         disp_coeff_tag           = <span class="stringliteral">"DISP_COEFF_LSS"</span>;
-<a name="l01004"></a>01004         slit_location_tag        = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;
-<a name="l01005"></a>01005         wavelength_map_tag       = <span class="stringliteral">"WAVELENGTH_MAP_LSS"</span>;
-<a name="l01006"></a>01006         slit_map_tag             = <span class="stringliteral">"SLIT_MAP_LSS"</span>;
-<a name="l01007"></a>01007         disp_residuals_table_tag = <span class="stringliteral">"DISP_RESIDUALS_TABLE_LSS"</span>;
-<a name="l01008"></a>01008         delta_image_tag          = <span class="stringliteral">"DELTA_IMAGE_LSS"</span>;
-<a name="l01009"></a>01009         mapped_screen_flat_tag   = <span class="stringliteral">"MAPPED_SCREEN_FLAT_LSS"</span>;
-<a name="l01010"></a>01010         mapped_norm_flat_tag     = <span class="stringliteral">"MAPPED_NORM_FLAT_LSS"</span>;
-<a name="l01011"></a>01011     }
-<a name="l01012"></a>01012 
-<a name="l01013"></a>01013     <span class="keywordflow">if</span> (mos) {
-<a name="l01014"></a>01014         cpl_msg_info(recipe, <span class="stringliteral">"MOS data found"</span>);
-<a name="l01015"></a>01015         arc_tag                  = <span class="stringliteral">"LAMP_MOS"</span>;
-<a name="l01016"></a>01016         flat_tag                 = <span class="stringliteral">"SCREEN_FLAT_MOS"</span>;
-<a name="l01017"></a>01017         master_screen_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_MOS"</span>;
-<a name="l01018"></a>01018         master_norm_flat_tag     = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;
-<a name="l01019"></a>01019         reduced_lamp_tag         = <span class="stringliteral">"REDUCED_LAMP_MOS"</span>;
-<a name="l01020"></a>01020         disp_residuals_tag       = <span class="stringliteral">"DISP_RESIDUALS_MOS"</span>;
-<a name="l01021"></a>01021         disp_coeff_tag           = <span class="stringliteral">"DISP_COEFF_MOS"</span>;
-<a name="l01022"></a>01022         wavelength_map_tag       = <span class="stringliteral">"WAVELENGTH_MAP_MOS"</span>;
-<a name="l01023"></a>01023         spectra_detection_tag    = <span class="stringliteral">"SPECTRA_DETECTION_MOS"</span>;
-<a name="l01024"></a>01024         spectral_resolution_tag  = <span class="stringliteral">"SPECTRAL_RESOLUTION_MOS"</span>;
-<a name="l01025"></a>01025         slit_map_tag             = <span class="stringliteral">"SLIT_MAP_MOS"</span>;
-<a name="l01026"></a>01026         curv_traces_tag          = <span class="stringliteral">"CURV_TRACES_MOS"</span>;
-<a name="l01027"></a>01027         curv_coeff_tag           = <span class="stringliteral">"CURV_COEFF_MOS"</span>;
-<a name="l01028"></a>01028         spatial_map_tag          = <span class="stringliteral">"SPATIAL_MAP_MOS"</span>;
-<a name="l01029"></a>01029         slit_location_tag        = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l01030"></a>01030         disp_residuals_table_tag = <span class="stringliteral">"DISP_RESIDUALS_TABLE_MOS"</span>;
-<a name="l01031"></a>01031         delta_image_tag          = <span class="stringliteral">"DELTA_IMAGE_MOS"</span>;
-<a name="l01032"></a>01032         mapped_screen_flat_tag   = <span class="stringliteral">"MAPPED_SCREEN_FLAT_MOS"</span>;
-<a name="l01033"></a>01033         mapped_norm_flat_tag     = <span class="stringliteral">"MAPPED_NORM_FLAT_MOS"</span>;
-<a name="l01034"></a>01034     }
-<a name="l01035"></a>01035 
-<a name="l01036"></a>01036     nbias = 0;
-<a name="l01037"></a>01037     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0) {
-<a name="l01038"></a>01038         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"BIAS"</span>) == 0)
-<a name="l01039"></a>01039             fors_calib_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS or BIAS"</span>);
-<a name="l01040"></a>01040         nbias = cpl_frameset_count_tags(frameset, <span class="stringliteral">"BIAS"</span>);
-<a name="l01041"></a>01041     }
-<a name="l01042"></a>01042 
-<a name="l01043"></a>01043     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)
-<a name="l01044"></a>01044         fors_calib_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);
-<a name="l01045"></a>01045 
-<a name="l01046"></a>01046     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)
-<a name="l01047"></a>01047         fors_calib_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);
-<a name="l01048"></a>01048 
-<a name="l01049"></a>01049     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)
-<a name="l01050"></a>01050         fors_calib_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);
-<a name="l01051"></a>01051 
-<a name="l01052"></a>01052     nflats = cpl_frameset_count_tags(frameset, flat_tag);
-<a name="l01053"></a>01053 
-<a name="l01054"></a>01054     <span class="keywordflow">if</span> (nflats < 1) {
-<a name="l01055"></a>01055         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, flat_tag);
-<a name="l01056"></a>01056         fors_calib_exit(NULL);
-<a name="l01057"></a>01057     }
-<a name="l01058"></a>01058 
-<a name="l01059"></a>01059     cpl_msg_indent_less();
-<a name="l01060"></a>01060 
-<a name="l01061"></a>01061     <span class="keywordflow">if</span> (nflats > 1)
-<a name="l01062"></a>01062         cpl_msg_info(recipe, <span class="stringliteral">"Load %d flat field frames and stack them "</span>
-<a name="l01063"></a>01063                      <span class="stringliteral">"with method \"%s\""</span>, nflats, stack_method);
-<a name="l01064"></a>01064     <span class="keywordflow">else</span>
-<a name="l01065"></a>01065         cpl_msg_info(recipe, <span class="stringliteral">"Load flat field exposure..."</span>);
-<a name="l01066"></a>01066 
-<a name="l01067"></a>01067     cpl_msg_indent_more();
-<a name="l01068"></a>01068 
-<a name="l01069"></a>01069     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, flat_tag, 0);
-<a name="l01070"></a>01070 
-<a name="l01071"></a>01071     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01072"></a>01072         fors_calib_exit(<span class="stringliteral">"Cannot load flat field frame header"</span>);
-<a name="l01073"></a>01073 
-<a name="l01074"></a>01074     <span class="comment">/*</span>
-<a name="l01075"></a>01075 <span class="comment">     * Insert here a check on supported filters:</span>
-<a name="l01076"></a>01076 <span class="comment">     */</span>
-<a name="l01077"></a>01077 
-<a name="l01078"></a>01078     wheel4 = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"ESO INS OPTI9 TYPE"</span>);
-<a name="l01079"></a>01079     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l01080"></a>01080         fors_calib_exit(<span class="stringliteral">"Missing keyword ESO INS OPTI9 TYPE in flat header"</span>);
-<a name="l01081"></a>01081     }
-<a name="l01082"></a>01082 
-<a name="l01083"></a>01083     <span class="keywordflow">if</span> (strcmp(<span class="stringliteral">"FILT"</span>, wheel4) == 0) {
-<a name="l01084"></a>01084         wheel4 = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, 
-<a name="l01085"></a>01085                                                      <span class="stringliteral">"ESO INS OPTI9 NAME"</span>);
-<a name="l01086"></a>01086         cpl_msg_error(recipe, <span class="stringliteral">"Unsupported filter: %s"</span>, wheel4);
-<a name="l01087"></a>01087         fors_calib_exit(NULL);
-<a name="l01088"></a>01088     }
-<a name="l01089"></a>01089 
-<a name="l01090"></a>01090     alltime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l01091"></a>01091 
-<a name="l01092"></a>01092     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01093"></a>01093         fors_calib_exit(<span class="stringliteral">"Missing keyword EXPTIME in flat field frame header"</span>);
-<a name="l01094"></a>01094 
-<a name="l01095"></a>01095     cpl_propertylist_delete(header);
-<a name="l01096"></a>01096 
-<a name="l01097"></a>01097     <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {
-<a name="l01098"></a>01098 
-<a name="l01099"></a>01099         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01100"></a>01100 
-<a name="l01101"></a>01101         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01102"></a>01102             fors_calib_exit(<span class="stringliteral">"Cannot load flat field frame header"</span>);
-<a name="l01103"></a>01103 
-<a name="l01104"></a>01104         alltime += cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l01105"></a>01105 
-<a name="l01106"></a>01106         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01107"></a>01107             fors_calib_exit(<span class="stringliteral">"Missing keyword EXPTIME in flat field "</span>
-<a name="l01108"></a>01108                             <span class="stringliteral">"frame header"</span>);
-<a name="l01109"></a>01109 
-<a name="l01110"></a>01110         cpl_propertylist_delete(header);
-<a name="l01111"></a>01111 
-<a name="l01112"></a>01112     }
-<a name="l01113"></a>01113 
-<a name="l01114"></a>01114     master_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, flat_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01115"></a>01115 
-<a name="l01116"></a>01116     <span class="keywordflow">if</span> (master_flat == NULL)
-<a name="l01117"></a>01117         fors_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);
-<a name="l01118"></a>01118 
-<a name="l01119"></a>01119     <span class="keywordflow">if</span> (nflats > 1) {
-<a name="l01120"></a>01120         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"average"</span>) == 0) {
-<a name="l01121"></a>01121             <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {
-<a name="l01122"></a>01122                 flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01123"></a>01123                 <span class="keywordflow">if</span> (flat) {
-<a name="l01124"></a>01124                     cpl_image_add(master_flat, flat);
-<a name="l01125"></a>01125                     cpl_image_delete(flat); flat = NULL;
-<a name="l01126"></a>01126                 }
-<a name="l01127"></a>01127                 <span class="keywordflow">else</span>
-<a name="l01128"></a>01128                     fors_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);
-<a name="l01129"></a>01129             }
-<a name="l01130"></a>01130 
-<a name="l01131"></a>01131         <span class="comment">/***</span>
-<a name="l01132"></a>01132 <span class="comment">            if (nflats > 1)</span>
-<a name="l01133"></a>01133 <span class="comment">                cpl_image_divide_scalar(master_flat, nflats);</span>
-<a name="l01134"></a>01134 <span class="comment">        ***/</span>
-<a name="l01135"></a>01135 
-<a name="l01136"></a>01136         }
-<a name="l01137"></a>01137         <span class="keywordflow">else</span> {
-<a name="l01138"></a>01138             cpl_imagelist *flatlist = NULL;
-<a name="l01139"></a>01139             <span class="keywordtype">double</span> rflux, flux;
-<a name="l01140"></a>01140 
-<a name="l01141"></a>01141             <span class="comment">/*</span>
-<a name="l01142"></a>01142 <span class="comment">             * added_flat is needed for tracing (masters obtained with</span>
-<a name="l01143"></a>01143 <span class="comment">             * rejections are not suitable for tracing)</span>
-<a name="l01144"></a>01144 <span class="comment">             */</span>
-<a name="l01145"></a>01145 
-<a name="l01146"></a>01146             added_flat = cpl_image_duplicate(master_flat);
-<a name="l01147"></a>01147 
-<a name="l01148"></a>01148             flatlist = cpl_imagelist_new();
-<a name="l01149"></a>01149             cpl_imagelist_set(flatlist, master_flat, 
-<a name="l01150"></a>01150                               cpl_imagelist_get_size(flatlist));
-<a name="l01151"></a>01151             master_flat = NULL;
-<a name="l01152"></a>01152 
-<a name="l01153"></a>01153             <span class="comment">/*</span>
-<a name="l01154"></a>01154 <span class="comment">             * Stacking with rejection requires normalization</span>
-<a name="l01155"></a>01155 <span class="comment">             * at the same flux. We normalise according to mean</span>
-<a name="l01156"></a>01156 <span class="comment">             * flux. This is equivalent to determining the</span>
-<a name="l01157"></a>01157 <span class="comment">             * flux ration for each image as the average of the</span>
-<a name="l01158"></a>01158 <span class="comment">             * flux ratio of all pixels weighted on the actual</span>
-<a name="l01159"></a>01159 <span class="comment">             * flux of each pixel.</span>
-<a name="l01160"></a>01160 <span class="comment">             */</span>
-<a name="l01161"></a>01161 
-<a name="l01162"></a>01162             rflux = cpl_image_get_mean(added_flat);
-<a name="l01163"></a>01163 
-<a name="l01164"></a>01164             <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {
-<a name="l01165"></a>01165                 flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01166"></a>01166                 <span class="keywordflow">if</span> (flat) {
-<a name="l01167"></a>01167                     cpl_image_add(added_flat, flat);
-<a name="l01168"></a>01168                     flux = cpl_image_get_mean(flat);
-<a name="l01169"></a>01169                     cpl_image_multiply_scalar(flat, rflux / flux);
-<a name="l01170"></a>01170                     cpl_imagelist_set(flatlist, flat, 
-<a name="l01171"></a>01171                                       cpl_imagelist_get_size(flatlist));
-<a name="l01172"></a>01172                     flat = NULL;
-<a name="l01173"></a>01173                 }
-<a name="l01174"></a>01174                 <span class="keywordflow">else</span> {
-<a name="l01175"></a>01175                     fors_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);
-<a name="l01176"></a>01176                 }
-<a name="l01177"></a>01177             }
-<a name="l01178"></a>01178 
-<a name="l01179"></a>01179             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"median"</span>) == 0) {
-<a name="l01180"></a>01180                 master_flat = cpl_imagelist_collapse_median_create(flatlist);
-<a name="l01181"></a>01181             }
-<a name="l01182"></a>01182 
-<a name="l01183"></a>01183             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"minmax"</span>) == 0) {
-<a name="l01184"></a>01184                 master_flat = cpl_imagelist_collapse_minmax_create(flatlist, 
-<a name="l01185"></a>01185                                                                    min_reject,
-<a name="l01186"></a>01186                                                                    max_reject);
-<a name="l01187"></a>01187             }
-<a name="l01188"></a>01188 
-<a name="l01189"></a>01189             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"ksigma"</span>) == 0) {
-<a name="l01190"></a>01190                 master_flat = <a class="code" href="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660">mos_ksigma_stack</a>(flatlist, 
-<a name="l01191"></a>01191                                                klow, khigh, kiter, NULL);
-<a name="l01192"></a>01192             }
-<a name="l01193"></a>01193 
-<a name="l01194"></a>01194             cpl_imagelist_delete(flatlist);
-<a name="l01195"></a>01195         }
-<a name="l01196"></a>01196     }
-<a name="l01197"></a>01197 
-<a name="l01198"></a>01198     <span class="comment">/*</span>
-<a name="l01199"></a>01199 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l01200"></a>01200 <span class="comment">     * dispersion direction from the arc lamp exposure</span>
-<a name="l01201"></a>01201 <span class="comment">     */</span>
-<a name="l01202"></a>01202 
-<a name="l01203"></a>01203     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01204"></a>01204 
-<a name="l01205"></a>01205     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01206"></a>01206         fors_calib_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);
-<a name="l01207"></a>01207 
-<a name="l01208"></a>01208     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l01209"></a>01209     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l01210"></a>01210         fors_calib_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);
-<a name="l01211"></a>01211     instrume = cpl_strdup(instrume);
-<a name="l01212"></a>01212 
-<a name="l01213"></a>01213     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l01214"></a>01214         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l01215"></a>01215     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l01216"></a>01216         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l01217"></a>01217 
-<a name="l01218"></a>01218     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l01219"></a>01219 
-<a name="l01220"></a>01220     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01221"></a>01221         fors_calib_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in arc lamp "</span>
-<a name="l01222"></a>01222                         <span class="stringliteral">"frame header"</span>);
-<a name="l01223"></a>01223 
-<a name="l01224"></a>01224     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l01225"></a>01225         reference *= 10;
-<a name="l01226"></a>01226 
-<a name="l01227"></a>01227     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l01228"></a>01228         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l01229"></a>01229                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in arc lamp frame header"</span>,
-<a name="l01230"></a>01230                       reference);
-<a name="l01231"></a>01231         fors_calib_exit(NULL);
-<a name="l01232"></a>01232     }
-<a name="l01233"></a>01233 
-<a name="l01234"></a>01234     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l01235"></a>01235 
-<a name="l01236"></a>01236     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l01237"></a>01237 
-<a name="l01238"></a>01238     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01239"></a>01239         fors_calib_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in arc lamp "</span>
-<a name="l01240"></a>01240                         <span class="stringliteral">"frame header"</span>);
-<a name="l01241"></a>01241 
-<a name="l01242"></a>01242     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l01243"></a>01243         dispersion *= rebin;
-<a name="l01244"></a>01244         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l01245"></a>01245                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin, 
-<a name="l01246"></a>01246                         dispersion);
-<a name="l01247"></a>01247     }
-<a name="l01248"></a>01248 
-<a name="l01249"></a>01249     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l01250"></a>01250 
-<a name="l01251"></a>01251     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01252"></a>01252         fors_calib_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in arc lamp "</span>
-<a name="l01253"></a>01253                         <span class="stringliteral">"frame header"</span>);
-<a name="l01254"></a>01254 
-<a name="l01255"></a>01255     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l01256"></a>01256 
-<a name="l01257"></a>01257     <span class="keywordflow">if</span> (mos || mxu) {
-<a name="l01258"></a>01258 
-<a name="l01259"></a>01259         <span class="keywordtype">int</span> nslits_out_det = 0;
-<a name="l01260"></a>01260 
-<a name="l01261"></a>01261         cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);
-<a name="l01262"></a>01262         <span class="keywordflow">if</span> (mos)
-<a name="l01263"></a>01263             maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l01264"></a>01264         <span class="keywordflow">else</span>
-<a name="l01265"></a>01265             maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l01266"></a>01266 
-<a name="l01267"></a>01267         <span class="comment">/*</span>
-<a name="l01268"></a>01268 <span class="comment">         * Check if all slits have the same X offset: in such case, </span>
-<a name="l01269"></a>01269 <span class="comment">         * treat the observation as a long-slit one!</span>
-<a name="l01270"></a>01270 <span class="comment">         */</span>
-<a name="l01271"></a>01271 
-<a name="l01272"></a>01272         mxpos = cpl_table_get_column_median(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l01273"></a>01273         nslits = cpl_table_get_nrow(maskslits);
-<a name="l01274"></a>01274 
-<a name="l01275"></a>01275         
-<a name="l01276"></a>01276         treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits,  nslits_out_det);
-<a name="l01277"></a>01277 
-<a name="l01278"></a>01278         <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l01279"></a>01279             cpl_msg_warning(recipe, <span class="stringliteral">"All MOS slits have the same offset: %.2f\n"</span>
-<a name="l01280"></a>01280                             <span class="stringliteral">"The LSS data reduction strategy is applied!"</span>, 
-<a name="l01281"></a>01281                             mxpos);
-<a name="l01282"></a>01282             cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l01283"></a>01283             <span class="keywordflow">if</span> (mos) {
-<a name="l01284"></a>01284                 master_screen_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_LONG_MOS"</span>;
-<a name="l01285"></a>01285                 master_norm_flat_tag     = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_MOS"</span>;
-<a name="l01286"></a>01286                 disp_residuals_table_tag = <span class="stringliteral">"DISP_RESIDUALS_TABLE_LONG_MOS"</span>;
-<a name="l01287"></a>01287                 delta_image_tag          = <span class="stringliteral">"DELTA_IMAGE_LONG_MOS"</span>;
-<a name="l01288"></a>01288                 spectral_resolution_tag  = <span class="stringliteral">"SPECTRAL_RESOLUTION_LONG_MOS"</span>;
-<a name="l01289"></a>01289                 reduced_lamp_tag         = <span class="stringliteral">"REDUCED_LAMP_LONG_MOS"</span>;
-<a name="l01290"></a>01290                 disp_coeff_tag           = <span class="stringliteral">"DISP_COEFF_LONG_MOS"</span>;
-<a name="l01291"></a>01291                 wavelength_map_tag       = <span class="stringliteral">"WAVELENGTH_MAP_LONG_MOS"</span>;
-<a name="l01292"></a>01292                 slit_location_tag        = <span class="stringliteral">"SLIT_LOCATION_LONG_MOS"</span>;
-<a name="l01293"></a>01293                 mapped_screen_flat_tag   = <span class="stringliteral">"MAPPED_SCREEN_FLAT_LONG_MOS"</span>;
-<a name="l01294"></a>01294                 mapped_norm_flat_tag     = <span class="stringliteral">"MAPPED_NORM_FLAT_LONG_MOS"</span>;
-<a name="l01295"></a>01295             }
-<a name="l01296"></a>01296             <span class="keywordflow">else</span> {
-<a name="l01297"></a>01297                 master_screen_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_LONG_MXU"</span>;
-<a name="l01298"></a>01298                 master_norm_flat_tag     = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_MXU"</span>;
-<a name="l01299"></a>01299                 disp_residuals_table_tag = <span class="stringliteral">"DISP_RESIDUALS_TABLE_LONG_MXU"</span>;
-<a name="l01300"></a>01300                 delta_image_tag          = <span class="stringliteral">"DELTA_IMAGE_LONG_MXU"</span>;
-<a name="l01301"></a>01301                 spectral_resolution_tag  = <span class="stringliteral">"SPECTRAL_RESOLUTION_LONG_MXU"</span>;
-<a name="l01302"></a>01302                 reduced_lamp_tag         = <span class="stringliteral">"REDUCED_LAMP_LONG_MXU"</span>;
-<a name="l01303"></a>01303                 disp_coeff_tag           = <span class="stringliteral">"DISP_COEFF_LONG_MXU"</span>;
-<a name="l01304"></a>01304                 wavelength_map_tag       = <span class="stringliteral">"WAVELENGTH_MAP_LONG_MXU"</span>;
-<a name="l01305"></a>01305                 slit_location_tag        = <span class="stringliteral">"SLIT_LOCATION_LONG_MXU"</span>;
-<a name="l01306"></a>01306                 mapped_screen_flat_tag   = <span class="stringliteral">"MAPPED_SCREEN_FLAT_LONG_MXU"</span>;
-<a name="l01307"></a>01307                 mapped_norm_flat_tag     = <span class="stringliteral">"MAPPED_NORM_FLAT_LONG_MXU"</span>;
-<a name="l01308"></a>01308             }
-<a name="l01309"></a>01309         }
-<a name="l01310"></a>01310     }
-<a name="l01311"></a>01311 
-<a name="l01312"></a>01312     <span class="keywordflow">if</span> (slit_ident == 0) {
-<a name="l01313"></a>01313         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l01314"></a>01314     }
-<a name="l01315"></a>01315 
-<a name="l01316"></a>01316 
-<a name="l01317"></a>01317     <span class="comment">/* Leave the header on for the next step... */</span>
-<a name="l01318"></a>01318 
-<a name="l01319"></a>01319 
-<a name="l01320"></a>01320     <span class="comment">/*</span>
-<a name="l01321"></a>01321 <span class="comment">     * Remove the master bias</span>
-<a name="l01322"></a>01322 <span class="comment">     */</span>
-<a name="l01323"></a>01323 
-<a name="l01324"></a>01324     <span class="keywordflow">if</span> (nbias) {
-<a name="l01325"></a>01325 
-<a name="l01326"></a>01326         <span class="comment">/*</span>
-<a name="l01327"></a>01327 <span class="comment">         * Set of raw BIASes in input, need to create master bias!</span>
-<a name="l01328"></a>01328 <span class="comment">         */</span>
-<a name="l01329"></a>01329 
-<a name="l01330"></a>01330         cpl_msg_info(recipe, <span class="stringliteral">"Generate the master from input raw biases..."</span>);
-<a name="l01331"></a>01331 
-<a name="l01332"></a>01332         <span class="keywordflow">if</span> (nbias > 1) {
-<a name="l01333"></a>01333 
-<a name="l01334"></a>01334             biases = cpl_imagelist_new();
-<a name="l01335"></a>01335 
-<a name="l01336"></a>01336             bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"BIAS"</span>, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01337"></a>01337     
-<a name="l01338"></a>01338             <span class="keywordflow">if</span> (bias == NULL)
-<a name="l01339"></a>01339                 fors_calib_exit(<span class="stringliteral">"Cannot load bias frame"</span>);
-<a name="l01340"></a>01340 
-<a name="l01341"></a>01341             cpl_imagelist_set(biases, bias, 0); bias = NULL;
-<a name="l01342"></a>01342     
-<a name="l01343"></a>01343             <span class="keywordflow">for</span> (i = 1; i < nbias; i++) {
-<a name="l01344"></a>01344                 bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01345"></a>01345                 <span class="keywordflow">if</span> (bias) {
-<a name="l01346"></a>01346                     cpl_imagelist_set(biases, bias, i); bias = NULL;
-<a name="l01347"></a>01347                 }
-<a name="l01348"></a>01348                 <span class="keywordflow">else</span>
-<a name="l01349"></a>01349                     fors_calib_exit(<span class="stringliteral">"Cannot load bias frame"</span>);
-<a name="l01350"></a>01350             }
-<a name="l01351"></a>01351     
-<a name="l01352"></a>01352             master_bias = cpl_imagelist_collapse_median_create(biases);
-<a name="l01353"></a>01353 
-<a name="l01354"></a>01354             cpl_imagelist_delete(biases);
-<a name="l01355"></a>01355         }
-<a name="l01356"></a>01356         <span class="keywordflow">else</span> {
-<a name="l01357"></a>01357             master_bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"BIAS"</span>, 
-<a name="l01358"></a>01358                                          CPL_TYPE_FLOAT, 0, 1);
-<a name="l01359"></a>01359             <span class="keywordflow">if</span> (master_bias == NULL)
-<a name="l01360"></a>01360                 fors_calib_exit(<span class="stringliteral">"Cannot load bias"</span>);
-<a name="l01361"></a>01361         }
-<a name="l01362"></a>01362 
-<a name="l01363"></a>01363     }
-<a name="l01364"></a>01364     <span class="keywordflow">else</span> {
-<a name="l01365"></a>01365         master_bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, 
-<a name="l01366"></a>01366                                      CPL_TYPE_FLOAT, 0, 1);
-<a name="l01367"></a>01367         <span class="keywordflow">if</span> (master_bias == NULL)
-<a name="l01368"></a>01368             fors_calib_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l01369"></a>01369     }
-<a name="l01370"></a>01370 
-<a name="l01371"></a>01371     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l01372"></a>01372 
-<a name="l01373"></a>01373     overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 1);
-<a name="l01374"></a>01374     cpl_propertylist_delete(header); header = NULL;
-<a name="l01375"></a>01375 
-<a name="l01376"></a>01376     <span class="keywordflow">if</span> (nbias) {
-<a name="l01377"></a>01377         <span class="keywordtype">int</span> xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, 0, NULL);
-<a name="l01378"></a>01378         <span class="keywordtype">int</span> ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, 0, NULL);
-<a name="l01379"></a>01379         <span class="keywordtype">int</span> xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, 0, NULL);
-<a name="l01380"></a>01380         <span class="keywordtype">int</span> yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, 0, NULL);
-<a name="l01381"></a>01381         dummy = cpl_image_extract(master_bias, xlow+1, ylow+1, xhig, yhig);
-<a name="l01382"></a>01382         cpl_image_delete(master_bias); master_bias = dummy;
-<a name="l01383"></a>01383 
-<a name="l01384"></a>01384         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, master_bias, <span class="stringliteral">"MASTER_BIAS"</span>,
-<a name="l01385"></a>01385                            NULL, parlist, recipe, version))
-<a name="l01386"></a>01386             fors_calib_exit(NULL);
-<a name="l01387"></a>01387     }
-<a name="l01388"></a>01388 
-<a name="l01389"></a>01389     <span class="keywordflow">if</span> (nflats > 1) {
-<a name="l01390"></a>01390         multi_bias = cpl_image_multiply_scalar_create(master_bias, nflats);
-<a name="l01391"></a>01391         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(master_flat, multi_bias, overscans);
-<a name="l01392"></a>01392         <span class="keywordflow">if</span> (added_flat)
-<a name="l01393"></a>01393             add_dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(added_flat, multi_bias, overscans);
-<a name="l01394"></a>01394         cpl_image_delete(multi_bias);
-<a name="l01395"></a>01395     }
-<a name="l01396"></a>01396     <span class="keywordflow">else</span> {
-<a name="l01397"></a>01397         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(master_flat, master_bias, overscans);
-<a name="l01398"></a>01398     }
-<a name="l01399"></a>01399     cpl_image_delete(master_flat);
-<a name="l01400"></a>01400     master_flat = dummy;
-<a name="l01401"></a>01401 
-<a name="l01402"></a>01402     <span class="keywordflow">if</span> (master_flat == NULL)
-<a name="l01403"></a>01403         fors_calib_exit(<span class="stringliteral">"Cannot remove bias from flat field"</span>);
-<a name="l01404"></a>01404 
-<a name="l01405"></a>01405     <span class="keywordflow">if</span> (added_flat) {
-<a name="l01406"></a>01406         cpl_image_delete(added_flat);
-<a name="l01407"></a>01407         added_flat = add_dummy;
-<a name="l01408"></a>01408 
-<a name="l01409"></a>01409         <span class="keywordflow">if</span> (added_flat == NULL)
-<a name="l01410"></a>01410             fors_calib_exit(<span class="stringliteral">"Cannot remove bias from added flat field"</span>);
-<a name="l01411"></a>01411 
-<a name="l01412"></a>01412         trace_flat = added_flat;
-<a name="l01413"></a>01413     }
-<a name="l01414"></a>01414     <span class="keywordflow">else</span>
-<a name="l01415"></a>01415         trace_flat = master_flat;
-<a name="l01416"></a>01416 
-<a name="l01417"></a>01417     cpl_msg_indent_less();
-<a name="l01418"></a>01418     cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);
-<a name="l01419"></a>01419     cpl_msg_indent_more();
-<a name="l01420"></a>01420 
-<a name="l01421"></a>01421     spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01422"></a>01422 
-<a name="l01423"></a>01423     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01424"></a>01424         fors_calib_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);
-<a name="l01425"></a>01425 
-<a name="l01426"></a>01426     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l01427"></a>01427 
-<a name="l01428"></a>01428     dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(spectra, master_bias, overscans);
-<a name="l01429"></a>01429     cpl_table_delete(overscans); overscans = NULL;
-<a name="l01430"></a>01430     cpl_image_delete(master_bias); master_bias = NULL;
-<a name="l01431"></a>01431     cpl_image_delete(spectra); spectra = dummy;
-<a name="l01432"></a>01432 
-<a name="l01433"></a>01433     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01434"></a>01434         fors_calib_exit(<span class="stringliteral">"Cannot remove bias from arc lamp exposure"</span>);
-<a name="l01435"></a>01435 
-<a name="l01436"></a>01436     cpl_msg_indent_less();
-<a name="l01437"></a>01437     cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);
-<a name="l01438"></a>01438     cpl_msg_indent_more();
-<a name="l01439"></a>01439 
-<a name="l01440"></a>01440     wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>, 1);
-<a name="l01441"></a>01441 
-<a name="l01442"></a>01442     <span class="keywordflow">if</span> (wavelengths == NULL)
-<a name="l01443"></a>01443         fors_calib_exit(<span class="stringliteral">"Cannot load line catalog"</span>);
-<a name="l01444"></a>01444 
-<a name="l01445"></a>01445 
-<a name="l01446"></a>01446     <span class="comment">/*</span>
-<a name="l01447"></a>01447 <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l01448"></a>01448 <span class="comment">     */</span>
-<a name="l01449"></a>01449 
-<a name="l01450"></a>01450     nlines = cpl_table_get_nrow(wavelengths);
-<a name="l01451"></a>01451 
-<a name="l01452"></a>01452     <span class="keywordflow">if</span> (nlines == 0)
-<a name="l01453"></a>01453         fors_calib_exit(<span class="stringliteral">"Empty input line catalog"</span>);
-<a name="l01454"></a>01454 
-<a name="l01455"></a>01455     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l01456"></a>01456         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,
-<a name="l01457"></a>01457                       wcolumn);
-<a name="l01458"></a>01458         fors_calib_exit(NULL);
-<a name="l01459"></a>01459     }
-<a name="l01460"></a>01460 
-<a name="l01461"></a>01461     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01462"></a>01462     
-<a name="l01463"></a>01463     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l01464"></a>01464         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l01465"></a>01465 
-<a name="l01466"></a>01466     cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l01467"></a>01467 
-<a name="l01468"></a>01468     lines = cpl_vector_wrap(nlines, line);
-<a name="l01469"></a>01469 
-<a name="l01470"></a>01470 
-<a name="l01471"></a>01471     <span class="keywordflow">if</span> (lss || treat_as_lss) {
-<a name="l01472"></a>01472 
-<a name="l01473"></a>01473         cpl_size first_row, last_row;
-<a name="l01474"></a>01474         cpl_size ylow, yhig;
-<a name="l01475"></a>01475 
-<a name="l01476"></a>01476         <span class="comment">/* FIXME:</span>
-<a name="l01477"></a>01477 <span class="comment">         * The LSS data calibration is still dirty: it doesn't apply</span>
-<a name="l01478"></a>01478 <span class="comment">         * any spatial rectification, and only in future an external</span>
-<a name="l01479"></a>01479 <span class="comment">         * spectral curvature model would be provided in input. Here</span>
-<a name="l01480"></a>01480 <span class="comment">         * and there temporary solutions are adpted, such as accepting</span>
-<a name="l01481"></a>01481 <span class="comment">         * the preliminary wavelength calibration.</span>
-<a name="l01482"></a>01482 <span class="comment">         */</span>
-<a name="l01483"></a>01483 
-<a name="l01484"></a>01484         <span class="comment">/*</span>
-<a name="l01485"></a>01485 <span class="comment">         * Flat field normalisation is done directly on the master flat</span>
-<a name="l01486"></a>01486 <span class="comment">         * field (without spatial rectification first). The spectral</span>
-<a name="l01487"></a>01487 <span class="comment">         * curvature model may be provided in input, in future releases.</span>
-<a name="l01488"></a>01488 <span class="comment">         */</span>
-<a name="l01489"></a>01489 
-<a name="l01490"></a>01490         cpl_msg_indent_less();
-<a name="l01491"></a>01491         cpl_msg_info(recipe, <span class="stringliteral">"Perform LSS flat field normalisation..."</span>);
-<a name="l01492"></a>01492         cpl_msg_indent_more();
-<a name="l01493"></a>01493 
-<a name="l01494"></a>01494         norm_flat = cpl_image_duplicate(master_flat);
-<a name="l01495"></a>01495 
-<a name="l01496"></a>01496         smo_flat = <a class="code" href="group__moses.html#g9c5947c76fc1246f203a1c6ebc6c9569">mos_normalise_longflat</a>(norm_flat, sradius, dradius,
-<a name="l01497"></a>01497                                           sdegree);
-<a name="l01498"></a>01498 
-<a name="l01499"></a>01499         cpl_image_delete(smo_flat); smo_flat = NULL; <span class="comment">/* It may be a product */</span>
-<a name="l01500"></a>01500 
-<a name="l01501"></a>01501         <span class="keywordflow">if</span> (1) {
-<a name="l01502"></a>01502             save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, flat_tag, 0);
-<a name="l01503"></a>01503             cpl_propertylist_update_int(save_header, 
-<a name="l01504"></a>01504                                         <span class="stringliteral">"ESO PRO DATANCOM"</span>, nflats);
-<a name="l01505"></a>01505 
-<a name="l01506"></a>01506             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, master_flat, master_screen_flat_tag,
-<a name="l01507"></a>01507                                save_header, parlist, recipe, version))
-<a name="l01508"></a>01508                 fors_calib_exit(NULL);
-<a name="l01509"></a>01509 <span class="comment">//%%%%%            cpl_image_delete(master_flat); master_flat = NULL;</span>
-<a name="l01510"></a>01510         }
-<a name="l01511"></a>01511 
-<a name="l01512"></a>01512         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, norm_flat, master_norm_flat_tag,
-<a name="l01513"></a>01513                            save_header, parlist, recipe, version))
-<a name="l01514"></a>01514             fors_calib_exit(NULL);
-<a name="l01515"></a>01515 
-<a name="l01516"></a>01516         cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01517"></a>01517 <span class="comment">//%%%%%        cpl_image_delete(norm_flat); norm_flat = NULL;</span>
-<a name="l01518"></a>01518 
-<a name="l01519"></a>01519 
-<a name="l01520"></a>01520         <span class="comment">/*</span>
-<a name="l01521"></a>01521 <span class="comment">         * In the case of LSS data, extract the spectra directly</span>
-<a name="l01522"></a>01522 <span class="comment">         * on the first attempt. The spectral curvature model may</span>
-<a name="l01523"></a>01523 <span class="comment">         * be provided in input, in future releases.</span>
-<a name="l01524"></a>01524 <span class="comment">         */</span>
-<a name="l01525"></a>01525 
-<a name="l01526"></a>01526         cpl_msg_indent_less();
-<a name="l01527"></a>01527         cpl_msg_info(recipe, <span class="stringliteral">"Perform wavelength calibration..."</span>);
-<a name="l01528"></a>01528         cpl_msg_indent_more();
-<a name="l01529"></a>01529 
-<a name="l01530"></a>01530         nx = cpl_image_get_size_x(spectra);
-<a name="l01531"></a>01531         ny = cpl_image_get_size_y(spectra);
-<a name="l01532"></a>01532 
-<a name="l01533"></a>01533         wavemap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01534"></a>01534         idscoeff_all = cpl_table_new(ny);
-<a name="l01535"></a>01535 
-<a name="l01536"></a>01536     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(spectra))
-<a name="l01537"></a>01537         fors_calib_exit(<span class="stringliteral">"Cannot process saturation"</span>);
-<a name="l01538"></a>01538 
-<a name="l01539"></a>01539     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(spectra))
-<a name="l01540"></a>01540         fors_calib_exit(<span class="stringliteral">"Cannot subtract the background"</span>);
-<a name="l01541"></a>01541 
-<a name="l01542"></a>01542         rectified = <a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion,
-<a name="l01543"></a>01543                                                    peakdetection, wradius,
-<a name="l01544"></a>01544                                                    wdegree, wreject, reference,
-<a name="l01545"></a>01545                                                    &startwavelength,
-<a name="l01546"></a>01546                                                    &endwavelength, NULL,
-<a name="l01547"></a>01547                                                    NULL, idscoeff_all, wavemap,
-<a name="l01548"></a>01548                                                    NULL, NULL, NULL);
-<a name="l01549"></a>01549 
-<a name="l01550"></a>01550         <span class="keywordflow">if</span> (rectified == NULL)
-<a name="l01551"></a>01551             fors_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l01552"></a>01552 
-<a name="l01553"></a>01553         <span class="keywordflow">if</span> (!cpl_table_has_valid(idscoeff_all, <span class="stringliteral">"c0"</span>))
-<a name="l01554"></a>01554             fors_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l01555"></a>01555 
-<a name="l01556"></a>01556         cpl_image_delete(rectified); rectified = NULL;
-<a name="l01557"></a>01557 
-<a name="l01558"></a>01558         first_row = 0;
-<a name="l01559"></a>01559         <span class="keywordflow">while</span> (!cpl_table_is_valid(idscoeff_all, <span class="stringliteral">"c0"</span>, first_row))
-<a name="l01560"></a>01560             first_row++;
-<a name="l01561"></a>01561 
-<a name="l01562"></a>01562         last_row = ny - 1;
-<a name="l01563"></a>01563         <span class="keywordflow">while</span> (!cpl_table_is_valid(idscoeff_all, <span class="stringliteral">"c0"</span>, last_row))
-<a name="l01564"></a>01564             last_row--;
-<a name="l01565"></a>01565 
-<a name="l01566"></a>01566         ylow = first_row + 1;
-<a name="l01567"></a>01567         yhig = last_row + 1;
-<a name="l01568"></a>01568 
-<a name="l01569"></a>01569         <span class="keywordflow">if</span> (ylow >= yhig) {
-<a name="l01570"></a>01570             cpl_error_reset();
-<a name="l01571"></a>01571             fors_calib_exit(<span class="stringliteral">"No spectra could be detected."</span>);
-<a name="l01572"></a>01572         }
-<a name="l01573"></a>01573 
-<a name="l01574"></a>01574         cpl_msg_info(recipe, 
-<a name="l01575"></a>01575                      <span class="stringliteral">"Spectral pattern was detected on %"</span>CPL_SIZE_FORMAT
-<a name="l01576"></a>01576                      <span class="stringliteral">" out of %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" CCD rows"</span>, 
-<a name="l01577"></a>01577                      yhig - ylow, ny);
-<a name="l01578"></a>01578 
-<a name="l01579"></a>01579         dummy = cpl_image_extract(spectra, 1, ylow, nx, yhig);
-<a name="l01580"></a>01580         cpl_image_delete(spectra); spectra = dummy;
-<a name="l01581"></a>01581 
-<a name="l01582"></a>01582         ccd_ysize = (int)ny;
-<a name="l01583"></a>01583         ny = cpl_image_get_size_y(spectra);
-<a name="l01584"></a>01584 
-<a name="l01585"></a>01585         <span class="keywordflow">if</span> (check)
-<a name="l01586"></a>01586             residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01587"></a>01587 
-<a name="l01588"></a>01588         fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01589"></a>01589         fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l01590"></a>01590         idscoeff = cpl_table_new(ny);
-<a name="l01591"></a>01591         restable = cpl_table_new(nlines);
-<a name="l01592"></a>01592 
-<a name="l01593"></a>01593     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(spectra))
-<a name="l01594"></a>01594         fors_calib_exit(<span class="stringliteral">"Cannot process saturation"</span>);
-<a name="l01595"></a>01595 
-<a name="l01596"></a>01596     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(spectra))
-<a name="l01597"></a>01597         fors_calib_exit(<span class="stringliteral">"Cannot subtract the background"</span>);
-<a name="l01598"></a>01598 
-<a name="l01599"></a>01599         rectified = <a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion,
-<a name="l01600"></a>01600                                                    peakdetection, wradius,
-<a name="l01601"></a>01601                                                    wdegree, wreject, reference,
-<a name="l01602"></a>01602                                                    &startwavelength, 
-<a name="l01603"></a>01603                                                    &endwavelength, fitlines, 
-<a name="l01604"></a>01604                                                    fiterror, idscoeff, NULL,
-<a name="l01605"></a>01605                                                    residual, restable, NULL);
-<a name="l01606"></a>01606 
-<a name="l01607"></a>01607         <span class="keywordflow">if</span> (rectified == NULL)
-<a name="l01608"></a>01608             fors_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l01609"></a>01609 
-<a name="l01610"></a>01610         <span class="keywordflow">if</span> (!cpl_table_has_valid(idscoeff, <span class="stringliteral">"c0"</span>))
-<a name="l01611"></a>01611             fors_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l01612"></a>01612 
-<a name="l01613"></a>01613         <span class="comment">/*</span>
-<a name="l01614"></a>01614 <span class="comment">         * A dummy slit locations table</span>
-<a name="l01615"></a>01615 <span class="comment">         */</span>
-<a name="l01616"></a>01616 
-<a name="l01617"></a>01617         slits = cpl_table_new(1);
-<a name="l01618"></a>01618         cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l01619"></a>01619         cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>, CPL_TYPE_DOUBLE);
-<a name="l01620"></a>01620         cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>, CPL_TYPE_DOUBLE);
-<a name="l01621"></a>01621         cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l01622"></a>01622         cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l01623"></a>01623         cpl_table_new_column(slits, <span class="stringliteral">"position"</span>, CPL_TYPE_INT);
-<a name="l01624"></a>01624         cpl_table_new_column(slits, <span class="stringliteral">"length"</span>, CPL_TYPE_INT);
-<a name="l01625"></a>01625         cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l01626"></a>01626         cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l01627"></a>01627         cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l01628"></a>01628         cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l01629"></a>01629         cpl_table_set_column_unit(slits, <span class="stringliteral">"position"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l01630"></a>01630         cpl_table_set_column_unit(slits, <span class="stringliteral">"length"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l01631"></a>01631         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 0);
-<a name="l01632"></a>01632         cpl_table_set_double(slits, <span class="stringliteral">"xtop"</span>, 0, 0);
-<a name="l01633"></a>01633         cpl_table_set_double(slits, <span class="stringliteral">"ytop"</span>, 0, (<span class="keywordtype">double</span>)last_row);
-<a name="l01634"></a>01634         cpl_table_set_double(slits, <span class="stringliteral">"xbottom"</span>, 0, 0);
-<a name="l01635"></a>01635         cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, 0, (<span class="keywordtype">double</span>)first_row);
-<a name="l01636"></a>01636         cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, 0, 0);
-<a name="l01637"></a>01637         cpl_table_set_int(slits, <span class="stringliteral">"length"</span>, 0, (<span class="keywordtype">int</span>)ny);
-<a name="l01638"></a>01638 
-<a name="l01639"></a>01639         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,
-<a name="l01640"></a>01640                            parlist, recipe, version))
-<a name="l01641"></a>01641             fors_calib_exit(NULL);
-<a name="l01642"></a>01642 
-<a name="l01643"></a>01643         cpl_table_delete(slits); slits = NULL;
-<a name="l01644"></a>01644 
-<a name="l01645"></a>01645         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, restable, disp_residuals_table_tag, NULL,
-<a name="l01646"></a>01646                            parlist, recipe, version))
-<a name="l01647"></a>01647             fors_calib_exit(NULL);
-<a name="l01648"></a>01648 
-<a name="l01649"></a>01649         cpl_table_delete(restable); restable = NULL;
-<a name="l01650"></a>01650 
-<a name="l01651"></a>01651         <span class="keywordflow">if</span> (wmode) {
-<a name="l01652"></a>01652             cpl_image_delete(rectified); rectified = NULL;
-<a name="l01653"></a>01653             cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l01654"></a>01654             <a class="code" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">mos_interpolate_wavecalib</a>(idscoeff, wavemap, wmode, 2);
-<a name="l01655"></a>01655             <a class="code" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">mos_interpolate_wavecalib</a>(idscoeff_all, wavemap, wmode, 2);
-<a name="l01656"></a>01656             wavemap = <a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(idscoeff_all, nx, reference,
-<a name="l01657"></a>01657                                        startwavelength, endwavelength);
-<a name="l01658"></a>01658             rectified = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(spectra, reference,
-<a name="l01659"></a>01659                                                    startwavelength, 
-<a name="l01660"></a>01660                                                    endwavelength, dispersion, 
-<a name="l01661"></a>01661                                                    idscoeff, 0);
-<a name="l01662"></a>01662         }
-<a name="l01663"></a>01663 
-<a name="l01664"></a>01664         cpl_table_delete(idscoeff_all); idscoeff_all = NULL;
-<a name="l01665"></a>01665 
-<a name="l01666"></a>01666         cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;
-<a name="l01667"></a>01667         cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l01668"></a>01668         cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;
-<a name="l01669"></a>01669 
-<a name="l01670"></a>01670         <span class="keywordflow">for</span> (i = 0; i < ny; i++)
-<a name="l01671"></a>01671             <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))
-<a name="l01672"></a>01672                 cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);
-<a name="l01673"></a>01673 
-<a name="l01674"></a>01674         delta = <a class="code" href="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1">mos_map_pixel</a>(idscoeff, reference, startwavelength,
-<a name="l01675"></a>01675                               endwavelength, dispersion, 2);
-<a name="l01676"></a>01676 
-<a name="l01677"></a>01677 <span class="comment">//%%%%%</span>
-<a name="l01678"></a>01678         dummy = cpl_image_extract(master_flat, 1, ylow, nx, yhig);
-<a name="l01679"></a>01679         cpl_image_delete(master_flat); master_flat = dummy;
-<a name="l01680"></a>01680 
-<a name="l01681"></a>01681         mapped_flat = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(master_flat, reference,
-<a name="l01682"></a>01682                                       startwavelength, endwavelength,
-<a name="l01683"></a>01683                                       dispersion, idscoeff, 0);
-<a name="l01684"></a>01684 
-<a name="l01685"></a>01685         cpl_image_delete(master_flat); master_flat = NULL;
-<a name="l01686"></a>01686 
-<a name="l01687"></a>01687         dummy = cpl_image_extract(norm_flat, 1, ylow, nx, yhig);
-<a name="l01688"></a>01688         cpl_image_delete(norm_flat); norm_flat = dummy;
-<a name="l01689"></a>01689 
-<a name="l01690"></a>01690         mapped_nflat = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(norm_flat, reference,
-<a name="l01691"></a>01691                                       startwavelength, endwavelength,
-<a name="l01692"></a>01692                                       dispersion, idscoeff, 0);
-<a name="l01693"></a>01693 
-<a name="l01694"></a>01694         cpl_image_delete(norm_flat); norm_flat = NULL;
-<a name="l01695"></a>01695 
-<a name="l01696"></a>01696         header = cpl_propertylist_new();
-<a name="l01697"></a>01697         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01698"></a>01698         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01699"></a>01699         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l01700"></a>01700                                        startwavelength + dispersion/2);
-<a name="l01701"></a>01701         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01702"></a>01702         <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01703"></a>01703 <span class="comment">        cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01704"></a>01704         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01705"></a>01705         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01706"></a>01706         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01707"></a>01707         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01708"></a>01708         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01709"></a>01709         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01710"></a>01710 
-<a name="l01711"></a>01711         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, delta, delta_image_tag,
-<a name="l01712"></a>01712                            header, parlist, recipe, version))
-<a name="l01713"></a>01713             fors_calib_exit(NULL);
-<a name="l01714"></a>01714 
-<a name="l01715"></a>01715         cpl_image_delete(delta); delta = NULL;
-<a name="l01716"></a>01716 
-<a name="l01717"></a>01717         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped_flat, mapped_screen_flat_tag,
-<a name="l01718"></a>01718                            header, parlist, recipe, version))
-<a name="l01719"></a>01719             fors_calib_exit(NULL);
-<a name="l01720"></a>01720 
-<a name="l01721"></a>01721         cpl_image_delete(mapped_flat); mapped_flat = NULL;
-<a name="l01722"></a>01722 
-<a name="l01723"></a>01723         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped_nflat, mapped_norm_flat_tag,
-<a name="l01724"></a>01724                            header, parlist, recipe, version))
-<a name="l01725"></a>01725             fors_calib_exit(NULL);
-<a name="l01726"></a>01726 
-<a name="l01727"></a>01727         cpl_image_delete(mapped_nflat); mapped_nflat = NULL;
-<a name="l01728"></a>01728 
-<a name="l01729"></a>01729         cpl_propertylist_delete(header); header = NULL;
-<a name="l01730"></a>01730 
-<a name="l01731"></a>01731         cpl_msg_info(recipe, <span class="stringliteral">"Valid solutions found: %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" out of %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" rows"</span>, 
-<a name="l01732"></a>01732                      ny - cpl_table_count_invalid(idscoeff, <span class="stringliteral">"c0"</span>), ny);
-<a name="l01733"></a>01733 
-<a name="l01734"></a>01734         cpl_image_delete(spectra); spectra = NULL;
-<a name="l01735"></a>01735 
-<a name="l01736"></a>01736         mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(rectified, lines, startwavelength,
-<a name="l01737"></a>01737                                        dispersion, 6, 0);
-<a name="l01738"></a>01738 
-<a name="l01739"></a>01739         cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f pixel"</span>, mean_rms);
-<a name="l01740"></a>01740 
-<a name="l01741"></a>01741         mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l01742"></a>01742         mean_rms_err = cpl_table_get_column_stdev(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l01743"></a>01743 
-<a name="l01744"></a>01744         cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,
-<a name="l01745"></a>01745                      mean_rms, mean_rms * dispersion);
-<a name="l01746"></a>01746 
-<a name="l01747"></a>01747         restab = <a class="code" href="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55">mos_resolution_table</a>(rectified, startwavelength, dispersion,
-<a name="l01748"></a>01748                                       60000, lines);
-<a name="l01749"></a>01749 
-<a name="l01750"></a>01750         <span class="keywordflow">if</span> (restab) {
-<a name="l01751"></a>01751             cpl_msg_info(recipe, <span class="stringliteral">"Mean spectral resolution: %.2f"</span>,
-<a name="l01752"></a>01752                   cpl_table_get_column_mean(restab, <span class="stringliteral">"resolution"</span>));
-<a name="l01753"></a>01753             cpl_msg_info(recipe, 
-<a name="l01754"></a>01754                   <span class="stringliteral">"Mean reference lines FWHM: %.2f +/- %.2f pixel"</span>,
-<a name="l01755"></a>01755                   cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm"</span>) / dispersion,
-<a name="l01756"></a>01756                   cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm_rms"</span>) / dispersion);
-<a name="l01757"></a>01757 
-<a name="l01758"></a>01758             <span class="keywordflow">if</span> (qc) {
-<a name="l01759"></a>01759 
-<a name="l01760"></a>01760                 header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01761"></a>01761 
-<a name="l01762"></a>01762                 <span class="keywordflow">if</span> (header == NULL)
-<a name="l01763"></a>01763                     fors_calib_exit(<span class="stringliteral">"Cannot reload arc lamp header"</span>);
-<a name="l01764"></a>01764 
-<a name="l01765"></a>01765                 qclist = cpl_propertylist_new();
-<a name="l01766"></a>01766 
-<a name="l01767"></a>01767 
-<a name="l01768"></a>01768                 <span class="comment">/*</span>
-<a name="l01769"></a>01769 <span class="comment">                 * QC1 parameters</span>
-<a name="l01770"></a>01770 <span class="comment">                 */</span>
-<a name="l01771"></a>01771                 keyname = <span class="stringliteral">"QC.DID"</span>;
-<a name="l01772"></a>01772 
-<a name="l01773"></a>01773                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(qclist,
-<a name="l01774"></a>01774                                              keyname,
-<a name="l01775"></a>01775                                              <span class="stringliteral">"2.0"</span>,
-<a name="l01776"></a>01776                                              <span class="stringliteral">"QC1 dictionary"</span>)) {
-<a name="l01777"></a>01777                     fors_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span>
-<a name="l01778"></a>01778                                     <span class="stringliteral">"to QC log file"</span>);
-<a name="l01779"></a>01779                 }
-<a name="l01780"></a>01780    
-<a name="l01781"></a>01781                 <span class="keywordflow">if</span> (mos)
-<a name="l01782"></a>01782                     keyname = <span class="stringliteral">"QC.MOS.RESOLUTION"</span>;
-<a name="l01783"></a>01783                 <span class="keywordflow">else</span>
-<a name="l01784"></a>01784                     keyname = <span class="stringliteral">"QC.LSS.RESOLUTION"</span>;
-<a name="l01785"></a>01785 
-<a name="l01786"></a>01786                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qclist, 
-<a name="l01787"></a>01787                                            cpl_table_get_column_mean(restab,
-<a name="l01788"></a>01788                                                                  <span class="stringliteral">"resolution"</span>),
-<a name="l01789"></a>01789                                            keyname, NULL, 
-<a name="l01790"></a>01790                                            <span class="stringliteral">"Mean spectral resolution"</span>)) {
-<a name="l01791"></a>01791                     fors_calib_exit(<span class="stringliteral">"Cannot write mean spectral resolution to "</span>
-<a name="l01792"></a>01792                                     <span class="stringliteral">"QC log file"</span>);
-<a name="l01793"></a>01793                 }
-<a name="l01794"></a>01794 
-<a name="l01795"></a>01795                 <span class="keywordflow">if</span> (mos)
-<a name="l01796"></a>01796                     keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.RMS"</span>; 
-<a name="l01797"></a>01797                 <span class="keywordflow">else</span>
-<a name="l01798"></a>01798                     keyname = <span class="stringliteral">"QC.LSS.RESOLUTION.RMS"</span>;
-<a name="l01799"></a>01799 
-<a name="l01800"></a>01800                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qclist,
-<a name="l01801"></a>01801                                            cpl_table_get_column_stdev(restab,
-<a name="l01802"></a>01802                                                                 <span class="stringliteral">"resolution"</span>),
-<a name="l01803"></a>01803                                            keyname, NULL, 
-<a name="l01804"></a>01804                                            <span class="stringliteral">"Scatter of spectral resolution"</span>)) {
-<a name="l01805"></a>01805                     fors_calib_exit(<span class="stringliteral">"Cannot write spectral resolution scatter "</span>
-<a name="l01806"></a>01806                                     <span class="stringliteral">"to QC log file"</span>);
-<a name="l01807"></a>01807                 }
-<a name="l01808"></a>01808 
-<a name="l01809"></a>01809                 <span class="keywordflow">if</span> (mos)
-<a name="l01810"></a>01810                     keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.NWAVE"</span>;
-<a name="l01811"></a>01811                 <span class="keywordflow">else</span>
-<a name="l01812"></a>01812                     keyname = <span class="stringliteral">"QC.LSS.RESOLUTION.NWAVE"</span>;
-<a name="l01813"></a>01813 
-<a name="l01814"></a>01814                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g5add57d4e24de85d348f48f8a1c752bb">fors_header_write_int</a>(qclist, cpl_table_get_nrow(restab) -
-<a name="l01815"></a>01815                                         cpl_table_count_invalid(restab,
-<a name="l01816"></a>01816                                                                 <span class="stringliteral">"resolution"</span>),
-<a name="l01817"></a>01817                                         keyname, NULL,
-<a name="l01818"></a>01818                                         <span class="stringliteral">"Number of examined wavelengths "</span>
-<a name="l01819"></a>01819                                         <span class="stringliteral">"for resolution computation"</span>)) {
-<a name="l01820"></a>01820                     fors_calib_exit(<span class="stringliteral">"Cannot write number of lines used in "</span>
-<a name="l01821"></a>01821                                     <span class="stringliteral">"spectral resolution computation "</span>
-<a name="l01822"></a>01822                                     <span class="stringliteral">"to QC log file"</span>);
-<a name="l01823"></a>01823                 }
-<a name="l01824"></a>01824 
-<a name="l01825"></a>01825                 <span class="keywordflow">if</span> (mos)
-<a name="l01826"></a>01826                     keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.MEANRMS"</span>;
-<a name="l01827"></a>01827                 <span class="keywordflow">else</span>
-<a name="l01828"></a>01828                     keyname = <span class="stringliteral">"QC.LSS.RESOLUTION.MEANRMS"</span>;
-<a name="l01829"></a>01829 
-<a name="l01830"></a>01830                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qclist, 
-<a name="l01831"></a>01831                                            cpl_table_get_column_mean(restab,
-<a name="l01832"></a>01832                                                          <span class="stringliteral">"resolution_rms"</span>),
-<a name="l01833"></a>01833                                         keyname, NULL,
-<a name="l01834"></a>01834                                         <span class="stringliteral">"Mean error on spectral "</span>
-<a name="l01835"></a>01835                                         <span class="stringliteral">"resolution computation"</span>)) {
-<a name="l01836"></a>01836                     fors_calib_exit(<span class="stringliteral">"Cannot write mean error in "</span>
-<a name="l01837"></a>01837                                     <span class="stringliteral">"spectral resolution computation "</span>
-<a name="l01838"></a>01838                                     <span class="stringliteral">"to QC log file"</span>);
-<a name="l01839"></a>01839                 }
-<a name="l01840"></a>01840 
-<a name="l01841"></a>01841                 <span class="keywordflow">if</span> (mos)
-<a name="l01842"></a>01842                     keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.NLINES"</span>;
-<a name="l01843"></a>01843                 <span class="keywordflow">else</span>
-<a name="l01844"></a>01844                     keyname = <span class="stringliteral">"QC.LSS.RESOLUTION.NLINES"</span>;
-<a name="l01845"></a>01845 
-<a name="l01846"></a>01846                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g5add57d4e24de85d348f48f8a1c752bb">fors_header_write_int</a>(qclist, 
-<a name="l01847"></a>01847                          cpl_table_get_column_mean(restab, <span class="stringliteral">"nlines"</span>) *
-<a name="l01848"></a>01848                                            cpl_table_get_nrow(restab),
-<a name="l01849"></a>01849                                         keyname, NULL,
-<a name="l01850"></a>01850                                         <span class="stringliteral">"Number of lines for spectral "</span>
-<a name="l01851"></a>01851                                         <span class="stringliteral">"resolution computation"</span>)) {
-<a name="l01852"></a>01852                     fors_calib_exit(<span class="stringliteral">"Cannot write number of examined "</span>
-<a name="l01853"></a>01853                          <span class="stringliteral">"wavelengths in spectral resolution computation "</span>
-<a name="l01854"></a>01854                          <span class="stringliteral">"to QC log file"</span>);
-<a name="l01855"></a>01855                 }
-<a name="l01856"></a>01856 
-<a name="l01857"></a>01857 <span class="comment">//                fors_qc_end_group();</span>
-<a name="l01858"></a>01858 
-<a name="l01859"></a>01859             }  <span class="comment">/* End of QC1 computation */</span>
-<a name="l01860"></a>01860 
-<a name="l01861"></a>01861             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, restab, spectral_resolution_tag, 
-<a name="l01862"></a>01862                                qclist, parlist, recipe, version))
-<a name="l01863"></a>01863                 fors_calib_exit(NULL);
-<a name="l01864"></a>01864 
-<a name="l01865"></a>01865             cpl_table_delete(restab); restab = NULL;
-<a name="l01866"></a>01866             cpl_propertylist_delete(qclist); qclist = NULL;
-<a name="l01867"></a>01867 
-<a name="l01868"></a>01868         }
-<a name="l01869"></a>01869         <span class="keywordflow">else</span>
-<a name="l01870"></a>01870             fors_calib_exit(<span class="stringliteral">"Cannot compute the spectral resolution table"</span>);
-<a name="l01871"></a>01871 
-<a name="l01872"></a>01872         cpl_vector_delete(lines); lines = NULL;
-<a name="l01873"></a>01873 
-<a name="l01874"></a>01874 
-<a name="l01875"></a>01875         <span class="comment">/*</span>
-<a name="l01876"></a>01876 <span class="comment">         * Save rectified arc lamp spectrum to disk</span>
-<a name="l01877"></a>01877 <span class="comment">         */</span>
-<a name="l01878"></a>01878 
-<a name="l01879"></a>01879         header = cpl_propertylist_new();
-<a name="l01880"></a>01880         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01881"></a>01881         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01882"></a>01882         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01883"></a>01883                                        startwavelength + dispersion/2);
-<a name="l01884"></a>01884         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01885"></a>01885         <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01886"></a>01886 <span class="comment">        cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01887"></a>01887         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01888"></a>01888         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01889"></a>01889         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01890"></a>01890         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01891"></a>01891         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01892"></a>01892         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01893"></a>01893         cpl_propertylist_update_int(header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, 1);
-<a name="l01894"></a>01894 
-<a name="l01895"></a>01895         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, rectified, reduced_lamp_tag, header, 
-<a name="l01896"></a>01896                            parlist, recipe, version))
-<a name="l01897"></a>01897             fors_calib_exit(NULL);
-<a name="l01898"></a>01898 
-<a name="l01899"></a>01899         cpl_image_delete(rectified); rectified = NULL;
-<a name="l01900"></a>01900         cpl_propertylist_delete(header); header = NULL;
-<a name="l01901"></a>01901 
-<a name="l01902"></a>01902         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_coeff_tag, NULL, 
-<a name="l01903"></a>01903                            parlist, recipe, version))
-<a name="l01904"></a>01904             fors_calib_exit(NULL);
-<a name="l01905"></a>01905 
-<a name="l01906"></a>01906         cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l01907"></a>01907 
-<a name="l01908"></a>01908         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01909"></a>01909 
-<a name="l01910"></a>01910         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01911"></a>01911             fors_calib_exit(<span class="stringliteral">"Cannot reload arc lamp header"</span>);
-<a name="l01912"></a>01912 
-<a name="l01913"></a>01913         <span class="keywordflow">if</span> (qc) {
-<a name="l01914"></a>01914 
-<a name="l01915"></a>01915             compute_central_wave = 0;
-<a name="l01916"></a>01916             <span class="keywordflow">if</span> (lss) {
-<a name="l01917"></a>01917 <span class="comment">/***</span>
-<a name="l01918"></a>01918 <span class="comment">                if (fabs(1.0 - cpl_propertylist_get_double(header,</span>
-<a name="l01919"></a>01919 <span class="comment">                                             "ESO INS SLIT WID")) < 0.05)</span>
-<a name="l01920"></a>01920 <span class="comment"> ***/</span>
-<a name="l01921"></a>01921                 compute_central_wave = 1;
-<a name="l01922"></a>01922             }
-<a name="l01923"></a>01923             <span class="keywordflow">else</span> {
-<a name="l01924"></a>01924                 <span class="keywordflow">if</span> (fabs(mxpos) < 0.05)
-<a name="l01925"></a>01925                     compute_central_wave = 1;
-<a name="l01926"></a>01926             }
-<a name="l01927"></a>01927 
-<a name="l01928"></a>01928             <span class="comment">/*</span>
-<a name="l01929"></a>01929 <span class="comment">             * QC1 parameters</span>
-<a name="l01930"></a>01930 <span class="comment">             */</span>
-<a name="l01931"></a>01931             keyname = <span class="stringliteral">"QC.DID"</span>;
-<a name="l01932"></a>01932 
-<a name="l01933"></a>01933             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(header,
-<a name="l01934"></a>01934                                          keyname,
-<a name="l01935"></a>01935                                          <span class="stringliteral">"2.0"</span>,
-<a name="l01936"></a>01936                                          <span class="stringliteral">"QC1 dictionary"</span>)) {
-<a name="l01937"></a>01937                 fors_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span>
-<a name="l01938"></a>01938                                 <span class="stringliteral">"to QC log file"</span>);
-<a name="l01939"></a>01939             }
-<a name="l01940"></a>01940 
-<a name="l01941"></a>01941             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(header,
-<a name="l01942"></a>01942                                        mean_rms,
-<a name="l01943"></a>01943                                        <span class="stringliteral">"QC.WAVE.ACCURACY"</span>,
-<a name="l01944"></a>01944                                        <span class="stringliteral">"pixel"</span>,
-<a name="l01945"></a>01945                                        <span class="stringliteral">"Mean accuracy of wavecalib model"</span>)) {
-<a name="l01946"></a>01946                 fors_calib_exit(<span class="stringliteral">"Cannot write mean wavelength calibration "</span>
-<a name="l01947"></a>01947                                 <span class="stringliteral">"accuracy to QC log file"</span>);
-<a name="l01948"></a>01948             }
-<a name="l01949"></a>01949 
-<a name="l01950"></a>01950             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(header,
-<a name="l01951"></a>01951                                        mean_rms_err,
-<a name="l01952"></a>01952                                        <span class="stringliteral">"QC.WAVE.ACCURACY.ERROR"</span>,
-<a name="l01953"></a>01953                                        <span class="stringliteral">"pixel"</span>,
-<a name="l01954"></a>01954                                        <span class="stringliteral">"Error on accuracy of wavecalib model"</span>)) {
-<a name="l01955"></a>01955                 fors_calib_exit(<span class="stringliteral">"Cannot write error on wavelength calibration "</span>
-<a name="l01956"></a>01956                                 <span class="stringliteral">"accuracy to QC log file"</span>);
-<a name="l01957"></a>01957             }
-<a name="l01958"></a>01958 
-<a name="l01959"></a>01959             <span class="keywordflow">if</span> (compute_central_wave) {
-<a name="l01960"></a>01960 
-<a name="l01961"></a>01961                 data = cpl_image_get_data(wavemap);
-<a name="l01962"></a>01962     
-<a name="l01963"></a>01963                 <span class="keywordflow">if</span> (lss) {
-<a name="l01964"></a>01964                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(header, 
-<a name="l01965"></a>01965                                                data[nx/2 + ccd_ysize*nx/2],
-<a name="l01966"></a>01966                                                <span class="stringliteral">"QC.LSS.CENTRAL.WAVELENGTH"</span>,
-<a name="l01967"></a>01967                                                <span class="stringliteral">"Angstrom"</span>, 
-<a name="l01968"></a>01968                                                <span class="stringliteral">"Wavelength at CCD center"</span>)) {
-<a name="l01969"></a>01969                         fors_calib_exit(<span class="stringliteral">"Cannot write central wavelength to QC "</span>
-<a name="l01970"></a>01970                                         <span class="stringliteral">"log file"</span>);
-<a name="l01971"></a>01971                     }
-<a name="l01972"></a>01972                 }
-<a name="l01973"></a>01973                 <span class="keywordflow">else</span> {
-<a name="l01974"></a>01974                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(header, 
-<a name="l01975"></a>01975                                                data[nx/2 + ccd_ysize*nx/2],
-<a name="l01976"></a>01976                                                <span class="stringliteral">"QC.MOS.CENTRAL.WAVELENGTH"</span>,
-<a name="l01977"></a>01977                                                <span class="stringliteral">"Angstrom"</span>, 
-<a name="l01978"></a>01978                                                <span class="stringliteral">"Wavelength at CCD center"</span>)) {
-<a name="l01979"></a>01979                         fors_calib_exit(<span class="stringliteral">"Cannot write central wavelength to QC "</span>
-<a name="l01980"></a>01980                                         <span class="stringliteral">"log file"</span>);
-<a name="l01981"></a>01981                     }
-<a name="l01982"></a>01982                 }
-<a name="l01983"></a>01983             }
-<a name="l01984"></a>01984         }
-<a name="l01985"></a>01985 
-<a name="l01986"></a>01986         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, wavemap, wavelength_map_tag, header,
-<a name="l01987"></a>01987                            parlist, recipe, version))
-<a name="l01988"></a>01988             fors_calib_exit(NULL);
-<a name="l01989"></a>01989 
-<a name="l01990"></a>01990         cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l01991"></a>01991 
-<a name="l01992"></a>01992         cpl_propertylist_erase_regexp(header, <span class="stringliteral">"^ESO QC "</span>, 0);
-<a name="l01993"></a>01993 
-<a name="l01994"></a>01994         <span class="keywordflow">if</span> (check) {
-<a name="l01995"></a>01995             cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01996"></a>01996             cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01997"></a>01997             <span class="comment">/* cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01998"></a>01998             cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, 1.0);
-<a name="l01999"></a>01999             cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02000"></a>02000             cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02001"></a>02001             cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02002"></a>02002             cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02003"></a>02003             cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02004"></a>02004 
-<a name="l02005"></a>02005             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, residual, disp_residuals_tag, header,
-<a name="l02006"></a>02006                                parlist, recipe, version))
-<a name="l02007"></a>02007                 fors_calib_exit(NULL);
-<a name="l02008"></a>02008 
-<a name="l02009"></a>02009             cpl_image_delete(residual); residual = NULL;
-<a name="l02010"></a>02010         }
-<a name="l02011"></a>02011 
-<a name="l02012"></a>02012         cpl_propertylist_delete(header); header = NULL;
-<a name="l02013"></a>02013         cpl_free(instrume); instrume = NULL;
-<a name="l02014"></a>02014 
-<a name="l02015"></a>02015         <span class="keywordflow">return</span> 0;         <span class="comment">/* Successful LSS data reduction */</span>
-<a name="l02016"></a>02016 
-<a name="l02017"></a>02017     }   <span class="comment">/* End of LSS data reduction section */</span>
-<a name="l02018"></a>02018 
-<a name="l02019"></a>02019 
-<a name="l02020"></a>02020     <span class="comment">/*</span>
-<a name="l02021"></a>02021 <span class="comment">     * Here the MOS and MXU calibration is carried out.</span>
-<a name="l02022"></a>02022 <span class="comment">     */</span>
-<a name="l02023"></a>02023 
-<a name="l02024"></a>02024     <span class="comment">/*</span>
-<a name="l02025"></a>02025 <span class="comment">     * Detecting spectra on the CCD</span>
-<a name="l02026"></a>02026 <span class="comment">     */</span>
-<a name="l02027"></a>02027 
-<a name="l02028"></a>02028     cpl_msg_indent_less();
-<a name="l02029"></a>02029     cpl_msg_info(recipe, <span class="stringliteral">"Detecting spectra on CCD..."</span>);
-<a name="l02030"></a>02030     cpl_msg_indent_more();
-<a name="l02031"></a>02031 
-<a name="l02032"></a>02032     ccd_xsize = nx = cpl_image_get_size_x(spectra);
-<a name="l02033"></a>02033     ccd_ysize = ny = cpl_image_get_size_y(spectra);
-<a name="l02034"></a>02034 
-<a name="l02035"></a>02035     refmask = cpl_mask_new(nx, ny);
-<a name="l02036"></a>02036 
-<a name="l02037"></a>02037     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(spectra))
-<a name="l02038"></a>02038     fors_calib_exit(<span class="stringliteral">"Cannot process saturation"</span>);
-<a name="l02039"></a>02039 
-<a name="l02040"></a>02040     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(spectra))
-<a name="l02041"></a>02041     fors_calib_exit(<span class="stringliteral">"Cannot subtract the background"</span>);
-<a name="l02042"></a>02042  
-<a name="l02043"></a>02043     checkwave = <a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion, 
-<a name="l02044"></a>02044                                                peakdetection, wradius, 
-<a name="l02045"></a>02045                                                wdegree, wreject, reference,
-<a name="l02046"></a>02046                                                &startwavelength, &endwavelength,
-<a name="l02047"></a>02047                                                NULL, NULL, NULL, NULL, NULL, 
-<a name="l02048"></a>02048                                                NULL, refmask);
-<a name="l02049"></a>02049 
-<a name="l02050"></a>02050     <span class="keywordflow">if</span> (checkwave == NULL)
-<a name="l02051"></a>02051         fors_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l02052"></a>02052 
-<a name="l02053"></a>02053     <span class="comment">/*</span>
-<a name="l02054"></a>02054 <span class="comment">     * Save check image to disk</span>
-<a name="l02055"></a>02055 <span class="comment">     */</span>
-<a name="l02056"></a>02056 
-<a name="l02057"></a>02057     header = cpl_propertylist_new();
-<a name="l02058"></a>02058     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l02059"></a>02059     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02060"></a>02060     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l02061"></a>02061                                    startwavelength + dispersion/2);
-<a name="l02062"></a>02062     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02063"></a>02063     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l02064"></a>02064 <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l02065"></a>02065     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l02066"></a>02066     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02067"></a>02067     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02068"></a>02068     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02069"></a>02069     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02070"></a>02070     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02071"></a>02071 
-<a name="l02072"></a>02072     <span class="keywordflow">if</span> (check) {
-<a name="l02073"></a>02073         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, checkwave, spectra_detection_tag, header, 
-<a name="l02074"></a>02074                            parlist, recipe, version))
-<a name="l02075"></a>02075             fors_calib_exit(NULL);
-<a name="l02076"></a>02076     }
-<a name="l02077"></a>02077 
-<a name="l02078"></a>02078     cpl_image_delete(checkwave); checkwave = NULL;
-<a name="l02079"></a>02079     cpl_propertylist_delete(header); header = NULL;
-<a name="l02080"></a>02080 
-<a name="l02081"></a>02081     cpl_msg_info(recipe, <span class="stringliteral">"Locate slits at reference wavelength on CCD..."</span>);
-<a name="l02082"></a>02082     slits = <a class="code" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_spectra</a>(refmask);
-<a name="l02083"></a>02083 
-<a name="l02084"></a>02084     <span class="keywordflow">if</span> (!slits) {
-<a name="l02085"></a>02085         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l02086"></a>02086         fors_calib_exit(<span class="stringliteral">"No slits could be detected!"</span>);
-<a name="l02087"></a>02087     }
-<a name="l02088"></a>02088 
-<a name="l02089"></a>02089     refimage = cpl_image_new_from_mask(refmask);
-<a name="l02090"></a>02090     cpl_mask_delete(refmask); refmask = NULL;
-<a name="l02091"></a>02091 
-<a name="l02092"></a>02092     <span class="keywordflow">if</span> (check) {
-<a name="l02093"></a>02093         save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l02094"></a>02094         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, refimage, slit_map_tag, save_header,
-<a name="l02095"></a>02095                            parlist, recipe, version))
-<a name="l02096"></a>02096             fors_calib_exit(NULL);
-<a name="l02097"></a>02097         cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l02098"></a>02098     }
-<a name="l02099"></a>02099 
-<a name="l02100"></a>02100     cpl_image_delete(refimage); refimage = NULL;
-<a name="l02101"></a>02101 
-<a name="l02102"></a>02102     <span class="keywordflow">if</span> (slit_ident) {
-<a name="l02103"></a>02103 
-<a name="l02104"></a>02104         <span class="comment">/*</span>
-<a name="l02105"></a>02105 <span class="comment">         * Attempt slit identification: this recipe may continue even</span>
-<a name="l02106"></a>02106 <span class="comment">         * in case of failed identification (i.e., the position table is </span>
-<a name="l02107"></a>02107 <span class="comment">         * not produced, but an error is not set). In case of failure,</span>
-<a name="l02108"></a>02108 <span class="comment">         * the spectra would be still extracted, even if they would not</span>
-<a name="l02109"></a>02109 <span class="comment">         * be associated to slits on the mask.</span>
-<a name="l02110"></a>02110 <span class="comment">         * </span>
-<a name="l02111"></a>02111 <span class="comment">         * The reason for making the slit identification an user option </span>
-<a name="l02112"></a>02112 <span class="comment">         * (via the parameter slit_ident) is to offer the possibility </span>
-<a name="l02113"></a>02113 <span class="comment">         * to avoid identifications that are only apparently successful, </span>
-<a name="l02114"></a>02114 <span class="comment">         * as it would happen in the case of an incorrect slit description </span>
-<a name="l02115"></a>02115 <span class="comment">         * in the data header.</span>
-<a name="l02116"></a>02116 <span class="comment">         */</span>
-<a name="l02117"></a>02117 
-<a name="l02118"></a>02118         cpl_msg_indent_less();
-<a name="l02119"></a>02119         cpl_msg_info(recipe, <span class="stringliteral">"Attempt slit identification (optional)..."</span>);
-<a name="l02120"></a>02120         cpl_msg_indent_more();
-<a name="l02121"></a>02121 
-<a name="l02122"></a>02122         positions = <a class="code" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits</a>(slits, maskslits, NULL);
-<a name="l02123"></a>02123 
-<a name="l02124"></a>02124         <span class="keywordflow">if</span> (positions) {
-<a name="l02125"></a>02125             cpl_table_delete(slits);
-<a name="l02126"></a>02126             slits = positions;
-<a name="l02127"></a>02127 
-<a name="l02128"></a>02128             <span class="comment">/*</span>
-<a name="l02129"></a>02129 <span class="comment">             * Eliminate slits which are _entirely_ outside the CCD</span>
-<a name="l02130"></a>02130 <span class="comment">             */</span>
-<a name="l02131"></a>02131 
-<a name="l02132"></a>02132             cpl_table_and_selected_double(slits, 
-<a name="l02133"></a>02133                                           <span class="stringliteral">"ybottom"</span>, CPL_GREATER_THAN, ny-1);
-<a name="l02134"></a>02134             cpl_table_or_selected_double(slits, 
-<a name="l02135"></a>02135                                           <span class="stringliteral">"ytop"</span>, CPL_LESS_THAN, 0);
-<a name="l02136"></a>02136             cpl_table_erase_selected(slits);
-<a name="l02137"></a>02137 
-<a name="l02138"></a>02138             nslits = cpl_table_get_nrow(slits);
-<a name="l02139"></a>02139 
-<a name="l02140"></a>02140             <span class="keywordflow">if</span> (nslits == 0)
-<a name="l02141"></a>02141                 fors_calib_exit(<span class="stringliteral">"No slits found on the CCD"</span>);
-<a name="l02142"></a>02142 
-<a name="l02143"></a>02143             cpl_msg_info(recipe, <span class="stringliteral">"%d slits are entirely or partially "</span>
-<a name="l02144"></a>02144                          <span class="stringliteral">"contained in CCD"</span>, nslits);
-<a name="l02145"></a>02145 
-<a name="l02146"></a>02146         }
-<a name="l02147"></a>02147         <span class="keywordflow">else</span> {
-<a name="l02148"></a>02148             slit_ident = 0;
-<a name="l02149"></a>02149             cpl_msg_info(recipe, <span class="stringliteral">"Global distortion model cannot be computed"</span>);
-<a name="l02150"></a>02150             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l02151"></a>02151                 fors_calib_exit(NULL);
-<a name="l02152"></a>02152             }
-<a name="l02153"></a>02153         }
-<a name="l02154"></a>02154     }
-<a name="l02155"></a>02155 
-<a name="l02156"></a>02156 
-<a name="l02157"></a>02157     <span class="comment">/*</span>
-<a name="l02158"></a>02158 <span class="comment">     * Determination of spectral curvature</span>
-<a name="l02159"></a>02159 <span class="comment">     */</span>
-<a name="l02160"></a>02160 
-<a name="l02161"></a>02161     cpl_msg_indent_less();
-<a name="l02162"></a>02162     cpl_msg_info(recipe, <span class="stringliteral">"Determining spectral curvature..."</span>);
-<a name="l02163"></a>02163     cpl_msg_indent_more();
-<a name="l02164"></a>02164 
-<a name="l02165"></a>02165     cpl_msg_info(recipe, <span class="stringliteral">"Tracing master flat field spectra edges..."</span>);
-<a name="l02166"></a>02166     traces = <a class="code" href="group__moses.html#g168f6aecd869c24634fa9f6690da0b02">mos_trace_flat</a>(trace_flat, slits, reference, 
-<a name="l02167"></a>02167                             startwavelength, endwavelength, dispersion);
-<a name="l02168"></a>02168 
-<a name="l02169"></a>02169     <span class="keywordflow">if</span> (!traces)
-<a name="l02170"></a>02170         fors_calib_exit(<span class="stringliteral">"Tracing failure"</span>);
-<a name="l02171"></a>02171 
-<a name="l02172"></a>02172     cpl_image_delete(added_flat); added_flat = NULL;
-<a name="l02173"></a>02173 
-<a name="l02174"></a>02174     cpl_msg_info(recipe, <span class="stringliteral">"Fitting flat field spectra edges..."</span>);
-<a name="l02175"></a>02175     polytraces = <a class="code" href="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414">mos_poly_trace</a>(slits, traces, cdegree);
-<a name="l02176"></a>02176 
-<a name="l02177"></a>02177     <span class="keywordflow">if</span> (!polytraces)
-<a name="l02178"></a>02178         fors_calib_exit(<span class="stringliteral">"Trace fitting failure"</span>);
-<a name="l02179"></a>02179 
-<a name="l02180"></a>02180     <span class="keywordflow">if</span> (cmode) {
-<a name="l02181"></a>02181         cpl_msg_info(recipe, <span class="stringliteral">"Computing global spectral curvature model..."</span>);
-<a name="l02182"></a>02182         <a class="code" href="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5">mos_global_trace</a>(slits, polytraces, cmode);
-<a name="l02183"></a>02183     }
-<a name="l02184"></a>02184 
-<a name="l02185"></a>02185     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, traces, curv_traces_tag, NULL, parlist,
-<a name="l02186"></a>02186                        recipe, version))
-<a name="l02187"></a>02187         fors_calib_exit(NULL);
-<a name="l02188"></a>02188 
-<a name="l02189"></a>02189     cpl_table_delete(traces); traces = NULL;
-<a name="l02190"></a>02190 
-<a name="l02191"></a>02191     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l02192"></a>02192     spatial = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, reference, 
-<a name="l02193"></a>02193                                       startwavelength, endwavelength, 
-<a name="l02194"></a>02194                                       dispersion, 0, coordinate);
-<a name="l02195"></a>02195 
-<a name="l02196"></a>02196     <span class="keywordflow">if</span> (!slit_ident) {
-<a name="l02197"></a>02197         cpl_image_delete(spectra); spectra = NULL;
-<a name="l02198"></a>02198     }
-<a name="l02199"></a>02199 
-<a name="l02200"></a>02200     <span class="comment">/*</span>
-<a name="l02201"></a>02201 <span class="comment">     * Flat field normalisation is done directly on the master flat</span>
-<a name="l02202"></a>02202 <span class="comment">     * field (without spatial rectification first). The spectral</span>
-<a name="l02203"></a>02203 <span class="comment">     * curvature model may be provided in input, in future releases.</span>
-<a name="l02204"></a>02204 <span class="comment">     */</span>
-<a name="l02205"></a>02205 
-<a name="l02206"></a>02206     cpl_msg_indent_less();
-<a name="l02207"></a>02207     cpl_msg_info(recipe, <span class="stringliteral">"Perform flat field normalisation..."</span>);
-<a name="l02208"></a>02208     cpl_msg_indent_more();
-<a name="l02209"></a>02209 
-<a name="l02210"></a>02210     norm_flat = cpl_image_duplicate(master_flat);
-<a name="l02211"></a>02211 
-<a name="l02212"></a>02212     smo_flat = <a class="code" href="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff">mos_normalise_flat</a>(norm_flat, coordinate, slits, polytraces, 
-<a name="l02213"></a>02213                                   reference, startwavelength, endwavelength,
-<a name="l02214"></a>02214                                   dispersion, dradius, ddegree);
-<a name="l02215"></a>02215 
-<a name="l02216"></a>02216     cpl_image_delete(smo_flat); smo_flat = NULL;  <span class="comment">/* It may be a product */</span>
-<a name="l02217"></a>02217 
-<a name="l02218"></a>02218  
-<a name="l02219"></a>02219     save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, flat_tag, 0);
-<a name="l02220"></a>02220     cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, nflats);
-<a name="l02221"></a>02221 <span class="comment">//%%%</span>
-<a name="l02222"></a>02222     rect_flat = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(master_flat, slits, polytraces, 
-<a name="l02223"></a>02223                                         reference, startwavelength, 
-<a name="l02224"></a>02224                                         endwavelength, dispersion, 0, NULL);
-<a name="l02225"></a>02225     rect_nflat = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(norm_flat, slits, polytraces, 
-<a name="l02226"></a>02226                                         reference, startwavelength, 
-<a name="l02227"></a>02227                                         endwavelength, dispersion, 0, NULL);
-<a name="l02228"></a>02228 <span class="comment">//%%%</span>
-<a name="l02229"></a>02229 
-<a name="l02230"></a>02230     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, master_flat, master_screen_flat_tag,
-<a name="l02231"></a>02231                        save_header, parlist, recipe, version))
-<a name="l02232"></a>02232         fors_calib_exit(NULL);
-<a name="l02233"></a>02233 
-<a name="l02234"></a>02234     cpl_image_delete(master_flat); master_flat = NULL;
-<a name="l02235"></a>02235 
-<a name="l02236"></a>02236     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, norm_flat, master_norm_flat_tag,
-<a name="l02237"></a>02237                        save_header, parlist, recipe, version))
-<a name="l02238"></a>02238         fors_calib_exit(NULL);
-<a name="l02239"></a>02239 
-<a name="l02240"></a>02240     cpl_image_delete(norm_flat); norm_flat = NULL;
-<a name="l02241"></a>02241     cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l02242"></a>02242 
-<a name="l02243"></a>02243 
-<a name="l02244"></a>02244     <span class="comment">/*</span>
-<a name="l02245"></a>02245 <span class="comment">     * Final wavelength calibration of spectra having their curvature</span>
-<a name="l02246"></a>02246 <span class="comment">     * removed</span>
-<a name="l02247"></a>02247 <span class="comment">     */</span>
-<a name="l02248"></a>02248 
-<a name="l02249"></a>02249     cpl_msg_indent_less();
-<a name="l02250"></a>02250     cpl_msg_info(recipe, <span class="stringliteral">"Perform final wavelength calibration..."</span>);
-<a name="l02251"></a>02251     cpl_msg_indent_more();
-<a name="l02252"></a>02252 
-<a name="l02253"></a>02253     nx = cpl_image_get_size_x(spatial);
-<a name="l02254"></a>02254     ny = cpl_image_get_size_y(spatial);
-<a name="l02255"></a>02255 
-<a name="l02256"></a>02256     idscoeff = cpl_table_new(ny);
-<a name="l02257"></a>02257     restable = cpl_table_new(nlines);
-<a name="l02258"></a>02258     rainbow = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l02259"></a>02259     <span class="keywordflow">if</span> (check)
-<a name="l02260"></a>02260         residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l02261"></a>02261     fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l02262"></a>02262     fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l02263"></a>02263 
-<a name="l02264"></a>02264     rectified = <a class="code" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final</a>(spatial, slits, lines, 
-<a name="l02265"></a>02265                                                  dispersion, peakdetection, 
-<a name="l02266"></a>02266                                                  wradius, wdegree, wreject,
-<a name="l02267"></a>02267                                                  reference, &startwavelength, 
-<a name="l02268"></a>02268                                                  &endwavelength, fitlines, 
-<a name="l02269"></a>02269                                                  fiterror, idscoeff, rainbow, 
-<a name="l02270"></a>02270                                                  residual, restable);
-<a name="l02271"></a>02271 
-<a name="l02272"></a>02272 <span class="comment">/*</span>
-<a name="l02273"></a>02273 <span class="comment">dfs_save_image(frameset, rainbow, "rainbow_calib", NULL, parlist, recipe, version);</span>
-<a name="l02274"></a>02274 <span class="comment">*/</span>
-<a name="l02275"></a>02275 
-<a name="l02276"></a>02276     <span class="keywordflow">if</span> (rectified == NULL)
-<a name="l02277"></a>02277         fors_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l02278"></a>02278 
-<a name="l02279"></a>02279     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, restable, disp_residuals_table_tag, NULL,
-<a name="l02280"></a>02280                        parlist, recipe, version))
-<a name="l02281"></a>02281         fors_calib_exit(NULL);
-<a name="l02282"></a>02282 
-<a name="l02283"></a>02283     cpl_table_delete(restable); restable = NULL;
-<a name="l02284"></a>02284 
-<a name="l02285"></a>02285     cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;
-<a name="l02286"></a>02286     cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l02287"></a>02287     cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;
-<a name="l02288"></a>02288 
-<a name="l02289"></a>02289     <span class="keywordflow">for</span> (i = 0; i < ny; i++)
-<a name="l02290"></a>02290         <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))
-<a name="l02291"></a>02291             cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);
-<a name="l02292"></a>02292 
-<a name="l02293"></a>02293     <span class="keywordflow">if</span> (wmosmode > 0) {
-<a name="l02294"></a>02294         <a class="code" href="group__moses.html#ga06affb6c77aac402204d1065f1de8ea">mos_interpolate_wavecalib_slit</a>(idscoeff, slits, 1, wmosmode - 1);
-<a name="l02295"></a>02295 
-<a name="l02296"></a>02296         cpl_image_delete(rectified);
-<a name="l02297"></a>02297 
-<a name="l02298"></a>02298         rectified = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(spatial, reference,
-<a name="l02299"></a>02299                                            startwavelength, endwavelength,
-<a name="l02300"></a>02300                                            dispersion, idscoeff, 0);
-<a name="l02301"></a>02301     }
-<a name="l02302"></a>02302 
-<a name="l02303"></a>02303     cpl_image_delete(spatial); spatial = NULL;
-<a name="l02304"></a>02304 
-<a name="l02305"></a>02305     delta = <a class="code" href="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1">mos_map_pixel</a>(idscoeff, reference, startwavelength,
-<a name="l02306"></a>02306                           endwavelength, dispersion, 2);
-<a name="l02307"></a>02307 
-<a name="l02308"></a>02308     header = cpl_propertylist_new();
-<a name="l02309"></a>02309     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l02310"></a>02310     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02311"></a>02311     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l02312"></a>02312                                    startwavelength + dispersion/2);
-<a name="l02313"></a>02313     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02314"></a>02314     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l02315"></a>02315 <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l02316"></a>02316     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l02317"></a>02317     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02318"></a>02318     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02319"></a>02319     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02320"></a>02320     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02321"></a>02321     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02322"></a>02322 
-<a name="l02323"></a>02323     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, delta, delta_image_tag,
-<a name="l02324"></a>02324                        header, parlist, recipe, version))
-<a name="l02325"></a>02325         fors_calib_exit(NULL);
-<a name="l02326"></a>02326 
-<a name="l02327"></a>02327     cpl_image_delete(delta); delta = NULL;
-<a name="l02328"></a>02328     cpl_propertylist_delete(header); header = NULL;
-<a name="l02329"></a>02329 
-<a name="l02330"></a>02330     mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(rectified, lines, startwavelength, 
-<a name="l02331"></a>02331                                    dispersion, 6, 0);
-<a name="l02332"></a>02332 
-<a name="l02333"></a>02333     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f pixel"</span>, mean_rms);
-<a name="l02334"></a>02334 
-<a name="l02335"></a>02335     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l02336"></a>02336     mean_rms_err = cpl_table_get_column_stdev(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l02337"></a>02337 
-<a name="l02338"></a>02338     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>, 
-<a name="l02339"></a>02339                  mean_rms, mean_rms * dispersion);
-<a name="l02340"></a>02340 
-<a name="l02341"></a>02341     restab = <a class="code" href="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55">mos_resolution_table</a>(rectified, startwavelength, dispersion, 
-<a name="l02342"></a>02342                                   60000, lines);
-<a name="l02343"></a>02343 
-<a name="l02344"></a>02344     <span class="keywordflow">if</span> (restab) {
-<a name="l02345"></a>02345         cpl_msg_info(recipe, <span class="stringliteral">"Mean spectral resolution: %.2f"</span>, 
-<a name="l02346"></a>02346                    cpl_table_get_column_mean(restab, <span class="stringliteral">"resolution"</span>));
-<a name="l02347"></a>02347         cpl_msg_info(recipe, <span class="stringliteral">"Mean reference lines FWHM: %.2f +/- %.2f pixel"</span>,
-<a name="l02348"></a>02348                    cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm"</span>) / dispersion,
-<a name="l02349"></a>02349                    cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm_rms"</span>) / dispersion);
-<a name="l02350"></a>02350 
-<a name="l02351"></a>02351         <span class="keywordflow">if</span> (qc) {
-<a name="l02352"></a>02352 
-<a name="l02353"></a>02353             qclist = cpl_propertylist_new();
-<a name="l02354"></a>02354 
-<a name="l02355"></a>02355             <span class="comment">/*</span>
-<a name="l02356"></a>02356 <span class="comment">             * QC1 parameters</span>
-<a name="l02357"></a>02357 <span class="comment">             */</span>
-<a name="l02358"></a>02358             keyname = <span class="stringliteral">"QC.DID"</span>;
-<a name="l02359"></a>02359 
-<a name="l02360"></a>02360             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(qclist,
-<a name="l02361"></a>02361                                          keyname,
-<a name="l02362"></a>02362                                          <span class="stringliteral">"2.0"</span>,
-<a name="l02363"></a>02363                                          <span class="stringliteral">"QC1 dictionary"</span>)) {
-<a name="l02364"></a>02364                 fors_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span>
-<a name="l02365"></a>02365                                 <span class="stringliteral">"to QC log file"</span>);
-<a name="l02366"></a>02366             }
-<a name="l02367"></a>02367 
-<a name="l02368"></a>02368             <span class="keywordflow">if</span> (mos)
-<a name="l02369"></a>02369                 keyname = <span class="stringliteral">"QC.MOS.RESOLUTION"</span>;
-<a name="l02370"></a>02370             <span class="keywordflow">else</span>
-<a name="l02371"></a>02371                 keyname = <span class="stringliteral">"QC.MXU.RESOLUTION"</span>;
-<a name="l02372"></a>02372 
-<a name="l02373"></a>02373             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qclist, 
-<a name="l02374"></a>02374                                        cpl_table_get_column_mean(restab,
-<a name="l02375"></a>02375                                                                  <span class="stringliteral">"resolution"</span>),
-<a name="l02376"></a>02376                                        keyname,
-<a name="l02377"></a>02377                                        <span class="stringliteral">"Angstrom"</span>,
-<a name="l02378"></a>02378                                        <span class="stringliteral">"Mean spectral resolution"</span>)) {
-<a name="l02379"></a>02379                 fors_calib_exit(<span class="stringliteral">"Cannot write mean spectral resolution to QC "</span>
-<a name="l02380"></a>02380                                 <span class="stringliteral">"log file"</span>);
-<a name="l02381"></a>02381             }
-<a name="l02382"></a>02382 
-<a name="l02383"></a>02383             <span class="keywordflow">if</span> (mos)
-<a name="l02384"></a>02384                 keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.RMS"</span>;
-<a name="l02385"></a>02385             <span class="keywordflow">else</span>
-<a name="l02386"></a>02386                 keyname = <span class="stringliteral">"QC.MXU.RESOLUTION.RMS"</span>;
-<a name="l02387"></a>02387 
-<a name="l02388"></a>02388             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qclist, 
-<a name="l02389"></a>02389                                        cpl_table_get_column_stdev(restab, 
-<a name="l02390"></a>02390                                                                   <span class="stringliteral">"resolution"</span>),
-<a name="l02391"></a>02391                                        keyname,
-<a name="l02392"></a>02392                                        <span class="stringliteral">"Angstrom"</span>, 
-<a name="l02393"></a>02393                                        <span class="stringliteral">"Scatter of spectral resolution"</span>)) {
-<a name="l02394"></a>02394                 fors_calib_exit(<span class="stringliteral">"Cannot write spectral resolution scatter "</span>
-<a name="l02395"></a>02395                                 <span class="stringliteral">"to QC log file"</span>);
-<a name="l02396"></a>02396             }
-<a name="l02397"></a>02397 
-<a name="l02398"></a>02398             <span class="keywordflow">if</span> (mos)
-<a name="l02399"></a>02399                 keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.NWAVE"</span>;
-<a name="l02400"></a>02400             <span class="keywordflow">else</span>
-<a name="l02401"></a>02401                 keyname = <span class="stringliteral">"QC.MXU.RESOLUTION.NWAVE"</span>;
-<a name="l02402"></a>02402 
-<a name="l02403"></a>02403             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g5add57d4e24de85d348f48f8a1c752bb">fors_header_write_int</a>(qclist, cpl_table_get_nrow(restab) -
-<a name="l02404"></a>02404                                     cpl_table_count_invalid(restab, 
-<a name="l02405"></a>02405                                                             <span class="stringliteral">"resolution"</span>),
-<a name="l02406"></a>02406                                     keyname,
-<a name="l02407"></a>02407                                     NULL,
-<a name="l02408"></a>02408                                     <span class="stringliteral">"Number of examined wavelengths "</span>
-<a name="l02409"></a>02409                                     <span class="stringliteral">"for resolution computation"</span>)) {
-<a name="l02410"></a>02410                 fors_calib_exit(<span class="stringliteral">"Cannot write number of lines used in "</span>
-<a name="l02411"></a>02411                                 <span class="stringliteral">"spectral resolution computation "</span>
-<a name="l02412"></a>02412                                 <span class="stringliteral">"to QC log file"</span>);
-<a name="l02413"></a>02413             }
-<a name="l02414"></a>02414 
-<a name="l02415"></a>02415             <span class="keywordflow">if</span> (mos)
-<a name="l02416"></a>02416                 keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.MEANRMS"</span>;
-<a name="l02417"></a>02417             <span class="keywordflow">else</span>
-<a name="l02418"></a>02418                 keyname = <span class="stringliteral">"QC.MXU.RESOLUTION.MEANRMS"</span>;
-<a name="l02419"></a>02419 
-<a name="l02420"></a>02420             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qclist,
-<a name="l02421"></a>02421                                        cpl_table_get_column_mean(restab,
-<a name="l02422"></a>02422                                                      <span class="stringliteral">"resolution_rms"</span>),
-<a name="l02423"></a>02423                                     keyname, NULL,
-<a name="l02424"></a>02424                                     <span class="stringliteral">"Mean error on spectral "</span>
-<a name="l02425"></a>02425                                     <span class="stringliteral">"resolution computation"</span>)) {
-<a name="l02426"></a>02426                 fors_calib_exit(<span class="stringliteral">"Cannot write mean error in "</span>
-<a name="l02427"></a>02427                                 <span class="stringliteral">"spectral resolution computation "</span>
-<a name="l02428"></a>02428                                 <span class="stringliteral">"to QC log file"</span>);
-<a name="l02429"></a>02429             }
-<a name="l02430"></a>02430 
-<a name="l02431"></a>02431             <span class="keywordflow">if</span> (mos)
-<a name="l02432"></a>02432                 keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.NLINES"</span>;
-<a name="l02433"></a>02433             <span class="keywordflow">else</span>
-<a name="l02434"></a>02434                 keyname = <span class="stringliteral">"QC.MXU.RESOLUTION.NLINES"</span>;
-<a name="l02435"></a>02435 
-<a name="l02436"></a>02436             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g5add57d4e24de85d348f48f8a1c752bb">fors_header_write_int</a>(qclist,
-<a name="l02437"></a>02437                      cpl_table_get_column_mean(restab, <span class="stringliteral">"nlines"</span>) *
-<a name="l02438"></a>02438                                        cpl_table_get_nrow(restab),
-<a name="l02439"></a>02439                                     keyname, NULL,
-<a name="l02440"></a>02440                                     <span class="stringliteral">"Number of lines for spectral "</span>
-<a name="l02441"></a>02441                                     <span class="stringliteral">"resolution computation"</span>)) {
-<a name="l02442"></a>02442                 fors_calib_exit(<span class="stringliteral">"Cannot write number of examined "</span>
-<a name="l02443"></a>02443                      <span class="stringliteral">"wavelengths in spectral resolution computation "</span>
-<a name="l02444"></a>02444                      <span class="stringliteral">"to QC log file"</span>);
-<a name="l02445"></a>02445             }
-<a name="l02446"></a>02446         }
-<a name="l02447"></a>02447 
-<a name="l02448"></a>02448         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, restab, spectral_resolution_tag, qclist,
-<a name="l02449"></a>02449                            parlist, recipe, version))
-<a name="l02450"></a>02450             fors_calib_exit(NULL);
-<a name="l02451"></a>02451 
-<a name="l02452"></a>02452         cpl_table_delete(restab); restab = NULL;
-<a name="l02453"></a>02453         cpl_propertylist_delete(qclist); qclist = NULL;
-<a name="l02454"></a>02454 
-<a name="l02455"></a>02455     }
-<a name="l02456"></a>02456     <span class="keywordflow">else</span>
-<a name="l02457"></a>02457         fors_calib_exit(<span class="stringliteral">"Cannot compute the spectral resolution table"</span>);
-<a name="l02458"></a>02458 
-<a name="l02459"></a>02459     cpl_vector_delete(lines); lines = NULL;
-<a name="l02460"></a>02460 
-<a name="l02461"></a>02461     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_coeff_tag, NULL,
-<a name="l02462"></a>02462                        parlist, recipe, version))
-<a name="l02463"></a>02463         fors_calib_exit(NULL);
-<a name="l02464"></a>02464 <span class="comment">//%%%</span>
-<a name="l02465"></a>02465 
-<a name="l02466"></a>02466     mapped_flat = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(rect_flat, reference,
-<a name="l02467"></a>02467                                       startwavelength, endwavelength,
-<a name="l02468"></a>02468                                       dispersion, idscoeff, 0);
-<a name="l02469"></a>02469 
-<a name="l02470"></a>02470     mapped_nflat = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(rect_nflat, reference,
-<a name="l02471"></a>02471                                       startwavelength, endwavelength,
-<a name="l02472"></a>02472                                       dispersion, idscoeff, 0);
-<a name="l02473"></a>02473 
-<a name="l02474"></a>02474     cpl_image_delete(rect_flat); rect_flat = NULL;
-<a name="l02475"></a>02475     cpl_image_delete(rect_nflat); rect_nflat = NULL;
-<a name="l02476"></a>02476 <span class="comment">//%%%</span>
-<a name="l02477"></a>02477 
-<a name="l02478"></a>02478     <span class="comment">/*</span>
-<a name="l02479"></a>02479 <span class="comment">     * Global distortion models</span>
-<a name="l02480"></a>02480 <span class="comment">     */</span>
-<a name="l02481"></a>02481 
-<a name="l02482"></a>02482     <span class="keywordflow">if</span> (slit_ident) {
-<a name="l02483"></a>02483 
-<a name="l02484"></a>02484         cpl_msg_info(recipe, <span class="stringliteral">"Computing global distortions model"</span>);
-<a name="l02485"></a>02485         global = <a class="code" href="group__moses.html#gdf9210c07ebddae07a3e5e99d88d2f5c">mos_global_distortion</a>(slits, maskslits, idscoeff, 
-<a name="l02486"></a>02486                                        polytraces, reference);
-<a name="l02487"></a>02487 
-<a name="l02488"></a>02488         <span class="keywordflow">if</span> (global && 0) {
-<a name="l02489"></a>02489             cpl_table *stest;
-<a name="l02490"></a>02490             cpl_table *ctest;
-<a name="l02491"></a>02491             cpl_table *dtest;
-<a name="l02492"></a>02492             cpl_image *itest;
-<a name="l02493"></a>02493 
-<a name="l02494"></a>02494             stest = <a class="code" href="group__moses.html#g39dd696d6572e52031e12b1a53e505c2">mos_build_slit_location</a>(global, maskslits, ccd_ysize);
-<a name="l02495"></a>02495 
-<a name="l02496"></a>02496             ctest = <a class="code" href="group__moses.html#ga010593249434f0bb667af2f2c950951">mos_build_curv_coeff</a>(global, maskslits, stest);
-<a name="l02497"></a>02497             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, ctest, <span class="stringliteral">"CURVS"</span>, NULL,
-<a name="l02498"></a>02498                                parlist, recipe, version))
-<a name="l02499"></a>02499                 fors_calib_exit(NULL);
-<a name="l02500"></a>02500 
-<a name="l02501"></a>02501             itest = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, stest, ctest, 
-<a name="l02502"></a>02502                                             reference, startwavelength, 
-<a name="l02503"></a>02503                                             endwavelength, dispersion, 
-<a name="l02504"></a>02504                                             0, NULL);
-<a name="l02505"></a>02505             cpl_table_delete(ctest); ctest = NULL;
-<a name="l02506"></a>02506             cpl_image_delete(itest); itest = NULL;
-<a name="l02507"></a>02507             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, stest, <span class="stringliteral">"SLITS"</span>, NULL,
-<a name="l02508"></a>02508                                parlist, recipe, version))
-<a name="l02509"></a>02509                 fors_calib_exit(NULL);
-<a name="l02510"></a>02510 
-<a name="l02511"></a>02511             dtest = <a class="code" href="group__moses.html#gc4a3f1981baef15668137f04c04cf710">mos_build_disp_coeff</a>(global, stest);
-<a name="l02512"></a>02512             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, dtest, <span class="stringliteral">"DISPS"</span>, NULL,
-<a name="l02513"></a>02513                                parlist, recipe, version))
-<a name="l02514"></a>02514                 fors_calib_exit(NULL);
-<a name="l02515"></a>02515 
-<a name="l02516"></a>02516             cpl_table_delete(dtest); dtest = NULL;
-<a name="l02517"></a>02517             cpl_table_delete(stest); stest = NULL;
-<a name="l02518"></a>02518         }
-<a name="l02519"></a>02519 
-<a name="l02520"></a>02520         <span class="keywordflow">if</span> (global) {
-<a name="l02521"></a>02521             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, global, global_distortion_tag, NULL,
-<a name="l02522"></a>02522                                parlist, recipe, version))
-<a name="l02523"></a>02523                 fors_calib_exit(NULL);
-<a name="l02524"></a>02524             cpl_table_delete(global); global = NULL;
-<a name="l02525"></a>02525         }
-<a name="l02526"></a>02526 
-<a name="l02527"></a>02527         cpl_image_delete(spectra); spectra = NULL;
-<a name="l02528"></a>02528         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l02529"></a>02529     }
-<a name="l02530"></a>02530 
-<a name="l02531"></a>02531     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l02532"></a>02532 
-<a name="l02533"></a>02533     header = cpl_propertylist_new();
-<a name="l02534"></a>02534     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l02535"></a>02535     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02536"></a>02536     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l02537"></a>02537                                    startwavelength + dispersion/2);
-<a name="l02538"></a>02538     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02539"></a>02539     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l02540"></a>02540 <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l02541"></a>02541     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l02542"></a>02542     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02543"></a>02543     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02544"></a>02544     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02545"></a>02545     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02546"></a>02546     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02547"></a>02547     cpl_propertylist_update_int(header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, 1);
-<a name="l02548"></a>02548 
-<a name="l02549"></a>02549     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, rectified, reduced_lamp_tag, header,
-<a name="l02550"></a>02550                        parlist, recipe, version))
-<a name="l02551"></a>02551         fors_calib_exit(NULL);
-<a name="l02552"></a>02552 
-<a name="l02553"></a>02553     cpl_image_delete(rectified); rectified = NULL;
-<a name="l02554"></a>02554 <span class="comment">//%%%</span>
-<a name="l02555"></a>02555     cpl_propertylist_update_int(header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, nflats);
-<a name="l02556"></a>02556 
-<a name="l02557"></a>02557     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped_flat, mapped_screen_flat_tag, header,
-<a name="l02558"></a>02558                        parlist, recipe, version))
-<a name="l02559"></a>02559         fors_calib_exit(NULL);
-<a name="l02560"></a>02560 
-<a name="l02561"></a>02561     cpl_image_delete(mapped_flat); mapped_flat = NULL;
-<a name="l02562"></a>02562 
-<a name="l02563"></a>02563     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped_nflat, mapped_norm_flat_tag, header,
-<a name="l02564"></a>02564                        parlist, recipe, version))
-<a name="l02565"></a>02565         fors_calib_exit(NULL);
-<a name="l02566"></a>02566 
-<a name="l02567"></a>02567     cpl_image_delete(mapped_nflat); mapped_nflat = NULL;
-<a name="l02568"></a>02568 
-<a name="l02569"></a>02569     cpl_propertylist_delete(header); header = NULL;
-<a name="l02570"></a>02570 
-<a name="l02571"></a>02571     <span class="keywordflow">if</span> (check) {
-<a name="l02572"></a>02572         save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l02573"></a>02573 
-<a name="l02574"></a>02574         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02575"></a>02575         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02576"></a>02576         <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span>
-<a name="l02577"></a>02577         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, 1.0);
-<a name="l02578"></a>02578         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02579"></a>02579         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02580"></a>02580         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02581"></a>02581         cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02582"></a>02582         cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02583"></a>02583 
-<a name="l02584"></a>02584         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, residual, disp_residuals_tag, save_header,
-<a name="l02585"></a>02585                            parlist, recipe, version))
-<a name="l02586"></a>02586             fors_calib_exit(NULL);
-<a name="l02587"></a>02587 
-<a name="l02588"></a>02588         cpl_image_delete(residual); residual = NULL;
-<a name="l02589"></a>02589         cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l02590"></a>02590     }
-<a name="l02591"></a>02591 
-<a name="l02592"></a>02592     wavemap = <a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(coordinate, rainbow, slits, polytraces, 
-<a name="l02593"></a>02593                                   reference, startwavelength, endwavelength, 
-<a name="l02594"></a>02594                                   dispersion);
-<a name="l02595"></a>02595 
-<a name="l02596"></a>02596     cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l02597"></a>02597 
-<a name="l02598"></a>02598     save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l02599"></a>02599 
-<a name="l02600"></a>02600     <span class="keywordflow">if</span> (qc) {
-<a name="l02601"></a>02601 
-<a name="l02602"></a>02602         <span class="comment">/*</span>
-<a name="l02603"></a>02603 <span class="comment">         * QC1 parameters</span>
-<a name="l02604"></a>02604 <span class="comment">         */</span>
-<a name="l02605"></a>02605         keyname = <span class="stringliteral">"QC.DID"</span>;
-<a name="l02606"></a>02606 
-<a name="l02607"></a>02607         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(save_header,
-<a name="l02608"></a>02608                                      keyname,
-<a name="l02609"></a>02609                                      <span class="stringliteral">"2.0"</span>,
-<a name="l02610"></a>02610                                      <span class="stringliteral">"QC1 dictionary"</span>)) {
-<a name="l02611"></a>02611             fors_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span>
-<a name="l02612"></a>02612                             <span class="stringliteral">"to QC log file"</span>);
-<a name="l02613"></a>02613         }
-<a name="l02614"></a>02614 
-<a name="l02615"></a>02615         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(save_header,
-<a name="l02616"></a>02616                                    mean_rms,
-<a name="l02617"></a>02617                                    <span class="stringliteral">"QC.WAVE.ACCURACY"</span>,
-<a name="l02618"></a>02618                                    <span class="stringliteral">"pixel"</span>,
-<a name="l02619"></a>02619                                    <span class="stringliteral">"Mean accuracy of wavecalib model"</span>)) {
-<a name="l02620"></a>02620             fors_calib_exit(<span class="stringliteral">"Cannot write mean wavelength calibration "</span>
-<a name="l02621"></a>02621                             <span class="stringliteral">"accuracy to QC log file"</span>);
-<a name="l02622"></a>02622         }
-<a name="l02623"></a>02623 
-<a name="l02624"></a>02624 
-<a name="l02625"></a>02625         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(save_header,
-<a name="l02626"></a>02626                                    mean_rms_err,
-<a name="l02627"></a>02627                                    <span class="stringliteral">"QC.WAVE.ACCURACY.ERROR"</span>,
-<a name="l02628"></a>02628                                    <span class="stringliteral">"pixel"</span>,
-<a name="l02629"></a>02629                                    <span class="stringliteral">"Error on accuracy of wavecalib model"</span>)) {
-<a name="l02630"></a>02630             fors_calib_exit(<span class="stringliteral">"Cannot write error on wavelength calibration "</span>
-<a name="l02631"></a>02631                             <span class="stringliteral">"accuracy to QC log file"</span>);
-<a name="l02632"></a>02632         }
-<a name="l02633"></a>02633     }
-<a name="l02634"></a>02634 
-<a name="l02635"></a>02635     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, wavemap, wavelength_map_tag, save_header,
-<a name="l02636"></a>02636                        parlist, recipe, version))
-<a name="l02637"></a>02637         fors_calib_exit(NULL);
-<a name="l02638"></a>02638 
-<a name="l02639"></a>02639     cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l02640"></a>02640 
-<a name="l02641"></a>02641     cpl_propertylist_erase_regexp(save_header, <span class="stringliteral">"^ESO QC "</span>, 0);
-<a name="l02642"></a>02642 
-<a name="l02643"></a>02643     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, coordinate, spatial_map_tag, save_header,
-<a name="l02644"></a>02644                        parlist, recipe, version))
-<a name="l02645"></a>02645         fors_calib_exit(NULL);
-<a name="l02646"></a>02646 
-<a name="l02647"></a>02647     cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l02648"></a>02648     cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l02649"></a>02649 
-<a name="l02650"></a>02650     header = NULL;    <span class="comment">/* To be really, really, REALLY sure... */</span>
-<a name="l02651"></a>02651 
-<a name="l02652"></a>02652     <span class="keywordflow">if</span> (qc) {
-<a name="l02653"></a>02653 
-<a name="l02654"></a>02654         <span class="keywordtype">double</span> maxpos, maxneg, maxcurve, maxslope;
-<a name="l02655"></a>02655 
-<a name="l02656"></a>02656         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l02657"></a>02657 
-<a name="l02658"></a>02658         <span class="comment">/*</span>
-<a name="l02659"></a>02659 <span class="comment">         * QC1 parameters</span>
-<a name="l02660"></a>02660 <span class="comment">         */</span>
-<a name="l02661"></a>02661         keyname = <span class="stringliteral">"QC.DID"</span>;
-<a name="l02662"></a>02662 
-<a name="l02663"></a>02663         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(header,
-<a name="l02664"></a>02664                                      keyname,
-<a name="l02665"></a>02665                                      <span class="stringliteral">"2.0"</span>,
-<a name="l02666"></a>02666                                      <span class="stringliteral">"QC1 dictionary"</span>)) {
-<a name="l02667"></a>02667             fors_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span>
-<a name="l02668"></a>02668                             <span class="stringliteral">"to QC log file"</span>);
-<a name="l02669"></a>02669         }
-<a name="l02670"></a>02670 
-<a name="l02671"></a>02671         maxpos = fabs(cpl_table_get_column_max(polytraces, <span class="stringliteral">"c2"</span>));
-<a name="l02672"></a>02672         maxneg = fabs(cpl_table_get_column_min(polytraces, <span class="stringliteral">"c2"</span>));
-<a name="l02673"></a>02673         maxcurve = maxpos > maxneg ? maxpos : maxneg;
-<a name="l02674"></a>02674         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(header,
-<a name="l02675"></a>02675                                    maxcurve,
-<a name="l02676"></a>02676                                    <span class="stringliteral">"QC.TRACE.MAX.CURVATURE"</span>,
-<a name="l02677"></a>02677                                    <span class="stringliteral">"Y pixel / X pixel ^2"</span>,
-<a name="l02678"></a>02678                                    <span class="stringliteral">"Max observed curvature in "</span>
-<a name="l02679"></a>02679                                    <span class="stringliteral">"spectral tracing"</span>)) {
-<a name="l02680"></a>02680             fors_calib_exit(<span class="stringliteral">"Cannot write max observed curvature in spectral "</span>
-<a name="l02681"></a>02681                             <span class="stringliteral">"tracing to QC log file"</span>);
-<a name="l02682"></a>02682         }
-<a name="l02683"></a>02683 
-<a name="l02684"></a>02684         maxpos = fabs(cpl_table_get_column_max(polytraces, <span class="stringliteral">"c1"</span>));
-<a name="l02685"></a>02685         maxneg = fabs(cpl_table_get_column_min(polytraces, <span class="stringliteral">"c1"</span>));
-<a name="l02686"></a>02686         maxslope = maxpos > maxneg ? maxpos : maxneg;
-<a name="l02687"></a>02687         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(header,
-<a name="l02688"></a>02688                                    maxslope,
-<a name="l02689"></a>02689                                    <span class="stringliteral">"QC.TRACE.MAX.SLOPE"</span>,
-<a name="l02690"></a>02690                                    <span class="stringliteral">"Y pixel / X pixel"</span>,
-<a name="l02691"></a>02691                                    <span class="stringliteral">"Max observed slope in spectral tracing"</span>)) {
-<a name="l02692"></a>02692             fors_calib_exit(<span class="stringliteral">"Cannot write max observed slope in spectral "</span>
-<a name="l02693"></a>02693                             <span class="stringliteral">"tracing to QC log file"</span>);
-<a name="l02694"></a>02694         }
-<a name="l02695"></a>02695 
-<a name="l02696"></a>02696 <span class="comment">//        fors_qc_end_group();</span>
-<a name="l02697"></a>02697     }
-<a name="l02698"></a>02698 
-<a name="l02699"></a>02699     cpl_free(instrume); instrume = NULL;
-<a name="l02700"></a>02700 
-<a name="l02701"></a>02701     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, polytraces, curv_coeff_tag, header,
-<a name="l02702"></a>02702                        parlist, recipe, version))
-<a name="l02703"></a>02703         fors_calib_exit(NULL);
-<a name="l02704"></a>02704 
-<a name="l02705"></a>02705     cpl_propertylist_delete(header); header = NULL;
-<a name="l02706"></a>02706     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l02707"></a>02707 
-<a name="l02708"></a>02708     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,
-<a name="l02709"></a>02709                        parlist, recipe, version))
-<a name="l02710"></a>02710         fors_calib_exit(NULL);
-<a name="l02711"></a>02711 
-<a name="l02712"></a>02712     cpl_table_delete(slits); slits = NULL;
-<a name="l02713"></a>02713 
-<a name="l02714"></a>02714     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l02715"></a>02715         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l02716"></a>02716         fors_calib_exit(NULL);
-<a name="l02717"></a>02717     }
-<a name="l02718"></a>02718 
-<a name="l02719"></a>02719     <span class="keywordflow">return</span> 0;
-<a name="l02720"></a>02720 }
-<a name="l02721"></a>02721 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__config_8c-source.html b/html/fors__config_8c-source.html
deleted file mode 100644
index 8e12c10..0000000
--- a/html/fors__config_8c-source.html
+++ /dev/null
@@ -1,738 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_config.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_config.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_config.c,v 1.4 2010/09/14 07:38:16 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:38:16 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <string.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <math.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <moses.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_create(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_exec(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_destroy(cpl_plugin *);
-<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config(cpl_parameterlist *, cpl_frameset *);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_config_description[] =
-<a name="l00044"></a>00044 <span class="stringliteral">"This recipe is used to create the so-called GRISM_TABLE, containing all\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"the FORS spectral pipeline configuration parameters related to a specific\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"grism. This is a way to provide for each specific instrument mode a set of\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"appropriate defaults for the recipe parameters.\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"The values assigned to each input parameter of fors_config are simply\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"copied to a FITS table consisting of one row, and as many columns as the\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"input parameter: each column will have the same name and type of each\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"parameter. Only the three parameters \"instrument\", \"grism\", and\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"\"id\" are not written to the table columns, but to the descriptor header\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"keywords INSTRUME, ESO INS GRIS1 NAME, and ESO INS GRIS1 ID, that will be\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"used by the automatic pipeline for appropriate data association.\n\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"Input files: none\n\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  GRISM_TABLE                FITS table  Recipe configuration parameters\n\n"</span>;
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 <span class="preprocessor">#define fors_config_exit(message)             \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">{                                             \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">cpl_table_delete(table);                      \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">cpl_free(filename);                           \</span>
-<a name="l00067"></a>00067 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">}</span>
-<a name="l00069"></a>00069 <span class="preprocessor"></span>
-<a name="l00070"></a>00070 
-<a name="l00082"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00082</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00083"></a>00083 {
-<a name="l00084"></a>00084     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00085"></a>00085     cpl_plugin *plugin = &recipe->interface;
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087     cpl_plugin_init(plugin,
-<a name="l00088"></a>00088                     CPL_PLUGIN_API,
-<a name="l00089"></a>00089                     FORS_BINARY_VERSION,
-<a name="l00090"></a>00090                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00091"></a>00091                     <span class="stringliteral">"fors_config"</span>,
-<a name="l00092"></a>00092                     <span class="stringliteral">"Creation of FORS recipes configuration tables"</span>,
-<a name="l00093"></a>00093                     fors_config_description,
-<a name="l00094"></a>00094                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00095"></a>00095                     PACKAGE_BUGREPORT,
-<a name="l00096"></a>00096     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00097"></a>00097     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00098"></a>00098     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00099"></a>00099     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00100"></a>00100     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00101"></a>00101     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00102"></a>00102     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00103"></a>00103     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00104"></a>00104     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00105"></a>00105     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00106"></a>00106     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00107"></a>00107     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00108"></a>00108     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00109"></a>00109                     fors_config_create,
-<a name="l00110"></a>00110                     fors_config_exec,
-<a name="l00111"></a>00111                     fors_config_destroy);
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     cpl_pluginlist_append(list, plugin);
-<a name="l00114"></a>00114     
-<a name="l00115"></a>00115     <span class="keywordflow">return</span> 0;
-<a name="l00116"></a>00116 }
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118 
-<a name="l00129"></a>00129 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_create(cpl_plugin *plugin)
-<a name="l00130"></a>00130 {
-<a name="l00131"></a>00131     cpl_recipe    *recipe;
-<a name="l00132"></a>00132     cpl_parameter *p;
-<a name="l00133"></a>00133 
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     <span class="comment">/* </span>
-<a name="l00136"></a>00136 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00137"></a>00137 <span class="comment">     */</span>
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00140"></a>00140         recipe = (cpl_recipe *)plugin;
-<a name="l00141"></a>00141     <span class="keywordflow">else</span> 
-<a name="l00142"></a>00142         <span class="keywordflow">return</span> -1;
-<a name="l00143"></a>00143 
-<a name="l00144"></a>00144     <span class="comment">/* </span>
-<a name="l00145"></a>00145 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00146"></a>00146 <span class="comment">     */</span>
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     <span class="comment">/*</span>
-<a name="l00152"></a>00152 <span class="comment">     * Dispersion</span>
-<a name="l00153"></a>00153 <span class="comment">     */</span>
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.dispersion"</span>,
-<a name="l00156"></a>00156                                 CPL_TYPE_DOUBLE,
-<a name="l00157"></a>00157                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00158"></a>00158                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00159"></a>00159                                 0.0);
-<a name="l00160"></a>00160     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00161"></a>00161     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00162"></a>00162     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164     <span class="comment">/*</span>
-<a name="l00165"></a>00165 <span class="comment">     * Peak detection level</span>
-<a name="l00166"></a>00166 <span class="comment">     */</span>
-<a name="l00167"></a>00167 
-<a name="l00168"></a>00168     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.peakdetection"</span>,
-<a name="l00169"></a>00169                                 CPL_TYPE_DOUBLE,
-<a name="l00170"></a>00170                                 <span class="stringliteral">"Peak detection threshold (ADU)"</span>,
-<a name="l00171"></a>00171                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00172"></a>00172                                 250.0);
-<a name="l00173"></a>00173     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);
-<a name="l00174"></a>00174     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00175"></a>00175     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177     <span class="comment">/* </span>
-<a name="l00178"></a>00178 <span class="comment">     * Degree of wavelength calibration polynomial</span>
-<a name="l00179"></a>00179 <span class="comment">     */</span>
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.wdegree"</span>,
-<a name="l00182"></a>00182                                 CPL_TYPE_INT,
-<a name="l00183"></a>00183                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,
-<a name="l00184"></a>00184                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00185"></a>00185                                 4);
-<a name="l00186"></a>00186     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);
-<a name="l00187"></a>00187     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00188"></a>00188     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <span class="comment">/*</span>
-<a name="l00191"></a>00191 <span class="comment">     * Reference lines search radius</span>
-<a name="l00192"></a>00192 <span class="comment">     */</span>
-<a name="l00193"></a>00193 
-<a name="l00194"></a>00194 <span class="comment">/*</span>
-<a name="l00195"></a>00195 <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.wradius",</span>
-<a name="l00196"></a>00196 <span class="comment">                                CPL_TYPE_INT,</span>
-<a name="l00197"></a>00197 <span class="comment">                                "Search radius if iterating pattern-matching "</span>
-<a name="l00198"></a>00198 <span class="comment">                                "with first-guess method",</span>
-<a name="l00199"></a>00199 <span class="comment">                                "fors.fors_config",</span>
-<a name="l00200"></a>00200 <span class="comment">                                0);</span>
-<a name="l00201"></a>00201 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "wradius");</span>
-<a name="l00202"></a>00202 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00203"></a>00203 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00204"></a>00204 <span class="comment">*/</span>
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206     <span class="comment">/*</span>
-<a name="l00207"></a>00207 <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span>
-<a name="l00208"></a>00208 <span class="comment">     */</span>
-<a name="l00209"></a>00209 
-<a name="l00210"></a>00210 <span class="comment">/*</span>
-<a name="l00211"></a>00211 <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.wreject",</span>
-<a name="l00212"></a>00212 <span class="comment">                                CPL_TYPE_DOUBLE,</span>
-<a name="l00213"></a>00213 <span class="comment">                                "Rejection threshold in dispersion "</span>
-<a name="l00214"></a>00214 <span class="comment">                                "relation fit (pixel)",</span>
-<a name="l00215"></a>00215 <span class="comment">                                "fors.fors_config",</span>
-<a name="l00216"></a>00216 <span class="comment">                                0.7);</span>
-<a name="l00217"></a>00217 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "wreject");</span>
-<a name="l00218"></a>00218 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00219"></a>00219 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00220"></a>00220 <span class="comment">*/</span>
-<a name="l00221"></a>00221 
-<a name="l00222"></a>00222     <span class="comment">/*</span>
-<a name="l00223"></a>00223 <span class="comment">     * Wavelength solution interpolation (for LSS data)</span>
-<a name="l00224"></a>00224 <span class="comment">     */</span>
-<a name="l00225"></a>00225  
-<a name="l00226"></a>00226 <span class="comment">/*</span>
-<a name="l00227"></a>00227 <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.wmode",</span>
-<a name="l00228"></a>00228 <span class="comment">                                CPL_TYPE_INT,</span>
-<a name="l00229"></a>00229 <span class="comment">                                "Interpolation mode of wavelength solution "</span>
-<a name="l00230"></a>00230 <span class="comment">                                "applicable to LSS-like data (0 = no "</span>
-<a name="l00231"></a>00231 <span class="comment">                                "interpolation, 1 = fill gaps, 2 = global "</span>
-<a name="l00232"></a>00232 <span class="comment">                                "model",</span>
-<a name="l00233"></a>00233 <span class="comment">                                "fors.fors_config",</span>
-<a name="l00234"></a>00234 <span class="comment">                                0);</span>
-<a name="l00235"></a>00235 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "wmode");</span>
-<a name="l00236"></a>00236 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00237"></a>00237 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00238"></a>00238 <span class="comment">*/</span>
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240     <span class="comment">/*</span>
-<a name="l00241"></a>00241 <span class="comment">     * Degree of spectral curvature polynomial</span>
-<a name="l00242"></a>00242 <span class="comment">     */</span>
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.cdegree"</span>,
-<a name="l00245"></a>00245                                 CPL_TYPE_INT,
-<a name="l00246"></a>00246                                 <span class="stringliteral">"Degree of spectral curvature polynomial"</span>,
-<a name="l00247"></a>00247                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00248"></a>00248                                 4);
-<a name="l00249"></a>00249     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cdegree"</span>);
-<a name="l00250"></a>00250     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00251"></a>00251     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253     <span class="comment">/*</span>
-<a name="l00254"></a>00254 <span class="comment">     * Global curvature model</span>
-<a name="l00255"></a>00255 <span class="comment">     */</span>
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257 <span class="comment">/*</span>
-<a name="l00258"></a>00258 <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.cglobal",</span>
-<a name="l00259"></a>00259 <span class="comment">                                CPL_TYPE_BOOL,</span>
-<a name="l00260"></a>00260 <span class="comment">                                "Global curvature model",</span>
-<a name="l00261"></a>00261 <span class="comment">                                "fors.fors_config",</span>
-<a name="l00262"></a>00262 <span class="comment">                                TRUE);</span>
-<a name="l00263"></a>00263 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "cglobal");</span>
-<a name="l00264"></a>00264 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00265"></a>00265 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00266"></a>00266 <span class="comment">*/</span>
-<a name="l00267"></a>00267 
-<a name="l00268"></a>00268     <span class="comment">/*</span>
-<a name="l00269"></a>00269 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00270"></a>00270 <span class="comment">     */</span>
-<a name="l00271"></a>00271 
-<a name="l00272"></a>00272     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.startwavelength"</span>,
-<a name="l00273"></a>00273                                 CPL_TYPE_DOUBLE,
-<a name="l00274"></a>00274                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00275"></a>00275                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00276"></a>00276                                 0.0);
-<a name="l00277"></a>00277     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00278"></a>00278     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00279"></a>00279     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281     <span class="comment">/*</span>
-<a name="l00282"></a>00282 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00283"></a>00283 <span class="comment">     */</span>
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.endwavelength"</span>,
-<a name="l00286"></a>00286                                 CPL_TYPE_DOUBLE,
-<a name="l00287"></a>00287                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00288"></a>00288                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00289"></a>00289                                 0.0);
-<a name="l00290"></a>00290     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00291"></a>00291     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00292"></a>00292     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00293"></a>00293 
-<a name="l00294"></a>00294     <span class="comment">/*</span>
-<a name="l00295"></a>00295 <span class="comment">     * Try slit identification</span>
-<a name="l00296"></a>00296 <span class="comment">     */</span>
-<a name="l00297"></a>00297 
-<a name="l00298"></a>00298 <span class="comment">/*</span>
-<a name="l00299"></a>00299 <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.slit_ident",</span>
-<a name="l00300"></a>00300 <span class="comment">                                CPL_TYPE_BOOL,</span>
-<a name="l00301"></a>00301 <span class="comment">                                "Attempt slit identification for MOS or MXU",</span>
-<a name="l00302"></a>00302 <span class="comment">                                "fors.fors_config",</span>
-<a name="l00303"></a>00303 <span class="comment">                                TRUE);</span>
-<a name="l00304"></a>00304 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "slit_ident");</span>
-<a name="l00305"></a>00305 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00306"></a>00306 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00307"></a>00307 <span class="comment">*/</span>
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309     <span class="comment">/*</span>
-<a name="l00310"></a>00310 <span class="comment">     * Degree of flat field fitting polynomial along spatial direction </span>
-<a name="l00311"></a>00311 <span class="comment">     * (used for LSS data)</span>
-<a name="l00312"></a>00312 <span class="comment">     */</span>
-<a name="l00313"></a>00313 
-<a name="l00314"></a>00314 <span class="comment">/*</span>
-<a name="l00315"></a>00315 <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.sdegree",</span>
-<a name="l00316"></a>00316 <span class="comment">                                CPL_TYPE_INT,</span>
-<a name="l00317"></a>00317 <span class="comment">                                "Degree of flat field fitting polynomial "</span>
-<a name="l00318"></a>00318 <span class="comment">                                "along spatial direction (used for LSS "</span>
-<a name="l00319"></a>00319 <span class="comment">                                "data only)",</span>
-<a name="l00320"></a>00320 <span class="comment">                                "fors.fors_config",</span>
-<a name="l00321"></a>00321 <span class="comment">                                4);</span>
-<a name="l00322"></a>00322 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "sdegree");</span>
-<a name="l00323"></a>00323 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00324"></a>00324 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00325"></a>00325 <span class="comment">*/</span>
-<a name="l00326"></a>00326 
-<a name="l00327"></a>00327     <span class="comment">/*</span>
-<a name="l00328"></a>00328 <span class="comment">     * Degree of flat field fitting polynomial along dispersion direction</span>
-<a name="l00329"></a>00329 <span class="comment">     * (used for MOS and MXU data)</span>
-<a name="l00330"></a>00330 <span class="comment">     */</span>
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332 <span class="comment">/*</span>
-<a name="l00333"></a>00333 <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.ddegree",</span>
-<a name="l00334"></a>00334 <span class="comment">                                CPL_TYPE_INT,</span>
-<a name="l00335"></a>00335 <span class="comment">                                "Degree of flat field fitting polynomial "</span>
-<a name="l00336"></a>00336 <span class="comment">                                "along dispersion direction (used for MOS "</span>
-<a name="l00337"></a>00337 <span class="comment">                                "and MXU data only)",</span>
-<a name="l00338"></a>00338 <span class="comment">                                "fors.fors_config",</span>
-<a name="l00339"></a>00339 <span class="comment">                                7);</span>
-<a name="l00340"></a>00340 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "ddegree");</span>
-<a name="l00341"></a>00341 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00342"></a>00342 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00343"></a>00343 <span class="comment">*/</span>
-<a name="l00344"></a>00344 
-<a name="l00345"></a>00345     <span class="comment">/*</span>
-<a name="l00346"></a>00346 <span class="comment">     * Smooth box radius for flat field along dispersion direction</span>
-<a name="l00347"></a>00347 <span class="comment">     */</span>
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349 <span class="comment">/*</span>
-<a name="l00350"></a>00350 <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.dradius",</span>
-<a name="l00351"></a>00351 <span class="comment">                                CPL_TYPE_INT,</span>
-<a name="l00352"></a>00352 <span class="comment">                                "Smooth box radius for flat field along "</span>
-<a name="l00353"></a>00353 <span class="comment">                                "dispersion direction",</span>
-<a name="l00354"></a>00354 <span class="comment">                                "fors.fors_config",</span>
-<a name="l00355"></a>00355 <span class="comment">                                10);</span>
-<a name="l00356"></a>00356 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "dradius");</span>
-<a name="l00357"></a>00357 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00358"></a>00358 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00359"></a>00359 <span class="comment">*/</span>
-<a name="l00360"></a>00360 
-<a name="l00361"></a>00361     <span class="comment">/*</span>
-<a name="l00362"></a>00362 <span class="comment">     * Smooth box radius for flat field along spatial direction</span>
-<a name="l00363"></a>00363 <span class="comment">     * (used for LSS data only)</span>
-<a name="l00364"></a>00364 <span class="comment">     */</span>
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366 <span class="comment">/*</span>
-<a name="l00367"></a>00367 <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.sradius",</span>
-<a name="l00368"></a>00368 <span class="comment">                                CPL_TYPE_INT,</span>
-<a name="l00369"></a>00369 <span class="comment">                                "Smooth box radius for flat field along "</span>
-<a name="l00370"></a>00370 <span class="comment">                                "spatial direction (used for LSS data only)",</span>
-<a name="l00371"></a>00371 <span class="comment">                                "fors.fors_config",</span>
-<a name="l00372"></a>00372 <span class="comment">                                10);</span>
-<a name="l00373"></a>00373 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "sradius");</span>
-<a name="l00374"></a>00374 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00375"></a>00375 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00376"></a>00376 <span class="comment">*/</span>
-<a name="l00377"></a>00377 
-<a name="l00378"></a>00378     <span class="comment">/* </span>
-<a name="l00379"></a>00379 <span class="comment">     * Sky lines alignment</span>
-<a name="l00380"></a>00380 <span class="comment">     */</span>
-<a name="l00381"></a>00381 
-<a name="l00382"></a>00382 <span class="comment">/*</span>
-<a name="l00383"></a>00383 <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.skyalign",</span>
-<a name="l00384"></a>00384 <span class="comment">                                CPL_TYPE_INT,</span>
-<a name="l00385"></a>00385 <span class="comment">                                "Polynomial order for sky lines alignment, "</span>
-<a name="l00386"></a>00386 <span class="comment">                                "or -1 to avoid alignment",</span>
-<a name="l00387"></a>00387 <span class="comment">                                "fors.fors_config",</span>
-<a name="l00388"></a>00388 <span class="comment">                                -1);</span>
-<a name="l00389"></a>00389 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "skyalign");</span>
-<a name="l00390"></a>00390 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00391"></a>00391 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00392"></a>00392 <span class="comment">*/</span>
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394     <span class="comment">/*</span>
-<a name="l00395"></a>00395 <span class="comment">     * Instrument name</span>
-<a name="l00396"></a>00396 <span class="comment">     */</span>
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.instrument"</span>,
-<a name="l00399"></a>00399                                 CPL_TYPE_STRING,
-<a name="l00400"></a>00400                                 <span class="stringliteral">"Name of instrument"</span>,
-<a name="l00401"></a>00401                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00402"></a>00402                                 <span class="stringliteral">"0"</span>);
-<a name="l00403"></a>00403     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"instrument"</span>);
-<a name="l00404"></a>00404     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00405"></a>00405     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407     <span class="comment">/*</span>
-<a name="l00408"></a>00408 <span class="comment">     * Grism name</span>
-<a name="l00409"></a>00409 <span class="comment">     */</span>
-<a name="l00410"></a>00410 
-<a name="l00411"></a>00411     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.grism"</span>,
-<a name="l00412"></a>00412                                 CPL_TYPE_STRING,
-<a name="l00413"></a>00413                                 <span class="stringliteral">"Name of grism"</span>,
-<a name="l00414"></a>00414                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00415"></a>00415                                 <span class="stringliteral">"0"</span>);
-<a name="l00416"></a>00416     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"grism"</span>);
-<a name="l00417"></a>00417     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00418"></a>00418     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420     <span class="comment">/*</span>
-<a name="l00421"></a>00421 <span class="comment">     * Grism id</span>
-<a name="l00422"></a>00422 <span class="comment">     */</span>
-<a name="l00423"></a>00423 
-<a name="l00424"></a>00424     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.grism_id"</span>,
-<a name="l00425"></a>00425                                 CPL_TYPE_STRING,
-<a name="l00426"></a>00426                                 <span class="stringliteral">"Grism ID"</span>,
-<a name="l00427"></a>00427                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00428"></a>00428                                 <span class="stringliteral">"0"</span>);
-<a name="l00429"></a>00429     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"grism_id"</span>);
-<a name="l00430"></a>00430     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00431"></a>00431     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433     <span class="comment">/*</span>
-<a name="l00434"></a>00434 <span class="comment">     * Filter name</span>
-<a name="l00435"></a>00435 <span class="comment">     */</span>
-<a name="l00436"></a>00436 
-<a name="l00437"></a>00437     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.filter"</span>,
-<a name="l00438"></a>00438                                 CPL_TYPE_STRING,
-<a name="l00439"></a>00439                                 <span class="stringliteral">"Name of filter"</span>,
-<a name="l00440"></a>00440                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00441"></a>00441                                 <span class="stringliteral">"0"</span>);
-<a name="l00442"></a>00442     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"filter"</span>);
-<a name="l00443"></a>00443     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00444"></a>00444     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00445"></a>00445 
-<a name="l00446"></a>00446     <span class="comment">/*</span>
-<a name="l00447"></a>00447 <span class="comment">     * Filter id</span>
-<a name="l00448"></a>00448 <span class="comment">     */</span>
-<a name="l00449"></a>00449 
-<a name="l00450"></a>00450     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.filter_id"</span>,
-<a name="l00451"></a>00451                                 CPL_TYPE_STRING,
-<a name="l00452"></a>00452                                 <span class="stringliteral">"Filter ID"</span>,
-<a name="l00453"></a>00453                                 <span class="stringliteral">"fors.fors_config"</span>,
-<a name="l00454"></a>00454                                 <span class="stringliteral">"0"</span>);
-<a name="l00455"></a>00455     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"filter_id"</span>);
-<a name="l00456"></a>00456     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00457"></a>00457     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00458"></a>00458 
-<a name="l00459"></a>00459     <span class="keywordflow">return</span> 0;
-<a name="l00460"></a>00460 }
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462 
-<a name="l00471"></a>00471 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_exec(cpl_plugin *plugin)
-<a name="l00472"></a>00472 {
-<a name="l00473"></a>00473     cpl_recipe *recipe;
-<a name="l00474"></a>00474     
-<a name="l00475"></a>00475     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00476"></a>00476         recipe = (cpl_recipe *)plugin;
-<a name="l00477"></a>00477     <span class="keywordflow">else</span> 
-<a name="l00478"></a>00478         <span class="keywordflow">return</span> -1;
-<a name="l00479"></a>00479 
-<a name="l00480"></a>00480     <span class="keywordflow">return</span> fors_config(recipe->parameters, recipe->frames);
-<a name="l00481"></a>00481 }
-<a name="l00482"></a>00482 
-<a name="l00483"></a>00483 
-<a name="l00492"></a>00492 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_destroy(cpl_plugin *plugin)
-<a name="l00493"></a>00493 {
-<a name="l00494"></a>00494     cpl_recipe *recipe;
-<a name="l00495"></a>00495     
-<a name="l00496"></a>00496     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00497"></a>00497         recipe = (cpl_recipe *)plugin;
-<a name="l00498"></a>00498     <span class="keywordflow">else</span> 
-<a name="l00499"></a>00499         <span class="keywordflow">return</span> -1;
-<a name="l00500"></a>00500 
-<a name="l00501"></a>00501     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00502"></a>00502 
-<a name="l00503"></a>00503     <span class="keywordflow">return</span> 0;
-<a name="l00504"></a>00504 }
-<a name="l00505"></a>00505 
-<a name="l00506"></a>00506 
-<a name="l00516"></a>00516 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00517"></a>00517 {
-<a name="l00518"></a>00518 
-<a name="l00519"></a>00519     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_config"</span>;
-<a name="l00520"></a>00520 
-<a name="l00521"></a>00521 
-<a name="l00522"></a>00522     <span class="comment">/*</span>
-<a name="l00523"></a>00523 <span class="comment">     * Input parameters</span>
-<a name="l00524"></a>00524 <span class="comment">     */</span>
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526     <span class="keywordtype">double</span>      dispersion;
-<a name="l00527"></a>00527     <span class="keywordtype">double</span>      peakdetection;
-<a name="l00528"></a>00528     <span class="keywordtype">int</span>         wdegree;
-<a name="l00529"></a>00529     <span class="keywordtype">int</span>         cdegree;
-<a name="l00530"></a>00530     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00531"></a>00531     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00532"></a>00532 <span class="comment">/*</span>
-<a name="l00533"></a>00533 <span class="comment"> *    int         wradius;</span>
-<a name="l00534"></a>00534 <span class="comment"> *    double      wreject;</span>
-<a name="l00535"></a>00535 <span class="comment"> *    int         wmode;</span>
-<a name="l00536"></a>00536 <span class="comment"> *    int         cglobal;</span>
-<a name="l00537"></a>00537 <span class="comment"> *    int         slit_ident;</span>
-<a name="l00538"></a>00538 <span class="comment"> *    int         sdegree;</span>
-<a name="l00539"></a>00539 <span class="comment"> *    int         ddegree;</span>
-<a name="l00540"></a>00540 <span class="comment"> *    int         sradius;</span>
-<a name="l00541"></a>00541 <span class="comment"> *    int         dradius;</span>
-<a name="l00542"></a>00542 <span class="comment"> *    int         skyalign;</span>
-<a name="l00543"></a>00543 <span class="comment"> */</span>
-<a name="l00544"></a>00544 
-<a name="l00545"></a>00545     <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument;
-<a name="l00546"></a>00546     <span class="keyword">const</span> <span class="keywordtype">char</span> *grism;
-<a name="l00547"></a>00547     <span class="keyword">const</span> <span class="keywordtype">char</span> *grism_id;
-<a name="l00548"></a>00548     <span class="keyword">const</span> <span class="keywordtype">char</span> *filter;
-<a name="l00549"></a>00549     <span class="keyword">const</span> <span class="keywordtype">char</span> *filter_id;
-<a name="l00550"></a>00550 
-<a name="l00551"></a>00551     <span class="keywordtype">char</span>       *filename = NULL;
-<a name="l00552"></a>00552 
-<a name="l00553"></a>00553     <span class="comment">/*</span>
-<a name="l00554"></a>00554 <span class="comment">     * CPL objects</span>
-<a name="l00555"></a>00555 <span class="comment">     */</span>
-<a name="l00556"></a>00556 
-<a name="l00557"></a>00557     cpl_table        *table  = NULL;
-<a name="l00558"></a>00558     cpl_propertylist *header = NULL;
-<a name="l00559"></a>00559 
-<a name="l00560"></a>00560     <span class="comment">/*</span>
-<a name="l00561"></a>00561 <span class="comment">     * Auxiliary variables</span>
-<a name="l00562"></a>00562 <span class="comment">     */</span>
-<a name="l00563"></a>00563 
-<a name="l00564"></a>00564     <span class="keywordtype">int</span>     len;
-<a name="l00565"></a>00565 
-<a name="l00566"></a>00566 
-<a name="l00567"></a>00567     <span class="keywordflow">if</span> (frameset){}   <span class="comment">/* To avoid compiler warning */</span>
-<a name="l00568"></a>00568 
-<a name="l00569"></a>00569     <span class="comment">/* </span>
-<a name="l00570"></a>00570 <span class="comment">     * Get configuration parameters</span>
-<a name="l00571"></a>00571 <span class="comment">     */</span>
-<a name="l00572"></a>00572 
-<a name="l00573"></a>00573     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00574"></a>00574     cpl_msg_indent_more();
-<a name="l00575"></a>00575 
-<a name="l00576"></a>00576     table = cpl_table_new(1);
-<a name="l00577"></a>00577 
-<a name="l00578"></a>00578     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00579"></a>00579                                           <span class="stringliteral">"fors.fors_config.dispersion"</span>, NULL);
-<a name="l00580"></a>00580 
-<a name="l00581"></a>00581     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00582"></a>00582         fors_config_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584     cpl_table_new_column(table, <span class="stringliteral">"dispersion"</span>, CPL_TYPE_DOUBLE);
-<a name="l00585"></a>00585     cpl_table_set_double(table, <span class="stringliteral">"dispersion"</span>, 0, dispersion);
-<a name="l00586"></a>00586 
-<a name="l00587"></a>00587     peakdetection = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00588"></a>00588                                <span class="stringliteral">"fors.fors_config.peakdetection"</span>, NULL);
-<a name="l00589"></a>00589     <span class="keywordflow">if</span> (peakdetection <= 0.0)
-<a name="l00590"></a>00590         fors_config_exit(<span class="stringliteral">"Invalid peak detection level"</span>);
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     cpl_table_new_column(table, <span class="stringliteral">"peakdetection"</span>, CPL_TYPE_DOUBLE);
-<a name="l00593"></a>00593     cpl_table_set_double(table, <span class="stringliteral">"peakdetection"</span>, 0, peakdetection);
-<a name="l00594"></a>00594 
-<a name="l00595"></a>00595     wdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_config.wdegree"</span>, NULL);
-<a name="l00596"></a>00596 
-<a name="l00597"></a>00597     <span class="keywordflow">if</span> (wdegree < 1)
-<a name="l00598"></a>00598         fors_config_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00599"></a>00599 
-<a name="l00600"></a>00600     <span class="keywordflow">if</span> (wdegree > 5)
-<a name="l00601"></a>00601         fors_config_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00602"></a>00602 
-<a name="l00603"></a>00603     cpl_table_new_column(table, <span class="stringliteral">"wdegree"</span>, CPL_TYPE_INT);
-<a name="l00604"></a>00604     cpl_table_set_int(table, <span class="stringliteral">"wdegree"</span>, 0, wdegree);
-<a name="l00605"></a>00605 
-<a name="l00606"></a>00606 <span class="comment">/*</span>
-<a name="l00607"></a>00607 <span class="comment"> *    wradius = dfs_get_parameter_int(parlist, </span>
-<a name="l00608"></a>00608 <span class="comment"> *                                    "fors.fors_config.wradius", NULL);</span>
-<a name="l00609"></a>00609 <span class="comment"> * </span>
-<a name="l00610"></a>00610 <span class="comment"> *    if (wradius < 0)</span>
-<a name="l00611"></a>00611 <span class="comment"> *        fors_config_exit("Invalid search radius");</span>
-<a name="l00612"></a>00612 <span class="comment"> * </span>
-<a name="l00613"></a>00613 <span class="comment"> *    cpl_table_new_column(table, "wradius", CPL_TYPE_INT);</span>
-<a name="l00614"></a>00614 <span class="comment"> *    cpl_table_set_int(table, "wradius", 0, wradius);</span>
-<a name="l00615"></a>00615 <span class="comment"> * </span>
-<a name="l00616"></a>00616 <span class="comment"> *    wreject = dfs_get_parameter_double(parlist, </span>
-<a name="l00617"></a>00617 <span class="comment"> *                                       "fors.fors_config.wreject", NULL);</span>
-<a name="l00618"></a>00618 <span class="comment"> * </span>
-<a name="l00619"></a>00619 <span class="comment"> *    if (wreject <= 0.0)</span>
-<a name="l00620"></a>00620 <span class="comment"> *        fors_config_exit("Invalid rejection threshold");</span>
-<a name="l00621"></a>00621 <span class="comment"> * </span>
-<a name="l00622"></a>00622 <span class="comment"> *    cpl_table_new_column(table, "wreject", CPL_TYPE_DOUBLE);</span>
-<a name="l00623"></a>00623 <span class="comment"> *    cpl_table_set_double(table, "wreject", 0, wreject);</span>
-<a name="l00624"></a>00624 <span class="comment"> * </span>
-<a name="l00625"></a>00625 <span class="comment"> *    wmode = dfs_get_parameter_int(parlist, "fors.fors_config.wmode", NULL);</span>
-<a name="l00626"></a>00626 <span class="comment"> * </span>
-<a name="l00627"></a>00627 <span class="comment"> *    if (wmode < 0 || wmode > 2)</span>
-<a name="l00628"></a>00628 <span class="comment"> *        fors_config_exit("Invalid wavelength solution interpolation mode");</span>
-<a name="l00629"></a>00629 <span class="comment"> * </span>
-<a name="l00630"></a>00630 <span class="comment"> *    cpl_table_new_column(table, "wmode", CPL_TYPE_INT);</span>
-<a name="l00631"></a>00631 <span class="comment"> *    cpl_table_set_int(table, "wmode", 0, wmode);</span>
-<a name="l00632"></a>00632 <span class="comment"> */</span>
-<a name="l00633"></a>00633 
-<a name="l00634"></a>00634     cdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_config.cdegree"</span>, NULL);
-<a name="l00635"></a>00635 
-<a name="l00636"></a>00636     <span class="keywordflow">if</span> (cdegree < 1)
-<a name="l00637"></a>00637         fors_config_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639     <span class="keywordflow">if</span> (cdegree > 5)
-<a name="l00640"></a>00640         fors_config_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00641"></a>00641 
-<a name="l00642"></a>00642     cpl_table_new_column(table, <span class="stringliteral">"cdegree"</span>, CPL_TYPE_INT);
-<a name="l00643"></a>00643     cpl_table_set_int(table, <span class="stringliteral">"cdegree"</span>, 0, cdegree);
-<a name="l00644"></a>00644 
-<a name="l00645"></a>00645 <span class="comment">/*</span>
-<a name="l00646"></a>00646 <span class="comment"> *    cglobal = dfs_get_parameter_bool(parlist, "fors.fors_config.cglobal", </span>
-<a name="l00647"></a>00647 <span class="comment"> *                                     NULL);</span>
-<a name="l00648"></a>00648 <span class="comment"> *</span>
-<a name="l00649"></a>00649 <span class="comment"> *    cpl_table_new_column(table, "cglobal", CPL_TYPE_INT);</span>
-<a name="l00650"></a>00650 <span class="comment"> *    cpl_table_set_int(table, "cglobal", 0, cglobal);</span>
-<a name="l00651"></a>00651 <span class="comment"> */</span>
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00654"></a>00654                                  <span class="stringliteral">"fors.fors_config.startwavelength"</span>, NULL);
-<a name="l00655"></a>00655     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00656"></a>00656         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00657"></a>00657             fors_config_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00658"></a>00658 
-<a name="l00659"></a>00659     cpl_table_new_column(table, <span class="stringliteral">"startwavelength"</span>, CPL_TYPE_DOUBLE);
-<a name="l00660"></a>00660     cpl_table_set_double(table, <span class="stringliteral">"startwavelength"</span>, 0, startwavelength);
-<a name="l00661"></a>00661 
-<a name="l00662"></a>00662     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00663"></a>00663                                    <span class="stringliteral">"fors.fors_config.endwavelength"</span>, NULL);
-<a name="l00664"></a>00664     <span class="keywordflow">if</span> (endwavelength > 1.0)
-<a name="l00665"></a>00665         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00666"></a>00666             fors_config_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00667"></a>00667 
-<a name="l00668"></a>00668     <span class="keywordflow">if</span> (startwavelength > 1.0 && endwavelength > 1.0)
-<a name="l00669"></a>00669         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00670"></a>00670             fors_config_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00671"></a>00671 
-<a name="l00672"></a>00672     cpl_table_new_column(table, <span class="stringliteral">"endwavelength"</span>, CPL_TYPE_DOUBLE);
-<a name="l00673"></a>00673     cpl_table_set_double(table, <span class="stringliteral">"endwavelength"</span>, 0, endwavelength);
-<a name="l00674"></a>00674 
-<a name="l00675"></a>00675 <span class="comment">/*</span>
-<a name="l00676"></a>00676 <span class="comment"> *    slit_ident = dfs_get_parameter_bool(parlist, </span>
-<a name="l00677"></a>00677 <span class="comment"> *                                   "fors.fors_config.slit_ident", NULL);</span>
-<a name="l00678"></a>00678 <span class="comment"> *</span>
-<a name="l00679"></a>00679 <span class="comment"> *    cpl_table_new_column(table, "slit_ident", CPL_TYPE_INT);</span>
-<a name="l00680"></a>00680 <span class="comment"> *    cpl_table_set_int(table, "slit_ident", 0, slit_ident);</span>
-<a name="l00681"></a>00681 <span class="comment"> *</span>
-<a name="l00682"></a>00682 <span class="comment"> *    sdegree = dfs_get_parameter_int(parlist, </span>
-<a name="l00683"></a>00683 <span class="comment"> *                                    "fors.fors_config.sdegree", NULL);</span>
-<a name="l00684"></a>00684 <span class="comment"> *</span>
-<a name="l00685"></a>00685 <span class="comment"> *    cpl_table_new_column(table, "sdegree", CPL_TYPE_INT);</span>
-<a name="l00686"></a>00686 <span class="comment"> *    cpl_table_set_int(table, "sdegree", 0, sdegree);</span>
-<a name="l00687"></a>00687 <span class="comment"> *</span>
-<a name="l00688"></a>00688 <span class="comment"> *    ddegree = dfs_get_parameter_int(parlist, </span>
-<a name="l00689"></a>00689 <span class="comment"> *                                    "fors.fors_config.ddegree", NULL);</span>
-<a name="l00690"></a>00690 <span class="comment"> *</span>
-<a name="l00691"></a>00691 <span class="comment"> *    cpl_table_new_column(table, "ddegree", CPL_TYPE_INT);</span>
-<a name="l00692"></a>00692 <span class="comment"> *    cpl_table_set_int(table, "ddegree", 0, ddegree);</span>
-<a name="l00693"></a>00693 <span class="comment"> *</span>
-<a name="l00694"></a>00694 <span class="comment"> *    sradius = dfs_get_parameter_int(parlist, </span>
-<a name="l00695"></a>00695 <span class="comment"> *                                    "fors.fors_config.sradius", NULL);</span>
-<a name="l00696"></a>00696 <span class="comment"> *    dradius = dfs_get_parameter_int(parlist, </span>
-<a name="l00697"></a>00697 <span class="comment"> *                                    "fors.fors_config.dradius", NULL);</span>
-<a name="l00698"></a>00698 <span class="comment"> *</span>
-<a name="l00699"></a>00699 <span class="comment"> *    if (sradius < 1 || dradius < 1)</span>
-<a name="l00700"></a>00700 <span class="comment"> *        fors_config_exit("Invalid smoothing box radius");</span>
-<a name="l00701"></a>00701 <span class="comment"> *</span>
-<a name="l00702"></a>00702 <span class="comment"> *    cpl_table_new_column(table, "sradius", CPL_TYPE_INT);</span>
-<a name="l00703"></a>00703 <span class="comment"> *    cpl_table_set_int(table, "sradius", 0, sradius);</span>
-<a name="l00704"></a>00704 <span class="comment"> *    cpl_table_new_column(table, "dradius", CPL_TYPE_INT);</span>
-<a name="l00705"></a>00705 <span class="comment"> *    cpl_table_set_int(table, "dradius", 0, dradius);</span>
-<a name="l00706"></a>00706 <span class="comment"> *</span>
-<a name="l00707"></a>00707 <span class="comment"> *    skyalign = dfs_get_parameter_int(parlist, "fors.fors_config.skyalign", </span>
-<a name="l00708"></a>00708 <span class="comment"> *                                     NULL);</span>
-<a name="l00709"></a>00709 <span class="comment"> *</span>
-<a name="l00710"></a>00710 <span class="comment"> *    cpl_table_new_column(table, "skyalign", CPL_TYPE_INT);</span>
-<a name="l00711"></a>00711 <span class="comment"> *    cpl_table_set_int(table, "skyalign", 0, skyalign);</span>
-<a name="l00712"></a>00712 <span class="comment"> */</span>
-<a name="l00713"></a>00713 
-<a name="l00714"></a>00714     header = cpl_propertylist_new();
-<a name="l00715"></a>00715 
-<a name="l00716"></a>00716     instrument = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00717"></a>00717                                    <span class="stringliteral">"fors.fors_config.instrument"</span>, NULL);
-<a name="l00718"></a>00718     cpl_propertylist_update_string(header, <span class="stringliteral">"INSTRUME"</span>, instrument);
-<a name="l00719"></a>00719 
-<a name="l00720"></a>00720     grism = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.fors_config.grism"</span>, NULL);
-<a name="l00721"></a>00721     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, grism);
-<a name="l00722"></a>00722 
-<a name="l00723"></a>00723     grism_id = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00724"></a>00724                                    <span class="stringliteral">"fors.fors_config.grism_id"</span>, NULL);
-<a name="l00725"></a>00725     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, grism_id);
-<a name="l00726"></a>00726 
-<a name="l00727"></a>00727     filter = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.fors_config.filter"</span>, NULL);
-<a name="l00728"></a>00728     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, filter);
-<a name="l00729"></a>00729 
-<a name="l00730"></a>00730     filter_id = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00731"></a>00731                                    <span class="stringliteral">"fors.fors_config.filter_id"</span>, NULL);
-<a name="l00732"></a>00732     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO INS FILT1 ID"</span>, filter_id);
-<a name="l00733"></a>00733 
-<a name="l00734"></a>00734     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00735"></a>00735         fors_config_exit(<span class="stringliteral">"Failed to get the configuration parameters"</span>);
-<a name="l00736"></a>00736 
-<a name="l00737"></a>00737     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO PRO CATG"</span>, <span class="stringliteral">"GRISM_TABLE"</span>);
-<a name="l00738"></a>00738 
-<a name="l00739"></a>00739     len = 14;
-<a name="l00740"></a>00740     len += strlen(instrument);
-<a name="l00741"></a>00741     len += strlen(grism + 5);
-<a name="l00742"></a>00742     len += strlen(grism_id);
-<a name="l00743"></a>00743     len += strlen(filter);
-<a name="l00744"></a>00744     len += strlen(filter_id);
-<a name="l00745"></a>00745 
-<a name="l00746"></a>00746     filename = cpl_calloc(len, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l00747"></a>00747 
-<a name="l00748"></a>00748     sprintf(filename, <span class="stringliteral">"%s_GRS_%s_%s_%s_%s.fits"</span>, 
-<a name="l00749"></a>00749             instrument, grism + 5, grism_id+1, filter, filter_id+1);
-<a name="l00750"></a>00750 
-<a name="l00751"></a>00751     cpl_table_save(table, header, NULL, filename, CPL_IO_DEFAULT);
-<a name="l00752"></a>00752     cpl_propertylist_delete(header); header = NULL;
-<a name="l00753"></a>00753     cpl_table_delete(table); table = NULL;
-<a name="l00754"></a>00754     cpl_free(filename); filename = NULL;
-<a name="l00755"></a>00755 
-<a name="l00756"></a>00756     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00757"></a>00757         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l00758"></a>00758         fors_config_exit(NULL);
-<a name="l00759"></a>00759     }
-<a name="l00760"></a>00760     <span class="keywordflow">else</span> 
-<a name="l00761"></a>00761         <span class="keywordflow">return</span> 0;
-<a name="l00762"></a>00762 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__config_8c_source.html b/html/fors__config_8c_source.html
new file mode 100644
index 0000000..13c470d
--- /dev/null
+++ b/html/fors__config_8c_source.html
@@ -0,0 +1,777 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_config.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_config.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_config.c,v 1.5 2013-10-09 15:59:38 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-09 15:59:38 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.5 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_create(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_config_description[] =</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"This recipe is used to create the so-called GRISM_TABLE, containing all\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"the FORS spectral pipeline configuration parameters related to a specific\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"grism. This is a way to provide for each specific instrument mode a set of\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"appropriate defaults for the recipe parameters.\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"The values assigned to each input parameter of fors_config are simply\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"copied to a FITS table consisting of one row, and as many columns as the\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"input parameter: each column will have the same name and type of each\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"parameter. Only the three parameters \"instrument\", \"grism\", and\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"\"id\" are not written to the table columns, but to the descriptor header\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"keywords INSTRUME, ESO INS GRIS1 NAME, and ESO INS GRIS1 ID, that will be\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"used by the automatic pipeline for appropriate data association.\n\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"Input files: none\n\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  GRISM_TABLE                FITS table  Recipe configuration parameters\n\n"</span>;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">#define fors_config_exit(message)             \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">cpl_table_delete(table);                      \</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">cpl_free(filename);                           \</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> {</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <span class="stringliteral">"fors_config"</span>,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                     <span class="stringliteral">"Creation of FORS recipes configuration tables"</span>,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                     fors_config_description,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                     fors_config_create,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     fors_config_exec,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                     fors_config_destroy);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> }</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> {</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.dispersion"</span>,</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                                 0.0);</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="comment">     * Peak detection level</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> </div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.peakdetection"</span>,</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>                                 <span class="stringliteral">"Peak detection threshold (ADU)"</span>,</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>                                 250.0);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="comment">     * Degree of wavelength calibration polynomial</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.wdegree"</span>,</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                                 4);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="comment">     * Reference lines search radius</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.wradius",</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="comment">                                CPL_TYPE_INT,</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="comment">                                "Search radius if iterating pattern-matching "</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="comment">                                "with first-guess method",</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="comment">                                "fors.fors_config",</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="comment">                                0);</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "wradius");</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.wreject",</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="comment">                                CPL_TYPE_DOUBLE,</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="comment">                                "Rejection threshold in dispersion "</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="comment">                                "relation fit (pixel)",</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="comment">                                "fors.fors_config",</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="comment">                                0.7);</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "wreject");</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> </div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> <span class="comment">     * Wavelength solution interpolation (for LSS data)</span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>  </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.wmode",</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="comment">                                CPL_TYPE_INT,</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> <span class="comment">                                "Interpolation mode of wavelength solution "</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="comment">                                "applicable to LSS-like data (0 = no "</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="comment">                                "interpolation, 1 = fill gaps, 2 = global "</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="comment">                                "model",</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <span class="comment">                                "fors.fors_config",</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> <span class="comment">                                0);</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "wmode");</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="comment">     * Degree of spectral curvature polynomial</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.cdegree"</span>,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                                 <span class="stringliteral">"Degree of spectral curvature polynomial"</span>,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                                 4);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cdegree"</span>);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> <span class="comment">     * Global curvature model</span></div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.cglobal",</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> <span class="comment">                                CPL_TYPE_BOOL,</span></div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> <span class="comment">                                "Global curvature model",</span></div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> <span class="comment">                                "fors.fors_config",</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="comment">                                TRUE);</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "cglobal");</span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.startwavelength"</span>,</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>                                 0.0);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.endwavelength"</span>,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                                 0.0);</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> </div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> <span class="comment">     * Try slit identification</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.slit_ident",</span></div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> <span class="comment">                                CPL_TYPE_BOOL,</span></div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> <span class="comment">                                "Attempt slit identification for MOS or MXU",</span></div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> <span class="comment">                                "fors.fors_config",</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> <span class="comment">                                TRUE);</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "slit_ident");</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> <span class="comment">     * Degree of flat field fitting polynomial along spatial direction </span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="comment">     * (used for LSS data)</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> </div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.sdegree",</span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="comment">                                CPL_TYPE_INT,</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="comment">                                "Degree of flat field fitting polynomial "</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="comment">                                "along spatial direction (used for LSS "</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> <span class="comment">                                "data only)",</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> <span class="comment">                                "fors.fors_config",</span></div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> <span class="comment">                                4);</span></div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "sdegree");</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> </div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> <span class="comment">     * Degree of flat field fitting polynomial along dispersion direction</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> <span class="comment">     * (used for MOS and MXU data)</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.ddegree",</span></div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> <span class="comment">                                CPL_TYPE_INT,</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> <span class="comment">                                "Degree of flat field fitting polynomial "</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> <span class="comment">                                "along dispersion direction (used for MOS "</span></div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> <span class="comment">                                "and MXU data only)",</span></div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> <span class="comment">                                "fors.fors_config",</span></div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> <span class="comment">                                7);</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "ddegree");</span></div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> </div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="comment">     * Smooth box radius for flat field along dispersion direction</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.dradius",</span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> <span class="comment">                                CPL_TYPE_INT,</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="comment">                                "Smooth box radius for flat field along "</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="comment">                                "dispersion direction",</span></div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> <span class="comment">                                "fors.fors_config",</span></div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> <span class="comment">                                10);</span></div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "dradius");</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> <span class="comment">     * Smooth box radius for flat field along spatial direction</span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> <span class="comment">     * (used for LSS data only)</span></div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.sradius",</span></div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> <span class="comment">                                CPL_TYPE_INT,</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> <span class="comment">                                "Smooth box radius for flat field along "</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> <span class="comment">                                "spatial direction (used for LSS data only)",</span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> <span class="comment">                                "fors.fors_config",</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> <span class="comment">                                10);</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "sradius");</span></div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> <span class="comment">     * Sky lines alignment</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> </div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_config.skyalign",</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> <span class="comment">                                CPL_TYPE_INT,</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> <span class="comment">                                "Polynomial order for sky lines alignment, "</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> <span class="comment">                                "or -1 to avoid alignment",</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment">                                "fors.fors_config",</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="comment">                                -1);</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "skyalign");</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment">     * Instrument name</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.instrument"</span>,</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>                                 <span class="stringliteral">"Name of instrument"</span>,</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>                                 <span class="stringliteral">"0"</span>);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"instrument"</span>);</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span> <span class="comment">     * Grism name</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> </div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.grism"</span>,</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>                                 <span class="stringliteral">"Name of grism"</span>,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                                 <span class="stringliteral">"0"</span>);</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"grism"</span>);</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> <span class="comment">     * Grism id</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.grism_id"</span>,</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>                                 <span class="stringliteral">"Grism ID"</span>,</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>                                 <span class="stringliteral">"0"</span>);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"grism_id"</span>);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> <span class="comment">     * Filter name</span></div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span> </div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.filter"</span>,</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>                                 <span class="stringliteral">"Name of filter"</span>,</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                                 <span class="stringliteral">"0"</span>);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"filter"</span>);</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> <span class="comment">     * Filter id</span></div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> </div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_config.filter_id"</span>,</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>                                 <span class="stringliteral">"Filter ID"</span>,</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>                                 <span class="stringliteral">"fors.fors_config"</span>,</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>                                 <span class="stringliteral">"0"</span>);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"filter_id"</span>);</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> </div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span> }</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span> </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> {</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     <span class="keywordflow">return</span> fors_config(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> }</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> {</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     </div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span> </div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> </div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span> }</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> </div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_config(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> {</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> </div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_config"</span>;</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> </div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span> </div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     <span class="keywordtype">double</span>      peakdetection;</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     <span class="keywordtype">int</span>         wdegree;</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     <span class="keywordtype">int</span>         cdegree;</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> <span class="comment"> *    int         wradius;</span></div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> <span class="comment"> *    double      wreject;</span></div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> <span class="comment"> *    int         wmode;</span></div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> <span class="comment"> *    int         cglobal;</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> <span class="comment"> *    int         slit_ident;</span></div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> <span class="comment"> *    int         sdegree;</span></div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span> <span class="comment"> *    int         ddegree;</span></div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> <span class="comment"> *    int         sradius;</span></div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> <span class="comment"> *    int         dradius;</span></div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> <span class="comment"> *    int         skyalign;</span></div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument;</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *grism;</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *grism_id;</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filter;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filter_id;</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span> </div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     <span class="keywordtype">char</span>       *filename = NULL;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> </div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     cpl_table        *table  = NULL;</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     cpl_propertylist *header = NULL;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> </div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     <span class="keywordtype">int</span>     len;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span> </div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> </div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     <span class="keywordflow">if</span> (frameset){}   <span class="comment">/* To avoid compiler warning */</span></div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span> </div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> </div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span> </div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     table = cpl_table_new(1);</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>                                           <span class="stringliteral">"fors.fors_config.dispersion"</span>, NULL);</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> </div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         fors_config_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     cpl_table_new_column(table, <span class="stringliteral">"dispersion"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     cpl_table_set_double(table, <span class="stringliteral">"dispersion"</span>, 0, dispersion);</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span> </div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     peakdetection = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>                                <span class="stringliteral">"fors.fors_config.peakdetection"</span>, NULL);</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordflow">if</span> (peakdetection <= 0.0)</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>         fors_config_exit(<span class="stringliteral">"Invalid peak detection level"</span>);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> </div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     cpl_table_new_column(table, <span class="stringliteral">"peakdetection"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     cpl_table_set_double(table, <span class="stringliteral">"peakdetection"</span>, 0, peakdetection);</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> </div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     wdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_config.wdegree"</span>, NULL);</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span> </div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     <span class="keywordflow">if</span> (wdegree < 1)</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         fors_config_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordflow">if</span> (wdegree > 5)</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>         fors_config_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span> </div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     cpl_table_new_column(table, <span class="stringliteral">"wdegree"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     cpl_table_set_int(table, <span class="stringliteral">"wdegree"</span>, 0, wdegree);</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> </div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span> <span class="comment"> *    wradius = dfs_get_parameter_int(parlist, </span></div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> <span class="comment"> *                                    "fors.fors_config.wradius", NULL);</span></div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> <span class="comment"> * </span></div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span> <span class="comment"> *    if (wradius < 0)</span></div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span> <span class="comment"> *        fors_config_exit("Invalid search radius");</span></div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span> <span class="comment"> * </span></div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span> <span class="comment"> *    cpl_table_new_column(table, "wradius", CPL_TYPE_INT);</span></div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> <span class="comment"> *    cpl_table_set_int(table, "wradius", 0, wradius);</span></div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> <span class="comment"> * </span></div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span> <span class="comment"> *    wreject = dfs_get_parameter_double(parlist, </span></div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span> <span class="comment"> *                                       "fors.fors_config.wreject", NULL);</span></div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span> <span class="comment"> * </span></div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span> <span class="comment"> *    if (wreject <= 0.0)</span></div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> <span class="comment"> *        fors_config_exit("Invalid rejection threshold");</span></div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span> <span class="comment"> * </span></div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span> <span class="comment"> *    cpl_table_new_column(table, "wreject", CPL_TYPE_DOUBLE);</span></div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span> <span class="comment"> *    cpl_table_set_double(table, "wreject", 0, wreject);</span></div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span> <span class="comment"> * </span></div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span> <span class="comment"> *    wmode = dfs_get_parameter_int(parlist, "fors.fors_config.wmode", NULL);</span></div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> <span class="comment"> * </span></div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span> <span class="comment"> *    if (wmode < 0 || wmode > 2)</span></div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span> <span class="comment"> *        fors_config_exit("Invalid wavelength solution interpolation mode");</span></div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> <span class="comment"> * </span></div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> <span class="comment"> *    cpl_table_new_column(table, "wmode", CPL_TYPE_INT);</span></div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span> <span class="comment"> *    cpl_table_set_int(table, "wmode", 0, wmode);</span></div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span> </div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     cdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_config.cdegree"</span>, NULL);</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     <span class="keywordflow">if</span> (cdegree < 1)</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>         fors_config_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> </div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>     <span class="keywordflow">if</span> (cdegree > 5)</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>         fors_config_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> </div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     cpl_table_new_column(table, <span class="stringliteral">"cdegree"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     cpl_table_set_int(table, <span class="stringliteral">"cdegree"</span>, 0, cdegree);</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> </div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> <span class="comment"> *    cglobal = dfs_get_parameter_bool(parlist, "fors.fors_config.cglobal", </span></div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> <span class="comment"> *                                     NULL);</span></div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> <span class="comment"> *    cpl_table_new_column(table, "cglobal", CPL_TYPE_INT);</span></div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span> <span class="comment"> *    cpl_table_set_int(table, "cglobal", 0, cglobal);</span></div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> </div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>                                  <span class="stringliteral">"fors.fors_config.startwavelength"</span>, NULL);</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>             fors_config_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> </div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     cpl_table_new_column(table, <span class="stringliteral">"startwavelength"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     cpl_table_set_double(table, <span class="stringliteral">"startwavelength"</span>, 0, startwavelength);</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> </div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>                                    <span class="stringliteral">"fors.fors_config.endwavelength"</span>, NULL);</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>     <span class="keywordflow">if</span> (endwavelength > 1.0)</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>             fors_config_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> </div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     <span class="keywordflow">if</span> (startwavelength > 1.0 && endwavelength > 1.0)</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>             fors_config_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span> </div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     cpl_table_new_column(table, <span class="stringliteral">"endwavelength"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     cpl_table_set_double(table, <span class="stringliteral">"endwavelength"</span>, 0, endwavelength);</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> <span class="comment"> *    slit_ident = dfs_get_parameter_bool(parlist, </span></div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> <span class="comment"> *                                   "fors.fors_config.slit_ident", NULL);</span></div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span> <span class="comment"> *    cpl_table_new_column(table, "slit_ident", CPL_TYPE_INT);</span></div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span> <span class="comment"> *    cpl_table_set_int(table, "slit_ident", 0, slit_ident);</span></div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> <span class="comment"> *    sdegree = dfs_get_parameter_int(parlist, </span></div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> <span class="comment"> *                                    "fors.fors_config.sdegree", NULL);</span></div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> <span class="comment"> *    cpl_table_new_column(table, "sdegree", CPL_TYPE_INT);</span></div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span> <span class="comment"> *    cpl_table_set_int(table, "sdegree", 0, sdegree);</span></div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span> <span class="comment"> *    ddegree = dfs_get_parameter_int(parlist, </span></div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> <span class="comment"> *                                    "fors.fors_config.ddegree", NULL);</span></div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span> <span class="comment"> *    cpl_table_new_column(table, "ddegree", CPL_TYPE_INT);</span></div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span> <span class="comment"> *    cpl_table_set_int(table, "ddegree", 0, ddegree);</span></div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span> <span class="comment"> *    sradius = dfs_get_parameter_int(parlist, </span></div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span> <span class="comment"> *                                    "fors.fors_config.sradius", NULL);</span></div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> <span class="comment"> *    dradius = dfs_get_parameter_int(parlist, </span></div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> <span class="comment"> *                                    "fors.fors_config.dradius", NULL);</span></div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> <span class="comment"> *    if (sradius < 1 || dradius < 1)</span></div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span> <span class="comment"> *        fors_config_exit("Invalid smoothing box radius");</span></div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span> <span class="comment"> *    cpl_table_new_column(table, "sradius", CPL_TYPE_INT);</span></div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> <span class="comment"> *    cpl_table_set_int(table, "sradius", 0, sradius);</span></div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> <span class="comment"> *    cpl_table_new_column(table, "dradius", CPL_TYPE_INT);</span></div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span> <span class="comment"> *    cpl_table_set_int(table, "dradius", 0, dradius);</span></div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> <span class="comment"> *    skyalign = dfs_get_parameter_int(parlist, "fors.fors_config.skyalign", </span></div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> <span class="comment"> *                                     NULL);</span></div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span> <span class="comment"> *    cpl_table_new_column(table, "skyalign", CPL_TYPE_INT);</span></div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> <span class="comment"> *    cpl_table_set_int(table, "skyalign", 0, skyalign);</span></div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> </div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> </div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     instrument = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>                                    <span class="stringliteral">"fors.fors_config.instrument"</span>, NULL);</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"INSTRUME"</span>, instrument);</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> </div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     grism = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.fors_config.grism"</span>, NULL);</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, grism);</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span> </div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>     grism_id = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>                                    <span class="stringliteral">"fors.fors_config.grism_id"</span>, NULL);</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, grism_id);</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span> </div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     filter = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.fors_config.filter"</span>, NULL);</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, filter);</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span> </div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     filter_id = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>                                    <span class="stringliteral">"fors.fors_config.filter_id"</span>, NULL);</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO INS FILT1 ID"</span>, filter_id);</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span> </div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>         fors_config_exit(<span class="stringliteral">"Failed to get the configuration parameters"</span>);</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span> </div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO PRO CATG"</span>, <span class="stringliteral">"GRISM_TABLE"</span>);</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span> </div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     len = 14;</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     len += strlen(instrument);</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     len += strlen(grism + 5);</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>     len += strlen(grism_id);</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     len += strlen(filter);</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     len += strlen(filter_id);</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span> </div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     filename = cpl_calloc(len, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     sprintf(filename, <span class="stringliteral">"%s_GRS_%s_%s_%s_%s.fits"</span>, </div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>             instrument, grism + 5, grism_id+1, filter, filter_id+1);</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span> </div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     cpl_table_save(table, header, NULL, filename, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     cpl_table_delete(table); table = NULL;</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     cpl_free(filename); filename = NULL;</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span> </div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>         cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>         fors_config_exit(NULL);</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     }</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__cpl__wcs-test_8c-source.html b/html/fors__cpl__wcs-test_8c-source.html
deleted file mode 100644
index 9b5ccc6..0000000
--- a/html/fors__cpl__wcs-test_8c-source.html
+++ /dev/null
@@ -1,334 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_cpl_wcs-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_cpl_wcs-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_cpl_wcs-test.c,v 1.2 2008/02/07 14:41:21 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the ESO Common Pipeline Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2001-2004 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2008/02/07 14:41:21 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_WCS</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span>
-<a name="l00030"></a>00030 <span class="comment">/*----------------------------------------------------------------------------</span>
-<a name="l00031"></a>00031 <span class="comment">                                   Includes</span>
-<a name="l00032"></a>00032 <span class="comment"> ----------------------------------------------------------------------------*/</span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <string.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <math.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <float.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include <cpl_wcs.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00042"></a>00042 <span class="comment">//#include "cpl_tools.h"</span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="preprocessor">#define NSK 2</span>
-<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#define NDK 13</span>
-<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#define NIK 3</span>
-<a name="l00047"></a>00047 <span class="preprocessor"></span>
-<a name="l00048"></a>00048 
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050 <span class="preprocessor">#define fors_cpl_test(bool) \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">  ((bool) ? (cpl_msg_debug(__FILE__, \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">     "OK in line %d (CPL-error state: '%s' in %s): %s",__LINE__, \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">       cpl_error_get_message(), cpl_error_get_where(), #bool), 0) \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">    : (cpl_msg_error(__FILE__, \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">     "Failure in line %d (CPL-error state: '%s' in %s): %s",__LINE__, \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">       cpl_error_get_message(), cpl_error_get_where(), #bool), 1))</span>
-<a name="l00057"></a>00057 <span class="preprocessor"></span>
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *skeys[NSK] = {<span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"CTYPE2"</span>};
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *dkeys[NDK] = {<span class="stringliteral">"CRVAL1"</span>, <span class="stringliteral">"CRVAL2"</span>, <span class="stringliteral">"CRPIX1"</span>, <span class="stringliteral">"CRPIX2"</span>, 
-<a name="l00065"></a>00065                  <span class="stringliteral">"CD1_1"</span>, <span class="stringliteral">"CD1_2"</span>, <span class="stringliteral">"CD2_1"</span>, <span class="stringliteral">"CD2_2"</span>, <span class="stringliteral">"PV2_1"</span>,
-<a name="l00066"></a>00066                  <span class="stringliteral">"PV2_2"</span>, <span class="stringliteral">"PV2_3"</span>, <span class="stringliteral">"PV2_4"</span>, <span class="stringliteral">"PV2_5"</span>};
-<a name="l00067"></a>00067 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *ikeys[NIK] = {<span class="stringliteral">"NAXIS"</span>,<span class="stringliteral">"NAXIS1"</span>,<span class="stringliteral">"NAXIS2"</span>};
-<a name="l00068"></a>00068 
-<a name="l00069"></a>00069 
-<a name="l00070"></a>00070 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *svals[NSK] = {<span class="stringliteral">"RA---ZPN"</span>, <span class="stringliteral">"DEC--ZPN"</span>};
-<a name="l00071"></a>00071 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> dvals[NDK] = {5.57368333333, -72.0576388889, 5401.6, 6860.8,
-<a name="l00072"></a>00072                   5.81347849634012E-21, 9.49444444444444E-05,
-<a name="l00073"></a>00073                   -9.49444444444444E-05, -5.81347849634012E-21,
-<a name="l00074"></a>00074                   1.0, 0.0, 42.0, 0.0, 0.0};
-<a name="l00075"></a>00075 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> ivals[NIK] = {2, 2048, 2048};
-<a name="l00076"></a>00076 
-<a name="l00077"></a>00077 <span class="preprocessor">#define NP 2</span>
-<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">double</span> physin[2*NP] = {1024.0, 1024.0, 1025.0, 1023.0};
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080 <span class="keyword">static</span> <span class="keywordtype">double</span> worldout[2*NP] = {3.825029720, -71.636524754,
-<a name="l00081"></a>00081                 3.824722171, -71.636616487};
-<a name="l00082"></a>00082 <span class="keyword">static</span> <span class="keywordtype">double</span> stdcout[2] = {-0.554171733, 0.415628800};
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085 <span class="keyword">static</span> <span class="keywordtype">double</span> worldin[2] = {3.824875946, -71.636570620};
-<a name="l00086"></a>00086 <span class="keyword">static</span> <span class="keywordtype">double</span> physout[2] = {1024.5, 1023.5};
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089 <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (<span class="keywordtype">void</span>) {
-<a name="l00090"></a>00090     cpl_boolean is_debug;
-<a name="l00091"></a>00091     <span class="keywordtype">int</span> i,nfail;
-<a name="l00092"></a>00092     cpl_propertylist *pl;
-<a name="l00093"></a>00093     cpl_wcs *wcs;
-<a name="l00094"></a>00094     cpl_matrix *from,*to;
-<a name="l00095"></a>00095     cpl_array *status;
-<a name="l00096"></a>00096     <span class="keywordtype">double</span> d1,d2;
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098     <span class="comment">/* Initialise */</span>
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100     cpl_init(CPL_INIT_DEFAULT);
-<a name="l00101"></a>00101     cpl_msg_set_level(CPL_MSG_WARNING);
-<a name="l00102"></a>00102     cpl_msg_set_level_from_env();
-<a name="l00103"></a>00103     cpl_msg_set_domain_off();
-<a name="l00104"></a>00104     is_debug = cpl_msg_get_level() <= CPL_MSG_DEBUG ? TRUE : FALSE;
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106     <span class="comment">/* Read in all the WCS properties, except for NAXIS? entries*/</span>
-<a name="l00107"></a>00107 
-<a name="l00108"></a>00108     pl = cpl_propertylist_new();
-<a name="l00109"></a>00109     <span class="keywordflow">for</span> (i = 0; i < NSK; i++) 
-<a name="l00110"></a>00110     cpl_propertylist_append_string(pl,skeys[i],svals[i]);
-<a name="l00111"></a>00111     <span class="keywordflow">for</span> (i = 0; i < NDK; i++) 
-<a name="l00112"></a>00112     cpl_propertylist_append_double(pl,dkeys[i],dvals[i]);
-<a name="l00113"></a>00113 
-<a name="l00114"></a>00114     <span class="comment">/* Now test cpl_wcs_new_from_propertylist to make sure we get the</span>
-<a name="l00115"></a>00115 <span class="comment">       correct errors */</span>
-<a name="l00116"></a>00116 
-<a name="l00117"></a>00117     nfail = 0;
-<a name="l00118"></a>00118     wcs = cpl_wcs_new_from_propertylist(NULL);
-<a name="l00119"></a>00119     nfail += fors_cpl_test(cpl_error_get_code() == CPL_ERROR_NULL_INPUT);
-<a name="l00120"></a>00120     nfail += fors_cpl_test(wcs == NULL);
-<a name="l00121"></a>00121     cpl_error_reset();
-<a name="l00122"></a>00122     <span class="keywordflow">if</span> (wcs != NULL)
-<a name="l00123"></a>00123     cpl_wcs_delete(wcs);
-<a name="l00124"></a>00124     wcs = cpl_wcs_new_from_propertylist(pl);
-<a name="l00125"></a>00125     nfail += fors_cpl_test(cpl_error_get_code() == CPL_ERROR_NONE);
-<a name="l00126"></a>00126     nfail += fors_cpl_test(wcs != NULL);
-<a name="l00127"></a>00127     cpl_error_reset();
-<a name="l00128"></a>00128     <span class="keywordflow">if</span> (wcs != NULL)
-<a name="l00129"></a>00129     cpl_wcs_delete(wcs);
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131     <span class="comment">/* OK, now insert the rest of the propertylist */</span>
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133     <span class="keywordflow">for</span> (i = 0; i < NIK; i++) 
-<a name="l00134"></a>00134     cpl_propertylist_append_int(pl,ikeys[i],ivals[i]);
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     <span class="comment">/* Get a wcs structure */</span>
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138     wcs = cpl_wcs_new_from_propertylist(pl);
-<a name="l00139"></a>00139     nfail += fors_cpl_test(wcs != NULL);
-<a name="l00140"></a>00140     cpl_propertylist_delete(pl);
-<a name="l00141"></a>00141 
-<a name="l00142"></a>00142     <span class="comment">/* Test cpl_wcs_convert to see if we get the correct error messages */</span>
-<a name="l00143"></a>00143 
-<a name="l00144"></a>00144     nfail += fors_cpl_test(cpl_wcs_convert(NULL,NULL,&to,&status,
-<a name="l00145"></a>00145                       CPL_WCS_PHYS2WORLD) == CPL_ERROR_NULL_INPUT);
-<a name="l00146"></a>00146     cpl_error_reset();
-<a name="l00147"></a>00147     nfail += fors_cpl_test(cpl_wcs_convert(wcs,NULL,&to,&status,
-<a name="l00148"></a>00148                       CPL_WCS_PHYS2WORLD) == CPL_ERROR_NULL_INPUT);
-<a name="l00149"></a>00149     cpl_error_reset();
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     <span class="comment">/* Ok, do a conversion of physical to world coordinates */</span>
-<a name="l00152"></a>00152 
-<a name="l00153"></a>00153     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"Transform physical -> world (2 points)"</span>);
-<a name="l00154"></a>00154     from = cpl_matrix_wrap(NP,2,physin);
-<a name="l00155"></a>00155     cpl_wcs_convert(wcs,from,&to,&status,CPL_WCS_PHYS2WORLD);
-<a name="l00156"></a>00156     nfail += (cpl_error_get_code() != CPL_ERROR_NONE);
-<a name="l00157"></a>00157     cpl_error_reset();
-<a name="l00158"></a>00158     cpl_matrix_unwrap(from);
-<a name="l00159"></a>00159     
-<a name="l00160"></a>00160     <span class="comment">/* Test the output values. The status should all be 0. The output matrix</span>
-<a name="l00161"></a>00161 <span class="comment">       is compared to predifined world coordinate values */</span>
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">for</span> (i = 0; i < NP; i++)
-<a name="l00164"></a>00164         nfail += fors_cpl_test(cpl_array_get_data_int(status)[i] == 0);
-<a name="l00165"></a>00165     d1 = fabs(worldout[0] - cpl_matrix_get(to,0,0));
-<a name="l00166"></a>00166     d2 = fabs(worldout[1] - cpl_matrix_get(to,0,1));
-<a name="l00167"></a>00167     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"phys1,phys2:   %15.9f %15.9f"</span>,physin[0],physin[1]);
-<a name="l00168"></a>00168     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"world1,world2: %15.9f %15.9f"</span>,worldout[0],worldout[1]);
-<a name="l00169"></a>00169     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"calc1,calc2:   %15.9f %15.9f"</span>,cpl_matrix_get(to,0,0),
-<a name="l00170"></a>00170         cpl_matrix_get(to,0,1));
-<a name="l00171"></a>00171     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"diff1,diff2:   %15.9f %15.9f"</span>,d1,d2);
-<a name="l00172"></a>00172     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"status:        %d"</span>,(cpl_array_get_data_int(status)[0]));
-<a name="l00173"></a>00173     nfail += fors_cpl_test(d1 < 1.0e-6);
-<a name="l00174"></a>00174     nfail += fors_cpl_test(d2 < 1.0e-6);
-<a name="l00175"></a>00175     d1 = fabs(worldout[2] - cpl_matrix_get(to,1,0));
-<a name="l00176"></a>00176     d2 = fabs(worldout[3] - cpl_matrix_get(to,1,1));
-<a name="l00177"></a>00177     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"phys1,phys2:   %15.9f %15.9f"</span>,physin[2],physin[3]);
-<a name="l00178"></a>00178     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"world1,world2: %15.9f %15.9f"</span>,worldout[2],worldout[3]);
-<a name="l00179"></a>00179     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"calc1,calc2:   %15.9f %15.9f"</span>,cpl_matrix_get(to,1,0),
-<a name="l00180"></a>00180         cpl_matrix_get(to,1,1));
-<a name="l00181"></a>00181     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"diff1,diff2:   %15.9f %15.9f"</span>,d1,d2);
-<a name="l00182"></a>00182     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"status:        %d"</span>,
-<a name="l00183"></a>00183          (cpl_array_get_data_int(status)[1]));
-<a name="l00184"></a>00184     nfail += fors_cpl_test(d1 < 1.0e-6);
-<a name="l00185"></a>00185     nfail += fors_cpl_test(d2 < 1.0e-6);
-<a name="l00186"></a>00186     cpl_matrix_delete(to);
-<a name="l00187"></a>00187     cpl_array_delete(status);
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189     <span class="comment">/* Do world to physical conversion */</span>
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"Transform world -> physical"</span>);
-<a name="l00192"></a>00192     from = cpl_matrix_wrap(1,2,worldin);
-<a name="l00193"></a>00193 <span class="comment">//    cpl_matrix_dump(from, stdout);</span>
-<a name="l00194"></a>00194     cpl_wcs_convert(wcs,from,&to,&status,CPL_WCS_WORLD2PHYS);
-<a name="l00195"></a>00195     nfail += (cpl_error_get_code() != CPL_ERROR_NONE);
-<a name="l00196"></a>00196     cpl_error_reset();
-<a name="l00197"></a>00197     cpl_matrix_unwrap(from);
-<a name="l00198"></a>00198     
-<a name="l00199"></a>00199     <span class="comment">/* Test the output values again */</span>
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201     nfail += fors_cpl_test(cpl_array_get_data_int(status)[0] == 0);
-<a name="l00202"></a>00202     d1 = fabs(physout[0] - cpl_matrix_get(to,0,0));
-<a name="l00203"></a>00203     d2 = fabs(physout[1] - cpl_matrix_get(to,0,1));
-<a name="l00204"></a>00204     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"world1,world2: %15.9f %15.9f"</span>,worldin[0],worldin[1]);
-<a name="l00205"></a>00205     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"phys1,phys2:   %15.9f %15.9f"</span>,physout[0],physout[1]);
-<a name="l00206"></a>00206     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"calc1,calc2:   %15.9f %15.9f"</span>,cpl_matrix_get(to,0,0),
-<a name="l00207"></a>00207         cpl_matrix_get(to,0,1));
-<a name="l00208"></a>00208     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"diff1,diff2:   %15.9f %15.9f"</span>,d1,d2);
-<a name="l00209"></a>00209     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"status:        %d"</span>,(cpl_array_get_data_int(status)[0]));
-<a name="l00210"></a>00210     nfail += fors_cpl_test(d1 < 2.5e-4);
-<a name="l00211"></a>00211     nfail += fors_cpl_test(d2 < 2.5e-4);
-<a name="l00212"></a>00212     cpl_matrix_delete(to);
-<a name="l00213"></a>00213     cpl_array_delete(status);
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215     <span class="comment">/* Do physical to standard */</span>
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"Transform physical -> standard"</span>);
-<a name="l00218"></a>00218     from = cpl_matrix_wrap(1,2,physin);
-<a name="l00219"></a>00219 <span class="comment">//    cpl_matrix_dump(from, stdout);</span>
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     cpl_wcs_convert(wcs,from,&to,&status,CPL_WCS_PHYS2STD);
-<a name="l00222"></a>00222     nfail += (cpl_error_get_code() != CPL_ERROR_NONE);
-<a name="l00223"></a>00223     cpl_error_reset();
-<a name="l00224"></a>00224     cpl_matrix_unwrap(from);
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <span class="comment">/* Test the output values again */</span>
-<a name="l00227"></a>00227 
-<a name="l00228"></a>00228     nfail += fors_cpl_test(cpl_array_get_data_int(status)[0] == 0);
-<a name="l00229"></a>00229     d1 = fabs(stdcout[0] - cpl_matrix_get(to,0,0));
-<a name="l00230"></a>00230     d2 = fabs(stdcout[1] - cpl_matrix_get(to,0,1));
-<a name="l00231"></a>00231     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"phys1,phys2:   %15.9f %15.9f"</span>,physin[0],physin[1]);
-<a name="l00232"></a>00232     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"std1,std2:     %15.9f %15.9f"</span>,stdcout[0],stdcout[1]);
-<a name="l00233"></a>00233     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"calc1,calc2:   %15.9f %15.9f"</span>,cpl_matrix_get(to,0,0),
-<a name="l00234"></a>00234         cpl_matrix_get(to,0,1));
-<a name="l00235"></a>00235     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"diff1,diff2:   %15.9f %15.9f"</span>,d1,d2);
-<a name="l00236"></a>00236     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"status:        %d"</span>,(cpl_array_get_data_int(status)[0]));
-<a name="l00237"></a>00237     nfail += fors_cpl_test(d1 < 1.7e-9);
-<a name="l00238"></a>00238     nfail += fors_cpl_test(d2 < 1.7e-9);
-<a name="l00239"></a>00239     cpl_matrix_delete(to);
-<a name="l00240"></a>00240     cpl_array_delete(status);
-<a name="l00241"></a>00241 
-<a name="l00242"></a>00242     <span class="comment">/* Do world to standard */</span>
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"Transform world -> standard"</span>);
-<a name="l00245"></a>00245     from = cpl_matrix_wrap(1,2,worldout);
-<a name="l00246"></a>00246 <span class="comment">//    cpl_matrix_dump(from, stdout);</span>
-<a name="l00247"></a>00247 
-<a name="l00248"></a>00248     cpl_wcs_convert(wcs,from,&to,&status,CPL_WCS_WORLD2STD);
-<a name="l00249"></a>00249     nfail += (cpl_error_get_code() != CPL_ERROR_NONE);
-<a name="l00250"></a>00250     cpl_error_reset();
-<a name="l00251"></a>00251     cpl_matrix_unwrap(from);
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253     <span class="comment">/* Test the output values again */</span>
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255     nfail += fors_cpl_test(cpl_array_get_data_int(status)[0] == 0);
-<a name="l00256"></a>00256     d1 = fabs(stdcout[0] - cpl_matrix_get(to,0,0));
-<a name="l00257"></a>00257     d2 = fabs(stdcout[1] - cpl_matrix_get(to,0,1));
-<a name="l00258"></a>00258     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"world1,world2: %15.9f %15.9f"</span>,worldout[0],worldout[1]);
-<a name="l00259"></a>00259     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"std1,std2:     %15.9f %15.9f"</span>,stdcout[0],stdcout[1]);
-<a name="l00260"></a>00260     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"calc1,calc2:   %15.9f %15.9f"</span>,cpl_matrix_get(to,0,0),
-<a name="l00261"></a>00261         cpl_matrix_get(to,0,1));
-<a name="l00262"></a>00262     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"diff1,diff2:   %15.9f %15.9f"</span>,d1,d2);
-<a name="l00263"></a>00263     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"status:        %d"</span>,(cpl_array_get_data_int(status)[0]));
-<a name="l00264"></a>00264     nfail += fors_cpl_test(d1 < 1.7e-9);
-<a name="l00265"></a>00265     nfail += fors_cpl_test(d2 < 1.7e-9);
-<a name="l00266"></a>00266     cpl_matrix_delete(to);
-<a name="l00267"></a>00267     cpl_array_delete(status);
-<a name="l00268"></a>00268 
-<a name="l00269"></a>00269     <span class="comment">/* Tidy */</span>
-<a name="l00270"></a>00270 
-<a name="l00271"></a>00271     cpl_wcs_delete(wcs);
-<a name="l00272"></a>00272 
-<a name="l00273"></a>00273     <span class="comment">/* Are there any memory leaks (NB: this only covers CPL. Memory is </span>
-<a name="l00274"></a>00274 <span class="comment">       allocated separately by WCSLIB */</span>
-<a name="l00275"></a>00275 
-<a name="l00276"></a>00276     nfail += fors_cpl_test(cpl_memory_is_empty());
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278     <span class="comment">/* Did any tests fail? */</span>
-<a name="l00279"></a>00279 
-<a name="l00280"></a>00280     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"%d test(s) failed"</span>,nfail);
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282     <span class="comment">/* Tidy and exit */</span>
-<a name="l00283"></a>00283     
-<a name="l00284"></a>00284     <span class="keywordflow">if</span> (is_debug || !cpl_memory_is_empty())
-<a name="l00285"></a>00285     cpl_memory_dump();
-<a name="l00286"></a>00286     cpl_end();
-<a name="l00287"></a>00287     <span class="keywordflow">return</span>(nfail);
-<a name="l00288"></a>00288 }
-<a name="l00289"></a>00289     
-<a name="l00290"></a>00290     
-<a name="l00291"></a>00291 <span class="preprocessor">#else</span>
-<a name="l00292"></a>00292 <span class="preprocessor"></span>
-<a name="l00293"></a>00293 <span class="preprocessor">#include <test.h></span>
-<a name="l00294"></a>00294 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00295"></a>00295 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00296"></a>00296 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00297"></a>00297 <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00298"></a>00298 {
-<a name="l00299"></a>00299     TEST_INIT;
-<a name="l00300"></a>00300     
-<a name="l00301"></a>00301     cpl_msg_info(cpl_func, <span class="stringliteral">"WCS module not available"</span>);
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303     TEST_END;
-<a name="l00304"></a>00304 }
-<a name="l00305"></a>00305     
-<a name="l00306"></a>00306 <span class="preprocessor">#endif</span>
-<a name="l00307"></a>00307 <span class="preprocessor"></span>        
-<a name="l00308"></a>00308     
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311 
-<a name="l00312"></a>00312     
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__cpl__wcs-test_8c_source.html b/html/fors__cpl__wcs-test_8c_source.html
new file mode 100644
index 0000000..e0c8a88
--- /dev/null
+++ b/html/fors__cpl__wcs-test_8c_source.html
@@ -0,0 +1,373 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_cpl_wcs-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_cpl_wcs-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_cpl_wcs-test.c,v 1.2 2008-02-07 14:41:21 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the ESO Common Pipeline Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2001-2004 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2008-02-07 14:41:21 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.2 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_WCS</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="comment">/*----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="comment">                                   Includes</span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="comment"> ----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <float.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <cpl_wcs.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="comment">//#include "cpl_tools.h"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#define NSK 2</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor"></span><span class="preprocessor">#define NDK 13</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor"></span><span class="preprocessor">#define NIK 3</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#define fors_cpl_test(bool) \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">  ((bool) ? (cpl_msg_debug(__FILE__, \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">     "OK in line %d (CPL-error state: '%s' in %s): %s",__LINE__, \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">       cpl_error_get_message(), cpl_error_get_where(), #bool), 0) \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">    : (cpl_msg_error(__FILE__, \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">     "Failure in line %d (CPL-error state: '%s' in %s): %s",__LINE__, \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">       cpl_error_get_message(), cpl_error_get_where(), #bool), 1))</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *skeys[NSK] = {<span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"CTYPE2"</span>};</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *dkeys[NDK] = {<span class="stringliteral">"CRVAL1"</span>, <span class="stringliteral">"CRVAL2"</span>, <span class="stringliteral">"CRPIX1"</span>, <span class="stringliteral">"CRPIX2"</span>, </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>                  <span class="stringliteral">"CD1_1"</span>, <span class="stringliteral">"CD1_2"</span>, <span class="stringliteral">"CD2_1"</span>, <span class="stringliteral">"CD2_2"</span>, <span class="stringliteral">"PV2_1"</span>,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>                  <span class="stringliteral">"PV2_2"</span>, <span class="stringliteral">"PV2_3"</span>, <span class="stringliteral">"PV2_4"</span>, <span class="stringliteral">"PV2_5"</span>};</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *ikeys[NIK] = {<span class="stringliteral">"NAXIS"</span>,<span class="stringliteral">"NAXIS1"</span>,<span class="stringliteral">"NAXIS2"</span>};</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *svals[NSK] = {<span class="stringliteral">"RA---ZPN"</span>, <span class="stringliteral">"DEC--ZPN"</span>};</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> dvals[NDK] = {5.57368333333, -72.0576388889, 5401.6, 6860.8,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                   5.81347849634012E-21, 9.49444444444444E-05,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                   -9.49444444444444E-05, -5.81347849634012E-21,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                   1.0, 0.0, 42.0, 0.0, 0.0};</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> ivals[NIK] = {2, 2048, 2048};</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> </div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">#define NP 2</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">double</span> physin[2*NP] = {1024.0, 1024.0, 1025.0, 1023.0};</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="keyword">static</span> <span class="keywordtype">double</span> worldout[2*NP] = {3.825029720, -71.636524754,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                 3.824722171, -71.636616487};</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="keyword">static</span> <span class="keywordtype">double</span> stdcout[2] = {-0.554171733, 0.415628800};</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="keyword">static</span> <span class="keywordtype">double</span> worldin[2] = {3.824875946, -71.636570620};</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="keyword">static</span> <span class="keywordtype">double</span> physout[2] = {1024.5, 1023.5};</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a> (<span class="keywordtype">void</span>) {</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     cpl_boolean is_debug;</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     <span class="keywordtype">int</span> i,nfail;</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     cpl_propertylist *pl;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_wcs *wcs;</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     cpl_matrix *from,*to;</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     cpl_array *status;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="keywordtype">double</span> d1,d2;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <span class="comment">/* Initialise */</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     cpl_init(CPL_INIT_DEFAULT);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     cpl_msg_set_level(CPL_MSG_WARNING);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     cpl_msg_set_level_from_env();</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     cpl_msg_set_domain_off();</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     is_debug = cpl_msg_get_level() <= CPL_MSG_DEBUG ? TRUE : FALSE;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> </div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="comment">/* Read in all the WCS properties, except for NAXIS? entries*/</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     pl = cpl_propertylist_new();</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="keywordflow">for</span> (i = 0; i < NSK; i++) </div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     cpl_propertylist_append_string(pl,skeys[i],svals[i]);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="keywordflow">for</span> (i = 0; i < NDK; i++) </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     cpl_propertylist_append_double(pl,dkeys[i],dvals[i]);</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="comment">/* Now test cpl_wcs_new_from_propertylist to make sure we get the</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="comment">       correct errors */</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     nfail = 0;</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     wcs = cpl_wcs_new_from_propertylist(NULL);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     nfail += fors_cpl_test(cpl_error_get_code() == CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     nfail += fors_cpl_test(wcs == NULL);</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     cpl_error_reset();</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="keywordflow">if</span> (wcs != NULL)</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     cpl_wcs_delete(wcs);</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     wcs = cpl_wcs_new_from_propertylist(pl);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     nfail += fors_cpl_test(cpl_error_get_code() == CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     nfail += fors_cpl_test(wcs != NULL);</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     cpl_error_reset();</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">if</span> (wcs != NULL)</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     cpl_wcs_delete(wcs);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     <span class="comment">/* OK, now insert the rest of the propertylist */</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <span class="keywordflow">for</span> (i = 0; i < NIK; i++) </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     cpl_propertylist_append_int(pl,ikeys[i],ivals[i]);</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     <span class="comment">/* Get a wcs structure */</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     wcs = cpl_wcs_new_from_propertylist(pl);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     nfail += fors_cpl_test(wcs != NULL);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     cpl_propertylist_delete(pl);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="comment">/* Test cpl_wcs_convert to see if we get the correct error messages */</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     nfail += fors_cpl_test(cpl_wcs_convert(NULL,NULL,&to,&status,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                       CPL_WCS_PHYS2WORLD) == CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     cpl_error_reset();</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     nfail += fors_cpl_test(cpl_wcs_convert(wcs,NULL,&to,&status,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                       CPL_WCS_PHYS2WORLD) == CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     cpl_error_reset();</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="comment">/* Ok, do a conversion of physical to world coordinates */</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"Transform physical -> world (2 points)"</span>);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     from = cpl_matrix_wrap(NP,2,physin);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     cpl_wcs_convert(wcs,from,&to,&status,CPL_WCS_PHYS2WORLD);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     nfail += (cpl_error_get_code() != CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     cpl_error_reset();</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     cpl_matrix_unwrap(from);</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="comment">/* Test the output values. The status should all be 0. The output matrix</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="comment">       is compared to predifined world coordinate values */</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">for</span> (i = 0; i < NP; i++)</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         nfail += fors_cpl_test(cpl_array_get_data_int(status)[i] == 0);</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     d1 = fabs(worldout[0] - cpl_matrix_get(to,0,0));</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     d2 = fabs(worldout[1] - cpl_matrix_get(to,0,1));</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"phys1,phys2:   %15.9f %15.9f"</span>,physin[0],physin[1]);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"world1,world2: %15.9f %15.9f"</span>,worldout[0],worldout[1]);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"calc1,calc2:   %15.9f %15.9f"</span>,cpl_matrix_get(to,0,0),</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>         cpl_matrix_get(to,0,1));</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"diff1,diff2:   %15.9f %15.9f"</span>,d1,d2);</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"status:        %d"</span>,(cpl_array_get_data_int(status)[0]));</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     nfail += fors_cpl_test(d1 < 1.0e-6);</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     nfail += fors_cpl_test(d2 < 1.0e-6);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     d1 = fabs(worldout[2] - cpl_matrix_get(to,1,0));</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     d2 = fabs(worldout[3] - cpl_matrix_get(to,1,1));</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"phys1,phys2:   %15.9f %15.9f"</span>,physin[2],physin[3]);</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"world1,world2: %15.9f %15.9f"</span>,worldout[2],worldout[3]);</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"calc1,calc2:   %15.9f %15.9f"</span>,cpl_matrix_get(to,1,0),</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>         cpl_matrix_get(to,1,1));</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"diff1,diff2:   %15.9f %15.9f"</span>,d1,d2);</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"status:        %d"</span>,</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>          (cpl_array_get_data_int(status)[1]));</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     nfail += fors_cpl_test(d1 < 1.0e-6);</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     nfail += fors_cpl_test(d2 < 1.0e-6);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_matrix_delete(to);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     cpl_array_delete(status);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     <span class="comment">/* Do world to physical conversion */</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"Transform world -> physical"</span>);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     from = cpl_matrix_wrap(1,2,worldin);</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="comment">//    cpl_matrix_dump(from, stdout);</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     cpl_wcs_convert(wcs,from,&to,&status,CPL_WCS_WORLD2PHYS);</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     nfail += (cpl_error_get_code() != CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     cpl_error_reset();</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     cpl_matrix_unwrap(from);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     </div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <span class="comment">/* Test the output values again */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     nfail += fors_cpl_test(cpl_array_get_data_int(status)[0] == 0);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     d1 = fabs(physout[0] - cpl_matrix_get(to,0,0));</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     d2 = fabs(physout[1] - cpl_matrix_get(to,0,1));</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"world1,world2: %15.9f %15.9f"</span>,worldin[0],worldin[1]);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"phys1,phys2:   %15.9f %15.9f"</span>,physout[0],physout[1]);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"calc1,calc2:   %15.9f %15.9f"</span>,cpl_matrix_get(to,0,0),</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         cpl_matrix_get(to,0,1));</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"diff1,diff2:   %15.9f %15.9f"</span>,d1,d2);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"status:        %d"</span>,(cpl_array_get_data_int(status)[0]));</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     nfail += fors_cpl_test(d1 < 2.5e-4);</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     nfail += fors_cpl_test(d2 < 2.5e-4);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     cpl_matrix_delete(to);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     cpl_array_delete(status);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <span class="comment">/* Do physical to standard */</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"Transform physical -> standard"</span>);</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     from = cpl_matrix_wrap(1,2,physin);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="comment">//    cpl_matrix_dump(from, stdout);</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     cpl_wcs_convert(wcs,from,&to,&status,CPL_WCS_PHYS2STD);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     nfail += (cpl_error_get_code() != CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_error_reset();</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     cpl_matrix_unwrap(from);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="comment">/* Test the output values again */</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> </div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     nfail += fors_cpl_test(cpl_array_get_data_int(status)[0] == 0);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     d1 = fabs(stdcout[0] - cpl_matrix_get(to,0,0));</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     d2 = fabs(stdcout[1] - cpl_matrix_get(to,0,1));</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"phys1,phys2:   %15.9f %15.9f"</span>,physin[0],physin[1]);</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"std1,std2:     %15.9f %15.9f"</span>,stdcout[0],stdcout[1]);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"calc1,calc2:   %15.9f %15.9f"</span>,cpl_matrix_get(to,0,0),</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>         cpl_matrix_get(to,0,1));</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"diff1,diff2:   %15.9f %15.9f"</span>,d1,d2);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"status:        %d"</span>,(cpl_array_get_data_int(status)[0]));</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     nfail += fors_cpl_test(d1 < 1.7e-9);</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     nfail += fors_cpl_test(d2 < 1.7e-9);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     cpl_matrix_delete(to);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     cpl_array_delete(status);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> </div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     <span class="comment">/* Do world to standard */</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"Transform world -> standard"</span>);</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     from = cpl_matrix_wrap(1,2,worldout);</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> <span class="comment">//    cpl_matrix_dump(from, stdout);</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     cpl_wcs_convert(wcs,from,&to,&status,CPL_WCS_WORLD2STD);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     nfail += (cpl_error_get_code() != CPL_ERROR_NONE);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     cpl_error_reset();</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_matrix_unwrap(from);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="comment">/* Test the output values again */</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     nfail += fors_cpl_test(cpl_array_get_data_int(status)[0] == 0);</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     d1 = fabs(stdcout[0] - cpl_matrix_get(to,0,0));</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     d2 = fabs(stdcout[1] - cpl_matrix_get(to,0,1));</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"world1,world2: %15.9f %15.9f"</span>,worldout[0],worldout[1]);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"std1,std2:     %15.9f %15.9f"</span>,stdcout[0],stdcout[1]);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"calc1,calc2:   %15.9f %15.9f"</span>,cpl_matrix_get(to,0,0),</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         cpl_matrix_get(to,0,1));</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"diff1,diff2:   %15.9f %15.9f"</span>,d1,d2);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"status:        %d"</span>,(cpl_array_get_data_int(status)[0]));</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     nfail += fors_cpl_test(d1 < 1.7e-9);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     nfail += fors_cpl_test(d2 < 1.7e-9);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_matrix_delete(to);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_array_delete(status);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="comment">/* Tidy */</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> </div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     cpl_wcs_delete(wcs);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="comment">/* Are there any memory leaks (NB: this only covers CPL. Memory is </span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> <span class="comment">       allocated separately by WCSLIB */</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     nfail += fors_cpl_test(cpl_memory_is_empty());</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="comment">/* Did any tests fail? */</span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     cpl_msg_info(<span class="stringliteral">""</span>,<span class="stringliteral">"%d test(s) failed"</span>,nfail);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="comment">/* Tidy and exit */</span></div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="keywordflow">if</span> (is_debug || !cpl_memory_is_empty())</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     cpl_memory_dump();</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     cpl_end();</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">return</span>(nfail);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> }</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     </div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> {</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     TEST_INIT;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"WCS module not available"</span>);</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     TEST_END;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> }</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> <span class="preprocessor"></span>        </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> </div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__cpl__wcs_8c-source.html b/html/fors__cpl__wcs_8c-source.html
deleted file mode 100644
index a904efb..0000000
--- a/html/fors__cpl__wcs_8c-source.html
+++ /dev/null
@@ -1,646 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_cpl_wcs.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_cpl_wcs.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_cpl_wcs.c,v 1.10 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the ESO Common Pipeline Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.10 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="comment">// Ouch! WCSLIB exports its config.h which will clash with ours,</span>
-<a name="l00029"></a>00029 <span class="comment">// so avoid that</span>
-<a name="l00030"></a>00030 <span class="comment">//#ifdef HAVE_CONFIG_H</span>
-<a name="l00031"></a>00031 <span class="comment">//#include <config.h></span>
-<a name="l00032"></a>00032 <span class="comment">//#endif</span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="comment">/*----------------------------------------------------------------------------</span>
-<a name="l00035"></a>00035 <span class="comment">                                   Includes</span>
-<a name="l00036"></a>00036 <span class="comment"> ----------------------------------------------------------------------------*/</span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="preprocessor">#include "fors_cpl_wcs.h"</span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include "cpl.h"</span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include <fitsio.h></span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include <fitsio2.h></span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include <wcslib.h></span>
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="comment">//#include <cpl_propertylist_impl.h></span>
-<a name="l00047"></a>00047 <span class="comment">//Declare internal CPL functions:</span>
-<a name="l00048"></a>00048 cpl_propertylist *cpl_propertylist_from_fitsfile(fitsfile *file);
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050 <span class="comment">// Note! ugly hack here. In CPL 4.0 the prototype was</span>
-<a name="l00051"></a>00051 <span class="comment">// cpl_error_code cpl_propertylist_to_fitsfile(fitsfile *file, const cpl_propertylist *self);</span>
-<a name="l00052"></a>00052 <span class="comment">//</span>
-<a name="l00053"></a>00053 <span class="comment">// Later versions:</span>
-<a name="l00054"></a>00054 <span class="comment">// cpl_error_code cpl_propertylist_to_fitsfile(fitsfile *file, const cpl_propertylist *, const char *);</span>
-<a name="l00055"></a>00055 <span class="comment">// We declare this function always as</span>
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 cpl_error_code cpl_propertylist_to_fitsfile(fitsfile *file, <span class="keyword">const</span> cpl_propertylist *<span class="keyword">self</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *); 
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="comment">// which accidentally works also with the CPL4.0 prototype because the </span>
-<a name="l00060"></a>00060 <span class="comment">// 3rd superfluous argument is ignored</span>
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="preprocessor">#include <math.h></span>
-<a name="l00063"></a>00063 <span class="preprocessor">#include <string.h></span>
-<a name="l00064"></a>00064 
-<a name="l00065"></a>00065 <span class="comment">/*---------------------------------------------------------------------------*/</span>
-<a name="l00082"></a>00082 <span class="comment">/*---------------------------------------------------------------------------*/</span>
-<a name="l00085"></a>00085 <span class="comment">/*----------------------------------------------------------------------------</span>
-<a name="l00086"></a>00086 <span class="comment">                                   Type definition</span>
-<a name="l00087"></a>00087 <span class="comment"> ----------------------------------------------------------------------------*/</span>
-<a name="l00088"></a>00088 
-<a name="l00089"></a><a class="code" href="struct__fors__cpl__wcs__.html">00089</a> <span class="keyword">struct </span><a class="code" href="struct__fors__cpl__wcs__.html">_fors_cpl_wcs_</a> {
-<a name="l00090"></a><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">00090</a>     <span class="keyword">struct </span>wcsprm *<a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a>;   <span class="comment">/* WCSLIB structure */</span>
-<a name="l00091"></a><a class="code" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">00091</a>     <span class="keywordtype">int</span>           <a class="code" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">naxis</a>;     <span class="comment">/* Number of dimensions of the image */</span>
-<a name="l00092"></a><a class="code" href="struct__fors__cpl__wcs__.html#947b7dc1ce3651b19825dee6fe385666">00092</a>     <span class="keywordtype">int</span>           *<a class="code" href="struct__fors__cpl__wcs__.html#947b7dc1ce3651b19825dee6fe385666">dims</a>;     <span class="comment">/* Dimensions of image */</span>
-<a name="l00093"></a>00093 };
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095 <span class="comment">/* Static routine declarations */</span>
-<a name="l00096"></a>00096 
-<a name="l00097"></a>00097 <span class="keyword">static</span> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *<a class="code" href="group__fors__cpl__wcs.html#g1ff77ef3ec6654b60865ff114ffb0194">fors_cpl_wcs_init</a>(<span class="keywordtype">void</span>);
-<a name="l00098"></a>00098 <span class="keyword">static</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__cpl__wcs.html#ge66dce7f4ef9d442dd849595f39b82bf">fors_cpl_wcs_plist2fitsstr</a>(<span class="keyword">const</span> cpl_propertylist *<span class="keyword">self</span>, <span class="keywordtype">int</span> *nkeys);
-<a name="l00099"></a>00099 <span class="keyword">static</span> cpl_propertylist *<a class="code" href="group__fors__cpl__wcs.html#g8d23e487c941ebc5b4d30a113f9dc324">fors_cpl_wcs_fitsstr2plist</a>(<span class="keywordtype">char</span> *fitsstr);
-<a name="l00100"></a>00100 
-<a name="l00101"></a>00101 <span class="comment">/* Useful conversion factors */</span>
-<a name="l00102"></a>00102 
-<a name="l00103"></a><a class="code" href="group__fors__cpl__wcs.html#g9cd93383f8763df38b2245c017e9bcd7">00103</a> <span class="preprocessor">#define DEGRAD 57.2957795130823229</span>
-<a name="l00104"></a>00104 <span class="preprocessor"></span>
-<a name="l00105"></a>00105 <span class="comment">/* WCSLIB error messages */</span>
-<a name="l00106"></a>00106 
-<a name="l00107"></a><a class="code" href="group__fors__cpl__wcs.html#gc010b843f505ed7d24c8da36477b5cde">00107</a> <span class="preprocessor">#define WCSLIB_ERRCODE_MAX  9</span>
-<a name="l00108"></a><a class="code" href="group__fors__cpl__wcs.html#ga106b9beff20823017688021d7f008c3">00108</a> <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__cpl__wcs.html#ga106b9beff20823017688021d7f008c3">wcslib_errmsgs</a>[<a class="code" href="group__fors__cpl__wcs.html#gc010b843f505ed7d24c8da36477b5cde">WCSLIB_ERRCODE_MAX</a>+1] = {
-<a name="l00109"></a>00109                   <span class="stringliteral">""</span>,
-<a name="l00110"></a>00110           <span class="stringliteral">"WCSLIB undefined input structure pointer"</span>,
-<a name="l00111"></a>00111           <span class="stringliteral">"WCSLIB unable to allocate required memory"</span>,
-<a name="l00112"></a>00112           <span class="stringliteral">"WCSLIB linear transformation matrix is singular"</span>,
-<a name="l00113"></a>00113           <span class="stringliteral">"WCSLIB invalid coordinate axis types"</span>,
-<a name="l00114"></a>00114           <span class="stringliteral">"WCSLIB invalid parameter value"</span>,
-<a name="l00115"></a>00115           <span class="stringliteral">"WCSLIB invalid coordinate transformation parameters"</span>,
-<a name="l00116"></a>00116           <span class="stringliteral">"WCSLIB Ill-conditioned coordinate transformation parameters"</span>,
-<a name="l00117"></a>00117           <span class="stringliteral">"WCSLIB One or more input coordinates invalid"</span>,
-<a name="l00118"></a>00118           <span class="stringliteral">"WCSLIB One or more input coordinates invalid"</span>};
-<a name="l00119"></a>00119           
-<a name="l00120"></a>00120 
-<a name="l00121"></a>00121 <span class="comment">/*-------------------------------------------------------------------------*/</span>
-<a name="l00122"></a>00122 <span class="comment">/*-------------------------------------------------------------------------*/</span>
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125 <span class="comment">/*--------------------------------------------------------------------------</span>
-<a name="l00126"></a>00126 <span class="comment">  [jmlarsen] This is a workaround for ffhdr2str() which has a severe memory error in CFITSIO 2.510,</span>
-<a name="l00127"></a>00127 <span class="comment">  fixed somewhere between versions 2.510 and 3.030</span>
-<a name="l00128"></a>00128 <span class="comment">*/</span>
-<a name="l00129"></a>00129 
-<a name="l00130"></a><a class="code" href="group__fors__cpl__wcs.html#g9be6ef771ded8b7466af4ed6485d17f6">00130</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__cpl__wcs.html#g9be6ef771ded8b7466af4ed6485d17f6">fors_ffhdr2str</a>( 
-<a name="l00131"></a>00131     fitsfile *fptr,  <span class="comment">/* I - FITS file pointer                    */</span>
-<a name="l00132"></a>00132     <span class="keywordtype">int</span> exclude_comm,   <span class="comment">/* I - if TRUE, exclude commentary keywords */</span>
-<a name="l00133"></a>00133     <span class="keywordtype">char</span> **exclist,     <span class="comment">/* I - list of excluded keyword names       */</span>
-<a name="l00134"></a>00134     <span class="keywordtype">int</span> nexc,           <span class="comment">/* I - number of names in exclist           */</span>
-<a name="l00135"></a>00135     <span class="keywordtype">char</span> **header,      <span class="comment">/* O - returned header string               */</span>
-<a name="l00136"></a>00136     <span class="keywordtype">int</span> *nkeys,         <span class="comment">/* O - returned number of 80-char keywords  */</span>
-<a name="l00137"></a>00137     <span class="keywordtype">int</span>  *status)       <span class="comment">/* IO - error status                        */</span>
-<a name="l00138"></a>00138 <span class="comment">/*</span>
-<a name="l00139"></a>00139 <span class="comment">  read header keywords into a long string of chars.  This routine allocates</span>
-<a name="l00140"></a>00140 <span class="comment">  memory for the string, so the calling routine must eventually free the</span>
-<a name="l00141"></a>00141 <span class="comment">  memory when it is not needed any more.  If exclude_comm is TRUE, then all</span>
-<a name="l00142"></a>00142 <span class="comment">  the COMMENT, HISTORY, and <blank> keywords will be excluded from the output</span>
-<a name="l00143"></a>00143 <span class="comment">  string of keywords.  Any other list of keywords to be excluded may be</span>
-<a name="l00144"></a>00144 <span class="comment">  specified with the exclist parameter.</span>
-<a name="l00145"></a>00145 <span class="comment">*/</span>
-<a name="l00146"></a>00146 {
-<a name="l00147"></a>00147     {
-<a name="l00148"></a>00148         <span class="comment">/* [jmlarsen] Use the actual CFITSIO function if the</span>
-<a name="l00149"></a>00149 <span class="comment">           version number is recent enough */</span>
-<a name="l00150"></a>00150         <span class="keywordtype">float</span> version;
-<a name="l00151"></a>00151         fits_get_version(&version);
-<a name="l00152"></a>00152         
-<a name="l00153"></a>00153         <span class="keywordflow">if</span> (version >= 3.030) 
-<a name="l00154"></a>00154             <span class="keywordflow">return</span> ffhdr2str(fptr, exclude_comm, exclist, nexc, header, nkeys, status);
-<a name="l00155"></a>00155     }
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157     <span class="keywordtype">int</span> casesn, match, exact, totkeys;
-<a name="l00158"></a>00158     <span class="keywordtype">long</span> ii, jj;
-<a name="l00159"></a>00159     <span class="keywordtype">char</span> keybuf[162], keyname[FLEN_KEYWORD], *headptr;
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161     *nkeys = 0;
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (*status > 0)
-<a name="l00164"></a>00164         <span class="keywordflow">return</span>(*status);
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166     <span class="comment">/* get number of keywords in the header (doesn't include END) */</span>
-<a name="l00167"></a>00167     <span class="keywordflow">if</span> (ffghsp(fptr, &totkeys, NULL, status) > 0)
-<a name="l00168"></a>00168         <span class="keywordflow">return</span>(*status);
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170     <span class="comment">/* allocate memory for all the keywords (multiple of 2880 bytes) */</span>
-<a name="l00171"></a>00171     *header = (<span class="keywordtype">char</span> *) calloc ( (totkeys + 1) * 80 + 1, 1);
-<a name="l00172"></a>00172     <span class="keywordflow">if</span> (!(*header))
-<a name="l00173"></a>00173     {
-<a name="l00174"></a>00174          *status = MEMORY_ALLOCATION;
-<a name="l00175"></a>00175          ffpmsg(<span class="stringliteral">"failed to allocate memory to hold all the header keywords"</span>);
-<a name="l00176"></a>00176          <span class="keywordflow">return</span>(*status);
-<a name="l00177"></a>00177     }
-<a name="l00178"></a>00178 
-<a name="l00179"></a>00179     headptr = *header;
-<a name="l00180"></a>00180     casesn = FALSE;
-<a name="l00181"></a>00181 
-<a name="l00182"></a>00182     <span class="comment">/* read every keyword */</span>
-<a name="l00183"></a>00183     <span class="keywordflow">for</span> (ii = 1; ii <= totkeys; ii++)
-<a name="l00184"></a>00184     {
-<a name="l00185"></a>00185         ffgrec(fptr, ii, keybuf, status);
-<a name="l00186"></a>00186         <span class="comment">/* pad record with blanks so that it is at least 80 chars long */</span>
-<a name="l00187"></a>00187         strcat(keybuf,
-<a name="l00188"></a>00188     <span class="stringliteral">"                                                                                "</span>);
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190         keyname[0] = <span class="charliteral">'\0'</span>;
-<a name="l00191"></a>00191         strncat(keyname, keybuf, 8); <span class="comment">/* copy the keyword name */</span>
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193         <span class="keywordflow">if</span> (exclude_comm)
-<a name="l00194"></a>00194         {
-<a name="l00195"></a>00195             <span class="keywordflow">if</span> (!FSTRCMP(<span class="stringliteral">"COMMENT "</span>, keyname) ||
-<a name="l00196"></a>00196                 !FSTRCMP(<span class="stringliteral">"HISTORY "</span>, keyname) ||
-<a name="l00197"></a>00197                 !FSTRCMP(<span class="stringliteral">"        "</span>, keyname) )
-<a name="l00198"></a>00198               <span class="keywordflow">continue</span>;  <span class="comment">/* skip this commentary keyword */</span>
-<a name="l00199"></a>00199         }
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201         <span class="comment">/* does keyword match any names in the exclusion list? */</span>
-<a name="l00202"></a>00202         <span class="keywordflow">for</span> (jj = 0; jj < nexc; jj++ )
-<a name="l00203"></a>00203         {
-<a name="l00204"></a>00204             ffcmps(exclist[jj], keyname, casesn, &match, &exact);
-<a name="l00205"></a>00205                  <span class="keywordflow">if</span> (match)
-<a name="l00206"></a>00206                      <span class="keywordflow">break</span>;
-<a name="l00207"></a>00207         }
-<a name="l00208"></a>00208 
-<a name="l00209"></a>00209         <span class="keywordflow">if</span> (jj == nexc)
-<a name="l00210"></a>00210         {
-<a name="l00211"></a>00211             <span class="comment">/* not in exclusion list, add this keyword to the string */</span>
-<a name="l00212"></a>00212             strcpy(headptr, keybuf);
-<a name="l00213"></a>00213             headptr += 80;
-<a name="l00214"></a>00214             (*nkeys)++;
-<a name="l00215"></a>00215         }
-<a name="l00216"></a>00216     }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     <span class="comment">/* add the END keyword */</span>
-<a name="l00219"></a>00219     strcpy(headptr,
-<a name="l00220"></a>00220     <span class="stringliteral">"END                                                                             "</span>);
-<a name="l00221"></a>00221     headptr += 80;
-<a name="l00222"></a>00222     (*nkeys)++;
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224     *headptr = <span class="charliteral">'\0'</span>;   <span class="comment">/* terminate the header string */</span>
-<a name="l00225"></a>00225     
-<a name="l00226"></a>00226     *header = realloc(*header, (*nkeys *80) + 1); <span class="comment">/* minimize the allocated memory */</span>
-<a name="l00227"></a>00227 
-<a name="l00228"></a>00228     <span class="keywordflow">return</span>(*status);
-<a name="l00229"></a>00229 }
-<a name="l00230"></a>00230 
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233 
-<a name="l00234"></a>00234 <span class="comment">/*</span>
-<a name="l00235"></a>00235 <span class="comment"> * @brief</span>
-<a name="l00236"></a>00236 <span class="comment"> *    Create a wcs structure by parsing a propertylist.</span>
-<a name="l00237"></a>00237 <span class="comment"> *</span>
-<a name="l00238"></a>00238 <span class="comment"> * @param plist    The input propertylist</span>
-<a name="l00239"></a>00239 <span class="comment"> *</span>
-<a name="l00240"></a>00240 <span class="comment"> * @return</span>
-<a name="l00241"></a>00241 <span class="comment"> *   The newly created and filled fors_cpl_wcs object or NULL if it could not be</span>
-<a name="l00242"></a>00242 <span class="comment"> *   created. In the latter case an appropriate error code is set.</span>
-<a name="l00243"></a>00243 <span class="comment"> *</span>
-<a name="l00244"></a>00244 <span class="comment"> * @error</span>
-<a name="l00245"></a>00245 <span class="comment"> *   <table class="ec" align="center"></span>
-<a name="l00246"></a>00246 <span class="comment"> *     <tr></span>
-<a name="l00247"></a>00247 <span class="comment"> *       <td class="ecl">CPL_ERROR_NULL_INPUT</td></span>
-<a name="l00248"></a>00248 <span class="comment"> *       <td class="ecr"></span>
-<a name="l00249"></a>00249 <span class="comment"> *         The parameter <i>plist</i> is a <tt>NULL</tt> pointer.</span>
-<a name="l00250"></a>00250 <span class="comment"> *       </td></span>
-<a name="l00251"></a>00251 <span class="comment"> *     </tr></span>
-<a name="l00252"></a>00252 <span class="comment"> *     <tr></span>
-<a name="l00253"></a>00253 <span class="comment"> *       <td class="ecl">CPL_ERROR_TYPE_MISMATCH</td></span>
-<a name="l00254"></a>00254 <span class="comment"> *       <td class="ecr"></span>
-<a name="l00255"></a>00255 <span class="comment"> *         NAXIS information in image propertylist is not an integer</span>
-<a name="l00256"></a>00256 <span class="comment"> *       </td></span>
-<a name="l00257"></a>00257 <span class="comment"> *     </tr></span>
-<a name="l00258"></a>00258 <span class="comment"> *     <tr></span>
-<a name="l00259"></a>00259 <span class="comment"> *       <td class="ecl">CPL_ERROR_DATA_NOT_FOUND</td></span>
-<a name="l00260"></a>00260 <span class="comment"> *       <td class="ecr"></span>
-<a name="l00261"></a>00261 <span class="comment"> *         Error in getting NAXIS information for image propertylists</span>
-<a name="l00262"></a>00262 <span class="comment"> *       </td></span>
-<a name="l00263"></a>00263 <span class="comment"> *     </tr></span>
-<a name="l00264"></a>00264 <span class="comment"> *   </table></span>
-<a name="l00265"></a>00265 <span class="comment"> * @enderror</span>
-<a name="l00266"></a>00266 <span class="comment"> *</span>
-<a name="l00267"></a>00267 <span class="comment"> * The function allocates memory for a WCS structure. A pointer to the WCSLIB</span>
-<a name="l00268"></a>00268 <span class="comment"> * header information is created by parsing the FITS WCS keywords from the </span>
-<a name="l00269"></a>00269 <span class="comment"> * header of a file. A few ancillary items are also filled in.</span>
-<a name="l00270"></a>00270 <span class="comment"> *</span>
-<a name="l00271"></a>00271 <span class="comment"> * The returned property must be destroyed using the wcs destructor</span>
-<a name="l00272"></a>00272 <span class="comment"> * @b fors_cpl_wcs_delete().</span>
-<a name="l00273"></a>00273 <span class="comment"> *</span>
-<a name="l00274"></a>00274 <span class="comment"> * @see fors_cpl_wcs_delete()</span>
-<a name="l00275"></a>00275 <span class="comment"> */</span>
-<a name="l00276"></a>00276 
-<a name="l00277"></a><a class="code" href="group__fors__cpl__wcs.html#g4636540ea73da854494e3b19f72cdd2a">00277</a> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *<a class="code" href="group__fors__cpl__wcs.html#g4636540ea73da854494e3b19f72cdd2a">fors_cpl_wcs_new_from_propertylist</a>(<span class="keyword">const</span> cpl_propertylist *plist) {
-<a name="l00278"></a>00278     <span class="keyword">const</span> <span class="keywordtype">char</span> *_id = <span class="stringliteral">"fors_cpl_wcs_new"</span>;
-<a name="l00279"></a>00279     <span class="keywordtype">char</span> *shdr,nax[9];
-<a name="l00280"></a>00280     <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs;
-<a name="l00281"></a>00281     <span class="keywordtype">int</span> retval,nrej,nwcs,np,i;
-<a name="l00282"></a>00282     <span class="keyword">struct </span>wcsprm *wwcs = NULL;
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     <span class="comment">/* Check to see if the propertylist exists */</span>
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286     <span class="keywordflow">if</span> (plist == NULL) {
-<a name="l00287"></a>00287     cpl_error_set(_id,CPL_ERROR_NULL_INPUT);
-<a name="l00288"></a>00288     <span class="keywordflow">return</span>(NULL);
-<a name="l00289"></a>00289     }
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291     <span class="comment">/* Get the size of the propertylist. </span>
-<a name="l00292"></a>00292 <span class="comment">       jmlarsen: No, it will overrun a buffer </span>
-<a name="l00293"></a>00293 <span class="comment">       np = cpl_propertylist_get_size(plist);</span>
-<a name="l00294"></a>00294 <span class="comment">    */</span>
-<a name="l00295"></a>00295     
-<a name="l00296"></a>00296     <span class="comment">/* Get a fors_cpl_wcs structure and initialise it */</span>
-<a name="l00297"></a>00297 
-<a name="l00298"></a>00298     <span class="keywordflow">if</span> ((wcs = <a class="code" href="group__fors__cpl__wcs.html#g1ff77ef3ec6654b60865ff114ffb0194">fors_cpl_wcs_init</a>()) == NULL)
-<a name="l00299"></a>00299     <span class="keywordflow">return</span>(NULL);
-<a name="l00300"></a>00300 
-<a name="l00301"></a>00301     <span class="comment">/* Convert the propertylist into a string */</span>
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303     shdr = <a class="code" href="group__fors__cpl__wcs.html#ge66dce7f4ef9d442dd849595f39b82bf">fors_cpl_wcs_plist2fitsstr</a>(plist, &np);
-<a name="l00304"></a>00304     <span class="keywordflow">if</span> (! shdr) {
-<a name="l00305"></a>00305     cpl_error_set_where(_id);
-<a name="l00306"></a>00306     <a class="code" href="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43">fors_cpl_wcs_delete</a>(wcs);
-<a name="l00307"></a>00307     <span class="keywordflow">return</span>(NULL);
-<a name="l00308"></a>00308     }
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310     <span class="comment">/* Parse the header to get the wcslib structure */</span>
-<a name="l00311"></a>00311     retval = wcspih(shdr,np,0,0,&nrej,&nwcs,&wwcs);
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313     <span class="keywordflow">if</span> (retval != 0) {
-<a name="l00314"></a>00314         cpl_msg_warning(_id,<span class="stringliteral">"Cannot parse WCS header"</span>);
-<a name="l00315"></a>00315         free(shdr);
-<a name="l00316"></a>00316         wcsvfree(&nwcs,&wwcs);
-<a name="l00317"></a>00317     <a class="code" href="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43">fors_cpl_wcs_delete</a>(wcs);
-<a name="l00318"></a>00318         <span class="keywordflow">return</span>(NULL);
-<a name="l00319"></a>00319     }
-<a name="l00320"></a>00320     free(shdr);
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322     <span class="comment">/* Now extract the one you want and ditch the rest */</span>
-<a name="l00323"></a>00323 
-<a name="l00324"></a>00324     wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a> = (<span class="keyword">struct </span>wcsprm *)cpl_calloc(1,<span class="keyword">sizeof</span>(<span class="keyword">struct</span> wcsprm));
-<a name="l00325"></a>00325     (wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a>)->flag = -1;
-<a name="l00326"></a>00326     wcscopy(1,wwcs,wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a>);
-<a name="l00327"></a>00327     wcsset(wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a>);
-<a name="l00328"></a>00328     wcsvfree(&nwcs,&wwcs);
-<a name="l00329"></a>00329 
-<a name="l00330"></a>00330     <span class="comment">/* Fill the rest of the stuff */</span>
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     <span class="keywordflow">if</span> (cpl_propertylist_has(plist,<span class="stringliteral">"NAXIS"</span>)) {
-<a name="l00333"></a>00333     wcs-><a class="code" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">naxis</a> = cpl_propertylist_get_int(plist,<span class="stringliteral">"NAXIS"</span>);
-<a name="l00334"></a>00334     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00335"></a>00335         <a class="code" href="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43">fors_cpl_wcs_delete</a>(wcs);
-<a name="l00336"></a>00336         <span class="keywordflow">return</span>(NULL);
-<a name="l00337"></a>00337     }
-<a name="l00338"></a>00338     wcs-><a class="code" href="struct__fors__cpl__wcs__.html#947b7dc1ce3651b19825dee6fe385666">dims</a> = cpl_calloc(wcs-><a class="code" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">naxis</a>,<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l00339"></a>00339     <span class="keywordflow">for</span> (i = 1; i <= wcs-><a class="code" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">naxis</a>; i++) {
-<a name="l00340"></a>00340         (<span class="keywordtype">void</span>)snprintf(nax,9,<span class="stringliteral">"NAXIS%d"</span>,i);
-<a name="l00341"></a>00341         wcs-><a class="code" href="struct__fors__cpl__wcs__.html#947b7dc1ce3651b19825dee6fe385666">dims</a>[i-1] = cpl_propertylist_get_int(plist,nax);
-<a name="l00342"></a>00342         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00343"></a>00343         <a class="code" href="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43">fors_cpl_wcs_delete</a>(wcs);
-<a name="l00344"></a>00344         <span class="keywordflow">return</span>(NULL);
-<a name="l00345"></a>00345         }
-<a name="l00346"></a>00346     }
-<a name="l00347"></a>00347     }
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349     <span class="comment">/* Get out of here */</span>
-<a name="l00350"></a>00350     
-<a name="l00351"></a>00351     <span class="keywordflow">return</span>(wcs);
-<a name="l00352"></a>00352 }
-<a name="l00353"></a>00353 
-<a name="l00367"></a><a class="code" href="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43">00367</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43">fors_cpl_wcs_delete</a>(<a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs) {
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369     <span class="comment">/* Free the workspace */</span>
-<a name="l00370"></a>00370 
-<a name="l00371"></a>00371     <span class="keywordflow">if</span> (wcs == NULL)
-<a name="l00372"></a>00372     <span class="keywordflow">return</span>;
-<a name="l00373"></a>00373     <span class="keywordflow">if</span> (wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a> != NULL) {
-<a name="l00374"></a>00374         (void)wcsfree(wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a>);
-<a name="l00375"></a>00375         cpl_free(wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a>);
-<a name="l00376"></a>00376     }
-<a name="l00377"></a>00377     <span class="keywordflow">if</span> (wcs-><a class="code" href="struct__fors__cpl__wcs__.html#947b7dc1ce3651b19825dee6fe385666">dims</a> != NULL) 
-<a name="l00378"></a>00378         cpl_free(wcs-><a class="code" href="struct__fors__cpl__wcs__.html#947b7dc1ce3651b19825dee6fe385666">dims</a>); 
-<a name="l00379"></a>00379     cpl_free(wcs);
-<a name="l00380"></a>00380 }
-<a name="l00381"></a>00381 
-<a name="l00382"></a>00382 <span class="comment">/*</span>
-<a name="l00383"></a>00383 <span class="comment"> * @brief</span>
-<a name="l00384"></a>00384 <span class="comment"> *    Convert between physical and world coordiantes.</span>
-<a name="l00385"></a>00385 <span class="comment"> *</span>
-<a name="l00386"></a>00386 <span class="comment"> * @param wcs       The input fors_cpl_wcs structure</span>
-<a name="l00387"></a>00387 <span class="comment"> * @param from      The input coordinate matrix</span>
-<a name="l00388"></a>00388 <span class="comment"> * @param to        The output coordinate matrix</span>
-<a name="l00389"></a>00389 <span class="comment"> * @param status    The output status array</span>
-<a name="l00390"></a>00390 <span class="comment"> * @param transform The transformation mode</span>
-<a name="l00391"></a>00391 <span class="comment"> *</span>
-<a name="l00392"></a>00392 <span class="comment"> * @return</span>
-<a name="l00393"></a>00393 <span class="comment"> *   An appropriate error code.</span>
-<a name="l00394"></a>00394 <span class="comment"> *</span>
-<a name="l00395"></a>00395 <span class="comment"> * @error</span>
-<a name="l00396"></a>00396 <span class="comment"> *   <table class="ec" align="center"></span>
-<a name="l00397"></a>00397 <span class="comment"> *     <tr></span>
-<a name="l00398"></a>00398 <span class="comment"> *       <td class="ecl">CPL_ERROR_NULL_INPUT</td></span>
-<a name="l00399"></a>00399 <span class="comment"> *       <td class="ecr"></span>
-<a name="l00400"></a>00400 <span class="comment"> *         The parameter <i>wcs</i> is a <tt>NULL</tt> pointer, the parameter</span>
-<a name="l00401"></a>00401 <span class="comment"> *         <i>from</i> is a <tt>NULL</tt> pointer or <i>wcs</i> is missing </span>
-<a name="l00402"></a>00402 <span class="comment"> *         some of its information.</span>
-<a name="l00403"></a>00403 <span class="comment"> *       </td></span>
-<a name="l00404"></a>00404 <span class="comment"> *     </tr></span>
-<a name="l00405"></a>00405 <span class="comment"> *     <tr></span>
-<a name="l00406"></a>00406 <span class="comment"> *       <td class="ecl">CPL_ERROR_UNSPECIFIED</td></span>
-<a name="l00407"></a>00407 <span class="comment"> *       <td class="ecr"></span>
-<a name="l00408"></a>00408 <span class="comment"> *         No rows or columns in the input matrix, or an unspecified error</span>
-<a name="l00409"></a>00409 <span class="comment"> *         has occurred in the WCSLIB routine</span>
-<a name="l00410"></a>00410 <span class="comment"> *       </td></span>
-<a name="l00411"></a>00411 <span class="comment"> *     </tr></span>
-<a name="l00412"></a>00412 <span class="comment"> *     <tr></span>
-<a name="l00413"></a>00413 <span class="comment"> *       <td class="ecl">CPL_ERROR_UNSUPPORTED_MODE</td></span>
-<a name="l00414"></a>00414 <span class="comment"> *       <td class="ecr"></span>
-<a name="l00415"></a>00415 <span class="comment"> *         The input conversion mode is not supported</span>
-<a name="l00416"></a>00416 <span class="comment"> *       </td></span>
-<a name="l00417"></a>00417 <span class="comment"> *     </tr></span>
-<a name="l00418"></a>00418 <span class="comment"> *   </table></span>
-<a name="l00419"></a>00419 <span class="comment"> * @enderror</span>
-<a name="l00420"></a>00420 <span class="comment"> *</span>
-<a name="l00421"></a>00421 <span class="comment"> * This function converts between coordinates. The supported modes are:</span>
-<a name="l00422"></a>00422 <span class="comment"> * -- FORS_CPL_WCS_PHYS2WORLD:  Converts input physical to world coordinates</span>
-<a name="l00423"></a>00423 <span class="comment"> * -- FORS_CPL_WCS_WORLD2PHYS:  Converts input world to physical coordinates</span>
-<a name="l00424"></a>00424 <span class="comment"> * -- FORS_CPL_WCS_WORLD2STD:   Converts input world to standard coordinates</span>
-<a name="l00425"></a>00425 <span class="comment"> * -- FORS_CPL_WCS_PHYS2STD:    Converts input physical to standard coordinates</span>
-<a name="l00426"></a>00426 <span class="comment"> * The output matrix and status arrays will be allocated here, and thus will</span>
-<a name="l00427"></a>00427 <span class="comment"> * need to be freed by the calling routine. The status array is used to flag</span>
-<a name="l00428"></a>00428 <span class="comment"> * input coordinates where there has been some sort of failure in the </span>
-<a name="l00429"></a>00429 <span class="comment"> * transformation. </span>
-<a name="l00430"></a>00430 <span class="comment"> *</span>
-<a name="l00431"></a>00431 <span class="comment"> */</span>
-<a name="l00432"></a>00432 
-<a name="l00433"></a><a class="code" href="group__fors__cpl__wcs.html#g89ddf97c27e31e73417e60d100ab925b">00433</a> cpl_error_code <a class="code" href="group__fors__cpl__wcs.html#g89ddf97c27e31e73417e60d100ab925b">fors_cpl_wcs_convert</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs, <span class="keyword">const</span> cpl_matrix *from,
-<a name="l00434"></a>00434                                     cpl_matrix **to, cpl_array **status,
-<a name="l00435"></a>00435                                     fors_cpl_wcs_trans_mode transform) {
-<a name="l00436"></a>00436     <span class="keywordtype">int</span> nrows,ncols,*sdata,retval,i;
-<a name="l00437"></a>00437     cpl_matrix *x1;
-<a name="l00438"></a>00438     cpl_array *x2,*x3;
-<a name="l00439"></a>00439     cpl_error_code code;
-<a name="l00440"></a>00440     <span class="keywordtype">double</span> *fdata,*tdata,*x1data,*x2data,*x3data;
-<a name="l00441"></a>00441     <span class="keywordtype">char</span> *_id = <span class="stringliteral">"fors_cpl_wcs_convert"</span>;
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443     <span class="comment">/* Initialise output */</span>
-<a name="l00444"></a>00444 
-<a name="l00445"></a>00445     *to = NULL;
-<a name="l00446"></a>00446     *status = NULL;
-<a name="l00447"></a>00447 
-<a name="l00448"></a>00448     <span class="comment">/* Basic checks on the input pointers */</span>
-<a name="l00449"></a>00449 
-<a name="l00450"></a>00450     <span class="keywordflow">if</span> (wcs == NULL || wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a> == NULL || from == NULL) {
-<a name="l00451"></a>00451         cpl_error_set(_id,CPL_ERROR_NULL_INPUT);
-<a name="l00452"></a>00452         <span class="keywordflow">return</span>(CPL_ERROR_NULL_INPUT);
-<a name="l00453"></a>00453     }
-<a name="l00454"></a>00454 
-<a name="l00455"></a>00455     <span class="comment">/* Check the number of rows/columns for the input matrix */</span>
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457     nrows = cpl_matrix_get_nrow(from);
-<a name="l00458"></a>00458     ncols = cpl_matrix_get_ncol(from);
-<a name="l00459"></a>00459     <span class="keywordflow">if</span> (nrows == 0 || ncols == 0) {
-<a name="l00460"></a>00460     cpl_error_set(_id,CPL_ERROR_UNSPECIFIED);
-<a name="l00461"></a>00461     <span class="keywordflow">return</span>(CPL_ERROR_UNSPECIFIED);
-<a name="l00462"></a>00462     }
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     <span class="comment">/* Get the output memory and some memory for wcslib to use */</span>
-<a name="l00465"></a>00465 
-<a name="l00466"></a>00466     *to = cpl_matrix_new(nrows,ncols);
-<a name="l00467"></a>00467     *status = cpl_array_new(nrows,CPL_TYPE_INT);
-<a name="l00468"></a>00468     x1 = cpl_matrix_new(nrows,ncols);
-<a name="l00469"></a>00469     x2 = cpl_array_new(nrows,CPL_TYPE_DOUBLE);
-<a name="l00470"></a>00470     x3 = cpl_array_new(nrows,CPL_TYPE_DOUBLE);
-<a name="l00471"></a>00471 
-<a name="l00472"></a>00472     <span class="comment">/* Now get the pointers for the data arrays */</span>
-<a name="l00473"></a>00473 
-<a name="l00474"></a>00474     fdata = cpl_matrix_get_data(from);
-<a name="l00475"></a>00475     tdata = cpl_matrix_get_data(*to);
-<a name="l00476"></a>00476     sdata = cpl_array_get_data_int(*status);
-<a name="l00477"></a>00477     x1data = cpl_matrix_get_data(x1);
-<a name="l00478"></a>00478     x2data = cpl_array_get_data_double(x2);
-<a name="l00479"></a>00479     x3data = cpl_array_get_data_double(x3);
-<a name="l00480"></a>00480 
-<a name="l00481"></a>00481     <span class="comment">/* Right, now switch for the transform type. First physical</span>
-<a name="l00482"></a>00482 <span class="comment">       to world coordinates */</span>
-<a name="l00483"></a>00483 
-<a name="l00484"></a>00484     <span class="keywordflow">switch</span> (transform) {
-<a name="l00485"></a>00485     <span class="keywordflow">case</span> FORS_CPL_WCS_PHYS2WORLD:
-<a name="l00486"></a>00486         retval = wcsp2s(wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a>,nrows,wcs-><a class="code" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">naxis</a>,fdata,x1data,x2data,
-<a name="l00487"></a>00487             x3data,tdata,sdata);
-<a name="l00488"></a>00488     <span class="keywordflow">break</span>;
-<a name="l00489"></a>00489     <span class="keywordflow">case</span> FORS_CPL_WCS_WORLD2PHYS:
-<a name="l00490"></a>00490         retval = wcss2p(wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a>,nrows,wcs-><a class="code" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">naxis</a>,fdata,x2data,x3data,
-<a name="l00491"></a>00491             x1data,tdata,sdata);
-<a name="l00492"></a>00492     <span class="keywordflow">break</span>;
-<a name="l00493"></a>00493     <span class="keywordflow">case</span> FORS_CPL_WCS_WORLD2STD:
-<a name="l00494"></a>00494         retval = wcss2p(wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a>,nrows,wcs-><a class="code" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">naxis</a>,fdata,x2data,x3data,
-<a name="l00495"></a>00495             tdata,x1data,sdata);
-<a name="l00496"></a>00496     <span class="keywordflow">break</span>;
-<a name="l00497"></a>00497     <span class="keywordflow">case</span> FORS_CPL_WCS_PHYS2STD:
-<a name="l00498"></a>00498         retval = wcsp2s(wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a>,nrows,wcs-><a class="code" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">naxis</a>,fdata,tdata,x2data,
-<a name="l00499"></a>00499             x3data,x1data,sdata);
-<a name="l00500"></a>00500     <span class="keywordflow">break</span>;
-<a name="l00501"></a>00501     <span class="keywordflow">default</span>:
-<a name="l00502"></a>00502     cpl_error_set(_id,CPL_ERROR_UNSUPPORTED_MODE);
-<a name="l00503"></a>00503     cpl_matrix_delete(*to);
-<a name="l00504"></a>00504     *to = NULL;
-<a name="l00505"></a>00505     cpl_array_delete(*status);
-<a name="l00506"></a>00506     *status = NULL;
-<a name="l00507"></a>00507         cpl_matrix_delete(x1);
-<a name="l00508"></a>00508     <span class="keywordflow">return</span>(CPL_ERROR_UNSUPPORTED_MODE);
-<a name="l00509"></a>00509     }
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511     <span class="comment">/* Ditch the intermediate coordinate results */</span>
-<a name="l00512"></a>00512 
-<a name="l00513"></a>00513     cpl_matrix_delete(x1);
-<a name="l00514"></a>00514     cpl_array_delete(x2);
-<a name="l00515"></a>00515     cpl_array_delete(x3);
-<a name="l00516"></a>00516 
-<a name="l00517"></a>00517     <span class="comment">/* Now interpret the return value from wcslib */</span>
-<a name="l00518"></a>00518 
-<a name="l00519"></a>00519     <span class="keywordflow">switch</span> (retval) {   
-<a name="l00520"></a>00520     <span class="keywordflow">case</span> 0:
-<a name="l00521"></a>00521     code = CPL_ERROR_NONE;
-<a name="l00522"></a>00522     <span class="keywordflow">break</span>;
-<a name="l00523"></a>00523     <span class="keywordflow">case</span> 1:
-<a name="l00524"></a>00524     code = CPL_ERROR_NULL_INPUT;
-<a name="l00525"></a>00525     cpl_msg_warning(__func__,<a class="code" href="group__fors__cpl__wcs.html#ga106b9beff20823017688021d7f008c3">wcslib_errmsgs</a>[1]);
-<a name="l00526"></a>00526     cpl_error_set(__func__,code);
-<a name="l00527"></a>00527     <span class="keywordflow">break</span>;
-<a name="l00528"></a>00528     <span class="keywordflow">case</span> 2:
-<a name="l00529"></a>00529     <span class="keywordflow">case</span> 3:
-<a name="l00530"></a>00530     <span class="keywordflow">case</span> 4:
-<a name="l00531"></a>00531     <span class="keywordflow">case</span> 5:
-<a name="l00532"></a>00532     <span class="keywordflow">case</span> 6:
-<a name="l00533"></a>00533     <span class="keywordflow">case</span> 7:
-<a name="l00534"></a>00534     <span class="keywordflow">case</span> 8:
-<a name="l00535"></a>00535     <span class="keywordflow">case</span> 9:
-<a name="l00536"></a>00536     code = CPL_ERROR_UNSPECIFIED;
-<a name="l00537"></a>00537     cpl_error_set(__func__,code);
-<a name="l00538"></a>00538     cpl_msg_warning(__func__,<a class="code" href="group__fors__cpl__wcs.html#ga106b9beff20823017688021d7f008c3">wcslib_errmsgs</a>[retval]);
-<a name="l00539"></a>00539     <span class="keywordflow">break</span>;
-<a name="l00540"></a>00540     <span class="keywordflow">default</span>:
-<a name="l00541"></a>00541     code = CPL_ERROR_UNSPECIFIED;
-<a name="l00542"></a>00542     cpl_error_set(__func__,code);
-<a name="l00543"></a>00543     cpl_msg_warning(__func__,<span class="stringliteral">"WCSLIB found an unspecified error: %d"</span>,
-<a name="l00544"></a>00544               retval);
-<a name="l00545"></a>00545     <span class="keywordflow">break</span>;
-<a name="l00546"></a>00546     }
-<a name="l00547"></a>00547     <span class="keywordflow">return</span>(code);
-<a name="l00548"></a>00548 }
-<a name="l00549"></a>00549 
-<a name="l00550"></a>00550 
-<a name="l00551"></a>00551 
-<a name="l00554"></a>00554 <span class="comment">/*-------------------------------------------------------------------------*/</span>
-<a name="l00555"></a>00555 
-<a name="l00569"></a><a class="code" href="group__fors__cpl__wcs.html#g1ff77ef3ec6654b60865ff114ffb0194">00569</a> <span class="keyword">static</span> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *<a class="code" href="group__fors__cpl__wcs.html#g1ff77ef3ec6654b60865ff114ffb0194">fors_cpl_wcs_init</a>(<span class="keywordtype">void</span>) {
-<a name="l00570"></a>00570     <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs = NULL;
-<a name="l00571"></a>00571 
-<a name="l00572"></a>00572     <span class="comment">/* Get the main structure workspace */</span>
-<a name="l00573"></a>00573 
-<a name="l00574"></a>00574     wcs = cpl_malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a>));
-<a name="l00575"></a>00575     <span class="keywordflow">if</span> (wcs == NULL)
-<a name="l00576"></a>00576     <span class="keywordflow">return</span>(NULL);
-<a name="l00577"></a>00577     
-<a name="l00578"></a>00578     <span class="comment">/* Initialise the output structure */</span>
-<a name="l00579"></a>00579 
-<a name="l00580"></a>00580     wcs-><a class="code" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a> = NULL;
-<a name="l00581"></a>00581     wcs-><a class="code" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">naxis</a> = 0;
-<a name="l00582"></a>00582     wcs-><a class="code" href="struct__fors__cpl__wcs__.html#947b7dc1ce3651b19825dee6fe385666">dims</a> = NULL;
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584     <span class="keywordflow">return</span> wcs;
-<a name="l00585"></a>00585 }
-<a name="l00586"></a>00586 
-<a name="l00613"></a><a class="code" href="group__fors__cpl__wcs.html#ge66dce7f4ef9d442dd849595f39b82bf">00613</a> <span class="keyword">static</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__cpl__wcs.html#ge66dce7f4ef9d442dd849595f39b82bf">fors_cpl_wcs_plist2fitsstr</a>(<span class="keyword">const</span> cpl_propertylist *<span class="keyword">self</span>, <span class="keywordtype">int</span> *nkeys) {
-<a name="l00614"></a>00614 
-<a name="l00615"></a>00615     <span class="keyword">const</span> <span class="keywordtype">char</span> *_id = <span class="stringliteral">"fors_cpl_wcs_plist2fitsstr"</span>;
-<a name="l00616"></a>00616     <span class="keywordtype">char</span> *header,*h,cval[2];
-<a name="l00617"></a>00617     <span class="keywordtype">int</span> n,status;
-<a name="l00618"></a>00618     <span class="keywordtype">long</span> lval,i;
-<a name="l00619"></a>00619     <span class="keywordtype">float</span> fval;
-<a name="l00620"></a>00620     <span class="keywordtype">double</span> dval;
-<a name="l00621"></a>00621     fitsfile *fptr;
-<a name="l00622"></a>00622     cpl_property *p;
-<a name="l00623"></a>00623 
-<a name="l00624"></a>00624     <span class="comment">/* Sanity testing of input propertylist */</span>
-<a name="l00625"></a>00625 
-<a name="l00626"></a>00626     <span class="keywordflow">if</span> (<span class="keyword">self</span> == NULL) {
-<a name="l00627"></a>00627         cpl_error_set(_id,CPL_ERROR_NULL_INPUT);
-<a name="l00628"></a>00628         <span class="keywordflow">return</span>(NULL);
-<a name="l00629"></a>00629     }
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631     <span class="comment">/* Find out how big the propertylist is */</span>
-<a name="l00632"></a>00632 
-<a name="l00633"></a>00633     n = cpl_propertylist_get_size(<span class="keyword">self</span>);
-<a name="l00634"></a>00634 
-<a name="l00635"></a>00635     <span class="comment">/* Open a memory file with CFITSIO */</span>
-<a name="l00636"></a>00636 
-<a name="l00637"></a>00637     status = 0;
-<a name="l00638"></a>00638     (void)fits_create_file(&fptr,<span class="stringliteral">"mem://"</span>,&status);
-<a name="l00639"></a>00639     (void)fits_create_img(fptr,BYTE_IMG,0,NULL,&status);
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641     <span class="comment">/* Add the properties into the FITS file */</span>
-<a name="l00642"></a>00642 
-<a name="l00643"></a>00643     cpl_propertylist_to_fitsfile(fptr,<span class="keyword">self</span>,NULL);
-<a name="l00644"></a>00644 
-<a name="l00645"></a>00645     <span class="comment">/* Parse the header */</span>
-<a name="l00646"></a>00646 
-<a name="l00647"></a>00647 <span class="comment">//    (void)fits_hdr2str(fptr,1,NULL,0,&header,&ival,&status);</span>
-<a name="l00648"></a>00648     (void)<a class="code" href="group__fors__cpl__wcs.html#g9be6ef771ded8b7466af4ed6485d17f6">fors_ffhdr2str</a>(fptr,1,NULL,0,&header,nkeys,&status);
-<a name="l00649"></a>00649     (void)fits_close_file(fptr,&status);
-<a name="l00650"></a>00650 
-<a name="l00651"></a>00651     <span class="comment">/* Get out of here */</span>
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653     <span class="keywordflow">return</span>(header);
-<a name="l00654"></a>00654 
-<a name="l00655"></a>00655 }
-<a name="l00656"></a>00656 
-<a name="l00682"></a><a class="code" href="group__fors__cpl__wcs.html#g8d23e487c941ebc5b4d30a113f9dc324">00682</a> <span class="keyword">static</span> cpl_propertylist *<a class="code" href="group__fors__cpl__wcs.html#g8d23e487c941ebc5b4d30a113f9dc324">fors_cpl_wcs_fitsstr2plist</a>(<span class="keywordtype">char</span> *fitsstr) {
-<a name="l00683"></a>00683     <span class="keywordtype">int</span> i,status;
-<a name="l00684"></a>00684     fitsfile *fptr;
-<a name="l00685"></a>00685     <span class="keywordtype">char</span> *f,*_id=<span class="stringliteral">"fors_cpl_wcs_fitsstr2plist"</span>;
-<a name="l00686"></a>00686     cpl_propertylist *p;
-<a name="l00687"></a>00687 
-<a name="l00688"></a>00688     <span class="comment">/* Check input */</span>
-<a name="l00689"></a>00689 
-<a name="l00690"></a>00690     <span class="keywordflow">if</span> (fitsstr == NULL) {
-<a name="l00691"></a>00691         cpl_error_set(_id,CPL_ERROR_NULL_INPUT);
-<a name="l00692"></a>00692         <span class="keywordflow">return</span>(NULL);
-<a name="l00693"></a>00693     }
-<a name="l00694"></a>00694 
-<a name="l00695"></a>00695     <span class="comment">/* Create a memory file using CFITSIO. We can then add individual cards to </span>
-<a name="l00696"></a>00696 <span class="comment">       the header and allow CFITSIO to decide on data types etc. */</span>
-<a name="l00697"></a>00697 
-<a name="l00698"></a>00698     status = 0;
-<a name="l00699"></a>00699     (void)fits_create_file(&fptr,<span class="stringliteral">"mem://"</span>,&status);
-<a name="l00700"></a>00700     (void)fits_create_img(fptr,BYTE_IMG,0,NULL,&status);
-<a name="l00701"></a>00701 
-<a name="l00702"></a>00702     <span class="comment">/* Loop for all the cards in the FITS string and add them to the </span>
-<a name="l00703"></a>00703 <span class="comment">       memory FITS header */</span>
-<a name="l00704"></a>00704 
-<a name="l00705"></a>00705     f = fitsstr;
-<a name="l00706"></a>00706     <span class="keywordflow">while</span> (strncmp(f,<span class="stringliteral">"END     "</span>,8)) {
-<a name="l00707"></a>00707     (void)fits_insert_card(fptr,f,&status);
-<a name="l00708"></a>00708     f += (FLEN_CARD - 1);
-<a name="l00709"></a>00709     }
-<a name="l00710"></a>00710     (void)fits_insert_card(fptr,f,&status);
-<a name="l00711"></a>00711 
-<a name="l00712"></a>00712     <span class="comment">/* Now create the propertylist */</span>
-<a name="l00713"></a>00713 
-<a name="l00714"></a>00714     p = cpl_propertylist_from_fitsfile(fptr);
-<a name="l00715"></a>00715 
-<a name="l00716"></a>00716     <span class="comment">/* Close the memory file and get out of here */</span>
-<a name="l00717"></a>00717 
-<a name="l00718"></a>00718     (void)fits_close_file(fptr,&status);
-<a name="l00719"></a>00719     <span class="keywordflow">return</span>(p);
-<a name="l00720"></a>00720 }
-<a name="l00721"></a>00721 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__cpl__wcs_8c_source.html b/html/fors__cpl__wcs_8c_source.html
new file mode 100644
index 0000000..bd72d70
--- /dev/null
+++ b/html/fors__cpl__wcs_8c_source.html
@@ -0,0 +1,685 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_cpl_wcs.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_cpl_wcs.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_cpl_wcs.c,v 1.10 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the ESO Common Pipeline Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.10 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="comment">// Ouch! WCSLIB exports its config.h which will clash with ours,</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="comment">// so avoid that</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="comment">//#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="comment">//#include <config.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="comment">//#endif</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="comment">/*----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="comment">                                   Includes</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="comment"> ----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include "fors_cpl_wcs.h"</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include "cpl.h"</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <fitsio.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <fitsio2.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include <wcslib.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="comment">//#include <cpl_propertylist_impl.h></span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="comment">//Declare internal CPL functions:</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> cpl_propertylist *cpl_propertylist_from_fitsfile(fitsfile *file);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="comment">// Note! ugly hack here. In CPL 4.0 the prototype was</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="comment">// cpl_error_code cpl_propertylist_to_fitsfile(fitsfile *file, const cpl_propertylist *self);</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="comment">//</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="comment">// Later versions:</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">// cpl_error_code cpl_propertylist_to_fitsfile(fitsfile *file, const cpl_propertylist *, const char *);</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="comment">// We declare this function always as</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> cpl_error_code cpl_propertylist_to_fitsfile(fitsfile *file, <span class="keyword">const</span> cpl_propertylist *<span class="keyword">self</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *); </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="comment">// which accidentally works also with the CPL4.0 prototype because the </span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="comment">// 3rd superfluous argument is ignored</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="comment">/*---------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="comment">/*---------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="comment">/*----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="comment">                                   Type definition</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="comment"> ----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno"><a class="code" href="struct__fors__cpl__wcs__.html">   89</a></span> <span class="keyword">struct </span><a class="code" href="struct__fors__cpl__wcs__.html">_fors_cpl_wcs_</a> {</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     <span class="keyword">struct </span>wcsprm *wcsptr;   <span class="comment">/* WCSLIB structure */</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     <span class="keywordtype">int</span>           naxis;     <span class="comment">/* Number of dimensions of the image */</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     <span class="keywordtype">int</span>           *dims;     <span class="comment">/* Dimensions of image */</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> };</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="comment">/* Static routine declarations */</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="keyword">static</span> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *<a class="code" href="group__fors__cpl__wcs.html#ga1027310dff52a22788095ccdc54263ac" title="Create an empty wcs structure.">fors_cpl_wcs_init</a>(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="keyword">static</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__cpl__wcs.html#gaa352c368a01171ba9fbfa0b63dd7784e" title="Convert a propertylist to a FITS string.">fors_cpl_wcs_plist2fitsstr</a>(<span class="keyword">const</span> cpl_propertylist *<span class="keyword">self</span>, <span class="keywordtype">int</span> *nkeys);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="keyword">static</span> cpl_propertylist *<a class="code" href="group__fors__cpl__wcs.html#ga85c6df963659c6ab9a28649094ae037a" title="Convert a FITS string to a propertylist.">fors_cpl_wcs_fitsstr2plist</a>(<span class="keywordtype">char</span> *fitsstr);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="comment">/* Useful conversion factors */</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">#define DEGRAD 57.2957795130823229</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="comment">/* WCSLIB error messages */</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">#define WCSLIB_ERRCODE_MAX  9</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">char</span> *wcslib_errmsgs[WCSLIB_ERRCODE_MAX+1] = {</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                   <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>           <span class="stringliteral">"WCSLIB undefined input structure pointer"</span>,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>           <span class="stringliteral">"WCSLIB unable to allocate required memory"</span>,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>           <span class="stringliteral">"WCSLIB linear transformation matrix is singular"</span>,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>           <span class="stringliteral">"WCSLIB invalid coordinate axis types"</span>,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>           <span class="stringliteral">"WCSLIB invalid parameter value"</span>,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>           <span class="stringliteral">"WCSLIB invalid coordinate transformation parameters"</span>,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>           <span class="stringliteral">"WCSLIB Ill-conditioned coordinate transformation parameters"</span>,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>           <span class="stringliteral">"WCSLIB One or more input coordinates invalid"</span>,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>           <span class="stringliteral">"WCSLIB One or more input coordinates invalid"</span>};</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>           </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="comment">/*-------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment">/*-------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="comment">/*--------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="comment">  [jmlarsen] This is a workaround for ffhdr2str() which has a severe memory error in CFITSIO 2.510,</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="comment">  fixed somewhere between versions 2.510 and 3.030</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_ffhdr2str( </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     fitsfile *fptr,  <span class="comment">/* I - FITS file pointer                    */</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="keywordtype">int</span> exclude_comm,   <span class="comment">/* I - if TRUE, exclude commentary keywords */</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <span class="keywordtype">char</span> **exclist,     <span class="comment">/* I - list of excluded keyword names       */</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <span class="keywordtype">int</span> nexc,           <span class="comment">/* I - number of names in exclist           */</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="keywordtype">char</span> **header,      <span class="comment">/* O - returned header string               */</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     <span class="keywordtype">int</span> *nkeys,         <span class="comment">/* O - returned number of 80-char keywords  */</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     <span class="keywordtype">int</span>  *status)       <span class="comment">/* IO - error status                        */</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="comment">  read header keywords into a long string of chars.  This routine allocates</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="comment">  memory for the string, so the calling routine must eventually free the</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="comment">  memory when it is not needed any more.  If exclude_comm is TRUE, then all</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="comment">  the COMMENT, HISTORY, and <blank> keywords will be excluded from the output</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="comment">  string of keywords.  Any other list of keywords to be excluded may be</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="comment">  specified with the exclist parameter.</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> {</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     {</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>         <span class="comment">/* [jmlarsen] Use the actual CFITSIO function if the</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="comment">           version number is recent enough */</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>         <span class="keywordtype">float</span> version;</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>         fits_get_version(&version);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>         </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>         <span class="keywordflow">if</span> (version >= 3.030) </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>             <span class="keywordflow">return</span> ffhdr2str(fptr, exclude_comm, exclist, nexc, header, nkeys, status);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     }</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keywordtype">int</span> casesn, match, exact, totkeys;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="keywordtype">long</span> ii, jj;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="keywordtype">char</span> keybuf[162], keyname[FLEN_KEYWORD], *headptr;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     *nkeys = 0;</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">if</span> (*status > 0)</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         <span class="keywordflow">return</span>(*status);</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <span class="comment">/* get number of keywords in the header (doesn't include END) */</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="keywordflow">if</span> (ffghsp(fptr, &totkeys, NULL, status) > 0)</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <span class="keywordflow">return</span>(*status);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     <span class="comment">/* allocate memory for all the keywords (multiple of 2880 bytes) */</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     *header = (<span class="keywordtype">char</span> *) calloc ( (totkeys + 1) * 80 + 1, 1);</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     <span class="keywordflow">if</span> (!(*header))</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     {</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>          *status = MEMORY_ALLOCATION;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>          ffpmsg(<span class="stringliteral">"failed to allocate memory to hold all the header keywords"</span>);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>          <span class="keywordflow">return</span>(*status);</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     }</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     headptr = *header;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     casesn = FALSE;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     <span class="comment">/* read every keyword */</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="keywordflow">for</span> (ii = 1; ii <= totkeys; ii++)</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         ffgrec(fptr, ii, keybuf, status);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>         <span class="comment">/* pad record with blanks so that it is at least 80 chars long */</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         strcat(keybuf,</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="stringliteral">"                                                                                "</span>);</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>         keyname[0] = <span class="charliteral">'\0'</span>;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>         strncat(keyname, keybuf, 8); <span class="comment">/* copy the keyword name */</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>         <span class="keywordflow">if</span> (exclude_comm)</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>         {</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>             <span class="keywordflow">if</span> (!FSTRCMP(<span class="stringliteral">"COMMENT "</span>, keyname) ||</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                 !FSTRCMP(<span class="stringliteral">"HISTORY "</span>, keyname) ||</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                 !FSTRCMP(<span class="stringliteral">"        "</span>, keyname) )</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>               <span class="keywordflow">continue</span>;  <span class="comment">/* skip this commentary keyword */</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>         }</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>         <span class="comment">/* does keyword match any names in the exclusion list? */</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>         <span class="keywordflow">for</span> (jj = 0; jj < nexc; jj++ )</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>         {</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>             ffcmps(exclist[jj], keyname, casesn, &match, &exact);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                  <span class="keywordflow">if</span> (match)</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                      <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         }</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> </div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>         <span class="keywordflow">if</span> (jj == nexc)</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>         {</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>             <span class="comment">/* not in exclusion list, add this keyword to the string */</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>             strcpy(headptr, keybuf);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>             headptr += 80;</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>             (*nkeys)++;</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         }</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     <span class="comment">/* add the END keyword */</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     strcpy(headptr,</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="stringliteral">"END                                                                             "</span>);</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     headptr += 80;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     (*nkeys)++;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     *headptr = <span class="charliteral">'\0'</span>;   <span class="comment">/* terminate the header string */</span></div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     *header = realloc(*header, (*nkeys *80) + 1); <span class="comment">/* minimize the allocated memory */</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> </div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     <span class="keywordflow">return</span>(*status);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> }</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> </div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> </div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> </div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="comment"> * @brief</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> <span class="comment"> *    Create a wcs structure by parsing a propertylist.</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="comment"> * @param plist    The input propertylist</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="comment"> * @return</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="comment"> *   The newly created and filled fors_cpl_wcs object or NULL if it could not be</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="comment"> *   created. In the latter case an appropriate error code is set.</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="comment"> * @error</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> <span class="comment"> *   <table class="ec" align="center"></span></div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> <span class="comment"> *     <tr></span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> <span class="comment"> *       <td class="ecl">CPL_ERROR_NULL_INPUT</td></span></div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> <span class="comment"> *       <td class="ecr"></span></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> <span class="comment"> *         The parameter <i>plist</i> is a <tt>NULL</tt> pointer.</span></div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> <span class="comment"> *       </td></span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> <span class="comment"> *     </tr></span></div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> <span class="comment"> *     <tr></span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> <span class="comment"> *       <td class="ecl">CPL_ERROR_TYPE_MISMATCH</td></span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> <span class="comment"> *       <td class="ecr"></span></div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="comment"> *         NAXIS information in image propertylist is not an integer</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> <span class="comment"> *       </td></span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> <span class="comment"> *     </tr></span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> <span class="comment"> *     <tr></span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> <span class="comment"> *       <td class="ecl">CPL_ERROR_DATA_NOT_FOUND</td></span></div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> <span class="comment"> *       <td class="ecr"></span></div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> <span class="comment"> *         Error in getting NAXIS information for image propertylists</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="comment"> *       </td></span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> <span class="comment"> *     </tr></span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> <span class="comment"> *   </table></span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> <span class="comment"> * @enderror</span></div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> <span class="comment"> * The function allocates memory for a WCS structure. A pointer to the WCSLIB</span></div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> <span class="comment"> * header information is created by parsing the FITS WCS keywords from the </span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> <span class="comment"> * header of a file. A few ancillary items are also filled in.</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> <span class="comment"> * The returned property must be destroyed using the wcs destructor</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> <span class="comment"> * @b fors_cpl_wcs_delete().</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> <span class="comment"> * @see fors_cpl_wcs_delete()</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *fors_cpl_wcs_new_from_propertylist(<span class="keyword">const</span> cpl_propertylist *plist) {</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *_id = <span class="stringliteral">"fors_cpl_wcs_new"</span>;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="keywordtype">char</span> *shdr,nax[9];</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     <span class="keywordtype">int</span> retval,nrej,nwcs,np,i;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keyword">struct </span>wcsprm *wwcs = NULL;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="comment">/* Check to see if the propertylist exists */</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="keywordflow">if</span> (plist == NULL) {</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     cpl_error_set(_id,CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keywordflow">return</span>(NULL);</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     }</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     <span class="comment">/* Get the size of the propertylist. </span></div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> <span class="comment">       jmlarsen: No, it will overrun a buffer </span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> <span class="comment">       np = cpl_propertylist_get_size(plist);</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     </div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="comment">/* Get a fors_cpl_wcs structure and initialise it */</span></div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     <span class="keywordflow">if</span> ((wcs = <a class="code" href="group__fors__cpl__wcs.html#ga1027310dff52a22788095ccdc54263ac" title="Create an empty wcs structure.">fors_cpl_wcs_init</a>()) == NULL)</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     <span class="keywordflow">return</span>(NULL);</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="comment">/* Convert the propertylist into a string */</span></div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     shdr = <a class="code" href="group__fors__cpl__wcs.html#gaa352c368a01171ba9fbfa0b63dd7784e" title="Convert a propertylist to a FITS string.">fors_cpl_wcs_plist2fitsstr</a>(plist, &np);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     <span class="keywordflow">if</span> (! shdr) {</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     cpl_error_set_where(_id);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     <a class="code" href="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83" title="Destroy a WCS structure.">fors_cpl_wcs_delete</a>(wcs);</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordflow">return</span>(NULL);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     }</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     <span class="comment">/* Parse the header to get the wcslib structure */</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     retval = wcspih(shdr,np,0,0,&nrej,&nwcs,&wwcs);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordflow">if</span> (retval != 0) {</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>         cpl_msg_warning(_id,<span class="stringliteral">"Cannot parse WCS header"</span>);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         free(shdr);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>         wcsvfree(&nwcs,&wwcs);</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <a class="code" href="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83" title="Destroy a WCS structure.">fors_cpl_wcs_delete</a>(wcs);</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         <span class="keywordflow">return</span>(NULL);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     }</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     free(shdr);</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     <span class="comment">/* Now extract the one you want and ditch the rest */</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     wcs->wcsptr = (<span class="keyword">struct </span>wcsprm *)cpl_calloc(1,<span class="keyword">sizeof</span>(<span class="keyword">struct</span> wcsprm));</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     (wcs->wcsptr)->flag = -1;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     wcscopy(1,wwcs,wcs->wcsptr);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     wcsset(wcs->wcsptr);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     wcsvfree(&nwcs,&wwcs);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="comment">/* Fill the rest of the stuff */</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(plist,<span class="stringliteral">"NAXIS"</span>)) {</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     wcs->naxis = cpl_propertylist_get_int(plist,<span class="stringliteral">"NAXIS"</span>);</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>         <a class="code" href="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83" title="Destroy a WCS structure.">fors_cpl_wcs_delete</a>(wcs);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>         <span class="keywordflow">return</span>(NULL);</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     }</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     wcs->dims = cpl_calloc(wcs->naxis,<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordflow">for</span> (i = 1; i <= wcs->naxis; i++) {</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>         (void)snprintf(nax,9,<span class="stringliteral">"NAXIS%d"</span>,i);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>         wcs->dims[i-1] = cpl_propertylist_get_int(plist,nax);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>         <a class="code" href="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83" title="Destroy a WCS structure.">fors_cpl_wcs_delete</a>(wcs);</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         <span class="keywordflow">return</span>(NULL);</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>         }</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     }</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     }</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <span class="comment">/* Get out of here */</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     </div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     <span class="keywordflow">return</span>(wcs);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> }</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> </div>
+<div class="line"><a name="l00367"></a><span class="lineno"><a class="code" href="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83">  367</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83" title="Destroy a WCS structure.">fors_cpl_wcs_delete</a>(<a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs) {</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <span class="comment">/* Free the workspace */</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keywordflow">if</span> (wcs == NULL)</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keywordflow">if</span> (wcs->wcsptr != NULL) {</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>         (void)wcsfree(wcs->wcsptr);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>         cpl_free(wcs->wcsptr);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     }</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordflow">if</span> (wcs->dims != NULL) </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>         cpl_free(wcs->dims); </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     cpl_free(wcs);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> }</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> </div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> <span class="comment"> * @brief</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> <span class="comment"> *    Convert between physical and world coordiantes.</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> <span class="comment"> * @param wcs       The input fors_cpl_wcs structure</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment"> * @param from      The input coordinate matrix</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="comment"> * @param to        The output coordinate matrix</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="comment"> * @param status    The output status array</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="comment"> * @param transform The transformation mode</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="comment"> * @return</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> <span class="comment"> *   An appropriate error code.</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment"> * @error</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="comment"> *   <table class="ec" align="center"></span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> <span class="comment"> *     <tr></span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> <span class="comment"> *       <td class="ecl">CPL_ERROR_NULL_INPUT</td></span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="comment"> *       <td class="ecr"></span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="comment"> *         The parameter <i>wcs</i> is a <tt>NULL</tt> pointer, the parameter</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="comment"> *         <i>from</i> is a <tt>NULL</tt> pointer or <i>wcs</i> is missing </span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> <span class="comment"> *         some of its information.</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> <span class="comment"> *       </td></span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="comment"> *     </tr></span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> <span class="comment"> *     <tr></span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> <span class="comment"> *       <td class="ecl">CPL_ERROR_UNSPECIFIED</td></span></div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span> <span class="comment"> *       <td class="ecr"></span></div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span> <span class="comment"> *         No rows or columns in the input matrix, or an unspecified error</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> <span class="comment"> *         has occurred in the WCSLIB routine</span></div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> <span class="comment"> *       </td></span></div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> <span class="comment"> *     </tr></span></div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> <span class="comment"> *     <tr></span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> <span class="comment"> *       <td class="ecl">CPL_ERROR_UNSUPPORTED_MODE</td></span></div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> <span class="comment"> *       <td class="ecr"></span></div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> <span class="comment"> *         The input conversion mode is not supported</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> <span class="comment"> *       </td></span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> <span class="comment"> *     </tr></span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> <span class="comment"> *   </table></span></div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> <span class="comment"> * @enderror</span></div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> <span class="comment"> * This function converts between coordinates. The supported modes are:</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> <span class="comment"> * -- FORS_CPL_WCS_PHYS2WORLD:  Converts input physical to world coordinates</span></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> <span class="comment"> * -- FORS_CPL_WCS_WORLD2PHYS:  Converts input world to physical coordinates</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span> <span class="comment"> * -- FORS_CPL_WCS_WORLD2STD:   Converts input world to standard coordinates</span></div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span> <span class="comment"> * -- FORS_CPL_WCS_PHYS2STD:    Converts input physical to standard coordinates</span></div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> <span class="comment"> * The output matrix and status arrays will be allocated here, and thus will</span></div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> <span class="comment"> * need to be freed by the calling routine. The status array is used to flag</span></div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> <span class="comment"> * input coordinates where there has been some sort of failure in the </span></div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> <span class="comment"> * transformation. </span></div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> cpl_error_code fors_cpl_wcs_convert(<span class="keyword">const</span> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs, <span class="keyword">const</span> cpl_matrix *from,</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>                                     cpl_matrix **to, cpl_array **status,</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                                     fors_cpl_wcs_trans_mode transform) {</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordtype">int</span> nrows,ncols,*sdata,retval,i;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     cpl_matrix *x1;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     cpl_array *x2,*x3;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     cpl_error_code code;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     <span class="keywordtype">double</span> *fdata,*tdata,*x1data,*x2data,*x3data;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordtype">char</span> *_id = <span class="stringliteral">"fors_cpl_wcs_convert"</span>;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     <span class="comment">/* Initialise output */</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> </div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     *to = NULL;</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     *status = NULL;</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     <span class="comment">/* Basic checks on the input pointers */</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> </div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     <span class="keywordflow">if</span> (wcs == NULL || wcs->wcsptr == NULL || from == NULL) {</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         cpl_error_set(_id,CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>         <span class="keywordflow">return</span>(CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     }</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="comment">/* Check the number of rows/columns for the input matrix */</span></div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     nrows = cpl_matrix_get_nrow(from);</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     ncols = cpl_matrix_get_ncol(from);</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     <span class="keywordflow">if</span> (nrows == 0 || ncols == 0) {</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     cpl_error_set(_id,CPL_ERROR_UNSPECIFIED);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     <span class="keywordflow">return</span>(CPL_ERROR_UNSPECIFIED);</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     }</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="comment">/* Get the output memory and some memory for wcslib to use */</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> </div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     *to = cpl_matrix_new(nrows,ncols);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     *status = cpl_array_new(nrows,CPL_TYPE_INT);</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     x1 = cpl_matrix_new(nrows,ncols);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     x2 = cpl_array_new(nrows,CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     x3 = cpl_array_new(nrows,CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     <span class="comment">/* Now get the pointers for the data arrays */</span></div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> </div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     fdata = cpl_matrix_get_data(from);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     tdata = cpl_matrix_get_data(*to);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     sdata = cpl_array_get_data_int(*status);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     x1data = cpl_matrix_get_data(x1);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     x2data = cpl_array_get_data_double(x2);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     x3data = cpl_array_get_data_double(x3);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> </div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     <span class="comment">/* Right, now switch for the transform type. First physical</span></div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> <span class="comment">       to world coordinates */</span></div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> </div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     <span class="keywordflow">switch</span> (transform) {</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     <span class="keywordflow">case</span> FORS_CPL_WCS_PHYS2WORLD:</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         retval = wcsp2s(wcs->wcsptr,nrows,wcs->naxis,fdata,x1data,x2data,</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>             x3data,tdata,sdata);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     <span class="keywordflow">case</span> FORS_CPL_WCS_WORLD2PHYS:</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>         retval = wcss2p(wcs->wcsptr,nrows,wcs->naxis,fdata,x2data,x3data,</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>             x1data,tdata,sdata);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     <span class="keywordflow">case</span> FORS_CPL_WCS_WORLD2STD:</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         retval = wcss2p(wcs->wcsptr,nrows,wcs->naxis,fdata,x2data,x3data,</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>             tdata,x1data,sdata);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     <span class="keywordflow">case</span> FORS_CPL_WCS_PHYS2STD:</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         retval = wcsp2s(wcs->wcsptr,nrows,wcs->naxis,fdata,tdata,x2data,</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>             x3data,x1data,sdata);</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     cpl_error_set(_id,CPL_ERROR_UNSUPPORTED_MODE);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     cpl_matrix_delete(*to);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     *to = NULL;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>     cpl_array_delete(*status);</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     *status = NULL;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>         cpl_matrix_delete(x1);</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     <span class="keywordflow">return</span>(CPL_ERROR_UNSUPPORTED_MODE);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     }</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span> </div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>     <span class="comment">/* Ditch the intermediate coordinate results */</span></div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span> </div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     cpl_matrix_delete(x1);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     cpl_array_delete(x2);</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     cpl_array_delete(x3);</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> </div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     <span class="comment">/* Now interpret the return value from wcslib */</span></div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> </div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     <span class="keywordflow">switch</span> (retval) {   </div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     <span class="keywordflow">case</span> 0:</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>     code = CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>     <span class="keywordflow">case</span> 1:</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     code = CPL_ERROR_NULL_INPUT;</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>     cpl_msg_warning(__func__,wcslib_errmsgs[1]);</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     cpl_error_set(__func__,code);</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     <span class="keywordflow">case</span> 2:</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     <span class="keywordflow">case</span> 3:</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>     <span class="keywordflow">case</span> 4:</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     <span class="keywordflow">case</span> 5:</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     <span class="keywordflow">case</span> 6:</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     <span class="keywordflow">case</span> 7:</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="keywordflow">case</span> 8:</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="keywordflow">case</span> 9:</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     code = CPL_ERROR_UNSPECIFIED;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     cpl_error_set(__func__,code);</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     cpl_msg_warning(__func__,wcslib_errmsgs[retval]);</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     code = CPL_ERROR_UNSPECIFIED;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>     cpl_error_set(__func__,code);</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     cpl_msg_warning(__func__,<span class="stringliteral">"WCSLIB found an unspecified error: %d"</span>,</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>               retval);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     }</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     <span class="keywordflow">return</span>(code);</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span> }</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span> </div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span> </div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> <span class="comment">/*-------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span> </div>
+<div class="line"><a name="l00569"></a><span class="lineno"><a class="code" href="group__fors__cpl__wcs.html#ga1027310dff52a22788095ccdc54263ac">  569</a></span> <span class="keyword">static</span> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *<a class="code" href="group__fors__cpl__wcs.html#ga1027310dff52a22788095ccdc54263ac" title="Create an empty wcs structure.">fors_cpl_wcs_init</a>(<span class="keywordtype">void</span>) {</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs = NULL;</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> </div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     <span class="comment">/* Get the main structure workspace */</span></div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span> </div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     wcs = cpl_malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a>));</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     <span class="keywordflow">if</span> (wcs == NULL)</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     <span class="keywordflow">return</span>(NULL);</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     <span class="comment">/* Initialise the output structure */</span></div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     wcs->wcsptr = NULL;</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     wcs->naxis = 0;</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>     wcs->dims = NULL;</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     <span class="keywordflow">return</span> wcs;</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span> }</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span> </div>
+<div class="line"><a name="l00613"></a><span class="lineno"><a class="code" href="group__fors__cpl__wcs.html#gaa352c368a01171ba9fbfa0b63dd7784e">  613</a></span> <span class="keyword">static</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__cpl__wcs.html#gaa352c368a01171ba9fbfa0b63dd7784e" title="Convert a propertylist to a FITS string.">fors_cpl_wcs_plist2fitsstr</a>(<span class="keyword">const</span> cpl_propertylist *<span class="keyword">self</span [...]
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> </div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *_id = <span class="stringliteral">"fors_cpl_wcs_plist2fitsstr"</span>;</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     <span class="keywordtype">char</span> *header,*h,cval[2];</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     <span class="keywordtype">int</span> n,status;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     <span class="keywordtype">long</span> lval,i;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     <span class="keywordtype">float</span> fval;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     <span class="keywordtype">double</span> dval;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     fitsfile *fptr;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     cpl_property *p;</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span> </div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     <span class="comment">/* Sanity testing of input propertylist */</span></div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span> </div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     <span class="keywordflow">if</span> (<span class="keyword">self</span> == NULL) {</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>         cpl_error_set(_id,CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         <span class="keywordflow">return</span>(NULL);</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     }</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> </div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     <span class="comment">/* Find out how big the propertylist is */</span></div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> </div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     n = cpl_propertylist_get_size(<span class="keyword">self</span>);</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span> </div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     <span class="comment">/* Open a memory file with CFITSIO */</span></div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span> </div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     status = 0;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     (void)fits_create_file(&fptr,<span class="stringliteral">"mem://"</span>,&status);</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>     (void)fits_create_img(fptr,BYTE_IMG,0,NULL,&status);</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="comment">/* Add the properties into the FITS file */</span></div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> </div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     cpl_propertylist_to_fitsfile(fptr,<span class="keyword">self</span>,NULL);</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> </div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     <span class="comment">/* Parse the header */</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> </div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> <span class="comment">//    (void)fits_hdr2str(fptr,1,NULL,0,&header,&ival,&status);</span></div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     (void)fors_ffhdr2str(fptr,1,NULL,0,&header,nkeys,&status);</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     (void)fits_close_file(fptr,&status);</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span> </div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>     <span class="comment">/* Get out of here */</span></div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> </div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     <span class="keywordflow">return</span>(header);</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span> </div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span> }</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> </div>
+<div class="line"><a name="l00682"></a><span class="lineno"><a class="code" href="group__fors__cpl__wcs.html#ga85c6df963659c6ab9a28649094ae037a">  682</a></span> <span class="keyword">static</span> cpl_propertylist *<a class="code" href="group__fors__cpl__wcs.html#ga85c6df963659c6ab9a28649094ae037a" title="Convert a FITS string to a propertylist.">fors_cpl_wcs_fitsstr2plist</a>(<span class="keywordtype">char</span> *fitsstr) {</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>     <span class="keywordtype">int</span> i,status;</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     fitsfile *fptr;</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     <span class="keywordtype">char</span> *f,*_id=<span class="stringliteral">"fors_cpl_wcs_fitsstr2plist"</span>;</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     cpl_propertylist *p;</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span> </div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     <span class="comment">/* Check input */</span></div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> </div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     <span class="keywordflow">if</span> (fitsstr == NULL) {</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>         cpl_error_set(_id,CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>         <span class="keywordflow">return</span>(NULL);</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>     }</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span> </div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     <span class="comment">/* Create a memory file using CFITSIO. We can then add individual cards to </span></div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> <span class="comment">       the header and allow CFITSIO to decide on data types etc. */</span></div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> </div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     status = 0;</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>     (void)fits_create_file(&fptr,<span class="stringliteral">"mem://"</span>,&status);</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     (void)fits_create_img(fptr,BYTE_IMG,0,NULL,&status);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> </div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     <span class="comment">/* Loop for all the cards in the FITS string and add them to the </span></div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> <span class="comment">       memory FITS header */</span></div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> </div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     f = fitsstr;</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>     <span class="keywordflow">while</span> (strncmp(f,<span class="stringliteral">"END     "</span>,8)) {</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     (void)fits_insert_card(fptr,f,&status);</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     f += (FLEN_CARD - 1);</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     }</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     (void)fits_insert_card(fptr,f,&status);</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> </div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     <span class="comment">/* Now create the propertylist */</span></div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> </div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     p = cpl_propertylist_from_fitsfile(fptr);</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> </div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     <span class="comment">/* Close the memory file and get out of here */</span></div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span> </div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     (void)fits_close_file(fptr,&status);</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     <span class="keywordflow">return</span>(p);</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span> }</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__cpl__wcs_8h-source.html b/html/fors__cpl__wcs_8h-source.html
deleted file mode 100644
index 497ad04..0000000
--- a/html/fors__cpl__wcs_8h-source.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_cpl_wcs.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_cpl_wcs.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_cpl_wcs.h,v 1.5 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the ESO Common Pipeline Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.5 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 
-<a name="l00029"></a>00029 <span class="preprocessor">#ifndef FORS_CPL_WCS_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define FORS_CPL_WCS_H</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include "cpl_error.h"</span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include "cpl_propertylist.h"</span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include "cpl_matrix.h"</span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include "cpl_array.h"</span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="comment">/* Definition of WCS structure */</span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__cpl__wcs__.html">_fors_cpl_wcs_</a> fors_cpl_wcs;
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="comment">/* Enumerate the modes available for the convert routine */</span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="keyword">enum</span> fors_cpl_wcs_trans_mode {
-<a name="l00044"></a>00044     FORS_CPL_WCS_PHYS2WORLD,
-<a name="l00045"></a>00045     FORS_CPL_WCS_WORLD2PHYS,
-<a name="l00046"></a>00046     FORS_CPL_WCS_PHYS2STD,
-<a name="l00047"></a>00047     FORS_CPL_WCS_WORLD2STD};
-<a name="l00048"></a>00048 
-<a name="l00049"></a>00049 <span class="keyword">typedef</span> <span class="keyword">enum</span> fors_cpl_wcs_trans_mode fors_cpl_wcs_trans_mode;
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 <span class="comment">/* Function prototypes */</span>
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 fors_cpl_wcs *<a class="code" href="group__fors__cpl__wcs.html#g4636540ea73da854494e3b19f72cdd2a">fors_cpl_wcs_new_from_propertylist</a>(<span class="keyword">const</span> cpl_propertylist *plist);
-<a name="l00054"></a>00054 <span class="keywordtype">void</span> <a class="code" href="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43">fors_cpl_wcs_delete</a>(fors_cpl_wcs *wcs);
-<a name="l00055"></a>00055 cpl_error_code <a class="code" href="group__fors__cpl__wcs.html#g89ddf97c27e31e73417e60d100ab925b">fors_cpl_wcs_convert</a>(<span class="keyword">const</span> fors_cpl_wcs *wcs, <span class="keyword">const</span> cpl_matrix *from,
-<a name="l00056"></a>00056                    cpl_matrix **to, cpl_array **status,
-<a name="l00057"></a>00057                    fors_cpl_wcs_trans_mode transform);
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="preprocessor">#endif </span><span class="comment">/* FORS_CPL_WCS_H */</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__cpl__wcs_8h_source.html b/html/fors__cpl__wcs_8h_source.html
new file mode 100644
index 0000000..a53b96d
--- /dev/null
+++ b/html/fors__cpl__wcs_8h_source.html
@@ -0,0 +1,120 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_cpl_wcs.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_cpl_wcs.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_cpl_wcs.h,v 1.5 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the ESO Common Pipeline Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.5 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> </div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor">#ifndef FORS_CPL_WCS_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_CPL_WCS_H</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include "cpl_error.h"</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include "cpl_propertylist.h"</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include "cpl_matrix.h"</span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include "cpl_array.h"</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="comment">/* Definition of WCS structure */</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__cpl__wcs__.html">_fors_cpl_wcs_</a> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a>;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="comment">/* Enumerate the modes available for the convert routine */</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">enum</span> fors_cpl_wcs_trans_mode {</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>     FORS_CPL_WCS_PHYS2WORLD,</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>     FORS_CPL_WCS_WORLD2PHYS,</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>     FORS_CPL_WCS_PHYS2STD,</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     FORS_CPL_WCS_WORLD2STD};</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keyword">typedef</span> <span class="keyword">enum</span> fors_cpl_wcs_trans_mode fors_cpl_wcs_trans_mode;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="comment">/* Function prototypes */</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *fors_cpl_wcs_new_from_propertylist(<span class="keyword">const</span> cpl_propertylist *plist);</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83" title="Destroy a WCS structure.">fors_cpl_wcs_delete</a>(<a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs);</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> cpl_error_code fors_cpl_wcs_convert(<span class="keyword">const</span> <a class="code" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs, <span class="keyword">const</span> cpl_matrix *from,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>                    cpl_matrix **to, cpl_array **status,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>                    fors_cpl_wcs_trans_mode transform);</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">#endif </span><span class="comment">/* FORS_CPL_WCS_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__dark-test_8c-source.html b/html/fors__dark-test_8c-source.html
deleted file mode 100644
index e519153..0000000
--- a/html/fors__dark-test_8c-source.html
+++ /dev/null
@@ -1,166 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_dark-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_dark-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_dark-test.c,v 1.3 2007/10/31 17:07:32 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/10/31 17:07:32 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.3 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_dark_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <test.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00047"></a>00047 <span class="preprocessor">#undef cleanup</span>
-<a name="l00048"></a><a class="code" href="group__fors__dark__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00048</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">do { \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">    cpl_frameset_delete(frames); \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">    fors_image_delete(&raw_dark); \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">    fors_image_delete(&master_dark); \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">    fors_image_delete(&master_bias); \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">} while(0)</span>
-<a name="l00057"></a>00057 <span class="preprocessor"></span>
-<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00062"></a><a class="code" href="group__fors__dark__test.html#g373bdc8eb6b8f1c0a07dfd8bad5a8933">00062</a> <a class="code" href="group__fors__dark__test.html#g373bdc8eb6b8f1c0a07dfd8bad5a8933">test_dark</a>(<span class="keywordtype">void</span>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     <span class="comment">/* Input */</span>
-<a name="l00065"></a>00065     cpl_frameset *frames          = cpl_frameset_new();
-<a name="l00066"></a>00066     cpl_parameterlist *parameters = cpl_parameterlist_new();
-<a name="l00067"></a>00067 
-<a name="l00068"></a>00068     <span class="comment">/* Output */</span>
-<a name="l00069"></a>00069     <a class="code" href="struct__fors__image.html">fors_image</a> *master_dark  = NULL;
-<a name="l00070"></a>00070     <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias  = NULL;
-<a name="l00071"></a>00071     <a class="code" href="struct__fors__image.html">fors_image</a> *raw_dark  = NULL;
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075     <span class="comment">/* Simulate data */</span>
-<a name="l00076"></a>00076     <span class="keyword">const</span> <span class="keywordtype">char</span> *dark_filename[] = {<span class="stringliteral">"dark_1.fits"</span>,
-<a name="l00077"></a>00077                                    <span class="stringliteral">"dark_2.fits"</span>,
-<a name="l00078"></a>00078                                    <span class="stringliteral">"dark_3.fits"</span>};
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080     {
-<a name="l00081"></a>00081         <span class="keywordtype">unsigned</span> i;
-<a name="l00082"></a>00082         
-<a name="l00083"></a>00083         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(dark_filename)/<span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *); i++) {
-<a name="l00084"></a>00084             cpl_frameset_insert(frames, 
-<a name="l00085"></a>00085                                 <a class="code" href="group__test__simulate.html#gb54d8ef52e4f8e0407e522565b8919f6">create_dark</a>(dark_filename[i],
-<a name="l00086"></a>00086                                             DARK, CPL_FRAME_GROUP_RAW));
-<a name="l00087"></a>00087         }
-<a name="l00088"></a>00088     }
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_get_first(frames));
-<a name="l00091"></a>00091 
-<a name="l00092"></a>00092     cpl_frameset_insert(frames, 
-<a name="l00093"></a>00093                         <a class="code" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">create_bias</a>(<span class="stringliteral">"dark_master_bias.fits"</span>, 
-<a name="l00094"></a>00094                                     MASTER_BIAS, CPL_FRAME_GROUP_CALIB));
-<a name="l00095"></a>00095     
-<a name="l00096"></a>00096     <a class="code" href="group__fors__dark.html#g41900339775a0440158f71fab8e4fe73">fors_dark_define_parameters</a>(parameters);
-<a name="l00097"></a>00097     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00098"></a>00098             <span class="stringliteral">"Create parameters failed"</span>);
-<a name="l00099"></a>00099     
-<a name="l00100"></a>00100     <a class="code" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">fors_parameterlist_set_defaults</a>(parameters);
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102     <span class="comment">/* Call recipe */</span>
-<a name="l00103"></a>00103     <a class="code" href="group__fors__dark.html#g605a72777b8ade477948b511ec213dba">fors_dark</a>(frames, parameters);
-<a name="l00104"></a>00104     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00105"></a>00105             <span class="stringliteral">"Execution error"</span>);
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107     <span class="comment">/* Test results */</span>
-<a name="l00108"></a>00108     {
-<a name="l00109"></a>00109         <span class="comment">/* New and previous frames */</span>
-<a name="l00110"></a>00110         test( cpl_frameset_find(frames, MASTER_DARK) != NULL );
-<a name="l00111"></a>00111         test( cpl_frameset_find(frames, MASTER_BIAS) != NULL );
-<a name="l00112"></a>00112         test( cpl_frameset_find(frames, DARK) != NULL );
-<a name="l00113"></a>00113         
-<a name="l00114"></a>00114         master_dark = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00115"></a>00115             cpl_frameset_find(frames, MASTER_DARK), NULL, setting, NULL);
-<a name="l00116"></a>00116         
-<a name="l00117"></a>00117         master_bias = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00118"></a>00118             cpl_frameset_find(frames, MASTER_BIAS), NULL, setting, NULL);
-<a name="l00119"></a>00119         
-<a name="l00120"></a>00120         raw_dark    = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00121"></a>00121             cpl_frameset_find(frames, DARK), NULL, setting, NULL);
-<a name="l00122"></a>00122         
-<a name="l00123"></a>00123         <span class="comment">/* Verify relation</span>
-<a name="l00124"></a>00124 <span class="comment">           master_dark = raw_dark - master_bias */</span>
-<a name="l00125"></a>00125         test_rel( <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(master_dark, NULL),
-<a name="l00126"></a>00126                   <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(raw_dark, NULL) -
-<a name="l00127"></a>00127                   <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(master_bias, NULL),
-<a name="l00128"></a>00128                   0.01);
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130         <span class="comment">/* Verify that relative error decreased  */</span>
-<a name="l00131"></a>00131         {
-<a name="l00132"></a>00132             test( <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(master_dark, NULL) /
-<a name="l00133"></a>00133                   (<a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(master_dark, NULL) +
-<a name="l00134"></a>00134                    <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(master_bias, NULL))
-<a name="l00135"></a>00135                   <
-<a name="l00136"></a>00136                   <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(raw_dark, NULL) /
-<a name="l00137"></a>00137                   <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(raw_dark, NULL));
-<a name="l00138"></a>00138         }
-<a name="l00139"></a>00139     }
-<a name="l00140"></a>00140 
-<a name="l00141"></a>00141     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00142"></a>00142     <span class="keywordflow">return</span>;
-<a name="l00143"></a>00143 }
-<a name="l00144"></a>00144 
-<a name="l00148"></a><a class="code" href="group__fors__dark__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00148</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00149"></a>00149 {
-<a name="l00150"></a>00150     TEST_INIT;
-<a name="l00151"></a>00151     
-<a name="l00152"></a>00152     <a class="code" href="group__fors__dark__test.html#g373bdc8eb6b8f1c0a07dfd8bad5a8933">test_dark</a>();
-<a name="l00153"></a>00153 
-<a name="l00154"></a>00154     TEST_END;
-<a name="l00155"></a>00155 }
-<a name="l00156"></a>00156 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__dark-test_8c_source.html b/html/fors__dark-test_8c_source.html
new file mode 100644
index 0000000..95f29f1
--- /dev/null
+++ b/html/fors__dark-test_8c_source.html
@@ -0,0 +1,205 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_dark-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_dark-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_dark-test.c,v 1.6 2013-09-11 13:47:53 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-11 13:47:53 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.6 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_dark_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">    cpl_frameset_delete(frames); \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">    fors_image_delete(&raw_dark); \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">    fors_image_delete(&master_dark); \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">    fors_image_delete(&master_bias); \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__dark__test.html#ga6b1c753a8c15cc5119ef13fda435ecbf">   62</a></span> <a class="code" href="group__fors__dark__test.html#ga6b1c753a8c15cc5119ef13fda435ecbf" title="Test dark recipe.">test_dark</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     <span class="comment">/* Input */</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_frameset *frames          = cpl_frameset_new();</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     cpl_parameterlist *parameters = cpl_parameterlist_new();</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     <span class="comment">/* Output */</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_dark  = NULL;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias  = NULL;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *raw_dark  = NULL;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <span class="comment">/* Simulate data */</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *dark_filename[] = {<span class="stringliteral">"dark_1.fits"</span>,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                                    <span class="stringliteral">"dark_2.fits"</span>,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                    <span class="stringliteral">"dark_3.fits"</span>};</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     {</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>         <span class="keywordtype">unsigned</span> i;</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>         </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(dark_filename)/<span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *); i++) {</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>             cpl_frameset_insert(frames, </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                                 <a class="code" href="group__test__simulate.html#gaebd36d5457a83612601155994a242dda" title="Simulate dark image.">create_dark</a>(dark_filename[i],</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                                             DARK, CPL_FRAME_GROUP_RAW));</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>         }</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     }</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_get_position(frames, 0));</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     cpl_frameset_insert(frames, </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                         <a class="code" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e" title="Simulate bias image.">create_bias</a>(<span class="stringliteral">"dark_master_bias.fits"</span>, </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                                     MASTER_BIAS, CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <a class="code" href="group__fors__dark.html#ga288a7e1b685184b501b448ea67bdf493" title="Define recipe parameters.">fors_dark_define_parameters</a>(parameters);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>             <span class="stringliteral">"Create parameters failed"</span>);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <a class="code" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42" title="Set unset parameters to default value.">fors_parameterlist_set_defaults</a>(parameters);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="comment">/* Call recipe */</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     <a class="code" href="group__fors__dark.html#ga5b25632b185b390afe047835ef04708c" title="Do the processing.">fors_dark</a>(frames, parameters);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>             <span class="stringliteral">"Execution error"</span>);</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="comment">/* Test results */</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     {</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>         <span class="comment">/* New and previous frames */</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>         test( cpl_frameset_find(frames, MASTER_DARK) != NULL );</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>         test( cpl_frameset_find(frames, MASTER_BIAS) != NULL );</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>         test( cpl_frameset_find(frames, DARK) != NULL );</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>         </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         master_dark = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>             cpl_frameset_find(frames, MASTER_DARK), NULL, setting, NULL);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>         </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>         master_bias = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>             cpl_frameset_find(frames, MASTER_BIAS), NULL, setting, NULL);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>         raw_dark    = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>             cpl_frameset_find(frames, DARK), NULL, setting, NULL);</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>         </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>         <span class="comment">/* Verify relation</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="comment">           master_dark = raw_dark - master_bias */</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>         test_rel( <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(master_dark, NULL),</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                   <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(raw_dark, NULL) -</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                   <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(master_bias, NULL),</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                   0.01);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>         <span class="comment">/* Verify that relative error decreased  */</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>         {</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>             test( <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(master_dark, NULL) /</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                   (<a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(master_dark, NULL) +</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>                    <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(master_bias, NULL))</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                   <</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                   <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(raw_dark, NULL) /</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                   <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(raw_dark, NULL));</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>         }</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     }</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     cleanup;</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> }</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno"><a class="code" href="group__fors__dark__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  148</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> {</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     TEST_INIT;</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <a class="code" href="group__fors__dark__test.html#ga6b1c753a8c15cc5119ef13fda435ecbf" title="Test dark recipe.">test_dark</a>();</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     TEST_END;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> }</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__dark_8c-source.html b/html/fors__dark_8c-source.html
deleted file mode 100644
index 95d593d..0000000
--- a/html/fors__dark_8c-source.html
+++ /dev/null
@@ -1,198 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_dark.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_dark.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_dark.c,v 1.9 2011/10/12 15:00:03 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/12 15:00:03 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.9 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_dark_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#gd82957e2524a2c840c990e6f6ac7a3f7">fors_dark_create</a>(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#gb03c103664e7d1ac06cf5819293024da">fors_dark_exec</a>(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#g0ae3039ae17bbc8695285b04dab01340">fors_dark_destroy</a>(cpl_plugin *);
-<a name="l00041"></a>00041 
-<a name="l00062"></a><a class="code" href="group__fors__dark.html#g4abb403976fc3ddcaa614c59a44590c9">00062</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00065"></a>00065     cpl_plugin *plugin = &recipe->interface;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>())
-<a name="l00068"></a>00068     {
-<a name="l00069"></a>00069         cpl_msg_error(cpl_func, 
-<a name="l00070"></a>00070               <span class="stringliteral">"I am fors_dark version %d, but I am linking "</span>
-<a name="l00071"></a>00071               <span class="stringliteral">"against the FORS library version %d. "</span>
-<a name="l00072"></a>00072               <span class="stringliteral">"This will not work. "</span>
-<a name="l00073"></a>00073               <span class="stringliteral">"Please remove all previous installations "</span>
-<a name="l00074"></a>00074               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,
-<a name="l00075"></a>00075               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>());
-<a name="l00076"></a>00076         <span class="keywordflow">return</span> 1;
-<a name="l00077"></a>00077     }
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079     cpl_plugin_init(plugin,
-<a name="l00080"></a>00080                     CPL_PLUGIN_API,
-<a name="l00081"></a>00081                     FORS_BINARY_VERSION,
-<a name="l00082"></a>00082                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00083"></a>00083                     <a class="code" href="group__fors__dark.html#g05d943cebf559a584cd08a0bb87c12f6">fors_dark_name</a>,
-<a name="l00084"></a>00084                     <a class="code" href="group__fors__dark.html#g6cfbc19717c1140f0ed3c69cd3753820">fors_dark_description_short</a>,
-<a name="l00085"></a>00085                     <a class="code" href="group__fors__dark.html#g6ca1a4a04494b527e073c4fcfc78d074">fors_dark_description</a>,
-<a name="l00086"></a>00086                     <a class="code" href="group__fors__dark.html#g2a0e9352332786f74633bbf15a357769">fors_dark_author</a>,
-<a name="l00087"></a>00087                     <a class="code" href="group__fors__dark.html#g7f059c5f1479df00d69390e1ea4f88e6">fors_dark_email</a>,
-<a name="l00088"></a>00088                     <a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a>(),
-<a name="l00089"></a>00089                     <a class="code" href="group__fors__dark.html#gd82957e2524a2c840c990e6f6ac7a3f7">fors_dark_create</a>,
-<a name="l00090"></a>00090                     <a class="code" href="group__fors__dark.html#gb03c103664e7d1ac06cf5819293024da">fors_dark_exec</a>,
-<a name="l00091"></a>00091                     <a class="code" href="group__fors__dark.html#g0ae3039ae17bbc8695285b04dab01340">fors_dark_destroy</a>);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     cpl_pluginlist_append(list, plugin);
-<a name="l00094"></a>00094     
-<a name="l00095"></a>00095     <span class="keywordflow">return</span> 0;
-<a name="l00096"></a>00096 }
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 
-<a name="l00109"></a><a class="code" href="group__fors__dark.html#gd82957e2524a2c840c990e6f6ac7a3f7">00109</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#gd82957e2524a2c840c990e6f6ac7a3f7">fors_dark_create</a>(cpl_plugin *plugin)
-<a name="l00110"></a>00110 {
-<a name="l00111"></a>00111     cpl_recipe    *recipe;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00114"></a>00114         cpl_msg_error(cpl_func, 
-<a name="l00115"></a>00115                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00116"></a>00116                       <span class="stringliteral">"refusing to create recipe fors_dark"</span>, 
-<a name="l00117"></a>00117                       cpl_error_get_message());
-<a name="l00118"></a>00118         <span class="keywordflow">return</span> 1;
-<a name="l00119"></a>00119     }
-<a name="l00120"></a>00120     
-<a name="l00121"></a>00121     <span class="comment">/* </span>
-<a name="l00122"></a>00122 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00123"></a>00123 <span class="comment">     */</span>
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00126"></a>00126         recipe = (cpl_recipe *)plugin;
-<a name="l00127"></a>00127     }
-<a name="l00128"></a>00128     <span class="keywordflow">else</span> {
-<a name="l00129"></a>00129         <span class="keywordflow">return</span> 1;
-<a name="l00130"></a>00130     }
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* </span>
-<a name="l00133"></a>00133 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00134"></a>00134 <span class="comment">     */</span>
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00137"></a>00137     
-<a name="l00138"></a>00138     <a class="code" href="group__fors__dark.html#g41900339775a0440158f71fab8e4fe73">fors_dark_define_parameters</a>(recipe->parameters);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00141"></a>00141         cpl_msg_error(cpl_func, 
-<a name="l00142"></a>00142                       <span class="stringliteral">"Could not create fors_dark parameters"</span>);
-<a name="l00143"></a>00143         <span class="keywordflow">return</span> 1;
-<a name="l00144"></a>00144     }
-<a name="l00145"></a>00145         
-<a name="l00146"></a>00146     <span class="keywordflow">return</span> 0;
-<a name="l00147"></a>00147 }
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 
-<a name="l00158"></a><a class="code" href="group__fors__dark.html#gb03c103664e7d1ac06cf5819293024da">00158</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#gb03c103664e7d1ac06cf5819293024da">fors_dark_exec</a>(cpl_plugin *plugin)
-<a name="l00159"></a>00159 {
-<a name="l00160"></a>00160     cpl_recipe *recipe;
-<a name="l00161"></a>00161     cpl_errorstate initial_errorstate = cpl_errorstate_get();
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00164"></a>00164         cpl_msg_error(cpl_func, 
-<a name="l00165"></a>00165                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00166"></a>00166                       <span class="stringliteral">"refusing to execute recipe fors_dark"</span>, 
-<a name="l00167"></a>00167                       cpl_error_get_message());
-<a name="l00168"></a>00168         <span class="keywordflow">return</span> 1;
-<a name="l00169"></a>00169     }
-<a name="l00170"></a>00170     
-<a name="l00171"></a>00171     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00172"></a>00172         recipe = (cpl_recipe *)plugin;
-<a name="l00173"></a>00173     }
-<a name="l00174"></a>00174     <span class="keywordflow">else</span> {
-<a name="l00175"></a>00175         <span class="keywordflow">return</span> 1;
-<a name="l00176"></a>00176     }
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="keywordflow">if</span> (recipe->frames == NULL) {
-<a name="l00179"></a>00179         cpl_msg_error(cpl_func, 
-<a name="l00180"></a>00180                       <span class="stringliteral">"Null frameset"</span>);
-<a name="l00181"></a>00181         <span class="keywordflow">return</span> 1;
-<a name="l00182"></a>00182     }
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">if</span> (recipe->parameters == NULL) {
-<a name="l00185"></a>00185         cpl_msg_error(cpl_func, 
-<a name="l00186"></a>00186                       <span class="stringliteral">"Null parameter list"</span>);
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> 1;
-<a name="l00188"></a>00188     }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a>(recipe->frames,
-<a name="l00191"></a>00191                <a class="code" href="group__fors__dark.html#g6cfbc19717c1140f0ed3c69cd3753820">fors_dark_description_short</a>);
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <a class="code" href="group__fors__dark.html#g605a72777b8ade477948b511ec213dba">fors_dark</a>(recipe->frames, recipe->parameters);
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a>(recipe->frames, initial_errorstate);
-<a name="l00196"></a>00196 }
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 
-<a name="l00207"></a><a class="code" href="group__fors__dark.html#g0ae3039ae17bbc8695285b04dab01340">00207</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#g0ae3039ae17bbc8695285b04dab01340">fors_dark_destroy</a>(cpl_plugin *plugin)
-<a name="l00208"></a>00208 {
-<a name="l00209"></a>00209     cpl_recipe *recipe;
-<a name="l00210"></a>00210     
-<a name="l00211"></a>00211     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00212"></a>00212         recipe = (cpl_recipe *)plugin;
-<a name="l00213"></a>00213     }
-<a name="l00214"></a>00214     <span class="keywordflow">else</span> {
-<a name="l00215"></a>00215         <span class="keywordflow">return</span> -1;
-<a name="l00216"></a>00216     }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     <span class="keywordflow">return</span> 0;
-<a name="l00221"></a>00221 }
-<a name="l00222"></a>00222 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__dark_8c_source.html b/html/fors__dark_8c_source.html
new file mode 100644
index 0000000..f04e4e1
--- /dev/null
+++ b/html/fors__dark_8c_source.html
@@ -0,0 +1,237 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_dark.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_dark.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_dark.c,v 1.9 2011-10-12 15:00:03 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-12 15:00:03 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.9 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_dark_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#gac68c5042f96db84bf22ca9d3c93f2015" title="Setup the recipe options.">fors_dark_create</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#gaff0761c9cc96530ee12377f1f014e069" title="Execute the plugin instance given by the interface.">fors_dark_exec</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#ga828322574faee993a595ecc93dfe5944" title="Destroy what has been created by the 'create' function.">fors_dark_destroy</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__dark.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">   62</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>())</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     {</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>               <span class="stringliteral">"I am fors_dark version %d, but I am linking "</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>               <span class="stringliteral">"against the FORS library version %d. "</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>               <span class="stringliteral">"This will not work. "</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>               <span class="stringliteral">"Please remove all previous installations "</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>());</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     }</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                     fors_dark_name,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                     fors_dark_description_short,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     fors_dark_description,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                     fors_dark_author,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                     fors_dark_email,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     <a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87" title="Get the pipeline copyright and license.">fors_get_license</a>(),</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     <a class="code" href="group__fors__dark.html#gac68c5042f96db84bf22ca9d3c93f2015" title="Setup the recipe options.">fors_dark_create</a>,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     <a class="code" href="group__fors__dark.html#gaff0761c9cc96530ee12377f1f014e069" title="Execute the plugin instance given by the interface.">fors_dark_exec</a>,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <a class="code" href="group__fors__dark.html#ga828322574faee993a595ecc93dfe5944" title="Destroy what has been created by the 'create' function.">fors_dark_destroy</a>);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> }</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="group__fors__dark.html#gac68c5042f96db84bf22ca9d3c93f2015">  109</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#gac68c5042f96db84bf22ca9d3c93f2015" title="Setup the recipe options.">fors_dark_create</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                       <span class="stringliteral">"refusing to create recipe fors_dark"</span>, </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     }</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     }</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <a class="code" href="group__fors__dark.html#ga288a7e1b685184b501b448ea67bdf493" title="Define recipe parameters.">fors_dark_define_parameters</a>(recipe->parameters);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                       <span class="stringliteral">"Could not create fors_dark parameters"</span>);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     }</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> }</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="group__fors__dark.html#gaff0761c9cc96530ee12377f1f014e069">  158</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#gaff0761c9cc96530ee12377f1f014e069" title="Execute the plugin instance given by the interface.">fors_dark_exec</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> {</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_errorstate initial_errorstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                       <span class="stringliteral">"refusing to execute recipe fors_dark"</span>, </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">if</span> (recipe->frames == NULL) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                       <span class="stringliteral">"Null frameset"</span>);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     }</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL) {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                       <span class="stringliteral">"Null parameter list"</span>);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce" title="Start recipe execution.">fors_begin</a>(recipe->frames,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                fors_dark_description_short);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <a class="code" href="group__fors__dark.html#ga5b25632b185b390afe047835ef04708c" title="Do the processing.">fors_dark</a>(recipe->frames, recipe->parameters);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9" title="End recipe execution.">fors_end</a>(recipe->frames, initial_errorstate);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> }</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno"><a class="code" href="group__fors__dark.html#ga828322574faee993a595ecc93dfe5944">  207</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__dark.html#ga828322574faee993a595ecc93dfe5944" title="Destroy what has been created by the 'create' function.">fors_dark_destroy</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> {</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     }</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> }</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__dark__impl_8c-source.html b/html/fors__dark__impl_8c-source.html
deleted file mode 100644
index 69d379b..0000000
--- a/html/fors__dark__impl_8c-source.html
+++ /dev/null
@@ -1,170 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_dark_impl.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_dark_impl.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_dark_impl.c,v 1.15 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.15 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_dark_impl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_stack.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00039"></a>00039 
-<a name="l00046"></a><a class="code" href="group__fors__dark.html#g05d943cebf559a584cd08a0bb87c12f6">00046</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__dark.html#g05d943cebf559a584cd08a0bb87c12f6">fors_dark_name</a> = <span class="stringliteral">"fors_dark"</span>;
-<a name="l00047"></a><a class="code" href="group__fors__dark.html#g6cfbc19717c1140f0ed3c69cd3753820">00047</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__dark.html#g6cfbc19717c1140f0ed3c69cd3753820">fors_dark_description_short</a> = <span class="stringliteral">"Compute master dark frame"</span>;
-<a name="l00048"></a><a class="code" href="group__fors__dark.html#g2a0e9352332786f74633bbf15a357769">00048</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__dark.html#g2a0e9352332786f74633bbf15a357769">fors_dark_author</a> = <span class="stringliteral">"Jonas M. Larsen"</span>;
-<a name="l00049"></a><a class="code" href="group__fors__dark.html#g7f059c5f1479df00d69390e1ea4f88e6">00049</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__dark.html#g7f059c5f1479df00d69390e1ea4f88e6">fors_dark_email</a> = PACKAGE_BUGREPORT;
-<a name="l00050"></a><a class="code" href="group__fors__dark.html#g6ca1a4a04494b527e073c4fcfc78d074">00050</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__dark.html#g6ca1a4a04494b527e073c4fcfc78d074">fors_dark_description</a> =
-<a name="l00051"></a>00051 <span class="stringliteral">"This recipe is used to combine input raw DARK frames into a master dark\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"frame by subtracing the master bias and using the given stacking method.\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"The overscan regions, if present, are removed from the result.\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"Input files:\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  DARK                       Raw         Dark frame              Y\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias             Y\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"Output files:\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  MASTER_DARK                FITS image  Master dark frame\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"\n"</span>;
-<a name="l00066"></a>00066 
-<a name="l00071"></a><a class="code" href="group__fors__dark.html#g41900339775a0440158f71fab8e4fe73">00071</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__dark.html#g41900339775a0440158f71fab8e4fe73">fors_dark_define_parameters</a>(cpl_parameterlist *parameters)
-<a name="l00072"></a>00072 {
-<a name="l00073"></a>00073     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__dark.html#g05d943cebf559a584cd08a0bb87c12f6">fors_dark_name</a>);
-<a name="l00074"></a>00074     
-<a name="l00075"></a>00075     <a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a>(parameters, context, <span class="stringliteral">"median"</span>);
-<a name="l00076"></a>00076 
-<a name="l00077"></a>00077     cpl_free((<span class="keywordtype">void</span> *)context);
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079     <span class="keywordflow">return</span>;
-<a name="l00080"></a>00080 }
-<a name="l00081"></a>00081 
-<a name="l00082"></a>00082 <span class="preprocessor">#undef cleanup</span>
-<a name="l00083"></a><a class="code" href="group__fors__dark.html#g57cf6e6e2826eb178fd2d9c3e5695343">00083</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">do { \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">    cpl_frameset_delete(dark_frames); \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">    cpl_frameset_delete(master_bias_frame); \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">    fors_image_delete_const(&master_bias); \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">    fors_stack_method_delete(&sm); \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">    fors_image_delete(&master_dark); \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">    fors_image_list_delete_const(&darks, fors_image_delete); \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">    cpl_free((void *)context); \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">} while (0)</span>
-<a name="l00094"></a>00094 <span class="preprocessor"></span>
-<a name="l00103"></a><a class="code" href="group__fors__dark.html#g605a72777b8ade477948b511ec213dba">00103</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__dark.html#g605a72777b8ade477948b511ec213dba">fors_dark</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)
-<a name="l00104"></a>00104 {
-<a name="l00105"></a>00105     <span class="comment">/* Raw */</span>
-<a name="l00106"></a>00106     cpl_frameset *dark_frames      = NULL;
-<a name="l00107"></a>00107     <span class="keyword">const</span> fors_image_list *darks   = NULL;
-<a name="l00108"></a>00108 
-<a name="l00109"></a>00109     <span class="comment">/* Calibration */</span>
-<a name="l00110"></a>00110     cpl_frameset *master_bias_frame = NULL;
-<a name="l00111"></a>00111     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias   = NULL; 
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="comment">/* Product */</span>
-<a name="l00114"></a>00114     <a class="code" href="struct__fors__image.html">fors_image</a> *master_dark = NULL;
-<a name="l00115"></a>00115 
-<a name="l00116"></a>00116     <span class="comment">/* Parameters */</span>
-<a name="l00117"></a>00117     stack_method *sm    = NULL;
-<a name="l00118"></a>00118 
-<a name="l00119"></a>00119     <span class="comment">/* Other */</span>
-<a name="l00120"></a>00120     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00121"></a>00121     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__dark.html#g05d943cebf559a584cd08a0bb87c12f6">fors_dark_name</a>);
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123     <span class="comment">/* Get parameters */</span>
-<a name="l00124"></a>00124     sm = <a class="code" href="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af">fors_stack_method_new</a>(parameters, context);
-<a name="l00125"></a>00125     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get stacking method"</span>);
-<a name="l00126"></a>00126     
-<a name="l00127"></a>00127     <span class="comment">/* Find raw */</span>
-<a name="l00128"></a>00128     dark_frames = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, DARK);
-<a name="l00129"></a>00129     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(dark_frames) > 0, <span class="keywordflow">return</span>, 
-<a name="l00130"></a>00130             <span class="stringliteral">"No %s provided"</span>, DARK);
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* Find calibration */</span>
-<a name="l00133"></a>00133     master_bias_frame = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, MASTER_BIAS);
-<a name="l00134"></a>00134     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(master_bias_frame) == 1, <span class="keywordflow">return</span>, 
-<a name="l00135"></a>00135             <span class="stringliteral">"One %s required. %d found"</span>, 
-<a name="l00136"></a>00136             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame));
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138     <span class="comment">/* Get instrument setting */</span>
-<a name="l00139"></a>00139     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_get_first(dark_frames));
-<a name="l00140"></a>00140     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );
-<a name="l00141"></a>00141 
-<a name="l00142"></a>00142     master_bias = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(cpl_frameset_get_first(master_bias_frame), 
-<a name="l00143"></a>00143                                   NULL, setting,
-<a name="l00144"></a>00144                                   NULL);
-<a name="l00145"></a>00145     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00146"></a>00146             <span class="stringliteral">"Could not load master bias"</span>);
-<a name="l00147"></a>00147     
-<a name="l00148"></a>00148     <span class="comment">/* Load dark, subtract bias */</span>
-<a name="l00149"></a>00149     darks = <a class="code" href="group__fors__image.html#gab0a6629f36c4db609f1a1515d602477">fors_image_load_list_const</a>(dark_frames, master_bias, setting, NULL);
-<a name="l00150"></a>00150     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load dark images"</span>);
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152     <span class="comment">/* Stack */</span>
-<a name="l00153"></a>00153     master_dark = <a class="code" href="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac">fors_stack_const</a>(darks, sm);
-<a name="l00154"></a>00154     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Dark stacking failed"</span>);
-<a name="l00155"></a>00155     
-<a name="l00156"></a>00156     <span class="comment">/* Save product */</span>
-<a name="l00157"></a>00157     <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, master_dark, MASTER_DARK,
-<a name="l00158"></a>00158                         NULL, parameters, <a class="code" href="group__fors__dark.html#g05d943cebf559a584cd08a0bb87c12f6">fors_dark_name</a>, 
-<a name="l00159"></a>00159                         cpl_frameset_get_first(dark_frames));
-<a name="l00160"></a>00160     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00161"></a>00161             MASTER_DARK);
-<a name="l00162"></a>00162     
-<a name="l00163"></a>00163     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00164"></a>00164     <span class="keywordflow">return</span>;
-<a name="l00165"></a>00165 }
-<a name="l00166"></a>00166 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__dark__impl_8c_source.html b/html/fors__dark__impl_8c_source.html
new file mode 100644
index 0000000..beb7f85
--- /dev/null
+++ b/html/fors__dark__impl_8c_source.html
@@ -0,0 +1,209 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_dark_impl.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_dark_impl.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_dark_impl.c,v 1.18 2013-09-10 19:12:03 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 19:12:03 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.18 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_dark_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_stack.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_dark_name = <span class="stringliteral">"fors_dark"</span>;</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_dark_description_short = <span class="stringliteral">"Compute master dark frame"</span>;</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_dark_author = <span class="stringliteral">"Jonas M. Larsen"</span>;</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_dark_email = PACKAGE_BUGREPORT;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_dark_description =</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"This recipe is used to combine input raw DARK frames into a master dark\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"frame by subtracing the master bias and using the given stacking method.\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"The overscan regions, if present, are removed from the result.\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  DARK                       Raw         Dark frame              Y\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias             Y\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  MASTER_DARK                FITS image  Master dark frame\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"\n"</span>;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="group__fors__dark.html#ga288a7e1b685184b501b448ea67bdf493">   71</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__dark.html#ga288a7e1b685184b501b448ea67bdf493" title="Define recipe parameters.">fors_dark_define_parameters</a>(cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> {</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_dark_name);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <a class="code" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15" title="Define recipe parameters.">fors_stack_define_parameters</a>(parameters, context, <span class="stringliteral">"median"</span>);</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> </div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     cpl_free((<span class="keywordtype">void</span> *)context);</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> }</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">    cpl_frameset_delete(dark_frames); \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">    cpl_frameset_delete(master_bias_frame); \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">    fors_image_delete_const(&master_bias); \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">    fors_stack_method_delete(&sm); \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">    fors_image_delete(&master_dark); \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">    fors_image_list_delete_const(&darks, fors_image_delete); \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">    cpl_free((void *)context); \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="group__fors__dark.html#ga5b25632b185b390afe047835ef04708c">  103</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__dark.html#ga5b25632b185b390afe047835ef04708c" title="Do the processing.">fors_dark</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> {</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     <span class="comment">/* Raw */</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     cpl_frameset *dark_frames      = NULL;</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="keyword">const</span> fors_image_list *darks   = NULL;</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="comment">/* Calibration */</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     cpl_frameset *master_bias_frame = NULL;</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias   = NULL; </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="comment">/* Product */</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_dark = NULL;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> </div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="comment">/* Parameters */</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     stack_method *sm    = NULL;</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="comment">/* Other */</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_dark_name);</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="comment">/* Get parameters */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     sm = <a class="code" href="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e" title="Get stack method from parameter list.">fors_stack_method_new</a>(parameters, context);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get stacking method"</span>);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     <span class="comment">/* Find raw */</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     dark_frames = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, DARK);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(dark_frames) > 0, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>             <span class="stringliteral">"No %s provided"</span>, DARK);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="comment">/* Find calibration */</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     master_bias_frame = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, MASTER_BIAS);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(master_bias_frame) == 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame));</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <span class="comment">/* Get instrument setting */</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_get_position(dark_frames, 0));</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     master_bias = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(cpl_frameset_get_position(master_bias_frame, 0), </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                                   NULL, setting,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                                   NULL);</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>             <span class="stringliteral">"Could not load master bias"</span>);</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="comment">/* Load dark, subtract bias */</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     darks = <a class="code" href="group__fors__image.html#ga0895dc7573734afe519fa4dff3ea33bd" title="Load imagelist.">fors_image_load_list_const</a>(dark_frames, master_bias, setting, NULL);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load dark images"</span>);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="comment">/* Stack */</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     master_dark = <a class="code" href="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc" title="Stack images.">fors_stack_const</a>(darks, sm);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Dark stacking failed"</span>);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="comment">/* Save product */</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, master_dark, MASTER_DARK,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                         NULL, parameters, fors_dark_name, </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                         cpl_frameset_get_position(dark_frames, 0));</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>             MASTER_DARK);</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     cleanup;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> }</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__dark__impl_8h-source.html b/html/fors__dark__impl_8h-source.html
deleted file mode 100644
index b50ccd2..0000000
--- a/html/fors__dark__impl_8h-source.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_dark_impl.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_dark_impl.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_dark_impl.h,v 1.5 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.5 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_DARK_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_DARK_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__dark.html#g05d943cebf559a584cd08a0bb87c12f6">fors_dark_name</a>;
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__dark.html#g6cfbc19717c1140f0ed3c69cd3753820">fors_dark_description_short</a>;
-<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__dark.html#g2a0e9352332786f74633bbf15a357769">fors_dark_author</a>;
-<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__dark.html#g7f059c5f1479df00d69390e1ea4f88e6">fors_dark_email</a>;
-<a name="l00039"></a>00039 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__dark.html#g6ca1a4a04494b527e073c4fcfc78d074">fors_dark_description</a>;
-<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="group__fors__dark.html#g41900339775a0440158f71fab8e4fe73">fors_dark_define_parameters</a>(cpl_parameterlist *parameters);
-<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="group__fors__dark.html#g605a72777b8ade477948b511ec213dba">fors_dark</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 CPL_END_DECLS
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__dark__impl_8h_source.html b/html/fors__dark__impl_8h_source.html
new file mode 100644
index 0000000..7e8998e
--- /dev/null
+++ b/html/fors__dark__impl_8h_source.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_dark_impl.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_dark_impl.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_dark_impl.h,v 1.5 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.5 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_DARK_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_DARK_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_dark_name;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_dark_description_short;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_dark_author;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_dark_email;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_dark_description;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__dark.html#ga288a7e1b685184b501b448ea67bdf493" title="Define recipe parameters.">fors_dark_define_parameters</a>(cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__dark.html#ga5b25632b185b390afe047835ef04708c" title="Do the processing.">fors_dark</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__data_8c-source.html b/html/fors__data_8c-source.html
deleted file mode 100644
index 90fe010..0000000
--- a/html/fors__data_8c-source.html
+++ /dev/null
@@ -1,429 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_data.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_data.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_data.c,v 1.43 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.43 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_data.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl_wcs.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_star.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_instrument.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_std_star.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include <math.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include <string.h></span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_FILTER    = <span class="stringliteral">"FILTER"</span>;
-<a name="l00046"></a>00046 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_EXTCOEFF  = <span class="stringliteral">"EXT"</span>;
-<a name="l00047"></a>00047 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DEXTCOEFF  = <span class="stringliteral">"DEXT"</span>;
-<a name="l00048"></a>00048 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_ZEROPOINT = <span class="stringliteral">"ZPOINT"</span>;
-<a name="l00049"></a>00049 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DZEROPOINT = <span class="stringliteral">"DZPOINT"</span>;
-<a name="l00050"></a>00050 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_COLORTERM = <span class="stringliteral">"COL"</span>;
-<a name="l00051"></a>00051 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DCOLORTERM = <span class="stringliteral">"DCOL"</span>;
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 <span class="preprocessor">#undef cleanup</span>
-<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">do { \</span>
-<a name="l00057"></a>00057 <span class="preprocessor">    cpl_wcs_delete(wcs); \</span>
-<a name="l00058"></a>00058 <span class="preprocessor">    cpl_matrix_delete(from); \</span>
-<a name="l00059"></a>00059 <span class="preprocessor">    cpl_matrix_delete(to); \</span>
-<a name="l00060"></a>00060 <span class="preprocessor">    cpl_array_delete(status); \</span>
-<a name="l00061"></a>00061 <span class="preprocessor">} while(0)</span>
-<a name="l00062"></a>00062 <span class="preprocessor"></span>
-<a name="l00067"></a>00067 <span class="keywordtype">void</span>
-<a name="l00068"></a>00068 fors_std_star_list_apply_wcs(               fors_std_star_list      *stars,
-<a name="l00069"></a>00069                                             <span class="keyword">const</span> cpl_propertylist  *header)
-<a name="l00070"></a>00070 {
-<a name="l00071"></a>00071     cpl_wcs *wcs = NULL;
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073     cpl_matrix *from = NULL;
-<a name="l00074"></a>00074     cpl_matrix *to = NULL;
-<a name="l00075"></a>00075     cpl_array *status = NULL;
-<a name="l00076"></a>00076     
-<a name="l00077"></a>00077     cassure_automsg(                        stars != NULL,
-<a name="l00078"></a>00078                                             CPL_ERROR_NULL_INPUT,
-<a name="l00079"></a>00079                                             <span class="keywordflow">return</span>);
-<a name="l00080"></a>00080     cassure_automsg(                        header != NULL,
-<a name="l00081"></a>00081                                             CPL_ERROR_NULL_INPUT,
-<a name="l00082"></a>00082                                             <span class="keywordflow">return</span>);
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084     <span class="keywordflow">if</span> (fors_std_star_list_size(stars) == 0) {
-<a name="l00085"></a>00085         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00086"></a>00086         <span class="keywordflow">return</span>;
-<a name="l00087"></a>00087     }
-<a name="l00088"></a>00088     
-<a name="l00089"></a>00089     wcs = cpl_wcs_new_from_propertylist(header);
-<a name="l00090"></a>00090     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>,
-<a name="l00091"></a>00091             <span class="stringliteral">"Failed to get WCS from header"</span>);
-<a name="l00092"></a>00092     
-<a name="l00093"></a>00093     {
-<a name="l00094"></a>00094         fors_std_star *star;
-<a name="l00095"></a>00095         <span class="keywordtype">int</span> i;
-<a name="l00096"></a>00096 
-<a name="l00097"></a>00097         from = cpl_matrix_new(fors_std_star_list_size(stars), 2);
-<a name="l00098"></a>00098         
-<a name="l00099"></a>00099         <span class="keywordflow">for</span> (star = fors_std_star_list_first(stars), i = 0;
-<a name="l00100"></a>00100              star != NULL;
-<a name="l00101"></a>00101              star = fors_std_star_list_next(stars), i++) {
-<a name="l00102"></a>00102             
-<a name="l00103"></a>00103             cpl_matrix_set(from, i, 0, star->ra);
-<a name="l00104"></a>00104             cpl_matrix_set(from, i, 1, star->dec);
-<a name="l00105"></a>00105         }
-<a name="l00106"></a>00106         
-<a name="l00107"></a>00107         cpl_wcs_convert(wcs, from,
-<a name="l00108"></a>00108                              &to, &status,
-<a name="l00109"></a>00109                              CPL_WCS_WORLD2PHYS);
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111         <span class="comment">/* The WCSLIB call sometimes fails with the error message</span>
-<a name="l00112"></a>00112 <span class="comment">           "WCSLIB One or more input coordinates invalid",</span>
-<a name="l00113"></a>00113 <span class="comment">           while all status flags are 0.</span>
-<a name="l00114"></a>00114 <span class="comment">        */</span>
-<a name="l00115"></a>00115         <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_UNSPECIFIED) {
-<a name="l00116"></a>00116             cpl_msg_warning(cpl_func,
-<a name="l00117"></a>00117                             <span class="stringliteral">"Ignoring WCSLIB unspecified error"</span>);
-<a name="l00118"></a>00118             cpl_error_reset();
-<a name="l00119"></a>00119         }
-<a name="l00120"></a>00120 
-<a name="l00121"></a>00121         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>,
-<a name="l00122"></a>00122                 <span class="stringliteral">"Failed to convert from world to physical coordinates"</span>);
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_matrix_get_ncol(to) == 2,
-<a name="l00125"></a>00125                 <span class="keywordflow">return</span>, <span class="stringliteral">"%d columns, 2 expected"</span>,
-<a name="l00126"></a>00126                 cpl_matrix_get_ncol(to));
-<a name="l00127"></a>00127 
-<a name="l00128"></a>00128         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_matrix_get_nrow(to) == fors_std_star_list_size(stars),
-<a name="l00129"></a>00129                 <span class="keywordflow">return</span>, <span class="stringliteral">"%d rows, %d expected"</span>,
-<a name="l00130"></a>00130                 cpl_matrix_get_nrow(to), fors_std_star_list_size(stars));
-<a name="l00131"></a>00131         
-<a name="l00132"></a>00132         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( status != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00133"></a>00133 
-<a name="l00134"></a>00134         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_array_get_size(status) == fors_std_star_list_size(stars),
-<a name="l00135"></a>00135                 <span class="keywordflow">return</span>, <span class="stringliteral">"Status array size is %d, %d expected"</span>,
-<a name="l00136"></a>00136                 cpl_array_get_size(status), fors_std_star_list_size(stars));
-<a name="l00137"></a>00137         
-<a name="l00138"></a>00138         <span class="keywordflow">for</span> (star = fors_std_star_list_first(stars), i = 0;
-<a name="l00139"></a>00139              star != NULL;
-<a name="l00140"></a>00140              star = fors_std_star_list_next(stars), i++) {
-<a name="l00141"></a>00141             
-<a name="l00142"></a>00142             <span class="keywordflow">if</span> (cpl_array_get_int(status, i, NULL) != 0) {
-<a name="l00143"></a>00143                 cpl_msg_warning(cpl_func, <span class="stringliteral">"Catalogue star %d: "</span>
-<a name="l00144"></a>00144                                 <span class="stringliteral">"non-zero status = %d from WCSLIB"</span>,
-<a name="l00145"></a>00145                                 i, cpl_array_get_int(status, i, NULL));
-<a name="l00146"></a>00146             }
-<a name="l00147"></a>00147             star->pixel->x = cpl_matrix_get(to, i, 0);
-<a name="l00148"></a>00148             star->pixel->y = cpl_matrix_get(to, i, 1);
-<a name="l00149"></a>00149         }
-<a name="l00150"></a>00150     }
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152 <span class="preprocessor">#if 0 </span><span class="comment">/* pre WCSLIB code */</span>
-<a name="l00153"></a>00153     <span class="keywordtype">double</span> deg_pr_pixel = 0.1/3600;
-<a name="l00154"></a>00154     fors_std_star *star;
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156     cpl_msg_warning(cpl_func,
-<a name="l00157"></a>00157                     <span class="stringliteral">"WCSLIB not available, "</span>
-<a name="l00158"></a>00158                     <span class="stringliteral">"applying fake transformation"</span>);
-<a name="l00159"></a>00159     
-<a name="l00160"></a>00160     <span class="keywordflow">for</span> (star = fors_std_star_list_first(stars);
-<a name="l00161"></a>00161          star != NULL;
-<a name="l00162"></a>00162          star = fors_std_star_list_next(stars)) {
-<a name="l00163"></a>00163         
-<a name="l00164"></a>00164         star->pixel->x = (star->ra  / deg_pr_pixel - 293000)/10;
-<a name="l00165"></a>00165         star->pixel->y = (star->dec / deg_pr_pixel / 10 + 169800)/10;
-<a name="l00166"></a>00166     }
-<a name="l00167"></a>00167 <span class="preprocessor">#endif</span>
-<a name="l00168"></a>00168 <span class="preprocessor"></span>    
-<a name="l00169"></a>00169     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00170"></a>00170     <span class="keywordflow">return</span>;
-<a name="l00171"></a>00171 }
-<a name="l00172"></a>00172 
-<a name="l00173"></a>00173 
-<a name="l00174"></a>00174 <span class="preprocessor">#undef cleanup</span>
-<a name="l00175"></a>00175 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00176"></a>00176 <span class="preprocessor">do { \</span>
-<a name="l00177"></a>00177 <span class="preprocessor">    cpl_table_delete(t); \</span>
-<a name="l00178"></a>00178 <span class="preprocessor">} while (0)</span>
-<a name="l00179"></a>00179 <span class="preprocessor"></span>
-<a name="l00192"></a>00192 <span class="keywordtype">void</span> fors_phot_table_load(<span class="keyword">const</span> cpl_frame *phot_table_frame,
-<a name="l00193"></a>00193                           <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00194"></a>00194                           <span class="keywordtype">double</span> *color_term,
-<a name="l00195"></a>00195                           <span class="keywordtype">double</span> *dcolor_term,
-<a name="l00196"></a>00196                           <span class="keywordtype">double</span> *ext_coeff,
-<a name="l00197"></a>00197                           <span class="keywordtype">double</span> *dext_coeff,
-<a name="l00198"></a>00198                           <span class="keywordtype">double</span> *expected_zeropoint,
-<a name="l00199"></a>00199                           <span class="keywordtype">double</span> *dexpected_zeropoint)
-<a name="l00200"></a>00200 {
-<a name="l00201"></a>00201     cpl_table *t = NULL;
-<a name="l00202"></a>00202     
-<a name="l00203"></a>00203     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( setting != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00204"></a>00204 <span class="comment">/* %%%</span>
-<a name="l00205"></a>00205 <span class="comment">    assure( setting->filter_name != NULL, return, "No filter name provided");</span>
-<a name="l00206"></a>00206 <span class="comment">*/</span>
-<a name="l00207"></a>00207     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( phot_table_frame != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00208"></a>00208     <span class="comment">/* color_term may be NULL */</span>
-<a name="l00209"></a>00209     <span class="comment">/* assure( ext_coeff != NULL, return, NULL ); it may also be NULL (Carlo) */</span>
-<a name="l00210"></a>00210     <span class="comment">/* expected_zeropoint may be NULL */</span>
-<a name="l00211"></a>00211 
-<a name="l00212"></a>00212     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( (color_term == NULL) == (dcolor_term == NULL), <span class="keywordflow">return</span>, NULL );
-<a name="l00213"></a>00213     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( (ext_coeff == NULL) == (dext_coeff == NULL), <span class="keywordflow">return</span>, NULL );
-<a name="l00214"></a>00214     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( (expected_zeropoint == NULL) == (dexpected_zeropoint == NULL), 
-<a name="l00215"></a>00215             <span class="keywordflow">return</span>, NULL );
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frame_get_filename(phot_table_frame) != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00218"></a>00218 
-<a name="l00219"></a>00219     <span class="keywordflow">if</span> (color_term) {
-<a name="l00220"></a>00220         *color_term = 0.0;
-<a name="l00221"></a>00221         *dcolor_term = 0.0;
-<a name="l00222"></a>00222     }
-<a name="l00223"></a>00223     <span class="keywordflow">if</span> (ext_coeff) {
-<a name="l00224"></a>00224         *ext_coeff = 0.0;
-<a name="l00225"></a>00225         *dext_coeff = 0.0;
-<a name="l00226"></a>00226     }
-<a name="l00227"></a>00227     <span class="keywordflow">if</span> (expected_zeropoint) {
-<a name="l00228"></a>00228         *expected_zeropoint = 0.0;
-<a name="l00229"></a>00229         *dexpected_zeropoint = 0.0;
-<a name="l00230"></a>00230     }
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232     <span class="keywordflow">if</span> (setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a> == NULL) {
-<a name="l00233"></a>00233         cpl_msg_warning(cpl_func, <span class="stringliteral">"Zeropoint computation is not supported "</span>
-<a name="l00234"></a>00234                         <span class="stringliteral">"for non-standard filters"</span>);
-<a name="l00235"></a>00235         <span class="keywordflow">return</span>;
-<a name="l00236"></a>00236     }
-<a name="l00237"></a>00237 
-<a name="l00238"></a>00238     <span class="comment">/* Verify instrument setting */</span>
-<a name="l00239"></a>00239     <span class="comment">//fixme: for user-friendliness we should verify the setting, except the filter</span>
-<a name="l00240"></a>00240     <span class="comment">//        (because this table contains data for all filters)</span>
-<a name="l00241"></a>00241     <span class="keywordflow">if</span> (0) {
-<a name="l00242"></a>00242     <a class="code" href="group__fors__setting.html#gccd3b501cb380066770b1250942fa02a">fors_setting_verify</a>(setting, phot_table_frame, NULL);
-<a name="l00243"></a>00243     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00244"></a>00244             <span class="stringliteral">"Could not verify %s setting"</span>, 
-<a name="l00245"></a>00245             cpl_frame_get_filename(phot_table_frame));
-<a name="l00246"></a>00246     }
-<a name="l00247"></a>00247 
-<a name="l00248"></a>00248     t = cpl_table_load(cpl_frame_get_filename(phot_table_frame), 1, 1);
-<a name="l00249"></a>00249     
-<a name="l00250"></a>00250     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load %s"</span>,
-<a name="l00251"></a>00251             cpl_frame_get_filename(phot_table_frame));
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_get_nrow(t) > 0, <span class="keywordflow">return</span>,
-<a name="l00254"></a>00254             <span class="stringliteral">"Empty table %s"</span>, cpl_frame_get_filename(phot_table_frame));
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256     {
-<a name="l00257"></a>00257         <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> colname[] = {
-<a name="l00258"></a>00258             FORS_DATA_PHOT_FILTER,
-<a name="l00259"></a>00259             FORS_DATA_PHOT_EXTCOEFF,
-<a name="l00260"></a>00260             FORS_DATA_PHOT_DEXTCOEFF,
-<a name="l00261"></a>00261             FORS_DATA_PHOT_ZEROPOINT,
-<a name="l00262"></a>00262             FORS_DATA_PHOT_DZEROPOINT,
-<a name="l00263"></a>00263             FORS_DATA_PHOT_COLORTERM,
-<a name="l00264"></a>00264             FORS_DATA_PHOT_DCOLORTERM};
-<a name="l00265"></a>00265         
-<a name="l00266"></a>00266         <span class="keyword">const</span> cpl_type coltype[] = {CPL_TYPE_STRING,
-<a name="l00267"></a>00267                                     CPL_TYPE_DOUBLE,
-<a name="l00268"></a>00268                                     CPL_TYPE_DOUBLE,
-<a name="l00269"></a>00269                                     CPL_TYPE_DOUBLE,
-<a name="l00270"></a>00270                                     CPL_TYPE_DOUBLE,
-<a name="l00271"></a>00271                                     CPL_TYPE_DOUBLE,
-<a name="l00272"></a>00272                                     CPL_TYPE_DOUBLE};
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274         <span class="keywordtype">int</span> colrequired[7]; <span class="comment">/* same # of elements as above */</span>
-<a name="l00275"></a>00275 
-<a name="l00276"></a>00276         colrequired[0] = 1;
-<a name="l00277"></a>00277         colrequired[1] = ext_coeff ? 1 : 0;
-<a name="l00278"></a>00278         colrequired[2] = ext_coeff ? 1 : 0;
-<a name="l00279"></a>00279         colrequired[3] = expected_zeropoint ? 1 : 0;
-<a name="l00280"></a>00280         colrequired[4] = expected_zeropoint ? 1 : 0;
-<a name="l00281"></a>00281         colrequired[5] = color_term ? 1 : 0;
-<a name="l00282"></a>00282         colrequired[6] = color_term ? 1 : 0;
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284         <span class="keywordtype">unsigned</span> i;
-<a name="l00285"></a>00285         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(colname) / <span class="keyword">sizeof</span>(*colname); i++) {
-<a name="l00286"></a>00286             
-<a name="l00287"></a>00287             <span class="keywordflow">if</span> (colrequired[i]) {
-<a name="l00288"></a>00288                 <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(t, colname[i]), <span class="keywordflow">return</span>,
-<a name="l00289"></a>00289                         <span class="stringliteral">"%s: Missing column %s"</span>,
-<a name="l00290"></a>00290                         cpl_frame_get_filename(phot_table_frame), colname[i]);
-<a name="l00291"></a>00291                 
-<a name="l00292"></a>00292                 <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_get_column_type(t, colname[i]) == coltype[i],
-<a name="l00293"></a>00293                         <span class="keywordflow">return</span>,
-<a name="l00294"></a>00294                         <span class="stringliteral">"%s column %s type is %s, %s expected"</span>,
-<a name="l00295"></a>00295                         cpl_frame_get_filename(phot_table_frame),
-<a name="l00296"></a>00296                         colname[i],
-<a name="l00297"></a>00297                         <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(cpl_table_get_column_type(t, 
-<a name="l00298"></a>00298                         colname[i])),
-<a name="l00299"></a>00299                         <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(coltype[i]));
-<a name="l00300"></a>00300             
-<a name="l00301"></a>00301                 <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_count_invalid(t, colname[i]) == 0, <span class="keywordflow">return</span>,
-<a name="l00302"></a>00302                         <span class="stringliteral">"%s column %s has invalid values"</span>,
-<a name="l00303"></a>00303                         cpl_frame_get_filename(phot_table_frame),
-<a name="l00304"></a>00304                         colname[i]);
-<a name="l00305"></a>00305              }
-<a name="l00306"></a>00306         }
-<a name="l00307"></a>00307     }
-<a name="l00308"></a>00308     <span class="comment">/* Input validation done */</span>
-<a name="l00309"></a>00309     
-<a name="l00310"></a>00310     cpl_msg_debug(cpl_func, <span class="stringliteral">"Searching for filter: %s"</span>, setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a>);
-<a name="l00311"></a>00311             
-<a name="l00312"></a>00312     <span class="keywordtype">bool</span> found = <span class="keyword">false</span>;
-<a name="l00313"></a>00313     <span class="keywordtype">int</span> i;
-<a name="l00314"></a>00314     <span class="keywordflow">for</span> (i = 0; i < cpl_table_get_nrow(t) && !found; i++) {
-<a name="l00315"></a>00315         <span class="keyword">const</span> <span class="keywordtype">char</span> *phot_filter = cpl_table_get_string(t, FORS_DATA_PHOT_FILTER, i);
-<a name="l00316"></a>00316 
-<a name="l00317"></a>00317         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( phot_filter != NULL, <span class="keywordflow">return</span>, <span class="stringliteral">"%s, row %d: Null %s"</span>,
-<a name="l00318"></a>00318                 cpl_frame_get_filename(phot_table_frame), i+1, FORS_DATA_PHOT_FILTER);
-<a name="l00319"></a>00319         
-<a name="l00320"></a>00320         <span class="keywordflow">if</span> (strcmp(setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a>, phot_filter) == 0) {
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322             found = <span class="keyword">true</span>;
-<a name="l00323"></a>00323             
-<a name="l00324"></a>00324             <span class="keywordflow">if</span> (color_term != NULL) {
-<a name="l00325"></a>00325                 *color_term  = cpl_table_get_double(t, FORS_DATA_PHOT_COLORTERM, i, NULL);
-<a name="l00326"></a>00326                 *dcolor_term = cpl_table_get_double(t, FORS_DATA_PHOT_DCOLORTERM, i, NULL);
-<a name="l00327"></a>00327             }
-<a name="l00328"></a>00328             
-<a name="l00329"></a>00329             <span class="keywordflow">if</span> (ext_coeff != NULL) {
-<a name="l00330"></a>00330                 *ext_coeff  = cpl_table_get_double(t, FORS_DATA_PHOT_EXTCOEFF, i, NULL);
-<a name="l00331"></a>00331                 *dext_coeff = cpl_table_get_double(t, FORS_DATA_PHOT_DEXTCOEFF, i, NULL);
-<a name="l00332"></a>00332             }
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334             <span class="keywordflow">if</span> (expected_zeropoint != NULL) {
-<a name="l00335"></a>00335                 *expected_zeropoint =
-<a name="l00336"></a>00336                     cpl_table_get_double(t, FORS_DATA_PHOT_ZEROPOINT, i, NULL);
-<a name="l00337"></a>00337                 *dexpected_zeropoint =
-<a name="l00338"></a>00338                     cpl_table_get_double(t, FORS_DATA_PHOT_DZEROPOINT, i, NULL);
-<a name="l00339"></a>00339             }
-<a name="l00340"></a>00340         }
-<a name="l00341"></a>00341     }
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343     <span class="keywordflow">if</span> (found == <span class="keyword">false</span>) {
-<a name="l00344"></a>00344         cpl_msg_warning(cpl_func, <span class="stringliteral">"Entry for filter %s missing in input "</span>
-<a name="l00345"></a>00345                         <span class="stringliteral">"photometric table (%s): assuming all photometric "</span>
-<a name="l00346"></a>00346                         <span class="stringliteral">"coefficients Z, E, and color term, equal to zero."</span>,
-<a name="l00347"></a>00347                         setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a>, 
-<a name="l00348"></a>00348                         cpl_frame_get_filename(phot_table_frame));
-<a name="l00349"></a>00349         *color_term          = 0.0;
-<a name="l00350"></a>00350         *dcolor_term         = 0.0;
-<a name="l00351"></a>00351         *ext_coeff           = 0.0;
-<a name="l00352"></a>00352         *dext_coeff          = 0.0;
-<a name="l00353"></a>00353         *expected_zeropoint  = 0.0;
-<a name="l00354"></a>00354         *dexpected_zeropoint = 0.0;
-<a name="l00355"></a>00355     }
-<a name="l00356"></a>00356     
-<a name="l00357"></a>00357     <span class="comment">/*</span>
-<a name="l00358"></a>00358 <span class="comment">    assure( found, return, "%s: Missing entry for filter '%s'",</span>
-<a name="l00359"></a>00359 <span class="comment">            cpl_frame_get_filename(phot_table_frame), setting->filter_name);</span>
-<a name="l00360"></a>00360 <span class="comment">    */</span>
-<a name="l00361"></a>00361     
-<a name="l00362"></a>00362     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00363"></a>00363     <span class="keywordflow">return</span>;
-<a name="l00364"></a>00364 }
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366 
-<a name="l00367"></a>00367 <span class="preprocessor">#undef cleanup</span>
-<a name="l00368"></a>00368 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00369"></a>00369 <span class="preprocessor">do { \</span>
-<a name="l00370"></a>00370 <span class="preprocessor">    cpl_table_delete(table); \</span>
-<a name="l00371"></a>00371 <span class="preprocessor">} while(0)</span>
-<a name="l00372"></a>00372 <span class="preprocessor"></span>
-<a name="l00389"></a>00389 cpl_table *fors_phot_coeff_create(<span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00390"></a>00390                                   <span class="keywordtype">double</span> color_term,
-<a name="l00391"></a>00391                                   <span class="keywordtype">double</span> dcolor_term,
-<a name="l00392"></a>00392                                   <span class="keywordtype">double</span> ext_coeff,
-<a name="l00393"></a>00393                                   <span class="keywordtype">double</span> dext_coeff,
-<a name="l00394"></a>00394                                   <span class="keywordtype">double</span> zeropoint,
-<a name="l00395"></a>00395                                   <span class="keywordtype">double</span> dzeropoint)
-<a name="l00396"></a>00396 {
-<a name="l00397"></a>00397     cpl_table *table = cpl_table_new(1);
-<a name="l00398"></a>00398 
-<a name="l00399"></a>00399     <span class="keywordflow">if</span> (table == NULL) {
-<a name="l00400"></a>00400         <span class="keywordflow">return</span> NULL;
-<a name="l00401"></a>00401     }
-<a name="l00402"></a>00402 
-<a name="l00403"></a>00403     <span class="keywordflow">if</span> (dcolor_term > 0.0 || dext_coeff > 0.0 || dzeropoint > 0.0) {
-<a name="l00404"></a>00404         cpl_table_new_column(table, FORS_DATA_PHOT_FILTER, CPL_TYPE_STRING);
-<a name="l00405"></a>00405         cpl_table_set_string(table, FORS_DATA_PHOT_FILTER, 
-<a name="l00406"></a>00406                              0, setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a>);
-<a name="l00407"></a>00407     }
-<a name="l00408"></a>00408     <span class="keywordflow">else</span> {
-<a name="l00409"></a>00409         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00410"></a>00410         <span class="keywordflow">return</span> NULL;
-<a name="l00411"></a>00411     }
-<a name="l00412"></a>00412 
-<a name="l00413"></a>00413     <span class="comment">/*</span>
-<a name="l00414"></a>00414 <span class="comment">     * Create only the necessary columns for the new table</span>
-<a name="l00415"></a>00415 <span class="comment">     */</span>
-<a name="l00416"></a>00416 
-<a name="l00417"></a>00417     <span class="keywordflow">if</span> (dext_coeff > 0.0) {
-<a name="l00418"></a>00418         cpl_table_new_column(table, FORS_DATA_PHOT_EXTCOEFF, CPL_TYPE_DOUBLE);
-<a name="l00419"></a>00419         cpl_table_new_column(table, FORS_DATA_PHOT_DEXTCOEFF, CPL_TYPE_DOUBLE);
-<a name="l00420"></a>00420         cpl_table_set_double(table, FORS_DATA_PHOT_EXTCOEFF, 0, ext_coeff);
-<a name="l00421"></a>00421         cpl_table_set_double(table, FORS_DATA_PHOT_DEXTCOEFF, 0, dext_coeff);
-<a name="l00422"></a>00422     }
-<a name="l00423"></a>00423 
-<a name="l00424"></a>00424     <span class="keywordflow">if</span> (dzeropoint > 0.0) {
-<a name="l00425"></a>00425         cpl_table_new_column(table, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);
-<a name="l00426"></a>00426         cpl_table_new_column(table, FORS_DATA_PHOT_DZEROPOINT, CPL_TYPE_DOUBLE);
-<a name="l00427"></a>00427         cpl_table_set_double(table, FORS_DATA_PHOT_ZEROPOINT, 0, zeropoint);
-<a name="l00428"></a>00428         cpl_table_set_double(table, FORS_DATA_PHOT_DZEROPOINT, 0, dzeropoint);
-<a name="l00429"></a>00429     }
-<a name="l00430"></a>00430 
-<a name="l00431"></a>00431     <span class="keywordflow">if</span> (dcolor_term > 0.0) {
-<a name="l00432"></a>00432         cpl_table_new_column(table, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);
-<a name="l00433"></a>00433         cpl_table_new_column(table, FORS_DATA_PHOT_DCOLORTERM, CPL_TYPE_DOUBLE);
-<a name="l00434"></a>00434         cpl_table_set_double(table, FORS_DATA_PHOT_COLORTERM, 0, color_term);
-<a name="l00435"></a>00435         cpl_table_set_double(table, FORS_DATA_PHOT_DCOLORTERM, 0, dcolor_term);
-<a name="l00436"></a>00436     }
-<a name="l00437"></a>00437 
-<a name="l00438"></a>00438     <span class="keywordflow">return</span> table;
-<a name="l00439"></a>00439 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__data_8c_source.html b/html/fors__data_8c_source.html
new file mode 100644
index 0000000..43cfc6c
--- /dev/null
+++ b/html/fors__data_8c_source.html
@@ -0,0 +1,468 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_data.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_data.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_data.c,v 1.44 2013-08-07 13:26:50 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-07 13:26:50 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.44 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_data.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <cpl_wcs.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_star.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_instrument.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_std_star.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_FILTER    = <span class="stringliteral">"FILTER"</span>;</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_EXTCOEFF  = <span class="stringliteral">"EXT"</span>;</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DEXTCOEFF  = <span class="stringliteral">"DEXT"</span>;</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_ZEROPOINT = <span class="stringliteral">"ZPOINT"</span>;</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DZEROPOINT = <span class="stringliteral">"DZPOINT"</span>;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_COLORTERM = <span class="stringliteral">"COL"</span>;</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DCOLORTERM = <span class="stringliteral">"DCOL"</span>;</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">    cpl_wcs_delete(wcs); \</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">    cpl_matrix_delete(from); \</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">    cpl_matrix_delete(to); \</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">    cpl_array_delete(status); \</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> fors_std_star_list_apply_wcs(               fors_std_star_list      *stars,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                             <span class="keyword">const</span> cpl_propertylist  *header)</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> {</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     cpl_wcs *wcs = NULL;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     cpl_matrix *from = NULL;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     cpl_matrix *to = NULL;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     cpl_array *status = NULL;</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     </div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     cassure_automsg(                        stars != NULL,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                                             <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     cassure_automsg(                        header != NULL,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                                             <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <span class="keywordflow">if</span> (fors_std_star_list_size(stars) == 0) {</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>         cleanup;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     }</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     wcs = cpl_wcs_new_from_propertylist(header);</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>             <span class="stringliteral">"Failed to get WCS from header"</span>);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     {</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>         fors_std_star *star;</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>         from = cpl_matrix_new(fors_std_star_list_size(stars), 2);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>         </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>         <span class="keywordflow">for</span> (star = fors_std_star_list_first(stars), i = 0;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>              star != NULL;</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>              star = fors_std_star_list_next(stars), i++) {</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>             </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>             cpl_matrix_set(from, i, 0, star->ra);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>             cpl_matrix_set(from, i, 1, star->dec);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>         }</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>         </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>         cpl_wcs_convert(wcs, from,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                              &to, &status,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                              CPL_WCS_WORLD2PHYS);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>         <span class="comment">/* The WCSLIB call sometimes fails with the error message</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="comment">           "WCSLIB One or more input coordinates invalid",</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="comment">           while all status flags are 0.</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>         <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_UNSPECIFIED) {</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>             cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                             <span class="stringliteral">"Ignoring WCSLIB unspecified error"</span>);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>             cpl_error_reset();</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         }</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                 <span class="stringliteral">"Failed to convert from world to physical coordinates"</span>);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_matrix_get_ncol(to) == 2,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                 <span class="keywordflow">return</span>, <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">" columns, 2 expected"</span>,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                 cpl_matrix_get_ncol(to));</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> </div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_matrix_get_nrow(to) == fors_std_star_list_size(stars),</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                 <span class="keywordflow">return</span>, <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">" rows, %d expected"</span>,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                 cpl_matrix_get_nrow(to), fors_std_star_list_size(stars));</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>         </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( status != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_array_get_size(status) == fors_std_star_list_size(stars),</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                 <span class="keywordflow">return</span>, <span class="stringliteral">"Status array size is %"</span>CPL_SIZE_FORMAT<span class="stringliteral">", %d expected"</span>,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                 cpl_array_get_size(status), fors_std_star_list_size(stars));</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>         </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>         <span class="keywordflow">for</span> (star = fors_std_star_list_first(stars), i = 0;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>              star != NULL;</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>              star = fors_std_star_list_next(stars), i++) {</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>             </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>             <span class="keywordflow">if</span> (cpl_array_get_int(status, i, NULL) != 0) {</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                 cpl_msg_warning(cpl_func, <span class="stringliteral">"Catalogue star %d: "</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                                 <span class="stringliteral">"non-zero status = %d from WCSLIB"</span>,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                                 i, cpl_array_get_int(status, i, NULL));</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>             }</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>             star->pixel->x = cpl_matrix_get(to, i, 0);</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>             star->pixel->y = cpl_matrix_get(to, i, 1);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>         }</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     }</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="preprocessor">#if 0 </span><span class="comment">/* pre WCSLIB code */</span><span class="preprocessor"></span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="preprocessor"></span>    <span class="keywordtype">double</span> deg_pr_pixel = 0.1/3600;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     fors_std_star *star;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                     <span class="stringliteral">"WCSLIB not available, "</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                     <span class="stringliteral">"applying fake transformation"</span>);</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="keywordflow">for</span> (star = fors_std_star_list_first(stars);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>          star != NULL;</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>          star = fors_std_star_list_next(stars)) {</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>         </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         star->pixel->x = (star->ra  / deg_pr_pixel - 293000)/10;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>         star->pixel->y = (star->dec / deg_pr_pixel / 10 + 169800)/10;</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     }</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="preprocessor"></span>    </div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     cleanup;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> }</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="preprocessor">    cpl_table_delete(t); \</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="keywordtype">void</span> fors_phot_table_load(<span class="keyword">const</span> cpl_frame *phot_table_frame,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                           <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                           <span class="keywordtype">double</span> *color_term,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                           <span class="keywordtype">double</span> *dcolor_term,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                           <span class="keywordtype">double</span> *ext_coeff,</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                           <span class="keywordtype">double</span> *dext_coeff,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                           <span class="keywordtype">double</span> *expected_zeropoint,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                           <span class="keywordtype">double</span> *dexpected_zeropoint)</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> {</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     cpl_table *t = NULL;</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( setting != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="comment">/* %%%</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment">    assure( setting->filter_name != NULL, return, "No filter name provided");</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( phot_table_frame != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     <span class="comment">/* color_term may be NULL */</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     <span class="comment">/* assure( ext_coeff != NULL, return, NULL ); it may also be NULL (Carlo) */</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="comment">/* expected_zeropoint may be NULL */</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> </div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( (color_term == NULL) == (dcolor_term == NULL), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( (ext_coeff == NULL) == (dext_coeff == NULL), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( (expected_zeropoint == NULL) == (dexpected_zeropoint == NULL), </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>             <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frame_get_filename(phot_table_frame) != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     <span class="keywordflow">if</span> (color_term) {</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>         *color_term = 0.0;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>         *dcolor_term = 0.0;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     }</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="keywordflow">if</span> (ext_coeff) {</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>         *ext_coeff = 0.0;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>         *dext_coeff = 0.0;</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     }</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     <span class="keywordflow">if</span> (expected_zeropoint) {</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>         *expected_zeropoint = 0.0;</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>         *dexpected_zeropoint = 0.0;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     }</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> </div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <span class="keywordflow">if</span> (setting->filter_name == NULL) {</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Zeropoint computation is not supported "</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                         <span class="stringliteral">"for non-standard filters"</span>);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     }</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> </div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     <span class="comment">/* Verify instrument setting */</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="comment">//fixme: for user-friendliness we should verify the setting, except the filter</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="comment">//        (because this table contains data for all filters)</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keywordflow">if</span> (0) {</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     <a class="code" href="group__fors__setting.html#ga160a93959e72b826426891ca8e0f80aa" title="Verify that instrument settings are compatible.">fors_setting_verify</a>(setting, phot_table_frame, NULL);</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>             <span class="stringliteral">"Could not verify %s setting"</span>, </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>             cpl_frame_get_filename(phot_table_frame));</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     }</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     t = cpl_table_load(cpl_frame_get_filename(phot_table_frame), 1, 1);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load %s"</span>,</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>             cpl_frame_get_filename(phot_table_frame));</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_get_nrow(t) > 0, <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>             <span class="stringliteral">"Empty table %s"</span>, cpl_frame_get_filename(phot_table_frame));</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     {</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> colname[] = {</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>             FORS_DATA_PHOT_FILTER,</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>             FORS_DATA_PHOT_EXTCOEFF,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>             FORS_DATA_PHOT_DEXTCOEFF,</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>             FORS_DATA_PHOT_ZEROPOINT,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>             FORS_DATA_PHOT_DZEROPOINT,</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>             FORS_DATA_PHOT_COLORTERM,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>             FORS_DATA_PHOT_DCOLORTERM};</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>         </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>         <span class="keyword">const</span> cpl_type coltype[] = {CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>                                     CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>                                     CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>                                     CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                                     CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>                                     CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>                                     CPL_TYPE_DOUBLE};</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         <span class="keywordtype">int</span> colrequired[7]; <span class="comment">/* same # of elements as above */</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>         colrequired[0] = 1;</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>         colrequired[1] = ext_coeff ? 1 : 0;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>         colrequired[2] = ext_coeff ? 1 : 0;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>         colrequired[3] = expected_zeropoint ? 1 : 0;</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>         colrequired[4] = expected_zeropoint ? 1 : 0;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>         colrequired[5] = color_term ? 1 : 0;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>         colrequired[6] = color_term ? 1 : 0;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>         <span class="keywordtype">unsigned</span> i;</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(colname) / <span class="keyword">sizeof</span>(*colname); i++) {</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>             </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>             <span class="keywordflow">if</span> (colrequired[i]) {</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                 <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(t, colname[i]), <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                         <span class="stringliteral">"%s: Missing column %s"</span>,</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                         cpl_frame_get_filename(phot_table_frame), colname[i]);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                 </div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                 <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_get_column_type(t, colname[i]) == coltype[i],</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                         <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                         <span class="stringliteral">"%s column %s type is %s, %s expected"</span>,</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                         cpl_frame_get_filename(phot_table_frame),</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                         colname[i],</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                         <a class="code" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd" title="Textual representation of CPL type.">fors_type_get_string</a>(cpl_table_get_column_type(t, </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                         colname[i])),</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                         <a class="code" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd" title="Textual representation of CPL type.">fors_type_get_string</a>(coltype[i]));</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>             </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>                 <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_count_invalid(t, colname[i]) == 0, <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                         <span class="stringliteral">"%s column %s has invalid values"</span>,</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>                         cpl_frame_get_filename(phot_table_frame),</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>                         colname[i]);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>              }</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         }</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     }</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="comment">/* Input validation done */</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     cpl_msg_debug(cpl_func, <span class="stringliteral">"Searching for filter: %s"</span>, setting->filter_name);</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>             </div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <span class="keywordtype">bool</span> found = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     <span class="keywordflow">for</span> (i = 0; i < cpl_table_get_nrow(t) && !found; i++) {</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *phot_filter = cpl_table_get_string(t, FORS_DATA_PHOT_FILTER, i);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( phot_filter != NULL, <span class="keywordflow">return</span>, <span class="stringliteral">"%s, row %d: Null %s"</span>,</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                 cpl_frame_get_filename(phot_table_frame), i+1, FORS_DATA_PHOT_FILTER);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>         </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>         <span class="keywordflow">if</span> (strcmp(setting->filter_name, phot_filter) == 0) {</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>             found = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>             </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>             <span class="keywordflow">if</span> (color_term != NULL) {</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>                 *color_term  = cpl_table_get_double(t, FORS_DATA_PHOT_COLORTERM, i, NULL);</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>                 *dcolor_term = cpl_table_get_double(t, FORS_DATA_PHOT_DCOLORTERM, i, NULL);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>             }</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>             </div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>             <span class="keywordflow">if</span> (ext_coeff != NULL) {</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                 *ext_coeff  = cpl_table_get_double(t, FORS_DATA_PHOT_EXTCOEFF, i, NULL);</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>                 *dext_coeff = cpl_table_get_double(t, FORS_DATA_PHOT_DEXTCOEFF, i, NULL);</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>             }</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>             <span class="keywordflow">if</span> (expected_zeropoint != NULL) {</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>                 *expected_zeropoint =</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                     cpl_table_get_double(t, FORS_DATA_PHOT_ZEROPOINT, i, NULL);</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>                 *dexpected_zeropoint =</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>                     cpl_table_get_double(t, FORS_DATA_PHOT_DZEROPOINT, i, NULL);</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>             }</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>         }</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     }</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordflow">if</span> (found == <span class="keyword">false</span>) {</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Entry for filter %s missing in input "</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>                         <span class="stringliteral">"photometric table (%s): assuming all photometric "</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>                         <span class="stringliteral">"coefficients Z, E, and color term, equal to zero."</span>,</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>                         setting->filter_name, </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>                         cpl_frame_get_filename(phot_table_frame));</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>         *color_term          = 0.0;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>         *dcolor_term         = 0.0;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>         *ext_coeff           = 0.0;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         *dext_coeff          = 0.0;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>         *expected_zeropoint  = 0.0;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         *dexpected_zeropoint = 0.0;</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     }</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     </div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> <span class="comment">    assure( found, return, "%s: Missing entry for filter '%s'",</span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> <span class="comment">            cpl_frame_get_filename(phot_table_frame), setting->filter_name);</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     cleanup;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> }</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> <span class="preprocessor">    cpl_table_delete(table); \</span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> cpl_table *fors_phot_coeff_create(<span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>                                   <span class="keywordtype">double</span> color_term,</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>                                   <span class="keywordtype">double</span> dcolor_term,</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>                                   <span class="keywordtype">double</span> ext_coeff,</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>                                   <span class="keywordtype">double</span> dext_coeff,</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                                   <span class="keywordtype">double</span> zeropoint,</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>                                   <span class="keywordtype">double</span> dzeropoint)</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> {</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     cpl_table *table = cpl_table_new(1);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     <span class="keywordflow">if</span> (table == NULL) {</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     }</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> </div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     <span class="keywordflow">if</span> (dcolor_term > 0.0 || dext_coeff > 0.0 || dzeropoint > 0.0) {</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>         cpl_table_new_column(table, FORS_DATA_PHOT_FILTER, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>         cpl_table_set_string(table, FORS_DATA_PHOT_FILTER, </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>                              0, setting->filter_name);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     }</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>         cleanup;</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     }</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> </div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> <span class="comment">     * Create only the necessary columns for the new table</span></div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     <span class="keywordflow">if</span> (dext_coeff > 0.0) {</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>         cpl_table_new_column(table, FORS_DATA_PHOT_EXTCOEFF, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>         cpl_table_new_column(table, FORS_DATA_PHOT_DEXTCOEFF, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>         cpl_table_set_double(table, FORS_DATA_PHOT_EXTCOEFF, 0, ext_coeff);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>         cpl_table_set_double(table, FORS_DATA_PHOT_DEXTCOEFF, 0, dext_coeff);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     }</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     <span class="keywordflow">if</span> (dzeropoint > 0.0) {</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         cpl_table_new_column(table, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         cpl_table_new_column(table, FORS_DATA_PHOT_DZEROPOINT, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         cpl_table_set_double(table, FORS_DATA_PHOT_ZEROPOINT, 0, zeropoint);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         cpl_table_set_double(table, FORS_DATA_PHOT_DZEROPOINT, 0, dzeropoint);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     }</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     <span class="keywordflow">if</span> (dcolor_term > 0.0) {</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>         cpl_table_new_column(table, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         cpl_table_new_column(table, FORS_DATA_PHOT_DCOLORTERM, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         cpl_table_set_double(table, FORS_DATA_PHOT_COLORTERM, 0, color_term);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>         cpl_table_set_double(table, FORS_DATA_PHOT_DCOLORTERM, 0, dcolor_term);</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     }</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span> </div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="keywordflow">return</span> table;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__data_8h-source.html b/html/fors__data_8h-source.html
deleted file mode 100644
index 8293ac5..0000000
--- a/html/fors__data_8h-source.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_data.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_data.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_data.h,v 1.16 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.16 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_DATA_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_DATA_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_std_star.h></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_setting.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="comment">/* Photometry table column names */</span>
-<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_FILTER;
-<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_EXTCOEFF;
-<a name="l00039"></a>00039 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DEXTCOEFF;
-<a name="l00040"></a>00040 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_ZEROPOINT;
-<a name="l00041"></a>00041 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DZEROPOINT;
-<a name="l00042"></a>00042 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_COLORTERM;
-<a name="l00043"></a>00043 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DCOLORTERM;
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="keywordtype">void</span>
-<a name="l00046"></a>00046 fors_std_star_list_apply_wcs(               fors_std_star_list      *stars,
-<a name="l00047"></a>00047                                             <span class="keyword">const</span> cpl_propertylist  *header);
-<a name="l00048"></a>00048 
-<a name="l00049"></a>00049 <span class="keywordtype">void</span> fors_phot_table_load(<span class="keyword">const</span> cpl_frame *phot_table_frame,
-<a name="l00050"></a>00050               <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00051"></a>00051               <span class="keywordtype">double</span> *color_term,
-<a name="l00052"></a>00052               <span class="keywordtype">double</span> *dcolor_term,
-<a name="l00053"></a>00053               <span class="keywordtype">double</span> *ext_coeff,
-<a name="l00054"></a>00054               <span class="keywordtype">double</span> *dext_coeff,
-<a name="l00055"></a>00055               <span class="keywordtype">double</span> *expected_zeropoint,
-<a name="l00056"></a>00056               <span class="keywordtype">double</span> *dexpected_zeropoint);
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058 cpl_table *fors_phot_coeff_create(<span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *,
-<a name="l00059"></a>00059                                   <span class="keywordtype">double</span> color_term,
-<a name="l00060"></a>00060                                   <span class="keywordtype">double</span> dcolor_term,
-<a name="l00061"></a>00061                                   <span class="keywordtype">double</span> ext_coeff,
-<a name="l00062"></a>00062                                   <span class="keywordtype">double</span> dext_coeff,
-<a name="l00063"></a>00063                                   <span class="keywordtype">double</span> zeropoint,
-<a name="l00064"></a>00064                                   <span class="keywordtype">double</span> dzeropoint);
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__data_8h_source.html b/html/fors__data_8h_source.html
new file mode 100644
index 0000000..a7512b3
--- /dev/null
+++ b/html/fors__data_8h_source.html
@@ -0,0 +1,127 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_data.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_data.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_data.h,v 1.16 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.16 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_DATA_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_DATA_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_std_star.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_setting.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="comment">/* Photometry table column names */</span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_FILTER;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_EXTCOEFF;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DEXTCOEFF;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_ZEROPOINT;</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DZEROPOINT;</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_COLORTERM;</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_PHOT_DCOLORTERM;</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> fors_std_star_list_apply_wcs(               fors_std_star_list      *stars,</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>                                             <span class="keyword">const</span> cpl_propertylist  *header);</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keywordtype">void</span> fors_phot_table_load(<span class="keyword">const</span> cpl_frame *phot_table_frame,</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>               <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>               <span class="keywordtype">double</span> *color_term,</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>               <span class="keywordtype">double</span> *dcolor_term,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>               <span class="keywordtype">double</span> *ext_coeff,</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>               <span class="keywordtype">double</span> *dext_coeff,</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>               <span class="keywordtype">double</span> *expected_zeropoint,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>               <span class="keywordtype">double</span> *dexpected_zeropoint);</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> cpl_table *fors_phot_coeff_create(<span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>                                   <span class="keywordtype">double</span> color_term,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>                                   <span class="keywordtype">double</span> dcolor_term,</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>                                   <span class="keywordtype">double</span> ext_coeff,</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>                                   <span class="keywordtype">double</span> dext_coeff,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>                                   <span class="keywordtype">double</span> zeropoint,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>                                   <span class="keywordtype">double</span> dzeropoint);</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__detect__objects_8c-source.html b/html/fors__detect__objects_8c-source.html
deleted file mode 100644
index ebb3cf0..0000000
--- a/html/fors__detect__objects_8c-source.html
+++ /dev/null
@@ -1,429 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_detect_objects.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_detect_objects.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_detect_objects.c,v 1.6 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.6 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_detect_objects_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to detect scientific objects spectra on a resampled\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"image produced with recipe fors_resample. Please refer to the FORS\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"Pipeline User's Manual for more details on object detection.\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"LSS, and SCI as STD.\n\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"  MAPPED_SCI_MXU             Calib       Resampled slit spectra  Y\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location on image  Y\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"  OBJECT_TABLE_SCI_MXU       FITS table  Object positions in slit spectra\n\n"</span>;
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="preprocessor">#define fors_detect_objects_exit(message)     \</span>
-<a name="l00058"></a>00058 <span class="preprocessor">{                                             \</span>
-<a name="l00059"></a>00059 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00060"></a>00060 <span class="preprocessor">cpl_image_delete(dummy);                      \</span>
-<a name="l00061"></a>00061 <span class="preprocessor">cpl_image_delete(mapped);                     \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">}</span>
-<a name="l00067"></a>00067 <span class="preprocessor"></span>
-<a name="l00068"></a>00068 <span class="preprocessor">#define fors_detect_objects_exit_memcheck(message)     \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">{                                                      \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);            \</span>
-<a name="l00071"></a>00071 <span class="preprocessor">printf("free dummy (%p)\n", dummy);                    \</span>
-<a name="l00072"></a>00072 <span class="preprocessor">cpl_image_delete(dummy);                               \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">printf("free mapped (%p)\n", mapped);                  \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">cpl_image_delete(mapped);                              \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">printf("free slits (%p)\n", slits);                    \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_table_delete(slits);                               \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">printf("free header (%p)\n", header);                  \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_propertylist_delete(header);                       \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">cpl_msg_indent_less();                                 \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">return 0;                                              \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">}</span>
-<a name="l00082"></a>00082 <span class="preprocessor"></span>
-<a name="l00083"></a>00083 
-<a name="l00095"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00095</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00096"></a>00096 {
-<a name="l00097"></a>00097     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00098"></a>00098     cpl_plugin *plugin = &recipe->interface;
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100     cpl_plugin_init(plugin,
-<a name="l00101"></a>00101                     CPL_PLUGIN_API,
-<a name="l00102"></a>00102                     FORS_BINARY_VERSION,
-<a name="l00103"></a>00103                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00104"></a>00104                     <span class="stringliteral">"fors_detect_objects"</span>,
-<a name="l00105"></a>00105                     <span class="stringliteral">"Detect objects in slit spectra"</span>,
-<a name="l00106"></a>00106                     fors_detect_objects_description,
-<a name="l00107"></a>00107                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00108"></a>00108                     PACKAGE_BUGREPORT,
-<a name="l00109"></a>00109     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00110"></a>00110     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00111"></a>00111     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00112"></a>00112     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00113"></a>00113     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00114"></a>00114     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00115"></a>00115     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00116"></a>00116     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00117"></a>00117     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00118"></a>00118     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00119"></a>00119     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00120"></a>00120     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00121"></a>00121     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00122"></a>00122                     fors_detect_objects_create,
-<a name="l00123"></a>00123                     fors_detect_objects_exec,
-<a name="l00124"></a>00124                     fors_detect_objects_destroy);
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126     cpl_pluginlist_append(list, plugin);
-<a name="l00127"></a>00127     
-<a name="l00128"></a>00128     <span class="keywordflow">return</span> 0;
-<a name="l00129"></a>00129 }
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131 
-<a name="l00142"></a>00142 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_create(cpl_plugin *plugin)
-<a name="l00143"></a>00143 {
-<a name="l00144"></a>00144     cpl_recipe    *recipe;
-<a name="l00145"></a>00145     cpl_parameter *p;
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147     <span class="comment">/* </span>
-<a name="l00148"></a>00148 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00149"></a>00149 <span class="comment">     */</span>
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00152"></a>00152         recipe = (cpl_recipe *)plugin;
-<a name="l00153"></a>00153     <span class="keywordflow">else</span> 
-<a name="l00154"></a>00154         <span class="keywordflow">return</span> -1;
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156     <span class="comment">/* </span>
-<a name="l00157"></a>00157 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00158"></a>00158 <span class="comment">     */</span>
-<a name="l00159"></a>00159 
-<a name="l00160"></a>00160     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162     <span class="comment">/*</span>
-<a name="l00163"></a>00163 <span class="comment">     * Slit margin</span>
-<a name="l00164"></a>00164 <span class="comment">     */</span>
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_objects.slit_margin"</span>,
-<a name="l00167"></a>00167                                 CPL_TYPE_INT,
-<a name="l00168"></a>00168                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span>
-<a name="l00169"></a>00169                                 <span class="stringliteral">"in object detection and extraction"</span>,
-<a name="l00170"></a>00170                                 <span class="stringliteral">"fors.fors_detect_objects"</span>,
-<a name="l00171"></a>00171                                 3);
-<a name="l00172"></a>00172     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);
-<a name="l00173"></a>00173     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00174"></a>00174     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00175"></a>00175 
-<a name="l00176"></a>00176     <span class="comment">/*</span>
-<a name="l00177"></a>00177 <span class="comment">     * Extraction radius</span>
-<a name="l00178"></a>00178 <span class="comment">     */</span>
-<a name="l00179"></a>00179 
-<a name="l00180"></a>00180     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_objects.ext_radius"</span>,
-<a name="l00181"></a>00181                                 CPL_TYPE_INT,
-<a name="l00182"></a>00182                                 <span class="stringliteral">"Maximum extraction radius for detected "</span>
-<a name="l00183"></a>00183                                 <span class="stringliteral">"objects (pixel)"</span>,
-<a name="l00184"></a>00184                                 <span class="stringliteral">"fors.fors_detect_objects"</span>,
-<a name="l00185"></a>00185                                 6);
-<a name="l00186"></a>00186     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);
-<a name="l00187"></a>00187     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00188"></a>00188     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <span class="comment">/*</span>
-<a name="l00191"></a>00191 <span class="comment">     * Contamination radius</span>
-<a name="l00192"></a>00192 <span class="comment">     */</span>
-<a name="l00193"></a>00193 
-<a name="l00194"></a>00194     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_objects.cont_radius"</span>,
-<a name="l00195"></a>00195                                 CPL_TYPE_INT,
-<a name="l00196"></a>00196                                 <span class="stringliteral">"Minimum distance at which two objects "</span>
-<a name="l00197"></a>00197                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span>
-<a name="l00198"></a>00198                                 <span class="stringliteral">"each other (pixel)"</span>,
-<a name="l00199"></a>00199                                 <span class="stringliteral">"fors.fors_detect_objects"</span>,
-<a name="l00200"></a>00200                                 0);
-<a name="l00201"></a>00201     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);
-<a name="l00202"></a>00202     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00203"></a>00203     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00204"></a>00204 
-<a name="l00205"></a>00205     <span class="keywordflow">return</span> 0;
-<a name="l00206"></a>00206 }
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208 
-<a name="l00217"></a>00217 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_exec(cpl_plugin *plugin)
-<a name="l00218"></a>00218 {
-<a name="l00219"></a>00219     cpl_recipe *recipe;
-<a name="l00220"></a>00220     
-<a name="l00221"></a>00221     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00222"></a>00222         recipe = (cpl_recipe *)plugin;
-<a name="l00223"></a>00223     <span class="keywordflow">else</span> 
-<a name="l00224"></a>00224         <span class="keywordflow">return</span> -1;
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <span class="keywordflow">return</span> fors_detect_objects(recipe->parameters, recipe->frames);
-<a name="l00227"></a>00227 }
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229 
-<a name="l00238"></a>00238 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_destroy(cpl_plugin *plugin)
-<a name="l00239"></a>00239 {
-<a name="l00240"></a>00240     cpl_recipe *recipe;
-<a name="l00241"></a>00241     
-<a name="l00242"></a>00242     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00243"></a>00243         recipe = (cpl_recipe *)plugin;
-<a name="l00244"></a>00244     <span class="keywordflow">else</span> 
-<a name="l00245"></a>00245         <span class="keywordflow">return</span> -1;
-<a name="l00246"></a>00246 
-<a name="l00247"></a>00247     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00248"></a>00248 
-<a name="l00249"></a>00249     <span class="keywordflow">return</span> 0;
-<a name="l00250"></a>00250 }
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252 
-<a name="l00262"></a>00262 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects(cpl_parameterlist *parlist, 
-<a name="l00263"></a>00263                                cpl_frameset *frameset)
-<a name="l00264"></a>00264 {
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_detect_objects"</span>;
-<a name="l00267"></a>00267 
-<a name="l00268"></a>00268 
-<a name="l00269"></a>00269     <span class="comment">/*</span>
-<a name="l00270"></a>00270 <span class="comment">     * Input parameters</span>
-<a name="l00271"></a>00271 <span class="comment">     */</span>
-<a name="l00272"></a>00272 
-<a name="l00273"></a>00273     <span class="keywordtype">int</span>         slit_margin;
-<a name="l00274"></a>00274     <span class="keywordtype">int</span>         ext_radius;
-<a name="l00275"></a>00275     <span class="keywordtype">int</span>         cont_radius;
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277     <span class="comment">/*</span>
-<a name="l00278"></a>00278 <span class="comment">     * CPL objects</span>
-<a name="l00279"></a>00279 <span class="comment">     */</span>
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281     cpl_image        *mapped = NULL;
-<a name="l00282"></a>00282     cpl_image        *dummy  = NULL;
-<a name="l00283"></a>00283     cpl_table        *slits  = NULL;
-<a name="l00284"></a>00284     cpl_propertylist *header = NULL;
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286     <span class="comment">/*</span>
-<a name="l00287"></a>00287 <span class="comment">     * Auxiliary variables</span>
-<a name="l00288"></a>00288 <span class="comment">     */</span>
-<a name="l00289"></a>00289 
-<a name="l00290"></a>00290     <span class="keywordtype">char</span>        version[80];
-<a name="l00291"></a>00291     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00292"></a>00292     <span class="keyword">const</span> <span class="keywordtype">char</span> *input_tag;
-<a name="l00293"></a>00293     <span class="keyword">const</span> <span class="keywordtype">char</span> *outpt_tag;
-<a name="l00294"></a>00294     <span class="keywordtype">int</span>         nframes;
-<a name="l00295"></a>00295     <span class="keywordtype">double</span>      gain;
-<a name="l00296"></a>00296     <span class="keywordtype">int</span>         scimxu;
-<a name="l00297"></a>00297     <span class="keywordtype">int</span>         scimos;
-<a name="l00298"></a>00298     <span class="keywordtype">int</span>         scilss;
-<a name="l00299"></a>00299     <span class="keywordtype">int</span>         stdmxu;
-<a name="l00300"></a>00300     <span class="keywordtype">int</span>         stdmos;
-<a name="l00301"></a>00301     <span class="keywordtype">int</span>         stdlss;
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306     cpl_msg_set_indentation(2);
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309     <span class="comment">/*</span>
-<a name="l00310"></a>00310 <span class="comment">     * Get configuration parameters</span>
-<a name="l00311"></a>00311 <span class="comment">     */</span>
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00314"></a>00314     cpl_msg_indent_more();
-<a name="l00315"></a>00315     
-<a name="l00316"></a>00316     slit_margin = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00317"></a>00317                                         <span class="stringliteral">"fors.fors_detect_objects.slit_margin"</span>,
-<a name="l00318"></a>00318                                         NULL);
-<a name="l00319"></a>00319     <span class="keywordflow">if</span> (slit_margin < 0)
-<a name="l00320"></a>00320         fors_detect_objects_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322     ext_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00323"></a>00323                                        <span class="stringliteral">"fors.fors_detect_objects.ext_radius"</span>,
-<a name="l00324"></a>00324                                         NULL);
-<a name="l00325"></a>00325     <span class="keywordflow">if</span> (ext_radius < 0)
-<a name="l00326"></a>00326         fors_detect_objects_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328     cont_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00329"></a>00329                                         <span class="stringliteral">"fors.fors_detect_objects.cont_radius"</span>,
-<a name="l00330"></a>00330                                         NULL);
-<a name="l00331"></a>00331     <span class="keywordflow">if</span> (cont_radius < 0)
-<a name="l00332"></a>00332         fors_detect_objects_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00335"></a>00335         fors_detect_objects_exit(<span class="stringliteral">"Failure reading configuration parameters"</span>);
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338     cpl_msg_indent_less();
-<a name="l00339"></a>00339     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00340"></a>00340     cpl_msg_indent_more();
-<a name="l00341"></a>00341 
-<a name="l00342"></a>00342     nframes  = scimxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_MXU"</span>);
-<a name="l00343"></a>00343     nframes += scimos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_MOS"</span>);
-<a name="l00344"></a>00344     nframes += scilss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_LSS"</span>);
-<a name="l00345"></a>00345     nframes += stdmxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_MXU"</span>);
-<a name="l00346"></a>00346     nframes += stdmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_MOS"</span>);
-<a name="l00347"></a>00347     nframes += stdlss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_LSS"</span>);
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00350"></a>00350         fors_detect_objects_exit(<span class="stringliteral">"Missing input scientific spectra"</span>);
-<a name="l00351"></a>00351     }
-<a name="l00352"></a>00352     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00353"></a>00353         cpl_msg_error(recipe, <span class="stringliteral">"Too many input scientific spectra (%d > 1)"</span>, 
-<a name="l00354"></a>00354                       nframes);
-<a name="l00355"></a>00355         fors_detect_objects_exit(NULL);
-<a name="l00356"></a>00356     }
-<a name="l00357"></a>00357 
-<a name="l00358"></a>00358     <span class="keywordflow">if</span> (scimxu) {
-<a name="l00359"></a>00359         input_tag         = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;
-<a name="l00360"></a>00360         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;
-<a name="l00361"></a>00361         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00362"></a>00362     }
-<a name="l00363"></a>00363     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scimos) {
-<a name="l00364"></a>00364         input_tag         = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;
-<a name="l00365"></a>00365         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;
-<a name="l00366"></a>00366         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00367"></a>00367     }
-<a name="l00368"></a>00368     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scilss) {
-<a name="l00369"></a>00369         input_tag         = <span class="stringliteral">"MAPPED_SCI_LSS"</span>;
-<a name="l00370"></a>00370         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;
-<a name="l00371"></a>00371         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;
-<a name="l00372"></a>00372     }
-<a name="l00373"></a>00373     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdmxu) {
-<a name="l00374"></a>00374         input_tag         = <span class="stringliteral">"MAPPED_STD_MXU"</span>;
-<a name="l00375"></a>00375         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;
-<a name="l00376"></a>00376         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00377"></a>00377     }
-<a name="l00378"></a>00378     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdmos) {
-<a name="l00379"></a>00379         input_tag         = <span class="stringliteral">"MAPPED_STD_MOS"</span>;
-<a name="l00380"></a>00380         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;
-<a name="l00381"></a>00381         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00382"></a>00382     }
-<a name="l00383"></a>00383     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdlss) {
-<a name="l00384"></a>00384         input_tag         = <span class="stringliteral">"MAPPED_STD_LSS"</span>;
-<a name="l00385"></a>00385         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;
-<a name="l00386"></a>00386         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;
-<a name="l00387"></a>00387     }
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00390"></a>00390         fors_detect_objects_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00393"></a>00393         fors_detect_objects_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00396"></a>00396         fors_detect_objects_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, input_tag, 0);
-<a name="l00399"></a>00399     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00400"></a>00400         fors_detect_objects_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00403"></a>00403     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00404"></a>00404         fors_detect_objects_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span>
-<a name="l00405"></a>00405                                  <span class="stringliteral">"header"</span>);
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00408"></a>00408         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00409"></a>00409     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00410"></a>00410         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l00413"></a>00413 
-<a name="l00414"></a>00414     cpl_propertylist_delete(header); header = NULL;
-<a name="l00415"></a>00415 
-<a name="l00416"></a>00416     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00417"></a>00417         fors_detect_objects_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in "</span>
-<a name="l00418"></a>00418                                <span class="stringliteral">"scientific frame header"</span>);
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l00421"></a>00421 
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423     cpl_msg_indent_less();
-<a name="l00424"></a>00424     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);
-<a name="l00425"></a>00425     cpl_msg_indent_more();
-<a name="l00426"></a>00426 
-<a name="l00427"></a>00427     mapped = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, input_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00428"></a>00428     <span class="keywordflow">if</span> (mapped == NULL)
-<a name="l00429"></a>00429         fors_detect_objects_exit(<span class="stringliteral">"Cannot load input scientific frame"</span>);
-<a name="l00430"></a>00430 
-<a name="l00431"></a>00431     slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l00432"></a>00432     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00433"></a>00433         fors_detect_objects_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435     cpl_msg_indent_less();
-<a name="l00436"></a>00436     cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);
-<a name="l00437"></a>00437     cpl_msg_indent_more();
-<a name="l00438"></a>00438 
-<a name="l00439"></a>00439     <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(mapped, gain, -1., -1.);
-<a name="l00440"></a>00440     dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped, slits, slit_margin,
-<a name="l00441"></a>00441                                ext_radius, cont_radius);
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443     cpl_image_delete(mapped); mapped = NULL;
-<a name="l00444"></a>00444     cpl_image_delete(dummy); dummy = NULL;
-<a name="l00445"></a>00445 
-<a name="l00446"></a>00446     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, outpt_tag, NULL, parlist,
-<a name="l00447"></a>00447                        recipe, version))
-<a name="l00448"></a>00448         fors_detect_objects_exit(NULL);
-<a name="l00449"></a>00449 
-<a name="l00450"></a>00450     cpl_table_delete(slits); slits = NULL;
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452     <span class="keywordflow">return</span> 0;
-<a name="l00453"></a>00453 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__detect__objects_8c_source.html b/html/fors__detect__objects_8c_source.html
new file mode 100644
index 0000000..55045c5
--- /dev/null
+++ b/html/fors__detect__objects_8c_source.html
@@ -0,0 +1,468 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_detect_objects.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_detect_objects.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_detect_objects.c,v 1.6 2013-04-24 14:14:13 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-04-24 14:14:13 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.6 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_detect_objects_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to detect scientific objects spectra on a resampled\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"image produced with recipe fors_resample. Please refer to the FORS\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"Pipeline User's Manual for more details on object detection.\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"LSS, and SCI as STD.\n\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"  MAPPED_SCI_MXU             Calib       Resampled slit spectra  Y\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location on image  Y\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"  OBJECT_TABLE_SCI_MXU       FITS table  Object positions in slit spectra\n\n"</span>;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">#define fors_detect_objects_exit(message)     \</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">cpl_image_delete(dummy);                      \</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">cpl_image_delete(mapped);                     \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">#define fors_detect_objects_exit_memcheck(message)     \</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">{                                                      \</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);            \</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor">printf("free dummy (%p)\n", dummy);                    \</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">cpl_image_delete(dummy);                               \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">printf("free mapped (%p)\n", mapped);                  \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">cpl_image_delete(mapped);                              \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">printf("free slits (%p)\n", slits);                    \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_table_delete(slits);                               \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">printf("free header (%p)\n", header);                  \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_propertylist_delete(header);                       \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">cpl_msg_indent_less();                                 \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">return 0;                                              \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> {</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                     <span class="stringliteral">"fors_detect_objects"</span>,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                     <span class="stringliteral">"Detect objects in slit spectra"</span>,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                     fors_detect_objects_description,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                     fors_detect_objects_create,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                     fors_detect_objects_exec,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                     fors_detect_objects_destroy);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     </div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> }</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> {</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="comment">     * Slit margin</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_objects.slit_margin"</span>,</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>                                 <span class="stringliteral">"in object detection and extraction"</span>,</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>                                 <span class="stringliteral">"fors.fors_detect_objects"</span>,</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                                 3);</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="comment">     * Extraction radius</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_objects.ext_radius"</span>,</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>                                 <span class="stringliteral">"Maximum extraction radius for detected "</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>                                 <span class="stringliteral">"objects (pixel)"</span>,</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>                                 <span class="stringliteral">"fors.fors_detect_objects"</span>,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                                 6);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="comment">     * Contamination radius</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_objects.cont_radius"</span>,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                                 <span class="stringliteral">"Minimum distance at which two objects "</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                                 <span class="stringliteral">"each other (pixel)"</span>,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                                 <span class="stringliteral">"fors.fors_detect_objects"</span>,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                                 0);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> }</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> {</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="keywordflow">return</span> fors_detect_objects(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> }</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> {</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     </div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> </div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> </div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> }</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_objects(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> {</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_detect_objects"</span>;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="keywordtype">int</span>         slit_margin;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     <span class="keywordtype">int</span>         ext_radius;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="keywordtype">int</span>         cont_radius;</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     cpl_image        *mapped = NULL;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     cpl_image        *dummy  = NULL;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_table        *slits  = NULL;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_propertylist *header = NULL;</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> </div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *input_tag;</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *outpt_tag;</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     <span class="keywordtype">int</span>         nframes;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     <span class="keywordtype">double</span>      gain;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="keywordtype">int</span>         scimxu;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keywordtype">int</span>         scimos;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     <span class="keywordtype">int</span>         scilss;</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     <span class="keywordtype">int</span>         stdmxu;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <span class="keywordtype">int</span>         stdmos;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="keywordtype">int</span>         stdlss;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     slit_margin = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>                                         <span class="stringliteral">"fors.fors_detect_objects.slit_margin"</span>,</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                                         NULL);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     <span class="keywordflow">if</span> (slit_margin < 0)</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>         fors_detect_objects_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     ext_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                                        <span class="stringliteral">"fors.fors_detect_objects.ext_radius"</span>,</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                                         NULL);</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keywordflow">if</span> (ext_radius < 0)</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>         fors_detect_objects_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     cont_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>                                         <span class="stringliteral">"fors.fors_detect_objects.cont_radius"</span>,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                                         NULL);</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <span class="keywordflow">if</span> (cont_radius < 0)</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>         fors_detect_objects_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>         fors_detect_objects_exit(<span class="stringliteral">"Failure reading configuration parameters"</span>);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> </div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     nframes  = scimxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     nframes += scimos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     nframes += scilss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_LSS"</span>);</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     nframes += stdmxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_MXU"</span>);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     nframes += stdmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_MOS"</span>);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     nframes += stdlss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_LSS"</span>);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>         fors_detect_objects_exit(<span class="stringliteral">"Missing input scientific spectra"</span>);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     }</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input scientific spectra (%d > 1)"</span>, </div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>                       nframes);</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>         fors_detect_objects_exit(NULL);</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     }</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="keywordflow">if</span> (scimxu) {</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>         input_tag         = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     }</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scimos) {</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>         input_tag         = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     }</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scilss) {</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>         input_tag         = <span class="stringliteral">"MAPPED_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     }</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdmxu) {</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>         input_tag         = <span class="stringliteral">"MAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     }</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdmos) {</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>         input_tag         = <span class="stringliteral">"MAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     }</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdlss) {</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>         input_tag         = <span class="stringliteral">"MAPPED_STD_LSS"</span>;</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>         outpt_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     }</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>         fors_detect_objects_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>         fors_detect_objects_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>         fors_detect_objects_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, input_tag, 0);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>         fors_detect_objects_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>         fors_detect_objects_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>                                  <span class="stringliteral">"header"</span>);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> </div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> </div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>         fors_detect_objects_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in "</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>                                <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> </div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> </div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     mapped = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, input_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     <span class="keywordflow">if</span> (mapped == NULL)</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>         fors_detect_objects_exit(<span class="stringliteral">"Cannot load input scientific frame"</span>);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         fors_detect_objects_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> </div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(mapped, gain, -1., -1.);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped, slits, slit_margin,</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                                ext_radius, cont_radius);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     cpl_image_delete(mapped); mapped = NULL;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, slits, outpt_tag, NULL, parlist,</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>                        recipe, version))</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>         fors_detect_objects_exit(NULL);</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> </div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> </div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__detect__spectra_8c-source.html b/html/fors__detect__spectra_8c-source.html
deleted file mode 100644
index 4e0f404..0000000
--- a/html/fors__detect__spectra_8c-source.html
+++ /dev/null
@@ -1,815 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_detect_spectra.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_detect_spectra.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_detect_spectra.c,v 1.8 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_detect_spectra_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to detect and locate MOS/MXU slit spectra on the CCD,\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"applying a pattern-matching algorithm. The input spectral exposure must\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"contain spectra with the dispersion direction approximately horizontal,\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"with blue on the left and red on the right. Use recipe fors_wave_calib_lss\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"for LSS data, or for MOS/MXU data where all slits have the same offset.\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"The rows of the input spectral exposure are processed separately, one\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"by one. First, the background continuum is removed. Second, a list of\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"positions of reference lines candidates is created. Only peaks above a\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"given threshold (specified by the parameter --peakdetection) are selected.\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"Third, the pattern-matching task selects from the found peaks the ones\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"corresponding to the reference lines, listed in the input line catalog,\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"associating them to the appropriate wavelengths. The ensuing polynomial\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"fit is used to locate the central wavelength of the applied grism along\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"each image row. The contributions from all rows form an image of the\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"location of all spectra, that can be used as a starting point for the\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"proper modeling of the optical and spectral distortions. For more details\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"on this reduction strategy please refer to the FORS Pipeline User's Manual.\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"Note that specifying an input GRISM_TABLE will set some of the recipe\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"configuration parameters to default values valid for a particular grism.\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"Again, see the pipeline manual for more details.\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS.\n\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  LAMP_UNBIAS_MXU            Calib       Bias subtracted arc     Y\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"  MASTER_LINECAT             Calib       Line catalog            Y\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"  SLIT_MAP_MXU               FITS image  Map of central wavelength on CCD\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"  SLIT_LOCATION_DETECT_MXU   FITS table  Slits positions on CCD\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"  SPECTRA_DETECTION_MXU      FITS image  Check of preliminary detection\n\n"</span>;
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078 <span class="preprocessor">#define fors_detect_spectra_exit(message)     \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">{                                             \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_image_delete(checkwave);                  \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_image_delete(refimage);                   \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">cpl_mask_delete(refmask);                     \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">}</span>
-<a name="l00094"></a>00094 <span class="preprocessor"></span>
-<a name="l00095"></a>00095 <span class="preprocessor">#define fors_detect_spectra_exit_memcheck(message) \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">{                                               \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">cpl_image_delete(spectra);                      \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">printf("free checkwave (%p)\n", checkwave);     \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">cpl_image_delete(checkwave);                    \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">printf("free refimage (%p)\n", refimage);       \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">cpl_image_delete(refimage);                     \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">printf("free refmask (%p)\n", refmask);         \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">cpl_mask_delete(refmask);                       \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">cpl_table_delete(grism_table);                  \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths); \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">cpl_table_delete(wavelengths);                  \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">cpl_table_delete(maskslits);                    \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">cpl_table_delete(slits);                        \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">printf("free lines (%p)\n", lines);             \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">cpl_vector_delete(lines);                       \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">}</span>
-<a name="l00121"></a>00121 <span class="preprocessor"></span>
-<a name="l00122"></a>00122 
-<a name="l00134"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00134</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00135"></a>00135 {
-<a name="l00136"></a>00136     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00137"></a>00137     cpl_plugin *plugin = &recipe->interface;
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139     cpl_plugin_init(plugin,
-<a name="l00140"></a>00140                     CPL_PLUGIN_API,
-<a name="l00141"></a>00141                     FORS_BINARY_VERSION,
-<a name="l00142"></a>00142                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00143"></a>00143                     <span class="stringliteral">"fors_detect_spectra"</span>,
-<a name="l00144"></a>00144                     <span class="stringliteral">"Detect MOS/MXU spectra on CCD"</span>,
-<a name="l00145"></a>00145                     fors_detect_spectra_description,
-<a name="l00146"></a>00146                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00147"></a>00147                     PACKAGE_BUGREPORT,
-<a name="l00148"></a>00148     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00149"></a>00149     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00150"></a>00150     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00151"></a>00151     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00152"></a>00152     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00153"></a>00153     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00154"></a>00154     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00155"></a>00155     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00156"></a>00156     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00157"></a>00157     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00158"></a>00158     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00159"></a>00159     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00160"></a>00160     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00161"></a>00161                     fors_detect_spectra_create,
-<a name="l00162"></a>00162                     fors_detect_spectra_exec,
-<a name="l00163"></a>00163                     fors_detect_spectra_destroy);
-<a name="l00164"></a>00164 
-<a name="l00165"></a>00165     cpl_pluginlist_append(list, plugin);
-<a name="l00166"></a>00166     
-<a name="l00167"></a>00167     <span class="keywordflow">return</span> 0;
-<a name="l00168"></a>00168 }
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170 
-<a name="l00181"></a>00181 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_create(cpl_plugin *plugin)
-<a name="l00182"></a>00182 {
-<a name="l00183"></a>00183     cpl_recipe    *recipe;
-<a name="l00184"></a>00184     cpl_parameter *p;
-<a name="l00185"></a>00185 
-<a name="l00186"></a>00186     <span class="comment">/* </span>
-<a name="l00187"></a>00187 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00188"></a>00188 <span class="comment">     */</span>
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00191"></a>00191         recipe = (cpl_recipe *)plugin;
-<a name="l00192"></a>00192     <span class="keywordflow">else</span> 
-<a name="l00193"></a>00193         <span class="keywordflow">return</span> -1;
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="comment">/* </span>
-<a name="l00196"></a>00196 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00197"></a>00197 <span class="comment">     */</span>
-<a name="l00198"></a>00198 
-<a name="l00199"></a>00199     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201     <span class="comment">/*</span>
-<a name="l00202"></a>00202 <span class="comment">     * Dispersion</span>
-<a name="l00203"></a>00203 <span class="comment">     */</span>
-<a name="l00204"></a>00204 
-<a name="l00205"></a>00205     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.dispersion"</span>,
-<a name="l00206"></a>00206                                 CPL_TYPE_DOUBLE,
-<a name="l00207"></a>00207                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00208"></a>00208                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,
-<a name="l00209"></a>00209                                 0.0);
-<a name="l00210"></a>00210     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00211"></a>00211     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00212"></a>00212     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00213"></a>00213 
-<a name="l00214"></a>00214     <span class="comment">/*</span>
-<a name="l00215"></a>00215 <span class="comment">     * Peak detection level</span>
-<a name="l00216"></a>00216 <span class="comment">     */</span>
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.peakdetection"</span>,
-<a name="l00219"></a>00219                                 CPL_TYPE_DOUBLE,
-<a name="l00220"></a>00220                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,
-<a name="l00221"></a>00221                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,
-<a name="l00222"></a>00222                                 0.0);
-<a name="l00223"></a>00223     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);
-<a name="l00224"></a>00224     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00225"></a>00225     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227     <span class="comment">/*</span>
-<a name="l00228"></a>00228 <span class="comment">     * Degree of wavelength calibration polynomial</span>
-<a name="l00229"></a>00229 <span class="comment">     */</span>
-<a name="l00230"></a>00230 
-<a name="l00231"></a>00231     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.wdegree"</span>,
-<a name="l00232"></a>00232                                 CPL_TYPE_INT,
-<a name="l00233"></a>00233                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,
-<a name="l00234"></a>00234                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,
-<a name="l00235"></a>00235                                 0);
-<a name="l00236"></a>00236     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);
-<a name="l00237"></a>00237     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00238"></a>00238     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240     <span class="comment">/*</span>
-<a name="l00241"></a>00241 <span class="comment">     * Reference lines search radius</span>
-<a name="l00242"></a>00242 <span class="comment">     */</span>
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.wradius"</span>,
-<a name="l00245"></a>00245                                 CPL_TYPE_INT,
-<a name="l00246"></a>00246                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span>
-<a name="l00247"></a>00247                                 <span class="stringliteral">"with first-guess method"</span>,
-<a name="l00248"></a>00248                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,
-<a name="l00249"></a>00249                                 4);
-<a name="l00250"></a>00250     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);
-<a name="l00251"></a>00251     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00252"></a>00252     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00253"></a>00253 
-<a name="l00254"></a>00254     <span class="comment">/*</span>
-<a name="l00255"></a>00255 <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span>
-<a name="l00256"></a>00256 <span class="comment">     */</span>
-<a name="l00257"></a>00257 
-<a name="l00258"></a>00258     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.wreject"</span>,
-<a name="l00259"></a>00259                                 CPL_TYPE_DOUBLE,
-<a name="l00260"></a>00260                                 <span class="stringliteral">"Rejection threshold in dispersion "</span>
-<a name="l00261"></a>00261                                 <span class="stringliteral">"relation fit (pixel)"</span>,
-<a name="l00262"></a>00262                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,
-<a name="l00263"></a>00263                                 0.7);
-<a name="l00264"></a>00264     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);
-<a name="l00265"></a>00265     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00266"></a>00266     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00267"></a>00267 
-<a name="l00268"></a>00268     <span class="comment">/*</span>
-<a name="l00269"></a>00269 <span class="comment">     * Line catalog table column containing the reference wavelengths</span>
-<a name="l00270"></a>00270 <span class="comment">     */</span>
-<a name="l00271"></a>00271 
-<a name="l00272"></a>00272     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.wcolumn"</span>,
-<a name="l00273"></a>00273                                 CPL_TYPE_STRING,
-<a name="l00274"></a>00274                                 <span class="stringliteral">"Name of line catalog table column "</span>
-<a name="l00275"></a>00275                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00276"></a>00276                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,
-<a name="l00277"></a>00277                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00278"></a>00278     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00279"></a>00279     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00280"></a>00280     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282     <span class="comment">/*</span>
-<a name="l00283"></a>00283 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00284"></a>00284 <span class="comment">     */</span>
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.startwavelength"</span>,
-<a name="l00287"></a>00287                                 CPL_TYPE_DOUBLE,
-<a name="l00288"></a>00288                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00289"></a>00289                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,
-<a name="l00290"></a>00290                                 0.0);
-<a name="l00291"></a>00291     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00292"></a>00292     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00293"></a>00293     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00294"></a>00294 
-<a name="l00295"></a>00295     <span class="comment">/*</span>
-<a name="l00296"></a>00296 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00297"></a>00297 <span class="comment">     */</span>
-<a name="l00298"></a>00298 
-<a name="l00299"></a>00299     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.endwavelength"</span>,
-<a name="l00300"></a>00300                                 CPL_TYPE_DOUBLE,
-<a name="l00301"></a>00301                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00302"></a>00302                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,
-<a name="l00303"></a>00303                                 0.0);
-<a name="l00304"></a>00304     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00305"></a>00305     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00306"></a>00306     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308     <span class="comment">/*</span>
-<a name="l00309"></a>00309 <span class="comment">     * Try slit identification</span>
-<a name="l00310"></a>00310 <span class="comment">     */</span>
-<a name="l00311"></a>00311 
-<a name="l00312"></a>00312     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.slit_ident"</span>,
-<a name="l00313"></a>00313                                 CPL_TYPE_BOOL,
-<a name="l00314"></a>00314                                 <span class="stringliteral">"Attempt slit identification for MOS or MXU"</span>,
-<a name="l00315"></a>00315                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,
-<a name="l00316"></a>00316                                 TRUE);
-<a name="l00317"></a>00317     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_ident"</span>);
-<a name="l00318"></a>00318     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00319"></a>00319     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322     <span class="keywordflow">return</span> 0;
-<a name="l00323"></a>00323 }
-<a name="l00324"></a>00324 
-<a name="l00325"></a>00325 
-<a name="l00334"></a>00334 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_exec(cpl_plugin *plugin)
-<a name="l00335"></a>00335 {
-<a name="l00336"></a>00336     cpl_recipe *recipe;
-<a name="l00337"></a>00337     
-<a name="l00338"></a>00338     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00339"></a>00339         recipe = (cpl_recipe *)plugin;
-<a name="l00340"></a>00340     <span class="keywordflow">else</span> 
-<a name="l00341"></a>00341         <span class="keywordflow">return</span> -1;
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343     <span class="keywordflow">return</span> fors_detect_spectra(recipe->parameters, recipe->frames);
-<a name="l00344"></a>00344 }
-<a name="l00345"></a>00345 
-<a name="l00346"></a>00346 
-<a name="l00355"></a>00355 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_destroy(cpl_plugin *plugin)
-<a name="l00356"></a>00356 {
-<a name="l00357"></a>00357     cpl_recipe *recipe;
-<a name="l00358"></a>00358     
-<a name="l00359"></a>00359     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00360"></a>00360         recipe = (cpl_recipe *)plugin;
-<a name="l00361"></a>00361     <span class="keywordflow">else</span> 
-<a name="l00362"></a>00362         <span class="keywordflow">return</span> -1;
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     <span class="keywordflow">return</span> 0;
-<a name="l00367"></a>00367 }
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369 
-<a name="l00379"></a>00379 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra(cpl_parameterlist *parlist, 
-<a name="l00380"></a>00380                                cpl_frameset *frameset)
-<a name="l00381"></a>00381 {
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_detect_spectra"</span>;
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386     <span class="comment">/*</span>
-<a name="l00387"></a>00387 <span class="comment">     * Input parameters</span>
-<a name="l00388"></a>00388 <span class="comment">     */</span>
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390     <span class="keywordtype">double</span>      dispersion;
-<a name="l00391"></a>00391     <span class="keywordtype">double</span>      peakdetection;
-<a name="l00392"></a>00392     <span class="keywordtype">int</span>         wdegree;
-<a name="l00393"></a>00393     <span class="keywordtype">int</span>         wradius;
-<a name="l00394"></a>00394     <span class="keywordtype">double</span>      wreject;
-<a name="l00395"></a>00395     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00396"></a>00396     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00397"></a>00397     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00398"></a>00398     <span class="keywordtype">int</span>         slit_ident;
-<a name="l00399"></a>00399 
-<a name="l00400"></a>00400     <span class="comment">/*</span>
-<a name="l00401"></a>00401 <span class="comment">     * CPL objects</span>
-<a name="l00402"></a>00402 <span class="comment">     */</span>
-<a name="l00403"></a>00403 
-<a name="l00404"></a>00404     cpl_image        *spectra     = NULL;
-<a name="l00405"></a>00405     cpl_image        *checkwave   = NULL;
-<a name="l00406"></a>00406     cpl_image        *refimage    = NULL;
-<a name="l00407"></a>00407     cpl_mask         *refmask     = NULL;
-<a name="l00408"></a>00408     cpl_table        *grism_table = NULL;
-<a name="l00409"></a>00409     cpl_table        *wavelengths = NULL;
-<a name="l00410"></a>00410     cpl_table        *slits       = NULL;
-<a name="l00411"></a>00411     cpl_table        *positions   = NULL;
-<a name="l00412"></a>00412     cpl_table        *maskslits   = NULL;
-<a name="l00413"></a>00413     cpl_vector       *lines       = NULL;
-<a name="l00414"></a>00414     cpl_propertylist *header      = NULL;
-<a name="l00415"></a>00415 
-<a name="l00416"></a>00416     <span class="comment">/*</span>
-<a name="l00417"></a>00417 <span class="comment">     * Auxiliary variables</span>
-<a name="l00418"></a>00418 <span class="comment">     */</span>
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420     <span class="keywordtype">char</span>        version[80];
-<a name="l00421"></a>00421     <span class="keyword">const</span> <span class="keywordtype">char</span> *arc_tag;
-<a name="l00422"></a>00422     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectra_detection_tag;
-<a name="l00423"></a>00423     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_map_tag;
-<a name="l00424"></a>00424     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00425"></a>00425     <span class="keywordtype">int</span>         lamp_mxu;
-<a name="l00426"></a>00426     <span class="keywordtype">int</span>         lamp_mos;
-<a name="l00427"></a>00427     <span class="keywordtype">int</span>         lamp_lss;
-<a name="l00428"></a>00428     <span class="keywordtype">int</span>         mxu, mos;
-<a name="l00429"></a>00429     <span class="keywordtype">int</span>         treat_as_lss = 0;
-<a name="l00430"></a>00430     <span class="keywordtype">int</span>         nslits;
-<a name="l00431"></a>00431     <span class="keywordtype">double</span>     *xpos;
-<a name="l00432"></a>00432     <span class="keywordtype">double</span>      mxpos;
-<a name="l00433"></a>00433     <span class="keywordtype">int</span>         narc;
-<a name="l00434"></a>00434     <span class="keywordtype">int</span>         nlines;
-<a name="l00435"></a>00435     <span class="keywordtype">int</span>         rebin;
-<a name="l00436"></a>00436     <span class="keywordtype">double</span>     *line;
-<a name="l00437"></a>00437     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00438"></a>00438     <span class="keywordtype">double</span>      reference;
-<a name="l00439"></a>00439     <span class="keywordtype">int</span>         i;
-<a name="l00440"></a>00440     <span class="keywordtype">int</span>         nslits_out_det = 0;
-<a name="l00441"></a>00441 
-<a name="l00442"></a>00442     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00443"></a>00443 
-<a name="l00444"></a>00444 
-<a name="l00445"></a>00445     cpl_msg_set_indentation(2);
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447     <span class="comment">/*</span>
-<a name="l00448"></a>00448 <span class="comment">     * Get configuration parameters</span>
-<a name="l00449"></a>00449 <span class="comment">     */</span>
-<a name="l00450"></a>00450 
-<a name="l00451"></a>00451     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00452"></a>00452     cpl_msg_indent_more();
-<a name="l00453"></a>00453     
-<a name="l00454"></a>00454     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00455"></a>00455         fors_detect_spectra_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); 
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00458"></a>00458 
-<a name="l00459"></a>00459     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00460"></a>00460                     <span class="stringliteral">"fors.fors_detect_spectra.dispersion"</span>, grism_table);
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00463"></a>00463         fors_detect_spectra_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00464"></a>00464 
-<a name="l00465"></a>00465     peakdetection = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00466"></a>00466                     <span class="stringliteral">"fors.fors_detect_spectra.peakdetection"</span>, grism_table);
-<a name="l00467"></a>00467     <span class="keywordflow">if</span> (peakdetection <= 0.0)
-<a name="l00468"></a>00468         fors_detect_spectra_exit(<span class="stringliteral">"Invalid peak detection level"</span>);
-<a name="l00469"></a>00469 
-<a name="l00470"></a>00470     wdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00471"></a>00471                     <span class="stringliteral">"fors.fors_detect_spectra.wdegree"</span>, grism_table);
-<a name="l00472"></a>00472 
-<a name="l00473"></a>00473     <span class="keywordflow">if</span> (wdegree < 1)
-<a name="l00474"></a>00474         fors_detect_spectra_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476     <span class="keywordflow">if</span> (wdegree > 5)
-<a name="l00477"></a>00477         fors_detect_spectra_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00478"></a>00478 
-<a name="l00479"></a>00479     wradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00480"></a>00480                                     <span class="stringliteral">"fors.fors_detect_spectra.wradius"</span>, NULL);
-<a name="l00481"></a>00481 
-<a name="l00482"></a>00482     <span class="keywordflow">if</span> (wradius < 0)
-<a name="l00483"></a>00483         fors_detect_spectra_exit(<span class="stringliteral">"Invalid search radius"</span>);
-<a name="l00484"></a>00484 
-<a name="l00485"></a>00485     wreject = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00486"></a>00486                                     <span class="stringliteral">"fors.fors_detect_spectra.wreject"</span>, NULL);
-<a name="l00487"></a>00487 
-<a name="l00488"></a>00488     <span class="keywordflow">if</span> (wreject <= 0.0)
-<a name="l00489"></a>00489         fors_detect_spectra_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);
-<a name="l00490"></a>00490 
-<a name="l00491"></a>00491     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00492"></a>00492                                     <span class="stringliteral">"fors.fors_detect_spectra.wcolumn"</span>, NULL);
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00495"></a>00495                     <span class="stringliteral">"fors.fors_detect_spectra.startwavelength"</span>, grism_table);
-<a name="l00496"></a>00496     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00497"></a>00497         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00498"></a>00498             fors_detect_spectra_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00501"></a>00501                     <span class="stringliteral">"fors.fors_detect_spectra.endwavelength"</span>, grism_table);
-<a name="l00502"></a>00502     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00503"></a>00503         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00504"></a>00504             fors_detect_spectra_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00505"></a>00505         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00506"></a>00506             fors_detect_spectra_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00507"></a>00507     }
-<a name="l00508"></a>00508 
-<a name="l00509"></a>00509     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00510"></a>00510         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00511"></a>00511             fors_detect_spectra_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00512"></a>00512 
-<a name="l00513"></a>00513     slit_ident = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist,
-<a name="l00514"></a>00514                     <span class="stringliteral">"fors.fors_detect_spectra.slit_ident"</span>, NULL);
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00517"></a>00517 
-<a name="l00518"></a>00518     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00519"></a>00519         fors_detect_spectra_exit(<span class="stringliteral">"Failure reading the "</span>
-<a name="l00520"></a>00520                                  <span class="stringliteral">"configuration parameters"</span>);
-<a name="l00521"></a>00521 
-<a name="l00522"></a>00522 
-<a name="l00523"></a>00523     cpl_msg_indent_less();
-<a name="l00524"></a>00524     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00525"></a>00525     cpl_msg_indent_more();
-<a name="l00526"></a>00526 
-<a name="l00527"></a>00527     narc  = lamp_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>);
-<a name="l00528"></a>00528     narc += lamp_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>);
-<a name="l00529"></a>00529     narc += lamp_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>);
-<a name="l00530"></a>00530 
-<a name="l00531"></a>00531     <span class="keywordflow">if</span> (narc == 0) {
-<a name="l00532"></a>00532         fors_detect_spectra_exit(<span class="stringliteral">"Missing input arc lamp frame"</span>);
-<a name="l00533"></a>00533     }
-<a name="l00534"></a>00534     <span class="keywordflow">if</span> (narc > 1) {
-<a name="l00535"></a>00535         cpl_msg_error(recipe, <span class="stringliteral">"Too many input arc lamp frames (%d > 1)"</span>, narc);
-<a name="l00536"></a>00536         fors_detect_spectra_exit(NULL);
-<a name="l00537"></a>00537     }
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539     mxu = mos = 0;
-<a name="l00540"></a>00540 
-<a name="l00541"></a>00541     <span class="keywordflow">if</span> (lamp_mxu) {
-<a name="l00542"></a>00542         mxu = 1;
-<a name="l00543"></a>00543         arc_tag               = <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>;
-<a name="l00544"></a>00544         spectra_detection_tag = <span class="stringliteral">"SPECTRA_DETECTION_MXU"</span>;
-<a name="l00545"></a>00545         slit_map_tag          = <span class="stringliteral">"SLIT_MAP_MXU"</span>;
-<a name="l00546"></a>00546         slit_location_tag     = <span class="stringliteral">"SLIT_LOCATION_DETECT_MXU"</span>;
-<a name="l00547"></a>00547     }
-<a name="l00548"></a>00548     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_mos) {
-<a name="l00549"></a>00549         mos = 1;
-<a name="l00550"></a>00550         arc_tag               = <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>;
-<a name="l00551"></a>00551         spectra_detection_tag = <span class="stringliteral">"SPECTRA_DETECTION_MOS"</span>;
-<a name="l00552"></a>00552         slit_map_tag          = <span class="stringliteral">"SLIT_MAP_MOS"</span>;
-<a name="l00553"></a>00553         slit_location_tag     = <span class="stringliteral">"SLIT_LOCATION_DETECT_MOS"</span>;
-<a name="l00554"></a>00554     }
-<a name="l00555"></a>00555     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_lss) {
-<a name="l00556"></a>00556         fors_detect_spectra_exit(<span class="stringliteral">"Use recipe fors_wave_calib_lss "</span>
-<a name="l00557"></a>00557                                  <span class="stringliteral">"for LSS data reduction"</span>);
-<a name="l00558"></a>00558     }
-<a name="l00559"></a>00559 
-<a name="l00560"></a>00560 
-<a name="l00561"></a>00561     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)
-<a name="l00562"></a>00562         fors_detect_spectra_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);
-<a name="l00563"></a>00563 
-<a name="l00564"></a>00564     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)
-<a name="l00565"></a>00565         fors_detect_spectra_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);
-<a name="l00566"></a>00566 
-<a name="l00567"></a>00567     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00568"></a>00568         fors_detect_spectra_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00569"></a>00569 
-<a name="l00570"></a>00570     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00571"></a>00571         fors_detect_spectra_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00572"></a>00572 
-<a name="l00573"></a>00573     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00574"></a>00574         fors_detect_spectra_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00575"></a>00575 
-<a name="l00576"></a>00576 
-<a name="l00577"></a>00577     <span class="comment">/*</span>
-<a name="l00578"></a>00578 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00579"></a>00579 <span class="comment">     * dispersion direction from the arc lamp exposure</span>
-<a name="l00580"></a>00580 <span class="comment">     */</span>
-<a name="l00581"></a>00581 
-<a name="l00582"></a>00582     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00585"></a>00585         fors_detect_spectra_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);
-<a name="l00586"></a>00586 
-<a name="l00587"></a>00587     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00588"></a>00588     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00589"></a>00589         fors_detect_spectra_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);
-<a name="l00590"></a>00590 
-<a name="l00591"></a>00591     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00592"></a>00592         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00593"></a>00593     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00594"></a>00594         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00595"></a>00595 
-<a name="l00596"></a>00596     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00597"></a>00597 
-<a name="l00598"></a>00598     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00599"></a>00599         fors_detect_spectra_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span>
-<a name="l00600"></a>00600                                  <span class="stringliteral">"in arc lamp frame header"</span>);
-<a name="l00601"></a>00601 
-<a name="l00602"></a>00602     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l00603"></a>00603         reference *= 10;
-<a name="l00604"></a>00604 
-<a name="l00605"></a>00605     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l00606"></a>00606         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l00607"></a>00607                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in arc lamp frame header"</span>,
-<a name="l00608"></a>00608                       reference);
-<a name="l00609"></a>00609         fors_detect_spectra_exit(NULL);
-<a name="l00610"></a>00610     }
-<a name="l00611"></a>00611 
-<a name="l00612"></a>00612     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l00613"></a>00613 
-<a name="l00614"></a>00614     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00617"></a>00617         fors_detect_spectra_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00618"></a>00618                                  <span class="stringliteral">"in arc lamp frame header"</span>);
-<a name="l00619"></a>00619 
-<a name="l00620"></a>00620     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l00621"></a>00621         dispersion *= rebin;
-<a name="l00622"></a>00622         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l00623"></a>00623                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,
-<a name="l00624"></a>00624                         dispersion);
-<a name="l00625"></a>00625     }
-<a name="l00626"></a>00626 
-<a name="l00627"></a>00627 
-<a name="l00628"></a>00628     cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);
-<a name="l00629"></a>00629 
-<a name="l00630"></a>00630     <span class="keywordflow">if</span> (mos)
-<a name="l00631"></a>00631         maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00632"></a>00632     <span class="keywordflow">else</span>
-<a name="l00633"></a>00633         maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00634"></a>00634 
-<a name="l00635"></a>00635     cpl_propertylist_delete(header); header = NULL;
-<a name="l00636"></a>00636 
-<a name="l00637"></a>00637 
-<a name="l00638"></a>00638     <span class="comment">/*</span>
-<a name="l00639"></a>00639 <span class="comment">     * Check if all slits have the same X offset: in such case,</span>
-<a name="l00640"></a>00640 <span class="comment">     * treat the observation as a long-slit one!</span>
-<a name="l00641"></a>00641 <span class="comment">     */</span>
-<a name="l00642"></a>00642 
-<a name="l00643"></a>00643     treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l00644"></a>00644 
-<a name="l00645"></a>00645     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00646"></a>00646         cpl_msg_error(recipe, <span class="stringliteral">"All slits have the same offset: %.2f mm\n"</span>
-<a name="l00647"></a>00647                       <span class="stringliteral">"The LSS data reduction strategy must be applied: "</span>
-<a name="l00648"></a>00648                       <span class="stringliteral">"please use recipe fors_wave_calib_lss"</span>, mxpos);
-<a name="l00649"></a>00649         fors_detect_spectra_exit(NULL);
-<a name="l00650"></a>00650     }
-<a name="l00651"></a>00651 
-<a name="l00652"></a>00652     <span class="keywordflow">if</span> (slit_ident == 0) {
-<a name="l00653"></a>00653         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00654"></a>00654     }
-<a name="l00655"></a>00655 
-<a name="l00656"></a>00656 
-<a name="l00657"></a>00657     cpl_msg_indent_less();
-<a name="l00658"></a>00658     cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);
-<a name="l00659"></a>00659     cpl_msg_indent_more();
-<a name="l00660"></a>00660 
-<a name="l00661"></a>00661     spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00662"></a>00662 
-<a name="l00663"></a>00663     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00664"></a>00664         fors_detect_spectra_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);
-<a name="l00665"></a>00665 
-<a name="l00666"></a>00666 
-<a name="l00667"></a>00667     cpl_msg_indent_less();
-<a name="l00668"></a>00668     cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);
-<a name="l00669"></a>00669     cpl_msg_indent_more();
-<a name="l00670"></a>00670 
-<a name="l00671"></a>00671     wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>, 1);
-<a name="l00672"></a>00672 
-<a name="l00673"></a>00673     <span class="keywordflow">if</span> (wavelengths == NULL)
-<a name="l00674"></a>00674         fors_detect_spectra_exit(<span class="stringliteral">"Cannot load line catalog"</span>);
-<a name="l00675"></a>00675 
-<a name="l00676"></a>00676 
-<a name="l00677"></a>00677     <span class="comment">/*</span>
-<a name="l00678"></a>00678 <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l00679"></a>00679 <span class="comment">     */</span>
-<a name="l00680"></a>00680 
-<a name="l00681"></a>00681     nlines = cpl_table_get_nrow(wavelengths);
-<a name="l00682"></a>00682 
-<a name="l00683"></a>00683     <span class="keywordflow">if</span> (nlines == 0)
-<a name="l00684"></a>00684         fors_detect_spectra_exit(<span class="stringliteral">"Empty input line catalog"</span>);
-<a name="l00685"></a>00685 
-<a name="l00686"></a>00686     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l00687"></a>00687         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,
-<a name="l00688"></a>00688                       wcolumn);
-<a name="l00689"></a>00689         fors_detect_spectra_exit(NULL);
-<a name="l00690"></a>00690     }
-<a name="l00691"></a>00691 
-<a name="l00692"></a>00692     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00693"></a>00693 
-<a name="l00694"></a>00694     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l00695"></a>00695         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l00696"></a>00696 
-<a name="l00697"></a>00697     cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l00698"></a>00698 
-<a name="l00699"></a>00699     lines = cpl_vector_wrap(nlines, line);
-<a name="l00700"></a>00700 
-<a name="l00701"></a>00701 
-<a name="l00702"></a>00702     cpl_msg_indent_less();
-<a name="l00703"></a>00703     cpl_msg_info(recipe, <span class="stringliteral">"Detecting spectra on CCD..."</span>);
-<a name="l00704"></a>00704     cpl_msg_indent_more();
-<a name="l00705"></a>00705 
-<a name="l00706"></a>00706     nx = cpl_image_get_size_x(spectra);
-<a name="l00707"></a>00707     ny = cpl_image_get_size_y(spectra);
-<a name="l00708"></a>00708 
-<a name="l00709"></a>00709     refmask = cpl_mask_new(nx, ny);
-<a name="l00710"></a>00710 
-<a name="l00711"></a>00711     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(spectra))
-<a name="l00712"></a>00712     fors_detect_spectra_exit(<span class="stringliteral">"Cannot process saturation"</span>);
-<a name="l00713"></a>00713 
-<a name="l00714"></a>00714     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(spectra))
-<a name="l00715"></a>00715     fors_detect_spectra_exit(<span class="stringliteral">"Cannot subtract the background"</span>);
-<a name="l00716"></a>00716 
-<a name="l00717"></a>00717     checkwave = <a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion,
-<a name="l00718"></a>00718                                                peakdetection, wradius,
-<a name="l00719"></a>00719                                                wdegree, wreject, reference,
-<a name="l00720"></a>00720                                                &startwavelength, &endwavelength,
-<a name="l00721"></a>00721                                                NULL, NULL, NULL, NULL, NULL,
-<a name="l00722"></a>00722                                                NULL, refmask);
-<a name="l00723"></a>00723 
-<a name="l00724"></a>00724     cpl_image_delete(spectra); spectra = NULL;
-<a name="l00725"></a>00725     cpl_vector_delete(lines); lines = NULL;
-<a name="l00726"></a>00726 
-<a name="l00727"></a>00727     <span class="keywordflow">if</span> (checkwave == NULL)
-<a name="l00728"></a>00728         fors_detect_spectra_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l00729"></a>00729 
-<a name="l00730"></a>00730 
-<a name="l00731"></a>00731     <span class="comment">/*</span>
-<a name="l00732"></a>00732 <span class="comment">     * Save check image to disk</span>
-<a name="l00733"></a>00733 <span class="comment">     */</span>
-<a name="l00734"></a>00734 
-<a name="l00735"></a>00735     header = cpl_propertylist_new();
-<a name="l00736"></a>00736     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l00737"></a>00737     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l00738"></a>00738     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l00739"></a>00739                                    startwavelength + dispersion/2);
-<a name="l00740"></a>00740     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l00741"></a>00741     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l00742"></a>00742 <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l00743"></a>00743     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l00744"></a>00744     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l00745"></a>00745     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l00746"></a>00746     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l00747"></a>00747     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l00748"></a>00748     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l00749"></a>00749 
-<a name="l00750"></a>00750     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, checkwave, spectra_detection_tag, header,
-<a name="l00751"></a>00751                        parlist, recipe, version))
-<a name="l00752"></a>00752         fors_detect_spectra_exit(NULL);
-<a name="l00753"></a>00753 
-<a name="l00754"></a>00754     cpl_image_delete(checkwave); checkwave = NULL;
-<a name="l00755"></a>00755     cpl_propertylist_delete(header); header = NULL;
-<a name="l00756"></a>00756 
-<a name="l00757"></a>00757 
-<a name="l00758"></a>00758     cpl_msg_info(recipe, <span class="stringliteral">"Locate slits at reference wavelength on CCD..."</span>);
-<a name="l00759"></a>00759     slits = <a class="code" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_spectra</a>(refmask);
-<a name="l00760"></a>00760 
-<a name="l00761"></a>00761     <span class="keywordflow">if</span> (!slits) {
-<a name="l00762"></a>00762         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l00763"></a>00763         fors_detect_spectra_exit(<span class="stringliteral">"No slits could be detected!"</span>);
-<a name="l00764"></a>00764     }
-<a name="l00765"></a>00765 
-<a name="l00766"></a>00766     refimage = cpl_image_new_from_mask(refmask);
-<a name="l00767"></a>00767     cpl_mask_delete(refmask); refmask = NULL;
-<a name="l00768"></a>00768 
-<a name="l00769"></a>00769     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l00770"></a>00770     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, refimage, slit_map_tag, header,
-<a name="l00771"></a>00771                        parlist, recipe, version))
-<a name="l00772"></a>00772         fors_detect_spectra_exit(NULL);
-<a name="l00773"></a>00773     cpl_propertylist_delete(header); header = NULL;
-<a name="l00774"></a>00774 
-<a name="l00775"></a>00775     cpl_image_delete(refimage); refimage = NULL;
-<a name="l00776"></a>00776 
-<a name="l00777"></a>00777     <span class="keywordflow">if</span> (slit_ident) {
-<a name="l00778"></a>00778 
-<a name="l00779"></a>00779         <span class="comment">/*</span>
-<a name="l00780"></a>00780 <span class="comment">         * Attempt slit identification: this recipe may continue even</span>
-<a name="l00781"></a>00781 <span class="comment">         * in case of failed identification (i.e., the position table is</span>
-<a name="l00782"></a>00782 <span class="comment">         * not produced, but an error is not set). In case of failure,</span>
-<a name="l00783"></a>00783 <span class="comment">         * the spectra would be still extracted, even if they would not</span>
-<a name="l00784"></a>00784 <span class="comment">         * be associated to slits on the mask.</span>
-<a name="l00785"></a>00785 <span class="comment">         *</span>
-<a name="l00786"></a>00786 <span class="comment">         * The reason for making the slit identification an user option</span>
-<a name="l00787"></a>00787 <span class="comment">         * (via the parameter slit_ident) is to offer the possibility</span>
-<a name="l00788"></a>00788 <span class="comment">         * to avoid identifications that are only apparently successful,</span>
-<a name="l00789"></a>00789 <span class="comment">         * as it would happen in the case of an incorrect slit description</span>
-<a name="l00790"></a>00790 <span class="comment">         * in the data header.</span>
-<a name="l00791"></a>00791 <span class="comment">         */</span>
-<a name="l00792"></a>00792 
-<a name="l00793"></a>00793         cpl_msg_indent_less();
-<a name="l00794"></a>00794         cpl_msg_info(recipe, <span class="stringliteral">"Attempt slit identification (optional)..."</span>);
-<a name="l00795"></a>00795         cpl_msg_indent_more();
-<a name="l00796"></a>00796 
-<a name="l00797"></a>00797         positions = <a class="code" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits</a>(slits, maskslits, NULL);
-<a name="l00798"></a>00798         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00799"></a>00799 
-<a name="l00800"></a>00800         <span class="keywordflow">if</span> (positions) {
-<a name="l00801"></a>00801             cpl_table_delete(slits);
-<a name="l00802"></a>00802             slits = positions;
-<a name="l00803"></a>00803 
-<a name="l00804"></a>00804             <span class="comment">/*</span>
-<a name="l00805"></a>00805 <span class="comment">             * Eliminate slits which are _entirely_ outside the CCD</span>
-<a name="l00806"></a>00806 <span class="comment">             */</span>
-<a name="l00807"></a>00807 
-<a name="l00808"></a>00808             cpl_table_and_selected_double(slits,
-<a name="l00809"></a>00809                                           <span class="stringliteral">"ybottom"</span>, CPL_GREATER_THAN, ny-1);
-<a name="l00810"></a>00810             cpl_table_or_selected_double(slits,
-<a name="l00811"></a>00811                                           <span class="stringliteral">"ytop"</span>, CPL_LESS_THAN, 0);
-<a name="l00812"></a>00812             cpl_table_erase_selected(slits);
-<a name="l00813"></a>00813 
-<a name="l00814"></a>00814             nslits = cpl_table_get_nrow(slits);
-<a name="l00815"></a>00815 
-<a name="l00816"></a>00816             <span class="keywordflow">if</span> (nslits == 0)
-<a name="l00817"></a>00817                 fors_detect_spectra_exit(<span class="stringliteral">"No slits found on the CCD"</span>);
-<a name="l00818"></a>00818 
-<a name="l00819"></a>00819             cpl_msg_info(recipe, <span class="stringliteral">"%d slits are entirely or partially "</span>
-<a name="l00820"></a>00820                          <span class="stringliteral">"contained in CCD"</span>, nslits);
-<a name="l00821"></a>00821 
-<a name="l00822"></a>00822         }
-<a name="l00823"></a>00823         <span class="keywordflow">else</span> {
-<a name="l00824"></a>00824             slit_ident = 0;
-<a name="l00825"></a>00825             cpl_msg_info(recipe, <span class="stringliteral">"Global distortion model cannot be computed"</span>);
-<a name="l00826"></a>00826             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00827"></a>00827                 fors_detect_spectra_exit(NULL);
-<a name="l00828"></a>00828             }
-<a name="l00829"></a>00829         }
-<a name="l00830"></a>00830     }
-<a name="l00831"></a>00831 
-<a name="l00832"></a>00832     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,
-<a name="l00833"></a>00833                        parlist, recipe, version))
-<a name="l00834"></a>00834         fors_detect_spectra_exit(NULL);
-<a name="l00835"></a>00835 
-<a name="l00836"></a>00836     cpl_table_delete(slits); slits = NULL;
-<a name="l00837"></a>00837 
-<a name="l00838"></a>00838     <span class="keywordflow">return</span> 0;
-<a name="l00839"></a>00839 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__detect__spectra_8c_source.html b/html/fors__detect__spectra_8c_source.html
new file mode 100644
index 0000000..53c2553
--- /dev/null
+++ b/html/fors__detect__spectra_8c_source.html
@@ -0,0 +1,852 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_detect_spectra.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_detect_spectra.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_detect_spectra.c,v 1.11 2013-10-09 15:59:38 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-09 15:59:38 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.11 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_detect_spectra_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to detect and locate MOS/MXU slit spectra on the CCD,\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"applying a pattern-matching algorithm. The input spectral exposure must\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"contain spectra with the dispersion direction approximately horizontal,\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"with blue on the left and red on the right. Use recipe fors_wave_calib_lss\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"for LSS data, or for MOS/MXU data where all slits have the same offset.\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"The rows of the input spectral exposure are processed separately, one\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"by one. First, the background continuum is removed. Second, a list of\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"positions of reference lines candidates is created. Only peaks above a\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"given threshold (specified by the parameter --peakdetection) are selected.\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"Third, the pattern-matching task selects from the found peaks the ones\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"corresponding to the reference lines, listed in the input line catalog,\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"associating them to the appropriate wavelengths. The ensuing polynomial\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"fit is used to locate the central wavelength of the applied grism along\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"each image row. The contributions from all rows form an image of the\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"location of all spectra, that can be used as a starting point for the\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"proper modeling of the optical and spectral distortions. For more details\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"on this reduction strategy please refer to the FORS Pipeline User's Manual.\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"Note that specifying an input GRISM_TABLE will set some of the recipe\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"configuration parameters to default values valid for a particular grism.\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"Again, see the pipeline manual for more details.\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS.\n\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  LAMP_UNBIAS_MXU            Calib       Bias subtracted arc     Y\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"  MASTER_LINECAT             Calib       Line catalog            Y\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"  SLIT_MAP_MXU               FITS image  Map of central wavelength on CCD\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"  SLIT_LOCATION_DETECT_MXU   FITS table  Slits positions on CCD\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"  SPECTRA_DETECTION_MXU      FITS image  Check of preliminary detection\n\n"</span>;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">#define fors_detect_spectra_exit(message)     \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_image_delete(checkwave);                  \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_image_delete(refimage);                   \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">cpl_mask_delete(refmask);                     \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">#define fors_detect_spectra_exit_memcheck(message) \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">cpl_image_delete(spectra);                      \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">printf("free checkwave (%p)\n", checkwave);     \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">cpl_image_delete(checkwave);                    \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">printf("free refimage (%p)\n", refimage);       \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">cpl_image_delete(refimage);                     \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">printf("free refmask (%p)\n", refmask);         \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">cpl_mask_delete(refmask);                       \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">cpl_table_delete(grism_table);                  \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths); \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">cpl_table_delete(wavelengths);                  \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor">cpl_table_delete(maskslits);                    \</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">cpl_table_delete(slits);                        \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">printf("free lines (%p)\n", lines);             \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">cpl_vector_delete(lines);                       \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> {</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                     <span class="stringliteral">"fors_detect_spectra"</span>,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                     <span class="stringliteral">"Detect MOS/MXU spectra on CCD"</span>,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                     fors_detect_spectra_description,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>                     fors_detect_spectra_create,</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>                     fors_detect_spectra_exec,</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>                     fors_detect_spectra_destroy);</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> }</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> {</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.dispersion"</span>,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                                 0.0);</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="comment">     * Peak detection level</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.peakdetection"</span>,</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                                 0.0);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="comment">     * Degree of wavelength calibration polynomial</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.wdegree"</span>,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                 0);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="comment">     * Reference lines search radius</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.wradius"</span>,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                                 <span class="stringliteral">"with first-guess method"</span>,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>                                 4);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.wreject"</span>,</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                                 <span class="stringliteral">"Rejection threshold in dispersion "</span></div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                                 <span class="stringliteral">"relation fit (pixel)"</span>,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                                 0.7);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> <span class="comment">     * Line catalog table column containing the reference wavelengths</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.wcolumn"</span>,</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>                                 <span class="stringliteral">"Name of line catalog table column "</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.startwavelength"</span>,</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                                 0.0);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> </div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> </div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.endwavelength"</span>,</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>                                 0.0);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> <span class="comment">     * Try slit identification</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> </div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_detect_spectra.slit_ident"</span>,</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                                 <span class="stringliteral">"Attempt slit identification for MOS or MXU"</span>,</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>                                 <span class="stringliteral">"fors.fors_detect_spectra"</span>,</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>                                 TRUE);</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_ident"</span>);</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> }</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> </div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> {</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordflow">return</span> fors_detect_spectra(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> }</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> {</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> }</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detect_spectra(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> {</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_detect_spectra"</span>;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     <span class="keywordtype">double</span>      peakdetection;</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <span class="keywordtype">int</span>         wdegree;</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordtype">int</span>         wradius;</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     <span class="keywordtype">double</span>      wreject;</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="keywordtype">int</span>         slit_ident;</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> </div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> </div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     cpl_image        *spectra     = NULL;</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     cpl_image        *checkwave   = NULL;</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     cpl_image        *refimage    = NULL;</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     cpl_mask         *refmask     = NULL;</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     cpl_table        *wavelengths = NULL;</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     cpl_table        *positions   = NULL;</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     cpl_table        *maskslits   = NULL;</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     cpl_vector       *lines       = NULL;</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> </div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *arc_tag;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectra_detection_tag;</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_map_tag;</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     <span class="keywordtype">int</span>         lamp_mxu;</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     <span class="keywordtype">int</span>         lamp_mos;</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     <span class="keywordtype">int</span>         lamp_lss;</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     <span class="keywordtype">int</span>         mos;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     <span class="keywordtype">int</span>         treat_as_lss = 0;</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     <span class="keywordtype">int</span>         nslits;</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keywordtype">int</span>         narc;</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keywordtype">int</span>         nlines;</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     <span class="keywordtype">double</span>     *line;</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <span class="keywordtype">int</span>         nslits_out_det = 0;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> </div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     </div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>         fors_detect_spectra_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> </div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> </div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>                     <span class="stringliteral">"fors.fors_detect_spectra.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span> </div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>         fors_detect_spectra_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     peakdetection = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>                     <span class="stringliteral">"fors.fors_detect_spectra.peakdetection"</span>, grism_table);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     <span class="keywordflow">if</span> (peakdetection <= 0.0)</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         fors_detect_spectra_exit(<span class="stringliteral">"Invalid peak detection level"</span>);</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> </div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     wdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>                     <span class="stringliteral">"fors.fors_detect_spectra.wdegree"</span>, grism_table);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     <span class="keywordflow">if</span> (wdegree < 1)</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         fors_detect_spectra_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="keywordflow">if</span> (wdegree > 5)</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         fors_detect_spectra_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     wradius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>                                     <span class="stringliteral">"fors.fors_detect_spectra.wradius"</span>, NULL);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> </div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     <span class="keywordflow">if</span> (wradius < 0)</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>         fors_detect_spectra_exit(<span class="stringliteral">"Invalid search radius"</span>);</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> </div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     wreject = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>                                     <span class="stringliteral">"fors.fors_detect_spectra.wreject"</span>, NULL);</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> </div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     <span class="keywordflow">if</span> (wreject <= 0.0)</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>         fors_detect_spectra_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> </div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>                                     <span class="stringliteral">"fors.fors_detect_spectra.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> </div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>                     <span class="stringliteral">"fors.fors_detect_spectra.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>             fors_detect_spectra_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span> </div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>                     <span class="stringliteral">"fors.fors_detect_spectra.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>             fors_detect_spectra_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>             fors_detect_spectra_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     }</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> </div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>             fors_detect_spectra_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     slit_ident = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist,</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                     <span class="stringliteral">"fors.fors_detect_spectra.slit_ident"</span>, NULL);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span> </div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> </div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         fors_detect_spectra_exit(<span class="stringliteral">"Failure reading the "</span></div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>                                  <span class="stringliteral">"configuration parameters"</span>);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> </div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span> </div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     narc  = lamp_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     narc += lamp_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     narc += lamp_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> </div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>     <span class="keywordflow">if</span> (narc == 0) {</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>         fors_detect_spectra_exit(<span class="stringliteral">"Missing input arc lamp frame"</span>);</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     }</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     <span class="keywordflow">if</span> (narc > 1) {</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input arc lamp frames (%d > 1)"</span>, narc);</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>         fors_detect_spectra_exit(NULL);</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     }</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> </div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     mos = 0;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span> </div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     <span class="keywordflow">if</span> (lamp_mxu) {</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>         arc_tag               = <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         spectra_detection_tag = <span class="stringliteral">"SPECTRA_DETECTION_MXU"</span>;</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>         slit_map_tag          = <span class="stringliteral">"SLIT_MAP_MXU"</span>;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>         slit_location_tag     = <span class="stringliteral">"SLIT_LOCATION_DETECT_MXU"</span>;</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     }</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_mos) {</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         mos = 1;</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         arc_tag               = <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         spectra_detection_tag = <span class="stringliteral">"SPECTRA_DETECTION_MOS"</span>;</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         slit_map_tag          = <span class="stringliteral">"SLIT_MAP_MOS"</span>;</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         slit_location_tag     = <span class="stringliteral">"SLIT_LOCATION_DETECT_MOS"</span>;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     }</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_lss) {</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>         fors_detect_spectra_exit(<span class="stringliteral">"Use recipe fors_wave_calib_lss "</span></div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>                                  <span class="stringliteral">"for LSS data reduction"</span>);</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     }</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span> </div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>         fors_detect_spectra_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> </div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>         fors_detect_spectra_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span> </div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         fors_detect_spectra_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span> </div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>         fors_detect_spectra_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span> </div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>         fors_detect_spectra_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span> </div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span> </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> <span class="comment">     * dispersion direction from the arc lamp exposure</span></div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span> </div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>         fors_detect_spectra_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span> </div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>         fors_detect_spectra_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span> </div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span> </div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> </div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         fors_detect_spectra_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span></div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>                                  <span class="stringliteral">"in arc lamp frame header"</span>);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>         reference *= 10;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span> </div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in arc lamp frame header"</span>,</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>                       reference);</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>         fors_detect_spectra_exit(NULL);</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     }</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span> </div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span> </div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         fors_detect_spectra_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>                                  <span class="stringliteral">"in arc lamp frame header"</span>);</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span> </div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>                         dispersion);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     }</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span> </div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span> </div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span> </div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>     <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>         maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>         maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> </div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span> </div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> <span class="comment">     * Check if all slits have the same X offset: in such case,</span></div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> <span class="comment">     * treat the observation as a long-slit one!</span></div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> </div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>         cpl_msg_error(recipe, <span class="stringliteral">"All slits have the same offset: %.2f mm\n"</span></div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>                       <span class="stringliteral">"The LSS data reduction strategy must be applied: "</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>                       <span class="stringliteral">"please use recipe fors_wave_calib_lss"</span>, mxpos);</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>         fors_detect_spectra_exit(NULL);</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     }</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     <span class="keywordflow">if</span> (slit_ident == 0) {</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     }</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span> </div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span> </div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> </div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span> </div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>         fors_detect_spectra_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span> </div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> </div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span> </div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>     wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>, 1);</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> </div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     <span class="keywordflow">if</span> (wavelengths == NULL)</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>         fors_detect_spectra_exit(<span class="stringliteral">"Cannot load line catalog"</span>);</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span> </div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span> </div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span> </div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>         fors_detect_spectra_exit(<span class="stringliteral">"Empty input line catalog"</span>);</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> </div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>                       wcolumn);</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>         fors_detect_spectra_exit(NULL);</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     }</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> </div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span> </div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span> </div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> </div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span> </div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>     cpl_msg_info(recipe, <span class="stringliteral">"Detecting spectra on CCD..."</span>);</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> </div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     refmask = cpl_mask_new(nx, ny);</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> </div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#ga854ead782f62a6929aade44b267353e0" title="Process saturation.">mos_saturation_process</a>(spectra))</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     fors_detect_spectra_exit(<span class="stringliteral">"Cannot process saturation"</span>);</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> </div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0" title="Subtract the background.">mos_subtract_background</a>(spectra))</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     fors_detect_spectra_exit(<span class="stringliteral">"Cannot subtract the background"</span>);</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> </div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     checkwave = <a class="code" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion,</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>                                                peakdetection, wradius,</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>                                                wdegree, wreject, reference,</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>                                                &startwavelength, &endwavelength,</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>                                                NULL, NULL, NULL, NULL, NULL,</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>                                                NULL, refmask, NULL);</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> </div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>     cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span> </div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     <span class="keywordflow">if</span> (checkwave == NULL)</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>         fors_detect_spectra_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> </div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span> </div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span> <span class="comment">     * Save check image to disk</span></div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>                                    startwavelength + dispersion/2);</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span> <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, checkwave, spectra_detection_tag, header,</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>         fors_detect_spectra_exit(NULL);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span> </div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     cpl_image_delete(checkwave); checkwave = NULL;</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span> </div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span> </div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     cpl_msg_info(recipe, <span class="stringliteral">"Locate slits at reference wavelength on CCD..."</span>);</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     slits = <a class="code" href="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900" title="Find the location of detected spectra on the CCD.">mos_locate_spectra</a>(refmask);</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span> </div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     <span class="keywordflow">if</span> (!slits) {</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>         cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>         fors_detect_spectra_exit(<span class="stringliteral">"No slits could be detected!"</span>);</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>     }</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> </div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     refimage = cpl_image_new_from_mask(refmask);</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>     cpl_mask_delete(refmask); refmask = NULL;</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span> </div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, refimage, slit_map_tag, header,</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>         fors_detect_spectra_exit(NULL);</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span> </div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     cpl_image_delete(refimage); refimage = NULL;</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     <span class="keywordflow">if</span> (slit_ident) {</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span> </div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span> <span class="comment">         * Attempt slit identification: this recipe may continue even</span></div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span> <span class="comment">         * in case of failed identification (i.e., the position table is</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> <span class="comment">         * not produced, but an error is not set). In case of failure,</span></div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> <span class="comment">         * the spectra would be still extracted, even if they would not</span></div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> <span class="comment">         * be associated to slits on the mask.</span></div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> <span class="comment">         * The reason for making the slit identification an user option</span></div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span> <span class="comment">         * (via the parameter slit_ident) is to offer the possibility</span></div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> <span class="comment">         * to avoid identifications that are only apparently successful,</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span> <span class="comment">         * as it would happen in the case of an incorrect slit description</span></div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span> <span class="comment">         * in the data header.</span></div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span> </div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>         cpl_msg_info(recipe, <span class="stringliteral">"Attempt slit identification (optional)..."</span>);</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span> </div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>         positions = <a class="code" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits</a>(slits, maskslits, NULL);</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span> </div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>         <span class="keywordflow">if</span> (positions) {</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>             cpl_table_delete(slits);</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>             slits = positions;</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> </div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span> <span class="comment">             * Eliminate slits which are _entirely_ outside the CCD</span></div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span> </div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>             cpl_table_and_selected_double(slits,</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>                                           <span class="stringliteral">"ybottom"</span>, CPL_GREATER_THAN, ny-1);</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>             cpl_table_or_selected_double(slits,</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>                                           <span class="stringliteral">"ytop"</span>, CPL_LESS_THAN, 0);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>             cpl_table_erase_selected(slits);</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span> </div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>             nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span> </div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>             <span class="keywordflow">if</span> (nslits == 0)</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>                 fors_detect_spectra_exit(<span class="stringliteral">"No slits found on the CCD"</span>);</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span> </div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>             cpl_msg_info(recipe, <span class="stringliteral">"%d slits are entirely or partially "</span></div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>                          <span class="stringliteral">"contained in CCD"</span>, nslits);</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span> </div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>         }</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>             slit_ident = 0;</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>             cpl_msg_info(recipe, <span class="stringliteral">"Global distortion model cannot be computed"</span>);</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>                 fors_detect_spectra_exit(NULL);</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>             }</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>         }</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>     }</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span> </div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>         fors_detect_spectra_exit(NULL);</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span> </div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span> </div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__detected__slits_8h_source.html b/html/fors__detected__slits_8h_source.html
new file mode 100644
index 0000000..7f03f44
--- /dev/null
+++ b/html/fors__detected__slits_8h_source.html
@@ -0,0 +1,110 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_detected_slits.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_detected_slits.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_detected_slits.h,v 1.1 2013-10-24 14:12:51 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the MOSCA library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2013 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-24 14:12:51 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.1 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef DETECTED_SLITS_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define DETECTED_SLITS_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <vector></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <string></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include "detected_slit.h"</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">namespace </span>fors</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> {</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">typedef</span> std::vector<mosca::detected_slit> detected_slits;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> detected_slits detected_slits_load_fits(<span class="keyword">const</span> std::string& fitsfile_slit_loc,</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>                                         <span class="keyword">const</span> std::string& fitsfile_curv_coeff,</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>                                         <span class="keywordtype">int</span> image_size_disp);</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> detected_slits detected_slits_from_tables(cpl_table * slit_loc,</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>                                           cpl_table * curv_coeff,</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>                                           <span class="keywordtype">int</span> image_size_disp);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> }</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__detlin_8c-source.html b/html/fors__detlin_8c-source.html
deleted file mode 100644
index 7a22800..0000000
--- a/html/fors__detlin_8c-source.html
+++ /dev/null
@@ -1,235 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_detlin.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_detlin.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_detlin.c,v 1.13 2011/10/24 13:11:17 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/24 13:11:17 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.13 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00029"></a>00029 <span class="preprocessor">#endif</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="comment">/*----------------------------------------------------------------------------</span>
-<a name="l00032"></a>00032 <span class="comment">                             Includes</span>
-<a name="l00033"></a>00033 <span class="comment"> ----------------------------------------------------------------------------*/</span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include "irplib_detmon.h"</span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include "irplib_detmon_lg.h"</span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="comment">/* Define here the DO.CATG keywords */</span>
-<a name="l00042"></a>00042 <span class="preprocessor">#define DETMON_OPT_LG_ON_RAW                    "DETECTOR_CHECK_FLAT"</span>
-<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define DETMON_OPT_LG_OFF_RAW                   "DETECTOR_CHECK_BIAS"</span>
-<a name="l00044"></a>00044 <span class="preprocessor"></span>
-<a name="l00045"></a>00045 <span class="preprocessor">#define RECIPE_NAME "fors_detlin"</span>
-<a name="l00046"></a>00046 <span class="preprocessor"></span>
-<a name="l00047"></a>00047 <span class="preprocessor">#define OPT FALSE</span>
-<a name="l00048"></a>00048 <span class="preprocessor"></span>
-<a name="l00049"></a>00049 <span class="comment">/*----------------------------------------------------------------------------</span>
-<a name="l00050"></a>00050 <span class="comment">                                Functions prototypes</span>
-<a name="l00051"></a>00051 <span class="comment"> ----------------------------------------------------------------------------*/</span>
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="keyword">static</span> cpl_error_code
-<a name="l00054"></a>00054 fors_detlin_fill_parlist(cpl_parameterlist *);
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 CPL_RECIPE_DEFINE(fors_detlin, FORS_BINARY_VERSION,
-<a name="l00057"></a>00057                   fors_detlin_fill_parlist(recipe->parameters),
-<a name="l00058"></a>00058                   <span class="stringliteral">"Lander de Bilbao"</span>, <span class="stringliteral">"lbilbao at eso.org"</span>, <span class="stringliteral">"2008"</span>, 
-<a name="l00059"></a>00059                   <span class="stringliteral">"Linearity/Gain recipe for the optical domain"</span>,
-<a name="l00060"></a>00060                   irplib_detmon_lg_get_description(<span class="stringliteral">"fors_detlin"</span>, 
-<a name="l00061"></a>00061                                                    PACKAGE_TARNAME,
-<a name="l00062"></a>00062                                                    DETMON_OPT_LG_ON_RAW,
-<a name="l00063"></a>00063                                                    DETMON_OPT_LG_OFF_RAW));
-<a name="l00064"></a>00064 
-<a name="l00065"></a>00065 <span class="comment">/*---------------------------------------------------------------------------*/</span>
-<a name="l00066"></a>00066 <span class="comment">/*</span>
-<a name="l00067"></a>00067 <span class="comment">  @brief    Interpret the command line options and execute the data processing</span>
-<a name="l00068"></a>00068 <span class="comment">  @param    frameset    the frames list</span>
-<a name="l00069"></a>00069 <span class="comment">  @param    parlist     the parameters list</span>
-<a name="l00070"></a>00070 <span class="comment">  @return   0 if everything is ok</span>
-<a name="l00071"></a>00071 <span class="comment"> */</span>
-<a name="l00072"></a>00072 <span class="comment">/*---------------------------------------------------------------------------*/</span>
-<a name="l00073"></a>00073 
-<a name="l00074"></a>00074 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detlin(cpl_frameset            *frameset,
-<a name="l00075"></a>00075                        <span class="keyword">const</span> cpl_parameterlist *parlist)
-<a name="l00076"></a>00076 {
-<a name="l00077"></a>00077     cpl_propertylist * lintbl = 
-<a name="l00078"></a>00078         irplib_detmon_fill_prolist(<span class="stringliteral">"DET_LIN_INFO"</span>, NULL, NULL, CPL_FALSE);
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080     cpl_propertylist * gaintbl = 
-<a name="l00081"></a>00081         irplib_detmon_fill_prolist(<span class="stringliteral">"GAIN_INFO"</span>,    NULL, NULL, CPL_FALSE);
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083     cpl_propertylist * coeffscube = 
-<a name="l00084"></a>00084         irplib_detmon_fill_prolist(<span class="stringliteral">"COEFFS_CUBE"</span>,  NULL, NULL, CPL_FALSE);
-<a name="l00085"></a>00085 
-<a name="l00086"></a>00086     cpl_propertylist * bpm = 
-<a name="l00087"></a>00087         irplib_detmon_fill_prolist(<span class="stringliteral">"BP_MAP_NL"</span>,    NULL, NULL, CPL_FALSE);
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089     cpl_propertylist * corr = 
-<a name="l00090"></a>00090         irplib_detmon_fill_prolist(<span class="stringliteral">"AUTOCORR"</span>,     NULL, NULL, CPL_FALSE);
-<a name="l00091"></a>00091 
-<a name="l00092"></a>00092     cpl_propertylist * diff_flat = 
-<a name="l00093"></a>00093         irplib_detmon_fill_prolist(<span class="stringliteral">"DIFF_FLAT"</span>,    NULL, NULL, CPL_FALSE);
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095     <span class="keyword">const</span> cpl_error_code error = irplib_detmon_lg(frameset,
-<a name="l00096"></a>00096                                                   parlist,
-<a name="l00097"></a>00097                                                   DETMON_OPT_LG_ON_RAW,
-<a name="l00098"></a>00098                                                   DETMON_OPT_LG_OFF_RAW,
-<a name="l00099"></a>00099                                                   RECIPE_NAME,
-<a name="l00100"></a>00100                                                   PACKAGE_TARNAME,
-<a name="l00101"></a>00101                                                   REGEXP,
-<a name="l00102"></a>00102                                                   lintbl, gaintbl, coeffscube,
-<a name="l00103"></a>00103                                                   bpm, corr, diff_flat,
-<a name="l00104"></a>00104                                                   PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,
-<a name="l00105"></a>00105                                                   NULL, NULL, OPT);
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107     cpl_propertylist_delete(lintbl);
-<a name="l00108"></a>00108     cpl_propertylist_delete(gaintbl);
-<a name="l00109"></a>00109     cpl_propertylist_delete(coeffscube);
-<a name="l00110"></a>00110     cpl_propertylist_delete(bpm);
-<a name="l00111"></a>00111     cpl_propertylist_delete(corr);
-<a name="l00112"></a>00112     cpl_propertylist_delete(diff_flat);
-<a name="l00113"></a>00113 
-<a name="l00114"></a>00114     {
-<a name="l00115"></a>00115         <span class="comment">/*</span>
-<a name="l00116"></a>00116 <span class="comment">         * This part is added until ticket DFS05711 is fixed.</span>
-<a name="l00117"></a>00117 <span class="comment">         */</span>
-<a name="l00118"></a>00118 
-<a name="l00119"></a>00119         cpl_image *chipmap;
-<a name="l00120"></a>00120         cpl_image *badpixmap;
-<a name="l00121"></a>00121         <span class="keywordtype">int</span>        llx = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parlist, 
-<a name="l00122"></a>00122                          PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".llx"</span>);
-<a name="l00123"></a>00123         <span class="keywordtype">int</span>        lly = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parlist, 
-<a name="l00124"></a>00124                          PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".lly"</span>);
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126         badpixmap = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"BP_MAP_NL"</span>, CPL_TYPE_FLOAT, 0, 1);
-<a name="l00127"></a>00127         chipmap = cpl_image_new(2048, 1024, CPL_TYPE_FLOAT);
-<a name="l00128"></a>00128         cpl_image_copy(chipmap, badpixmap, llx, lly - 5);
-<a name="l00129"></a>00129         cpl_image_delete(badpixmap);
-<a name="l00130"></a>00130         <a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, chipmap, <span class="stringliteral">"BP_MAP_NL_FULL"</span>, NULL, parlist, 
-<a name="l00131"></a>00131                        RECIPE_NAME, PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION);
-<a name="l00132"></a>00132         cpl_image_delete(chipmap);
-<a name="l00133"></a>00133     }
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     <span class="comment">/* Propagate the error, if any */</span>
-<a name="l00136"></a>00136     cpl_ensure_code(!error, error);
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00139"></a>00139 }
-<a name="l00140"></a>00140 
-<a name="l00141"></a>00141 <span class="keyword">static</span> cpl_error_code
-<a name="l00142"></a>00142 fors_detlin_fill_parlist(cpl_parameterlist * parlist)
-<a name="l00143"></a>00143 {
-<a name="l00144"></a>00144     cpl_error_code error;
-<a name="l00145"></a>00145     cpl_parameter * p;
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147     error = irplib_detmon_lg_fill_parlist_opt_default(parlist,
-<a name="l00148"></a>00148                                               <span class="stringliteral">"fors_detlin"</span>, PACKAGE_TARNAME);
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150     cpl_ensure_code(!error, error);
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152  
-<a name="l00153"></a>00153     p = cpl_parameterlist_find(parlist, 
-<a name="l00154"></a>00154                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".tolerance"</span>);
-<a name="l00155"></a>00155     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00156"></a>00156     error = cpl_parameter_set_default_double(p, 0.1);
-<a name="l00157"></a>00157     cpl_ensure_code(!error, error);
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159     p = cpl_parameterlist_find(parlist,
-<a name="l00160"></a>00160                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".pix2pix"</span>);
-<a name="l00161"></a>00161     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00162"></a>00162     error = cpl_parameter_set_default_bool(p, 1);
-<a name="l00163"></a>00163     cpl_ensure_code(!error, error);
-<a name="l00164"></a>00164 
-<a name="l00165"></a>00165     p = cpl_parameterlist_find(parlist,
-<a name="l00166"></a>00166                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".order"</span>);
-<a name="l00167"></a>00167     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00168"></a>00168     error = cpl_parameter_set_default_int(p, 2);
-<a name="l00169"></a>00169     cpl_ensure_code(!error, error);
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171     p = cpl_parameterlist_find(parlist,
-<a name="l00172"></a>00172                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".kappa"</span>);
-<a name="l00173"></a>00173     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00174"></a>00174     error = cpl_parameter_set_default_double(p, 4.0);
-<a name="l00175"></a>00175     cpl_ensure_code(!error, error);
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     p = cpl_parameterlist_find(parlist,
-<a name="l00179"></a>00179                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".llx"</span>);
-<a name="l00180"></a>00180     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00181"></a>00181     error = cpl_parameter_set_default_int(p, 1);
-<a name="l00182"></a>00182     cpl_ensure_code(!error, error);
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     p = cpl_parameterlist_find(parlist,
-<a name="l00185"></a>00185                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".urx"</span>);
-<a name="l00186"></a>00186     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00187"></a>00187     error = cpl_parameter_set_default_int(p, 2048);
-<a name="l00188"></a>00188     cpl_ensure_code(!error, error);
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191     p = cpl_parameterlist_find(parlist,
-<a name="l00192"></a>00192                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".lly"</span>);
-<a name="l00193"></a>00193     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00194"></a>00194     error = cpl_parameter_set_default_int(p, 6);
-<a name="l00195"></a>00195     cpl_ensure_code(!error, error);
-<a name="l00196"></a>00196 
-<a name="l00197"></a>00197     p = cpl_parameterlist_find(parlist,
-<a name="l00198"></a>00198                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".ury"</span>);
-<a name="l00199"></a>00199     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00200"></a>00200     error = cpl_parameter_set_default_int(p, 1029);
-<a name="l00201"></a>00201     cpl_ensure_code(!error, error);
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203 <span class="comment">/*</span>
-<a name="l00204"></a>00204 <span class="comment">    p = cpl_parameterlist_find(parlist,</span>
-<a name="l00205"></a>00205 <span class="comment">                               PACKAGE_TARNAME "." RECIPE_NAME ".method");</span>
-<a name="l00206"></a>00206 <span class="comment">    cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</span>
-<a name="l00207"></a>00207 <span class="comment">    error = cpl_parameter_set_default_string(p, "MED");</span>
-<a name="l00208"></a>00208 <span class="comment">    cpl_ensure_code(!error, error);</span>
-<a name="l00209"></a>00209 <span class="comment">*/</span>
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211     <span class="keywordflow">return</span> error;
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__detlin_8c_source.html b/html/fors__detlin_8c_source.html
new file mode 100644
index 0000000..8829b47
--- /dev/null
+++ b/html/fors__detlin_8c_source.html
@@ -0,0 +1,274 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_detlin.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_detlin.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_detlin.c,v 1.13 2011-10-24 13:11:17 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-24 13:11:17 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.13 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="comment">/*----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="comment">                             Includes</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment"> ----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include "irplib_detmon.h"</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include "irplib_detmon_lg.h"</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="comment">/* Define here the DO.CATG keywords */</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#define DETMON_OPT_LG_ON_RAW                    "DETECTOR_CHECK_FLAT"</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor"></span><span class="preprocessor">#define DETMON_OPT_LG_OFF_RAW                   "DETECTOR_CHECK_BIAS"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#define RECIPE_NAME "fors_detlin"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#define OPT FALSE</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="comment">/*----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="comment">                                Functions prototypes</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="comment"> ----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> fors_detlin_fill_parlist(cpl_parameterlist *);</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> CPL_RECIPE_DEFINE(fors_detlin, FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>                   fors_detlin_fill_parlist(recipe->parameters),</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>                   <span class="stringliteral">"Lander de Bilbao"</span>, <span class="stringliteral">"lbilbao at eso.org"</span>, <span class="stringliteral">"2008"</span>, </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>                   <span class="stringliteral">"Linearity/Gain recipe for the optical domain"</span>,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>                   irplib_detmon_lg_get_description(<span class="stringliteral">"fors_detlin"</span>, </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>                                                    PACKAGE_TARNAME,</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>                                                    DETMON_OPT_LG_ON_RAW,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>                                                    DETMON_OPT_LG_OFF_RAW));</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="comment">/*---------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="comment">  @brief    Interpret the command line options and execute the data processing</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="comment">  @param    frameset    the frames list</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="comment">  @param    parlist     the parameters list</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="comment">  @return   0 if everything is ok</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="comment">/*---------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> </div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_detlin(cpl_frameset            *frameset,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                        <span class="keyword">const</span> cpl_parameterlist *parlist)</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> {</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     cpl_propertylist * lintbl = </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>         irplib_detmon_fill_prolist(<span class="stringliteral">"DET_LIN_INFO"</span>, NULL, NULL, CPL_FALSE);</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     cpl_propertylist * gaintbl = </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>         irplib_detmon_fill_prolist(<span class="stringliteral">"GAIN_INFO"</span>,    NULL, NULL, CPL_FALSE);</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     cpl_propertylist * coeffscube = </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>         irplib_detmon_fill_prolist(<span class="stringliteral">"COEFFS_CUBE"</span>,  NULL, NULL, CPL_FALSE);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> </div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     cpl_propertylist * bpm = </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>         irplib_detmon_fill_prolist(<span class="stringliteral">"BP_MAP_NL"</span>,    NULL, NULL, CPL_FALSE);</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     cpl_propertylist * corr = </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>         irplib_detmon_fill_prolist(<span class="stringliteral">"AUTOCORR"</span>,     NULL, NULL, CPL_FALSE);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     cpl_propertylist * diff_flat = </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>         irplib_detmon_fill_prolist(<span class="stringliteral">"DIFF_FLAT"</span>,    NULL, NULL, CPL_FALSE);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keyword">const</span> cpl_error_code error = irplib_detmon_lg(frameset,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                                                   parlist,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                                                   DETMON_OPT_LG_ON_RAW,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>                                                   DETMON_OPT_LG_OFF_RAW,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>                                                   RECIPE_NAME,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                                                   PACKAGE_TARNAME,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                                                   REGEXP,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                                                   lintbl, gaintbl, coeffscube,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                                                   bpm, corr, diff_flat,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                                                   PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                                                   NULL, NULL, OPT);</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     cpl_propertylist_delete(lintbl);</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     cpl_propertylist_delete(gaintbl);</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     cpl_propertylist_delete(coeffscube);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     cpl_propertylist_delete(bpm);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_propertylist_delete(corr);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     cpl_propertylist_delete(diff_flat);</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     {</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="comment">         * This part is added until ticket DFS05711 is fixed.</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         cpl_image *chipmap;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>         cpl_image *badpixmap;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>         <span class="keywordtype">int</span>        llx = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parlist, </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                          PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".llx"</span>);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>         <span class="keywordtype">int</span>        lly = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parlist, </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                          PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".lly"</span>);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         badpixmap = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"BP_MAP_NL"</span>, CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>         chipmap = cpl_image_new(2048, 1024, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>         cpl_image_copy(chipmap, badpixmap, llx, lly - 5);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         cpl_image_delete(badpixmap);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>         <a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, chipmap, <span class="stringliteral">"BP_MAP_NL_FULL"</span>, NULL, parlist, </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                        RECIPE_NAME, PACKAGE <span class="stringliteral">"/"</span> PACKAGE_VERSION);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         cpl_image_delete(chipmap);</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     }</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="comment">/* Propagate the error, if any */</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     cpl_ensure_code(!error, error);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> }</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> fors_detlin_fill_parlist(cpl_parameterlist * parlist)</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> {</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     cpl_error_code error;</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     cpl_parameter * p;</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     error = irplib_detmon_lg_fill_parlist_opt_default(parlist,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                                               <span class="stringliteral">"fors_detlin"</span>, PACKAGE_TARNAME);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     cpl_ensure_code(!error, error);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>  </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     p = cpl_parameterlist_find(parlist, </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".tolerance"</span>);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     error = cpl_parameter_set_default_double(p, 0.1);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     cpl_ensure_code(!error, error);</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     p = cpl_parameterlist_find(parlist,</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".pix2pix"</span>);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     error = cpl_parameter_set_default_bool(p, 1);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     cpl_ensure_code(!error, error);</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     p = cpl_parameterlist_find(parlist,</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".order"</span>);</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     error = cpl_parameter_set_default_int(p, 2);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     cpl_ensure_code(!error, error);</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     p = cpl_parameterlist_find(parlist,</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".kappa"</span>);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     error = cpl_parameter_set_default_double(p, 4.0);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     cpl_ensure_code(!error, error);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     p = cpl_parameterlist_find(parlist,</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".llx"</span>);</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     error = cpl_parameter_set_default_int(p, 1);</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     cpl_ensure_code(!error, error);</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     p = cpl_parameterlist_find(parlist,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".urx"</span>);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     error = cpl_parameter_set_default_int(p, 2048);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     cpl_ensure_code(!error, error);</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     p = cpl_parameterlist_find(parlist,</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".lly"</span>);</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     error = cpl_parameter_set_default_int(p, 6);</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     cpl_ensure_code(!error, error);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     p = cpl_parameterlist_find(parlist,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                                PACKAGE_TARNAME <span class="stringliteral">"."</span> RECIPE_NAME <span class="stringliteral">".ury"</span>);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     error = cpl_parameter_set_default_int(p, 1029);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     cpl_ensure_code(!error, error);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="comment">    p = cpl_parameterlist_find(parlist,</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment">                               PACKAGE_TARNAME "." RECIPE_NAME ".method");</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="comment">    cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> <span class="comment">    error = cpl_parameter_set_default_string(p, "MED");</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="comment">    cpl_ensure_code(!error, error);</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">return</span> error;</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__dfs_8c-source.html b/html/fors__dfs_8c-source.html
deleted file mode 100644
index d708c86..0000000
--- a/html/fors__dfs_8c-source.html
+++ /dev/null
@@ -1,1476 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_dfs.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_dfs.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_dfs.c,v 1.40 2013/04/24 14:12:04 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:12:04 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.40 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include <ctype.h></span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include <string.h></span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include <unistd.h></span>
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00054"></a>00054 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00055"></a>00055 
-<a name="l00058"></a><a class="code" href="group__forsdfs.html#g0b6879dd3db31db30dd619bcbfc69d5d">00058</a> <span class="preprocessor">#define WCS_KEYS "^((CRVAL|CRPIX|CTYPE|CDELT)[0-9]|RADECSYS|CD[0-9]_[0-9])$"</span>
-<a name="l00059"></a>00059 <span class="preprocessor"></span>
-<a name="l00060"></a>00060 <span class="comment">/*------------------------------------------------------------------------------</span>
-<a name="l00061"></a>00061 <span class="comment">    Prototypes</span>
-<a name="l00062"></a>00062 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00063"></a>00063 <span class="comment">/*------------------------------------------------------------------------------</span>
-<a name="l00064"></a>00064 <span class="comment">    Implementation</span>
-<a name="l00065"></a>00065 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00068"></a>00068 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00069"></a><a class="code" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">00069</a> <span class="keyword">static</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">strlower</a>(<span class="keywordtype">char</span> *s)
-<a name="l00070"></a>00070 {
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072   <span class="keywordtype">char</span> *t = s;
-<a name="l00073"></a>00073 
-<a name="l00074"></a>00074   <span class="keywordflow">while</span> (*t) {
-<a name="l00075"></a>00075     *t = tolower(*t);
-<a name="l00076"></a>00076     t++;
-<a name="l00077"></a>00077   }
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079   <span class="keywordflow">return</span> s;
-<a name="l00080"></a>00080 
-<a name="l00081"></a>00081 }
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00084"></a>00084 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00085"></a>00085 <span class="comment">/*</span>
-<a name="l00086"></a>00086 <span class="comment"></span>
-<a name="l00087"></a>00087 <span class="comment">static char *strupper(char *s)</span>
-<a name="l00088"></a>00088 <span class="comment">{</span>
-<a name="l00089"></a>00089 <span class="comment"></span>
-<a name="l00090"></a>00090 <span class="comment">  char *t = s;</span>
-<a name="l00091"></a>00091 <span class="comment"></span>
-<a name="l00092"></a>00092 <span class="comment">  while (*t) {</span>
-<a name="l00093"></a>00093 <span class="comment">    *t = toupper(*t);</span>
-<a name="l00094"></a>00094 <span class="comment">    t++;</span>
-<a name="l00095"></a>00095 <span class="comment">  }</span>
-<a name="l00096"></a>00096 <span class="comment">  </span>
-<a name="l00097"></a>00097 <span class="comment">  return s;</span>
-<a name="l00098"></a>00098 <span class="comment"></span>
-<a name="l00099"></a>00099 <span class="comment">}</span>
-<a name="l00100"></a>00100 <span class="comment"></span>
-<a name="l00101"></a>00101 <span class="comment">*/</span>
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00104"></a>00104 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00105"></a><a class="code" href="group__forsdfs.html#g34ac001c0471b1dc6dab4a0a38b7c4a2">00105</a> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#g34ac001c0471b1dc6dab4a0a38b7c4a2">dfs_generate_filename</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *category)
-<a name="l00106"></a>00106 {
-<a name="l00107"></a>00107     <span class="keywordtype">char</span> *filename = cpl_calloc(strlen(category) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l00108"></a>00108 
-<a name="l00109"></a>00109     <a class="code" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">strlower</a>(strcpy(filename, category));
-<a name="l00110"></a>00110     strcat(filename, <span class="stringliteral">".fits"</span>);
-<a name="l00111"></a>00111 
-<a name="l00112"></a>00112     <span class="keywordflow">return</span> filename;
-<a name="l00113"></a>00113 }
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00116"></a>00116 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00117"></a><a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">00117</a> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *category)
-<a name="l00118"></a>00118 {
-<a name="l00119"></a>00119     <span class="comment">/*</span>
-<a name="l00120"></a>00120 <span class="comment">    char *filename = cpl_calloc(strlen(category) + 7, sizeof(char));</span>
-<a name="l00121"></a>00121 <span class="comment">    */</span>
-<a name="l00122"></a>00122     <span class="keywordtype">char</span> *filename = cpl_calloc(strlen(category) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124     <a class="code" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">strlower</a>(strcpy(filename, category));
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126     <span class="comment">/*</span>
-<a name="l00127"></a>00127 <span class="comment">    strcat(filename, ".tfits");</span>
-<a name="l00128"></a>00128 <span class="comment">    */</span>
-<a name="l00129"></a>00129     strcat(filename, <span class="stringliteral">".fits"</span>);
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131     <span class="keywordflow">return</span> filename;
-<a name="l00132"></a>00132 }
-<a name="l00133"></a>00133 
-<a name="l00134"></a>00134 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00145"></a>00145 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00146"></a>00146 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00147"></a><a class="code" href="group__forsdfs.html#g8479954471cd14e92ec92efce09ec87b">00147</a> <a class="code" href="group__forsdfs.html#g8479954471cd14e92ec92efce09ec87b">errorstate_dump_one</a>(<span class="keywordtype">unsigned</span> <span class="keyword">self</span>, <span class="keywordtype">unsigned</span> first, <span class="keywordtype">unsigned</span> last)
-<a name="l00148"></a>00148 {
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150     <span class="keyword">const</span> cpl_boolean is_reverse = first > last ? CPL_TRUE : CPL_FALSE;
-<a name="l00151"></a>00151     <span class="keyword">const</span> <span class="keywordtype">unsigned</span>    newest     = is_reverse ? first : last;
-<a name="l00152"></a>00152     <span class="keyword">const</span> <span class="keywordtype">unsigned</span>    oldest     = is_reverse ? last : first;
-<a name="l00153"></a>00153     <span class="keyword">const</span> <span class="keywordtype">char</span>      * revmsg     = is_reverse ? <span class="stringliteral">" in reverse order"</span> : <span class="stringliteral">""</span>;
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     <span class="comment">/* Cannot use internal CPL functions</span>
-<a name="l00156"></a>00156 <span class="comment">       cx_assert( oldest <= self );</span>
-<a name="l00157"></a>00157 <span class="comment">       cx_assert( newest >= self ); */</span>
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159     <span class="keywordflow">if</span> (newest == 0) {
-<a name="l00160"></a>00160         cpl_msg_info(cpl_func, <span class="stringliteral">"No error(s) to dump"</span>);
-<a name="l00161"></a>00161         <span class="comment">/* cx_assert( oldest == 0); */</span>
-<a name="l00162"></a>00162     } <span class="keywordflow">else</span> {
-<a name="l00163"></a>00163         <span class="comment">/*  cx_assert( oldest > 0);</span>
-<a name="l00164"></a>00164 <span class="comment">            cx_assert( newest >= oldest); */</span>
-<a name="l00165"></a>00165         <span class="keywordflow">if</span> (<span class="keyword">self</span> == first) {
-<a name="l00166"></a>00166             <span class="keywordflow">if</span> (oldest == 1) {
-<a name="l00167"></a>00167                 cpl_msg_debug(cpl_func, <span class="stringliteral">"Dumping all %u error(s)%s:"</span>, newest,
-<a name="l00168"></a>00168                               revmsg);
-<a name="l00169"></a>00169             } <span class="keywordflow">else</span> {
-<a name="l00170"></a>00170                 cpl_msg_error(cpl_func, <span class="stringliteral">"Dumping the %u most recent error(s) "</span>
-<a name="l00171"></a>00171                               <span class="stringliteral">"out of a total of %u errors%s:"</span>,
-<a name="l00172"></a>00172                               newest - oldest + 1, newest, revmsg);
-<a name="l00173"></a>00173             }
-<a name="l00174"></a>00174         }
-<a name="l00175"></a>00175 
-<a name="l00176"></a>00176         <span class="keyword">const</span> <span class="keywordtype">char</span> *message_from_cpl = cpl_error_get_message();
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178         <span class="keywordflow">if</span> (message_from_cpl == NULL) {
-<a name="l00179"></a>00179             <span class="comment">/* This should never happen */</span>
-<a name="l00180"></a>00180             cpl_msg_error(cpl_func, <span class="stringliteral">"Unspecified error"</span>);
-<a name="l00181"></a>00181         }
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183         <span class="comment">/* Skip the standard (non-informative) CPL message string, </span>
-<a name="l00184"></a>00184 <span class="comment">           which usually terminates with ': '</span>
-<a name="l00185"></a>00185 <span class="comment"></span>
-<a name="l00186"></a>00186 <span class="comment">           If no user-defined error message is given, </span>
-<a name="l00187"></a>00187 <span class="comment">           print the CPL standard message</span>
-<a name="l00188"></a>00188 <span class="comment">        */</span>
-<a name="l00189"></a>00189         <span class="keywordflow">while</span> (*message_from_cpl != <span class="charliteral">'\0'</span> && *message_from_cpl != <span class="charliteral">':'</span>) {
-<a name="l00190"></a>00190             message_from_cpl += 1;
-<a name="l00191"></a>00191         }
-<a name="l00192"></a>00192         
-<a name="l00193"></a>00193         <span class="keywordflow">if</span> (*message_from_cpl != <span class="charliteral">'\0'</span>) {
-<a name="l00194"></a>00194             message_from_cpl += 1;
-<a name="l00195"></a>00195             
-<a name="l00196"></a>00196             <span class="keywordflow">if</span> (*message_from_cpl == <span class="charliteral">' '</span>) message_from_cpl++;
-<a name="l00197"></a>00197             
-<a name="l00198"></a>00198             <span class="keywordflow">if</span> (*message_from_cpl != <span class="charliteral">'\0'</span>) {
-<a name="l00199"></a>00199                 <span class="comment">/* Still something left of the string */</span>
-<a name="l00200"></a>00200                 cpl_msg_error(cpl_func, <span class="stringliteral">"%s [%s]"</span>, message_from_cpl,
-<a name="l00201"></a>00201                               cpl_error_get_where());
-<a name="l00202"></a>00202             }
-<a name="l00203"></a>00203             <span class="keywordflow">else</span> {
-<a name="l00204"></a>00204                 cpl_msg_error(cpl_func, <span class="stringliteral">"%s [%s]"</span>,
-<a name="l00205"></a>00205                               cpl_error_get_message(), cpl_error_get_where());
-<a name="l00206"></a>00206         }
-<a name="l00207"></a>00207         }
-<a name="l00208"></a>00208         <span class="keywordflow">else</span> {
-<a name="l00209"></a>00209             <span class="comment">/* Found no ':' is CPL message string */</span>
-<a name="l00210"></a>00210             cpl_msg_error(cpl_func, <span class="stringliteral">"%s [%s]"</span>,
-<a name="l00211"></a>00211                           cpl_error_get_message(), cpl_error_get_where());
-<a name="l00212"></a>00212         }
-<a name="l00213"></a>00213     }
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215     <span class="keywordflow">return</span>;
-<a name="l00216"></a>00216 }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218 
-<a name="l00219"></a>00219 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00229"></a>00229 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00230"></a><a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">00230</a> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a>(cpl_frameset *frames,
-<a name="l00231"></a>00231         <span class="keyword">const</span> <span class="keywordtype">char</span> *description_short)
-<a name="l00232"></a>00232 {
-<a name="l00233"></a>00233     cpl_msg_info(cpl_func, <span class="stringliteral">"%s"</span>, PACKAGE_STRING);   
-<a name="l00234"></a>00234     cpl_msg_info(cpl_func, <span class="stringliteral">"%s"</span>, description_short);
-<a name="l00235"></a>00235     
-<a name="l00236"></a>00236     <a class="code" href="group__forsdfs.html#g37d74636b6c3f3d52b0312ce3a58e59d">fors_dfs_set_groups</a>(frames);
-<a name="l00237"></a>00237     cpl_msg_info(cpl_func, <span class="stringliteral">"Input frame%s:"</span>, 
-<a name="l00238"></a>00238                  cpl_frameset_get_size(frames) != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>);
-<a name="l00239"></a>00239     <a class="code" href="group__fors__utils.html#gc1181b0023db290ca5bfc42e9980e3a8">fors_frameset_print</a>(frames);
-<a name="l00240"></a>00240     
-<a name="l00241"></a>00241     <span class="keywordflow">return</span>;
-<a name="l00242"></a>00242 }
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00257"></a>00257 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00258"></a><a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">00258</a> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a>(<span class="keyword">const</span> cpl_frameset *frames, cpl_errorstate before_exec)
-<a name="l00259"></a>00259 {
-<a name="l00260"></a>00260     <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_NONE) {
-<a name="l00261"></a>00261         
-<a name="l00262"></a>00262         <span class="keyword">const</span> cpl_frame *f;
-<a name="l00263"></a>00263         
-<a name="l00264"></a>00264         cpl_msg_info(cpl_func, <span class="stringliteral">"Product frame%s:"</span>, 
-<a name="l00265"></a>00265                      cpl_frameset_get_size(frames) != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>);
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267         <span class="keywordflow">for</span> (f = cpl_frameset_get_first_const(frames);
-<a name="l00268"></a>00268              f != NULL;
-<a name="l00269"></a>00269              f = cpl_frameset_get_next_const(frames)) {
-<a name="l00270"></a>00270             <span class="keywordflow">if</span> (cpl_frame_get_group(f) == CPL_FRAME_GROUP_PRODUCT) {
-<a name="l00271"></a>00271                 <a class="code" href="group__fors__utils.html#g375049f68639265267adcdc11d161bc3">fors_frame_print</a>(f);
-<a name="l00272"></a>00272             }
-<a name="l00273"></a>00273         }
-<a name="l00274"></a>00274         
-<a name="l00275"></a>00275         <span class="comment">/* Shut up EsoRex */</span>
-<a name="l00276"></a>00276         <span class="comment">//cpl_msg_set_level(CPL_MSG_WARNING);</span>
-<a name="l00277"></a>00277         <span class="keywordflow">return</span> 0;
-<a name="l00278"></a>00278     }
-<a name="l00279"></a>00279     <span class="keywordflow">else</span> {
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281         cpl_errorstate_dump(before_exec, CPL_FALSE, <a class="code" href="group__forsdfs.html#g8479954471cd14e92ec92efce09ec87b">errorstate_dump_one</a>);
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283         <span class="keywordflow">return</span> 1;
-<a name="l00284"></a>00284     }
-<a name="l00285"></a>00285 }
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287 <span class="preprocessor">#undef cleanup</span>
-<a name="l00288"></a>00288 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00289"></a>00289 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00294"></a>00294 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00295"></a>00295 <span class="keywordtype">void</span>
-<a name="l00296"></a><a class="code" href="group__forsdfs.html#g37d74636b6c3f3d52b0312ce3a58e59d">00296</a> <a class="code" href="group__forsdfs.html#g37d74636b6c3f3d52b0312ce3a58e59d">fors_dfs_set_groups</a>(cpl_frameset * set)
-<a name="l00297"></a>00297 {
-<a name="l00298"></a>00298     cpl_frame *f;
-<a name="l00299"></a>00299     
-<a name="l00300"></a>00300     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( set != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00301"></a>00301     
-<a name="l00302"></a>00302     <span class="keywordflow">for</span> (f = cpl_frameset_get_first(set);
-<a name="l00303"></a>00303          f != NULL;
-<a name="l00304"></a>00304          f = cpl_frameset_get_next(set)) {
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306         <span class="keyword">const</span> <span class="keywordtype">char</span> *tag = cpl_frame_get_tag(f);
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308         <span class="keywordflow">if</span> (tag != NULL) {
-<a name="l00309"></a>00309             <span class="keywordflow">if</span> (strcmp(tag, BIAS              ) == 0 ||
-<a name="l00310"></a>00310                 strcmp(tag, DARK              ) == 0 ||
-<a name="l00311"></a>00311                 strcmp(tag, SCREEN_FLAT_IMG   ) == 0 ||
-<a name="l00312"></a>00312                 strcmp(tag, SKY_FLAT_IMG      ) == 0 ||
-<a name="l00313"></a>00313                 strcmp(tag, STANDARD_IMG      ) == 0 ||
-<a name="l00314"></a>00314                 strcmp(tag, <span class="stringliteral">"LAMP_PMOS"</span>       ) == 0 ||
-<a name="l00315"></a>00315                 strcmp(tag, <span class="stringliteral">"SCREEN_FLAT_PMOS"</span>) == 0 ||
-<a name="l00316"></a>00316                 strcmp(tag, <span class="stringliteral">"STANDARD_PMOS"</span>   ) == 0 ||
-<a name="l00317"></a>00317                 strcmp(tag, <span class="stringliteral">"SCIENCE_PMOS"</span>    ) == 0 ||
-<a name="l00318"></a>00318                 strcmp(tag, SCIENCE_IMG       ) == 0 ) {
-<a name="l00319"></a>00319                 cpl_frame_set_group(f, CPL_FRAME_GROUP_RAW);
-<a name="l00320"></a>00320             }
-<a name="l00321"></a>00321             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(tag, MASTER_BIAS                    ) == 0 ||
-<a name="l00322"></a>00322                      strcmp(tag, MASTER_DARK                    ) == 0 ||
-<a name="l00323"></a>00323                      strcmp(tag, MASTER_SCREEN_FLAT_IMG         ) == 0 ||
-<a name="l00324"></a>00324                      strcmp(tag, MASTER_SKY_FLAT_IMG            ) == 0 ||
-<a name="l00325"></a>00325                      strcmp(tag, ALIGNED_PHOT                   ) == 0 ||
-<a name="l00326"></a>00326                      strcmp(tag, <span class="stringliteral">"MASTER_NORM_FLAT_PMOS"</span>        ) == 0 ||
-<a name="l00327"></a>00327                      strcmp(tag, <span class="stringliteral">"DISP_COEFF_PMOS"</span>              ) == 0 ||
-<a name="l00328"></a>00328                      strcmp(tag, <span class="stringliteral">"CURV_COEFF_PMOS"</span>              ) == 0 ||
-<a name="l00329"></a>00329                      strcmp(tag, <span class="stringliteral">"SLIT_LOCATION_PMOS"</span>           ) == 0 ||
-<a name="l00330"></a>00330                      <span class="comment">/* static calibration */</span>
-<a name="l00331"></a>00331                      strcmp(tag, FLX_STD_IMG                    ) == 0 ||
-<a name="l00332"></a>00332                      strcmp(tag, <span class="stringliteral">"MASTER_LINECAT"</span>               ) == 0 ||
-<a name="l00333"></a>00333                      strcmp(tag, <span class="stringliteral">"MASTER_DISTORTION_TABLE"</span>      ) == 0 ||
-<a name="l00334"></a>00334                      strcmp(tag, <span class="stringliteral">"RETARDER_WAVEPLATE_CHROMATISM"</span>) == 0 ||
-<a name="l00335"></a>00335                      strcmp(tag, <span class="stringliteral">"GRISM_TABLE"</span>                  ) == 0 ||
-<a name="l00336"></a>00336                      strcmp(tag, <span class="stringliteral">"STD_PMOS_TABLE"</span>               ) == 0 ||
-<a name="l00337"></a>00337                      strcmp(tag, PHOT_TABLE                     ) == 0) {
-<a name="l00338"></a>00338                 cpl_frame_set_group(f, CPL_FRAME_GROUP_CALIB);
-<a name="l00339"></a>00339             }
-<a name="l00340"></a>00340             <span class="keywordflow">else</span> {
-<a name="l00341"></a>00341                 cpl_msg_warning(cpl_func, <span class="stringliteral">"Unrecognized frame tag: '%s'"</span>,
-<a name="l00342"></a>00342                                 tag);
-<a name="l00343"></a>00343             }
-<a name="l00344"></a>00344         }
-<a name="l00345"></a>00345     }
-<a name="l00346"></a>00346     
-<a name="l00347"></a>00347     <span class="keywordflow">return</span>;
-<a name="l00348"></a>00348 }
-<a name="l00349"></a>00349 
-<a name="l00350"></a>00350 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00351"></a>00351 <span class="preprocessor">#undef cleanup</span>
-<a name="l00352"></a>00352 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00353"></a>00353 <span class="preprocessor"></span>
-<a name="l00361"></a>00361 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00362"></a>00362 <span class="keyword">const</span> <span class="keywordtype">char</span> *
-<a name="l00363"></a><a class="code" href="group__forsdfs.html#g61956e9dcf77f5c71db911e0390f63f3">00363</a> <a class="code" href="group__forsdfs.html#g61956e9dcf77f5c71db911e0390f63f3">fors_dfs_pipeline_version</a>(<span class="keyword">const</span> cpl_propertylist *header, 
-<a name="l00364"></a>00364                           <span class="keyword">const</span> <span class="keywordtype">char</span> **instrument_version)
-<a name="l00365"></a>00365 {
-<a name="l00366"></a>00366     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00367"></a>00367     
-<a name="l00368"></a>00368     instrume = cpl_propertylist_get_string(header, 
-<a name="l00369"></a>00369                                            <a class="code" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">FORS_PFITS_INSTRUME</a>);
-<a name="l00370"></a>00370     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,
-<a name="l00371"></a>00371             <span class="stringliteral">"Missing keyword %s in input header"</span>, <a class="code" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">FORS_PFITS_INSTRUME</a>);
-<a name="l00372"></a>00372     
-<a name="l00373"></a>00373     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( strlen(instrume) >= 5, <span class="keywordflow">return</span> NULL,
-<a name="l00374"></a>00374             <span class="stringliteral">"%s keyword must be 'fors1' or 'fors2', not '%s'"</span>, 
-<a name="l00375"></a>00375             <a class="code" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">FORS_PFITS_INSTRUME</a>, instrume);
-<a name="l00376"></a>00376 
-<a name="l00377"></a>00377     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( instrume[4] == <span class="charliteral">'1'</span> || instrume[4] == <span class="charliteral">'2'</span>, <span class="keywordflow">return</span> NULL,
-<a name="l00378"></a>00378             <span class="stringliteral">"Unrecognized %s: %s"</span>, <a class="code" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">FORS_PFITS_INSTRUME</a>, instrume);
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     <span class="keywordflow">if</span> (instrument_version != NULL) {
-<a name="l00381"></a>00381         *instrument_version = cpl_sprintf(<span class="stringliteral">"%s"</span>, instrume);
-<a name="l00382"></a>00382     }
-<a name="l00383"></a>00383     
-<a name="l00384"></a>00384     <span class="keywordflow">return</span> cpl_sprintf(<span class="stringliteral">"fors%c/%s"</span>, instrume[4], VERSION);
-<a name="l00385"></a>00385 }
-<a name="l00386"></a>00386 
-<a name="l00387"></a>00387 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00409"></a>00409 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00410"></a><a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">00410</a> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name,
-<a name="l00411"></a>00411                           <span class="keyword">const</span> cpl_table *defaults)
-<a name="l00412"></a>00412 {
-<a name="l00413"></a>00413     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_get_parameter_int"</span>;
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     <span class="keyword">const</span> <span class="keywordtype">char</span>    *alias;
-<a name="l00416"></a>00416     cpl_parameter *param;
-<a name="l00417"></a>00417 
-<a name="l00418"></a>00418 
-<a name="l00419"></a>00419     <span class="keywordflow">if</span> (parlist == NULL) {
-<a name="l00420"></a>00420         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter list"</span>);
-<a name="l00421"></a>00421         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l00422"></a>00422         <span class="keywordflow">return</span> 0;
-<a name="l00423"></a>00423     }
-<a name="l00424"></a>00424 
-<a name="l00425"></a>00425     <span class="keywordflow">if</span> (name == NULL) {
-<a name="l00426"></a>00426         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter name"</span>);
-<a name="l00427"></a>00427         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l00428"></a>00428         <span class="keywordflow">return</span> 0;
-<a name="l00429"></a>00429     }
-<a name="l00430"></a>00430 
-<a name="l00431"></a>00431     param = cpl_parameterlist_find(parlist, name);
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433     <span class="keywordflow">if</span> (param == NULL) {
-<a name="l00434"></a>00434         cpl_msg_error(func, <span class="stringliteral">"Wrong parameter name: %s"</span>, name);
-<a name="l00435"></a>00435         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00436"></a>00436         <span class="keywordflow">return</span> 0;
-<a name="l00437"></a>00437     }
-<a name="l00438"></a>00438 
-<a name="l00439"></a>00439     <span class="keywordflow">if</span> (cpl_parameter_get_type(param) != CPL_TYPE_INT) {
-<a name="l00440"></a>00440         cpl_msg_error(func, <span class="stringliteral">"Unexpected type for parameter "</span>
-<a name="l00441"></a>00441                       <span class="stringliteral">"\"%s\": it should be integer"</span>, name);
-<a name="l00442"></a>00442         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l00443"></a>00443         <span class="keywordflow">return</span> 0;
-<a name="l00444"></a>00444     }
-<a name="l00445"></a>00445 
-<a name="l00446"></a>00446     alias = cpl_parameter_get_alias(param, CPL_PARAMETER_MODE_CLI);
-<a name="l00447"></a>00447 
-<a name="l00448"></a>00448 <span class="comment">//    if (defaults && cpl_parameter_get_default_flag(param) == 0) {</span>
-<a name="l00449"></a>00449     <span class="keywordflow">if</span> (defaults && 
-<a name="l00450"></a>00450         cpl_parameter_get_default_int(param) == cpl_parameter_get_int(param)) {
-<a name="l00451"></a>00451     
-<a name="l00452"></a>00452         <span class="keywordflow">if</span> (cpl_table_has_column(defaults, alias)) {
-<a name="l00453"></a>00453             <span class="keywordflow">if</span> (cpl_table_get_column_type(defaults, alias) != CPL_TYPE_INT) {
-<a name="l00454"></a>00454                 cpl_msg_error(func, <span class="stringliteral">"Unexpected type for GRISM_TABLE "</span>
-<a name="l00455"></a>00455                               <span class="stringliteral">"column \"%s\": it should be integer"</span>, alias);
-<a name="l00456"></a>00456                 cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l00457"></a>00457                 <span class="keywordflow">return</span> 0;
-<a name="l00458"></a>00458             }
-<a name="l00459"></a>00459             <span class="keywordflow">if</span> (cpl_table_is_valid(defaults, alias, 0)) {
-<a name="l00460"></a>00460                 cpl_parameter_set_int(param, cpl_table_get_int(defaults, 
-<a name="l00461"></a>00461                                                                alias, 0, NULL));
-<a name="l00462"></a>00462             }
-<a name="l00463"></a>00463             <span class="keywordflow">else</span> {
-<a name="l00464"></a>00464                 cpl_msg_error(func, <span class="stringliteral">"Invalid parameter value in table "</span>
-<a name="l00465"></a>00465                               <span class="stringliteral">"column \"%s\""</span>, alias);
-<a name="l00466"></a>00466                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00467"></a>00467                 <span class="keywordflow">return</span> 0;
-<a name="l00468"></a>00468             }
-<a name="l00469"></a>00469         }
-<a name="l00470"></a>00470         <span class="keywordflow">else</span> {
-<a name="l00471"></a>00471             cpl_msg_warning(func, <span class="stringliteral">"Parameter \"%s\" not found in GRISM_TABLE "</span>
-<a name="l00472"></a>00472                             <span class="stringliteral">"- using recipe default"</span>, alias);
-<a name="l00473"></a>00473         }
-<a name="l00474"></a>00474     }
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476     cpl_msg_info(func, <span class="stringliteral">"%s:"</span>, alias);
-<a name="l00477"></a>00477     cpl_msg_info(func, <span class="stringliteral">"%s: %d"</span>,
-<a name="l00478"></a>00478                  cpl_parameter_get_help(param), cpl_parameter_get_int(param));
-<a name="l00479"></a>00479 
-<a name="l00480"></a>00480     <span class="keywordflow">return</span> cpl_parameter_get_int(param);
-<a name="l00481"></a>00481 
-<a name="l00482"></a>00482 }
-<a name="l00483"></a>00483 
-<a name="l00484"></a>00484 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00506"></a>00506 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00507"></a><a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">00507</a> <span class="keywordtype">double</span> <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(cpl_parameterlist *parlist, 
-<a name="l00508"></a>00508                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> cpl_table *defaults)
-<a name="l00509"></a>00509 {
-<a name="l00510"></a>00510     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_get_parameter_double"</span>;
-<a name="l00511"></a>00511 
-<a name="l00512"></a>00512     <span class="keyword">const</span> <span class="keywordtype">char</span>    *alias;
-<a name="l00513"></a>00513     cpl_parameter *param;
-<a name="l00514"></a>00514 
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516     <span class="keywordflow">if</span> (parlist == NULL) {
-<a name="l00517"></a>00517         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter list"</span>);
-<a name="l00518"></a>00518         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l00519"></a>00519         <span class="keywordflow">return</span> 0;
-<a name="l00520"></a>00520     }
-<a name="l00521"></a>00521 
-<a name="l00522"></a>00522     <span class="keywordflow">if</span> (name == NULL) {
-<a name="l00523"></a>00523         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter name"</span>);
-<a name="l00524"></a>00524         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l00525"></a>00525         <span class="keywordflow">return</span> 0;
-<a name="l00526"></a>00526     }
-<a name="l00527"></a>00527 
-<a name="l00528"></a>00528     param = cpl_parameterlist_find(parlist, name);
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530     <span class="keywordflow">if</span> (param == NULL) {
-<a name="l00531"></a>00531         cpl_msg_error(func, <span class="stringliteral">"Wrong parameter name: %s"</span>, name);
-<a name="l00532"></a>00532         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00533"></a>00533         <span class="keywordflow">return</span> 0;
-<a name="l00534"></a>00534     }
-<a name="l00535"></a>00535 
-<a name="l00536"></a>00536     <span class="keywordflow">if</span> (cpl_parameter_get_type(param) != CPL_TYPE_DOUBLE) {
-<a name="l00537"></a>00537         cpl_msg_error(func, <span class="stringliteral">"Unexpected type for parameter "</span>
-<a name="l00538"></a>00538                       <span class="stringliteral">"\"%s\": it should be double"</span>, name);
-<a name="l00539"></a>00539         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l00540"></a>00540         <span class="keywordflow">return</span> 0;
-<a name="l00541"></a>00541     }
-<a name="l00542"></a>00542 
-<a name="l00543"></a>00543     alias = cpl_parameter_get_alias(param, CPL_PARAMETER_MODE_CLI);
-<a name="l00544"></a>00544 
-<a name="l00545"></a>00545 <span class="comment">//    if (defaults && cpl_parameter_get_default_flag(param) == 0) {</span>
-<a name="l00546"></a>00546     <span class="keywordflow">if</span> (defaults && 
-<a name="l00547"></a>00547         cpl_parameter_get_default_double(param) == 
-<a name="l00548"></a>00548         cpl_parameter_get_double(param)) {
-<a name="l00549"></a>00549     
-<a name="l00550"></a>00550         <span class="keywordflow">if</span> (cpl_table_has_column(defaults, alias)) {
-<a name="l00551"></a>00551             <span class="keywordflow">if</span> (cpl_table_get_column_type(defaults, alias) != CPL_TYPE_DOUBLE) {
-<a name="l00552"></a>00552                 cpl_msg_error(func, <span class="stringliteral">"Unexpected type for GRISM_TABL "</span>
-<a name="l00553"></a>00553                               <span class="stringliteral">"column \"%s\": it should be double"</span>, alias);
-<a name="l00554"></a>00554                 cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l00555"></a>00555                 <span class="keywordflow">return</span> 0;
-<a name="l00556"></a>00556             }
-<a name="l00557"></a>00557             <span class="keywordflow">if</span> (cpl_table_is_valid(defaults, alias, 0)) {
-<a name="l00558"></a>00558                 cpl_parameter_set_double(param, cpl_table_get_double(defaults, 
-<a name="l00559"></a>00559                                                                alias, 0, NULL));
-<a name="l00560"></a>00560             }
-<a name="l00561"></a>00561             <span class="keywordflow">else</span> {
-<a name="l00562"></a>00562                 cpl_msg_error(func, <span class="stringliteral">"Invalid parameter value in table "</span>
-<a name="l00563"></a>00563                               <span class="stringliteral">"column \"%s\""</span>, alias);
-<a name="l00564"></a>00564                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00565"></a>00565                 <span class="keywordflow">return</span> 0;
-<a name="l00566"></a>00566             }
-<a name="l00567"></a>00567         }
-<a name="l00568"></a>00568         <span class="keywordflow">else</span> {
-<a name="l00569"></a>00569             cpl_msg_warning(func, <span class="stringliteral">"Parameter \"%s\" not found in GRISM_TABLE "</span>
-<a name="l00570"></a>00570                             <span class="stringliteral">"- using recipe default"</span>, alias);
-<a name="l00571"></a>00571         }
-<a name="l00572"></a>00572     }
-<a name="l00573"></a>00573 
-<a name="l00574"></a>00574     cpl_msg_info(func, <span class="stringliteral">"%s:"</span>, alias);
-<a name="l00575"></a>00575     cpl_msg_info(func, <span class="stringliteral">"%s: %f"</span>,
-<a name="l00576"></a>00576                  cpl_parameter_get_help(param), cpl_parameter_get_double(param));
-<a name="l00577"></a>00577 
-<a name="l00578"></a>00578     <span class="keywordflow">return</span> cpl_parameter_get_double(param);
-<a name="l00579"></a>00579 
-<a name="l00580"></a>00580 }
-<a name="l00581"></a>00581 
-<a name="l00582"></a>00582 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00604"></a>00604 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00605"></a><a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">00605</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(cpl_parameterlist *parlist, 
-<a name="l00606"></a>00606                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *name, 
-<a name="l00607"></a>00607                                      <span class="keyword">const</span> cpl_table *defaults)
-<a name="l00608"></a>00608 {
-<a name="l00609"></a>00609     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_get_parameter_string"</span>;
-<a name="l00610"></a>00610 
-<a name="l00611"></a>00611     <span class="keyword">const</span> <span class="keywordtype">char</span>    *alias;
-<a name="l00612"></a>00612     cpl_parameter *param;
-<a name="l00613"></a>00613 
-<a name="l00614"></a>00614 
-<a name="l00615"></a>00615     <span class="keywordflow">if</span> (parlist == NULL) {
-<a name="l00616"></a>00616         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter list"</span>);
-<a name="l00617"></a>00617         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l00618"></a>00618         <span class="keywordflow">return</span> 0;
-<a name="l00619"></a>00619     }
-<a name="l00620"></a>00620 
-<a name="l00621"></a>00621     <span class="keywordflow">if</span> (name == NULL) {
-<a name="l00622"></a>00622         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter name"</span>);
-<a name="l00623"></a>00623         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l00624"></a>00624         <span class="keywordflow">return</span> 0;
-<a name="l00625"></a>00625     }
-<a name="l00626"></a>00626 
-<a name="l00627"></a>00627     param = cpl_parameterlist_find(parlist, name);
-<a name="l00628"></a>00628 
-<a name="l00629"></a>00629     <span class="keywordflow">if</span> (param == NULL) {
-<a name="l00630"></a>00630         cpl_msg_error(func, <span class="stringliteral">"Wrong parameter name: %s"</span>, name);
-<a name="l00631"></a>00631         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00632"></a>00632         <span class="keywordflow">return</span> 0;
-<a name="l00633"></a>00633     }
-<a name="l00634"></a>00634 
-<a name="l00635"></a>00635     <span class="keywordflow">if</span> (cpl_parameter_get_type(param) != CPL_TYPE_STRING) {
-<a name="l00636"></a>00636         cpl_msg_error(func, <span class="stringliteral">"Unexpected type for parameter "</span>
-<a name="l00637"></a>00637                       <span class="stringliteral">"\"%s\": it should be string"</span>, name);
-<a name="l00638"></a>00638         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l00639"></a>00639         <span class="keywordflow">return</span> 0;
-<a name="l00640"></a>00640     }
-<a name="l00641"></a>00641 
-<a name="l00642"></a>00642     alias = cpl_parameter_get_alias(param, CPL_PARAMETER_MODE_CLI);
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644 <span class="comment">//    if (defaults && cpl_parameter_get_default_flag(param) == 0) {</span>
-<a name="l00645"></a>00645     <span class="keywordflow">if</span> (defaults && 
-<a name="l00646"></a>00646         strcmp(cpl_parameter_get_default_string(param), 
-<a name="l00647"></a>00647                cpl_parameter_get_string(param)) == 0) {
-<a name="l00648"></a>00648     
-<a name="l00649"></a>00649         <span class="keywordflow">if</span> (cpl_table_has_column(defaults, alias)) {
-<a name="l00650"></a>00650             <span class="keywordflow">if</span> (cpl_table_get_column_type(defaults, alias) != CPL_TYPE_STRING) {
-<a name="l00651"></a>00651                 cpl_msg_error(func, <span class="stringliteral">"Unexpected type for GRISM_TABLE "</span>
-<a name="l00652"></a>00652                               <span class="stringliteral">"column \"%s\": it should be string"</span>, alias);
-<a name="l00653"></a>00653                 cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l00654"></a>00654                 <span class="keywordflow">return</span> 0;
-<a name="l00655"></a>00655             }
-<a name="l00656"></a>00656             <span class="keywordflow">if</span> (cpl_table_is_valid(defaults, alias, 0)) {
-<a name="l00657"></a>00657                 cpl_parameter_set_string(param, cpl_table_get_string(defaults, 
-<a name="l00658"></a>00658                                                              alias, 0));
-<a name="l00659"></a>00659             }
-<a name="l00660"></a>00660             <span class="keywordflow">else</span> {
-<a name="l00661"></a>00661                 cpl_msg_error(func, <span class="stringliteral">"Invalid parameter value in table "</span>
-<a name="l00662"></a>00662                               <span class="stringliteral">"column \"%s\""</span>, alias);
-<a name="l00663"></a>00663                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00664"></a>00664                 <span class="keywordflow">return</span> 0;
-<a name="l00665"></a>00665             }
-<a name="l00666"></a>00666         }
-<a name="l00667"></a>00667         <span class="keywordflow">else</span> {
-<a name="l00668"></a>00668             cpl_msg_warning(func, <span class="stringliteral">"Parameter \"%s\" not found in GRISM_TABLE "</span>
-<a name="l00669"></a>00669                             <span class="stringliteral">"- using recipe default"</span>, alias);
-<a name="l00670"></a>00670         }
-<a name="l00671"></a>00671     }
-<a name="l00672"></a>00672 
-<a name="l00673"></a>00673     cpl_msg_info(func, <span class="stringliteral">"%s:"</span>, alias);
-<a name="l00674"></a>00674     cpl_msg_info(func, <span class="stringliteral">"%s: %s"</span>, cpl_parameter_get_help(param), 
-<a name="l00675"></a>00675                  cpl_parameter_get_string(param));
-<a name="l00676"></a>00676 
-<a name="l00677"></a>00677     <span class="keywordflow">return</span> cpl_parameter_get_string(param);
-<a name="l00678"></a>00678 
-<a name="l00679"></a>00679 }
-<a name="l00680"></a>00680 
-<a name="l00681"></a>00681 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00703"></a>00703 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00704"></a><a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">00704</a> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name,
-<a name="l00705"></a>00705                            <span class="keyword">const</span> cpl_table *defaults)
-<a name="l00706"></a>00706 {
-<a name="l00707"></a>00707     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_get_parameter_bool"</span>;
-<a name="l00708"></a>00708 
-<a name="l00709"></a>00709     <span class="keyword">const</span> <span class="keywordtype">char</span>    *alias;
-<a name="l00710"></a>00710     cpl_parameter *param;
-<a name="l00711"></a>00711     <span class="keywordtype">int</span>            value;
-<a name="l00712"></a>00712 
-<a name="l00713"></a>00713 
-<a name="l00714"></a>00714     <span class="keywordflow">if</span> (parlist == NULL) {
-<a name="l00715"></a>00715         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter list"</span>);
-<a name="l00716"></a>00716         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l00717"></a>00717         <span class="keywordflow">return</span> 0;
-<a name="l00718"></a>00718     }
-<a name="l00719"></a>00719 
-<a name="l00720"></a>00720     <span class="keywordflow">if</span> (name == NULL) {
-<a name="l00721"></a>00721         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter name"</span>);
-<a name="l00722"></a>00722         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l00723"></a>00723         <span class="keywordflow">return</span> 0;
-<a name="l00724"></a>00724     }
-<a name="l00725"></a>00725 
-<a name="l00726"></a>00726     param = cpl_parameterlist_find(parlist, name);
-<a name="l00727"></a>00727 
-<a name="l00728"></a>00728     <span class="keywordflow">if</span> (param == NULL) {
-<a name="l00729"></a>00729         cpl_msg_error(func, <span class="stringliteral">"Wrong parameter name: %s"</span>, name);
-<a name="l00730"></a>00730         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00731"></a>00731         <span class="keywordflow">return</span> 0;
-<a name="l00732"></a>00732     }
-<a name="l00733"></a>00733 
-<a name="l00734"></a>00734     <span class="keywordflow">if</span> (cpl_parameter_get_type(param) != CPL_TYPE_BOOL) {
-<a name="l00735"></a>00735         cpl_msg_error(func, <span class="stringliteral">"Unexpected type for parameter "</span>
-<a name="l00736"></a>00736                       <span class="stringliteral">"\"%s\": it should be boolean"</span>, name);
-<a name="l00737"></a>00737         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l00738"></a>00738         <span class="keywordflow">return</span> 0;
-<a name="l00739"></a>00739     }
-<a name="l00740"></a>00740 
-<a name="l00741"></a>00741     alias = cpl_parameter_get_alias(param, CPL_PARAMETER_MODE_CLI);
-<a name="l00742"></a>00742 
-<a name="l00743"></a>00743 <span class="comment">//    if (defaults && cpl_parameter_get_default_flag(param) == 0) {</span>
-<a name="l00744"></a>00744     <span class="keywordflow">if</span> (defaults && 
-<a name="l00745"></a>00745         cpl_parameter_get_default_bool(param) == 
-<a name="l00746"></a>00746         cpl_parameter_get_bool(param)) {
-<a name="l00747"></a>00747     
-<a name="l00748"></a>00748         <span class="keywordflow">if</span> (cpl_table_has_column(defaults, alias)) {
-<a name="l00749"></a>00749             <span class="keywordflow">if</span> (cpl_table_get_column_type(defaults, alias) != CPL_TYPE_INT) {
-<a name="l00750"></a>00750                 cpl_msg_error(func, <span class="stringliteral">"Unexpected type for GRISM_TABLE "</span>
-<a name="l00751"></a>00751                               <span class="stringliteral">"column \"%s\": it should be integer"</span>, alias);
-<a name="l00752"></a>00752                 cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l00753"></a>00753                 <span class="keywordflow">return</span> 0;
-<a name="l00754"></a>00754             }
-<a name="l00755"></a>00755             <span class="keywordflow">if</span> (cpl_table_is_valid(defaults, alias, 0)) {
-<a name="l00756"></a>00756                 value = cpl_table_get_int(defaults, alias, 0, NULL);
-<a name="l00757"></a>00757                 <span class="keywordflow">if</span> (value < 0 || value > 1) {
-<a name="l00758"></a>00758                     cpl_msg_error(func, <span class="stringliteral">"Illegal parameter value in table "</span>
-<a name="l00759"></a>00759                                   <span class="stringliteral">"column \"%s\": it should be either 0 or 1"</span>, 
-<a name="l00760"></a>00760                                   alias);
-<a name="l00761"></a>00761                     cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00762"></a>00762                     <span class="keywordflow">return</span> 0;
-<a name="l00763"></a>00763                 }
-<a name="l00764"></a>00764                 cpl_parameter_set_bool(param, value);
-<a name="l00765"></a>00765             }
-<a name="l00766"></a>00766             <span class="keywordflow">else</span> {
-<a name="l00767"></a>00767                 cpl_msg_error(func, <span class="stringliteral">"Invalid parameter value in table "</span>
-<a name="l00768"></a>00768                               <span class="stringliteral">"column \"%s\""</span>, alias);
-<a name="l00769"></a>00769                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l00770"></a>00770                 <span class="keywordflow">return</span> 0;
-<a name="l00771"></a>00771             }
-<a name="l00772"></a>00772         }
-<a name="l00773"></a>00773         <span class="keywordflow">else</span> {
-<a name="l00774"></a>00774             cpl_msg_warning(func, <span class="stringliteral">"Parameter \"%s\" not found in GRISM_TABLE "</span>
-<a name="l00775"></a>00775                             <span class="stringliteral">"- using recipe default"</span>, alias);
-<a name="l00776"></a>00776         }
-<a name="l00777"></a>00777     }
-<a name="l00778"></a>00778 
-<a name="l00779"></a>00779     value = cpl_parameter_get_bool(param);
-<a name="l00780"></a>00780 
-<a name="l00781"></a>00781     <span class="keywordflow">if</span> (value) {
-<a name="l00782"></a>00782         cpl_msg_info(func, <span class="stringliteral">"%s:"</span>, alias);
-<a name="l00783"></a>00783         cpl_msg_info(func, <span class="stringliteral">"%s: TRUE"</span>, cpl_parameter_get_help(param));
-<a name="l00784"></a>00784     }
-<a name="l00785"></a>00785     <span class="keywordflow">else</span> {
-<a name="l00786"></a>00786         cpl_msg_info(func, <span class="stringliteral">"%s:"</span>, alias);
-<a name="l00787"></a>00787         cpl_msg_info(func, <span class="stringliteral">"%s: FALSE"</span>, cpl_parameter_get_help(param));
-<a name="l00788"></a>00788     }
-<a name="l00789"></a>00789 
-<a name="l00790"></a>00790     <span class="keywordflow">return</span> value;
-<a name="l00791"></a>00791 
-<a name="l00792"></a>00792 }
-<a name="l00793"></a>00793 
-<a name="l00794"></a>00794 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00798"></a>00798 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00799"></a><a class="code" href="group__forsdfs.html#gfce5eddb71d8700b30c690f49374d2e0">00799</a> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gfce5eddb71d8700b30c690f49374d2e0">dfs_get_parameter_bool_const</a>(<span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name)
-<a name="l00800"></a>00800 {
-<a name="l00801"></a>00801     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>((cpl_parameterlist *)parlist, name, NULL);
-<a name="l00802"></a>00802 }
-<a name="l00803"></a>00803 
-<a name="l00804"></a>00804 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00808"></a>00808 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00809"></a><a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">00809</a> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(<span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name)
-<a name="l00810"></a>00810 {
-<a name="l00811"></a>00811     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>((cpl_parameterlist *)parlist, name, NULL);
-<a name="l00812"></a>00812 }
-<a name="l00813"></a>00813 
-<a name="l00814"></a>00814 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00818"></a>00818 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00819"></a><a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">00819</a> <span class="keywordtype">double</span> <a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a>(<span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name)
-<a name="l00820"></a>00820 {
-<a name="l00821"></a>00821     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>((cpl_parameterlist *)parlist, name, NULL);
-<a name="l00822"></a>00822 }
-<a name="l00823"></a>00823 
-<a name="l00824"></a>00824 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00828"></a>00828 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00829"></a><a class="code" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">00829</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">dfs_get_parameter_string_const</a>(<span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name)
-<a name="l00830"></a>00830 {
-<a name="l00831"></a>00831     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>((cpl_parameterlist *)parlist, name, NULL);
-<a name="l00832"></a>00832 }
-<a name="l00833"></a>00833 
-<a name="l00834"></a>00834 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00862"></a>00862 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00863"></a><a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">00863</a> cpl_image *<a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(cpl_frameset *frameset, <span class="keyword">const</span> <span class="keywordtype">char</span> *category, 
-<a name="l00864"></a>00864                           cpl_type type, <span class="keywordtype">int</span> ext, <span class="keywordtype">int</span> calib)
-<a name="l00865"></a>00865 {
-<a name="l00866"></a>00866     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_load_image"</span>;
-<a name="l00867"></a>00867 
-<a name="l00868"></a>00868     cpl_frame  *frame = NULL;
-<a name="l00869"></a>00869     cpl_image  *image = NULL;
-<a name="l00870"></a>00870 
-<a name="l00871"></a>00871 
-<a name="l00872"></a>00872     frame = cpl_frameset_find(frameset, category);
-<a name="l00873"></a>00873 
-<a name="l00874"></a>00874     <span class="keywordflow">if</span> (frame) {
-<a name="l00875"></a>00875         image = cpl_image_load(cpl_frame_get_filename(frame), type, 0, ext);
-<a name="l00876"></a>00876         <span class="keywordflow">if</span> (image == NULL) {
-<a name="l00877"></a>00877             cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l00878"></a>00878             cpl_msg_error(func, <span class="stringliteral">"Cannot load image %s"</span>,
-<a name="l00879"></a>00879                           cpl_frame_get_filename(frame));
-<a name="l00880"></a>00880         }
-<a name="l00881"></a>00881         <span class="keywordflow">else</span> {
-<a name="l00882"></a>00882             <span class="keywordflow">if</span> (calib) 
-<a name="l00883"></a>00883                 cpl_frame_set_group(frame, CPL_FRAME_GROUP_CALIB);
-<a name="l00884"></a>00884             <span class="keywordflow">else</span>
-<a name="l00885"></a>00885                 cpl_frame_set_group(frame, CPL_FRAME_GROUP_RAW);
-<a name="l00886"></a>00886         }
-<a name="l00887"></a>00887     }
-<a name="l00888"></a>00888 
-<a name="l00889"></a>00889     <span class="keywordflow">return</span> image;
-<a name="l00890"></a>00890 }
-<a name="l00891"></a>00891 
-<a name="l00892"></a>00892 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00918"></a>00918 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00919"></a><a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">00919</a> cpl_table *<a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(cpl_frameset *frameset, <span class="keyword">const</span> <span class="keywordtype">char</span> *category, <span class="keywordtype">int</span> ext)
-<a name="l00920"></a>00920 {
-<a name="l00921"></a>00921     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_load_table"</span>;
-<a name="l00922"></a>00922 
-<a name="l00923"></a>00923     cpl_frame  *frame = NULL;
-<a name="l00924"></a>00924     cpl_table  *table = NULL;
-<a name="l00925"></a>00925 
-<a name="l00926"></a>00926 
-<a name="l00927"></a>00927     frame = cpl_frameset_find(frameset, category);
-<a name="l00928"></a>00928 
-<a name="l00929"></a>00929     <span class="keywordflow">if</span> (frame) {
-<a name="l00930"></a>00930         table = cpl_table_load(cpl_frame_get_filename(frame), ext, 1);
-<a name="l00931"></a>00931         <span class="keywordflow">if</span> (table == NULL) {
-<a name="l00932"></a>00932             cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l00933"></a>00933             cpl_msg_error(func, <span class="stringliteral">"Cannot load table %s"</span>,
-<a name="l00934"></a>00934                           cpl_frame_get_filename(frame));
-<a name="l00935"></a>00935         }
-<a name="l00936"></a>00936         <span class="keywordflow">else</span>
-<a name="l00937"></a>00937             cpl_frame_set_group(frame, CPL_FRAME_GROUP_CALIB);
-<a name="l00938"></a>00938     }
-<a name="l00939"></a>00939 
-<a name="l00940"></a>00940     <span class="keywordflow">return</span> table;
-<a name="l00941"></a>00941 }
-<a name="l00942"></a>00942 
-<a name="l00943"></a>00943 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00968"></a>00968 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00969"></a><a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">00969</a> cpl_propertylist *<a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(cpl_frameset *frameset, 
-<a name="l00970"></a>00970                                   <span class="keyword">const</span> <span class="keywordtype">char</span> *category, <span class="keywordtype">int</span> ext)
-<a name="l00971"></a>00971 {
-<a name="l00972"></a>00972     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_load_header"</span>;
-<a name="l00973"></a>00973 
-<a name="l00974"></a>00974     cpl_frame         *frame = NULL;
-<a name="l00975"></a>00975     cpl_propertylist  *plist = NULL;
-<a name="l00976"></a>00976 
-<a name="l00977"></a>00977 
-<a name="l00978"></a>00978     frame = cpl_frameset_find(frameset, category);
-<a name="l00979"></a>00979 
-<a name="l00980"></a>00980     <span class="keywordflow">if</span> (frame) {
-<a name="l00981"></a>00981         plist = cpl_propertylist_load(cpl_frame_get_filename(frame), ext);
-<a name="l00982"></a>00982         <span class="keywordflow">if</span> (plist == NULL) {
-<a name="l00983"></a>00983             cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l00984"></a>00984             cpl_msg_error(func, <span class="stringliteral">"Cannot load header from %s"</span>,
-<a name="l00985"></a>00985                           cpl_frame_get_filename(frame));
-<a name="l00986"></a>00986         }
-<a name="l00987"></a>00987     }
-<a name="l00988"></a>00988 
-<a name="l00989"></a>00989     <span class="keywordflow">return</span> plist;
-<a name="l00990"></a>00990 }
-<a name="l00991"></a>00991 
-<a name="l00992"></a>00992 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00999"></a>00999 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01000"></a>01000 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l01001"></a><a class="code" href="group__forsdfs.html#g8670593994ad689ac3aa76cf648e76c3">01001</a> <a class="code" href="group__forsdfs.html#g8670593994ad689ac3aa76cf648e76c3">dfs_save</a>(cpl_frameset *frameset, <span class="keyword">const</span> <span class="keywordtype">void</span> *object, cpl_frame_type type,
-<a name="l01002"></a>01002          <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,
-<a name="l01003"></a>01003          <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,
-<a name="l01004"></a>01004          <span class="keyword">const</span> cpl_frame *raw_frame)
-<a name="l01005"></a>01005 {
-<a name="l01006"></a>01006     <span class="keywordtype">char</span>             *filename;
-<a name="l01007"></a>01007     cpl_frame        *frame;
-<a name="l01008"></a>01008     cpl_propertylist *plist;
-<a name="l01009"></a>01009     <span class="keyword">const</span> <span class="keywordtype">char</span>       *version    = NULL;
-<a name="l01010"></a>01010     cpl_propertylist *raw_header = NULL;
-<a name="l01011"></a>01011 
-<a name="l01012"></a>01012 
-<a name="l01013"></a>01013     <span class="keywordflow">if</span> (category == NULL || frameset == NULL || object == NULL || 
-<a name="l01014"></a>01014         raw_frame == NULL) {
-<a name="l01015"></a>01015         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01016"></a>01016         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
-<a name="l01017"></a>01017         <span class="keywordflow">return</span>;
-<a name="l01018"></a>01018     }
-<a name="l01019"></a>01019 
-<a name="l01020"></a>01020     <span class="keywordflow">if</span> (type == CPL_FRAME_TYPE_IMAGE) {
-<a name="l01021"></a>01021         cpl_msg_debug(cpl_func, <span class="stringliteral">"Saving %s image to disk..."</span>, category);
-<a name="l01022"></a>01022     }
-<a name="l01023"></a>01023     <span class="keywordflow">else</span> {
-<a name="l01024"></a>01024         cpl_msg_debug(cpl_func, <span class="stringliteral">"Saving %s table to disk..."</span>, category);
-<a name="l01025"></a>01025     }
-<a name="l01026"></a>01026 
-<a name="l01027"></a>01027     <span class="comment">/* Read instrument version from raw frame */</span>
-<a name="l01028"></a>01028     {
-<a name="l01029"></a>01029         <span class="keyword">const</span> <span class="keywordtype">char</span> *raw_filename = 
-<a name="l01030"></a>01030             cpl_frame_get_filename(raw_frame);
-<a name="l01031"></a>01031         
-<a name="l01032"></a>01032         raw_header = cpl_propertylist_load(raw_filename, 0);
-<a name="l01033"></a>01033         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l01034"></a>01034             cpl_msg_error(cpl_func, <span class="stringliteral">"Could not read %s primary header"</span>, raw_filename);
-<a name="l01035"></a>01035             <span class="keywordflow">return</span>;
-<a name="l01036"></a>01036         }
-<a name="l01037"></a>01037         
-<a name="l01038"></a>01038         version = <a class="code" href="group__forsdfs.html#g61956e9dcf77f5c71db911e0390f63f3">fors_dfs_pipeline_version</a>(raw_header, NULL);
-<a name="l01039"></a>01039         cpl_propertylist_delete(raw_header);        
-<a name="l01040"></a>01040 
-<a name="l01041"></a>01041         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l01042"></a>01042             cpl_msg_error(cpl_func, <span class="stringliteral">"Could not identify instrument version from %s header"</span>,
-<a name="l01043"></a>01043                           raw_filename);
-<a name="l01044"></a>01044             <span class="keywordflow">return</span>;
-<a name="l01045"></a>01045         }       
-<a name="l01046"></a>01046     }
-<a name="l01047"></a>01047 
-<a name="l01048"></a>01048     filename = cpl_calloc(strlen(category) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l01049"></a>01049 
-<a name="l01050"></a>01050     <a class="code" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">strlower</a>(strcpy(filename, category));
-<a name="l01051"></a>01051     strcat(filename, <span class="stringliteral">".fits"</span>);
-<a name="l01052"></a>01052 
-<a name="l01053"></a>01053     frame = cpl_frame_new();
-<a name="l01054"></a>01054 
-<a name="l01055"></a>01055     cpl_frame_set_filename(frame, filename);
-<a name="l01056"></a>01056     cpl_frame_set_tag(frame, category);
-<a name="l01057"></a>01057     cpl_frame_set_type(frame, type);
-<a name="l01058"></a>01058     cpl_frame_set_group(frame, CPL_FRAME_GROUP_PRODUCT);
-<a name="l01059"></a>01059     cpl_frame_set_level(frame, CPL_FRAME_LEVEL_FINAL);
-<a name="l01060"></a>01060     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01061"></a>01061         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01062"></a>01062         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot initialise the product frame"</span>);
-<a name="l01063"></a>01063         cpl_frame_delete(frame);
-<a name="l01064"></a>01064         cpl_free(filename);
-<a name="l01065"></a>01065         cpl_free((<span class="keywordtype">void</span> *)version);
-<a name="l01066"></a>01066         <span class="keywordflow">return</span>;
-<a name="l01067"></a>01067     }
-<a name="l01068"></a>01068 
-<a name="l01069"></a>01069 
-<a name="l01070"></a>01070     <span class="comment">/*</span>
-<a name="l01071"></a>01071 <span class="comment">     * Produce DFS compliant FITS header for product</span>
-<a name="l01072"></a>01072 <span class="comment">     */</span>
-<a name="l01073"></a>01073 
-<a name="l01074"></a>01074     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01075"></a>01075         plist = cpl_propertylist_new();
-<a name="l01076"></a>01076     <span class="keywordflow">else</span>
-<a name="l01077"></a>01077         plist = header;
-<a name="l01078"></a>01078 
-<a name="l01079"></a>01079 <span class="preprocessor">#if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(4, 8, 0)</span>
-<a name="l01080"></a>01080 <span class="preprocessor"></span>    <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,
-<a name="l01081"></a>01081                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>, NULL)) {
-<a name="l01082"></a>01082 <span class="preprocessor">#else </span>
-<a name="l01083"></a>01083 <span class="preprocessor"></span>    <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,
-<a name="l01084"></a>01084                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>)) {
-<a name="l01085"></a>01085 <span class="preprocessor">#endif</span>
-<a name="l01086"></a>01086 <span class="preprocessor"></span>        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01087"></a>01087         cpl_msg_error(cpl_func, <span class="stringliteral">"Problem with product %s FITS header definition"</span>,
-<a name="l01088"></a>01088                       category);
-<a name="l01089"></a>01089         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01090"></a>01090             cpl_propertylist_delete(plist);
-<a name="l01091"></a>01091         cpl_frame_delete(frame);
-<a name="l01092"></a>01092         cpl_free(filename);
-<a name="l01093"></a>01093         cpl_free((<span class="keywordtype">void</span> *)version);
-<a name="l01094"></a>01094         <span class="keywordflow">return</span>;
-<a name="l01095"></a>01095     }
-<a name="l01096"></a>01096 
-<a name="l01097"></a>01097     cpl_free((<span class="keywordtype">void</span> *)version);
-<a name="l01098"></a>01098 
-<a name="l01099"></a>01099 <span class="comment">/* CPL3.0 </span>
-<a name="l01100"></a>01100 <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 OVSC*", 0);</span>
-<a name="l01101"></a>01101 <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 PRSC*", 0);</span>
-<a name="l01102"></a>01102 <span class="comment">*/</span>
-<a name="l01103"></a>01103 <span class="comment">/* CPL2.0 */</span>
-<a name="l01104"></a>01104     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>);
-<a name="l01105"></a>01105     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>);
-<a name="l01106"></a>01106     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>);
-<a name="l01107"></a>01107     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>);
-<a name="l01108"></a>01108 
-<a name="l01109"></a>01109     <span class="comment">/*</span>
-<a name="l01110"></a>01110 <span class="comment">     * Write to disk</span>
-<a name="l01111"></a>01111 <span class="comment">     */</span>
-<a name="l01112"></a>01112     
-<a name="l01113"></a>01113     <span class="keywordflow">if</span> (type == CPL_FRAME_TYPE_IMAGE) {
-<a name="l01114"></a>01114         <a class="code" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save</a>((<a class="code" href="struct__fors__image.html">fors_image</a> *)object, plist, filename);
-<a name="l01115"></a>01115     }
-<a name="l01116"></a>01116     <span class="keywordflow">else</span> {
-<a name="l01117"></a>01117         cpl_table_save((cpl_table *)object, 
-<a name="l01118"></a>01118                        plist, NULL, filename, CPL_IO_DEFAULT);
-<a name="l01119"></a>01119     }
-<a name="l01120"></a>01120     
-<a name="l01121"></a>01121     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l01122"></a>01122         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01123"></a>01123         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot save product %s to disk"</span>, filename);
-<a name="l01124"></a>01124         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01125"></a>01125             cpl_propertylist_delete(plist);
-<a name="l01126"></a>01126         cpl_frame_delete(frame);
-<a name="l01127"></a>01127         cpl_free(filename);
-<a name="l01128"></a>01128         <span class="keywordflow">return</span>;
-<a name="l01129"></a>01129     }
-<a name="l01130"></a>01130 
-<a name="l01131"></a>01131     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01132"></a>01132         cpl_propertylist_delete(plist);
-<a name="l01133"></a>01133 
-<a name="l01134"></a>01134     cpl_free(filename);
-<a name="l01135"></a>01135 
-<a name="l01136"></a>01136     cpl_frameset_insert(frameset, frame);
-<a name="l01137"></a>01137 
-<a name="l01138"></a>01138     <span class="keywordflow">return</span>;
-<a name="l01139"></a>01139 }
-<a name="l01140"></a>01140     
-<a name="l01141"></a>01141 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01162"></a>01162 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01163"></a>01163 <span class="keywordtype">void</span>
-<a name="l01164"></a><a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">01164</a> <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(cpl_frameset *frameset, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,
-<a name="l01165"></a>01165                     <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,
-<a name="l01166"></a>01166                     <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,
-<a name="l01167"></a>01167                     <span class="keyword">const</span> cpl_frame *raw_frame)
-<a name="l01168"></a>01168 {
-<a name="l01169"></a>01169     <a class="code" href="group__forsdfs.html#g8670593994ad689ac3aa76cf648e76c3">dfs_save</a>(frameset, image, CPL_FRAME_TYPE_IMAGE, 
-<a name="l01170"></a>01170              category, header, 
-<a name="l01171"></a>01171              parlist, recipename, 
-<a name="l01172"></a>01172              raw_frame);
-<a name="l01173"></a>01173 }
-<a name="l01174"></a>01174 
-<a name="l01175"></a>01175 <span class="preprocessor">#undef cleanup</span>
-<a name="l01176"></a>01176 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01177"></a>01177 <span class="preprocessor">do { \</span>
-<a name="l01178"></a>01178 <span class="preprocessor">    cpl_propertylist_delete(wcs_header); \</span>
-<a name="l01179"></a>01179 <span class="preprocessor">} while (0)</span>
-<a name="l01180"></a>01180 <span class="preprocessor"></span>
-<a name="l01185"></a><a class="code" href="group__forsdfs.html#geb1068e007bd0ebef0cd4a6aa12cf523">01185</a> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#geb1068e007bd0ebef0cd4a6aa12cf523">fors_dfs_add_wcs</a>(cpl_propertylist *header, <span class="keyword">const</span> cpl_frame *frame,
-<a name="l01186"></a>01186                       <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting)
-<a name="l01187"></a>01187 {
-<a name="l01188"></a>01188     <span class="keywordtype">bool</span> invert = <span class="keyword">false</span>;
-<a name="l01189"></a>01189     <span class="keywordtype">int</span> extension = 0;
-<a name="l01190"></a>01190     
-<a name="l01191"></a>01191     cpl_propertylist *wcs_header = 
-<a name="l01192"></a>01192         cpl_propertylist_load_regexp(cpl_frame_get_filename(frame), 
-<a name="l01193"></a>01193                                      extension, <a class="code" href="group__forsdfs.html#g0b6879dd3db31db30dd619bcbfc69d5d">WCS_KEYS</a>, invert);
-<a name="l01194"></a>01194   
-<a name="l01195"></a>01195     cpl_propertylist_copy_property_regexp(header, wcs_header, <span class="stringliteral">".*"</span>, invert);
-<a name="l01196"></a>01196 
-<a name="l01197"></a>01197     <span class="keywordtype">double</span> crpix1 = cpl_propertylist_get_double(header, <a class="code" href="group__fors__pfits.html#g3c36769697845cb20c1c5e5d2193de16">FORS_PFITS_CRPIX1</a>);
-<a name="l01198"></a>01198 
-<a name="l01199"></a>01199     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l01200"></a>01200             <span class="stringliteral">"Could not read %s from %s"</span>, <a class="code" href="group__fors__pfits.html#g3c36769697845cb20c1c5e5d2193de16">FORS_PFITS_CRPIX1</a>, 
-<a name="l01201"></a>01201             cpl_frame_get_filename(frame));
-<a name="l01202"></a>01202             
-<a name="l01203"></a>01203     <span class="keywordtype">double</span> crpix2 = cpl_propertylist_get_double(header, <a class="code" href="group__fors__pfits.html#g2fa4424e21e2ca5f1936b814a6d42f97">FORS_PFITS_CRPIX2</a>);
-<a name="l01204"></a>01204 
-<a name="l01205"></a>01205     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l01206"></a>01206             <span class="stringliteral">"Could not read %s from %s"</span>, <a class="code" href="group__fors__pfits.html#g2fa4424e21e2ca5f1936b814a6d42f97">FORS_PFITS_CRPIX2</a>,
-<a name="l01207"></a>01207             cpl_frame_get_filename(frame));
-<a name="l01208"></a>01208     
-<a name="l01209"></a>01209     cpl_propertylist_update_double(header, <a class="code" href="group__fors__pfits.html#g3c36769697845cb20c1c5e5d2193de16">FORS_PFITS_CRPIX1</a>,
-<a name="l01210"></a>01210                                    crpix1 - setting-><a class="code" href="struct__fors__setting.html#73c8992df1265002a5ad94acbb1f36c9">prescan_x</a>);
-<a name="l01211"></a>01211     
-<a name="l01212"></a>01212     cpl_propertylist_update_double(header, <a class="code" href="group__fors__pfits.html#g2fa4424e21e2ca5f1936b814a6d42f97">FORS_PFITS_CRPIX2</a>,
-<a name="l01213"></a>01213                                    crpix2 - setting-><a class="code" href="struct__fors__setting.html#21a646d60ba3e80ce7ced6c1af9ca03b">prescan_y</a>);
-<a name="l01214"></a>01214 
-<a name="l01215"></a>01215     
-<a name="l01216"></a>01216     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01217"></a>01217     <span class="keywordflow">return</span>;
-<a name="l01218"></a>01218 }
-<a name="l01219"></a>01219 
-<a name="l01220"></a>01220 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01221"></a>01221 <span class="preprocessor">#undef cleanup</span>
-<a name="l01222"></a><a class="code" href="group__forsdfs.html#g57cf6e6e2826eb178fd2d9c3e5695343">01222</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01223"></a>01223 <span class="preprocessor">do { \</span>
-<a name="l01224"></a>01224 <span class="preprocessor">    cpl_propertylist_delete(time_header); \</span>
-<a name="l01225"></a>01225 <span class="preprocessor">} while (0)</span>
-<a name="l01226"></a>01226 <span class="preprocessor"></span>
-<a name="l01238"></a>01238 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01239"></a><a class="code" href="group__forsdfs.html#gea45a5b73ab086e5e08680928adbd0cd">01239</a> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#gea45a5b73ab086e5e08680928adbd0cd">fors_dfs_add_exptime</a>(cpl_propertylist *header, <span class="keyword">const</span> cpl_frame *frame,
-<a name="l01240"></a>01240                           <span class="keywordtype">double</span> exptime)
-<a name="l01241"></a>01241 {
-<a name="l01242"></a>01242     <span class="keywordtype">bool</span> invert = <span class="keyword">false</span>;
-<a name="l01243"></a>01243     <span class="keywordtype">int</span> extension = 0;
-<a name="l01244"></a>01244 
-<a name="l01245"></a>01245     cpl_propertylist *time_header = NULL;
-<a name="l01246"></a>01246 
-<a name="l01247"></a>01247     <span class="keywordflow">if</span> (frame) {
-<a name="l01248"></a>01248 
-<a name="l01249"></a>01249         time_header =
-<a name="l01250"></a>01250         cpl_propertylist_load_regexp(cpl_frame_get_filename(frame),
-<a name="l01251"></a>01251                                      extension, <span class="stringliteral">"EXPTIME"</span>, invert);
-<a name="l01252"></a>01252 
-<a name="l01253"></a>01253         <span class="keywordflow">if</span> (time_header) {
-<a name="l01254"></a>01254             cpl_propertylist_copy_property_regexp(header, 
-<a name="l01255"></a>01255                                                   time_header, <span class="stringliteral">".*"</span>, invert);
-<a name="l01256"></a>01256         }
-<a name="l01257"></a>01257         <span class="keywordflow">else</span> {
-<a name="l01258"></a>01258             cpl_error_reset();
-<a name="l01259"></a>01259         }
-<a name="l01260"></a>01260     }
-<a name="l01261"></a>01261     <span class="keywordflow">else</span> {
-<a name="l01262"></a>01262         <span class="keywordflow">while</span> (cpl_propertylist_erase(header, <span class="stringliteral">"EXPTIME"</span>));
-<a name="l01263"></a>01263         cpl_propertylist_update_double(header, <span class="stringliteral">"EXPTIME"</span>, exptime);
-<a name="l01264"></a>01264     }
-<a name="l01265"></a>01265 
-<a name="l01266"></a>01266     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01267"></a>01267     <span class="keywordflow">return</span>;
-<a name="l01268"></a>01268 }
-<a name="l01269"></a>01269 
-<a name="l01270"></a>01270 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01277"></a>01277 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01278"></a>01278 <span class="keywordtype">void</span>
-<a name="l01279"></a><a class="code" href="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42">01279</a> <a class="code" href="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42">fors_dfs_save_table</a>(cpl_frameset *frameset, <span class="keyword">const</span> cpl_table *table,
-<a name="l01280"></a>01280                     <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,
-<a name="l01281"></a>01281                     <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,
-<a name="l01282"></a>01282                     <span class="keyword">const</span> cpl_frame *raw_frame)
-<a name="l01283"></a>01283 {
-<a name="l01284"></a>01284     <a class="code" href="group__forsdfs.html#g8670593994ad689ac3aa76cf648e76c3">dfs_save</a>(frameset, table, CPL_FRAME_TYPE_TABLE, 
-<a name="l01285"></a>01285              category, header, 
-<a name="l01286"></a>01286              parlist, recipename, 
-<a name="l01287"></a>01287              raw_frame);
-<a name="l01288"></a>01288 }
-<a name="l01289"></a>01289 
-<a name="l01290"></a>01290 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01322"></a>01322 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01323"></a><a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">01323</a> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(cpl_frameset *frameset, <span class="keyword">const</span> cpl_image *image, 
-<a name="l01324"></a>01324                    <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,
-<a name="l01325"></a>01325                    <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename, 
-<a name="l01326"></a>01326                    <span class="keyword">const</span> <span class="keywordtype">char</span> *version)
-<a name="l01327"></a>01327 {
-<a name="l01328"></a>01328     <span class="keyword">const</span> <span class="keywordtype">char</span>       *func = <span class="stringliteral">"dfs_save_image"</span>;
-<a name="l01329"></a>01329 
-<a name="l01330"></a>01330     <span class="keywordtype">char</span>             *filename;
-<a name="l01331"></a>01331     cpl_frame        *frame;
-<a name="l01332"></a>01332     cpl_propertylist *plist;
-<a name="l01333"></a>01333 
-<a name="l01334"></a>01334 
-<a name="l01335"></a>01335     <span class="keywordflow">if</span> (category == NULL || frameset == NULL || image == NULL) {
-<a name="l01336"></a>01336         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01337"></a>01337         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l01338"></a>01338         <span class="keywordflow">return</span> -1;
-<a name="l01339"></a>01339     }
-<a name="l01340"></a>01340 
-<a name="l01341"></a>01341     cpl_msg_info(func, <span class="stringliteral">"Saving %s image to disk..."</span>, category);
-<a name="l01342"></a>01342 
-<a name="l01343"></a>01343     filename = cpl_calloc(strlen(category) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l01344"></a>01344 
-<a name="l01345"></a>01345     <a class="code" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">strlower</a>(strcpy(filename, category));
-<a name="l01346"></a>01346     strcat(filename, <span class="stringliteral">".fits"</span>);
-<a name="l01347"></a>01347 
-<a name="l01348"></a>01348     frame = cpl_frame_new();
-<a name="l01349"></a>01349 
-<a name="l01350"></a>01350     cpl_frame_set_filename(frame, filename);
-<a name="l01351"></a>01351     cpl_frame_set_tag(frame, category);
-<a name="l01352"></a>01352     cpl_frame_set_type(frame, CPL_FRAME_TYPE_IMAGE);
-<a name="l01353"></a>01353     cpl_frame_set_group(frame, CPL_FRAME_GROUP_PRODUCT);
-<a name="l01354"></a>01354     cpl_frame_set_level(frame, CPL_FRAME_LEVEL_FINAL);
-<a name="l01355"></a>01355     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01356"></a>01356         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01357"></a>01357         cpl_msg_error(func, <span class="stringliteral">"Cannot initialise the product frame"</span>);
-<a name="l01358"></a>01358         cpl_frame_delete(frame);
-<a name="l01359"></a>01359         cpl_free(filename);
-<a name="l01360"></a>01360         <span class="keywordflow">return</span> -1;
-<a name="l01361"></a>01361     }
-<a name="l01362"></a>01362 
-<a name="l01363"></a>01363 
-<a name="l01364"></a>01364     <span class="comment">/*</span>
-<a name="l01365"></a>01365 <span class="comment">     * Produce DFS compliant FITS header for image</span>
-<a name="l01366"></a>01366 <span class="comment">     */</span>
-<a name="l01367"></a>01367 
-<a name="l01368"></a>01368     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01369"></a>01369         plist = cpl_propertylist_new();
-<a name="l01370"></a>01370     <span class="keywordflow">else</span>
-<a name="l01371"></a>01371         plist = header;
-<a name="l01372"></a>01372 
-<a name="l01373"></a>01373 <span class="preprocessor">#if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(4, 8, 0)</span>
-<a name="l01374"></a>01374 <span class="preprocessor"></span>    <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,
-<a name="l01375"></a>01375                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>, NULL)) {
-<a name="l01376"></a>01376 <span class="preprocessor">#else </span>
-<a name="l01377"></a>01377 <span class="preprocessor"></span>    <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,
-<a name="l01378"></a>01378                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>)) {
-<a name="l01379"></a>01379 <span class="preprocessor">#endif</span>
-<a name="l01380"></a>01380 <span class="preprocessor"></span>        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01381"></a>01381         cpl_msg_error(func, <span class="stringliteral">"Problem with product %s FITS header definition"</span>,
-<a name="l01382"></a>01382                       category);
-<a name="l01383"></a>01383         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01384"></a>01384             cpl_propertylist_delete(plist);
-<a name="l01385"></a>01385         cpl_frame_delete(frame);
-<a name="l01386"></a>01386         cpl_free(filename);
-<a name="l01387"></a>01387         <span class="keywordflow">return</span> -1;
-<a name="l01388"></a>01388     }
-<a name="l01389"></a>01389 
-<a name="l01390"></a>01390 <span class="comment">/* CPL3.0 </span>
-<a name="l01391"></a>01391 <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 OVSC*", 0);</span>
-<a name="l01392"></a>01392 <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 PRSC*", 0);</span>
-<a name="l01393"></a>01393 <span class="comment">*/</span>
-<a name="l01394"></a>01394 <span class="comment">/* CPL2.0 */</span>
-<a name="l01395"></a>01395     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>);
-<a name="l01396"></a>01396     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>);
-<a name="l01397"></a>01397     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>);
-<a name="l01398"></a>01398     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>);
-<a name="l01399"></a>01399 
-<a name="l01400"></a>01400     <span class="comment">/*</span>
-<a name="l01401"></a>01401 <span class="comment">     * Write image to disk</span>
-<a name="l01402"></a>01402 <span class="comment">     */</span>
-<a name="l01403"></a>01403 
-<a name="l01404"></a>01404     <span class="keywordflow">if</span> (cpl_image_save(image, filename, CPL_BPP_IEEE_FLOAT, plist,
-<a name="l01405"></a>01405                        CPL_IO_DEFAULT)) {
-<a name="l01406"></a>01406         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01407"></a>01407         cpl_msg_error(func, <span class="stringliteral">"Cannot save product %s to disk"</span>, filename);
-<a name="l01408"></a>01408         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01409"></a>01409             cpl_propertylist_delete(plist);
-<a name="l01410"></a>01410         cpl_frame_delete(frame);
-<a name="l01411"></a>01411         cpl_free(filename);
-<a name="l01412"></a>01412         <span class="keywordflow">return</span> -1;
-<a name="l01413"></a>01413     }
-<a name="l01414"></a>01414 
-<a name="l01415"></a>01415     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01416"></a>01416         cpl_propertylist_delete(plist);
-<a name="l01417"></a>01417 
-<a name="l01418"></a>01418     cpl_free(filename);
-<a name="l01419"></a>01419 
-<a name="l01420"></a>01420     cpl_frameset_insert(frameset, frame);
-<a name="l01421"></a>01421 
-<a name="l01422"></a>01422     <span class="keywordflow">return</span> 0;
-<a name="l01423"></a>01423 }
-<a name="l01424"></a>01424 
-<a name="l01425"></a>01425 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01457"></a>01457 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01458"></a><a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">01458</a> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(cpl_frameset *frameset, <span class="keyword">const</span> cpl_table *table, 
-<a name="l01459"></a>01459                    <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,
-<a name="l01460"></a>01460                    <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename, 
-<a name="l01461"></a>01461                    <span class="keyword">const</span> <span class="keywordtype">char</span> *version)
-<a name="l01462"></a>01462 {
-<a name="l01463"></a>01463     <span class="keyword">const</span> <span class="keywordtype">char</span>       *func = <span class="stringliteral">"dfs_save_table"</span>;
-<a name="l01464"></a>01464 
-<a name="l01465"></a>01465     <span class="keywordtype">char</span>             *filename;
-<a name="l01466"></a>01466     cpl_frame        *frame;
-<a name="l01467"></a>01467     cpl_propertylist *plist;
-<a name="l01468"></a>01468 
-<a name="l01469"></a>01469 
-<a name="l01470"></a>01470     <span class="keywordflow">if</span> (category == NULL || frameset == NULL || table == NULL) {
-<a name="l01471"></a>01471         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l01472"></a>01472         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01473"></a>01473         <span class="keywordflow">return</span> -1;
-<a name="l01474"></a>01474     }
-<a name="l01475"></a>01475 
-<a name="l01476"></a>01476     cpl_msg_info(func, <span class="stringliteral">"Saving %s table to disk..."</span>, category);
-<a name="l01477"></a>01477 
-<a name="l01478"></a>01478     <span class="comment">/*</span>
-<a name="l01479"></a>01479 <span class="comment">    filename = cpl_calloc(strlen(category) + 7, sizeof(char));</span>
-<a name="l01480"></a>01480 <span class="comment">    */</span>
-<a name="l01481"></a>01481     filename = cpl_calloc(strlen(category) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l01482"></a>01482 
-<a name="l01483"></a>01483     <a class="code" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">strlower</a>(strcpy(filename, category));
-<a name="l01484"></a>01484 
-<a name="l01485"></a>01485     <span class="comment">/*</span>
-<a name="l01486"></a>01486 <span class="comment">    strcat(filename, ".tfits");</span>
-<a name="l01487"></a>01487 <span class="comment">    */</span>
-<a name="l01488"></a>01488     strcat(filename, <span class="stringliteral">".fits"</span>);
-<a name="l01489"></a>01489 
-<a name="l01490"></a>01490     frame = cpl_frame_new();
-<a name="l01491"></a>01491 
-<a name="l01492"></a>01492     cpl_frame_set_filename(frame, filename);
-<a name="l01493"></a>01493     cpl_frame_set_tag(frame, category);
-<a name="l01494"></a>01494     cpl_frame_set_type(frame, CPL_FRAME_TYPE_TABLE);
-<a name="l01495"></a>01495     cpl_frame_set_group(frame, CPL_FRAME_GROUP_PRODUCT);
-<a name="l01496"></a>01496     cpl_frame_set_level(frame, CPL_FRAME_LEVEL_FINAL);
-<a name="l01497"></a>01497     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01498"></a>01498         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01499"></a>01499         cpl_msg_error(func, <span class="stringliteral">"Cannot initialise the product frame"</span>);
-<a name="l01500"></a>01500         cpl_frame_delete(frame);
-<a name="l01501"></a>01501         cpl_free(filename);
-<a name="l01502"></a>01502         <span class="keywordflow">return</span> -1;
-<a name="l01503"></a>01503     }
-<a name="l01504"></a>01504 
-<a name="l01505"></a>01505 
-<a name="l01506"></a>01506     <span class="comment">/*</span>
-<a name="l01507"></a>01507 <span class="comment">     * Produce DFS compliant FITS header for table</span>
-<a name="l01508"></a>01508 <span class="comment">     */</span>
-<a name="l01509"></a>01509 
-<a name="l01510"></a>01510     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01511"></a>01511         plist = cpl_propertylist_new();
-<a name="l01512"></a>01512     <span class="keywordflow">else</span>
-<a name="l01513"></a>01513         plist = header;
-<a name="l01514"></a>01514 
-<a name="l01515"></a>01515 <span class="preprocessor">#if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(4, 8, 0)</span>
-<a name="l01516"></a>01516 <span class="preprocessor"></span>    <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,
-<a name="l01517"></a>01517                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>, NULL)) {
-<a name="l01518"></a>01518 <span class="preprocessor">#else </span>
-<a name="l01519"></a>01519 <span class="preprocessor"></span>    <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,
-<a name="l01520"></a>01520                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>)) {
-<a name="l01521"></a>01521 <span class="preprocessor">#endif</span>
-<a name="l01522"></a>01522 <span class="preprocessor"></span>        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01523"></a>01523         cpl_msg_error(func, <span class="stringliteral">"Problem with product %s FITS header definition"</span>,
-<a name="l01524"></a>01524                       category);
-<a name="l01525"></a>01525         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01526"></a>01526             cpl_propertylist_delete(plist);
-<a name="l01527"></a>01527         cpl_frame_delete(frame);
-<a name="l01528"></a>01528         cpl_free(filename);
-<a name="l01529"></a>01529         <span class="keywordflow">return</span> -1;
-<a name="l01530"></a>01530     }
-<a name="l01531"></a>01531 
-<a name="l01532"></a>01532 <span class="comment">/* For CPL3.0</span>
-<a name="l01533"></a>01533 <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 OVSC*", 0);</span>
-<a name="l01534"></a>01534 <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 PRSC*", 0);</span>
-<a name="l01535"></a>01535 <span class="comment">*/</span>
-<a name="l01536"></a>01536 <span class="comment">/* For CPL2.0 */</span>
-<a name="l01537"></a>01537     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>);
-<a name="l01538"></a>01538     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>);
-<a name="l01539"></a>01539     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>);
-<a name="l01540"></a>01540     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>);
-<a name="l01541"></a>01541 
-<a name="l01542"></a>01542     <span class="comment">/*</span>
-<a name="l01543"></a>01543 <span class="comment">     * Write table to disk</span>
-<a name="l01544"></a>01544 <span class="comment">     */</span>
-<a name="l01545"></a>01545     
-<a name="l01546"></a>01546     
-<a name="l01547"></a>01547     <span class="keywordflow">if</span> (cpl_table_save(table, plist, NULL, filename, CPL_IO_DEFAULT)) {
-<a name="l01548"></a>01548         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01549"></a>01549         cpl_msg_error(func, <span class="stringliteral">"Cannot save product %s to disk"</span>, filename);
-<a name="l01550"></a>01550         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01551"></a>01551             cpl_propertylist_delete(plist);
-<a name="l01552"></a>01552         cpl_frame_delete(frame);
-<a name="l01553"></a>01553         cpl_free(filename);
-<a name="l01554"></a>01554         <span class="keywordflow">return</span> -1;
-<a name="l01555"></a>01555     }
-<a name="l01556"></a>01556 
-<a name="l01557"></a>01557     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01558"></a>01558         cpl_propertylist_delete(plist);
-<a name="l01559"></a>01559     cpl_free(filename);
-<a name="l01560"></a>01560 
-<a name="l01561"></a>01561     cpl_frameset_insert(frameset, frame);
-<a name="l01562"></a>01562 
-<a name="l01563"></a>01563     <span class="keywordflow">return</span> 0;
-<a name="l01564"></a>01564 }
-<a name="l01565"></a>01565 
-<a name="l01566"></a>01566 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01583"></a>01583 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01584"></a><a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">01584</a> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(cpl_frameset *frameset, <span class="keyword">const</span> <span class="keywordtype">char</span> *keyword)
-<a name="l01585"></a>01585 {
-<a name="l01586"></a>01586     <span class="keyword">const</span> <span class="keywordtype">char</span>       *func = <span class="stringliteral">"dfs_equal_keyword"</span>;
-<a name="l01587"></a>01587 
-<a name="l01588"></a>01588     cpl_frame        *frame;
-<a name="l01589"></a>01589     cpl_propertylist *reference;
-<a name="l01590"></a>01590     cpl_type          rtype;
-<a name="l01591"></a>01591     cpl_type          type;
-<a name="l01592"></a>01592     <span class="keyword">const</span> <span class="keywordtype">char</span>       *rstring;
-<a name="l01593"></a>01593     <span class="keyword">const</span> <span class="keywordtype">char</span>       *string;
-<a name="l01594"></a>01594     <span class="keywordtype">int</span>               rintero;
-<a name="l01595"></a>01595     <span class="keywordtype">int</span>               intero;
-<a name="l01596"></a>01596     <span class="keywordtype">int</span>               found;
-<a name="l01597"></a>01597 
-<a name="l01598"></a>01598 
-<a name="l01599"></a>01599     <span class="keywordflow">if</span> (frameset == NULL || keyword == NULL) {
-<a name="l01600"></a>01600         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l01601"></a>01601         <span class="keywordflow">return</span> 0;
-<a name="l01602"></a>01602     }
-<a name="l01603"></a>01603 
-<a name="l01604"></a>01604     <span class="keywordflow">if</span> (cpl_frameset_is_empty(frameset)) {
-<a name="l01605"></a>01605         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l01606"></a>01606         <span class="keywordflow">return</span> 0;
-<a name="l01607"></a>01607     }
-<a name="l01608"></a>01608         
-<a name="l01609"></a>01609     frame = cpl_frameset_get_first(frameset);
-<a name="l01610"></a>01610 
-<a name="l01611"></a>01611     found = 0;
-<a name="l01612"></a>01612 
-<a name="l01613"></a>01613     <span class="keywordflow">while</span> (frame) {
-<a name="l01614"></a>01614 
-<a name="l01615"></a>01615         reference = cpl_propertylist_load(cpl_frame_get_filename(frame), 0);
-<a name="l01616"></a>01616         <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_BAD_FILE_FORMAT) {
-<a name="l01617"></a>01617             cpl_error_reset();
-<a name="l01618"></a>01618             frame = cpl_frameset_get_next(frameset);
-<a name="l01619"></a>01619             <span class="keywordflow">continue</span>;
-<a name="l01620"></a>01620         }
-<a name="l01621"></a>01621 
-<a name="l01622"></a>01622         <span class="keywordflow">if</span> (cpl_propertylist_has(reference, keyword)) {
-<a name="l01623"></a>01623             rtype = cpl_propertylist_get_type(reference, keyword);
-<a name="l01624"></a>01624 
-<a name="l01625"></a>01625             <span class="keywordflow">if</span> (rtype == CPL_TYPE_STRING) {
-<a name="l01626"></a>01626                 found = 1;
-<a name="l01627"></a>01627                 rstring = cpl_strdup(cpl_propertylist_get_string(reference, 
-<a name="l01628"></a>01628                                                                  keyword));
-<a name="l01629"></a>01629                 cpl_propertylist_delete(reference);
-<a name="l01630"></a>01630                 <span class="keywordflow">break</span>;
-<a name="l01631"></a>01631             }
-<a name="l01632"></a>01632 
-<a name="l01633"></a>01633             <span class="keywordflow">if</span> (rtype == CPL_TYPE_INT) {
-<a name="l01634"></a>01634                 found = 1;
-<a name="l01635"></a>01635                 rintero = cpl_propertylist_get_int(reference, keyword);
-<a name="l01636"></a>01636                 cpl_propertylist_delete(reference);
-<a name="l01637"></a>01637                 <span class="keywordflow">break</span>;
-<a name="l01638"></a>01638             }
-<a name="l01639"></a>01639 
-<a name="l01640"></a>01640             cpl_propertylist_delete(reference);
-<a name="l01641"></a>01641             <span class="keywordflow">return</span> 0;
-<a name="l01642"></a>01642         }
-<a name="l01643"></a>01643 
-<a name="l01644"></a>01644         cpl_propertylist_delete(reference);
-<a name="l01645"></a>01645 
-<a name="l01646"></a>01646         frame = cpl_frameset_get_next(frameset);
-<a name="l01647"></a>01647     }
-<a name="l01648"></a>01648 
-<a name="l01649"></a>01649 
-<a name="l01650"></a>01650     <span class="keywordflow">if</span> (!found)
-<a name="l01651"></a>01651         <span class="keywordflow">return</span> 1;
-<a name="l01652"></a>01652 
-<a name="l01653"></a>01653     frame = cpl_frameset_get_first(frameset);
-<a name="l01654"></a>01654 
-<a name="l01655"></a>01655     <span class="keywordflow">while</span> (frame) {
-<a name="l01656"></a>01656 
-<a name="l01657"></a>01657         reference = cpl_propertylist_load(cpl_frame_get_filename(frame), 0);
-<a name="l01658"></a>01658         <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_BAD_FILE_FORMAT) {
-<a name="l01659"></a>01659             cpl_error_reset();
-<a name="l01660"></a>01660             frame = cpl_frameset_get_next(frameset);
-<a name="l01661"></a>01661             <span class="keywordflow">continue</span>;
-<a name="l01662"></a>01662         }
-<a name="l01663"></a>01663 
-<a name="l01664"></a>01664         <span class="keywordflow">if</span> (cpl_propertylist_has(reference, keyword)) {
-<a name="l01665"></a>01665 
-<a name="l01666"></a>01666             type = cpl_propertylist_get_type(reference, keyword);
-<a name="l01667"></a>01667 
-<a name="l01668"></a>01668             <span class="keywordflow">if</span> (rtype != type) {
-<a name="l01669"></a>01669                 cpl_propertylist_delete(reference);
-<a name="l01670"></a>01670                 <span class="keywordflow">return</span> 0;
-<a name="l01671"></a>01671             }
-<a name="l01672"></a>01672 
-<a name="l01673"></a>01673             <span class="keywordflow">if</span> (rtype == CPL_TYPE_STRING) {
-<a name="l01674"></a>01674                 string = cpl_propertylist_get_string(reference, 
-<a name="l01675"></a>01675                                                      keyword);
-<a name="l01676"></a>01676                 <span class="keywordflow">if</span> (strncmp(rstring, string, 15)) {
-<a name="l01677"></a>01677                     cpl_propertylist_delete(reference);
-<a name="l01678"></a>01678                     <span class="keywordflow">return</span> 0;
-<a name="l01679"></a>01679                 }
-<a name="l01680"></a>01680             }
-<a name="l01681"></a>01681 
-<a name="l01682"></a>01682             <span class="keywordflow">if</span> (rtype == CPL_TYPE_INT) {
-<a name="l01683"></a>01683                 intero = cpl_propertylist_get_int(reference, keyword);
-<a name="l01684"></a>01684                 <span class="keywordflow">if</span> (rintero - intero) {
-<a name="l01685"></a>01685                     cpl_propertylist_delete(reference);
-<a name="l01686"></a>01686                     <span class="keywordflow">return</span> 0;
-<a name="l01687"></a>01687                 }
-<a name="l01688"></a>01688             }
-<a name="l01689"></a>01689         }
-<a name="l01690"></a>01690 
-<a name="l01691"></a>01691         cpl_propertylist_delete(reference);
-<a name="l01692"></a>01692 
-<a name="l01693"></a>01693         frame = cpl_frameset_get_next(frameset);
-<a name="l01694"></a>01694     }
-<a name="l01695"></a>01695 
-<a name="l01696"></a>01696     <span class="keywordflow">if</span> (rtype == CPL_TYPE_STRING)
-<a name="l01697"></a>01697         cpl_free((<span class="keywordtype">void</span> *)rstring);
-<a name="l01698"></a>01698 
-<a name="l01699"></a>01699     <span class="keywordflow">return</span> 1;
-<a name="l01700"></a>01700 
-<a name="l01701"></a>01701 }
-<a name="l01702"></a>01702 
-<a name="l01712"></a><a class="code" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">01712</a> cpl_error_code <a class="code" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">dfs_save_table_ext</a>(cpl_table        * table,
-<a name="l01713"></a>01713                   <span class="keyword">const</span> <span class="keywordtype">char</span>             * tag,
-<a name="l01714"></a>01714                   cpl_propertylist * extheader)
-<a name="l01715"></a>01715 {
-<a name="l01716"></a>01716     <span class="keywordtype">char</span> * filename = cpl_calloc(strlen(tag) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l01717"></a>01717     cpl_propertylist * header;
-<a name="l01718"></a>01718 
-<a name="l01719"></a>01719     <span class="keywordflow">if</span> (extheader) { 
-<a name="l01720"></a>01720     header = cpl_propertylist_duplicate(extheader);
-<a name="l01721"></a>01721 
-<a name="l01722"></a>01722     cpl_propertylist_erase_regexp(header, 
-<a name="l01723"></a>01723                                       <span class="stringliteral">"^ESO DPR |^ARCFILE$|^ORIGFILE$"</span>, 0);
-<a name="l01724"></a>01724     } <span class="keywordflow">else</span> {
-<a name="l01725"></a>01725     header = NULL;
-<a name="l01726"></a>01726     }
-<a name="l01727"></a>01727 
-<a name="l01728"></a>01728     <a class="code" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">strlower</a>(strcpy(filename, tag));
-<a name="l01729"></a>01729     strcat(filename, <span class="stringliteral">".fits"</span>);
-<a name="l01730"></a>01730     
-<a name="l01731"></a>01731     <span class="keywordflow">if</span> (cpl_table_save(table, NULL, header, filename, CPL_IO_EXTEND)) {
-<a name="l01732"></a>01732     cpl_free(filename);
-<a name="l01733"></a>01733     cpl_ensure_code(0, CPL_ERROR_FILE_IO);
-<a name="l01734"></a>01734     }
-<a name="l01735"></a>01735     
-<a name="l01736"></a>01736     cpl_propertylist_delete(header);
-<a name="l01737"></a>01737     cpl_free(filename);
-<a name="l01738"></a>01738 
-<a name="l01739"></a>01739     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l01740"></a>01740 }
-<a name="l01741"></a>01741 
-<a name="l01751"></a><a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">01751</a> cpl_error_code <a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(cpl_image        * image,
-<a name="l01752"></a>01752                   <span class="keyword">const</span> <span class="keywordtype">char</span>             * tag,
-<a name="l01753"></a>01753                   cpl_propertylist * extheader)
-<a name="l01754"></a>01754 {
-<a name="l01755"></a>01755     <span class="keywordtype">char</span> * filename = cpl_calloc(strlen(tag) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l01756"></a>01756     
-<a name="l01757"></a>01757     cpl_propertylist * header;
-<a name="l01758"></a>01758 
-<a name="l01759"></a>01759     <span class="keywordflow">if</span> (extheader) {
-<a name="l01760"></a>01760     header = cpl_propertylist_duplicate(extheader);
-<a name="l01761"></a>01761 
-<a name="l01762"></a>01762     cpl_propertylist_erase_regexp(header, 
-<a name="l01763"></a>01763                                       <span class="stringliteral">"^ESO DPR |^ARCFILE$|^ORIGFILE$"</span>, 0);
-<a name="l01764"></a>01764     } <span class="keywordflow">else</span> {
-<a name="l01765"></a>01765     header = NULL;
-<a name="l01766"></a>01766     }
-<a name="l01767"></a>01767 
-<a name="l01768"></a>01768     <a class="code" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">strlower</a>(strcpy(filename, tag));
-<a name="l01769"></a>01769     strcat(filename, <span class="stringliteral">".fits"</span>);
-<a name="l01770"></a>01770     
-<a name="l01771"></a>01771     <span class="keywordflow">if</span> (cpl_image_save(image, filename, CPL_BPP_IEEE_FLOAT,
-<a name="l01772"></a>01772                header, CPL_IO_EXTEND)) {
-<a name="l01773"></a>01773     cpl_free(filename);
-<a name="l01774"></a>01774     cpl_ensure_code(0, CPL_ERROR_FILE_IO);
-<a name="l01775"></a>01775     }
-<a name="l01776"></a>01776     
-<a name="l01777"></a>01777     cpl_propertylist_delete(header);
-<a name="l01778"></a>01778     cpl_free(filename);
-<a name="l01779"></a>01779 
-<a name="l01780"></a>01780     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l01781"></a>01781 }
-<a name="l01782"></a>01782 
-<a name="l01794"></a><a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">01794</a> cpl_error_code <a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(cpl_frameset * frameset,
-<a name="l01795"></a>01795                    cpl_parameterlist * parlist,
-<a name="l01796"></a>01796                    <span class="keyword">const</span> <span class="keywordtype">char</span> * tag,
-<a name="l01797"></a>01797                    <span class="keyword">const</span> <span class="keywordtype">char</span> * recipename,
-<a name="l01798"></a>01798                    <span class="keyword">const</span> <span class="keywordtype">char</span> * version)
-<a name="l01799"></a>01799 {
-<a name="l01800"></a>01800     <span class="keyword">const</span> <span class="keywordtype">char</span> * regexp = <span class="stringliteral">"ESO DET OUT1 OVSCX|"</span>
-<a name="l01801"></a>01801                       <span class="stringliteral">"ESO DET OUT1 PRSCX|"</span>
-<a name="l01802"></a>01802                           <span class="stringliteral">"ESO DET OUT1 OVSCY|"</span>
-<a name="l01803"></a>01803                           <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>;
-<a name="l01804"></a>01804 
-<a name="l01805"></a>01805     <span class="keywordtype">char</span> * filename = cpl_calloc(strlen(tag) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l01806"></a>01806 
-<a name="l01807"></a>01807     cpl_error_code error;
-<a name="l01808"></a>01808 
-<a name="l01809"></a>01809     cpl_propertylist * pro = cpl_propertylist_new();
-<a name="l01810"></a>01810         
-<a name="l01811"></a>01811     cpl_propertylist_append_string(pro, <span class="stringliteral">"ESO PRO CATG"</span>, tag);
-<a name="l01812"></a>01812 
-<a name="l01813"></a>01813     <a class="code" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">strlower</a>(strcpy(filename, tag));
-<a name="l01814"></a>01814     strcat(filename, <span class="stringliteral">".fits"</span>);
-<a name="l01815"></a>01815 
-<a name="l01816"></a>01816 <span class="preprocessor">#if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(4, 8, 0)</span>
-<a name="l01817"></a>01817 <span class="preprocessor"></span>    error = cpl_dfs_save_image(frameset, NULL, parlist, frameset, NULL, NULL,
-<a name="l01818"></a>01818                    CPL_BPP_IEEE_FLOAT, recipename, pro,
-<a name="l01819"></a>01819                    regexp, version, filename);
-<a name="l01820"></a>01820 <span class="preprocessor">#else</span>
-<a name="l01821"></a>01821 <span class="preprocessor"></span>    error = cpl_dfs_save_image(frameset, parlist, frameset, NULL,
-<a name="l01822"></a>01822                    CPL_BPP_IEEE_FLOAT, recipename, tag,
-<a name="l01823"></a>01823                    NULL, regexp, version, filename);
-<a name="l01824"></a>01824 <span class="preprocessor">#endif</span>
-<a name="l01825"></a>01825 <span class="preprocessor"></span>    
-<a name="l01826"></a>01826     cpl_free(filename);
-<a name="l01827"></a>01827     cpl_propertylist_delete(pro);
-<a name="l01828"></a>01828 
-<a name="l01829"></a>01829     <span class="keywordflow">return</span> error;
-<a name="l01830"></a>01830 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__dfs_8c_source.html b/html/fors__dfs_8c_source.html
new file mode 100644
index 0000000..65b2973
--- /dev/null
+++ b/html/fors__dfs_8c_source.html
@@ -0,0 +1,1580 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_dfs.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_dfs.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_dfs.c,v 1.47 2013-10-09 15:58:42 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-09 15:58:42 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.47 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <ctype.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include <unistd.h></span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">#define WCS_KEYS "^((CRVAL|CRPIX|CTYPE|CDELT)[0-9]|RADECSYS|CD[0-9]_[0-9])$"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="comment">/*------------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="comment">    Prototypes</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="comment">/*------------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="comment">    Implementation</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="keyword">static</span> <span class="keywordtype">char</span> *strlower(<span class="keywordtype">char</span> *s)</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> {</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>   <span class="keywordtype">char</span> *t = s;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> </div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>   <span class="keywordflow">while</span> (*t) {</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     *t = tolower(*t);</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     t++;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>   }</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>   <span class="keywordflow">return</span> s;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> }</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="comment"></span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="comment">static char *strupper(char *s)</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="comment">{</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="comment"></span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="comment">  char *t = s;</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="comment"></span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="comment">  while (*t) {</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="comment">    *t = toupper(*t);</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="comment">    t++;</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="comment">  }</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="comment">  </span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="comment">  return s;</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="comment"></span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="comment">}</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="comment"></span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="keywordtype">char</span> *dfs_generate_filename(<span class="keyword">const</span> <span class="keywordtype">char</span> *category)</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> {</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="keywordtype">char</span> *filename = cpl_calloc(strlen(category) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     strlower(strcpy(filename, category));</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     strcat(filename, <span class="stringliteral">".fits"</span>);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     <span class="keywordflow">return</span> filename;</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> }</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="keywordtype">char</span> *dfs_generate_filename_tfits(<span class="keyword">const</span> <span class="keywordtype">char</span> *category)</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> {</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="comment">    char *filename = cpl_calloc(strlen(category) + 7, sizeof(char));</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="keywordtype">char</span> *filename = cpl_calloc(strlen(category) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     strlower(strcpy(filename, category));</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="comment">    strcat(filename, ".tfits");</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     strcat(filename, <span class="stringliteral">".fits"</span>);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     <span class="keywordflow">return</span> filename;</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> }</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno"><a class="code" href="group__forsdfs.html#gaa72aa06ad8174e7f9e14b556e1ec130f">  147</a></span> <a class="code" href="group__forsdfs.html#gaa72aa06ad8174e7f9e14b556e1ec130f" title="Dump a single CPL error.">errorstate_dump_one</a>(<span class="keywordtype">unsigned</span> <span class="keyword">self</span>, <span class="keywordtype">unsigned</span> first, <span class="keywordtype">unsigned</span> last)</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> {</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="keyword">const</span> cpl_boolean is_reverse = first > last ? CPL_TRUE : CPL_FALSE;</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="keyword">const</span> <span class="keywordtype">unsigned</span>    newest     = is_reverse ? first : last;</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="keyword">const</span> <span class="keywordtype">unsigned</span>    oldest     = is_reverse ? last : first;</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>      * revmsg     = is_reverse ? <span class="stringliteral">" in reverse order"</span> : <span class="stringliteral">""</span>;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="comment">/* Cannot use internal CPL functions</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="comment">       cx_assert( oldest <= self );</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="comment">       cx_assert( newest >= self ); */</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="keywordflow">if</span> (newest == 0) {</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"No error(s) to dump"</span>);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>         <span class="comment">/* cx_assert( oldest == 0); */</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>         <span class="comment">/*  cx_assert( oldest > 0);</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="comment">            cx_assert( newest >= oldest); */</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>         <span class="keywordflow">if</span> (<span class="keyword">self</span> == first) {</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>             <span class="keywordflow">if</span> (oldest == 1) {</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                 cpl_msg_debug(cpl_func, <span class="stringliteral">"Dumping all %u error(s)%s:"</span>, newest,</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>                               revmsg);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>             } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"Dumping the %u most recent error(s) "</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                               <span class="stringliteral">"out of a total of %u errors%s:"</span>,</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>                               newest - oldest + 1, newest, revmsg);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>             }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>         }</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *message_from_cpl = cpl_error_get_message();</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>         <span class="keywordflow">if</span> (message_from_cpl == NULL) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>             <span class="comment">/* This should never happen */</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Unspecified error"</span>);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         }</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>         <span class="comment">/* Skip the standard (non-informative) CPL message string, </span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="comment">           which usually terminates with ': '</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="comment"></span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="comment">           If no user-defined error message is given, </span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="comment">           print the CPL standard message</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>         <span class="keywordflow">while</span> (*message_from_cpl != <span class="charliteral">'\0'</span> && *message_from_cpl != <span class="charliteral">':'</span>) {</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>             message_from_cpl += 1;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>         }</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>         </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>         <span class="keywordflow">if</span> (*message_from_cpl != <span class="charliteral">'\0'</span>) {</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>             message_from_cpl += 1;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>             </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>             <span class="keywordflow">if</span> (*message_from_cpl == <span class="charliteral">' '</span>) message_from_cpl++;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>             </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>             <span class="keywordflow">if</span> (*message_from_cpl != <span class="charliteral">'\0'</span>) {</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                 <span class="comment">/* Still something left of the string */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"%s [%s]"</span>, message_from_cpl,</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                               cpl_error_get_where());</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>             }</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"%s [%s]"</span>,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                               cpl_error_get_message(), cpl_error_get_where());</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>         }</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         }</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>             <span class="comment">/* Found no ':' is CPL message string */</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"%s [%s]"</span>,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                           cpl_error_get_message(), cpl_error_get_where());</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         }</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     }</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce">  230</a></span> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce" title="Start recipe execution.">fors_begin</a>(cpl_frameset *frames,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *description_short)</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> {</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"%s"</span>, PACKAGE_STRING);   </div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"%s"</span>, description_short);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     </div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <a class="code" href="group__forsdfs.html#ga5162766f25e67bb99869e7959c3f8201" title="Set the group as RAW or CALIB in a frameset.">fors_dfs_set_groups</a>(frames);</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Input frame%s:"</span>, </div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>                  cpl_frameset_get_size(frames) != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <a class="code" href="group__fors__utils.html#ga414e1f2d95f271cc76a67e525b910e96" title="Print a frame set.">fors_frameset_print</a>(frames);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     </div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> }</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno"><a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9">  258</a></span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9" title="End recipe execution.">fors_end</a>(<span class="keyword">const</span> cpl_frameset *frames, cpl_errorstate before_exec)</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> {</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>         <span class="keyword">const</span> cpl_frame *f;</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>         </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Product frame%s:"</span>, </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                      cpl_frameset_get_size(frames) != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>         <span class="keywordflow">for</span> (f = cpl_frameset_get_first_const(frames);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>              f != NULL;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>              f = cpl_frameset_get_next_const(frames)) {</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>             <span class="keywordflow">if</span> (cpl_frame_get_group(f) == CPL_FRAME_GROUP_PRODUCT) {</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>                 <a class="code" href="group__fors__utils.html#ga6692a0ba541b3e7f99654f844aee40c6" title="Print a frame.">fors_frame_print</a>(f);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>             }</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>         }</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>         <span class="comment">/* Shut up EsoRex */</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>         <span class="comment">//cpl_msg_set_level(CPL_MSG_WARNING);</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     }</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>         cpl_errorstate_dump(before_exec, CPL_FALSE, <a class="code" href="group__forsdfs.html#gaa72aa06ad8174e7f9e14b556e1ec130f" title="Dump a single CPL error.">errorstate_dump_one</a>);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     }</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> }</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga5162766f25e67bb99869e7959c3f8201">  296</a></span> <a class="code" href="group__forsdfs.html#ga5162766f25e67bb99869e7959c3f8201" title="Set the group as RAW or CALIB in a frameset.">fors_dfs_set_groups</a>(cpl_frameset * <span class="keyword">set</span>)</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> {</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     cpl_frame *f;</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <span class="keyword">set</span> != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     <span class="keywordflow">for</span> (f = cpl_frameset_get_first(<span class="keyword">set</span>);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>          f != NULL;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>          f = cpl_frameset_get_next(<span class="keyword">set</span>)) {</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *tag = cpl_frame_get_tag(f);</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>         <span class="keywordflow">if</span> (tag != NULL) {</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>             <span class="keywordflow">if</span> (strcmp(tag, BIAS              ) == 0 ||</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                 strcmp(tag, DARK              ) == 0 ||</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>                 strcmp(tag, SCREEN_FLAT_IMG   ) == 0 ||</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>                 strcmp(tag, SKY_FLAT_IMG      ) == 0 ||</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                 strcmp(tag, STANDARD_IMG      ) == 0 ||</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                 strcmp(tag, <span class="stringliteral">"LAMP_PMOS"</span>       ) == 0 ||</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>                 strcmp(tag, <span class="stringliteral">"SCREEN_FLAT_PMOS"</span>) == 0 ||</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>                 strcmp(tag, <span class="stringliteral">"STANDARD_PMOS"</span>   ) == 0 ||</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>                 strcmp(tag, <span class="stringliteral">"SCIENCE_PMOS"</span>    ) == 0 ||</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                 strcmp(tag, SCIENCE_IMG       ) == 0 ) {</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>                 cpl_frame_set_group(f, CPL_FRAME_GROUP_RAW);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>             }</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(tag, MASTER_BIAS                    ) == 0 ||</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                      strcmp(tag, MASTER_DARK                    ) == 0 ||</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                      strcmp(tag, MASTER_SCREEN_FLAT_IMG         ) == 0 ||</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                      strcmp(tag, MASTER_SKY_FLAT_IMG            ) == 0 ||</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>                      strcmp(tag, ALIGNED_PHOT                   ) == 0 ||</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>                      strcmp(tag, <span class="stringliteral">"MASTER_NORM_FLAT_PMOS"</span>        ) == 0 ||</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>                      strcmp(tag, <span class="stringliteral">"DISP_COEFF_PMOS"</span>              ) == 0 ||</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>                      strcmp(tag, <span class="stringliteral">"CURV_COEFF_PMOS"</span>              ) == 0 ||</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>                      strcmp(tag, <span class="stringliteral">"SLIT_LOCATION_PMOS"</span>           ) == 0 ||</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                      <span class="comment">/* static calibration */</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>                      strcmp(tag, FLX_STD_IMG                    ) == 0 ||</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>                      strcmp(tag, <span class="stringliteral">"MASTER_LINECAT"</span>               ) == 0 ||</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>                      strcmp(tag, <span class="stringliteral">"MASTER_DISTORTION_TABLE"</span>      ) == 0 ||</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>                      strcmp(tag, <span class="stringliteral">"RETARDER_WAVEPLATE_CHROMATISM"</span>) == 0 ||</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>                      strcmp(tag, <span class="stringliteral">"GRISM_TABLE"</span>                  ) == 0 ||</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                      strcmp(tag, <span class="stringliteral">"STD_PMOS_TABLE"</span>               ) == 0 ||</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>                      strcmp(tag, PHOT_TABLE                     ) == 0) {</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>                 cpl_frame_set_group(f, CPL_FRAME_GROUP_CALIB);</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>             }</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>                 cpl_msg_warning(cpl_func, <span class="stringliteral">"Unrecognized frame tag: '%s'"</span>,</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>                                 tag);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>             }</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         }</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     }</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> }</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *</div>
+<div class="line"><a name="l00363"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga31c40f4add0fc7ef1e992d99493f5d1a">  363</a></span> <a class="code" href="group__forsdfs.html#ga31c40f4add0fc7ef1e992d99493f5d1a" title="Get pipeline and instrument versions.">fors_dfs_pipeline_version</a>(<span class="keyword">const</span> cpl_propertylist *header, </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>                           <span class="keyword">const</span> <span class="keywordtype">char</span> **instrument_version)</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> {</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *instrume = NULL;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     </div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     instrume = cpl_propertylist_get_string(header, </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                                            FORS_PFITS_INSTRUME);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>             <span class="stringliteral">"Missing keyword %s in input header"</span>, FORS_PFITS_INSTRUME);</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     </div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( strlen(instrume) >= 5, <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>             <span class="stringliteral">"%s keyword must be 'fors1' or 'fors2', not '%s'"</span>, </div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>             FORS_PFITS_INSTRUME, instrume);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> </div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( instrume[4] == <span class="charliteral">'1'</span> || instrume[4] == <span class="charliteral">'2'</span>, <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>             <span class="stringliteral">"Unrecognized %s: %s"</span>, FORS_PFITS_INSTRUME, instrume);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> </div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     <span class="keywordflow">if</span> (instrument_version != NULL) {</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>         *instrument_version = cpl_sprintf(<span class="stringliteral">"%s"</span>, instrume);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     }</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="keywordflow">return</span> cpl_sprintf(<span class="stringliteral">"fors%c/%s"</span>, instrume[4], PACKAGE_VERSION);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> }</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> </div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00410"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22">  410</a></span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name,</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>                           <span class="keyword">const</span> cpl_table *defaults)</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> {</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_get_parameter_int"</span>;</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>    *alias;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     cpl_parameter *param;</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> </div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> </div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     <span class="keywordflow">if</span> (parlist == NULL) {</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter list"</span>);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     }</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span> </div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     <span class="keywordflow">if</span> (name == NULL) {</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter name"</span>);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     }</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     param = cpl_parameterlist_find(parlist, name);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keywordflow">if</span> (param == NULL) {</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         cpl_msg_error(func, <span class="stringliteral">"Wrong parameter name: %s"</span>, name);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     }</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <span class="keywordflow">if</span> (cpl_parameter_get_type(param) != CPL_TYPE_INT) {</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>         cpl_msg_error(func, <span class="stringliteral">"Unexpected type for parameter "</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                       <span class="stringliteral">"\"%s\": it should be integer"</span>, name);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     }</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     alias = cpl_parameter_get_alias(param, CPL_PARAMETER_MODE_CLI);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> <span class="comment">//    if (defaults && cpl_parameter_get_default_flag(param) == 0) {</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     <span class="keywordflow">if</span> (defaults && </div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         cpl_parameter_get_default_int(param) == cpl_parameter_get_int(param)) {</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     </div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>         <span class="keywordflow">if</span> (cpl_table_has_column(defaults, alias)) {</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>             <span class="keywordflow">if</span> (cpl_table_get_column_type(defaults, alias) != CPL_TYPE_INT) {</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>                 cpl_msg_error(func, <span class="stringliteral">"Unexpected type for GRISM_TABLE "</span></div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>                               <span class="stringliteral">"column \"%s\": it should be integer"</span>, alias);</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>                 cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>                 <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>             }</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>             <span class="keywordflow">if</span> (cpl_table_is_valid(defaults, alias, 0)) {</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>                 cpl_parameter_set_int(param, cpl_table_get_int(defaults, </div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>                                                                alias, 0, NULL));</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>             }</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>                 cpl_msg_error(func, <span class="stringliteral">"Invalid parameter value in table "</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>                               <span class="stringliteral">"column \"%s\""</span>, alias);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>                 <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>             }</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         }</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>             cpl_msg_warning(func, <span class="stringliteral">"Parameter \"%s\" not found in GRISM_TABLE "</span></div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>                             <span class="stringliteral">"- using recipe default"</span>, alias);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         }</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     }</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> </div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     cpl_msg_info(func, <span class="stringliteral">"%s:"</span>, alias);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     cpl_msg_info(func, <span class="stringliteral">"%s: %d"</span>,</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>                  cpl_parameter_get_help(param), cpl_parameter_get_int(param));</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     <span class="keywordflow">return</span> cpl_parameter_get_int(param);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> }</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> </div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00507"></a><span class="lineno"><a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96">  507</a></span> <span class="keywordtype">double</span> <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> cpl_table *defaults)</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> {</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_get_parameter_double"</span>;</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>    *alias;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     cpl_parameter *param;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span> </div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     <span class="keywordflow">if</span> (parlist == NULL) {</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter list"</span>);</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     }</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span> </div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     <span class="keywordflow">if</span> (name == NULL) {</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter name"</span>);</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     }</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     param = cpl_parameterlist_find(parlist, name);</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> </div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>     <span class="keywordflow">if</span> (param == NULL) {</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>         cpl_msg_error(func, <span class="stringliteral">"Wrong parameter name: %s"</span>, name);</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     }</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> </div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordflow">if</span> (cpl_parameter_get_type(param) != CPL_TYPE_DOUBLE) {</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>         cpl_msg_error(func, <span class="stringliteral">"Unexpected type for parameter "</span></div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>                       <span class="stringliteral">"\"%s\": it should be double"</span>, name);</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     }</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> </div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     alias = cpl_parameter_get_alias(param, CPL_PARAMETER_MODE_CLI);</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span> <span class="comment">//    if (defaults && cpl_parameter_get_default_flag(param) == 0) {</span></div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keywordflow">if</span> (defaults && </div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         cpl_parameter_get_default_double(param) == </div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         cpl_parameter_get_double(param)) {</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         <span class="keywordflow">if</span> (cpl_table_has_column(defaults, alias)) {</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>             <span class="keywordflow">if</span> (cpl_table_get_column_type(defaults, alias) != CPL_TYPE_DOUBLE) {</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>                 cpl_msg_error(func, <span class="stringliteral">"Unexpected type for GRISM_TABL "</span></div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>                               <span class="stringliteral">"column \"%s\": it should be double"</span>, alias);</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>                 cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>                 <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>             }</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>             <span class="keywordflow">if</span> (cpl_table_is_valid(defaults, alias, 0)) {</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>                 cpl_parameter_set_double(param, cpl_table_get_double(defaults, </div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>                                                                alias, 0, NULL));</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>             }</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>                 cpl_msg_error(func, <span class="stringliteral">"Invalid parameter value in table "</span></div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>                               <span class="stringliteral">"column \"%s\""</span>, alias);</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>                 <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>             }</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>         }</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>             cpl_msg_warning(func, <span class="stringliteral">"Parameter \"%s\" not found in GRISM_TABLE "</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>                             <span class="stringliteral">"- using recipe default"</span>, alias);</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>         }</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     }</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span> </div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     cpl_msg_info(func, <span class="stringliteral">"%s:"</span>, alias);</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     cpl_msg_info(func, <span class="stringliteral">"%s: %f"</span>,</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>                  cpl_parameter_get_help(param), cpl_parameter_get_double(param));</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     <span class="keywordflow">return</span> cpl_parameter_get_double(param);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> }</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span> </div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197">  605</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *name, </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>                                      <span class="keyword">const</span> cpl_table *defaults)</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> {</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_get_parameter_string"</span>;</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span> </div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>    *alias;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     cpl_parameter *param;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span> </div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> </div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     <span class="keywordflow">if</span> (parlist == NULL) {</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter list"</span>);</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     }</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     <span class="keywordflow">if</span> (name == NULL) {</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter name"</span>);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     }</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> </div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     param = cpl_parameterlist_find(parlist, name);</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span> </div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     <span class="keywordflow">if</span> (param == NULL) {</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>         cpl_msg_error(func, <span class="stringliteral">"Wrong parameter name: %s"</span>, name);</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     }</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span> </div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     <span class="keywordflow">if</span> (cpl_parameter_get_type(param) != CPL_TYPE_STRING) {</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>         cpl_msg_error(func, <span class="stringliteral">"Unexpected type for parameter "</span></div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>                       <span class="stringliteral">"\"%s\": it should be string"</span>, name);</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     }</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> </div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     alias = cpl_parameter_get_alias(param, CPL_PARAMETER_MODE_CLI);</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> </div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> <span class="comment">//    if (defaults && cpl_parameter_get_default_flag(param) == 0) {</span></div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     <span class="keywordflow">if</span> (defaults && </div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>         strcmp(cpl_parameter_get_default_string(param), </div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>                cpl_parameter_get_string(param)) == 0) {</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     </div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>         <span class="keywordflow">if</span> (cpl_table_has_column(defaults, alias)) {</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>             <span class="keywordflow">if</span> (cpl_table_get_column_type(defaults, alias) != CPL_TYPE_STRING) {</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>                 cpl_msg_error(func, <span class="stringliteral">"Unexpected type for GRISM_TABLE "</span></div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>                               <span class="stringliteral">"column \"%s\": it should be string"</span>, alias);</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>                 cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>                 <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>             }</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>             <span class="keywordflow">if</span> (cpl_table_is_valid(defaults, alias, 0)) {</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>                 cpl_parameter_set_string(param, cpl_table_get_string(defaults, </div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>                                                              alias, 0));</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>             }</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>                 cpl_msg_error(func, <span class="stringliteral">"Invalid parameter value in table "</span></div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>                               <span class="stringliteral">"column \"%s\""</span>, alias);</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>                 <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>             }</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>         }</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>             cpl_msg_warning(func, <span class="stringliteral">"Parameter \"%s\" not found in GRISM_TABLE "</span></div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>                             <span class="stringliteral">"- using recipe default"</span>, alias);</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>         }</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     }</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span> </div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     cpl_msg_info(func, <span class="stringliteral">"%s:"</span>, alias);</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     cpl_msg_info(func, <span class="stringliteral">"%s: %s"</span>, cpl_parameter_get_help(param), </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>                  cpl_parameter_get_string(param));</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> </div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     <span class="keywordflow">return</span> cpl_parameter_get_string(param);</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span> </div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span> }</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span> </div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00704"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb">  704</a></span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name,</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>                            <span class="keyword">const</span> cpl_table *defaults)</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> {</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_get_parameter_bool"</span>;</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> </div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>    *alias;</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     cpl_parameter *param;</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     <span class="keywordtype">int</span>            value;</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span> </div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> </div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     <span class="keywordflow">if</span> (parlist == NULL) {</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter list"</span>);</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     }</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> </div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     <span class="keywordflow">if</span> (name == NULL) {</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>         cpl_msg_error(func, <span class="stringliteral">"Missing input parameter name"</span>);</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     }</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span> </div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     param = cpl_parameterlist_find(parlist, name);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> </div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     <span class="keywordflow">if</span> (param == NULL) {</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>         cpl_msg_error(func, <span class="stringliteral">"Wrong parameter name: %s"</span>, name);</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     }</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span> </div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     <span class="keywordflow">if</span> (cpl_parameter_get_type(param) != CPL_TYPE_BOOL) {</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>         cpl_msg_error(func, <span class="stringliteral">"Unexpected type for parameter "</span></div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>                       <span class="stringliteral">"\"%s\": it should be boolean"</span>, name);</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     }</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span> </div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     alias = cpl_parameter_get_alias(param, CPL_PARAMETER_MODE_CLI);</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span> </div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span> <span class="comment">//    if (defaults && cpl_parameter_get_default_flag(param) == 0) {</span></div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     <span class="keywordflow">if</span> (defaults && </div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>         cpl_parameter_get_default_bool(param) == </div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>         cpl_parameter_get_bool(param)) {</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>     </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>         <span class="keywordflow">if</span> (cpl_table_has_column(defaults, alias)) {</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>             <span class="keywordflow">if</span> (cpl_table_get_column_type(defaults, alias) != CPL_TYPE_INT) {</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>                 cpl_msg_error(func, <span class="stringliteral">"Unexpected type for GRISM_TABLE "</span></div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>                               <span class="stringliteral">"column \"%s\": it should be integer"</span>, alias);</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>                 cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>                 <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>             }</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>             <span class="keywordflow">if</span> (cpl_table_is_valid(defaults, alias, 0)) {</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>                 value = cpl_table_get_int(defaults, alias, 0, NULL);</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>                 <span class="keywordflow">if</span> (value < 0 || value > 1) {</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>                     cpl_msg_error(func, <span class="stringliteral">"Illegal parameter value in table "</span></div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>                                   <span class="stringliteral">"column \"%s\": it should be either 0 or 1"</span>, </div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>                                   alias);</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>                     cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>                     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>                 }</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>                 cpl_parameter_set_bool(param, value);</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>             }</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>                 cpl_msg_error(func, <span class="stringliteral">"Invalid parameter value in table "</span></div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>                               <span class="stringliteral">"column \"%s\""</span>, alias);</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>                 <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>             }</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>         }</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>             cpl_msg_warning(func, <span class="stringliteral">"Parameter \"%s\" not found in GRISM_TABLE "</span></div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>                             <span class="stringliteral">"- using recipe default"</span>, alias);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>         }</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>     }</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span> </div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>     value = cpl_parameter_get_bool(param);</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> </div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>     <span class="keywordflow">if</span> (value) {</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>         cpl_msg_info(func, <span class="stringliteral">"%s:"</span>, alias);</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>         cpl_msg_info(func, <span class="stringliteral">"%s: TRUE"</span>, cpl_parameter_get_help(param));</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     }</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>         cpl_msg_info(func, <span class="stringliteral">"%s:"</span>, alias);</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>         cpl_msg_info(func, <span class="stringliteral">"%s: FALSE"</span>, cpl_parameter_get_help(param));</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     }</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> </div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     <span class="keywordflow">return</span> value;</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span> </div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> }</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span> </div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00799"></a><span class="lineno"><a class="code" href="group__forsdfs.html#gae0dc63f80258d73a93d35e41b2a8b367">  799</a></span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gae0dc63f80258d73a93d35e41b2a8b367">dfs_get_parameter_bool_const</a>(<span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name)</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span> {</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>((cpl_parameterlist *)parlist, name, NULL);</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span> }</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span> </div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00809"></a><span class="lineno"><a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">  809</a></span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(<span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name)</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span> {</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>((cpl_parameterlist *)parlist, name, NULL);</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span> }</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span> </div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00819"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">  819</a></span> <span class="keywordtype">double</span> <a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a>(<span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name)</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span> {</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>((cpl_parameterlist *)parlist, name, NULL);</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span> }</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span> </div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00829"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">  829</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">dfs_get_parameter_string_const</a>(<span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *name)</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span> {</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>((cpl_parameterlist *)parlist, name, NULL);</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span> }</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span> </div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00863"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660">  863</a></span> cpl_image *<a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(cpl_frameset *frameset, <span class="keyword">const</span> <span class="keywordtype">char</span> *category, </div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>                           cpl_type type, <span class="keywordtype">int</span> ext, <span class="keywordtype">int</span> calib)</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span> {</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_load_image"</span>;</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span> </div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>     cpl_frame  *frame = NULL;</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>     cpl_image  *image = NULL;</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span> </div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span> </div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>     frame = cpl_frameset_find(frameset, category);</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span> </div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>     <span class="keywordflow">if</span> (frame) {</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>         image = cpl_image_load(cpl_frame_get_filename(frame), type, 0, ext);</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>         <span class="keywordflow">if</span> (image == NULL) {</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>             cpl_msg_error(cpl_error_get_where(),<span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>             cpl_msg_error(func, <span class="stringliteral">"Cannot load image %s"</span>,</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>                           cpl_frame_get_filename(frame));</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>         }</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>             <span class="keywordflow">if</span> (calib) </div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>                 cpl_frame_set_group(frame, CPL_FRAME_GROUP_CALIB);</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>                 cpl_frame_set_group(frame, CPL_FRAME_GROUP_RAW);</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>         }</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>     }</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span> </div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>     <span class="keywordflow">return</span> image;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span> }</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span> </div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00919"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649">  919</a></span> cpl_table *<a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(cpl_frameset *frameset, <span class="keyword">const</span> <span class="keywordtype">char</span> *category, <span class="keywordtype">int</span> ext)</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span> {</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_load_table"</span>;</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span> </div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>     cpl_frame  *frame = NULL;</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>     cpl_table  *table = NULL;</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span> </div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span> </div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>     frame = cpl_frameset_find(frameset, category);</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span> </div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>     <span class="keywordflow">if</span> (frame) {</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>         table = cpl_table_load(cpl_frame_get_filename(frame), ext, 1);</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>         <span class="keywordflow">if</span> (table == NULL) {</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>             cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>             cpl_msg_error(func, <span class="stringliteral">"Cannot load table %s"</span>,</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>                           cpl_frame_get_filename(frame));</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>         }</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>             cpl_frame_set_group(frame, CPL_FRAME_GROUP_CALIB);</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>     }</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span> </div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>     <span class="keywordflow">return</span> table;</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span> }</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span> </div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00969"></a><span class="lineno"><a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf">  969</a></span> cpl_propertylist *<a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(cpl_frameset *frameset, </div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>                                   <span class="keyword">const</span> <span class="keywordtype">char</span> *category, <span class="keywordtype">int</span> ext)</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span> {</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"dfs_load_header"</span>;</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span> </div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>     cpl_frame         *frame = NULL;</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>     cpl_propertylist  *plist = NULL;</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span> </div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span> </div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>     frame = cpl_frameset_find(frameset, category);</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span> </div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>     <span class="keywordflow">if</span> (frame) {</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>         plist = cpl_propertylist_load(cpl_frame_get_filename(frame), ext);</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>         <span class="keywordflow">if</span> (plist == NULL) {</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>             cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>             cpl_msg_error(func, <span class="stringliteral">"Cannot load header from %s"</span>,</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>                           cpl_frame_get_filename(frame));</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>         }</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>     }</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span> </div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>     <span class="keywordflow">return</span> plist;</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span> }</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span> </div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l01001"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga04ce01a9ddd2c4ddee75010d7fdb81fd"> 1001</a></span> <a class="code" href="group__forsdfs.html#ga04ce01a9ddd2c4ddee75010d7fdb81fd" title="Save DFS product.">dfs_save</a>(cpl_frameset *frameset, <span class="keyword">const</span> <span class="keywordtype">void</span> *<span class="keywordtype">object</span>, fors_type type,</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>          <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>          <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>          <span class="keyword">const</span> cpl_frame *inherit_frame)</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span> {</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>     <span class="keywordtype">char</span>             *filename;</div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>     cpl_frame        *frame;</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>     cpl_propertylist *plist;</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *version    = NULL;</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>     cpl_propertylist *raw_header = NULL;</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span> </div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span> </div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>     <span class="keywordflow">if</span> (category == NULL || frameset == NULL || <span class="keywordtype">object</span> == NULL || </div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>         inherit_frame == NULL) {</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>         cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>     }</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span> </div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>     <span class="keywordflow">if</span> (type == FORS_TYPE_TABLE) {</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"Saving %s table to disk..."</span>, category);</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>     }</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"Saving %s image to disk..."</span>, category);</div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>     }</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span> </div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>     <span class="comment">/* Read instrument version from raw frame */</span></div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>     {</div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *raw_filename = </div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>             cpl_frame_get_filename(inherit_frame);</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>         </div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>         raw_header = cpl_propertylist_load(raw_filename, 0);</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Could not read %s primary header"</span>, raw_filename);</div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>             <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>         }</div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>         </div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>         version = <a class="code" href="group__forsdfs.html#ga31c40f4add0fc7ef1e992d99493f5d1a" title="Get pipeline and instrument versions.">fors_dfs_pipeline_version</a>(raw_header, NULL);</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>         cpl_propertylist_delete(raw_header);        </div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span> </div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Could not identify instrument version from %s header"</span>,</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>                           raw_filename);</div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>             <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>         }       </div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>     }</div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span> </div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>     filename = cpl_calloc(strlen(category) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span> </div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>     strlower(strcpy(filename, category));</div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>     strcat(filename, <span class="stringliteral">".fits"</span>);</div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span> </div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>     frame = cpl_frame_new();</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span> </div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>     cpl_frame_set_filename(frame, filename);</div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>     cpl_frame_set_tag(frame, category);</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>     cpl_frame_set_type(frame, type);</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>     cpl_frame_set_group(frame, CPL_FRAME_GROUP_PRODUCT);</div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>     cpl_frame_set_level(frame, CPL_FRAME_LEVEL_FINAL);</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>         cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot initialise the product frame"</span>);</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>         cpl_frame_delete(frame);</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>         cpl_free(filename);</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>         cpl_free((<span class="keywordtype">void</span> *)version);</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>     }</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span> </div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span> </div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span> <span class="comment">     * Produce DFS compliant FITS header for product</span></div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span> </div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>         plist = cpl_propertylist_new();</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>         plist = header;</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span> </div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>     <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>, </div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>                                      inherit_frame)) {</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Problem with product %s FITS header definition"</span>,</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>                       category);</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>             cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>         cpl_frame_delete(frame);</div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>         cpl_free(filename);</div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>         cpl_free((<span class="keywordtype">void</span> *)version);</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>     }</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span> </div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>     cpl_free((<span class="keywordtype">void</span> *)version);</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span> </div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span> <span class="comment">/* CPL3.0 </span></div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span> <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 OVSC*", 0);</span></div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span> <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 PRSC*", 0);</span></div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span> <span class="comment">/* CPL2.0 */</span></div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>);</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>);</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>);</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>);</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span> </div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span> <span class="comment">     * Write to disk</span></div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>     </div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>     <span class="keywordflow">if</span> (type == FORS_TYPE_IMAGE_ERR) {</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>         <a class="code" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save</a>((<a class="code" href="struct__fors__image.html">fors_image</a> *)<span class="keywordtype">object</span>, plist, filename);</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>     }</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (type == FORS_TYPE_IMAGE) {</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>         cpl_image_save((cpl_image *)<span class="keywordtype">object</span>, filename, CPL_BPP_IEEE_FLOAT, plist,</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>                        CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>     }</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>             cpl_table_save((cpl_table *)<span class="keywordtype">object</span>, </div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>                            plist, NULL, filename, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>     }</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>     </div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Cannot save product %s to disk"</span>, filename);</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>             cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>         cpl_frame_delete(frame);</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>         cpl_free(filename);</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>     }</div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span> </div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>         cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span> </div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>     cpl_free(filename);</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span> </div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>     cpl_frameset_insert(frameset, frame);</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span> </div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span> }</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>     </div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l01166"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga45cefe5c9339a8b27be0454c9144a70a"> 1166</a></span> <a class="code" href="group__forsdfs.html#ga45cefe5c9339a8b27be0454c9144a70a" title="Save DFS product (image)">fors_dfs_save_image</a>(cpl_frameset *frameset, <span class="keyword">const</span> cpl_image *image,</div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,</div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>                     <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>                     <span class="keyword">const</span> cpl_frame *inherit_frame)</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span> {</div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>     <a class="code" href="group__forsdfs.html#ga04ce01a9ddd2c4ddee75010d7fdb81fd" title="Save DFS product.">dfs_save</a>(frameset, image, FORS_TYPE_IMAGE, </div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>              category, header, </div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>              parlist, recipename, </div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>              inherit_frame);</div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span> }</div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span> </div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l01200"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7"> 1200</a></span> <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(cpl_frameset *frameset, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>                     <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>                     <span class="keyword">const</span> cpl_frame *inherit_frame)</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span> {</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>     <a class="code" href="group__forsdfs.html#ga04ce01a9ddd2c4ddee75010d7fdb81fd" title="Save DFS product.">dfs_save</a>(frameset, image, FORS_TYPE_IMAGE_ERR, </div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>              category, header, </div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>              parlist, recipename, </div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>              inherit_frame);</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span> }</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span> </div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span> <span class="preprocessor">    cpl_propertylist_delete(wcs_header); \</span></div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01221"></a><span class="lineno"><a class="code" href="group__forsdfs.html#gadbf163fdd77abcf68fac009993f20959"> 1221</a></span> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#gadbf163fdd77abcf68fac009993f20959" title="add WCS keywords to header">fors_dfs_add_wcs</a>(cpl_propertylist *header, <span class="keyword">const</span> cpl_frame *frame,</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>                       <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting)</div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span> {</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>     <span class="keywordtype">bool</span> invert = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>     <span class="keywordtype">int</span> extension = 0;</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>     </div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>     cpl_propertylist *wcs_header = </div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>         cpl_propertylist_load_regexp(cpl_frame_get_filename(frame), </div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>                                      extension, WCS_KEYS, invert);</div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>   </div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>     cpl_propertylist_copy_property_regexp(header, wcs_header, <span class="stringliteral">".*"</span>, invert);</div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span> </div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>     <span class="keywordtype">double</span> crpix1 = cpl_propertylist_get_double(header, FORS_PFITS_CRPIX1);</div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span> </div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>             <span class="stringliteral">"Could not read %s from %s"</span>, FORS_PFITS_CRPIX1, </div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>             cpl_frame_get_filename(frame));</div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>             </div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>     <span class="keywordtype">double</span> crpix2 = cpl_propertylist_get_double(header, FORS_PFITS_CRPIX2);</div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span> </div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>             <span class="stringliteral">"Could not read %s from %s"</span>, FORS_PFITS_CRPIX2,</div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>             cpl_frame_get_filename(frame));</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>     </div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>     cpl_propertylist_update_double(header, FORS_PFITS_CRPIX1,</div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>                                    crpix1 - setting->prescan_x);</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>     </div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>     cpl_propertylist_update_double(header, FORS_PFITS_CRPIX2,</div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>                                    crpix2 - setting->prescan_y);</div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span> </div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>     </div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>     cleanup;</div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span> }</div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span> </div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span> <span class="preprocessor">    cpl_propertylist_delete(time_header); \</span></div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01275"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga71054af8e26681ec2d7e1ea39e7feb17"> 1275</a></span> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#ga71054af8e26681ec2d7e1ea39e7feb17" title="Add keyword EXPTIME to header.">fors_dfs_add_exptime</a>(cpl_propertylist *header, <span class="keyword">const</span> cpl_frame *frame,</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>                           <span class="keywordtype">double</span> exptime)</div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span> {</div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>     <span class="keywordtype">bool</span> invert = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>     <span class="keywordtype">int</span> extension = 0;</div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span> </div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>     cpl_propertylist *time_header = NULL;</div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span> </div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>     <span class="keywordflow">if</span> (frame) {</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span> </div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>         time_header =</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>         cpl_propertylist_load_regexp(cpl_frame_get_filename(frame),</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>                                      extension, <span class="stringliteral">"EXPTIME"</span>, invert);</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span> </div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>         <span class="keywordflow">if</span> (time_header) {</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>             cpl_propertylist_copy_property_regexp(header, </div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>                                                   time_header, <span class="stringliteral">".*"</span>, invert);</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>         }</div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>             cpl_error_reset();</div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>         }</div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>     }</div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>         <span class="keywordflow">while</span> (cpl_propertylist_erase(header, <span class="stringliteral">"EXPTIME"</span>));</div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"EXPTIME"</span>, exptime);</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>     }</div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span> </div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>     cleanup;</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span> }</div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span> </div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l01315"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f"> 1315</a></span> <a class="code" href="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f" title="Save DFS product (table)">fors_dfs_save_table</a>(cpl_frameset *frameset, <span class="keyword">const</span> cpl_table *table,</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,</div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>                     <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,</div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>                     <span class="keyword">const</span> cpl_frame *inherit_frame)</div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span> {</div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>     <a class="code" href="group__forsdfs.html#ga04ce01a9ddd2c4ddee75010d7fdb81fd" title="Save DFS product.">dfs_save</a>(frameset, table, FORS_TYPE_TABLE, </div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>              category, header, </div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>              parlist, recipename, </div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>              inherit_frame);</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span> }</div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span> </div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01359"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5"> 1359</a></span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(cpl_frameset *frameset, <span class="keyword">const</span> cpl_image *image, </div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,</div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>                    <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename, </div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *version)</div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span> {</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *func = <span class="stringliteral">"dfs_save_image"</span>;</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span> </div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>     <span class="keywordtype">char</span>             *filename;</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>     cpl_frame        *frame;</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>     cpl_propertylist *plist;</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span> </div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span> </div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>     <span class="keywordflow">if</span> (category == NULL || frameset == NULL || image == NULL) {</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>     }</div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span> </div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>     cpl_msg_info(func, <span class="stringliteral">"Saving %s image to disk..."</span>, category);</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span> </div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>     filename = cpl_calloc(strlen(category) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span> </div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>     strlower(strcpy(filename, category));</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>     strcat(filename, <span class="stringliteral">".fits"</span>);</div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span> </div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>     frame = cpl_frame_new();</div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span> </div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>     cpl_frame_set_filename(frame, filename);</div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>     cpl_frame_set_tag(frame, category);</div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>     cpl_frame_set_type(frame, CPL_FRAME_TYPE_IMAGE);</div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>     cpl_frame_set_group(frame, CPL_FRAME_GROUP_PRODUCT);</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>     cpl_frame_set_level(frame, CPL_FRAME_LEVEL_FINAL);</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>         cpl_msg_error(func, <span class="stringliteral">"Cannot initialise the product frame"</span>);</div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>         cpl_frame_delete(frame);</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>         cpl_free(filename);</div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>     }</div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span> </div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span> </div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span> <span class="comment">     * Produce DFS compliant FITS header for image</span></div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span> </div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>         plist = cpl_propertylist_new();</div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>         plist = header;</div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span> </div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span> <span class="preprocessor">#if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(4, 8, 0)</span></div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span> <span class="preprocessor"></span>    <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>, NULL)) {</div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span> <span class="preprocessor">#else </span></div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span> <span class="preprocessor"></span>    <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>)) {</div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span> <span class="preprocessor"></span>        cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>         cpl_msg_error(func, <span class="stringliteral">"Problem with product %s FITS header definition"</span>,</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>                       category);</div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>             cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>         cpl_frame_delete(frame);</div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>         cpl_free(filename);</div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>     }</div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span> </div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span> <span class="comment">/* CPL3.0 </span></div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span> <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 OVSC*", 0);</span></div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span> <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 PRSC*", 0);</span></div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span> <span class="comment">/* CPL2.0 */</span></div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>);</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>);</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>);</div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>);</div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span> </div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span> <span class="comment">     * Write image to disk</span></div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span> </div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>     <span class="keywordflow">if</span> (cpl_image_save(image, filename, CPL_BPP_IEEE_FLOAT, plist,</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>                        CPL_IO_DEFAULT)) {</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>         cpl_msg_error(func, <span class="stringliteral">"Cannot save product %s to disk"</span>, filename);</div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>             cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>         cpl_frame_delete(frame);</div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>         cpl_free(filename);</div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>     }</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span> </div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>         cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span> </div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>     cpl_free(filename);</div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span> </div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>     cpl_frameset_insert(frameset, frame);</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span> </div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span> }</div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span> </div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01498"></a><span class="lineno"><a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824"> 1498</a></span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(cpl_frameset *frameset, <span class="keyword">const</span> cpl_table *table, </div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,</div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>                    <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename, </div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *version)</div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span> {</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *func = <span class="stringliteral">"dfs_save_table"</span>;</div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span> </div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>     <span class="keywordtype">char</span>             *filename;</div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>     cpl_frame        *frame;</div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>     cpl_propertylist *plist;</div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span> </div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span> </div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>     <span class="keywordflow">if</span> (category == NULL || frameset == NULL || table == NULL) {</div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>     }</div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span> </div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>     cpl_msg_info(func, <span class="stringliteral">"Saving %s table to disk..."</span>, category);</div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span> </div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span> <span class="comment">    filename = cpl_calloc(strlen(category) + 7, sizeof(char));</span></div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>     filename = cpl_calloc(strlen(category) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span> </div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>     strlower(strcpy(filename, category));</div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span> </div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span> <span class="comment">    strcat(filename, ".tfits");</span></div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>     strcat(filename, <span class="stringliteral">".fits"</span>);</div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span> </div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>     frame = cpl_frame_new();</div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span> </div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>     cpl_frame_set_filename(frame, filename);</div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>     cpl_frame_set_tag(frame, category);</div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>     cpl_frame_set_type(frame, CPL_FRAME_TYPE_TABLE);</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>     cpl_frame_set_group(frame, CPL_FRAME_GROUP_PRODUCT);</div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>     cpl_frame_set_level(frame, CPL_FRAME_LEVEL_FINAL);</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>         cpl_msg_error(func, <span class="stringliteral">"Cannot initialise the product frame"</span>);</div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>         cpl_frame_delete(frame);</div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>         cpl_free(filename);</div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>     }</div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span> </div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span> </div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span> <span class="comment">     * Produce DFS compliant FITS header for table</span></div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span> </div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>         plist = cpl_propertylist_new();</div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>         plist = header;</div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span> </div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span> <span class="preprocessor">#if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(4, 8, 0)</span></div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span> <span class="preprocessor"></span>    <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,</div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>, NULL)) {</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span> <span class="preprocessor">#else </span></div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span> <span class="preprocessor"></span>    <span class="keywordflow">if</span> (cpl_dfs_setup_product_header(plist, frame, frameset, parlist,</div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>                                      recipename, version, <span class="stringliteral">"PRO-1.15"</span>)) {</div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span> <span class="preprocessor"></span>        cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>         cpl_msg_error(func, <span class="stringliteral">"Problem with product %s FITS header definition"</span>,</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>                       category);</div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>             cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>         cpl_frame_delete(frame);</div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>         cpl_free(filename);</div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>     }</div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span> </div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span> <span class="comment">/* For CPL3.0</span></div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span> <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 OVSC*", 0);</span></div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span> <span class="comment">    cpl_propertylist_erase_regexp(plist, "^ESO DET OUT1 PRSC*", 0);</span></div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span> <span class="comment">/* For CPL2.0 */</span></div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>);</div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>);</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>);</div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>     cpl_propertylist_erase(plist, <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>);</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span> </div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span> <span class="comment">     * Write table to disk</span></div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>     </div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>     </div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>     <span class="keywordflow">if</span> (cpl_table_save(table, plist, NULL, filename, CPL_IO_DEFAULT)) {</div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>         cpl_msg_error(func, <span class="stringliteral">"Cannot save product %s to disk"</span>, filename);</div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>             cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>         cpl_frame_delete(frame);</div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>         cpl_free(filename);</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>     }</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span> </div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>         cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>     cpl_free(filename);</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span> </div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>     cpl_frameset_insert(frameset, frame);</div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span> </div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span> }</div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span> </div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01628"></a><span class="lineno"><a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435"> 1628</a></span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(cpl_frameset *frameset, <span class="keyword">const</span> <span class="keywordtype">char</span> *keyword)</div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span> {</div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *func = <span class="stringliteral">"dfs_equal_keyword"</span>;</div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span> </div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>     cpl_frame        *frame;</div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>     cpl_propertylist *reference;</div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>     cpl_type          rtype;</div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>     cpl_type          type;</div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *rstring;</div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>       *string;</div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>     <span class="keywordtype">int</span>               rintero;</div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>     <span class="keywordtype">int</span>               intero;</div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>     <span class="keywordtype">int</span>               found;</div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span> </div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span> </div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>     <span class="keywordflow">if</span> (frameset == NULL || keyword == NULL) {</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>     }</div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span> </div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>     <span class="keywordflow">if</span> (cpl_frameset_is_empty(frameset)) {</div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>     }</div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>         </div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>     frame = cpl_frameset_get_first(frameset);</div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span> </div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>     found = 0;</div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span> </div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>     <span class="keywordflow">while</span> (frame) {</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span> </div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>         reference = cpl_propertylist_load(cpl_frame_get_filename(frame), 0);</div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>         <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_BAD_FILE_FORMAT) {</div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>             cpl_error_reset();</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>             frame = cpl_frameset_get_next(frameset);</div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>         }</div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span> </div>
+<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>         <span class="keywordflow">if</span> (cpl_propertylist_has(reference, keyword)) {</div>
+<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>             rtype = cpl_propertylist_get_type(reference, keyword);</div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span> </div>
+<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>             <span class="keywordflow">if</span> (rtype == CPL_TYPE_STRING) {</div>
+<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>                 found = 1;</div>
+<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>                 rstring = cpl_strdup(cpl_propertylist_get_string(reference, </div>
+<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>                                                                  keyword));</div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span>                 cpl_propertylist_delete(reference);</div>
+<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>             }</div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span> </div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>             <span class="keywordflow">if</span> (rtype == CPL_TYPE_INT) {</div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>                 found = 1;</div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>                 rintero = cpl_propertylist_get_int(reference, keyword);</div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>                 cpl_propertylist_delete(reference);</div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>             }</div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span> </div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>             cpl_propertylist_delete(reference);</div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>             <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>         }</div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span> </div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>         cpl_propertylist_delete(reference);</div>
+<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span> </div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>         frame = cpl_frameset_get_next(frameset);</div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>     }</div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span> </div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span> </div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>     <span class="keywordflow">if</span> (!found)</div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span> </div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>     frame = cpl_frameset_get_first(frameset);</div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span> </div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>     <span class="keywordflow">while</span> (frame) {</div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span> </div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>         reference = cpl_propertylist_load(cpl_frame_get_filename(frame), 0);</div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>         <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_BAD_FILE_FORMAT) {</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>             cpl_error_reset();</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>             frame = cpl_frameset_get_next(frameset);</div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>         }</div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span> </div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>         <span class="keywordflow">if</span> (cpl_propertylist_has(reference, keyword)) {</div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span> </div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>             type = cpl_propertylist_get_type(reference, keyword);</div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span> </div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>             <span class="keywordflow">if</span> (rtype != type) {</div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>                 cpl_propertylist_delete(reference);</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>                 <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>             }</div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span> </div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>             <span class="keywordflow">if</span> (rtype == CPL_TYPE_STRING) {</div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>                 <span class="keywordtype">string</span> = cpl_propertylist_get_string(reference, </div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>                                                      keyword);</div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>                 <span class="keywordflow">if</span> (strncmp(rstring, <span class="keywordtype">string</span>, 15)) {</div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>                     cpl_propertylist_delete(reference);</div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>                     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>                 }</div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>             }</div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span> </div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>             <span class="keywordflow">if</span> (rtype == CPL_TYPE_INT) {</div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>                 intero = cpl_propertylist_get_int(reference, keyword);</div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>                 <span class="keywordflow">if</span> (rintero - intero) {</div>
+<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>                     cpl_propertylist_delete(reference);</div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>                     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>                 }</div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>             }</div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>         }</div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span> </div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>         cpl_propertylist_delete(reference);</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span> </div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>         frame = cpl_frameset_get_next(frameset);</div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>     }</div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span> </div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>     <span class="keywordflow">if</span> (rtype == CPL_TYPE_STRING)</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>         cpl_free((<span class="keywordtype">void</span> *)rstring);</div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span> </div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>     <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span> </div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span> }</div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span> </div>
+<div class="line"><a name="l01756"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489"> 1756</a></span> cpl_error_code <a class="code" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489" title="Save a table in a extension (different from the first one)">dfs_save_table_ext</a>(cpl_table        * table,</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>                   <span class="keyword">const</span> <span class="keywordtype">char</span>             * tag,</div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>                   cpl_propertylist * extheader)</div>
+<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span> {</div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>     <span class="keywordtype">char</span> * filename = cpl_calloc(strlen(tag) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>     cpl_propertylist * header;</div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span> </div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>     <span class="keywordflow">if</span> (extheader) { </div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>     header = cpl_propertylist_duplicate(extheader);</div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span> </div>
+<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>     cpl_propertylist_erase_regexp(header, </div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>                                       <span class="stringliteral">"^ESO DPR |^ARCFILE$|^ORIGFILE$"</span>, 0);</div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>     header = NULL;</div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>     }</div>
+<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span> </div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>     strlower(strcpy(filename, tag));</div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>     strcat(filename, <span class="stringliteral">".fits"</span>);</div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>     </div>
+<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>     <span class="keywordflow">if</span> (cpl_table_save(table, NULL, header, filename, CPL_IO_EXTEND)) {</div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>     cpl_free(filename);</div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>     cpl_ensure_code(0, CPL_ERROR_FILE_IO);</div>
+<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span>     }</div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>     </div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>     cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>     cpl_free(filename);</div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span> </div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span> }</div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span> </div>
+<div class="line"><a name="l01795"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee"> 1795</a></span> cpl_error_code <a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(cpl_image        * image,</div>
+<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>                   <span class="keyword">const</span> <span class="keywordtype">char</span>             * tag,</div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>                   cpl_propertylist * extheader)</div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span> {</div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>     <span class="keywordtype">char</span> * filename = cpl_calloc(strlen(tag) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>     </div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>     cpl_propertylist * header;</div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span> </div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>     <span class="keywordflow">if</span> (extheader) {</div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>     header = cpl_propertylist_duplicate(extheader);</div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span> </div>
+<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>     cpl_propertylist_erase_regexp(header, </div>
+<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span>                                       <span class="stringliteral">"^ESO DPR |^ARCFILE$|^ORIGFILE$"</span>, 0);</div>
+<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span>     header = NULL;</div>
+<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>     }</div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span> </div>
+<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>     strlower(strcpy(filename, tag));</div>
+<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>     strcat(filename, <span class="stringliteral">".fits"</span>);</div>
+<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>     </div>
+<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>     <span class="keywordflow">if</span> (cpl_image_save(image, filename, CPL_BPP_IEEE_FLOAT,</div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>                header, CPL_IO_EXTEND)) {</div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>     cpl_free(filename);</div>
+<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>     cpl_ensure_code(0, CPL_ERROR_FILE_IO);</div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>     }</div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>     </div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>     cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>     cpl_free(filename);</div>
+<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span> </div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span> }</div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span> </div>
+<div class="line"><a name="l01838"></a><span class="lineno"><a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b"> 1838</a></span> cpl_error_code <a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(cpl_frameset * frameset,</div>
+<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>                    cpl_parameterlist * parlist,</div>
+<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> * tag,</div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> * recipename,</div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> * version)</div>
+<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span> {</div>
+<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> * regexp = <span class="stringliteral">"ESO DET OUT1 OVSCX|"</span></div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>                       <span class="stringliteral">"ESO DET OUT1 PRSCX|"</span></div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>                           <span class="stringliteral">"ESO DET OUT1 OVSCY|"</span></div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>                           <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>;</div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span> </div>
+<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>     <span class="keywordtype">char</span> * filename = cpl_calloc(strlen(tag) + 6, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span> </div>
+<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>     cpl_error_code error;</div>
+<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span> </div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>     cpl_propertylist * pro = cpl_propertylist_new();</div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>         </div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>     cpl_propertylist_append_string(pro, <span class="stringliteral">"ESO PRO CATG"</span>, tag);</div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span> </div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>     strlower(strcpy(filename, tag));</div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>     strcat(filename, <span class="stringliteral">".fits"</span>);</div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span> </div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span> <span class="preprocessor">#if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(4, 8, 0)</span></div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span> <span class="preprocessor"></span>    error = cpl_dfs_save_image(frameset, NULL, parlist, frameset, NULL, NULL,</div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>                    CPL_BPP_IEEE_FLOAT, recipename, pro,</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>                    regexp, version, filename);</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span> <span class="preprocessor"></span>    error = cpl_dfs_save_image(frameset, parlist, frameset, NULL,</div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>                    CPL_BPP_IEEE_FLOAT, recipename, tag,</div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>                    NULL, regexp, version, filename);</div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span> <span class="preprocessor"></span>    </div>
+<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>     cpl_free(filename);</div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>     cpl_propertylist_delete(pro);</div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span> </div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>     <span class="keywordflow">return</span> error;</div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span> }</div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span> </div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span> cpl_frameset * hawki_extract_frameset(</div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>         <span class="keyword">const</span> cpl_frameset  *   in,</div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>          *   tag)</div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span> {</div>
+<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>     cpl_frameset    *   out ;</div>
+<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>     <span class="keyword">const</span> cpl_frame *   cur_frame ;</div>
+<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>     cpl_frame       *   loc_frame ;</div>
+<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>     <span class="keywordtype">int</span>                 nbframes, nbext ;</div>
+<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>     <span class="keywordtype">int</span>                 i ;</div>
+<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span> </div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>     <span class="comment">/* Test entries */</span></div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>     <span class="keywordflow">if</span> (in == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>     <span class="keywordflow">if</span> (tag == NULL) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span> </div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>     <span class="comment">/* Initialise */</span></div>
+<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>     nbframes = cpl_frameset_get_size(in) ;</div>
+<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span> </div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>     <span class="comment">/* Count the frames with the tag */</span></div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>     <span class="keywordflow">if</span> ((nbext = cpl_frameset_count_tags(in, tag)) == 0) <span class="keywordflow">return</span> NULL ;</div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span> </div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>     <span class="comment">/* Create the output frameset */</span></div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>     out = cpl_frameset_new() ;</div>
+<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span> </div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>     <span class="comment">/* Loop on the requested frames and store them in out */</span></div>
+<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>     nbext = 0 ;</div>
+<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>     <span class="keywordflow">for</span> (i=0 ; i<nbframes ; i++) {</div>
+<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>         cur_frame = cpl_frameset_get_frame_const(in, i) ;</div>
+<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>         <span class="keywordflow">if</span> (!strcmp(cpl_frame_get_tag(cur_frame), tag)) {</div>
+<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>             loc_frame = cpl_frame_duplicate(cur_frame) ;</div>
+<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>             cpl_frameset_insert(out, loc_frame) ;</div>
+<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>             nbext ++ ;</div>
+<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>         }</div>
+<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>     }</div>
+<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>     <span class="keywordflow">return</span> out ;</div>
+<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span> }</div>
+<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span> </div>
+<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span> </div>
+<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span> </div>
+<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span> </div>
+<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__dfs_8h-source.html b/html/fors__dfs_8h-source.html
deleted file mode 100644
index 77437fe..0000000
--- a/html/fors__dfs_8h-source.html
+++ /dev/null
@@ -1,149 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_dfs.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_dfs.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_dfs.h,v 1.32 2013/04/24 14:17:59 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:17:59 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.32 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_DFS_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_DFS_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 CPL_BEGIN_DECLS
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="comment">/* Raw frames */</span>
-<a name="l00038"></a>00038 <span class="preprocessor">#define BIAS                    "BIAS"</span>
-<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define DARK                    "DARK"</span>
-<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define SCREEN_FLAT_IMG         "SCREEN_FLAT_IMG"</span>
-<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define SKY_FLAT_IMG            "SKY_FLAT_IMG"</span>
-<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define STANDARD_IMG            "STANDARD_IMG"</span>
-<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define SCIENCE_IMG             "SCIENCE_IMG"</span>
-<a name="l00044"></a>00044 <span class="preprocessor"></span>
-<a name="l00045"></a>00045 <span class="comment">/* Pipeline products */</span>
-<a name="l00046"></a>00046 <span class="preprocessor">#define MASTER_BIAS             "MASTER_BIAS"</span>
-<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define MASTER_DARK             "MASTER_DARK"</span>
-<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define MASTER_SCREEN_FLAT_IMG  "MASTER_SCREEN_FLAT_IMG"</span>
-<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define MASTER_NORM_FLAT_IMG    "MASTER_NORM_FLAT_IMG"</span>
-<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#define MASTER_SKY_FLAT_IMG     "MASTER_SKY_FLAT_IMG"</span>
-<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#define SOURCES_SCI             "SOURCES_SCI_IMG"</span>
-<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#define SOURCES_STD             "SOURCES_STD_IMG"</span>
-<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define ALIGNED_PHOT            "ALIGNED_PHOT"</span>
-<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define STANDARD_REDUCED_IMG    "STANDARD_REDUCED_IMG"</span>
-<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#define SCIENCE_REDUCED_IMG     "SCIENCE_REDUCED_IMG"</span>
-<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#define PHOTOMETRY_TABLE        "OBJECT_TABLE_SCI_IMG"</span>
-<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#define PHOT_BACKGROUND_SCI_IMG "PHOT_BACKGROUND_SCI_IMG"</span>
-<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define PHOT_BACKGROUND_STD_IMG "PHOT_BACKGROUND_STD_IMG"</span>
-<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#define CORRECTION_MAP          "CORRECTION_MAP"</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define CORRECTION_FACTOR       "CORRECTION_FACTOR"</span>
-<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#define MASTER_FLAT_IMG         "MASTER_FLAT_IMG"</span>
-<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define PHOT_COEFF_TABLE        "PHOT_COEFF_TABLE"</span>
-<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#define EXTINCTION_PER_NIGHT    "EXTINCTION_PER_NIGHT"</span>
-<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#define EXTINCTION_PER_FRAME    "EXTINCTION_PER_FRAME"</span>
-<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define OFFSET_HISTOGRAM        "OFFSET_HISTOGRAM"</span>
-<a name="l00066"></a>00066 <span class="preprocessor"></span>
-<a name="l00067"></a>00067 <span class="comment">/* Static calibration */</span>
-<a name="l00068"></a>00068 <span class="preprocessor">#define FLX_STD_IMG             "FLX_STD_IMG"</span>
-<a name="l00069"></a>00069 <span class="preprocessor"></span><span class="preprocessor">#define PHOT_TABLE              "PHOT_TABLE"</span>
-<a name="l00070"></a>00070 <span class="preprocessor"></span>
-<a name="l00071"></a>00071 <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#g37d74636b6c3f3d52b0312ce3a58e59d">fors_dfs_set_groups</a>(cpl_frameset * set);
-<a name="l00072"></a>00072 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#g61956e9dcf77f5c71db911e0390f63f3">fors_dfs_pipeline_version</a>(<span class="keyword">const</span> cpl_propertylist *header, 
-<a name="l00073"></a>00073                       <span class="keyword">const</span> <span class="keywordtype">char</span> **instrument_version);
-<a name="l00074"></a>00074 <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#g34ac001c0471b1dc6dab4a0a38b7c4a2">dfs_generate_filename</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00075"></a>00075 <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00076"></a>00076 <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00077"></a>00077                            <span class="keyword">const</span> cpl_table *);
-<a name="l00078"></a>00078 <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00079"></a>00079                           <span class="keyword">const</span> cpl_table *);
-<a name="l00080"></a>00080 <span class="keywordtype">double</span> <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00081"></a>00081                                 <span class="keyword">const</span> cpl_table *);
-<a name="l00082"></a>00082 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00083"></a>00083                                      <span class="keyword">const</span> cpl_table *);
-<a name="l00084"></a>00084 <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gfce5eddb71d8700b30c690f49374d2e0">dfs_get_parameter_bool_const</a>(<span class="keyword">const</span> cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00085"></a>00085 <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(<span class="keyword">const</span> cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00086"></a>00086 <span class="keywordtype">double</span> <a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a>(<span class="keyword">const</span> cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00087"></a>00087 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">dfs_get_parameter_string_const</a>(<span class="keyword">const</span> cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00088"></a>00088 cpl_image *<a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(cpl_frameset *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, cpl_type, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
-<a name="l00089"></a>00089 cpl_table *<a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(cpl_frameset *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>);
-<a name="l00090"></a>00090 cpl_propertylist *<a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(cpl_frameset *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>);
-<a name="l00091"></a>00091 <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#geb1068e007bd0ebef0cd4a6aa12cf523">fors_dfs_add_wcs</a>(cpl_propertylist *header, <span class="keyword">const</span> cpl_frame *frame,
-<a name="l00092"></a>00092                       <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting);
-<a name="l00093"></a>00093 <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#gea45a5b73ab086e5e08680928adbd0cd">fors_dfs_add_exptime</a>(cpl_propertylist *header, <span class="keyword">const</span> cpl_frame *frame,
-<a name="l00094"></a>00094                           <span class="keywordtype">double</span> exptime);
-<a name="l00095"></a>00095 <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(cpl_frameset *frameset, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,
-<a name="l00096"></a>00096              <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,
-<a name="l00097"></a>00097              <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,
-<a name="l00098"></a>00098              <span class="keyword">const</span> cpl_frame *raw_frame);
-<a name="l00099"></a>00099 <span class="keywordtype">void</span> fors_dfs_save_image_wcs(cpl_frameset *frameset, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,
-<a name="l00100"></a>00100                  <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,
-<a name="l00101"></a>00101                  <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,
-<a name="l00102"></a>00102                  <span class="keyword">const</span> cpl_frame *raw_frame);
-<a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42">fors_dfs_save_table</a>(cpl_frameset *frameset, <span class="keyword">const</span> cpl_table *table,
-<a name="l00104"></a>00104              <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,
-<a name="l00105"></a>00105              <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,
-<a name="l00106"></a>00106              <span class="keyword">const</span> cpl_frame *raw_frame);
-<a name="l00107"></a>00107 <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(cpl_frameset *, <span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00108"></a>00108                    cpl_propertylist *, <span class="keyword">const</span> cpl_parameterlist *, 
-<a name="l00109"></a>00109                    <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00110"></a>00110 <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(cpl_frameset *, <span class="keyword">const</span> cpl_table *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00111"></a>00111                    cpl_propertylist *, <span class="keyword">const</span> cpl_parameterlist *, 
-<a name="l00112"></a>00112                    <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00113"></a>00113 <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(cpl_frameset *frameset, <span class="keyword">const</span> <span class="keywordtype">char</span> *keyword);
-<a name="l00114"></a>00114 <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a>(cpl_frameset *frames, <span class="keyword">const</span> <span class="keywordtype">char</span> *description_short);
-<a name="l00115"></a>00115 <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a>(<span class="keyword">const</span> cpl_frameset *frames, cpl_errorstate before_exec);
-<a name="l00116"></a>00116 
-<a name="l00117"></a>00117 cpl_error_code <a class="code" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">dfs_save_table_ext</a>(cpl_table *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
-<a name="l00118"></a>00118                   cpl_propertylist *);
-<a name="l00119"></a>00119 cpl_error_code <a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(cpl_image *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
-<a name="l00120"></a>00120                   cpl_propertylist *);
-<a name="l00121"></a>00121 cpl_error_code <a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(cpl_frameset *, cpl_parameterlist *,
-<a name="l00122"></a>00122                    <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
-<a name="l00123"></a>00123                    <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125 CPL_END_DECLS
-<a name="l00126"></a>00126 
-<a name="l00127"></a>00127 <span class="preprocessor">#endif   </span><span class="comment">/* FORS_DFS_H */</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__dfs_8h_source.html b/html/fors__dfs_8h_source.html
new file mode 100644
index 0000000..107743e
--- /dev/null
+++ b/html/fors__dfs_8h_source.html
@@ -0,0 +1,208 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_dfs.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_dfs.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_dfs.h,v 1.35 2013-09-10 19:27:01 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 19:27:01 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.35 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_DFS_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_DFS_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="comment">/* Types of data to save */</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">enum</span> _fors_type_ {</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>     FORS_TYPE_IMAGE      = 1 << 0,</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>     FORS_TYPE_IMAGE_ERR  = 1 << 1,</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>     FORS_TYPE_TABLE      = 1 << 2</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> };</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keyword">typedef</span> <span class="keyword">enum</span> _fors_type_ fors_type;</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="comment">/* Raw frames */</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#define BIAS                    "BIAS"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor"></span><span class="preprocessor">#define DARK                    "DARK"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor"></span><span class="preprocessor">#define SCREEN_FLAT_IMG         "SCREEN_FLAT_IMG"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor"></span><span class="preprocessor">#define SKY_FLAT_IMG            "SKY_FLAT_IMG"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor"></span><span class="preprocessor">#define STANDARD_IMG            "STANDARD_IMG"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor"></span><span class="preprocessor">#define SCIENCE_IMG             "SCIENCE_IMG"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="comment">/* Pipeline products */</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">#define MASTER_BIAS             "MASTER_BIAS"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor"></span><span class="preprocessor">#define MASTER_DARK             "MASTER_DARK"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor"></span><span class="preprocessor">#define MASTER_SCREEN_FLAT_IMG  "MASTER_SCREEN_FLAT_IMG"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span><span class="preprocessor">#define MASTER_NORM_FLAT_IMG    "MASTER_NORM_FLAT_IMG"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor"></span><span class="preprocessor">#define MASTER_SKY_FLAT_IMG     "MASTER_SKY_FLAT_IMG"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor"></span><span class="preprocessor">#define SOURCES_SCI             "SOURCES_SCI_IMG"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor"></span><span class="preprocessor">#define SOURCES_STD             "SOURCES_STD_IMG"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor"></span><span class="preprocessor">#define ALIGNED_PHOT            "ALIGNED_PHOT"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor"></span><span class="preprocessor">#define STANDARD_REDUCED_IMG    "STANDARD_REDUCED_IMG"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor"></span><span class="preprocessor">#define SCIENCE_REDUCED_IMG     "SCIENCE_REDUCED_IMG"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor"></span><span class="preprocessor">#define PHOTOMETRY_TABLE        "OBJECT_TABLE_SCI_IMG"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor"></span><span class="preprocessor">#define PHOT_BACKGROUND_SCI_IMG "PHOT_BACKGROUND_SCI_IMG"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor"></span><span class="preprocessor">#define PHOT_BACKGROUND_STD_IMG "PHOT_BACKGROUND_STD_IMG"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor"></span><span class="preprocessor">#define CORRECTION_MAP          "CORRECTION_MAP"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor"></span><span class="preprocessor">#define CORRECTION_FACTOR       "CORRECTION_FACTOR"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor"></span><span class="preprocessor">#define MASTER_FLAT_IMG         "MASTER_FLAT_IMG"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor"></span><span class="preprocessor">#define PHOT_COEFF_TABLE        "PHOT_COEFF_TABLE"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor"></span><span class="preprocessor">#define EXTINCTION_PER_NIGHT    "EXTINCTION_PER_NIGHT"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor"></span><span class="preprocessor">#define EXTINCTION_PER_FRAME    "EXTINCTION_PER_FRAME"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor"></span><span class="preprocessor">#define OFFSET_HISTOGRAM        "OFFSET_HISTOGRAM"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="comment">/* Static calibration */</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">#define FLX_STD_IMG             "FLX_STD_IMG"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor"></span><span class="preprocessor">#define PHOT_TABLE              "PHOT_TABLE"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#ga5162766f25e67bb99869e7959c3f8201" title="Set the group as RAW or CALIB in a frameset.">fors_dfs_set_groups</a>(cpl_frameset * <span class="keyword">set</span>);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#ga31c40f4add0fc7ef1e992d99493f5d1a" title="Get pipeline and instrument versions.">fors_dfs_pipeline_version</a>(<span class="keyword">const</span> cpl_propertylist *header, </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                       <span class="keyword">const</span> <span class="keywordtype">char</span> **instrument_version);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="keywordtype">char</span> *dfs_generate_filename(<span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="keywordtype">char</span> *dfs_generate_filename_tfits(<span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                            <span class="keyword">const</span> cpl_table *);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                           <span class="keyword">const</span> cpl_table *);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="keywordtype">double</span> <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                                 <span class="keyword">const</span> cpl_table *);</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                                      <span class="keyword">const</span> cpl_table *);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gae0dc63f80258d73a93d35e41b2a8b367">dfs_get_parameter_bool_const</a>(<span class="keyword">const</span> cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(<span class="keyword">const</span> cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="keywordtype">double</span> <a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a>(<span class="keyword">const</span> cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">dfs_get_parameter_string_const</a>(<span class="keyword">const</span> cpl_parameterlist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> cpl_image *<a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(cpl_frameset *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, cpl_type, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> cpl_table *<a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(cpl_frameset *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> cpl_propertylist *<a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(cpl_frameset *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#gadbf163fdd77abcf68fac009993f20959" title="add WCS keywords to header">fors_dfs_add_wcs</a>(cpl_propertylist *header, <span class="keyword">const</span> cpl_frame *frame,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                       <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#ga71054af8e26681ec2d7e1ea39e7feb17" title="Add keyword EXPTIME to header.">fors_dfs_add_exptime</a>(cpl_propertylist *header, <span class="keyword">const</span> cpl_frame *frame,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                           <span class="keywordtype">double</span> exptime);</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(cpl_frameset *frameset, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>              <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>              <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>              <span class="keyword">const</span> cpl_frame *raw_frame);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#ga45cefe5c9339a8b27be0454c9144a70a" title="Save DFS product (image)">fors_dfs_save_image</a>(cpl_frameset *frameset, <span class="keyword">const</span> cpl_image *image,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>              <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>              <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>              <span class="keyword">const</span> cpl_frame *raw_frame);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="keywordtype">void</span> fors_dfs_save_image_wcs(cpl_frameset *frameset, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                  <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                  <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                  <span class="keyword">const</span> cpl_frame *raw_frame);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f" title="Save DFS product (table)">fors_dfs_save_table</a>(cpl_frameset *frameset, <span class="keyword">const</span> cpl_table *table,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>              <span class="keyword">const</span> <span class="keywordtype">char</span> *category, cpl_propertylist *header,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>              <span class="keyword">const</span> cpl_parameterlist *parlist, <span class="keyword">const</span> <span class="keywordtype">char</span> *recipename,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>              <span class="keyword">const</span> cpl_frame *raw_frame);</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(cpl_frameset *, <span class="keyword">const</span> cpl_image *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                    cpl_propertylist *, <span class="keyword">const</span> cpl_parameterlist *, </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *) CPL_ATTR_DEPRECATED; </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(cpl_frameset *, const cpl_table *, const <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                    cpl_propertylist *, const cpl_parameterlist *, </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                    const <span class="keywordtype">char</span> *, const <span class="keywordtype">char</span> *) CPL_ATTR_DEPRECATED;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(cpl_frameset *frameset, const <span class="keywordtype">char</span> *keyword);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="keywordtype">void</span> <a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce" title="Start recipe execution.">fors_begin</a>(cpl_frameset *frames, const <span class="keywordtype">char</span> *description_short);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="keywordtype">int</span> <a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9" title="End recipe execution.">fors_end</a>(const cpl_frameset *frames, cpl_errorstate before_exec);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> cpl_error_code <a class="code" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489" title="Save a table in a extension (different from the first one)">dfs_save_table_ext</a>(cpl_table *, const <span class="keywordtype">char</span> *,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                   cpl_propertylist *);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> cpl_error_code <a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(cpl_image *, const <span class="keywordtype">char</span> *,</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                   cpl_propertylist *);</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> cpl_error_code <a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(cpl_frameset *, cpl_parameterlist *,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                    const <span class="keywordtype">char</span> *, const <span class="keywordtype">char</span> *,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                    const <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> cpl_frameset * hawki_extract_frameset(</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         const cpl_frameset  *   in,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>         const <span class="keywordtype">char</span>          *   tag);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor">#endif   </span><span class="comment">/* FORS_DFS_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__double_8c-source.html b/html/fors__double_8c-source.html
deleted file mode 100644
index a85e862..0000000
--- a/html/fors__double_8c-source.html
+++ /dev/null
@@ -1,158 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_double.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_double.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_double.c,v 1.5 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.5 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_double.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <math.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <assert.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#define LIST_DEFINE</span>
-<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM double</span>
-<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 
-<a name="l00053"></a>00053 <span class="comment">/*</span>
-<a name="l00054"></a>00054 <span class="comment">  Copy constructor</span>
-<a name="l00055"></a>00055 <span class="comment"> */</span>
-<a name="l00056"></a>00056 <span class="keywordtype">double</span> *
-<a name="l00057"></a>00057 double_duplicate(<span class="keyword">const</span> <span class="keywordtype">double</span> *d)
-<a name="l00058"></a>00058 {
-<a name="l00059"></a>00059     <span class="keywordtype">double</span> *dp = cpl_malloc(<span class="keyword">sizeof</span>(*dp));
-<a name="l00060"></a>00060     *dp = *d;
-<a name="l00061"></a>00061     <span class="keywordflow">return</span> dp;
-<a name="l00062"></a>00062 }
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 <span class="comment">/*</span>
-<a name="l00065"></a>00065 <span class="comment">  @brief  Destructor</span>
-<a name="l00066"></a>00066 <span class="comment">  @param  d    double</span>
-<a name="l00067"></a>00067 <span class="comment"> */</span>
-<a name="l00068"></a>00068 <span class="keywordtype">void</span>
-<a name="l00069"></a>00069 double_delete(<span class="keywordtype">double</span> **d)
-<a name="l00070"></a>00070 {
-<a name="l00071"></a>00071     <span class="keywordflow">if</span> (d && *d) {
-<a name="l00072"></a>00072         cpl_free(*d); *d = NULL;
-<a name="l00073"></a>00073     }
-<a name="l00074"></a>00074 }
-<a name="l00075"></a>00075 
-<a name="l00082"></a>00082 <span class="keywordtype">double</span>
-<a name="l00083"></a>00083 double_eval(<span class="keyword">const</span> <span class="keywordtype">double</span> *d, <span class="keywordtype">void</span> *data)
-<a name="l00084"></a>00084 {
-<a name="l00085"></a>00085     data = data;
-<a name="l00086"></a>00086     <span class="keywordflow">return</span> *d;
-<a name="l00087"></a>00087 }
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089 <span class="preprocessor">#undef cleanup</span>
-<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00091"></a>00091 <span class="preprocessor"></span>
-<a name="l00100"></a>00100 <span class="keywordtype">double</span>
-<a name="l00101"></a>00101 double_subtract(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,
-<a name="l00102"></a>00102                 <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,
-<a name="l00103"></a>00103                 <span class="keywordtype">double</span> *error)
-<a name="l00104"></a>00104 {
-<a name="l00105"></a>00105     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( error != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00106"></a>00106     
-<a name="l00107"></a>00107     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dx >= 0, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00108"></a>00108     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dy >= 0, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00109"></a>00109 
-<a name="l00110"></a>00110     *error = sqrt( dx*dx + dy*dy );
-<a name="l00111"></a>00111 
-<a name="l00112"></a>00112     <span class="keywordflow">return</span> x - y;
-<a name="l00113"></a>00113 }
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115 
-<a name="l00116"></a>00116 <span class="preprocessor">#undef cleanup</span>
-<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00118"></a>00118 <span class="preprocessor"></span>
-<a name="l00128"></a>00128 <span class="keywordtype">double</span>
-<a name="l00129"></a>00129 double_divide(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,
-<a name="l00130"></a>00130           <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,
-<a name="l00131"></a>00131           <span class="keywordtype">double</span> *error)
-<a name="l00132"></a>00132 {
-<a name="l00133"></a>00133     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( error != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( y*y > 0, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00136"></a>00136     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dx >= 0, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00137"></a>00137     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dy >= 0, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139     *error = ( dx*dx + dy*dy * x*x / (y*y) ) / (y*y);
-<a name="l00140"></a>00140     *error = sqrt(*error);
-<a name="l00141"></a>00141 
-<a name="l00142"></a>00142     <span class="keywordflow">return</span> x/y;
-<a name="l00143"></a>00143 }
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145 
-<a name="l00146"></a>00146 <span class="preprocessor">#undef cleanup</span>
-<a name="l00147"></a>00147 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00148"></a>00148 <span class="preprocessor"></span>
-<a name="l00159"></a>00159 <span class="keywordtype">double</span>
-<a name="l00160"></a>00160 double_atan2(<span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,
-<a name="l00161"></a>00161              <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,
-<a name="l00162"></a>00162          <span class="keywordtype">double</span> *error)
-<a name="l00163"></a>00163 {
-<a name="l00164"></a>00164     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( error != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00165"></a>00165     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dy >= 0, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00166"></a>00166     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dx >= 0, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00167"></a>00167     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( (x*x + y*y)*(x*x + y*y) > 0, <span class="keywordflow">return</span> 0, NULL ); <span class="comment">/* angle undefined */</span>
-<a name="l00168"></a>00168     
-<a name="l00169"></a>00169     <span class="comment">/* using error propagation formula and d(atan(u))/du = 1/(1+u^2) */</span>
-<a name="l00170"></a>00170     *error = (dy*dy*x*x + dx*dx*y*y) / ((x*x + y*y)*(x*x + y*y));
-<a name="l00171"></a>00171     *error = sqrt(*error);
-<a name="l00172"></a>00172 
-<a name="l00173"></a>00173     assert( *error >= 0 );
-<a name="l00174"></a>00174 
-<a name="l00175"></a>00175     <span class="keywordflow">return</span> atan2(y, x);
-<a name="l00176"></a>00176 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__double_8c_source.html b/html/fors__double_8c_source.html
new file mode 100644
index 0000000..e422234
--- /dev/null
+++ b/html/fors__double_8c_source.html
@@ -0,0 +1,197 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_double.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_double.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_double.c,v 1.5 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.5 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_double.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <assert.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#define LIST_DEFINE</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM double</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">  Copy constructor</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keywordtype">double</span> *</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> double_duplicate(<span class="keyword">const</span> <span class="keywordtype">double</span> *d)</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> {</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     <span class="keywordtype">double</span> *dp = cpl_malloc(<span class="keyword">sizeof</span>(*dp));</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     *dp = *d;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <span class="keywordflow">return</span> dp;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> }</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="comment">  @brief  Destructor</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="comment">  @param  d    double</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> double_delete(<span class="keywordtype">double</span> **d)</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> {</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <span class="keywordflow">if</span> (d && *d) {</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>         cpl_free(*d); *d = NULL;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     }</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> }</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> double_eval(<span class="keyword">const</span> <span class="keywordtype">double</span> *d, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> {</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     data = data;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     <span class="keywordflow">return</span> *d;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> }</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> double_subtract(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                 <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                 <span class="keywordtype">double</span> *error)</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> {</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( error != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dx >= 0, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dy >= 0, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> </div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     *error = sqrt( dx*dx + dy*dy );</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     <span class="keywordflow">return</span> x - y;</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> }</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> </div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> double_divide(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>           <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>           <span class="keywordtype">double</span> *error)</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> {</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( error != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( y*y > 0, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dx >= 0, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dy >= 0, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     *error = ( dx*dx + dy*dy * x*x / (y*y) ) / (y*y);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     *error = sqrt(*error);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="keywordflow">return</span> x/y;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> }</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> double_atan2(<span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>              <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>          <span class="keywordtype">double</span> *error)</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> {</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( error != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dy >= 0, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dx >= 0, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( (x*x + y*y)*(x*x + y*y) > 0, <span class="keywordflow">return</span> 0, NULL ); <span class="comment">/* angle undefined */</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     </div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="comment">/* using error propagation formula and d(atan(u))/du = 1/(1+u^2) */</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     *error = (dy*dy*x*x + dx*dx*y*y) / ((x*x + y*y)*(x*x + y*y));</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     *error = sqrt(*error);</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     assert( *error >= 0 );</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     <span class="keywordflow">return</span> atan2(y, x);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__double_8h-source.html b/html/fors__double_8h-source.html
deleted file mode 100644
index 6769602..0000000
--- a/html/fors__double_8h-source.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_double.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_double.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_double.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_DOUBLE_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_DOUBLE_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#undef LIST_DEFINE</span>
-<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM double</span>
-<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="keywordtype">double</span> *
-<a name="l00037"></a>00037 double_duplicate(<span class="keyword">const</span> <span class="keywordtype">double</span> *d);
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="keywordtype">void</span>
-<a name="l00040"></a>00040 double_delete(<span class="keywordtype">double</span> **d);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keywordtype">double</span>
-<a name="l00043"></a>00043 double_eval(<span class="keyword">const</span> <span class="keywordtype">double</span> *d, <span class="keywordtype">void</span> *data);
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="keywordtype">double</span>
-<a name="l00046"></a>00046 double_divide(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,
-<a name="l00047"></a>00047           <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,
-<a name="l00048"></a>00048           <span class="keywordtype">double</span> *error);
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050 <span class="keywordtype">double</span>
-<a name="l00051"></a>00051 double_subtract(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,
-<a name="l00052"></a>00052                 <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,
-<a name="l00053"></a>00053                 <span class="keywordtype">double</span> *error);
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 <span class="keywordtype">double</span>
-<a name="l00056"></a>00056 double_atan2(<span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,
-<a name="l00057"></a>00057              <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,
-<a name="l00058"></a>00058          <span class="keywordtype">double</span> *error);
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__double_8h_source.html b/html/fors__double_8h_source.html
new file mode 100644
index 0000000..334fe45
--- /dev/null
+++ b/html/fors__double_8h_source.html
@@ -0,0 +1,121 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_double.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_double.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_double.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.4 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_DOUBLE_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_DOUBLE_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#undef LIST_DEFINE</span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM double</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keywordtype">double</span> *</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> double_duplicate(<span class="keyword">const</span> <span class="keywordtype">double</span> *d);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> double_delete(<span class="keywordtype">double</span> **d);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> double_eval(<span class="keyword">const</span> <span class="keywordtype">double</span> *d, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> double_divide(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>           <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>           <span class="keywordtype">double</span> *error);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> double_subtract(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>                 <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>                 <span class="keywordtype">double</span> *error);</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> double_atan2(<span class="keywordtype">double</span> y, <span class="keywordtype">double</span> dy,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>              <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> dx,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>          <span class="keywordtype">double</span> *error);</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__extract_8h-source.html b/html/fors__extract_8h-source.html
deleted file mode 100644
index 8ae1f21..0000000
--- a/html/fors__extract_8h-source.html
+++ /dev/null
@@ -1,97 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_extract.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_extract.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_extract.h,v 1.11 2011/06/11 06:16:24 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/06/11 06:16:24 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.11 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_EXTRACT_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_EXTRACT_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_star.h></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 CPL_BEGIN_DECLS
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__extract__method.html">_extract_method</a> extract_method;
-<a name="l00039"></a>00039 
-<a name="l00040"></a><a class="code" href="structfors__extract__sky__stats.html">00040</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> {
-<a name="l00041"></a><a class="code" href="structfors__extract__sky__stats.html#69ed6753cee271b73c8b7e73a016fdeb">00041</a>     <span class="keywordtype">double</span> <a class="code" href="structfors__extract__sky__stats.html#b7ca852023d946aa752ef2d3f4f871b9">mean</a>, <a class="code" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">median</a>, <a class="code" href="structfors__extract__sky__stats.html#69ed6753cee271b73c8b7e73a016fdeb">rms</a>;
-<a name="l00042"></a>00042 } <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a>;
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="keywordtype">void</span> 
-<a name="l00045"></a>00045 <a class="code" href="group__fors__extract.html#gd07fd085541e8be0723f2932a29abdb3">fors_extract_define_parameters</a>(             cpl_parameterlist *parameters, 
-<a name="l00046"></a>00046                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *context);
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="keywordtype">bool</span>
-<a name="l00049"></a>00049 <a class="code" href="group__fors__extract.html#gcdd189ebaad6fe5c20ac2dea2eb06dfe">fors_extract_check_sex_flag</a>(                <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    sex_flag);
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 <span class="keywordtype">bool</span>
-<a name="l00052"></a>00052 <a class="code" href="group__fors__extract.html#g2c649f2f8802860d4693e38bd640032c">fors_extract_check_sex_star</a>(                <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star,
-<a name="l00053"></a>00053                                             <span class="keyword">const</span> cpl_image *ref_img);
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 extract_method *
-<a name="l00057"></a>00057 <a class="code" href="group__fors__extract.html#g1f3f1af725e7b5fb1c770507eab8ac09">fors_extract_method_new</a>(                    <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00058"></a>00058                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *context);
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060 <span class="keywordtype">void</span>
-<a name="l00061"></a>00061 <a class="code" href="group__fors__extract.html#g2f7149d890f135097366c9389cab25fe">fors_extract_method_delete</a>(                 extract_method **em);
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063 fors_star_list *
-<a name="l00064"></a>00064 <a class="code" href="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1">fors_extract</a>(                               <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, 
-<a name="l00065"></a>00065                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00066"></a>00066                                             <span class="keyword">const</span> extract_method *em,
-<a name="l00067"></a>00067                                             <span class="keywordtype">double</span> magsyserr,
-<a name="l00068"></a>00068                                             <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,
-<a name="l00069"></a>00069                                             cpl_image **background,
-<a name="l00070"></a>00070                                             cpl_table **extracted_sources);
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073 CPL_END_DECLS
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__extract_8h_source.html b/html/fors__extract_8h_source.html
new file mode 100644
index 0000000..94aad84
--- /dev/null
+++ b/html/fors__extract_8h_source.html
@@ -0,0 +1,136 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_extract.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_extract.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_extract.h,v 1.11 2011-06-11 06:16:24 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-06-11 06:16:24 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.11 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_EXTRACT_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_EXTRACT_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_star.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__extract__method.html">_extract_method</a> extract_method;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="structfors__extract__sky__stats.html">   40</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> {</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>     <span class="keywordtype">double</span> mean, median, rms;</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> } <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a>;</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <a class="code" href="group__fors__extract.html#ga2fe71423afa3cceea5d92dd3b49aca1e" title="Define recipe parameters.">fors_extract_define_parameters</a>(             cpl_parameterlist *parameters, </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *context);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <a class="code" href="group__fors__extract.html#ga0753c9c8f5c40f594ebc0628407df2d4" title="Check SExtractor object feature: FLAG.">fors_extract_check_sex_flag</a>(                <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    sex_flag);</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <a class="code" href="group__fors__extract.html#gab2bb9e07066870dd90dadd6044803dd0" title="Check a sextracted star for validity.">fors_extract_check_sex_star</a>(                <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>                                             <span class="keyword">const</span> cpl_image *ref_img);</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> extract_method *</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <a class="code" href="group__fors__extract.html#ga9b1d727905c3cb3f7740900ffaba6b57" title="Get extraction method from parameter list.">fors_extract_method_new</a>(                    <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *context);</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <a class="code" href="group__fors__extract.html#ga11354d3d250769e1adb67e1a2dbc1a96" title="Deallocate extraction method and set the pointer to NULL.">fors_extract_method_delete</a>(                 extract_method **em);</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> fors_star_list *</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <a class="code" href="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05" title="Extract sources.">fors_extract</a>(                               <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>                                             <span class="keyword">const</span> extract_method *em,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                                             <span class="keywordtype">double</span> magsyserr,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                             <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                             cpl_image **background,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                                             cpl_table **extracted_sources);</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__extract__objects_8c-source.html b/html/fors__extract__objects_8c-source.html
deleted file mode 100644
index ee10d28..0000000
--- a/html/fors__extract__objects_8c-source.html
+++ /dev/null
@@ -1,448 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_extract_objects.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_extract_objects.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_extract_objects.c,v 1.6 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.6 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_extract_objects_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to extract scientific objects spectra on a resampled\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"image produced with recipe fors_resample, at the positions listed in the\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"object table produced by recipe fors_detect_objects. Please refer to the\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"FORS Pipeline User's Manual for more details on object extraction.\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"LSS, and SCI as STD.\n\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"  MAPPED_SCI_MXU             Calib       Resampled slit spectra  Y\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"  MAPPED_SKY_SCI_MXU         Calib       Resampled sky spectra   Y\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"  OBJECT_TABLE_SCI_MXU       Calib       Object table            Y\n\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  REDUCED_SCI_MXU            FITS image  Extracted object spectra\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  REDUCED_SKY_SCI_MXU        FITS image  Extracted sky spectra\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  REDUCED_ERROR_SCI_MXU      FITS image  Error on extracted spectra\n\n"</span>;
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 <span class="preprocessor">#define fors_extract_objects_exit(message)    \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">{                                             \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">cpl_image_delete(mapped);                     \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">cpl_image_delete(skymapped);                  \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00067"></a>00067 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">}</span>
-<a name="l00071"></a>00071 <span class="preprocessor"></span>
-<a name="l00072"></a>00072 <span class="preprocessor">#define fors_extract_objects_exit_memcheck(message)    \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">{                                                      \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);            \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">printf("free mapped (%p)\n", mapped);                  \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_image_delete(mapped);                              \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">printf("free skymapped (%p)\n", skymapped);            \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_image_delete(skymapped);                           \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">printf("free slits (%p)\n", slits);                    \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_table_delete(slits);                               \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">printf("free header (%p)\n", header);                  \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_propertylist_delete(header);                       \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_msg_indent_less();                                 \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">return 0;                                              \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">}</span>
-<a name="l00086"></a>00086 <span class="preprocessor"></span>
-<a name="l00087"></a>00087 
-<a name="l00099"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00099</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00100"></a>00100 {
-<a name="l00101"></a>00101     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00102"></a>00102     cpl_plugin *plugin = &recipe->interface;
-<a name="l00103"></a>00103 
-<a name="l00104"></a>00104     cpl_plugin_init(plugin,
-<a name="l00105"></a>00105                     CPL_PLUGIN_API,
-<a name="l00106"></a>00106                     FORS_BINARY_VERSION,
-<a name="l00107"></a>00107                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00108"></a>00108                     <span class="stringliteral">"fors_extract_objects"</span>,
-<a name="l00109"></a>00109                     <span class="stringliteral">"Extract objects in slit spectra"</span>,
-<a name="l00110"></a>00110                     fors_extract_objects_description,
-<a name="l00111"></a>00111                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00112"></a>00112                     PACKAGE_BUGREPORT,
-<a name="l00113"></a>00113     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00114"></a>00114     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00115"></a>00115     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00116"></a>00116     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00117"></a>00117     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00118"></a>00118     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00119"></a>00119     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00120"></a>00120     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00121"></a>00121     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00122"></a>00122     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00123"></a>00123     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00124"></a>00124     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00125"></a>00125     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00126"></a>00126                     fors_extract_objects_create,
-<a name="l00127"></a>00127                     fors_extract_objects_exec,
-<a name="l00128"></a>00128                     fors_extract_objects_destroy);
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130     cpl_pluginlist_append(list, plugin);
-<a name="l00131"></a>00131     
-<a name="l00132"></a>00132     <span class="keywordflow">return</span> 0;
-<a name="l00133"></a>00133 }
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135 
-<a name="l00146"></a>00146 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_create(cpl_plugin *plugin)
-<a name="l00147"></a>00147 {
-<a name="l00148"></a>00148     cpl_recipe    *recipe;
-<a name="l00149"></a>00149     cpl_parameter *p;
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     <span class="comment">/* </span>
-<a name="l00152"></a>00152 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00153"></a>00153 <span class="comment">     */</span>
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00156"></a>00156         recipe = (cpl_recipe *)plugin;
-<a name="l00157"></a>00157     <span class="keywordflow">else</span> 
-<a name="l00158"></a>00158         <span class="keywordflow">return</span> -1;
-<a name="l00159"></a>00159 
-<a name="l00160"></a>00160     <span class="comment">/* </span>
-<a name="l00161"></a>00161 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00162"></a>00162 <span class="comment">     */</span>
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166     <span class="comment">/*</span>
-<a name="l00167"></a>00167 <span class="comment">     * Object extraction method</span>
-<a name="l00168"></a>00168 <span class="comment">     */</span>
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract_objects.ext_mode"</span>,
-<a name="l00171"></a>00171                                 CPL_TYPE_INT,
-<a name="l00172"></a>00172                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span>
-<a name="l00173"></a>00173                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,
-<a name="l00174"></a>00174                                 <span class="stringliteral">"fors.fors_extract_objects"</span>,
-<a name="l00175"></a>00175                                 1);
-<a name="l00176"></a>00176     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);
-<a name="l00177"></a>00177     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00178"></a>00178     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00179"></a>00179 
-<a name="l00180"></a>00180     <span class="keywordflow">return</span> 0;
-<a name="l00181"></a>00181 }
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183 
-<a name="l00192"></a>00192 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_exec(cpl_plugin *plugin)
-<a name="l00193"></a>00193 {
-<a name="l00194"></a>00194     cpl_recipe *recipe;
-<a name="l00195"></a>00195     
-<a name="l00196"></a>00196     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00197"></a>00197         recipe = (cpl_recipe *)plugin;
-<a name="l00198"></a>00198     <span class="keywordflow">else</span> 
-<a name="l00199"></a>00199         <span class="keywordflow">return</span> -1;
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201     <span class="keywordflow">return</span> fors_extract_objects(recipe->parameters, recipe->frames);
-<a name="l00202"></a>00202 }
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204 
-<a name="l00213"></a>00213 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_destroy(cpl_plugin *plugin)
-<a name="l00214"></a>00214 {
-<a name="l00215"></a>00215     cpl_recipe *recipe;
-<a name="l00216"></a>00216     
-<a name="l00217"></a>00217     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00218"></a>00218         recipe = (cpl_recipe *)plugin;
-<a name="l00219"></a>00219     <span class="keywordflow">else</span> 
-<a name="l00220"></a>00220         <span class="keywordflow">return</span> -1;
-<a name="l00221"></a>00221 
-<a name="l00222"></a>00222     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224     <span class="keywordflow">return</span> 0;
-<a name="l00225"></a>00225 }
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227 
-<a name="l00237"></a>00237 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects(cpl_parameterlist *parlist, 
-<a name="l00238"></a>00238                                cpl_frameset *frameset)
-<a name="l00239"></a>00239 {
-<a name="l00240"></a>00240 
-<a name="l00241"></a>00241     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_extract_objects"</span>;
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     <span class="comment">/*</span>
-<a name="l00245"></a>00245 <span class="comment">     * Input parameters</span>
-<a name="l00246"></a>00246 <span class="comment">     */</span>
-<a name="l00247"></a>00247 
-<a name="l00248"></a>00248     <span class="keywordtype">int</span>         ext_mode;
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250     <span class="comment">/*</span>
-<a name="l00251"></a>00251 <span class="comment">     * CPL objects</span>
-<a name="l00252"></a>00252 <span class="comment">     */</span>
-<a name="l00253"></a>00253 
-<a name="l00254"></a>00254     cpl_image       **images;
-<a name="l00255"></a>00255     cpl_image        *mapped    = NULL;
-<a name="l00256"></a>00256     cpl_image        *skymapped = NULL;
-<a name="l00257"></a>00257     cpl_table        *slits     = NULL;
-<a name="l00258"></a>00258     cpl_propertylist *header    = NULL;
-<a name="l00259"></a>00259 
-<a name="l00260"></a>00260     <span class="comment">/*</span>
-<a name="l00261"></a>00261 <span class="comment">     * Auxiliary variables</span>
-<a name="l00262"></a>00262 <span class="comment">     */</span>
-<a name="l00263"></a>00263 
-<a name="l00264"></a>00264     <span class="keywordtype">char</span>    version[80];
-<a name="l00265"></a>00265     <span class="keyword">const</span> <span class="keywordtype">char</span>   *object_tag;
-<a name="l00266"></a>00266     <span class="keyword">const</span> <span class="keywordtype">char</span>   *science_tag;
-<a name="l00267"></a>00267     <span class="keyword">const</span> <span class="keywordtype">char</span>   *sky_tag;
-<a name="l00268"></a>00268     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_tag;
-<a name="l00269"></a>00269     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_sky_tag;
-<a name="l00270"></a>00270     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_err_tag;
-<a name="l00271"></a>00271     <span class="keywordtype">int</span>     nframes;
-<a name="l00272"></a>00272     <span class="keywordtype">double</span>  gain;
-<a name="l00273"></a>00273     <span class="keywordtype">double</span>  <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>;
-<a name="l00274"></a>00274     <span class="keywordtype">int</span>     scimxu;
-<a name="l00275"></a>00275     <span class="keywordtype">int</span>     scimos;
-<a name="l00276"></a>00276     <span class="keywordtype">int</span>     scilss;
-<a name="l00277"></a>00277     <span class="keywordtype">int</span>     stdmxu;
-<a name="l00278"></a>00278     <span class="keywordtype">int</span>     stdmos;
-<a name="l00279"></a>00279     <span class="keywordtype">int</span>     stdlss;
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281     <span class="keywordtype">char</span>   *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     cpl_msg_set_indentation(2);
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287     <span class="comment">/*</span>
-<a name="l00288"></a>00288 <span class="comment">     * Get configuration parameters</span>
-<a name="l00289"></a>00289 <span class="comment">     */</span>
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00292"></a>00292     cpl_msg_indent_more();
-<a name="l00293"></a>00293 
-<a name="l00294"></a>00294     ext_mode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00295"></a>00295                                      <span class="stringliteral">"fors.fors_extract_objects.ext_mode"</span>,
-<a name="l00296"></a>00296                                      NULL);
-<a name="l00297"></a>00297     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)
-<a name="l00298"></a>00298         fors_extract_objects_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);
-<a name="l00299"></a>00299 
-<a name="l00300"></a>00300     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00301"></a>00301         fors_extract_objects_exit(<span class="stringliteral">"Failure reading configuration parameters"</span>);
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304     cpl_msg_indent_less();
-<a name="l00305"></a>00305     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00306"></a>00306     cpl_msg_indent_more();
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308     nframes  = scimxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_MXU"</span>);
-<a name="l00309"></a>00309     nframes += scimos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_MOS"</span>);
-<a name="l00310"></a>00310     nframes += scilss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_LSS"</span>);
-<a name="l00311"></a>00311     nframes += stdmxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_MXU"</span>);
-<a name="l00312"></a>00312     nframes += stdmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_MOS"</span>);
-<a name="l00313"></a>00313     nframes += stdlss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_LSS"</span>);
-<a name="l00314"></a>00314 
-<a name="l00315"></a>00315     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00316"></a>00316         fors_extract_objects_exit(<span class="stringliteral">"Missing input scientific spectra"</span>);
-<a name="l00317"></a>00317     }
-<a name="l00318"></a>00318     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00319"></a>00319         cpl_msg_error(recipe, <span class="stringliteral">"Too many input scientific spectra (%d > 1)"</span>, 
-<a name="l00320"></a>00320                       nframes);
-<a name="l00321"></a>00321         fors_extract_objects_exit(NULL);
-<a name="l00322"></a>00322     }
-<a name="l00323"></a>00323 
-<a name="l00324"></a>00324     <span class="keywordflow">if</span> (scimxu) {
-<a name="l00325"></a>00325         science_tag       = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;
-<a name="l00326"></a>00326         sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_MXU"</span>;
-<a name="l00327"></a>00327         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;
-<a name="l00328"></a>00328         reduced_tag       = <span class="stringliteral">"REDUCED_SCI_MXU"</span>;
-<a name="l00329"></a>00329         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_SCI_MXU"</span>;
-<a name="l00330"></a>00330         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_SCI_MXU"</span>;
-<a name="l00331"></a>00331     }
-<a name="l00332"></a>00332     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scimos) {
-<a name="l00333"></a>00333         science_tag       = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;
-<a name="l00334"></a>00334         sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_MOS"</span>;
-<a name="l00335"></a>00335         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;
-<a name="l00336"></a>00336         reduced_tag       = <span class="stringliteral">"REDUCED_SCI_MOS"</span>;
-<a name="l00337"></a>00337         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_SCI_MOS"</span>;
-<a name="l00338"></a>00338         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_SCI_MOS"</span>;
-<a name="l00339"></a>00339     }
-<a name="l00340"></a>00340     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scilss) {
-<a name="l00341"></a>00341         science_tag       = <span class="stringliteral">"MAPPED_SCI_LSS"</span>;
-<a name="l00342"></a>00342         sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_LSS"</span>;
-<a name="l00343"></a>00343         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;
-<a name="l00344"></a>00344         reduced_tag       = <span class="stringliteral">"REDUCED_SCI_LSS"</span>;
-<a name="l00345"></a>00345         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_SCI_LSS"</span>;
-<a name="l00346"></a>00346         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_SCI_LSS"</span>;
-<a name="l00347"></a>00347     }
-<a name="l00348"></a>00348     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdmxu) {
-<a name="l00349"></a>00349         science_tag       = <span class="stringliteral">"MAPPED_STD_MXU"</span>;
-<a name="l00350"></a>00350         sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_MXU"</span>;
-<a name="l00351"></a>00351         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;
-<a name="l00352"></a>00352         reduced_tag       = <span class="stringliteral">"REDUCED_STD_MXU"</span>;
-<a name="l00353"></a>00353         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_STD_MXU"</span>;
-<a name="l00354"></a>00354         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_STD_MXU"</span>;
-<a name="l00355"></a>00355     }
-<a name="l00356"></a>00356     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdmos) {
-<a name="l00357"></a>00357         science_tag       = <span class="stringliteral">"MAPPED_STD_MOS"</span>;
-<a name="l00358"></a>00358         sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_MOS"</span>;
-<a name="l00359"></a>00359         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;
-<a name="l00360"></a>00360         reduced_tag       = <span class="stringliteral">"REDUCED_STD_MOS"</span>;
-<a name="l00361"></a>00361         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_STD_MOS"</span>;
-<a name="l00362"></a>00362         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_STD_MOS"</span>;
-<a name="l00363"></a>00363     }
-<a name="l00364"></a>00364     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdlss) {
-<a name="l00365"></a>00365         science_tag       = <span class="stringliteral">"MAPPED_STD_LSS"</span>;
-<a name="l00366"></a>00366         sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_LSS"</span>;
-<a name="l00367"></a>00367         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;
-<a name="l00368"></a>00368         reduced_tag       = <span class="stringliteral">"REDUCED_STD_LSS"</span>;
-<a name="l00369"></a>00369         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_STD_LSS"</span>;
-<a name="l00370"></a>00370         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_STD_LSS"</span>;
-<a name="l00371"></a>00371     }
-<a name="l00372"></a>00372 
-<a name="l00373"></a>00373     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00374"></a>00374         fors_extract_objects_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00377"></a>00377         fors_extract_objects_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00378"></a>00378 
-<a name="l00379"></a>00379     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00380"></a>00380         fors_extract_objects_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00381"></a>00381 
-<a name="l00382"></a>00382     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l00383"></a>00383     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00384"></a>00384         fors_extract_objects_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00387"></a>00387     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00388"></a>00388         fors_extract_objects_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span>
-<a name="l00389"></a>00389                                  <span class="stringliteral">"header"</span>);
-<a name="l00390"></a>00390 
-<a name="l00391"></a>00391     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00392"></a>00392         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00393"></a>00393     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00394"></a>00394         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00395"></a>00395 
-<a name="l00396"></a>00396     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00399"></a>00399         fors_extract_objects_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in "</span>
-<a name="l00400"></a>00400                                <span class="stringliteral">"scientific frame header"</span>);
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l00403"></a>00403 
-<a name="l00404"></a>00404 
-<a name="l00405"></a>00405     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00408"></a>00408         fors_extract_objects_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in "</span>
-<a name="l00409"></a>00409                                   <span class="stringliteral">"scientific frame header"</span>);
-<a name="l00410"></a>00410 
-<a name="l00411"></a>00411     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span>
-<a name="l00412"></a>00412 
-<a name="l00413"></a>00413     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415 
-<a name="l00416"></a>00416     cpl_msg_indent_less();
-<a name="l00417"></a>00417     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);
-<a name="l00418"></a>00418     cpl_msg_indent_more();
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420     mapped = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00421"></a>00421     <span class="keywordflow">if</span> (mapped == NULL)
-<a name="l00422"></a>00422         fors_extract_objects_exit(<span class="stringliteral">"Cannot load input scientific frame"</span>);
-<a name="l00423"></a>00423 
-<a name="l00424"></a>00424     skymapped = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, sky_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00425"></a>00425     <span class="keywordflow">if</span> (skymapped == NULL)
-<a name="l00426"></a>00426         fors_extract_objects_exit(<span class="stringliteral">"Cannot load input sky frame"</span>);
-<a name="l00427"></a>00427 
-<a name="l00428"></a>00428     slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, object_tag, 1);
-<a name="l00429"></a>00429     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00430"></a>00430         fors_extract_objects_exit(<span class="stringliteral">"Cannot load input object table"</span>);
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433     cpl_msg_indent_less();
-<a name="l00434"></a>00434     cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);
-<a name="l00435"></a>00435     cpl_msg_indent_more();
-<a name="l00436"></a>00436 
-<a name="l00437"></a>00437     images = <a class="code" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">mos_extract_objects</a>(mapped, skymapped, slits,
-<a name="l00438"></a>00438                                  ext_mode, ron, gain, 1);
-<a name="l00439"></a>00439 
-<a name="l00440"></a>00440     cpl_image_delete(mapped); mapped = NULL;
-<a name="l00441"></a>00441     cpl_image_delete(skymapped); skymapped = NULL;
-<a name="l00442"></a>00442     cpl_table_delete(slits); slits = NULL;
-<a name="l00443"></a>00443 
-<a name="l00444"></a>00444     <span class="keywordflow">if</span> (images) {
-<a name="l00445"></a>00445 
-<a name="l00446"></a>00446         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[0], reduced_tag, header,
-<a name="l00447"></a>00447                            parlist, recipe, version))
-<a name="l00448"></a>00448             fors_extract_objects_exit(NULL);
-<a name="l00449"></a>00449         cpl_image_delete(images[0]);
-<a name="l00450"></a>00450 
-<a name="l00451"></a>00451         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[1], reduced_sky_tag, header,
-<a name="l00452"></a>00452                            parlist, recipe, version))
-<a name="l00453"></a>00453             fors_extract_objects_exit(NULL);
-<a name="l00454"></a>00454         cpl_image_delete(images[1]);
-<a name="l00455"></a>00455 
-<a name="l00456"></a>00456         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[2], reduced_err_tag, header,
-<a name="l00457"></a>00457                            parlist, recipe, version))
-<a name="l00458"></a>00458             fors_extract_objects_exit(NULL);
-<a name="l00459"></a>00459         cpl_image_delete(images[2]);
-<a name="l00460"></a>00460 
-<a name="l00461"></a>00461         cpl_free(images);
-<a name="l00462"></a>00462     }
-<a name="l00463"></a>00463     <span class="keywordflow">else</span> {
-<a name="l00464"></a>00464         cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span>
-<a name="l00465"></a>00465                         <span class="stringliteral">"%s, %s, and %s are not created"</span>,
-<a name="l00466"></a>00466                         reduced_tag, reduced_sky_tag, reduced_err_tag);
-<a name="l00467"></a>00467     }
-<a name="l00468"></a>00468 
-<a name="l00469"></a>00469     cpl_propertylist_delete(header); header = NULL;
-<a name="l00470"></a>00470 
-<a name="l00471"></a>00471     <span class="keywordflow">return</span> 0;
-<a name="l00472"></a>00472 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__extract__objects_8c_source.html b/html/fors__extract__objects_8c_source.html
new file mode 100644
index 0000000..db43dbd
--- /dev/null
+++ b/html/fors__extract__objects_8c_source.html
@@ -0,0 +1,487 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_extract_objects.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_extract_objects.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_extract_objects.c,v 1.6 2013-04-24 14:14:13 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-04-24 14:14:13 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.6 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_extract_objects_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to extract scientific objects spectra on a resampled\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"image produced with recipe fors_resample, at the positions listed in the\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"object table produced by recipe fors_detect_objects. Please refer to the\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"FORS Pipeline User's Manual for more details on object extraction.\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"LSS, and SCI as STD.\n\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"  MAPPED_SCI_MXU             Calib       Resampled slit spectra  Y\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"  MAPPED_SKY_SCI_MXU         Calib       Resampled sky spectra   Y\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"  OBJECT_TABLE_SCI_MXU       Calib       Object table            Y\n\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  REDUCED_SCI_MXU            FITS image  Extracted object spectra\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  REDUCED_SKY_SCI_MXU        FITS image  Extracted sky spectra\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  REDUCED_ERROR_SCI_MXU      FITS image  Error on extracted spectra\n\n"</span>;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">#define fors_extract_objects_exit(message)    \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">cpl_image_delete(mapped);                     \</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">cpl_image_delete(skymapped);                  \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">#define fors_extract_objects_exit_memcheck(message)    \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">{                                                      \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);            \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">printf("free mapped (%p)\n", mapped);                  \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_image_delete(mapped);                              \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">printf("free skymapped (%p)\n", skymapped);            \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_image_delete(skymapped);                           \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">printf("free slits (%p)\n", slits);                    \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">cpl_table_delete(slits);                               \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">printf("free header (%p)\n", header);                  \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_propertylist_delete(header);                       \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_msg_indent_less();                                 \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">return 0;                                              \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> {</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                     <span class="stringliteral">"fors_extract_objects"</span>,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                     <span class="stringliteral">"Extract objects in slit spectra"</span>,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     fors_extract_objects_description,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                     fors_extract_objects_create,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                     fors_extract_objects_exec,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                     fors_extract_objects_destroy);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> }</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> {</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="comment">     * Object extraction method</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract_objects.ext_mode"</span>,</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>                                 <span class="stringliteral">"fors.fors_extract_objects"</span>,</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>                                 1);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> }</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> {</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="keywordflow">return</span> fors_extract_objects(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> }</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> {</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> </div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> }</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_objects(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> {</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> </div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_extract_objects"</span>;</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keywordtype">int</span>         ext_mode;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     cpl_image       **images;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     cpl_image        *mapped    = NULL;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     cpl_image        *skymapped = NULL;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     cpl_table        *slits     = NULL;</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     cpl_propertylist *header    = NULL;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     <span class="keywordtype">char</span>    version[80];</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *object_tag;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *science_tag;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *sky_tag;</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_tag;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_sky_tag;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_err_tag;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <span class="keywordtype">int</span>     nframes;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <span class="keywordtype">double</span>  gain;</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="keywordtype">double</span>  ron;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     <span class="keywordtype">int</span>     scimxu;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="keywordtype">int</span>     scimos;</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     <span class="keywordtype">int</span>     scilss;</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordtype">int</span>     stdmxu;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="keywordtype">int</span>     stdmos;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="keywordtype">int</span>     stdlss;</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     <span class="keywordtype">char</span>   *instrume = NULL;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> </div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     ext_mode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                                      <span class="stringliteral">"fors.fors_extract_objects.ext_mode"</span>,</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                                      NULL);</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>         fors_extract_objects_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>         fors_extract_objects_exit(<span class="stringliteral">"Failure reading configuration parameters"</span>);</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     nframes  = scimxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     nframes += scimos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     nframes += scilss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_SCI_LSS"</span>);</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     nframes += stdmxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_MXU"</span>);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     nframes += stdmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_MOS"</span>);</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     nframes += stdlss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_STD_LSS"</span>);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>         fors_extract_objects_exit(<span class="stringliteral">"Missing input scientific spectra"</span>);</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     }</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input scientific spectra (%d > 1)"</span>, </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>                       nframes);</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>         fors_extract_objects_exit(NULL);</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     }</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     <span class="keywordflow">if</span> (scimxu) {</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>         science_tag       = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>         sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         reduced_tag       = <span class="stringliteral">"REDUCED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     }</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scimos) {</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>         science_tag       = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>         sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>         reduced_tag       = <span class="stringliteral">"REDUCED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     }</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scilss) {</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>         science_tag       = <span class="stringliteral">"MAPPED_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         reduced_tag       = <span class="stringliteral">"REDUCED_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     }</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdmxu) {</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>         science_tag       = <span class="stringliteral">"MAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>         sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         reduced_tag       = <span class="stringliteral">"REDUCED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_STD_MXU"</span>;</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     }</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdmos) {</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>         science_tag       = <span class="stringliteral">"MAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>         sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>         reduced_tag       = <span class="stringliteral">"REDUCED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_STD_MOS"</span>;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     }</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdlss) {</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>         science_tag       = <span class="stringliteral">"MAPPED_STD_LSS"</span>;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>         sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_LSS"</span>;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>         object_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>         reduced_tag       = <span class="stringliteral">"REDUCED_STD_LSS"</span>;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>         reduced_sky_tag   = <span class="stringliteral">"REDUCED_SKY_STD_LSS"</span>;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>         reduced_err_tag   = <span class="stringliteral">"REDUCED_ERROR_STD_LSS"</span>;</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     }</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> </div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>         fors_extract_objects_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>         fors_extract_objects_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>         fors_extract_objects_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> </div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>         fors_extract_objects_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>         fors_extract_objects_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>                                  <span class="stringliteral">"header"</span>);</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> </div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> </div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         fors_extract_objects_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in "</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>                                <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> </div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> </div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         fors_extract_objects_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in "</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>                                   <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> </div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span></div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> </div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> </div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     mapped = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="keywordflow">if</span> (mapped == NULL)</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>         fors_extract_objects_exit(<span class="stringliteral">"Cannot load input scientific frame"</span>);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     skymapped = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, sky_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     <span class="keywordflow">if</span> (skymapped == NULL)</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         fors_extract_objects_exit(<span class="stringliteral">"Cannot load input sky frame"</span>);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, object_tag, 1);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>         fors_extract_objects_exit(<span class="stringliteral">"Cannot load input object table"</span>);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> </div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span> </div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     images = <a class="code" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522" title="Extract detected objects from rectified scientific frame.">mos_extract_objects</a>(mapped, skymapped, slits,</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                                  ext_mode, ron, gain, 1);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> </div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     cpl_image_delete(mapped); mapped = NULL;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     cpl_image_delete(skymapped); skymapped = NULL;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     <span class="keywordflow">if</span> (images) {</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[0], reduced_tag, header,</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>             fors_extract_objects_exit(NULL);</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>         cpl_image_delete(images[0]);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> </div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[1], reduced_sky_tag, header,</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>             fors_extract_objects_exit(NULL);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>         cpl_image_delete(images[1]);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> </div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[2], reduced_err_tag, header,</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>             fors_extract_objects_exit(NULL);</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         cpl_image_delete(images[2]);</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span> </div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>         cpl_free(images);</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     }</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>                         <span class="stringliteral">"%s, %s, and %s are not created"</span>,</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>                         reduced_tag, reduced_sky_tag, reduced_err_tag);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     }</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> </div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__extract__slits_8c-source.html b/html/fors__extract__slits_8c-source.html
deleted file mode 100644
index b5588e0..0000000
--- a/html/fors__extract__slits_8c-source.html
+++ /dev/null
@@ -1,687 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_extract_slits.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_extract_slits.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_extract_slits.c,v 1.7 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_extract_slits_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to extract MOS/MXU slit spectra, following their\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"curvature, and to remap them into a spatially rectified image.\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"Please refer to the FORS Pipeline User's Manual for details about\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"the spectra remapping technique. Note however that the interpolation\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"is done exclusively along the spatial direction, and therefore the\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"output rectified image will have the same x size of the input spectral\n"</span> 
-<a name="l00049"></a>00049 <span class="stringliteral">"image.\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS.\n\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"  LAMP_UNBIAS_MXU\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"  or SCIENCE_UNBIAS_MXU\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"  or SCIENCE_UNFLAT_MXU\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  or STANDARD_UNBIAS_MXU\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  or STANDARD_UNFLAT_MXU\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  or UNMAPPED_SCI_MXU\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"  or UNMAPPED_STD_MXU\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"  or UNMAPPED_SKY_SCI_MXU\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"  or UNMAPPED_SKY_STD_MXU    Calib       Spectral frame          Y\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  SLIT_LOCATION_DETECT_MXU\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  or SLIT_LOCATION_MXU       Calib       Master flat frame       Y\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      Y\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  RECTIFIED_LAMP_MXU\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"  or RECTIFIED_ALL_SCI_MXU\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"  or RECTIFIED_ALL_STD_MXU\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"  or RECTIFIED_SCI_MXU\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"  or RECTIFIED_STD_MXU\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"  or RECTIFIED_SKY_SCI_MXU\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"  or RECTIFIED_SKY_STD_MXU   FITS image  Rectified slit spectra\n\n"</span>;
-<a name="l00076"></a>00076 
-<a name="l00077"></a>00077 <span class="preprocessor">#define fors_extract_slits_exit(message)      \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">{                                             \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">cpl_image_delete(spatial);                    \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">}</span>
-<a name="l00090"></a>00090 <span class="preprocessor"></span>
-<a name="l00091"></a>00091 <span class="preprocessor">#define fors_extract_slits_exit_memcheck(message)  \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">{                                               \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00094"></a>00094 <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">cpl_image_delete(spectra);                      \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">printf("free spatial (%p)\n", spatial);         \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">cpl_image_delete(spatial);                      \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">cpl_table_delete(grism_table);                  \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">cpl_table_delete(maskslits);                    \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">cpl_table_delete(slits);                        \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">cpl_table_delete(polytraces);                   \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">}</span>
-<a name="l00111"></a>00111 <span class="preprocessor"></span>
-<a name="l00112"></a>00112 
-<a name="l00124"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00124</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00125"></a>00125 {
-<a name="l00126"></a>00126     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00127"></a>00127     cpl_plugin *plugin = &recipe->interface;
-<a name="l00128"></a>00128 
-<a name="l00129"></a>00129     cpl_plugin_init(plugin,
-<a name="l00130"></a>00130                     CPL_PLUGIN_API,
-<a name="l00131"></a>00131                     FORS_BINARY_VERSION,
-<a name="l00132"></a>00132                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00133"></a>00133                     <span class="stringliteral">"fors_extract_slits"</span>,
-<a name="l00134"></a>00134                     <span class="stringliteral">"Spatial rectification of spectral image"</span>,
-<a name="l00135"></a>00135                     fors_extract_slits_description,
-<a name="l00136"></a>00136                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00137"></a>00137                     PACKAGE_BUGREPORT,
-<a name="l00138"></a>00138     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00139"></a>00139     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00140"></a>00140     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00141"></a>00141     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00142"></a>00142     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00143"></a>00143     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00144"></a>00144     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00145"></a>00145     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00146"></a>00146     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00147"></a>00147     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00148"></a>00148     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00149"></a>00149     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00150"></a>00150     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00151"></a>00151                     fors_extract_slits_create,
-<a name="l00152"></a>00152                     fors_extract_slits_exec,
-<a name="l00153"></a>00153                     fors_extract_slits_destroy);
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     cpl_pluginlist_append(list, plugin);
-<a name="l00156"></a>00156     
-<a name="l00157"></a>00157     <span class="keywordflow">return</span> 0;
-<a name="l00158"></a>00158 }
-<a name="l00159"></a>00159 
-<a name="l00160"></a>00160 
-<a name="l00171"></a>00171 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_create(cpl_plugin *plugin)
-<a name="l00172"></a>00172 {
-<a name="l00173"></a>00173     cpl_recipe    *recipe;
-<a name="l00174"></a>00174     cpl_parameter *p;
-<a name="l00175"></a>00175 
-<a name="l00176"></a>00176     <span class="comment">/* </span>
-<a name="l00177"></a>00177 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00178"></a>00178 <span class="comment">     */</span>
-<a name="l00179"></a>00179 
-<a name="l00180"></a>00180     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00181"></a>00181         recipe = (cpl_recipe *)plugin;
-<a name="l00182"></a>00182     <span class="keywordflow">else</span> 
-<a name="l00183"></a>00183         <span class="keywordflow">return</span> -1;
-<a name="l00184"></a>00184 
-<a name="l00185"></a>00185     <span class="comment">/* </span>
-<a name="l00186"></a>00186 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00187"></a>00187 <span class="comment">     */</span>
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191     <span class="comment">/*</span>
-<a name="l00192"></a>00192 <span class="comment">     * Dispersion</span>
-<a name="l00193"></a>00193 <span class="comment">     */</span>
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract_slits.dispersion"</span>,
-<a name="l00196"></a>00196                                 CPL_TYPE_DOUBLE,
-<a name="l00197"></a>00197                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00198"></a>00198                                 <span class="stringliteral">"fors.fors_extract_slits"</span>,
-<a name="l00199"></a>00199                                 0.0);
-<a name="l00200"></a>00200     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00201"></a>00201     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00202"></a>00202     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204     <span class="comment">/*</span>
-<a name="l00205"></a>00205 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00206"></a>00206 <span class="comment">     */</span>
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract_slits.startwavelength"</span>,
-<a name="l00209"></a>00209                                 CPL_TYPE_DOUBLE,
-<a name="l00210"></a>00210                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00211"></a>00211                                 <span class="stringliteral">"fors.fors_extract_slits"</span>,
-<a name="l00212"></a>00212                                 0.0);
-<a name="l00213"></a>00213     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00214"></a>00214     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00215"></a>00215     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217     <span class="comment">/*</span>
-<a name="l00218"></a>00218 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00219"></a>00219 <span class="comment">     */</span>
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract_slits.endwavelength"</span>,
-<a name="l00222"></a>00222                                 CPL_TYPE_DOUBLE,
-<a name="l00223"></a>00223                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00224"></a>00224                                 <span class="stringliteral">"fors.fors_extract_slits"</span>,
-<a name="l00225"></a>00225                                 0.0);
-<a name="l00226"></a>00226     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00227"></a>00227     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00228"></a>00228     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230     <span class="comment">/*</span>
-<a name="l00231"></a>00231 <span class="comment">     * Flux conservation</span>
-<a name="l00232"></a>00232 <span class="comment">     */</span>
-<a name="l00233"></a>00233  
-<a name="l00234"></a>00234     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract_slits.flux"</span>,
-<a name="l00235"></a>00235                                 CPL_TYPE_BOOL,
-<a name="l00236"></a>00236                                 <span class="stringliteral">"Apply flux conservation"</span>,
-<a name="l00237"></a>00237                                 <span class="stringliteral">"fors.fors_extract_slits"</span>,
-<a name="l00238"></a>00238                                 TRUE);
-<a name="l00239"></a>00239     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);
-<a name="l00240"></a>00240     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00241"></a>00241     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243     <span class="keywordflow">return</span> 0;
-<a name="l00244"></a>00244 }
-<a name="l00245"></a>00245 
-<a name="l00246"></a>00246 
-<a name="l00255"></a>00255 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_exec(cpl_plugin *plugin)
-<a name="l00256"></a>00256 {
-<a name="l00257"></a>00257     cpl_recipe *recipe;
-<a name="l00258"></a>00258     
-<a name="l00259"></a>00259     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00260"></a>00260         recipe = (cpl_recipe *)plugin;
-<a name="l00261"></a>00261     <span class="keywordflow">else</span> 
-<a name="l00262"></a>00262         <span class="keywordflow">return</span> -1;
-<a name="l00263"></a>00263 
-<a name="l00264"></a>00264     <span class="keywordflow">return</span> fors_extract_slits(recipe->parameters, recipe->frames);
-<a name="l00265"></a>00265 }
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267 
-<a name="l00276"></a>00276 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_destroy(cpl_plugin *plugin)
-<a name="l00277"></a>00277 {
-<a name="l00278"></a>00278     cpl_recipe *recipe;
-<a name="l00279"></a>00279     
-<a name="l00280"></a>00280     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00281"></a>00281         recipe = (cpl_recipe *)plugin;
-<a name="l00282"></a>00282     <span class="keywordflow">else</span> 
-<a name="l00283"></a>00283         <span class="keywordflow">return</span> -1;
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287     <span class="keywordflow">return</span> 0;
-<a name="l00288"></a>00288 }
-<a name="l00289"></a>00289 
-<a name="l00290"></a>00290 
-<a name="l00300"></a>00300 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits(cpl_parameterlist *parlist, 
-<a name="l00301"></a>00301                                cpl_frameset *frameset)
-<a name="l00302"></a>00302 {
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_extract_slits"</span>;
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306 
-<a name="l00307"></a>00307     <span class="comment">/*</span>
-<a name="l00308"></a>00308 <span class="comment">     * Input parameters</span>
-<a name="l00309"></a>00309 <span class="comment">     */</span>
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311     <span class="keywordtype">double</span>      dispersion;
-<a name="l00312"></a>00312     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00313"></a>00313     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00314"></a>00314     <span class="keywordtype">int</span>         flux;
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     <span class="comment">/*</span>
-<a name="l00317"></a>00317 <span class="comment">     * CPL objects</span>
-<a name="l00318"></a>00318 <span class="comment">     */</span>
-<a name="l00319"></a>00319 
-<a name="l00320"></a>00320     cpl_image        *spectra     = NULL;
-<a name="l00321"></a>00321     cpl_image        *spatial     = NULL;
-<a name="l00322"></a>00322     cpl_table        *grism_table = NULL;
-<a name="l00323"></a>00323     cpl_table        *slits       = NULL;
-<a name="l00324"></a>00324     cpl_table        *polytraces  = NULL;
-<a name="l00325"></a>00325     cpl_table        *maskslits   = NULL;
-<a name="l00326"></a>00326     cpl_propertylist *header      = NULL;
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328     <span class="comment">/*</span>
-<a name="l00329"></a>00329 <span class="comment">     * Auxiliary variables</span>
-<a name="l00330"></a>00330 <span class="comment">     */</span>
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     <span class="keywordtype">char</span>        version[80];
-<a name="l00333"></a>00333     <span class="keyword">const</span> <span class="keywordtype">char</span> *input_tag;
-<a name="l00334"></a>00334     <span class="keyword">const</span> <span class="keywordtype">char</span> *output_tag;
-<a name="l00335"></a>00335     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00336"></a>00336     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;
-<a name="l00337"></a>00337     <span class="keywordtype">int</span>         nframes;
-<a name="l00338"></a>00338     <span class="keywordtype">int</span>         rebin;
-<a name="l00339"></a>00339     <span class="keywordtype">int</span>         nslits;
-<a name="l00340"></a>00340     <span class="keywordtype">int</span>         treat_as_lss;
-<a name="l00341"></a>00341     <span class="keywordtype">int</span>         i;
-<a name="l00342"></a>00342     <span class="keywordtype">double</span>      reference;
-<a name="l00343"></a>00343     <span class="keywordtype">double</span>     *xpos;
-<a name="l00344"></a>00344     <span class="keywordtype">double</span>      mxpos;
-<a name="l00345"></a>00345     <span class="keywordtype">int</span>         mxu, mos, lss;
-<a name="l00346"></a>00346     <span class="keywordtype">int</span>         slit_l, slit_d;
-<a name="l00347"></a>00347     <span class="keywordtype">int</span>         lamp_mxu;
-<a name="l00348"></a>00348     <span class="keywordtype">int</span>         lamp_mos;
-<a name="l00349"></a>00349     <span class="keywordtype">int</span>         lamp_lss;
-<a name="l00350"></a>00350     <span class="keywordtype">int</span>         scib_mxu;
-<a name="l00351"></a>00351     <span class="keywordtype">int</span>         scib_mos;
-<a name="l00352"></a>00352     <span class="keywordtype">int</span>         scib_lss;
-<a name="l00353"></a>00353     <span class="keywordtype">int</span>         scif_mxu;
-<a name="l00354"></a>00354     <span class="keywordtype">int</span>         scif_mos;
-<a name="l00355"></a>00355     <span class="keywordtype">int</span>         scif_lss;
-<a name="l00356"></a>00356     <span class="keywordtype">int</span>         stab_mxu;
-<a name="l00357"></a>00357     <span class="keywordtype">int</span>         stab_mos;
-<a name="l00358"></a>00358     <span class="keywordtype">int</span>         stab_lss;
-<a name="l00359"></a>00359     <span class="keywordtype">int</span>         staf_mxu;
-<a name="l00360"></a>00360     <span class="keywordtype">int</span>         staf_mos;
-<a name="l00361"></a>00361     <span class="keywordtype">int</span>         staf_lss;
-<a name="l00362"></a>00362     <span class="keywordtype">int</span>         sciu_mxu;
-<a name="l00363"></a>00363     <span class="keywordtype">int</span>         sciu_mos;
-<a name="l00364"></a>00364     <span class="keywordtype">int</span>         sciu_lss;
-<a name="l00365"></a>00365     <span class="keywordtype">int</span>         stau_mxu;
-<a name="l00366"></a>00366     <span class="keywordtype">int</span>         stau_mos;
-<a name="l00367"></a>00367     <span class="keywordtype">int</span>         stau_lss;
-<a name="l00368"></a>00368     <span class="keywordtype">int</span>         scis_mxu;
-<a name="l00369"></a>00369     <span class="keywordtype">int</span>         scis_mos;
-<a name="l00370"></a>00370     <span class="keywordtype">int</span>         scis_lss;
-<a name="l00371"></a>00371     <span class="keywordtype">int</span>         stas_mxu;
-<a name="l00372"></a>00372     <span class="keywordtype">int</span>         stas_mos;
-<a name="l00373"></a>00373     <span class="keywordtype">int</span>         stas_lss;
-<a name="l00374"></a>00374     <span class="keywordtype">int</span>         nslits_out_det = 0;
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00377"></a>00377 
-<a name="l00378"></a>00378 
-<a name="l00379"></a>00379     cpl_msg_set_indentation(2);
-<a name="l00380"></a>00380 
-<a name="l00381"></a>00381 
-<a name="l00382"></a>00382     <span class="comment">/*</span>
-<a name="l00383"></a>00383 <span class="comment">     * Get configuration parameters</span>
-<a name="l00384"></a>00384 <span class="comment">     */</span>
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00387"></a>00387     cpl_msg_indent_more();
-<a name="l00388"></a>00388     
-<a name="l00389"></a>00389     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00390"></a>00390         fors_extract_slits_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); 
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00395"></a>00395                     <span class="stringliteral">"fors.fors_extract_slits.dispersion"</span>, grism_table);
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00398"></a>00398         fors_extract_slits_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00399"></a>00399 
-<a name="l00400"></a>00400     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00401"></a>00401                     <span class="stringliteral">"fors.fors_extract_slits.startwavelength"</span>, grism_table);
-<a name="l00402"></a>00402     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00403"></a>00403         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00404"></a>00404             fors_extract_slits_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00405"></a>00405 
-<a name="l00406"></a>00406     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00407"></a>00407                     <span class="stringliteral">"fors.fors_extract_slits.endwavelength"</span>, grism_table);
-<a name="l00408"></a>00408     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00409"></a>00409         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00410"></a>00410             fors_extract_slits_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00411"></a>00411         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00412"></a>00412             fors_extract_slits_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00413"></a>00413     }
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00416"></a>00416         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00417"></a>00417             fors_extract_slits_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00418"></a>00418 
-<a name="l00419"></a>00419     flux = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00420"></a>00420                                   <span class="stringliteral">"fors.fors_extract_slits.flux"</span>, NULL);
-<a name="l00421"></a>00421 
-<a name="l00422"></a>00422     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00423"></a>00423 
-<a name="l00424"></a>00424     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00425"></a>00425         fors_extract_slits_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);
-<a name="l00426"></a>00426 
-<a name="l00427"></a>00427 
-<a name="l00428"></a>00428     cpl_msg_indent_less();
-<a name="l00429"></a>00429     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00430"></a>00430     cpl_msg_indent_more();
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432     mxu  = lamp_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>);
-<a name="l00433"></a>00433     mos  = lamp_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>);
-<a name="l00434"></a>00434     lss  = lamp_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>);
-<a name="l00435"></a>00435     mxu += scib_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>);
-<a name="l00436"></a>00436     mos += scib_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>);
-<a name="l00437"></a>00437     lss += scib_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>);
-<a name="l00438"></a>00438     mxu += scif_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>);
-<a name="l00439"></a>00439     mos += scif_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>);
-<a name="l00440"></a>00440     lss += scif_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>);
-<a name="l00441"></a>00441     mxu += stab_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>);
-<a name="l00442"></a>00442     mos += stab_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>);
-<a name="l00443"></a>00443     lss += stab_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>);
-<a name="l00444"></a>00444     mxu += staf_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>);
-<a name="l00445"></a>00445     mos += staf_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>);
-<a name="l00446"></a>00446     lss += staf_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>);
-<a name="l00447"></a>00447     mxu += sciu_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>);
-<a name="l00448"></a>00448     mos += sciu_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>);
-<a name="l00449"></a>00449     lss += sciu_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SCI_LSS"</span>);
-<a name="l00450"></a>00450     mxu += stau_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_STD_MXU"</span>);
-<a name="l00451"></a>00451     mos += stau_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_STD_MOS"</span>);
-<a name="l00452"></a>00452     lss += stau_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_STD_LSS"</span>);
-<a name="l00453"></a>00453     mxu += scis_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>);
-<a name="l00454"></a>00454     mos += scis_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>);
-<a name="l00455"></a>00455     lss += scis_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_SCI_LSS"</span>);
-<a name="l00456"></a>00456     mxu += stas_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>);
-<a name="l00457"></a>00457     mos += stas_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>);
-<a name="l00458"></a>00458     lss += stas_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_STD_LSS"</span>);
-<a name="l00459"></a>00459 
-<a name="l00460"></a>00460     nframes = mos + mxu + lss;
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00463"></a>00463         fors_extract_slits_exit(<span class="stringliteral">"Missing input spectral frame"</span>);
-<a name="l00464"></a>00464     }
-<a name="l00465"></a>00465     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00466"></a>00466         cpl_msg_error(recipe, 
-<a name="l00467"></a>00467                       <span class="stringliteral">"Too many input spectral frames (%d > 1)"</span>, nframes);
-<a name="l00468"></a>00468         fors_extract_slits_exit(NULL);
-<a name="l00469"></a>00469     }
-<a name="l00470"></a>00470 
-<a name="l00471"></a>00471     <span class="keywordflow">if</span> (lss)
-<a name="l00472"></a>00472         fors_extract_slits_exit(<span class="stringliteral">"Use this recipe just with MOS/MXU data."</span>);
-<a name="l00473"></a>00473 
-<a name="l00474"></a>00474     <span class="keywordflow">if</span> (mxu) {
-<a name="l00475"></a>00475         slit_l = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MXU"</span>);
-<a name="l00476"></a>00476         slit_d = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_DETECT_MXU"</span>);
-<a name="l00477"></a>00477     }
-<a name="l00478"></a>00478     <span class="keywordflow">else</span> {
-<a name="l00479"></a>00479         slit_l = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MOS"</span>);
-<a name="l00480"></a>00480         slit_d = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_DETECT_MOS"</span>);
-<a name="l00481"></a>00481     }
-<a name="l00482"></a>00482 
-<a name="l00483"></a>00483     nframes = slit_l + slit_d;
-<a name="l00484"></a>00484 
-<a name="l00485"></a>00485     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00486"></a>00486         fors_extract_slits_exit(<span class="stringliteral">"Missing input slit location table"</span>);
-<a name="l00487"></a>00487     }
-<a name="l00488"></a>00488     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00489"></a>00489         cpl_msg_error(recipe,
-<a name="l00490"></a>00490                       <span class="stringliteral">"Too many input slit location tables (%d > 1)"</span>, nframes);
-<a name="l00491"></a>00491         fors_extract_slits_exit(NULL);
-<a name="l00492"></a>00492     }
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494     <span class="keywordflow">if</span> (slit_l) {
-<a name="l00495"></a>00495         <span class="keywordflow">if</span> (mxu)
-<a name="l00496"></a>00496             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00497"></a>00497         <span class="keywordflow">else</span>
-<a name="l00498"></a>00498             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00499"></a>00499     }
-<a name="l00500"></a>00500     <span class="keywordflow">else</span> {
-<a name="l00501"></a>00501         <span class="keywordflow">if</span> (mxu)
-<a name="l00502"></a>00502             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_DETECT_MXU"</span>;
-<a name="l00503"></a>00503         <span class="keywordflow">else</span>
-<a name="l00504"></a>00504             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_DETECT_MOS"</span>;
-<a name="l00505"></a>00505     }
-<a name="l00506"></a>00506 
-<a name="l00507"></a>00507     <span class="keywordflow">if</span> (mxu)
-<a name="l00508"></a>00508         curv_coeff_tag = <span class="stringliteral">"CURV_COEFF_MXU"</span>;
-<a name="l00509"></a>00509     <span class="keywordflow">else</span>
-<a name="l00510"></a>00510         curv_coeff_tag = <span class="stringliteral">"CURV_COEFF_MOS"</span>;
-<a name="l00511"></a>00511 
-<a name="l00512"></a>00512     <span class="keywordflow">if</span> (lamp_mxu) {
-<a name="l00513"></a>00513         input_tag = <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>;
-<a name="l00514"></a>00514         output_tag = <span class="stringliteral">"RECTIFIED_LAMP_MXU"</span>;
-<a name="l00515"></a>00515     }
-<a name="l00516"></a>00516     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_mos) {
-<a name="l00517"></a>00517         input_tag = <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>;
-<a name="l00518"></a>00518         output_tag = <span class="stringliteral">"RECTIFIED_LAMP_MOS"</span>;
-<a name="l00519"></a>00519     }
-<a name="l00520"></a>00520     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scib_mxu) {
-<a name="l00521"></a>00521         input_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;
-<a name="l00522"></a>00522         output_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>;
-<a name="l00523"></a>00523     }
-<a name="l00524"></a>00524     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scib_mos) {
-<a name="l00525"></a>00525         input_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;
-<a name="l00526"></a>00526         output_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>;
-<a name="l00527"></a>00527     }
-<a name="l00528"></a>00528     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scif_mxu) {
-<a name="l00529"></a>00529         input_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>;
-<a name="l00530"></a>00530         output_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>;
-<a name="l00531"></a>00531     }
-<a name="l00532"></a>00532     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scif_mos) {
-<a name="l00533"></a>00533         input_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>;
-<a name="l00534"></a>00534         output_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>;
-<a name="l00535"></a>00535     }
-<a name="l00536"></a>00536     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stab_mxu) {
-<a name="l00537"></a>00537         input_tag = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;
-<a name="l00538"></a>00538         output_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>;
-<a name="l00539"></a>00539     }
-<a name="l00540"></a>00540     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stab_mos) {
-<a name="l00541"></a>00541         input_tag = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;
-<a name="l00542"></a>00542         output_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>;
-<a name="l00543"></a>00543     }
-<a name="l00544"></a>00544     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (staf_mxu) {
-<a name="l00545"></a>00545         input_tag = <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>;
-<a name="l00546"></a>00546         output_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>;
-<a name="l00547"></a>00547     }
-<a name="l00548"></a>00548     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (staf_mos) {
-<a name="l00549"></a>00549         input_tag = <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>;
-<a name="l00550"></a>00550         output_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>;
-<a name="l00551"></a>00551     }
-<a name="l00552"></a>00552     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sciu_mxu) {
-<a name="l00553"></a>00553         input_tag = <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>;
-<a name="l00554"></a>00554         output_tag = <span class="stringliteral">"RECTIFIED_SCI_MXU"</span>;
-<a name="l00555"></a>00555     }
-<a name="l00556"></a>00556     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sciu_mos) {
-<a name="l00557"></a>00557         input_tag = <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>;
-<a name="l00558"></a>00558         output_tag = <span class="stringliteral">"RECTIFIED_SCI_MOS"</span>;
-<a name="l00559"></a>00559     }
-<a name="l00560"></a>00560     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stau_mxu) {
-<a name="l00561"></a>00561         input_tag = <span class="stringliteral">"UNMAPPED_STD_MXU"</span>;
-<a name="l00562"></a>00562         output_tag = <span class="stringliteral">"RECTIFIED_STD_MXU"</span>;
-<a name="l00563"></a>00563     }
-<a name="l00564"></a>00564     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stau_mos) {
-<a name="l00565"></a>00565         input_tag = <span class="stringliteral">"UNMAPPED_STD_MOS"</span>;
-<a name="l00566"></a>00566         output_tag = <span class="stringliteral">"RECTIFIED_STD_MOS"</span>;
-<a name="l00567"></a>00567     }
-<a name="l00568"></a>00568     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scis_mxu) {
-<a name="l00569"></a>00569         input_tag = <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>;
-<a name="l00570"></a>00570         output_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MXU"</span>;
-<a name="l00571"></a>00571     }
-<a name="l00572"></a>00572     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scis_mos) {
-<a name="l00573"></a>00573         input_tag = <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>;
-<a name="l00574"></a>00574         output_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MOS"</span>;
-<a name="l00575"></a>00575     }
-<a name="l00576"></a>00576     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stas_mxu) {
-<a name="l00577"></a>00577         input_tag = <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>;
-<a name="l00578"></a>00578         output_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MXU"</span>;
-<a name="l00579"></a>00579     }
-<a name="l00580"></a>00580     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stas_mos) {
-<a name="l00581"></a>00581         input_tag = <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>;
-<a name="l00582"></a>00582         output_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MOS"</span>;
-<a name="l00583"></a>00583     }
-<a name="l00584"></a>00584 
-<a name="l00585"></a>00585     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, input_tag, 0);
-<a name="l00586"></a>00586 
-<a name="l00587"></a>00587     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00588"></a>00588         fors_extract_slits_exit(<span class="stringliteral">"Cannot load master flat frame header"</span>);
-<a name="l00589"></a>00589 
-<a name="l00590"></a>00590     <span class="keywordflow">if</span> (mos)
-<a name="l00591"></a>00591         maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00592"></a>00592     <span class="keywordflow">else</span>
-<a name="l00593"></a>00593         maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00594"></a>00594 
-<a name="l00595"></a>00595     <span class="comment">/*</span>
-<a name="l00596"></a>00596 <span class="comment">     * Check if all slits have the same X offset: in such case, abort!</span>
-<a name="l00597"></a>00597 <span class="comment">     */</span>
-<a name="l00598"></a>00598 
-<a name="l00599"></a>00599     treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l00600"></a>00600 
-<a name="l00601"></a>00601     cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00602"></a>00602 
-<a name="l00603"></a>00603     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00604"></a>00604         cpl_msg_error(recipe, <span class="stringliteral">"All slits have the same offset: %.2f mm\n"</span>
-<a name="l00605"></a>00605                       <span class="stringliteral">"The LSS data reduction strategy must be applied."</span>, 
-<a name="l00606"></a>00606                       mxpos);
-<a name="l00607"></a>00607         fors_extract_slits_exit(NULL);
-<a name="l00608"></a>00608     }
-<a name="l00609"></a>00609 
-<a name="l00610"></a>00610     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00611"></a>00611         fors_extract_slits_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00612"></a>00612 
-<a name="l00613"></a>00613     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00614"></a>00614         fors_extract_slits_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00617"></a>00617         fors_extract_slits_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00618"></a>00618 
-<a name="l00619"></a>00619 
-<a name="l00620"></a>00620     <span class="comment">/*</span>
-<a name="l00621"></a>00621 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00622"></a>00622 <span class="comment">     * dispersion direction from the master flat frame</span>
-<a name="l00623"></a>00623 <span class="comment">     */</span>
-<a name="l00624"></a>00624 
-<a name="l00625"></a>00625     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00626"></a>00626     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00627"></a>00627         fors_extract_slits_exit(<span class="stringliteral">"Missing keyword INSTRUME in master "</span>
-<a name="l00628"></a>00628                                  <span class="stringliteral">"flat header"</span>);
-<a name="l00629"></a>00629 
-<a name="l00630"></a>00630     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00631"></a>00631         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00632"></a>00632     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00633"></a>00633         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00634"></a>00634 
-<a name="l00635"></a>00635     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00636"></a>00636 
-<a name="l00637"></a>00637     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00638"></a>00638         fors_extract_slits_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span>
-<a name="l00639"></a>00639                                  <span class="stringliteral">"in master flat frame header"</span>);
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l00642"></a>00642         reference *= 10;
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l00645"></a>00645         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l00646"></a>00646                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in master flat header"</span>,
-<a name="l00647"></a>00647                       reference);
-<a name="l00648"></a>00648         fors_extract_slits_exit(NULL);
-<a name="l00649"></a>00649     }
-<a name="l00650"></a>00650 
-<a name="l00651"></a>00651     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00654"></a>00654 
-<a name="l00655"></a>00655     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00656"></a>00656         fors_extract_slits_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00657"></a>00657                                  <span class="stringliteral">"in master flat header"</span>);
-<a name="l00658"></a>00658 
-<a name="l00659"></a>00659     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l00660"></a>00660         dispersion *= rebin;
-<a name="l00661"></a>00661         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l00662"></a>00662                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,
-<a name="l00663"></a>00663                         dispersion);
-<a name="l00664"></a>00664     }
-<a name="l00665"></a>00665 
-<a name="l00666"></a>00666     cpl_msg_indent_less();
-<a name="l00667"></a>00667     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);
-<a name="l00668"></a>00668     cpl_msg_indent_more();
-<a name="l00669"></a>00669 
-<a name="l00670"></a>00670     spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, input_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00671"></a>00671     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00672"></a>00672         fors_extract_slits_exit(<span class="stringliteral">"Cannot load input spectral frame"</span>);
-<a name="l00673"></a>00673 
-<a name="l00674"></a>00674     slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l00675"></a>00675     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00676"></a>00676         fors_extract_slits_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l00677"></a>00677 
-<a name="l00678"></a>00678     polytraces = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, curv_coeff_tag, 1);
-<a name="l00679"></a>00679     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00680"></a>00680         fors_extract_slits_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);
-<a name="l00681"></a>00681 
-<a name="l00682"></a>00682     spatial = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, reference,
-<a name="l00683"></a>00683                                       startwavelength, endwavelength,
-<a name="l00684"></a>00684                                       dispersion, flux, NULL);
-<a name="l00685"></a>00685 
-<a name="l00686"></a>00686     cpl_image_delete(spectra); spectra = NULL;
-<a name="l00687"></a>00687     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l00688"></a>00688     cpl_table_delete(slits); slits = NULL;
-<a name="l00689"></a>00689 
-<a name="l00690"></a>00690     cpl_propertylist_delete(header); header = NULL;
-<a name="l00691"></a>00691     header = cpl_propertylist_new();
-<a name="l00692"></a>00692 
-<a name="l00693"></a>00693     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l00694"></a>00694     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l00695"></a>00695     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l00696"></a>00696     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, 1.0);
-<a name="l00697"></a>00697     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l00698"></a>00698     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l00699"></a>00699     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l00700"></a>00700     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l00701"></a>00701     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l00702"></a>00702 
-<a name="l00703"></a>00703     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, spatial, output_tag,
-<a name="l00704"></a>00704                        header, parlist, recipe, version))
-<a name="l00705"></a>00705         fors_extract_slits_exit(NULL);
-<a name="l00706"></a>00706 
-<a name="l00707"></a>00707     cpl_image_delete(spatial); spatial = NULL;
-<a name="l00708"></a>00708     cpl_propertylist_delete(header); header = NULL;
-<a name="l00709"></a>00709 
-<a name="l00710"></a>00710     <span class="keywordflow">return</span> 0;
-<a name="l00711"></a>00711 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__extract__slits_8c_source.html b/html/fors__extract__slits_8c_source.html
new file mode 100644
index 0000000..63b4334
--- /dev/null
+++ b/html/fors__extract__slits_8c_source.html
@@ -0,0 +1,723 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_extract_slits.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_extract_slits.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_extract_slits.c,v 1.8 2013-08-20 17:02:58 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-20 17:02:58 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_extract_slits_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to extract MOS/MXU slit spectra, following their\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"curvature, and to remap them into a spatially rectified image.\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"Please refer to the FORS Pipeline User's Manual for details about\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"the spectra remapping technique. Note however that the interpolation\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"is done exclusively along the spatial direction, and therefore the\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"output rectified image will have the same x size of the input spectral\n"</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"image.\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS.\n\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"  LAMP_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"  or SCIENCE_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"  or SCIENCE_UNFLAT_MXU\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  or STANDARD_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  or STANDARD_UNFLAT_MXU\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  or UNMAPPED_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"  or UNMAPPED_STD_MXU\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"  or UNMAPPED_SKY_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"  or UNMAPPED_SKY_STD_MXU    Calib       Spectral frame          Y\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  SLIT_LOCATION_DETECT_MXU\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  or SLIT_LOCATION_MXU       Calib       Master flat frame       Y\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      Y\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  RECTIFIED_LAMP_MXU\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"  or RECTIFIED_ALL_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"  or RECTIFIED_ALL_STD_MXU\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"  or RECTIFIED_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"  or RECTIFIED_STD_MXU\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"  or RECTIFIED_SKY_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"  or RECTIFIED_SKY_STD_MXU   FITS image  Rectified slit spectra\n\n"</span>;</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> </div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">#define fors_extract_slits_exit(message)      \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">cpl_image_delete(spatial);                    \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">#define fors_extract_slits_exit_memcheck(message)  \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">cpl_image_delete(spectra);                      \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">printf("free spatial (%p)\n", spatial);         \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">cpl_image_delete(spatial);                      \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">cpl_table_delete(grism_table);                  \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">cpl_table_delete(maskslits);                    \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">cpl_table_delete(slits);                        \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">cpl_table_delete(polytraces);                   \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> {</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                     <span class="stringliteral">"fors_extract_slits"</span>,</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>                     <span class="stringliteral">"Spatial rectification of spectral image"</span>,</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                     fors_extract_slits_description,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>                     fors_extract_slits_create,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                     fors_extract_slits_exec,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                     fors_extract_slits_destroy);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> }</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> {</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> </div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract_slits.dispersion"</span>,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                                 <span class="stringliteral">"fors.fors_extract_slits"</span>,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                                 0.0);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract_slits.startwavelength"</span>,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                                 <span class="stringliteral">"fors.fors_extract_slits"</span>,</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>                                 0.0);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract_slits.endwavelength"</span>,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                                 <span class="stringliteral">"fors.fors_extract_slits"</span>,</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                                 0.0);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="comment">     * Flux conservation</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>  </div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract_slits.flux"</span>,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                                 <span class="stringliteral">"Apply flux conservation"</span>,</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>                                 <span class="stringliteral">"fors.fors_extract_slits"</span>,</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>                                 TRUE);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> }</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> {</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     </div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     <span class="keywordflow">return</span> fors_extract_slits(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> }</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> {</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> }</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> </div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_slits(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> {</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_extract_slits"</span>;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     <span class="keywordtype">int</span>         flux;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     cpl_image        *spectra     = NULL;</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     cpl_image        *spatial     = NULL;</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     cpl_table        *polytraces  = NULL;</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     cpl_table        *maskslits   = NULL;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *input_tag;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *output_tag;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordtype">int</span>         nframes;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordtype">int</span>         treat_as_lss;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     <span class="keywordtype">int</span>         mxu, mos, lss;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordtype">int</span>         slit_l, slit_d;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="keywordtype">int</span>         lamp_mxu;</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     <span class="keywordtype">int</span>         lamp_mos;</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordtype">int</span>         lamp_lss;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     <span class="keywordtype">int</span>         scib_mxu;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     <span class="keywordtype">int</span>         scib_mos;</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <span class="keywordtype">int</span>         scib_lss;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     <span class="keywordtype">int</span>         scif_mxu;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     <span class="keywordtype">int</span>         scif_mos;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     <span class="keywordtype">int</span>         scif_lss;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     <span class="keywordtype">int</span>         stab_mxu;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     <span class="keywordtype">int</span>         stab_mos;</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     <span class="keywordtype">int</span>         stab_lss;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <span class="keywordtype">int</span>         staf_mxu;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <span class="keywordtype">int</span>         staf_mos;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="keywordtype">int</span>         staf_lss;</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     <span class="keywordtype">int</span>         sciu_mxu;</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     <span class="keywordtype">int</span>         sciu_mos;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keywordtype">int</span>         sciu_lss;</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     <span class="keywordtype">int</span>         stau_mxu;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keywordtype">int</span>         stau_mos;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="keywordtype">int</span>         stau_lss;</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     <span class="keywordtype">int</span>         scis_mxu;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keywordtype">int</span>         scis_mos;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keywordtype">int</span>         scis_lss;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     <span class="keywordtype">int</span>         stas_mxu;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <span class="keywordtype">int</span>         stas_mos;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="keywordtype">int</span>         stas_lss;</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keywordtype">int</span>         nslits_out_det = 0;</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> </div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> </div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>         fors_extract_slits_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> </div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>                     <span class="stringliteral">"fors.fors_extract_slits.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>         fors_extract_slits_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>                     <span class="stringliteral">"fors.fors_extract_slits.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>             fors_extract_slits_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> </div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>                     <span class="stringliteral">"fors.fors_extract_slits.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>             fors_extract_slits_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>             fors_extract_slits_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     }</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>             fors_extract_slits_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> </div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     flux = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>                                   <span class="stringliteral">"fors.fors_extract_slits.flux"</span>, NULL);</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> </div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> </div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>         fors_extract_slits_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span> </div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> </div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     mxu  = lamp_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     mos  = lamp_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     lss  = lamp_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     mxu += scib_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     mos += scib_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     lss += scib_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     mxu += scif_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>);</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     mos += scif_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>);</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     lss += scif_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     mxu += stab_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     mos += stab_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     lss += stab_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     mxu += staf_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     mos += staf_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>);</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     lss += staf_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>);</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     mxu += sciu_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     mos += sciu_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     lss += sciu_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SCI_LSS"</span>);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     mxu += stau_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_STD_MXU"</span>);</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     mos += stau_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_STD_MOS"</span>);</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     lss += stau_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_STD_LSS"</span>);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     mxu += scis_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     mos += scis_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     lss += scis_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_SCI_LSS"</span>);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     mxu += stas_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     mos += stas_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     lss += stas_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"UNMAPPED_SKY_STD_LSS"</span>);</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     nframes = mos + mxu + lss;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> </div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>         fors_extract_slits_exit(<span class="stringliteral">"Missing input spectral frame"</span>);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     }</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         cpl_msg_error(recipe, </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>                       <span class="stringliteral">"Too many input spectral frames (%d > 1)"</span>, nframes);</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         fors_extract_slits_exit(NULL);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     }</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> </div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     <span class="keywordflow">if</span> (lss)</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         fors_extract_slits_exit(<span class="stringliteral">"Use this recipe just with MOS/MXU data."</span>);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         slit_l = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MXU"</span>);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         slit_d = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_DETECT_MXU"</span>);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     }</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         slit_l = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MOS"</span>);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         slit_d = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_DETECT_MOS"</span>);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     }</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     nframes = slit_l + slit_d;</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         fors_extract_slits_exit(<span class="stringliteral">"Missing input slit location table"</span>);</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     }</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         cpl_msg_error(recipe,</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                       <span class="stringliteral">"Too many input slit location tables (%d > 1)"</span>, nframes);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>         fors_extract_slits_exit(NULL);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     }</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span> </div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     <span class="keywordflow">if</span> (slit_l) {</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>         <span class="keywordflow">if</span> (mxu)</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     }</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         <span class="keywordflow">if</span> (mxu)</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_DETECT_MXU"</span>;</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_DETECT_MOS"</span>;</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     }</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span> </div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     <span class="keywordflow">if</span> (mxu)</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         curv_coeff_tag = <span class="stringliteral">"CURV_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>         curv_coeff_tag = <span class="stringliteral">"CURV_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> </div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     <span class="keywordflow">if</span> (lamp_mxu) {</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         input_tag = <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>         output_tag = <span class="stringliteral">"RECTIFIED_LAMP_MXU"</span>;</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     }</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_mos) {</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         input_tag = <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>         output_tag = <span class="stringliteral">"RECTIFIED_LAMP_MOS"</span>;</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     }</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scib_mxu) {</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         input_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>         output_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     }</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scib_mos) {</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>         input_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>         output_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     }</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scif_mxu) {</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>         input_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>         output_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     }</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scif_mos) {</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>         input_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>;</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>         output_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     }</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stab_mxu) {</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>         input_tag = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>         output_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     }</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stab_mos) {</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>         input_tag = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>         output_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     }</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (staf_mxu) {</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         input_tag = <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>;</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>         output_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>     }</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (staf_mos) {</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>         input_tag = <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>;</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         output_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>;</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     }</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sciu_mxu) {</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         input_tag = <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         output_tag = <span class="stringliteral">"RECTIFIED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     }</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sciu_mos) {</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>         input_tag = <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>         output_tag = <span class="stringliteral">"RECTIFIED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     }</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stau_mxu) {</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>         input_tag = <span class="stringliteral">"UNMAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         output_tag = <span class="stringliteral">"RECTIFIED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     }</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stau_mos) {</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>         input_tag = <span class="stringliteral">"UNMAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>         output_tag = <span class="stringliteral">"RECTIFIED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     }</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scis_mxu) {</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         input_tag = <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>         output_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     }</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scis_mos) {</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         input_tag = <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>         output_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     }</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stas_mxu) {</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         input_tag = <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         output_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     }</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stas_mos) {</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>         input_tag = <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         output_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     }</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span> </div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, input_tag, 0);</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>         fors_extract_slits_exit(<span class="stringliteral">"Cannot load master flat frame header"</span>);</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span> </div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>         maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>         maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> </div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span> <span class="comment">     * Check if all slits have the same X offset: in such case, abort!</span></div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> </div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span> </div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>         cpl_msg_error(recipe, <span class="stringliteral">"All slits have the same offset: %.2f mm\n"</span></div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>                       <span class="stringliteral">"The LSS data reduction strategy must be applied."</span>, </div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>                       mxpos);</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>         fors_extract_slits_exit(NULL);</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     }</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>         fors_extract_slits_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>         fors_extract_slits_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span> </div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>         fors_extract_slits_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> </div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span> </div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span> <span class="comment">     * dispersion direction from the master flat frame</span></div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span> </div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>         fors_extract_slits_exit(<span class="stringliteral">"Missing keyword INSTRUME in master "</span></div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>                                  <span class="stringliteral">"flat header"</span>);</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> </div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span> </div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span> </div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>         fors_extract_slits_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span></div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>                                  <span class="stringliteral">"in master flat frame header"</span>);</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> </div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>         reference *= 10;</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in master flat header"</span>,</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>                       reference);</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>         fors_extract_slits_exit(NULL);</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     }</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> </div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span> </div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>         fors_extract_slits_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>                                  <span class="stringliteral">"in master flat header"</span>);</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span> </div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>                         dispersion);</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     }</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span> </div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span> </div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>     spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, input_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>         fors_extract_slits_exit(<span class="stringliteral">"Cannot load input spectral frame"</span>);</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> </div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>         fors_extract_slits_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     polytraces = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, curv_coeff_tag, 1);</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>         fors_extract_slits_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span> </div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     spatial = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>                                       startwavelength, endwavelength,</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>                                       dispersion, flux, NULL);</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> </div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span> </div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> </div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, 1.0);</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, spatial, output_tag,</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>                        header, parlist, recipe, version))</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>         fors_extract_slits_exit(NULL);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> </div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     cpl_image_delete(spatial); spatial = NULL;</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__flat_8c-source.html b/html/fors__flat_8c-source.html
deleted file mode 100644
index 31297f9..0000000
--- a/html/fors__flat_8c-source.html
+++ /dev/null
@@ -1,364 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_flat.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_flat.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_flat.c,v 1.8 2013/04/24 14:14:14 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:14 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 <span class="preprocessor">#include <math.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <moses.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flat_create(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flat_exec(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flat_destroy(cpl_plugin *);
-<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flat(cpl_parameterlist *, cpl_frameset *);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_flat_description[] =
-<a name="l00044"></a>00044 <span class="stringliteral">"This recipe is used to subtract the master bias, produced by the recipe\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"fors_bias, from a set of raw flat field frames. The input raw frames are\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"summed, the master bias frame is rescaled accordingly, and subtracted\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"from the result. The overscan regions, if present, are used to compensate\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"for variations of the bias level between master bias and input raw frames.\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"The overscan regions are then trimmed from the result.\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"LSS.\n\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"  SCREEN_FLAT_MXU            Raw         Raw data frame          Y\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"  MASTER_BIAS                Calib       Master bias frame       Y\n\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  MASTER_SCREEN_FLAT_MXU     FITS image  Bias subtracted sum frame\n\n"</span>;
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060 <span class="preprocessor">#define fors_flat_exit(message)               \</span>
-<a name="l00061"></a>00061 <span class="preprocessor">{                                             \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">cpl_image_delete(flat);                       \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">cpl_image_delete(master_flat);                \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">cpl_image_delete(master_bias);                \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00067"></a>00067 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">}</span>
-<a name="l00071"></a>00071 <span class="preprocessor"></span>
-<a name="l00072"></a>00072 <span class="preprocessor">#define fors_flat_exit_memcheck(message)        \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">{                                               \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">printf("free flat (%p)\n", flat);               \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_image_delete(flat);                         \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">printf("free master_flat (%p)\n", master_flat); \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_image_delete(master_flat);                  \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">printf("free master_bias (%p)\n", master_bias); \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_image_delete(master_bias);                  \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">printf("free overscans (%p)\n", overscans);     \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">cpl_table_delete(overscans);                    \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">}</span>
-<a name="l00088"></a>00088 <span class="preprocessor"></span>
-<a name="l00089"></a>00089 
-<a name="l00101"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00101</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00102"></a>00102 {
-<a name="l00103"></a>00103     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00104"></a>00104     cpl_plugin *plugin = &recipe->interface;
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106     cpl_plugin_init(plugin,
-<a name="l00107"></a>00107                     CPL_PLUGIN_API,
-<a name="l00108"></a>00108                     FORS_BINARY_VERSION,
-<a name="l00109"></a>00109                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00110"></a>00110                     <span class="stringliteral">"fors_flat"</span>,
-<a name="l00111"></a>00111                     <span class="stringliteral">"Sum input flat field frames and remove bias"</span>,
-<a name="l00112"></a>00112                     fors_flat_description,
-<a name="l00113"></a>00113                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00114"></a>00114                     PACKAGE_BUGREPORT,
-<a name="l00115"></a>00115     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00116"></a>00116     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00117"></a>00117     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00118"></a>00118     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00119"></a>00119     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00120"></a>00120     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00121"></a>00121     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00122"></a>00122     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00123"></a>00123     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00124"></a>00124     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00125"></a>00125     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00126"></a>00126     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00127"></a>00127     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00128"></a>00128                     fors_flat_create,
-<a name="l00129"></a>00129                     fors_flat_exec,
-<a name="l00130"></a>00130                     fors_flat_destroy);
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     cpl_pluginlist_append(list, plugin);
-<a name="l00133"></a>00133     
-<a name="l00134"></a>00134     <span class="keywordflow">return</span> 0;
-<a name="l00135"></a>00135 }
-<a name="l00136"></a>00136 
-<a name="l00137"></a>00137 
-<a name="l00148"></a>00148 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flat_create(cpl_plugin *plugin)
-<a name="l00149"></a>00149 {
-<a name="l00150"></a>00150     cpl_recipe    *recipe;
-<a name="l00151"></a>00151 <span class="comment">/* Uncomment in case parameters are defined</span>
-<a name="l00152"></a>00152 <span class="comment">    cpl_parameter *p;</span>
-<a name="l00153"></a>00153 <span class="comment">*/</span>
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     <span class="comment">/* </span>
-<a name="l00156"></a>00156 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00157"></a>00157 <span class="comment">     */</span>
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00160"></a>00160         recipe = (cpl_recipe *)plugin;
-<a name="l00161"></a>00161     <span class="keywordflow">else</span> 
-<a name="l00162"></a>00162         <span class="keywordflow">return</span> -1;
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164     <span class="comment">/* </span>
-<a name="l00165"></a>00165 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00166"></a>00166 <span class="comment">     */</span>
-<a name="l00167"></a>00167 
-<a name="l00168"></a>00168     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170     <span class="keywordflow">return</span> 0;
-<a name="l00171"></a>00171 }
-<a name="l00172"></a>00172 
-<a name="l00173"></a>00173 
-<a name="l00182"></a>00182 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flat_exec(cpl_plugin *plugin)
-<a name="l00183"></a>00183 {
-<a name="l00184"></a>00184     cpl_recipe *recipe;
-<a name="l00185"></a>00185     
-<a name="l00186"></a>00186     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00187"></a>00187         recipe = (cpl_recipe *)plugin;
-<a name="l00188"></a>00188     <span class="keywordflow">else</span> 
-<a name="l00189"></a>00189         <span class="keywordflow">return</span> -1;
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191     <span class="keywordflow">return</span> fors_flat(recipe->parameters, recipe->frames);
-<a name="l00192"></a>00192 }
-<a name="l00193"></a>00193 
-<a name="l00194"></a>00194 
-<a name="l00203"></a>00203 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flat_destroy(cpl_plugin *plugin)
-<a name="l00204"></a>00204 {
-<a name="l00205"></a>00205     cpl_recipe *recipe;
-<a name="l00206"></a>00206     
-<a name="l00207"></a>00207     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00208"></a>00208         recipe = (cpl_recipe *)plugin;
-<a name="l00209"></a>00209     <span class="keywordflow">else</span> 
-<a name="l00210"></a>00210         <span class="keywordflow">return</span> -1;
-<a name="l00211"></a>00211 
-<a name="l00212"></a>00212     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00213"></a>00213 
-<a name="l00214"></a>00214     <span class="keywordflow">return</span> 0;
-<a name="l00215"></a>00215 }
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217 
-<a name="l00227"></a>00227 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flat(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00228"></a>00228 {
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_flat"</span>;
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233     <span class="comment">/*</span>
-<a name="l00234"></a>00234 <span class="comment">     * CPL objects</span>
-<a name="l00235"></a>00235 <span class="comment">     */</span>
-<a name="l00236"></a>00236 
-<a name="l00237"></a>00237     cpl_image        *flat        = NULL;
-<a name="l00238"></a>00238     cpl_image        *master_flat = NULL;
-<a name="l00239"></a>00239     cpl_image        *master_bias = NULL;
-<a name="l00240"></a>00240     cpl_image        *multi_bias  = NULL;
-<a name="l00241"></a>00241     cpl_image        *dummy       = NULL;
-<a name="l00242"></a>00242     cpl_table        *overscans   = NULL;
-<a name="l00243"></a>00243     cpl_propertylist *header      = NULL;
-<a name="l00244"></a>00244 
-<a name="l00245"></a>00245     <span class="comment">/*</span>
-<a name="l00246"></a>00246 <span class="comment">     * Auxiliary variables</span>
-<a name="l00247"></a>00247 <span class="comment">     */</span>
-<a name="l00248"></a>00248 
-<a name="l00249"></a>00249     <span class="keywordtype">char</span>        version[80];
-<a name="l00250"></a>00250     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_bias_tag = <span class="stringliteral">"MASTER_BIAS"</span>;
-<a name="l00251"></a>00251     <span class="keyword">const</span> <span class="keywordtype">char</span> *flat_tag;
-<a name="l00252"></a>00252     <span class="keyword">const</span> <span class="keywordtype">char</span> *pro_tag;
-<a name="l00253"></a>00253     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00254"></a>00254     <span class="keywordtype">int</span>         flat_mxu;
-<a name="l00255"></a>00255     <span class="keywordtype">int</span>         flat_mos;
-<a name="l00256"></a>00256     <span class="keywordtype">int</span>         flat_lss;
-<a name="l00257"></a>00257     <span class="keywordtype">int</span>         nbias, nflat;
-<a name="l00258"></a>00258     <span class="keywordtype">int</span>         i;
-<a name="l00259"></a>00259 
-<a name="l00260"></a>00260 
-<a name="l00261"></a>00261     cpl_msg_set_indentation(2);
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263 
-<a name="l00264"></a>00264     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00265"></a>00265     cpl_msg_indent_more();
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267     nbias = cpl_frameset_count_tags(frameset, master_bias_tag);
-<a name="l00268"></a>00268     <span class="keywordflow">if</span> (nbias == 0) {
-<a name="l00269"></a>00269         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, master_bias_tag);
-<a name="l00270"></a>00270         fors_flat_exit(NULL);
-<a name="l00271"></a>00271     }
-<a name="l00272"></a>00272     <span class="keywordflow">if</span> (nbias > 1) {
-<a name="l00273"></a>00273         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input (%d > 1): %s"</span>, 
-<a name="l00274"></a>00274                       nbias, master_bias_tag);
-<a name="l00275"></a>00275         fors_flat_exit(NULL);
-<a name="l00276"></a>00276     }
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278     nflat  = flat_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCREEN_FLAT_MXU"</span>);
-<a name="l00279"></a>00279     nflat += flat_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCREEN_FLAT_MOS"</span>);
-<a name="l00280"></a>00280     nflat += flat_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCREEN_FLAT_LSS"</span>);
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282     <span class="keywordflow">if</span> (nflat == 0) {
-<a name="l00283"></a>00283         fors_flat_exit(<span class="stringliteral">"Missing required input raw frames"</span>);
-<a name="l00284"></a>00284     }
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286     <span class="keywordflow">if</span> (flat_mxu) {
-<a name="l00287"></a>00287         flat_tag = <span class="stringliteral">"SCREEN_FLAT_MXU"</span>;
-<a name="l00288"></a>00288         pro_tag = <span class="stringliteral">"MASTER_SCREEN_FLAT_MXU"</span>;
-<a name="l00289"></a>00289     }
-<a name="l00290"></a>00290     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (flat_mos) {
-<a name="l00291"></a>00291         flat_tag = <span class="stringliteral">"SCREEN_FLAT_MOS"</span>;
-<a name="l00292"></a>00292         pro_tag = <span class="stringliteral">"MASTER_SCREEN_FLAT_MOS"</span>;
-<a name="l00293"></a>00293     }
-<a name="l00294"></a>00294     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (flat_lss) {
-<a name="l00295"></a>00295         flat_tag = <span class="stringliteral">"SCREEN_FLAT_LSS"</span>;
-<a name="l00296"></a>00296         pro_tag = <span class="stringliteral">"MASTER_SCREEN_FLAT_LSS"</span>;
-<a name="l00297"></a>00297     }
-<a name="l00298"></a>00298 
-<a name="l00299"></a>00299     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00300"></a>00300         fors_flat_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00303"></a>00303         fors_flat_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>)) 
-<a name="l00306"></a>00306         fors_flat_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, flat_tag, 0);
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l00311"></a>00311         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load header of %s frame"</span>, flat_tag);
-<a name="l00312"></a>00312         fors_flat_exit(NULL);
-<a name="l00313"></a>00313     }
-<a name="l00314"></a>00314 
-<a name="l00315"></a>00315     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00316"></a>00316     <span class="keywordflow">if</span> (instrume == NULL) {
-<a name="l00317"></a>00317         cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword INSTRUME in %s header"</span>, 
-<a name="l00318"></a>00318                       flat_tag);
-<a name="l00319"></a>00319         fors_flat_exit(NULL);
-<a name="l00320"></a>00320     }
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00323"></a>00323         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00324"></a>00324     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00325"></a>00325         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00326"></a>00326 
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328     cpl_msg_indent_less();
-<a name="l00329"></a>00329     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames:"</span>);
-<a name="l00330"></a>00330     cpl_msg_indent_more();
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     master_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, flat_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="keywordflow">if</span> (master_flat == NULL)
-<a name="l00335"></a>00335         fors_flat_exit(<span class="stringliteral">"Cannot load flat field"</span>);
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     <span class="keywordflow">for</span> (i = 1; i < nflat; i++) {
-<a name="l00338"></a>00338         flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00339"></a>00339         <span class="keywordflow">if</span> (flat) {
-<a name="l00340"></a>00340             cpl_image_add(master_flat, flat);
-<a name="l00341"></a>00341             cpl_image_delete(flat); flat = NULL;
-<a name="l00342"></a>00342         }
-<a name="l00343"></a>00343         <span class="keywordflow">else</span>
-<a name="l00344"></a>00344             fors_flat_exit(<span class="stringliteral">"Cannot load flat field"</span>);
-<a name="l00345"></a>00345     }
-<a name="l00346"></a>00346 
-<a name="l00347"></a>00347     master_bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, 
-<a name="l00348"></a>00348                                  master_bias_tag, CPL_TYPE_FLOAT, 0, 1);
-<a name="l00349"></a>00349     <span class="keywordflow">if</span> (master_bias == NULL)
-<a name="l00350"></a>00350         fors_flat_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l00351"></a>00351 
-<a name="l00352"></a>00352     cpl_msg_indent_less();
-<a name="l00353"></a>00353     cpl_msg_info(recipe, <span class="stringliteral">"Subtract the master bias from sum flat frame..."</span>);
-<a name="l00354"></a>00354     cpl_msg_indent_more();
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356     overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 1);
-<a name="l00357"></a>00357 
-<a name="l00358"></a>00358     <span class="keywordflow">if</span> (nflat > 1) {
-<a name="l00359"></a>00359         multi_bias = cpl_image_multiply_scalar_create(master_bias, nflat);
-<a name="l00360"></a>00360         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(master_flat, multi_bias, overscans);
-<a name="l00361"></a>00361         cpl_image_delete(multi_bias);
-<a name="l00362"></a>00362     }
-<a name="l00363"></a>00363     <span class="keywordflow">else</span> {
-<a name="l00364"></a>00364         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(master_flat, master_bias, overscans);
-<a name="l00365"></a>00365     }
-<a name="l00366"></a>00366 
-<a name="l00367"></a>00367     cpl_table_delete(overscans); overscans = NULL;
-<a name="l00368"></a>00368     cpl_image_delete(master_bias); master_bias = NULL;
-<a name="l00369"></a>00369     cpl_image_delete(master_flat); master_flat = dummy;
-<a name="l00370"></a>00370 
-<a name="l00371"></a>00371     <span class="keywordflow">if</span> (master_flat == NULL) {
-<a name="l00372"></a>00372         cpl_msg_error(recipe, <span class="stringliteral">"Cannot remove bias from sum flat frame"</span>);
-<a name="l00373"></a>00373         fors_flat_exit(NULL);
-<a name="l00374"></a>00374     }
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     cpl_msg_indent_less();
-<a name="l00377"></a>00377 
-<a name="l00378"></a>00378     cpl_propertylist_update_int(header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, nflat);
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, master_flat, pro_tag,
-<a name="l00381"></a>00381                        header, parlist, recipe, version))
-<a name="l00382"></a>00382         fors_flat_exit(NULL);
-<a name="l00383"></a>00383 
-<a name="l00384"></a>00384     cpl_image_delete(master_flat); master_flat = NULL;
-<a name="l00385"></a>00385     cpl_propertylist_delete(header); header = NULL;
-<a name="l00386"></a>00386 
-<a name="l00387"></a>00387     <span class="keywordflow">return</span> 0;
-<a name="l00388"></a>00388 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__flat__normalise_8h_source.html b/html/fors__flat__normalise_8h_source.html
new file mode 100644
index 0000000..9da5baf
--- /dev/null
+++ b/html/fors__flat__normalise_8h_source.html
@@ -0,0 +1,113 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_flat_normalise.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_flat_normalise.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_flat_normalise.h,v 1.3 2013-09-09 12:14:12 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the VIMOS Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-09 12:14:12 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.3 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_FLAT_NORMALISE_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_FLAT_NORMALISE_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> cpl_image *mos_mosflat_normalise(cpl_image *flat, cpl_image *spatial, </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span>                                  cpl_table *slits, cpl_table *polytraces, </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span>                                  <span class="keywordtype">double</span> reference, <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span>                                  <span class="keywordtype">double</span> dispersion,</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>                                  <span class="keywordtype">int</span> spa_smooth_radius, <span class="keywordtype">int</span> disp_smooth_radius, </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>                                  <span class="keywordtype">int</span> spa_fit_nknots, <span class="keywordtype">int</span> disp_fit_nknots,</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>                                  <span class="keywordtype">double</span> fit_threshold);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> cpl_image *mos_lssflat_normalise(cpl_image *flat,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>                                  <span class="keywordtype">int</span> spa_smooth_radius, <span class="keywordtype">int</span> disp_smooth_radius, </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>                                  <span class="keywordtype">int</span> spa_fit_nknots, <span class="keywordtype">int</span> disp_fit_nknots,</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>                                  <span class="keywordtype">double</span> fit_threshold);</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keywordtype">void</span> image_smooth_fit_1d_pol_spa(cpl_image * image, cpl_size polyorder);</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keywordtype">void</span> image_smooth_fit_1d_pol_disp(cpl_image * image, cpl_size polyorder);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#endif   </span><span class="comment">/* FORS_FLAT_NORMALISE_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__flatfield_8c-source.html b/html/fors__flatfield_8c-source.html
deleted file mode 100644
index 15d8e29..0000000
--- a/html/fors__flatfield_8c-source.html
+++ /dev/null
@@ -1,360 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_flatfield.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_flatfield.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_flatfield.c,v 1.6 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.6 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_flatfield_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to divide the input frame by the normalised flat\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"field frame produced by recipe fors_normalise_flat. The input frame must\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"be already bias subtracted (e.g., by recipe fors_remove_bias).\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"LSS.\n\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"  SCIENCE_UNBIAS_MXU\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"  or STANDARD_UNBIAS_MXU     Raw         Bias subtracted frame   Y\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"  MASTER_NORM_FLAT_MXU       Calib       Normalised flat frame   Y\n\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"  SCIENCE_UNFLAT_MXU\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"  or STANDARD_UNFLAT_MXU     FITS image  Flat field corrected frame\n\n"</span>;
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058 <span class="preprocessor">#define fors_flatfield_exit(message)          \</span>
-<a name="l00059"></a>00059 <span class="preprocessor">{                                             \</span>
-<a name="l00060"></a>00060 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00061"></a>00061 <span class="preprocessor">cpl_image_delete(raw_image);                  \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">}</span>
-<a name="l00067"></a>00067 <span class="preprocessor"></span>
-<a name="l00068"></a>00068 <span class="preprocessor">#define fors_flatfield_exit_memcheck(message) \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">{                                               \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00071"></a>00071 <span class="preprocessor">printf("free raw_image (%p)\n", raw_image);     \</span>
-<a name="l00072"></a>00072 <span class="preprocessor">cpl_image_delete(raw_image);                    \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">printf("free norm_flat (%p)\n", norm_flat);     \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">cpl_image_delete(norm_flat);                    \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">}</span>
-<a name="l00080"></a>00080 <span class="preprocessor"></span>
-<a name="l00081"></a>00081 
-<a name="l00093"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00093</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00094"></a>00094 {
-<a name="l00095"></a>00095     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00096"></a>00096     cpl_plugin *plugin = &recipe->interface;
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098     cpl_plugin_init(plugin,
-<a name="l00099"></a>00099                     CPL_PLUGIN_API,
-<a name="l00100"></a>00100                     FORS_BINARY_VERSION,
-<a name="l00101"></a>00101                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00102"></a>00102                     <span class="stringliteral">"fors_flatfield"</span>,
-<a name="l00103"></a>00103                     <span class="stringliteral">"Flat field correction of input frame"</span>,
-<a name="l00104"></a>00104                     fors_flatfield_description,
-<a name="l00105"></a>00105                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00106"></a>00106                     PACKAGE_BUGREPORT,
-<a name="l00107"></a>00107     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00108"></a>00108     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00109"></a>00109     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00110"></a>00110     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00111"></a>00111     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00112"></a>00112     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00113"></a>00113     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00114"></a>00114     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00115"></a>00115     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00116"></a>00116     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00117"></a>00117     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00118"></a>00118     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00119"></a>00119     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00120"></a>00120                     fors_flatfield_create,
-<a name="l00121"></a>00121                     fors_flatfield_exec,
-<a name="l00122"></a>00122                     fors_flatfield_destroy);
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124     cpl_pluginlist_append(list, plugin);
-<a name="l00125"></a>00125     
-<a name="l00126"></a>00126     <span class="keywordflow">return</span> 0;
-<a name="l00127"></a>00127 }
-<a name="l00128"></a>00128 
-<a name="l00129"></a>00129 
-<a name="l00140"></a>00140 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_create(cpl_plugin *plugin)
-<a name="l00141"></a>00141 {
-<a name="l00142"></a>00142     cpl_recipe    *recipe;
-<a name="l00143"></a>00143 <span class="comment">/* Uncomment in case parameters are defined</span>
-<a name="l00144"></a>00144 <span class="comment">    cpl_parameter *p;</span>
-<a name="l00145"></a>00145 <span class="comment">*/</span>
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147     <span class="comment">/* </span>
-<a name="l00148"></a>00148 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00149"></a>00149 <span class="comment">     */</span>
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00152"></a>00152         recipe = (cpl_recipe *)plugin;
-<a name="l00153"></a>00153     <span class="keywordflow">else</span> 
-<a name="l00154"></a>00154         <span class="keywordflow">return</span> -1;
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156     <span class="comment">/* </span>
-<a name="l00157"></a>00157 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00158"></a>00158 <span class="comment">     */</span>
-<a name="l00159"></a>00159 
-<a name="l00160"></a>00160     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162     <span class="keywordflow">return</span> 0;
-<a name="l00163"></a>00163 }
-<a name="l00164"></a>00164 
-<a name="l00165"></a>00165 
-<a name="l00174"></a>00174 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_exec(cpl_plugin *plugin)
-<a name="l00175"></a>00175 {
-<a name="l00176"></a>00176     cpl_recipe *recipe;
-<a name="l00177"></a>00177     
-<a name="l00178"></a>00178     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00179"></a>00179         recipe = (cpl_recipe *)plugin;
-<a name="l00180"></a>00180     <span class="keywordflow">else</span> 
-<a name="l00181"></a>00181         <span class="keywordflow">return</span> -1;
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183     <span class="keywordflow">return</span> fors_flatfield(recipe->parameters, recipe->frames);
-<a name="l00184"></a>00184 }
-<a name="l00185"></a>00185 
-<a name="l00186"></a>00186 
-<a name="l00195"></a>00195 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_destroy(cpl_plugin *plugin)
-<a name="l00196"></a>00196 {
-<a name="l00197"></a>00197     cpl_recipe *recipe;
-<a name="l00198"></a>00198     
-<a name="l00199"></a>00199     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00200"></a>00200         recipe = (cpl_recipe *)plugin;
-<a name="l00201"></a>00201     <span class="keywordflow">else</span> 
-<a name="l00202"></a>00202         <span class="keywordflow">return</span> -1;
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206     <span class="keywordflow">return</span> 0;
-<a name="l00207"></a>00207 }
-<a name="l00208"></a>00208 
-<a name="l00209"></a>00209 
-<a name="l00219"></a>00219 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00220"></a>00220 {
-<a name="l00221"></a>00221 
-<a name="l00222"></a>00222     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_flatfield"</span>;
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224 
-<a name="l00225"></a>00225     <span class="comment">/*</span>
-<a name="l00226"></a>00226 <span class="comment">     * CPL objects</span>
-<a name="l00227"></a>00227 <span class="comment">     */</span>
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229     cpl_image        *raw_image   = NULL;
-<a name="l00230"></a>00230     cpl_image        *norm_flat   = NULL;
-<a name="l00231"></a>00231     cpl_propertylist *header      = NULL;
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233     <span class="comment">/*</span>
-<a name="l00234"></a>00234 <span class="comment">     * Auxiliary variables</span>
-<a name="l00235"></a>00235 <span class="comment">     */</span>
-<a name="l00236"></a>00236 
-<a name="l00237"></a>00237     <span class="keywordtype">char</span>        version[80];
-<a name="l00238"></a>00238     <span class="keyword">const</span> <span class="keywordtype">char</span> *norm_flat_tag;
-<a name="l00239"></a>00239     <span class="keyword">const</span> <span class="keywordtype">char</span> *raw_image_tag;
-<a name="l00240"></a>00240     <span class="keyword">const</span> <span class="keywordtype">char</span> *pro_image_tag;
-<a name="l00241"></a>00241     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00242"></a>00242     <span class="keywordtype">int</span>         science_mxu;
-<a name="l00243"></a>00243     <span class="keywordtype">int</span>         science_mos;
-<a name="l00244"></a>00244     <span class="keywordtype">int</span>         science_lss;
-<a name="l00245"></a>00245     <span class="keywordtype">int</span>         standard_mxu;
-<a name="l00246"></a>00246     <span class="keywordtype">int</span>         standard_mos;
-<a name="l00247"></a>00247     <span class="keywordtype">int</span>         standard_lss;
-<a name="l00248"></a>00248     <span class="keywordtype">int</span>         nflat, nframe;
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250 
-<a name="l00251"></a>00251     cpl_msg_set_indentation(2);
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253 
-<a name="l00254"></a>00254     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00255"></a>00255     cpl_msg_indent_more();
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257     nframe  = science_mxu  = cpl_frameset_count_tags(frameset, 
-<a name="l00258"></a>00258                                                      <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>);
-<a name="l00259"></a>00259     nframe += science_mos  = cpl_frameset_count_tags(frameset, 
-<a name="l00260"></a>00260                                                      <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>);
-<a name="l00261"></a>00261     nframe += science_lss  = cpl_frameset_count_tags(frameset, 
-<a name="l00262"></a>00262                                                      <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>);
-<a name="l00263"></a>00263     nframe += standard_mxu = cpl_frameset_count_tags(frameset, 
-<a name="l00264"></a>00264                                                      <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>);
-<a name="l00265"></a>00265     nframe += standard_mos = cpl_frameset_count_tags(frameset, 
-<a name="l00266"></a>00266                                                      <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>);
-<a name="l00267"></a>00267     nframe += standard_lss = cpl_frameset_count_tags(frameset, 
-<a name="l00268"></a>00268                                                      <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>);
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     <span class="keywordflow">if</span> (nframe == 0) {
-<a name="l00271"></a>00271         fors_flatfield_exit(<span class="stringliteral">"Missing required input scientific frame"</span>);
-<a name="l00272"></a>00272     }
-<a name="l00273"></a>00273     <span class="keywordflow">if</span> (nframe > 1) {
-<a name="l00274"></a>00274         cpl_msg_error(recipe, <span class="stringliteral">"Too many input scientific frames (%d > 1)"</span>, 
-<a name="l00275"></a>00275                       nframe);
-<a name="l00276"></a>00276         fors_flatfield_exit(NULL);
-<a name="l00277"></a>00277     }
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     <span class="keywordflow">if</span> (science_mxu) {
-<a name="l00280"></a>00280         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;
-<a name="l00281"></a>00281         pro_image_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>;
-<a name="l00282"></a>00282         raw_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;
-<a name="l00283"></a>00283     }
-<a name="l00284"></a>00284     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (science_mos) {
-<a name="l00285"></a>00285         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;
-<a name="l00286"></a>00286         pro_image_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>;
-<a name="l00287"></a>00287         raw_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;
-<a name="l00288"></a>00288     }
-<a name="l00289"></a>00289     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (science_lss) {
-<a name="l00290"></a>00290         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;
-<a name="l00291"></a>00291         pro_image_tag = <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>;
-<a name="l00292"></a>00292         raw_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>;
-<a name="l00293"></a>00293     }
-<a name="l00294"></a>00294     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_mxu) {
-<a name="l00295"></a>00295         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;
-<a name="l00296"></a>00296         pro_image_tag = <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>;
-<a name="l00297"></a>00297         raw_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;
-<a name="l00298"></a>00298     }
-<a name="l00299"></a>00299     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_mos) {
-<a name="l00300"></a>00300         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;
-<a name="l00301"></a>00301         pro_image_tag = <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>;
-<a name="l00302"></a>00302         raw_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;
-<a name="l00303"></a>00303     }
-<a name="l00304"></a>00304     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_lss) {
-<a name="l00305"></a>00305         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;
-<a name="l00306"></a>00306         pro_image_tag = <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>;
-<a name="l00307"></a>00307         raw_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>;
-<a name="l00308"></a>00308     }
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310     nflat = cpl_frameset_count_tags(frameset, norm_flat_tag);
-<a name="l00311"></a>00311     <span class="keywordflow">if</span> (nflat == 0) {
-<a name="l00312"></a>00312         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, norm_flat_tag);
-<a name="l00313"></a>00313         fors_flatfield_exit(NULL);
-<a name="l00314"></a>00314     }
-<a name="l00315"></a>00315     <span class="keywordflow">if</span> (nflat > 1) {
-<a name="l00316"></a>00316         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input (%d > 1): %s"</span>,
-<a name="l00317"></a>00317                       nflat, norm_flat_tag);
-<a name="l00318"></a>00318         fors_flatfield_exit(NULL);
-<a name="l00319"></a>00319     }
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00322"></a>00322         fors_flatfield_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00323"></a>00323 
-<a name="l00324"></a>00324     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00325"></a>00325         fors_flatfield_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00326"></a>00326 
-<a name="l00327"></a>00327     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>)) 
-<a name="l00328"></a>00328         fors_flatfield_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00329"></a>00329 
-<a name="l00330"></a>00330     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, raw_image_tag, 0);
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l00333"></a>00333         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load header of %s frame"</span>, raw_image_tag);
-<a name="l00334"></a>00334         fors_flatfield_exit(NULL);
-<a name="l00335"></a>00335     }
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00338"></a>00338     <span class="keywordflow">if</span> (instrume == NULL) {
-<a name="l00339"></a>00339         cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword INSTRUME in %s header"</span>, 
-<a name="l00340"></a>00340                       raw_image_tag);
-<a name="l00341"></a>00341         fors_flatfield_exit(NULL);
-<a name="l00342"></a>00342     }
-<a name="l00343"></a>00343 
-<a name="l00344"></a>00344     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00345"></a>00345         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00346"></a>00346     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00347"></a>00347         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349     cpl_msg_indent_less();
-<a name="l00350"></a>00350     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames:"</span>);
-<a name="l00351"></a>00351     cpl_msg_indent_more();
-<a name="l00352"></a>00352 
-<a name="l00353"></a>00353     norm_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, norm_flat_tag, CPL_TYPE_FLOAT, 0, 1);
-<a name="l00354"></a>00354     <span class="keywordflow">if</span> (norm_flat == NULL)
-<a name="l00355"></a>00355         fors_flatfield_exit(<span class="stringliteral">"Cannot load normalised flat field"</span>);
-<a name="l00356"></a>00356 
-<a name="l00357"></a>00357     raw_image = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, raw_image_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00358"></a>00358     <span class="keywordflow">if</span> (raw_image == NULL) {
-<a name="l00359"></a>00359         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load %s frame"</span>, raw_image_tag);
-<a name="l00360"></a>00360         fors_flatfield_exit(NULL);
-<a name="l00361"></a>00361     }
-<a name="l00362"></a>00362 
-<a name="l00363"></a>00363     cpl_msg_indent_less();
-<a name="l00364"></a>00364     cpl_msg_info(recipe, <span class="stringliteral">"Divide input %s by flat field..."</span>, raw_image_tag);
-<a name="l00365"></a>00365     cpl_msg_indent_more();
-<a name="l00366"></a>00366 
-<a name="l00367"></a>00367     <span class="keywordflow">if</span> (cpl_image_divide(raw_image, norm_flat) != CPL_ERROR_NONE) {
-<a name="l00368"></a>00368         cpl_msg_error(recipe, <span class="stringliteral">"Failure of flat field correction: %s"</span>,
-<a name="l00369"></a>00369                       cpl_error_get_message());
-<a name="l00370"></a>00370         fors_flatfield_exit(NULL);
-<a name="l00371"></a>00371     }
-<a name="l00372"></a>00372     cpl_image_delete(norm_flat); norm_flat = NULL;
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374     cpl_msg_indent_less();
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, raw_image, pro_image_tag,
-<a name="l00377"></a>00377                        header, parlist, recipe, version))
-<a name="l00378"></a>00378         fors_flatfield_exit(NULL);
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     cpl_propertylist_delete(header); header = NULL;
-<a name="l00381"></a>00381     cpl_image_delete(raw_image); raw_image = NULL;
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383     <span class="keywordflow">return</span> 0;
-<a name="l00384"></a>00384 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__flatfield_8c_source.html b/html/fors__flatfield_8c_source.html
new file mode 100644
index 0000000..37f221b
--- /dev/null
+++ b/html/fors__flatfield_8c_source.html
@@ -0,0 +1,399 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_flatfield.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_flatfield.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_flatfield.c,v 1.6 2013-04-24 14:14:13 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-04-24 14:14:13 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.6 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_flatfield_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to divide the input frame by the normalised flat\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"field frame produced by recipe fors_normalise_flat. The input frame must\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"be already bias subtracted (e.g., by recipe fors_remove_bias).\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"LSS.\n\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"  SCIENCE_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"  or STANDARD_UNBIAS_MXU     Raw         Bias subtracted frame   Y\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"  MASTER_NORM_FLAT_MXU       Calib       Normalised flat frame   Y\n\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"  SCIENCE_UNFLAT_MXU\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"  or STANDARD_UNFLAT_MXU     FITS image  Flat field corrected frame\n\n"</span>;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">#define fors_flatfield_exit(message)          \</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">cpl_image_delete(raw_image);                  \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">#define fors_flatfield_exit_memcheck(message) \</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor">printf("free raw_image (%p)\n", raw_image);     \</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">cpl_image_delete(raw_image);                    \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">printf("free norm_flat (%p)\n", norm_flat);     \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">cpl_image_delete(norm_flat);                    \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> {</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                     <span class="stringliteral">"fors_flatfield"</span>,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                     <span class="stringliteral">"Flat field correction of input frame"</span>,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                     fors_flatfield_description,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                     fors_flatfield_create,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                     fors_flatfield_exec,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                     fors_flatfield_destroy);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> {</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="comment">/* Uncomment in case parameters are defined</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="comment">    cpl_parameter *p;</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> }</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> {</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="keywordflow">return</span> fors_flatfield(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> }</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> {</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     </div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> }</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> </div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_flatfield(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> {</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> </div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_flatfield"</span>;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> </div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     cpl_image        *raw_image   = NULL;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     cpl_image        *norm_flat   = NULL;</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> </div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *norm_flat_tag;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *raw_image_tag;</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *pro_image_tag;</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     <span class="keywordtype">int</span>         science_mxu;</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     <span class="keywordtype">int</span>         science_mos;</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="keywordtype">int</span>         science_lss;</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     <span class="keywordtype">int</span>         standard_mxu;</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="keywordtype">int</span>         standard_mos;</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     <span class="keywordtype">int</span>         standard_lss;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keywordtype">int</span>         nflat, nframe;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     nframe  = science_mxu  = cpl_frameset_count_tags(frameset, </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>                                                      <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     nframe += science_mos  = cpl_frameset_count_tags(frameset, </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                                                      <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     nframe += science_lss  = cpl_frameset_count_tags(frameset, </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                                                      <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     nframe += standard_mxu = cpl_frameset_count_tags(frameset, </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                                                      <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     nframe += standard_mos = cpl_frameset_count_tags(frameset, </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>                                                      <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     nframe += standard_lss = cpl_frameset_count_tags(frameset, </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>                                                      <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="keywordflow">if</span> (nframe == 0) {</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>         fors_flatfield_exit(<span class="stringliteral">"Missing required input scientific frame"</span>);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     }</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="keywordflow">if</span> (nframe > 1) {</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input scientific frames (%d > 1)"</span>, </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                       nframe);</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>         fors_flatfield_exit(NULL);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     }</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="keywordflow">if</span> (science_mxu) {</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>         pro_image_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>         raw_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     }</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (science_mos) {</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>         pro_image_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>;</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>         raw_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     }</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (science_lss) {</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>         pro_image_tag = <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>;</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>         raw_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     }</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_mxu) {</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>         pro_image_tag = <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>         raw_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     }</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_mos) {</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>         pro_image_tag = <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         raw_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     }</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_lss) {</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>         norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         pro_image_tag = <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         raw_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     }</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     nflat = cpl_frameset_count_tags(frameset, norm_flat_tag);</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="keywordflow">if</span> (nflat == 0) {</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, norm_flat_tag);</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>         fors_flatfield_exit(NULL);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     }</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     <span class="keywordflow">if</span> (nflat > 1) {</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input (%d > 1): %s"</span>,</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>                       nflat, norm_flat_tag);</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         fors_flatfield_exit(NULL);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     }</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>         fors_flatfield_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>         fors_flatfield_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> </div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>)) </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         fors_flatfield_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, raw_image_tag, 0);</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load header of %s frame"</span>, raw_image_tag);</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>         fors_flatfield_exit(NULL);</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     }</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordflow">if</span> (instrume == NULL) {</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword INSTRUME in %s header"</span>, </div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>                       raw_image_tag);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>         fors_flatfield_exit(NULL);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     }</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> </div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames:"</span>);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> </div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     norm_flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, norm_flat_tag, CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     <span class="keywordflow">if</span> (norm_flat == NULL)</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>         fors_flatfield_exit(<span class="stringliteral">"Cannot load normalised flat field"</span>);</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> </div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     raw_image = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, raw_image_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="keywordflow">if</span> (raw_image == NULL) {</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load %s frame"</span>, raw_image_tag);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>         fors_flatfield_exit(NULL);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     }</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     cpl_msg_info(recipe, <span class="stringliteral">"Divide input %s by flat field..."</span>, raw_image_tag);</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keywordflow">if</span> (cpl_image_divide(raw_image, norm_flat) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>         cpl_msg_error(recipe, <span class="stringliteral">"Failure of flat field correction: %s"</span>,</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>         fors_flatfield_exit(NULL);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     }</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     cpl_image_delete(norm_flat); norm_flat = NULL;</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, raw_image, pro_image_tag,</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>                        header, parlist, recipe, version))</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>         fors_flatfield_exit(NULL);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> </div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     cpl_image_delete(raw_image); raw_image = NULL;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__header_8c-source.html b/html/fors__header_8c-source.html
deleted file mode 100644
index 5907f5f..0000000
--- a/html/fors__header_8c-source.html
+++ /dev/null
@@ -1,181 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_header.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_header.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_header.c,v 1.1 2012/11/05 17:11:56 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/11/05 17:11:56 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <ctype.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <string.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <unistd.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <math.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <fors_paf.h></span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#define DICT_LINE_LENGTH    (80)</span>
-<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#define MAX_PAF_NAME_LENGTH (80)</span>
-<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define PAF_ROOT_NAME       "qc"</span>
-<a name="l00048"></a>00048 <span class="preprocessor"></span>
-<a name="l00078"></a><a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">00078</a> cpl_error_code <a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(cpl_propertylist *header,
-<a name="l00079"></a>00079                                        <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value, 
-<a name="l00080"></a>00080                                        <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)
-<a name="l00081"></a>00081 {
-<a name="l00082"></a>00082     <span class="keywordtype">char</span> *header_name;
-<a name="l00083"></a>00083     <span class="keywordtype">int</span>   i;
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085     header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087     strcpy(header_name, <span class="stringliteral">"ESO "</span>);
-<a name="l00088"></a>00088     strcat(header_name, name);
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090     <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)
-<a name="l00091"></a>00091         <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)
-<a name="l00092"></a>00092             header_name[i] = <span class="charliteral">' '</span>;
-<a name="l00093"></a>00093 
-<a name="l00094"></a>00094     <span class="keywordflow">if</span> (cpl_propertylist_update_string(header, header_name, value)) {
-<a name="l00095"></a>00095         cpl_free(header_name);
-<a name="l00096"></a>00096         cpl_error_set_where(cpl_func);
-<a name="l00097"></a>00097         <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00098"></a>00098     }
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100     cpl_propertylist_set_comment(header, header_name, comment);
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102     cpl_free(header_name);
-<a name="l00103"></a>00103 
-<a name="l00104"></a>00104     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00105"></a>00105 }
-<a name="l00106"></a>00106 
-<a name="l00131"></a><a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">00131</a> cpl_error_code <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(cpl_propertylist *header, <span class="keywordtype">double</span> value, 
-<a name="l00132"></a>00132                                       <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, 
-<a name="l00133"></a>00133                                       <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)
-<a name="l00134"></a>00134 {
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136   <span class="keywordtype">char</span> *header_name;
-<a name="l00137"></a>00137   <span class="keywordtype">int</span>   i;
-<a name="l00138"></a>00138   <span class="keywordtype">char</span> *allComment;
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140   allComment = cpl_malloc(81 * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));
-<a name="l00141"></a>00141 
-<a name="l00142"></a>00142   <span class="keywordflow">if</span> (unit)
-<a name="l00143"></a>00143     snprintf(allComment, 80, <span class="stringliteral">"%s [%s]"</span>, comment, unit);
-<a name="l00144"></a>00144   <span class="keywordflow">else</span>
-<a name="l00145"></a>00145     snprintf(allComment, 80, <span class="stringliteral">"%s"</span>, comment);
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147   
-<a name="l00148"></a>00148   header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150   strcpy(header_name, <span class="stringliteral">"ESO "</span>);
-<a name="l00151"></a>00151   strcat(header_name, name);
-<a name="l00152"></a>00152 
-<a name="l00153"></a>00153   <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)
-<a name="l00154"></a>00154     <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)
-<a name="l00155"></a>00155       header_name[i] = <span class="charliteral">' '</span>;
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157   <span class="keywordflow">if</span> (cpl_propertylist_update_double(header, header_name, value)) {
-<a name="l00158"></a>00158       cpl_free(header_name);
-<a name="l00159"></a>00159       cpl_error_set_where(cpl_func);
-<a name="l00160"></a>00160       <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00161"></a>00161   }
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163   cpl_propertylist_set_comment(header, header_name, allComment);
-<a name="l00164"></a>00164 
-<a name="l00165"></a>00165   cpl_free(header_name);
-<a name="l00166"></a>00166   cpl_free(allComment);
-<a name="l00167"></a>00167 
-<a name="l00168"></a>00168   <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170 }
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172 
-<a name="l00173"></a><a class="code" href="group__forsqc.html#g5add57d4e24de85d348f48f8a1c752bb">00173</a> cpl_error_code <a class="code" href="group__forsqc.html#g5add57d4e24de85d348f48f8a1c752bb">fors_header_write_int</a>(cpl_propertylist *header, <span class="keywordtype">int</span> value,
-<a name="l00174"></a>00174                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit,
-<a name="l00175"></a>00175                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)
-<a name="l00176"></a>00176 {
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178   <span class="keywordtype">char</span> *header_name;
-<a name="l00179"></a>00179   <span class="keywordtype">int</span>   i;
-<a name="l00180"></a>00180   <span class="keywordtype">char</span> *allComment;
-<a name="l00181"></a>00181 
-<a name="l00182"></a>00182   allComment = cpl_malloc(81 * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184   <span class="keywordflow">if</span> (unit)
-<a name="l00185"></a>00185     snprintf(allComment, 80, <span class="stringliteral">"%s [%s]"</span>, comment, unit);
-<a name="l00186"></a>00186   <span class="keywordflow">else</span>
-<a name="l00187"></a>00187     snprintf(allComment, 80, <span class="stringliteral">"%s"</span>, comment);
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189   header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191   strcpy(header_name, <span class="stringliteral">"ESO "</span>);
-<a name="l00192"></a>00192   strcat(header_name, name);
-<a name="l00193"></a>00193 
-<a name="l00194"></a>00194   <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)
-<a name="l00195"></a>00195     <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)
-<a name="l00196"></a>00196       header_name[i] = <span class="charliteral">' '</span>;
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198   <span class="keywordflow">if</span> (cpl_propertylist_update_int(header, header_name, value)) {
-<a name="l00199"></a>00199       cpl_free(header_name);
-<a name="l00200"></a>00200       cpl_error_set_where(cpl_func);
-<a name="l00201"></a>00201       <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00202"></a>00202   }
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204   cpl_propertylist_set_comment(header, header_name, allComment);
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206   cpl_free(header_name);
-<a name="l00207"></a>00207   cpl_free(allComment);
-<a name="l00208"></a>00208 
-<a name="l00209"></a>00209   <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211 }
-<a name="l00212"></a>00212 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__header_8c_source.html b/html/fors__header_8c_source.html
new file mode 100644
index 0000000..e6f458e
--- /dev/null
+++ b/html/fors__header_8c_source.html
@@ -0,0 +1,220 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_header.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_header.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_header.c,v 1.1 2012-11-05 17:11:56 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012-11-05 17:11:56 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.1 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <ctype.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <unistd.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <fors_paf.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#define DICT_LINE_LENGTH    (80)</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor"></span><span class="preprocessor">#define MAX_PAF_NAME_LENGTH (80)</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_ROOT_NAME       "qc"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053">   78</a></span> cpl_error_code <a class="code" href="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053" title="Write a string value to the active QC1 PAF object and to a header.">fors_header_write_string</a>(cpl_propertylist *header,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                                        <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value, </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                                        <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> {</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     <span class="keywordtype">char</span> *header_name;</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     <span class="keywordtype">int</span>   i;</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     strcpy(header_name, <span class="stringliteral">"ESO "</span>);</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     strcat(header_name, name);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>         <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>             header_name[i] = <span class="charliteral">' '</span>;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     <span class="keywordflow">if</span> (cpl_propertylist_update_string(header, header_name, value)) {</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>         cpl_free(header_name);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>         cpl_error_set_where(cpl_func);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>         <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     }</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     cpl_propertylist_set_comment(header, header_name, comment);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     cpl_free(header_name);</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> }</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno"><a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f">  131</a></span> cpl_error_code <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(cpl_propertylist *header, <span class="keywordtype">double</span> value, </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>                                       <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                                       <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> {</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>   <span class="keywordtype">char</span> *header_name;</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>   <span class="keywordtype">int</span>   i;</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>   <span class="keywordtype">char</span> *allComment;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>   allComment = cpl_malloc(81 * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>   <span class="keywordflow">if</span> (unit)</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     snprintf(allComment, 80, <span class="stringliteral">"%s [%s]"</span>, comment, unit);</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>   <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     snprintf(allComment, 80, <span class="stringliteral">"%s"</span>, comment);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>   </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>   header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>   strcpy(header_name, <span class="stringliteral">"ESO "</span>);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>   strcat(header_name, name);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>   <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>       header_name[i] = <span class="charliteral">' '</span>;</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>   <span class="keywordflow">if</span> (cpl_propertylist_update_double(header, header_name, value)) {</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>       cpl_free(header_name);</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>       cpl_error_set_where(cpl_func);</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>       <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>   }</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>   cpl_propertylist_set_comment(header, header_name, allComment);</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>   cpl_free(header_name);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>   cpl_free(allComment);</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> </div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>   <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> }</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> cpl_error_code fors_header_write_int(cpl_propertylist *header, <span class="keywordtype">int</span> value,</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit,</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> {</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>   <span class="keywordtype">char</span> *header_name;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>   <span class="keywordtype">int</span>   i;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>   <span class="keywordtype">char</span> *allComment;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>   allComment = cpl_malloc(81 * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>   <span class="keywordflow">if</span> (unit)</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     snprintf(allComment, 80, <span class="stringliteral">"%s [%s]"</span>, comment, unit);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>   <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     snprintf(allComment, 80, <span class="stringliteral">"%s"</span>, comment);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>   header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>   strcpy(header_name, <span class="stringliteral">"ESO "</span>);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>   strcat(header_name, name);</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>   <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>       header_name[i] = <span class="charliteral">' '</span>;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>   <span class="keywordflow">if</span> (cpl_propertylist_update_int(header, header_name, value)) {</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>       cpl_free(header_name);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>       cpl_error_set_where(cpl_func);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>       <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>   }</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>   cpl_propertylist_set_comment(header, header_name, allComment);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>   cpl_free(header_name);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>   cpl_free(allComment);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> </div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>   <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> }</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__header_8h-source.html b/html/fors__header_8h-source.html
deleted file mode 100644
index b893b9f..0000000
--- a/html/fors__header_8h-source.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_header.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_header.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_header.h,v 1.1 2012/11/05 17:11:40 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/11/05 17:11:40 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_HEADER_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_HEADER_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 cpl_error_code <a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(cpl_propertylist *header,
-<a name="l00036"></a>00036                                         <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value, 
-<a name="l00037"></a>00037                                         <span class="keyword">const</span> <span class="keywordtype">char</span> *comment);
-<a name="l00038"></a>00038 cpl_error_code <a class="code" href="group__forsqc.html#g5add57d4e24de85d348f48f8a1c752bb">fors_header_write_int</a>(cpl_propertylist *header, <span class="keywordtype">int</span> value,
-<a name="l00039"></a>00039                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit,
-<a name="l00040"></a>00040                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *comment);
-<a name="l00041"></a>00041 cpl_error_code <a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(cpl_propertylist *header, <span class="keywordtype">double</span> value, 
-<a name="l00042"></a>00042                                         <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, 
-<a name="l00043"></a>00043                                         <span class="keyword">const</span> <span class="keywordtype">char</span> *comment);
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 CPL_END_DECLS
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 <span class="preprocessor">#endif </span><span class="comment">/* FORS_HEADER_H */</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__header_8h_source.html b/html/fors__header_8h_source.html
new file mode 100644
index 0000000..724c588
--- /dev/null
+++ b/html/fors__header_8h_source.html
@@ -0,0 +1,108 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_header.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_header.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_header.h,v 1.1 2012-11-05 17:11:40 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012-11-05 17:11:40 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.1 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_HEADER_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_HEADER_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> cpl_error_code <a class="code" href="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053" title="Write a string value to the active QC1 PAF object and to a header.">fors_header_write_string</a>(cpl_propertylist *header,</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span>                                         <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value, </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span>                                         <span class="keyword">const</span> <span class="keywordtype">char</span> *comment);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> cpl_error_code fors_header_write_int(cpl_propertylist *header, <span class="keywordtype">int</span> value,</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit,</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *comment);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> cpl_error_code <a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(cpl_propertylist *header, <span class="keywordtype">double</span> value, </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>                                         <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>                                         <span class="keyword">const</span> <span class="keywordtype">char</span> *comment);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#endif </span><span class="comment">/* FORS_HEADER_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__identify-test_8c-source.html b/html/fors__identify-test_8c-source.html
deleted file mode 100644
index b4ffc5e..0000000
--- a/html/fors__identify-test_8c-source.html
+++ /dev/null
@@ -1,296 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_identify-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_identify-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_identify-test.c,v 1.30 2011/05/10 07:29:10 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/05/10 07:29:10 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.30 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_identify.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_setting.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_data.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_instrument.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_std_cat.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <test.h></span>
-<a name="l00042"></a>00042 
-<a name="l00050"></a>00050 <span class="preprocessor">#undef cleanup</span>
-<a name="l00051"></a><a class="code" href="group__fors__identify__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">do { \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">    cpl_frame_delete(raw_frame); \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">    cpl_frameset_delete(cat_frames); \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">    cpl_frame_delete(phot_table); \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00057"></a>00057 <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span>
-<a name="l00058"></a>00058 <span class="preprocessor">    fors_identify_method_delete(&im); \</span>
-<a name="l00059"></a>00059 <span class="preprocessor">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</span>
-<a name="l00060"></a>00060 <span class="preprocessor">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</span>
-<a name="l00061"></a>00061 <span class="preprocessor">    fors_star_list_delete(&stars, fors_star_delete); \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">    fors_star_list_delete(&stars_id, fors_star_delete); \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">    cpl_propertylist_delete(raw_header); raw_header = NULL; \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">} while(0)</span>
-<a name="l00065"></a>00065 <span class="preprocessor"></span>
-<a name="l00069"></a>00069 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00070"></a><a class="code" href="group__fors__identify__test.html#gb90b25df34e84ac286eea7acaaf2c726">00070</a> <a class="code" href="group__fors__identify__test.html#gb90b25df34e84ac286eea7acaaf2c726">test_identify</a>(<span class="keywordtype">void</span>)
-<a name="l00071"></a>00071 {
-<a name="l00072"></a>00072     identify_method *im = NULL;
-<a name="l00073"></a>00073     cpl_parameterlist *parameters = cpl_parameterlist_new();
-<a name="l00074"></a>00074     <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> context = <span class="stringliteral">"test"</span>;
-<a name="l00075"></a>00075     fors_star_list *stars = NULL;
-<a name="l00076"></a>00076     fors_star_list *stars_id = NULL;
-<a name="l00077"></a>00077     fors_std_star_list *cat = NULL;
-<a name="l00078"></a>00078     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00079"></a>00079     cpl_frame *raw_frame = NULL;
-<a name="l00080"></a>00080     cpl_frame *phot_table = NULL;
-<a name="l00081"></a>00081     cpl_propertylist    *raw_header = NULL;
-<a name="l00082"></a>00082     <span class="keywordtype">double</span> color_term, dcolor_term;
-<a name="l00083"></a>00083     <span class="keywordtype">double</span> ext_coeff, dext_coeff;
-<a name="l00084"></a>00084     <span class="keywordtype">char</span>   band;
-<a name="l00085"></a>00085 
-<a name="l00086"></a>00086     <span class="comment">/* Simulate data */</span>
-<a name="l00087"></a>00087     cpl_frameset *cat_frames = cpl_frameset_new();
-<a name="l00088"></a>00088     cpl_frameset_insert(cat_frames, <a class="code" href="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410">create_std_cat</a>(<span class="stringliteral">"identify_std_cat.fits"</span>,
-<a name="l00089"></a>00089                                                    FLX_STD_IMG,
-<a name="l00090"></a>00090                                                    CPL_FRAME_GROUP_CALIB));
-<a name="l00091"></a>00091                         
-<a name="l00092"></a>00092     <a class="code" href="group__fors__identify.html#g62b335e73ad633535e1494f9ffd0cd03">fors_identify_define_parameters</a>(parameters, context);   
-<a name="l00093"></a>00093     <a class="code" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">fors_parameterlist_set_defaults</a>(parameters);
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095     im = <a class="code" href="group__fors__identify.html#g2763139bd0ceba14e3be219d5d043e46">fors_identify_method_new</a>(parameters, context);
-<a name="l00096"></a>00096     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00097"></a>00097             <span class="stringliteral">"Could not get identification parameters"</span>);
-<a name="l00098"></a>00098  
-<a name="l00099"></a>00099     raw_frame = <a class="code" href="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b">create_standard</a>(<span class="stringliteral">"identify_std_img.fits"</span>, 
-<a name="l00100"></a>00100                                 STANDARD_IMG, CPL_FRAME_GROUP_RAW);
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102     phot_table = <a class="code" href="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5">create_phot_table</a>(<span class="stringliteral">"identify_phot_table.fits"</span>,
-<a name="l00103"></a>00103                                    PHOT_TABLE, CPL_FRAME_GROUP_CALIB);
-<a name="l00104"></a>00104     
-<a name="l00105"></a>00105     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(raw_frame);
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107     fors_phot_table_load(phot_table, setting, 
-<a name="l00108"></a>00108              &color_term, &dcolor_term,
-<a name="l00109"></a>00109              &ext_coeff, &dext_coeff,
-<a name="l00110"></a>00110              NULL, NULL);
-<a name="l00111"></a>00111     
-<a name="l00112"></a>00112     <span class="comment">/* Use catalogue list of stars as 'detected' sources */</span>
-<a name="l00113"></a>00113     band = fors_instrument_filterband_get_by_setting(setting);
-<a name="l00114"></a>00114     cat = fors_std_cat_load(cat_frames, band, 0, color_term, dcolor_term);
-<a name="l00115"></a>00115     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00116"></a>00116     
-<a name="l00117"></a>00117     raw_header = cpl_propertylist_load(cpl_frame_get_filename(raw_frame), 0);
-<a name="l00118"></a>00118     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00119"></a>00119     fors_std_star_list_apply_wcs(cat, raw_header);
-<a name="l00120"></a>00120     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00121"></a>00121     
-<a name="l00122"></a>00122     stars    = fors_star_list_new();
-<a name="l00123"></a>00123     stars_id = fors_star_list_new();  <span class="comment">/* Reference list of expected results */</span>
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="comment">/* Add offset + noise to positions,</span>
-<a name="l00126"></a>00126 <span class="comment">       rotate 90 degrees </span>
-<a name="l00127"></a>00127 <span class="comment">    */</span>
-<a name="l00128"></a>00128     {
-<a name="l00129"></a>00129         fors_std_star *s;
-<a name="l00130"></a>00130         <span class="keywordtype">double</span> sigma = 0.1;  <span class="comment">/* pixels */</span>
-<a name="l00131"></a>00131         <span class="keywordtype">double</span> offsetx = 60; <span class="comment">/* pixels */</span>
-<a name="l00132"></a>00132         <span class="keywordtype">double</span> offsety = -100; <span class="comment">/* pixels */</span>
-<a name="l00133"></a>00133         <span class="keywordtype">double</span> semi_major = 1.0;
-<a name="l00134"></a>00134         <span class="keywordtype">double</span> semi_minor = 1.0;
-<a name="l00135"></a>00135         <span class="keywordtype">double</span> fwhm = 3;
-<a name="l00136"></a>00136         <span class="keywordtype">double</span> orientation = 0;
-<a name="l00137"></a>00137         <span class="keywordtype">double</span> stellarity = 1.0;  <span class="comment">/* Presumably catalog objects are stars */</span>
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139         <span class="keywordflow">for</span> (s = fors_std_star_list_first(cat);
-<a name="l00140"></a>00140              s != NULL;
-<a name="l00141"></a>00141              s = fors_std_star_list_next(cat)) {
-<a name="l00142"></a>00142             
-<a name="l00143"></a>00143             <a class="code" href="struct__fors__star.html">fors_star</a> *source = 
-<a name="l00144"></a>00144                 <a class="code" href="group__fors__star.html#g548c477088fd4fbadd74fd84f3becb94">fors_star_new</a>(
-<a name="l00145"></a>00145                     s->pixel->x + offsetx + sigma * <a class="code" href="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044">fors_rand_gauss</a>(),
-<a name="l00146"></a>00146                     s->pixel->y + offsety + sigma * <a class="code" href="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044">fors_rand_gauss</a>(),
-<a name="l00147"></a>00147                     fwhm,
-<a name="l00148"></a>00148                     semi_major,
-<a name="l00149"></a>00149                     semi_minor,
-<a name="l00150"></a>00150                     orientation,
-<a name="l00151"></a>00151                     - s->magnitude,
-<a name="l00152"></a>00152                     s->dmagnitude,
-<a name="l00153"></a>00153                     stellarity);
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155             <span class="comment">/* Rotate */</span>
-<a name="l00156"></a>00156             <span class="keywordflow">if</span> (0) <span class="comment">/* not supported by the implementation */</span> {
-<a name="l00157"></a>00157                 <span class="keywordtype">double</span> temp      = source-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x;
-<a name="l00158"></a>00158                 source->pixel->x = source->pixel->y;
-<a name="l00159"></a>00159                 source->pixel->y = -temp;
-<a name="l00160"></a>00160             }
-<a name="l00161"></a>00161             
-<a name="l00162"></a>00162 <span class="comment">/*</span>
-<a name="l00163"></a>00163 <span class="comment">printf("Inserisce in stars source (%2f,%2f)\n", s->pixel->x, s->pixel->y);</span>
-<a name="l00164"></a>00164 <span class="comment">printf("  deviata a %2f %2f ------> (%2f,%2f)\n", offsetx, offsety, source->pixel->x, source->pixel->y);</span>
-<a name="l00165"></a>00165 <span class="comment">*/</span>
-<a name="l00166"></a>00166             fors_star_list_insert(stars, source);
-<a name="l00167"></a>00167 
-<a name="l00168"></a>00168             <a class="code" href="struct__fors__star.html">fors_star</a> *source_id = <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>(source);
-<a name="l00169"></a>00169             
-<a name="l00170"></a>00170             source_id-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> = fors_std_star_duplicate(s);
-<a name="l00171"></a>00171             fors_star_list_insert(stars_id, source_id);
-<a name="l00172"></a>00172         }
-<a name="l00173"></a>00173     }
-<a name="l00174"></a>00174 
-<a name="l00175"></a>00175     <span class="comment">/* Call function */</span>
-<a name="l00176"></a>00176     <a class="code" href="group__fors__identify.html#g879f2fc7b296f37722f6203d0ead78b6">fors_identify</a>(stars, cat, im, NULL);
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="comment">/* Verify that </span>
-<a name="l00179"></a>00179 <span class="comment">     *   stars identifications</span>
-<a name="l00180"></a>00180 <span class="comment">     * match</span>
-<a name="l00181"></a>00181 <span class="comment">     *   stars_id</span>
-<a name="l00182"></a>00182 <span class="comment">     */</span>
-<a name="l00183"></a>00183     {
-<a name="l00184"></a>00184         <a class="code" href="struct__fors__star.html">fors_star</a> *star;
-<a name="l00185"></a>00185         <span class="keywordtype">int</span> <span class="keywordtype">id</span> = 0;
-<a name="l00186"></a>00186         <span class="keywordtype">int</span> tot = 0;
-<a name="l00187"></a>00187 
-<a name="l00188"></a>00188         <span class="keywordflow">for</span> (star = fors_star_list_first(stars);
-<a name="l00189"></a>00189              star != NULL;
-<a name="l00190"></a>00190              star = fors_star_list_next(stars))
-<a name="l00191"></a>00191             {
-<a name="l00192"></a>00192                 <span class="keywordflow">if</span> (star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> != NULL) {
-<a name="l00193"></a>00193                     <span class="keywordtype">id</span>++;
-<a name="l00194"></a>00194                     
-<a name="l00195"></a>00195                     <span class="comment">/* Find corresponding input star and verify that the id</span>
-<a name="l00196"></a>00196 <span class="comment">                       is correct */</span>
-<a name="l00197"></a>00197                     fors_star_list *input = 
-<a name="l00198"></a>00198                         fors_star_list_extract(stars_id, <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>,
-<a name="l00199"></a>00199                                                (fors_star_list_func_predicate) <a class="code" href="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98">fors_star_equal</a>, 
-<a name="l00200"></a>00200                                                star);
-<a name="l00201"></a>00201                     
-<a name="l00202"></a>00202                     test_eq( fors_star_list_size(input), 1 );
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204                     <a class="code" href="struct__fors__star.html">fors_star</a> *input1 = fors_star_list_first(input);
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206                     test( fors_std_star_equal(star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>, input1-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>) );
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208                     fors_star_list_delete(&input, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>);
-<a name="l00209"></a>00209                 }
-<a name="l00210"></a>00210                 tot++;
-<a name="l00211"></a>00211             }
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213 <span class="comment">/* For some reason this test fails as soon as the default search radius</span>
-<a name="l00214"></a>00214 <span class="comment">   and max search radius in fors_identify.c are set from 5,50 to 20,20.</span>
-<a name="l00215"></a>00215 <span class="comment">   In the first case 7 out of 8 stars are identified, in the second case</span>
-<a name="l00216"></a>00216 <span class="comment">   only 2 out of 8 stars are identified. However, stars are correctly</span>
-<a name="l00217"></a>00217 <span class="comment">   identified in real cases by the pipeline with the 20,20 setting, and</span>
-<a name="l00218"></a>00218 <span class="comment">   not with the 5,50 setting, therefore this test is disabled until the</span>
-<a name="l00219"></a>00219 <span class="comment">   error (in the test!) is discovered.</span>
-<a name="l00220"></a>00220 <span class="comment"></span>
-<a name="l00221"></a>00221 <span class="comment">printf("id = %d, tot = %d\n", id, tot);</span>
-<a name="l00222"></a>00222 <span class="comment">        </span>
-<a name="l00223"></a>00223 <span class="comment">        test( id > tot/2 );</span>
-<a name="l00224"></a>00224 <span class="comment">*/</span>
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     }
-<a name="l00227"></a>00227 
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229     <span class="comment">/* Now mirror sources (i.e. switch x and y), </span>
-<a name="l00230"></a>00230 <span class="comment">       the identification should fail */</span>
-<a name="l00231"></a>00231     {
-<a name="l00232"></a>00232         <a class="code" href="struct__fors__star.html">fors_star</a> *star;
-<a name="l00233"></a>00233         
-<a name="l00234"></a>00234         <span class="keywordflow">for</span> (star = fors_star_list_first(stars);
-<a name="l00235"></a>00235              star != NULL;
-<a name="l00236"></a>00236              star = fors_star_list_next(stars)) {
-<a name="l00237"></a>00237             
-<a name="l00238"></a>00238             <span class="keywordtype">double</span> temp = star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x;
-<a name="l00239"></a>00239             star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x = star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y;
-<a name="l00240"></a>00240             star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y = temp;
-<a name="l00241"></a>00241 
-<a name="l00242"></a>00242             <span class="comment">/* reset ID */</span>
-<a name="l00243"></a>00243             if (star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> != NULL) {
-<a name="l00244"></a>00244                 fors_std_star_delete_const(&(star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>));
-<a name="l00245"></a>00245             }
-<a name="l00246"></a>00246         }
-<a name="l00247"></a>00247     }
-<a name="l00248"></a>00248     
-<a name="l00249"></a>00249     <span class="comment">/* Call function, suppress warnings */</span>
-<a name="l00250"></a>00250     {
-<a name="l00251"></a>00251         cpl_msg_severity before = cpl_msg_get_level();
-<a name="l00252"></a>00252         cpl_msg_set_level(CPL_MSG_ERROR);
-<a name="l00253"></a>00253         
-<a name="l00254"></a>00254         <a class="code" href="group__fors__identify.html#g879f2fc7b296f37722f6203d0ead78b6">fors_identify</a>(stars, cat, im, NULL);
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256         cpl_msg_set_level(before);
-<a name="l00257"></a>00257     }    
-<a name="l00258"></a>00258     <span class="comment">/* Verify that ID failed */</span>
-<a name="l00259"></a>00259     {
-<a name="l00260"></a>00260         <a class="code" href="struct__fors__star.html">fors_star</a> *star;
-<a name="l00261"></a>00261         
-<a name="l00262"></a>00262         <span class="keywordflow">for</span> (star = fors_star_list_first(stars);
-<a name="l00263"></a>00263              star != NULL;
-<a name="l00264"></a>00264              star = fors_star_list_next(stars)) {
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266             test( star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> == NULL );
-<a name="l00267"></a>00267         }
-<a name="l00268"></a>00268     }            
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00271"></a>00271     <span class="keywordflow">return</span>;
-<a name="l00272"></a>00272 }
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274 
-<a name="l00278"></a><a class="code" href="group__fors__identify__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00278</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00279"></a>00279 {
-<a name="l00280"></a>00280     TEST_INIT;
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span>
-<a name="l00283"></a>00283     <a class="code" href="group__fors__identify__test.html#gb90b25df34e84ac286eea7acaaf2c726">test_identify</a>();
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285     TEST_END;
-<a name="l00286"></a>00286 }
-<a name="l00287"></a>00287 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__identify-test_8c_source.html b/html/fors__identify-test_8c_source.html
new file mode 100644
index 0000000..e21fc63
--- /dev/null
+++ b/html/fors__identify-test_8c_source.html
@@ -0,0 +1,335 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_identify-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_identify-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_identify-test.c,v 1.30 2011-05-10 07:29:10 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-05-10 07:29:10 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.30 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_identify.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_setting.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_data.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_instrument.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_std_cat.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">    cpl_frame_delete(raw_frame); \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">    cpl_frameset_delete(cat_frames); \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">    cpl_frame_delete(phot_table); \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">    fors_identify_method_delete(&im); \</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">    fors_star_list_delete(&stars, fors_star_delete); \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">    fors_star_list_delete(&stars_id, fors_star_delete); \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">    cpl_propertylist_delete(raw_header); raw_header = NULL; \</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="group__fors__identify__test.html#ga9d562f61b66fedca2d53604fa93c8328">   70</a></span> <a class="code" href="group__fors__identify__test.html#ga9d562f61b66fedca2d53604fa93c8328" title="Test identification.">test_identify</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> {</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     identify_method *im = NULL;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     cpl_parameterlist *parameters = cpl_parameterlist_new();</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> context = <span class="stringliteral">"test"</span>;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     fors_star_list *stars = NULL;</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     fors_star_list *stars_id = NULL;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     fors_std_star_list *cat = NULL;</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_frame *raw_frame = NULL;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     cpl_frame *phot_table = NULL;</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     cpl_propertylist    *raw_header = NULL;</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     <span class="keywordtype">double</span> color_term, dcolor_term;</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     <span class="keywordtype">double</span> ext_coeff, dext_coeff;</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <span class="keywordtype">char</span>   band;</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> </div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     <span class="comment">/* Simulate data */</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     cpl_frameset *cat_frames = cpl_frameset_new();</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     cpl_frameset_insert(cat_frames, <a class="code" href="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3" title="Create standard star catalogue.">create_std_cat</a>(<span class="stringliteral">"identify_std_cat.fits"</span>,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                                                    FLX_STD_IMG,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                                                    CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                         </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     <a class="code" href="group__fors__identify.html#gac0dc4fbd9cc717256e5972cad3e7447f" title="Define recipe parameters.">fors_identify_define_parameters</a>(parameters, context);   </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     <a class="code" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42" title="Set unset parameters to default value.">fors_parameterlist_set_defaults</a>(parameters);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     im = <a class="code" href="group__fors__identify.html#ga642e6d38ae7b273d1901698a3970fd49" title="Get id method from parameter list.">fors_identify_method_new</a>(parameters, context);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>             <span class="stringliteral">"Could not get identification parameters"</span>);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>  </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     raw_frame = <a class="code" href="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164" title="Create standard star image.">create_standard</a>(<span class="stringliteral">"identify_std_img.fits"</span>, </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                                 STANDARD_IMG, CPL_FRAME_GROUP_RAW);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     phot_table = <a class="code" href="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b" title="Create photometry table.">create_phot_table</a>(<span class="stringliteral">"identify_phot_table.fits"</span>,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                                    PHOT_TABLE, CPL_FRAME_GROUP_CALIB);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     </div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(raw_frame);</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     fors_phot_table_load(phot_table, setting, </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>              &color_term, &dcolor_term,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>              &ext_coeff, &dext_coeff,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>              NULL, NULL);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     <span class="comment">/* Use catalogue list of stars as 'detected' sources */</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     band = fors_instrument_filterband_get_by_setting(setting);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     cat = fors_std_cat_load(cat_frames, band, 0, color_term, dcolor_term);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     raw_header = cpl_propertylist_load(cpl_frame_get_filename(raw_frame), 0);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     fors_std_star_list_apply_wcs(cat, raw_header);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     stars    = fors_star_list_new();</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     stars_id = fors_star_list_new();  <span class="comment">/* Reference list of expected results */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="comment">/* Add offset + noise to positions,</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="comment">       rotate 90 degrees </span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     {</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         fors_std_star *s;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>         <span class="keywordtype">double</span> sigma = 0.1;  <span class="comment">/* pixels */</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>         <span class="keywordtype">double</span> offsetx = 60; <span class="comment">/* pixels */</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         <span class="keywordtype">double</span> offsety = -100; <span class="comment">/* pixels */</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>         <span class="keywordtype">double</span> semi_major = 1.0;</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         <span class="keywordtype">double</span> semi_minor = 1.0;</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>         <span class="keywordtype">double</span> fwhm = 3;</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         <span class="keywordtype">double</span> orientation = 0;</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>         <span class="keywordtype">double</span> stellarity = 1.0;  <span class="comment">/* Presumably catalog objects are stars */</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>         <span class="keywordflow">for</span> (s = fors_std_star_list_first(cat);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>              s != NULL;</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>              s = fors_std_star_list_next(cat)) {</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>             </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>             <a class="code" href="struct__fors__star.html">fors_star</a> *source = </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                 <a class="code" href="group__fors__star.html#ga7a8b2a60d5685524ffbb762e066c9b01" title="Constructor.">fors_star_new</a>(</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                     s->pixel->x + offsetx + sigma * <a class="code" href="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56" title="Pseudo-random gaussian distributed number.">fors_rand_gauss</a>(),</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                     s->pixel->y + offsety + sigma * <a class="code" href="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56" title="Pseudo-random gaussian distributed number.">fors_rand_gauss</a>(),</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                     fwhm,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                     semi_major,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                     semi_minor,</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>                     orientation,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>                     - s->magnitude,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                     s->dmagnitude,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                     stellarity);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>             <span class="comment">/* Rotate */</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>             <span class="keywordflow">if</span> (0) <span class="comment">/* not supported by the implementation */</span> {</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                 <span class="keywordtype">double</span> temp      = source->pixel->x;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                 source->pixel->x = source->pixel->y;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                 source->pixel->y = -temp;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>             }</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>             </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="comment">printf("Inserisce in stars source (%2f,%2f)\n", s->pixel->x, s->pixel->y);</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="comment">printf("  deviata a %2f %2f ------> (%2f,%2f)\n", offsetx, offsety, source->pixel->x, source->pixel->y);</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>             fors_star_list_insert(stars, source);</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> </div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>             <a class="code" href="struct__fors__star.html">fors_star</a> *source_id = <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>(source);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>             </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>             source_id->id = fors_std_star_duplicate(s);</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>             fors_star_list_insert(stars_id, source_id);</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         }</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     <span class="comment">/* Call function */</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     <a class="code" href="group__fors__identify.html#ga734ab55ebf9bec1bed7e6330def7b6d8" title="Identify sources.">fors_identify</a>(stars, cat, im, NULL);</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="comment">/* Verify that </span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="comment">     *   stars identifications</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="comment">     * match</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="comment">     *   stars_id</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     {</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>         <a class="code" href="struct__fors__star.html">fors_star</a> *star;</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         <span class="keywordtype">int</span> <span class="keywordtype">id</span> = 0;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>         <span class="keywordtype">int</span> tot = 0;</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>         <span class="keywordflow">for</span> (star = fors_star_list_first(stars);</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>              star != NULL;</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>              star = fors_star_list_next(stars))</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>             {</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                 <span class="keywordflow">if</span> (star->id != NULL) {</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                     <span class="keywordtype">id</span>++;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                     </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                     <span class="comment">/* Find corresponding input star and verify that the id</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="comment">                       is correct */</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                     fors_star_list *input = </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                         fors_star_list_extract(stars_id, <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                                                (fors_star_list_func_predicate) <a class="code" href="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1" title="Test for equality.">fors_star_equal</a>, </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                                                star);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                     </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                     test_eq( fors_star_list_size(input), 1 );</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                     <a class="code" href="struct__fors__star.html">fors_star</a> *input1 = fors_star_list_first(input);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                     test( fors_std_star_equal(star->id, input1->id) );</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                     fors_star_list_delete(&input, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                 }</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                 tot++;</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>             }</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="comment">/* For some reason this test fails as soon as the default search radius</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="comment">   and max search radius in fors_identify.c are set from 5,50 to 20,20.</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="comment">   In the first case 7 out of 8 stars are identified, in the second case</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="comment">   only 2 out of 8 stars are identified. However, stars are correctly</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="comment">   identified in real cases by the pipeline with the 20,20 setting, and</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="comment">   not with the 5,50 setting, therefore this test is disabled until the</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="comment">   error (in the test!) is discovered.</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> <span class="comment"></span></div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> <span class="comment">printf("id = %d, tot = %d\n", id, tot);</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> <span class="comment">        </span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> <span class="comment">        test( id > tot/2 );</span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     }</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> </div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <span class="comment">/* Now mirror sources (i.e. switch x and y), </span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="comment">       the identification should fail */</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     {</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>         <a class="code" href="struct__fors__star.html">fors_star</a> *star;</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>         </div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>         <span class="keywordflow">for</span> (star = fors_star_list_first(stars);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>              star != NULL;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>              star = fors_star_list_next(stars)) {</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>             </div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>             <span class="keywordtype">double</span> temp = star->pixel->x;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>             star->pixel->x = star->pixel->y;</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>             star->pixel->y = temp;</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> </div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>             <span class="comment">/* reset ID */</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>             <span class="keywordflow">if</span> (star->id != NULL) {</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                 fors_std_star_delete_const(&(star->id));</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>             }</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>         }</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     }</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     </div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <span class="comment">/* Call function, suppress warnings */</span></div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     {</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>         cpl_msg_severity before = cpl_msg_get_level();</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>         cpl_msg_set_level(CPL_MSG_ERROR);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>         </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>         <a class="code" href="group__fors__identify.html#ga734ab55ebf9bec1bed7e6330def7b6d8" title="Identify sources.">fors_identify</a>(stars, cat, im, NULL);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>         cpl_msg_set_level(before);</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     }    </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     <span class="comment">/* Verify that ID failed */</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     {</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>         <a class="code" href="struct__fors__star.html">fors_star</a> *star;</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>         <span class="keywordflow">for</span> (star = fors_star_list_first(stars);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>              star != NULL;</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>              star = fors_star_list_next(stars)) {</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>             test( star->id == NULL );</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>         }</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     }            </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     cleanup;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> }</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00278"></a><span class="lineno"><a class="code" href="group__fors__identify__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  278</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> {</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     TEST_INIT;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span></div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     <a class="code" href="group__fors__identify__test.html#ga9d562f61b66fedca2d53604fa93c8328" title="Test identification.">test_identify</a>();</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     TEST_END;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> }</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__identify_8c-source.html b/html/fors__identify_8c-source.html
deleted file mode 100644
index 9797149..0000000
--- a/html/fors__identify_8c-source.html
+++ /dev/null
@@ -1,1203 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_identify.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_identify.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_identify.c,v 1.56 2012/01/27 18:53:56 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/01/27 18:53:56 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.56 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_identify.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_pattern.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_point.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_double.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#include <math.h></span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include <assert.h></span>
-<a name="l00045"></a>00045 
-<a name="l00052"></a><a class="code" href="struct__identify__method.html">00052</a> <span class="keyword">struct </span><a class="code" href="struct__identify__method.html">_identify_method</a>
-<a name="l00053"></a>00053 {
-<a name="l00054"></a><a class="code" href="struct__identify__method.html#ad3758417318402dd98eb910e55d35e8">00054</a>     <span class="keywordtype">int</span> <a class="code" href="struct__identify__method.html#ad3758417318402dd98eb910e55d35e8">ncat</a>;
-<a name="l00055"></a><a class="code" href="struct__identify__method.html#6a2f70f5e0e5a3f34bd0a2ee5d001b8e">00055</a>     <span class="keywordtype">double</span> <a class="code" href="struct__identify__method.html#6a2f70f5e0e5a3f34bd0a2ee5d001b8e">nsource</a>;
-<a name="l00056"></a><a class="code" href="struct__identify__method.html#1aae6e461fafcb0388b343e5d94adbe6">00056</a>     <span class="keywordtype">double</span> <a class="code" href="struct__identify__method.html#1aae6e461fafcb0388b343e5d94adbe6">kappa</a>;
-<a name="l00057"></a><a class="code" href="struct__identify__method.html#8fc2dc70bc04cb6ff4404d394febc4b8">00057</a>     <span class="keywordtype">double</span> <a class="code" href="struct__identify__method.html#8fc2dc70bc04cb6ff4404d394febc4b8">search</a>;
-<a name="l00058"></a><a class="code" href="struct__identify__method.html#6dc2396ebd18713f47a577e819f02583">00058</a>     <span class="keywordtype">double</span> <a class="code" href="struct__identify__method.html#6dc2396ebd18713f47a577e819f02583">max_search</a>;
-<a name="l00059"></a><a class="code" href="struct__identify__method.html#d938db4c3b29c4365da3b57bec477970">00059</a>     <span class="keywordtype">double</span> <a class="code" href="struct__identify__method.html#d938db4c3b29c4365da3b57bec477970">max_offset</a>;
-<a name="l00060"></a>00060 };
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00063"></a>00063 <a class="code" href="group__fors__identify.html#gdfc439dadf11b131119fe17cb19f6e25">inside_region</a>(<span class="keyword">const</span> fors_std_star *std,
-<a name="l00064"></a>00064               <span class="keywordtype">void</span> *reg);
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00067"></a>00067 <a class="code" href="group__fors__identify.html#g3c4ce99ce7472d6d48acffcf562b0fb7">match_patterns</a>(<span class="keyword">const</span> fors_star_list *stars, 
-<a name="l00068"></a>00068                <span class="keyword">const</span> fors_std_star_list *std,
-<a name="l00069"></a>00069                <span class="keywordtype">double</span> kappa,
-<a name="l00070"></a>00070                <span class="keywordtype">double</span> *sx_00,
-<a name="l00071"></a>00071                <span class="keywordtype">double</span> *sy_00,
-<a name="l00072"></a>00072                <span class="keywordtype">double</span> *med_scale,
-<a name="l00073"></a>00073                <span class="keywordtype">double</span> *med_angle,
-<a name="l00074"></a>00074                <span class="keywordtype">int</span>    *status);
-<a name="l00075"></a>00075 
-<a name="l00081"></a>00081 <span class="keywordtype">void</span> 
-<a name="l00082"></a><a class="code" href="group__fors__identify.html#g62b335e73ad633535e1494f9ffd0cd03">00082</a> <a class="code" href="group__fors__identify.html#g62b335e73ad633535e1494f9ffd0cd03">fors_identify_define_parameters</a>(cpl_parameterlist *parameters, 
-<a name="l00083"></a>00083                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *context)
-<a name="l00084"></a>00084 {
-<a name="l00085"></a>00085     cpl_parameter *p;
-<a name="l00086"></a>00086     <span class="keyword">const</span> <span class="keywordtype">char</span> *full_name = NULL;
-<a name="l00087"></a>00087     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089 <span class="comment">/* Restore if pattern matching needs to be restored</span>
-<a name="l00090"></a>00090 <span class="comment"></span>
-<a name="l00091"></a>00091 <span class="comment">    name = "ncat";</span>
-<a name="l00092"></a>00092 <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span>
-<a name="l00093"></a>00093 <span class="comment">    p = cpl_parameter_new_value(full_name,</span>
-<a name="l00094"></a>00094 <span class="comment">                                CPL_TYPE_INT,</span>
-<a name="l00095"></a>00095 <span class="comment">                                "Number of catalog stars to use in "</span>
-<a name="l00096"></a>00096 <span class="comment">                                "pattern matching",</span>
-<a name="l00097"></a>00097 <span class="comment">                                context,</span>
-<a name="l00098"></a>00098 <span class="comment">                                10);</span>
-<a name="l00099"></a>00099 <span class="comment">                                         </span>
-<a name="l00100"></a>00100 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span>
-<a name="l00101"></a>00101 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00102"></a>00102 <span class="comment">    cpl_parameterlist_append(parameters, p);</span>
-<a name="l00103"></a>00103 <span class="comment">    cpl_free((void *)full_name);</span>
-<a name="l00104"></a>00104 <span class="comment"></span>
-<a name="l00105"></a>00105 <span class="comment"></span>
-<a name="l00106"></a>00106 <span class="comment">    name = "nsource";</span>
-<a name="l00107"></a>00107 <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span>
-<a name="l00108"></a>00108 <span class="comment">    p = cpl_parameter_new_value(full_name,</span>
-<a name="l00109"></a>00109 <span class="comment">                                CPL_TYPE_DOUBLE,</span>
-<a name="l00110"></a>00110 <span class="comment">                                "Number of sources to use in "</span>
-<a name="l00111"></a>00111 <span class="comment">                                "pattern matching, pr. catalog star",</span>
-<a name="l00112"></a>00112 <span class="comment">                                context,</span>
-<a name="l00113"></a>00113 <span class="comment">                                15.0);</span>
-<a name="l00114"></a>00114 <span class="comment">                                         </span>
-<a name="l00115"></a>00115 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span>
-<a name="l00116"></a>00116 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00117"></a>00117 <span class="comment">    cpl_parameterlist_append(parameters, p);</span>
-<a name="l00118"></a>00118 <span class="comment">    cpl_free((void *)full_name);</span>
-<a name="l00119"></a>00119 <span class="comment"></span>
-<a name="l00120"></a>00120 <span class="comment">    name = "kappa";</span>
-<a name="l00121"></a>00121 <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span>
-<a name="l00122"></a>00122 <span class="comment">    p = cpl_parameter_new_value(full_name,</span>
-<a name="l00123"></a>00123 <span class="comment">                                CPL_TYPE_DOUBLE,</span>
-<a name="l00124"></a>00124 <span class="comment">                                "Rejection parameter (scale, angle) used "</span>
-<a name="l00125"></a>00125 <span class="comment">                                "in pattern matching ",</span>
-<a name="l00126"></a>00126 <span class="comment">                                context,</span>
-<a name="l00127"></a>00127 <span class="comment">                                5.0);</span>
-<a name="l00128"></a>00128 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span>
-<a name="l00129"></a>00129 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00130"></a>00130 <span class="comment">    cpl_parameterlist_append(parameters, p);</span>
-<a name="l00131"></a>00131 <span class="comment">    cpl_free((void *)full_name);</span>
-<a name="l00132"></a>00132 <span class="comment"></span>
-<a name="l00133"></a>00133 <span class="comment">End of restoring if pattern matching has to be restored */</span>
-<a name="l00134"></a>00134     
-<a name="l00135"></a>00135 <span class="comment">/*</span>
-<a name="l00136"></a>00136 <span class="comment"></span>
-<a name="l00137"></a>00137 <span class="comment">    name = "search";</span>
-<a name="l00138"></a>00138 <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span>
-<a name="l00139"></a>00139 <span class="comment">    p = cpl_parameter_new_value(full_name,</span>
-<a name="l00140"></a>00140 <span class="comment">                                CPL_TYPE_DOUBLE,</span>
-<a name="l00141"></a>00141 <span class="comment">                                "Search radius (pixels)",</span>
-<a name="l00142"></a>00142 <span class="comment">                                context,</span>
-<a name="l00143"></a>00143 <span class="comment">                                5.0);</span>
-<a name="l00144"></a>00144 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span>
-<a name="l00145"></a>00145 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00146"></a>00146 <span class="comment">    cpl_parameterlist_append(parameters, p);</span>
-<a name="l00147"></a>00147 <span class="comment">    cpl_free((void *)full_name);</span>
-<a name="l00148"></a>00148 <span class="comment">    </span>
-<a name="l00149"></a>00149 <span class="comment">    name = "maxsearch";</span>
-<a name="l00150"></a>00150 <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span>
-<a name="l00151"></a>00151 <span class="comment">    p = cpl_parameter_new_value(full_name,</span>
-<a name="l00152"></a>00152 <span class="comment">                                CPL_TYPE_DOUBLE,</span>
-<a name="l00153"></a>00153 <span class="comment">                                "Maximum search radius (pixels)",</span>
-<a name="l00154"></a>00154 <span class="comment">                                context,</span>
-<a name="l00155"></a>00155 <span class="comment">                                20.0);</span>
-<a name="l00156"></a>00156 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span>
-<a name="l00157"></a>00157 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00158"></a>00158 <span class="comment">    cpl_parameterlist_append(parameters, p);</span>
-<a name="l00159"></a>00159 <span class="comment">    cpl_free((void *)full_name);</span>
-<a name="l00160"></a>00160 <span class="comment"></span>
-<a name="l00161"></a>00161 <span class="comment">*/</span>
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     name = <span class="stringliteral">"maxoffset"</span>;
-<a name="l00164"></a>00164     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00165"></a>00165     p = cpl_parameter_new_value(full_name,
-<a name="l00166"></a>00166                                 CPL_TYPE_DOUBLE,
-<a name="l00167"></a>00167     <span class="stringliteral">"Maximum acceptable offset between the image and catalogue WCS (pixels)"</span>,
-<a name="l00168"></a>00168                                 context,
-<a name="l00169"></a>00169                                 150.0);
-<a name="l00170"></a>00170     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00171"></a>00171     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00172"></a>00172     cpl_parameterlist_append(parameters, p);
-<a name="l00173"></a>00173     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00174"></a>00174     
-<a name="l00175"></a>00175     <span class="keywordflow">return</span>;
-<a name="l00176"></a>00176 }
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178 <span class="preprocessor">#undef cleanup</span>
-<a name="l00179"></a>00179 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00180"></a>00180 <span class="preprocessor">do { \</span>
-<a name="l00181"></a>00181 <span class="preprocessor">    cpl_free((void *)name); \</span>
-<a name="l00182"></a>00182 <span class="preprocessor">} while (0)</span>
-<a name="l00183"></a>00183 <span class="preprocessor"></span>
-<a name="l00192"></a>00192 identify_method *
-<a name="l00193"></a><a class="code" href="group__fors__identify.html#g2763139bd0ceba14e3be219d5d043e46">00193</a> <a class="code" href="group__fors__identify.html#g2763139bd0ceba14e3be219d5d043e46">fors_identify_method_new</a>(<span class="keyword">const</span> cpl_parameterlist *parameters, <span class="keyword">const</span> <span class="keywordtype">char</span> *context)
-<a name="l00194"></a>00194 {
-<a name="l00195"></a>00195     identify_method *im = cpl_malloc(<span class="keyword">sizeof</span>(*im));
-<a name="l00196"></a>00196     <span class="keyword">const</span> <span class="keywordtype">char</span> *name = NULL;
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198     cpl_msg_info(cpl_func, <span class="stringliteral">"Identification parameters:"</span>);
-<a name="l00199"></a>00199        
-<a name="l00200"></a>00200 <span class="comment">/* Restore if pattern matching to be restored</span>
-<a name="l00201"></a>00201 <span class="comment"></span>
-<a name="l00202"></a>00202 <span class="comment">    cpl_msg_indent_more();</span>
-<a name="l00203"></a>00203 <span class="comment">    name = cpl_sprintf("%s.%s", context, "ncat");</span>
-<a name="l00204"></a>00204 <span class="comment">    im->ncat = dfs_get_parameter_int_const(parameters, name);</span>
-<a name="l00205"></a>00205 <span class="comment">    cpl_free((void *)name); name = NULL;</span>
-<a name="l00206"></a>00206 <span class="comment">    cpl_msg_indent_less();</span>
-<a name="l00207"></a>00207 <span class="comment"></span>
-<a name="l00208"></a>00208 <span class="comment">       </span>
-<a name="l00209"></a>00209 <span class="comment">    cpl_msg_indent_more();</span>
-<a name="l00210"></a>00210 <span class="comment">    name = cpl_sprintf("%s.%s", context, "nsource");</span>
-<a name="l00211"></a>00211 <span class="comment">    im->nsource = dfs_get_parameter_double_const(parameters, name);</span>
-<a name="l00212"></a>00212 <span class="comment">    cpl_free((void *)name); name = NULL;</span>
-<a name="l00213"></a>00213 <span class="comment">    cpl_msg_indent_less();</span>
-<a name="l00214"></a>00214 <span class="comment"></span>
-<a name="l00215"></a>00215 <span class="comment">       </span>
-<a name="l00216"></a>00216 <span class="comment">    cpl_msg_indent_more();</span>
-<a name="l00217"></a>00217 <span class="comment">    name = cpl_sprintf("%s.%s", context, "kappa");</span>
-<a name="l00218"></a>00218 <span class="comment">    im->kappa = dfs_get_parameter_double_const(parameters, name);</span>
-<a name="l00219"></a>00219 <span class="comment">    cpl_free((void *)name); name = NULL;</span>
-<a name="l00220"></a>00220 <span class="comment">    cpl_msg_indent_less();</span>
-<a name="l00221"></a>00221 <span class="comment"></span>
-<a name="l00222"></a>00222 <span class="comment">End of restore if pattern matching to be restored */</span>
-<a name="l00223"></a>00223     
-<a name="l00224"></a>00224 
-<a name="l00225"></a>00225     <span class="comment">// cpl_msg_indent_more();</span>
-<a name="l00226"></a>00226     <span class="comment">// name = cpl_sprintf("%s.%s", context, "search");</span>
-<a name="l00227"></a>00227     im->search = 5.0; <span class="comment">// dfs_get_parameter_double_const(parameters, name);</span>
-<a name="l00228"></a>00228     <span class="comment">// cpl_free((void *)name); name = NULL;</span>
-<a name="l00229"></a>00229     <span class="comment">// cpl_msg_indent_less();</span>
-<a name="l00230"></a>00230     
-<a name="l00231"></a>00231    
-<a name="l00232"></a>00232     <span class="comment">// cpl_msg_indent_more();</span>
-<a name="l00233"></a>00233     <span class="comment">// name = cpl_sprintf("%s.%s", context, "maxsearch");</span>
-<a name="l00234"></a>00234     <span class="comment">// name = cpl_sprintf("%s.%s", context, "search"); // Same value for max search</span>
-<a name="l00235"></a>00235     im->max_search = 5.0; <span class="comment">// dfs_get_parameter_double_const(parameters, name);</span>
-<a name="l00236"></a>00236     <span class="comment">// cpl_free((void *)name); name = NULL;</span>
-<a name="l00237"></a>00237     <span class="comment">// cpl_msg_indent_less();</span>
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240     cpl_msg_indent_more();
-<a name="l00241"></a>00241     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"maxoffset"</span>);
-<a name="l00242"></a>00242     im->max_offset = <a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a>(parameters, name);
-<a name="l00243"></a>00243     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00244"></a>00244     cpl_msg_indent_less();
-<a name="l00245"></a>00245     
-<a name="l00246"></a>00246 
-<a name="l00247"></a>00247     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00248"></a>00248     
-<a name="l00249"></a>00249     <span class="keywordflow">return</span> im;
-<a name="l00250"></a>00250 }
-<a name="l00251"></a>00251 
-<a name="l00255"></a>00255 <span class="keywordtype">void</span>
-<a name="l00256"></a><a class="code" href="group__fors__identify.html#g265af4d62a463db6eea76b808c2a4e8d">00256</a> <a class="code" href="group__fors__identify.html#g265af4d62a463db6eea76b808c2a4e8d">fors_identify_method_delete</a>(identify_method **em)
-<a name="l00257"></a>00257 {
-<a name="l00258"></a>00258     <span class="keywordflow">if</span> (em && *em) {
-<a name="l00259"></a>00259         cpl_free(*em); *em = NULL;
-<a name="l00260"></a>00260     }
-<a name="l00261"></a>00261     <span class="keywordflow">return</span>;
-<a name="l00262"></a>00262 }
-<a name="l00263"></a>00263 
-<a name="l00273"></a>00273 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00274"></a><a class="code" href="group__fors__identify.html#g5e7cadfe27ffb45ccfa00905d520878e">00274</a> <a class="code" href="group__fors__identify.html#g5e7cadfe27ffb45ccfa00905d520878e">std_brighter_than</a>(<span class="keyword">const</span> fors_std_star *s1,
-<a name="l00275"></a>00275                   <span class="keywordtype">void</span> *s2)
-<a name="l00276"></a>00276 {
-<a name="l00277"></a>00277     <span class="keywordflow">return</span> fors_std_star_brighter_than(s1, s2, NULL);
-<a name="l00278"></a>00278 }
-<a name="l00279"></a>00279 
-<a name="l00289"></a>00289 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00290"></a><a class="code" href="group__fors__identify.html#g4a762f4e872e3f797ba890c9d93eb98c">00290</a> <a class="code" href="group__fors__identify.html#g4a762f4e872e3f797ba890c9d93eb98c">star_brighter_than</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s1,
-<a name="l00291"></a>00291                    <span class="keywordtype">void</span> *s2)
-<a name="l00292"></a>00292 {
-<a name="l00293"></a>00293     <span class="keywordflow">return</span> <a class="code" href="group__fors__star.html#g100f4290bf02ce348f22092f4e2bc3eb">fors_star_brighter_than</a>(s1, s2, NULL);
-<a name="l00294"></a>00294 }
-<a name="l00295"></a>00295 
-<a name="l00304"></a>00304 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00305"></a><a class="code" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">00305</a> <a class="code" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">distsq_shift</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s,
-<a name="l00306"></a>00306              <span class="keyword">const</span> fors_std_star *std,
-<a name="l00307"></a>00307              <span class="keywordtype">double</span> shiftx,
-<a name="l00308"></a>00308              <span class="keywordtype">double</span> shifty)
-<a name="l00309"></a>00309 {
-<a name="l00310"></a>00310     fors_point *shifted_pos = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(std->pixel->x + shiftx,
-<a name="l00311"></a>00311                                              std->pixel->y + shifty);
-<a name="l00312"></a>00312     
-<a name="l00313"></a>00313     <span class="keywordtype">double</span> result = <a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>, shifted_pos);
-<a name="l00314"></a>00314     
-<a name="l00315"></a>00315     <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&shifted_pos);
-<a name="l00316"></a>00316     
-<a name="l00317"></a>00317     <span class="keywordflow">return</span> result;
-<a name="l00318"></a>00318 }
-<a name="l00319"></a>00319 
-<a name="l00328"></a>00328 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00329"></a><a class="code" href="group__fors__identify.html#gd13e1eb3050a7a1933760649f74fa14a">00329</a> <a class="code" href="group__fors__identify.html#gd13e1eb3050a7a1933760649f74fa14a">star_nearer</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s1,
-<a name="l00330"></a>00330             <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s2,
-<a name="l00331"></a>00331             <span class="keywordtype">void</span> *data) 
-<a name="l00332"></a>00332 {
-<a name="l00333"></a>00333     <span class="keyword">struct </span>{
-<a name="l00334"></a>00334         <span class="keywordtype">double</span> shift_x, shift_y;
-<a name="l00335"></a>00335         <span class="keyword">const</span> fors_std_star *ref;
-<a name="l00336"></a>00336     } *d = data;
-<a name="l00337"></a>00337     <span class="comment">/* Cast is safe, see caller */</span>
-<a name="l00338"></a>00338     
-<a name="l00339"></a>00339     <span class="keywordflow">return</span> 
-<a name="l00340"></a>00340         <a class="code" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">distsq_shift</a>(s1, d->ref, d->shift_x, d->shift_y) <
-<a name="l00341"></a>00341         <a class="code" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">distsq_shift</a>(s2, d->ref, d->shift_x, d->shift_y);
-<a name="l00342"></a>00342 }
-<a name="l00343"></a>00343 
-<a name="l00344"></a>00344 
-<a name="l00345"></a>00345 <span class="preprocessor">#undef cleanup</span>
-<a name="l00346"></a>00346 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00347"></a>00347 <span class="preprocessor">do { \</span>
-<a name="l00348"></a>00348 <span class="preprocessor">    fors_std_star_list_delete(&std_ccd       , fors_std_star_delete); \</span>
-<a name="l00349"></a>00349 <span class="preprocessor">    fors_std_star_list_delete(&std_ccd_bright, fors_std_star_delete); \</span>
-<a name="l00350"></a>00350 <span class="preprocessor">    fors_star_list_delete(&source_bright, fors_star_delete); \</span>
-<a name="l00351"></a>00351 <span class="preprocessor">} while (0)</span>
-<a name="l00352"></a>00352 <span class="preprocessor"></span>
-<a name="l00371"></a>00371 <span class="keywordtype">void</span>
-<a name="l00372"></a><a class="code" href="group__fors__identify.html#g879f2fc7b296f37722f6203d0ead78b6">00372</a> <a class="code" href="group__fors__identify.html#g879f2fc7b296f37722f6203d0ead78b6">fors_identify</a>(fors_star_list *stars, 
-<a name="l00373"></a>00373               fors_std_star_list *cat,
-<a name="l00374"></a>00374               <span class="keyword">const</span> identify_method *im,
-<a name="l00375"></a>00375               cpl_image **histogram)
-<a name="l00376"></a>00376 {
-<a name="l00377"></a>00377     fors_std_star_list *std_ccd = NULL;  <span class="comment">/* Subset of catalog stars</span>
-<a name="l00378"></a>00378 <span class="comment">                                            which are inside the CCD */</span>
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     fors_std_star_list *std_ccd_bright = NULL; <span class="comment">/* Brightest std stars */</span>
-<a name="l00381"></a>00381 
-<a name="l00382"></a>00382     fors_star_list *source_bright  = NULL;     <span class="comment">/* Subset of brightest stars */</span>
-<a name="l00383"></a>00383 
-<a name="l00384"></a>00384     <span class="keywordtype">double</span> offset = 0.0;
-<a name="l00385"></a>00385     <span class="keywordtype">double</span> sx_00, sy_00;
-<a name="l00386"></a>00386     <span class="keywordtype">int</span> status;
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388     <span class="keywordflow">if</span> (histogram)
-<a name="l00389"></a>00389         *histogram = NULL;
-<a name="l00390"></a>00390 
-<a name="l00391"></a>00391     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( stars != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393     cpl_msg_info(cpl_func, <span class="stringliteral">"Identifying sources"</span>);
-<a name="l00394"></a>00394     cpl_msg_indent_more();
-<a name="l00395"></a>00395 
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397     <span class="comment">/*</span>
-<a name="l00398"></a>00398 <span class="comment">      fors_star_print_list(CPL_MSG_ERROR, stars);</span>
-<a name="l00399"></a>00399 <span class="comment">      fors_std_star_print_list(CPL_MSG_ERROR, cat); </span>
-<a name="l00400"></a>00400 <span class="comment">     */</span>
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     cpl_msg_info(cpl_func, <span class="stringliteral">"Pattern matching"</span>);
-<a name="l00403"></a>00403     cpl_msg_indent_more();
-<a name="l00404"></a>00404 
-<a name="l00405"></a>00405     <span class="comment">/* Select standards inside CCD */</span>
-<a name="l00406"></a>00406     {
-<a name="l00407"></a>00407         <span class="keywordtype">double</span> tolerance = 100; <span class="comment">/* pixels */</span>
-<a name="l00408"></a>00408         <span class="keyword">struct </span>{
-<a name="l00409"></a>00409             <span class="keywordtype">int</span> xlo, ylo;
-<a name="l00410"></a>00410             <span class="keywordtype">int</span> xhi, yhi;
-<a name="l00411"></a>00411         } region;
-<a name="l00412"></a>00412         <span class="keywordflow">if</span> (fors_star_list_size(stars) > 0) {
-<a name="l00413"></a>00413             region.xlo = <a class="code" href="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0">fors_star_get_x</a>(fors_star_list_min_val(stars,
-<a name="l00414"></a>00414                     <a class="code" href="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0">fors_star_get_x</a>,
-<a name="l00415"></a>00415                     NULL), NULL) - tolerance;
-<a name="l00416"></a>00416             region.ylo = <a class="code" href="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e">fors_star_get_y</a>(fors_star_list_min_val(stars,
-<a name="l00417"></a>00417                     <a class="code" href="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e">fors_star_get_y</a>,
-<a name="l00418"></a>00418                     NULL), NULL) - tolerance;
-<a name="l00419"></a>00419             region.xhi = <a class="code" href="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0">fors_star_get_x</a>(fors_star_list_max_val(stars,
-<a name="l00420"></a>00420                     <a class="code" href="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0">fors_star_get_x</a>,
-<a name="l00421"></a>00421                     NULL), NULL) + tolerance;
-<a name="l00422"></a>00422             region.yhi = <a class="code" href="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e">fors_star_get_y</a>(fors_star_list_max_val(stars,
-<a name="l00423"></a>00423                     <a class="code" href="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e">fors_star_get_y</a>,
-<a name="l00424"></a>00424                     NULL), NULL) + tolerance;
-<a name="l00425"></a>00425 
-<a name="l00426"></a>00426         } <span class="keywordflow">else</span> {
-<a name="l00427"></a>00427             region.xlo = 1;
-<a name="l00428"></a>00428             region.ylo = 1;
-<a name="l00429"></a>00429             region.xhi = 1000; <span class="comment">/* Anything can go here, not used */</span>
-<a name="l00430"></a>00430             region.yhi = 1000;
-<a name="l00431"></a>00431         }
-<a name="l00432"></a>00432         cpl_msg_debug(cpl_func, <span class="stringliteral">"Search region = (%d, %d) - (%d, %d)"</span>,
-<a name="l00433"></a>00433                       region.xlo, region.ylo,
-<a name="l00434"></a>00434                       region.xhi, region.yhi);
-<a name="l00435"></a>00435 
-<a name="l00436"></a>00436         std_ccd = fors_std_star_list_extract(
-<a name="l00437"></a>00437                 cat, fors_std_star_duplicate, <a class="code" href="group__fors__identify.html#gdfc439dadf11b131119fe17cb19f6e25">inside_region</a>, &region);
-<a name="l00438"></a>00438 
-<a name="l00439"></a>00439         <span class="keywordtype">int</span> multiple_entries = 0;
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441         <span class="keywordflow">if</span> (fors_std_star_list_size(std_ccd) > 1) {
-<a name="l00442"></a>00442             <span class="keywordtype">bool</span> found_double;
-<a name="l00443"></a>00443             <span class="keywordflow">do</span> {
-<a name="l00444"></a>00444                 found_double = <span class="keyword">false</span>;
-<a name="l00445"></a>00445 
-<a name="l00446"></a>00446                 <span class="comment">/* Searching for the nearest neighbour will permute the list,</span>
-<a name="l00447"></a>00447 <span class="comment">                   do not do that while iterating the same list */</span>
-<a name="l00448"></a>00448                 fors_std_star_list *tmp = 
-<a name="l00449"></a>00449                         fors_std_star_list_duplicate(std_ccd,
-<a name="l00450"></a>00450                                 fors_std_star_duplicate);
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452                 cpl_msg_debug(cpl_func, <span class="stringliteral">"%d stars left"</span>, fors_std_star_list_size(tmp));
-<a name="l00453"></a>00453 
-<a name="l00454"></a>00454                 fors_std_star *std;
-<a name="l00455"></a>00455 
-<a name="l00456"></a>00456                 <span class="keywordflow">for</span> (std = fors_std_star_list_first(tmp);
-<a name="l00457"></a>00457                         std != NULL && !found_double;
-<a name="l00458"></a>00458                         std = fors_std_star_list_next(tmp)) {
-<a name="l00459"></a>00459 
-<a name="l00460"></a>00460                     fors_std_star *<span class="keyword">self</span> = fors_std_star_list_kth_val(
-<a name="l00461"></a>00461                             std_ccd, 1,
-<a name="l00462"></a>00462                             (fors_std_star_list_func_eval)
-<a name="l00463"></a>00463                             fors_std_star_dist_arcsec,
-<a name="l00464"></a>00464                             std);
-<a name="l00465"></a>00465 
-<a name="l00466"></a>00466                     fors_std_star *nn = fors_std_star_list_kth_val(
-<a name="l00467"></a>00467                             std_ccd, 2,
-<a name="l00468"></a>00468                             (fors_std_star_list_func_eval)
-<a name="l00469"></a>00469                             fors_std_star_dist_arcsec,
-<a name="l00470"></a>00470                             std);
-<a name="l00471"></a>00471 
-<a name="l00472"></a>00472                     <span class="keywordtype">double</span> min_dist = fors_std_star_dist_arcsec(std, nn);
-<a name="l00473"></a>00473 
-<a name="l00474"></a>00474                     cpl_msg_debug(cpl_func, <span class="stringliteral">"dist = %f arcseconds"</span>, min_dist);
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476                     <span class="comment">/* If very close, remove the one with the largest magnitude</span>
-<a name="l00477"></a>00477 <span class="comment">                       error. </span>
-<a name="l00478"></a>00478 <span class="comment"></span>
-<a name="l00479"></a>00479 <span class="comment">                       Do not try to combine the two magnitudes because</span>
-<a name="l00480"></a>00480 <span class="comment">                       those estimates may or may not be correlated </span>
-<a name="l00481"></a>00481 <span class="comment">                     */</span>
-<a name="l00482"></a>00482                     <span class="keywordflow">if</span> (min_dist < 5) {
-<a name="l00483"></a>00483                         multiple_entries += 1;
-<a name="l00484"></a>00484 
-<a name="l00485"></a>00485                         <span class="keywordflow">if</span> (std->dmagnitude > nn->dmagnitude) {
-<a name="l00486"></a>00486                             fors_std_star_list_remove(std_ccd, <span class="keyword">self</span>);
-<a name="l00487"></a>00487                             fors_std_star_delete(&<span class="keyword">self</span>);
-<a name="l00488"></a>00488                         } <span class="keywordflow">else</span> {
-<a name="l00489"></a>00489                             fors_std_star_list_remove(std_ccd, nn);
-<a name="l00490"></a>00490                             fors_std_star_delete(&nn);
-<a name="l00491"></a>00491                         }
-<a name="l00492"></a>00492                         found_double = <span class="keyword">true</span>;
-<a name="l00493"></a>00493                     }
-<a name="l00494"></a>00494                 }
-<a name="l00495"></a>00495 
-<a name="l00496"></a>00496                 fors_std_star_list_delete(&tmp,
-<a name="l00497"></a>00497                                           fors_std_star_delete);
-<a name="l00498"></a>00498 
-<a name="l00499"></a>00499             } <span class="keywordflow">while</span> (found_double);
-<a name="l00500"></a>00500         }
-<a name="l00501"></a>00501 
-<a name="l00502"></a>00502         cpl_msg_info(cpl_func, 
-<a name="l00503"></a>00503                      <span class="stringliteral">"%d catalog star%s are expected inside detector, "</span>
-<a name="l00504"></a>00504                      <span class="stringliteral">"ignored %d repeated source%s"</span>,
-<a name="l00505"></a>00505                      fors_std_star_list_size(std_ccd),
-<a name="l00506"></a>00506                      fors_std_star_list_size(std_ccd) == 1 ? <span class="stringliteral">""</span> : <span class="stringliteral">"s"</span>,
-<a name="l00507"></a>00507                      multiple_entries,
-<a name="l00508"></a>00508                      multiple_entries == 1 ? <span class="stringliteral">""</span> : <span class="stringliteral">"s"</span>);
-<a name="l00509"></a>00509     }
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511 
-<a name="l00512"></a>00512     <span class="keywordflow">if</span> (0) {
-<a name="l00513"></a>00513         <span class="comment">/* Select brightest std */</span>
-<a name="l00514"></a>00514         <span class="keywordflow">if</span> (fors_std_star_list_size(std_ccd) <= im->ncat) {
-<a name="l00515"></a>00515             std_ccd_bright = fors_std_star_list_duplicate(std_ccd,
-<a name="l00516"></a>00516                     fors_std_star_duplicate);
-<a name="l00517"></a>00517         }
-<a name="l00518"></a>00518         <span class="keywordflow">else</span> {
-<a name="l00519"></a>00519             fors_std_star *<a class="code" href="group__multiset.html#ge1f21da53f4a26ca9dd7e25f19286408">kth</a> =
-<a name="l00520"></a>00520                     fors_std_star_list_kth(std_ccd,
-<a name="l00521"></a>00521                             im->ncat + 1,
-<a name="l00522"></a>00522                             fors_std_star_brighter_than, NULL);
-<a name="l00523"></a>00523 
-<a name="l00524"></a>00524             <span class="comment">//fors_std_star_print_list(std_ccd);</span>
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526             std_ccd_bright = fors_std_star_list_extract(
-<a name="l00527"></a>00527                     std_ccd, fors_std_star_duplicate, 
-<a name="l00528"></a>00528                     <a class="code" href="group__fors__identify.html#g5e7cadfe27ffb45ccfa00905d520878e">std_brighter_than</a>, kth);
-<a name="l00529"></a>00529         }
-<a name="l00530"></a>00530 
-<a name="l00531"></a>00531         <span class="keywordflow">if</span> (fors_std_star_list_size(std_ccd_bright) < 3) {
-<a name="l00532"></a>00532 
-<a name="l00533"></a>00533             cpl_msg_warning(cpl_func, 
-<a name="l00534"></a>00534                     <span class="stringliteral">"Too few catalog stars (%d) available for pattern "</span>
-<a name="l00535"></a>00535                     <span class="stringliteral">"matching, assuming FITS header WCS solution"</span>,
-<a name="l00536"></a>00536                     fors_std_star_list_size(std_ccd_bright));
-<a name="l00537"></a>00537 
-<a name="l00538"></a>00538             sx_00 = 0;
-<a name="l00539"></a>00539             sy_00 = 0;
-<a name="l00540"></a>00540         }
-<a name="l00541"></a>00541         <span class="keywordflow">else</span> {
-<a name="l00542"></a>00542 
-<a name="l00543"></a>00543             <span class="keywordtype">double</span> med_scale, med_angle;
-<a name="l00544"></a>00544 
-<a name="l00545"></a>00545             cpl_msg_info(cpl_func, <span class="stringliteral">"Using %d brightest standards"</span>,
-<a name="l00546"></a>00546                          fors_std_star_list_size(std_ccd_bright));
-<a name="l00547"></a>00547 
-<a name="l00548"></a>00548             fors_std_star_print_list(CPL_MSG_DEBUG, std_ccd_bright);
-<a name="l00549"></a>00549 
-<a name="l00550"></a>00550             <span class="comment">/* Select sources */</span>
-<a name="l00551"></a>00551             <span class="keywordtype">int</span> n_sources = 
-<a name="l00552"></a>00552                     (int) (fors_std_star_list_size(std_ccd_bright)*im->nsource + 0.5);
-<a name="l00553"></a>00553 
-<a name="l00554"></a>00554             <span class="keywordflow">if</span> (fors_star_list_size(stars) <= n_sources) {
-<a name="l00555"></a>00555                 source_bright = fors_star_list_duplicate(stars,
-<a name="l00556"></a>00556                         <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>);
-<a name="l00557"></a>00557             }
-<a name="l00558"></a>00558             <span class="keywordflow">else</span> {
-<a name="l00559"></a>00559                 <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__multiset.html#ge1f21da53f4a26ca9dd7e25f19286408">kth</a> =
-<a name="l00560"></a>00560                         fors_star_list_kth(stars,
-<a name="l00561"></a>00561                                 n_sources + 1,
-<a name="l00562"></a>00562                                 <a class="code" href="group__fors__star.html#g100f4290bf02ce348f22092f4e2bc3eb">fors_star_brighter_than</a>, NULL);
-<a name="l00563"></a>00563 
-<a name="l00564"></a>00564                 source_bright = fors_star_list_extract(
-<a name="l00565"></a>00565                         stars, <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>,
-<a name="l00566"></a>00566                         <a class="code" href="group__fors__identify.html#g4a762f4e872e3f797ba890c9d93eb98c">star_brighter_than</a>, <a class="code" href="group__multiset.html#ge1f21da53f4a26ca9dd7e25f19286408">kth</a>);
-<a name="l00567"></a>00567             }
-<a name="l00568"></a>00568 
-<a name="l00569"></a>00569             cpl_msg_info(cpl_func, <span class="stringliteral">"Using %d brightest sources"</span>, 
-<a name="l00570"></a>00570                          fors_star_list_size(source_bright));
-<a name="l00571"></a>00571             <a class="code" href="group__fors__star.html#g8ab50c70291d9ed66d075ce9ae93577d">fors_star_print_list</a>(CPL_MSG_DEBUG, source_bright);
-<a name="l00572"></a>00572 
-<a name="l00573"></a>00573 
-<a name="l00574"></a>00574             status = 0;
-<a name="l00575"></a>00575             <a class="code" href="group__fors__identify.html#g3c4ce99ce7472d6d48acffcf562b0fb7">match_patterns</a>(source_bright, std_ccd_bright,
-<a name="l00576"></a>00576                            im->kappa,
-<a name="l00577"></a>00577                            &sx_00, &sy_00, &med_scale, &med_angle, &status);
-<a name="l00578"></a>00578 
-<a name="l00579"></a>00579             <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Pattern matching failed"</span> );
-<a name="l00580"></a>00580 
-<a name="l00581"></a>00581 
-<a name="l00582"></a>00582             <span class="keywordflow">if</span> (status) {
-<a name="l00583"></a>00583                 cpl_msg_warning(cpl_func, 
-<a name="l00584"></a>00584                         <span class="stringliteral">"BAD pattern matching solution rejected."</span>);
-<a name="l00585"></a>00585 
-<a name="l00586"></a>00586                 <span class="keywordflow">if</span> (med_scale > 1.1 || med_scale < 0.9) {
-<a name="l00587"></a>00587                     cpl_msg_warning(cpl_func, <span class="stringliteral">"Unexpected scale from pattern "</span>
-<a name="l00588"></a>00588                             <span class="stringliteral">"matching (expected 1.0): assuming FITS header WCS solution"</span>);
-<a name="l00589"></a>00589                 }
-<a name="l00590"></a>00590 
-<a name="l00591"></a>00591                 offset = sqrt(sx_00 * sx_00 + sy_00 * sy_00);
-<a name="l00592"></a>00592 
-<a name="l00593"></a>00593                 <span class="keywordflow">if</span> (offset > im->max_offset) {
-<a name="l00594"></a>00594                     cpl_msg_warning(cpl_func, <span class="stringliteral">"Pattern matching identifications "</span>
-<a name="l00595"></a>00595                             <span class="stringliteral">"are more than %.2f pixel off their expected positions (max "</span>
-<a name="l00596"></a>00596                             <span class="stringliteral">"allowed was: %.2f). Pattern matching solution is rejected, "</span>
-<a name="l00597"></a>00597                             <span class="stringliteral">"FITS header WCS solution is used instead!"</span>, offset, 
-<a name="l00598"></a>00598                             im->max_offset);
-<a name="l00599"></a>00599                 }
-<a name="l00600"></a>00600 
-<a name="l00601"></a>00601                 sx_00 = 0;
-<a name="l00602"></a>00602                 sy_00 = 0;
-<a name="l00603"></a>00603             }
-<a name="l00604"></a>00604         }
-<a name="l00605"></a>00605         cpl_msg_indent_less();
-<a name="l00606"></a>00606 
-<a name="l00607"></a>00607         cpl_msg_info(cpl_func, 
-<a name="l00608"></a>00608                      <span class="stringliteral">"Average shift from pattern matching = (%.2f, %.2f) pixels"</span>, 
-<a name="l00609"></a>00609                      sx_00, sy_00);
-<a name="l00610"></a>00610     }
-<a name="l00611"></a>00611 
-<a name="l00612"></a>00612     <span class="comment">/*</span>
-<a name="l00613"></a>00613 <span class="comment">     * Begin here alternative algorithm to pattern matching</span>
-<a name="l00614"></a>00614 <span class="comment">     */</span>
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616     <span class="keywordtype">double</span>               search_radius = im->max_offset;
-<a name="l00617"></a>00617     <span class="keyword">const</span> fors_std_star *catalog_star;
-<a name="l00618"></a>00618     <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a>     *ccd_star;
-<a name="l00619"></a>00619     <span class="keywordtype">float</span>                dx, dy;
-<a name="l00620"></a>00620     <span class="keywordtype">int</span>                  npix = (2 * search_radius + 1);
-<a name="l00621"></a>00621     cpl_image           *histo = cpl_image_new(npix, npix, CPL_TYPE_INT);
-<a name="l00622"></a>00622     <span class="keywordtype">int</span>                 *dhisto = cpl_image_get_data(histo);
-<a name="l00623"></a>00623     cpl_size             xpos, ypos;
-<a name="l00624"></a>00624     <span class="keywordtype">int</span>                  i, rebin, max;
-<a name="l00625"></a>00625     <span class="keywordtype">int</span>                  found = 0;
-<a name="l00626"></a>00626 
-<a name="l00627"></a>00627     <span class="keywordflow">for</span> (catalog_star = fors_std_star_list_first_const(std_ccd);
-<a name="l00628"></a>00628             catalog_star != NULL;
-<a name="l00629"></a>00629             catalog_star = fors_std_star_list_next_const(std_ccd)) {
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631         <span class="keywordflow">for</span> (ccd_star = fors_star_list_first_const(stars);
-<a name="l00632"></a>00632                 ccd_star != NULL;
-<a name="l00633"></a>00633                 ccd_star = fors_star_list_next_const(stars)) {
-<a name="l00634"></a>00634 
-<a name="l00635"></a>00635             dx = catalog_star->pixel->x - ccd_star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x;
-<a name="l00636"></a>00636             dy = catalog_star->pixel->y - ccd_star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y;
-<a name="l00637"></a>00637 
-<a name="l00638"></a>00638             if (fabs(dx) < search_radius) {
-<a name="l00639"></a>00639                 <span class="keywordflow">if</span> (fabs(dy) < search_radius) {
-<a name="l00640"></a>00640                     xpos = search_radius + floor(dx + 0.5);
-<a name="l00641"></a>00641                     ypos = search_radius + floor(dy + 0.5);
-<a name="l00642"></a>00642                     ++dhisto[xpos + ypos * npix];
-<a name="l00643"></a>00643                 }
-<a name="l00644"></a>00644             }
-<a name="l00645"></a>00645         }
-<a name="l00646"></a>00646     }
-<a name="l00647"></a>00647 
-<a name="l00648"></a>00648     max = 0;
-<a name="l00649"></a>00649     <span class="keywordflow">for</span> (i = 0; i < npix * npix; i++) {
-<a name="l00650"></a>00650         <span class="keywordflow">if</span> (max < dhisto[i]) {
-<a name="l00651"></a>00651             max = dhisto[i];
-<a name="l00652"></a>00652         }
-<a name="l00653"></a>00653     }
-<a name="l00654"></a>00654 
-<a name="l00655"></a>00655     <span class="keywordflow">if</span> (max == 0) {
-<a name="l00656"></a>00656         cpl_msg_warning(cpl_func, 
-<a name="l00657"></a>00657                 <span class="stringliteral">"WCS offset determination failed."</span>);
-<a name="l00658"></a>00658         sx_00 = 0.0;
-<a name="l00659"></a>00659         sy_00 = 0.0;
-<a name="l00660"></a>00660     }
-<a name="l00661"></a>00661     <span class="keywordflow">else</span> {
-<a name="l00662"></a>00662         rebin = 0;
-<a name="l00663"></a>00663         <span class="keywordflow">for</span> (i = 0; i < npix * npix; i++) {
-<a name="l00664"></a>00664             <span class="keywordflow">if</span> (max == dhisto[i]) {
-<a name="l00665"></a>00665                 <span class="keywordflow">if</span> (found) {
-<a name="l00666"></a>00666                     cpl_image *rebinned;
-<a name="l00667"></a>00667                     found = 2;
-<a name="l00668"></a>00668                     rebin = 1;
-<a name="l00669"></a>00669                     cpl_msg_warning(cpl_func,
-<a name="l00670"></a>00670                                     <span class="stringliteral">"More than one WCS offset found, try rebinning..."</span>);
-<a name="l00671"></a>00671                     rebinned = cpl_image_rebin(histo, 1, 1, 3, 3);
-<a name="l00672"></a>00672                     cpl_image_delete(histo);
-<a name="l00673"></a>00673                     histo = rebinned;
-<a name="l00674"></a>00674                     dhisto = cpl_image_get_data(histo);
-<a name="l00675"></a>00675                     npix = cpl_image_get_size_x(histo);
-<a name="l00676"></a>00676                     search_radius /= 3;
-<a name="l00677"></a>00677                     <span class="keywordflow">break</span>;
-<a name="l00678"></a>00678                 }
-<a name="l00679"></a>00679                 <span class="keywordflow">else</span> {
-<a name="l00680"></a>00680                     found = 1;
-<a name="l00681"></a>00681                 }
-<a name="l00682"></a>00682             }
-<a name="l00683"></a>00683         }
-<a name="l00684"></a>00684 
-<a name="l00685"></a>00685         <span class="keywordflow">if</span> (found > 1) {
-<a name="l00686"></a>00686             found = max = 0;
-<a name="l00687"></a>00687             <span class="keywordflow">for</span> (i = 0; i < npix * npix; i++) {
-<a name="l00688"></a>00688                 <span class="keywordflow">if</span> (max < dhisto[i]) {
-<a name="l00689"></a>00689                     max = dhisto[i];
-<a name="l00690"></a>00690                 }
-<a name="l00691"></a>00691             }
-<a name="l00692"></a>00692 
-<a name="l00693"></a>00693             <span class="keywordflow">for</span> (i = 0; i < npix * npix; i++) {
-<a name="l00694"></a>00694                 <span class="keywordflow">if</span> (max == dhisto[i]) {
-<a name="l00695"></a>00695                     <span class="keywordflow">if</span> (found) {
-<a name="l00696"></a>00696 
-<a name="l00697"></a>00697                         <span class="comment">/*</span>
-<a name="l00698"></a>00698 <span class="comment">                         * Check if connected to previously found maxima</span>
-<a name="l00699"></a>00699 <span class="comment">                         */</span>
-<a name="l00700"></a>00700 
-<a name="l00701"></a>00701                         <span class="keywordtype">int</span> connected = 0;
-<a name="l00702"></a>00702 
-<a name="l00703"></a>00703                         <span class="keywordflow">if</span> (i > 0) {
-<a name="l00704"></a>00704                             <span class="keywordflow">if</span> (max == dhisto[i-1]) {
-<a name="l00705"></a>00705                                 connected = 1;
-<a name="l00706"></a>00706                             }
-<a name="l00707"></a>00707                         }
-<a name="l00708"></a>00708                         <span class="keywordflow">if</span> (i > npix) {
-<a name="l00709"></a>00709                             <span class="keywordflow">if</span> (max == dhisto[i-npix-1] || 
-<a name="l00710"></a>00710                                     max == dhisto[i-npix]   ||
-<a name="l00711"></a>00711                                     max == dhisto[i-npix+1]) {
-<a name="l00712"></a>00712                                 connected = 1;
-<a name="l00713"></a>00713                             }
-<a name="l00714"></a>00714                         }
-<a name="l00715"></a>00715 
-<a name="l00716"></a>00716                         <span class="keywordflow">if</span> (!connected) {
-<a name="l00717"></a>00717                             found = 2;
-<a name="l00718"></a>00718                             cpl_msg_warning(cpl_func,
-<a name="l00719"></a>00719                                             <span class="stringliteral">"WCS offset determination failed."</span>);
-<a name="l00720"></a>00720                             sx_00 = 0.0;
-<a name="l00721"></a>00721                             sy_00 = 0.0;
-<a name="l00722"></a>00722                             <span class="keywordflow">break</span>;
-<a name="l00723"></a>00723                         }
-<a name="l00724"></a>00724                     }
-<a name="l00725"></a>00725                     <span class="keywordflow">else</span> {
-<a name="l00726"></a>00726                         found = 1;
-<a name="l00727"></a>00727                     }
-<a name="l00728"></a>00728                 }
-<a name="l00729"></a>00729             }
-<a name="l00730"></a>00730         }
-<a name="l00731"></a>00731     }
-<a name="l00732"></a>00732 
-<a name="l00733"></a>00733     <span class="keywordflow">if</span> (found == 1) {
-<a name="l00734"></a>00734         cpl_image_get_maxpos(histo, &xpos, &ypos);
-<a name="l00735"></a>00735         xpos--;
-<a name="l00736"></a>00736         ypos--;
-<a name="l00737"></a>00737 
-<a name="l00738"></a>00738         <span class="comment">/*</span>
-<a name="l00739"></a>00739 <span class="comment">         * Refine peak position</span>
-<a name="l00740"></a>00740 <span class="comment">         */</span>
-<a name="l00741"></a>00741 
-<a name="l00742"></a>00742         <span class="keywordtype">float</span> xmean = 0.0;
-<a name="l00743"></a>00743         <span class="keywordtype">float</span> ymean = 0.0;
-<a name="l00744"></a>00744         <span class="keywordtype">int</span>   i, j, count = 0;
-<a name="l00745"></a>00745 
-<a name="l00746"></a>00746         <span class="keywordflow">for</span> (i = xpos - 1; i <= xpos; i++) {
-<a name="l00747"></a>00747             <span class="keywordflow">for</span> (j = ypos - 1; j <= ypos; j++) {
-<a name="l00748"></a>00748                 <span class="keywordflow">if</span> (i >= 0 && i < npix) {
-<a name="l00749"></a>00749                     <span class="keywordflow">if</span> (j >= 0 && j < npix) {
-<a name="l00750"></a>00750                         xmean += i * dhisto[i + j*npix];
-<a name="l00751"></a>00751                         ymean += j * dhisto[i + j*npix];
-<a name="l00752"></a>00752                         count += dhisto[i + j*npix];
-<a name="l00753"></a>00753                     }
-<a name="l00754"></a>00754                 }
-<a name="l00755"></a>00755             }
-<a name="l00756"></a>00756         }
-<a name="l00757"></a>00757 
-<a name="l00758"></a>00758         sx_00 = search_radius - xmean / count - 0.5;
-<a name="l00759"></a>00759         sy_00 = search_radius - ymean / count - 0.5;
-<a name="l00760"></a>00760 
-<a name="l00761"></a>00761         <span class="keywordflow">if</span> (rebin) {
-<a name="l00762"></a>00762             sx_00 *= 3;
-<a name="l00763"></a>00763             sy_00 *= 3;
-<a name="l00764"></a>00764         }
-<a name="l00765"></a>00765 
-<a name="l00766"></a>00766         <span class="comment">/*</span>
-<a name="l00767"></a>00767 <span class="comment">        cpl_msg_info(cpl_func, </span>
-<a name="l00768"></a>00768 <span class="comment">                 "Average shift from histogram method = (%.2f, %.2f) pixels", </span>
-<a name="l00769"></a>00769 <span class="comment">                 sx_00, sy_00);</span>
-<a name="l00770"></a>00770 <span class="comment">         */</span>
-<a name="l00771"></a>00771 
-<a name="l00772"></a>00772         <span class="comment">//        cpl_image_save(histo, "histogram.fits", CPL_BPP_32_SIGNED, NULL,</span>
-<a name="l00773"></a>00773         <span class="comment">//                       CPL_IO_DEFAULT);</span>
-<a name="l00774"></a>00774         <span class="comment">//</span>
-<a name="l00775"></a>00775         <span class="comment">//        cpl_image_delete(histo);</span>
-<a name="l00776"></a>00776     }
-<a name="l00777"></a>00777 
-<a name="l00778"></a>00778     <span class="keywordflow">if</span> (histogram) 
-<a name="l00779"></a>00779         *histogram = histo;
-<a name="l00780"></a>00780     <span class="keywordflow">else</span>
-<a name="l00781"></a>00781         cpl_image_delete(histo);
-<a name="l00782"></a>00782 
-<a name="l00783"></a>00783     offset = sqrt(sx_00 * sx_00 + sy_00 * sy_00);
-<a name="l00784"></a>00784 
-<a name="l00785"></a>00785     <span class="keywordflow">if</span> (offset > im->max_offset) {
-<a name="l00786"></a>00786         cpl_msg_warning(cpl_func, <span class="stringliteral">"Offset with respect to WCS is %.2f pixel "</span>
-<a name="l00787"></a>00787                 <span class="stringliteral">"(max allowed was: %.2f). This offset is rejected."</span>,
-<a name="l00788"></a>00788                 offset, im->max_offset);
-<a name="l00789"></a>00789 
-<a name="l00790"></a>00790         sx_00 = 0;
-<a name="l00791"></a>00791         sy_00 = 0;
-<a name="l00792"></a>00792     }
-<a name="l00793"></a>00793 
-<a name="l00794"></a>00794     <span class="comment">/*</span>
-<a name="l00795"></a>00795 <span class="comment">     * End here alternative algorithm to pattern matching</span>
-<a name="l00796"></a>00796 <span class="comment">     */</span>
-<a name="l00797"></a>00797 
-<a name="l00798"></a>00798     <span class="comment">/* Finally, make the identification if a unique source is found </span>
-<a name="l00799"></a>00799 <span class="comment">       within the corrected position search radius.</span>
-<a name="l00800"></a>00800 <span class="comment"></span>
-<a name="l00801"></a>00801 <span class="comment">       Use all catalog stars (inside CCD).</span>
-<a name="l00802"></a>00802 <span class="comment">     */</span>
-<a name="l00803"></a>00803 
-<a name="l00804"></a>00804     <span class="keywordflow">if</span> (sx_00 == 0.0 && sy_00 == 0.0) {
-<a name="l00805"></a>00805         cpl_msg_warning(cpl_func, <span class="stringliteral">"No standard star could be identified."</span>);
-<a name="l00806"></a>00806         cpl_msg_indent_less();
-<a name="l00807"></a>00807         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00808"></a>00808         <span class="keywordflow">return</span>;
-<a name="l00809"></a>00809     }
-<a name="l00810"></a>00810 
-<a name="l00811"></a>00811     <span class="keywordtype">int</span> number_of_ids = 0;
-<a name="l00812"></a>00812     <span class="keywordtype">bool</span> require_unique = <span class="keyword">true</span>;
-<a name="l00813"></a>00813     search_radius = im->search;
-<a name="l00814"></a>00814 
-<a name="l00815"></a>00815     <span class="keywordflow">while</span> (number_of_ids == 0 && search_radius <= im->max_search) {
-<a name="l00816"></a>00816 
-<a name="l00817"></a>00817         cpl_msg_info(cpl_func, <span class="stringliteral">"Identification"</span>);
-<a name="l00818"></a>00818 
-<a name="l00819"></a>00819         cpl_msg_indent_more();
-<a name="l00820"></a>00820         cpl_msg_info(cpl_func, <span class="stringliteral">"Average shift with WCS = (%.2f, %.2f) pixels"</span>,
-<a name="l00821"></a>00821                      sx_00,
-<a name="l00822"></a>00822                      sy_00);
-<a name="l00823"></a>00823 
-<a name="l00824"></a>00824         <span class="keywordflow">if</span> (fabs(sx_00) > 10.0) {
-<a name="l00825"></a>00825             cpl_msg_warning(cpl_func, <span class="stringliteral">"Large x-shift"</span>);
-<a name="l00826"></a>00826         }
-<a name="l00827"></a>00827         <span class="keywordflow">if</span> (fabs(sy_00) > 10.0) {
-<a name="l00828"></a>00828             cpl_msg_warning(cpl_func, <span class="stringliteral">"Large y-shift"</span>);
-<a name="l00829"></a>00829         }
-<a name="l00830"></a>00830 
-<a name="l00831"></a>00831         cpl_msg_info(cpl_func, <span class="stringliteral">"search_radius = %.2f pixels"</span>, search_radius);
-<a name="l00832"></a>00832 
-<a name="l00833"></a>00833         <span class="keyword">struct </span>{
-<a name="l00834"></a>00834             <span class="keywordtype">double</span> shift_x, shift_y;
-<a name="l00835"></a>00835             <span class="keyword">const</span> fors_std_star *ref;
-<a name="l00836"></a>00836         } data;
-<a name="l00837"></a>00837 
-<a name="l00838"></a>00838         data.shift_x = sx_00;
-<a name="l00839"></a>00839         data.shift_y = sy_00;
-<a name="l00840"></a>00840 
-<a name="l00841"></a>00841         <span class="keywordflow">if</span> (fors_star_list_size(stars) > 0) {
-<a name="l00842"></a>00842             <span class="keywordflow">for</span> (data.ref = fors_std_star_list_first_const(std_ccd);
-<a name="l00843"></a>00843                     data.ref != NULL;
-<a name="l00844"></a>00844                     data.ref = fors_std_star_list_next_const(std_ccd)) {
-<a name="l00845"></a>00845 
-<a name="l00846"></a>00846                 <a class="code" href="struct__fors__star.html">fors_star</a> *nearest_1 = fors_star_list_kth(stars,
-<a name="l00847"></a>00847                         1,
-<a name="l00848"></a>00848                         <a class="code" href="group__fors__identify.html#gd13e1eb3050a7a1933760649f74fa14a">star_nearer</a>,
-<a name="l00849"></a>00849                         &data);
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851                 <span class="keywordflow">if</span> (fors_star_list_size(stars) > 1) {
-<a name="l00852"></a>00852 
-<a name="l00853"></a>00853                     <a class="code" href="struct__fors__star.html">fors_star</a> *nearest_2 = fors_star_list_kth(stars,
-<a name="l00854"></a>00854                             2,
-<a name="l00855"></a>00855                             <a class="code" href="group__fors__identify.html#gd13e1eb3050a7a1933760649f74fa14a">star_nearer</a>,
-<a name="l00856"></a>00856                             &data);
-<a name="l00857"></a>00857 
-<a name="l00858"></a>00858                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Nearest candidates at "</span>
-<a name="l00859"></a>00859                                   <span class="stringliteral">"distance %f and %f pixels"</span>,
-<a name="l00860"></a>00860                                   sqrt(<a class="code" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">distsq_shift</a>(nearest_1, data.ref, 
-<a name="l00861"></a>00861                                           data.shift_x, 
-<a name="l00862"></a>00862                                           data.shift_y)),
-<a name="l00863"></a>00863                                           sqrt(<a class="code" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">distsq_shift</a>(nearest_2, data.ref, 
-<a name="l00864"></a>00864                                                   data.shift_x, 
-<a name="l00865"></a>00865                                                   data.shift_y)));
-<a name="l00866"></a>00866 
-<a name="l00867"></a>00867                     <span class="keywordflow">if</span> (<a class="code" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">distsq_shift</a>(nearest_1, data.ref, 
-<a name="l00868"></a>00868                             data.shift_x, data.shift_y) <= 
-<a name="l00869"></a>00869                             search_radius * search_radius) {
-<a name="l00870"></a>00870 
-<a name="l00871"></a>00871                         <span class="keywordflow">if</span> (!require_unique || 
-<a name="l00872"></a>00872                                 <a class="code" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">distsq_shift</a>(nearest_2, data.ref, 
-<a name="l00873"></a>00873                                         data.shift_x, data.shift_y) > 
-<a name="l00874"></a>00874                         search_radius * search_radius) {
-<a name="l00875"></a>00875 
-<a name="l00876"></a>00876                             cpl_msg_debug(cpl_func, 
-<a name="l00877"></a>00877                                     <span class="stringliteral">"unique source inside %f pixels"</span>,
-<a name="l00878"></a>00878                                     search_radius);
-<a name="l00879"></a>00879 
-<a name="l00880"></a>00880                             nearest_1->id = fors_std_star_duplicate(data.ref);
-<a name="l00881"></a>00881                             number_of_ids += 1;
-<a name="l00882"></a>00882                         }
-<a name="l00883"></a>00883                     }
-<a name="l00884"></a>00884                 }
-<a name="l00885"></a>00885                 <span class="keywordflow">else</span> {
-<a name="l00886"></a>00886                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Nearest candidate at "</span>
-<a name="l00887"></a>00887                             <span class="stringliteral">"distance %f pixels"</span>,
-<a name="l00888"></a>00888                             sqrt(<a class="code" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">distsq_shift</a>(nearest_1, data.ref, 
-<a name="l00889"></a>00889                                     data.shift_x, 
-<a name="l00890"></a>00890                                     data.shift_y)));
-<a name="l00891"></a>00891                     <span class="keywordflow">if</span> (<a class="code" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">distsq_shift</a>(nearest_1, data.ref, 
-<a name="l00892"></a>00892                             data.shift_x, data.shift_y) <=
-<a name="l00893"></a>00893                             search_radius * search_radius) {
-<a name="l00894"></a>00894 
-<a name="l00895"></a>00895                         cpl_msg_debug(cpl_func, 
-<a name="l00896"></a>00896                                 <span class="stringliteral">"unique source inside %f pixels"</span>,
-<a name="l00897"></a>00897                                 search_radius);
-<a name="l00898"></a>00898 
-<a name="l00899"></a>00899                         nearest_1->id = fors_std_star_duplicate(data.ref);
-<a name="l00900"></a>00900                         number_of_ids += 1;
-<a name="l00901"></a>00901                     }
-<a name="l00902"></a>00902                 }
-<a name="l00903"></a>00903             }
-<a name="l00904"></a>00904         }
-<a name="l00905"></a>00905 
-<a name="l00906"></a>00906         cpl_msg_info(cpl_func, <span class="stringliteral">"Identified %d star%s"</span>,
-<a name="l00907"></a>00907                      number_of_ids, (number_of_ids == 1) ? <span class="stringliteral">""</span> : <span class="stringliteral">"s"</span>);
-<a name="l00908"></a>00908 
-<a name="l00909"></a>00909         <span class="keywordflow">if</span> (number_of_ids == 0) {
-<a name="l00910"></a>00910 
-<a name="l00911"></a>00911             <span class="keywordflow">if</span> (fabs(sx_00) > 0.1 && 
-<a name="l00912"></a>00912                     fabs(sy_00) > 0.1) {
-<a name="l00913"></a>00913 
-<a name="l00914"></a>00914                 cpl_msg_debug(cpl_func,
-<a name="l00915"></a>00915                         <span class="stringliteral">"No identifications made, "</span>
-<a name="l00916"></a>00916                         <span class="stringliteral">"set shift to zero and try again"</span>);
-<a name="l00917"></a>00917                 search_radius = 20;
-<a name="l00918"></a>00918                 require_unique = <span class="keyword">false</span>;
-<a name="l00919"></a>00919 
-<a name="l00920"></a>00920                 sx_00 = 0;
-<a name="l00921"></a>00921                 sy_00 = 0;
-<a name="l00922"></a>00922             }
-<a name="l00923"></a>00923             <span class="keywordflow">else</span> {
-<a name="l00924"></a>00924                 require_unique = <span class="keyword">false</span>;
-<a name="l00925"></a>00925 
-<a name="l00926"></a>00926                 search_radius *= 2;
-<a name="l00927"></a>00927 
-<a name="l00928"></a>00928                 cpl_msg_debug(cpl_func,
-<a name="l00929"></a>00929                               <span class="stringliteral">"No identifications made, "</span>
-<a name="l00930"></a>00930                               <span class="stringliteral">"double search radius and try again"</span>);
-<a name="l00931"></a>00931             }
-<a name="l00932"></a>00932         }
-<a name="l00933"></a>00933 
-<a name="l00934"></a>00934         cpl_msg_indent_less();
-<a name="l00935"></a>00935 
-<a name="l00936"></a>00936     } <span class="comment">/* while no identifications made */</span>
-<a name="l00937"></a>00937 
-<a name="l00938"></a>00938     <span class="keywordflow">if</span> (number_of_ids == 0) {
-<a name="l00939"></a>00939         cpl_msg_warning(cpl_func,
-<a name="l00940"></a>00940                 <span class="stringliteral">"No identifications made, "</span>
-<a name="l00941"></a>00941                 <span class="stringliteral">"within search radius %f pixels"</span>,
-<a name="l00942"></a>00942                 im->max_search);
-<a name="l00943"></a>00943         <span class="comment">/* When maxsearchradius was a parameter</span>
-<a name="l00944"></a>00944 <span class="comment"></span>
-<a name="l00945"></a>00945 <span class="comment">        cpl_msg_warning(cpl_func,</span>
-<a name="l00946"></a>00946 <span class="comment">                        "No identifications made, "</span>
-<a name="l00947"></a>00947 <span class="comment">                        "max search radius reached: %f pixels",</span>
-<a name="l00948"></a>00948 <span class="comment">                        im->max_search);</span>
-<a name="l00949"></a>00949 <span class="comment">         */</span>
-<a name="l00950"></a>00950     }
-<a name="l00951"></a>00951     <span class="keywordflow">else</span> {
-<a name="l00952"></a>00952         <span class="comment">/* Sketch to recompute shift:</span>
-<a name="l00953"></a>00953 <span class="comment">         *    Get median shifts (in x and y) of identified stars.</span>
-<a name="l00954"></a>00954 <span class="comment">         *    Then do the equivalent of a single tour through the while() loop above</span>
-<a name="l00955"></a>00955 <span class="comment">         *    </span>
-<a name="l00956"></a>00956 <span class="comment">         *    This could perhaps be unified with the code above to avoid duplication</span>
-<a name="l00957"></a>00957 <span class="comment">         */</span>
-<a name="l00958"></a>00958     }
-<a name="l00959"></a>00959 
-<a name="l00960"></a>00960 
-<a name="l00961"></a>00961     cpl_msg_indent_less();
-<a name="l00962"></a>00962 
-<a name="l00963"></a>00963     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00964"></a>00964     <span class="keywordflow">return</span>;
-<a name="l00965"></a>00965 }
-<a name="l00966"></a>00966 
-<a name="l00975"></a>00975 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00976"></a><a class="code" href="group__fors__identify.html#gdfc439dadf11b131119fe17cb19f6e25">00976</a> <a class="code" href="group__fors__identify.html#gdfc439dadf11b131119fe17cb19f6e25">inside_region</a>(<span class="keyword">const</span> fors_std_star *std,
-<a name="l00977"></a>00977               <span class="keywordtype">void</span> *reg)
-<a name="l00978"></a>00978 {
-<a name="l00979"></a>00979     <span class="keyword">const</span> <span class="keyword">struct </span>{
-<a name="l00980"></a>00980         <span class="keywordtype">int</span> xlo, ylo;
-<a name="l00981"></a>00981         <span class="keywordtype">int</span> xhi, yhi;
-<a name="l00982"></a>00982     } *region = reg;
-<a name="l00983"></a>00983 
-<a name="l00984"></a>00984     <span class="keywordflow">return</span>
-<a name="l00985"></a>00985         region->xlo <= std->pixel->x && std->pixel->x <= region->xhi &&
-<a name="l00986"></a>00986         region->ylo <= std->pixel->y && std->pixel->y <= region->yhi;
-<a name="l00987"></a>00987 }
-<a name="l00988"></a>00988 
-<a name="l00989"></a>00989 
-<a name="l00990"></a>00990 
-<a name="l00991"></a>00991 <span class="preprocessor">#undef cleanup</span>
-<a name="l00992"></a><a class="code" href="group__fors__identify.html#g57cf6e6e2826eb178fd2d9c3e5695343">00992</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00993"></a>00993 <span class="preprocessor">do { \</span>
-<a name="l00994"></a>00994 <span class="preprocessor">    fors_point_list_delete(&std_points, fors_point_delete); \</span>
-<a name="l00995"></a>00995 <span class="preprocessor">    fors_point_list_delete(&source_points, fors_point_delete); \</span>
-<a name="l00996"></a>00996 <span class="preprocessor">    fors_pattern_list_delete(&std_patterns, fors_pattern_delete); \</span>
-<a name="l00997"></a>00997 <span class="preprocessor">    fors_pattern_list_delete(&source_patterns, fors_pattern_delete); \</span>
-<a name="l00998"></a>00998 <span class="preprocessor">    double_list_delete(&scales, double_delete); \</span>
-<a name="l00999"></a>00999 <span class="preprocessor">    double_list_delete(&angles, double_delete); \</span>
-<a name="l01000"></a>01000 <span class="preprocessor">    double_list_delete(&angle_cos, double_delete); \</span>
-<a name="l01001"></a>01001 <span class="preprocessor">    double_list_delete(&angle_sin, double_delete); \</span>
-<a name="l01002"></a>01002 <span class="preprocessor">    double_list_delete(&match_dist, double_delete); \</span>
-<a name="l01003"></a>01003 <span class="preprocessor">    double_list_delete(&shiftx, double_delete); \</span>
-<a name="l01004"></a>01004 <span class="preprocessor">    double_list_delete(&shifty, double_delete); \</span>
-<a name="l01005"></a>01005 <span class="preprocessor">} while (0)</span>
-<a name="l01006"></a>01006 <span class="preprocessor"></span>
-<a name="l01022"></a>01022 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l01023"></a><a class="code" href="group__fors__identify.html#g3c4ce99ce7472d6d48acffcf562b0fb7">01023</a> <a class="code" href="group__fors__identify.html#g3c4ce99ce7472d6d48acffcf562b0fb7">match_patterns</a>(<span class="keyword">const</span> fors_star_list *stars, 
-<a name="l01024"></a>01024                <span class="keyword">const</span> fors_std_star_list *std,
-<a name="l01025"></a>01025                <span class="keywordtype">double</span> kappa,
-<a name="l01026"></a>01026                <span class="keywordtype">double</span> *sx_00,
-<a name="l01027"></a>01027                <span class="keywordtype">double</span> *sy_00,
-<a name="l01028"></a>01028                <span class="keywordtype">double</span> *med_scale,
-<a name="l01029"></a>01029                <span class="keywordtype">double</span> *med_angle,
-<a name="l01030"></a>01030                <span class="keywordtype">int</span>    *status)
-<a name="l01031"></a>01031 {
-<a name="l01032"></a>01032     fors_point_list *std_points = NULL;
-<a name="l01033"></a>01033     fors_point_list *source_points = NULL;
-<a name="l01034"></a>01034 
-<a name="l01035"></a>01035     fors_pattern_list *std_patterns = NULL;
-<a name="l01036"></a>01036     fors_pattern_list *source_patterns = NULL;
-<a name="l01037"></a>01037 
-<a name="l01038"></a>01038     double_list *scales = NULL;
-<a name="l01039"></a>01039     double_list *angles = NULL;
-<a name="l01040"></a>01040     double_list *angle_cos = NULL;
-<a name="l01041"></a>01041     double_list *angle_sin = NULL;
-<a name="l01042"></a>01042     double_list *match_dist = NULL;
-<a name="l01043"></a>01043     double_list *shiftx = NULL;
-<a name="l01044"></a>01044     double_list *shifty = NULL;
-<a name="l01045"></a>01045 
-<a name="l01046"></a>01046     *status = 0;
-<a name="l01047"></a>01047 
-<a name="l01048"></a>01048     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( sx_00 != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l01049"></a>01049     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( sy_00 != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l01050"></a>01050   
-<a name="l01051"></a>01051     <span class="comment">/* Build patterns */</span>
-<a name="l01052"></a>01052     std_points = fors_point_list_new();
-<a name="l01053"></a>01053     {
-<a name="l01054"></a>01054         <span class="keyword">const</span> fors_std_star *s;
-<a name="l01055"></a>01055         
-<a name="l01056"></a>01056         <span class="keywordflow">for</span> (s = fors_std_star_list_first_const(std);
-<a name="l01057"></a>01057              s != NULL;
-<a name="l01058"></a>01058              s = fors_std_star_list_next_const(std)) {
-<a name="l01059"></a>01059             
-<a name="l01060"></a>01060             fors_point_list_insert(std_points,
-<a name="l01061"></a>01061                                    <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(s->pixel->x,
-<a name="l01062"></a>01062                                                   s->pixel->y));
-<a name="l01063"></a>01063         }
-<a name="l01064"></a>01064     }
-<a name="l01065"></a>01065     
-<a name="l01066"></a>01066     source_points = fors_point_list_new();
-<a name="l01067"></a>01067     {
-<a name="l01068"></a>01068         <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s;
-<a name="l01069"></a>01069         
-<a name="l01070"></a>01070         <span class="keywordflow">for</span> (s = fors_star_list_first_const(stars);
-<a name="l01071"></a>01071              s != NULL;
-<a name="l01072"></a>01072              s = fors_star_list_next_const(stars)) {
-<a name="l01073"></a>01073             
-<a name="l01074"></a>01074             fors_point_list_insert(source_points,
-<a name="l01075"></a>01075                                    <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x,
-<a name="l01076"></a>01076                                                   s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y));
-<a name="l01077"></a>01077         }
-<a name="l01078"></a>01078     }
-<a name="l01079"></a>01079 
-<a name="l01080"></a>01080     <span class="keyword">const</span> <span class="keywordtype">double</span> min_dist = 1.0; <span class="comment">/* minimum distance between two </span>
-<a name="l01081"></a>01081 <span class="comment">                                    points in a pattern */</span>
-<a name="l01082"></a>01082     <span class="keywordtype">double</span> sigma_std = 0.0; <span class="comment">/* No uncertainty of catalog patterns */</span>
-<a name="l01083"></a>01083     std_patterns = 
-<a name="l01084"></a>01084         fors_pattern_new_from_points(std_points, min_dist, sigma_std);
-<a name="l01085"></a>01085     cpl_msg_info(cpl_func, <span class="stringliteral">"Created %d catalog patterns"</span>,
-<a name="l01086"></a>01086                  fors_pattern_list_size(std_patterns));
-<a name="l01087"></a>01087 
-<a name="l01088"></a>01088     <span class="keywordtype">double</span> sigma_source;
-<a name="l01089"></a>01089     <span class="keywordflow">if</span> (fors_star_list_size(stars) > 0) {
-<a name="l01090"></a>01090     sigma_source = fors_star_list_median(stars,
-<a name="l01091"></a>01091                          <a class="code" href="group__fors__star.html#g4f81e6410fe5c7aefbdbcae907095059">fors_star_extension</a>, NULL);
-<a name="l01092"></a>01092     cpl_msg_info(cpl_func, <span class="stringliteral">"Average source extension = %.2f pixels"</span>, sigma_source);
-<a name="l01093"></a>01093     } <span class="keywordflow">else</span> {
-<a name="l01094"></a>01094     sigma_source = -1; <span class="comment">/* not used in this case */</span>
-<a name="l01095"></a>01095     }
-<a name="l01096"></a>01096     source_patterns = 
-<a name="l01097"></a>01097     fors_pattern_new_from_points(source_points, min_dist, sigma_source);
-<a name="l01098"></a>01098 
-<a name="l01099"></a>01099     cpl_msg_info(cpl_func, <span class="stringliteral">"Created %d source patterns"</span>,
-<a name="l01100"></a>01100                  fors_pattern_list_size(source_patterns));
-<a name="l01101"></a>01101     
-<a name="l01102"></a>01102     scales = double_list_new();
-<a name="l01103"></a>01103     angles = double_list_new();
-<a name="l01104"></a>01104     angle_cos = double_list_new();
-<a name="l01105"></a>01105     angle_sin = double_list_new();
-<a name="l01106"></a>01106     match_dist = double_list_new();
-<a name="l01107"></a>01107 
-<a name="l01108"></a>01108     <span class="keywordflow">if</span> ( fors_pattern_list_size(source_patterns) > 0) {
-<a name="l01109"></a>01109     <span class="comment">/* Identify, </span>
-<a name="l01110"></a>01110 <span class="comment">       get average scale, orientation */</span>
-<a name="l01111"></a>01111     <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p;
-<a name="l01112"></a>01112         
-<a name="l01113"></a>01113     <span class="keywordflow">for</span> (p = fors_pattern_list_first(std_patterns);
-<a name="l01114"></a>01114          p != NULL;
-<a name="l01115"></a>01115          p = fors_pattern_list_next(std_patterns)) {
-<a name="l01116"></a>01116         
-<a name="l01117"></a>01117         <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *nearest_source = 
-<a name="l01118"></a>01118         fors_pattern_list_min_val(source_patterns,
-<a name="l01119"></a>01119                       (fors_pattern_list_func_eval) fors_pattern_distsq,
-<a name="l01120"></a>01120                       p);
-<a name="l01121"></a>01121         
-<a name="l01122"></a>01122         <span class="keywordtype">double</span> scale = fors_pattern_get_scale(p, nearest_source);
-<a name="l01123"></a>01123         <span class="keywordtype">double</span> angle = fors_pattern_get_angle(p, nearest_source);
-<a name="l01124"></a>01124         <span class="keywordtype">double</span> angle_c = cos(angle);
-<a name="l01125"></a>01125         <span class="keywordtype">double</span> angle_s = sin(angle);
-<a name="l01126"></a>01126         <span class="keywordtype">double</span> dist = sqrt(fors_pattern_distsq(p, nearest_source));
-<a name="l01127"></a>01127         <span class="keywordtype">double</span> dist_per_error = fors_pattern_dist_per_error(p, nearest_source);
-<a name="l01128"></a>01128         
-<a name="l01129"></a>01129         cpl_msg_debug(cpl_func, <span class="stringliteral">"dist, ndist, scale, orientation = %f, %f, %f, %f"</span>,
-<a name="l01130"></a>01130               dist, dist_per_error, scale, angle * 360/(2*M_PI));
-<a name="l01131"></a>01131         
-<a name="l01132"></a>01132         <span class="comment">/* Make identification if patterns match within error bars</span>
-<a name="l01133"></a>01133 <span class="comment">           (defined above as sigma_source) </span>
-<a name="l01134"></a>01134 <span class="comment">        */</span>
-<a name="l01135"></a>01135         <span class="keywordflow">if</span> (dist_per_error < 1.0) {
-<a name="l01136"></a>01136         double_list_insert(scales   , double_duplicate(&scale));
-<a name="l01137"></a>01137         double_list_insert(angles   , double_duplicate(&angle));
-<a name="l01138"></a>01138         double_list_insert(angle_cos, double_duplicate(&angle_c));
-<a name="l01139"></a>01139         double_list_insert(angle_sin, double_duplicate(&angle_s));
-<a name="l01140"></a>01140         double_list_insert(match_dist, double_duplicate(&dist));
-<a name="l01141"></a>01141         }
-<a name="l01142"></a>01142     }
-<a name="l01143"></a>01143     }
-<a name="l01144"></a>01144     <span class="keywordflow">else</span> {
-<a name="l01145"></a>01145     <span class="comment">/* no source patterns to match */</span>
-<a name="l01146"></a>01146     }
-<a name="l01147"></a>01147     
-<a name="l01148"></a>01148     <span class="keywordflow">if</span> ( double_list_size(scales) >= 2 ) {
-<a name="l01149"></a>01149         <span class="keywordtype">double</span> scale_avg   = double_list_median(scales, double_eval, NULL);
-<a name="l01150"></a>01150         <span class="keywordtype">double</span> scale_stdev = double_list_mad(scales, double_eval, NULL) * <a class="code" href="group__fors__utils.html#gea88c3776498f5f3717413a50289af52">STDEV_PR_MAD</a>;
-<a name="l01151"></a>01151         
-<a name="l01152"></a>01152         cpl_msg_info(cpl_func, <span class="stringliteral">"Median scale = %.4f +- %.4f"</span>,
-<a name="l01153"></a>01153                      scale_avg, scale_stdev);
-<a name="l01154"></a>01154 
-<a name="l01155"></a>01155         *med_scale = scale_avg;
-<a name="l01156"></a>01156         
-<a name="l01157"></a>01157         <span class="keywordflow">if</span> (scale_stdev > 0.2) {
-<a name="l01158"></a>01158             cpl_msg_warning(cpl_func, <span class="stringliteral">"Uncertain scale determination"</span>);
-<a name="l01159"></a>01159             *status = 1;
-<a name="l01160"></a>01160         }
-<a name="l01161"></a>01161         
-<a name="l01162"></a>01162         <span class="comment">/* </span>
-<a name="l01163"></a>01163 <span class="comment">         * Represent each angle as a unit vector, compute average </span>
-<a name="l01164"></a>01164 <span class="comment">         * unit vector orientation.</span>
-<a name="l01165"></a>01165 <span class="comment">         * Compute median absolute deviation with respect to this average </span>
-<a name="l01166"></a>01166 <span class="comment">         */</span>
-<a name="l01167"></a>01167         <span class="keywordtype">double</span> angle_avg = atan2(double_list_mean(angle_sin, double_eval, NULL),
-<a name="l01168"></a>01168                                  double_list_mean(angle_cos, double_eval, NULL));
-<a name="l01169"></a>01169         <span class="keywordtype">double</span> angle_stdev = <a class="code" href="group__fors__utils.html#gea88c3776498f5f3717413a50289af52">STDEV_PR_MAD</a> *
-<a name="l01170"></a>01170             double_list_median(angles, (double_list_func_eval) <a class="code" href="group__fors__utils.html#g71645af45bc192964d3170f28c671240">fors_angle_diff</a>, &angle_avg);
-<a name="l01171"></a>01171         
-<a name="l01172"></a>01172         cpl_msg_info(cpl_func, <span class="stringliteral">"Average orientation = %.1f +- %.1f degrees"</span>,
-<a name="l01173"></a>01173                      angle_avg   * 360 / (2*M_PI),
-<a name="l01174"></a>01174                      angle_stdev * 360 / (2*M_PI));
-<a name="l01175"></a>01175 
-<a name="l01176"></a>01176         *med_angle = angle_avg;
-<a name="l01177"></a>01177         
-<a name="l01178"></a>01178         <span class="keywordflow">if</span> (angle_avg > M_PI/4 || angle_avg < -M_PI/4) {
-<a name="l01179"></a>01179             cpl_msg_warning(cpl_func, <span class="stringliteral">"Expected orientation = 0 degrees"</span>);
-<a name="l01180"></a>01180             *status = 1;
-<a name="l01181"></a>01181             <span class="comment">/* To model any orientation, we should use higher order (than zero) polynomials</span>
-<a name="l01182"></a>01182 <span class="comment">               for the shifts */</span>
-<a name="l01183"></a>01183         }
-<a name="l01184"></a>01184         
-<a name="l01185"></a>01185         <span class="keywordtype">double</span> avg_dist   = double_list_mean(match_dist, double_eval, NULL);
-<a name="l01186"></a>01186         <span class="keywordtype">double</span> false_dist = 1.0/sqrt(M_PI * fors_pattern_list_size(source_patterns));
-<a name="l01187"></a>01187         <span class="comment">/* Average distance to nearest false match */</span>
-<a name="l01188"></a>01188         
-<a name="l01189"></a>01189         cpl_msg_info(cpl_func, <span class="stringliteral">"Average match distance = %f pixel"</span>, avg_dist);
-<a name="l01190"></a>01190         cpl_msg_info(cpl_func, <span class="stringliteral">"False match distance = %f pixel"</span>, false_dist);
-<a name="l01191"></a>01191         cpl_msg_info(cpl_func, <span class="stringliteral">"Safety index = %.3f (should be >~ 5)"</span>, 
-<a name="l01192"></a>01192                      false_dist / avg_dist);
-<a name="l01193"></a>01193         <span class="keywordflow">if</span> (false_dist / avg_dist < 1.5) {
-<a name="l01194"></a>01194             cpl_msg_warning(cpl_func, <span class="stringliteral">"Uncertain pattern matching"</span>);
-<a name="l01195"></a>01195             *status = 1;
-<a name="l01196"></a>01196         }
-<a name="l01197"></a>01197         
-<a name="l01198"></a>01198         <span class="comment">/* Get shift from matches */</span>
-<a name="l01199"></a>01199         shiftx = double_list_new();
-<a name="l01200"></a>01200         shifty = double_list_new();
-<a name="l01201"></a>01201         {
-<a name="l01202"></a>01202             <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p;
-<a name="l01203"></a>01203             
-<a name="l01204"></a>01204             <span class="keywordflow">for</span> (p = fors_pattern_list_first(std_patterns);
-<a name="l01205"></a>01205                  p != NULL;
-<a name="l01206"></a>01206                  p = fors_pattern_list_next(std_patterns)) {
-<a name="l01207"></a>01207                 
-<a name="l01208"></a>01208                 <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *nearest_source = 
-<a name="l01209"></a>01209                     fors_pattern_list_min_val(
-<a name="l01210"></a>01210                         source_patterns,
-<a name="l01211"></a>01211                         (fors_pattern_list_func_eval) fors_pattern_distsq,
-<a name="l01212"></a>01212                         p);
-<a name="l01213"></a>01213                 
-<a name="l01214"></a>01214                 <span class="keywordtype">double</span> dist = sqrt(fors_pattern_distsq(p, nearest_source));
-<a name="l01215"></a>01215                 <span class="keywordtype">double</span> dist_per_error = fors_pattern_dist_per_error(p, nearest_source);
-<a name="l01216"></a>01216                 <span class="keywordtype">double</span> scale = fors_pattern_get_scale(p, nearest_source);
-<a name="l01217"></a>01217                 <span class="keywordtype">double</span> angle = fors_pattern_get_angle(p, nearest_source);
-<a name="l01218"></a>01218                 
-<a name="l01219"></a>01219                 cpl_msg_debug(cpl_func, <span class="stringliteral">"scale, orientation, distance, norm.distance "</span>
-<a name="l01220"></a>01220                               <span class="stringliteral">"= %f, %f, %f, %f"</span>,
-<a name="l01221"></a>01221                               scale, angle * 360/(2*M_PI), dist, dist_per_error);
-<a name="l01222"></a>01222                 
-<a name="l01223"></a>01223                 <span class="keywordflow">if</span> (dist_per_error < 1.0 &&
-<a name="l01224"></a>01224                     fabs(scale - scale_avg)             <= kappa * scale_stdev &&
-<a name="l01225"></a>01225             <a class="code" href="group__fors__utils.html#g71645af45bc192964d3170f28c671240">fors_angle_diff</a>(&angle, &angle_avg) <= kappa * angle_stdev) {
-<a name="l01226"></a>01226                     
-<a name="l01227"></a>01227                     <span class="comment">/* Compute shift of the two patterns' reference stars */</span>
-<a name="l01228"></a>01228                     <span class="keywordtype">double</span> shift_x = fors_pattern_get_ref(nearest_source)->x - fors_pattern_get_ref(p)->x;
-<a name="l01229"></a>01229                     <span class="keywordtype">double</span> shift_y = fors_pattern_get_ref(nearest_source)->y - fors_pattern_get_ref(p)->y;
-<a name="l01230"></a>01230                     
-<a name="l01231"></a>01231                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Accepted, shift = (%f, %f) pixels"</span>, 
-<a name="l01232"></a>01232                                   shift_x, shift_y);
-<a name="l01233"></a>01233                     
-<a name="l01234"></a>01234                     double_list_insert(shiftx, double_duplicate(&shift_x));
-<a name="l01235"></a>01235                     double_list_insert(shifty, double_duplicate(&shift_y));
-<a name="l01236"></a>01236                 }
-<a name="l01237"></a>01237             } 
-<a name="l01238"></a>01238         }
-<a name="l01239"></a>01239 
-<a name="l01240"></a>01240     <span class="keywordflow">if</span> (double_list_size(shiftx) > 0) {
-<a name="l01241"></a>01241         *sx_00 = double_list_median(shiftx, double_eval, NULL);
-<a name="l01242"></a>01242     }
-<a name="l01243"></a>01243     <span class="keywordflow">else</span> {
-<a name="l01244"></a>01244         <span class="comment">/* If this happens it is likely a bug, because</span>
-<a name="l01245"></a>01245 <span class="comment">           we already checked that 'scales' is non-empty.</span>
-<a name="l01246"></a>01246 <span class="comment"></span>
-<a name="l01247"></a>01247 <span class="comment">           But do not try to get the median of an empty list in any case,</span>
-<a name="l01248"></a>01248 <span class="comment">           which would cause a crash</span>
-<a name="l01249"></a>01249 <span class="comment">        */</span>
-<a name="l01250"></a>01250         cpl_msg_warning(cpl_func, <span class="stringliteral">"No standardstar identifications!"</span>);
-<a name="l01251"></a>01251             *status = 1;
-<a name="l01252"></a>01252     }
-<a name="l01253"></a>01253 
-<a name="l01254"></a>01254     <span class="keywordflow">if</span> (double_list_size(shiftx) > 0) {
-<a name="l01255"></a>01255         *sy_00 = double_list_median(shifty, double_eval, NULL);
-<a name="l01256"></a>01256     }
-<a name="l01257"></a>01257     <span class="keywordflow">else</span> {
-<a name="l01258"></a>01258         cpl_msg_warning(cpl_func, <span class="stringliteral">"No standardstar identifications!"</span>);
-<a name="l01259"></a>01259             *status = 1;
-<a name="l01260"></a>01260     }
-<a name="l01261"></a>01261     }
-<a name="l01262"></a>01262     <span class="keywordflow">else</span> {
-<a name="l01263"></a>01263         cpl_msg_warning(cpl_func,
-<a name="l01264"></a>01264                         <span class="stringliteral">"Too few (%d) matching patterns: assuming zero shift"</span>,
-<a name="l01265"></a>01265                         double_list_size(scales));
-<a name="l01266"></a>01266         *sx_00 = 0;
-<a name="l01267"></a>01267         *sy_00 = 0;
-<a name="l01268"></a>01268         *med_scale = 1.0;
-<a name="l01269"></a>01269         *med_angle = 0.0;
-<a name="l01270"></a>01270     }
-<a name="l01271"></a>01271 
-<a name="l01272"></a>01272     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01273"></a>01273     <span class="keywordflow">return</span>;
-<a name="l01274"></a>01274 }
-<a name="l01275"></a>01275 
-<a name="l01276"></a>01276 
-<a name="l01277"></a>01277 
-<a name="l01278"></a>01278     
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__identify_8c_source.html b/html/fors__identify_8c_source.html
new file mode 100644
index 0000000..810a3b3
--- /dev/null
+++ b/html/fors__identify_8c_source.html
@@ -0,0 +1,1242 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_identify.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_identify.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_identify.c,v 1.58 2013-09-10 15:14:44 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 15:14:44 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.58 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_identify.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_pattern.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_point.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_double.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include <assert.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="struct__identify__method.html">   52</a></span> <span class="keyword">struct </span><a class="code" href="struct__identify__method.html">_identify_method</a></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> {</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>     <span class="keywordtype">int</span> ncat;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>     <span class="keywordtype">double</span> nsource;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>     <span class="keywordtype">double</span> kappa;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>     <span class="keywordtype">double</span> search;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>     <span class="keywordtype">double</span> max_search;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     <span class="keywordtype">double</span> max_offset;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> };</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <a class="code" href="group__fors__identify.html#ga2bf16455ff9dadaa26861905f8999616" title="Determine if star is inside region.">inside_region</a>(<span class="keyword">const</span> fors_std_star *std,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>               <span class="keywordtype">void</span> *reg);</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <a class="code" href="group__fors__identify.html#gabbed61b85afc33d67894bd2dd1f061f3" title="Match patterns.">match_patterns</a>(<span class="keyword">const</span> fors_star_list *stars, </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                <span class="keyword">const</span> fors_std_star_list *std,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                <span class="keywordtype">double</span> kappa,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                <span class="keywordtype">double</span> *sx_00,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                <span class="keywordtype">double</span> *sy_00,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                <span class="keywordtype">double</span> *med_scale,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                <span class="keywordtype">double</span> *med_angle,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                <span class="keywordtype">int</span>    *status);</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="group__fors__identify.html#gac0dc4fbd9cc717256e5972cad3e7447f">   82</a></span> <a class="code" href="group__fors__identify.html#gac0dc4fbd9cc717256e5972cad3e7447f" title="Define recipe parameters.">fors_identify_define_parameters</a>(cpl_parameterlist *parameters, </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *context)</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> {</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *full_name = NULL;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="comment">/* Restore if pattern matching needs to be restored</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="comment"></span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="comment">    name = "ncat";</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="comment">    p = cpl_parameter_new_value(full_name,</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="comment">                                CPL_TYPE_INT,</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="comment">                                "Number of catalog stars to use in "</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="comment">                                "pattern matching",</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="comment">                                context,</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="comment">                                10);</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="comment">                                         </span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="comment">    cpl_parameterlist_append(parameters, p);</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="comment">    cpl_free((void *)full_name);</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="comment"></span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="comment"></span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="comment">    name = "nsource";</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="comment">    p = cpl_parameter_new_value(full_name,</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="comment">                                CPL_TYPE_DOUBLE,</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="comment">                                "Number of sources to use in "</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="comment">                                "pattern matching, pr. catalog star",</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="comment">                                context,</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="comment">                                15.0);</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="comment">                                         </span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="comment">    cpl_parameterlist_append(parameters, p);</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="comment">    cpl_free((void *)full_name);</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="comment"></span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="comment">    name = "kappa";</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment">    p = cpl_parameter_new_value(full_name,</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">                                CPL_TYPE_DOUBLE,</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="comment">                                "Rejection parameter (scale, angle) used "</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="comment">                                "in pattern matching ",</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="comment">                                context,</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="comment">                                5.0);</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="comment">    cpl_parameterlist_append(parameters, p);</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="comment">    cpl_free((void *)full_name);</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="comment"></span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment">End of restoring if pattern matching has to be restored */</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="comment"></span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="comment">    name = "search";</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="comment">    p = cpl_parameter_new_value(full_name,</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="comment">                                CPL_TYPE_DOUBLE,</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="comment">                                "Search radius (pixels)",</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="comment">                                context,</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="comment">                                5.0);</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="comment">    cpl_parameterlist_append(parameters, p);</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="comment">    cpl_free((void *)full_name);</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="comment">    </span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="comment">    name = "maxsearch";</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="comment">    p = cpl_parameter_new_value(full_name,</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="comment">                                CPL_TYPE_DOUBLE,</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="comment">                                "Maximum search radius (pixels)",</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="comment">                                context,</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="comment">                                20.0);</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="comment">    cpl_parameterlist_append(parameters, p);</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="comment">    cpl_free((void *)full_name);</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="comment"></span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     name = <span class="stringliteral">"maxoffset"</span>;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="stringliteral">"Maximum acceptable offset between the image and catalogue WCS (pixels)"</span>,</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>                                 context,</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>                                 150.0);</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="preprocessor">    cpl_free((void *)name); \</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> identify_method *</div>
+<div class="line"><a name="l00193"></a><span class="lineno"><a class="code" href="group__fors__identify.html#ga642e6d38ae7b273d1901698a3970fd49">  193</a></span> <a class="code" href="group__fors__identify.html#ga642e6d38ae7b273d1901698a3970fd49" title="Get id method from parameter list.">fors_identify_method_new</a>(<span class="keyword">const</span> cpl_parameterlist *parameters, <span class="keyword">const</span> <span class="keywordtype">char</span> *context)</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> {</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     identify_method *im = cpl_malloc(<span class="keyword">sizeof</span>(*im));</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name = NULL;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Identification parameters:"</span>);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>        </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="comment">/* Restore if pattern matching to be restored</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="comment"></span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="comment">    cpl_msg_indent_more();</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="comment">    name = cpl_sprintf("%s.%s", context, "ncat");</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="comment">    im->ncat = dfs_get_parameter_int_const(parameters, name);</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment">    cpl_free((void *)name); name = NULL;</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="comment">    cpl_msg_indent_less();</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> <span class="comment"></span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="comment">       </span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <span class="comment">    cpl_msg_indent_more();</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="comment">    name = cpl_sprintf("%s.%s", context, "nsource");</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> <span class="comment">    im->nsource = dfs_get_parameter_double_const(parameters, name);</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="comment">    cpl_free((void *)name); name = NULL;</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="comment">    cpl_msg_indent_less();</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="comment"></span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="comment">       </span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="comment">    cpl_msg_indent_more();</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="comment">    name = cpl_sprintf("%s.%s", context, "kappa");</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="comment">    im->kappa = dfs_get_parameter_double_const(parameters, name);</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="comment">    cpl_free((void *)name); name = NULL;</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> <span class="comment">    cpl_msg_indent_less();</span></div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> <span class="comment"></span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> <span class="comment">End of restore if pattern matching to be restored */</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> </div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     <span class="comment">// cpl_msg_indent_more();</span></div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="comment">// name = cpl_sprintf("%s.%s", context, "search");</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     im->search = 5.0; <span class="comment">// dfs_get_parameter_double_const(parameters, name);</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     <span class="comment">// cpl_free((void *)name); name = NULL;</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <span class="comment">// cpl_msg_indent_less();</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>    </div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <span class="comment">// cpl_msg_indent_more();</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     <span class="comment">// name = cpl_sprintf("%s.%s", context, "maxsearch");</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     <span class="comment">// name = cpl_sprintf("%s.%s", context, "search"); // Same value for max search</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     im->max_search = 5.0; <span class="comment">// dfs_get_parameter_double_const(parameters, name);</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="comment">// cpl_free((void *)name); name = NULL;</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     <span class="comment">// cpl_msg_indent_less();</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"maxoffset"</span>);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     im->max_offset = <a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a>(parameters, name);</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> </div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     </div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <span class="keywordflow">return</span> im;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> }</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno"><a class="code" href="group__fors__identify.html#gaea1f0f7065727f62a6e3a5805549a9ce">  256</a></span> <a class="code" href="group__fors__identify.html#gaea1f0f7065727f62a6e3a5805549a9ce" title="Deallocate identifyion method and set the pointer to NULL.">fors_identify_method_delete</a>(identify_method **em)</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> {</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     <span class="keywordflow">if</span> (em && *em) {</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>         cpl_free(*em); *em = NULL;</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     }</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> }</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00274"></a><span class="lineno"><a class="code" href="group__fors__identify.html#ga1c91776ec58d5026026e00580f18f277">  274</a></span> <a class="code" href="group__fors__identify.html#ga1c91776ec58d5026026e00580f18f277" title="Compare brightness.">std_brighter_than</a>(<span class="keyword">const</span> fors_std_star *s1,</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                   <span class="keywordtype">void</span> *s2)</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> {</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordflow">return</span> fors_std_star_brighter_than(s1, s2, NULL);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> }</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> </div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno"><a class="code" href="group__fors__identify.html#ga75bfe0adc06bd97c18925132d4abf937">  290</a></span> <a class="code" href="group__fors__identify.html#ga75bfe0adc06bd97c18925132d4abf937" title="Compare brightness.">star_brighter_than</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s1,</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                    <span class="keywordtype">void</span> *s2)</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> {</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__star.html#ga7672a63fe0deea93cb8bae8362b6d020" title="Compare star brightness.">fors_star_brighter_than</a>(s1, s2, NULL);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> }</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno"><a class="code" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025">  305</a></span> <a class="code" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025" title="Distance between source and shifted catalog star.">distsq_shift</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>              <span class="keyword">const</span> fors_std_star *std,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>              <span class="keywordtype">double</span> shiftx,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>              <span class="keywordtype">double</span> shifty)</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> {</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     fors_point *shifted_pos = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(std->pixel->x + shiftx,</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>                                              std->pixel->y + shifty);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordtype">double</span> result = <a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(s->pixel, shifted_pos);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&shifted_pos);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> }</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno"><a class="code" href="group__fors__identify.html#ga95a6f76b39659c4ce77f5f4ae3366a6f">  329</a></span> <a class="code" href="group__fors__identify.html#ga95a6f76b39659c4ce77f5f4ae3366a6f" title="Tell if a source is closest to a catalog star.">star_nearer</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s1,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>             <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s2,</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>             <span class="keywordtype">void</span> *data) </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> {</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>         <span class="keywordtype">double</span> shift_x, shift_y;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>         <span class="keyword">const</span> fors_std_star *ref;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     } *d = data;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="comment">/* Cast is safe, see caller */</span></div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordflow">return</span> </div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>         <a class="code" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025" title="Distance between source and shifted catalog star.">distsq_shift</a>(s1, d->ref, d->shift_x, d->shift_y) <</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>         <a class="code" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025" title="Distance between source and shifted catalog star.">distsq_shift</a>(s2, d->ref, d->shift_x, d->shift_y);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> }</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> </div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> </div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> <span class="preprocessor">    fors_std_star_list_delete(&std_ccd       , fors_std_star_delete); \</span></div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> <span class="preprocessor">    fors_std_star_list_delete(&std_ccd_bright, fors_std_star_delete); \</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> <span class="preprocessor">    fors_star_list_delete(&source_bright, fors_star_delete); \</span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno"><a class="code" href="group__fors__identify.html#ga734ab55ebf9bec1bed7e6330def7b6d8">  372</a></span> <a class="code" href="group__fors__identify.html#ga734ab55ebf9bec1bed7e6330def7b6d8" title="Identify sources.">fors_identify</a>(fors_star_list *stars, </div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>               fors_std_star_list *cat,</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>               <span class="keyword">const</span> identify_method *im,</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>               cpl_image **histogram)</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> {</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     fors_std_star_list *std_ccd = NULL;  <span class="comment">/* Subset of catalog stars</span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> <span class="comment">                                            which are inside the CCD */</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> </div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     fors_std_star_list *std_ccd_bright = NULL; <span class="comment">/* Brightest std stars */</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> </div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     fors_star_list *source_bright  = NULL;     <span class="comment">/* Subset of brightest stars */</span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="keywordtype">double</span> offset = 0.0;</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <span class="keywordtype">double</span> sx_00, sy_00;</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keywordtype">int</span> status;</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="keywordflow">if</span> (histogram)</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>         *histogram = NULL;</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> </div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( stars != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Identifying sources"</span>);</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> </div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> <span class="comment">      fors_star_print_list(CPL_MSG_ERROR, stars);</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="comment">      fors_std_star_print_list(CPL_MSG_ERROR, cat); </span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Pattern matching"</span>);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> </div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     <span class="comment">/* Select standards inside CCD */</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     {</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         <span class="keywordtype">double</span> tolerance = 100; <span class="comment">/* pixels */</span></div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>             <span class="keywordtype">int</span> xlo, ylo;</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>             <span class="keywordtype">int</span> xhi, yhi;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>         } region;</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>         <span class="keywordflow">if</span> (fors_star_list_size(stars) > 0) {</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>             region.xlo = <a class="code" href="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165" title="Get position.">fors_star_get_x</a>(fors_star_list_min_val(stars,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>                     <a class="code" href="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165" title="Get position.">fors_star_get_x</a>,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                     NULL), NULL) - tolerance;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>             region.ylo = <a class="code" href="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160" title="Get position.">fors_star_get_y</a>(fors_star_list_min_val(stars,</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>                     <a class="code" href="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160" title="Get position.">fors_star_get_y</a>,</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>                     NULL), NULL) - tolerance;</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>             region.xhi = <a class="code" href="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165" title="Get position.">fors_star_get_x</a>(fors_star_list_max_val(stars,</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                     <a class="code" href="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165" title="Get position.">fors_star_get_x</a>,</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                     NULL), NULL) + tolerance;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>             region.yhi = <a class="code" href="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160" title="Get position.">fors_star_get_y</a>(fors_star_list_max_val(stars,</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                     <a class="code" href="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160" title="Get position.">fors_star_get_y</a>,</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>                     NULL), NULL) + tolerance;</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span> </div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>             region.xlo = 1;</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>             region.ylo = 1;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>             region.xhi = 1000; <span class="comment">/* Anything can go here, not used */</span></div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>             region.yhi = 1000;</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>         }</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"Search region = (%d, %d) - (%d, %d)"</span>,</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>                       region.xlo, region.ylo,</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>                       region.xhi, region.yhi);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>         std_ccd = fors_std_star_list_extract(</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                 cat, fors_std_star_duplicate, <a class="code" href="group__fors__identify.html#ga2bf16455ff9dadaa26861905f8999616" title="Determine if star is inside region.">inside_region</a>, &region);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         <span class="keywordtype">int</span> multiple_entries = 0;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         <span class="keywordflow">if</span> (fors_std_star_list_size(std_ccd) > 1) {</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>             <span class="keywordtype">bool</span> found_double;</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>             <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>                 found_double = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>                 <span class="comment">/* Searching for the nearest neighbour will permute the list,</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> <span class="comment">                   do not do that while iterating the same list */</span></div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>                 fors_std_star_list *tmp = </div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>                         fors_std_star_list_duplicate(std_ccd,</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>                                 fors_std_star_duplicate);</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> </div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>                 cpl_msg_debug(cpl_func, <span class="stringliteral">"%d stars left"</span>, fors_std_star_list_size(tmp));</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> </div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>                 fors_std_star *std;</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> </div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>                 <span class="keywordflow">for</span> (std = fors_std_star_list_first(tmp);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>                         std != NULL && !found_double;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>                         std = fors_std_star_list_next(tmp)) {</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>                     fors_std_star *<span class="keyword">self</span> = fors_std_star_list_kth_val(</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>                             std_ccd, 1,</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>                             (fors_std_star_list_func_eval)</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>                             fors_std_star_dist_arcsec,</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>                             std);</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> </div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>                     fors_std_star *nn = fors_std_star_list_kth_val(</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>                             std_ccd, 2,</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>                             (fors_std_star_list_func_eval)</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>                             fors_std_star_dist_arcsec,</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>                             std);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>                     <span class="keywordtype">double</span> min_dist = fors_std_star_dist_arcsec(std, nn);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> </div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>                     cpl_msg_debug(cpl_func, <span class="stringliteral">"dist = %f arcseconds"</span>, min_dist);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> </div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>                     <span class="comment">/* If very close, remove the one with the largest magnitude</span></div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> <span class="comment">                       error. </span></div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> <span class="comment"></span></div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> <span class="comment">                       Do not try to combine the two magnitudes because</span></div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> <span class="comment">                       those estimates may or may not be correlated </span></div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>                     <span class="keywordflow">if</span> (min_dist < 5) {</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>                         multiple_entries += 1;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> </div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>                         <span class="keywordflow">if</span> (std->dmagnitude > nn->dmagnitude) {</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>                             fors_std_star_list_remove(std_ccd, <span class="keyword">self</span>);</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                             fors_std_star_delete(&<span class="keyword">self</span>);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>                         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>                             fors_std_star_list_remove(std_ccd, nn);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>                             fors_std_star_delete(&nn);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>                         }</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>                         found_double = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>                     }</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>                 }</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> </div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>                 fors_std_star_list_delete(&tmp,</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>                                           fors_std_star_delete);</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span> </div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>             } <span class="keywordflow">while</span> (found_double);</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>         }</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span> </div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>         cpl_msg_info(cpl_func, </div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>                      <span class="stringliteral">"%d catalog star%s are expected inside detector, "</span></div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                      <span class="stringliteral">"ignored %d repeated source%s"</span>,</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>                      fors_std_star_list_size(std_ccd),</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>                      fors_std_star_list_size(std_ccd) == 1 ? <span class="stringliteral">""</span> : <span class="stringliteral">"s"</span>,</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>                      multiple_entries,</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>                      multiple_entries == 1 ? <span class="stringliteral">""</span> : <span class="stringliteral">"s"</span>);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     }</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span> </div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     <span class="keywordflow">if</span> (0) {</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>         <span class="comment">/* Select brightest std */</span></div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         <span class="keywordflow">if</span> (fors_std_star_list_size(std_ccd) <= im->ncat) {</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>             std_ccd_bright = fors_std_star_list_duplicate(std_ccd,</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>                     fors_std_star_duplicate);</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>         }</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>             fors_std_star *kth =</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>                     fors_std_star_list_kth(std_ccd,</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>                             im->ncat + 1,</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>                             fors_std_star_brighter_than, NULL);</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> </div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>             <span class="comment">//fors_std_star_print_list(std_ccd);</span></div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>             std_ccd_bright = fors_std_star_list_extract(</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>                     std_ccd, fors_std_star_duplicate, </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>                     <a class="code" href="group__fors__identify.html#ga1c91776ec58d5026026e00580f18f277" title="Compare brightness.">std_brighter_than</a>, kth);</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>         }</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> </div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>         <span class="keywordflow">if</span> (fors_std_star_list_size(std_ccd_bright) < 3) {</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span> </div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>             cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>                     <span class="stringliteral">"Too few catalog stars (%d) available for pattern "</span></div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>                     <span class="stringliteral">"matching, assuming FITS header WCS solution"</span>,</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>                     fors_std_star_list_size(std_ccd_bright));</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> </div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>             sx_00 = 0;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>             sy_00 = 0;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>         }</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> </div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>             <span class="keywordtype">double</span> med_scale, med_angle;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>             cpl_msg_info(cpl_func, <span class="stringliteral">"Using %d brightest standards"</span>,</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>                          fors_std_star_list_size(std_ccd_bright));</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span> </div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>             fors_std_star_print_list(CPL_MSG_DEBUG, std_ccd_bright);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>             <span class="comment">/* Select sources */</span></div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>             <span class="keywordtype">int</span> n_sources = </div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>                     (int) (fors_std_star_list_size(std_ccd_bright)*im->nsource + 0.5);</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span> </div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>             <span class="keywordflow">if</span> (fors_star_list_size(stars) <= n_sources) {</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>                 source_bright = fors_star_list_duplicate(stars,</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>                         <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>);</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>             }</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>                 <a class="code" href="struct__fors__star.html">fors_star</a> *kth =</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>                         fors_star_list_kth(stars,</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>                                 n_sources + 1,</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>                                 <a class="code" href="group__fors__star.html#ga7672a63fe0deea93cb8bae8362b6d020" title="Compare star brightness.">fors_star_brighter_than</a>, NULL);</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>                 source_bright = fors_star_list_extract(</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>                         stars, <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>,</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>                         <a class="code" href="group__fors__identify.html#ga75bfe0adc06bd97c18925132d4abf937" title="Compare brightness.">star_brighter_than</a>, kth);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>             }</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span> </div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>             cpl_msg_info(cpl_func, <span class="stringliteral">"Using %d brightest sources"</span>, </div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>                          fors_star_list_size(source_bright));</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>             <a class="code" href="group__fors__star.html#ga4e15f3d1dbd18c8e010dc4ef82401d7d" title="Print list of stars.">fors_star_print_list</a>(CPL_MSG_DEBUG, source_bright);</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> </div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span> </div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>             status = 0;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>             <a class="code" href="group__fors__identify.html#gabbed61b85afc33d67894bd2dd1f061f3" title="Match patterns.">match_patterns</a>(source_bright, std_ccd_bright,</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>                            im->kappa,</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>                            &sx_00, &sy_00, &med_scale, &med_angle, &status);</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> </div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>             <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Pattern matching failed"</span> );</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> </div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span> </div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>             <span class="keywordflow">if</span> (status) {</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>                 cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>                         <span class="stringliteral">"BAD pattern matching solution rejected."</span>);</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span> </div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>                 <span class="keywordflow">if</span> (med_scale > 1.1 || med_scale < 0.9) {</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>                     cpl_msg_warning(cpl_func, <span class="stringliteral">"Unexpected scale from pattern "</span></div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>                             <span class="stringliteral">"matching (expected 1.0): assuming FITS header WCS solution"</span>);</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>                 }</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span> </div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>                 offset = sqrt(sx_00 * sx_00 + sy_00 * sy_00);</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span> </div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>                 <span class="keywordflow">if</span> (offset > im->max_offset) {</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>                     cpl_msg_warning(cpl_func, <span class="stringliteral">"Pattern matching identifications "</span></div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>                             <span class="stringliteral">"are more than %.2f pixel off their expected positions (max "</span></div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>                             <span class="stringliteral">"allowed was: %.2f). Pattern matching solution is rejected, "</span></div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>                             <span class="stringliteral">"FITS header WCS solution is used instead!"</span>, offset, </div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>                             im->max_offset);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>                 }</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span> </div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>                 sx_00 = 0;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>                 sy_00 = 0;</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>             }</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>         }</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>         cpl_msg_info(cpl_func, </div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>                      <span class="stringliteral">"Average shift from pattern matching = (%.2f, %.2f) pixels"</span>, </div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>                      sx_00, sy_00);</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     }</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span> </div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span> <span class="comment">     * Begin here alternative algorithm to pattern matching</span></div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> </div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     <span class="keywordtype">double</span>               search_radius = im->max_offset;</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     <span class="keyword">const</span> fors_std_star *catalog_star;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a>     *ccd_star;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     <span class="keywordtype">float</span>                dx, dy;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     <span class="keywordtype">int</span>                  npix = (2 * search_radius + 1);</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     cpl_image           *histo = cpl_image_new(npix, npix, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     <span class="keywordtype">int</span>                 *dhisto = cpl_image_get_data(histo);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     cpl_size             xpos, ypos;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     <span class="keywordtype">int</span>                  i, rebin, max;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     <span class="keywordtype">int</span>                  found = 0;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> </div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="keywordflow">for</span> (catalog_star = fors_std_star_list_first_const(std_ccd);</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>             catalog_star != NULL;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>             catalog_star = fors_std_star_list_next_const(std_ccd)) {</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> </div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>         <span class="keywordflow">for</span> (ccd_star = fors_star_list_first_const(stars);</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>                 ccd_star != NULL;</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>                 ccd_star = fors_star_list_next_const(stars)) {</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span> </div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>             dx = catalog_star->pixel->x - ccd_star->pixel->x;</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>             dy = catalog_star->pixel->y - ccd_star->pixel->y;</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> </div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>             <span class="keywordflow">if</span> (fabs(dx) < search_radius) {</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>                 <span class="keywordflow">if</span> (fabs(dy) < search_radius) {</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>                     xpos = search_radius + floor(dx + 0.5);</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>                     ypos = search_radius + floor(dy + 0.5);</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>                     ++dhisto[xpos + ypos * npix];</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>                 }</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>             }</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>         }</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     }</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> </div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     max = 0;</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     <span class="keywordflow">for</span> (i = 0; i < npix * npix; i++) {</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>         <span class="keywordflow">if</span> (max < dhisto[i]) {</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>             max = dhisto[i];</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>         }</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     }</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span> </div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     <span class="keywordflow">if</span> (max == 0) {</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>         cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>                 <span class="stringliteral">"WCS offset determination failed."</span>);</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>         sx_00 = 0.0;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>         sy_00 = 0.0;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     }</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>         rebin = 0;</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>         <span class="keywordflow">for</span> (i = 0; i < npix * npix; i++) {</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>             <span class="keywordflow">if</span> (max == dhisto[i]) {</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>                 <span class="keywordflow">if</span> (found) {</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>                     cpl_image *rebinned;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>                     found = 2;</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>                     rebin = 1;</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>                     cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>                                     <span class="stringliteral">"More than one WCS offset found, try rebinning..."</span>);</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>                     rebinned = cpl_image_rebin(histo, 1, 1, 3, 3);</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>                     cpl_image_delete(histo);</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>                     histo = rebinned;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>                     dhisto = cpl_image_get_data(histo);</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>                     npix = cpl_image_get_size_x(histo);</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>                     search_radius /= 3;</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>                 }</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>                     found = 1;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>                 }</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>             }</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>         }</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span> </div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>         <span class="keywordflow">if</span> (found > 1) {</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>             found = max = 0;</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>             <span class="keywordflow">for</span> (i = 0; i < npix * npix; i++) {</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>                 <span class="keywordflow">if</span> (max < dhisto[i]) {</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>                     max = dhisto[i];</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>                 }</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>             }</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span> </div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>             <span class="keywordflow">for</span> (i = 0; i < npix * npix; i++) {</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>                 <span class="keywordflow">if</span> (max == dhisto[i]) {</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>                     <span class="keywordflow">if</span> (found) {</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> </div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>                         <span class="comment">/*</span></div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span> <span class="comment">                         * Check if connected to previously found maxima</span></div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> <span class="comment">                         */</span></div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span> </div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>                         <span class="keywordtype">int</span> connected = 0;</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span> </div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>                         <span class="keywordflow">if</span> (i > 0) {</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>                             <span class="keywordflow">if</span> (max == dhisto[i-1]) {</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>                                 connected = 1;</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>                             }</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>                         }</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>                         <span class="keywordflow">if</span> (i > npix) {</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>                             <span class="keywordflow">if</span> (max == dhisto[i-npix-1] || </div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>                                     max == dhisto[i-npix]   ||</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>                                     max == dhisto[i-npix+1]) {</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>                                 connected = 1;</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>                             }</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>                         }</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> </div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>                         <span class="keywordflow">if</span> (!connected) {</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>                             found = 2;</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>                             cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>                                             <span class="stringliteral">"WCS offset determination failed."</span>);</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>                             sx_00 = 0.0;</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>                             sy_00 = 0.0;</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>                             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>                         }</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>                     }</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>                         found = 1;</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>                     }</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>                 }</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>             }</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>         }</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     }</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <span class="keywordflow">if</span> (found == 1) {</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>         cpl_image_get_maxpos(histo, &xpos, &ypos);</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>         xpos--;</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>         ypos--;</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> </div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span> <span class="comment">         * Refine peak position</span></div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> </div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>         <span class="keywordtype">float</span> xmean = 0.0;</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>         <span class="keywordtype">float</span> ymean = 0.0;</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>         <span class="keywordtype">int</span>   i, j, count = 0;</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span> </div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>         <span class="keywordflow">for</span> (i = xpos - 1; i <= xpos; i++) {</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>             <span class="keywordflow">for</span> (j = ypos - 1; j <= ypos; j++) {</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>                 <span class="keywordflow">if</span> (i >= 0 && i < npix) {</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>                     <span class="keywordflow">if</span> (j >= 0 && j < npix) {</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>                         xmean += i * dhisto[i + j*npix];</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>                         ymean += j * dhisto[i + j*npix];</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>                         count += dhisto[i + j*npix];</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>                     }</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>                 }</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>             }</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>         }</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span> </div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>         sx_00 = search_radius - xmean / count - 0.5;</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>         sy_00 = search_radius - ymean / count - 0.5;</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span> </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>         <span class="keywordflow">if</span> (rebin) {</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>             sx_00 *= 3;</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>             sy_00 *= 3;</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>         }</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span> </div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span> <span class="comment">        cpl_msg_info(cpl_func, </span></div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span> <span class="comment">                 "Average shift from histogram method = (%.2f, %.2f) pixels", </span></div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span> <span class="comment">                 sx_00, sy_00);</span></div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span> </div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>         <span class="comment">//        cpl_image_save(histo, "histogram.fits", CPL_BPP_32_SIGNED, NULL,</span></div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>         <span class="comment">//                       CPL_IO_DEFAULT);</span></div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>         <span class="comment">//</span></div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>         <span class="comment">//        cpl_image_delete(histo);</span></div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     }</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> </div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     <span class="keywordflow">if</span> (histogram) </div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>         *histogram = histo;</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>         cpl_image_delete(histo);</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> </div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     offset = sqrt(sx_00 * sx_00 + sy_00 * sy_00);</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> </div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     <span class="keywordflow">if</span> (offset > im->max_offset) {</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Offset with respect to WCS is %.2f pixel "</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>                 <span class="stringliteral">"(max allowed was: %.2f). This offset is rejected."</span>,</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>                 offset, im->max_offset);</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> </div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>         sx_00 = 0;</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>         sy_00 = 0;</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>     }</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span> </div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> <span class="comment">     * End here alternative algorithm to pattern matching</span></div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span> </div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>     <span class="comment">/* Finally, make the identification if a unique source is found </span></div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span> <span class="comment">       within the corrected position search radius.</span></div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span> <span class="comment"></span></div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> <span class="comment">       Use all catalog stars (inside CCD).</span></div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span> </div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     <span class="keywordflow">if</span> (sx_00 == 0.0 && sy_00 == 0.0) {</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"No standard star could be identified."</span>);</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>         cleanup;</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     }</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span> </div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     <span class="keywordtype">int</span> number_of_ids = 0;</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     <span class="keywordtype">bool</span> require_unique = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     search_radius = im->search;</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span> </div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>     <span class="keywordflow">while</span> (number_of_ids == 0 && search_radius <= im->max_search) {</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span> </div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Identification"</span>);</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span> </div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Average shift with WCS = (%.2f, %.2f) pixels"</span>,</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>                      sx_00,</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>                      sy_00);</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span> </div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>         <span class="keywordflow">if</span> (fabs(sx_00) > 10.0) {</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Large x-shift"</span>);</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>         }</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>         <span class="keywordflow">if</span> (fabs(sy_00) > 10.0) {</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Large y-shift"</span>);</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>         }</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span> </div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"search_radius = %.2f pixels"</span>, search_radius);</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span> </div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>         <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>             <span class="keywordtype">double</span> shift_x, shift_y;</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>             <span class="keyword">const</span> fors_std_star *ref;</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>         } data;</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span> </div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>         data.shift_x = sx_00;</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>         data.shift_y = sy_00;</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span> </div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>         <span class="keywordflow">if</span> (fors_star_list_size(stars) > 0) {</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>             <span class="keywordflow">for</span> (data.ref = fors_std_star_list_first_const(std_ccd);</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>                     data.ref != NULL;</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>                     data.ref = fors_std_star_list_next_const(std_ccd)) {</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span> </div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>                 <a class="code" href="struct__fors__star.html">fors_star</a> *nearest_1 = fors_star_list_kth(stars,</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>                         1,</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>                         <a class="code" href="group__fors__identify.html#ga95a6f76b39659c4ce77f5f4ae3366a6f" title="Tell if a source is closest to a catalog star.">star_nearer</a>,</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>                         &data);</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> </div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>                 <span class="keywordflow">if</span> (fors_star_list_size(stars) > 1) {</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span> </div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>                     <a class="code" href="struct__fors__star.html">fors_star</a> *nearest_2 = fors_star_list_kth(stars,</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>                             2,</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>                             <a class="code" href="group__fors__identify.html#ga95a6f76b39659c4ce77f5f4ae3366a6f" title="Tell if a source is closest to a catalog star.">star_nearer</a>,</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>                             &data);</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span> </div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Nearest candidates at "</span></div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>                                   <span class="stringliteral">"distance %f and %f pixels"</span>,</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>                                   sqrt(<a class="code" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025" title="Distance between source and shifted catalog star.">distsq_shift</a>(nearest_1, data.ref, </div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>                                           data.shift_x, </div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>                                           data.shift_y)),</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>                                           sqrt(<a class="code" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025" title="Distance between source and shifted catalog star.">distsq_shift</a>(nearest_2, data.ref, </div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>                                                   data.shift_x, </div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>                                                   data.shift_y)));</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span> </div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025" title="Distance between source and shifted catalog star.">distsq_shift</a>(nearest_1, data.ref, </div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>                             data.shift_x, data.shift_y) <= </div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>                             search_radius * search_radius) {</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span> </div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>                         <span class="keywordflow">if</span> (!require_unique || </div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>                                 <a class="code" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025" title="Distance between source and shifted catalog star.">distsq_shift</a>(nearest_2, data.ref, </div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>                                         data.shift_x, data.shift_y) > </div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>                         search_radius * search_radius) {</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span> </div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>                             cpl_msg_debug(cpl_func, </div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>                                     <span class="stringliteral">"unique source inside %f pixels"</span>,</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>                                     search_radius);</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span> </div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>                             nearest_1->id = fors_std_star_duplicate(data.ref);</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>                             number_of_ids += 1;</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>                         }</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>                     }</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>                 }</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Nearest candidate at "</span></div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>                             <span class="stringliteral">"distance %f pixels"</span>,</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>                             sqrt(<a class="code" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025" title="Distance between source and shifted catalog star.">distsq_shift</a>(nearest_1, data.ref, </div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>                                     data.shift_x, </div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>                                     data.shift_y)));</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025" title="Distance between source and shifted catalog star.">distsq_shift</a>(nearest_1, data.ref, </div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>                             data.shift_x, data.shift_y) <=</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>                             search_radius * search_radius) {</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span> </div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>                         cpl_msg_debug(cpl_func, </div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>                                 <span class="stringliteral">"unique source inside %f pixels"</span>,</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>                                 search_radius);</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span> </div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>                         nearest_1->id = fors_std_star_duplicate(data.ref);</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>                         number_of_ids += 1;</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>                     }</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>                 }</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>             }</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>         }</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span> </div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Identified %d star%s"</span>,</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>                      number_of_ids, (number_of_ids == 1) ? <span class="stringliteral">""</span> : <span class="stringliteral">"s"</span>);</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span> </div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>         <span class="keywordflow">if</span> (number_of_ids == 0) {</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span> </div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>             <span class="keywordflow">if</span> (fabs(sx_00) > 0.1 && </div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>                     fabs(sy_00) > 0.1) {</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span> </div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>                 cpl_msg_debug(cpl_func,</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>                         <span class="stringliteral">"No identifications made, "</span></div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>                         <span class="stringliteral">"set shift to zero and try again"</span>);</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>                 search_radius = 20;</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>                 require_unique = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span> </div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>                 sx_00 = 0;</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>                 sy_00 = 0;</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>             }</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>                 require_unique = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span> </div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>                 search_radius *= 2;</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span> </div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>                 cpl_msg_debug(cpl_func,</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>                               <span class="stringliteral">"No identifications made, "</span></div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>                               <span class="stringliteral">"double search radius and try again"</span>);</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>             }</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>         }</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span> </div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span> </div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>     } <span class="comment">/* while no identifications made */</span></div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span> </div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>     <span class="keywordflow">if</span> (number_of_ids == 0) {</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>         cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>                 <span class="stringliteral">"No identifications made, "</span></div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>                 <span class="stringliteral">"within search radius %f pixels"</span>,</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>                 im->max_search);</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>         <span class="comment">/* When maxsearchradius was a parameter</span></div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span> <span class="comment"></span></div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span> <span class="comment">        cpl_msg_warning(cpl_func,</span></div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span> <span class="comment">                        "No identifications made, "</span></div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span> <span class="comment">                        "max search radius reached: %f pixels",</span></div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span> <span class="comment">                        im->max_search);</span></div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>     }</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>         <span class="comment">/* Sketch to recompute shift:</span></div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span> <span class="comment">         *    Get median shifts (in x and y) of identified stars.</span></div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span> <span class="comment">         *    Then do the equivalent of a single tour through the while() loop above</span></div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span> <span class="comment">         *    </span></div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span> <span class="comment">         *    This could perhaps be unified with the code above to avoid duplication</span></div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>     }</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span> </div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span> </div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span> </div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>     cleanup;</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span> }</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span> </div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00976"></a><span class="lineno"><a class="code" href="group__fors__identify.html#ga2bf16455ff9dadaa26861905f8999616">  976</a></span> <a class="code" href="group__fors__identify.html#ga2bf16455ff9dadaa26861905f8999616" title="Determine if star is inside region.">inside_region</a>(<span class="keyword">const</span> fors_std_star *std,</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>               <span class="keywordtype">void</span> *reg)</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span> {</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>     <span class="keyword">const</span> <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>         <span class="keywordtype">int</span> xlo, ylo;</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>         <span class="keywordtype">int</span> xhi, yhi;</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>     } *region = reg;</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span> </div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>     <span class="keywordflow">return</span></div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>         region->xlo <= std->pixel->x && std->pixel->x <= region->xhi &&</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>         region->ylo <= std->pixel->y && std->pixel->y <= region->yhi;</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span> }</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span> </div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span> </div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span> </div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span> <span class="preprocessor">    fors_point_list_delete(&std_points, fors_point_delete); \</span></div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span> <span class="preprocessor">    fors_point_list_delete(&source_points, fors_point_delete); \</span></div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span> <span class="preprocessor">    fors_pattern_list_delete(&std_patterns, fors_pattern_delete); \</span></div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span> <span class="preprocessor">    fors_pattern_list_delete(&source_patterns, fors_pattern_delete); \</span></div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span> <span class="preprocessor">    double_list_delete(&scales, double_delete); \</span></div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span> <span class="preprocessor">    double_list_delete(&angles, double_delete); \</span></div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span> <span class="preprocessor">    double_list_delete(&angle_cos, double_delete); \</span></div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span> <span class="preprocessor">    double_list_delete(&angle_sin, double_delete); \</span></div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span> <span class="preprocessor">    double_list_delete(&match_dist, double_delete); \</span></div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span> <span class="preprocessor">    double_list_delete(&shiftx, double_delete); \</span></div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span> <span class="preprocessor">    double_list_delete(&shifty, double_delete); \</span></div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l01023"></a><span class="lineno"><a class="code" href="group__fors__identify.html#gabbed61b85afc33d67894bd2dd1f061f3"> 1023</a></span> <a class="code" href="group__fors__identify.html#gabbed61b85afc33d67894bd2dd1f061f3" title="Match patterns.">match_patterns</a>(<span class="keyword">const</span> fors_star_list *stars, </div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>                <span class="keyword">const</span> fors_std_star_list *std,</div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>                <span class="keywordtype">double</span> kappa,</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>                <span class="keywordtype">double</span> *sx_00,</div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>                <span class="keywordtype">double</span> *sy_00,</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>                <span class="keywordtype">double</span> *med_scale,</div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>                <span class="keywordtype">double</span> *med_angle,</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>                <span class="keywordtype">int</span>    *status)</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span> {</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>     fors_point_list *std_points = NULL;</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>     fors_point_list *source_points = NULL;</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span> </div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>     fors_pattern_list *std_patterns = NULL;</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>     fors_pattern_list *source_patterns = NULL;</div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span> </div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>     double_list *scales = NULL;</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>     double_list *angles = NULL;</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>     double_list *angle_cos = NULL;</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>     double_list *angle_sin = NULL;</div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>     double_list *match_dist = NULL;</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>     double_list *shiftx = NULL;</div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>     double_list *shifty = NULL;</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span> </div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>     *status = 0;</div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span> </div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( sx_00 != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( sy_00 != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>   </div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>     <span class="comment">/* Build patterns */</span></div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>     std_points = fors_point_list_new();</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>     {</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>         <span class="keyword">const</span> fors_std_star *s;</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>         </div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>         <span class="keywordflow">for</span> (s = fors_std_star_list_first_const(std);</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>              s != NULL;</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>              s = fors_std_star_list_next_const(std)) {</div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>             </div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>             fors_point_list_insert(std_points,</div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>                                    <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(s->pixel->x,</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>                                                   s->pixel->y));</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>         }</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>     }</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>     </div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>     source_points = fors_point_list_new();</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>     {</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>         <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s;</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>         </div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>         <span class="keywordflow">for</span> (s = fors_star_list_first_const(stars);</div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>              s != NULL;</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>              s = fors_star_list_next_const(stars)) {</div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>             </div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>             fors_point_list_insert(source_points,</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>                                    <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(s->pixel->x,</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>                                                   s->pixel->y));</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>         }</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>     }</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span> </div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>     <span class="keyword">const</span> <span class="keywordtype">double</span> min_dist = 1.0; <span class="comment">/* minimum distance between two </span></div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span> <span class="comment">                                    points in a pattern */</span></div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>     <span class="keywordtype">double</span> sigma_std = 0.0; <span class="comment">/* No uncertainty of catalog patterns */</span></div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>     std_patterns = </div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>         fors_pattern_new_from_points(std_points, min_dist, sigma_std);</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Created %d catalog patterns"</span>,</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>                  fors_pattern_list_size(std_patterns));</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span> </div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>     <span class="keywordtype">double</span> sigma_source;</div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>     <span class="keywordflow">if</span> (fors_star_list_size(stars) > 0) {</div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>     sigma_source = fors_star_list_median(stars,</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>                          <a class="code" href="group__fors__star.html#ga2c97d2c47686016fa04c59b2a3e92b5c" title="Get star size.">fors_star_extension</a>, NULL);</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Average source extension = %.2f pixels"</span>, sigma_source);</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>     sigma_source = -1; <span class="comment">/* not used in this case */</span></div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>     }</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>     source_patterns = </div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>     fors_pattern_new_from_points(source_points, min_dist, sigma_source);</div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span> </div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Created %d source patterns"</span>,</div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>                  fors_pattern_list_size(source_patterns));</div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>     </div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>     scales = double_list_new();</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>     angles = double_list_new();</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>     angle_cos = double_list_new();</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>     angle_sin = double_list_new();</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>     match_dist = double_list_new();</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span> </div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>     <span class="keywordflow">if</span> ( fors_pattern_list_size(source_patterns) > 0) {</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>     <span class="comment">/* Identify, </span></div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span> <span class="comment">       get average scale, orientation */</span></div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>     <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p;</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>         </div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>     <span class="keywordflow">for</span> (p = fors_pattern_list_first(std_patterns);</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>          p != NULL;</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>          p = fors_pattern_list_next(std_patterns)) {</div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>         </div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>         <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *nearest_source = </div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>         fors_pattern_list_min_val(source_patterns,</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>                       (fors_pattern_list_func_eval) fors_pattern_distsq,</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>                       p);</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>         </div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>         <span class="keywordtype">double</span> scale = fors_pattern_get_scale(p, nearest_source);</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>         <span class="keywordtype">double</span> angle = fors_pattern_get_angle(p, nearest_source);</div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>         <span class="keywordtype">double</span> angle_c = cos(angle);</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>         <span class="keywordtype">double</span> angle_s = sin(angle);</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>         <span class="keywordtype">double</span> dist = sqrt(fors_pattern_distsq(p, nearest_source));</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>         <span class="keywordtype">double</span> dist_per_error = fors_pattern_dist_per_error(p, nearest_source);</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>         </div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"dist, ndist, scale, orientation = %f, %f, %f, %f"</span>,</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>               dist, dist_per_error, scale, angle * 360/(2*M_PI));</div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>         </div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>         <span class="comment">/* Make identification if patterns match within error bars</span></div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span> <span class="comment">           (defined above as sigma_source) </span></div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>         <span class="keywordflow">if</span> (dist_per_error < 1.0) {</div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>         double_list_insert(scales   , double_duplicate(&scale));</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>         double_list_insert(angles   , double_duplicate(&angle));</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>         double_list_insert(angle_cos, double_duplicate(&angle_c));</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>         double_list_insert(angle_sin, double_duplicate(&angle_s));</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>         double_list_insert(match_dist, double_duplicate(&dist));</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>         }</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>     }</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>     }</div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>     <span class="comment">/* no source patterns to match */</span></div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>     }</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>     </div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>     <span class="keywordflow">if</span> ( double_list_size(scales) >= 2 ) {</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>         <span class="keywordtype">double</span> scale_avg   = double_list_median(scales, double_eval, NULL);</div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>         <span class="keywordtype">double</span> scale_stdev = double_list_mad(scales, double_eval, NULL) * STDEV_PR_MAD;</div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>         </div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Median scale = %.4f +- %.4f"</span>,</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>                      scale_avg, scale_stdev);</div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span> </div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>         *med_scale = scale_avg;</div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>         </div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>         <span class="keywordflow">if</span> (scale_stdev > 0.2) {</div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Uncertain scale determination"</span>);</div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>             *status = 1;</div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>         }</div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>         </div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>         <span class="comment">/* </span></div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span> <span class="comment">         * Represent each angle as a unit vector, compute average </span></div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span> <span class="comment">         * unit vector orientation.</span></div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span> <span class="comment">         * Compute median absolute deviation with respect to this average </span></div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>         <span class="keywordtype">double</span> angle_avg = atan2(double_list_mean(angle_sin, double_eval, NULL),</div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>                                  double_list_mean(angle_cos, double_eval, NULL));</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>         <span class="keywordtype">double</span> angle_stdev = STDEV_PR_MAD *</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>             double_list_median(angles, (double_list_func_eval) <a class="code" href="group__fors__utils.html#ga69350709e5f9874601c729becd315e81" title="Difference between angles.">fors_angle_diff</a>, &angle_avg);</div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>         </div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Average orientation = %.1f +- %.1f degrees"</span>,</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>                      angle_avg   * 360 / (2*M_PI),</div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>                      angle_stdev * 360 / (2*M_PI));</div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span> </div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>         *med_angle = angle_avg;</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>         </div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>         <span class="keywordflow">if</span> (angle_avg > M_PI/4 || angle_avg < -M_PI/4) {</div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Expected orientation = 0 degrees"</span>);</div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>             *status = 1;</div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>             <span class="comment">/* To model any orientation, we should use higher order (than zero) polynomials</span></div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span> <span class="comment">               for the shifts */</span></div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>         }</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>         </div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>         <span class="keywordtype">double</span> avg_dist   = double_list_mean(match_dist, double_eval, NULL);</div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>         <span class="keywordtype">double</span> false_dist = 1.0/sqrt(M_PI * fors_pattern_list_size(source_patterns));</div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>         <span class="comment">/* Average distance to nearest false match */</span></div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>         </div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Average match distance = %f pixel"</span>, avg_dist);</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"False match distance = %f pixel"</span>, false_dist);</div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Safety index = %.3f (should be >~ 5)"</span>, </div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>                      false_dist / avg_dist);</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>         <span class="keywordflow">if</span> (false_dist / avg_dist < 1.5) {</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Uncertain pattern matching"</span>);</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>             *status = 1;</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>         }</div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>         </div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>         <span class="comment">/* Get shift from matches */</span></div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>         shiftx = double_list_new();</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>         shifty = double_list_new();</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>         {</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>             <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p;</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>             </div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>             <span class="keywordflow">for</span> (p = fors_pattern_list_first(std_patterns);</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>                  p != NULL;</div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>                  p = fors_pattern_list_next(std_patterns)) {</div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>                 </div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>                 <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *nearest_source = </div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>                     fors_pattern_list_min_val(</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>                         source_patterns,</div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>                         (fors_pattern_list_func_eval) fors_pattern_distsq,</div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>                         p);</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>                 </div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>                 <span class="keywordtype">double</span> dist = sqrt(fors_pattern_distsq(p, nearest_source));</div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>                 <span class="keywordtype">double</span> dist_per_error = fors_pattern_dist_per_error(p, nearest_source);</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>                 <span class="keywordtype">double</span> scale = fors_pattern_get_scale(p, nearest_source);</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>                 <span class="keywordtype">double</span> angle = fors_pattern_get_angle(p, nearest_source);</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>                 </div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>                 cpl_msg_debug(cpl_func, <span class="stringliteral">"scale, orientation, distance, norm.distance "</span></div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>                               <span class="stringliteral">"= %f, %f, %f, %f"</span>,</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>                               scale, angle * 360/(2*M_PI), dist, dist_per_error);</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>                 </div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>                 <span class="keywordflow">if</span> (dist_per_error < 1.0 &&</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>                     fabs(scale - scale_avg)             <= kappa * scale_stdev &&</div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>             <a class="code" href="group__fors__utils.html#ga69350709e5f9874601c729becd315e81" title="Difference between angles.">fors_angle_diff</a>(&angle, &angle_avg) <= kappa * angle_stdev) {</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>                     </div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>                     <span class="comment">/* Compute shift of the two patterns' reference stars */</span></div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>                     <span class="keywordtype">double</span> shift_x = fors_pattern_get_ref(nearest_source)->x - fors_pattern_get_ref(p)->x;</div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>                     <span class="keywordtype">double</span> shift_y = fors_pattern_get_ref(nearest_source)->y - fors_pattern_get_ref(p)->y;</div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>                     </div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Accepted, shift = (%f, %f) pixels"</span>, </div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>                                   shift_x, shift_y);</div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>                     </div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>                     double_list_insert(shiftx, double_duplicate(&shift_x));</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>                     double_list_insert(shifty, double_duplicate(&shift_y));</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>                 }</div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>             } </div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>         }</div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span> </div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>     <span class="keywordflow">if</span> (double_list_size(shiftx) > 0) {</div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>         *sx_00 = double_list_median(shiftx, double_eval, NULL);</div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>     }</div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>         <span class="comment">/* If this happens it is likely a bug, because</span></div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span> <span class="comment">           we already checked that 'scales' is non-empty.</span></div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span> <span class="comment"></span></div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span> <span class="comment">           But do not try to get the median of an empty list in any case,</span></div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span> <span class="comment">           which would cause a crash</span></div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"No standardstar identifications!"</span>);</div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>             *status = 1;</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>     }</div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span> </div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>     <span class="keywordflow">if</span> (double_list_size(shiftx) > 0) {</div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>         *sy_00 = double_list_median(shifty, double_eval, NULL);</div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>     }</div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"No standardstar identifications!"</span>);</div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>             *status = 1;</div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>     }</div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>     }</div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>         cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>                         <span class="stringliteral">"Too few (%d) matching patterns: assuming zero shift"</span>,</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>                         double_list_size(scales));</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>         *sx_00 = 0;</div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>         *sy_00 = 0;</div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>         *med_scale = 1.0;</div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>         *med_angle = 0.0;</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>     }</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span> </div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>     cleanup;</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span> }</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span> </div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span> </div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span> </div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>     </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__identify_8h-source.html b/html/fors__identify_8h-source.html
deleted file mode 100644
index 16b08d9..0000000
--- a/html/fors__identify_8h-source.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_identify.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_identify.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_identify.h,v 1.8 2011/05/09 13:08:59 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/05/09 13:08:59 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_IDENTIFY_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_IDENTIFY_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_star.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 CPL_BEGIN_DECLS
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__identify__method.html">_identify_method</a> identify_method;
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="keywordtype">void</span> 
-<a name="l00040"></a>00040 <a class="code" href="group__fors__identify.html#g62b335e73ad633535e1494f9ffd0cd03">fors_identify_define_parameters</a>(cpl_parameterlist *parameters, 
-<a name="l00041"></a>00041                 <span class="keyword">const</span> <span class="keywordtype">char</span> *context);
-<a name="l00042"></a>00042 identify_method *
-<a name="l00043"></a>00043 <a class="code" href="group__fors__identify.html#g2763139bd0ceba14e3be219d5d043e46">fors_identify_method_new</a>(<span class="keyword">const</span> cpl_parameterlist *parameters, <span class="keyword">const</span> <span class="keywordtype">char</span> *context);
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="keywordtype">void</span>
-<a name="l00046"></a>00046 <a class="code" href="group__fors__identify.html#g265af4d62a463db6eea76b808c2a4e8d">fors_identify_method_delete</a>(identify_method **im);
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="keywordtype">void</span>
-<a name="l00049"></a>00049 <a class="code" href="group__fors__identify.html#g879f2fc7b296f37722f6203d0ead78b6">fors_identify</a>(fors_star_list *stars, 
-<a name="l00050"></a>00050               fors_std_star_list *cat,
-<a name="l00051"></a>00051               <span class="keyword">const</span> identify_method *im,
-<a name="l00052"></a>00052               cpl_image **histogram);
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 CPL_END_DECLS
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__identify_8h_source.html b/html/fors__identify_8h_source.html
new file mode 100644
index 0000000..b7c9e71
--- /dev/null
+++ b/html/fors__identify_8h_source.html
@@ -0,0 +1,118 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_identify.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_identify.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_identify.h,v 1.10 2013-09-10 15:16:32 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 15:16:32 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.10 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_IDENTIFY_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_IDENTIFY_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_star.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__identify__method.html">_identify_method</a> identify_method;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <a class="code" href="group__fors__identify.html#gac0dc4fbd9cc717256e5972cad3e7447f" title="Define recipe parameters.">fors_identify_define_parameters</a>(cpl_parameterlist *parameters, </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *context);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> identify_method *</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <a class="code" href="group__fors__identify.html#ga642e6d38ae7b273d1901698a3970fd49" title="Get id method from parameter list.">fors_identify_method_new</a>(<span class="keyword">const</span> cpl_parameterlist *parameters, <span class="keyword">const</span> <span class="keywordtype">char</span> *context);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <a class="code" href="group__fors__identify.html#gaea1f0f7065727f62a6e3a5805549a9ce" title="Deallocate identifyion method and set the pointer to NULL.">fors_identify_method_delete</a>(identify_method **im);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <a class="code" href="group__fors__identify.html#ga734ab55ebf9bec1bed7e6330def7b6d8" title="Identify sources.">fors_identify</a>(fors_star_list *stars, </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>               fors_std_star_list *cat,</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>               <span class="keyword">const</span> identify_method *im,</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>               cpl_image **histogram);</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__image-test_8c-source.html b/html/fors__image-test_8c-source.html
deleted file mode 100644
index 02a5e93..0000000
--- a/html/fors__image-test_8c-source.html
+++ /dev/null
@@ -1,340 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_image-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_image-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_image-test.c,v 1.20 2007/11/23 14:24:24 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/11/23 14:24:24 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.20 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <test.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="preprocessor">#include <math.h></span>
-<a name="l00039"></a>00039 
-<a name="l00046"></a>00046 <span class="preprocessor">#undef cleanup</span>
-<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00048"></a>00048 <span class="preprocessor">do { \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">} while(0)</span>
-<a name="l00051"></a>00051 <span class="preprocessor"></span>
-<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00056"></a><a class="code" href="group__fors__image__test.html#g0565bfec6c6aec9b2991e35e9c929b5b">00056</a> <a class="code" href="group__fors__image__test.html#g0565bfec6c6aec9b2991e35e9c929b5b">test_image</a>(<span class="keywordtype">void</span>)
-<a name="l00057"></a>00057 {
-<a name="l00058"></a>00058     <span class="keyword">const</span> <span class="keywordtype">int</span> nx = 200; <span class="comment">/* Duplication here. Must be updated</span>
-<a name="l00059"></a>00059 <span class="comment">                           in synchronization with nx and ny in ./test_simulate.c */</span>
-<a name="l00060"></a>00060     <span class="keyword">const</span> <span class="keywordtype">int</span> ny = 200;
-<a name="l00061"></a>00061     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename = <span class="stringliteral">"fors_image.fits"</span>;
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063     cpl_frame *frame = cpl_frame_new();
-<a name="l00064"></a>00064     cpl_propertylist *header = cpl_propertylist_new();
-<a name="l00065"></a>00065     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00066"></a>00066     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00067"></a>00067     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00068"></a>00068     <a class="code" href="struct__fors__image.html">fors_image</a> *image;
-<a name="l00069"></a>00069     <span class="keywordtype">double</span> saturated;
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071     cpl_image_add_scalar(variance, 1.0);
-<a name="l00072"></a>00072     cpl_image_set(data, 1, 1, 1); <span class="comment">/* One non-saturated pixel */</span>
-<a name="l00073"></a>00073     image   = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l00074"></a>00074     
-<a name="l00075"></a>00075     <span class="comment">/* save, load */</span>
-<a name="l00076"></a>00076     {
-<a name="l00077"></a>00077         <span class="keywordtype">double</span> exptime = 423;
-<a name="l00078"></a>00078         <a class="code" href="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2">create_standard_keys</a>(header, exptime);
-<a name="l00079"></a>00079     }
-<a name="l00080"></a>00080 
-<a name="l00081"></a>00081     <a class="code" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save</a>(image, header, filename);
-<a name="l00082"></a>00082     <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image);
-<a name="l00083"></a>00083     cpl_frame_set_filename(frame, filename);
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(frame);
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087     image = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(frame, NULL, setting, &saturated);
-<a name="l00088"></a>00088     
-<a name="l00089"></a>00089     test_rel( saturated, 100 * (1 - 1.0 / (nx*ny)), 0.01 ); 
-<a name="l00090"></a>00090     test_eq( nx, <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(image) );
-<a name="l00091"></a>00091     test_eq( ny, <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(image) );
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     cpl_frame_delete(frame);
-<a name="l00094"></a>00094     cpl_propertylist_delete(header);
-<a name="l00095"></a>00095     <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image);
-<a name="l00096"></a>00096 
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098     <span class="comment">/* Test croppping */</span>
-<a name="l00099"></a>00099     data     = cpl_image_new(3, 2, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00100"></a>00100     variance = cpl_image_new(3, 2, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102     {
-<a name="l00103"></a>00103         <span class="keywordtype">int</span> x, y;
-<a name="l00104"></a>00104         <span class="keywordflow">for</span> (y = 1; y <= 2; y++) {
-<a name="l00105"></a>00105             <span class="keywordflow">for</span> (x = 1; x <= 3; x++) {
-<a name="l00106"></a>00106                 cpl_image_set(data, x, y, x*y);
-<a name="l00107"></a>00107             }
-<a name="l00108"></a>00108         }
-<a name="l00109"></a>00109         <span class="comment">/*</span>
-<a name="l00110"></a>00110 <span class="comment">          Input data now:</span>
-<a name="l00111"></a>00111 <span class="comment">            2 4 6</span>
-<a name="l00112"></a>00112 <span class="comment">            1 2 3</span>
-<a name="l00113"></a>00113 <span class="comment">        */</span>
-<a name="l00114"></a>00114     }
-<a name="l00115"></a>00115     cpl_image_add_scalar(variance, 1.0);
-<a name="l00116"></a>00116     image = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l00117"></a>00117     
-<a name="l00118"></a>00118     <span class="keywordtype">int</span> xlo = 2;
-<a name="l00119"></a>00119     <span class="keywordtype">int</span> xhi = 2;
-<a name="l00120"></a>00120     <span class="keywordtype">int</span> ylo = 1;
-<a name="l00121"></a>00121     <span class="keywordtype">int</span> yhi = 2;
-<a name="l00122"></a>00122     <a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a>(image, 
-<a name="l00123"></a>00123                     xlo, ylo, xhi, yhi);
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="comment">/*</span>
-<a name="l00126"></a>00126 <span class="comment">         Should have now:</span>
-<a name="l00127"></a>00127 <span class="comment">              4</span>
-<a name="l00128"></a>00128 <span class="comment">              2</span>
-<a name="l00129"></a>00129 <span class="comment">     */</span>
-<a name="l00130"></a>00130     test_eq( <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(image), 1 );
-<a name="l00131"></a>00131     test_eq( <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(image), 2 );
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133     test_rel( <a class="code" href="group__fors__image.html#gc4edb9a966bcf97a17ad6a5c1b9d020f">fors_image_get_min</a>(image), 2, 0.0001 );
-<a name="l00134"></a>00134     test_rel( <a class="code" href="group__fors__image.html#g5c7d9b043db23a40e632ffc34c3f3d5c">fors_image_get_max</a>(image), 4, 0.0001 );
-<a name="l00135"></a>00135     test_rel( <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(image, NULL), 3, 0.0001 );
-<a name="l00136"></a>00136     test_rel( <a class="code" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">fors_image_get_stdev</a>(image, NULL), sqrt(2), 0.0001 );
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138     <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00141"></a>00141     <span class="keywordflow">return</span>;
-<a name="l00142"></a>00142 }
-<a name="l00143"></a>00143 
-<a name="l00147"></a>00147 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00148"></a><a class="code" href="group__fors__image__test.html#g945cb1e4f748ebddb0ace30b987c5d59">00148</a> <a class="code" href="group__fors__image__test.html#g945cb1e4f748ebddb0ace30b987c5d59">test_median_filter</a>(<span class="keywordtype">void</span>)
-<a name="l00149"></a>00149 {
-<a name="l00150"></a>00150     <span class="comment">//const int nx = 4000;</span>
-<a name="l00151"></a>00151     <span class="comment">//const int ny = 2000;</span>
-<a name="l00152"></a>00152     <span class="keyword">const</span> <span class="keywordtype">int</span> nx = 400;
-<a name="l00153"></a>00153     <span class="keyword">const</span> <span class="keywordtype">int</span> ny = 200;
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     <span class="keyword">const</span> <span class="keywordtype">int</span> xradius = 1;
-<a name="l00156"></a>00156     <span class="keyword">const</span> <span class="keywordtype">int</span> yradius = 1;
-<a name="l00157"></a>00157     <span class="keyword">const</span> <span class="keywordtype">int</span> xstart = 1;
-<a name="l00158"></a>00158     <span class="keyword">const</span> <span class="keywordtype">int</span> ystart = 1;
-<a name="l00159"></a>00159     <span class="keyword">const</span> <span class="keywordtype">int</span> xend = nx;
-<a name="l00160"></a>00160     <span class="keyword">const</span> <span class="keywordtype">int</span> yend = ny;
-<a name="l00161"></a>00161     <span class="keyword">const</span> <span class="keywordtype">int</span> xstep = 1;
-<a name="l00162"></a>00162     <span class="keyword">const</span> <span class="keywordtype">int</span> ystep = 1;
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00165"></a>00165     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00166"></a>00166     
-<a name="l00167"></a>00167     <a class="code" href="struct__fors__image.html">fors_image</a> *image;
-<a name="l00168"></a>00168     cpl_image *smooth;
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170     cpl_image_add_scalar(variance, 1.0);
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172     image = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l00173"></a>00173     <span class="keywordtype">bool</span> use_data = <span class="keyword">true</span>;
-<a name="l00174"></a>00174     smooth = <a class="code" href="group__fors__image.html#g96498be3e15cde80921709406c33b6f3">fors_image_filter_median_create</a>(image,
-<a name="l00175"></a>00175                                              xradius, yradius,
-<a name="l00176"></a>00176                                              xstart, ystart,
-<a name="l00177"></a>00177                                              xend, yend,
-<a name="l00178"></a>00178                                              xstep, ystep,
-<a name="l00179"></a>00179                                              use_data);
-<a name="l00180"></a>00180     
-<a name="l00181"></a>00181     cpl_image_delete(smooth);
-<a name="l00182"></a>00182     <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image);
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">return</span>;
-<a name="l00185"></a>00185 }
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187 <span class="preprocessor">#undef cleanup</span>
-<a name="l00188"></a>00188 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00189"></a>00189 <span class="preprocessor">do { \</span>
-<a name="l00190"></a>00190 <span class="preprocessor">    fors_image_delete(&left); \</span>
-<a name="l00191"></a>00191 <span class="preprocessor">    fors_image_delete(&right); \</span>
-<a name="l00192"></a>00192 <span class="preprocessor">} while(0)</span>
-<a name="l00193"></a>00193 <span class="preprocessor"></span>
-<a name="l00197"></a>00197 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00198"></a><a class="code" href="group__fors__image__test.html#gd2be9c987ea7e4114c61df4ebefe5c0e">00198</a> <a class="code" href="group__fors__image__test.html#gd2be9c987ea7e4114c61df4ebefe5c0e">test_subtract</a>(<span class="keywordtype">void</span>)
-<a name="l00199"></a>00199 {
-<a name="l00200"></a>00200     <span class="comment">/* Simulate data */</span>
-<a name="l00201"></a>00201     <span class="keyword">const</span> <span class="keywordtype">int</span> nx = 20;
-<a name="l00202"></a>00202     <span class="keyword">const</span> <span class="keywordtype">int</span> ny = 30;
-<a name="l00203"></a>00203     <span class="keyword">const</span> <span class="keywordtype">double</span> values  = 17;
-<a name="l00204"></a>00204     <span class="keyword">const</span> <span class="keywordtype">double</span> variance = 5;
-<a name="l00205"></a>00205     cpl_image *left_data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00206"></a>00206     cpl_image *left_variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00207"></a>00207     cpl_image *right_data;
-<a name="l00208"></a>00208     cpl_image *right_variance;
-<a name="l00209"></a>00209     <a class="code" href="struct__fors__image.html">fors_image</a> *left, *right;
-<a name="l00210"></a>00210     <span class="keywordtype">double</span> error_before, error_after;
-<a name="l00211"></a>00211 
-<a name="l00212"></a>00212     cpl_image_add_scalar(left_data, values);
-<a name="l00213"></a>00213     cpl_image_add_scalar(left_variance, variance);
-<a name="l00214"></a>00214     
-<a name="l00215"></a>00215     right_data    = cpl_image_multiply_scalar_create(left_data, 0.6);
-<a name="l00216"></a>00216     right_variance = cpl_image_duplicate(left_variance);
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     left  = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(left_data , left_variance);
-<a name="l00219"></a>00219     right = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(right_data, right_variance);
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     error_before = <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(left, NULL);
-<a name="l00222"></a>00222 
-<a name="l00223"></a>00223     <span class="comment">/* Call function */</span>
-<a name="l00224"></a>00224     <a class="code" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">fors_image_subtract</a>(left, right);
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <span class="comment">/* Check results */</span>
-<a name="l00227"></a>00227     error_after = <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(left, NULL);
-<a name="l00228"></a>00228     test_rel( <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(left, NULL), values*(1-0.6), 0.001);
-<a name="l00229"></a>00229     test_rel( error_after, error_before*sqrt(2.0), 0.001);
-<a name="l00230"></a>00230     
-<a name="l00231"></a>00231     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00232"></a>00232     <span class="keywordflow">return</span>;
-<a name="l00233"></a>00233 }
-<a name="l00234"></a>00234 
-<a name="l00235"></a>00235 <span class="preprocessor">#undef cleanup</span>
-<a name="l00236"></a>00236 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00237"></a>00237 <span class="preprocessor">do { \</span>
-<a name="l00238"></a>00238 <span class="preprocessor">    fors_image_delete(&image); \</span>
-<a name="l00239"></a>00239 <span class="preprocessor">} while(0)</span>
-<a name="l00240"></a>00240 <span class="preprocessor"></span>
-<a name="l00244"></a>00244 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00245"></a><a class="code" href="group__fors__image__test.html#g683ef393a98e1ae90afb2013c635b08a">00245</a> <a class="code" href="group__fors__image__test.html#g683ef393a98e1ae90afb2013c635b08a">test_exponential</a>(<span class="keywordtype">void</span>)
-<a name="l00246"></a>00246 {
-<a name="l00247"></a>00247     <span class="comment">/* Simulate data */</span>
-<a name="l00248"></a>00248     <span class="keyword">const</span> <span class="keywordtype">int</span> nx = 20;
-<a name="l00249"></a>00249     <span class="keyword">const</span> <span class="keywordtype">int</span> ny = 30;
-<a name="l00250"></a>00250     <span class="keyword">const</span> <span class="keywordtype">double</span> values  = 17;
-<a name="l00251"></a>00251     <span class="keyword">const</span> <span class="keywordtype">double</span> var_val = 5;
-<a name="l00252"></a>00252     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00253"></a>00253     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00254"></a>00254     <span class="keywordtype">double</span> base = 10;
-<a name="l00255"></a>00255     <span class="keywordtype">double</span> dbase = -1;
-<a name="l00256"></a>00256     <a class="code" href="struct__fors__image.html">fors_image</a> *image;
-<a name="l00257"></a>00257     
-<a name="l00258"></a>00258     cpl_image_add_scalar(data, values);
-<a name="l00259"></a>00259     cpl_image_add_scalar(variance, var_val);
-<a name="l00260"></a>00260     
-<a name="l00261"></a>00261     image = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263     <span class="comment">/* Call function */</span>
-<a name="l00264"></a>00264     <a class="code" href="group__fors__image.html#g78afca4bf8e5c3dc80d0dcd7f682f9e9">fors_image_exponential</a>(image, base, dbase);
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266     <span class="comment">/* Check results */</span>
-<a name="l00267"></a>00267     test_rel( <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(image, NULL), pow(base, values), 0.001);
-<a name="l00268"></a>00268     
-<a name="l00269"></a>00269     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00270"></a>00270     <span class="keywordflow">return</span>;
-<a name="l00271"></a>00271 }
-<a name="l00272"></a>00272 
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274 <span class="preprocessor">#undef cleanup</span>
-<a name="l00275"></a><a class="code" href="group__fors__image__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00275</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00276"></a>00276 <span class="preprocessor">do { \</span>
-<a name="l00277"></a>00277 <span class="preprocessor">    fors_image_delete(&image); \</span>
-<a name="l00278"></a>00278 <span class="preprocessor">} while(0)</span>
-<a name="l00279"></a>00279 <span class="preprocessor"></span>
-<a name="l00282"></a>00282 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00283"></a><a class="code" href="group__fors__image__test.html#g761a8fb6f0c0f22ba364b1e9e231738a">00283</a> <a class="code" href="group__fors__image__test.html#g761a8fb6f0c0f22ba364b1e9e231738a">test_divide</a>(<span class="keywordtype">void</span>)
-<a name="l00284"></a>00284 {
-<a name="l00285"></a>00285     <span class="comment">/* Simulate data */</span>
-<a name="l00286"></a>00286     <span class="keyword">const</span> <span class="keywordtype">int</span> nx = 20;
-<a name="l00287"></a>00287     <span class="keyword">const</span> <span class="keywordtype">int</span> ny = 30;
-<a name="l00288"></a>00288     <span class="keyword">const</span> <span class="keywordtype">double</span> values  = 17;
-<a name="l00289"></a>00289     <span class="keyword">const</span> <span class="keywordtype">double</span> variance_value = 5;
-<a name="l00290"></a>00290     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00291"></a>00291     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00292"></a>00292     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;
-<a name="l00293"></a>00293     <span class="keywordtype">double</span> error_before, error_after;
-<a name="l00294"></a>00294 
-<a name="l00295"></a>00295     cpl_image_add_scalar(data    , values);
-<a name="l00296"></a>00296     cpl_image_add_scalar(variance, variance_value);
-<a name="l00297"></a>00297     
-<a name="l00298"></a>00298     image  = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l00299"></a>00299 
-<a name="l00300"></a>00300     error_before = 
-<a name="l00301"></a>00301         <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(image, NULL) /
-<a name="l00302"></a>00302         <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>      (image, NULL);
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304     <span class="comment">/* Call function */</span>
-<a name="l00305"></a>00305     <a class="code" href="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4">fors_image_divide</a>(image, image);
-<a name="l00306"></a>00306 
-<a name="l00307"></a>00307     <span class="comment">/* Check results,</span>
-<a name="l00308"></a>00308 <span class="comment">     * relative errors add in quadrature</span>
-<a name="l00309"></a>00309 <span class="comment">     */</span>
-<a name="l00310"></a>00310     error_after =
-<a name="l00311"></a>00311         <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(image, NULL) /
-<a name="l00312"></a>00312         <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>      (image, NULL);
-<a name="l00313"></a>00313     test_rel( <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(image, NULL), 1.0, 0.001 );
-<a name="l00314"></a>00314     test_rel( error_after, error_before*sqrt(2.0), 0.001 );
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00317"></a>00317     <span class="keywordflow">return</span>;
-<a name="l00318"></a>00318 }
-<a name="l00319"></a>00319 
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321 
-<a name="l00325"></a><a class="code" href="group__fors__image__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00325</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00326"></a>00326 {
-<a name="l00327"></a>00327     TEST_INIT;
-<a name="l00328"></a>00328 
-<a name="l00329"></a>00329     <a class="code" href="group__fors__image__test.html#g0565bfec6c6aec9b2991e35e9c929b5b">test_image</a>();
-<a name="l00330"></a>00330     
-<a name="l00331"></a>00331     <a class="code" href="group__fors__image__test.html#g945cb1e4f748ebddb0ace30b987c5d59">test_median_filter</a>();
-<a name="l00332"></a>00332 
-<a name="l00333"></a>00333     <a class="code" href="group__fors__image__test.html#gd2be9c987ea7e4114c61df4ebefe5c0e">test_subtract</a>();
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335     <a class="code" href="group__fors__image__test.html#g761a8fb6f0c0f22ba364b1e9e231738a">test_divide</a>();
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     <a class="code" href="group__fors__image__test.html#g683ef393a98e1ae90afb2013c635b08a">test_exponential</a>();
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339     TEST_END;
-<a name="l00340"></a>00340 }
-<a name="l00341"></a>00341 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__image-test_8c_source.html b/html/fors__image-test_8c_source.html
new file mode 100644
index 0000000..711549e
--- /dev/null
+++ b/html/fors__image-test_8c_source.html
@@ -0,0 +1,379 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_image-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_image-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_image-test.c,v 1.20 2007-11-23 14:24:24 jmlarsen Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: jmlarsen $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007-11-23 14:24:24 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.20 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="group__fors__image__test.html#ga8e2e648513e2b6ee3843dd026130d7a2">   56</a></span> <a class="code" href="group__fors__image__test.html#ga8e2e648513e2b6ee3843dd026130d7a2" title="Test functions.">test_image</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> {</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> nx = 200; <span class="comment">/* Duplication here. Must be updated</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="comment">                           in synchronization with nx and ny in ./test_simulate.c */</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> ny = 200;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> filename = <span class="stringliteral">"fors_image.fits"</span>;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     cpl_frame *frame = cpl_frame_new();</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_propertylist *header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image;</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <span class="keywordtype">double</span> saturated;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     cpl_image_add_scalar(variance, 1.0);</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     cpl_image_set(data, 1, 1, 1); <span class="comment">/* One non-saturated pixel */</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     image   = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <span class="comment">/* save, load */</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     {</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>         <span class="keywordtype">double</span> exptime = 423;</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>         <a class="code" href="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5" title="Write FORS standard keywords to simulated header.">create_standard_keys</a>(header, exptime);</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     }</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     <a class="code" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save</a>(image, header, filename);</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&image);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     cpl_frame_set_filename(frame, filename);</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(frame);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     image = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(frame, NULL, setting, &saturated);</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     test_rel( saturated, 100 * (1 - 1.0 / (nx*ny)), 0.01 ); </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     test_eq( nx, <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(image) );</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     test_eq( ny, <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(image) );</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_frame_delete(frame);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&image);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <span class="comment">/* Test croppping */</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     data     = cpl_image_new(3, 2, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     variance = cpl_image_new(3, 2, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     {</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>         <span class="keywordtype">int</span> x, y;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>         <span class="keywordflow">for</span> (y = 1; y <= 2; y++) {</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>             <span class="keywordflow">for</span> (x = 1; x <= 3; x++) {</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                 cpl_image_set(data, x, y, x*y);</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>             }</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>         }</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="comment">          Input data now:</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="comment">            2 4 6</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="comment">            1 2 3</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     }</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     cpl_image_add_scalar(variance, 1.0);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     image = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="keywordtype">int</span> xlo = 2;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="keywordtype">int</span> xhi = 2;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="keywordtype">int</span> ylo = 1;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="keywordtype">int</span> yhi = 2;</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053" title="Crop image.">fors_image_crop</a>(image, </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                     xlo, ylo, xhi, yhi);</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="comment">         Should have now:</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="comment">              4</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="comment">              2</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     test_eq( <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(image), 1 );</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     test_eq( <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(image), 2 );</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     test_rel( <a class="code" href="group__fors__image.html#ga918a9107b07852d77bd457ea44d9b28e" title="Get min data value.">fors_image_get_min</a>(image), 2, 0.0001 );</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     test_rel( <a class="code" href="group__fors__image.html#ga8bde38b5f976d70ab7d6cef4652e1a51" title="Get max data value.">fors_image_get_max</a>(image), 4, 0.0001 );</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     test_rel( <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(image, NULL), 3, 0.0001 );</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     test_rel( <a class="code" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e" title="Get empirical stdev of data.">fors_image_get_stdev</a>(image, NULL), sqrt(2), 0.0001 );</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&image);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     cleanup;</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> }</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno"><a class="code" href="group__fors__image__test.html#ga3fb4147d1739891fdc6ae6132e87d0bd">  148</a></span> <a class="code" href="group__fors__image__test.html#ga3fb4147d1739891fdc6ae6132e87d0bd" title="Median filtering benchmark.">test_median_filter</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> {</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="comment">//const int nx = 4000;</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="comment">//const int ny = 2000;</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> nx = 400;</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> ny = 200;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> xradius = 1;</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> yradius = 1;</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> xstart = 1;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> ystart = 1;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> xend = nx;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> yend = ny;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> xstep = 1;</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> ystep = 1;</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image;</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     cpl_image *smooth;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     cpl_image_add_scalar(variance, 1.0);</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     image = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     <span class="keywordtype">bool</span> use_data = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     smooth = <a class="code" href="group__fors__image.html#ga395b18920e75b55d9a793dfbcb99755f" title="Smooth image.">fors_image_filter_median_create</a>(image,</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>                                              xradius, yradius,</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>                                              xstart, ystart,</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>                                              xend, yend,</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>                                              xstep, ystep,</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>                                              use_data);</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     cpl_image_delete(smooth);</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&image);</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> }</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="preprocessor">    fors_image_delete(&left); \</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="preprocessor">    fors_image_delete(&right); \</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno"><a class="code" href="group__fors__image__test.html#ga460806546207179c6e136d31bdb922d5">  198</a></span> <a class="code" href="group__fors__image__test.html#ga460806546207179c6e136d31bdb922d5" title="Test image subtraction.">test_subtract</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> {</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     <span class="comment">/* Simulate data */</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> nx = 20;</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> ny = 30;</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="keyword">const</span> <span class="keywordtype">double</span> values  = 17;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     <span class="keyword">const</span> <span class="keywordtype">double</span> variance = 5;</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     cpl_image *left_data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     cpl_image *left_variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     cpl_image *right_data;</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_image *right_variance;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *left, *right;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="keywordtype">double</span> error_before, error_after;</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> </div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     cpl_image_add_scalar(left_data, values);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     cpl_image_add_scalar(left_variance, variance);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     right_data    = cpl_image_multiply_scalar_create(left_data, 0.6);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     right_variance = cpl_image_duplicate(left_variance);</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     left  = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(left_data , left_variance);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     right = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(right_data, right_variance);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     error_before = <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(left, NULL);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="comment">/* Call function */</span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <a class="code" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be" title="Subtract images.">fors_image_subtract</a>(left, right);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="comment">/* Check results */</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     error_after = <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(left, NULL);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     test_rel( <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(left, NULL), values*(1-0.6), 0.001);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     test_rel( error_after, error_before*sqrt(2.0), 0.001);</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     cleanup;</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> }</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="preprocessor">    fors_image_delete(&image); \</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno"><a class="code" href="group__fors__image__test.html#ga69074b617f26911b58cda3a0fa13c918">  245</a></span> <a class="code" href="group__fors__image__test.html#ga69074b617f26911b58cda3a0fa13c918" title="Test image exponentiation.">test_exponential</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> {</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     <span class="comment">/* Simulate data */</span></div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> nx = 20;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> ny = 30;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keyword">const</span> <span class="keywordtype">double</span> values  = 17;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     <span class="keyword">const</span> <span class="keywordtype">double</span> var_val = 5;</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="keywordtype">double</span> base = 10;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <span class="keywordtype">double</span> dbase = -1;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     cpl_image_add_scalar(data, values);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     cpl_image_add_scalar(variance, var_val);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     image = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     <span class="comment">/* Call function */</span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     <a class="code" href="group__fors__image.html#gabe2039c17c13fed0e430d71cb38454bf" title="Exponential.">fors_image_exponential</a>(image, base, dbase);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <span class="comment">/* Check results */</span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     test_rel( <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(image, NULL), pow(base, values), 0.001);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     cleanup;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> }</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> <span class="preprocessor">    fors_image_delete(&image); \</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00283"></a><span class="lineno"><a class="code" href="group__fors__image__test.html#ga0383c55336d7d782ab9f4fc614f9b0e0">  283</a></span> <a class="code" href="group__fors__image__test.html#ga0383c55336d7d782ab9f4fc614f9b0e0" title="Test image division.">test_divide</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> {</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     <span class="comment">/* Simulate data */</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> nx = 20;</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> ny = 30;</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keyword">const</span> <span class="keywordtype">double</span> values  = 17;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keyword">const</span> <span class="keywordtype">double</span> variance_value = 5;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     <span class="keywordtype">double</span> error_before, error_after;</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> </div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     cpl_image_add_scalar(data    , values);</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     cpl_image_add_scalar(variance, variance_value);</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     image  = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     error_before = </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>         <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(image, NULL) /</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>      (image, NULL);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     <span class="comment">/* Call function */</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <a class="code" href="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2" title="Divide images.">fors_image_divide</a>(image, image);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="comment">/* Check results,</span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> <span class="comment">     * relative errors add in quadrature</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     error_after =</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>         <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(image, NULL) /</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>         <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>      (image, NULL);</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     test_rel( <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(image, NULL), 1.0, 0.001 );</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     test_rel( error_after, error_before*sqrt(2.0), 0.001 );</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cleanup;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> }</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> </div>
+<div class="line"><a name="l00325"></a><span class="lineno"><a class="code" href="group__fors__image__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  325</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> {</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     TEST_INIT;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> </div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <a class="code" href="group__fors__image__test.html#ga8e2e648513e2b6ee3843dd026130d7a2" title="Test functions.">test_image</a>();</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     </div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <a class="code" href="group__fors__image__test.html#ga3fb4147d1739891fdc6ae6132e87d0bd" title="Median filtering benchmark.">test_median_filter</a>();</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> </div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <a class="code" href="group__fors__image__test.html#ga460806546207179c6e136d31bdb922d5" title="Test image subtraction.">test_subtract</a>();</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <a class="code" href="group__fors__image__test.html#ga0383c55336d7d782ab9f4fc614f9b0e0" title="Test image division.">test_divide</a>();</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <a class="code" href="group__fors__image__test.html#ga69074b617f26911b58cda3a0fa13c918" title="Test image exponentiation.">test_exponential</a>();</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     TEST_END;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> }</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__image_8c-source.html b/html/fors__image_8c-source.html
deleted file mode 100644
index 032cbad..0000000
--- a/html/fors__image_8c-source.html
+++ /dev/null
@@ -1,1610 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_image.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_image.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_image.c,v 1.60 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.60 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_double.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <moses.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#include <math.h></span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00046"></a>00046 
-<a name="l00062"></a><a class="code" href="struct__fors__image.html">00062</a> <span class="keyword">struct </span><a class="code" href="struct__fors__image.html">_fors_image</a>
-<a name="l00063"></a>00063 {
-<a name="l00064"></a><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">00064</a>     cpl_image *<a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>;
-<a name="l00065"></a><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">00065</a>     cpl_image *<a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <span class="comment">/* Invariants:</span>
-<a name="l00068"></a>00068 <span class="comment">       The CPL images are non-NULL. </span>
-<a name="l00069"></a>00069 <span class="comment">       The variance image is everywhere non-negative.</span>
-<a name="l00070"></a>00070 <span class="comment">       The CPL image types are FORS_IMAGE_TYPE.</span>
-<a name="l00071"></a>00071 <span class="comment">       The CPL image bad pixel masks are unused</span>
-<a name="l00072"></a>00072 <span class="comment">    */</span>
-<a name="l00073"></a>00073 };
-<a name="l00074"></a>00074 
-<a name="l00078"></a><a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">00078</a> <span class="keyword">const</span> cpl_type <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a> = CPL_TYPE_FLOAT;
-<a name="l00079"></a><a class="code" href="group__fors__image.html#gf1d3f1bc9894b624c5fac0ef5eb9b854">00079</a> <span class="preprocessor">#define FORS_IMAGE_TYPE_MAX FLT_MAX  </span><span class="comment">/* Use a #define rather than a variable here</span>
-<a name="l00080"></a>00080 <span class="comment">                                        to avoid type casting */</span>
-<a name="l00081"></a>00081 
-<a name="l00082"></a>00082 <span class="preprocessor">#undef cleanup</span>
-<a name="l00083"></a>00083 <span class="preprocessor"></span>
-<a name="l00084"></a>00084 <span class="comment">/* </span>
-<a name="l00085"></a>00085 <span class="comment"> * The following static function passes a max filter of given box</span>
-<a name="l00086"></a>00086 <span class="comment"> * size on the input data buffer. The output data buffer must be</span>
-<a name="l00087"></a>00087 <span class="comment"> * pre-allocated. The box size must be a positive odd integer.</span>
-<a name="l00088"></a>00088 <span class="comment"> * Returns 0 on success.</span>
-<a name="l00089"></a>00089 <span class="comment"> */</span>
-<a name="l00090"></a>00090  
-<a name="l00091"></a>00091 <span class="keyword">static</span> <span class="keywordtype">int</span> 
-<a name="l00092"></a><a class="code" href="group__fors__image.html#g167f96e092eeb578086febe4b86d6df9">00092</a> <a class="code" href="group__fors__image.html#g167f96e092eeb578086febe4b86d6df9">max_filter</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *ibuffer, <span class="keywordtype">float</span> *obuffer, <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> size)
-<a name="l00093"></a>00093 {
-<a name="l00094"></a>00094     <span class="keywordtype">float</span>  max;
-<a name="l00095"></a>00095     <span class="keywordtype">int</span>    start = size / 2;
-<a name="l00096"></a>00096     <span class="keywordtype">int</span>    end   = length - size / 2;
-<a name="l00097"></a>00097     <span class="keywordtype">int</span>    i, j;
-<a name="l00098"></a>00098 
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100     <span class="keywordflow">for</span> (i = start; i < end; i++) {
-<a name="l00101"></a>00101         max = ibuffer[i-start];
-<a name="l00102"></a>00102         <span class="keywordflow">for</span> (j = i - start + 1; j <= i + start; j++)
-<a name="l00103"></a>00103             <span class="keywordflow">if</span> (max < ibuffer[j])
-<a name="l00104"></a>00104                 max = ibuffer[j];
-<a name="l00105"></a>00105         obuffer[i] = max;
-<a name="l00106"></a>00106     }
-<a name="l00107"></a>00107 
-<a name="l00108"></a>00108     <span class="keywordflow">for</span> (i = 0; i < start; i++)
-<a name="l00109"></a>00109         obuffer[i] = obuffer[start];
-<a name="l00110"></a>00110  
-<a name="l00111"></a>00111     <span class="keywordflow">for</span> (i = end; i < length; i++)
-<a name="l00112"></a>00112         obuffer[i] = obuffer[end-1];
-<a name="l00113"></a>00113 
-<a name="l00114"></a>00114     <span class="keywordflow">return</span> 0;
-<a name="l00115"></a>00115 }
-<a name="l00116"></a>00116 
-<a name="l00117"></a>00117 <span class="preprocessor">#define cleanup</span>
-<a name="l00118"></a>00118 <span class="preprocessor"></span>
-<a name="l00127"></a>00127 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l00128"></a><a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">00128</a> <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(cpl_image *data, cpl_image *variance)
-<a name="l00129"></a>00129 {
-<a name="l00130"></a>00130     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( data != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00133"></a>00133     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( variance != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00134"></a>00134     
-<a name="l00135"></a>00135     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_image_get_type(data) == <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>, <span class="keywordflow">return</span> NULL,
-<a name="l00136"></a>00136             <span class="stringliteral">"Provided data image type is %s, must be %s"</span>,
-<a name="l00137"></a>00137             <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(cpl_image_get_type(data)),
-<a name="l00138"></a>00138             <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(<a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>) );
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_image_get_type(variance) == <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>, <span class="keywordflow">return</span> NULL,
-<a name="l00141"></a>00141             <span class="stringliteral">"Provided weight image type is %s, must be %s"</span>,
-<a name="l00142"></a>00142             <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(cpl_image_get_type(variance)),
-<a name="l00143"></a>00143             <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(<a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>) );
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_image_get_size_x(data) == cpl_image_get_size_x(variance) &&
-<a name="l00146"></a>00146             cpl_image_get_size_y(data) == cpl_image_get_size_y(variance),
-<a name="l00147"></a>00147             <span class="keywordflow">return</span> NULL,
-<a name="l00148"></a>00148             <span class="stringliteral">"Incompatible data and weight image sizes: %dx%d and %dx%d"</span>,
-<a name="l00149"></a>00149             cpl_image_get_size_x(data), cpl_image_get_size_y(data),
-<a name="l00150"></a>00150             cpl_image_get_size_x(variance), cpl_image_get_size_y(variance));
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_image_get_min(variance) >= 0, <span class="keywordflow">return</span> NULL,
-<a name="l00153"></a>00153             <span class="stringliteral">"Variances must be non-negative, minimum is %f"</span>,
-<a name="l00154"></a>00154             cpl_image_get_min(variance));
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156     image = cpl_malloc(<span class="keyword">sizeof</span>(*image));
-<a name="l00157"></a>00157 
-<a name="l00158"></a>00158     image->data = data;
-<a name="l00159"></a>00159     image->variance = variance;
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161     <span class="keywordflow">return</span> image;    
-<a name="l00162"></a>00162 }
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164 <span class="preprocessor">#undef cleanup</span>
-<a name="l00165"></a>00165 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00166"></a>00166 <span class="preprocessor"></span>
-<a name="l00171"></a>00171 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l00172"></a><a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">00172</a> <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)
-<a name="l00173"></a>00173 {
-<a name="l00174"></a>00174     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00175"></a>00175 
-<a name="l00176"></a>00176     <span class="keywordflow">return</span> <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(cpl_image_duplicate(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>),
-<a name="l00177"></a>00177                           cpl_image_duplicate(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>));
-<a name="l00178"></a>00178 }
-<a name="l00179"></a>00179 
-<a name="l00184"></a>00184 <span class="keywordtype">void</span>
-<a name="l00185"></a><a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">00185</a> <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(<a class="code" href="struct__fors__image.html">fors_image</a> **image)
-<a name="l00186"></a>00186 {
-<a name="l00187"></a>00187     <span class="keywordflow">if</span> (image && *image) {
-<a name="l00188"></a>00188         cpl_image_delete((*image)->data);
-<a name="l00189"></a>00189         cpl_image_delete((*image)->variance);
-<a name="l00190"></a>00190         cpl_free(*image); *image = NULL;
-<a name="l00191"></a>00191     }
-<a name="l00192"></a>00192     <span class="keywordflow">return</span>;
-<a name="l00193"></a>00193 }
-<a name="l00194"></a>00194 
-<a name="l00199"></a>00199 <span class="keywordtype">void</span>
-<a name="l00200"></a><a class="code" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">00200</a> <a class="code" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">fors_image_delete_const</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> **image)
-<a name="l00201"></a>00201 {
-<a name="l00202"></a>00202     <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>((<a class="code" href="struct__fors__image.html">fors_image</a> **)image);
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204     <span class="keywordflow">return</span>;
-<a name="l00205"></a>00205 }
-<a name="l00206"></a>00206 
-<a name="l00207"></a>00207 <span class="comment">/* not used */</span>
-<a name="l00208"></a>00208 <span class="preprocessor">#if 0</span>
-<a name="l00209"></a>00209 <span class="preprocessor"></span>
-<a name="l00213"></a>00213 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00214"></a>00214 fors_image_dump(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, FILE *file)
-<a name="l00215"></a>00215 {
-<a name="l00216"></a>00216     <span class="keywordflow">if</span> (image == NULL) {
-<a name="l00217"></a>00217         fprintf(file, <span class="stringliteral">"Null image\n"</span>);
-<a name="l00218"></a>00218     }
-<a name="l00219"></a>00219     <span class="keywordflow">else</span> {
-<a name="l00220"></a>00220         cpl_stats *stats;
-<a name="l00221"></a>00221 
-<a name="l00222"></a>00222         fprintf(file, <span class="stringliteral">"Data:\n"</span>);
-<a name="l00223"></a>00223         stats = cpl_stats_new_from_image(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, CPL_STATS_ALL);
-<a name="l00224"></a>00224         cpl_stats_dump(stats, CPL_STATS_ALL, file);
-<a name="l00225"></a>00225         cpl_stats_delete(stats);
-<a name="l00226"></a>00226             
-<a name="l00227"></a>00227         fprintf(file, <span class="stringliteral">"Variance:\n"</span>);
-<a name="l00228"></a>00228         stats = cpl_stats_new_from_image(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, CPL_STATS_ALL);
-<a name="l00229"></a>00229         cpl_stats_dump(stats, CPL_STATS_ALL, file);
-<a name="l00230"></a>00230         cpl_stats_delete(stats);
-<a name="l00231"></a>00231     }
-<a name="l00232"></a>00232     
-<a name="l00233"></a>00233     <span class="keywordflow">return</span>;
-<a name="l00234"></a>00234 }
-<a name="l00235"></a>00235 <span class="preprocessor">#endif</span>
-<a name="l00236"></a>00236 <span class="preprocessor"></span>
-<a name="l00237"></a>00237 <span class="preprocessor">#undef cleanup</span>
-<a name="l00238"></a>00238 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00239"></a>00239 <span class="preprocessor">do { \</span>
-<a name="l00240"></a>00240 <span class="preprocessor">    double_list_delete(&sat_percent, double_delete); \</span>
-<a name="l00241"></a>00241 <span class="preprocessor">} while (0)</span>
-<a name="l00242"></a>00242 <span class="preprocessor"></span>
-<a name="l00256"></a>00256 fors_image_list *
-<a name="l00257"></a><a class="code" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">00257</a> <a class="code" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list</a>(<span class="keyword">const</span> cpl_frameset *frames, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *bias,
-<a name="l00258"></a>00258                      <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00259"></a>00259                      <span class="keywordtype">double</span> *saturated)
-<a name="l00260"></a>00260 {
-<a name="l00261"></a>00261     fors_image_list *ilist = fors_image_list_new();
-<a name="l00262"></a>00262     double_list *sat_percent = double_list_new();
-<a name="l00263"></a>00263     
-<a name="l00264"></a>00264     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( frames != NULL, <span class="keywordflow">return</span> ilist, NULL );
-<a name="l00265"></a>00265     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_frameset_is_empty(frames), <span class="keywordflow">return</span> ilist, <span class="stringliteral">"Empty frameset"</span>);
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267     {
-<a name="l00268"></a>00268         <span class="keyword">const</span> cpl_frame *f;
-<a name="l00269"></a>00269         
-<a name="l00270"></a>00270         <span class="keywordflow">for</span> (f = cpl_frameset_get_first_const(frames);
-<a name="l00271"></a>00271              f != NULL;
-<a name="l00272"></a>00272              f = cpl_frameset_get_next_const(frames)) {
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274             <span class="keywordtype">double</span> saturated_one;
-<a name="l00275"></a>00275             
-<a name="l00276"></a>00276             <a class="code" href="struct__fors__image.html">fors_image</a> *i = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(f, bias, setting,
-<a name="l00277"></a>00277                                             saturated != NULL ? 
-<a name="l00278"></a>00278                                             &saturated_one : NULL);
-<a name="l00279"></a>00279             <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> ilist, NULL );
-<a name="l00280"></a>00280             
-<a name="l00281"></a>00281             fors_image_list_insert(ilist, i);
-<a name="l00282"></a>00282             <span class="keywordflow">if</span> (saturated != NULL) {
-<a name="l00283"></a>00283                 double_list_insert(sat_percent, 
-<a name="l00284"></a>00284                                    double_duplicate(&saturated_one));
-<a name="l00285"></a>00285             }
-<a name="l00286"></a>00286         }
-<a name="l00287"></a>00287     }
-<a name="l00288"></a>00288 
-<a name="l00289"></a>00289     <span class="comment">/* fixme: make sure input is consistent */</span>
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291     <span class="comment">/* Compute overall percentage as mean of each percentage.</span>
-<a name="l00292"></a>00292 <span class="comment">       Valid because input frames have same size. */</span>
-<a name="l00293"></a>00293     <span class="keywordflow">if</span> (saturated != NULL) {
-<a name="l00294"></a>00294         *saturated = double_list_mean(sat_percent, double_eval, NULL);
-<a name="l00295"></a>00295     }
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00298"></a>00298     <span class="keywordflow">return</span> ilist;
-<a name="l00299"></a>00299 }
-<a name="l00300"></a>00300 
-<a name="l00312"></a>00312 <span class="keyword">const</span> fors_image_list *
-<a name="l00313"></a><a class="code" href="group__fors__image.html#gab0a6629f36c4db609f1a1515d602477">00313</a> <a class="code" href="group__fors__image.html#gab0a6629f36c4db609f1a1515d602477">fors_image_load_list_const</a>(<span class="keyword">const</span> cpl_frameset *frames, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *bias,
-<a name="l00314"></a>00314                            <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00315"></a>00315                            <span class="keywordtype">double</span> *saturated)
-<a name="l00316"></a>00316 {
-<a name="l00317"></a>00317     <span class="keywordflow">return</span> (<span class="keyword">const</span> fors_image_list *)
-<a name="l00318"></a>00318         <a class="code" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list</a>(frames, bias, setting, saturated);
-<a name="l00319"></a>00319 }
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321 <span class="preprocessor">#undef cleanup</span>
-<a name="l00322"></a>00322 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00323"></a>00323 <span class="preprocessor">do { \</span>
-<a name="l00324"></a>00324 <span class="preprocessor">    cpl_propertylist_delete(header); \</span>
-<a name="l00325"></a>00325 <span class="preprocessor">    cpl_table_delete(overscans); \</span>
-<a name="l00326"></a>00326 <span class="preprocessor">    cpl_image_delete(temp); \</span>
-<a name="l00327"></a>00327 <span class="preprocessor">    cpl_mask_delete(non_saturated); \</span>
-<a name="l00328"></a>00328 <span class="preprocessor">    fors_setting_delete(&frame_setting); \</span>
-<a name="l00329"></a>00329 <span class="preprocessor">} while (0)</span>
-<a name="l00330"></a>00330 <span class="preprocessor"></span>
-<a name="l00348"></a>00348 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l00349"></a><a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">00349</a> <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(<span class="keyword">const</span> cpl_frame *frame, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *bias,
-<a name="l00350"></a>00350                 <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00351"></a>00351                 <span class="keywordtype">double</span> *saturated)
-<a name="l00352"></a>00352 {
-<a name="l00353"></a>00353     <a class="code" href="struct__fors__image.html">fors_image</a> *image           = NULL;
-<a name="l00354"></a>00354     <a class="code" href="struct__fors__setting.html">fors_setting</a> *frame_setting = NULL;
-<a name="l00355"></a>00355     cpl_image *data             = NULL;
-<a name="l00356"></a>00356     cpl_image *variance         = NULL;
-<a name="l00357"></a>00357     cpl_image *temp             = NULL;
-<a name="l00358"></a>00358     cpl_propertylist *header    = NULL;
-<a name="l00359"></a>00359     cpl_table *overscans        = NULL;
-<a name="l00360"></a>00360     cpl_mask *non_saturated     = NULL;
-<a name="l00361"></a>00361     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename;
-<a name="l00362"></a>00362     <span class="keywordtype">int</span> extension= 0;
-<a name="l00363"></a>00363     <span class="keyword">const</span> <span class="keywordtype">int</span> plane = 0;
-<a name="l00364"></a>00364     <span class="keywordtype">double</span> ocorr = 0.0;
-<a name="l00365"></a>00365     <span class="keywordtype">int</span> has_overscans = 0;
-<a name="l00366"></a>00366     <span class="keywordtype">int</span> i;
-<a name="l00367"></a>00367 
-<a name="l00368"></a>00368     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( frame != NULL, <span class="keywordflow">return</span> image, NULL );
-<a name="l00369"></a>00369     <span class="comment">/* bias may be NULL */</span>
-<a name="l00370"></a>00370     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( setting != NULL, <span class="keywordflow">return</span> image, NULL );
-<a name="l00371"></a>00371     filename = cpl_frame_get_filename(frame);
-<a name="l00372"></a>00372     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( filename != NULL, <span class="keywordflow">return</span> image, 
-<a name="l00373"></a>00373             <span class="stringliteral">"NULL filename received"</span>);
-<a name="l00374"></a>00374     
-<a name="l00375"></a>00375     cpl_msg_info(cpl_func, <span class="stringliteral">"Loading %s: %s"</span>,
-<a name="l00376"></a>00376                  <span class="comment">/* fors_frame_get_group_string(frame), */</span>
-<a name="l00377"></a>00377          (cpl_frame_get_tag(frame) != NULL) ? 
-<a name="l00378"></a>00378          cpl_frame_get_tag(frame) : <span class="stringliteral">"NULL"</span>,
-<a name="l00379"></a>00379                  filename);
-<a name="l00380"></a>00380 
-<a name="l00381"></a>00381     <span class="comment">/* Verify instrument setting */</span>
-<a name="l00382"></a>00382     <a class="code" href="group__fors__setting.html#gccd3b501cb380066770b1250942fa02a">fors_setting_verify</a>(setting, frame, &frame_setting);
-<a name="l00383"></a>00383     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, 
-<a name="l00384"></a>00384             <span class="stringliteral">"Could not verify %s setting"</span>, 
-<a name="l00385"></a>00385             filename);
-<a name="l00386"></a>00386     
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388     <span class="comment">/* Get header */</span>
-<a name="l00389"></a>00389     header = cpl_propertylist_load(filename, extension);
-<a name="l00390"></a>00390     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, 
-<a name="l00391"></a>00391             <span class="stringliteral">"Could not load %s extension %d header"</span>, 
-<a name="l00392"></a>00392             filename, extension);
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394     <span class="comment">/* Get data */</span>
-<a name="l00395"></a>00395     data = cpl_image_load(filename, 
-<a name="l00396"></a>00396                           <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>, plane, extension);
-<a name="l00397"></a>00397     
-<a name="l00398"></a>00398     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, 
-<a name="l00399"></a>00399             <span class="stringliteral">"Could not load image from %s extension %d"</span>, 
-<a name="l00400"></a>00400             filename, extension);
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     <span class="comment">/* Read, remove overscan areas */</span>
-<a name="l00403"></a>00403     {
-<a name="l00404"></a>00404         <span class="keywordtype">int</span> xlow, ylow, xhig, yhig;
-<a name="l00405"></a>00405     <span class="comment">/* bool check_consistency = false; */</span>
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407         overscans = <a class="code" href="group__moses.html#g83424b665852cb22061bea76a664a730">mos_load_overscans_fors</a>(header);
-<a name="l00408"></a>00408     <span class="comment">/* Uses always ESO.DET.OUT1.*  which is fine even</span>
-<a name="l00409"></a>00409 <span class="comment">       for old FORS data */</span>
-<a name="l00410"></a>00410 
-<a name="l00411"></a>00411         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, 
-<a name="l00412"></a>00412                 <span class="stringliteral">"Could not read overscan information from %s extension %d"</span>, 
-<a name="l00413"></a>00413                 filename, extension);
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415         <span class="keywordflow">for</span> (i = 1; i < cpl_table_get_nrow(overscans); i++) {
-<a name="l00416"></a>00416 
-<a name="l00417"></a>00417             <span class="comment">/*</span>
-<a name="l00418"></a>00418 <span class="comment">             * Overscan correction</span>
-<a name="l00419"></a>00419 <span class="comment">             */</span>
-<a name="l00420"></a>00420         
-<a name="l00421"></a>00421             xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, i, NULL);
-<a name="l00422"></a>00422             ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, i, NULL);
-<a name="l00423"></a>00423             xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, i, NULL);
-<a name="l00424"></a>00424             yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, i, NULL);
-<a name="l00425"></a>00425 
-<a name="l00426"></a>00426             temp = cpl_image_extract(data, xlow+1, ylow+1, xhig, yhig);
-<a name="l00427"></a>00427 
-<a name="l00428"></a>00428             ocorr += cpl_image_get_median(temp);
-<a name="l00429"></a>00429 
-<a name="l00430"></a>00430             cpl_image_delete(temp); temp = NULL;
-<a name="l00431"></a>00431         }
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433         <span class="keywordflow">if</span> (cpl_table_get_nrow(overscans) > 1) {
-<a name="l00434"></a>00434             has_overscans = 1;
-<a name="l00435"></a>00435             ocorr /= cpl_table_get_nrow(overscans) - 1;
-<a name="l00436"></a>00436         }
-<a name="l00437"></a>00437 
-<a name="l00438"></a>00438         xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, 0, NULL);
-<a name="l00439"></a>00439         ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, 0, NULL);
-<a name="l00440"></a>00440         xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, 0, NULL);
-<a name="l00441"></a>00441         yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, 0, NULL);
-<a name="l00442"></a>00442         
-<a name="l00443"></a>00443         cpl_table_delete(overscans); overscans = NULL;
-<a name="l00444"></a>00444         
-<a name="l00445"></a>00445         temp = cpl_image_duplicate(data);
-<a name="l00446"></a>00446         cpl_image_delete(data);
-<a name="l00447"></a>00447         data = cpl_image_extract(temp, xlow+1, ylow+1, xhig, yhig);
-<a name="l00448"></a>00448         
-<a name="l00449"></a>00449         cpl_image_delete(temp); temp = NULL;
-<a name="l00450"></a>00450     }
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452     cpl_propertylist_delete(header); header = NULL;       
-<a name="l00453"></a>00453 
-<a name="l00454"></a>00454     <span class="comment">/* Define variance */</span>
-<a name="l00455"></a>00455     <span class="keywordflow">if</span> (cpl_frame_get_nextensions(frame) == 0 || bias != NULL) {
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457         <span class="comment">/* No error bars provided, assume RON only.</span>
-<a name="l00458"></a>00458 <span class="comment">           If frame is not a bias, add photon noise later.</span>
-<a name="l00459"></a>00459 <span class="comment">        */</span>
-<a name="l00460"></a>00460 
-<a name="l00461"></a>00461         <span class="comment">/* Define read-out-noise */</span>
-<a name="l00462"></a>00462         variance = cpl_image_new(
-<a name="l00463"></a>00463             cpl_image_get_size_x(data),
-<a name="l00464"></a>00464             cpl_image_get_size_y(data),
-<a name="l00465"></a>00465             <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);        
-<a name="l00466"></a>00466 
-<a name="l00467"></a>00467         <span class="keywordflow">if</span> (cpl_frame_get_group(frame) == CPL_FRAME_GROUP_CALIB) {
-<a name="l00468"></a>00468             cpl_msg_warning(cpl_func, 
-<a name="l00469"></a>00469                             <span class="stringliteral">"No error bars provided for calibration frame %s, "</span>
-<a name="l00470"></a>00470                             <span class="stringliteral">"assuming no errors. For complete error propagation, "</span>
-<a name="l00471"></a>00471                             <span class="stringliteral">"you may recreate this frame with this pipeline"</span>, 
-<a name="l00472"></a>00472                             filename);
-<a name="l00473"></a>00473         } <span class="keywordflow">else</span> {
-<a name="l00474"></a>00474             cpl_image_add_scalar(variance, frame_setting-><a class="code" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">ron</a>*frame_setting-><a class="code" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">ron</a>);
-<a name="l00475"></a>00475         }
-<a name="l00476"></a>00476     }
-<a name="l00477"></a>00477     <span class="keywordflow">else</span> {
-<a name="l00478"></a>00478 
-<a name="l00479"></a>00479         extension = 1;
-<a name="l00480"></a>00480         
-<a name="l00481"></a>00481         <span class="comment">/* Get error bars */</span>
-<a name="l00482"></a>00482         variance = cpl_image_load(filename, 
-<a name="l00483"></a>00483                                   <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>, plane, extension);
-<a name="l00484"></a>00484         
-<a name="l00485"></a>00485         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, 
-<a name="l00486"></a>00486                 <span class="stringliteral">"Could not load image from %s extension %d"</span>, 
-<a name="l00487"></a>00487                 filename, extension);
-<a name="l00488"></a>00488 
-<a name="l00489"></a>00489         cpl_image_power(variance, 2);
-<a name="l00490"></a>00490 
-<a name="l00491"></a>00491         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_image_get_min(variance) >= 0, <span class="keywordflow">return</span> image,
-<a name="l00492"></a>00492                 <span class="stringliteral">"Illegal minimum variance: %g"</span>,
-<a name="l00493"></a>00493                 cpl_image_get_min(variance));
-<a name="l00494"></a>00494 
-<a name="l00495"></a>00495         cpl_image_delete(temp); temp = NULL;
-<a name="l00496"></a>00496     }
-<a name="l00497"></a>00497     
-<a name="l00498"></a>00498     image = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500     <span class="comment">/* Count saturated pixels */</span>
-<a name="l00501"></a>00501     <span class="keywordflow">if</span> (saturated != NULL) {
-<a name="l00502"></a>00502         <span class="keywordtype">double</span> lo_cut = 0.5;
-<a name="l00503"></a>00503         <span class="keywordtype">double</span> hi_cut = 65534.5;
-<a name="l00504"></a>00504         non_saturated = cpl_mask_threshold_image_create(
-<a name="l00505"></a>00505             data, lo_cut, hi_cut);
-<a name="l00506"></a>00506         
-<a name="l00507"></a>00507         *saturated = (cpl_image_get_size_x(data) * 
-<a name="l00508"></a>00508                       cpl_image_get_size_y(data) - 
-<a name="l00509"></a>00509                       cpl_mask_count(non_saturated)) * 100.0 / 
-<a name="l00510"></a>00510             (cpl_image_get_size_x(data) * 
-<a name="l00511"></a>00511              cpl_image_get_size_y(data));
-<a name="l00512"></a>00512 
-<a name="l00513"></a>00513         cpl_mask_delete(non_saturated); non_saturated = NULL;
-<a name="l00514"></a>00514 
-<a name="l00515"></a>00515         cpl_msg_debug(cpl_func,
-<a name="l00516"></a>00516                      <span class="stringliteral">"%f %% saturated pixels"</span>, *saturated);
-<a name="l00517"></a>00517     }        
-<a name="l00518"></a>00518     
-<a name="l00519"></a>00519     <span class="keywordflow">if</span> (bias == NULL) {
-<a name="l00520"></a>00520         <span class="comment">/* Done. No bias to subtract */</span>
-<a name="l00521"></a>00521     }
-<a name="l00522"></a>00522     <span class="keywordflow">else</span> {
-<a name="l00523"></a>00523         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frame_get_group(frame) == CPL_FRAME_GROUP_RAW,
-<a name="l00524"></a>00524                 <span class="keywordflow">return</span> image,
-<a name="l00525"></a>00525                 <span class="stringliteral">"Refusing to subtract bias from non-raw (%s) input frame: %s"</span>,
-<a name="l00526"></a>00526                 <a class="code" href="group__fors__utils.html#gc219cfea8dd4f3c5a0aceb222d19150a">fors_frame_get_group_string</a>(frame),
-<a name="l00527"></a>00527                 filename);
-<a name="l00528"></a>00528         
-<a name="l00529"></a>00529         cpl_msg_debug(cpl_func, <span class="stringliteral">"Subtracting bias from %s"</span>, filename);
-<a name="l00530"></a>00530         
-<a name="l00531"></a>00531         <a class="code" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">fors_image_subtract</a>(image, bias);
-<a name="l00532"></a>00532         
-<a name="l00533"></a>00533         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, 
-<a name="l00534"></a>00534                 <span class="stringliteral">"Bias subtraction failed"</span> );
-<a name="l00535"></a>00535 
-<a name="l00536"></a>00536         <span class="keywordflow">if</span> (has_overscans) {
-<a name="l00537"></a>00537 
-<a name="l00538"></a>00538             <span class="comment">/*</span>
-<a name="l00539"></a>00539 <span class="comment">             * Overscan correction</span>
-<a name="l00540"></a>00540 <span class="comment">             */</span>
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542             ocorr -= cpl_image_get_median(bias-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00543"></a>00543 
-<a name="l00544"></a>00544             cpl_msg_info(cpl_func, 
-<a name="l00545"></a>00545                          <span class="stringliteral">"Overscan correction applied: %.2f ADUs"</span>, ocorr);
-<a name="l00546"></a>00546 
-<a name="l00547"></a>00547             <a class="code" href="group__fors__image.html#g50a06b605ca558553e0642209b93c100">fors_image_subtract_scalar</a>(image, ocorr, -1);
-<a name="l00548"></a>00548         }
-<a name="l00549"></a>00549         
-<a name="l00550"></a>00550         <span class="comment">/* Variance is now (ron**2  +  bias_noise**2).</span>
-<a name="l00551"></a>00551 <span class="comment">           Add photonic noise:</span>
-<a name="l00552"></a>00552 <span class="comment">           </span>
-<a name="l00553"></a>00553 <span class="comment">           variance := variance + |f|/conad</span>
-<a name="l00554"></a>00554 <span class="comment">        */</span>
-<a name="l00555"></a>00555 
-<a name="l00556"></a>00556         <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a> = 1.0 / frame_setting-><a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a>;
-<a name="l00557"></a>00557 
-<a name="l00558"></a>00558         temp = cpl_image_divide_scalar_create(image->data, conad);
-<a name="l00559"></a>00559         cpl_image_abs(temp);
-<a name="l00560"></a>00560 
-<a name="l00561"></a>00561         cpl_image_add(image->variance, temp);
-<a name="l00562"></a>00562     }
-<a name="l00563"></a>00563     
-<a name="l00564"></a>00564     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00565"></a>00565     <span class="keywordflow">return</span> image;
-<a name="l00566"></a>00566 }
-<a name="l00567"></a>00567 
-<a name="l00568"></a>00568 
-<a name="l00569"></a>00569 <span class="preprocessor">#undef cleanup</span>
-<a name="l00570"></a>00570 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00571"></a>00571 <span class="preprocessor">do { \</span>
-<a name="l00572"></a>00572 <span class="preprocessor">    cpl_image_delete(sigma); \</span>
-<a name="l00573"></a>00573 <span class="preprocessor">} while(0)</span>
-<a name="l00574"></a>00574 <span class="preprocessor"></span>
-<a name="l00583"></a>00583 <span class="keywordtype">void</span>
-<a name="l00584"></a><a class="code" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">00584</a> <a class="code" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keyword">const</span> cpl_propertylist *header,
-<a name="l00585"></a>00585                 <span class="keyword">const</span> <span class="keywordtype">char</span> *filename)
-<a name="l00586"></a>00586 {
-<a name="l00587"></a>00587     cpl_propertylist *extension_header = NULL;
-<a name="l00588"></a>00588     cpl_image *sigma = NULL;
-<a name="l00589"></a>00589 
-<a name="l00590"></a>00590     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00591"></a>00591     <span class="comment">/* header may be NULL */</span>
-<a name="l00592"></a>00592     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( filename != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00593"></a>00593     
-<a name="l00594"></a>00594     cpl_image_save(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, filename, CPL_BPP_IEEE_FLOAT, header,
-<a name="l00595"></a>00595                    CPL_IO_DEFAULT);
-<a name="l00596"></a>00596     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00597"></a>00597             <span class="stringliteral">"Cannot save product %s"</span>, filename);
-<a name="l00598"></a>00598     
-<a name="l00599"></a>00599     sigma = cpl_image_power_create(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, 0.5);
-<a name="l00600"></a>00600     <span class="comment">/* This would probably be faster if sqrt() is used rather than pow */</span>
-<a name="l00601"></a>00601 
-<a name="l00602"></a>00602     cpl_image_save(sigma, filename, CPL_BPP_IEEE_FLOAT, extension_header,
-<a name="l00603"></a>00603                    CPL_IO_EXTEND);
-<a name="l00604"></a>00604     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00605"></a>00605             <span class="stringliteral">"Cannot save product %s"</span>, filename);
-<a name="l00606"></a>00606     
-<a name="l00607"></a>00607     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00608"></a>00608     <span class="keywordflow">return</span>;
-<a name="l00609"></a>00609 }
-<a name="l00610"></a>00610 
-<a name="l00611"></a>00611 
-<a name="l00612"></a>00612 <span class="preprocessor">#undef cleanup</span>
-<a name="l00613"></a>00613 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00614"></a>00614 <span class="preprocessor">do { \</span>
-<a name="l00615"></a>00615 <span class="preprocessor">    cpl_image_delete(var_bkg); \</span>
-<a name="l00616"></a>00616 <span class="preprocessor">    cpl_image_delete(sigma_bkg); \</span>
-<a name="l00617"></a>00617 <span class="preprocessor">} while(0)</span>
-<a name="l00618"></a>00618 <span class="preprocessor"></span>
-<a name="l00629"></a>00629 <span class="keywordtype">void</span>
-<a name="l00630"></a><a class="code" href="group__fors__image.html#g1ddf7d1b81954a8d2113e4f5174301a8">00630</a> <a class="code" href="group__fors__image.html#g1ddf7d1b81954a8d2113e4f5174301a8">fors_image_save_sex</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keyword">const</span> cpl_propertylist *header,
-<a name="l00631"></a>00631                     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_dat,
-<a name="l00632"></a>00632                     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_var,
-<a name="l00633"></a>00633                     <span class="keywordtype">int</span> radius)
-<a name="l00634"></a>00634 {
-<a name="l00635"></a>00635     cpl_propertylist *extension_header = NULL;
-<a name="l00636"></a>00636     cpl_image *sigma_bkg = NULL;
-<a name="l00637"></a>00637     cpl_image *var_bkg = NULL;
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00640"></a>00640     <span class="comment">/* header may be NULL */</span>
-<a name="l00641"></a>00641     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( filename_dat != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00642"></a>00642     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( filename_var != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644     cpl_image_save(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, filename_dat, CPL_BPP_IEEE_FLOAT, header,
-<a name="l00645"></a>00645                    CPL_IO_DEFAULT);
-<a name="l00646"></a>00646     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00647"></a>00647             <span class="stringliteral">"Cannot save product %s"</span>, filename_dat);
-<a name="l00648"></a>00648     
-<a name="l00649"></a>00649     <span class="comment">/* Sextractor wants as input the background error bars,</span>
-<a name="l00650"></a>00650 <span class="comment">       i.e. excluding sources.</span>
-<a name="l00651"></a>00651 <span class="comment">       Therefore filter away sources but keep the sharp edges</span>
-<a name="l00652"></a>00652 <span class="comment">       between the illuminated / non-illuminated areas.</span>
-<a name="l00653"></a>00653 <span class="comment"></span>
-<a name="l00654"></a>00654 <span class="comment">       I.e. use a median filter, average filter would not work.</span>
-<a name="l00655"></a>00655 <span class="comment">    */</span>
-<a name="l00656"></a>00656 
-<a name="l00657"></a>00657     cpl_msg_info(cpl_func, <span class="stringliteral">"Creating background error map"</span>);
-<a name="l00658"></a>00658 
-<a name="l00659"></a>00659     <span class="keywordtype">bool</span> filter_data = <span class="keyword">false</span>;  <span class="comment">/* filter the variance image */</span>
-<a name="l00660"></a>00660     <span class="keywordtype">int</span> xstep = radius/2; <span class="comment">/* 25 points sampling grid </span>
-<a name="l00661"></a>00661 <span class="comment">                             . . . . .</span>
-<a name="l00662"></a>00662 <span class="comment">                             . . . . .</span>
-<a name="l00663"></a>00663 <span class="comment">                             . . . . .</span>
-<a name="l00664"></a>00664 <span class="comment">                             . . . . .</span>
-<a name="l00665"></a>00665 <span class="comment">                             . . . . .</span>
-<a name="l00666"></a>00666 <span class="comment">                           */</span>
-<a name="l00667"></a>00667     <span class="keywordtype">int</span> ystep = radius/2;
-<a name="l00668"></a>00668     <span class="keywordtype">int</span> xstart = 1;
-<a name="l00669"></a>00669     <span class="keywordtype">int</span> ystart = 1;
-<a name="l00670"></a>00670     <span class="keywordtype">int</span> xend = <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(image);
-<a name="l00671"></a>00671     <span class="keywordtype">int</span> yend = <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(image);
-<a name="l00672"></a>00672 
-<a name="l00673"></a>00673 
-<a name="l00674"></a>00674     var_bkg = <a class="code" href="group__fors__image.html#g96498be3e15cde80921709406c33b6f3">fors_image_filter_median_create</a>(image, 
-<a name="l00675"></a>00675                                               radius,
-<a name="l00676"></a>00676                                               radius,
-<a name="l00677"></a>00677                                               xstart, ystart,
-<a name="l00678"></a>00678                                               xend, yend,
-<a name="l00679"></a>00679                                               xstep, ystep,
-<a name="l00680"></a>00680                                               filter_data);
-<a name="l00681"></a>00681     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00682"></a>00682             <span class="stringliteral">"Median filtering failed"</span>);
-<a name="l00683"></a>00683 
-<a name="l00684"></a>00684     sigma_bkg = cpl_image_power_create(var_bkg, 0.5);
-<a name="l00685"></a>00685 
-<a name="l00686"></a>00686     cpl_image_save(sigma_bkg, filename_var,
-<a name="l00687"></a>00687                    CPL_BPP_IEEE_FLOAT, extension_header,
-<a name="l00688"></a>00688                    CPL_IO_DEFAULT);
-<a name="l00689"></a>00689     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00690"></a>00690             <span class="stringliteral">"Cannot save product %s"</span>, filename_var);
-<a name="l00691"></a>00691 
-<a name="l00692"></a>00692     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00693"></a>00693     <span class="keywordflow">return</span>;
-<a name="l00694"></a>00694 }
-<a name="l00695"></a>00695 
-<a name="l00696"></a>00696 <span class="preprocessor">#undef cleanup</span>
-<a name="l00697"></a>00697 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00698"></a>00698 <span class="preprocessor"></span>
-<a name="l00703"></a><a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">00703</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)
-<a name="l00704"></a>00704 {
-<a name="l00705"></a>00705     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00706"></a>00706     <span class="keywordflow">return</span> cpl_image_get_size_x(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00707"></a>00707 }
-<a name="l00708"></a>00708 
-<a name="l00709"></a>00709 <span class="preprocessor">#undef cleanup</span>
-<a name="l00710"></a>00710 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00711"></a>00711 <span class="preprocessor"></span>
-<a name="l00716"></a><a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">00716</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)
-<a name="l00717"></a>00717 {
-<a name="l00718"></a>00718     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00719"></a>00719     <span class="keywordflow">return</span> cpl_image_get_size_y(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00720"></a>00720 }
-<a name="l00721"></a>00721 
-<a name="l00722"></a>00722 <span class="preprocessor">#undef cleanup</span>
-<a name="l00723"></a>00723 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00724"></a>00724 <span class="preprocessor"></span>
-<a name="l00728"></a><a class="code" href="group__fors__image.html#gdffe6405bb64c769dfcdf71c6a281dad">00728</a> <span class="keyword">const</span> <span class="keywordtype">float</span> *<a class="code" href="group__fors__image.html#gdffe6405bb64c769dfcdf71c6a281dad">fors_image_get_data_const</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)
-<a name="l00729"></a>00729 {
-<a name="l00730"></a>00730     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00731"></a>00731 
-<a name="l00732"></a>00732     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a> == CPL_TYPE_FLOAT, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00733"></a>00733     <span class="comment">/* This function (including API) would need to change</span>
-<a name="l00734"></a>00734 <span class="comment">       if the pixel type changes */</span>
-<a name="l00735"></a>00735 
-<a name="l00736"></a>00736     <span class="keywordflow">return</span> cpl_image_get_data_float(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00737"></a>00737 }
-<a name="l00738"></a>00738 
-<a name="l00739"></a>00739 <span class="preprocessor">#undef cleanup</span>
-<a name="l00740"></a>00740 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00741"></a>00741 <span class="preprocessor"></span>
-<a name="l00748"></a>00748 <span class="keywordtype">void</span>
-<a name="l00749"></a><a class="code" href="group__fors__image.html#g5ac7cb865a07bab1987284dba3676ceb">00749</a> <a class="code" href="group__fors__image.html#g5ac7cb865a07bab1987284dba3676ceb">fors_image_abs</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image)
-<a name="l00750"></a>00750 {
-<a name="l00751"></a>00751     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00752"></a>00752 
-<a name="l00753"></a>00753     cpl_image_abs(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00754"></a>00754 
-<a name="l00755"></a>00755     <span class="keywordflow">return</span>;
-<a name="l00756"></a>00756 }
-<a name="l00757"></a>00757 
-<a name="l00758"></a>00758 <span class="preprocessor">#undef cleanup</span>
-<a name="l00759"></a>00759 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00760"></a>00760 <span class="preprocessor"></span>
-<a name="l00767"></a>00767 <span class="keywordtype">void</span>
-<a name="l00768"></a><a class="code" href="group__fors__image.html#g18f269421a43f46c063b667fac72c938">00768</a> <a class="code" href="group__fors__image.html#g18f269421a43f46c063b667fac72c938">fors_image_square</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image)
-<a name="l00769"></a>00769 {
-<a name="l00770"></a>00770     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00771"></a>00771 
-<a name="l00772"></a>00772     cpl_image_multiply(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00773"></a>00773     <span class="comment">/* It is an undocumented feature of CPL that you</span>
-<a name="l00774"></a>00774 <span class="comment">       can pass the same image to cpl_image_multiply and get</span>
-<a name="l00775"></a>00775 <span class="comment">       the right answer. Let us hope it does not change...</span>
-<a name="l00776"></a>00776 <span class="comment">    */</span>
-<a name="l00777"></a>00777     cpl_image_multiply_scalar(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, 2);
-<a name="l00778"></a>00778 
-<a name="l00779"></a>00779     <span class="keywordflow">return</span>;
-<a name="l00780"></a>00780 }
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782 
-<a name="l00783"></a>00783 <span class="preprocessor">#undef cleanup</span>
-<a name="l00784"></a>00784 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00785"></a>00785 <span class="preprocessor">do { \</span>
-<a name="l00786"></a>00786 <span class="preprocessor">    cpl_image_delete(temp); \</span>
-<a name="l00787"></a>00787 <span class="preprocessor">} while(0)</span>
-<a name="l00788"></a>00788 <span class="preprocessor"></span>
-<a name="l00796"></a>00796 <span class="keywordtype">void</span>
-<a name="l00797"></a><a class="code" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">00797</a> <a class="code" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">fors_image_subtract</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *right)
-<a name="l00798"></a>00798 {
-<a name="l00799"></a>00799     cpl_image *temp = NULL;
-<a name="l00800"></a>00800     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( left != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00801"></a>00801     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( right != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00802"></a>00802 
-<a name="l00803"></a>00803     cpl_image_subtract(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, right-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00804"></a>00804 
-<a name="l00805"></a>00805     <span class="comment">/*  variance_left := variance_left + variance_right */</span>
-<a name="l00806"></a>00806     cpl_image_add(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, right-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>);
-<a name="l00807"></a>00807 
-<a name="l00808"></a>00808     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00809"></a>00809     <span class="keywordflow">return</span>;
-<a name="l00810"></a>00810 }
-<a name="l00811"></a>00811 
-<a name="l00812"></a>00812 <span class="preprocessor">#undef cleanup</span>
-<a name="l00813"></a>00813 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00814"></a>00814 <span class="preprocessor"></span>
-<a name="l00824"></a>00824 <span class="keywordtype">void</span>
-<a name="l00825"></a><a class="code" href="group__fors__image.html#g0769427c961bdf0fd79eda47fcadeee2">00825</a> <a class="code" href="group__fors__image.html#g0769427c961bdf0fd79eda47fcadeee2">fors_image_multiply_noerr</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> cpl_image *right)
-<a name="l00826"></a>00826 {
-<a name="l00827"></a>00827     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( left != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00828"></a>00828     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( right != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00829"></a>00829     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_image_get_size_x(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>) == cpl_image_get_size_x(right) &&
-<a name="l00830"></a>00830             cpl_image_get_size_y(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>) == cpl_image_get_size_y(right),
-<a name="l00831"></a>00831             <span class="keywordflow">return</span>, <span class="stringliteral">"Incompatible image sizes: %dx%d and %dx%d"</span>,
-<a name="l00832"></a>00832             cpl_image_get_size_x(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>),
-<a name="l00833"></a>00833             cpl_image_get_size_y(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>),
-<a name="l00834"></a>00834             cpl_image_get_size_x(right),
-<a name="l00835"></a>00835             cpl_image_get_size_y(right));
-<a name="l00836"></a>00836 
-<a name="l00837"></a>00837     cpl_image_multiply(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, right);
-<a name="l00838"></a>00838     cpl_image_multiply(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, right);
-<a name="l00839"></a>00839     cpl_image_multiply(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, right);
-<a name="l00840"></a>00840 
-<a name="l00841"></a>00841     <span class="keywordflow">return</span>;
-<a name="l00842"></a>00842 }
-<a name="l00843"></a>00843 
-<a name="l00844"></a>00844 <span class="preprocessor">#undef cleanup</span>
-<a name="l00845"></a>00845 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00846"></a>00846 <span class="preprocessor"></span>
-<a name="l00862"></a>00862 <span class="keywordtype">void</span>
-<a name="l00863"></a><a class="code" href="group__fors__image.html#g4c8774a9e651df6d05689d208fb349e1">00863</a> <a class="code" href="group__fors__image.html#g4c8774a9e651df6d05689d208fb349e1">fors_image_divide_noerr</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, cpl_image *right)
-<a name="l00864"></a>00864 {
-<a name="l00865"></a>00865     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( left != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00866"></a>00866     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( right != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00867"></a>00867     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_image_get_size_x(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>) == cpl_image_get_size_x(right) &&
-<a name="l00868"></a>00868             cpl_image_get_size_y(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>) == cpl_image_get_size_y(right),
-<a name="l00869"></a>00869             <span class="keywordflow">return</span>, <span class="stringliteral">"Incompatible image sizes: %dx%d and %dx%d"</span>,
-<a name="l00870"></a>00870             cpl_image_get_size_x(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>),
-<a name="l00871"></a>00871             cpl_image_get_size_y(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>),
-<a name="l00872"></a>00872             cpl_image_get_size_x(right),
-<a name="l00873"></a>00873             cpl_image_get_size_y(right));
-<a name="l00874"></a>00874 
-<a name="l00875"></a>00875     <span class="keywordtype">int</span> x, y;
-<a name="l00876"></a>00876     <span class="keywordtype">int</span> nx = cpl_image_get_size_x(right);
-<a name="l00877"></a>00877     <span class="keywordtype">int</span> ny = cpl_image_get_size_y(right);
-<a name="l00878"></a>00878     <span class="keywordtype">float</span> *datal = cpl_image_get_data_float(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00879"></a>00879     <span class="keywordtype">float</span> *datav = cpl_image_get_data_float(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>);
-<a name="l00880"></a>00880     <span class="keywordtype">float</span> *datar = cpl_image_get_data_float(right);
-<a name="l00881"></a>00881     <span class="keywordflow">for</span> (y = 0; y < ny; y++) {
-<a name="l00882"></a>00882         <span class="keywordflow">for</span> (x = 0; x < nx; x++) {
-<a name="l00883"></a>00883             <span class="keywordflow">if</span> (datar[x + nx*y] == 0) {
-<a name="l00884"></a>00884                 datar[x + nx*y] = 1;
-<a name="l00885"></a>00885                 datal[x + nx*y] = 1;
-<a name="l00886"></a>00886 
-<a name="l00887"></a>00887                 datav[x + nx*y] = <a class="code" href="group__fors__image.html#gf1d3f1bc9894b624c5fac0ef5eb9b854">FORS_IMAGE_TYPE_MAX</a>;
-<a name="l00888"></a>00888             }
-<a name="l00889"></a>00889         }
-<a name="l00890"></a>00890     }
-<a name="l00891"></a>00891 
-<a name="l00892"></a>00892     cpl_image_divide(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, right);
-<a name="l00893"></a>00893     cpl_image_divide(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, right);
-<a name="l00894"></a>00894     cpl_image_divide(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, right);
-<a name="l00895"></a>00895 
-<a name="l00896"></a>00896     <span class="keywordflow">return</span>;
-<a name="l00897"></a>00897 }
-<a name="l00898"></a>00898 
-<a name="l00899"></a>00899 <span class="preprocessor">#undef cleanup</span>
-<a name="l00900"></a>00900 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00901"></a>00901 <span class="preprocessor">do { \</span>
-<a name="l00902"></a>00902 <span class="preprocessor">    fors_image_delete(&dupl); \</span>
-<a name="l00903"></a>00903 <span class="preprocessor">} while(0)</span>
-<a name="l00904"></a>00904 <span class="preprocessor"></span>
-<a name="l00924"></a>00924 <span class="keywordtype">void</span>
-<a name="l00925"></a><a class="code" href="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4">00925</a> <a class="code" href="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4">fors_image_divide</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *right)
-<a name="l00926"></a>00926 {
-<a name="l00927"></a>00927     <a class="code" href="struct__fors__image.html">fors_image</a> *dupl = NULL;
-<a name="l00928"></a>00928 
-<a name="l00929"></a>00929     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( left  != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00930"></a>00930     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( right != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00931"></a>00931 
-<a name="l00932"></a>00932     dupl = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(right);
-<a name="l00933"></a>00933 
-<a name="l00934"></a>00934     cpl_image_divide(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, dupl-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>); 
-<a name="l00935"></a>00935     <span class="comment">/* This CPL function divides by zero by setting  x/0 = 1 for all x */</span>
-<a name="l00936"></a>00936 
-<a name="l00937"></a>00937     cpl_image_multiply(dupl-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00938"></a>00938     cpl_image_multiply(dupl-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00939"></a>00939 
-<a name="l00940"></a>00940     <span class="comment">/* Now  dupl->variance = sigma2^2 * data1^2 / data2^2 */</span>
-<a name="l00941"></a>00941 
-<a name="l00942"></a>00942     cpl_image_add(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, dupl-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>);
-<a name="l00943"></a>00943 
-<a name="l00944"></a>00944     <span class="comment">/* Now  left->variance = sigma1^2 + sigma2^2 * data1^2 / data2^2 */</span>
-<a name="l00945"></a>00945 
-<a name="l00946"></a>00946     cpl_image_divide(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, dupl-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00947"></a>00947     cpl_image_divide(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, dupl-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00948"></a>00948     <span class="comment">/* QED */</span>
-<a name="l00949"></a>00949 
-<a name="l00950"></a>00950     <span class="comment">/* Handle division by zero */</span>
-<a name="l00951"></a>00951     <span class="keywordtype">int</span> x, y;
-<a name="l00952"></a>00952     <span class="keywordtype">int</span> nx = cpl_image_get_size_x(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00953"></a>00953     <span class="keywordtype">int</span> ny = cpl_image_get_size_y(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00954"></a>00954     <span class="keywordtype">float</span> *datal = cpl_image_get_data_float(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00955"></a>00955     <span class="keywordtype">float</span> *datav = cpl_image_get_data_float(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>);
-<a name="l00956"></a>00956     <span class="keywordtype">float</span> *datar = cpl_image_get_data_float(right-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00957"></a>00957     <span class="keywordflow">for</span> (y = 0; y < ny; y++) {
-<a name="l00958"></a>00958         <span class="keywordflow">for</span> (x = 0; x < nx; x++) {
-<a name="l00959"></a>00959             <span class="keywordflow">if</span> (datar[x + nx*y] == 0) {
-<a name="l00960"></a>00960                 datal[x + nx*y] = 1;
-<a name="l00961"></a>00961                 datav[x + nx*y] = <a class="code" href="group__fors__image.html#gf1d3f1bc9894b624c5fac0ef5eb9b854">FORS_IMAGE_TYPE_MAX</a>;
-<a name="l00962"></a>00962             }
-<a name="l00963"></a>00963         }
-<a name="l00964"></a>00964     }
-<a name="l00965"></a>00965 
-<a name="l00966"></a>00966     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00967"></a>00967     <span class="keywordflow">return</span>;
-<a name="l00968"></a>00968 }
-<a name="l00969"></a>00969 
-<a name="l00970"></a>00970 <span class="preprocessor">#undef cleanup</span>
-<a name="l00971"></a>00971 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00972"></a>00972 <span class="preprocessor">do { \</span>
-<a name="l00973"></a>00973 <span class="preprocessor">    cpl_image_delete(s22d12); \</span>
-<a name="l00974"></a>00974 <span class="preprocessor">} while(0)</span>
-<a name="l00975"></a>00975 <span class="preprocessor"></span>
-<a name="l00986"></a>00986 <span class="keywordtype">void</span>
-<a name="l00987"></a><a class="code" href="group__fors__image.html#g15f95ab361e6c2ea44bafbada5d8d4a1">00987</a> <a class="code" href="group__fors__image.html#g15f95ab361e6c2ea44bafbada5d8d4a1">fors_image_multiply</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *right)
-<a name="l00988"></a>00988 {
-<a name="l00989"></a>00989     cpl_image *s22d12 = NULL;
-<a name="l00990"></a>00990 
-<a name="l00991"></a>00991     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( left  != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00992"></a>00992     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( right != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00993"></a>00993 
-<a name="l00994"></a>00994     s22d12 = cpl_image_duplicate(right-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>);
-<a name="l00995"></a>00995     cpl_image_multiply(s22d12, left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00996"></a>00996     cpl_image_multiply(s22d12, left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00997"></a>00997     
-<a name="l00998"></a>00998     cpl_image_multiply(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, right-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l00999"></a>00999     cpl_image_multiply(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, right-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01000"></a>01000     cpl_image_add(left-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, s22d12);
-<a name="l01001"></a>01001 
-<a name="l01002"></a>01002     cpl_image_multiply(left-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, right-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01003"></a>01003 
-<a name="l01004"></a>01004     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01005"></a>01005     <span class="keywordflow">return</span>;
-<a name="l01006"></a>01006 }
-<a name="l01007"></a>01007 
-<a name="l01008"></a>01008 
-<a name="l01009"></a>01009 <span class="preprocessor">#undef cleanup</span>
-<a name="l01010"></a>01010 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01011"></a>01011 <span class="preprocessor"></span>
-<a name="l01023"></a><a class="code" href="group__fors__image.html#g50a06b605ca558553e0642209b93c100">01023</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g50a06b605ca558553e0642209b93c100">fors_image_subtract_scalar</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span> ds)
-<a name="l01024"></a>01024 {
-<a name="l01025"></a>01025     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l01026"></a>01026     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( ds <= 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Unsupported"</span>);
-<a name="l01027"></a>01027 
-<a name="l01028"></a>01028     cpl_image_subtract_scalar(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, s);
-<a name="l01029"></a>01029 
-<a name="l01030"></a>01030     <span class="keywordflow">return</span>;
-<a name="l01031"></a>01031 }
-<a name="l01032"></a>01032 
-<a name="l01033"></a>01033 
-<a name="l01034"></a>01034 <span class="preprocessor">#undef cleanup</span>
-<a name="l01035"></a>01035 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01036"></a>01036 <span class="preprocessor"></span>
-<a name="l01048"></a><a class="code" href="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff">01048</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff">fors_image_divide_scalar</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span> ds)
-<a name="l01049"></a>01049 {
-<a name="l01050"></a>01050     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l01051"></a>01051     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Division by zero"</span>);
-<a name="l01052"></a>01052     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( ds <= 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Unsupported"</span>);
-<a name="l01053"></a>01053 
-<a name="l01054"></a>01054     cpl_image_divide_scalar(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, s);
-<a name="l01055"></a>01055     cpl_image_divide_scalar(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, s*s);
-<a name="l01056"></a>01056     
-<a name="l01057"></a>01057     <span class="keywordflow">return</span>;
-<a name="l01058"></a>01058 }
-<a name="l01059"></a>01059 
-<a name="l01060"></a>01060 <span class="preprocessor">#undef cleanup</span>
-<a name="l01061"></a>01061 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01062"></a>01062 <span class="preprocessor"></span>
-<a name="l01074"></a><a class="code" href="group__fors__image.html#g077f7a5a847fa9c0e458dca2e12e4e6f">01074</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g077f7a5a847fa9c0e458dca2e12e4e6f">fors_image_multiply_scalar</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span> ds)
-<a name="l01075"></a>01075 {
-<a name="l01076"></a>01076     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l01077"></a>01077     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( ds <= 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Unsupported"</span>);
-<a name="l01078"></a>01078 
-<a name="l01079"></a>01079     cpl_image_multiply_scalar(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, s);
-<a name="l01080"></a>01080     cpl_image_multiply_scalar(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, s*s);
-<a name="l01081"></a>01081 
-<a name="l01082"></a>01082     <span class="keywordflow">return</span>;
-<a name="l01083"></a>01083 }
-<a name="l01084"></a>01084 
-<a name="l01085"></a>01085 <span class="preprocessor">#undef cleanup</span>
-<a name="l01086"></a>01086 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01087"></a>01087 <span class="preprocessor">do { \</span>
-<a name="l01088"></a>01088 <span class="preprocessor">    cpl_image_delete(temp); \</span>
-<a name="l01089"></a>01089 <span class="preprocessor">} while(0)</span>
-<a name="l01090"></a>01090 <span class="preprocessor"></span>
-<a name="l01103"></a><a class="code" href="group__fors__image.html#g78afca4bf8e5c3dc80d0dcd7f682f9e9">01103</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g78afca4bf8e5c3dc80d0dcd7f682f9e9">fors_image_exponential</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> b, <span class="keywordtype">double</span> db)
-<a name="l01104"></a>01104 {
-<a name="l01105"></a>01105     cpl_image *temp = NULL;
-<a name="l01106"></a>01106 
-<a name="l01107"></a>01107     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l01108"></a>01108     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( b >= 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Negative base: %f"</span>, b);
-<a name="l01109"></a>01109     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( db <= 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Unsupported"</span>);
-<a name="l01110"></a>01110 
-<a name="l01111"></a>01111     cpl_image_exponential(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, b);
-<a name="l01112"></a>01112 
-<a name="l01113"></a>01113     <span class="keywordtype">double</span> lnb = log(b);
-<a name="l01114"></a>01114     
-<a name="l01115"></a>01115     cpl_image_multiply_scalar(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, lnb*lnb);
-<a name="l01116"></a>01116     cpl_image_multiply(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01117"></a>01117     cpl_image_multiply(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01118"></a>01118 
-<a name="l01119"></a>01119     <span class="keywordflow">return</span>;
-<a name="l01120"></a>01120 }
-<a name="l01121"></a>01121 
-<a name="l01122"></a>01122 
-<a name="l01123"></a>01123 <span class="preprocessor">#undef cleanup</span>
-<a name="l01124"></a>01124 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01125"></a>01125 <span class="preprocessor"></span>
-<a name="l01130"></a>01130 <span class="keywordtype">double</span>
-<a name="l01131"></a><a class="code" href="group__fors__image.html#gc4edb9a966bcf97a17ad6a5c1b9d020f">01131</a> <a class="code" href="group__fors__image.html#gc4edb9a966bcf97a17ad6a5c1b9d020f">fors_image_get_min</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)
-<a name="l01132"></a>01132 {
-<a name="l01133"></a>01133     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l01134"></a>01134 
-<a name="l01135"></a>01135     <span class="keywordflow">return</span> cpl_image_get_min(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01136"></a>01136 }
-<a name="l01137"></a>01137 
-<a name="l01138"></a>01138 <span class="preprocessor">#undef cleanup</span>
-<a name="l01139"></a>01139 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01140"></a>01140 <span class="preprocessor"></span>
-<a name="l01145"></a>01145 <span class="keywordtype">double</span>
-<a name="l01146"></a><a class="code" href="group__fors__image.html#g5c7d9b043db23a40e632ffc34c3f3d5c">01146</a> <a class="code" href="group__fors__image.html#g5c7d9b043db23a40e632ffc34c3f3d5c">fors_image_get_max</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)
-<a name="l01147"></a>01147 {
-<a name="l01148"></a>01148     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l01149"></a>01149 
-<a name="l01150"></a>01150     <span class="keywordflow">return</span> cpl_image_get_max(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01151"></a>01151 }
-<a name="l01152"></a>01152 
-<a name="l01153"></a>01153 <span class="preprocessor">#undef cleanup</span>
-<a name="l01154"></a>01154 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01155"></a>01155 <span class="preprocessor"></span>
-<a name="l01161"></a>01161 <span class="keywordtype">double</span>
-<a name="l01162"></a><a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">01162</a> <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dmean)
-<a name="l01163"></a>01163 {
-<a name="l01164"></a>01164     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l01165"></a>01165     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dmean == NULL, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Unsupported"</span>);
-<a name="l01166"></a>01166 
-<a name="l01167"></a>01167     <span class="keywordflow">return</span> cpl_image_get_mean(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01168"></a>01168 }
-<a name="l01169"></a>01169 
-<a name="l01170"></a>01170 <span class="preprocessor">#undef cleanup</span>
-<a name="l01171"></a>01171 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01172"></a>01172 <span class="preprocessor"></span>
-<a name="l01178"></a>01178 <span class="keywordtype">double</span>
-<a name="l01179"></a><a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">01179</a> <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dmedian)
-<a name="l01180"></a>01180 {
-<a name="l01181"></a>01181     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l01182"></a>01182     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dmedian == NULL, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Unsupported"</span>);
-<a name="l01183"></a>01183 
-<a name="l01184"></a>01184     <span class="keywordflow">return</span> cpl_image_get_median(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01185"></a>01185 }
-<a name="l01186"></a>01186 
-<a name="l01187"></a>01187 
-<a name="l01188"></a>01188 <span class="preprocessor">#undef cleanup</span>
-<a name="l01189"></a>01189 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01190"></a>01190 <span class="preprocessor"></span>
-<a name="l01204"></a><a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">01204</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image,
-<a name="l01205"></a>01205              <span class="keywordtype">int</span> xlo, <span class="keywordtype">int</span> ylo,
-<a name="l01206"></a>01206              <span class="keywordtype">int</span> xhi, <span class="keywordtype">int</span> yhi)
-<a name="l01207"></a>01207 {
-<a name="l01208"></a>01208     <span class="comment">/* CPL is missing the function to locally extract an image,</span>
-<a name="l01209"></a>01209 <span class="comment">       so this this inefficient CPL function */</span>
-<a name="l01210"></a>01210     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l01211"></a>01211     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( 1 <= xlo && xlo <= xhi && xhi <= <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(image) &&
-<a name="l01212"></a>01212             1 <= ylo && ylo <= yhi && yhi <= <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(image),
-<a name="l01213"></a>01213             <span class="keywordflow">return</span>, <span class="stringliteral">"Cannot extraction region (%d, %d) - (%d, %d) of "</span>
-<a name="l01214"></a>01214             <span class="stringliteral">"%dx%d image"</span>,
-<a name="l01215"></a>01215             xlo, ylo, xhi, yhi,
-<a name="l01216"></a>01216             <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(image),
-<a name="l01217"></a>01217             <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(image));
-<a name="l01218"></a>01218     
-<a name="l01219"></a>01219     cpl_image *new_data = cpl_image_extract(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>,
-<a name="l01220"></a>01220                                             xlo, ylo,
-<a name="l01221"></a>01221                                             xhi, yhi);
-<a name="l01222"></a>01222     cpl_image_delete(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01223"></a>01223 
-<a name="l01224"></a>01224     cpl_image* new_variance = cpl_image_extract(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>,
-<a name="l01225"></a>01225                                                 xlo, ylo,
-<a name="l01226"></a>01226                                                 xhi, yhi);
-<a name="l01227"></a>01227     cpl_image_delete(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>);
-<a name="l01228"></a>01228 
-<a name="l01229"></a>01229     image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a> = new_data;
-<a name="l01230"></a>01230     image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a> = new_variance;
-<a name="l01231"></a>01231 
-<a name="l01232"></a>01232     <span class="keywordflow">return</span>;
-<a name="l01233"></a>01233 }
-<a name="l01234"></a>01234 
-<a name="l01260"></a>01260 cpl_image *
-<a name="l01261"></a><a class="code" href="group__fors__image.html#g96498be3e15cde80921709406c33b6f3">01261</a> <a class="code" href="group__fors__image.html#g96498be3e15cde80921709406c33b6f3">fors_image_filter_median_create</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, 
-<a name="l01262"></a>01262                                 <span class="keywordtype">int</span> xradius,
-<a name="l01263"></a>01263                                 <span class="keywordtype">int</span> yradius,
-<a name="l01264"></a>01264                                 <span class="keywordtype">int</span> xstart, 
-<a name="l01265"></a>01265                                 <span class="keywordtype">int</span> ystart,
-<a name="l01266"></a>01266                                 <span class="keywordtype">int</span> xend,
-<a name="l01267"></a>01267                                 <span class="keywordtype">int</span> yend,
-<a name="l01268"></a>01268                                 <span class="keywordtype">int</span> xstep,
-<a name="l01269"></a>01269                                 <span class="keywordtype">int</span> ystep,
-<a name="l01270"></a>01270                                 <span class="keywordtype">bool</span> use_data)
-<a name="l01271"></a>01271 {
-<a name="l01272"></a>01272     <span class="keyword">const</span> cpl_image *input = NULL;
-<a name="l01273"></a>01273     cpl_image *smooth = NULL;
-<a name="l01274"></a>01274     <span class="keywordtype">int</span> nx, ny;
-<a name="l01275"></a>01275     
-<a name="l01276"></a>01276     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> smooth, NULL );
-<a name="l01277"></a>01277     passure( image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a> != NULL, <span class="keywordflow">return</span> smooth );
-<a name="l01278"></a>01278     passure( image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a> != NULL, <span class="keywordflow">return</span> smooth );
-<a name="l01279"></a>01279     
-<a name="l01280"></a>01280     input = (use_data) ? image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a> : image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>;
-<a name="l01281"></a>01281 
-<a name="l01282"></a>01282     nx = cpl_image_get_size_x(input);
-<a name="l01283"></a>01283     ny = cpl_image_get_size_y(input);
-<a name="l01284"></a>01284 
-<a name="l01285"></a>01285     <span class="keywordflow">if</span> (xstep < 1) xstep = 1;
-<a name="l01286"></a>01286     <span class="keywordflow">if</span> (ystep < 1) ystep = 1;
-<a name="l01287"></a>01287 
-<a name="l01288"></a>01288     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( 1 <= xstart && xstart <= xend && xend <= nx &&
-<a name="l01289"></a>01289             1 <= ystart && ystart <= yend && yend <= ny, <span class="keywordflow">return</span> smooth,
-<a name="l01290"></a>01290             <span class="stringliteral">"Illegal region (%d, %d) - (%d, %d) of %dx%d image"</span>,
-<a name="l01291"></a>01291             xstart, ystart,
-<a name="l01292"></a>01292             xend, yend,
-<a name="l01293"></a>01293             nx, ny);
-<a name="l01294"></a>01294     
-<a name="l01295"></a>01295     smooth = cpl_image_duplicate(input);
-<a name="l01296"></a>01296 
-<a name="l01297"></a>01297     <span class="comment">/* For efficiency reasons, assume that the image type is float */</span>
-<a name="l01298"></a>01298     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a> == CPL_TYPE_FLOAT, <span class="keywordflow">return</span> smooth, NULL );
-<a name="l01299"></a>01299 
-<a name="l01300"></a>01300     <span class="keyword">const</span> <span class="keywordtype">float</span> *input_data  = cpl_image_get_data_float_const(input);
-<a name="l01301"></a>01301     <span class="keywordtype">float</span> *smooth_data = cpl_image_get_data_float(smooth);
-<a name="l01302"></a>01302     <span class="keywordtype">float</span> *data = cpl_malloc((2*yradius + 1)*(2*xradius + 1)*<span class="keyword">sizeof</span>(*data));
-<a name="l01303"></a>01303     
-<a name="l01304"></a>01304     <span class="keywordtype">int</span> y;
-<a name="l01305"></a>01305     <span class="keywordflow">for</span> (y = ystart; y < yend; y++) {
-<a name="l01306"></a>01306         <span class="comment">/*</span>
-<a name="l01307"></a>01307 <span class="comment">          Sample kernel on grid which always contains the central pixel</span>
-<a name="l01308"></a>01308 <span class="comment">          </span>
-<a name="l01309"></a>01309 <span class="comment">          Trim window (note: this will cause fewer values to</span>
-<a name="l01310"></a>01310 <span class="comment">          be used for the median near the region borders </span>
-<a name="l01311"></a>01311 <span class="comment">        */</span>
-<a name="l01312"></a>01312         <span class="keywordtype">int</span> ylo = y - (yradius/ystep) * ystep;
-<a name="l01313"></a>01313         <span class="keywordtype">int</span> yhi = y + (yradius/ystep) * ystep;
-<a name="l01314"></a>01314         
-<a name="l01315"></a>01315         <span class="keywordflow">while</span> (ylo < ystart) ylo += ystep;
-<a name="l01316"></a>01316         <span class="keywordflow">while</span> (yhi > yend  ) yhi -= ystep;
-<a name="l01317"></a>01317         
-<a name="l01318"></a>01318         <span class="keywordtype">int</span> x;
-<a name="l01319"></a>01319         <span class="keywordflow">for</span> (x = xstart; x < xend; x++) {
-<a name="l01320"></a>01320             <span class="keywordtype">int</span> xlo = x - (xradius/xstep) * xstep;
-<a name="l01321"></a>01321             <span class="keywordtype">int</span> xhi = x + (xradius/xstep) * xstep;
-<a name="l01322"></a>01322             
-<a name="l01323"></a>01323             <span class="keywordflow">while</span> (xlo < xstart) xlo += xstep;
-<a name="l01324"></a>01324             <span class="keywordflow">while</span> (xhi > xend  ) xhi -= xstep;
-<a name="l01325"></a>01325             
-<a name="l01326"></a>01326             <span class="comment">/* Collect data */</span>
-<a name="l01327"></a>01327             <span class="keywordtype">int</span> k = 0;
-<a name="l01328"></a>01328             <span class="keywordtype">int</span> j, i;
-<a name="l01329"></a>01329             <span class="keywordflow">for</span> (j = ylo; j <= yhi; j += ystep) {
-<a name="l01330"></a>01330                 <span class="keywordflow">for</span> (i = xlo; i <= xhi; i += xstep) {
-<a name="l01331"></a>01331                     data[k++] = input_data[ (i-1) + (j-1)*nx ];
-<a name="l01332"></a>01332                 }
-<a name="l01333"></a>01333             }
-<a name="l01334"></a>01334         
-<a name="l01335"></a>01335             <span class="comment">/* Get median */</span>
-<a name="l01336"></a>01336             smooth_data[ (x-1) + (y-1)*nx ] = 
-<a name="l01337"></a>01337                                <a class="code" href="group__fors__utils.html#g82a608ac0a7259f2c39a89db274546d3">fors_tools_get_median_float</a>(data, k);
-<a name="l01338"></a>01338         }
-<a name="l01339"></a>01339     }
-<a name="l01340"></a>01340 
-<a name="l01341"></a>01341     cpl_free(data);
-<a name="l01342"></a>01342     <span class="keywordflow">return</span> smooth;
-<a name="l01343"></a>01343 }
-<a name="l01344"></a>01344 
-<a name="l01345"></a>01345 <span class="preprocessor">#undef cleanup</span>
-<a name="l01346"></a>01346 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01347"></a>01347 <span class="preprocessor">do { \</span>
-<a name="l01348"></a>01348 <span class="preprocessor">    cpl_image_delete(input); \</span>
-<a name="l01349"></a>01349 <span class="preprocessor">} while(0)</span>
-<a name="l01350"></a>01350 <span class="preprocessor"></span>cpl_image *
-<a name="l01351"></a><a class="code" href="group__fors__image.html#g0a3e3ddaf982b76fc92d9daf7e32059a">01351</a> <a class="code" href="group__fors__image.html#g0a3e3ddaf982b76fc92d9daf7e32059a">fors_image_flat_fit_create</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, 
-<a name="l01352"></a>01352                            <span class="keywordtype">int</span> step, 
-<a name="l01353"></a>01353                            <span class="keywordtype">int</span> degree, 
-<a name="l01354"></a>01354                            <span class="keywordtype">float</span> level)
-<a name="l01355"></a>01355 {
-<a name="l01356"></a>01356     cpl_image *temp = NULL;
-<a name="l01357"></a>01357     cpl_image *input = NULL;
-<a name="l01358"></a>01358     cpl_image *smooth = NULL;
-<a name="l01359"></a>01359     <span class="keywordtype">int</span> nx, ny;
-<a name="l01360"></a>01360 
-<a name="l01361"></a>01361     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> smooth, NULL );
-<a name="l01362"></a>01362     passure( image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a> != NULL, <span class="keywordflow">return</span> smooth );
-<a name="l01363"></a>01363     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( step > 0, <span class="keywordflow">return</span> smooth, NULL );
-<a name="l01364"></a>01364     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( degree >= 0, <span class="keywordflow">return</span> smooth, NULL );
-<a name="l01365"></a>01365 
-<a name="l01366"></a>01366 
-<a name="l01367"></a>01367     temp = image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>;
-<a name="l01368"></a>01368 
-<a name="l01369"></a>01369     nx = cpl_image_get_size_x(temp);
-<a name="l01370"></a>01370     ny = cpl_image_get_size_y(temp);
-<a name="l01371"></a>01371 
-<a name="l01372"></a>01372     <span class="comment">/* </span>
-<a name="l01373"></a>01373 <span class="comment">     * For efficiency reasons, assume that the image type is float </span>
-<a name="l01374"></a>01374 <span class="comment">     */</span>
-<a name="l01375"></a>01375 
-<a name="l01376"></a>01376     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a> == CPL_TYPE_FLOAT, <span class="keywordflow">return</span> smooth, NULL );
-<a name="l01377"></a>01377 
-<a name="l01378"></a>01378     <span class="comment">/*</span>
-<a name="l01379"></a>01379 <span class="comment">     * Apply light median filter, to eliminate big outliers from fit</span>
-<a name="l01380"></a>01380 <span class="comment">     */</span>
-<a name="l01381"></a>01381 
-<a name="l01382"></a>01382     input = <a class="code" href="group__moses.html#g4fe5f2fe3227522421783758228cdc39">mos_image_filter_median</a>(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, 3, 3);
-<a name="l01383"></a>01383 
-<a name="l01384"></a>01384     <span class="keyword">const</span> <span class="keywordtype">float</span> *input_data = cpl_image_get_data_float_const(input);
-<a name="l01385"></a>01385 
-<a name="l01386"></a>01386     <span class="comment">/*</span>
-<a name="l01387"></a>01387 <span class="comment">     * First of all, count how many points will have to be fitted</span>
-<a name="l01388"></a>01388 <span class="comment">     */</span>
-<a name="l01389"></a>01389 
-<a name="l01390"></a>01390     <span class="keywordtype">int</span> x, y, pos;
-<a name="l01391"></a>01391     <span class="keywordtype">int</span> count = 0;
-<a name="l01392"></a>01392     <span class="keywordflow">for</span> (y = 0; y < ny; y += step) {
-<a name="l01393"></a>01393         pos = y*nx;
-<a name="l01394"></a>01394         <span class="keywordflow">for</span> (x = 0; x < nx; x += step, pos += step) {
-<a name="l01395"></a>01395             <span class="keywordflow">if</span> (input_data[pos] > level) {
-<a name="l01396"></a>01396                 count++;
-<a name="l01397"></a>01397             }
-<a name="l01398"></a>01398         }
-<a name="l01399"></a>01399     }
-<a name="l01400"></a>01400 
-<a name="l01401"></a>01401     <span class="keywordflow">if</span> (count < (degree+1)*(degree+2)) {
-<a name="l01402"></a>01402         step = sqrt((nx*nx)/((degree+1)*(degree+2))) / 2;
-<a name="l01403"></a>01403         <span class="keywordflow">if</span> (step == 0)
-<a name="l01404"></a>01404             step = 1;
-<a name="l01405"></a>01405         cpl_msg_error(cpl_func, <span class="stringliteral">"Flat field image too small (%dx%d). "</span>
-<a name="l01406"></a>01406                       <span class="stringliteral">"Please provide a smaller resampling step (a good "</span>
-<a name="l01407"></a>01407                       <span class="stringliteral">"value would be %d)"</span>, nx, ny, step);
-<a name="l01408"></a>01408         cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l01409"></a>01409         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01410"></a>01410         <span class="keywordflow">return</span> NULL;
-<a name="l01411"></a>01411     }
-<a name="l01412"></a>01412 
-<a name="l01413"></a>01413 
-<a name="l01414"></a>01414     <span class="comment">/*</span>
-<a name="l01415"></a>01415 <span class="comment">     * Fill position and flux vectors with appropriate values</span>
-<a name="l01416"></a>01416 <span class="comment">     */</span>
-<a name="l01417"></a>01417 
-<a name="l01418"></a>01418     cpl_bivector *positions = cpl_bivector_new(count);
-<a name="l01419"></a>01419     <span class="keywordtype">double</span> *xpos = cpl_bivector_get_x_data(positions);
-<a name="l01420"></a>01420     <span class="keywordtype">double</span> *ypos = cpl_bivector_get_y_data(positions);
-<a name="l01421"></a>01421     cpl_vector *fluxes = cpl_vector_new(count);
-<a name="l01422"></a>01422     <span class="keywordtype">double</span> *flux = cpl_vector_get_data(fluxes);
-<a name="l01423"></a>01423 
-<a name="l01424"></a>01424     count = 0;
-<a name="l01425"></a>01425     <span class="keywordflow">for</span> (y = 0; y < ny; y += step) {
-<a name="l01426"></a>01426         pos = y*nx;
-<a name="l01427"></a>01427         <span class="keywordflow">for</span> (x = 0; x < nx; x += step, pos += step) {
-<a name="l01428"></a>01428             <span class="keywordflow">if</span> (input_data[pos] > level) {
-<a name="l01429"></a>01429                 xpos[count] = x;
-<a name="l01430"></a>01430                 ypos[count] = y;
-<a name="l01431"></a>01431                 flux[count] = input_data[pos];
-<a name="l01432"></a>01432                 count++;
-<a name="l01433"></a>01433             }
-<a name="l01434"></a>01434         }
-<a name="l01435"></a>01435     }
-<a name="l01436"></a>01436 
-<a name="l01437"></a>01437     cpl_image_delete(input); input = NULL;
-<a name="l01438"></a>01438 
-<a name="l01439"></a>01439     <span class="comment">/*</span>
-<a name="l01440"></a>01440 <span class="comment">     * Do the fit, and fill the output image with the model</span>
-<a name="l01441"></a>01441 <span class="comment">     * values in all pixels.</span>
-<a name="l01442"></a>01442 <span class="comment">     */</span>
-<a name="l01443"></a>01443 
-<a name="l01444"></a>01444     cpl_polynomial *model = cpl_polynomial_fit_2d_create(positions,
-<a name="l01445"></a>01445                                                          fluxes,
-<a name="l01446"></a>01446                                                          degree,
-<a name="l01447"></a>01447                                                          NULL);
-<a name="l01448"></a>01448 
-<a name="l01449"></a>01449     cpl_bivector_delete(positions);
-<a name="l01450"></a>01450     cpl_vector_delete(fluxes);
-<a name="l01451"></a>01451 
-<a name="l01452"></a>01452     smooth = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l01453"></a>01453     <span class="keywordtype">float</span> *smooth_data = cpl_image_get_data_float(smooth);
-<a name="l01454"></a>01454 
-<a name="l01455"></a>01455     cpl_vector *point = cpl_vector_new(2);
-<a name="l01456"></a>01456     <span class="keywordtype">double</span> *dpoint = cpl_vector_get_data(point);
-<a name="l01457"></a>01457 
-<a name="l01458"></a>01458     <span class="keywordflow">for</span> (y = 0; y < ny; y++) {
-<a name="l01459"></a>01459         pos = y*nx;
-<a name="l01460"></a>01460         dpoint[1] = y;
-<a name="l01461"></a>01461         <span class="keywordflow">for</span> (x = 0; x < nx; x++, pos++) {
-<a name="l01462"></a>01462             dpoint[0] = x;
-<a name="l01463"></a>01463             smooth_data[pos] = cpl_polynomial_eval(model, point);
-<a name="l01464"></a>01464         }
-<a name="l01465"></a>01465     }
-<a name="l01466"></a>01466 
-<a name="l01467"></a>01467     cpl_polynomial_delete(model);
-<a name="l01468"></a>01468     cpl_vector_delete(point);
-<a name="l01469"></a>01469 
-<a name="l01470"></a>01470     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01471"></a>01471     <span class="keywordflow">return</span> smooth;
-<a name="l01472"></a>01472 
-<a name="l01473"></a>01473 }
-<a name="l01474"></a>01474 
-<a name="l01475"></a>01475 <span class="preprocessor">#undef cleanup</span>
-<a name="l01476"></a>01476 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01477"></a>01477 <span class="preprocessor"></span>
-<a name="l01493"></a>01493 cpl_image *
-<a name="l01494"></a><a class="code" href="group__fors__image.html#g315f5476160ed7db282a7623f0d354b0">01494</a> <a class="code" href="group__fors__image.html#g315f5476160ed7db282a7623f0d354b0">fors_image_filter_max_create</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, 
-<a name="l01495"></a>01495                              <span class="keywordtype">int</span> xradius,
-<a name="l01496"></a>01496                              <span class="keywordtype">int</span> yradius,
-<a name="l01497"></a>01497                              <span class="keywordtype">bool</span> use_data)
-<a name="l01498"></a>01498 {
-<a name="l01499"></a>01499     <span class="keyword">const</span> cpl_image *input = NULL;
-<a name="l01500"></a>01500     cpl_image *hmaxima = NULL;
-<a name="l01501"></a>01501     cpl_image *maxima = NULL;
-<a name="l01502"></a>01502     <span class="keywordtype">int</span> nx, ny;
-<a name="l01503"></a>01503     
-<a name="l01504"></a>01504     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> maxima, NULL );
-<a name="l01505"></a>01505     passure( image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a> != NULL, <span class="keywordflow">return</span> maxima );
-<a name="l01506"></a>01506     passure( image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a> != NULL, <span class="keywordflow">return</span> maxima );
-<a name="l01507"></a>01507     
-<a name="l01508"></a>01508     input = (use_data) ? image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a> : image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>;
-<a name="l01509"></a>01509 
-<a name="l01510"></a>01510     nx = cpl_image_get_size_x(input);
-<a name="l01511"></a>01511     ny = cpl_image_get_size_y(input);
-<a name="l01512"></a>01512 
-<a name="l01513"></a>01513     <span class="comment">/*</span>
-<a name="l01514"></a>01514 <span class="comment">     * Allocate space for horizontal max filter result.</span>
-<a name="l01515"></a>01515 <span class="comment">     */</span>
-<a name="l01516"></a>01516 
-<a name="l01517"></a>01517     hmaxima = cpl_image_duplicate(input);
-<a name="l01518"></a>01518 
-<a name="l01519"></a>01519     <span class="comment">/* For efficiency reasons, assume that the image type is float */</span>
-<a name="l01520"></a>01520     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a> == CPL_TYPE_FLOAT, <span class="keywordflow">return</span> maxima, NULL );
-<a name="l01521"></a>01521 
-<a name="l01522"></a>01522     <span class="keywordtype">float</span> *input_data  = (<span class="keywordtype">float</span> *)cpl_image_get_data_float_const(input);
-<a name="l01523"></a>01523     <span class="keywordtype">float</span> *maxima_data = cpl_image_get_data_float(hmaxima);
-<a name="l01524"></a>01524 
-<a name="l01525"></a>01525     <span class="keywordtype">int</span> y;
-<a name="l01526"></a>01526     <span class="keywordflow">for</span> (y = 0; y < ny; y++) {
-<a name="l01527"></a>01527         <span class="keyword">const</span> <span class="keywordtype">float</span> *irow = input_data + y * nx;
-<a name="l01528"></a>01528         <span class="keywordtype">float</span>       *orow = maxima_data + y * nx;
-<a name="l01529"></a>01529         <a class="code" href="group__fors__image.html#g167f96e092eeb578086febe4b86d6df9">max_filter</a>(irow, orow, nx, 2*xradius+1);
-<a name="l01530"></a>01530     }
-<a name="l01531"></a>01531 
-<a name="l01532"></a>01532     cpl_image_turn(hmaxima, 1);
-<a name="l01533"></a>01533 
-<a name="l01534"></a>01534     <span class="comment">/*</span>
-<a name="l01535"></a>01535 <span class="comment">     * Allocate space for vertical max filter result.</span>
-<a name="l01536"></a>01536 <span class="comment">     */</span>
-<a name="l01537"></a>01537 
-<a name="l01538"></a>01538     maxima = cpl_image_duplicate(hmaxima);
-<a name="l01539"></a>01539     input_data  = cpl_image_get_data_float(hmaxima);
-<a name="l01540"></a>01540     maxima_data = cpl_image_get_data_float(maxima);
-<a name="l01541"></a>01541 
-<a name="l01542"></a>01542     <span class="comment">/*</span>
-<a name="l01543"></a>01543 <span class="comment">     * Now nx is the y size of the rotated image...</span>
-<a name="l01544"></a>01544 <span class="comment">     */</span>
-<a name="l01545"></a>01545 
-<a name="l01546"></a>01546     <span class="keywordtype">int</span> x;
-<a name="l01547"></a>01547     <span class="keywordflow">for</span> (x = 0; x < nx; x++) {
-<a name="l01548"></a>01548         <span class="keyword">const</span> <span class="keywordtype">float</span> *irow = input_data + x * ny;
-<a name="l01549"></a>01549         <span class="keywordtype">float</span>       *orow = maxima_data + x * ny;
-<a name="l01550"></a>01550         <a class="code" href="group__fors__image.html#g167f96e092eeb578086febe4b86d6df9">max_filter</a>(irow, orow, ny, 2*yradius+1);
-<a name="l01551"></a>01551     }
-<a name="l01552"></a>01552 
-<a name="l01553"></a>01553     cpl_image_delete(hmaxima);
-<a name="l01554"></a>01554 
-<a name="l01555"></a>01555     cpl_image_turn(maxima, -1);
-<a name="l01556"></a>01556     
-<a name="l01557"></a>01557     <span class="keywordflow">return</span> maxima;
-<a name="l01558"></a>01558 }
-<a name="l01559"></a>01559 
-<a name="l01560"></a>01560 <span class="preprocessor">#undef cleanup</span>
-<a name="l01561"></a>01561 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01562"></a>01562 <span class="preprocessor"></span>
-<a name="l01568"></a>01568 <span class="keywordtype">double</span>
-<a name="l01569"></a><a class="code" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">01569</a> <a class="code" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">fors_image_get_stdev</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dstdev)
-<a name="l01570"></a>01570 {
-<a name="l01571"></a>01571     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l01572"></a>01572     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dstdev == NULL, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Unsupported"</span>);
-<a name="l01573"></a>01573 
-<a name="l01574"></a>01574     <span class="keywordflow">return</span> cpl_image_get_stdev(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01575"></a>01575 }
-<a name="l01576"></a>01576 <span class="preprocessor">#undef cleanup</span>
-<a name="l01577"></a>01577 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01578"></a>01578 <span class="preprocessor">do { \</span>
-<a name="l01579"></a>01579 <span class="preprocessor">    cpl_mask_delete(rejected); \</span>
-<a name="l01580"></a>01580 <span class="preprocessor">    cpl_image_delete(im); \</span>
-<a name="l01581"></a>01581 <span class="preprocessor">} while (0)</span>
-<a name="l01582"></a>01582 <span class="preprocessor"></span>
-<a name="l01590"></a><a class="code" href="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b">01590</a> <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b">fors_image_get_stdev_robust</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, 
-<a name="l01591"></a>01591                    <span class="keywordtype">double</span> cut,
-<a name="l01592"></a>01592                    <span class="keywordtype">double</span> *dstdev)
-<a name="l01593"></a>01593 {
-<a name="l01594"></a>01594     cpl_mask *rejected = NULL;
-<a name="l01595"></a>01595     cpl_image *im = NULL;
-<a name="l01596"></a>01596 
-<a name="l01597"></a>01597     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l01598"></a>01598     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cut > 0, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Illegal cut: %f"</span>, cut );
-<a name="l01599"></a>01599     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dstdev == NULL, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Unsupported"</span>);
-<a name="l01600"></a>01600 
-<a name="l01601"></a>01601     <span class="keywordtype">double</span> median = <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(image, NULL);
-<a name="l01602"></a>01602 
-<a name="l01603"></a>01603     im = cpl_image_duplicate(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>);
-<a name="l01604"></a>01604     cpl_image_subtract_scalar(im, median); 
-<a name="l01605"></a>01605     cpl_image_power(im, 2);
-<a name="l01606"></a>01606     <span class="comment">/* Now squared residuals wrt median */</span>
-<a name="l01607"></a>01607     
-<a name="l01608"></a>01608     rejected = cpl_mask_threshold_image_create(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>,
-<a name="l01609"></a>01609                                                median - cut,
-<a name="l01610"></a>01610                                                median + cut);
-<a name="l01611"></a>01611     cpl_mask_not(rejected);
-<a name="l01612"></a>01612     cpl_image_reject_from_mask(im, rejected);
-<a name="l01613"></a>01613 
-<a name="l01614"></a>01614     <span class="keywordtype">double</span> robust_stdev = sqrt(cpl_image_get_mean(im));
-<a name="l01615"></a>01615 
-<a name="l01616"></a>01616     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01617"></a>01617     <span class="keywordflow">return</span> robust_stdev;
-<a name="l01618"></a>01618 }
-<a name="l01619"></a>01619 
-<a name="l01620"></a>01620 <span class="preprocessor">#undef cleanup</span>
-<a name="l01621"></a>01621 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01622"></a>01622 <span class="preprocessor"></span>
-<a name="l01632"></a>01632 <span class="keywordtype">double</span>
-<a name="l01633"></a><a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">01633</a> <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dmean)
-<a name="l01634"></a>01634 {
-<a name="l01635"></a>01635     <span class="keywordtype">double</span> avg;
-<a name="l01636"></a>01636 
-<a name="l01637"></a>01637     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l01638"></a>01638     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dmean == NULL, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Unsupported"</span>);
-<a name="l01639"></a>01639 
-<a name="l01640"></a>01640     avg = cpl_image_get_mean(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>);
-<a name="l01641"></a>01641 
-<a name="l01642"></a>01642     <span class="comment">/* This should never happen, but avoid sqrt of negative value in any case */</span>
-<a name="l01643"></a>01643     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( avg >= 0, <span class="keywordflow">return</span> -1, <span class="stringliteral">"Average variance is %f"</span>, avg);
-<a name="l01644"></a>01644     
-<a name="l01645"></a>01645     <span class="keywordflow">return</span> sqrt(avg);
-<a name="l01646"></a>01646 }
-<a name="l01647"></a>01647 
-<a name="l01648"></a>01648 
-<a name="l01649"></a>01649 <span class="preprocessor">#undef cleanup</span>
-<a name="l01650"></a>01650 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01651"></a>01651 <span class="preprocessor">do { \</span>
-<a name="l01652"></a>01652 <span class="preprocessor">    cpl_imagelist_delete(datlist); \</span>
-<a name="l01653"></a>01653 <span class="preprocessor">    cpl_imagelist_delete(varlist); \</span>
-<a name="l01654"></a>01654 <span class="preprocessor">} while (0)</span>
-<a name="l01655"></a>01655 <span class="preprocessor"></span>
-<a name="l01664"></a>01664 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l01665"></a><a class="code" href="group__fors__image.html#g4154f529cbabe4cb4d1203d03e771f8a">01665</a> <a class="code" href="group__fors__image.html#g4154f529cbabe4cb4d1203d03e771f8a">fors_image_collapse_create</a>(<span class="keyword">const</span> fors_image_list *images)
-<a name="l01666"></a>01666 {
-<a name="l01667"></a>01667     cpl_imagelist *datlist = NULL;
-<a name="l01668"></a>01668     cpl_imagelist *varlist = NULL;
-<a name="l01669"></a>01669     cpl_image *data = NULL;
-<a name="l01670"></a>01670     cpl_image *variance = NULL;
-<a name="l01671"></a>01671     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *i;
-<a name="l01672"></a>01672     <span class="keywordtype">int</span> N = 0;
-<a name="l01673"></a>01673     
-<a name="l01674"></a>01674     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( images != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l01675"></a>01675     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( fors_image_list_size(images) > 0, <span class="keywordflow">return</span> NULL, 
-<a name="l01676"></a>01676             <span class="stringliteral">"Cannot stack zero images"</span>);
-<a name="l01677"></a>01677 
-<a name="l01678"></a>01678     i = fors_image_list_first_const(images);
-<a name="l01679"></a>01679 
-<a name="l01680"></a>01680     datlist = cpl_imagelist_new();
-<a name="l01681"></a>01681     varlist = cpl_imagelist_new();
-<a name="l01682"></a>01682 
-<a name="l01683"></a>01683     <span class="keywordflow">while</span>(i != NULL) {
-<a name="l01684"></a>01684 
-<a name="l01685"></a>01685         <span class="comment">/* Append current image to image lists */</span>
-<a name="l01686"></a>01686         cpl_imagelist_set(datlist, 
-<a name="l01687"></a>01687                           cpl_image_duplicate(i-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>), 
-<a name="l01688"></a>01688                           cpl_imagelist_get_size(datlist));
-<a name="l01689"></a>01689         cpl_imagelist_set(varlist,
-<a name="l01690"></a>01690                           cpl_image_duplicate(i-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>),
-<a name="l01691"></a>01691                           cpl_imagelist_get_size(varlist));
-<a name="l01692"></a>01692         i = fors_image_list_next_const(images);
-<a name="l01693"></a>01693         N++;
-<a name="l01694"></a>01694     }
-<a name="l01695"></a>01695 
-<a name="l01696"></a>01696 <span class="preprocessor">#ifdef CPL_IS_NOT_CRAP</span>
-<a name="l01697"></a>01697 <span class="preprocessor"></span>    data    = cpl_imagelist_collapse_create(datlist);
-<a name="l01698"></a>01698 
-<a name="l01699"></a>01699     variance = cpl_imagelist_collapse_create(varlist);
-<a name="l01700"></a>01700 <span class="preprocessor">#else</span>
-<a name="l01701"></a>01701 <span class="preprocessor"></span>    data    = <a class="code" href="group__fors__utils.html#g833fbeca7835f9c594deb0a8752d8b74">fors_imagelist_collapse_create</a>(datlist);
-<a name="l01702"></a>01702 
-<a name="l01703"></a>01703     variance = <a class="code" href="group__fors__utils.html#g833fbeca7835f9c594deb0a8752d8b74">fors_imagelist_collapse_create</a>(varlist);
-<a name="l01704"></a>01704 <span class="preprocessor">#endif</span>
-<a name="l01705"></a>01705 <span class="preprocessor"></span>
-<a name="l01706"></a>01706     cpl_image_divide_scalar(variance, N);
-<a name="l01707"></a>01707 
-<a name="l01708"></a>01708     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01709"></a>01709     <span class="keywordflow">return</span> <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l01710"></a>01710 }
-<a name="l01711"></a>01711 
-<a name="l01712"></a>01712 
-<a name="l01713"></a>01713 <span class="preprocessor">#undef cleanup</span>
-<a name="l01714"></a>01714 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01715"></a>01715 <span class="preprocessor">do { \</span>
-<a name="l01716"></a>01716 <span class="preprocessor">    cpl_imagelist_delete(datlist); \</span>
-<a name="l01717"></a>01717 <span class="preprocessor">    cpl_imagelist_delete(varlist); \</span>
-<a name="l01718"></a>01718 <span class="preprocessor">} while (0)</span>
-<a name="l01719"></a>01719 <span class="preprocessor"></span>
-<a name="l01730"></a>01730 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l01731"></a><a class="code" href="group__fors__image.html#gfe360dbc95e94b6b1043401aef8cbacc">01731</a> <a class="code" href="group__fors__image.html#gfe360dbc95e94b6b1043401aef8cbacc">fors_image_collapse_minmax_create</a>(<span class="keyword">const</span> fors_image_list *images, 
-<a name="l01732"></a>01732                                   <span class="keywordtype">int</span> low, <span class="keywordtype">int</span> high)
-<a name="l01733"></a>01733 {
-<a name="l01734"></a>01734     cpl_imagelist *datlist = NULL;
-<a name="l01735"></a>01735     cpl_imagelist *varlist = NULL;
-<a name="l01736"></a>01736     cpl_image *data = NULL;
-<a name="l01737"></a>01737     cpl_image *variance = NULL;
-<a name="l01738"></a>01738     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *i;
-<a name="l01739"></a>01739     <span class="keywordtype">int</span> N = 0;
-<a name="l01740"></a>01740     
-<a name="l01741"></a>01741     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( images != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l01742"></a>01742     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( fors_image_list_size(images) >  low + high, <span class="keywordflow">return</span> NULL, 
-<a name="l01743"></a>01743             <span class="stringliteral">"Cannot reject more images than there are"</span>);
-<a name="l01744"></a>01744     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( low*high >= 0 && low+high > 0, <span class="keywordflow">return</span> NULL, 
-<a name="l01745"></a>01745             <span class="stringliteral">"Invalid minmax rejection criteria"</span>);
-<a name="l01746"></a>01746 
-<a name="l01747"></a>01747     i = fors_image_list_first_const(images);
-<a name="l01748"></a>01748 
-<a name="l01749"></a>01749     datlist = cpl_imagelist_new();
-<a name="l01750"></a>01750     varlist = cpl_imagelist_new();
-<a name="l01751"></a>01751 
-<a name="l01752"></a>01752     <span class="keywordflow">while</span>(i != NULL) {
-<a name="l01753"></a>01753 
-<a name="l01754"></a>01754         <span class="comment">/* Append current image to image lists */</span>
-<a name="l01755"></a>01755         cpl_imagelist_set(datlist, 
-<a name="l01756"></a>01756                           cpl_image_duplicate(i-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>), 
-<a name="l01757"></a>01757                           cpl_imagelist_get_size(datlist));
-<a name="l01758"></a>01758         cpl_imagelist_set(varlist,
-<a name="l01759"></a>01759                           cpl_image_duplicate(i-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>),
-<a name="l01760"></a>01760                           cpl_imagelist_get_size(varlist));
-<a name="l01761"></a>01761         i = fors_image_list_next_const(images);
-<a name="l01762"></a>01762         N++;
-<a name="l01763"></a>01763     }
-<a name="l01764"></a>01764 
-<a name="l01765"></a>01765     data     = cpl_imagelist_collapse_minmax_create(datlist, low, high);
-<a name="l01766"></a>01766     variance = cpl_imagelist_collapse_minmax_create(varlist, low, high);
-<a name="l01767"></a>01767 
-<a name="l01768"></a>01768     cpl_image_divide_scalar(variance, N);
-<a name="l01769"></a>01769 
-<a name="l01770"></a>01770     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01771"></a>01771     <span class="keywordflow">return</span> <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l01772"></a>01772 }
-<a name="l01773"></a>01773 
-<a name="l01786"></a>01786 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l01787"></a><a class="code" href="group__fors__image.html#g9f084a5b4f1564f1efb645e342eee2af">01787</a> <a class="code" href="group__fors__image.html#g9f084a5b4f1564f1efb645e342eee2af">fors_image_collapse_ksigma_create</a>(<span class="keyword">const</span> fors_image_list *images, 
-<a name="l01788"></a>01788                                   <span class="keywordtype">int</span> low, <span class="keywordtype">int</span> high, <span class="keywordtype">int</span> iter)
-<a name="l01789"></a>01789 {
-<a name="l01790"></a>01790     cpl_imagelist *datlist = NULL;
-<a name="l01791"></a>01791     cpl_imagelist *varlist = NULL;
-<a name="l01792"></a>01792     cpl_image *data = NULL;
-<a name="l01793"></a>01793     cpl_image *variance = NULL;
-<a name="l01794"></a>01794     cpl_image *ngood = NULL;
-<a name="l01795"></a>01795     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *i;
-<a name="l01796"></a>01796     
-<a name="l01797"></a>01797     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( images != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l01798"></a>01798 
-<a name="l01799"></a>01799     i = fors_image_list_first_const(images);
-<a name="l01800"></a>01800 
-<a name="l01801"></a>01801     datlist = cpl_imagelist_new();
-<a name="l01802"></a>01802     varlist = cpl_imagelist_new();
-<a name="l01803"></a>01803     
-<a name="l01804"></a>01804     <span class="keywordflow">while</span>(i != NULL) {
-<a name="l01805"></a>01805 
-<a name="l01806"></a>01806         <span class="comment">/* Append current image to image lists */</span>
-<a name="l01807"></a>01807         cpl_imagelist_set(datlist,
-<a name="l01808"></a>01808                           cpl_image_duplicate(i-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>),
-<a name="l01809"></a>01809                           cpl_imagelist_get_size(datlist));
-<a name="l01810"></a>01810         cpl_imagelist_set(varlist,
-<a name="l01811"></a>01811                           cpl_image_duplicate(i-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>),
-<a name="l01812"></a>01812                           cpl_imagelist_get_size(varlist));
-<a name="l01813"></a>01813         i = fors_image_list_next_const(images);
-<a name="l01814"></a>01814     }
-<a name="l01815"></a>01815 
-<a name="l01816"></a>01816     data     = <a class="code" href="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660">mos_ksigma_stack</a>(datlist, low, high, iter, &ngood);
-<a name="l01817"></a>01817     variance = cpl_imagelist_collapse_create(varlist);
-<a name="l01818"></a>01818 
-<a name="l01819"></a>01819     cpl_image_divide(variance, ngood);
-<a name="l01820"></a>01820 
-<a name="l01821"></a>01821     cpl_image_delete(ngood);
-<a name="l01822"></a>01822     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01823"></a>01823 
-<a name="l01824"></a>01824     <span class="keywordflow">return</span> <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l01825"></a>01825 }
-<a name="l01826"></a>01826 
-<a name="l01838"></a>01838 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l01839"></a><a class="code" href="group__fors__image.html#gbd2b7e8761473ff4ca42f90fa879e1ad">01839</a> <a class="code" href="group__fors__image.html#gbd2b7e8761473ff4ca42f90fa879e1ad">fors_image_collapse_median_create</a>(<span class="keyword">const</span> fors_image_list *images)
-<a name="l01840"></a>01840 {
-<a name="l01841"></a>01841     cpl_imagelist *datlist = NULL;
-<a name="l01842"></a>01842     cpl_imagelist *varlist = NULL;
-<a name="l01843"></a>01843     cpl_image *data = NULL;
-<a name="l01844"></a>01844     cpl_image *variance = NULL;
-<a name="l01845"></a>01845     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *i;
-<a name="l01846"></a>01846     <span class="keywordtype">int</span> N = 0;
-<a name="l01847"></a>01847 
-<a name="l01848"></a>01848     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( images != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l01849"></a>01849     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( fors_image_list_size(images) > 0, <span class="keywordflow">return</span> NULL, 
-<a name="l01850"></a>01850             <span class="stringliteral">"Cannot stack zero images"</span>);
-<a name="l01851"></a>01851 
-<a name="l01852"></a>01852     i = fors_image_list_first_const(images);
-<a name="l01853"></a>01853     
-<a name="l01854"></a>01854     datlist = cpl_imagelist_new();
-<a name="l01855"></a>01855     varlist = cpl_imagelist_new();
-<a name="l01856"></a>01856     <span class="keywordflow">while</span>(i != NULL) {
-<a name="l01857"></a>01857         <span class="comment">/* Append to image lists */</span>
-<a name="l01858"></a>01858         cpl_imagelist_set(datlist, 
-<a name="l01859"></a>01859                           cpl_image_duplicate(i-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>), 
-<a name="l01860"></a>01860                           cpl_imagelist_get_size(datlist));
-<a name="l01861"></a>01861         cpl_imagelist_set(varlist,
-<a name="l01862"></a>01862                           cpl_image_duplicate(i-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>),
-<a name="l01863"></a>01863                           cpl_imagelist_get_size(varlist));
-<a name="l01864"></a>01864 
-<a name="l01865"></a>01865         i = fors_image_list_next_const(images);
-<a name="l01866"></a>01866         N++;
-<a name="l01867"></a>01867     }
-<a name="l01868"></a>01868     
-<a name="l01869"></a>01869 <span class="preprocessor">#ifdef CPL_IS_NOT_CRAP</span>
-<a name="l01870"></a>01870 <span class="preprocessor"></span>    data    = cpl_imagelist_collapse_median_create(datlist);
-<a name="l01871"></a>01871 
-<a name="l01872"></a>01872     variance = cpl_imagelist_collapse_create(varlist);
-<a name="l01873"></a>01873 <span class="preprocessor">#else</span>
-<a name="l01874"></a>01874 <span class="preprocessor"></span>    data    = <a class="code" href="group__fors__utils.html#g2d1787d975000e60e8790fc656d538f6">fors_imagelist_collapse_median_create</a>(datlist);
-<a name="l01875"></a>01875 
-<a name="l01876"></a>01876     variance = <a class="code" href="group__fors__utils.html#g833fbeca7835f9c594deb0a8752d8b74">fors_imagelist_collapse_create</a>(varlist);
-<a name="l01877"></a>01877 <span class="preprocessor">#endif</span>
-<a name="l01878"></a>01878 <span class="preprocessor"></span>
-<a name="l01879"></a>01879     cpl_image_divide_scalar(variance, N);
-<a name="l01880"></a>01880 
-<a name="l01881"></a>01881     cpl_image_multiply_scalar(variance, 
-<a name="l01882"></a>01882                   <a class="code" href="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3">fors_utils_median_corr</a>(N) * 
-<a name="l01883"></a>01883                   <a class="code" href="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3">fors_utils_median_corr</a>(N));
-<a name="l01884"></a>01884     
-<a name="l01885"></a>01885     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01886"></a>01886     <span class="keywordflow">return</span> <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l01887"></a>01887 }
-<a name="l01888"></a>01888 
-<a name="l01889"></a>01889 <span class="preprocessor">#undef cleanup</span>
-<a name="l01890"></a><a class="code" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">01890</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01891"></a>01891 <span class="preprocessor"></span>
-<a name="l01908"></a><a class="code" href="group__fors__image.html#g5b5539c0e15fe20c16bedc58e8263724">01908</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g5b5539c0e15fe20c16bedc58e8263724">fors_image_draw</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">int</span> type,
-<a name="l01909"></a>01909              <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y,
-<a name="l01910"></a>01910              <span class="keywordtype">int</span> radius, <span class="keywordtype">double</span> color)
-<a name="l01911"></a>01911 {
-<a name="l01912"></a>01912     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l01913"></a>01913 
-<a name="l01914"></a>01914     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( type == 0 || type == 1 || type == 2,
-<a name="l01915"></a>01915             <span class="keywordflow">return</span> , <span class="stringliteral">"Unsupported type %d"</span>, type);
-<a name="l01916"></a>01916 
-<a name="l01917"></a>01917     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( radius > 0, <span class="keywordflow">return</span>, NULL );
-<a name="l01918"></a>01918 
-<a name="l01919"></a>01919     <span class="keywordflow">if</span> (type == 2) {
-<a name="l01920"></a>01920         <span class="keywordtype">int</span> i;
-<a name="l01921"></a>01921         <span class="keywordflow">for</span> (i = 0; i < 360; i++) {
-<a name="l01922"></a>01922             <span class="comment">/* Step size of 1 degree is arbitrary */</span>
-<a name="l01923"></a>01923 
-<a name="l01924"></a>01924             <span class="keywordtype">int</span> px = x + radius*cos(i/(2*M_PI));
-<a name="l01925"></a>01925             <span class="keywordtype">int</span> py = y + radius*sin(i/(2*M_PI));
-<a name="l01926"></a>01926             
-<a name="l01927"></a>01927             <span class="keywordflow">if</span> (1 <= px && px <= cpl_image_get_size_x(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>) &&
-<a name="l01928"></a>01928                 1 <= py && py <= cpl_image_get_size_y(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>)) {
-<a name="l01929"></a>01929                 cpl_image_set(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, px, py, color);
-<a name="l01930"></a>01930                 cpl_image_set(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, px, py, color > 0 ? color : 0);
-<a name="l01931"></a>01931             }
-<a name="l01932"></a>01932         }
-<a name="l01933"></a>01933     }
-<a name="l01934"></a>01934     <span class="keywordflow">else</span> {
-<a name="l01935"></a>01935         <span class="keywordtype">int</span> i;
-<a name="l01936"></a>01936 
-<a name="l01937"></a>01937         <span class="keywordflow">for</span> (i = -radius; i <= radius; i++) {
-<a name="l01938"></a>01938 
-<a name="l01939"></a>01939             <span class="keywordtype">int</span> px, py;
-<a name="l01940"></a>01940             
-<a name="l01941"></a>01941             <span class="keywordflow">if</span> (type == 0) {
-<a name="l01942"></a>01942                 px = x + i;
-<a name="l01943"></a>01943                 py = y;
-<a name="l01944"></a>01944             }
-<a name="l01945"></a>01945             <span class="keywordflow">else</span> {
-<a name="l01946"></a>01946                 px = x;
-<a name="l01947"></a>01947                 py = y + i;
-<a name="l01948"></a>01948             }
-<a name="l01949"></a>01949             
-<a name="l01950"></a>01950             <span class="keywordflow">if</span> (1 <= px && px <= cpl_image_get_size_x(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>) &&
-<a name="l01951"></a>01951                 1 <= py && py <= cpl_image_get_size_y(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>)) {
-<a name="l01952"></a>01952                 cpl_image_set(image-><a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>    , px, py, color);
-<a name="l01953"></a>01953                 cpl_image_set(image-><a class="code" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a>, px, py, color > 0 ? color : 0);
-<a name="l01954"></a>01954             }
-<a name="l01955"></a>01955         }
-<a name="l01956"></a>01956     }
-<a name="l01957"></a>01957 
-<a name="l01958"></a>01958     <span class="keywordflow">return</span>;
-<a name="l01959"></a>01959 }
-<a name="l01960"></a>01960 
-<a name="l01961"></a><a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">01961</a> <span class="preprocessor">#define LIST_DEFINE</span>
-<a name="l01962"></a>01962 <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l01963"></a><a class="code" href="group__fors__image.html#g9d7995a21a54c1d39a0bc87d7f498029">01963</a> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_image</span>
-<a name="l01964"></a>01964 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l01965"></a>01965 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__image_8c_source.html b/html/fors__image_8c_source.html
new file mode 100644
index 0000000..a19ce24
--- /dev/null
+++ b/html/fors__image_8c_source.html
@@ -0,0 +1,1658 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_image.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_image.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_image.c,v 1.63 2013-08-07 13:24:40 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-07 13:24:40 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.63 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_double.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="struct__fors__image.html">   62</a></span> <span class="keyword">struct </span><a class="code" href="struct__fors__image.html">_fors_image</a></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_image *data;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_image *variance;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="comment">/* Invariants:</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="comment">       The CPL images are non-NULL. </span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="comment">       The variance image is everywhere non-negative.</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="comment">       The CPL image types are FORS_IMAGE_TYPE.</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="comment">       The CPL image bad pixel masks are unused</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> };</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8">   78</a></span> <span class="keyword">const</span> cpl_type <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a> = CPL_TYPE_FLOAT;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">#define FORS_IMAGE_TYPE_MAX FLT_MAX  </span><span class="comment">/* Use a #define rather than a variable here</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="comment">                                        to avoid type casting */</span><span class="preprocessor"></span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="comment">/* </span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="comment"> * The following static function passes a max filter of given box</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="comment"> * size on the input data buffer. The output data buffer must be</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="comment"> * pre-allocated. The box size must be a positive odd integer.</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="comment"> * Returns 0 on success.</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>  </div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="keyword">static</span> <span class="keywordtype">int</span> </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> max_filter(<span class="keyword">const</span> <span class="keywordtype">float</span> *ibuffer, <span class="keywordtype">float</span> *obuffer, <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> size)</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> {</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     <span class="keywordtype">float</span>  max;</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordtype">int</span>    start = size / 2;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="keywordtype">int</span>    end   = length - size / 2;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <span class="keywordtype">int</span>    i, j;</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="keywordflow">for</span> (i = start; i < end; i++) {</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>         max = ibuffer[i-start];</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>         <span class="keywordflow">for</span> (j = i - start + 1; j <= i + start; j++)</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>             <span class="keywordflow">if</span> (max < ibuffer[j])</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                 max = ibuffer[j];</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>         obuffer[i] = max;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     }</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="keywordflow">for</span> (i = 0; i < start; i++)</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>         obuffer[i] = obuffer[start];</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>  </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="keywordflow">for</span> (i = end; i < length; i++)</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>         obuffer[i] = obuffer[end-1];</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> }</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363">  128</a></span> <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(cpl_image *data, cpl_image *variance)</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> {</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( data != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( variance != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="comment">//TODO: Changed to allow saving as double. Check the consequences.</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="comment">//    assure( cpl_image_get_type(data) == FORS_IMAGE_TYPE, return NULL,</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="comment">//            "Provided data image type is %s, must be %s",</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="comment">//            fors_type_get_string(cpl_image_get_type(data)),</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="comment">//            fors_type_get_string(FORS_IMAGE_TYPE) );</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="comment">//   assure( cpl_image_get_type(variance) == FORS_IMAGE_TYPE, return NULL,</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="comment">//            "Provided weight image type is %s, must be %s",</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="comment">//            fors_type_get_string(cpl_image_get_type(variance)),</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="comment">//            fors_type_get_string(FORS_IMAGE_TYPE) );</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_image_get_size_x(data) == cpl_image_get_size_x(variance) &&</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>             cpl_image_get_size_y(data) == cpl_image_get_size_y(variance),</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>             <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>             <span class="stringliteral">"Incompatible data and weight image sizes: "</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>             <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">"x%"</span>CPL_SIZE_FORMAT</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>             <span class="stringliteral">" and %"</span>CPL_SIZE_FORMAT<span class="stringliteral">"x%"</span>CPL_SIZE_FORMAT,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>             cpl_image_get_size_x(data), cpl_image_get_size_y(data),</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>             cpl_image_get_size_x(variance), cpl_image_get_size_y(variance));</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_image_get_min(variance) >= 0, <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>             <span class="stringliteral">"Variances must be non-negative, minimum is %f"</span>,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>             cpl_image_get_min(variance));</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     image = cpl_malloc(<span class="keyword">sizeof</span>(*image));</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     image->data = data;</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     image->variance = variance;</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="keywordflow">return</span> image;    </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> }</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l00175"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f">  175</a></span> <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> {</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(cpl_image_duplicate(image->data),</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                           cpl_image_duplicate(image->variance));</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> }</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad">  188</a></span> <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(<a class="code" href="struct__fors__image.html">fors_image</a> **image)</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> {</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="keywordflow">if</span> (image && *image) {</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>         cpl_image_delete((*image)->data);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>         cpl_image_delete((*image)->variance);</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>         cpl_free(*image); *image = NULL;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     }</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> }</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga67d54e90304b185e9f211aba5a620c4f">  203</a></span> <a class="code" href="group__fors__image.html#ga67d54e90304b185e9f211aba5a620c4f" title="Deallocate image and set pointer to NULL.">fors_image_delete_const</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> **image)</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> {</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>((<a class="code" href="struct__fors__image.html">fors_image</a> **)image);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> }</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="comment">/* not used */</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> <span class="preprocessor">#if 0</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> fors_image_dump(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, FILE *file)</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> {</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     <span class="keywordflow">if</span> (image == NULL) {</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>         fprintf(file, <span class="stringliteral">"Null image\n"</span>);</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     }</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>         cpl_stats *stats;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> </div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>         fprintf(file, <span class="stringliteral">"Data:\n"</span>);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>         stats = cpl_stats_new_from_image(image->data, CPL_STATS_ALL);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>         cpl_stats_dump(stats, CPL_STATS_ALL, file);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>         cpl_stats_delete(stats);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>             </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>         fprintf(file, <span class="stringliteral">"Variance:\n"</span>);</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>         stats = cpl_stats_new_from_image(image->variance, CPL_STATS_ALL);</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>         cpl_stats_dump(stats, CPL_STATS_ALL, file);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>         cpl_stats_delete(stats);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     }</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     </div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> }</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="preprocessor">    double_list_delete(&sat_percent, double_delete); \</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> fors_image_list *</div>
+<div class="line"><a name="l00260"></a><span class="lineno"><a class="code" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c">  260</a></span> <a class="code" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list</a>(<span class="keyword">const</span> cpl_frameset *frames, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *bias,</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                      <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                      <span class="keywordtype">double</span> *saturated)</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> {</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     fors_image_list *ilist = fors_image_list_new();</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     double_list *sat_percent = double_list_new();</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( frames != NULL, <span class="keywordflow">return</span> ilist, NULL );</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_frameset_is_empty(frames), <span class="keywordflow">return</span> ilist, <span class="stringliteral">"Empty frameset"</span>);</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     {</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>         <span class="keyword">const</span> cpl_frame *f;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>         </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>         <span class="keywordflow">for</span> (f = cpl_frameset_get_first_const(frames);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>              f != NULL;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>              f = cpl_frameset_get_next_const(frames)) {</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>             <span class="keywordtype">double</span> saturated_one;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>             </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>             <a class="code" href="struct__fors__image.html">fors_image</a> *i = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(f, bias, setting,</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>                                             saturated != NULL ? </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>                                             &saturated_one : NULL);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>             <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> ilist, NULL );</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>             </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>             fors_image_list_insert(ilist, i);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>             <span class="keywordflow">if</span> (saturated != NULL) {</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                 double_list_insert(sat_percent, </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>                                    double_duplicate(&saturated_one));</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>             }</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>         }</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     }</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> </div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     <span class="comment">/* fixme: make sure input is consistent */</span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> </div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     <span class="comment">/* Compute overall percentage as mean of each percentage.</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> <span class="comment">       Valid because input frames have same size. */</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="keywordflow">if</span> (saturated != NULL) {</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>         *saturated = double_list_mean(sat_percent, double_eval, NULL);</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     }</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     cleanup;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="keywordflow">return</span> ilist;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> }</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="keyword">const</span> fors_image_list *</div>
+<div class="line"><a name="l00316"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga0895dc7573734afe519fa4dff3ea33bd">  316</a></span> <a class="code" href="group__fors__image.html#ga0895dc7573734afe519fa4dff3ea33bd" title="Load imagelist.">fors_image_load_list_const</a>(<span class="keyword">const</span> cpl_frameset *frames, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *bias,</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>                            <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                            <span class="keywordtype">double</span> *saturated)</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> {</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     <span class="keywordflow">return</span> (<span class="keyword">const</span> fors_image_list *)</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>         <a class="code" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list</a>(frames, bias, setting, saturated);</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> }</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> <span class="preprocessor">    cpl_propertylist_delete(header); \</span></div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> <span class="preprocessor">    cpl_table_delete(overscans); \</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> <span class="preprocessor">    cpl_image_delete(temp); \</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> <span class="preprocessor">    cpl_mask_delete(non_saturated); \</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> <span class="preprocessor">    fors_setting_delete(&frame_setting); \</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l00352"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a">  352</a></span> <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(<span class="keyword">const</span> cpl_frame *frame, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *bias,</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>                 <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>                 <span class="keywordtype">double</span> *saturated)</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> {</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image           = NULL;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *frame_setting = NULL;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     cpl_image *data             = NULL;</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     cpl_image *variance         = NULL;</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     cpl_image *temp             = NULL;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     cpl_propertylist *header    = NULL;</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     cpl_table *overscans        = NULL;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     cpl_mask *non_saturated     = NULL;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename;</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     <span class="keywordtype">int</span> extension= 0;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> plane = 0;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keywordtype">double</span> ocorr = 0.0;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     <span class="keywordtype">int</span> has_overscans = 0;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( frame != NULL, <span class="keywordflow">return</span> image, NULL );</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     <span class="comment">/* bias may be NULL */</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( setting != NULL, <span class="keywordflow">return</span> image, NULL );</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     filename = cpl_frame_get_filename(frame);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( filename != NULL, <span class="keywordflow">return</span> image, </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>             <span class="stringliteral">"NULL filename received"</span>);</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Loading %s: %s"</span>,</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>                  <span class="comment">/* fors_frame_get_group_string(frame), */</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>          (cpl_frame_get_tag(frame) != NULL) ? </div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>          cpl_frame_get_tag(frame) : <span class="stringliteral">"NULL"</span>,</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>                  filename);</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="comment">/* Verify instrument setting */</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <a class="code" href="group__fors__setting.html#ga160a93959e72b826426891ca8e0f80aa" title="Verify that instrument settings are compatible.">fors_setting_verify</a>(setting, frame, &frame_setting);</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, </div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>             <span class="stringliteral">"Could not verify %s setting"</span>, </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>             filename);</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> </div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     <span class="comment">/* Get header */</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     header = cpl_propertylist_load(filename, extension);</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>             <span class="stringliteral">"Could not load %s extension %d header"</span>, </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>             filename, extension);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     <span class="comment">/* Get data */</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     data = cpl_image_load(filename, </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>                           <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>, plane, extension);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>             <span class="stringliteral">"Could not load image from %s extension %d"</span>, </div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>             filename, extension);</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> </div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     <span class="comment">/* Read, remove overscan areas */</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     {</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         <span class="keywordtype">int</span> xlow, ylow, xhig, yhig;</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     <span class="comment">/* bool check_consistency = false; */</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> </div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>         overscans = mos_load_overscans_fors(header);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     <span class="comment">/* Uses always ESO.DET.OUT1.*  which is fine even</span></div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> <span class="comment">       for old FORS data */</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> </div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                 <span class="stringliteral">"Could not read overscan information from %s extension %d"</span>, </div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>                 filename, extension);</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> </div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>         <span class="keywordflow">for</span> (i = 1; i < cpl_table_get_nrow(overscans); i++) {</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> <span class="comment">             * Overscan correction</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>         </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>             xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, i, NULL);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>             ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, i, NULL);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>             xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, i, NULL);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>             yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, i, NULL);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> </div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>             temp = cpl_image_extract(data, xlow+1, ylow+1, xhig, yhig);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>             ocorr += cpl_image_get_median(temp);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>             cpl_image_delete(temp); temp = NULL;</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         }</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>         <span class="keywordflow">if</span> (cpl_table_get_nrow(overscans) > 1) {</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>             has_overscans = 1;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>             ocorr /= cpl_table_get_nrow(overscans) - 1;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         }</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, 0, NULL);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, 0, NULL);</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>         xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, 0, NULL);</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>         yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, 0, NULL);</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>         </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>         cpl_table_delete(overscans); overscans = NULL;</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>         </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>         temp = cpl_image_duplicate(data);</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>         cpl_image_delete(data);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         data = cpl_image_extract(temp, xlow+1, ylow+1, xhig, yhig);</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         </div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>         cpl_image_delete(temp); temp = NULL;</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     }</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     cpl_propertylist_delete(header); header = NULL;       </div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="comment">/* Define variance */</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     <span class="keywordflow">if</span> (cpl_frame_get_nextensions(frame) == 0 || bias != NULL) {</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>         <span class="comment">/* No error bars provided, assume RON only.</span></div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> <span class="comment">           If frame is not a bias, add photon noise later.</span></div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         <span class="comment">/* Define read-out-noise */</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         variance = cpl_image_new(</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>             cpl_image_get_size_x(data),</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>             cpl_image_get_size_y(data),</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>             <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);        </div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> </div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         <span class="keywordflow">if</span> (cpl_frame_get_group(frame) == CPL_FRAME_GROUP_CALIB) {</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>             cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>                             <span class="stringliteral">"No error bars provided for calibration frame %s, "</span></div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                             <span class="stringliteral">"assuming no errors. For complete error propagation, "</span></div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>                             <span class="stringliteral">"you may recreate this frame with this pipeline"</span>, </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>                             filename);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>             cpl_image_add_scalar(variance, frame_setting->ron*frame_setting->ron);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         }</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     }</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>         extension = 1;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         </div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>         <span class="comment">/* Get error bars */</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         variance = cpl_image_load(filename, </div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>                                   <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>, plane, extension);</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         </div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, </div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>                 <span class="stringliteral">"Could not load image from %s extension %d"</span>, </div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>                 filename, extension);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>         cpl_image_power(variance, 2);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> </div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_image_get_min(variance) >= 0, <span class="keywordflow">return</span> image,</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>                 <span class="stringliteral">"Illegal minimum variance: %g"</span>,</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>                 cpl_image_get_min(variance));</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span> </div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         cpl_image_delete(temp); temp = NULL;</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     }</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     </div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     image = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> </div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     <span class="comment">/* Count saturated pixels */</span></div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     <span class="keywordflow">if</span> (saturated != NULL) {</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         <span class="keywordtype">double</span> lo_cut = 0.5;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         <span class="keywordtype">double</span> hi_cut = 65534.5;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>         non_saturated = cpl_mask_threshold_image_create(</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>             data, lo_cut, hi_cut);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         </div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         *saturated = (cpl_image_get_size_x(data) * </div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>                       cpl_image_get_size_y(data) - </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>                       cpl_mask_count(non_saturated)) * 100.0 / </div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>             (cpl_image_get_size_x(data) * </div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>              cpl_image_get_size_y(data));</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>         cpl_mask_delete(non_saturated); non_saturated = NULL;</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> </div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         cpl_msg_debug(cpl_func,</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>                      <span class="stringliteral">"%f %% saturated pixels"</span>, *saturated);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     }        </div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>     </div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     <span class="keywordflow">if</span> (bias == NULL) {</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>         <span class="comment">/* Done. No bias to subtract */</span></div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     }</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frame_get_group(frame) == CPL_FRAME_GROUP_RAW,</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>                 <span class="keywordflow">return</span> image,</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>                 <span class="stringliteral">"Refusing to subtract bias from non-raw (%s) input frame: %s"</span>,</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>                 <a class="code" href="group__fors__utils.html#ga3e2178bad7068e3768fc5f78b1d02490" title="Get frame group as a string.">fors_frame_get_group_string</a>(frame),</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>                 filename);</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>         </div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"Subtracting bias from %s"</span>, filename);</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>         </div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>         <a class="code" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be" title="Subtract images.">fors_image_subtract</a>(image, bias);</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>         </div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> image, </div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>                 <span class="stringliteral">"Bias subtraction failed"</span> );</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>         <span class="keywordflow">if</span> (has_overscans) {</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> </div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> <span class="comment">             * Overscan correction</span></div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>             ocorr -= cpl_image_get_median(bias->data);</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span> </div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>             cpl_msg_info(cpl_func, </div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>                          <span class="stringliteral">"Overscan correction applied: %.2f ADUs"</span>, ocorr);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>             <a class="code" href="group__fors__image.html#gacbfb7c0518043b1079bb72af95d80961" title="Subtract scalar.">fors_image_subtract_scalar</a>(image, ocorr, -1);</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         }</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>         </div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>         <span class="comment">/* Variance is now (ron**2  +  bias_noise**2).</span></div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> <span class="comment">           Add photonic noise:</span></div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span> <span class="comment">           </span></div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> <span class="comment">           variance := variance + |f|/conad</span></div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span> </div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         <span class="keywordtype">double</span> conad = 1.0 / frame_setting->average_gain;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> </div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>         temp = cpl_image_divide_scalar_create(image->data, conad);</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>         cpl_image_abs(temp);</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         cpl_image_add(image->variance, temp);</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     }</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>     </div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     cleanup;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     <span class="keywordflow">return</span> image;</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span> }</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span> </div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> </div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span> <span class="preprocessor">    cpl_image_delete(sigma); \</span></div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00587"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1">  587</a></span> <a class="code" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keyword">const</span> cpl_propertylist *header,</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *filename)</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span> {</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     cpl_propertylist *extension_header = NULL;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     cpl_image *sigma = NULL;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span> </div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     <span class="comment">/* header may be NULL */</span></div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( filename != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     </div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     cpl_image_save(image->data, filename, CPL_BPP_IEEE_FLOAT, header,</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>                    CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>             <span class="stringliteral">"Cannot save product %s"</span>, filename);</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     </div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     sigma = cpl_image_power_create(image->variance, 0.5);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     <span class="comment">/* This would probably be faster if sqrt() is used rather than pow */</span></div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span> </div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     cpl_image_save(sigma, filename, CPL_BPP_IEEE_FLOAT, extension_header,</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>                    CPL_IO_EXTEND);</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>             <span class="stringliteral">"Cannot save product %s"</span>, filename);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     cleanup;</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span> }</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span> </div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> </div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span> <span class="preprocessor">    cpl_image_delete(var_bkg); \</span></div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span> <span class="preprocessor">    cpl_image_delete(sigma_bkg); \</span></div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00633"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga38eebeb331a65efbffbc6dc04304a786">  633</a></span> <a class="code" href="group__fors__image.html#ga38eebeb331a65efbffbc6dc04304a786" title="Save image in format useable by SExtractor.">fors_image_save_sex</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keyword">const</span> cpl_propertylist *header,</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_dat,</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_var,</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>                     <span class="keywordtype">int</span> radius)</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> {</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     cpl_propertylist *extension_header = NULL;</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>     cpl_image *sigma_bkg = NULL;</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     cpl_image *var_bkg = NULL;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> </div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     <span class="comment">/* header may be NULL */</span></div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( filename_dat != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( filename_var != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> </div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     cpl_image_save(image->data, filename_dat, CPL_BPP_IEEE_FLOAT, header,</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>                    CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>             <span class="stringliteral">"Cannot save product %s"</span>, filename_dat);</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>     </div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     <span class="comment">/* Sextractor wants as input the background error bars,</span></div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span> <span class="comment">       i.e. excluding sources.</span></div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span> <span class="comment">       Therefore filter away sources but keep the sharp edges</span></div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span> <span class="comment">       between the illuminated / non-illuminated areas.</span></div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> <span class="comment"></span></div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span> <span class="comment">       I.e. use a median filter, average filter would not work.</span></div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span> </div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Creating background error map"</span>);</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> </div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>     <span class="keywordtype">bool</span> filter_data = <span class="keyword">false</span>;  <span class="comment">/* filter the variance image */</span></div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     <span class="keywordtype">int</span> xstep = radius/2; <span class="comment">/* 25 points sampling grid </span></div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> <span class="comment">                             . . . . .</span></div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span> <span class="comment">                             . . . . .</span></div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span> <span class="comment">                             . . . . .</span></div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> <span class="comment">                             . . . . .</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span> <span class="comment">                             . . . . .</span></div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span> <span class="comment">                           */</span></div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>     <span class="keywordtype">int</span> ystep = radius/2;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     <span class="keywordtype">int</span> xstart = 1;</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keywordtype">int</span> ystart = 1;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     <span class="keywordtype">int</span> xend = <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(image);</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     <span class="keywordtype">int</span> yend = <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(image);</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span> </div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> </div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     var_bkg = <a class="code" href="group__fors__image.html#ga395b18920e75b55d9a793dfbcb99755f" title="Smooth image.">fors_image_filter_median_create</a>(image, </div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>                                               radius,</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>                                               radius,</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>                                               xstart, ystart,</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>                                               xend, yend,</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>                                               xstep, ystep,</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>                                               filter_data);</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>             <span class="stringliteral">"Median filtering failed"</span>);</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span> </div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>     sigma_bkg = cpl_image_power_create(var_bkg, 0.5);</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span> </div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     cpl_image_save(sigma_bkg, filename_var,</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>                    CPL_BPP_IEEE_FLOAT, extension_header,</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>                    CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>             <span class="stringliteral">"Cannot save product %s"</span>, filename_var);</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span> </div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     cleanup;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> }</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span> </div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00706"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc">  706</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> {</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     <span class="keywordflow">return</span> cpl_image_get_size_x(image->data);</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span> }</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> </div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00719"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7">  719</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span> {</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     <span class="keywordflow">return</span> cpl_image_get_size_y(image->data);</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span> }</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span> </div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00731"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga547b9bf5f615a083bffdcfa9097d0520">  731</a></span> <span class="keyword">const</span> <span class="keywordtype">float</span> *<a class="code" href="group__fors__image.html#ga547b9bf5f615a083bffdcfa9097d0520" title="Get pointer to data buffer.">fors_image_get_data_const</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> {</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span> </div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a> == CPL_TYPE_FLOAT, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     <span class="comment">/* This function (including API) would need to change</span></div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> <span class="comment">       if the pixel type changes */</span></div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span> </div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     <span class="keywordflow">return</span> cpl_image_get_data_float(image->data);</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span> }</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> </div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00752"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga14651bbe94e495df34aa59b335439b8f">  752</a></span> <a class="code" href="group__fors__image.html#ga14651bbe94e495df34aa59b335439b8f" title="Absolute value.">fors_image_abs</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image)</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span> {</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span> </div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     cpl_image_abs(image->data);</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span> </div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span> }</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span> </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00771"></a><span class="lineno"><a class="code" href="group__fors__image.html#gad4ecbb0eb96611d66dc9a3a1bc2ae0d8">  771</a></span> <a class="code" href="group__fors__image.html#gad4ecbb0eb96611d66dc9a3a1bc2ae0d8" title="Squared.">fors_image_square</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image)</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span> {</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     cpl_image_multiply(image->data, image->data);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     <span class="comment">/* It is an undocumented feature of CPL that you</span></div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> <span class="comment">       can pass the same image to cpl_image_multiply and get</span></div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span> <span class="comment">       the right answer. Let us hope it does not change...</span></div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>     cpl_image_multiply_scalar(image->variance, 2);</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> </div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span> }</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> </div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span> </div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> <span class="preprocessor">    cpl_image_delete(temp); \</span></div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00800"></a><span class="lineno"><a class="code" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be">  800</a></span> <a class="code" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be" title="Subtract images.">fors_image_subtract</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *right)</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> {</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     cpl_image *temp = NULL;</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( left != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( right != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span> </div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     cpl_image_subtract(left->data, right->data);</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span> </div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     <span class="comment">/*  variance_left := variance_left + variance_right */</span></div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     cpl_image_add(left->variance, right->variance);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span> </div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     cleanup;</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span> }</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span> </div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00828"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga25c0e2f6005831b9f5fcf3d81accfc43">  828</a></span> <a class="code" href="group__fors__image.html#ga25c0e2f6005831b9f5fcf3d81accfc43" title="Multiply images.">fors_image_multiply_noerr</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> cpl_image *right)</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span> {</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( left != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( right != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_image_get_size_x(left->data) == cpl_image_get_size_x(right) &&</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>             cpl_image_get_size_y(left->data) == cpl_image_get_size_y(right),</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>             <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>             <span class="stringliteral">"Incompatible data and weight image sizes: "</span></div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>             <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">"x%"</span>CPL_SIZE_FORMAT</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>             <span class="stringliteral">" and %"</span>CPL_SIZE_FORMAT<span class="stringliteral">"x%"</span>CPL_SIZE_FORMAT,</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>             cpl_image_get_size_x(left->data),</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>             cpl_image_get_size_y(left->data),</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>             cpl_image_get_size_x(right),</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>             cpl_image_get_size_y(right));</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span> </div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     cpl_image_multiply(left->data, right);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     cpl_image_multiply(left->variance, right);</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>     cpl_image_multiply(left->variance, right);</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span> </div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span> }</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span> </div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00869"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga88aca44b1a0bde06bbd43c487ae58766">  869</a></span> <a class="code" href="group__fors__image.html#ga88aca44b1a0bde06bbd43c487ae58766" title="Divide images.">fors_image_divide_noerr</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, cpl_image *right)</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span> {</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( left != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( right != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_image_get_size_x(left->data) == cpl_image_get_size_x(right) &&</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>             cpl_image_get_size_y(left->data) == cpl_image_get_size_y(right),</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>             <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>             <span class="stringliteral">"Incompatible data and weight image sizes: "</span></div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>             <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">"x%"</span>CPL_SIZE_FORMAT</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>             <span class="stringliteral">" and %"</span>CPL_SIZE_FORMAT<span class="stringliteral">"x%"</span>CPL_SIZE_FORMAT,</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>             cpl_image_get_size_x(left->data),</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>             cpl_image_get_size_y(left->data),</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>             cpl_image_get_size_x(right),</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>             cpl_image_get_size_y(right));</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span> </div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>     <span class="keywordtype">int</span> x, y;</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>     <span class="keywordtype">int</span> nx = cpl_image_get_size_x(right);</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>     <span class="keywordtype">int</span> ny = cpl_image_get_size_y(right);</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>     <span class="keywordtype">float</span> *datal = cpl_image_get_data_float(left->data);</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>     <span class="keywordtype">float</span> *datav = cpl_image_get_data_float(left->variance);</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>     <span class="keywordtype">float</span> *datar = cpl_image_get_data_float(right);</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>     <span class="keywordflow">for</span> (y = 0; y < ny; y++) {</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>         <span class="keywordflow">for</span> (x = 0; x < nx; x++) {</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>             <span class="keywordflow">if</span> (datar[x + nx*y] == 0) {</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>                 datar[x + nx*y] = 1;</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>                 datal[x + nx*y] = 1;</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span> </div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>                 datav[x + nx*y] = FORS_IMAGE_TYPE_MAX;</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>             }</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>         }</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>     }</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span> </div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>     cpl_image_divide(left->data, right);</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>     cpl_image_divide(left->variance, right);</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>     cpl_image_divide(left->variance, right);</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span> </div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span> }</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span> </div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span> <span class="preprocessor">    fors_image_delete(&dupl); \</span></div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00934"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2">  934</a></span> <a class="code" href="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2" title="Divide images.">fors_image_divide</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *right)</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span> {</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *dupl = NULL;</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span> </div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( left  != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( right != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span> </div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>     dupl = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(right);</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span> </div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>     cpl_image_divide(left->data, dupl->data); </div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>     <span class="comment">/* This CPL function divides by zero by setting  x/0 = 1 for all x */</span></div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span> </div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>     cpl_image_multiply(dupl->variance, left->data);</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>     cpl_image_multiply(dupl->variance, left->data);</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span> </div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>     <span class="comment">/* Now  dupl->variance = sigma2^2 * data1^2 / data2^2 */</span></div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span> </div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>     cpl_image_add(left->variance, dupl->variance);</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span> </div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>     <span class="comment">/* Now  left->variance = sigma1^2 + sigma2^2 * data1^2 / data2^2 */</span></div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span> </div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>     cpl_image_divide(left->variance, dupl->data);</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>     cpl_image_divide(left->variance, dupl->data);</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>     <span class="comment">/* QED */</span></div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span> </div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>     <span class="comment">/* Handle division by zero */</span></div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>     <span class="keywordtype">int</span> x, y;</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>     <span class="keywordtype">int</span> nx = cpl_image_get_size_x(left->data);</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>     <span class="keywordtype">int</span> ny = cpl_image_get_size_y(left->data);</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>     <span class="keywordtype">float</span> *datal = cpl_image_get_data_float(left->data);</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>     <span class="keywordtype">float</span> *datav = cpl_image_get_data_float(left->variance);</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>     <span class="keywordtype">float</span> *datar = cpl_image_get_data_float(right->data);</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>     <span class="keywordflow">for</span> (y = 0; y < ny; y++) {</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>         <span class="keywordflow">for</span> (x = 0; x < nx; x++) {</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>             <span class="keywordflow">if</span> (datar[x + nx*y] == 0) {</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>                 datal[x + nx*y] = 1;</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>                 datav[x + nx*y] = FORS_IMAGE_TYPE_MAX;</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>             }</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>         }</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>     }</div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span> </div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>     cleanup;</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span> }</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span> </div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span> <span class="preprocessor">    cpl_image_delete(s22d12); \</span></div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00996"></a><span class="lineno"><a class="code" href="group__fors__image.html#gaaa54b1e6e0e3cf5fcf442267896f6dad">  996</a></span> <a class="code" href="group__fors__image.html#gaaa54b1e6e0e3cf5fcf442267896f6dad" title="Multiply images.">fors_image_multiply</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *right)</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span> {</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>     cpl_image *s22d12 = NULL;</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span> </div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( left  != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( right != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span> </div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>     s22d12 = cpl_image_duplicate(right->variance);</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>     cpl_image_multiply(s22d12, left->data);</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>     cpl_image_multiply(s22d12, left->data);</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>     </div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>     cpl_image_multiply(left->variance, right->data);</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>     cpl_image_multiply(left->variance, right->data);</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>     cpl_image_add(left->variance, s22d12);</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span> </div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>     cpl_image_multiply(left->data, right->data);</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span> </div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>     cleanup;</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span> }</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span> </div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span> </div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01032"></a><span class="lineno"><a class="code" href="group__fors__image.html#gacbfb7c0518043b1079bb72af95d80961"> 1032</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gacbfb7c0518043b1079bb72af95d80961" title="Subtract scalar.">fors_image_subtract_scalar</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span [...]
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span> {</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( ds <= 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Unsupported"</span>);</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span> </div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>     cpl_image_subtract_scalar(image->data, s);</div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span> </div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span> }</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span> </div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span> </div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01057"></a><span class="lineno"><a class="code" href="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35"> 1057</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35" title="Divide by scalar.">fors_image_divide_scalar</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span> [...]
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span> {</div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Division by zero"</span>);</div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( ds <= 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Unsupported"</span>);</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span> </div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>     cpl_image_divide_scalar(image->data, s);</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>     cpl_image_divide_scalar(image->variance, s*s);</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>     </div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span> }</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span> </div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01083"></a><span class="lineno"><a class="code" href="group__fors__image.html#gadd751e2623f778d5bb2b8f3b628077c2"> 1083</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gadd751e2623f778d5bb2b8f3b628077c2" title="Multiply by scalar.">fors_image_multiply_scalar</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</s [...]
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span> {</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( ds <= 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Unsupported"</span>);</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span> </div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>     cpl_image_multiply_scalar(image->data, s);</div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>     cpl_image_multiply_scalar(image->variance, s*s);</div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span> </div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span> }</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span> </div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span> <span class="preprocessor">    cpl_image_delete(temp); \</span></div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01112"></a><span class="lineno"><a class="code" href="group__fors__image.html#gabe2039c17c13fed0e430d71cb38454bf"> 1112</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gabe2039c17c13fed0e430d71cb38454bf" title="Exponential.">fors_image_exponential</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> b, <span class="keywordtype">double</span> db)</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span> {</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>     cpl_image *temp = NULL;</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span> </div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( b >= 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Negative base: %f"</span>, b);</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( db <= 0, <span class="keywordflow">return</span>, <span class="stringliteral">"Unsupported"</span>);</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span> </div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>     cpl_image_exponential(image->data, b);</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span> </div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>     <span class="keywordtype">double</span> lnb = log(b);</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>     </div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>     cpl_image_multiply_scalar(image->variance, lnb*lnb);</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>     cpl_image_multiply(image->variance, image->data);</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>     cpl_image_multiply(image->variance, image->data);</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span> </div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span> }</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span> </div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span> </div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l01140"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga918a9107b07852d77bd457ea44d9b28e"> 1140</a></span> <a class="code" href="group__fors__image.html#ga918a9107b07852d77bd457ea44d9b28e" title="Get min data value.">fors_image_get_min</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span> {</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span> </div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>     <span class="keywordflow">return</span> cpl_image_get_min(image->data);</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span> }</div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span> </div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l01155"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga8bde38b5f976d70ab7d6cef4652e1a51"> 1155</a></span> <a class="code" href="group__fors__image.html#ga8bde38b5f976d70ab7d6cef4652e1a51" title="Get max data value.">fors_image_get_max</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image)</div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span> {</div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span> </div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>     <span class="keywordflow">return</span> cpl_image_get_max(image->data);</div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span> }</div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span> </div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l01171"></a><span class="lineno"><a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f"> 1171</a></span> <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dmean)</div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span> {</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dmean == NULL, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Unsupported"</span>);</div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span> </div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>     <span class="keywordflow">return</span> cpl_image_get_mean(image->data);</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span> }</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span> </div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l01188"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb"> 1188</a></span> <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dmedian)</div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span> {</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dmedian == NULL, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Unsupported"</span>);</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span> </div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>     <span class="keywordflow">return</span> cpl_image_get_median(image->data);</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span> }</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span> </div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span> </div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01213"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053"> 1213</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053" title="Crop image.">fors_image_crop</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image,</div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>              <span class="keywordtype">int</span> xlo, <span class="keywordtype">int</span> ylo,</div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>              <span class="keywordtype">int</span> xhi, <span class="keywordtype">int</span> yhi)</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span> {</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>     <span class="comment">/* CPL is missing the function to locally extract an image,</span></div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span> <span class="comment">       so this this inefficient CPL function */</span></div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( 1 <= xlo && xlo <= xhi && xhi <= <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(image) &&</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>             1 <= ylo && ylo <= yhi && yhi <= <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(image),</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>             <span class="keywordflow">return</span>, <span class="stringliteral">"Cannot extraction region (%d, %d) - (%d, %d) of "</span></div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>             <span class="stringliteral">"%dx%d image"</span>,</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>             xlo, ylo, xhi, yhi,</div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>             <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(image),</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>             <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(image));</div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>     </div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>     cpl_image *new_data = cpl_image_extract(image->data,</div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>                                             xlo, ylo,</div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>                                             xhi, yhi);</div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>     cpl_image_delete(image->data);</div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span> </div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>     cpl_image* new_variance = cpl_image_extract(image->variance,</div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>                                                 xlo, ylo,</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>                                                 xhi, yhi);</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>     cpl_image_delete(image->variance);</div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span> </div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>     image->data = new_data;</div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>     image->variance = new_variance;</div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span> </div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span> }</div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span> </div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span> cpl_image *</div>
+<div class="line"><a name="l01270"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga395b18920e75b55d9a793dfbcb99755f"> 1270</a></span> <a class="code" href="group__fors__image.html#ga395b18920e75b55d9a793dfbcb99755f" title="Smooth image.">fors_image_filter_median_create</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, </div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>                                 <span class="keywordtype">int</span> xradius,</div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>                                 <span class="keywordtype">int</span> yradius,</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>                                 <span class="keywordtype">int</span> xstart, </div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>                                 <span class="keywordtype">int</span> ystart,</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>                                 <span class="keywordtype">int</span> xend,</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>                                 <span class="keywordtype">int</span> yend,</div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>                                 <span class="keywordtype">int</span> xstep,</div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>                                 <span class="keywordtype">int</span> ystep,</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>                                 <span class="keywordtype">bool</span> use_data)</div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span> {</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>     <span class="keyword">const</span> cpl_image *input = NULL;</div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>     cpl_image *smooth = NULL;</div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>     <span class="keywordtype">int</span> nx, ny;</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>     </div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> smooth, NULL );</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>     passure( image->data != NULL, <span class="keywordflow">return</span> smooth );</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>     passure( image->variance != NULL, <span class="keywordflow">return</span> smooth );</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>     </div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>     input = (use_data) ? image->data : image->variance;</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span> </div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>     nx = cpl_image_get_size_x(input);</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>     ny = cpl_image_get_size_y(input);</div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span> </div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>     <span class="keywordflow">if</span> (xstep < 1) xstep = 1;</div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>     <span class="keywordflow">if</span> (ystep < 1) ystep = 1;</div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span> </div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( 1 <= xstart && xstart <= xend && xend <= nx &&</div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>             1 <= ystart && ystart <= yend && yend <= ny, <span class="keywordflow">return</span> smooth,</div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>             <span class="stringliteral">"Illegal region (%d, %d) - (%d, %d) of %dx%d image"</span>,</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>             xstart, ystart,</div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>             xend, yend,</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>             nx, ny);</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>     </div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>     smooth = cpl_image_duplicate(input);</div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span> </div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>     <span class="comment">/* For efficiency reasons, assume that the image type is float */</span></div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a> == CPL_TYPE_FLOAT, <span class="keywordflow">return</span> smooth, NULL );</div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span> </div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>     <span class="keyword">const</span> <span class="keywordtype">float</span> *input_data  = cpl_image_get_data_float_const(input);</div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>     <span class="keywordtype">float</span> *smooth_data = cpl_image_get_data_float(smooth);</div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>     <span class="keywordtype">float</span> *data = cpl_malloc((2*yradius + 1)*(2*xradius + 1)*<span class="keyword">sizeof</span>(*data));</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>     </div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>     <span class="keywordtype">int</span> y;</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>     <span class="keywordflow">for</span> (y = ystart; y < yend; y++) {</div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span> <span class="comment">          Sample kernel on grid which always contains the central pixel</span></div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span> <span class="comment">          </span></div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span> <span class="comment">          Trim window (note: this will cause fewer values to</span></div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span> <span class="comment">          be used for the median near the region borders </span></div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>         <span class="keywordtype">int</span> ylo = y - (yradius/ystep) * ystep;</div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>         <span class="keywordtype">int</span> yhi = y + (yradius/ystep) * ystep;</div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>         </div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>         <span class="keywordflow">while</span> (ylo < ystart) ylo += ystep;</div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>         <span class="keywordflow">while</span> (yhi > yend  ) yhi -= ystep;</div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>         </div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>         <span class="keywordtype">int</span> x;</div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>         <span class="keywordflow">for</span> (x = xstart; x < xend; x++) {</div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>             <span class="keywordtype">int</span> xlo = x - (xradius/xstep) * xstep;</div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>             <span class="keywordtype">int</span> xhi = x + (xradius/xstep) * xstep;</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>             </div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>             <span class="keywordflow">while</span> (xlo < xstart) xlo += xstep;</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>             <span class="keywordflow">while</span> (xhi > xend  ) xhi -= xstep;</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>             </div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>             <span class="comment">/* Collect data */</span></div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>             <span class="keywordtype">int</span> k = 0;</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>             <span class="keywordtype">int</span> j, i;</div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>             <span class="keywordflow">for</span> (j = ylo; j <= yhi; j += ystep) {</div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>                 <span class="keywordflow">for</span> (i = xlo; i <= xhi; i += xstep) {</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>                     data[k++] = input_data[ (i-1) + (j-1)*nx ];</div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>                 }</div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>             }</div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>         </div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>             <span class="comment">/* Get median */</span></div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>             smooth_data[ (x-1) + (y-1)*nx ] = </div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>                                <a class="code" href="group__fors__utils.html#ga513ceb86672094a1d13a45d75e01782a" title="Unbiased median.">fors_tools_get_median_float</a>(data, k);</div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>         }</div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>     }</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span> </div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>     cpl_free(data);</div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>     <span class="keywordflow">return</span> smooth;</div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span> }</div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span> </div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span> <span class="preprocessor">    cpl_image_delete(input); \</span></div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span> <span class="preprocessor"></span>cpl_image *</div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span> fors_image_flat_fit_create(<a class="code" href="struct__fors__image.html">fors_image</a> *image, </div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>                            <span class="keywordtype">int</span> step, </div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>                            <span class="keywordtype">int</span> degree, </div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>                            <span class="keywordtype">float</span> level)</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span> {</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>     cpl_image *temp = NULL;</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>     cpl_image *input = NULL;</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>     cpl_image *smooth = NULL;</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>     <span class="keywordtype">int</span> nx, ny;</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span> </div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> smooth, NULL );</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>     passure( image->data != NULL, <span class="keywordflow">return</span> smooth );</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( step > 0, <span class="keywordflow">return</span> smooth, NULL );</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( degree >= 0, <span class="keywordflow">return</span> smooth, NULL );</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span> </div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span> </div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>     temp = image->data;</div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span> </div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>     nx = cpl_image_get_size_x(temp);</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>     ny = cpl_image_get_size_y(temp);</div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span> </div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span> <span class="comment">     * For efficiency reasons, assume that the image type is float </span></div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span> </div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a> == CPL_TYPE_FLOAT, <span class="keywordflow">return</span> smooth, NULL );</div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span> </div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span> <span class="comment">     * Apply light median filter, to eliminate big outliers from fit</span></div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span> </div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>     input = <a class="code" href="group__moses.html#ga1f574f5f45840ea69fa03eb26055a1b1" title="Convenience function for standard median filtering.">mos_image_filter_median</a>(image->data, 3, 3);</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span> </div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>     <span class="keyword">const</span> <span class="keywordtype">float</span> *input_data = cpl_image_get_data_float_const(input);</div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span> </div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span> <span class="comment">     * First of all, count how many points will have to be fitted</span></div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span> </div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>     <span class="keywordtype">int</span> x, y, pos;</div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>     <span class="keywordtype">int</span> count = 0;</div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>     <span class="keywordflow">for</span> (y = 0; y < ny; y += step) {</div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>         pos = y*nx;</div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>         <span class="keywordflow">for</span> (x = 0; x < nx; x += step, pos += step) {</div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>             <span class="keywordflow">if</span> (input_data[pos] > level) {</div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>                 count++;</div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>             }</div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>         }</div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>     }</div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span> </div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>     <span class="keywordflow">if</span> (count < (degree+1)*(degree+2)) {</div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>         step = sqrt((nx*nx)/((degree+1)*(degree+2))) / 2;</div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>         <span class="keywordflow">if</span> (step == 0)</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>             step = 1;</div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Flat field image too small (%dx%d). "</span></div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>                       <span class="stringliteral">"Please provide a smaller resampling step (a good "</span></div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>                       <span class="stringliteral">"value would be %d)"</span>, nx, ny, step);</div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>         cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>         cleanup;</div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>     }</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span> </div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span> </div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span> <span class="comment">     * Fill position and flux vectors with appropriate values</span></div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span> </div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>     cpl_bivector *positions = cpl_bivector_new(count);</div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>     <span class="keywordtype">double</span> *xpos = cpl_bivector_get_x_data(positions);</div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>     <span class="keywordtype">double</span> *ypos = cpl_bivector_get_y_data(positions);</div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>     cpl_vector *fluxes = cpl_vector_new(count);</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>     <span class="keywordtype">double</span> *flux = cpl_vector_get_data(fluxes);</div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span> </div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>     count = 0;</div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>     <span class="keywordflow">for</span> (y = 0; y < ny; y += step) {</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>         pos = y*nx;</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>         <span class="keywordflow">for</span> (x = 0; x < nx; x += step, pos += step) {</div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>             <span class="keywordflow">if</span> (input_data[pos] > level) {</div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>                 xpos[count] = x;</div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>                 ypos[count] = y;</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>                 flux[count] = input_data[pos];</div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>                 count++;</div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>             }</div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>         }</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>     }</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span> </div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>     cpl_image_delete(input); input = NULL;</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span> </div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span> <span class="comment">     * Do the fit, and fill the output image with the model</span></div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span> <span class="comment">     * values in all pixels.</span></div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span> </div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>     cpl_polynomial *model = cpl_polynomial_fit_2d_create(positions,</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>                                                          fluxes,</div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>                                                          degree,</div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>                                                          NULL);</div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span> </div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>     cpl_bivector_delete(positions);</div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>     cpl_vector_delete(fluxes);</div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span> </div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>     smooth = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>     <span class="keywordtype">float</span> *smooth_data = cpl_image_get_data_float(smooth);</div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span> </div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>     cpl_vector *point = cpl_vector_new(2);</div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>     <span class="keywordtype">double</span> *dpoint = cpl_vector_get_data(point);</div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span> </div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>     <span class="keywordflow">for</span> (y = 0; y < ny; y++) {</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>         pos = y*nx;</div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>         dpoint[1] = y;</div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>         <span class="keywordflow">for</span> (x = 0; x < nx; x++, pos++) {</div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>             dpoint[0] = x;</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>             smooth_data[pos] = cpl_polynomial_eval(model, point);</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>         }</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>     }</div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span> </div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>     cpl_polynomial_delete(model);</div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>     cpl_vector_delete(point);</div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span> </div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>     cleanup;</div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>     <span class="keywordflow">return</span> smooth;</div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span> </div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span> }</div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span> </div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span> cpl_image *</div>
+<div class="line"><a name="l01503"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga21965427a98e2e07cf0b167e4610da1c"> 1503</a></span> <a class="code" href="group__fors__image.html#ga21965427a98e2e07cf0b167e4610da1c" title="Max filter image.">fors_image_filter_max_create</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, </div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>                              <span class="keywordtype">int</span> xradius,</div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>                              <span class="keywordtype">int</span> yradius,</div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>                              <span class="keywordtype">bool</span> use_data)</div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span> {</div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>     <span class="keyword">const</span> cpl_image *input = NULL;</div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>     cpl_image *hmaxima = NULL;</div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>     cpl_image *maxima = NULL;</div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>     <span class="keywordtype">int</span> nx, ny;</div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>     </div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> maxima, NULL );</div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>     passure( image->data != NULL, <span class="keywordflow">return</span> maxima );</div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>     passure( image->variance != NULL, <span class="keywordflow">return</span> maxima );</div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>     </div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>     input = (use_data) ? image->data : image->variance;</div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span> </div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>     nx = cpl_image_get_size_x(input);</div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>     ny = cpl_image_get_size_y(input);</div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span> </div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span> <span class="comment">     * Allocate space for horizontal max filter result.</span></div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span> </div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>     hmaxima = cpl_image_duplicate(input);</div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span> </div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>     <span class="comment">/* For efficiency reasons, assume that the image type is float */</span></div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a> == CPL_TYPE_FLOAT, <span class="keywordflow">return</span> maxima, NULL );</div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span> </div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>     <span class="keywordtype">float</span> *input_data  = (<span class="keywordtype">float</span> *)cpl_image_get_data_float_const(input);</div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>     <span class="keywordtype">float</span> *maxima_data = cpl_image_get_data_float(hmaxima);</div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span> </div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>     <span class="keywordtype">int</span> y;</div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>     <span class="keywordflow">for</span> (y = 0; y < ny; y++) {</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>         <span class="keyword">const</span> <span class="keywordtype">float</span> *irow = input_data + y * nx;</div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>         <span class="keywordtype">float</span>       *orow = maxima_data + y * nx;</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>         max_filter(irow, orow, nx, 2*xradius+1);</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>     }</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span> </div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>     cpl_image_turn(hmaxima, 1);</div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span> </div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span> <span class="comment">     * Allocate space for vertical max filter result.</span></div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span> </div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>     maxima = cpl_image_duplicate(hmaxima);</div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>     input_data  = cpl_image_get_data_float(hmaxima);</div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>     maxima_data = cpl_image_get_data_float(maxima);</div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span> </div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span> <span class="comment">     * Now nx is the y size of the rotated image...</span></div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span> </div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>     <span class="keywordtype">int</span> x;</div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>     <span class="keywordflow">for</span> (x = 0; x < nx; x++) {</div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>         <span class="keyword">const</span> <span class="keywordtype">float</span> *irow = input_data + x * ny;</div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>         <span class="keywordtype">float</span>       *orow = maxima_data + x * ny;</div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>         max_filter(irow, orow, ny, 2*yradius+1);</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>     }</div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span> </div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>     cpl_image_delete(hmaxima);</div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span> </div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>     cpl_image_turn(maxima, -1);</div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>     </div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>     <span class="keywordflow">return</span> maxima;</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span> }</div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span> </div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l01578"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e"> 1578</a></span> <a class="code" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e" title="Get empirical stdev of data.">fors_image_get_stdev</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dstdev)</div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span> {</div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dstdev == NULL, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Unsupported"</span>);</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span> </div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>     <span class="keywordflow">return</span> cpl_image_get_stdev(image->data);</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span> }</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span> <span class="preprocessor">    cpl_mask_delete(rejected); \</span></div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span> <span class="preprocessor">    cpl_image_delete(im); \</span></div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01599"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10"> 1599</a></span> <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10" title="Get robust empirical stdev of data.">fors_image_get_stdev_robust</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, </div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>                    <span class="keywordtype">double</span> cut,</div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>                    <span class="keywordtype">double</span> *dstdev)</div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span> {</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>     cpl_mask *rejected = NULL;</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>     cpl_image *im = NULL;</div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span> </div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cut > 0, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Illegal cut: %f"</span>, cut );</div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dstdev == NULL, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Unsupported"</span>);</div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span> </div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>     <span class="keywordtype">double</span> median = <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(image, NULL);</div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span> </div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>     im = cpl_image_duplicate(image->data);</div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>     cpl_image_subtract_scalar(im, median); </div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>     cpl_image_power(im, 2);</div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>     <span class="comment">/* Now squared residuals wrt median */</span></div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>     </div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>     rejected = cpl_mask_threshold_image_create(image->data,</div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>                                                median - cut,</div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>                                                median + cut);</div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>     cpl_mask_not(rejected);</div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>     cpl_image_reject_from_mask(im, rejected);</div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span> </div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>     <span class="keywordtype">double</span> robust_stdev = sqrt(cpl_image_get_mean(im));</div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span> </div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>     cleanup;</div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>     <span class="keywordflow">return</span> robust_stdev;</div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span> }</div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span> </div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l01642"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4"> 1642</a></span> <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dmean)</div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span> {</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>     <span class="keywordtype">double</span> avg;</div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span> </div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dmean == NULL, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Unsupported"</span>);</div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span> </div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>     avg = cpl_image_get_mean(image->variance);</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span> </div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>     <span class="comment">/* This should never happen, but avoid sqrt of negative value in any case */</span></div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( avg >= 0, <span class="keywordflow">return</span> -1, <span class="stringliteral">"Average variance is %f"</span>, avg);</div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>     </div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>     <span class="keywordflow">return</span> sqrt(avg);</div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span> }</div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span> </div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span> </div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span> <span class="preprocessor">    cpl_imagelist_delete(datlist); \</span></div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span> <span class="preprocessor">    cpl_imagelist_delete(varlist); \</span></div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l01674"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga5510f4f5ebec4c99de3d9567b4eca21d"> 1674</a></span> <a class="code" href="group__fors__image.html#ga5510f4f5ebec4c99de3d9567b4eca21d" title="Average collapse.">fors_image_collapse_create</a>(<span class="keyword">const</span> fors_image_list *images)</div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span> {</div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>     cpl_imagelist *datlist = NULL;</div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>     cpl_imagelist *varlist = NULL;</div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>     cpl_image *data = NULL;</div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>     cpl_image *variance = NULL;</div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *i;</div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>     <span class="keywordtype">int</span> N = 0;</div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>     </div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( images != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( fors_image_list_size(images) > 0, <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>             <span class="stringliteral">"Cannot stack zero images"</span>);</div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span> </div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>     i = fors_image_list_first_const(images);</div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span> </div>
+<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span>     datlist = cpl_imagelist_new();</div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>     varlist = cpl_imagelist_new();</div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span> </div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>     <span class="keywordflow">while</span>(i != NULL) {</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span> </div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>         <span class="comment">/* Append current image to image lists */</span></div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>         cpl_imagelist_set(datlist, </div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>                           cpl_image_duplicate(i->data), </div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>                           cpl_imagelist_get_size(datlist));</div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>         cpl_imagelist_set(varlist,</div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>                           cpl_image_duplicate(i->variance),</div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>                           cpl_imagelist_get_size(varlist));</div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>         i = fors_image_list_next_const(images);</div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>         N++;</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>     }</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span> </div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span> <span class="preprocessor">#ifdef CPL_IS_NOT_CRAP</span></div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span> <span class="preprocessor"></span>    data    = cpl_imagelist_collapse_create(datlist);</div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span> </div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>     variance = cpl_imagelist_collapse_create(varlist);</div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span> <span class="preprocessor"></span>    data    = <a class="code" href="group__fors__utils.html#gabb34a534e28308533f300ea11ec7a3a3" title="Workaround for cpl_imagelist_collapse_create.">fors_imagelist_collapse_create</a>(datlist);</div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span> </div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>     variance = <a class="code" href="group__fors__utils.html#gabb34a534e28308533f300ea11ec7a3a3" title="Workaround for cpl_imagelist_collapse_create.">fors_imagelist_collapse_create</a>(varlist);</div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>     cpl_image_divide_scalar(variance, N);</div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span> </div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>     cleanup;</div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span> }</div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span> </div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span> </div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span> <span class="preprocessor">    cpl_imagelist_delete(datlist); \</span></div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span> <span class="preprocessor">    cpl_imagelist_delete(varlist); \</span></div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l01740"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga41938f63e18b05073716d2afed9bd4a3"> 1740</a></span> <a class="code" href="group__fors__image.html#ga41938f63e18b05073716d2afed9bd4a3" title="Minmax collapse.">fors_image_collapse_minmax_create</a>(<span class="keyword">const</span> fors_image_list *images, </div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>                                   <span class="keywordtype">int</span> low, <span class="keywordtype">int</span> high)</div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span> {</div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>     cpl_imagelist *datlist = NULL;</div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>     cpl_imagelist *varlist = NULL;</div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>     cpl_image *data = NULL;</div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>     cpl_image *variance = NULL;</div>
+<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *i;</div>
+<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>     <span class="keywordtype">int</span> N = 0;</div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>     </div>
+<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( images != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( fors_image_list_size(images) >  low + high, <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>             <span class="stringliteral">"Cannot reject more images than there are"</span>);</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( low*high >= 0 && low+high > 0, <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>             <span class="stringliteral">"Invalid minmax rejection criteria"</span>);</div>
+<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span> </div>
+<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>     i = fors_image_list_first_const(images);</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span> </div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>     datlist = cpl_imagelist_new();</div>
+<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>     varlist = cpl_imagelist_new();</div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span> </div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>     <span class="keywordflow">while</span>(i != NULL) {</div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span> </div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>         <span class="comment">/* Append current image to image lists */</span></div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>         cpl_imagelist_set(datlist, </div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>                           cpl_image_duplicate(i->data), </div>
+<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>                           cpl_imagelist_get_size(datlist));</div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>         cpl_imagelist_set(varlist,</div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>                           cpl_image_duplicate(i->variance),</div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>                           cpl_imagelist_get_size(varlist));</div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>         i = fors_image_list_next_const(images);</div>
+<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>         N++;</div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>     }</div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span> </div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>     data     = cpl_imagelist_collapse_minmax_create(datlist, low, high);</div>
+<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>     variance = cpl_imagelist_collapse_minmax_create(varlist, low, high);</div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span> </div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>     cpl_image_divide_scalar(variance, N);</div>
+<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span> </div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>     cleanup;</div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span> }</div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span> </div>
+<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l01796"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga3789562f96e6c162f90d51388d372a88"> 1796</a></span> <a class="code" href="group__fors__image.html#ga3789562f96e6c162f90d51388d372a88" title="Ksigma collapse.">fors_image_collapse_ksigma_create</a>(<span class="keyword">const</span> fors_image_list *images, </div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>                                   <span class="keywordtype">int</span> low, <span class="keywordtype">int</span> high, <span class="keywordtype">int</span> iter)</div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span> {</div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>     cpl_imagelist *datlist = NULL;</div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>     cpl_imagelist *varlist = NULL;</div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>     cpl_image *data = NULL;</div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>     cpl_image *variance = NULL;</div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>     cpl_image *ngood = NULL;</div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *i;</div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>     </div>
+<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( images != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span> </div>
+<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>     i = fors_image_list_first_const(images);</div>
+<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span> </div>
+<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>     datlist = cpl_imagelist_new();</div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>     varlist = cpl_imagelist_new();</div>
+<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>     </div>
+<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>     <span class="keywordflow">while</span>(i != NULL) {</div>
+<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span> </div>
+<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>         <span class="comment">/* Append current image to image lists */</span></div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>         cpl_imagelist_set(datlist,</div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>                           cpl_image_duplicate(i->data),</div>
+<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>                           cpl_imagelist_get_size(datlist));</div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>         cpl_imagelist_set(varlist,</div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>                           cpl_image_duplicate(i->variance),</div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>                           cpl_imagelist_get_size(varlist));</div>
+<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>         i = fors_image_list_next_const(images);</div>
+<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>     }</div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span> </div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>     data     = <a class="code" href="group__moses.html#ga663cfcd4584b6a3e63e7593cba926688" title="Stack images using k-sigma clipping.">mos_ksigma_stack</a>(datlist, low, high, iter, &ngood);</div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>     variance = cpl_imagelist_collapse_create(varlist);</div>
+<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span> </div>
+<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>     cpl_image_divide(variance, ngood);</div>
+<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span> </div>
+<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>     cpl_image_delete(ngood);</div>
+<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>     cleanup;</div>
+<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span> </div>
+<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span> }</div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span> </div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l01848"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga0d7aab18ef2992f7efba3ab24f7af503"> 1848</a></span> <a class="code" href="group__fors__image.html#ga0d7aab18ef2992f7efba3ab24f7af503" title="Median collapse.">fors_image_collapse_median_create</a>(<span class="keyword">const</span> fors_image_list *images)</div>
+<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span> {</div>
+<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>     cpl_imagelist *datlist = NULL;</div>
+<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>     cpl_imagelist *varlist = NULL;</div>
+<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>     cpl_image *data = NULL;</div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>     cpl_image *variance = NULL;</div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *i;</div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>     <span class="keywordtype">int</span> N = 0;</div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span> </div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( images != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( fors_image_list_size(images) > 0, <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>             <span class="stringliteral">"Cannot stack zero images"</span>);</div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span> </div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>     i = fors_image_list_first_const(images);</div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>     </div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>     datlist = cpl_imagelist_new();</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>     varlist = cpl_imagelist_new();</div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>     <span class="keywordflow">while</span>(i != NULL) {</div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>         <span class="comment">/* Append to image lists */</span></div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>         cpl_imagelist_set(datlist, </div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>                           cpl_image_duplicate(i->data), </div>
+<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>                           cpl_imagelist_get_size(datlist));</div>
+<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>         cpl_imagelist_set(varlist,</div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>                           cpl_image_duplicate(i->variance),</div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>                           cpl_imagelist_get_size(varlist));</div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span> </div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>         i = fors_image_list_next_const(images);</div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>         N++;</div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>     }</div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>     </div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span> <span class="preprocessor">#ifdef CPL_IS_NOT_CRAP</span></div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span> <span class="preprocessor"></span>    data    = cpl_imagelist_collapse_median_create(datlist);</div>
+<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span> </div>
+<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>     variance = cpl_imagelist_collapse_create(varlist);</div>
+<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span> <span class="preprocessor"></span>    data    = <a class="code" href="group__fors__utils.html#gaa55c5fd8ade8f10e441297c0cda96093" title="Workaround for cpl_imagelist_collapse_median_create.">fors_imagelist_collapse_median_create</a>(datlist);</div>
+<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span> </div>
+<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>     variance = <a class="code" href="group__fors__utils.html#gabb34a534e28308533f300ea11ec7a3a3" title="Workaround for cpl_imagelist_collapse_create.">fors_imagelist_collapse_create</a>(varlist);</div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>     cpl_image_divide_scalar(variance, N);</div>
+<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span> </div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>     cpl_image_multiply_scalar(variance, </div>
+<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>                   <a class="code" href="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3" title="median stacking correction factor">fors_utils_median_corr</a>(N) * </div>
+<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>                   <a class="code" href="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3" title="median stacking correction factor">fors_utils_median_corr</a>(N));</div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>     </div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>     cleanup;</div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span> }</div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span> </div>
+<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01917"></a><span class="lineno"><a class="code" href="group__fors__image.html#ga84a11915fdc3ac7ae1c9535d9eadfeeb"> 1917</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ga84a11915fdc3ac7ae1c9535d9eadfeeb" title="Draw on image.">fors_image_draw</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">int</span> type,</div>
+<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>              <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y,</div>
+<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>              <span class="keywordtype">int</span> radius, <span class="keywordtype">double</span> color)</div>
+<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span> {</div>
+<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( image != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span> </div>
+<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( type == 0 || type == 1 || type == 2,</div>
+<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>             <span class="keywordflow">return</span> , <span class="stringliteral">"Unsupported type %d"</span>, type);</div>
+<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span> </div>
+<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( radius > 0, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span> </div>
+<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>     <span class="keywordflow">if</span> (type == 2) {</div>
+<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>         <span class="keywordflow">for</span> (i = 0; i < 360; i++) {</div>
+<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>             <span class="comment">/* Step size of 1 degree is arbitrary */</span></div>
+<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span> </div>
+<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>             <span class="keywordtype">int</span> px = x + radius*cos(i/(2*M_PI));</div>
+<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>             <span class="keywordtype">int</span> py = y + radius*sin(i/(2*M_PI));</div>
+<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>             </div>
+<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>             <span class="keywordflow">if</span> (1 <= px && px <= cpl_image_get_size_x(image->data) &&</div>
+<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>                 1 <= py && py <= cpl_image_get_size_y(image->data)) {</div>
+<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>                 cpl_image_set(image->data, px, py, color);</div>
+<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>                 cpl_image_set(image->variance, px, py, color > 0 ? color : 0);</div>
+<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>             }</div>
+<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>         }</div>
+<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>     }</div>
+<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span> </div>
+<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>         <span class="keywordflow">for</span> (i = -radius; i <= radius; i++) {</div>
+<div class="line"><a name="l01947"></a><span class="lineno"> 1947</span> </div>
+<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>             <span class="keywordtype">int</span> px, py;</div>
+<div class="line"><a name="l01949"></a><span class="lineno"> 1949</span>             </div>
+<div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>             <span class="keywordflow">if</span> (type == 0) {</div>
+<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>                 px = x + i;</div>
+<div class="line"><a name="l01952"></a><span class="lineno"> 1952</span>                 py = y;</div>
+<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>             }</div>
+<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span>                 px = x;</div>
+<div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>                 py = y + i;</div>
+<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>             }</div>
+<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>             </div>
+<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>             <span class="keywordflow">if</span> (1 <= px && px <= cpl_image_get_size_x(image->data) &&</div>
+<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>                 1 <= py && py <= cpl_image_get_size_y(image->data)) {</div>
+<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>                 cpl_image_set(image->data    , px, py, color);</div>
+<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span>                 cpl_image_set(image->variance, px, py, color > 0 ? color : 0);</div>
+<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>             }</div>
+<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>         }</div>
+<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>     }</div>
+<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span> </div>
+<div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span> }</div>
+<div class="line"><a name="l01969"></a><span class="lineno"> 1969</span> </div>
+<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span> <span class="preprocessor">#define LIST_DEFINE</span></div>
+<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span> <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_image</span></div>
+<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__image_8h-source.html b/html/fors__image_8h-source.html
deleted file mode 100644
index 4d3b6e0..0000000
--- a/html/fors__image_8h-source.html
+++ /dev/null
@@ -1,171 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_image.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_image.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_image.h,v 1.30 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.30 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_IMAGE_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_IMAGE_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_setting.h></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__image.html">_fors_image</a> fors_image;
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> cpl_type <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>;
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="comment">/* Container */</span>
-<a name="l00039"></a>00039 <span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_image</span>
-<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="comment">/* Constructors */</span>
-<a name="l00044"></a>00044 fors_image *<a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(cpl_image *<a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>, cpl_image *weights);
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 fors_image *<a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(<span class="keyword">const</span> fors_image *image);
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="comment">/* Desctructors */</span>
-<a name="l00049"></a>00049 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(fors_image **image);
-<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">fors_image_delete_const</a>(<span class="keyword">const</span> fors_image **image);
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="comment">/* I/O */</span>
-<a name="l00054"></a>00054 fors_image *<a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(<span class="keyword">const</span> cpl_frame *frame, <span class="keyword">const</span> fors_image *bias,
-<a name="l00055"></a>00055                 <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00056"></a>00056                 <span class="keywordtype">double</span> *saturated);
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 fors_image_list *<a class="code" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list</a>(<span class="keyword">const</span> cpl_frameset *frames, 
-<a name="l00060"></a>00060                       <span class="keyword">const</span> fors_image *bias,
-<a name="l00061"></a>00061                       <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00062"></a>00062                       <span class="keywordtype">double</span> *saturated);
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 <span class="keyword">const</span> fors_image_list *
-<a name="l00065"></a>00065 <a class="code" href="group__fors__image.html#gab0a6629f36c4db609f1a1515d602477">fors_image_load_list_const</a>(<span class="keyword">const</span> cpl_frameset *frames, <span class="keyword">const</span> fors_image *bias,
-<a name="l00066"></a>00066                            <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00067"></a>00067                            <span class="keywordtype">double</span> *saturated);
-<a name="l00068"></a>00068 
-<a name="l00069"></a>00069 <span class="keywordtype">void</span>
-<a name="l00070"></a>00070 <a class="code" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save</a>(<span class="keyword">const</span> fors_image *image, <span class="keyword">const</span> cpl_propertylist *header,
-<a name="l00071"></a>00071         <span class="keyword">const</span> <span class="keywordtype">char</span> *filename);
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073 <span class="keywordtype">void</span>
-<a name="l00074"></a>00074 <a class="code" href="group__fors__image.html#g1ddf7d1b81954a8d2113e4f5174301a8">fors_image_save_sex</a>(<span class="keyword">const</span> fors_image *image, <span class="keyword">const</span> cpl_propertylist *header,
-<a name="l00075"></a>00075                     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_dat,
-<a name="l00076"></a>00076                     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_var,
-<a name="l00077"></a>00077                     <span class="keywordtype">int</span> radius);
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079 <span class="comment">/* Other */</span>
-<a name="l00080"></a>00080 <span class="keywordtype">int</span> <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(<span class="keyword">const</span> fors_image *image);
-<a name="l00081"></a>00081 <span class="keywordtype">int</span> <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(<span class="keyword">const</span> fors_image *image);
-<a name="l00082"></a>00082 <span class="keyword">const</span> <span class="keywordtype">float</span> *<a class="code" href="group__fors__image.html#gdffe6405bb64c769dfcdf71c6a281dad">fors_image_get_data_const</a>(<span class="keyword">const</span> fors_image *image);
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g5b5539c0e15fe20c16bedc58e8263724">fors_image_draw</a>(fors_image *image, <span class="keywordtype">int</span> type,
-<a name="l00085"></a>00085              <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y,
-<a name="l00086"></a>00086              <span class="keywordtype">int</span> radius, <span class="keywordtype">double</span> color);
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a>(fors_image *image,
-<a name="l00089"></a>00089              <span class="keywordtype">int</span> xlo, <span class="keywordtype">int</span> ylo,
-<a name="l00090"></a>00090              <span class="keywordtype">int</span> xhi, <span class="keywordtype">int</span> yhi);
-<a name="l00091"></a>00091 
-<a name="l00092"></a>00092 <span class="comment">/* Arithmetic */</span>
-<a name="l00093"></a>00093 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">fors_image_subtract</a>(fors_image *left, <span class="keyword">const</span> fors_image *right);
-<a name="l00094"></a>00094 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g15f95ab361e6c2ea44bafbada5d8d4a1">fors_image_multiply</a>(fors_image *left, <span class="keyword">const</span> fors_image *right);
-<a name="l00095"></a>00095 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g0769427c961bdf0fd79eda47fcadeee2">fors_image_multiply_noerr</a>(fors_image *left, <span class="keyword">const</span> cpl_image *right);
-<a name="l00096"></a>00096 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4">fors_image_divide</a>(fors_image *left, <span class="keyword">const</span> fors_image *right);
-<a name="l00097"></a>00097 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g4c8774a9e651df6d05689d208fb349e1">fors_image_divide_noerr</a>(fors_image *left, cpl_image *right);
-<a name="l00098"></a>00098 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g5ac7cb865a07bab1987284dba3676ceb">fors_image_abs</a>(fors_image *image);
-<a name="l00099"></a>00099 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g18f269421a43f46c063b667fac72c938">fors_image_square</a>(fors_image *image);
-<a name="l00100"></a>00100 
-<a name="l00101"></a>00101 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g78afca4bf8e5c3dc80d0dcd7f682f9e9">fors_image_exponential</a>(fors_image *image, <span class="keywordtype">double</span> b, <span class="keywordtype">double</span> db);
-<a name="l00102"></a>00102 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g077f7a5a847fa9c0e458dca2e12e4e6f">fors_image_multiply_scalar</a>(fors_image *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span> ds);
-<a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff">fors_image_divide_scalar</a>(fors_image *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span> ds);
-<a name="l00104"></a>00104 <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#g50a06b605ca558553e0642209b93c100">fors_image_subtract_scalar</a>(fors_image *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span> ds);
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106 fors_image *<a class="code" href="group__fors__image.html#g4154f529cbabe4cb4d1203d03e771f8a">fors_image_collapse_create</a>(<span class="keyword">const</span> fors_image_list *images);
-<a name="l00107"></a>00107 fors_image *<a class="code" href="group__fors__image.html#gbd2b7e8761473ff4ca42f90fa879e1ad">fors_image_collapse_median_create</a>(<span class="keyword">const</span> fors_image_list *images);
-<a name="l00108"></a>00108 fors_image *<a class="code" href="group__fors__image.html#gfe360dbc95e94b6b1043401aef8cbacc">fors_image_collapse_minmax_create</a>(<span class="keyword">const</span> fors_image_list *images, 
-<a name="l00109"></a>00109                                               <span class="keywordtype">int</span> low, <span class="keywordtype">int</span> high);
-<a name="l00110"></a>00110 fors_image *<a class="code" href="group__fors__image.html#g9f084a5b4f1564f1efb645e342eee2af">fors_image_collapse_ksigma_create</a>(<span class="keyword">const</span> fors_image_list *images, 
-<a name="l00111"></a>00111                                               <span class="keywordtype">int</span> low, <span class="keywordtype">int</span> high, <span class="keywordtype">int</span> iter);
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113 cpl_image *
-<a name="l00114"></a>00114 <a class="code" href="group__fors__image.html#g96498be3e15cde80921709406c33b6f3">fors_image_filter_median_create</a>(<span class="keyword">const</span> fors_image *image, 
-<a name="l00115"></a>00115                                 <span class="keywordtype">int</span> xradius,
-<a name="l00116"></a>00116                                 <span class="keywordtype">int</span> yradius,
-<a name="l00117"></a>00117                                 <span class="keywordtype">int</span> xstart, 
-<a name="l00118"></a>00118                                 <span class="keywordtype">int</span> ystart,
-<a name="l00119"></a>00119                                 <span class="keywordtype">int</span> xend,
-<a name="l00120"></a>00120                                 <span class="keywordtype">int</span> yend,
-<a name="l00121"></a>00121                                 <span class="keywordtype">int</span> xstep,
-<a name="l00122"></a>00122                                 <span class="keywordtype">int</span> ystep,
-<a name="l00123"></a>00123                                 <span class="keywordtype">bool</span> use_data);
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125 cpl_image *
-<a name="l00126"></a>00126 <a class="code" href="group__fors__image.html#g0a3e3ddaf982b76fc92d9daf7e32059a">fors_image_flat_fit_create</a>(fors_image *image,
-<a name="l00127"></a>00127                            <span class="keywordtype">int</span> step,
-<a name="l00128"></a>00128                            <span class="keywordtype">int</span> degree,
-<a name="l00129"></a>00129                            <span class="keywordtype">float</span> level);
-<a name="l00130"></a>00130 cpl_image *
-<a name="l00131"></a>00131 <a class="code" href="group__fors__image.html#g315f5476160ed7db282a7623f0d354b0">fors_image_filter_max_create</a>(<span class="keyword">const</span> fors_image *image,
-<a name="l00132"></a>00132                              <span class="keywordtype">int</span> xradius,
-<a name="l00133"></a>00133                              <span class="keywordtype">int</span> yradius,
-<a name="l00134"></a>00134                              <span class="keywordtype">bool</span> use_data);
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136 <span class="comment">/* Statistics */</span>
-<a name="l00137"></a>00137 <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(<span class="keyword">const</span> fors_image *image, <span class="keywordtype">double</span> *dmean);
-<a name="l00138"></a>00138 <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(<span class="keyword">const</span> fors_image *image, <span class="keywordtype">double</span> *dmedian);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140 <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">fors_image_get_stdev</a>(<span class="keyword">const</span> fors_image *image, <span class="keywordtype">double</span> *dstdev);
-<a name="l00141"></a>00141 <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b">fors_image_get_stdev_robust</a>(<span class="keyword">const</span> fors_image *image, 
-<a name="l00142"></a>00142                    <span class="keywordtype">double</span> cut,
-<a name="l00143"></a>00143                    <span class="keywordtype">double</span> *dstdev);
-<a name="l00144"></a>00144 <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(<span class="keyword">const</span> fors_image *image, <span class="keywordtype">double</span> *dmean);
-<a name="l00145"></a>00145 
-<a name="l00146"></a>00146 <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#gc4edb9a966bcf97a17ad6a5c1b9d020f">fors_image_get_min</a>(<span class="keyword">const</span> fors_image *image);
-<a name="l00147"></a>00147 <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#g5c7d9b043db23a40e632ffc34c3f3d5c">fors_image_get_max</a>(<span class="keyword">const</span> fors_image *image);
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__image_8h_source.html b/html/fors__image_8h_source.html
new file mode 100644
index 0000000..800308d
--- /dev/null
+++ b/html/fors__image_8h_source.html
@@ -0,0 +1,214 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_image.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_image.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_image.h,v 1.31 2013-07-24 12:59:35 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-07-24 12:59:35 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.31 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_IMAGE_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_IMAGE_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_setting.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__image.html">_fors_image</a> <a class="code" href="struct__fors__image.html">fors_image</a>;</div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> cpl_type <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="comment">/* Container */</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_image</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="comment">/* Constructors */</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <a class="code" href="struct__fors__image.html">fors_image</a> *<a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(cpl_image *data, cpl_image *weights);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <a class="code" href="struct__fors__image.html">fors_image</a> *<a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="comment">/* Desctructors */</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(<a class="code" href="struct__fors__image.html">fors_image</a> **image);</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ga67d54e90304b185e9f211aba5a620c4f" title="Deallocate image and set pointer to NULL.">fors_image_delete_const</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> **image);</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="comment">/* I/O */</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <a class="code" href="struct__fors__image.html">fors_image</a> *<a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(<span class="keyword">const</span> cpl_frame *frame, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *bias,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>                 <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>                 <span class="keywordtype">double</span> *saturated);</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> fors_image_list *<a class="code" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list</a>(<span class="keyword">const</span> cpl_frameset *frames, </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>                       <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *bias,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>                       <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>                       <span class="keywordtype">double</span> *saturated);</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keyword">const</span> fors_image_list *</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <a class="code" href="group__fors__image.html#ga0895dc7573734afe519fa4dff3ea33bd" title="Load imagelist.">fors_image_load_list_const</a>(<span class="keyword">const</span> cpl_frameset *frames, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *bias,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                            <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                            <span class="keywordtype">double</span> *saturated);</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <a class="code" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keyword">const</span> cpl_propertylist *header,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *filename);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <a class="code" href="group__fors__image.html#ga38eebeb331a65efbffbc6dc04304a786" title="Save image in format useable by SExtractor.">fors_image_save_sex</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keyword">const</span> cpl_propertylist *header,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_dat,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename_var,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                     <span class="keywordtype">int</span> radius);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="comment">/* Other */</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image);</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="keyword">const</span> <span class="keywordtype">float</span> *<a class="code" href="group__fors__image.html#ga547b9bf5f615a083bffdcfa9097d0520" title="Get pointer to data buffer.">fors_image_get_data_const</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> </div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ga84a11915fdc3ac7ae1c9535d9eadfeeb" title="Draw on image.">fors_image_draw</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">int</span> type,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>              <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>              <span class="keywordtype">int</span> radius, <span class="keywordtype">double</span> color);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053" title="Crop image.">fors_image_crop</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>              <span class="keywordtype">int</span> xlo, <span class="keywordtype">int</span> ylo,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>              <span class="keywordtype">int</span> xhi, <span class="keywordtype">int</span> yhi);</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="comment">/* Arithmetic */</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be" title="Subtract images.">fors_image_subtract</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *right);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gaaa54b1e6e0e3cf5fcf442267896f6dad" title="Multiply images.">fors_image_multiply</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *right);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ga25c0e2f6005831b9f5fcf3d81accfc43" title="Multiply images.">fors_image_multiply_noerr</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> cpl_image *right);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2" title="Divide images.">fors_image_divide</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *right);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ga88aca44b1a0bde06bbd43c487ae58766" title="Divide images.">fors_image_divide_noerr</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *left, cpl_image *right);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#ga14651bbe94e495df34aa59b335439b8f" title="Absolute value.">fors_image_abs</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gad4ecbb0eb96611d66dc9a3a1bc2ae0d8" title="Squared.">fors_image_square</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gabe2039c17c13fed0e430d71cb38454bf" title="Exponential.">fors_image_exponential</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> b, <span class="keywordtype">double</span> db);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gadd751e2623f778d5bb2b8f3b628077c2" title="Multiply by scalar.">fors_image_multiply_scalar</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span> ds);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35" title="Divide by scalar.">fors_image_divide_scalar</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span> ds);</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__image.html#gacbfb7c0518043b1079bb72af95d80961" title="Subtract scalar.">fors_image_subtract_scalar</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> s, <span class="keywordtype">double</span> ds);</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <a class="code" href="struct__fors__image.html">fors_image</a> *<a class="code" href="group__fors__image.html#ga5510f4f5ebec4c99de3d9567b4eca21d" title="Average collapse.">fors_image_collapse_create</a>(<span class="keyword">const</span> fors_image_list *images);</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <a class="code" href="struct__fors__image.html">fors_image</a> *<a class="code" href="group__fors__image.html#ga0d7aab18ef2992f7efba3ab24f7af503" title="Median collapse.">fors_image_collapse_median_create</a>(<span class="keyword">const</span> fors_image_list *images);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <a class="code" href="struct__fors__image.html">fors_image</a> *<a class="code" href="group__fors__image.html#ga41938f63e18b05073716d2afed9bd4a3" title="Minmax collapse.">fors_image_collapse_minmax_create</a>(<span class="keyword">const</span> fors_image_list *images, </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                                               <span class="keywordtype">int</span> low, <span class="keywordtype">int</span> high);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <a class="code" href="struct__fors__image.html">fors_image</a> *<a class="code" href="group__fors__image.html#ga3789562f96e6c162f90d51388d372a88" title="Ksigma collapse.">fors_image_collapse_ksigma_create</a>(<span class="keyword">const</span> fors_image_list *images, </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                                               <span class="keywordtype">int</span> low, <span class="keywordtype">int</span> high, <span class="keywordtype">int</span> iter);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> cpl_image *</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <a class="code" href="group__fors__image.html#ga395b18920e75b55d9a793dfbcb99755f" title="Smooth image.">fors_image_filter_median_create</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                                 <span class="keywordtype">int</span> xradius,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                                 <span class="keywordtype">int</span> yradius,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                                 <span class="keywordtype">int</span> xstart, </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                                 <span class="keywordtype">int</span> ystart,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                                 <span class="keywordtype">int</span> xend,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                                 <span class="keywordtype">int</span> yend,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                                 <span class="keywordtype">int</span> xstep,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                                 <span class="keywordtype">int</span> ystep,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                                 <span class="keywordtype">bool</span> use_data);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> cpl_image *</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> fors_image_flat_fit_create(<a class="code" href="struct__fors__image.html">fors_image</a> *image,</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                            <span class="keywordtype">int</span> step,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                            <span class="keywordtype">int</span> degree,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                            <span class="keywordtype">float</span> level);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> cpl_image *</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <a class="code" href="group__fors__image.html#ga21965427a98e2e07cf0b167e4610da1c" title="Max filter image.">fors_image_filter_max_create</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image,</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>                              <span class="keywordtype">int</span> xradius,</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                              <span class="keywordtype">int</span> yradius,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                              <span class="keywordtype">bool</span> use_data);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="comment">/* Statistics */</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dmean);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dmedian);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e" title="Get empirical stdev of data.">fors_image_get_stdev</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dstdev);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10" title="Get robust empirical stdev of data.">fors_image_get_stdev_robust</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                    <span class="keywordtype">double</span> cut,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                    <span class="keywordtype">double</span> *dstdev);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image, <span class="keywordtype">double</span> *dmean);</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#ga918a9107b07852d77bd457ea44d9b28e" title="Get min data value.">fors_image_get_min</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__image.html#ga8bde38b5f976d70ab7d6cef4652e1a51" title="Get max data value.">fors_image_get_max</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *image);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__science-test_8c-source.html b/html/fors__img__science-test_8c-source.html
deleted file mode 100644
index 52ac527..0000000
--- a/html/fors__img__science-test_8c-source.html
+++ /dev/null
@@ -1,146 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_science-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_img_science-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_science-test.c,v 1.6 2011/07/19 15:50:16 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/07/19 15:50:16 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.6 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_img_science_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <test.h></span>
-<a name="l00038"></a>00038 
-<a name="l00046"></a>00046 <span class="preprocessor">#undef cleanup</span>
-<a name="l00047"></a><a class="code" href="group__fors__img__science__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00047</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00048"></a>00048 <span class="preprocessor">do { \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">    cpl_frameset_delete(frames); \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">} while(0)</span>
-<a name="l00052"></a>00052 <span class="preprocessor"></span>
-<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00057"></a><a class="code" href="group__fors__img__science__test.html#gb1191beef5be429ab3bbb284e3fc6606">00057</a> <a class="code" href="group__fors__img__science__test.html#gb1191beef5be429ab3bbb284e3fc6606">test_img_science</a>(<span class="keywordtype">void</span>)
-<a name="l00058"></a>00058 {
-<a name="l00059"></a>00059     <span class="comment">/* Input */</span>
-<a name="l00060"></a>00060     cpl_frameset      *frames     = cpl_frameset_new();
-<a name="l00061"></a>00061     cpl_parameterlist *parameters = cpl_parameterlist_new();
-<a name="l00062"></a>00062     cpl_parameter     *p          = NULL;
-<a name="l00063"></a>00063     <span class="keywordtype">double</span> exptime = 1.0;
-<a name="l00064"></a>00064     <span class="comment">/* Products */</span>
-<a name="l00065"></a>00065     
-<a name="l00066"></a>00066     <span class="comment">/* Simulate data */</span>
-<a name="l00067"></a>00067     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b">create_standard</a>(<span class="stringliteral">"img_science_standard_img.fits"</span>,
-<a name="l00068"></a>00068                                                 SCIENCE_IMG,
-<a name="l00069"></a>00069                                                 CPL_FRAME_GROUP_RAW));
-<a name="l00070"></a>00070     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">create_bias</a>(<span class="stringliteral">"img_science_master_bias.fits"</span>,
-<a name="l00071"></a>00071                                             MASTER_BIAS,
-<a name="l00072"></a>00072                                             CPL_FRAME_GROUP_CALIB));
-<a name="l00073"></a>00073     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669">create_sky_flat</a>(<span class="stringliteral">"img_science_master_sky_flat.fits"</span>,
-<a name="l00074"></a>00074                                                 MASTER_SKY_FLAT_IMG,
-<a name="l00075"></a>00075                                                 CPL_FRAME_GROUP_CALIB, exptime));
-<a name="l00076"></a>00076     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410">create_std_cat</a>(<span class="stringliteral">"img_science_std_cat.fits"</span>,
-<a name="l00077"></a>00077                                                FLX_STD_IMG,
-<a name="l00078"></a>00078                                                CPL_FRAME_GROUP_CALIB));
-<a name="l00079"></a>00079     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5">create_phot_table</a>(<span class="stringliteral">"img_science_phot_table.fits"</span>,
-<a name="l00080"></a>00080                                                   PHOT_TABLE,
-<a name="l00081"></a>00081                                                   CPL_FRAME_GROUP_CALIB));
-<a name="l00082"></a>00082     
-<a name="l00083"></a>00083     <span class="comment">/* Set parameters */</span>
-<a name="l00084"></a>00084     <a class="code" href="group__fors__img__science.html#g9391a3b278d25edc38af3cb70db34597">fors_img_science_define_parameters</a>(parameters);
-<a name="l00085"></a>00085     p = cpl_parameter_new_enum(<span class="stringliteral">"fors.fors_img_science.extract_method"</span>,
-<a name="l00086"></a>00086                                CPL_TYPE_STRING,
-<a name="l00087"></a>00087                                <span class="stringliteral">"Source extraction method"</span>,
-<a name="l00088"></a>00088                                <span class="stringliteral">"fors.fors_img_science"</span>,
-<a name="l00089"></a>00089                                <span class="stringliteral">"sex"</span>, 2,
-<a name="l00090"></a>00090                                <span class="stringliteral">"sex"</span>, <span class="stringliteral">"test"</span>);
-<a name="l00091"></a>00091     cpl_parameterlist_append(parameters, p);
-<a name="l00092"></a>00092     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00093"></a>00093             <span class="stringliteral">"Create parameters failed"</span>);
-<a name="l00094"></a>00094     
-<a name="l00095"></a>00095     <a class="code" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">fors_parameterlist_set_defaults</a>(parameters);
-<a name="l00096"></a>00096  
-<a name="l00097"></a>00097     <span class="comment">/* Do not rely on SExtractor for this unit test */</span>
-<a name="l00098"></a>00098     cpl_parameter_set_string(cpl_parameterlist_find(parameters,
-<a name="l00099"></a>00099                                                     <span class="stringliteral">"fors.fors_img_science.extract_method"</span>),
-<a name="l00100"></a>00100                              <span class="stringliteral">"test"</span>);
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102     <a class="code" href="group__fors__img__science.html#gc6a3f5a41cacfa91711e127f612fa064">fors_img_science</a>(frames, parameters);
-<a name="l00103"></a>00103 
-<a name="l00104"></a>00104     <span class="comment">/* Test existence of QC + products */</span>
-<a name="l00105"></a>00105     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[] = {SOURCES_SCI, 
-<a name="l00106"></a>00106                                         SCIENCE_REDUCED_IMG, 
-<a name="l00107"></a>00107                                         PHOTOMETRY_TABLE,
-<a name="l00108"></a>00108                                         PHOT_BACKGROUND_SCI_IMG};
-<a name="l00109"></a>00109     <span class="keyword">const</span> <span class="keywordtype">char</span> *main_product = SCIENCE_REDUCED_IMG;
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[] = 
-<a name="l00112"></a>00112         {<span class="stringliteral">"QC SKYAVG"</span>, <span class="stringliteral">"QC SKYMED"</span>, <span class="stringliteral">"QC SKYRMS"</span>,
-<a name="l00113"></a>00113          <span class="stringliteral">"QC IMGQU"</span>, <span class="stringliteral">"QC IMGQUERR"</span>, <span class="stringliteral">"QC STELLAVG"</span>, 
-<a name="l00114"></a>00114          <span class="stringliteral">"QC IMGQUELL"</span>, <span class="stringliteral">"QC IMGQUELLERR"</span>};
-<a name="l00115"></a>00115     <a class="code" href="group__test.html#ge4730f9510e545e738aef9c8b7459b8b">test_recipe_output</a>(frames, 
-<a name="l00116"></a>00116                        product_tags, <span class="keyword">sizeof</span> product_tags / <span class="keyword">sizeof</span> *product_tags,
-<a name="l00117"></a>00117                main_product,
-<a name="l00118"></a>00118                        qc, <span class="keyword">sizeof</span> qc / <span class="keyword">sizeof</span> *qc);
-<a name="l00119"></a>00119         
-<a name="l00120"></a>00120     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00121"></a>00121     <span class="keywordflow">return</span>;
-<a name="l00122"></a>00122 }
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124 
-<a name="l00128"></a><a class="code" href="group__fors__img__science__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00128</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00129"></a>00129 {
-<a name="l00130"></a>00130     TEST_INIT;
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span>
-<a name="l00133"></a>00133     <a class="code" href="group__fors__img__science__test.html#gb1191beef5be429ab3bbb284e3fc6606">test_img_science</a>();
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     TEST_END;
-<a name="l00136"></a>00136 }
-<a name="l00137"></a>00137 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__science-test_8c_source.html b/html/fors__img__science-test_8c_source.html
new file mode 100644
index 0000000..6f19293
--- /dev/null
+++ b/html/fors__img__science-test_8c_source.html
@@ -0,0 +1,185 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_science-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_science-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_science-test.c,v 1.6 2011-07-19 15:50:16 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-07-19 15:50:16 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.6 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_img_science_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">    cpl_frameset_delete(frames); \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="group__fors__img__science__test.html#ga64116c898e3e40a355dad7fec89f65a8">   57</a></span> <a class="code" href="group__fors__img__science__test.html#ga64116c898e3e40a355dad7fec89f65a8" title="Test science recipe.">test_img_science</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> {</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     <span class="comment">/* Input */</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     cpl_frameset      *frames     = cpl_frameset_new();</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     cpl_parameterlist *parameters = cpl_parameterlist_new();</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>     cpl_parameter     *p          = NULL;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     <span class="keywordtype">double</span> exptime = 1.0;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     <span class="comment">/* Products */</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     <span class="comment">/* Simulate data */</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164" title="Create standard star image.">create_standard</a>(<span class="stringliteral">"img_science_standard_img.fits"</span>,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                                 SCIENCE_IMG,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                                 CPL_FRAME_GROUP_RAW));</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e" title="Simulate bias image.">create_bias</a>(<span class="stringliteral">"img_science_master_bias.fits"</span>,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                                             MASTER_BIAS,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                                             CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103" title="Simulate sky flat image.">create_sky_flat</a>(<span class="stringliteral">"img_science_master_sky_flat.fits"</span>,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                                                 MASTER_SKY_FLAT_IMG,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                                                 CPL_FRAME_GROUP_CALIB, exptime));</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3" title="Create standard star catalogue.">create_std_cat</a>(<span class="stringliteral">"img_science_std_cat.fits"</span>,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                                                FLX_STD_IMG,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                                CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b" title="Create photometry table.">create_phot_table</a>(<span class="stringliteral">"img_science_phot_table.fits"</span>,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                                                   PHOT_TABLE,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                                                   CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     <span class="comment">/* Set parameters */</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <a class="code" href="group__fors__img__science.html#ga2a18bf8b29e61bb854f3290fba50bdfd" title="Define recipe parameters.">fors_img_science_define_parameters</a>(parameters);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     p = cpl_parameter_new_enum(<span class="stringliteral">"fors.fors_img_science.extract_method"</span>,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                                CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                                <span class="stringliteral">"Source extraction method"</span>,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                                <span class="stringliteral">"fors.fors_img_science"</span>,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                                <span class="stringliteral">"sex"</span>, 2,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                                <span class="stringliteral">"sex"</span>, <span class="stringliteral">"test"</span>);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>             <span class="stringliteral">"Create parameters failed"</span>);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <a class="code" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42" title="Set unset parameters to default value.">fors_parameterlist_set_defaults</a>(parameters);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>  </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <span class="comment">/* Do not rely on SExtractor for this unit test */</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     cpl_parameter_set_string(cpl_parameterlist_find(parameters,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>                                                     <span class="stringliteral">"fors.fors_img_science.extract_method"</span>),</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                              <span class="stringliteral">"test"</span>);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <a class="code" href="group__fors__img__science.html#ga6f762068474a2723fd2c17f01b4a82c1" title="Do the processing.">fors_img_science</a>(frames, parameters);</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="comment">/* Test existence of QC + products */</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[] = {SOURCES_SCI, </div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                                         SCIENCE_REDUCED_IMG, </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                                         PHOTOMETRY_TABLE,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                                         PHOT_BACKGROUND_SCI_IMG};</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *main_product = SCIENCE_REDUCED_IMG;</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[] = </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>         {<span class="stringliteral">"QC SKYAVG"</span>, <span class="stringliteral">"QC SKYMED"</span>, <span class="stringliteral">"QC SKYRMS"</span>,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>          <span class="stringliteral">"QC IMGQU"</span>, <span class="stringliteral">"QC IMGQUERR"</span>, <span class="stringliteral">"QC STELLAVG"</span>, </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>          <span class="stringliteral">"QC IMGQUELL"</span>, <span class="stringliteral">"QC IMGQUELLERR"</span>};</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <a class="code" href="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c" title="Test existence of recipe products.">test_recipe_output</a>(frames, </div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                        product_tags, <span class="keyword">sizeof</span> product_tags / <span class="keyword">sizeof</span> *product_tags,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                main_product,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                        qc, <span class="keyword">sizeof</span> qc / <span class="keyword">sizeof</span> *qc);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     cleanup;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> }</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="group__fors__img__science__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  128</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> {</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     TEST_INIT;</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <a class="code" href="group__fors__img__science__test.html#ga64116c898e3e40a355dad7fec89f65a8" title="Test science recipe.">test_img_science</a>();</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     TEST_END;</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> }</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__science_8c-source.html b/html/fors__img__science_8c-source.html
deleted file mode 100644
index df6bc51..0000000
--- a/html/fors__img__science_8c-source.html
+++ /dev/null
@@ -1,198 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_science.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_img_science.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_science.c,v 1.8 2011/10/12 15:00:14 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/12 15:00:14 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_img_science_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#g8f20063c6ace32082add0a55898badd5">fors_img_science_create</a>(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#g346ce5737ecd8c688f1f9cd39eda56db">fors_img_science_exec</a>(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#g034dd2408c1d19371c8f0da3f2ac0ea1">fors_img_science_destroy</a>(cpl_plugin *);
-<a name="l00041"></a>00041 
-<a name="l00062"></a><a class="code" href="group__fors__img__science.html#g4abb403976fc3ddcaa614c59a44590c9">00062</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00065"></a>00065     cpl_plugin *plugin = &recipe->interface;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>())
-<a name="l00068"></a>00068     {
-<a name="l00069"></a>00069         cpl_msg_error(cpl_func, 
-<a name="l00070"></a>00070               <span class="stringliteral">"I am fors_img_science version %d, but I am linking "</span>
-<a name="l00071"></a>00071               <span class="stringliteral">"against the FORS library version %d. "</span>
-<a name="l00072"></a>00072               <span class="stringliteral">"This will not work. "</span>
-<a name="l00073"></a>00073               <span class="stringliteral">"Please remove all previous installations "</span>
-<a name="l00074"></a>00074               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,
-<a name="l00075"></a>00075               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>());
-<a name="l00076"></a>00076         <span class="keywordflow">return</span> 1;
-<a name="l00077"></a>00077     }
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079     cpl_plugin_init(plugin,
-<a name="l00080"></a>00080                     CPL_PLUGIN_API,
-<a name="l00081"></a>00081                     FORS_BINARY_VERSION,
-<a name="l00082"></a>00082                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00083"></a>00083                     <a class="code" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">fors_img_science_name</a>,
-<a name="l00084"></a>00084                     <a class="code" href="group__fors__img__science.html#gb97915136a3a942113a96d464f9eae30">fors_img_science_description_short</a>,
-<a name="l00085"></a>00085                     <a class="code" href="group__fors__img__science.html#g74ec08d9ca0bb98b7d31fc7609531e90">fors_img_science_description</a>,
-<a name="l00086"></a>00086                     <a class="code" href="group__fors__img__science.html#g969cdeff825fab5a2f064ae5e7335ded">fors_img_science_author</a>,
-<a name="l00087"></a>00087                     <a class="code" href="group__fors__img__science.html#g0b4a7b1ca4765372ccfd735dd1dc8d7b">fors_img_science_email</a>,
-<a name="l00088"></a>00088                     <a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a>(),
-<a name="l00089"></a>00089                     <a class="code" href="group__fors__img__science.html#g8f20063c6ace32082add0a55898badd5">fors_img_science_create</a>,
-<a name="l00090"></a>00090                     <a class="code" href="group__fors__img__science.html#g346ce5737ecd8c688f1f9cd39eda56db">fors_img_science_exec</a>,
-<a name="l00091"></a>00091                     <a class="code" href="group__fors__img__science.html#g034dd2408c1d19371c8f0da3f2ac0ea1">fors_img_science_destroy</a>);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     cpl_pluginlist_append(list, plugin);
-<a name="l00094"></a>00094     
-<a name="l00095"></a>00095     <span class="keywordflow">return</span> 0;
-<a name="l00096"></a>00096 }
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 
-<a name="l00109"></a><a class="code" href="group__fors__img__science.html#g8f20063c6ace32082add0a55898badd5">00109</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#g8f20063c6ace32082add0a55898badd5">fors_img_science_create</a>(cpl_plugin *plugin)
-<a name="l00110"></a>00110 {
-<a name="l00111"></a>00111     cpl_recipe    *recipe;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00114"></a>00114         cpl_msg_error(cpl_func, 
-<a name="l00115"></a>00115                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00116"></a>00116                       <span class="stringliteral">"refusing to create recipe fors_img_science"</span>, 
-<a name="l00117"></a>00117                       cpl_error_get_message());
-<a name="l00118"></a>00118         <span class="keywordflow">return</span> 1;
-<a name="l00119"></a>00119     }
-<a name="l00120"></a>00120     
-<a name="l00121"></a>00121     <span class="comment">/* </span>
-<a name="l00122"></a>00122 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00123"></a>00123 <span class="comment">     */</span>
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00126"></a>00126         recipe = (cpl_recipe *)plugin;
-<a name="l00127"></a>00127     }
-<a name="l00128"></a>00128     <span class="keywordflow">else</span> {
-<a name="l00129"></a>00129         <span class="keywordflow">return</span> 1;
-<a name="l00130"></a>00130     }
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* </span>
-<a name="l00133"></a>00133 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00134"></a>00134 <span class="comment">     */</span>
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00137"></a>00137     
-<a name="l00138"></a>00138     <a class="code" href="group__fors__img__science.html#g9391a3b278d25edc38af3cb70db34597">fors_img_science_define_parameters</a>(recipe->parameters);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00141"></a>00141         cpl_msg_error(cpl_func, 
-<a name="l00142"></a>00142                       <span class="stringliteral">"Could not create fors_img_science parameters"</span>);
-<a name="l00143"></a>00143         <span class="keywordflow">return</span> 1;
-<a name="l00144"></a>00144     }
-<a name="l00145"></a>00145         
-<a name="l00146"></a>00146     <span class="keywordflow">return</span> 0;
-<a name="l00147"></a>00147 }
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 
-<a name="l00158"></a><a class="code" href="group__fors__img__science.html#g346ce5737ecd8c688f1f9cd39eda56db">00158</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#g346ce5737ecd8c688f1f9cd39eda56db">fors_img_science_exec</a>(cpl_plugin *plugin)
-<a name="l00159"></a>00159 {
-<a name="l00160"></a>00160     cpl_recipe *recipe;
-<a name="l00161"></a>00161     cpl_errorstate initial_errorstate = cpl_errorstate_get();
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00164"></a>00164         cpl_msg_error(cpl_func, 
-<a name="l00165"></a>00165                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00166"></a>00166                       <span class="stringliteral">"refusing to execute recipe fors_img_science"</span>, 
-<a name="l00167"></a>00167                       cpl_error_get_message());
-<a name="l00168"></a>00168         <span class="keywordflow">return</span> 1;
-<a name="l00169"></a>00169     }
-<a name="l00170"></a>00170     
-<a name="l00171"></a>00171     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00172"></a>00172         recipe = (cpl_recipe *)plugin;
-<a name="l00173"></a>00173     }
-<a name="l00174"></a>00174     <span class="keywordflow">else</span> {
-<a name="l00175"></a>00175         <span class="keywordflow">return</span> 1;
-<a name="l00176"></a>00176     }
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="keywordflow">if</span> (recipe->frames == NULL) {
-<a name="l00179"></a>00179         cpl_msg_error(cpl_func, 
-<a name="l00180"></a>00180                       <span class="stringliteral">"Null frameset"</span>);
-<a name="l00181"></a>00181         <span class="keywordflow">return</span> 1;
-<a name="l00182"></a>00182     }
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">if</span> (recipe->parameters == NULL) {
-<a name="l00185"></a>00185         cpl_msg_error(cpl_func, 
-<a name="l00186"></a>00186                       <span class="stringliteral">"Null parameter list"</span>);
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> 1;
-<a name="l00188"></a>00188     }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a>(recipe->frames,
-<a name="l00191"></a>00191                <a class="code" href="group__fors__img__science.html#gb97915136a3a942113a96d464f9eae30">fors_img_science_description_short</a>);
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <a class="code" href="group__fors__img__science.html#gc6a3f5a41cacfa91711e127f612fa064">fors_img_science</a>(recipe->frames, recipe->parameters);
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a>(recipe->frames, initial_errorstate);
-<a name="l00196"></a>00196 }
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 
-<a name="l00207"></a><a class="code" href="group__fors__img__science.html#g034dd2408c1d19371c8f0da3f2ac0ea1">00207</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#g034dd2408c1d19371c8f0da3f2ac0ea1">fors_img_science_destroy</a>(cpl_plugin *plugin)
-<a name="l00208"></a>00208 {
-<a name="l00209"></a>00209     cpl_recipe *recipe;
-<a name="l00210"></a>00210     
-<a name="l00211"></a>00211     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00212"></a>00212         recipe = (cpl_recipe *)plugin;
-<a name="l00213"></a>00213     }
-<a name="l00214"></a>00214     <span class="keywordflow">else</span> {
-<a name="l00215"></a>00215         <span class="keywordflow">return</span> -1;
-<a name="l00216"></a>00216     }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     <span class="keywordflow">return</span> 0;
-<a name="l00221"></a>00221 }
-<a name="l00222"></a>00222 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__science_8c_source.html b/html/fors__img__science_8c_source.html
new file mode 100644
index 0000000..f98e730
--- /dev/null
+++ b/html/fors__img__science_8c_source.html
@@ -0,0 +1,237 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_science.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_science.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_science.c,v 1.8 2011-10-12 15:00:14 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-12 15:00:14 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_img_science_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#ga966196c928f588d03aa1a17a486781aa" title="Setup the recipe options.">fors_img_science_create</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#ga375da6eaae762d1ee8a202bb62514ad2" title="Execute the plugin instance given by the interface.">fors_img_science_exec</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#gad9737c625ab9465c8a504a25e67d8a03" title="Destroy what has been created by the 'create' function.">fors_img_science_destroy</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__img__science.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">   62</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>())</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     {</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>               <span class="stringliteral">"I am fors_img_science version %d, but I am linking "</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>               <span class="stringliteral">"against the FORS library version %d. "</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>               <span class="stringliteral">"This will not work. "</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>               <span class="stringliteral">"Please remove all previous installations "</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>());</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     }</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                     fors_img_science_name,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                     fors_img_science_description_short,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     fors_img_science_description,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                     fors_img_science_author,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                     fors_img_science_email,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     <a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87" title="Get the pipeline copyright and license.">fors_get_license</a>(),</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     <a class="code" href="group__fors__img__science.html#ga966196c928f588d03aa1a17a486781aa" title="Setup the recipe options.">fors_img_science_create</a>,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     <a class="code" href="group__fors__img__science.html#ga375da6eaae762d1ee8a202bb62514ad2" title="Execute the plugin instance given by the interface.">fors_img_science_exec</a>,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <a class="code" href="group__fors__img__science.html#gad9737c625ab9465c8a504a25e67d8a03" title="Destroy what has been created by the 'create' function.">fors_img_science_destroy</a>);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> }</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="group__fors__img__science.html#ga966196c928f588d03aa1a17a486781aa">  109</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#ga966196c928f588d03aa1a17a486781aa" title="Setup the recipe options.">fors_img_science_create</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                       <span class="stringliteral">"refusing to create recipe fors_img_science"</span>, </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     }</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     }</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <a class="code" href="group__fors__img__science.html#ga2a18bf8b29e61bb854f3290fba50bdfd" title="Define recipe parameters.">fors_img_science_define_parameters</a>(recipe->parameters);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                       <span class="stringliteral">"Could not create fors_img_science parameters"</span>);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     }</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> }</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="group__fors__img__science.html#ga375da6eaae762d1ee8a202bb62514ad2">  158</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#ga375da6eaae762d1ee8a202bb62514ad2" title="Execute the plugin instance given by the interface.">fors_img_science_exec</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> {</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_errorstate initial_errorstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                       <span class="stringliteral">"refusing to execute recipe fors_img_science"</span>, </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">if</span> (recipe->frames == NULL) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                       <span class="stringliteral">"Null frameset"</span>);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     }</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL) {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                       <span class="stringliteral">"Null parameter list"</span>);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce" title="Start recipe execution.">fors_begin</a>(recipe->frames,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                fors_img_science_description_short);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <a class="code" href="group__fors__img__science.html#ga6f762068474a2723fd2c17f01b4a82c1" title="Do the processing.">fors_img_science</a>(recipe->frames, recipe->parameters);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9" title="End recipe execution.">fors_end</a>(recipe->frames, initial_errorstate);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> }</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno"><a class="code" href="group__fors__img__science.html#gad9737c625ab9465c8a504a25e67d8a03">  207</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__science.html#gad9737c625ab9465c8a504a25e67d8a03" title="Destroy what has been created by the 'create' function.">fors_img_science_destroy</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> {</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     }</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> }</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__science__impl_8c-source.html b/html/fors__img__science__impl_8c-source.html
deleted file mode 100644
index f3c660a..0000000
--- a/html/fors__img__science__impl_8c-source.html
+++ /dev/null
@@ -1,554 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_science_impl.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_img_science_impl.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_science_impl.c,v 1.49 2013/02/15 10:54:52 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/02/15 10:54:52 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.49 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_img_science_impl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_extract.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_tools.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_setting.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_data.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include <math.h></span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00046"></a>00046 
-<a name="l00053"></a><a class="code" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">00053</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">fors_img_science_name</a> = <span class="stringliteral">"fors_img_science"</span>;
-<a name="l00054"></a><a class="code" href="group__fors__img__science.html#gb97915136a3a942113a96d464f9eae30">00054</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__science.html#gb97915136a3a942113a96d464f9eae30">fors_img_science_description_short</a> = <span class="stringliteral">"Reduce scientific exposure"</span>;
-<a name="l00055"></a><a class="code" href="group__fors__img__science.html#g969cdeff825fab5a2f064ae5e7335ded">00055</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__science.html#g969cdeff825fab5a2f064ae5e7335ded">fors_img_science_author</a> = <span class="stringliteral">"Jonas M. Larsen"</span>;
-<a name="l00056"></a><a class="code" href="group__fors__img__science.html#g0b4a7b1ca4765372ccfd735dd1dc8d7b">00056</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__science.html#g0b4a7b1ca4765372ccfd735dd1dc8d7b">fors_img_science_email</a> = PACKAGE_BUGREPORT;
-<a name="l00057"></a><a class="code" href="group__fors__img__science.html#g74ec08d9ca0bb98b7d31fc7609531e90">00057</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__science.html#g74ec08d9ca0bb98b7d31fc7609531e90">fors_img_science_description</a> = 
-<a name="l00058"></a>00058 <span class="stringliteral">"Input files:\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"  SCIENCE_IMG                Raw         Science image               1\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flat field       1\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"Output files:\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"  SCIENCE_REDUCED_IMG        FITS image  Reduced science image\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"  PHOT_BACKGROUND_SCI_IMG    FITS image  Reduced science image background\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  SOURCES_SCI_IMG            FITS image  Unfiltered SExtractor output\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  OBJECT_TABLE_SCI_IMG       FITS table  Extracted sources properties\n"</span>;
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00073"></a>00073 <a class="code" href="group__fors__img__science.html#g2d7fe71bb7c47e2284dea7e2732650fb">get_image_quality</a>(<span class="keyword">const</span> fors_star_list *sources, <span class="keywordtype">double</span> *image_quality_err,
-<a name="l00074"></a>00074                   <span class="keywordtype">double</span> *stellarity,
-<a name="l00075"></a>00075                   <span class="keywordtype">double</span> *ellipticity,
-<a name="l00076"></a>00076                   <span class="keywordtype">double</span> *ellipticity_rms);
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078 <span class="preprocessor">#undef cleanup</span>
-<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">do { \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">    cpl_free((void *)full_name); \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">} while (0)</span>
-<a name="l00083"></a>00083 <span class="preprocessor"></span>
-<a name="l00089"></a><a class="code" href="group__fors__img__science.html#g9391a3b278d25edc38af3cb70db34597">00089</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__science.html#g9391a3b278d25edc38af3cb70db34597">fors_img_science_define_parameters</a>(cpl_parameterlist *parameters)
-<a name="l00090"></a>00090 {
-<a name="l00091"></a>00091     cpl_parameter *p;
-<a name="l00092"></a>00092     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">fors_img_science_name</a>);
-<a name="l00093"></a>00093     <span class="keyword">const</span> <span class="keywordtype">char</span> *full_name = NULL;
-<a name="l00094"></a>00094     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
-<a name="l00095"></a>00095 
-<a name="l00096"></a>00096     <span class="comment">/*  This parameter is not yet implemented</span>
-<a name="l00097"></a>00097 <span class="comment">    name = "cr_remove";</span>
-<a name="l00098"></a>00098 <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span>
-<a name="l00099"></a>00099 <span class="comment">    p = cpl_parameter_new_value(full_name,</span>
-<a name="l00100"></a>00100 <span class="comment">                                CPL_TYPE_BOOL,</span>
-<a name="l00101"></a>00101 <span class="comment">                                "Cosmic ray removal",</span>
-<a name="l00102"></a>00102 <span class="comment">                                context,</span>
-<a name="l00103"></a>00103 <span class="comment">                                false);</span>
-<a name="l00104"></a>00104 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span>
-<a name="l00105"></a>00105 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00106"></a>00106 <span class="comment">    cpl_parameterlist_append(parameters, p);</span>
-<a name="l00107"></a>00107 <span class="comment">    cpl_free((void *)full_name); full_name = NULL;</span>
-<a name="l00108"></a>00108 <span class="comment">    */</span>
-<a name="l00109"></a>00109 
-<a name="l00110"></a>00110     name = <span class="stringliteral">"magsyserr"</span>;
-<a name="l00111"></a>00111     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00112"></a>00112     p = cpl_parameter_new_value(full_name,
-<a name="l00113"></a>00113                                 CPL_TYPE_DOUBLE,
-<a name="l00114"></a>00114                                 <span class="stringliteral">"Systematic error in magnitude"</span>,
-<a name="l00115"></a>00115                                 context,
-<a name="l00116"></a>00116                                 0.01);
-<a name="l00117"></a>00117     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00118"></a>00118     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00119"></a>00119     cpl_parameterlist_append(parameters, p);
-<a name="l00120"></a>00120     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122     <a class="code" href="group__fors__extract.html#gd07fd085541e8be0723f2932a29abdb3">fors_extract_define_parameters</a>(parameters, context);
-<a name="l00123"></a>00123     
-<a name="l00124"></a>00124     cpl_free((<span class="keywordtype">void</span> *)context);
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126     <span class="keywordflow">return</span>;
-<a name="l00127"></a>00127 }
-<a name="l00128"></a>00128 
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130 <span class="preprocessor">#undef cleanup</span>
-<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00132"></a>00132 <span class="preprocessor">do { \</span>
-<a name="l00133"></a>00133 <span class="preprocessor">    cpl_frameset_delete(sci_frame); \</span>
-<a name="l00134"></a>00134 <span class="preprocessor">    cpl_frameset_delete(master_bias_frame); \</span>
-<a name="l00135"></a>00135 <span class="preprocessor">    cpl_frameset_delete(master_flat_frame); \</span>
-<a name="l00136"></a>00136 <span class="preprocessor">    fors_image_delete(&sci); \</span>
-<a name="l00137"></a>00137 <span class="preprocessor">    fors_image_delete_const(&master_bias); \</span>
-<a name="l00138"></a>00138 <span class="preprocessor">    fors_image_delete(&master_flat); \</span>
-<a name="l00139"></a>00139 <span class="preprocessor">    cpl_table_delete(phot); \</span>
-<a name="l00140"></a>00140 <span class="preprocessor">    cpl_table_delete(sources); \</span>
-<a name="l00141"></a>00141 <span class="preprocessor">    cpl_image_delete(background); \</span>
-<a name="l00142"></a>00142 <span class="preprocessor">    fors_extract_method_delete(&em); \</span>
-<a name="l00143"></a>00143 <span class="preprocessor">    fors_star_list_delete(&stars, fors_star_delete); \</span>
-<a name="l00144"></a>00144 <span class="preprocessor">    cpl_free((void *)context); \</span>
-<a name="l00145"></a>00145 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00146"></a>00146 <span class="preprocessor">    cpl_propertylist_delete(qc); \</span>
-<a name="l00147"></a>00147 <span class="preprocessor">    cpl_propertylist_delete(product_header); \</span>
-<a name="l00148"></a>00148 <span class="preprocessor">    cpl_propertylist_delete(header); \</span>
-<a name="l00149"></a>00149 <span class="preprocessor">} while (0)</span>
-<a name="l00150"></a>00150 <span class="preprocessor"></span>
-<a name="l00151"></a>00151 <span class="comment">/* %%% Removed from cleanup</span>
-<a name="l00152"></a>00152 <span class="comment">    cpl_frameset_delete(phot_table); \</span>
-<a name="l00153"></a>00153 <span class="comment">*/</span>
-<a name="l00154"></a>00154 
-<a name="l00161"></a><a class="code" href="group__fors__img__science.html#gc6a3f5a41cacfa91711e127f612fa064">00161</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__science.html#gc6a3f5a41cacfa91711e127f612fa064">fors_img_science</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)
-<a name="l00162"></a>00162 {
-<a name="l00163"></a>00163     <span class="comment">/* Raw */</span>
-<a name="l00164"></a>00164     cpl_frameset *sci_frame      = NULL;
-<a name="l00165"></a>00165     <a class="code" href="struct__fors__image.html">fors_image</a> *sci              = NULL;
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     <span class="comment">/* Calibration */</span>
-<a name="l00168"></a>00168     cpl_frameset *master_bias_frame = NULL;
-<a name="l00169"></a>00169     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias   = NULL; 
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171     cpl_frameset *master_flat_frame = NULL;
-<a name="l00172"></a>00172     <a class="code" href="struct__fors__image.html">fors_image</a> *master_flat         = NULL; 
-<a name="l00173"></a>00173 
-<a name="l00174"></a>00174 <span class="comment">/* %%%</span>
-<a name="l00175"></a>00175 <span class="comment">    cpl_frameset *phot_table        = NULL;</span>
-<a name="l00176"></a>00176 <span class="comment">    double ext_coeff, dext_coeff;</span>
-<a name="l00177"></a>00177 <span class="comment">*/</span>
-<a name="l00178"></a>00178 
-<a name="l00179"></a>00179     <span class="comment">/* Products */</span>
-<a name="l00180"></a>00180     cpl_propertylist *qc = cpl_propertylist_new();
-<a name="l00181"></a>00181     cpl_propertylist *product_header = cpl_propertylist_new();
-<a name="l00182"></a>00182     cpl_propertylist *header = NULL;
-<a name="l00183"></a>00183     cpl_table *phot = NULL;
-<a name="l00184"></a>00184     <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> sky_stats;
-<a name="l00185"></a>00185     cpl_image *background = NULL;
-<a name="l00186"></a>00186     cpl_table *sources = NULL;
-<a name="l00187"></a>00187 
-<a name="l00188"></a>00188     <span class="comment">/* Parameters */</span>
-<a name="l00189"></a>00189     extract_method  *em = NULL;
-<a name="l00190"></a>00190     <span class="keywordtype">double</span>           magsyserr;
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <span class="comment">/* Other */</span>
-<a name="l00193"></a>00193     <span class="keyword">const</span> <span class="keywordtype">char</span> *context   = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">fors_img_science_name</a>);
-<a name="l00194"></a>00194     fors_star_list *stars = NULL;
-<a name="l00195"></a>00195     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00196"></a>00196     <span class="keywordtype">double</span> avg_airmass = 0.0;
-<a name="l00197"></a>00197     <span class="keywordtype">char</span> *name;
-<a name="l00198"></a>00198 
-<a name="l00199"></a>00199     <span class="comment">/* Get parameters */</span>
-<a name="l00200"></a>00200     em = <a class="code" href="group__fors__extract.html#g1f3f1af725e7b5fb1c770507eab8ac09">fors_extract_method_new</a>(parameters, context);
-<a name="l00201"></a>00201     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00202"></a>00202             <span class="stringliteral">"Could not get extraction parameters"</span> );
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204     cpl_msg_indent_more();
-<a name="l00205"></a>00205     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"magsyserr"</span>);
-<a name="l00206"></a>00206     magsyserr = <a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a>(parameters,
-<a name="l00207"></a>00207                                                name);
-<a name="l00208"></a>00208     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00209"></a>00209     cpl_msg_indent_less();
-<a name="l00210"></a>00210     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00211"></a>00211     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( magsyserr >= 0, <span class="keywordflow">return</span>, 
-<a name="l00212"></a>00212             <span class="stringliteral">"Input systematic error (magsyserr=%f) cannot be negative"</span>,
-<a name="l00213"></a>00213             magsyserr);
-<a name="l00214"></a>00214     
-<a name="l00215"></a>00215     <span class="comment">/* Find raw */</span>
-<a name="l00216"></a>00216     sci_frame = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, SCIENCE_IMG);
-<a name="l00217"></a>00217     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(sci_frame) == 1, <span class="keywordflow">return</span>, 
-<a name="l00218"></a>00218             <span class="stringliteral">"Exactly 1 %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, 
-<a name="l00219"></a>00219             SCIENCE_IMG, cpl_frameset_get_size(sci_frame) );
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     <span class="comment">/* Find calibration */</span>
-<a name="l00222"></a>00222     master_bias_frame = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, MASTER_BIAS);
-<a name="l00223"></a>00223     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(master_bias_frame) == 1, <span class="keywordflow">return</span>, 
-<a name="l00224"></a>00224             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, 
-<a name="l00225"></a>00225             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame) );
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227     master_flat_frame = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, MASTER_SKY_FLAT_IMG);
-<a name="l00228"></a>00228     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(master_flat_frame) == 1, <span class="keywordflow">return</span>, 
-<a name="l00229"></a>00229             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, 
-<a name="l00230"></a>00230             MASTER_SKY_FLAT_IMG, cpl_frameset_get_size(master_flat_frame) );
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232 <span class="comment">/* %%%</span>
-<a name="l00233"></a>00233 <span class="comment">    phot_table = fors_frameset_extract(frames, PHOT_TABLE);</span>
-<a name="l00234"></a>00234 <span class="comment">    assure( cpl_frameset_get_size(phot_table) == 1, return, </span>
-<a name="l00235"></a>00235 <span class="comment">            "One %s required. %d found",</span>
-<a name="l00236"></a>00236 <span class="comment">            PHOT_TABLE, cpl_frameset_get_size(phot_table));</span>
-<a name="l00237"></a>00237 <span class="comment">*/</span>
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239     <span class="comment">/* Done finding frames */</span>
-<a name="l00240"></a>00240 
-<a name="l00241"></a>00241     <span class="comment">/* Get instrument setting */</span>
-<a name="l00242"></a>00242     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_get_first(sci_frame));
-<a name="l00243"></a>00243     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );
-<a name="l00244"></a>00244 
-<a name="l00245"></a>00245 
-<a name="l00246"></a>00246     master_bias = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(cpl_frameset_get_first(master_bias_frame), 
-<a name="l00247"></a>00247                                   NULL, setting, NULL);
-<a name="l00248"></a>00248     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00249"></a>00249             <span class="stringliteral">"Could not load master bias"</span>);
-<a name="l00250"></a>00250 
-<a name="l00251"></a>00251     <span class="comment">/* Load raw frames, subtract bias */</span>
-<a name="l00252"></a>00252     sci = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(cpl_frameset_get_first(sci_frame), master_bias, 
-<a name="l00253"></a>00253                           setting, NULL);
-<a name="l00254"></a>00254     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load standard image"</span>);
-<a name="l00255"></a>00255     <a class="code" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">fors_image_delete_const</a>(&master_bias);
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257     <span class="comment">/* Load master flat */</span>
-<a name="l00258"></a>00258     master_flat = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(cpl_frameset_get_first(master_flat_frame), 
-<a name="l00259"></a>00259                                   NULL, setting, NULL);
-<a name="l00260"></a>00260     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load master flat"</span>);
-<a name="l00261"></a>00261     
-<a name="l00262"></a>00262     <span class="comment">/* Divide by normalized flat */</span>
-<a name="l00263"></a>00263     <a class="code" href="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff">fors_image_divide_scalar</a>(master_flat,
-<a name="l00264"></a>00264                              <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(master_flat, NULL), -1.0);
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266     <a class="code" href="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4">fors_image_divide</a>(sci, master_flat);
-<a name="l00267"></a>00267     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not divide by master flat"</span>);
-<a name="l00268"></a>00268     <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_flat);
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     <span class="comment">/* Extract sources */</span>
-<a name="l00271"></a>00271     stars = <a class="code" href="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1">fors_extract</a>(sci, setting, em, magsyserr,
-<a name="l00272"></a>00272              &sky_stats, &background, &sources);
-<a name="l00273"></a>00273     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not extract objects"</span>);  
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275     <span class="comment">/* QC */</span>
-<a name="l00276"></a>00276     <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qc, <a class="code" href="group__forsqc.html#gf875be6d318687206fdb50a7c61b7924">fors_qc_dic_version</a>, setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00277"></a>00277     
-<a name="l00278"></a>00278     <a class="code" href="group__forsqc.html#g1ccea526719a1be6c14de81963d81955">fors_qc_write_group_heading</a>(cpl_frameset_get_first(sci_frame),
-<a name="l00279"></a>00279                                 PHOTOMETRY_TABLE,
-<a name="l00280"></a>00280                                 setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00281"></a>00281     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not write %s QC parameters"</span>, 
-<a name="l00282"></a>00282             PHOTOMETRY_TABLE);
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285     <span class="keywordtype">double</span> sky_mag;
-<a name="l00286"></a>00286     <span class="keywordtype">double</span> sky_mag_rms;
-<a name="l00287"></a>00287     <span class="keywordflow">if</span> (sky_stats.<a class="code" href="structfors__extract__sky__stats.html#b7ca852023d946aa752ef2d3f4f871b9">mean</a> > 0) {
-<a name="l00288"></a>00288         sky_mag = -2.5*log(sky_stats.<a class="code" href="structfors__extract__sky__stats.html#b7ca852023d946aa752ef2d3f4f871b9">mean</a> /
-<a name="l00289"></a>00289                            (setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>*setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>))/log(10);
-<a name="l00290"></a>00290     }
-<a name="l00291"></a>00291     <span class="keywordflow">else</span> {
-<a name="l00292"></a>00292         cpl_msg_warning(cpl_func, 
-<a name="l00293"></a>00293                         <span class="stringliteral">"Average sky background is negative (%f ADU), "</span>
-<a name="l00294"></a>00294                         <span class="stringliteral">"cannot compute magnitude, setting QC.SKYAVG to 99999."</span>,
-<a name="l00295"></a>00295                         sky_stats.<a class="code" href="structfors__extract__sky__stats.html#b7ca852023d946aa752ef2d3f4f871b9">mean</a>);
-<a name="l00296"></a>00296         sky_mag = 99999.;
-<a name="l00297"></a>00297     }
-<a name="l00298"></a>00298     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00299"></a>00299                             sky_mag,
-<a name="l00300"></a>00300                             <span class="stringliteral">"QC.SKYAVG"</span>,
-<a name="l00301"></a>00301                             <span class="stringliteral">"mag/arcsec^2"</span>,
-<a name="l00302"></a>00302                             <span class="stringliteral">"Mean of sky background"</span>,
-<a name="l00303"></a>00303                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00304"></a>00304     
-<a name="l00305"></a>00305     <span class="keywordflow">if</span> (sky_stats.<a class="code" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">median</a> > 0) {
-<a name="l00306"></a>00306         sky_mag = -2.5*log(sky_stats.<a class="code" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">median</a> /
-<a name="l00307"></a>00307                            (setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>*setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>))/log(10);
-<a name="l00308"></a>00308         <span class="comment">/* deltaM = -2.5*log10(e)*deltaF/F */</span>
-<a name="l00309"></a>00309         sky_mag_rms = fabs(-2.5 * (1.0/log(10))*sky_stats.<a class="code" href="structfors__extract__sky__stats.html#69ed6753cee271b73c8b7e73a016fdeb">rms</a>/sky_stats.<a class="code" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">median</a>);
-<a name="l00310"></a>00310     }
-<a name="l00311"></a>00311     <span class="keywordflow">else</span> {
-<a name="l00312"></a>00312         cpl_msg_warning(cpl_func, 
-<a name="l00313"></a>00313                         <span class="stringliteral">"Median sky background is negative (%f ADU), "</span>
-<a name="l00314"></a>00314                         <span class="stringliteral">"cannot compute magnitude: setting both QC.SKYMED "</span>
-<a name="l00315"></a>00315                         <span class="stringliteral">"and QC.SKYRMS to 99999."</span>,
-<a name="l00316"></a>00316                         sky_mag);
-<a name="l00317"></a>00317         sky_mag = 99999.;
-<a name="l00318"></a>00318         sky_mag_rms = 99999.;
-<a name="l00319"></a>00319     }
-<a name="l00320"></a>00320     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00321"></a>00321                             sky_mag,
-<a name="l00322"></a>00322                             <span class="stringliteral">"QC.SKYMED"</span>,
-<a name="l00323"></a>00323                             <span class="stringliteral">"mag/arcsec^2"</span>,
-<a name="l00324"></a>00324                             <span class="stringliteral">"Median of sky background"</span>,
-<a name="l00325"></a>00325                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00326"></a>00326 
-<a name="l00327"></a>00327     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00328"></a>00328                             sky_mag_rms,
-<a name="l00329"></a>00329                             <span class="stringliteral">"QC.SKYRMS"</span>,
-<a name="l00330"></a>00330                             <span class="stringliteral">"mag/arcsec^2"</span>,
-<a name="l00331"></a>00331                             <span class="stringliteral">"Standard deviation of sky background"</span>,
-<a name="l00332"></a>00332                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="keywordtype">double</span> image_quality_error;
-<a name="l00335"></a>00335     <span class="keywordtype">double</span> stellarity;
-<a name="l00336"></a>00336     <span class="keywordtype">double</span> ellipticity, ellipticity_rms;
-<a name="l00337"></a>00337     <span class="keywordtype">double</span> image_quality = <a class="code" href="group__fors__img__science.html#g2d7fe71bb7c47e2284dea7e2732650fb">get_image_quality</a>(stars, 
-<a name="l00338"></a>00338                                              &image_quality_error,
-<a name="l00339"></a>00339                                              &stellarity,
-<a name="l00340"></a>00340                                              &ellipticity,
-<a name="l00341"></a>00341                                              &ellipticity_rms);
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343     <span class="keywordflow">if</span> (image_quality > 0.) {
-<a name="l00344"></a>00344         image_quality *= TWOSQRT2LN2 * setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>;
-<a name="l00345"></a>00345         image_quality_error *= TWOSQRT2LN2 * setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>;
-<a name="l00346"></a>00346     }
-<a name="l00347"></a>00347 
-<a name="l00348"></a>00348     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00349"></a>00349                             image_quality,
-<a name="l00350"></a>00350                             <span class="stringliteral">"QC.IMGQU"</span>,
-<a name="l00351"></a>00351                             <span class="stringliteral">"arcsec"</span>,
-<a name="l00352"></a>00352                             <span class="stringliteral">"Image quality of scientific exposure"</span>,
-<a name="l00353"></a>00353                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00354"></a>00354 
-<a name="l00355"></a>00355     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00356"></a>00356                             image_quality_error,
-<a name="l00357"></a>00357                             <span class="stringliteral">"QC.IMGQUERR"</span>,
-<a name="l00358"></a>00358                             <span class="stringliteral">"arcsec"</span>,
-<a name="l00359"></a>00359                             <span class="stringliteral">"Uncertainty of image quality"</span>,
-<a name="l00360"></a>00360                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00361"></a>00361 
-<a name="l00362"></a>00362     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00363"></a>00363                             stellarity,
-<a name="l00364"></a>00364                             <span class="stringliteral">"QC.STELLAVG"</span>,
-<a name="l00365"></a>00365                             NULL,
-<a name="l00366"></a>00366                             <span class="stringliteral">"Mean stellarity index"</span>,
-<a name="l00367"></a>00367                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00370"></a>00370                             ellipticity,
-<a name="l00371"></a>00371                             <span class="stringliteral">"QC.IMGQUELL"</span>,
-<a name="l00372"></a>00372                             NULL,
-<a name="l00373"></a>00373                             <span class="stringliteral">"Mean star ellipticity"</span>,
-<a name="l00374"></a>00374                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00377"></a>00377                             ellipticity_rms,
-<a name="l00378"></a>00378                             <span class="stringliteral">"QC.IMGQUELLERR"</span>,
-<a name="l00379"></a>00379                             NULL,
-<a name="l00380"></a>00380                             <span class="stringliteral">"Standard deviation of star ellipticities"</span>,
-<a name="l00381"></a>00381                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383     <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385     <span class="comment">/* Save SCIENCE_REDUCED, PHOT_BACKGROUND_SCI_IMG */</span>
-<a name="l00386"></a>00386 
-<a name="l00387"></a>00387 <span class="comment">/* %%% */</span>
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389     header = cpl_propertylist_load(
-<a name="l00390"></a>00390                         cpl_frame_get_filename(
-<a name="l00391"></a>00391                            cpl_frameset_get_first(sci_frame)), 0);
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l00394"></a>00394         cpl_msg_error(cpl_func, <span class="stringliteral">"Failed to load raw header"</span>);
-<a name="l00395"></a>00395         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00396"></a>00396         <span class="keywordflow">return</span>;
-<a name="l00397"></a>00397     }
-<a name="l00398"></a>00398 
-<a name="l00399"></a>00399     avg_airmass = <a class="code" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">fors_get_airmass</a>(header);
-<a name="l00400"></a>00400 
-<a name="l00401"></a>00401     cpl_propertylist_update_double(qc, <span class="stringliteral">"AIRMASS"</span>, avg_airmass);
-<a name="l00402"></a>00402     cpl_propertylist_update_double(product_header, <span class="stringliteral">"AIRMASS"</span>, avg_airmass);
-<a name="l00403"></a>00403 
-<a name="l00404"></a>00404 <span class="comment">/* %%% */</span>
-<a name="l00405"></a>00405 
-<a name="l00406"></a>00406     <a class="code" href="group__forsdfs.html#geb1068e007bd0ebef0cd4a6aa12cf523">fors_dfs_add_wcs</a>(qc, cpl_frameset_get_first(sci_frame), setting);
-<a name="l00407"></a>00407     <a class="code" href="group__forsdfs.html#gea45a5b73ab086e5e08680928adbd0cd">fors_dfs_add_exptime</a>(qc, cpl_frameset_get_first(sci_frame), 0.);
-<a name="l00408"></a>00408     <a class="code" href="group__forsdfs.html#geb1068e007bd0ebef0cd4a6aa12cf523">fors_dfs_add_wcs</a>(product_header, cpl_frameset_get_first(sci_frame), 
-<a name="l00409"></a>00409                      setting);
-<a name="l00410"></a>00410     <a class="code" href="group__forsdfs.html#gea45a5b73ab086e5e08680928adbd0cd">fors_dfs_add_exptime</a>(product_header, cpl_frameset_get_first(sci_frame), 0.);
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412     <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, sci, SCIENCE_REDUCED_IMG,
-<a name="l00413"></a>00413                         qc, parameters, <a class="code" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">fors_img_science_name</a>, 
-<a name="l00414"></a>00414                         cpl_frameset_get_first(sci_frame));
-<a name="l00415"></a>00415     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00416"></a>00416             SCIENCE_REDUCED_IMG);
-<a name="l00417"></a>00417 
-<a name="l00418"></a>00418     <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&sci);
-<a name="l00419"></a>00419     
-<a name="l00420"></a>00420     <a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frames, background, PHOT_BACKGROUND_SCI_IMG,
-<a name="l00421"></a>00421                    product_header, parameters, <a class="code" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">fors_img_science_name</a>, 
-<a name="l00422"></a>00422                    setting-><a class="code" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">version</a>);
-<a name="l00423"></a>00423     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00424"></a>00424             PHOT_BACKGROUND_SCI_IMG);
-<a name="l00425"></a>00425 
-<a name="l00426"></a>00426     cpl_image_delete(background); background = NULL;
-<a name="l00427"></a>00427     
-<a name="l00428"></a>00428     <span class="comment">/* Load filter coefficients */</span>
-<a name="l00429"></a>00429 
-<a name="l00430"></a>00430 <span class="comment">/* %%%</span>
-<a name="l00431"></a>00431 <span class="comment">    fors_phot_table_load(cpl_frameset_get_first(phot_table), setting,</span>
-<a name="l00432"></a>00432 <span class="comment">                         NULL, NULL, </span>
-<a name="l00433"></a>00433 <span class="comment">             &ext_coeff, &dext_coeff,</span>
-<a name="l00434"></a>00434 <span class="comment">             NULL, NULL);</span>
-<a name="l00435"></a>00435 <span class="comment">    assure( !cpl_error_get_code(), return, "Could not load photometry table" );</span>
-<a name="l00436"></a>00436 <span class="comment">*/</span>
-<a name="l00437"></a>00437 
-<a name="l00438"></a>00438     <span class="comment">/* Correct for atmospheric extinction */</span>
-<a name="l00439"></a>00439 <span class="comment">/* %%%</span>
-<a name="l00440"></a>00440 <span class="comment">    fors_star_ext_corr(stars, setting, ext_coeff, dext_coeff,</span>
-<a name="l00441"></a>00441 <span class="comment">                       cpl_frameset_get_first(sci_frame));</span>
-<a name="l00442"></a>00442 <span class="comment">    assure( !cpl_error_get_code(), return, </span>
-<a name="l00443"></a>00443 <span class="comment">            "Extinction correction failed");</span>
-<a name="l00444"></a>00444 <span class="comment">*/</span>
-<a name="l00445"></a>00445 
-<a name="l00446"></a>00446     <span class="comment">/* Create, save FITS product */</span>
-<a name="l00447"></a>00447     phot = <a class="code" href="group__fors__tools.html#g8138511b64d1d365e21b56eb161f2028">fors_create_sources_table</a>(stars);
-<a name="l00448"></a>00448     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>,
-<a name="l00449"></a>00449             <span class="stringliteral">"Failed to create extracted sources table"</span>);
-<a name="l00450"></a>00450 
-<a name="l00451"></a>00451     <span class="comment">/*</span>
-<a name="l00452"></a>00452 <span class="comment">     * Eliminate unused columns from photometry table</span>
-<a name="l00453"></a>00453 <span class="comment">     */</span>
-<a name="l00454"></a>00454 
-<a name="l00455"></a>00455     cpl_table_erase_column(phot, <span class="stringliteral">"INSTR_CMAG"</span>);
-<a name="l00456"></a>00456     cpl_table_erase_column(phot, <span class="stringliteral">"DINSTR_CMAG"</span>);
-<a name="l00457"></a>00457     cpl_table_erase_column(phot, <span class="stringliteral">"OBJECT"</span>);
-<a name="l00458"></a>00458     cpl_table_erase_column(phot, <span class="stringliteral">"MAG"</span>);
-<a name="l00459"></a>00459     cpl_table_erase_column(phot, <span class="stringliteral">"DMAG"</span>);
-<a name="l00460"></a>00460     cpl_table_erase_column(phot, <span class="stringliteral">"CAT_MAG"</span>);
-<a name="l00461"></a>00461     cpl_table_erase_column(phot, <span class="stringliteral">"DCAT_MAG"</span>);
-<a name="l00462"></a>00462     cpl_table_erase_column(phot, <span class="stringliteral">"COLOR"</span>);
-<a name="l00463"></a>00463     <span class="comment">/* new columns since 4.4.10 */</span>
-<a name="l00464"></a>00464     <span class="keywordflow">if</span> (cpl_table_has_column(phot, <span class="stringliteral">"DCOLOR"</span>))
-<a name="l00465"></a>00465         cpl_table_erase_column(phot, <span class="stringliteral">"DCOLOR"</span>);
-<a name="l00466"></a>00466     <span class="keywordflow">if</span> (cpl_table_has_column(phot, <span class="stringliteral">"COV_CATM_COL"</span>))
-<a name="l00467"></a>00467         cpl_table_erase_column(phot, <span class="stringliteral">"COV_CATM_COL"</span>);
-<a name="l00468"></a>00468     cpl_table_erase_column(phot, <span class="stringliteral">"USE_CAT"</span>);
-<a name="l00469"></a>00469     cpl_table_erase_column(phot, <span class="stringliteral">"SHIFT_X"</span>);
-<a name="l00470"></a>00470     cpl_table_erase_column(phot, <span class="stringliteral">"SHIFT_Y"</span>);
-<a name="l00471"></a>00471     cpl_table_erase_column(phot, <span class="stringliteral">"ZEROPOINT"</span>);
-<a name="l00472"></a>00472     cpl_table_erase_column(phot, <span class="stringliteral">"DZEROPOINT"</span>);
-<a name="l00473"></a>00473     cpl_table_erase_column(phot, <span class="stringliteral">"WEIGHT"</span>);
-<a name="l00474"></a>00474 
-<a name="l00475"></a>00475     <a class="code" href="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42">fors_dfs_save_table</a>(frames, sources, SOURCES_SCI,
-<a name="l00476"></a>00476                         NULL, parameters, <a class="code" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">fors_img_science_name</a>, 
-<a name="l00477"></a>00477                         cpl_frameset_get_first(sci_frame));
-<a name="l00478"></a>00478     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00479"></a>00479             SOURCES_SCI);
-<a name="l00480"></a>00480 
-<a name="l00481"></a>00481     <a class="code" href="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42">fors_dfs_save_table</a>(frames, phot, PHOTOMETRY_TABLE,
-<a name="l00482"></a>00482                         NULL, parameters, <a class="code" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">fors_img_science_name</a>, 
-<a name="l00483"></a>00483                         cpl_frameset_get_first(sci_frame));
-<a name="l00484"></a>00484     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00485"></a>00485             PHOTOMETRY_TABLE);
-<a name="l00486"></a>00486 
-<a name="l00487"></a>00487     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00488"></a>00488     <span class="keywordflow">return</span>;
-<a name="l00489"></a>00489 }
-<a name="l00490"></a>00490 
-<a name="l00491"></a>00491 <span class="preprocessor">#undef cleanup</span>
-<a name="l00492"></a>00492 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00493"></a>00493 <span class="preprocessor"></span>
-<a name="l00499"></a>00499 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00500"></a><a class="code" href="group__fors__img__science.html#gded70f366457b7e7915dc906a4d50a45">00500</a> <a class="code" href="group__fors__img__science.html#gded70f366457b7e7915dc906a4d50a45">is_star</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *<a class="code" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a>)
-<a name="l00501"></a>00501 {
-<a name="l00502"></a>00502     data = data;
-<a name="l00503"></a>00503     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL, <span class="keywordflow">return</span> <span class="keyword">false</span>, NULL );
-<a name="l00504"></a>00504 
-<a name="l00505"></a>00505 <span class="comment">/*FIXME</span>
-<a name="l00506"></a>00506 <span class="comment">  All stars for the moment... */</span>
-<a name="l00507"></a>00507 
-<a name="l00508"></a>00508     <span class="keywordflow">return</span> s-><a class="code" href="struct__fors__star.html#cd353ab887426dc767a89db51164271a">stellarity_index</a> >= 0.7;
-<a name="l00509"></a>00509 }
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511 <span class="preprocessor">#undef cleanup</span>
-<a name="l00512"></a><a class="code" href="group__fors__img__science.html#g57cf6e6e2826eb178fd2d9c3e5695343">00512</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00513"></a>00513 <span class="preprocessor">do { \</span>
-<a name="l00514"></a>00514 <span class="preprocessor">    fors_star_list_delete(&stars, fors_star_delete); \</span>
-<a name="l00515"></a>00515 <span class="preprocessor">} while(0)</span>
-<a name="l00516"></a>00516 <span class="preprocessor"></span>
-<a name="l00529"></a>00529 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00530"></a><a class="code" href="group__fors__img__science.html#g2d7fe71bb7c47e2284dea7e2732650fb">00530</a> <a class="code" href="group__fors__img__science.html#g2d7fe71bb7c47e2284dea7e2732650fb">get_image_quality</a>(<span class="keyword">const</span> fors_star_list *sources, <span class="keywordtype">double</span> *image_quality_err,
-<a name="l00531"></a>00531                   <span class="keywordtype">double</span> *stellarity,
-<a name="l00532"></a>00532                   <span class="keywordtype">double</span> *ellipticity,
-<a name="l00533"></a>00533                   <span class="keywordtype">double</span> *ellipticity_rms)
-<a name="l00534"></a>00534 {
-<a name="l00535"></a>00535     fors_star_list *stars = fors_star_list_extract(sources,
-<a name="l00536"></a>00536                                                    <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>,
-<a name="l00537"></a>00537                                                    <a class="code" href="group__fors__img__science.html#gded70f366457b7e7915dc906a4d50a45">is_star</a>, NULL);
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539     <span class="keywordtype">double</span> fwhm;
-<a name="l00540"></a>00540     <span class="keywordflow">if</span> (fors_star_list_size(stars) >= 1) {
-<a name="l00541"></a>00541         *image_quality_err = fors_star_list_mad(stars, <a class="code" href="group__fors__star.html#g4f81e6410fe5c7aefbdbcae907095059">fors_star_extension</a>, NULL) 
-<a name="l00542"></a>00542             * <a class="code" href="group__fors__utils.html#gea88c3776498f5f3717413a50289af52">STDEV_PR_MAD</a>;
-<a name="l00543"></a>00543         
-<a name="l00544"></a>00544         fwhm = fors_star_list_median(stars, <a class="code" href="group__fors__star.html#g4f81e6410fe5c7aefbdbcae907095059">fors_star_extension</a> , NULL);
-<a name="l00545"></a>00545         
-<a name="l00546"></a>00546         *stellarity      = fors_star_list_mean(stars, <a class="code" href="group__fors__star.html#g310c2402602378a7505a36a85ee98c7b">fors_star_stellarity</a>, NULL);
-<a name="l00547"></a>00547         *ellipticity     = fors_star_list_mean(stars, <a class="code" href="group__fors__star.html#gdef23fa2c1ad1c4f2b0de18038b0daca">fors_star_ellipticity</a>, NULL);
-<a name="l00548"></a>00548         *ellipticity_rms = fors_star_list_mad(stars, <a class="code" href="group__fors__star.html#gdef23fa2c1ad1c4f2b0de18038b0daca">fors_star_ellipticity</a>, NULL)
-<a name="l00549"></a>00549             * <a class="code" href="group__fors__utils.html#gea88c3776498f5f3717413a50289af52">STDEV_PR_MAD</a>;
-<a name="l00550"></a>00550     }
-<a name="l00551"></a>00551     <span class="keywordflow">else</span> {
-<a name="l00552"></a>00552         cpl_msg_warning(cpl_func, <span class="stringliteral">"No stars found! Cannot compute image quality, "</span>
-<a name="l00553"></a>00553                         <span class="stringliteral">"setting QC parameters to -1"</span>);
-<a name="l00554"></a>00554 
-<a name="l00555"></a>00555         <span class="comment">/* -1 is not a valid value for any of these */</span>
-<a name="l00556"></a>00556         *image_quality_err = -1;
-<a name="l00557"></a>00557         fwhm = -1;
-<a name="l00558"></a>00558         *stellarity = -1;
-<a name="l00559"></a>00559         *ellipticity = -1;
-<a name="l00560"></a>00560         *ellipticity_rms = -1;
-<a name="l00561"></a>00561     }
-<a name="l00562"></a>00562 
-<a name="l00563"></a>00563     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00564"></a>00564     <span class="keywordflow">return</span> fwhm;
-<a name="l00565"></a>00565 }
-<a name="l00566"></a>00566 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__science__impl_8c_source.html b/html/fors__img__science__impl_8c_source.html
new file mode 100644
index 0000000..45aa18f
--- /dev/null
+++ b/html/fors__img__science__impl_8c_source.html
@@ -0,0 +1,593 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_science_impl.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_science_impl.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_science_impl.c,v 1.50 2013-09-10 19:16:03 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 19:16:03 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.50 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_img_science_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_extract.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_tools.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_setting.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_data.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_science_name = <span class="stringliteral">"fors_img_science"</span>;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_science_description_short = <span class="stringliteral">"Reduce scientific exposure"</span>;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_science_author = <span class="stringliteral">"Jonas M. Larsen"</span>;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_science_email = PACKAGE_BUGREPORT;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_science_description = </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"  SCIENCE_IMG                Raw         Science image               1\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flat field       1\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"  SCIENCE_REDUCED_IMG        FITS image  Reduced science image\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"  PHOT_BACKGROUND_SCI_IMG    FITS image  Reduced science image background\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  SOURCES_SCI_IMG            FITS image  Unfiltered SExtractor output\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  OBJECT_TABLE_SCI_IMG       FITS table  Extracted sources properties\n"</span>;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <a class="code" href="group__fors__img__science.html#ga11315f8dbe7bcd79d1f4e7ad691532fe" title="Compute image quality.">get_image_quality</a>(<span class="keyword">const</span> fors_star_list *sources, <span class="keywordtype">double</span> *image_quality_err,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                   <span class="keywordtype">double</span> *stellarity,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                   <span class="keywordtype">double</span> *ellipticity,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>                   <span class="keywordtype">double</span> *ellipticity_rms);</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">    cpl_free((void *)full_name); \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00089"></a><span class="lineno"><a class="code" href="group__fors__img__science.html#ga2a18bf8b29e61bb854f3290fba50bdfd">   89</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__science.html#ga2a18bf8b29e61bb854f3290fba50bdfd" title="Define recipe parameters.">fors_img_science_define_parameters</a>(cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> {</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_img_science_name);</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *full_name = NULL;</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="comment">/*  This parameter is not yet implemented</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="comment">    name = "cr_remove";</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="comment">    full_name = cpl_sprintf("%s.%s", context, name);</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="comment">    p = cpl_parameter_new_value(full_name,</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="comment">                                CPL_TYPE_BOOL,</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="comment">                                "Cosmic ray removal",</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="comment">                                context,</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="comment">                                false);</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="comment">    cpl_parameterlist_append(parameters, p);</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="comment">    cpl_free((void *)full_name); full_name = NULL;</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> </div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     name = <span class="stringliteral">"magsyserr"</span>;</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                                 <span class="stringliteral">"Systematic error in magnitude"</span>,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                                 context,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                                 0.01);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <a class="code" href="group__fors__extract.html#ga2fe71423afa3cceea5d92dd3b49aca1e" title="Define recipe parameters.">fors_extract_define_parameters</a>(parameters, context);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     cpl_free((<span class="keywordtype">void</span> *)context);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="preprocessor">    cpl_frameset_delete(sci_frame); \</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="preprocessor">    cpl_frameset_delete(master_bias_frame); \</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="preprocessor">    cpl_frameset_delete(master_flat_frame); \</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="preprocessor">    fors_image_delete(&sci); \</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="preprocessor">    fors_image_delete_const(&master_bias); \</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="preprocessor">    fors_image_delete(&master_flat); \</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="preprocessor">    cpl_table_delete(phot); \</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="preprocessor">    cpl_table_delete(sources); \</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="preprocessor">    cpl_image_delete(background); \</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="preprocessor">    fors_extract_method_delete(&em); \</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="preprocessor">    fors_star_list_delete(&stars, fors_star_delete); \</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="preprocessor">    cpl_free((void *)context); \</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="preprocessor">    cpl_propertylist_delete(qc); \</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor">    cpl_propertylist_delete(product_header); \</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="preprocessor">    cpl_propertylist_delete(header); \</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="comment">/* %%% Removed from cleanup</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="comment">    cpl_frameset_delete(phot_table); \</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno"><a class="code" href="group__fors__img__science.html#ga6f762068474a2723fd2c17f01b4a82c1">  161</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__science.html#ga6f762068474a2723fd2c17f01b4a82c1" title="Do the processing.">fors_img_science</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> {</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="comment">/* Raw */</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     cpl_frameset *sci_frame      = NULL;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *sci              = NULL;</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="comment">/* Calibration */</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     cpl_frameset *master_bias_frame = NULL;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias   = NULL; </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     cpl_frameset *master_flat_frame = NULL;</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_flat         = NULL; </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="comment">/* %%%</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="comment">    cpl_frameset *phot_table        = NULL;</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="comment">    double ext_coeff, dext_coeff;</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     <span class="comment">/* Products */</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     cpl_propertylist *qc = cpl_propertylist_new();</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     cpl_propertylist *product_header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     cpl_propertylist *header = NULL;</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     cpl_table *phot = NULL;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> sky_stats;</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     cpl_image *background = NULL;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_table *sources = NULL;</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="comment">/* Parameters */</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     extract_method  *em = NULL;</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="keywordtype">double</span>           magsyserr;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="comment">/* Other */</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context   = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_img_science_name);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     fors_star_list *stars = NULL;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     <span class="keywordtype">double</span> avg_airmass = 0.0;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <span class="comment">/* Get parameters */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     em = <a class="code" href="group__fors__extract.html#ga9b1d727905c3cb3f7740900ffaba6b57" title="Get extraction method from parameter list.">fors_extract_method_new</a>(parameters, context);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>             <span class="stringliteral">"Could not get extraction parameters"</span> );</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"magsyserr"</span>);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     magsyserr = <a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a>(parameters,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                                                name);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( magsyserr >= 0, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>             <span class="stringliteral">"Input systematic error (magsyserr=%f) cannot be negative"</span>,</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>             magsyserr);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <span class="comment">/* Find raw */</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     sci_frame = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, SCIENCE_IMG);</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(sci_frame) == 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>             <span class="stringliteral">"Exactly 1 %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>             SCIENCE_IMG, cpl_frameset_get_size(sci_frame) );</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     <span class="comment">/* Find calibration */</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     master_bias_frame = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, MASTER_BIAS);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(master_bias_frame) == 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, </div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame) );</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     master_flat_frame = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, MASTER_SKY_FLAT_IMG);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(master_flat_frame) == 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>             MASTER_SKY_FLAT_IMG, cpl_frameset_get_size(master_flat_frame) );</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> </div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="comment">/* %%%</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <span class="comment">    phot_table = fors_frameset_extract(frames, PHOT_TABLE);</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> <span class="comment">    assure( cpl_frameset_get_size(phot_table) == 1, return, </span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="comment">            "One %s required. %d found",</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> <span class="comment">            PHOT_TABLE, cpl_frameset_get_size(phot_table));</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="comment">/* Done finding frames */</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> </div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="comment">/* Get instrument setting */</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_get_first(sci_frame));</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     master_bias = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(cpl_frameset_get_first(master_bias_frame), </div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                                   NULL, setting, NULL);</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>             <span class="stringliteral">"Could not load master bias"</span>);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     <span class="comment">/* Load raw frames, subtract bias */</span></div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     sci = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(cpl_frameset_get_first(sci_frame), master_bias, </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>                           setting, NULL);</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load standard image"</span>);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <a class="code" href="group__fors__image.html#ga67d54e90304b185e9f211aba5a620c4f" title="Deallocate image and set pointer to NULL.">fors_image_delete_const</a>(&master_bias);</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="comment">/* Load master flat */</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     master_flat = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(cpl_frameset_get_first(master_flat_frame), </div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                                   NULL, setting, NULL);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load master flat"</span>);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     <span class="comment">/* Divide by normalized flat */</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     <a class="code" href="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35" title="Divide by scalar.">fors_image_divide_scalar</a>(master_flat,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                              <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(master_flat, NULL), -1.0);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <a class="code" href="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2" title="Divide images.">fors_image_divide</a>(sci, master_flat);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not divide by master flat"</span>);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&master_flat);</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="comment">/* Extract sources */</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     stars = <a class="code" href="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05" title="Extract sources.">fors_extract</a>(sci, setting, em, magsyserr,</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>              &sky_stats, &background, &sources);</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not extract objects"</span>);  </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="comment">/* QC */</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qc, fors_qc_dic_version, setting->instrument);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <a class="code" href="group__forsqc.html#ga9ff2c73c315e805ab5d1415a2de9ce0b" title="Initiate a new QC1 group and log basic QC.">fors_qc_write_group_heading</a>(cpl_frameset_get_first(sci_frame),</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>                                 PHOTOMETRY_TABLE,</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>                                 setting->instrument);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not write %s QC parameters"</span>, </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>             PHOTOMETRY_TABLE);</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     <span class="keywordtype">double</span> sky_mag;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="keywordtype">double</span> sky_mag_rms;</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">if</span> (sky_stats.mean > 0) {</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>         sky_mag = -2.5*log(sky_stats.mean /</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                            (setting->pixel_scale*setting->pixel_scale))/log(10);</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     }</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>         cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                         <span class="stringliteral">"Average sky background is negative (%f ADU), "</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                         <span class="stringliteral">"cannot compute magnitude, setting QC.SKYAVG to 99999."</span>,</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                         sky_stats.mean);</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>         sky_mag = 99999.;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     }</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                             sky_mag,</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                             <span class="stringliteral">"QC.SKYAVG"</span>,</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>                             <span class="stringliteral">"mag/arcsec^2"</span>,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                             <span class="stringliteral">"Mean of sky background"</span>,</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>                             setting->instrument);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <span class="keywordflow">if</span> (sky_stats.median > 0) {</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         sky_mag = -2.5*log(sky_stats.median /</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>                            (setting->pixel_scale*setting->pixel_scale))/log(10);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>         <span class="comment">/* deltaM = -2.5*log10(e)*deltaF/F */</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>         sky_mag_rms = fabs(-2.5 * (1.0/log(10))*sky_stats.rms/sky_stats.median);</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     }</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>         cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                         <span class="stringliteral">"Median sky background is negative (%f ADU), "</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                         <span class="stringliteral">"cannot compute magnitude: setting both QC.SKYMED "</span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>                         <span class="stringliteral">"and QC.SKYRMS to 99999."</span>,</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>                         sky_mag);</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         sky_mag = 99999.;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         sky_mag_rms = 99999.;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     }</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>                             sky_mag,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                             <span class="stringliteral">"QC.SKYMED"</span>,</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                             <span class="stringliteral">"mag/arcsec^2"</span>,</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                             <span class="stringliteral">"Median of sky background"</span>,</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>                             setting->instrument);</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> </div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>                             sky_mag_rms,</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>                             <span class="stringliteral">"QC.SKYRMS"</span>,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                             <span class="stringliteral">"mag/arcsec^2"</span>,</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>                             <span class="stringliteral">"Standard deviation of sky background"</span>,</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>                             setting->instrument);</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordtype">double</span> image_quality_error;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keywordtype">double</span> stellarity;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keywordtype">double</span> ellipticity, ellipticity_rms;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordtype">double</span> image_quality = <a class="code" href="group__fors__img__science.html#ga11315f8dbe7bcd79d1f4e7ad691532fe" title="Compute image quality.">get_image_quality</a>(stars, </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>                                              &image_quality_error,</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>                                              &stellarity,</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>                                              &ellipticity,</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>                                              &ellipticity_rms);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordflow">if</span> (image_quality > 0.) {</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         image_quality *= TWOSQRT2LN2 * setting->pixel_scale;</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>         image_quality_error *= TWOSQRT2LN2 * setting->pixel_scale;</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     }</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>                             image_quality,</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>                             <span class="stringliteral">"QC.IMGQU"</span>,</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>                             <span class="stringliteral">"arcsec"</span>,</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>                             <span class="stringliteral">"Image quality of scientific exposure"</span>,</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>                             setting->instrument);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>                             image_quality_error,</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>                             <span class="stringliteral">"QC.IMGQUERR"</span>,</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>                             <span class="stringliteral">"arcsec"</span>,</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>                             <span class="stringliteral">"Uncertainty of image quality"</span>,</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                             setting->instrument);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                             stellarity,</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>                             <span class="stringliteral">"QC.STELLAVG"</span>,</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                             NULL,</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                             <span class="stringliteral">"Mean stellarity index"</span>,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                             setting->instrument);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>                             ellipticity,</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>                             <span class="stringliteral">"QC.IMGQUELL"</span>,</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>                             NULL,</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>                             <span class="stringliteral">"Mean star ellipticity"</span>,</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>                             setting->instrument);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>                             ellipticity_rms,</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>                             <span class="stringliteral">"QC.IMGQUELLERR"</span>,</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>                             NULL,</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>                             <span class="stringliteral">"Standard deviation of star ellipticities"</span>,</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>                             setting->instrument);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <span class="comment">/* Save SCIENCE_REDUCED, PHOT_BACKGROUND_SCI_IMG */</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> </div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment">/* %%% */</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     header = cpl_propertylist_load(</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>                         cpl_frame_get_filename(</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>                            cpl_frameset_get_first(sci_frame)), 0);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Failed to load raw header"</span>);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>         cleanup;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     }</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     avg_airmass = <a class="code" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b" title="Compute average airmass.">fors_get_airmass</a>(header);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     cpl_propertylist_update_double(qc, <span class="stringliteral">"AIRMASS"</span>, avg_airmass);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     cpl_propertylist_update_double(product_header, <span class="stringliteral">"AIRMASS"</span>, avg_airmass);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> </div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="comment">/* %%% */</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     <a class="code" href="group__forsdfs.html#gadbf163fdd77abcf68fac009993f20959" title="add WCS keywords to header">fors_dfs_add_wcs</a>(qc, cpl_frameset_get_first(sci_frame), setting);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     <a class="code" href="group__forsdfs.html#ga71054af8e26681ec2d7e1ea39e7feb17" title="Add keyword EXPTIME to header.">fors_dfs_add_exptime</a>(qc, cpl_frameset_get_first(sci_frame), 0.);</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     <a class="code" href="group__forsdfs.html#gadbf163fdd77abcf68fac009993f20959" title="add WCS keywords to header">fors_dfs_add_wcs</a>(product_header, cpl_frameset_get_first(sci_frame), </div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>                      setting);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     <a class="code" href="group__forsdfs.html#ga71054af8e26681ec2d7e1ea39e7feb17" title="Add keyword EXPTIME to header.">fors_dfs_add_exptime</a>(product_header, cpl_frameset_get_first(sci_frame), 0.);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, sci, SCIENCE_REDUCED_IMG,</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>                         qc, parameters, fors_img_science_name, </div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>                         cpl_frameset_get_first(sci_frame));</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>             SCIENCE_REDUCED_IMG);</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> </div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&sci);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     <a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frames, background, PHOT_BACKGROUND_SCI_IMG,</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                    product_header, parameters, fors_img_science_name, </div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>                    setting->version);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>             PHOT_BACKGROUND_SCI_IMG);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span> </div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     cpl_image_delete(background); background = NULL;</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     <span class="comment">/* Load filter coefficients */</span></div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> </div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> <span class="comment">/* %%%</span></div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> <span class="comment">    fors_phot_table_load(cpl_frameset_get_first(phot_table), setting,</span></div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> <span class="comment">                         NULL, NULL, </span></div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> <span class="comment">             &ext_coeff, &dext_coeff,</span></div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> <span class="comment">             NULL, NULL);</span></div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> <span class="comment">    assure( !cpl_error_get_code(), return, "Could not load photometry table" );</span></div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span> </div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="comment">/* Correct for atmospheric extinction */</span></div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> <span class="comment">/* %%%</span></div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> <span class="comment">    fors_star_ext_corr(stars, setting, ext_coeff, dext_coeff,</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> <span class="comment">                       cpl_frameset_get_first(sci_frame));</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> <span class="comment">    assure( !cpl_error_get_code(), return, </span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> <span class="comment">            "Extinction correction failed");</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="comment">/* Create, save FITS product */</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     phot = <a class="code" href="group__fors__tools.html#gabebf30c47320c004ab4e658f837f75db" title="Create product.">fors_create_sources_table</a>(stars);</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>             <span class="stringliteral">"Failed to create extracted sources table"</span>);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> </div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> <span class="comment">     * Eliminate unused columns from photometry table</span></div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     cpl_table_erase_column(phot, <span class="stringliteral">"INSTR_CMAG"</span>);</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     cpl_table_erase_column(phot, <span class="stringliteral">"DINSTR_CMAG"</span>);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     cpl_table_erase_column(phot, <span class="stringliteral">"OBJECT"</span>);</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     cpl_table_erase_column(phot, <span class="stringliteral">"MAG"</span>);</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     cpl_table_erase_column(phot, <span class="stringliteral">"DMAG"</span>);</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     cpl_table_erase_column(phot, <span class="stringliteral">"CAT_MAG"</span>);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     cpl_table_erase_column(phot, <span class="stringliteral">"DCAT_MAG"</span>);</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     cpl_table_erase_column(phot, <span class="stringliteral">"COLOR"</span>);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     <span class="comment">/* new columns since 4.4.10 */</span></div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="keywordflow">if</span> (cpl_table_has_column(phot, <span class="stringliteral">"DCOLOR"</span>))</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         cpl_table_erase_column(phot, <span class="stringliteral">"DCOLOR"</span>);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     <span class="keywordflow">if</span> (cpl_table_has_column(phot, <span class="stringliteral">"COV_CATM_COL"</span>))</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         cpl_table_erase_column(phot, <span class="stringliteral">"COV_CATM_COL"</span>);</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     cpl_table_erase_column(phot, <span class="stringliteral">"USE_CAT"</span>);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     cpl_table_erase_column(phot, <span class="stringliteral">"SHIFT_X"</span>);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     cpl_table_erase_column(phot, <span class="stringliteral">"SHIFT_Y"</span>);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     cpl_table_erase_column(phot, <span class="stringliteral">"ZEROPOINT"</span>);</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     cpl_table_erase_column(phot, <span class="stringliteral">"DZEROPOINT"</span>);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     cpl_table_erase_column(phot, <span class="stringliteral">"WEIGHT"</span>);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <a class="code" href="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f" title="Save DFS product (table)">fors_dfs_save_table</a>(frames, sources, SOURCES_SCI,</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>                         NULL, parameters, fors_img_science_name, </div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>                         cpl_frameset_get_first(sci_frame));</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>             SOURCES_SCI);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> </div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     <a class="code" href="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f" title="Save DFS product (table)">fors_dfs_save_table</a>(frames, phot, PHOTOMETRY_TABLE,</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>                         NULL, parameters, fors_img_science_name, </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>                         cpl_frameset_get_first(sci_frame));</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>             PHOTOMETRY_TABLE);</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> </div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     cleanup;</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> }</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span> </div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00500"></a><span class="lineno"><a class="code" href="group__fors__img__science.html#ga52377e795ce68f7de7da06f753b01efc">  500</a></span> <a class="code" href="group__fors__img__science.html#ga52377e795ce68f7de7da06f753b01efc" title="Determine if source is a star.">is_star</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span> {</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     data = data;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL, <span class="keywordflow">return</span> <span class="keyword">false</span>, NULL );</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span> </div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> <span class="comment">/*FIXME</span></div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> <span class="comment">  All stars for the moment... */</span></div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> </div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     <span class="keywordflow">return</span> s->stellarity_index >= 0.7;</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> }</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span> </div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span> <span class="preprocessor">    fors_star_list_delete(&stars, fors_star_delete); \</span></div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00530"></a><span class="lineno"><a class="code" href="group__fors__img__science.html#ga11315f8dbe7bcd79d1f4e7ad691532fe">  530</a></span> <a class="code" href="group__fors__img__science.html#ga11315f8dbe7bcd79d1f4e7ad691532fe" title="Compute image quality.">get_image_quality</a>(<span class="keyword">const</span> fors_star_list *sources, <span class="keywordtype">double</span> *image_quality_err,</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>                   <span class="keywordtype">double</span> *stellarity,</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>                   <span class="keywordtype">double</span> *ellipticity,</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>                   <span class="keywordtype">double</span> *ellipticity_rms)</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> {</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     fors_star_list *stars = fors_star_list_extract(sources,</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>                                                    <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>,</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>                                                    <a class="code" href="group__fors__img__science.html#ga52377e795ce68f7de7da06f753b01efc" title="Determine if source is a star.">is_star</a>, NULL);</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     <span class="keywordtype">double</span> fwhm;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     <span class="keywordflow">if</span> (fors_star_list_size(stars) >= 1) {</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>         *image_quality_err = fors_star_list_mad(stars, <a class="code" href="group__fors__star.html#ga2c97d2c47686016fa04c59b2a3e92b5c" title="Get star size.">fors_star_extension</a>, NULL) </div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>             * STDEV_PR_MAD;</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>         </div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>         fwhm = fors_star_list_median(stars, <a class="code" href="group__fors__star.html#ga2c97d2c47686016fa04c59b2a3e92b5c" title="Get star size.">fors_star_extension</a> , NULL);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>         </div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>         *stellarity      = fors_star_list_mean(stars, <a class="code" href="group__fors__star.html#ga67451b955667ae4f965146aee484c6bc" title="Get star stellarity.">fors_star_stellarity</a>, NULL);</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         *ellipticity     = fors_star_list_mean(stars, <a class="code" href="group__fors__star.html#ga9e7994d44acbe88580cab63d3662df40" title="Get star ellipticity.">fors_star_ellipticity</a>, NULL);</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         *ellipticity_rms = fors_star_list_mad(stars, <a class="code" href="group__fors__star.html#ga9e7994d44acbe88580cab63d3662df40" title="Get star ellipticity.">fors_star_ellipticity</a>, NULL)</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>             * STDEV_PR_MAD;</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     }</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"No stars found! Cannot compute image quality, "</span></div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>                         <span class="stringliteral">"setting QC parameters to -1"</span>);</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> </div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>         <span class="comment">/* -1 is not a valid value for any of these */</span></div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>         *image_quality_err = -1;</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>         fwhm = -1;</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>         *stellarity = -1;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         *ellipticity = -1;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>         *ellipticity_rms = -1;</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     }</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span> </div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     cleanup;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     <span class="keywordflow">return</span> fwhm;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span> }</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__science__impl_8h-source.html b/html/fors__img__science__impl_8h-source.html
deleted file mode 100644
index c904d44..0000000
--- a/html/fors__img__science__impl_8h-source.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_science_impl.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_img_science_impl.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_science_impl.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_IMG_SCIENCE_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_IMG_SCIENCE_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">fors_img_science_name</a>;
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__science.html#gb97915136a3a942113a96d464f9eae30">fors_img_science_description_short</a>;
-<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__science.html#g969cdeff825fab5a2f064ae5e7335ded">fors_img_science_author</a>;
-<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__science.html#g0b4a7b1ca4765372ccfd735dd1dc8d7b">fors_img_science_email</a>;
-<a name="l00039"></a>00039 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__science.html#g74ec08d9ca0bb98b7d31fc7609531e90">fors_img_science_description</a>;
-<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="group__fors__img__science.html#g9391a3b278d25edc38af3cb70db34597">fors_img_science_define_parameters</a>(cpl_parameterlist *parameters);
-<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="group__fors__img__science.html#gc6a3f5a41cacfa91711e127f612fa064">fors_img_science</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 CPL_END_DECLS
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__science__impl_8h_source.html b/html/fors__img__science__impl_8h_source.html
new file mode 100644
index 0000000..cd90d37
--- /dev/null
+++ b/html/fors__img__science__impl_8h_source.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_science_impl.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_science_impl.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_science_impl.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.4 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_IMG_SCIENCE_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_IMG_SCIENCE_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_science_name;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_science_description_short;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_science_author;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_science_email;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_science_description;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__science.html#ga2a18bf8b29e61bb854f3290fba50bdfd" title="Define recipe parameters.">fors_img_science_define_parameters</a>(cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__science.html#ga6f762068474a2723fd2c17f01b4a82c1" title="Do the processing.">fors_img_science</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__screen__flat-test_8c-source.html b/html/fors__img__screen__flat-test_8c-source.html
deleted file mode 100644
index 291dc7d..0000000
--- a/html/fors__img__screen__flat-test_8c-source.html
+++ /dev/null
@@ -1,235 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_screen_flat-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_img_screen_flat-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_screen_flat-test.c,v 1.17 2008/08/07 09:38:01 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2008/08/07 09:38:01 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.17 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_img_screen_flat_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <test.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <math.h></span>
-<a name="l00042"></a>00042 
-<a name="l00049"></a>00049 <span class="preprocessor">#undef cleanup</span>
-<a name="l00050"></a><a class="code" href="group__fors__img__screen__flat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">do { \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">    cpl_frameset_delete(frames); \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">    fors_image_delete(&raw_sflat); \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">    fors_image_delete(&master_sflat); \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">    fors_image_delete(&master_bias); \</span>
-<a name="l00057"></a>00057 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00058"></a>00058 <span class="preprocessor">    cpl_propertylist_delete(product_header); \</span>
-<a name="l00059"></a>00059 <span class="preprocessor">} while(0)</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span>
-<a name="l00064"></a>00064 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00065"></a><a class="code" href="group__fors__img__screen__flat__test.html#g94a7123b53e71795fea2518b58a1f44d">00065</a> <a class="code" href="group__fors__img__screen__flat__test.html#g94a7123b53e71795fea2518b58a1f44d">test_img_screen_flat</a>(<span class="keywordtype">void</span>)
-<a name="l00066"></a>00066 {
-<a name="l00067"></a>00067     <span class="comment">/* Input */</span>
-<a name="l00068"></a>00068     cpl_frameset *frames = cpl_frameset_new();
-<a name="l00069"></a>00069     cpl_parameterlist *parameters = cpl_parameterlist_new();
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071     <span class="comment">/* Output */</span>
-<a name="l00072"></a>00072     <a class="code" href="struct__fors__image.html">fors_image</a> *raw_sflat = NULL;
-<a name="l00073"></a>00073     <a class="code" href="struct__fors__image.html">fors_image</a> *master_sflat = NULL;
-<a name="l00074"></a>00074     <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias = NULL;
-<a name="l00075"></a>00075     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00076"></a>00076     cpl_propertylist *product_header = NULL;
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078     <span class="comment">/* Simulate data */</span>
-<a name="l00079"></a>00079     <span class="keyword">const</span> <span class="keywordtype">char</span> *screen_flat_filename[] = {<span class="stringliteral">"img_screen_flat_1.fits"</span>,
-<a name="l00080"></a>00080                                           <span class="stringliteral">"img_screen_flat_2.fits"</span>,
-<a name="l00081"></a>00081                                           <span class="stringliteral">"img_screen_flat_3.fits"</span>};
-<a name="l00082"></a>00082     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> N =  <span class="keyword">sizeof</span>(screen_flat_filename)/<span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *);
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084     {
-<a name="l00085"></a>00085         <span class="keywordtype">unsigned</span> i;
-<a name="l00086"></a>00086         
-<a name="l00087"></a>00087         <span class="keywordflow">for</span> (i = 0; i < N; i++) {
-<a name="l00088"></a>00088             cpl_frameset_insert(
-<a name="l00089"></a>00089                 frames,
-<a name="l00090"></a>00090                 <a class="code" href="group__test__simulate.html#g474967528c2d1de8ce4dadd24da817ce">create_screen_flat</a>(screen_flat_filename[i],
-<a name="l00091"></a>00091                                    SCREEN_FLAT_IMG, CPL_FRAME_GROUP_RAW));
-<a name="l00092"></a>00092         }
-<a name="l00093"></a>00093     }
-<a name="l00094"></a>00094     
-<a name="l00095"></a>00095     cpl_frameset_insert(frames, 
-<a name="l00096"></a>00096                         <a class="code" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">create_bias</a>(<span class="stringliteral">"img_screen_flat_master_bias.fits"</span>, 
-<a name="l00097"></a>00097                                     MASTER_BIAS, CPL_FRAME_GROUP_CALIB));
-<a name="l00098"></a>00098     
-<a name="l00099"></a>00099     <span class="comment">/* Define parameters */</span>
-<a name="l00100"></a>00100     <a class="code" href="group__fors__img__screen__flat.html#g8bd60f1e1c99dff8aa58da8d21eeeb02">fors_img_screen_flat_define_parameters</a>(parameters);
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00103"></a>00103             <span class="stringliteral">"Create parameters failed"</span>);
-<a name="l00104"></a>00104     
-<a name="l00105"></a>00105     <a class="code" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">fors_parameterlist_set_defaults</a>(parameters);
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107     cpl_parameter_set_int(cpl_parameterlist_find(parameters, 
-<a name="l00108"></a>00108                           <span class="stringliteral">"fors.fors_img_screen_flat.xradius"</span>),
-<a name="l00109"></a>00109                           1);
-<a name="l00110"></a>00110     cpl_parameter_set_int(cpl_parameterlist_find(parameters, 
-<a name="l00111"></a>00111                           <span class="stringliteral">"fors.fors_img_screen_flat.yradius"</span>),
-<a name="l00112"></a>00112                           1);
-<a name="l00113"></a>00113 
-<a name="l00114"></a>00114     cpl_parameter_set_int(cpl_parameterlist_find(parameters,
-<a name="l00115"></a>00115                           <span class="stringliteral">"fors.fors_img_screen_flat.degree"</span>),
-<a name="l00116"></a>00116                           -1);
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118     <span class="comment">/* Call recipe */</span>
-<a name="l00119"></a>00119     <a class="code" href="group__fors__img__screen__flat.html#g6ada02347c7648aaa61ce6bc000910e5">fors_img_screen_flat</a>(frames, parameters);
-<a name="l00120"></a>00120     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00121"></a>00121             <span class="stringliteral">"Execution error"</span>);
-<a name="l00122"></a>00122     
-<a name="l00123"></a>00123     <span class="comment">/* Test results */</span>
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="comment">/* Existence */</span>
-<a name="l00126"></a>00126     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[] = {MASTER_SCREEN_FLAT_IMG,
-<a name="l00127"></a>00127                                         MASTER_NORM_FLAT_IMG};
-<a name="l00128"></a>00128     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[] =  {<span class="stringliteral">"QC OVEREXPO"</span>,
-<a name="l00129"></a>00129                                <span class="stringliteral">"QC FLAT EFF"</span>,
-<a name="l00130"></a>00130                                <span class="stringliteral">"QC FLAT PHN"</span>,
-<a name="l00131"></a>00131                                <span class="stringliteral">"QC FLAT FPN"</span>,
-<a name="l00132"></a>00132                                <span class="stringliteral">"QC FLAT CONAD"</span>,
-<a name="l00133"></a>00133                                <span class="stringliteral">"QC FLAT CONADERR"</span>};
-<a name="l00134"></a>00134     
-<a name="l00135"></a>00135     <a class="code" href="group__test.html#ge4730f9510e545e738aef9c8b7459b8b">test_recipe_output</a>(frames,
-<a name="l00136"></a>00136                        product_tags, <span class="keyword">sizeof</span> product_tags / <span class="keyword">sizeof</span> *product_tags,
-<a name="l00137"></a>00137                MASTER_NORM_FLAT_IMG,
-<a name="l00138"></a>00138                        qc, <span class="keyword">sizeof</span> qc / <span class="keyword">sizeof</span> *qc);    
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140 
-<a name="l00141"></a>00141     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_find(frames,
-<a name="l00142"></a>00142                                                  SCREEN_FLAT_IMG));
-<a name="l00143"></a>00143     
-<a name="l00144"></a>00144     {
-<a name="l00145"></a>00145         <span class="comment">/* New and previous frames */</span>
-<a name="l00146"></a>00146         test( cpl_frameset_find(frames, MASTER_SCREEN_FLAT_IMG) != NULL );
-<a name="l00147"></a>00147         test( cpl_frameset_find(frames, MASTER_NORM_FLAT_IMG) != NULL );
-<a name="l00148"></a>00148         test( cpl_frameset_find(frames, MASTER_BIAS) != NULL );
-<a name="l00149"></a>00149         test( cpl_frameset_find(frames, SCREEN_FLAT_IMG) != NULL );
-<a name="l00150"></a>00150         
-<a name="l00151"></a>00151         master_sflat = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00152"></a>00152             cpl_frameset_find(frames, MASTER_NORM_FLAT_IMG), NULL, setting, NULL);
-<a name="l00153"></a>00153         master_bias  = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00154"></a>00154             cpl_frameset_find(frames, MASTER_BIAS), NULL, setting, NULL);
-<a name="l00155"></a>00155         
-<a name="l00156"></a>00156         raw_sflat    = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00157"></a>00157             cpl_frameset_find(frames, SCREEN_FLAT_IMG), master_bias, setting, NULL);
-<a name="l00158"></a>00158         
-<a name="l00159"></a>00159         <span class="comment">/* Verify that relative error decreased  */</span>
-<a name="l00160"></a>00160         test( <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(master_sflat, NULL) /
-<a name="l00161"></a>00161               <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(master_sflat, NULL) 
-<a name="l00162"></a>00162               <
-<a name="l00163"></a>00163               <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(raw_sflat, NULL) /
-<a name="l00164"></a>00164               <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(raw_sflat, NULL));
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166         <span class="comment">/* Verify normalization */</span>
-<a name="l00167"></a>00167         test_rel( <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(master_sflat, NULL),
-<a name="l00168"></a>00168                   1.0, 0.01);
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170         <span class="comment">/* Test QC values */</span>
-<a name="l00171"></a>00171         product_header = 
-<a name="l00172"></a>00172             cpl_propertylist_load(cpl_frame_get_filename(
-<a name="l00173"></a>00173                                       cpl_frameset_find(frames,
-<a name="l00174"></a>00174                                                         MASTER_NORM_FLAT_IMG)),
-<a name="l00175"></a>00175                                   0);
-<a name="l00176"></a>00176         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( product_header != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178         
-<a name="l00179"></a>00179         test_rel( cpl_propertylist_get_double(product_header,
-<a name="l00180"></a>00180                                               <span class="stringliteral">"ESO QC FLAT EFF"</span>),
-<a name="l00181"></a>00181                   <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(raw_sflat, NULL) / setting-><a class="code" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">exposure_time</a>,
-<a name="l00182"></a>00182                   0.01 );
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184         <span class="comment">/* QC.FLAT.PHN is the master flat photon noise in ADU.</span>
-<a name="l00185"></a>00185 <span class="comment">           But the master flat is normalized to one, so</span>
-<a name="l00186"></a>00186 <span class="comment">           multiply by the normalization factor */</span>
-<a name="l00187"></a>00187 <span class="comment">/*  %%%</span>
-<a name="l00188"></a>00188 <span class="comment">        test_rel( cpl_propertylist_get_double(product_header,</span>
-<a name="l00189"></a>00189 <span class="comment">                                              "ESO QC FLAT PHN"),</span>
-<a name="l00190"></a>00190 <span class="comment">                  fors_image_get_stdev(master_sflat, NULL) *</span>
-<a name="l00191"></a>00191 <span class="comment">                  fors_image_get_median(raw_sflat, NULL),</span>
-<a name="l00192"></a>00192 <span class="comment">                  0.1 );</span>
-<a name="l00193"></a>00193 <span class="comment">%%% */</span>
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195 
-<a name="l00196"></a>00196         <span class="comment">/* CONAD */</span>
-<a name="l00197"></a>00197         test_rel( cpl_propertylist_get_double(product_header,
-<a name="l00198"></a>00198                                               <span class="stringliteral">"ESO QC FLAT CONAD"</span>),
-<a name="l00199"></a>00199                   cpl_propertylist_get_double(product_header,
-<a name="l00200"></a>00200                                               <a class="code" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a>[0]),
-<a name="l00201"></a>00201                   <span class="comment">/* Compare with propagated CONAD value */</span>
-<a name="l00202"></a>00202                   0.1);
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204         test( cpl_propertylist_get_double(product_header,
-<a name="l00205"></a>00205                                           <span class="stringliteral">"ESO QC FLAT CONADERR"</span>) <
-<a name="l00206"></a>00206               0.1 * cpl_propertylist_get_double(product_header,
-<a name="l00207"></a>00207                                                 <span class="stringliteral">"ESO QC FLAT CONAD"</span>) );
-<a name="l00208"></a>00208     }
-<a name="l00209"></a>00209     
-<a name="l00210"></a>00210     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00211"></a>00211     <span class="keywordflow">return</span>;
-<a name="l00212"></a>00212 }
-<a name="l00213"></a>00213 
-<a name="l00217"></a><a class="code" href="group__fors__img__screen__flat__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00217</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00218"></a>00218 {
-<a name="l00219"></a>00219     TEST_INIT;
-<a name="l00220"></a>00220     
-<a name="l00221"></a>00221     <a class="code" href="group__fors__img__screen__flat__test.html#g94a7123b53e71795fea2518b58a1f44d">test_img_screen_flat</a>();
-<a name="l00222"></a>00222 
-<a name="l00223"></a>00223     TEST_END;
-<a name="l00224"></a>00224 }
-<a name="l00225"></a>00225 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__screen__flat-test_8c_source.html b/html/fors__img__screen__flat-test_8c_source.html
new file mode 100644
index 0000000..c230546
--- /dev/null
+++ b/html/fors__img__screen__flat-test_8c_source.html
@@ -0,0 +1,274 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_screen_flat-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_screen_flat-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_screen_flat-test.c,v 1.17 2008-08-07 09:38:01 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2008-08-07 09:38:01 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.17 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_img_screen_flat_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">    cpl_frameset_delete(frames); \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">    fors_image_delete(&raw_sflat); \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">    fors_image_delete(&master_sflat); \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">    fors_image_delete(&master_bias); \</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">    cpl_propertylist_delete(product_header); \</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat__test.html#gaa7f97a660fe457c4a77d4269200b6162">   65</a></span> <a class="code" href="group__fors__img__screen__flat__test.html#gaa7f97a660fe457c4a77d4269200b6162" title="Test screen flat recipe.">test_img_screen_flat</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> {</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="comment">/* Input */</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     cpl_frameset *frames = cpl_frameset_new();</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     cpl_parameterlist *parameters = cpl_parameterlist_new();</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <span class="comment">/* Output */</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *raw_sflat = NULL;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_sflat = NULL;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias = NULL;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     cpl_propertylist *product_header = NULL;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <span class="comment">/* Simulate data */</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *screen_flat_filename[] = {<span class="stringliteral">"img_screen_flat_1.fits"</span>,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                                           <span class="stringliteral">"img_screen_flat_2.fits"</span>,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                                           <span class="stringliteral">"img_screen_flat_3.fits"</span>};</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> N =  <span class="keyword">sizeof</span>(screen_flat_filename)/<span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     {</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>         <span class="keywordtype">unsigned</span> i;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>         </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>         <span class="keywordflow">for</span> (i = 0; i < N; i++) {</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>             cpl_frameset_insert(</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                 frames,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                 <a class="code" href="group__test__simulate.html#ga5e5e21165c992a2062b3ca661e35fe9d" title="Simulate screen flat image.">create_screen_flat</a>(screen_flat_filename[i],</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                                    SCREEN_FLAT_IMG, CPL_FRAME_GROUP_RAW));</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>         }</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     }</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     cpl_frameset_insert(frames, </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                         <a class="code" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e" title="Simulate bias image.">create_bias</a>(<span class="stringliteral">"img_screen_flat_master_bias.fits"</span>, </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                                     MASTER_BIAS, CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     <span class="comment">/* Define parameters */</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <a class="code" href="group__fors__img__screen__flat.html#ga19e0710196db92a992d5c1502c35a5f0" title="Define recipe parameters.">fors_img_screen_flat_define_parameters</a>(parameters);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>             <span class="stringliteral">"Create parameters failed"</span>);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     </div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     <a class="code" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42" title="Set unset parameters to default value.">fors_parameterlist_set_defaults</a>(parameters);</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     cpl_parameter_set_int(cpl_parameterlist_find(parameters, </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                           <span class="stringliteral">"fors.fors_img_screen_flat.xradius"</span>),</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                           1);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     cpl_parameter_set_int(cpl_parameterlist_find(parameters, </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                           <span class="stringliteral">"fors.fors_img_screen_flat.yradius"</span>),</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                           1);</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     cpl_parameter_set_int(cpl_parameterlist_find(parameters,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                           <span class="stringliteral">"fors.fors_img_screen_flat.degree"</span>),</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                           -1);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="comment">/* Call recipe */</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <a class="code" href="group__fors__img__screen__flat.html#gad6f0f603eedc00271082e6dae9dbd2a6" title="Do the processing.">fors_img_screen_flat</a>(frames, parameters);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>             <span class="stringliteral">"Execution error"</span>);</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="comment">/* Test results */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="comment">/* Existence */</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[] = {MASTER_SCREEN_FLAT_IMG,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                                         MASTER_NORM_FLAT_IMG};</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[] =  {<span class="stringliteral">"QC OVEREXPO"</span>,</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                                <span class="stringliteral">"QC FLAT EFF"</span>,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                                <span class="stringliteral">"QC FLAT PHN"</span>,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                                <span class="stringliteral">"QC FLAT FPN"</span>,</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>                                <span class="stringliteral">"QC FLAT CONAD"</span>,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                                <span class="stringliteral">"QC FLAT CONADERR"</span>};</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <a class="code" href="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c" title="Test existence of recipe products.">test_recipe_output</a>(frames,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                        product_tags, <span class="keyword">sizeof</span> product_tags / <span class="keyword">sizeof</span> *product_tags,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                MASTER_NORM_FLAT_IMG,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                        qc, <span class="keyword">sizeof</span> qc / <span class="keyword">sizeof</span> *qc);    </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_find(frames,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                                                  SCREEN_FLAT_IMG));</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     {</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         <span class="comment">/* New and previous frames */</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>         test( cpl_frameset_find(frames, MASTER_SCREEN_FLAT_IMG) != NULL );</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>         test( cpl_frameset_find(frames, MASTER_NORM_FLAT_IMG) != NULL );</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>         test( cpl_frameset_find(frames, MASTER_BIAS) != NULL );</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>         test( cpl_frameset_find(frames, SCREEN_FLAT_IMG) != NULL );</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>         </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>         master_sflat = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>             cpl_frameset_find(frames, MASTER_NORM_FLAT_IMG), NULL, setting, NULL);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>         master_bias  = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>             cpl_frameset_find(frames, MASTER_BIAS), NULL, setting, NULL);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>         </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>         raw_sflat    = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>             cpl_frameset_find(frames, SCREEN_FLAT_IMG), master_bias, setting, NULL);</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>         </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>         <span class="comment">/* Verify that relative error decreased  */</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>         test( <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(master_sflat, NULL) /</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>               <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(master_sflat, NULL) </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>               <</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>               <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(raw_sflat, NULL) /</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>               <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(raw_sflat, NULL));</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>         <span class="comment">/* Verify normalization */</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>         test_rel( <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(master_sflat, NULL),</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>                   1.0, 0.01);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>         <span class="comment">/* Test QC values */</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>         product_header = </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>             cpl_propertylist_load(cpl_frame_get_filename(</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>                                       cpl_frameset_find(frames,</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>                                                         MASTER_NORM_FLAT_IMG)),</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>                                   0);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( product_header != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>         </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         test_rel( cpl_propertylist_get_double(product_header,</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                                               <span class="stringliteral">"ESO QC FLAT EFF"</span>),</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                   <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(raw_sflat, NULL) / setting->exposure_time,</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>                   0.01 );</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>         <span class="comment">/* QC.FLAT.PHN is the master flat photon noise in ADU.</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="comment">           But the master flat is normalized to one, so</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="comment">           multiply by the normalization factor */</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="comment">/*  %%%</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="comment">        test_rel( cpl_propertylist_get_double(product_header,</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="comment">                                              "ESO QC FLAT PHN"),</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="comment">                  fors_image_get_stdev(master_sflat, NULL) *</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="comment">                  fors_image_get_median(raw_sflat, NULL),</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="comment">                  0.1 );</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="comment">%%% */</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>         <span class="comment">/* CONAD */</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>         test_rel( cpl_propertylist_get_double(product_header,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                                               <span class="stringliteral">"ESO QC FLAT CONAD"</span>),</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                   cpl_propertylist_get_double(product_header,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                                               FORS_PFITS_CONAD[0]),</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                   <span class="comment">/* Compare with propagated CONAD value */</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                   0.1);</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>         test( cpl_propertylist_get_double(product_header,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                           <span class="stringliteral">"ESO QC FLAT CONADERR"</span>) <</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>               0.1 * cpl_propertylist_get_double(product_header,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                                                 <span class="stringliteral">"ESO QC FLAT CONAD"</span>) );</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     }</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     cleanup;</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> }</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  217</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> {</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     TEST_INIT;</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     <a class="code" href="group__fors__img__screen__flat__test.html#gaa7f97a660fe457c4a77d4269200b6162" title="Test screen flat recipe.">test_img_screen_flat</a>();</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     TEST_END;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> }</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__screen__flat_8c-source.html b/html/fors__img__screen__flat_8c-source.html
deleted file mode 100644
index 3cb5fec..0000000
--- a/html/fors__img__screen__flat_8c-source.html
+++ /dev/null
@@ -1,198 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_screen_flat.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_img_screen_flat.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_screen_flat.c,v 1.8 2011/10/12 15:00:51 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/12 15:00:51 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_img_screen_flat_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#g4f7674508424db7a7b62d5a8772bb3cc">fors_img_screen_flat_create</a>(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#gcdfb37251e245fe82da375ba0725a3cb">fors_img_screen_flat_exec</a>(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#g4ee16c004f65246f0c474d1c4f5516a8">fors_img_screen_flat_destroy</a>(cpl_plugin *);
-<a name="l00041"></a>00041 
-<a name="l00062"></a><a class="code" href="group__fors__img__screen__flat.html#g4abb403976fc3ddcaa614c59a44590c9">00062</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00065"></a>00065     cpl_plugin *plugin = &recipe->interface;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>())
-<a name="l00068"></a>00068     {
-<a name="l00069"></a>00069         cpl_msg_error(cpl_func, 
-<a name="l00070"></a>00070               <span class="stringliteral">"I am fors_img_screen_flat version %d, but I am linking "</span>
-<a name="l00071"></a>00071               <span class="stringliteral">"against the FORS library version %d. "</span>
-<a name="l00072"></a>00072               <span class="stringliteral">"This will not work. "</span>
-<a name="l00073"></a>00073               <span class="stringliteral">"Please remove all previous installations "</span>
-<a name="l00074"></a>00074               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,
-<a name="l00075"></a>00075               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>());
-<a name="l00076"></a>00076         <span class="keywordflow">return</span> 1;
-<a name="l00077"></a>00077     }
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079     cpl_plugin_init(plugin,
-<a name="l00080"></a>00080                     CPL_PLUGIN_API,
-<a name="l00081"></a>00081                     FORS_BINARY_VERSION,
-<a name="l00082"></a>00082                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00083"></a>00083                     <a class="code" href="group__fors__img__screen__flat.html#g9423928a6bbf5fa7d8ca95661ced4d1e">fors_img_screen_flat_name</a>,
-<a name="l00084"></a>00084                     <a class="code" href="group__fors__img__screen__flat.html#gc5ff969a1df38b9da80ab308f823132d">fors_img_screen_flat_description_short</a>,
-<a name="l00085"></a>00085                     <a class="code" href="group__fors__img__screen__flat.html#g584ddcde63f204f4110497cab0e49075">fors_img_screen_flat_description</a>,
-<a name="l00086"></a>00086                     <a class="code" href="group__fors__img__screen__flat.html#ge5a540ddd41737890da74f817765cefd">fors_img_screen_flat_author</a>,
-<a name="l00087"></a>00087                     <a class="code" href="group__fors__img__screen__flat.html#g9713c3ac85f9ad32781dd22fcd81775f">fors_img_screen_flat_email</a>,
-<a name="l00088"></a>00088                     <a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a>(),
-<a name="l00089"></a>00089                     <a class="code" href="group__fors__img__screen__flat.html#g4f7674508424db7a7b62d5a8772bb3cc">fors_img_screen_flat_create</a>,
-<a name="l00090"></a>00090                     <a class="code" href="group__fors__img__screen__flat.html#gcdfb37251e245fe82da375ba0725a3cb">fors_img_screen_flat_exec</a>,
-<a name="l00091"></a>00091                     <a class="code" href="group__fors__img__screen__flat.html#g4ee16c004f65246f0c474d1c4f5516a8">fors_img_screen_flat_destroy</a>);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     cpl_pluginlist_append(list, plugin);
-<a name="l00094"></a>00094     
-<a name="l00095"></a>00095     <span class="keywordflow">return</span> 0;
-<a name="l00096"></a>00096 }
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 
-<a name="l00109"></a><a class="code" href="group__fors__img__screen__flat.html#g4f7674508424db7a7b62d5a8772bb3cc">00109</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#g4f7674508424db7a7b62d5a8772bb3cc">fors_img_screen_flat_create</a>(cpl_plugin *plugin)
-<a name="l00110"></a>00110 {
-<a name="l00111"></a>00111     cpl_recipe    *recipe;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00114"></a>00114         cpl_msg_error(cpl_func, 
-<a name="l00115"></a>00115                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00116"></a>00116                       <span class="stringliteral">"refusing to create recipe fors_img_screen_flat"</span>, 
-<a name="l00117"></a>00117                       cpl_error_get_message());
-<a name="l00118"></a>00118         <span class="keywordflow">return</span> 1;
-<a name="l00119"></a>00119     }
-<a name="l00120"></a>00120     
-<a name="l00121"></a>00121     <span class="comment">/* </span>
-<a name="l00122"></a>00122 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00123"></a>00123 <span class="comment">     */</span>
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00126"></a>00126         recipe = (cpl_recipe *)plugin;
-<a name="l00127"></a>00127     }
-<a name="l00128"></a>00128     <span class="keywordflow">else</span> {
-<a name="l00129"></a>00129         <span class="keywordflow">return</span> 1;
-<a name="l00130"></a>00130     }
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* </span>
-<a name="l00133"></a>00133 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00134"></a>00134 <span class="comment">     */</span>
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00137"></a>00137     
-<a name="l00138"></a>00138     <a class="code" href="group__fors__img__screen__flat.html#g8bd60f1e1c99dff8aa58da8d21eeeb02">fors_img_screen_flat_define_parameters</a>(recipe->parameters);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00141"></a>00141         cpl_msg_error(cpl_func, 
-<a name="l00142"></a>00142                       <span class="stringliteral">"Could not create fors_img_screen_flat parameters"</span>);
-<a name="l00143"></a>00143         <span class="keywordflow">return</span> 1;
-<a name="l00144"></a>00144     }
-<a name="l00145"></a>00145         
-<a name="l00146"></a>00146     <span class="keywordflow">return</span> 0;
-<a name="l00147"></a>00147 }
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 
-<a name="l00158"></a><a class="code" href="group__fors__img__screen__flat.html#gcdfb37251e245fe82da375ba0725a3cb">00158</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#gcdfb37251e245fe82da375ba0725a3cb">fors_img_screen_flat_exec</a>(cpl_plugin *plugin)
-<a name="l00159"></a>00159 {
-<a name="l00160"></a>00160     cpl_recipe *recipe;
-<a name="l00161"></a>00161     cpl_errorstate initial_errorstate = cpl_errorstate_get();
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00164"></a>00164         cpl_msg_error(cpl_func, 
-<a name="l00165"></a>00165                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00166"></a>00166                       <span class="stringliteral">"refusing to execute recipe fors_img_screen_flat"</span>, 
-<a name="l00167"></a>00167                       cpl_error_get_message());
-<a name="l00168"></a>00168         <span class="keywordflow">return</span> 1;
-<a name="l00169"></a>00169     }
-<a name="l00170"></a>00170     
-<a name="l00171"></a>00171     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00172"></a>00172         recipe = (cpl_recipe *)plugin;
-<a name="l00173"></a>00173     }
-<a name="l00174"></a>00174     <span class="keywordflow">else</span> {
-<a name="l00175"></a>00175         <span class="keywordflow">return</span> 1;
-<a name="l00176"></a>00176     }
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="keywordflow">if</span> (recipe->frames == NULL) {
-<a name="l00179"></a>00179         cpl_msg_error(cpl_func, 
-<a name="l00180"></a>00180                       <span class="stringliteral">"Null frameset"</span>);
-<a name="l00181"></a>00181         <span class="keywordflow">return</span> 1;
-<a name="l00182"></a>00182     }
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">if</span> (recipe->parameters == NULL) {
-<a name="l00185"></a>00185         cpl_msg_error(cpl_func, 
-<a name="l00186"></a>00186                       <span class="stringliteral">"Null parameter list"</span>);
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> 1;
-<a name="l00188"></a>00188     }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a>(recipe->frames,
-<a name="l00191"></a>00191                <a class="code" href="group__fors__img__screen__flat.html#gc5ff969a1df38b9da80ab308f823132d">fors_img_screen_flat_description_short</a>);
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <a class="code" href="group__fors__img__screen__flat.html#g6ada02347c7648aaa61ce6bc000910e5">fors_img_screen_flat</a>(recipe->frames, recipe->parameters);
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a>(recipe->frames, initial_errorstate);
-<a name="l00196"></a>00196 }
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 
-<a name="l00207"></a><a class="code" href="group__fors__img__screen__flat.html#g4ee16c004f65246f0c474d1c4f5516a8">00207</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#g4ee16c004f65246f0c474d1c4f5516a8">fors_img_screen_flat_destroy</a>(cpl_plugin *plugin)
-<a name="l00208"></a>00208 {
-<a name="l00209"></a>00209     cpl_recipe *recipe;
-<a name="l00210"></a>00210     
-<a name="l00211"></a>00211     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00212"></a>00212         recipe = (cpl_recipe *)plugin;
-<a name="l00213"></a>00213     }
-<a name="l00214"></a>00214     <span class="keywordflow">else</span> {
-<a name="l00215"></a>00215         <span class="keywordflow">return</span> -1;
-<a name="l00216"></a>00216     }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     <span class="keywordflow">return</span> 0;
-<a name="l00221"></a>00221 }
-<a name="l00222"></a>00222 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__screen__flat_8c_source.html b/html/fors__img__screen__flat_8c_source.html
new file mode 100644
index 0000000..8e9b775
--- /dev/null
+++ b/html/fors__img__screen__flat_8c_source.html
@@ -0,0 +1,237 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_screen_flat.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_screen_flat.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_screen_flat.c,v 1.8 2011-10-12 15:00:51 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-12 15:00:51 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_img_screen_flat_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#gaaf1392d5e4fd8d016322a38b2bc1131a" title="Setup the recipe options.">fors_img_screen_flat_create</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#ga4a8a4add6fd2c7f1300789425e079bce" title="Execute the plugin instance given by the interface.">fors_img_screen_flat_exec</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#ga0867be809872f262200c7562c3eb0cee" title="Destroy what has been created by the 'create' function.">fors_img_screen_flat_destroy</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">   62</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>())</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     {</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>               <span class="stringliteral">"I am fors_img_screen_flat version %d, but I am linking "</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>               <span class="stringliteral">"against the FORS library version %d. "</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>               <span class="stringliteral">"This will not work. "</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>               <span class="stringliteral">"Please remove all previous installations "</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>());</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     }</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                     fors_img_screen_flat_name,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                     fors_img_screen_flat_description_short,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     fors_img_screen_flat_description,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                     fors_img_screen_flat_author,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                     fors_img_screen_flat_email,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     <a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87" title="Get the pipeline copyright and license.">fors_get_license</a>(),</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     <a class="code" href="group__fors__img__screen__flat.html#gaaf1392d5e4fd8d016322a38b2bc1131a" title="Setup the recipe options.">fors_img_screen_flat_create</a>,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     <a class="code" href="group__fors__img__screen__flat.html#ga4a8a4add6fd2c7f1300789425e079bce" title="Execute the plugin instance given by the interface.">fors_img_screen_flat_exec</a>,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <a class="code" href="group__fors__img__screen__flat.html#ga0867be809872f262200c7562c3eb0cee" title="Destroy what has been created by the 'create' function.">fors_img_screen_flat_destroy</a>);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> }</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat.html#gaaf1392d5e4fd8d016322a38b2bc1131a">  109</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#gaaf1392d5e4fd8d016322a38b2bc1131a" title="Setup the recipe options.">fors_img_screen_flat_create</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                       <span class="stringliteral">"refusing to create recipe fors_img_screen_flat"</span>, </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     }</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     }</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <a class="code" href="group__fors__img__screen__flat.html#ga19e0710196db92a992d5c1502c35a5f0" title="Define recipe parameters.">fors_img_screen_flat_define_parameters</a>(recipe->parameters);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                       <span class="stringliteral">"Could not create fors_img_screen_flat parameters"</span>);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     }</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> }</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat.html#ga4a8a4add6fd2c7f1300789425e079bce">  158</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#ga4a8a4add6fd2c7f1300789425e079bce" title="Execute the plugin instance given by the interface.">fors_img_screen_flat_exec</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> {</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_errorstate initial_errorstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                       <span class="stringliteral">"refusing to execute recipe fors_img_screen_flat"</span>, </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">if</span> (recipe->frames == NULL) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                       <span class="stringliteral">"Null frameset"</span>);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     }</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL) {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                       <span class="stringliteral">"Null parameter list"</span>);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce" title="Start recipe execution.">fors_begin</a>(recipe->frames,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                fors_img_screen_flat_description_short);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <a class="code" href="group__fors__img__screen__flat.html#gad6f0f603eedc00271082e6dae9dbd2a6" title="Do the processing.">fors_img_screen_flat</a>(recipe->frames, recipe->parameters);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9" title="End recipe execution.">fors_end</a>(recipe->frames, initial_errorstate);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> }</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat.html#ga0867be809872f262200c7562c3eb0cee">  207</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__screen__flat.html#ga0867be809872f262200c7562c3eb0cee" title="Destroy what has been created by the 'create' function.">fors_img_screen_flat_destroy</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> {</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     }</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> }</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__screen__flat__impl_8c-source.html b/html/fors__img__screen__flat__impl_8c-source.html
deleted file mode 100644
index 1aec8c1..0000000
--- a/html/fors__img__screen__flat__impl_8c-source.html
+++ /dev/null
@@ -1,854 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_screen_flat_impl.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_img_screen_flat_impl.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_screen_flat_impl.c,v 1.43 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.43 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_img_screen_flat_impl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_stack.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_tools.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <math.h></span>
-<a name="l00042"></a>00042 
-<a name="l00049"></a><a class="code" href="group__fors__img__screen__flat.html#g9423928a6bbf5fa7d8ca95661ced4d1e">00049</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__screen__flat.html#g9423928a6bbf5fa7d8ca95661ced4d1e">fors_img_screen_flat_name</a> = <span class="stringliteral">"fors_img_screen_flat"</span>;
-<a name="l00050"></a><a class="code" href="group__fors__img__screen__flat.html#gc5ff969a1df38b9da80ab308f823132d">00050</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__screen__flat.html#gc5ff969a1df38b9da80ab308f823132d">fors_img_screen_flat_description_short</a> = 
-<a name="l00051"></a>00051 <span class="stringliteral">"Compute master screen flat frame"</span>;
-<a name="l00052"></a><a class="code" href="group__fors__img__screen__flat.html#ge5a540ddd41737890da74f817765cefd">00052</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__screen__flat.html#ge5a540ddd41737890da74f817765cefd">fors_img_screen_flat_author</a> = <span class="stringliteral">"Jonas M. Larsen"</span>;
-<a name="l00053"></a><a class="code" href="group__fors__img__screen__flat.html#g9713c3ac85f9ad32781dd22fcd81775f">00053</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__screen__flat.html#g9713c3ac85f9ad32781dd22fcd81775f">fors_img_screen_flat_email</a> = PACKAGE_BUGREPORT;
-<a name="l00054"></a><a class="code" href="group__fors__img__screen__flat.html#g584ddcde63f204f4110497cab0e49075">00054</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__screen__flat.html#g584ddcde63f204f4110497cab0e49075">fors_img_screen_flat_description</a> = 
-<a name="l00055"></a>00055 <span class="stringliteral">"After bias subtraction, the input flat field frames are combined using\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"the given stack method. The combined frame is finally normalised dividing\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"it by its large scale illumination trend. The large scale trend is obtained\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"by applying a median filter with a large kernel. To avoid boundary effects, \n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"the median filter is applied only to the specified region.\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"The overscan regions, if present, are removed from the result.\n\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"Input files:\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  SCREEN_FLAT_IMG            Raw         Screen flat field    Y\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  MASTER_BIAS                Raw         Master bias          Y\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  MASTER_SCREEN_FLAT_IMG     FITS image  Master screen flat field\n"</span>;
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00073"></a>00073 <a class="code" href="group__fors__img__screen__flat.html#g75a60ee291780e6bbaeeb68313c112f0">remove_large_scale</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *master_screen_flat,
-<a name="l00074"></a>00074                    <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00075"></a>00075                    <span class="keyword">const</span> <span class="keywordtype">char</span> *context,
-<a name="l00076"></a>00076                    <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting);
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00079"></a>00079 <a class="code" href="group__fors__img__screen__flat.html#g34064d266d0016050844a2e2c9e1a59c">remove_large_scale_fit</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *master_screen_flat,
-<a name="l00080"></a>00080                        <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00081"></a>00081                        <span class="keyword">const</span> <span class="keywordtype">char</span> *context,
-<a name="l00082"></a>00082                        <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting);
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00085"></a>00085 <a class="code" href="group__fors__bias.html#g118f4ff4db4251491395cec26f300577">write_qc</a>(cpl_propertylist *qc, 
-<a name="l00086"></a>00086          <span class="keyword">const</span> cpl_frame *first_raw,
-<a name="l00087"></a>00087          <span class="keyword">const</span> fors_image_list *sflats, 
-<a name="l00088"></a>00088          <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_sflat,
-<a name="l00089"></a>00089          <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00090"></a>00090          <span class="keywordtype">double</span> saturation);
-<a name="l00096"></a><a class="code" href="group__fors__img__screen__flat.html#g8bd60f1e1c99dff8aa58da8d21eeeb02">00096</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__screen__flat.html#g8bd60f1e1c99dff8aa58da8d21eeeb02">fors_img_screen_flat_define_parameters</a>(cpl_parameterlist *parameters)
-<a name="l00097"></a>00097 {
-<a name="l00098"></a>00098     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__img__screen__flat.html#g9423928a6bbf5fa7d8ca95661ced4d1e">fors_img_screen_flat_name</a>);
-<a name="l00099"></a>00099     <span class="keyword">const</span> <span class="keywordtype">char</span> *full_name = NULL;
-<a name="l00100"></a>00100     
-<a name="l00101"></a>00101     <a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a>(parameters, context, <span class="stringliteral">"average"</span>);
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103     {
-<a name="l00104"></a>00104         cpl_parameter *p;
-<a name="l00105"></a>00105         <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
-<a name="l00106"></a>00106         
-<a name="l00107"></a>00107         <span class="comment">/* Median filter, xradius, yradius */</span>
-<a name="l00108"></a>00108         name = <span class="stringliteral">"xradius"</span>;
-<a name="l00109"></a>00109         full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00110"></a>00110         p = cpl_parameter_new_value(full_name,
-<a name="l00111"></a>00111                                     CPL_TYPE_INT,
-<a name="l00112"></a>00112                                     <span class="stringliteral">"Median filter x radius (unbinned pixels)"</span>,
-<a name="l00113"></a>00113                                     context,
-<a name="l00114"></a>00114                                     50);
-<a name="l00115"></a>00115         cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00116"></a>00116         cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00117"></a>00117         cpl_parameterlist_append(parameters, p);
-<a name="l00118"></a>00118         cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00119"></a>00119         
-<a name="l00120"></a>00120         name = <span class="stringliteral">"yradius"</span>;
-<a name="l00121"></a>00121         full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00122"></a>00122         p = cpl_parameter_new_value(full_name,
-<a name="l00123"></a>00123                                     CPL_TYPE_INT,
-<a name="l00124"></a>00124                                     <span class="stringliteral">"Median filter y radius (unbinned pixels)"</span>,
-<a name="l00125"></a>00125                                     context,
-<a name="l00126"></a>00126                                     50);
-<a name="l00127"></a>00127         cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00128"></a>00128         cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00129"></a>00129         cpl_parameterlist_append(parameters, p);
-<a name="l00130"></a>00130         cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132         name = <span class="stringliteral">"degree"</span>;
-<a name="l00133"></a>00133         full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00134"></a>00134         p = cpl_parameter_new_value(full_name,
-<a name="l00135"></a>00135                                     CPL_TYPE_INT,
-<a name="l00136"></a>00136                                     <span class="stringliteral">"Degree of fitting polynomial"</span>,
-<a name="l00137"></a>00137                                     context,
-<a name="l00138"></a>00138                                     -1);
-<a name="l00139"></a>00139         cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00140"></a>00140         cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00141"></a>00141         cpl_parameterlist_append(parameters, p);
-<a name="l00142"></a>00142         cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00143"></a>00143 
-<a name="l00144"></a>00144         name = <span class="stringliteral">"sampling"</span>;
-<a name="l00145"></a>00145         full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00146"></a>00146         p = cpl_parameter_new_value(full_name,
-<a name="l00147"></a>00147                                     CPL_TYPE_INT,
-<a name="l00148"></a>00148                                     <span class="stringliteral">"Sampling interval for fitting"</span>,
-<a name="l00149"></a>00149                                     context,
-<a name="l00150"></a>00150                                     100);
-<a name="l00151"></a>00151         cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00152"></a>00152         cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00153"></a>00153         cpl_parameterlist_append(parameters, p);
-<a name="l00154"></a>00154         cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00155"></a>00155     }
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157     cpl_free((<span class="keywordtype">void</span> *)context);
-<a name="l00158"></a>00158     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00159"></a>00159 
-<a name="l00160"></a>00160     <span class="keywordflow">return</span>;
-<a name="l00161"></a>00161 }
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163 <span class="preprocessor">#undef cleanup</span>
-<a name="l00164"></a>00164 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00165"></a>00165 <span class="preprocessor">do { \</span>
-<a name="l00166"></a>00166 <span class="preprocessor">    cpl_frameset_delete(sflat_frames); \</span>
-<a name="l00167"></a>00167 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00168"></a>00168 <span class="preprocessor">    cpl_frameset_delete(master_bias_frame); \</span>
-<a name="l00169"></a>00169 <span class="preprocessor">    fors_image_delete_const(&master_bias); \</span>
-<a name="l00170"></a>00170 <span class="preprocessor">    fors_stack_method_delete(&sm); \</span>
-<a name="l00171"></a>00171 <span class="preprocessor">    cpl_free((void *)context); \</span>
-<a name="l00172"></a>00172 <span class="preprocessor">    fors_image_delete(&master_screen_flat); \</span>
-<a name="l00173"></a>00173 <span class="preprocessor">    fors_image_delete(&master_norm_flat); \</span>
-<a name="l00174"></a>00174 <span class="preprocessor">    fors_image_list_delete_const(&sflats, fors_image_delete); \</span>
-<a name="l00175"></a>00175 <span class="preprocessor">    cpl_propertylist_delete(qc); \</span>
-<a name="l00176"></a>00176 <span class="preprocessor">} while (0)</span>
-<a name="l00177"></a>00177 <span class="preprocessor"></span>
-<a name="l00185"></a>00185 <span class="keywordtype">void</span>
-<a name="l00186"></a><a class="code" href="group__fors__img__screen__flat.html#g6ada02347c7648aaa61ce6bc000910e5">00186</a> <a class="code" href="group__fors__img__screen__flat.html#g6ada02347c7648aaa61ce6bc000910e5">fors_img_screen_flat</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)
-<a name="l00187"></a>00187 {
-<a name="l00188"></a>00188     <span class="comment">/* Raw */</span>
-<a name="l00189"></a>00189     cpl_frameset *sflat_frames      = NULL;
-<a name="l00190"></a>00190     <span class="keyword">const</span> fors_image_list *sflats   = NULL;
-<a name="l00191"></a>00191     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting           = NULL;
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <span class="comment">/* Calibration */</span>
-<a name="l00194"></a>00194     cpl_frameset *master_bias_frame = NULL;
-<a name="l00195"></a>00195     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias   = NULL; 
-<a name="l00196"></a>00196 
-<a name="l00197"></a>00197     <span class="comment">/* Products */</span>
-<a name="l00198"></a>00198     <a class="code" href="struct__fors__image.html">fors_image</a> *master_screen_flat = NULL;
-<a name="l00199"></a>00199     <a class="code" href="struct__fors__image.html">fors_image</a> *master_norm_flat   = NULL;
-<a name="l00200"></a>00200     
-<a name="l00201"></a>00201     <span class="comment">/* QC */</span>
-<a name="l00202"></a>00202     cpl_propertylist *qc = cpl_propertylist_new();
-<a name="l00203"></a>00203     <span class="keywordtype">double</span> saturation;
-<a name="l00204"></a>00204 
-<a name="l00205"></a>00205     <span class="comment">/* Parameters */</span>
-<a name="l00206"></a>00206     stack_method *sm = NULL;
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208     <span class="comment">/* Other */</span>
-<a name="l00209"></a>00209     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__img__screen__flat.html#g9423928a6bbf5fa7d8ca95661ced4d1e">fors_img_screen_flat_name</a>);
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211     <span class="comment">/* Get parameters */</span>
-<a name="l00212"></a>00212     sm = <a class="code" href="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af">fors_stack_method_new</a>(parameters, context);
-<a name="l00213"></a>00213     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get stacking method"</span>);
-<a name="l00214"></a>00214     
-<a name="l00215"></a>00215     <span class="comment">/* Find raw */</span>
-<a name="l00216"></a>00216     sflat_frames = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, SCREEN_FLAT_IMG);
-<a name="l00217"></a>00217     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(sflat_frames) > 0, <span class="keywordflow">return</span>, 
-<a name="l00218"></a>00218             <span class="stringliteral">"No %s provided"</span>, SCREEN_FLAT_IMG);
-<a name="l00219"></a>00219     
-<a name="l00220"></a>00220     <span class="comment">/* Find calibration */</span>
-<a name="l00221"></a>00221     master_bias_frame = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, MASTER_BIAS);
-<a name="l00222"></a>00222     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(master_bias_frame) == 1, <span class="keywordflow">return</span>, 
-<a name="l00223"></a>00223             <span class="stringliteral">"One %s required. %d found"</span>, 
-<a name="l00224"></a>00224             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame));
-<a name="l00225"></a>00225     
-<a name="l00226"></a>00226     <span class="comment">/* Get instrument setting */</span>
-<a name="l00227"></a>00227     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_get_first(sflat_frames));
-<a name="l00228"></a>00228     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230     master_bias = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(cpl_frameset_get_first(master_bias_frame), 
-<a name="l00231"></a>00231                                   NULL, setting, NULL);
-<a name="l00232"></a>00232     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00233"></a>00233             <span class="stringliteral">"Could not load master bias"</span>);
-<a name="l00234"></a>00234 
-<a name="l00235"></a>00235     <span class="comment">/* Load raw frames, subtract bias */</span>
-<a name="l00236"></a>00236     sflats = <a class="code" href="group__fors__image.html#gab0a6629f36c4db609f1a1515d602477">fors_image_load_list_const</a>(sflat_frames, master_bias, 
-<a name="l00237"></a>00237                                         setting, &saturation);
-<a name="l00238"></a>00238     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load screen flat images"</span>);
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240     <span class="comment">/* Stack */</span>
-<a name="l00241"></a>00241     master_screen_flat = <a class="code" href="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac">fors_stack_const</a>(sflats, sm);
-<a name="l00242"></a>00242     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Screen flat stacking failed"</span>);
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     <span class="comment">/* Divide out large scale structure */</span>
-<a name="l00245"></a>00245     master_norm_flat = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(master_screen_flat);
-<a name="l00246"></a>00246     <a class="code" href="group__fors__img__screen__flat.html#g75a60ee291780e6bbaeeb68313c112f0">remove_large_scale</a>(master_norm_flat,
-<a name="l00247"></a>00247                        parameters, context,
-<a name="l00248"></a>00248                        setting);
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00251"></a>00251             <span class="stringliteral">"Flat field smoothing/normalization failed"</span>);
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253     <span class="comment">/* QC */</span>
-<a name="l00254"></a>00254     <a class="code" href="group__fors__bias.html#g118f4ff4db4251491395cec26f300577">write_qc</a>(qc, cpl_frameset_get_first(sflat_frames),
-<a name="l00255"></a>00255              sflats, master_norm_flat, setting, saturation);
-<a name="l00256"></a>00256     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Failed to compute QC"</span>);
-<a name="l00257"></a>00257 
-<a name="l00258"></a>00258     <span class="comment">/* Save products */</span>
-<a name="l00259"></a>00259     <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, master_screen_flat, MASTER_SCREEN_FLAT_IMG,
-<a name="l00260"></a>00260                         NULL, parameters, <a class="code" href="group__fors__img__screen__flat.html#g9423928a6bbf5fa7d8ca95661ced4d1e">fors_img_screen_flat_name</a>, 
-<a name="l00261"></a>00261                         cpl_frameset_get_first(sflat_frames));
-<a name="l00262"></a>00262     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00263"></a>00263             MASTER_SCREEN_FLAT_IMG);
-<a name="l00264"></a>00264     
-<a name="l00265"></a>00265     <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, master_norm_flat, MASTER_NORM_FLAT_IMG,
-<a name="l00266"></a>00266                         qc, parameters, <a class="code" href="group__fors__img__screen__flat.html#g9423928a6bbf5fa7d8ca95661ced4d1e">fors_img_screen_flat_name</a>, 
-<a name="l00267"></a>00267                         cpl_frameset_get_first(sflat_frames));
-<a name="l00268"></a>00268     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00269"></a>00269             MASTER_NORM_FLAT_IMG);
-<a name="l00270"></a>00270     
-<a name="l00271"></a>00271     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00272"></a>00272     <span class="keywordflow">return</span>;
-<a name="l00273"></a>00273 }
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275 <span class="preprocessor">#undef cleanup</span>
-<a name="l00276"></a>00276 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00277"></a>00277 <span class="preprocessor">do { \</span>
-<a name="l00278"></a>00278 <span class="preprocessor">    cpl_image_delete(smoothed); \</span>
-<a name="l00279"></a>00279 <span class="preprocessor">} while (0)</span>
-<a name="l00280"></a>00280 <span class="preprocessor"></span>
-<a name="l00298"></a>00298 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00299"></a><a class="code" href="group__fors__img__screen__flat.html#g75a60ee291780e6bbaeeb68313c112f0">00299</a> <a class="code" href="group__fors__img__screen__flat.html#g75a60ee291780e6bbaeeb68313c112f0">remove_large_scale</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *master_screen_flat,
-<a name="l00300"></a>00300                    <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00301"></a>00301                    <span class="keyword">const</span> <span class="keywordtype">char</span> *context,
-<a name="l00302"></a>00302                    <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting)
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304 {
-<a name="l00305"></a>00305     cpl_image *smoothed = NULL;
-<a name="l00306"></a>00306     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
-<a name="l00307"></a>00307     <span class="keywordtype">int</span> xradius, yradius;
-<a name="l00308"></a>00308     <span class="keywordtype">int</span> xstart, ystart;
-<a name="l00309"></a>00309     <span class="keywordtype">int</span> xend, yend;
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"degree"</span>);
-<a name="l00312"></a>00312     <span class="keyword">const</span> cpl_parameter *param = cpl_parameterlist_find_const(parameters, name);
-<a name="l00313"></a>00313     <span class="keywordtype">int</span> degree = cpl_parameter_get_int(param);
-<a name="l00314"></a>00314     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00315"></a>00315     <span class="keywordflow">if</span> (degree >= 0) {
-<a name="l00316"></a>00316         <a class="code" href="group__fors__img__screen__flat.html#g34064d266d0016050844a2e2c9e1a59c">remove_large_scale_fit</a>(master_screen_flat, parameters, context,
-<a name="l00317"></a>00317                                setting);
-<a name="l00318"></a>00318         <span class="keywordflow">return</span>;
-<a name="l00319"></a>00319     }
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321     cpl_msg_info(cpl_func, <span class="stringliteral">"Median filter parameters:"</span>);
-<a name="l00322"></a>00322     
-<a name="l00323"></a>00323     cpl_msg_indent_more();
-<a name="l00324"></a>00324     cpl_msg_indent_more();
-<a name="l00325"></a>00325     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"xradius"</span>);
-<a name="l00326"></a>00326     xradius = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parameters, 
-<a name="l00327"></a>00327                                           name);
-<a name="l00328"></a>00328     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00329"></a>00329     cpl_msg_indent_less();
-<a name="l00330"></a>00330     cpl_msg_indent_less();
-<a name="l00331"></a>00331     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00332"></a>00332     
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     cpl_msg_indent_more();
-<a name="l00335"></a>00335     cpl_msg_indent_more();
-<a name="l00336"></a>00336     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"yradius"</span>);
-<a name="l00337"></a>00337     yradius = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parameters, 
-<a name="l00338"></a>00338                                           name);
-<a name="l00339"></a>00339     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00340"></a>00340     cpl_msg_indent_less();
-<a name="l00341"></a>00341     cpl_msg_indent_less();
-<a name="l00342"></a>00342     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00343"></a>00343     
-<a name="l00344"></a>00344     <span class="comment">/* Done reading parameters, apply filter */</span>
-<a name="l00345"></a>00345     <span class="keywordtype">bool</span> use_data = <span class="keyword">true</span>;  <span class="comment">/* Filter the data values, not error bars */</span>
-<a name="l00346"></a>00346 
-<a name="l00347"></a>00347     <span class="comment">/* Correct for CCD binning */</span>
-<a name="l00348"></a>00348     xradius = (xradius - 1)/setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a> + 1;
-<a name="l00349"></a>00349     yradius = (yradius - 1)/setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a> + 1;
-<a name="l00350"></a>00350     xstart = 1;
-<a name="l00351"></a>00351     ystart = 1;
-<a name="l00352"></a>00352     xend = <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(master_screen_flat);
-<a name="l00353"></a>00353     yend = <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(master_screen_flat);
-<a name="l00354"></a>00354     <span class="keywordtype">int</span> xstep = 1;
-<a name="l00355"></a>00355     <span class="keywordtype">int</span> ystep = 1;
-<a name="l00356"></a>00356 
-<a name="l00357"></a>00357     smoothed = <a class="code" href="group__fors__image.html#g96498be3e15cde80921709406c33b6f3">fors_image_filter_median_create</a>(master_screen_flat,
-<a name="l00358"></a>00358                                                xradius, yradius,
-<a name="l00359"></a>00359                                                xstart, ystart,
-<a name="l00360"></a>00360                                                xend, yend,
-<a name="l00361"></a>00361                                                xstep, ystep,
-<a name="l00362"></a>00362                                                use_data);
-<a name="l00363"></a>00363     
-<a name="l00364"></a>00364     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     <span class="keywordtype">int</span> DEBUG = 1;
-<a name="l00367"></a>00367     <span class="keywordflow">if</span> (DEBUG) {
-<a name="l00368"></a>00368         <span class="keyword">const</span> <span class="keywordtype">char</span> *filename = <span class="stringliteral">"smooth.fits"</span>;
-<a name="l00369"></a>00369 
-<a name="l00370"></a>00370         cpl_msg_info(cpl_func, <span class="stringliteral">"Saving large scale structure image to %s"</span>,
-<a name="l00371"></a>00371                      filename);
-<a name="l00372"></a>00372         cpl_image_save(smoothed, filename, CPL_BPP_IEEE_FLOAT,
-<a name="l00373"></a>00373                        NULL, CPL_IO_DEFAULT);
-<a name="l00374"></a>00374     }
-<a name="l00375"></a>00375     
-<a name="l00376"></a>00376     <a class="code" href="group__fors__image.html#g4c8774a9e651df6d05689d208fb349e1">fors_image_divide_noerr</a>(master_screen_flat, smoothed);
-<a name="l00377"></a>00377     <span class="comment">/* smoothed image modified here */</span>
-<a name="l00378"></a>00378 
-<a name="l00379"></a>00379     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00380"></a>00380     <span class="keywordflow">return</span>;
-<a name="l00381"></a>00381 }
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383 
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385 <span class="preprocessor">#undef cleanup</span>
-<a name="l00386"></a>00386 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00387"></a>00387 <span class="preprocessor">do { \</span>
-<a name="l00388"></a>00388 <span class="preprocessor">    cpl_image_delete(smoothed); \</span>
-<a name="l00389"></a>00389 <span class="preprocessor">} while (0)</span>
-<a name="l00390"></a>00390 <span class="preprocessor"></span>
-<a name="l00406"></a>00406 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00407"></a><a class="code" href="group__fors__img__screen__flat.html#g34064d266d0016050844a2e2c9e1a59c">00407</a> <a class="code" href="group__fors__img__screen__flat.html#g34064d266d0016050844a2e2c9e1a59c">remove_large_scale_fit</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *master_screen_flat,
-<a name="l00408"></a>00408                        <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00409"></a>00409                        <span class="keyword">const</span> <span class="keywordtype">char</span> *context,
-<a name="l00410"></a>00410                        <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting)
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412 {
-<a name="l00413"></a>00413     cpl_image *smoothed = NULL;
-<a name="l00414"></a>00414     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
-<a name="l00415"></a>00415     <span class="keywordtype">int</span> step;
-<a name="l00416"></a>00416     <span class="keywordtype">int</span> degree;
-<a name="l00417"></a>00417 
-<a name="l00418"></a>00418     cpl_msg_info(cpl_func, <span class="stringliteral">"Large scale fitting parameters:"</span>);
-<a name="l00419"></a>00419     
-<a name="l00420"></a>00420     cpl_msg_indent_more();
-<a name="l00421"></a>00421     cpl_msg_indent_more();
-<a name="l00422"></a>00422     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sampling"</span>);
-<a name="l00423"></a>00423     step = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parameters, 
-<a name="l00424"></a>00424                                        name);
-<a name="l00425"></a>00425     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00426"></a>00426     cpl_msg_indent_less();
-<a name="l00427"></a>00427     cpl_msg_indent_less();
-<a name="l00428"></a>00428     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00429"></a>00429 
-<a name="l00430"></a>00430     cpl_msg_indent_more();
-<a name="l00431"></a>00431     cpl_msg_indent_more();
-<a name="l00432"></a>00432     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"degree"</span>);
-<a name="l00433"></a>00433     degree = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parameters,
-<a name="l00434"></a>00434                                          name);
-<a name="l00435"></a>00435     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00436"></a>00436     cpl_msg_indent_less();
-<a name="l00437"></a>00437     cpl_msg_indent_less();
-<a name="l00438"></a>00438     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00439"></a>00439     
-<a name="l00440"></a>00440     <span class="comment">/*</span>
-<a name="l00441"></a>00441 <span class="comment">     * Determine typical level of flat field, that will be used to</span>
-<a name="l00442"></a>00442 <span class="comment">     * avoid fitting values from the vignetted region.</span>
-<a name="l00443"></a>00443 <span class="comment">     */</span>
-<a name="l00444"></a>00444 
-<a name="l00445"></a>00445     <span class="keywordtype">float</span> level = <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(master_screen_flat, NULL) / 2;
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447     smoothed = <a class="code" href="group__fors__image.html#g0a3e3ddaf982b76fc92d9daf7e32059a">fors_image_flat_fit_create</a>(master_screen_flat,
-<a name="l00448"></a>00448                                           step, degree, level);
-<a name="l00449"></a>00449     
-<a name="l00450"></a>00450     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452     <span class="keywordtype">int</span> DEBUG = 1;
-<a name="l00453"></a>00453     <span class="keywordflow">if</span> (DEBUG) {
-<a name="l00454"></a>00454         <span class="keyword">const</span> <span class="keywordtype">char</span> *filename = <span class="stringliteral">"smooth.fits"</span>;
-<a name="l00455"></a>00455 
-<a name="l00456"></a>00456         cpl_msg_info(cpl_func, <span class="stringliteral">"Saving large scale structure image to %s"</span>,
-<a name="l00457"></a>00457                      filename);
-<a name="l00458"></a>00458         cpl_image_save(smoothed, filename, CPL_BPP_IEEE_FLOAT,
-<a name="l00459"></a>00459                        NULL, CPL_IO_DEFAULT);
-<a name="l00460"></a>00460     }
-<a name="l00461"></a>00461     
-<a name="l00462"></a>00462     <a class="code" href="group__fors__image.html#g4c8774a9e651df6d05689d208fb349e1">fors_image_divide_noerr</a>(master_screen_flat, smoothed);
-<a name="l00463"></a>00463     <span class="comment">/* smoothed image modified here */</span>
-<a name="l00464"></a>00464 
-<a name="l00465"></a>00465     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00466"></a>00466     <span class="keywordflow">return</span>;
-<a name="l00467"></a>00467 }
-<a name="l00468"></a>00468 
-<a name="l00469"></a>00469 
-<a name="l00470"></a>00470 
-<a name="l00471"></a>00471 <span class="preprocessor">#undef cleanup</span>
-<a name="l00472"></a><a class="code" href="group__fors__img__screen__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343">00472</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00473"></a>00473 <span class="preprocessor">do { \</span>
-<a name="l00474"></a>00474 <span class="preprocessor">    fors_image_delete(&image); \</span>
-<a name="l00475"></a>00475 <span class="preprocessor">} while (0)</span>
-<a name="l00476"></a>00476 <span class="preprocessor"></span>
-<a name="l00484"></a>00484 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00485"></a><a class="code" href="group__fors__img__screen__flat.html#gff8fa4d76051acfba7263b22a5bc06c3">00485</a> <a class="code" href="group__fors__bias.html#g118f4ff4db4251491395cec26f300577">write_qc</a>(cpl_propertylist *qc, 
-<a name="l00486"></a>00486          <span class="keyword">const</span> cpl_frame *first_raw_frame,
-<a name="l00487"></a>00487          <span class="keyword">const</span> fors_image_list *sflats, 
-<a name="l00488"></a>00488          <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_sflat,
-<a name="l00489"></a>00489          <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00490"></a>00490          <span class="keywordtype">double</span> saturation)
-<a name="l00491"></a>00491 {
-<a name="l00492"></a>00492     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494     <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qc, <a class="code" href="group__forsqc.html#gf875be6d318687206fdb50a7c61b7924">fors_qc_dic_version</a>, setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00495"></a>00495 
-<a name="l00496"></a>00496     <a class="code" href="group__forsqc.html#g1ccea526719a1be6c14de81963d81955">fors_qc_write_group_heading</a>(first_raw_frame,
-<a name="l00497"></a>00497                                 MASTER_SCREEN_FLAT_IMG,
-<a name="l00498"></a>00498                                 setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00499"></a>00499     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not write %s QC parameters"</span>, 
-<a name="l00500"></a>00500             MASTER_SCREEN_FLAT_IMG);
-<a name="l00501"></a>00501 
-<a name="l00502"></a>00502 
-<a name="l00503"></a>00503 
-<a name="l00504"></a>00504     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00505"></a>00505                             saturation,
-<a name="l00506"></a>00506                             <span class="stringliteral">"QC.OVEREXPO"</span>,
-<a name="l00507"></a>00507                             <span class="stringliteral">"%"</span>,
-<a name="l00508"></a>00508                             <span class="stringliteral">"Percentage of overexposed pixels"</span>,
-<a name="l00509"></a>00509                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511     <span class="comment">/* </span>
-<a name="l00512"></a>00512 <span class="comment">     * Second_raw is NULL if only one raw frame provided:</span>
-<a name="l00513"></a>00513 <span class="comment">     */</span>
-<a name="l00514"></a>00514 
-<a name="l00515"></a>00515     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *first_raw = fors_image_list_first_const(sflats);
-<a name="l00516"></a>00516     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *second_raw = fors_image_list_next_const(sflats); 
-<a name="l00517"></a>00517         
-<a name="l00518"></a>00518     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00519"></a>00519                             <span class="comment">/* Median of bias subtracted frame */</span>
-<a name="l00520"></a>00520                             <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(first_raw, NULL)
-<a name="l00521"></a>00521                             / setting-><a class="code" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">exposure_time</a>,
-<a name="l00522"></a>00522                             <span class="stringliteral">"QC.FLAT.EFF"</span>,
-<a name="l00523"></a>00523                             <span class="stringliteral">"ADU/s"</span>,
-<a name="l00524"></a>00524                             <span class="stringliteral">"Flat field lamp efficiency"</span>,
-<a name="l00525"></a>00525                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00526"></a>00526 
-<a name="l00527"></a>00527 
-<a name="l00528"></a>00528     <span class="comment">/*</span>
-<a name="l00529"></a>00529 <span class="comment">     * Here compute QC.FLAT.PHN and QC.FLAT.CONAD:</span>
-<a name="l00530"></a>00530 <span class="comment">     */</span>
-<a name="l00531"></a>00531 
-<a name="l00532"></a>00532     <span class="keywordtype">double</span> master_photon_noise;
-<a name="l00533"></a>00533     <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>, conad_err;
-<a name="l00534"></a>00534 
-<a name="l00535"></a>00535     <span class="comment">/* FIXME: </span>
-<a name="l00536"></a>00536 <span class="comment">     * Here in principle we should use the propagated errors to get</span>
-<a name="l00537"></a>00537 <span class="comment">     * the master flat photon noise, instead of computing it all over</span>
-<a name="l00538"></a>00538 <span class="comment">     * again...</span>
-<a name="l00539"></a>00539 <span class="comment">     */</span>
-<a name="l00540"></a>00540 
-<a name="l00541"></a>00541     <span class="keywordflow">if</span> (second_raw != NULL) {
-<a name="l00542"></a>00542             
-<a name="l00543"></a>00543         <span class="comment">/* </span>
-<a name="l00544"></a>00544 <span class="comment">         * Use central 101x101 window of difference frame </span>
-<a name="l00545"></a>00545 <span class="comment">         */</span>
-<a name="l00546"></a>00546 
-<a name="l00547"></a>00547         <span class="keywordflow">if</span> (<a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(second_raw) >= 101 &&
-<a name="l00548"></a>00548             <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(second_raw) >= 101) {
-<a name="l00549"></a>00549 
-<a name="l00550"></a>00550             <a class="code" href="struct__fors__image.html">fors_image</a> *center_first = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(first_raw);
-<a name="l00551"></a>00551             <a class="code" href="struct__fors__image.html">fors_image</a> *center_second = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(second_raw);
-<a name="l00552"></a>00552                 
-<a name="l00553"></a>00553             <span class="keywordtype">int</span> mid_x = (<a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(center_first) + 1) / 2;
-<a name="l00554"></a>00554             <span class="keywordtype">int</span> mid_y = (<a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(center_first) + 1) / 2;
-<a name="l00555"></a>00555 
-<a name="l00556"></a>00556             <a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a>(center_first, 
-<a name="l00557"></a>00557                             mid_x - 50, mid_y - 50,
-<a name="l00558"></a>00558                             mid_x + 50, mid_y + 50);
-<a name="l00559"></a>00559 
-<a name="l00560"></a>00560             <a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a>(center_second, 
-<a name="l00561"></a>00561                             mid_x - 50, mid_y - 50,
-<a name="l00562"></a>00562                             mid_x + 50, mid_y + 50);
-<a name="l00563"></a>00563 
-<a name="l00564"></a>00564             <span class="comment">/*</span>
-<a name="l00565"></a>00565 <span class="comment">             * This one is the intensity image, will be used later</span>
-<a name="l00566"></a>00566 <span class="comment">             * for gain computation</span>
-<a name="l00567"></a>00567 <span class="comment">             */</span>
-<a name="l00568"></a>00568 
-<a name="l00569"></a>00569             image = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(center_first);
-<a name="l00570"></a>00570 
-<a name="l00571"></a>00571             <span class="comment">/*</span>
-<a name="l00572"></a>00572 <span class="comment">             * 1) Determine the median value of the ratio  F1/F2 = k .</span>
-<a name="l00573"></a>00573 <span class="comment">             * 2) Compute the frame  F1 - k*F2 (whose mean should be</span>
-<a name="l00574"></a>00574 <span class="comment">             *    around 0).</span>
-<a name="l00575"></a>00575 <span class="comment">             * 3) The expected variance of  F1 - k*F2  is  V = V1 + k*k*V2,</span>
-<a name="l00576"></a>00576 <span class="comment">             *    where V1 and V2 are the variances of the frames F1 and F2.</span>
-<a name="l00577"></a>00577 <span class="comment">             * 4) Neglecting the contribution of the readout noise, it is  </span>
-<a name="l00578"></a>00578 <span class="comment">             *    V1 = F1/conad  and  V2 = F2/conad, so it is also V1/V2 = k .</span>
-<a name="l00579"></a>00579 <span class="comment">             * 5) Therefore we get V = V1 + k*V1, that is   V1 = V/(1+k),</span>
-<a name="l00580"></a>00580 <span class="comment">             *    an estimator of the variance of the first frame.</span>
-<a name="l00581"></a>00581 <span class="comment">             * 6) The noise (1-sigma level) of the first frame is then</span>
-<a name="l00582"></a>00582 <span class="comment">             *    sqrt(V1) = sqrt(V)/sqrt(1+k).</span>
-<a name="l00583"></a>00583 <span class="comment">             */</span>
-<a name="l00584"></a>00584 
-<a name="l00585"></a>00585             <span class="comment">/* 1) */</span>
-<a name="l00586"></a>00586             <a class="code" href="struct__fors__image.html">fors_image</a> *ratio = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(center_first);
-<a name="l00587"></a>00587             <a class="code" href="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4">fors_image_divide</a>(ratio, center_second);
-<a name="l00588"></a>00588             <span class="keywordtype">double</span> k = <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(ratio, NULL);
-<a name="l00589"></a>00589             <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&ratio);
-<a name="l00590"></a>00590 
-<a name="l00591"></a>00591             <span class="comment">/* 2) */</span>
-<a name="l00592"></a>00592             <a class="code" href="group__fors__image.html#g077f7a5a847fa9c0e458dca2e12e4e6f">fors_image_multiply_scalar</a>(center_second, k, -1);
-<a name="l00593"></a>00593             <a class="code" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">fors_image_subtract</a>(center_first, center_second);
-<a name="l00594"></a>00594             <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&center_second);
-<a name="l00595"></a>00595 
-<a name="l00596"></a>00596             <span class="comment">/* 6) */</span>
-<a name="l00597"></a>00597             master_photon_noise = <a class="code" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">fors_image_get_stdev</a>(center_first, NULL);
-<a name="l00598"></a>00598             master_photon_noise /= sqrt(1+k);
-<a name="l00599"></a>00599 
-<a name="l00600"></a>00600             <span class="comment">/*</span>
-<a name="l00601"></a>00601 <span class="comment">             * Now estimate the noise of all frames (assuming that all</span>
-<a name="l00602"></a>00602 <span class="comment">             * frames have similar exposure times...)</span>
-<a name="l00603"></a>00603 <span class="comment">             */</span>
-<a name="l00604"></a>00604 
-<a name="l00605"></a>00605             master_photon_noise /= sqrt(fors_image_list_size(sflats));
-<a name="l00606"></a>00606 
-<a name="l00607"></a>00607             <span class="comment">/*</span>
-<a name="l00608"></a>00608 <span class="comment">             * Now center_first is used to determine the CONAD: the</span>
-<a name="l00609"></a>00609 <span class="comment">             * center_first is still to be squared and divided by (1+k) </span>
-<a name="l00610"></a>00610 <span class="comment">             * to become an estimator of the variance of the first frame.</span>
-<a name="l00611"></a>00611 <span class="comment">             *</span>
-<a name="l00612"></a>00612 <span class="comment">             * CONAD is estimated as 1 / mean(variance_i / flux_i)</span>
-<a name="l00613"></a>00613 <span class="comment">             *</span>
-<a name="l00614"></a>00614 <span class="comment">             * Note: It is important that the average is made using</span>
-<a name="l00615"></a>00615 <span class="comment">             * (variance_i / flux_i), and not using (flux_i / variance_i)</span>
-<a name="l00616"></a>00616 <span class="comment">             * because the variance estimates are very noisy and</span>
-<a name="l00617"></a>00617 <span class="comment">             * close to zero.</span>
-<a name="l00618"></a>00618 <span class="comment">             */</span>
-<a name="l00619"></a>00619 
-<a name="l00620"></a>00620             <a class="code" href="group__fors__image.html#g18f269421a43f46c063b667fac72c938">fors_image_square</a>(center_first);
-<a name="l00621"></a>00621             <a class="code" href="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4">fors_image_divide</a>(center_first, image);
-<a name="l00622"></a>00622 
-<a name="l00623"></a>00623             <span class="comment">/*</span>
-<a name="l00624"></a>00624 <span class="comment">             * We _must_ use mean, here, because the mean of the</span>
-<a name="l00625"></a>00625 <span class="comment">             * squares in center_first is an estimate of the variance,</span>
-<a name="l00626"></a>00626 <span class="comment">             * but the median is not (asymmetric distribution).</span>
-<a name="l00627"></a>00627 <span class="comment">             */</span>
-<a name="l00628"></a>00628 
-<a name="l00629"></a>00629             <span class="keywordtype">double</span> gain = <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(center_first, NULL) / (1+k);
-<a name="l00630"></a>00630             <span class="keywordtype">double</span> gain_err = <a class="code" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">fors_image_get_stdev</a>(center_first, NULL) / (1+k);
-<a name="l00631"></a>00631             <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&center_first);
-<a name="l00632"></a>00632             <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image);
-<a name="l00633"></a>00633 
-<a name="l00634"></a>00634             <span class="comment">/*</span>
-<a name="l00635"></a>00635 <span class="comment">             * Relative error in CONAD and GAIN is the same:</span>
-<a name="l00636"></a>00636 <span class="comment">             */</span>
-<a name="l00637"></a>00637 
-<a name="l00638"></a>00638             conad = 1.0 / gain;
-<a name="l00639"></a>00639             conad_err = conad * gain_err/gain;
-<a name="l00640"></a>00640             conad_err /= 101;
-<a name="l00641"></a>00641         }
-<a name="l00642"></a>00642         <span class="keywordflow">else</span> {
-<a name="l00643"></a>00643             cpl_msg_warning(cpl_func,
-<a name="l00644"></a>00644                             <span class="stringliteral">"Raw images too small (%dx%d), "</span>
-<a name="l00645"></a>00645                             <span class="stringliteral">"need size 101x101 to compute master flat "</span>
-<a name="l00646"></a>00646                             <span class="stringliteral">"photon noise and gain"</span>,
-<a name="l00647"></a>00647                             <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(second_raw),
-<a name="l00648"></a>00648                             <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(second_raw));
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650             master_photon_noise = -1;
-<a name="l00651"></a>00651         }
-<a name="l00652"></a>00652     }
-<a name="l00653"></a>00653     <span class="keywordflow">else</span> {
-<a name="l00654"></a>00654         cpl_msg_warning(cpl_func, <span class="stringliteral">"Only 1 raw frame provided, "</span>
-<a name="l00655"></a>00655                         <span class="stringliteral">"cannot compute master flat photon noise"</span>);
-<a name="l00656"></a>00656         master_photon_noise = -1;
-<a name="l00657"></a>00657     }
-<a name="l00658"></a>00658 
-<a name="l00659"></a>00659     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00660"></a>00660                             master_photon_noise,
-<a name="l00661"></a>00661                             <span class="stringliteral">"QC.FLAT.PHN"</span>,
-<a name="l00662"></a>00662                             <span class="stringliteral">"ADU"</span>,
-<a name="l00663"></a>00663                             <span class="stringliteral">"Photon noise in master screen flat field"</span>,
-<a name="l00664"></a>00664                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00665"></a>00665         
-<a name="l00666"></a>00666     <span class="keywordtype">double</span> master_fixed_pattern_noise = 
-<a name="l00667"></a>00667         <a class="code" href="group__fors__tools.html#g5637ecda70fb6aeab5c0b22dec2e2e10">fors_fixed_pattern_noise</a>(master_sflat,
-<a name="l00668"></a>00668                                  <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(first_raw, NULL),
-<a name="l00669"></a>00669                                  master_photon_noise);
-<a name="l00670"></a>00670     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00671"></a>00671             <span class="stringliteral">"Could not compute fixed pattern noise"</span> );
-<a name="l00672"></a>00672     
-<a name="l00673"></a>00673     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00674"></a>00674                             master_fixed_pattern_noise,
-<a name="l00675"></a>00675                             <span class="stringliteral">"QC.FLAT.FPN"</span>,
-<a name="l00676"></a>00676                             <span class="stringliteral">"ADU"</span>,
-<a name="l00677"></a>00677                             <span class="stringliteral">"Fixed-pattern noise"</span>,
-<a name="l00678"></a>00678                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00679"></a>00679 
-<a name="l00680"></a>00680     master_fixed_pattern_noise /= <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(first_raw, NULL);
-<a name="l00681"></a>00681 
-<a name="l00682"></a>00682     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00683"></a>00683                             master_fixed_pattern_noise,
-<a name="l00684"></a>00684                             <span class="stringliteral">"QC.FLAT.FPN.REL"</span>,
-<a name="l00685"></a>00685                             NULL,
-<a name="l00686"></a>00686                             <span class="stringliteral">"Relative fixed-pattern noise"</span>,
-<a name="l00687"></a>00687                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00688"></a>00688 
-<a name="l00689"></a>00689     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00690"></a>00690                             conad,
-<a name="l00691"></a>00691                             <span class="stringliteral">"QC.FLAT.CONAD"</span>,
-<a name="l00692"></a>00692                             <span class="stringliteral">"e-/ADU"</span>,
-<a name="l00693"></a>00693                             <span class="stringliteral">"Conversion factor from ADU to electrons"</span>,
-<a name="l00694"></a>00694                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00695"></a>00695 
-<a name="l00696"></a>00696     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00697"></a>00697                             conad_err,
-<a name="l00698"></a>00698                             <span class="stringliteral">"QC.FLAT.CONADERR"</span>,
-<a name="l00699"></a>00699                             <span class="stringliteral">"e-/ADU"</span>,
-<a name="l00700"></a>00700                             <span class="stringliteral">"Error on conversion factor ADU/electrons"</span>,
-<a name="l00701"></a>00701                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00702"></a>00702 
-<a name="l00703"></a>00703 <span class="preprocessor">#define SALTA 1</span>
-<a name="l00704"></a>00704 <span class="preprocessor"></span><span class="preprocessor">#ifndef SALTA</span>
-<a name="l00705"></a>00705 <span class="preprocessor"></span>    <span class="comment">/* </span>
-<a name="l00706"></a>00706 <span class="comment">     * Estimate CONAD as 1 / mean(variance_i / flux_i) </span>
-<a name="l00707"></a>00707 <span class="comment">     *</span>
-<a name="l00708"></a>00708 <span class="comment">     * where variance_i is estimated as (flux_i1 - flux_i2)^2/2</span>
-<a name="l00709"></a>00709 <span class="comment">     * for the fluxes of the first two raw frames. The systematic </span>
-<a name="l00710"></a>00710 <span class="comment">     * part of the difference (i.e. due to sligthly different </span>
-<a name="l00711"></a>00711 <span class="comment">     * exposure times) is subtracted from the difference image.</span>
-<a name="l00712"></a>00712 <span class="comment">     * </span>
-<a name="l00713"></a>00713 <span class="comment">     * Note: It is important that the average is made using</span>
-<a name="l00714"></a>00714 <span class="comment">     * (variance_i / flux_i), and not using (flux_i / variance_i)</span>
-<a name="l00715"></a>00715 <span class="comment">     * because the variance estimates are very noisy and</span>
-<a name="l00716"></a>00716 <span class="comment">     * close to zero.</span>
-<a name="l00717"></a>00717 <span class="comment">     */</span>
-<a name="l00718"></a>00718         
-<a name="l00719"></a>00719     <span class="keywordtype">double</span> conad, conad_err;
-<a name="l00720"></a>00720 
-<a name="l00721"></a>00721     <span class="keywordflow">if</span> (second_raw != NULL) {
-<a name="l00722"></a>00722         image = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(first_raw);
-<a name="l00723"></a>00723         <a class="code" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">fors_image_subtract</a>(image, second_raw);
-<a name="l00724"></a>00724 
-<a name="l00725"></a>00725         <span class="comment">/*</span>
-<a name="l00726"></a>00726 <span class="comment">         * At every pixel, variance_i / flux_i is an estimate of the gain.</span>
-<a name="l00727"></a>00727 <span class="comment">         *  </span>
-<a name="l00728"></a>00728 <span class="comment">         * To get the average use only part of image with flux_i above </span>
-<a name="l00729"></a>00729 <span class="comment">         * 0.5*median, because regions with zero ~flux cause division by </span>
-<a name="l00730"></a>00730 <span class="comment">         * zero and do not help estimate the gain. </span>
-<a name="l00731"></a>00731 <span class="comment">         */</span>
-<a name="l00732"></a>00732 
-<a name="l00733"></a>00733         <span class="keywordtype">double</span> gain_mean, gain_err;
-<a name="l00734"></a>00734 
-<a name="l00735"></a>00735         {
-<a name="l00736"></a>00736             <span class="keywordtype">double</span> first_raw_median = <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(first_raw, NULL);
-<a name="l00737"></a>00737 
-<a name="l00738"></a>00738             <span class="keyword">const</span> <span class="keywordtype">float</span> *first_raw_data = <a class="code" href="group__fors__image.html#gdffe6405bb64c769dfcdf71c6a281dad">fors_image_get_data_const</a>(first_raw);
-<a name="l00739"></a>00739             <span class="keyword">const</span> <span class="keywordtype">float</span> *diff_data = <a class="code" href="group__fors__image.html#gdffe6405bb64c769dfcdf71c6a281dad">fors_image_get_data_const</a>(image);
-<a name="l00740"></a>00740 
-<a name="l00741"></a>00741             <span class="keyword">const</span> <span class="keywordtype">int</span> Ntot = <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(image) 
-<a name="l00742"></a>00742                            * <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(image);
-<a name="l00743"></a>00743 
-<a name="l00744"></a>00744             <span class="comment">/*</span>
-<a name="l00745"></a>00745 <span class="comment">             * Computing the mean difference between the two raw flats,</span>
-<a name="l00746"></a>00746 <span class="comment">             * and subtract it from the difference image. This is in </span>
-<a name="l00747"></a>00747 <span class="comment">             * principle incorrect: the difference between two flat</span>
-<a name="l00748"></a>00748 <span class="comment">             * exposures is not a constant, but it has the same illumination</span>
-<a name="l00749"></a>00749 <span class="comment">             * distribution as the original flats:</span>
-<a name="l00750"></a>00750 <span class="comment">             * </span>
-<a name="l00751"></a>00751 <span class="comment">             *   diff = flat1 - flat2 = flat1 - k*flat1 = (1-k) * flat1</span>
-<a name="l00752"></a>00752 <span class="comment">             *</span>
-<a name="l00753"></a>00753 <span class="comment">             * Correcting for a constant offset would not prevent an</span>
-<a name="l00754"></a>00754 <span class="comment">             * overestimation of the variance in case k is different </span>
-<a name="l00755"></a>00755 <span class="comment">             * from 1.0!</span>
-<a name="l00756"></a>00756 <span class="comment">             */</span>
-<a name="l00757"></a>00757 
-<a name="l00758"></a>00758             <span class="keywordtype">double</span> diff_mean = 0;
-<a name="l00759"></a>00759             <span class="keywordtype">int</span> N = 0;
-<a name="l00760"></a>00760             <span class="keywordtype">int</span> i;
-<a name="l00761"></a>00761             <span class="keywordflow">for</span> (i = 0; i < Ntot; i++) {
-<a name="l00762"></a>00762                 <span class="keywordflow">if</span> (first_raw_data[i] > 0.5 * first_raw_median) {
-<a name="l00763"></a>00763                     diff_mean += diff_data[i];
-<a name="l00764"></a>00764                     N += 1;
-<a name="l00765"></a>00765                 }
-<a name="l00766"></a>00766             }
-<a name="l00767"></a>00767             diff_mean /= N;
-<a name="l00768"></a>00768             <a class="code" href="group__fors__image.html#g50a06b605ca558553e0642209b93c100">fors_image_subtract_scalar</a>(image, diff_mean, -1);
-<a name="l00769"></a>00769 
-<a name="l00770"></a>00770             <span class="comment">/* </span>
-<a name="l00771"></a>00771 <span class="comment">             * Pixel per pixel estimate of variance.</span>
-<a name="l00772"></a>00772 <span class="comment">             */</span>
-<a name="l00773"></a>00773 
-<a name="l00774"></a>00774             <a class="code" href="group__fors__image.html#g18f269421a43f46c063b667fac72c938">fors_image_square</a>(image);
-<a name="l00775"></a>00775             <a class="code" href="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff">fors_image_divide_scalar</a>(image, 2, -1);
-<a name="l00776"></a>00776 
-<a name="l00777"></a>00777             <span class="comment">/* </span>
-<a name="l00778"></a>00778 <span class="comment">             * Now image contains estimates of variance at every pixel,</span>
-<a name="l00779"></a>00779 <span class="comment">             * i.e., diff_data[] points to variance values.</span>
-<a name="l00780"></a>00780 <span class="comment">             */</span>
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782             <span class="keywordtype">double</span> sum_vf = 0;     <span class="comment">/* sum (variance_i / flux_i)   */</span>
-<a name="l00783"></a>00783             <span class="keywordtype">double</span> sum_vfvf = 0;   <span class="comment">/* sum (variance_i / flux_i)^2 */</span>
-<a name="l00784"></a>00784             N = 0;
-<a name="l00785"></a>00785             <span class="keywordflow">for</span> (i = 0; i < Ntot; i++) {
-<a name="l00786"></a>00786                 <span class="keywordflow">if</span> (first_raw_data[i] > 0.5 * first_raw_median) {
-<a name="l00787"></a>00787                     <span class="keywordtype">double</span> vf = diff_data[i] / first_raw_data[i];
-<a name="l00788"></a>00788                     sum_vf   += vf;
-<a name="l00789"></a>00789                     sum_vfvf += vf*vf;
-<a name="l00790"></a>00790                     N += 1;
-<a name="l00791"></a>00791                 }
-<a name="l00792"></a>00792             }
-<a name="l00793"></a>00793 
-<a name="l00794"></a>00794             gain_mean = sum_vf / N;
-<a name="l00795"></a>00795             <span class="keywordtype">double</span> vfvf_mean = sum_vfvf / N;
-<a name="l00796"></a>00796             gain_err = sqrt(fabs(vfvf_mean - gain_mean*gain_mean));
-<a name="l00797"></a>00797 
-<a name="l00798"></a>00798             <span class="comment">/* </span>
-<a name="l00799"></a>00799 <span class="comment">             * Iterate, rejecting 5 sigma outliers (e.g. due to cosmics</span>
-<a name="l00800"></a>00800 <span class="comment">             * in any raw frame).</span>
-<a name="l00801"></a>00801 <span class="comment">             */</span>
-<a name="l00802"></a>00802 
-<a name="l00803"></a>00803             <span class="keywordtype">double</span> hicut = gain_mean + 5*gain_err;
-<a name="l00804"></a>00804             sum_vf = 0;  
-<a name="l00805"></a>00805             sum_vfvf = 0;
-<a name="l00806"></a>00806             N = 0;
-<a name="l00807"></a>00807             <span class="keywordflow">for</span> (i = 0; i < Ntot; i++) {
-<a name="l00808"></a>00808                 <span class="keywordflow">if</span> (first_raw_data[i] > 0.5 * first_raw_median) {
-<a name="l00809"></a>00809                     <span class="keywordtype">double</span> vf = diff_data[i] / first_raw_data[i];
-<a name="l00810"></a>00810                     <span class="keywordflow">if</span> (vf < hicut) {
-<a name="l00811"></a>00811                         sum_vf   += vf;
-<a name="l00812"></a>00812                         sum_vfvf += vf*vf;
-<a name="l00813"></a>00813                         N += 1;
-<a name="l00814"></a>00814                     }
-<a name="l00815"></a>00815                 }
-<a name="l00816"></a>00816             }
-<a name="l00817"></a>00817             
-<a name="l00818"></a>00818             cpl_msg_info(cpl_func, <span class="stringliteral">"Using %d of %d pixels for gain estimation"</span>,
-<a name="l00819"></a>00819                          N, Ntot);
-<a name="l00820"></a>00820 
-<a name="l00821"></a>00821             gain_mean = sum_vf / N;
-<a name="l00822"></a>00822 
-<a name="l00823"></a>00823             <span class="comment">/* </span>
-<a name="l00824"></a>00824 <span class="comment">             * If sigma_i follows a Gaussian distribution and flux_i</span>
-<a name="l00825"></a>00825 <span class="comment">             * is roughly constant, then the distribution of  </span>
-<a name="l00826"></a>00826 <span class="comment">             *        variance_i / flux_i  =  sigma_i^2 / flux_i</span>
-<a name="l00827"></a>00827 <span class="comment">             * has a predictable (non-symmetric and non-Gaussian) shape.</span>
-<a name="l00828"></a>00828 <span class="comment">             *</span>
-<a name="l00829"></a>00829 <span class="comment">             * We want the *mean* of this distribution, and we cannot use</span>
-<a name="l00830"></a>00830 <span class="comment">             * e.g. the median to estimate the mean.</span>
-<a name="l00831"></a>00831 <span class="comment">             */</span>
-<a name="l00832"></a>00832 
-<a name="l00833"></a>00833             vfvf_mean = sum_vfvf / N;
-<a name="l00834"></a>00834 
-<a name="l00835"></a>00835             gain_err = sqrt(fabs(vfvf_mean - gain_mean*gain_mean));
-<a name="l00836"></a>00836 
-<a name="l00837"></a>00837             <span class="comment">/* </span>
-<a name="l00838"></a>00838 <span class="comment">             * Mean squared is always greater than squared mean,</span>
-<a name="l00839"></a>00839 <span class="comment">             * the fabs() is there just in case.</span>
-<a name="l00840"></a>00840 <span class="comment">             */</span>
-<a name="l00841"></a>00841 
-<a name="l00842"></a>00842             <span class="comment">/* </span>
-<a name="l00843"></a>00843 <span class="comment">             * Convert from stdev to error of mean estimate </span>
-<a name="l00844"></a>00844 <span class="comment">             */</span>
-<a name="l00845"></a>00845 
-<a name="l00846"></a>00846             gain_err /= sqrt(N);
-<a name="l00847"></a>00847         }
-<a name="l00848"></a>00848         
-<a name="l00849"></a>00849         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( gain_mean > 0, <span class="keywordflow">return</span>,
-<a name="l00850"></a>00850                 <span class="stringliteral">"Difference between first two raw input frames is "</span>
-<a name="l00851"></a>00851                 <span class="stringliteral">"always zero, cannot estimate gain"</span>);
-<a name="l00852"></a>00852         
-<a name="l00853"></a>00853         conad = 1.0/gain_mean;
-<a name="l00854"></a>00854         
-<a name="l00855"></a>00855         <span class="comment">/* </span>
-<a name="l00856"></a>00856 <span class="comment">         * Relative error in CONAD and GAIN is the same:</span>
-<a name="l00857"></a>00857 <span class="comment">         */</span>
-<a name="l00858"></a>00858 
-<a name="l00859"></a>00859         conad_err = conad * gain_err/gain_mean;
-<a name="l00860"></a>00860     }
-<a name="l00861"></a>00861     <span class="keywordflow">else</span> {
-<a name="l00862"></a>00862         cpl_msg_warning(cpl_func, <span class="stringliteral">"Only 1 raw frame provided, "</span>
-<a name="l00863"></a>00863                         <span class="stringliteral">"cannot estimate CONAD"</span>);
-<a name="l00864"></a>00864         conad     = -1;
-<a name="l00865"></a>00865         conad_err = -1;
-<a name="l00866"></a>00866     }
-<a name="l00867"></a>00867 
-<a name="l00868"></a>00868     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00869"></a>00869                             conad,
-<a name="l00870"></a>00870                             <span class="stringliteral">"QC.FLAT.CONAD"</span>,
-<a name="l00871"></a>00871                             <span class="stringliteral">"e-/ADU"</span>,
-<a name="l00872"></a>00872                             <span class="stringliteral">"Conversion factor from ADU to electrons"</span>,
-<a name="l00873"></a>00873                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00874"></a>00874         
-<a name="l00875"></a>00875     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00876"></a>00876                             conad_err,
-<a name="l00877"></a>00877                             <span class="stringliteral">"QC.FLAT.CONADERR"</span>,
-<a name="l00878"></a>00878                             <span class="stringliteral">"e-/ADU"</span>,
-<a name="l00879"></a>00879                             <span class="stringliteral">"Error on conversion factor ADU/electrons"</span>,
-<a name="l00880"></a>00880                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);  
-<a name="l00881"></a>00881 <span class="preprocessor">#endif</span>
-<a name="l00882"></a>00882 <span class="preprocessor"></span>
-<a name="l00883"></a>00883     <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l00884"></a>00884 
-<a name="l00885"></a>00885     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00886"></a>00886     <span class="keywordflow">return</span>;
-<a name="l00887"></a>00887 }
-<a name="l00888"></a>00888 
-<a name="l00889"></a>00889 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__screen__flat__impl_8c_source.html b/html/fors__img__screen__flat__impl_8c_source.html
new file mode 100644
index 0000000..7079af9
--- /dev/null
+++ b/html/fors__img__screen__flat__impl_8c_source.html
@@ -0,0 +1,897 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_screen_flat_impl.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_screen_flat_impl.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_screen_flat_impl.c,v 1.48 2013-09-10 19:16:19 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 19:16:19 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.48 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_img_screen_flat_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_stack.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_tools.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_screen_flat_name = <span class="stringliteral">"fors_img_screen_flat"</span>;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_screen_flat_description_short = </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"Compute master screen flat frame"</span>;</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_screen_flat_author = <span class="stringliteral">"Jonas M. Larsen"</span>;</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_screen_flat_email = PACKAGE_BUGREPORT;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_screen_flat_description = </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"After bias subtraction, the input flat field frames are combined using\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"the given stack method. The combined frame is finally normalised dividing\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"it by its large scale illumination trend. The large scale trend is obtained\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"by applying a median filter with a large kernel. To avoid boundary effects, \n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"the median filter is applied only to the specified region.\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"The overscan regions, if present, are removed from the result.\n\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  SCREEN_FLAT_IMG            Raw         Screen flat field    Y\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  MASTER_BIAS                Raw         Master bias          Y\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  MASTER_SCREEN_FLAT_IMG     FITS image  Master screen flat field\n"</span>;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <a class="code" href="group__fors__img__screen__flat.html#gabe250dfa6d750ed0de8e583c614a7dae" title="Fit and divide out large scale structure.">remove_large_scale</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *master_screen_flat,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                    <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *context,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>                    <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting);</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <a class="code" href="group__fors__img__screen__flat.html#ga28678e6bba93d507e39ef08578423528" title="Fit and divide out large scale structure.">remove_large_scale_fit</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *master_screen_flat,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                        <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                        <span class="keyword">const</span> <span class="keywordtype">char</span> *context,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                        <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <a class="code" href="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1" title="Compute QC.">write_qc</a>(cpl_propertylist *qc, </div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>          <span class="keyword">const</span> cpl_frame *first_raw,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>          <span class="keyword">const</span> fors_image_list *sflats, </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>          <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_sflat,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>          <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>          <span class="keywordtype">double</span> saturation);</div>
+<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat.html#ga19e0710196db92a992d5c1502c35a5f0">   96</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__screen__flat.html#ga19e0710196db92a992d5c1502c35a5f0" title="Define recipe parameters.">fors_img_screen_flat_define_parameters</a>(cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> {</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_img_screen_flat_name);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *full_name = NULL;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <a class="code" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15" title="Define recipe parameters.">fors_stack_define_parameters</a>(parameters, context, <span class="stringliteral">"average"</span>);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     {</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>         cpl_parameter *p;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>         </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>         <span class="comment">/* Median filter, xradius, yradius */</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>         name = <span class="stringliteral">"xradius"</span>;</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>         full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>         p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                                     CPL_TYPE_INT,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                                     <span class="stringliteral">"Median filter x radius (unbinned pixels)"</span>,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                                     context,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                                     50);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>         cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>         cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>         cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>         name = <span class="stringliteral">"yradius"</span>;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>         full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>         p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                                     CPL_TYPE_INT,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                                     <span class="stringliteral">"Median filter y radius (unbinned pixels)"</span>,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                                     context,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                                     50);</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>         cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>         cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>         cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         name = <span class="stringliteral">"degree"</span>;</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>         full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                                     CPL_TYPE_INT,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                                     <span class="stringliteral">"Degree of fitting polynomial"</span>,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                                     context,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                                     -1);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>         cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>         cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>         cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>         name = <span class="stringliteral">"sampling"</span>;</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>         p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                                     CPL_TYPE_INT,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                                     <span class="stringliteral">"Sampling interval for fitting"</span>,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                                     context,</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>                                     100);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>         cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>         cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>         cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>         cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     }</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     cpl_free((<span class="keywordtype">void</span> *)context);</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> }</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor">    cpl_frameset_delete(sflat_frames); \</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="preprocessor">    cpl_frameset_delete(master_bias_frame); \</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor">    fors_image_delete_const(&master_bias); \</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="preprocessor">    fors_stack_method_delete(&sm); \</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="preprocessor">    cpl_free((void *)context); \</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="preprocessor">    fors_image_delete(&master_screen_flat); \</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="preprocessor">    fors_image_delete(&master_norm_flat); \</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="preprocessor">    fors_image_list_delete_const(&sflats, fors_image_delete); \</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor">    cpl_propertylist_delete(qc); \</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat.html#gad6f0f603eedc00271082e6dae9dbd2a6">  186</a></span> <a class="code" href="group__fors__img__screen__flat.html#gad6f0f603eedc00271082e6dae9dbd2a6" title="Do the processing.">fors_img_screen_flat</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> {</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="comment">/* Raw */</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     cpl_frameset *sflat_frames      = NULL;</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="keyword">const</span> fors_image_list *sflats   = NULL;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting           = NULL;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="comment">/* Calibration */</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     cpl_frameset *master_bias_frame = NULL;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias   = NULL; </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="comment">/* Products */</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_screen_flat = NULL;</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_norm_flat   = NULL;</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="comment">/* QC */</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     cpl_propertylist *qc = cpl_propertylist_new();</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="keywordtype">double</span> saturation;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     <span class="comment">/* Parameters */</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     stack_method *sm = NULL;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     <span class="comment">/* Other */</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_img_screen_flat_name);</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="comment">/* Get parameters */</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     sm = <a class="code" href="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e" title="Get stack method from parameter list.">fors_stack_method_new</a>(parameters, context);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get stacking method"</span>);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <span class="comment">/* Find raw */</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     sflat_frames = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, SCREEN_FLAT_IMG);</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(sflat_frames) > 0, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>             <span class="stringliteral">"No %s provided"</span>, SCREEN_FLAT_IMG);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="comment">/* Find calibration */</span></div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     master_bias_frame = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, MASTER_BIAS);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(master_bias_frame) == 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame));</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="comment">/* Get instrument setting */</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_get_first(sflat_frames));</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     master_bias = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(cpl_frameset_get_first(master_bias_frame), </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                   NULL, setting, NULL);</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>             <span class="stringliteral">"Could not load master bias"</span>);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     <span class="comment">/* Load raw frames, subtract bias */</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     sflats = <a class="code" href="group__fors__image.html#ga0895dc7573734afe519fa4dff3ea33bd" title="Load imagelist.">fors_image_load_list_const</a>(sflat_frames, master_bias, </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>                                         setting, &saturation);</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load screen flat images"</span>);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="comment">/* Stack */</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     master_screen_flat = <a class="code" href="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc" title="Stack images.">fors_stack_const</a>(sflats, sm);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Screen flat stacking failed"</span>);</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="comment">/* Divide out large scale structure */</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     master_norm_flat = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(master_screen_flat);</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <a class="code" href="group__fors__img__screen__flat.html#gabe250dfa6d750ed0de8e583c614a7dae" title="Fit and divide out large scale structure.">remove_large_scale</a>(master_norm_flat,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                        parameters, context,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                        setting);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>             <span class="stringliteral">"Flat field smoothing/normalization failed"</span>);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="comment">/* QC */</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <a class="code" href="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1" title="Compute QC.">write_qc</a>(qc, cpl_frameset_get_first(sflat_frames),</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>              sflats, master_norm_flat, setting, saturation);</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Failed to compute QC"</span>);</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     <span class="comment">/* Save products */</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, master_screen_flat, MASTER_SCREEN_FLAT_IMG,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                         NULL, parameters, fors_img_screen_flat_name, </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                         cpl_frameset_get_first(sflat_frames));</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>             MASTER_SCREEN_FLAT_IMG);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, master_norm_flat, MASTER_NORM_FLAT_IMG,</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>                         qc, parameters, fors_img_screen_flat_name, </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>                         cpl_frameset_get_first(sflat_frames));</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>             MASTER_NORM_FLAT_IMG);</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     </div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     cleanup;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> }</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> <span class="preprocessor">    cpl_image_delete(smoothed); \</span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00299"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat.html#gabe250dfa6d750ed0de8e583c614a7dae">  299</a></span> <a class="code" href="group__fors__img__screen__flat.html#gabe250dfa6d750ed0de8e583c614a7dae" title="Fit and divide out large scale structure.">remove_large_scale</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *master_screen_flat,</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                    <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *context,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                    <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting)</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> {</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     cpl_image *smoothed = NULL;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordtype">int</span> xradius, yradius;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="keywordtype">int</span> xstart, ystart;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="keywordtype">int</span> xend, yend;</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"degree"</span>);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <span class="keyword">const</span> cpl_parameter *param = cpl_parameterlist_find_const(parameters, name);</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordtype">int</span> degree = cpl_parameter_get_int(param);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     <span class="keywordflow">if</span> (degree >= 0) {</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         <a class="code" href="group__fors__img__screen__flat.html#ga28678e6bba93d507e39ef08578423528" title="Fit and divide out large scale structure.">remove_large_scale_fit</a>(master_screen_flat, parameters, context,</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                                setting);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     }</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Median filter parameters:"</span>);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"xradius"</span>);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     xradius = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parameters, </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>                                           name);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"yradius"</span>);</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     yradius = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parameters, </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>                                           name);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     </div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     <span class="comment">/* Done reading parameters, apply filter */</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordtype">bool</span> use_data = <span class="keyword">true</span>;  <span class="comment">/* Filter the data values, not error bars */</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     <span class="comment">/* Correct for CCD binning */</span></div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     xradius = (xradius - 1)/setting->binx + 1;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     yradius = (yradius - 1)/setting->biny + 1;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     xstart = 1;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     ystart = 1;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     xend = <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(master_screen_flat);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     yend = <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(master_screen_flat);</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     <span class="keywordtype">int</span> xstep = 1;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <span class="keywordtype">int</span> ystep = 1;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     smoothed = <a class="code" href="group__fors__image.html#ga395b18920e75b55d9a793dfbcb99755f" title="Smooth image.">fors_image_filter_median_create</a>(master_screen_flat,</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>                                                xradius, yradius,</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                                                xstart, ystart,</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>                                                xend, yend,</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>                                                xstep, ystep,</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                                                use_data);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> <span class="preprocessor">#ifdef DEBUG</span></div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> <span class="preprocessor"></span>    {</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *filename = <span class="stringliteral">"smooth.fits"</span>;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Saving large scale structure image to %s"</span>,</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>                      filename);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>         cpl_image_save(smoothed, filename, CPL_BPP_IEEE_FLOAT,</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>                        NULL, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     }</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> <span class="preprocessor"></span>    </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <a class="code" href="group__fors__image.html#ga88aca44b1a0bde06bbd43c487ae58766" title="Divide images.">fors_image_divide_noerr</a>(master_screen_flat, smoothed);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="comment">/* smoothed image modified here */</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> </div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     cleanup;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> }</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> </div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="preprocessor">    cpl_image_delete(smoothed); \</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat.html#ga28678e6bba93d507e39ef08578423528">  409</a></span> <a class="code" href="group__fors__img__screen__flat.html#ga28678e6bba93d507e39ef08578423528" title="Fit and divide out large scale structure.">remove_large_scale_fit</a>(<a class="code" href="struct__fors__image.html">fors_image</a> *master_screen_flat,</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                        <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>                        <span class="keyword">const</span> <span class="keywordtype">char</span> *context,</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>                        <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting)</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> </div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> {</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     cpl_image *smoothed = NULL;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     <span class="keywordtype">int</span> step;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     <span class="keywordtype">int</span> degree;</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     (void)setting;</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> </div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Large scale fitting parameters:"</span>);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"sampling"</span>);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     step = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parameters, </div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                                        name);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"degree"</span>);</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     degree = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parameters,</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                                          name);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="comment">     * Determine typical level of flat field, that will be used to</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> <span class="comment">     * avoid fitting values from the vignetted region.</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     <span class="keywordtype">float</span> level = <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(master_screen_flat, NULL) / 2;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> </div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     smoothed = fors_image_flat_fit_create(master_screen_flat,</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>                                           step, degree, level);</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     </div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> <span class="preprocessor">#ifdef DEBUG</span></div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> <span class="preprocessor"></span>    {</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *filename = <span class="stringliteral">"smooth.fits"</span>;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> </div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Saving large scale structure image to %s"</span>,</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>                      filename);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>         cpl_image_save(smoothed, filename, CPL_BPP_IEEE_FLOAT,</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>                        NULL, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     }</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> <span class="preprocessor"></span>    </div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     <a class="code" href="group__fors__image.html#ga88aca44b1a0bde06bbd43c487ae58766" title="Divide images.">fors_image_divide_noerr</a>(master_screen_flat, smoothed);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     <span class="comment">/* smoothed image modified here */</span></div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> </div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     cleanup;</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> }</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> </div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> </div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> <span class="preprocessor">    fors_image_delete(&image); \</span></div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00489"></a><span class="lineno"><a class="code" href="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1">  489</a></span> <a class="code" href="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1" title="Compute QC.">write_qc</a>(cpl_propertylist *qc, </div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>          <span class="keyword">const</span> cpl_frame *first_raw_frame,</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>          <span class="keyword">const</span> fors_image_list *sflats, </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>          <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_sflat,</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>          <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>          <span class="keywordtype">double</span> saturation)</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> {</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span> </div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qc, fors_qc_dic_version, setting->instrument);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> </div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     <a class="code" href="group__forsqc.html#ga9ff2c73c315e805ab5d1415a2de9ce0b" title="Initiate a new QC1 group and log basic QC.">fors_qc_write_group_heading</a>(first_raw_frame,</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>                                 MASTER_SCREEN_FLAT_IMG,</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>                                 setting->instrument);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not write %s QC parameters"</span>, </div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>             MASTER_SCREEN_FLAT_IMG);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> </div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> </div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> </div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>                             saturation,</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>                             <span class="stringliteral">"QC.OVEREXPO"</span>,</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>                             <span class="stringliteral">"%"</span>,</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>                             <span class="stringliteral">"Percentage of overexposed pixels"</span>,</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                             setting->instrument);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span> </div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> <span class="comment">     * Second_raw is NULL if only one raw frame provided:</span></div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> </div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *first_raw = fors_image_list_first_const(sflats);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *second_raw = fors_image_list_next_const(sflats); </div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>         </div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>                             <span class="comment">/* Median of bias subtracted frame */</span></div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>                             <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(first_raw, NULL)</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>                             / setting->exposure_time,</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>                             <span class="stringliteral">"QC.FLAT.EFF"</span>,</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>                             <span class="stringliteral">"ADU/s"</span>,</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>                             <span class="stringliteral">"Flat field lamp efficiency"</span>,</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>                             setting->instrument);</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> </div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> </div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> <span class="comment">     * Here compute QC.FLAT.PHN and QC.FLAT.CONAD:</span></div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> </div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordtype">double</span> master_photon_noise;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keywordtype">double</span> conad, conad_err;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     <span class="comment">/* FIXME: </span></div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> <span class="comment">     * Here in principle we should use the propagated errors to get</span></div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> <span class="comment">     * the master flat photon noise, instead of computing it all over</span></div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> <span class="comment">     * again...</span></div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keywordflow">if</span> (second_raw != NULL) {</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>             </div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         <span class="comment">/* </span></div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span> <span class="comment">         * Use central 101x101 window of difference frame </span></div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span> </div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         <span class="keywordflow">if</span> (<a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(second_raw) >= 101 &&</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>             <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(second_raw) >= 101) {</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span> </div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>             <a class="code" href="struct__fors__image.html">fors_image</a> *center_first = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(first_raw);</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>             <a class="code" href="struct__fors__image.html">fors_image</a> *center_second = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(second_raw);</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>                 </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>             <span class="keywordtype">int</span> mid_x = (<a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(center_first) + 1) / 2;</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>             <span class="keywordtype">int</span> mid_y = (<a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(center_first) + 1) / 2;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> </div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>             <a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053" title="Crop image.">fors_image_crop</a>(center_first, </div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>                             mid_x - 50, mid_y - 50,</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>                             mid_x + 50, mid_y + 50);</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>             <a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053" title="Crop image.">fors_image_crop</a>(center_second, </div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>                             mid_x - 50, mid_y - 50,</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>                             mid_x + 50, mid_y + 50);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span> </div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span> <span class="comment">             * This one is the intensity image, will be used later</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span> <span class="comment">             * for gain computation</span></div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> </div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>             image = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(center_first);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span> </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span> <span class="comment">             * 1) Determine the median value of the ratio  F1/F2 = k .</span></div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> <span class="comment">             * 2) Compute the frame  F1 - k*F2 (whose mean should be</span></div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> <span class="comment">             *    around 0).</span></div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> <span class="comment">             * 3) The expected variance of  F1 - k*F2  is  V = V1 + k*k*V2,</span></div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> <span class="comment">             *    where V1 and V2 are the variances of the frames F1 and F2.</span></div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span> <span class="comment">             * 4) Neglecting the contribution of the readout noise, it is  </span></div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> <span class="comment">             *    V1 = F1/conad  and  V2 = F2/conad, so it is also V1/V2 = k .</span></div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> <span class="comment">             * 5) Therefore we get V = V1 + k*V1, that is   V1 = V/(1+k),</span></div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span> <span class="comment">             *    an estimator of the variance of the first frame.</span></div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span> <span class="comment">             * 6) The noise (1-sigma level) of the first frame is then</span></div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span> <span class="comment">             *    sqrt(V1) = sqrt(V)/sqrt(1+k).</span></div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span> </div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>             <span class="comment">/* 1) */</span></div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>             <a class="code" href="struct__fors__image.html">fors_image</a> *ratio = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(center_first);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>             <a class="code" href="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2" title="Divide images.">fors_image_divide</a>(ratio, center_second);</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>             <span class="keywordtype">double</span> k = <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(ratio, NULL);</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>             <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&ratio);</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> </div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>             <span class="comment">/* 2) */</span></div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>             <a class="code" href="group__fors__image.html#gadd751e2623f778d5bb2b8f3b628077c2" title="Multiply by scalar.">fors_image_multiply_scalar</a>(center_second, k, -1);</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>             <a class="code" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be" title="Subtract images.">fors_image_subtract</a>(center_first, center_second);</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>             <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&center_second);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>             <span class="comment">/* 6) */</span></div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>             master_photon_noise = <a class="code" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e" title="Get empirical stdev of data.">fors_image_get_stdev</a>(center_first, NULL);</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>             master_photon_noise /= sqrt(1+k);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> </div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> <span class="comment">             * Now estimate the noise of all frames (assuming that all</span></div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> <span class="comment">             * frames have similar exposure times...)</span></div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> </div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>             master_photon_noise /= sqrt(fors_image_list_size(sflats));</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span> </div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span> <span class="comment">             * Now center_first is used to determine the CONAD: the</span></div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span> <span class="comment">             * center_first is still to be squared and divided by (1+k) </span></div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> <span class="comment">             * to become an estimator of the variance of the first frame.</span></div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> <span class="comment">             *</span></div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span> <span class="comment">             * CONAD is estimated as 1 / mean(variance_i / flux_i)</span></div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span> <span class="comment">             *</span></div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span> <span class="comment">             * Note: It is important that the average is made using</span></div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span> <span class="comment">             * (variance_i / flux_i), and not using (flux_i / variance_i)</span></div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> <span class="comment">             * because the variance estimates are very noisy and</span></div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span> <span class="comment">             * close to zero.</span></div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span> </div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>             <a class="code" href="group__fors__image.html#gad4ecbb0eb96611d66dc9a3a1bc2ae0d8" title="Squared.">fors_image_square</a>(center_first);</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>             <a class="code" href="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2" title="Divide images.">fors_image_divide</a>(center_first, image);</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> </div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span> <span class="comment">             * We _must_ use mean, here, because the mean of the</span></div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> <span class="comment">             * squares in center_first is an estimate of the variance,</span></div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> <span class="comment">             * but the median is not (asymmetric distribution).</span></div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> </div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>             <span class="keywordtype">double</span> gain = <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(center_first, NULL) / (1+k);</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>             <span class="keywordtype">double</span> gain_err = <a class="code" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e" title="Get empirical stdev of data.">fors_image_get_stdev</a>(center_first, NULL) / (1+k);</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>             <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&center_first);</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>             <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&image);</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> </div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> <span class="comment">             * Relative error in CONAD and GAIN is the same:</span></div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> </div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>             conad = 1.0 / gain;</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>             conad_err = conad * gain_err/gain;</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>             conad_err /= 101;</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>         }</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>             cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>                             <span class="stringliteral">"Raw images too small (%dx%d), "</span></div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>                             <span class="stringliteral">"need size 101x101 to compute master flat "</span></div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>                             <span class="stringliteral">"photon noise and gain"</span>,</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>                             <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(second_raw),</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>                             <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(second_raw));</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span> </div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>             master_photon_noise = -1;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         }</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     }</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Only 1 raw frame provided, "</span></div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>                         <span class="stringliteral">"cannot compute master flat photon noise"</span>);</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>         master_photon_noise = -1;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     }</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span> </div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>                             master_photon_noise,</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>                             <span class="stringliteral">"QC.FLAT.PHN"</span>,</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>                             <span class="stringliteral">"Photon noise in master screen flat field"</span>,</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>                             setting->instrument);</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>         </div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>     <span class="keywordtype">double</span> master_fixed_pattern_noise = </div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>         <a class="code" href="group__fors__tools.html#ga97b43bda55e1da41fe216364c8408d5b" title="Compute fixed pattern noise in flat field.">fors_fixed_pattern_noise</a>(master_sflat,</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>                                  <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(first_raw, NULL),</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>                                  master_photon_noise);</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>             <span class="stringliteral">"Could not compute fixed pattern noise"</span> );</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>     </div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>                             master_fixed_pattern_noise,</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>                             <span class="stringliteral">"QC.FLAT.FPN"</span>,</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>                             <span class="stringliteral">"Fixed-pattern noise"</span>,</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>                             setting->instrument);</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> </div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     master_fixed_pattern_noise /= <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(first_raw, NULL);</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> </div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>                             master_fixed_pattern_noise,</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>                             <span class="stringliteral">"QC.FLAT.FPN.REL"</span>,</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>                             NULL,</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>                             <span class="stringliteral">"Relative fixed-pattern noise"</span>,</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>                             setting->instrument);</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span> </div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>                             conad,</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>                             <span class="stringliteral">"QC.FLAT.CONAD"</span>,</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>                             <span class="stringliteral">"e-/ADU"</span>,</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>                             <span class="stringliteral">"Conversion factor from ADU to electrons"</span>,</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>                             setting->instrument);</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>                             conad_err,</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>                             <span class="stringliteral">"QC.FLAT.CONADERR"</span>,</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>                             <span class="stringliteral">"e-/ADU"</span>,</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>                             <span class="stringliteral">"Error on conversion factor ADU/electrons"</span>,</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>                             setting->instrument);</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> <span class="preprocessor">#define SALTA 1</span></div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> <span class="preprocessor"></span><span class="preprocessor">#ifndef SALTA</span></div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span> <span class="preprocessor"></span>    <span class="comment">/* </span></div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span> <span class="comment">     * Estimate CONAD as 1 / mean(variance_i / flux_i) </span></div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span> <span class="comment">     * where variance_i is estimated as (flux_i1 - flux_i2)^2/2</span></div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> <span class="comment">     * for the fluxes of the first two raw frames. The systematic </span></div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> <span class="comment">     * part of the difference (i.e. due to sligthly different </span></div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> <span class="comment">     * exposure times) is subtracted from the difference image.</span></div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span> <span class="comment">     * </span></div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span> <span class="comment">     * Note: It is important that the average is made using</span></div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span> <span class="comment">     * (variance_i / flux_i), and not using (flux_i / variance_i)</span></div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> <span class="comment">     * because the variance estimates are very noisy and</span></div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span> <span class="comment">     * close to zero.</span></div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>         </div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>     <span class="keywordtype">double</span> conad, conad_err;</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span> </div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     <span class="keywordflow">if</span> (second_raw != NULL) {</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>         image = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(first_raw);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>         <a class="code" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be" title="Subtract images.">fors_image_subtract</a>(image, second_raw);</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span> </div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span> <span class="comment">         * At every pixel, variance_i / flux_i is an estimate of the gain.</span></div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span> <span class="comment">         *  </span></div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> <span class="comment">         * To get the average use only part of image with flux_i above </span></div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span> <span class="comment">         * 0.5*median, because regions with zero ~flux cause division by </span></div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span> <span class="comment">         * zero and do not help estimate the gain. </span></div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span> </div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>         <span class="keywordtype">double</span> gain_mean, gain_err;</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span> </div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>         {</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>             <span class="keywordtype">double</span> first_raw_median = <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(first_raw, NULL);</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> </div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>             <span class="keyword">const</span> <span class="keywordtype">float</span> *first_raw_data = <a class="code" href="group__fors__image.html#ga547b9bf5f615a083bffdcfa9097d0520" title="Get pointer to data buffer.">fors_image_get_data_const</a>(first_raw);</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>             <span class="keyword">const</span> <span class="keywordtype">float</span> *diff_data = <a class="code" href="group__fors__image.html#ga547b9bf5f615a083bffdcfa9097d0520" title="Get pointer to data buffer.">fors_image_get_data_const</a>(image);</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> </div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>             <span class="keyword">const</span> <span class="keywordtype">int</span> Ntot = <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(image) </div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>                            * <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(image);</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span> <span class="comment">             * Computing the mean difference between the two raw flats,</span></div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span> <span class="comment">             * and subtract it from the difference image. This is in </span></div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span> <span class="comment">             * principle incorrect: the difference between two flat</span></div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span> <span class="comment">             * exposures is not a constant, but it has the same illumination</span></div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span> <span class="comment">             * distribution as the original flats:</span></div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span> <span class="comment">             * </span></div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span> <span class="comment">             *   diff = flat1 - flat2 = flat1 - k*flat1 = (1-k) * flat1</span></div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span> <span class="comment">             *</span></div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span> <span class="comment">             * Correcting for a constant offset would not prevent an</span></div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span> <span class="comment">             * overestimation of the variance in case k is different </span></div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span> <span class="comment">             * from 1.0!</span></div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span> </div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>             <span class="keywordtype">double</span> diff_mean = 0;</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>             <span class="keywordtype">int</span> N = 0;</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>             <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>             <span class="keywordflow">for</span> (i = 0; i < Ntot; i++) {</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>                 <span class="keywordflow">if</span> (first_raw_data[i] > 0.5 * first_raw_median) {</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>                     diff_mean += diff_data[i];</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>                     N += 1;</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>                 }</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>             }</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>             diff_mean /= N;</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>             <a class="code" href="group__fors__image.html#gacbfb7c0518043b1079bb72af95d80961" title="Subtract scalar.">fors_image_subtract_scalar</a>(image, diff_mean, -1);</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span> </div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>             <span class="comment">/* </span></div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span> <span class="comment">             * Pixel per pixel estimate of variance.</span></div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> </div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>             <a class="code" href="group__fors__image.html#gad4ecbb0eb96611d66dc9a3a1bc2ae0d8" title="Squared.">fors_image_square</a>(image);</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>             <a class="code" href="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35" title="Divide by scalar.">fors_image_divide_scalar</a>(image, 2, -1);</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> </div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>             <span class="comment">/* </span></div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> <span class="comment">             * Now image contains estimates of variance at every pixel,</span></div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span> <span class="comment">             * i.e., diff_data[] points to variance values.</span></div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span> </div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>             <span class="keywordtype">double</span> sum_vf = 0;     <span class="comment">/* sum (variance_i / flux_i)   */</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>             <span class="keywordtype">double</span> sum_vfvf = 0;   <span class="comment">/* sum (variance_i / flux_i)^2 */</span></div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>             N = 0;</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>             <span class="keywordflow">for</span> (i = 0; i < Ntot; i++) {</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>                 <span class="keywordflow">if</span> (first_raw_data[i] > 0.5 * first_raw_median) {</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>                     <span class="keywordtype">double</span> vf = diff_data[i] / first_raw_data[i];</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>                     sum_vf   += vf;</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>                     sum_vfvf += vf*vf;</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>                     N += 1;</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>                 }</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>             }</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span> </div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>             gain_mean = sum_vf / N;</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>             <span class="keywordtype">double</span> vfvf_mean = sum_vfvf / N;</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>             gain_err = sqrt(fabs(vfvf_mean - gain_mean*gain_mean));</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> </div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>             <span class="comment">/* </span></div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span> <span class="comment">             * Iterate, rejecting 5 sigma outliers (e.g. due to cosmics</span></div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span> <span class="comment">             * in any raw frame).</span></div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span> </div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>             <span class="keywordtype">double</span> hicut = gain_mean + 5*gain_err;</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>             sum_vf = 0;  </div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>             sum_vfvf = 0;</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>             N = 0;</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>             <span class="keywordflow">for</span> (i = 0; i < Ntot; i++) {</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>                 <span class="keywordflow">if</span> (first_raw_data[i] > 0.5 * first_raw_median) {</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>                     <span class="keywordtype">double</span> vf = diff_data[i] / first_raw_data[i];</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>                     <span class="keywordflow">if</span> (vf < hicut) {</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>                         sum_vf   += vf;</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>                         sum_vfvf += vf*vf;</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>                         N += 1;</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>                     }</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>                 }</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>             }</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>             </div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>             cpl_msg_info(cpl_func, <span class="stringliteral">"Using %d of %d pixels for gain estimation"</span>,</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>                          N, Ntot);</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span> </div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>             gain_mean = sum_vf / N;</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span> </div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>             <span class="comment">/* </span></div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span> <span class="comment">             * If sigma_i follows a Gaussian distribution and flux_i</span></div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span> <span class="comment">             * is roughly constant, then the distribution of  </span></div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span> <span class="comment">             *        variance_i / flux_i  =  sigma_i^2 / flux_i</span></div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span> <span class="comment">             * has a predictable (non-symmetric and non-Gaussian) shape.</span></div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span> <span class="comment">             *</span></div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span> <span class="comment">             * We want the *mean* of this distribution, and we cannot use</span></div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span> <span class="comment">             * e.g. the median to estimate the mean.</span></div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span> </div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>             vfvf_mean = sum_vfvf / N;</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span> </div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>             gain_err = sqrt(fabs(vfvf_mean - gain_mean*gain_mean));</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span> </div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>             <span class="comment">/* </span></div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span> <span class="comment">             * Mean squared is always greater than squared mean,</span></div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span> <span class="comment">             * the fabs() is there just in case.</span></div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span> </div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>             <span class="comment">/* </span></div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span> <span class="comment">             * Convert from stdev to error of mean estimate </span></div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span> </div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>             gain_err /= sqrt(N);</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>         }</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>         </div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( gain_mean > 0, <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>                 <span class="stringliteral">"Difference between first two raw input frames is "</span></div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>                 <span class="stringliteral">"always zero, cannot estimate gain"</span>);</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>         </div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>         conad = 1.0/gain_mean;</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>         </div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>         <span class="comment">/* </span></div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span> <span class="comment">         * Relative error in CONAD and GAIN is the same:</span></div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span> </div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>         conad_err = conad * gain_err/gain_mean;</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>     }</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Only 1 raw frame provided, "</span></div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>                         <span class="stringliteral">"cannot estimate CONAD"</span>);</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>         conad     = -1;</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>         conad_err = -1;</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>     }</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span> </div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>                             conad,</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>                             <span class="stringliteral">"QC.FLAT.CONAD"</span>,</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>                             <span class="stringliteral">"e-/ADU"</span>,</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>                             <span class="stringliteral">"Conversion factor from ADU to electrons"</span>,</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>                             setting->instrument);</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>         </div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>                             conad_err,</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>                             <span class="stringliteral">"QC.FLAT.CONADERR"</span>,</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>                             <span class="stringliteral">"e-/ADU"</span>,</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>                             <span class="stringliteral">"Error on conversion factor ADU/electrons"</span>,</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>                             setting->instrument);  </div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>     <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span> </div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>     cleanup;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span> }</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span> </div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__screen__flat__impl_8h-source.html b/html/fors__img__screen__flat__impl_8h-source.html
deleted file mode 100644
index 91bb7d8..0000000
--- a/html/fors__img__screen__flat__impl_8h-source.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_screen_flat_impl.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_img_screen_flat_impl.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_screen_flat_impl.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_IMG_SCREEN_FLAT_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_IMG_SCREEN_FLAT_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__screen__flat.html#g9423928a6bbf5fa7d8ca95661ced4d1e">fors_img_screen_flat_name</a>;
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__screen__flat.html#gc5ff969a1df38b9da80ab308f823132d">fors_img_screen_flat_description_short</a>;
-<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__screen__flat.html#ge5a540ddd41737890da74f817765cefd">fors_img_screen_flat_author</a>;
-<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__screen__flat.html#g9713c3ac85f9ad32781dd22fcd81775f">fors_img_screen_flat_email</a>;
-<a name="l00039"></a>00039 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__screen__flat.html#g584ddcde63f204f4110497cab0e49075">fors_img_screen_flat_description</a>;
-<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="group__fors__img__screen__flat.html#g8bd60f1e1c99dff8aa58da8d21eeeb02">fors_img_screen_flat_define_parameters</a>(cpl_parameterlist *parameters);
-<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="group__fors__img__screen__flat.html#g6ada02347c7648aaa61ce6bc000910e5">fors_img_screen_flat</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 CPL_END_DECLS
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__screen__flat__impl_8h_source.html b/html/fors__img__screen__flat__impl_8h_source.html
new file mode 100644
index 0000000..798c063
--- /dev/null
+++ b/html/fors__img__screen__flat__impl_8h_source.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_screen_flat_impl.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_screen_flat_impl.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_screen_flat_impl.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.4 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_IMG_SCREEN_FLAT_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_IMG_SCREEN_FLAT_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_screen_flat_name;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_screen_flat_description_short;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_screen_flat_author;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_screen_flat_email;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_screen_flat_description;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__screen__flat.html#ga19e0710196db92a992d5c1502c35a5f0" title="Define recipe parameters.">fors_img_screen_flat_define_parameters</a>(cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__screen__flat.html#gad6f0f603eedc00271082e6dae9dbd2a6" title="Do the processing.">fors_img_screen_flat</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__sky__flat-test_8c-source.html b/html/fors__img__sky__flat-test_8c-source.html
deleted file mode 100644
index 8de6bcc..0000000
--- a/html/fors__img__sky__flat-test_8c-source.html
+++ /dev/null
@@ -1,173 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_sky_flat-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_img_sky_flat-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_sky_flat-test.c,v 1.7 2007/11/26 14:30:52 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/11/26 14:30:52 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_img_sky_flat_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <test.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00047"></a>00047 <span class="preprocessor">#undef cleanup</span>
-<a name="l00048"></a><a class="code" href="group__fors__img__sky__flat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00048</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">do { \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">    cpl_frameset_delete(frames); \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">    fors_image_delete(&raw_sflat); \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">    fors_image_delete(&master_sflat); \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">    fors_image_delete(&master_bias); \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">} while(0)</span>
-<a name="l00057"></a>00057 <span class="preprocessor"></span>
-<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00062"></a><a class="code" href="group__fors__img__sky__flat__test.html#g18f82989adfe64f6e50c56a10b9eed98">00062</a> <a class="code" href="group__fors__img__sky__flat__test.html#g18f82989adfe64f6e50c56a10b9eed98">test_img_sky_flat</a>(<span class="keywordtype">void</span>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     <span class="comment">/* Input */</span>
-<a name="l00065"></a>00065     cpl_frameset *frames = cpl_frameset_new();
-<a name="l00066"></a>00066     cpl_parameterlist *parameters = cpl_parameterlist_new();
-<a name="l00067"></a>00067 
-<a name="l00068"></a>00068     <span class="comment">/* Output */</span>
-<a name="l00069"></a>00069     <a class="code" href="struct__fors__image.html">fors_image</a> *raw_sflat = NULL;
-<a name="l00070"></a>00070     <a class="code" href="struct__fors__image.html">fors_image</a> *master_sflat = NULL;
-<a name="l00071"></a>00071     <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias = NULL;
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075     <span class="comment">/* Simulate data */</span>
-<a name="l00076"></a>00076     <span class="keyword">const</span> <span class="keywordtype">char</span> *sky_flat_filename[] = {<span class="stringliteral">"img_sky_flat_1.fits"</span>,
-<a name="l00077"></a>00077                                        <span class="stringliteral">"img_sky_flat_2.fits"</span>,
-<a name="l00078"></a>00078                                        <span class="stringliteral">"img_sky_flat_3.fits"</span>};
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080     <span class="keywordtype">double</span> sky_flat_exptime[] = {1, 2, 5};
-<a name="l00081"></a>00081     {
-<a name="l00082"></a>00082         <span class="keywordtype">unsigned</span> i;
-<a name="l00083"></a>00083         
-<a name="l00084"></a>00084         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(sky_flat_filename)/<span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *); i++) {
-<a name="l00085"></a>00085             cpl_frame *sflat = <a class="code" href="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669">create_sky_flat</a>(sky_flat_filename[i],
-<a name="l00086"></a>00086                                                SKY_FLAT_IMG, CPL_FRAME_GROUP_RAW,
-<a name="l00087"></a>00087                                                sky_flat_exptime[i]);
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089             cpl_frame_set_group(sflat, CPL_FRAME_GROUP_RAW);
-<a name="l00090"></a>00090             cpl_frameset_insert(frames, sflat);
-<a name="l00091"></a>00091         }
-<a name="l00092"></a>00092     }
-<a name="l00093"></a>00093     
-<a name="l00094"></a>00094     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_get_first(frames));
-<a name="l00095"></a>00095     
-<a name="l00096"></a>00096     cpl_frameset_insert(frames, 
-<a name="l00097"></a>00097                         <a class="code" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">create_bias</a>(<span class="stringliteral">"img_sky_flat_master_bias.fits"</span>, 
-<a name="l00098"></a>00098                                     MASTER_BIAS, CPL_FRAME_GROUP_CALIB));
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100     <a class="code" href="group__fors__img__sky__flat.html#gec7c64a6e66a6461f399baba1d71640c">fors_img_sky_flat_define_parameters</a>(parameters);
-<a name="l00101"></a>00101     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00102"></a>00102             <span class="stringliteral">"Create parameters failed"</span>);
-<a name="l00103"></a>00103     
-<a name="l00104"></a>00104     <a class="code" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">fors_parameterlist_set_defaults</a>(parameters);
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106     <span class="comment">/* Call recipe */</span>
-<a name="l00107"></a>00107     <a class="code" href="group__fors__img__sky__flat.html#g46d79972dcc1d750bb362f17bd454517">fors_img_sky_flat</a>(frames, parameters);
-<a name="l00108"></a>00108     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00109"></a>00109             <span class="stringliteral">"Execution error"</span>);
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111     <span class="comment">/* Test results */</span>
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="comment">/* Existence */</span>
-<a name="l00114"></a>00114     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[] = {MASTER_SKY_FLAT_IMG};
-<a name="l00115"></a>00115     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[] = {<span class="stringliteral">"QC OVEREXPO"</span>};
-<a name="l00116"></a>00116     <a class="code" href="group__test.html#ge4730f9510e545e738aef9c8b7459b8b">test_recipe_output</a>(frames,
-<a name="l00117"></a>00117                        product_tags, <span class="keyword">sizeof</span> product_tags / <span class="keyword">sizeof</span> *product_tags,
-<a name="l00118"></a>00118                MASTER_SKY_FLAT_IMG,
-<a name="l00119"></a>00119                        qc, <span class="keyword">sizeof</span> qc / <span class="keyword">sizeof</span> *qc);
-<a name="l00120"></a>00120     
-<a name="l00121"></a>00121     <span class="comment">/* Numbers */</span>
-<a name="l00122"></a>00122     {
-<a name="l00123"></a>00123         <span class="comment">/* New and previous frames */</span>
-<a name="l00124"></a>00124         test( cpl_frameset_find(frames, MASTER_BIAS) != NULL );
-<a name="l00125"></a>00125         test( cpl_frameset_find(frames, SKY_FLAT_IMG) != NULL );
-<a name="l00126"></a>00126         
-<a name="l00127"></a>00127         master_sflat = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00128"></a>00128             cpl_frameset_find(frames, MASTER_SKY_FLAT_IMG), NULL, setting, NULL);
-<a name="l00129"></a>00129         
-<a name="l00130"></a>00130         master_bias  = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00131"></a>00131             cpl_frameset_find(frames, MASTER_BIAS), NULL, setting, NULL);
-<a name="l00132"></a>00132         
-<a name="l00133"></a>00133         raw_sflat    = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(
-<a name="l00134"></a>00134             cpl_frameset_find(frames, SKY_FLAT_IMG), NULL, setting, NULL);
-<a name="l00135"></a>00135         
-<a name="l00136"></a>00136         <span class="comment">/* Verify that relative error decreased  */</span>
-<a name="l00137"></a>00137         test( <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(master_sflat, NULL) /
-<a name="l00138"></a>00138               <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(master_sflat, NULL) 
-<a name="l00139"></a>00139               <
-<a name="l00140"></a>00140               <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(raw_sflat, NULL) /
-<a name="l00141"></a>00141               <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(raw_sflat, NULL));
-<a name="l00142"></a>00142 
-<a name="l00143"></a>00143         <span class="comment">/* Verify normalization */</span>
-<a name="l00144"></a>00144         test_rel( <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(master_sflat, NULL),
-<a name="l00145"></a>00145                   1.0, 0.01);
-<a name="l00146"></a>00146     }
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00149"></a>00149     <span class="keywordflow">return</span>;
-<a name="l00150"></a>00150 }
-<a name="l00151"></a>00151 
-<a name="l00155"></a><a class="code" href="group__fors__img__sky__flat__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00155</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00156"></a>00156 {
-<a name="l00157"></a>00157     TEST_INIT;
-<a name="l00158"></a>00158     
-<a name="l00159"></a>00159     <a class="code" href="group__fors__img__sky__flat__test.html#g18f82989adfe64f6e50c56a10b9eed98">test_img_sky_flat</a>();
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161     TEST_END;
-<a name="l00162"></a>00162 }
-<a name="l00163"></a>00163 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__sky__flat-test_8c_source.html b/html/fors__img__sky__flat-test_8c_source.html
new file mode 100644
index 0000000..07cb5d9
--- /dev/null
+++ b/html/fors__img__sky__flat-test_8c_source.html
@@ -0,0 +1,212 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_sky_flat-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_sky_flat-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_sky_flat-test.c,v 1.8 2013-09-11 10:04:21 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-11 10:04:21 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_img_sky_flat_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">    cpl_frameset_delete(frames); \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">    fors_image_delete(&raw_sflat); \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">    fors_image_delete(&master_sflat); \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">    fors_image_delete(&master_bias); \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__img__sky__flat__test.html#ga885513ffa26feb33dd89087279376767">   62</a></span> <a class="code" href="group__fors__img__sky__flat__test.html#ga885513ffa26feb33dd89087279376767" title="Test sky flat recipe.">test_img_sky_flat</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     <span class="comment">/* Input */</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_frameset *frames = cpl_frameset_new();</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     cpl_parameterlist *parameters = cpl_parameterlist_new();</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     <span class="comment">/* Output */</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *raw_sflat = NULL;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_sflat = NULL;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias = NULL;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <span class="comment">/* Simulate data */</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *sky_flat_filename[] = {<span class="stringliteral">"img_sky_flat_1.fits"</span>,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                                        <span class="stringliteral">"img_sky_flat_2.fits"</span>,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                        <span class="stringliteral">"img_sky_flat_3.fits"</span>};</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     <span class="keywordtype">double</span> sky_flat_exptime[] = {1, 2, 5};</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     {</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>         <span class="keywordtype">unsigned</span> i;</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>         </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(sky_flat_filename)/<span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *); i++) {</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>             cpl_frame *sflat = <a class="code" href="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103" title="Simulate sky flat image.">create_sky_flat</a>(sky_flat_filename[i],</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                                                SKY_FLAT_IMG, CPL_FRAME_GROUP_RAW,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                                                sky_flat_exptime[i]);</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>             cpl_frame_set_group(sflat, CPL_FRAME_GROUP_RAW);</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>             cpl_frameset_insert(frames, sflat);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>         }</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     }</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_get_position(frames, 0));</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     cpl_frameset_insert(frames, </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                         <a class="code" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e" title="Simulate bias image.">create_bias</a>(<span class="stringliteral">"img_sky_flat_master_bias.fits"</span>, </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>                                     MASTER_BIAS, CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <a class="code" href="group__fors__img__sky__flat.html#ga61b98b9ade434fed2b939774f5c6c7eb" title="Define recipe parameters.">fors_img_sky_flat_define_parameters</a>(parameters);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>             <span class="stringliteral">"Create parameters failed"</span>);</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <a class="code" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42" title="Set unset parameters to default value.">fors_parameterlist_set_defaults</a>(parameters);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> </div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="comment">/* Call recipe */</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <a class="code" href="group__fors__img__sky__flat.html#ga6624d51caa8c203f494562b809cd9b9b" title="Do the processing.">fors_img_sky_flat</a>(frames, parameters);</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>             <span class="stringliteral">"Execution error"</span>);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="comment">/* Test results */</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="comment">/* Existence */</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[] = {MASTER_SKY_FLAT_IMG};</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[] = {<span class="stringliteral">"QC OVEREXPO"</span>};</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <a class="code" href="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c" title="Test existence of recipe products.">test_recipe_output</a>(frames,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                        product_tags, <span class="keyword">sizeof</span> product_tags / <span class="keyword">sizeof</span> *product_tags,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                MASTER_SKY_FLAT_IMG,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                        qc, <span class="keyword">sizeof</span> qc / <span class="keyword">sizeof</span> *qc);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="comment">/* Numbers */</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     {</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>         <span class="comment">/* New and previous frames */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>         test( cpl_frameset_find(frames, MASTER_BIAS) != NULL );</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>         test( cpl_frameset_find(frames, SKY_FLAT_IMG) != NULL );</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>         master_sflat = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>             cpl_frameset_find(frames, MASTER_SKY_FLAT_IMG), NULL, setting, NULL);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>         master_bias  = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>             cpl_frameset_find(frames, MASTER_BIAS), NULL, setting, NULL);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>         raw_sflat    = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>             cpl_frameset_find(frames, SKY_FLAT_IMG), NULL, setting, NULL);</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>         </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         <span class="comment">/* Verify that relative error decreased  */</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>         test( <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(master_sflat, NULL) /</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>               <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(master_sflat, NULL) </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>               <</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>               <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(raw_sflat, NULL) /</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>               <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(raw_sflat, NULL));</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <span class="comment">/* Verify normalization */</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>         test_rel( <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(master_sflat, NULL),</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                   1.0, 0.01);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     }</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     cleanup;</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> }</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno"><a class="code" href="group__fors__img__sky__flat__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  155</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> {</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     TEST_INIT;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <a class="code" href="group__fors__img__sky__flat__test.html#ga885513ffa26feb33dd89087279376767" title="Test sky flat recipe.">test_img_sky_flat</a>();</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     TEST_END;</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> }</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__sky__flat_8c-source.html b/html/fors__img__sky__flat_8c-source.html
deleted file mode 100644
index aa448ed..0000000
--- a/html/fors__img__sky__flat_8c-source.html
+++ /dev/null
@@ -1,198 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_sky_flat.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_img_sky_flat.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_sky_flat.c,v 1.8 2011/10/12 15:00:51 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/12 15:00:51 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_img_sky_flat_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#g2fd81ec014584d5e4812ceec9fced368">fors_img_sky_flat_create</a>(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#g73801ec3f11f5acf82354dce429c7364">fors_img_sky_flat_exec</a>(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#g41907dc5910fef4332bc850d202cdf0a">fors_img_sky_flat_destroy</a>(cpl_plugin *);
-<a name="l00041"></a>00041 
-<a name="l00062"></a><a class="code" href="group__fors__img__sky__flat.html#g4abb403976fc3ddcaa614c59a44590c9">00062</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00065"></a>00065     cpl_plugin *plugin = &recipe->interface;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>())
-<a name="l00068"></a>00068     {
-<a name="l00069"></a>00069         cpl_msg_error(cpl_func, 
-<a name="l00070"></a>00070               <span class="stringliteral">"I am fors_img_sky_flat version %d, but I am linking "</span>
-<a name="l00071"></a>00071               <span class="stringliteral">"against the FORS library version %d. "</span>
-<a name="l00072"></a>00072               <span class="stringliteral">"This will not work. "</span>
-<a name="l00073"></a>00073               <span class="stringliteral">"Please remove all previous installations "</span>
-<a name="l00074"></a>00074               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,
-<a name="l00075"></a>00075               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>());
-<a name="l00076"></a>00076         <span class="keywordflow">return</span> 1;
-<a name="l00077"></a>00077     }
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079     cpl_plugin_init(plugin,
-<a name="l00080"></a>00080                     CPL_PLUGIN_API,
-<a name="l00081"></a>00081                     FORS_BINARY_VERSION,
-<a name="l00082"></a>00082                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00083"></a>00083                     <a class="code" href="group__fors__img__sky__flat.html#g58ccd117747a3c69f4c3639d8c69a8e7">fors_img_sky_flat_name</a>,
-<a name="l00084"></a>00084                     <a class="code" href="group__fors__img__sky__flat.html#g4c9a895d70a777d2e7e1c6dff6c2523e">fors_img_sky_flat_description_short</a>,
-<a name="l00085"></a>00085                     <a class="code" href="group__fors__img__sky__flat.html#g6e7c504f168bc6f8319b544b066ceb85">fors_img_sky_flat_description</a>,
-<a name="l00086"></a>00086                     <a class="code" href="group__fors__img__sky__flat.html#g2eb550caafa47d2df3a812a099d0a4f8">fors_img_sky_flat_author</a>,
-<a name="l00087"></a>00087                     <a class="code" href="group__fors__img__sky__flat.html#gda5355fc3361e98892a671bb9757194f">fors_img_sky_flat_email</a>,
-<a name="l00088"></a>00088                     <a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a>(),
-<a name="l00089"></a>00089                     <a class="code" href="group__fors__img__sky__flat.html#g2fd81ec014584d5e4812ceec9fced368">fors_img_sky_flat_create</a>,
-<a name="l00090"></a>00090                     <a class="code" href="group__fors__img__sky__flat.html#g73801ec3f11f5acf82354dce429c7364">fors_img_sky_flat_exec</a>,
-<a name="l00091"></a>00091                     <a class="code" href="group__fors__img__sky__flat.html#g41907dc5910fef4332bc850d202cdf0a">fors_img_sky_flat_destroy</a>);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     cpl_pluginlist_append(list, plugin);
-<a name="l00094"></a>00094     
-<a name="l00095"></a>00095     <span class="keywordflow">return</span> 0;
-<a name="l00096"></a>00096 }
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 
-<a name="l00109"></a><a class="code" href="group__fors__img__sky__flat.html#g2fd81ec014584d5e4812ceec9fced368">00109</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#g2fd81ec014584d5e4812ceec9fced368">fors_img_sky_flat_create</a>(cpl_plugin *plugin)
-<a name="l00110"></a>00110 {
-<a name="l00111"></a>00111     cpl_recipe    *recipe;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00114"></a>00114         cpl_msg_error(cpl_func, 
-<a name="l00115"></a>00115                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00116"></a>00116                       <span class="stringliteral">"refusing to create recipe fors_img_sky_flat"</span>, 
-<a name="l00117"></a>00117                       cpl_error_get_message());
-<a name="l00118"></a>00118         <span class="keywordflow">return</span> 1;
-<a name="l00119"></a>00119     }
-<a name="l00120"></a>00120     
-<a name="l00121"></a>00121     <span class="comment">/* </span>
-<a name="l00122"></a>00122 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00123"></a>00123 <span class="comment">     */</span>
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00126"></a>00126         recipe = (cpl_recipe *)plugin;
-<a name="l00127"></a>00127     }
-<a name="l00128"></a>00128     <span class="keywordflow">else</span> {
-<a name="l00129"></a>00129         <span class="keywordflow">return</span> 1;
-<a name="l00130"></a>00130     }
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* </span>
-<a name="l00133"></a>00133 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00134"></a>00134 <span class="comment">     */</span>
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00137"></a>00137     
-<a name="l00138"></a>00138     <a class="code" href="group__fors__img__sky__flat.html#gec7c64a6e66a6461f399baba1d71640c">fors_img_sky_flat_define_parameters</a>(recipe->parameters);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00141"></a>00141         cpl_msg_error(cpl_func, 
-<a name="l00142"></a>00142                       <span class="stringliteral">"Could not create fors_img_sky_flat parameters"</span>);
-<a name="l00143"></a>00143         <span class="keywordflow">return</span> 1;
-<a name="l00144"></a>00144     }
-<a name="l00145"></a>00145         
-<a name="l00146"></a>00146     <span class="keywordflow">return</span> 0;
-<a name="l00147"></a>00147 }
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 
-<a name="l00158"></a><a class="code" href="group__fors__img__sky__flat.html#g73801ec3f11f5acf82354dce429c7364">00158</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#g73801ec3f11f5acf82354dce429c7364">fors_img_sky_flat_exec</a>(cpl_plugin *plugin)
-<a name="l00159"></a>00159 {
-<a name="l00160"></a>00160     cpl_recipe *recipe;
-<a name="l00161"></a>00161     cpl_errorstate initial_errorstate = cpl_errorstate_get();
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00164"></a>00164         cpl_msg_error(cpl_func, 
-<a name="l00165"></a>00165                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00166"></a>00166                       <span class="stringliteral">"refusing to execute recipe fors_img_sky_flat"</span>, 
-<a name="l00167"></a>00167                       cpl_error_get_message());
-<a name="l00168"></a>00168         <span class="keywordflow">return</span> 1;
-<a name="l00169"></a>00169     }
-<a name="l00170"></a>00170     
-<a name="l00171"></a>00171     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00172"></a>00172         recipe = (cpl_recipe *)plugin;
-<a name="l00173"></a>00173     }
-<a name="l00174"></a>00174     <span class="keywordflow">else</span> {
-<a name="l00175"></a>00175         <span class="keywordflow">return</span> 1;
-<a name="l00176"></a>00176     }
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="keywordflow">if</span> (recipe->frames == NULL) {
-<a name="l00179"></a>00179         cpl_msg_error(cpl_func, 
-<a name="l00180"></a>00180                       <span class="stringliteral">"Null frameset"</span>);
-<a name="l00181"></a>00181         <span class="keywordflow">return</span> 1;
-<a name="l00182"></a>00182     }
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">if</span> (recipe->parameters == NULL) {
-<a name="l00185"></a>00185         cpl_msg_error(cpl_func, 
-<a name="l00186"></a>00186                       <span class="stringliteral">"Null parameter list"</span>);
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> 1;
-<a name="l00188"></a>00188     }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a>(recipe->frames,
-<a name="l00191"></a>00191                <a class="code" href="group__fors__img__sky__flat.html#g4c9a895d70a777d2e7e1c6dff6c2523e">fors_img_sky_flat_description_short</a>);
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <a class="code" href="group__fors__img__sky__flat.html#g46d79972dcc1d750bb362f17bd454517">fors_img_sky_flat</a>(recipe->frames, recipe->parameters);
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a>(recipe->frames, initial_errorstate);
-<a name="l00196"></a>00196 }
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 
-<a name="l00207"></a><a class="code" href="group__fors__img__sky__flat.html#g41907dc5910fef4332bc850d202cdf0a">00207</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#g41907dc5910fef4332bc850d202cdf0a">fors_img_sky_flat_destroy</a>(cpl_plugin *plugin)
-<a name="l00208"></a>00208 {
-<a name="l00209"></a>00209     cpl_recipe *recipe;
-<a name="l00210"></a>00210     
-<a name="l00211"></a>00211     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00212"></a>00212         recipe = (cpl_recipe *)plugin;
-<a name="l00213"></a>00213     }
-<a name="l00214"></a>00214     <span class="keywordflow">else</span> {
-<a name="l00215"></a>00215         <span class="keywordflow">return</span> -1;
-<a name="l00216"></a>00216     }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     <span class="keywordflow">return</span> 0;
-<a name="l00221"></a>00221 }
-<a name="l00222"></a>00222 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__sky__flat_8c_source.html b/html/fors__img__sky__flat_8c_source.html
new file mode 100644
index 0000000..65977d7
--- /dev/null
+++ b/html/fors__img__sky__flat_8c_source.html
@@ -0,0 +1,237 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_sky_flat.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_sky_flat.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_sky_flat.c,v 1.8 2011-10-12 15:00:51 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-12 15:00:51 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_img_sky_flat_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#ga02c59acaaf71d4b2e9b4df6e5a452695" title="Setup the recipe options.">fors_img_sky_flat_create</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#ga3cf0bca5c79ec81295fe4402b9580063" title="Execute the plugin instance given by the interface.">fors_img_sky_flat_exec</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#ga7182fc139ef9c00488f2df5e96be18b3" title="Destroy what has been created by the 'create' function.">fors_img_sky_flat_destroy</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__img__sky__flat.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">   62</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>())</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     {</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>               <span class="stringliteral">"I am fors_img_sky_flat version %d, but I am linking "</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>               <span class="stringliteral">"against the FORS library version %d. "</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>               <span class="stringliteral">"This will not work. "</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>               <span class="stringliteral">"Please remove all previous installations "</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>());</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     }</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                     fors_img_sky_flat_name,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                     fors_img_sky_flat_description_short,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     fors_img_sky_flat_description,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                     fors_img_sky_flat_author,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                     fors_img_sky_flat_email,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     <a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87" title="Get the pipeline copyright and license.">fors_get_license</a>(),</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     <a class="code" href="group__fors__img__sky__flat.html#ga02c59acaaf71d4b2e9b4df6e5a452695" title="Setup the recipe options.">fors_img_sky_flat_create</a>,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     <a class="code" href="group__fors__img__sky__flat.html#ga3cf0bca5c79ec81295fe4402b9580063" title="Execute the plugin instance given by the interface.">fors_img_sky_flat_exec</a>,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <a class="code" href="group__fors__img__sky__flat.html#ga7182fc139ef9c00488f2df5e96be18b3" title="Destroy what has been created by the 'create' function.">fors_img_sky_flat_destroy</a>);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> }</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="group__fors__img__sky__flat.html#ga02c59acaaf71d4b2e9b4df6e5a452695">  109</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#ga02c59acaaf71d4b2e9b4df6e5a452695" title="Setup the recipe options.">fors_img_sky_flat_create</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                       <span class="stringliteral">"refusing to create recipe fors_img_sky_flat"</span>, </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     }</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     }</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <a class="code" href="group__fors__img__sky__flat.html#ga61b98b9ade434fed2b939774f5c6c7eb" title="Define recipe parameters.">fors_img_sky_flat_define_parameters</a>(recipe->parameters);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                       <span class="stringliteral">"Could not create fors_img_sky_flat parameters"</span>);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     }</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> }</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="group__fors__img__sky__flat.html#ga3cf0bca5c79ec81295fe4402b9580063">  158</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#ga3cf0bca5c79ec81295fe4402b9580063" title="Execute the plugin instance given by the interface.">fors_img_sky_flat_exec</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> {</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_errorstate initial_errorstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                       <span class="stringliteral">"refusing to execute recipe fors_img_sky_flat"</span>, </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">if</span> (recipe->frames == NULL) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                       <span class="stringliteral">"Null frameset"</span>);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     }</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL) {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                       <span class="stringliteral">"Null parameter list"</span>);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce" title="Start recipe execution.">fors_begin</a>(recipe->frames,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                fors_img_sky_flat_description_short);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <a class="code" href="group__fors__img__sky__flat.html#ga6624d51caa8c203f494562b809cd9b9b" title="Do the processing.">fors_img_sky_flat</a>(recipe->frames, recipe->parameters);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9" title="End recipe execution.">fors_end</a>(recipe->frames, initial_errorstate);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> }</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno"><a class="code" href="group__fors__img__sky__flat.html#ga7182fc139ef9c00488f2df5e96be18b3">  207</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__img__sky__flat.html#ga7182fc139ef9c00488f2df5e96be18b3" title="Destroy what has been created by the 'create' function.">fors_img_sky_flat_destroy</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> {</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     }</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> }</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__sky__flat__impl_8c-source.html b/html/fors__img__sky__flat__impl_8c-source.html
deleted file mode 100644
index 6e48484..0000000
--- a/html/fors__img__sky__flat__impl_8c-source.html
+++ /dev/null
@@ -1,242 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_sky_flat_impl.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_img_sky_flat_impl.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_sky_flat_impl.c,v 1.25 2013/02/15 10:55:44 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/02/15 10:55:44 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.25 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_img_sky_flat_impl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_stack.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00047"></a><a class="code" href="group__fors__img__sky__flat.html#g58ccd117747a3c69f4c3639d8c69a8e7">00047</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__sky__flat.html#g58ccd117747a3c69f4c3639d8c69a8e7">fors_img_sky_flat_name</a> = <span class="stringliteral">"fors_img_sky_flat"</span>;
-<a name="l00048"></a><a class="code" href="group__fors__img__sky__flat.html#g4c9a895d70a777d2e7e1c6dff6c2523e">00048</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__sky__flat.html#g4c9a895d70a777d2e7e1c6dff6c2523e">fors_img_sky_flat_description_short</a> = <span class="stringliteral">"Compute master img_sky_flat frame"</span>;
-<a name="l00049"></a><a class="code" href="group__fors__img__sky__flat.html#g2eb550caafa47d2df3a812a099d0a4f8">00049</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__sky__flat.html#g2eb550caafa47d2df3a812a099d0a4f8">fors_img_sky_flat_author</a> = <span class="stringliteral">"Jonas M. Larsen"</span>;
-<a name="l00050"></a><a class="code" href="group__fors__img__sky__flat.html#gda5355fc3361e98892a671bb9757194f">00050</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__sky__flat.html#gda5355fc3361e98892a671bb9757194f">fors_img_sky_flat_email</a> = PACKAGE_BUGREPORT;
-<a name="l00051"></a><a class="code" href="group__fors__img__sky__flat.html#g6e7c504f168bc6f8319b544b066ceb85">00051</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__sky__flat.html#g6e7c504f168bc6f8319b544b066ceb85">fors_img_sky_flat_description</a> = 
-<a name="l00052"></a>00052 <span class="stringliteral">"Input files:\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"  SKY_FLAT_IMG               Raw         Jittered sky flat fields    1+\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"Output files:\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flat field\n"</span>;
-<a name="l00065"></a><a class="code" href="group__fors__img__sky__flat.html#gec7c64a6e66a6461f399baba1d71640c">00065</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__sky__flat.html#gec7c64a6e66a6461f399baba1d71640c">fors_img_sky_flat_define_parameters</a>(cpl_parameterlist *parameters)
-<a name="l00066"></a>00066 {
-<a name="l00067"></a>00067     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__img__sky__flat.html#g58ccd117747a3c69f4c3639d8c69a8e7">fors_img_sky_flat_name</a>);
-<a name="l00068"></a>00068     
-<a name="l00069"></a>00069     <a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a>(parameters, context, <span class="stringliteral">"median"</span>);
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071     cpl_free((<span class="keywordtype">void</span> *)context);
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073     <span class="keywordflow">return</span>;
-<a name="l00074"></a>00074 }
-<a name="l00075"></a>00075 
-<a name="l00076"></a>00076 <span class="preprocessor">#undef cleanup</span>
-<a name="l00077"></a><a class="code" href="group__fors__img__sky__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343">00077</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">do { \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">    cpl_frameset_delete(sflat_frames); \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">    cpl_frameset_delete(master_bias_frame); \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">    fors_stack_method_delete(&sm); \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">    cpl_free((void *)context); \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">    fors_image_delete_const(&master_bias); \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">    fors_image_delete(&master_sky_flat); \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">    fors_image_list_delete(&sflats, fors_image_delete); \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">    cpl_propertylist_delete(qc); \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">} while (0)</span>
-<a name="l00089"></a>00089 <span class="preprocessor"></span>
-<a name="l00098"></a><a class="code" href="group__fors__img__sky__flat.html#g46d79972dcc1d750bb362f17bd454517">00098</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__sky__flat.html#g46d79972dcc1d750bb362f17bd454517">fors_img_sky_flat</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)
-<a name="l00099"></a>00099 {
-<a name="l00100"></a>00100     <span class="comment">/* Raw */</span>
-<a name="l00101"></a>00101     cpl_frameset *sflat_frames      = NULL;
-<a name="l00102"></a>00102     fors_image_list *sflats         = NULL;
-<a name="l00103"></a>00103 
-<a name="l00104"></a>00104     <span class="comment">/* Calibration */</span>
-<a name="l00105"></a>00105     cpl_frameset *master_bias_frame = NULL;
-<a name="l00106"></a>00106     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias   = NULL; 
-<a name="l00107"></a>00107 
-<a name="l00108"></a>00108     <span class="comment">/* Products */</span>
-<a name="l00109"></a>00109     <a class="code" href="struct__fors__image.html">fors_image</a> *master_sky_flat = NULL;
-<a name="l00110"></a>00110     cpl_propertylist *qc = cpl_propertylist_new();
-<a name="l00111"></a>00111     <span class="keywordtype">double</span> saturation;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="comment">/* Parameters */</span>
-<a name="l00114"></a>00114     stack_method *sm = NULL;
-<a name="l00115"></a>00115 
-<a name="l00116"></a>00116     <span class="comment">/* Other */</span>
-<a name="l00117"></a>00117     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__img__sky__flat.html#g58ccd117747a3c69f4c3639d8c69a8e7">fors_img_sky_flat_name</a>);
-<a name="l00118"></a>00118     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00119"></a>00119 
-<a name="l00120"></a>00120     <span class="comment">/* QCs about sky level */</span>
-<a name="l00121"></a>00121     <span class="keywordtype">double</span> skylevel, skylevmax, skylevmin;
-<a name="l00122"></a>00122     <span class="keywordtype">int</span>    first_frame;
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124     <span class="comment">/* Get parameters */</span>
-<a name="l00125"></a>00125     sm = <a class="code" href="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af">fors_stack_method_new</a>(parameters, context);
-<a name="l00126"></a>00126     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get stacking method"</span>);
-<a name="l00127"></a>00127 
-<a name="l00128"></a>00128     <span class="comment">/* Eliminate irrelevant RAW frames (header would be inherited from them) */</span>
-<a name="l00129"></a>00129     cpl_frameset_erase(frames, <span class="stringliteral">"TEST"</span>);
-<a name="l00130"></a>00130     
-<a name="l00131"></a>00131     <span class="comment">/* Find raw */</span>
-<a name="l00132"></a>00132     sflat_frames = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, SKY_FLAT_IMG);
-<a name="l00133"></a>00133     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(sflat_frames) > 0, <span class="keywordflow">return</span>, 
-<a name="l00134"></a>00134             <span class="stringliteral">"No %s provided"</span>, SKY_FLAT_IMG);
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     <span class="comment">/* Find calibration */</span>
-<a name="l00137"></a>00137     master_bias_frame = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, MASTER_BIAS);
-<a name="l00138"></a>00138     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(master_bias_frame) == 1, <span class="keywordflow">return</span>, 
-<a name="l00139"></a>00139             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, 
-<a name="l00140"></a>00140             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame));
-<a name="l00141"></a>00141 
-<a name="l00142"></a>00142     <span class="comment">/* Get setting */</span>
-<a name="l00143"></a>00143     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_get_first_const(sflat_frames));
-<a name="l00144"></a>00144     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );
-<a name="l00145"></a>00145     
-<a name="l00146"></a>00146     master_bias = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(cpl_frameset_get_first(master_bias_frame), 
-<a name="l00147"></a>00147                                   NULL, setting, NULL);
-<a name="l00148"></a>00148     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00149"></a>00149             <span class="stringliteral">"Could not load master bias"</span>);
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     <span class="comment">/* Load raw frames, subtract bias */</span>
-<a name="l00152"></a>00152     sflats = <a class="code" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list</a>(sflat_frames, master_bias, setting, &saturation);
-<a name="l00153"></a>00153     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load sky flat images"</span>);
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     <span class="comment">/* Normalize to median = 1.</span>
-<a name="l00156"></a>00156 <span class="comment">     *</span>
-<a name="l00157"></a>00157 <span class="comment">     * (The input sky flats generally have different normalization because of</span>
-<a name="l00158"></a>00158 <span class="comment">     *  the time dependent sky level. We must bring the input flats</span>
-<a name="l00159"></a>00159 <span class="comment">     *  to the same normalization before stacking.)</span>
-<a name="l00160"></a>00160 <span class="comment">     */</span>
-<a name="l00161"></a>00161     {
-<a name="l00162"></a>00162         <a class="code" href="struct__fors__image.html">fors_image</a> *image;
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164         skylevel = skylevmax = skylevmin = 0.0;
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166         first_frame = 1;
-<a name="l00167"></a>00167         
-<a name="l00168"></a>00168         <span class="keywordflow">for</span> (image = fors_image_list_first(sflats);
-<a name="l00169"></a>00169              image != NULL;
-<a name="l00170"></a>00170              image = fors_image_list_next(sflats)) {
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172             skylevel = <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(image, NULL);
-<a name="l00173"></a>00173 
-<a name="l00174"></a>00174             <a class="code" href="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff">fors_image_divide_scalar</a>(image, skylevel, -1.0);
-<a name="l00175"></a>00175             
-<a name="l00176"></a>00176             <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00177"></a>00177                     <span class="stringliteral">"Raw sky flat normalization failed"</span>);
-<a name="l00178"></a>00178 
-<a name="l00179"></a>00179             <span class="keywordflow">if</span> (first_frame) {
-<a name="l00180"></a>00180                 first_frame = 0;
-<a name="l00181"></a>00181                 skylevmax = skylevmin = skylevel;
-<a name="l00182"></a>00182             }
-<a name="l00183"></a>00183             <span class="keywordflow">else</span> {
-<a name="l00184"></a>00184                 <span class="keywordflow">if</span> (skylevmax < skylevel)
-<a name="l00185"></a>00185                     skylevmax = skylevel;
-<a name="l00186"></a>00186                 <span class="keywordflow">if</span> (skylevmin > skylevel)
-<a name="l00187"></a>00187                     skylevmin = skylevel;
-<a name="l00188"></a>00188             }
-<a name="l00189"></a>00189         }
-<a name="l00190"></a>00190     }
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <span class="comment">/* Stack */</span>
-<a name="l00194"></a>00194     master_sky_flat = <a class="code" href="group__fors__stack.html#g1fd9044444484f1ee859abd3101ce8b4">fors_stack</a>(sflats, sm);
-<a name="l00195"></a>00195     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Sky flat stacking failed"</span>);
-<a name="l00196"></a>00196 
-<a name="l00197"></a>00197     <span class="comment">/* QC */</span>
-<a name="l00198"></a>00198     <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qc, <a class="code" href="group__forsqc.html#gf875be6d318687206fdb50a7c61b7924">fors_qc_dic_version</a>, setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00199"></a>00199     
-<a name="l00200"></a>00200     <a class="code" href="group__forsqc.html#g1ccea526719a1be6c14de81963d81955">fors_qc_write_group_heading</a>(cpl_frameset_get_first(sflat_frames),
-<a name="l00201"></a>00201                                 MASTER_SKY_FLAT_IMG,
-<a name="l00202"></a>00202                                 setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00203"></a>00203     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not write %s QC parameters"</span>, 
-<a name="l00204"></a>00204             MASTER_SKY_FLAT_IMG);
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00207"></a>00207                             saturation,
-<a name="l00208"></a>00208                             <span class="stringliteral">"QC.OVEREXPO"</span>,
-<a name="l00209"></a>00209                             <span class="stringliteral">"%"</span>,
-<a name="l00210"></a>00210                             <span class="stringliteral">"Percentage of overexposed pixels"</span>,
-<a name="l00211"></a>00211                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00214"></a>00214                             skylevmin,
-<a name="l00215"></a>00215                             <span class="stringliteral">"QC.SKYFLAT.FLUX.MIN"</span>,
-<a name="l00216"></a>00216                             <span class="stringliteral">"ADU"</span>,
-<a name="l00217"></a>00217                             <span class="stringliteral">"Median level of dimmest input flat"</span>,
-<a name="l00218"></a>00218                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l00221"></a>00221                             skylevmax,
-<a name="l00222"></a>00222                             <span class="stringliteral">"QC.SKYFLAT.FLUX.MAX"</span>,
-<a name="l00223"></a>00223                             <span class="stringliteral">"ADU"</span>,
-<a name="l00224"></a>00224                             <span class="stringliteral">"Median level of brightest input flat"</span>,
-<a name="l00225"></a>00225                             setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00226"></a>00226     <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l00227"></a>00227 
-<a name="l00228"></a>00228     <span class="comment">/* Save product */</span>
-<a name="l00229"></a>00229     <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, master_sky_flat, MASTER_SKY_FLAT_IMG,
-<a name="l00230"></a>00230                         qc, parameters, <a class="code" href="group__fors__img__sky__flat.html#g58ccd117747a3c69f4c3639d8c69a8e7">fors_img_sky_flat_name</a>, 
-<a name="l00231"></a>00231                         cpl_frameset_get_first(sflat_frames));
-<a name="l00232"></a>00232     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00233"></a>00233             MASTER_SKY_FLAT_IMG);
-<a name="l00234"></a>00234     
-<a name="l00235"></a>00235     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00236"></a>00236     <span class="keywordflow">return</span>;
-<a name="l00237"></a>00237 }
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__sky__flat__impl_8c_source.html b/html/fors__img__sky__flat__impl_8c_source.html
new file mode 100644
index 0000000..8134871
--- /dev/null
+++ b/html/fors__img__sky__flat__impl_8c_source.html
@@ -0,0 +1,281 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_sky_flat_impl.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_sky_flat_impl.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_sky_flat_impl.c,v 1.26 2013-09-10 19:16:36 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 19:16:36 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.26 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_img_sky_flat_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_stack.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_sky_flat_name = <span class="stringliteral">"fors_img_sky_flat"</span>;</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_sky_flat_description_short = <span class="stringliteral">"Compute master img_sky_flat frame"</span>;</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_sky_flat_author = <span class="stringliteral">"Jonas M. Larsen"</span>;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_sky_flat_email = PACKAGE_BUGREPORT;</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_sky_flat_description = </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"  SKY_FLAT_IMG               Raw         Jittered sky flat fields    1+\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flat field\n"</span>;</div>
+<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="group__fors__img__sky__flat.html#ga61b98b9ade434fed2b939774f5c6c7eb">   65</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__sky__flat.html#ga61b98b9ade434fed2b939774f5c6c7eb" title="Define recipe parameters.">fors_img_sky_flat_define_parameters</a>(cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> {</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_img_sky_flat_name);</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <a class="code" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15" title="Define recipe parameters.">fors_stack_define_parameters</a>(parameters, context, <span class="stringliteral">"median"</span>);</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     cpl_free((<span class="keywordtype">void</span> *)context);</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> }</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">    cpl_frameset_delete(sflat_frames); \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">    cpl_frameset_delete(master_bias_frame); \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">    fors_stack_method_delete(&sm); \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">    cpl_free((void *)context); \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">    fors_image_delete_const(&master_bias); \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">    fors_image_delete(&master_sky_flat); \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">    fors_image_list_delete(&sflats, fors_image_delete); \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">    cpl_propertylist_delete(qc); \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="group__fors__img__sky__flat.html#ga6624d51caa8c203f494562b809cd9b9b">   98</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__sky__flat.html#ga6624d51caa8c203f494562b809cd9b9b" title="Do the processing.">fors_img_sky_flat</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> {</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="comment">/* Raw */</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     cpl_frameset *sflat_frames      = NULL;</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     fors_image_list *sflats         = NULL;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="comment">/* Calibration */</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     cpl_frameset *master_bias_frame = NULL;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias   = NULL; </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="comment">/* Products */</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_sky_flat = NULL;</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     cpl_propertylist *qc = cpl_propertylist_new();</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="keywordtype">double</span> saturation;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="comment">/* Parameters */</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     stack_method *sm = NULL;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> </div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="comment">/* Other */</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_img_sky_flat_name);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="comment">/* QCs about sky level */</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="keywordtype">double</span> skylevel, skylevmax, skylevmin;</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="keywordtype">int</span>    first_frame;</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="comment">/* Get parameters */</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     sm = <a class="code" href="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e" title="Get stack method from parameter list.">fors_stack_method_new</a>(parameters, context);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get stacking method"</span>);</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> </div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="comment">/* Eliminate irrelevant RAW frames (header would be inherited from them) */</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     cpl_frameset_erase(frames, <span class="stringliteral">"TEST"</span>);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     <span class="comment">/* Find raw */</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     sflat_frames = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, SKY_FLAT_IMG);</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(sflat_frames) > 0, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>             <span class="stringliteral">"No %s provided"</span>, SKY_FLAT_IMG);</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     <span class="comment">/* Find calibration */</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     master_bias_frame = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, MASTER_BIAS);</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(master_bias_frame) == 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame));</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="comment">/* Get setting */</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_get_first_const(sflat_frames));</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     master_bias = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(cpl_frameset_get_first(master_bias_frame), </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                                   NULL, setting, NULL);</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>             <span class="stringliteral">"Could not load master bias"</span>);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="comment">/* Load raw frames, subtract bias */</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     sflats = <a class="code" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list</a>(sflat_frames, master_bias, setting, &saturation);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load sky flat images"</span>);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="comment">/* Normalize to median = 1.</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="comment">     * (The input sky flats generally have different normalization because of</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="comment">     *  the time dependent sky level. We must bring the input flats</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="comment">     *  to the same normalization before stacking.)</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     {</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>         <a class="code" href="struct__fors__image.html">fors_image</a> *image;</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         skylevel = skylevmax = skylevmin = 0.0;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>         first_frame = 1;</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>         </div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <span class="keywordflow">for</span> (image = fors_image_list_first(sflats);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>              image != NULL;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>              image = fors_image_list_next(sflats)) {</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>             skylevel = <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(image, NULL);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>             <a class="code" href="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35" title="Divide by scalar.">fors_image_divide_scalar</a>(image, skylevel, -1.0);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>             </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>             <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>                     <span class="stringliteral">"Raw sky flat normalization failed"</span>);</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>             <span class="keywordflow">if</span> (first_frame) {</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                 first_frame = 0;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                 skylevmax = skylevmin = skylevel;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>             }</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>                 <span class="keywordflow">if</span> (skylevmax < skylevel)</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                     skylevmax = skylevel;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                 <span class="keywordflow">if</span> (skylevmin > skylevel)</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>                     skylevmin = skylevel;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>             }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>         }</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     }</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="comment">/* Stack */</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     master_sky_flat = <a class="code" href="group__fors__stack.html#ga6792068e2f3a973ad54722120779feb1" title="Same as fors_stack_const()">fors_stack</a>(sflats, sm);</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Sky flat stacking failed"</span>);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="comment">/* QC */</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qc, fors_qc_dic_version, setting->instrument);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     <a class="code" href="group__forsqc.html#ga9ff2c73c315e805ab5d1415a2de9ce0b" title="Initiate a new QC1 group and log basic QC.">fors_qc_write_group_heading</a>(cpl_frameset_get_first(sflat_frames),</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                                 MASTER_SKY_FLAT_IMG,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                                 setting->instrument);</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not write %s QC parameters"</span>, </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>             MASTER_SKY_FLAT_IMG);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                             saturation,</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                             <span class="stringliteral">"QC.OVEREXPO"</span>,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                             <span class="stringliteral">"%"</span>,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                             <span class="stringliteral">"Percentage of overexposed pixels"</span>,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                             setting->instrument);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>                             skylevmin,</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                             <span class="stringliteral">"QC.SKYFLAT.FLUX.MIN"</span>,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                             <span class="stringliteral">"Median level of dimmest input flat"</span>,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                             setting->instrument);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                             skylevmax,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                             <span class="stringliteral">"QC.SKYFLAT.FLUX.MAX"</span>,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                             <span class="stringliteral">"ADU"</span>,</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                             <span class="stringliteral">"Median level of brightest input flat"</span>,</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                             setting->instrument);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> </div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     <span class="comment">/* Save product */</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, master_sky_flat, MASTER_SKY_FLAT_IMG,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                         qc, parameters, fors_img_sky_flat_name, </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                         cpl_frameset_get_first(sflat_frames));</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>             MASTER_SKY_FLAT_IMG);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cleanup;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> }</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__img__sky__flat__impl_8h-source.html b/html/fors__img__sky__flat__impl_8h-source.html
deleted file mode 100644
index 7d2c5d6..0000000
--- a/html/fors__img__sky__flat__impl_8h-source.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_img_sky_flat_impl.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_img_sky_flat_impl.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_img_sky_flat_impl.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_IMG_SKY_FLAT_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_IMG_SKY_FLAT_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__sky__flat.html#g58ccd117747a3c69f4c3639d8c69a8e7">fors_img_sky_flat_name</a>;
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__sky__flat.html#g4c9a895d70a777d2e7e1c6dff6c2523e">fors_img_sky_flat_description_short</a>;
-<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__sky__flat.html#g2eb550caafa47d2df3a812a099d0a4f8">fors_img_sky_flat_author</a>;
-<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__sky__flat.html#gda5355fc3361e98892a671bb9757194f">fors_img_sky_flat_email</a>;
-<a name="l00039"></a>00039 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__img__sky__flat.html#g6e7c504f168bc6f8319b544b066ceb85">fors_img_sky_flat_description</a>;
-<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="group__fors__img__sky__flat.html#gec7c64a6e66a6461f399baba1d71640c">fors_img_sky_flat_define_parameters</a>(cpl_parameterlist *parameters);
-<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="group__fors__img__sky__flat.html#g46d79972dcc1d750bb362f17bd454517">fors_img_sky_flat</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 CPL_END_DECLS
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__img__sky__flat__impl_8h_source.html b/html/fors__img__sky__flat__impl_8h_source.html
new file mode 100644
index 0000000..13681a9
--- /dev/null
+++ b/html/fors__img__sky__flat__impl_8h_source.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_img_sky_flat_impl.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_img_sky_flat_impl.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_img_sky_flat_impl.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.4 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_IMG_SKY_FLAT_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_IMG_SKY_FLAT_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_sky_flat_name;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_sky_flat_description_short;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_sky_flat_author;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_sky_flat_email;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_img_sky_flat_description;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__sky__flat.html#ga61b98b9ade434fed2b939774f5c6c7eb" title="Define recipe parameters.">fors_img_sky_flat_define_parameters</a>(cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__img__sky__flat.html#ga6624d51caa8c203f494562b809cd9b9b" title="Do the processing.">fors_img_sky_flat</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__instrument_8c-source.html b/html/fors__instrument_8c-source.html
deleted file mode 100644
index 3c326db..0000000
--- a/html/fors__instrument_8c-source.html
+++ /dev/null
@@ -1,183 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_instrument.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_instrument.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_instrument.c,v 1.4 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_instrument.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <string.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a><a class="code" href="structfors__filterlist.html">00035</a> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code" href="structfors__filterlist.html">fors_filterlist</a> {
-<a name="l00036"></a><a class="code" href="structfors__filterlist.html#35bb80c76e8fa9b4526ba6a03fea5520">00036</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>  <a class="code" href="structfors__filterlist.html#35bb80c76e8fa9b4526ba6a03fea5520">name</a>[10];
-<a name="l00037"></a><a class="code" href="structfors__filterlist.html#98f2d94bcd86b7376568e913140371ac">00037</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>  <a class="code" href="structfors__filterlist.html#98f2d94bcd86b7376568e913140371ac">band</a>;
-<a name="l00038"></a>00038 } <a class="code" href="structfors__filterlist.html">fors_filterlist</a>[15] = {
-<a name="l00039"></a>00039     <span class="comment">/* FORS1 */</span>
-<a name="l00040"></a>00040     {<span class="stringliteral">"U_BESS"</span>, <span class="charliteral">'U'</span>},
-<a name="l00041"></a>00041     {<span class="stringliteral">"u_HIGH"</span>, <span class="charliteral">'U'</span>},
-<a name="l00042"></a>00042     {<span class="stringliteral">"B_BESS"</span>, <span class="charliteral">'B'</span>},
-<a name="l00043"></a>00043     {<span class="stringliteral">"b_HIGH"</span>, <span class="charliteral">'B'</span>},
-<a name="l00044"></a>00044     {<span class="stringliteral">"g_HIGH"</span>, <span class="charliteral">'V'</span>},    <span class="comment">/* G uses V ?????????????????????????????????? */</span>
-<a name="l00045"></a>00045     {<span class="stringliteral">"V_BESS"</span>, <span class="charliteral">'V'</span>},
-<a name="l00046"></a>00046     {<span class="stringliteral">"v_HIGH"</span>, <span class="charliteral">'V'</span>},
-<a name="l00047"></a>00047     {<span class="stringliteral">"R_BESS"</span>, <span class="charliteral">'R'</span>},
-<a name="l00048"></a>00048     {<span class="stringliteral">"I_BESS"</span>, <span class="charliteral">'I'</span>},
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050     <span class="comment">/* FORS2 */</span>
-<a name="l00051"></a>00051     {<span class="stringliteral">"U_SPECIAL"</span>, <span class="charliteral">'U'</span>},
-<a name="l00052"></a>00052     {<span class="stringliteral">"B_BESS"</span>   , <span class="charliteral">'B'</span>},
-<a name="l00053"></a>00053     {<span class="stringliteral">"V_BESS"</span>   , <span class="charliteral">'V'</span>},
-<a name="l00054"></a>00054     {<span class="stringliteral">"R_SPECIAL"</span>, <span class="charliteral">'R'</span>},
-<a name="l00055"></a>00055     {<span class="stringliteral">"I_BESS"</span>   , <span class="charliteral">'I'</span>},
-<a name="l00056"></a>00056     {<span class="stringliteral">""</span>         , <span class="charliteral">'\0'</span>}
-<a name="l00057"></a>00057 };
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="keyword">const</span> <span class="keywordtype">char</span>  fors_filterband_unknown = <span class="charliteral">'?'</span>,
-<a name="l00060"></a>00060             fors_filterband_none    = <span class="charliteral">'\0'</span>;
-<a name="l00061"></a>00061 
-<a name="l00076"></a>00076 <span class="keywordtype">char</span>
-<a name="l00077"></a>00077 fors_instrument_filterband_get_by_setting(  <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a>  *setting)
-<a name="l00078"></a>00078 {
-<a name="l00079"></a>00079     <span class="keywordtype">char</span>            band;
-<a name="l00080"></a>00080     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00081"></a>00081     
-<a name="l00082"></a>00082     <span class="keywordflow">if</span> (setting == NULL)
-<a name="l00083"></a>00083     {
-<a name="l00084"></a>00084         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
-<a name="l00085"></a>00085         <span class="keywordflow">return</span> fors_filterband_unknown;
-<a name="l00086"></a>00086     }
-<a name="l00087"></a>00087     
-<a name="l00088"></a>00088     band = fors_instrument_filterband_get_by_name(setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a>);
-<a name="l00089"></a>00089     <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))
-<a name="l00090"></a>00090         cpl_error_set_where(cpl_func);
-<a name="l00091"></a>00091     
-<a name="l00092"></a>00092     <span class="keywordflow">return</span> band;
-<a name="l00093"></a>00093 }
-<a name="l00094"></a>00094 
-<a name="l00106"></a>00106 <span class="keywordtype">char</span>
-<a name="l00107"></a>00107 fors_instrument_filterband_get_by_name(     <span class="keyword">const</span> <span class="keywordtype">char</span>  *filtername)
-<a name="l00108"></a>00108 {
-<a name="l00109"></a>00109     <span class="keywordtype">int</span> n;
-<a name="l00110"></a>00110     
-<a name="l00111"></a>00111     <span class="keywordflow">if</span> (filtername == NULL || filtername[0] == <span class="charliteral">'\0'</span>)
-<a name="l00112"></a>00112         <span class="keywordflow">return</span> fors_filterband_none;
-<a name="l00113"></a>00113     
-<a name="l00114"></a>00114     n = 0;
-<a name="l00115"></a>00115     <span class="keywordflow">while</span> ((<a class="code" href="structfors__filterlist.html">fors_filterlist</a>[n].name)[0] != <span class="charliteral">'\0'</span>)
-<a name="l00116"></a>00116     {
-<a name="l00117"></a>00117         <span class="keywordflow">if</span> (strcmp(filtername, <a class="code" href="structfors__filterlist.html">fors_filterlist</a>[n].name) == 0)
-<a name="l00118"></a>00118             <span class="keywordflow">return</span> <a class="code" href="structfors__filterlist.html">fors_filterlist</a>[n].band;
-<a name="l00119"></a>00119         n++;
-<a name="l00120"></a>00120     }
-<a name="l00121"></a>00121     
-<a name="l00122"></a>00122     cpl_error_set_message(                  cpl_func,
-<a name="l00123"></a>00123                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00124"></a>00124                                             <span class="stringliteral">"unknown filter name \"%s\""</span>,
-<a name="l00125"></a>00125                                             filtername);
-<a name="l00126"></a>00126     <span class="keywordflow">return</span> fors_filterband_unknown;
-<a name="l00127"></a>00127 }
-<a name="l00128"></a>00128 
-<a name="l00137"></a>00137 <span class="keywordtype">bool</span>
-<a name="l00138"></a>00138 fors_instrument_filterband_is_defined(      <span class="keywordtype">char</span>    band)
-<a name="l00139"></a>00139 {
-<a name="l00140"></a>00140     <span class="keywordflow">return</span>  (band >= <span class="charliteral">'A'</span> && band <= <span class="charliteral">'Z'</span>);
-<a name="l00141"></a>00141 }
-<a name="l00142"></a>00142 
-<a name="l00150"></a>00150 <span class="keywordtype">bool</span>
-<a name="l00151"></a>00151 fors_instrument_filterband_is_none(         <span class="keywordtype">char</span>    band)
-<a name="l00152"></a>00152 {
-<a name="l00153"></a>00153     <span class="keywordflow">return</span>  (band == <span class="charliteral">'\0'</span>);
-<a name="l00154"></a>00154 }
-<a name="l00155"></a>00155 
-<a name="l00164"></a>00164 <span class="keywordtype">bool</span>
-<a name="l00165"></a>00165 fors_instrument_filterband_is_unknown(      <span class="keywordtype">char</span>    band)
-<a name="l00166"></a>00166 {
-<a name="l00167"></a>00167     <span class="keywordflow">return</span>  !(  fors_instrument_filterband_is_defined(band)
-<a name="l00168"></a>00168                 || fors_instrument_filterband_is_none(band));
-<a name="l00169"></a>00169 }
-<a name="l00170"></a>00170 
-<a name="l00175"></a>00175 <span class="keywordtype">char</span>
-<a name="l00176"></a>00176 fors_instrument_filterband_value_unknown(   <span class="keywordtype">void</span>)
-<a name="l00177"></a>00177 {
-<a name="l00178"></a>00178     <span class="keywordflow">return</span> fors_filterband_unknown;
-<a name="l00179"></a>00179 }
-<a name="l00180"></a>00180 
-<a name="l00185"></a>00185 <span class="keywordtype">int</span>
-<a name="l00186"></a>00186 fors_instrument_known_filters_get_number(   <span class="keywordtype">void</span>)
-<a name="l00187"></a>00187 {
-<a name="l00188"></a>00188     <span class="keywordflow">return</span> (<span class="keyword">sizeof</span>(<a class="code" href="structfors__filterlist.html">fors_filterlist</a>)/<span class="keyword">sizeof</span>(*fors_filterlist)) - 1;
-<a name="l00189"></a>00189 }
-<a name="l00190"></a>00190 
-<a name="l00199"></a>00199 <span class="keyword">const</span> <span class="keywordtype">char</span>  *
-<a name="l00200"></a>00200 fors_instrument_known_filters_get_name(     <span class="keywordtype">int</span> n)
-<a name="l00201"></a>00201 {
-<a name="l00202"></a>00202     <span class="keywordflow">if</span> (n < 0
-<a name="l00203"></a>00203         || n >= fors_instrument_known_filters_get_number())
-<a name="l00204"></a>00204     {
-<a name="l00205"></a>00205         cpl_error_set(                      cpl_func,
-<a name="l00206"></a>00206                                             CPL_ERROR_ACCESS_OUT_OF_RANGE);
-<a name="l00207"></a>00207         <span class="keywordflow">return</span> NULL;
-<a name="l00208"></a>00208     }
-<a name="l00209"></a>00209     <span class="keywordflow">return</span> fors_filterlist[n].name;
-<a name="l00210"></a>00210 }
-<a name="l00211"></a>00211 
-<a name="l00221"></a>00221 <span class="keywordtype">char</span>
-<a name="l00222"></a>00222 fors_instrument_known_filters_get_band(     <span class="keywordtype">int</span> n)
-<a name="l00223"></a>00223 {
-<a name="l00224"></a>00224     <span class="keywordflow">if</span> (n < 0
-<a name="l00225"></a>00225         || n >= fors_instrument_known_filters_get_number())
-<a name="l00226"></a>00226     {
-<a name="l00227"></a>00227         cpl_error_set(                      cpl_func,
-<a name="l00228"></a>00228                                             CPL_ERROR_ACCESS_OUT_OF_RANGE);
-<a name="l00229"></a>00229         <span class="keywordflow">return</span> fors_filterband_unknown;
-<a name="l00230"></a>00230     }
-<a name="l00231"></a>00231     <span class="keywordflow">return</span> fors_filterlist[n].band;
-<a name="l00232"></a>00232 }
-<a name="l00233"></a>00233 
-<a name="l00234"></a>00234 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__instrument_8c_source.html b/html/fors__instrument_8c_source.html
new file mode 100644
index 0000000..c8b58b9
--- /dev/null
+++ b/html/fors__instrument_8c_source.html
@@ -0,0 +1,222 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_instrument.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_instrument.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_instrument.c,v 1.4 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.4 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_instrument.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="structfors__filterlist.html">   35</a></span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code" href="structfors__filterlist.html">fors_filterlist</a> {</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  name[10];</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  band;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> } <a class="code" href="structfors__filterlist.html">fors_filterlist</a>[15] = {</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>     <span class="comment">/* FORS1 */</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>     {<span class="stringliteral">"U_BESS"</span>, <span class="charliteral">'U'</span>},</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>     {<span class="stringliteral">"u_HIGH"</span>, <span class="charliteral">'U'</span>},</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>     {<span class="stringliteral">"B_BESS"</span>, <span class="charliteral">'B'</span>},</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>     {<span class="stringliteral">"b_HIGH"</span>, <span class="charliteral">'B'</span>},</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>     {<span class="stringliteral">"g_HIGH"</span>, <span class="charliteral">'V'</span>},    <span class="comment">/* G uses V ?????????????????????????????????? */</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>     {<span class="stringliteral">"V_BESS"</span>, <span class="charliteral">'V'</span>},</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>     {<span class="stringliteral">"v_HIGH"</span>, <span class="charliteral">'V'</span>},</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     {<span class="stringliteral">"R_BESS"</span>, <span class="charliteral">'R'</span>},</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>     {<span class="stringliteral">"I_BESS"</span>, <span class="charliteral">'I'</span>},</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>     <span class="comment">/* FORS2 */</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>     {<span class="stringliteral">"U_SPECIAL"</span>, <span class="charliteral">'U'</span>},</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>     {<span class="stringliteral">"B_BESS"</span>   , <span class="charliteral">'B'</span>},</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>     {<span class="stringliteral">"V_BESS"</span>   , <span class="charliteral">'V'</span>},</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>     {<span class="stringliteral">"R_SPECIAL"</span>, <span class="charliteral">'R'</span>},</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>     {<span class="stringliteral">"I_BESS"</span>   , <span class="charliteral">'I'</span>},</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>     {<span class="stringliteral">""</span>         , <span class="charliteral">'\0'</span>}</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> };</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">const</span> <span class="keywordtype">char</span>  fors_filterband_unknown = <span class="charliteral">'?'</span>,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>             fors_filterband_none    = <span class="charliteral">'\0'</span>;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="keywordtype">char</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> fors_instrument_filterband_get_by_setting(  <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a>  *setting)</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> {</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     <span class="keywordtype">char</span>            band;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     <span class="keywordflow">if</span> (setting == NULL)</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     {</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>         <span class="keywordflow">return</span> fors_filterband_unknown;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     }</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     band = fors_instrument_filterband_get_by_name(setting->filter_name);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>         cpl_error_set_where(cpl_func);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     <span class="keywordflow">return</span> band;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> }</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="keywordtype">char</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> fors_instrument_filterband_get_by_name(     <span class="keyword">const</span> <span class="keywordtype">char</span>  *filtername)</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> {</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="keywordtype">int</span> n;</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="keywordflow">if</span> (filtername == NULL || filtername[0] == <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>         <span class="keywordflow">return</span> fors_filterband_none;</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     n = 0;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="keywordflow">while</span> ((<a class="code" href="structfors__filterlist.html">fors_filterlist</a>[n].name)[0] != <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     {</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>         <span class="keywordflow">if</span> (strcmp(filtername, <a class="code" href="structfors__filterlist.html">fors_filterlist</a>[n].name) == 0)</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>             <span class="keywordflow">return</span> <a class="code" href="structfors__filterlist.html">fors_filterlist</a>[n].band;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         n++;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     }</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     cpl_error_set_message(                  cpl_func,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                                             <span class="stringliteral">"unknown filter name \"%s\""</span>,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                                             filtername);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="keywordflow">return</span> fors_filterband_unknown;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> fors_instrument_filterband_is_defined(      <span class="keywordtype">char</span>    band)</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> {</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keywordflow">return</span>  (band >= <span class="charliteral">'A'</span> && band <= <span class="charliteral">'Z'</span>);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> }</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> fors_instrument_filterband_is_none(         <span class="keywordtype">char</span>    band)</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> {</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="keywordflow">return</span>  (band == <span class="charliteral">'\0'</span>);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> }</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> fors_instrument_filterband_is_unknown(      <span class="keywordtype">char</span>    band)</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> {</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="keywordflow">return</span>  !(  fors_instrument_filterband_is_defined(band)</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>                 || fors_instrument_filterband_is_none(band));</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="keywordtype">char</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> fors_instrument_filterband_value_unknown(   <span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> {</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">return</span> fors_filterband_unknown;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> }</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> </div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> fors_instrument_known_filters_get_number(   <span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> {</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="keywordflow">return</span> (<span class="keyword">sizeof</span>(<a class="code" href="structfors__filterlist.html">fors_filterlist</a>)/<span class="keyword">sizeof</span>(*<a class="code" href="structfors__filterlist.html">fors_filterlist</a>)) - 1;</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> }</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="keyword">const</span> <span class="keywordtype">char</span>  *</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> fors_instrument_known_filters_get_name(     <span class="keywordtype">int</span> n)</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> {</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     <span class="keywordflow">if</span> (n < 0</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>         || n >= fors_instrument_known_filters_get_number())</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     {</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>         cpl_error_set(                      cpl_func,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                                             CPL_ERROR_ACCESS_OUT_OF_RANGE);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     }</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     <span class="keywordflow">return</span> <a class="code" href="structfors__filterlist.html">fors_filterlist</a>[n].name;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> }</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> <span class="keywordtype">char</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> fors_instrument_known_filters_get_band(     <span class="keywordtype">int</span> n)</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> {</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keywordflow">if</span> (n < 0</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>         || n >= fors_instrument_known_filters_get_number())</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     {</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>         cpl_error_set(                      cpl_func,</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>                                             CPL_ERROR_ACCESS_OUT_OF_RANGE);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>         <span class="keywordflow">return</span> fors_filterband_unknown;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     }</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     <span class="keywordflow">return</span> <a class="code" href="structfors__filterlist.html">fors_filterlist</a>[n].band;</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> }</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> </div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__instrument_8h-source.html b/html/fors__instrument_8h-source.html
deleted file mode 100644
index 57ff1d2..0000000
--- a/html/fors__instrument_8h-source.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_instrument.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_instrument.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_instrument.h,v 1.3 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.3 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_INSTRUMENT_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_INSTRUMENT_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_setting.h></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keywordtype">char</span>
-<a name="l00036"></a>00036 fors_instrument_filterband_get_by_setting(  <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a>  *setting);
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keywordtype">char</span>
-<a name="l00039"></a>00039 fors_instrument_filterband_get_by_name(     <span class="keyword">const</span> <span class="keywordtype">char</span>  *filtername);
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="keywordtype">bool</span>
-<a name="l00042"></a>00042 fors_instrument_filterband_is_defined(      <span class="keywordtype">char</span>    band);
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="keywordtype">bool</span>
-<a name="l00045"></a>00045 fors_instrument_filterband_is_none(         <span class="keywordtype">char</span>    band);
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 <span class="keywordtype">bool</span>
-<a name="l00048"></a>00048 fors_instrument_filterband_is_unknown(      <span class="keywordtype">char</span>    band);
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050 <span class="keywordtype">char</span>
-<a name="l00051"></a>00051 fors_instrument_filterband_value_unknown(   <span class="keywordtype">void</span>);
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="keywordtype">int</span>
-<a name="l00054"></a>00054 fors_instrument_known_filters_get_number(   <span class="keywordtype">void</span>);
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 <span class="keyword">const</span> <span class="keywordtype">char</span>  *
-<a name="l00057"></a>00057 fors_instrument_known_filters_get_name(     <span class="keywordtype">int</span> n);
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="keywordtype">char</span>
-<a name="l00060"></a>00060 fors_instrument_known_filters_get_band(     <span class="keywordtype">int</span> n);
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="preprocessor">#endif  </span><span class="comment">/* FORS_INSTRUMENT_H */</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__instrument_8h_source.html b/html/fors__instrument_8h_source.html
new file mode 100644
index 0000000..371ce0f
--- /dev/null
+++ b/html/fors__instrument_8h_source.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_instrument.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_instrument.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_instrument.h,v 1.3 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.3 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_INSTRUMENT_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_INSTRUMENT_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_setting.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keywordtype">char</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> fors_instrument_filterband_get_by_setting(  <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a>  *setting);</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keywordtype">char</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> fors_instrument_filterband_get_by_name(     <span class="keyword">const</span> <span class="keywordtype">char</span>  *filtername);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> fors_instrument_filterband_is_defined(      <span class="keywordtype">char</span>    band);</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> fors_instrument_filterband_is_none(         <span class="keywordtype">char</span>    band);</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> fors_instrument_filterband_is_unknown(      <span class="keywordtype">char</span>    band);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keywordtype">char</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> fors_instrument_filterband_value_unknown(   <span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> fors_instrument_known_filters_get_number(   <span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">const</span> <span class="keywordtype">char</span>  *</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> fors_instrument_known_filters_get_name(     <span class="keywordtype">int</span> n);</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keywordtype">char</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> fors_instrument_known_filters_get_band(     <span class="keywordtype">int</span> n);</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">#endif  </span><span class="comment">/* FORS_INSTRUMENT_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__normalise__flat_8c-source.html b/html/fors__normalise__flat_8c-source.html
deleted file mode 100644
index 73697d3..0000000
--- a/html/fors__normalise__flat_8c-source.html
+++ /dev/null
@@ -1,668 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_normalise_flat.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_normalise_flat.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_normalise_flat.c,v 1.7 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_normalise_flat_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to normalise a master flat field frame dividing it\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"by its large scale illumination trend. This recipe can be applied both\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"to generic multi-slit (MOS/MXU) and to long slit exposures (either LSS, or\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"LSS-like MOS/MXU), even if different normalisation methods are applied in\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"such different cases. The input master flat field image is the product\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"of the recipe fors_flat. The input spectral curvature table, product of\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"the recipe fors_detect_spectra, is only required in the case of multi-slit\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"data.\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"In the case of multi-slit data, the flat field spectra are spatially\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"rectified, heavily smoothed, and then mapped back on the CCD. Then the\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"master flat image is divided by its smoothed counterpart. The smoothing\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"may be obtained either by applying a running median filter of specified\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"sizes, or by polynomial fitting along the dispersion direction performed\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"independently for each row of the spatially remapped spectra.\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"In the case of long-slit data, the smoothing can still be obtained either\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"by applying a running median filter or by polynomial fitting, but the\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"polynomial fitting will be performed along the spatial direction, for\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"each column of the spectrum.\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS or\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"LSS.\n\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  MASTER_SCREEN_FLAT_MXU     Calib       Master flat frame       Y\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      .\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"  MASTER_NORM_FLAT_MXU       FITS image  Normalised flat field\n\n"</span>;
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="preprocessor">#define fors_normalise_flat_exit(message)     \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">{                                             \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_image_delete(master_flat);                \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">cpl_image_delete(spatial);                    \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">cpl_image_delete(smo_flat);                   \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">}</span>
-<a name="l00090"></a>00090 <span class="preprocessor"></span>
-<a name="l00091"></a>00091 <span class="preprocessor">#define fors_normalise_flat_exit_memcheck(message)  \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">{                                               \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00094"></a>00094 <span class="preprocessor">printf("free master_flat (%p)\n", master_flat); \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">cpl_image_delete(master_flat);                  \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">printf("free spatial (%p)\n", spatial);         \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">cpl_image_delete(spatial);                      \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);   \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">cpl_image_delete(coordinate);                   \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">printf("free smo_flat (%p)\n", smo_flat);       \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">cpl_image_delete(smo_flat);                     \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">cpl_table_delete(grism_table);                  \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">cpl_table_delete(maskslits);                    \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">cpl_table_delete(slits);                        \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">cpl_table_delete(polytraces);                   \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">}</span>
-<a name="l00115"></a>00115 <span class="preprocessor"></span>
-<a name="l00116"></a>00116 
-<a name="l00128"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00128</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00129"></a>00129 {
-<a name="l00130"></a>00130     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00131"></a>00131     cpl_plugin *plugin = &recipe->interface;
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133     cpl_plugin_init(plugin,
-<a name="l00134"></a>00134                     CPL_PLUGIN_API,
-<a name="l00135"></a>00135                     FORS_BINARY_VERSION,
-<a name="l00136"></a>00136                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00137"></a>00137                     <span class="stringliteral">"fors_normalise_flat"</span>,
-<a name="l00138"></a>00138                     <span class="stringliteral">"Normalise master flat spectrum"</span>,
-<a name="l00139"></a>00139                     fors_normalise_flat_description,
-<a name="l00140"></a>00140                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00141"></a>00141                     PACKAGE_BUGREPORT,
-<a name="l00142"></a>00142     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00143"></a>00143     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00144"></a>00144     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00145"></a>00145     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00146"></a>00146     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00147"></a>00147     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00148"></a>00148     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00149"></a>00149     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00150"></a>00150     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00151"></a>00151     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00152"></a>00152     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00153"></a>00153     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00154"></a>00154     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00155"></a>00155                     fors_normalise_flat_create,
-<a name="l00156"></a>00156                     fors_normalise_flat_exec,
-<a name="l00157"></a>00157                     fors_normalise_flat_destroy);
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159     cpl_pluginlist_append(list, plugin);
-<a name="l00160"></a>00160     
-<a name="l00161"></a>00161     <span class="keywordflow">return</span> 0;
-<a name="l00162"></a>00162 }
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164 
-<a name="l00175"></a>00175 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_create(cpl_plugin *plugin)
-<a name="l00176"></a>00176 {
-<a name="l00177"></a>00177     cpl_recipe    *recipe;
-<a name="l00178"></a>00178     cpl_parameter *p;
-<a name="l00179"></a>00179 
-<a name="l00180"></a>00180     <span class="comment">/* </span>
-<a name="l00181"></a>00181 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00182"></a>00182 <span class="comment">     */</span>
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00185"></a>00185         recipe = (cpl_recipe *)plugin;
-<a name="l00186"></a>00186     <span class="keywordflow">else</span> 
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> -1;
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189     <span class="comment">/* </span>
-<a name="l00190"></a>00190 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00191"></a>00191 <span class="comment">     */</span>
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="comment">/*</span>
-<a name="l00196"></a>00196 <span class="comment">     * Dispersion</span>
-<a name="l00197"></a>00197 <span class="comment">     */</span>
-<a name="l00198"></a>00198 
-<a name="l00199"></a>00199     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.dispersion"</span>,
-<a name="l00200"></a>00200                                 CPL_TYPE_DOUBLE,
-<a name="l00201"></a>00201                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00202"></a>00202                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,
-<a name="l00203"></a>00203                                 0.0);
-<a name="l00204"></a>00204     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00205"></a>00205     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00206"></a>00206     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208     <span class="comment">/*</span>
-<a name="l00209"></a>00209 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00210"></a>00210 <span class="comment">     */</span>
-<a name="l00211"></a>00211 
-<a name="l00212"></a>00212     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.startwavelength"</span>,
-<a name="l00213"></a>00213                                 CPL_TYPE_DOUBLE,
-<a name="l00214"></a>00214                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00215"></a>00215                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,
-<a name="l00216"></a>00216                                 0.0);
-<a name="l00217"></a>00217     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00218"></a>00218     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00219"></a>00219     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     <span class="comment">/*</span>
-<a name="l00222"></a>00222 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00223"></a>00223 <span class="comment">     */</span>
-<a name="l00224"></a>00224 
-<a name="l00225"></a>00225     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.endwavelength"</span>,
-<a name="l00226"></a>00226                                 CPL_TYPE_DOUBLE,
-<a name="l00227"></a>00227                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00228"></a>00228                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,
-<a name="l00229"></a>00229                                 0.0);
-<a name="l00230"></a>00230     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00231"></a>00231     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00232"></a>00232     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00233"></a>00233 
-<a name="l00234"></a>00234     <span class="comment">/*</span>
-<a name="l00235"></a>00235 <span class="comment">     * Degree of flat field fitting polynomial along spatial direction</span>
-<a name="l00236"></a>00236 <span class="comment">     * (used for LSS data)</span>
-<a name="l00237"></a>00237 <span class="comment">     */</span>
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.sdegree"</span>,
-<a name="l00240"></a>00240                                 CPL_TYPE_INT,
-<a name="l00241"></a>00241                                 <span class="stringliteral">"Degree of flat field fitting polynomial "</span>
-<a name="l00242"></a>00242                                 <span class="stringliteral">"along spatial direction (used for LSS "</span>
-<a name="l00243"></a>00243                                 <span class="stringliteral">"data only)"</span>,
-<a name="l00244"></a>00244                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,
-<a name="l00245"></a>00245                                 4);
-<a name="l00246"></a>00246     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sdegree"</span>);
-<a name="l00247"></a>00247     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00248"></a>00248     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250     <span class="comment">/*</span>
-<a name="l00251"></a>00251 <span class="comment">     * Degree of flat field fitting polynomial along dispersion direction</span>
-<a name="l00252"></a>00252 <span class="comment">     * (used for MOS and MXU data)</span>
-<a name="l00253"></a>00253 <span class="comment">     */</span>
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.ddegree"</span>,
-<a name="l00256"></a>00256                                 CPL_TYPE_INT,
-<a name="l00257"></a>00257                                 <span class="stringliteral">"Degree of flat field fitting polynomial "</span>
-<a name="l00258"></a>00258                                 <span class="stringliteral">"along dispersion direction (used for MOS "</span>
-<a name="l00259"></a>00259                                 <span class="stringliteral">"and MXU data only)"</span>,
-<a name="l00260"></a>00260                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,
-<a name="l00261"></a>00261                                 -1);
-<a name="l00262"></a>00262     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ddegree"</span>);
-<a name="l00263"></a>00263     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00264"></a>00264     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266     <span class="comment">/*</span>
-<a name="l00267"></a>00267 <span class="comment">     * Smooth box radius for flat field along dispersion direction</span>
-<a name="l00268"></a>00268 <span class="comment">     */</span>
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.dradius"</span>,
-<a name="l00271"></a>00271                                 CPL_TYPE_INT,
-<a name="l00272"></a>00272                                 <span class="stringliteral">"Smooth box radius for flat field along "</span>
-<a name="l00273"></a>00273                                 <span class="stringliteral">"dispersion direction"</span>,
-<a name="l00274"></a>00274                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,
-<a name="l00275"></a>00275                                 10);
-<a name="l00276"></a>00276     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dradius"</span>);
-<a name="l00277"></a>00277     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00278"></a>00278     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00279"></a>00279 
-<a name="l00280"></a>00280     <span class="comment">/*</span>
-<a name="l00281"></a>00281 <span class="comment">     * Smooth box radius for flat field along spatial direction</span>
-<a name="l00282"></a>00282 <span class="comment">     * (used for LSS data only)</span>
-<a name="l00283"></a>00283 <span class="comment">     */</span>
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.sradius"</span>,
-<a name="l00286"></a>00286                                 CPL_TYPE_INT,
-<a name="l00287"></a>00287                                 <span class="stringliteral">"Smooth box radius for flat field along "</span>
-<a name="l00288"></a>00288                                 <span class="stringliteral">"spatial direction"</span>,
-<a name="l00289"></a>00289                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,
-<a name="l00290"></a>00290                                 10);
-<a name="l00291"></a>00291     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sradius"</span>);
-<a name="l00292"></a>00292     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00293"></a>00293     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00294"></a>00294 
-<a name="l00295"></a>00295     <span class="keywordflow">return</span> 0;
-<a name="l00296"></a>00296 }
-<a name="l00297"></a>00297 
-<a name="l00298"></a>00298 
-<a name="l00307"></a>00307 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_exec(cpl_plugin *plugin)
-<a name="l00308"></a>00308 {
-<a name="l00309"></a>00309     cpl_recipe *recipe;
-<a name="l00310"></a>00310     
-<a name="l00311"></a>00311     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00312"></a>00312         recipe = (cpl_recipe *)plugin;
-<a name="l00313"></a>00313     <span class="keywordflow">else</span> 
-<a name="l00314"></a>00314         <span class="keywordflow">return</span> -1;
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     <span class="keywordflow">return</span> fors_normalise_flat(recipe->parameters, recipe->frames);
-<a name="l00317"></a>00317 }
-<a name="l00318"></a>00318 
-<a name="l00319"></a>00319 
-<a name="l00328"></a>00328 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_destroy(cpl_plugin *plugin)
-<a name="l00329"></a>00329 {
-<a name="l00330"></a>00330     cpl_recipe *recipe;
-<a name="l00331"></a>00331     
-<a name="l00332"></a>00332     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00333"></a>00333         recipe = (cpl_recipe *)plugin;
-<a name="l00334"></a>00334     <span class="keywordflow">else</span> 
-<a name="l00335"></a>00335         <span class="keywordflow">return</span> -1;
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339     <span class="keywordflow">return</span> 0;
-<a name="l00340"></a>00340 }
-<a name="l00341"></a>00341 
-<a name="l00342"></a>00342 
-<a name="l00352"></a>00352 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat(cpl_parameterlist *parlist, 
-<a name="l00353"></a>00353                                cpl_frameset *frameset)
-<a name="l00354"></a>00354 {
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_normalise_flat"</span>;
-<a name="l00357"></a>00357 
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     <span class="comment">/*</span>
-<a name="l00360"></a>00360 <span class="comment">     * Input parameters</span>
-<a name="l00361"></a>00361 <span class="comment">     */</span>
-<a name="l00362"></a>00362 
-<a name="l00363"></a>00363     <span class="keywordtype">double</span>      dispersion;
-<a name="l00364"></a>00364     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00365"></a>00365     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00366"></a>00366     <span class="keywordtype">int</span>         sdegree;
-<a name="l00367"></a>00367     <span class="keywordtype">int</span>         ddegree;
-<a name="l00368"></a>00368     <span class="keywordtype">int</span>         sradius;
-<a name="l00369"></a>00369     <span class="keywordtype">int</span>         dradius;
-<a name="l00370"></a>00370 
-<a name="l00371"></a>00371     <span class="comment">/*</span>
-<a name="l00372"></a>00372 <span class="comment">     * CPL objects</span>
-<a name="l00373"></a>00373 <span class="comment">     */</span>
-<a name="l00374"></a>00374 
-<a name="l00375"></a>00375     cpl_image        *master_flat = NULL;
-<a name="l00376"></a>00376     cpl_image        *smo_flat    = NULL;
-<a name="l00377"></a>00377     cpl_image        *coordinate  = NULL;
-<a name="l00378"></a>00378     cpl_image        *spatial     = NULL;
-<a name="l00379"></a>00379     cpl_table        *grism_table = NULL;
-<a name="l00380"></a>00380     cpl_table        *slits       = NULL;
-<a name="l00381"></a>00381     cpl_table        *polytraces  = NULL;
-<a name="l00382"></a>00382     cpl_table        *maskslits   = NULL;
-<a name="l00383"></a>00383     cpl_propertylist *header      = NULL;
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385     <span class="comment">/*</span>
-<a name="l00386"></a>00386 <span class="comment">     * Auxiliary variables</span>
-<a name="l00387"></a>00387 <span class="comment">     */</span>
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389     <span class="keywordtype">char</span>        version[80];
-<a name="l00390"></a>00390     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_flat_tag;
-<a name="l00391"></a>00391     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_norm_flat_tag;
-<a name="l00392"></a>00392     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00393"></a>00393     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;
-<a name="l00394"></a>00394     <span class="keywordtype">int</span>         mxu, mos, lss;
-<a name="l00395"></a>00395     <span class="keywordtype">int</span>         nflat;
-<a name="l00396"></a>00396     <span class="keywordtype">int</span>         rebin;
-<a name="l00397"></a>00397     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00398"></a>00398     <span class="keywordtype">int</span>         nslits;
-<a name="l00399"></a>00399     <span class="keywordtype">int</span>         treat_as_lss;
-<a name="l00400"></a>00400     <span class="keywordtype">int</span>         i;
-<a name="l00401"></a>00401     <span class="keywordtype">double</span>      reference;
-<a name="l00402"></a>00402     <span class="keywordtype">double</span>     *xpos;
-<a name="l00403"></a>00403     <span class="keywordtype">double</span>      mxpos;
-<a name="l00404"></a>00404 
-<a name="l00405"></a>00405     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407 
-<a name="l00408"></a>00408     cpl_msg_set_indentation(2);
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410 
-<a name="l00411"></a>00411     <span class="comment">/*</span>
-<a name="l00412"></a>00412 <span class="comment">     * Get configuration parameters</span>
-<a name="l00413"></a>00413 <span class="comment">     */</span>
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00416"></a>00416     cpl_msg_indent_more();
-<a name="l00417"></a>00417     
-<a name="l00418"></a>00418     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00419"></a>00419         fors_normalise_flat_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); 
-<a name="l00420"></a>00420 
-<a name="l00421"></a>00421     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00424"></a>00424                     <span class="stringliteral">"fors.fors_normalise_flat.dispersion"</span>, grism_table);
-<a name="l00425"></a>00425 
-<a name="l00426"></a>00426     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00427"></a>00427         fors_normalise_flat_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00428"></a>00428 
-<a name="l00429"></a>00429     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00430"></a>00430                     <span class="stringliteral">"fors.fors_normalise_flat.startwavelength"</span>, grism_table);
-<a name="l00431"></a>00431     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00432"></a>00432         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00433"></a>00433             fors_normalise_flat_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00436"></a>00436                     <span class="stringliteral">"fors.fors_normalise_flat.endwavelength"</span>, grism_table);
-<a name="l00437"></a>00437     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00438"></a>00438         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00439"></a>00439             fors_normalise_flat_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00440"></a>00440         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00441"></a>00441             fors_normalise_flat_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00442"></a>00442     }
-<a name="l00443"></a>00443 
-<a name="l00444"></a>00444     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00445"></a>00445         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00446"></a>00446             fors_normalise_flat_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00447"></a>00447 
-<a name="l00448"></a>00448     sdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00449"></a>00449                                     <span class="stringliteral">"fors.fors_normalise_flat.sdegree"</span>, NULL);
-<a name="l00450"></a>00450     ddegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00451"></a>00451                                     <span class="stringliteral">"fors.fors_normalise_flat.ddegree"</span>, NULL);
-<a name="l00452"></a>00452     sradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00453"></a>00453                                     <span class="stringliteral">"fors.fors_normalise_flat.sradius"</span>, NULL);
-<a name="l00454"></a>00454     dradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00455"></a>00455                                     <span class="stringliteral">"fors.fors_normalise_flat.dradius"</span>, NULL);
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457     <span class="keywordflow">if</span> (sradius < 1 || dradius < 1)
-<a name="l00458"></a>00458         fors_normalise_flat_exit(<span class="stringliteral">"Invalid smoothing box radius"</span>);
-<a name="l00459"></a>00459 
-<a name="l00460"></a>00460     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00463"></a>00463         fors_normalise_flat_exit(<span class="stringliteral">"Failure reading the configuration "</span>
-<a name="l00464"></a>00464                                  <span class="stringliteral">"parameters"</span>);
-<a name="l00465"></a>00465 
-<a name="l00466"></a>00466 
-<a name="l00467"></a>00467     cpl_msg_indent_less();
-<a name="l00468"></a>00468     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00469"></a>00469     cpl_msg_indent_more();
-<a name="l00470"></a>00470 
-<a name="l00471"></a>00471     nflat  = mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SCREEN_FLAT_MXU"</span>);
-<a name="l00472"></a>00472     nflat += mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SCREEN_FLAT_MOS"</span>);
-<a name="l00473"></a>00473     nflat += lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SCREEN_FLAT_LSS"</span>);
-<a name="l00474"></a>00474 
-<a name="l00475"></a>00475     <span class="keywordflow">if</span> (nflat == 0) {
-<a name="l00476"></a>00476         fors_normalise_flat_exit(<span class="stringliteral">"Missing input master flat field frame"</span>);
-<a name="l00477"></a>00477     }
-<a name="l00478"></a>00478     <span class="keywordflow">if</span> (nflat > 1) {
-<a name="l00479"></a>00479         cpl_msg_error(recipe, <span class="stringliteral">"Too many input flat frames (%d > 1)"</span>, nflat);
-<a name="l00480"></a>00480         fors_normalise_flat_exit(NULL);
-<a name="l00481"></a>00481     }
-<a name="l00482"></a>00482 
-<a name="l00483"></a>00483     <span class="keywordflow">if</span> (mxu) {
-<a name="l00484"></a>00484         master_flat_tag      = <span class="stringliteral">"MASTER_SCREEN_FLAT_MXU"</span>;
-<a name="l00485"></a>00485         master_norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;
-<a name="l00486"></a>00486         slit_location_tag    = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00487"></a>00487         curv_coeff_tag       = <span class="stringliteral">"CURV_COEFF_MXU"</span>;
-<a name="l00488"></a>00488     }
-<a name="l00489"></a>00489     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00490"></a>00490         master_flat_tag      = <span class="stringliteral">"MASTER_SCREEN_FLAT_MOS"</span>;
-<a name="l00491"></a>00491         master_norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;
-<a name="l00492"></a>00492         slit_location_tag    = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00493"></a>00493         curv_coeff_tag       = <span class="stringliteral">"CURV_COEFF_MOS"</span>;
-<a name="l00494"></a>00494     }
-<a name="l00495"></a>00495     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lss) {
-<a name="l00496"></a>00496         master_flat_tag      = <span class="stringliteral">"MASTER_SCREEN_FLAT_LSS"</span>;
-<a name="l00497"></a>00497         master_norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;
-<a name="l00498"></a>00498     }
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, master_flat_tag, 0);
-<a name="l00501"></a>00501 
-<a name="l00502"></a>00502     <span class="keywordflow">if</span> (mos || mxu) {
-<a name="l00503"></a>00503         <span class="keywordtype">int</span> nslits_out_det = 0;
-<a name="l00504"></a>00504         <span class="keywordflow">if</span> (mos)
-<a name="l00505"></a>00505             maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00506"></a>00506         <span class="keywordflow">else</span>
-<a name="l00507"></a>00507             maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00508"></a>00508 
-<a name="l00509"></a>00509         <span class="comment">/*</span>
-<a name="l00510"></a>00510 <span class="comment">         * Check if all slits have the same X offset: in such case,</span>
-<a name="l00511"></a>00511 <span class="comment">         * treat the observation as a long-slit one!</span>
-<a name="l00512"></a>00512 <span class="comment">         */</span>
-<a name="l00513"></a>00513 
-<a name="l00514"></a>00514         treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det); 
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00517"></a>00517 
-<a name="l00518"></a>00518         <span class="keywordflow">if</span> (treat_as_lss)
-<a name="l00519"></a>00519             cpl_msg_warning(recipe, <span class="stringliteral">"All MOS slits have the same offset: %.2f\n"</span>
-<a name="l00520"></a>00520                             <span class="stringliteral">"The LSS data reduction strategy is applied!"</span>,
-<a name="l00521"></a>00521                             mxpos);
-<a name="l00522"></a>00522     }
-<a name="l00523"></a>00523 
-<a name="l00524"></a>00524     <span class="keywordflow">if</span> (!(lss || treat_as_lss)) {
-<a name="l00525"></a>00525         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) == 0) {
-<a name="l00526"></a>00526             cpl_msg_error(recipe, <span class="stringliteral">"Missing input: %s"</span>, curv_coeff_tag);
-<a name="l00527"></a>00527             fors_normalise_flat_exit(NULL);
-<a name="l00528"></a>00528         }
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) > 1) {
-<a name="l00531"></a>00531             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, curv_coeff_tag);
-<a name="l00532"></a>00532             fors_normalise_flat_exit(NULL);
-<a name="l00533"></a>00533         }
-<a name="l00534"></a>00534 
-<a name="l00535"></a>00535         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) == 0) {
-<a name="l00536"></a>00536             cpl_msg_error(recipe, <span class="stringliteral">"Missing input: %s"</span>, slit_location_tag);
-<a name="l00537"></a>00537             fors_normalise_flat_exit(NULL);
-<a name="l00538"></a>00538         }
-<a name="l00539"></a>00539 
-<a name="l00540"></a>00540         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) > 1) {
-<a name="l00541"></a>00541             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, slit_location_tag);
-<a name="l00542"></a>00542             fors_normalise_flat_exit(NULL);
-<a name="l00543"></a>00543         }
-<a name="l00544"></a>00544     }
-<a name="l00545"></a>00545 
-<a name="l00546"></a>00546     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00547"></a>00547         fors_normalise_flat_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00548"></a>00548 
-<a name="l00549"></a>00549     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00550"></a>00550         fors_normalise_flat_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00551"></a>00551 
-<a name="l00552"></a>00552     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00553"></a>00553         fors_normalise_flat_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00554"></a>00554 
-<a name="l00555"></a>00555 
-<a name="l00556"></a>00556     <span class="comment">/*</span>
-<a name="l00557"></a>00557 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00558"></a>00558 <span class="comment">     * dispersion direction from the master flat frame</span>
-<a name="l00559"></a>00559 <span class="comment">     */</span>
-<a name="l00560"></a>00560 
-<a name="l00561"></a>00561     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00562"></a>00562         fors_normalise_flat_exit(<span class="stringliteral">"Cannot load master flat frame header"</span>);
-<a name="l00563"></a>00563 
-<a name="l00564"></a>00564     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00565"></a>00565     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00566"></a>00566         fors_normalise_flat_exit(<span class="stringliteral">"Missing keyword INSTRUME in master "</span>
-<a name="l00567"></a>00567                                  <span class="stringliteral">"flat header"</span>);
-<a name="l00568"></a>00568 
-<a name="l00569"></a>00569     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00570"></a>00570         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00571"></a>00571     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00572"></a>00572         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00573"></a>00573 
-<a name="l00574"></a>00574     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00575"></a>00575 
-<a name="l00576"></a>00576     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00577"></a>00577         fors_normalise_flat_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span>
-<a name="l00578"></a>00578                                  <span class="stringliteral">"in master flat frame header"</span>);
-<a name="l00579"></a>00579 
-<a name="l00580"></a>00580     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l00581"></a>00581         reference *= 10;
-<a name="l00582"></a>00582 
-<a name="l00583"></a>00583     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l00584"></a>00584         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l00585"></a>00585                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in master flat header"</span>,
-<a name="l00586"></a>00586                       reference);
-<a name="l00587"></a>00587         fors_normalise_flat_exit(NULL);
-<a name="l00588"></a>00588     }
-<a name="l00589"></a>00589 
-<a name="l00590"></a>00590     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00593"></a>00593 
-<a name="l00594"></a>00594     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00595"></a>00595         fors_normalise_flat_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00596"></a>00596                                  <span class="stringliteral">"in master flat header"</span>);
-<a name="l00597"></a>00597 
-<a name="l00598"></a>00598     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l00599"></a>00599         dispersion *= rebin;
-<a name="l00600"></a>00600         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l00601"></a>00601                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,
-<a name="l00602"></a>00602                         dispersion);
-<a name="l00603"></a>00603     }
-<a name="l00604"></a>00604 
-<a name="l00605"></a>00605 
-<a name="l00606"></a>00606     cpl_msg_indent_less();
-<a name="l00607"></a>00607     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);
-<a name="l00608"></a>00608     cpl_msg_indent_more();
-<a name="l00609"></a>00609 
-<a name="l00610"></a>00610     master_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, master_flat_tag, 
-<a name="l00611"></a>00611                                  CPL_TYPE_FLOAT, 0, 0);
-<a name="l00612"></a>00612     <span class="keywordflow">if</span> (master_flat == NULL)
-<a name="l00613"></a>00613         fors_normalise_flat_exit(<span class="stringliteral">"Cannot load master flat field frame"</span>);
-<a name="l00614"></a>00614 
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616     cpl_msg_indent_less();
-<a name="l00617"></a>00617     cpl_msg_info(recipe, <span class="stringliteral">"Perform flat field normalisation..."</span>);
-<a name="l00618"></a>00618     cpl_msg_indent_more();
-<a name="l00619"></a>00619 
-<a name="l00620"></a>00620     <span class="keywordflow">if</span> (lss || treat_as_lss) {
-<a name="l00621"></a>00621 
-<a name="l00622"></a>00622         <span class="comment">/* FIXME:</span>
-<a name="l00623"></a>00623 <span class="comment">         * The LSS data calibration is still dirty: it doesn't apply</span>
-<a name="l00624"></a>00624 <span class="comment">         * any spatial rectification, and only in future an external</span>
-<a name="l00625"></a>00625 <span class="comment">         * spectral curvature model would be provided in input. Here</span>
-<a name="l00626"></a>00626 <span class="comment">         * and there temporary solutions are adpted, such as accepting</span>
-<a name="l00627"></a>00627 <span class="comment">         * the preliminary wavelength calibration.</span>
-<a name="l00628"></a>00628 <span class="comment">         */</span>
-<a name="l00629"></a>00629 
-<a name="l00630"></a>00630         <span class="comment">/*</span>
-<a name="l00631"></a>00631 <span class="comment">         * Flat field normalisation is done directly on the master flat</span>
-<a name="l00632"></a>00632 <span class="comment">         * field (without spatial rectification first). The spectral</span>
-<a name="l00633"></a>00633 <span class="comment">         * curvature model may be provided in input, in future releases.</span>
-<a name="l00634"></a>00634 <span class="comment">         */</span>
-<a name="l00635"></a>00635 
-<a name="l00636"></a>00636         smo_flat = <a class="code" href="group__moses.html#g9c5947c76fc1246f203a1c6ebc6c9569">mos_normalise_longflat</a>(master_flat, 
-<a name="l00637"></a>00637                                           sradius, dradius, sdegree);
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639         cpl_image_delete(smo_flat); smo_flat = NULL; <span class="comment">/* It may be a product */</span>
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, master_flat, master_norm_flat_tag,
-<a name="l00642"></a>00642                            header, parlist, recipe, version))
-<a name="l00643"></a>00643             fors_normalise_flat_exit(NULL);
-<a name="l00644"></a>00644 
-<a name="l00645"></a>00645         cpl_propertylist_delete(header); header = NULL;
-<a name="l00646"></a>00646         cpl_image_delete(master_flat); master_flat = NULL;
-<a name="l00647"></a>00647 
-<a name="l00648"></a>00648         <span class="keywordflow">return</span> 0;
-<a name="l00649"></a>00649     }
-<a name="l00650"></a>00650 
-<a name="l00651"></a>00651 
-<a name="l00652"></a>00652     <span class="comment">/*</span>
-<a name="l00653"></a>00653 <span class="comment">     * This is the generic MOS/MXU handling</span>
-<a name="l00654"></a>00654 <span class="comment">     */</span>
-<a name="l00655"></a>00655 
-<a name="l00656"></a>00656     slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l00657"></a>00657     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00658"></a>00658         fors_normalise_flat_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l00659"></a>00659 
-<a name="l00660"></a>00660     polytraces = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, curv_coeff_tag, 1);
-<a name="l00661"></a>00661     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00662"></a>00662         fors_normalise_flat_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);
-<a name="l00663"></a>00663 
-<a name="l00664"></a>00664     nx = cpl_image_get_size_x(master_flat);
-<a name="l00665"></a>00665     ny = cpl_image_get_size_y(master_flat);
-<a name="l00666"></a>00666 
-<a name="l00667"></a>00667     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l00668"></a>00668     spatial = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(master_flat, slits, polytraces, 
-<a name="l00669"></a>00669                                       reference,
-<a name="l00670"></a>00670                                       startwavelength, endwavelength,
-<a name="l00671"></a>00671                                       dispersion, 0, coordinate);
-<a name="l00672"></a>00672 
-<a name="l00673"></a>00673     cpl_image_delete(spatial); spatial = NULL;
-<a name="l00674"></a>00674 
-<a name="l00675"></a>00675     smo_flat = <a class="code" href="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff">mos_normalise_flat</a>(master_flat, coordinate, slits, polytraces,
-<a name="l00676"></a>00676                                   reference, startwavelength, endwavelength,
-<a name="l00677"></a>00677                                   dispersion, dradius, ddegree);
-<a name="l00678"></a>00678 
-<a name="l00679"></a>00679     cpl_image_delete(smo_flat); smo_flat = NULL;  <span class="comment">/* It may be a product */</span>
-<a name="l00680"></a>00680     cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l00681"></a>00681     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l00682"></a>00682     cpl_table_delete(slits); slits = NULL;
-<a name="l00683"></a>00683 
-<a name="l00684"></a>00684     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, master_flat, master_norm_flat_tag,
-<a name="l00685"></a>00685                        header, parlist, recipe, version))
-<a name="l00686"></a>00686         fors_normalise_flat_exit(NULL);
-<a name="l00687"></a>00687 
-<a name="l00688"></a>00688     cpl_propertylist_delete(header); header = NULL;
-<a name="l00689"></a>00689     cpl_image_delete(master_flat); master_flat = NULL;
-<a name="l00690"></a>00690 
-<a name="l00691"></a>00691     <span class="keywordflow">return</span> 0;
-<a name="l00692"></a>00692 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__normalise__flat_8c_source.html b/html/fors__normalise__flat_8c_source.html
new file mode 100644
index 0000000..06ea21d
--- /dev/null
+++ b/html/fors__normalise__flat_8c_source.html
@@ -0,0 +1,722 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_normalise_flat.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_normalise_flat.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_normalise_flat.c,v 1.10 2013/09/09 12:24:55 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/09/09 12:24:55 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.10 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name:  $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_flat_normalise.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_create(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_normalise_flat_description[] =</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"This recipe is used to normalise a master flat field frame dividing it\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"by its large scale illumination trend. This recipe can be applied both\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"to generic multi-slit (MOS/MXU) and to long slit exposures (either LSS, or\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"LSS-like MOS/MXU), even if different normalisation methods are applied in\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"such different cases. The input master flat field image is the product\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"of the recipe fors_flat. The input spectral curvature table, product of\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"the recipe fors_detect_spectra, is only required in the case of multi-slit\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"data.\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"In the case of multi-slit data, the flat field spectra are spatially\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"rectified, heavily smoothed, and then mapped back on the CCD. Then the\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"master flat image is divided by its smoothed counterpart. The smoothing\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"may be obtained either by applying a running median filter of specified\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"sizes, or by polynomial fitting along the dispersion direction performed\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"independently for each row of the spatially remapped spectra.\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"In the case of long-slit data, the smoothing can still be obtained either\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"by applying a running median filter or by polynomial fitting, but the\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"polynomial fitting will be performed along the spatial direction, for\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"each column of the spectrum.\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS or\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"LSS.\n\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  MASTER_SCREEN_FLAT_MXU     Calib       Master flat frame       Y\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      .\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Spectral curvature      .\n"</span>        </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"  MASTER_NORM_FLAT_MXU       FITS image  Normalised flat field\n\n"</span>;</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> </div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">#define fors_normalise_flat_exit(message)     \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">cpl_image_delete(master_flat);                \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">cpl_image_delete(spatial);                    \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_image_delete(smo_flat);                   \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">#define fors_normalise_flat_exit_memcheck(message)  \</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">printf("free master_flat (%p)\n", master_flat); \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">cpl_image_delete(master_flat);                  \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">printf("free spatial (%p)\n", spatial);         \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">cpl_image_delete(spatial);                      \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);   \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">cpl_image_delete(coordinate);                   \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">printf("free smo_flat (%p)\n", smo_flat);       \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">cpl_image_delete(smo_flat);                     \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">cpl_table_delete(grism_table);                  \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">cpl_table_delete(maskslits);                    \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">cpl_table_delete(slits);                        \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor">cpl_table_delete(polytraces);                   \</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> {</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                     <span class="stringliteral">"fors_normalise_flat"</span>,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                     <span class="stringliteral">"Normalise master flat spectrum"</span>,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                     fors_normalise_flat_description,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                     fors_normalise_flat_create,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                     fors_normalise_flat_exec,</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                     fors_normalise_flat_destroy);</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> }</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.dispersion"</span>,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                 0.0);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.startwavelength"</span>,</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                                 0.0);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.endwavelength"</span>,</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                 0.0);</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> </div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="comment">     * Number of knots in flat field fitting splines along spatial direction </span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.spa_nknots"</span>,</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>                                 <span class="stringliteral">"Number of knots in flat field fitting "</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>                                 <span class="stringliteral">"splines along spatial direction"</span>,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                                 -1);</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"spa_nknots"</span>);</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> <span class="comment">     * Smooth box radius for flat field along spatial direction</span></div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> <span class="comment">     * (if spa_knots < 0)</span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.sradius"</span>,</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>                                 <span class="stringliteral">"Smooth box radius for flat field along "</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>                                 <span class="stringliteral">"spatial direction (used if spa_knots < 0)"</span>,</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                                 10);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sradius"</span>);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> <span class="comment">     * Number of knots in flat field fitting splines along dispersion direction </span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.disp_nknots"</span>,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>                                 <span class="stringliteral">"Number of knots in flat field fitting "</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>                                 <span class="stringliteral">"splines along dispersion direction"</span>,</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>                                 -1);</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"disp_nknots"</span>);</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> <span class="comment">     * Smooth box radius for flat field along dispersion direction</span></div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.dradius"</span>,</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>                                 <span class="stringliteral">"Smooth box radius for flat field along "</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                                 <span class="stringliteral">"dispersion direction (if disp_knots < 0)"</span>,</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                                 10);</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dradius"</span>);</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> <span class="comment">     * Threshold percentage for flat spline fitting with respect to the maximum</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_normalise_flat.splfit_threshold"</span>,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                                 <span class="stringliteral">"Threshold percentage for flat spline fitting"</span></div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                                 <span class="stringliteral">"with respect to the maximum"</span>,</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>                                 <span class="stringliteral">"fors.fors_normalise_flat"</span>,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                                 0.01);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"splfit_threshold"</span>);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> }</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> {</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     </div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="keywordflow">return</span> fors_normalise_flat(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> }</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> </div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> </div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> {</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     </div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> </div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> }</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> </div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_normalise_flat(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> {</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> </div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_normalise_flat"</span>;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> </div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> </div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordtype">int</span>         spa_nknots;</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="keywordtype">int</span>         disp_nknots;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     <span class="keywordtype">int</span>         sradius;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="keywordtype">int</span>         dradius;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keywordtype">float</span>       splfit_threshold;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     cpl_image        *master_flat = NULL;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     cpl_image        *smo_flat    = NULL;</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     cpl_image        *coordinate  = NULL;</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     cpl_image        *spatial     = NULL;</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     cpl_table        *polytraces  = NULL;</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     cpl_table        *maskslits   = NULL;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_flat_tag;</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_norm_flat_tag;</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     <span class="keywordtype">int</span>         mxu, mos, lss;</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     <span class="keywordtype">int</span>         nflat;</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     <span class="keywordtype">int</span>         treat_as_lss;</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> </div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> </div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span> </div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>         fors_normalise_flat_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); </div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>                     <span class="stringliteral">"fors.fors_normalise_flat.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>         fors_normalise_flat_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>                     <span class="stringliteral">"fors.fors_normalise_flat.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>             fors_normalise_flat_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> </div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>                     <span class="stringliteral">"fors.fors_normalise_flat.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>             fors_normalise_flat_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>             fors_normalise_flat_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     }</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> </div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>             fors_normalise_flat_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> </div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     spa_nknots = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>             <span class="stringliteral">"fors.fors_normalise_flat.spa_nknots"</span>, NULL);</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     disp_nknots = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>             <span class="stringliteral">"fors.fors_normalise_flat.disp_nknots"</span>, NULL);</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     sradius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>             <span class="stringliteral">"fors.fors_normalise_flat.sradius"</span>, NULL);</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     dradius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>             <span class="stringliteral">"fors.fors_normalise_flat.dradius"</span>, NULL);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     splfit_threshold = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>             <span class="stringliteral">"fors.fors_normalise_flat.splfit_threshold"</span>, NULL);</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> </div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     <span class="keywordflow">if</span> (sradius < 1 || dradius < 1)</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         fors_normalise_flat_exit(<span class="stringliteral">"Invalid smoothing box radius"</span>);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> </div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>         fors_normalise_flat_exit(<span class="stringliteral">"Failure reading the configuration "</span></div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>                                  <span class="stringliteral">"parameters"</span>);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> </div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     nflat  = mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SCREEN_FLAT_MXU"</span>);</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     nflat += mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SCREEN_FLAT_MOS"</span>);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     nflat += lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SCREEN_FLAT_LSS"</span>);</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> </div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     <span class="keywordflow">if</span> (nflat == 0) {</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>         fors_normalise_flat_exit(<span class="stringliteral">"Missing input master flat field frame"</span>);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     }</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     <span class="keywordflow">if</span> (nflat > 1) {</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input flat frames (%d > 1)"</span>, nflat);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>         fors_normalise_flat_exit(NULL);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     }</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> </div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>         master_flat_tag      = <span class="stringliteral">"MASTER_SCREEN_FLAT_MXU"</span>;</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>         master_norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         slit_location_tag    = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>         curv_coeff_tag       = <span class="stringliteral">"CURV_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     }</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>         master_flat_tag      = <span class="stringliteral">"MASTER_SCREEN_FLAT_MOS"</span>;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>         master_norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         slit_location_tag    = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         curv_coeff_tag       = <span class="stringliteral">"CURV_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     }</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lss) {</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>         master_flat_tag      = <span class="stringliteral">"MASTER_SCREEN_FLAT_LSS"</span>;</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         master_norm_flat_tag = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     }</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, master_flat_tag, 0);</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span> </div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     <span class="keywordflow">if</span> (mos || mxu) {</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>         <span class="keywordtype">int</span> nslits_out_det = 0;</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>         <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>             maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>             maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> </div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span> <span class="comment">         * Check if all slits have the same X offset: in such case,</span></div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> <span class="comment">         * treat the observation as a long-slit one!</span></div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>         treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det); </div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> </div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>         <span class="keywordflow">if</span> (treat_as_lss)</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>             cpl_msg_warning(recipe, <span class="stringliteral">"All MOS slits have the same offset: %.2f\n"</span></div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>                             <span class="stringliteral">"The LSS data reduction strategy is applied!"</span>,</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>                             mxpos);</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     }</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> </div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordflow">if</span> (!(lss || treat_as_lss)) {</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) == 0) {</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing input: %s"</span>, curv_coeff_tag);</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>             fors_normalise_flat_exit(NULL);</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>         }</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> </div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) > 1) {</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, curv_coeff_tag);</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>             fors_normalise_flat_exit(NULL);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>         }</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span> </div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) == 0) {</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing input: %s"</span>, slit_location_tag);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>             fors_normalise_flat_exit(NULL);</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         }</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span> </div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) > 1) {</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, slit_location_tag);</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>             fors_normalise_flat_exit(NULL);</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>         }</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     }</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         fors_normalise_flat_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> </div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>         fors_normalise_flat_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>         fors_normalise_flat_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> </div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span> </div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span> <span class="comment">     * dispersion direction from the master flat frame</span></div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> </div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         fors_normalise_flat_exit(<span class="stringliteral">"Cannot load master flat frame header"</span>);</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span> </div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>         fors_normalise_flat_exit(<span class="stringliteral">"Missing keyword INSTRUME in master "</span></div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>                                  <span class="stringliteral">"flat header"</span>);</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> </div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span> </div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span> </div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>         fors_normalise_flat_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span></div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>                                  <span class="stringliteral">"in master flat frame header"</span>);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> </div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>         reference *= 10;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> </div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in master flat header"</span>,</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>                       reference);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>         fors_normalise_flat_exit(NULL);</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     }</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> </div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> </div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> </div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>         fors_normalise_flat_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>                                  <span class="stringliteral">"in master flat header"</span>);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>                         dispersion);</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     }</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span> </div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span> </div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span> </div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     master_flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, master_flat_tag, </div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>                                  CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     <span class="keywordflow">if</span> (master_flat == NULL)</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>         fors_normalise_flat_exit(<span class="stringliteral">"Cannot load master flat field frame"</span>);</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> </div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span> </div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     cpl_msg_info(recipe, <span class="stringliteral">"Perform flat field normalisation..."</span>);</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span> </div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     <span class="keywordflow">if</span> (lss || treat_as_lss) {</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span> </div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>         <span class="comment">/* FIXME:</span></div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> <span class="comment">         * The LSS data calibration is still dirty: it doesn't apply</span></div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span> <span class="comment">         * any spatial rectification, and only in future an external</span></div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> <span class="comment">         * spectral curvature model would be provided in input. Here</span></div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> <span class="comment">         * and there temporary solutions are adpted, such as accepting</span></div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> <span class="comment">         * the preliminary wavelength calibration.</span></div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> </div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> <span class="comment">         * Flat field normalisation is done directly on the master flat</span></div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> <span class="comment">         * field (without spatial rectification first). The spectral</span></div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span> <span class="comment">         * curvature model may be provided in input, in future releases.</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> </div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>         smo_flat = mos_lssflat_normalise(master_flat, </div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>                                          sradius, dradius, </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>                                          spa_nknots, disp_nknots,</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>                                          splfit_threshold);</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> </div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>         cpl_image_delete(smo_flat); smo_flat = NULL; <span class="comment">/* It may be a product */</span></div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span> </div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, master_flat, master_norm_flat_tag,</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>                            header, parlist, recipe, version))</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>             fors_normalise_flat_exit(NULL);</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> </div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>         cpl_image_delete(master_flat); master_flat = NULL;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> </div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     }</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> </div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span> </div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> <span class="comment">     * This is the generic MOS/MXU handling</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span> </div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>     slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>         fors_normalise_flat_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span> </div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     polytraces = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, curv_coeff_tag, 1);</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>         fors_normalise_flat_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> </div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     nx = cpl_image_get_size_x(master_flat);</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     ny = cpl_image_get_size_y(master_flat);</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span> </div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     spatial = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(master_flat, slits, polytraces, </div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>                                       reference,</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>                                       startwavelength, endwavelength,</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>                                       dispersion, 0, coordinate);</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span> </div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>     cpl_image_delete(spatial); spatial = NULL;</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span> </div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     smo_flat = mos_mosflat_normalise(master_flat, coordinate, slits, polytraces,</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>                                      reference, startwavelength, endwavelength,</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>                                      dispersion, sradius, dradius,</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>                                      spa_nknots, disp_nknots, splfit_threshold);</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span> </div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     cpl_image_delete(smo_flat); smo_flat = NULL;  <span class="comment">/* It may be a product */</span></div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     cpl_image_delete(coordinate); coordinate = NULL;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span> </div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, master_flat, master_norm_flat_tag,</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>                        header, parlist, recipe, version))</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>         fors_normalise_flat_exit(NULL);</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span> </div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     cpl_image_delete(master_flat); master_flat = NULL;</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span> </div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__overscan_8h_source.html b/html/fors__overscan_8h_source.html
new file mode 100644
index 0000000..c1deecf
--- /dev/null
+++ b/html/fors__overscan_8h_source.html
@@ -0,0 +1,100 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_overscan.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_overscan.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: moses.h,v 1.41 2013/09/09 12:19:20 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the VIMOS Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013/09/09 12:19:20 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.41 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name:  $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef MOSES_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define MOSES_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> cpl_image * fors_remove_overscan(cpl_image * image, cpl_propertylist * header);</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#endif   </span><span class="comment">/* FORS_OVERSCAN_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__paf_8c-source.html b/html/fors__paf_8c-source.html
deleted file mode 100644
index bc93350..0000000
--- a/html/fors__paf_8c-source.html
+++ /dev/null
@@ -1,750 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_paf.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_paf.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_paf.c,v 1.3 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.3 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <string.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <ctype.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <unistd.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <pwd.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <sys/types.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <time.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <assert.h></span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include <fors_paf.h></span>
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="comment">/*</span>
-<a name="l00047"></a>00047 <span class="comment"> * Reserved PAF header keywords</span>
-<a name="l00048"></a>00048 <span class="comment"> */</span>
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050 <span class="preprocessor">#define PAF_HDR_START      "PAF.HDR.START"</span>
-<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#define PAF_TYPE           "PAF.TYPE"</span>
-<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#define PAF_ID             "PAF.ID"</span>
-<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define PAF_NAME           "PAF.NAME"</span>
-<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define PAF_DESC           "PAF.DESC"</span>
-<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#define PAF_CRTE_NAME      "PAF.CRTE.NAME"</span>
-<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#define PAF_CRTE_TIME      "PAF.CRTE.DAYTIM"</span>
-<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#define PAF_LCHG_NAME      "PAF.LCHG.NAME"</span>
-<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define PAF_LCHG_TIME      "PAF.LCHG.DAYTIM"</span>
-<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#define PAF_CHCK_NAME      "PAF.CHCK.NAME"</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define PAF_CHCK_TIME      "PAF.CHCK.DAYTIM"</span>
-<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#define PAF_CHCK_CHECKSUM  "PAF.CHCK.CHECKSUM"</span>
-<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define PAF_HDR_END        "PAF.HDR.END"</span>
-<a name="l00063"></a>00063 <span class="preprocessor"></span>
-<a name="l00064"></a>00064 
-<a name="l00065"></a>00065 <span class="comment">/*</span>
-<a name="l00066"></a>00066 <span class="comment"> * Value and comment field start position</span>
-<a name="l00067"></a>00067 <span class="comment"> */</span>
-<a name="l00068"></a>00068 
-<a name="l00069"></a>00069 <span class="preprocessor">#define PAF_FIELD_OFFSET_VALUE    20</span>
-<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="preprocessor">#define PAF_FIELD_OFFSET_COMMENT  45</span>
-<a name="l00071"></a>00071 <span class="preprocessor"></span>
-<a name="l00072"></a>00072 
-<a name="l00081"></a>00081 <span class="comment">/*</span>
-<a name="l00082"></a>00082 <span class="comment"> * PAF record definition. This corresponds to one line of a parameter file.</span>
-<a name="l00083"></a>00083 <span class="comment"> */</span>
-<a name="l00084"></a>00084 
-<a name="l00085"></a><a class="code" href="struct__FORS__PAF__RECORD__.html">00085</a> <span class="keyword">struct </span><a class="code" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_</a> {
-<a name="l00086"></a><a class="code" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">00086</a>     <span class="keywordtype">char</span> *<a class="code" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">name</a>;
-<a name="l00087"></a><a class="code" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">00087</a>     <span class="keywordtype">char</span> *<a class="code" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">comment</a>;
-<a name="l00088"></a><a class="code" href="struct__FORS__PAF__RECORD__.html#13b54564388819d2d248117bcb421ab3">00088</a>     ForsPAFType <a class="code" href="struct__FORS__PAF__RECORD__.html#13b54564388819d2d248117bcb421ab3">type</a>;
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090     <span class="keyword">union </span>{
-<a name="l00091"></a><a class="code" href="struct__FORS__PAF__RECORD__.html#633c615d76af4c00b82b50bf75cb4b84">00091</a>         <span class="keywordtype">int</span> *<a class="code" href="struct__FORS__PAF__RECORD__.html#633c615d76af4c00b82b50bf75cb4b84">bval</a>;
-<a name="l00092"></a><a class="code" href="struct__FORS__PAF__RECORD__.html#880a737b5fffa6baaeaa97653bdb341e">00092</a>         <span class="keywordtype">int</span> *<a class="code" href="struct__FORS__PAF__RECORD__.html#880a737b5fffa6baaeaa97653bdb341e">ival</a>;
-<a name="l00093"></a><a class="code" href="struct__FORS__PAF__RECORD__.html#34d5c881a9bc312b95bc3d644d6fb522">00093</a>         <span class="keywordtype">double</span> *<a class="code" href="struct__FORS__PAF__RECORD__.html#34d5c881a9bc312b95bc3d644d6fb522">dval</a>;
-<a name="l00094"></a><a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">00094</a>         <span class="keywordtype">char</span> *<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a>;
-<a name="l00095"></a>00095     } data;
-<a name="l00096"></a>00096 };
-<a name="l00097"></a>00097 
-<a name="l00098"></a><a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">00098</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_</a> <a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a>;
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100 
-<a name="l00101"></a>00101 <span class="comment">/*</span>
-<a name="l00102"></a>00102 <span class="comment"> * The PAF object</span>
-<a name="l00103"></a>00103 <span class="comment"> */</span>
-<a name="l00104"></a>00104 
-<a name="l00105"></a><a class="code" href="struct__FORS__PAF__.html">00105</a> <span class="keyword">struct </span><a class="code" href="struct__FORS__PAF__.html">_FORS_PAF_</a> {
-<a name="l00106"></a><a class="code" href="struct__FORS__PAF__.html#34a869607ecd20de7f2452c808b64de6">00106</a>     <span class="keywordtype">char</span> *<a class="code" href="struct__FORS__PAF__.html#34a869607ecd20de7f2452c808b64de6">name</a>;
-<a name="l00107"></a><a class="code" href="struct__FORS__PAF__.html#8bf1f1454a4b17f7672624a3b8c2bd2c">00107</a>     <span class="keywordtype">int</span> <a class="code" href="struct__FORS__PAF__.html#8bf1f1454a4b17f7672624a3b8c2bd2c">nh</a>;
-<a name="l00108"></a><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">00108</a>     <span class="keywordtype">int</span> <a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a>;
-<a name="l00109"></a><a class="code" href="struct__FORS__PAF__.html#cdc2007f38750ed7ef260e8409d4eb1f">00109</a>     <a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> **<a class="code" href="struct__FORS__PAF__.html#cdc2007f38750ed7ef260e8409d4eb1f">header</a>;
-<a name="l00110"></a><a class="code" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">00110</a>     <a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> **<a class="code" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">records</a>;
-<a name="l00111"></a>00111 };
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113 
-<a name="l00114"></a>00114 <span class="comment">/*</span>
-<a name="l00115"></a>00115 <span class="comment"> * @brief</span>
-<a name="l00116"></a>00116 <span class="comment"> *   Get current date and time in ISO8601 format.</span>
-<a name="l00117"></a>00117 <span class="comment"> *</span>
-<a name="l00118"></a>00118 <span class="comment"> * @return Pointer to a statically allocated string in the function</span>
-<a name="l00119"></a>00119 <span class="comment"> *   (no need to free it). In case of failure, returns a @c NULL.</span>
-<a name="l00120"></a>00120 <span class="comment"> *</span>
-<a name="l00121"></a>00121 <span class="comment"> * This private function just returns the current time in ISO8601 format.</span>
-<a name="l00122"></a>00122 <span class="comment"> */</span>
-<a name="l00123"></a>00123 
-<a name="l00124"></a><a class="code" href="group__forsPaf.html#g641d95bede019f7a29f1db650d177c62">00124</a> <span class="preprocessor">#define TIME_ISO8601_LENGTH (20)</span>
-<a name="l00125"></a>00125 <span class="preprocessor"></span>
-<a name="l00126"></a><a class="code" href="group__forsPaf.html#g77e6970f0c1394755e48983ec30964b8">00126</a> <span class="keyword">static</span> <span class="keywordtype">char</span> *<a class="code" href="group__forsPaf.html#g77e6970f0c1394755e48983ec30964b8">getTimeISO8601</a>(<span class="keywordtype">void</span>)
-<a name="l00127"></a>00127 {
-<a name="l00128"></a>00128 
-<a name="l00129"></a>00129     <span class="keyword">static</span> <span class="keywordtype">char</span> timeISO8601[<a class="code" href="group__forsPaf.html#g641d95bede019f7a29f1db650d177c62">TIME_ISO8601_LENGTH</a>];
-<a name="l00130"></a>00130     time_t      seconds = time((time_t *)0);
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="keywordflow">if</span> (strftime(timeISO8601, <a class="code" href="group__forsPaf.html#g641d95bede019f7a29f1db650d177c62">TIME_ISO8601_LENGTH</a>,
-<a name="l00133"></a>00133                     <span class="stringliteral">"%Y-%m-%dT%T"</span>, localtime(&seconds)) == 0)
-<a name="l00134"></a>00134         strcpy(timeISO8601, <span class="stringliteral">"0000-00-00T00:00:00"</span>);
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     <span class="keywordflow">return</span> timeISO8601;
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138 }
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140 
-<a name="l00141"></a>00141 <span class="comment">/*</span>
-<a name="l00142"></a>00142 <span class="comment"> * Compute record type size in bytes.</span>
-<a name="l00143"></a>00143 <span class="comment"> */</span>
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145 <span class="keyword">inline</span> <span class="keyword">static</span> size_t
-<a name="l00146"></a><a class="code" href="group__forsPaf.html#g2c1e284f8aed1d0ba1742c8bded4bf4a">00146</a> <a class="code" href="group__forsPaf.html#g2c1e284f8aed1d0ba1742c8bded4bf4a">_forsPAFValueSize</a>(ForsPAFType type, <span class="keyword">const</span> <span class="keywordtype">void</span> *value)
-<a name="l00147"></a>00147 {
-<a name="l00148"></a>00148     size_t sz;
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150     <span class="keywordflow">switch</span> (type) {
-<a name="l00151"></a>00151         <span class="keywordflow">case</span> PAF_TYPE_BOOL:
-<a name="l00152"></a>00152             sz = <span class="keyword">sizeof</span>(int);
-<a name="l00153"></a>00153             <span class="keywordflow">break</span>;
-<a name="l00154"></a>00154             
-<a name="l00155"></a>00155         <span class="keywordflow">case</span> PAF_TYPE_INT:
-<a name="l00156"></a>00156             sz = <span class="keyword">sizeof</span>(int);
-<a name="l00157"></a>00157             <span class="keywordflow">break</span>;
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159         <span class="keywordflow">case</span> PAF_TYPE_DOUBLE:
-<a name="l00160"></a>00160             sz = <span class="keyword">sizeof</span>(double);
-<a name="l00161"></a>00161             <span class="keywordflow">break</span>;
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163         <span class="keywordflow">case</span> PAF_TYPE_STRING:
-<a name="l00164"></a>00164             sz = (strlen((<span class="keywordtype">char</span> *)value) + 1) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>);
-<a name="l00165"></a>00165             <span class="keywordflow">break</span>;
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167         <span class="keywordflow">default</span>:
-<a name="l00168"></a>00168                 sz = 0;
-<a name="l00169"></a>00169                 <span class="keywordflow">break</span>;
-<a name="l00170"></a>00170         }
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172     <span class="keywordflow">return</span> sz;
-<a name="l00173"></a>00173 
-<a name="l00174"></a>00174 }
-<a name="l00175"></a>00175 
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177 <span class="comment">/*</span>
-<a name="l00178"></a>00178 <span class="comment"> * Destroy a PAF record</span>
-<a name="l00179"></a>00179 <span class="comment"> */</span>
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181 <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00182"></a><a class="code" href="group__forsPaf.html#gfb1c398d9c412268e4845b2c584b1aed">00182</a> <a class="code" href="group__forsPaf.html#gfb1c398d9c412268e4845b2c584b1aed">_forsPAFRecordDestroy</a>(<a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> *record)
-<a name="l00183"></a>00183 {
-<a name="l00184"></a>00184 
-<a name="l00185"></a>00185     <span class="keywordflow">if</span> (record) {
-<a name="l00186"></a>00186         cpl_free(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">name</a>);
-<a name="l00187"></a>00187         cpl_free((<span class="keywordtype">void</span> *)record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a>);
-<a name="l00188"></a>00188         cpl_free(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">comment</a>);
-<a name="l00189"></a>00189         cpl_free(record);
-<a name="l00190"></a>00190     }
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <span class="keywordflow">return</span>;
-<a name="l00193"></a>00193 
-<a name="l00194"></a>00194 }
-<a name="l00195"></a>00195 
-<a name="l00196"></a>00196 
-<a name="l00197"></a>00197 <span class="comment">/*</span>
-<a name="l00198"></a>00198 <span class="comment"> * Create a new PAF record</span>
-<a name="l00199"></a>00199 <span class="comment"> */</span>
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> *
-<a name="l00202"></a><a class="code" href="group__forsPaf.html#g46037bb92868be7c73210555065f5241">00202</a> <a class="code" href="group__forsPaf.html#g46037bb92868be7c73210555065f5241">_forsPAFRecordCreate</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, ForsPAFType type, <span class="keyword">const</span> <span class="keywordtype">void</span> *value,
-<a name="l00203"></a>00203                     <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)
-<a name="l00204"></a>00204 {
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206     size_t sz;
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208     <a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> *record = cpl_malloc(<span class="keyword">sizeof</span>(<a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a>));
-<a name="l00209"></a>00209 
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211     record-><a class="code" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">name</a> = cpl_strdup(name);
-<a name="l00212"></a>00212     record-><a class="code" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">comment</a> = comment ? cpl_strdup(comment) : NULL;
-<a name="l00213"></a>00213     record-><a class="code" href="struct__FORS__PAF__RECORD__.html#13b54564388819d2d248117bcb421ab3">type</a> = type;
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215     sz = <a class="code" href="group__forsPaf.html#g2c1e284f8aed1d0ba1742c8bded4bf4a">_forsPAFValueSize</a>(type, value);
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217     <span class="keywordflow">if</span> (sz == 0) {
-<a name="l00218"></a>00218         record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a> = NULL;
-<a name="l00219"></a>00219     }
-<a name="l00220"></a>00220     <span class="keywordflow">else</span> {
-<a name="l00221"></a>00221         record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a> = (<span class="keywordtype">char</span> *)cpl_malloc(sz);
-<a name="l00222"></a>00222     }
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224     memcpy(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a>, value, sz);
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <span class="keywordflow">return</span> record;
-<a name="l00227"></a>00227 
-<a name="l00228"></a>00228 }
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230 <span class="comment">/*</span>
-<a name="l00231"></a>00231 <span class="comment"> * Set name, value and comment of a PAF record</span>
-<a name="l00232"></a>00232 <span class="comment"> */</span>
-<a name="l00233"></a>00233 
-<a name="l00234"></a>00234 <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00235"></a><a class="code" href="group__forsPaf.html#g096710d0ef5d21acd2338ed418c6da7e">00235</a> <a class="code" href="group__forsPaf.html#g096710d0ef5d21acd2338ed418c6da7e">_forsPAFRecordSet</a>(<a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> *record, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, ForsPAFType type,
-<a name="l00236"></a>00236                  <span class="keyword">const</span> <span class="keywordtype">void</span> *value, <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)
-<a name="l00237"></a>00237 {
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239     <span class="keywordflow">if</span> (name) {
-<a name="l00240"></a>00240         cpl_free(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">name</a>);
-<a name="l00241"></a>00241         record-><a class="code" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">name</a> = cpl_strdup(name);
-<a name="l00242"></a>00242     }
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     <span class="keywordflow">if</span> (comment) {
-<a name="l00245"></a>00245         cpl_free(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">comment</a>);
-<a name="l00246"></a>00246         record-><a class="code" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">comment</a> = cpl_strdup(comment);
-<a name="l00247"></a>00247     }
-<a name="l00248"></a>00248 
-<a name="l00249"></a>00249     <span class="keywordflow">if</span> (value) {
-<a name="l00250"></a>00250         size_t sz = <a class="code" href="group__forsPaf.html#g2c1e284f8aed1d0ba1742c8bded4bf4a">_forsPAFValueSize</a>(type, value);
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252         <span class="keywordflow">if</span> (record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a>) {
-<a name="l00253"></a>00253             size_t size = <a class="code" href="group__forsPaf.html#g2c1e284f8aed1d0ba1742c8bded4bf4a">_forsPAFValueSize</a>(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#13b54564388819d2d248117bcb421ab3">type</a>, record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a>);
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255             <span class="keywordflow">if</span> (sz != size)
-<a name="l00256"></a>00256                 record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a> = (<span class="keywordtype">char</span> *)cpl_realloc(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ff [...]
-<a name="l00257"></a>00257         }
-<a name="l00258"></a>00258         <span class="keywordflow">else</span>
-<a name="l00259"></a>00259             record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a> = (<span class="keywordtype">char</span> *)cpl_malloc(sz);
-<a name="l00260"></a>00260 
-<a name="l00261"></a>00261         memcpy(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a>, value, sz);
-<a name="l00262"></a>00262         record-><a class="code" href="struct__FORS__PAF__RECORD__.html#13b54564388819d2d248117bcb421ab3">type</a> = type;
-<a name="l00263"></a>00263     }
-<a name="l00264"></a>00264 
-<a name="l00265"></a>00265     <span class="keywordflow">return</span>;
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267 }
-<a name="l00268"></a>00268 
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270 <span class="comment">/*</span>
-<a name="l00271"></a>00271 <span class="comment"> * Create a record from name, value and comment and append the record to</span>
-<a name="l00272"></a>00272 <span class="comment"> * the PAF header or record list.</span>
-<a name="l00273"></a>00273 <span class="comment"> */</span>
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275 <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">int</span>
-<a name="l00276"></a><a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">00276</a> <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(<a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> ***<a class="code" href="structlist.html">list</a>, <span class="keywordtype">int</span> *pos, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, 
-<a name="l00277"></a>00277               ForsPAFType type, <span class="keyword">const</span> <span class="keywordtype">void</span> *value, <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)
-<a name="l00278"></a>00278 {
-<a name="l00279"></a>00279 
-<a name="l00280"></a>00280     <a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> *record;
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283     record = <a class="code" href="group__forsPaf.html#g46037bb92868be7c73210555065f5241">_forsPAFRecordCreate</a>(name, type, value, comment);
-<a name="l00284"></a>00284     <span class="keywordflow">if</span> (!record)
-<a name="l00285"></a>00285         <span class="keywordflow">return</span> 1;
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287     <span class="keywordflow">if</span> (pos[0] == 0) {
-<a name="l00288"></a>00288         *list = cpl_malloc(<span class="keyword">sizeof</span>(<a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> *));
-<a name="l00289"></a>00289     }
-<a name="l00290"></a>00290     <span class="keywordflow">else</span> {
-<a name="l00291"></a>00291         *list = cpl_realloc(*list, (pos[0]+1) * <span class="keyword">sizeof</span>(<a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> *));
-<a name="l00292"></a>00292     }
-<a name="l00293"></a>00293 
-<a name="l00294"></a>00294     (*list)[pos[0]] = record;
-<a name="l00295"></a>00295     pos[0]++;
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297     <span class="keywordflow">return</span> 0;
-<a name="l00298"></a>00298 
-<a name="l00299"></a>00299 }
-<a name="l00300"></a>00300 
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302 <span class="comment">/*</span>
-<a name="l00303"></a>00303 <span class="comment"> * Create a new PAF header.</span>
-<a name="l00304"></a>00304 <span class="comment"> */</span>
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306 <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> **
-<a name="l00307"></a><a class="code" href="group__forsPaf.html#g603cc78fa373dc03085f39b09c8f3ff3">00307</a> <a class="code" href="group__forsPaf.html#g603cc78fa373dc03085f39b09c8f3ff3">_forsPAFHeaderCreate</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *type, <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keywordtype">id</span>,
-<a name="l00308"></a>00308                     <span class="keyword">const</span> <span class="keywordtype">char</span> *desc, <span class="keywordtype">int</span> *pos)
-<a name="l00309"></a>00309 {
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311     <a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> **hdr;
-<a name="l00312"></a>00312     <span class="keyword">const</span> <span class="keywordtype">char</span> *user, *timestamp;
-<a name="l00313"></a>00313 <span class="preprocessor">#if defined HAVE_GETUID && defined HAVE_GETPWUID</span>
-<a name="l00314"></a>00314 <span class="preprocessor"></span>    <span class="keyword">struct </span>passwd *pw;
-<a name="l00315"></a>00315 <span class="preprocessor">#endif</span>
-<a name="l00316"></a>00316 <span class="preprocessor"></span>
-<a name="l00317"></a>00317     <span class="comment">/* Get user id */</span>
-<a name="l00318"></a>00318 
-<a name="l00319"></a>00319 <span class="preprocessor">#if defined HAVE_GETUID && defined HAVE_GETPWUID</span>
-<a name="l00320"></a>00320 <span class="preprocessor"></span>    pw = getpwuid(getuid());
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322     <span class="keywordflow">if</span> (!pw)
-<a name="l00323"></a>00323         <span class="keywordflow">return</span> NULL;
-<a name="l00324"></a>00324 
-<a name="l00325"></a>00325     user = pw->pw_name;
-<a name="l00326"></a>00326 <span class="preprocessor">#else</span>
-<a name="l00327"></a>00327 <span class="preprocessor"></span>    user = getenv(<span class="stringliteral">"USER"</span>);
-<a name="l00328"></a>00328     user = user == NULL ? getenv(<span class="stringliteral">"LOGNAME"</span>) : user;
-<a name="l00329"></a>00329 
-<a name="l00330"></a>00330     <span class="keywordflow">if</span> (!user)
-<a name="l00331"></a>00331         <span class="keywordflow">return</span> NULL;
-<a name="l00332"></a>00332 <span class="preprocessor">#endif</span>
-<a name="l00333"></a>00333 <span class="preprocessor"></span>
-<a name="l00334"></a>00334     <span class="comment">/* Get timestamp */</span>
-<a name="l00335"></a>00335 
-<a name="l00336"></a>00336     timestamp = <a class="code" href="group__forsPaf.html#g77e6970f0c1394755e48983ec30964b8">getTimeISO8601</a>();
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338     pos[0] = 0;
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_HDR_START, PAF_TYPE_NONE, NULL, NULL);
-<a name="l00341"></a>00341     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_TYPE, PAF_TYPE_STRING, type,
-<a name="l00342"></a>00342                   <span class="stringliteral">"Type of parameter file"</span>);
-<a name="l00343"></a>00343 
-<a name="l00344"></a>00344     <span class="keywordflow">if</span> (<span class="keywordtype">id</span>) {
-<a name="l00345"></a>00345         <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_ID, PAF_TYPE_STRING, <span class="keywordtype">id</span>, NULL);
-<a name="l00346"></a>00346     }
-<a name="l00347"></a>00347     <span class="keywordflow">else</span> {
-<a name="l00348"></a>00348         <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_ID, PAF_TYPE_STRING, <span class="stringliteral">""</span>, NULL);
-<a name="l00349"></a>00349     }
-<a name="l00350"></a>00350 
-<a name="l00351"></a>00351     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_NAME, PAF_TYPE_STRING, name, <span class="stringliteral">"Name of PAF"</span>);
-<a name="l00352"></a>00352 
-<a name="l00353"></a>00353     <span class="keywordflow">if</span> (desc)
-<a name="l00354"></a>00354         <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_DESC, PAF_TYPE_STRING, desc,
-<a name="l00355"></a>00355                       <span class="stringliteral">"Short description of PAF"</span>);
-<a name="l00356"></a>00356     <span class="keywordflow">else</span>
-<a name="l00357"></a>00357         <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_DESC, PAF_TYPE_STRING, <span class="stringliteral">""</span>,
-<a name="l00358"></a>00358                       <span class="stringliteral">"Short description of PAF"</span>);
-<a name="l00359"></a>00359 
-<a name="l00360"></a>00360     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_CRTE_NAME, PAF_TYPE_STRING, user,
-<a name="l00361"></a>00361                   <span class="stringliteral">"Name of creator"</span>);
-<a name="l00362"></a>00362     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_CRTE_TIME, PAF_TYPE_STRING, timestamp,
-<a name="l00363"></a>00363                   <span class="stringliteral">"Civil time for creation"</span>);
-<a name="l00364"></a>00364     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_LCHG_NAME, PAF_TYPE_STRING, user,
-<a name="l00365"></a>00365                   <span class="stringliteral">"Author of par. file"</span>);
-<a name="l00366"></a>00366     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_LCHG_TIME, PAF_TYPE_STRING, timestamp,
-<a name="l00367"></a>00367                   <span class="stringliteral">"Timestamp for last change"</span>);
-<a name="l00368"></a>00368     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_CHCK_NAME, PAF_TYPE_STRING, <span class="stringliteral">""</span>,
-<a name="l00369"></a>00369                   <span class="stringliteral">"Name of appl. checking"</span>);
-<a name="l00370"></a>00370     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_CHCK_TIME, PAF_TYPE_STRING, <span class="stringliteral">""</span>,
-<a name="l00371"></a>00371                   <span class="stringliteral">"Time for checking"</span>);
-<a name="l00372"></a>00372     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_CHCK_CHECKSUM, PAF_TYPE_STRING, <span class="stringliteral">""</span>,
-<a name="l00373"></a>00373                   <span class="stringliteral">"Checksum for the PAF"</span>);
-<a name="l00374"></a>00374     <a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&hdr, pos, PAF_HDR_END, PAF_TYPE_NONE, NULL, NULL);
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     <span class="keywordflow">return</span> hdr;
-<a name="l00377"></a>00377 
-<a name="l00378"></a>00378 }
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380 
-<a name="l00381"></a>00381 <span class="comment">/*</span>
-<a name="l00382"></a>00382 <span class="comment"> * Format a record so that it can be written to a parameter file on disk.</span>
-<a name="l00383"></a>00383 <span class="comment"> * The formatted record is written to the given output buffer.</span>
-<a name="l00384"></a>00384 <span class="comment"> */</span>
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386 <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *
-<a name="l00387"></a><a class="code" href="group__forsPaf.html#gee350e22bb8d324a29d3aae6033b670f">00387</a> <a class="code" href="group__forsPaf.html#gee350e22bb8d324a29d3aae6033b670f">_forsPAFFormatRecord</a>(<a class="code" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a> *record)
-<a name="l00388"></a>00388 {
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390     <span class="keyword">static</span> <span class="keywordtype">char</span> buffer[PAF_RECORD_MAX + 1];
-<a name="l00391"></a>00391     <span class="keywordtype">char</span> value[PAF_RECORD_MAX + 1];
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393     <span class="keywordtype">int</span> pos, sz;
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395 
-<a name="l00396"></a>00396     memset(buffer, <span class="charliteral">' '</span>, PAF_RECORD_MAX);
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398 
-<a name="l00399"></a>00399     <span class="comment">/*</span>
-<a name="l00400"></a>00400 <span class="comment">     * Verify that the record name fits into the buffer. The extra</span>
-<a name="l00401"></a>00401 <span class="comment">     * character is for the semicolon which has to be present.</span>
-<a name="l00402"></a>00402 <span class="comment">     */</span>
-<a name="l00403"></a>00403 
-<a name="l00404"></a>00404     <span class="keywordflow">if</span> (strlen(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">name</a>) + 1 > PAF_RECORD_MAX)
-<a name="l00405"></a>00405         <span class="keywordflow">return</span> NULL;
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407 
-<a name="l00408"></a>00408     <span class="comment">/*</span>
-<a name="l00409"></a>00409 <span class="comment">     * Build the formatted string from the record structure</span>
-<a name="l00410"></a>00410 <span class="comment">     */</span>
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412     sz = strlen(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">name</a>);
-<a name="l00413"></a>00413     strncpy(buffer, record-><a class="code" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">name</a>, sz);
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     pos = sz;
-<a name="l00416"></a>00416     <span class="keywordflow">if</span> (record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a>) {
-<a name="l00417"></a>00417         <span class="keywordflow">if</span> (pos < PAF_FIELD_OFFSET_VALUE)
-<a name="l00418"></a>00418             pos = PAF_FIELD_OFFSET_VALUE;
-<a name="l00419"></a>00419         <span class="keywordflow">else</span>
-<a name="l00420"></a>00420             pos++;
-<a name="l00421"></a>00421 
-<a name="l00422"></a>00422         <span class="keywordflow">switch</span> (record-><a class="code" href="struct__FORS__PAF__RECORD__.html#13b54564388819d2d248117bcb421ab3">type</a>) {
-<a name="l00423"></a>00423             <span class="keywordflow">case</span> PAF_TYPE_BOOL:
-<a name="l00424"></a>00424                 snprintf(value, PAF_RECORD_MAX, <span class="stringliteral">"%c"</span>,
-<a name="l00425"></a>00425                          *record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#633c615d76af4c00b82b50bf75cb4b84">bval</a> ? <span class="charliteral">'T'</span> : <span class="charliteral">'F'</span>);
-<a name="l00426"></a>00426                 <span class="keywordflow">break</span>;
-<a name="l00427"></a>00427 
-<a name="l00428"></a>00428             <span class="keywordflow">case</span> PAF_TYPE_INT:
-<a name="l00429"></a>00429                 snprintf(value, PAF_RECORD_MAX, <span class="stringliteral">"%d"</span>, *record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#880a737b5fffa6baaeaa97653bdb341e">ival</a>);
-<a name="l00430"></a>00430                 <span class="keywordflow">break</span>;
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432             <span class="keywordflow">case</span> PAF_TYPE_DOUBLE:
-<a name="l00433"></a>00433                 snprintf(value, PAF_RECORD_MAX, <span class="stringliteral">"%.15G"</span>, *record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#34d5c881a9bc312b95bc3d644d6fb522">dval</a>);
-<a name="l00434"></a>00434                 <span class="keywordflow">if</span> (!strchr(value, <span class="charliteral">'.'</span>)) {
-<a name="l00435"></a>00435                     <span class="keywordflow">if</span> (strchr(value, <span class="charliteral">'E'</span>))
-<a name="l00436"></a>00436                         snprintf(value, PAF_RECORD_MAX, <span class="stringliteral">"%.1E"</span>,
-<a name="l00437"></a>00437                                  *record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#34d5c881a9bc312b95bc3d644d6fb522">dval</a>);
-<a name="l00438"></a>00438                     <span class="keywordflow">else</span>
-<a name="l00439"></a>00439                         strcat(value, <span class="stringliteral">"."</span>);
-<a name="l00440"></a>00440                 }
-<a name="l00441"></a>00441                 <span class="keywordflow">break</span>;
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443             <span class="keywordflow">case</span> PAF_TYPE_STRING:
-<a name="l00444"></a>00444                 snprintf(value, PAF_RECORD_MAX, <span class="stringliteral">"\"%s\""</span>, record-><a class="code" href="struct__FORS__PAF__RECORD__.html#af503bdde0ec76ccfa978ec693f61d40">data</a>.<a class="code" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a>);
-<a name="l00445"></a>00445                 <span class="keywordflow">break</span>;
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447             <span class="keywordflow">case</span> PAF_TYPE_NONE:
-<a name="l00448"></a>00448 
-<a name="l00449"></a>00449                 <span class="comment">/* </span>
-<a name="l00450"></a>00450 <span class="comment">                 * Should not reach this point. If type is PAF_TYPE_NONE</span>
-<a name="l00451"></a>00451 <span class="comment">                 * the data pointer should always be NULL.</span>
-<a name="l00452"></a>00452 <span class="comment">                 */</span>
-<a name="l00453"></a>00453                 
-<a name="l00454"></a>00454                 <span class="keywordflow">break</span>;
-<a name="l00455"></a>00455         }
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457         sz = strlen(value);
-<a name="l00458"></a>00458 
-<a name="l00459"></a>00459         <span class="comment">/* </span>
-<a name="l00460"></a>00460 <span class="comment">         * Verify that writing the value string does not overflow the buffer.</span>
-<a name="l00461"></a>00461 <span class="comment">         */</span>
-<a name="l00462"></a>00462         
-<a name="l00463"></a>00463         <span class="keywordflow">if</span> (sz > PAF_RECORD_MAX - pos + 1)
-<a name="l00464"></a>00464             <span class="keywordflow">return</span> NULL;
-<a name="l00465"></a>00465 
-<a name="l00466"></a>00466         strncpy(&buffer[pos], value, sz);
-<a name="l00467"></a>00467         pos += sz;
-<a name="l00468"></a>00468     }
-<a name="l00469"></a>00469 
-<a name="l00470"></a>00470     buffer[pos++] = <span class="charliteral">';'</span>;
-<a name="l00471"></a>00471 
-<a name="l00472"></a>00472 
-<a name="l00473"></a>00473     <span class="comment">/*</span>
-<a name="l00474"></a>00474 <span class="comment">     * Comments are not printed if there is room in the buffer for at least 3</span>
-<a name="l00475"></a>00475 <span class="comment">     * characters, so that not only the hash and/or the following blank</span>
-<a name="l00476"></a>00476 <span class="comment">     * could be stored because of the finite record size.</span>
-<a name="l00477"></a>00477 <span class="comment">     */</span>
-<a name="l00478"></a>00478 
-<a name="l00479"></a>00479     <span class="keywordflow">if</span> (record-><a class="code" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">comment</a> && (PAF_RECORD_MAX - pos) >= 2) {
-<a name="l00480"></a>00480         <span class="keywordflow">if</span> (pos < PAF_FIELD_OFFSET_COMMENT)
-<a name="l00481"></a>00481             pos = PAF_FIELD_OFFSET_COMMENT;
-<a name="l00482"></a>00482         <span class="keywordflow">else</span>
-<a name="l00483"></a>00483             pos++;
-<a name="l00484"></a>00484 
-<a name="l00485"></a>00485         strncpy(&buffer[pos], <span class="stringliteral">"# "</span>, 2);
-<a name="l00486"></a>00486         pos += 2;
-<a name="l00487"></a>00487         sz = strlen(record-><a class="code" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">comment</a>);
-<a name="l00488"></a>00488         strncpy(&buffer[pos], record-><a class="code" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">comment</a>, sz);
-<a name="l00489"></a>00489         pos += sz;
-<a name="l00490"></a>00490     }
-<a name="l00491"></a>00491 
-<a name="l00492"></a>00492     buffer[pos] = <span class="charliteral">'\0'</span>;
-<a name="l00493"></a>00493     
-<a name="l00494"></a>00494     <span class="keywordflow">return</span> buffer;
-<a name="l00495"></a>00495 }
-<a name="l00496"></a>00496 
-<a name="l00497"></a>00497 
-<a name="l00509"></a><a class="code" href="group__forsPaf.html#gefe94695ad068025eff46fe69998e75d">00509</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__forsPaf.html#gefe94695ad068025eff46fe69998e75d">deleteForsPAF</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)
-<a name="l00510"></a>00510 {
-<a name="l00511"></a>00511 
-<a name="l00512"></a>00512     <span class="keywordtype">int</span> i;
-<a name="l00513"></a>00513 
-<a name="l00514"></a>00514     <span class="keywordflow">if</span> (paf) {
-<a name="l00515"></a>00515         <span class="keywordflow">for</span> (i = 0; i < paf-><a class="code" href="struct__FORS__PAF__.html#8bf1f1454a4b17f7672624a3b8c2bd2c">nh</a>; i++)
-<a name="l00516"></a>00516             <a class="code" href="group__forsPaf.html#gfb1c398d9c412268e4845b2c584b1aed">_forsPAFRecordDestroy</a>(paf-><a class="code" href="struct__FORS__PAF__.html#cdc2007f38750ed7ef260e8409d4eb1f">header</a>[i]);
-<a name="l00517"></a>00517         for (i = 0; i < paf-><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a>; i++)
-<a name="l00518"></a>00518             <a class="code" href="group__forsPaf.html#gfb1c398d9c412268e4845b2c584b1aed">_forsPAFRecordDestroy</a>(paf-><a class="code" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">records</a>[i]);
-<a name="l00519"></a>00519         cpl_free(paf-><a class="code" href="struct__FORS__PAF__.html#cdc2007f38750ed7ef260e8409d4eb1f">header</a>);
-<a name="l00520"></a>00520         cpl_free(paf-><a class="code" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">records</a>);
-<a name="l00521"></a>00521         cpl_free(paf-><a class="code" href="struct__FORS__PAF__.html#34a869607ecd20de7f2452c808b64de6">name</a>);
-<a name="l00522"></a>00522         cpl_free(paf);
-<a name="l00523"></a>00523     }
-<a name="l00524"></a>00524 
-<a name="l00525"></a>00525     <span class="keywordflow">return</span>;
-<a name="l00526"></a>00526 
-<a name="l00527"></a>00527 }
-<a name="l00528"></a>00528 
-<a name="l00529"></a>00529 
-<a name="l00548"></a><a class="code" href="group__forsPaf.html#gb2e886163098d674eb07e95d96b38229">00548</a> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *<a class="code" href="group__forsPaf.html#gb2e886163098d674eb07e95d96b38229">newForsPAF</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *type, <span class="keyword">const</span> <span class="keywordtype">char</span [...]
-<a name="l00549"></a>00549                   <span class="keyword">const</span> <span class="keywordtype">char</span> *desc)
-<a name="l00550"></a>00550 {
-<a name="l00551"></a>00551 
-<a name="l00552"></a>00552     <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf;
-<a name="l00553"></a>00553     <span class="keywordtype">int</span>     pos = 0;
-<a name="l00554"></a>00554 
-<a name="l00555"></a>00555 
-<a name="l00556"></a>00556     <span class="keywordflow">if</span> (!name || !type)
-<a name="l00557"></a>00557         <span class="keywordflow">return</span> NULL;
-<a name="l00558"></a>00558 
-<a name="l00559"></a>00559     paf = (<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *)cpl_malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a>));
-<a name="l00560"></a>00560     <span class="keywordflow">if</span> (paf) {
-<a name="l00561"></a>00561         paf-><a class="code" href="struct__FORS__PAF__.html#cdc2007f38750ed7ef260e8409d4eb1f">header</a> = <a class="code" href="group__forsPaf.html#g603cc78fa373dc03085f39b09c8f3ff3">_forsPAFHeaderCreate</a>(name, type, <span class="keywordtype">id</span>, desc, &pos);
-<a name="l00562"></a>00562         paf-><a class="code" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">records</a> = NULL;
-<a name="l00563"></a>00563         paf-><a class="code" href="struct__FORS__PAF__.html#8bf1f1454a4b17f7672624a3b8c2bd2c">nh</a> = pos;
-<a name="l00564"></a>00564         paf-><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a> = 0;
-<a name="l00565"></a>00565         paf-><a class="code" href="struct__FORS__PAF__.html#34a869607ecd20de7f2452c808b64de6">name</a> = cpl_strdup(name);
-<a name="l00566"></a>00566     }
-<a name="l00567"></a>00567 
-<a name="l00568"></a>00568     <span class="keywordflow">return</span> paf;
-<a name="l00569"></a>00569 
-<a name="l00570"></a>00570 }
-<a name="l00571"></a>00571 
-<a name="l00572"></a>00572 
-<a name="l00586"></a>00586 <span class="keywordtype">int</span>
-<a name="l00587"></a><a class="code" href="group__forsPaf.html#ge80d2196e3845f5857f374416333edbc">00587</a> <a class="code" href="group__forsPaf.html#ge80d2196e3845f5857f374416333edbc">forsPAFIsEmpty</a>(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)
-<a name="l00588"></a>00588 {
-<a name="l00589"></a>00589 
-<a name="l00590"></a>00590     assert(paf != NULL);
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     <span class="keywordflow">return</span> paf-><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a> == 0 ? 1 : 0;
-<a name="l00593"></a>00593 
-<a name="l00594"></a>00594 }
-<a name="l00595"></a>00595 
-<a name="l00596"></a>00596 
-<a name="l00611"></a><a class="code" href="group__forsPaf.html#gb39490ffdb9ac9b2e666d75da2436b65">00611</a> size_t <a class="code" href="group__forsPaf.html#gb39490ffdb9ac9b2e666d75da2436b65">forsPAFGetSize</a>(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)
-<a name="l00612"></a>00612 {
-<a name="l00613"></a>00613     assert(paf != NULL);
-<a name="l00614"></a>00614 
-<a name="l00615"></a>00615     <span class="keywordflow">return</span> (size_t)paf-><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a>;
-<a name="l00616"></a>00616 
-<a name="l00617"></a>00617 }
-<a name="l00618"></a>00618 
-<a name="l00619"></a>00619 
-<a name="l00634"></a>00634 <span class="keyword">inline</span> <span class="keywordtype">int</span>
-<a name="l00635"></a><a class="code" href="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917">00635</a> <a class="code" href="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917">forsPAFIsValidName</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name)
-<a name="l00636"></a>00636 {
-<a name="l00637"></a>00637 
-<a name="l00638"></a>00638     <span class="keyword">register</span> size_t i, sz;
-<a name="l00639"></a>00639 
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641     assert(name != NULL);
-<a name="l00642"></a>00642 
-<a name="l00643"></a>00643     <span class="keywordflow">if</span> (strchr(name, <span class="charliteral">' '</span>))
-<a name="l00644"></a>00644         <span class="keywordflow">return</span> 0;
-<a name="l00645"></a>00645 
-<a name="l00646"></a>00646     sz = strlen(name);
-<a name="l00647"></a>00647     <span class="keywordflow">for</span> (i = 0; i <sz; i++) {
-<a name="l00648"></a>00648         <span class="keywordtype">char</span> c = name[i];
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650         <span class="comment">/*</span>
-<a name="l00651"></a>00651 <span class="comment">         * Names may be composed from uppercase letters, digits, the dot</span>
-<a name="l00652"></a>00652 <span class="comment">         * and the underscore only.</span>
-<a name="l00653"></a>00653 <span class="comment">         */</span>
-<a name="l00654"></a>00654 
-<a name="l00655"></a>00655         <span class="comment">/*</span>
-<a name="l00656"></a>00656 <span class="comment">         * Note: The characer class functions have to be enclosed in</span>
-<a name="l00657"></a>00657 <span class="comment">         *   parantheses to use the actual function on HP-UX where these</span>
-<a name="l00658"></a>00658 <span class="comment">         *   functions are also provided as macros, which are taken by</span>
-<a name="l00659"></a>00659 <span class="comment">         *   default and may lead to compiler warnings.</span>
-<a name="l00660"></a>00660 <span class="comment">         */</span>
-<a name="l00661"></a>00661 
-<a name="l00662"></a>00662         <span class="keywordflow">if</span> (!(isupper)(c) && !(isdigit)(c) && c != <span class="charliteral">'.'</span> && c != <span class="charliteral">'_'</span> && c != <span class="charliteral">'-'</span>)
-<a name="l00663"></a>00663             <span class="keywordflow">return</span> 0;
-<a name="l00664"></a>00664     }
-<a name="l00665"></a>00665 
-<a name="l00666"></a>00666     <span class="keywordflow">return</span> 1;
-<a name="l00667"></a>00667 
-<a name="l00668"></a>00668 }
-<a name="l00669"></a>00669 
-<a name="l00670"></a>00670 
-<a name="l00687"></a>00687 <span class="keyword">inline</span> <span class="keywordtype">int</span>
-<a name="l00688"></a><a class="code" href="group__forsPaf.html#g15b886f9811c703203b77a91e3bd0e91">00688</a> <a class="code" href="group__forsPaf.html#g15b886f9811c703203b77a91e3bd0e91">forsPAFAppendBool</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">int</span> value, <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)
-<a name="l00689"></a>00689 {
-<a name="l00690"></a>00690     assert(paf != NULL);
-<a name="l00691"></a>00691     assert(name != NULL);
-<a name="l00692"></a>00692     
-<a name="l00693"></a>00693     <span class="keywordflow">if</span> (!<a class="code" href="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917">forsPAFIsValidName</a>(name) && name[0] != <span class="charliteral">'#'</span> && name [0] != <span class="charliteral">'\0'</span>)
-<a name="l00694"></a>00694         <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00695"></a>00695 
-<a name="l00696"></a>00696     <span class="keywordflow">if</span> (<a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&(paf-><a class="code" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">records</a>), &(paf-><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a>), name, PAF_TYPE_BOOL, 
-<a name="l00697"></a>00697                       &value, comment))
-<a name="l00698"></a>00698         <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700     <span class="keywordflow">return</span> EXIT_SUCCESS;
-<a name="l00701"></a>00701 
-<a name="l00702"></a>00702 }
-<a name="l00703"></a>00703 
-<a name="l00704"></a>00704 
-<a name="l00721"></a>00721 <span class="keyword">inline</span> <span class="keywordtype">int</span>
-<a name="l00722"></a><a class="code" href="group__forsPaf.html#gde7f65f7ca0d7e3e24babefd2c8d8716">00722</a> <a class="code" href="group__forsPaf.html#gde7f65f7ca0d7e3e24babefd2c8d8716">forsPAFAppendInt</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">int</span> value, <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)
-<a name="l00723"></a>00723 {
-<a name="l00724"></a>00724 
-<a name="l00725"></a>00725     assert(paf != NULL);
-<a name="l00726"></a>00726     assert(name != NULL);
-<a name="l00727"></a>00727     
-<a name="l00728"></a>00728     <span class="keywordflow">if</span> (!<a class="code" href="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917">forsPAFIsValidName</a>(name) && name[0] != <span class="charliteral">'#'</span> && name [0] != <span class="charliteral">'\0'</span>)
-<a name="l00729"></a>00729         <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00730"></a>00730 
-<a name="l00731"></a>00731     <span class="keywordflow">if</span> (<a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&(paf-><a class="code" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">records</a>), &(paf-><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a>), name, PAF_TYPE_INT, 
-<a name="l00732"></a>00732                       &value, comment))
-<a name="l00733"></a>00733         <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00734"></a>00734 
-<a name="l00735"></a>00735     <span class="keywordflow">return</span> EXIT_SUCCESS;
-<a name="l00736"></a>00736 
-<a name="l00737"></a>00737 }
-<a name="l00738"></a>00738 
-<a name="l00739"></a>00739 
-<a name="l00756"></a>00756 <span class="keyword">inline</span> <span class="keywordtype">int</span>
-<a name="l00757"></a><a class="code" href="group__forsPaf.html#gdd6ed0c50b7cf4c62fdbabd0794487e4">00757</a> <a class="code" href="group__forsPaf.html#gdd6ed0c50b7cf4c62fdbabd0794487e4">forsPAFAppendDouble</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">double</span> value,
-<a name="l00758"></a>00758                    <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)
-<a name="l00759"></a>00759 {
-<a name="l00760"></a>00760 
-<a name="l00761"></a>00761     assert(paf != NULL);
-<a name="l00762"></a>00762     assert(name != NULL);
-<a name="l00763"></a>00763     
-<a name="l00764"></a>00764     <span class="keywordflow">if</span> (!<a class="code" href="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917">forsPAFIsValidName</a>(name) && name[0] != <span class="charliteral">'#'</span> && name [0] != <span class="charliteral">'\0'</span>)
-<a name="l00765"></a>00765         <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00766"></a>00766 
-<a name="l00767"></a>00767     <span class="keywordflow">if</span> (<a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&(paf-><a class="code" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">records</a>), &(paf-><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a>), name, PAF_TYPE_DOUBLE, 
-<a name="l00768"></a>00768                       &value, comment))
-<a name="l00769"></a>00769         <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00770"></a>00770 
-<a name="l00771"></a>00771     <span class="keywordflow">return</span> EXIT_SUCCESS;
-<a name="l00772"></a>00772 
-<a name="l00773"></a>00773 }
-<a name="l00774"></a>00774 
-<a name="l00775"></a>00775 
-<a name="l00792"></a>00792 <span class="keyword">inline</span> <span class="keywordtype">int</span>
-<a name="l00793"></a><a class="code" href="group__forsPaf.html#gf615f1fbc45dd108391de129e67d58b2">00793</a> <a class="code" href="group__forsPaf.html#gf615f1fbc45dd108391de129e67d58b2">forsPAFAppendString</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value,
-<a name="l00794"></a>00794                    <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)
-<a name="l00795"></a>00795 {
-<a name="l00796"></a>00796 
-<a name="l00797"></a>00797     assert(paf != NULL);
-<a name="l00798"></a>00798     assert(name != NULL);
-<a name="l00799"></a>00799     
-<a name="l00800"></a>00800     <span class="keywordflow">if</span> (!<a class="code" href="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917">forsPAFIsValidName</a>(name) && name[0] != <span class="charliteral">'#'</span> && name [0] != <span class="charliteral">'\0'</span>)
-<a name="l00801"></a>00801         <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00802"></a>00802 
-<a name="l00803"></a>00803     <span class="keywordflow">if</span> (<a class="code" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a>(&(paf-><a class="code" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">records</a>), &(paf-><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a>), name, PAF_TYPE_STRING, 
-<a name="l00804"></a>00804                       value, comment))
-<a name="l00805"></a>00805         <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00806"></a>00806 
-<a name="l00807"></a>00807     <span class="keywordflow">return</span> EXIT_SUCCESS;
-<a name="l00808"></a>00808 
-<a name="l00809"></a>00809 }
-<a name="l00810"></a>00810 
-<a name="l00811"></a>00811 
-<a name="l00826"></a>00826 <span class="keywordtype">int</span>
-<a name="l00827"></a><a class="code" href="group__forsPaf.html#g2cceff721bbbd99c1a4bddfb57ed688b">00827</a> <a class="code" href="group__forsPaf.html#g2cceff721bbbd99c1a4bddfb57ed688b">forsPAFWrite</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)
-<a name="l00828"></a>00828 {
-<a name="l00829"></a>00829 
-<a name="l00830"></a>00830     <span class="keyword">const</span> <span class="keywordtype">char</span> *record;
-<a name="l00831"></a>00831     FILE *stream;
-<a name="l00832"></a>00832     <span class="keywordtype">int</span> i;
-<a name="l00833"></a>00833 
-<a name="l00834"></a>00834 
-<a name="l00835"></a>00835     <span class="keywordflow">if</span> (!paf)
-<a name="l00836"></a>00836         <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00837"></a>00837 
-<a name="l00838"></a>00838     assert(paf-><a class="code" href="struct__FORS__PAF__.html#cdc2007f38750ed7ef260e8409d4eb1f">header</a> != NULL);
-<a name="l00839"></a>00839 
-<a name="l00840"></a>00840 
-<a name="l00841"></a>00841     <span class="comment">/*</span>
-<a name="l00842"></a>00842 <span class="comment">     * Create output file</span>
-<a name="l00843"></a>00843 <span class="comment">     */</span>
-<a name="l00844"></a>00844 
-<a name="l00845"></a>00845     stream = fopen(paf-><a class="code" href="struct__FORS__PAF__.html#34a869607ecd20de7f2452c808b64de6">name</a>, <span class="stringliteral">"wb"</span>);
-<a name="l00846"></a>00846     <span class="keywordflow">if</span> (!stream)
-<a name="l00847"></a>00847         <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00848"></a>00848 
-<a name="l00849"></a>00849 
-<a name="l00850"></a>00850     <span class="keywordflow">for</span> (i = 0; i < paf-><a class="code" href="struct__FORS__PAF__.html#8bf1f1454a4b17f7672624a3b8c2bd2c">nh</a>; i++) {
-<a name="l00851"></a>00851         record = <a class="code" href="group__forsPaf.html#gee350e22bb8d324a29d3aae6033b670f">_forsPAFFormatRecord</a>(paf-><a class="code" href="struct__FORS__PAF__.html#cdc2007f38750ed7ef260e8409d4eb1f">header</a>[i]);
-<a name="l00852"></a>00852         if (!record) {
-<a name="l00853"></a>00853             fclose(stream);
-<a name="l00854"></a>00854             <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00855"></a>00855         }
-<a name="l00856"></a>00856             
-<a name="l00857"></a>00857         fprintf(stream, <span class="stringliteral">"%s\n"</span>, record);
-<a name="l00858"></a>00858     }
-<a name="l00859"></a>00859 
-<a name="l00860"></a>00860 
-<a name="l00861"></a>00861     <span class="keywordflow">if</span> (paf-><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a>) {
-<a name="l00862"></a>00862         <span class="keywordtype">char</span> buffer[PAF_RECORD_MAX];
-<a name="l00863"></a>00863 
-<a name="l00864"></a>00864         buffer[0] = <span class="charliteral">'#'</span>;
-<a name="l00865"></a>00865         memset(&buffer[1], <span class="charliteral">'-'</span>, 78);
-<a name="l00866"></a>00866         buffer[79] = <span class="charliteral">'\0'</span>;
-<a name="l00867"></a>00867         fprintf(stream, <span class="stringliteral">"%s\n"</span>, buffer);
-<a name="l00868"></a>00868     }
-<a name="l00869"></a>00869 
-<a name="l00870"></a>00870     <span class="keywordflow">for</span> (i = 0; i < paf-><a class="code" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a>; i++) {
-<a name="l00871"></a>00871         record = <a class="code" href="group__forsPaf.html#gee350e22bb8d324a29d3aae6033b670f">_forsPAFFormatRecord</a>(paf-><a class="code" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">records</a>[i]);
-<a name="l00872"></a>00872         if (!record) {
-<a name="l00873"></a>00873             fclose(stream);
-<a name="l00874"></a>00874             <span class="keywordflow">return</span> EXIT_FAILURE;
-<a name="l00875"></a>00875         }
-<a name="l00876"></a>00876 
-<a name="l00877"></a>00877         fprintf(stream, <span class="stringliteral">"%s\n"</span>, record);
-<a name="l00878"></a>00878     }
-<a name="l00879"></a>00879 
-<a name="l00880"></a>00880     fclose(stream);
-<a name="l00881"></a>00881 
-<a name="l00882"></a>00882     <span class="keywordflow">return</span> EXIT_SUCCESS;
-<a name="l00883"></a>00883     
-<a name="l00884"></a>00884 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__paf_8c_source.html b/html/fors__paf_8c_source.html
new file mode 100644
index 0000000..b3e88ac
--- /dev/null
+++ b/html/fors__paf_8c_source.html
@@ -0,0 +1,796 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_paf.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_paf.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_paf.c,v 1.6 2013-08-14 13:28:56 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-14 13:28:56 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.6 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <ctype.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <unistd.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <pwd.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <sys/types.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <time.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <assert.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <fors_paf.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="comment"> * Reserved PAF header keywords</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#define PAF_HDR_START      "PAF.HDR.START"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_TYPE           "PAF.TYPE"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_ID             "PAF.ID"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_NAME           "PAF.NAME"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_DESC           "PAF.DESC"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_CRTE_NAME      "PAF.CRTE.NAME"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_CRTE_TIME      "PAF.CRTE.DAYTIM"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_LCHG_NAME      "PAF.LCHG.NAME"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_LCHG_TIME      "PAF.LCHG.DAYTIM"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_CHCK_NAME      "PAF.CHCK.NAME"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_CHCK_TIME      "PAF.CHCK.DAYTIM"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_CHCK_CHECKSUM  "PAF.CHCK.CHECKSUM"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_HDR_END        "PAF.HDR.END"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="comment"> * Value and comment field start position</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">#define PAF_FIELD_OFFSET_VALUE    20</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_FIELD_OFFSET_COMMENT  45</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="comment"> * PAF record definition. This corresponds to one line of a parameter file.</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> </div>
+<div class="line"><a name="l00085"></a><span class="lineno"><a class="code" href="struct__FORS__PAF__RECORD__.html">   85</a></span> <span class="keyword">struct </span><a class="code" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_</a> {</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     <span class="keywordtype">char</span> *comment;</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     ForsPAFType type;</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     <span class="keyword">union </span>{</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>         <span class="keywordtype">int</span> *bval;</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>         <span class="keywordtype">int</span> *ival;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>         <span class="keywordtype">double</span> *dval;</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>         <span class="keywordtype">char</span> *sval;</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     } data;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> };</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_</a> <a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a>;</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="comment"> * The PAF object</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> </div>
+<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="struct__FORS__PAF__.html">  105</a></span> <span class="keyword">struct </span><a class="code" href="struct__FORS__PAF__.html">_FORS_PAF_</a> {</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="keywordtype">int</span> nh;</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="keywordtype">int</span> nr;</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> **header;</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     <a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> **records;</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> };</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="comment"> * @brief</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="comment"> *   Get current date and time in ISO8601 format.</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="comment"> * @return Pointer to a statically allocated string in the function</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="comment"> *   (no need to free it). In case of failure, returns a @c NULL.</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="comment"> * This private function just returns the current time in ISO8601 format.</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor">#define TIME_ISO8601_LENGTH (20)</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="keyword">static</span> <span class="keywordtype">char</span> *getTimeISO8601(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> {</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <span class="keyword">static</span> <span class="keywordtype">char</span> timeISO8601[TIME_ISO8601_LENGTH];</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     time_t      seconds = time((time_t *)0);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="keywordflow">if</span> (strftime(timeISO8601, TIME_ISO8601_LENGTH,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                     <span class="stringliteral">"%Y-%m-%dT%T"</span>, localtime(&seconds)) == 0)</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         strcpy(timeISO8601, <span class="stringliteral">"0000-00-00T00:00:00"</span>);</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     <span class="keywordflow">return</span> timeISO8601;</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> }</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="comment"> * Compute record type size in bytes.</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">size_t</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> _forsPAFValueSize(ForsPAFType type, <span class="keyword">const</span> <span class="keywordtype">void</span> *value)</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> {</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="keywordtype">size_t</span> sz;</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="keywordflow">switch</span> (type) {</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>         <span class="keywordflow">case</span> PAF_TYPE_BOOL:</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>             sz = <span class="keyword">sizeof</span>(int);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>             </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>         <span class="keywordflow">case</span> PAF_TYPE_INT:</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>             sz = <span class="keyword">sizeof</span>(int);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>         <span class="keywordflow">case</span> PAF_TYPE_DOUBLE:</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>             sz = <span class="keyword">sizeof</span>(double);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>         <span class="keywordflow">case</span> PAF_TYPE_STRING:</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>             sz = (strlen((<span class="keywordtype">char</span> *)value) + 1) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>);</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>         <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>                 sz = 0;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>         }</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     <span class="keywordflow">return</span> sz;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> }</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="comment"> * Destroy a PAF record</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> _forsPAFRecordDestroy(<a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record)</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> {</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> </div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     <span class="keywordflow">if</span> (record) {</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>         cpl_free(record->name);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         cpl_free((<span class="keywordtype">void</span> *)record->data.sval);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>         cpl_free(record->comment);</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>         cpl_free(record);</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     }</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> }</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="comment"> * Create a new PAF record</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> _forsPAFRecordCreate(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, ForsPAFType type, <span class="keyword">const</span> <span class="keywordtype">void</span> *value,</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> {</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <span class="keywordtype">size_t</span> sz;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     <a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record = cpl_malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a>));</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     record->name = cpl_strdup(name);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     record->comment = comment ? cpl_strdup(comment) : NULL;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     record->type = type;</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     sz = _forsPAFValueSize(type, value);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <span class="keywordflow">if</span> (sz == 0) {</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>         record->data.sval = NULL;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     }</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>         record->data.sval = (<span class="keywordtype">char</span> *)cpl_malloc(sz);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     }</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     memcpy(record->data.sval, value, sz);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="keywordflow">return</span> record;</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> </div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> }</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="comment"> * Set name, value and comment of a PAF record</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> </div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> _forsPAFRecordSet(<a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, ForsPAFType type,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                  <span class="keyword">const</span> <span class="keywordtype">void</span> *value, <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> {</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="keywordflow">if</span> (name) {</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>         cpl_free(record->name);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>         record->name = cpl_strdup(name);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     }</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="keywordflow">if</span> (comment) {</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>         cpl_free(record->comment);</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>         record->comment = cpl_strdup(comment);</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     }</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> </div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <span class="keywordflow">if</span> (value) {</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>         <span class="keywordtype">size_t</span> sz = _forsPAFValueSize(type, value);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>         <span class="keywordflow">if</span> (record->data.sval) {</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>             <span class="keywordtype">size_t</span> size = _forsPAFValueSize(record->type, record->data.sval);</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>             <span class="keywordflow">if</span> (sz != size)</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>                 record->data.sval = (<span class="keywordtype">char</span> *)cpl_realloc(record->data.sval, sz);</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>         }</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>             record->data.sval = (<span class="keywordtype">char</span> *)cpl_malloc(sz);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         memcpy(record->data.sval, value, sz);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>         record->type = type;</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     }</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> }</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> <span class="comment"> * Create a record from name, value and comment and append the record to</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> <span class="comment"> * the PAF header or record list.</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> _forsPAFAppend(<a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> ***<a class="code" href="structlist.html">list</a>, <span class="keywordtype">int</span> *pos, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>               ForsPAFType type, <span class="keyword">const</span> <span class="keywordtype">void</span> *value, <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> {</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     <a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     record = _forsPAFRecordCreate(name, type, value, comment);</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="keywordflow">if</span> (!record)</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">if</span> (pos[0] == 0) {</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>         *list = cpl_malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *));</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     }</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>         *list = cpl_realloc(*list, (pos[0]+1) * <span class="keyword">sizeof</span>(<a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *));</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     }</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> </div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     (*list)[pos[0]] = record;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     pos[0]++;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> </div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> }</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> <span class="comment"> * Create a new PAF header.</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> <span class="keyword">inline</span> <span class="keyword">static</span> <a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> **</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> _forsPAFHeaderCreate(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *type, <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keywordtype">id</span>,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *desc, <span class="keywordtype">int</span> *pos)</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> {</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> **hdr;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *user, *timestamp;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> <span class="preprocessor">#if defined HAVE_GETUID && defined HAVE_GETPWUID</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> <span class="preprocessor"></span>    <span class="keyword">struct </span>passwd *pw;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <span class="comment">/* Get user id */</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> </div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> <span class="preprocessor">#if defined HAVE_GETUID && defined HAVE_GETPWUID</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> <span class="preprocessor"></span>    pw = getpwuid(getuid());</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     <span class="keywordflow">if</span> (!pw)</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> </div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     user = pw->pw_name;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> <span class="preprocessor"></span>    user = getenv(<span class="stringliteral">"USER"</span>);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     user = user == NULL ? getenv(<span class="stringliteral">"LOGNAME"</span>) : user;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="keywordflow">if</span> (!user)</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     {</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     }</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="comment">/* Get timestamp */</span></div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     timestamp = getTimeISO8601();</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> </div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     pos[0] = 0;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> </div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     _forsPAFAppend(&hdr, pos, PAF_HDR_START, PAF_TYPE_NONE, NULL, NULL);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     _forsPAFAppend(&hdr, pos, PAF_TYPE, PAF_TYPE_STRING, type,</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>                   <span class="stringliteral">"Type of parameter file"</span>);</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordflow">if</span> (<span class="keywordtype">id</span>) {</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>         _forsPAFAppend(&hdr, pos, PAF_ID, PAF_TYPE_STRING, <span class="keywordtype">id</span>, NULL);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     }</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>         _forsPAFAppend(&hdr, pos, PAF_ID, PAF_TYPE_STRING, <span class="stringliteral">""</span>, NULL);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     }</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> </div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     _forsPAFAppend(&hdr, pos, PAF_NAME, PAF_TYPE_STRING, name, <span class="stringliteral">"Name of PAF"</span>);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     <span class="keywordflow">if</span> (desc)</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>         _forsPAFAppend(&hdr, pos, PAF_DESC, PAF_TYPE_STRING, desc,</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>                       <span class="stringliteral">"Short description of PAF"</span>);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>         _forsPAFAppend(&hdr, pos, PAF_DESC, PAF_TYPE_STRING, <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                       <span class="stringliteral">"Short description of PAF"</span>);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     _forsPAFAppend(&hdr, pos, PAF_CRTE_NAME, PAF_TYPE_STRING, user,</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                   <span class="stringliteral">"Name of creator"</span>);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     _forsPAFAppend(&hdr, pos, PAF_CRTE_TIME, PAF_TYPE_STRING, timestamp,</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                   <span class="stringliteral">"Civil time for creation"</span>);</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     _forsPAFAppend(&hdr, pos, PAF_LCHG_NAME, PAF_TYPE_STRING, user,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                   <span class="stringliteral">"Author of par. file"</span>);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     _forsPAFAppend(&hdr, pos, PAF_LCHG_TIME, PAF_TYPE_STRING, timestamp,</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                   <span class="stringliteral">"Timestamp for last change"</span>);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     _forsPAFAppend(&hdr, pos, PAF_CHCK_NAME, PAF_TYPE_STRING, <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>                   <span class="stringliteral">"Name of appl. checking"</span>);</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     _forsPAFAppend(&hdr, pos, PAF_CHCK_TIME, PAF_TYPE_STRING, <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>                   <span class="stringliteral">"Time for checking"</span>);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     _forsPAFAppend(&hdr, pos, PAF_CHCK_CHECKSUM, PAF_TYPE_STRING, <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>                   <span class="stringliteral">"Checksum for the PAF"</span>);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     _forsPAFAppend(&hdr, pos, PAF_HDR_END, PAF_TYPE_NONE, NULL, NULL);</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordflow">return</span> hdr;</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> </div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> }</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> </div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> <span class="comment"> * Format a record so that it can be written to a parameter file on disk.</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> <span class="comment"> * The formatted record is written to the given output buffer.</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> _forsPAFFormatRecord(<a class="code" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record)</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> {</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <span class="keyword">static</span> <span class="keywordtype">char</span> buffer[PAF_RECORD_MAX + 1];</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordtype">char</span> value[PAF_RECORD_MAX + 1];</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     <span class="keywordtype">int</span> pos, sz;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     memset(buffer, <span class="charliteral">' '</span>, PAF_RECORD_MAX);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> </div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> <span class="comment">     * Verify that the record name fits into the buffer. The extra</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> <span class="comment">     * character is for the semicolon which has to be present.</span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     <span class="keywordflow">if</span> (strlen(record->name) + 1 > PAF_RECORD_MAX)</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span> </div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> </div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> <span class="comment">     * Build the formatted string from the record structure</span></div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> </div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     sz = strlen(record->name);</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     strncpy(buffer, record->name, sz);</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     pos = sz;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     <span class="keywordflow">if</span> (record->data.sval) {</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>         <span class="keywordflow">if</span> (pos < PAF_FIELD_OFFSET_VALUE)</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>             pos = PAF_FIELD_OFFSET_VALUE;</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>             pos++;</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>         <span class="keywordflow">switch</span> (record->type) {</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>             <span class="keywordflow">case</span> PAF_TYPE_BOOL:</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>                 snprintf(value, PAF_RECORD_MAX, <span class="stringliteral">"%c"</span>,</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                          *record->data.bval ? <span class="charliteral">'T'</span> : <span class="charliteral">'F'</span>);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> </div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>             <span class="keywordflow">case</span> PAF_TYPE_INT:</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>                 snprintf(value, PAF_RECORD_MAX, <span class="stringliteral">"%d"</span>, *record->data.ival);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> </div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>             <span class="keywordflow">case</span> PAF_TYPE_DOUBLE:</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                 snprintf(value, PAF_RECORD_MAX, <span class="stringliteral">"%.15G"</span>, *record->data.dval);</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                 <span class="keywordflow">if</span> (!strchr(value, <span class="charliteral">'.'</span>)) {</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                     <span class="keywordflow">if</span> (strchr(value, <span class="charliteral">'E'</span>))</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                         snprintf(value, PAF_RECORD_MAX, <span class="stringliteral">"%.1E"</span>,</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>                                  *record->data.dval);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>                     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                         strcat(value, <span class="stringliteral">"."</span>);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>                 }</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> </div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>             <span class="keywordflow">case</span> PAF_TYPE_STRING:</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>                 snprintf(value, PAF_RECORD_MAX, <span class="stringliteral">"\"%s\""</span>, record->data.sval);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> </div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>             <span class="keywordflow">case</span> PAF_TYPE_NONE:</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> </div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>                 <span class="comment">/* </span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> <span class="comment">                 * Should not reach this point. If type is PAF_TYPE_NONE</span></div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> <span class="comment">                 * the data pointer should always be NULL.</span></div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>                 </div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>         }</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> </div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         sz = strlen(value);</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span> </div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>         <span class="comment">/* </span></div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span> <span class="comment">         * Verify that writing the value string does not overflow the buffer.</span></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         </div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         <span class="keywordflow">if</span> (sz > PAF_RECORD_MAX - pos + 1)</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> </div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         strncpy(&buffer[pos], value, sz);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         pos += sz;</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     }</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     buffer[pos++] = <span class="charliteral">';'</span>;</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> </div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> <span class="comment">     * Comments are not printed if there is room in the buffer for at least 3</span></div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> <span class="comment">     * characters, so that not only the hash and/or the following blank</span></div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> <span class="comment">     * could be stored because of the finite record size.</span></div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> </div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     <span class="keywordflow">if</span> (record->comment && (PAF_RECORD_MAX - pos) >= 2) {</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>         <span class="keywordflow">if</span> (pos < PAF_FIELD_OFFSET_COMMENT)</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>             pos = PAF_FIELD_OFFSET_COMMENT;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>             pos++;</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> </div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         strncpy(&buffer[pos], <span class="stringliteral">"# "</span>, 2);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>         pos += 2;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>         sz = strlen(record->comment);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>         strncpy(&buffer[pos], record->comment, sz);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>         pos += sz;</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     }</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> </div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     buffer[pos] = <span class="charliteral">'\0'</span>;</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     </div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     <span class="keywordflow">return</span> buffer;</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span> }</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span> </div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> </div>
+<div class="line"><a name="l00511"></a><span class="lineno"><a class="code" href="group__forsPaf.html#ga5d62f23bc1a07c4136aecccfcea2459d">  511</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__forsPaf.html#ga5d62f23bc1a07c4136aecccfcea2459d" title="Destroy a PAF object.">deleteForsPAF</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span> {</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span> </div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     <span class="keywordflow">if</span> (paf) {</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>         <span class="keywordflow">for</span> (i = 0; i < paf->nh; i++)</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>             _forsPAFRecordDestroy(paf->header[i]);</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>         <span class="keywordflow">for</span> (i = 0; i < paf->nr; i++)</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>             _forsPAFRecordDestroy(paf->records[i]);</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>         cpl_free(paf->header);</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>         cpl_free(paf->records);</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>         cpl_free(paf->name);</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>         cpl_free(paf);</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>     }</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span> </div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span> </div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> }</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> </div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> </div>
+<div class="line"><a name="l00550"></a><span class="lineno"><a class="code" href="group__forsPaf.html#ga7aef24280b6605d6dfbb063bab8da2f4">  550</a></span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *<a class="code" href="group__forsPaf.html#ga7aef24280b6605d6dfbb063bab8da2f4" title="Create a new PAF object.">newForsPAF</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char [...]
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>                   <span class="keyword">const</span> <span class="keywordtype">char</span> *desc)</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> {</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span> </div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf;</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     <span class="keywordtype">int</span>     pos = 0;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     <span class="keywordflow">if</span> (!name || !type)</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> </div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     paf = (<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *)cpl_malloc(<span class="keyword">sizeof</span>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a>));</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     <span class="keywordflow">if</span> (paf) {</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>         paf->header = _forsPAFHeaderCreate(name, type, <span class="keywordtype">id</span>, desc, &pos);</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         <span class="keywordflow">if</span>(paf->header == NULL)</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>         {</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>             cpl_free(paf);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>         }</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>         paf->records = NULL;</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         paf->nh = pos;</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>         paf->nr = 0;</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>         paf->name = cpl_strdup(name);</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     }</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     <span class="keywordflow">return</span> paf;</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span> </div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> }</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> </div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00594"></a><span class="lineno"><a class="code" href="group__forsPaf.html#ga84dbb309c51aee01813cc9b90dde96cb">  594</a></span> <a class="code" href="group__forsPaf.html#ga84dbb309c51aee01813cc9b90dde96cb" title="Check whether a PAF object is empty.">forsPAFIsEmpty</a>(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> {</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span> </div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     assert(paf != NULL);</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span> </div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     <span class="keywordflow">return</span> paf->nr == 0 ? 1 : 0;</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span> </div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> }</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span> </div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> </div>
+<div class="line"><a name="l00618"></a><span class="lineno"><a class="code" href="group__forsPaf.html#ga38a21baf09dfb452f820eb2aded1a6c0">  618</a></span> <span class="keywordtype">size_t</span> <a class="code" href="group__forsPaf.html#ga38a21baf09dfb452f820eb2aded1a6c0" title="Get the actual size of the given PAF object.">forsPAFGetSize</a>(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span> {</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     assert(paf != NULL);</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span> </div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)paf->nr;</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span> </div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span> }</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span> </div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> <span class="keyword">inline</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00642"></a><span class="lineno"><a class="code" href="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37">  642</a></span> <a class="code" href="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37" title="Verify that the given string is a valid PAF keyword.">forsPAFIsValidName</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name)</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> {</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> </div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     <span class="keyword">register</span> <span class="keywordtype">size_t</span> i, sz;</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> </div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> </div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     assert(name != NULL);</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     <span class="keywordflow">if</span> (strchr(name, <span class="charliteral">' '</span>))</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> </div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     sz = strlen(name);</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     <span class="keywordflow">for</span> (i = 0; i <sz; i++) {</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         <span class="keywordtype">char</span> c = name[i];</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> <span class="comment">         * Names may be composed from uppercase letters, digits, the dot</span></div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span> <span class="comment">         * and the underscore only.</span></div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> </div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span> <span class="comment">         * Note: The characer class functions have to be enclosed in</span></div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> <span class="comment">         *   parantheses to use the actual function on HP-UX where these</span></div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span> <span class="comment">         *   functions are also provided as macros, which are taken by</span></div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span> <span class="comment">         *   default and may lead to compiler warnings.</span></div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span> </div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>         <span class="keywordflow">if</span> (!(isupper)(c) && !(isdigit)(c) && c != <span class="charliteral">'.'</span> && c != <span class="charliteral">'_'</span> && c != <span class="charliteral">'-'</span>)</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>             <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     }</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span> </div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span> }</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> </div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> </div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span> <span class="keyword">inline</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00695"></a><span class="lineno"><a class="code" href="group__forsPaf.html#gaac413514350c777efbd5ed0e1cc26778">  695</a></span> <a class="code" href="group__forsPaf.html#gaac413514350c777efbd5ed0e1cc26778" title="Append a boolean value to a PAF object.">forsPAFAppendBool</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">int</span> v [...]
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> {</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     assert(paf != NULL);</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     assert(name != NULL);</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>     </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37" title="Verify that the given string is a valid PAF keyword.">forsPAFIsValidName</a>(name) && name[0] != <span class="charliteral">'#'</span> && name [0] != <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>         <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span> </div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>     <span class="keywordflow">if</span> (_forsPAFAppend(&(paf->records), &(paf->nr), name, PAF_TYPE_BOOL, </div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>                       &value, comment))</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>         <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> </div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span> }</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span> </div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> </div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span> <span class="keyword">inline</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00729"></a><span class="lineno"><a class="code" href="group__forsPaf.html#gae15f3d1ee9b849039f26cd82d3568913">  729</a></span> <a class="code" href="group__forsPaf.html#gae15f3d1ee9b849039f26cd82d3568913" title="Append a integer value to a PAF object.">forsPAFAppendInt</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">int</span> va [...]
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span> {</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span> </div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     assert(paf != NULL);</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     assert(name != NULL);</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     </div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37" title="Verify that the given string is a valid PAF keyword.">forsPAFIsValidName</a>(name) && name[0] != <span class="charliteral">'#'</span> && name [0] != <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>         <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> </div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     <span class="keywordflow">if</span> (_forsPAFAppend(&(paf->records), &(paf->nr), name, PAF_TYPE_INT, </div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>                       &value, comment))</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>         <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> </div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>     <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span> </div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> }</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span> </div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span> </div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> <span class="keyword">inline</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00764"></a><span class="lineno"><a class="code" href="group__forsPaf.html#ga83aca84f4fb88e3db7a233b442cd644a">  764</a></span> <a class="code" href="group__forsPaf.html#ga83aca84f4fb88e3db7a233b442cd644a" title="Append a double value to a PAF object.">forsPAFAppendDouble</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">double</spa [...]
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span> {</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span> </div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>     assert(paf != NULL);</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     assert(name != NULL);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     </div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37" title="Verify that the given string is a valid PAF keyword.">forsPAFIsValidName</a>(name) && name[0] != <span class="charliteral">'#'</span> && name [0] != <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>         <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span> </div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>     <span class="keywordflow">if</span> (_forsPAFAppend(&(paf->records), &(paf->nr), name, PAF_TYPE_DOUBLE, </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>                       &value, comment))</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>         <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> </div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span> </div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> }</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> </div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> </div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span> <span class="keyword">inline</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00800"></a><span class="lineno"><a class="code" href="group__forsPaf.html#gad23a2cd11683bd001f954383a282b9c3">  800</a></span> <a class="code" href="group__forsPaf.html#gad23a2cd11683bd001f954383a282b9c3" title="Append a string value to a PAF object.">forsPAFAppendString</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <s [...]
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *comment)</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span> {</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span> </div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     assert(paf != NULL);</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     assert(name != NULL);</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     </div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37" title="Verify that the given string is a valid PAF keyword.">forsPAFIsValidName</a>(name) && name[0] != <span class="charliteral">'#'</span> && name [0] != <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>         <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span> </div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     <span class="keywordflow">if</span> (_forsPAFAppend(&(paf->records), &(paf->nr), name, PAF_TYPE_STRING, </div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>                       value, comment))</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>         <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span> </div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span> </div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span> }</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span> </div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span> </div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00834"></a><span class="lineno"><a class="code" href="group__forsPaf.html#ga3e16371f03930ae272a5454ad6100f83">  834</a></span> <a class="code" href="group__forsPaf.html#ga3e16371f03930ae272a5454ad6100f83" title="Write a PAF object to a disk file.">forsPAFWrite</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span> {</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span> </div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *record;</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>     FILE *stream;</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span> </div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span> </div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>     <span class="keywordflow">if</span> (!paf)</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>         <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span> </div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>     assert(paf->header != NULL);</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span> </div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span> </div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span> <span class="comment">     * Create output file</span></div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span> </div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>     stream = fopen(paf->name, <span class="stringliteral">"wb"</span>);</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>     <span class="keywordflow">if</span> (!stream)</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>         <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span> </div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span> </div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>     <span class="keywordflow">for</span> (i = 0; i < paf->nh; i++) {</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>         record = _forsPAFFormatRecord(paf->header[i]);</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>         <span class="keywordflow">if</span> (!record) {</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>             fclose(stream);</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>             <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>         }</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>             </div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>         fprintf(stream, <span class="stringliteral">"%s\n"</span>, record);</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     }</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span> </div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span> </div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>     <span class="keywordflow">if</span> (paf->nr) {</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>         <span class="keywordtype">char</span> buffer[PAF_RECORD_MAX];</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span> </div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>         buffer[0] = <span class="charliteral">'#'</span>;</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>         memset(&buffer[1], <span class="charliteral">'-'</span>, 78);</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>         buffer[79] = <span class="charliteral">'\0'</span>;</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>         fprintf(stream, <span class="stringliteral">"%s\n"</span>, buffer);</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>     }</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span> </div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>     <span class="keywordflow">for</span> (i = 0; i < paf->nr; i++) {</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>         record = _forsPAFFormatRecord(paf->records[i]);</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>         <span class="keywordflow">if</span> (!record) {</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>             fclose(stream);</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>             <span class="keywordflow">return</span> EXIT_FAILURE;</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>         }</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span> </div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>         fprintf(stream, <span class="stringliteral">"%s\n"</span>, record);</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>     }</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span> </div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>     fclose(stream);</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span> </div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>     <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>     </div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__paf_8h-source.html b/html/fors__paf_8h-source.html
deleted file mode 100644
index 341b8dc..0000000
--- a/html/fors__paf_8h-source.html
+++ /dev/null
@@ -1,188 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_paf.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_paf.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_paf.h,v 1.2 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027  
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_PAF_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_PAF_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <sys/types.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 CPL_BEGIN_DECLS
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="comment">/*</span>
-<a name="l00039"></a>00039 <span class="comment"> * Maximum length of a parameter file record, i.e. maximum number of</span>
-<a name="l00040"></a>00040 <span class="comment"> * characters per line of a parameter file on disk. This does not include</span>
-<a name="l00041"></a>00041 <span class="comment"> * a trailing 0.</span>
-<a name="l00042"></a>00042 <span class="comment"> */</span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="preprocessor">#define PAF_RECORD_MAX  (256)</span>
-<a name="l00045"></a>00045 <span class="preprocessor"></span>
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 <span class="comment">/*</span>
-<a name="l00048"></a>00048 <span class="comment"> * PAF value types</span>
-<a name="l00049"></a>00049 <span class="comment"> */</span>
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 <span class="keyword">enum</span> _FORS_PAF_TYPE_ {
-<a name="l00052"></a>00052     PAF_TYPE_NONE,
-<a name="l00053"></a>00053     PAF_TYPE_BOOL,
-<a name="l00054"></a>00054     PAF_TYPE_INT,
-<a name="l00055"></a>00055     PAF_TYPE_DOUBLE,
-<a name="l00056"></a>00056     PAF_TYPE_STRING
-<a name="l00057"></a>00057 };
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="keyword">typedef</span> <span class="keyword">enum</span> _FORS_PAF_TYPE_ ForsPAFType;
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 <span class="comment">/*</span>
-<a name="l00062"></a>00062 <span class="comment"> * PAF object</span>
-<a name="l00063"></a>00063 <span class="comment"> */</span>
-<a name="l00064"></a>00064 
-<a name="l00065"></a>00065 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__FORS__PAF__.html">_FORS_PAF_</a> ForsPAF;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067 <span class="comment">/*</span>
-<a name="l00068"></a>00068 <span class="comment"> * Create, copy and destroy operations</span>
-<a name="l00069"></a>00069 <span class="comment"> */</span>
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071 ForsPAF *<a class="code" href="group__forsPaf.html#gb2e886163098d674eb07e95d96b38229">newForsPAF</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
-<a name="l00072"></a>00072                           <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00073"></a>00073 <span class="keywordtype">void</span> <a class="code" href="group__forsPaf.html#gefe94695ad068025eff46fe69998e75d">deleteForsPAF</a>(ForsPAF *);
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="comment">/*</span>
-<a name="l00076"></a>00076 <span class="comment"> * Nonmodifying operations</span>
-<a name="l00077"></a>00077 <span class="comment"> */</span>
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079 <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#ge80d2196e3845f5857f374416333edbc">forsPAFIsEmpty</a>(<span class="keyword">const</span> ForsPAF *);
-<a name="l00080"></a>00080 size_t <a class="code" href="group__forsPaf.html#gb39490ffdb9ac9b2e666d75da2436b65">forsPAFGetSize</a>(<span class="keyword">const</span> ForsPAF *);
-<a name="l00081"></a>00081 <span class="keywordtype">int</span> forsPAFContains(<span class="keyword">const</span> ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00082"></a>00082 size_t forsPAFCount(<span class="keyword">const</span> ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084 <span class="comment">/*</span>
-<a name="l00085"></a>00085 <span class="comment"> * Header operations</span>
-<a name="l00086"></a>00086 <span class="comment"> */</span>
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 ForsPAFType forsPAFType(<span class="keyword">const</span> ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090 <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetName(<span class="keyword">const</span> ForsPAF *);
-<a name="l00091"></a>00091 <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetTag(<span class="keyword">const</span> ForsPAF *);
-<a name="l00092"></a>00092 <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetId(<span class="keyword">const</span> ForsPAF *);
-<a name="l00093"></a>00093 <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetDescription(<span class="keyword">const</span> ForsPAF *);
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095 <span class="keywordtype">int</span> forsPAFSetName(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00096"></a>00096 <span class="keywordtype">int</span> forsPAFSetTag(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00097"></a>00097 <span class="keywordtype">int</span> forsPAFSetId(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00098"></a>00098 <span class="keywordtype">int</span> forsPAFSetDescription(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100 <span class="keywordtype">int</span> forsPAFSetHeader(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
-<a name="l00101"></a>00101                     <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103 <span class="comment">/*</span>
-<a name="l00104"></a>00104 <span class="comment"> * Element access</span>
-<a name="l00105"></a>00105 <span class="comment"> */</span>
-<a name="l00106"></a>00106 
-<a name="l00107"></a>00107 <span class="keywordtype">int</span> forsPAFGetValueBool(<span class="keyword">const</span> ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00108"></a>00108 <span class="keywordtype">int</span> forsPAFGetValueInt(<span class="keyword">const</span> ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00109"></a>00109 <span class="keywordtype">double</span> forsPAFGetValueDouble(<span class="keyword">const</span> ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00110"></a>00110 <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetValueString(<span class="keyword">const</span> ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00111"></a>00111 <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetComment(<span class="keyword">const</span> ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113 <span class="keywordtype">int</span> forsPAFSetValueBool(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>);
-<a name="l00114"></a>00114 <span class="keywordtype">int</span> forsPAFSetValueInt(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>);
-<a name="l00115"></a>00115 <span class="keywordtype">int</span> forsPAFSetValueDouble(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>);
-<a name="l00116"></a>00116 <span class="keywordtype">int</span> forsPAFSetValueString(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00117"></a>00117 <span class="keywordtype">int</span> forsPAFSetComment(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00118"></a>00118 
-<a name="l00119"></a>00119 <span class="comment">/*</span>
-<a name="l00120"></a>00120 <span class="comment"> * Inserting and removing elements</span>
-<a name="l00121"></a>00121 <span class="comment"> */</span>
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123 <span class="keywordtype">int</span> forsPAFInsertBool(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00124"></a>00124 <span class="keywordtype">int</span> forsPAFInsertInt(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00125"></a>00125 <span class="keywordtype">int</span> forsPAFInsertDouble(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>,
-<a name="l00126"></a>00126                        <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00127"></a>00127 <span class="keywordtype">int</span> forsPAFInsertString(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
-<a name="l00128"></a>00128                        <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130 <span class="keywordtype">int</span> forsPAFInsertAfterBool(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>,
-<a name="l00131"></a>00131                           <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00132"></a>00132 <span class="keywordtype">int</span> forsPAFInsertAfterInt(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>,
-<a name="l00133"></a>00133                          <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00134"></a>00134 <span class="keywordtype">int</span> forsPAFInsertAfterDouble(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>,
-<a name="l00135"></a>00135                             <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00136"></a>00136 <span class="keywordtype">int</span> forsPAFInsertAfterString(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
-<a name="l00137"></a>00137                             <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139 <span class="keywordtype">int</span> forsPAFPrependBool(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00140"></a>00140 <span class="keywordtype">int</span> forsPAFPrependInt(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00141"></a>00141 <span class="keywordtype">int</span> forsPAFPrependDouble(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00142"></a>00142 <span class="keywordtype">int</span> forsPAFPrependString(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00143"></a>00143 
-<a name="l00144"></a>00144 <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#g15b886f9811c703203b77a91e3bd0e91">forsPAFAppendBool</a>(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00145"></a>00145 <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#gde7f65f7ca0d7e3e24babefd2c8d8716">forsPAFAppendInt</a>(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00146"></a>00146 <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#gdd6ed0c50b7cf4c62fdbabd0794487e4">forsPAFAppendDouble</a>(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00147"></a>00147 <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#gf615f1fbc45dd108391de129e67d58b2">forsPAFAppendString</a>(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 <span class="keywordtype">void</span> forsPAFErase(ForsPAF *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00150"></a>00150 <span class="keywordtype">void</span> forsPAFClear(ForsPAF *);
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152 <span class="comment">/*</span>
-<a name="l00153"></a>00153 <span class="comment"> * Read and write operations</span>
-<a name="l00154"></a>00154 <span class="comment"> */</span>
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156 <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#g2cceff721bbbd99c1a4bddfb57ed688b">forsPAFWrite</a>(ForsPAF *);
-<a name="l00157"></a>00157 
-<a name="l00158"></a>00158 <span class="comment">/*</span>
-<a name="l00159"></a>00159 <span class="comment"> * Miscellaneous utilities</span>
-<a name="l00160"></a>00160 <span class="comment"> */</span>
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162 <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917">forsPAFIsValidName</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164 CPL_END_DECLS
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166 <span class="preprocessor">#endif </span><span class="comment">/* FORS_PAF_H */</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__paf_8h_source.html b/html/fors__paf_8h_source.html
new file mode 100644
index 0000000..6b3b041
--- /dev/null
+++ b/html/fors__paf_8h_source.html
@@ -0,0 +1,227 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_paf.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_paf.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_paf.h,v 1.2 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.2 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span>  </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_PAF_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_PAF_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <sys/types.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="comment"> * Maximum length of a parameter file record, i.e. maximum number of</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="comment"> * characters per line of a parameter file on disk. This does not include</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="comment"> * a trailing 0.</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#define PAF_RECORD_MAX  (256)</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="comment"> * PAF value types</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keyword">enum</span> _FORS_PAF_TYPE_ {</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>     PAF_TYPE_NONE,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>     PAF_TYPE_BOOL,</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>     PAF_TYPE_INT,</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>     PAF_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>     PAF_TYPE_STRING</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> };</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">typedef</span> <span class="keyword">enum</span> _FORS_PAF_TYPE_ ForsPAFType;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="comment"> * PAF object</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__FORS__PAF__.html">_FORS_PAF_</a> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a>;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="comment"> * Create, copy and destroy operations</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *<a class="code" href="group__forsPaf.html#ga7aef24280b6605d6dfbb063bab8da2f4" title="Create a new PAF object.">newForsPAF</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                           <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="keywordtype">void</span> <a class="code" href="group__forsPaf.html#ga5d62f23bc1a07c4136aecccfcea2459d" title="Destroy a PAF object.">deleteForsPAF</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="comment"> * Nonmodifying operations</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#ga84dbb309c51aee01813cc9b90dde96cb" title="Check whether a PAF object is empty.">forsPAFIsEmpty</a>(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="keywordtype">size_t</span> <a class="code" href="group__forsPaf.html#ga38a21baf09dfb452f820eb2aded1a6c0" title="Get the actual size of the given PAF object.">forsPAFGetSize</a>(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *);</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keywordtype">int</span> forsPAFContains(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="keywordtype">size_t</span> forsPAFCount(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="comment"> * Header operations</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> ForsPAFType forsPAFType(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetName(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetTag(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetId(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *);</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetDescription(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keywordtype">int</span> forsPAFSetName(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="keywordtype">int</span> forsPAFSetTag(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="keywordtype">int</span> forsPAFSetId(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="keywordtype">int</span> forsPAFSetDescription(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="keywordtype">int</span> forsPAFSetHeader(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="comment"> * Element access</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="keywordtype">int</span> forsPAFGetValueBool(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="keywordtype">int</span> forsPAFGetValueInt(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="keywordtype">double</span> forsPAFGetValueDouble(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetValueString(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *forsPAFGetComment(<span class="keyword">const</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="keywordtype">int</span> forsPAFSetValueBool(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="keywordtype">int</span> forsPAFSetValueInt(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="keywordtype">int</span> forsPAFSetValueDouble(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="keywordtype">int</span> forsPAFSetValueString(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="keywordtype">int</span> forsPAFSetComment(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="comment"> * Inserting and removing elements</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="keywordtype">int</span> forsPAFInsertBool(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="keywordtype">int</span> forsPAFInsertInt(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="keywordtype">int</span> forsPAFInsertDouble(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                        <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="keywordtype">int</span> forsPAFInsertString(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                        <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="keywordtype">int</span> forsPAFInsertAfterBool(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                           <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="keywordtype">int</span> forsPAFInsertAfterInt(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                          <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="keywordtype">int</span> forsPAFInsertAfterDouble(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>,</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                             <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="keywordtype">int</span> forsPAFInsertAfterString(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                             <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="keywordtype">int</span> forsPAFPrependBool(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="keywordtype">int</span> forsPAFPrependInt(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="keywordtype">int</span> forsPAFPrependDouble(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="keywordtype">int</span> forsPAFPrependString(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#gaac413514350c777efbd5ed0e1cc26778" title="Append a boolean value to a PAF object.">forsPAFAppendBool</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keyw [...]
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#gae15f3d1ee9b849039f26cd82d3568913" title="Append a integer value to a PAF object.">forsPAFAppendInt</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywo [...]
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#ga83aca84f4fb88e3db7a233b442cd644a" title="Append a double value to a PAF object.">forsPAFAppendDouble</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>, <span class="keyword">const</span> <span class=" [...]
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#gad23a2cd11683bd001f954383a282b9c3" title="Append a string value to a PAF object.">forsPAFAppendString</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class=" [...]
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="keywordtype">void</span> forsPAFErase(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="keywordtype">void</span> forsPAFClear(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="comment"> * Read and write operations</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#ga3e16371f03930ae272a5454ad6100f83" title="Write a PAF object to a disk file.">forsPAFWrite</a>(<a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> </div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="comment"> * Miscellaneous utilities</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="keywordtype">int</span> <a class="code" href="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37" title="Verify that the given string is a valid PAF keyword.">forsPAFIsValidName</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor">#endif </span><span class="comment">/* FORS_PAF_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__pattern-test_8c-source.html b/html/fors__pattern-test_8c-source.html
deleted file mode 100644
index 7529304..0000000
--- a/html/fors__pattern-test_8c-source.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_pattern-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_pattern-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_pattern-test.c,v 1.2 2007/09/07 11:29:49 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/09/07 11:29:49 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_pattern.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_point.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <test.h></span>
-<a name="l00035"></a>00035 
-<a name="l00045"></a>00045 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00046"></a><a class="code" href="group__fors__pattern__test.html#g25ce248a1e86361188a657bac8f9ff32">00046</a> <a class="code" href="group__fors__pattern__test.html#g25ce248a1e86361188a657bac8f9ff32">test_pattern</a>(<span class="keywordtype">void</span>)
-<a name="l00047"></a>00047 {
-<a name="l00048"></a>00048     fors_point *p1 = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(1, 2);
-<a name="l00049"></a>00049     fors_point *p2 = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(2, 2);
-<a name="l00050"></a>00050     fors_point *p3 = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(3, 4);
-<a name="l00051"></a>00051     fors_point *p4 = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(0.1, 0.2);
-<a name="l00052"></a>00052     fors_point *p5 = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(0.2, 0.2);
-<a name="l00053"></a>00053     fors_point *p6 = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(0.3, 0.4);
-<a name="l00054"></a>00054     <span class="keywordtype">double</span> sigma = 0.001;
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056     <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *pat1 = fors_pattern_new(p1, p2, p3, sigma);
-<a name="l00057"></a>00057     <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *pat2 = fors_pattern_new(p4, p5, p6, sigma);
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059     test_abs( fors_pattern_get_scale(pat1, pat2),     10, 0.01 );
-<a name="l00060"></a>00060     test_abs( fors_pattern_get_scale(pat2, pat1), 1.0/10, 0.01 );
-<a name="l00061"></a>00061     test_abs( fors_pattern_get_angle(pat1, pat2), 0, 0.01 );
-<a name="l00062"></a>00062     test_abs( fors_pattern_get_angle(pat2, pat1), 0, 0.01 );
-<a name="l00063"></a>00063     
-<a name="l00064"></a>00064     test_abs( fors_pattern_distsq(pat1, pat2), 0, 0.001 );
-<a name="l00065"></a>00065     test_abs( fors_pattern_distsq(pat2, pat1), 0, 0.001 );
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&p1);
-<a name="l00068"></a>00068     <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&p2);
-<a name="l00069"></a>00069     <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&p3);
-<a name="l00070"></a>00070     <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&p4);
-<a name="l00071"></a>00071     <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&p5);
-<a name="l00072"></a>00072     <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&p6);
-<a name="l00073"></a>00073     fors_pattern_delete(&pat1);
-<a name="l00074"></a>00074     fors_pattern_delete(&pat2);
-<a name="l00075"></a>00075 
-<a name="l00076"></a>00076     <span class="keywordflow">return</span>;
-<a name="l00077"></a>00077 }
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079 
-<a name="l00083"></a><a class="code" href="group__fors__pattern__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00083</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00084"></a>00084 {
-<a name="l00085"></a>00085     TEST_INIT;
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087     <a class="code" href="group__fors__pattern__test.html#g25ce248a1e86361188a657bac8f9ff32">test_pattern</a>();
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089     TEST_END;
-<a name="l00090"></a>00090 }
-<a name="l00091"></a>00091 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__pattern-test_8c_source.html b/html/fors__pattern-test_8c_source.html
new file mode 100644
index 0000000..6cbbb30
--- /dev/null
+++ b/html/fors__pattern-test_8c_source.html
@@ -0,0 +1,140 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_pattern-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_pattern-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_pattern-test.c,v 1.2 2007-09-07 11:29:49 jmlarsen Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: jmlarsen $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007-09-07 11:29:49 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.2 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_pattern.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_point.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="group__fors__pattern__test.html#ga05781d2ba3b01b5ddbc4dd9dfe0eda77">   46</a></span> <a class="code" href="group__fors__pattern__test.html#ga05781d2ba3b01b5ddbc4dd9dfe0eda77" title="test">test_pattern</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> {</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>     fors_point *p1 = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(1, 2);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>     fors_point *p2 = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(2, 2);</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>     fors_point *p3 = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(3, 4);</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>     fors_point *p4 = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(0.1, 0.2);</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>     fors_point *p5 = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(0.2, 0.2);</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>     fors_point *p6 = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(0.3, 0.4);</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>     <span class="keywordtype">double</span> sigma = 0.001;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>     <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *pat1 = fors_pattern_new(p1, p2, p3, sigma);</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>     <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *pat2 = fors_pattern_new(p4, p5, p6, sigma);</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     test_abs( fors_pattern_get_scale(pat1, pat2),     10, 0.01 );</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     test_abs( fors_pattern_get_scale(pat2, pat1), 1.0/10, 0.01 );</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     test_abs( fors_pattern_get_angle(pat1, pat2), 0, 0.01 );</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>     test_abs( fors_pattern_get_angle(pat2, pat1), 0, 0.01 );</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     test_abs( fors_pattern_distsq(pat1, pat2), 0, 0.001 );</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     test_abs( fors_pattern_distsq(pat2, pat1), 0, 0.001 );</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&p1);</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&p2);</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&p3);</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&p4);</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&p5);</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&p6);</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     fors_pattern_delete(&pat1);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     fors_pattern_delete(&pat2);</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> }</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="group__fors__pattern__test.html#ga840291bc02cba5474a4cb46a9b9566fe">   83</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> {</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     TEST_INIT;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     <a class="code" href="group__fors__pattern__test.html#ga05781d2ba3b01b5ddbc4dd9dfe0eda77" title="test">test_pattern</a>();</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     TEST_END;</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> }</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__pattern_8c-source.html b/html/fors__pattern_8c-source.html
deleted file mode 100644
index 19e766b..0000000
--- a/html/fors__pattern_8c-source.html
+++ /dev/null
@@ -1,321 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_pattern.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_pattern.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_pattern.c,v 1.4 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_pattern.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_double.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <math.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a><a class="code" href="struct__fors__pattern.html">00041</a> <span class="keyword">struct </span><a class="code" href="struct__fors__pattern.html">_fors_pattern</a> 
-<a name="l00042"></a>00042 {
-<a name="l00043"></a><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">00043</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a>;  <span class="comment">/* (rmin/Rmax)^2 */</span>
-<a name="l00044"></a><a class="code" href="struct__fors__pattern.html#b30a8282c5be5dcb81396a14232c6d97">00044</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__pattern.html#b30a8282c5be5dcb81396a14232c6d97">dratsq</a>; <span class="comment">/* error */</span>
-<a name="l00045"></a>00045 
-<a name="l00046"></a><a class="code" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">00046</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">theta</a>;  <span class="comment">/* angle min - angle max  in [0; 2pi[ */</span>
-<a name="l00047"></a><a class="code" href="struct__fors__pattern.html#41f94fda5bd41b1e72ef9c679ac73c2b">00047</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__pattern.html#41f94fda5bd41b1e72ef9c679ac73c2b">dtheta</a>; <span class="comment">/* error */</span>
-<a name="l00048"></a><a class="code" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">00048</a>     <span class="keyword">const</span> fors_point *<a class="code" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">ref</a>, *<a class="code" href="struct__fors__pattern.html#5a91baccbe20c7f8b25bddaa043a1773">min</a>, *<a class="code" href="struct__fors__pattern.html#bec8b3d42dee603bd4c07eed85d87665">max</a>; 
-<a name="l00049"></a>00049     <span class="comment">/* Reference, nearest, farest points used to build this pattern */</span>
-<a name="l00050"></a>00050 };
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="preprocessor">#undef cleanup</span>
-<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00054"></a>00054 <span class="preprocessor"></span>
-<a name="l00069"></a>00069 <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *fors_pattern_new(<span class="keyword">const</span> fors_point *ref,
-<a name="l00070"></a>00070                                <span class="keyword">const</span> fors_point *p1,
-<a name="l00071"></a>00071                                <span class="keyword">const</span> fors_point *p2,
-<a name="l00072"></a>00072                                <span class="keywordtype">double</span> sigma)
-<a name="l00073"></a>00073 {
-<a name="l00074"></a>00074     <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p = cpl_malloc(<span class="keyword">sizeof</span>(*p));
-<a name="l00075"></a>00075 
-<a name="l00076"></a>00076     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( ref != NULL, <span class="keywordflow">return</span> p, NULL );
-<a name="l00077"></a>00077     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(  p1 != NULL, <span class="keywordflow">return</span> p, NULL );
-<a name="l00078"></a>00078     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(  p2 != NULL, <span class="keywordflow">return</span> p, NULL );
-<a name="l00079"></a>00079     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(  sigma >= 0, <span class="keywordflow">return</span> p, NULL );
-<a name="l00080"></a>00080 
-<a name="l00081"></a>00081     p->ref = ref;
-<a name="l00082"></a>00082     {
-<a name="l00083"></a>00083         <span class="keywordtype">double</span> r1 = <a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(ref, p1);
-<a name="l00084"></a>00084         <span class="keywordtype">double</span> r2 = <a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(ref, p2);
-<a name="l00085"></a>00085         <span class="keywordtype">double</span> dr1 = sqrt(8*sigma*sigma*r1);
-<a name="l00086"></a>00086         <span class="keywordtype">double</span> dr2 = sqrt(8*sigma*sigma*r2);
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088         <span class="keywordtype">double</span> dt1, dt2;
-<a name="l00089"></a>00089         <span class="keywordtype">double</span> t1 = double_atan2(ref->y - p1->y, sqrt(2)*sigma,
-<a name="l00090"></a>00090                                  ref->x - p1->x, sqrt(2)*sigma,
-<a name="l00091"></a>00091                                  &dt1);
-<a name="l00092"></a>00092         
-<a name="l00093"></a>00093         <span class="keywordtype">double</span> t2 = double_atan2(ref->y - p2->y, sqrt(2)*sigma,
-<a name="l00094"></a>00094                                  ref->x - p2->x, sqrt(2)*sigma,
-<a name="l00095"></a>00095                                  &dt2);
-<a name="l00096"></a>00096         
-<a name="l00097"></a>00097         <span class="keywordflow">if</span> (r1 < r2) {
-<a name="l00098"></a>00098             p->ratsq = double_divide(r1, dr1,
-<a name="l00099"></a>00099                                      r2, dr2,
-<a name="l00100"></a>00100                                      &p->dratsq);
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102             p->theta = double_subtract(t1, dt1,
-<a name="l00103"></a>00103                                        t2, dt2,
-<a name="l00104"></a>00104                                        &p->dtheta);
-<a name="l00105"></a>00105             p->min   = p1;
-<a name="l00106"></a>00106             p->max   = p2;
-<a name="l00107"></a>00107         }
-<a name="l00108"></a>00108         <span class="keywordflow">else</span> {
-<a name="l00109"></a>00109             p->ratsq = double_divide(r2, dr2,
-<a name="l00110"></a>00110                                      r1, dr1,
-<a name="l00111"></a>00111                                      &p->dratsq);
-<a name="l00112"></a>00112             p->theta = double_subtract(t2, dt2,
-<a name="l00113"></a>00113                                        t1, dt1,
-<a name="l00114"></a>00114                                        &p->dtheta);
-<a name="l00115"></a>00115             p->min   = p2;
-<a name="l00116"></a>00116             p->max   = p1;
-<a name="l00117"></a>00117         }
-<a name="l00118"></a>00118         
-<a name="l00119"></a>00119         <span class="keywordflow">while</span> (p->theta <  0     ) p->theta += 2*M_PI; <span class="comment">/* Error does not change */</span>
-<a name="l00120"></a>00120         <span class="keywordflow">while</span> (p->theta >= 2*M_PI) p->theta -= 2*M_PI;
-<a name="l00121"></a>00121     }
-<a name="l00122"></a>00122     
-<a name="l00123"></a>00123     <span class="keywordflow">return</span> p;
-<a name="l00124"></a>00124 }
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126 <span class="preprocessor">#undef cleanup</span>
-<a name="l00127"></a>00127 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00128"></a>00128 <span class="preprocessor"></span>
-<a name="l00137"></a>00137 fors_pattern_list *
-<a name="l00138"></a>00138 fors_pattern_new_from_points(fors_point_list *points,
-<a name="l00139"></a>00139                              <span class="keywordtype">double</span> tolerance,
-<a name="l00140"></a>00140                              <span class="keywordtype">double</span> sigma)
-<a name="l00141"></a>00141 {
-<a name="l00142"></a>00142     fors_pattern_list *patterns = fors_pattern_list_new();
-<a name="l00143"></a>00143     <span class="keywordtype">double</span> tol_sq = tolerance * tolerance;
-<a name="l00144"></a>00144     fors_point *ref, *p1, *p2;
-<a name="l00145"></a>00145 
-<a name="l00146"></a>00146     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( points != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     <span class="keywordflow">for</span> (ref = fors_point_list_first(points);
-<a name="l00149"></a>00149          ref != NULL;
-<a name="l00150"></a>00150          ref = fors_point_list_next(points)) {
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152         <span class="keywordflow">for</span> (fors_point_list_first_pair(points, &p1, &p2);
-<a name="l00153"></a>00153              p1 != NULL;
-<a name="l00154"></a>00154              fors_point_list_next_pair(points, &p1, &p2)) {
-<a name="l00155"></a>00155                 
-<a name="l00156"></a>00156             <span class="keywordflow">if</span> (<a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(ref, p1) > tol_sq &&
-<a name="l00157"></a>00157                 <a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(ref, p2) > tol_sq &&
-<a name="l00158"></a>00158                 <a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(p1 , p2) > tol_sq) {
-<a name="l00159"></a>00159                 
-<a name="l00160"></a>00160                 fors_pattern_list_insert(patterns,
-<a name="l00161"></a>00161                                          fors_pattern_new(
-<a name="l00162"></a>00162                                              ref, p1, p2, sigma));
-<a name="l00163"></a>00163             }
-<a name="l00164"></a>00164         }
-<a name="l00165"></a>00165     }
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     cpl_msg_debug(cpl_func,
-<a name="l00168"></a>00168                   <span class="stringliteral">"Created %d pattern(s)"</span>, fors_pattern_list_size(patterns));
-<a name="l00169"></a>00169     
-<a name="l00170"></a>00170     <span class="keywordflow">return</span> patterns;
-<a name="l00171"></a>00171 }
-<a name="l00172"></a>00172 
-<a name="l00173"></a>00173 <span class="preprocessor">#undef cleanup</span>
-<a name="l00174"></a>00174 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00175"></a>00175 <span class="preprocessor"></span>
-<a name="l00180"></a>00180 <span class="preprocessor">#if 0  </span><span class="comment">/* check before enabling! */</span>
-<a name="l00181"></a>00181 <span class="keyword">static</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *
-<a name="l00182"></a>00182 fors_pattern_duplicate(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p)
-<a name="l00183"></a>00183 {
-<a name="l00184"></a>00184     <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *d = NULL;
-<a name="l00185"></a>00185 
-<a name="l00186"></a>00186     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( p != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00187"></a>00187     
-<a name="l00188"></a>00188     d = cpl_malloc(<span class="keyword">sizeof</span>(*d));
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     d-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a> = p-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a>;
-<a name="l00191"></a>00191     d-><a class="code" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">theta</a> = p-><a class="code" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">theta</a>;
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <span class="keywordflow">return</span> d;
-<a name="l00194"></a>00194 }
-<a name="l00195"></a>00195 <span class="preprocessor">#endif</span>
-<a name="l00196"></a>00196 <span class="preprocessor"></span>
-<a name="l00201"></a>00201 <span class="keywordtype">void</span> fors_pattern_delete(<a class="code" href="struct__fors__pattern.html">fors_pattern</a> **p)
-<a name="l00202"></a>00202 {
-<a name="l00203"></a>00203     <span class="keywordflow">if</span> (p && *p) {
-<a name="l00204"></a>00204         cpl_free(*p); *p = NULL;
-<a name="l00205"></a>00205     }
-<a name="l00206"></a>00206     <span class="keywordflow">return</span>;
-<a name="l00207"></a>00207 }
-<a name="l00208"></a>00208 
-<a name="l00214"></a>00214 <span class="keyword">const</span> fors_point *
-<a name="l00215"></a>00215 fors_pattern_get_ref(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p)
-<a name="l00216"></a>00216 {
-<a name="l00217"></a>00217     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( p != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00218"></a>00218 
-<a name="l00219"></a>00219     <span class="keywordflow">return</span> p-><a class="code" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">ref</a>;
-<a name="l00220"></a>00220 }
-<a name="l00221"></a>00221 
-<a name="l00230"></a>00230 <span class="keywordtype">void</span> fors_pattern_error(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,
-<a name="l00231"></a>00231             <span class="keywordtype">double</span> *dr2,
-<a name="l00232"></a>00232             <span class="keywordtype">double</span> *dtheta)
-<a name="l00233"></a>00233 {
-<a name="l00234"></a>00234     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( p      != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00235"></a>00235     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dr2    != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00236"></a>00236     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dtheta != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00237"></a>00237 
-<a name="l00238"></a>00238     *dr2    = p-><a class="code" href="struct__fors__pattern.html#b30a8282c5be5dcb81396a14232c6d97">dratsq</a>;
-<a name="l00239"></a>00239     *dtheta = p-><a class="code" href="struct__fors__pattern.html#41f94fda5bd41b1e72ef9c679ac73c2b">dtheta</a> / (2*M_PI);
-<a name="l00240"></a>00240 
-<a name="l00241"></a>00241     <span class="keywordflow">return</span>;
-<a name="l00242"></a>00242 }
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244 
-<a name="l00253"></a>00253 <span class="keywordtype">double</span> fors_pattern_distsq(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,
-<a name="l00254"></a>00254                            <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q)
-<a name="l00255"></a>00255 {
-<a name="l00256"></a>00256     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( p != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00257"></a>00257     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( q != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00258"></a>00258     
-<a name="l00259"></a>00259     <span class="keywordtype">double</span> dtheta = <a class="code" href="group__fors__utils.html#g71645af45bc192964d3170f28c671240">fors_angle_diff</a>(&p-><a class="code" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">theta</a>, &q-><a class="code" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">theta</a>); <span class="comment">/* in [0;pi] */</span>
-<a name="l00260"></a>00260     
-<a name="l00261"></a>00261     <span class="comment">/* Return distance in normalized parameter space [0;1[ x [0;1[.</span>
-<a name="l00262"></a>00262 <span class="comment">       This is to give equal weight to differences in radii</span>
-<a name="l00263"></a>00263 <span class="comment">       and differences in theta.</span>
-<a name="l00264"></a>00264 <span class="comment">    */</span>
-<a name="l00265"></a>00265     <span class="keywordflow">return</span> 
-<a name="l00266"></a>00266         (p-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a> - q-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a>) * (p-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a> - q-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a>) / (1.0 * 1.0) +
-<a name="l00267"></a>00267         (dtheta * dtheta) / (M_PI*M_PI);
-<a name="l00268"></a>00268 }
-<a name="l00269"></a>00269 
-<a name="l00276"></a>00276 <span class="keywordtype">double</span> fors_pattern_dist_per_error(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,
-<a name="l00277"></a>00277                                    <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q)
-<a name="l00278"></a>00278 {
-<a name="l00279"></a>00279     <span class="keywordtype">double</span> dtheta = <a class="code" href="group__fors__utils.html#g71645af45bc192964d3170f28c671240">fors_angle_diff</a>(&p-><a class="code" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">theta</a>, &q-><a class="code" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">theta</a>);
-<a name="l00280"></a>00280     
-<a name="l00281"></a>00281     <span class="keywordtype">double</span> p_error_r;
-<a name="l00282"></a>00282     <span class="keywordtype">double</span> p_error_t;
-<a name="l00283"></a>00283     
-<a name="l00284"></a>00284     fors_pattern_error(p, 
-<a name="l00285"></a>00285                        &p_error_r,
-<a name="l00286"></a>00286                        &p_error_t);
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     <span class="keywordtype">double</span> q_error_r;
-<a name="l00289"></a>00289     <span class="keywordtype">double</span> q_error_t;
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291     fors_pattern_error(q, 
-<a name="l00292"></a>00292                        &q_error_r,
-<a name="l00293"></a>00293                        &q_error_t);
-<a name="l00294"></a>00294  
-<a name="l00295"></a>00295     <span class="comment">/* variance of difference */</span>
-<a name="l00296"></a>00296     <span class="keywordtype">double</span> rr = p_error_r*p_error_r + q_error_r*q_error_r;
-<a name="l00297"></a>00297     <span class="keywordtype">double</span> tt = p_error_t*p_error_t + q_error_t*q_error_t;
-<a name="l00298"></a>00298 
-<a name="l00299"></a>00299     <span class="keywordflow">return</span> sqrt(
-<a name="l00300"></a>00300         (p-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a> - q-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a>) * (p-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a> - q-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a>) / ((1.0*1.0) * rr) + 
-<a name="l00301"></a>00301         (dtheta * dtheta) / ((M_PI*M_PI) * tt)
-<a name="l00302"></a>00302         );
-<a name="l00303"></a>00303 }
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306 
-<a name="l00307"></a>00307 
-<a name="l00312"></a>00312 <span class="keywordtype">void</span> fors_pattern_print(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p)
-<a name="l00313"></a>00313 {
-<a name="l00314"></a>00314     <span class="keywordflow">if</span> (p == NULL) {
-<a name="l00315"></a>00315         cpl_msg_info(cpl_func, <span class="stringliteral">"NULL pattern"</span>);
-<a name="l00316"></a>00316     }
-<a name="l00317"></a>00317     <span class="keywordflow">else</span> {
-<a name="l00318"></a>00318         cpl_msg_info(cpl_func, <span class="stringliteral">"Rmin^2/Rmax^2 = %f ; theta = %f"</span>,
-<a name="l00319"></a>00319                      p-><a class="code" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a>, p-><a class="code" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">theta</a>);
-<a name="l00320"></a>00320     }
-<a name="l00321"></a>00321     <span class="keywordflow">return</span>;
-<a name="l00322"></a>00322 }
-<a name="l00323"></a>00323 
-<a name="l00331"></a>00331 <span class="keywordtype">double</span> fors_pattern_get_scale(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,
-<a name="l00332"></a>00332                               <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q)
-<a name="l00333"></a>00333 {
-<a name="l00334"></a>00334     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( p != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00335"></a>00335     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( q != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00336"></a>00336     
-<a name="l00337"></a>00337     <span class="keywordtype">double</span> s1 = sqrt(<a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(p-><a class="code" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">ref</a>, p-><a class="code" href="struct__fors__pattern.html#bec8b3d42dee603bd4c07eed85d87665">max</a>));
-<a name="l00338"></a>00338     <span class="keywordtype">double</span> s2 = sqrt(<a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(q-><a class="code" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">ref</a>, q-><a class="code" href="struct__fors__pattern.html#bec8b3d42dee603bd4c07eed85d87665">max</a>));
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340     <span class="keywordflow">return</span> (s2 == 0) ? 0 : s1/s2;
-<a name="l00341"></a>00341 }
-<a name="l00342"></a>00342 
-<a name="l00350"></a>00350 <span class="keywordtype">double</span> fors_pattern_get_angle(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,
-<a name="l00351"></a>00351                               <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q)
-<a name="l00352"></a>00352 {
-<a name="l00353"></a>00353     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( p != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00354"></a>00354     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( q != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00355"></a>00355     
-<a name="l00356"></a>00356     <span class="keywordtype">double</span> t1 = atan2(p-><a class="code" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">ref</a>->y - p-><a class="code" href="struct__fors__pattern.html#bec8b3d42dee603bd4c07eed85d87665">max</a>->y,
-<a name="l00357"></a>00357                p-><a class="code" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">ref</a>->x - p-><a class="code" href="struct__fors__pattern.html#bec8b3d42dee603bd4c07eed85d87665">max</a>->x);
-<a name="l00358"></a>00358     <span class="keywordtype">double</span> t2 = atan2(q-><a class="code" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">ref</a>->y - q-><a class="code" href="struct__fors__pattern.html#bec8b3d42dee603bd4c07eed85d87665">max</a>->y,
-<a name="l00359"></a>00359                q-><a class="code" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">ref</a>->x - q-><a class="code" href="struct__fors__pattern.html#bec8b3d42dee603bd4c07eed85d87665">max</a>->x);
-<a name="l00360"></a>00360 
-<a name="l00361"></a>00361     <span class="keywordtype">double</span> t = t1 - t2;
-<a name="l00362"></a>00362 
-<a name="l00363"></a>00363     <span class="keywordflow">while</span> (t >= 2*M_PI) t -= 2*M_PI;
-<a name="l00364"></a>00364     <span class="keywordflow">while</span> (t  < 0     ) t += 2*M_PI;
-<a name="l00365"></a>00365     
-<a name="l00366"></a>00366     <span class="keywordflow">return</span> t;
-<a name="l00367"></a>00367 }
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369 
-<a name="l00370"></a>00370 <span class="preprocessor">#define LIST_DEFINE</span>
-<a name="l00371"></a>00371 <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00372"></a>00372 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_pattern</span>
-<a name="l00373"></a>00373 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00374"></a>00374 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__pattern_8c_source.html b/html/fors__pattern_8c_source.html
new file mode 100644
index 0000000..22db631
--- /dev/null
+++ b/html/fors__pattern_8c_source.html
@@ -0,0 +1,360 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_pattern.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_pattern.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_pattern.c,v 1.4 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.4 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_pattern.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_double.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="struct__fors__pattern.html">   41</a></span> <span class="keyword">struct </span><a class="code" href="struct__fors__pattern.html">_fors_pattern</a> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> {</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>     <span class="keywordtype">double</span> ratsq;  <span class="comment">/* (rmin/Rmax)^2 */</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>     <span class="keywordtype">double</span> dratsq; <span class="comment">/* error */</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>     <span class="keywordtype">double</span> theta;  <span class="comment">/* angle min - angle max  in [0; 2pi[ */</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     <span class="keywordtype">double</span> dtheta; <span class="comment">/* error */</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>     <span class="keyword">const</span> fors_point *ref, *min, *max; </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>     <span class="comment">/* Reference, nearest, farest points used to build this pattern */</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> };</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *fors_pattern_new(<span class="keyword">const</span> fors_point *ref,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                                <span class="keyword">const</span> fors_point *p1,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                                <span class="keyword">const</span> fors_point *p2,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                                <span class="keywordtype">double</span> sigma)</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> {</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p = cpl_malloc(<span class="keyword">sizeof</span>(*p));</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( ref != NULL, <span class="keywordflow">return</span> p, NULL );</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(  p1 != NULL, <span class="keywordflow">return</span> p, NULL );</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(  p2 != NULL, <span class="keywordflow">return</span> p, NULL );</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(  sigma >= 0, <span class="keywordflow">return</span> p, NULL );</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     p->ref = ref;</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     {</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>         <span class="keywordtype">double</span> r1 = <a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(ref, p1);</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>         <span class="keywordtype">double</span> r2 = <a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(ref, p2);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>         <span class="keywordtype">double</span> dr1 = sqrt(8*sigma*sigma*r1);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>         <span class="keywordtype">double</span> dr2 = sqrt(8*sigma*sigma*r2);</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>         <span class="keywordtype">double</span> dt1, dt2;</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>         <span class="keywordtype">double</span> t1 = double_atan2(ref->y - p1->y, sqrt(2)*sigma,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                                  ref->x - p1->x, sqrt(2)*sigma,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                                  &dt1);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>         </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>         <span class="keywordtype">double</span> t2 = double_atan2(ref->y - p2->y, sqrt(2)*sigma,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                                  ref->x - p2->x, sqrt(2)*sigma,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                                  &dt2);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>         </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>         <span class="keywordflow">if</span> (r1 < r2) {</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>             p->ratsq = double_divide(r1, dr1,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>                                      r2, dr2,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                                      &p->dratsq);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>             p->theta = double_subtract(t1, dt1,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                                        t2, dt2,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                                        &p->dtheta);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>             p->min   = p1;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>             p->max   = p2;</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>         }</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>             p->ratsq = double_divide(r2, dr2,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                                      r1, dr1,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                                      &p->dratsq);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>             p->theta = double_subtract(t2, dt2,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                                        t1, dt1,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                                        &p->dtheta);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>             p->min   = p2;</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>             p->max   = p1;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>         }</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         <span class="keywordflow">while</span> (p->theta <  0     ) p->theta += 2*M_PI; <span class="comment">/* Error does not change */</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>         <span class="keywordflow">while</span> (p->theta >= 2*M_PI) p->theta -= 2*M_PI;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     }</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="keywordflow">return</span> p;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> }</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> fors_pattern_list *</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> fors_pattern_new_from_points(fors_point_list *points,</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                              <span class="keywordtype">double</span> tolerance,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                              <span class="keywordtype">double</span> sigma)</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> {</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     fors_pattern_list *patterns = fors_pattern_list_new();</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="keywordtype">double</span> tol_sq = tolerance * tolerance;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     fors_point *ref, *p1, *p2;</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( points != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="keywordflow">for</span> (ref = fors_point_list_first(points);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>          ref != NULL;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>          ref = fors_point_list_next(points)) {</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>         <span class="keywordflow">for</span> (fors_point_list_first_pair(points, &p1, &p2);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>              p1 != NULL;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>              fors_point_list_next_pair(points, &p1, &p2)) {</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>                 </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>             <span class="keywordflow">if</span> (<a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(ref, p1) > tol_sq &&</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                 <a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(ref, p2) > tol_sq &&</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                 <a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(p1 , p2) > tol_sq) {</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                 </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>                 fors_pattern_list_insert(patterns,</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>                                          fors_pattern_new(</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>                                              ref, p1, p2, sigma));</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>             }</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         }</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     }</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     cpl_msg_debug(cpl_func,</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>                   <span class="stringliteral">"Created %d pattern(s)"</span>, fors_pattern_list_size(patterns));</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     <span class="keywordflow">return</span> patterns;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> }</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="preprocessor">#if 0  </span><span class="comment">/* check before enabling! */</span><span class="preprocessor"></span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="preprocessor"></span><span class="keyword">static</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> fors_pattern_duplicate(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p)</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> {</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *d = NULL;</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( p != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     d = cpl_malloc(<span class="keyword">sizeof</span>(*d));</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     d->ratsq = p->ratsq;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     d->theta = p->theta;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keywordflow">return</span> d;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> }</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="keywordtype">void</span> fors_pattern_delete(<a class="code" href="struct__fors__pattern.html">fors_pattern</a> **p)</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> {</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="keywordflow">if</span> (p && *p) {</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>         cpl_free(*p); *p = NULL;</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     }</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> }</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="keyword">const</span> fors_point *</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> fors_pattern_get_ref(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p)</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> {</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( p != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     <span class="keywordflow">return</span> p->ref;</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> }</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="keywordtype">void</span> fors_pattern_error(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>             <span class="keywordtype">double</span> *dr2,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>             <span class="keywordtype">double</span> *dtheta)</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> {</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( p      != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dr2    != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dtheta != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> </div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     *dr2    = p->dratsq;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     *dtheta = p->dtheta / (2*M_PI);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> </div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> }</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> <span class="keywordtype">double</span> fors_pattern_distsq(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>                            <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q)</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> {</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( p != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( q != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     </div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     <span class="keywordtype">double</span> dtheta = <a class="code" href="group__fors__utils.html#ga69350709e5f9874601c729becd315e81" title="Difference between angles.">fors_angle_diff</a>(&p->theta, &q->theta); <span class="comment">/* in [0;pi] */</span></div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="comment">/* Return distance in normalized parameter space [0;1[ x [0;1[.</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="comment">       This is to give equal weight to differences in radii</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> <span class="comment">       and differences in theta.</span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     <span class="keywordflow">return</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>         (p->ratsq - q->ratsq) * (p->ratsq - q->ratsq) / (1.0 * 1.0) +</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>         (dtheta * dtheta) / (M_PI*M_PI);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> }</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="keywordtype">double</span> fors_pattern_dist_per_error(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>                                    <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q)</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> {</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="keywordtype">double</span> dtheta = <a class="code" href="group__fors__utils.html#ga69350709e5f9874601c729becd315e81" title="Difference between angles.">fors_angle_diff</a>(&p->theta, &q->theta);</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     <span class="keywordtype">double</span> p_error_r;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordtype">double</span> p_error_t;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     fors_pattern_error(p, </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>                        &p_error_r,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                        &p_error_t);</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keywordtype">double</span> q_error_r;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keywordtype">double</span> q_error_t;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     fors_pattern_error(q, </div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                        &q_error_r,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                        &q_error_t);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>  </div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     <span class="comment">/* variance of difference */</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="keywordtype">double</span> rr = p_error_r*p_error_r + q_error_r*q_error_r;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keywordtype">double</span> tt = p_error_t*p_error_t + q_error_t*q_error_t;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> </div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     <span class="keywordflow">return</span> sqrt(</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>         (p->ratsq - q->ratsq) * (p->ratsq - q->ratsq) / ((1.0*1.0) * rr) + </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>         (dtheta * dtheta) / ((M_PI*M_PI) * tt)</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         );</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> }</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> <span class="keywordtype">void</span> fors_pattern_print(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p)</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> {</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     <span class="keywordflow">if</span> (p == NULL) {</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"NULL pattern"</span>);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     }</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Rmin^2/Rmax^2 = %f ; theta = %f"</span>,</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>                      p->ratsq, p->theta);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     }</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> }</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> <span class="keywordtype">double</span> fors_pattern_get_scale(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>                               <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q)</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> {</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( p != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( q != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordtype">double</span> s1 = sqrt(<a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(p->ref, p->max));</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordtype">double</span> s2 = sqrt(<a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(q->ref, q->max));</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> </div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordflow">return</span> (s2 == 0) ? 0 : s1/s2;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> }</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> <span class="keywordtype">double</span> fors_pattern_get_angle(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>                               <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q)</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> {</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( p != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( q != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     </div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <span class="keywordtype">double</span> t1 = atan2(p->ref->y - p->max->y,</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>                p->ref->x - p->max->x);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="keywordtype">double</span> t2 = atan2(q->ref->y - q->max->y,</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>                q->ref->x - q->max->x);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keywordtype">double</span> t = t1 - t2;</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keywordflow">while</span> (t >= 2*M_PI) t -= 2*M_PI;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="keywordflow">while</span> (t  < 0     ) t += 2*M_PI;</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keywordflow">return</span> t;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> }</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> </div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> <span class="preprocessor">#define LIST_DEFINE</span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_pattern</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__pattern_8h-source.html b/html/fors__pattern_8h-source.html
deleted file mode 100644
index e6e6e48..0000000
--- a/html/fors__pattern_8h-source.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_pattern.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_pattern.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_pattern.h,v 1.3 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.3 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_PATTERN_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_PATTERN_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_point.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__pattern.html">_fors_pattern</a> fors_pattern;
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_pattern</span>
-<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 fors_pattern *fors_pattern_new(<span class="keyword">const</span> fors_point *<a class="code" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">ref</a>,
-<a name="l00042"></a>00042                                <span class="keyword">const</span> fors_point *p1,
-<a name="l00043"></a>00043                                <span class="keyword">const</span> fors_point *p2,
-<a name="l00044"></a>00044                                <span class="keywordtype">double</span> sigma);
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 fors_pattern_list *
-<a name="l00047"></a>00047 fors_pattern_new_from_points(<span class="keyword">struct</span> fors_point_list *points,
-<a name="l00048"></a>00048                  <span class="keywordtype">double</span> tolerance,
-<a name="l00049"></a>00049                  <span class="keywordtype">double</span> sigma);
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 <span class="keywordtype">void</span>
-<a name="l00052"></a>00052 fors_pattern_delete(fors_pattern **p);
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 <span class="keywordtype">void</span> fors_pattern_print(<span class="keyword">const</span> fors_pattern *p);
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 <span class="keyword">const</span> fors_point *
-<a name="l00057"></a>00057 fors_pattern_get_ref(<span class="keyword">const</span> fors_pattern *p);
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="keywordtype">double</span> fors_pattern_get_scale(<span class="keyword">const</span> fors_pattern *p,
-<a name="l00060"></a>00060                               <span class="keyword">const</span> fors_pattern *q);
-<a name="l00061"></a>00061 <span class="keywordtype">double</span> fors_pattern_get_angle(<span class="keyword">const</span> fors_pattern *p,
-<a name="l00062"></a>00062                               <span class="keyword">const</span> fors_pattern *q);
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 <span class="keywordtype">void</span> fors_pattern_get_shift(<span class="keyword">const</span> fors_pattern *p,
-<a name="l00065"></a>00065                 <span class="keyword">const</span> fors_pattern *q,
-<a name="l00066"></a>00066                 <span class="keywordtype">double</span> *shift_x,
-<a name="l00067"></a>00067                 <span class="keywordtype">double</span> *shift_y);
-<a name="l00068"></a>00068 
-<a name="l00069"></a>00069 <span class="keywordtype">double</span> fors_pattern_distsq(<span class="keyword">const</span> fors_pattern *p,
-<a name="l00070"></a>00070                            <span class="keyword">const</span> fors_pattern *q);
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 <span class="keywordtype">double</span> fors_pattern_dist_per_error(<span class="keyword">const</span> fors_pattern *p,
-<a name="l00073"></a>00073                    <span class="keyword">const</span> fors_pattern *q);
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="keywordtype">void</span> fors_pattern_error(<span class="keyword">const</span> fors_pattern *p,
-<a name="l00076"></a>00076             <span class="keywordtype">double</span> *dr2,
-<a name="l00077"></a>00077             <span class="keywordtype">double</span> *<a class="code" href="struct__fors__pattern.html#41f94fda5bd41b1e72ef9c679ac73c2b">dtheta</a>);
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__pattern_8h_source.html b/html/fors__pattern_8h_source.html
new file mode 100644
index 0000000..4eb32b6
--- /dev/null
+++ b/html/fors__pattern_8h_source.html
@@ -0,0 +1,140 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_pattern.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_pattern.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_pattern.h,v 1.3 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.3 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_PATTERN_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_PATTERN_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_point.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__pattern.html">_fors_pattern</a> <a class="code" href="struct__fors__pattern.html">fors_pattern</a>;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_pattern</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *fors_pattern_new(<span class="keyword">const</span> fors_point *ref,</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>                                <span class="keyword">const</span> fors_point *p1,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>                                <span class="keyword">const</span> fors_point *p2,</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>                                <span class="keywordtype">double</span> sigma);</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> fors_pattern_list *</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> fors_pattern_new_from_points(<span class="keyword">struct</span> fors_point_list *points,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>                  <span class="keywordtype">double</span> tolerance,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>                  <span class="keywordtype">double</span> sigma);</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> fors_pattern_delete(<a class="code" href="struct__fors__pattern.html">fors_pattern</a> **p);</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keywordtype">void</span> fors_pattern_print(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p);</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">const</span> fors_point *</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> fors_pattern_get_ref(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p);</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keywordtype">double</span> fors_pattern_get_scale(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>                               <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q);</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keywordtype">double</span> fors_pattern_get_angle(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>                               <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q);</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keywordtype">void</span> fors_pattern_get_shift(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>                 <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>                 <span class="keywordtype">double</span> *shift_x,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                 <span class="keywordtype">double</span> *shift_y);</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="keywordtype">double</span> fors_pattern_distsq(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                            <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q);</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="keywordtype">double</span> fors_pattern_dist_per_error(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                    <span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *q);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keywordtype">void</span> fors_pattern_error(<span class="keyword">const</span> <a class="code" href="struct__fors__pattern.html">fors_pattern</a> *p,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>             <span class="keywordtype">double</span> *dr2,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>             <span class="keywordtype">double</span> *dtheta);</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__pfits_8c-source.html b/html/fors__pfits_8c-source.html
deleted file mode 100644
index 3a5a1c9..0000000
--- a/html/fors__pfits_8c-source.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_pfits.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_pfits.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_pfits.c,v 1.13 2011/10/24 13:08:33 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/24 13:08:33 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.13 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00033"></a>00033 
-<a name="l00042"></a><a class="code" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">00042</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">FORS_PFITS_INSTRUME</a>    = <span class="stringliteral">"INSTRUME"</span>;
-<a name="l00043"></a><a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">00043</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a> = <span class="stringliteral">"EXPTIME"</span>;
-<a name="l00044"></a><a class="code" href="group__fors__pfits.html#g4a9f2c688a6202767e8c004478488994">00044</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g4a9f2c688a6202767e8c004478488994">FORS_PFITS_AIRMASS_START</a> = <span class="stringliteral">"ESO TEL AIRM START"</span>;
-<a name="l00045"></a><a class="code" href="group__fors__pfits.html#gc3c14efc5b8bb4954172110153ed1965">00045</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#gc3c14efc5b8bb4954172110153ed1965">FORS_PFITS_AIRMASS_END</a> = <span class="stringliteral">"ESO TEL AIRM END"</span>;
-<a name="l00046"></a><a class="code" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">00046</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">FORS_PFITS_FILTER_NAME</a> = <span class="stringliteral">"ESO INS FILT1 NAME"</span>;
-<a name="l00047"></a><a class="code" href="group__fors__pfits.html#gfaec82e5fe2051be0f32d0e8e01a7060">00047</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#gfaec82e5fe2051be0f32d0e8e01a7060">FORS_PFITS_OUTPUTS</a>     = <span class="stringliteral">"ESO DET OUTPUTS"</span>;
-<a name="l00048"></a><a class="code" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">00048</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a>[4]    = {<span class="stringliteral">"ESO DET OUT1 CONAD"</span>,
-<a name="l00049"></a>00049                         <span class="stringliteral">"ESO DET OUT2 CONAD"</span>,
-<a name="l00050"></a>00050                         <span class="stringliteral">"ESO DET OUT3 CONAD"</span>,
-<a name="l00051"></a>00051                         <span class="stringliteral">"ESO DET OUT4 CONAD"</span>};
-<a name="l00052"></a><a class="code" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">00052</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">FORS_PFITS_RON</a>[4]      = {<span class="stringliteral">"ESO DET OUT1 RON"</span>,
-<a name="l00053"></a>00053                         <span class="stringliteral">"ESO DET OUT2 RON"</span>,
-<a name="l00054"></a>00054                         <span class="stringliteral">"ESO DET OUT3 RON"</span>,
-<a name="l00055"></a>00055                         <span class="stringliteral">"ESO DET OUT4 RON"</span>};
-<a name="l00056"></a><a class="code" href="group__fors__pfits.html#ge9a36044b50b5432f2c9018c58a3b98c">00056</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#ge9a36044b50b5432f2c9018c58a3b98c">FORS_PFITS_OVERSCANX</a>   = <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>;
-<a name="l00057"></a><a class="code" href="group__fors__pfits.html#g7aee125e2c5769eb4927a296a47a63c0">00057</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g7aee125e2c5769eb4927a296a47a63c0">FORS_PFITS_OVERSCANY</a>   = <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>;
-<a name="l00058"></a><a class="code" href="group__fors__pfits.html#g06cb15f701f99b2615b057941aa115ae">00058</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g06cb15f701f99b2615b057941aa115ae">FORS_PFITS_PRESCANX</a>    = <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>;
-<a name="l00059"></a><a class="code" href="group__fors__pfits.html#g2701275da3ccfdcbf3ceaf2b3dcc02fc">00059</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g2701275da3ccfdcbf3ceaf2b3dcc02fc">FORS_PFITS_PRESCANY</a>    = <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>;
-<a name="l00060"></a><a class="code" href="group__fors__pfits.html#g3c36769697845cb20c1c5e5d2193de16">00060</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g3c36769697845cb20c1c5e5d2193de16">FORS_PFITS_CRPIX1</a>      = <span class="stringliteral">"CRPIX1"</span>;
-<a name="l00061"></a><a class="code" href="group__fors__pfits.html#g2fa4424e21e2ca5f1936b814a6d42f97">00061</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g2fa4424e21e2ca5f1936b814a6d42f97">FORS_PFITS_CRPIX2</a>      = <span class="stringliteral">"CRPIX2"</span>;
-<a name="l00062"></a><a class="code" href="group__fors__pfits.html#g186fc8a1532d8bf60c670ca0071d9047">00062</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g186fc8a1532d8bf60c670ca0071d9047">FORS_PFITS_DET_NX</a>      = <span class="stringliteral">"ESO DET OUT1 NX"</span>;
-<a name="l00063"></a><a class="code" href="group__fors__pfits.html#g3c7312a701e7edde8da903a85e83ff3f">00063</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g3c7312a701e7edde8da903a85e83ff3f">FORS_PFITS_DET_NY</a>      = <span class="stringliteral">"ESO DET OUT1 NY"</span>;
-<a name="l00064"></a><a class="code" href="group__fors__pfits.html#ge144a58d19a4028977a4993eb37211b6">00064</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#ge144a58d19a4028977a4993eb37211b6">FORS_PFITS_BINX</a>        = <span class="stringliteral">"ESO DET WIN1 BINX"</span>;
-<a name="l00065"></a><a class="code" href="group__fors__pfits.html#gac44799b56c43a52fd8846bb493c4444">00065</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#gac44799b56c43a52fd8846bb493c4444">FORS_PFITS_BINY</a>        = <span class="stringliteral">"ESO DET WIN1 BINY"</span>;
-<a name="l00066"></a><a class="code" href="group__fors__pfits.html#g4eb732430cac676ad4e2bf1f68a3f5f0">00066</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g4eb732430cac676ad4e2bf1f68a3f5f0">FORS_PFITS_PIXSCALE</a>    = <span class="stringliteral">"ESO INS PIXSCALE"</span>;
-<a name="l00067"></a><a class="code" href="group__fors__pfits.html#g43f0b7ed1c32b140f3da959293f924eb">00067</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g43f0b7ed1c32b140f3da959293f924eb">FORS_PFITS_READ_CLOCK</a>  = <span class="stringliteral">"ESO DET READ CLOCK"</span>;
-<a name="l00068"></a><a class="code" href="group__fors__pfits.html#g0eb4a071376ffab7bd7fb36186e16dda">00068</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g0eb4a071376ffab7bd7fb36186e16dda">FORS_PFITS_CHIP_ID</a>     = <span class="stringliteral">"ESO DET CHIP1 ID"</span>;
-<a name="l00069"></a><a class="code" href="group__fors__pfits.html#g6ef465e799ac380d31708be1255d0a68">00069</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g6ef465e799ac380d31708be1255d0a68">FORS_PFITS_TARG_NAME</a>   = <span class="stringliteral">"ESO OBS TARG NAME"</span>;
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__pfits_8c_source.html b/html/fors__pfits_8c_source.html
new file mode 100644
index 0000000..8cda205
--- /dev/null
+++ b/html/fors__pfits_8c_source.html
@@ -0,0 +1,124 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_pfits.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_pfits.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_pfits.c,v 1.13 2011-10-24 13:08:33 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-24 13:08:33 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.13 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_INSTRUME    = <span class="stringliteral">"INSTRUME"</span>;</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_EXPOSURE_TIME = <span class="stringliteral">"EXPTIME"</span>;</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_AIRMASS_START = <span class="stringliteral">"ESO TEL AIRM START"</span>;</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_AIRMASS_END = <span class="stringliteral">"ESO TEL AIRM END"</span>;</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_FILTER_NAME = <span class="stringliteral">"ESO INS FILT1 NAME"</span>;</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_OUTPUTS     = <span class="stringliteral">"ESO DET OUTPUTS"</span>;</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_CONAD[4]    = {<span class="stringliteral">"ESO DET OUT1 CONAD"</span>,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>                         <span class="stringliteral">"ESO DET OUT2 CONAD"</span>,</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>                         <span class="stringliteral">"ESO DET OUT3 CONAD"</span>,</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>                         <span class="stringliteral">"ESO DET OUT4 CONAD"</span>};</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_RON[4]      = {<span class="stringliteral">"ESO DET OUT1 RON"</span>,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>                         <span class="stringliteral">"ESO DET OUT2 RON"</span>,</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>                         <span class="stringliteral">"ESO DET OUT3 RON"</span>,</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>                         <span class="stringliteral">"ESO DET OUT4 RON"</span>};</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_OVERSCANX   = <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_OVERSCANY   = <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_PRESCANX    = <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_PRESCANY    = <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_CRPIX1      = <span class="stringliteral">"CRPIX1"</span>;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_CRPIX2      = <span class="stringliteral">"CRPIX2"</span>;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_DET_NX      = <span class="stringliteral">"ESO DET OUT1 NX"</span>;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_DET_NY      = <span class="stringliteral">"ESO DET OUT1 NY"</span>;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_BINX        = <span class="stringliteral">"ESO DET WIN1 BINX"</span>;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_BINY        = <span class="stringliteral">"ESO DET WIN1 BINY"</span>;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_PIXSCALE    = <span class="stringliteral">"ESO INS PIXSCALE"</span>;</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_READ_CLOCK  = <span class="stringliteral">"ESO DET READ CLOCK"</span>;</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_CHIP_ID     = <span class="stringliteral">"ESO DET CHIP1 ID"</span>;</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_TARG_NAME   = <span class="stringliteral">"ESO OBS TARG NAME"</span>;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__pfits_8h-source.html b/html/fors__pfits_8h-source.html
deleted file mode 100644
index c2157e1..0000000
--- a/html/fors__pfits_8h-source.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_pfits.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_pfits.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_pfits.h,v 1.12 2011/10/24 13:08:17 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/24 13:08:17 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.12 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_PFITS_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_PFITS_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">FORS_PFITS_INSTRUME</a>;
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">FORS_PFITS_FILTER_NAME</a>;
-<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a>;
-<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g4a9f2c688a6202767e8c004478488994">FORS_PFITS_AIRMASS_START</a>;
-<a name="l00039"></a>00039 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#gc3c14efc5b8bb4954172110153ed1965">FORS_PFITS_AIRMASS_END</a>;
-<a name="l00040"></a>00040 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#gfaec82e5fe2051be0f32d0e8e01a7060">FORS_PFITS_OUTPUTS</a>;
-<a name="l00041"></a>00041 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a>[4];
-<a name="l00042"></a>00042 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">FORS_PFITS_RON</a>[4];
-<a name="l00043"></a>00043 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#ge9a36044b50b5432f2c9018c58a3b98c">FORS_PFITS_OVERSCANX</a>;
-<a name="l00044"></a>00044 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g7aee125e2c5769eb4927a296a47a63c0">FORS_PFITS_OVERSCANY</a>;
-<a name="l00045"></a>00045 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g06cb15f701f99b2615b057941aa115ae">FORS_PFITS_PRESCANX</a>;
-<a name="l00046"></a>00046 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g2701275da3ccfdcbf3ceaf2b3dcc02fc">FORS_PFITS_PRESCANY</a>;
-<a name="l00047"></a>00047 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g3c36769697845cb20c1c5e5d2193de16">FORS_PFITS_CRPIX1</a>;
-<a name="l00048"></a>00048 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g2fa4424e21e2ca5f1936b814a6d42f97">FORS_PFITS_CRPIX2</a>;
-<a name="l00049"></a>00049 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g186fc8a1532d8bf60c670ca0071d9047">FORS_PFITS_DET_NX</a>;
-<a name="l00050"></a>00050 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g3c7312a701e7edde8da903a85e83ff3f">FORS_PFITS_DET_NY</a>;
-<a name="l00051"></a>00051 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#ge144a58d19a4028977a4993eb37211b6">FORS_PFITS_BINX</a>;
-<a name="l00052"></a>00052 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#gac44799b56c43a52fd8846bb493c4444">FORS_PFITS_BINY</a>;
-<a name="l00053"></a>00053 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g4eb732430cac676ad4e2bf1f68a3f5f0">FORS_PFITS_PIXSCALE</a>;
-<a name="l00054"></a>00054 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g43f0b7ed1c32b140f3da959293f924eb">FORS_PFITS_READ_CLOCK</a>;
-<a name="l00055"></a>00055 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g0eb4a071376ffab7bd7fb36186e16dda">FORS_PFITS_CHIP_ID</a>;
-<a name="l00056"></a>00056 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__pfits.html#g6ef465e799ac380d31708be1255d0a68">FORS_PFITS_TARG_NAME</a>;
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058 CPL_END_DECLS
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__pfits_8h_source.html b/html/fors__pfits_8h_source.html
new file mode 100644
index 0000000..7f9599c
--- /dev/null
+++ b/html/fors__pfits_8h_source.html
@@ -0,0 +1,121 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_pfits.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_pfits.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_pfits.h,v 1.12 2011-10-24 13:08:17 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-24 13:08:17 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.12 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_PFITS_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_PFITS_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_INSTRUME;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_FILTER_NAME;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_EXPOSURE_TIME;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_AIRMASS_START;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_AIRMASS_END;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_OUTPUTS;</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_CONAD[4];</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_RON[4];</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_OVERSCANX;</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_OVERSCANY;</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_PRESCANX;</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_PRESCANY;</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_CRPIX1;</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_CRPIX2;</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_DET_NX;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_DET_NY;</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_BINX;</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_BINY;</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_PIXSCALE;</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_READ_CLOCK;</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_CHIP_ID;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_PFITS_TARG_NAME;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__photometry-test_8c-source.html b/html/fors__photometry-test_8c-source.html
deleted file mode 100644
index 701991f..0000000
--- a/html/fors__photometry-test_8c-source.html
+++ /dev/null
@@ -1,183 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_photometry-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_photometry-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_photometry-test.c,v 1.9 2009/02/17 12:18:28 hlorch Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: hlorch $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/02/17 12:18:28 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.9 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_photometry_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <test.h></span>
-<a name="l00037"></a>00037 
-<a name="l00044"></a>00044 <span class="preprocessor">#undef cleanup</span>
-<a name="l00045"></a><a class="code" href="group__fors__point__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00046"></a>00046 <span class="preprocessor">do { \</span>
-<a name="l00047"></a>00047 <span class="preprocessor">    cpl_frameset_delete(frames); \</span>
-<a name="l00048"></a>00048 <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">    cpl_propertylist_delete(header); \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">} while(0)</span>
-<a name="l00051"></a>00051 <span class="preprocessor"></span>
-<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00055"></a><a class="code" href="group__fors__point__test.html#gad6ab87338468a53ffe9d19dc578c999">00055</a> <a class="code" href="group__fors__point__test.html#gad6ab87338468a53ffe9d19dc578c999">test_photometry</a>(<span class="keywordtype">void</span>)
-<a name="l00056"></a>00056 {
-<a name="l00057"></a>00057     cpl_parameterlist *parameters = cpl_parameterlist_new();
-<a name="l00058"></a>00058     cpl_frameset *frames = cpl_frameset_new();
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename[] = {<span class="stringliteral">"photometry_aligned0.fits"</span>,
-<a name="l00061"></a>00061                   <span class="stringliteral">"photometry_aligned1.fits"</span>,
-<a name="l00062"></a>00062                   <span class="stringliteral">"photometry_aligned2.fits"</span>,
-<a name="l00063"></a>00063                   <span class="stringliteral">"photometry_aligned3.fits"</span>};
-<a name="l00064"></a>00064     cpl_propertylist *header = cpl_propertylist_new();
-<a name="l00065"></a>00065     <span class="keywordtype">double</span> exptime = 10.0;
-<a name="l00066"></a>00066     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669">create_sky_flat</a>(<span class="stringliteral">"photometry_master_flat.fits"</span>,
-<a name="l00067"></a>00067                         MASTER_SKY_FLAT_IMG,
-<a name="l00068"></a>00068                         CPL_FRAME_GROUP_RAW,
-<a name="l00069"></a>00069                         10.0));
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5">create_phot_table</a>(<span class="stringliteral">"photometry_phot_table.fits"</span>,
-<a name="l00072"></a>00072                                                   PHOT_TABLE,
-<a name="l00073"></a>00073                                                   CPL_FRAME_GROUP_CALIB));
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075     <a class="code" href="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2">create_standard_keys</a>(header, exptime);
-<a name="l00076"></a>00076     <span class="comment">/* required by fors_photometry parameter --fite=pernight */</span>
-<a name="l00077"></a>00077     cpl_propertylist_update_string(header, <span class="stringliteral">"ORIGIN"</span>, <span class="stringliteral">"ESO"</span>);
-<a name="l00078"></a>00078     cpl_propertylist_update_double(header, <span class="stringliteral">"MJD-OBS"</span>, 0.5);
-<a name="l00079"></a>00079     
-<a name="l00080"></a>00080     {
-<a name="l00081"></a>00081     <span class="keywordtype">int</span> i;
-<a name="l00082"></a>00082     <span class="keywordflow">for</span> (i = 0; i < (int)(<span class="keyword">sizeof</span>(filename)/<span class="keyword">sizeof</span>(*filename)); i++)
-<a name="l00083"></a>00083     {
-<a name="l00084"></a>00084         <span class="keywordtype">double</span>  airmass;
-<a name="l00085"></a>00085         airmass = 1.1 + 0.1*i;
-<a name="l00086"></a>00086         
-<a name="l00087"></a>00087         <span class="comment">/* create an airmass range for fitting the atm. ext. */</span>
-<a name="l00088"></a>00088         cpl_propertylist_update_double(header, <span class="stringliteral">"AIRMASS"</span>, airmass);
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090         <span class="comment">/* Probably better would be to use fors_create_sources_table()</span>
-<a name="l00091"></a>00091 <span class="comment">           to create the ALIGNED_PHOT table */</span>
-<a name="l00092"></a>00092         
-<a name="l00093"></a>00093         cpl_table *aligned = cpl_table_new(1);
-<a name="l00094"></a>00094         
-<a name="l00095"></a>00095         cpl_frame *f = cpl_frame_new();
-<a name="l00096"></a>00096         cpl_frame_set_tag(f, ALIGNED_PHOT);
-<a name="l00097"></a>00097         cpl_frame_set_filename(f, filename[i]);
-<a name="l00098"></a>00098         cpl_frameset_insert(frames, f);
-<a name="l00099"></a>00099         
-<a name="l00100"></a>00100         cpl_table_new_column(aligned, <span class="stringliteral">"INSTR_MAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00101"></a>00101         cpl_table_new_column(aligned, <span class="stringliteral">"DINSTR_MAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00102"></a>00102         cpl_table_new_column(aligned, <span class="stringliteral">"MAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00103"></a>00103         cpl_table_new_column(aligned, <span class="stringliteral">"DMAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00104"></a>00104         cpl_table_new_column(aligned, <span class="stringliteral">"CAT_MAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00105"></a>00105         cpl_table_new_column(aligned, <span class="stringliteral">"DCAT_MAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00106"></a>00106         cpl_table_new_column(aligned, <span class="stringliteral">"COLOR"</span>, CPL_TYPE_DOUBLE);
-<a name="l00107"></a>00107         cpl_table_new_column(aligned, <span class="stringliteral">"RA"</span>, CPL_TYPE_DOUBLE);
-<a name="l00108"></a>00108         cpl_table_new_column(aligned, <span class="stringliteral">"DEC"</span>, CPL_TYPE_DOUBLE);
-<a name="l00109"></a>00109         cpl_table_new_column(aligned, <span class="stringliteral">"X"</span>, CPL_TYPE_DOUBLE);
-<a name="l00110"></a>00110         cpl_table_new_column(aligned, <span class="stringliteral">"Y"</span>, CPL_TYPE_DOUBLE);
-<a name="l00111"></a>00111         cpl_table_new_column(aligned, <span class="stringliteral">"A"</span>, CPL_TYPE_DOUBLE);
-<a name="l00112"></a>00112         cpl_table_new_column(aligned, <span class="stringliteral">"B"</span>, CPL_TYPE_DOUBLE);
-<a name="l00113"></a>00113         cpl_table_new_column(aligned, <span class="stringliteral">"FWHM"</span>, CPL_TYPE_DOUBLE);
-<a name="l00114"></a>00114         cpl_table_new_column(aligned, <span class="stringliteral">"THETA"</span>, CPL_TYPE_DOUBLE);
-<a name="l00115"></a>00115         cpl_table_new_column(aligned, <span class="stringliteral">"CLASS_STAR"</span>, CPL_TYPE_DOUBLE);
-<a name="l00116"></a>00116         cpl_table_new_column(aligned, <span class="stringliteral">"OBJECT"</span>, CPL_TYPE_STRING);
-<a name="l00117"></a>00117         cpl_table_new_column(aligned, <span class="stringliteral">"USE_CAT"</span>, CPL_TYPE_INT);
-<a name="l00118"></a>00118         
-<a name="l00119"></a>00119         cpl_table_set_double(aligned, <span class="stringliteral">"INSTR_MAG"</span>, 0, -13.8 + (airmass-1)*0.1);
-<a name="l00120"></a>00120         cpl_table_set_double(aligned, <span class="stringliteral">"DINSTR_MAG"</span>, 0, 0.1);
-<a name="l00121"></a>00121         cpl_table_set_double(aligned, <span class="stringliteral">"MAG"</span>, 0, 14.4);
-<a name="l00122"></a>00122         cpl_table_set_double(aligned, <span class="stringliteral">"DMAG"</span>, 0, 0.004);
-<a name="l00123"></a>00123         cpl_table_set_double(aligned, <span class="stringliteral">"CAT_MAG"</span>, 0, 14.2);
-<a name="l00124"></a>00124         cpl_table_set_double(aligned, <span class="stringliteral">"DCAT_MAG"</span>, 0, 0.002);
-<a name="l00125"></a>00125         cpl_table_set_double(aligned, <span class="stringliteral">"COLOR"</span>, 0, 0.4);
-<a name="l00126"></a>00126         
-<a name="l00127"></a>00127         cpl_table_set_double(aligned, <span class="stringliteral">"RA"</span>, 0, 100);
-<a name="l00128"></a>00128         cpl_table_set_double(aligned, <span class="stringliteral">"DEC"</span>, 0, 1);
-<a name="l00129"></a>00129         
-<a name="l00130"></a>00130         cpl_table_set_double(aligned, <span class="stringliteral">"X"</span>, 0, 400);
-<a name="l00131"></a>00131         cpl_table_set_double(aligned, <span class="stringliteral">"Y"</span>, 0, 500);
-<a name="l00132"></a>00132         cpl_table_set_double(aligned, <span class="stringliteral">"A"</span>, 0, 2);
-<a name="l00133"></a>00133         cpl_table_set_double(aligned, <span class="stringliteral">"B"</span>, 0, 1);
-<a name="l00134"></a>00134         cpl_table_set_double(aligned, <span class="stringliteral">"FWHM"</span>, 0, 1.4);
-<a name="l00135"></a>00135         cpl_table_set_double(aligned, <span class="stringliteral">"THETA"</span>, 0, 0.1);
-<a name="l00136"></a>00136         cpl_table_set_double(aligned, <span class="stringliteral">"CLASS_STAR"</span>, 0, 0.1);
-<a name="l00137"></a>00137         
-<a name="l00138"></a>00138         cpl_table_set_string(aligned, <span class="stringliteral">"OBJECT"</span>, 0, <span class="stringliteral">"MOBJEKT"</span>);
-<a name="l00139"></a>00139         cpl_table_set_int(aligned, <span class="stringliteral">"USE_CAT"</span>, 0, 1);        
-<a name="l00140"></a>00140         
-<a name="l00141"></a>00141         cpl_table_save(aligned, header, NULL, filename[i], CPL_IO_DEFAULT);
-<a name="l00142"></a>00142 
-<a name="l00143"></a>00143         cpl_table_delete(aligned); aligned = NULL;
-<a name="l00144"></a>00144     }
-<a name="l00145"></a>00145     }
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149     <a class="code" href="group__fors__photometry.html#gecc363f8be41aa6d224d6f604d5a6b30">fors_photometry_define_parameters</a>(parameters);
-<a name="l00150"></a>00150     cpl_parameter_set_int(cpl_parameterlist_find(parameters,
-<a name="l00151"></a>00151                          <span class="stringliteral">"fors.fors_photometry.degreef1"</span>),
-<a name="l00152"></a>00152               0);
-<a name="l00153"></a>00153     
-<a name="l00154"></a>00154     <a class="code" href="group__fors__photometry.html#g78298a3adaf4b775f4a48a21a2b475ba">fors_photometry</a>(frames, parameters);
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00157"></a>00157     <span class="keywordflow">return</span>;
-<a name="l00158"></a>00158 }
-<a name="l00159"></a>00159 
-<a name="l00160"></a>00160 
-<a name="l00164"></a><a class="code" href="group__fors__point__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00164</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00165"></a>00165 {
-<a name="l00166"></a>00166     TEST_INIT;
-<a name="l00167"></a>00167     <span class="comment">//cpl_msg_set_level(CPL_MSG_DEBUG);</span>
-<a name="l00168"></a>00168     <a class="code" href="group__fors__point__test.html#gad6ab87338468a53ffe9d19dc578c999">test_photometry</a>();
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170     TEST_END;
-<a name="l00171"></a>00171 }
-<a name="l00172"></a>00172 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__photometry-test_8c_source.html b/html/fors__photometry-test_8c_source.html
new file mode 100644
index 0000000..0b3fdec
--- /dev/null
+++ b/html/fors__photometry-test_8c_source.html
@@ -0,0 +1,222 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_photometry-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_photometry-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_photometry-test.c,v 1.9 2009-02-17 12:18:28 hlorch Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: hlorch $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009-02-17 12:18:28 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.9 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_photometry_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">    cpl_frameset_delete(frames); \</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">    cpl_propertylist_delete(header); \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="group__fors__point__test.html#gad87df141a27d7e06e22c0e912ae029e6">   55</a></span> <a class="code" href="group__fors__point__test.html#gad87df141a27d7e06e22c0e912ae029e6" title="test">test_photometry</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> {</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>     cpl_parameterlist *parameters = cpl_parameterlist_new();</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>     cpl_frameset *frames = cpl_frameset_new();</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename[] = {<span class="stringliteral">"photometry_aligned0.fits"</span>,</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>                   <span class="stringliteral">"photometry_aligned1.fits"</span>,</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>                   <span class="stringliteral">"photometry_aligned2.fits"</span>,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>                   <span class="stringliteral">"photometry_aligned3.fits"</span>};</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_propertylist *header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     <span class="keywordtype">double</span> exptime = 10.0;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103" title="Simulate sky flat image.">create_sky_flat</a>(<span class="stringliteral">"photometry_master_flat.fits"</span>,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                         MASTER_SKY_FLAT_IMG,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                         CPL_FRAME_GROUP_RAW,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                         10.0));</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b" title="Create photometry table.">create_phot_table</a>(<span class="stringliteral">"photometry_phot_table.fits"</span>,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                                                   PHOT_TABLE,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                                                   CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <a class="code" href="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5" title="Write FORS standard keywords to simulated header.">create_standard_keys</a>(header, exptime);</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="comment">/* required by fors_photometry parameter --fite=pernight */</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"ORIGIN"</span>, <span class="stringliteral">"ESO"</span>);</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"MJD-OBS"</span>, 0.5);</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     {</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     <span class="keywordflow">for</span> (i = 0; i < (int)(<span class="keyword">sizeof</span>(filename)/<span class="keyword">sizeof</span>(*filename)); i++)</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     {</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>         <span class="keywordtype">double</span>  airmass;</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>         airmass = 1.1 + 0.1*i;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>         </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>         <span class="comment">/* create an airmass range for fitting the atm. ext. */</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"AIRMASS"</span>, airmass);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>         <span class="comment">/* Probably better would be to use fors_create_sources_table()</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="comment">           to create the ALIGNED_PHOT table */</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>         </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>         cpl_table *aligned = cpl_table_new(1);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>         </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>         cpl_frame *f = cpl_frame_new();</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>         cpl_frame_set_tag(f, ALIGNED_PHOT);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>         cpl_frame_set_filename(f, filename[i]);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>         cpl_frameset_insert(frames, f);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>         </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>         cpl_table_new_column(aligned, <span class="stringliteral">"INSTR_MAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>         cpl_table_new_column(aligned, <span class="stringliteral">"DINSTR_MAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>         cpl_table_new_column(aligned, <span class="stringliteral">"MAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>         cpl_table_new_column(aligned, <span class="stringliteral">"DMAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>         cpl_table_new_column(aligned, <span class="stringliteral">"CAT_MAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>         cpl_table_new_column(aligned, <span class="stringliteral">"DCAT_MAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>         cpl_table_new_column(aligned, <span class="stringliteral">"COLOR"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>         cpl_table_new_column(aligned, <span class="stringliteral">"RA"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>         cpl_table_new_column(aligned, <span class="stringliteral">"DEC"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>         cpl_table_new_column(aligned, <span class="stringliteral">"X"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>         cpl_table_new_column(aligned, <span class="stringliteral">"Y"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>         cpl_table_new_column(aligned, <span class="stringliteral">"A"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>         cpl_table_new_column(aligned, <span class="stringliteral">"B"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>         cpl_table_new_column(aligned, <span class="stringliteral">"FWHM"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         cpl_table_new_column(aligned, <span class="stringliteral">"THETA"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>         cpl_table_new_column(aligned, <span class="stringliteral">"CLASS_STAR"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>         cpl_table_new_column(aligned, <span class="stringliteral">"OBJECT"</span>, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>         cpl_table_new_column(aligned, <span class="stringliteral">"USE_CAT"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         cpl_table_set_double(aligned, <span class="stringliteral">"INSTR_MAG"</span>, 0, -13.8 + (airmass-1)*0.1);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>         cpl_table_set_double(aligned, <span class="stringliteral">"DINSTR_MAG"</span>, 0, 0.1);</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>         cpl_table_set_double(aligned, <span class="stringliteral">"MAG"</span>, 0, 14.4);</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>         cpl_table_set_double(aligned, <span class="stringliteral">"DMAG"</span>, 0, 0.004);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>         cpl_table_set_double(aligned, <span class="stringliteral">"CAT_MAG"</span>, 0, 14.2);</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>         cpl_table_set_double(aligned, <span class="stringliteral">"DCAT_MAG"</span>, 0, 0.002);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>         cpl_table_set_double(aligned, <span class="stringliteral">"COLOR"</span>, 0, 0.4);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>         cpl_table_set_double(aligned, <span class="stringliteral">"RA"</span>, 0, 100);</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>         cpl_table_set_double(aligned, <span class="stringliteral">"DEC"</span>, 0, 1);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>         cpl_table_set_double(aligned, <span class="stringliteral">"X"</span>, 0, 400);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>         cpl_table_set_double(aligned, <span class="stringliteral">"Y"</span>, 0, 500);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         cpl_table_set_double(aligned, <span class="stringliteral">"A"</span>, 0, 2);</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>         cpl_table_set_double(aligned, <span class="stringliteral">"B"</span>, 0, 1);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         cpl_table_set_double(aligned, <span class="stringliteral">"FWHM"</span>, 0, 1.4);</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>         cpl_table_set_double(aligned, <span class="stringliteral">"THETA"</span>, 0, 0.1);</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         cpl_table_set_double(aligned, <span class="stringliteral">"CLASS_STAR"</span>, 0, 0.1);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>         </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>         cpl_table_set_string(aligned, <span class="stringliteral">"OBJECT"</span>, 0, <span class="stringliteral">"MOBJEKT"</span>);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>         cpl_table_set_int(aligned, <span class="stringliteral">"USE_CAT"</span>, 0, 1);        </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>         </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         cpl_table_save(aligned, header, NULL, filename[i], CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         cpl_table_delete(aligned); aligned = NULL;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     }</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     }</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <a class="code" href="group__fors__photometry.html#ga4b3a00d660ccc7d889875a00fb629be5" title="Define recipe parameters.">fors_photometry_define_parameters</a>(parameters);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     cpl_parameter_set_int(cpl_parameterlist_find(parameters,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>                          <span class="stringliteral">"fors.fors_photometry.degreef1"</span>),</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>               0);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <a class="code" href="group__fors__photometry.html#gae18d6d686eec800da9538ee3c533aed7" title="Do the processing.">fors_photometry</a>(frames, parameters);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     cleanup;</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> }</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno"><a class="code" href="group__fors__point__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  164</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> {</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     TEST_INIT;</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="comment">//cpl_msg_set_level(CPL_MSG_DEBUG);</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <a class="code" href="group__fors__point__test.html#gad87df141a27d7e06e22c0e912ae029e6" title="test">test_photometry</a>();</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     TEST_END;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> }</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__photometry_8c-source.html b/html/fors__photometry_8c-source.html
deleted file mode 100644
index 2240ac8..0000000
--- a/html/fors__photometry_8c-source.html
+++ /dev/null
@@ -1,198 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_photometry.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_photometry.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_photometry.c,v 1.8 2011/10/12 15:00:52 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/12 15:00:52 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_photometry_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#g8caa3f3d513a15a26c0d6e55a17370e3">fors_photometry_create</a>(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#g71aac253b19e8883e79cfbce6b73076a">fors_photometry_exec</a>(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#gad02467f38136c506fb860db14783156">fors_photometry_destroy</a>(cpl_plugin *);
-<a name="l00041"></a>00041 
-<a name="l00062"></a><a class="code" href="group__fors__photometry.html#g4abb403976fc3ddcaa614c59a44590c9">00062</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00065"></a>00065     cpl_plugin *plugin = &recipe->interface;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>())
-<a name="l00068"></a>00068     {
-<a name="l00069"></a>00069         cpl_msg_error(cpl_func, 
-<a name="l00070"></a>00070               <span class="stringliteral">"I am fors_photometry version %d, but I am linking "</span>
-<a name="l00071"></a>00071               <span class="stringliteral">"against the FORS library version %d. "</span>
-<a name="l00072"></a>00072               <span class="stringliteral">"This will not work. "</span>
-<a name="l00073"></a>00073               <span class="stringliteral">"Please remove all previous installations "</span>
-<a name="l00074"></a>00074               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,
-<a name="l00075"></a>00075               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>());
-<a name="l00076"></a>00076         <span class="keywordflow">return</span> 1;
-<a name="l00077"></a>00077     }
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079     cpl_plugin_init(plugin,
-<a name="l00080"></a>00080                     CPL_PLUGIN_API,
-<a name="l00081"></a>00081                     FORS_BINARY_VERSION,
-<a name="l00082"></a>00082                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00083"></a>00083                     <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a>,
-<a name="l00084"></a>00084                     <a class="code" href="group__fors__photometry.html#gc66ce3f4470634c6cee1eab4c05f6985">fors_photometry_description_short</a>,
-<a name="l00085"></a>00085                     <a class="code" href="group__fors__photometry.html#g1e4c46bbe3d698da29ad2ca40f5c70cf">fors_photometry_description</a>,
-<a name="l00086"></a>00086                     <a class="code" href="group__fors__photometry.html#g6772a94b278b89711f7ab2c9d19a6c91">fors_photometry_author</a>,
-<a name="l00087"></a>00087                     <a class="code" href="group__fors__photometry.html#gc03e598cb3c1c63eb2a1b04939aa2f21">fors_photometry_email</a>,
-<a name="l00088"></a>00088                     <a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a>(),
-<a name="l00089"></a>00089                     <a class="code" href="group__fors__photometry.html#g8caa3f3d513a15a26c0d6e55a17370e3">fors_photometry_create</a>,
-<a name="l00090"></a>00090                     <a class="code" href="group__fors__photometry.html#g71aac253b19e8883e79cfbce6b73076a">fors_photometry_exec</a>,
-<a name="l00091"></a>00091                     <a class="code" href="group__fors__photometry.html#gad02467f38136c506fb860db14783156">fors_photometry_destroy</a>);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     cpl_pluginlist_append(list, plugin);
-<a name="l00094"></a>00094     
-<a name="l00095"></a>00095     <span class="keywordflow">return</span> 0;
-<a name="l00096"></a>00096 }
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 
-<a name="l00109"></a><a class="code" href="group__fors__photometry.html#g8caa3f3d513a15a26c0d6e55a17370e3">00109</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#g8caa3f3d513a15a26c0d6e55a17370e3">fors_photometry_create</a>(cpl_plugin *plugin)
-<a name="l00110"></a>00110 {
-<a name="l00111"></a>00111     cpl_recipe    *recipe;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00114"></a>00114         cpl_msg_error(cpl_func, 
-<a name="l00115"></a>00115                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00116"></a>00116                       <span class="stringliteral">"refusing to create recipe fors_photometry"</span>, 
-<a name="l00117"></a>00117                       cpl_error_get_message());
-<a name="l00118"></a>00118         <span class="keywordflow">return</span> 1;
-<a name="l00119"></a>00119     }
-<a name="l00120"></a>00120     
-<a name="l00121"></a>00121     <span class="comment">/* </span>
-<a name="l00122"></a>00122 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00123"></a>00123 <span class="comment">     */</span>
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00126"></a>00126         recipe = (cpl_recipe *)plugin;
-<a name="l00127"></a>00127     }
-<a name="l00128"></a>00128     <span class="keywordflow">else</span> {
-<a name="l00129"></a>00129         <span class="keywordflow">return</span> 1;
-<a name="l00130"></a>00130     }
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* </span>
-<a name="l00133"></a>00133 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00134"></a>00134 <span class="comment">     */</span>
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00137"></a>00137     
-<a name="l00138"></a>00138     <a class="code" href="group__fors__photometry.html#gecc363f8be41aa6d224d6f604d5a6b30">fors_photometry_define_parameters</a>(recipe->parameters);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00141"></a>00141         cpl_msg_error(cpl_func, 
-<a name="l00142"></a>00142                       <span class="stringliteral">"Could not create fors_photometry parameters"</span>);
-<a name="l00143"></a>00143         <span class="keywordflow">return</span> 1;
-<a name="l00144"></a>00144     }
-<a name="l00145"></a>00145         
-<a name="l00146"></a>00146     <span class="keywordflow">return</span> 0;
-<a name="l00147"></a>00147 }
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 
-<a name="l00158"></a><a class="code" href="group__fors__photometry.html#g71aac253b19e8883e79cfbce6b73076a">00158</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#g71aac253b19e8883e79cfbce6b73076a">fors_photometry_exec</a>(cpl_plugin *plugin)
-<a name="l00159"></a>00159 {
-<a name="l00160"></a>00160     cpl_recipe *recipe;
-<a name="l00161"></a>00161     cpl_errorstate initial_errorstate = cpl_errorstate_get();
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00164"></a>00164         cpl_msg_error(cpl_func, 
-<a name="l00165"></a>00165                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00166"></a>00166                       <span class="stringliteral">"refusing to execute recipe fors_photometry"</span>, 
-<a name="l00167"></a>00167                       cpl_error_get_message());
-<a name="l00168"></a>00168         <span class="keywordflow">return</span> 1;
-<a name="l00169"></a>00169     }
-<a name="l00170"></a>00170     
-<a name="l00171"></a>00171     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00172"></a>00172         recipe = (cpl_recipe *)plugin;
-<a name="l00173"></a>00173     }
-<a name="l00174"></a>00174     <span class="keywordflow">else</span> {
-<a name="l00175"></a>00175         <span class="keywordflow">return</span> 1;
-<a name="l00176"></a>00176     }
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="keywordflow">if</span> (recipe->frames == NULL) {
-<a name="l00179"></a>00179         cpl_msg_error(cpl_func, 
-<a name="l00180"></a>00180                       <span class="stringliteral">"Null frameset"</span>);
-<a name="l00181"></a>00181         <span class="keywordflow">return</span> 1;
-<a name="l00182"></a>00182     }
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">if</span> (recipe->parameters == NULL) {
-<a name="l00185"></a>00185         cpl_msg_error(cpl_func, 
-<a name="l00186"></a>00186                       <span class="stringliteral">"Null parameter list"</span>);
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> 1;
-<a name="l00188"></a>00188     }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a>(recipe->frames,
-<a name="l00191"></a>00191                <a class="code" href="group__fors__photometry.html#gc66ce3f4470634c6cee1eab4c05f6985">fors_photometry_description_short</a>);
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <a class="code" href="group__fors__photometry.html#g78298a3adaf4b775f4a48a21a2b475ba">fors_photometry</a>(recipe->frames, recipe->parameters);
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a>(recipe->frames, initial_errorstate);
-<a name="l00196"></a>00196 }
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 
-<a name="l00207"></a><a class="code" href="group__fors__photometry.html#gad02467f38136c506fb860db14783156">00207</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#gad02467f38136c506fb860db14783156">fors_photometry_destroy</a>(cpl_plugin *plugin)
-<a name="l00208"></a>00208 {
-<a name="l00209"></a>00209     cpl_recipe *recipe;
-<a name="l00210"></a>00210     
-<a name="l00211"></a>00211     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00212"></a>00212         recipe = (cpl_recipe *)plugin;
-<a name="l00213"></a>00213     }
-<a name="l00214"></a>00214     <span class="keywordflow">else</span> {
-<a name="l00215"></a>00215         <span class="keywordflow">return</span> -1;
-<a name="l00216"></a>00216     }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     <span class="keywordflow">return</span> 0;
-<a name="l00221"></a>00221 }
-<a name="l00222"></a>00222 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__photometry_8c_source.html b/html/fors__photometry_8c_source.html
new file mode 100644
index 0000000..f5a1284
--- /dev/null
+++ b/html/fors__photometry_8c_source.html
@@ -0,0 +1,237 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_photometry.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_photometry.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_photometry.c,v 1.8 2011-10-12 15:00:52 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-12 15:00:52 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_photometry_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#gaefb8747dfc072489e0c49686e235db79" title="Setup the recipe options.">fors_photometry_create</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#gaa3f56f38e97f7b8afe2cc18c5e9f3a6d" title="Execute the plugin instance given by the interface.">fors_photometry_exec</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#gae31960fe5e90f545420ff2f50c33f0a4" title="Destroy what has been created by the 'create' function.">fors_photometry_destroy</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">   62</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>())</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     {</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>               <span class="stringliteral">"I am fors_photometry version %d, but I am linking "</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>               <span class="stringliteral">"against the FORS library version %d. "</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>               <span class="stringliteral">"This will not work. "</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>               <span class="stringliteral">"Please remove all previous installations "</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>());</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     }</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                     fors_photometry_name,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                     fors_photometry_description_short,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     fors_photometry_description,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                     fors_photometry_author,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                     fors_photometry_email,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     <a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87" title="Get the pipeline copyright and license.">fors_get_license</a>(),</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     <a class="code" href="group__fors__photometry.html#gaefb8747dfc072489e0c49686e235db79" title="Setup the recipe options.">fors_photometry_create</a>,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     <a class="code" href="group__fors__photometry.html#gaa3f56f38e97f7b8afe2cc18c5e9f3a6d" title="Execute the plugin instance given by the interface.">fors_photometry_exec</a>,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <a class="code" href="group__fors__photometry.html#gae31960fe5e90f545420ff2f50c33f0a4" title="Destroy what has been created by the 'create' function.">fors_photometry_destroy</a>);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> }</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gaefb8747dfc072489e0c49686e235db79">  109</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#gaefb8747dfc072489e0c49686e235db79" title="Setup the recipe options.">fors_photometry_create</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                       <span class="stringliteral">"refusing to create recipe fors_photometry"</span>, </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     }</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     }</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <a class="code" href="group__fors__photometry.html#ga4b3a00d660ccc7d889875a00fb629be5" title="Define recipe parameters.">fors_photometry_define_parameters</a>(recipe->parameters);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                       <span class="stringliteral">"Could not create fors_photometry parameters"</span>);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     }</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> }</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gaa3f56f38e97f7b8afe2cc18c5e9f3a6d">  158</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#gaa3f56f38e97f7b8afe2cc18c5e9f3a6d" title="Execute the plugin instance given by the interface.">fors_photometry_exec</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> {</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_errorstate initial_errorstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                       <span class="stringliteral">"refusing to execute recipe fors_photometry"</span>, </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">if</span> (recipe->frames == NULL) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                       <span class="stringliteral">"Null frameset"</span>);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     }</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL) {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                       <span class="stringliteral">"Null parameter list"</span>);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce" title="Start recipe execution.">fors_begin</a>(recipe->frames,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                fors_photometry_description_short);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <a class="code" href="group__fors__photometry.html#gae18d6d686eec800da9538ee3c533aed7" title="Do the processing.">fors_photometry</a>(recipe->frames, recipe->parameters);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9" title="End recipe execution.">fors_end</a>(recipe->frames, initial_errorstate);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> }</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gae31960fe5e90f545420ff2f50c33f0a4">  207</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__photometry.html#gae31960fe5e90f545420ff2f50c33f0a4" title="Destroy what has been created by the 'create' function.">fors_photometry_destroy</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> {</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     }</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> }</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__photometry__impl_8c-source.html b/html/fors__photometry__impl_8c-source.html
deleted file mode 100644
index f73b105..0000000
--- a/html/fors__photometry__impl_8c-source.html
+++ /dev/null
@@ -1,3807 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_photometry_impl.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_photometry_impl.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_photometry_impl.c,v 1.82 2012/01/27 18:53:15 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/01/27 18:53:15 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.82 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_photometry_impl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_data.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_tools.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_polynomial.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <fors_double.h></span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include <fors_extract.h></span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include <math.h></span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include <assert.h></span>
-<a name="l00047"></a>00047 <span class="preprocessor">#include <string.h></span>
-<a name="l00048"></a>00048 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00049"></a>00049 
-<a name="l00056"></a><a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">00056</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a> = <span class="stringliteral">"fors_photometry"</span>;
-<a name="l00057"></a><a class="code" href="group__fors__photometry.html#gc66ce3f4470634c6cee1eab4c05f6985">00057</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__photometry.html#gc66ce3f4470634c6cee1eab4c05f6985">fors_photometry_description_short</a> = <span class="stringliteral">"Compute corrected flatfield"</span>;
-<a name="l00058"></a><a class="code" href="group__fors__photometry.html#g6772a94b278b89711f7ab2c9d19a6c91">00058</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__photometry.html#g6772a94b278b89711f7ab2c9d19a6c91">fors_photometry_author</a> = <span class="stringliteral">"Jonas M. Larsen"</span>;
-<a name="l00059"></a><a class="code" href="group__fors__photometry.html#gc03e598cb3c1c63eb2a1b04939aa2f21">00059</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__photometry.html#gc03e598cb3c1c63eb2a1b04939aa2f21">fors_photometry_email</a> = PACKAGE_BUGREPORT;
-<a name="l00060"></a><a class="code" href="group__fors__photometry.html#g1e4c46bbe3d698da29ad2ca40f5c70cf">00060</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__photometry.html#g1e4c46bbe3d698da29ad2ca40f5c70cf">fors_photometry_description</a> = 
-<a name="l00061"></a>00061 <span class="stringliteral">"Input files:\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  PHOT_TABLE                 FITS table  Expected extinction params  1\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  ALIGNED_PHOT               FITS table  Photometry                  1+\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master flat field           1\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"Output files:\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  PHOT_COEFF_TABLE           FITS image  Observed extinction coefficients\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"  CORRECTION_MAP             FITS image  Correction map (magnitude)\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"  CORRECTION_FACTOR          FITS image  Correction map (flux)\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"  MASTER_FLAT_IMG            FITS image  Corrected master flat field\n"</span>;
-<a name="l00073"></a>00073 
-<a name="l00074"></a><a class="code" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">00074</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> {
-<a name="l00075"></a>00075     FORS_FIT_NCOEFF_NO = 0,
-<a name="l00076"></a>00076     FORS_FIT_NCOEFF_ONE,
-<a name="l00077"></a>00077     FORS_FIT_NCOEFF_PERFRAME,
-<a name="l00078"></a>00078     FORS_FIT_NCOEFF_PERNIGHT
-<a name="l00079"></a>00079 } <a class="code" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a>;
-<a name="l00080"></a>00080 
-<a name="l00081"></a><a class="code" href="structfors__fit__ncoeff__paropts.html">00081</a> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a> {
-<a name="l00082"></a><a class="code" href="structfors__fit__ncoeff__paropts.html#4e5247458b71d9717197e5a15240f029">00082</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *<a class="code" href="structfors__fit__ncoeff__paropts.html#6fec4d8800eab2df5c1ba89004dc39f1">no</a>,
-<a name="l00083"></a>00083                 *<a class="code" href="structfors__fit__ncoeff__paropts.html#7bd4d2efd9c7633b9e865404c93f1d90">one</a>,
-<a name="l00084"></a>00084                 *<a class="code" href="structfors__fit__ncoeff__paropts.html#08db6598924e76f81aeb0fb4ecf6873d">perframe</a>,
-<a name="l00085"></a>00085                 *<a class="code" href="structfors__fit__ncoeff__paropts.html#4e5247458b71d9717197e5a15240f029">pernight</a>;
-<a name="l00086"></a>00086 } <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a> = {       <span class="stringliteral">"no"</span>,
-<a name="l00087"></a>00087                                     <span class="stringliteral">"one"</span>,
-<a name="l00088"></a>00088                                     <span class="stringliteral">"perframe"</span>,
-<a name="l00089"></a>00089                                     <span class="stringliteral">"pernight"</span>};
-<a name="l00090"></a>00090 
-<a name="l00091"></a><a class="code" href="structentry.html">00091</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structentry.html">entry</a>
-<a name="l00092"></a>00092 {
-<a name="l00093"></a><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">00093</a>     <span class="keywordtype">int</span>         <a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a>,   <span class="comment">/* Counting from zero */</span>
-<a name="l00094"></a>00094                 <a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a>,    <span class="comment">/* Star identification number, count from 0 */</span>
-<a name="l00095"></a>00095                 <a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a>;  <span class="comment">/* atmospheric extinction index, count from 0 */</span>
-<a name="l00096"></a><a class="code" href="structentry.html#c85d7b45722824c52fdaa4754c8d64ee">00096</a>     <span class="keywordtype">int</span>         <a class="code" href="structentry.html#c85d7b45722824c52fdaa4754c8d64ee">atm_ext_identifier</a>;
-<a name="l00097"></a><a class="code" href="structentry.html#9094c40ac744faa1135a2773f85ba1ff">00097</a>     <span class="keywordtype">double</span>      <a class="code" href="structentry.html#6f585239f5d6905b0cff05055d77bf9c">airmass</a>,
-<a name="l00098"></a>00098                 <a class="code" href="structentry.html#9094c40ac744faa1135a2773f85ba1ff">gain</a>,
-<a name="l00099"></a>00099                 <a class="code" href="structentry.html#3e422ef6bc06e1e9c3d2dad3ec2f972b">exptime</a>;
-<a name="l00100"></a><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">00100</a>     <a class="code" href="struct__fors__star.html">fors_star</a>   *<a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>;
-<a name="l00101"></a>00101 } <a class="code" href="structentry.html">entry</a>;
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103 <span class="comment">/* Declare and define entry_list */</span>
-<a name="l00104"></a>00104 <span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00105"></a><a class="code" href="group__fors__photometry.html#g9d7995a21a54c1d39a0bc87d7f498029">00105</a> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM entry </span>
-<a name="l00106"></a>00106 <span class="preprocessor"></span><span class="preprocessor">#undef LIST_DEFINE</span>
-<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00108"></a><a class="code" href="group__fors__photometry.html#gb79164ea3a1118352c6ca0ea9a9840ea">00108</a> <span class="preprocessor">#define LIST_DEFINE</span>
-<a name="l00109"></a>00109 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00110"></a>00110 
-<a name="l00111"></a><a class="code" href="group__fors__photometry.html#gb139bfc01f73748958dc0543e8e9a1c9">00111</a> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__photometry.html#gb139bfc01f73748958dc0543e8e9a1c9">arcsec_tol</a> = 5.0;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113 <a class="code" href="structentry.html">entry</a> *<a class="code" href="group__fors__photometry.html#gc4cfb3c0bdf31be44324adffdb6277a1">entry_new</a>(                           <span class="keywordtype">int</span>     frame_index,
-<a name="l00114"></a>00114                                             <span class="keywordtype">int</span>     star_index,
-<a name="l00115"></a>00115                                             <span class="keywordtype">double</span>  airmass,
-<a name="l00116"></a>00116                                             <span class="keywordtype">double</span>  gain,
-<a name="l00117"></a>00117                                             <span class="keywordtype">double</span>  exptime,
-<a name="l00118"></a>00118                                             <span class="keywordtype">int</span>     atm_ext_identifier,
-<a name="l00119"></a>00119                                             <a class="code" href="struct__fors__star.html">fors_star</a> *star);
-<a name="l00120"></a>00120 
-<a name="l00121"></a>00121 <span class="keywordtype">void</span>
-<a name="l00122"></a>00122 <a class="code" href="group__fors__photometry.html#gff8105d58698d673632960edbd21f26c">entry_delete</a>(                               <a class="code" href="structentry.html">entry</a> **e);
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00125"></a>00125 <a class="code" href="group__fors__photometry.html#g704bbcab4ba8418ff88419511eb5092b">entry_delete_but_standard</a>(                  <a class="code" href="structentry.html">entry</a> **e);
-<a name="l00126"></a>00126 
-<a name="l00127"></a>00127 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00128"></a>00128 <a class="code" href="group__fors__photometry.html#gc10eb374497333bc41f877a56ff3bf94">entry_get_powers_x_y</a>(                       <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a> *e,
-<a name="l00129"></a>00129                                             <span class="keyword">const</span> cpl_array *powers);
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131 <span class="keywordtype">void</span>
-<a name="l00132"></a>00132 <a class="code" href="group__fors__photometry.html#g62dd2afbab9508f260ddcc65d8e00f80">entry_list_print</a>(                           <span class="keyword">const</span> entry_list *l,
-<a name="l00133"></a>00133                                             cpl_msg_severity level);
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00136"></a>00136 <a class="code" href="group__fors__photometry.html#g4b6948f2884a7356d77f747894bdfd8f">entry_get_powers_airmass_color</a>(             <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a> *e,
-<a name="l00137"></a>00137                                             <span class="keyword">const</span> cpl_array *powers);
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139 <span class="keyword">static</span> entry_list *
-<a name="l00140"></a>00140 <a class="code" href="group__fors__photometry.html#gd9e3544d21c84d8a62c36b859b2a4bcf">fors_photometry_read_input</a>(                 <span class="keyword">const</span> cpl_frameset  *alphot_frames,
-<a name="l00141"></a>00141                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a>  *setting,
-<a name="l00142"></a>00142                                             <span class="keywordtype">int</span> (*get_atm_ext_id_function)(
-<a name="l00143"></a>00143                                                 <span class="keyword">const</span> cpl_propertylist *header),
-<a name="l00144"></a>00144                                             <span class="keywordtype">bool</span>                import_unknown,
-<a name="l00145"></a>00145                                             <span class="keywordtype">int</span>                 *n_frames,
-<a name="l00146"></a>00146                                             fors_std_star_list  **std_star_list,
-<a name="l00147"></a>00147                                             <span class="keywordtype">int</span>                 filter
-<a name="l00148"></a>00148                                             );
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150 <span class="keyword">static</span> fors_std_star*
-<a name="l00151"></a>00151 <a class="code" href="group__fors__photometry.html#g99be8a6361832a8a2592304da84bc62b">fors_photometry_read_input_listinsert_star_if_new</a>(
-<a name="l00152"></a>00152                                             fors_std_star_list  *std_list,
-<a name="l00153"></a>00153                                             fors_std_star       *std,
-<a name="l00154"></a>00154                                             <span class="keywordtype">double</span>              mind_arcsec);
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00157"></a>00157 <a class="code" href="group__fors__photometry.html#g27249fb4bf764484d9f553c100e2e2b8">fors_delete_star_lists</a>(                     entry_list          **el,
-<a name="l00158"></a>00158                                             fors_std_star_list  **sl);
-<a name="l00159"></a>00159 
-<a name="l00160"></a>00160 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00161"></a>00161 <a class="code" href="group__fors__photometry.html#gedafdf97c6e7c236d39fe16f9c459953">fors_fits_compare_string</a>(                   <span class="keyword">const</span> <span class="keywordtype">char</span>  *s1,
-<a name="l00162"></a>00162                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *s2);
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00165"></a>00165 <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(                           cpl_matrix  **m);
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00168"></a>00168 <a class="code" href="group__fors__photometry.html#g99631efe7a94de4d3f563bfff57dc19a">fors_matrix_append_delete</a>(                  cpl_matrix  **m1,
-<a name="l00169"></a>00169                                             cpl_matrix  **m2);
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00172"></a>00172 <a class="code" href="group__fors__photometry.html#gd7a4fa7744d0bb4be55c0dfbd1138674">fors_property_get_num</a>(                      <span class="keyword">const</span> cpl_property  *prop);
-<a name="l00173"></a>00173 
-<a name="l00174"></a>00174 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00175"></a>00175 <a class="code" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">fors_photometry_parameter_get_num</a>(          <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00176"></a>00176                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name,
-<a name="l00177"></a>00177                                             cpl_type                type);
-<a name="l00178"></a>00178 
-<a name="l00179"></a>00179 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*
-<a name="l00180"></a>00180 <a class="code" href="group__fors__photometry.html#gbb4b72778a8958b36dff0ffa63f9e6ea">fors_photometry_parameter_get_string</a>(       <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00181"></a>00181                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name);
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183 <span class="keyword">static</span> <a class="code" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a>
-<a name="l00184"></a>00184 <a class="code" href="group__fors__photometry.html#g62ed7eadbdb3468fee3078879e13f25c">fors_photometry_parameter_get_ncoeff</a>(       <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00185"></a>00185                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name);
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187 <span class="keywordtype">void</span> <a class="code" href="group__fors__photometry.html#gecc363f8be41aa6d224d6f604d5a6b30">fors_photometry_define_parameters</a>(     cpl_parameterlist   *parameters);
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189 <span class="keyword">static</span> cpl_polynomial*
-<a name="l00190"></a>00190 <a class="code" href="group__fors__photometry.html#ge8d0a82d52e920497d6a5efd435760c6">fors_photometry_define_polyf</a>(               <span class="keywordtype">int</span>                 degreef1,
-<a name="l00191"></a>00191                                             <span class="keywordtype">int</span>                 degreef2);
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193 <span class="keyword">static</span> cpl_polynomial*
-<a name="l00194"></a>00194 <a class="code" href="group__fors__photometry.html#ga8ebd4e57d8df9c4fb26a5ea59d52182">fors_photometry_define_polyp</a>(               <span class="keywordtype">int</span>                 degreep);
-<a name="l00195"></a>00195 
-<a name="l00196"></a>00196 <span class="keyword">static</span> cpl_error_code
-<a name="l00197"></a>00197 <a class="code" href="group__fors__photometry.html#ga9ee56261da033d2a3ff241a68569522">fors_photometry_poly_new_from_coefficients</a>( <span class="keyword">const</span> cpl_polynomial    *p_def,
-<a name="l00198"></a>00198                                             <span class="keyword">const</span> cpl_matrix        *coeffs,
-<a name="l00199"></a>00199                                             <span class="keyword">const</span> cpl_matrix        *cov_coeffs,
-<a name="l00200"></a>00200                                             cpl_polynomial          **poly,
-<a name="l00201"></a>00201                                             cpl_polynomial          **var_poly);
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203 <span class="keywordtype">int</span>
-<a name="l00204"></a>00204 <a class="code" href="group__fors__photometry.html#g105a6893a27ad23d6ef02cc271f42c30">fors_photometry_get_timezone_observer</a>(      <span class="keyword">const</span> cpl_propertylist  *header);
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206 <span class="keywordtype">int</span>
-<a name="l00207"></a>00207 <a class="code" href="group__fors__photometry.html#g294b0010ae795af85c28da476abadb18">fors_photometry_get_night_id</a>(               <span class="keyword">const</span> cpl_propertylist *header);
-<a name="l00208"></a>00208 
-<a name="l00209"></a>00209 <span class="keyword">static</span> <span class="keywordtype">int</span>
-<a name="l00210"></a>00210 <a class="code" href="group__fors__photometry.html#g951ded14339fa018b98cbf21a332c7cf">fors_photometry_atm_ext_create_index_by_identifier</a>(
-<a name="l00211"></a>00211                                             entry_list          *obs_list);
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213 <span class="keyword">static</span> <span class="keywordtype">int</span>
-<a name="l00214"></a>00214 <a class="code" href="group__fors__photometry.html#g1491e01ccadf9b6d6b85316dfffd7f86">fors_photometry_atm_ext_create_indices</a>(     entry_list      *obsl,
-<a name="l00215"></a>00215                                             <a class="code" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> fit_e);
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217 <span class="comment">//static cpl_error_code</span>
-<a name="l00218"></a>00218 <span class="keyword">static</span> cpl_table *
-<a name="l00219"></a>00219 <a class="code" href="group__fors__photometry.html#ga3a88672675c12a7d6f30f9e6cc1459a">fors_photometry_atm_ext_print_index_by_framename</a>(
-<a name="l00220"></a>00220                                             <span class="keyword">const</span> entry_list    *obs_list,
-<a name="l00221"></a>00221                                             <span class="keyword">const</span> cpl_frameset  *frames);
-<a name="l00222"></a>00222 
-<a name="l00223"></a>00223 <span class="keyword">static</span> cpl_error_code
-<a name="l00224"></a>00224 <a class="code" href="group__fors__photometry.html#gfe5618566936c6f9809d639f9148ce4d">fors_photometry_check_input_value</a>(          <span class="keywordtype">double</span>      value,
-<a name="l00225"></a>00225                                             <span class="keywordtype">double</span>      value_error,
-<a name="l00226"></a>00226                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *value_name,
-<a name="l00227"></a>00227                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *input_name,
-<a name="l00228"></a>00228                                             <span class="keywordtype">double</span>      min_limit,
-<a name="l00229"></a>00229                                             <span class="keywordtype">double</span>      max_limit,
-<a name="l00230"></a>00230                                             <span class="keywordtype">double</span>      max_error);
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232 <span class="keyword">static</span> cpl_error_code
-<a name="l00233"></a>00233 <a class="code" href="group__fors__photometry.html#g7a7ad98c36de98c254af8f74f436a347">fors_photometry_check_fitparam_atm_ext</a>(     entry_list      *obsl,
-<a name="l00234"></a>00234                                             <a class="code" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> fit_e,
-<a name="l00235"></a>00235                                             <span class="keywordtype">bool</span>            fit_z);
-<a name="l00236"></a>00236 
-<a name="l00237"></a>00237 <span class="keyword">static</span> cpl_error_code
-<a name="l00238"></a>00238 <a class="code" href="group__fors__photometry.html#g07d83baf5879b02b0224e2eb59390bed">fors_photometry_adjust_fit_mag_flags</a>(       fors_std_star_list  *stdl,
-<a name="l00239"></a>00239                                             entry_list          *obsl,
-<a name="l00240"></a>00240                                             <span class="keywordtype">bool</span>                override_fit_m,
-<a name="l00241"></a>00241                                             <span class="keywordtype">int</span>                 *n_mag_fits);
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243 <span class="keyword">static</span> cpl_error_code
-<a name="l00244"></a>00244 <a class="code" href="group__fors__photometry.html#gb82262e58905a5f0d047cf607614aa6d">fors_photometry_remove_unnecessary</a>(         fors_std_star_list  *std_list,
-<a name="l00245"></a>00245                                             entry_list          *obs_list,
-<a name="l00246"></a>00246                                             <span class="keywordtype">int</span>                 *n_mag_fits);
-<a name="l00247"></a>00247 
-<a name="l00248"></a>00248 <span class="keyword">static</span> cpl_array*
-<a name="l00249"></a>00249 <a class="code" href="group__fors__photometry.html#gbb6ba893e672e51a2a83674b93fe4733">fors_photometry_count_observations</a>(         fors_std_star_list  *std_list,
-<a name="l00250"></a>00250                                             entry_list          *obs_list);
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252 <span class="keyword">static</span> cpl_matrix*
-<a name="l00253"></a>00253 <a class="code" href="group__fors__photometry.html#gb269a10fede882f376f2e599965cebe4">build_equations_lhs_matrix_from_parameters</a>( <span class="keyword">const</span> entry_list    *obs_list,
-<a name="l00254"></a>00254                                             <span class="keyword">const</span> fors_std_star_list  *std_list,
-<a name="l00255"></a>00255                                             <span class="keywordtype">bool</span>                fit_z,
-<a name="l00256"></a>00256                                             <span class="keywordtype">bool</span>                fit_c,
-<a name="l00257"></a>00257                                             <span class="keywordtype">int</span>                 *n_fit_e_cols);
-<a name="l00258"></a>00258 
-<a name="l00259"></a>00259 <span class="keyword">static</span> cpl_matrix*
-<a name="l00260"></a>00260 <a class="code" href="group__fors__photometry.html#g55817cb490a2517ef207f96a9cf51b8b">build_equations_lhs_matrix_from_poly</a>(       <span class="keyword">const</span> entry_list        *obs_list,
-<a name="l00261"></a>00261                                             <span class="keyword">const</span> cpl_polynomial    *poly,
-<a name="l00262"></a>00262                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *pname,
-<a name="l00263"></a>00263                                             <span class="keywordtype">double</span> (*powerfunc)(
-<a name="l00264"></a>00264                                                             <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>*,
-<a name="l00265"></a>00265                                                             <span class="keyword">const</span> cpl_array*));
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267 <span class="keyword">static</span> cpl_error_code
-<a name="l00268"></a>00268 <a class="code" href="group__fors__photometry.html#ge2d3cb795a4f549322f1febff5596787">build_equations_rhs_cov</a>(                    <span class="keyword">const</span> entry_list    *obs_list,
-<a name="l00269"></a>00269                                             <span class="keyword">const</span> fors_std_star_list  *std_list,
-<a name="l00270"></a>00270                                             <span class="keywordtype">bool</span>                fit_z,
-<a name="l00271"></a>00271                                             <span class="keywordtype">bool</span>                fit_c,
-<a name="l00272"></a>00272                                             <span class="keywordtype">bool</span>                fit_e,
-<a name="l00273"></a>00273                                             <span class="keywordtype">double</span>              color_coeff,
-<a name="l00274"></a>00274                                             <span class="keywordtype">double</span>              dcolor_coeff,
-<a name="l00275"></a>00275                                             <span class="keywordtype">double</span>              ext_coeff,
-<a name="l00276"></a>00276                                             <span class="keywordtype">double</span>              dext_coeff,
-<a name="l00277"></a>00277                                             <span class="keywordtype">double</span>              zpoint,
-<a name="l00278"></a>00278                                             <span class="keywordtype">double</span>              dzpoint,
-<a name="l00279"></a>00279                                             cpl_matrix          **rhs,
-<a name="l00280"></a>00280                                             cpl_matrix          **rhs_cov);
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00288"></a>00288 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00289"></a><a class="code" href="group__fors__photometry.html#gc4cfb3c0bdf31be44324adffdb6277a1">00289</a> <a class="code" href="structentry.html">entry</a> *<a class="code" href="group__fors__photometry.html#gc4cfb3c0bdf31be44324adffdb6277a1">entry_new</a>(                           <span class="keywordtype">int</span>     frame_index,
-<a name="l00290"></a>00290                                             <span class="keywordtype">int</span>     star_index,
-<a name="l00291"></a>00291                                             <span class="keywordtype">double</span>  airmass,
-<a name="l00292"></a>00292                                             <span class="keywordtype">double</span>  gain,
-<a name="l00293"></a>00293                                             <span class="keywordtype">double</span>  exptime,
-<a name="l00294"></a>00294                                             <span class="keywordtype">int</span>     atm_ext_identifier,
-<a name="l00295"></a>00295                                             <a class="code" href="struct__fors__star.html">fors_star</a> *star)
-<a name="l00296"></a>00296 {
-<a name="l00297"></a>00297     <a class="code" href="structentry.html">entry</a> *e = cpl_malloc(<span class="keyword">sizeof</span>(*e));
-<a name="l00298"></a>00298 
-<a name="l00299"></a>00299     e->frame_index = frame_index;
-<a name="l00300"></a>00300     e->star_index = star_index;
-<a name="l00301"></a>00301     e->atm_ext_index = -1;  <span class="comment">/* means undefined */</span>
-<a name="l00302"></a>00302     e->airmass = airmass;
-<a name="l00303"></a>00303     e->gain = gain;
-<a name="l00304"></a>00304     e->exptime = exptime;
-<a name="l00305"></a>00305     
-<a name="l00306"></a>00306     e->atm_ext_identifier = atm_ext_identifier;
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308     e->star = star;
-<a name="l00309"></a>00309     
-<a name="l00310"></a>00310     <span class="keywordflow">return</span> e;
-<a name="l00311"></a>00311 }
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00318"></a>00318 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00319"></a>00319 <span class="keywordtype">void</span>
-<a name="l00320"></a><a class="code" href="group__fors__photometry.html#gff8105d58698d673632960edbd21f26c">00320</a> <a class="code" href="group__fors__photometry.html#gff8105d58698d673632960edbd21f26c">entry_delete</a>(                               <a class="code" href="structentry.html">entry</a> **e)
-<a name="l00321"></a>00321 {
-<a name="l00322"></a>00322     <span class="keywordflow">if</span> (e && *e) {
-<a name="l00323"></a>00323         <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>(&(*e)->star);
-<a name="l00324"></a>00324         cpl_free(*e); *e = NULL;
-<a name="l00325"></a>00325     }
-<a name="l00326"></a>00326     <span class="keywordflow">return</span>;
-<a name="l00327"></a>00327 }
-<a name="l00328"></a>00328 
-<a name="l00329"></a>00329 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00334"></a>00334 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00335"></a>00335 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00336"></a><a class="code" href="group__fors__photometry.html#g704bbcab4ba8418ff88419511eb5092b">00336</a> <a class="code" href="group__fors__photometry.html#g704bbcab4ba8418ff88419511eb5092b">entry_delete_but_standard</a>(                  <a class="code" href="structentry.html">entry</a> **e)
-<a name="l00337"></a>00337 {
-<a name="l00338"></a>00338     <span class="keywordflow">if</span> (e && *e) {
-<a name="l00339"></a>00339         <a class="code" href="group__fors__star.html#g40fa6037fee74abd5a9d5166137609e0">fors_star_delete_but_standard</a>(&(*e)->star);
-<a name="l00340"></a>00340         cpl_free(*e); *e = NULL;
-<a name="l00341"></a>00341     }
-<a name="l00342"></a>00342     <span class="keywordflow">return</span>;
-<a name="l00343"></a>00343 }
-<a name="l00344"></a>00344 
-<a name="l00345"></a>00345 
-<a name="l00346"></a>00346 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00352"></a>00352 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00353"></a>00353 <span class="keywordtype">void</span>
-<a name="l00354"></a><a class="code" href="group__fors__photometry.html#g62dd2afbab9508f260ddcc65d8e00f80">00354</a> <a class="code" href="group__fors__photometry.html#g62dd2afbab9508f260ddcc65d8e00f80">entry_list_print</a>(                           <span class="keyword">const</span> entry_list *l,
-<a name="l00355"></a>00355                                             cpl_msg_severity level)
-<a name="l00356"></a>00356 {
-<a name="l00357"></a>00357     <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a> *e;
-<a name="l00358"></a>00358     
-<a name="l00359"></a>00359     fors_msg(level, <span class="stringliteral">"Observation list:"</span>);
-<a name="l00360"></a>00360     cpl_msg_indent_more();
-<a name="l00361"></a>00361     <span class="keywordflow">for</span> (e = entry_list_first_const(l);
-<a name="l00362"></a>00362          e != NULL;
-<a name="l00363"></a>00363          e = entry_list_next_const(l)) {
-<a name="l00364"></a>00364 
-<a name="l00365"></a>00365         fors_msg(level,
-<a name="l00366"></a>00366                  <span class="stringliteral">"frame %d, star %d: airmass = %f, gain = %f, exptime = %f s"</span>,
-<a name="l00367"></a>00367                  e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a>, e-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a>,
-<a name="l00368"></a>00368                  e-><a class="code" href="structentry.html#6f585239f5d6905b0cff05055d77bf9c">airmass</a>, e-><a class="code" href="structentry.html#9094c40ac744faa1135a2773f85ba1ff">gain</a>, e-><a class="code" href="structentry.html#3e422ef6bc06e1e9c3d2dad3ec2f972b">exptime</a>);
-<a name="l00369"></a>00369 
-<a name="l00370"></a>00370         <a class="code" href="group__fors__star.html#g89b5801d41c9760d82ec12097e14b584">fors_star_print</a>(level, e-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>);
-<a name="l00371"></a>00371     }
-<a name="l00372"></a>00372     cpl_msg_indent_less();
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374     <span class="keywordflow">return</span>;
-<a name="l00375"></a>00375 }
-<a name="l00376"></a>00376 
-<a name="l00377"></a>00377 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00378"></a>00378 <span class="preprocessor">#undef cleanup</span>
-<a name="l00379"></a>00379 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00380"></a>00380 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00381"></a>00381 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00382"></a><a class="code" href="group__fors__photometry.html#gc10eb374497333bc41f877a56ff3bf94">00382</a> <a class="code" href="group__fors__photometry.html#gc10eb374497333bc41f877a56ff3bf94">entry_get_powers_x_y</a>(                       <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>     *e,
-<a name="l00383"></a>00383                                             <span class="keyword">const</span> cpl_array *powers)
-<a name="l00384"></a>00384 {
-<a name="l00385"></a>00385     passure(powers != NULL && e != NULL, <span class="keywordflow">return</span> sqrt(-1));  <span class="comment">/* return NaN */</span>
-<a name="l00386"></a>00386     passure(cpl_array_get_size(powers) == 2, <span class="keywordflow">return</span> sqrt(-1));
-<a name="l00387"></a>00387     <span class="keywordflow">return</span>  pow(e-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x,      cpl_array_get(powers, 0, NULL))
-<a name="l00388"></a>00388             * pow(e-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y,    cpl_array_get(powers, 1, NULL));
-<a name="l00389"></a>00389 }
-<a name="l00390"></a>00390 
-<a name="l00391"></a>00391 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00392"></a>00392 <span class="preprocessor">#undef cleanup</span>
-<a name="l00393"></a>00393 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00394"></a>00394 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00395"></a>00395 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00396"></a><a class="code" href="group__fors__photometry.html#g4b6948f2884a7356d77f747894bdfd8f">00396</a> <a class="code" href="group__fors__photometry.html#g4b6948f2884a7356d77f747894bdfd8f">entry_get_powers_airmass_color</a>(             <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a> *e,
-<a name="l00397"></a>00397                                             <span class="keyword">const</span> cpl_array *powers)
-<a name="l00398"></a>00398 {
-<a name="l00399"></a>00399     passure(powers != NULL && e != NULL, <span class="keywordflow">return</span> sqrt(-1));  <span class="comment">/* return NaN */</span>
-<a name="l00400"></a>00400     passure(cpl_array_get_size(powers) == 2, <span class="keywordflow">return</span> sqrt(-1));
-<a name="l00401"></a>00401     <span class="keywordflow">return</span>  pow(e-><a class="code" href="structentry.html#6f585239f5d6905b0cff05055d77bf9c">airmass</a>,             cpl_array_get(powers, 0, NULL))
-<a name="l00402"></a>00402             * pow(e-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->color,   cpl_array_get(powers, 1, NULL));
-<a name="l00403"></a>00403 }
-<a name="l00404"></a>00404 
-<a name="l00405"></a>00405 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00412"></a>00412 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00413"></a>00413 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00414"></a><a class="code" href="group__fors__photometry.html#g27249fb4bf764484d9f553c100e2e2b8">00414</a> <a class="code" href="group__fors__photometry.html#g27249fb4bf764484d9f553c100e2e2b8">fors_delete_star_lists</a>(                     entry_list          **el,
-<a name="l00415"></a>00415                                             fors_std_star_list  **sl)
-<a name="l00416"></a>00416 {
-<a name="l00417"></a>00417     <a class="code" href="structentry.html">entry</a> *e;
-<a name="l00418"></a>00418     <span class="keywordflow">if</span> (el != NULL && *el != NULL)
-<a name="l00419"></a>00419     {
-<a name="l00420"></a>00420         <span class="keywordflow">for</span> (   e = entry_list_first(*el);
-<a name="l00421"></a>00421                 e != NULL;
-<a name="l00422"></a>00422                 e = entry_list_next(*el))
-<a name="l00423"></a>00423         {
-<a name="l00424"></a>00424             e-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> = NULL;
-<a name="l00425"></a>00425         }
-<a name="l00426"></a>00426     }
-<a name="l00427"></a>00427     
-<a name="l00428"></a>00428     fors_std_star_list_delete(sl, fors_std_star_delete);
-<a name="l00429"></a>00429     entry_list_delete(el, <a class="code" href="group__fors__photometry.html#gff8105d58698d673632960edbd21f26c">entry_delete</a>);
-<a name="l00430"></a>00430 }
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00441"></a>00441 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00442"></a>00442 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00443"></a><a class="code" href="group__fors__photometry.html#gedafdf97c6e7c236d39fe16f9c459953">00443</a> <a class="code" href="group__fors__photometry.html#gedafdf97c6e7c236d39fe16f9c459953">fors_fits_compare_string</a>(                   <span class="keyword">const</span> <span class="keywordtype">char</span>  *s1,
-<a name="l00444"></a>00444                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *s2)
-<a name="l00445"></a>00445 {
-<a name="l00446"></a>00446     <span class="keyword">const</span> <span class="keywordtype">char</span>  *m1 = <span class="stringliteral">""</span>,
-<a name="l00447"></a>00447                 *m2 = <span class="stringliteral">""</span>;
-<a name="l00448"></a>00448     <span class="keywordtype">int</span>         len1,
-<a name="l00449"></a>00449                 len2;
-<a name="l00450"></a>00450     
-<a name="l00451"></a>00451     <span class="keywordflow">if</span> (s1 != NULL)
-<a name="l00452"></a>00452         m1 = s1;
-<a name="l00453"></a>00453     <span class="keywordflow">if</span> (s2 != NULL)
-<a name="l00454"></a>00454         m2 = s2;
-<a name="l00455"></a>00455     
-<a name="l00456"></a>00456     len1 = strlen(m1);
-<a name="l00457"></a>00457     len2 = strlen(m2);
-<a name="l00458"></a>00458     
-<a name="l00459"></a>00459     <span class="keywordflow">while</span> (len1 > 0 && m1[len1-1] == <span class="charliteral">' '</span>) len1--;
-<a name="l00460"></a>00460     <span class="keywordflow">while</span> (len2 > 0 && m2[len2-1] == <span class="charliteral">' '</span>) len2--;
-<a name="l00461"></a>00461     
-<a name="l00462"></a>00462     <span class="keywordflow">if</span> (len1 != len2)
-<a name="l00463"></a>00463         <span class="keywordflow">return</span> <span class="keyword">false</span>;
-<a name="l00464"></a>00464     
-<a name="l00465"></a>00465     <span class="keywordflow">if</span> (strncmp(m1, m2, len1) != 0)
-<a name="l00466"></a>00466         <span class="keywordflow">return</span> <span class="keyword">false</span>;
-<a name="l00467"></a>00467     
-<a name="l00468"></a>00468     <span class="keywordflow">return</span> <span class="keyword">true</span>;
-<a name="l00469"></a>00469 }
-<a name="l00470"></a>00470 
-<a name="l00471"></a>00471 
-<a name="l00472"></a>00472 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00478"></a>00478 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00479"></a>00479 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00480"></a><a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">00480</a> <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(                           cpl_matrix    **m)
-<a name="l00481"></a>00481 {
-<a name="l00482"></a>00482     <span class="keywordflow">if</span> (m != NULL)
-<a name="l00483"></a>00483     {
-<a name="l00484"></a>00484         cpl_matrix_delete(*m);
-<a name="l00485"></a>00485         *m = NULL;
-<a name="l00486"></a>00486     }
-<a name="l00487"></a>00487 }
-<a name="l00488"></a>00488 
-<a name="l00489"></a>00489 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00490"></a>00490 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00491"></a>00491 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00492"></a><a class="code" href="group__fors__photometry.html#g99631efe7a94de4d3f563bfff57dc19a">00492</a> <a class="code" href="group__fors__photometry.html#g99631efe7a94de4d3f563bfff57dc19a">fors_matrix_append_delete</a>(                  cpl_matrix  **m1,
-<a name="l00493"></a>00493                                             cpl_matrix  **m2)
-<a name="l00494"></a>00494 {
-<a name="l00495"></a>00495     <span class="keywordflow">if</span> (m1 == NULL || m2 == NULL)
-<a name="l00496"></a>00496         <span class="keywordflow">return</span>;
-<a name="l00497"></a>00497     
-<a name="l00498"></a>00498     <span class="keywordflow">if</span> (*m2 != NULL)
-<a name="l00499"></a>00499     {
-<a name="l00500"></a>00500         <span class="keywordflow">if</span> (*m1 == NULL)
-<a name="l00501"></a>00501         {
-<a name="l00502"></a>00502             *m1 = *m2;
-<a name="l00503"></a>00503             *m2 = NULL;
-<a name="l00504"></a>00504         }
-<a name="l00505"></a>00505         <span class="keywordflow">else</span>
-<a name="l00506"></a>00506         {
-<a name="l00507"></a>00507             cpl_matrix_append(*m1, *m2, 0);
-<a name="l00508"></a>00508             <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(m2);
-<a name="l00509"></a>00509         }
-<a name="l00510"></a>00510     }
-<a name="l00511"></a>00511     <span class="comment">/* else do nothing */</span>
-<a name="l00512"></a>00512 }
-<a name="l00513"></a>00513 
-<a name="l00514"></a>00514 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00515"></a>00515 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00516"></a>00516 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00517"></a><a class="code" href="group__fors__photometry.html#gd7a4fa7744d0bb4be55c0dfbd1138674">00517</a> <a class="code" href="group__fors__photometry.html#gd7a4fa7744d0bb4be55c0dfbd1138674">fors_property_get_num</a>(                      <span class="keyword">const</span> cpl_property  *prop)
-<a name="l00518"></a>00518 {
-<a name="l00519"></a>00519     <span class="keywordtype">double</span>      retval = 0;
-<a name="l00520"></a>00520     cpl_type    type;
-<a name="l00521"></a>00521     
-<a name="l00522"></a>00522     cassure_automsg(                        prop != NULL,
-<a name="l00523"></a>00523                                             CPL_ERROR_NULL_INPUT,
-<a name="l00524"></a>00524                                             <span class="keywordflow">return</span> 0);
-<a name="l00525"></a>00525     
-<a name="l00526"></a>00526     type = cpl_property_get_type(prop);
-<a name="l00527"></a>00527     
-<a name="l00528"></a>00528     <span class="keywordflow">switch</span> (type)
-<a name="l00529"></a>00529     {
-<a name="l00530"></a>00530         <span class="keywordflow">case</span> CPL_TYPE_BOOL:
-<a name="l00531"></a>00531             retval = cpl_property_get_bool(prop);
-<a name="l00532"></a>00532             <span class="keywordflow">break</span>;
-<a name="l00533"></a>00533         <span class="keywordflow">case</span> CPL_TYPE_INT:
-<a name="l00534"></a>00534             retval = cpl_property_get_int(prop);
-<a name="l00535"></a>00535             <span class="keywordflow">break</span>;
-<a name="l00536"></a>00536         <span class="keywordflow">case</span> CPL_TYPE_FLOAT:
-<a name="l00537"></a>00537             retval = cpl_property_get_float(prop);
-<a name="l00538"></a>00538             <span class="keywordflow">break</span>;
-<a name="l00539"></a>00539         <span class="keywordflow">case</span> CPL_TYPE_DOUBLE:
-<a name="l00540"></a>00540             retval = cpl_property_get_double(prop);
-<a name="l00541"></a>00541             <span class="keywordflow">break</span>;
-<a name="l00542"></a>00542         <span class="keywordflow">default</span>:
-<a name="l00543"></a>00543             cpl_error_set_message(  cpl_func, CPL_ERROR_INVALID_TYPE,
-<a name="l00544"></a>00544                                     <span class="stringliteral">"type must be bool, int, float or double"</span>);
-<a name="l00545"></a>00545     }
-<a name="l00546"></a>00546     
-<a name="l00547"></a>00547     <span class="keywordflow">switch</span> (type)
-<a name="l00548"></a>00548     {
-<a name="l00549"></a>00549         <span class="keywordflow">case</span> CPL_TYPE_BOOL:
-<a name="l00550"></a>00550             <span class="keywordflow">return</span> (fabs(retval) > 0.5) ? 1 : 0;
-<a name="l00551"></a>00551         <span class="keywordflow">case</span> CPL_TYPE_INT:
-<a name="l00552"></a>00552             <span class="keywordflow">return</span> round(retval);
-<a name="l00553"></a>00553         <span class="keywordflow">default</span>:
-<a name="l00554"></a>00554             <span class="keywordflow">return</span> retval;
-<a name="l00555"></a>00555     }
-<a name="l00556"></a>00556 }
-<a name="l00557"></a>00557 
-<a name="l00558"></a>00558 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00559"></a>00559 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00560"></a>00560 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00561"></a><a class="code" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">00561</a> <a class="code" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">fors_photometry_parameter_get_num</a>(          <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00562"></a>00562                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name,
-<a name="l00563"></a>00563                                             cpl_type                type)
-<a name="l00564"></a>00564 {
-<a name="l00565"></a>00565     <span class="keywordtype">char</span>  *descriptor;
-<a name="l00566"></a>00566     <span class="keywordtype">double</span>      retval = -1;
-<a name="l00567"></a>00567     
-<a name="l00568"></a>00568     cpl_msg_indent_more();
-<a name="l00569"></a>00569     descriptor = cpl_sprintf(<span class="stringliteral">"fors.%s.%s"</span>, <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a>, name);
-<a name="l00570"></a>00570     <span class="keywordflow">switch</span> (type)
-<a name="l00571"></a>00571     {
-<a name="l00572"></a>00572         <span class="keywordflow">case</span> CPL_TYPE_BOOL:
-<a name="l00573"></a>00573             retval = <a class="code" href="group__forsdfs.html#gfce5eddb71d8700b30c690f49374d2e0">dfs_get_parameter_bool_const</a>(parameters, descriptor);
-<a name="l00574"></a>00574             <span class="keywordflow">break</span>;
-<a name="l00575"></a>00575         <span class="keywordflow">case</span> CPL_TYPE_INT:
-<a name="l00576"></a>00576             retval = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parameters, descriptor);
-<a name="l00577"></a>00577             <span class="keywordflow">break</span>;
-<a name="l00578"></a>00578 <span class="comment">/*        case CPL_TYPE_FLOAT:</span>
-<a name="l00579"></a>00579 <span class="comment">            retval = dfs_get_parameter_float_const(parameters, descriptor);</span>
-<a name="l00580"></a>00580 <span class="comment">            break;*/</span>
-<a name="l00581"></a>00581         <span class="keywordflow">case</span> CPL_TYPE_DOUBLE:
-<a name="l00582"></a>00582             retval = <a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a>(parameters, descriptor);
-<a name="l00583"></a>00583             <span class="keywordflow">break</span>;
-<a name="l00584"></a>00584         <span class="keywordflow">default</span>:
-<a name="l00585"></a>00585             cpl_error_set_message(  cpl_func, CPL_ERROR_INVALID_TYPE,
-<a name="l00586"></a>00586                                     <span class="stringliteral">"type must be bool, int"</span>
-<a name="l00587"></a>00587                                     <span class="comment">/*", float"*/</span>
-<a name="l00588"></a>00588                                     <span class="stringliteral">" or double"</span>);
-<a name="l00589"></a>00589     }
-<a name="l00590"></a>00590     cpl_free(descriptor);
-<a name="l00591"></a>00591     cpl_msg_indent_less();
-<a name="l00592"></a>00592     
-<a name="l00593"></a>00593     <span class="keywordflow">switch</span> (type)
-<a name="l00594"></a>00594     {
-<a name="l00595"></a>00595         <span class="keywordflow">case</span> CPL_TYPE_BOOL:
-<a name="l00596"></a>00596             <span class="keywordflow">return</span> (fabs(retval) > 0.5) ? <span class="keyword">true</span> : <span class="keyword">false</span>;
-<a name="l00597"></a>00597         <span class="keywordflow">case</span> CPL_TYPE_INT:
-<a name="l00598"></a>00598             <span class="keywordflow">return</span> round(retval);
-<a name="l00599"></a>00599         <span class="keywordflow">default</span>:
-<a name="l00600"></a>00600             <span class="keywordflow">return</span> retval;
-<a name="l00601"></a>00601     }
-<a name="l00602"></a>00602 }
-<a name="l00603"></a>00603 
-<a name="l00604"></a>00604 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00605"></a>00605 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00606"></a>00606 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*
-<a name="l00607"></a><a class="code" href="group__fors__photometry.html#gbb4b72778a8958b36dff0ffa63f9e6ea">00607</a> <a class="code" href="group__fors__photometry.html#gbb4b72778a8958b36dff0ffa63f9e6ea">fors_photometry_parameter_get_string</a>(       <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00608"></a>00608                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name)
-<a name="l00609"></a>00609 {
-<a name="l00610"></a>00610     <span class="keywordtype">char</span>        *descriptor;
-<a name="l00611"></a>00611     <span class="keyword">const</span> <span class="keywordtype">char</span>  *retval = NULL;
-<a name="l00612"></a>00612     
-<a name="l00613"></a>00613     cpl_msg_indent_more();
-<a name="l00614"></a>00614     descriptor = cpl_sprintf(<span class="stringliteral">"fors.%s.%s"</span>, <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a>, name);
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616     retval = <a class="code" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">dfs_get_parameter_string_const</a>(parameters, descriptor);
-<a name="l00617"></a>00617     
-<a name="l00618"></a>00618     cpl_free(descriptor);
-<a name="l00619"></a>00619     cpl_msg_indent_less();
-<a name="l00620"></a>00620     
-<a name="l00621"></a>00621     <span class="keywordflow">return</span> retval;
-<a name="l00622"></a>00622 }
-<a name="l00623"></a>00623 
-<a name="l00624"></a>00624 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00625"></a>00625 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00626"></a>00626 <span class="keyword">static</span> <a class="code" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a>
-<a name="l00627"></a><a class="code" href="group__fors__photometry.html#g62ed7eadbdb3468fee3078879e13f25c">00627</a> <a class="code" href="group__fors__photometry.html#g62ed7eadbdb3468fee3078879e13f25c">fors_photometry_parameter_get_ncoeff</a>(       <span class="keyword">const</span> cpl_parameterlist *parameters,
-<a name="l00628"></a>00628                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name)
-<a name="l00629"></a>00629 {
-<a name="l00630"></a>00630     <span class="keyword">const</span> <span class="keywordtype">char</span>  *fit_n_str;
-<a name="l00631"></a>00631     fit_n_str = <a class="code" href="group__fors__photometry.html#gbb4b72778a8958b36dff0ffa63f9e6ea">fors_photometry_parameter_get_string</a>(
-<a name="l00632"></a>00632                                             parameters,
-<a name="l00633"></a>00633                                             name);
-<a name="l00634"></a>00634     <span class="keywordflow">if</span> (fit_n_str == NULL)
-<a name="l00635"></a>00635     {
-<a name="l00636"></a>00636         cpl_error_set_message(              cpl_func,
-<a name="l00637"></a>00637                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00638"></a>00638                                             <span class="stringliteral">"parameter %s not found"</span>,
-<a name="l00639"></a>00639                                             name);
-<a name="l00640"></a>00640         <span class="keywordflow">return</span> -1;
-<a name="l00641"></a>00641     }
-<a name="l00642"></a>00642     
-<a name="l00643"></a>00643     <span class="keywordflow">if</span> (strcmp(fit_n_str, <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.no) == 0)
-<a name="l00644"></a>00644         <span class="keywordflow">return</span> FORS_FIT_NCOEFF_NO;
-<a name="l00645"></a>00645     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(fit_n_str, <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.one) == 0)
-<a name="l00646"></a>00646         <span class="keywordflow">return</span> FORS_FIT_NCOEFF_ONE;
-<a name="l00647"></a>00647     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(fit_n_str, <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.perframe)== 0)
-<a name="l00648"></a>00648         <span class="keywordflow">return</span> FORS_FIT_NCOEFF_PERFRAME;
-<a name="l00649"></a>00649     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(fit_n_str, <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.pernight)== 0)
-<a name="l00650"></a>00650         <span class="keywordflow">return</span> FORS_FIT_NCOEFF_PERNIGHT;
-<a name="l00651"></a>00651     <span class="keywordflow">else</span>
-<a name="l00652"></a>00652     {
-<a name="l00653"></a>00653         cpl_error_set_message(              cpl_func,
-<a name="l00654"></a>00654                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00655"></a>00655                                             <span class="stringliteral">"unknown parameter value \"%s\" "</span>
-<a name="l00656"></a>00656                                             <span class="stringliteral">"for %s"</span>,
-<a name="l00657"></a>00657                                             fit_n_str,
-<a name="l00658"></a>00658                                             name);
-<a name="l00659"></a>00659         <span class="keywordflow">return</span> -1;
-<a name="l00660"></a>00660     }
-<a name="l00661"></a>00661 }
-<a name="l00662"></a>00662 
-<a name="l00663"></a>00663 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00668"></a>00668 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00669"></a><a class="code" href="group__fors__photometry.html#gecc363f8be41aa6d224d6f604d5a6b30">00669</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__photometry.html#gecc363f8be41aa6d224d6f604d5a6b30">fors_photometry_define_parameters</a>(     cpl_parameterlist   *parameters)
-<a name="l00670"></a>00670 {
-<a name="l00671"></a>00671     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a>);
-<a name="l00672"></a>00672 
-<a name="l00673"></a>00673     <span class="keyword">const</span> <span class="keywordtype">char</span> *name, *full_name;
-<a name="l00674"></a>00674     cpl_parameter *p;
-<a name="l00675"></a>00675 
-<a name="l00676"></a>00676     name = <span class="stringliteral">"fitz"</span>;
-<a name="l00677"></a>00677     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00678"></a>00678     p = cpl_parameter_new_value(full_name,
-<a name="l00679"></a>00679                                 CPL_TYPE_BOOL,
-<a name="l00680"></a>00680                                 <span class="stringliteral">"Fit zeropoint"</span>,
-<a name="l00681"></a>00681                                 context,
-<a name="l00682"></a>00682                                 <span class="keyword">true</span>);
-<a name="l00683"></a>00683     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00684"></a>00684     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00685"></a>00685     cpl_parameterlist_append(parameters, p);
-<a name="l00686"></a>00686     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00687"></a>00687 
-<a name="l00688"></a>00688     name = <span class="stringliteral">"fit_all_mag"</span>;
-<a name="l00689"></a>00689     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00690"></a>00690     p = cpl_parameter_new_value(full_name,
-<a name="l00691"></a>00691                                 CPL_TYPE_BOOL,
-<a name="l00692"></a>00692                                 <span class="stringliteral">"Always fit star magnitudes"</span>,
-<a name="l00693"></a>00693                                 context,
-<a name="l00694"></a>00694                                 <span class="keyword">false</span>);
-<a name="l00695"></a>00695     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00696"></a>00696     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00697"></a>00697     cpl_parameterlist_append(parameters, p);
-<a name="l00698"></a>00698     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00699"></a>00699     
-<a name="l00700"></a>00700     name = <span class="stringliteral">"fite"</span>;
-<a name="l00701"></a>00701     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00702"></a>00702     p = cpl_parameter_new_enum( full_name,
-<a name="l00703"></a>00703                                 CPL_TYPE_STRING,
-<a name="l00704"></a>00704                                 <span class="stringliteral">"Fit atmospheric extinctions"</span>,
-<a name="l00705"></a>00705                                 context,
-<a name="l00706"></a>00706                                 <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.pernight,
-<a name="l00707"></a>00707                                 4,
-<a name="l00708"></a>00708                                 <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.no,
-<a name="l00709"></a>00709                                 <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.one,
-<a name="l00710"></a>00710                                 <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.perframe,
-<a name="l00711"></a>00711                                 <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.pernight);
-<a name="l00712"></a>00712     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00713"></a>00713     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00714"></a>00714     cpl_parameterlist_append(parameters, p);
-<a name="l00715"></a>00715     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00716"></a>00716 
-<a name="l00717"></a>00717     name = <span class="stringliteral">"fitc"</span>;
-<a name="l00718"></a>00718     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00719"></a>00719     p = cpl_parameter_new_value(full_name,
-<a name="l00720"></a>00720                                 CPL_TYPE_BOOL,
-<a name="l00721"></a>00721                                 <span class="stringliteral">"Fit color correction term"</span>,
-<a name="l00722"></a>00722                                 context,
-<a name="l00723"></a>00723                                 <span class="keyword">false</span>);
-<a name="l00724"></a>00724     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00725"></a>00725     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00726"></a>00726     cpl_parameterlist_append(parameters, p);
-<a name="l00727"></a>00727     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00728"></a>00728 
-<a name="l00729"></a>00729     name = <span class="stringliteral">"use_all_stars"</span>;
-<a name="l00730"></a>00730     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00731"></a>00731     p = cpl_parameter_new_value(full_name,
-<a name="l00732"></a>00732                                 CPL_TYPE_BOOL,
-<a name="l00733"></a>00733                                 <span class="stringliteral">"Use also non-standard stars to fit "</span>
-<a name="l00734"></a>00734                                 <span class="stringliteral">"polynomial f"</span>,
-<a name="l00735"></a>00735                                 context,
-<a name="l00736"></a>00736                                 <span class="keyword">false</span>);
-<a name="l00737"></a>00737     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00738"></a>00738     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00739"></a>00739     cpl_parameterlist_append(parameters, p);
-<a name="l00740"></a>00740     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00741"></a>00741 
-<a name="l00742"></a>00742     name = <span class="stringliteral">"degreef1"</span>;
-<a name="l00743"></a>00743     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00744"></a>00744     p = cpl_parameter_new_value(full_name,
-<a name="l00745"></a>00745                                 CPL_TYPE_INT,
-<a name="l00746"></a>00746                                 <span class="stringliteral">"FLatfield correction map polynomial degree "</span>
-<a name="l00747"></a>00747                                 <span class="stringliteral">"(x)"</span>,
-<a name="l00748"></a>00748                                 context,
-<a name="l00749"></a>00749                                 0);
-<a name="l00750"></a>00750     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00751"></a>00751     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00752"></a>00752     cpl_parameterlist_append(parameters, p);
-<a name="l00753"></a>00753     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00754"></a>00754 
-<a name="l00755"></a>00755     name = <span class="stringliteral">"degreef2"</span>;
-<a name="l00756"></a>00756     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00757"></a>00757     p = cpl_parameter_new_value(full_name,
-<a name="l00758"></a>00758                                 CPL_TYPE_INT,
-<a name="l00759"></a>00759                                 <span class="stringliteral">"Flatfield correction map polynomial degree "</span>
-<a name="l00760"></a>00760                                 <span class="stringliteral">"(y), or negative for "</span>
-<a name="l00761"></a>00761                                 <span class="stringliteral">"triangular coefficient matrix"</span>,
-<a name="l00762"></a>00762                                 context,
-<a name="l00763"></a>00763                                 -1);
-<a name="l00764"></a>00764     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00765"></a>00765     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00766"></a>00766     cpl_parameterlist_append(parameters, p);
-<a name="l00767"></a>00767     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00768"></a>00768 
-<a name="l00769"></a>00769     name = <span class="stringliteral">"degreep"</span>;
-<a name="l00770"></a>00770     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00771"></a>00771     p = cpl_parameter_new_value(full_name,
-<a name="l00772"></a>00772                                 CPL_TYPE_INT,
-<a name="l00773"></a>00773                                 <span class="stringliteral">"Extinction/color coupling degree"</span>,
-<a name="l00774"></a>00774                                 context,
-<a name="l00775"></a>00775                                 0);
-<a name="l00776"></a>00776     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00777"></a>00777     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00778"></a>00778     cpl_parameterlist_append(parameters, p);
-<a name="l00779"></a>00779     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00780"></a>00780 
-<a name="l00781"></a>00781     cpl_free((<span class="keywordtype">void</span> *)context);
-<a name="l00782"></a>00782 
-<a name="l00783"></a>00783     <span class="keywordflow">return</span>;
-<a name="l00784"></a>00784 }
-<a name="l00785"></a>00785 
-<a name="l00786"></a>00786 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00787"></a>00787 <span class="preprocessor">#undef cleanup</span>
-<a name="l00788"></a>00788 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00789"></a>00789 <span class="preprocessor">do { \</span>
-<a name="l00790"></a>00790 <span class="preprocessor">    cpl_polynomial_delete(polyf); polyf = NULL; \</span>
-<a name="l00791"></a>00791 <span class="preprocessor">} while (0)</span>
-<a name="l00792"></a>00792 <span class="preprocessor"></span>
-<a name="l00803"></a>00803 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00804"></a>00804 <span class="keyword">static</span> cpl_polynomial*
-<a name="l00805"></a><a class="code" href="group__fors__photometry.html#ge8d0a82d52e920497d6a5efd435760c6">00805</a> <a class="code" href="group__fors__photometry.html#ge8d0a82d52e920497d6a5efd435760c6">fors_photometry_define_polyf</a>(               <span class="keywordtype">int</span>                 degreef1,
-<a name="l00806"></a>00806                                             <span class="keywordtype">int</span>                 degreef2)
-<a name="l00807"></a>00807 {
-<a name="l00808"></a>00808     <span class="keywordtype">int</span>             xpow,
-<a name="l00809"></a>00809                     ypow;
-<a name="l00810"></a>00810     cpl_polynomial  *polyf = NULL;
-<a name="l00811"></a>00811     
-<a name="l00812"></a>00812     <span class="comment">/* free output pointers */</span>
-<a name="l00813"></a>00813     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00814"></a>00814     
-<a name="l00815"></a>00815     <span class="comment">/* check input */</span>
-<a name="l00816"></a>00816     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Previous error caught."</span>);
-<a name="l00817"></a>00817     
-<a name="l00818"></a>00818     <span class="keywordflow">if</span> (degreef1 < 0)
-<a name="l00819"></a>00819     {
-<a name="l00820"></a>00820         cpl_error_set_message(  cpl_func, CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00821"></a>00821                                 <span class="stringliteral">"!(degreef1 >= 0)"</span>);
-<a name="l00822"></a>00822         <span class="keywordflow">return</span> NULL;
-<a name="l00823"></a>00823     }
-<a name="l00824"></a>00824     
-<a name="l00825"></a>00825     <span class="comment">/* define the polynomial */</span>
-<a name="l00826"></a>00826     polyf = cpl_polynomial_new(2);  <span class="comment">/* 2 dimensions */</span>
-<a name="l00827"></a>00827     <span class="keywordflow">for</span> (xpow = 0; xpow <= degreef1; xpow++)
-<a name="l00828"></a>00828     {
-<a name="l00829"></a>00829         <span class="keywordflow">for</span> (ypow = 0;
-<a name="l00830"></a>00830              (degreef2 >= 0) ? (ypow <= degreef2) : (xpow + ypow <= degreef1);
-<a name="l00831"></a>00831              ypow++)
-<a name="l00832"></a>00832          {
-<a name="l00833"></a>00833             <span class="keywordflow">if</span> (xpow+ypow > 0)
-<a name="l00834"></a>00834             {
-<a name="l00835"></a>00835                 cpl_size pows[2];
-<a name="l00836"></a>00836                 pows[0] = xpow;
-<a name="l00837"></a>00837                 pows[1] = ypow;
-<a name="l00838"></a>00838                 cpl_polynomial_set_coeff(polyf, pows, 1.0);
-<a name="l00839"></a>00839             }
-<a name="l00840"></a>00840          }
-<a name="l00841"></a>00841     }
-<a name="l00842"></a>00842     
-<a name="l00843"></a>00843     <a class="code" href="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb">fors_polynomial_dump</a>(polyf, <span class="stringliteral">"polynomial definition f"</span>, CPL_MSG_DEBUG, NULL);
-<a name="l00844"></a>00844     
-<a name="l00845"></a>00845     <span class="comment">/* consistency check */</span>
-<a name="l00846"></a>00846     <span class="keywordflow">if</span> (degreef2 >= 0)
-<a name="l00847"></a>00847     {
-<a name="l00848"></a>00848         cassure(<a class="code" href="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679">fors_polynomial_count_coeff</a>(polyf)
-<a name="l00849"></a>00849                 == (degreef1+1)*(degreef2+1)-1,
-<a name="l00850"></a>00850                 CPL_ERROR_UNSPECIFIED,
-<a name="l00851"></a>00851                 <span class="keywordflow">return</span> polyf,
-<a name="l00852"></a>00852                 <span class="stringliteral">"Consistency check for rectangular f polynomial failed"</span>);
-<a name="l00853"></a>00853     }
-<a name="l00854"></a>00854     <span class="keywordflow">else</span>
-<a name="l00855"></a>00855     {
-<a name="l00856"></a>00856         cassure(<a class="code" href="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679">fors_polynomial_count_coeff</a>(polyf)
-<a name="l00857"></a>00857                 == ((degreef1+1)*(degreef1+2))/2-1,
-<a name="l00858"></a>00858                 CPL_ERROR_UNSPECIFIED,
-<a name="l00859"></a>00859                 <span class="keywordflow">return</span> polyf,
-<a name="l00860"></a>00860                 <span class="stringliteral">"Consistency check for triangular f polynomial failed"</span>);
-<a name="l00861"></a>00861     }
-<a name="l00862"></a>00862     
-<a name="l00863"></a>00863     <span class="keywordflow">return</span> polyf;
-<a name="l00864"></a>00864 }
-<a name="l00865"></a>00865 
-<a name="l00866"></a>00866 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00867"></a>00867 <span class="preprocessor">#undef cleanup</span>
-<a name="l00868"></a>00868 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00869"></a>00869 <span class="preprocessor">do { \</span>
-<a name="l00870"></a>00870 <span class="preprocessor">    cpl_polynomial_delete(polyp); polyp = NULL; \</span>
-<a name="l00871"></a>00871 <span class="preprocessor">} while (0)</span>
-<a name="l00872"></a>00872 <span class="preprocessor"></span>
-<a name="l00883"></a>00883 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00884"></a>00884 <span class="keyword">static</span> cpl_polynomial*
-<a name="l00885"></a><a class="code" href="group__fors__photometry.html#ga8ebd4e57d8df9c4fb26a5ea59d52182">00885</a> <a class="code" href="group__fors__photometry.html#ga8ebd4e57d8df9c4fb26a5ea59d52182">fors_photometry_define_polyp</a>(               <span class="keywordtype">int</span>                 degreep)
-<a name="l00886"></a>00886 {
-<a name="l00887"></a>00887     <span class="keywordtype">int</span>             k,
-<a name="l00888"></a>00888                     l;
-<a name="l00889"></a>00889     cpl_polynomial  *polyp = NULL;
-<a name="l00890"></a>00890     
-<a name="l00891"></a>00891     <span class="comment">/* free output pointers */</span>
-<a name="l00892"></a>00892     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00893"></a>00893     
-<a name="l00894"></a>00894     <span class="comment">/* check input */</span>
-<a name="l00895"></a>00895     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Previous error caught."</span>);
-<a name="l00896"></a>00896     
-<a name="l00897"></a>00897     cassure(                                degreep >= 0,
-<a name="l00898"></a>00898                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00899"></a>00899                                             <span class="keywordflow">return</span> polyp,
-<a name="l00900"></a>00900                                             <span class="stringliteral">"!(degreep >= 0)"</span>);
-<a name="l00901"></a>00901     
-<a name="l00902"></a>00902     <span class="comment">/* define the polynomial */</span>
-<a name="l00903"></a>00903     polyp = cpl_polynomial_new(2);  <span class="comment">/* 2 dimensions */</span>
-<a name="l00904"></a>00904     
-<a name="l00905"></a>00905     <span class="keywordflow">for</span> (k = 0; k <= degreep; k++) {
-<a name="l00906"></a>00906         <span class="keywordflow">for</span> (l = 0; k + l <= degreep; l++)
-<a name="l00907"></a>00907             <span class="keywordflow">if</span> (k+l > 1) {
-<a name="l00908"></a>00908                 cpl_size pows[2];
-<a name="l00909"></a>00909                 pows[0] = k;
-<a name="l00910"></a>00910                 pows[1] = l;
-<a name="l00911"></a>00911                 cpl_polynomial_set_coeff(polyp, pows, 1.0);
-<a name="l00912"></a>00912             }
-<a name="l00913"></a>00913     }
-<a name="l00914"></a>00914     
-<a name="l00915"></a>00915     <a class="code" href="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb">fors_polynomial_dump</a>(polyp, <span class="stringliteral">"polynomial definition p"</span>, CPL_MSG_DEBUG, NULL);
-<a name="l00916"></a>00916     
-<a name="l00917"></a>00917     <span class="comment">/* consistency check */</span>
-<a name="l00918"></a>00918     {
-<a name="l00919"></a>00919         <span class="keywordtype">int</span> npars = degreep >= 2 ? ((degreep+1)*(degreep+2))/2-3 : 0;
-<a name="l00920"></a>00920         cassure(<a class="code" href="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679">fors_polynomial_count_coeff</a>(polyp) == npars,
-<a name="l00921"></a>00921                 CPL_ERROR_UNSPECIFIED,
-<a name="l00922"></a>00922                 <span class="keywordflow">return</span> polyp,
-<a name="l00923"></a>00923                 <span class="stringliteral">"Consistency check for triangular p polynomial failed"</span>);
-<a name="l00924"></a>00924     }
-<a name="l00925"></a>00925     
-<a name="l00926"></a>00926     <span class="keywordflow">return</span> polyp;
-<a name="l00927"></a>00927 }
-<a name="l00928"></a>00928 
-<a name="l00929"></a>00929 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00930"></a>00930 <span class="preprocessor">#undef cleanup</span>
-<a name="l00931"></a>00931 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00932"></a>00932 <span class="preprocessor">do { \</span>
-<a name="l00933"></a>00933 <span class="preprocessor">    if (poly != NULL) { cpl_polynomial_delete(*poly); *poly = NULL; } \</span>
-<a name="l00934"></a>00934 <span class="preprocessor">    if (var_poly != NULL) {cpl_polynomial_delete(*var_poly); *var_poly = NULL;}\</span>
-<a name="l00935"></a>00935 <span class="preprocessor">} while (0)</span>
-<a name="l00936"></a>00936 <span class="preprocessor"></span>
-<a name="l00950"></a>00950 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00951"></a>00951 <span class="keyword">static</span> cpl_error_code
-<a name="l00952"></a><a class="code" href="group__fors__photometry.html#ga9ee56261da033d2a3ff241a68569522">00952</a> <a class="code" href="group__fors__photometry.html#ga9ee56261da033d2a3ff241a68569522">fors_photometry_poly_new_from_coefficients</a>( <span class="keyword">const</span> cpl_polynomial    *p_def,
-<a name="l00953"></a>00953                                             <span class="keyword">const</span> cpl_matrix        *coeffs,
-<a name="l00954"></a>00954                                             <span class="keyword">const</span> cpl_matrix        *cov_coeffs,
-<a name="l00955"></a>00955                                             cpl_polynomial          **poly,
-<a name="l00956"></a>00956                                             cpl_polynomial          **var_poly)
-<a name="l00957"></a>00957 {
-<a name="l00958"></a>00958     <span class="keywordtype">int</span>             n_coeffs;
-<a name="l00959"></a>00959     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00960"></a>00960     
-<a name="l00961"></a>00961     <span class="comment">/* free output pointers */</span>
-<a name="l00962"></a>00962     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00963"></a>00963     
-<a name="l00964"></a>00964     cassure_automsg(                        p_def != NULL,
-<a name="l00965"></a>00965                                             CPL_ERROR_NULL_INPUT,
-<a name="l00966"></a>00966                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00967"></a>00967     cassure_automsg(                        poly != NULL,
-<a name="l00968"></a>00968                                             CPL_ERROR_NULL_INPUT,
-<a name="l00969"></a>00969                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00970"></a>00970     
-<a name="l00971"></a>00971     n_coeffs = <a class="code" href="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679">fors_polynomial_count_coeff</a>( p_def);
-<a name="l00972"></a>00972     cassure_automsg(                        n_coeffs == 0 || coeffs != NULL,
-<a name="l00973"></a>00973                                             CPL_ERROR_NULL_INPUT,
-<a name="l00974"></a>00974                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00975"></a>00975     cassure_automsg(                        n_coeffs == 0
-<a name="l00976"></a>00976                                             || var_poly == NULL
-<a name="l00977"></a>00977                                             || cov_coeffs != NULL,
-<a name="l00978"></a>00978                                             CPL_ERROR_NULL_INPUT,
-<a name="l00979"></a>00979                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00980"></a>00980     <span class="keywordflow">if</span> (n_coeffs > 0)
-<a name="l00981"></a>00981     {
-<a name="l00982"></a>00982         
-<a name="l00983"></a>00983         cassure_automsg(                    cpl_matrix_get_ncol(coeffs) == 1,
-<a name="l00984"></a>00984                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00985"></a>00985                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00986"></a>00986         cassure_automsg(                    cpl_matrix_get_nrow(coeffs)
-<a name="l00987"></a>00987                                             == n_coeffs,
-<a name="l00988"></a>00988                                             CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l00989"></a>00989                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00990"></a>00990         <span class="keywordflow">if</span> (var_poly != NULL)
-<a name="l00991"></a>00991         {
-<a name="l00992"></a>00992             cassure_automsg(                cpl_matrix_get_nrow(cov_coeffs)
-<a name="l00993"></a>00993                                             == n_coeffs,
-<a name="l00994"></a>00994                                             CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l00995"></a>00995                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00996"></a>00996             cassure(                        cpl_matrix_get_nrow(cov_coeffs)
-<a name="l00997"></a>00997                                             == cpl_matrix_get_ncol(cov_coeffs),
-<a name="l00998"></a>00998                                             CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l00999"></a>00999                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l01000"></a>01000                                             <span class="stringliteral">"cov_coeffs is not square"</span>);
-<a name="l01001"></a>01001         }
-<a name="l01002"></a>01002         *poly = cpl_polynomial_duplicate(   p_def);
-<a name="l01003"></a>01003         <a class="code" href="group__fors__polynomial.html#g2255e6cc731c54c6b5575e506bd5fea8">fors_polynomial_set_existing_coeff</a>( *poly,
-<a name="l01004"></a>01004                                             cpl_matrix_get_data_const(coeffs),
-<a name="l01005"></a>01005                                             n_coeffs);
-<a name="l01006"></a>01006         passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01007"></a>01007         
-<a name="l01008"></a>01008         <span class="keywordflow">if</span> (var_poly != NULL)
-<a name="l01009"></a>01009             *var_poly = <a class="code" href="group__fors__polynomial.html#ga116e293092bfb1db2c5e90504e90cc0">fors_polynomial_create_variance_polynomial</a>(
-<a name="l01010"></a>01010                                             p_def,
-<a name="l01011"></a>01011                                             cov_coeffs);
-<a name="l01012"></a>01012         passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01013"></a>01013     }
-<a name="l01014"></a>01014     <span class="keywordflow">else</span>    <span class="comment">/* create empty polynomial */</span>
-<a name="l01015"></a>01015     {
-<a name="l01016"></a>01016         *poly = cpl_polynomial_new(         cpl_polynomial_get_dimension(
-<a name="l01017"></a>01017                                                 p_def));
-<a name="l01018"></a>01018         <span class="keywordflow">if</span> (var_poly != NULL)
-<a name="l01019"></a>01019             *var_poly = cpl_polynomial_new( cpl_polynomial_get_dimension(
-<a name="l01020"></a>01020                                                 p_def));
-<a name="l01021"></a>01021     }
-<a name="l01022"></a>01022     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01023"></a>01023     
-<a name="l01024"></a>01024     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?
-<a name="l01025"></a>01025             CPL_ERROR_NONE :
-<a name="l01026"></a>01026             cpl_error_get_code());
-<a name="l01027"></a>01027 }
-<a name="l01028"></a>01028 
-<a name="l01029"></a>01029 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01030"></a>01030 <span class="preprocessor">#undef cleanup</span>
-<a name="l01031"></a>01031 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01032"></a>01032 <span class="preprocessor"></span>
-<a name="l01037"></a>01037 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01038"></a>01038 <span class="keywordtype">int</span>
-<a name="l01039"></a><a class="code" href="group__fors__photometry.html#g105a6893a27ad23d6ef02cc271f42c30">01039</a> <a class="code" href="group__fors__photometry.html#g105a6893a27ad23d6ef02cc271f42c30">fors_photometry_get_timezone_observer</a>(      <span class="keyword">const</span> cpl_propertylist  *header)
-<a name="l01040"></a>01040 {
-<a name="l01041"></a>01041     <span class="keyword">const</span> cpl_property  *prop;
-<a name="l01042"></a>01042     
-<a name="l01043"></a>01043     cassure_automsg(                        header != NULL,
-<a name="l01044"></a>01044                                             CPL_ERROR_NULL_INPUT,
-<a name="l01045"></a>01045                                             <span class="keywordflow">return</span> 0);
-<a name="l01046"></a>01046     
-<a name="l01047"></a>01047     <span class="keywordflow">do</span> {
-<a name="l01048"></a>01048         <span class="keyword">const</span> <span class="keywordtype">char</span>  *origin;
-<a name="l01049"></a>01049                 
-<a name="l01050"></a>01050         prop = cpl_propertylist_get_property_const(header, <span class="stringliteral">"ORIGIN"</span>);
-<a name="l01051"></a>01051         <span class="keywordflow">if</span> (prop == NULL)
-<a name="l01052"></a>01052         {
-<a name="l01053"></a>01053             cpl_error_set_message(          cpl_func,
-<a name="l01054"></a>01054                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01055"></a>01055                                             <span class="stringliteral">"Couldn't find the keyword ORIGIN"</span>);
-<a name="l01056"></a>01056             <span class="keywordflow">return</span> 0;
-<a name="l01057"></a>01057         }
-<a name="l01058"></a>01058         
-<a name="l01059"></a>01059         <span class="keywordflow">if</span> (cpl_property_get_type(prop) != CPL_TYPE_STRING)
-<a name="l01060"></a>01060             <span class="keywordflow">break</span>;
-<a name="l01061"></a>01061         
-<a name="l01062"></a>01062         <span class="keywordflow">if</span> ((origin = cpl_property_get_string(prop)) == NULL)
-<a name="l01063"></a>01063             <span class="keywordflow">break</span>;
-<a name="l01064"></a>01064         
-<a name="l01065"></a>01065         <span class="keywordflow">if</span> (!<a class="code" href="group__fors__photometry.html#gedafdf97c6e7c236d39fe16f9c459953">fors_fits_compare_string</a>(origin, <span class="stringliteral">"ESO"</span>))
-<a name="l01066"></a>01066             <span class="keywordflow">break</span>;
-<a name="l01067"></a>01067         
-<a name="l01068"></a>01068         <span class="comment">/* We're at ESO, i.e. in Chile */</span>
-<a name="l01069"></a>01069         <span class="keywordflow">return</span> -3;
-<a name="l01070"></a>01070         
-<a name="l01071"></a>01071     } <span class="keywordflow">while</span> (0);
-<a name="l01072"></a>01072     
-<a name="l01073"></a>01073     cpl_error_set_message(                  cpl_func,
-<a name="l01074"></a>01074                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l01075"></a>01075                                             <span class="stringliteral">"Don't know the originator of the "</span>
-<a name="l01076"></a>01076                                             <span class="stringliteral">"frame specified in ORIGIN"</span>);
-<a name="l01077"></a>01077     <span class="keywordflow">return</span> 0;
-<a name="l01078"></a>01078 }
-<a name="l01079"></a>01079 
-<a name="l01080"></a>01080 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01081"></a>01081 <span class="preprocessor">#undef cleanup</span>
-<a name="l01082"></a>01082 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01083"></a>01083 <span class="preprocessor"></span>
-<a name="l01090"></a>01090 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01091"></a>01091 <span class="keywordtype">int</span>
-<a name="l01092"></a><a class="code" href="group__fors__photometry.html#g294b0010ae795af85c28da476abadb18">01092</a> <a class="code" href="group__fors__photometry.html#g294b0010ae795af85c28da476abadb18">fors_photometry_get_night_id</a>(               <span class="keyword">const</span> cpl_propertylist *header)
-<a name="l01093"></a>01093 {
-<a name="l01094"></a>01094     <span class="keyword">const</span> cpl_property  *prop;
-<a name="l01095"></a>01095     cpl_errorstate      errstat = cpl_errorstate_get();
-<a name="l01096"></a>01096     
-<a name="l01097"></a>01097     cassure_automsg(                        header != NULL,
-<a name="l01098"></a>01098                                             CPL_ERROR_NULL_INPUT,
-<a name="l01099"></a>01099                                             <span class="keywordflow">return</span> 0);
-<a name="l01100"></a>01100     
-<a name="l01101"></a>01101     <span class="comment">/* try to get the Modified Julian Date */</span>
-<a name="l01102"></a>01102     prop = cpl_propertylist_get_property_const(header, <span class="stringliteral">"MJD-OBS"</span>);
-<a name="l01103"></a>01103     <span class="keywordflow">if</span> (prop != NULL)
-<a name="l01104"></a>01104     {
-<a name="l01105"></a>01105         <span class="keywordtype">double</span>  mjd,
-<a name="l01106"></a>01106                 jd,
-<a name="l01107"></a>01107                 timezone;
-<a name="l01108"></a>01108         <span class="keywordtype">int</span>     localstartday;
-<a name="l01109"></a>01109         mjd = <a class="code" href="group__fors__photometry.html#gd7a4fa7744d0bb4be55c0dfbd1138674">fors_property_get_num</a>(prop);
-<a name="l01110"></a>01110         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                             cpl_errorstate_is_equal(errstat),
-<a name="l01111"></a>01111                                             <span class="keywordflow">return</span> 0,
-<a name="l01112"></a>01112                                             <span class="stringliteral">"Could not interprete Modified "</span>
-<a name="l01113"></a>01113                                             <span class="stringliteral">"Julian Date keyword MJD-OBS"</span>);
-<a name="l01114"></a>01114         
-<a name="l01115"></a>01115         <span class="comment">/* The Julian Calendar starts at noon in Greenwich, counting days.</span>
-<a name="l01116"></a>01116 <span class="comment">         * The definition of MJD (FITS standard) is:</span>
-<a name="l01117"></a>01117 <span class="comment">         *   MJD = JD - 2'400'000.5</span>
-<a name="l01118"></a>01118 <span class="comment">         * The "xxx.5" means it starts some day at midnight (in Greenwich).</span>
-<a name="l01119"></a>01119 <span class="comment">         * We want a day definition again that starts at noon, so to have</span>
-<a name="l01120"></a>01120 <span class="comment">         * something standard, convert back to Julian date.</span>
-<a name="l01121"></a>01121 <span class="comment">         */</span>
-<a name="l01122"></a>01122          jd = mjd + 2400000.5;
-<a name="l01123"></a>01123          
-<a name="l01124"></a>01124          <span class="comment">/* Get the timezone of the observation location. The timezone is not</span>
-<a name="l01125"></a>01125 <span class="comment">          * perfect to determine sunrise/sunset times, but we don't care</span>
-<a name="l01126"></a>01126 <span class="comment">          * since we don't expect any observations +/- 2h around noon.</span>
-<a name="l01127"></a>01127 <span class="comment">          */</span>
-<a name="l01128"></a>01128          timezone = <a class="code" href="group__fors__photometry.html#g105a6893a27ad23d6ef02cc271f42c30">fors_photometry_get_timezone_observer</a>(header);
-<a name="l01129"></a>01129          
-<a name="l01130"></a>01130          <span class="comment">/* Correct for the timezone. Now we have something like a</span>
-<a name="l01131"></a>01131 <span class="comment">          * "Julian Local Time Date" */</span>
-<a name="l01132"></a>01132          jd += (double)timezone / 24.0;
-<a name="l01133"></a>01133          
-<a name="l01134"></a>01134          <span class="comment">/* Since the Julian days start every noon, we just round down and</span>
-<a name="l01135"></a>01135 <span class="comment">          * have the date of the day in which the night started */</span>
-<a name="l01136"></a>01136          localstartday = floor(jd);
-<a name="l01137"></a>01137          cpl_msg_debug(                     cpl_func,
-<a name="l01138"></a>01138                                             <span class="stringliteral">"Julian day no. of observation "</span>
-<a name="l01139"></a>01139                                             <span class="stringliteral">"night: %d"</span>,
-<a name="l01140"></a>01140                                             localstartday);
-<a name="l01141"></a>01141          
-<a name="l01142"></a>01142          <span class="keywordflow">return</span> localstartday;
-<a name="l01143"></a>01143     }
-<a name="l01144"></a>01144     
-<a name="l01145"></a>01145     <span class="comment">/* So far, no alternative for MJD-OBS is provided. If there should be one</span>
-<a name="l01146"></a>01146 <span class="comment">     * in future, remember to check for inconsistencies between the frames. */</span>
-<a name="l01147"></a>01147     cpl_error_set_message(                  cpl_func,
-<a name="l01148"></a>01148                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01149"></a>01149                                             <span class="stringliteral">"Couldn't find the keyword "</span>
-<a name="l01150"></a>01150                                             <span class="stringliteral">"MJD-OBS"</span>);
-<a name="l01151"></a>01151     <span class="keywordflow">return</span> 0;
-<a name="l01152"></a>01152 }
-<a name="l01153"></a>01153 
-<a name="l01154"></a>01154 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01155"></a>01155 <span class="preprocessor">#undef cleanup</span>
-<a name="l01156"></a>01156 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01157"></a>01157 <span class="preprocessor">do { \</span>
-<a name="l01158"></a>01158 <span class="preprocessor">    cpl_free(ident_array); ident_array = NULL; \</span>
-<a name="l01159"></a>01159 <span class="preprocessor">} while (0)</span>
-<a name="l01160"></a>01160 <span class="preprocessor"></span>
-<a name="l01168"></a>01168 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01169"></a>01169 <span class="keyword">static</span> <span class="keywordtype">int</span>
-<a name="l01170"></a><a class="code" href="group__fors__photometry.html#g951ded14339fa018b98cbf21a332c7cf">01170</a> <a class="code" href="group__fors__photometry.html#g951ded14339fa018b98cbf21a332c7cf">fors_photometry_atm_ext_create_index_by_identifier</a>(
-<a name="l01171"></a>01171                                             entry_list          *obs_list)
-<a name="l01172"></a>01172 {
-<a name="l01173"></a>01173     <a class="code" href="structentry.html">entry</a>           *e;
-<a name="l01174"></a>01174     <span class="keywordtype">int</span>             *ident_array;
-<a name="l01175"></a>01175     <span class="keywordtype">int</span>             n_entries,
-<a name="l01176"></a>01176                     n_idents = 0;
-<a name="l01177"></a>01177     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l01178"></a>01178     
-<a name="l01179"></a>01179     cassure_automsg(                        obs_list != NULL,
-<a name="l01180"></a>01180                                             CPL_ERROR_NULL_INPUT,
-<a name="l01181"></a>01181                                             <span class="keywordflow">return</span> 0);
-<a name="l01182"></a>01182     
-<a name="l01183"></a>01183     n_entries = entry_list_size(obs_list);
-<a name="l01184"></a>01184     ident_array = cpl_malloc(n_entries * <span class="keyword">sizeof</span>(*ident_array));
-<a name="l01185"></a>01185     
-<a name="l01186"></a>01186     <span class="keywordflow">for</span> (   e = entry_list_first(obs_list);
-<a name="l01187"></a>01187             e != NULL;
-<a name="l01188"></a>01188             e = entry_list_next(obs_list))
-<a name="l01189"></a>01189     {
-<a name="l01190"></a>01190         <span class="keywordtype">int</span>     i;
-<a name="l01191"></a>01191         <span class="keywordtype">bool</span>    found = <span class="keyword">false</span>;
-<a name="l01192"></a>01192         <span class="keywordflow">for</span> (i = 0; i < n_idents && !found; i++)
-<a name="l01193"></a>01193         {
-<a name="l01194"></a>01194             <span class="keywordflow">if</span> (e-><a class="code" href="structentry.html#c85d7b45722824c52fdaa4754c8d64ee">atm_ext_identifier</a> == ident_array[i])
-<a name="l01195"></a>01195             {
-<a name="l01196"></a>01196                 found = <span class="keyword">true</span>;
-<a name="l01197"></a>01197                 e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> = i;
-<a name="l01198"></a>01198             }
-<a name="l01199"></a>01199         }
-<a name="l01200"></a>01200         <span class="keywordflow">if</span> (!found)
-<a name="l01201"></a>01201         {
-<a name="l01202"></a>01202             ident_array[n_idents] = e-><a class="code" href="structentry.html#c85d7b45722824c52fdaa4754c8d64ee">atm_ext_identifier</a>;
-<a name="l01203"></a>01203             e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> = n_idents;
-<a name="l01204"></a>01204             
-<a name="l01205"></a>01205             cpl_msg_debug(                  cpl_func,
-<a name="l01206"></a>01206                                             <span class="stringliteral">"Creating atm. extinction index "</span>
-<a name="l01207"></a>01207                                             <span class="stringliteral">"%2d for identifier %d"</span>,
-<a name="l01208"></a>01208                                             n_idents,
-<a name="l01209"></a>01209                                             ident_array[n_idents]);
-<a name="l01210"></a>01210             
-<a name="l01211"></a>01211             n_idents++;
-<a name="l01212"></a>01212         }
-<a name="l01213"></a>01213     }
-<a name="l01214"></a>01214     
-<a name="l01215"></a>01215     passure(                                cpl_errorstate_is_equal(errstat),
-<a name="l01216"></a>01216                                             <span class="keywordflow">return</span> 0);
-<a name="l01217"></a>01217     
-<a name="l01218"></a>01218     cpl_free(ident_array);
-<a name="l01219"></a>01219     <span class="keywordflow">return</span> n_idents;
-<a name="l01220"></a>01220 }
-<a name="l01221"></a>01221 
-<a name="l01222"></a>01222 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01223"></a>01223 <span class="preprocessor">#undef cleanup</span>
-<a name="l01224"></a>01224 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01225"></a>01225 <span class="preprocessor"></span>
-<a name="l01241"></a>01241 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01242"></a>01242 <span class="keyword">static</span> <span class="keywordtype">int</span>
-<a name="l01243"></a><a class="code" href="group__fors__photometry.html#g1491e01ccadf9b6d6b85316dfffd7f86">01243</a> <a class="code" href="group__fors__photometry.html#g1491e01ccadf9b6d6b85316dfffd7f86">fors_photometry_atm_ext_create_indices</a>(     entry_list      *obsl,
-<a name="l01244"></a>01244                                             <a class="code" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> fit_e)
-<a name="l01245"></a>01245 {
-<a name="l01246"></a>01246     <a class="code" href="structentry.html">entry</a>           *e;
-<a name="l01247"></a>01247     <span class="keywordtype">int</span>             n_atm_ext_indices = 0;
-<a name="l01248"></a>01248     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l01249"></a>01249     
-<a name="l01250"></a>01250     cassure_automsg(                        obsl != NULL,
-<a name="l01251"></a>01251                                             CPL_ERROR_NULL_INPUT,
-<a name="l01252"></a>01252                                             <span class="keywordflow">return</span> -1);
-<a name="l01253"></a>01253     
-<a name="l01254"></a>01254     <span class="keywordflow">if</span> (fit_e != FORS_FIT_NCOEFF_NO
-<a name="l01255"></a>01255         && fit_e != FORS_FIT_NCOEFF_ONE
-<a name="l01256"></a>01256         && fit_e != FORS_FIT_NCOEFF_PERFRAME)
-<a name="l01257"></a>01257     {
-<a name="l01258"></a>01258         <span class="comment">/* if FORS_FIT_NCOEFF_PERNIGHT or any other future option which</span>
-<a name="l01259"></a>01259 <span class="comment">         * has set an identifier */</span>
-<a name="l01260"></a>01260         n_atm_ext_indices = 
-<a name="l01261"></a>01261             <a class="code" href="group__fors__photometry.html#g951ded14339fa018b98cbf21a332c7cf">fors_photometry_atm_ext_create_index_by_identifier</a>(obsl);
-<a name="l01262"></a>01262     }
-<a name="l01263"></a>01263     <span class="keywordflow">else</span>
-<a name="l01264"></a>01264     {
-<a name="l01265"></a>01265         <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_NO)
-<a name="l01266"></a>01266         {
-<a name="l01267"></a>01267             <span class="keywordflow">for</span> (e = entry_list_first(obsl); e!=NULL; e = entry_list_next(obsl))
-<a name="l01268"></a>01268                 e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> = -1;
-<a name="l01269"></a>01269             n_atm_ext_indices = 0;
-<a name="l01270"></a>01270         }
-<a name="l01271"></a>01271         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_ONE)
-<a name="l01272"></a>01272         {
-<a name="l01273"></a>01273             <span class="keywordflow">for</span> (e = entry_list_first(obsl); e!=NULL; e = entry_list_next(obsl))
-<a name="l01274"></a>01274                 e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> = 0;
-<a name="l01275"></a>01275             n_atm_ext_indices = 1;
-<a name="l01276"></a>01276         }
-<a name="l01277"></a>01277         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERFRAME)
-<a name="l01278"></a>01278         {
-<a name="l01279"></a>01279             <span class="keywordflow">for</span> (e = entry_list_first(obsl); e!=NULL; e = entry_list_next(obsl))
-<a name="l01280"></a>01280             {
-<a name="l01281"></a>01281                 e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> = e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a>;
-<a name="l01282"></a>01282                 if (e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a> >= n_atm_ext_indices)
-<a name="l01283"></a>01283                     n_atm_ext_indices = e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a> + 1;
-<a name="l01284"></a>01284             }
-<a name="l01285"></a>01285         }
-<a name="l01286"></a>01286     }
-<a name="l01287"></a>01287     
-<a name="l01288"></a>01288     <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))
-<a name="l01289"></a>01289         cpl_error_set_where(cpl_func);
-<a name="l01290"></a>01290     
-<a name="l01291"></a>01291     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ? n_atm_ext_indices : -1);
-<a name="l01292"></a>01292 }
-<a name="l01293"></a>01293 
-<a name="l01294"></a>01294 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01295"></a>01295 <span class="preprocessor">#undef cleanup</span>
-<a name="l01296"></a>01296 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01297"></a>01297 <span class="preprocessor">do { \</span>
-<a name="l01298"></a>01298 <span class="preprocessor">    if (frame_printed != NULL) \</span>
-<a name="l01299"></a>01299 <span class="preprocessor">    { \</span>
-<a name="l01300"></a>01300 <span class="preprocessor">        cpl_free(frame_printed); \</span>
-<a name="l01301"></a>01301 <span class="preprocessor">        frame_printed = NULL; \</span>
-<a name="l01302"></a>01302 <span class="preprocessor">    } \</span>
-<a name="l01303"></a>01303 <span class="preprocessor">} while (0)</span>
-<a name="l01304"></a>01304 <span class="preprocessor"></span>
-<a name="l01310"></a>01310 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01311"></a>01311 <span class="comment">//static cpl_error_code</span>
-<a name="l01312"></a>01312 <span class="keyword">static</span> cpl_table *
-<a name="l01313"></a><a class="code" href="group__fors__photometry.html#ga3a88672675c12a7d6f30f9e6cc1459a">01313</a> <a class="code" href="group__fors__photometry.html#ga3a88672675c12a7d6f30f9e6cc1459a">fors_photometry_atm_ext_print_index_by_framename</a>(
-<a name="l01314"></a>01314                                             <span class="keyword">const</span> entry_list    *obs_list,
-<a name="l01315"></a>01315                                             <span class="keyword">const</span> cpl_frameset  *frames)
-<a name="l01316"></a>01316 {
-<a name="l01317"></a>01317     <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>     *e;
-<a name="l01318"></a>01318     <span class="keywordtype">bool</span>            *frame_printed = NULL;
-<a name="l01319"></a>01319     <span class="keywordtype">int</span>             n_frames,
-<a name="l01320"></a>01320                     ext_index,
-<a name="l01321"></a>01321                     max_ext_index,
-<a name="l01322"></a>01322                     n;
-<a name="l01323"></a>01323     <span class="keywordtype">int</span>             row = 0;
-<a name="l01324"></a>01324     cpl_table      *summary;
-<a name="l01325"></a>01325     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l01326"></a>01326     
-<a name="l01327"></a>01327     cassure_automsg(                        obs_list != NULL,
-<a name="l01328"></a>01328                                             CPL_ERROR_NULL_INPUT,
-<a name="l01329"></a>01329                                             <span class="keywordflow">return</span> NULL);
-<a name="l01330"></a>01330     cassure_automsg(                        frames != NULL,
-<a name="l01331"></a>01331                                             CPL_ERROR_NULL_INPUT,
-<a name="l01332"></a>01332                                             <span class="keywordflow">return</span> NULL);
-<a name="l01333"></a>01333     
-<a name="l01334"></a>01334     n_frames = cpl_frameset_get_size(frames);
-<a name="l01335"></a>01335     frame_printed = cpl_malloc(n_frames * <span class="keyword">sizeof</span>(*frame_printed));
-<a name="l01336"></a>01336 
-<a name="l01337"></a>01337     summary = cpl_table_new(n_frames);
-<a name="l01338"></a>01338     cpl_table_new_column(summary, <span class="stringliteral">"filename"</span>, CPL_TYPE_STRING);
-<a name="l01339"></a>01339     cpl_table_new_column(summary, <span class="stringliteral">"index"</span>, CPL_TYPE_INT);
-<a name="l01340"></a>01340     
-<a name="l01341"></a>01341     max_ext_index = -1;
-<a name="l01342"></a>01342     <span class="keywordflow">for</span> (   e = entry_list_first_const(obs_list);
-<a name="l01343"></a>01343             e != NULL;
-<a name="l01344"></a>01344             e = entry_list_next_const(obs_list))
-<a name="l01345"></a>01345     {
-<a name="l01346"></a>01346         <span class="keywordflow">if</span> (e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> > max_ext_index)
-<a name="l01347"></a>01347             max_ext_index = e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a>;
-<a name="l01348"></a>01348     }
-<a name="l01349"></a>01349     
-<a name="l01350"></a>01350     <span class="keywordflow">if</span> (max_ext_index >= 0)
-<a name="l01351"></a>01351         cpl_msg_info(                       cpl_func,
-<a name="l01352"></a>01352                                             <span class="stringliteral">"Assignment of atmospheric "</span>
-<a name="l01353"></a>01353                                             <span class="stringliteral">"extinction indices:"</span>);
-<a name="l01354"></a>01354     
-<a name="l01355"></a>01355     <span class="keywordflow">for</span> (ext_index = 0; ext_index <= max_ext_index; ext_index++)
-<a name="l01356"></a>01356     {
-<a name="l01357"></a>01357         <span class="keywordtype">bool</span>    first_file = <span class="keyword">true</span>;
-<a name="l01358"></a>01358         <span class="keywordtype">char</span>    estr[15];
-<a name="l01359"></a>01359         <span class="keywordflow">for</span> (n = 0; n < n_frames; n++)
-<a name="l01360"></a>01360             frame_printed[n] = <span class="keyword">false</span>;
-<a name="l01361"></a>01361         
-<a name="l01362"></a>01362         cpl_msg_indent_more();
-<a name="l01363"></a>01363         sprintf(estr, <span class="stringliteral">"E_%d:         "</span>, ext_index);
-<a name="l01364"></a>01364         estr[9] = <span class="charliteral">'\0'</span>;
-<a name="l01365"></a>01365         
-<a name="l01366"></a>01366         <span class="keywordflow">for</span> (   e = entry_list_first_const(obs_list);
-<a name="l01367"></a>01367                 e != NULL;
-<a name="l01368"></a>01368                 e = entry_list_next_const(obs_list))
-<a name="l01369"></a>01369         {
-<a name="l01370"></a>01370             <span class="keywordflow">if</span> (e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> == ext_index)
-<a name="l01371"></a>01371             {
-<a name="l01372"></a>01372                 cassure_automsg(            e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a> >= 0
-<a name="l01373"></a>01373                                             && e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a> < n_frames,
-<a name="l01374"></a>01374                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l01375"></a>01375                                             {
-<a name="l01376"></a>01376                                                 cpl_msg_indent_less();
-<a name="l01377"></a>01377                                                 <span class="keywordflow">return</span> NULL;
-<a name="l01378"></a>01378                                             });
-<a name="l01379"></a>01379                 
-<a name="l01380"></a>01380                 <span class="keywordflow">if</span> (!frame_printed[e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a>])
-<a name="l01381"></a>01381                 {
-<a name="l01382"></a>01382                     <span class="keyword">const</span> cpl_frame *f;
-<a name="l01383"></a>01383                     
-<a name="l01384"></a>01384                     f = cpl_frameset_get_frame_const(frames, e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a>);
-<a name="l01385"></a>01385                     if (first_file)
-<a name="l01386"></a>01386                     {
-<a name="l01387"></a>01387                         cpl_msg_info(       cpl_func,
-<a name="l01388"></a>01388                                             <span class="stringliteral">"%s%s"</span>,
-<a name="l01389"></a>01389                                             estr,
-<a name="l01390"></a>01390                                             cpl_frame_get_filename(f));
-<a name="l01391"></a>01391                     }
-<a name="l01392"></a>01392                     <span class="keywordflow">else</span>
-<a name="l01393"></a>01393                     {
-<a name="l01394"></a>01394                         cpl_msg_info(       cpl_func,
-<a name="l01395"></a>01395                                             <span class="stringliteral">"         %s"</span>,
-<a name="l01396"></a>01396                                             cpl_frame_get_filename(f));
-<a name="l01397"></a>01397                     }
-<a name="l01398"></a>01398                     frame_printed[e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a>] = <span class="keyword">true</span>;
-<a name="l01399"></a>01399                     first_file = <span class="keyword">false</span>;
-<a name="l01400"></a>01400 
-<a name="l01401"></a>01401                     <span class="comment">/*</span>
-<a name="l01402"></a>01402 <span class="comment">                     * This tail is added to store the filename / index</span>
-<a name="l01403"></a>01403 <span class="comment">                     * in a summary table.</span>
-<a name="l01404"></a>01404 <span class="comment">                     */</span>
-<a name="l01405"></a>01405 
-<a name="l01406"></a>01406                     cpl_table_set_string(summary, <span class="stringliteral">"filename"</span>, row, 
-<a name="l01407"></a>01407                                          cpl_frame_get_filename(f));
-<a name="l01408"></a>01408                     cpl_table_set_int(summary, <span class="stringliteral">"index"</span>, row, ext_index);
-<a name="l01409"></a>01409                     row++;
-<a name="l01410"></a>01410 
-<a name="l01411"></a>01411                 }
-<a name="l01412"></a>01412             }
-<a name="l01413"></a>01413             
-<a name="l01414"></a>01414             
-<a name="l01415"></a>01415         }
-<a name="l01416"></a>01416         cpl_msg_indent_less();
-<a name="l01417"></a>01417     }
-<a name="l01418"></a>01418 
-<a name="l01419"></a>01419 <span class="comment">//    cpl_table_save(summary, NULL, NULL, "summary.fits", CPL_IO_CREATE);</span>
-<a name="l01420"></a>01420     
-<a name="l01421"></a>01421     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01422"></a>01422     
-<a name="l01423"></a>01423     passure(                                cpl_errorstate_is_equal(errstat),
-<a name="l01424"></a>01424                                             <span class="keywordflow">return</span> NULL);
-<a name="l01425"></a>01425     
-<a name="l01426"></a>01426     <span class="keywordflow">return</span> summary;
-<a name="l01427"></a>01427 }
-<a name="l01428"></a>01428 
-<a name="l01429"></a>01429 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01430"></a>01430 <span class="preprocessor">#undef cleanup</span>
-<a name="l01431"></a>01431 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01432"></a>01432 <span class="preprocessor"></span>
-<a name="l01445"></a>01445 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01446"></a>01446 <span class="keyword">static</span> cpl_error_code
-<a name="l01447"></a><a class="code" href="group__fors__photometry.html#gfe5618566936c6f9809d639f9148ce4d">01447</a> <a class="code" href="group__fors__photometry.html#gfe5618566936c6f9809d639f9148ce4d">fors_photometry_check_input_value</a>(          <span class="keywordtype">double</span>      value,
-<a name="l01448"></a>01448                                             <span class="keywordtype">double</span>      value_error,
-<a name="l01449"></a>01449                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *value_name,
-<a name="l01450"></a>01450                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *input_name,
-<a name="l01451"></a>01451                                             <span class="keywordtype">double</span>      min_limit,
-<a name="l01452"></a>01452                                             <span class="keywordtype">double</span>      max_limit,
-<a name="l01453"></a>01453                                             <span class="keywordtype">double</span>      max_error)
-<a name="l01454"></a>01454 {
-<a name="l01455"></a>01455     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l01456"></a>01456     
-<a name="l01457"></a>01457     <span class="keywordflow">if</span> (value < min_limit || value > max_limit)
-<a name="l01458"></a>01458     {
-<a name="l01459"></a>01459         cpl_error_set_message(              cpl_func,
-<a name="l01460"></a>01460                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l01461"></a>01461                                             <span class="stringliteral">"invalid %s (%f)"</span>
-<a name="l01462"></a>01462                                             <span class="stringliteral">"%s%s"</span>
-<a name="l01463"></a>01463                                             <span class="stringliteral">", either correct input, or try to "</span>
-<a name="l01464"></a>01464                                             <span class="stringliteral">"re-run this recipe with fitting "</span>
-<a name="l01465"></a>01465                                             <span class="stringliteral">"%s enabled"</span>,
-<a name="l01466"></a>01466                                             value_name,
-<a name="l01467"></a>01467                                             value,
-<a name="l01468"></a>01468                                             (input_name != NULL)?<span class="stringliteral">" read from "</span>:<span class="stringliteral">""</span>,
-<a name="l01469"></a>01469                                             (input_name != NULL)?input_name:<span class="stringliteral">""</span>,
-<a name="l01470"></a>01470                                             value_name);
-<a name="l01471"></a>01471     }
-<a name="l01472"></a>01472     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value_error > max_error || value_error < 0)
-<a name="l01473"></a>01473     {
-<a name="l01474"></a>01474         <span class="keywordtype">char</span>    exceed_max_err[30];
-<a name="l01475"></a>01475         sprintf(exceed_max_err, <span class="stringliteral">"> %f"</span>, max_error);
-<a name="l01476"></a>01476         cpl_error_set_message(              cpl_func,
-<a name="l01477"></a>01477                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l01478"></a>01478                                             <span class="stringliteral">"unreliable %s ((error = %g) %s)"</span>
-<a name="l01479"></a>01479                                             <span class="stringliteral">"%s%s"</span>
-<a name="l01480"></a>01480                                             <span class="stringliteral">", either recompute input, or try "</span>
-<a name="l01481"></a>01481                                             <span class="stringliteral">"to re-run this recipe with "</span>
-<a name="l01482"></a>01482                                             <span class="stringliteral">"fitting %s enabled"</span>,
-<a name="l01483"></a>01483                                             value_name,
-<a name="l01484"></a>01484                                             value_error,
-<a name="l01485"></a>01485                                             (value_error < 0) ?
-<a name="l01486"></a>01486                                                 <span class="stringliteral">"< 0"</span> : exceed_max_err,
-<a name="l01487"></a>01487                                             (input_name != NULL)?<span class="stringliteral">" read from "</span>:<span class="stringliteral">""</span>,
-<a name="l01488"></a>01488                                             (input_name != NULL)?input_name:<span class="stringliteral">""</span>,
-<a name="l01489"></a>01489                                             value_name);
-<a name="l01490"></a>01490     }
-<a name="l01491"></a>01491     <span class="keywordflow">else</span>
-<a name="l01492"></a>01492     {
-<a name="l01493"></a>01493         cpl_msg_info(                       cpl_func,
-<a name="l01494"></a>01494                                             <span class="stringliteral">"Using input value%s%s: "</span>
-<a name="l01495"></a>01495                                             <span class="stringliteral">"%s = %f +- %f"</span>,
-<a name="l01496"></a>01496                                             (input_name != NULL)?<span class="stringliteral">" from "</span>:<span class="stringliteral">""</span>,
-<a name="l01497"></a>01497                                             (input_name != NULL)?input_name:<span class="stringliteral">""</span>,
-<a name="l01498"></a>01498                                             value_name,
-<a name="l01499"></a>01499                                             value,
-<a name="l01500"></a>01500                                             value_error);
-<a name="l01501"></a>01501     }
-<a name="l01502"></a>01502     
-<a name="l01503"></a>01503     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?
-<a name="l01504"></a>01504                 CPL_ERROR_NONE :
-<a name="l01505"></a>01505                 cpl_error_get_code());
-<a name="l01506"></a>01506 }
-<a name="l01507"></a>01507 
-<a name="l01508"></a>01508 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01509"></a>01509 <span class="preprocessor">#undef cleanup</span>
-<a name="l01510"></a>01510 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01511"></a>01511 <span class="preprocessor">do { \</span>
-<a name="l01512"></a>01512 <span class="preprocessor">    cpl_array_delete(airmasses); airmasses = NULL; \</span>
-<a name="l01513"></a>01513 <span class="preprocessor">} while (0)</span>
-<a name="l01514"></a>01514 <span class="preprocessor"></span>
-<a name="l01520"></a>01520 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01521"></a>01521 <span class="keyword">static</span> cpl_error_code
-<a name="l01522"></a><a class="code" href="group__fors__photometry.html#g7a7ad98c36de98c254af8f74f436a347">01522</a> <a class="code" href="group__fors__photometry.html#g7a7ad98c36de98c254af8f74f436a347">fors_photometry_check_fitparam_atm_ext</a>(     entry_list      *obsl,
-<a name="l01523"></a>01523                                             <a class="code" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> fit_e,
-<a name="l01524"></a>01524                                             <span class="keywordtype">bool</span>            fit_z)
-<a name="l01525"></a>01525 {
-<a name="l01526"></a>01526     <a class="code" href="structentry.html">entry</a>           *e;
-<a name="l01527"></a>01527     <span class="keywordtype">int</span>             n_atm_ext_indices = 0;
-<a name="l01528"></a>01528     cpl_array       *airmasses = NULL;
-<a name="l01529"></a>01529     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l01530"></a>01530     
-<a name="l01531"></a>01531     cassure_automsg(                        obsl != NULL,
-<a name="l01532"></a>01532                                             CPL_ERROR_NULL_INPUT,
-<a name="l01533"></a>01533                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01534"></a>01534     
-<a name="l01535"></a>01535     <span class="comment">/* we only have a problem if we want to fit the zeropoint and the</span>
-<a name="l01536"></a>01536 <span class="comment">     * atmospheric extinction at the same time, but there are not</span>
-<a name="l01537"></a>01537 <span class="comment">     * enough airmasses */</span>
-<a name="l01538"></a>01538     <span class="keywordflow">if</span> (!fit_z || fit_e == FORS_FIT_NCOEFF_NO)
-<a name="l01539"></a>01539     {
-<a name="l01540"></a>01540         <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l01541"></a>01541     }
-<a name="l01542"></a>01542     
-<a name="l01543"></a>01543     <span class="comment">/* count the indices */</span>
-<a name="l01544"></a>01544     <span class="keywordflow">for</span> (e = entry_list_first(obsl); e!=NULL; e = entry_list_next(obsl))
-<a name="l01545"></a>01545     {
-<a name="l01546"></a>01546         <span class="keywordflow">if</span> (e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> >= n_atm_ext_indices)
-<a name="l01547"></a>01547             n_atm_ext_indices = e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> + 1;
-<a name="l01548"></a>01548     }
-<a name="l01549"></a>01549     
-<a name="l01550"></a>01550     <span class="comment">/*assure(                                 cpl_errorstate_is_equal(errstat),</span>
-<a name="l01551"></a>01551 <span class="comment">                                            return cpl_error_get_code(),</span>
-<a name="l01552"></a>01552 <span class="comment">                                            NULL);*/</span>
-<a name="l01553"></a>01553 
-<a name="l01554"></a>01554     <span class="comment">/* Check whether there are at least 2 different airmasses for</span>
-<a name="l01555"></a>01555 <span class="comment">     * at least 1 atmospheric extinction</span>
-<a name="l01556"></a>01556 <span class="comment">     */</span>
-<a name="l01557"></a>01557     <span class="keywordflow">if</span> (n_atm_ext_indices > 0)
-<a name="l01558"></a>01558     {
-<a name="l01559"></a>01559         <span class="keywordtype">bool</span>    multiple_found = <span class="keyword">false</span>;
-<a name="l01560"></a>01560         
-<a name="l01561"></a>01561         airmasses = cpl_array_new(n_atm_ext_indices, CPL_TYPE_DOUBLE);
-<a name="l01562"></a>01562         
-<a name="l01563"></a>01563         <span class="keywordflow">for</span> (   e = entry_list_first(obsl);
-<a name="l01564"></a>01564                 e != NULL;
-<a name="l01565"></a>01565                 e = entry_list_next(obsl))
-<a name="l01566"></a>01566         {
-<a name="l01567"></a>01567             <span class="keywordtype">double</span>  first_airmass;
-<a name="l01568"></a>01568             <span class="keywordtype">int</span>     is_set;
-<a name="l01569"></a>01569             first_airmass = cpl_array_get_double(
-<a name="l01570"></a>01570                                             airmasses,
-<a name="l01571"></a>01571                                             e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a>,
-<a name="l01572"></a>01572                                             &is_set); 
-<a name="l01573"></a>01573             passure(                        cpl_errorstate_is_equal(errstat),
-<a name="l01574"></a>01574                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01575"></a>01575             is_set = (is_set == 0);
-<a name="l01576"></a>01576             <span class="keywordflow">if</span> (!is_set)
-<a name="l01577"></a>01577                 cpl_array_set_double(airmasses, e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a>, e-><a class="code" href="structentry.html#6f585239f5d6905b0cff05055d77bf9c">airmass</a>);
-<a name="l01578"></a>01578             <span class="keywordflow">else</span>
-<a name="l01579"></a>01579             {
-<a name="l01580"></a>01580                 <span class="comment">/* if there is a different airmass for this ext index */</span>
-<a name="l01581"></a>01581                 <span class="keywordflow">if</span> (fabs(e-><a class="code" href="structentry.html#6f585239f5d6905b0cff05055d77bf9c">airmass</a> - first_airmass) > 10*DBL_EPSILON)
-<a name="l01582"></a>01582                 {
-<a name="l01583"></a>01583                     multiple_found = <span class="keyword">true</span>;
-<a name="l01584"></a>01584                     <span class="keywordflow">break</span>;
-<a name="l01585"></a>01585                 }
-<a name="l01586"></a>01586                 <span class="comment">/* we won't check here whether the difference in airmass is</span>
-<a name="l01587"></a>01587 <span class="comment">                 * too small to get reliable results, that will turn out</span>
-<a name="l01588"></a>01588 <span class="comment">                 * in the errors of the output after fitting */</span>
-<a name="l01589"></a>01589             }
-<a name="l01590"></a>01590         }
-<a name="l01591"></a>01591         
-<a name="l01592"></a>01592         <span class="keywordflow">if</span> (!multiple_found)
-<a name="l01593"></a>01593         {
-<a name="l01594"></a>01594             <span class="keywordflow">if</span> (n_atm_ext_indices > 1)
-<a name="l01595"></a>01595                 cpl_msg_error(              cpl_func,
-<a name="l01596"></a>01596                                             <span class="stringliteral">"No atmospheric extinction was "</span>
-<a name="l01597"></a>01597                                             <span class="stringliteral">"observed at different airmasses."</span>);
-<a name="l01598"></a>01598             <span class="keywordflow">else</span>
-<a name="l01599"></a>01599                 cpl_msg_error(              cpl_func,
-<a name="l01600"></a>01600                                             <span class="stringliteral">"Atmospheric extinction was not "</span>
-<a name="l01601"></a>01601                                             <span class="stringliteral">"observed at different airmasses."</span>);
-<a name="l01602"></a>01602         }
-<a name="l01603"></a>01603         cassure(                            multiple_found,
-<a name="l01604"></a>01604                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l01605"></a>01605                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l01606"></a>01606                                             <span class="stringliteral">"For fitting the zeropoint and "</span>
-<a name="l01607"></a>01607                                             <span class="stringliteral">"atmospheric extinction, "</span>
-<a name="l01608"></a>01608                                             <span class="stringliteral">"there must be >= 2 different "</span>
-<a name="l01609"></a>01609                                             <span class="stringliteral">"airmasses for at least 1 "</span>
-<a name="l01610"></a>01610                                             <span class="stringliteral">"atmospheric extinction"</span>);
-<a name="l01611"></a>01611     }
-<a name="l01612"></a>01612     
-<a name="l01613"></a>01613     cpl_array_delete(airmasses);
-<a name="l01614"></a>01614     
-<a name="l01615"></a>01615     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?
-<a name="l01616"></a>01616             CPL_ERROR_NONE :
-<a name="l01617"></a>01617             cpl_error_get_code());
-<a name="l01618"></a>01618 }
-<a name="l01619"></a>01619 
-<a name="l01620"></a>01620 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01621"></a>01621 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01622"></a>01622 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l01623"></a><a class="code" href="group__fors__photometry.html#g331bcb497e4f6c6520ca1fd2770aa40a">01623</a> <a class="code" href="group__fors__photometry.html#g331bcb497e4f6c6520ca1fd2770aa40a">myprintf</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *format, ...) 
-<a name="l01624"></a>01624 {
-<a name="l01625"></a>01625     va_list al;
-<a name="l01626"></a>01626     
-<a name="l01627"></a>01627     va_start(al, format);
-<a name="l01628"></a>01628     <span class="comment">//vprintf(format, al);</span>
-<a name="l01629"></a>01629     va_end(al);
-<a name="l01630"></a>01630 
-<a name="l01631"></a>01631     <span class="keywordflow">return</span>;
-<a name="l01632"></a>01632 }
-<a name="l01633"></a>01633 
-<a name="l01634"></a>01634 
-<a name="l01635"></a>01635 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01636"></a>01636 <span class="comment">/* Internal CPL function, duplicated */</span>
-<a name="l01637"></a>01637 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01638"></a><a class="code" href="group__fors__photometry.html#gf9cd7f47ec72c0d957c1e83280b2f1ed">01638</a> <span class="keyword">static</span> cpl_matrix * <a class="code" href="group__fors__photometry.html#gf9cd7f47ec72c0d957c1e83280b2f1ed">matrix_product_normal_create</a>(<span class="keyword">const</span> cpl_matrix * <span class="keyword">self</span>)
-<a name="l01639"></a>01639 {
-<a name="l01640"></a>01640     <span class="keywordtype">double</span>         sum;
-<a name="l01641"></a>01641     cpl_matrix   * product;
-<a name="l01642"></a>01642     <span class="keyword">const</span> <span class="keywordtype">double</span> * ai = cpl_matrix_get_data_const(<span class="keyword">self</span>);
-<a name="l01643"></a>01643     <span class="keyword">const</span> <span class="keywordtype">double</span> * aj;
-<a name="l01644"></a>01644     <span class="keywordtype">double</span>       * bwrite;
-<a name="l01645"></a>01645     <span class="keyword">const</span> <span class="keywordtype">int</span>      m = cpl_matrix_get_nrow(<span class="keyword">self</span>);
-<a name="l01646"></a>01646     <span class="keyword">const</span> <span class="keywordtype">int</span>      n = cpl_matrix_get_ncol(<span class="keyword">self</span>);
-<a name="l01647"></a>01647     <span class="keywordtype">int</span>            i, j, k;
-<a name="l01648"></a>01648 
-<a name="l01649"></a>01649 
-<a name="l01650"></a>01650     cpl_ensure(<span class="keyword">self</span> != NULL, CPL_ERROR_NULL_INPUT, NULL);
-<a name="l01651"></a>01651 
-<a name="l01652"></a>01652 <span class="preprocessor">#if 0</span>
-<a name="l01653"></a>01653 <span class="preprocessor"></span>    <span class="comment">/* Initialize all values to zero.</span>
-<a name="l01654"></a>01654 <span class="comment">       This is done to avoid access of uninitilized memory,  in case</span>
-<a name="l01655"></a>01655 <span class="comment">       someone passes the matrix to for example cpl_matrix_dump(). */</span>
-<a name="l01656"></a>01656     product = cpl_matrix_new(m, m);
-<a name="l01657"></a>01657     bwrite = cpl_matrix_get_data(product);
-<a name="l01658"></a>01658 <span class="preprocessor">#else</span>
-<a name="l01659"></a>01659 <span class="preprocessor"></span>    bwrite = (<span class="keywordtype">double</span> *) cpl_malloc(m * m * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01660"></a>01660     product = cpl_matrix_wrap(m, m, bwrite);
-<a name="l01661"></a>01661 <span class="preprocessor">#endif</span>
-<a name="l01662"></a>01662 <span class="preprocessor"></span>
-<a name="l01663"></a>01663     <span class="comment">/* The result at (i,j) is the dot-product of i'th and j'th row */</span>
-<a name="l01664"></a>01664     <span class="keywordflow">for</span> (i = 0; i < m; i++, bwrite += m, ai += n) {
-<a name="l01665"></a>01665         aj = ai; <span class="comment">/* aj points to first entry in j'th row */</span>
-<a name="l01666"></a>01666         <span class="keywordflow">for</span> (j = i; j < m; j++, aj += n) {
-<a name="l01667"></a>01667             sum = 0.0;
-<a name="l01668"></a>01668             <span class="keywordflow">for</span> (k = 0; k < n; k++) {
-<a name="l01669"></a>01669                 sum += ai[k] * aj[k];
-<a name="l01670"></a>01670             }
-<a name="l01671"></a>01671             bwrite[j] = sum;
-<a name="l01672"></a>01672         }
-<a name="l01673"></a>01673     }
-<a name="l01674"></a>01674 
-<a name="l01675"></a>01675     <span class="keywordflow">return</span> product;
-<a name="l01676"></a>01676 }
-<a name="l01677"></a>01677 
-<a name="l01678"></a>01678 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01679"></a>01679 <span class="preprocessor">#undef cleanup</span>
-<a name="l01680"></a>01680 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01681"></a>01681 <span class="preprocessor">do { \</span>
-<a name="l01682"></a>01682 <span class="preprocessor">    fors_matrix_null(&solution); \</span>
-<a name="l01683"></a>01683 <span class="preprocessor">    fors_matrix_null(&cov1); \</span>
-<a name="l01684"></a>01684 <span class="preprocessor">    fors_matrix_null(&At); \</span>
-<a name="l01685"></a>01685 <span class="preprocessor">    fors_matrix_null(&AtC); \</span>
-<a name="l01686"></a>01686 <span class="preprocessor">    fors_matrix_null(&AtCA); \</span>
-<a name="l01687"></a>01687 <span class="preprocessor">    fors_matrix_null(&p); \</span>
-<a name="l01688"></a>01688 <span class="preprocessor">    fors_matrix_null(&Ap); \</span>
-<a name="l01689"></a>01689 <span class="preprocessor">    fors_matrix_null(&bAp); \</span>
-<a name="l01690"></a>01690 <span class="preprocessor">    fors_matrix_null(&bApt); \</span>
-<a name="l01691"></a>01691 <span class="preprocessor">    fors_matrix_null(&C1bAp); \</span>
-<a name="l01692"></a>01692 <span class="preprocessor">    fors_matrix_null(&chi2); \</span>
-<a name="l01693"></a>01693 <span class="preprocessor">} while (0)</span>
-<a name="l01694"></a>01694 <span class="preprocessor"></span><span class="comment">/* </span>
-<a name="l01695"></a>01695 <span class="comment">   @brief Linear correlated weighted least squares fit</span>
-<a name="l01696"></a>01696 <span class="comment">   @param coeff      design matrix (A)</span>
-<a name="l01697"></a>01697 <span class="comment">   @param rhs        right hand side (b)</span>
-<a name="l01698"></a>01698 <span class="comment">   @param cov_rhs    covariance of b (C)</span>
-<a name="l01699"></a>01699 <span class="comment">   @param red_chisq  (output) reduced chi squared, or NULL</span>
-<a name="l01700"></a>01700 <span class="comment"></span>
-<a name="l01701"></a>01701 <span class="comment">   Similar to cpl_matrix_solve_normal, except the output matrix is not</span>
-<a name="l01702"></a>01702 <span class="comment">   a m x 1 matrix</span>
-<a name="l01703"></a>01703 <span class="comment"></span>
-<a name="l01704"></a>01704 <span class="comment">   x0</span>
-<a name="l01705"></a>01705 <span class="comment">   x1</span>
-<a name="l01706"></a>01706 <span class="comment">   x2</span>
-<a name="l01707"></a>01707 <span class="comment">   :</span>
-<a name="l01708"></a>01708 <span class="comment"></span>
-<a name="l01709"></a>01709 <span class="comment">   but an m x (m+1) matrix</span>
-<a name="l01710"></a>01710 <span class="comment"></span>
-<a name="l01711"></a>01711 <span class="comment">   x0  C00 C01 C02 ...</span>
-<a name="l01712"></a>01712 <span class="comment">   x1  C10 C11 </span>
-<a name="l01713"></a>01713 <span class="comment">   x2  C20     . </span>
-<a name="l01714"></a>01714 <span class="comment">   :   :        .</span>
-<a name="l01715"></a>01715 <span class="comment"></span>
-<a name="l01716"></a>01716 <span class="comment">   where the first column is the least chi squared solution to the</span>
-<a name="l01717"></a>01717 <span class="comment">   overdetermined equation system Ax = b, given the covariance, C, of b.</span>
-<a name="l01718"></a>01718 <span class="comment"></span>
-<a name="l01719"></a>01719 <span class="comment">   and the last m columns is the covariance matrix of the solution</span>
-<a name="l01720"></a>01720 <span class="comment">   (A^t C^-1 A)^-1</span>
-<a name="l01721"></a>01721 <span class="comment"></span>
-<a name="l01722"></a>01722 <span class="comment">   The reduced chi squared is given by</span>
-<a name="l01723"></a>01723 <span class="comment">   </span>
-<a name="l01724"></a>01724 <span class="comment">     (b-Ap)^t C^-1 (b-Ap) / (degrees of freedom)</span>
-<a name="l01725"></a>01725 <span class="comment"></span>
-<a name="l01726"></a>01726 <span class="comment">   where  degrees of freedom = |b| - |p|</span>
-<a name="l01727"></a>01727 <span class="comment"></span>
-<a name="l01728"></a>01728 <span class="comment"> */</span>
-<a name="l01729"></a>01729 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01730"></a>01730 <span class="keyword">static</span> cpl_matrix *
-<a name="l01731"></a><a class="code" href="group__fors__photometry.html#g5559595786d24c15da25069870a45ddc">01731</a> <a class="code" href="group__fors__photometry.html#g5559595786d24c15da25069870a45ddc">solve_normal</a>(<span class="keyword">const</span> cpl_matrix *coeff, 
-<a name="l01732"></a>01732              <span class="keyword">const</span> cpl_matrix *rhs,
-<a name="l01733"></a>01733              <span class="keyword">const</span> cpl_matrix *cov_rhs,
-<a name="l01734"></a>01734              <span class="keywordtype">double</span> *red_chisq)
-<a name="l01735"></a>01735 {
-<a name="l01736"></a>01736     cpl_matrix      *solution = NULL;
-<a name="l01737"></a>01737     cpl_matrix      *cov1 = NULL;  <span class="comment">/* C^-1 */</span>
-<a name="l01738"></a>01738     cpl_matrix      *At = NULL;    <span class="comment">/* A^t */</span>
-<a name="l01739"></a>01739     cpl_matrix      *AtC = NULL;   <span class="comment">/* A^t C^-1 */</span>
-<a name="l01740"></a>01740     cpl_matrix      *AtCA = NULL;  <span class="comment">/* A^t C^-1 A */</span>
-<a name="l01741"></a>01741     cpl_matrix      *p = NULL;
-<a name="l01742"></a>01742     cpl_matrix      *Ap = NULL;
-<a name="l01743"></a>01743     cpl_matrix      *bAp = NULL;
-<a name="l01744"></a>01744     cpl_matrix      *bApt = NULL;
-<a name="l01745"></a>01745     cpl_matrix      *C1bAp = NULL;
-<a name="l01746"></a>01746     cpl_matrix      *chi2 = NULL;
-<a name="l01747"></a>01747     cpl_error_code  error;
-<a name="l01748"></a>01748 
-<a name="l01749"></a>01749     cpl_ensure(coeff   != NULL, CPL_ERROR_NULL_INPUT, NULL);
-<a name="l01750"></a>01750     cpl_ensure(rhs     != NULL, CPL_ERROR_NULL_INPUT, NULL);
-<a name="l01751"></a>01751     cpl_ensure(cov_rhs != NULL, CPL_ERROR_NULL_INPUT, NULL);
-<a name="l01752"></a>01752 
-<a name="l01753"></a>01753     <span class="comment">/* The overall time is probably dominated by this</span>
-<a name="l01754"></a>01754 <span class="comment">       matrix inversion which is O(n^3) if C is nxn */</span>
-<a name="l01755"></a>01755     cov1 = cpl_matrix_invert_create(cov_rhs);
-<a name="l01756"></a>01756 
-<a name="l01757"></a>01757     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cov1 != NULL, <span class="keywordflow">return</span> NULL, 
-<a name="l01758"></a>01758             <span class="stringliteral">"Could not invert covariance matrix. Make sure that provided "</span>
-<a name="l01759"></a>01759             <span class="stringliteral">"errors are positive"</span>);
-<a name="l01760"></a>01760     <span class="comment">/* The covariance matrix is singular if one (or more) eigenvalue is</span>
-<a name="l01761"></a>01761 <span class="comment">       zero, i.e. if there exist a unitary transformation (rotation of</span>
-<a name="l01762"></a>01762 <span class="comment">       coordinates) that makes the variance of one of the new coordinates</span>
-<a name="l01763"></a>01763 <span class="comment">       zero (and therefore a failure at this place is probably because the</span>
-<a name="l01764"></a>01764 <span class="comment">       user has provided some non-positive error).</span>
-<a name="l01765"></a>01765 <span class="comment">    */</span>
-<a name="l01766"></a>01766     
-<a name="l01767"></a>01767     At  = cpl_matrix_transpose_create(coeff);
-<a name="l01768"></a>01768 
-<a name="l01769"></a>01769     AtC = cpl_matrix_product_create(At, cov1);   
-<a name="l01770"></a>01770 
-<a name="l01771"></a>01771     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&At);
-<a name="l01772"></a>01772 
-<a name="l01773"></a>01773     AtCA = cpl_matrix_product_create(AtC, coeff);
-<a name="l01774"></a>01774     
-<a name="l01775"></a>01775     solution = cpl_matrix_product_create(AtC, rhs);
-<a name="l01776"></a>01776     cpl_matrix_set_size(solution, 
-<a name="l01777"></a>01777                         cpl_matrix_get_nrow(solution),
-<a name="l01778"></a>01778                         1 + cpl_matrix_get_nrow(solution));
-<a name="l01779"></a>01779     {
-<a name="l01780"></a>01780         <span class="keywordtype">int</span> i = 0;
-<a name="l01781"></a>01781         <span class="keywordflow">for</span> (i = 0; i < cpl_matrix_get_nrow(solution); i++) {
-<a name="l01782"></a>01782             cpl_matrix_set(solution, i, i+1, 1);
-<a name="l01783"></a>01783         }
-<a name="l01784"></a>01784     }
-<a name="l01785"></a>01785 
-<a name="l01786"></a>01786     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&AtC);
-<a name="l01787"></a>01787 
-<a name="l01788"></a>01788     <span class="comment">//cpl_matrix_dump(AtCA, stdout);</span>
-<a name="l01789"></a>01789     <span class="comment">//cpl_matrix_dump(solution, stdout);</span>
-<a name="l01790"></a>01790     
-<a name="l01791"></a>01791     error = cpl_matrix_decomp_chol(AtCA);
-<a name="l01792"></a>01792     <span class="keywordflow">if</span> (!error) {
-<a name="l01793"></a>01793         error = cpl_matrix_solve_chol(AtCA, solution);
-<a name="l01794"></a>01794     }
-<a name="l01795"></a>01795     
-<a name="l01796"></a>01796     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&AtCA);
-<a name="l01797"></a>01797 
-<a name="l01798"></a>01798     <span class="keywordflow">if</span> (error) {
-<a name="l01799"></a>01799         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01800"></a>01800         cpl_ensure(0, error, NULL);
-<a name="l01801"></a>01801     }
-<a name="l01802"></a>01802 
-<a name="l01803"></a>01803 
-<a name="l01804"></a>01804     <span class="keywordflow">if</span> (red_chisq != NULL) {
-<a name="l01805"></a>01805 
-<a name="l01806"></a>01806         <span class="comment">/* Get first column vector, p, of solution */</span>
-<a name="l01807"></a>01807         p = cpl_matrix_duplicate(solution);
-<a name="l01808"></a>01808         cpl_matrix_set_size(p, cpl_matrix_get_nrow(p), 1);
-<a name="l01809"></a>01809         
-<a name="l01810"></a>01810         Ap = cpl_matrix_product_create(coeff, p);
-<a name="l01811"></a>01811 
-<a name="l01812"></a>01812         bAp = cpl_matrix_duplicate(rhs);
-<a name="l01813"></a>01813         cpl_matrix_subtract(bAp, Ap);
-<a name="l01814"></a>01814 
-<a name="l01815"></a>01815         bApt = cpl_matrix_transpose_create(bAp);
-<a name="l01816"></a>01816 
-<a name="l01817"></a>01817         C1bAp = cpl_matrix_product_create(cov1, bAp);
-<a name="l01818"></a>01818 
-<a name="l01819"></a>01819         chi2 =  cpl_matrix_product_create(bApt, C1bAp);
-<a name="l01820"></a>01820 
-<a name="l01821"></a>01821         passure(cpl_matrix_get_nrow(chi2) == 1 &&
-<a name="l01822"></a>01822                 cpl_matrix_get_ncol(chi2) == 1, <span class="keywordflow">return</span> NULL);
-<a name="l01823"></a>01823 
-<a name="l01824"></a>01824         *red_chisq = cpl_matrix_get(chi2, 0, 0) /
-<a name="l01825"></a>01825             (cpl_matrix_get_nrow(rhs) - cpl_matrix_get_nrow(p));
-<a name="l01826"></a>01826 
-<a name="l01827"></a>01827     }
-<a name="l01828"></a>01828     
-<a name="l01829"></a>01829     cpl_matrix  *return_solution = solution; solution = NULL;
-<a name="l01830"></a>01830     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01831"></a>01831 
-<a name="l01832"></a>01832     <span class="keywordflow">return</span> return_solution;
-<a name="l01833"></a>01833 }
-<a name="l01834"></a>01834 
-<a name="l01835"></a>01835 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01836"></a>01836 <span class="preprocessor">#undef cleanup</span>
-<a name="l01837"></a>01837 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01838"></a>01838 <span class="preprocessor">do { \</span>
-<a name="l01839"></a>01839 <span class="preprocessor">    cpl_frameset_delete((cpl_frameset *)aligned_phot_frames);        \</span>
-<a name="l01840"></a>01840 <span class="preprocessor">    cpl_frameset_delete((cpl_frameset *)master_flat_frame); \</span>
-<a name="l01841"></a>01841 <span class="preprocessor">    cpl_frameset_delete((cpl_frameset *)phot_table); \</span>
-<a name="l01842"></a>01842 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l01843"></a>01843 <span class="preprocessor">    fors_image_delete(&master_flat); \</span>
-<a name="l01844"></a>01844 <span class="preprocessor">    fors_image_delete(&correction); \</span>
-<a name="l01845"></a>01845 <span class="preprocessor">    cpl_table_delete(phot_coeff); \</span>
-<a name="l01846"></a>01846 <span class="preprocessor">    cpl_table_delete(summary); \</span>
-<a name="l01847"></a>01847 <span class="preprocessor">    fors_delete_star_lists(&obs, &std_star_list); \</span>
-<a name="l01848"></a>01848 <span class="preprocessor">    cpl_array_delete(n_std_star_obs); n_std_star_obs = NULL; \</span>
-<a name="l01849"></a>01849 <span class="preprocessor">    fors_matrix_null(&eqn_lhs); \</span>
-<a name="l01850"></a>01850 <span class="preprocessor">    fors_matrix_null(&eqn_rhs); \</span>
-<a name="l01851"></a>01851 <span class="preprocessor">    fors_matrix_null(&eqn_cov_rhs); \</span>
-<a name="l01852"></a>01852 <span class="preprocessor">    fors_matrix_null(&eqn_result); \</span>
-<a name="l01853"></a>01853 <span class="preprocessor">    fors_matrix_null(&tmp_mat); \</span>
-<a name="l01854"></a>01854 <span class="preprocessor">    fors_matrix_null(&result_polyf); \</span>
-<a name="l01855"></a>01855 <span class="preprocessor">    fors_matrix_null(&result_cov_polyf); \</span>
-<a name="l01856"></a>01856 <span class="preprocessor">    fors_matrix_null(&result_params); \</span>
-<a name="l01857"></a>01857 <span class="preprocessor">    fors_matrix_null(&result_cov_params); \</span>
-<a name="l01858"></a>01858 <span class="preprocessor">    fors_matrix_null(&result_polyp); \</span>
-<a name="l01859"></a>01859 <span class="preprocessor">    fors_matrix_null(&result_cov_polyp); \</span>
-<a name="l01860"></a>01860 <span class="preprocessor">    cpl_polynomial_delete(polyf); polyf = NULL; \</span>
-<a name="l01861"></a>01861 <span class="preprocessor">    cpl_polynomial_delete(polyf_definition); polyf_definition = NULL; \</span>
-<a name="l01862"></a>01862 <span class="preprocessor">    cpl_polynomial_delete(polyf_variance); polyf_variance = NULL; \</span>
-<a name="l01863"></a>01863 <span class="preprocessor">    cpl_polynomial_delete(polyp); polyp = NULL; \</span>
-<a name="l01864"></a>01864 <span class="preprocessor">    cpl_polynomial_delete(polyp_definition); polyp_definition = NULL; \</span>
-<a name="l01865"></a>01865 <span class="preprocessor">} while (0)</span>
-<a name="l01866"></a>01866 <span class="preprocessor"></span>
-<a name="l01875"></a>01875 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01876"></a><a class="code" href="group__fors__photometry.html#g78298a3adaf4b775f4a48a21a2b475ba">01876</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__photometry.html#g78298a3adaf4b775f4a48a21a2b475ba">fors_photometry</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)
-<a name="l01877"></a>01877 {
-<a name="l01878"></a>01878     <span class="comment">/* Input */</span>
-<a name="l01879"></a>01879     <span class="keyword">const</span> cpl_frameset  *aligned_phot_frames = NULL,
-<a name="l01880"></a>01880                         *master_flat_frame   = NULL,
-<a name="l01881"></a>01881                         *phot_table          = NULL;
-<a name="l01882"></a>01882     <a class="code" href="struct__fors__image.html">fors_image</a>          *master_flat         = NULL;
-<a name="l01883"></a>01883 
-<a name="l01884"></a>01884     <span class="comment">/* Products */</span>
-<a name="l01885"></a>01885     <a class="code" href="struct__fors__image.html">fors_image</a>          *correction = NULL;
-<a name="l01886"></a>01886     cpl_table           *phot_coeff = NULL;
-<a name="l01887"></a>01887     cpl_table           *summary    = NULL;
-<a name="l01888"></a>01888     
-<a name="l01889"></a>01889     <span class="comment">/* Star lists */</span>
-<a name="l01890"></a>01890     fors_std_star_list  *std_star_list = NULL;
-<a name="l01891"></a>01891     entry_list          *obs = NULL;
-<a name="l01892"></a>01892     cpl_array           *n_std_star_obs = NULL;
-<a name="l01893"></a>01893     
-<a name="l01894"></a>01894     <span class="comment">/* Equation system */</span>
-<a name="l01895"></a>01895     cpl_matrix          *eqn_lhs = NULL,
-<a name="l01896"></a>01896                         *eqn_rhs = NULL,
-<a name="l01897"></a>01897                         *eqn_cov_rhs = NULL,
-<a name="l01898"></a>01898                         *eqn_result = NULL,
-<a name="l01899"></a>01899                         *result_polyf = NULL,
-<a name="l01900"></a>01900                         *result_cov_polyf = NULL,
-<a name="l01901"></a>01901                         *result_params = NULL,
-<a name="l01902"></a>01902                         *result_cov_params = NULL,
-<a name="l01903"></a>01903                         *result_polyp = NULL,
-<a name="l01904"></a>01904                         *result_cov_polyp = NULL,
-<a name="l01905"></a>01905                         *tmp_mat = NULL;
-<a name="l01906"></a>01906     
-<a name="l01907"></a>01907     <span class="comment">/* polynomials to fit */</span>
-<a name="l01908"></a>01908     cpl_polynomial      *polyf = NULL,
-<a name="l01909"></a>01909                         *polyf_definition = NULL,
-<a name="l01910"></a>01910                         *polyf_variance = NULL,
-<a name="l01911"></a>01911                         *polyp = NULL,
-<a name="l01912"></a>01912                         *polyp_definition = NULL;
-<a name="l01913"></a>01913     
-<a name="l01914"></a>01914     <span class="comment">/* Other */</span>
-<a name="l01915"></a>01915     <a class="code" href="struct__fors__setting.html">fors_setting</a>        *setting = NULL;
-<a name="l01916"></a>01916     <span class="keyword">const</span> <span class="keywordtype">char</span>          *tag     = NULL;
-<a name="l01917"></a>01917     <span class="keywordtype">int</span>                  row;
-<a name="l01918"></a>01918 
-<a name="l01919"></a>01919     <span class="comment">/* Photometric parameters */</span>
-<a name="l01920"></a>01920     cpl_propertylist *qc        = NULL;
-<a name="l01921"></a>01921     <span class="keywordtype">double</span> qc_zeropoint         = -1.0;
-<a name="l01922"></a>01922     <span class="keywordtype">double</span> qc_zeropoint_err     = -1.0;
-<a name="l01923"></a>01923     <span class="keywordtype">double</span> qc_extinction        = -1.0;
-<a name="l01924"></a>01924     <span class="keywordtype">double</span> qc_extinction_err    = -1.0;
-<a name="l01925"></a>01925     <span class="keywordtype">double</span> qc_colorterm         = -1.0;
-<a name="l01926"></a>01926     <span class="keywordtype">double</span> qc_colorterm_err     = -1.0;
-<a name="l01927"></a>01927     
-<a name="l01928"></a>01928     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l01929"></a>01929     <span class="comment">/* Find input */</span>
-<a name="l01930"></a>01930     aligned_phot_frames = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, ALIGNED_PHOT);
-<a name="l01931"></a>01931     cassure(cpl_frameset_get_size(aligned_phot_frames) > 0,
-<a name="l01932"></a>01932             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01933"></a>01933             <span class="keywordflow">return</span>, 
-<a name="l01934"></a>01934             <span class="stringliteral">"No %s provided"</span>, ALIGNED_PHOT);
-<a name="l01935"></a>01935 
-<a name="l01936"></a>01936     master_flat_frame = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, MASTER_SKY_FLAT_IMG);
-<a name="l01937"></a>01937     cassure(cpl_frameset_get_size(master_flat_frame) > 0,
-<a name="l01938"></a>01938             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01939"></a>01939             <span class="keywordflow">return</span>,
-<a name="l01940"></a>01940             <span class="stringliteral">"No %s provided"</span>, MASTER_SKY_FLAT_IMG);
-<a name="l01941"></a>01941     
-<a name="l01942"></a>01942     phot_table = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, PHOT_TABLE);
-<a name="l01943"></a>01943     cassure(cpl_frameset_get_size(phot_table) == 1,
-<a name="l01944"></a>01944             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01945"></a>01945             <span class="keywordflow">return</span>, 
-<a name="l01946"></a>01946             <span class="stringliteral">"One %s required. %d found"</span>,
-<a name="l01947"></a>01947             PHOT_TABLE, cpl_frameset_get_size(phot_table));
-<a name="l01948"></a>01948 
-<a name="l01949"></a>01949     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l01950"></a>01950     <span class="comment">/* Get command line parameters */</span>
-<a name="l01951"></a>01951     <span class="keywordtype">bool</span>            fit_z,
-<a name="l01952"></a>01952                     override_fit_m,
-<a name="l01953"></a>01953                     fit_c,
-<a name="l01954"></a>01954                     use_all;
-<a name="l01955"></a>01955     <span class="keywordtype">int</span>             degreef1,
-<a name="l01956"></a>01956                     degreef2,
-<a name="l01957"></a>01957                     degreep;
-<a name="l01958"></a>01958     <a class="code" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> fit_e;
-<a name="l01959"></a>01959     
-<a name="l01960"></a>01960     degreef1 = <a class="code" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">fors_photometry_parameter_get_num</a>(
-<a name="l01961"></a>01961                                             parameters,
-<a name="l01962"></a>01962                                             <span class="stringliteral">"degreef1"</span>,
-<a name="l01963"></a>01963                                             CPL_TYPE_INT);
-<a name="l01964"></a>01964     degreef2 = <a class="code" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">fors_photometry_parameter_get_num</a>(
-<a name="l01965"></a>01965                                             parameters,
-<a name="l01966"></a>01966                                             <span class="stringliteral">"degreef2"</span>,
-<a name="l01967"></a>01967                                             CPL_TYPE_INT);
-<a name="l01968"></a>01968     degreep = <a class="code" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">fors_photometry_parameter_get_num</a>(
-<a name="l01969"></a>01969                                             parameters,
-<a name="l01970"></a>01970                                             <span class="stringliteral">"degreep"</span>,
-<a name="l01971"></a>01971                                             CPL_TYPE_INT);
-<a name="l01972"></a>01972     fit_z = <a class="code" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">fors_photometry_parameter_get_num</a>(
-<a name="l01973"></a>01973                                             parameters,
-<a name="l01974"></a>01974                                             <span class="stringliteral">"fitz"</span>,
-<a name="l01975"></a>01975                                             CPL_TYPE_BOOL);
-<a name="l01976"></a>01976     override_fit_m = <a class="code" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">fors_photometry_parameter_get_num</a>(
-<a name="l01977"></a>01977                                             parameters,
-<a name="l01978"></a>01978                                             <span class="stringliteral">"fit_all_mag"</span>,
-<a name="l01979"></a>01979                                             CPL_TYPE_BOOL);
-<a name="l01980"></a>01980     fit_c = <a class="code" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">fors_photometry_parameter_get_num</a>(
-<a name="l01981"></a>01981                                             parameters,
-<a name="l01982"></a>01982                                             <span class="stringliteral">"fitc"</span>,
-<a name="l01983"></a>01983                                             CPL_TYPE_BOOL);
-<a name="l01984"></a>01984     use_all = <a class="code" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">fors_photometry_parameter_get_num</a>(
-<a name="l01985"></a>01985                                             parameters,
-<a name="l01986"></a>01986                                             <span class="stringliteral">"use_all_stars"</span>,
-<a name="l01987"></a>01987                                             CPL_TYPE_BOOL);
-<a name="l01988"></a>01988     fit_e = <a class="code" href="group__fors__photometry.html#g62ed7eadbdb3468fee3078879e13f25c">fors_photometry_parameter_get_ncoeff</a>(
-<a name="l01989"></a>01989                                             parameters,
-<a name="l01990"></a>01990                                             <span class="stringliteral">"fite"</span>);
-<a name="l01991"></a>01991     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l01992"></a>01992     
-<a name="l01993"></a>01993     <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERFRAME
-<a name="l01994"></a>01994         && fit_z == <span class="keyword">true</span>)
-<a name="l01995"></a>01995     {
-<a name="l01996"></a>01996         cpl_error_set_message(              cpl_func,
-<a name="l01997"></a>01997                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l01998"></a>01998                                             <span class="stringliteral">"Fitting one atmospheric "</span>
-<a name="l01999"></a>01999                                             <span class="stringliteral">"extinction per frame and the "</span>
-<a name="l02000"></a>02000                                             <span class="stringliteral">"zeropoint is ambiguous and "</span>
-<a name="l02001"></a>02001                                             <span class="stringliteral">"therefore not possible"</span>);
-<a name="l02002"></a>02002         <span class="keywordflow">return</span>;
-<a name="l02003"></a>02003     }
-<a name="l02004"></a>02004     
-<a name="l02005"></a>02005     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l02006"></a>02006     <span class="comment">/* Get instrument and filter settings */</span>
-<a name="l02007"></a>02007     
-<a name="l02008"></a>02008     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(             cpl_frameset_get_first_const(
-<a name="l02009"></a>02009                                                 aligned_phot_frames));
-<a name="l02010"></a>02010     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 !cpl_error_get_code(),
-<a name="l02011"></a>02011                                             <span class="keywordflow">return</span>,
-<a name="l02012"></a>02012                                             <span class="stringliteral">"Could not get instrument setting"</span>);
-<a name="l02013"></a>02013 
-<a name="l02014"></a>02014     <span class="comment">/* Load filter coefficients */</span>
-<a name="l02015"></a>02015     <span class="keyword">struct </span>phot_input {
-<a name="l02016"></a>02016         <span class="keywordtype">double</span>  color_coeff,
-<a name="l02017"></a>02017                 dcolor_coeff,
-<a name="l02018"></a>02018                 ext,
-<a name="l02019"></a>02019                 dext,
-<a name="l02020"></a>02020                 zpoint,
-<a name="l02021"></a>02021                 dzpoint;
-<a name="l02022"></a>02022     } phot_input;
-<a name="l02023"></a>02023 
-<a name="l02024"></a>02024     phot_input.color_coeff = 0.0;
-<a name="l02025"></a>02025     phot_input.dcolor_coeff = 0.0;
-<a name="l02026"></a>02026     phot_input.ext = 0.0;
-<a name="l02027"></a>02027     phot_input.dext = 0.0;
-<a name="l02028"></a>02028     phot_input.zpoint = 0.0;
-<a name="l02029"></a>02029     phot_input.dzpoint = 0.0;
-<a name="l02030"></a>02030 
-<a name="l02031"></a>02031     cpl_msg_info(cpl_func, <span class="stringliteral">"Loading photometry table"</span>);
-<a name="l02032"></a>02032     fors_phot_table_load(                   cpl_frameset_get_first_const(
-<a name="l02033"></a>02033                                                 phot_table),
-<a name="l02034"></a>02034                                             setting,
-<a name="l02035"></a>02035                                             fit_c ? NULL 
-<a name="l02036"></a>02036                                                   : &phot_input.color_coeff,
-<a name="l02037"></a>02037                                             fit_c ? NULL
-<a name="l02038"></a>02038                                                   : &phot_input.dcolor_coeff,
-<a name="l02039"></a>02039                                             fit_e != FORS_FIT_NCOEFF_NO ? NULL
-<a name="l02040"></a>02040                                                   : &phot_input.ext,
-<a name="l02041"></a>02041                                             fit_e != FORS_FIT_NCOEFF_NO ? NULL
-<a name="l02042"></a>02042                                                   : &phot_input.dext,
-<a name="l02043"></a>02043                                             fit_z ? NULL
-<a name="l02044"></a>02044                                                   : &phot_input.zpoint,
-<a name="l02045"></a>02045                                             fit_z ? NULL
-<a name="l02046"></a>02046                                                   : &phot_input.dzpoint);
-<a name="l02047"></a>02047     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 !cpl_error_get_code(),
-<a name="l02048"></a>02048                                             <span class="keywordflow">return</span>,
-<a name="l02049"></a>02049                                             <span class="stringliteral">"Could not load photometry table"</span>);
-<a name="l02050"></a>02050     
-<a name="l02051"></a>02051     <span class="comment">/* Check fixed photometric input */</span>
-<a name="l02052"></a>02052     cpl_msg_indent_more();
-<a name="l02053"></a>02053     <span class="keywordflow">if</span> (!fit_c)
-<a name="l02054"></a>02054     {
-<a name="l02055"></a>02055         <a class="code" href="group__fors__photometry.html#gfe5618566936c6f9809d639f9148ce4d">fors_photometry_check_input_value</a>(  phot_input.color_coeff,
-<a name="l02056"></a>02056                                             phot_input.dcolor_coeff,
-<a name="l02057"></a>02057                                             <span class="stringliteral">"color correction term"</span>,
-<a name="l02058"></a>02058                                             NULL<span class="comment">/*"photometry table"*/</span>,
-<a name="l02059"></a>02059                                             -10,<span class="comment">/* min limit */</span>
-<a name="l02060"></a>02060                                             10, <span class="comment">/* max limit */</span>
-<a name="l02061"></a>02061                                             1); <span class="comment">/* max error */</span>
-<a name="l02062"></a>02062     }
-<a name="l02063"></a>02063     <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_NO)
-<a name="l02064"></a>02064     {
-<a name="l02065"></a>02065         <a class="code" href="group__fors__photometry.html#gfe5618566936c6f9809d639f9148ce4d">fors_photometry_check_input_value</a>(  phot_input.ext,
-<a name="l02066"></a>02066                                             phot_input.dext,
-<a name="l02067"></a>02067                                             <span class="stringliteral">"atmospheric extinction"</span>,
-<a name="l02068"></a>02068                                             NULL<span class="comment">/*"photometry table"*/</span>,
-<a name="l02069"></a>02069                                             0,  <span class="comment">/* min limit */</span>
-<a name="l02070"></a>02070                                             5,  <span class="comment">/* max limit */</span>
-<a name="l02071"></a>02071                                             1); <span class="comment">/* max error */</span>
-<a name="l02072"></a>02072     }
-<a name="l02073"></a>02073     <span class="keywordflow">if</span> (!fit_z)
-<a name="l02074"></a>02074     {
-<a name="l02075"></a>02075         <a class="code" href="group__fors__photometry.html#gfe5618566936c6f9809d639f9148ce4d">fors_photometry_check_input_value</a>(  phot_input.zpoint,
-<a name="l02076"></a>02076                                             phot_input.dzpoint,
-<a name="l02077"></a>02077                                             <span class="stringliteral">"zeropoint"</span>,
-<a name="l02078"></a>02078                                             NULL<span class="comment">/*"photometry table"*/</span>,
-<a name="l02079"></a>02079                                             0,  <span class="comment">/* min limit */</span>
-<a name="l02080"></a>02080                                             50, <span class="comment">/* max limit */</span>
-<a name="l02081"></a>02081                                             1); <span class="comment">/* max error */</span>
-<a name="l02082"></a>02082     }
-<a name="l02083"></a>02083     cpl_msg_indent_less();
-<a name="l02084"></a>02084     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l02085"></a>02085         <span class="keywordflow">return</span>;
-<a name="l02086"></a>02086     
-<a name="l02087"></a>02087     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l02088"></a>02088     <span class="comment">/* Read input observation table */</span>
-<a name="l02089"></a>02089     <span class="keywordtype">int</span>                 n_mag_fits,
-<a name="l02090"></a>02090                         n_frames;
-<a name="l02091"></a>02091     int                 (*get_atm_ext_id_func)(<span class="keyword">const</span> cpl_propertylist*);
-<a name="l02092"></a>02092     
-<a name="l02093"></a>02093     cpl_msg_info(                           cpl_func,
-<a name="l02094"></a>02094                                             <span class="stringliteral">"Importing %s tables:"</span>,
-<a name="l02095"></a>02095                                             ALIGNED_PHOT);
-<a name="l02096"></a>02096     cpl_msg_indent_more();
-<a name="l02097"></a>02097     
-<a name="l02098"></a>02098     <span class="keywordflow">switch</span> (fit_e)
-<a name="l02099"></a>02099     {
-<a name="l02100"></a>02100         <span class="keywordflow">case</span> FORS_FIT_NCOEFF_PERNIGHT:
-<a name="l02101"></a>02101             get_atm_ext_id_func = <a class="code" href="group__fors__photometry.html#g294b0010ae795af85c28da476abadb18">fors_photometry_get_night_id</a>;
-<a name="l02102"></a>02102             <span class="keywordflow">break</span>;
-<a name="l02103"></a>02103         <span class="keywordflow">default</span>:
-<a name="l02104"></a>02104             get_atm_ext_id_func = NULL;
-<a name="l02105"></a>02105     }
-<a name="l02106"></a>02106     
-<a name="l02107"></a>02107     obs = <a class="code" href="group__fors__photometry.html#gd9e3544d21c84d8a62c36b859b2a4bcf">fors_photometry_read_input</a>(       aligned_phot_frames,
-<a name="l02108"></a>02108                                             setting,
-<a name="l02109"></a>02109                                             get_atm_ext_id_func,
-<a name="l02110"></a>02110                                             use_all,
-<a name="l02111"></a>02111                                             &n_frames,
-<a name="l02112"></a>02112                                             &std_star_list,
-<a name="l02113"></a>02113                                             degreef1 < 1);
-<a name="l02114"></a>02114     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);
-<a name="l02115"></a>02115     
-<a name="l02116"></a>02116     <a class="code" href="group__fors__photometry.html#g07d83baf5879b02b0224e2eb59390bed">fors_photometry_adjust_fit_mag_flags</a>(   std_star_list,
-<a name="l02117"></a>02117                                             obs,
-<a name="l02118"></a>02118                                             override_fit_m,
-<a name="l02119"></a>02119                                             &n_mag_fits);
-<a name="l02120"></a>02120     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);
-<a name="l02121"></a>02121     
-<a name="l02122"></a>02122     <a class="code" href="group__fors__photometry.html#g1491e01ccadf9b6d6b85316dfffd7f86">fors_photometry_atm_ext_create_indices</a>( obs,
-<a name="l02123"></a>02123                                             fit_e);
-<a name="l02124"></a>02124     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02125"></a>02125     
-<a name="l02126"></a>02126     <span class="keywordflow">if</span> (fit_e != FORS_FIT_NCOEFF_NO && fit_e != FORS_FIT_NCOEFF_ONE)
-<a name="l02127"></a>02127     {
-<a name="l02128"></a>02128         summary = <a class="code" href="group__fors__photometry.html#ga3a88672675c12a7d6f30f9e6cc1459a">fors_photometry_atm_ext_print_index_by_framename</a>(
-<a name="l02129"></a>02129                                             obs,
-<a name="l02130"></a>02130                                             aligned_phot_frames);
-<a name="l02131"></a>02131         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Internal error"</span> );
-<a name="l02132"></a>02132     }
-<a name="l02133"></a>02133     
-<a name="l02134"></a>02134     <a class="code" href="group__fors__photometry.html#gb82262e58905a5f0d047cf607614aa6d">fors_photometry_remove_unnecessary</a>(     std_star_list,
-<a name="l02135"></a>02135                                             obs,
-<a name="l02136"></a>02136                                             &n_mag_fits);
-<a name="l02137"></a>02137     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);
-<a name="l02138"></a>02138     
-<a name="l02139"></a>02139     <a class="code" href="group__fors__photometry.html#g7a7ad98c36de98c254af8f74f436a347">fors_photometry_check_fitparam_atm_ext</a>(obs, fit_e, fit_z);
-<a name="l02140"></a>02140     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);
-<a name="l02141"></a>02141     
-<a name="l02142"></a>02142     <a class="code" href="group__fors__photometry.html#g62dd2afbab9508f260ddcc65d8e00f80">entry_list_print</a>(obs, CPL_MSG_DEBUG);
-<a name="l02143"></a>02143 
-<a name="l02144"></a>02144     {
-<a name="l02145"></a>02145         <span class="keywordtype">int</span> ntot,
-<a name="l02146"></a>02146             n_std_stars;
-<a name="l02147"></a>02147         ntot = entry_list_size(obs);
-<a name="l02148"></a>02148         n_std_stars = fors_std_star_list_size(std_star_list);
-<a name="l02149"></a>02149         
-<a name="l02150"></a>02150         cpl_msg_info(cpl_func, 
-<a name="l02151"></a>02151                      <span class="stringliteral">"Found %d table%s, %d star%s, %d unique star%s, "</span>
-<a name="l02152"></a>02152                      <span class="stringliteral">"%d magnitude%s to determine"</span>,
-<a name="l02153"></a>02153                      n_frames,      n_frames != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>,
-<a name="l02154"></a>02154                      ntot,          ntot != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>, 
-<a name="l02155"></a>02155                      n_std_stars,   n_std_stars != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>,
-<a name="l02156"></a>02156                      n_mag_fits,    n_mag_fits != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>);
-<a name="l02157"></a>02157     }
-<a name="l02158"></a>02158     cpl_msg_indent_less();
-<a name="l02159"></a>02159 
-<a name="l02160"></a>02160     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l02161"></a>02161     <span class="comment">/* Build equation system */</span>
-<a name="l02162"></a>02162     <span class="keywordtype">int</span>         n_coeff_polyf = 0,
-<a name="l02163"></a>02163                 n_coeff_polyp = 0,
-<a name="l02164"></a>02164                 n_coeff_params = 0,
-<a name="l02165"></a>02165                 n_coeff_params_ext = 0;
-<a name="l02166"></a>02166     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&eqn_lhs);
-<a name="l02167"></a>02167     
-<a name="l02168"></a>02168     polyf_definition = <a class="code" href="group__fors__photometry.html#ge8d0a82d52e920497d6a5efd435760c6">fors_photometry_define_polyf</a>(
-<a name="l02169"></a>02169                                             degreef1,
-<a name="l02170"></a>02170                                             degreef2);
-<a name="l02171"></a>02171     polyp_definition = <a class="code" href="group__fors__photometry.html#ga8ebd4e57d8df9c4fb26a5ea59d52182">fors_photometry_define_polyp</a>(
-<a name="l02172"></a>02172                                             degreep);
-<a name="l02173"></a>02173     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);
-<a name="l02174"></a>02174     
-<a name="l02175"></a>02175     <span class="comment">/* Left hand side */</span>
-<a name="l02176"></a>02176     tmp_mat = <a class="code" href="group__fors__photometry.html#g55817cb490a2517ef207f96a9cf51b8b">build_equations_lhs_matrix_from_poly</a>(
-<a name="l02177"></a>02177                                             obs,
-<a name="l02178"></a>02178                                             polyf_definition,
-<a name="l02179"></a>02179                                             <span class="stringliteral">"f"</span>,
-<a name="l02180"></a>02180                                             &<a class="code" href="group__fors__photometry.html#gc10eb374497333bc41f877a56ff3bf94">entry_get_powers_x_y</a>);
-<a name="l02181"></a>02181     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);
-<a name="l02182"></a>02182     <span class="keywordflow">if</span> (tmp_mat != NULL) n_coeff_polyf = cpl_matrix_get_ncol(tmp_mat);
-<a name="l02183"></a>02183     <a class="code" href="group__fors__photometry.html#g99631efe7a94de4d3f563bfff57dc19a">fors_matrix_append_delete</a>(&eqn_lhs, &tmp_mat);
-<a name="l02184"></a>02184     
-<a name="l02185"></a>02185     tmp_mat = <a class="code" href="group__fors__photometry.html#gb269a10fede882f376f2e599965cebe4">build_equations_lhs_matrix_from_parameters</a>(
-<a name="l02186"></a>02186                                             obs,
-<a name="l02187"></a>02187                                             std_star_list,
-<a name="l02188"></a>02188                                             fit_z,
-<a name="l02189"></a>02189                                             fit_c,
-<a name="l02190"></a>02190                                             &n_coeff_params_ext);
-<a name="l02191"></a>02191     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);
-<a name="l02192"></a>02192     <span class="keywordflow">if</span> (tmp_mat != NULL) n_coeff_params = cpl_matrix_get_ncol(tmp_mat);
-<a name="l02193"></a>02193     <a class="code" href="group__fors__photometry.html#g99631efe7a94de4d3f563bfff57dc19a">fors_matrix_append_delete</a>(&eqn_lhs, &tmp_mat);
-<a name="l02194"></a>02194     
-<a name="l02195"></a>02195     tmp_mat = <a class="code" href="group__fors__photometry.html#g55817cb490a2517ef207f96a9cf51b8b">build_equations_lhs_matrix_from_poly</a>(
-<a name="l02196"></a>02196                                             obs,
-<a name="l02197"></a>02197                                             polyp_definition,
-<a name="l02198"></a>02198                                             <span class="stringliteral">"p"</span>,
-<a name="l02199"></a>02199                                             &<a class="code" href="group__fors__photometry.html#g4b6948f2884a7356d77f747894bdfd8f">entry_get_powers_airmass_color</a>);
-<a name="l02200"></a>02200     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);
-<a name="l02201"></a>02201     <span class="keywordflow">if</span> (tmp_mat != NULL) n_coeff_polyp = cpl_matrix_get_ncol(tmp_mat);
-<a name="l02202"></a>02202     <a class="code" href="group__fors__photometry.html#g99631efe7a94de4d3f563bfff57dc19a">fors_matrix_append_delete</a>(&eqn_lhs, &tmp_mat);
-<a name="l02203"></a>02203     
-<a name="l02204"></a>02204     <span class="comment">/* Right hand side */</span>
-<a name="l02205"></a>02205     <a class="code" href="group__fors__photometry.html#ge2d3cb795a4f549322f1febff5596787">build_equations_rhs_cov</a>(                obs,
-<a name="l02206"></a>02206                                             std_star_list,
-<a name="l02207"></a>02207                                             fit_z,
-<a name="l02208"></a>02208                                             fit_c,
-<a name="l02209"></a>02209                                             (n_coeff_params_ext > 0),<span class="comment">/* fit_e */</span>
-<a name="l02210"></a>02210                                             phot_input.color_coeff,
-<a name="l02211"></a>02211                                             phot_input.dcolor_coeff,
-<a name="l02212"></a>02212                                             phot_input.ext,
-<a name="l02213"></a>02213                                             phot_input.dext,
-<a name="l02214"></a>02214                                             phot_input.zpoint,
-<a name="l02215"></a>02215                                             phot_input.dzpoint,
-<a name="l02216"></a>02216                                             &eqn_rhs,
-<a name="l02217"></a>02217                                             &eqn_cov_rhs);
-<a name="l02218"></a>02218     <span class="comment">/*cpl_msg_info(cpl_func, "lhs");</span>
-<a name="l02219"></a>02219 <span class="comment">    cpl_matrix_dump(eqn_lhs, stdout);</span>
-<a name="l02220"></a>02220 <span class="comment">    cpl_msg_info(cpl_func, "rhs");</span>
-<a name="l02221"></a>02221 <span class="comment">    cpl_matrix_dump(eqn_rhs, stdout);</span>
-<a name="l02222"></a>02222 <span class="comment">    cpl_msg_info(cpl_func, "cov_rhs");</span>
-<a name="l02223"></a>02223 <span class="comment">    cpl_matrix_dump(eqn_cov_rhs, stdout);*/</span>
-<a name="l02224"></a>02224     
-<a name="l02225"></a>02225     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not setup rhs equations"</span> );
-<a name="l02226"></a>02226     
-<a name="l02227"></a>02227     <span class="keywordtype">int</span> n_parameters = cpl_matrix_get_ncol(eqn_lhs);
-<a name="l02228"></a>02228     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&tmp_mat);
-<a name="l02229"></a>02229     
-<a name="l02230"></a>02230     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l02231"></a>02231     <span class="comment">/* Solve the equation system */</span>
-<a name="l02232"></a>02232     {
-<a name="l02233"></a>02233         <span class="keywordtype">int</span> eqn_nrows = cpl_matrix_get_nrow(eqn_lhs);
-<a name="l02234"></a>02234         cpl_msg_info(cpl_func, <span class="stringliteral">"Solving %d equation%s for %d parameter%s"</span>,
-<a name="l02235"></a>02235                      eqn_nrows,  eqn_nrows != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>,
-<a name="l02236"></a>02236                      n_parameters, n_parameters != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>);
-<a name="l02237"></a>02237     }
-<a name="l02238"></a>02238 
-<a name="l02239"></a>02239     <span class="comment">/* Solve this overdetermined set of equations in the least chi squared</span>
-<a name="l02240"></a>02240 <span class="comment">       sense using Cholesky-decomposition, output matrix</span>
-<a name="l02241"></a>02241 <span class="comment">       is the solution vector (1st column) and the covariance matrix</span>
-<a name="l02242"></a>02242 <span class="comment">       in the remaining columns.</span>
-<a name="l02243"></a>02243 <span class="comment">    */</span>
-<a name="l02244"></a>02244     <span class="keywordtype">double</span> red_chisq;
-<a name="l02245"></a>02245     eqn_result = <a class="code" href="group__fors__photometry.html#g5559595786d24c15da25069870a45ddc">solve_normal</a>(              eqn_lhs,
-<a name="l02246"></a>02246                                             eqn_rhs,
-<a name="l02247"></a>02247                                             eqn_cov_rhs,
-<a name="l02248"></a>02248                                             &red_chisq);
-<a name="l02249"></a>02249     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&eqn_lhs);
-<a name="l02250"></a>02250     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&eqn_rhs);
-<a name="l02251"></a>02251     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&eqn_cov_rhs);
-<a name="l02252"></a>02252 
-<a name="l02253"></a>02253     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not solve equation system"</span>);
-<a name="l02254"></a>02254 
-<a name="l02255"></a>02255     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l02256"></a>02256     <span class="comment">/* Extract the partial results, propagate polynomial error */</span>
-<a name="l02257"></a>02257     
-<a name="l02258"></a>02258     <span class="comment">/* Print solution, convert to CPL polynomial */</span>
-<a name="l02259"></a>02259     <span class="keywordtype">int</span> offset = 0;
-<a name="l02260"></a>02260     {
-<a name="l02261"></a>02261         <span class="keywordtype">int</span> size = n_coeff_polyf;
-<a name="l02262"></a>02262         <span class="keywordflow">if</span> (size > 0)
-<a name="l02263"></a>02263         {
-<a name="l02264"></a>02264             result_polyf = cpl_matrix_extract(
-<a name="l02265"></a>02265                                             eqn_result,
-<a name="l02266"></a>02266                                             offset, 0,
-<a name="l02267"></a>02267                                             1, 1,
-<a name="l02268"></a>02268                                             size, 1);
-<a name="l02269"></a>02269             result_cov_polyf = cpl_matrix_extract(
-<a name="l02270"></a>02270                                             eqn_result,
-<a name="l02271"></a>02271                                             offset, 1+offset,
-<a name="l02272"></a>02272                                             1, 1,
-<a name="l02273"></a>02273                                             size, size);
-<a name="l02274"></a>02274             offset += size;
-<a name="l02275"></a>02275         }
-<a name="l02276"></a>02276     }
-<a name="l02277"></a>02277     {
-<a name="l02278"></a>02278         <span class="keywordtype">int</span> size = n_coeff_params;
-<a name="l02279"></a>02279         <span class="keywordflow">if</span> (size > 0)
-<a name="l02280"></a>02280         {
-<a name="l02281"></a>02281             result_params = cpl_matrix_extract(
-<a name="l02282"></a>02282                                             eqn_result,
-<a name="l02283"></a>02283                                             offset, 0,
-<a name="l02284"></a>02284                                             1, 1,
-<a name="l02285"></a>02285                                             size, 1);
-<a name="l02286"></a>02286             result_cov_params = cpl_matrix_extract(
-<a name="l02287"></a>02287                                             eqn_result,
-<a name="l02288"></a>02288                                             offset, 1+offset,
-<a name="l02289"></a>02289                                             1, 1,
-<a name="l02290"></a>02290                                             size, size);
-<a name="l02291"></a>02291         }
-<a name="l02292"></a>02292         offset += size;
-<a name="l02293"></a>02293     }
-<a name="l02294"></a>02294     {
-<a name="l02295"></a>02295         <span class="keywordtype">int</span> size = n_coeff_polyp;
-<a name="l02296"></a>02296         <span class="keywordflow">if</span> (size > 0)
-<a name="l02297"></a>02297         {
-<a name="l02298"></a>02298             result_polyp = cpl_matrix_extract(
-<a name="l02299"></a>02299                                             eqn_result,
-<a name="l02300"></a>02300                                             offset, 0,
-<a name="l02301"></a>02301                                             1, 1,
-<a name="l02302"></a>02302                                             size, 1);
-<a name="l02303"></a>02303             result_cov_polyp = cpl_matrix_extract(eqn_result,
-<a name="l02304"></a>02304                                             offset, 1+offset,
-<a name="l02305"></a>02305                                             1, 1,
-<a name="l02306"></a>02306                                             size, size);
-<a name="l02307"></a>02307         }
-<a name="l02308"></a>02308         offset += size;
-<a name="l02309"></a>02309     }
-<a name="l02310"></a>02310     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02311"></a>02311     
-<a name="l02312"></a>02312     <a class="code" href="group__fors__photometry.html#ga9ee56261da033d2a3ff241a68569522">fors_photometry_poly_new_from_coefficients</a>(
-<a name="l02313"></a>02313                                             polyf_definition,
-<a name="l02314"></a>02314                                             result_polyf,   <span class="comment">/* NULL if f empty*/</span>
-<a name="l02315"></a>02315                                             result_cov_polyf,<span class="comment">/* NULL if f emp.*/</span>
-<a name="l02316"></a>02316                                             &polyf,
-<a name="l02317"></a>02317                                             &polyf_variance);
-<a name="l02318"></a>02318     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02319"></a>02319     <a class="code" href="group__fors__photometry.html#ga9ee56261da033d2a3ff241a68569522">fors_photometry_poly_new_from_coefficients</a>(
-<a name="l02320"></a>02320                                             polyp_definition,
-<a name="l02321"></a>02321                                             result_polyp,   <span class="comment">/* NULL if p empty*/</span>
-<a name="l02322"></a>02322                                             NULL,<span class="comment">/* NULL if p emp.*/</span>
-<a name="l02323"></a>02323                                             &polyp,
-<a name="l02324"></a>02324                                             NULL);
-<a name="l02325"></a>02325     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02326"></a>02326     
-<a name="l02327"></a>02327     cpl_msg_indent_more();
-<a name="l02328"></a>02328     <a class="code" href="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb">fors_polynomial_dump</a>(polyf, <span class="stringliteral">"f"</span>, CPL_MSG_INFO, polyf_definition);
-<a name="l02329"></a>02329     <a class="code" href="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb">fors_polynomial_dump</a>(polyp, <span class="stringliteral">"p"</span>, CPL_MSG_INFO, polyp_definition);
-<a name="l02330"></a>02330     cpl_msg_indent_less();
-<a name="l02331"></a>02331     
-<a name="l02332"></a>02332     {
-<a name="l02333"></a>02333         <span class="comment">/* magnitudes */</span>
-<a name="l02334"></a>02334         <span class="keywordtype">int</span>                 k,
-<a name="l02335"></a>02335                             i = 0;
-<a name="l02336"></a>02336         <span class="keyword">const</span> fors_std_star *std;
-<a name="l02337"></a>02337         
-<a name="l02338"></a>02338         <span class="comment">/* count observations of std star objects */</span>
-<a name="l02339"></a>02339         n_std_star_obs = <a class="code" href="group__fors__photometry.html#gbb6ba893e672e51a2a83674b93fe4733">fors_photometry_count_observations</a>(
-<a name="l02340"></a>02340                                             std_star_list,
-<a name="l02341"></a>02341                                             obs);
-<a name="l02342"></a>02342         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02343"></a>02343         
-<a name="l02344"></a>02344         cpl_msg_indent_more();
-<a name="l02345"></a>02345         <span class="keywordflow">for</span> (   std = fors_std_star_list_first_const(std_star_list), k = 0;
-<a name="l02346"></a>02346                 std != NULL;
-<a name="l02347"></a>02347                 std = fors_std_star_list_next_const(std_star_list), k++)
-<a name="l02348"></a>02348         {
-<a name="l02349"></a>02349             <span class="keywordflow">if</span> (std->trusted)   <span class="comment">/* !(fit magnitude) */</span>
-<a name="l02350"></a>02350             {
-<a name="l02351"></a>02351                 cpl_msg_info(cpl_func, <span class="stringliteral">"M%d = %f +- %f mag (fixed, %s, %d obs)"</span>,
-<a name="l02352"></a>02352                              k,
-<a name="l02353"></a>02353                              std->magnitude,
-<a name="l02354"></a>02354                              std->dmagnitude,
-<a name="l02355"></a>02355                              std->name,
-<a name="l02356"></a>02356                              cpl_array_get_int(n_std_star_obs, k, NULL));
-<a name="l02357"></a>02357             }
-<a name="l02358"></a>02358             <span class="keywordflow">else</span> {
-<a name="l02359"></a>02359                 cpl_msg_info(cpl_func, <span class="stringliteral">"M%d = %f +- %f mag (free, %s, %d obs)"</span>,
-<a name="l02360"></a>02360                              k,
-<a name="l02361"></a>02361                              cpl_matrix_get(result_params, i, 0),
-<a name="l02362"></a>02362                              sqrt(cpl_matrix_get(result_cov_params, i, i)),
-<a name="l02363"></a>02363                              std->name,
-<a name="l02364"></a>02364                              cpl_array_get_int(n_std_star_obs, k, NULL));
-<a name="l02365"></a>02365                 i++;
-<a name="l02366"></a>02366             }
-<a name="l02367"></a>02367         }
-<a name="l02368"></a>02368         cpl_msg_indent_less();
-<a name="l02369"></a>02369         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02370"></a>02370         
-<a name="l02371"></a>02371         cpl_array_delete(n_std_star_obs); n_std_star_obs = NULL;
-<a name="l02372"></a>02372         fors_std_star_list_delete(&std_star_list, fors_std_star_delete);
-<a name="l02373"></a>02373         entry_list_delete(&obs, <a class="code" href="group__fors__photometry.html#g704bbcab4ba8418ff88419511eb5092b">entry_delete_but_standard</a>); obs = NULL;
-<a name="l02374"></a>02374 
-<a name="l02375"></a>02375         <span class="comment">/* zeropoint */</span>
-<a name="l02376"></a>02376         cpl_msg_indent_more();
-<a name="l02377"></a>02377         <span class="keywordflow">if</span> (fit_z)
-<a name="l02378"></a>02378         {
-<a name="l02379"></a>02379             qc_zeropoint = cpl_matrix_get(result_params, i, 0);
-<a name="l02380"></a>02380             qc_zeropoint_err = sqrt(cpl_matrix_get(result_cov_params, i, i));
-<a name="l02381"></a>02381             cpl_msg_info(cpl_func, <span class="stringliteral">"Z = %f +- %f mag"</span>,
-<a name="l02382"></a>02382                          qc_zeropoint,
-<a name="l02383"></a>02383                          qc_zeropoint_err);
-<a name="l02384"></a>02384             i++;
-<a name="l02385"></a>02385         }
-<a name="l02386"></a>02386         cpl_msg_indent_less();
-<a name="l02387"></a>02387         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02388"></a>02388         
-<a name="l02389"></a>02389         <span class="comment">/* extinction */</span>
-<a name="l02390"></a>02390         cpl_msg_indent_more();
-<a name="l02391"></a>02391         <span class="keywordflow">if</span> (n_coeff_params_ext > 0)
-<a name="l02392"></a>02392         {
-<a name="l02393"></a>02393             qc_extinction = cpl_matrix_get(result_params, i, 0);
-<a name="l02394"></a>02394             qc_extinction_err = sqrt(cpl_matrix_get(result_cov_params, i, i));
-<a name="l02395"></a>02395             <span class="keywordflow">if</span> (n_coeff_params_ext == 1)
-<a name="l02396"></a>02396             {
-<a name="l02397"></a>02397                 cpl_msg_info(cpl_func, <span class="stringliteral">"E = %f +- %f mag/airmass"</span>,
-<a name="l02398"></a>02398                              qc_extinction,
-<a name="l02399"></a>02399                              qc_extinction_err);
-<a name="l02400"></a>02400                 i++;
-<a name="l02401"></a>02401             }
-<a name="l02402"></a>02402             <span class="keywordflow">else</span>
-<a name="l02403"></a>02403             {
-<a name="l02404"></a>02404                 <span class="keywordflow">if</span> (summary) {
-<a name="l02405"></a>02405                     cpl_table_new_column(summary, <span class="stringliteral">"EXT"</span>, CPL_TYPE_DOUBLE);
-<a name="l02406"></a>02406                     cpl_table_new_column(summary, <span class="stringliteral">"DEXT"</span>, CPL_TYPE_DOUBLE);
-<a name="l02407"></a>02407                     <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERFRAME) {
-<a name="l02408"></a>02408                         cpl_table_new_column(summary, <span class="stringliteral">"MJD-OBS"</span>, 
-<a name="l02409"></a>02409                                              CPL_TYPE_DOUBLE);
-<a name="l02410"></a>02410                     }
-<a name="l02411"></a>02411                     <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERNIGHT) {
-<a name="l02412"></a>02412                         cpl_table_new_column(summary, <span class="stringliteral">"MJD-NIGHT"</span>, 
-<a name="l02413"></a>02413                                              CPL_TYPE_INT);
-<a name="l02414"></a>02414                     }
-<a name="l02415"></a>02415                     
-<a name="l02416"></a>02416                 }
-<a name="l02417"></a>02417 
-<a name="l02418"></a>02418                 <span class="keywordflow">for</span> (k = 0; k < n_coeff_params_ext; k++)
-<a name="l02419"></a>02419                 {
-<a name="l02420"></a>02420                     <span class="keywordtype">double</span> ext  = cpl_matrix_get(result_params, i, 0);
-<a name="l02421"></a>02421                     <span class="keywordtype">double</span> dext = sqrt(cpl_matrix_get(result_cov_params, i, i));
-<a name="l02422"></a>02422 
-<a name="l02423"></a>02423                     cpl_msg_info(cpl_func, <span class="stringliteral">"E_%d = %f +- %f mag/airmass"</span>,
-<a name="l02424"></a>02424                                  k, ext, dext);
-<a name="l02425"></a>02425 
-<a name="l02426"></a>02426                     <span class="keywordflow">if</span> (summary) {
-<a name="l02427"></a>02427                         cpl_table_select_all(summary);
-<a name="l02428"></a>02428                         cpl_table_and_selected_int(summary, <span class="stringliteral">"index"</span>,
-<a name="l02429"></a>02429                                                    CPL_EQUAL_TO, k);
-<a name="l02430"></a>02430                         <span class="keywordflow">for</span> (row = 0; row < n_frames; row++) {
-<a name="l02431"></a>02431                             <span class="keywordflow">if</span> (cpl_table_is_selected(summary, row)) {
-<a name="l02432"></a>02432                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *filename =
-<a name="l02433"></a>02433                                 cpl_table_get_string(summary, <span class="stringliteral">"filename"</span>, row);
-<a name="l02434"></a>02434                                 cpl_propertylist *plist = 
-<a name="l02435"></a>02435                                 cpl_propertylist_load_regexp(filename, 0,
-<a name="l02436"></a>02436                                                              <span class="stringliteral">"MJD-OBS|ORIGIN"</span>, 
-<a name="l02437"></a>02437                                                              0);
-<a name="l02438"></a>02438 
-<a name="l02439"></a>02439                                 cpl_table_set_double(summary, 
-<a name="l02440"></a>02440                                                      <span class="stringliteral">"EXT"</span>, row, ext);
-<a name="l02441"></a>02441                                 cpl_table_set_double(summary, 
-<a name="l02442"></a>02442                                                      <span class="stringliteral">"DEXT"</span>, row, dext);
-<a name="l02443"></a>02443                                 <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERFRAME) {
-<a name="l02444"></a>02444                                     cpl_table_set_double(summary, 
-<a name="l02445"></a>02445                                                          <span class="stringliteral">"MJD-OBS"</span>, row, 
-<a name="l02446"></a>02446                                        cpl_propertylist_get_double(plist, 
-<a name="l02447"></a>02447                                                                    <span class="stringliteral">"MJD-OBS"</span>));
-<a name="l02448"></a>02448                                 }
-<a name="l02449"></a>02449                                 <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERNIGHT) {
-<a name="l02450"></a>02450                                     cpl_table_set_int(summary, <span class="stringliteral">"MJD-NIGHT"</span>, 
-<a name="l02451"></a>02451                                                       row, 
-<a name="l02452"></a>02452                                          <a class="code" href="group__fors__photometry.html#g294b0010ae795af85c28da476abadb18">fors_photometry_get_night_id</a>(plist));
-<a name="l02453"></a>02453                                 }
-<a name="l02454"></a>02454 
-<a name="l02455"></a>02455                                 cpl_propertylist_delete(plist);
-<a name="l02456"></a>02456                             }
-<a name="l02457"></a>02457                         }
-<a name="l02458"></a>02458                     }
-<a name="l02459"></a>02459 
-<a name="l02460"></a>02460                     i++;
-<a name="l02461"></a>02461                 }
-<a name="l02462"></a>02462             }
-<a name="l02463"></a>02463         }
-<a name="l02464"></a>02464         cpl_msg_indent_less();
-<a name="l02465"></a>02465         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02466"></a>02466 
-<a name="l02467"></a>02467         <span class="keywordflow">if</span> (summary) {
-<a name="l02468"></a>02468             cpl_table_select_all(summary);
-<a name="l02469"></a>02469             cpl_table_erase_column(summary, <span class="stringliteral">"index"</span>);
-<a name="l02470"></a>02470         }
-<a name="l02471"></a>02471 
-<a name="l02472"></a>02472         <span class="comment">/* color */</span>
-<a name="l02473"></a>02473         cpl_msg_indent_more();
-<a name="l02474"></a>02474         <span class="keywordflow">if</span> (fit_c) {
-<a name="l02475"></a>02475             <span class="comment">/* Note different sign convention. The values</span>
-<a name="l02476"></a>02476 <span class="comment">               provided in PHOT_TABLEs are actually -c.</span>
-<a name="l02477"></a>02477 <span class="comment">               As in fors_std_cat_load() </span>
-<a name="l02478"></a>02478 <span class="comment">            */</span>
-<a name="l02479"></a>02479             qc_colorterm = cpl_matrix_get(result_params, i, 0);
-<a name="l02480"></a>02480             qc_colorterm = -qc_colorterm;   <span class="comment">/* External convention */</span>
-<a name="l02481"></a>02481             qc_colorterm_err = sqrt(cpl_matrix_get(result_cov_params, i, i));
-<a name="l02482"></a>02482             cpl_msg_info(cpl_func, <span class="stringliteral">"C_correction = %f +- %f"</span>,
-<a name="l02483"></a>02483                          qc_colorterm, qc_colorterm_err);
-<a name="l02484"></a>02484             i++;
-<a name="l02485"></a>02485         }
-<a name="l02486"></a>02486         cpl_msg_indent_less();
-<a name="l02487"></a>02487         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02488"></a>02488 
-<a name="l02489"></a>02489         <span class="comment">/* Abort if crazy values... */</span>
-<a name="l02490"></a>02490         <span class="keywordflow">if</span> (qc_zeropoint_err > 1.0) {
-<a name="l02491"></a>02491             cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l02492"></a>02492                                   <span class="stringliteral">"Unreliable zeropoint!"</span>);
-<a name="l02493"></a>02493             <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l02494"></a>02494             <span class="keywordflow">return</span>;
-<a name="l02495"></a>02495         }
-<a name="l02496"></a>02496         <span class="keywordflow">if</span> (qc_extinction_err > 1.0) {
-<a name="l02497"></a>02497             cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l02498"></a>02498                                   <span class="stringliteral">"Unreliable atmospheric extinction!"</span>);
-<a name="l02499"></a>02499             <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l02500"></a>02500             <span class="keywordflow">return</span>;
-<a name="l02501"></a>02501         }
-<a name="l02502"></a>02502         <span class="keywordflow">if</span> (qc_colorterm_err > 1.0) {
-<a name="l02503"></a>02503             cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l02504"></a>02504                                   <span class="stringliteral">"Unreliable color correction term!"</span>);
-<a name="l02505"></a>02505             <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l02506"></a>02506             <span class="keywordflow">return</span>;
-<a name="l02507"></a>02507         }
-<a name="l02508"></a>02508         <span class="keywordflow">if</span> (qc_extinction_err > 0.0 && qc_extinction <= 0.0) {
-<a name="l02509"></a>02509             cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l02510"></a>02510                                   <span class="stringliteral">"Impossible atmospheric extinction!"</span>);
-<a name="l02511"></a>02511             <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l02512"></a>02512             <span class="keywordflow">return</span>;
-<a name="l02513"></a>02513         }
-<a name="l02514"></a>02514         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02515"></a>02515 
-<a name="l02516"></a>02516         cpl_msg_indent_more();
-<a name="l02517"></a>02517         cpl_msg_info(cpl_func, <span class="stringliteral">"Reduced chi square = %f"</span>, red_chisq);
-<a name="l02518"></a>02518         cpl_msg_indent_less();
-<a name="l02519"></a>02519     
-<a name="l02520"></a>02520     }
-<a name="l02521"></a>02521     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02522"></a>02522     <span class="comment">/* Code checks:</span>
-<a name="l02523"></a>02523 <span class="comment">     * - polynomials must exist (also if empty), they might be used later */</span>
-<a name="l02524"></a>02524     passure(polyf != NULL, <span class="keywordflow">return</span>);
-<a name="l02525"></a>02525     passure(polyp != NULL, <span class="keywordflow">return</span>);
-<a name="l02526"></a>02526 
-<a name="l02527"></a>02527     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l02528"></a>02528     <span class="comment">/* Compute correction image, apply to master flat */</span>
-<a name="l02529"></a>02529     {
-<a name="l02530"></a>02530         <span class="keywordtype">int</span> nx,
-<a name="l02531"></a>02531             ny;
-<a name="l02532"></a>02532         
-<a name="l02533"></a>02533         master_flat = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(      cpl_frameset_get_first_const(
-<a name="l02534"></a>02534                                                 master_flat_frame),
-<a name="l02535"></a>02535                                             NULL, setting, NULL);
-<a name="l02536"></a>02536         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load master flat"</span>);
-<a name="l02537"></a>02537         
-<a name="l02538"></a>02538         nx = <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(master_flat);
-<a name="l02539"></a>02539         ny = <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(master_flat);
-<a name="l02540"></a>02540         cpl_image *correction_map   = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l02541"></a>02541         cpl_image *correction_map_v = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l02542"></a>02542         
-<a name="l02543"></a>02543         cpl_msg_info(cpl_func, <span class="stringliteral">"Creating correction map (magnitude)"</span>);
-<a name="l02544"></a>02544         cpl_image_fill_polynomial(correction_map, polyf,
-<a name="l02545"></a>02545                                   1.0, 1.0, 1.0, 1.0);
-<a name="l02546"></a>02546         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02547"></a>02547         cpl_image_fill_polynomial(correction_map_v, polyf_variance,
-<a name="l02548"></a>02548                                   1.0, 1.0, 1.0, 1.0);
-<a name="l02549"></a>02549         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02550"></a>02550         
-<a name="l02551"></a>02551         correction = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(correction_map, correction_map_v);
-<a name="l02552"></a>02552     }
-<a name="l02553"></a>02553     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02554"></a>02554     
-<a name="l02555"></a>02555     cpl_polynomial_delete(polyf); polyf = NULL;
-<a name="l02556"></a>02556     cpl_polynomial_delete(polyf_variance); polyf_variance = NULL;
-<a name="l02557"></a>02557     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&eqn_result);
-<a name="l02558"></a>02558 
-<a name="l02559"></a>02559     <span class="keywordflow">if</span> (qc_zeropoint_err > 0.0 ||
-<a name="l02560"></a>02560         qc_extinction_err > 0.0 ||
-<a name="l02561"></a>02561         qc_colorterm_err > 0.0) {
-<a name="l02562"></a>02562 
-<a name="l02563"></a>02563         phot_coeff = fors_phot_coeff_create(setting,
-<a name="l02564"></a>02564                                             qc_colorterm,
-<a name="l02565"></a>02565                                             qc_colorterm_err,
-<a name="l02566"></a>02566                                             qc_extinction,
-<a name="l02567"></a>02567                                             qc_extinction_err,
-<a name="l02568"></a>02568                                             qc_zeropoint,
-<a name="l02569"></a>02569                                             qc_zeropoint_err);
-<a name="l02570"></a>02570 
-<a name="l02571"></a>02571         <span class="comment">/*</span>
-<a name="l02572"></a>02572 <span class="comment">         * Write QCs</span>
-<a name="l02573"></a>02573 <span class="comment">         */</span>
-<a name="l02574"></a>02574 
-<a name="l02575"></a>02575         qc = cpl_propertylist_new();
-<a name="l02576"></a>02576 
-<a name="l02577"></a>02577         <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qc, <a class="code" href="group__forsqc.html#gf875be6d318687206fdb50a7c61b7924">fors_qc_dic_version</a>, setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l02578"></a>02578 
-<a name="l02579"></a>02579 <span class="comment">/*</span>
-<a name="l02580"></a>02580 <span class="comment">    fors_qc_write_group_heading(cpl_frameset_get_first_const(master_flat_frame),</span>
-<a name="l02581"></a>02581 <span class="comment">                                CORRECTION_MAP,</span>
-<a name="l02582"></a>02582 <span class="comment">                                setting->instrument);</span>
-<a name="l02583"></a>02583 <span class="comment">    assure( !cpl_error_get_code(), return, "Could not write %s QC parameters",</span>
-<a name="l02584"></a>02584 <span class="comment">            CORRECTION_MAP);</span>
-<a name="l02585"></a>02585 <span class="comment">*/</span>
-<a name="l02586"></a>02586 
-<a name="l02587"></a>02587         <span class="keywordflow">if</span> (qc_zeropoint_err > 0.0) {
-<a name="l02588"></a>02588             <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l02589"></a>02589                                     qc_zeropoint,
-<a name="l02590"></a>02590                                     <span class="stringliteral">"QC.INSTRUMENT.ZEROPOINT"</span>,
-<a name="l02591"></a>02591                                     <span class="stringliteral">"mag"</span>,
-<a name="l02592"></a>02592                                     <span class="stringliteral">"Instrument zeropoint"</span>,
-<a name="l02593"></a>02593                                     setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l02594"></a>02594 
-<a name="l02595"></a>02595             <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l02596"></a>02596                                     qc_zeropoint_err,
-<a name="l02597"></a>02597                                     <span class="stringliteral">"QC.INSTRUMENT.ZEROPOINT.ERROR"</span>,
-<a name="l02598"></a>02598                                     <span class="stringliteral">"mag"</span>,
-<a name="l02599"></a>02599                                     <span class="stringliteral">"Instrument zeropoint error"</span>,
-<a name="l02600"></a>02600                                     setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l02601"></a>02601         }
-<a name="l02602"></a>02602 
-<a name="l02603"></a>02603         <span class="keywordflow">if</span> (qc_extinction_err > 0.0 && summary == NULL) {
-<a name="l02604"></a>02604             <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l02605"></a>02605                                     qc_extinction,
-<a name="l02606"></a>02606                                     <span class="stringliteral">"QC.ATMOSPHERIC.EXTINCTION"</span>,
-<a name="l02607"></a>02607                                     <span class="stringliteral">"mag/airmass"</span>,
-<a name="l02608"></a>02608                                     <span class="stringliteral">"Atmospheric extinction"</span>,
-<a name="l02609"></a>02609                                     setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l02610"></a>02610 
-<a name="l02611"></a>02611             <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l02612"></a>02612                                     qc_extinction_err,
-<a name="l02613"></a>02613                                     <span class="stringliteral">"QC.ATMOSPHERIC.EXTINCTION.ERROR"</span>,
-<a name="l02614"></a>02614                                     <span class="stringliteral">"mag/airmass"</span>,
-<a name="l02615"></a>02615                                     <span class="stringliteral">"Atmospheric extinction error"</span>,
-<a name="l02616"></a>02616                                     setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l02617"></a>02617         }
-<a name="l02618"></a>02618 
-<a name="l02619"></a>02619         <span class="keywordflow">if</span> (qc_colorterm_err > 0.0) {
-<a name="l02620"></a>02620             <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l02621"></a>02621                                     qc_colorterm,
-<a name="l02622"></a>02622                                     <span class="stringliteral">"QC.COLOR.CORRECTION"</span>,
-<a name="l02623"></a>02623                                     NULL,
-<a name="l02624"></a>02624                                     <span class="stringliteral">"Linear color correction term"</span>,
-<a name="l02625"></a>02625                                     setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l02626"></a>02626 
-<a name="l02627"></a>02627             <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qc,
-<a name="l02628"></a>02628                                     qc_colorterm_err,
-<a name="l02629"></a>02629                                     <span class="stringliteral">"QC.COLOR.CORRECTION.ERROR"</span>,
-<a name="l02630"></a>02630                                     NULL,
-<a name="l02631"></a>02631                                     <span class="stringliteral">"Linear color correction term error"</span>,
-<a name="l02632"></a>02632                                     setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l02633"></a>02633         }
-<a name="l02634"></a>02634 
-<a name="l02635"></a>02635         <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l02636"></a>02636 
-<a name="l02637"></a>02637         <span class="comment">/*</span>
-<a name="l02638"></a>02638 <span class="comment">         * End write QCs</span>
-<a name="l02639"></a>02639 <span class="comment">         */</span>
-<a name="l02640"></a>02640     }
-<a name="l02641"></a>02641     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);
-<a name="l02642"></a>02642 
-<a name="l02643"></a>02643     <span class="keywordflow">if</span> (summary && phot_coeff) {
-<a name="l02644"></a>02644         cpl_table_erase_column(phot_coeff, <span class="stringliteral">"EXT"</span>);
-<a name="l02645"></a>02645         cpl_table_erase_column(phot_coeff, <span class="stringliteral">"DEXT"</span>);
-<a name="l02646"></a>02646         <span class="keywordflow">if</span> (1 == cpl_table_get_ncol(phot_coeff)) {
-<a name="l02647"></a>02647             cpl_table_delete(phot_coeff);
-<a name="l02648"></a>02648             phot_coeff = NULL;
-<a name="l02649"></a>02649         }
-<a name="l02650"></a>02650     }
-<a name="l02651"></a>02651 
-<a name="l02652"></a>02652     <span class="keywordflow">if</span> (phot_coeff) {
-<a name="l02653"></a>02653         <a class="code" href="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42">fors_dfs_save_table</a>(frames, phot_coeff, PHOT_COEFF_TABLE,
-<a name="l02654"></a>02654                             qc, parameters, <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a>,
-<a name="l02655"></a>02655                             cpl_frameset_get_first_const(master_flat_frame));
-<a name="l02656"></a>02656         cpl_propertylist_delete(qc); qc = NULL;
-<a name="l02657"></a>02657     }
-<a name="l02658"></a>02658     
-<a name="l02659"></a>02659     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l02660"></a>02660             PHOT_COEFF_TABLE);
-<a name="l02661"></a>02661 
-<a name="l02662"></a>02662     <span class="keywordflow">if</span> (summary) {
-<a name="l02663"></a>02663         <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERFRAME) {
-<a name="l02664"></a>02664             tag = EXTINCTION_PER_FRAME;
-<a name="l02665"></a>02665         }
-<a name="l02666"></a>02666         <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERNIGHT) {
-<a name="l02667"></a>02667             tag = EXTINCTION_PER_NIGHT;
-<a name="l02668"></a>02668         }
-<a name="l02669"></a>02669         <a class="code" href="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42">fors_dfs_save_table</a>(frames, summary, tag, NULL, parameters, 
-<a name="l02670"></a>02670                             <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a>,
-<a name="l02671"></a>02671                             cpl_frameset_get_first_const(master_flat_frame));
-<a name="l02672"></a>02672     }
-<a name="l02673"></a>02673     
-<a name="l02674"></a>02674     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>, tag);
-<a name="l02675"></a>02675 
-<a name="l02676"></a>02676     <span class="keywordflow">if</span> (degreef1 > 0) {
-<a name="l02677"></a>02677     
-<a name="l02678"></a>02678         <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, correction, CORRECTION_MAP,
-<a name="l02679"></a>02679                             qc, parameters, <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a>, 
-<a name="l02680"></a>02680                             cpl_frameset_get_first_const(master_flat_frame));
-<a name="l02681"></a>02681 
-<a name="l02682"></a>02682     }
-<a name="l02683"></a>02683 
-<a name="l02684"></a>02684     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l02685"></a>02685             CORRECTION_MAP);
-<a name="l02686"></a>02686 
-<a name="l02687"></a>02687     cpl_propertylist_delete(qc);
-<a name="l02688"></a>02688     
-<a name="l02689"></a>02689     <span class="comment">/* Convert from magnitude to flux.</span>
-<a name="l02690"></a>02690 <span class="comment">       F = 10^(-0.4 m)</span>
-<a name="l02691"></a>02691 <span class="comment">    */</span>
-<a name="l02692"></a>02692     <span class="keywordflow">if</span> (degreef1 > 0) {
-<a name="l02693"></a>02693         cpl_msg_info(cpl_func, <span class="stringliteral">"Creating correction map (flux)"</span>);
-<a name="l02694"></a>02694     
-<a name="l02695"></a>02695         <a class="code" href="group__fors__image.html#g077f7a5a847fa9c0e458dca2e12e4e6f">fors_image_multiply_scalar</a>(correction, -0.4, -1);
-<a name="l02696"></a>02696         <a class="code" href="group__fors__image.html#g78afca4bf8e5c3dc80d0dcd7f682f9e9">fors_image_exponential</a>(correction, 10, -1);
-<a name="l02697"></a>02697     
-<a name="l02698"></a>02698         <span class="comment">/* Normalize to median = 1 */</span>
-<a name="l02699"></a>02699         <a class="code" href="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff">fors_image_divide_scalar</a>(correction, 
-<a name="l02700"></a>02700                                  <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(correction, NULL), -1.0);
-<a name="l02701"></a>02701     
-<a name="l02702"></a>02702         <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, correction, CORRECTION_FACTOR,
-<a name="l02703"></a>02703                             NULL, parameters, <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a>, 
-<a name="l02704"></a>02704                             cpl_frameset_get_first_const(master_flat_frame));
-<a name="l02705"></a>02705     
-<a name="l02706"></a>02706         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l02707"></a>02707                 CORRECTION_FACTOR);
-<a name="l02708"></a>02708     }
-<a name="l02709"></a>02709     
-<a name="l02710"></a>02710     <span class="keywordflow">if</span> (degreef1 > 0) {
-<a name="l02711"></a>02711         cpl_msg_info(cpl_func, <span class="stringliteral">"Creating corrected master flat"</span>);
-<a name="l02712"></a>02712         <a class="code" href="group__fors__image.html#g15f95ab361e6c2ea44bafbada5d8d4a1">fors_image_multiply</a>(master_flat, correction);
-<a name="l02713"></a>02713     
-<a name="l02714"></a>02714         <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, master_flat, MASTER_FLAT_IMG,
-<a name="l02715"></a>02715                             NULL, parameters, <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a>, 
-<a name="l02716"></a>02716                             cpl_frameset_get_first_const(master_flat_frame));
-<a name="l02717"></a>02717         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l02718"></a>02718                 MASTER_FLAT_IMG);
-<a name="l02719"></a>02719     }
-<a name="l02720"></a>02720     
-<a name="l02721"></a>02721     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l02722"></a>02722     <span class="keywordflow">return</span>;
-<a name="l02723"></a>02723 }
-<a name="l02724"></a>02724 
-<a name="l02725"></a>02725 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l02726"></a>02726 <span class="preprocessor">#undef cleanup</span>
-<a name="l02727"></a>02727 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l02728"></a>02728 <span class="preprocessor">do { \</span>
-<a name="l02729"></a>02729 <span class="preprocessor">    fors_std_star_delete(&std_star); \</span>
-<a name="l02730"></a>02730 <span class="preprocessor">    cpl_propertylist_delete(header); header = NULL; \</span>
-<a name="l02731"></a>02731 <span class="preprocessor">    cpl_table_delete(aligned_phot); aligned_phot = NULL; \</span>
-<a name="l02732"></a>02732 <span class="preprocessor">    fors_setting_delete(&setting_f); \</span>
-<a name="l02733"></a>02733 <span class="preprocessor">    fors_delete_star_lists(&obs, std_star_list); \</span>
-<a name="l02734"></a>02734 <span class="preprocessor">    fors_star_delete_but_standard(&obs_star); \</span>
-<a name="l02735"></a>02735 <span class="preprocessor">    fors_std_star_delete(&std_star); \</span>
-<a name="l02736"></a>02736 <span class="preprocessor">    \</span>
-<a name="l02737"></a>02737 <span class="preprocessor">    *n_frames = 0; \</span>
-<a name="l02738"></a>02738 <span class="preprocessor">} while (0)</span>
-<a name="l02739"></a>02739 <span class="preprocessor"></span>
-<a name="l02754"></a>02754 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l02755"></a>02755 <span class="keyword">static</span> entry_list *
-<a name="l02756"></a><a class="code" href="group__fors__photometry.html#gd9e3544d21c84d8a62c36b859b2a4bcf">02756</a> <a class="code" href="group__fors__photometry.html#gd9e3544d21c84d8a62c36b859b2a4bcf">fors_photometry_read_input</a>(                 <span class="keyword">const</span> cpl_frameset  *alphot_frames,
-<a name="l02757"></a>02757                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a>  *setting,
-<a name="l02758"></a>02758                                             <span class="keywordtype">int</span> (*get_atm_ext_id_function)(
-<a name="l02759"></a>02759                                                 <span class="keyword">const</span> cpl_propertylist *header),
-<a name="l02760"></a>02760                                             <span class="keywordtype">bool</span>                import_unknown,
-<a name="l02761"></a>02761                                             <span class="keywordtype">int</span>                 *n_frames,
-<a name="l02762"></a>02762                                             fors_std_star_list  **std_star_list,
-<a name="l02763"></a>02763                                             <span class="keywordtype">int</span>                 filter)
-<a name="l02764"></a>02764 {
-<a name="l02765"></a>02765     entry_list          *obs = NULL;
-<a name="l02766"></a>02766     <a class="code" href="struct__fors__setting.html">fors_setting</a>        *setting_f = NULL;
-<a name="l02767"></a>02767     <a class="code" href="struct__fors__star.html">fors_star</a>           *obs_star = NULL;
-<a name="l02768"></a>02768     fors_std_star       *std_star = NULL;
-<a name="l02769"></a>02769     cpl_propertylist    *header = NULL;
-<a name="l02770"></a>02770     cpl_table           *aligned_phot = NULL;
-<a name="l02771"></a>02771     <span class="keyword">const</span> cpl_frame     *f;
-<a name="l02772"></a>02772     <span class="keywordtype">int</span>                 iframe,
-<a name="l02773"></a>02773                         inonstd = 0;
-<a name="l02774"></a>02774     cpl_errorstate      errstat = cpl_errorstate_get();
-<a name="l02775"></a>02775     
-<a name="l02776"></a>02776     <span class="comment">/* init output pointers */</span>
-<a name="l02777"></a>02777     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l02778"></a>02778     
-<a name="l02779"></a>02779     <span class="comment">/* prepare */</span>
-<a name="l02780"></a>02780     obs = entry_list_new();
-<a name="l02781"></a>02781     *std_star_list = fors_std_star_list_new();
-<a name="l02782"></a>02782     
-<a name="l02783"></a>02783     <span class="comment">/*</span>
-<a name="l02784"></a>02784 <span class="comment">     * Loop on all aligned photometric tables in input, and count the</span>
-<a name="l02785"></a>02785 <span class="comment">     * found frames in iframe.</span>
-<a name="l02786"></a>02786 <span class="comment">     */</span>
-<a name="l02787"></a>02787     <span class="keywordflow">for</span> (f = cpl_frameset_get_first_const(alphot_frames), iframe = 0;
-<a name="l02788"></a>02788          f != NULL;
-<a name="l02789"></a>02789          f = cpl_frameset_get_next_const(alphot_frames), iframe++)
-<a name="l02790"></a>02790     {
-<a name="l02791"></a>02791         <span class="keyword">const</span> <span class="keywordtype">char</span>  *filename;
-<a name="l02792"></a>02792         <span class="keywordtype">int</span>         atm_ext_id = 0;
-<a name="l02793"></a>02793         <span class="keywordtype">double</span>      airmass;
-<a name="l02794"></a>02794         
-<a name="l02795"></a>02795         filename = cpl_frame_get_filename(f);
-<a name="l02796"></a>02796         cpl_msg_info(cpl_func, <span class="stringliteral">"Loading %s"</span>, filename);
-<a name="l02797"></a>02797         cpl_msg_indent_more();
-<a name="l02798"></a>02798 
-<a name="l02799"></a>02799         aligned_phot = cpl_table_load(filename, 1, 1);
-<a name="l02800"></a>02800         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                             cpl_errorstate_is_equal(errstat),
-<a name="l02801"></a>02801                                             <span class="keywordflow">return</span> NULL,
-<a name="l02802"></a>02802                                             <span class="stringliteral">"Could not load %s"</span>,
-<a name="l02803"></a>02803                                                 filename);
-<a name="l02804"></a>02804 <span class="comment">/* %%% */</span>
-<a name="l02805"></a>02805         <span class="keywordflow">if</span> (filter && cpl_table_has_column(aligned_phot, <span class="stringliteral">"WEIGHT"</span>)) {
-<a name="l02806"></a>02806             cpl_table_and_selected_double(aligned_phot, 
-<a name="l02807"></a>02807                                           <span class="stringliteral">"WEIGHT"</span>, CPL_LESS_THAN, 1.0);
-<a name="l02808"></a>02808             cpl_table_and_selected_double(aligned_phot, 
-<a name="l02809"></a>02809                                           <span class="stringliteral">"WEIGHT"</span>, CPL_GREATER_THAN, -1.0);
-<a name="l02810"></a>02810             cpl_table_erase_selected(aligned_phot);
-<a name="l02811"></a>02811         }
-<a name="l02812"></a>02812 <span class="comment">/* %%% */</span>
-<a name="l02813"></a>02813 
-<a name="l02814"></a>02814         header = cpl_propertylist_load(filename, 0);
-<a name="l02815"></a>02815         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                             cpl_errorstate_is_equal(errstat),
-<a name="l02816"></a>02816                                             <span class="keywordflow">return</span> NULL,
-<a name="l02817"></a>02817                                             <span class="stringliteral">"Could not load %s header"</span>,
-<a name="l02818"></a>02818                                                 filename);
-<a name="l02819"></a>02819         
-<a name="l02820"></a>02820         <span class="comment">/* </span>
-<a name="l02821"></a>02821 <span class="comment">         * Load and verify setting for this frame </span>
-<a name="l02822"></a>02822 <span class="comment">         */</span>
-<a name="l02823"></a>02823         <a class="code" href="group__fors__setting.html#gccd3b501cb380066770b1250942fa02a">fors_setting_verify</a>(setting, f, &setting_f);
-<a name="l02824"></a>02824         
-<a name="l02825"></a>02825         airmass = cpl_propertylist_get_double(header, <span class="stringliteral">"AIRMASS"</span>);
-<a name="l02826"></a>02826         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                             cpl_errorstate_is_equal(errstat),
-<a name="l02827"></a>02827                                             <span class="keywordflow">return</span> NULL,
-<a name="l02828"></a>02828                                             <span class="stringliteral">"%s: Could not read %s"</span>,
-<a name="l02829"></a>02829                                                 filename, <span class="stringliteral">"AIRMASS"</span>);
-<a name="l02830"></a>02830 
-<a name="l02831"></a>02831         <span class="comment">/* FIXME:</span>
-<a name="l02832"></a>02832 <span class="comment">         * This whole section is for verifying the input table. The</span>
-<a name="l02833"></a>02833 <span class="comment">         * structure of this table is probably defined in some other</span>
-<a name="l02834"></a>02834 <span class="comment">         * place too... Likely this is a dependency between modules</span>
-<a name="l02835"></a>02835 <span class="comment">         * that should be eliminated. Please check... (C.Izzo, 28.01.08)</span>
-<a name="l02836"></a>02836 <span class="comment">         */</span>
-<a name="l02837"></a>02837         <span class="keyword">struct </span>{
-<a name="l02838"></a>02838             <span class="keyword">const</span> <span class="keywordtype">char</span>  *name;
-<a name="l02839"></a>02839             cpl_type    type;
-<a name="l02840"></a>02840             <span class="keywordtype">bool</span>        optional;
-<a name="l02841"></a>02841         } col[] =
-<a name="l02842"></a>02842               {{<span class="stringliteral">"RA"</span>,           CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02843"></a>02843                {<span class="stringliteral">"DEC"</span>,          CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02844"></a>02844                {<span class="stringliteral">"X"</span>,            CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02845"></a>02845                {<span class="stringliteral">"Y"</span>,            CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02846"></a>02846                {<span class="stringliteral">"FWHM"</span>,         CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02847"></a>02847                {<span class="stringliteral">"A"</span>,            CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02848"></a>02848                {<span class="stringliteral">"B"</span>,            CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02849"></a>02849                {<span class="stringliteral">"THETA"</span>,        CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02850"></a>02850                {<span class="stringliteral">"INSTR_MAG"</span>,    CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02851"></a>02851                {<span class="stringliteral">"DINSTR_MAG"</span>,   CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02852"></a>02852                {<span class="stringliteral">"CAT_MAG"</span>,      CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02853"></a>02853                {<span class="stringliteral">"DCAT_MAG"</span>,     CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02854"></a>02854                {<span class="stringliteral">"MAG"</span>,          CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02855"></a>02855                {<span class="stringliteral">"DMAG"</span>,         CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02856"></a>02856                {<span class="stringliteral">"COLOR"</span>,        CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02857"></a>02857                {<span class="stringliteral">"DCOLOR"</span>,       CPL_TYPE_DOUBLE, <span class="keyword">true</span>}, <span class="comment">/* miss in old data */</span>
-<a name="l02858"></a>02858                {<span class="stringliteral">"COV_CATM_COL"</span>, CPL_TYPE_DOUBLE, <span class="keyword">true</span>}, <span class="comment">/* miss in old data */</span>
-<a name="l02859"></a>02859                {<span class="stringliteral">"CLASS_STAR"</span>,   CPL_TYPE_DOUBLE, <span class="keyword">false</span>},
-<a name="l02860"></a>02860                {<span class="stringliteral">"USE_CAT"</span>,      CPL_TYPE_INT,    <span class="keyword">false</span>},
-<a name="l02861"></a>02861                {<span class="stringliteral">"OBJECT"</span>,       CPL_TYPE_STRING, <span class="keyword">false</span>}};
-<a name="l02862"></a>02862         {
-<a name="l02863"></a>02863             <span class="keywordtype">unsigned</span> i = 0;
-<a name="l02864"></a>02864             <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(col) / <span class="keyword">sizeof</span>(*col); i++)
-<a name="l02865"></a>02865             {
-<a name="l02866"></a>02866                 <span class="keywordtype">bool</span>    exists;
-<a name="l02867"></a>02867                 exists = cpl_table_has_column(aligned_phot, col[i].name);
-<a name="l02868"></a>02868                 cassure(exists || col[i].optional,
-<a name="l02869"></a>02869                         CPL_ERROR_DATA_NOT_FOUND,
-<a name="l02870"></a>02870                         <span class="keywordflow">return</span> NULL,
-<a name="l02871"></a>02871                         <span class="stringliteral">"%s: Missing column %s"</span>, filename, col[i].name);
-<a name="l02872"></a>02872                 cassure((!exists) ||
-<a name="l02873"></a>02873                         cpl_table_get_column_type(aligned_phot, col[i].name) 
-<a name="l02874"></a>02874                             == col[i].type,
-<a name="l02875"></a>02875                         CPL_ERROR_INVALID_TYPE,
-<a name="l02876"></a>02876                         <span class="keywordflow">return</span> NULL,
-<a name="l02877"></a>02877                         <span class="stringliteral">"%s: column %s: Type is %s, %s expected "</span>, 
-<a name="l02878"></a>02878                         filename,
-<a name="l02879"></a>02879                         col[i].name,
-<a name="l02880"></a>02880                         <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(
-<a name="l02881"></a>02881                             cpl_table_get_column_type(aligned_phot, 
-<a name="l02882"></a>02882                                                       col[i].name)
-<a name="l02883"></a>02883                         ),
-<a name="l02884"></a>02884                         <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(col[i].type));
-<a name="l02885"></a>02885             }
-<a name="l02886"></a>02886         } <span class="comment">/* Table check done */</span>
-<a name="l02887"></a>02887         
-<a name="l02888"></a>02888         <span class="keywordflow">if</span> (get_atm_ext_id_function != NULL)
-<a name="l02889"></a>02889         {
-<a name="l02890"></a>02890             atm_ext_id = get_atm_ext_id_function(header);
-<a name="l02891"></a>02891             <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                         cpl_errorstate_is_equal(errstat),
-<a name="l02892"></a>02892                                             <span class="keywordflow">return</span> NULL,
-<a name="l02893"></a>02893                                             <span class="stringliteral">"Getting atmospheric extinction "</span>
-<a name="l02894"></a>02894                                             <span class="stringliteral">"identifier failed."</span>);
-<a name="l02895"></a>02895         }
-<a name="l02896"></a>02896         
-<a name="l02897"></a>02897         <span class="comment">/* </span>
-<a name="l02898"></a>02898 <span class="comment">         * Get IDed stars in this table: </span>
-<a name="l02899"></a>02899 <span class="comment">         */</span>
-<a name="l02900"></a>02900         <span class="keywordtype">int</span> i;
-<a name="l02901"></a>02901         <span class="keywordflow">for</span> (i = 0; i < cpl_table_get_nrow(aligned_phot); i++)
-<a name="l02902"></a>02902         {
-<a name="l02903"></a>02903             obs_star = <a class="code" href="group__fors__star.html#gec880ac28409dd535ec3138e0b5b001c">fors_star_new_from_table</a>(
-<a name="l02904"></a>02904                                             aligned_phot,
-<a name="l02905"></a>02905                                             i,
-<a name="l02906"></a>02906                                             <span class="stringliteral">"X"</span>, <span class="stringliteral">"Y"</span>,
-<a name="l02907"></a>02907                                             <span class="stringliteral">"FWHM"</span>,
-<a name="l02908"></a>02908                                             <span class="stringliteral">"A"</span>, <span class="stringliteral">"B"</span>,
-<a name="l02909"></a>02909                                             <span class="stringliteral">"THETA"</span>, 
-<a name="l02910"></a>02910                                             <span class="stringliteral">"INSTR_MAG"</span>, <span class="stringliteral">"DINSTR_MAG"</span>,
-<a name="l02911"></a>02911                                             <span class="stringliteral">"CLASS_STAR"</span>);
-<a name="l02912"></a>02912             std_star = fors_std_star_new_from_table(
-<a name="l02913"></a>02913                                             aligned_phot,
-<a name="l02914"></a>02914                                             i,
-<a name="l02915"></a>02915                                             <span class="stringliteral">"RA"</span>, <span class="stringliteral">"DEC"</span>,
-<a name="l02916"></a>02916                                             <span class="stringliteral">"MAG"</span>, <span class="stringliteral">"DMAG"</span>,
-<a name="l02917"></a>02917                                             <span class="stringliteral">"CAT_MAG"</span>, <span class="stringliteral">"DCAT_MAG"</span>,
-<a name="l02918"></a>02918                                             <span class="stringliteral">"COLOR"</span>, NULL,   <span class="comment">/* DCOLOR */</span>
-<a name="l02919"></a>02919                                             NULL,   <span class="comment">/* COV_CATM_COL */</span>
-<a name="l02920"></a>02920                                             NULL, NULL,
-<a name="l02921"></a>02921                                             <span class="stringliteral">"OBJECT"</span>);
-<a name="l02922"></a>02922             <span class="comment">/* compatibility with old fors_zeropoint products */</span>
-<a name="l02923"></a>02923             <span class="keywordflow">if</span> (cpl_table_has_column(aligned_phot, <span class="stringliteral">"DCOLOR"</span>)
-<a name="l02924"></a>02924                 && cpl_table_has_column(aligned_phot, <span class="stringliteral">"COV_CATM_COL"</span>))
-<a name="l02925"></a>02925             {
-<a name="l02926"></a>02926                 std_star->dcolor = cpl_table_get(
-<a name="l02927"></a>02927                                             aligned_phot,
-<a name="l02928"></a>02928                                             <span class="stringliteral">"DCOLOR"</span>,
-<a name="l02929"></a>02929                                             i,
-<a name="l02930"></a>02930                                             NULL);
-<a name="l02931"></a>02931                 std_star->cov_catm_color = cpl_table_get(
-<a name="l02932"></a>02932                                             aligned_phot,
-<a name="l02933"></a>02933                                             <span class="stringliteral">"COV_CATM_COL"</span>,
-<a name="l02934"></a>02934                                             i,
-<a name="l02935"></a>02935                                             NULL);
-<a name="l02936"></a>02936             }
-<a name="l02937"></a>02937             <span class="comment">/*</span>
-<a name="l02938"></a>02938 <span class="comment">             * The star and the standard star are the same star. </span>
-<a name="l02939"></a>02939 <span class="comment">             * The star is detector-oriented, the standard star</span>
-<a name="l02940"></a>02940 <span class="comment">             * is its identification and includes physical propeties.</span>
-<a name="l02941"></a>02941 <span class="comment">             * Here the information is linked together, and the</span>
-<a name="l02942"></a>02942 <span class="comment">             * standard star is "owned" by the star object - so</span>
-<a name="l02943"></a>02943 <span class="comment">             * it should not be destroyed.  (C.Izzo, 28.01.08)</span>
-<a name="l02944"></a>02944 <span class="comment">             */</span>
-<a name="l02945"></a>02945             obs_star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> = std_star;
-<a name="l02946"></a>02946             
-<a name="l02947"></a>02947             <span class="comment">/* Use catalog magnitude xor fit the magnitude: */</span>
-<a name="l02948"></a>02948             std_star->trusted = (0 != cpl_table_get_int(
-<a name="l02949"></a>02949                                             aligned_phot, <span class="stringliteral">"USE_CAT"</span>, i, NULL));
-<a name="l02950"></a>02950             
-<a name="l02951"></a>02951             <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                         cpl_errorstate_is_equal(errstat)
-<a name="l02952"></a>02952                                             && obs_star != NULL
-<a name="l02953"></a>02953                                             && std_star != NULL,
-<a name="l02954"></a>02954                                             <span class="keywordflow">return</span> NULL,
-<a name="l02955"></a>02955                                             <span class="stringliteral">"Reading from aligned photometry "</span>
-<a name="l02956"></a>02956                                             <span class="stringliteral">"table failed."</span>);
-<a name="l02957"></a>02957             
-<a name="l02958"></a>02958             cassure(                        obs_star-><a class="code" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">dmagnitude</a> > 0,
-<a name="l02959"></a>02959                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l02960"></a>02960                                             <span class="keywordflow">return</span> NULL, 
-<a name="l02961"></a>02961                                             <span class="stringliteral">"Non-positive magnitude error: "</span>
-<a name="l02962"></a>02962                                             <span class="stringliteral">"%f mag at row %d"</span>,
-<a name="l02963"></a>02963                                             obs_star-><a class="code" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">dmagnitude</a>,
-<a name="l02964"></a>02964                                             i+1);
-<a name="l02965"></a>02965             
-<a name="l02966"></a>02966             <span class="comment">/*fors_star_print(CPL_MSG_DEBUG, obs_star);</span>
-<a name="l02967"></a>02967 <span class="comment">            fors_std_star_print(CPL_MSG_DEBUG, std_star);*/</span>
-<a name="l02968"></a>02968             
-<a name="l02969"></a>02969             <span class="keywordflow">if</span> (! <a class="code" href="group__fors__extract.html#g2c649f2f8802860d4693e38bd640032c">fors_extract_check_sex_star</a>(obs_star, NULL))
-<a name="l02970"></a>02970             {
-<a name="l02971"></a>02971                 
-<a name="l02972"></a>02972                 cpl_msg_warning(cpl_func,   <span class="stringliteral">"Rejecting object no. %d from "</span>
-<a name="l02973"></a>02973                                             <span class="stringliteral">"frame %d, "</span>
-<a name="l02974"></a>02974                                             <span class="stringliteral">"which should have been caught "</span>
-<a name="l02975"></a>02975                                             <span class="stringliteral">"by recent fors_zeropoint recipe. "</span>
-<a name="l02976"></a>02976                                             <span class="stringliteral">"Consider reprocessing input data."</span>,
-<a name="l02977"></a>02977                                             i+1, iframe+1);
-<a name="l02978"></a>02978                 fors_std_star_delete(&std_star);
-<a name="l02979"></a>02979             }
-<a name="l02980"></a>02980             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std_star->name != NULL && (std_star->name)[0] != <span class="charliteral">'\0'</span>)
-<a name="l02981"></a>02981             {
-<a name="l02982"></a>02982                 <span class="comment">/* Object with name is standard star */</span>
-<a name="l02983"></a>02983                 <span class="comment">/* Avoid duplicate standard star list entries. */</span>
-<a name="l02984"></a>02984                 std_star = <a class="code" href="group__fors__photometry.html#g99be8a6361832a8a2592304da84bc62b">fors_photometry_read_input_listinsert_star_if_new</a>(
-<a name="l02985"></a>02985                                             *std_star_list,
-<a name="l02986"></a>02986                                             std_star,
-<a name="l02987"></a>02987                                             <a class="code" href="group__fors__photometry.html#gb139bfc01f73748958dc0543e8e9a1c9">arcsec_tol</a>);
-<a name="l02988"></a>02988             }
-<a name="l02989"></a>02989             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (import_unknown)    <span class="comment">/* import non-std stars */</span>
-<a name="l02990"></a>02990             {
-<a name="l02991"></a>02991                 fors_std_star   *s_in_list;
-<a name="l02992"></a>02992                 
-<a name="l02993"></a>02993                 std_star-><a class="code" href="struct__fors__std__star.html#1d7de44e88c02bc012ef3d75a9e43eed">trusted</a> = <span class="keyword">false</span>;  <span class="comment">/* don't trust ignoring table flag*/</span>
-<a name="l02994"></a>02994                 
-<a name="l02995"></a>02995                 s_in_list = <a class="code" href="group__fors__photometry.html#g99be8a6361832a8a2592304da84bc62b">fors_photometry_read_input_listinsert_star_if_new</a>(
-<a name="l02996"></a>02996                                             *std_star_list,
-<a name="l02997"></a>02997                                             std_star,
-<a name="l02998"></a>02998                                             <a class="code" href="group__fors__photometry.html#gb139bfc01f73748958dc0543e8e9a1c9">arcsec_tol</a>);
-<a name="l02999"></a>02999                 
-<a name="l03000"></a>03000                 <span class="keywordflow">if</span> (s_in_list == std_star) <span class="comment">/* made it into list */</span>
-<a name="l03001"></a>03001                 {
-<a name="l03002"></a>03002                     <span class="keywordtype">char</span>            name[16];
-<a name="l03003"></a>03003                     sprintf(name, <span class="stringliteral">"non-std-%d"</span>, inonstd);
-<a name="l03004"></a>03004                     fors_std_star_set_name(std_star, name);
-<a name="l03005"></a>03005                     inonstd++;
-<a name="l03006"></a>03006                 }
-<a name="l03007"></a>03007                 
-<a name="l03008"></a>03008                 std_star = s_in_list;
-<a name="l03009"></a>03009             }
-<a name="l03010"></a>03010             <span class="keywordflow">else</span>
-<a name="l03011"></a>03011             {
-<a name="l03012"></a>03012                 fors_std_star_delete(&std_star);
-<a name="l03013"></a>03013             }
-<a name="l03014"></a>03014             
-<a name="l03015"></a>03015             <span class="keywordflow">if</span> (std_star != NULL)
-<a name="l03016"></a>03016             {
-<a name="l03017"></a>03017                 <a class="code" href="structentry.html">entry</a>   *e;
-<a name="l03018"></a>03018                 obs_star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> = std_star;
-<a name="l03019"></a>03019                 <span class="comment">/* cannot identify std star id yet, because the used list</span>
-<a name="l03020"></a>03020 <span class="comment">                 * object totally scrambles the order (for whatever reason) */</span>
-<a name="l03021"></a>03021                 e = <a class="code" href="group__fors__photometry.html#gc4cfb3c0bdf31be44324adffdb6277a1">entry_new</a>(              iframe,
-<a name="l03022"></a>03022                                             -1,
-<a name="l03023"></a>03023                                             airmass, 
-<a name="l03024"></a>03024                                             setting_f-><a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a>,
-<a name="l03025"></a>03025                                             setting_f-><a class="code" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">exposure_time</a>,
-<a name="l03026"></a>03026                                             atm_ext_id,
-<a name="l03027"></a>03027                                             obs_star);
-<a name="l03028"></a>03028                 entry_list_insert(      obs, e);
-<a name="l03029"></a>03029             }
-<a name="l03030"></a>03030             <span class="keywordflow">else</span>
-<a name="l03031"></a>03031             {
-<a name="l03032"></a>03032                 <a class="code" href="group__fors__star.html#g40fa6037fee74abd5a9d5166137609e0">fors_star_delete_but_standard</a>(&obs_star);
-<a name="l03033"></a>03033             }
-<a name="l03034"></a>03034 
-<a name="l03035"></a>03035         }<span class="comment">/* for each star */</span>
-<a name="l03036"></a>03036 
-<a name="l03037"></a>03037         cpl_propertylist_delete(header); header = NULL;
-<a name="l03038"></a>03038         cpl_table_delete(aligned_phot); aligned_phot = NULL;
-<a name="l03039"></a>03039         <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting_f);
-<a name="l03040"></a>03040 
-<a name="l03041"></a>03041         cpl_msg_indent_less();
-<a name="l03042"></a>03042     }<span class="comment">/* For each table */</span>
-<a name="l03043"></a>03043 
-<a name="l03044"></a>03044     *n_frames = iframe;
-<a name="l03045"></a>03045     
-<a name="l03046"></a>03046     
-<a name="l03047"></a>03047     <span class="comment">/* The used list object is actually fed in reverse order (because there</span>
-<a name="l03048"></a>03048 <span class="comment">     * is only the function list_insert, but not list_append). But we would</span>
-<a name="l03049"></a>03049 <span class="comment">     * like to access the elements in the same order as we imported them, so</span>
-<a name="l03050"></a>03050 <span class="comment">     * the fix was the invention of the function list_reverse().</span>
-<a name="l03051"></a>03051 <span class="comment">     * hlorch, 17.02.2009 */</span>
-<a name="l03052"></a>03052     entry_list_reverse(obs);
-<a name="l03053"></a>03053     fors_std_star_list_reverse(*std_star_list);
-<a name="l03054"></a>03054     
-<a name="l03055"></a>03055     <span class="comment">/* determine the observation's object id */</span>
-<a name="l03056"></a>03056     {
-<a name="l03057"></a>03057         fors_std_star   *ref;
-<a name="l03058"></a>03058         <a class="code" href="structentry.html">entry</a>           *e;
-<a name="l03059"></a>03059         
-<a name="l03060"></a>03060         <span class="keywordflow">for</span> (e = entry_list_first(obs); e != NULL; e = entry_list_next(obs))
-<a name="l03061"></a>03061         {
-<a name="l03062"></a>03062             <span class="keywordtype">int</span> i;
-<a name="l03063"></a>03063             <span class="keywordflow">for</span> (   ref = fors_std_star_list_first(*std_star_list), i = 0;
-<a name="l03064"></a>03064                     ref != NULL;
-<a name="l03065"></a>03065                     ref = fors_std_star_list_next(*std_star_list), i++)
-<a name="l03066"></a>03066             {
-<a name="l03067"></a>03067                 <span class="keywordflow">if</span> (e-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> == ref)
-<a name="l03068"></a>03068                 {
-<a name="l03069"></a>03069                     e-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a> = i;
-<a name="l03070"></a>03070                     <span class="keywordflow">break</span>;
-<a name="l03071"></a>03071                 }
-<a name="l03072"></a>03072             }
-<a name="l03073"></a>03073         }
-<a name="l03074"></a>03074     }
-<a name="l03075"></a>03075 
-<a name="l03076"></a>03076     cassure(                                entry_list_size(obs) > 0,
-<a name="l03077"></a>03077                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l03078"></a>03078                                             <span class="keywordflow">return</span> NULL,
-<a name="l03079"></a>03079                                             <span class="stringliteral">"No stars found"</span>);
-<a name="l03080"></a>03080 
-<a name="l03081"></a>03081     <span class="keywordflow">return</span> obs;
-<a name="l03082"></a>03082 }
-<a name="l03083"></a>03083 
-<a name="l03084"></a>03084 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03085"></a>03085 <span class="preprocessor">#undef cleanup</span>
-<a name="l03086"></a>03086 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l03087"></a>03087 <span class="preprocessor"></span>
-<a name="l03100"></a>03100 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03101"></a>03101 <span class="keyword">static</span> fors_std_star*
-<a name="l03102"></a><a class="code" href="group__fors__photometry.html#g99be8a6361832a8a2592304da84bc62b">03102</a> <a class="code" href="group__fors__photometry.html#g99be8a6361832a8a2592304da84bc62b">fors_photometry_read_input_listinsert_star_if_new</a>(
-<a name="l03103"></a>03103                                             fors_std_star_list  *std_list,
-<a name="l03104"></a>03104                                             fors_std_star       *std,
-<a name="l03105"></a>03105                                             <span class="keywordtype">double</span>              mind_arcsec)
-<a name="l03106"></a>03106 {
-<a name="l03107"></a>03107     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l03108"></a>03108     <span class="keywordtype">bool</span>            found = <span class="keyword">false</span>;
-<a name="l03109"></a>03109     
-<a name="l03110"></a>03110     cassure_automsg(                        std_list != NULL,
-<a name="l03111"></a>03111                                             CPL_ERROR_NULL_INPUT,
-<a name="l03112"></a>03112                                             <span class="keywordflow">return</span> std);
-<a name="l03113"></a>03113     cassure_automsg(                        std != NULL,
-<a name="l03114"></a>03114                                             CPL_ERROR_NULL_INPUT,
-<a name="l03115"></a>03115                                             <span class="keywordflow">return</span> std);
-<a name="l03116"></a>03116     cassure_automsg(                        mind_arcsec > 0,
-<a name="l03117"></a>03117                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l03118"></a>03118                                             <span class="keywordflow">return</span> std);
-<a name="l03119"></a>03119     
-<a name="l03120"></a>03120     <span class="keywordflow">if</span> (fors_std_star_list_size(std_list) > 0)
-<a name="l03121"></a>03121     {
-<a name="l03122"></a>03122         fors_std_star   *nearest;
-<a name="l03123"></a>03123         <span class="keywordtype">double</span>          dist_arcsec;
-<a name="l03124"></a>03124         <span class="comment">/* Only if the nearest standard star is farther </span>
-<a name="l03125"></a>03125 <span class="comment">         * away than 5 arcsecs, insert this standard star </span>
-<a name="l03126"></a>03126 <span class="comment">         * in the standard star list. */</span>
-<a name="l03127"></a>03127         nearest = fors_std_star_list_kth_val(
-<a name="l03128"></a>03128                                             std_list, 1,
-<a name="l03129"></a>03129                                             (fors_std_star_list_func_eval)
-<a name="l03130"></a>03130                                             fors_std_star_dist_arcsec,
-<a name="l03131"></a>03131                                             std);
-<a name="l03132"></a>03132         passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> std);
-<a name="l03133"></a>03133         
-<a name="l03134"></a>03134         dist_arcsec = fors_std_star_dist_arcsec(nearest, std);
-<a name="l03135"></a>03135         passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> std);
-<a name="l03136"></a>03136         
-<a name="l03137"></a>03137         cpl_msg_debug(                      cpl_func,
-<a name="l03138"></a>03138                                             <span class="stringliteral">"dist = %f arcseconds"</span>,
-<a name="l03139"></a>03139                                             dist_arcsec);
-<a name="l03140"></a>03140 
-<a name="l03141"></a>03141         <span class="keywordflow">if</span> (dist_arcsec < mind_arcsec)
-<a name="l03142"></a>03142         {
-<a name="l03143"></a>03143             <span class="comment">/* trust a star only if it's always trusted */</span>
-<a name="l03144"></a>03144             nearest->trusted &= std->trusted;
-<a name="l03145"></a>03145             <span class="comment">/* delete the new star and link to the old one */</span>
-<a name="l03146"></a>03146             fors_std_star_delete(&std);
-<a name="l03147"></a>03147             std = nearest;
-<a name="l03148"></a>03148             found = <span class="keyword">true</span>;
-<a name="l03149"></a>03149         }
-<a name="l03150"></a>03150     }
-<a name="l03151"></a>03151     
-<a name="l03152"></a>03152     <span class="keywordflow">if</span> (!found)
-<a name="l03153"></a>03153     {
-<a name="l03154"></a>03154         fors_std_star_list_insert(std_list, std);
-<a name="l03155"></a>03155     }
-<a name="l03156"></a>03156     
-<a name="l03157"></a>03157     <span class="keywordflow">return</span> std;
-<a name="l03158"></a>03158 }
-<a name="l03159"></a>03159 
-<a name="l03160"></a>03160 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03161"></a>03161 <span class="preprocessor">#undef cleanup</span>
-<a name="l03162"></a>03162 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l03163"></a>03163 <span class="preprocessor"></span><span class="comment">/*</span>
-<a name="l03164"></a>03164 <span class="comment"> * @brief   Adjust @em trusted flags.</span>
-<a name="l03165"></a>03165 <span class="comment"> * @param   stdl            Standard star list</span>
-<a name="l03166"></a>03166 <span class="comment"> * @param   el              Observation entry list</span>
-<a name="l03167"></a>03167 <span class="comment"> * @param   override_fit_m  Flag whether to fit all catalog magnitudes</span>
-<a name="l03168"></a>03168 <span class="comment"> * @param   n_mag_fits      (Output) number of magnitudes to fit</span>
-<a name="l03169"></a>03169 <span class="comment"> * @return  CPL error code</span>
-<a name="l03170"></a>03170 <span class="comment"> */</span>
-<a name="l03171"></a>03171 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03172"></a>03172 <span class="keyword">static</span> cpl_error_code
-<a name="l03173"></a><a class="code" href="group__fors__photometry.html#g07d83baf5879b02b0224e2eb59390bed">03173</a> <a class="code" href="group__fors__photometry.html#g07d83baf5879b02b0224e2eb59390bed">fors_photometry_adjust_fit_mag_flags</a>(       fors_std_star_list  *stdl,
-<a name="l03174"></a>03174                                             entry_list          *obsl,
-<a name="l03175"></a>03175                                             <span class="keywordtype">bool</span>                override_fit_m,
-<a name="l03176"></a>03176                                             <span class="keywordtype">int</span>                 *n_mag_fits)
-<a name="l03177"></a>03177 {
-<a name="l03178"></a>03178     fors_std_star   *std;
-<a name="l03179"></a>03179     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l03180"></a>03180     
-<a name="l03181"></a>03181     cassure_automsg(                        stdl != NULL,
-<a name="l03182"></a>03182                                             CPL_ERROR_NULL_INPUT,
-<a name="l03183"></a>03183                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03184"></a>03184     cassure_automsg(                        obsl != NULL,
-<a name="l03185"></a>03185                                             CPL_ERROR_NULL_INPUT,
-<a name="l03186"></a>03186                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03187"></a>03187     cassure_automsg(                        n_mag_fits != NULL,
-<a name="l03188"></a>03188                                             CPL_ERROR_NULL_INPUT,
-<a name="l03189"></a>03189                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03190"></a>03190     
-<a name="l03191"></a>03191     *n_mag_fits = 0;
-<a name="l03192"></a>03192     
-<a name="l03193"></a>03193     <span class="comment">/* If (override_fit_m), then fit all magnitudes.</span>
-<a name="l03194"></a>03194 <span class="comment">     * The intention is to fit in a best way the f polynomial. Just one</span>
-<a name="l03195"></a>03195 <span class="comment">     * star is necessary to fix the offset, so just don't fit the magnitude</span>
-<a name="l03196"></a>03196 <span class="comment">     * of the first one. */</span>
-<a name="l03197"></a>03197     <span class="keywordflow">if</span> (override_fit_m)
-<a name="l03198"></a>03198     {
-<a name="l03199"></a>03199         std = fors_std_star_list_first(stdl);
-<a name="l03200"></a>03200         <span class="comment">/* find the first trusted object */</span>
-<a name="l03201"></a>03201         <span class="keywordflow">while</span> (std != NULL && std->trusted == <span class="keyword">false</span>)
-<a name="l03202"></a>03202         {
-<a name="l03203"></a>03203             std = fors_std_star_list_next(stdl);
-<a name="l03204"></a>03204             (*n_mag_fits)++;
-<a name="l03205"></a>03205         }
-<a name="l03206"></a>03206         <span class="comment">/* keep this one */</span>
-<a name="l03207"></a>03207         <span class="keywordflow">if</span> (std != NULL)
-<a name="l03208"></a>03208             std = fors_std_star_list_next(stdl);
-<a name="l03209"></a>03209         <span class="comment">/* and set the rest to non-trusted */</span>
-<a name="l03210"></a>03210         <span class="keywordflow">for</span> ( ; std != NULL; std = fors_std_star_list_next(stdl))
-<a name="l03211"></a>03211         {
-<a name="l03212"></a>03212             std->trusted = <span class="keyword">false</span>;
-<a name="l03213"></a>03213             (*n_mag_fits)++;
-<a name="l03214"></a>03214         }
-<a name="l03215"></a>03215     }
-<a name="l03216"></a>03216     <span class="keywordflow">else</span>
-<a name="l03217"></a>03217     {
-<a name="l03218"></a>03218         <span class="keywordflow">for</span> (   std = fors_std_star_list_first(stdl);
-<a name="l03219"></a>03219                 std != NULL;
-<a name="l03220"></a>03220                 std = fors_std_star_list_next(stdl))
-<a name="l03221"></a>03221         {
-<a name="l03222"></a>03222             <span class="keywordflow">if</span>(! std->trusted)
-<a name="l03223"></a>03223                 (*n_mag_fits)++;
-<a name="l03224"></a>03224         }
-<a name="l03225"></a>03225     }
-<a name="l03226"></a>03226     
-<a name="l03227"></a>03227     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?
-<a name="l03228"></a>03228             CPL_ERROR_NONE :
-<a name="l03229"></a>03229             cpl_error_get_code());
-<a name="l03230"></a>03230 }
-<a name="l03231"></a>03231 
-<a name="l03232"></a>03232 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03233"></a>03233 <span class="preprocessor">#undef cleanup</span>
-<a name="l03234"></a>03234 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l03235"></a>03235 <span class="preprocessor">do { \</span>
-<a name="l03236"></a>03236 <span class="preprocessor">    cpl_array_delete(n_obs_per_std); n_obs_per_std = NULL; \</span>
-<a name="l03237"></a>03237 <span class="preprocessor">    fors_std_star_list_delete(&std_list_copy, NULL); \</span>
-<a name="l03238"></a>03238 <span class="preprocessor">    entry_list_delete(&obs_list_copy, NULL); \</span>
-<a name="l03239"></a>03239 <span class="preprocessor">} while (0)</span>
-<a name="l03240"></a>03240 <span class="preprocessor"></span>
-<a name="l03247"></a>03247 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03248"></a>03248 <span class="keyword">static</span> cpl_error_code
-<a name="l03249"></a><a class="code" href="group__fors__photometry.html#gb82262e58905a5f0d047cf607614aa6d">03249</a> <a class="code" href="group__fors__photometry.html#gb82262e58905a5f0d047cf607614aa6d">fors_photometry_remove_unnecessary</a>(         fors_std_star_list  *std_list,
-<a name="l03250"></a>03250                                             entry_list          *obs_list,
-<a name="l03251"></a>03251                                             <span class="keywordtype">int</span>                 *n_mag_fits)
-<a name="l03252"></a>03252 {
-<a name="l03253"></a>03253     cpl_array           *n_obs_per_std = NULL;
-<a name="l03254"></a>03254     fors_std_star_list  *std_list_copy = NULL;
-<a name="l03255"></a>03255     entry_list          *obs_list_copy = NULL;
-<a name="l03256"></a>03256     fors_std_star       *std;
-<a name="l03257"></a>03257     <a class="code" href="structentry.html">entry</a>               *obs;
-<a name="l03258"></a>03258     <span class="keywordtype">int</span>                 n_std_stars,
-<a name="l03259"></a>03259                         n_removed = 0,
-<a name="l03260"></a>03260                         n;
-<a name="l03261"></a>03261     cpl_errorstate      errstat = cpl_errorstate_get();
-<a name="l03262"></a>03262     
-<a name="l03263"></a>03263     cassure_automsg(                        std_list != NULL,
-<a name="l03264"></a>03264                                             CPL_ERROR_NULL_INPUT,
-<a name="l03265"></a>03265                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03266"></a>03266     cassure_automsg(                        obs_list != NULL,
-<a name="l03267"></a>03267                                             CPL_ERROR_NULL_INPUT,
-<a name="l03268"></a>03268                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03269"></a>03269     cassure_automsg(                        n_mag_fits != NULL,
-<a name="l03270"></a>03270                                             CPL_ERROR_NULL_INPUT,
-<a name="l03271"></a>03271                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03272"></a>03272     
-<a name="l03273"></a>03273     *n_mag_fits = 0;
-<a name="l03274"></a>03274     
-<a name="l03275"></a>03275     n_std_stars = fors_std_star_list_size(std_list);
-<a name="l03276"></a>03276     
-<a name="l03277"></a>03277     n_obs_per_std = <a class="code" href="group__fors__photometry.html#gbb6ba893e672e51a2a83674b93fe4733">fors_photometry_count_observations</a>(std_list, obs_list);
-<a name="l03278"></a>03278     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03279"></a>03279     
-<a name="l03280"></a>03280     <span class="comment">/* We are not so sure what happens if we iterate the FORS list and at the</span>
-<a name="l03281"></a>03281 <span class="comment">     * same time remove entries, so copy the list to temporarily keep the</span>
-<a name="l03282"></a>03282 <span class="comment">     * pointers. */</span>
-<a name="l03283"></a>03283     std_list_copy = fors_std_star_list_duplicate(std_list, NULL);
-<a name="l03284"></a>03284     obs_list_copy = entry_list_duplicate(obs_list, NULL);
-<a name="l03285"></a>03285     
-<a name="l03286"></a>03286     <span class="comment">/* first remove all unnecessary observation entries */</span>
-<a name="l03287"></a>03287     <span class="keywordflow">for</span> (   obs = entry_list_first(obs_list_copy);
-<a name="l03288"></a>03288             obs != NULL;
-<a name="l03289"></a>03289             obs = entry_list_next(obs_list_copy))
-<a name="l03290"></a>03290     {
-<a name="l03291"></a>03291         <span class="keywordtype">int</span>     n_obs;
-<a name="l03292"></a>03292         <span class="keywordtype">bool</span>    remove = <span class="keyword">false</span>;
-<a name="l03293"></a>03293         
-<a name="l03294"></a>03294         remove |= (obs-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a> < 0 || obs-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a> >= n_std_stars);
-<a name="l03295"></a>03295         
-<a name="l03296"></a>03296         n_obs = cpl_array_get_int(n_obs_per_std, obs-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a>, NULL);
-<a name="l03297"></a>03297         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                             cpl_errorstate_is_equal(errstat),
-<a name="l03298"></a>03298                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l03299"></a>03299                                             NULL);
-<a name="l03300"></a>03300         remove |= (n_obs < 2 && !obs-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->trusted);
-<a name="l03301"></a>03301         
-<a name="l03302"></a>03302         <span class="keywordflow">if</span> (remove)
-<a name="l03303"></a>03303         {
-<a name="l03304"></a>03304             entry_list_remove(obs_list, obs);
-<a name="l03305"></a>03305             <a class="code" href="group__fors__photometry.html#g704bbcab4ba8418ff88419511eb5092b">entry_delete_but_standard</a>(&obs);
-<a name="l03306"></a>03306         }
-<a name="l03307"></a>03307     }
-<a name="l03308"></a>03308     
-<a name="l03309"></a>03309     <span class="keywordflow">for</span> (   std = fors_std_star_list_first(std_list_copy), n = 0;
-<a name="l03310"></a>03310             std != NULL;
-<a name="l03311"></a>03311             std = fors_std_star_list_next(std_list_copy), n++)
-<a name="l03312"></a>03312     {
-<a name="l03313"></a>03313         <span class="keywordtype">int</span>     n_obs;
-<a name="l03314"></a>03314         
-<a name="l03315"></a>03315         n_obs = cpl_array_get_int(n_obs_per_std, n, NULL);
-<a name="l03316"></a>03316         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                             cpl_errorstate_is_equal(errstat),
-<a name="l03317"></a>03317                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l03318"></a>03318                                             NULL);
-<a name="l03319"></a>03319         
-<a name="l03320"></a>03320         <span class="keywordflow">if</span> (n_obs < 2 && !std->trusted)
-<a name="l03321"></a>03321         {
-<a name="l03322"></a>03322             fors_std_star_list_remove(std_list, std);
-<a name="l03323"></a>03323             fors_std_star_delete(&std);
-<a name="l03324"></a>03324             n_removed++;
-<a name="l03325"></a>03325         }
-<a name="l03326"></a>03326         <span class="keywordflow">else</span> <span class="keywordflow">if</span>(!std->trusted)
-<a name="l03327"></a>03327         {
-<a name="l03328"></a>03328             (*n_mag_fits)++;
-<a name="l03329"></a>03329         }
-<a name="l03330"></a>03330     }
-<a name="l03331"></a>03331     
-<a name="l03332"></a>03332     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;    <span class="comment">/* don't need that anymore */</span>
-<a name="l03333"></a>03333     
-<a name="l03334"></a>03334     <span class="comment">/* Set the new star indices */</span>
-<a name="l03335"></a>03335     <span class="keywordflow">for</span> (   obs = entry_list_first(obs_list);
-<a name="l03336"></a>03336             obs != NULL;
-<a name="l03337"></a>03337             obs = entry_list_next(obs_list))
-<a name="l03338"></a>03338     {
-<a name="l03339"></a>03339         <span class="keywordflow">for</span> (   std = fors_std_star_list_first(std_list), n = 0;
-<a name="l03340"></a>03340                 std != NULL;
-<a name="l03341"></a>03341                 std = fors_std_star_list_next(std_list), n++)
-<a name="l03342"></a>03342         {
-<a name="l03343"></a>03343             <span class="keywordflow">if</span> (obs-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> == std)
-<a name="l03344"></a>03344             {
-<a name="l03345"></a>03345                 obs-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a> = n;
-<a name="l03346"></a>03346                 <span class="keywordflow">break</span>;
-<a name="l03347"></a>03347             }
-<a name="l03348"></a>03348         }
-<a name="l03349"></a>03349     }
-<a name="l03350"></a>03350     
-<a name="l03351"></a>03351     <span class="keywordflow">if</span> (n_removed > 0)
-<a name="l03352"></a>03352         cpl_msg_info(   cpl_func,
-<a name="l03353"></a>03353                         <span class="stringliteral">"Discarded %d untrusted/fitted objects which were "</span>
-<a name="l03354"></a>03354                         <span class="stringliteral">"observed only once (and therefore don't contribute)."</span>,
-<a name="l03355"></a>03355                         n_removed);
-<a name="l03356"></a>03356     
-<a name="l03357"></a>03357     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l03358"></a>03358     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?
-<a name="l03359"></a>03359             CPL_ERROR_NONE :
-<a name="l03360"></a>03360             cpl_error_get_code());
-<a name="l03361"></a>03361 }
-<a name="l03362"></a>03362 
-<a name="l03363"></a>03363 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03364"></a>03364 <span class="preprocessor">#undef cleanup</span>
-<a name="l03365"></a>03365 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l03366"></a>03366 <span class="preprocessor">do { \</span>
-<a name="l03367"></a>03367 <span class="preprocessor">    cpl_array_unwrap(n_obs_a); n_obs_a = NULL; \</span>
-<a name="l03368"></a>03368 <span class="preprocessor">    cpl_free(n_obs); n_obs = NULL; \</span>
-<a name="l03369"></a>03369 <span class="preprocessor">} while (0)</span>
-<a name="l03370"></a>03370 <span class="preprocessor"></span>
-<a name="l03377"></a>03377 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03378"></a>03378 <span class="keyword">static</span> cpl_array*
-<a name="l03379"></a><a class="code" href="group__fors__photometry.html#gbb6ba893e672e51a2a83674b93fe4733">03379</a> <a class="code" href="group__fors__photometry.html#gbb6ba893e672e51a2a83674b93fe4733">fors_photometry_count_observations</a>(         fors_std_star_list  *std_list,
-<a name="l03380"></a>03380                                             entry_list          *obs_list)
-<a name="l03381"></a>03381 {
-<a name="l03382"></a>03382     <span class="keywordtype">int</span>         *n_obs = NULL;
-<a name="l03383"></a>03383     cpl_array   *n_obs_a = NULL;
-<a name="l03384"></a>03384     <a class="code" href="structentry.html">entry</a>       *e;
-<a name="l03385"></a>03385     <span class="keywordtype">int</span>         n_std_stars;
-<a name="l03386"></a>03386     
-<a name="l03387"></a>03387     cassure_automsg(                        std_list != NULL,
-<a name="l03388"></a>03388                                             CPL_ERROR_NULL_INPUT,
-<a name="l03389"></a>03389                                             <span class="keywordflow">return</span> n_obs_a);
-<a name="l03390"></a>03390     cassure_automsg(                        obs_list != NULL,
-<a name="l03391"></a>03391                                             CPL_ERROR_NULL_INPUT,
-<a name="l03392"></a>03392                                             <span class="keywordflow">return</span> n_obs_a);
-<a name="l03393"></a>03393     
-<a name="l03394"></a>03394     n_std_stars = fors_std_star_list_size(std_list);
-<a name="l03395"></a>03395     n_obs = cpl_calloc(n_std_stars, <span class="keyword">sizeof</span>(*n_obs));
-<a name="l03396"></a>03396     
-<a name="l03397"></a>03397     <span class="keywordflow">for</span> (   e = entry_list_first(obs_list);
-<a name="l03398"></a>03398             e != NULL;
-<a name="l03399"></a>03399             e = entry_list_next(obs_list))
-<a name="l03400"></a>03400     {
-<a name="l03401"></a>03401         ppassure(                           e-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a> >= 0
-<a name="l03402"></a>03402                                             && e-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a> < n_std_stars,
-<a name="l03403"></a>03403                                             CPL_ERROR_UNSPECIFIED,
-<a name="l03404"></a>03404                                             <span class="keywordflow">return</span> n_obs_a);
-<a name="l03405"></a>03405         n_obs[e-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a>]++;
-<a name="l03406"></a>03406     }
-<a name="l03407"></a>03407     
-<a name="l03408"></a>03408     n_obs_a = cpl_array_wrap_int(n_obs, n_std_stars);
-<a name="l03409"></a>03409     <span class="keywordflow">return</span> n_obs_a;
-<a name="l03410"></a>03410 }
-<a name="l03411"></a>03411 
-<a name="l03412"></a>03412 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03413"></a>03413 <span class="preprocessor">#undef cleanup</span>
-<a name="l03414"></a>03414 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l03415"></a>03415 <span class="preprocessor">do { \</span>
-<a name="l03416"></a>03416 <span class="preprocessor">    fors_matrix_null(&lhs); \</span>
-<a name="l03417"></a>03417 <span class="preprocessor">    if (n_fit_e_cols != NULL) \</span>
-<a name="l03418"></a>03418 <span class="preprocessor">        *n_fit_e_cols = 0; \</span>
-<a name="l03419"></a>03419 <span class="preprocessor">} while (0)</span>
-<a name="l03420"></a>03420 <span class="preprocessor"></span>
-<a name="l03444"></a>03444 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03445"></a>03445 <span class="keyword">static</span> cpl_matrix*
-<a name="l03446"></a><a class="code" href="group__fors__photometry.html#gb269a10fede882f376f2e599965cebe4">03446</a> <a class="code" href="group__fors__photometry.html#gb269a10fede882f376f2e599965cebe4">build_equations_lhs_matrix_from_parameters</a>( <span class="keyword">const</span> entry_list    *obs_list,
-<a name="l03447"></a>03447                                             <span class="keyword">const</span> fors_std_star_list  *std_list,
-<a name="l03448"></a>03448                                             <span class="keywordtype">bool</span>                fit_z,
-<a name="l03449"></a>03449                                             <span class="keywordtype">bool</span>                fit_c,
-<a name="l03450"></a>03450                                             <span class="keywordtype">int</span>                 *n_fit_e_cols)
-<a name="l03451"></a>03451 {
-<a name="l03452"></a>03452     <span class="keywordtype">int</span>             n_std_stars,
-<a name="l03453"></a>03453                     n_obs,
-<a name="l03454"></a>03454                     n_col,
-<a name="l03455"></a>03455                     n_fit_std_mag = 0,
-<a name="l03456"></a>03456                     n_frames,
-<a name="l03457"></a>03457                     n_atm_ext,  <span class="comment">/* nr of atm. extinction coefficients */</span>
-<a name="l03458"></a>03458                     row;
-<a name="l03459"></a>03459     <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>     *e;
-<a name="l03460"></a>03460     <span class="keyword">const</span> fors_std_star
-<a name="l03461"></a>03461                     *std;
-<a name="l03462"></a>03462     cpl_matrix      *lhs = NULL;
-<a name="l03463"></a>03463     <span class="keywordtype">bool</span>            printed = <span class="keyword">false</span>;
-<a name="l03464"></a>03464     
-<a name="l03465"></a>03465     <span class="comment">/* free output pointers */</span>
-<a name="l03466"></a>03466     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l03467"></a>03467     
-<a name="l03468"></a>03468     <span class="comment">/* check input */</span>
-<a name="l03469"></a>03469     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> lhs, <span class="stringliteral">"Previous error caught."</span>);
-<a name="l03470"></a>03470     
-<a name="l03471"></a>03471     ppassure(                               obs_list != NULL
-<a name="l03472"></a>03472                                             && std_list != NULL,
-<a name="l03473"></a>03473                                             CPL_ERROR_NULL_INPUT,
-<a name="l03474"></a>03474                                             <span class="keywordflow">return</span> lhs);
-<a name="l03475"></a>03475     
-<a name="l03476"></a>03476     n_std_stars = fors_std_star_list_size(std_list);
-<a name="l03477"></a>03477     n_obs = entry_list_size(obs_list);
-<a name="l03478"></a>03478     
-<a name="l03479"></a>03479     cassure(                                n_std_stars > 0 && n_obs > 0,
-<a name="l03480"></a>03480                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l03481"></a>03481                                             <span class="keywordflow">return</span> lhs,
-<a name="l03482"></a>03482                                             <span class="stringliteral">"Empty input list"</span>);
-<a name="l03483"></a>03483     
-<a name="l03484"></a>03484     <span class="comment">/* prepare */</span>
-<a name="l03485"></a>03485     n_obs = entry_list_size(obs_list);
-<a name="l03486"></a>03486     <span class="keywordflow">for</span> (   std = fors_std_star_list_first_const(std_list);
-<a name="l03487"></a>03487             std != NULL;
-<a name="l03488"></a>03488             std = fors_std_star_list_next_const(std_list))
-<a name="l03489"></a>03489     {
-<a name="l03490"></a>03490         n_fit_std_mag += !(std->trusted);
-<a name="l03491"></a>03491     }
-<a name="l03492"></a>03492     
-<a name="l03493"></a>03493     n_frames = 0;
-<a name="l03494"></a>03494     n_atm_ext = 0;
-<a name="l03495"></a>03495     <span class="keywordflow">for</span> (   e = entry_list_first_const(obs_list);
-<a name="l03496"></a>03496             e != NULL;
-<a name="l03497"></a>03497             e = entry_list_next_const(obs_list))
-<a name="l03498"></a>03498     {
-<a name="l03499"></a>03499         <span class="comment">/* assume indices counting from 0 */</span>
-<a name="l03500"></a>03500         <span class="keywordflow">if</span> (e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a> + 1 > n_frames)
-<a name="l03501"></a>03501             n_frames = e-><a class="code" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a> + 1;
-<a name="l03502"></a>03502         <span class="keywordflow">if</span> (e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> + 1 > n_atm_ext)
-<a name="l03503"></a>03503             n_atm_ext = e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a> + 1;
-<a name="l03504"></a>03504     }
-<a name="l03505"></a>03505     <span class="keywordflow">if</span> (n_atm_ext < 0) n_atm_ext = 0;
-<a name="l03506"></a>03506     passure(!cpl_error_get_code(), <span class="keywordflow">return</span> lhs);
-<a name="l03507"></a>03507     
-<a name="l03508"></a>03508     n_col = n_fit_std_mag
-<a name="l03509"></a>03509             + ((fit_z) ? 1 : 0)
-<a name="l03510"></a>03510             + n_atm_ext
-<a name="l03511"></a>03511             + ((fit_c) ? 1 : 0);
-<a name="l03512"></a>03512     
-<a name="l03513"></a>03513     <span class="keywordflow">if</span> (n_col == 0) <span class="comment">/* if nothing to be fitted here */</span>
-<a name="l03514"></a>03514     {
-<a name="l03515"></a>03515         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l03516"></a>03516         <span class="keywordflow">return</span> lhs; <span class="comment">/* NULL */</span>
-<a name="l03517"></a>03517     }
-<a name="l03518"></a>03518     
-<a name="l03519"></a>03519     lhs = cpl_matrix_new(n_obs, n_col);
-<a name="l03520"></a>03520     passure(!cpl_error_get_code(), <span class="keywordflow">return</span> lhs);
-<a name="l03521"></a>03521     
-<a name="l03522"></a>03522     <span class="comment">/* start */</span>
-<a name="l03523"></a>03523     <span class="comment">/* FIXME: FAP: insert visual comments here */</span>
-<a name="l03524"></a>03524     <span class="keywordflow">for</span> (e = entry_list_first_const(obs_list), row = 0;
-<a name="l03525"></a>03525          e != NULL;
-<a name="l03526"></a>03526          e = entry_list_next_const(obs_list), row++) 
-<a name="l03527"></a>03527     {
-<a name="l03528"></a>03528         <span class="keywordtype">int</span> col = 0,
-<a name="l03529"></a>03529             k;
-<a name="l03530"></a>03530         
-<a name="l03531"></a>03531         <span class="comment">/* Star not identified, should not happen */</span>
-<a name="l03532"></a>03532         ppassure(                           e-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a> >= 0,
-<a name="l03533"></a>03533                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l03534"></a>03534                                             <span class="keywordflow">return</span> lhs);
-<a name="l03535"></a>03535         
-<a name="l03536"></a>03536         <span class="keywordflow">if</span> (n_fit_std_mag > 0) <span class="comment">/* one column per std. star's magnitude to fit */</span>
-<a name="l03537"></a>03537         {
-<a name="l03538"></a>03538             <span class="keywordflow">for</span> (   std = fors_std_star_list_first_const(std_list), k = 0;
-<a name="l03539"></a>03539                     std != NULL;
-<a name="l03540"></a>03540                     std = fors_std_star_list_next_const(std_list), k++)
-<a name="l03541"></a>03541             {
-<a name="l03542"></a>03542                 <span class="keywordflow">if</span> (!(std->trusted))
-<a name="l03543"></a>03543                 {
-<a name="l03544"></a>03544                     <span class="keywordflow">if</span> (!printed)
-<a name="l03545"></a>03545                         cpl_msg_debug(      cpl_func,
-<a name="l03546"></a>03546                                             <span class="stringliteral">"Creating column for mag(M%d)"</span>,
-<a name="l03547"></a>03547                                             k);
-<a name="l03548"></a>03548                     <span class="keywordflow">if</span> (e-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> == std)
-<a name="l03549"></a>03549                         cpl_matrix_set(lhs, row, col, 1);
-<a name="l03550"></a>03550                     col++;
-<a name="l03551"></a>03551                 }
-<a name="l03552"></a>03552             }
-<a name="l03553"></a>03553         }
-<a name="l03554"></a>03554         
-<a name="l03555"></a>03555         <span class="keywordflow">if</span> (fit_z)
-<a name="l03556"></a>03556         {
-<a name="l03557"></a>03557             <span class="keywordflow">if</span> (!printed)
-<a name="l03558"></a>03558                 cpl_msg_debug(cpl_func, <span class="stringliteral">"Creating column for Z"</span>);
-<a name="l03559"></a>03559             cpl_matrix_set(lhs, row, col++, -1);
-<a name="l03560"></a>03560         }
-<a name="l03561"></a>03561         
-<a name="l03562"></a>03562         <span class="keywordflow">if</span> (n_atm_ext > 0)
-<a name="l03563"></a>03563         {
-<a name="l03564"></a>03564             <span class="keywordflow">for</span> (k = 0; k < n_atm_ext; k++)
-<a name="l03565"></a>03565             {
-<a name="l03566"></a>03566                 <span class="keywordflow">if</span> (!printed)
-<a name="l03567"></a>03567                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Creating column for E_%d"</span>, k);
-<a name="l03568"></a>03568                 <span class="keywordtype">double</span> val = (k == e-><a class="code" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a>) ? e-><a class="code" href="structentry.html#6f585239f5d6905b0cff05055d77bf9c">airmass</a> : 0;
-<a name="l03569"></a>03569                 cpl_matrix_set(lhs, row, col++, val);
-<a name="l03570"></a>03570             }
-<a name="l03571"></a>03571         }
-<a name="l03572"></a>03572 
-<a name="l03573"></a>03573         <span class="keywordflow">if</span> (fit_c)  <span class="comment">/* fit color coeff */</span>
-<a name="l03574"></a>03574         {
-<a name="l03575"></a>03575             <span class="keywordtype">double</span>  c;
-<a name="l03576"></a>03576             <span class="keywordflow">if</span> (!printed)
-<a name="l03577"></a>03577                 cpl_msg_debug(cpl_func,     <span class="stringliteral">"Creating column for color "</span>
-<a name="l03578"></a>03578                                             <span class="stringliteral">"correction term"</span>);
-<a name="l03579"></a>03579             c = e-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->color;
-<a name="l03580"></a>03580             <span class="comment">/* if (fit_mag), then fit observed magnitude, not corrected by</span>
-<a name="l03581"></a>03581 <span class="comment">             * catalogue color, or in other words: set std.star elements</span>
-<a name="l03582"></a>03582 <span class="comment">             * to zero */</span>
-<a name="l03583"></a>03583             <span class="keywordflow">if</span> (!(e-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->trusted))
-<a name="l03584"></a>03584                 c = 0;
-<a name="l03585"></a>03585             cpl_matrix_set(lhs, row, col++, c);
-<a name="l03586"></a>03586         }
-<a name="l03587"></a>03587         printed = <span class="keyword">true</span>;
-<a name="l03588"></a>03588     }
-<a name="l03589"></a>03589     passure(!cpl_error_get_code(), <span class="keywordflow">return</span> lhs);
-<a name="l03590"></a>03590     
-<a name="l03591"></a>03591     <span class="keywordflow">if</span> (n_fit_e_cols != NULL)
-<a name="l03592"></a>03592         *n_fit_e_cols = n_atm_ext;
-<a name="l03593"></a>03593     
-<a name="l03594"></a>03594     <span class="keywordflow">return</span> lhs;
-<a name="l03595"></a>03595 }
-<a name="l03596"></a>03596 
-<a name="l03597"></a>03597 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03598"></a>03598 <span class="preprocessor">#undef cleanup</span>
-<a name="l03599"></a>03599 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l03600"></a>03600 <span class="preprocessor">do { \</span>
-<a name="l03601"></a>03601 <span class="preprocessor">    fors_matrix_null(&mat); \</span>
-<a name="l03602"></a>03602 <span class="preprocessor">    cpl_array_delete(Apowers); Apowers = NULL; \</span>
-<a name="l03603"></a>03603 <span class="preprocessor">} while (0)</span>
-<a name="l03604"></a>03604 <span class="preprocessor"></span>
-<a name="l03622"></a>03622 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03623"></a>03623 <span class="keyword">static</span> cpl_matrix*
-<a name="l03624"></a><a class="code" href="group__fors__photometry.html#g55817cb490a2517ef207f96a9cf51b8b">03624</a> <a class="code" href="group__fors__photometry.html#g55817cb490a2517ef207f96a9cf51b8b">build_equations_lhs_matrix_from_poly</a>(       <span class="keyword">const</span> entry_list        *obs_list,
-<a name="l03625"></a>03625                                             <span class="keyword">const</span> cpl_polynomial    *poly,
-<a name="l03626"></a>03626                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *pname,
-<a name="l03627"></a>03627                                             <span class="keywordtype">double</span> (*powerfunc)(
-<a name="l03628"></a>03628                                                             <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>*,
-<a name="l03629"></a>03629                                                             <span class="keyword">const</span> cpl_array*))
-<a name="l03630"></a>03630 {
-<a name="l03631"></a>03631     <span class="keywordtype">int</span>             n_obs,
-<a name="l03632"></a>03632                     n_coeff,
-<a name="l03633"></a>03633                     n_dims,
-<a name="l03634"></a>03634                     row;
-<a name="l03635"></a>03635     cpl_matrix      *mat = NULL;
-<a name="l03636"></a>03636     cpl_array       *Apowers = NULL;
-<a name="l03637"></a>03637     <span class="keywordtype">int</span>             *ipowers;
-<a name="l03638"></a>03638     cpl_size        *ipowers_size;
-<a name="l03639"></a>03639     <span class="keyword">const</span> entry     *e;
-<a name="l03640"></a>03640     cpl_error_code  errc;
-<a name="l03641"></a>03641     <span class="keywordtype">bool</span>            printed = <span class="keyword">false</span>;
-<a name="l03642"></a>03642     <span class="keywordtype">int</span>             i;
-<a name="l03643"></a>03643     
-<a name="l03644"></a>03644     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!(errc=cpl_error_get_code()), <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Previous error caught."</span>);
-<a name="l03645"></a>03645     
-<a name="l03646"></a>03646     <span class="comment">/* check input */</span>
-<a name="l03647"></a>03647     ppassure(                               poly != NULL && obs_list != NULL,
-<a name="l03648"></a>03648                                             CPL_ERROR_NULL_INPUT,
-<a name="l03649"></a>03649                                             <span class="keywordflow">return</span> NULL);
-<a name="l03650"></a>03650     
-<a name="l03651"></a>03651     <span class="comment">/* init */</span>
-<a name="l03652"></a>03652     n_obs = entry_list_size(obs_list);
-<a name="l03653"></a>03653     n_coeff = <a class="code" href="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679">fors_polynomial_count_coeff</a>(poly);
-<a name="l03654"></a>03654     passure(!cpl_error_get_code(), <span class="keywordflow">return</span> NULL);
-<a name="l03655"></a>03655     
-<a name="l03656"></a>03656     <span class="keywordflow">if</span> (n_coeff == 0)
-<a name="l03657"></a>03657         <span class="keywordflow">return</span> NULL;
-<a name="l03658"></a>03658     
-<a name="l03659"></a>03659     mat = cpl_matrix_new(n_obs, n_coeff);
-<a name="l03660"></a>03660     
-<a name="l03661"></a>03661     <span class="comment">/* start */</span>
-<a name="l03662"></a>03662     n_dims = cpl_polynomial_get_dimension(poly);
-<a name="l03663"></a>03663     Apowers = cpl_array_new(n_dims, CPL_TYPE_INT);
-<a name="l03664"></a>03664     cpl_array_fill_window_int(Apowers, 0, n_dims, 0);
-<a name="l03665"></a>03665     ipowers = cpl_array_get_data_int(Apowers);
-<a name="l03666"></a>03666     passure(!cpl_error_get_code(), <span class="keywordflow">return</span> NULL);
-<a name="l03667"></a>03667     
-<a name="l03668"></a>03668     <span class="comment">//This is a workaround until cpl_array supports CPL_SIZE type elements. </span>
-<a name="l03669"></a>03669     ipowers_size = cpl_malloc(n_dims*<span class="keyword">sizeof</span>(ipowers_size));
-<a name="l03670"></a>03670     <span class="keywordflow">for</span> (i=0; i<n_dims; i++)
-<a name="l03671"></a>03671         ipowers_size[i] = ipowers[i];
-<a name="l03672"></a>03672     
-<a name="l03673"></a>03673     <span class="keywordflow">for</span> (e = entry_list_first_const(obs_list), row = 0;
-<a name="l03674"></a>03674          e != NULL;
-<a name="l03675"></a>03675          e = entry_list_next_const(obs_list), row++) 
-<a name="l03676"></a>03676     {
-<a name="l03677"></a>03677         <span class="keywordtype">int</span>     col = 0;
-<a name="l03678"></a>03678         <span class="keywordtype">bool</span>    overflow;
-<a name="l03679"></a>03679         
-<a name="l03680"></a>03680         overflow = <a class="code" href="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0">fors_polynomial_powers_find_first_coeff</a>(poly, ipowers_size);
-<a name="l03681"></a>03681         <span class="keywordflow">while</span> (!overflow)
-<a name="l03682"></a>03682         {
-<a name="l03683"></a>03683             <span class="keywordflow">if</span> (!printed)
-<a name="l03684"></a>03684             {
-<a name="l03685"></a>03685                 <span class="keywordtype">char</span> *cn = <a class="code" href="group__fors__polynomial.html#g54a749f0fe51db3713c776ffe5dd0b57">fors_polynomial_sprint_coeff</a>(poly, ipowers_size, pname);
-<a name="l03686"></a>03686                 <span class="keywordflow">if</span> (cn != NULL)
-<a name="l03687"></a>03687                 {
-<a name="l03688"></a>03688                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Creating column for %s"</span>, cn);
-<a name="l03689"></a>03689                     cpl_free(cn);
-<a name="l03690"></a>03690                 }
-<a name="l03691"></a>03691             }
-<a name="l03692"></a>03692             cpl_matrix_set(mat, row, col++, (*powerfunc)(e, Apowers));
-<a name="l03693"></a>03693             passure(!cpl_error_get_code(), <span class="keywordflow">return</span> NULL);
-<a name="l03694"></a>03694             
-<a name="l03695"></a>03695             overflow = <a class="code" href="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073">fors_polynomial_powers_find_next_coeff</a>(poly, ipowers_size);
-<a name="l03696"></a>03696         }
-<a name="l03697"></a>03697         
-<a name="l03698"></a>03698         printed = <span class="keyword">true</span>;
-<a name="l03699"></a>03699     }
-<a name="l03700"></a>03700     
-<a name="l03701"></a>03701     cpl_array_delete(Apowers);
-<a name="l03702"></a>03702     
-<a name="l03703"></a>03703     <span class="keywordflow">return</span> mat;
-<a name="l03704"></a>03704 }
-<a name="l03705"></a>03705 
-<a name="l03706"></a>03706 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03707"></a>03707 <span class="preprocessor">#undef cleanup</span>
-<a name="l03708"></a><a class="code" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">03708</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l03709"></a>03709 <span class="preprocessor">do { \</span>
-<a name="l03710"></a>03710 <span class="preprocessor">    fors_matrix_null(&rhs_input_cov); \</span>
-<a name="l03711"></a>03711 <span class="preprocessor">    fors_matrix_null(&rhs_jacobian); \</span>
-<a name="l03712"></a>03712 <span class="preprocessor">    fors_matrix_null(&rhs_input); \</span>
-<a name="l03713"></a>03713 <span class="preprocessor">    fors_matrix_null(&rhs_jacobian_T); \</span>
-<a name="l03714"></a>03714 <span class="preprocessor">    fors_matrix_null(&tmp_matrix); \</span>
-<a name="l03715"></a>03715 <span class="preprocessor">    fors_matrix_null(rhs); \</span>
-<a name="l03716"></a>03716 <span class="preprocessor">    fors_matrix_null(rhs_cov); \</span>
-<a name="l03717"></a>03717 <span class="preprocessor">} while (0)</span>
-<a name="l03718"></a>03718 <span class="preprocessor"></span>
-<a name="l03733"></a>03733 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03734"></a>03734 <span class="keyword">static</span> cpl_error_code
-<a name="l03735"></a><a class="code" href="group__fors__photometry.html#ge2d3cb795a4f549322f1febff5596787">03735</a> <a class="code" href="group__fors__photometry.html#ge2d3cb795a4f549322f1febff5596787">build_equations_rhs_cov</a>(                    <span class="keyword">const</span> entry_list    *obs_list,
-<a name="l03736"></a>03736                                             <span class="keyword">const</span> fors_std_star_list  *std_list,
-<a name="l03737"></a>03737                                             <span class="keywordtype">bool</span>                fit_z,
-<a name="l03738"></a>03738                                             <span class="keywordtype">bool</span>                fit_c,
-<a name="l03739"></a>03739                                             <span class="keywordtype">bool</span>                fit_e,
-<a name="l03740"></a>03740                                             <span class="keywordtype">double</span>              color_coeff,
-<a name="l03741"></a>03741                                             <span class="keywordtype">double</span>              dcolor_coeff,
-<a name="l03742"></a>03742                                             <span class="keywordtype">double</span>              ext_coeff,
-<a name="l03743"></a>03743                                             <span class="keywordtype">double</span>              dext_coeff,
-<a name="l03744"></a>03744                                             <span class="keywordtype">double</span>              zpoint,
-<a name="l03745"></a>03745                                             <span class="keywordtype">double</span>              dzpoint,
-<a name="l03746"></a>03746                                             cpl_matrix          **rhs,
-<a name="l03747"></a>03747                                             cpl_matrix          **rhs_cov)
-<a name="l03748"></a>03748 {
-<a name="l03749"></a>03749     <span class="comment">/* This function computes the following</span>
-<a name="l03750"></a>03750 <span class="comment">     * (with i = index of referenced std. star):</span>
-<a name="l03751"></a>03751 <span class="comment">     * </span>
-<a name="l03752"></a>03752 <span class="comment">     * rhs_obs = m_obs (instrumental magnitude)</span>
-<a name="l03753"></a>03753 <span class="comment">     *           - (!fit_mag_i)     ? cat_mag_i : 0</span>
-<a name="l03754"></a>03754 <span class="comment">     *           + (!fit_c)         ? color_i * color_coeff : 0</span>
-<a name="l03755"></a>03755 <span class="comment">     *           - (!fit_e)         ? airmass_f * ext_coeff : 0</span>
-<a name="l03756"></a>03756 <span class="comment">     *           + (!fit_z)         ? zpoint : 0</span>
-<a name="l03757"></a>03757 <span class="comment">     *           - magscale(gain)</span>
-<a name="l03758"></a>03758 <span class="comment">     *           - magscale(exposure_time);</span>
-<a name="l03759"></a>03759 <span class="comment">     * </span>
-<a name="l03760"></a>03760 <span class="comment">     * It does it by generating 3 matrices: the inputs matrix, a Jacobian, and</span>
-<a name="l03761"></a>03761 <span class="comment">     * an inputs covariance matrix. Using these, the rhs and its covariance</span>
-<a name="l03762"></a>03762 <span class="comment">     * matrix are computed.</span>
-<a name="l03763"></a>03763 <span class="comment">     */</span>
-<a name="l03764"></a>03764     cpl_matrix      *rhs_input_cov = NULL,
-<a name="l03765"></a>03765                     *rhs_jacobian = NULL,
-<a name="l03766"></a>03766                     *rhs_input = NULL,
-<a name="l03767"></a>03767                     *rhs_jacobian_T = NULL,
-<a name="l03768"></a>03768                     *tmp_matrix = NULL;
-<a name="l03769"></a>03769     <span class="keywordtype">int</span>             n_std_stars,
-<a name="l03770"></a>03770                     n_obs,
-<a name="l03771"></a>03771                     n_col,
-<a name="l03772"></a>03772                     r,
-<a name="l03773"></a>03773                     c;
-<a name="l03774"></a>03774     <span class="keyword">const</span> fors_std_star
-<a name="l03775"></a>03775                     *std;
-<a name="l03776"></a>03776     <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>     *obs;
-<a name="l03777"></a>03777     <span class="keywordtype">bool</span>            printed_debug = <span class="keyword">false</span>;
-<a name="l03778"></a>03778     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l03779"></a>03779     
-<a name="l03780"></a>03780     <span class="comment">/* free output pointers */</span>
-<a name="l03781"></a>03781     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l03782"></a>03782     
-<a name="l03783"></a>03783     <span class="comment">/* check input */</span>
-<a name="l03784"></a>03784     cassure_automsg(                        obs_list != NULL,
-<a name="l03785"></a>03785                                             CPL_ERROR_NULL_INPUT,
-<a name="l03786"></a>03786                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03787"></a>03787     cassure_automsg(                        std_list != NULL,
-<a name="l03788"></a>03788                                             CPL_ERROR_NULL_INPUT,
-<a name="l03789"></a>03789                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03790"></a>03790     cassure_automsg(                        rhs != NULL,
-<a name="l03791"></a>03791                                             CPL_ERROR_NULL_INPUT,
-<a name="l03792"></a>03792                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03793"></a>03793     cassure_automsg(                        rhs_cov != NULL,
-<a name="l03794"></a>03794                                             CPL_ERROR_NULL_INPUT,
-<a name="l03795"></a>03795                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03796"></a>03796     
-<a name="l03797"></a>03797     n_std_stars = fors_std_star_list_size(std_list);
-<a name="l03798"></a>03798     n_obs = entry_list_size(obs_list);
-<a name="l03799"></a>03799     
-<a name="l03800"></a>03800     cassure(                                n_std_stars > 0 && n_obs > 0,
-<a name="l03801"></a>03801                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l03802"></a>03802                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l03803"></a>03803                                             <span class="stringliteral">"Empty input list"</span>);
-<a name="l03804"></a>03804     
-<a name="l03805"></a>03805     <span class="comment">/* start */</span>
-<a name="l03806"></a>03806     n_col = n_std_stars*2 + 3;
-<a name="l03807"></a>03807     
-<a name="l03808"></a>03808     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l03809"></a>03809     <span class="comment">/* build the following input covariance matrix:</span>
-<a name="l03810"></a>03810 <span class="comment">     * </span>
-<a name="l03811"></a>03811 <span class="comment">     * v_mag_0  cov_mc_0  0        0           0            0          0</span>
-<a name="l03812"></a>03812 <span class="comment">     * cov_mc_0 v_color_0 0        0           0            0          0</span>
-<a name="l03813"></a>03813 <span class="comment">     * 0        0         v_mag_1  cov_mc_1    0            0          0</span>
-<a name="l03814"></a>03814 <span class="comment">     * 0        0         cov_mc_1 v_color_1   0            0          0</span>
-<a name="l03815"></a>03815 <span class="comment">     *                                      ...</span>
-<a name="l03816"></a>03816 <span class="comment">     * 0        0         0        0           v_color_coef 0          0</span>
-<a name="l03817"></a>03817 <span class="comment">     * 0        0         0        0           0            v_ext_coef 0</span>
-<a name="l03818"></a>03818 <span class="comment">     * 0        0         0        0           0            0          v_zpoint</span>
-<a name="l03819"></a>03819 <span class="comment">     */</span>
-<a name="l03820"></a>03820     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l03821"></a>03821     rhs_input_cov = cpl_matrix_new(n_col, n_col);
-<a name="l03822"></a>03822     <span class="keywordflow">for</span> (   std = fors_std_star_list_first_const(std_list), c = 0;
-<a name="l03823"></a>03823             std != NULL;
-<a name="l03824"></a>03824             std = fors_std_star_list_next_const(std_list), c += 2)
-<a name="l03825"></a>03825     {
-<a name="l03826"></a>03826         <span class="keywordtype">double</span>  dcatm = std->dcat_magnitude,
-<a name="l03827"></a>03827                 dcolor = std->dcolor,
-<a name="l03828"></a>03828                 cov_catmag_color = std->cov_catm_color;
-<a name="l03829"></a>03829         
-<a name="l03830"></a>03830         <span class="comment">/* To new maintainers: first understand the rest of the</span>
-<a name="l03831"></a>03831 <span class="comment">         * function without the following if-statement. */</span>
-<a name="l03832"></a>03832         if (!(dcolor > 0) || isnan(cov_catmag_color))
-<a name="l03833"></a>03833         {
-<a name="l03834"></a>03834             <span class="comment">/* If we have old fors_zeropoint input data, i.e.</span>
-<a name="l03835"></a>03835 <span class="comment">             * if dcolor and cov_catmag_color are not set, then:</span>
-<a name="l03836"></a>03836 <span class="comment">             * </span>
-<a name="l03837"></a>03837 <span class="comment">             * use the mag entry in the covariance matrix and in the rhs input</span>
-<a name="l03838"></a>03838 <span class="comment">             * vector:</span>
-<a name="l03839"></a>03839 <span class="comment">             * - depently on fit_c, use the catalogue magnitude or the</span>
-<a name="l03840"></a>03840 <span class="comment">             *   color corrected magnitude, and</span>
-<a name="l03841"></a>03841 <span class="comment">             * - set the color +- dcolor entry to 0 +- 0.</span>
-<a name="l03842"></a>03842 <span class="comment">             * </span>
-<a name="l03843"></a>03843 <span class="comment">             * The color corrected magnitude, computed by the old</span>
-<a name="l03844"></a>03844 <span class="comment">             * fors_zeropoint recipe, included the correlation between</span>
-<a name="l03845"></a>03845 <span class="comment">             * magnitude and color index, using the color correction term</span>
-<a name="l03846"></a>03846 <span class="comment">             * from the then used photometric table.</span>
-<a name="l03847"></a>03847 <span class="comment">             */</span>
-<a name="l03848"></a>03848             cov_catmag_color = 0;
-<a name="l03849"></a>03849             dcolor = 0;
-<a name="l03850"></a>03850             <span class="keywordflow">if</span> (std->trusted) <span class="comment">/* !(fit magnitude), not really necessary</span>
-<a name="l03851"></a>03851 <span class="comment">                                                   because Jacobian takes care</span>
-<a name="l03852"></a>03852 <span class="comment">                                                   of (!(std->trusted)) */</span>
-<a name="l03853"></a>03853             {
-<a name="l03854"></a>03854                 <span class="keywordflow">if</span> (!fit_c)
-<a name="l03855"></a>03855                 {
-<a name="l03856"></a>03856                     cassure(                dcatm > 0,
-<a name="l03857"></a>03857                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l03858"></a>03858                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l03859"></a>03859                                             <span class="stringliteral">"Could not determine color "</span>
-<a name="l03860"></a>03860                                             <span class="stringliteral">"corrected magnitude with error "</span>
-<a name="l03861"></a>03861                                             <span class="stringliteral">"estimate of object %s"</span>,
-<a name="l03862"></a>03862                                             (std->name != NULL) ?
-<a name="l03863"></a>03863                                                 std->name : <span class="stringliteral">"unknown"</span>);
-<a name="l03864"></a>03864                     dcatm = std->dmagnitude;    <span class="comment">/* color corrected mag */</span>
-<a name="l03865"></a>03865                     <span class="keywordflow">if</span> (!printed_debug)
-<a name="l03866"></a>03866                     {
-<a name="l03867"></a>03867                         cpl_msg_debug(      cpl_func,
-<a name="l03868"></a>03868                                             <span class="stringliteral">"Having old fors_zeropoint data. "</span>
-<a name="l03869"></a>03869                                             <span class="stringliteral">"Using color corrected magnitudes "</span>
-<a name="l03870"></a>03870                                             <span class="stringliteral">"instead of catalogue magnitude "</span>
-<a name="l03871"></a>03871                                             <span class="stringliteral">"and color separately."</span>);
-<a name="l03872"></a>03872                         printed_debug = <span class="keyword">true</span>;
-<a name="l03873"></a>03873                     }
-<a name="l03874"></a>03874                 }
-<a name="l03875"></a>03875             }
-<a name="l03876"></a>03876             <span class="comment">/* else fit the observed magnitude, i.e. not correcting by</span>
-<a name="l03877"></a>03877 <span class="comment">             * the catalogue color (see Jacobian), so don't care about</span>
-<a name="l03878"></a>03878 <span class="comment">             * missing color entries */</span>
-<a name="l03879"></a>03879         }
-<a name="l03880"></a>03880         
-<a name="l03881"></a>03881         cpl_matrix_set(rhs_input_cov, c, c, dcatm*dcatm);
-<a name="l03882"></a>03882         cpl_matrix_set(rhs_input_cov, c+1, c+1, dcolor*dcolor);
-<a name="l03883"></a>03883         cpl_matrix_set(rhs_input_cov, c, c+1, cov_catmag_color);
-<a name="l03884"></a>03884         cpl_matrix_set(rhs_input_cov, c+1, c, cov_catmag_color);
-<a name="l03885"></a>03885     }
-<a name="l03886"></a>03886     cpl_matrix_set(rhs_input_cov, c, c, dcolor_coeff*dcolor_coeff);
-<a name="l03887"></a>03887     cpl_matrix_set(rhs_input_cov, c+1, c+1, dext_coeff*dext_coeff);
-<a name="l03888"></a>03888     cpl_matrix_set(rhs_input_cov, c+1, c+1, dzpoint*dzpoint);
-<a name="l03889"></a>03889     
-<a name="l03890"></a>03890     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03891"></a>03891     
-<a name="l03892"></a>03892     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l03893"></a>03893     <span class="comment">/* build the following Jacobi matrix</span>
-<a name="l03894"></a>03894 <span class="comment">     * with: i = index of referenced std. star,</span>
-<a name="l03895"></a>03895 <span class="comment">     *       f = index of frame</span>
-<a name="l03896"></a>03896 <span class="comment">     *       A = airmass,</span>
-<a name="l03897"></a>03897 <span class="comment">     *       G = color correction term</span>
-<a name="l03898"></a>03898 <span class="comment">     *       C = color</span>
-<a name="l03899"></a>03899 <span class="comment">     * </span>
-<a name="l03900"></a>03900 <span class="comment">     * ... (!fit_mag_i)*1 -(!fit_c)*G ... -(!fit_c)*C_i (!fit_e)*A_f -(!fit_z)*1</span>
-<a name="l03901"></a>03901 <span class="comment">     *         . </span>
-<a name="l03902"></a>03902 <span class="comment">     *         .</span>
-<a name="l03903"></a>03903 <span class="comment">     *         .</span>
-<a name="l03904"></a>03904 <span class="comment">     * </span>
-<a name="l03905"></a>03905 <span class="comment">     * and multiply by (-1) to subtract the input.</span>
-<a name="l03906"></a>03906 <span class="comment">     * fit_c appears twice with the coefficients required to compute the</span>
-<a name="l03907"></a>03907 <span class="comment">     * rhs covariance matrix.</span>
-<a name="l03908"></a>03908 <span class="comment">     * In principle, the airmass index could also be the index of the</span>
-<a name="l03909"></a>03909 <span class="comment">     * measurement/observation of the star, since it is taken from the obs</span>
-<a name="l03910"></a>03910 <span class="comment">     * object.</span>
-<a name="l03911"></a>03911 <span class="comment">     */</span>
-<a name="l03912"></a>03912     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l03913"></a>03913     rhs_jacobian = cpl_matrix_new(n_obs, n_col);
-<a name="l03914"></a>03914     <span class="keywordflow">for</span> (   obs = entry_list_first_const(obs_list), r = 0;
-<a name="l03915"></a>03915             obs != NULL;
-<a name="l03916"></a>03916             obs = entry_list_next_const(obs_list), r++)
-<a name="l03917"></a>03917     {
-<a name="l03918"></a>03918         <span class="keywordtype">bool</span>    fit_mag,
-<a name="l03919"></a>03919                 compensate_color;
-<a name="l03920"></a>03920         
-<a name="l03921"></a>03921         c = obs-><a class="code" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a> * 2;
-<a name="l03922"></a>03922         fit_mag = !(obs-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->trusted);
-<a name="l03923"></a>03923         <span class="comment">/* if (fit_mag), then fit observed magnitude, not corrected by</span>
-<a name="l03924"></a>03924 <span class="comment">         * catalogue color */</span>
-<a name="l03925"></a>03925         compensate_color = (!fit_c) && (!fit_mag);
-<a name="l03926"></a>03926         
-<a name="l03927"></a>03927         cpl_matrix_set(rhs_jacobian, r, c,  -(!fit_mag)*1.0);
-<a name="l03928"></a>03928         cpl_matrix_set(rhs_jacobian, r, c+1, +(compensate_color)*color_coeff);
-<a name="l03929"></a>03929         
-<a name="l03930"></a>03930         cpl_matrix_set(rhs_jacobian, r, n_col-3, + (compensate_color)
-<a name="l03931"></a>03931                                                    * obs-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->color);
-<a name="l03932"></a>03932         cpl_matrix_set(rhs_jacobian, r, n_col-2, -(!fit_e)*obs-><a class="code" href="structentry.html#6f585239f5d6905b0cff05055d77bf9c">airmass</a>);
-<a name="l03933"></a>03933         cpl_matrix_set(rhs_jacobian, r, n_col-1, +(!fit_z)*1.0);
-<a name="l03934"></a>03934     }
-<a name="l03935"></a>03935     
-<a name="l03936"></a>03936     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03937"></a>03937     
-<a name="l03938"></a>03938     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l03939"></a>03939     <span class="comment">/* Prepare the rhs input vector:</span>
-<a name="l03940"></a>03940 <span class="comment">     * </span>
-<a name="l03941"></a>03941 <span class="comment">     * [...  cat_mag_i  color_i  ...  0  ext_coef  zpoint]^T</span>
-<a name="l03942"></a>03942 <span class="comment">     * </span>
-<a name="l03943"></a>03943 <span class="comment">     * Here, the term C*G shall only be used once, so set the other occurrence</span>
-<a name="l03944"></a>03944 <span class="comment">     * to 0. </span>
-<a name="l03945"></a>03945 <span class="comment">     */</span>
-<a name="l03946"></a>03946     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l03947"></a>03947     rhs_input = cpl_matrix_new(n_col, 1);
-<a name="l03948"></a>03948     <span class="keywordflow">for</span> (   std = fors_std_star_list_first_const(std_list), r = 0;
-<a name="l03949"></a>03949             std != NULL;
-<a name="l03950"></a>03950             std = fors_std_star_list_next_const(std_list), r += 2)
-<a name="l03951"></a>03951     {
-<a name="l03952"></a>03952         <span class="keywordtype">double</span>  catm = std->cat_magnitude,
-<a name="l03953"></a>03953                 color = std->color;
-<a name="l03954"></a>03954         
-<a name="l03955"></a>03955         <span class="comment">/* To new maintainers: first understand the rest of the</span>
-<a name="l03956"></a>03956 <span class="comment">         * function without the following if-statement. */</span>
-<a name="l03957"></a>03957         if (!(std->dcolor > 0) || isnan(std->cov_catm_color))
-<a name="l03958"></a>03958         {
-<a name="l03959"></a>03959             <span class="comment">/* see above */</span>
-<a name="l03960"></a>03960             color = 0;
-<a name="l03961"></a>03961             <span class="keywordflow">if</span> (std->trusted) <span class="comment">/* !(fit magnitude) */</span>
-<a name="l03962"></a>03962             {
-<a name="l03963"></a>03963                 <span class="keywordflow">if</span> (!fit_c)
-<a name="l03964"></a>03964                     catm = std->magnitude;      <span class="comment">/* color corrected mag */</span>
-<a name="l03965"></a>03965             }
-<a name="l03966"></a>03966         }
-<a name="l03967"></a>03967         
-<a name="l03968"></a>03968         cpl_matrix_set(rhs_input, r, 0, catm);
-<a name="l03969"></a>03969         cpl_matrix_set(rhs_input, r+1, 0, color);
-<a name="l03970"></a>03970     }
-<a name="l03971"></a>03971     <span class="comment">/* we already have color_i*color_coeff</span>
-<a name="l03972"></a>03972 <span class="comment">     *cpl_matrix_set(rhs_input, r, 0, 0);*/</span>
-<a name="l03973"></a>03973     cpl_matrix_set(rhs_input, r+1, 0, ext_coeff);
-<a name="l03974"></a>03974     cpl_matrix_set(rhs_input, r+2, 0, zpoint);
-<a name="l03975"></a>03975     
-<a name="l03976"></a>03976     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03977"></a>03977     
-<a name="l03978"></a>03978     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l03979"></a>03979     <span class="comment">/* ...and compute the results... */</span>
-<a name="l03980"></a>03980     *rhs = cpl_matrix_product_create(rhs_jacobian, rhs_input);
-<a name="l03981"></a>03981     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03982"></a>03982     
-<a name="l03983"></a>03983     rhs_jacobian_T = cpl_matrix_transpose_create(rhs_jacobian);
-<a name="l03984"></a>03984     tmp_matrix = cpl_matrix_product_create(rhs_input_cov, rhs_jacobian_T);
-<a name="l03985"></a>03985     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03986"></a>03986     *rhs_cov = cpl_matrix_product_create(rhs_jacobian, tmp_matrix);
-<a name="l03987"></a>03987     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l03988"></a>03988     
-<a name="l03989"></a>03989     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l03990"></a>03990     <span class="comment">/* add the missing contributions:</span>
-<a name="l03991"></a>03991 <span class="comment">     * 1. rhs    : instrumental magnitude, subtract gain and exptime</span>
-<a name="l03992"></a>03992 <span class="comment">     * 2. rhs_cov: variance of instrumental magnitude</span>
-<a name="l03993"></a>03993 <span class="comment">     */</span>
-<a name="l03994"></a>03994     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span>
-<a name="l03995"></a>03995     <span class="keywordflow">for</span> (   obs = entry_list_first_const(obs_list), r = 0;
-<a name="l03996"></a>03996             obs != NULL;
-<a name="l03997"></a>03997             obs = entry_list_next_const(obs_list), r++)
-<a name="l03998"></a>03998     {
-<a name="l03999"></a>03999         cpl_matrix_set(*rhs, r, 0,      cpl_matrix_get(*rhs, r, 0)
-<a name="l04000"></a>04000                                         + obs-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">magnitude</a>
-<a name="l04001"></a>04001                                         + 2.5*log10(obs-><a class="code" href="structentry.html#9094c40ac744faa1135a2773f85ba1ff">gain</a>)
-<a name="l04002"></a>04002                                         + 2.5*log10(obs-><a class="code" href="structentry.html#3e422ef6bc06e1e9c3d2dad3ec2f972b">exptime</a>));
-<a name="l04003"></a>04003         cpl_matrix_set(*rhs_cov, r, r,  cpl_matrix_get(*rhs_cov, r, r)
-<a name="l04004"></a>04004                                         + obs-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">dmagnitude</a>
-<a name="l04005"></a>04005                                           * obs-><a class="code" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a>-><a class="code" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">dmagnitude</a>);
-<a name="l04006"></a>04006     }
-<a name="l04007"></a>04007     
-<a name="l04008"></a>04008     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&rhs_input_cov);
-<a name="l04009"></a>04009     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&rhs_jacobian);
-<a name="l04010"></a>04010     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&rhs_input);
-<a name="l04011"></a>04011     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&rhs_jacobian_T);
-<a name="l04012"></a>04012     <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&tmp_matrix);
-<a name="l04013"></a>04013     
-<a name="l04014"></a>04014     <span class="keywordflow">return</span> (    cpl_errorstate_is_equal(errstat) ?
-<a name="l04015"></a>04015                 CPL_ERROR_NONE :
-<a name="l04016"></a>04016                 cpl_error_get_code());
-<a name="l04017"></a>04017 }
-<a name="l04018"></a>04018 
-<a name="l04019"></a>04019 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__photometry__impl_8c_source.html b/html/fors__photometry__impl_8c_source.html
new file mode 100644
index 0000000..3752372
--- /dev/null
+++ b/html/fors__photometry__impl_8c_source.html
@@ -0,0 +1,3788 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_photometry_impl.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_photometry_impl.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_photometry_impl.c,v 1.86 2013-09-10 19:17:31 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 19:17:31 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.86 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_photometry_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_data.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_tools.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_polynomial.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <fors_double.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <fors_extract.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include <assert.h></span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_photometry_name = <span class="stringliteral">"fors_photometry"</span>;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_photometry_description_short = <span class="stringliteral">"Compute corrected flatfield"</span>;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_photometry_author = <span class="stringliteral">"Jonas M. Larsen"</span>;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_photometry_email = PACKAGE_BUGREPORT;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_photometry_description = </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  PHOT_TABLE                 FITS table  Expected extinction params  1\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  ALIGNED_PHOT               FITS table  Photometry                  1+\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master flat field           1\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  PHOT_COEFF_TABLE           FITS image  Observed extinction coefficients\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"  CORRECTION_MAP             FITS image  Correction map (magnitude)\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"  CORRECTION_FACTOR          FITS image  Correction map (flux)\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"  MASTER_FLAT_IMG            FITS image  Corrected master flat field\n"</span>;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> </div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="keyword">typedef</span> <span class="keyword">enum</span> fors_fit_ncoeff {</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     FORS_FIT_NCOEFF_NO = 0,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     FORS_FIT_NCOEFF_ONE,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     FORS_FIT_NCOEFF_PERFRAME,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     FORS_FIT_NCOEFF_PERNIGHT</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> } fors_fit_ncoeff;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="structfors__fit__ncoeff__paropts.html">   81</a></span> <span class="keyword">const</span> <span class="keyword">struct </span><a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a> {</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *no,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                 *one,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                 *perframe,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                 *pernight;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> } <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a> = {       <span class="stringliteral">"no"</span>,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                                     <span class="stringliteral">"one"</span>,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                                     <span class="stringliteral">"perframe"</span>,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                                     <span class="stringliteral">"pernight"</span>};</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> </div>
+<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="structentry.html">   91</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structentry.html">entry</a></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> {</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     <span class="keywordtype">int</span>         frame_index,   <span class="comment">/* Counting from zero */</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                 star_index,    <span class="comment">/* Star identification number, count from 0 */</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                 atm_ext_index;  <span class="comment">/* atmospheric extinction index, count from 0 */</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="keywordtype">int</span>         atm_ext_identifier;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <span class="keywordtype">double</span>      airmass,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>                 gain,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>                 exptime;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <a class="code" href="struct__fors__star.html">fors_star</a>   *star;</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> } <a class="code" href="structentry.html">entry</a>;</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="comment">/* Declare and define entry_list */</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM entry </span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor"></span><span class="preprocessor">#undef LIST_DEFINE</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">#define LIST_DEFINE</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="keyword">const</span> <span class="keywordtype">double</span> arcsec_tol = 5.0;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <a class="code" href="structentry.html">entry</a> *<a class="code" href="group__fors__photometry.html#ga0a8c8c9ebad2d55ac56e61c820fa3f27" title="entry constructor">entry_new</a>(                           <span class="keywordtype">int</span>     frame_index,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                                             <span class="keywordtype">int</span>     star_index,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                                             <span class="keywordtype">double</span>  airmass,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                                             <span class="keywordtype">double</span>  gain,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                                             <span class="keywordtype">double</span>  exptime,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                                             <span class="keywordtype">int</span>     atm_ext_identifier,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                                             <a class="code" href="struct__fors__star.html">fors_star</a> *star);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <a class="code" href="group__fors__photometry.html#ga5a7208d2d524a7660f3e57e269b7305f" title="Destructor.">entry_delete</a>(                               <a class="code" href="structentry.html">entry</a> **e);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <a class="code" href="group__fors__photometry.html#ga24e72dc7095e56d37033c584bd279f13" title="Destructor.">entry_delete_but_standard</a>(                  <a class="code" href="structentry.html">entry</a> **e);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> entry_get_powers_x_y(                       <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a> *e,</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                                             <span class="keyword">const</span> cpl_array *powers);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <a class="code" href="group__fors__photometry.html#gaf8c135834cc51bd767a6956346885958" title="Print list.">entry_list_print</a>(                           <span class="keyword">const</span> entry_list *l,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                                             cpl_msg_severity level);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> entry_get_powers_airmass_color(             <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a> *e,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                                             <span class="keyword">const</span> cpl_array *powers);</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="keyword">static</span> entry_list *</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <a class="code" href="group__fors__photometry.html#gabe32026b38c8d511f76b7f1008941f71" title="Read input data from aligned phot tables.">fors_photometry_read_input</a>(                 <span class="keyword">const</span> cpl_frameset  *alphot_frames,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a>  *setting,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                                             <span class="keywordtype">int</span> (*get_atm_ext_id_function)(</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                                                 <span class="keyword">const</span> cpl_propertylist *header),</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                                             <span class="keywordtype">bool</span>                import_unknown,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                                             <span class="keywordtype">int</span>                 *n_frames,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                                             fors_std_star_list  **std_star_list,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                                             <span class="keywordtype">int</span>                 filter</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                                             );</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="keyword">static</span> fors_std_star*</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <a class="code" href="group__fors__photometry.html#gabffbeb12c88498ed45e6115a1b529c07" title="Insert a std star into a list, if the closest existing distance > maxd_arcsec.">fors_photometry_read_input_listinsert_star_if_new</a>(</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                                             fors_std_star_list  *std_list,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                                             fors_std_star       *std,</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                                             <span class="keywordtype">double</span>              mind_arcsec);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <a class="code" href="group__fors__photometry.html#ga2271cd483d1b8537a0513251799faaed" title="Delete a fors_std_star_list and an entry list referring to it.">fors_delete_star_lists</a>(                     entry_list          **el,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                                             fors_std_star_list  **sl);</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <a class="code" href="group__fors__photometry.html#ga37834a5427d4d460953d5b818ea79ffa" title="Compare two strings while ignoring trailing blanks.">fors_fits_compare_string</a>(                   <span class="keyword">const</span> <span class="keywordtype">char</span>  *s1,</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *s2);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(                           cpl_matrix  **m);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> fors_matrix_append_delete(                  cpl_matrix  **m1,</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>                                             cpl_matrix  **m2);</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> fors_property_get_num(                      <span class="keyword">const</span> cpl_property  *prop);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> fors_photometry_parameter_get_num(          <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name,</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>                                             cpl_type                type);</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> fors_photometry_parameter_get_string(       <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name);</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="keyword">static</span> fors_fit_ncoeff</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> fors_photometry_parameter_get_ncoeff(       <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__photometry.html#ga4b3a00d660ccc7d889875a00fb629be5" title="Define recipe parameters.">fors_photometry_define_parameters</a>(     cpl_parameterlist   *parameters);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="keyword">static</span> cpl_polynomial*</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <a class="code" href="group__fors__photometry.html#gaa9757bbaea210d70edf5874682ec6660" title="Create a polynomial containing the desired coefficients (set to 1).">fors_photometry_define_polyf</a>(               <span class="keywordtype">int</span>                 degreef1,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                                             <span class="keywordtype">int</span>                 degreef2);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="keyword">static</span> cpl_polynomial*</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <a class="code" href="group__fors__photometry.html#ga8d413c86621fd2b2e37b6174e935d082" title="Create a 2-dim polynomial with the desired coefficients (set to 1).">fors_photometry_define_polyp</a>(               <span class="keywordtype">int</span>                 degreep);</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <a class="code" href="group__fors__photometry.html#ga07a5f25084d3a57c92743262a41e0366" title="Create a polynomial from a definition and a coefficients container.">fors_photometry_poly_new_from_coefficients</a>( <span class="keyword">const</span> cpl_polynomial    *p_def,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                                             <span class="keyword">const</span> cpl_matrix        *coeffs,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                                             <span class="keyword">const</span> cpl_matrix        *cov_coeffs,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                                             cpl_polynomial          **poly,</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                                             cpl_polynomial          **var_poly);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <a class="code" href="group__fors__photometry.html#ga1ac67d0a2f318cd599a5be4a05a8b4b1" title="Return the timezone of the observer in hours against UT.">fors_photometry_get_timezone_observer</a>(      <span class="keyword">const</span> cpl_propertylist  *header);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> <a class="code" href="group__fors__photometry.html#gaf800d130ebeddcf3e8a655cf0c305f47" title="Get a unique identifier for the night of the observation.">fors_photometry_get_night_id</a>(               <span class="keyword">const</span> cpl_propertylist *header);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> </div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <span class="keyword">static</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <a class="code" href="group__fors__photometry.html#gac8322b086764e1db46e5c9d72263a251" title="Collect all atm. extinction identifiers and create the indices.">fors_photometry_atm_ext_create_index_by_identifier</a>(</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                                             entry_list          *obs_list);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="keyword">static</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <a class="code" href="group__fors__photometry.html#gafecdbeccb909ad2d152a857cfd10c2c0" title="Create all atmospheric extinction indices.">fors_photometry_atm_ext_create_indices</a>(     entry_list      *obsl,</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                                             fors_fit_ncoeff fit_e);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="comment">//static cpl_error_code</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="keyword">static</span> cpl_table *</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <a class="code" href="group__fors__photometry.html#gaadcf6d1ce33dbed7ae0cbd24d675562f" title="Print the frame filenames for each atm. ext. index.">fors_photometry_atm_ext_print_index_by_framename</a>(</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>                                             <span class="keyword">const</span> entry_list    *obs_list,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                                             <span class="keyword">const</span> cpl_frameset  *frames);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> <a class="code" href="group__fors__photometry.html#ga104fe70d8a535ae244e71f6b16dcaf5d" title="Check input value and its error to stay in a range.">fors_photometry_check_input_value</a>(          <span class="keywordtype">double</span>      value,</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                                             <span class="keywordtype">double</span>      value_error,</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *value_name,</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *input_name,</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>                                             <span class="keywordtype">double</span>      min_limit,</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>                                             <span class="keywordtype">double</span>      max_limit,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                                             <span class="keywordtype">double</span>      max_error);</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> </div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <a class="code" href="group__fors__photometry.html#ga750adc75acb9310f8dde5fb067a356e9" title="Check whether fitting is possible (see below).">fors_photometry_check_fitparam_atm_ext</a>(     entry_list      *obsl,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                             fors_fit_ncoeff fit_e,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                             <span class="keywordtype">bool</span>            fit_z);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> fors_photometry_adjust_fit_mag_flags(       fors_std_star_list  *stdl,</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>                                             entry_list          *obsl,</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>                                             <span class="keywordtype">bool</span>                override_fit_m,</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>                                             <span class="keywordtype">int</span>                 *n_mag_fits);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <a class="code" href="group__fors__photometry.html#ga6e8831942438a88bb3287ed491961ec1" title="Remove all standard stars which are fitted but were observed only once.">fors_photometry_remove_unnecessary</a>(         fors_std_star_list  *std_list,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                                             entry_list          *obs_list,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                                             <span class="keywordtype">int</span>                 *n_mag_fits);</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> <span class="keyword">static</span> cpl_array*</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> <a class="code" href="group__fors__photometry.html#ga182915aa06bfd142318b3c9443a80e80" title="Count the number of observations of each standard star.">fors_photometry_count_observations</a>(         fors_std_star_list  *std_list,</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>                                             entry_list          *obs_list);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> <span class="keyword">static</span> cpl_matrix*</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> <a class="code" href="group__fors__photometry.html#gabfcabff5102d27ba7b09e4398e057762" title="Build left hand side matrix equation part.">build_equations_lhs_matrix_from_parameters</a>( <span class="keyword">const</span> entry_list    *obs_list,</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>                                             <span class="keyword">const</span> fors_std_star_list  *std_list,</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>                                             <span class="keywordtype">bool</span>                fit_z,</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>                                             <span class="keywordtype">bool</span>                fit_c,</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>                                             <span class="keywordtype">int</span>                 *n_fit_e_cols);</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> </div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> <span class="keyword">static</span> cpl_matrix*</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> <a class="code" href="group__fors__photometry.html#ga43e3c1d13157092f683e6d4912cd71d2" title="Build polynomial fitting matrix with coefficients represented in columns.">build_equations_lhs_matrix_from_poly</a>(       <span class="keyword">const</span> entry_list        *obs_list,</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                                             <span class="keyword">const</span> cpl_polynomial    *poly,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *pname,</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                                             <span class="keywordtype">double</span> (*powerfunc)(</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                                                             <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>*,</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                                                             <span class="keyword">const</span> cpl_array*));</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> <a class="code" href="group__fors__photometry.html#ga5e4afe6326f0bb9c748fed2286c8c835" title="Build right hand side matrix equation part.">build_equations_rhs_cov</a>(                    <span class="keyword">const</span> entry_list    *obs_list,</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>                                             <span class="keyword">const</span> fors_std_star_list  *std_list,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                                             <span class="keywordtype">bool</span>                fit_z,</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>                                             <span class="keywordtype">bool</span>                fit_c,</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>                                             <span class="keywordtype">bool</span>                fit_e,</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                                             <span class="keywordtype">double</span>              color_coeff,</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>                                             <span class="keywordtype">double</span>              dcolor_coeff,</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                                             <span class="keywordtype">double</span>              ext_coeff,</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>                                             <span class="keywordtype">double</span>              dext_coeff,</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>                                             <span class="keywordtype">double</span>              zpoint,</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>                                             <span class="keywordtype">double</span>              dzpoint,</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>                                             cpl_matrix          **rhs,</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>                                             cpl_matrix          **rhs_cov);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga0a8c8c9ebad2d55ac56e61c820fa3f27">  289</a></span> <a class="code" href="structentry.html">entry</a> *<a class="code" href="group__fors__photometry.html#ga0a8c8c9ebad2d55ac56e61c820fa3f27" title="entry constructor">entry_new</a>(                           <span class="keywordtype">int</span>     frame_index,</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                                             <span class="keywordtype">int</span>     star_index,</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                                             <span class="keywordtype">double</span>  airmass,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                                             <span class="keywordtype">double</span>  gain,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                                             <span class="keywordtype">double</span>  exptime,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                                             <span class="keywordtype">int</span>     atm_ext_identifier,</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                                             <a class="code" href="struct__fors__star.html">fors_star</a> *star)</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> {</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <a class="code" href="structentry.html">entry</a> *e = cpl_malloc(<span class="keyword">sizeof</span>(*e));</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> </div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     e->frame_index = frame_index;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     e->star_index = star_index;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     e->atm_ext_index = -1;  <span class="comment">/* means undefined */</span></div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     e->airmass = airmass;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     e->gain = gain;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     e->exptime = exptime;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     e->atm_ext_identifier = atm_ext_identifier;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     e->star = star;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     <span class="keywordflow">return</span> e;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> }</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga5a7208d2d524a7660f3e57e269b7305f">  320</a></span> <a class="code" href="group__fors__photometry.html#ga5a7208d2d524a7660f3e57e269b7305f" title="Destructor.">entry_delete</a>(                               <a class="code" href="structentry.html">entry</a> **e)</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> {</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     <span class="keywordflow">if</span> (e && *e) {</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>         <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>(&(*e)->star);</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>         cpl_free(*e); *e = NULL;</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     }</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> }</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> </div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga24e72dc7095e56d37033c584bd279f13">  336</a></span> <a class="code" href="group__fors__photometry.html#ga24e72dc7095e56d37033c584bd279f13" title="Destructor.">entry_delete_but_standard</a>(                  <a class="code" href="structentry.html">entry</a> **e)</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> {</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordflow">if</span> (e && *e) {</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>         <a class="code" href="group__fors__star.html#ga517c8c542ad4eb8145fa664be9625a98" title="Delete object and set pointer to NULL - but ignore the standard star.">fors_star_delete_but_standard</a>(&(*e)->star);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>         cpl_free(*e); *e = NULL;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     }</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> }</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> </div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00354"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gaf8c135834cc51bd767a6956346885958">  354</a></span> <a class="code" href="group__fors__photometry.html#gaf8c135834cc51bd767a6956346885958" title="Print list.">entry_list_print</a>(                           <span class="keyword">const</span> entry_list *l,</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                                             cpl_msg_severity level)</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> {</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a> *e;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     fors_msg(level, <span class="stringliteral">"Observation list:"</span>);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keywordflow">for</span> (e = entry_list_first_const(l);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>          e != NULL;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>          e = entry_list_next_const(l)) {</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>         fors_msg(level,</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                  <span class="stringliteral">"frame %d, star %d: airmass = %f, gain = %f, exptime = %f s"</span>,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                  e->frame_index, e->star_index,</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>                  e->airmass, e->gain, e->exptime);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> </div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>         <a class="code" href="group__fors__star.html#ga3443159e600f23336b266f7b557f4ea0" title="Print object.">fors_star_print</a>(level, e->star);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     }</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> }</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> </div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> entry_get_powers_x_y(                       <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>     *e,</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>                                             <span class="keyword">const</span> cpl_array *powers)</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> {</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     passure(powers != NULL && e != NULL, <span class="keywordflow">return</span> sqrt(-1));  <span class="comment">/* return NaN */</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     passure(cpl_array_get_size(powers) == 2, <span class="keywordflow">return</span> sqrt(-1));</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     <span class="keywordflow">return</span>  pow(e->star->pixel->x,      cpl_array_get(powers, 0, NULL))</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>             * pow(e->star->pixel->y,    cpl_array_get(powers, 1, NULL));</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> }</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> </div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> entry_get_powers_airmass_color(             <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a> *e,</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>                                             <span class="keyword">const</span> cpl_array *powers)</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> {</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     passure(powers != NULL && e != NULL, <span class="keywordflow">return</span> sqrt(-1));  <span class="comment">/* return NaN */</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     passure(cpl_array_get_size(powers) == 2, <span class="keywordflow">return</span> sqrt(-1));</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     <span class="keywordflow">return</span>  pow(e->airmass,             cpl_array_get(powers, 0, NULL))</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>             * pow(e->star->id->color,   cpl_array_get(powers, 1, NULL));</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> }</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> </div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00414"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga2271cd483d1b8537a0513251799faaed">  414</a></span> <a class="code" href="group__fors__photometry.html#ga2271cd483d1b8537a0513251799faaed" title="Delete a fors_std_star_list and an entry list referring to it.">fors_delete_star_lists</a>(                     entry_list          **el,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                                             fors_std_star_list  **sl)</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> {</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     <a class="code" href="structentry.html">entry</a> *e;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     <span class="keywordflow">if</span> (el != NULL && *el != NULL)</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     {</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>         <span class="keywordflow">for</span> (   e = entry_list_first(*el);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                 e != NULL;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>                 e = entry_list_next(*el))</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>         {</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>             e->star->id = NULL;</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         }</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     }</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     fors_std_star_list_delete(sl, fors_std_star_delete);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     entry_list_delete(el, <a class="code" href="group__fors__photometry.html#ga5a7208d2d524a7660f3e57e269b7305f" title="Destructor.">entry_delete</a>);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> }</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> </div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga37834a5427d4d460953d5b818ea79ffa">  443</a></span> <a class="code" href="group__fors__photometry.html#ga37834a5427d4d460953d5b818ea79ffa" title="Compare two strings while ignoring trailing blanks.">fors_fits_compare_string</a>(                   <span class="keyword">const</span> <span class="keywordtype">char</span>  *s1,</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *s2)</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> {</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *m1 = <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>                 *m2 = <span class="stringliteral">""</span>;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     <span class="keywordtype">int</span>         len1,</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>                 len2;</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     </div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     <span class="keywordflow">if</span> (s1 != NULL)</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>         m1 = s1;</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <span class="keywordflow">if</span> (s2 != NULL)</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>         m2 = s2;</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     </div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     len1 = strlen(m1);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     len2 = strlen(m2);</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     </div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     <span class="keywordflow">while</span> (len1 > 0 && m1[len1-1] == <span class="charliteral">' '</span>) len1--;</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     <span class="keywordflow">while</span> (len2 > 0 && m2[len2-1] == <span class="charliteral">' '</span>) len2--;</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     <span class="keywordflow">if</span> (len1 != len2)</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     </div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     <span class="keywordflow">if</span> (strncmp(m1, m2, len1) != 0)</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     </div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> }</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00480"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c">  480</a></span> <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(                           cpl_matrix    **m)</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> {</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     <span class="keywordflow">if</span> (m != NULL)</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     {</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>         cpl_matrix_delete(*m);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         *m = NULL;</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     }</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span> }</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span> </div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> fors_matrix_append_delete(                  cpl_matrix  **m1,</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>                                             cpl_matrix  **m2)</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> {</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     <span class="keywordflow">if</span> (m1 == NULL || m2 == NULL)</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     </div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     <span class="keywordflow">if</span> (*m2 != NULL)</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     {</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>         <span class="keywordflow">if</span> (*m1 == NULL)</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>         {</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>             *m1 = *m2;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>             *m2 = NULL;</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         }</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         {</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>             cpl_matrix_append(*m1, *m2, 0);</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>             <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(m2);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         }</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     }</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>     <span class="comment">/* else do nothing */</span></div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span> }</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span> </div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> fors_property_get_num(                      <span class="keyword">const</span> cpl_property  *prop)</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> {</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     <span class="keywordtype">double</span>      retval = 0;</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     cpl_type    type;</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>     </div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     cassure_automsg(                        prop != NULL,</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>                                             <span class="keywordflow">return</span> 0);</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>     </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     type = cpl_property_get_type(prop);</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     <span class="keywordflow">switch</span> (type)</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     {</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>         <span class="keywordflow">case</span> CPL_TYPE_BOOL:</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>             retval = cpl_property_get_bool(prop);</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>         <span class="keywordflow">case</span> CPL_TYPE_INT:</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>             retval = cpl_property_get_int(prop);</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>         <span class="keywordflow">case</span> CPL_TYPE_FLOAT:</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>             retval = cpl_property_get_float(prop);</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>         <span class="keywordflow">case</span> CPL_TYPE_DOUBLE:</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>             retval = cpl_property_get_double(prop);</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>             cpl_error_set_message(  cpl_func, CPL_ERROR_INVALID_TYPE,</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>                                     <span class="stringliteral">"type must be bool, int, float or double"</span>);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     }</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     </div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     <span class="keywordflow">switch</span> (type)</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     {</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         <span class="keywordflow">case</span> CPL_TYPE_BOOL:</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>             <span class="keywordflow">return</span> (fabs(retval) > 0.5) ? 1 : 0;</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         <span class="keywordflow">case</span> CPL_TYPE_INT:</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>             <span class="keywordflow">return</span> round(retval);</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>         <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>             <span class="keywordflow">return</span> retval;</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     }</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> }</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> fors_photometry_parameter_get_num(          <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name,</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>                                             cpl_type                type)</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span> {</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     <span class="keywordtype">char</span>  *descriptor;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>     <span class="keywordtype">double</span>      retval = -1;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     </div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     descriptor = cpl_sprintf(<span class="stringliteral">"fors.%s.%s"</span>, fors_photometry_name, name);</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     <span class="keywordflow">switch</span> (type)</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     {</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>         <span class="keywordflow">case</span> CPL_TYPE_BOOL:</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>             retval = <a class="code" href="group__forsdfs.html#gae0dc63f80258d73a93d35e41b2a8b367">dfs_get_parameter_bool_const</a>(parameters, descriptor);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         <span class="keywordflow">case</span> CPL_TYPE_INT:</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>             retval = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parameters, descriptor);</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> <span class="comment">/*        case CPL_TYPE_FLOAT:</span></div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> <span class="comment">            retval = dfs_get_parameter_float_const(parameters, descriptor);</span></div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> <span class="comment">            break;*/</span></div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>         <span class="keywordflow">case</span> CPL_TYPE_DOUBLE:</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>             retval = <a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a>(parameters, descriptor);</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>         <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>             cpl_error_set_message(  cpl_func, CPL_ERROR_INVALID_TYPE,</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>                                     <span class="stringliteral">"type must be bool, int"</span></div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>                                     <span class="comment">/*", float"*/</span></div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>                                     <span class="stringliteral">" or double"</span>);</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     }</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     cpl_free(descriptor);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     </div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     <span class="keywordflow">switch</span> (type)</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     {</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>         <span class="keywordflow">case</span> CPL_TYPE_BOOL:</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>             <span class="keywordflow">return</span> (fabs(retval) > 0.5) ? <span class="keyword">true</span> : <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         <span class="keywordflow">case</span> CPL_TYPE_INT:</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>             <span class="keywordflow">return</span> round(retval);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>         <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>             <span class="keywordflow">return</span> retval;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     }</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span> }</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> </div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span> fors_photometry_parameter_get_string(       <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name)</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> {</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     <span class="keywordtype">char</span>        *descriptor;</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *retval = NULL;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     </div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     descriptor = cpl_sprintf(<span class="stringliteral">"fors.%s.%s"</span>, fors_photometry_name, name);</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> </div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     retval = <a class="code" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">dfs_get_parameter_string_const</a>(parameters, descriptor);</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     </div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     cpl_free(descriptor);</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     <span class="keywordflow">return</span> retval;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span> }</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span> </div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> <span class="keyword">static</span> fors_fit_ncoeff</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span> fors_photometry_parameter_get_ncoeff(       <span class="keyword">const</span> cpl_parameterlist *parameters,</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name)</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> {</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *fit_n_str;</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     fit_n_str = fors_photometry_parameter_get_string(</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>                                             parameters,</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>                                             name);</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     <span class="keywordflow">if</span> (fit_n_str == NULL)</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     {</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>         cpl_error_set_message(              cpl_func,</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>                                             <span class="stringliteral">"parameter %s not found"</span>,</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>                                             name);</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     }</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     </div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     <span class="keywordflow">if</span> (strcmp(fit_n_str, <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.no) == 0)</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>         <span class="keywordflow">return</span> FORS_FIT_NCOEFF_NO;</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(fit_n_str, <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.one) == 0)</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>         <span class="keywordflow">return</span> FORS_FIT_NCOEFF_ONE;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(fit_n_str, <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.perframe)== 0)</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>         <span class="keywordflow">return</span> FORS_FIT_NCOEFF_PERFRAME;</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(fit_n_str, <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.pernight)== 0)</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>         <span class="keywordflow">return</span> FORS_FIT_NCOEFF_PERNIGHT;</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     {</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>         cpl_error_set_message(              cpl_func,</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>                                             <span class="stringliteral">"unknown parameter value \"%s\" "</span></div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>                                             <span class="stringliteral">"for %s"</span>,</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>                                             fit_n_str,</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>                                             name);</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     }</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> }</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span> </div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00669"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga4b3a00d660ccc7d889875a00fb629be5">  669</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__photometry.html#ga4b3a00d660ccc7d889875a00fb629be5" title="Define recipe parameters.">fors_photometry_define_parameters</a>(     cpl_parameterlist   *parameters)</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> {</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_photometry_name);</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span> </div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name, *full_name;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span> </div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>     name = <span class="stringliteral">"fitz"</span>;</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>                                 <span class="stringliteral">"Fit zeropoint"</span>,</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>                                 context,</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>                                 <span class="keyword">true</span>);</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span> </div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     name = <span class="stringliteral">"fit_all_mag"</span>;</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>                                 <span class="stringliteral">"Always fit star magnitudes"</span>,</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>                                 context,</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>                                 <span class="keyword">false</span>);</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>     </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     name = <span class="stringliteral">"fite"</span>;</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     p = cpl_parameter_new_enum( full_name,</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>                                 <span class="stringliteral">"Fit atmospheric extinctions"</span>,</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>                                 context,</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>                                 <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.pernight,</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>                                 4,</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>                                 <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.no,</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>                                 <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.one,</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>                                 <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.perframe,</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>                                 <a class="code" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>.pernight);</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span> </div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     name = <span class="stringliteral">"fitc"</span>;</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>                                 <span class="stringliteral">"Fit color correction term"</span>,</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>                                 context,</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>                                 <span class="keyword">false</span>);</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span> </div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     name = <span class="stringliteral">"use_all_stars"</span>;</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>                                 <span class="stringliteral">"Use also non-standard stars to fit "</span></div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>                                 <span class="stringliteral">"polynomial f"</span>,</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>                                 context,</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>                                 <span class="keyword">false</span>);</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> </div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>     name = <span class="stringliteral">"degreef1"</span>;</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>                                 <span class="stringliteral">"FLatfield correction map polynomial degree "</span></div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>                                 <span class="stringliteral">"(x)"</span>,</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>                                 context,</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>                                 0);</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span> </div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>     name = <span class="stringliteral">"degreef2"</span>;</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>                                 <span class="stringliteral">"Flatfield correction map polynomial degree "</span></div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>                                 <span class="stringliteral">"(y), or negative for "</span></div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>                                 <span class="stringliteral">"triangular coefficient matrix"</span>,</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>                                 context,</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>                                 -1);</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span> </div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     name = <span class="stringliteral">"degreep"</span>;</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>                                 <span class="stringliteral">"Extinction/color coupling degree"</span>,</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>                                 context,</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>                                 0);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> </div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>     cpl_free((<span class="keywordtype">void</span> *)context);</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> </div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> }</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span> </div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span> <span class="preprocessor">    cpl_polynomial_delete(polyf); polyf = NULL; \</span></div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span> <span class="keyword">static</span> cpl_polynomial*</div>
+<div class="line"><a name="l00805"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gaa9757bbaea210d70edf5874682ec6660">  805</a></span> <a class="code" href="group__fors__photometry.html#gaa9757bbaea210d70edf5874682ec6660" title="Create a polynomial containing the desired coefficients (set to 1).">fors_photometry_define_polyf</a>(               <span class="keywordtype">int</span>                 degreef1,</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>                                             <span class="keywordtype">int</span>                 degreef2)</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span> {</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     <span class="keywordtype">int</span>             xpow,</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>                     ypow;</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     cpl_polynomial  *polyf = NULL;</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     </div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     <span class="comment">/* free output pointers */</span></div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     cleanup;</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     </div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>     <span class="comment">/* check input */</span></div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Previous error caught."</span>);</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>     </div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>     <span class="keywordflow">if</span> (degreef1 < 0)</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>     {</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>         cpl_error_set_message(  cpl_func, CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>                                 <span class="stringliteral">"!(degreef1 >= 0)"</span>);</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>     }</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>     </div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>     <span class="comment">/* define the polynomial */</span></div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>     polyf = cpl_polynomial_new(2);  <span class="comment">/* 2 dimensions */</span></div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>     <span class="keywordflow">for</span> (xpow = 0; xpow <= degreef1; xpow++)</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>     {</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>         <span class="keywordflow">for</span> (ypow = 0;</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>              (degreef2 >= 0) ? (ypow <= degreef2) : (xpow + ypow <= degreef1);</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>              ypow++)</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>          {</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>             <span class="keywordflow">if</span> (xpow+ypow > 0)</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>             {</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>                 cpl_size pows[2];</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>                 pows[0] = xpow;</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>                 pows[1] = ypow;</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>                 cpl_polynomial_set_coeff(polyf, pows, 1.0);</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>             }</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>          }</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     }</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>     </div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     <a class="code" href="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981" title="Count the total number of non-zero coefficients.">fors_polynomial_dump</a>(polyf, <span class="stringliteral">"polynomial definition f"</span>, CPL_MSG_DEBUG, NULL);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     </div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>     <span class="comment">/* consistency check */</span></div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>     <span class="keywordflow">if</span> (degreef2 >= 0)</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>     {</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>         cassure(<a class="code" href="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff" title="Count the total number of non-zero coefficients.">fors_polynomial_count_coeff</a>(polyf)</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>                 == (degreef1+1)*(degreef2+1)-1,</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>                 CPL_ERROR_UNSPECIFIED,</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>                 <span class="keywordflow">return</span> polyf,</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>                 <span class="stringliteral">"Consistency check for rectangular f polynomial failed"</span>);</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>     }</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>     {</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>         cassure(<a class="code" href="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff" title="Count the total number of non-zero coefficients.">fors_polynomial_count_coeff</a>(polyf)</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>                 == ((degreef1+1)*(degreef1+2))/2-1,</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>                 CPL_ERROR_UNSPECIFIED,</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>                 <span class="keywordflow">return</span> polyf,</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>                 <span class="stringliteral">"Consistency check for triangular f polynomial failed"</span>);</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>     }</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>     </div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>     <span class="keywordflow">return</span> polyf;</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span> }</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span> </div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span> <span class="preprocessor">    cpl_polynomial_delete(polyp); polyp = NULL; \</span></div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span> <span class="keyword">static</span> cpl_polynomial*</div>
+<div class="line"><a name="l00885"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga8d413c86621fd2b2e37b6174e935d082">  885</a></span> <a class="code" href="group__fors__photometry.html#ga8d413c86621fd2b2e37b6174e935d082" title="Create a 2-dim polynomial with the desired coefficients (set to 1).">fors_photometry_define_polyp</a>(               <span class="keywordtype">int</span>                 degreep)</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span> {</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>     <span class="keywordtype">int</span>             k,</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>                     l;</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>     cpl_polynomial  *polyp = NULL;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>     </div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>     <span class="comment">/* free output pointers */</span></div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>     cleanup;</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>     </div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>     <span class="comment">/* check input */</span></div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Previous error caught."</span>);</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>     </div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>     cassure(                                degreep >= 0,</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>                                             <span class="keywordflow">return</span> polyp,</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>                                             <span class="stringliteral">"!(degreep >= 0)"</span>);</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>     </div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>     <span class="comment">/* define the polynomial */</span></div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>     polyp = cpl_polynomial_new(2);  <span class="comment">/* 2 dimensions */</span></div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>     </div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>     <span class="keywordflow">for</span> (k = 0; k <= degreep; k++) {</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>         <span class="keywordflow">for</span> (l = 0; k + l <= degreep; l++)</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>             <span class="keywordflow">if</span> (k+l > 1) {</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>                 cpl_size pows[2];</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>                 pows[0] = k;</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>                 pows[1] = l;</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>                 cpl_polynomial_set_coeff(polyp, pows, 1.0);</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>             }</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>     }</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>     </div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>     <a class="code" href="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981" title="Count the total number of non-zero coefficients.">fors_polynomial_dump</a>(polyp, <span class="stringliteral">"polynomial definition p"</span>, CPL_MSG_DEBUG, NULL);</div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>     </div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>     <span class="comment">/* consistency check */</span></div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>     {</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>         <span class="keywordtype">int</span> npars = degreep >= 2 ? ((degreep+1)*(degreep+2))/2-3 : 0;</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>         cassure(<a class="code" href="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff" title="Count the total number of non-zero coefficients.">fors_polynomial_count_coeff</a>(polyp) == npars,</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>                 CPL_ERROR_UNSPECIFIED,</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>                 <span class="keywordflow">return</span> polyp,</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>                 <span class="stringliteral">"Consistency check for triangular p polynomial failed"</span>);</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>     }</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>     </div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>     <span class="keywordflow">return</span> polyp;</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span> }</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span> </div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span> <span class="preprocessor">    if (poly != NULL) { cpl_polynomial_delete(*poly); *poly = NULL; } \</span></div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span> <span class="preprocessor">    if (var_poly != NULL) {cpl_polynomial_delete(*var_poly); *var_poly = NULL;}\</span></div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00952"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga07a5f25084d3a57c92743262a41e0366">  952</a></span> <a class="code" href="group__fors__photometry.html#ga07a5f25084d3a57c92743262a41e0366" title="Create a polynomial from a definition and a coefficients container.">fors_photometry_poly_new_from_coefficients</a>( <span class="keyword">const</span> cpl_polynomial    *p_def,</div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>                                             <span class="keyword">const</span> cpl_matrix        *coeffs,</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>                                             <span class="keyword">const</span> cpl_matrix        *cov_coeffs,</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>                                             cpl_polynomial          **poly,</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>                                             cpl_polynomial          **var_poly)</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span> {</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>     <span class="keywordtype">int</span>             n_coeffs;</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>     </div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>     <span class="comment">/* free output pointers */</span></div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>     cleanup;</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>     </div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>     cassure_automsg(                        p_def != NULL,</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>     cassure_automsg(                        poly != NULL,</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>     </div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>     n_coeffs = <a class="code" href="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff" title="Count the total number of non-zero coefficients.">fors_polynomial_count_coeff</a>( p_def);</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>     cassure_automsg(                        n_coeffs == 0 || coeffs != NULL,</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>     cassure_automsg(                        n_coeffs == 0</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>                                             || var_poly == NULL</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>                                             || cov_coeffs != NULL,</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>     <span class="keywordflow">if</span> (n_coeffs > 0)</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>     {</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>         </div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>         cassure_automsg(                    cpl_matrix_get_ncol(coeffs) == 1,</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>         cassure_automsg(                    cpl_matrix_get_nrow(coeffs)</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>                                             == n_coeffs,</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>                                             CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>         <span class="keywordflow">if</span> (var_poly != NULL)</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>         {</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>             cassure_automsg(                cpl_matrix_get_nrow(cov_coeffs)</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>                                             == n_coeffs,</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>                                             CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>             cassure(                        cpl_matrix_get_nrow(cov_coeffs)</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>                                             == cpl_matrix_get_ncol(cov_coeffs),</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>                                             CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>                                             <span class="stringliteral">"cov_coeffs is not square"</span>);</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>         }</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>         *poly = cpl_polynomial_duplicate(   p_def);</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>         <a class="code" href="group__fors__polynomial.html#ga9363bc98285fa909170db1684e81a240" title="Set the already existing coefficients in a polynomial to values taken from an array.">fors_polynomial_set_existing_coeff</a>( *poly,</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>                                             cpl_matrix_get_data_const(coeffs),</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>                                             n_coeffs);</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>         passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>         </div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>         <span class="keywordflow">if</span> (var_poly != NULL)</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>             *var_poly = <a class="code" href="group__fors__polynomial.html#ga2de60ddde27a60692e8e116939ef5007" title="Create a polynomial modelling the squared influence of the error of the coefficients of another polyn...">fors_polynomial_create_variance_polynomial</a>(</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>                                             p_def,</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>                                             cov_coeffs);</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>         passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>     }</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>     <span class="keywordflow">else</span>    <span class="comment">/* create empty polynomial */</span></div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>     {</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>         *poly = cpl_polynomial_new(         cpl_polynomial_get_dimension(</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>                                                 p_def));</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>         <span class="keywordflow">if</span> (var_poly != NULL)</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>             *var_poly = cpl_polynomial_new( cpl_polynomial_get_dimension(</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>                                                 p_def));</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>     }</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>     </div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>             CPL_ERROR_NONE :</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>             cpl_error_get_code());</div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span> }</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span> </div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l01039"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga1ac67d0a2f318cd599a5be4a05a8b4b1"> 1039</a></span> <a class="code" href="group__fors__photometry.html#ga1ac67d0a2f318cd599a5be4a05a8b4b1" title="Return the timezone of the observer in hours against UT.">fors_photometry_get_timezone_observer</a>(      <span class="keyword">const</span> cpl_propertylist  *header)</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span> {</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>     <span class="keyword">const</span> cpl_property  *prop;</div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>     </div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>     cassure_automsg(                        header != NULL,</div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>                                             <span class="keywordflow">return</span> 0);</div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>     </div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>     <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  *origin;</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>                 </div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>         prop = cpl_propertylist_get_property_const(header, <span class="stringliteral">"ORIGIN"</span>);</div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>         <span class="keywordflow">if</span> (prop == NULL)</div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>         {</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>             cpl_error_set_message(          cpl_func,</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>                                             <span class="stringliteral">"Couldn't find the keyword ORIGIN"</span>);</div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>             <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>         }</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>         </div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>         <span class="keywordflow">if</span> (cpl_property_get_type(prop) != CPL_TYPE_STRING)</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>         </div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>         <span class="keywordflow">if</span> ((origin = cpl_property_get_string(prop)) == NULL)</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>         </div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__fors__photometry.html#ga37834a5427d4d460953d5b818ea79ffa" title="Compare two strings while ignoring trailing blanks.">fors_fits_compare_string</a>(origin, <span class="stringliteral">"ESO"</span>))</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>         </div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>         <span class="comment">/* We're at ESO, i.e. in Chile */</span></div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>         <span class="keywordflow">return</span> -3;</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>         </div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>     } <span class="keywordflow">while</span> (0);</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>     </div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>     cpl_error_set_message(                  cpl_func,</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>                                             <span class="stringliteral">"Don't know the originator of the "</span></div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>                                             <span class="stringliteral">"frame specified in ORIGIN"</span>);</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span> }</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span> </div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l01092"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gaf800d130ebeddcf3e8a655cf0c305f47"> 1092</a></span> <a class="code" href="group__fors__photometry.html#gaf800d130ebeddcf3e8a655cf0c305f47" title="Get a unique identifier for the night of the observation.">fors_photometry_get_night_id</a>(               <span class="keyword">const</span> cpl_propertylist *header)</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span> {</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>     <span class="keyword">const</span> cpl_property  *prop;</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>     cpl_errorstate      errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>     </div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>     cassure_automsg(                        header != NULL,</div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>                                             <span class="keywordflow">return</span> 0);</div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>     </div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>     <span class="comment">/* try to get the Modified Julian Date */</span></div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>     prop = cpl_propertylist_get_property_const(header, <span class="stringliteral">"MJD-OBS"</span>);</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>     <span class="keywordflow">if</span> (prop != NULL)</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>     {</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>         <span class="keywordtype">double</span>  mjd,</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>                 jd,</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>                 timezone;</div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>         <span class="keywordtype">int</span>     localstartday;</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>         mjd = fors_property_get_num(prop);</div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                             cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>                                             <span class="keywordflow">return</span> 0,</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>                                             <span class="stringliteral">"Could not interprete Modified "</span></div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>                                             <span class="stringliteral">"Julian Date keyword MJD-OBS"</span>);</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>         </div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>         <span class="comment">/* The Julian Calendar starts at noon in Greenwich, counting days.</span></div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span> <span class="comment">         * The definition of MJD (FITS standard) is:</span></div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span> <span class="comment">         *   MJD = JD - 2'400'000.5</span></div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span> <span class="comment">         * The "xxx.5" means it starts some day at midnight (in Greenwich).</span></div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span> <span class="comment">         * We want a day definition again that starts at noon, so to have</span></div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span> <span class="comment">         * something standard, convert back to Julian date.</span></div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>          jd = mjd + 2400000.5;</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>          </div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>          <span class="comment">/* Get the timezone of the observation location. The timezone is not</span></div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span> <span class="comment">          * perfect to determine sunrise/sunset times, but we don't care</span></div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span> <span class="comment">          * since we don't expect any observations +/- 2h around noon.</span></div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span> <span class="comment">          */</span></div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>          timezone = <a class="code" href="group__fors__photometry.html#ga1ac67d0a2f318cd599a5be4a05a8b4b1" title="Return the timezone of the observer in hours against UT.">fors_photometry_get_timezone_observer</a>(header);</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>          </div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>          <span class="comment">/* Correct for the timezone. Now we have something like a</span></div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span> <span class="comment">          * "Julian Local Time Date" */</span></div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>          jd += (double)timezone / 24.0;</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>          </div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>          <span class="comment">/* Since the Julian days start every noon, we just round down and</span></div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span> <span class="comment">          * have the date of the day in which the night started */</span></div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>          localstartday = floor(jd);</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>          cpl_msg_debug(                     cpl_func,</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>                                             <span class="stringliteral">"Julian day no. of observation "</span></div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>                                             <span class="stringliteral">"night: %d"</span>,</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>                                             localstartday);</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>          </div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>          <span class="keywordflow">return</span> localstartday;</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>     }</div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>     </div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>     <span class="comment">/* So far, no alternative for MJD-OBS is provided. If there should be one</span></div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span> <span class="comment">     * in future, remember to check for inconsistencies between the frames. */</span></div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>     cpl_error_set_message(                  cpl_func,</div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>                                             <span class="stringliteral">"Couldn't find the keyword "</span></div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>                                             <span class="stringliteral">"MJD-OBS"</span>);</div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span> }</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span> </div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span> <span class="preprocessor">    cpl_free(ident_array); ident_array = NULL; \</span></div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span> <span class="keyword">static</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l01170"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gac8322b086764e1db46e5c9d72263a251"> 1170</a></span> <a class="code" href="group__fors__photometry.html#gac8322b086764e1db46e5c9d72263a251" title="Collect all atm. extinction identifiers and create the indices.">fors_photometry_atm_ext_create_index_by_identifier</a>(</div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>                                             entry_list          *obs_list)</div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span> {</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>     <a class="code" href="structentry.html">entry</a>           *e;</div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>     <span class="keywordtype">int</span>             *ident_array;</div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>     <span class="keywordtype">int</span>             n_entries,</div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>                     n_idents = 0;</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>     </div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>     cassure_automsg(                        obs_list != NULL,</div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>                                             <span class="keywordflow">return</span> 0);</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>     </div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>     n_entries = entry_list_size(obs_list);</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>     ident_array = cpl_malloc(n_entries * <span class="keyword">sizeof</span>(*ident_array));</div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>     </div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>     <span class="keywordflow">for</span> (   e = entry_list_first(obs_list);</div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>             e != NULL;</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>             e = entry_list_next(obs_list))</div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>     {</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>         <span class="keywordtype">int</span>     i;</div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>         <span class="keywordtype">bool</span>    found = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>         <span class="keywordflow">for</span> (i = 0; i < n_idents && !found; i++)</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>         {</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>             <span class="keywordflow">if</span> (e->atm_ext_identifier == ident_array[i])</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>             {</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>                 found = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>                 e->atm_ext_index = i;</div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>             }</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>         }</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>         <span class="keywordflow">if</span> (!found)</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>         {</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>             ident_array[n_idents] = e->atm_ext_identifier;</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>             e->atm_ext_index = n_idents;</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>             </div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>             cpl_msg_debug(                  cpl_func,</div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>                                             <span class="stringliteral">"Creating atm. extinction index "</span></div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>                                             <span class="stringliteral">"%2d for identifier %d"</span>,</div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>                                             n_idents,</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>                                             ident_array[n_idents]);</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>             </div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>             n_idents++;</div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>         }</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>     }</div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>     </div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>     passure(                                cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>                                             <span class="keywordflow">return</span> 0);</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>     </div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>     cpl_free(ident_array);</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>     <span class="keywordflow">return</span> n_idents;</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span> }</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span> </div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span> <span class="keyword">static</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l01243"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gafecdbeccb909ad2d152a857cfd10c2c0"> 1243</a></span> <a class="code" href="group__fors__photometry.html#gafecdbeccb909ad2d152a857cfd10c2c0" title="Create all atmospheric extinction indices.">fors_photometry_atm_ext_create_indices</a>(     entry_list      *obsl,</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>                                             fors_fit_ncoeff fit_e)</div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span> {</div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>     <a class="code" href="structentry.html">entry</a>           *e;</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>     <span class="keywordtype">int</span>             n_atm_ext_indices = 0;</div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>     </div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>     cassure_automsg(                        obsl != NULL,</div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>                                             <span class="keywordflow">return</span> -1);</div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>     </div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>     <span class="keywordflow">if</span> (fit_e != FORS_FIT_NCOEFF_NO</div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>         && fit_e != FORS_FIT_NCOEFF_ONE</div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>         && fit_e != FORS_FIT_NCOEFF_PERFRAME)</div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>     {</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>         <span class="comment">/* if FORS_FIT_NCOEFF_PERNIGHT or any other future option which</span></div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span> <span class="comment">         * has set an identifier */</span></div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>         n_atm_ext_indices = </div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>             <a class="code" href="group__fors__photometry.html#gac8322b086764e1db46e5c9d72263a251" title="Collect all atm. extinction identifiers and create the indices.">fors_photometry_atm_ext_create_index_by_identifier</a>(obsl);</div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>     }</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>     {</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>         <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_NO)</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>         {</div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>             <span class="keywordflow">for</span> (e = entry_list_first(obsl); e!=NULL; e = entry_list_next(obsl))</div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>                 e->atm_ext_index = -1;</div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>             n_atm_ext_indices = 0;</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>         }</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_ONE)</div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>         {</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>             <span class="keywordflow">for</span> (e = entry_list_first(obsl); e!=NULL; e = entry_list_next(obsl))</div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>                 e->atm_ext_index = 0;</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>             n_atm_ext_indices = 1;</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>         }</div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERFRAME)</div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>         {</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>             <span class="keywordflow">for</span> (e = entry_list_first(obsl); e!=NULL; e = entry_list_next(obsl))</div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>             {</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>                 e->atm_ext_index = e->frame_index;</div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>                 <span class="keywordflow">if</span> (e->frame_index >= n_atm_ext_indices)</div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>                     n_atm_ext_indices = e->frame_index + 1;</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>             }</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>         }</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>     }</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>     </div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>     <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))</div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>         cpl_error_set_where(cpl_func);</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>     </div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ? n_atm_ext_indices : -1);</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span> }</div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span> </div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span> <span class="preprocessor">    if (frame_printed != NULL) \</span></div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span> <span class="preprocessor">    { \</span></div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span> <span class="preprocessor">        cpl_free(frame_printed); \</span></div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span> <span class="preprocessor">        frame_printed = NULL; \</span></div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span> <span class="preprocessor">    } \</span></div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span> <span class="comment">//static cpl_error_code</span></div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span> <span class="keyword">static</span> cpl_table *</div>
+<div class="line"><a name="l01313"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gaadcf6d1ce33dbed7ae0cbd24d675562f"> 1313</a></span> <a class="code" href="group__fors__photometry.html#gaadcf6d1ce33dbed7ae0cbd24d675562f" title="Print the frame filenames for each atm. ext. index.">fors_photometry_atm_ext_print_index_by_framename</a>(</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>                                             <span class="keyword">const</span> entry_list    *obs_list,</div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>                                             <span class="keyword">const</span> cpl_frameset  *frames)</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span> {</div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>     <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>     *e;</div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>     <span class="keywordtype">bool</span>            *frame_printed = NULL;</div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>     <span class="keywordtype">int</span>             n_frames,</div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>                     ext_index,</div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>                     max_ext_index,</div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>                     n;</div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>     <span class="keywordtype">int</span>             row = 0;</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>     cpl_table      *summary;</div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>     </div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>     cassure_automsg(                        obs_list != NULL,</div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>                                             <span class="keywordflow">return</span> NULL);</div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>     cassure_automsg(                        frames != NULL,</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>                                             <span class="keywordflow">return</span> NULL);</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>     </div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>     n_frames = cpl_frameset_get_size(frames);</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>     frame_printed = cpl_malloc(n_frames * <span class="keyword">sizeof</span>(*frame_printed));</div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span> </div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>     summary = cpl_table_new(n_frames);</div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>     cpl_table_new_column(summary, <span class="stringliteral">"filename"</span>, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>     cpl_table_new_column(summary, <span class="stringliteral">"index"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>     </div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>     max_ext_index = -1;</div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>     <span class="keywordflow">for</span> (   e = entry_list_first_const(obs_list);</div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>             e != NULL;</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>             e = entry_list_next_const(obs_list))</div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>     {</div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>         <span class="keywordflow">if</span> (e->atm_ext_index > max_ext_index)</div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>             max_ext_index = e->atm_ext_index;</div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>     }</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>     </div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>     <span class="keywordflow">if</span> (max_ext_index >= 0)</div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>         cpl_msg_info(                       cpl_func,</div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>                                             <span class="stringliteral">"Assignment of atmospheric "</span></div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>                                             <span class="stringliteral">"extinction indices:"</span>);</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>     </div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>     <span class="keywordflow">for</span> (ext_index = 0; ext_index <= max_ext_index; ext_index++)</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>     {</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>         <span class="keywordtype">bool</span>    first_file = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>         <span class="keywordtype">char</span>    estr[15];</div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>         <span class="keywordflow">for</span> (n = 0; n < n_frames; n++)</div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>             frame_printed[n] = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>         </div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>         sprintf(estr, <span class="stringliteral">"E_%d:         "</span>, ext_index);</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>         estr[9] = <span class="charliteral">'\0'</span>;</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>         </div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>         <span class="keywordflow">for</span> (   e = entry_list_first_const(obs_list);</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>                 e != NULL;</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>                 e = entry_list_next_const(obs_list))</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>         {</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>             <span class="keywordflow">if</span> (e->atm_ext_index == ext_index)</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>             {</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>                 cassure_automsg(            e->frame_index >= 0</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>                                             && e->frame_index < n_frames,</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>                                             {</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>                                                 cpl_msg_indent_less();</div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>                                                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>                                             });</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>                 </div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>                 <span class="keywordflow">if</span> (!frame_printed[e->frame_index])</div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>                 {</div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>                     <span class="keyword">const</span> cpl_frame *f;</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>                     </div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>                     f = cpl_frameset_get_frame_const(frames, e->frame_index);</div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>                     <span class="keywordflow">if</span> (first_file)</div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>                     {</div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>                         cpl_msg_info(       cpl_func,</div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>                                             <span class="stringliteral">"%s%s"</span>,</div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>                                             estr,</div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>                                             cpl_frame_get_filename(f));</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>                     }</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>                     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>                     {</div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>                         cpl_msg_info(       cpl_func,</div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>                                             <span class="stringliteral">"         %s"</span>,</div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>                                             cpl_frame_get_filename(f));</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>                     }</div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>                     frame_printed[e->frame_index] = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>                     first_file = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span> </div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span> <span class="comment">                     * This tail is added to store the filename / index</span></div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span> <span class="comment">                     * in a summary table.</span></div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span> </div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>                     cpl_table_set_string(summary, <span class="stringliteral">"filename"</span>, row, </div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>                                          cpl_frame_get_filename(f));</div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>                     cpl_table_set_int(summary, <span class="stringliteral">"index"</span>, row, ext_index);</div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>                     row++;</div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span> </div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>                 }</div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>             }</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>             </div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>             </div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>         }</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>     }</div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span> </div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span> <span class="comment">//    cpl_table_save(summary, NULL, NULL, "summary.fits", CPL_IO_CREATE);</span></div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>     </div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>     cleanup;</div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>     </div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>     passure(                                cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>                                             <span class="keywordflow">return</span> NULL);</div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>     </div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>     <span class="keywordflow">return</span> summary;</div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span> }</div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span> </div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l01447"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga104fe70d8a535ae244e71f6b16dcaf5d"> 1447</a></span> <a class="code" href="group__fors__photometry.html#ga104fe70d8a535ae244e71f6b16dcaf5d" title="Check input value and its error to stay in a range.">fors_photometry_check_input_value</a>(          <span class="keywordtype">double</span>      value,</div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>                                             <span class="keywordtype">double</span>      value_error,</div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *value_name,</div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *input_name,</div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>                                             <span class="keywordtype">double</span>      min_limit,</div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>                                             <span class="keywordtype">double</span>      max_limit,</div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>                                             <span class="keywordtype">double</span>      max_error)</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span> {</div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>     </div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>     <span class="keywordflow">if</span> (value < min_limit || value > max_limit)</div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>     {</div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>         cpl_error_set_message(              cpl_func,</div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>                                             <span class="stringliteral">"invalid %s (%f)"</span></div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>                                             <span class="stringliteral">"%s%s"</span></div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>                                             <span class="stringliteral">", either correct input, or try to "</span></div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>                                             <span class="stringliteral">"re-run this recipe with fitting "</span></div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>                                             <span class="stringliteral">"%s enabled"</span>,</div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>                                             value_name,</div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>                                             value,</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>                                             (input_name != NULL)?<span class="stringliteral">" read from "</span>:<span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>                                             (input_name != NULL)?input_name:<span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>                                             value_name);</div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>     }</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value_error > max_error || value_error < 0)</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>     {</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>         <span class="keywordtype">char</span>    exceed_max_err[30];</div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>         sprintf(exceed_max_err, <span class="stringliteral">"> %f"</span>, max_error);</div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>         cpl_error_set_message(              cpl_func,</div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>                                             <span class="stringliteral">"unreliable %s ((error = %g) %s)"</span></div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>                                             <span class="stringliteral">"%s%s"</span></div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>                                             <span class="stringliteral">", either recompute input, or try "</span></div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>                                             <span class="stringliteral">"to re-run this recipe with "</span></div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>                                             <span class="stringliteral">"fitting %s enabled"</span>,</div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>                                             value_name,</div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>                                             value_error,</div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>                                             (value_error < 0) ?</div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>                                                 <span class="stringliteral">"< 0"</span> : exceed_max_err,</div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>                                             (input_name != NULL)?<span class="stringliteral">" read from "</span>:<span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>                                             (input_name != NULL)?input_name:<span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>                                             value_name);</div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>     }</div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>     {</div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>         cpl_msg_info(                       cpl_func,</div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>                                             <span class="stringliteral">"Using input value%s%s: "</span></div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>                                             <span class="stringliteral">"%s = %f +- %f"</span>,</div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>                                             (input_name != NULL)?<span class="stringliteral">" from "</span>:<span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>                                             (input_name != NULL)?input_name:<span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>                                             value_name,</div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>                                             value,</div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>                                             value_error);</div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>     }</div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>     </div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>                 CPL_ERROR_NONE :</div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>                 cpl_error_get_code());</div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span> }</div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span> </div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span> <span class="preprocessor">    cpl_array_delete(airmasses); airmasses = NULL; \</span></div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l01522"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga750adc75acb9310f8dde5fb067a356e9"> 1522</a></span> <a class="code" href="group__fors__photometry.html#ga750adc75acb9310f8dde5fb067a356e9" title="Check whether fitting is possible (see below).">fors_photometry_check_fitparam_atm_ext</a>(     entry_list      *obsl,</div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>                                             fors_fit_ncoeff fit_e,</div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>                                             <span class="keywordtype">bool</span>            fit_z)</div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span> {</div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>     <a class="code" href="structentry.html">entry</a>           *e;</div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>     <span class="keywordtype">int</span>             n_atm_ext_indices = 0;</div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>     cpl_array       *airmasses = NULL;</div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>     </div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>     cassure_automsg(                        obsl != NULL,</div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>     </div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>     <span class="comment">/* we only have a problem if we want to fit the zeropoint and the</span></div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span> <span class="comment">     * atmospheric extinction at the same time, but there are not</span></div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span> <span class="comment">     * enough airmasses */</span></div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>     <span class="keywordflow">if</span> (!fit_z || fit_e == FORS_FIT_NCOEFF_NO)</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>     {</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>         <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>     }</div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>     </div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>     <span class="comment">/* count the indices */</span></div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>     <span class="keywordflow">for</span> (e = entry_list_first(obsl); e!=NULL; e = entry_list_next(obsl))</div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>     {</div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>         <span class="keywordflow">if</span> (e->atm_ext_index >= n_atm_ext_indices)</div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>             n_atm_ext_indices = e->atm_ext_index + 1;</div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>     }</div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>     </div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>     <span class="comment">/*assure(                                 cpl_errorstate_is_equal(errstat),</span></div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span> <span class="comment">                                            return cpl_error_get_code(),</span></div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span> <span class="comment">                                            NULL);*/</span></div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span> </div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>     <span class="comment">/* Check whether there are at least 2 different airmasses for</span></div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span> <span class="comment">     * at least 1 atmospheric extinction</span></div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>     <span class="keywordflow">if</span> (n_atm_ext_indices > 0)</div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>     {</div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>         <span class="keywordtype">bool</span>    multiple_found = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>         </div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>         airmasses = cpl_array_new(n_atm_ext_indices, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>         </div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>         <span class="keywordflow">for</span> (   e = entry_list_first(obsl);</div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>                 e != NULL;</div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>                 e = entry_list_next(obsl))</div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>         {</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>             <span class="keywordtype">double</span>  first_airmass;</div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>             <span class="keywordtype">int</span>     is_set;</div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>             first_airmass = cpl_array_get_double(</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>                                             airmasses,</div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>                                             e->atm_ext_index,</div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>                                             &is_set); </div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>             passure(                        cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>             is_set = (is_set == 0);</div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>             <span class="keywordflow">if</span> (!is_set)</div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>                 cpl_array_set_double(airmasses, e->atm_ext_index, e->airmass);</div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>             {</div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>                 <span class="comment">/* if there is a different airmass for this ext index */</span></div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>                 <span class="keywordflow">if</span> (fabs(e->airmass - first_airmass) > 10*DBL_EPSILON)</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>                 {</div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>                     multiple_found = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>                 }</div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>                 <span class="comment">/* we won't check here whether the difference in airmass is</span></div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span> <span class="comment">                 * too small to get reliable results, that will turn out</span></div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span> <span class="comment">                 * in the errors of the output after fitting */</span></div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>             }</div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>         }</div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>         </div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>         <span class="keywordflow">if</span> (!multiple_found)</div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>         {</div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>             <span class="keywordflow">if</span> (n_atm_ext_indices > 1)</div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>                 cpl_msg_error(              cpl_func,</div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>                                             <span class="stringliteral">"No atmospheric extinction was "</span></div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>                                             <span class="stringliteral">"observed at different airmasses."</span>);</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>                 cpl_msg_error(              cpl_func,</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>                                             <span class="stringliteral">"Atmospheric extinction was not "</span></div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>                                             <span class="stringliteral">"observed at different airmasses."</span>);</div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>         }</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>         cassure(                            multiple_found,</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>                                             <span class="stringliteral">"For fitting the zeropoint and "</span></div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>                                             <span class="stringliteral">"atmospheric extinction, "</span></div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>                                             <span class="stringliteral">"there must be >= 2 different "</span></div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>                                             <span class="stringliteral">"airmasses for at least 1 "</span></div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>                                             <span class="stringliteral">"atmospheric extinction"</span>);</div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>     }</div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>     </div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>     cpl_array_delete(airmasses);</div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>     </div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>             CPL_ERROR_NONE :</div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>             cpl_error_get_code());</div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span> }</div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span> </div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span> <span class="preprocessor">    fors_matrix_null(&solution); \</span></div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span> <span class="preprocessor">    fors_matrix_null(&cov1); \</span></div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span> <span class="preprocessor">    fors_matrix_null(&At); \</span></div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span> <span class="preprocessor">    fors_matrix_null(&AtC); \</span></div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span> <span class="preprocessor">    fors_matrix_null(&AtCA); \</span></div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span> <span class="preprocessor">    fors_matrix_null(&p); \</span></div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span> <span class="preprocessor">    fors_matrix_null(&Ap); \</span></div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span> <span class="preprocessor">    fors_matrix_null(&bAp); \</span></div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span> <span class="preprocessor">    fors_matrix_null(&bApt); \</span></div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span> <span class="preprocessor">    fors_matrix_null(&C1bAp); \</span></div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span> <span class="preprocessor">    fors_matrix_null(&chi2); \</span></div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span> <span class="preprocessor"></span><span class="comment">/* </span></div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span> <span class="comment">   @brief Linear correlated weighted least squares fit</span></div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span> <span class="comment">   @param coeff      design matrix (A)</span></div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span> <span class="comment">   @param rhs        right hand side (b)</span></div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span> <span class="comment">   @param cov_rhs    covariance of b (C)</span></div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span> <span class="comment">   @param red_chisq  (output) reduced chi squared, or NULL</span></div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span> <span class="comment"></span></div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span> <span class="comment">   Similar to cpl_matrix_solve_normal, except the output matrix is not</span></div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span> <span class="comment">   a m x 1 matrix</span></div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span> <span class="comment"></span></div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span> <span class="comment">   x0</span></div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span> <span class="comment">   x1</span></div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span> <span class="comment">   x2</span></div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span> <span class="comment">   :</span></div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span> <span class="comment"></span></div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span> <span class="comment">   but an m x (m+1) matrix</span></div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span> <span class="comment"></span></div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span> <span class="comment">   x0  C00 C01 C02 ...</span></div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span> <span class="comment">   x1  C10 C11 </span></div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span> <span class="comment">   x2  C20     . </span></div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span> <span class="comment">   :   :        .</span></div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span> <span class="comment"></span></div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span> <span class="comment">   where the first column is the least chi squared solution to the</span></div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span> <span class="comment">   overdetermined equation system Ax = b, given the covariance, C, of b.</span></div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span> <span class="comment"></span></div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span> <span class="comment">   and the last m columns is the covariance matrix of the solution</span></div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span> <span class="comment">   (A^t C^-1 A)^-1</span></div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span> <span class="comment"></span></div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span> <span class="comment">   The reduced chi squared is given by</span></div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span> <span class="comment">   </span></div>
+<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span> <span class="comment">     (b-Ap)^t C^-1 (b-Ap) / (degrees of freedom)</span></div>
+<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span> <span class="comment"></span></div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span> <span class="comment">   where  degrees of freedom = |b| - |p|</span></div>
+<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span> <span class="comment"></span></div>
+<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span> <span class="keyword">static</span> cpl_matrix *</div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span> solve_normal(<span class="keyword">const</span> cpl_matrix *coeff, </div>
+<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>              <span class="keyword">const</span> cpl_matrix *rhs,</div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>              <span class="keyword">const</span> cpl_matrix *cov_rhs,</div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>              <span class="keywordtype">double</span> *red_chisq)</div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span> {</div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>     cpl_matrix      *solution = NULL;</div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>     cpl_matrix      *cov1 = NULL;  <span class="comment">/* C^-1 */</span></div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>     cpl_matrix      *At = NULL;    <span class="comment">/* A^t */</span></div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>     cpl_matrix      *AtC = NULL;   <span class="comment">/* A^t C^-1 */</span></div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>     cpl_matrix      *AtCA = NULL;  <span class="comment">/* A^t C^-1 A */</span></div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>     cpl_matrix      *p = NULL;</div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>     cpl_matrix      *Ap = NULL;</div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>     cpl_matrix      *bAp = NULL;</div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>     cpl_matrix      *bApt = NULL;</div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>     cpl_matrix      *C1bAp = NULL;</div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>     cpl_matrix      *chi2 = NULL;</div>
+<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span>     cpl_error_code  error;</div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span> </div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>     cpl_ensure(coeff   != NULL, CPL_ERROR_NULL_INPUT, NULL);</div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>     cpl_ensure(rhs     != NULL, CPL_ERROR_NULL_INPUT, NULL);</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>     cpl_ensure(cov_rhs != NULL, CPL_ERROR_NULL_INPUT, NULL);</div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span> </div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>     <span class="comment">/* The overall time is probably dominated by this</span></div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span> <span class="comment">       matrix inversion which is O(n^3) if C is nxn */</span></div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>     cov1 = cpl_matrix_invert_create(cov_rhs);</div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span> </div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cov1 != NULL, <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>             <span class="stringliteral">"Could not invert covariance matrix. Make sure that provided "</span></div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>             <span class="stringliteral">"errors are positive"</span>);</div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>     <span class="comment">/* The covariance matrix is singular if one (or more) eigenvalue is</span></div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span> <span class="comment">       zero, i.e. if there exist a unitary transformation (rotation of</span></div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span> <span class="comment">       coordinates) that makes the variance of one of the new coordinates</span></div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span> <span class="comment">       zero (and therefore a failure at this place is probably because the</span></div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span> <span class="comment">       user has provided some non-positive error).</span></div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>     </div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>     At  = cpl_matrix_transpose_create(coeff);</div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span> </div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>     AtC = cpl_matrix_product_create(At, cov1);   </div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span> </div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&At);</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span> </div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>     AtCA = cpl_matrix_product_create(AtC, coeff);</div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>     </div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>     solution = cpl_matrix_product_create(AtC, rhs);</div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>     cpl_matrix_set_size(solution, </div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>                         cpl_matrix_get_nrow(solution),</div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>                         1 + cpl_matrix_get_nrow(solution));</div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>     {</div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>         <span class="keywordtype">int</span> i = 0;</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>         <span class="keywordflow">for</span> (i = 0; i < cpl_matrix_get_nrow(solution); i++) {</div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>             cpl_matrix_set(solution, i, i+1, 1);</div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>         }</div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>     }</div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span> </div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&AtC);</div>
+<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span> </div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>     <span class="comment">//cpl_matrix_dump(AtCA, stdout);</span></div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>     <span class="comment">//cpl_matrix_dump(solution, stdout);</span></div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>     </div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>     error = cpl_matrix_decomp_chol(AtCA);</div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>     <span class="keywordflow">if</span> (!error) {</div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>         error = cpl_matrix_solve_chol(AtCA, solution);</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>     }</div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>     </div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&AtCA);</div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span> </div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>     <span class="keywordflow">if</span> (error) {</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>         cleanup;</div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>         cpl_ensure(0, error, NULL);</div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>     }</div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span> </div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span> </div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>     <span class="keywordflow">if</span> (red_chisq != NULL) {</div>
+<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span> </div>
+<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>         <span class="comment">/* Get first column vector, p, of solution */</span></div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>         p = cpl_matrix_duplicate(solution);</div>
+<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>         cpl_matrix_set_size(p, cpl_matrix_get_nrow(p), 1);</div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>         </div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>         Ap = cpl_matrix_product_create(coeff, p);</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span> </div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>         bAp = cpl_matrix_duplicate(rhs);</div>
+<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>         cpl_matrix_subtract(bAp, Ap);</div>
+<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span> </div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>         bApt = cpl_matrix_transpose_create(bAp);</div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span> </div>
+<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>         C1bAp = cpl_matrix_product_create(cov1, bAp);</div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span> </div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>         chi2 =  cpl_matrix_product_create(bApt, C1bAp);</div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span> </div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>         passure(cpl_matrix_get_nrow(chi2) == 1 &&</div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>                 cpl_matrix_get_ncol(chi2) == 1, <span class="keywordflow">return</span> NULL);</div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span> </div>
+<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>         *red_chisq = cpl_matrix_get(chi2, 0, 0) /</div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>             (cpl_matrix_get_nrow(rhs) - cpl_matrix_get_nrow(p));</div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span> </div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>     }</div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>     </div>
+<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>     cpl_matrix  *return_solution = solution; solution = NULL;</div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>     cleanup;</div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span> </div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>     <span class="keywordflow">return</span> return_solution;</div>
+<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span> }</div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span> </div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span> <span class="preprocessor">    cpl_frameset_delete((cpl_frameset *)aligned_phot_frames);        \</span></div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span> <span class="preprocessor">    cpl_frameset_delete((cpl_frameset *)master_flat_frame); \</span></div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span> <span class="preprocessor">    cpl_frameset_delete((cpl_frameset *)phot_table); \</span></div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span> <span class="preprocessor">    fors_image_delete(&master_flat); \</span></div>
+<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span> <span class="preprocessor">    fors_image_delete(&correction); \</span></div>
+<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span> <span class="preprocessor">    cpl_table_delete(phot_coeff); \</span></div>
+<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span> <span class="preprocessor">    cpl_table_delete(summary); \</span></div>
+<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span> <span class="preprocessor">    fors_delete_star_lists(&obs, &std_star_list); \</span></div>
+<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span> <span class="preprocessor">    cpl_array_delete(n_std_star_obs); n_std_star_obs = NULL; \</span></div>
+<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span> <span class="preprocessor">    fors_matrix_null(&eqn_lhs); \</span></div>
+<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span> <span class="preprocessor">    fors_matrix_null(&eqn_rhs); \</span></div>
+<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span> <span class="preprocessor">    fors_matrix_null(&eqn_cov_rhs); \</span></div>
+<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span> <span class="preprocessor">    fors_matrix_null(&eqn_result); \</span></div>
+<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span> <span class="preprocessor">    fors_matrix_null(&tmp_mat); \</span></div>
+<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span> <span class="preprocessor">    fors_matrix_null(&result_polyf); \</span></div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span> <span class="preprocessor">    fors_matrix_null(&result_cov_polyf); \</span></div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span> <span class="preprocessor">    fors_matrix_null(&result_params); \</span></div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span> <span class="preprocessor">    fors_matrix_null(&result_cov_params); \</span></div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span> <span class="preprocessor">    fors_matrix_null(&result_polyp); \</span></div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span> <span class="preprocessor">    fors_matrix_null(&result_cov_polyp); \</span></div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span> <span class="preprocessor">    cpl_polynomial_delete(polyf); polyf = NULL; \</span></div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span> <span class="preprocessor">    cpl_polynomial_delete(polyf_definition); polyf_definition = NULL; \</span></div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span> <span class="preprocessor">    cpl_polynomial_delete(polyf_variance); polyf_variance = NULL; \</span></div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span> <span class="preprocessor">    cpl_polynomial_delete(polyp); polyp = NULL; \</span></div>
+<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span> <span class="preprocessor">    cpl_polynomial_delete(polyp_definition); polyp_definition = NULL; \</span></div>
+<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01818"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gae18d6d686eec800da9538ee3c533aed7"> 1818</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__photometry.html#gae18d6d686eec800da9538ee3c533aed7" title="Do the processing.">fors_photometry</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span> {</div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>     <span class="comment">/* Input */</span></div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>     <span class="keyword">const</span> cpl_frameset  *aligned_phot_frames = NULL,</div>
+<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>                         *master_flat_frame   = NULL,</div>
+<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>                         *phot_table          = NULL;</div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>     <a class="code" href="struct__fors__image.html">fors_image</a>          *master_flat         = NULL;</div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span> </div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>     <span class="comment">/* Products */</span></div>
+<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>     <a class="code" href="struct__fors__image.html">fors_image</a>          *correction = NULL;</div>
+<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>     cpl_table           *phot_coeff = NULL;</div>
+<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>     cpl_table           *summary    = NULL;</div>
+<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>     </div>
+<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>     <span class="comment">/* Star lists */</span></div>
+<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>     fors_std_star_list  *std_star_list = NULL;</div>
+<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span>     entry_list          *obs = NULL;</div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>     cpl_array           *n_std_star_obs = NULL;</div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>     </div>
+<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>     <span class="comment">/* Equation system */</span></div>
+<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>     cpl_matrix          *eqn_lhs = NULL,</div>
+<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>                         *eqn_rhs = NULL,</div>
+<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>                         *eqn_cov_rhs = NULL,</div>
+<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>                         *eqn_result = NULL,</div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>                         *result_polyf = NULL,</div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>                         *result_cov_polyf = NULL,</div>
+<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>                         *result_params = NULL,</div>
+<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>                         *result_cov_params = NULL,</div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>                         *result_polyp = NULL,</div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>                         *result_cov_polyp = NULL,</div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>                         *tmp_mat = NULL;</div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>     </div>
+<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>     <span class="comment">/* polynomials to fit */</span></div>
+<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>     cpl_polynomial      *polyf = NULL,</div>
+<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>                         *polyf_definition = NULL,</div>
+<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>                         *polyf_variance = NULL,</div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>                         *polyp = NULL,</div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>                         *polyp_definition = NULL;</div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>     </div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>     <span class="comment">/* Other */</span></div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a>        *setting = NULL;</div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>          *tag     = NULL;</div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>     <span class="keywordtype">int</span>                  row;</div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span> </div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>     <span class="comment">/* Photometric parameters */</span></div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>     cpl_propertylist *qc        = NULL;</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>     <span class="keywordtype">double</span> qc_zeropoint         = -1.0;</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>     <span class="keywordtype">double</span> qc_zeropoint_err     = -1.0;</div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>     <span class="keywordtype">double</span> qc_extinction        = -1.0;</div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>     <span class="keywordtype">double</span> qc_extinction_err    = -1.0;</div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>     <span class="keywordtype">double</span> qc_colorterm         = -1.0;</div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>     <span class="keywordtype">double</span> qc_colorterm_err     = -1.0;</div>
+<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>     </div>
+<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>     <span class="comment">/* Find input */</span></div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>     aligned_phot_frames = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, ALIGNED_PHOT);</div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>     cassure(cpl_frameset_get_size(aligned_phot_frames) > 0,</div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>             <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>             <span class="stringliteral">"No %s provided"</span>, ALIGNED_PHOT);</div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span> </div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>     master_flat_frame = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, MASTER_SKY_FLAT_IMG);</div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>     cassure(cpl_frameset_get_size(master_flat_frame) > 0,</div>
+<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>             <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>             <span class="stringliteral">"No %s provided"</span>, MASTER_SKY_FLAT_IMG);</div>
+<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>     </div>
+<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>     phot_table = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, PHOT_TABLE);</div>
+<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>     cassure(cpl_frameset_get_size(phot_table) == 1,</div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>             <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>,</div>
+<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span>             PHOT_TABLE, cpl_frameset_get_size(phot_table));</div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span> </div>
+<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>     <span class="comment">/* Get command line parameters */</span></div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>     <span class="keywordtype">bool</span>            fit_z,</div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>                     override_fit_m,</div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>                     fit_c,</div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>                     use_all;</div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>     <span class="keywordtype">int</span>             degreef1,</div>
+<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span>                     degreef2,</div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>                     degreep;</div>
+<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>     fors_fit_ncoeff fit_e;</div>
+<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>     </div>
+<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>     degreef1 = fors_photometry_parameter_get_num(</div>
+<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>                                             parameters,</div>
+<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>                                             <span class="stringliteral">"degreef1"</span>,</div>
+<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>                                             CPL_TYPE_INT);</div>
+<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>     degreef2 = fors_photometry_parameter_get_num(</div>
+<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>                                             parameters,</div>
+<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>                                             <span class="stringliteral">"degreef2"</span>,</div>
+<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>                                             CPL_TYPE_INT);</div>
+<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>     degreep = fors_photometry_parameter_get_num(</div>
+<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>                                             parameters,</div>
+<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>                                             <span class="stringliteral">"degreep"</span>,</div>
+<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span>                                             CPL_TYPE_INT);</div>
+<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>     fit_z = fors_photometry_parameter_get_num(</div>
+<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>                                             parameters,</div>
+<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>                                             <span class="stringliteral">"fitz"</span>,</div>
+<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>                                             CPL_TYPE_BOOL);</div>
+<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>     override_fit_m = fors_photometry_parameter_get_num(</div>
+<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>                                             parameters,</div>
+<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>                                             <span class="stringliteral">"fit_all_mag"</span>,</div>
+<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>                                             CPL_TYPE_BOOL);</div>
+<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>     fit_c = fors_photometry_parameter_get_num(</div>
+<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>                                             parameters,</div>
+<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>                                             <span class="stringliteral">"fitc"</span>,</div>
+<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>                                             CPL_TYPE_BOOL);</div>
+<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>     use_all = fors_photometry_parameter_get_num(</div>
+<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>                                             parameters,</div>
+<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>                                             <span class="stringliteral">"use_all_stars"</span>,</div>
+<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>                                             CPL_TYPE_BOOL);</div>
+<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>     fit_e = fors_photometry_parameter_get_ncoeff(</div>
+<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>                                             parameters,</div>
+<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>                                             <span class="stringliteral">"fite"</span>);</div>
+<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>     </div>
+<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>     <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERFRAME</div>
+<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>         && fit_z == <span class="keyword">true</span>)</div>
+<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>     {</div>
+<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>         cpl_error_set_message(              cpl_func,</div>
+<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>                                             <span class="stringliteral">"Fitting one atmospheric "</span></div>
+<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>                                             <span class="stringliteral">"extinction per frame and the "</span></div>
+<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>                                             <span class="stringliteral">"zeropoint is ambiguous and "</span></div>
+<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>                                             <span class="stringliteral">"therefore not possible"</span>);</div>
+<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>     }</div>
+<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>     </div>
+<div class="line"><a name="l01947"></a><span class="lineno"> 1947</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>     <span class="comment">/* Get instrument and filter settings */</span></div>
+<div class="line"><a name="l01949"></a><span class="lineno"> 1949</span>     </div>
+<div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(             cpl_frameset_get_first_const(</div>
+<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>                                                 aligned_phot_frames));</div>
+<div class="line"><a name="l01952"></a><span class="lineno"> 1952</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 !cpl_error_get_code(),</div>
+<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>                                             <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>                                             <span class="stringliteral">"Could not get instrument setting"</span>);</div>
+<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span> </div>
+<div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>     <span class="comment">/* Load filter coefficients */</span></div>
+<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>     <span class="keyword">struct </span>phot_input {</div>
+<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>         <span class="keywordtype">double</span>  color_coeff,</div>
+<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>                 dcolor_coeff,</div>
+<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>                 ext,</div>
+<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>                 dext,</div>
+<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span>                 zpoint,</div>
+<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>                 dzpoint;</div>
+<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>     } phot_input;</div>
+<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span> </div>
+<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>     phot_input.color_coeff = 0.0;</div>
+<div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>     phot_input.dcolor_coeff = 0.0;</div>
+<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>     phot_input.ext = 0.0;</div>
+<div class="line"><a name="l01969"></a><span class="lineno"> 1969</span>     phot_input.dext = 0.0;</div>
+<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>     phot_input.zpoint = 0.0;</div>
+<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>     phot_input.dzpoint = 0.0;</div>
+<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span> </div>
+<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Loading photometry table"</span>);</div>
+<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>     fors_phot_table_load(                   cpl_frameset_get_first_const(</div>
+<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>                                                 phot_table),</div>
+<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>                                             setting,</div>
+<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>                                             fit_c ? NULL </div>
+<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>                                                   : &phot_input.color_coeff,</div>
+<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>                                             fit_c ? NULL</div>
+<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>                                                   : &phot_input.dcolor_coeff,</div>
+<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>                                             fit_e != FORS_FIT_NCOEFF_NO ? NULL</div>
+<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>                                                   : &phot_input.ext,</div>
+<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>                                             fit_e != FORS_FIT_NCOEFF_NO ? NULL</div>
+<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>                                                   : &phot_input.dext,</div>
+<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>                                             fit_z ? NULL</div>
+<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>                                                   : &phot_input.zpoint,</div>
+<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>                                             fit_z ? NULL</div>
+<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>                                                   : &phot_input.dzpoint);</div>
+<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 !cpl_error_get_code(),</div>
+<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>                                             <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>                                             <span class="stringliteral">"Could not load photometry table"</span>);</div>
+<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>     </div>
+<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>     <span class="comment">/* Check fixed photometric input */</span></div>
+<div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>     <span class="keywordflow">if</span> (!fit_c)</div>
+<div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>     {</div>
+<div class="line"><a name="l01997"></a><span class="lineno"> 1997</span>         <a class="code" href="group__fors__photometry.html#ga104fe70d8a535ae244e71f6b16dcaf5d" title="Check input value and its error to stay in a range.">fors_photometry_check_input_value</a>(  phot_input.color_coeff,</div>
+<div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>                                             phot_input.dcolor_coeff,</div>
+<div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>                                             <span class="stringliteral">"color correction term"</span>,</div>
+<div class="line"><a name="l02000"></a><span class="lineno"> 2000</span>                                             NULL<span class="comment">/*"photometry table"*/</span>,</div>
+<div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>                                             -10,<span class="comment">/* min limit */</span></div>
+<div class="line"><a name="l02002"></a><span class="lineno"> 2002</span>                                             10, <span class="comment">/* max limit */</span></div>
+<div class="line"><a name="l02003"></a><span class="lineno"> 2003</span>                                             1); <span class="comment">/* max error */</span></div>
+<div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>     }</div>
+<div class="line"><a name="l02005"></a><span class="lineno"> 2005</span>     <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_NO)</div>
+<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>     {</div>
+<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>         <a class="code" href="group__fors__photometry.html#ga104fe70d8a535ae244e71f6b16dcaf5d" title="Check input value and its error to stay in a range.">fors_photometry_check_input_value</a>(  phot_input.ext,</div>
+<div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>                                             phot_input.dext,</div>
+<div class="line"><a name="l02009"></a><span class="lineno"> 2009</span>                                             <span class="stringliteral">"atmospheric extinction"</span>,</div>
+<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>                                             NULL<span class="comment">/*"photometry table"*/</span>,</div>
+<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>                                             0,  <span class="comment">/* min limit */</span></div>
+<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>                                             5,  <span class="comment">/* max limit */</span></div>
+<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>                                             1); <span class="comment">/* max error */</span></div>
+<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>     }</div>
+<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>     <span class="keywordflow">if</span> (!fit_z)</div>
+<div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>     {</div>
+<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>         <a class="code" href="group__fors__photometry.html#ga104fe70d8a535ae244e71f6b16dcaf5d" title="Check input value and its error to stay in a range.">fors_photometry_check_input_value</a>(  phot_input.zpoint,</div>
+<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>                                             phot_input.dzpoint,</div>
+<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>                                             <span class="stringliteral">"zeropoint"</span>,</div>
+<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>                                             NULL<span class="comment">/*"photometry table"*/</span>,</div>
+<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>                                             0,  <span class="comment">/* min limit */</span></div>
+<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>                                             50, <span class="comment">/* max limit */</span></div>
+<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>                                             1); <span class="comment">/* max error */</span></div>
+<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>     }</div>
+<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>     </div>
+<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>     <span class="comment">/* Read input observation table */</span></div>
+<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>     <span class="keywordtype">int</span>                 n_mag_fits,</div>
+<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>                         n_frames;</div>
+<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>     int                 (*get_atm_ext_id_func)(<span class="keyword">const</span> cpl_propertylist*);</div>
+<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span>     </div>
+<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span>     cpl_msg_info(                           cpl_func,</div>
+<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>                                             <span class="stringliteral">"Importing %s tables:"</span>,</div>
+<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>                                             ALIGNED_PHOT);</div>
+<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>     </div>
+<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span>     <span class="keywordflow">switch</span> (fit_e)</div>
+<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>     {</div>
+<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>         <span class="keywordflow">case</span> FORS_FIT_NCOEFF_PERNIGHT:</div>
+<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>             get_atm_ext_id_func = <a class="code" href="group__fors__photometry.html#gaf800d130ebeddcf3e8a655cf0c305f47" title="Get a unique identifier for the night of the observation.">fors_photometry_get_night_id</a>;</div>
+<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>         <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span>             get_atm_ext_id_func = NULL;</div>
+<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>     }</div>
+<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>     </div>
+<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>     obs = <a class="code" href="group__fors__photometry.html#gabe32026b38c8d511f76b7f1008941f71" title="Read input data from aligned phot tables.">fors_photometry_read_input</a>(       aligned_phot_frames,</div>
+<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span>                                             setting,</div>
+<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>                                             get_atm_ext_id_func,</div>
+<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>                                             use_all,</div>
+<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>                                             &n_frames,</div>
+<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>                                             &std_star_list,</div>
+<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>                                             degreef1 < 1);</div>
+<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);</div>
+<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>     </div>
+<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>     fors_photometry_adjust_fit_mag_flags(   std_star_list,</div>
+<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>                                             obs,</div>
+<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>                                             override_fit_m,</div>
+<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>                                             &n_mag_fits);</div>
+<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);</div>
+<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>     </div>
+<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span>     <a class="code" href="group__fors__photometry.html#gafecdbeccb909ad2d152a857cfd10c2c0" title="Create all atmospheric extinction indices.">fors_photometry_atm_ext_create_indices</a>( obs,</div>
+<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>                                             fit_e);</div>
+<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span>     </div>
+<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>     <span class="keywordflow">if</span> (fit_e != FORS_FIT_NCOEFF_NO && fit_e != FORS_FIT_NCOEFF_ONE)</div>
+<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>     {</div>
+<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span>         summary = <a class="code" href="group__fors__photometry.html#gaadcf6d1ce33dbed7ae0cbd24d675562f" title="Print the frame filenames for each atm. ext. index.">fors_photometry_atm_ext_print_index_by_framename</a>(</div>
+<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>                                             obs,</div>
+<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>                                             aligned_phot_frames);</div>
+<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Internal error"</span> );</div>
+<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span>     }</div>
+<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>     </div>
+<div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>     <a class="code" href="group__fors__photometry.html#ga6e8831942438a88bb3287ed491961ec1" title="Remove all standard stars which are fitted but were observed only once.">fors_photometry_remove_unnecessary</a>(     std_star_list,</div>
+<div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>                                             obs,</div>
+<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>                                             &n_mag_fits);</div>
+<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);</div>
+<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>     </div>
+<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>     <a class="code" href="group__fors__photometry.html#ga750adc75acb9310f8dde5fb067a356e9" title="Check whether fitting is possible (see below).">fors_photometry_check_fitparam_atm_ext</a>(obs, fit_e, fit_z);</div>
+<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);</div>
+<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>     </div>
+<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>     <a class="code" href="group__fors__photometry.html#gaf8c135834cc51bd767a6956346885958" title="Print list.">entry_list_print</a>(obs, CPL_MSG_DEBUG);</div>
+<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span> </div>
+<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>     {</div>
+<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>         <span class="keywordtype">int</span> ntot,</div>
+<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>             n_std_stars;</div>
+<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>         ntot = entry_list_size(obs);</div>
+<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>         n_std_stars = fors_std_star_list_size(std_star_list);</div>
+<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>         </div>
+<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>         cpl_msg_info(cpl_func, </div>
+<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>                      <span class="stringliteral">"Found %d table%s, %d star%s, %d unique star%s, "</span></div>
+<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>                      <span class="stringliteral">"%d magnitude%s to determine"</span>,</div>
+<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>                      n_frames,      n_frames != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>                      ntot,          ntot != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>, </div>
+<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>                      n_std_stars,   n_std_stars != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>                      n_mag_fits,    n_mag_fits != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>     }</div>
+<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span> </div>
+<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>     <span class="comment">/* Build equation system */</span></div>
+<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>     <span class="keywordtype">int</span>         n_coeff_polyf = 0,</div>
+<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>                 n_coeff_polyp = 0,</div>
+<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>                 n_coeff_params = 0,</div>
+<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>                 n_coeff_params_ext = 0;</div>
+<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&eqn_lhs);</div>
+<div class="line"><a name="l02109"></a><span class="lineno"> 2109</span>     </div>
+<div class="line"><a name="l02110"></a><span class="lineno"> 2110</span>     polyf_definition = <a class="code" href="group__fors__photometry.html#gaa9757bbaea210d70edf5874682ec6660" title="Create a polynomial containing the desired coefficients (set to 1).">fors_photometry_define_polyf</a>(</div>
+<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>                                             degreef1,</div>
+<div class="line"><a name="l02112"></a><span class="lineno"> 2112</span>                                             degreef2);</div>
+<div class="line"><a name="l02113"></a><span class="lineno"> 2113</span>     polyp_definition = <a class="code" href="group__fors__photometry.html#ga8d413c86621fd2b2e37b6174e935d082" title="Create a 2-dim polynomial with the desired coefficients (set to 1).">fors_photometry_define_polyp</a>(</div>
+<div class="line"><a name="l02114"></a><span class="lineno"> 2114</span>                                             degreep);</div>
+<div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);</div>
+<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span>     </div>
+<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span>     <span class="comment">/* Left hand side */</span></div>
+<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>     tmp_mat = <a class="code" href="group__fors__photometry.html#ga43e3c1d13157092f683e6d4912cd71d2" title="Build polynomial fitting matrix with coefficients represented in columns.">build_equations_lhs_matrix_from_poly</a>(</div>
+<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>                                             obs,</div>
+<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>                                             polyf_definition,</div>
+<div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>                                             <span class="stringliteral">"f"</span>,</div>
+<div class="line"><a name="l02122"></a><span class="lineno"> 2122</span>                                             &entry_get_powers_x_y);</div>
+<div class="line"><a name="l02123"></a><span class="lineno"> 2123</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);</div>
+<div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>     <span class="keywordflow">if</span> (tmp_mat != NULL) n_coeff_polyf = cpl_matrix_get_ncol(tmp_mat);</div>
+<div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>     fors_matrix_append_delete(&eqn_lhs, &tmp_mat);</div>
+<div class="line"><a name="l02126"></a><span class="lineno"> 2126</span>     </div>
+<div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>     tmp_mat = <a class="code" href="group__fors__photometry.html#gabfcabff5102d27ba7b09e4398e057762" title="Build left hand side matrix equation part.">build_equations_lhs_matrix_from_parameters</a>(</div>
+<div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>                                             obs,</div>
+<div class="line"><a name="l02129"></a><span class="lineno"> 2129</span>                                             std_star_list,</div>
+<div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>                                             fit_z,</div>
+<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>                                             fit_c,</div>
+<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>                                             &n_coeff_params_ext);</div>
+<div class="line"><a name="l02133"></a><span class="lineno"> 2133</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);</div>
+<div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>     <span class="keywordflow">if</span> (tmp_mat != NULL) n_coeff_params = cpl_matrix_get_ncol(tmp_mat);</div>
+<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>     fors_matrix_append_delete(&eqn_lhs, &tmp_mat);</div>
+<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>     </div>
+<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>     tmp_mat = <a class="code" href="group__fors__photometry.html#ga43e3c1d13157092f683e6d4912cd71d2" title="Build polynomial fitting matrix with coefficients represented in columns.">build_equations_lhs_matrix_from_poly</a>(</div>
+<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>                                             obs,</div>
+<div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>                                             polyp_definition,</div>
+<div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>                                             <span class="stringliteral">"p"</span>,</div>
+<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>                                             &entry_get_powers_airmass_color);</div>
+<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span>, NULL);</div>
+<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>     <span class="keywordflow">if</span> (tmp_mat != NULL) n_coeff_polyp = cpl_matrix_get_ncol(tmp_mat);</div>
+<div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>     fors_matrix_append_delete(&eqn_lhs, &tmp_mat);</div>
+<div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>     </div>
+<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>     <span class="comment">/* Right hand side */</span></div>
+<div class="line"><a name="l02147"></a><span class="lineno"> 2147</span>     <a class="code" href="group__fors__photometry.html#ga5e4afe6326f0bb9c748fed2286c8c835" title="Build right hand side matrix equation part.">build_equations_rhs_cov</a>(                obs,</div>
+<div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>                                             std_star_list,</div>
+<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>                                             fit_z,</div>
+<div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>                                             fit_c,</div>
+<div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>                                             (n_coeff_params_ext > 0),<span class="comment">/* fit_e */</span></div>
+<div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>                                             phot_input.color_coeff,</div>
+<div class="line"><a name="l02153"></a><span class="lineno"> 2153</span>                                             phot_input.dcolor_coeff,</div>
+<div class="line"><a name="l02154"></a><span class="lineno"> 2154</span>                                             phot_input.ext,</div>
+<div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>                                             phot_input.dext,</div>
+<div class="line"><a name="l02156"></a><span class="lineno"> 2156</span>                                             phot_input.zpoint,</div>
+<div class="line"><a name="l02157"></a><span class="lineno"> 2157</span>                                             phot_input.dzpoint,</div>
+<div class="line"><a name="l02158"></a><span class="lineno"> 2158</span>                                             &eqn_rhs,</div>
+<div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>                                             &eqn_cov_rhs);</div>
+<div class="line"><a name="l02160"></a><span class="lineno"> 2160</span>     <span class="comment">/*cpl_msg_info(cpl_func, "lhs");</span></div>
+<div class="line"><a name="l02161"></a><span class="lineno"> 2161</span> <span class="comment">    cpl_matrix_dump(eqn_lhs, stdout);</span></div>
+<div class="line"><a name="l02162"></a><span class="lineno"> 2162</span> <span class="comment">    cpl_msg_info(cpl_func, "rhs");</span></div>
+<div class="line"><a name="l02163"></a><span class="lineno"> 2163</span> <span class="comment">    cpl_matrix_dump(eqn_rhs, stdout);</span></div>
+<div class="line"><a name="l02164"></a><span class="lineno"> 2164</span> <span class="comment">    cpl_msg_info(cpl_func, "cov_rhs");</span></div>
+<div class="line"><a name="l02165"></a><span class="lineno"> 2165</span> <span class="comment">    cpl_matrix_dump(eqn_cov_rhs, stdout);*/</span></div>
+<div class="line"><a name="l02166"></a><span class="lineno"> 2166</span>     </div>
+<div class="line"><a name="l02167"></a><span class="lineno"> 2167</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not setup rhs equations"</span> );</div>
+<div class="line"><a name="l02168"></a><span class="lineno"> 2168</span>     </div>
+<div class="line"><a name="l02169"></a><span class="lineno"> 2169</span>     <span class="keywordtype">int</span> n_parameters = cpl_matrix_get_ncol(eqn_lhs);</div>
+<div class="line"><a name="l02170"></a><span class="lineno"> 2170</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&tmp_mat);</div>
+<div class="line"><a name="l02171"></a><span class="lineno"> 2171</span>     </div>
+<div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l02173"></a><span class="lineno"> 2173</span>     <span class="comment">/* Solve the equation system */</span></div>
+<div class="line"><a name="l02174"></a><span class="lineno"> 2174</span>     {</div>
+<div class="line"><a name="l02175"></a><span class="lineno"> 2175</span>         <span class="keywordtype">int</span> eqn_nrows = cpl_matrix_get_nrow(eqn_lhs);</div>
+<div class="line"><a name="l02176"></a><span class="lineno"> 2176</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Solving %d equation%s for %d parameter%s"</span>,</div>
+<div class="line"><a name="l02177"></a><span class="lineno"> 2177</span>                      eqn_nrows,  eqn_nrows != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l02178"></a><span class="lineno"> 2178</span>                      n_parameters, n_parameters != 1 ? <span class="stringliteral">"s"</span> : <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l02179"></a><span class="lineno"> 2179</span>     }</div>
+<div class="line"><a name="l02180"></a><span class="lineno"> 2180</span> </div>
+<div class="line"><a name="l02181"></a><span class="lineno"> 2181</span>     <span class="comment">/* Solve this overdetermined set of equations in the least chi squared</span></div>
+<div class="line"><a name="l02182"></a><span class="lineno"> 2182</span> <span class="comment">       sense using Cholesky-decomposition, output matrix</span></div>
+<div class="line"><a name="l02183"></a><span class="lineno"> 2183</span> <span class="comment">       is the solution vector (1st column) and the covariance matrix</span></div>
+<div class="line"><a name="l02184"></a><span class="lineno"> 2184</span> <span class="comment">       in the remaining columns.</span></div>
+<div class="line"><a name="l02185"></a><span class="lineno"> 2185</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l02186"></a><span class="lineno"> 2186</span>     <span class="keywordtype">double</span> red_chisq;</div>
+<div class="line"><a name="l02187"></a><span class="lineno"> 2187</span>     eqn_result = solve_normal(              eqn_lhs,</div>
+<div class="line"><a name="l02188"></a><span class="lineno"> 2188</span>                                             eqn_rhs,</div>
+<div class="line"><a name="l02189"></a><span class="lineno"> 2189</span>                                             eqn_cov_rhs,</div>
+<div class="line"><a name="l02190"></a><span class="lineno"> 2190</span>                                             &red_chisq);</div>
+<div class="line"><a name="l02191"></a><span class="lineno"> 2191</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&eqn_lhs);</div>
+<div class="line"><a name="l02192"></a><span class="lineno"> 2192</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&eqn_rhs);</div>
+<div class="line"><a name="l02193"></a><span class="lineno"> 2193</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&eqn_cov_rhs);</div>
+<div class="line"><a name="l02194"></a><span class="lineno"> 2194</span> </div>
+<div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not solve equation system"</span>);</div>
+<div class="line"><a name="l02196"></a><span class="lineno"> 2196</span> </div>
+<div class="line"><a name="l02197"></a><span class="lineno"> 2197</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>     <span class="comment">/* Extract the partial results, propagate polynomial error */</span></div>
+<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>     </div>
+<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>     <span class="comment">/* Print solution, convert to CPL polynomial */</span></div>
+<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>     <span class="keywordtype">int</span> offset = 0;</div>
+<div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>     {</div>
+<div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>         <span class="keywordtype">int</span> size = n_coeff_polyf;</div>
+<div class="line"><a name="l02204"></a><span class="lineno"> 2204</span>         <span class="keywordflow">if</span> (size > 0)</div>
+<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>         {</div>
+<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>             result_polyf = cpl_matrix_extract(</div>
+<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>                                             eqn_result,</div>
+<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>                                             offset, 0,</div>
+<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>                                             1, 1,</div>
+<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span>                                             size, 1);</div>
+<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>             result_cov_polyf = cpl_matrix_extract(</div>
+<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>                                             eqn_result,</div>
+<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>                                             offset, 1+offset,</div>
+<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>                                             1, 1,</div>
+<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>                                             size, size);</div>
+<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>             offset += size;</div>
+<div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>         }</div>
+<div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>     }</div>
+<div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>     {</div>
+<div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>         <span class="keywordtype">int</span> size = n_coeff_params;</div>
+<div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>         <span class="keywordflow">if</span> (size > 0)</div>
+<div class="line"><a name="l02222"></a><span class="lineno"> 2222</span>         {</div>
+<div class="line"><a name="l02223"></a><span class="lineno"> 2223</span>             result_params = cpl_matrix_extract(</div>
+<div class="line"><a name="l02224"></a><span class="lineno"> 2224</span>                                             eqn_result,</div>
+<div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>                                             offset, 0,</div>
+<div class="line"><a name="l02226"></a><span class="lineno"> 2226</span>                                             1, 1,</div>
+<div class="line"><a name="l02227"></a><span class="lineno"> 2227</span>                                             size, 1);</div>
+<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>             result_cov_params = cpl_matrix_extract(</div>
+<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>                                             eqn_result,</div>
+<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>                                             offset, 1+offset,</div>
+<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>                                             1, 1,</div>
+<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>                                             size, size);</div>
+<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span>         }</div>
+<div class="line"><a name="l02234"></a><span class="lineno"> 2234</span>         offset += size;</div>
+<div class="line"><a name="l02235"></a><span class="lineno"> 2235</span>     }</div>
+<div class="line"><a name="l02236"></a><span class="lineno"> 2236</span>     {</div>
+<div class="line"><a name="l02237"></a><span class="lineno"> 2237</span>         <span class="keywordtype">int</span> size = n_coeff_polyp;</div>
+<div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>         <span class="keywordflow">if</span> (size > 0)</div>
+<div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>         {</div>
+<div class="line"><a name="l02240"></a><span class="lineno"> 2240</span>             result_polyp = cpl_matrix_extract(</div>
+<div class="line"><a name="l02241"></a><span class="lineno"> 2241</span>                                             eqn_result,</div>
+<div class="line"><a name="l02242"></a><span class="lineno"> 2242</span>                                             offset, 0,</div>
+<div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>                                             1, 1,</div>
+<div class="line"><a name="l02244"></a><span class="lineno"> 2244</span>                                             size, 1);</div>
+<div class="line"><a name="l02245"></a><span class="lineno"> 2245</span>             result_cov_polyp = cpl_matrix_extract(eqn_result,</div>
+<div class="line"><a name="l02246"></a><span class="lineno"> 2246</span>                                             offset, 1+offset,</div>
+<div class="line"><a name="l02247"></a><span class="lineno"> 2247</span>                                             1, 1,</div>
+<div class="line"><a name="l02248"></a><span class="lineno"> 2248</span>                                             size, size);</div>
+<div class="line"><a name="l02249"></a><span class="lineno"> 2249</span>         }</div>
+<div class="line"><a name="l02250"></a><span class="lineno"> 2250</span>         offset += size;</div>
+<div class="line"><a name="l02251"></a><span class="lineno"> 2251</span>     }</div>
+<div class="line"><a name="l02252"></a><span class="lineno"> 2252</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02253"></a><span class="lineno"> 2253</span>     </div>
+<div class="line"><a name="l02254"></a><span class="lineno"> 2254</span>     <a class="code" href="group__fors__photometry.html#ga07a5f25084d3a57c92743262a41e0366" title="Create a polynomial from a definition and a coefficients container.">fors_photometry_poly_new_from_coefficients</a>(</div>
+<div class="line"><a name="l02255"></a><span class="lineno"> 2255</span>                                             polyf_definition,</div>
+<div class="line"><a name="l02256"></a><span class="lineno"> 2256</span>                                             result_polyf,   <span class="comment">/* NULL if f empty*/</span></div>
+<div class="line"><a name="l02257"></a><span class="lineno"> 2257</span>                                             result_cov_polyf,<span class="comment">/* NULL if f emp.*/</span></div>
+<div class="line"><a name="l02258"></a><span class="lineno"> 2258</span>                                             &polyf,</div>
+<div class="line"><a name="l02259"></a><span class="lineno"> 2259</span>                                             &polyf_variance);</div>
+<div class="line"><a name="l02260"></a><span class="lineno"> 2260</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02261"></a><span class="lineno"> 2261</span>     <a class="code" href="group__fors__photometry.html#ga07a5f25084d3a57c92743262a41e0366" title="Create a polynomial from a definition and a coefficients container.">fors_photometry_poly_new_from_coefficients</a>(</div>
+<div class="line"><a name="l02262"></a><span class="lineno"> 2262</span>                                             polyp_definition,</div>
+<div class="line"><a name="l02263"></a><span class="lineno"> 2263</span>                                             result_polyp,   <span class="comment">/* NULL if p empty*/</span></div>
+<div class="line"><a name="l02264"></a><span class="lineno"> 2264</span>                                             NULL,<span class="comment">/* NULL if p emp.*/</span></div>
+<div class="line"><a name="l02265"></a><span class="lineno"> 2265</span>                                             &polyp,</div>
+<div class="line"><a name="l02266"></a><span class="lineno"> 2266</span>                                             NULL);</div>
+<div class="line"><a name="l02267"></a><span class="lineno"> 2267</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02268"></a><span class="lineno"> 2268</span>     </div>
+<div class="line"><a name="l02269"></a><span class="lineno"> 2269</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l02270"></a><span class="lineno"> 2270</span>     <a class="code" href="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981" title="Count the total number of non-zero coefficients.">fors_polynomial_dump</a>(polyf, <span class="stringliteral">"f"</span>, CPL_MSG_INFO, polyf_definition);</div>
+<div class="line"><a name="l02271"></a><span class="lineno"> 2271</span>     <a class="code" href="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981" title="Count the total number of non-zero coefficients.">fors_polynomial_dump</a>(polyp, <span class="stringliteral">"p"</span>, CPL_MSG_INFO, polyp_definition);</div>
+<div class="line"><a name="l02272"></a><span class="lineno"> 2272</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l02273"></a><span class="lineno"> 2273</span>     </div>
+<div class="line"><a name="l02274"></a><span class="lineno"> 2274</span>     {</div>
+<div class="line"><a name="l02275"></a><span class="lineno"> 2275</span>         <span class="comment">/* magnitudes */</span></div>
+<div class="line"><a name="l02276"></a><span class="lineno"> 2276</span>         <span class="keywordtype">int</span>                 k,</div>
+<div class="line"><a name="l02277"></a><span class="lineno"> 2277</span>                             i = 0;</div>
+<div class="line"><a name="l02278"></a><span class="lineno"> 2278</span>         <span class="keyword">const</span> fors_std_star *std;</div>
+<div class="line"><a name="l02279"></a><span class="lineno"> 2279</span>         </div>
+<div class="line"><a name="l02280"></a><span class="lineno"> 2280</span>         <span class="comment">/* count observations of std star objects */</span></div>
+<div class="line"><a name="l02281"></a><span class="lineno"> 2281</span>         n_std_star_obs = <a class="code" href="group__fors__photometry.html#ga182915aa06bfd142318b3c9443a80e80" title="Count the number of observations of each standard star.">fors_photometry_count_observations</a>(</div>
+<div class="line"><a name="l02282"></a><span class="lineno"> 2282</span>                                             std_star_list,</div>
+<div class="line"><a name="l02283"></a><span class="lineno"> 2283</span>                                             obs);</div>
+<div class="line"><a name="l02284"></a><span class="lineno"> 2284</span>         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02285"></a><span class="lineno"> 2285</span>         </div>
+<div class="line"><a name="l02286"></a><span class="lineno"> 2286</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l02287"></a><span class="lineno"> 2287</span>         <span class="keywordflow">for</span> (   std = fors_std_star_list_first_const(std_star_list), k = 0;</div>
+<div class="line"><a name="l02288"></a><span class="lineno"> 2288</span>                 std != NULL;</div>
+<div class="line"><a name="l02289"></a><span class="lineno"> 2289</span>                 std = fors_std_star_list_next_const(std_star_list), k++)</div>
+<div class="line"><a name="l02290"></a><span class="lineno"> 2290</span>         {</div>
+<div class="line"><a name="l02291"></a><span class="lineno"> 2291</span>             <span class="keywordflow">if</span> (std->trusted)   <span class="comment">/* !(fit magnitude) */</span></div>
+<div class="line"><a name="l02292"></a><span class="lineno"> 2292</span>             {</div>
+<div class="line"><a name="l02293"></a><span class="lineno"> 2293</span>                 cpl_msg_info(cpl_func, <span class="stringliteral">"M%d = %f +- %f mag (fixed, %s, %d obs)"</span>,</div>
+<div class="line"><a name="l02294"></a><span class="lineno"> 2294</span>                              k,</div>
+<div class="line"><a name="l02295"></a><span class="lineno"> 2295</span>                              std->magnitude,</div>
+<div class="line"><a name="l02296"></a><span class="lineno"> 2296</span>                              std->dmagnitude,</div>
+<div class="line"><a name="l02297"></a><span class="lineno"> 2297</span>                              std->name,</div>
+<div class="line"><a name="l02298"></a><span class="lineno"> 2298</span>                              cpl_array_get_int(n_std_star_obs, k, NULL));</div>
+<div class="line"><a name="l02299"></a><span class="lineno"> 2299</span>             }</div>
+<div class="line"><a name="l02300"></a><span class="lineno"> 2300</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02301"></a><span class="lineno"> 2301</span>                 cpl_msg_info(cpl_func, <span class="stringliteral">"M%d = %f +- %f mag (free, %s, %d obs)"</span>,</div>
+<div class="line"><a name="l02302"></a><span class="lineno"> 2302</span>                              k,</div>
+<div class="line"><a name="l02303"></a><span class="lineno"> 2303</span>                              cpl_matrix_get(result_params, i, 0),</div>
+<div class="line"><a name="l02304"></a><span class="lineno"> 2304</span>                              sqrt(cpl_matrix_get(result_cov_params, i, i)),</div>
+<div class="line"><a name="l02305"></a><span class="lineno"> 2305</span>                              std->name,</div>
+<div class="line"><a name="l02306"></a><span class="lineno"> 2306</span>                              cpl_array_get_int(n_std_star_obs, k, NULL));</div>
+<div class="line"><a name="l02307"></a><span class="lineno"> 2307</span>                 i++;</div>
+<div class="line"><a name="l02308"></a><span class="lineno"> 2308</span>             }</div>
+<div class="line"><a name="l02309"></a><span class="lineno"> 2309</span>         }</div>
+<div class="line"><a name="l02310"></a><span class="lineno"> 2310</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l02311"></a><span class="lineno"> 2311</span>         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02312"></a><span class="lineno"> 2312</span>         </div>
+<div class="line"><a name="l02313"></a><span class="lineno"> 2313</span>         cpl_array_delete(n_std_star_obs); n_std_star_obs = NULL;</div>
+<div class="line"><a name="l02314"></a><span class="lineno"> 2314</span>         fors_std_star_list_delete(&std_star_list, fors_std_star_delete);</div>
+<div class="line"><a name="l02315"></a><span class="lineno"> 2315</span>         entry_list_delete(&obs, <a class="code" href="group__fors__photometry.html#ga24e72dc7095e56d37033c584bd279f13" title="Destructor.">entry_delete_but_standard</a>); obs = NULL;</div>
+<div class="line"><a name="l02316"></a><span class="lineno"> 2316</span> </div>
+<div class="line"><a name="l02317"></a><span class="lineno"> 2317</span>         <span class="comment">/* zeropoint */</span></div>
+<div class="line"><a name="l02318"></a><span class="lineno"> 2318</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l02319"></a><span class="lineno"> 2319</span>         <span class="keywordflow">if</span> (fit_z)</div>
+<div class="line"><a name="l02320"></a><span class="lineno"> 2320</span>         {</div>
+<div class="line"><a name="l02321"></a><span class="lineno"> 2321</span>             qc_zeropoint = cpl_matrix_get(result_params, i, 0);</div>
+<div class="line"><a name="l02322"></a><span class="lineno"> 2322</span>             qc_zeropoint_err = sqrt(cpl_matrix_get(result_cov_params, i, i));</div>
+<div class="line"><a name="l02323"></a><span class="lineno"> 2323</span>             cpl_msg_info(cpl_func, <span class="stringliteral">"Z = %f +- %f mag"</span>,</div>
+<div class="line"><a name="l02324"></a><span class="lineno"> 2324</span>                          qc_zeropoint,</div>
+<div class="line"><a name="l02325"></a><span class="lineno"> 2325</span>                          qc_zeropoint_err);</div>
+<div class="line"><a name="l02326"></a><span class="lineno"> 2326</span>             i++;</div>
+<div class="line"><a name="l02327"></a><span class="lineno"> 2327</span>         }</div>
+<div class="line"><a name="l02328"></a><span class="lineno"> 2328</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l02329"></a><span class="lineno"> 2329</span>         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02330"></a><span class="lineno"> 2330</span>         </div>
+<div class="line"><a name="l02331"></a><span class="lineno"> 2331</span>         <span class="comment">/* extinction */</span></div>
+<div class="line"><a name="l02332"></a><span class="lineno"> 2332</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l02333"></a><span class="lineno"> 2333</span>         <span class="keywordflow">if</span> (n_coeff_params_ext > 0)</div>
+<div class="line"><a name="l02334"></a><span class="lineno"> 2334</span>         {</div>
+<div class="line"><a name="l02335"></a><span class="lineno"> 2335</span>             qc_extinction = cpl_matrix_get(result_params, i, 0);</div>
+<div class="line"><a name="l02336"></a><span class="lineno"> 2336</span>             qc_extinction_err = sqrt(cpl_matrix_get(result_cov_params, i, i));</div>
+<div class="line"><a name="l02337"></a><span class="lineno"> 2337</span>             <span class="keywordflow">if</span> (n_coeff_params_ext == 1)</div>
+<div class="line"><a name="l02338"></a><span class="lineno"> 2338</span>             {</div>
+<div class="line"><a name="l02339"></a><span class="lineno"> 2339</span>                 cpl_msg_info(cpl_func, <span class="stringliteral">"E = %f +- %f mag/airmass"</span>,</div>
+<div class="line"><a name="l02340"></a><span class="lineno"> 2340</span>                              qc_extinction,</div>
+<div class="line"><a name="l02341"></a><span class="lineno"> 2341</span>                              qc_extinction_err);</div>
+<div class="line"><a name="l02342"></a><span class="lineno"> 2342</span>                 i++;</div>
+<div class="line"><a name="l02343"></a><span class="lineno"> 2343</span>             }</div>
+<div class="line"><a name="l02344"></a><span class="lineno"> 2344</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l02345"></a><span class="lineno"> 2345</span>             {</div>
+<div class="line"><a name="l02346"></a><span class="lineno"> 2346</span>                 <span class="keywordflow">if</span> (summary) {</div>
+<div class="line"><a name="l02347"></a><span class="lineno"> 2347</span>                     cpl_table_new_column(summary, <span class="stringliteral">"EXT"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02348"></a><span class="lineno"> 2348</span>                     cpl_table_new_column(summary, <span class="stringliteral">"DEXT"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02349"></a><span class="lineno"> 2349</span>                     <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERFRAME) {</div>
+<div class="line"><a name="l02350"></a><span class="lineno"> 2350</span>                         cpl_table_new_column(summary, <span class="stringliteral">"MJD-OBS"</span>, </div>
+<div class="line"><a name="l02351"></a><span class="lineno"> 2351</span>                                              CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02352"></a><span class="lineno"> 2352</span>                     }</div>
+<div class="line"><a name="l02353"></a><span class="lineno"> 2353</span>                     <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERNIGHT) {</div>
+<div class="line"><a name="l02354"></a><span class="lineno"> 2354</span>                         cpl_table_new_column(summary, <span class="stringliteral">"MJD-NIGHT"</span>, </div>
+<div class="line"><a name="l02355"></a><span class="lineno"> 2355</span>                                              CPL_TYPE_INT);</div>
+<div class="line"><a name="l02356"></a><span class="lineno"> 2356</span>                     }</div>
+<div class="line"><a name="l02357"></a><span class="lineno"> 2357</span>                     </div>
+<div class="line"><a name="l02358"></a><span class="lineno"> 2358</span>                 }</div>
+<div class="line"><a name="l02359"></a><span class="lineno"> 2359</span> </div>
+<div class="line"><a name="l02360"></a><span class="lineno"> 2360</span>                 <span class="keywordflow">for</span> (k = 0; k < n_coeff_params_ext; k++)</div>
+<div class="line"><a name="l02361"></a><span class="lineno"> 2361</span>                 {</div>
+<div class="line"><a name="l02362"></a><span class="lineno"> 2362</span>                     <span class="keywordtype">double</span> ext  = cpl_matrix_get(result_params, i, 0);</div>
+<div class="line"><a name="l02363"></a><span class="lineno"> 2363</span>                     <span class="keywordtype">double</span> dext = sqrt(cpl_matrix_get(result_cov_params, i, i));</div>
+<div class="line"><a name="l02364"></a><span class="lineno"> 2364</span> </div>
+<div class="line"><a name="l02365"></a><span class="lineno"> 2365</span>                     cpl_msg_info(cpl_func, <span class="stringliteral">"E_%d = %f +- %f mag/airmass"</span>,</div>
+<div class="line"><a name="l02366"></a><span class="lineno"> 2366</span>                                  k, ext, dext);</div>
+<div class="line"><a name="l02367"></a><span class="lineno"> 2367</span> </div>
+<div class="line"><a name="l02368"></a><span class="lineno"> 2368</span>                     <span class="keywordflow">if</span> (summary) {</div>
+<div class="line"><a name="l02369"></a><span class="lineno"> 2369</span>                         cpl_table_select_all(summary);</div>
+<div class="line"><a name="l02370"></a><span class="lineno"> 2370</span>                         cpl_table_and_selected_int(summary, <span class="stringliteral">"index"</span>,</div>
+<div class="line"><a name="l02371"></a><span class="lineno"> 2371</span>                                                    CPL_EQUAL_TO, k);</div>
+<div class="line"><a name="l02372"></a><span class="lineno"> 2372</span>                         <span class="keywordflow">for</span> (row = 0; row < n_frames; row++) {</div>
+<div class="line"><a name="l02373"></a><span class="lineno"> 2373</span>                             <span class="keywordflow">if</span> (cpl_table_is_selected(summary, row)) {</div>
+<div class="line"><a name="l02374"></a><span class="lineno"> 2374</span>                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *filename =</div>
+<div class="line"><a name="l02375"></a><span class="lineno"> 2375</span>                                 cpl_table_get_string(summary, <span class="stringliteral">"filename"</span>, row);</div>
+<div class="line"><a name="l02376"></a><span class="lineno"> 2376</span>                                 cpl_propertylist *plist = </div>
+<div class="line"><a name="l02377"></a><span class="lineno"> 2377</span>                                 cpl_propertylist_load_regexp(filename, 0,</div>
+<div class="line"><a name="l02378"></a><span class="lineno"> 2378</span>                                                              <span class="stringliteral">"MJD-OBS|ORIGIN"</span>, </div>
+<div class="line"><a name="l02379"></a><span class="lineno"> 2379</span>                                                              0);</div>
+<div class="line"><a name="l02380"></a><span class="lineno"> 2380</span> </div>
+<div class="line"><a name="l02381"></a><span class="lineno"> 2381</span>                                 cpl_table_set_double(summary, </div>
+<div class="line"><a name="l02382"></a><span class="lineno"> 2382</span>                                                      <span class="stringliteral">"EXT"</span>, row, ext);</div>
+<div class="line"><a name="l02383"></a><span class="lineno"> 2383</span>                                 cpl_table_set_double(summary, </div>
+<div class="line"><a name="l02384"></a><span class="lineno"> 2384</span>                                                      <span class="stringliteral">"DEXT"</span>, row, dext);</div>
+<div class="line"><a name="l02385"></a><span class="lineno"> 2385</span>                                 <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERFRAME) {</div>
+<div class="line"><a name="l02386"></a><span class="lineno"> 2386</span>                                     cpl_table_set_double(summary, </div>
+<div class="line"><a name="l02387"></a><span class="lineno"> 2387</span>                                                          <span class="stringliteral">"MJD-OBS"</span>, row, </div>
+<div class="line"><a name="l02388"></a><span class="lineno"> 2388</span>                                        cpl_propertylist_get_double(plist, </div>
+<div class="line"><a name="l02389"></a><span class="lineno"> 2389</span>                                                                    <span class="stringliteral">"MJD-OBS"</span>));</div>
+<div class="line"><a name="l02390"></a><span class="lineno"> 2390</span>                                 }</div>
+<div class="line"><a name="l02391"></a><span class="lineno"> 2391</span>                                 <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERNIGHT) {</div>
+<div class="line"><a name="l02392"></a><span class="lineno"> 2392</span>                                     cpl_table_set_int(summary, <span class="stringliteral">"MJD-NIGHT"</span>, </div>
+<div class="line"><a name="l02393"></a><span class="lineno"> 2393</span>                                                       row, </div>
+<div class="line"><a name="l02394"></a><span class="lineno"> 2394</span>                                          <a class="code" href="group__fors__photometry.html#gaf800d130ebeddcf3e8a655cf0c305f47" title="Get a unique identifier for the night of the observation.">fors_photometry_get_night_id</a>(plist));</div>
+<div class="line"><a name="l02395"></a><span class="lineno"> 2395</span>                                 }</div>
+<div class="line"><a name="l02396"></a><span class="lineno"> 2396</span> </div>
+<div class="line"><a name="l02397"></a><span class="lineno"> 2397</span>                                 cpl_propertylist_delete(plist);</div>
+<div class="line"><a name="l02398"></a><span class="lineno"> 2398</span>                             }</div>
+<div class="line"><a name="l02399"></a><span class="lineno"> 2399</span>                         }</div>
+<div class="line"><a name="l02400"></a><span class="lineno"> 2400</span>                     }</div>
+<div class="line"><a name="l02401"></a><span class="lineno"> 2401</span> </div>
+<div class="line"><a name="l02402"></a><span class="lineno"> 2402</span>                     i++;</div>
+<div class="line"><a name="l02403"></a><span class="lineno"> 2403</span>                 }</div>
+<div class="line"><a name="l02404"></a><span class="lineno"> 2404</span>             }</div>
+<div class="line"><a name="l02405"></a><span class="lineno"> 2405</span>         }</div>
+<div class="line"><a name="l02406"></a><span class="lineno"> 2406</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l02407"></a><span class="lineno"> 2407</span>         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02408"></a><span class="lineno"> 2408</span> </div>
+<div class="line"><a name="l02409"></a><span class="lineno"> 2409</span>         <span class="keywordflow">if</span> (summary) {</div>
+<div class="line"><a name="l02410"></a><span class="lineno"> 2410</span>             cpl_table_select_all(summary);</div>
+<div class="line"><a name="l02411"></a><span class="lineno"> 2411</span>             cpl_table_erase_column(summary, <span class="stringliteral">"index"</span>);</div>
+<div class="line"><a name="l02412"></a><span class="lineno"> 2412</span>         }</div>
+<div class="line"><a name="l02413"></a><span class="lineno"> 2413</span> </div>
+<div class="line"><a name="l02414"></a><span class="lineno"> 2414</span>         <span class="comment">/* color */</span></div>
+<div class="line"><a name="l02415"></a><span class="lineno"> 2415</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l02416"></a><span class="lineno"> 2416</span>         <span class="keywordflow">if</span> (fit_c) {</div>
+<div class="line"><a name="l02417"></a><span class="lineno"> 2417</span>             <span class="comment">/* Note different sign convention. The values</span></div>
+<div class="line"><a name="l02418"></a><span class="lineno"> 2418</span> <span class="comment">               provided in PHOT_TABLEs are actually -c.</span></div>
+<div class="line"><a name="l02419"></a><span class="lineno"> 2419</span> <span class="comment">               As in fors_std_cat_load() </span></div>
+<div class="line"><a name="l02420"></a><span class="lineno"> 2420</span> <span class="comment">            */</span></div>
+<div class="line"><a name="l02421"></a><span class="lineno"> 2421</span>             qc_colorterm = cpl_matrix_get(result_params, i, 0);</div>
+<div class="line"><a name="l02422"></a><span class="lineno"> 2422</span>             qc_colorterm = -qc_colorterm;   <span class="comment">/* External convention */</span></div>
+<div class="line"><a name="l02423"></a><span class="lineno"> 2423</span>             qc_colorterm_err = sqrt(cpl_matrix_get(result_cov_params, i, i));</div>
+<div class="line"><a name="l02424"></a><span class="lineno"> 2424</span>             cpl_msg_info(cpl_func, <span class="stringliteral">"C_correction = %f +- %f"</span>,</div>
+<div class="line"><a name="l02425"></a><span class="lineno"> 2425</span>                          qc_colorterm, qc_colorterm_err);</div>
+<div class="line"><a name="l02426"></a><span class="lineno"> 2426</span>             i++;</div>
+<div class="line"><a name="l02427"></a><span class="lineno"> 2427</span>         }</div>
+<div class="line"><a name="l02428"></a><span class="lineno"> 2428</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l02429"></a><span class="lineno"> 2429</span>         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02430"></a><span class="lineno"> 2430</span> </div>
+<div class="line"><a name="l02431"></a><span class="lineno"> 2431</span>         <span class="comment">/* Abort if crazy values... */</span></div>
+<div class="line"><a name="l02432"></a><span class="lineno"> 2432</span>         <span class="keywordflow">if</span> (qc_zeropoint_err > 1.0) {</div>
+<div class="line"><a name="l02433"></a><span class="lineno"> 2433</span>             cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l02434"></a><span class="lineno"> 2434</span>                                   <span class="stringliteral">"Unreliable zeropoint!"</span>);</div>
+<div class="line"><a name="l02435"></a><span class="lineno"> 2435</span>             cleanup;</div>
+<div class="line"><a name="l02436"></a><span class="lineno"> 2436</span>             <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l02437"></a><span class="lineno"> 2437</span>         }</div>
+<div class="line"><a name="l02438"></a><span class="lineno"> 2438</span>         <span class="keywordflow">if</span> (qc_extinction_err > 1.0) {</div>
+<div class="line"><a name="l02439"></a><span class="lineno"> 2439</span>             cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l02440"></a><span class="lineno"> 2440</span>                                   <span class="stringliteral">"Unreliable atmospheric extinction!"</span>);</div>
+<div class="line"><a name="l02441"></a><span class="lineno"> 2441</span>             cleanup;</div>
+<div class="line"><a name="l02442"></a><span class="lineno"> 2442</span>             <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l02443"></a><span class="lineno"> 2443</span>         }</div>
+<div class="line"><a name="l02444"></a><span class="lineno"> 2444</span>         <span class="keywordflow">if</span> (qc_colorterm_err > 1.0) {</div>
+<div class="line"><a name="l02445"></a><span class="lineno"> 2445</span>             cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l02446"></a><span class="lineno"> 2446</span>                                   <span class="stringliteral">"Unreliable color correction term!"</span>);</div>
+<div class="line"><a name="l02447"></a><span class="lineno"> 2447</span>             cleanup;</div>
+<div class="line"><a name="l02448"></a><span class="lineno"> 2448</span>             <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l02449"></a><span class="lineno"> 2449</span>         }</div>
+<div class="line"><a name="l02450"></a><span class="lineno"> 2450</span>         <span class="keywordflow">if</span> (qc_extinction_err > 0.0 && qc_extinction <= 0.0) {</div>
+<div class="line"><a name="l02451"></a><span class="lineno"> 2451</span>             cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l02452"></a><span class="lineno"> 2452</span>                                   <span class="stringliteral">"Impossible atmospheric extinction!"</span>);</div>
+<div class="line"><a name="l02453"></a><span class="lineno"> 2453</span>             cleanup;</div>
+<div class="line"><a name="l02454"></a><span class="lineno"> 2454</span>             <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l02455"></a><span class="lineno"> 2455</span>         }</div>
+<div class="line"><a name="l02456"></a><span class="lineno"> 2456</span>         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02457"></a><span class="lineno"> 2457</span> </div>
+<div class="line"><a name="l02458"></a><span class="lineno"> 2458</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l02459"></a><span class="lineno"> 2459</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Reduced chi square = %f"</span>, red_chisq);</div>
+<div class="line"><a name="l02460"></a><span class="lineno"> 2460</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l02461"></a><span class="lineno"> 2461</span>     </div>
+<div class="line"><a name="l02462"></a><span class="lineno"> 2462</span>     }</div>
+<div class="line"><a name="l02463"></a><span class="lineno"> 2463</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02464"></a><span class="lineno"> 2464</span>     <span class="comment">/* Code checks:</span></div>
+<div class="line"><a name="l02465"></a><span class="lineno"> 2465</span> <span class="comment">     * - polynomials must exist (also if empty), they might be used later */</span></div>
+<div class="line"><a name="l02466"></a><span class="lineno"> 2466</span>     passure(polyf != NULL, <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02467"></a><span class="lineno"> 2467</span>     passure(polyp != NULL, <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02468"></a><span class="lineno"> 2468</span> </div>
+<div class="line"><a name="l02469"></a><span class="lineno"> 2469</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l02470"></a><span class="lineno"> 2470</span>     <span class="comment">/* Compute correction image, apply to master flat */</span></div>
+<div class="line"><a name="l02471"></a><span class="lineno"> 2471</span>     {</div>
+<div class="line"><a name="l02472"></a><span class="lineno"> 2472</span>         <span class="keywordtype">int</span> nx,</div>
+<div class="line"><a name="l02473"></a><span class="lineno"> 2473</span>             ny;</div>
+<div class="line"><a name="l02474"></a><span class="lineno"> 2474</span>         </div>
+<div class="line"><a name="l02475"></a><span class="lineno"> 2475</span>         master_flat = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(      cpl_frameset_get_first_const(</div>
+<div class="line"><a name="l02476"></a><span class="lineno"> 2476</span>                                                 master_flat_frame),</div>
+<div class="line"><a name="l02477"></a><span class="lineno"> 2477</span>                                             NULL, setting, NULL);</div>
+<div class="line"><a name="l02478"></a><span class="lineno"> 2478</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load master flat"</span>);</div>
+<div class="line"><a name="l02479"></a><span class="lineno"> 2479</span>         </div>
+<div class="line"><a name="l02480"></a><span class="lineno"> 2480</span>         nx = <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(master_flat);</div>
+<div class="line"><a name="l02481"></a><span class="lineno"> 2481</span>         ny = <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(master_flat);</div>
+<div class="line"><a name="l02482"></a><span class="lineno"> 2482</span>         cpl_image *correction_map   = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l02483"></a><span class="lineno"> 2483</span>         cpl_image *correction_map_v = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l02484"></a><span class="lineno"> 2484</span>         </div>
+<div class="line"><a name="l02485"></a><span class="lineno"> 2485</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Creating correction map (magnitude)"</span>);</div>
+<div class="line"><a name="l02486"></a><span class="lineno"> 2486</span>         cpl_image_fill_polynomial(correction_map, polyf,</div>
+<div class="line"><a name="l02487"></a><span class="lineno"> 2487</span>                                   1.0, 1.0, 1.0, 1.0);</div>
+<div class="line"><a name="l02488"></a><span class="lineno"> 2488</span>         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02489"></a><span class="lineno"> 2489</span>         cpl_image_fill_polynomial(correction_map_v, polyf_variance,</div>
+<div class="line"><a name="l02490"></a><span class="lineno"> 2490</span>                                   1.0, 1.0, 1.0, 1.0);</div>
+<div class="line"><a name="l02491"></a><span class="lineno"> 2491</span>         passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02492"></a><span class="lineno"> 2492</span>         </div>
+<div class="line"><a name="l02493"></a><span class="lineno"> 2493</span>         correction = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(correction_map, correction_map_v);</div>
+<div class="line"><a name="l02494"></a><span class="lineno"> 2494</span>     }</div>
+<div class="line"><a name="l02495"></a><span class="lineno"> 2495</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02496"></a><span class="lineno"> 2496</span>     </div>
+<div class="line"><a name="l02497"></a><span class="lineno"> 2497</span>     cpl_polynomial_delete(polyf); polyf = NULL;</div>
+<div class="line"><a name="l02498"></a><span class="lineno"> 2498</span>     cpl_polynomial_delete(polyf_variance); polyf_variance = NULL;</div>
+<div class="line"><a name="l02499"></a><span class="lineno"> 2499</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&eqn_result);</div>
+<div class="line"><a name="l02500"></a><span class="lineno"> 2500</span> </div>
+<div class="line"><a name="l02501"></a><span class="lineno"> 2501</span>     <span class="keywordflow">if</span> (qc_zeropoint_err > 0.0 ||</div>
+<div class="line"><a name="l02502"></a><span class="lineno"> 2502</span>         qc_extinction_err > 0.0 ||</div>
+<div class="line"><a name="l02503"></a><span class="lineno"> 2503</span>         qc_colorterm_err > 0.0) {</div>
+<div class="line"><a name="l02504"></a><span class="lineno"> 2504</span> </div>
+<div class="line"><a name="l02505"></a><span class="lineno"> 2505</span>         phot_coeff = fors_phot_coeff_create(setting,</div>
+<div class="line"><a name="l02506"></a><span class="lineno"> 2506</span>                                             qc_colorterm,</div>
+<div class="line"><a name="l02507"></a><span class="lineno"> 2507</span>                                             qc_colorterm_err,</div>
+<div class="line"><a name="l02508"></a><span class="lineno"> 2508</span>                                             qc_extinction,</div>
+<div class="line"><a name="l02509"></a><span class="lineno"> 2509</span>                                             qc_extinction_err,</div>
+<div class="line"><a name="l02510"></a><span class="lineno"> 2510</span>                                             qc_zeropoint,</div>
+<div class="line"><a name="l02511"></a><span class="lineno"> 2511</span>                                             qc_zeropoint_err);</div>
+<div class="line"><a name="l02512"></a><span class="lineno"> 2512</span> </div>
+<div class="line"><a name="l02513"></a><span class="lineno"> 2513</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02514"></a><span class="lineno"> 2514</span> <span class="comment">         * Write QCs</span></div>
+<div class="line"><a name="l02515"></a><span class="lineno"> 2515</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02516"></a><span class="lineno"> 2516</span> </div>
+<div class="line"><a name="l02517"></a><span class="lineno"> 2517</span>         qc = cpl_propertylist_new();</div>
+<div class="line"><a name="l02518"></a><span class="lineno"> 2518</span> </div>
+<div class="line"><a name="l02519"></a><span class="lineno"> 2519</span>         <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qc, fors_qc_dic_version, setting->instrument);</div>
+<div class="line"><a name="l02520"></a><span class="lineno"> 2520</span> </div>
+<div class="line"><a name="l02521"></a><span class="lineno"> 2521</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l02522"></a><span class="lineno"> 2522</span> <span class="comment">    fors_qc_write_group_heading(cpl_frameset_get_first_const(master_flat_frame),</span></div>
+<div class="line"><a name="l02523"></a><span class="lineno"> 2523</span> <span class="comment">                                CORRECTION_MAP,</span></div>
+<div class="line"><a name="l02524"></a><span class="lineno"> 2524</span> <span class="comment">                                setting->instrument);</span></div>
+<div class="line"><a name="l02525"></a><span class="lineno"> 2525</span> <span class="comment">    assure( !cpl_error_get_code(), return, "Could not write %s QC parameters",</span></div>
+<div class="line"><a name="l02526"></a><span class="lineno"> 2526</span> <span class="comment">            CORRECTION_MAP);</span></div>
+<div class="line"><a name="l02527"></a><span class="lineno"> 2527</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l02528"></a><span class="lineno"> 2528</span> </div>
+<div class="line"><a name="l02529"></a><span class="lineno"> 2529</span>         <span class="keywordflow">if</span> (qc_zeropoint_err > 0.0) {</div>
+<div class="line"><a name="l02530"></a><span class="lineno"> 2530</span>             <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l02531"></a><span class="lineno"> 2531</span>                                     qc_zeropoint,</div>
+<div class="line"><a name="l02532"></a><span class="lineno"> 2532</span>                                     <span class="stringliteral">"QC.INSTRUMENT.ZEROPOINT"</span>,</div>
+<div class="line"><a name="l02533"></a><span class="lineno"> 2533</span>                                     <span class="stringliteral">"mag"</span>,</div>
+<div class="line"><a name="l02534"></a><span class="lineno"> 2534</span>                                     <span class="stringliteral">"Instrument zeropoint"</span>,</div>
+<div class="line"><a name="l02535"></a><span class="lineno"> 2535</span>                                     setting->instrument);</div>
+<div class="line"><a name="l02536"></a><span class="lineno"> 2536</span> </div>
+<div class="line"><a name="l02537"></a><span class="lineno"> 2537</span>             <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l02538"></a><span class="lineno"> 2538</span>                                     qc_zeropoint_err,</div>
+<div class="line"><a name="l02539"></a><span class="lineno"> 2539</span>                                     <span class="stringliteral">"QC.INSTRUMENT.ZEROPOINT.ERROR"</span>,</div>
+<div class="line"><a name="l02540"></a><span class="lineno"> 2540</span>                                     <span class="stringliteral">"mag"</span>,</div>
+<div class="line"><a name="l02541"></a><span class="lineno"> 2541</span>                                     <span class="stringliteral">"Instrument zeropoint error"</span>,</div>
+<div class="line"><a name="l02542"></a><span class="lineno"> 2542</span>                                     setting->instrument);</div>
+<div class="line"><a name="l02543"></a><span class="lineno"> 2543</span>         }</div>
+<div class="line"><a name="l02544"></a><span class="lineno"> 2544</span> </div>
+<div class="line"><a name="l02545"></a><span class="lineno"> 2545</span>         <span class="keywordflow">if</span> (qc_extinction_err > 0.0 && summary == NULL) {</div>
+<div class="line"><a name="l02546"></a><span class="lineno"> 2546</span>             <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l02547"></a><span class="lineno"> 2547</span>                                     qc_extinction,</div>
+<div class="line"><a name="l02548"></a><span class="lineno"> 2548</span>                                     <span class="stringliteral">"QC.ATMOSPHERIC.EXTINCTION"</span>,</div>
+<div class="line"><a name="l02549"></a><span class="lineno"> 2549</span>                                     <span class="stringliteral">"mag/airmass"</span>,</div>
+<div class="line"><a name="l02550"></a><span class="lineno"> 2550</span>                                     <span class="stringliteral">"Atmospheric extinction"</span>,</div>
+<div class="line"><a name="l02551"></a><span class="lineno"> 2551</span>                                     setting->instrument);</div>
+<div class="line"><a name="l02552"></a><span class="lineno"> 2552</span> </div>
+<div class="line"><a name="l02553"></a><span class="lineno"> 2553</span>             <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l02554"></a><span class="lineno"> 2554</span>                                     qc_extinction_err,</div>
+<div class="line"><a name="l02555"></a><span class="lineno"> 2555</span>                                     <span class="stringliteral">"QC.ATMOSPHERIC.EXTINCTION.ERROR"</span>,</div>
+<div class="line"><a name="l02556"></a><span class="lineno"> 2556</span>                                     <span class="stringliteral">"mag/airmass"</span>,</div>
+<div class="line"><a name="l02557"></a><span class="lineno"> 2557</span>                                     <span class="stringliteral">"Atmospheric extinction error"</span>,</div>
+<div class="line"><a name="l02558"></a><span class="lineno"> 2558</span>                                     setting->instrument);</div>
+<div class="line"><a name="l02559"></a><span class="lineno"> 2559</span>         }</div>
+<div class="line"><a name="l02560"></a><span class="lineno"> 2560</span> </div>
+<div class="line"><a name="l02561"></a><span class="lineno"> 2561</span>         <span class="keywordflow">if</span> (qc_colorterm_err > 0.0) {</div>
+<div class="line"><a name="l02562"></a><span class="lineno"> 2562</span>             <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l02563"></a><span class="lineno"> 2563</span>                                     qc_colorterm,</div>
+<div class="line"><a name="l02564"></a><span class="lineno"> 2564</span>                                     <span class="stringliteral">"QC.COLOR.CORRECTION"</span>,</div>
+<div class="line"><a name="l02565"></a><span class="lineno"> 2565</span>                                     NULL,</div>
+<div class="line"><a name="l02566"></a><span class="lineno"> 2566</span>                                     <span class="stringliteral">"Linear color correction term"</span>,</div>
+<div class="line"><a name="l02567"></a><span class="lineno"> 2567</span>                                     setting->instrument);</div>
+<div class="line"><a name="l02568"></a><span class="lineno"> 2568</span> </div>
+<div class="line"><a name="l02569"></a><span class="lineno"> 2569</span>             <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qc,</div>
+<div class="line"><a name="l02570"></a><span class="lineno"> 2570</span>                                     qc_colorterm_err,</div>
+<div class="line"><a name="l02571"></a><span class="lineno"> 2571</span>                                     <span class="stringliteral">"QC.COLOR.CORRECTION.ERROR"</span>,</div>
+<div class="line"><a name="l02572"></a><span class="lineno"> 2572</span>                                     NULL,</div>
+<div class="line"><a name="l02573"></a><span class="lineno"> 2573</span>                                     <span class="stringliteral">"Linear color correction term error"</span>,</div>
+<div class="line"><a name="l02574"></a><span class="lineno"> 2574</span>                                     setting->instrument);</div>
+<div class="line"><a name="l02575"></a><span class="lineno"> 2575</span>         }</div>
+<div class="line"><a name="l02576"></a><span class="lineno"> 2576</span> </div>
+<div class="line"><a name="l02577"></a><span class="lineno"> 2577</span>         <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l02578"></a><span class="lineno"> 2578</span> </div>
+<div class="line"><a name="l02579"></a><span class="lineno"> 2579</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02580"></a><span class="lineno"> 2580</span> <span class="comment">         * End write QCs</span></div>
+<div class="line"><a name="l02581"></a><span class="lineno"> 2581</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02582"></a><span class="lineno"> 2582</span>     }</div>
+<div class="line"><a name="l02583"></a><span class="lineno"> 2583</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span>);</div>
+<div class="line"><a name="l02584"></a><span class="lineno"> 2584</span> </div>
+<div class="line"><a name="l02585"></a><span class="lineno"> 2585</span>     <span class="keywordflow">if</span> (summary && phot_coeff) {</div>
+<div class="line"><a name="l02586"></a><span class="lineno"> 2586</span>         cpl_table_erase_column(phot_coeff, <span class="stringliteral">"EXT"</span>);</div>
+<div class="line"><a name="l02587"></a><span class="lineno"> 2587</span>         cpl_table_erase_column(phot_coeff, <span class="stringliteral">"DEXT"</span>);</div>
+<div class="line"><a name="l02588"></a><span class="lineno"> 2588</span>         <span class="keywordflow">if</span> (1 == cpl_table_get_ncol(phot_coeff)) {</div>
+<div class="line"><a name="l02589"></a><span class="lineno"> 2589</span>             cpl_table_delete(phot_coeff);</div>
+<div class="line"><a name="l02590"></a><span class="lineno"> 2590</span>             phot_coeff = NULL;</div>
+<div class="line"><a name="l02591"></a><span class="lineno"> 2591</span>         }</div>
+<div class="line"><a name="l02592"></a><span class="lineno"> 2592</span>     }</div>
+<div class="line"><a name="l02593"></a><span class="lineno"> 2593</span> </div>
+<div class="line"><a name="l02594"></a><span class="lineno"> 2594</span>     <span class="keywordflow">if</span> (phot_coeff) {</div>
+<div class="line"><a name="l02595"></a><span class="lineno"> 2595</span>         <a class="code" href="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f" title="Save DFS product (table)">fors_dfs_save_table</a>(frames, phot_coeff, PHOT_COEFF_TABLE,</div>
+<div class="line"><a name="l02596"></a><span class="lineno"> 2596</span>                             qc, parameters, fors_photometry_name,</div>
+<div class="line"><a name="l02597"></a><span class="lineno"> 2597</span>                             cpl_frameset_get_first_const(master_flat_frame));</div>
+<div class="line"><a name="l02598"></a><span class="lineno"> 2598</span>         cpl_propertylist_delete(qc); qc = NULL;</div>
+<div class="line"><a name="l02599"></a><span class="lineno"> 2599</span>     }</div>
+<div class="line"><a name="l02600"></a><span class="lineno"> 2600</span>     </div>
+<div class="line"><a name="l02601"></a><span class="lineno"> 2601</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l02602"></a><span class="lineno"> 2602</span>             PHOT_COEFF_TABLE);</div>
+<div class="line"><a name="l02603"></a><span class="lineno"> 2603</span> </div>
+<div class="line"><a name="l02604"></a><span class="lineno"> 2604</span>     <span class="keywordflow">if</span> (summary) {</div>
+<div class="line"><a name="l02605"></a><span class="lineno"> 2605</span>         <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERFRAME) {</div>
+<div class="line"><a name="l02606"></a><span class="lineno"> 2606</span>             tag = EXTINCTION_PER_FRAME;</div>
+<div class="line"><a name="l02607"></a><span class="lineno"> 2607</span>         }</div>
+<div class="line"><a name="l02608"></a><span class="lineno"> 2608</span>         <span class="keywordflow">if</span> (fit_e == FORS_FIT_NCOEFF_PERNIGHT) {</div>
+<div class="line"><a name="l02609"></a><span class="lineno"> 2609</span>             tag = EXTINCTION_PER_NIGHT;</div>
+<div class="line"><a name="l02610"></a><span class="lineno"> 2610</span>         }</div>
+<div class="line"><a name="l02611"></a><span class="lineno"> 2611</span>         <a class="code" href="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f" title="Save DFS product (table)">fors_dfs_save_table</a>(frames, summary, tag, NULL, parameters, </div>
+<div class="line"><a name="l02612"></a><span class="lineno"> 2612</span>                             fors_photometry_name,</div>
+<div class="line"><a name="l02613"></a><span class="lineno"> 2613</span>                             cpl_frameset_get_first_const(master_flat_frame));</div>
+<div class="line"><a name="l02614"></a><span class="lineno"> 2614</span>     }</div>
+<div class="line"><a name="l02615"></a><span class="lineno"> 2615</span>     </div>
+<div class="line"><a name="l02616"></a><span class="lineno"> 2616</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>, tag);</div>
+<div class="line"><a name="l02617"></a><span class="lineno"> 2617</span> </div>
+<div class="line"><a name="l02618"></a><span class="lineno"> 2618</span>     <span class="keywordflow">if</span> (degreef1 > 0) {</div>
+<div class="line"><a name="l02619"></a><span class="lineno"> 2619</span>     </div>
+<div class="line"><a name="l02620"></a><span class="lineno"> 2620</span>         <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, correction, CORRECTION_MAP,</div>
+<div class="line"><a name="l02621"></a><span class="lineno"> 2621</span>                             qc, parameters, fors_photometry_name, </div>
+<div class="line"><a name="l02622"></a><span class="lineno"> 2622</span>                             cpl_frameset_get_first_const(master_flat_frame));</div>
+<div class="line"><a name="l02623"></a><span class="lineno"> 2623</span> </div>
+<div class="line"><a name="l02624"></a><span class="lineno"> 2624</span>     }</div>
+<div class="line"><a name="l02625"></a><span class="lineno"> 2625</span> </div>
+<div class="line"><a name="l02626"></a><span class="lineno"> 2626</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l02627"></a><span class="lineno"> 2627</span>             CORRECTION_MAP);</div>
+<div class="line"><a name="l02628"></a><span class="lineno"> 2628</span> </div>
+<div class="line"><a name="l02629"></a><span class="lineno"> 2629</span>     cpl_propertylist_delete(qc);</div>
+<div class="line"><a name="l02630"></a><span class="lineno"> 2630</span>     </div>
+<div class="line"><a name="l02631"></a><span class="lineno"> 2631</span>     <span class="comment">/* Convert from magnitude to flux.</span></div>
+<div class="line"><a name="l02632"></a><span class="lineno"> 2632</span> <span class="comment">       F = 10^(-0.4 m)</span></div>
+<div class="line"><a name="l02633"></a><span class="lineno"> 2633</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l02634"></a><span class="lineno"> 2634</span>     <span class="keywordflow">if</span> (degreef1 > 0) {</div>
+<div class="line"><a name="l02635"></a><span class="lineno"> 2635</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Creating correction map (flux)"</span>);</div>
+<div class="line"><a name="l02636"></a><span class="lineno"> 2636</span>     </div>
+<div class="line"><a name="l02637"></a><span class="lineno"> 2637</span>         <a class="code" href="group__fors__image.html#gadd751e2623f778d5bb2b8f3b628077c2" title="Multiply by scalar.">fors_image_multiply_scalar</a>(correction, -0.4, -1);</div>
+<div class="line"><a name="l02638"></a><span class="lineno"> 2638</span>         <a class="code" href="group__fors__image.html#gabe2039c17c13fed0e430d71cb38454bf" title="Exponential.">fors_image_exponential</a>(correction, 10, -1);</div>
+<div class="line"><a name="l02639"></a><span class="lineno"> 2639</span>     </div>
+<div class="line"><a name="l02640"></a><span class="lineno"> 2640</span>         <span class="comment">/* Normalize to median = 1 */</span></div>
+<div class="line"><a name="l02641"></a><span class="lineno"> 2641</span>         <a class="code" href="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35" title="Divide by scalar.">fors_image_divide_scalar</a>(correction, </div>
+<div class="line"><a name="l02642"></a><span class="lineno"> 2642</span>                                  <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(correction, NULL), -1.0);</div>
+<div class="line"><a name="l02643"></a><span class="lineno"> 2643</span>     </div>
+<div class="line"><a name="l02644"></a><span class="lineno"> 2644</span>         <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, correction, CORRECTION_FACTOR,</div>
+<div class="line"><a name="l02645"></a><span class="lineno"> 2645</span>                             NULL, parameters, fors_photometry_name, </div>
+<div class="line"><a name="l02646"></a><span class="lineno"> 2646</span>                             cpl_frameset_get_first_const(master_flat_frame));</div>
+<div class="line"><a name="l02647"></a><span class="lineno"> 2647</span>     </div>
+<div class="line"><a name="l02648"></a><span class="lineno"> 2648</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l02649"></a><span class="lineno"> 2649</span>                 CORRECTION_FACTOR);</div>
+<div class="line"><a name="l02650"></a><span class="lineno"> 2650</span>     }</div>
+<div class="line"><a name="l02651"></a><span class="lineno"> 2651</span>     </div>
+<div class="line"><a name="l02652"></a><span class="lineno"> 2652</span>     <span class="keywordflow">if</span> (degreef1 > 0) {</div>
+<div class="line"><a name="l02653"></a><span class="lineno"> 2653</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Creating corrected master flat"</span>);</div>
+<div class="line"><a name="l02654"></a><span class="lineno"> 2654</span>         <a class="code" href="group__fors__image.html#gaaa54b1e6e0e3cf5fcf442267896f6dad" title="Multiply images.">fors_image_multiply</a>(master_flat, correction);</div>
+<div class="line"><a name="l02655"></a><span class="lineno"> 2655</span>     </div>
+<div class="line"><a name="l02656"></a><span class="lineno"> 2656</span>         <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, master_flat, MASTER_FLAT_IMG,</div>
+<div class="line"><a name="l02657"></a><span class="lineno"> 2657</span>                             NULL, parameters, fors_photometry_name, </div>
+<div class="line"><a name="l02658"></a><span class="lineno"> 2658</span>                             cpl_frameset_get_first_const(master_flat_frame));</div>
+<div class="line"><a name="l02659"></a><span class="lineno"> 2659</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l02660"></a><span class="lineno"> 2660</span>                 MASTER_FLAT_IMG);</div>
+<div class="line"><a name="l02661"></a><span class="lineno"> 2661</span>     }</div>
+<div class="line"><a name="l02662"></a><span class="lineno"> 2662</span>     </div>
+<div class="line"><a name="l02663"></a><span class="lineno"> 2663</span>     cleanup;</div>
+<div class="line"><a name="l02664"></a><span class="lineno"> 2664</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l02665"></a><span class="lineno"> 2665</span> }</div>
+<div class="line"><a name="l02666"></a><span class="lineno"> 2666</span> </div>
+<div class="line"><a name="l02667"></a><span class="lineno"> 2667</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l02668"></a><span class="lineno"> 2668</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l02669"></a><span class="lineno"> 2669</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l02670"></a><span class="lineno"> 2670</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l02671"></a><span class="lineno"> 2671</span> <span class="preprocessor">    fors_std_star_delete(&std_star); \</span></div>
+<div class="line"><a name="l02672"></a><span class="lineno"> 2672</span> <span class="preprocessor">    cpl_propertylist_delete(header); header = NULL; \</span></div>
+<div class="line"><a name="l02673"></a><span class="lineno"> 2673</span> <span class="preprocessor">    cpl_table_delete(aligned_phot); aligned_phot = NULL; \</span></div>
+<div class="line"><a name="l02674"></a><span class="lineno"> 2674</span> <span class="preprocessor">    fors_setting_delete(&setting_f); \</span></div>
+<div class="line"><a name="l02675"></a><span class="lineno"> 2675</span> <span class="preprocessor">    fors_delete_star_lists(&obs, std_star_list); \</span></div>
+<div class="line"><a name="l02676"></a><span class="lineno"> 2676</span> <span class="preprocessor">    fors_star_delete_but_standard(&obs_star); \</span></div>
+<div class="line"><a name="l02677"></a><span class="lineno"> 2677</span> <span class="preprocessor">    fors_std_star_delete(&std_star); \</span></div>
+<div class="line"><a name="l02678"></a><span class="lineno"> 2678</span> <span class="preprocessor">    \</span></div>
+<div class="line"><a name="l02679"></a><span class="lineno"> 2679</span> <span class="preprocessor">    *n_frames = 0; \</span></div>
+<div class="line"><a name="l02680"></a><span class="lineno"> 2680</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l02681"></a><span class="lineno"> 2681</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l02696"></a><span class="lineno"> 2696</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l02697"></a><span class="lineno"> 2697</span> <span class="keyword">static</span> entry_list *</div>
+<div class="line"><a name="l02698"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gabe32026b38c8d511f76b7f1008941f71"> 2698</a></span> <a class="code" href="group__fors__photometry.html#gabe32026b38c8d511f76b7f1008941f71" title="Read input data from aligned phot tables.">fors_photometry_read_input</a>(                 <span class="keyword">const</span> cpl_frameset  *alphot_frames,</div>
+<div class="line"><a name="l02699"></a><span class="lineno"> 2699</span>                                             <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a>  *setting,</div>
+<div class="line"><a name="l02700"></a><span class="lineno"> 2700</span>                                             <span class="keywordtype">int</span> (*get_atm_ext_id_function)(</div>
+<div class="line"><a name="l02701"></a><span class="lineno"> 2701</span>                                                 <span class="keyword">const</span> cpl_propertylist *header),</div>
+<div class="line"><a name="l02702"></a><span class="lineno"> 2702</span>                                             <span class="keywordtype">bool</span>                import_unknown,</div>
+<div class="line"><a name="l02703"></a><span class="lineno"> 2703</span>                                             <span class="keywordtype">int</span>                 *n_frames,</div>
+<div class="line"><a name="l02704"></a><span class="lineno"> 2704</span>                                             fors_std_star_list  **std_star_list,</div>
+<div class="line"><a name="l02705"></a><span class="lineno"> 2705</span>                                             <span class="keywordtype">int</span>                 filter)</div>
+<div class="line"><a name="l02706"></a><span class="lineno"> 2706</span> {</div>
+<div class="line"><a name="l02707"></a><span class="lineno"> 2707</span>     entry_list          *obs = NULL;</div>
+<div class="line"><a name="l02708"></a><span class="lineno"> 2708</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a>        *setting_f = NULL;</div>
+<div class="line"><a name="l02709"></a><span class="lineno"> 2709</span>     <a class="code" href="struct__fors__star.html">fors_star</a>           *obs_star = NULL;</div>
+<div class="line"><a name="l02710"></a><span class="lineno"> 2710</span>     fors_std_star       *std_star = NULL;</div>
+<div class="line"><a name="l02711"></a><span class="lineno"> 2711</span>     cpl_propertylist    *header = NULL;</div>
+<div class="line"><a name="l02712"></a><span class="lineno"> 2712</span>     cpl_table           *aligned_phot = NULL;</div>
+<div class="line"><a name="l02713"></a><span class="lineno"> 2713</span>     <span class="keyword">const</span> cpl_frame     *f;</div>
+<div class="line"><a name="l02714"></a><span class="lineno"> 2714</span>     <span class="keywordtype">int</span>                 iframe,</div>
+<div class="line"><a name="l02715"></a><span class="lineno"> 2715</span>                         inonstd = 0;</div>
+<div class="line"><a name="l02716"></a><span class="lineno"> 2716</span>     cpl_errorstate      errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l02717"></a><span class="lineno"> 2717</span>     </div>
+<div class="line"><a name="l02718"></a><span class="lineno"> 2718</span>     <span class="comment">/* init output pointers */</span></div>
+<div class="line"><a name="l02719"></a><span class="lineno"> 2719</span>     cleanup;</div>
+<div class="line"><a name="l02720"></a><span class="lineno"> 2720</span>     </div>
+<div class="line"><a name="l02721"></a><span class="lineno"> 2721</span>     <span class="comment">/* prepare */</span></div>
+<div class="line"><a name="l02722"></a><span class="lineno"> 2722</span>     obs = entry_list_new();</div>
+<div class="line"><a name="l02723"></a><span class="lineno"> 2723</span>     *std_star_list = fors_std_star_list_new();</div>
+<div class="line"><a name="l02724"></a><span class="lineno"> 2724</span>     </div>
+<div class="line"><a name="l02725"></a><span class="lineno"> 2725</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l02726"></a><span class="lineno"> 2726</span> <span class="comment">     * Loop on all aligned photometric tables in input, and count the</span></div>
+<div class="line"><a name="l02727"></a><span class="lineno"> 2727</span> <span class="comment">     * found frames in iframe.</span></div>
+<div class="line"><a name="l02728"></a><span class="lineno"> 2728</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l02729"></a><span class="lineno"> 2729</span>     <span class="keywordflow">for</span> (f = cpl_frameset_get_first_const(alphot_frames), iframe = 0;</div>
+<div class="line"><a name="l02730"></a><span class="lineno"> 2730</span>          f != NULL;</div>
+<div class="line"><a name="l02731"></a><span class="lineno"> 2731</span>          f = cpl_frameset_get_next_const(alphot_frames), iframe++)</div>
+<div class="line"><a name="l02732"></a><span class="lineno"> 2732</span>     {</div>
+<div class="line"><a name="l02733"></a><span class="lineno"> 2733</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  *filename;</div>
+<div class="line"><a name="l02734"></a><span class="lineno"> 2734</span>         <span class="keywordtype">int</span>         atm_ext_id = 0;</div>
+<div class="line"><a name="l02735"></a><span class="lineno"> 2735</span>         <span class="keywordtype">double</span>      airmass;</div>
+<div class="line"><a name="l02736"></a><span class="lineno"> 2736</span>         </div>
+<div class="line"><a name="l02737"></a><span class="lineno"> 2737</span>         filename = cpl_frame_get_filename(f);</div>
+<div class="line"><a name="l02738"></a><span class="lineno"> 2738</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Loading %s"</span>, filename);</div>
+<div class="line"><a name="l02739"></a><span class="lineno"> 2739</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l02740"></a><span class="lineno"> 2740</span> </div>
+<div class="line"><a name="l02741"></a><span class="lineno"> 2741</span>         aligned_phot = cpl_table_load(filename, 1, 1);</div>
+<div class="line"><a name="l02742"></a><span class="lineno"> 2742</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                             cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l02743"></a><span class="lineno"> 2743</span>                                             <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l02744"></a><span class="lineno"> 2744</span>                                             <span class="stringliteral">"Could not load %s"</span>,</div>
+<div class="line"><a name="l02745"></a><span class="lineno"> 2745</span>                                                 filename);</div>
+<div class="line"><a name="l02746"></a><span class="lineno"> 2746</span> <span class="comment">/* %%% */</span></div>
+<div class="line"><a name="l02747"></a><span class="lineno"> 2747</span>         <span class="keywordflow">if</span> (filter && cpl_table_has_column(aligned_phot, <span class="stringliteral">"WEIGHT"</span>)) {</div>
+<div class="line"><a name="l02748"></a><span class="lineno"> 2748</span>             cpl_table_and_selected_double(aligned_phot, </div>
+<div class="line"><a name="l02749"></a><span class="lineno"> 2749</span>                                           <span class="stringliteral">"WEIGHT"</span>, CPL_LESS_THAN, 1.0);</div>
+<div class="line"><a name="l02750"></a><span class="lineno"> 2750</span>             cpl_table_and_selected_double(aligned_phot, </div>
+<div class="line"><a name="l02751"></a><span class="lineno"> 2751</span>                                           <span class="stringliteral">"WEIGHT"</span>, CPL_GREATER_THAN, -1.0);</div>
+<div class="line"><a name="l02752"></a><span class="lineno"> 2752</span>             cpl_table_erase_selected(aligned_phot);</div>
+<div class="line"><a name="l02753"></a><span class="lineno"> 2753</span>         }</div>
+<div class="line"><a name="l02754"></a><span class="lineno"> 2754</span> <span class="comment">/* %%% */</span></div>
+<div class="line"><a name="l02755"></a><span class="lineno"> 2755</span> </div>
+<div class="line"><a name="l02756"></a><span class="lineno"> 2756</span>         header = cpl_propertylist_load(filename, 0);</div>
+<div class="line"><a name="l02757"></a><span class="lineno"> 2757</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                             cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l02758"></a><span class="lineno"> 2758</span>                                             <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l02759"></a><span class="lineno"> 2759</span>                                             <span class="stringliteral">"Could not load %s header"</span>,</div>
+<div class="line"><a name="l02760"></a><span class="lineno"> 2760</span>                                                 filename);</div>
+<div class="line"><a name="l02761"></a><span class="lineno"> 2761</span>         </div>
+<div class="line"><a name="l02762"></a><span class="lineno"> 2762</span>         <span class="comment">/* </span></div>
+<div class="line"><a name="l02763"></a><span class="lineno"> 2763</span> <span class="comment">         * Load and verify setting for this frame </span></div>
+<div class="line"><a name="l02764"></a><span class="lineno"> 2764</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02765"></a><span class="lineno"> 2765</span>         <a class="code" href="group__fors__setting.html#ga160a93959e72b826426891ca8e0f80aa" title="Verify that instrument settings are compatible.">fors_setting_verify</a>(setting, f, &setting_f);</div>
+<div class="line"><a name="l02766"></a><span class="lineno"> 2766</span>         </div>
+<div class="line"><a name="l02767"></a><span class="lineno"> 2767</span>         airmass = cpl_propertylist_get_double(header, <span class="stringliteral">"AIRMASS"</span>);</div>
+<div class="line"><a name="l02768"></a><span class="lineno"> 2768</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                             cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l02769"></a><span class="lineno"> 2769</span>                                             <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l02770"></a><span class="lineno"> 2770</span>                                             <span class="stringliteral">"%s: Could not read %s"</span>,</div>
+<div class="line"><a name="l02771"></a><span class="lineno"> 2771</span>                                                 filename, <span class="stringliteral">"AIRMASS"</span>);</div>
+<div class="line"><a name="l02772"></a><span class="lineno"> 2772</span> </div>
+<div class="line"><a name="l02773"></a><span class="lineno"> 2773</span>         <span class="comment">/* FIXME:</span></div>
+<div class="line"><a name="l02774"></a><span class="lineno"> 2774</span> <span class="comment">         * This whole section is for verifying the input table. The</span></div>
+<div class="line"><a name="l02775"></a><span class="lineno"> 2775</span> <span class="comment">         * structure of this table is probably defined in some other</span></div>
+<div class="line"><a name="l02776"></a><span class="lineno"> 2776</span> <span class="comment">         * place too... Likely this is a dependency between modules</span></div>
+<div class="line"><a name="l02777"></a><span class="lineno"> 2777</span> <span class="comment">         * that should be eliminated. Please check... (C.Izzo, 28.01.08)</span></div>
+<div class="line"><a name="l02778"></a><span class="lineno"> 2778</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02779"></a><span class="lineno"> 2779</span>         <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l02780"></a><span class="lineno"> 2780</span>             <span class="keyword">const</span> <span class="keywordtype">char</span>  *name;</div>
+<div class="line"><a name="l02781"></a><span class="lineno"> 2781</span>             cpl_type    type;</div>
+<div class="line"><a name="l02782"></a><span class="lineno"> 2782</span>             <span class="keywordtype">bool</span>        optional;</div>
+<div class="line"><a name="l02783"></a><span class="lineno"> 2783</span>         } col[] =</div>
+<div class="line"><a name="l02784"></a><span class="lineno"> 2784</span>               {{<span class="stringliteral">"RA"</span>,           CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02785"></a><span class="lineno"> 2785</span>                {<span class="stringliteral">"DEC"</span>,          CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02786"></a><span class="lineno"> 2786</span>                {<span class="stringliteral">"X"</span>,            CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02787"></a><span class="lineno"> 2787</span>                {<span class="stringliteral">"Y"</span>,            CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02788"></a><span class="lineno"> 2788</span>                {<span class="stringliteral">"FWHM"</span>,         CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02789"></a><span class="lineno"> 2789</span>                {<span class="stringliteral">"A"</span>,            CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02790"></a><span class="lineno"> 2790</span>                {<span class="stringliteral">"B"</span>,            CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02791"></a><span class="lineno"> 2791</span>                {<span class="stringliteral">"THETA"</span>,        CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02792"></a><span class="lineno"> 2792</span>                {<span class="stringliteral">"INSTR_MAG"</span>,    CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02793"></a><span class="lineno"> 2793</span>                {<span class="stringliteral">"DINSTR_MAG"</span>,   CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02794"></a><span class="lineno"> 2794</span>                {<span class="stringliteral">"CAT_MAG"</span>,      CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02795"></a><span class="lineno"> 2795</span>                {<span class="stringliteral">"DCAT_MAG"</span>,     CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02796"></a><span class="lineno"> 2796</span>                {<span class="stringliteral">"MAG"</span>,          CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02797"></a><span class="lineno"> 2797</span>                {<span class="stringliteral">"DMAG"</span>,         CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02798"></a><span class="lineno"> 2798</span>                {<span class="stringliteral">"COLOR"</span>,        CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02799"></a><span class="lineno"> 2799</span>                {<span class="stringliteral">"DCOLOR"</span>,       CPL_TYPE_DOUBLE, <span class="keyword">true</span>}, <span class="comment">/* miss in old data */</span></div>
+<div class="line"><a name="l02800"></a><span class="lineno"> 2800</span>                {<span class="stringliteral">"COV_CATM_COL"</span>, CPL_TYPE_DOUBLE, <span class="keyword">true</span>}, <span class="comment">/* miss in old data */</span></div>
+<div class="line"><a name="l02801"></a><span class="lineno"> 2801</span>                {<span class="stringliteral">"CLASS_STAR"</span>,   CPL_TYPE_DOUBLE, <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02802"></a><span class="lineno"> 2802</span>                {<span class="stringliteral">"USE_CAT"</span>,      CPL_TYPE_INT,    <span class="keyword">false</span>},</div>
+<div class="line"><a name="l02803"></a><span class="lineno"> 2803</span>                {<span class="stringliteral">"OBJECT"</span>,       CPL_TYPE_STRING, <span class="keyword">false</span>}};</div>
+<div class="line"><a name="l02804"></a><span class="lineno"> 2804</span>         {</div>
+<div class="line"><a name="l02805"></a><span class="lineno"> 2805</span>             <span class="keywordtype">unsigned</span> i = 0;</div>
+<div class="line"><a name="l02806"></a><span class="lineno"> 2806</span>             <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(col) / <span class="keyword">sizeof</span>(*col); i++)</div>
+<div class="line"><a name="l02807"></a><span class="lineno"> 2807</span>             {</div>
+<div class="line"><a name="l02808"></a><span class="lineno"> 2808</span>                 <span class="keywordtype">bool</span>    exists;</div>
+<div class="line"><a name="l02809"></a><span class="lineno"> 2809</span>                 exists = cpl_table_has_column(aligned_phot, col[i].name);</div>
+<div class="line"><a name="l02810"></a><span class="lineno"> 2810</span>                 cassure(exists || col[i].optional,</div>
+<div class="line"><a name="l02811"></a><span class="lineno"> 2811</span>                         CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l02812"></a><span class="lineno"> 2812</span>                         <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l02813"></a><span class="lineno"> 2813</span>                         <span class="stringliteral">"%s: Missing column %s"</span>, filename, col[i].name);</div>
+<div class="line"><a name="l02814"></a><span class="lineno"> 2814</span>                 cassure((!exists) ||</div>
+<div class="line"><a name="l02815"></a><span class="lineno"> 2815</span>                         cpl_table_get_column_type(aligned_phot, col[i].name) </div>
+<div class="line"><a name="l02816"></a><span class="lineno"> 2816</span>                             == col[i].type,</div>
+<div class="line"><a name="l02817"></a><span class="lineno"> 2817</span>                         CPL_ERROR_INVALID_TYPE,</div>
+<div class="line"><a name="l02818"></a><span class="lineno"> 2818</span>                         <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l02819"></a><span class="lineno"> 2819</span>                         <span class="stringliteral">"%s: column %s: Type is %s, %s expected "</span>, </div>
+<div class="line"><a name="l02820"></a><span class="lineno"> 2820</span>                         filename,</div>
+<div class="line"><a name="l02821"></a><span class="lineno"> 2821</span>                         col[i].name,</div>
+<div class="line"><a name="l02822"></a><span class="lineno"> 2822</span>                         <a class="code" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd" title="Textual representation of CPL type.">fors_type_get_string</a>(</div>
+<div class="line"><a name="l02823"></a><span class="lineno"> 2823</span>                             cpl_table_get_column_type(aligned_phot, </div>
+<div class="line"><a name="l02824"></a><span class="lineno"> 2824</span>                                                       col[i].name)</div>
+<div class="line"><a name="l02825"></a><span class="lineno"> 2825</span>                         ),</div>
+<div class="line"><a name="l02826"></a><span class="lineno"> 2826</span>                         <a class="code" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd" title="Textual representation of CPL type.">fors_type_get_string</a>(col[i].type));</div>
+<div class="line"><a name="l02827"></a><span class="lineno"> 2827</span>             }</div>
+<div class="line"><a name="l02828"></a><span class="lineno"> 2828</span>         } <span class="comment">/* Table check done */</span></div>
+<div class="line"><a name="l02829"></a><span class="lineno"> 2829</span>         </div>
+<div class="line"><a name="l02830"></a><span class="lineno"> 2830</span>         <span class="keywordflow">if</span> (get_atm_ext_id_function != NULL)</div>
+<div class="line"><a name="l02831"></a><span class="lineno"> 2831</span>         {</div>
+<div class="line"><a name="l02832"></a><span class="lineno"> 2832</span>             atm_ext_id = get_atm_ext_id_function(header);</div>
+<div class="line"><a name="l02833"></a><span class="lineno"> 2833</span>             <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                         cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l02834"></a><span class="lineno"> 2834</span>                                             <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l02835"></a><span class="lineno"> 2835</span>                                             <span class="stringliteral">"Getting atmospheric extinction "</span></div>
+<div class="line"><a name="l02836"></a><span class="lineno"> 2836</span>                                             <span class="stringliteral">"identifier failed."</span>);</div>
+<div class="line"><a name="l02837"></a><span class="lineno"> 2837</span>         }</div>
+<div class="line"><a name="l02838"></a><span class="lineno"> 2838</span>         </div>
+<div class="line"><a name="l02839"></a><span class="lineno"> 2839</span>         <span class="comment">/* </span></div>
+<div class="line"><a name="l02840"></a><span class="lineno"> 2840</span> <span class="comment">         * Get IDed stars in this table: </span></div>
+<div class="line"><a name="l02841"></a><span class="lineno"> 2841</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02842"></a><span class="lineno"> 2842</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l02843"></a><span class="lineno"> 2843</span>         <span class="keywordflow">for</span> (i = 0; i < cpl_table_get_nrow(aligned_phot); i++)</div>
+<div class="line"><a name="l02844"></a><span class="lineno"> 2844</span>         {</div>
+<div class="line"><a name="l02845"></a><span class="lineno"> 2845</span>             obs_star = <a class="code" href="group__fors__star.html#ga5be8cd6931b5f998692daaf65bcf9755" title="Create a star from a table WITHOUT checking.">fors_star_new_from_table</a>(</div>
+<div class="line"><a name="l02846"></a><span class="lineno"> 2846</span>                                             aligned_phot,</div>
+<div class="line"><a name="l02847"></a><span class="lineno"> 2847</span>                                             i,</div>
+<div class="line"><a name="l02848"></a><span class="lineno"> 2848</span>                                             <span class="stringliteral">"X"</span>, <span class="stringliteral">"Y"</span>,</div>
+<div class="line"><a name="l02849"></a><span class="lineno"> 2849</span>                                             <span class="stringliteral">"FWHM"</span>,</div>
+<div class="line"><a name="l02850"></a><span class="lineno"> 2850</span>                                             <span class="stringliteral">"A"</span>, <span class="stringliteral">"B"</span>,</div>
+<div class="line"><a name="l02851"></a><span class="lineno"> 2851</span>                                             <span class="stringliteral">"THETA"</span>, </div>
+<div class="line"><a name="l02852"></a><span class="lineno"> 2852</span>                                             <span class="stringliteral">"INSTR_MAG"</span>, <span class="stringliteral">"DINSTR_MAG"</span>,</div>
+<div class="line"><a name="l02853"></a><span class="lineno"> 2853</span>                                             <span class="stringliteral">"CLASS_STAR"</span>);</div>
+<div class="line"><a name="l02854"></a><span class="lineno"> 2854</span>             std_star = fors_std_star_new_from_table(</div>
+<div class="line"><a name="l02855"></a><span class="lineno"> 2855</span>                                             aligned_phot,</div>
+<div class="line"><a name="l02856"></a><span class="lineno"> 2856</span>                                             i,</div>
+<div class="line"><a name="l02857"></a><span class="lineno"> 2857</span>                                             <span class="stringliteral">"RA"</span>, <span class="stringliteral">"DEC"</span>,</div>
+<div class="line"><a name="l02858"></a><span class="lineno"> 2858</span>                                             <span class="stringliteral">"MAG"</span>, <span class="stringliteral">"DMAG"</span>,</div>
+<div class="line"><a name="l02859"></a><span class="lineno"> 2859</span>                                             <span class="stringliteral">"CAT_MAG"</span>, <span class="stringliteral">"DCAT_MAG"</span>,</div>
+<div class="line"><a name="l02860"></a><span class="lineno"> 2860</span>                                             <span class="stringliteral">"COLOR"</span>, NULL,   <span class="comment">/* DCOLOR */</span></div>
+<div class="line"><a name="l02861"></a><span class="lineno"> 2861</span>                                             NULL,   <span class="comment">/* COV_CATM_COL */</span></div>
+<div class="line"><a name="l02862"></a><span class="lineno"> 2862</span>                                             NULL, NULL,</div>
+<div class="line"><a name="l02863"></a><span class="lineno"> 2863</span>                                             <span class="stringliteral">"OBJECT"</span>);</div>
+<div class="line"><a name="l02864"></a><span class="lineno"> 2864</span>             <span class="comment">/* compatibility with old fors_zeropoint products */</span></div>
+<div class="line"><a name="l02865"></a><span class="lineno"> 2865</span>             <span class="keywordflow">if</span> (cpl_table_has_column(aligned_phot, <span class="stringliteral">"DCOLOR"</span>)</div>
+<div class="line"><a name="l02866"></a><span class="lineno"> 2866</span>                 && cpl_table_has_column(aligned_phot, <span class="stringliteral">"COV_CATM_COL"</span>))</div>
+<div class="line"><a name="l02867"></a><span class="lineno"> 2867</span>             {</div>
+<div class="line"><a name="l02868"></a><span class="lineno"> 2868</span>                 std_star->dcolor = cpl_table_get(</div>
+<div class="line"><a name="l02869"></a><span class="lineno"> 2869</span>                                             aligned_phot,</div>
+<div class="line"><a name="l02870"></a><span class="lineno"> 2870</span>                                             <span class="stringliteral">"DCOLOR"</span>,</div>
+<div class="line"><a name="l02871"></a><span class="lineno"> 2871</span>                                             i,</div>
+<div class="line"><a name="l02872"></a><span class="lineno"> 2872</span>                                             NULL);</div>
+<div class="line"><a name="l02873"></a><span class="lineno"> 2873</span>                 std_star->cov_catm_color = cpl_table_get(</div>
+<div class="line"><a name="l02874"></a><span class="lineno"> 2874</span>                                             aligned_phot,</div>
+<div class="line"><a name="l02875"></a><span class="lineno"> 2875</span>                                             <span class="stringliteral">"COV_CATM_COL"</span>,</div>
+<div class="line"><a name="l02876"></a><span class="lineno"> 2876</span>                                             i,</div>
+<div class="line"><a name="l02877"></a><span class="lineno"> 2877</span>                                             NULL);</div>
+<div class="line"><a name="l02878"></a><span class="lineno"> 2878</span>             }</div>
+<div class="line"><a name="l02879"></a><span class="lineno"> 2879</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l02880"></a><span class="lineno"> 2880</span> <span class="comment">             * The star and the standard star are the same star. </span></div>
+<div class="line"><a name="l02881"></a><span class="lineno"> 2881</span> <span class="comment">             * The star is detector-oriented, the standard star</span></div>
+<div class="line"><a name="l02882"></a><span class="lineno"> 2882</span> <span class="comment">             * is its identification and includes physical propeties.</span></div>
+<div class="line"><a name="l02883"></a><span class="lineno"> 2883</span> <span class="comment">             * Here the information is linked together, and the</span></div>
+<div class="line"><a name="l02884"></a><span class="lineno"> 2884</span> <span class="comment">             * standard star is "owned" by the star object - so</span></div>
+<div class="line"><a name="l02885"></a><span class="lineno"> 2885</span> <span class="comment">             * it should not be destroyed.  (C.Izzo, 28.01.08)</span></div>
+<div class="line"><a name="l02886"></a><span class="lineno"> 2886</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l02887"></a><span class="lineno"> 2887</span>             obs_star->id = std_star;</div>
+<div class="line"><a name="l02888"></a><span class="lineno"> 2888</span>             </div>
+<div class="line"><a name="l02889"></a><span class="lineno"> 2889</span>             <span class="comment">/* Use catalog magnitude xor fit the magnitude: */</span></div>
+<div class="line"><a name="l02890"></a><span class="lineno"> 2890</span>             std_star->trusted = (0 != cpl_table_get_int(</div>
+<div class="line"><a name="l02891"></a><span class="lineno"> 2891</span>                                             aligned_phot, <span class="stringliteral">"USE_CAT"</span>, i, NULL));</div>
+<div class="line"><a name="l02892"></a><span class="lineno"> 2892</span>             </div>
+<div class="line"><a name="l02893"></a><span class="lineno"> 2893</span>             <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                         cpl_errorstate_is_equal(errstat)</div>
+<div class="line"><a name="l02894"></a><span class="lineno"> 2894</span>                                             && obs_star != NULL</div>
+<div class="line"><a name="l02895"></a><span class="lineno"> 2895</span>                                             && std_star != NULL,</div>
+<div class="line"><a name="l02896"></a><span class="lineno"> 2896</span>                                             <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l02897"></a><span class="lineno"> 2897</span>                                             <span class="stringliteral">"Reading from aligned photometry "</span></div>
+<div class="line"><a name="l02898"></a><span class="lineno"> 2898</span>                                             <span class="stringliteral">"table failed."</span>);</div>
+<div class="line"><a name="l02899"></a><span class="lineno"> 2899</span>             </div>
+<div class="line"><a name="l02900"></a><span class="lineno"> 2900</span>             cassure(                        obs_star->dmagnitude > 0,</div>
+<div class="line"><a name="l02901"></a><span class="lineno"> 2901</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l02902"></a><span class="lineno"> 2902</span>                                             <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l02903"></a><span class="lineno"> 2903</span>                                             <span class="stringliteral">"Non-positive magnitude error: "</span></div>
+<div class="line"><a name="l02904"></a><span class="lineno"> 2904</span>                                             <span class="stringliteral">"%f mag at row %d"</span>,</div>
+<div class="line"><a name="l02905"></a><span class="lineno"> 2905</span>                                             obs_star->dmagnitude,</div>
+<div class="line"><a name="l02906"></a><span class="lineno"> 2906</span>                                             i+1);</div>
+<div class="line"><a name="l02907"></a><span class="lineno"> 2907</span>             </div>
+<div class="line"><a name="l02908"></a><span class="lineno"> 2908</span>             <span class="comment">/*fors_star_print(CPL_MSG_DEBUG, obs_star);</span></div>
+<div class="line"><a name="l02909"></a><span class="lineno"> 2909</span> <span class="comment">            fors_std_star_print(CPL_MSG_DEBUG, std_star);*/</span></div>
+<div class="line"><a name="l02910"></a><span class="lineno"> 2910</span>             </div>
+<div class="line"><a name="l02911"></a><span class="lineno"> 2911</span>             <span class="keywordflow">if</span> (! <a class="code" href="group__fors__extract.html#gab2bb9e07066870dd90dadd6044803dd0" title="Check a sextracted star for validity.">fors_extract_check_sex_star</a>(obs_star, NULL))</div>
+<div class="line"><a name="l02912"></a><span class="lineno"> 2912</span>             {</div>
+<div class="line"><a name="l02913"></a><span class="lineno"> 2913</span>                 </div>
+<div class="line"><a name="l02914"></a><span class="lineno"> 2914</span>                 cpl_msg_warning(cpl_func,   <span class="stringliteral">"Rejecting object no. %d from "</span></div>
+<div class="line"><a name="l02915"></a><span class="lineno"> 2915</span>                                             <span class="stringliteral">"frame %d, "</span></div>
+<div class="line"><a name="l02916"></a><span class="lineno"> 2916</span>                                             <span class="stringliteral">"which should have been caught "</span></div>
+<div class="line"><a name="l02917"></a><span class="lineno"> 2917</span>                                             <span class="stringliteral">"by recent fors_zeropoint recipe. "</span></div>
+<div class="line"><a name="l02918"></a><span class="lineno"> 2918</span>                                             <span class="stringliteral">"Consider reprocessing input data."</span>,</div>
+<div class="line"><a name="l02919"></a><span class="lineno"> 2919</span>                                             i+1, iframe+1);</div>
+<div class="line"><a name="l02920"></a><span class="lineno"> 2920</span>                 fors_std_star_delete(&std_star);</div>
+<div class="line"><a name="l02921"></a><span class="lineno"> 2921</span>             }</div>
+<div class="line"><a name="l02922"></a><span class="lineno"> 2922</span>             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std_star->name != NULL && (std_star->name)[0] != <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l02923"></a><span class="lineno"> 2923</span>             {</div>
+<div class="line"><a name="l02924"></a><span class="lineno"> 2924</span>                 <span class="comment">/* Object with name is standard star */</span></div>
+<div class="line"><a name="l02925"></a><span class="lineno"> 2925</span>                 <span class="comment">/* Avoid duplicate standard star list entries. */</span></div>
+<div class="line"><a name="l02926"></a><span class="lineno"> 2926</span>                 std_star = <a class="code" href="group__fors__photometry.html#gabffbeb12c88498ed45e6115a1b529c07" title="Insert a std star into a list, if the closest existing distance > maxd_arcsec.">fors_photometry_read_input_listinsert_star_if_new</a>(</div>
+<div class="line"><a name="l02927"></a><span class="lineno"> 2927</span>                                             *std_star_list,</div>
+<div class="line"><a name="l02928"></a><span class="lineno"> 2928</span>                                             std_star,</div>
+<div class="line"><a name="l02929"></a><span class="lineno"> 2929</span>                                             arcsec_tol);</div>
+<div class="line"><a name="l02930"></a><span class="lineno"> 2930</span>             }</div>
+<div class="line"><a name="l02931"></a><span class="lineno"> 2931</span>             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (import_unknown)    <span class="comment">/* import non-std stars */</span></div>
+<div class="line"><a name="l02932"></a><span class="lineno"> 2932</span>             {</div>
+<div class="line"><a name="l02933"></a><span class="lineno"> 2933</span>                 fors_std_star   *s_in_list;</div>
+<div class="line"><a name="l02934"></a><span class="lineno"> 2934</span>                 </div>
+<div class="line"><a name="l02935"></a><span class="lineno"> 2935</span>                 std_star->trusted = <span class="keyword">false</span>;  <span class="comment">/* don't trust ignoring table flag*/</span></div>
+<div class="line"><a name="l02936"></a><span class="lineno"> 2936</span>                 </div>
+<div class="line"><a name="l02937"></a><span class="lineno"> 2937</span>                 s_in_list = <a class="code" href="group__fors__photometry.html#gabffbeb12c88498ed45e6115a1b529c07" title="Insert a std star into a list, if the closest existing distance > maxd_arcsec.">fors_photometry_read_input_listinsert_star_if_new</a>(</div>
+<div class="line"><a name="l02938"></a><span class="lineno"> 2938</span>                                             *std_star_list,</div>
+<div class="line"><a name="l02939"></a><span class="lineno"> 2939</span>                                             std_star,</div>
+<div class="line"><a name="l02940"></a><span class="lineno"> 2940</span>                                             arcsec_tol);</div>
+<div class="line"><a name="l02941"></a><span class="lineno"> 2941</span>                 </div>
+<div class="line"><a name="l02942"></a><span class="lineno"> 2942</span>                 <span class="keywordflow">if</span> (s_in_list == std_star) <span class="comment">/* made it into list */</span></div>
+<div class="line"><a name="l02943"></a><span class="lineno"> 2943</span>                 {</div>
+<div class="line"><a name="l02944"></a><span class="lineno"> 2944</span>                     <span class="keywordtype">char</span>            name[16];</div>
+<div class="line"><a name="l02945"></a><span class="lineno"> 2945</span>                     sprintf(name, <span class="stringliteral">"non-std-%d"</span>, inonstd);</div>
+<div class="line"><a name="l02946"></a><span class="lineno"> 2946</span>                     fors_std_star_set_name(std_star, name);</div>
+<div class="line"><a name="l02947"></a><span class="lineno"> 2947</span>                     inonstd++;</div>
+<div class="line"><a name="l02948"></a><span class="lineno"> 2948</span>                 }</div>
+<div class="line"><a name="l02949"></a><span class="lineno"> 2949</span>                 </div>
+<div class="line"><a name="l02950"></a><span class="lineno"> 2950</span>                 std_star = s_in_list;</div>
+<div class="line"><a name="l02951"></a><span class="lineno"> 2951</span>             }</div>
+<div class="line"><a name="l02952"></a><span class="lineno"> 2952</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l02953"></a><span class="lineno"> 2953</span>             {</div>
+<div class="line"><a name="l02954"></a><span class="lineno"> 2954</span>                 fors_std_star_delete(&std_star);</div>
+<div class="line"><a name="l02955"></a><span class="lineno"> 2955</span>             }</div>
+<div class="line"><a name="l02956"></a><span class="lineno"> 2956</span>             </div>
+<div class="line"><a name="l02957"></a><span class="lineno"> 2957</span>             <span class="keywordflow">if</span> (std_star != NULL)</div>
+<div class="line"><a name="l02958"></a><span class="lineno"> 2958</span>             {</div>
+<div class="line"><a name="l02959"></a><span class="lineno"> 2959</span>                 <a class="code" href="structentry.html">entry</a>   *e;</div>
+<div class="line"><a name="l02960"></a><span class="lineno"> 2960</span>                 obs_star->id = std_star;</div>
+<div class="line"><a name="l02961"></a><span class="lineno"> 2961</span>                 <span class="comment">/* cannot identify std star id yet, because the used list</span></div>
+<div class="line"><a name="l02962"></a><span class="lineno"> 2962</span> <span class="comment">                 * object totally scrambles the order (for whatever reason) */</span></div>
+<div class="line"><a name="l02963"></a><span class="lineno"> 2963</span>                 e = <a class="code" href="group__fors__photometry.html#ga0a8c8c9ebad2d55ac56e61c820fa3f27" title="entry constructor">entry_new</a>(              iframe,</div>
+<div class="line"><a name="l02964"></a><span class="lineno"> 2964</span>                                             -1,</div>
+<div class="line"><a name="l02965"></a><span class="lineno"> 2965</span>                                             airmass, </div>
+<div class="line"><a name="l02966"></a><span class="lineno"> 2966</span>                                             setting_f->average_gain,</div>
+<div class="line"><a name="l02967"></a><span class="lineno"> 2967</span>                                             setting_f->exposure_time,</div>
+<div class="line"><a name="l02968"></a><span class="lineno"> 2968</span>                                             atm_ext_id,</div>
+<div class="line"><a name="l02969"></a><span class="lineno"> 2969</span>                                             obs_star);</div>
+<div class="line"><a name="l02970"></a><span class="lineno"> 2970</span>                 entry_list_insert(      obs, e);</div>
+<div class="line"><a name="l02971"></a><span class="lineno"> 2971</span>             }</div>
+<div class="line"><a name="l02972"></a><span class="lineno"> 2972</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l02973"></a><span class="lineno"> 2973</span>             {</div>
+<div class="line"><a name="l02974"></a><span class="lineno"> 2974</span>                 <a class="code" href="group__fors__star.html#ga517c8c542ad4eb8145fa664be9625a98" title="Delete object and set pointer to NULL - but ignore the standard star.">fors_star_delete_but_standard</a>(&obs_star);</div>
+<div class="line"><a name="l02975"></a><span class="lineno"> 2975</span>             }</div>
+<div class="line"><a name="l02976"></a><span class="lineno"> 2976</span> </div>
+<div class="line"><a name="l02977"></a><span class="lineno"> 2977</span>         }<span class="comment">/* for each star */</span></div>
+<div class="line"><a name="l02978"></a><span class="lineno"> 2978</span> </div>
+<div class="line"><a name="l02979"></a><span class="lineno"> 2979</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l02980"></a><span class="lineno"> 2980</span>         cpl_table_delete(aligned_phot); aligned_phot = NULL;</div>
+<div class="line"><a name="l02981"></a><span class="lineno"> 2981</span>         <a class="code" href="group__fors__setting.html#ga6a9999a057167a310f81224d0218cb83" title="Deallocate and and set pointer to NULL.">fors_setting_delete</a>(&setting_f);</div>
+<div class="line"><a name="l02982"></a><span class="lineno"> 2982</span> </div>
+<div class="line"><a name="l02983"></a><span class="lineno"> 2983</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l02984"></a><span class="lineno"> 2984</span>     }<span class="comment">/* For each table */</span></div>
+<div class="line"><a name="l02985"></a><span class="lineno"> 2985</span> </div>
+<div class="line"><a name="l02986"></a><span class="lineno"> 2986</span>     *n_frames = iframe;</div>
+<div class="line"><a name="l02987"></a><span class="lineno"> 2987</span>     </div>
+<div class="line"><a name="l02988"></a><span class="lineno"> 2988</span>     </div>
+<div class="line"><a name="l02989"></a><span class="lineno"> 2989</span>     <span class="comment">/* The used list object is actually fed in reverse order (because there</span></div>
+<div class="line"><a name="l02990"></a><span class="lineno"> 2990</span> <span class="comment">     * is only the function list_insert, but not list_append). But we would</span></div>
+<div class="line"><a name="l02991"></a><span class="lineno"> 2991</span> <span class="comment">     * like to access the elements in the same order as we imported them, so</span></div>
+<div class="line"><a name="l02992"></a><span class="lineno"> 2992</span> <span class="comment">     * the fix was the invention of the function list_reverse().</span></div>
+<div class="line"><a name="l02993"></a><span class="lineno"> 2993</span> <span class="comment">     * hlorch, 17.02.2009 */</span></div>
+<div class="line"><a name="l02994"></a><span class="lineno"> 2994</span>     entry_list_reverse(obs);</div>
+<div class="line"><a name="l02995"></a><span class="lineno"> 2995</span>     fors_std_star_list_reverse(*std_star_list);</div>
+<div class="line"><a name="l02996"></a><span class="lineno"> 2996</span>     </div>
+<div class="line"><a name="l02997"></a><span class="lineno"> 2997</span>     <span class="comment">/* determine the observation's object id */</span></div>
+<div class="line"><a name="l02998"></a><span class="lineno"> 2998</span>     {</div>
+<div class="line"><a name="l02999"></a><span class="lineno"> 2999</span>         fors_std_star   *ref;</div>
+<div class="line"><a name="l03000"></a><span class="lineno"> 3000</span>         <a class="code" href="structentry.html">entry</a>           *e;</div>
+<div class="line"><a name="l03001"></a><span class="lineno"> 3001</span>         </div>
+<div class="line"><a name="l03002"></a><span class="lineno"> 3002</span>         <span class="keywordflow">for</span> (e = entry_list_first(obs); e != NULL; e = entry_list_next(obs))</div>
+<div class="line"><a name="l03003"></a><span class="lineno"> 3003</span>         {</div>
+<div class="line"><a name="l03004"></a><span class="lineno"> 3004</span>             <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l03005"></a><span class="lineno"> 3005</span>             <span class="keywordflow">for</span> (   ref = fors_std_star_list_first(*std_star_list), i = 0;</div>
+<div class="line"><a name="l03006"></a><span class="lineno"> 3006</span>                     ref != NULL;</div>
+<div class="line"><a name="l03007"></a><span class="lineno"> 3007</span>                     ref = fors_std_star_list_next(*std_star_list), i++)</div>
+<div class="line"><a name="l03008"></a><span class="lineno"> 3008</span>             {</div>
+<div class="line"><a name="l03009"></a><span class="lineno"> 3009</span>                 <span class="keywordflow">if</span> (e->star->id == ref)</div>
+<div class="line"><a name="l03010"></a><span class="lineno"> 3010</span>                 {</div>
+<div class="line"><a name="l03011"></a><span class="lineno"> 3011</span>                     e->star_index = i;</div>
+<div class="line"><a name="l03012"></a><span class="lineno"> 3012</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l03013"></a><span class="lineno"> 3013</span>                 }</div>
+<div class="line"><a name="l03014"></a><span class="lineno"> 3014</span>             }</div>
+<div class="line"><a name="l03015"></a><span class="lineno"> 3015</span>         }</div>
+<div class="line"><a name="l03016"></a><span class="lineno"> 3016</span>     }</div>
+<div class="line"><a name="l03017"></a><span class="lineno"> 3017</span> </div>
+<div class="line"><a name="l03018"></a><span class="lineno"> 3018</span>     cassure(                                entry_list_size(obs) > 0,</div>
+<div class="line"><a name="l03019"></a><span class="lineno"> 3019</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l03020"></a><span class="lineno"> 3020</span>                                             <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l03021"></a><span class="lineno"> 3021</span>                                             <span class="stringliteral">"No stars found"</span>);</div>
+<div class="line"><a name="l03022"></a><span class="lineno"> 3022</span> </div>
+<div class="line"><a name="l03023"></a><span class="lineno"> 3023</span>     <span class="keywordflow">return</span> obs;</div>
+<div class="line"><a name="l03024"></a><span class="lineno"> 3024</span> }</div>
+<div class="line"><a name="l03025"></a><span class="lineno"> 3025</span> </div>
+<div class="line"><a name="l03026"></a><span class="lineno"> 3026</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03027"></a><span class="lineno"> 3027</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l03028"></a><span class="lineno"> 3028</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l03029"></a><span class="lineno"> 3029</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l03042"></a><span class="lineno"> 3042</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03043"></a><span class="lineno"> 3043</span> <span class="keyword">static</span> fors_std_star*</div>
+<div class="line"><a name="l03044"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gabffbeb12c88498ed45e6115a1b529c07"> 3044</a></span> <a class="code" href="group__fors__photometry.html#gabffbeb12c88498ed45e6115a1b529c07" title="Insert a std star into a list, if the closest existing distance > maxd_arcsec.">fors_photometry_read_input_listinsert_star_if_new</a>(</div>
+<div class="line"><a name="l03045"></a><span class="lineno"> 3045</span>                                             fors_std_star_list  *std_list,</div>
+<div class="line"><a name="l03046"></a><span class="lineno"> 3046</span>                                             fors_std_star       *std,</div>
+<div class="line"><a name="l03047"></a><span class="lineno"> 3047</span>                                             <span class="keywordtype">double</span>              mind_arcsec)</div>
+<div class="line"><a name="l03048"></a><span class="lineno"> 3048</span> {</div>
+<div class="line"><a name="l03049"></a><span class="lineno"> 3049</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l03050"></a><span class="lineno"> 3050</span>     <span class="keywordtype">bool</span>            found = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l03051"></a><span class="lineno"> 3051</span>     </div>
+<div class="line"><a name="l03052"></a><span class="lineno"> 3052</span>     cassure_automsg(                        std_list != NULL,</div>
+<div class="line"><a name="l03053"></a><span class="lineno"> 3053</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03054"></a><span class="lineno"> 3054</span>                                             <span class="keywordflow">return</span> std);</div>
+<div class="line"><a name="l03055"></a><span class="lineno"> 3055</span>     cassure_automsg(                        std != NULL,</div>
+<div class="line"><a name="l03056"></a><span class="lineno"> 3056</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03057"></a><span class="lineno"> 3057</span>                                             <span class="keywordflow">return</span> std);</div>
+<div class="line"><a name="l03058"></a><span class="lineno"> 3058</span>     cassure_automsg(                        mind_arcsec > 0,</div>
+<div class="line"><a name="l03059"></a><span class="lineno"> 3059</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l03060"></a><span class="lineno"> 3060</span>                                             <span class="keywordflow">return</span> std);</div>
+<div class="line"><a name="l03061"></a><span class="lineno"> 3061</span>     </div>
+<div class="line"><a name="l03062"></a><span class="lineno"> 3062</span>     <span class="keywordflow">if</span> (fors_std_star_list_size(std_list) > 0)</div>
+<div class="line"><a name="l03063"></a><span class="lineno"> 3063</span>     {</div>
+<div class="line"><a name="l03064"></a><span class="lineno"> 3064</span>         fors_std_star   *nearest;</div>
+<div class="line"><a name="l03065"></a><span class="lineno"> 3065</span>         <span class="keywordtype">double</span>          dist_arcsec;</div>
+<div class="line"><a name="l03066"></a><span class="lineno"> 3066</span>         <span class="comment">/* Only if the nearest standard star is farther </span></div>
+<div class="line"><a name="l03067"></a><span class="lineno"> 3067</span> <span class="comment">         * away than 5 arcsecs, insert this standard star </span></div>
+<div class="line"><a name="l03068"></a><span class="lineno"> 3068</span> <span class="comment">         * in the standard star list. */</span></div>
+<div class="line"><a name="l03069"></a><span class="lineno"> 3069</span>         nearest = fors_std_star_list_kth_val(</div>
+<div class="line"><a name="l03070"></a><span class="lineno"> 3070</span>                                             std_list, 1,</div>
+<div class="line"><a name="l03071"></a><span class="lineno"> 3071</span>                                             (fors_std_star_list_func_eval)</div>
+<div class="line"><a name="l03072"></a><span class="lineno"> 3072</span>                                             fors_std_star_dist_arcsec,</div>
+<div class="line"><a name="l03073"></a><span class="lineno"> 3073</span>                                             std);</div>
+<div class="line"><a name="l03074"></a><span class="lineno"> 3074</span>         passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> std);</div>
+<div class="line"><a name="l03075"></a><span class="lineno"> 3075</span>         </div>
+<div class="line"><a name="l03076"></a><span class="lineno"> 3076</span>         dist_arcsec = fors_std_star_dist_arcsec(nearest, std);</div>
+<div class="line"><a name="l03077"></a><span class="lineno"> 3077</span>         passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> std);</div>
+<div class="line"><a name="l03078"></a><span class="lineno"> 3078</span>         </div>
+<div class="line"><a name="l03079"></a><span class="lineno"> 3079</span>         cpl_msg_debug(                      cpl_func,</div>
+<div class="line"><a name="l03080"></a><span class="lineno"> 3080</span>                                             <span class="stringliteral">"dist = %f arcseconds"</span>,</div>
+<div class="line"><a name="l03081"></a><span class="lineno"> 3081</span>                                             dist_arcsec);</div>
+<div class="line"><a name="l03082"></a><span class="lineno"> 3082</span> </div>
+<div class="line"><a name="l03083"></a><span class="lineno"> 3083</span>         <span class="keywordflow">if</span> (dist_arcsec < mind_arcsec)</div>
+<div class="line"><a name="l03084"></a><span class="lineno"> 3084</span>         {</div>
+<div class="line"><a name="l03085"></a><span class="lineno"> 3085</span>             <span class="comment">/* trust a star only if it's always trusted */</span></div>
+<div class="line"><a name="l03086"></a><span class="lineno"> 3086</span>             nearest->trusted &= std->trusted;</div>
+<div class="line"><a name="l03087"></a><span class="lineno"> 3087</span>             <span class="comment">/* delete the new star and link to the old one */</span></div>
+<div class="line"><a name="l03088"></a><span class="lineno"> 3088</span>             fors_std_star_delete(&std);</div>
+<div class="line"><a name="l03089"></a><span class="lineno"> 3089</span>             std = nearest;</div>
+<div class="line"><a name="l03090"></a><span class="lineno"> 3090</span>             found = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l03091"></a><span class="lineno"> 3091</span>         }</div>
+<div class="line"><a name="l03092"></a><span class="lineno"> 3092</span>     }</div>
+<div class="line"><a name="l03093"></a><span class="lineno"> 3093</span>     </div>
+<div class="line"><a name="l03094"></a><span class="lineno"> 3094</span>     <span class="keywordflow">if</span> (!found)</div>
+<div class="line"><a name="l03095"></a><span class="lineno"> 3095</span>     {</div>
+<div class="line"><a name="l03096"></a><span class="lineno"> 3096</span>         fors_std_star_list_insert(std_list, std);</div>
+<div class="line"><a name="l03097"></a><span class="lineno"> 3097</span>     }</div>
+<div class="line"><a name="l03098"></a><span class="lineno"> 3098</span>     </div>
+<div class="line"><a name="l03099"></a><span class="lineno"> 3099</span>     <span class="keywordflow">return</span> std;</div>
+<div class="line"><a name="l03100"></a><span class="lineno"> 3100</span> }</div>
+<div class="line"><a name="l03101"></a><span class="lineno"> 3101</span> </div>
+<div class="line"><a name="l03102"></a><span class="lineno"> 3102</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03103"></a><span class="lineno"> 3103</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l03104"></a><span class="lineno"> 3104</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l03105"></a><span class="lineno"> 3105</span> <span class="preprocessor"></span><span class="comment">/*</span></div>
+<div class="line"><a name="l03106"></a><span class="lineno"> 3106</span> <span class="comment"> * @brief   Adjust @em trusted flags.</span></div>
+<div class="line"><a name="l03107"></a><span class="lineno"> 3107</span> <span class="comment"> * @param   stdl            Standard star list</span></div>
+<div class="line"><a name="l03108"></a><span class="lineno"> 3108</span> <span class="comment"> * @param   el              Observation entry list</span></div>
+<div class="line"><a name="l03109"></a><span class="lineno"> 3109</span> <span class="comment"> * @param   override_fit_m  Flag whether to fit all catalog magnitudes</span></div>
+<div class="line"><a name="l03110"></a><span class="lineno"> 3110</span> <span class="comment"> * @param   n_mag_fits      (Output) number of magnitudes to fit</span></div>
+<div class="line"><a name="l03111"></a><span class="lineno"> 3111</span> <span class="comment"> * @return  CPL error code</span></div>
+<div class="line"><a name="l03112"></a><span class="lineno"> 3112</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l03113"></a><span class="lineno"> 3113</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03114"></a><span class="lineno"> 3114</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l03115"></a><span class="lineno"> 3115</span> fors_photometry_adjust_fit_mag_flags(       fors_std_star_list  *stdl,</div>
+<div class="line"><a name="l03116"></a><span class="lineno"> 3116</span>                                             entry_list          *obsl,</div>
+<div class="line"><a name="l03117"></a><span class="lineno"> 3117</span>                                             <span class="keywordtype">bool</span>                override_fit_m,</div>
+<div class="line"><a name="l03118"></a><span class="lineno"> 3118</span>                                             <span class="keywordtype">int</span>                 *n_mag_fits)</div>
+<div class="line"><a name="l03119"></a><span class="lineno"> 3119</span> {</div>
+<div class="line"><a name="l03120"></a><span class="lineno"> 3120</span>     fors_std_star   *std;</div>
+<div class="line"><a name="l03121"></a><span class="lineno"> 3121</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l03122"></a><span class="lineno"> 3122</span>     </div>
+<div class="line"><a name="l03123"></a><span class="lineno"> 3123</span>     cassure_automsg(                        stdl != NULL,</div>
+<div class="line"><a name="l03124"></a><span class="lineno"> 3124</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03125"></a><span class="lineno"> 3125</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03126"></a><span class="lineno"> 3126</span>     cassure_automsg(                        obsl != NULL,</div>
+<div class="line"><a name="l03127"></a><span class="lineno"> 3127</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03128"></a><span class="lineno"> 3128</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03129"></a><span class="lineno"> 3129</span>     cassure_automsg(                        n_mag_fits != NULL,</div>
+<div class="line"><a name="l03130"></a><span class="lineno"> 3130</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03131"></a><span class="lineno"> 3131</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03132"></a><span class="lineno"> 3132</span>     </div>
+<div class="line"><a name="l03133"></a><span class="lineno"> 3133</span>     *n_mag_fits = 0;</div>
+<div class="line"><a name="l03134"></a><span class="lineno"> 3134</span>     </div>
+<div class="line"><a name="l03135"></a><span class="lineno"> 3135</span>     <span class="comment">/* If (override_fit_m), then fit all magnitudes.</span></div>
+<div class="line"><a name="l03136"></a><span class="lineno"> 3136</span> <span class="comment">     * The intention is to fit in a best way the f polynomial. Just one</span></div>
+<div class="line"><a name="l03137"></a><span class="lineno"> 3137</span> <span class="comment">     * star is necessary to fix the offset, so just don't fit the magnitude</span></div>
+<div class="line"><a name="l03138"></a><span class="lineno"> 3138</span> <span class="comment">     * of the first one. */</span></div>
+<div class="line"><a name="l03139"></a><span class="lineno"> 3139</span>     <span class="keywordflow">if</span> (override_fit_m)</div>
+<div class="line"><a name="l03140"></a><span class="lineno"> 3140</span>     {</div>
+<div class="line"><a name="l03141"></a><span class="lineno"> 3141</span>         std = fors_std_star_list_first(stdl);</div>
+<div class="line"><a name="l03142"></a><span class="lineno"> 3142</span>         <span class="comment">/* find the first trusted object */</span></div>
+<div class="line"><a name="l03143"></a><span class="lineno"> 3143</span>         <span class="keywordflow">while</span> (std != NULL && std->trusted == <span class="keyword">false</span>)</div>
+<div class="line"><a name="l03144"></a><span class="lineno"> 3144</span>         {</div>
+<div class="line"><a name="l03145"></a><span class="lineno"> 3145</span>             std = fors_std_star_list_next(stdl);</div>
+<div class="line"><a name="l03146"></a><span class="lineno"> 3146</span>             (*n_mag_fits)++;</div>
+<div class="line"><a name="l03147"></a><span class="lineno"> 3147</span>         }</div>
+<div class="line"><a name="l03148"></a><span class="lineno"> 3148</span>         <span class="comment">/* keep this one */</span></div>
+<div class="line"><a name="l03149"></a><span class="lineno"> 3149</span>         <span class="keywordflow">if</span> (std != NULL)</div>
+<div class="line"><a name="l03150"></a><span class="lineno"> 3150</span>             std = fors_std_star_list_next(stdl);</div>
+<div class="line"><a name="l03151"></a><span class="lineno"> 3151</span>         <span class="comment">/* and set the rest to non-trusted */</span></div>
+<div class="line"><a name="l03152"></a><span class="lineno"> 3152</span>         <span class="keywordflow">for</span> ( ; std != NULL; std = fors_std_star_list_next(stdl))</div>
+<div class="line"><a name="l03153"></a><span class="lineno"> 3153</span>         {</div>
+<div class="line"><a name="l03154"></a><span class="lineno"> 3154</span>             std->trusted = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l03155"></a><span class="lineno"> 3155</span>             (*n_mag_fits)++;</div>
+<div class="line"><a name="l03156"></a><span class="lineno"> 3156</span>         }</div>
+<div class="line"><a name="l03157"></a><span class="lineno"> 3157</span>     }</div>
+<div class="line"><a name="l03158"></a><span class="lineno"> 3158</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l03159"></a><span class="lineno"> 3159</span>     {</div>
+<div class="line"><a name="l03160"></a><span class="lineno"> 3160</span>         <span class="keywordflow">for</span> (   std = fors_std_star_list_first(stdl);</div>
+<div class="line"><a name="l03161"></a><span class="lineno"> 3161</span>                 std != NULL;</div>
+<div class="line"><a name="l03162"></a><span class="lineno"> 3162</span>                 std = fors_std_star_list_next(stdl))</div>
+<div class="line"><a name="l03163"></a><span class="lineno"> 3163</span>         {</div>
+<div class="line"><a name="l03164"></a><span class="lineno"> 3164</span>             <span class="keywordflow">if</span>(! std->trusted)</div>
+<div class="line"><a name="l03165"></a><span class="lineno"> 3165</span>                 (*n_mag_fits)++;</div>
+<div class="line"><a name="l03166"></a><span class="lineno"> 3166</span>         }</div>
+<div class="line"><a name="l03167"></a><span class="lineno"> 3167</span>     }</div>
+<div class="line"><a name="l03168"></a><span class="lineno"> 3168</span>     </div>
+<div class="line"><a name="l03169"></a><span class="lineno"> 3169</span>     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l03170"></a><span class="lineno"> 3170</span>             CPL_ERROR_NONE :</div>
+<div class="line"><a name="l03171"></a><span class="lineno"> 3171</span>             cpl_error_get_code());</div>
+<div class="line"><a name="l03172"></a><span class="lineno"> 3172</span> }</div>
+<div class="line"><a name="l03173"></a><span class="lineno"> 3173</span> </div>
+<div class="line"><a name="l03174"></a><span class="lineno"> 3174</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03175"></a><span class="lineno"> 3175</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l03176"></a><span class="lineno"> 3176</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l03177"></a><span class="lineno"> 3177</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l03178"></a><span class="lineno"> 3178</span> <span class="preprocessor">    cpl_array_delete(n_obs_per_std); n_obs_per_std = NULL; \</span></div>
+<div class="line"><a name="l03179"></a><span class="lineno"> 3179</span> <span class="preprocessor">    fors_std_star_list_delete(&std_list_copy, NULL); \</span></div>
+<div class="line"><a name="l03180"></a><span class="lineno"> 3180</span> <span class="preprocessor">    entry_list_delete(&obs_list_copy, NULL); \</span></div>
+<div class="line"><a name="l03181"></a><span class="lineno"> 3181</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l03182"></a><span class="lineno"> 3182</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l03189"></a><span class="lineno"> 3189</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03190"></a><span class="lineno"> 3190</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l03191"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga6e8831942438a88bb3287ed491961ec1"> 3191</a></span> <a class="code" href="group__fors__photometry.html#ga6e8831942438a88bb3287ed491961ec1" title="Remove all standard stars which are fitted but were observed only once.">fors_photometry_remove_unnecessary</a>(         fors_std_star_list  *std_list,</div>
+<div class="line"><a name="l03192"></a><span class="lineno"> 3192</span>                                             entry_list          *obs_list,</div>
+<div class="line"><a name="l03193"></a><span class="lineno"> 3193</span>                                             <span class="keywordtype">int</span>                 *n_mag_fits)</div>
+<div class="line"><a name="l03194"></a><span class="lineno"> 3194</span> {</div>
+<div class="line"><a name="l03195"></a><span class="lineno"> 3195</span>     cpl_array           *n_obs_per_std = NULL;</div>
+<div class="line"><a name="l03196"></a><span class="lineno"> 3196</span>     fors_std_star_list  *std_list_copy = NULL;</div>
+<div class="line"><a name="l03197"></a><span class="lineno"> 3197</span>     entry_list          *obs_list_copy = NULL;</div>
+<div class="line"><a name="l03198"></a><span class="lineno"> 3198</span>     fors_std_star       *std;</div>
+<div class="line"><a name="l03199"></a><span class="lineno"> 3199</span>     <a class="code" href="structentry.html">entry</a>               *obs;</div>
+<div class="line"><a name="l03200"></a><span class="lineno"> 3200</span>     <span class="keywordtype">int</span>                 n_std_stars,</div>
+<div class="line"><a name="l03201"></a><span class="lineno"> 3201</span>                         n_removed = 0,</div>
+<div class="line"><a name="l03202"></a><span class="lineno"> 3202</span>                         n;</div>
+<div class="line"><a name="l03203"></a><span class="lineno"> 3203</span>     cpl_errorstate      errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l03204"></a><span class="lineno"> 3204</span>     </div>
+<div class="line"><a name="l03205"></a><span class="lineno"> 3205</span>     cassure_automsg(                        std_list != NULL,</div>
+<div class="line"><a name="l03206"></a><span class="lineno"> 3206</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03207"></a><span class="lineno"> 3207</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03208"></a><span class="lineno"> 3208</span>     cassure_automsg(                        obs_list != NULL,</div>
+<div class="line"><a name="l03209"></a><span class="lineno"> 3209</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03210"></a><span class="lineno"> 3210</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03211"></a><span class="lineno"> 3211</span>     cassure_automsg(                        n_mag_fits != NULL,</div>
+<div class="line"><a name="l03212"></a><span class="lineno"> 3212</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03213"></a><span class="lineno"> 3213</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03214"></a><span class="lineno"> 3214</span>     </div>
+<div class="line"><a name="l03215"></a><span class="lineno"> 3215</span>     *n_mag_fits = 0;</div>
+<div class="line"><a name="l03216"></a><span class="lineno"> 3216</span>     </div>
+<div class="line"><a name="l03217"></a><span class="lineno"> 3217</span>     n_std_stars = fors_std_star_list_size(std_list);</div>
+<div class="line"><a name="l03218"></a><span class="lineno"> 3218</span>     </div>
+<div class="line"><a name="l03219"></a><span class="lineno"> 3219</span>     n_obs_per_std = <a class="code" href="group__fors__photometry.html#ga182915aa06bfd142318b3c9443a80e80" title="Count the number of observations of each standard star.">fors_photometry_count_observations</a>(std_list, obs_list);</div>
+<div class="line"><a name="l03220"></a><span class="lineno"> 3220</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03221"></a><span class="lineno"> 3221</span>     </div>
+<div class="line"><a name="l03222"></a><span class="lineno"> 3222</span>     <span class="comment">/* We are not so sure what happens if we iterate the FORS list and at the</span></div>
+<div class="line"><a name="l03223"></a><span class="lineno"> 3223</span> <span class="comment">     * same time remove entries, so copy the list to temporarily keep the</span></div>
+<div class="line"><a name="l03224"></a><span class="lineno"> 3224</span> <span class="comment">     * pointers. */</span></div>
+<div class="line"><a name="l03225"></a><span class="lineno"> 3225</span>     std_list_copy = fors_std_star_list_duplicate(std_list, NULL);</div>
+<div class="line"><a name="l03226"></a><span class="lineno"> 3226</span>     obs_list_copy = entry_list_duplicate(obs_list, NULL);</div>
+<div class="line"><a name="l03227"></a><span class="lineno"> 3227</span>     </div>
+<div class="line"><a name="l03228"></a><span class="lineno"> 3228</span>     <span class="comment">/* first remove all unnecessary observation entries */</span></div>
+<div class="line"><a name="l03229"></a><span class="lineno"> 3229</span>     <span class="keywordflow">for</span> (   obs = entry_list_first(obs_list_copy);</div>
+<div class="line"><a name="l03230"></a><span class="lineno"> 3230</span>             obs != NULL;</div>
+<div class="line"><a name="l03231"></a><span class="lineno"> 3231</span>             obs = entry_list_next(obs_list_copy))</div>
+<div class="line"><a name="l03232"></a><span class="lineno"> 3232</span>     {</div>
+<div class="line"><a name="l03233"></a><span class="lineno"> 3233</span>         <span class="keywordtype">int</span>     n_obs;</div>
+<div class="line"><a name="l03234"></a><span class="lineno"> 3234</span>         <span class="keywordtype">bool</span>    <span class="keyword">remove</span> = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l03235"></a><span class="lineno"> 3235</span>         </div>
+<div class="line"><a name="l03236"></a><span class="lineno"> 3236</span>         <span class="keyword">remove</span> |= (obs->star_index < 0 || obs->star_index >= n_std_stars);</div>
+<div class="line"><a name="l03237"></a><span class="lineno"> 3237</span>         </div>
+<div class="line"><a name="l03238"></a><span class="lineno"> 3238</span>         n_obs = cpl_array_get_int(n_obs_per_std, obs->star_index, NULL);</div>
+<div class="line"><a name="l03239"></a><span class="lineno"> 3239</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                             cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l03240"></a><span class="lineno"> 3240</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l03241"></a><span class="lineno"> 3241</span>                                             NULL);</div>
+<div class="line"><a name="l03242"></a><span class="lineno"> 3242</span>         <span class="keyword">remove</span> |= (n_obs < 2 && !obs->star->id->trusted);</div>
+<div class="line"><a name="l03243"></a><span class="lineno"> 3243</span>         </div>
+<div class="line"><a name="l03244"></a><span class="lineno"> 3244</span>         <span class="keywordflow">if</span> (<span class="keyword">remove</span>)</div>
+<div class="line"><a name="l03245"></a><span class="lineno"> 3245</span>         {</div>
+<div class="line"><a name="l03246"></a><span class="lineno"> 3246</span>             entry_list_remove(obs_list, obs);</div>
+<div class="line"><a name="l03247"></a><span class="lineno"> 3247</span>             <a class="code" href="group__fors__photometry.html#ga24e72dc7095e56d37033c584bd279f13" title="Destructor.">entry_delete_but_standard</a>(&obs);</div>
+<div class="line"><a name="l03248"></a><span class="lineno"> 3248</span>         }</div>
+<div class="line"><a name="l03249"></a><span class="lineno"> 3249</span>     }</div>
+<div class="line"><a name="l03250"></a><span class="lineno"> 3250</span>     </div>
+<div class="line"><a name="l03251"></a><span class="lineno"> 3251</span>     <span class="keywordflow">for</span> (   std = fors_std_star_list_first(std_list_copy), n = 0;</div>
+<div class="line"><a name="l03252"></a><span class="lineno"> 3252</span>             std != NULL;</div>
+<div class="line"><a name="l03253"></a><span class="lineno"> 3253</span>             std = fors_std_star_list_next(std_list_copy), n++)</div>
+<div class="line"><a name="l03254"></a><span class="lineno"> 3254</span>     {</div>
+<div class="line"><a name="l03255"></a><span class="lineno"> 3255</span>         <span class="keywordtype">int</span>     n_obs;</div>
+<div class="line"><a name="l03256"></a><span class="lineno"> 3256</span>         </div>
+<div class="line"><a name="l03257"></a><span class="lineno"> 3257</span>         n_obs = cpl_array_get_int(n_obs_per_std, n, NULL);</div>
+<div class="line"><a name="l03258"></a><span class="lineno"> 3258</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                             cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l03259"></a><span class="lineno"> 3259</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l03260"></a><span class="lineno"> 3260</span>                                             NULL);</div>
+<div class="line"><a name="l03261"></a><span class="lineno"> 3261</span>         </div>
+<div class="line"><a name="l03262"></a><span class="lineno"> 3262</span>         <span class="keywordflow">if</span> (n_obs < 2 && !std->trusted)</div>
+<div class="line"><a name="l03263"></a><span class="lineno"> 3263</span>         {</div>
+<div class="line"><a name="l03264"></a><span class="lineno"> 3264</span>             fors_std_star_list_remove(std_list, std);</div>
+<div class="line"><a name="l03265"></a><span class="lineno"> 3265</span>             fors_std_star_delete(&std);</div>
+<div class="line"><a name="l03266"></a><span class="lineno"> 3266</span>             n_removed++;</div>
+<div class="line"><a name="l03267"></a><span class="lineno"> 3267</span>         }</div>
+<div class="line"><a name="l03268"></a><span class="lineno"> 3268</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span>(!std->trusted)</div>
+<div class="line"><a name="l03269"></a><span class="lineno"> 3269</span>         {</div>
+<div class="line"><a name="l03270"></a><span class="lineno"> 3270</span>             (*n_mag_fits)++;</div>
+<div class="line"><a name="l03271"></a><span class="lineno"> 3271</span>         }</div>
+<div class="line"><a name="l03272"></a><span class="lineno"> 3272</span>     }</div>
+<div class="line"><a name="l03273"></a><span class="lineno"> 3273</span>     </div>
+<div class="line"><a name="l03274"></a><span class="lineno"> 3274</span>     cleanup;    <span class="comment">/* don't need that anymore */</span></div>
+<div class="line"><a name="l03275"></a><span class="lineno"> 3275</span>     </div>
+<div class="line"><a name="l03276"></a><span class="lineno"> 3276</span>     <span class="comment">/* Set the new star indices */</span></div>
+<div class="line"><a name="l03277"></a><span class="lineno"> 3277</span>     <span class="keywordflow">for</span> (   obs = entry_list_first(obs_list);</div>
+<div class="line"><a name="l03278"></a><span class="lineno"> 3278</span>             obs != NULL;</div>
+<div class="line"><a name="l03279"></a><span class="lineno"> 3279</span>             obs = entry_list_next(obs_list))</div>
+<div class="line"><a name="l03280"></a><span class="lineno"> 3280</span>     {</div>
+<div class="line"><a name="l03281"></a><span class="lineno"> 3281</span>         <span class="keywordflow">for</span> (   std = fors_std_star_list_first(std_list), n = 0;</div>
+<div class="line"><a name="l03282"></a><span class="lineno"> 3282</span>                 std != NULL;</div>
+<div class="line"><a name="l03283"></a><span class="lineno"> 3283</span>                 std = fors_std_star_list_next(std_list), n++)</div>
+<div class="line"><a name="l03284"></a><span class="lineno"> 3284</span>         {</div>
+<div class="line"><a name="l03285"></a><span class="lineno"> 3285</span>             <span class="keywordflow">if</span> (obs->star->id == std)</div>
+<div class="line"><a name="l03286"></a><span class="lineno"> 3286</span>             {</div>
+<div class="line"><a name="l03287"></a><span class="lineno"> 3287</span>                 obs->star_index = n;</div>
+<div class="line"><a name="l03288"></a><span class="lineno"> 3288</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l03289"></a><span class="lineno"> 3289</span>             }</div>
+<div class="line"><a name="l03290"></a><span class="lineno"> 3290</span>         }</div>
+<div class="line"><a name="l03291"></a><span class="lineno"> 3291</span>     }</div>
+<div class="line"><a name="l03292"></a><span class="lineno"> 3292</span>     </div>
+<div class="line"><a name="l03293"></a><span class="lineno"> 3293</span>     <span class="keywordflow">if</span> (n_removed > 0)</div>
+<div class="line"><a name="l03294"></a><span class="lineno"> 3294</span>         cpl_msg_info(   cpl_func,</div>
+<div class="line"><a name="l03295"></a><span class="lineno"> 3295</span>                         <span class="stringliteral">"Discarded %d untrusted/fitted objects which were "</span></div>
+<div class="line"><a name="l03296"></a><span class="lineno"> 3296</span>                         <span class="stringliteral">"observed only once (and therefore don't contribute)."</span>,</div>
+<div class="line"><a name="l03297"></a><span class="lineno"> 3297</span>                         n_removed);</div>
+<div class="line"><a name="l03298"></a><span class="lineno"> 3298</span>     </div>
+<div class="line"><a name="l03299"></a><span class="lineno"> 3299</span>     cleanup;</div>
+<div class="line"><a name="l03300"></a><span class="lineno"> 3300</span>     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l03301"></a><span class="lineno"> 3301</span>             CPL_ERROR_NONE :</div>
+<div class="line"><a name="l03302"></a><span class="lineno"> 3302</span>             cpl_error_get_code());</div>
+<div class="line"><a name="l03303"></a><span class="lineno"> 3303</span> }</div>
+<div class="line"><a name="l03304"></a><span class="lineno"> 3304</span> </div>
+<div class="line"><a name="l03305"></a><span class="lineno"> 3305</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03306"></a><span class="lineno"> 3306</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l03307"></a><span class="lineno"> 3307</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l03308"></a><span class="lineno"> 3308</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l03309"></a><span class="lineno"> 3309</span> <span class="preprocessor">    cpl_array_unwrap(n_obs_a); n_obs_a = NULL; \</span></div>
+<div class="line"><a name="l03310"></a><span class="lineno"> 3310</span> <span class="preprocessor">    cpl_free(n_obs); n_obs = NULL; \</span></div>
+<div class="line"><a name="l03311"></a><span class="lineno"> 3311</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l03312"></a><span class="lineno"> 3312</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l03319"></a><span class="lineno"> 3319</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03320"></a><span class="lineno"> 3320</span> <span class="keyword">static</span> cpl_array*</div>
+<div class="line"><a name="l03321"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga182915aa06bfd142318b3c9443a80e80"> 3321</a></span> <a class="code" href="group__fors__photometry.html#ga182915aa06bfd142318b3c9443a80e80" title="Count the number of observations of each standard star.">fors_photometry_count_observations</a>(         fors_std_star_list  *std_list,</div>
+<div class="line"><a name="l03322"></a><span class="lineno"> 3322</span>                                             entry_list          *obs_list)</div>
+<div class="line"><a name="l03323"></a><span class="lineno"> 3323</span> {</div>
+<div class="line"><a name="l03324"></a><span class="lineno"> 3324</span>     <span class="keywordtype">int</span>         *n_obs = NULL;</div>
+<div class="line"><a name="l03325"></a><span class="lineno"> 3325</span>     cpl_array   *n_obs_a = NULL;</div>
+<div class="line"><a name="l03326"></a><span class="lineno"> 3326</span>     <a class="code" href="structentry.html">entry</a>       *e;</div>
+<div class="line"><a name="l03327"></a><span class="lineno"> 3327</span>     <span class="keywordtype">int</span>         n_std_stars;</div>
+<div class="line"><a name="l03328"></a><span class="lineno"> 3328</span>     </div>
+<div class="line"><a name="l03329"></a><span class="lineno"> 3329</span>     cassure_automsg(                        std_list != NULL,</div>
+<div class="line"><a name="l03330"></a><span class="lineno"> 3330</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03331"></a><span class="lineno"> 3331</span>                                             <span class="keywordflow">return</span> n_obs_a);</div>
+<div class="line"><a name="l03332"></a><span class="lineno"> 3332</span>     cassure_automsg(                        obs_list != NULL,</div>
+<div class="line"><a name="l03333"></a><span class="lineno"> 3333</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03334"></a><span class="lineno"> 3334</span>                                             <span class="keywordflow">return</span> n_obs_a);</div>
+<div class="line"><a name="l03335"></a><span class="lineno"> 3335</span>     </div>
+<div class="line"><a name="l03336"></a><span class="lineno"> 3336</span>     n_std_stars = fors_std_star_list_size(std_list);</div>
+<div class="line"><a name="l03337"></a><span class="lineno"> 3337</span>     n_obs = cpl_calloc(n_std_stars, <span class="keyword">sizeof</span>(*n_obs));</div>
+<div class="line"><a name="l03338"></a><span class="lineno"> 3338</span>     </div>
+<div class="line"><a name="l03339"></a><span class="lineno"> 3339</span>     <span class="keywordflow">for</span> (   e = entry_list_first(obs_list);</div>
+<div class="line"><a name="l03340"></a><span class="lineno"> 3340</span>             e != NULL;</div>
+<div class="line"><a name="l03341"></a><span class="lineno"> 3341</span>             e = entry_list_next(obs_list))</div>
+<div class="line"><a name="l03342"></a><span class="lineno"> 3342</span>     {</div>
+<div class="line"><a name="l03343"></a><span class="lineno"> 3343</span>         ppassure(                           e->star_index >= 0</div>
+<div class="line"><a name="l03344"></a><span class="lineno"> 3344</span>                                             && e->star_index < n_std_stars,</div>
+<div class="line"><a name="l03345"></a><span class="lineno"> 3345</span>                                             CPL_ERROR_UNSPECIFIED,</div>
+<div class="line"><a name="l03346"></a><span class="lineno"> 3346</span>                                             <span class="keywordflow">return</span> n_obs_a);</div>
+<div class="line"><a name="l03347"></a><span class="lineno"> 3347</span>         n_obs[e->star_index]++;</div>
+<div class="line"><a name="l03348"></a><span class="lineno"> 3348</span>     }</div>
+<div class="line"><a name="l03349"></a><span class="lineno"> 3349</span>     </div>
+<div class="line"><a name="l03350"></a><span class="lineno"> 3350</span>     n_obs_a = cpl_array_wrap_int(n_obs, n_std_stars);</div>
+<div class="line"><a name="l03351"></a><span class="lineno"> 3351</span>     <span class="keywordflow">return</span> n_obs_a;</div>
+<div class="line"><a name="l03352"></a><span class="lineno"> 3352</span> }</div>
+<div class="line"><a name="l03353"></a><span class="lineno"> 3353</span> </div>
+<div class="line"><a name="l03354"></a><span class="lineno"> 3354</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03355"></a><span class="lineno"> 3355</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l03356"></a><span class="lineno"> 3356</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l03357"></a><span class="lineno"> 3357</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l03358"></a><span class="lineno"> 3358</span> <span class="preprocessor">    fors_matrix_null(&lhs); \</span></div>
+<div class="line"><a name="l03359"></a><span class="lineno"> 3359</span> <span class="preprocessor">    if (n_fit_e_cols != NULL) \</span></div>
+<div class="line"><a name="l03360"></a><span class="lineno"> 3360</span> <span class="preprocessor">        *n_fit_e_cols = 0; \</span></div>
+<div class="line"><a name="l03361"></a><span class="lineno"> 3361</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l03362"></a><span class="lineno"> 3362</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l03386"></a><span class="lineno"> 3386</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03387"></a><span class="lineno"> 3387</span> <span class="keyword">static</span> cpl_matrix*</div>
+<div class="line"><a name="l03388"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#gabfcabff5102d27ba7b09e4398e057762"> 3388</a></span> <a class="code" href="group__fors__photometry.html#gabfcabff5102d27ba7b09e4398e057762" title="Build left hand side matrix equation part.">build_equations_lhs_matrix_from_parameters</a>( <span class="keyword">const</span> entry_list    *obs_list,</div>
+<div class="line"><a name="l03389"></a><span class="lineno"> 3389</span>                                             <span class="keyword">const</span> fors_std_star_list  *std_list,</div>
+<div class="line"><a name="l03390"></a><span class="lineno"> 3390</span>                                             <span class="keywordtype">bool</span>                fit_z,</div>
+<div class="line"><a name="l03391"></a><span class="lineno"> 3391</span>                                             <span class="keywordtype">bool</span>                fit_c,</div>
+<div class="line"><a name="l03392"></a><span class="lineno"> 3392</span>                                             <span class="keywordtype">int</span>                 *n_fit_e_cols)</div>
+<div class="line"><a name="l03393"></a><span class="lineno"> 3393</span> {</div>
+<div class="line"><a name="l03394"></a><span class="lineno"> 3394</span>     <span class="keywordtype">int</span>             n_std_stars,</div>
+<div class="line"><a name="l03395"></a><span class="lineno"> 3395</span>                     n_obs,</div>
+<div class="line"><a name="l03396"></a><span class="lineno"> 3396</span>                     n_col,</div>
+<div class="line"><a name="l03397"></a><span class="lineno"> 3397</span>                     n_fit_std_mag = 0,</div>
+<div class="line"><a name="l03398"></a><span class="lineno"> 3398</span>                     n_frames,</div>
+<div class="line"><a name="l03399"></a><span class="lineno"> 3399</span>                     n_atm_ext,  <span class="comment">/* nr of atm. extinction coefficients */</span></div>
+<div class="line"><a name="l03400"></a><span class="lineno"> 3400</span>                     row;</div>
+<div class="line"><a name="l03401"></a><span class="lineno"> 3401</span>     <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>     *e;</div>
+<div class="line"><a name="l03402"></a><span class="lineno"> 3402</span>     <span class="keyword">const</span> fors_std_star</div>
+<div class="line"><a name="l03403"></a><span class="lineno"> 3403</span>                     *std;</div>
+<div class="line"><a name="l03404"></a><span class="lineno"> 3404</span>     cpl_matrix      *lhs = NULL;</div>
+<div class="line"><a name="l03405"></a><span class="lineno"> 3405</span>     <span class="keywordtype">bool</span>            printed = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l03406"></a><span class="lineno"> 3406</span>     </div>
+<div class="line"><a name="l03407"></a><span class="lineno"> 3407</span>     <span class="comment">/* free output pointers */</span></div>
+<div class="line"><a name="l03408"></a><span class="lineno"> 3408</span>     cleanup;</div>
+<div class="line"><a name="l03409"></a><span class="lineno"> 3409</span>     </div>
+<div class="line"><a name="l03410"></a><span class="lineno"> 3410</span>     <span class="comment">/* check input */</span></div>
+<div class="line"><a name="l03411"></a><span class="lineno"> 3411</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> lhs, <span class="stringliteral">"Previous error caught."</span>);</div>
+<div class="line"><a name="l03412"></a><span class="lineno"> 3412</span>     </div>
+<div class="line"><a name="l03413"></a><span class="lineno"> 3413</span>     ppassure(                               obs_list != NULL</div>
+<div class="line"><a name="l03414"></a><span class="lineno"> 3414</span>                                             && std_list != NULL,</div>
+<div class="line"><a name="l03415"></a><span class="lineno"> 3415</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03416"></a><span class="lineno"> 3416</span>                                             <span class="keywordflow">return</span> lhs);</div>
+<div class="line"><a name="l03417"></a><span class="lineno"> 3417</span>     </div>
+<div class="line"><a name="l03418"></a><span class="lineno"> 3418</span>     n_std_stars = fors_std_star_list_size(std_list);</div>
+<div class="line"><a name="l03419"></a><span class="lineno"> 3419</span>     n_obs = entry_list_size(obs_list);</div>
+<div class="line"><a name="l03420"></a><span class="lineno"> 3420</span>     </div>
+<div class="line"><a name="l03421"></a><span class="lineno"> 3421</span>     cassure(                                n_std_stars > 0 && n_obs > 0,</div>
+<div class="line"><a name="l03422"></a><span class="lineno"> 3422</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l03423"></a><span class="lineno"> 3423</span>                                             <span class="keywordflow">return</span> lhs,</div>
+<div class="line"><a name="l03424"></a><span class="lineno"> 3424</span>                                             <span class="stringliteral">"Empty input list"</span>);</div>
+<div class="line"><a name="l03425"></a><span class="lineno"> 3425</span>     </div>
+<div class="line"><a name="l03426"></a><span class="lineno"> 3426</span>     <span class="comment">/* prepare */</span></div>
+<div class="line"><a name="l03427"></a><span class="lineno"> 3427</span>     n_obs = entry_list_size(obs_list);</div>
+<div class="line"><a name="l03428"></a><span class="lineno"> 3428</span>     <span class="keywordflow">for</span> (   std = fors_std_star_list_first_const(std_list);</div>
+<div class="line"><a name="l03429"></a><span class="lineno"> 3429</span>             std != NULL;</div>
+<div class="line"><a name="l03430"></a><span class="lineno"> 3430</span>             std = fors_std_star_list_next_const(std_list))</div>
+<div class="line"><a name="l03431"></a><span class="lineno"> 3431</span>     {</div>
+<div class="line"><a name="l03432"></a><span class="lineno"> 3432</span>         n_fit_std_mag += !(std->trusted);</div>
+<div class="line"><a name="l03433"></a><span class="lineno"> 3433</span>     }</div>
+<div class="line"><a name="l03434"></a><span class="lineno"> 3434</span>     </div>
+<div class="line"><a name="l03435"></a><span class="lineno"> 3435</span>     n_frames = 0;</div>
+<div class="line"><a name="l03436"></a><span class="lineno"> 3436</span>     n_atm_ext = 0;</div>
+<div class="line"><a name="l03437"></a><span class="lineno"> 3437</span>     <span class="keywordflow">for</span> (   e = entry_list_first_const(obs_list);</div>
+<div class="line"><a name="l03438"></a><span class="lineno"> 3438</span>             e != NULL;</div>
+<div class="line"><a name="l03439"></a><span class="lineno"> 3439</span>             e = entry_list_next_const(obs_list))</div>
+<div class="line"><a name="l03440"></a><span class="lineno"> 3440</span>     {</div>
+<div class="line"><a name="l03441"></a><span class="lineno"> 3441</span>         <span class="comment">/* assume indices counting from 0 */</span></div>
+<div class="line"><a name="l03442"></a><span class="lineno"> 3442</span>         <span class="keywordflow">if</span> (e->frame_index + 1 > n_frames)</div>
+<div class="line"><a name="l03443"></a><span class="lineno"> 3443</span>             n_frames = e->frame_index + 1;</div>
+<div class="line"><a name="l03444"></a><span class="lineno"> 3444</span>         <span class="keywordflow">if</span> (e->atm_ext_index + 1 > n_atm_ext)</div>
+<div class="line"><a name="l03445"></a><span class="lineno"> 3445</span>             n_atm_ext = e->atm_ext_index + 1;</div>
+<div class="line"><a name="l03446"></a><span class="lineno"> 3446</span>     }</div>
+<div class="line"><a name="l03447"></a><span class="lineno"> 3447</span>     <span class="keywordflow">if</span> (n_atm_ext < 0) n_atm_ext = 0;</div>
+<div class="line"><a name="l03448"></a><span class="lineno"> 3448</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span> lhs);</div>
+<div class="line"><a name="l03449"></a><span class="lineno"> 3449</span>     </div>
+<div class="line"><a name="l03450"></a><span class="lineno"> 3450</span>     n_col = n_fit_std_mag</div>
+<div class="line"><a name="l03451"></a><span class="lineno"> 3451</span>             + ((fit_z) ? 1 : 0)</div>
+<div class="line"><a name="l03452"></a><span class="lineno"> 3452</span>             + n_atm_ext</div>
+<div class="line"><a name="l03453"></a><span class="lineno"> 3453</span>             + ((fit_c) ? 1 : 0);</div>
+<div class="line"><a name="l03454"></a><span class="lineno"> 3454</span>     </div>
+<div class="line"><a name="l03455"></a><span class="lineno"> 3455</span>     <span class="keywordflow">if</span> (n_col == 0) <span class="comment">/* if nothing to be fitted here */</span></div>
+<div class="line"><a name="l03456"></a><span class="lineno"> 3456</span>     {</div>
+<div class="line"><a name="l03457"></a><span class="lineno"> 3457</span>         cleanup;</div>
+<div class="line"><a name="l03458"></a><span class="lineno"> 3458</span>         <span class="keywordflow">return</span> lhs; <span class="comment">/* NULL */</span></div>
+<div class="line"><a name="l03459"></a><span class="lineno"> 3459</span>     }</div>
+<div class="line"><a name="l03460"></a><span class="lineno"> 3460</span>     </div>
+<div class="line"><a name="l03461"></a><span class="lineno"> 3461</span>     lhs = cpl_matrix_new(n_obs, n_col);</div>
+<div class="line"><a name="l03462"></a><span class="lineno"> 3462</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span> lhs);</div>
+<div class="line"><a name="l03463"></a><span class="lineno"> 3463</span>     </div>
+<div class="line"><a name="l03464"></a><span class="lineno"> 3464</span>     <span class="comment">/* start */</span></div>
+<div class="line"><a name="l03465"></a><span class="lineno"> 3465</span>     <span class="comment">/* FIXME: FAP: insert visual comments here */</span></div>
+<div class="line"><a name="l03466"></a><span class="lineno"> 3466</span>     <span class="keywordflow">for</span> (e = entry_list_first_const(obs_list), row = 0;</div>
+<div class="line"><a name="l03467"></a><span class="lineno"> 3467</span>          e != NULL;</div>
+<div class="line"><a name="l03468"></a><span class="lineno"> 3468</span>          e = entry_list_next_const(obs_list), row++) </div>
+<div class="line"><a name="l03469"></a><span class="lineno"> 3469</span>     {</div>
+<div class="line"><a name="l03470"></a><span class="lineno"> 3470</span>         <span class="keywordtype">int</span> col = 0,</div>
+<div class="line"><a name="l03471"></a><span class="lineno"> 3471</span>             k;</div>
+<div class="line"><a name="l03472"></a><span class="lineno"> 3472</span>         </div>
+<div class="line"><a name="l03473"></a><span class="lineno"> 3473</span>         <span class="comment">/* Star not identified, should not happen */</span></div>
+<div class="line"><a name="l03474"></a><span class="lineno"> 3474</span>         ppassure(                           e->star_index >= 0,</div>
+<div class="line"><a name="l03475"></a><span class="lineno"> 3475</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l03476"></a><span class="lineno"> 3476</span>                                             <span class="keywordflow">return</span> lhs);</div>
+<div class="line"><a name="l03477"></a><span class="lineno"> 3477</span>         </div>
+<div class="line"><a name="l03478"></a><span class="lineno"> 3478</span>         <span class="keywordflow">if</span> (n_fit_std_mag > 0) <span class="comment">/* one column per std. star's magnitude to fit */</span></div>
+<div class="line"><a name="l03479"></a><span class="lineno"> 3479</span>         {</div>
+<div class="line"><a name="l03480"></a><span class="lineno"> 3480</span>             <span class="keywordflow">for</span> (   std = fors_std_star_list_first_const(std_list), k = 0;</div>
+<div class="line"><a name="l03481"></a><span class="lineno"> 3481</span>                     std != NULL;</div>
+<div class="line"><a name="l03482"></a><span class="lineno"> 3482</span>                     std = fors_std_star_list_next_const(std_list), k++)</div>
+<div class="line"><a name="l03483"></a><span class="lineno"> 3483</span>             {</div>
+<div class="line"><a name="l03484"></a><span class="lineno"> 3484</span>                 <span class="keywordflow">if</span> (!(std->trusted))</div>
+<div class="line"><a name="l03485"></a><span class="lineno"> 3485</span>                 {</div>
+<div class="line"><a name="l03486"></a><span class="lineno"> 3486</span>                     <span class="keywordflow">if</span> (!printed)</div>
+<div class="line"><a name="l03487"></a><span class="lineno"> 3487</span>                         cpl_msg_debug(      cpl_func,</div>
+<div class="line"><a name="l03488"></a><span class="lineno"> 3488</span>                                             <span class="stringliteral">"Creating column for mag(M%d)"</span>,</div>
+<div class="line"><a name="l03489"></a><span class="lineno"> 3489</span>                                             k);</div>
+<div class="line"><a name="l03490"></a><span class="lineno"> 3490</span>                     <span class="keywordflow">if</span> (e->star->id == std)</div>
+<div class="line"><a name="l03491"></a><span class="lineno"> 3491</span>                         cpl_matrix_set(lhs, row, col, 1);</div>
+<div class="line"><a name="l03492"></a><span class="lineno"> 3492</span>                     col++;</div>
+<div class="line"><a name="l03493"></a><span class="lineno"> 3493</span>                 }</div>
+<div class="line"><a name="l03494"></a><span class="lineno"> 3494</span>             }</div>
+<div class="line"><a name="l03495"></a><span class="lineno"> 3495</span>         }</div>
+<div class="line"><a name="l03496"></a><span class="lineno"> 3496</span>         </div>
+<div class="line"><a name="l03497"></a><span class="lineno"> 3497</span>         <span class="keywordflow">if</span> (fit_z)</div>
+<div class="line"><a name="l03498"></a><span class="lineno"> 3498</span>         {</div>
+<div class="line"><a name="l03499"></a><span class="lineno"> 3499</span>             <span class="keywordflow">if</span> (!printed)</div>
+<div class="line"><a name="l03500"></a><span class="lineno"> 3500</span>                 cpl_msg_debug(cpl_func, <span class="stringliteral">"Creating column for Z"</span>);</div>
+<div class="line"><a name="l03501"></a><span class="lineno"> 3501</span>             cpl_matrix_set(lhs, row, col++, -1);</div>
+<div class="line"><a name="l03502"></a><span class="lineno"> 3502</span>         }</div>
+<div class="line"><a name="l03503"></a><span class="lineno"> 3503</span>         </div>
+<div class="line"><a name="l03504"></a><span class="lineno"> 3504</span>         <span class="keywordflow">if</span> (n_atm_ext > 0)</div>
+<div class="line"><a name="l03505"></a><span class="lineno"> 3505</span>         {</div>
+<div class="line"><a name="l03506"></a><span class="lineno"> 3506</span>             <span class="keywordflow">for</span> (k = 0; k < n_atm_ext; k++)</div>
+<div class="line"><a name="l03507"></a><span class="lineno"> 3507</span>             {</div>
+<div class="line"><a name="l03508"></a><span class="lineno"> 3508</span>                 <span class="keywordflow">if</span> (!printed)</div>
+<div class="line"><a name="l03509"></a><span class="lineno"> 3509</span>                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Creating column for E_%d"</span>, k);</div>
+<div class="line"><a name="l03510"></a><span class="lineno"> 3510</span>                 <span class="keywordtype">double</span> val = (k == e->atm_ext_index) ? e->airmass : 0;</div>
+<div class="line"><a name="l03511"></a><span class="lineno"> 3511</span>                 cpl_matrix_set(lhs, row, col++, val);</div>
+<div class="line"><a name="l03512"></a><span class="lineno"> 3512</span>             }</div>
+<div class="line"><a name="l03513"></a><span class="lineno"> 3513</span>         }</div>
+<div class="line"><a name="l03514"></a><span class="lineno"> 3514</span> </div>
+<div class="line"><a name="l03515"></a><span class="lineno"> 3515</span>         <span class="keywordflow">if</span> (fit_c)  <span class="comment">/* fit color coeff */</span></div>
+<div class="line"><a name="l03516"></a><span class="lineno"> 3516</span>         {</div>
+<div class="line"><a name="l03517"></a><span class="lineno"> 3517</span>             <span class="keywordtype">double</span>  c;</div>
+<div class="line"><a name="l03518"></a><span class="lineno"> 3518</span>             <span class="keywordflow">if</span> (!printed)</div>
+<div class="line"><a name="l03519"></a><span class="lineno"> 3519</span>                 cpl_msg_debug(cpl_func,     <span class="stringliteral">"Creating column for color "</span></div>
+<div class="line"><a name="l03520"></a><span class="lineno"> 3520</span>                                             <span class="stringliteral">"correction term"</span>);</div>
+<div class="line"><a name="l03521"></a><span class="lineno"> 3521</span>             c = e->star->id->color;</div>
+<div class="line"><a name="l03522"></a><span class="lineno"> 3522</span>             <span class="comment">/* if (fit_mag), then fit observed magnitude, not corrected by</span></div>
+<div class="line"><a name="l03523"></a><span class="lineno"> 3523</span> <span class="comment">             * catalogue color, or in other words: set std.star elements</span></div>
+<div class="line"><a name="l03524"></a><span class="lineno"> 3524</span> <span class="comment">             * to zero */</span></div>
+<div class="line"><a name="l03525"></a><span class="lineno"> 3525</span>             <span class="keywordflow">if</span> (!(e->star->id->trusted))</div>
+<div class="line"><a name="l03526"></a><span class="lineno"> 3526</span>                 c = 0;</div>
+<div class="line"><a name="l03527"></a><span class="lineno"> 3527</span>             cpl_matrix_set(lhs, row, col++, c);</div>
+<div class="line"><a name="l03528"></a><span class="lineno"> 3528</span>         }</div>
+<div class="line"><a name="l03529"></a><span class="lineno"> 3529</span>         printed = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l03530"></a><span class="lineno"> 3530</span>     }</div>
+<div class="line"><a name="l03531"></a><span class="lineno"> 3531</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span> lhs);</div>
+<div class="line"><a name="l03532"></a><span class="lineno"> 3532</span>     </div>
+<div class="line"><a name="l03533"></a><span class="lineno"> 3533</span>     <span class="keywordflow">if</span> (n_fit_e_cols != NULL)</div>
+<div class="line"><a name="l03534"></a><span class="lineno"> 3534</span>         *n_fit_e_cols = n_atm_ext;</div>
+<div class="line"><a name="l03535"></a><span class="lineno"> 3535</span>     </div>
+<div class="line"><a name="l03536"></a><span class="lineno"> 3536</span>     <span class="keywordflow">return</span> lhs;</div>
+<div class="line"><a name="l03537"></a><span class="lineno"> 3537</span> }</div>
+<div class="line"><a name="l03538"></a><span class="lineno"> 3538</span> </div>
+<div class="line"><a name="l03539"></a><span class="lineno"> 3539</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03540"></a><span class="lineno"> 3540</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l03541"></a><span class="lineno"> 3541</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l03542"></a><span class="lineno"> 3542</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l03543"></a><span class="lineno"> 3543</span> <span class="preprocessor">    fors_matrix_null(&mat); \</span></div>
+<div class="line"><a name="l03544"></a><span class="lineno"> 3544</span> <span class="preprocessor">    cpl_array_delete(Apowers); Apowers = NULL; \</span></div>
+<div class="line"><a name="l03545"></a><span class="lineno"> 3545</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l03546"></a><span class="lineno"> 3546</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l03564"></a><span class="lineno"> 3564</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03565"></a><span class="lineno"> 3565</span> <span class="keyword">static</span> cpl_matrix*</div>
+<div class="line"><a name="l03566"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga43e3c1d13157092f683e6d4912cd71d2"> 3566</a></span> <a class="code" href="group__fors__photometry.html#ga43e3c1d13157092f683e6d4912cd71d2" title="Build polynomial fitting matrix with coefficients represented in columns.">build_equations_lhs_matrix_from_poly</a>(       <span class="keyword">const</span> entry_list        *obs_list,</div>
+<div class="line"><a name="l03567"></a><span class="lineno"> 3567</span>                                             <span class="keyword">const</span> cpl_polynomial    *poly,</div>
+<div class="line"><a name="l03568"></a><span class="lineno"> 3568</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *pname,</div>
+<div class="line"><a name="l03569"></a><span class="lineno"> 3569</span>                                             <span class="keywordtype">double</span> (*powerfunc)(</div>
+<div class="line"><a name="l03570"></a><span class="lineno"> 3570</span>                                                             <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>*,</div>
+<div class="line"><a name="l03571"></a><span class="lineno"> 3571</span>                                                             <span class="keyword">const</span> cpl_array*))</div>
+<div class="line"><a name="l03572"></a><span class="lineno"> 3572</span> {</div>
+<div class="line"><a name="l03573"></a><span class="lineno"> 3573</span>     <span class="keywordtype">int</span>             n_obs,</div>
+<div class="line"><a name="l03574"></a><span class="lineno"> 3574</span>                     n_coeff,</div>
+<div class="line"><a name="l03575"></a><span class="lineno"> 3575</span>                     n_dims,</div>
+<div class="line"><a name="l03576"></a><span class="lineno"> 3576</span>                     row;</div>
+<div class="line"><a name="l03577"></a><span class="lineno"> 3577</span>     cpl_matrix      *mat = NULL;</div>
+<div class="line"><a name="l03578"></a><span class="lineno"> 3578</span>     cpl_array       *Apowers = NULL;</div>
+<div class="line"><a name="l03579"></a><span class="lineno"> 3579</span>     <span class="keywordtype">int</span>             *ipowers;</div>
+<div class="line"><a name="l03580"></a><span class="lineno"> 3580</span>     cpl_size        *ipowers_size;</div>
+<div class="line"><a name="l03581"></a><span class="lineno"> 3581</span>     <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>     *e;</div>
+<div class="line"><a name="l03582"></a><span class="lineno"> 3582</span>     cpl_error_code  errc;</div>
+<div class="line"><a name="l03583"></a><span class="lineno"> 3583</span>     <span class="keywordtype">bool</span>            printed = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l03584"></a><span class="lineno"> 3584</span>     <span class="keywordtype">int</span>             i;</div>
+<div class="line"><a name="l03585"></a><span class="lineno"> 3585</span>     </div>
+<div class="line"><a name="l03586"></a><span class="lineno"> 3586</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!(errc=cpl_error_get_code()), <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Previous error caught."</span>);</div>
+<div class="line"><a name="l03587"></a><span class="lineno"> 3587</span>     </div>
+<div class="line"><a name="l03588"></a><span class="lineno"> 3588</span>     <span class="comment">/* check input */</span></div>
+<div class="line"><a name="l03589"></a><span class="lineno"> 3589</span>     ppassure(                               poly != NULL && obs_list != NULL,</div>
+<div class="line"><a name="l03590"></a><span class="lineno"> 3590</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03591"></a><span class="lineno"> 3591</span>                                             <span class="keywordflow">return</span> NULL);</div>
+<div class="line"><a name="l03592"></a><span class="lineno"> 3592</span>     </div>
+<div class="line"><a name="l03593"></a><span class="lineno"> 3593</span>     <span class="comment">/* init */</span></div>
+<div class="line"><a name="l03594"></a><span class="lineno"> 3594</span>     n_obs = entry_list_size(obs_list);</div>
+<div class="line"><a name="l03595"></a><span class="lineno"> 3595</span>     n_coeff = <a class="code" href="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff" title="Count the total number of non-zero coefficients.">fors_polynomial_count_coeff</a>(poly);</div>
+<div class="line"><a name="l03596"></a><span class="lineno"> 3596</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span> NULL);</div>
+<div class="line"><a name="l03597"></a><span class="lineno"> 3597</span>     </div>
+<div class="line"><a name="l03598"></a><span class="lineno"> 3598</span>     <span class="keywordflow">if</span> (n_coeff == 0)</div>
+<div class="line"><a name="l03599"></a><span class="lineno"> 3599</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03600"></a><span class="lineno"> 3600</span>     </div>
+<div class="line"><a name="l03601"></a><span class="lineno"> 3601</span>     mat = cpl_matrix_new(n_obs, n_coeff);</div>
+<div class="line"><a name="l03602"></a><span class="lineno"> 3602</span>     </div>
+<div class="line"><a name="l03603"></a><span class="lineno"> 3603</span>     <span class="comment">/* start */</span></div>
+<div class="line"><a name="l03604"></a><span class="lineno"> 3604</span>     n_dims = cpl_polynomial_get_dimension(poly);</div>
+<div class="line"><a name="l03605"></a><span class="lineno"> 3605</span>     Apowers = cpl_array_new(n_dims, CPL_TYPE_INT);</div>
+<div class="line"><a name="l03606"></a><span class="lineno"> 3606</span>     cpl_array_fill_window_int(Apowers, 0, n_dims, 0);</div>
+<div class="line"><a name="l03607"></a><span class="lineno"> 3607</span>     ipowers = cpl_array_get_data_int(Apowers);</div>
+<div class="line"><a name="l03608"></a><span class="lineno"> 3608</span>     passure(!cpl_error_get_code(), <span class="keywordflow">return</span> NULL);</div>
+<div class="line"><a name="l03609"></a><span class="lineno"> 3609</span>     </div>
+<div class="line"><a name="l03610"></a><span class="lineno"> 3610</span>     <span class="comment">//This is a workaround until cpl_array supports CPL_SIZE type elements. </span></div>
+<div class="line"><a name="l03611"></a><span class="lineno"> 3611</span>     ipowers_size = cpl_malloc(n_dims*<span class="keyword">sizeof</span>(ipowers_size));</div>
+<div class="line"><a name="l03612"></a><span class="lineno"> 3612</span>     <span class="keywordflow">for</span> (i=0; i<n_dims; i++)</div>
+<div class="line"><a name="l03613"></a><span class="lineno"> 3613</span>         ipowers_size[i] = ipowers[i];</div>
+<div class="line"><a name="l03614"></a><span class="lineno"> 3614</span>     </div>
+<div class="line"><a name="l03615"></a><span class="lineno"> 3615</span>     <span class="keywordflow">for</span> (e = entry_list_first_const(obs_list), row = 0;</div>
+<div class="line"><a name="l03616"></a><span class="lineno"> 3616</span>          e != NULL;</div>
+<div class="line"><a name="l03617"></a><span class="lineno"> 3617</span>          e = entry_list_next_const(obs_list), row++) </div>
+<div class="line"><a name="l03618"></a><span class="lineno"> 3618</span>     {</div>
+<div class="line"><a name="l03619"></a><span class="lineno"> 3619</span>         <span class="keywordtype">int</span>     col = 0;</div>
+<div class="line"><a name="l03620"></a><span class="lineno"> 3620</span>         <span class="keywordtype">bool</span>    overflow;</div>
+<div class="line"><a name="l03621"></a><span class="lineno"> 3621</span>         </div>
+<div class="line"><a name="l03622"></a><span class="lineno"> 3622</span>         overflow = <a class="code" href="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e" title="Find the first non-zero coefficient.">fors_polynomial_powers_find_first_coeff</a>(poly, ipowers_size);</div>
+<div class="line"><a name="l03623"></a><span class="lineno"> 3623</span>         <span class="keywordflow">while</span> (!overflow)</div>
+<div class="line"><a name="l03624"></a><span class="lineno"> 3624</span>         {</div>
+<div class="line"><a name="l03625"></a><span class="lineno"> 3625</span>             <span class="keywordflow">if</span> (!printed)</div>
+<div class="line"><a name="l03626"></a><span class="lineno"> 3626</span>             {</div>
+<div class="line"><a name="l03627"></a><span class="lineno"> 3627</span>                 <span class="keywordtype">char</span> *cn = <a class="code" href="group__fors__polynomial.html#ga498733e7d062578c77b1ae5c0f6f2935" title="Print a coefficient's name into a newly allocated string.">fors_polynomial_sprint_coeff</a>(poly, ipowers_size, pname);</div>
+<div class="line"><a name="l03628"></a><span class="lineno"> 3628</span>                 <span class="keywordflow">if</span> (cn != NULL)</div>
+<div class="line"><a name="l03629"></a><span class="lineno"> 3629</span>                 {</div>
+<div class="line"><a name="l03630"></a><span class="lineno"> 3630</span>                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Creating column for %s"</span>, cn);</div>
+<div class="line"><a name="l03631"></a><span class="lineno"> 3631</span>                     cpl_free(cn);</div>
+<div class="line"><a name="l03632"></a><span class="lineno"> 3632</span>                 }</div>
+<div class="line"><a name="l03633"></a><span class="lineno"> 3633</span>             }</div>
+<div class="line"><a name="l03634"></a><span class="lineno"> 3634</span>             cpl_matrix_set(mat, row, col++, (*powerfunc)(e, Apowers));</div>
+<div class="line"><a name="l03635"></a><span class="lineno"> 3635</span>             passure(!cpl_error_get_code(), <span class="keywordflow">return</span> NULL);</div>
+<div class="line"><a name="l03636"></a><span class="lineno"> 3636</span>             </div>
+<div class="line"><a name="l03637"></a><span class="lineno"> 3637</span>             overflow = <a class="code" href="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c" title="Find the next non-zero coefficient.">fors_polynomial_powers_find_next_coeff</a>(poly, ipowers_size);</div>
+<div class="line"><a name="l03638"></a><span class="lineno"> 3638</span>         }</div>
+<div class="line"><a name="l03639"></a><span class="lineno"> 3639</span>         </div>
+<div class="line"><a name="l03640"></a><span class="lineno"> 3640</span>         printed = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l03641"></a><span class="lineno"> 3641</span>     }</div>
+<div class="line"><a name="l03642"></a><span class="lineno"> 3642</span>     </div>
+<div class="line"><a name="l03643"></a><span class="lineno"> 3643</span>     cpl_array_delete(Apowers);</div>
+<div class="line"><a name="l03644"></a><span class="lineno"> 3644</span>     </div>
+<div class="line"><a name="l03645"></a><span class="lineno"> 3645</span>     <span class="keywordflow">return</span> mat;</div>
+<div class="line"><a name="l03646"></a><span class="lineno"> 3646</span> }</div>
+<div class="line"><a name="l03647"></a><span class="lineno"> 3647</span> </div>
+<div class="line"><a name="l03648"></a><span class="lineno"> 3648</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03649"></a><span class="lineno"> 3649</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l03650"></a><span class="lineno"> 3650</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l03651"></a><span class="lineno"> 3651</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l03652"></a><span class="lineno"> 3652</span> <span class="preprocessor">    fors_matrix_null(&rhs_input_cov); \</span></div>
+<div class="line"><a name="l03653"></a><span class="lineno"> 3653</span> <span class="preprocessor">    fors_matrix_null(&rhs_jacobian); \</span></div>
+<div class="line"><a name="l03654"></a><span class="lineno"> 3654</span> <span class="preprocessor">    fors_matrix_null(&rhs_input); \</span></div>
+<div class="line"><a name="l03655"></a><span class="lineno"> 3655</span> <span class="preprocessor">    fors_matrix_null(&rhs_jacobian_T); \</span></div>
+<div class="line"><a name="l03656"></a><span class="lineno"> 3656</span> <span class="preprocessor">    fors_matrix_null(&tmp_matrix); \</span></div>
+<div class="line"><a name="l03657"></a><span class="lineno"> 3657</span> <span class="preprocessor">    fors_matrix_null(rhs); \</span></div>
+<div class="line"><a name="l03658"></a><span class="lineno"> 3658</span> <span class="preprocessor">    fors_matrix_null(rhs_cov); \</span></div>
+<div class="line"><a name="l03659"></a><span class="lineno"> 3659</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l03660"></a><span class="lineno"> 3660</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l03675"></a><span class="lineno"> 3675</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03676"></a><span class="lineno"> 3676</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l03677"></a><span class="lineno"><a class="code" href="group__fors__photometry.html#ga5e4afe6326f0bb9c748fed2286c8c835"> 3677</a></span> <a class="code" href="group__fors__photometry.html#ga5e4afe6326f0bb9c748fed2286c8c835" title="Build right hand side matrix equation part.">build_equations_rhs_cov</a>(                    <span class="keyword">const</span> entry_list    *obs_list,</div>
+<div class="line"><a name="l03678"></a><span class="lineno"> 3678</span>                                             <span class="keyword">const</span> fors_std_star_list  *std_list,</div>
+<div class="line"><a name="l03679"></a><span class="lineno"> 3679</span>                                             <span class="keywordtype">bool</span>                fit_z,</div>
+<div class="line"><a name="l03680"></a><span class="lineno"> 3680</span>                                             <span class="keywordtype">bool</span>                fit_c,</div>
+<div class="line"><a name="l03681"></a><span class="lineno"> 3681</span>                                             <span class="keywordtype">bool</span>                fit_e,</div>
+<div class="line"><a name="l03682"></a><span class="lineno"> 3682</span>                                             <span class="keywordtype">double</span>              color_coeff,</div>
+<div class="line"><a name="l03683"></a><span class="lineno"> 3683</span>                                             <span class="keywordtype">double</span>              dcolor_coeff,</div>
+<div class="line"><a name="l03684"></a><span class="lineno"> 3684</span>                                             <span class="keywordtype">double</span>              ext_coeff,</div>
+<div class="line"><a name="l03685"></a><span class="lineno"> 3685</span>                                             <span class="keywordtype">double</span>              dext_coeff,</div>
+<div class="line"><a name="l03686"></a><span class="lineno"> 3686</span>                                             <span class="keywordtype">double</span>              zpoint,</div>
+<div class="line"><a name="l03687"></a><span class="lineno"> 3687</span>                                             <span class="keywordtype">double</span>              dzpoint,</div>
+<div class="line"><a name="l03688"></a><span class="lineno"> 3688</span>                                             cpl_matrix          **rhs,</div>
+<div class="line"><a name="l03689"></a><span class="lineno"> 3689</span>                                             cpl_matrix          **rhs_cov)</div>
+<div class="line"><a name="l03690"></a><span class="lineno"> 3690</span> {</div>
+<div class="line"><a name="l03691"></a><span class="lineno"> 3691</span>     <span class="comment">/* This function computes the following</span></div>
+<div class="line"><a name="l03692"></a><span class="lineno"> 3692</span> <span class="comment">     * (with i = index of referenced std. star):</span></div>
+<div class="line"><a name="l03693"></a><span class="lineno"> 3693</span> <span class="comment">     * </span></div>
+<div class="line"><a name="l03694"></a><span class="lineno"> 3694</span> <span class="comment">     * rhs_obs = m_obs (instrumental magnitude)</span></div>
+<div class="line"><a name="l03695"></a><span class="lineno"> 3695</span> <span class="comment">     *           - (!fit_mag_i)     ? cat_mag_i : 0</span></div>
+<div class="line"><a name="l03696"></a><span class="lineno"> 3696</span> <span class="comment">     *           + (!fit_c)         ? color_i * color_coeff : 0</span></div>
+<div class="line"><a name="l03697"></a><span class="lineno"> 3697</span> <span class="comment">     *           - (!fit_e)         ? airmass_f * ext_coeff : 0</span></div>
+<div class="line"><a name="l03698"></a><span class="lineno"> 3698</span> <span class="comment">     *           + (!fit_z)         ? zpoint : 0</span></div>
+<div class="line"><a name="l03699"></a><span class="lineno"> 3699</span> <span class="comment">     *           - magscale(gain)</span></div>
+<div class="line"><a name="l03700"></a><span class="lineno"> 3700</span> <span class="comment">     *           - magscale(exposure_time);</span></div>
+<div class="line"><a name="l03701"></a><span class="lineno"> 3701</span> <span class="comment">     * </span></div>
+<div class="line"><a name="l03702"></a><span class="lineno"> 3702</span> <span class="comment">     * It does it by generating 3 matrices: the inputs matrix, a Jacobian, and</span></div>
+<div class="line"><a name="l03703"></a><span class="lineno"> 3703</span> <span class="comment">     * an inputs covariance matrix. Using these, the rhs and its covariance</span></div>
+<div class="line"><a name="l03704"></a><span class="lineno"> 3704</span> <span class="comment">     * matrix are computed.</span></div>
+<div class="line"><a name="l03705"></a><span class="lineno"> 3705</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l03706"></a><span class="lineno"> 3706</span>     cpl_matrix      *rhs_input_cov = NULL,</div>
+<div class="line"><a name="l03707"></a><span class="lineno"> 3707</span>                     *rhs_jacobian = NULL,</div>
+<div class="line"><a name="l03708"></a><span class="lineno"> 3708</span>                     *rhs_input = NULL,</div>
+<div class="line"><a name="l03709"></a><span class="lineno"> 3709</span>                     *rhs_jacobian_T = NULL,</div>
+<div class="line"><a name="l03710"></a><span class="lineno"> 3710</span>                     *tmp_matrix = NULL;</div>
+<div class="line"><a name="l03711"></a><span class="lineno"> 3711</span>     <span class="keywordtype">int</span>             n_std_stars,</div>
+<div class="line"><a name="l03712"></a><span class="lineno"> 3712</span>                     n_obs,</div>
+<div class="line"><a name="l03713"></a><span class="lineno"> 3713</span>                     n_col,</div>
+<div class="line"><a name="l03714"></a><span class="lineno"> 3714</span>                     r,</div>
+<div class="line"><a name="l03715"></a><span class="lineno"> 3715</span>                     c;</div>
+<div class="line"><a name="l03716"></a><span class="lineno"> 3716</span>     <span class="keyword">const</span> fors_std_star</div>
+<div class="line"><a name="l03717"></a><span class="lineno"> 3717</span>                     *std;</div>
+<div class="line"><a name="l03718"></a><span class="lineno"> 3718</span>     <span class="keyword">const</span> <a class="code" href="structentry.html">entry</a>     *obs;</div>
+<div class="line"><a name="l03719"></a><span class="lineno"> 3719</span>     <span class="keywordtype">bool</span>            printed_debug = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l03720"></a><span class="lineno"> 3720</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l03721"></a><span class="lineno"> 3721</span>     </div>
+<div class="line"><a name="l03722"></a><span class="lineno"> 3722</span>     <span class="comment">/* free output pointers */</span></div>
+<div class="line"><a name="l03723"></a><span class="lineno"> 3723</span>     cleanup;</div>
+<div class="line"><a name="l03724"></a><span class="lineno"> 3724</span>     </div>
+<div class="line"><a name="l03725"></a><span class="lineno"> 3725</span>     <span class="comment">/* check input */</span></div>
+<div class="line"><a name="l03726"></a><span class="lineno"> 3726</span>     cassure_automsg(                        obs_list != NULL,</div>
+<div class="line"><a name="l03727"></a><span class="lineno"> 3727</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03728"></a><span class="lineno"> 3728</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03729"></a><span class="lineno"> 3729</span>     cassure_automsg(                        std_list != NULL,</div>
+<div class="line"><a name="l03730"></a><span class="lineno"> 3730</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03731"></a><span class="lineno"> 3731</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03732"></a><span class="lineno"> 3732</span>     cassure_automsg(                        rhs != NULL,</div>
+<div class="line"><a name="l03733"></a><span class="lineno"> 3733</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03734"></a><span class="lineno"> 3734</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03735"></a><span class="lineno"> 3735</span>     cassure_automsg(                        rhs_cov != NULL,</div>
+<div class="line"><a name="l03736"></a><span class="lineno"> 3736</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l03737"></a><span class="lineno"> 3737</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03738"></a><span class="lineno"> 3738</span>     </div>
+<div class="line"><a name="l03739"></a><span class="lineno"> 3739</span>     n_std_stars = fors_std_star_list_size(std_list);</div>
+<div class="line"><a name="l03740"></a><span class="lineno"> 3740</span>     n_obs = entry_list_size(obs_list);</div>
+<div class="line"><a name="l03741"></a><span class="lineno"> 3741</span>     </div>
+<div class="line"><a name="l03742"></a><span class="lineno"> 3742</span>     cassure(                                n_std_stars > 0 && n_obs > 0,</div>
+<div class="line"><a name="l03743"></a><span class="lineno"> 3743</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l03744"></a><span class="lineno"> 3744</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l03745"></a><span class="lineno"> 3745</span>                                             <span class="stringliteral">"Empty input list"</span>);</div>
+<div class="line"><a name="l03746"></a><span class="lineno"> 3746</span>     </div>
+<div class="line"><a name="l03747"></a><span class="lineno"> 3747</span>     <span class="comment">/* start */</span></div>
+<div class="line"><a name="l03748"></a><span class="lineno"> 3748</span>     n_col = n_std_stars*2 + 3;</div>
+<div class="line"><a name="l03749"></a><span class="lineno"> 3749</span>     </div>
+<div class="line"><a name="l03750"></a><span class="lineno"> 3750</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l03751"></a><span class="lineno"> 3751</span>     <span class="comment">/* build the following input covariance matrix:</span></div>
+<div class="line"><a name="l03752"></a><span class="lineno"> 3752</span> <span class="comment">     * </span></div>
+<div class="line"><a name="l03753"></a><span class="lineno"> 3753</span> <span class="comment">     * v_mag_0  cov_mc_0  0        0           0            0          0</span></div>
+<div class="line"><a name="l03754"></a><span class="lineno"> 3754</span> <span class="comment">     * cov_mc_0 v_color_0 0        0           0            0          0</span></div>
+<div class="line"><a name="l03755"></a><span class="lineno"> 3755</span> <span class="comment">     * 0        0         v_mag_1  cov_mc_1    0            0          0</span></div>
+<div class="line"><a name="l03756"></a><span class="lineno"> 3756</span> <span class="comment">     * 0        0         cov_mc_1 v_color_1   0            0          0</span></div>
+<div class="line"><a name="l03757"></a><span class="lineno"> 3757</span> <span class="comment">     *                                      ...</span></div>
+<div class="line"><a name="l03758"></a><span class="lineno"> 3758</span> <span class="comment">     * 0        0         0        0           v_color_coef 0          0</span></div>
+<div class="line"><a name="l03759"></a><span class="lineno"> 3759</span> <span class="comment">     * 0        0         0        0           0            v_ext_coef 0</span></div>
+<div class="line"><a name="l03760"></a><span class="lineno"> 3760</span> <span class="comment">     * 0        0         0        0           0            0          v_zpoint</span></div>
+<div class="line"><a name="l03761"></a><span class="lineno"> 3761</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l03762"></a><span class="lineno"> 3762</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l03763"></a><span class="lineno"> 3763</span>     rhs_input_cov = cpl_matrix_new(n_col, n_col);</div>
+<div class="line"><a name="l03764"></a><span class="lineno"> 3764</span>     <span class="keywordflow">for</span> (   std = fors_std_star_list_first_const(std_list), c = 0;</div>
+<div class="line"><a name="l03765"></a><span class="lineno"> 3765</span>             std != NULL;</div>
+<div class="line"><a name="l03766"></a><span class="lineno"> 3766</span>             std = fors_std_star_list_next_const(std_list), c += 2)</div>
+<div class="line"><a name="l03767"></a><span class="lineno"> 3767</span>     {</div>
+<div class="line"><a name="l03768"></a><span class="lineno"> 3768</span>         <span class="keywordtype">double</span>  dcatm = std->dcat_magnitude,</div>
+<div class="line"><a name="l03769"></a><span class="lineno"> 3769</span>                 dcolor = std->dcolor,</div>
+<div class="line"><a name="l03770"></a><span class="lineno"> 3770</span>                 cov_catmag_color = std->cov_catm_color;</div>
+<div class="line"><a name="l03771"></a><span class="lineno"> 3771</span>         </div>
+<div class="line"><a name="l03772"></a><span class="lineno"> 3772</span>         <span class="comment">/* To new maintainers: first understand the rest of the</span></div>
+<div class="line"><a name="l03773"></a><span class="lineno"> 3773</span> <span class="comment">         * function without the following if-statement. */</span></div>
+<div class="line"><a name="l03774"></a><span class="lineno"> 3774</span>         <span class="keywordflow">if</span> (!(dcolor > 0) || isnan(cov_catmag_color))</div>
+<div class="line"><a name="l03775"></a><span class="lineno"> 3775</span>         {</div>
+<div class="line"><a name="l03776"></a><span class="lineno"> 3776</span>             <span class="comment">/* If we have old fors_zeropoint input data, i.e.</span></div>
+<div class="line"><a name="l03777"></a><span class="lineno"> 3777</span> <span class="comment">             * if dcolor and cov_catmag_color are not set, then:</span></div>
+<div class="line"><a name="l03778"></a><span class="lineno"> 3778</span> <span class="comment">             * </span></div>
+<div class="line"><a name="l03779"></a><span class="lineno"> 3779</span> <span class="comment">             * use the mag entry in the covariance matrix and in the rhs input</span></div>
+<div class="line"><a name="l03780"></a><span class="lineno"> 3780</span> <span class="comment">             * vector:</span></div>
+<div class="line"><a name="l03781"></a><span class="lineno"> 3781</span> <span class="comment">             * - depently on fit_c, use the catalogue magnitude or the</span></div>
+<div class="line"><a name="l03782"></a><span class="lineno"> 3782</span> <span class="comment">             *   color corrected magnitude, and</span></div>
+<div class="line"><a name="l03783"></a><span class="lineno"> 3783</span> <span class="comment">             * - set the color +- dcolor entry to 0 +- 0.</span></div>
+<div class="line"><a name="l03784"></a><span class="lineno"> 3784</span> <span class="comment">             * </span></div>
+<div class="line"><a name="l03785"></a><span class="lineno"> 3785</span> <span class="comment">             * The color corrected magnitude, computed by the old</span></div>
+<div class="line"><a name="l03786"></a><span class="lineno"> 3786</span> <span class="comment">             * fors_zeropoint recipe, included the correlation between</span></div>
+<div class="line"><a name="l03787"></a><span class="lineno"> 3787</span> <span class="comment">             * magnitude and color index, using the color correction term</span></div>
+<div class="line"><a name="l03788"></a><span class="lineno"> 3788</span> <span class="comment">             * from the then used photometric table.</span></div>
+<div class="line"><a name="l03789"></a><span class="lineno"> 3789</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l03790"></a><span class="lineno"> 3790</span>             cov_catmag_color = 0;</div>
+<div class="line"><a name="l03791"></a><span class="lineno"> 3791</span>             dcolor = 0;</div>
+<div class="line"><a name="l03792"></a><span class="lineno"> 3792</span>             <span class="keywordflow">if</span> (std->trusted) <span class="comment">/* !(fit magnitude), not really necessary</span></div>
+<div class="line"><a name="l03793"></a><span class="lineno"> 3793</span> <span class="comment">                                                   because Jacobian takes care</span></div>
+<div class="line"><a name="l03794"></a><span class="lineno"> 3794</span> <span class="comment">                                                   of (!(std->trusted)) */</span></div>
+<div class="line"><a name="l03795"></a><span class="lineno"> 3795</span>             {</div>
+<div class="line"><a name="l03796"></a><span class="lineno"> 3796</span>                 <span class="keywordflow">if</span> (!fit_c)</div>
+<div class="line"><a name="l03797"></a><span class="lineno"> 3797</span>                 {</div>
+<div class="line"><a name="l03798"></a><span class="lineno"> 3798</span>                     cassure(                dcatm > 0,</div>
+<div class="line"><a name="l03799"></a><span class="lineno"> 3799</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l03800"></a><span class="lineno"> 3800</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l03801"></a><span class="lineno"> 3801</span>                                             <span class="stringliteral">"Could not determine color "</span></div>
+<div class="line"><a name="l03802"></a><span class="lineno"> 3802</span>                                             <span class="stringliteral">"corrected magnitude with error "</span></div>
+<div class="line"><a name="l03803"></a><span class="lineno"> 3803</span>                                             <span class="stringliteral">"estimate of object %s"</span>,</div>
+<div class="line"><a name="l03804"></a><span class="lineno"> 3804</span>                                             (std->name != NULL) ?</div>
+<div class="line"><a name="l03805"></a><span class="lineno"> 3805</span>                                                 std->name : <span class="stringliteral">"unknown"</span>);</div>
+<div class="line"><a name="l03806"></a><span class="lineno"> 3806</span>                     dcatm = std->dmagnitude;    <span class="comment">/* color corrected mag */</span></div>
+<div class="line"><a name="l03807"></a><span class="lineno"> 3807</span>                     <span class="keywordflow">if</span> (!printed_debug)</div>
+<div class="line"><a name="l03808"></a><span class="lineno"> 3808</span>                     {</div>
+<div class="line"><a name="l03809"></a><span class="lineno"> 3809</span>                         cpl_msg_debug(      cpl_func,</div>
+<div class="line"><a name="l03810"></a><span class="lineno"> 3810</span>                                             <span class="stringliteral">"Having old fors_zeropoint data. "</span></div>
+<div class="line"><a name="l03811"></a><span class="lineno"> 3811</span>                                             <span class="stringliteral">"Using color corrected magnitudes "</span></div>
+<div class="line"><a name="l03812"></a><span class="lineno"> 3812</span>                                             <span class="stringliteral">"instead of catalogue magnitude "</span></div>
+<div class="line"><a name="l03813"></a><span class="lineno"> 3813</span>                                             <span class="stringliteral">"and color separately."</span>);</div>
+<div class="line"><a name="l03814"></a><span class="lineno"> 3814</span>                         printed_debug = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l03815"></a><span class="lineno"> 3815</span>                     }</div>
+<div class="line"><a name="l03816"></a><span class="lineno"> 3816</span>                 }</div>
+<div class="line"><a name="l03817"></a><span class="lineno"> 3817</span>             }</div>
+<div class="line"><a name="l03818"></a><span class="lineno"> 3818</span>             <span class="comment">/* else fit the observed magnitude, i.e. not correcting by</span></div>
+<div class="line"><a name="l03819"></a><span class="lineno"> 3819</span> <span class="comment">             * the catalogue color (see Jacobian), so don't care about</span></div>
+<div class="line"><a name="l03820"></a><span class="lineno"> 3820</span> <span class="comment">             * missing color entries */</span></div>
+<div class="line"><a name="l03821"></a><span class="lineno"> 3821</span>         }</div>
+<div class="line"><a name="l03822"></a><span class="lineno"> 3822</span>         </div>
+<div class="line"><a name="l03823"></a><span class="lineno"> 3823</span>         cpl_matrix_set(rhs_input_cov, c, c, dcatm*dcatm);</div>
+<div class="line"><a name="l03824"></a><span class="lineno"> 3824</span>         cpl_matrix_set(rhs_input_cov, c+1, c+1, dcolor*dcolor);</div>
+<div class="line"><a name="l03825"></a><span class="lineno"> 3825</span>         cpl_matrix_set(rhs_input_cov, c, c+1, cov_catmag_color);</div>
+<div class="line"><a name="l03826"></a><span class="lineno"> 3826</span>         cpl_matrix_set(rhs_input_cov, c+1, c, cov_catmag_color);</div>
+<div class="line"><a name="l03827"></a><span class="lineno"> 3827</span>     }</div>
+<div class="line"><a name="l03828"></a><span class="lineno"> 3828</span>     cpl_matrix_set(rhs_input_cov, c, c, dcolor_coeff*dcolor_coeff);</div>
+<div class="line"><a name="l03829"></a><span class="lineno"> 3829</span>     cpl_matrix_set(rhs_input_cov, c+1, c+1, dext_coeff*dext_coeff);</div>
+<div class="line"><a name="l03830"></a><span class="lineno"> 3830</span>     cpl_matrix_set(rhs_input_cov, c+1, c+1, dzpoint*dzpoint);</div>
+<div class="line"><a name="l03831"></a><span class="lineno"> 3831</span>     </div>
+<div class="line"><a name="l03832"></a><span class="lineno"> 3832</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03833"></a><span class="lineno"> 3833</span>     </div>
+<div class="line"><a name="l03834"></a><span class="lineno"> 3834</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l03835"></a><span class="lineno"> 3835</span>     <span class="comment">/* build the following Jacobi matrix</span></div>
+<div class="line"><a name="l03836"></a><span class="lineno"> 3836</span> <span class="comment">     * with: i = index of referenced std. star,</span></div>
+<div class="line"><a name="l03837"></a><span class="lineno"> 3837</span> <span class="comment">     *       f = index of frame</span></div>
+<div class="line"><a name="l03838"></a><span class="lineno"> 3838</span> <span class="comment">     *       A = airmass,</span></div>
+<div class="line"><a name="l03839"></a><span class="lineno"> 3839</span> <span class="comment">     *       G = color correction term</span></div>
+<div class="line"><a name="l03840"></a><span class="lineno"> 3840</span> <span class="comment">     *       C = color</span></div>
+<div class="line"><a name="l03841"></a><span class="lineno"> 3841</span> <span class="comment">     * </span></div>
+<div class="line"><a name="l03842"></a><span class="lineno"> 3842</span> <span class="comment">     * ... (!fit_mag_i)*1 -(!fit_c)*G ... -(!fit_c)*C_i (!fit_e)*A_f -(!fit_z)*1</span></div>
+<div class="line"><a name="l03843"></a><span class="lineno"> 3843</span> <span class="comment">     *         . </span></div>
+<div class="line"><a name="l03844"></a><span class="lineno"> 3844</span> <span class="comment">     *         .</span></div>
+<div class="line"><a name="l03845"></a><span class="lineno"> 3845</span> <span class="comment">     *         .</span></div>
+<div class="line"><a name="l03846"></a><span class="lineno"> 3846</span> <span class="comment">     * </span></div>
+<div class="line"><a name="l03847"></a><span class="lineno"> 3847</span> <span class="comment">     * and multiply by (-1) to subtract the input.</span></div>
+<div class="line"><a name="l03848"></a><span class="lineno"> 3848</span> <span class="comment">     * fit_c appears twice with the coefficients required to compute the</span></div>
+<div class="line"><a name="l03849"></a><span class="lineno"> 3849</span> <span class="comment">     * rhs covariance matrix.</span></div>
+<div class="line"><a name="l03850"></a><span class="lineno"> 3850</span> <span class="comment">     * In principle, the airmass index could also be the index of the</span></div>
+<div class="line"><a name="l03851"></a><span class="lineno"> 3851</span> <span class="comment">     * measurement/observation of the star, since it is taken from the obs</span></div>
+<div class="line"><a name="l03852"></a><span class="lineno"> 3852</span> <span class="comment">     * object.</span></div>
+<div class="line"><a name="l03853"></a><span class="lineno"> 3853</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l03854"></a><span class="lineno"> 3854</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l03855"></a><span class="lineno"> 3855</span>     rhs_jacobian = cpl_matrix_new(n_obs, n_col);</div>
+<div class="line"><a name="l03856"></a><span class="lineno"> 3856</span>     <span class="keywordflow">for</span> (   obs = entry_list_first_const(obs_list), r = 0;</div>
+<div class="line"><a name="l03857"></a><span class="lineno"> 3857</span>             obs != NULL;</div>
+<div class="line"><a name="l03858"></a><span class="lineno"> 3858</span>             obs = entry_list_next_const(obs_list), r++)</div>
+<div class="line"><a name="l03859"></a><span class="lineno"> 3859</span>     {</div>
+<div class="line"><a name="l03860"></a><span class="lineno"> 3860</span>         <span class="keywordtype">bool</span>    fit_mag,</div>
+<div class="line"><a name="l03861"></a><span class="lineno"> 3861</span>                 compensate_color;</div>
+<div class="line"><a name="l03862"></a><span class="lineno"> 3862</span>         </div>
+<div class="line"><a name="l03863"></a><span class="lineno"> 3863</span>         c = obs->star_index * 2;</div>
+<div class="line"><a name="l03864"></a><span class="lineno"> 3864</span>         fit_mag = !(obs->star->id->trusted);</div>
+<div class="line"><a name="l03865"></a><span class="lineno"> 3865</span>         <span class="comment">/* if (fit_mag), then fit observed magnitude, not corrected by</span></div>
+<div class="line"><a name="l03866"></a><span class="lineno"> 3866</span> <span class="comment">         * catalogue color */</span></div>
+<div class="line"><a name="l03867"></a><span class="lineno"> 3867</span>         compensate_color = (!fit_c) && (!fit_mag);</div>
+<div class="line"><a name="l03868"></a><span class="lineno"> 3868</span>         </div>
+<div class="line"><a name="l03869"></a><span class="lineno"> 3869</span>         cpl_matrix_set(rhs_jacobian, r, c,  -(!fit_mag)*1.0);</div>
+<div class="line"><a name="l03870"></a><span class="lineno"> 3870</span>         cpl_matrix_set(rhs_jacobian, r, c+1, +(compensate_color)*color_coeff);</div>
+<div class="line"><a name="l03871"></a><span class="lineno"> 3871</span>         </div>
+<div class="line"><a name="l03872"></a><span class="lineno"> 3872</span>         cpl_matrix_set(rhs_jacobian, r, n_col-3, + (compensate_color)</div>
+<div class="line"><a name="l03873"></a><span class="lineno"> 3873</span>                                                    * obs->star->id->color);</div>
+<div class="line"><a name="l03874"></a><span class="lineno"> 3874</span>         cpl_matrix_set(rhs_jacobian, r, n_col-2, -(!fit_e)*obs->airmass);</div>
+<div class="line"><a name="l03875"></a><span class="lineno"> 3875</span>         cpl_matrix_set(rhs_jacobian, r, n_col-1, +(!fit_z)*1.0);</div>
+<div class="line"><a name="l03876"></a><span class="lineno"> 3876</span>     }</div>
+<div class="line"><a name="l03877"></a><span class="lineno"> 3877</span>     </div>
+<div class="line"><a name="l03878"></a><span class="lineno"> 3878</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03879"></a><span class="lineno"> 3879</span>     </div>
+<div class="line"><a name="l03880"></a><span class="lineno"> 3880</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l03881"></a><span class="lineno"> 3881</span>     <span class="comment">/* Prepare the rhs input vector:</span></div>
+<div class="line"><a name="l03882"></a><span class="lineno"> 3882</span> <span class="comment">     * </span></div>
+<div class="line"><a name="l03883"></a><span class="lineno"> 3883</span> <span class="comment">     * [...  cat_mag_i  color_i  ...  0  ext_coef  zpoint]^T</span></div>
+<div class="line"><a name="l03884"></a><span class="lineno"> 3884</span> <span class="comment">     * </span></div>
+<div class="line"><a name="l03885"></a><span class="lineno"> 3885</span> <span class="comment">     * Here, the term C*G shall only be used once, so set the other occurrence</span></div>
+<div class="line"><a name="l03886"></a><span class="lineno"> 3886</span> <span class="comment">     * to 0. </span></div>
+<div class="line"><a name="l03887"></a><span class="lineno"> 3887</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l03888"></a><span class="lineno"> 3888</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l03889"></a><span class="lineno"> 3889</span>     rhs_input = cpl_matrix_new(n_col, 1);</div>
+<div class="line"><a name="l03890"></a><span class="lineno"> 3890</span>     <span class="keywordflow">for</span> (   std = fors_std_star_list_first_const(std_list), r = 0;</div>
+<div class="line"><a name="l03891"></a><span class="lineno"> 3891</span>             std != NULL;</div>
+<div class="line"><a name="l03892"></a><span class="lineno"> 3892</span>             std = fors_std_star_list_next_const(std_list), r += 2)</div>
+<div class="line"><a name="l03893"></a><span class="lineno"> 3893</span>     {</div>
+<div class="line"><a name="l03894"></a><span class="lineno"> 3894</span>         <span class="keywordtype">double</span>  catm = std->cat_magnitude,</div>
+<div class="line"><a name="l03895"></a><span class="lineno"> 3895</span>                 color = std->color;</div>
+<div class="line"><a name="l03896"></a><span class="lineno"> 3896</span>         </div>
+<div class="line"><a name="l03897"></a><span class="lineno"> 3897</span>         <span class="comment">/* To new maintainers: first understand the rest of the</span></div>
+<div class="line"><a name="l03898"></a><span class="lineno"> 3898</span> <span class="comment">         * function without the following if-statement. */</span></div>
+<div class="line"><a name="l03899"></a><span class="lineno"> 3899</span>         <span class="keywordflow">if</span> (!(std->dcolor > 0) || isnan(std->cov_catm_color))</div>
+<div class="line"><a name="l03900"></a><span class="lineno"> 3900</span>         {</div>
+<div class="line"><a name="l03901"></a><span class="lineno"> 3901</span>             <span class="comment">/* see above */</span></div>
+<div class="line"><a name="l03902"></a><span class="lineno"> 3902</span>             color = 0;</div>
+<div class="line"><a name="l03903"></a><span class="lineno"> 3903</span>             <span class="keywordflow">if</span> (std->trusted) <span class="comment">/* !(fit magnitude) */</span></div>
+<div class="line"><a name="l03904"></a><span class="lineno"> 3904</span>             {</div>
+<div class="line"><a name="l03905"></a><span class="lineno"> 3905</span>                 <span class="keywordflow">if</span> (!fit_c)</div>
+<div class="line"><a name="l03906"></a><span class="lineno"> 3906</span>                     catm = std->magnitude;      <span class="comment">/* color corrected mag */</span></div>
+<div class="line"><a name="l03907"></a><span class="lineno"> 3907</span>             }</div>
+<div class="line"><a name="l03908"></a><span class="lineno"> 3908</span>         }</div>
+<div class="line"><a name="l03909"></a><span class="lineno"> 3909</span>         </div>
+<div class="line"><a name="l03910"></a><span class="lineno"> 3910</span>         cpl_matrix_set(rhs_input, r, 0, catm);</div>
+<div class="line"><a name="l03911"></a><span class="lineno"> 3911</span>         cpl_matrix_set(rhs_input, r+1, 0, color);</div>
+<div class="line"><a name="l03912"></a><span class="lineno"> 3912</span>     }</div>
+<div class="line"><a name="l03913"></a><span class="lineno"> 3913</span>     <span class="comment">/* we already have color_i*color_coeff</span></div>
+<div class="line"><a name="l03914"></a><span class="lineno"> 3914</span> <span class="comment">     *cpl_matrix_set(rhs_input, r, 0, 0);*/</span></div>
+<div class="line"><a name="l03915"></a><span class="lineno"> 3915</span>     cpl_matrix_set(rhs_input, r+1, 0, ext_coeff);</div>
+<div class="line"><a name="l03916"></a><span class="lineno"> 3916</span>     cpl_matrix_set(rhs_input, r+2, 0, zpoint);</div>
+<div class="line"><a name="l03917"></a><span class="lineno"> 3917</span>     </div>
+<div class="line"><a name="l03918"></a><span class="lineno"> 3918</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03919"></a><span class="lineno"> 3919</span>     </div>
+<div class="line"><a name="l03920"></a><span class="lineno"> 3920</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l03921"></a><span class="lineno"> 3921</span>     <span class="comment">/* ...and compute the results... */</span></div>
+<div class="line"><a name="l03922"></a><span class="lineno"> 3922</span>     *rhs = cpl_matrix_product_create(rhs_jacobian, rhs_input);</div>
+<div class="line"><a name="l03923"></a><span class="lineno"> 3923</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03924"></a><span class="lineno"> 3924</span>     </div>
+<div class="line"><a name="l03925"></a><span class="lineno"> 3925</span>     rhs_jacobian_T = cpl_matrix_transpose_create(rhs_jacobian);</div>
+<div class="line"><a name="l03926"></a><span class="lineno"> 3926</span>     tmp_matrix = cpl_matrix_product_create(rhs_input_cov, rhs_jacobian_T);</div>
+<div class="line"><a name="l03927"></a><span class="lineno"> 3927</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03928"></a><span class="lineno"> 3928</span>     *rhs_cov = cpl_matrix_product_create(rhs_jacobian, tmp_matrix);</div>
+<div class="line"><a name="l03929"></a><span class="lineno"> 3929</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l03930"></a><span class="lineno"> 3930</span>     </div>
+<div class="line"><a name="l03931"></a><span class="lineno"> 3931</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l03932"></a><span class="lineno"> 3932</span>     <span class="comment">/* add the missing contributions:</span></div>
+<div class="line"><a name="l03933"></a><span class="lineno"> 3933</span> <span class="comment">     * 1. rhs    : instrumental magnitude, subtract gain and exptime</span></div>
+<div class="line"><a name="l03934"></a><span class="lineno"> 3934</span> <span class="comment">     * 2. rhs_cov: variance of instrumental magnitude</span></div>
+<div class="line"><a name="l03935"></a><span class="lineno"> 3935</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l03936"></a><span class="lineno"> 3936</span>     <span class="comment">/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/</span></div>
+<div class="line"><a name="l03937"></a><span class="lineno"> 3937</span>     <span class="keywordflow">for</span> (   obs = entry_list_first_const(obs_list), r = 0;</div>
+<div class="line"><a name="l03938"></a><span class="lineno"> 3938</span>             obs != NULL;</div>
+<div class="line"><a name="l03939"></a><span class="lineno"> 3939</span>             obs = entry_list_next_const(obs_list), r++)</div>
+<div class="line"><a name="l03940"></a><span class="lineno"> 3940</span>     {</div>
+<div class="line"><a name="l03941"></a><span class="lineno"> 3941</span>         cpl_matrix_set(*rhs, r, 0,      cpl_matrix_get(*rhs, r, 0)</div>
+<div class="line"><a name="l03942"></a><span class="lineno"> 3942</span>                                         + obs->star->magnitude</div>
+<div class="line"><a name="l03943"></a><span class="lineno"> 3943</span>                                         + 2.5*log10(obs->gain)</div>
+<div class="line"><a name="l03944"></a><span class="lineno"> 3944</span>                                         + 2.5*log10(obs->exptime));</div>
+<div class="line"><a name="l03945"></a><span class="lineno"> 3945</span>         cpl_matrix_set(*rhs_cov, r, r,  cpl_matrix_get(*rhs_cov, r, r)</div>
+<div class="line"><a name="l03946"></a><span class="lineno"> 3946</span>                                         + obs->star->dmagnitude</div>
+<div class="line"><a name="l03947"></a><span class="lineno"> 3947</span>                                           * obs->star->dmagnitude);</div>
+<div class="line"><a name="l03948"></a><span class="lineno"> 3948</span>     }</div>
+<div class="line"><a name="l03949"></a><span class="lineno"> 3949</span>     </div>
+<div class="line"><a name="l03950"></a><span class="lineno"> 3950</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&rhs_input_cov);</div>
+<div class="line"><a name="l03951"></a><span class="lineno"> 3951</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&rhs_jacobian);</div>
+<div class="line"><a name="l03952"></a><span class="lineno"> 3952</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&rhs_input);</div>
+<div class="line"><a name="l03953"></a><span class="lineno"> 3953</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&rhs_jacobian_T);</div>
+<div class="line"><a name="l03954"></a><span class="lineno"> 3954</span>     <a class="code" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c" title="Delete a cpl_matrix and set the pointer to NULL.">fors_matrix_null</a>(&tmp_matrix);</div>
+<div class="line"><a name="l03955"></a><span class="lineno"> 3955</span>     </div>
+<div class="line"><a name="l03956"></a><span class="lineno"> 3956</span>     <span class="keywordflow">return</span> (    cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l03957"></a><span class="lineno"> 3957</span>                 CPL_ERROR_NONE :</div>
+<div class="line"><a name="l03958"></a><span class="lineno"> 3958</span>                 cpl_error_get_code());</div>
+<div class="line"><a name="l03959"></a><span class="lineno"> 3959</span> }</div>
+<div class="line"><a name="l03960"></a><span class="lineno"> 3960</span> </div>
+<div class="line"><a name="l03961"></a><span class="lineno"> 3961</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__photometry__impl_8h-source.html b/html/fors__photometry__impl_8h-source.html
deleted file mode 100644
index 6f28ee0..0000000
--- a/html/fors__photometry__impl_8h-source.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_photometry_impl.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_photometry_impl.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_photometry_impl.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_PHOTOMETRY_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_PHOTOMETRY_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a>;
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__photometry.html#gc66ce3f4470634c6cee1eab4c05f6985">fors_photometry_description_short</a>;
-<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__photometry.html#g6772a94b278b89711f7ab2c9d19a6c91">fors_photometry_author</a>;
-<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__photometry.html#gc03e598cb3c1c63eb2a1b04939aa2f21">fors_photometry_email</a>;
-<a name="l00039"></a>00039 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__photometry.html#g1e4c46bbe3d698da29ad2ca40f5c70cf">fors_photometry_description</a>;
-<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="group__fors__photometry.html#gecc363f8be41aa6d224d6f604d5a6b30">fors_photometry_define_parameters</a>(cpl_parameterlist *parameters);
-<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="group__fors__photometry.html#g78298a3adaf4b775f4a48a21a2b475ba">fors_photometry</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 CPL_END_DECLS
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__photometry__impl_8h_source.html b/html/fors__photometry__impl_8h_source.html
new file mode 100644
index 0000000..3cf4e36
--- /dev/null
+++ b/html/fors__photometry__impl_8h_source.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_photometry_impl.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_photometry_impl.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_photometry_impl.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.4 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_PHOTOMETRY_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_PHOTOMETRY_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_photometry_name;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_photometry_description_short;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_photometry_author;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_photometry_email;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_photometry_description;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__photometry.html#ga4b3a00d660ccc7d889875a00fb629be5" title="Define recipe parameters.">fors_photometry_define_parameters</a>(cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__photometry.html#gae18d6d686eec800da9538ee3c533aed7" title="Do the processing.">fors_photometry</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__pmos__calib_8c-source.html b/html/fors__pmos__calib_8c-source.html
deleted file mode 100644
index 8074149..0000000
--- a/html/fors__pmos__calib_8c-source.html
+++ /dev/null
@@ -1,2316 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_pmos_calib.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_pmos_calib.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_pmos_calib.c,v 1.38 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.38 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <string.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <ctype.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <moses.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_stack.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_header.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#define OFFSET    50</span>
-<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define TOLERANCE 10</span>
-<a name="l00043"></a>00043 <span class="preprocessor"></span>
-<a name="l00044"></a>00044 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_create(cpl_plugin *);
-<a name="l00045"></a>00045 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_exec(cpl_plugin *);
-<a name="l00046"></a>00046 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_destroy(cpl_plugin *);
-<a name="l00047"></a>00047 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib(cpl_parameterlist *, cpl_frameset *);
-<a name="l00048"></a>00048 
-<a name="l00049"></a>00049 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_pmos_calib_description[] =
-<a name="l00050"></a>00050 <span class="stringliteral">"This recipe is used to identify reference lines on PMOS arc lamp\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"exposures, and trace the spectral edges on the corresponding flat field\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"exposures. This information is used to determine the spectral extraction\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"mask to be applied in the scientific data reduction, performed with the\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"recipe fors_science.\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. The input arc lamps and\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"flat field exposures are assumed to be obtained quasi-simultaneously, so\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"that they would be described by exactly the same instrument distortions.\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"A line catalog must be specified, containing the wavelengths of the\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"reference arc lamp lines used for the wavelength calibration. A grism\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"table (typically depending on the instrument mode, and in particular on\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"the grism used) may also be specified: this table contains a default\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"recipe parameter setting to control the way spectra are extracted for\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"a specific instrument mode, as it is used for automatic run of the\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"pipeline on Paranal and in Garching. If this table is specified, it\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"will modify the default recipe parameter setting, with the exception of\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"those parameters which have been explicitly modifyed on the command line.\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"If a grism table is not specified, the input recipe parameters values\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"will always be read from the command line, or from an esorex configuration\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"file if present, or from their generic default values (that are rarely\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"meaningful). Finally a master bias frame must be input to this recipe.\n"</span> 
-<a name="l00071"></a>00071 <span class="stringliteral">"The products SPECTRA_DETECTION_PMOS, SLIT_MAP_PMOS, and DISP_RESIDUALS_PMOS,\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"are just created if the --check parameter is set to true.\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"The MASTER_DISTORTION_TABLE is marked as required, but it is not so if all\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"slits have different offsets, and in the case of FORS1 observations made\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"with the old TK2048EB4-1 1604 chip read in windowed mode (2048x400)\n\n"</span> 
-<a name="l00076"></a>00076 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00077"></a>00077 <span class="stringliteral">"  DO category:              Type:       Explanation:          Required:\n"</span>
-<a name="l00078"></a>00078 <span class="stringliteral">"  SCREEN_FLAT_PMOS          Raw         Flat field exposures     Y\n"</span>
-<a name="l00079"></a>00079 <span class="stringliteral">"  LAMP_PMOS                 Raw         Arc lamp exposure        Y\n"</span>
-<a name="l00080"></a>00080 <span class="stringliteral">"  MASTER_BIAS or BIAS       Calib       Bias frame               Y\n"</span>
-<a name="l00081"></a>00081 <span class="stringliteral">"  MASTER_LINECAT            Calib       Line catalog             Y\n"</span>
-<a name="l00082"></a>00082 <span class="stringliteral">"  GRISM_TABLE               Calib       Grism table              .\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"  MASTER_DISTORTION_TABLE   Calib       Master distortions table Y\n\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"Output files:\n\n"</span> 
-<a name="l00085"></a>00085 <span class="stringliteral">"  DO category:              Data type:  Explanation:\n"</span>
-<a name="l00086"></a>00086 <span class="stringliteral">"  MASTER_SCREEN_FLAT_PMOS   FITS image  Combined (sum) flat field\n"</span>
-<a name="l00087"></a>00087 <span class="stringliteral">"  MASTER_NORM_FLAT_PMOS     FITS image  Normalised flat field\n"</span>
-<a name="l00088"></a>00088 <span class="stringliteral">"  MAPPED_SCREEN_FLAT_PMOS   FITS image  Wavelength calibrated flat field\n"</span>
-<a name="l00089"></a>00089 <span class="stringliteral">"  MAPPED_NORM_FLAT_PMOS     FITS image  Wavelength calibrated normalised flat\n"</span>
-<a name="l00090"></a>00090 <span class="stringliteral">"  REDUCED_LAMP_PMOS         FITS image  Wavelength calibrated arc spectrum\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"  DISP_COEFF_PMOS           FITS table  Inverse dispersion coefficients\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"  DISP_RESIDUALS_PMOS       FITS image  Residuals in wavelength calibration\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"  DISP_RESIDUALS_TABLE_PMOS FITS table  Residuals in wavelength calibration\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"  DELTA_IMAGE_PMOS          FITS image  Offset vs linear wavelength calib\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"  WAVELENGTH_MAP_PMOS       FITS image  Wavelength for each pixel on CCD\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"  SPECTRA_DETECTION_PMOS    FITS image  Check for preliminary detection\n"</span>
-<a name="l00097"></a>00097 <span class="stringliteral">"  SLIT_MAP_PMOS             FITS image  Map of central wavelength on CCD\n"</span>
-<a name="l00098"></a>00098 <span class="stringliteral">"  CURV_TRACES_PMOS          FITS table  Spectral curvature traces\n"</span>
-<a name="l00099"></a>00099 <span class="stringliteral">"  CURV_COEFF_PMOS           FITS table  Spectral curvature coefficients\n"</span>
-<a name="l00100"></a>00100 <span class="stringliteral">"  SPATIAL_MAP_PMOS          FITS image  Spatial position along slit on CCD\n"</span>
-<a name="l00101"></a>00101 <span class="stringliteral">"  SPECTRAL_RESOLUTION_PMOS  FITS table  Resolution at reference arc lines\n"</span>
-<a name="l00102"></a>00102 <span class="stringliteral">"  SLIT_LOCATION_PMOS        FITS table  Slits on product frames and CCD\n\n"</span>;
-<a name="l00103"></a>00103 
-<a name="l00104"></a>00104 <span class="preprocessor">#define fors_pmos_calib_exit(message)              \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">{                                             \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">cpl_free(instrume);                           \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">cpl_free(fiterror);                           \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">cpl_free(fitlines);                           \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">cpl_image_delete(bias);                       \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">cpl_image_delete(master_bias);                \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">cpl_image_delete(checkwave);                  \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">cpl_image_delete(flat);                       \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">cpl_image_delete(master_flat);                \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">cpl_image_delete(added_flat);                 \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">cpl_image_delete(mapped_flat);                \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">cpl_image_delete(mapped_nflat);               \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00121"></a>00121 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">cpl_image_delete(residual);                   \</span>
-<a name="l00123"></a>00123 <span class="preprocessor">cpl_image_delete(smo_flat);                   \</span>
-<a name="l00124"></a>00124 <span class="preprocessor">cpl_image_delete(spatial);                    \</span>
-<a name="l00125"></a>00125 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00126"></a>00126 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00127"></a>00127 <span class="preprocessor">cpl_image_delete(delta);                      \</span>
-<a name="l00128"></a>00128 <span class="preprocessor">cpl_image_delete(rect_flat);                  \</span>
-<a name="l00129"></a>00129 <span class="preprocessor">cpl_image_delete(rect_nflat);                 \</span>
-<a name="l00130"></a>00130 <span class="preprocessor">cpl_image_delete(mapped_flat);                \</span>
-<a name="l00131"></a>00131 <span class="preprocessor">cpl_image_delete(mapped_nflat);               \</span>
-<a name="l00132"></a>00132 <span class="preprocessor">cpl_mask_delete(refmask);                     \</span>
-<a name="l00133"></a>00133 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00134"></a>00134 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00135"></a>00135 <span class="preprocessor">cpl_propertylist_delete(qclist);              \</span>
-<a name="l00136"></a>00136 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00137"></a>00137 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00138"></a>00138 <span class="preprocessor">cpl_table_delete(idscoeff_all);               \</span>
-<a name="l00139"></a>00139 <span class="preprocessor">cpl_table_delete(restable);                   \</span>
-<a name="l00140"></a>00140 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00141"></a>00141 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00142"></a>00142 <span class="preprocessor">cpl_table_delete(traces);                     \</span>
-<a name="l00143"></a>00143 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00144"></a>00144 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00145"></a>00145 <span class="preprocessor">cpl_table_delete(restab);                     \</span>
-<a name="l00146"></a>00146 <span class="preprocessor">cpl_table_delete(global);                     \</span>
-<a name="l00147"></a>00147 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00148"></a>00148 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00149"></a>00149 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00150"></a>00150 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00151"></a>00151 <span class="preprocessor">}</span>
-<a name="l00152"></a>00152 <span class="preprocessor"></span>
-<a name="l00153"></a>00153 <span class="preprocessor">#define fors_pmos_calib_exit_memcheck(message)       \</span>
-<a name="l00154"></a>00154 <span class="preprocessor">{                                               \</span>
-<a name="l00155"></a>00155 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00156"></a>00156 <span class="preprocessor">printf("free instrume (%p)\n", instrume);       \</span>
-<a name="l00157"></a>00157 <span class="preprocessor">cpl_free(instrume);                             \</span>
-<a name="l00158"></a>00158 <span class="preprocessor">printf("free pipefile (%p)\n", pipefile);       \</span>
-<a name="l00159"></a>00159 <span class="preprocessor">cpl_free(pipefile);                             \</span>
-<a name="l00160"></a>00160 <span class="preprocessor">printf("free fiterror (%p)\n", fiterror);       \</span>
-<a name="l00161"></a>00161 <span class="preprocessor">cpl_free(fiterror);                             \</span>
-<a name="l00162"></a>00162 <span class="preprocessor">printf("free fitlines (%p)\n", fitlines);       \</span>
-<a name="l00163"></a>00163 <span class="preprocessor">cpl_free(fitlines);                             \</span>
-<a name="l00164"></a>00164 <span class="preprocessor">printf("free bias (%p)\n", bias);               \</span>
-<a name="l00165"></a>00165 <span class="preprocessor">cpl_image_delete(bias);                         \</span>
-<a name="l00166"></a>00166 <span class="preprocessor">printf("free master_bias (%p)\n", master_bias); \</span>
-<a name="l00167"></a>00167 <span class="preprocessor">cpl_image_delete(master_bias);                  \</span>
-<a name="l00168"></a>00168 <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);   \</span>
-<a name="l00169"></a>00169 <span class="preprocessor">cpl_image_delete(coordinate);                   \</span>
-<a name="l00170"></a>00170 <span class="preprocessor">printf("free checkwave (%p)\n", checkwave);     \</span>
-<a name="l00171"></a>00171 <span class="preprocessor">cpl_image_delete(checkwave);                    \</span>
-<a name="l00172"></a>00172 <span class="preprocessor">printf("free flat (%p)\n", flat);               \</span>
-<a name="l00173"></a>00173 <span class="preprocessor">cpl_image_delete(flat);                         \</span>
-<a name="l00174"></a>00174 <span class="preprocessor">printf("free master_flat (%p)\n", master_flat); \</span>
-<a name="l00175"></a>00175 <span class="preprocessor">cpl_image_delete(master_flat);                  \</span>
-<a name="l00176"></a>00176 <span class="preprocessor">printf("free norm_flat (%p)\n", norm_flat);     \</span>
-<a name="l00177"></a>00177 <span class="preprocessor">cpl_image_delete(norm_flat);                    \</span>
-<a name="l00178"></a>00178 <span class="preprocessor">printf("free mapped_flat (%p)\n", mapped_flat); \</span>
-<a name="l00179"></a>00179 <span class="preprocessor">cpl_image_delete(mapped_flat);                  \</span>
-<a name="l00180"></a>00180 <span class="preprocessor">printf("free mapped_nflat (%p)\n", mapped_nflat); \</span>
-<a name="l00181"></a>00181 <span class="preprocessor">cpl_image_delete(mapped_nflat);                 \</span>
-<a name="l00182"></a>00182 <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);         \</span>
-<a name="l00183"></a>00183 <span class="preprocessor">cpl_image_delete(rainbow);                      \</span>
-<a name="l00184"></a>00184 <span class="preprocessor">printf("free rectified (%p)\n", rectified);     \</span>
-<a name="l00185"></a>00185 <span class="preprocessor">cpl_image_delete(rectified);                    \</span>
-<a name="l00186"></a>00186 <span class="preprocessor">printf("free residual (%p)\n", residual);       \</span>
-<a name="l00187"></a>00187 <span class="preprocessor">cpl_image_delete(residual);                     \</span>
-<a name="l00188"></a>00188 <span class="preprocessor">printf("free smo_flat (%p)\n", smo_flat);       \</span>
-<a name="l00189"></a>00189 <span class="preprocessor">cpl_image_delete(smo_flat);                     \</span>
-<a name="l00190"></a>00190 <span class="preprocessor">printf("free spatial (%p)\n", spatial);         \</span>
-<a name="l00191"></a>00191 <span class="preprocessor">cpl_image_delete(spatial);                      \</span>
-<a name="l00192"></a>00192 <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span>
-<a name="l00193"></a>00193 <span class="preprocessor">cpl_image_delete(spectra);                      \</span>
-<a name="l00194"></a>00194 <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);         \</span>
-<a name="l00195"></a>00195 <span class="preprocessor">cpl_image_delete(wavemap);                      \</span>
-<a name="l00196"></a>00196 <span class="preprocessor">printf("free delta (%p)\n", delta);             \</span>
-<a name="l00197"></a>00197 <span class="preprocessor">cpl_image_delete(delta);                        \</span>
-<a name="l00198"></a>00198 <span class="preprocessor">printf("free rect_flat (%p)\n", rect_flat);     \</span>
-<a name="l00199"></a>00199 <span class="preprocessor">cpl_image_delete(rect_flat);                    \</span>
-<a name="l00200"></a>00200 <span class="preprocessor">printf("free rect_nflat (%p)\n", rect_nflat);   \</span>
-<a name="l00201"></a>00201 <span class="preprocessor">cpl_image_delete(rect_nflat);                   \</span>
-<a name="l00202"></a>00202 <span class="preprocessor">printf("free refmask (%p)\n", refmask);         \</span>
-<a name="l00203"></a>00203 <span class="preprocessor">cpl_mask_delete(refmask);                       \</span>
-<a name="l00204"></a>00204 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00205"></a>00205 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00206"></a>00206 <span class="preprocessor">printf("free save_header (%p)\n", save_header); \</span>
-<a name="l00207"></a>00207 <span class="preprocessor">cpl_propertylist_delete(save_header);           \</span>
-<a name="l00208"></a>00208 <span class="preprocessor">printf("free qclist (%p)\n", qclist);           \</span>
-<a name="l00209"></a>00209 <span class="preprocessor">cpl_propertylist_delete(qclist);                \</span>
-<a name="l00210"></a>00210 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span>
-<a name="l00211"></a>00211 <span class="preprocessor">cpl_table_delete(grism_table);                  \</span>
-<a name="l00212"></a>00212 <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);       \</span>
-<a name="l00213"></a>00213 <span class="preprocessor">cpl_table_delete(idscoeff);                     \</span>
-<a name="l00214"></a>00214 <span class="preprocessor">printf("free idscoeff_all (%p)\n", idscoeff_all);  \</span>
-<a name="l00215"></a>00215 <span class="preprocessor">cpl_table_delete(idscoeff_all);                 \</span>
-<a name="l00216"></a>00216 <span class="preprocessor">printf("free restable (%p)\n", restable);       \</span>
-<a name="l00217"></a>00217 <span class="preprocessor">cpl_table_delete(restable);                     \</span>
-<a name="l00218"></a>00218 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span>
-<a name="l00219"></a>00219 <span class="preprocessor">cpl_table_delete(maskslits);                    \</span>
-<a name="l00220"></a>00220 <span class="preprocessor">printf("free overscans (%p)\n", overscans);     \</span>
-<a name="l00221"></a>00221 <span class="preprocessor">cpl_table_delete(overscans);                    \</span>
-<a name="l00222"></a>00222 <span class="preprocessor">printf("free traces (%p)\n", traces);           \</span>
-<a name="l00223"></a>00223 <span class="preprocessor">cpl_table_delete(traces);                       \</span>
-<a name="l00224"></a>00224 <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span>
-<a name="l00225"></a>00225 <span class="preprocessor">cpl_table_delete(polytraces);                   \</span>
-<a name="l00226"></a>00226 <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span>
-<a name="l00227"></a>00227 <span class="preprocessor">cpl_table_delete(slits);                        \</span>
-<a name="l00228"></a>00228 <span class="preprocessor">printf("free restab (%p)\n", restab);           \</span>
-<a name="l00229"></a>00229 <span class="preprocessor">cpl_table_delete(restab);                       \</span>
-<a name="l00230"></a>00230 <span class="preprocessor">printf("free global (%p)\n", global);           \</span>
-<a name="l00231"></a>00231 <span class="preprocessor">cpl_table_delete(global);                       \</span>
-<a name="l00232"></a>00232 <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths); \</span>
-<a name="l00233"></a>00233 <span class="preprocessor">cpl_table_delete(wavelengths);                  \</span>
-<a name="l00234"></a>00234 <span class="preprocessor">printf("free lines (%p)\n", lines);             \</span>
-<a name="l00235"></a>00235 <span class="preprocessor">cpl_vector_delete(lines);                       \</span>
-<a name="l00236"></a>00236 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00237"></a>00237 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00238"></a>00238 <span class="preprocessor">}</span>
-<a name="l00239"></a>00239 <span class="preprocessor"></span>
-<a name="l00240"></a>00240 
-<a name="l00252"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00252</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00253"></a>00253 {
-<a name="l00254"></a>00254     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00255"></a>00255     cpl_plugin *plugin = &recipe->interface;
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257     cpl_plugin_init(plugin,
-<a name="l00258"></a>00258                     CPL_PLUGIN_API,
-<a name="l00259"></a>00259                     FORS_BINARY_VERSION,
-<a name="l00260"></a>00260                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00261"></a>00261                     <span class="stringliteral">"fors_pmos_calib"</span>,
-<a name="l00262"></a>00262                     <span class="stringliteral">"Determination of the extraction mask"</span>,
-<a name="l00263"></a>00263                     fors_pmos_calib_description,
-<a name="l00264"></a>00264                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00265"></a>00265                     PACKAGE_BUGREPORT,
-<a name="l00266"></a>00266     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00267"></a>00267     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00268"></a>00268     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00269"></a>00269     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00270"></a>00270     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00271"></a>00271     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00272"></a>00272     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00273"></a>00273     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00274"></a>00274     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00275"></a>00275     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00276"></a>00276     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00277"></a>00277     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00278"></a>00278     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00279"></a>00279                     fors_pmos_calib_create,
-<a name="l00280"></a>00280                     fors_pmos_calib_exec,
-<a name="l00281"></a>00281                     fors_pmos_calib_destroy);
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283     cpl_pluginlist_append(list, plugin);
-<a name="l00284"></a>00284     
-<a name="l00285"></a>00285     <span class="keywordflow">return</span> 0;
-<a name="l00286"></a>00286 }
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288 
-<a name="l00299"></a>00299 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_create(cpl_plugin *plugin)
-<a name="l00300"></a>00300 {
-<a name="l00301"></a>00301     cpl_recipe    *recipe;
-<a name="l00302"></a>00302     cpl_parameter *p;
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305     <span class="comment">/* </span>
-<a name="l00306"></a>00306 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00307"></a>00307 <span class="comment">     */</span>
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00310"></a>00310         recipe = (cpl_recipe *)plugin;
-<a name="l00311"></a>00311     <span class="keywordflow">else</span> 
-<a name="l00312"></a>00312         <span class="keywordflow">return</span> -1;
-<a name="l00313"></a>00313 
-<a name="l00314"></a>00314     <span class="comment">/* </span>
-<a name="l00315"></a>00315 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00316"></a>00316 <span class="comment">     */</span>
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00319"></a>00319 
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321     <span class="comment">/*</span>
-<a name="l00322"></a>00322 <span class="comment">     * Dispersion</span>
-<a name="l00323"></a>00323 <span class="comment">     */</span>
-<a name="l00324"></a>00324 
-<a name="l00325"></a>00325     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.dispersion"</span>,
-<a name="l00326"></a>00326                                 CPL_TYPE_DOUBLE,
-<a name="l00327"></a>00327                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00328"></a>00328                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00329"></a>00329                                 0.0);
-<a name="l00330"></a>00330     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00331"></a>00331     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00332"></a>00332     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="comment">/*</span>
-<a name="l00335"></a>00335 <span class="comment">     * Peak detection level</span>
-<a name="l00336"></a>00336 <span class="comment">     */</span>
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.peakdetection"</span>,
-<a name="l00339"></a>00339                                 CPL_TYPE_DOUBLE,
-<a name="l00340"></a>00340                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,
-<a name="l00341"></a>00341                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00342"></a>00342                                 0.0);
-<a name="l00343"></a>00343     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);
-<a name="l00344"></a>00344     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00345"></a>00345     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00346"></a>00346 
-<a name="l00347"></a>00347     <span class="comment">/* </span>
-<a name="l00348"></a>00348 <span class="comment">     * Degree of wavelength calibration polynomial</span>
-<a name="l00349"></a>00349 <span class="comment">     */</span>
-<a name="l00350"></a>00350 
-<a name="l00351"></a>00351     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.wdegree"</span>,
-<a name="l00352"></a>00352                                 CPL_TYPE_INT,
-<a name="l00353"></a>00353                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,
-<a name="l00354"></a>00354                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00355"></a>00355                                 0);
-<a name="l00356"></a>00356     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);
-<a name="l00357"></a>00357     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00358"></a>00358     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00359"></a>00359 
-<a name="l00360"></a>00360     <span class="comment">/*</span>
-<a name="l00361"></a>00361 <span class="comment">     * Reference lines search radius</span>
-<a name="l00362"></a>00362 <span class="comment">     */</span>
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.wradius"</span>,
-<a name="l00365"></a>00365                                 CPL_TYPE_INT,
-<a name="l00366"></a>00366                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span>
-<a name="l00367"></a>00367                                 <span class="stringliteral">"with first-guess method"</span>,
-<a name="l00368"></a>00368                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00369"></a>00369                                 4);
-<a name="l00370"></a>00370     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);
-<a name="l00371"></a>00371     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00372"></a>00372     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374     <span class="comment">/*</span>
-<a name="l00375"></a>00375 <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span>
-<a name="l00376"></a>00376 <span class="comment">     */</span>
-<a name="l00377"></a>00377 
-<a name="l00378"></a>00378     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.wreject"</span>,
-<a name="l00379"></a>00379                                 CPL_TYPE_DOUBLE,
-<a name="l00380"></a>00380                                 <span class="stringliteral">"Rejection threshold in dispersion "</span>
-<a name="l00381"></a>00381                                 <span class="stringliteral">"relation fit (pixel)"</span>,
-<a name="l00382"></a>00382                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00383"></a>00383                                 0.7);
-<a name="l00384"></a>00384     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);
-<a name="l00385"></a>00385     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00386"></a>00386     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388     <span class="comment">/*</span>
-<a name="l00389"></a>00389 <span class="comment">     * Line catalog table column containing the reference wavelengths</span>
-<a name="l00390"></a>00390 <span class="comment">     */</span>
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.wcolumn"</span>,
-<a name="l00393"></a>00393                                 CPL_TYPE_STRING,
-<a name="l00394"></a>00394                                 <span class="stringliteral">"Name of line catalog table column "</span>
-<a name="l00395"></a>00395                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00396"></a>00396                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00397"></a>00397                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00398"></a>00398     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00399"></a>00399     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00400"></a>00400     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     <span class="comment">/*</span>
-<a name="l00403"></a>00403 <span class="comment">     * Degree of spectral curvature polynomial</span>
-<a name="l00404"></a>00404 <span class="comment">     */</span>
-<a name="l00405"></a>00405 
-<a name="l00406"></a>00406     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.cdegree"</span>,
-<a name="l00407"></a>00407                                 CPL_TYPE_INT,
-<a name="l00408"></a>00408                                 <span class="stringliteral">"Degree of spectral curvature polynomial"</span>,
-<a name="l00409"></a>00409                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00410"></a>00410                                 0);
-<a name="l00411"></a>00411     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cdegree"</span>);
-<a name="l00412"></a>00412     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00413"></a>00413     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     <span class="comment">/*</span>
-<a name="l00416"></a>00416 <span class="comment">     * Curvature solution interpolation</span>
-<a name="l00417"></a>00417 <span class="comment">     */</span>
-<a name="l00418"></a>00418  
-<a name="l00419"></a>00419     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.cmode"</span>,
-<a name="l00420"></a>00420                                 CPL_TYPE_INT,
-<a name="l00421"></a>00421                                 <span class="stringliteral">"Interpolation mode of curvature solution "</span>
-<a name="l00422"></a>00422                                 <span class="stringliteral">"(0 = no "</span>
-<a name="l00423"></a>00423                                 <span class="stringliteral">"interpolation, 1 = fill gaps, 2 = global "</span>
-<a name="l00424"></a>00424                                 <span class="stringliteral">"model)"</span>,
-<a name="l00425"></a>00425                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00426"></a>00426                                 1);
-<a name="l00427"></a>00427     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cmode"</span>);
-<a name="l00428"></a>00428     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00429"></a>00429     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00430"></a>00430 
-<a name="l00431"></a>00431     <span class="comment">/*</span>
-<a name="l00432"></a>00432 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00433"></a>00433 <span class="comment">     */</span>
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.startwavelength"</span>,
-<a name="l00436"></a>00436                                 CPL_TYPE_DOUBLE,
-<a name="l00437"></a>00437                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00438"></a>00438                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00439"></a>00439                                 0.0);
-<a name="l00440"></a>00440     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00441"></a>00441     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00442"></a>00442     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00443"></a>00443 
-<a name="l00444"></a>00444     <span class="comment">/*</span>
-<a name="l00445"></a>00445 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00446"></a>00446 <span class="comment">     */</span>
-<a name="l00447"></a>00447 
-<a name="l00448"></a>00448     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.endwavelength"</span>,
-<a name="l00449"></a>00449                                 CPL_TYPE_DOUBLE,
-<a name="l00450"></a>00450                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00451"></a>00451                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00452"></a>00452                                 0.0);
-<a name="l00453"></a>00453     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00454"></a>00454     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00455"></a>00455     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457     <span class="comment">/*</span>
-<a name="l00458"></a>00458 <span class="comment">     * Flat field frames stack parameters</span>
-<a name="l00459"></a>00459 <span class="comment">     */</span>
-<a name="l00460"></a>00460  
-<a name="l00461"></a>00461     <a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a>(recipe->parameters, <span class="stringliteral">"fors.fors_pmos_calib"</span>, 
-<a name="l00462"></a>00462                                  <span class="stringliteral">"average"</span>);
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     <span class="comment">/*</span>
-<a name="l00465"></a>00465 <span class="comment">     * Degree of flat field fitting polynomial along dispersion direction</span>
-<a name="l00466"></a>00466 <span class="comment">     */</span>
-<a name="l00467"></a>00467 
-<a name="l00468"></a>00468     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.ddegree"</span>,
-<a name="l00469"></a>00469                                 CPL_TYPE_INT,
-<a name="l00470"></a>00470                                 <span class="stringliteral">"Degree of flat field fitting polynomial "</span>
-<a name="l00471"></a>00471                                 <span class="stringliteral">"along dispersion direction"</span>,
-<a name="l00472"></a>00472                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00473"></a>00473                                 -1);
-<a name="l00474"></a>00474     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ddegree"</span>);
-<a name="l00475"></a>00475     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00476"></a>00476     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00477"></a>00477 
-<a name="l00478"></a>00478     <span class="comment">/*</span>
-<a name="l00479"></a>00479 <span class="comment">     * Smooth box radius for flat field along dispersion direction</span>
-<a name="l00480"></a>00480 <span class="comment">     */</span>
-<a name="l00481"></a>00481 
-<a name="l00482"></a>00482     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.dradius"</span>,
-<a name="l00483"></a>00483                                 CPL_TYPE_INT,
-<a name="l00484"></a>00484                                 <span class="stringliteral">"Smooth box radius for flat field along "</span>
-<a name="l00485"></a>00485                                 <span class="stringliteral">"dispersion direction"</span>,
-<a name="l00486"></a>00486                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00487"></a>00487                                 10);
-<a name="l00488"></a>00488     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dradius"</span>);
-<a name="l00489"></a>00489     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00490"></a>00490     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00491"></a>00491 
-<a name="l00492"></a>00492     <span class="comment">/*</span>
-<a name="l00493"></a>00493 <span class="comment">     * Computation of QC1 parameters</span>
-<a name="l00494"></a>00494 <span class="comment">     */</span>
-<a name="l00495"></a>00495 
-<a name="l00496"></a>00496     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.qc"</span>,
-<a name="l00497"></a>00497                                 CPL_TYPE_BOOL,
-<a name="l00498"></a>00498                                 <span class="stringliteral">"Compute QC1 parameters"</span>,
-<a name="l00499"></a>00499                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00500"></a>00500                                 TRUE);
-<a name="l00501"></a>00501     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"qc"</span>);
-<a name="l00502"></a>00502     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00503"></a>00503     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00504"></a>00504 
-<a name="l00505"></a>00505     <span class="comment">/*</span>
-<a name="l00506"></a>00506 <span class="comment">     * Create check products</span>
-<a name="l00507"></a>00507 <span class="comment">     */</span>
-<a name="l00508"></a>00508 
-<a name="l00509"></a>00509     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.check"</span>,
-<a name="l00510"></a>00510                                 CPL_TYPE_BOOL,
-<a name="l00511"></a>00511                                 <span class="stringliteral">"Create intermediate products"</span>,
-<a name="l00512"></a>00512                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,
-<a name="l00513"></a>00513                                 FALSE);
-<a name="l00514"></a>00514     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"check"</span>);
-<a name="l00515"></a>00515     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00516"></a>00516     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00517"></a>00517 
-<a name="l00518"></a>00518     <span class="keywordflow">return</span> 0;
-<a name="l00519"></a>00519 }
-<a name="l00520"></a>00520 
-<a name="l00521"></a>00521 
-<a name="l00530"></a>00530 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_exec(cpl_plugin *plugin)
-<a name="l00531"></a>00531 {
-<a name="l00532"></a>00532     cpl_recipe *recipe;
-<a name="l00533"></a>00533     
-<a name="l00534"></a>00534     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00535"></a>00535         recipe = (cpl_recipe *)plugin;
-<a name="l00536"></a>00536     <span class="keywordflow">else</span> 
-<a name="l00537"></a>00537         <span class="keywordflow">return</span> -1;
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539     <span class="keywordflow">return</span> fors_pmos_calib(recipe->parameters, recipe->frames);
-<a name="l00540"></a>00540 }
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542 
-<a name="l00551"></a>00551 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_destroy(cpl_plugin *plugin)
-<a name="l00552"></a>00552 {
-<a name="l00553"></a>00553     cpl_recipe *recipe;
-<a name="l00554"></a>00554     
-<a name="l00555"></a>00555     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00556"></a>00556         recipe = (cpl_recipe *)plugin;
-<a name="l00557"></a>00557     <span class="keywordflow">else</span> 
-<a name="l00558"></a>00558         <span class="keywordflow">return</span> -1;
-<a name="l00559"></a>00559 
-<a name="l00560"></a>00560     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00561"></a>00561 
-<a name="l00562"></a>00562     <span class="keywordflow">return</span> 0;
-<a name="l00563"></a>00563 }
-<a name="l00564"></a>00564 
-<a name="l00565"></a>00565 
-<a name="l00575"></a>00575 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00576"></a>00576 {
-<a name="l00577"></a>00577 
-<a name="l00578"></a>00578     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_pmos_calib"</span>;
-<a name="l00579"></a>00579 
-<a name="l00580"></a>00580 
-<a name="l00581"></a>00581     <span class="comment">/*</span>
-<a name="l00582"></a>00582 <span class="comment">     * Input parameters</span>
-<a name="l00583"></a>00583 <span class="comment">     */</span>
-<a name="l00584"></a>00584 
-<a name="l00585"></a>00585     <span class="keywordtype">double</span>      dispersion;
-<a name="l00586"></a>00586     <span class="keywordtype">double</span>      peakdetection;
-<a name="l00587"></a>00587     <span class="keywordtype">int</span>         wdegree;
-<a name="l00588"></a>00588     <span class="keywordtype">int</span>         wradius;
-<a name="l00589"></a>00589     <span class="keywordtype">double</span>      wreject;
-<a name="l00590"></a>00590     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00591"></a>00591     <span class="keywordtype">int</span>         cdegree;
-<a name="l00592"></a>00592     <span class="keywordtype">int</span>         cmode;
-<a name="l00593"></a>00593     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00594"></a>00594     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00595"></a>00595     <span class="keywordtype">int</span>         ddegree;
-<a name="l00596"></a>00596     <span class="keywordtype">int</span>         dradius;
-<a name="l00597"></a>00597     <span class="keywordtype">int</span>         qc;
-<a name="l00598"></a>00598     <span class="keywordtype">int</span>         check;
-<a name="l00599"></a>00599     <span class="keyword">const</span> <span class="keywordtype">char</span> *stack_method;
-<a name="l00600"></a>00600     <span class="keywordtype">int</span>         min_reject;
-<a name="l00601"></a>00601     <span class="keywordtype">int</span>         max_reject;
-<a name="l00602"></a>00602     <span class="keywordtype">double</span>      klow;
-<a name="l00603"></a>00603     <span class="keywordtype">double</span>      khigh;
-<a name="l00604"></a>00604     <span class="keywordtype">int</span>         kiter;
-<a name="l00605"></a>00605 
-<a name="l00606"></a>00606 
-<a name="l00607"></a>00607     <span class="comment">/*</span>
-<a name="l00608"></a>00608 <span class="comment">     * CPL objects</span>
-<a name="l00609"></a>00609 <span class="comment">     */</span>
-<a name="l00610"></a>00610 
-<a name="l00611"></a>00611     cpl_imagelist    *biases       = NULL;
-<a name="l00612"></a>00612     cpl_image        *bias         = NULL;
-<a name="l00613"></a>00613     cpl_image        *master_bias  = NULL;
-<a name="l00614"></a>00614     cpl_image        *multi_bias   = NULL;
-<a name="l00615"></a>00615     cpl_image        *flat         = NULL;
-<a name="l00616"></a>00616     cpl_image        *master_flat  = NULL;
-<a name="l00617"></a>00617     cpl_image        *added_flat   = NULL;
-<a name="l00618"></a>00618     cpl_image        *trace_flat   = NULL;
-<a name="l00619"></a>00619     cpl_image        *smo_flat     = NULL;
-<a name="l00620"></a>00620     cpl_image        *norm_flat    = NULL;
-<a name="l00621"></a>00621     cpl_image        *spectra      = NULL;
-<a name="l00622"></a>00622     cpl_image        *wavemap      = NULL;
-<a name="l00623"></a>00623     cpl_image        *delta        = NULL;
-<a name="l00624"></a>00624     cpl_image        *residual     = NULL;
-<a name="l00625"></a>00625     cpl_image        *checkwave    = NULL;
-<a name="l00626"></a>00626     cpl_image        *rectified    = NULL;
-<a name="l00627"></a>00627     cpl_image        *dummy        = NULL;
-<a name="l00628"></a>00628     cpl_image        *add_dummy    = NULL;
-<a name="l00629"></a>00629     cpl_image        *refimage     = NULL;
-<a name="l00630"></a>00630     cpl_image        *coordinate   = NULL;
-<a name="l00631"></a>00631     cpl_image        *rainbow      = NULL;
-<a name="l00632"></a>00632     cpl_image        *spatial      = NULL;
-<a name="l00633"></a>00633     cpl_image        *rect_flat    = NULL;
-<a name="l00634"></a>00634     cpl_image        *rect_nflat   = NULL;
-<a name="l00635"></a>00635     cpl_image        *mapped_flat  = NULL;
-<a name="l00636"></a>00636     cpl_image        *mapped_nflat = NULL;
-<a name="l00637"></a>00637 
-<a name="l00638"></a>00638     cpl_mask         *refmask      = NULL;
-<a name="l00639"></a>00639 
-<a name="l00640"></a>00640     cpl_table        *grism_table  = NULL;
-<a name="l00641"></a>00641     cpl_table        *overscans    = NULL;
-<a name="l00642"></a>00642     cpl_table        *wavelengths  = NULL;
-<a name="l00643"></a>00643     cpl_table        *idscoeff     = NULL;
-<a name="l00644"></a>00644     cpl_table        *idscoeff_all = NULL;
-<a name="l00645"></a>00645     cpl_table        *restable     = NULL;
-<a name="l00646"></a>00646     cpl_table        *slits        = NULL;
-<a name="l00647"></a>00647     cpl_table        *positions    = NULL;
-<a name="l00648"></a>00648     cpl_table        *maskslits    = NULL;
-<a name="l00649"></a>00649     cpl_table        *traces       = NULL;
-<a name="l00650"></a>00650     cpl_table        *polytraces   = NULL;
-<a name="l00651"></a>00651     cpl_table        *restab       = NULL;
-<a name="l00652"></a>00652     cpl_table        *global       = NULL;
-<a name="l00653"></a>00653 
-<a name="l00654"></a>00654     cpl_vector       *lines        = NULL;
-<a name="l00655"></a>00655 
-<a name="l00656"></a>00656     cpl_propertylist *header_dist  = NULL;
-<a name="l00657"></a>00657     cpl_propertylist *header       = NULL;
-<a name="l00658"></a>00658     cpl_propertylist *save_header  = NULL;
-<a name="l00659"></a>00659     cpl_propertylist *qclist       = NULL;
-<a name="l00660"></a>00660 
-<a name="l00661"></a>00661     <span class="comment">/*</span>
-<a name="l00662"></a>00662 <span class="comment">     * Auxiliary variables</span>
-<a name="l00663"></a>00663 <span class="comment">     */</span>
-<a name="l00664"></a>00664 
-<a name="l00665"></a>00665     <span class="keywordtype">char</span>    version[80];
-<a name="l00666"></a>00666     <span class="keyword">const</span> <span class="keywordtype">char</span>   *arc_tag;
-<a name="l00667"></a>00667     <span class="keyword">const</span> <span class="keywordtype">char</span>   *flat_tag;
-<a name="l00668"></a>00668     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_screen_flat_tag;
-<a name="l00669"></a>00669     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_norm_flat_tag;
-<a name="l00670"></a>00670     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_lamp_tag;
-<a name="l00671"></a>00671     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_residuals_tag;
-<a name="l00672"></a>00672     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_coeff_tag;
-<a name="l00673"></a>00673     <span class="keyword">const</span> <span class="keywordtype">char</span>   *wavelength_map_tag;
-<a name="l00674"></a>00674     <span class="keyword">const</span> <span class="keywordtype">char</span>   *spectra_detection_tag;
-<a name="l00675"></a>00675     <span class="keyword">const</span> <span class="keywordtype">char</span>   *spectral_resolution_tag;
-<a name="l00676"></a>00676     <span class="keyword">const</span> <span class="keywordtype">char</span>   *slit_map_tag;
-<a name="l00677"></a>00677     <span class="keyword">const</span> <span class="keywordtype">char</span>   *curv_traces_tag;
-<a name="l00678"></a>00678     <span class="keyword">const</span> <span class="keywordtype">char</span>   *curv_coeff_tag;
-<a name="l00679"></a>00679     <span class="keyword">const</span> <span class="keywordtype">char</span>   *spatial_map_tag;
-<a name="l00680"></a>00680     <span class="keyword">const</span> <span class="keywordtype">char</span>   *slit_location_tag;
-<a name="l00681"></a>00681     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_distortion_tag = <span class="stringliteral">"MASTER_DISTORTION_TABLE"</span>;
-<a name="l00682"></a>00682     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_residuals_table_tag;
-<a name="l00683"></a>00683     <span class="keyword">const</span> <span class="keywordtype">char</span>   *delta_image_tag;
-<a name="l00684"></a>00684     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_screen_flat_tag;
-<a name="l00685"></a>00685     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_norm_flat_tag;
-<a name="l00686"></a>00686     <span class="keyword">const</span> <span class="keywordtype">char</span>   *keyname;
-<a name="l00687"></a>00687     <span class="keywordtype">int</span>     pmos;
-<a name="l00688"></a>00688     <span class="keywordtype">int</span>     same_offset = 0;
-<a name="l00689"></a>00689     <span class="keywordtype">int</span>     nslits;
-<a name="l00690"></a>00690     <span class="keywordtype">float</span>  *data;
-<a name="l00691"></a>00691     <span class="keywordtype">double</span> *xpos;
-<a name="l00692"></a>00692     <span class="keywordtype">double</span>  mxpos;
-<a name="l00693"></a>00693     <span class="keywordtype">double</span>  mean_rms;
-<a name="l00694"></a>00694     <span class="keywordtype">double</span>  mean_rms_err;
-<a name="l00695"></a>00695     <span class="keywordtype">double</span>  alltime;
-<a name="l00696"></a>00696     <span class="keywordtype">int</span>     nflats;
-<a name="l00697"></a>00697     <span class="keywordtype">int</span>     nbias;
-<a name="l00698"></a>00698     <span class="keywordtype">int</span>     nlines;
-<a name="l00699"></a>00699     <span class="keywordtype">int</span>     rebin, rebin_dist;
-<a name="l00700"></a>00700     <span class="keywordtype">double</span> *line;
-<a name="l00701"></a>00701     <span class="keywordtype">double</span> *fiterror = NULL;
-<a name="l00702"></a>00702     <span class="keywordtype">int</span>    *fitlines = NULL;
-<a name="l00703"></a>00703     <span class="keywordtype">int</span>     nx, ny;
-<a name="l00704"></a>00704     <span class="keywordtype">double</span>  reference;
-<a name="l00705"></a>00705     <span class="keywordtype">double</span>  gain;
-<a name="l00706"></a>00706     <span class="keywordtype">int</span>     ccd_xsize, ccd_ysize;
-<a name="l00707"></a>00707     <span class="keywordtype">int</span>     i, j;
-<a name="l00708"></a>00708 
-<a name="l00709"></a>00709     <span class="keywordtype">char</span>   *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00710"></a>00710 
-<a name="l00711"></a>00711     <span class="comment">/*</span>
-<a name="l00712"></a>00712 <span class="comment">     * Variables just related to bagoo</span>
-<a name="l00713"></a>00713 <span class="comment">     */</span>
-<a name="l00714"></a>00714 
-<a name="l00715"></a>00715     <span class="keywordtype">int</span>     bagoo = 0;
-<a name="l00716"></a>00716     <span class="keywordtype">int</span>     doit = 0;
-<a name="l00717"></a>00717     <span class="keywordtype">double</span>  blevel = 0.0;
-<a name="l00718"></a>00718     <span class="keywordtype">double</span>  <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a> = 0.0;
-<a name="l00719"></a>00719 
-<a name="l00720"></a>00720     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00721"></a>00721 
-<a name="l00722"></a>00722     cpl_msg_set_indentation(2);
-<a name="l00723"></a>00723 
-<a name="l00724"></a>00724     <a class="code" href="group__forsdfs.html#g37d74636b6c3f3d52b0312ce3a58e59d">fors_dfs_set_groups</a>(frameset);
-<a name="l00725"></a>00725 
-<a name="l00726"></a>00726     <span class="comment">/* </span>
-<a name="l00727"></a>00727 <span class="comment">     * Get configuration parameters</span>
-<a name="l00728"></a>00728 <span class="comment">     */</span>
-<a name="l00729"></a>00729 
-<a name="l00730"></a>00730     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00731"></a>00731     cpl_msg_indent_more();
-<a name="l00732"></a>00732 
-<a name="l00733"></a>00733     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00734"></a>00734         fors_pmos_calib_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);
-<a name="l00735"></a>00735 
-<a name="l00736"></a>00736     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00737"></a>00737 
-<a name="l00738"></a>00738     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00739"></a>00739                     <span class="stringliteral">"fors.fors_pmos_calib.dispersion"</span>, grism_table);
-<a name="l00740"></a>00740 
-<a name="l00741"></a>00741     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00742"></a>00742         fors_pmos_calib_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00743"></a>00743 
-<a name="l00744"></a>00744     peakdetection = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00745"></a>00745                     <span class="stringliteral">"fors.fors_pmos_calib.peakdetection"</span>, grism_table);
-<a name="l00746"></a>00746     <span class="keywordflow">if</span> (peakdetection <= 0.0)
-<a name="l00747"></a>00747         fors_pmos_calib_exit(<span class="stringliteral">"Invalid peak detection level"</span>);
-<a name="l00748"></a>00748 
-<a name="l00749"></a>00749     wdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00750"></a>00750                     <span class="stringliteral">"fors.fors_pmos_calib.wdegree"</span>, grism_table);
-<a name="l00751"></a>00751 
-<a name="l00752"></a>00752     <span class="keywordflow">if</span> (wdegree < 1)
-<a name="l00753"></a>00753         fors_pmos_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00754"></a>00754 
-<a name="l00755"></a>00755     <span class="keywordflow">if</span> (wdegree > 5)
-<a name="l00756"></a>00756         fors_pmos_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00757"></a>00757 
-<a name="l00758"></a>00758     wradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00759"></a>00759                                     <span class="stringliteral">"fors.fors_pmos_calib.wradius"</span>, NULL);
-<a name="l00760"></a>00760 
-<a name="l00761"></a>00761     <span class="keywordflow">if</span> (wradius < 0)
-<a name="l00762"></a>00762         fors_pmos_calib_exit(<span class="stringliteral">"Invalid search radius"</span>);
-<a name="l00763"></a>00763 
-<a name="l00764"></a>00764     wreject = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00765"></a>00765                                        <span class="stringliteral">"fors.fors_pmos_calib.wreject"</span>, NULL);
-<a name="l00766"></a>00766 
-<a name="l00767"></a>00767     <span class="keywordflow">if</span> (wreject <= 0.0)
-<a name="l00768"></a>00768         fors_pmos_calib_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);
-<a name="l00769"></a>00769 
-<a name="l00770"></a>00770     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00771"></a>00771                                        <span class="stringliteral">"fors.fors_pmos_calib.wcolumn"</span>, NULL);
-<a name="l00772"></a>00772 
-<a name="l00773"></a>00773     cdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00774"></a>00774                     <span class="stringliteral">"fors.fors_pmos_calib.cdegree"</span>, grism_table);
-<a name="l00775"></a>00775 
-<a name="l00776"></a>00776     <span class="keywordflow">if</span> (cdegree < 1)
-<a name="l00777"></a>00777         fors_pmos_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00778"></a>00778 
-<a name="l00779"></a>00779     <span class="keywordflow">if</span> (cdegree > 5)
-<a name="l00780"></a>00780         fors_pmos_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782     cmode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_pmos_calib.cmode"</span>, NULL);
-<a name="l00783"></a>00783 
-<a name="l00784"></a>00784     <span class="keywordflow">if</span> (cmode < 0 || cmode > 2)
-<a name="l00785"></a>00785         fors_pmos_calib_exit(<span class="stringliteral">"Invalid curvature solution interpolation mode"</span>);
-<a name="l00786"></a>00786 
-<a name="l00787"></a>00787     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00788"></a>00788                     <span class="stringliteral">"fors.fors_pmos_calib.startwavelength"</span>, grism_table);
-<a name="l00789"></a>00789     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00790"></a>00790         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00791"></a>00791             fors_pmos_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00792"></a>00792 
-<a name="l00793"></a>00793     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00794"></a>00794                     <span class="stringliteral">"fors.fors_pmos_calib.endwavelength"</span>, grism_table);
-<a name="l00795"></a>00795     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00796"></a>00796         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00797"></a>00797             fors_pmos_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00798"></a>00798         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00799"></a>00799             fors_pmos_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00800"></a>00800     }
-<a name="l00801"></a>00801 
-<a name="l00802"></a>00802     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00803"></a>00803         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00804"></a>00804             fors_pmos_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00805"></a>00805 
-<a name="l00806"></a>00806     stack_method = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist,
-<a name="l00807"></a>00807                                             <span class="stringliteral">"fors.fors_pmos_calib.stack_method"</span>,
-<a name="l00808"></a>00808                                             NULL);
-<a name="l00809"></a>00809 
-<a name="l00810"></a>00810     <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"minmax"</span>) == 0) {
-<a name="l00811"></a>00811         min_reject = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00812"></a>00812                                    <span class="stringliteral">"fors.fors_pmos_calib.minrejection"</span>, NULL);
-<a name="l00813"></a>00813         <span class="keywordflow">if</span> (min_reject < 0)
-<a name="l00814"></a>00814             fors_pmos_calib_exit(<span class="stringliteral">"Invalid number of lower rejections"</span>);
-<a name="l00815"></a>00815 
-<a name="l00816"></a>00816         max_reject = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00817"></a>00817                                    <span class="stringliteral">"fors.fors_pmos_calib.maxrejection"</span>, NULL);
-<a name="l00818"></a>00818         <span class="keywordflow">if</span> (max_reject < 0)
-<a name="l00819"></a>00819             fors_pmos_calib_exit(<span class="stringliteral">"Invalid number of upper rejections"</span>);
-<a name="l00820"></a>00820     }
-<a name="l00821"></a>00821 
-<a name="l00822"></a>00822     <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"ksigma"</span>) == 0) {
-<a name="l00823"></a>00823         klow  = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00824"></a>00824                                          <span class="stringliteral">"fors.fors_pmos_calib.klow"</span>, NULL);
-<a name="l00825"></a>00825         <span class="keywordflow">if</span> (klow < 0.1)
-<a name="l00826"></a>00826             fors_pmos_calib_exit(<span class="stringliteral">"Invalid lower K-sigma"</span>);
-<a name="l00827"></a>00827 
-<a name="l00828"></a>00828         khigh = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00829"></a>00829                                          <span class="stringliteral">"fors.fors_pmos_calib.khigh"</span>, NULL);
-<a name="l00830"></a>00830         <span class="keywordflow">if</span> (khigh < 0.1)
-<a name="l00831"></a>00831             fors_pmos_calib_exit(<span class="stringliteral">"Invalid lower K-sigma"</span>);
-<a name="l00832"></a>00832 
-<a name="l00833"></a>00833         kiter = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00834"></a>00834                                       <span class="stringliteral">"fors.fors_pmos_calib.kiter"</span>, NULL);
-<a name="l00835"></a>00835         <span class="keywordflow">if</span> (kiter < 1)
-<a name="l00836"></a>00836             fors_pmos_calib_exit(<span class="stringliteral">"Invalid number of iterations"</span>);
-<a name="l00837"></a>00837     }
-<a name="l00838"></a>00838 
-<a name="l00839"></a>00839     ddegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00840"></a>00840                                     <span class="stringliteral">"fors.fors_pmos_calib.ddegree"</span>, NULL);
-<a name="l00841"></a>00841     dradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00842"></a>00842                                     <span class="stringliteral">"fors.fors_pmos_calib.dradius"</span>, NULL);
-<a name="l00843"></a>00843 
-<a name="l00844"></a>00844     <span class="keywordflow">if</span> (dradius < 1)
-<a name="l00845"></a>00845         fors_pmos_calib_exit(<span class="stringliteral">"Invalid smoothing box radius"</span>);
-<a name="l00846"></a>00846 
-<a name="l00847"></a>00847     qc = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_calib.qc"</span>, NULL);
-<a name="l00848"></a>00848 
-<a name="l00849"></a>00849     check = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_calib.check"</span>, NULL);
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00852"></a>00852 
-<a name="l00853"></a>00853     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00854"></a>00854         fors_pmos_calib_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00855"></a>00855 
-<a name="l00856"></a>00856 
-<a name="l00857"></a>00857     <span class="comment">/* </span>
-<a name="l00858"></a>00858 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00859"></a>00859 <span class="comment">     */</span>
-<a name="l00860"></a>00860 
-<a name="l00861"></a>00861     cpl_msg_indent_less();
-<a name="l00862"></a>00862     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00863"></a>00863     cpl_msg_indent_more();
-<a name="l00864"></a>00864 
-<a name="l00865"></a>00865     {
-<a name="l00866"></a>00866         cpl_frameset *subframeset = cpl_frameset_duplicate(frameset);
-<a name="l00867"></a>00867         cpl_frameset_erase(subframeset, <span class="stringliteral">"BIAS"</span>);
-<a name="l00868"></a>00868         cpl_frameset_erase(subframeset, <span class="stringliteral">"MASTER_BIAS"</span>);
-<a name="l00869"></a>00869 
-<a name="l00870"></a>00870         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>)) 
-<a name="l00871"></a>00871             fors_pmos_calib_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00872"></a>00872     
-<a name="l00873"></a>00873         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO INS FILT1 ID"</span>)) 
-<a name="l00874"></a>00874             fors_pmos_calib_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00875"></a>00875     
-<a name="l00876"></a>00876         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>)) 
-<a name="l00877"></a>00877             fors_pmos_calib_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00878"></a>00878 
-<a name="l00879"></a>00879         cpl_frameset_delete(subframeset);
-<a name="l00880"></a>00880     }
-<a name="l00881"></a>00881 
-<a name="l00882"></a>00882     pmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_PMOS"</span>);
-<a name="l00883"></a>00883 
-<a name="l00884"></a>00884     <span class="keywordflow">if</span> (pmos == 0)
-<a name="l00885"></a>00885         fors_pmos_calib_exit(<span class="stringliteral">"Missing input arc lamp frame"</span>);
-<a name="l00886"></a>00886 
-<a name="l00887"></a>00887     <span class="keywordflow">if</span> (pmos) {
-<a name="l00888"></a>00888         cpl_msg_info(recipe, <span class="stringliteral">"PMOS data found"</span>);
-<a name="l00889"></a>00889         arc_tag                  = <span class="stringliteral">"LAMP_PMOS"</span>;
-<a name="l00890"></a>00890         flat_tag                 = <span class="stringliteral">"SCREEN_FLAT_PMOS"</span>;
-<a name="l00891"></a>00891         master_screen_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_PMOS"</span>;
-<a name="l00892"></a>00892         master_norm_flat_tag     = <span class="stringliteral">"MASTER_NORM_FLAT_PMOS"</span>;
-<a name="l00893"></a>00893         reduced_lamp_tag         = <span class="stringliteral">"REDUCED_LAMP_PMOS"</span>;
-<a name="l00894"></a>00894         disp_residuals_tag       = <span class="stringliteral">"DISP_RESIDUALS_PMOS"</span>;
-<a name="l00895"></a>00895         disp_coeff_tag           = <span class="stringliteral">"DISP_COEFF_PMOS"</span>;
-<a name="l00896"></a>00896         wavelength_map_tag       = <span class="stringliteral">"WAVELENGTH_MAP_PMOS"</span>;
-<a name="l00897"></a>00897         spectra_detection_tag    = <span class="stringliteral">"SPECTRA_DETECTION_PMOS"</span>;
-<a name="l00898"></a>00898         spectral_resolution_tag  = <span class="stringliteral">"SPECTRAL_RESOLUTION_PMOS"</span>;
-<a name="l00899"></a>00899         slit_map_tag             = <span class="stringliteral">"SLIT_MAP_PMOS"</span>;
-<a name="l00900"></a>00900         curv_traces_tag          = <span class="stringliteral">"CURV_TRACES_PMOS"</span>;
-<a name="l00901"></a>00901         curv_coeff_tag           = <span class="stringliteral">"CURV_COEFF_PMOS"</span>;
-<a name="l00902"></a>00902         spatial_map_tag          = <span class="stringliteral">"SPATIAL_MAP_PMOS"</span>;
-<a name="l00903"></a>00903         slit_location_tag        = <span class="stringliteral">"SLIT_LOCATION_PMOS"</span>;
-<a name="l00904"></a>00904         disp_residuals_table_tag = <span class="stringliteral">"DISP_RESIDUALS_TABLE_PMOS"</span>;
-<a name="l00905"></a>00905         delta_image_tag          = <span class="stringliteral">"DELTA_IMAGE_PMOS"</span>;
-<a name="l00906"></a>00906         mapped_screen_flat_tag   = <span class="stringliteral">"MAPPED_SCREEN_FLAT_PMOS"</span>;
-<a name="l00907"></a>00907         mapped_norm_flat_tag     = <span class="stringliteral">"MAPPED_NORM_FLAT_PMOS"</span>;
-<a name="l00908"></a>00908     }
-<a name="l00909"></a>00909 
-<a name="l00910"></a>00910     nbias = 0;
-<a name="l00911"></a>00911     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0) {
-<a name="l00912"></a>00912         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"BIAS"</span>) == 0)
-<a name="l00913"></a>00913             fors_pmos_calib_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS or BIAS"</span>);
-<a name="l00914"></a>00914         nbias = cpl_frameset_count_tags(frameset, <span class="stringliteral">"BIAS"</span>);
-<a name="l00915"></a>00915     }
-<a name="l00916"></a>00916 
-<a name="l00917"></a>00917     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)
-<a name="l00918"></a>00918         fors_pmos_calib_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);
-<a name="l00919"></a>00919 
-<a name="l00920"></a>00920     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)
-<a name="l00921"></a>00921         fors_pmos_calib_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);
-<a name="l00922"></a>00922 
-<a name="l00923"></a>00923     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)
-<a name="l00924"></a>00924         fors_pmos_calib_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);
-<a name="l00925"></a>00925 
-<a name="l00926"></a>00926     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)
-<a name="l00927"></a>00927         fors_pmos_calib_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);
-<a name="l00928"></a>00928 
-<a name="l00929"></a>00929     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)
-<a name="l00930"></a>00930         fors_pmos_calib_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);
-<a name="l00931"></a>00931 
-<a name="l00932"></a>00932 <span class="comment">/*</span>
-<a name="l00933"></a>00933 <span class="comment">    if (cpl_frameset_count_tags(frameset, master_distortion_tag) == 0)</span>
-<a name="l00934"></a>00934 <span class="comment">        fors_pmos_calib_exit("Missing required input: MASTER_DISTORTION_TABLE");</span>
-<a name="l00935"></a>00935 <span class="comment">*/</span>
-<a name="l00936"></a>00936 
-<a name="l00937"></a>00937     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_distortion_tag) > 1)
-<a name="l00938"></a>00938         fors_pmos_calib_exit(<span class="stringliteral">"Too many in input: MASTER_DISTORTION_TABLE"</span>);
-<a name="l00939"></a>00939 
-<a name="l00940"></a>00940     nflats = cpl_frameset_count_tags(frameset, flat_tag);
-<a name="l00941"></a>00941 
-<a name="l00942"></a>00942     <span class="keywordflow">if</span> (nflats < 1) {
-<a name="l00943"></a>00943         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, flat_tag);
-<a name="l00944"></a>00944         fors_pmos_calib_exit(NULL);
-<a name="l00945"></a>00945     }
-<a name="l00946"></a>00946 
-<a name="l00947"></a>00947     cpl_msg_indent_less();
-<a name="l00948"></a>00948 
-<a name="l00949"></a>00949     <span class="keywordflow">if</span> (nflats > 1)
-<a name="l00950"></a>00950         cpl_msg_info(recipe, <span class="stringliteral">"Load %d flat field frames and stack them "</span>
-<a name="l00951"></a>00951                      <span class="stringliteral">"with method \"%s\""</span>, nflats, stack_method);
-<a name="l00952"></a>00952     <span class="keywordflow">else</span>
-<a name="l00953"></a>00953         cpl_msg_info(recipe, <span class="stringliteral">"Load flat field exposure..."</span>);
-<a name="l00954"></a>00954 
-<a name="l00955"></a>00955     cpl_msg_indent_more();
-<a name="l00956"></a>00956 
-<a name="l00957"></a>00957     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, flat_tag, 0);
-<a name="l00958"></a>00958 
-<a name="l00959"></a>00959     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00960"></a>00960         fors_pmos_calib_exit(<span class="stringliteral">"Cannot load flat field frame header"</span>);
-<a name="l00961"></a>00961 
-<a name="l00962"></a>00962     alltime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l00963"></a>00963 
-<a name="l00964"></a>00964     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00965"></a>00965         fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword EXPTIME in flat field "</span>
-<a name="l00966"></a>00966                              <span class="stringliteral">"frame header"</span>);
-<a name="l00967"></a>00967 
-<a name="l00968"></a>00968     cpl_propertylist_delete(header);
-<a name="l00969"></a>00969 
-<a name="l00970"></a>00970     <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {
-<a name="l00971"></a>00971 
-<a name="l00972"></a>00972         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l00973"></a>00973 
-<a name="l00974"></a>00974         <span class="keywordflow">if</span> (header == NULL)
-<a name="l00975"></a>00975             fors_pmos_calib_exit(<span class="stringliteral">"Cannot load flat field frame header"</span>);
-<a name="l00976"></a>00976 
-<a name="l00977"></a>00977         alltime += cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l00978"></a>00978 
-<a name="l00979"></a>00979         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00980"></a>00980             fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword EXPTIME in flat field "</span>
-<a name="l00981"></a>00981                             <span class="stringliteral">"frame header"</span>);
-<a name="l00982"></a>00982 
-<a name="l00983"></a>00983         cpl_propertylist_delete(header);
-<a name="l00984"></a>00984 
-<a name="l00985"></a>00985     }
-<a name="l00986"></a>00986 
-<a name="l00987"></a>00987     <span class="keywordflow">if</span> (bagoo) {
-<a name="l00988"></a>00988         <span class="keywordtype">char</span> *montecarlo = getenv(<span class="stringliteral">"MONTECARLO"</span>);
-<a name="l00989"></a>00989 
-<a name="l00990"></a>00990         <span class="keywordflow">if</span> (montecarlo)
-<a name="l00991"></a>00991             doit = atoi(montecarlo);
-<a name="l00992"></a>00992 
-<a name="l00993"></a>00993         <span class="keywordflow">if</span> (doit) {
-<a name="l00994"></a>00994             master_bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>,
-<a name="l00995"></a>00995                                      CPL_TYPE_FLOAT, 0, 1);
-<a name="l00996"></a>00996             <span class="keywordflow">if</span> (master_bias == NULL)
-<a name="l00997"></a>00997                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l00998"></a>00998 
-<a name="l00999"></a>00999             blevel = cpl_image_get_mean(master_bias);
-<a name="l01000"></a>01000 
-<a name="l01001"></a>01001             cpl_image_delete(master_bias);
-<a name="l01002"></a>01002         }
-<a name="l01003"></a>01003     }
-<a name="l01004"></a>01004 
-<a name="l01005"></a>01005     master_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, flat_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01006"></a>01006 
-<a name="l01007"></a>01007     <span class="keywordflow">if</span> (master_flat == NULL)
-<a name="l01008"></a>01008         fors_pmos_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);
-<a name="l01009"></a>01009 
-<a name="l01010"></a>01010     <span class="keywordflow">if</span> (doit) {
-<a name="l01011"></a>01011         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, flat_tag, 0);
-<a name="l01012"></a>01012 
-<a name="l01013"></a>01013         gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l01014"></a>01014 
-<a name="l01015"></a>01015         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01016"></a>01016             fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD "</span>
-<a name="l01017"></a>01017                                  <span class="stringliteral">"in flat field frame header"</span>);
-<a name="l01018"></a>01018 
-<a name="l01019"></a>01019         ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);
-<a name="l01020"></a>01020 
-<a name="l01021"></a>01021         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01022"></a>01022             fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON "</span>
-<a name="l01023"></a>01023                                  <span class="stringliteral">"in flat field frame header"</span>);
-<a name="l01024"></a>01024 
-<a name="l01025"></a>01025         cpl_propertylist_delete(header);
-<a name="l01026"></a>01026 
-<a name="l01027"></a>01027         ron /= gain;   <span class="comment">// RON converted from electrons to ADU</span>
-<a name="l01028"></a>01028 
-<a name="l01029"></a>01029         <a class="code" href="group__moses.html#g7557973371ca804e0fab92c40b833f3c">mos_randomise_image</a>(master_flat, ron, gain, blevel);
-<a name="l01030"></a>01030     }
-<a name="l01031"></a>01031 
-<a name="l01032"></a>01032     ny = cpl_image_get_size_y(master_flat);
-<a name="l01033"></a>01033 
-<a name="l01034"></a>01034     <span class="keywordflow">if</span> (nflats > 1) {
-<a name="l01035"></a>01035         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"average"</span>) == 0) {
-<a name="l01036"></a>01036             <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {
-<a name="l01037"></a>01037                 flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01038"></a>01038                 <span class="keywordflow">if</span> (flat) {
-<a name="l01039"></a>01039                     <span class="keywordflow">if</span> (doit) {
-<a name="l01040"></a>01040                         <a class="code" href="group__moses.html#g7557973371ca804e0fab92c40b833f3c">mos_randomise_image</a>(flat, ron, gain, blevel);
-<a name="l01041"></a>01041                     }
-<a name="l01042"></a>01042                     cpl_image_add(master_flat, flat);
-<a name="l01043"></a>01043                     cpl_image_delete(flat); flat = NULL;
-<a name="l01044"></a>01044                 }
-<a name="l01045"></a>01045                 <span class="keywordflow">else</span>
-<a name="l01046"></a>01046                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);
-<a name="l01047"></a>01047             }
-<a name="l01048"></a>01048 
-<a name="l01049"></a>01049         <span class="comment">/***</span>
-<a name="l01050"></a>01050 <span class="comment">            if (nflats > 1)</span>
-<a name="l01051"></a>01051 <span class="comment">                cpl_image_divide_scalar(master_flat, nflats);</span>
-<a name="l01052"></a>01052 <span class="comment">        ***/</span>
-<a name="l01053"></a>01053 
-<a name="l01054"></a>01054         }
-<a name="l01055"></a>01055         <span class="keywordflow">else</span> {
-<a name="l01056"></a>01056             cpl_imagelist *flatlist = NULL;
-<a name="l01057"></a>01057             <span class="keywordtype">double</span> rflux, flux;
-<a name="l01058"></a>01058 
-<a name="l01059"></a>01059             added_flat = cpl_image_duplicate(master_flat);
-<a name="l01060"></a>01060 
-<a name="l01061"></a>01061             flatlist = cpl_imagelist_new();
-<a name="l01062"></a>01062             cpl_imagelist_set(flatlist, master_flat, 
-<a name="l01063"></a>01063                               cpl_imagelist_get_size(flatlist));
-<a name="l01064"></a>01064 
-<a name="l01065"></a>01065             <span class="comment">/*</span>
-<a name="l01066"></a>01066 <span class="comment">             * Stacking with rejection requires normalization</span>
-<a name="l01067"></a>01067 <span class="comment">             * at the same flux. We normalise according to mean</span>
-<a name="l01068"></a>01068 <span class="comment">             * flux. This is equivalent to determining the</span>
-<a name="l01069"></a>01069 <span class="comment">             * flux ratio for each image as the average of the</span>
-<a name="l01070"></a>01070 <span class="comment">             * flux ratio of all pixels weighted on the actual</span>
-<a name="l01071"></a>01071 <span class="comment">             * flux of each pixel.</span>
-<a name="l01072"></a>01072 <span class="comment">             */</span>
-<a name="l01073"></a>01073 
-<a name="l01074"></a>01074             rflux = cpl_image_get_mean(master_flat);
-<a name="l01075"></a>01075 
-<a name="l01076"></a>01076             <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {
-<a name="l01077"></a>01077                 flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01078"></a>01078                 <span class="keywordflow">if</span> (flat) {
-<a name="l01079"></a>01079                     <span class="keywordflow">if</span> (doit) {
-<a name="l01080"></a>01080                         <a class="code" href="group__moses.html#g7557973371ca804e0fab92c40b833f3c">mos_randomise_image</a>(flat, ron, gain, blevel);
-<a name="l01081"></a>01081                     }
-<a name="l01082"></a>01082                     cpl_image_add(added_flat, flat);
-<a name="l01083"></a>01083                     flux = cpl_image_get_mean(flat);
-<a name="l01084"></a>01084                     cpl_image_multiply_scalar(flat, rflux / flux);
-<a name="l01085"></a>01085                     cpl_imagelist_set(flatlist, flat, 
-<a name="l01086"></a>01086                                       cpl_imagelist_get_size(flatlist));
-<a name="l01087"></a>01087                 }
-<a name="l01088"></a>01088                 <span class="keywordflow">else</span> {
-<a name="l01089"></a>01089                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);
-<a name="l01090"></a>01090                 }
-<a name="l01091"></a>01091             }
-<a name="l01092"></a>01092             
-<a name="l01093"></a>01093             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"median"</span>) == 0) {
-<a name="l01094"></a>01094                 master_flat = cpl_imagelist_collapse_median_create(flatlist);
-<a name="l01095"></a>01095             }
-<a name="l01096"></a>01096 
-<a name="l01097"></a>01097             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"minmax"</span>) == 0) {
-<a name="l01098"></a>01098                 master_flat = cpl_imagelist_collapse_minmax_create(flatlist, 
-<a name="l01099"></a>01099                                                                    min_reject,
-<a name="l01100"></a>01100                                                                    max_reject);
-<a name="l01101"></a>01101             }
-<a name="l01102"></a>01102 
-<a name="l01103"></a>01103             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"ksigma"</span>) == 0) {
-<a name="l01104"></a>01104                 master_flat = <a class="code" href="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660">mos_ksigma_stack</a>(flatlist, 
-<a name="l01105"></a>01105                                                klow, khigh, kiter, NULL);
-<a name="l01106"></a>01106             }
-<a name="l01107"></a>01107         }
-<a name="l01108"></a>01108     }
-<a name="l01109"></a>01109 
-<a name="l01110"></a>01110 
-<a name="l01111"></a>01111     <span class="comment">/*</span>
-<a name="l01112"></a>01112 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l01113"></a>01113 <span class="comment">     * dispersion direction from the arc lamp exposure</span>
-<a name="l01114"></a>01114 <span class="comment">     */</span>
-<a name="l01115"></a>01115 
-<a name="l01116"></a>01116     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01117"></a>01117 
-<a name="l01118"></a>01118     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01119"></a>01119         fors_pmos_calib_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);
-<a name="l01120"></a>01120 
-<a name="l01121"></a>01121     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l01122"></a>01122     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l01123"></a>01123         fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);
-<a name="l01124"></a>01124 
-<a name="l01125"></a>01125     instrume = cpl_strdup(instrume);
-<a name="l01126"></a>01126 
-<a name="l01127"></a>01127     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l01128"></a>01128         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l01129"></a>01129     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l01130"></a>01130         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l01131"></a>01131 
-<a name="l01132"></a>01132     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l01133"></a>01133 
-<a name="l01134"></a>01134     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01135"></a>01135         fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in arc lamp "</span>
-<a name="l01136"></a>01136                         <span class="stringliteral">"frame header"</span>);
-<a name="l01137"></a>01137 
-<a name="l01138"></a>01138     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l01139"></a>01139         reference *= 10;
-<a name="l01140"></a>01140 
-<a name="l01141"></a>01141     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l01142"></a>01142         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l01143"></a>01143                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in arc lamp frame header"</span>,
-<a name="l01144"></a>01144                       reference);
-<a name="l01145"></a>01145         fors_pmos_calib_exit(NULL);
-<a name="l01146"></a>01146     }
-<a name="l01147"></a>01147 
-<a name="l01148"></a>01148     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l01149"></a>01149 
-<a name="l01150"></a>01150     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l01151"></a>01151 
-<a name="l01152"></a>01152     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01153"></a>01153         fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in arc lamp "</span>
-<a name="l01154"></a>01154                         <span class="stringliteral">"frame header"</span>);
-<a name="l01155"></a>01155 
-<a name="l01156"></a>01156     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l01157"></a>01157         dispersion *= rebin;
-<a name="l01158"></a>01158         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l01159"></a>01159                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin, 
-<a name="l01160"></a>01160                         dispersion);
-<a name="l01161"></a>01161     }
-<a name="l01162"></a>01162 
-<a name="l01163"></a>01163     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l01164"></a>01164 
-<a name="l01165"></a>01165     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01166"></a>01166         fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in arc lamp "</span>
-<a name="l01167"></a>01167                         <span class="stringliteral">"frame header"</span>);
-<a name="l01168"></a>01168 
-<a name="l01169"></a>01169     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l01170"></a>01170 
-<a name="l01171"></a>01171     <span class="keywordflow">if</span> (pmos) {
-<a name="l01172"></a>01172         <span class="keywordtype">int</span> nslits_out_det;
-<a name="l01173"></a>01173         cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);
-<a name="l01174"></a>01174 
-<a name="l01175"></a>01175         maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l01176"></a>01176 
-<a name="l01177"></a>01177         <span class="comment">/*</span>
-<a name="l01178"></a>01178 <span class="comment">         * Check if all slits have the same X offset: in such case, </span>
-<a name="l01179"></a>01179 <span class="comment">         * treat the observation as a long-slit one!</span>
-<a name="l01180"></a>01180 <span class="comment">         */</span>
-<a name="l01181"></a>01181 
-<a name="l01182"></a>01182         mxpos = cpl_table_get_column_median(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l01183"></a>01183         xpos = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l01184"></a>01184         nslits = cpl_table_get_nrow(maskslits);
-<a name="l01185"></a>01185 
-<a name="l01186"></a>01186         same_offset = 1;
-<a name="l01187"></a>01187         <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l01188"></a>01188             <span class="keywordflow">if</span> (fabs(mxpos-xpos[i]) > 0.01) {
-<a name="l01189"></a>01189                 same_offset = 0;
-<a name="l01190"></a>01190                 <span class="keywordflow">break</span>;
-<a name="l01191"></a>01191             }
-<a name="l01192"></a>01192         }
-<a name="l01193"></a>01193         <span class="comment">//If not all the slits are illuminated, then we cannot say that</span>
-<a name="l01194"></a>01194         <span class="comment">//all have the same offsets.</span>
-<a name="l01195"></a>01195         <span class="keywordflow">if</span>(nslits_out_det != 0)
-<a name="l01196"></a>01196             same_offset = 0;
-<a name="l01197"></a>01197 
-<a name="l01198"></a>01198         <span class="keywordflow">if</span> (same_offset) {
-<a name="l01199"></a>01199             cpl_msg_info(recipe, <span class="stringliteral">"All slits have same offset: %.2f"</span>, mxpos);
-<a name="l01200"></a>01200         }
-<a name="l01201"></a>01201         <span class="keywordflow">else</span> {
-<a name="l01202"></a>01202             cpl_msg_info(recipe, <span class="stringliteral">"All slits have different offsets"</span>);
-<a name="l01203"></a>01203         }
-<a name="l01204"></a>01204 
-<a name="l01205"></a>01205         <span class="keywordflow">if</span> (ny != 400 && ny != 500) {
-<a name="l01206"></a>01206             <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, 
-<a name="l01207"></a>01207                                         master_distortion_tag) == 0)
-<a name="l01208"></a>01208                 fors_pmos_calib_exit(
-<a name="l01209"></a>01209                 <span class="stringliteral">"Missing required input: MASTER_DISTORTION_TABLE"</span>);
-<a name="l01210"></a>01210 
-<a name="l01211"></a>01211             header_dist = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, 
-<a name="l01212"></a>01212                                           master_distortion_tag, 0);
-<a name="l01213"></a>01213             rebin_dist = cpl_propertylist_get_int(header_dist,
-<a name="l01214"></a>01214                                                   <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l01215"></a>01215             cpl_propertylist_delete(header_dist);
-<a name="l01216"></a>01216         }
-<a name="l01217"></a>01217     }
-<a name="l01218"></a>01218 
-<a name="l01219"></a>01219     <span class="comment">/* Leave the header on for the next step... */</span>
-<a name="l01220"></a>01220 
-<a name="l01221"></a>01221 
-<a name="l01222"></a>01222     <span class="comment">/*</span>
-<a name="l01223"></a>01223 <span class="comment">     * Remove the master bias</span>
-<a name="l01224"></a>01224 <span class="comment">     */</span>
-<a name="l01225"></a>01225 
-<a name="l01226"></a>01226     <span class="keywordflow">if</span> (nbias) {
-<a name="l01227"></a>01227 
-<a name="l01228"></a>01228         <span class="comment">/*</span>
-<a name="l01229"></a>01229 <span class="comment">         * Set of raw BIASes in input, need to create master bias!</span>
-<a name="l01230"></a>01230 <span class="comment">         */</span>
-<a name="l01231"></a>01231 
-<a name="l01232"></a>01232         cpl_msg_info(recipe, <span class="stringliteral">"Generate the master from input raw biases..."</span>);
-<a name="l01233"></a>01233 
-<a name="l01234"></a>01234         <span class="keywordflow">if</span> (nbias > 1) {
-<a name="l01235"></a>01235 
-<a name="l01236"></a>01236             biases = cpl_imagelist_new();
-<a name="l01237"></a>01237 
-<a name="l01238"></a>01238             bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"BIAS"</span>, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01239"></a>01239     
-<a name="l01240"></a>01240             <span class="keywordflow">if</span> (bias == NULL)
-<a name="l01241"></a>01241                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot load bias frame"</span>);
-<a name="l01242"></a>01242 
-<a name="l01243"></a>01243             cpl_imagelist_set(biases, bias, 0);
-<a name="l01244"></a>01244     
-<a name="l01245"></a>01245             <span class="keywordflow">for</span> (i = 1; i < nbias; i++) {
-<a name="l01246"></a>01246                 bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01247"></a>01247                 <span class="keywordflow">if</span> (bias)
-<a name="l01248"></a>01248                     cpl_imagelist_set(biases, bias, i);
-<a name="l01249"></a>01249                 <span class="keywordflow">else</span>
-<a name="l01250"></a>01250                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot load bias frame"</span>);
-<a name="l01251"></a>01251             }
-<a name="l01252"></a>01252     
-<a name="l01253"></a>01253             master_bias = cpl_imagelist_collapse_median_create(biases);
-<a name="l01254"></a>01254 
-<a name="l01255"></a>01255             cpl_imagelist_delete(biases);
-<a name="l01256"></a>01256         }
-<a name="l01257"></a>01257         <span class="keywordflow">else</span> {
-<a name="l01258"></a>01258             master_bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"BIAS"</span>, 
-<a name="l01259"></a>01259                                          CPL_TYPE_FLOAT, 0, 1);
-<a name="l01260"></a>01260             <span class="keywordflow">if</span> (master_bias == NULL)
-<a name="l01261"></a>01261                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot load bias"</span>);
-<a name="l01262"></a>01262         }
-<a name="l01263"></a>01263 
-<a name="l01264"></a>01264     }
-<a name="l01265"></a>01265     <span class="keywordflow">else</span> {
-<a name="l01266"></a>01266         master_bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, 
-<a name="l01267"></a>01267                                      CPL_TYPE_FLOAT, 0, 1);
-<a name="l01268"></a>01268         <span class="keywordflow">if</span> (master_bias == NULL)
-<a name="l01269"></a>01269             fors_pmos_calib_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l01270"></a>01270     }
-<a name="l01271"></a>01271 
-<a name="l01272"></a>01272     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l01273"></a>01273 
-<a name="l01274"></a>01274     overscans = <a class="code" href="group__moses.html#g83424b665852cb22061bea76a664a730">mos_load_overscans_fors</a>(header);
-<a name="l01275"></a>01275     cpl_propertylist_delete(header); header = NULL;
-<a name="l01276"></a>01276 
-<a name="l01277"></a>01277     <span class="keywordflow">if</span> (nbias) {
-<a name="l01278"></a>01278         <span class="keywordtype">int</span> xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, 0, NULL);
-<a name="l01279"></a>01279         <span class="keywordtype">int</span> ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, 0, NULL);
-<a name="l01280"></a>01280         <span class="keywordtype">int</span> xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, 0, NULL);
-<a name="l01281"></a>01281         <span class="keywordtype">int</span> yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, 0, NULL);
-<a name="l01282"></a>01282         dummy = cpl_image_extract(master_bias, xlow+1, ylow+1, xhig, yhig);
-<a name="l01283"></a>01283         cpl_image_delete(master_bias); master_bias = dummy;
-<a name="l01284"></a>01284 
-<a name="l01285"></a>01285         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, master_bias, <span class="stringliteral">"MASTER_BIAS"</span>,
-<a name="l01286"></a>01286                            NULL, parlist, recipe, version))
-<a name="l01287"></a>01287             fors_pmos_calib_exit(NULL);
-<a name="l01288"></a>01288     }
-<a name="l01289"></a>01289 
-<a name="l01290"></a>01290     <span class="keywordflow">if</span> (nflats > 1) {
-<a name="l01291"></a>01291         multi_bias = cpl_image_multiply_scalar_create(master_bias, nflats);
-<a name="l01292"></a>01292         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(master_flat, multi_bias, overscans);
-<a name="l01293"></a>01293         <span class="keywordflow">if</span> (added_flat)
-<a name="l01294"></a>01294             add_dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(added_flat, multi_bias, overscans);
-<a name="l01295"></a>01295         cpl_image_delete(multi_bias);
-<a name="l01296"></a>01296     }
-<a name="l01297"></a>01297     <span class="keywordflow">else</span> {
-<a name="l01298"></a>01298         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(master_flat, master_bias, overscans);
-<a name="l01299"></a>01299     }
-<a name="l01300"></a>01300     cpl_image_delete(master_flat);
-<a name="l01301"></a>01301     master_flat = dummy;
-<a name="l01302"></a>01302 
-<a name="l01303"></a>01303     <span class="keywordflow">if</span> (master_flat == NULL)
-<a name="l01304"></a>01304         fors_pmos_calib_exit(<span class="stringliteral">"Cannot remove bias from flat field"</span>);
-<a name="l01305"></a>01305 
-<a name="l01306"></a>01306     <span class="keywordflow">if</span> (added_flat) {
-<a name="l01307"></a>01307         cpl_image_delete(added_flat);
-<a name="l01308"></a>01308         added_flat = add_dummy;
-<a name="l01309"></a>01309 
-<a name="l01310"></a>01310         <span class="keywordflow">if</span> (added_flat == NULL)
-<a name="l01311"></a>01311             fors_pmos_calib_exit(<span class="stringliteral">"Cannot remove bias from added flat field"</span>);
-<a name="l01312"></a>01312 
-<a name="l01313"></a>01313         trace_flat = added_flat;
-<a name="l01314"></a>01314     }
-<a name="l01315"></a>01315     <span class="keywordflow">else</span>
-<a name="l01316"></a>01316         trace_flat = master_flat;
-<a name="l01317"></a>01317 
-<a name="l01318"></a>01318     wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>, 1);
-<a name="l01319"></a>01319 
-<a name="l01320"></a>01320     <span class="keywordflow">if</span> (wavelengths == NULL)
-<a name="l01321"></a>01321         fors_pmos_calib_exit(<span class="stringliteral">"Cannot load line catalog"</span>);
-<a name="l01322"></a>01322 
-<a name="l01323"></a>01323     <span class="comment">/*</span>
-<a name="l01324"></a>01324 <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l01325"></a>01325 <span class="comment">     */</span>
-<a name="l01326"></a>01326 
-<a name="l01327"></a>01327     nlines = cpl_table_get_nrow(wavelengths);
-<a name="l01328"></a>01328 
-<a name="l01329"></a>01329     <span class="keywordflow">if</span> (nlines == 0)
-<a name="l01330"></a>01330         fors_pmos_calib_exit(<span class="stringliteral">"Empty input line catalog"</span>);
-<a name="l01331"></a>01331 
-<a name="l01332"></a>01332     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l01333"></a>01333         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,
-<a name="l01334"></a>01334                       wcolumn);
-<a name="l01335"></a>01335         fors_pmos_calib_exit(NULL);
-<a name="l01336"></a>01336     }
-<a name="l01337"></a>01337 
-<a name="l01338"></a>01338     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01339"></a>01339     
-<a name="l01340"></a>01340     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l01341"></a>01341         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l01342"></a>01342 
-<a name="l01343"></a>01343     lines = cpl_vector_wrap(nlines, line);
-<a name="l01344"></a>01344 
-<a name="l01345"></a>01345     <span class="keywordflow">for</span> (j = 0; j < pmos; j++) {
-<a name="l01346"></a>01346         <span class="keywordtype">int</span> k;
-<a name="l01347"></a>01347 
-<a name="l01348"></a>01348         cpl_msg_indent_less();
-<a name="l01349"></a>01349         cpl_msg_info(recipe, <span class="stringliteral">"Processing arc lamp nb %d out of %d ..."</span>,
-<a name="l01350"></a>01350                      j + 1, pmos);
-<a name="l01351"></a>01351         cpl_msg_indent_more();
-<a name="l01352"></a>01352 
-<a name="l01353"></a>01353         cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);
-<a name="l01354"></a>01354         cpl_msg_indent_more();
-<a name="l01355"></a>01355 
-<a name="l01356"></a>01356         spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01357"></a>01357 
-<a name="l01358"></a>01358         <span class="comment">/*</span>
-<a name="l01359"></a>01359 <span class="comment">         * FIXME: Horrible workaround to avoid the problem because of the</span>
-<a name="l01360"></a>01360 <span class="comment">         * multiple encapsulation of cpl_frameset_find() in different </span>
-<a name="l01361"></a>01361 <span class="comment">         * loading functions</span>
-<a name="l01362"></a>01362 <span class="comment">         */</span>
-<a name="l01363"></a>01363         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01364"></a>01364             cpl_image_delete(spectra);
-<a name="l01365"></a>01365             spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01366"></a>01366         }
-<a name="l01367"></a>01367 
-<a name="l01368"></a>01368         <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01369"></a>01369             fors_pmos_calib_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);
-<a name="l01370"></a>01370 
-<a name="l01371"></a>01371         <span class="keywordflow">if</span> (doit) {
-<a name="l01372"></a>01372             <a class="code" href="group__moses.html#g7557973371ca804e0fab92c40b833f3c">mos_randomise_image</a>(spectra, ron, gain, blevel);
-<a name="l01373"></a>01373         }
-<a name="l01374"></a>01374 
-<a name="l01375"></a>01375         cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l01376"></a>01376 
-<a name="l01377"></a>01377         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(spectra, master_bias, overscans);
-<a name="l01378"></a>01378         cpl_image_delete(spectra); spectra = dummy;
-<a name="l01379"></a>01379 
-<a name="l01380"></a>01380         <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01381"></a>01381             fors_pmos_calib_exit(<span class="stringliteral">"Cannot remove bias from arc lamp exposure"</span>);
-<a name="l01382"></a>01382 
-<a name="l01383"></a>01383         cpl_msg_indent_less();
-<a name="l01384"></a>01384         cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);
-<a name="l01385"></a>01385         cpl_msg_indent_more();
-<a name="l01386"></a>01386 
-<a name="l01387"></a>01387         <span class="comment">/*</span>
-<a name="l01388"></a>01388 <span class="comment">         * Here the PMOS calibration is carried out.</span>
-<a name="l01389"></a>01389 <span class="comment">         */</span>
-<a name="l01390"></a>01390 
-<a name="l01391"></a>01391         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(spectra))
-<a name="l01392"></a>01392             fors_pmos_calib_exit(<span class="stringliteral">"Cannot process saturation"</span>);
-<a name="l01393"></a>01393 
-<a name="l01394"></a>01394         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(spectra))
-<a name="l01395"></a>01395             fors_pmos_calib_exit(<span class="stringliteral">"Cannot subtract the background"</span>);
-<a name="l01396"></a>01396 
-<a name="l01397"></a>01397         <span class="keywordflow">if</span> (!j) {
-<a name="l01398"></a>01398             <span class="comment">/*</span>
-<a name="l01399"></a>01399 <span class="comment">             * Detecting spectra on the CCD</span>
-<a name="l01400"></a>01400 <span class="comment">             */</span>
-<a name="l01401"></a>01401 
-<a name="l01402"></a>01402             cpl_msg_indent_less();
-<a name="l01403"></a>01403             cpl_msg_info(recipe, <span class="stringliteral">"Detecting spectra on CCD..."</span>);
-<a name="l01404"></a>01404             cpl_msg_indent_more();
-<a name="l01405"></a>01405 
-<a name="l01406"></a>01406             ccd_xsize = nx = cpl_image_get_size_x(spectra);
-<a name="l01407"></a>01407             ccd_ysize = ny = cpl_image_get_size_y(spectra);
-<a name="l01408"></a>01408 
-<a name="l01409"></a>01409             refmask = cpl_mask_new(nx, ny);
-<a name="l01410"></a>01410 
-<a name="l01411"></a>01411             checkwave =
-<a name="l01412"></a>01412                 <a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion, 
-<a name="l01413"></a>01413                                                peakdetection, wradius, 
-<a name="l01414"></a>01414                                                wdegree, wreject, reference,
-<a name="l01415"></a>01415                                                &startwavelength, &endwavelength,
-<a name="l01416"></a>01416                                                NULL, NULL, NULL, NULL, NULL, 
-<a name="l01417"></a>01417                                                NULL, refmask);
-<a name="l01418"></a>01418 
-<a name="l01419"></a>01419             <span class="keywordflow">if</span> (checkwave == NULL)
-<a name="l01420"></a>01420                 fors_pmos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l01421"></a>01421 
-<a name="l01422"></a>01422             <span class="comment">/*</span>
-<a name="l01423"></a>01423 <span class="comment">             * Save check image to disk</span>
-<a name="l01424"></a>01424 <span class="comment">             */</span>
-<a name="l01425"></a>01425 
-<a name="l01426"></a>01426             header = cpl_propertylist_new();
-<a name="l01427"></a>01427             cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01428"></a>01428             cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01429"></a>01429             cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01430"></a>01430                                            startwavelength + dispersion/2);
-<a name="l01431"></a>01431             cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01432"></a>01432             <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01433"></a>01433 <span class="comment">               cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01434"></a>01434             cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01435"></a>01435             cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01436"></a>01436             cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01437"></a>01437             cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01438"></a>01438             cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01439"></a>01439             cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01440"></a>01440 
-<a name="l01441"></a>01441             <span class="keywordflow">if</span> (check) {
-<a name="l01442"></a>01442                 <span class="keywordflow">if</span> (!j) {
-<a name="l01443"></a>01443                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01444"></a>01444                                            spectra_detection_tag,
-<a name="l01445"></a>01445                                            recipe, version)) {
-<a name="l01446"></a>01446                         fors_pmos_calib_exit(NULL);
-<a name="l01447"></a>01447                     }
-<a name="l01448"></a>01448                 }
-<a name="l01449"></a>01449 
-<a name="l01450"></a>01450                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(checkwave, 
-<a name="l01451"></a>01451                                        spectra_detection_tag, header)) {
-<a name="l01452"></a>01452                     fors_pmos_calib_exit(NULL);
-<a name="l01453"></a>01453                 }
-<a name="l01454"></a>01454             }
-<a name="l01455"></a>01455 
-<a name="l01456"></a>01456             cpl_image_delete(checkwave); checkwave = NULL;
-<a name="l01457"></a>01457             cpl_propertylist_delete(header); header = NULL;
-<a name="l01458"></a>01458 
-<a name="l01459"></a>01459             <span class="keywordflow">if</span> (cpl_mask_is_empty(refmask))
-<a name="l01460"></a>01460                 fors_pmos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l01461"></a>01461 
-<a name="l01462"></a>01462             <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gaabac93f2fab16b6c268e5ab494a7238">mos_refmask_find_gaps</a>(refmask, trace_flat, -1.0))
-<a name="l01463"></a>01463                 fors_pmos_calib_exit(<span class="stringliteral">"The gaps could not be found"</span>);
-<a name="l01464"></a>01464 
-<a name="l01465"></a>01465             cpl_msg_info(recipe,
-<a name="l01466"></a>01466                          <span class="stringliteral">"Locate slits at reference wavelength on CCD..."</span>);
-<a name="l01467"></a>01467             slits = <a class="code" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_spectra</a>(refmask);
-<a name="l01468"></a>01468 
-<a name="l01469"></a>01469             <span class="keywordflow">if</span> (!slits) {
-<a name="l01470"></a>01470                 cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01471"></a>01471                 fors_pmos_calib_exit(<span class="stringliteral">"No slits could be detected!"</span>);
-<a name="l01472"></a>01472             }
-<a name="l01473"></a>01473 
-<a name="l01474"></a>01474             <span class="keywordflow">if</span> (same_offset) {
-<a name="l01475"></a>01475                 <span class="keywordflow">if</span> (ny != 400 && ny != 500) {
-<a name="l01476"></a>01476                     <span class="keywordtype">float</span> rescale = (float) rebin_dist / rebin;
-<a name="l01477"></a>01477                     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g5ec455544df7dfc83da8fefc91a9afc7">mos_check_slits</a>(slits, rescale)) {
-<a name="l01478"></a>01478                         fors_pmos_calib_exit(<span class="stringliteral">"Some slits are missing. "</span>
-<a name="l01479"></a>01479                                              <span class="stringliteral">"Cannot recover!"</span>);
-<a name="l01480"></a>01480                     }
-<a name="l01481"></a>01481                 }
-<a name="l01482"></a>01482             }
-<a name="l01483"></a>01483 
-<a name="l01484"></a>01484             refimage = cpl_image_new_from_mask(refmask);
-<a name="l01485"></a>01485             cpl_mask_delete(refmask); refmask = NULL;
-<a name="l01486"></a>01486 
-<a name="l01487"></a>01487             <span class="keywordflow">if</span> (check) {
-<a name="l01488"></a>01488                 <span class="keywordflow">if</span> (!j) {
-<a name="l01489"></a>01489                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01490"></a>01490                                            slit_map_tag,
-<a name="l01491"></a>01491                                            recipe, version)) {
-<a name="l01492"></a>01492                         fors_pmos_calib_exit(NULL);
-<a name="l01493"></a>01493                     }
-<a name="l01494"></a>01494                 }
-<a name="l01495"></a>01495 
-<a name="l01496"></a>01496                 save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01497"></a>01497 
-<a name="l01498"></a>01498                 <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01499"></a>01499                     cpl_propertylist_delete(save_header);
-<a name="l01500"></a>01500                     save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01501"></a>01501                 }
-<a name="l01502"></a>01502 
-<a name="l01503"></a>01503                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(refimage, slit_map_tag, save_header)) {
-<a name="l01504"></a>01504                     fors_pmos_calib_exit(NULL);
-<a name="l01505"></a>01505                 }
-<a name="l01506"></a>01506                 cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01507"></a>01507             }
-<a name="l01508"></a>01508 
-<a name="l01509"></a>01509             cpl_image_delete(refimage); refimage = NULL;
-<a name="l01510"></a>01510 
-<a name="l01511"></a>01511 <span class="comment">//          if (same_offset == 0) {</span>
-<a name="l01512"></a>01512 
-<a name="l01513"></a>01513             same_offset = 1; <span class="comment">// Added, see next line comment.</span>
-<a name="l01514"></a>01514             <span class="keywordflow">if</span> (0) { <span class="comment">// This part is eliminated: a successful</span>
-<a name="l01515"></a>01515                      <span class="comment">// pattern matching would identify just </span>
-<a name="l01516"></a>01516                      <span class="comment">// one of the two beams!!! It needs to be FIXED.</span>
-<a name="l01517"></a>01517 
-<a name="l01518"></a>01518                 <span class="comment">/*</span>
-<a name="l01519"></a>01519 <span class="comment">                 * Attempt slit identification: this recipe may continue even</span>
-<a name="l01520"></a>01520 <span class="comment">                 * in case of failed identification (i.e., the position table</span>
-<a name="l01521"></a>01521 <span class="comment">                 * is not produced, but an error is not set). In case of </span>
-<a name="l01522"></a>01522 <span class="comment">                 * failure, the spectra would be still extracted, even if they</span>
-<a name="l01523"></a>01523 <span class="comment">                 * would not be associated to slits on the mask.</span>
-<a name="l01524"></a>01524 <span class="comment">                 * </span>
-<a name="l01525"></a>01525 <span class="comment">                 * The reason for making the slit identification an user option</span>
-<a name="l01526"></a>01526 <span class="comment">                 * (via the parameter slit_ident) is to offer the possibility </span>
-<a name="l01527"></a>01527 <span class="comment">                 * to avoid identifications that are only apparently successful</span>
-<a name="l01528"></a>01528 <span class="comment">                 * as it would happen in the case of an incorrect slit</span>
-<a name="l01529"></a>01529 <span class="comment">                 * description in the data header.</span>
-<a name="l01530"></a>01530 <span class="comment">                 */</span>
-<a name="l01531"></a>01531 
-<a name="l01532"></a>01532                 cpl_msg_indent_less();
-<a name="l01533"></a>01533                 cpl_msg_info(recipe, 
-<a name="l01534"></a>01534                              <span class="stringliteral">"Attempt slit identification (optional)..."</span>);
-<a name="l01535"></a>01535                 cpl_msg_indent_more();
-<a name="l01536"></a>01536 
-<a name="l01537"></a>01537                 positions = <a class="code" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits</a>(slits, maskslits, NULL);
-<a name="l01538"></a>01538 
-<a name="l01539"></a>01539                 <span class="keywordflow">if</span> (positions) {
-<a name="l01540"></a>01540                     cpl_table_delete(slits);
-<a name="l01541"></a>01541                     slits = positions;
-<a name="l01542"></a>01542 
-<a name="l01543"></a>01543                    <span class="comment">/*</span>
-<a name="l01544"></a>01544 <span class="comment">                    * Eliminate slits which are not _entirely_ inside the CCD</span>
-<a name="l01545"></a>01545 <span class="comment">                    */</span>
-<a name="l01546"></a>01546 
-<a name="l01547"></a>01547                     cpl_table_and_selected_double(slits, 
-<a name="l01548"></a>01548                                                  <span class="stringliteral">"ytop"</span>, CPL_GREATER_THAN, ny);
-<a name="l01549"></a>01549                     cpl_table_or_selected_double(slits, 
-<a name="l01550"></a>01550                                                  <span class="stringliteral">"ybottom"</span>, CPL_LESS_THAN, 0);
-<a name="l01551"></a>01551                     cpl_table_erase_selected(slits);
-<a name="l01552"></a>01552 
-<a name="l01553"></a>01553                     nslits = cpl_table_get_nrow(slits);
-<a name="l01554"></a>01554 
-<a name="l01555"></a>01555                     <span class="keywordflow">if</span> (nslits == 0)
-<a name="l01556"></a>01556                         fors_pmos_calib_exit(<span class="stringliteral">"No slits found on the CCD"</span>);
-<a name="l01557"></a>01557 
-<a name="l01558"></a>01558                     cpl_msg_info(recipe,
-<a name="l01559"></a>01559                                  <span class="stringliteral">"%d slits are entirely contained in CCD"</span>, 
-<a name="l01560"></a>01560                                  nslits);
-<a name="l01561"></a>01561                 }
-<a name="l01562"></a>01562                 <span class="keywordflow">else</span> {
-<a name="l01563"></a>01563                     same_offset = 1; <span class="comment">/* FIXLANDER slit_ident = 0; */</span>
-<a name="l01564"></a>01564                     cpl_msg_info(recipe, 
-<a name="l01565"></a>01565                                  <span class="stringliteral">"Global distortion model cannot be computed"</span>);
-<a name="l01566"></a>01566                     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l01567"></a>01567                         fors_pmos_calib_exit(NULL);
-<a name="l01568"></a>01568                     }
-<a name="l01569"></a>01569                 }
-<a name="l01570"></a>01570             }
-<a name="l01571"></a>01571 
-<a name="l01572"></a>01572 
-<a name="l01573"></a>01573             <span class="keywordflow">if</span> (ny == 400 || ny == 500) {
-<a name="l01574"></a>01574 
-<a name="l01575"></a>01575                <span class="comment">/*</span>
-<a name="l01576"></a>01576 <span class="comment">                * For the FORS1 special case (old chip 2048x400 readout)</span>
-<a name="l01577"></a>01577 <span class="comment">                * keep the central slits only</span>
-<a name="l01578"></a>01578 <span class="comment">                */</span>
-<a name="l01579"></a>01579 
-<a name="l01580"></a>01580                 nslits = cpl_table_get_nrow(slits);
-<a name="l01581"></a>01581 
-<a name="l01582"></a>01582                 <span class="keywordflow">if</span> (nslits > 4) {
-<a name="l01583"></a>01583                     cpl_table_unselect_all(slits);
-<a name="l01584"></a>01584                     <span class="keywordflow">for</span> (k = 0; k < cpl_table_get_nrow(slits); k++) {
-<a name="l01585"></a>01585                         <span class="keywordtype">double</span> jump = cpl_table_get(slits, <span class="stringliteral">"ytop"</span>, k, NULL) 
-<a name="l01586"></a>01586                                     - cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, k, NULL);
-<a name="l01587"></a>01587                         <span class="keywordflow">if</span> (jump < 50.) {
-<a name="l01588"></a>01588                             cpl_table_select_row(slits, k);
-<a name="l01589"></a>01589                         }
-<a name="l01590"></a>01590                     }
-<a name="l01591"></a>01591                     cpl_table_erase_selected(slits);
-<a name="l01592"></a>01592                     nslits = cpl_table_get_nrow(slits);
-<a name="l01593"></a>01593                 }
-<a name="l01594"></a>01594 
-<a name="l01595"></a>01595                 <span class="keywordflow">if</span> (nslits == 0)
-<a name="l01596"></a>01596                     fors_pmos_calib_exit(<span class="stringliteral">"No slits found on the CCD"</span>);
-<a name="l01597"></a>01597 
-<a name="l01598"></a>01598                 <span class="keywordflow">if</span> (nslits == 4) {
-<a name="l01599"></a>01599                     cpl_table_unselect_all(slits);
-<a name="l01600"></a>01600                     cpl_table_select_row(slits, 0);
-<a name="l01601"></a>01601                     cpl_table_select_row(slits, cpl_table_get_nrow(slits)-1);
-<a name="l01602"></a>01602                     cpl_table_erase_selected(slits);
-<a name="l01603"></a>01603                 }
-<a name="l01604"></a>01604 
-<a name="l01605"></a>01605                 cpl_msg_info(recipe, 
-<a name="l01606"></a>01606                              <span class="stringliteral">"%d slits are entirely contained in CCD"</span>, nslits);
-<a name="l01607"></a>01607             }
-<a name="l01608"></a>01608             <span class="keywordflow">else</span> {
-<a name="l01609"></a>01609                 cpl_table_unselect_all(slits);
-<a name="l01610"></a>01610                 <span class="keywordflow">for</span> (k = 0; k < cpl_table_get_nrow(slits); k++) {
-<a name="l01611"></a>01611                     <span class="keywordtype">double</span> jump = cpl_table_get(slits, <span class="stringliteral">"ytop"</span>, k, NULL)
-<a name="l01612"></a>01612                                 - cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, k, NULL);
-<a name="l01613"></a>01613                     <span class="keywordflow">if</span> (jump < 10.) {
-<a name="l01614"></a>01614                         cpl_table_select_row(slits, k);
-<a name="l01615"></a>01615                     }
-<a name="l01616"></a>01616                 }
-<a name="l01617"></a>01617                 cpl_table_erase_selected(slits);
-<a name="l01618"></a>01618                 nslits = cpl_table_get_nrow(slits);
-<a name="l01619"></a>01619             }
-<a name="l01620"></a>01620 
-<a name="l01621"></a>01621 
-<a name="l01622"></a>01622             <span class="comment">/*</span>
-<a name="l01623"></a>01623 <span class="comment">             * Determination of spectral curvature</span>
-<a name="l01624"></a>01624 <span class="comment">             */</span>
-<a name="l01625"></a>01625 
-<a name="l01626"></a>01626             cpl_msg_indent_less();
-<a name="l01627"></a>01627             cpl_msg_info(recipe, <span class="stringliteral">"Determining spectral curvature..."</span>);
-<a name="l01628"></a>01628             cpl_msg_indent_more();
-<a name="l01629"></a>01629 
-<a name="l01630"></a>01630             cpl_msg_info(recipe, <span class="stringliteral">"Tracing master flat field spectra edges..."</span>);
-<a name="l01631"></a>01631             traces = <a class="code" href="group__moses.html#g168f6aecd869c24634fa9f6690da0b02">mos_trace_flat</a>(trace_flat, slits, reference, 
-<a name="l01632"></a>01632                                     startwavelength, endwavelength, dispersion);
-<a name="l01633"></a>01633 
-<a name="l01634"></a>01634             <span class="keywordflow">if</span> (!traces)
-<a name="l01635"></a>01635                 fors_pmos_calib_exit(<span class="stringliteral">"Tracing failure"</span>);
-<a name="l01636"></a>01636 
-<a name="l01637"></a>01637             cpl_image_delete(added_flat); added_flat = NULL;
-<a name="l01638"></a>01638 
-<a name="l01639"></a>01639             cpl_msg_info(recipe, <span class="stringliteral">"Fitting flat field spectra edges..."</span>);
-<a name="l01640"></a>01640             polytraces = <a class="code" href="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414">mos_poly_trace</a>(slits, traces, cdegree);
-<a name="l01641"></a>01641 
-<a name="l01642"></a>01642             <span class="keywordflow">if</span> (!polytraces)
-<a name="l01643"></a>01643                 fors_pmos_calib_exit(<span class="stringliteral">"Trace fitting failure"</span>);
-<a name="l01644"></a>01644 
-<a name="l01645"></a>01645             <span class="keywordflow">if</span> (cmode) {
-<a name="l01646"></a>01646                 cpl_msg_info(recipe, 
-<a name="l01647"></a>01647                              <span class="stringliteral">"Computing global spectral curvature model..."</span>);
-<a name="l01648"></a>01648                 <a class="code" href="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5">mos_global_trace</a>(slits, polytraces, cmode);
-<a name="l01649"></a>01649             }
-<a name="l01650"></a>01650 
-<a name="l01651"></a>01651             <span class="keywordflow">if</span> (!j) {
-<a name="l01652"></a>01652                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist, curv_traces_tag,
-<a name="l01653"></a>01653                                        recipe, version)) {
-<a name="l01654"></a>01654                     fors_pmos_calib_exit(NULL);
-<a name="l01655"></a>01655                 }
-<a name="l01656"></a>01656             }
-<a name="l01657"></a>01657 
-<a name="l01658"></a>01658             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">dfs_save_table_ext</a>(traces, curv_traces_tag, NULL)) {
-<a name="l01659"></a>01659                 fors_pmos_calib_exit(NULL);
-<a name="l01660"></a>01660             }
-<a name="l01661"></a>01661 
-<a name="l01662"></a>01662             cpl_table_delete(traces); traces = NULL;
-<a name="l01663"></a>01663 
-<a name="l01664"></a>01664             coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01665"></a>01665 
-<a name="l01666"></a>01666         }
-<a name="l01667"></a>01667 <span class="comment">//</span>
-<a name="l01668"></a>01668         spatial = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces,
-<a name="l01669"></a>01669                                           reference, 
-<a name="l01670"></a>01670                                           startwavelength, endwavelength, 
-<a name="l01671"></a>01671                                           dispersion, 0, j ? NULL: coordinate);
-<a name="l01672"></a>01672 
-<a name="l01673"></a>01673         <span class="keywordflow">if</span> (!j) {
-<a name="l01674"></a>01674 <span class="comment">//</span>
-<a name="l01675"></a>01675             <span class="keywordflow">if</span> (same_offset) { <span class="comment">/* FIXLANDER It was !slit_ident */</span>
-<a name="l01676"></a>01676                 cpl_image_delete(spectra); spectra = NULL;
-<a name="l01677"></a>01677             }
-<a name="l01678"></a>01678 
-<a name="l01679"></a>01679             <span class="comment">/*</span>
-<a name="l01680"></a>01680 <span class="comment">             * Flat field normalisation is done directly on the master flat</span>
-<a name="l01681"></a>01681 <span class="comment">             * field (without spatial rectification first). The spectral</span>
-<a name="l01682"></a>01682 <span class="comment">             * curvature model may be provided in input, in future releases.</span>
-<a name="l01683"></a>01683 <span class="comment">             */</span>
-<a name="l01684"></a>01684 
-<a name="l01685"></a>01685             cpl_msg_indent_less();
-<a name="l01686"></a>01686             cpl_msg_info(recipe, <span class="stringliteral">"Perform flat field normalisation..."</span>);
-<a name="l01687"></a>01687             cpl_msg_indent_more();
-<a name="l01688"></a>01688 
-<a name="l01689"></a>01689             norm_flat = cpl_image_duplicate(master_flat);
-<a name="l01690"></a>01690 
-<a name="l01691"></a>01691             smo_flat = <a class="code" href="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff">mos_normalise_flat</a>(norm_flat, coordinate, slits,
-<a name="l01692"></a>01692                                           polytraces, reference,
-<a name="l01693"></a>01693                                           startwavelength, endwavelength,
-<a name="l01694"></a>01694                                           dispersion, dradius, ddegree);
-<a name="l01695"></a>01695 
-<a name="l01696"></a>01696             <span class="comment">/* This may be a product */</span>
-<a name="l01697"></a>01697             cpl_image_delete(smo_flat); smo_flat = NULL; 
-<a name="l01698"></a>01698 
-<a name="l01699"></a>01699  
-<a name="l01700"></a>01700             save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, flat_tag, 0);
-<a name="l01701"></a>01701             cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>,
-<a name="l01702"></a>01702                                         nflats);
-<a name="l01703"></a>01703 
-<a name="l01704"></a>01704             rect_flat = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(master_flat, slits, polytraces,
-<a name="l01705"></a>01705                                                 reference, startwavelength, 
-<a name="l01706"></a>01706                                                 endwavelength, dispersion, 0,
-<a name="l01707"></a>01707                                                 NULL);
-<a name="l01708"></a>01708             rect_nflat = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(norm_flat, slits, polytraces, 
-<a name="l01709"></a>01709                                                  reference, startwavelength, 
-<a name="l01710"></a>01710                                                  endwavelength, dispersion, 0,
-<a name="l01711"></a>01711                                                  NULL);
-<a name="l01712"></a>01712 
-<a name="l01713"></a>01713 
-<a name="l01714"></a>01714             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, master_flat, master_screen_flat_tag,
-<a name="l01715"></a>01715                                save_header, parlist, recipe, version))
-<a name="l01716"></a>01716                 fors_pmos_calib_exit(NULL);
-<a name="l01717"></a>01717 
-<a name="l01718"></a>01718 
-<a name="l01719"></a>01719             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, norm_flat, master_norm_flat_tag,
-<a name="l01720"></a>01720                                save_header, parlist, recipe, version))
-<a name="l01721"></a>01721                 fors_pmos_calib_exit(NULL);
-<a name="l01722"></a>01722 
-<a name="l01723"></a>01723             cpl_image_delete(norm_flat); norm_flat = NULL;
-<a name="l01724"></a>01724             cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01725"></a>01725 
-<a name="l01726"></a>01726         }
-<a name="l01727"></a>01727 
-<a name="l01728"></a>01728 
-<a name="l01729"></a>01729         <span class="comment">/*</span>
-<a name="l01730"></a>01730 <span class="comment">         * Final wavelength calibration of spectra having their curvature</span>
-<a name="l01731"></a>01731 <span class="comment">         * removed</span>
-<a name="l01732"></a>01732 <span class="comment">         */</span>
-<a name="l01733"></a>01733 
-<a name="l01734"></a>01734         cpl_msg_indent_less();
-<a name="l01735"></a>01735         cpl_msg_info(recipe, <span class="stringliteral">"Perform final wavelength calibration..."</span>);
-<a name="l01736"></a>01736         cpl_msg_indent_more();
-<a name="l01737"></a>01737 
-<a name="l01738"></a>01738         nx = cpl_image_get_size_x(spatial);
-<a name="l01739"></a>01739         ny = cpl_image_get_size_y(spatial);
-<a name="l01740"></a>01740 
-<a name="l01741"></a>01741         idscoeff = cpl_table_new(ny);
-<a name="l01742"></a>01742         restable = cpl_table_new(nlines);
-<a name="l01743"></a>01743         rainbow = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01744"></a>01744         <span class="keywordflow">if</span> (check)
-<a name="l01745"></a>01745             residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01746"></a>01746         fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01747"></a>01747         fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l01748"></a>01748 
-<a name="l01749"></a>01749         rectified = <a class="code" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final</a>(spatial, slits, lines, 
-<a name="l01750"></a>01750                                                      dispersion, peakdetection,
-<a name="l01751"></a>01751                                                      wradius, wdegree, wreject,
-<a name="l01752"></a>01752                                                      reference,
-<a name="l01753"></a>01753                                                      &startwavelength, 
-<a name="l01754"></a>01754                                                      &endwavelength, fitlines, 
-<a name="l01755"></a>01755                                                      fiterror, idscoeff,
-<a name="l01756"></a>01756                                                      rainbow, 
-<a name="l01757"></a>01757                                                      residual, restable);
-<a name="l01758"></a>01758 
-<a name="l01759"></a>01759         <span class="keywordflow">if</span> (rectified == NULL)
-<a name="l01760"></a>01760             fors_pmos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l01761"></a>01761 
-<a name="l01762"></a>01762         <span class="keywordflow">if</span> (!j) {
-<a name="l01763"></a>01763             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist, disp_residuals_table_tag,
-<a name="l01764"></a>01764                                    recipe, version)) {
-<a name="l01765"></a>01765                 fors_pmos_calib_exit(NULL);
-<a name="l01766"></a>01766             }
-<a name="l01767"></a>01767         }
-<a name="l01768"></a>01768 
-<a name="l01769"></a>01769         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01770"></a>01770 
-<a name="l01771"></a>01771         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01772"></a>01772             cpl_propertylist_delete(header);
-<a name="l01773"></a>01773             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01774"></a>01774         }
-<a name="l01775"></a>01775 
-<a name="l01776"></a>01776         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">dfs_save_table_ext</a>(restable, disp_residuals_table_tag, header)) {
-<a name="l01777"></a>01777             fors_pmos_calib_exit(NULL);
-<a name="l01778"></a>01778         }
-<a name="l01779"></a>01779 
-<a name="l01780"></a>01780         cpl_propertylist_delete(header);
-<a name="l01781"></a>01781 
-<a name="l01782"></a>01782         cpl_table_delete(restable); restable = NULL;
-<a name="l01783"></a>01783 
-<a name="l01784"></a>01784         cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;
-<a name="l01785"></a>01785         cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l01786"></a>01786         cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;
-<a name="l01787"></a>01787 
-<a name="l01788"></a>01788         <span class="keywordflow">for</span> (i = 0; i < ny; i++)
-<a name="l01789"></a>01789             <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))
-<a name="l01790"></a>01790                 cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);
-<a name="l01791"></a>01791 
-<a name="l01792"></a>01792         delta = <a class="code" href="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1">mos_map_pixel</a>(idscoeff, reference, startwavelength,
-<a name="l01793"></a>01793                               endwavelength, dispersion, 2);
-<a name="l01794"></a>01794 
-<a name="l01795"></a>01795         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01796"></a>01796 
-<a name="l01797"></a>01797         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01798"></a>01798             cpl_propertylist_delete(header);
-<a name="l01799"></a>01799             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01800"></a>01800         }
-<a name="l01801"></a>01801 
-<a name="l01802"></a>01802         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01803"></a>01803         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01804"></a>01804         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l01805"></a>01805                                        startwavelength + dispersion/2);
-<a name="l01806"></a>01806         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01807"></a>01807         <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01808"></a>01808 <span class="comment">           cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01809"></a>01809         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01810"></a>01810         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01811"></a>01811         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01812"></a>01812         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01813"></a>01813         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01814"></a>01814         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01815"></a>01815 
-<a name="l01816"></a>01816         <span class="keywordflow">if</span> (!j) {
-<a name="l01817"></a>01817             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist, delta_image_tag,
-<a name="l01818"></a>01818                                    recipe, version)) {
-<a name="l01819"></a>01819                 fors_pmos_calib_exit(NULL);
-<a name="l01820"></a>01820             }
-<a name="l01821"></a>01821         }
-<a name="l01822"></a>01822 
-<a name="l01823"></a>01823         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(delta, delta_image_tag, header)) {
-<a name="l01824"></a>01824             fors_pmos_calib_exit(NULL);
-<a name="l01825"></a>01825         }
-<a name="l01826"></a>01826 
-<a name="l01827"></a>01827         cpl_image_delete(delta); delta = NULL;
-<a name="l01828"></a>01828         cpl_propertylist_delete(header); header = NULL;
-<a name="l01829"></a>01829 
-<a name="l01830"></a>01830         mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(rectified, lines, startwavelength, 
-<a name="l01831"></a>01831                                        dispersion, 6, 0);
-<a name="l01832"></a>01832 
-<a name="l01833"></a>01833         cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f pixel"</span>, mean_rms);
-<a name="l01834"></a>01834 
-<a name="l01835"></a>01835         mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l01836"></a>01836         mean_rms_err = cpl_table_get_column_stdev(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l01837"></a>01837 
-<a name="l01838"></a>01838         cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>, 
-<a name="l01839"></a>01839                      mean_rms, mean_rms * dispersion);
-<a name="l01840"></a>01840 
-<a name="l01841"></a>01841         restab = <a class="code" href="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55">mos_resolution_table</a>(rectified, startwavelength, dispersion, 
-<a name="l01842"></a>01842                                       60000, lines);
-<a name="l01843"></a>01843 
-<a name="l01844"></a>01844         <span class="keywordflow">if</span> (restab) {
-<a name="l01845"></a>01845             cpl_msg_info(recipe, <span class="stringliteral">"Mean spectral resolution: %.2f"</span>, 
-<a name="l01846"></a>01846                          cpl_table_get_column_mean(restab, <span class="stringliteral">"resolution"</span>));
-<a name="l01847"></a>01847             cpl_msg_info(recipe,
-<a name="l01848"></a>01848                   <span class="stringliteral">"Mean reference lines FWHM: %.2f +/- %.2f pixel"</span>,
-<a name="l01849"></a>01849                   cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm"</span>) / dispersion,
-<a name="l01850"></a>01850                   cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm_rms"</span>) / dispersion);
-<a name="l01851"></a>01851 
-<a name="l01852"></a>01852             cpl_table_duplicate_column(restab, <span class="stringliteral">"dlambda"</span>, 
-<a name="l01853"></a>01853                                        restab, <span class="stringliteral">"fwhm"</span>);
-<a name="l01854"></a>01854             cpl_table_multiply_scalar(restab, <span class="stringliteral">"dlambda"</span>, dispersion);
-<a name="l01855"></a>01855             cpl_table_duplicate_column(restab, <span class="stringliteral">"dlambda_rms"</span>, 
-<a name="l01856"></a>01856                                        restab, <span class="stringliteral">"fwhm_rms"</span>);
-<a name="l01857"></a>01857             cpl_table_multiply_scalar(restab, <span class="stringliteral">"dlambda_rms"</span>, dispersion);
-<a name="l01858"></a>01858 
-<a name="l01859"></a>01859             <span class="keywordflow">if</span> (qc) {
-<a name="l01860"></a>01860 
-<a name="l01861"></a>01861                 qclist = cpl_propertylist_new();
-<a name="l01862"></a>01862 
-<a name="l01863"></a>01863                 <span class="comment">/*</span>
-<a name="l01864"></a>01864 <span class="comment">                 * QC1 parameters</span>
-<a name="l01865"></a>01865 <span class="comment">                 */</span>
-<a name="l01866"></a>01866                 keyname = <span class="stringliteral">"QC.DID"</span>;
-<a name="l01867"></a>01867 
-<a name="l01868"></a>01868                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(qclist,
-<a name="l01869"></a>01869                                              keyname,
-<a name="l01870"></a>01870                                              <span class="stringliteral">"2.0"</span>,
-<a name="l01871"></a>01871                                              <span class="stringliteral">"QC1 dictionary"</span>)) {
-<a name="l01872"></a>01872                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span>
-<a name="l01873"></a>01873                                          <span class="stringliteral">"to QC log file"</span>);
-<a name="l01874"></a>01874                 }
-<a name="l01875"></a>01875 
-<a name="l01876"></a>01876                 
-<a name="l01877"></a>01877                 keyname = <span class="stringliteral">"QC.PMOS.RESOLUTION"</span>;
-<a name="l01878"></a>01878 
-<a name="l01879"></a>01879                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qclist, 
-<a name="l01880"></a>01880                                             cpl_table_get_column_mean(restab,
-<a name="l01881"></a>01881                                             <span class="stringliteral">"resolution"</span>),
-<a name="l01882"></a>01882                                             keyname,
-<a name="l01883"></a>01883                                             <span class="stringliteral">"Angstrom"</span>,
-<a name="l01884"></a>01884                                             <span class="stringliteral">"Mean spectral resolution"</span>)) {
-<a name="l01885"></a>01885                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write mean spectral "</span>
-<a name="l01886"></a>01886                                          <span class="stringliteral">"resolution to QC log file"</span>);
-<a name="l01887"></a>01887                 }
-<a name="l01888"></a>01888 
-<a name="l01889"></a>01889                 keyname = <span class="stringliteral">"QC.PMOS.RESOLUTION.RMS"</span>;
-<a name="l01890"></a>01890 
-<a name="l01891"></a>01891                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qclist, 
-<a name="l01892"></a>01892                                             cpl_table_get_column_stdev(restab, 
-<a name="l01893"></a>01893                                             <span class="stringliteral">"resolution"</span>),
-<a name="l01894"></a>01894                                             keyname,
-<a name="l01895"></a>01895                                             <span class="stringliteral">"Angstrom"</span>, 
-<a name="l01896"></a>01896                                             <span class="stringliteral">"Scatter of spectral resolution"</span>)) {
-<a name="l01897"></a>01897                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write spectral resolution "</span>
-<a name="l01898"></a>01898                                          <span class="stringliteral">"scatter to QC log file"</span>);
-<a name="l01899"></a>01899                 }
-<a name="l01900"></a>01900 
-<a name="l01901"></a>01901                 keyname = <span class="stringliteral">"QC.PMOS.RESOLUTION.NWAVE"</span>;
-<a name="l01902"></a>01902 
-<a name="l01903"></a>01903                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g5add57d4e24de85d348f48f8a1c752bb">fors_header_write_int</a>(qclist, cpl_table_get_nrow(restab) -
-<a name="l01904"></a>01904                                          cpl_table_count_invalid(restab, 
-<a name="l01905"></a>01905                                                                  <span class="stringliteral">"resolution"</span>),
-<a name="l01906"></a>01906                                          keyname,
-<a name="l01907"></a>01907                                          NULL,
-<a name="l01908"></a>01908                                          <span class="stringliteral">"Number of examined wavelengths "</span>
-<a name="l01909"></a>01909                                          <span class="stringliteral">"for resolution computation"</span>)) {
-<a name="l01910"></a>01910                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write number of lines used "</span>
-<a name="l01911"></a>01911                                          <span class="stringliteral">"in spectral resolution computation "</span>
-<a name="l01912"></a>01912                                          <span class="stringliteral">"to QC log file"</span>);
-<a name="l01913"></a>01913                 }
-<a name="l01914"></a>01914 
-<a name="l01915"></a>01915                 keyname = <span class="stringliteral">"QC.PMOS.RESOLUTION.MEANRMS"</span>;
-<a name="l01916"></a>01916                     
-<a name="l01917"></a>01917                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(qclist,
-<a name="l01918"></a>01918                                             cpl_table_get_column_mean(restab,
-<a name="l01919"></a>01919                                             <span class="stringliteral">"resolution_rms"</span>),
-<a name="l01920"></a>01920                                             keyname, NULL,
-<a name="l01921"></a>01921                                             <span class="stringliteral">"Mean error on spectral "</span>
-<a name="l01922"></a>01922                                             <span class="stringliteral">"resolution computation"</span>)) {
-<a name="l01923"></a>01923                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write mean error in "</span>
-<a name="l01924"></a>01924                                          <span class="stringliteral">"spectral resolution computation "</span>
-<a name="l01925"></a>01925                                          <span class="stringliteral">"to QC log file"</span>);
-<a name="l01926"></a>01926                 }
-<a name="l01927"></a>01927 
-<a name="l01928"></a>01928                 keyname = <span class="stringliteral">"QC.PMOS.RESOLUTION.NLINES"</span>;
-<a name="l01929"></a>01929 
-<a name="l01930"></a>01930                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g5add57d4e24de85d348f48f8a1c752bb">fors_header_write_int</a>(qclist,
-<a name="l01931"></a>01931                                          cpl_table_get_column_mean(restab, 
-<a name="l01932"></a>01932                                                                    <span class="stringliteral">"nlines"</span>) *
-<a name="l01933"></a>01933                                          cpl_table_get_nrow(restab),
-<a name="l01934"></a>01934                                          keyname, NULL,
-<a name="l01935"></a>01935                                          <span class="stringliteral">"Number of lines for spectral "</span>
-<a name="l01936"></a>01936                                          <span class="stringliteral">"resolution computation"</span>)) {
-<a name="l01937"></a>01937                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write number of examined "</span>
-<a name="l01938"></a>01938                                          <span class="stringliteral">"wavelengths in spectral resolution "</span>
-<a name="l01939"></a>01939                                          <span class="stringliteral">"computation to QC log file"</span>);
-<a name="l01940"></a>01940                 }
-<a name="l01941"></a>01941 
-<a name="l01942"></a>01942             }
-<a name="l01943"></a>01943 
-<a name="l01944"></a>01944             <span class="keywordflow">if</span> (!j) {
-<a name="l01945"></a>01945                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist, 
-<a name="l01946"></a>01946                                        spectral_resolution_tag,
-<a name="l01947"></a>01947                                        recipe, version)) {
-<a name="l01948"></a>01948                     fors_pmos_calib_exit(NULL);
-<a name="l01949"></a>01949                 }
-<a name="l01950"></a>01950             }
-<a name="l01951"></a>01951 
-<a name="l01952"></a>01952             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01953"></a>01953 
-<a name="l01954"></a>01954             <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01955"></a>01955                 cpl_propertylist_delete(header);
-<a name="l01956"></a>01956                 header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01957"></a>01957             }
-<a name="l01958"></a>01958 
-<a name="l01959"></a>01959             cpl_propertylist_append(header, qclist);
-<a name="l01960"></a>01960 
-<a name="l01961"></a>01961             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">dfs_save_table_ext</a>(restab, spectral_resolution_tag, header)) {
-<a name="l01962"></a>01962                 fors_pmos_calib_exit(NULL);
-<a name="l01963"></a>01963             }
-<a name="l01964"></a>01964 
-<a name="l01965"></a>01965             cpl_table_delete(restab); restab = NULL;
-<a name="l01966"></a>01966             cpl_propertylist_delete(qclist); qclist = NULL;
-<a name="l01967"></a>01967             cpl_propertylist_delete(header); header = NULL;
-<a name="l01968"></a>01968 
-<a name="l01969"></a>01969         }
-<a name="l01970"></a>01970         <span class="keywordflow">else</span>
-<a name="l01971"></a>01971             fors_pmos_calib_exit(<span class="stringliteral">"Cannot compute the spectral "</span>
-<a name="l01972"></a>01972                                  <span class="stringliteral">"resolution table"</span>);
-<a name="l01973"></a>01973 
-<a name="l01974"></a>01974         <span class="keywordflow">if</span> (!j) {
-<a name="l01975"></a>01975             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist, disp_coeff_tag,
-<a name="l01976"></a>01976                                    recipe, version)) {
-<a name="l01977"></a>01977                 fors_pmos_calib_exit(NULL);
-<a name="l01978"></a>01978             }
-<a name="l01979"></a>01979         }
-<a name="l01980"></a>01980 
-<a name="l01981"></a>01981         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01982"></a>01982 
-<a name="l01983"></a>01983         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01984"></a>01984             cpl_propertylist_delete(header);
-<a name="l01985"></a>01985             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01986"></a>01986         }
-<a name="l01987"></a>01987 
-<a name="l01988"></a>01988         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">dfs_save_table_ext</a>(idscoeff, disp_coeff_tag, header)) {
-<a name="l01989"></a>01989             fors_pmos_calib_exit(NULL);
-<a name="l01990"></a>01990         }
-<a name="l01991"></a>01991 
-<a name="l01992"></a>01992         cpl_propertylist_delete(header);
-<a name="l01993"></a>01993 
-<a name="l01994"></a>01994         <span class="keywordflow">if</span> (!j) {
-<a name="l01995"></a>01995             mapped_flat = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(rect_flat, reference,
-<a name="l01996"></a>01996                                                      startwavelength, 
-<a name="l01997"></a>01997                                                      endwavelength,
-<a name="l01998"></a>01998                                                      dispersion, idscoeff, 0);
-<a name="l01999"></a>01999 
-<a name="l02000"></a>02000             mapped_nflat = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(rect_nflat, reference,
-<a name="l02001"></a>02001                                                       startwavelength, 
-<a name="l02002"></a>02002                                                       endwavelength,
-<a name="l02003"></a>02003                                                       dispersion, idscoeff, 0);
-<a name="l02004"></a>02004 
-<a name="l02005"></a>02005             cpl_image_delete(rect_flat); rect_flat = NULL;
-<a name="l02006"></a>02006             cpl_image_delete(rect_nflat); rect_nflat = NULL;
-<a name="l02007"></a>02007         }
-<a name="l02008"></a>02008 
-<a name="l02009"></a>02009         <span class="comment">/* Global removed */</span>
-<a name="l02010"></a>02010 
-<a name="l02011"></a>02011         cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l02012"></a>02012 
-<a name="l02013"></a>02013         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l02014"></a>02014 
-<a name="l02015"></a>02015         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l02016"></a>02016             cpl_propertylist_delete(header);
-<a name="l02017"></a>02017             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l02018"></a>02018         }
-<a name="l02019"></a>02019 
-<a name="l02020"></a>02020         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l02021"></a>02021         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02022"></a>02022         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l02023"></a>02023                                        startwavelength + dispersion/2);
-<a name="l02024"></a>02024         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02025"></a>02025         <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l02026"></a>02026 <span class="comment">           cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l02027"></a>02027         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l02028"></a>02028         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02029"></a>02029         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02030"></a>02030         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02031"></a>02031         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02032"></a>02032         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02033"></a>02033         cpl_propertylist_update_int(header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, 1);
-<a name="l02034"></a>02034 
-<a name="l02035"></a>02035         <span class="keywordflow">if</span> (!j) {
-<a name="l02036"></a>02036             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist, reduced_lamp_tag,
-<a name="l02037"></a>02037                                    recipe, version)) {
-<a name="l02038"></a>02038                 fors_pmos_calib_exit(NULL);
-<a name="l02039"></a>02039             }
-<a name="l02040"></a>02040         }
-<a name="l02041"></a>02041 
-<a name="l02042"></a>02042         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(rectified, reduced_lamp_tag, header)) {
-<a name="l02043"></a>02043             fors_pmos_calib_exit(NULL);
-<a name="l02044"></a>02044         }
-<a name="l02045"></a>02045 
-<a name="l02046"></a>02046         cpl_image_delete(rectified); rectified = NULL;
-<a name="l02047"></a>02047 
-<a name="l02048"></a>02048         cpl_propertylist_update_int(header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, nflats);
-<a name="l02049"></a>02049 
-<a name="l02050"></a>02050         <span class="keywordflow">if</span> (!j) {
-<a name="l02051"></a>02051             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped_flat, mapped_screen_flat_tag,
-<a name="l02052"></a>02052                                header, parlist, recipe, version))
-<a name="l02053"></a>02053                 fors_pmos_calib_exit(NULL);
-<a name="l02054"></a>02054             cpl_image_delete(mapped_flat); mapped_flat = NULL;
-<a name="l02055"></a>02055 
-<a name="l02056"></a>02056             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped_nflat, mapped_norm_flat_tag,
-<a name="l02057"></a>02057                                header, parlist, recipe, version))
-<a name="l02058"></a>02058                 fors_pmos_calib_exit(NULL);
-<a name="l02059"></a>02059             cpl_image_delete(mapped_nflat); mapped_nflat = NULL;
-<a name="l02060"></a>02060         }
-<a name="l02061"></a>02061 
-<a name="l02062"></a>02062         cpl_propertylist_delete(header); header = NULL;
-<a name="l02063"></a>02063 
-<a name="l02064"></a>02064         <span class="keywordflow">if</span> (check) {
-<a name="l02065"></a>02065             save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l02066"></a>02066             <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l02067"></a>02067                 cpl_propertylist_delete(save_header);
-<a name="l02068"></a>02068                 save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l02069"></a>02069             }
-<a name="l02070"></a>02070 
-<a name="l02071"></a>02071             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02072"></a>02072             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02073"></a>02073             <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span>
-<a name="l02074"></a>02074             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, 1.0);
-<a name="l02075"></a>02075             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02076"></a>02076             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02077"></a>02077             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02078"></a>02078             cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02079"></a>02079             cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02080"></a>02080 
-<a name="l02081"></a>02081             <span class="keywordflow">if</span> (!j) {
-<a name="l02082"></a>02082                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist, disp_residuals_tag,
-<a name="l02083"></a>02083                                        recipe, version)) {
-<a name="l02084"></a>02084                     fors_pmos_calib_exit(NULL);
-<a name="l02085"></a>02085                 }
-<a name="l02086"></a>02086             }
-<a name="l02087"></a>02087 
-<a name="l02088"></a>02088             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(residual, disp_residuals_tag, save_header)) {
-<a name="l02089"></a>02089                 fors_pmos_calib_exit(NULL);
-<a name="l02090"></a>02090             }
-<a name="l02091"></a>02091 
-<a name="l02092"></a>02092             cpl_image_delete(residual); residual = NULL;
-<a name="l02093"></a>02093             cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l02094"></a>02094         }
-<a name="l02095"></a>02095 
-<a name="l02096"></a>02096         wavemap = <a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(coordinate, rainbow, slits, polytraces, 
-<a name="l02097"></a>02097                                       reference, startwavelength, endwavelength, 
-<a name="l02098"></a>02098                                       dispersion);
-<a name="l02099"></a>02099 
-<a name="l02100"></a>02100         cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l02101"></a>02101 
-<a name="l02102"></a>02102         save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l02103"></a>02103 
-<a name="l02104"></a>02104         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l02105"></a>02105             cpl_propertylist_delete(save_header);
-<a name="l02106"></a>02106             save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l02107"></a>02107         }
-<a name="l02108"></a>02108 
-<a name="l02109"></a>02109         <span class="keywordflow">if</span> (qc) {
-<a name="l02110"></a>02110 
-<a name="l02111"></a>02111             <span class="comment">/*</span>
-<a name="l02112"></a>02112 <span class="comment">             * QC1 parameters</span>
-<a name="l02113"></a>02113 <span class="comment">             */</span>
-<a name="l02114"></a>02114             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(save_header,
-<a name="l02115"></a>02115                                          <span class="stringliteral">"QC.DID"</span>,
-<a name="l02116"></a>02116                                          <span class="stringliteral">"2.0"</span>,
-<a name="l02117"></a>02117                                          <span class="stringliteral">"QC1 dictionary"</span>)) {
-<a name="l02118"></a>02118                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span>
-<a name="l02119"></a>02119                                      <span class="stringliteral">"to QC log file"</span>);
-<a name="l02120"></a>02120             }
-<a name="l02121"></a>02121 
-<a name="l02122"></a>02122             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(save_header,
-<a name="l02123"></a>02123                                         mean_rms,
-<a name="l02124"></a>02124                                         <span class="stringliteral">"QC.WAVE.ACCURACY"</span>,
-<a name="l02125"></a>02125                                         <span class="stringliteral">"pixel"</span>,
-<a name="l02126"></a>02126                                         <span class="stringliteral">"Mean accuracy of wavecalib model"</span>)) {
-<a name="l02127"></a>02127                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot write mean wavelength calibration "</span>
-<a name="l02128"></a>02128                                      <span class="stringliteral">"accuracy to QC log file"</span>);
-<a name="l02129"></a>02129             }
-<a name="l02130"></a>02130 
-<a name="l02131"></a>02131 
-<a name="l02132"></a>02132             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(save_header,
-<a name="l02133"></a>02133                                         mean_rms_err,
-<a name="l02134"></a>02134                                         <span class="stringliteral">"QC.WAVE.ACCURACY.ERROR"</span>,
-<a name="l02135"></a>02135                                         <span class="stringliteral">"pixel"</span>,
-<a name="l02136"></a>02136                                         <span class="stringliteral">"Error on accuracy of wavecalib model"</span>)) {
-<a name="l02137"></a>02137                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot write error on wavelength "</span>
-<a name="l02138"></a>02138                                      <span class="stringliteral">"calibration accuracy to QC log file"</span>);
-<a name="l02139"></a>02139             }
-<a name="l02140"></a>02140 
-<a name="l02141"></a>02141             <span class="keywordflow">if</span> (same_offset && fabs(mxpos) < 0.05) { 
-<a name="l02142"></a>02142                                              <span class="comment">/* Only if same offset is 0.0 */</span>
-<a name="l02143"></a>02143 
-<a name="l02144"></a>02144                 data = cpl_image_get_data(wavemap);
-<a name="l02145"></a>02145 
-<a name="l02146"></a>02146                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(save_header,
-<a name="l02147"></a>02147                                            data[nx/2 + ccd_ysize*nx/2],
-<a name="l02148"></a>02148                                            <span class="stringliteral">"QC.PMOS.CENTRAL.WAVELENGTH"</span>,
-<a name="l02149"></a>02149                                            <span class="stringliteral">"Angstrom"</span>,
-<a name="l02150"></a>02150                                            <span class="stringliteral">"Wavelength at CCD center"</span>)) {
-<a name="l02151"></a>02151                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write central wavelength "</span>
-<a name="l02152"></a>02152                                          <span class="stringliteral">"to QC log file"</span>);
-<a name="l02153"></a>02153                 }
-<a name="l02154"></a>02154             }
-<a name="l02155"></a>02155 
-<a name="l02156"></a>02156         }
-<a name="l02157"></a>02157 
-<a name="l02158"></a>02158         <span class="keywordflow">if</span> (!j) {
-<a name="l02159"></a>02159             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist, wavelength_map_tag,
-<a name="l02160"></a>02160                                    recipe, version)) {
-<a name="l02161"></a>02161                 fors_pmos_calib_exit(NULL);
-<a name="l02162"></a>02162             }
-<a name="l02163"></a>02163         }
-<a name="l02164"></a>02164 
-<a name="l02165"></a>02165         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(wavemap, wavelength_map_tag, save_header)) {
-<a name="l02166"></a>02166             fors_pmos_calib_exit(NULL);
-<a name="l02167"></a>02167         }
-<a name="l02168"></a>02168 
-<a name="l02169"></a>02169         cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l02170"></a>02170 
-<a name="l02171"></a>02171         cpl_propertylist_erase_regexp(save_header, <span class="stringliteral">"^ESO QC "</span>, 0);
-<a name="l02172"></a>02172 
-<a name="l02173"></a>02173         cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l02174"></a>02174 
-<a name="l02175"></a>02175         cpl_msg_indent_less();
-<a name="l02176"></a>02176 
-<a name="l02177"></a>02177     }
-<a name="l02178"></a>02178 
-<a name="l02179"></a>02179     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, coordinate, spatial_map_tag, save_header,
-<a name="l02180"></a>02180                        parlist, recipe, version))
-<a name="l02181"></a>02181         fors_pmos_calib_exit(NULL);
-<a name="l02182"></a>02182 
-<a name="l02183"></a>02183     cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l02184"></a>02184     cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l02185"></a>02185 
-<a name="l02186"></a>02186     header = NULL;
-<a name="l02187"></a>02187 
-<a name="l02188"></a>02188     <span class="keywordflow">if</span> (qc) {
-<a name="l02189"></a>02189 
-<a name="l02190"></a>02190         <span class="keywordtype">double</span> maxpos, maxneg, maxcurve, maxslope;
-<a name="l02191"></a>02191 
-<a name="l02192"></a>02192         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l02193"></a>02193 
-<a name="l02194"></a>02194         <span class="comment">/*</span>
-<a name="l02195"></a>02195 <span class="comment">         * QC1 parameters</span>
-<a name="l02196"></a>02196 <span class="comment">         */</span>
-<a name="l02197"></a>02197         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a>(header,
-<a name="l02198"></a>02198                                      <span class="stringliteral">"QC.DID"</span>,
-<a name="l02199"></a>02199                                      <span class="stringliteral">"2.0"</span>,
-<a name="l02200"></a>02200                                      <span class="stringliteral">"QC1 dictionary"</span>)) {
-<a name="l02201"></a>02201             fors_pmos_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span>
-<a name="l02202"></a>02202                                  <span class="stringliteral">"to QC log file"</span>);
-<a name="l02203"></a>02203         }
-<a name="l02204"></a>02204 
-<a name="l02205"></a>02205         maxpos = fabs(cpl_table_get_column_max(polytraces, <span class="stringliteral">"c2"</span>));
-<a name="l02206"></a>02206         maxneg = fabs(cpl_table_get_column_min(polytraces, <span class="stringliteral">"c2"</span>));
-<a name="l02207"></a>02207         maxcurve = maxpos > maxneg ? maxpos : maxneg;
-<a name="l02208"></a>02208         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(header,
-<a name="l02209"></a>02209                                    maxcurve,
-<a name="l02210"></a>02210                                    <span class="stringliteral">"QC.TRACE.MAX.CURVATURE"</span>,
-<a name="l02211"></a>02211                                    <span class="stringliteral">"Y pixel / X pixel ^2"</span>,
-<a name="l02212"></a>02212                                    <span class="stringliteral">"Max observed curvature "</span>
-<a name="l02213"></a>02213                                    <span class="stringliteral">"in spectral tracing"</span>)) {
-<a name="l02214"></a>02214             fors_pmos_calib_exit(<span class="stringliteral">"Cannot write max observed curvature in "</span>
-<a name="l02215"></a>02215                                  <span class="stringliteral">"spectral tracing to QC log file"</span>);
-<a name="l02216"></a>02216         }
-<a name="l02217"></a>02217 
-<a name="l02218"></a>02218         maxpos = fabs(cpl_table_get_column_max(polytraces, <span class="stringliteral">"c1"</span>));
-<a name="l02219"></a>02219         maxneg = fabs(cpl_table_get_column_min(polytraces, <span class="stringliteral">"c1"</span>));
-<a name="l02220"></a>02220         maxslope = maxpos > maxneg ? maxpos : maxneg;
-<a name="l02221"></a>02221 
-<a name="l02222"></a>02222         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a>(header,
-<a name="l02223"></a>02223                                    maxslope,
-<a name="l02224"></a>02224                                    <span class="stringliteral">"QC.TRACE.MAX.SLOPE"</span>,
-<a name="l02225"></a>02225                                    <span class="stringliteral">"Y pixel / X pixel"</span>,
-<a name="l02226"></a>02226                                    <span class="stringliteral">"Max observed slope in spectral tracing"</span>)) {
-<a name="l02227"></a>02227             fors_pmos_calib_exit(<span class="stringliteral">"Cannot write max observed slope in spectral "</span>
-<a name="l02228"></a>02228                                  <span class="stringliteral">"tracing to QC log file"</span>);
-<a name="l02229"></a>02229         }
-<a name="l02230"></a>02230     }
-<a name="l02231"></a>02231 
-<a name="l02232"></a>02232     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, polytraces, curv_coeff_tag, header,
-<a name="l02233"></a>02233                        parlist, recipe, version)) {
-<a name="l02234"></a>02234         fors_pmos_calib_exit(NULL);
-<a name="l02235"></a>02235     }
-<a name="l02236"></a>02236 
-<a name="l02237"></a>02237     cpl_propertylist_delete(header); header = NULL;
-<a name="l02238"></a>02238     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l02239"></a>02239 
-<a name="l02240"></a>02240     <span class="comment">/* FIXLANDER It was slit_ident == 0 and </span>
-<a name="l02241"></a>02241 <span class="comment">       it was in a different place above in the code */</span>
-<a name="l02242"></a>02242 
-<a name="l02243"></a>02243     <span class="keywordflow">if</span> (same_offset) {
-<a name="l02244"></a>02244         cpl_table *globaltbl;
-<a name="l02245"></a>02245         cpl_table *slitpos;
-<a name="l02246"></a>02246         <span class="keywordtype">double</span>    *l_ytop;
-<a name="l02247"></a>02247         <span class="keywordtype">int</span>       *l_id;
-<a name="l02248"></a>02248         <span class="keywordtype">int</span>        npairs;
-<a name="l02249"></a>02249         <span class="keywordtype">double</span>    *ytop   = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);
-<a name="l02250"></a>02250         <span class="keywordtype">double</span>    *ybot   = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);
-<a name="l02251"></a>02251         <span class="keywordtype">int</span>        k;
-<a name="l02252"></a>02252 <span class="comment">// int    *p_id;</span>
-<a name="l02253"></a>02253 
-<a name="l02254"></a>02254         <span class="comment">/* Just in case it has been modified */</span>
-<a name="l02255"></a>02255         nslits = cpl_table_get_nrow(slits);
-<a name="l02256"></a>02256 
-<a name="l02257"></a>02257         cpl_table_new_column(slits, <span class="stringliteral">"pair_id"</span>, CPL_TYPE_INT);
-<a name="l02258"></a>02258 <span class="comment">// p_id   = cpl_table_get_data_int(slits, "pair_id");</span>
-<a name="l02259"></a>02259 
-<a name="l02260"></a>02260         <span class="keywordflow">if</span> (ccd_ysize == 400 || ccd_ysize == 500) {
-<a name="l02261"></a>02261             
-<a name="l02262"></a>02262             <span class="comment">/*</span>
-<a name="l02263"></a>02263 <span class="comment">             * Special case with old FORS1 chip</span>
-<a name="l02264"></a>02264 <span class="comment">             */</span>
-<a name="l02265"></a>02265 
-<a name="l02266"></a>02266             l_ytop = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l02267"></a>02267             l_ytop[0] = 255.0;
-<a name="l02268"></a>02268             l_id = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l02269"></a>02269             l_id[0] = 10;
-<a name="l02270"></a>02270             npairs = 1;
-<a name="l02271"></a>02271         }
-<a name="l02272"></a>02272         <span class="keywordflow">else</span> {
-<a name="l02273"></a>02273             globaltbl = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, master_distortion_tag, 1);
-<a name="l02274"></a>02274             slitpos = <a class="code" href="group__moses.html#g39dd696d6572e52031e12b1a53e505c2">mos_build_slit_location</a>(globaltbl, maskslits, ccd_ysize);
-<a name="l02275"></a>02275             l_ytop = cpl_table_get_data_double(slitpos, <span class="stringliteral">"ytop"</span>);
-<a name="l02276"></a>02276             l_id   = cpl_table_get_data_int(slitpos, <span class="stringliteral">"slit_id"</span>);
-<a name="l02277"></a>02277             npairs = cpl_table_get_nrow(slitpos);
-<a name="l02278"></a>02278             <span class="keywordflow">if</span> (rebin_dist != rebin) {
-<a name="l02279"></a>02279                 <span class="keywordtype">float</span> rescale = (float)rebin_dist / rebin;
-<a name="l02280"></a>02280                 <span class="keywordflow">for</span> (i = 0; i < npairs; i++) {
-<a name="l02281"></a>02281                    l_ytop[i] *= rescale;
-<a name="l02282"></a>02282                 }
-<a name="l02283"></a>02283             }
-<a name="l02284"></a>02284         }
-<a name="l02285"></a>02285 
-<a name="l02286"></a>02286         <span class="keywordflow">for</span> (k = 0; k < npairs; k++) {
-<a name="l02287"></a>02287             <span class="keywordtype">int</span> h;
-<a name="l02288"></a>02288 
-<a name="l02289"></a>02289             <span class="keywordflow">for</span> (h = 0; h < nslits; h++) {
-<a name="l02290"></a>02290 
-<a name="l02291"></a>02291                 <span class="keywordflow">if</span> (l_ytop[k] < ytop[h] && l_ytop[k] > ybot[h]) {
-<a name="l02292"></a>02292                     <span class="keywordflow">if</span> (h + 1 < nslits) {
-<a name="l02293"></a>02293                         cpl_table_set_int(slits, <span class="stringliteral">"pair_id"</span>, h, l_id[k]);
-<a name="l02294"></a>02294                         cpl_table_set_int(slits, <span class="stringliteral">"pair_id"</span>, h + 1, l_id[k]);
-<a name="l02295"></a>02295                     }
-<a name="l02296"></a>02296                 }
-<a name="l02297"></a>02297             }
-<a name="l02298"></a>02298         }
-<a name="l02299"></a>02299 
-<a name="l02300"></a>02300 <span class="comment">/* %%% */</span>
-<a name="l02301"></a>02301 
-<a name="l02302"></a>02302         cpl_table_fill_invalid_int(slits, <span class="stringliteral">"pair_id"</span>, -1);
-<a name="l02303"></a>02303 
-<a name="l02304"></a>02304         <span class="keywordflow">if</span> (ccd_ysize == 400 || ccd_ysize == 500) {
-<a name="l02305"></a>02305             cpl_free(l_ytop);
-<a name="l02306"></a>02306             cpl_free(l_id);
-<a name="l02307"></a>02307         }
-<a name="l02308"></a>02308         <span class="keywordflow">else</span> {
-<a name="l02309"></a>02309             cpl_table_delete(slitpos);   slitpos   = NULL;
-<a name="l02310"></a>02310             cpl_table_delete(globaltbl); globaltbl = NULL;
-<a name="l02311"></a>02311     
-<a name="l02312"></a>02312             cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l02313"></a>02313         }
-<a name="l02314"></a>02314     }
-<a name="l02315"></a>02315 
-<a name="l02316"></a>02316     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,
-<a name="l02317"></a>02317                        parlist, recipe, version)) {
-<a name="l02318"></a>02318         fors_pmos_calib_exit(NULL);
-<a name="l02319"></a>02319     }
-<a name="l02320"></a>02320 
-<a name="l02321"></a>02321     cpl_table_delete(slits); slits = NULL;
-<a name="l02322"></a>02322 
-<a name="l02323"></a>02323     cpl_image_delete(spatial); spatial = NULL;
-<a name="l02324"></a>02324 
-<a name="l02325"></a>02325     cpl_free(instrume); instrume = NULL;
-<a name="l02326"></a>02326 
-<a name="l02327"></a>02327     cpl_table_delete(overscans); overscans = NULL;
-<a name="l02328"></a>02328     cpl_image_delete(master_bias); master_bias = NULL;
-<a name="l02329"></a>02329     cpl_image_delete(master_flat); master_flat = NULL;
-<a name="l02330"></a>02330 
-<a name="l02331"></a>02331     cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l02332"></a>02332     cpl_vector_delete(lines); lines = NULL;
-<a name="l02333"></a>02333 
-<a name="l02334"></a>02334     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l02335"></a>02335         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l02336"></a>02336         fors_pmos_calib_exit(NULL);
-<a name="l02337"></a>02337     }
-<a name="l02338"></a>02338 
-<a name="l02339"></a>02339     <span class="keywordflow">return</span> 0;
-<a name="l02340"></a>02340 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__pmos__calib_8c_source.html b/html/fors__pmos__calib_8c_source.html
new file mode 100644
index 0000000..d3c402b
--- /dev/null
+++ b/html/fors__pmos__calib_8c_source.html
@@ -0,0 +1,2356 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_pmos_calib.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_pmos_calib.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_pmos_calib.c,v 1.42 2013-10-09 15:59:38 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-09 15:59:38 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.42 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <ctype.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_stack.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_header.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#define OFFSET    50</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor"></span><span class="preprocessor">#define TOLERANCE 10</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_create(cpl_plugin *);</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_pmos_calib_description[] =</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"This recipe is used to identify reference lines on PMOS arc lamp\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"exposures, and trace the spectral edges on the corresponding flat field\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"exposures. This information is used to determine the spectral extraction\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"mask to be applied in the scientific data reduction, performed with the\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"recipe fors_science.\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. The input arc lamps and\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"flat field exposures are assumed to be obtained quasi-simultaneously, so\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"that they would be described by exactly the same instrument distortions.\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"A line catalog must be specified, containing the wavelengths of the\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"reference arc lamp lines used for the wavelength calibration. A grism\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"table (typically depending on the instrument mode, and in particular on\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"the grism used) may also be specified: this table contains a default\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"recipe parameter setting to control the way spectra are extracted for\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"a specific instrument mode, as it is used for automatic run of the\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"pipeline on Paranal and in Garching. If this table is specified, it\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"will modify the default recipe parameter setting, with the exception of\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"those parameters which have been explicitly modifyed on the command line.\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"If a grism table is not specified, the input recipe parameters values\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"will always be read from the command line, or from an esorex configuration\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"file if present, or from their generic default values (that are rarely\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"meaningful). Finally a master bias frame must be input to this recipe.\n"</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"The products SPECTRA_DETECTION_PMOS, SLIT_MAP_PMOS, and DISP_RESIDUALS_PMOS,\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"are just created if the --check parameter is set to true.\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"The MASTER_DISTORTION_TABLE is marked as required, but it is not so if all\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"slits have different offsets, and in the case of FORS1 observations made\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"with the old TK2048EB4-1 1604 chip read in windowed mode (2048x400)\n\n"</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"  DO category:              Type:       Explanation:          Required:\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="stringliteral">"  SCREEN_FLAT_PMOS          Raw         Flat field exposures     Y\n"</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="stringliteral">"  LAMP_PMOS                 Raw         Arc lamp exposure        Y\n"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="stringliteral">"  MASTER_BIAS or BIAS       Calib       Bias frame               Y\n"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"  MASTER_LINECAT            Calib       Line catalog             Y\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"  GRISM_TABLE               Calib       Grism table              .\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="stringliteral">"  MASTER_DISTORTION_TABLE   Calib       Master distortions table Y\n\n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="stringliteral">"Output files:\n\n"</span> </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="stringliteral">"  DO category:              Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="stringliteral">"  MASTER_SCREEN_FLAT_PMOS   FITS image  Combined (sum) flat field\n"</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="stringliteral">"  MASTER_NORM_FLAT_PMOS     FITS image  Normalised flat field\n"</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="stringliteral">"  MAPPED_SCREEN_FLAT_PMOS   FITS image  Wavelength calibrated flat field\n"</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="stringliteral">"  MAPPED_NORM_FLAT_PMOS     FITS image  Wavelength calibrated normalised flat\n"</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="stringliteral">"  REDUCED_LAMP_PMOS         FITS image  Wavelength calibrated arc spectrum\n"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="stringliteral">"  DISP_COEFF_PMOS           FITS table  Inverse dispersion coefficients\n"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="stringliteral">"  DISP_RESIDUALS_PMOS       FITS image  Residuals in wavelength calibration\n"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="stringliteral">"  DISP_RESIDUALS_TABLE_PMOS FITS table  Residuals in wavelength calibration\n"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="stringliteral">"  DELTA_IMAGE_PMOS          FITS image  Offset vs linear wavelength calib\n"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"  WAVELENGTH_MAP_PMOS       FITS image  Wavelength for each pixel on CCD\n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"  SPECTRA_DETECTION_PMOS    FITS image  Check for preliminary detection\n"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="stringliteral">"  SLIT_MAP_PMOS             FITS image  Map of central wavelength on CCD\n"</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="stringliteral">"  CURV_TRACES_PMOS          FITS table  Spectral curvature traces\n"</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="stringliteral">"  CURV_COEFF_PMOS           FITS table  Spectral curvature coefficients\n"</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="stringliteral">"  SPATIAL_MAP_PMOS          FITS image  Spatial position along slit on CCD\n"</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="stringliteral">"  SPECTRAL_RESOLUTION_PMOS  FITS table  Resolution at reference arc lines\n"</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="stringliteral">"  SLIT_LOCATION_PMOS        FITS table  Slits on product frames and CCD\n\n"</span>;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">#define fors_pmos_calib_exit(message)              \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">cpl_free(instrume);                           \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">cpl_free(fiterror);                           \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">cpl_free(fitlines);                           \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">cpl_image_delete(bias);                       \</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor">cpl_image_delete(master_bias);                \</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">cpl_image_delete(checkwave);                  \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">cpl_image_delete(flat);                       \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">cpl_image_delete(master_flat);                \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">cpl_image_delete(added_flat);                 \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor">cpl_image_delete(mapped_flat);                \</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="preprocessor">cpl_image_delete(mapped_nflat);               \</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor">cpl_image_delete(residual);                   \</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor">cpl_image_delete(smo_flat);                   \</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor">cpl_image_delete(spatial);                    \</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor">cpl_image_delete(delta);                      \</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="preprocessor">cpl_image_delete(rect_flat);                  \</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="preprocessor">cpl_image_delete(rect_nflat);                 \</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="preprocessor">cpl_image_delete(mapped_flat);                \</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="preprocessor">cpl_image_delete(mapped_nflat);               \</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="preprocessor">cpl_mask_delete(refmask);                     \</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="preprocessor">cpl_propertylist_delete(qclist);              \</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="preprocessor">cpl_table_delete(idscoeff_all);               \</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="preprocessor">cpl_table_delete(restable);                   \</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="preprocessor">cpl_table_delete(traces);                     \</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="preprocessor">cpl_table_delete(restab);                     \</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="preprocessor">cpl_table_delete(global);                     \</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="preprocessor">#define fors_pmos_calib_exit_memcheck(message)       \</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="preprocessor">printf("free instrume (%p)\n", instrume);       \</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="preprocessor">cpl_free(instrume);                             \</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="preprocessor">printf("free pipefile (%p)\n", pipefile);       \</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="preprocessor">cpl_free(pipefile);                             \</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="preprocessor">printf("free fiterror (%p)\n", fiterror);       \</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="preprocessor">cpl_free(fiterror);                             \</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="preprocessor">printf("free fitlines (%p)\n", fitlines);       \</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="preprocessor">cpl_free(fitlines);                             \</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="preprocessor">printf("free bias (%p)\n", bias);               \</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="preprocessor">cpl_image_delete(bias);                         \</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor">printf("free master_bias (%p)\n", master_bias); \</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="preprocessor">cpl_image_delete(master_bias);                  \</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);   \</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor">cpl_image_delete(coordinate);                   \</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="preprocessor">printf("free checkwave (%p)\n", checkwave);     \</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="preprocessor">cpl_image_delete(checkwave);                    \</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="preprocessor">printf("free flat (%p)\n", flat);               \</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="preprocessor">cpl_image_delete(flat);                         \</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="preprocessor">printf("free master_flat (%p)\n", master_flat); \</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor">cpl_image_delete(master_flat);                  \</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="preprocessor">printf("free norm_flat (%p)\n", norm_flat);     \</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="preprocessor">cpl_image_delete(norm_flat);                    \</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="preprocessor">printf("free mapped_flat (%p)\n", mapped_flat); \</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="preprocessor">cpl_image_delete(mapped_flat);                  \</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="preprocessor">printf("free mapped_nflat (%p)\n", mapped_nflat); \</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="preprocessor">cpl_image_delete(mapped_nflat);                 \</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);         \</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="preprocessor">cpl_image_delete(rainbow);                      \</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="preprocessor">printf("free rectified (%p)\n", rectified);     \</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="preprocessor">cpl_image_delete(rectified);                    \</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="preprocessor">printf("free residual (%p)\n", residual);       \</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="preprocessor">cpl_image_delete(residual);                     \</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="preprocessor">printf("free smo_flat (%p)\n", smo_flat);       \</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="preprocessor">cpl_image_delete(smo_flat);                     \</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="preprocessor">printf("free spatial (%p)\n", spatial);         \</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="preprocessor">cpl_image_delete(spatial);                      \</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="preprocessor">cpl_image_delete(spectra);                      \</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);         \</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="preprocessor">cpl_image_delete(wavemap);                      \</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="preprocessor">printf("free delta (%p)\n", delta);             \</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="preprocessor">cpl_image_delete(delta);                        \</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="preprocessor">printf("free rect_flat (%p)\n", rect_flat);     \</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="preprocessor">cpl_image_delete(rect_flat);                    \</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="preprocessor">printf("free rect_nflat (%p)\n", rect_nflat);   \</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="preprocessor">cpl_image_delete(rect_nflat);                   \</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="preprocessor">printf("free refmask (%p)\n", refmask);         \</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="preprocessor">cpl_mask_delete(refmask);                       \</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="preprocessor">printf("free save_header (%p)\n", save_header); \</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> <span class="preprocessor">cpl_propertylist_delete(save_header);           \</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="preprocessor">printf("free qclist (%p)\n", qclist);           \</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <span class="preprocessor">cpl_propertylist_delete(qclist);                \</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> <span class="preprocessor">cpl_table_delete(grism_table);                  \</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);       \</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="preprocessor">cpl_table_delete(idscoeff);                     \</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="preprocessor">printf("free idscoeff_all (%p)\n", idscoeff_all);  \</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="preprocessor">cpl_table_delete(idscoeff_all);                 \</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="preprocessor">printf("free restable (%p)\n", restable);       \</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="preprocessor">cpl_table_delete(restable);                     \</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="preprocessor">cpl_table_delete(maskslits);                    \</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> <span class="preprocessor">printf("free overscans (%p)\n", overscans);     \</span></div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> <span class="preprocessor">cpl_table_delete(overscans);                    \</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> <span class="preprocessor">printf("free traces (%p)\n", traces);           \</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> <span class="preprocessor">cpl_table_delete(traces);                       \</span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span></div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> <span class="preprocessor">cpl_table_delete(polytraces);                   \</span></div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> <span class="preprocessor">cpl_table_delete(slits);                        \</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="preprocessor">printf("free restab (%p)\n", restab);           \</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> <span class="preprocessor">cpl_table_delete(restab);                       \</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="preprocessor">printf("free global (%p)\n", global);           \</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="preprocessor">cpl_table_delete(global);                       \</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths); \</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <span class="preprocessor">cpl_table_delete(wavelengths);                  \</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> <span class="preprocessor">printf("free lines (%p)\n", lines);             \</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="preprocessor">cpl_vector_delete(lines);                       \</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> {</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                     <span class="stringliteral">"fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                     <span class="stringliteral">"Determination of the extraction mask"</span>,</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                     fors_pmos_calib_description,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>                     fors_pmos_calib_create,</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>                     fors_pmos_calib_exec,</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>                     fors_pmos_calib_destroy);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> }</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> </div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> {</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> </div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> </div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> </div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.dispersion"</span>,</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>                                 0.0);</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> <span class="comment">     * Peak detection level</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.peakdetection"</span>,</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>                                 0.0);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> <span class="comment">     * Degree of wavelength calibration polynomial</span></div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> </div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.wdegree"</span>,</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                                 0);</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> <span class="comment">     * Reference lines search radius</span></div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.wradius"</span>,</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span></div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                                 <span class="stringliteral">"with first-guess method"</span>,</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                                 4);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span></div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.wreject"</span>,</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>                                 <span class="stringliteral">"Rejection threshold in dispersion "</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>                                 <span class="stringliteral">"relation fit (pixel)"</span>,</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>                                 0.7);</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="comment">     * Line catalog table column containing the reference wavelengths</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.wcolumn"</span>,</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                                 <span class="stringliteral">"Name of line catalog table column "</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> <span class="comment">     * Degree of spectral curvature polynomial</span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.cdegree"</span>,</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                                 <span class="stringliteral">"Degree of spectral curvature polynomial"</span>,</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                                 0);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cdegree"</span>);</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> <span class="comment">     * Curvature solution interpolation</span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>  </div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.cmode"</span>,</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                                 <span class="stringliteral">"Interpolation mode of curvature solution "</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>                                 <span class="stringliteral">"(0 = no "</span></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                                 <span class="stringliteral">"interpolation, 1 = fill gaps, 2 = global "</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>                                 <span class="stringliteral">"model)"</span>,</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>                                 1);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cmode"</span>);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> </div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.startwavelength"</span>,</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>                                 0.0);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.endwavelength"</span>,</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>                                 0.0);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> <span class="comment">     * Flat field frames stack parameters</span></div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>  </div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     <a class="code" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15" title="Define recipe parameters.">fors_stack_define_parameters</a>(recipe->parameters, <span class="stringliteral">"fors.fors_pmos_calib"</span>, </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>                                  <span class="stringliteral">"average"</span>);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> <span class="comment">     * Degree of flat field fitting polynomial along dispersion direction</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> </div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.ddegree"</span>,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>                                 <span class="stringliteral">"Degree of flat field fitting polynomial "</span></div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>                                 <span class="stringliteral">"along dispersion direction"</span>,</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                                 -1);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ddegree"</span>);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> <span class="comment">     * Smooth box radius for flat field along dispersion direction</span></div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.dradius"</span>,</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>                                 <span class="stringliteral">"Smooth box radius for flat field along "</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>                                 <span class="stringliteral">"dispersion direction"</span>,</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                                 10);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dradius"</span>);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> <span class="comment">     * Computation of QC1 parameters</span></div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> </div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.qc"</span>,</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>                                 <span class="stringliteral">"Compute QC1 parameters"</span>,</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>                                 TRUE);</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"qc"</span>);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span> </div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> <span class="comment">     * Create check products</span></div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> </div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_calib.check"</span>,</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>                                 <span class="stringliteral">"Create intermediate products"</span>,</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>                                 <span class="stringliteral">"fors.fors_pmos_calib"</span>,</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                                 FALSE);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"check"</span>);</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> </div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span> }</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> </div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span> </div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> {</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     </div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     <span class="keywordflow">return</span> fors_pmos_calib(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> }</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> </div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> </div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> {</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     </div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> </div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> </div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> }</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span> </div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span> </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span> {</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_pmos_calib"</span>;</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> </div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span> </div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     <span class="keywordtype">double</span>      peakdetection;</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     <span class="keywordtype">int</span>         wdegree;</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <span class="keywordtype">int</span>         wradius;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordtype">double</span>      wreject;</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     <span class="keywordtype">int</span>         cdegree;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="keywordtype">int</span>         cmode;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordtype">int</span>         ddegree;</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="keywordtype">int</span>         dradius;</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     <span class="keywordtype">int</span>         qc;</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     <span class="keywordtype">int</span>         check;</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *stack_method;</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordtype">int</span>         min_reject;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     <span class="keywordtype">int</span>         max_reject;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     <span class="keywordtype">double</span>      klow;</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     <span class="keywordtype">double</span>      khigh;</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     <span class="keywordtype">int</span>         kiter;</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> </div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span> </div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     cpl_imagelist    *biases       = NULL;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     cpl_image        *bias         = NULL;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     cpl_image        *master_bias  = NULL;</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     cpl_image        *multi_bias   = NULL;</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     cpl_image        *flat         = NULL;</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     cpl_image        *master_flat  = NULL;</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     cpl_image        *added_flat   = NULL;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     cpl_image        *trace_flat   = NULL;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     cpl_image        *smo_flat     = NULL;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     cpl_image        *norm_flat    = NULL;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     cpl_image        *spectra      = NULL;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     cpl_image        *wavemap      = NULL;</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     cpl_image        *delta        = NULL;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     cpl_image        *residual     = NULL;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     cpl_image        *checkwave    = NULL;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     cpl_image        *rectified    = NULL;</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     cpl_image        *dummy        = NULL;</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>     cpl_image        *add_dummy    = NULL;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     cpl_image        *refimage     = NULL;</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     cpl_image        *coordinate   = NULL;</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     cpl_image        *rainbow      = NULL;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     cpl_image        *spatial      = NULL;</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     cpl_image        *rect_flat    = NULL;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     cpl_image        *rect_nflat   = NULL;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     cpl_image        *mapped_flat  = NULL;</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     cpl_image        *mapped_nflat = NULL;</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> </div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     cpl_mask         *refmask      = NULL;</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> </div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     cpl_table        *grism_table  = NULL;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     cpl_table        *overscans    = NULL;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     cpl_table        *wavelengths  = NULL;</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     cpl_table        *idscoeff     = NULL;</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     cpl_table        *idscoeff_all = NULL;</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     cpl_table        *restable     = NULL;</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     cpl_table        *slits        = NULL;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     cpl_table        *positions    = NULL;</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     cpl_table        *maskslits    = NULL;</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     cpl_table        *traces       = NULL;</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     cpl_table        *polytraces   = NULL;</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>     cpl_table        *restab       = NULL;</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     cpl_table        *global       = NULL;</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span> </div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     cpl_vector       *lines        = NULL;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span> </div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     cpl_propertylist *header_dist  = NULL;</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     cpl_propertylist *header       = NULL;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>     cpl_propertylist *save_header  = NULL;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     cpl_propertylist *qclist       = NULL;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span> </div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> </div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>     <span class="keywordtype">char</span>    version[80];</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *arc_tag;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *flat_tag;</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_screen_flat_tag;</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_norm_flat_tag;</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_lamp_tag;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_residuals_tag;</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_coeff_tag;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *wavelength_map_tag;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *spectra_detection_tag;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *spectral_resolution_tag;</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *slit_map_tag;</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *curv_traces_tag;</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *curv_coeff_tag;</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *spatial_map_tag;</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *slit_location_tag;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_distortion_tag = <span class="stringliteral">"MASTER_DISTORTION_TABLE"</span>;</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_residuals_table_tag;</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *delta_image_tag;</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_screen_flat_tag;</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_norm_flat_tag;</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *keyname;</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>     <span class="keywordtype">int</span>     pmos;</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     <span class="keywordtype">int</span>     same_offset = 0;</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     <span class="keywordtype">int</span>     nslits;</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     <span class="keywordtype">float</span>  *data;</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>     <span class="keywordtype">double</span> *xpos;</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     <span class="keywordtype">double</span>  mxpos;</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>     <span class="keywordtype">double</span>  mean_rms;</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     <span class="keywordtype">double</span>  mean_rms_err;</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     <span class="keywordtype">double</span>  alltime;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     <span class="keywordtype">int</span>     nflats;</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     <span class="keywordtype">int</span>     nbias;</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     <span class="keywordtype">int</span>     nlines;</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>     <span class="keywordtype">int</span>     rebin, rebin_dist;</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     <span class="keywordtype">double</span> *line;</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>     <span class="keywordtype">double</span> *fiterror = NULL;</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     <span class="keywordtype">int</span>    *fitlines = NULL;</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>     <span class="keywordtype">int</span>     nx, ny;</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     <span class="keywordtype">double</span>  reference;</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     <span class="keywordtype">double</span>  gain;</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>     <span class="keywordtype">int</span>     ccd_ysize;</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     <span class="keywordtype">int</span>     i, j;</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> </div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     <span class="keywordtype">char</span>   *instrume = NULL;</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span> </div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span> <span class="comment">     * Variables just related to bagoo</span></div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> </div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     <span class="keywordtype">int</span>     bagoo = 0;</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     <span class="keywordtype">int</span>     doit = 0;</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     <span class="keywordtype">double</span>  blevel = 0.0;</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     <span class="keywordtype">double</span>  ron = 0.0;</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> </div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> </div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span> </div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     <a class="code" href="group__forsdfs.html#ga5162766f25e67bb99869e7959c3f8201" title="Set the group as RAW or CALIB in a frameset.">fors_dfs_set_groups</a>(frameset);</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span> </div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span> </div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>         fors_pmos_calib_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> </div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> </div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>                     <span class="stringliteral">"fors.fors_pmos_calib.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span> </div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>         fors_pmos_calib_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span> </div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     peakdetection = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>                     <span class="stringliteral">"fors.fors_pmos_calib.peakdetection"</span>, grism_table);</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     <span class="keywordflow">if</span> (peakdetection <= 0.0)</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>         fors_pmos_calib_exit(<span class="stringliteral">"Invalid peak detection level"</span>);</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span> </div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>     wdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>                     <span class="stringliteral">"fors.fors_pmos_calib.wdegree"</span>, grism_table);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span> </div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     <span class="keywordflow">if</span> (wdegree < 1)</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>         fors_pmos_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span> </div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>     <span class="keywordflow">if</span> (wdegree > 5)</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>         fors_pmos_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span> </div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>     wradius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>                                     <span class="stringliteral">"fors.fors_pmos_calib.wradius"</span>, NULL);</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span> </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>     <span class="keywordflow">if</span> (wradius < 0)</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>         fors_pmos_calib_exit(<span class="stringliteral">"Invalid search radius"</span>);</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> </div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     wreject = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>                                        <span class="stringliteral">"fors.fors_pmos_calib.wreject"</span>, NULL);</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span> </div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     <span class="keywordflow">if</span> (wreject <= 0.0)</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>         fors_pmos_calib_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span> </div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>                                        <span class="stringliteral">"fors.fors_pmos_calib.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span> </div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     cdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>                     <span class="stringliteral">"fors.fors_pmos_calib.cdegree"</span>, grism_table);</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span> </div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     <span class="keywordflow">if</span> (cdegree < 1)</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>         fors_pmos_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span> </div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>     <span class="keywordflow">if</span> (cdegree > 5)</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>         fors_pmos_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> </div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>     cmode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_pmos_calib.cmode"</span>, NULL);</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span> </div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     <span class="keywordflow">if</span> (cmode < 0 || cmode > 2)</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>         fors_pmos_calib_exit(<span class="stringliteral">"Invalid curvature solution interpolation mode"</span>);</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> </div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>                     <span class="stringliteral">"fors.fors_pmos_calib.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>             fors_pmos_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> </div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>                     <span class="stringliteral">"fors.fors_pmos_calib.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>             fors_pmos_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>             fors_pmos_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>     }</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> </div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>             fors_pmos_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span> </div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     stack_method = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist,</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>                                             <span class="stringliteral">"fors.fors_pmos_calib.stack_method"</span>,</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>                                             NULL);</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span> </div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"minmax"</span>) == 0) {</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>         min_reject = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>                                    <span class="stringliteral">"fors.fors_pmos_calib.minrejection"</span>, NULL);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>         <span class="keywordflow">if</span> (min_reject < 0)</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>             fors_pmos_calib_exit(<span class="stringliteral">"Invalid number of lower rejections"</span>);</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span> </div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>         max_reject = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>                                    <span class="stringliteral">"fors.fors_pmos_calib.maxrejection"</span>, NULL);</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>         <span class="keywordflow">if</span> (max_reject < 0)</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>             fors_pmos_calib_exit(<span class="stringliteral">"Invalid number of upper rejections"</span>);</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>     }</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span> </div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>     <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"ksigma"</span>) == 0) {</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>         klow  = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>                                          <span class="stringliteral">"fors.fors_pmos_calib.klow"</span>, NULL);</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>         <span class="keywordflow">if</span> (klow < 0.1)</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>             fors_pmos_calib_exit(<span class="stringliteral">"Invalid lower K-sigma"</span>);</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span> </div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>         khigh = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>                                          <span class="stringliteral">"fors.fors_pmos_calib.khigh"</span>, NULL);</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>         <span class="keywordflow">if</span> (khigh < 0.1)</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>             fors_pmos_calib_exit(<span class="stringliteral">"Invalid lower K-sigma"</span>);</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span> </div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>         kiter = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>                                       <span class="stringliteral">"fors.fors_pmos_calib.kiter"</span>, NULL);</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>         <span class="keywordflow">if</span> (kiter < 1)</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>             fors_pmos_calib_exit(<span class="stringliteral">"Invalid number of iterations"</span>);</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>     }</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span> </div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>     ddegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>                                     <span class="stringliteral">"fors.fors_pmos_calib.ddegree"</span>, NULL);</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     dradius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>                                     <span class="stringliteral">"fors.fors_pmos_calib.dradius"</span>, NULL);</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span> </div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     <span class="keywordflow">if</span> (dradius < 1)</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>         fors_pmos_calib_exit(<span class="stringliteral">"Invalid smoothing box radius"</span>);</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span> </div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>     qc = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_calib.qc"</span>, NULL);</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span> </div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>     check = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_calib.check"</span>, NULL);</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> </div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span> </div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>         fors_pmos_calib_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span> </div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span> </div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span> <span class="comment">     * Check input set-of-frames</span></div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span> </div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span> </div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     {</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>         cpl_frameset *subframeset = cpl_frameset_duplicate(frameset);</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>         cpl_frameset_erase(subframeset, <span class="stringliteral">"BIAS"</span>);</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>         cpl_frameset_erase(subframeset, <span class="stringliteral">"MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span> </div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>)) </div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>             fors_pmos_calib_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>     </div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO INS FILT1 ID"</span>)) </div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>             fors_pmos_calib_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>     </div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>)) </div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>             fors_pmos_calib_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span> </div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>         cpl_frameset_delete(subframeset);</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>     }</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span> </div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>     pmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_PMOS"</span>);</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span> </div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>     <span class="keywordflow">if</span> (pmos == 0)</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>         fors_pmos_calib_exit(<span class="stringliteral">"Missing input arc lamp frame"</span>);</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span> </div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>     <span class="keywordflow">if</span> (pmos) {</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>         cpl_msg_info(recipe, <span class="stringliteral">"PMOS data found"</span>);</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>         arc_tag                  = <span class="stringliteral">"LAMP_PMOS"</span>;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>         flat_tag                 = <span class="stringliteral">"SCREEN_FLAT_PMOS"</span>;</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>         master_screen_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_PMOS"</span>;</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>         master_norm_flat_tag     = <span class="stringliteral">"MASTER_NORM_FLAT_PMOS"</span>;</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>         reduced_lamp_tag         = <span class="stringliteral">"REDUCED_LAMP_PMOS"</span>;</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>         disp_residuals_tag       = <span class="stringliteral">"DISP_RESIDUALS_PMOS"</span>;</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>         disp_coeff_tag           = <span class="stringliteral">"DISP_COEFF_PMOS"</span>;</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>         wavelength_map_tag       = <span class="stringliteral">"WAVELENGTH_MAP_PMOS"</span>;</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>         spectra_detection_tag    = <span class="stringliteral">"SPECTRA_DETECTION_PMOS"</span>;</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>         spectral_resolution_tag  = <span class="stringliteral">"SPECTRAL_RESOLUTION_PMOS"</span>;</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>         slit_map_tag             = <span class="stringliteral">"SLIT_MAP_PMOS"</span>;</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>         curv_traces_tag          = <span class="stringliteral">"CURV_TRACES_PMOS"</span>;</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>         curv_coeff_tag           = <span class="stringliteral">"CURV_COEFF_PMOS"</span>;</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>         spatial_map_tag          = <span class="stringliteral">"SPATIAL_MAP_PMOS"</span>;</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>         slit_location_tag        = <span class="stringliteral">"SLIT_LOCATION_PMOS"</span>;</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>         disp_residuals_table_tag = <span class="stringliteral">"DISP_RESIDUALS_TABLE_PMOS"</span>;</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>         delta_image_tag          = <span class="stringliteral">"DELTA_IMAGE_PMOS"</span>;</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>         mapped_screen_flat_tag   = <span class="stringliteral">"MAPPED_SCREEN_FLAT_PMOS"</span>;</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>         mapped_norm_flat_tag     = <span class="stringliteral">"MAPPED_NORM_FLAT_PMOS"</span>;</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>     }</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span> </div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>     nbias = 0;</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0) {</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"BIAS"</span>) == 0)</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>             fors_pmos_calib_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS or BIAS"</span>);</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>         nbias = cpl_frameset_count_tags(frameset, <span class="stringliteral">"BIAS"</span>);</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>     }</div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span> </div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>         fors_pmos_calib_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span> </div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>         fors_pmos_calib_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span> </div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>         fors_pmos_calib_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span> </div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>         fors_pmos_calib_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span> </div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>         fors_pmos_calib_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span> </div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span> <span class="comment">    if (cpl_frameset_count_tags(frameset, master_distortion_tag) == 0)</span></div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span> <span class="comment">        fors_pmos_calib_exit("Missing required input: MASTER_DISTORTION_TABLE");</span></div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span> </div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_distortion_tag) > 1)</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>         fors_pmos_calib_exit(<span class="stringliteral">"Too many in input: MASTER_DISTORTION_TABLE"</span>);</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span> </div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>     nflats = cpl_frameset_count_tags(frameset, flat_tag);</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span> </div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>     <span class="keywordflow">if</span> (nflats < 1) {</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, flat_tag);</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>         fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>     }</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span> </div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span> </div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>     <span class="keywordflow">if</span> (nflats > 1)</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load %d flat field frames and stack them "</span></div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>                      <span class="stringliteral">"with method \"%s\""</span>, nflats, stack_method);</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load flat field exposure..."</span>);</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span> </div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span> </div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, flat_tag, 0);</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span> </div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>         fors_pmos_calib_exit(<span class="stringliteral">"Cannot load flat field frame header"</span>);</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span> </div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>     alltime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span> </div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>         fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword EXPTIME in flat field "</span></div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>                              <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span> </div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>     cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span> </div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>     <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span> </div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span> </div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot load flat field frame header"</span>);</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span> </div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>         alltime += cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span> </div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>             fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword EXPTIME in flat field "</span></div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>                             <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span> </div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>         cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span> </div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>     }</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span> </div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>     <span class="keywordflow">if</span> (bagoo) {</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>         <span class="keywordtype">char</span> *montecarlo = getenv(<span class="stringliteral">"MONTECARLO"</span>);</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span> </div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>         <span class="keywordflow">if</span> (montecarlo)</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>             doit = atoi(montecarlo);</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span> </div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>         <span class="keywordflow">if</span> (doit) {</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>             master_bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>,</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>                                      CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>             <span class="keywordflow">if</span> (master_bias == NULL)</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot load master bias"</span>);</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span> </div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>             blevel = cpl_image_get_mean(master_bias);</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span> </div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>             cpl_image_delete(master_bias);</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>         }</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>     }</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span> </div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>     master_flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, flat_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span> </div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>     <span class="keywordflow">if</span> (master_flat == NULL)</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>         fors_pmos_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span> </div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>     <span class="keywordflow">if</span> (doit) {</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, flat_tag, 0);</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span> </div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>         gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span> </div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>             fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD "</span></div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>                                  <span class="stringliteral">"in flat field frame header"</span>);</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span> </div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>         ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span> </div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>             fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON "</span></div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>                                  <span class="stringliteral">"in flat field frame header"</span>);</div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span> </div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>         cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span> </div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>         ron /= gain;   <span class="comment">// RON converted from electrons to ADU</span></div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span> </div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>         <a class="code" href="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2" title="Randomise image.">mos_randomise_image</a>(master_flat, ron, gain, blevel);</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>     }</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span> </div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>     ny = cpl_image_get_size_y(master_flat);</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span> </div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>     <span class="keywordflow">if</span> (nflats > 1) {</div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"average"</span>) == 0) {</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>             <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {</div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>                 flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>                 <span class="keywordflow">if</span> (flat) {</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>                     <span class="keywordflow">if</span> (doit) {</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>                         <a class="code" href="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2" title="Randomise image.">mos_randomise_image</a>(flat, ron, gain, blevel);</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>                     }</div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>                     cpl_image_add(master_flat, flat);</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>                     cpl_image_delete(flat); flat = NULL;</div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>                 }</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);</div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>             }</div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span> </div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>         <span class="comment">/***</span></div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span> <span class="comment">            if (nflats > 1)</span></div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span> <span class="comment">                cpl_image_divide_scalar(master_flat, nflats);</span></div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span> <span class="comment">        ***/</span></div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span> </div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>         }</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>             cpl_imagelist *flatlist = NULL;</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>             <span class="keywordtype">double</span> rflux, flux;</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span> </div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>             added_flat = cpl_image_duplicate(master_flat);</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span> </div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>             flatlist = cpl_imagelist_new();</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>             cpl_imagelist_set(flatlist, master_flat, </div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>                               cpl_imagelist_get_size(flatlist));</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span> </div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span> <span class="comment">             * Stacking with rejection requires normalization</span></div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span> <span class="comment">             * at the same flux. We normalise according to mean</span></div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span> <span class="comment">             * flux. This is equivalent to determining the</span></div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span> <span class="comment">             * flux ratio for each image as the average of the</span></div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span> <span class="comment">             * flux ratio of all pixels weighted on the actual</span></div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span> <span class="comment">             * flux of each pixel.</span></div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span> </div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>             rflux = cpl_image_get_mean(master_flat);</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span> </div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>             <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>                 flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>                 <span class="keywordflow">if</span> (flat) {</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>                     <span class="keywordflow">if</span> (doit) {</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>                         <a class="code" href="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2" title="Randomise image.">mos_randomise_image</a>(flat, ron, gain, blevel);</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>                     }</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>                     cpl_image_add(added_flat, flat);</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>                     flux = cpl_image_get_mean(flat);</div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>                     cpl_image_multiply_scalar(flat, rflux / flux);</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>                     cpl_imagelist_set(flatlist, flat, </div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>                                       cpl_imagelist_get_size(flatlist));</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>                 }</div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);</div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>                 }</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>             }</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>             </div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"median"</span>) == 0) {</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>                 master_flat = cpl_imagelist_collapse_median_create(flatlist);</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>             }</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span> </div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"minmax"</span>) == 0) {</div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>                 master_flat = cpl_imagelist_collapse_minmax_create(flatlist, </div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>                                                                    min_reject,</div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>                                                                    max_reject);</div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>             }</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span> </div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"ksigma"</span>) == 0) {</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>                 master_flat = <a class="code" href="group__moses.html#ga663cfcd4584b6a3e63e7593cba926688" title="Stack images using k-sigma clipping.">mos_ksigma_stack</a>(flatlist, </div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>                                                klow, khigh, kiter, NULL);</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>             }</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>         }</div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>     }</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span> </div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span> </div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span> <span class="comment">     * dispersion direction from the arc lamp exposure</span></div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span> </div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span> </div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>         fors_pmos_calib_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span> </div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>         fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);</div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span> </div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>     instrume = cpl_strdup(instrume);</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span> </div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span> </div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span> </div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>         fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in arc lamp "</span></div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span> </div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>         reference *= 10;</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span> </div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in arc lamp frame header"</span>,</div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>                       reference);</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>         fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>     }</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span> </div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span> </div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span> </div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>         fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in arc lamp "</span></div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span> </div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin, </div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>                         dispersion);</div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>     }</div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span> </div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span> </div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>         fors_pmos_calib_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in arc lamp "</span></div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span> </div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span> </div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>     <span class="keywordflow">if</span> (pmos) {</div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>         <span class="keywordtype">int</span> nslits_out_det;</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>         cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);</div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span> </div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>         maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span> </div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span> <span class="comment">         * Check if all slits have the same X offset: in such case, </span></div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span> <span class="comment">         * treat the observation as a long-slit one!</span></div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span> </div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>         mxpos = cpl_table_get_column_median(maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>         xpos = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>         nslits = cpl_table_get_nrow(maskslits);</div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span> </div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>         same_offset = 1;</div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>         <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>             <span class="keywordflow">if</span> (fabs(mxpos-xpos[i]) > 0.01) {</div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>                 same_offset = 0;</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>             }</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>         }</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>         <span class="comment">//If not all the slits are illuminated, then we cannot say that</span></div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>         <span class="comment">//all have the same offsets.</span></div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>         <span class="keywordflow">if</span>(nslits_out_det != 0)</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>             same_offset = 0;</div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span> </div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>         <span class="keywordflow">if</span> (same_offset) {</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>             cpl_msg_info(recipe, <span class="stringliteral">"All slits have same offset: %.2f"</span>, mxpos);</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>         }</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>             cpl_msg_info(recipe, <span class="stringliteral">"All slits have different offsets"</span>);</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>         }</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span> </div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>         <span class="keywordflow">if</span> (ny != 400 && ny != 500) {</div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>             <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, </div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>                                         master_distortion_tag) == 0)</div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>                 fors_pmos_calib_exit(</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>                 <span class="stringliteral">"Missing required input: MASTER_DISTORTION_TABLE"</span>);</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span> </div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>             header_dist = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, </div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>                                           master_distortion_tag, 0);</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>             rebin_dist = cpl_propertylist_get_int(header_dist,</div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>                                                   <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>             cpl_propertylist_delete(header_dist);</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>         }</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>     }</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span> </div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>     <span class="comment">/* Leave the header on for the next step... */</span></div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span> </div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span> </div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span> <span class="comment">     * Remove the master bias</span></div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span> </div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>     <span class="keywordflow">if</span> (nbias) {</div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span> </div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span> <span class="comment">         * Set of raw BIASes in input, need to create master bias!</span></div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span> </div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>         cpl_msg_info(recipe, <span class="stringliteral">"Generate the master from input raw biases..."</span>);</div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span> </div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>         <span class="keywordflow">if</span> (nbias > 1) {</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span> </div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>             biases = cpl_imagelist_new();</div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span> </div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>             bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"BIAS"</span>, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>     </div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>             <span class="keywordflow">if</span> (bias == NULL)</div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot load bias frame"</span>);</div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span> </div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>             cpl_imagelist_set(biases, bias, 0);</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>     </div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>             <span class="keywordflow">for</span> (i = 1; i < nbias; i++) {</div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>                 bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>                 <span class="keywordflow">if</span> (bias)</div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>                     cpl_imagelist_set(biases, bias, i);</div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot load bias frame"</span>);</div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>             }</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>     </div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>             master_bias = cpl_imagelist_collapse_median_create(biases);</div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span> </div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>             cpl_imagelist_delete(biases);</div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>         }</div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>             master_bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"BIAS"</span>, </div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>                                          CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>             <span class="keywordflow">if</span> (master_bias == NULL)</div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot load bias"</span>);</div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>         }</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span> </div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>     }</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>         master_bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, </div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>                                      CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>         <span class="keywordflow">if</span> (master_bias == NULL)</div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot load master bias"</span>);</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>     }</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span> </div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span> </div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>     overscans = mos_load_overscans_fors(header);</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span> </div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>     <span class="keywordflow">if</span> (nbias) {</div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>         <span class="keywordtype">int</span> xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, 0, NULL);</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>         <span class="keywordtype">int</span> ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, 0, NULL);</div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>         <span class="keywordtype">int</span> xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, 0, NULL);</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>         <span class="keywordtype">int</span> yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, 0, NULL);</div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>         dummy = cpl_image_extract(master_bias, xlow+1, ylow+1, xhig, yhig);</div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>         cpl_image_delete(master_bias); master_bias = dummy;</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span> </div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, master_bias, <span class="stringliteral">"MASTER_BIAS"</span>,</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>                            NULL, parlist, recipe, version))</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>             fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>     }</div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span> </div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>     <span class="keywordflow">if</span> (nflats > 1) {</div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>         multi_bias = cpl_image_multiply_scalar_create(master_bias, nflats);</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>         dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(master_flat, multi_bias, overscans);</div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>         <span class="keywordflow">if</span> (added_flat)</div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>             add_dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(added_flat, multi_bias, overscans);</div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>         cpl_image_delete(multi_bias);</div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>     }</div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>         dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(master_flat, master_bias, overscans);</div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>     }</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>     cpl_image_delete(master_flat);</div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>     master_flat = dummy;</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span> </div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>     <span class="keywordflow">if</span> (master_flat == NULL)</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>         fors_pmos_calib_exit(<span class="stringliteral">"Cannot remove bias from flat field"</span>);</div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span> </div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>     <span class="keywordflow">if</span> (added_flat) {</div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>         cpl_image_delete(added_flat);</div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>         added_flat = add_dummy;</div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span> </div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>         <span class="keywordflow">if</span> (added_flat == NULL)</div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot remove bias from added flat field"</span>);</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span> </div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>         trace_flat = added_flat;</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>     }</div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>         trace_flat = master_flat;</div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span> </div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>     wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>, 1);</div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span> </div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>     <span class="keywordflow">if</span> (wavelengths == NULL)</div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>         fors_pmos_calib_exit(<span class="stringliteral">"Cannot load line catalog"</span>);</div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span> </div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span> <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span> </div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>     nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span> </div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>     <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>         fors_pmos_calib_exit(<span class="stringliteral">"Empty input line catalog"</span>);</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span> </div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>                       wcolumn);</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>         fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>     }</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span> </div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>     </div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span> </div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>     lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span> </div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>     <span class="keywordflow">for</span> (j = 0; j < pmos; j++) {</div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>         <span class="keywordtype">int</span> k;</div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span> </div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>         cpl_msg_info(recipe, <span class="stringliteral">"Processing arc lamp nb %d out of %d ..."</span>,</div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>                      j + 1, pmos);</div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span> </div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span> </div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>         spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span> </div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span> <span class="comment">         * FIXME: Horrible workaround to avoid the problem because of the</span></div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span> <span class="comment">         * multiple encapsulation of cpl_frameset_find() in different </span></div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span> <span class="comment">         * loading functions</span></div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>             cpl_image_delete(spectra);</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>             spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>         }</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span> </div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>         <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span> </div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>         <span class="keywordflow">if</span> (doit) {</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>             <a class="code" href="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2" title="Randomise image.">mos_randomise_image</a>(spectra, ron, gain, blevel);</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>         }</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span> </div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>         cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span> </div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>         dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(spectra, master_bias, overscans);</div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>         cpl_image_delete(spectra); spectra = dummy;</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span> </div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>         <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot remove bias from arc lamp exposure"</span>);</div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span> </div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);</div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span> </div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span> <span class="comment">         * Here the PMOS calibration is carried out.</span></div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span> </div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#ga854ead782f62a6929aade44b267353e0" title="Process saturation.">mos_saturation_process</a>(spectra))</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot process saturation"</span>);</div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span> </div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0" title="Subtract the background.">mos_subtract_background</a>(spectra))</div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot subtract the background"</span>);</div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span> </div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span> <span class="comment">             * Detecting spectra on the CCD</span></div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span> </div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>             cpl_msg_info(recipe, <span class="stringliteral">"Detecting spectra on CCD..."</span>);</div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span> </div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>             nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>             ccd_ysize = ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span> </div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>             refmask = cpl_mask_new(nx, ny);</div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span> </div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>             checkwave =</div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>                 <a class="code" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion, </div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>                                                peakdetection, wradius, </div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>                                                wdegree, wreject, reference,</div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>                                                &startwavelength, &endwavelength,</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>                                                NULL, NULL, NULL, NULL, NULL, </div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>                                                NULL, refmask, NULL);</div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span> </div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>             <span class="keywordflow">if</span> (checkwave == NULL)</div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>                 fors_pmos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span> </div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span> <span class="comment">             * Save check image to disk</span></div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span> </div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>             header = cpl_propertylist_new();</div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>             cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>             cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>             cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>                                            startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>             cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>             <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span> <span class="comment">               cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>             cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>             cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>             cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>             cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>             cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>             cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span> </div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>             <span class="keywordflow">if</span> (check) {</div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>                 <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>                                            spectra_detection_tag,</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>                                            recipe, version)) {</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>                         fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>                     }</div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>                 }</div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span> </div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(checkwave, </div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>                                        spectra_detection_tag, header)) {</div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>                     fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>                 }</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>             }</div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span> </div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>             cpl_image_delete(checkwave); checkwave = NULL;</div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>             cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span> </div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>             <span class="keywordflow">if</span> (cpl_mask_is_empty(refmask))</div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>                 fors_pmos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span> </div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>             <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gae623b8129e3fd33516f32d866c5106a8" title="Reconstruct the gaps required for slit location.">mos_refmask_find_gaps</a>(refmask, trace_flat, -1.0))</div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>                 fors_pmos_calib_exit(<span class="stringliteral">"The gaps could not be found"</span>);</div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span> </div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>             cpl_msg_info(recipe,</div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>                          <span class="stringliteral">"Locate slits at reference wavelength on CCD..."</span>);</div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>             slits = <a class="code" href="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900" title="Find the location of detected spectra on the CCD.">mos_locate_spectra</a>(refmask);</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span> </div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>             <span class="keywordflow">if</span> (!slits) {</div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>                 cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, </div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>                               cpl_error_get_message());</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>                 fors_pmos_calib_exit(<span class="stringliteral">"No slits could be detected!"</span>);</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>             }</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span> </div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>             <span class="keywordflow">if</span> (same_offset) {</div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>                 <span class="keywordflow">if</span> (ny != 400 && ny != 500) {</div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>                     <span class="keywordtype">float</span> rescale = (float) rebin_dist / rebin;</div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#ga71e13921907ec2f25478957d35318e7f" title="Check that all slit have been detected, insert them if not.">mos_check_slits</a>(slits, rescale)) {</div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>                         fors_pmos_calib_exit(<span class="stringliteral">"Some slits are missing. "</span></div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>                                              <span class="stringliteral">"Cannot recover!"</span>);</div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>                     }</div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>                 }</div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>             }</div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span> </div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>             refimage = cpl_image_new_from_mask(refmask);</div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>             cpl_mask_delete(refmask); refmask = NULL;</div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span> </div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>             <span class="keywordflow">if</span> (check) {</div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>                 <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>                                            slit_map_tag,</div>
+<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>                                            recipe, version)) {</div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>                         fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>                     }</div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>                 }</div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span> </div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>                 save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span> </div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>                 <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>                     cpl_propertylist_delete(save_header);</div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>                     save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>                 }</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span> </div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(refimage, slit_map_tag, save_header)) {</div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>                     fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>                 }</div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>                 cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>             }</div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span> </div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>             cpl_image_delete(refimage); refimage = NULL;</div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span> </div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span> <span class="comment">//          if (same_offset == 0) {</span></div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span> </div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>             same_offset = 1; <span class="comment">// Added, see next line comment.</span></div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>             <span class="keywordflow">if</span> (0) { <span class="comment">// This part is eliminated: a successful</span></div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>                      <span class="comment">// pattern matching would identify just </span></div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>                      <span class="comment">// one of the two beams!!! It needs to be FIXED.</span></div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span> </div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span> <span class="comment">                 * Attempt slit identification: this recipe may continue even</span></div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span> <span class="comment">                 * in case of failed identification (i.e., the position table</span></div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span> <span class="comment">                 * is not produced, but an error is not set). In case of </span></div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span> <span class="comment">                 * failure, the spectra would be still extracted, even if they</span></div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span> <span class="comment">                 * would not be associated to slits on the mask.</span></div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span> <span class="comment">                 * </span></div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span> <span class="comment">                 * The reason for making the slit identification an user option</span></div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span> <span class="comment">                 * (via the parameter slit_ident) is to offer the possibility </span></div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span> <span class="comment">                 * to avoid identifications that are only apparently successful</span></div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span> <span class="comment">                 * as it would happen in the case of an incorrect slit</span></div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span> <span class="comment">                 * description in the data header.</span></div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span> </div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>                 cpl_msg_indent_less();</div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>                 cpl_msg_info(recipe, </div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>                              <span class="stringliteral">"Attempt slit identification (optional)..."</span>);</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>                 cpl_msg_indent_more();</div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span> </div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>                 positions = <a class="code" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits</a>(slits, maskslits, NULL);</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span> </div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>                 <span class="keywordflow">if</span> (positions) {</div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>                     cpl_table_delete(slits);</div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>                     slits = positions;</div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span> </div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>                    <span class="comment">/*</span></div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span> <span class="comment">                    * Eliminate slits which are not _entirely_ inside the CCD</span></div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span> <span class="comment">                    */</span></div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span> </div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>                     cpl_table_and_selected_double(slits, </div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>                                                  <span class="stringliteral">"ytop"</span>, CPL_GREATER_THAN, ny);</div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>                     cpl_table_or_selected_double(slits, </div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>                                                  <span class="stringliteral">"ybottom"</span>, CPL_LESS_THAN, 0);</div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>                     cpl_table_erase_selected(slits);</div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span> </div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>                     nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span> </div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>                     <span class="keywordflow">if</span> (nslits == 0)</div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>                         fors_pmos_calib_exit(<span class="stringliteral">"No slits found on the CCD"</span>);</div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span> </div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>                     cpl_msg_info(recipe,</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>                                  <span class="stringliteral">"%d slits are entirely contained in CCD"</span>, </div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>                                  nslits);</div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>                 }</div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>                     same_offset = 1; <span class="comment">/* FIXLANDER slit_ident = 0; */</span></div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>                     cpl_msg_info(recipe, </div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>                                  <span class="stringliteral">"Global distortion model cannot be computed"</span>);</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>                     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>                         fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>                     }</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>                 }</div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>             }</div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span> </div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span> </div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>             <span class="keywordflow">if</span> (ny == 400 || ny == 500) {</div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span> </div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>                <span class="comment">/*</span></div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span> <span class="comment">                * For the FORS1 special case (old chip 2048x400 readout)</span></div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span> <span class="comment">                * keep the central slits only</span></div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span> <span class="comment">                */</span></div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span> </div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>                 nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span> </div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>                 <span class="keywordflow">if</span> (nslits > 4) {</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>                     cpl_table_unselect_all(slits);</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>                     <span class="keywordflow">for</span> (k = 0; k < cpl_table_get_nrow(slits); k++) {</div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>                         <span class="keywordtype">double</span> jump = cpl_table_get(slits, <span class="stringliteral">"ytop"</span>, k, NULL) </div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>                                     - cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, k, NULL);</div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>                         <span class="keywordflow">if</span> (jump < 50.) {</div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>                             cpl_table_select_row(slits, k);</div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>                         }</div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>                     }</div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>                     cpl_table_erase_selected(slits);</div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>                     nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>                 }</div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span> </div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>                 <span class="keywordflow">if</span> (nslits == 0)</div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>                     fors_pmos_calib_exit(<span class="stringliteral">"No slits found on the CCD"</span>);</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span> </div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>                 <span class="keywordflow">if</span> (nslits == 4) {</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>                     cpl_table_unselect_all(slits);</div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>                     cpl_table_select_row(slits, 0);</div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>                     cpl_table_select_row(slits, cpl_table_get_nrow(slits)-1);</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>                     cpl_table_erase_selected(slits);</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>                 }</div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span> </div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>                 cpl_msg_info(recipe, </div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>                              <span class="stringliteral">"%d slits are entirely contained in CCD"</span>, nslits);</div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>             }</div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>                 cpl_table_unselect_all(slits);</div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>                 <span class="keywordflow">for</span> (k = 0; k < cpl_table_get_nrow(slits); k++) {</div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>                     <span class="keywordtype">double</span> jump = cpl_table_get(slits, <span class="stringliteral">"ytop"</span>, k, NULL)</div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>                                 - cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, k, NULL);</div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>                     <span class="keywordflow">if</span> (jump < 10.) {</div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>                         cpl_table_select_row(slits, k);</div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>                     }</div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>                 }</div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>                 cpl_table_erase_selected(slits);</div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>                 nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>             }</div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span> </div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span> </div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span> <span class="comment">             * Determination of spectral curvature</span></div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span> </div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>             cpl_msg_info(recipe, <span class="stringliteral">"Determining spectral curvature..."</span>);</div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span> </div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>             cpl_msg_info(recipe, <span class="stringliteral">"Tracing master flat field spectra edges..."</span>);</div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>             traces = <a class="code" href="group__moses.html#gaad02c30291fd30d07156ac8f397f439f" title="Trace flat field spectra.">mos_trace_flat</a>(trace_flat, slits, reference, </div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>                                     startwavelength, endwavelength, dispersion);</div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span> </div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>             <span class="keywordflow">if</span> (!traces)</div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>                 fors_pmos_calib_exit(<span class="stringliteral">"Tracing failure"</span>);</div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span> </div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>             cpl_image_delete(added_flat); added_flat = NULL;</div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span> </div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>             cpl_msg_info(recipe, <span class="stringliteral">"Fitting flat field spectra edges..."</span>);</div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>             polytraces = <a class="code" href="group__moses.html#ga7518d66581d93ab64704fcf90996296b" title="Fit spectral traces.">mos_poly_trace</a>(slits, traces, cdegree);</div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span> </div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>             <span class="keywordflow">if</span> (!polytraces)</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>                 fors_pmos_calib_exit(<span class="stringliteral">"Trace fitting failure"</span>);</div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span> </div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>             <span class="keywordflow">if</span> (cmode) {</div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>                 cpl_msg_info(recipe, </div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>                              <span class="stringliteral">"Computing global spectral curvature model..."</span>);</div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>                 <a class="code" href="group__moses.html#ga0eda8a5abf396113ffbe66607fd72fe6" title="Recompute tracing coefficients globally.">mos_global_trace</a>(slits, polytraces, cmode);</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>             }</div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span> </div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>             <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist, curv_traces_tag,</div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>                                        recipe, version)) {</div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>                     fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>                 }</div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>             }</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span> </div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489" title="Save a table in a extension (different from the first one)">dfs_save_table_ext</a>(traces, curv_traces_tag, NULL)) {</div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>             }</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span> </div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>             cpl_table_delete(traces); traces = NULL;</div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span> </div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>             coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span> </div>
+<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>         }</div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span> <span class="comment">//</span></div>
+<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>         spatial = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces,</div>
+<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>                                           reference, </div>
+<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>                                           startwavelength, endwavelength, </div>
+<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>                                           dispersion, 0, j ? NULL: coordinate);</div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span> </div>
+<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span> <span class="comment">//</span></div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>             <span class="keywordflow">if</span> (same_offset) { <span class="comment">/* FIXLANDER It was !slit_ident */</span></div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>                 cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>             }</div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span> </div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span> <span class="comment">             * Flat field normalisation is done directly on the master flat</span></div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span> <span class="comment">             * field (without spatial rectification first). The spectral</span></div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span> <span class="comment">             * curvature model may be provided in input, in future releases.</span></div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span> </div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>             cpl_msg_info(recipe, <span class="stringliteral">"Perform flat field normalisation..."</span>);</div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span> </div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>             norm_flat = cpl_image_duplicate(master_flat);</div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span> </div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>             smo_flat = <a class="code" href="group__moses.html#ga6b94ed200f4b1b8e281417a80b9aa4b5" title="Normalise a flat field exposure.">mos_normalise_flat</a>(norm_flat, coordinate, slits,</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>                                           polytraces, reference,</div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>                                           startwavelength, endwavelength,</div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>                                           dispersion, dradius, ddegree);</div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span> </div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>             <span class="comment">/* This may be a product */</span></div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>             cpl_image_delete(smo_flat); smo_flat = NULL; </div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span> </div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>  </div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>             save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, flat_tag, 0);</div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>             cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>,</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>                                         nflats);</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span> </div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>             rect_flat = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(master_flat, slits, polytraces,</div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>                                                 reference, startwavelength, </div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>                                                 endwavelength, dispersion, 0,</div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>                                                 NULL);</div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>             rect_nflat = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(norm_flat, slits, polytraces, </div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>                                                  reference, startwavelength, </div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>                                                  endwavelength, dispersion, 0,</div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>                                                  NULL);</div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span> </div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span> </div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, master_flat, master_screen_flat_tag,</div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>                                save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span> </div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span> </div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, norm_flat, master_norm_flat_tag,</div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>                                save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span> </div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>             cpl_image_delete(norm_flat); norm_flat = NULL;</div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>             cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span> </div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>         }</div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span> </div>
+<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span> </div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span> <span class="comment">         * Final wavelength calibration of spectra having their curvature</span></div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span> <span class="comment">         * removed</span></div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span> </div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>         cpl_msg_info(recipe, <span class="stringliteral">"Perform final wavelength calibration..."</span>);</div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span> </div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>         nx = cpl_image_get_size_x(spatial);</div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>         ny = cpl_image_get_size_y(spatial);</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span> </div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>         idscoeff = cpl_table_new(ny);</div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>         restable = cpl_table_new(nlines);</div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>         rainbow = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>         <span class="keywordflow">if</span> (check)</div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>             residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>         fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>         fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span> </div>
+<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>         rectified = <a class="code" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb" title="Derive wavelength calibration from a rectified arc lamp or sky exposure.">mos_wavelength_calibration_final</a>(spatial, slits, lines, </div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>                                                      dispersion, peakdetection,</div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>                                                      wradius, wdegree, wreject,</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>                                                      reference,</div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>                                                      &startwavelength, </div>
+<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>                                                      &endwavelength, fitlines, </div>
+<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>                                                      fiterror, idscoeff,</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>                                                      rainbow, </div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>                                                      residual, restable, NULL);</div>
+<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span> </div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>         <span class="keywordflow">if</span> (rectified == NULL)</div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>             fors_pmos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);</div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span> </div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist, disp_residuals_table_tag,</div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>                                    recipe, version)) {</div>
+<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>             }</div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>         }</div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span> </div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span> </div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>             cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>         }</div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span> </div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489" title="Save a table in a extension (different from the first one)">dfs_save_table_ext</a>(restable, disp_residuals_table_tag, header)) {</div>
+<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span>             fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>         }</div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span> </div>
+<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>         cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span> </div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>         cpl_table_delete(restable); restable = NULL;</div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span> </div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>         cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;</div>
+<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>         cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>         cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;</div>
+<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span> </div>
+<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i++)</div>
+<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>             <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))</div>
+<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>                 cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);</div>
+<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span> </div>
+<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span>         delta = <a class="code" href="group__moses.html#ga6187454ef3812203ba2d50d1e2d01326" title="Create a pixel map from an IDS coefficients table.">mos_map_pixel</a>(idscoeff, reference, startwavelength,</div>
+<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>                               endwavelength, dispersion, 2);</div>
+<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span> </div>
+<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span> </div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>             cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>         }</div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span> </div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,</div>
+<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>                                        startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>         <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span> <span class="comment">           cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span> </div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist, delta_image_tag,</div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>                                    recipe, version)) {</div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>             }</div>
+<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>         }</div>
+<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span> </div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(delta, delta_image_tag, header)) {</div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>             fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>         }</div>
+<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span> </div>
+<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>         cpl_image_delete(delta); delta = NULL;</div>
+<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span> </div>
+<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>         mean_rms = <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(rectified, lines, startwavelength, </div>
+<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>                                        dispersion, 6, 0);</div>
+<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span> </div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>         cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f pixel"</span>, mean_rms);</div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span> </div>
+<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>         mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>         mean_rms_err = cpl_table_get_column_stdev(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span> </div>
+<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>         cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>, </div>
+<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>                      mean_rms, mean_rms * dispersion);</div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span> </div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>         restab = <a class="code" href="group__moses.html#gae9f633b64e1880984c084a19f53047fc" title="Compute mean spectral resolution at a given arc lamp line.">mos_resolution_table</a>(rectified, startwavelength, dispersion, </div>
+<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>                                       60000, lines);</div>
+<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span> </div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>         <span class="keywordflow">if</span> (restab) {</div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>             cpl_msg_info(recipe, <span class="stringliteral">"Mean spectral resolution: %.2f"</span>, </div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>                          cpl_table_get_column_mean(restab, <span class="stringliteral">"resolution"</span>));</div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>             cpl_msg_info(recipe,</div>
+<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>                   <span class="stringliteral">"Mean reference lines FWHM: %.2f +/- %.2f pixel"</span>,</div>
+<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>                   cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm"</span>) / dispersion,</div>
+<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>                   cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm_rms"</span>) / dispersion);</div>
+<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span> </div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>             cpl_table_duplicate_column(restab, <span class="stringliteral">"dlambda"</span>, </div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>                                        restab, <span class="stringliteral">"fwhm"</span>);</div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>             cpl_table_multiply_scalar(restab, <span class="stringliteral">"dlambda"</span>, dispersion);</div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>             cpl_table_duplicate_column(restab, <span class="stringliteral">"dlambda_rms"</span>, </div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>                                        restab, <span class="stringliteral">"fwhm_rms"</span>);</div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>             cpl_table_multiply_scalar(restab, <span class="stringliteral">"dlambda_rms"</span>, dispersion);</div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span> </div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>             <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span> </div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>                 qclist = cpl_propertylist_new();</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span> </div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span> <span class="comment">                 * QC1 parameters</span></div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>                 keyname = <span class="stringliteral">"QC.DID"</span>;</div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span> </div>
+<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053" title="Write a string value to the active QC1 PAF object and to a header.">fors_header_write_string</a>(qclist,</div>
+<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>                                              keyname,</div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>                                              <span class="stringliteral">"2.0"</span>,</div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>                                              <span class="stringliteral">"QC1 dictionary"</span>)) {</div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span></div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>                                          <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>                 }</div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span> </div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>                 </div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>                 keyname = <span class="stringliteral">"QC.PMOS.RESOLUTION"</span>;</div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span> </div>
+<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qclist, </div>
+<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>                                             cpl_table_get_column_mean(restab,</div>
+<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>                                             <span class="stringliteral">"resolution"</span>),</div>
+<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>                                             keyname,</div>
+<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>                                             <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>                                             <span class="stringliteral">"Mean spectral resolution"</span>)) {</div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write mean spectral "</span></div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>                                          <span class="stringliteral">"resolution to QC log file"</span>);</div>
+<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>                 }</div>
+<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span> </div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>                 keyname = <span class="stringliteral">"QC.PMOS.RESOLUTION.RMS"</span>;</div>
+<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span> </div>
+<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qclist, </div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>                                             cpl_table_get_column_stdev(restab, </div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>                                             <span class="stringliteral">"resolution"</span>),</div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>                                             keyname,</div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>                                             <span class="stringliteral">"Angstrom"</span>, </div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>                                             <span class="stringliteral">"Scatter of spectral resolution"</span>)) {</div>
+<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span>                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write spectral resolution "</span></div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>                                          <span class="stringliteral">"scatter to QC log file"</span>);</div>
+<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>                 }</div>
+<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span> </div>
+<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>                 keyname = <span class="stringliteral">"QC.PMOS.RESOLUTION.NWAVE"</span>;</div>
+<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span> </div>
+<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>                 <span class="keywordflow">if</span> (fors_header_write_int(qclist, cpl_table_get_nrow(restab) -</div>
+<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>                                          cpl_table_count_invalid(restab, </div>
+<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>                                                                  <span class="stringliteral">"resolution"</span>),</div>
+<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>                                          keyname,</div>
+<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>                                          NULL,</div>
+<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>                                          <span class="stringliteral">"Number of examined wavelengths "</span></div>
+<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>                                          <span class="stringliteral">"for resolution computation"</span>)) {</div>
+<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write number of lines used "</span></div>
+<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>                                          <span class="stringliteral">"in spectral resolution computation "</span></div>
+<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span>                                          <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>                 }</div>
+<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span> </div>
+<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>                 keyname = <span class="stringliteral">"QC.PMOS.RESOLUTION.MEANRMS"</span>;</div>
+<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>                     </div>
+<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(qclist,</div>
+<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>                                             cpl_table_get_column_mean(restab,</div>
+<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>                                             <span class="stringliteral">"resolution_rms"</span>),</div>
+<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>                                             keyname, NULL,</div>
+<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>                                             <span class="stringliteral">"Mean error on spectral "</span></div>
+<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>                                             <span class="stringliteral">"resolution computation"</span>)) {</div>
+<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write mean error in "</span></div>
+<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>                                          <span class="stringliteral">"spectral resolution computation "</span></div>
+<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>                                          <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>                 }</div>
+<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span> </div>
+<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>                 keyname = <span class="stringliteral">"QC.PMOS.RESOLUTION.NLINES"</span>;</div>
+<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span> </div>
+<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>                 <span class="keywordflow">if</span> (fors_header_write_int(qclist,</div>
+<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>                                          cpl_table_get_column_mean(restab, </div>
+<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>                                                                    <span class="stringliteral">"nlines"</span>) *</div>
+<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>                                          cpl_table_get_nrow(restab),</div>
+<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>                                          keyname, NULL,</div>
+<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>                                          <span class="stringliteral">"Number of lines for spectral "</span></div>
+<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>                                          <span class="stringliteral">"resolution computation"</span>)) {</div>
+<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write number of examined "</span></div>
+<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>                                          <span class="stringliteral">"wavelengths in spectral resolution "</span></div>
+<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>                                          <span class="stringliteral">"computation to QC log file"</span>);</div>
+<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>                 }</div>
+<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span> </div>
+<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>             }</div>
+<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span> </div>
+<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>             <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist, </div>
+<div class="line"><a name="l01947"></a><span class="lineno"> 1947</span>                                        spectral_resolution_tag,</div>
+<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>                                        recipe, version)) {</div>
+<div class="line"><a name="l01949"></a><span class="lineno"> 1949</span>                     fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>                 }</div>
+<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>             }</div>
+<div class="line"><a name="l01952"></a><span class="lineno"> 1952</span> </div>
+<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span> </div>
+<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span>             <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>                 cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>                 header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>             }</div>
+<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span> </div>
+<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>             cpl_propertylist_append(header, qclist);</div>
+<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span> </div>
+<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489" title="Save a table in a extension (different from the first one)">dfs_save_table_ext</a>(restab, spectral_resolution_tag, header)) {</div>
+<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>             }</div>
+<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span> </div>
+<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>             cpl_table_delete(restab); restab = NULL;</div>
+<div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>             cpl_propertylist_delete(qclist); qclist = NULL;</div>
+<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>             cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01969"></a><span class="lineno"> 1969</span> </div>
+<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>         }</div>
+<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot compute the spectral "</span></div>
+<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>                                  <span class="stringliteral">"resolution table"</span>);</div>
+<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span> </div>
+<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist, disp_coeff_tag,</div>
+<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>                                    recipe, version)) {</div>
+<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>             }</div>
+<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>         }</div>
+<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span> </div>
+<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span> </div>
+<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>             cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>         }</div>
+<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span> </div>
+<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489" title="Save a table in a extension (different from the first one)">dfs_save_table_ext</a>(idscoeff, disp_coeff_tag, header)) {</div>
+<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>             fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>         }</div>
+<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span> </div>
+<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>         cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01994"></a><span class="lineno"> 1994</span> </div>
+<div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>             mapped_flat = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(rect_flat, reference,</div>
+<div class="line"><a name="l01997"></a><span class="lineno"> 1997</span>                                                      startwavelength, </div>
+<div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>                                                      endwavelength,</div>
+<div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>                                                      dispersion, idscoeff, 0);</div>
+<div class="line"><a name="l02000"></a><span class="lineno"> 2000</span> </div>
+<div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>             mapped_nflat = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(rect_nflat, reference,</div>
+<div class="line"><a name="l02002"></a><span class="lineno"> 2002</span>                                                       startwavelength, </div>
+<div class="line"><a name="l02003"></a><span class="lineno"> 2003</span>                                                       endwavelength,</div>
+<div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>                                                       dispersion, idscoeff, 0);</div>
+<div class="line"><a name="l02005"></a><span class="lineno"> 2005</span> </div>
+<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>             cpl_image_delete(rect_flat); rect_flat = NULL;</div>
+<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>             cpl_image_delete(rect_nflat); rect_nflat = NULL;</div>
+<div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>         }</div>
+<div class="line"><a name="l02009"></a><span class="lineno"> 2009</span> </div>
+<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>         <span class="comment">/* Global removed */</span></div>
+<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span> </div>
+<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>         cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span> </div>
+<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span> </div>
+<div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>             cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>         }</div>
+<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span> </div>
+<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>                                        startwavelength + dispersion/2);</div>
+<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>         <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span> <span class="comment">           cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span>         cpl_propertylist_update_int(header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, 1);</div>
+<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span> </div>
+<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist, reduced_lamp_tag,</div>
+<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>                                    recipe, version)) {</div>
+<div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span>             }</div>
+<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>         }</div>
+<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span> </div>
+<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(rectified, reduced_lamp_tag, header)) {</div>
+<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>             fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>         }</div>
+<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span> </div>
+<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>         cpl_image_delete(rectified); rectified = NULL;</div>
+<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span> </div>
+<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>         cpl_propertylist_update_int(header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, nflats);</div>
+<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span> </div>
+<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, mapped_flat, mapped_screen_flat_tag,</div>
+<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>                                header, parlist, recipe, version))</div>
+<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>             cpl_image_delete(mapped_flat); mapped_flat = NULL;</div>
+<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span> </div>
+<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, mapped_nflat, mapped_norm_flat_tag,</div>
+<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>                                header, parlist, recipe, version))</div>
+<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>             cpl_image_delete(mapped_nflat); mapped_nflat = NULL;</div>
+<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>         }</div>
+<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span> </div>
+<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span> </div>
+<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>         <span class="keywordflow">if</span> (check) {</div>
+<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>             save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span>             <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>                 cpl_propertylist_delete(save_header);</div>
+<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>                 save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span>             }</div>
+<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span> </div>
+<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span>             <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, 1.0);</div>
+<div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>             cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>             cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>             cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span> </div>
+<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>             <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist, disp_residuals_tag,</div>
+<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>                                        recipe, version)) {</div>
+<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>                     fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>                 }</div>
+<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>             }</div>
+<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span> </div>
+<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(residual, disp_residuals_tag, save_header)) {</div>
+<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>             }</div>
+<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span> </div>
+<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>             cpl_image_delete(residual); residual = NULL;</div>
+<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>             cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>         }</div>
+<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span> </div>
+<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>         wavemap = <a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(coordinate, rainbow, slits, polytraces, </div>
+<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>                                       reference, startwavelength, endwavelength, </div>
+<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>                                       dispersion);</div>
+<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span> </div>
+<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>         cpl_image_delete(rainbow); rainbow = NULL;</div>
+<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span> </div>
+<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>         save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span> </div>
+<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>             cpl_propertylist_delete(save_header);</div>
+<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>             save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>         }</div>
+<div class="line"><a name="l02109"></a><span class="lineno"> 2109</span> </div>
+<div class="line"><a name="l02110"></a><span class="lineno"> 2110</span>         <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span> </div>
+<div class="line"><a name="l02112"></a><span class="lineno"> 2112</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l02113"></a><span class="lineno"> 2113</span> <span class="comment">             * QC1 parameters</span></div>
+<div class="line"><a name="l02114"></a><span class="lineno"> 2114</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053" title="Write a string value to the active QC1 PAF object and to a header.">fors_header_write_string</a>(save_header,</div>
+<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span>                                          <span class="stringliteral">"QC.DID"</span>,</div>
+<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span>                                          <span class="stringliteral">"2.0"</span>,</div>
+<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>                                          <span class="stringliteral">"QC1 dictionary"</span>)) {</div>
+<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span></div>
+<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>                                      <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>             }</div>
+<div class="line"><a name="l02122"></a><span class="lineno"> 2122</span> </div>
+<div class="line"><a name="l02123"></a><span class="lineno"> 2123</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(save_header,</div>
+<div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>                                         mean_rms,</div>
+<div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>                                         <span class="stringliteral">"QC.WAVE.ACCURACY"</span>,</div>
+<div class="line"><a name="l02126"></a><span class="lineno"> 2126</span>                                         <span class="stringliteral">"pixel"</span>,</div>
+<div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>                                         <span class="stringliteral">"Mean accuracy of wavecalib model"</span>)) {</div>
+<div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot write mean wavelength calibration "</span></div>
+<div class="line"><a name="l02129"></a><span class="lineno"> 2129</span>                                      <span class="stringliteral">"accuracy to QC log file"</span>);</div>
+<div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>             }</div>
+<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span> </div>
+<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span> </div>
+<div class="line"><a name="l02133"></a><span class="lineno"> 2133</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(save_header,</div>
+<div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>                                         mean_rms_err,</div>
+<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>                                         <span class="stringliteral">"QC.WAVE.ACCURACY.ERROR"</span>,</div>
+<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>                                         <span class="stringliteral">"pixel"</span>,</div>
+<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>                                         <span class="stringliteral">"Error on accuracy of wavecalib model"</span>)) {</div>
+<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>                 fors_pmos_calib_exit(<span class="stringliteral">"Cannot write error on wavelength "</span></div>
+<div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>                                      <span class="stringliteral">"calibration accuracy to QC log file"</span>);</div>
+<div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>             }</div>
+<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span> </div>
+<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>             <span class="keywordflow">if</span> (same_offset && fabs(mxpos) < 0.05) { </div>
+<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>                                              <span class="comment">/* Only if same offset is 0.0 */</span></div>
+<div class="line"><a name="l02144"></a><span class="lineno"> 2144</span> </div>
+<div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>                 data = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span> </div>
+<div class="line"><a name="l02147"></a><span class="lineno"> 2147</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(save_header,</div>
+<div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>                                            data[nx/2 + ccd_ysize*nx/2],</div>
+<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>                                            <span class="stringliteral">"QC.PMOS.CENTRAL.WAVELENGTH"</span>,</div>
+<div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>                                            <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>                                            <span class="stringliteral">"Wavelength at CCD center"</span>)) {</div>
+<div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>                     fors_pmos_calib_exit(<span class="stringliteral">"Cannot write central wavelength "</span></div>
+<div class="line"><a name="l02153"></a><span class="lineno"> 2153</span>                                          <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l02154"></a><span class="lineno"> 2154</span>                 }</div>
+<div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>             }</div>
+<div class="line"><a name="l02156"></a><span class="lineno"> 2156</span> </div>
+<div class="line"><a name="l02157"></a><span class="lineno"> 2157</span>         }</div>
+<div class="line"><a name="l02158"></a><span class="lineno"> 2158</span> </div>
+<div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l02160"></a><span class="lineno"> 2160</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist, wavelength_map_tag,</div>
+<div class="line"><a name="l02161"></a><span class="lineno"> 2161</span>                                    recipe, version)) {</div>
+<div class="line"><a name="l02162"></a><span class="lineno"> 2162</span>                 fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02163"></a><span class="lineno"> 2163</span>             }</div>
+<div class="line"><a name="l02164"></a><span class="lineno"> 2164</span>         }</div>
+<div class="line"><a name="l02165"></a><span class="lineno"> 2165</span> </div>
+<div class="line"><a name="l02166"></a><span class="lineno"> 2166</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(wavemap, wavelength_map_tag, save_header)) {</div>
+<div class="line"><a name="l02167"></a><span class="lineno"> 2167</span>             fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02168"></a><span class="lineno"> 2168</span>         }</div>
+<div class="line"><a name="l02169"></a><span class="lineno"> 2169</span> </div>
+<div class="line"><a name="l02170"></a><span class="lineno"> 2170</span>         cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l02171"></a><span class="lineno"> 2171</span> </div>
+<div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>         cpl_propertylist_erase_regexp(save_header, <span class="stringliteral">"^ESO QC "</span>, 0);</div>
+<div class="line"><a name="l02173"></a><span class="lineno"> 2173</span> </div>
+<div class="line"><a name="l02174"></a><span class="lineno"> 2174</span>         cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l02175"></a><span class="lineno"> 2175</span> </div>
+<div class="line"><a name="l02176"></a><span class="lineno"> 2176</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l02177"></a><span class="lineno"> 2177</span> </div>
+<div class="line"><a name="l02178"></a><span class="lineno"> 2178</span>     }</div>
+<div class="line"><a name="l02179"></a><span class="lineno"> 2179</span> </div>
+<div class="line"><a name="l02180"></a><span class="lineno"> 2180</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, coordinate, spatial_map_tag, save_header,</div>
+<div class="line"><a name="l02181"></a><span class="lineno"> 2181</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l02182"></a><span class="lineno"> 2182</span>         fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02183"></a><span class="lineno"> 2183</span> </div>
+<div class="line"><a name="l02184"></a><span class="lineno"> 2184</span>     cpl_image_delete(coordinate); coordinate = NULL;</div>
+<div class="line"><a name="l02185"></a><span class="lineno"> 2185</span>     cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l02186"></a><span class="lineno"> 2186</span> </div>
+<div class="line"><a name="l02187"></a><span class="lineno"> 2187</span>     header = NULL;</div>
+<div class="line"><a name="l02188"></a><span class="lineno"> 2188</span> </div>
+<div class="line"><a name="l02189"></a><span class="lineno"> 2189</span>     <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l02190"></a><span class="lineno"> 2190</span> </div>
+<div class="line"><a name="l02191"></a><span class="lineno"> 2191</span>         <span class="keywordtype">double</span> maxpos, maxneg, maxcurve, maxslope;</div>
+<div class="line"><a name="l02192"></a><span class="lineno"> 2192</span> </div>
+<div class="line"><a name="l02193"></a><span class="lineno"> 2193</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l02194"></a><span class="lineno"> 2194</span> </div>
+<div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02196"></a><span class="lineno"> 2196</span> <span class="comment">         * QC1 parameters</span></div>
+<div class="line"><a name="l02197"></a><span class="lineno"> 2197</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053" title="Write a string value to the active QC1 PAF object and to a header.">fors_header_write_string</a>(header,</div>
+<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>                                      <span class="stringliteral">"QC.DID"</span>,</div>
+<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>                                      <span class="stringliteral">"2.0"</span>,</div>
+<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>                                      <span class="stringliteral">"QC1 dictionary"</span>)) {</div>
+<div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot write dictionary version "</span></div>
+<div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>                                  <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l02204"></a><span class="lineno"> 2204</span>         }</div>
+<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span> </div>
+<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>         maxpos = fabs(cpl_table_get_column_max(polytraces, <span class="stringliteral">"c2"</span>));</div>
+<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>         maxneg = fabs(cpl_table_get_column_min(polytraces, <span class="stringliteral">"c2"</span>));</div>
+<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>         maxcurve = maxpos > maxneg ? maxpos : maxneg;</div>
+<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(header,</div>
+<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span>                                    maxcurve,</div>
+<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>                                    <span class="stringliteral">"QC.TRACE.MAX.CURVATURE"</span>,</div>
+<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>                                    <span class="stringliteral">"Y pixel / X pixel ^2"</span>,</div>
+<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>                                    <span class="stringliteral">"Max observed curvature "</span></div>
+<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>                                    <span class="stringliteral">"in spectral tracing"</span>)) {</div>
+<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot write max observed curvature in "</span></div>
+<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>                                  <span class="stringliteral">"spectral tracing to QC log file"</span>);</div>
+<div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>         }</div>
+<div class="line"><a name="l02218"></a><span class="lineno"> 2218</span> </div>
+<div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>         maxpos = fabs(cpl_table_get_column_max(polytraces, <span class="stringliteral">"c1"</span>));</div>
+<div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>         maxneg = fabs(cpl_table_get_column_min(polytraces, <span class="stringliteral">"c1"</span>));</div>
+<div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>         maxslope = maxpos > maxneg ? maxpos : maxneg;</div>
+<div class="line"><a name="l02222"></a><span class="lineno"> 2222</span> </div>
+<div class="line"><a name="l02223"></a><span class="lineno"> 2223</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_header_write_double</a>(header,</div>
+<div class="line"><a name="l02224"></a><span class="lineno"> 2224</span>                                    maxslope,</div>
+<div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>                                    <span class="stringliteral">"QC.TRACE.MAX.SLOPE"</span>,</div>
+<div class="line"><a name="l02226"></a><span class="lineno"> 2226</span>                                    <span class="stringliteral">"Y pixel / X pixel"</span>,</div>
+<div class="line"><a name="l02227"></a><span class="lineno"> 2227</span>                                    <span class="stringliteral">"Max observed slope in spectral tracing"</span>)) {</div>
+<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>             fors_pmos_calib_exit(<span class="stringliteral">"Cannot write max observed slope in spectral "</span></div>
+<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>                                  <span class="stringliteral">"tracing to QC log file"</span>);</div>
+<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>         }</div>
+<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>     }</div>
+<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span> </div>
+<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, polytraces, curv_coeff_tag, header,</div>
+<div class="line"><a name="l02234"></a><span class="lineno"> 2234</span>                        parlist, recipe, version)) {</div>
+<div class="line"><a name="l02235"></a><span class="lineno"> 2235</span>         fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02236"></a><span class="lineno"> 2236</span>     }</div>
+<div class="line"><a name="l02237"></a><span class="lineno"> 2237</span> </div>
+<div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l02240"></a><span class="lineno"> 2240</span> </div>
+<div class="line"><a name="l02241"></a><span class="lineno"> 2241</span>     <span class="comment">/* FIXLANDER It was slit_ident == 0 and </span></div>
+<div class="line"><a name="l02242"></a><span class="lineno"> 2242</span> <span class="comment">       it was in a different place above in the code */</span></div>
+<div class="line"><a name="l02243"></a><span class="lineno"> 2243</span> </div>
+<div class="line"><a name="l02244"></a><span class="lineno"> 2244</span>     <span class="keywordflow">if</span> (same_offset) {</div>
+<div class="line"><a name="l02245"></a><span class="lineno"> 2245</span>         cpl_table *globaltbl;</div>
+<div class="line"><a name="l02246"></a><span class="lineno"> 2246</span>         cpl_table *slitpos;</div>
+<div class="line"><a name="l02247"></a><span class="lineno"> 2247</span>         <span class="keywordtype">double</span>    *l_ytop;</div>
+<div class="line"><a name="l02248"></a><span class="lineno"> 2248</span>         <span class="keywordtype">int</span>       *l_id;</div>
+<div class="line"><a name="l02249"></a><span class="lineno"> 2249</span>         <span class="keywordtype">int</span>        npairs;</div>
+<div class="line"><a name="l02250"></a><span class="lineno"> 2250</span>         <span class="keywordtype">double</span>    *ytop   = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l02251"></a><span class="lineno"> 2251</span>         <span class="keywordtype">double</span>    *ybot   = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l02252"></a><span class="lineno"> 2252</span>         <span class="keywordtype">int</span>        k;</div>
+<div class="line"><a name="l02253"></a><span class="lineno"> 2253</span> <span class="comment">// int    *p_id;</span></div>
+<div class="line"><a name="l02254"></a><span class="lineno"> 2254</span> </div>
+<div class="line"><a name="l02255"></a><span class="lineno"> 2255</span>         <span class="comment">/* Just in case it has been modified */</span></div>
+<div class="line"><a name="l02256"></a><span class="lineno"> 2256</span>         nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l02257"></a><span class="lineno"> 2257</span> </div>
+<div class="line"><a name="l02258"></a><span class="lineno"> 2258</span>         cpl_table_new_column(slits, <span class="stringliteral">"pair_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l02259"></a><span class="lineno"> 2259</span> <span class="comment">// p_id   = cpl_table_get_data_int(slits, "pair_id");</span></div>
+<div class="line"><a name="l02260"></a><span class="lineno"> 2260</span> </div>
+<div class="line"><a name="l02261"></a><span class="lineno"> 2261</span>         <span class="keywordflow">if</span> (ccd_ysize == 400 || ccd_ysize == 500) {</div>
+<div class="line"><a name="l02262"></a><span class="lineno"> 2262</span>             </div>
+<div class="line"><a name="l02263"></a><span class="lineno"> 2263</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l02264"></a><span class="lineno"> 2264</span> <span class="comment">             * Special case with old FORS1 chip</span></div>
+<div class="line"><a name="l02265"></a><span class="lineno"> 2265</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l02266"></a><span class="lineno"> 2266</span> </div>
+<div class="line"><a name="l02267"></a><span class="lineno"> 2267</span>             l_ytop = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l02268"></a><span class="lineno"> 2268</span>             l_ytop[0] = 255.0;</div>
+<div class="line"><a name="l02269"></a><span class="lineno"> 2269</span>             l_id = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l02270"></a><span class="lineno"> 2270</span>             l_id[0] = 10;</div>
+<div class="line"><a name="l02271"></a><span class="lineno"> 2271</span>             npairs = 1;</div>
+<div class="line"><a name="l02272"></a><span class="lineno"> 2272</span>         }</div>
+<div class="line"><a name="l02273"></a><span class="lineno"> 2273</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02274"></a><span class="lineno"> 2274</span>             globaltbl = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, master_distortion_tag, 1);</div>
+<div class="line"><a name="l02275"></a><span class="lineno"> 2275</span>             slitpos = <a class="code" href="group__moses.html#gad9b2789388ba6564011d832d276b2ae6" title="Build the slit location table from a global distortions table.">mos_build_slit_location</a>(globaltbl, maskslits, ccd_ysize);</div>
+<div class="line"><a name="l02276"></a><span class="lineno"> 2276</span>             l_ytop = cpl_table_get_data_double(slitpos, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l02277"></a><span class="lineno"> 2277</span>             l_id   = cpl_table_get_data_int(slitpos, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l02278"></a><span class="lineno"> 2278</span>             npairs = cpl_table_get_nrow(slitpos);</div>
+<div class="line"><a name="l02279"></a><span class="lineno"> 2279</span>             <span class="keywordflow">if</span> (rebin_dist != rebin) {</div>
+<div class="line"><a name="l02280"></a><span class="lineno"> 2280</span>                 <span class="keywordtype">float</span> rescale = (float)rebin_dist / rebin;</div>
+<div class="line"><a name="l02281"></a><span class="lineno"> 2281</span>                 <span class="keywordflow">for</span> (i = 0; i < npairs; i++) {</div>
+<div class="line"><a name="l02282"></a><span class="lineno"> 2282</span>                    l_ytop[i] *= rescale;</div>
+<div class="line"><a name="l02283"></a><span class="lineno"> 2283</span>                 }</div>
+<div class="line"><a name="l02284"></a><span class="lineno"> 2284</span>             }</div>
+<div class="line"><a name="l02285"></a><span class="lineno"> 2285</span>         }</div>
+<div class="line"><a name="l02286"></a><span class="lineno"> 2286</span> </div>
+<div class="line"><a name="l02287"></a><span class="lineno"> 2287</span>         <span class="keywordflow">for</span> (k = 0; k < npairs; k++) {</div>
+<div class="line"><a name="l02288"></a><span class="lineno"> 2288</span>             <span class="keywordtype">int</span> h;</div>
+<div class="line"><a name="l02289"></a><span class="lineno"> 2289</span> </div>
+<div class="line"><a name="l02290"></a><span class="lineno"> 2290</span>             <span class="keywordflow">for</span> (h = 0; h < nslits; h++) {</div>
+<div class="line"><a name="l02291"></a><span class="lineno"> 2291</span> </div>
+<div class="line"><a name="l02292"></a><span class="lineno"> 2292</span>                 <span class="keywordflow">if</span> (l_ytop[k] < ytop[h] && l_ytop[k] > ybot[h]) {</div>
+<div class="line"><a name="l02293"></a><span class="lineno"> 2293</span>                     <span class="keywordflow">if</span> (h + 1 < nslits) {</div>
+<div class="line"><a name="l02294"></a><span class="lineno"> 2294</span>                         cpl_table_set_int(slits, <span class="stringliteral">"pair_id"</span>, h, l_id[k]);</div>
+<div class="line"><a name="l02295"></a><span class="lineno"> 2295</span>                         cpl_table_set_int(slits, <span class="stringliteral">"pair_id"</span>, h + 1, l_id[k]);</div>
+<div class="line"><a name="l02296"></a><span class="lineno"> 2296</span>                     }</div>
+<div class="line"><a name="l02297"></a><span class="lineno"> 2297</span>                 }</div>
+<div class="line"><a name="l02298"></a><span class="lineno"> 2298</span>             }</div>
+<div class="line"><a name="l02299"></a><span class="lineno"> 2299</span>         }</div>
+<div class="line"><a name="l02300"></a><span class="lineno"> 2300</span> </div>
+<div class="line"><a name="l02301"></a><span class="lineno"> 2301</span> <span class="comment">/* %%% */</span></div>
+<div class="line"><a name="l02302"></a><span class="lineno"> 2302</span> </div>
+<div class="line"><a name="l02303"></a><span class="lineno"> 2303</span>         cpl_table_fill_invalid_int(slits, <span class="stringliteral">"pair_id"</span>, -1);</div>
+<div class="line"><a name="l02304"></a><span class="lineno"> 2304</span> </div>
+<div class="line"><a name="l02305"></a><span class="lineno"> 2305</span>         <span class="keywordflow">if</span> (ccd_ysize == 400 || ccd_ysize == 500) {</div>
+<div class="line"><a name="l02306"></a><span class="lineno"> 2306</span>             cpl_free(l_ytop);</div>
+<div class="line"><a name="l02307"></a><span class="lineno"> 2307</span>             cpl_free(l_id);</div>
+<div class="line"><a name="l02308"></a><span class="lineno"> 2308</span>         }</div>
+<div class="line"><a name="l02309"></a><span class="lineno"> 2309</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02310"></a><span class="lineno"> 2310</span>             cpl_table_delete(slitpos);   slitpos   = NULL;</div>
+<div class="line"><a name="l02311"></a><span class="lineno"> 2311</span>             cpl_table_delete(globaltbl); globaltbl = NULL;</div>
+<div class="line"><a name="l02312"></a><span class="lineno"> 2312</span>     </div>
+<div class="line"><a name="l02313"></a><span class="lineno"> 2313</span>             cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l02314"></a><span class="lineno"> 2314</span>         }</div>
+<div class="line"><a name="l02315"></a><span class="lineno"> 2315</span>     }</div>
+<div class="line"><a name="l02316"></a><span class="lineno"> 2316</span> </div>
+<div class="line"><a name="l02317"></a><span class="lineno"> 2317</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,</div>
+<div class="line"><a name="l02318"></a><span class="lineno"> 2318</span>                        parlist, recipe, version)) {</div>
+<div class="line"><a name="l02319"></a><span class="lineno"> 2319</span>         fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02320"></a><span class="lineno"> 2320</span>     }</div>
+<div class="line"><a name="l02321"></a><span class="lineno"> 2321</span> </div>
+<div class="line"><a name="l02322"></a><span class="lineno"> 2322</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l02323"></a><span class="lineno"> 2323</span> </div>
+<div class="line"><a name="l02324"></a><span class="lineno"> 2324</span>     cpl_image_delete(spatial); spatial = NULL;</div>
+<div class="line"><a name="l02325"></a><span class="lineno"> 2325</span> </div>
+<div class="line"><a name="l02326"></a><span class="lineno"> 2326</span>     cpl_free(instrume); instrume = NULL;</div>
+<div class="line"><a name="l02327"></a><span class="lineno"> 2327</span> </div>
+<div class="line"><a name="l02328"></a><span class="lineno"> 2328</span>     cpl_table_delete(overscans); overscans = NULL;</div>
+<div class="line"><a name="l02329"></a><span class="lineno"> 2329</span>     cpl_image_delete(master_bias); master_bias = NULL;</div>
+<div class="line"><a name="l02330"></a><span class="lineno"> 2330</span>     cpl_image_delete(master_flat); master_flat = NULL;</div>
+<div class="line"><a name="l02331"></a><span class="lineno"> 2331</span> </div>
+<div class="line"><a name="l02332"></a><span class="lineno"> 2332</span>     cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l02333"></a><span class="lineno"> 2333</span>     cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l02334"></a><span class="lineno"> 2334</span> </div>
+<div class="line"><a name="l02335"></a><span class="lineno"> 2335</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l02336"></a><span class="lineno"> 2336</span>         cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l02337"></a><span class="lineno"> 2337</span>         fors_pmos_calib_exit(NULL);</div>
+<div class="line"><a name="l02338"></a><span class="lineno"> 2338</span>     }</div>
+<div class="line"><a name="l02339"></a><span class="lineno"> 2339</span> </div>
+<div class="line"><a name="l02340"></a><span class="lineno"> 2340</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l02341"></a><span class="lineno"> 2341</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__pmos__extract_8c-source.html b/html/fors__pmos__extract_8c-source.html
deleted file mode 100644
index 19b59e0..0000000
--- a/html/fors__pmos__extract_8c-source.html
+++ /dev/null
@@ -1,2876 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_pmos_extract.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_pmos_extract.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_pmos_extract.c,v 1.8 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <string.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <ctype.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <assert.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <moses.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_create(cpl_plugin *);
-<a name="l00044"></a>00044 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_exec(cpl_plugin *);
-<a name="l00045"></a>00045 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_destroy(cpl_plugin *);
-<a name="l00046"></a>00046 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract(cpl_parameterlist *, cpl_frameset *);
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="keyword">static</span> <span class="keywordtype">float</span> * fors_check_angles(cpl_frameset *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span> *);
-<a name="l00049"></a>00049 <span class="keyword">static</span> <span class="keywordtype">int</span>
-<a name="l00050"></a>00050 fors_find_angle_pos(<span class="keywordtype">float</span> * angles, <span class="keywordtype">int</span> nangles, <span class="keywordtype">float</span> angle);
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_pmos_extract_description[] =
-<a name="l00053"></a>00053 <span class="stringliteral">"This recipe is used to reduce scientific spectra using the extraction\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"mask and the products created by the recipe fors_mpol_calib. The spectra\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"are bias subtracted, flat fielded (if a normalised flat field is specified)\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"and remapped eliminating the optical distortions. The wavelength calibration\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"can be optionally upgraded using a number of sky lines: if no sky lines\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"catalog of wavelengths is specified, an internal one is used instead.\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"If the alignment to the sky lines is performed, the input dispersion\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"coefficients table is upgraded and saved to disk, and a new CCD wavelengths\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"map is created.\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. A grism table (typically\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"depending on the instrument mode, and in particular on the grism used)\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"may also be specified: this table contains a default recipe parameter\n"</span> 
-<a name="l00065"></a>00065 <span class="stringliteral">"setting to control the way spectra are extracted for a specific instrument\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"mode, as it is used for automatic run of the pipeline on Paranal and in\n"</span> 
-<a name="l00067"></a>00067 <span class="stringliteral">"Garching. If this table is specified, it will modify the default recipe\n"</span> 
-<a name="l00068"></a>00068 <span class="stringliteral">"parameter setting, with the exception of those parameters which have been\n"</span> 
-<a name="l00069"></a>00069 <span class="stringliteral">"explicitly modifyed on the command line. If a grism table is not specified,\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"the input recipe parameters values will always be read from the command\n"</span> 
-<a name="l00071"></a>00071 <span class="stringliteral">"line, or from an esorex configuration file if present, or from their\n"</span> 
-<a name="l00072"></a>00072 <span class="stringliteral">"generic default values (that are rarely meaningful).\n"</span> 
-<a name="l00073"></a>00073 <span class="stringliteral">"Either a scientific or a standard star exposure can be specified in input.\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"The acronym SCI on products should be read STD in case of standard stars\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"observations.\n\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00077"></a>00077 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00078"></a>00078 <span class="stringliteral">"  SCIENCE_PMOS                  Raw         Scientific exposure     Y\n"</span>
-<a name="l00079"></a>00079 <span class="stringliteral">"  or STANDARD_PMOS              Raw         Standard star exposure  Y\n"</span>
-<a name="l00080"></a>00080 <span class="stringliteral">"  MASTER_BIAS                   Calib       Master bias             Y\n"</span>
-<a name="l00081"></a>00081 <span class="stringliteral">"  GRISM_TABLE                   Calib       Grism table             .\n"</span>
-<a name="l00082"></a>00082 <span class="stringliteral">"  MASTER_SKYLINECAT             Calib       Sky lines catalog       .\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"  MASTER_NORM_FLAT_PMOS         Calib       Normalised flat field   .\n"</span>
-<a name="l00085"></a>00085 <span class="stringliteral">"  DISP_COEFF_PMOS               Calib       Inverse dispersion      Y\n"</span>
-<a name="l00086"></a>00086 <span class="stringliteral">"  CURV_COEFF_PMOS               Calib       Spectral curvature      Y\n"</span>
-<a name="l00087"></a>00087 <span class="stringliteral">"  SLIT_LOCATION_PMOS            Calib       Slits positions table   Y\n"</span>
-<a name="l00088"></a>00088 <span class="stringliteral">"  RETARDER_WAVEPLATE_CHROMATISM Calib       Chromatism correction   .\n"</span>
-<a name="l00089"></a>00089 <span class="stringliteral">"\n"</span>
-<a name="l00090"></a>00090 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"  REDUCED_SCI_PMOS             FITS image  Extracted scientific spectra\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"  REDUCED_SKY_SCI_PMOS         FITS image  Extracted sky spectra\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"  REDUCED_ERROR_SCI_PMOS       FITS image  Errors on extracted spectra\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"  REDUCED_SCI_X_PMOS           FITS image  X Stokes parameter (and L)\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"  REDUCED_ERROR_X_PMOS         FITS image  Error on X Stokes parameter\n"</span>
-<a name="l00097"></a>00097 <span class="stringliteral">"  REDUCED_NUL_X_PMOS           FITS image  Null parameter for X\n"</span>
-<a name="l00098"></a>00098 <span class="stringliteral">"  REDUCED_POL_ANGLE_PMOS       FITS image  Direction of linear polarization\n"</span>
-<a name="l00099"></a>00099 <span class="stringliteral">"  REDUCED_POL_ANGLE_ERROR_PMOS FITS image  Error on polarization direction\n"</span>
-<a name="l00100"></a>00100 <span class="stringliteral">"  UNMAPPED_SCI_PMOS            FITS image  Sky subtracted scientific spectra\n"</span>
-<a name="l00101"></a>00101 <span class="stringliteral">"  MAPPED_SCI_PMOS              FITS image  Rectified scientific spectra\n"</span>
-<a name="l00102"></a>00102 <span class="stringliteral">"  MAPPED_ALL_SCI_PMOS          FITS image  Rectified science spectra with sky\n"</span>
-<a name="l00103"></a>00103 <span class="stringliteral">"  MAPPED_SKY_SCI_PMOS          FITS image  Rectified sky spectra\n"</span>
-<a name="l00104"></a>00104 <span class="stringliteral">"  UNMAPPED_SKY_SCI_PMOS        FITS image  Sky on CCD\n"</span>
-<a name="l00105"></a>00105 <span class="stringliteral">"  GLOBAL_SKY_SPECTRUM_PMOS     FITS table  Global sky spectrum\n"</span>
-<a name="l00106"></a>00106 <span class="stringliteral">"  OBJECT_TABLE_SCI_PMOS        FITS table  Positions of detected objects\n"</span>
-<a name="l00107"></a>00107 <span class="stringliteral">"  OBJECT_TABLE_POL_SCI_PMOS    FITS table  Positions of real objects\n"</span>
-<a name="l00108"></a>00108 <span class="stringliteral">"\n"</span>
-<a name="l00109"></a>00109 <span class="stringliteral">"  Only if the sky-alignment of the wavelength solution is requested:\n"</span>
-<a name="l00110"></a>00110 <span class="stringliteral">"  DISP_COEFF_SCI_PMOS          FITS table  Upgraded dispersion coefficients\n"</span>
-<a name="l00111"></a>00111 <span class="stringliteral">"  WAVELENGTH_MAP_SCI_PMOS      FITS image  Upgraded wavelength map\n\n"</span>;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113 <span class="preprocessor">#define fors_pmos_extract_exit(message)            \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">{                                             \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">cpl_free(instrume);                           \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">cpl_image_delete(dummy);                      \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00121"></a>00121 <span class="preprocessor">cpl_image_delete(smapped);                    \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">cpl_table_delete(offsets);                    \</span>
-<a name="l00123"></a>00123 <span class="preprocessor">cpl_table_delete(sky);                        \</span>
-<a name="l00124"></a>00124 <span class="preprocessor">cpl_image_delete(bias);                       \</span>
-<a name="l00125"></a>00125 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00126"></a>00126 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00127"></a>00127 <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span>
-<a name="l00128"></a>00128 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00129"></a>00129 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00130"></a>00130 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00131"></a>00131 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00132"></a>00132 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00133"></a>00133 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00134"></a>00134 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00135"></a>00135 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00136"></a>00136 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00137"></a>00137 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00138"></a>00138 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00139"></a>00139 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00140"></a>00140 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00141"></a>00141 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00142"></a>00142 <span class="preprocessor">}</span>
-<a name="l00143"></a>00143 <span class="preprocessor"></span>
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145 <span class="preprocessor">#define fors_pmos_extract_exit_memcheck(message)   \</span>
-<a name="l00146"></a>00146 <span class="preprocessor">{                                             \</span>
-<a name="l00147"></a>00147 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span>
-<a name="l00148"></a>00148 <span class="preprocessor">cpl_free(instrume);                           \</span>
-<a name="l00149"></a>00149 <span class="preprocessor">cpl_image_delete(dummy);                      \</span>
-<a name="l00150"></a>00150 <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span>
-<a name="l00151"></a>00151 <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span>
-<a name="l00152"></a>00152 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00153"></a>00153 <span class="preprocessor">cpl_image_delete(smapped);                    \</span>
-<a name="l00154"></a>00154 <span class="preprocessor">cpl_table_delete(offsets);                    \</span>
-<a name="l00155"></a>00155 <span class="preprocessor">cpl_table_delete(sky);                        \</span>
-<a name="l00156"></a>00156 <span class="preprocessor">cpl_image_delete(bias);                       \</span>
-<a name="l00157"></a>00157 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00158"></a>00158 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00159"></a>00159 <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span>
-<a name="l00160"></a>00160 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00161"></a>00161 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00162"></a>00162 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00163"></a>00163 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00164"></a>00164 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00165"></a>00165 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00166"></a>00166 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00167"></a>00167 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00168"></a>00168 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00169"></a>00169 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00170"></a>00170 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00171"></a>00171 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00172"></a>00172 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00173"></a>00173 <span class="preprocessor">return 0;                                     \</span>
-<a name="l00174"></a>00174 <span class="preprocessor">}</span>
-<a name="l00175"></a>00175 <span class="preprocessor"></span>
-<a name="l00176"></a>00176 
-<a name="l00188"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00188</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00189"></a>00189 {
-<a name="l00190"></a>00190     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00191"></a>00191     cpl_plugin *plugin = &recipe->interface;
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     cpl_plugin_init(plugin,
-<a name="l00194"></a>00194                     CPL_PLUGIN_API,
-<a name="l00195"></a>00195                     FORS_BINARY_VERSION,
-<a name="l00196"></a>00196                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00197"></a>00197                     <span class="stringliteral">"fors_pmos_extract"</span>,
-<a name="l00198"></a>00198                     <span class="stringliteral">"Extraction of scientific spectra"</span>,
-<a name="l00199"></a>00199                     fors_pmos_extract_description,
-<a name="l00200"></a>00200                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00201"></a>00201                     PACKAGE_BUGREPORT,
-<a name="l00202"></a>00202     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00203"></a>00203     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00204"></a>00204     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00205"></a>00205     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00206"></a>00206     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00207"></a>00207     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00208"></a>00208     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00209"></a>00209     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00210"></a>00210     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00211"></a>00211     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00212"></a>00212     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00213"></a>00213     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00214"></a>00214     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00215"></a>00215                     fors_pmos_extract_create,
-<a name="l00216"></a>00216                     fors_pmos_extract_exec,
-<a name="l00217"></a>00217                     fors_pmos_extract_destroy);
-<a name="l00218"></a>00218 
-<a name="l00219"></a>00219     cpl_pluginlist_append(list, plugin);
-<a name="l00220"></a>00220     
-<a name="l00221"></a>00221     <span class="keywordflow">return</span> 0;
-<a name="l00222"></a>00222 }
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224 
-<a name="l00235"></a>00235 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_create(cpl_plugin *plugin)
-<a name="l00236"></a>00236 {
-<a name="l00237"></a>00237     cpl_recipe    *recipe;
-<a name="l00238"></a>00238     cpl_parameter *p;
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240 
-<a name="l00241"></a>00241     <span class="comment">/* </span>
-<a name="l00242"></a>00242 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00243"></a>00243 <span class="comment">     */</span>
-<a name="l00244"></a>00244 
-<a name="l00245"></a>00245     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00246"></a>00246         recipe = (cpl_recipe *)plugin;
-<a name="l00247"></a>00247     <span class="keywordflow">else</span> 
-<a name="l00248"></a>00248         <span class="keywordflow">return</span> -1;
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250     <span class="comment">/* </span>
-<a name="l00251"></a>00251 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00252"></a>00252 <span class="comment">     */</span>
-<a name="l00253"></a>00253 
-<a name="l00254"></a>00254     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257     <span class="comment">/*</span>
-<a name="l00258"></a>00258 <span class="comment">     * Dispersion</span>
-<a name="l00259"></a>00259 <span class="comment">     */</span>
-<a name="l00260"></a>00260 
-<a name="l00261"></a>00261     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.dispersion"</span>,
-<a name="l00262"></a>00262                                 CPL_TYPE_DOUBLE,
-<a name="l00263"></a>00263                                 <span class="stringliteral">"Resampling step (Angstrom/pixel)"</span>,
-<a name="l00264"></a>00264                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00265"></a>00265                                 0.0);
-<a name="l00266"></a>00266     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00267"></a>00267     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00268"></a>00268     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     <span class="comment">/*</span>
-<a name="l00271"></a>00271 <span class="comment">     * Sky lines alignment</span>
-<a name="l00272"></a>00272 <span class="comment">     */</span>
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.skyalign"</span>,
-<a name="l00275"></a>00275                                 CPL_TYPE_INT,
-<a name="l00276"></a>00276                                 <span class="stringliteral">"Polynomial order for sky lines alignment, "</span>
-<a name="l00277"></a>00277                                 <span class="stringliteral">"or -1 to avoid alignment"</span>,
-<a name="l00278"></a>00278                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00279"></a>00279                                 0);
-<a name="l00280"></a>00280     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);
-<a name="l00281"></a>00281     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00282"></a>00282     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     <span class="comment">/*</span>
-<a name="l00285"></a>00285 <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span>
-<a name="l00286"></a>00286 <span class="comment">     */</span>
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.wcolumn"</span>,
-<a name="l00289"></a>00289                                 CPL_TYPE_STRING,
-<a name="l00290"></a>00290                                 <span class="stringliteral">"Name of sky line catalog table column "</span>
-<a name="l00291"></a>00291                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00292"></a>00292                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00293"></a>00293                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00294"></a>00294     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00295"></a>00295     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00296"></a>00296     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00297"></a>00297 
-<a name="l00298"></a>00298     <span class="comment">/*</span>
-<a name="l00299"></a>00299 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00300"></a>00300 <span class="comment">     */</span>
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.startwavelength"</span>,
-<a name="l00303"></a>00303                                 CPL_TYPE_DOUBLE,
-<a name="l00304"></a>00304                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00305"></a>00305                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00306"></a>00306                                 0.0);
-<a name="l00307"></a>00307     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00308"></a>00308     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00309"></a>00309     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311     <span class="comment">/*</span>
-<a name="l00312"></a>00312 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00313"></a>00313 <span class="comment">     */</span>
-<a name="l00314"></a>00314 
-<a name="l00315"></a>00315     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.endwavelength"</span>,
-<a name="l00316"></a>00316                                 CPL_TYPE_DOUBLE,
-<a name="l00317"></a>00317                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00318"></a>00318                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00319"></a>00319                                 0.0);
-<a name="l00320"></a>00320     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00321"></a>00321     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00322"></a>00322     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00323"></a>00323 
-<a name="l00324"></a>00324     <span class="comment">/*</span>
-<a name="l00325"></a>00325 <span class="comment">     * Flux conservation</span>
-<a name="l00326"></a>00326 <span class="comment">     */</span>
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.flux"</span>,
-<a name="l00329"></a>00329                                 CPL_TYPE_BOOL,
-<a name="l00330"></a>00330                                 <span class="stringliteral">"Apply flux conservation"</span>,
-<a name="l00331"></a>00331                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00332"></a>00332                                 TRUE);
-<a name="l00333"></a>00333     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);
-<a name="l00334"></a>00334     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00335"></a>00335     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     <span class="comment">/*</span>
-<a name="l00338"></a>00338 <span class="comment">     * Apply flat field</span>
-<a name="l00339"></a>00339 <span class="comment">     */</span>
-<a name="l00340"></a>00340 
-<a name="l00341"></a>00341     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.flatfield"</span>,
-<a name="l00342"></a>00342                                 CPL_TYPE_BOOL,
-<a name="l00343"></a>00343                                 <span class="stringliteral">"Apply flat field"</span>,
-<a name="l00344"></a>00344                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00345"></a>00345                                 FALSE);
-<a name="l00346"></a>00346     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flatfield"</span>);
-<a name="l00347"></a>00347     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00348"></a>00348     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00349"></a>00349 
-<a name="l00350"></a>00350     <span class="comment">/*</span>
-<a name="l00351"></a>00351 <span class="comment">     * Global sky subtraction</span>
-<a name="l00352"></a>00352 <span class="comment">     */</span>
-<a name="l00353"></a>00353 
-<a name="l00354"></a>00354     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.skyglobal"</span>,
-<a name="l00355"></a>00355                                 CPL_TYPE_BOOL,
-<a name="l00356"></a>00356                                 <span class="stringliteral">"Subtract global sky spectrum from CCD"</span>,
-<a name="l00357"></a>00357                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00358"></a>00358                                 FALSE);
-<a name="l00359"></a>00359     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyglobal"</span>);
-<a name="l00360"></a>00360     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00361"></a>00361     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00362"></a>00362 
-<a name="l00363"></a>00363     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.skymedian"</span>,
-<a name="l00364"></a>00364                                 CPL_TYPE_BOOL,
-<a name="l00365"></a>00365                                 <span class="stringliteral">"Sky subtraction from extracted slit spectra"</span>,
-<a name="l00366"></a>00366                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00367"></a>00367                                 FALSE);
-<a name="l00368"></a>00368     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skymedian"</span>);
-<a name="l00369"></a>00369     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00370"></a>00370     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00371"></a>00371 
-<a name="l00372"></a>00372     <span class="comment">/*</span>
-<a name="l00373"></a>00373 <span class="comment">     * Local sky subtraction on CCD spectra</span>
-<a name="l00374"></a>00374 <span class="comment">     */</span>
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.skylocal"</span>,
-<a name="l00377"></a>00377                                 CPL_TYPE_BOOL,
-<a name="l00378"></a>00378                                 <span class="stringliteral">"Sky subtraction from CCD slit spectra"</span>,
-<a name="l00379"></a>00379                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00380"></a>00380                                 TRUE);
-<a name="l00381"></a>00381     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skylocal"</span>);
-<a name="l00382"></a>00382     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00383"></a>00383     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385     <span class="comment">/*</span>
-<a name="l00386"></a>00386 <span class="comment">     * Cosmic rays removal</span>
-<a name="l00387"></a>00387 <span class="comment">     */</span>
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.cosmics"</span>,
-<a name="l00390"></a>00390                                 CPL_TYPE_BOOL,
-<a name="l00391"></a>00391                                 <span class="stringliteral">"Eliminate cosmic rays hits (only if global "</span>
-<a name="l00392"></a>00392                                 <span class="stringliteral">"sky subtraction is also requested)"</span>,
-<a name="l00393"></a>00393                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00394"></a>00394                                 FALSE);
-<a name="l00395"></a>00395     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);
-<a name="l00396"></a>00396     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00397"></a>00397     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00398"></a>00398 
-<a name="l00399"></a>00399     <span class="comment">/*</span>
-<a name="l00400"></a>00400 <span class="comment">     * Slit margin</span>
-<a name="l00401"></a>00401 <span class="comment">     */</span>
-<a name="l00402"></a>00402 
-<a name="l00403"></a>00403     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.slit_margin"</span>,
-<a name="l00404"></a>00404                                 CPL_TYPE_INT,
-<a name="l00405"></a>00405                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span>
-<a name="l00406"></a>00406                                 <span class="stringliteral">"in object detection and extraction"</span>,
-<a name="l00407"></a>00407                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00408"></a>00408                                 3);
-<a name="l00409"></a>00409     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);
-<a name="l00410"></a>00410     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00411"></a>00411     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00412"></a>00412 
-<a name="l00413"></a>00413     <span class="comment">/*</span>
-<a name="l00414"></a>00414 <span class="comment">     * Extraction radius</span>
-<a name="l00415"></a>00415 <span class="comment">     */</span>
-<a name="l00416"></a>00416 
-<a name="l00417"></a>00417     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.ext_radius"</span>,
-<a name="l00418"></a>00418                                 CPL_TYPE_INT,
-<a name="l00419"></a>00419                                 <span class="stringliteral">"Maximum extraction radius for detected "</span>
-<a name="l00420"></a>00420                                 <span class="stringliteral">"objects (pixel)"</span>,
-<a name="l00421"></a>00421                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00422"></a>00422                                 6);
-<a name="l00423"></a>00423     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);
-<a name="l00424"></a>00424     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00425"></a>00425     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00426"></a>00426 
-<a name="l00427"></a>00427     <span class="comment">/*</span>
-<a name="l00428"></a>00428 <span class="comment">     * Contamination radius</span>
-<a name="l00429"></a>00429 <span class="comment">     */</span>
-<a name="l00430"></a>00430 
-<a name="l00431"></a>00431     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.cont_radius"</span>,
-<a name="l00432"></a>00432                                 CPL_TYPE_INT,
-<a name="l00433"></a>00433                                 <span class="stringliteral">"Minimum distance at which two objects "</span>
-<a name="l00434"></a>00434                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span>
-<a name="l00435"></a>00435                                 <span class="stringliteral">"each other (pixel)"</span>,
-<a name="l00436"></a>00436                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00437"></a>00437                                 0);
-<a name="l00438"></a>00438     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);
-<a name="l00439"></a>00439     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00440"></a>00440     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00441"></a>00441 
-<a name="l00442"></a>00442     <span class="comment">/*</span>
-<a name="l00443"></a>00443 <span class="comment">     * Object extraction method</span>
-<a name="l00444"></a>00444 <span class="comment">     */</span>
-<a name="l00445"></a>00445 
-<a name="l00446"></a>00446     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.ext_mode"</span>,
-<a name="l00447"></a>00447                                 CPL_TYPE_INT,
-<a name="l00448"></a>00448                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span>
-<a name="l00449"></a>00449                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,
-<a name="l00450"></a>00450                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00451"></a>00451                                 1);
-<a name="l00452"></a>00452     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);
-<a name="l00453"></a>00453     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00454"></a>00454     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00455"></a>00455 
-<a name="l00456"></a>00456     <span class="comment">/*</span>
-<a name="l00457"></a>00457 <span class="comment">     * Normalise output by exposure time</span>
-<a name="l00458"></a>00458 <span class="comment">     */</span>
-<a name="l00459"></a>00459 
-<a name="l00460"></a>00460     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.time_normalise"</span>,
-<a name="l00461"></a>00461                                 CPL_TYPE_BOOL,
-<a name="l00462"></a>00462                                 <span class="stringliteral">"Normalise output spectra by the exposure time"</span>,
-<a name="l00463"></a>00463                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00464"></a>00464                                 TRUE);
-<a name="l00465"></a>00465     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"time_normalise"</span>);
-<a name="l00466"></a>00466     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00467"></a>00467     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00468"></a>00468 
-<a name="l00469"></a>00469     <span class="comment">/*</span>
-<a name="l00470"></a>00470 <span class="comment">     * Apply chromatism correction to polarization angle</span>
-<a name="l00471"></a>00471 <span class="comment">     */</span>
-<a name="l00472"></a>00472 
-<a name="l00473"></a>00473     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.chromatism"</span>,
-<a name="l00474"></a>00474                                 CPL_TYPE_BOOL,
-<a name="l00475"></a>00475                                 <span class="stringliteral">"Chromatism correction to polarization angles"</span>,
-<a name="l00476"></a>00476                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00477"></a>00477                                 TRUE);
-<a name="l00478"></a>00478     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"chromatism"</span>);
-<a name="l00479"></a>00479     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00480"></a>00480     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00481"></a>00481 
-<a name="l00482"></a>00482     <span class="comment">/*</span>
-<a name="l00483"></a>00483 <span class="comment">     * Create check products</span>
-<a name="l00484"></a>00484 <span class="comment">     */</span>
-<a name="l00485"></a>00485 
-<a name="l00486"></a>00486     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.check"</span>,
-<a name="l00487"></a>00487                                 CPL_TYPE_BOOL,
-<a name="l00488"></a>00488                                 <span class="stringliteral">"Create intermediate products"</span>,
-<a name="l00489"></a>00489                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,
-<a name="l00490"></a>00490                                 FALSE);
-<a name="l00491"></a>00491     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"check"</span>);
-<a name="l00492"></a>00492     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00493"></a>00493     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00494"></a>00494 
-<a name="l00495"></a>00495     <span class="keywordflow">return</span> 0;
-<a name="l00496"></a>00496 }
-<a name="l00497"></a>00497 
-<a name="l00498"></a>00498 
-<a name="l00507"></a>00507 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_exec(cpl_plugin *plugin)
-<a name="l00508"></a>00508 {
-<a name="l00509"></a>00509     cpl_recipe *recipe;
-<a name="l00510"></a>00510     
-<a name="l00511"></a>00511     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00512"></a>00512         recipe = (cpl_recipe *)plugin;
-<a name="l00513"></a>00513     <span class="keywordflow">else</span> 
-<a name="l00514"></a>00514         <span class="keywordflow">return</span> -1;
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516     <span class="keywordflow">return</span> fors_pmos_extract(recipe->parameters, recipe->frames);
-<a name="l00517"></a>00517 }
-<a name="l00518"></a>00518 
-<a name="l00519"></a>00519 
-<a name="l00528"></a>00528 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_destroy(cpl_plugin *plugin)
-<a name="l00529"></a>00529 {
-<a name="l00530"></a>00530     cpl_recipe *recipe;
-<a name="l00531"></a>00531     
-<a name="l00532"></a>00532     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00533"></a>00533         recipe = (cpl_recipe *)plugin;
-<a name="l00534"></a>00534     <span class="keywordflow">else</span> 
-<a name="l00535"></a>00535         <span class="keywordflow">return</span> -1;
-<a name="l00536"></a>00536 
-<a name="l00537"></a>00537     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539     <span class="keywordflow">return</span> 0;
-<a name="l00540"></a>00540 }
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542 
-<a name="l00552"></a>00552 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00553"></a>00553 {
-<a name="l00554"></a>00554 
-<a name="l00555"></a>00555     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_pmos_extract"</span>;
-<a name="l00556"></a>00556 
-<a name="l00557"></a>00557 
-<a name="l00558"></a>00558     <span class="comment">/*</span>
-<a name="l00559"></a>00559 <span class="comment">     * Input parameters</span>
-<a name="l00560"></a>00560 <span class="comment">     */</span>
-<a name="l00561"></a>00561 
-<a name="l00562"></a>00562     <span class="keywordtype">double</span>      dispersion;
-<a name="l00563"></a>00563     <span class="keywordtype">int</span>         skyalign;
-<a name="l00564"></a>00564     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00565"></a>00565     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00566"></a>00566     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00567"></a>00567     <span class="keywordtype">int</span>         flux;
-<a name="l00568"></a>00568     <span class="keywordtype">int</span>         flatfield;
-<a name="l00569"></a>00569     <span class="keywordtype">int</span>         skyglobal;
-<a name="l00570"></a>00570     <span class="keywordtype">int</span>         skylocal;
-<a name="l00571"></a>00571     <span class="keywordtype">int</span>         skymedian;
-<a name="l00572"></a>00572     <span class="keywordtype">int</span>         chromatism;
-<a name="l00573"></a>00573     <span class="keywordtype">int</span>         cosmics;
-<a name="l00574"></a>00574     <span class="keywordtype">int</span>         slit_margin;
-<a name="l00575"></a>00575     <span class="keywordtype">int</span>         ext_radius;
-<a name="l00576"></a>00576     <span class="keywordtype">int</span>         cont_radius;
-<a name="l00577"></a>00577     <span class="keywordtype">int</span>         ext_mode;
-<a name="l00578"></a>00578     <span class="keywordtype">int</span>         time_normalise;
-<a name="l00579"></a>00579     <span class="keywordtype">int</span>         check;
-<a name="l00580"></a>00580 
-<a name="l00581"></a>00581     <span class="comment">/*</span>
-<a name="l00582"></a>00582 <span class="comment">     * CPL objects</span>
-<a name="l00583"></a>00583 <span class="comment">     */</span>
-<a name="l00584"></a>00584 
-<a name="l00585"></a>00585     cpl_image       **images;
-<a name="l00586"></a>00586 
-<a name="l00587"></a>00587     cpl_image       **reduceds       = NULL;
-<a name="l00588"></a>00588     cpl_image       **rerrors        = NULL;
-<a name="l00589"></a>00589     cpl_table       **slitss         = NULL;
-<a name="l00590"></a>00590     cpl_image       **mappeds        = NULL;
-<a name="l00591"></a>00591     cpl_image       **skylocalmaps   = NULL;
-<a name="l00592"></a>00592     
-<a name="l00593"></a>00593     <span class="keywordtype">int</span> nobjects = 0;
-<a name="l00594"></a>00594 
-<a name="l00595"></a>00595     cpl_image        *bias           = NULL;
-<a name="l00596"></a>00596     cpl_image        *norm_flat      = NULL;
-<a name="l00597"></a>00597     cpl_image        *spectra        = NULL;
-<a name="l00598"></a>00598     cpl_image        *rectified      = NULL;
-<a name="l00599"></a>00599     cpl_image        *coordinate     = NULL;
-<a name="l00600"></a>00600     cpl_image        *rainbow        = NULL;
-<a name="l00601"></a>00601     cpl_image        *mapped         = NULL;
-<a name="l00602"></a>00602     cpl_image        *mapped_sky     = NULL;
-<a name="l00603"></a>00603     cpl_image        *mapped_cleaned = NULL;
-<a name="l00604"></a>00604     cpl_image        *smapped        = NULL;
-<a name="l00605"></a>00605     cpl_image        *wavemap        = NULL;
-<a name="l00606"></a>00606     cpl_image        *skymap         = NULL;
-<a name="l00607"></a>00607     cpl_image        *skylocalmap    = NULL;
-<a name="l00608"></a>00608     cpl_image        *dummy          = NULL;
-<a name="l00609"></a>00609 
-<a name="l00610"></a>00610     cpl_table        *grism_table    = NULL;
-<a name="l00611"></a>00611     cpl_table        *overscans      = NULL;
-<a name="l00612"></a>00612     cpl_table        *wavelengths    = NULL;
-<a name="l00613"></a>00613     cpl_table        *idscoeff       = NULL;
-<a name="l00614"></a>00614     cpl_table        *slits          = NULL;
-<a name="l00615"></a>00615     cpl_table        *origslits     = NULL;
-<a name="l00616"></a>00616     cpl_table        *maskslits      = NULL;
-<a name="l00617"></a>00617     cpl_table        *polytraces     = NULL;
-<a name="l00618"></a>00618     cpl_table        *offsets        = NULL;
-<a name="l00619"></a>00619     cpl_table        *sky            = NULL;
-<a name="l00620"></a>00620 
-<a name="l00621"></a>00621     cpl_vector       *lines          = NULL;
-<a name="l00622"></a>00622 
-<a name="l00623"></a>00623     cpl_propertylist *header         = NULL;
-<a name="l00624"></a>00624     cpl_propertylist *save_header    = NULL;
-<a name="l00625"></a>00625 
-<a name="l00626"></a>00626     cpl_table        *global         = NULL;
-<a name="l00627"></a>00627     <span class="comment">/*</span>
-<a name="l00628"></a>00628 <span class="comment">     * Auxiliary variables</span>
-<a name="l00629"></a>00629 <span class="comment">     */</span>
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631     <span class="keywordtype">char</span>    version[80];
-<a name="l00632"></a>00632     <span class="keywordtype">char</span>   *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00633"></a>00633     <span class="keyword">const</span> <span class="keywordtype">char</span>   *science_tag;
-<a name="l00634"></a>00634     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_norm_flat_tag;
-<a name="l00635"></a>00635     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_coeff_sky_tag;
-<a name="l00636"></a>00636     <span class="keyword">const</span> <span class="keywordtype">char</span>   *wavelength_map_sky_tag;
-<a name="l00637"></a>00637     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_science_tag;
-<a name="l00638"></a>00638     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_sky_tag;
-<a name="l00639"></a>00639     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_tag;
-<a name="l00640"></a>00640     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_science_tag;
-<a name="l00641"></a>00641     <span class="keyword">const</span> <span class="keywordtype">char</span>   *unmapped_science_tag;
-<a name="l00642"></a>00642     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_science_sky_tag;
-<a name="l00643"></a>00643     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_sky_tag;
-<a name="l00644"></a>00644     <span class="keyword">const</span> <span class="keywordtype">char</span>   *unmapped_sky_tag;
-<a name="l00645"></a>00645     <span class="keyword">const</span> <span class="keywordtype">char</span>   *global_sky_spectrum_tag;
-<a name="l00646"></a>00646     <span class="keyword">const</span> <span class="keywordtype">char</span>   *object_table_tag;
-<a name="l00647"></a>00647     <span class="keyword">const</span> <span class="keywordtype">char</span>   *object_table_pol_tag;
-<a name="l00648"></a>00648     <span class="keyword">const</span> <span class="keywordtype">char</span>   *skylines_offsets_tag;
-<a name="l00649"></a>00649     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_q_tag;
-<a name="l00650"></a>00650     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_u_tag;
-<a name="l00651"></a>00651     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_v_tag;
-<a name="l00652"></a>00652     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_l_tag;
-<a name="l00653"></a>00653     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_q_tag;
-<a name="l00654"></a>00654     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_u_tag;
-<a name="l00655"></a>00655     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_v_tag;
-<a name="l00656"></a>00656     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_l_tag;
-<a name="l00657"></a>00657     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_q_tag;
-<a name="l00658"></a>00658     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_u_tag;
-<a name="l00659"></a>00659     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_v_tag;
-<a name="l00660"></a>00660     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_angle_tag;
-<a name="l00661"></a>00661     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_angle_tag;
-<a name="l00662"></a>00662     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_distortion_tag = <span class="stringliteral">"MASTER_DISTORTION_TABLE"</span>;
-<a name="l00663"></a>00663     <span class="keyword">const</span> <span class="keywordtype">char</span>   *chrom_table_tag = <span class="stringliteral">"RETARDER_WAVEPLATE_CHROMATISM"</span>;
-<a name="l00664"></a>00664     <span class="keywordtype">float</span> *angles = NULL;
-<a name="l00665"></a>00665     <span class="keywordtype">int</span>     pmos, circ;
-<a name="l00666"></a>00666     <span class="keywordtype">int</span>     nscience;
-<a name="l00667"></a>00667     <span class="keywordtype">double</span>  alltime;
-<a name="l00668"></a>00668     <span class="keywordtype">double</span>  mean_rms;
-<a name="l00669"></a>00669     <span class="keywordtype">int</span>     nlines;
-<a name="l00670"></a>00670     <span class="keywordtype">int</span>     rebin;
-<a name="l00671"></a>00671     <span class="keywordtype">double</span> *line;
-<a name="l00672"></a>00672     <span class="keywordtype">int</span>     nx = 0, ny;
-<a name="l00673"></a>00673     <span class="keywordtype">int</span>     ccd_xsize, ccd_ysize;
-<a name="l00674"></a>00674     <span class="keywordtype">double</span>  reference;
-<a name="l00675"></a>00675     <span class="keywordtype">double</span>  gain;
-<a name="l00676"></a>00676     <span class="keywordtype">double</span>  <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>;
-<a name="l00677"></a>00677     <span class="keywordtype">int</span>     standard;
-<a name="l00678"></a>00678     <span class="keywordtype">int</span>     highres;
-<a name="l00679"></a>00679     <span class="keywordtype">int</span>     i, j;
-<a name="l00680"></a>00680     cpl_error_code error;
-<a name="l00681"></a>00681 
-<a name="l00682"></a>00682     <span class="keywordtype">int</span> * nobjs_per_slit;
-<a name="l00683"></a>00683     <span class="keywordtype">int</span>   nslits_out_det = 0;
-<a name="l00684"></a>00684 
-<a name="l00685"></a>00685 
-<a name="l00686"></a>00686     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00687"></a>00687 
-<a name="l00688"></a>00688     cpl_msg_set_indentation(2);
-<a name="l00689"></a>00689 
-<a name="l00690"></a>00690     <span class="comment">/* </span>
-<a name="l00691"></a>00691 <span class="comment">     * Get configuration parameters</span>
-<a name="l00692"></a>00692 <span class="comment">     */</span>
-<a name="l00693"></a>00693 
-<a name="l00694"></a>00694     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00695"></a>00695     cpl_msg_indent_more();
-<a name="l00696"></a>00696 
-<a name="l00697"></a>00697     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00698"></a>00698         fors_pmos_extract_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00701"></a>00701 
-<a name="l00702"></a>00702     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00703"></a>00703                     <span class="stringliteral">"fors.fors_pmos_extract.dispersion"</span>, grism_table);
-<a name="l00704"></a>00704 
-<a name="l00705"></a>00705     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00706"></a>00706         fors_pmos_extract_exit(<span class="stringliteral">"Invalid resampling step"</span>);
-<a name="l00707"></a>00707 
-<a name="l00708"></a>00708     skyalign = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00709"></a>00709                     <span class="stringliteral">"fors.fors_pmos_extract.skyalign"</span>, NULL);
-<a name="l00710"></a>00710 
-<a name="l00711"></a>00711     <span class="keywordflow">if</span> (skyalign > 2)
-<a name="l00712"></a>00712         fors_pmos_extract_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);
-<a name="l00713"></a>00713 
-<a name="l00714"></a>00714     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00715"></a>00715                     <span class="stringliteral">"fors.fors_pmos_extract.wcolumn"</span>, NULL);
-<a name="l00716"></a>00716 
-<a name="l00717"></a>00717     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00718"></a>00718                     <span class="stringliteral">"fors.fors_pmos_extract.startwavelength"</span>, grism_table);
-<a name="l00719"></a>00719     <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00720"></a>00720         fors_pmos_extract_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00721"></a>00721 
-<a name="l00722"></a>00722     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00723"></a>00723                     <span class="stringliteral">"fors.fors_pmos_extract.endwavelength"</span>, grism_table);
-<a name="l00724"></a>00724     <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00725"></a>00725         fors_pmos_extract_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00726"></a>00726 
-<a name="l00727"></a>00727     <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00728"></a>00728         fors_pmos_extract_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00729"></a>00729 
-<a name="l00730"></a>00730     flux = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.flux"</span>, NULL);
-<a name="l00731"></a>00731 
-<a name="l00732"></a>00732     flatfield = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.flatfield"</span>, 
-<a name="l00733"></a>00733                                        NULL);
-<a name="l00734"></a>00734 
-<a name="l00735"></a>00735     skyglobal = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.skyglobal"</span>, 
-<a name="l00736"></a>00736                                        NULL);
-<a name="l00737"></a>00737     skylocal  = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.skylocal"</span>, 
-<a name="l00738"></a>00738                                        NULL);
-<a name="l00739"></a>00739     skymedian = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.skymedian"</span>, 
-<a name="l00740"></a>00740                                        NULL);
-<a name="l00741"></a>00741 <span class="comment">/* NSS</span>
-<a name="l00742"></a>00742 <span class="comment">    skymedian = dfs_get_parameter_int(parlist, "fors.fors_pmos_extract.skymedian", </span>
-<a name="l00743"></a>00743 <span class="comment">                                       NULL);</span>
-<a name="l00744"></a>00744 <span class="comment">*/</span>
-<a name="l00745"></a>00745     
-<a name="l00746"></a>00746     chromatism = 
-<a name="l00747"></a>00747     <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.chromatism"</span>, 
-<a name="l00748"></a>00748                    NULL);
-<a name="l00749"></a>00749 
-<a name="l00750"></a>00750     <span class="keywordflow">if</span> (skylocal && skyglobal)
-<a name="l00751"></a>00751         fors_pmos_extract_exit(<span class="stringliteral">"Cannot apply both local and global sky subtraction"</span>);
-<a name="l00752"></a>00752 
-<a name="l00753"></a>00753     <span class="keywordflow">if</span> (skylocal && skymedian)
-<a name="l00754"></a>00754         fors_pmos_extract_exit(<span class="stringliteral">"Cannot apply sky subtraction both on extracted "</span>
-<a name="l00755"></a>00755                           <span class="stringliteral">"and non-extracted spectra"</span>);
-<a name="l00756"></a>00756 
-<a name="l00757"></a>00757     cosmics = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00758"></a>00758                                      <span class="stringliteral">"fors.fors_pmos_extract.cosmics"</span>, NULL);
-<a name="l00759"></a>00759 
-<a name="l00760"></a>00760     <span class="keywordflow">if</span> (cosmics)
-<a name="l00761"></a>00761         <span class="keywordflow">if</span> (!(skyglobal || skylocal))
-<a name="l00762"></a>00762             fors_pmos_extract_exit(<span class="stringliteral">"Cosmic rays correction requires "</span>
-<a name="l00763"></a>00763                               <span class="stringliteral">"either skylocal=true or skyglobal=true"</span>);
-<a name="l00764"></a>00764 
-<a name="l00765"></a>00765     slit_margin = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00766"></a>00766                                         <span class="stringliteral">"fors.fors_pmos_extract.slit_margin"</span>,
-<a name="l00767"></a>00767                                         NULL);
-<a name="l00768"></a>00768     <span class="keywordflow">if</span> (slit_margin < 0)
-<a name="l00769"></a>00769         fors_pmos_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00770"></a>00770 
-<a name="l00771"></a>00771     ext_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.ext_radius"</span>,
-<a name="l00772"></a>00772                                        NULL);
-<a name="l00773"></a>00773     <span class="keywordflow">if</span> (ext_radius < 0)
-<a name="l00774"></a>00774         fors_pmos_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00775"></a>00775 
-<a name="l00776"></a>00776     cont_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00777"></a>00777                                         <span class="stringliteral">"fors.fors_pmos_extract.cont_radius"</span>,
-<a name="l00778"></a>00778                                         NULL);
-<a name="l00779"></a>00779     <span class="keywordflow">if</span> (cont_radius < 0)
-<a name="l00780"></a>00780         fors_pmos_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782     ext_mode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.ext_mode"</span>,
-<a name="l00783"></a>00783                                        NULL);
-<a name="l00784"></a>00784     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)
-<a name="l00785"></a>00785         fors_pmos_extract_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);
-<a name="l00786"></a>00786 
-<a name="l00787"></a>00787     time_normalise = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00788"></a>00788                              <span class="stringliteral">"fors.fors_pmos_extract.time_normalise"</span>, NULL);
-<a name="l00789"></a>00789 
-<a name="l00790"></a>00790     check = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.check"</span>, NULL);
-<a name="l00791"></a>00791     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00792"></a>00792 
-<a name="l00793"></a>00793     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00794"></a>00794         fors_pmos_extract_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00795"></a>00795 
-<a name="l00796"></a>00796     
-<a name="l00797"></a>00797     <span class="comment">/* </span>
-<a name="l00798"></a>00798 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00799"></a>00799 <span class="comment">     */</span>
-<a name="l00800"></a>00800 
-<a name="l00801"></a>00801     cpl_msg_indent_less();
-<a name="l00802"></a>00802     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00803"></a>00803     cpl_msg_indent_more();
-<a name="l00804"></a>00804 
-<a name="l00805"></a>00805     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00806"></a>00806         fors_pmos_extract_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00807"></a>00807 
-<a name="l00808"></a>00808     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00809"></a>00809         fors_pmos_extract_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00810"></a>00810 
-<a name="l00811"></a>00811     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00812"></a>00812         fors_pmos_extract_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00813"></a>00813 
-<a name="l00814"></a>00814     standard = 0;
-<a name="l00815"></a>00815     pmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_PMOS"</span>);
-<a name="l00816"></a>00816 
-<a name="l00817"></a>00817     <span class="keywordflow">if</span> (pmos == 0) {
-<a name="l00818"></a>00818         pmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_PMOS"</span>);
-<a name="l00819"></a>00819         standard = 1;
-<a name="l00820"></a>00820     }
-<a name="l00821"></a>00821 
-<a name="l00822"></a>00822     <span class="keywordflow">if</span> (pmos == 0)
-<a name="l00823"></a>00823         fors_pmos_extract_exit(<span class="stringliteral">"Missing input scientific frame"</span>);
-<a name="l00824"></a>00824 
-<a name="l00825"></a>00825     angles = fors_check_angles(frameset, pmos, 
-<a name="l00826"></a>00826                                 standard ? <span class="stringliteral">"STANDARD_PMOS"</span> : <span class="stringliteral">"SCIENCE_PMOS"</span>, 
-<a name="l00827"></a>00827                                 &circ);
-<a name="l00828"></a>00828     <span class="keywordflow">if</span> (angles == NULL)
-<a name="l00829"></a>00829         fors_pmos_extract_exit(<span class="stringliteral">"Polarization angles could not be read"</span>);
-<a name="l00830"></a>00830 
-<a name="l00831"></a>00831     <span class="keywordflow">if</span> (circ)
-<a name="l00832"></a>00832         chromatism = 0; <span class="comment">/* Chromatism correction unrequired for </span>
-<a name="l00833"></a>00833 <span class="comment">                           circular polarimetry */</span>
-<a name="l00834"></a>00834 
-<a name="l00835"></a>00835 
-<a name="l00836"></a>00836     nscience = pmos;
-<a name="l00837"></a>00837 
-<a name="l00838"></a>00838     reduceds = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);
-<a name="l00839"></a>00839     rerrors  = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);
-<a name="l00840"></a>00840     slitss   = (cpl_table **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_table *) * nscience);
-<a name="l00841"></a>00841     mappeds  = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);
-<a name="l00842"></a>00842     skylocalmaps = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);
-<a name="l00843"></a>00843 
-<a name="l00844"></a>00844     <span class="keywordflow">if</span> (pmos) {
-<a name="l00845"></a>00845         cpl_msg_info(recipe, <span class="stringliteral">"PMOS data found"</span>);
-<a name="l00846"></a>00846         <span class="keywordflow">if</span> (standard) {
-<a name="l00847"></a>00847             science_tag             = <span class="stringliteral">"STANDARD_PMOS"</span>;
-<a name="l00848"></a>00848             reduced_science_tag     = <span class="stringliteral">"REDUCED_STD_PMOS"</span>;
-<a name="l00849"></a>00849             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_STD_PMOS"</span>;
-<a name="l00850"></a>00850             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_PMOS"</span>;
-<a name="l00851"></a>00851             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_PMOS"</span>;
-<a name="l00852"></a>00852             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_PMOS"</span>;
-<a name="l00853"></a>00853             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_STD_PMOS"</span>;
-<a name="l00854"></a>00854             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_STD_PMOS"</span>;
-<a name="l00855"></a>00855             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_PMOS"</span>;
-<a name="l00856"></a>00856             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_STD_PMOS"</span>;
-<a name="l00857"></a>00857             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_STD_PMOS"</span>;
-<a name="l00858"></a>00858             object_table_pol_tag    = <span class="stringliteral">"OBJECT_TABLE_POL_STD_PMOS"</span>;
-<a name="l00859"></a>00859             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_STD_PMOS"</span>;
-<a name="l00860"></a>00860             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_STD_PMOS"</span>;
-<a name="l00861"></a>00861             reduced_q_tag           = <span class="stringliteral">"REDUCED_Q_STD_PMOS"</span>;
-<a name="l00862"></a>00862             reduced_u_tag           = <span class="stringliteral">"REDUCED_U_STD_PMOS"</span>;
-<a name="l00863"></a>00863             reduced_v_tag           = <span class="stringliteral">"REDUCED_V_STD_PMOS"</span>;
-<a name="l00864"></a>00864             reduced_l_tag           = <span class="stringliteral">"REDUCED_L_STD_PMOS"</span>;
-<a name="l00865"></a>00865             reduced_error_q_tag     = <span class="stringliteral">"REDUCED_ERROR_Q_STD_PMOS"</span>;
-<a name="l00866"></a>00866             reduced_error_u_tag     = <span class="stringliteral">"REDUCED_ERROR_U_STD_PMOS"</span>;
-<a name="l00867"></a>00867             reduced_error_v_tag     = <span class="stringliteral">"REDUCED_ERROR_V_STD_PMOS"</span>;
-<a name="l00868"></a>00868             reduced_error_l_tag     = <span class="stringliteral">"REDUCED_ERROR_L_STD_PMOS"</span>;
-<a name="l00869"></a>00869             reduced_nul_q_tag       = <span class="stringliteral">"REDUCED_NUL_Q_STD_PMOS"</span>;
-<a name="l00870"></a>00870             reduced_nul_u_tag       = <span class="stringliteral">"REDUCED_NUL_U_STD_PMOS"</span>;
-<a name="l00871"></a>00871             reduced_nul_v_tag       = <span class="stringliteral">"REDUCED_NUL_V_STD_PMOS"</span>;
-<a name="l00872"></a>00872             reduced_angle_tag       = <span class="stringliteral">"REDUCED_ANGLE_STD_PMOS"</span>;
-<a name="l00873"></a>00873             reduced_error_angle_tag = <span class="stringliteral">"REDUCED_ERROR_ANGLE_STD_PMOS"</span>;
-<a name="l00874"></a>00874         }
-<a name="l00875"></a>00875         <span class="keywordflow">else</span> {
-<a name="l00876"></a>00876             science_tag             = <span class="stringliteral">"SCIENCE_PMOS"</span>;
-<a name="l00877"></a>00877             reduced_science_tag     = <span class="stringliteral">"REDUCED_SCI_PMOS"</span>;
-<a name="l00878"></a>00878             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_SCI_PMOS"</span>;
-<a name="l00879"></a>00879             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_PMOS"</span>;
-<a name="l00880"></a>00880             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_PMOS"</span>;
-<a name="l00881"></a>00881             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_PMOS"</span>;
-<a name="l00882"></a>00882             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_SCI_PMOS"</span>;
-<a name="l00883"></a>00883             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_SCI_PMOS"</span>;
-<a name="l00884"></a>00884             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_PMOS"</span>;
-<a name="l00885"></a>00885             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_SCI_PMOS"</span>;
-<a name="l00886"></a>00886             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_PMOS"</span>;
-<a name="l00887"></a>00887             object_table_pol_tag    = <span class="stringliteral">"OBJECT_TABLE_POL_SCI_PMOS"</span>;
-<a name="l00888"></a>00888             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_SCI_PMOS"</span>;
-<a name="l00889"></a>00889             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_SCI_PMOS"</span>;
-<a name="l00890"></a>00890             reduced_q_tag           = <span class="stringliteral">"REDUCED_Q_SCI_PMOS"</span>;
-<a name="l00891"></a>00891             reduced_u_tag           = <span class="stringliteral">"REDUCED_U_SCI_PMOS"</span>;
-<a name="l00892"></a>00892             reduced_v_tag           = <span class="stringliteral">"REDUCED_V_SCI_PMOS"</span>;
-<a name="l00893"></a>00893             reduced_l_tag           = <span class="stringliteral">"REDUCED_L_SCI_PMOS"</span>;
-<a name="l00894"></a>00894             reduced_error_q_tag     = <span class="stringliteral">"REDUCED_ERROR_Q_SCI_PMOS"</span>;
-<a name="l00895"></a>00895             reduced_error_u_tag     = <span class="stringliteral">"REDUCED_ERROR_U_SCI_PMOS"</span>;
-<a name="l00896"></a>00896             reduced_error_v_tag     = <span class="stringliteral">"REDUCED_ERROR_V_SCI_PMOS"</span>;
-<a name="l00897"></a>00897             reduced_error_l_tag     = <span class="stringliteral">"REDUCED_ERROR_L_SCI_PMOS"</span>;
-<a name="l00898"></a>00898             reduced_nul_q_tag       = <span class="stringliteral">"REDUCED_NUL_Q_SCI_PMOS"</span>;
-<a name="l00899"></a>00899             reduced_nul_u_tag       = <span class="stringliteral">"REDUCED_NUL_U_SCI_PMOS"</span>;
-<a name="l00900"></a>00900             reduced_nul_v_tag       = <span class="stringliteral">"REDUCED_NUL_V_SCI_PMOS"</span>;
-<a name="l00901"></a>00901             reduced_angle_tag       = <span class="stringliteral">"REDUCED_ANGLE_SCI_PMOS"</span>;
-<a name="l00902"></a>00902             reduced_error_angle_tag = <span class="stringliteral">"REDUCED_ERROR_ANGLE_SCI_PMOS"</span>;
-<a name="l00903"></a>00903         }
-<a name="l00904"></a>00904 
-<a name="l00905"></a>00905         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_PMOS"</span>;
-<a name="l00906"></a>00906         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_PMOS"</span>;
-<a name="l00907"></a>00907 
-<a name="l00908"></a>00908         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {
-<a name="l00909"></a>00909             master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_PMOS"</span>;
-<a name="l00910"></a>00910         }
-<a name="l00911"></a>00911     }
-<a name="l00912"></a>00912 
-<a name="l00913"></a>00913     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0)
-<a name="l00914"></a>00914         fors_pmos_extract_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS"</span>);
-<a name="l00915"></a>00915 
-<a name="l00916"></a>00916     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)
-<a name="l00917"></a>00917         fors_pmos_extract_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);
-<a name="l00918"></a>00918 
-<a name="l00919"></a>00919     <span class="keywordflow">if</span> (skyalign >= 0)
-<a name="l00920"></a>00920         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)
-<a name="l00921"></a>00921             fors_pmos_extract_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);
-<a name="l00922"></a>00922 
-<a name="l00923"></a>00923     <span class="keywordflow">if</span> (chromatism) {
-<a name="l00924"></a>00924     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, chrom_table_tag) == 0) {
-<a name="l00925"></a>00925         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>,
-<a name="l00926"></a>00926               chrom_table_tag);
-<a name="l00927"></a>00927         fors_pmos_extract_exit(NULL);
-<a name="l00928"></a>00928     }
-<a name="l00929"></a>00929 
-<a name="l00930"></a>00930     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, chrom_table_tag) > 1) {
-<a name="l00931"></a>00931         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, chrom_table_tag);
-<a name="l00932"></a>00932         fors_pmos_extract_exit(NULL);
-<a name="l00933"></a>00933     }
-<a name="l00934"></a>00934     }
-<a name="l00935"></a>00935 
-<a name="l00936"></a>00936     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) > 1) {
-<a name="l00937"></a>00937         <span class="keywordflow">if</span> (flatfield) {
-<a name="l00938"></a>00938             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, 
-<a name="l00939"></a>00939                           master_norm_flat_tag);
-<a name="l00940"></a>00940             fors_pmos_extract_exit(NULL);
-<a name="l00941"></a>00941         }
-<a name="l00942"></a>00942         <span class="keywordflow">else</span> {
-<a name="l00943"></a>00943             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input are ignored, "</span>
-<a name="l00944"></a>00944                             <span class="stringliteral">"since flat field correction was not requested"</span>, 
-<a name="l00945"></a>00945                             master_norm_flat_tag);
-<a name="l00946"></a>00946         }
-<a name="l00947"></a>00947     }
-<a name="l00948"></a>00948 
-<a name="l00949"></a>00949     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 1) {
-<a name="l00950"></a>00950         <span class="keywordflow">if</span> (!flatfield) {
-<a name="l00951"></a>00951             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input is ignored, "</span>
-<a name="l00952"></a>00952                             <span class="stringliteral">"since flat field correction was not requested"</span>, 
-<a name="l00953"></a>00953                             master_norm_flat_tag);
-<a name="l00954"></a>00954         }
-<a name="l00955"></a>00955     }
-<a name="l00956"></a>00956 
-<a name="l00957"></a>00957     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 0) {
-<a name="l00958"></a>00958         <span class="keywordflow">if</span> (flatfield) {
-<a name="l00959"></a>00959             cpl_msg_error(recipe, <span class="stringliteral">"Flat field correction was requested, "</span>
-<a name="l00960"></a>00960                           <span class="stringliteral">"but no %s are found in input"</span>,
-<a name="l00961"></a>00961                           master_norm_flat_tag);
-<a name="l00962"></a>00962             fors_pmos_extract_exit(NULL);
-<a name="l00963"></a>00963         }
-<a name="l00964"></a>00964     }
-<a name="l00965"></a>00965 
-<a name="l00966"></a>00966     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_distortion_tag) == 0)
-<a name="l00967"></a>00967         fors_pmos_extract_exit(<span class="stringliteral">"Missing required input: MASTER_DISTORTION_TABLE"</span>);
-<a name="l00968"></a>00968     
-<a name="l00969"></a>00969     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_distortion_tag) > 1)
-<a name="l00970"></a>00970     fors_pmos_extract_exit(<span class="stringliteral">"Too many in input: MASTER_DISTORTION_TABLE"</span>);
-<a name="l00971"></a>00971     
-<a name="l00972"></a>00972     global = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, master_distortion_tag, 1);
-<a name="l00973"></a>00973     <span class="keywordflow">if</span> (global == NULL)
-<a name="l00974"></a>00974     fors_pmos_extract_exit(<span class="stringliteral">"Cannot load master distortion table"</span>);
-<a name="l00975"></a>00975     
-<a name="l00976"></a>00976     cpl_msg_indent_less();
-<a name="l00977"></a>00977 
-<a name="l00978"></a>00978     <span class="comment">/*</span>
-<a name="l00979"></a>00979 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00980"></a>00980 <span class="comment">     * dispersion direction from a scientific exposure</span>
-<a name="l00981"></a>00981 <span class="comment">     */</span>
-<a name="l00982"></a>00982 
-<a name="l00983"></a>00983     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l00984"></a>00984 
-<a name="l00985"></a>00985     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00986"></a>00986         fors_pmos_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l00987"></a>00987 
-<a name="l00988"></a>00988     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00989"></a>00989     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00990"></a>00990         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INSTRUME in scientific header"</span>);
-<a name="l00991"></a>00991     instrume = cpl_strdup(instrume);
-<a name="l00992"></a>00992 
-<a name="l00993"></a>00993     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00994"></a>00994         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00995"></a>00995     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00996"></a>00996         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00997"></a>00997 
-<a name="l00998"></a>00998     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00999"></a>00999 
-<a name="l01000"></a>01000     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01001"></a>01001         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in scientific "</span>
-<a name="l01002"></a>01002                         <span class="stringliteral">"frame header"</span>);
-<a name="l01003"></a>01003 
-<a name="l01004"></a>01004     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l01005"></a>01005         reference *= 10;
-<a name="l01006"></a>01006 
-<a name="l01007"></a>01007     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l01008"></a>01008         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l01009"></a>01009                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in scientific frame header"</span>,
-<a name="l01010"></a>01010                       reference);
-<a name="l01011"></a>01011         fors_pmos_extract_exit(NULL);
-<a name="l01012"></a>01012     }
-<a name="l01013"></a>01013 
-<a name="l01014"></a>01014     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l01015"></a>01015 
-<a name="l01016"></a>01016     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l01017"></a>01017 
-<a name="l01018"></a>01018     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01019"></a>01019         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in scientific "</span>
-<a name="l01020"></a>01020                         <span class="stringliteral">"frame header"</span>);
-<a name="l01021"></a>01021 
-<a name="l01022"></a>01022     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l01023"></a>01023         dispersion *= rebin;
-<a name="l01024"></a>01024         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l01025"></a>01025                         <span class="stringliteral">"resampling step used is %f A/pixel"</span>, rebin, 
-<a name="l01026"></a>01026                         dispersion);
-<a name="l01027"></a>01027     }
-<a name="l01028"></a>01028 
-<a name="l01029"></a>01029     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l01030"></a>01030 
-<a name="l01031"></a>01031     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01032"></a>01032         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in scientific "</span>
-<a name="l01033"></a>01033                           <span class="stringliteral">"frame header"</span>);
-<a name="l01034"></a>01034 
-<a name="l01035"></a>01035     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l01036"></a>01036 
-<a name="l01037"></a>01037     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);
-<a name="l01038"></a>01038 
-<a name="l01039"></a>01039     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01040"></a>01040         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in scientific "</span>
-<a name="l01041"></a>01041                           <span class="stringliteral">"frame header"</span>);
-<a name="l01042"></a>01042 
-<a name="l01043"></a>01043     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span>
-<a name="l01044"></a>01044 
-<a name="l01045"></a>01045     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);
-<a name="l01046"></a>01046 
-<a name="l01047"></a>01047     cpl_msg_info(recipe, <span class="stringliteral">"Load normalised flat field (if present)..."</span>);
-<a name="l01048"></a>01048     cpl_msg_indent_more();
-<a name="l01049"></a>01049 
-<a name="l01050"></a>01050     <span class="keywordflow">if</span> (flatfield) {
-<a name="l01051"></a>01051     norm_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, master_norm_flat_tag, 
-<a name="l01052"></a>01052                    CPL_TYPE_FLOAT, 0, 1);
-<a name="l01053"></a>01053     }
-<a name="l01054"></a>01054 
-<a name="l01055"></a>01055     cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);
-<a name="l01056"></a>01056 
-<a name="l01057"></a>01057     maskslits = <a class="code" href="group__moses.html#g5bc87e2a7c15dd1686e02e2d65e057f5">mos_load_slits_fors_pmos</a>(header, &nslits_out_det);
-<a name="l01058"></a>01058 
-<a name="l01059"></a>01059     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01060"></a>01060 
-<a name="l01061"></a>01061     cpl_msg_indent_less();
-<a name="l01062"></a>01062     cpl_msg_info(recipe, <span class="stringliteral">"Load input sky line catalog..."</span>);
-<a name="l01063"></a>01063     cpl_msg_indent_more();
-<a name="l01064"></a>01064 
-<a name="l01065"></a>01065     wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);
-<a name="l01066"></a>01066 
-<a name="l01067"></a>01067     <span class="keywordflow">if</span> (wavelengths) {
-<a name="l01068"></a>01068         <span class="comment">/*</span>
-<a name="l01069"></a>01069 <span class="comment">         * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l01070"></a>01070 <span class="comment">         */</span>
-<a name="l01071"></a>01071 
-<a name="l01072"></a>01072         nlines = cpl_table_get_nrow(wavelengths);
-<a name="l01073"></a>01073 
-<a name="l01074"></a>01074         <span class="keywordflow">if</span> (nlines == 0)
-<a name="l01075"></a>01075         fors_pmos_extract_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);
-<a name="l01076"></a>01076 
-<a name="l01077"></a>01077         <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l01078"></a>01078         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span>
-<a name="l01079"></a>01079                   <span class="stringliteral">"catalog table"</span>, wcolumn);
-<a name="l01080"></a>01080         fors_pmos_extract_exit(NULL);
-<a name="l01081"></a>01081         }
-<a name="l01082"></a>01082 
-<a name="l01083"></a>01083         line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01084"></a>01084     
-<a name="l01085"></a>01085         <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l01086"></a>01086         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l01087"></a>01087 
-<a name="l01088"></a>01088         cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l01089"></a>01089 
-<a name="l01090"></a>01090         lines = cpl_vector_wrap(nlines, line);
-<a name="l01091"></a>01091     }
-<a name="l01092"></a>01092     <span class="keywordflow">else</span> {
-<a name="l01093"></a>01093         cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);
-<a name="l01094"></a>01094     }
-<a name="l01095"></a>01095     }
-<a name="l01096"></a>01096 
-<a name="l01097"></a>01097 
-<a name="l01098"></a>01098     cpl_propertylist_delete(header); header = NULL;
-<a name="l01099"></a>01099 
-<a name="l01100"></a>01100     <span class="comment">/*</span>
-<a name="l01101"></a>01101 <span class="comment">     * Load the wavelength calibration table</span>
-<a name="l01102"></a>01102 <span class="comment">     */</span>
-<a name="l01103"></a>01103 
-<a name="l01104"></a>01104     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {
-<a name="l01105"></a>01105     <span class="keywordtype">int</span> k;
-<a name="l01106"></a>01106 
-<a name="l01107"></a>01107     cpl_msg_indent_less();
-<a name="l01108"></a>01108     cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific exposure of angle %.2f "</span>
-<a name="l01109"></a>01109              <span class="stringliteral">"(%d out of %d) ..."</span>,
-<a name="l01110"></a>01110              angles[j], j + 1, nscience);
-<a name="l01111"></a>01111     cpl_msg_indent_more();
-<a name="l01112"></a>01112 
-<a name="l01113"></a>01113     cpl_msg_info(recipe, <span class="stringliteral">"Load scientific exposure..."</span>);
-<a name="l01114"></a>01114     cpl_msg_indent_more();
-<a name="l01115"></a>01115 
-<a name="l01116"></a>01116     <span class="comment">/*</span>
-<a name="l01117"></a>01117 <span class="comment">     * FIXME: Horrible workaround to avoid the problem because of the</span>
-<a name="l01118"></a>01118 <span class="comment">     * multiple encapsulation of cpl_frameset_find() in different </span>
-<a name="l01119"></a>01119 <span class="comment">     * loading functions</span>
-<a name="l01120"></a>01120 <span class="comment">     */</span>
-<a name="l01121"></a>01121 
-<a name="l01122"></a>01122     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01123"></a>01123 
-<a name="l01124"></a>01124     <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01125"></a>01125         cpl_propertylist_delete(header);
-<a name="l01126"></a>01126         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01127"></a>01127     }
-<a name="l01128"></a>01128 
-<a name="l01129"></a>01129     spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01130"></a>01130 
-<a name="l01131"></a>01131     <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01132"></a>01132         cpl_image_delete(spectra);
-<a name="l01133"></a>01133         spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01134"></a>01134     }
-<a name="l01135"></a>01135 
-<a name="l01136"></a>01136     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01137"></a>01137         fors_pmos_extract_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l01138"></a>01138         
-<a name="l01139"></a>01139     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01140"></a>01140         fors_pmos_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01141"></a>01141 
-<a name="l01142"></a>01142     alltime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l01143"></a>01143 
-<a name="l01144"></a>01144     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01145"></a>01145         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l01146"></a>01146                    <span class="stringliteral">"frame header"</span>);
-<a name="l01147"></a>01147 
-<a name="l01148"></a>01148     <span class="comment">/* Leave the header on for the next step... */</span>
-<a name="l01149"></a>01149     <span class="comment">//cpl_propertylist_delete(header); header = NULL;</span>
-<a name="l01150"></a>01150 
-<a name="l01151"></a>01151     cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame exposure time: %.2f s"</span>, 
-<a name="l01152"></a>01152              alltime);
-<a name="l01153"></a>01153 
-<a name="l01154"></a>01154     cpl_msg_indent_less();
-<a name="l01155"></a>01155 
-<a name="l01156"></a>01156     <span class="comment">/*</span>
-<a name="l01157"></a>01157 <span class="comment">     * Remove the master bias</span>
-<a name="l01158"></a>01158 <span class="comment">     */</span>
-<a name="l01159"></a>01159 
-<a name="l01160"></a>01160     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l01161"></a>01161 
-<a name="l01162"></a>01162     bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, CPL_TYPE_FLOAT, 0, 1);
-<a name="l01163"></a>01163 
-<a name="l01164"></a>01164     <span class="keywordflow">if</span> (bias == NULL)
-<a name="l01165"></a>01165         fors_pmos_extract_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l01166"></a>01166 
-<a name="l01167"></a>01167     overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 1);
-<a name="l01168"></a>01168 
-<a name="l01169"></a>01169     dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(spectra, bias, overscans);
-<a name="l01170"></a>01170     cpl_image_delete(spectra); spectra = dummy; dummy = NULL;
-<a name="l01171"></a>01171     cpl_image_delete(bias); bias = NULL;
-<a name="l01172"></a>01172     cpl_table_delete(overscans); overscans = NULL;
-<a name="l01173"></a>01173 
-<a name="l01174"></a>01174     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01175"></a>01175         fors_pmos_extract_exit(<span class="stringliteral">"Cannot remove bias from scientific frame"</span>);
-<a name="l01176"></a>01176 
-<a name="l01177"></a>01177     ccd_xsize = nx = cpl_image_get_size_x(spectra);
-<a name="l01178"></a>01178     ccd_ysize = ny = cpl_image_get_size_y(spectra);
-<a name="l01179"></a>01179 
-<a name="l01180"></a>01180     <span class="keywordflow">if</span> (flatfield) {
-<a name="l01181"></a>01181 
-<a name="l01182"></a>01182         <span class="keywordflow">if</span> (norm_flat) {
-<a name="l01183"></a>01183         cpl_msg_info(recipe, <span class="stringliteral">"Apply flat field correction..."</span>);
-<a name="l01184"></a>01184         <span class="keywordflow">if</span> (cpl_image_divide(spectra, norm_flat) != CPL_ERROR_NONE) {
-<a name="l01185"></a>01185             cpl_msg_error(recipe, <span class="stringliteral">"Failure of flat field correction: %s"</span>,
-<a name="l01186"></a>01186                   cpl_error_get_message());
-<a name="l01187"></a>01187             fors_pmos_extract_exit(NULL);
-<a name="l01188"></a>01188         }
-<a name="l01189"></a>01189         }
-<a name="l01190"></a>01190         <span class="keywordflow">else</span> {
-<a name="l01191"></a>01191         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load input %s for flat field "</span>
-<a name="l01192"></a>01192                   <span class="stringliteral">"correction"</span>, master_norm_flat_tag);
-<a name="l01193"></a>01193         fors_pmos_extract_exit(NULL);
-<a name="l01194"></a>01194         }
-<a name="l01195"></a>01195 
-<a name="l01196"></a>01196     }
-<a name="l01197"></a>01197 
-<a name="l01198"></a>01198     <span class="comment">/*</span>
-<a name="l01199"></a>01199 <span class="comment">     * Load the slit location table</span>
-<a name="l01200"></a>01200 <span class="comment">     */</span>
-<a name="l01201"></a>01201 
-<a name="l01202"></a>01202     slits = <a class="code" href="group__moses.html#g39dd696d6572e52031e12b1a53e505c2">mos_build_slit_location</a>(global, maskslits, ny);
-<a name="l01203"></a>01203 
-<a name="l01204"></a>01204     <span class="keywordflow">if</span> (slits == NULL) {
-<a name="l01205"></a>01205         fors_pmos_extract_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l01206"></a>01206     } <span class="keywordflow">else</span> {
-<a name="l01207"></a>01207         cpl_table_new_column(slits, <span class="stringliteral">"pair_id"</span>, CPL_TYPE_INT);
-<a name="l01208"></a>01208 
-<a name="l01209"></a>01209         <span class="keywordtype">int</span> m, null, size = cpl_table_get_nrow(slits);
-<a name="l01210"></a>01210 
-<a name="l01211"></a>01211         <span class="keywordflow">for</span> (m = 0; m < size; m++) {
-<a name="l01212"></a>01212         <span class="keywordtype">int</span> slit_id = cpl_table_get(slits, <span class="stringliteral">"slit_id"</span>, m, &null);
-<a name="l01213"></a>01213 
-<a name="l01214"></a>01214         <span class="keywordtype">int</span> pair_id = slit_id % 2 ? slit_id + 1 : slit_id;
-<a name="l01215"></a>01215 
-<a name="l01216"></a>01216         cpl_table_set(slits, <span class="stringliteral">"pair_id"</span>, m, pair_id);
-<a name="l01217"></a>01217         }
-<a name="l01218"></a>01218     }
-<a name="l01219"></a>01219     
-<a name="l01220"></a>01220     cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific spectra..."</span>);
-<a name="l01221"></a>01221 
-<a name="l01222"></a>01222     <span class="comment">/*</span>
-<a name="l01223"></a>01223 <span class="comment">     * Load the spectral curvature table</span>
-<a name="l01224"></a>01224 <span class="comment">     */</span>
-<a name="l01225"></a>01225 
-<a name="l01226"></a>01226     polytraces = <a class="code" href="group__moses.html#ga010593249434f0bb667af2f2c950951">mos_build_curv_coeff</a>(global, maskslits, slits);
-<a name="l01227"></a>01227     <span class="keywordflow">if</span> (polytraces == NULL)
-<a name="l01228"></a>01228         fors_pmos_extract_exit(<span class="stringliteral">"Cannot create spectral curvature table"</span>);
-<a name="l01229"></a>01229  
-<a name="l01230"></a>01230     <span class="comment">/*</span>
-<a name="l01231"></a>01231 <span class="comment">     * This one will also generate the spatial map from the spectral </span>
-<a name="l01232"></a>01232 <span class="comment">     * curvature table (in the case of multislit data)</span>
-<a name="l01233"></a>01233 <span class="comment">     */</span>
-<a name="l01234"></a>01234 
-<a name="l01235"></a>01235     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01236"></a>01236 
-<a name="l01237"></a>01237     smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, reference,
-<a name="l01238"></a>01238                       startwavelength, endwavelength,
-<a name="l01239"></a>01239                       dispersion, flux, coordinate);
-<a name="l01240"></a>01240 
-<a name="l01241"></a>01241     <span class="comment">/*</span>
-<a name="l01242"></a>01242 <span class="comment">     * Generate a rectified wavelength map from the wavelength calibration </span>
-<a name="l01243"></a>01243 <span class="comment">     * table</span>
-<a name="l01244"></a>01244 <span class="comment">     */</span>
-<a name="l01245"></a>01245 
-<a name="l01246"></a>01246     <span class="comment">/*</span>
-<a name="l01247"></a>01247 <span class="comment">     * Load the wavelength calibration table</span>
-<a name="l01248"></a>01248 <span class="comment">     */</span>
-<a name="l01249"></a>01249  
-<a name="l01250"></a>01250     idscoeff = <a class="code" href="group__moses.html#gc4a3f1981baef15668137f04c04cf710">mos_build_disp_coeff</a>(global, slits);
-<a name="l01251"></a>01251     <span class="keywordflow">if</span> (idscoeff == NULL)
-<a name="l01252"></a>01252         fors_pmos_extract_exit(<span class="stringliteral">"Cannot create wavelength calibration table"</span>);
-<a name="l01253"></a>01253 
-<a name="l01254"></a>01254     rainbow = <a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength, 
-<a name="l01255"></a>01255                    endwavelength);
-<a name="l01256"></a>01256 
-<a name="l01257"></a>01257     <span class="keywordflow">if</span> (dispersion > 1.0)
-<a name="l01258"></a>01258         highres = 0;
-<a name="l01259"></a>01259     <span class="keywordflow">else</span>
-<a name="l01260"></a>01260         highres = 1;
-<a name="l01261"></a>01261 
-<a name="l01262"></a>01262     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01263"></a>01263         <span class="keywordflow">if</span> (skyalign) {
-<a name="l01264"></a>01264         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l01265"></a>01265                  <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);
-<a name="l01266"></a>01266         }
-<a name="l01267"></a>01267         <span class="keywordflow">else</span> {
-<a name="l01268"></a>01268         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l01269"></a>01269                  <span class="stringliteral">"skylines applying median offset..."</span>);
-<a name="l01270"></a>01270         }
-<a name="l01271"></a>01271 
-<a name="l01272"></a>01272         <span class="keywordflow">if</span> (!j) {
-<a name="l01273"></a>01273         offsets = <a class="code" href="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3">mos_wavelength_align</a>(smapped, slits, reference, 
-<a name="l01274"></a>01274                            startwavelength, endwavelength, 
-<a name="l01275"></a>01275                            idscoeff, lines, highres, 
-<a name="l01276"></a>01276                            skyalign, rainbow, 4);
-<a name="l01277"></a>01277 
-<a name="l01278"></a>01278         <span class="keywordflow">if</span> (offsets) {
-<a name="l01279"></a>01279             <span class="keywordflow">if</span> (standard)
-<a name="l01280"></a>01280             cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span>
-<a name="l01281"></a>01281                     <span class="stringliteral">"to reference sky lines may be unreliable in "</span>
-<a name="l01282"></a>01282                     <span class="stringliteral">"this case!"</span>);
-<a name="l01283"></a>01283 
-<a name="l01284"></a>01284             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, offsets, skylines_offsets_tag,
-<a name="l01285"></a>01285                        NULL, parlist, recipe, version)) {
-<a name="l01286"></a>01286             fors_pmos_extract_exit(NULL);
-<a name="l01287"></a>01287             }
-<a name="l01288"></a>01288 
-<a name="l01289"></a>01289         } <span class="keywordflow">else</span> {
-<a name="l01290"></a>01290             cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span>
-<a name="l01291"></a>01291                     <span class="stringliteral">"to reference sky lines could not be done!"</span>);
-<a name="l01292"></a>01292             skyalign = -1;
-<a name="l01293"></a>01293         }
-<a name="l01294"></a>01294         }
-<a name="l01295"></a>01295 
-<a name="l01296"></a>01296 
-<a name="l01297"></a>01297     }
-<a name="l01298"></a>01298 
-<a name="l01299"></a>01299     wavemap = <a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(coordinate, rainbow, slits, 
-<a name="l01300"></a>01300                       polytraces, reference, 
-<a name="l01301"></a>01301                       startwavelength, endwavelength,
-<a name="l01302"></a>01302                       dispersion);
-<a name="l01303"></a>01303 
-<a name="l01304"></a>01304 
-<a name="l01305"></a>01305     cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l01306"></a>01306     cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l01307"></a>01307 
-<a name="l01308"></a>01308     <span class="comment">/*</span>
-<a name="l01309"></a>01309 <span class="comment">     * Here the wavelength calibrated slit spectra are created. This frame</span>
-<a name="l01310"></a>01310 <span class="comment">     * contains sky_science.</span>
-<a name="l01311"></a>01311 <span class="comment">     */</span>
-<a name="l01312"></a>01312 
-<a name="l01313"></a>01313     mapped_sky = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, reference,
-<a name="l01314"></a>01314                         startwavelength, endwavelength,
-<a name="l01315"></a>01315                         dispersion, idscoeff, flux);
-<a name="l01316"></a>01316 
-<a name="l01317"></a>01317     <span class="keywordflow">if</span> (!j) {
-<a name="l01318"></a>01318         cpl_msg_indent_less();
-<a name="l01319"></a>01319         cpl_msg_info(recipe, <span class="stringliteral">"Check applied wavelength against skylines..."</span>);
-<a name="l01320"></a>01320         cpl_msg_indent_more();
-<a name="l01321"></a>01321 
-<a name="l01322"></a>01322         mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(mapped_sky, lines, startwavelength,
-<a name="l01323"></a>01323                        dispersion, 6, highres);
-<a name="l01324"></a>01324 
-<a name="l01325"></a>01325 
-<a name="l01326"></a>01326         cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f"</span>, mean_rms);
-<a name="l01327"></a>01327 
-<a name="l01328"></a>01328         mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l01329"></a>01329 
-<a name="l01330"></a>01330         cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,
-<a name="l01331"></a>01331              mean_rms, mean_rms * dispersion);
-<a name="l01332"></a>01332     }
-<a name="l01333"></a>01333 
-<a name="l01334"></a>01334     save_header = cpl_propertylist_duplicate(header);
-<a name="l01335"></a>01335 
-<a name="l01336"></a>01336     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01337"></a>01337     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01338"></a>01338     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01339"></a>01339                        startwavelength + dispersion/2);
-<a name="l01340"></a>01340     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01341"></a>01341     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01342"></a>01342 <span class="comment">       cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01343"></a>01343     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01344"></a>01344     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01345"></a>01345     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01346"></a>01346     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01347"></a>01347     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01348"></a>01348     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01349"></a>01349 
-<a name="l01350"></a>01350     <span class="keywordflow">if</span> (time_normalise) {
-<a name="l01351"></a>01351         dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);
-<a name="l01352"></a>01352         <span class="keywordflow">if</span> (!j) {
-<a name="l01353"></a>01353         <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01354"></a>01354                        mapped_science_sky_tag,
-<a name="l01355"></a>01355                        recipe, version)) {
-<a name="l01356"></a>01356             fors_pmos_extract_exit(NULL);
-<a name="l01357"></a>01357         }
-<a name="l01358"></a>01358         }
-<a name="l01359"></a>01359         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(dummy, mapped_science_sky_tag, header)) {
-<a name="l01360"></a>01360         fors_pmos_extract_exit(NULL);
-<a name="l01361"></a>01361         }
-<a name="l01362"></a>01362         cpl_image_delete(dummy); dummy = NULL;
-<a name="l01363"></a>01363     }
-<a name="l01364"></a>01364     <span class="keywordflow">else</span> {
-<a name="l01365"></a>01365 
-<a name="l01366"></a>01366         <span class="keywordflow">if</span> (!j) {
-<a name="l01367"></a>01367         <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01368"></a>01368                        mapped_science_sky_tag,
-<a name="l01369"></a>01369                        recipe, version)) {
-<a name="l01370"></a>01370             fors_pmos_extract_exit(NULL);
-<a name="l01371"></a>01371         }
-<a name="l01372"></a>01372         }
-<a name="l01373"></a>01373 
-<a name="l01374"></a>01374         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(mapped_sky,
-<a name="l01375"></a>01375                    mapped_science_sky_tag, header)) {
-<a name="l01376"></a>01376         fors_pmos_extract_exit(NULL);
-<a name="l01377"></a>01377         }
-<a name="l01378"></a>01378 
-<a name="l01379"></a>01379     }
-<a name="l01380"></a>01380 
-<a name="l01381"></a>01381 <span class="comment">/*    if (skyglobal == 0 && skymedian < 0) {    NSS */</span>
-<a name="l01382"></a>01382     <span class="keywordflow">if</span> (skyglobal == 0 && skymedian == 0 && skylocal == 0) {
-<a name="l01383"></a>01383         cpl_image_delete(mapped_sky); mapped_sky = NULL;
-<a name="l01384"></a>01384     }
-<a name="l01385"></a>01385 
-<a name="l01386"></a>01386     <span class="keywordflow">if</span> (skyglobal || skylocal) {
-<a name="l01387"></a>01387 
-<a name="l01388"></a>01388         cpl_msg_indent_less();
-<a name="l01389"></a>01389 
-<a name="l01390"></a>01390         <span class="keywordflow">if</span> (skyglobal) {
-<a name="l01391"></a>01391         cpl_msg_info(recipe, <span class="stringliteral">"Global sky determination..."</span>);
-<a name="l01392"></a>01392         cpl_msg_indent_more();
-<a name="l01393"></a>01393         skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01394"></a>01394 
-<a name="l01395"></a>01395         sky = <a class="code" href="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1">mos_sky_map_super</a>(spectra, wavemap, dispersion, 
-<a name="l01396"></a>01396                     2.0, 50, skymap);
-<a name="l01397"></a>01397 
-<a name="l01398"></a>01398         <span class="keywordflow">if</span> (sky) {
-<a name="l01399"></a>01399             cpl_image_subtract(spectra, skymap);
-<a name="l01400"></a>01400         }
-<a name="l01401"></a>01401         <span class="keywordflow">else</span> {
-<a name="l01402"></a>01402             cpl_image_delete(skymap); skymap = NULL;
-<a name="l01403"></a>01403         }
-<a name="l01404"></a>01404         }
-<a name="l01405"></a>01405         <span class="keywordflow">else</span> {
-<a name="l01406"></a>01406         cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l01407"></a>01407         cpl_msg_indent_more();
-<a name="l01408"></a>01408         skymap = <a class="code" href="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f">mos_subtract_sky</a>(spectra, slits, polytraces, reference,
-<a name="l01409"></a>01409                       startwavelength, endwavelength, dispersion);
-<a name="l01410"></a>01410         }
-<a name="l01411"></a>01411 
-<a name="l01412"></a>01412         <span class="keywordflow">if</span> (skymap) {
-<a name="l01413"></a>01413         <span class="keywordflow">if</span> (skyglobal) {
-<a name="l01414"></a>01414             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01415"></a>01415             cpl_table_divide_scalar(sky, <span class="stringliteral">"sky"</span>, alltime);
-<a name="l01416"></a>01416 
-<a name="l01417"></a>01417 <span class="comment">/* Old saving:</span>
-<a name="l01418"></a>01418 <span class="comment"></span>
-<a name="l01419"></a>01419 <span class="comment">            if (!j) {</span>
-<a name="l01420"></a>01420 <span class="comment">            if (dfs_save_table(frameset, sky,</span>
-<a name="l01421"></a>01421 <span class="comment">                       global_sky_spectrum_tag, </span>
-<a name="l01422"></a>01422 <span class="comment">                       NULL, parlist, recipe, version)) {</span>
-<a name="l01423"></a>01423 <span class="comment">                fors_pmos_extract_exit(NULL);</span>
-<a name="l01424"></a>01424 <span class="comment">            }</span>
-<a name="l01425"></a>01425 <span class="comment">            } else {</span>
-<a name="l01426"></a>01426 <span class="comment">            if (dfs_save_table_ext(sky, global_sky_spectrum_tag, </span>
-<a name="l01427"></a>01427 <span class="comment">                           NULL)) {</span>
-<a name="l01428"></a>01428 <span class="comment">                fors_pmos_extract_exit(NULL);</span>
-<a name="l01429"></a>01429 <span class="comment">            }</span>
-<a name="l01430"></a>01430 <span class="comment">            }</span>
-<a name="l01431"></a>01431 <span class="comment"></span>
-<a name="l01432"></a>01432 <span class="comment">End of old saving */</span>
-<a name="l01433"></a>01433 
-<a name="l01434"></a>01434                     <span class="keywordflow">if</span> (!j) {
-<a name="l01435"></a>01435                         <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist, 
-<a name="l01436"></a>01436                                                global_sky_spectrum_tag,
-<a name="l01437"></a>01437                                                recipe, version)) {
-<a name="l01438"></a>01438                 fors_pmos_extract_exit(NULL);
-<a name="l01439"></a>01439                         }
-<a name="l01440"></a>01440                     }
-<a name="l01441"></a>01441     
-<a name="l01442"></a>01442                     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">dfs_save_table_ext</a>(sky, global_sky_spectrum_tag, 
-<a name="l01443"></a>01443                                            NULL)) {
-<a name="l01444"></a>01444                         fors_pmos_extract_exit(NULL);
-<a name="l01445"></a>01445                     }
-<a name="l01446"></a>01446     
-<a name="l01447"></a>01447     
-<a name="l01448"></a>01448             cpl_table_delete(sky); sky = NULL;
-<a name="l01449"></a>01449         }
-<a name="l01450"></a>01450 
-<a name="l01451"></a>01451 <span class="comment">//      save_header = dfs_load_header(frameset, science_tag, 0);</span>
-<a name="l01452"></a>01452 
-<a name="l01453"></a>01453         <span class="keywordflow">if</span> (time_normalise)
-<a name="l01454"></a>01454             cpl_image_divide_scalar(skymap, alltime);
-<a name="l01455"></a>01455 
-<a name="l01456"></a>01456         <span class="keywordflow">if</span> (!j) {
-<a name="l01457"></a>01457             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01458"></a>01458                        unmapped_sky_tag,
-<a name="l01459"></a>01459                        recipe, version)) {
-<a name="l01460"></a>01460             fors_pmos_extract_exit(NULL);
-<a name="l01461"></a>01461             }
-<a name="l01462"></a>01462         }
-<a name="l01463"></a>01463 
-<a name="l01464"></a>01464         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(skymap, unmapped_sky_tag,
-<a name="l01465"></a>01465                        save_header)) {
-<a name="l01466"></a>01466             fors_pmos_extract_exit(NULL);
-<a name="l01467"></a>01467         }
-<a name="l01468"></a>01468 
-<a name="l01469"></a>01469         cpl_image_delete(skymap); skymap = NULL;
-<a name="l01470"></a>01470 
-<a name="l01471"></a>01471         <span class="keywordflow">if</span> (!j) {
-<a name="l01472"></a>01472             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01473"></a>01473                        unmapped_science_tag,
-<a name="l01474"></a>01474                        recipe, version)) {
-<a name="l01475"></a>01475             fors_pmos_extract_exit(NULL);
-<a name="l01476"></a>01476             }
-<a name="l01477"></a>01477         }
-<a name="l01478"></a>01478 
-<a name="l01479"></a>01479         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(spectra, unmapped_science_tag,
-<a name="l01480"></a>01480                        save_header)) {
-<a name="l01481"></a>01481             fors_pmos_extract_exit(NULL);
-<a name="l01482"></a>01482         }
-<a name="l01483"></a>01483 
-<a name="l01484"></a>01484 <span class="comment">//      cpl_propertylist_delete(save_header); save_header = NULL;</span>
-<a name="l01485"></a>01485 
-<a name="l01486"></a>01486         <span class="keywordflow">if</span> (cosmics) {
-<a name="l01487"></a>01487             cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);
-<a name="l01488"></a>01488             <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(spectra, gain, -1., -1.);
-<a name="l01489"></a>01489         }
-<a name="l01490"></a>01490 
-<a name="l01491"></a>01491         <span class="comment">/*</span>
-<a name="l01492"></a>01492 <span class="comment">         * The spatially rectified image, that contained the sky,</span>
-<a name="l01493"></a>01493 <span class="comment">         * is replaced by a sky-subtracted spatially rectified image:</span>
-<a name="l01494"></a>01494 <span class="comment">         */</span>
-<a name="l01495"></a>01495 
-<a name="l01496"></a>01496         cpl_image_delete(smapped); smapped = NULL;
-<a name="l01497"></a>01497 
-<a name="l01498"></a>01498         smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, 
-<a name="l01499"></a>01499                           reference, startwavelength, 
-<a name="l01500"></a>01500                           endwavelength, dispersion, 
-<a name="l01501"></a>01501                           flux, NULL);
-<a name="l01502"></a>01502         }
-<a name="l01503"></a>01503         <span class="keywordflow">else</span> {
-<a name="l01504"></a>01504         cpl_msg_warning(recipe, <span class="stringliteral">"Sky subtraction failure"</span>);
-<a name="l01505"></a>01505         <span class="keywordflow">if</span> (cosmics)
-<a name="l01506"></a>01506             cpl_msg_warning(recipe, <span class="stringliteral">"Cosmic rays removal not performed!"</span>);
-<a name="l01507"></a>01507         cosmics = skylocal = skyglobal = 0;
-<a name="l01508"></a>01508         }
-<a name="l01509"></a>01509     }
-<a name="l01510"></a>01510 
-<a name="l01511"></a>01511     cpl_image_delete(spectra); spectra = NULL;
-<a name="l01512"></a>01512     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l01513"></a>01513 
-<a name="l01514"></a>01514     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01515"></a>01515         save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01516"></a>01516 
-<a name="l01517"></a>01517         <span class="keywordflow">if</span> (!j) {
-<a name="l01518"></a>01518         <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01519"></a>01519                        wavelength_map_sky_tag,
-<a name="l01520"></a>01520                        recipe, version)) {
-<a name="l01521"></a>01521             fors_pmos_extract_exit(NULL);
-<a name="l01522"></a>01522         }
-<a name="l01523"></a>01523         }
-<a name="l01524"></a>01524 
-<a name="l01525"></a>01525         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(wavemap, wavelength_map_sky_tag,
-<a name="l01526"></a>01526                    save_header)) {
-<a name="l01527"></a>01527         fors_pmos_extract_exit(NULL);
-<a name="l01528"></a>01528         }
-<a name="l01529"></a>01529 
-<a name="l01530"></a>01530 <span class="comment">//      cpl_propertylist_delete(save_header); save_header = NULL;</span>
-<a name="l01531"></a>01531     }
-<a name="l01532"></a>01532 
-<a name="l01533"></a>01533     cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l01534"></a>01534 
-<a name="l01535"></a>01535     mapped = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, reference,
-<a name="l01536"></a>01536                         startwavelength, endwavelength,
-<a name="l01537"></a>01537                         dispersion, idscoeff, flux);
-<a name="l01538"></a>01538 
-<a name="l01539"></a>01539     cpl_image_delete(smapped); smapped = NULL;
-<a name="l01540"></a>01540 
-<a name="l01541"></a>01541     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01542"></a>01542         <span class="keywordflow">if</span> (!j) {
-<a name="l01543"></a>01543         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_coeff_sky_tag,
-<a name="l01544"></a>01544                    NULL, parlist, recipe, version)) {
-<a name="l01545"></a>01545             fors_pmos_extract_exit(NULL);
-<a name="l01546"></a>01546         }
-<a name="l01547"></a>01547         }
-<a name="l01548"></a>01548     }
-<a name="l01549"></a>01549 
-<a name="l01550"></a>01550 <span class="comment">/*    if (skymedian >= 0) {    NSS */</span>
-<a name="l01551"></a>01551     <span class="keywordflow">if</span> (skymedian) {
-<a name="l01552"></a>01552             cpl_msg_indent_less();
-<a name="l01553"></a>01553             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l01554"></a>01554             cpl_msg_indent_more();
-<a name="l01555"></a>01555        
-<a name="l01556"></a>01556 <span class="comment">/*   NSS      skylocalmap = mos_sky_local(mapped, slits, skymedian); */</span>
-<a name="l01557"></a>01557 <span class="comment">/*            skylocalmap = mos_sky_local(mapped, slits, 0);        */</span>
-<a name="l01558"></a>01558             skylocalmap = <a class="code" href="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a">mos_sky_local_old</a>(mapped, slits);       
-<a name="l01559"></a>01559             cpl_image_subtract(mapped, skylocalmap);
-<a name="l01560"></a>01560 <span class="comment">/*</span>
-<a name="l01561"></a>01561 <span class="comment">  if (dfs_save_image(frameset, skylocalmap, mapped_sky_tag, header, </span>
-<a name="l01562"></a>01562 <span class="comment">  parlist, recipe, version))</span>
-<a name="l01563"></a>01563 <span class="comment">  fors_pmos_extract_exit(NULL);</span>
-<a name="l01564"></a>01564 <span class="comment">*/</span>
-<a name="l01565"></a>01565             cpl_image_delete(skylocalmap); skylocalmap = NULL;
-<a name="l01566"></a>01566     }
-<a name="l01567"></a>01567 
-<a name="l01568"></a>01568 <span class="comment">/*    if (skyglobal || skymedian >= 0 || skylocal) {   NSS */</span>
-<a name="l01569"></a>01569     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {
-<a name="l01570"></a>01570 
-<a name="l01571"></a>01571         skylocalmap = cpl_image_subtract_create(mapped_sky, mapped);
-<a name="l01572"></a>01572 
-<a name="l01573"></a>01573         cpl_image_delete(mapped_sky); mapped_sky = NULL;
-<a name="l01574"></a>01574 
-<a name="l01575"></a>01575         <span class="keywordflow">if</span> (time_normalise) {
-<a name="l01576"></a>01576         dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);
-<a name="l01577"></a>01577 
-<a name="l01578"></a>01578         <span class="keywordflow">if</span> (!j) {
-<a name="l01579"></a>01579             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01580"></a>01580                        mapped_sky_tag,
-<a name="l01581"></a>01581                        recipe, version)) {
-<a name="l01582"></a>01582             fors_pmos_extract_exit(NULL);
-<a name="l01583"></a>01583             }
-<a name="l01584"></a>01584         }
-<a name="l01585"></a>01585 
-<a name="l01586"></a>01586         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(dummy, mapped_sky_tag,
-<a name="l01587"></a>01587                        header)) {
-<a name="l01588"></a>01588             fors_pmos_extract_exit(NULL);
-<a name="l01589"></a>01589         }
-<a name="l01590"></a>01590 
-<a name="l01591"></a>01591         cpl_image_delete(dummy); dummy = NULL;
-<a name="l01592"></a>01592         }
-<a name="l01593"></a>01593         <span class="keywordflow">else</span> {
-<a name="l01594"></a>01594         <span class="keywordflow">if</span> (!j) {
-<a name="l01595"></a>01595             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01596"></a>01596                        mapped_sky_tag,
-<a name="l01597"></a>01597                        recipe, version)) {
-<a name="l01598"></a>01598             fors_pmos_extract_exit(NULL);
-<a name="l01599"></a>01599             }
-<a name="l01600"></a>01600         }
-<a name="l01601"></a>01601 
-<a name="l01602"></a>01602         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(skylocalmap, mapped_sky_tag,
-<a name="l01603"></a>01603                        header)) {
-<a name="l01604"></a>01604             fors_pmos_extract_exit(NULL);
-<a name="l01605"></a>01605         }
-<a name="l01606"></a>01606         }
-<a name="l01607"></a>01607 
-<a name="l01608"></a>01608         skylocalmaps[j] = skylocalmap;
-<a name="l01609"></a>01609 
-<a name="l01610"></a>01610         cpl_msg_indent_less();
-<a name="l01611"></a>01611         cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);
-<a name="l01612"></a>01612         cpl_msg_indent_more();
-<a name="l01613"></a>01613 
-<a name="l01614"></a>01614         <span class="keywordflow">if</span> (!j)
-<a name="l01615"></a>01615         origslits = cpl_table_duplicate(slits);
-<a name="l01616"></a>01616 
-<a name="l01617"></a>01617         <span class="keywordflow">if</span> (cosmics || nscience > 1) {
-<a name="l01618"></a>01618         dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped, slits, slit_margin, ext_radius, 
-<a name="l01619"></a>01619                        cont_radius);
-<a name="l01620"></a>01620         }
-<a name="l01621"></a>01621         <span class="keywordflow">else</span> {
-<a name="l01622"></a>01622         mapped_cleaned = cpl_image_duplicate(mapped);
-<a name="l01623"></a>01623         <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);
-<a name="l01624"></a>01624         dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin, 
-<a name="l01625"></a>01625                        ext_radius, cont_radius);
-<a name="l01626"></a>01626 
-<a name="l01627"></a>01627         cpl_image_delete(mapped_cleaned); mapped_cleaned = NULL;
-<a name="l01628"></a>01628         }
-<a name="l01629"></a>01629 
-<a name="l01630"></a>01630         cpl_image_delete(dummy); dummy = NULL;
-<a name="l01631"></a>01631 
-<a name="l01632"></a>01632         <span class="keywordflow">if</span> (check) {
-<a name="l01633"></a>01633 
-<a name="l01634"></a>01634 <span class="comment">/* Old saving:</span>
-<a name="l01635"></a>01635 <span class="comment"></span>
-<a name="l01636"></a>01636 <span class="comment">        if (!j) {</span>
-<a name="l01637"></a>01637 <span class="comment">            if (dfs_save_table(frameset, slits, object_table_tag,</span>
-<a name="l01638"></a>01638 <span class="comment">                       NULL, parlist, recipe, version)) {</span>
-<a name="l01639"></a>01639 <span class="comment">            fors_pmos_extract_exit(NULL);</span>
-<a name="l01640"></a>01640 <span class="comment">            }</span>
-<a name="l01641"></a>01641 <span class="comment">        } else {</span>
-<a name="l01642"></a>01642 <span class="comment">            if (dfs_save_table_ext(slits, object_table_tag, NULL)) {</span>
-<a name="l01643"></a>01643 <span class="comment">            fors_pmos_extract_exit(NULL);</span>
-<a name="l01644"></a>01644 <span class="comment">            }</span>
-<a name="l01645"></a>01645 <span class="comment">        }</span>
-<a name="l01646"></a>01646 <span class="comment"></span>
-<a name="l01647"></a>01647 <span class="comment">End old saving */</span>
-<a name="l01648"></a>01648 
-<a name="l01649"></a>01649                 <span class="keywordflow">if</span> (!j) {
-<a name="l01650"></a>01650                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01651"></a>01651                                            object_table_tag,
-<a name="l01652"></a>01652                                            recipe, version)) {
-<a name="l01653"></a>01653                         fors_pmos_extract_exit(NULL);
-<a name="l01654"></a>01654                     }
-<a name="l01655"></a>01655                 }
-<a name="l01656"></a>01656 
-<a name="l01657"></a>01657                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">dfs_save_table_ext</a>(slits, object_table_tag, NULL)) {
-<a name="l01658"></a>01658                     fors_pmos_extract_exit(NULL);
-<a name="l01659"></a>01659                 }
-<a name="l01660"></a>01660         }
-<a name="l01661"></a>01661     }
-<a name="l01662"></a>01662 
-<a name="l01663"></a>01663     slitss[j]  = slits;
-<a name="l01664"></a>01664     mappeds[j] = mapped;
-<a name="l01665"></a>01665 
-<a name="l01666"></a>01666     cpl_msg_indent_less();
-<a name="l01667"></a>01667 
-<a name="l01668"></a>01668     cpl_propertylist_delete(header); header = NULL;
-<a name="l01669"></a>01669     cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01670"></a>01670 
-<a name="l01671"></a>01671     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l01672"></a>01672     }
-<a name="l01673"></a>01673 
-<a name="l01674"></a>01674     cpl_table_delete(offsets); offsets = NULL;
-<a name="l01675"></a>01675 
-<a name="l01676"></a>01676     cpl_image_delete(norm_flat); norm_flat = NULL;
-<a name="l01677"></a>01677     cpl_vector_delete(lines); lines = NULL;
-<a name="l01678"></a>01678 
-<a name="l01679"></a>01679     cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l01680"></a>01680 
-<a name="l01681"></a>01681     
-<a name="l01682"></a>01682     cpl_msg_indent_less();
-<a name="l01683"></a>01683     cpl_msg_info(recipe, 
-<a name="l01684"></a>01684          <span class="stringliteral">"Check object detection in both beams for all angles..."</span>);
-<a name="l01685"></a>01685     cpl_msg_indent_more();
-<a name="l01686"></a>01686 
-<a name="l01687"></a>01687     <span class="comment">/* House keeping - selection of objects for which information required </span>
-<a name="l01688"></a>01688 <span class="comment">       for Stokes parameters computation is present */</span>
-<a name="l01689"></a>01689     error = <a class="code" href="group__moses.html#g621083edda685c07a318aa94f53bce6f">mos_object_intersect</a>(slitss, origslits, nscience, 5.0);
-<a name="l01690"></a>01690     <span class="keywordflow">if</span> (error == CPL_ERROR_DATA_NOT_FOUND) {
-<a name="l01691"></a>01691         cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: no Stokes "</span>
-<a name="l01692"></a>01692                        <span class="stringliteral">"parameters to compute!"</span>);
-<a name="l01693"></a>01693         <span class="keywordflow">for</span> (j = 0; j < nscience; j++)
-<a name="l01694"></a>01694             cpl_table_delete(slitss[j]);
-<a name="l01695"></a>01695         cpl_free(slitss);
-<a name="l01696"></a>01696         cpl_table_delete(origslits);
-<a name="l01697"></a>01697         <span class="keywordflow">return</span> 0;
-<a name="l01698"></a>01698     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (error) {
-<a name="l01699"></a>01699         fors_pmos_extract_exit(<span class="stringliteral">"Problem in polarimetric object selection"</span>);
-<a name="l01700"></a>01700     }
-<a name="l01701"></a>01701 
-<a name="l01702"></a>01702     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, origslits, object_table_pol_tag,
-<a name="l01703"></a>01703                NULL, parlist, recipe, version)) {
-<a name="l01704"></a>01704     fors_pmos_extract_exit(NULL);
-<a name="l01705"></a>01705     }
-<a name="l01706"></a>01706 
-<a name="l01707"></a>01707     nobjs_per_slit = <a class="code" href="group__moses.html#ge887675f0978f93eb562934c909590e7">fors_get_nobjs_perslit</a>(origslits);
-<a name="l01708"></a>01708 
-<a name="l01709"></a>01709     cpl_msg_indent_less();
-<a name="l01710"></a>01710     cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);
-<a name="l01711"></a>01711     cpl_msg_indent_more();
-<a name="l01712"></a>01712 
-<a name="l01713"></a>01713     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {
-<a name="l01714"></a>01714     <span class="keywordtype">int</span> k;
-<a name="l01715"></a>01715 
-<a name="l01716"></a>01716     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01717"></a>01717 
-<a name="l01718"></a>01718     <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01719"></a>01719         cpl_propertylist_delete(header);
-<a name="l01720"></a>01720         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01721"></a>01721     }
-<a name="l01722"></a>01722 
-<a name="l01723"></a>01723     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01724"></a>01724     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01725"></a>01725     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01726"></a>01726                        startwavelength + dispersion/2);
-<a name="l01727"></a>01727     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01728"></a>01728     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01729"></a>01729 <span class="comment">       cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01730"></a>01730     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01731"></a>01731     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01732"></a>01732     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01733"></a>01733     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01734"></a>01734     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01735"></a>01735     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01736"></a>01736 
-<a name="l01737"></a>01737     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {
-<a name="l01738"></a>01738 
-<a name="l01739"></a>01739         cpl_msg_info(recipe, <span class="stringliteral">"Extracting at angle %.2f (%d out of %d) ..."</span>,
-<a name="l01740"></a>01740              angles[j], j + 1, nscience);
-<a name="l01741"></a>01741 
-<a name="l01742"></a>01742         images = <a class="code" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">mos_extract_objects</a>(mappeds[j], skylocalmaps[j],
-<a name="l01743"></a>01743                      origslits, 
-<a name="l01744"></a>01744                      ext_mode, ron, gain, 1);
-<a name="l01745"></a>01745 
-<a name="l01746"></a>01746         cpl_image_delete(skylocalmaps[j]); skylocalmaps[j] = NULL;
-<a name="l01747"></a>01747 
-<a name="l01748"></a>01748         <span class="keywordflow">if</span> (images) {
-<a name="l01749"></a>01749         <span class="keywordflow">if</span> (time_normalise)
-<a name="l01750"></a>01750             cpl_image_divide_scalar(images[0], alltime);
-<a name="l01751"></a>01751 
-<a name="l01752"></a>01752         <span class="keywordflow">if</span> (!j) {
-<a name="l01753"></a>01753             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01754"></a>01754                        reduced_science_tag,
-<a name="l01755"></a>01755                        recipe, version)) {
-<a name="l01756"></a>01756             fors_pmos_extract_exit(NULL);
-<a name="l01757"></a>01757             }
-<a name="l01758"></a>01758         }
-<a name="l01759"></a>01759 
-<a name="l01760"></a>01760         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(images[0], reduced_science_tag,
-<a name="l01761"></a>01761                        header)) {
-<a name="l01762"></a>01762             fors_pmos_extract_exit(NULL);
-<a name="l01763"></a>01763         }
-<a name="l01764"></a>01764 
-<a name="l01765"></a>01765         reduceds[j] = images[0];
-<a name="l01766"></a>01766 <span class="comment">//      cpl_image_delete(images[0]);</span>
-<a name="l01767"></a>01767     
-<a name="l01768"></a>01768         <span class="keywordflow">if</span> (time_normalise)
-<a name="l01769"></a>01769             cpl_image_divide_scalar(images[1], alltime);
-<a name="l01770"></a>01770 
-<a name="l01771"></a>01771         <span class="keywordflow">if</span> (!j) {
-<a name="l01772"></a>01772             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01773"></a>01773                        reduced_sky_tag,
-<a name="l01774"></a>01774                        recipe, version)) {
-<a name="l01775"></a>01775             fors_pmos_extract_exit(NULL);
-<a name="l01776"></a>01776             }
-<a name="l01777"></a>01777         }
-<a name="l01778"></a>01778 
-<a name="l01779"></a>01779         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(images[1], reduced_sky_tag,
-<a name="l01780"></a>01780                        header)) {
-<a name="l01781"></a>01781             fors_pmos_extract_exit(NULL);
-<a name="l01782"></a>01782         }
-<a name="l01783"></a>01783         cpl_image_delete(images[1]);
-<a name="l01784"></a>01784     
-<a name="l01785"></a>01785         <span class="keywordflow">if</span> (time_normalise)
-<a name="l01786"></a>01786             cpl_image_divide_scalar(images[2], alltime);
-<a name="l01787"></a>01787 
-<a name="l01788"></a>01788         <span class="keywordflow">if</span> (!j) {
-<a name="l01789"></a>01789             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01790"></a>01790                        reduced_error_tag,
-<a name="l01791"></a>01791                        recipe, version)) {
-<a name="l01792"></a>01792             fors_pmos_extract_exit(NULL);
-<a name="l01793"></a>01793             }
-<a name="l01794"></a>01794         }
-<a name="l01795"></a>01795 
-<a name="l01796"></a>01796         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(images[2], reduced_error_tag,
-<a name="l01797"></a>01797                        header)) {
-<a name="l01798"></a>01798             fors_pmos_extract_exit(NULL);
-<a name="l01799"></a>01799         }
-<a name="l01800"></a>01800 
-<a name="l01801"></a>01801         rerrors[j] = images[2];
-<a name="l01802"></a>01802 <span class="comment">//      cpl_image_delete(images[2]);</span>
-<a name="l01803"></a>01803 
-<a name="l01804"></a>01804         cpl_free(images);
-<a name="l01805"></a>01805         }
-<a name="l01806"></a>01806         <span class="keywordflow">else</span> {
-<a name="l01807"></a>01807         cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span>
-<a name="l01808"></a>01808                 <span class="stringliteral">"%s, %s, and %s are not created"</span>, 
-<a name="l01809"></a>01809                 reduced_science_tag, reduced_sky_tag, 
-<a name="l01810"></a>01810                 reduced_error_tag);
-<a name="l01811"></a>01811         }
-<a name="l01812"></a>01812 
-<a name="l01813"></a>01813     }
-<a name="l01814"></a>01814 
-<a name="l01815"></a>01815 <span class="comment">//  slitss[j] = slits;</span>
-<a name="l01816"></a>01816 <span class="comment">//  cpl_table_delete(slits); slits = NULL;</span>
-<a name="l01817"></a>01817 
-<a name="l01818"></a>01818 
-<a name="l01819"></a>01819 <span class="comment">/*    if (skyglobal || skymedian >= 0) {   NSS */</span>
-<a name="l01820"></a>01820     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {
-<a name="l01821"></a>01821         <span class="keywordflow">if</span> (time_normalise)
-<a name="l01822"></a>01822         cpl_image_divide_scalar(mappeds[j], alltime);
-<a name="l01823"></a>01823 
-<a name="l01824"></a>01824         <span class="keywordflow">if</span> (!j) {
-<a name="l01825"></a>01825         <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01826"></a>01826                        mapped_science_tag,
-<a name="l01827"></a>01827                        recipe, version)) {
-<a name="l01828"></a>01828             fors_pmos_extract_exit(NULL);
-<a name="l01829"></a>01829         }
-<a name="l01830"></a>01830         }
-<a name="l01831"></a>01831 
-<a name="l01832"></a>01832         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(mappeds[j], mapped_science_tag,
-<a name="l01833"></a>01833                    header)) {
-<a name="l01834"></a>01834         fors_pmos_extract_exit(NULL);
-<a name="l01835"></a>01835         }
-<a name="l01836"></a>01836     }
-<a name="l01837"></a>01837 
-<a name="l01838"></a>01838     cpl_image_delete(mappeds[j]); mappeds[j] = NULL;
-<a name="l01839"></a>01839     cpl_propertylist_delete(header); header = NULL;
-<a name="l01840"></a>01840 
-<a name="l01841"></a>01841     }
-<a name="l01842"></a>01842 
-<a name="l01843"></a>01843     cpl_table_delete(origslits);
-<a name="l01844"></a>01844 
-<a name="l01845"></a>01845     <span class="comment">/* Stokes computation */</span>
-<a name="l01846"></a>01846 
-<a name="l01847"></a>01847     nobjects = cpl_image_get_size_y(reduceds[0]) / 2;
-<a name="l01848"></a>01848     nx       = cpl_image_get_size_x(reduceds[0]);
-<a name="l01849"></a>01849 
-<a name="l01850"></a>01850     header = cpl_propertylist_new();
-<a name="l01851"></a>01851     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01852"></a>01852     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01853"></a>01853     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01854"></a>01854                    startwavelength + dispersion/2);
-<a name="l01855"></a>01855     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01856"></a>01856     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01857"></a>01857 <span class="comment">       cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01858"></a>01858     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01859"></a>01859     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01860"></a>01860     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01861"></a>01861     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01862"></a>01862     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01863"></a>01863     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01864"></a>01864     
-<a name="l01865"></a>01865     <span class="keywordflow">if</span> (circ) {
-<a name="l01866"></a>01866 
-<a name="l01867"></a>01867     cpl_image        *pv_im          = NULL;
-<a name="l01868"></a>01868     cpl_image        *pvnull_im      = NULL;
-<a name="l01869"></a>01869     cpl_image        *perr_im        = NULL;
-<a name="l01870"></a>01870 
-<a name="l01871"></a>01871     <span class="keywordtype">double</span>           *p_v            = NULL;
-<a name="l01872"></a>01872     <span class="keywordtype">double</span>           *p_vnull        = NULL;
-<a name="l01873"></a>01873     <span class="keywordtype">double</span>           *perr           = NULL;
-<a name="l01874"></a>01874 
-<a name="l01875"></a>01875     <span class="keywordtype">double</span>            mean_vnull;
-<a name="l01876"></a>01876 
-<a name="l01877"></a>01877     <span class="keywordtype">int</span> p = -1;
-<a name="l01878"></a>01878     <span class="keywordtype">int</span> total = 0;
-<a name="l01879"></a>01879 
-<a name="l01880"></a>01880     pv_im     = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l01881"></a>01881     perr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l01882"></a>01882 
-<a name="l01883"></a>01883     p_v     = cpl_image_get_data_double(pv_im);
-<a name="l01884"></a>01884     perr    = cpl_image_get_data_double(perr_im);
-<a name="l01885"></a>01885 
-<a name="l01886"></a>01886     <span class="keywordflow">if</span> (nscience / 2 > 1) {
-<a name="l01887"></a>01887         pvnull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l01888"></a>01888         p_vnull = cpl_image_get_data_double(pvnull_im);
-<a name="l01889"></a>01889     }
-<a name="l01890"></a>01890 
-<a name="l01891"></a>01891     <span class="keywordflow">for</span> (j = 0; j < nobjects; j++) {
-<a name="l01892"></a>01892         <span class="keywordtype">int</span> k, m;
-<a name="l01893"></a>01893 
-<a name="l01894"></a>01894         <span class="keywordtype">double</span> * ip_v,
-<a name="l01895"></a>01895            * ip_vnull, * iperr;
-<a name="l01896"></a>01896 
-<a name="l01897"></a>01897         <span class="keywordtype">float</span> * data;
-<a name="l01898"></a>01898         <span class="keywordtype">float</span> * iff,  * ierr;
-<a name="l01899"></a>01899 
-<a name="l01900"></a>01900         ip_v = p_v + (nobjects - 1 - j) * nx;
-<a name="l01901"></a>01901 
-<a name="l01902"></a>01902         <span class="keywordflow">if</span> (nscience / 2 > 1)
-<a name="l01903"></a>01903         ip_vnull = p_vnull + (nobjects - 1 - j) * nx;
-<a name="l01904"></a>01904 
-<a name="l01905"></a>01905         iperr = perr + (nobjects - 1 - j) * nx;
-<a name="l01906"></a>01906 
-<a name="l01907"></a>01907         <span class="keywordflow">while</span> (total < j + 1) {
-<a name="l01908"></a>01908         p++;
-<a name="l01909"></a>01909         total += nobjs_per_slit[p];
-<a name="l01910"></a>01910         }
-<a name="l01911"></a>01911 
-<a name="l01912"></a>01912         <span class="keywordflow">for</span> (k = 0; k < nscience / 2; k++) {
-<a name="l01913"></a>01913         <span class="keywordtype">float</span> * if_o,  * if_e,  * ifdelta_o, * ifdelta_e;
-<a name="l01914"></a>01914 
-<a name="l01915"></a>01915         <span class="keywordtype">int</span> pos   = fors_find_angle_pos(angles, nscience, 180 * k - 45);
-<a name="l01916"></a>01916         <span class="keywordtype">int</span> pos_d = fors_find_angle_pos(angles, nscience, 180 * k + 45);
-<a name="l01917"></a>01917 
-<a name="l01918"></a>01918         data = cpl_image_get_data_float(reduceds[pos]);
-<a name="l01919"></a>01919 
-<a name="l01920"></a>01920         if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l01921"></a>01921                    + (total - j - 1)) * nx;
-<a name="l01922"></a>01922 
-<a name="l01923"></a>01923         if_e = data + (2 * (nobjects - total) 
-<a name="l01924"></a>01924                    + (total - j - 1)) * nx;
-<a name="l01925"></a>01925 
-<a name="l01926"></a>01926 <span class="comment">//      if_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span>
-<a name="l01927"></a>01927 <span class="comment">//      if_e = data +  2 * (nobjects - 1 - j)      * nx;</span>
-<a name="l01928"></a>01928 
-<a name="l01929"></a>01929         data = cpl_image_get_data_float(reduceds[pos_d]);
-<a name="l01930"></a>01930 
-<a name="l01931"></a>01931         ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l01932"></a>01932                    + (total - j - 1)) * nx;
-<a name="l01933"></a>01933 
-<a name="l01934"></a>01934         ifdelta_e = data + (2 * (nobjects - total) 
-<a name="l01935"></a>01935                    + (total - j - 1)) * nx;
-<a name="l01936"></a>01936 
-<a name="l01937"></a>01937 <span class="comment">//      ifdelta_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span>
-<a name="l01938"></a>01938 <span class="comment">//      ifdelta_e = data +  2 * (nobjects - 1 - j)      * nx;</span>
-<a name="l01939"></a>01939 
-<a name="l01940"></a>01940         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l01941"></a>01941 
-<a name="l01942"></a>01942             <span class="keywordtype">double</span> quantity = if_o[m] + if_e[m] == 0.0 ? 0.0 :
-<a name="l01943"></a>01943             (if_o[m]      - if_e[m]     ) /
-<a name="l01944"></a>01944             (if_o[m]      + if_e[m]     ) -
-<a name="l01945"></a>01945             (ifdelta_o[m] - ifdelta_e[m]) /
-<a name="l01946"></a>01946             (ifdelta_o[m] + ifdelta_e[m]);
-<a name="l01947"></a>01947 
-<a name="l01948"></a>01948             quantity = isfinite(quantity) ? quantity : 0.0;
-<a name="l01949"></a>01949 
-<a name="l01950"></a>01950             <span class="comment">/* PQ map computation */</span>
-<a name="l01951"></a>01951             ip_v[m] += quantity * 0.5 / (nscience / 2);
-<a name="l01952"></a>01952 
-<a name="l01953"></a>01953             <span class="comment">/* PQnull map computation */</span>
-<a name="l01954"></a>01954             <span class="keywordflow">if</span> (nscience / 2 > 1) {
-<a name="l01955"></a>01955             <span class="keywordflow">if</span> (k % 2)
-<a name="l01956"></a>01956                 ip_vnull[m] += quantity * 0.5 / (nscience / 2);
-<a name="l01957"></a>01957             <span class="keywordflow">else</span>
-<a name="l01958"></a>01958                 ip_vnull[m] -= quantity * 0.5 / (nscience / 2);
-<a name="l01959"></a>01959             }
-<a name="l01960"></a>01960         }
-<a name="l01961"></a>01961         }
-<a name="l01962"></a>01962 
-<a name="l01963"></a>01963         <span class="comment">/* Error map */</span>
-<a name="l01964"></a>01964         data = cpl_image_get_data_float(reduceds[0]);
-<a name="l01965"></a>01965         iff  = data +  2 * (nobjects - 1 - j)      * nx;
-<a name="l01966"></a>01966 
-<a name="l01967"></a>01967         data = cpl_image_get_data_float(rerrors[0]);
-<a name="l01968"></a>01968         ierr = data +  2 * (nobjects - 1 - j)      * nx;
-<a name="l01969"></a>01969 
-<a name="l01970"></a>01970         <span class="keywordflow">for</span> (m = 0; m < nx; m++)
-<a name="l01971"></a>01971         iperr[m] = iff[m] <= 0.0 ? 
-<a name="l01972"></a>01972             0.0 : ierr[m] / iff[m] * 0.5 / sqrt (nscience / 2);
-<a name="l01973"></a>01973 
-<a name="l01974"></a>01974         <span class="keywordflow">if</span> (nscience / 2 > 1) {
-<a name="l01975"></a>01975         <span class="keywordtype">float</span> * weights;
-<a name="l01976"></a>01976         <span class="keywordtype">float</span>   max, sum, sum2, imean;
-<a name="l01977"></a>01977 
-<a name="l01978"></a>01978         <span class="keywordtype">int</span> k;
-<a name="l01979"></a>01979 
-<a name="l01980"></a>01980         <span class="comment">/* QC on U NULL */</span>
-<a name="l01981"></a>01981         weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);
-<a name="l01982"></a>01982 
-<a name="l01983"></a>01983         max = 0.0;
-<a name="l01984"></a>01984         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l01985"></a>01985             <span class="keywordflow">if</span> (max < iff[k]) max = iff[k];
-<a name="l01986"></a>01986         }
-<a name="l01987"></a>01987         
-<a name="l01988"></a>01988         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l01989"></a>01989             weights[k] = iff[k] < 0.0 ? 
-<a name="l01990"></a>01990             0.0 : iff[k] * iff[k] / (max * max);
-<a name="l01991"></a>01991         }
-<a name="l01992"></a>01992         
-<a name="l01993"></a>01993         sum  = 0.0;
-<a name="l01994"></a>01994         sum2 = 0.0;
-<a name="l01995"></a>01995         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l01996"></a>01996             sum  += weights[k] * ip_vnull[k];
-<a name="l01997"></a>01997             sum2 += weights[k];
-<a name="l01998"></a>01998         }
-<a name="l01999"></a>01999 
-<a name="l02000"></a>02000         cpl_free(weights);
-<a name="l02001"></a>02001 
-<a name="l02002"></a>02002         imean = sum / sum2;
-<a name="l02003"></a>02003 
-<a name="l02004"></a>02004         mean_vnull += (imean - mean_vnull) / (j + 1.0);
-<a name="l02005"></a>02005         }
-<a name="l02006"></a>02006     }
-<a name="l02007"></a>02007 
-<a name="l02008"></a>02008     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pv_im, reduced_v_tag, header, 
-<a name="l02009"></a>02009                parlist, recipe, version))
-<a name="l02010"></a>02010         fors_pmos_extract_exit(NULL);
-<a name="l02011"></a>02011 
-<a name="l02012"></a>02012     <span class="keywordflow">if</span> (nscience / 2 > 1) {
-<a name="l02013"></a>02013         <span class="keywordtype">char</span> * pipefile, * keyname;
-<a name="l02014"></a>02014         cpl_propertylist * qheader = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l02015"></a>02015 
-<a name="l02016"></a>02016             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l02017"></a>02017             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02018"></a>02018             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l02019"></a>02019                                startwavelength + dispersion/2);
-<a name="l02020"></a>02020             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02021"></a>02021             <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l02022"></a>02022 <span class="comment">               cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l02023"></a>02023             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l02024"></a>02024             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02025"></a>02025             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02026"></a>02026             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02027"></a>02027             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02028"></a>02028             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02029"></a>02029 
-<a name="l02030"></a>02030         <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);
-<a name="l02031"></a>02031 
-<a name="l02032"></a>02032         <span class="comment">/*</span>
-<a name="l02033"></a>02033 <span class="comment">         * QC1 group header</span>
-<a name="l02034"></a>02034 <span class="comment">         */</span>
-<a name="l02035"></a>02035 
-<a name="l02036"></a>02036         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_v_tag,
-<a name="l02037"></a>02037                      <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l02038"></a>02038         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write product category to "</span>
-<a name="l02039"></a>02039                      <span class="stringliteral">"QC log file"</span>);
-<a name="l02040"></a>02040 
-<a name="l02041"></a>02041         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l02042"></a>02042                        <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l02043"></a>02043         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DPR TYPE in arc "</span>
-<a name="l02044"></a>02044                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02045"></a>02045 
-<a name="l02046"></a>02046         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l02047"></a>02047                        <span class="stringliteral">"Template"</span>, instrume))
-<a name="l02048"></a>02048         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword TPL ID in arc "</span>
-<a name="l02049"></a>02049                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02050"></a>02050 
-<a name="l02051"></a>02051         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,
-<a name="l02052"></a>02052                        <span class="stringliteral">"Grism name"</span>, instrume))
-<a name="l02053"></a>02053         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in arc "</span>
-<a name="l02054"></a>02054                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02055"></a>02055 
-<a name="l02056"></a>02056         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,
-<a name="l02057"></a>02057                        <span class="stringliteral">"Grism identifier"</span>, instrume))
-<a name="l02058"></a>02058         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in arc "</span>
-<a name="l02059"></a>02059                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02060"></a>02060 
-<a name="l02061"></a>02061         <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))
-<a name="l02062"></a>02062         <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,
-<a name="l02063"></a>02063                        <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l02064"></a>02064 
-<a name="l02065"></a>02065         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,
-<a name="l02066"></a>02066                        <span class="stringliteral">"Collimator name"</span>, instrume))
-<a name="l02067"></a>02067         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in arc "</span>
-<a name="l02068"></a>02068                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02069"></a>02069 
-<a name="l02070"></a>02070         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l02071"></a>02071                        <span class="stringliteral">"Chip identifier"</span>, instrume))
-<a name="l02072"></a>02072         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in arc "</span>
-<a name="l02073"></a>02073                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02074"></a>02074 
-<a name="l02075"></a>02075         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l02076"></a>02076                        <span class="stringliteral">"Archive name of input data"</span>, 
-<a name="l02077"></a>02077                        instrume))
-<a name="l02078"></a>02078         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ARCFILE in arc "</span>
-<a name="l02079"></a>02079                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02080"></a>02080 
-<a name="l02081"></a>02081         pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(reduced_nul_v_tag);
-<a name="l02082"></a>02082         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l02083"></a>02083                      <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l02084"></a>02084         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);
-<a name="l02085"></a>02085         cpl_free(pipefile); pipefile = NULL;
-<a name="l02086"></a>02086 
-<a name="l02087"></a>02087 
-<a name="l02088"></a>02088         <span class="comment">/*</span>
-<a name="l02089"></a>02089 <span class="comment">         * QC1 parameters</span>
-<a name="l02090"></a>02090 <span class="comment">         */</span>
-<a name="l02091"></a>02091 
-<a name="l02092"></a>02092         keyname = <span class="stringliteral">"QC.NULL.V.MEAN"</span>;
-<a name="l02093"></a>02093             
-<a name="l02094"></a>02094         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qheader, mean_vnull,
-<a name="l02095"></a>02095                     keyname, NULL,
-<a name="l02096"></a>02096                     <span class="stringliteral">"Mean V null parameter"</span>,
-<a name="l02097"></a>02097                     instrume)) {
-<a name="l02098"></a>02098         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write mean Q null parameter "</span>
-<a name="l02099"></a>02099                      <span class="stringliteral">"to QC log file"</span>);
-<a name="l02100"></a>02100         }
-<a name="l02101"></a>02101 
-<a name="l02102"></a>02102         <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l02103"></a>02103 
-<a name="l02104"></a>02104         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pvnull_im, reduced_nul_v_tag, qheader, 
-<a name="l02105"></a>02105                    parlist, recipe, version))
-<a name="l02106"></a>02106         fors_pmos_extract_exit(NULL);
-<a name="l02107"></a>02107 
-<a name="l02108"></a>02108         cpl_propertylist_delete(qheader);
-<a name="l02109"></a>02109     }
-<a name="l02110"></a>02110 
-<a name="l02111"></a>02111     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, perr_im, reduced_error_v_tag, header, 
-<a name="l02112"></a>02112                parlist, recipe, version))
-<a name="l02113"></a>02113         fors_pmos_extract_exit(NULL);
-<a name="l02114"></a>02114 
-<a name="l02115"></a>02115     cpl_image_delete(pv_im);
-<a name="l02116"></a>02116     cpl_image_delete(pvnull_im);
-<a name="l02117"></a>02117     cpl_image_delete(perr_im);
-<a name="l02118"></a>02118     } <span class="keywordflow">else</span> {
-<a name="l02119"></a>02119     cpl_image        *pq_im          = NULL;
-<a name="l02120"></a>02120     cpl_image        *pu_im          = NULL;
-<a name="l02121"></a>02121     cpl_image        *pl_im          = NULL;
-<a name="l02122"></a>02122 
-<a name="l02123"></a>02123     cpl_image        *pqnull_im      = NULL;
-<a name="l02124"></a>02124     cpl_image        *punull_im      = NULL;
-<a name="l02125"></a>02125 
-<a name="l02126"></a>02126     cpl_image        *pqerr_im        = NULL;
-<a name="l02127"></a>02127     cpl_image        *puerr_im        = NULL;
-<a name="l02128"></a>02128     cpl_image        *plerr_im        = NULL;
-<a name="l02129"></a>02129 
-<a name="l02130"></a>02130     cpl_image        *pang_im        = NULL;
-<a name="l02131"></a>02131     cpl_image        *pangerr_im        = NULL;
-<a name="l02132"></a>02132 
-<a name="l02133"></a>02133     <span class="keywordtype">double</span>           *p_q            = NULL;
-<a name="l02134"></a>02134     <span class="keywordtype">double</span>           *p_u            = NULL;
-<a name="l02135"></a>02135     <span class="keywordtype">double</span>           *p_l            = NULL;
-<a name="l02136"></a>02136 
-<a name="l02137"></a>02137     <span class="keywordtype">double</span>           *p_qnull        = NULL;
-<a name="l02138"></a>02138     <span class="keywordtype">double</span>           *p_unull        = NULL;
-<a name="l02139"></a>02139 
-<a name="l02140"></a>02140     <span class="keywordtype">double</span>           *pqerr           = NULL;
-<a name="l02141"></a>02141     <span class="keywordtype">double</span>           *puerr           = NULL;
-<a name="l02142"></a>02142     <span class="keywordtype">double</span>           *plerr           = NULL;
-<a name="l02143"></a>02143 
-<a name="l02144"></a>02144     <span class="keywordtype">double</span>           *pang           = NULL;
-<a name="l02145"></a>02145     <span class="keywordtype">double</span>           *pangerr           = NULL;
-<a name="l02146"></a>02146 
-<a name="l02147"></a>02147     <span class="keywordtype">int</span> k, m;
-<a name="l02148"></a>02148 
-<a name="l02149"></a>02149     cpl_image * correct_im = cpl_image_new(nx, 1, CPL_TYPE_DOUBLE);
-<a name="l02150"></a>02150     <span class="keywordtype">double</span>    * correct    = cpl_image_get_data_double(correct_im);
-<a name="l02151"></a>02151 
-<a name="l02152"></a>02152     <span class="keywordtype">double</span> mean_unull, mean_qnull;
-<a name="l02153"></a>02153 
-<a name="l02154"></a>02154     <span class="keywordtype">int</span> p = -1;
-<a name="l02155"></a>02155     <span class="keywordtype">int</span> total = 0;
-<a name="l02156"></a>02156 
-<a name="l02157"></a>02157     pq_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02158"></a>02158     pu_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02159"></a>02159     pl_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02160"></a>02160 
-<a name="l02161"></a>02161     pqerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02162"></a>02162     puerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02163"></a>02163     plerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02164"></a>02164 
-<a name="l02165"></a>02165     pang_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02166"></a>02166     pangerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02167"></a>02167 
-<a name="l02168"></a>02168     p_q = cpl_image_get_data_double(pq_im);
-<a name="l02169"></a>02169     p_u = cpl_image_get_data_double(pu_im);
-<a name="l02170"></a>02170     p_l = cpl_image_get_data_double(pl_im);
-<a name="l02171"></a>02171 
-<a name="l02172"></a>02172     <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02173"></a>02173         pqnull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02174"></a>02174         punull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02175"></a>02175 
-<a name="l02176"></a>02176         p_qnull = cpl_image_get_data_double(pqnull_im);
-<a name="l02177"></a>02177         p_unull = cpl_image_get_data_double(punull_im);
-<a name="l02178"></a>02178     } <span class="keywordflow">else</span> {
-<a name="l02179"></a>02179         cpl_msg_warning(cpl_func, 
-<a name="l02180"></a>02180                 <span class="stringliteral">"Not enough pairs to compute null parameters"</span>);
-<a name="l02181"></a>02181     }
-<a name="l02182"></a>02182 
-<a name="l02183"></a>02183     pqerr = cpl_image_get_data_double(pqerr_im);
-<a name="l02184"></a>02184     puerr = cpl_image_get_data_double(puerr_im);
-<a name="l02185"></a>02185     plerr = cpl_image_get_data_double(plerr_im);
-<a name="l02186"></a>02186 
-<a name="l02187"></a>02187     pang = cpl_image_get_data_double(pang_im);
-<a name="l02188"></a>02188     pangerr = cpl_image_get_data_double(pangerr_im);
-<a name="l02189"></a>02189 
-<a name="l02190"></a>02190     <span class="keywordflow">if</span> (chromatism) {
-<a name="l02191"></a>02191         cpl_table * chrotbl = 
-<a name="l02192"></a>02192         <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, chrom_table_tag, 1);
-<a name="l02193"></a>02193 
-<a name="l02194"></a>02194         <span class="keywordtype">int</span>      nrow   = cpl_table_get_nrow(chrotbl);
-<a name="l02195"></a>02195         <span class="keywordtype">float</span>  * lambda = cpl_table_get_data_float(chrotbl, <span class="stringliteral">"lambda"</span>);
-<a name="l02196"></a>02196         <span class="keywordtype">float</span>  * theta  = cpl_table_get_data_float(chrotbl, <span class="stringliteral">"eps_theta"</span>);
-<a name="l02197"></a>02197 
-<a name="l02198"></a>02198         <span class="keywordflow">for</span> (j = 0; j < nx; j++) {
-<a name="l02199"></a>02199         <span class="keywordtype">double</span> c_wave = 
-<a name="l02200"></a>02200             startwavelength + dispersion / 2 + j * dispersion;
-<a name="l02201"></a>02201         
-<a name="l02202"></a>02202         <span class="keywordtype">int</span> found = 0;
-<a name="l02203"></a>02203 
-<a name="l02204"></a>02204         <span class="keywordflow">for</span> (k = 0; k < nrow - 1; k++) {
-<a name="l02205"></a>02205             <span class="keywordflow">if</span> (lambda[k] <= c_wave && c_wave < lambda[k + 1]) {
-<a name="l02206"></a>02206             found = 1;
-<a name="l02207"></a>02207             <span class="keywordflow">break</span>;
-<a name="l02208"></a>02208             }
-<a name="l02209"></a>02209         }
-<a name="l02210"></a>02210 
-<a name="l02211"></a>02211         <span class="keywordflow">if</span> (found) {
-<a name="l02212"></a>02212             correct[j] = (theta [k + 1] - theta [k]) /
-<a name="l02213"></a>02213                      (lambda[k + 1] - lambda[k]) *
-<a name="l02214"></a>02214                      (c_wave        - lambda[k])   + theta[k];
-<a name="l02215"></a>02215                     correct[j] *= M_PI / 180;   <span class="comment">/* Radians */</span>
-<a name="l02216"></a>02216         }
-<a name="l02217"></a>02217                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (j)
-<a name="l02218"></a>02218                     correct[j] = correct[j-1];
-<a name="l02219"></a>02219                 <span class="keywordflow">else</span>
-<a name="l02220"></a>02220                     correct[j] = 0.0;
-<a name="l02221"></a>02221 
-<a name="l02222"></a>02222         }
-<a name="l02223"></a>02223 
-<a name="l02224"></a>02224         cpl_table_delete(chrotbl);
-<a name="l02225"></a>02225     }
-<a name="l02226"></a>02226 
-<a name="l02227"></a>02227     <span class="keywordflow">for</span> (j = 0; j < nobjects; j++) {
-<a name="l02228"></a>02228         <span class="keywordtype">double</span> * ip_q,     * ip_u, * ip_l, 
-<a name="l02229"></a>02229         * ip_qnull, * ip_unull, * ipqerr, * ipuerr, * iplerr,
-<a name="l02230"></a>02230         * ipang, * ipangerr;
-<a name="l02231"></a>02231 
-<a name="l02232"></a>02232         <span class="keywordtype">float</span> * data;
-<a name="l02233"></a>02233         <span class="keywordtype">float</span> * iffq,  * ierrq, * iffu, * ierru;
-<a name="l02234"></a>02234 
-<a name="l02235"></a>02235         <span class="keywordtype">int</span> pos, pos_d;
-<a name="l02236"></a>02236 
-<a name="l02237"></a>02237         ip_q = p_q + (nobjects - 1 - j) * nx;
-<a name="l02238"></a>02238         ip_u = p_u + (nobjects - 1 - j) * nx;
-<a name="l02239"></a>02239         ip_l = p_l + (nobjects - 1 - j) * nx;
-<a name="l02240"></a>02240 
-<a name="l02241"></a>02241         <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02242"></a>02242         ip_qnull = p_qnull + (nobjects - 1 - j) * nx;
-<a name="l02243"></a>02243         ip_unull = p_unull + (nobjects - 1 - j) * nx;
-<a name="l02244"></a>02244         }
-<a name="l02245"></a>02245 
-<a name="l02246"></a>02246         ipqerr = pqerr + (nobjects - 1 - j) * nx;
-<a name="l02247"></a>02247         ipuerr = puerr + (nobjects - 1 - j) * nx;
-<a name="l02248"></a>02248         iplerr = plerr + (nobjects - 1 - j) * nx;
-<a name="l02249"></a>02249 
-<a name="l02250"></a>02250         ipang = pang + (nobjects - 1 - j) * nx;
-<a name="l02251"></a>02251         ipangerr = pangerr + (nobjects - 1 - j) * nx;
-<a name="l02252"></a>02252 
-<a name="l02253"></a>02253         <span class="keywordflow">while</span> (total < j + 1) {
-<a name="l02254"></a>02254         p++;
-<a name="l02255"></a>02255         total += nobjs_per_slit[p];
-<a name="l02256"></a>02256         }
-<a name="l02257"></a>02257 
-<a name="l02258"></a>02258         <span class="keywordflow">for</span> (k = 0; k < nscience / 4; k++) {
-<a name="l02259"></a>02259         <span class="keywordtype">float</span> * if_o,  * if_e,  * ifdelta_o, * ifdelta_e;
-<a name="l02260"></a>02260 
-<a name="l02261"></a>02261         <span class="comment">/* First P_Q */</span>
-<a name="l02262"></a>02262 
-<a name="l02263"></a>02263         pos   = fors_find_angle_pos(angles, nscience, 90 * k);
-<a name="l02264"></a>02264         pos_d = fors_find_angle_pos(angles, nscience, 90 * k + 45);
-<a name="l02265"></a>02265 
-<a name="l02266"></a>02266         data = cpl_image_get_data_float(reduceds[pos]);
-<a name="l02267"></a>02267 
-<a name="l02268"></a>02268         if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l02269"></a>02269                    + (total - j - 1)) * nx;
-<a name="l02270"></a>02270 
-<a name="l02271"></a>02271         if_e = data + (2 * (nobjects - total) 
-<a name="l02272"></a>02272                    + (total - j - 1)) * nx;
-<a name="l02273"></a>02273 
-<a name="l02274"></a>02274 <span class="comment">//      if_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span>
-<a name="l02275"></a>02275 <span class="comment">//      if_e = data +  2 * (nobjects - 1 - j)      * nx;</span>
-<a name="l02276"></a>02276 
-<a name="l02277"></a>02277         data = cpl_image_get_data_float(reduceds[pos_d]);
-<a name="l02278"></a>02278 
-<a name="l02279"></a>02279         ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l02280"></a>02280                    + (total - j - 1)) * nx;
-<a name="l02281"></a>02281 
-<a name="l02282"></a>02282         ifdelta_e = data + (2 * (nobjects - total) 
-<a name="l02283"></a>02283                    + (total - j - 1)) * nx;
-<a name="l02284"></a>02284 
-<a name="l02285"></a>02285 <span class="comment">//      ifdelta_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span>
-<a name="l02286"></a>02286 <span class="comment">//      ifdelta_e = data +  2 * (nobjects - 1 - j)      * nx;</span>
-<a name="l02287"></a>02287 
-<a name="l02288"></a>02288         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l02289"></a>02289 
-<a name="l02290"></a>02290             <span class="keywordtype">double</span> quantity = fabs(if_o[m] + if_e[m]) < FLT_MIN ? 0.0 :
-<a name="l02291"></a>02291             (if_o[m]      - if_e[m]     ) /
-<a name="l02292"></a>02292             (if_o[m]      + if_e[m]     ) -
-<a name="l02293"></a>02293             (ifdelta_o[m] - ifdelta_e[m]) /
-<a name="l02294"></a>02294             (ifdelta_o[m] + ifdelta_e[m]);
-<a name="l02295"></a>02295 
-<a name="l02296"></a>02296             quantity = isfinite(quantity) ? quantity : 0.0;
-<a name="l02297"></a>02297 
-<a name="l02298"></a>02298             <span class="comment">/* PQ map computation */</span>
-<a name="l02299"></a>02299             ip_q[m] += quantity * 0.5 / (nscience / 4);
-<a name="l02300"></a>02300 
-<a name="l02301"></a>02301             <span class="comment">/* PQnull map computation */</span>
-<a name="l02302"></a>02302             <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02303"></a>02303             <span class="keywordflow">if</span> (k % 2)
-<a name="l02304"></a>02304                 ip_qnull[m] += quantity * 0.5 / (nscience / 4);
-<a name="l02305"></a>02305             <span class="keywordflow">else</span>
-<a name="l02306"></a>02306                 ip_qnull[m] -= quantity * 0.5 / (nscience / 4);
-<a name="l02307"></a>02307             }
-<a name="l02308"></a>02308         }
-<a name="l02309"></a>02309 
-<a name="l02310"></a>02310         <span class="comment">/* Now P_U */</span>
-<a name="l02311"></a>02311 
-<a name="l02312"></a>02312         pos   = fors_find_angle_pos(angles, nscience, 90 * k + 22.5);
-<a name="l02313"></a>02313         pos_d = fors_find_angle_pos(angles, nscience, 90 * k + 67.5);
-<a name="l02314"></a>02314 
-<a name="l02315"></a>02315         data = cpl_image_get_data_float(reduceds[pos]);
-<a name="l02316"></a>02316 
-<a name="l02317"></a>02317         if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l02318"></a>02318                    + (total - j - 1)) * nx;
-<a name="l02319"></a>02319 
-<a name="l02320"></a>02320         if_e = data + (2 * (nobjects - total) 
-<a name="l02321"></a>02321                    + (total - j - 1)) * nx;
-<a name="l02322"></a>02322 
-<a name="l02323"></a>02323 <span class="comment">//      if_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span>
-<a name="l02324"></a>02324 <span class="comment">//      if_e = data +  2 * (nobjects - 1 - j)      * nx;</span>
-<a name="l02325"></a>02325 
-<a name="l02326"></a>02326         data = cpl_image_get_data_float(reduceds[pos_d]);
-<a name="l02327"></a>02327 
-<a name="l02328"></a>02328         ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l02329"></a>02329                    + (total - j - 1)) * nx;
-<a name="l02330"></a>02330 
-<a name="l02331"></a>02331         ifdelta_e = data + (2 * (nobjects - total) 
-<a name="l02332"></a>02332                    + (total - j - 1)) * nx;
-<a name="l02333"></a>02333 
-<a name="l02334"></a>02334 <span class="comment">//      ifdelta_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span>
-<a name="l02335"></a>02335 <span class="comment">//      ifdelta_e = data +  2 * (nobjects - 1 - j)      * nx;</span>
-<a name="l02336"></a>02336 
-<a name="l02337"></a>02337         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l02338"></a>02338 
-<a name="l02339"></a>02339             <span class="keywordtype">double</span> quantity = fabs(if_o[m] + if_e[m]) < FLT_MIN ? 0.0 :
-<a name="l02340"></a>02340             (if_o[m]      - if_e[m]     ) /
-<a name="l02341"></a>02341             (if_o[m]      + if_e[m]     ) -
-<a name="l02342"></a>02342             (ifdelta_o[m] - ifdelta_e[m]) /
-<a name="l02343"></a>02343             (ifdelta_o[m] + ifdelta_e[m]);
-<a name="l02344"></a>02344 
-<a name="l02345"></a>02345             quantity = isfinite(quantity) ? quantity : 0.0;
-<a name="l02346"></a>02346 
-<a name="l02347"></a>02347             <span class="comment">/* PU map computation */</span>
-<a name="l02348"></a>02348             ip_u[m] += quantity * 0.5 / (nscience / 4);
-<a name="l02349"></a>02349 
-<a name="l02350"></a>02350             <span class="comment">/* PUnull map computation */</span>
-<a name="l02351"></a>02351             <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02352"></a>02352             <span class="keywordflow">if</span> (k % 2)
-<a name="l02353"></a>02353                 ip_unull[m] += quantity * 0.5 / (nscience / 4);
-<a name="l02354"></a>02354             <span class="keywordflow">else</span>
-<a name="l02355"></a>02355                 ip_unull[m] -= quantity * 0.5 / (nscience / 4);
-<a name="l02356"></a>02356             }
-<a name="l02357"></a>02357         }
-<a name="l02358"></a>02358         }
-<a name="l02359"></a>02359 
-<a name="l02360"></a>02360         <span class="comment">/* Error map */</span>
-<a name="l02361"></a>02361 
-<a name="l02362"></a>02362         pos   = fors_find_angle_pos(angles, nscience, 0.0);
-<a name="l02363"></a>02363 
-<a name="l02364"></a>02364         data = cpl_image_get_data_float(reduceds[pos]);
-<a name="l02365"></a>02365         iffq  = data +  2 * (nobjects - 1 - j)      * nx;
-<a name="l02366"></a>02366 
-<a name="l02367"></a>02367         data = cpl_image_get_data_float(rerrors[pos]);
-<a name="l02368"></a>02368         ierrq = data +  2 * (nobjects - 1 - j)      * nx;
-<a name="l02369"></a>02369         
-<a name="l02370"></a>02370         pos   = fors_find_angle_pos(angles, nscience, 22.5);
-<a name="l02371"></a>02371 
-<a name="l02372"></a>02372         data = cpl_image_get_data_float(reduceds[pos]);
-<a name="l02373"></a>02373         iffu  = data +  2 * (nobjects - 1 - j)      * nx;
-<a name="l02374"></a>02374 
-<a name="l02375"></a>02375         data = cpl_image_get_data_float(rerrors[pos]);
-<a name="l02376"></a>02376         ierru = data +  2 * (nobjects - 1 - j)      * nx;
-<a name="l02377"></a>02377 
-<a name="l02378"></a>02378         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l02379"></a>02379 
-<a name="l02380"></a>02380         <span class="keywordtype">double</span> radicand; 
-<a name="l02381"></a>02381 
-<a name="l02382"></a>02382         ipqerr[m] = iffq[m] <= 0.0 ? 
-<a name="l02383"></a>02383             0.0 : ierrq[m] / iffq[m] * 0.5 / sqrt (nscience / 4);
-<a name="l02384"></a>02384 
-<a name="l02385"></a>02385         ipuerr[m] = iffu[m] <= 0.0 ? 
-<a name="l02386"></a>02386             0.0 : ierru[m] / iffu[m] * 0.5 / sqrt (nscience / 4);
-<a name="l02387"></a>02387 
-<a name="l02388"></a>02388         iplerr[m] = CPL_MATH_SQRT1_2 * 0.5 * (ipqerr[m] + ipuerr[m]);
-<a name="l02389"></a>02389 
-<a name="l02390"></a>02390 <span class="comment">/* Added: */</span>
-<a name="l02391"></a>02391         <span class="keywordflow">if</span> (chromatism) {
-<a name="l02392"></a>02392             ip_q[m] = ip_q[m] * cos(2 * correct[m]) - 
-<a name="l02393"></a>02393                               ip_u[m] * sin(2 * correct[m]);
-<a name="l02394"></a>02394 
-<a name="l02395"></a>02395             ip_u[m] = ip_q[m] * sin(2 * correct[m]) + 
-<a name="l02396"></a>02396                               ip_u[m] * cos(2 * correct[m]);
-<a name="l02397"></a>02397         }
-<a name="l02398"></a>02398 <span class="comment">/* End added */</span>
-<a name="l02399"></a>02399 
-<a name="l02400"></a>02400         <span class="comment">/* PL computation */</span>
-<a name="l02401"></a>02401         ip_l[m] = sqrt(ip_u[m] * ip_u[m] + ip_q[m] * ip_q[m]);
-<a name="l02402"></a>02402 
-<a name="l02403"></a>02403         <span class="comment">/* P angle computation */</span>
-<a name="l02404"></a>02404         ipang[m] = (ip_q[m] == 0.0 ?
-<a name="l02405"></a>02405             (ip_u[m] > 0.0 ? 45.0 : 135.0)
-<a name="l02406"></a>02406             : 0.5 * (atan2(ip_u[m], ip_q[m]) * 180 / M_PI + 
-<a name="l02407"></a>02407                  ((atan2(ip_u[m], ip_q[m]) > 0.0 ? 0.0 : 360.0))));
-<a name="l02408"></a>02408 
-<a name="l02409"></a>02409         <span class="comment">/* Error on the angle computation */</span>
-<a name="l02410"></a>02410         radicand = ip_q[m] * ip_q[m] * ipuerr[m] * ipuerr[m] + 
-<a name="l02411"></a>02411                    ip_u[m] * ip_u[m] * ipqerr[m] * ipqerr[m];
-<a name="l02412"></a>02412   
-<a name="l02413"></a>02413         ipangerr[m] = ip_l[m] == 0.0 ? 0.0 :
-<a name="l02414"></a>02414              sqrt(radicand) * 0.5 / (ip_l[m] * ip_l[m]) * 180 / M_PI;
-<a name="l02415"></a>02415 
-<a name="l02416"></a>02416                 <span class="comment">/* </span>
-<a name="l02417"></a>02417 <span class="comment">                 * Note: no need to apply chromatism correction to angle,</span>
-<a name="l02418"></a>02418 <span class="comment">                 * it is implicit in Q and U correction applied before.</span>
-<a name="l02419"></a>02419 <span class="comment">                 */</span>
-<a name="l02420"></a>02420 
-<a name="l02421"></a>02421 <span class="comment">/* Removed: </span>
-<a name="l02422"></a>02422 <span class="comment">        if (chromatism) {</span>
-<a name="l02423"></a>02423 <span class="comment">            ipang[m] -= correct[m];</span>
-<a name="l02424"></a>02424 <span class="comment">        </span>
-<a name="l02425"></a>02425 <span class="comment">            ip_q[m] = ip_q[m] * cos(2 * correct[m]) - </span>
-<a name="l02426"></a>02426 <span class="comment">                              ip_u[m] * sin(2 * correct[m]);</span>
-<a name="l02427"></a>02427 <span class="comment"></span>
-<a name="l02428"></a>02428 <span class="comment">            ip_u[m] = ip_q[m] * sin(2 * correct[m]) + </span>
-<a name="l02429"></a>02429 <span class="comment">                              ip_u[m] * cos(2 * correct[m]);</span>
-<a name="l02430"></a>02430 <span class="comment">        </span>
-<a name="l02431"></a>02431 <span class="comment">        }</span>
-<a name="l02432"></a>02432 <span class="comment">  end removed */</span>
-<a name="l02433"></a>02433         }
-<a name="l02434"></a>02434 
-<a name="l02435"></a>02435         <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02436"></a>02436         <span class="keywordtype">float</span> * weights;
-<a name="l02437"></a>02437         <span class="keywordtype">float</span>   max, sum, sum2, imean;
-<a name="l02438"></a>02438 
-<a name="l02439"></a>02439         <span class="keywordtype">int</span> k;
-<a name="l02440"></a>02440 
-<a name="l02441"></a>02441         <span class="comment">/* QC on U NULL */</span>
-<a name="l02442"></a>02442         weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);
-<a name="l02443"></a>02443 
-<a name="l02444"></a>02444         max = 0.0;
-<a name="l02445"></a>02445         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02446"></a>02446             <span class="keywordflow">if</span> (max < iffq[k]) max = iffq[k];
-<a name="l02447"></a>02447         }
-<a name="l02448"></a>02448         
-<a name="l02449"></a>02449         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02450"></a>02450             weights[k] = iffq[k] < 0.0 ? 
-<a name="l02451"></a>02451             0.0 : iffq[k] * iffq[k] / (max * max);
-<a name="l02452"></a>02452         }
-<a name="l02453"></a>02453         
-<a name="l02454"></a>02454         sum  = 0.0;
-<a name="l02455"></a>02455         sum2 = 0.0;
-<a name="l02456"></a>02456         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02457"></a>02457             sum  += weights[k] * ip_qnull[k];
-<a name="l02458"></a>02458             sum2 += weights[k];
-<a name="l02459"></a>02459         }
-<a name="l02460"></a>02460 
-<a name="l02461"></a>02461         cpl_free(weights);
-<a name="l02462"></a>02462 
-<a name="l02463"></a>02463         imean = sum / sum2;
-<a name="l02464"></a>02464 
-<a name="l02465"></a>02465         mean_qnull += (imean - mean_qnull) / (j + 1.0);
-<a name="l02466"></a>02466           
-<a name="l02467"></a>02467         <span class="comment">/* QC on U NULL */</span>
-<a name="l02468"></a>02468         weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);
-<a name="l02469"></a>02469         
-<a name="l02470"></a>02470         max = 0.0;
-<a name="l02471"></a>02471         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02472"></a>02472             <span class="keywordflow">if</span> (max < iffu[k]) max = iffu[k];
-<a name="l02473"></a>02473         }
-<a name="l02474"></a>02474         
-<a name="l02475"></a>02475         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02476"></a>02476             weights[k] = iffu[k] < 0.0 ? 
-<a name="l02477"></a>02477             0.0 : iffu[k] * iffu[k] / (max * max);
-<a name="l02478"></a>02478         }
-<a name="l02479"></a>02479         
-<a name="l02480"></a>02480         sum  = 0.0;
-<a name="l02481"></a>02481         sum2 = 0.0;
-<a name="l02482"></a>02482         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02483"></a>02483             sum  += weights[k] * ip_unull[k];
-<a name="l02484"></a>02484             sum2 += weights[k];
-<a name="l02485"></a>02485         }
-<a name="l02486"></a>02486 
-<a name="l02487"></a>02487         cpl_free(weights);
-<a name="l02488"></a>02488 
-<a name="l02489"></a>02489         imean = sum / sum2;
-<a name="l02490"></a>02490 
-<a name="l02491"></a>02491         mean_unull += (imean - mean_unull) / (j + 1.0);
-<a name="l02492"></a>02492         }
-<a name="l02493"></a>02493     }
-<a name="l02494"></a>02494 
-<a name="l02495"></a>02495     cpl_image_delete(correct_im);
-<a name="l02496"></a>02496 
-<a name="l02497"></a>02497     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pq_im, reduced_q_tag, header, 
-<a name="l02498"></a>02498                parlist, recipe, version))
-<a name="l02499"></a>02499         fors_pmos_extract_exit(NULL);
-<a name="l02500"></a>02500 
-<a name="l02501"></a>02501     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pu_im, reduced_u_tag, header, 
-<a name="l02502"></a>02502                parlist, recipe, version))
-<a name="l02503"></a>02503         fors_pmos_extract_exit(NULL);
-<a name="l02504"></a>02504 
-<a name="l02505"></a>02505     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pl_im, reduced_l_tag, header, 
-<a name="l02506"></a>02506                parlist, recipe, version))
-<a name="l02507"></a>02507         fors_pmos_extract_exit(NULL);
-<a name="l02508"></a>02508 
-<a name="l02509"></a>02509     <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02510"></a>02510         <span class="keywordtype">char</span> *pipefile; 
-<a name="l02511"></a>02511             <span class="keywordtype">char</span> *keyname;
-<a name="l02512"></a>02512         cpl_propertylist *qheader = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, 
-<a name="l02513"></a>02513                                                         science_tag, 0);
-<a name="l02514"></a>02514 
-<a name="l02515"></a>02515             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l02516"></a>02516             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02517"></a>02517             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l02518"></a>02518                                startwavelength + dispersion/2);
-<a name="l02519"></a>02519             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02520"></a>02520             <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l02521"></a>02521 <span class="comment">               cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l02522"></a>02522             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l02523"></a>02523             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02524"></a>02524             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02525"></a>02525             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02526"></a>02526             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02527"></a>02527             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02528"></a>02528 
-<a name="l02529"></a>02529         <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);
-<a name="l02530"></a>02530 
-<a name="l02531"></a>02531         <span class="comment">/*</span>
-<a name="l02532"></a>02532 <span class="comment">         * QC1 group header</span>
-<a name="l02533"></a>02533 <span class="comment">         */</span>
-<a name="l02534"></a>02534 
-<a name="l02535"></a>02535         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_q_tag,
-<a name="l02536"></a>02536                      <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l02537"></a>02537         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write product category to "</span>
-<a name="l02538"></a>02538                      <span class="stringliteral">"QC log file"</span>);
-<a name="l02539"></a>02539 
-<a name="l02540"></a>02540         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l02541"></a>02541                        <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l02542"></a>02542         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DPR TYPE in arc "</span>
-<a name="l02543"></a>02543                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02544"></a>02544 
-<a name="l02545"></a>02545         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l02546"></a>02546                        <span class="stringliteral">"Template"</span>, instrume))
-<a name="l02547"></a>02547         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword TPL ID in arc "</span>
-<a name="l02548"></a>02548                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02549"></a>02549 
-<a name="l02550"></a>02550         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,
-<a name="l02551"></a>02551                        <span class="stringliteral">"Grism name"</span>, instrume))
-<a name="l02552"></a>02552         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in arc "</span>
-<a name="l02553"></a>02553                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02554"></a>02554 
-<a name="l02555"></a>02555         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,
-<a name="l02556"></a>02556                        <span class="stringliteral">"Grism identifier"</span>, instrume))
-<a name="l02557"></a>02557         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in arc "</span>
-<a name="l02558"></a>02558                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02559"></a>02559 
-<a name="l02560"></a>02560         <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))
-<a name="l02561"></a>02561         <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,
-<a name="l02562"></a>02562                        <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l02563"></a>02563 
-<a name="l02564"></a>02564         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,
-<a name="l02565"></a>02565                        <span class="stringliteral">"Collimator name"</span>, instrume))
-<a name="l02566"></a>02566         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in arc "</span>
-<a name="l02567"></a>02567                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02568"></a>02568 
-<a name="l02569"></a>02569         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l02570"></a>02570                        <span class="stringliteral">"Chip identifier"</span>, instrume))
-<a name="l02571"></a>02571         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in arc "</span>
-<a name="l02572"></a>02572                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02573"></a>02573 
-<a name="l02574"></a>02574         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l02575"></a>02575                        <span class="stringliteral">"Archive name of input data"</span>, 
-<a name="l02576"></a>02576                        instrume))
-<a name="l02577"></a>02577         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ARCFILE in arc "</span>
-<a name="l02578"></a>02578                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02579"></a>02579 
-<a name="l02580"></a>02580         pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(reduced_nul_q_tag);
-<a name="l02581"></a>02581         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l02582"></a>02582                      <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l02583"></a>02583         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);
-<a name="l02584"></a>02584         cpl_free(pipefile); pipefile = NULL;
-<a name="l02585"></a>02585 
-<a name="l02586"></a>02586 
-<a name="l02587"></a>02587         <span class="comment">/*</span>
-<a name="l02588"></a>02588 <span class="comment">         * QC1 parameters</span>
-<a name="l02589"></a>02589 <span class="comment">         */</span>
-<a name="l02590"></a>02590 
-<a name="l02591"></a>02591         keyname = <span class="stringliteral">"QC.NULL.Q.MEAN"</span>;
-<a name="l02592"></a>02592             
-<a name="l02593"></a>02593         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qheader, mean_qnull,
-<a name="l02594"></a>02594                     keyname, NULL,
-<a name="l02595"></a>02595                     <span class="stringliteral">"Mean Q null parameter"</span>,
-<a name="l02596"></a>02596                     instrume)) {
-<a name="l02597"></a>02597         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write mean Q null parameter "</span>
-<a name="l02598"></a>02598                      <span class="stringliteral">"to QC log file"</span>);
-<a name="l02599"></a>02599         }
-<a name="l02600"></a>02600 
-<a name="l02601"></a>02601         <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l02602"></a>02602 
-<a name="l02603"></a>02603         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pqnull_im, reduced_nul_q_tag, qheader, 
-<a name="l02604"></a>02604                    parlist, recipe, version))
-<a name="l02605"></a>02605         fors_pmos_extract_exit(NULL);
-<a name="l02606"></a>02606 
-<a name="l02607"></a>02607         cpl_propertylist_delete(qheader);
-<a name="l02608"></a>02608 
-<a name="l02609"></a>02609         qheader = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l02610"></a>02610 
-<a name="l02611"></a>02611             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l02612"></a>02612             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02613"></a>02613             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l02614"></a>02614                                startwavelength + dispersion/2);
-<a name="l02615"></a>02615             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02616"></a>02616             <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l02617"></a>02617 <span class="comment">               cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l02618"></a>02618             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l02619"></a>02619             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02620"></a>02620             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02621"></a>02621             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02622"></a>02622             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02623"></a>02623             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02624"></a>02624 
-<a name="l02625"></a>02625         <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);
-<a name="l02626"></a>02626 
-<a name="l02627"></a>02627         <span class="comment">/*</span>
-<a name="l02628"></a>02628 <span class="comment">         * QC1 group header</span>
-<a name="l02629"></a>02629 <span class="comment">         */</span>
-<a name="l02630"></a>02630 
-<a name="l02631"></a>02631         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_u_tag,
-<a name="l02632"></a>02632                      <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l02633"></a>02633         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write product category to "</span>
-<a name="l02634"></a>02634                      <span class="stringliteral">"QC log file"</span>);
-<a name="l02635"></a>02635 
-<a name="l02636"></a>02636         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l02637"></a>02637                        <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l02638"></a>02638         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DPR TYPE in arc "</span>
-<a name="l02639"></a>02639                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02640"></a>02640 
-<a name="l02641"></a>02641         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l02642"></a>02642                        <span class="stringliteral">"Template"</span>, instrume))
-<a name="l02643"></a>02643         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword TPL ID in arc "</span>
-<a name="l02644"></a>02644                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02645"></a>02645 
-<a name="l02646"></a>02646         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,
-<a name="l02647"></a>02647                        <span class="stringliteral">"Grism name"</span>, instrume))
-<a name="l02648"></a>02648         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in arc "</span>
-<a name="l02649"></a>02649                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02650"></a>02650 
-<a name="l02651"></a>02651         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,
-<a name="l02652"></a>02652                        <span class="stringliteral">"Grism identifier"</span>, instrume))
-<a name="l02653"></a>02653         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in arc "</span>
-<a name="l02654"></a>02654                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02655"></a>02655 
-<a name="l02656"></a>02656         <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))
-<a name="l02657"></a>02657         <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,
-<a name="l02658"></a>02658                        <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l02659"></a>02659 
-<a name="l02660"></a>02660         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,
-<a name="l02661"></a>02661                        <span class="stringliteral">"Collimator name"</span>, instrume))
-<a name="l02662"></a>02662         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in arc "</span>
-<a name="l02663"></a>02663                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02664"></a>02664 
-<a name="l02665"></a>02665         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l02666"></a>02666                        <span class="stringliteral">"Chip identifier"</span>, instrume))
-<a name="l02667"></a>02667         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in arc "</span>
-<a name="l02668"></a>02668                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02669"></a>02669 
-<a name="l02670"></a>02670         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l02671"></a>02671                        <span class="stringliteral">"Archive name of input data"</span>, 
-<a name="l02672"></a>02672                        instrume))
-<a name="l02673"></a>02673         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ARCFILE in arc "</span>
-<a name="l02674"></a>02674                      <span class="stringliteral">"lamp header"</span>);
-<a name="l02675"></a>02675 
-<a name="l02676"></a>02676         pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(reduced_nul_u_tag);
-<a name="l02677"></a>02677         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l02678"></a>02678                      <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l02679"></a>02679         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);
-<a name="l02680"></a>02680         cpl_free(pipefile); pipefile = NULL;
-<a name="l02681"></a>02681 
-<a name="l02682"></a>02682 
-<a name="l02683"></a>02683         <span class="comment">/*</span>
-<a name="l02684"></a>02684 <span class="comment">         * QC1 parameters</span>
-<a name="l02685"></a>02685 <span class="comment">         */</span>
-<a name="l02686"></a>02686 
-<a name="l02687"></a>02687         keyname = <span class="stringliteral">"QC.NULL.U.MEAN"</span>;
-<a name="l02688"></a>02688             
-<a name="l02689"></a>02689         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qheader, mean_unull,
-<a name="l02690"></a>02690                     keyname, NULL,
-<a name="l02691"></a>02691                     <span class="stringliteral">"Mean U null parameter"</span>,
-<a name="l02692"></a>02692                     instrume)) {
-<a name="l02693"></a>02693         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write mean U null parameter "</span>
-<a name="l02694"></a>02694                      <span class="stringliteral">"to QC log file"</span>);
-<a name="l02695"></a>02695         }
-<a name="l02696"></a>02696 
-<a name="l02697"></a>02697         <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l02698"></a>02698 
-<a name="l02699"></a>02699         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, punull_im, reduced_nul_u_tag, qheader, 
-<a name="l02700"></a>02700                    parlist, recipe, version))
-<a name="l02701"></a>02701         fors_pmos_extract_exit(NULL);
-<a name="l02702"></a>02702 
-<a name="l02703"></a>02703         cpl_propertylist_delete(qheader);
-<a name="l02704"></a>02704     }
-<a name="l02705"></a>02705 
-<a name="l02706"></a>02706     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pqerr_im, reduced_error_q_tag, header, 
-<a name="l02707"></a>02707                parlist, recipe, version))
-<a name="l02708"></a>02708         fors_pmos_extract_exit(NULL);
-<a name="l02709"></a>02709 
-<a name="l02710"></a>02710     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, puerr_im, reduced_error_u_tag, header, 
-<a name="l02711"></a>02711                parlist, recipe, version))
-<a name="l02712"></a>02712         fors_pmos_extract_exit(NULL);
-<a name="l02713"></a>02713 
-<a name="l02714"></a>02714     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, plerr_im, reduced_error_l_tag, header, 
-<a name="l02715"></a>02715                parlist, recipe, version))
-<a name="l02716"></a>02716         fors_pmos_extract_exit(NULL);
-<a name="l02717"></a>02717 
-<a name="l02718"></a>02718     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pang_im, reduced_angle_tag, header, 
-<a name="l02719"></a>02719                parlist, recipe, version))
-<a name="l02720"></a>02720         fors_pmos_extract_exit(NULL);
-<a name="l02721"></a>02721 
-<a name="l02722"></a>02722     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pangerr_im, reduced_error_angle_tag, 
-<a name="l02723"></a>02723                header, parlist, recipe, version))
-<a name="l02724"></a>02724         fors_pmos_extract_exit(NULL);
-<a name="l02725"></a>02725 
-<a name="l02726"></a>02726     cpl_image_delete(pq_im);
-<a name="l02727"></a>02727     cpl_image_delete(pu_im);
-<a name="l02728"></a>02728     cpl_image_delete(pl_im);
-<a name="l02729"></a>02729 
-<a name="l02730"></a>02730     cpl_image_delete(pqnull_im);
-<a name="l02731"></a>02731     cpl_image_delete(punull_im);
-<a name="l02732"></a>02732 
-<a name="l02733"></a>02733     cpl_image_delete(pqerr_im);
-<a name="l02734"></a>02734     cpl_image_delete(puerr_im);
-<a name="l02735"></a>02735     cpl_image_delete(plerr_im);
-<a name="l02736"></a>02736     cpl_image_delete(pang_im);
-<a name="l02737"></a>02737     cpl_image_delete(pangerr_im);
-<a name="l02738"></a>02738     }
-<a name="l02739"></a>02739 
-<a name="l02740"></a>02740     cpl_propertylist_delete(header);
-<a name="l02741"></a>02741 
-<a name="l02742"></a>02742     <span class="comment">/* End of Stokes computation */</span>
-<a name="l02743"></a>02743 
-<a name="l02744"></a>02744     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {
-<a name="l02745"></a>02745     cpl_image_delete(reduceds[j]);
-<a name="l02746"></a>02746     cpl_image_delete(rerrors[j]);
-<a name="l02747"></a>02747     cpl_table_delete(slitss[j]);
-<a name="l02748"></a>02748     cpl_image_delete(mappeds[j]);
-<a name="l02749"></a>02749     }
-<a name="l02750"></a>02750 
-<a name="l02751"></a>02751     cpl_free(reduceds);
-<a name="l02752"></a>02752     cpl_free(rerrors);
-<a name="l02753"></a>02753     cpl_free(slitss);
-<a name="l02754"></a>02754     cpl_free(mappeds);
-<a name="l02755"></a>02755 
-<a name="l02756"></a>02756     cpl_free(instrume); instrume = NULL;
-<a name="l02757"></a>02757 
-<a name="l02758"></a>02758     cpl_free(skylocalmaps);
-<a name="l02759"></a>02759     cpl_free(nobjs_per_slit);
-<a name="l02760"></a>02760 
-<a name="l02761"></a>02761     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l02762"></a>02762         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l02763"></a>02763         fors_pmos_extract_exit(NULL);
-<a name="l02764"></a>02764     }
-<a name="l02765"></a>02765     <span class="keywordflow">else</span> 
-<a name="l02766"></a>02766         <span class="keywordflow">return</span> 0;
-<a name="l02767"></a>02767 }
-<a name="l02768"></a>02768 
-<a name="l02769"></a>02769 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l02780"></a>02780 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l02781"></a>02781 <span class="keyword">static</span> <span class="keywordtype">float</span> * fors_check_angles(cpl_frameset * frameset,
-<a name="l02782"></a>02782                  <span class="keywordtype">int</span> pmos, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, <span class="keywordtype">int</span> * circ)
-<a name="l02783"></a>02783 {
-<a name="l02784"></a>02784     <span class="keywordtype">float</span>     *angles  = NULL;
-<a name="l02785"></a>02785     cpl_frame *c_frame = NULL;
-<a name="l02786"></a>02786     <span class="keywordtype">char</span>      *ret_id  = NULL;
-<a name="l02787"></a>02787 
-<a name="l02788"></a>02788     <span class="keywordtype">int</span> i = 0;
-<a name="l02789"></a>02789 
-<a name="l02790"></a>02790     angles = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * pmos);
-<a name="l02791"></a>02791 
-<a name="l02792"></a>02792     <span class="keywordflow">for</span> (c_frame  = cpl_frameset_find(frameset, tag);
-<a name="l02793"></a>02793      c_frame != NULL; c_frame = cpl_frameset_find(frameset, NULL)) {
-<a name="l02794"></a>02794 
-<a name="l02795"></a>02795         cpl_propertylist * header =
-<a name="l02796"></a>02796         cpl_propertylist_load(cpl_frame_get_filename(c_frame), 0);
-<a name="l02797"></a>02797     
-<a name="l02798"></a>02798     <span class="keywordflow">if</span> (!ret_id) {
-<a name="l02799"></a>02799         ret_id = cpl_strdup(cpl_propertylist_get_string(header, 
-<a name="l02800"></a>02800                                                         <span class="stringliteral">"ESO INS OPTI4 ID"</span>));
-<a name="l02801"></a>02801 
-<a name="l02802"></a>02802         <span class="keywordflow">if</span> (ret_id[1] != <span class="charliteral">'5'</span> && ret_id[1] != <span class="charliteral">'4'</span>) {
-<a name="l02803"></a>02803         cpl_msg_error(cpl_func, 
-<a name="l02804"></a>02804                   <span class="stringliteral">"Unknown retarder plate id: %s"</span>, ret_id);
-<a name="l02805"></a>02805         <span class="keywordflow">return</span> NULL;
-<a name="l02806"></a>02806         }
-<a name="l02807"></a>02807     } <span class="keywordflow">else</span> {
-<a name="l02808"></a>02808         <span class="keywordtype">char</span> * c_ret_id = (<span class="keywordtype">char</span> *)
-<a name="l02809"></a>02809         cpl_propertylist_get_string(header, <span class="stringliteral">"ESO INS OPTI4 ID"</span>);
-<a name="l02810"></a>02810         <span class="keywordflow">if</span> (ret_id[1] != c_ret_id[1]) {
-<a name="l02811"></a>02811         cpl_msg_error(cpl_func, <span class="stringliteral">"Input frames are not from the same "</span>
-<a name="l02812"></a>02812                   <span class="stringliteral">"retarder plate"</span>);
-<a name="l02813"></a>02813         <span class="keywordflow">return</span> NULL;
-<a name="l02814"></a>02814         }
-<a name="l02815"></a>02815     }
-<a name="l02816"></a>02816     
-<a name="l02817"></a>02817     <span class="keywordflow">if</span> (ret_id[1] == <span class="charliteral">'5'</span>) {  <span class="comment">/* Linear polarimetry */</span>
-<a name="l02818"></a>02818         angles[i] = (float)
-<a name="l02819"></a>02819         cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS RETA2 ROT"</span>);
-<a name="l02820"></a>02820         *circ = 0;
-<a name="l02821"></a>02821     } <span class="keywordflow">else</span> {                 <span class="comment">/* Circular polarimetry */</span>
-<a name="l02822"></a>02822         angles[i] = (float)
-<a name="l02823"></a>02823         cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS RETA4 ROT"</span>);
-<a name="l02824"></a>02824         *circ = 1;
-<a name="l02825"></a>02825     }
-<a name="l02826"></a>02826 
-<a name="l02827"></a>02827         cpl_propertylist_delete(header);
-<a name="l02828"></a>02828     i++;
-<a name="l02829"></a>02829     }
-<a name="l02830"></a>02830 
-<a name="l02831"></a>02831     cpl_free(ret_id);
-<a name="l02832"></a>02832 
-<a name="l02833"></a>02833     <span class="keywordflow">if</span> (*circ) {
-<a name="l02834"></a>02834     <span class="keywordflow">if</span> (pmos != 2 && pmos != 4) {
-<a name="l02835"></a>02835         cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: %d angles "</span>
-<a name="l02836"></a>02836                           <span class="stringliteral">"found, but either 2 or 4 are required for "</span>
-<a name="l02837"></a>02837                           <span class="stringliteral">"circular polarization measurements!"</span>, pmos);
-<a name="l02838"></a>02838         <span class="keywordflow">return</span> NULL;
-<a name="l02839"></a>02839     }
-<a name="l02840"></a>02840     } <span class="keywordflow">else</span> {
-<a name="l02841"></a>02841     <span class="keywordflow">if</span> (pmos != 4 && pmos != 8 && pmos != 16) {
-<a name="l02842"></a>02842         cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: %d angles "</span>
-<a name="l02843"></a>02843                           <span class="stringliteral">"found, but either 4, 8, or 16 are required for "</span>
-<a name="l02844"></a>02844                           <span class="stringliteral">"linear polarization measurements!"</span>, pmos);
-<a name="l02845"></a>02845         <span class="keywordflow">return</span> NULL;
-<a name="l02846"></a>02846     }
-<a name="l02847"></a>02847     }
-<a name="l02848"></a>02848     
-<a name="l02849"></a>02849     <span class="comment">/* Check completeness */</span>
-<a name="l02850"></a>02850 
-<a name="l02851"></a>02851     <span class="keywordflow">if</span> (*circ) {
-<a name="l02852"></a>02852         <span class="keywordflow">for</span> (i = 0; i < pmos; i++) {
-<a name="l02853"></a>02853             <span class="keywordflow">if</span> (fors_find_angle_pos(angles, pmos, 90.0 * i - 45.0) < 0) {
-<a name="l02854"></a>02854                 <span class="keyword">const</span> <span class="keywordtype">char</span> *cangles;
-<a name="l02855"></a>02855                 <span class="keywordflow">switch</span> (pmos) {
-<a name="l02856"></a>02856                 <span class="keywordflow">case</span> 2: cangles  = <span class="stringliteral">"-45.0, 45.0"</span>; <span class="keywordflow">break</span>;
-<a name="l02857"></a>02857                 <span class="keywordflow">case</span> 4: cangles  = <span class="stringliteral">"-45.0, 45.0, 135.0, 225.0"</span>; <span class="keywordflow">break</span>;
-<a name="l02858"></a>02858                 <span class="keywordflow">default</span>: assert(0);
-<a name="l02859"></a>02859                 }  
-<a name="l02860"></a>02860 
-<a name="l02861"></a>02861             cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: missing "</span>
-<a name="l02862"></a>02862                               <span class="stringliteral">"angle %.2f. All angles %s must be provided."</span>,
-<a name="l02863"></a>02863                               angles[i], cangles);
-<a name="l02864"></a>02864                 <span class="keywordflow">return</span> NULL;
-<a name="l02865"></a>02865             }
-<a name="l02866"></a>02866         }
-<a name="l02867"></a>02867     }
-<a name="l02868"></a>02868     <span class="keywordflow">else</span> {
-<a name="l02869"></a>02869         <span class="keywordflow">for</span> (i = 0; i < pmos; i++) {
-<a name="l02870"></a>02870             <span class="keywordflow">if</span> (fors_find_angle_pos(angles, pmos, 22.5 * i) < 0) {
-<a name="l02871"></a>02871                 <span class="keyword">const</span> <span class="keywordtype">char</span> *cangles;
-<a name="l02872"></a>02872                 <span class="keywordflow">switch</span> (pmos) {
-<a name="l02873"></a>02873                 <span class="keywordflow">case</span> 4: cangles  = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5"</span>; <span class="keywordflow">break</span>;
-<a name="l02874"></a>02874                 <span class="keywordflow">case</span> 8: cangles  = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5, "</span>
-<a name="l02875"></a>02875                                    <span class="stringliteral">"90.0, 112.5, 135.0, 157.5"</span>; <span class="keywordflow">break</span>;
-<a name="l02876"></a>02876                 <span class="keywordflow">case</span> 16: cangles = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5, "</span>
-<a name="l02877"></a>02877                                    <span class="stringliteral">"90.0, 112.5, 135.0, 157.5, "</span>
-<a name="l02878"></a>02878                                    <span class="stringliteral">"180.0, 202.5, 225.0, 247.5, "</span>
-<a name="l02879"></a>02879                                    <span class="stringliteral">"270.0, 292.5, 315.0, 337.5"</span>; <span class="keywordflow">break</span>;
-<a name="l02880"></a>02880                 <span class="keywordflow">default</span>: assert(0);
-<a name="l02881"></a>02881                 }  
-<a name="l02882"></a>02882 
-<a name="l02883"></a>02883             cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: missing "</span>
-<a name="l02884"></a>02884                               <span class="stringliteral">"angle %.2f. All angles %s must be provided."</span>,
-<a name="l02885"></a>02885                               angles[i], cangles);
-<a name="l02886"></a>02886                 <span class="keywordflow">return</span> NULL;
-<a name="l02887"></a>02887             }
-<a name="l02888"></a>02888         }
-<a name="l02889"></a>02889     }
-<a name="l02890"></a>02890 
-<a name="l02891"></a>02891     <span class="keywordflow">return</span> angles;
-<a name="l02892"></a>02892 }
-<a name="l02893"></a>02893 
-<a name="l02894"></a>02894 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l02902"></a>02902 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l02903"></a>02903 <span class="keyword">static</span> <span class="keywordtype">int</span>
-<a name="l02904"></a>02904 fors_find_angle_pos(<span class="keywordtype">float</span> * angles, <span class="keywordtype">int</span> nangles, <span class="keywordtype">float</span> angle)
-<a name="l02905"></a>02905 {
-<a name="l02906"></a>02906     <span class="keywordtype">int</span> i, match = 0;
-<a name="l02907"></a>02907 
-<a name="l02908"></a>02908     <span class="keywordflow">for</span> (i = 0; i < nangles; i++) {
-<a name="l02909"></a>02909     <span class="keywordflow">if</span> (fabs(angles[i]         - angle) < 1.0 || 
-<a name="l02910"></a>02910         fabs(angles[i] - 360.0 - angle) < 1.0) {
-<a name="l02911"></a>02911         match = 1;
-<a name="l02912"></a>02912         <span class="keywordflow">break</span>;
-<a name="l02913"></a>02913     }
-<a name="l02914"></a>02914     }
-<a name="l02915"></a>02915 
-<a name="l02916"></a>02916     <span class="keywordflow">return</span> match ? i : -1;
-<a name="l02917"></a>02917 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__pmos__extract_8c_source.html b/html/fors__pmos__extract_8c_source.html
new file mode 100644
index 0000000..5ca613a
--- /dev/null
+++ b/html/fors__pmos__extract_8c_source.html
@@ -0,0 +1,2915 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_pmos_extract.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_pmos_extract.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_pmos_extract.c,v 1.10 2013-10-09 15:59:38 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-09 15:59:38 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.10 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <ctype.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <assert.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_create(cpl_plugin *);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keyword">static</span> <span class="keywordtype">float</span> * fors_check_angles(cpl_frameset *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span> *);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keyword">static</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> fors_find_angle_pos(<span class="keywordtype">float</span> * angles, <span class="keywordtype">int</span> nangles, <span class="keywordtype">float</span> angle);</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_pmos_extract_description[] =</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"This recipe is used to reduce scientific spectra using the extraction\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"mask and the products created by the recipe fors_mpol_calib. The spectra\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"are bias subtracted, flat fielded (if a normalised flat field is specified)\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"and remapped eliminating the optical distortions. The wavelength calibration\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"can be optionally upgraded using a number of sky lines: if no sky lines\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"catalog of wavelengths is specified, an internal one is used instead.\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"If the alignment to the sky lines is performed, the input dispersion\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"coefficients table is upgraded and saved to disk, and a new CCD wavelengths\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"map is created.\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. A grism table (typically\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"depending on the instrument mode, and in particular on the grism used)\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"may also be specified: this table contains a default recipe parameter\n"</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"setting to control the way spectra are extracted for a specific instrument\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"mode, as it is used for automatic run of the pipeline on Paranal and in\n"</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"Garching. If this table is specified, it will modify the default recipe\n"</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"parameter setting, with the exception of those parameters which have been\n"</span> </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"explicitly modifyed on the command line. If a grism table is not specified,\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"the input recipe parameters values will always be read from the command\n"</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"line, or from an esorex configuration file if present, or from their\n"</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"generic default values (that are rarely meaningful).\n"</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"Either a scientific or a standard star exposure can be specified in input.\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"The acronym SCI on products should be read STD in case of standard stars\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"observations.\n\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="stringliteral">"  SCIENCE_PMOS                  Raw         Scientific exposure     Y\n"</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="stringliteral">"  or STANDARD_PMOS              Raw         Standard star exposure  Y\n"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="stringliteral">"  MASTER_BIAS                   Calib       Master bias             Y\n"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"  GRISM_TABLE                   Calib       Grism table             .\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"  MASTER_SKYLINECAT             Calib       Sky lines catalog       .\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="stringliteral">"  MASTER_NORM_FLAT_PMOS         Calib       Normalised flat field   .\n"</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="stringliteral">"  DISP_COEFF_PMOS               Calib       Inverse dispersion      Y\n"</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="stringliteral">"  CURV_COEFF_PMOS               Calib       Spectral curvature      Y\n"</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="stringliteral">"  SLIT_LOCATION_PMOS            Calib       Slits positions table   Y\n"</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="stringliteral">"  RETARDER_WAVEPLATE_CHROMATISM Calib       Chromatism correction   .\n"</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="stringliteral">"  REDUCED_SCI_PMOS             FITS image  Extracted scientific spectra\n"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="stringliteral">"  REDUCED_SKY_SCI_PMOS         FITS image  Extracted sky spectra\n"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="stringliteral">"  REDUCED_ERROR_SCI_PMOS       FITS image  Errors on extracted spectra\n"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"  REDUCED_SCI_X_PMOS           FITS image  X Stokes parameter (and L)\n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"  REDUCED_ERROR_X_PMOS         FITS image  Error on X Stokes parameter\n"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="stringliteral">"  REDUCED_NUL_X_PMOS           FITS image  Null parameter for X\n"</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="stringliteral">"  REDUCED_POL_ANGLE_PMOS       FITS image  Direction of linear polarization\n"</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="stringliteral">"  REDUCED_POL_ANGLE_ERROR_PMOS FITS image  Error on polarization direction\n"</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="stringliteral">"  UNMAPPED_SCI_PMOS            FITS image  Sky subtracted scientific spectra\n"</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="stringliteral">"  MAPPED_SCI_PMOS              FITS image  Rectified scientific spectra\n"</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="stringliteral">"  MAPPED_ALL_SCI_PMOS          FITS image  Rectified science spectra with sky\n"</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="stringliteral">"  MAPPED_SKY_SCI_PMOS          FITS image  Rectified sky spectra\n"</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="stringliteral">"  UNMAPPED_SKY_SCI_PMOS        FITS image  Sky on CCD\n"</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="stringliteral">"  GLOBAL_SKY_SPECTRUM_PMOS     FITS table  Global sky spectrum\n"</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="stringliteral">"  OBJECT_TABLE_SCI_PMOS        FITS table  Positions of detected objects\n"</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="stringliteral">"  OBJECT_TABLE_POL_SCI_PMOS    FITS table  Positions of real objects\n"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="stringliteral">"  Only if the sky-alignment of the wavelength solution is requested:\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="stringliteral">"  DISP_COEFF_SCI_PMOS          FITS table  Upgraded dispersion coefficients\n"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="stringliteral">"  WAVELENGTH_MAP_SCI_PMOS      FITS image  Upgraded wavelength map\n\n"</span>;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">#define fors_pmos_extract_exit(message)            \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">cpl_free(instrume);                           \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">cpl_image_delete(dummy);                      \</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">cpl_image_delete(smapped);                    \</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor">cpl_table_delete(offsets);                    \</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor">cpl_table_delete(sky);                        \</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor">cpl_image_delete(bias);                       \</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="preprocessor">#define fors_pmos_extract_exit_memcheck(message)   \</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="preprocessor">cpl_free(instrume);                           \</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="preprocessor">cpl_image_delete(dummy);                      \</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="preprocessor">cpl_image_delete(smapped);                    \</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="preprocessor">cpl_table_delete(offsets);                    \</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="preprocessor">cpl_table_delete(sky);                        \</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="preprocessor">cpl_image_delete(bias);                       \</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="preprocessor">return 0;                                     \</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> {</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                     <span class="stringliteral">"fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                     <span class="stringliteral">"Extraction of scientific spectra"</span>,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                     fors_pmos_extract_description,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                     fors_pmos_extract_create,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                     fors_pmos_extract_exec,</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                     fors_pmos_extract_destroy);</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> }</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> {</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> </div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.dispersion"</span>,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                                 <span class="stringliteral">"Resampling step (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                                 0.0);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> <span class="comment">     * Sky lines alignment</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.skyalign"</span>,</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>                                 <span class="stringliteral">"Polynomial order for sky lines alignment, "</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>                                 <span class="stringliteral">"or -1 to avoid alignment"</span>,</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>                                 0);</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.wcolumn"</span>,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                                 <span class="stringliteral">"Name of sky line catalog table column "</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.startwavelength"</span>,</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>                                 0.0);</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.endwavelength"</span>,</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>                                 0.0);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> <span class="comment">     * Flux conservation</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.flux"</span>,</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                                 <span class="stringliteral">"Apply flux conservation"</span>,</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>                                 TRUE);</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> <span class="comment">     * Apply flat field</span></div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> </div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.flatfield"</span>,</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>                                 <span class="stringliteral">"Apply flat field"</span>,</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>                                 FALSE);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flatfield"</span>);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> <span class="comment">     * Global sky subtraction</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> </div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.skyglobal"</span>,</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>                                 <span class="stringliteral">"Subtract global sky spectrum from CCD"</span>,</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>                                 FALSE);</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyglobal"</span>);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.skymedian"</span>,</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                                 <span class="stringliteral">"Sky subtraction from extracted slit spectra"</span>,</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                                 FALSE);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skymedian"</span>);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> </div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> <span class="comment">     * Local sky subtraction on CCD spectra</span></div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.skylocal"</span>,</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>                                 <span class="stringliteral">"Sky subtraction from CCD slit spectra"</span>,</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>                                 TRUE);</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skylocal"</span>);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> <span class="comment">     * Cosmic rays removal</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.cosmics"</span>,</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>                                 <span class="stringliteral">"Eliminate cosmic rays hits (only if global "</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>                                 <span class="stringliteral">"sky subtraction is also requested)"</span>,</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                                 FALSE);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="comment">     * Slit margin</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> </div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.slit_margin"</span>,</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>                                 <span class="stringliteral">"in object detection and extraction"</span>,</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                                 3);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> </div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> <span class="comment">     * Extraction radius</span></div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.ext_radius"</span>,</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>                                 <span class="stringliteral">"Maximum extraction radius for detected "</span></div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                                 <span class="stringliteral">"objects (pixel)"</span>,</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>                                 6);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> </div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> <span class="comment">     * Contamination radius</span></div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.cont_radius"</span>,</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>                                 <span class="stringliteral">"Minimum distance at which two objects "</span></div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span></div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                                 <span class="stringliteral">"each other (pixel)"</span>,</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                                 0);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> </div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> <span class="comment">     * Object extraction method</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.ext_mode"</span>,</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>                                 1);</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> </div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> <span class="comment">     * Normalise output by exposure time</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.time_normalise"</span>,</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>                                 <span class="stringliteral">"Normalise output spectra by the exposure time"</span>,</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>                                 TRUE);</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"time_normalise"</span>);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> </div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> <span class="comment">     * Apply chromatism correction to polarization angle</span></div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> </div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.chromatism"</span>,</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>                                 <span class="stringliteral">"Chromatism correction to polarization angles"</span>,</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>                                 TRUE);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"chromatism"</span>);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> <span class="comment">     * Create check products</span></div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span> </div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_extract.check"</span>,</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>                                 <span class="stringliteral">"Create intermediate products"</span>,</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>                                 <span class="stringliteral">"fors.fors_pmos_extract"</span>,</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>                                 FALSE);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"check"</span>);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> </div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span> }</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span> </div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span> </div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> {</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     </div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     <span class="keywordflow">return</span> fors_pmos_extract(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> }</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> </div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span> </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> {</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     </div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> </div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> }</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> </div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> </div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_extract(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span> {</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> </div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_pmos_extract"</span>;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> </div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordtype">int</span>         skyalign;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     <span class="keywordtype">int</span>         flux;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     <span class="keywordtype">int</span>         flatfield;</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="keywordtype">int</span>         skyglobal;</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     <span class="keywordtype">int</span>         skylocal;</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     <span class="keywordtype">int</span>         skymedian;</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     <span class="keywordtype">int</span>         chromatism;</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     <span class="keywordtype">int</span>         cosmics;</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     <span class="keywordtype">int</span>         slit_margin;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     <span class="keywordtype">int</span>         ext_radius;</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     <span class="keywordtype">int</span>         cont_radius;</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     <span class="keywordtype">int</span>         ext_mode;</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     <span class="keywordtype">int</span>         time_normalise;</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>     <span class="keywordtype">int</span>         check;</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> </div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span> </div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     cpl_image       **images;</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span> </div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     cpl_image       **reduceds       = NULL;</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     cpl_image       **rerrors        = NULL;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     cpl_table       **slitss         = NULL;</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     cpl_image       **mappeds        = NULL;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     cpl_image       **skylocalmaps   = NULL;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     </div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     <span class="keywordtype">int</span> nobjects = 0;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> </div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     cpl_image        *bias           = NULL;</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     cpl_image        *norm_flat      = NULL;</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     cpl_image        *spectra        = NULL;</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     cpl_image        *rectified      = NULL;</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     cpl_image        *coordinate     = NULL;</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     cpl_image        *rainbow        = NULL;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     cpl_image        *mapped         = NULL;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     cpl_image        *mapped_sky     = NULL;</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     cpl_image        *mapped_cleaned = NULL;</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     cpl_image        *smapped        = NULL;</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     cpl_image        *wavemap        = NULL;</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     cpl_image        *skymap         = NULL;</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     cpl_image        *skylocalmap    = NULL;</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     cpl_image        *dummy          = NULL;</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     cpl_table        *grism_table    = NULL;</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     cpl_table        *overscans      = NULL;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     cpl_table        *wavelengths    = NULL;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     cpl_table        *idscoeff       = NULL;</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     cpl_table        *slits          = NULL;</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     cpl_table        *origslits     = NULL;</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     cpl_table        *maskslits      = NULL;</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     cpl_table        *polytraces     = NULL;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     cpl_table        *offsets        = NULL;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     cpl_table        *sky            = NULL;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     cpl_vector       *lines          = NULL;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span> </div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     cpl_propertylist *header         = NULL;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     cpl_propertylist *save_header    = NULL;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span> </div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     cpl_table        *global         = NULL;</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> </div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     <span class="keywordtype">char</span>    version[80];</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     <span class="keywordtype">char</span>   *instrume = NULL;</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *science_tag;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_norm_flat_tag;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_coeff_sky_tag;</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *wavelength_map_sky_tag;</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_science_tag;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_sky_tag;</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_tag;</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_science_tag;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *unmapped_science_tag;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_science_sky_tag;</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_sky_tag;</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *unmapped_sky_tag;</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *global_sky_spectrum_tag;</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *object_table_tag;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *object_table_pol_tag;</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *skylines_offsets_tag;</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_q_tag;</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_u_tag;</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_v_tag;</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_l_tag;</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_q_tag;</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_u_tag;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_v_tag;</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_l_tag;</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_q_tag;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_u_tag;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_v_tag;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_angle_tag;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_angle_tag;</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_distortion_tag = <span class="stringliteral">"MASTER_DISTORTION_TABLE"</span>;</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *chrom_table_tag = <span class="stringliteral">"RETARDER_WAVEPLATE_CHROMATISM"</span>;</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>     <span class="keywordtype">float</span> *angles = NULL;</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>     <span class="keywordtype">int</span>     pmos, circ;</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     <span class="keywordtype">int</span>     nscience;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>     <span class="keywordtype">double</span>  alltime;</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     <span class="keywordtype">double</span>  mean_rms;</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>     <span class="keywordtype">int</span>     nlines;</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>     <span class="keywordtype">int</span>     rebin;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     <span class="keywordtype">double</span> *line;</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keywordtype">int</span>     nx = 0, ny;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     <span class="keywordtype">int</span>     ccd_xsize;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     <span class="keywordtype">double</span>  reference;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="keywordtype">double</span>  gain;</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>     <span class="keywordtype">double</span>  ron;</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     <span class="keywordtype">int</span>     standard;</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     <span class="keywordtype">int</span>     highres;</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     <span class="keywordtype">int</span>     i, j;</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     cpl_error_code error;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> </div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     <span class="keywordtype">int</span> * nobjs_per_slit;</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>     <span class="keywordtype">int</span>   nslits_out_det = 0;</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span> </div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> </div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span> </div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> </div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span> </div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> </div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>         fors_pmos_extract_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> </div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>                     <span class="stringliteral">"fors.fors_pmos_extract.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> </div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>         fors_pmos_extract_exit(<span class="stringliteral">"Invalid resampling step"</span>);</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> </div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     skyalign = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>                     <span class="stringliteral">"fors.fors_pmos_extract.skyalign"</span>, NULL);</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span> </div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     <span class="keywordflow">if</span> (skyalign > 2)</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>         fors_pmos_extract_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> </div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>                     <span class="stringliteral">"fors.fors_pmos_extract.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span> </div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>                     <span class="stringliteral">"fors.fors_pmos_extract.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>         fors_pmos_extract_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> </div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>                     <span class="stringliteral">"fors.fors_pmos_extract.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>         fors_pmos_extract_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span> </div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>         fors_pmos_extract_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span> </div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     flux = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.flux"</span>, NULL);</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span> </div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     flatfield = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.flatfield"</span>, </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>                                        NULL);</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span> </div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     skyglobal = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.skyglobal"</span>, </div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>                                        NULL);</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     skylocal  = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.skylocal"</span>, </div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>                                        NULL);</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     skymedian = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.skymedian"</span>, </div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>                                        NULL);</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> <span class="comment">/* NSS</span></div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span> <span class="comment">    skymedian = dfs_get_parameter_int(parlist, "fors.fors_pmos_extract.skymedian", </span></div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span> <span class="comment">                                       NULL);</span></div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     </div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     chromatism = </div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>     <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.chromatism"</span>, </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>                    NULL);</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span> </div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     <span class="keywordflow">if</span> (skylocal && skyglobal)</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot apply both local and global sky subtraction"</span>);</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span> </div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     <span class="keywordflow">if</span> (skylocal && skymedian)</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot apply sky subtraction both on extracted "</span></div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>                           <span class="stringliteral">"and non-extracted spectra"</span>);</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span> </div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     cosmics = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>                                      <span class="stringliteral">"fors.fors_pmos_extract.cosmics"</span>, NULL);</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span> </div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>     <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>         <span class="keywordflow">if</span> (!(skyglobal || skylocal))</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>             fors_pmos_extract_exit(<span class="stringliteral">"Cosmic rays correction requires "</span></div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>                               <span class="stringliteral">"either skylocal=true or skyglobal=true"</span>);</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span> </div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>     slit_margin = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>                                         <span class="stringliteral">"fors.fors_pmos_extract.slit_margin"</span>,</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>                                         NULL);</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>     <span class="keywordflow">if</span> (slit_margin < 0)</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>         fors_pmos_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span> </div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     ext_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.ext_radius"</span>,</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>                                        NULL);</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     <span class="keywordflow">if</span> (ext_radius < 0)</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>         fors_pmos_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span> </div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     cont_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>                                         <span class="stringliteral">"fors.fors_pmos_extract.cont_radius"</span>,</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>                                         NULL);</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>     <span class="keywordflow">if</span> (cont_radius < 0)</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>         fors_pmos_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> </div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>     ext_mode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.ext_mode"</span>,</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>                                        NULL);</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>         fors_pmos_extract_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> </div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>     time_normalise = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>                              <span class="stringliteral">"fors.fors_pmos_extract.time_normalise"</span>, NULL);</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> </div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     check = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_extract.check"</span>, NULL);</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> </div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>         fors_pmos_extract_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> </div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     </div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span> <span class="comment">     * Check input set-of-frames</span></div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span> </div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span> </div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         fors_pmos_extract_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span> </div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>         fors_pmos_extract_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span> </div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>         fors_pmos_extract_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span> </div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     standard = 0;</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>     pmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_PMOS"</span>);</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span> </div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>     <span class="keywordflow">if</span> (pmos == 0) {</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>         pmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_PMOS"</span>);</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>         standard = 1;</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>     }</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span> </div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>     <span class="keywordflow">if</span> (pmos == 0)</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing input scientific frame"</span>);</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span> </div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>     angles = fors_check_angles(frameset, pmos, </div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>                                 standard ? <span class="stringliteral">"STANDARD_PMOS"</span> : <span class="stringliteral">"SCIENCE_PMOS"</span>, </div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>                                 &circ);</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>     <span class="keywordflow">if</span> (angles == NULL)</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>         fors_pmos_extract_exit(<span class="stringliteral">"Polarization angles could not be read"</span>);</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span> </div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>     <span class="keywordflow">if</span> (circ)</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>         chromatism = 0; <span class="comment">/* Chromatism correction unrequired for </span></div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span> <span class="comment">                           circular polarimetry */</span></div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span> </div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span> </div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>     nscience = pmos;</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span> </div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>     reduceds = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>     rerrors  = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     slitss   = (cpl_table **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_table *) * nscience);</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     mappeds  = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>     skylocalmaps = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span> </div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     <span class="keywordflow">if</span> (pmos) {</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>         cpl_msg_info(recipe, <span class="stringliteral">"PMOS data found"</span>);</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>             science_tag             = <span class="stringliteral">"STANDARD_PMOS"</span>;</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>             reduced_science_tag     = <span class="stringliteral">"REDUCED_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>             object_table_pol_tag    = <span class="stringliteral">"OBJECT_TABLE_POL_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>             reduced_q_tag           = <span class="stringliteral">"REDUCED_Q_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>             reduced_u_tag           = <span class="stringliteral">"REDUCED_U_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>             reduced_v_tag           = <span class="stringliteral">"REDUCED_V_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>             reduced_l_tag           = <span class="stringliteral">"REDUCED_L_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>             reduced_error_q_tag     = <span class="stringliteral">"REDUCED_ERROR_Q_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>             reduced_error_u_tag     = <span class="stringliteral">"REDUCED_ERROR_U_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>             reduced_error_v_tag     = <span class="stringliteral">"REDUCED_ERROR_V_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>             reduced_error_l_tag     = <span class="stringliteral">"REDUCED_ERROR_L_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>             reduced_nul_q_tag       = <span class="stringliteral">"REDUCED_NUL_Q_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>             reduced_nul_u_tag       = <span class="stringliteral">"REDUCED_NUL_U_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>             reduced_nul_v_tag       = <span class="stringliteral">"REDUCED_NUL_V_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>             reduced_angle_tag       = <span class="stringliteral">"REDUCED_ANGLE_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>             reduced_error_angle_tag = <span class="stringliteral">"REDUCED_ERROR_ANGLE_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>         }</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>             science_tag             = <span class="stringliteral">"SCIENCE_PMOS"</span>;</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>             reduced_science_tag     = <span class="stringliteral">"REDUCED_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>             object_table_pol_tag    = <span class="stringliteral">"OBJECT_TABLE_POL_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>             reduced_q_tag           = <span class="stringliteral">"REDUCED_Q_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>             reduced_u_tag           = <span class="stringliteral">"REDUCED_U_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>             reduced_v_tag           = <span class="stringliteral">"REDUCED_V_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>             reduced_l_tag           = <span class="stringliteral">"REDUCED_L_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>             reduced_error_q_tag     = <span class="stringliteral">"REDUCED_ERROR_Q_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>             reduced_error_u_tag     = <span class="stringliteral">"REDUCED_ERROR_U_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>             reduced_error_v_tag     = <span class="stringliteral">"REDUCED_ERROR_V_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>             reduced_error_l_tag     = <span class="stringliteral">"REDUCED_ERROR_L_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>             reduced_nul_q_tag       = <span class="stringliteral">"REDUCED_NUL_Q_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>             reduced_nul_u_tag       = <span class="stringliteral">"REDUCED_NUL_U_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>             reduced_nul_v_tag       = <span class="stringliteral">"REDUCED_NUL_V_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>             reduced_angle_tag       = <span class="stringliteral">"REDUCED_ANGLE_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>             reduced_error_angle_tag = <span class="stringliteral">"REDUCED_ERROR_ANGLE_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>         }</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span> </div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_PMOS"</span>;</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_PMOS"</span>;</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span> </div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>             master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_PMOS"</span>;</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>         }</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>     }</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span> </div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0)</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span> </div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>         fors_pmos_extract_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span> </div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>     <span class="keywordflow">if</span> (skyalign >= 0)</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>             fors_pmos_extract_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span> </div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>     <span class="keywordflow">if</span> (chromatism) {</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, chrom_table_tag) == 0) {</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>,</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>               chrom_table_tag);</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>     }</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span> </div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, chrom_table_tag) > 1) {</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, chrom_table_tag);</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>     }</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>     }</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span> </div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) > 1) {</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, </div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>                           master_norm_flat_tag);</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>         }</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input are ignored, "</span></div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>                             <span class="stringliteral">"since flat field correction was not requested"</span>, </div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>                             master_norm_flat_tag);</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>         }</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>     }</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span> </div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 1) {</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>         <span class="keywordflow">if</span> (!flatfield) {</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input is ignored, "</span></div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>                             <span class="stringliteral">"since flat field correction was not requested"</span>, </div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>                             master_norm_flat_tag);</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>         }</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>     }</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span> </div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 0) {</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>             cpl_msg_error(recipe, <span class="stringliteral">"Flat field correction was requested, "</span></div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>                           <span class="stringliteral">"but no %s are found in input"</span>,</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>                           master_norm_flat_tag);</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>         }</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>     }</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span> </div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_distortion_tag) == 0)</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing required input: MASTER_DISTORTION_TABLE"</span>);</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>     </div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_distortion_tag) > 1)</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>     fors_pmos_extract_exit(<span class="stringliteral">"Too many in input: MASTER_DISTORTION_TABLE"</span>);</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>     </div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>     global = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, master_distortion_tag, 1);</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>     <span class="keywordflow">if</span> (global == NULL)</div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>     fors_pmos_extract_exit(<span class="stringliteral">"Cannot load master distortion table"</span>);</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>     </div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span> </div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span> <span class="comment">     * dispersion direction from a scientific exposure</span></div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span> </div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span> </div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span> </div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INSTRUME in scientific header"</span>);</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>     instrume = cpl_strdup(instrume);</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span> </div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span> </div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span> </div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in scientific "</span></div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span> </div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>         reference *= 10;</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span> </div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in scientific frame header"</span>,</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>                       reference);</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>     }</div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span> </div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span> </div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span> </div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in scientific "</span></div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span> </div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>                         <span class="stringliteral">"resampling step used is %f A/pixel"</span>, rebin, </div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>                         dispersion);</div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>     }</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span> </div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span> </div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in scientific "</span></div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span> </div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span> </div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);</div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span> </div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in scientific "</span></div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span> </div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span></div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span> </div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);</div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span> </div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load normalised flat field (if present)..."</span>);</div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span> </div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>     <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>     norm_flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, master_norm_flat_tag, </div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>                    CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>     }</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span> </div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>     cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);</div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span> </div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>     maskslits = <a class="code" href="group__moses.html#ga78aebb1592ccefba83f9b7cbb80a9676" title="Create PMOS slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_pmos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span> </div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span> </div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input sky line catalog..."</span>);</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span> </div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>     wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span> </div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>     <span class="keywordflow">if</span> (wavelengths) {</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span> <span class="comment">         * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span> </div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>         nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span> </div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>         <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>         fors_pmos_extract_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span> </div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>         <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span></div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>                   <span class="stringliteral">"catalog table"</span>, wcolumn);</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>         }</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span> </div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>         line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>     </div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>         <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span> </div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>         cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span> </div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>         lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>     }</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>         cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>     }</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>     }</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span> </div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span> </div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span> </div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span> <span class="comment">     * Load the wavelength calibration table</span></div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span> </div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>     <span class="keywordtype">int</span> k;</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span> </div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>     cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific exposure of angle %.2f "</span></div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>              <span class="stringliteral">"(%d out of %d) ..."</span>,</div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>              angles[j], j + 1, nscience);</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span> </div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load scientific exposure..."</span>);</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span> </div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span> <span class="comment">     * FIXME: Horrible workaround to avoid the problem because of the</span></div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span> <span class="comment">     * multiple encapsulation of cpl_frameset_find() in different </span></div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span> <span class="comment">     * loading functions</span></div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span> </div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span> </div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>     <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>         cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>     }</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span> </div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>     spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span> </div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>     <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>         cpl_image_delete(spectra);</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>         spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>     }</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span> </div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>         </div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span> </div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>     alltime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span> </div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>                    <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span> </div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>     <span class="comment">/* Leave the header on for the next step... */</span></div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>     <span class="comment">//cpl_propertylist_delete(header); header = NULL;</span></div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span> </div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>     cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>              alltime);</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span> </div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span> </div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span> <span class="comment">     * Remove the master bias</span></div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span> </div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);</div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span> </div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>     bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span> </div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>     <span class="keywordflow">if</span> (bias == NULL)</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot load master bias"</span>);</div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span> </div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>     overscans = <a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(header, 1);</div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span> </div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>     dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(spectra, bias, overscans);</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>     cpl_image_delete(spectra); spectra = dummy; dummy = NULL;</div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>     cpl_image_delete(bias); bias = NULL;</div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>     cpl_table_delete(overscans); overscans = NULL;</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span> </div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot remove bias from scientific frame"</span>);</div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span> </div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>     ccd_xsize = nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span> </div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>     <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span> </div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>         <span class="keywordflow">if</span> (norm_flat) {</div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>         cpl_msg_info(recipe, <span class="stringliteral">"Apply flat field correction..."</span>);</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>         <span class="keywordflow">if</span> (cpl_image_divide(spectra, norm_flat) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>             cpl_msg_error(recipe, <span class="stringliteral">"Failure of flat field correction: %s"</span>,</div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>                   cpl_error_get_message());</div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>         }</div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>         }</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load input %s for flat field "</span></div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>                   <span class="stringliteral">"correction"</span>, master_norm_flat_tag);</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>         }</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span> </div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>     }</div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span> </div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span> <span class="comment">     * Load the slit location table</span></div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span> </div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>     slits = <a class="code" href="group__moses.html#gad9b2789388ba6564011d832d276b2ae6" title="Build the slit location table from a global distortions table.">mos_build_slit_location</a>(global, maskslits, ny);</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span> </div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>     <span class="keywordflow">if</span> (slits == NULL) {</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>         cpl_table_new_column(slits, <span class="stringliteral">"pair_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span> </div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>         <span class="keywordtype">int</span> m, null, size = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span> </div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>         <span class="keywordflow">for</span> (m = 0; m < size; m++) {</div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>         <span class="keywordtype">int</span> slit_id = cpl_table_get(slits, <span class="stringliteral">"slit_id"</span>, m, &null);</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span> </div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>         <span class="keywordtype">int</span> pair_id = slit_id % 2 ? slit_id + 1 : slit_id;</div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span> </div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>         cpl_table_set(slits, <span class="stringliteral">"pair_id"</span>, m, pair_id);</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>         }</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>     }</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>     </div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>     cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific spectra..."</span>);</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span> </div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span> <span class="comment">     * Load the spectral curvature table</span></div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span> </div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>     polytraces = <a class="code" href="group__moses.html#gacff89218baba1abf3641c083a1125861" title="Build the curvature coefficients table from a global distortions table.">mos_build_curv_coeff</a>(global, maskslits, slits);</div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>     <span class="keywordflow">if</span> (polytraces == NULL)</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot create spectral curvature table"</span>);</div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>  </div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span> <span class="comment">     * This one will also generate the spatial map from the spectral </span></div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span> <span class="comment">     * curvature table (in the case of multislit data)</span></div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span> </div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span> </div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>     smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>                       startwavelength, endwavelength,</div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>                       dispersion, flux, coordinate);</div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span> </div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span> <span class="comment">     * Generate a rectified wavelength map from the wavelength calibration </span></div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span> <span class="comment">     * table</span></div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span> </div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span> <span class="comment">     * Load the wavelength calibration table</span></div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>  </div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>     idscoeff = <a class="code" href="group__moses.html#ga4e4da9890ad8d0229f187b4d7eda17be" title="Build the IDS coefficients table from a global distortions table.">mos_build_disp_coeff</a>(global, slits);</div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>     <span class="keywordflow">if</span> (idscoeff == NULL)</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot create wavelength calibration table"</span>);</div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span> </div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>     rainbow = <a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength, </div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>                    endwavelength);</div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span> </div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>     <span class="keywordflow">if</span> (dispersion > 1.0)</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>         highres = 0;</div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>         highres = 1;</div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span> </div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>         <span class="keywordflow">if</span> (skyalign) {</div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>                  <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>         }</div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>         cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>                  <span class="stringliteral">"skylines applying median offset..."</span>);</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>         }</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span> </div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>         offsets = <a class="code" href="group__moses.html#ga634eb7408671a139e7015185776f4513" title="Modify the input wavelength solution to match reference sky lines.">mos_wavelength_align</a>(smapped, slits, reference, </div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>                            startwavelength, endwavelength, </div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>                            idscoeff, lines, highres, </div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>                            skyalign, rainbow, 4);</div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span> </div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>         <span class="keywordflow">if</span> (offsets) {</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>             <span class="keywordflow">if</span> (standard)</div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span></div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>                     <span class="stringliteral">"to reference sky lines may be unreliable in "</span></div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>                     <span class="stringliteral">"this case!"</span>);</div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span> </div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, offsets, skylines_offsets_tag,</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>                        NULL, parlist, recipe, version)) {</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>             }</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span> </div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span></div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>                     <span class="stringliteral">"to reference sky lines could not be done!"</span>);</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>             skyalign = -1;</div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>         }</div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>         }</div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span> </div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span> </div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>     }</div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span> </div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>     wavemap = <a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(coordinate, rainbow, slits, </div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>                       polytraces, reference, </div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>                       startwavelength, endwavelength,</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>                       dispersion);</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span> </div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span> </div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>     cpl_image_delete(rainbow); rainbow = NULL;</div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>     cpl_image_delete(coordinate); coordinate = NULL;</div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span> </div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span> <span class="comment">     * Here the wavelength calibrated slit spectra are created. This frame</span></div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span> <span class="comment">     * contains sky_science.</span></div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span> </div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>     mapped_sky = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, reference,</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>                         startwavelength, endwavelength,</div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>                         dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span> </div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>     <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>         cpl_msg_info(recipe, <span class="stringliteral">"Check applied wavelength against skylines..."</span>);</div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span> </div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>         mean_rms = <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(mapped_sky, lines, startwavelength,</div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>                        dispersion, 6, highres);</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span> </div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span> </div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>         cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f"</span>, mean_rms);</div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span> </div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>         mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span> </div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>         cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>              mean_rms, mean_rms * dispersion);</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>     }</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span> </div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>     save_header = cpl_propertylist_duplicate(header);</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span> </div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>                        startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span> <span class="comment">       cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span> </div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>     <span class="keywordflow">if</span> (time_normalise) {</div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>         dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);</div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>         <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>                        mapped_science_sky_tag,</div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>         }</div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>         }</div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(dummy, mapped_science_sky_tag, header)) {</div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>         }</div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>         cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>     }</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span> </div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>         <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>                        mapped_science_sky_tag,</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>         }</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>         }</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span> </div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(mapped_sky,</div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>                    mapped_science_sky_tag, header)) {</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>         }</div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span> </div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>     }</div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span> </div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span> <span class="comment">/*    if (skyglobal == 0 && skymedian < 0) {    NSS */</span></div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>     <span class="keywordflow">if</span> (skyglobal == 0 && skymedian == 0 && skylocal == 0) {</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>         cpl_image_delete(mapped_sky); mapped_sky = NULL;</div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>     }</div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span> </div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>     <span class="keywordflow">if</span> (skyglobal || skylocal) {</div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span> </div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span> </div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>         <span class="keywordflow">if</span> (skyglobal) {</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>         cpl_msg_info(recipe, <span class="stringliteral">"Global sky determination..."</span>);</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>         skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span> </div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>         sky = <a class="code" href="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d" title="Create a CCD median sky map.">mos_sky_map_super</a>(spectra, wavemap, dispersion, </div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>                     2.0, 50, skymap);</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span> </div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>         <span class="keywordflow">if</span> (sky) {</div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>             cpl_image_subtract(spectra, skymap);</div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>         }</div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>             cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>         }</div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>         }</div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>         cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>         skymap = <a class="code" href="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2" title="Subtract the sky from the scientific CCD exposure.">mos_subtract_sky</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>                       startwavelength, endwavelength, dispersion);</div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>         }</div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span> </div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>         <span class="keywordflow">if</span> (skymap) {</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>         <span class="keywordflow">if</span> (skyglobal) {</div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>             <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>             cpl_table_divide_scalar(sky, <span class="stringliteral">"sky"</span>, alltime);</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span> </div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span> <span class="comment">/* Old saving:</span></div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span> <span class="comment"></span></div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span> <span class="comment">            if (!j) {</span></div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span> <span class="comment">            if (dfs_save_table(frameset, sky,</span></div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span> <span class="comment">                       global_sky_spectrum_tag, </span></div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span> <span class="comment">                       NULL, parlist, recipe, version)) {</span></div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span> <span class="comment">                fors_pmos_extract_exit(NULL);</span></div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span> <span class="comment">            } else {</span></div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span> <span class="comment">            if (dfs_save_table_ext(sky, global_sky_spectrum_tag, </span></div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span> <span class="comment">                           NULL)) {</span></div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span> <span class="comment">                fors_pmos_extract_exit(NULL);</span></div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span> <span class="comment"></span></div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span> <span class="comment">End of old saving */</span></div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span> </div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>                     <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>                         <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist, </div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>                                                global_sky_spectrum_tag,</div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>                                                recipe, version)) {</div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>                 fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>                         }</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>                     }</div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>     </div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489" title="Save a table in a extension (different from the first one)">dfs_save_table_ext</a>(sky, global_sky_spectrum_tag, </div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>                                            NULL)) {</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>                         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>                     }</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>     </div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>     </div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>             cpl_table_delete(sky); sky = NULL;</div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>         }</div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span> </div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span> <span class="comment">//      save_header = dfs_load_header(frameset, science_tag, 0);</span></div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span> </div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>         <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>             cpl_image_divide_scalar(skymap, alltime);</div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span> </div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>                        unmapped_sky_tag,</div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>             }</div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>         }</div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span> </div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(skymap, unmapped_sky_tag,</div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>                        save_header)) {</div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>         }</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span> </div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>         cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span> </div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>                        unmapped_science_tag,</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>             }</div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>         }</div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span> </div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(spectra, unmapped_science_tag,</div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>                        save_header)) {</div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>         }</div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span> </div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span> <span class="comment">//      cpl_propertylist_delete(save_header); save_header = NULL;</span></div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span> </div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>         <span class="keywordflow">if</span> (cosmics) {</div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>             cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);</div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>             <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(spectra, gain, -1., -1.);</div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>         }</div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span> </div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span> <span class="comment">         * The spatially rectified image, that contained the sky,</span></div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span> <span class="comment">         * is replaced by a sky-subtracted spatially rectified image:</span></div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span> </div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>         cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span> </div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>         smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, </div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>                           reference, startwavelength, </div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>                           endwavelength, dispersion, </div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>                           flux, NULL);</div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>         }</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>         cpl_msg_warning(recipe, <span class="stringliteral">"Sky subtraction failure"</span>);</div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>         <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Cosmic rays removal not performed!"</span>);</div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>         cosmics = skylocal = skyglobal = 0;</div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>         }</div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>     }</div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span> </div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span> </div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>         save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span> </div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>         <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>                        wavelength_map_sky_tag,</div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>         }</div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>         }</div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span> </div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(wavemap, wavelength_map_sky_tag,</div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>                    save_header)) {</div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>         }</div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span> </div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span> <span class="comment">//      cpl_propertylist_delete(save_header); save_header = NULL;</span></div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>     }</div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span> </div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>     cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span> </div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>     mapped = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, reference,</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>                         startwavelength, endwavelength,</div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>                         dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span> </div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>     cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span> </div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, idscoeff, disp_coeff_sky_tag,</div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>                    NULL, parlist, recipe, version)) {</div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>         }</div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>         }</div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>     }</div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span> </div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span> <span class="comment">/*    if (skymedian >= 0) {    NSS */</span></div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>     <span class="keywordflow">if</span> (skymedian) {</div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>        </div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span> <span class="comment">/*   NSS      skylocalmap = mos_sky_local(mapped, slits, skymedian); */</span></div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span> <span class="comment">/*            skylocalmap = mos_sky_local(mapped, slits, 0);        */</span></div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>             skylocalmap = <a class="code" href="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8" title="Local determination of sky.">mos_sky_local_old</a>(mapped, slits);       </div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>             cpl_image_subtract(mapped, skylocalmap);</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span> <span class="comment">  if (dfs_save_image(frameset, skylocalmap, mapped_sky_tag, header, </span></div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span> <span class="comment">  parlist, recipe, version))</span></div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span> <span class="comment">  fors_pmos_extract_exit(NULL);</span></div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>             cpl_image_delete(skylocalmap); skylocalmap = NULL;</div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>     }</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span> </div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span> <span class="comment">/*    if (skyglobal || skymedian >= 0 || skylocal) {   NSS */</span></div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span> </div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>         skylocalmap = cpl_image_subtract_create(mapped_sky, mapped);</div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span> </div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>         cpl_image_delete(mapped_sky); mapped_sky = NULL;</div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span> </div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>         <span class="keywordflow">if</span> (time_normalise) {</div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>         dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);</div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span> </div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>                        mapped_sky_tag,</div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>             }</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>         }</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span> </div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(dummy, mapped_sky_tag,</div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>                        header)) {</div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>         }</div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span> </div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>         cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>         }</div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>                        mapped_sky_tag,</div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>             }</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>         }</div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span> </div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(skylocalmap, mapped_sky_tag,</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>                        header)) {</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>         }</div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>         }</div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span> </div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>         skylocalmaps[j] = skylocalmap;</div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span> </div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>         cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);</div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span> </div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>         <span class="keywordflow">if</span> (!j)</div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>         origslits = cpl_table_duplicate(slits);</div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span> </div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>         <span class="keywordflow">if</span> (cosmics || nscience > 1) {</div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>         dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped, slits, slit_margin, ext_radius, </div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>                        cont_radius);</div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>         }</div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>         mapped_cleaned = cpl_image_duplicate(mapped);</div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>         <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);</div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>         dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin, </div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>                        ext_radius, cont_radius);</div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span> </div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>         cpl_image_delete(mapped_cleaned); mapped_cleaned = NULL;</div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>         }</div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span> </div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>         cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span> </div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>         <span class="keywordflow">if</span> (check) {</div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span> </div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span> <span class="comment">/* Old saving:</span></div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span> <span class="comment"></span></div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span> <span class="comment">        if (!j) {</span></div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span> <span class="comment">            if (dfs_save_table(frameset, slits, object_table_tag,</span></div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span> <span class="comment">                       NULL, parlist, recipe, version)) {</span></div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span> <span class="comment">            fors_pmos_extract_exit(NULL);</span></div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span> <span class="comment">        } else {</span></div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span> <span class="comment">            if (dfs_save_table_ext(slits, object_table_tag, NULL)) {</span></div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span> <span class="comment">            fors_pmos_extract_exit(NULL);</span></div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span> <span class="comment">        }</span></div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span> <span class="comment"></span></div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span> <span class="comment">End old saving */</span></div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span> </div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>                 <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>                                            object_table_tag,</div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>                                            recipe, version)) {</div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>                         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>                     }</div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>                 }</div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span> </div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489" title="Save a table in a extension (different from the first one)">dfs_save_table_ext</a>(slits, object_table_tag, NULL)) {</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>                     fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>                 }</div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>         }</div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>     }</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span> </div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>     slitss[j]  = slits;</div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>     mappeds[j] = mapped;</div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span> </div>
+<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span> </div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>     cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span> </div>
+<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>     }</div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span> </div>
+<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>     cpl_table_delete(offsets); offsets = NULL;</div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span> </div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>     cpl_image_delete(norm_flat); norm_flat = NULL;</div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>     cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span> </div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>     cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span> </div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>     </div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>     cpl_msg_info(recipe, </div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>          <span class="stringliteral">"Check object detection in both beams for all angles..."</span>);</div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span> </div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>     <span class="comment">/* House keeping - selection of objects for which information required </span></div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span> <span class="comment">       for Stokes parameters computation is present */</span></div>
+<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span>     error = <a class="code" href="group__moses.html#ga5f9947ec541f1291f7c9fb20bd081280" title="Intersect a number of slit tables.">mos_object_intersect</a>(slitss, origslits, nscience, 5.0);</div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>     <span class="keywordflow">if</span> (error == CPL_ERROR_DATA_NOT_FOUND) {</div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>         cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: no Stokes "</span></div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>                        <span class="stringliteral">"parameters to compute!"</span>);</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>         <span class="keywordflow">for</span> (j = 0; j < nscience; j++)</div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>             cpl_table_delete(slitss[j]);</div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>         cpl_free(slitss);</div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>         cpl_table_delete(origslits);</div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (error) {</div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>         fors_pmos_extract_exit(<span class="stringliteral">"Problem in polarimetric object selection"</span>);</div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>     }</div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span> </div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, origslits, object_table_pol_tag,</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>                NULL, parlist, recipe, version)) {</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>     fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>     }</div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span> </div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>     nobjs_per_slit = fors_get_nobjs_perslit(origslits);</div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span> </div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>     cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);</div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span> </div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>     <span class="keywordtype">int</span> k;</div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span> </div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span> </div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>     <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>         cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>     }</div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span> </div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>                        startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span> <span class="comment">       cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span> </div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {</div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span> </div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>         cpl_msg_info(recipe, <span class="stringliteral">"Extracting at angle %.2f (%d out of %d) ..."</span>,</div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>              angles[j], j + 1, nscience);</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span> </div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>         images = <a class="code" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522" title="Extract detected objects from rectified scientific frame.">mos_extract_objects</a>(mappeds[j], skylocalmaps[j],</div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>                      origslits, </div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>                      ext_mode, ron, gain, 1);</div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span> </div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>         cpl_image_delete(skylocalmaps[j]); skylocalmaps[j] = NULL;</div>
+<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span> </div>
+<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>         <span class="keywordflow">if</span> (images) {</div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>         <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>             cpl_image_divide_scalar(images[0], alltime);</div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span> </div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>                        reduced_science_tag,</div>
+<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>             }</div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>         }</div>
+<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span> </div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(images[0], reduced_science_tag,</div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>                        header)) {</div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>         }</div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span> </div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>         reduceds[j] = images[0];</div>
+<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span> <span class="comment">//      cpl_image_delete(images[0]);</span></div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>     </div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>         <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>             cpl_image_divide_scalar(images[1], alltime);</div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span> </div>
+<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>                        reduced_sky_tag,</div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>             }</div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>         }</div>
+<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span> </div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(images[1], reduced_sky_tag,</div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>                        header)) {</div>
+<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>         }</div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>         cpl_image_delete(images[1]);</div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>     </div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>         <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>             cpl_image_divide_scalar(images[2], alltime);</div>
+<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span> </div>
+<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>                        reduced_error_tag,</div>
+<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span>             }</div>
+<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>         }</div>
+<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span> </div>
+<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(images[2], reduced_error_tag,</div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>                        header)) {</div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>         }</div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span> </div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>         rerrors[j] = images[2];</div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span> <span class="comment">//      cpl_image_delete(images[2]);</span></div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span> </div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>         cpl_free(images);</div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>         }</div>
+<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span>         cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span></div>
+<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>                 <span class="stringliteral">"%s, %s, and %s are not created"</span>, </div>
+<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span>                 reduced_science_tag, reduced_sky_tag, </div>
+<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>                 reduced_error_tag);</div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>         }</div>
+<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span> </div>
+<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>     }</div>
+<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span> </div>
+<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span> <span class="comment">//  slitss[j] = slits;</span></div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span> <span class="comment">//  cpl_table_delete(slits); slits = NULL;</span></div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span> </div>
+<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span> </div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span> <span class="comment">/*    if (skyglobal || skymedian >= 0) {   NSS */</span></div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {</div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>         <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>         cpl_image_divide_scalar(mappeds[j], alltime);</div>
+<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span> </div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>         <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>                        mapped_science_tag,</div>
+<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>                        recipe, version)) {</div>
+<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>             fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>         }</div>
+<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>         }</div>
+<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span> </div>
+<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(mappeds[j], mapped_science_tag,</div>
+<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span>                    header)) {</div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>         }</div>
+<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>     }</div>
+<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span> </div>
+<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>     cpl_image_delete(mappeds[j]); mappeds[j] = NULL;</div>
+<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span> </div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>     }</div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span> </div>
+<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>     cpl_table_delete(origslits);</div>
+<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span> </div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>     <span class="comment">/* Stokes computation */</span></div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span> </div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>     nobjects = cpl_image_get_size_y(reduceds[0]) / 2;</div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>     nx       = cpl_image_get_size_x(reduceds[0]);</div>
+<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span> </div>
+<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>     header = cpl_propertylist_new();</div>
+<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>                    startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span> <span class="comment">       cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>     </div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>     <span class="keywordflow">if</span> (circ) {</div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span> </div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>     cpl_image        *pv_im          = NULL;</div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>     cpl_image        *pvnull_im      = NULL;</div>
+<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>     cpl_image        *perr_im        = NULL;</div>
+<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span> </div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>     <span class="keywordtype">double</span>           *p_v            = NULL;</div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>     <span class="keywordtype">double</span>           *p_vnull        = NULL;</div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>     <span class="keywordtype">double</span>           *perr           = NULL;</div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span> </div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>     <span class="keywordtype">double</span>            mean_vnull;</div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span> </div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>     <span class="keywordtype">int</span> p = -1;</div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>     <span class="keywordtype">int</span> total = 0;</div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span> </div>
+<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>     pv_im     = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>     perr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span> </div>
+<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>     p_v     = cpl_image_get_data_double(pv_im);</div>
+<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>     perr    = cpl_image_get_data_double(perr_im);</div>
+<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span> </div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>     <span class="keywordflow">if</span> (nscience / 2 > 1) {</div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>         pvnull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>         p_vnull = cpl_image_get_data_double(pvnull_im);</div>
+<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span>     }</div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span> </div>
+<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>     <span class="keywordflow">for</span> (j = 0; j < nobjects; j++) {</div>
+<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>         <span class="keywordtype">int</span> k, m;</div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span> </div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>         <span class="keywordtype">double</span> * ip_v,</div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>            * ip_vnull, * iperr;</div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span> </div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>         <span class="keywordtype">float</span> * data;</div>
+<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span>         <span class="keywordtype">float</span> * iff,  * ierr;</div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span> </div>
+<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>         ip_v = p_v + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span> </div>
+<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>         <span class="keywordflow">if</span> (nscience / 2 > 1)</div>
+<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>         ip_vnull = p_vnull + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span> </div>
+<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>         iperr = perr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span> </div>
+<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>         <span class="keywordflow">while</span> (total < j + 1) {</div>
+<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>         p++;</div>
+<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>         total += nobjs_per_slit[p];</div>
+<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>         }</div>
+<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span> </div>
+<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>         <span class="keywordflow">for</span> (k = 0; k < nscience / 2; k++) {</div>
+<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span>         <span class="keywordtype">float</span> * if_o,  * if_e,  * ifdelta_o, * ifdelta_e;</div>
+<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span> </div>
+<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>         <span class="keywordtype">int</span> pos   = fors_find_angle_pos(angles, nscience, 180 * k - 45);</div>
+<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>         <span class="keywordtype">int</span> pos_d = fors_find_angle_pos(angles, nscience, 180 * k + 45);</div>
+<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span> </div>
+<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>         data = cpl_image_get_data_float(reduceds[pos]);</div>
+<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span> </div>
+<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>         if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span> </div>
+<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>         if_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span> </div>
+<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span> <span class="comment">//      if_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span></div>
+<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span> <span class="comment">//      if_e = data +  2 * (nobjects - 1 - j)      * nx;</span></div>
+<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span> </div>
+<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>         data = cpl_image_get_data_float(reduceds[pos_d]);</div>
+<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span> </div>
+<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>         ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span> </div>
+<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>         ifdelta_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span> </div>
+<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span> <span class="comment">//      ifdelta_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span></div>
+<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span> <span class="comment">//      ifdelta_e = data +  2 * (nobjects - 1 - j)      * nx;</span></div>
+<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span> </div>
+<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span> </div>
+<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>             <span class="keywordtype">double</span> quantity = if_o[m] + if_e[m] == 0.0 ? 0.0 :</div>
+<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>             (if_o[m]      - if_e[m]     ) /</div>
+<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>             (if_o[m]      + if_e[m]     ) -</div>
+<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>             (ifdelta_o[m] - ifdelta_e[m]) /</div>
+<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>             (ifdelta_o[m] + ifdelta_e[m]);</div>
+<div class="line"><a name="l01947"></a><span class="lineno"> 1947</span> </div>
+<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>             quantity = isfinite(quantity) ? quantity : 0.0;</div>
+<div class="line"><a name="l01949"></a><span class="lineno"> 1949</span> </div>
+<div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>             <span class="comment">/* PQ map computation */</span></div>
+<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>             ip_v[m] += quantity * 0.5 / (nscience / 2);</div>
+<div class="line"><a name="l01952"></a><span class="lineno"> 1952</span> </div>
+<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>             <span class="comment">/* PQnull map computation */</span></div>
+<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>             <span class="keywordflow">if</span> (nscience / 2 > 1) {</div>
+<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span>             <span class="keywordflow">if</span> (k % 2)</div>
+<div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>                 ip_vnull[m] += quantity * 0.5 / (nscience / 2);</div>
+<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>                 ip_vnull[m] -= quantity * 0.5 / (nscience / 2);</div>
+<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>             }</div>
+<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>         }</div>
+<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>         }</div>
+<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span> </div>
+<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>         <span class="comment">/* Error map */</span></div>
+<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>         data = cpl_image_get_data_float(reduceds[0]);</div>
+<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>         iff  = data +  2 * (nobjects - 1 - j)      * nx;</div>
+<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span> </div>
+<div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>         data = cpl_image_get_data_float(rerrors[0]);</div>
+<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>         ierr = data +  2 * (nobjects - 1 - j)      * nx;</div>
+<div class="line"><a name="l01969"></a><span class="lineno"> 1969</span> </div>
+<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>         <span class="keywordflow">for</span> (m = 0; m < nx; m++)</div>
+<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>         iperr[m] = iff[m] <= 0.0 ? </div>
+<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>             0.0 : ierr[m] / iff[m] * 0.5 / sqrt (nscience / 2);</div>
+<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span> </div>
+<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>         <span class="keywordflow">if</span> (nscience / 2 > 1) {</div>
+<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>         <span class="keywordtype">float</span> * weights;</div>
+<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>         <span class="keywordtype">float</span>   max, sum, sum2, imean;</div>
+<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span> </div>
+<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>         <span class="keywordtype">int</span> k;</div>
+<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span> </div>
+<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>         <span class="comment">/* QC on U NULL */</span></div>
+<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>         weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);</div>
+<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span> </div>
+<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>         max = 0.0;</div>
+<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>             <span class="keywordflow">if</span> (max < iff[k]) max = iff[k];</div>
+<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>         }</div>
+<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>         </div>
+<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>             weights[k] = iff[k] < 0.0 ? </div>
+<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>             0.0 : iff[k] * iff[k] / (max * max);</div>
+<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>         }</div>
+<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>         </div>
+<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>         sum  = 0.0;</div>
+<div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>         sum2 = 0.0;</div>
+<div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>             sum  += weights[k] * ip_vnull[k];</div>
+<div class="line"><a name="l01997"></a><span class="lineno"> 1997</span>             sum2 += weights[k];</div>
+<div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>         }</div>
+<div class="line"><a name="l01999"></a><span class="lineno"> 1999</span> </div>
+<div class="line"><a name="l02000"></a><span class="lineno"> 2000</span>         cpl_free(weights);</div>
+<div class="line"><a name="l02001"></a><span class="lineno"> 2001</span> </div>
+<div class="line"><a name="l02002"></a><span class="lineno"> 2002</span>         imean = sum / sum2;</div>
+<div class="line"><a name="l02003"></a><span class="lineno"> 2003</span> </div>
+<div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>         mean_vnull += (imean - mean_vnull) / (j + 1.0);</div>
+<div class="line"><a name="l02005"></a><span class="lineno"> 2005</span>         }</div>
+<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>     }</div>
+<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span> </div>
+<div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pv_im, reduced_v_tag, header, </div>
+<div class="line"><a name="l02009"></a><span class="lineno"> 2009</span>                parlist, recipe, version))</div>
+<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span> </div>
+<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>     <span class="keywordflow">if</span> (nscience / 2 > 1) {</div>
+<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>         <span class="keywordtype">char</span> * pipefile, * keyname;</div>
+<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>         cpl_propertylist * qheader = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span> </div>
+<div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>                                startwavelength + dispersion/2);</div>
+<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>             <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span> <span class="comment">               cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span> </div>
+<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>         <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);</div>
+<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span> </div>
+<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span> <span class="comment">         * QC1 group header</span></div>
+<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span> </div>
+<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_v_tag,</div>
+<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>                      <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write product category to "</span></div>
+<div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>                      <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span> </div>
+<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>                        <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DPR TYPE in arc "</span></div>
+<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span> </div>
+<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>                        <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword TPL ID in arc "</span></div>
+<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span> </div>
+<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>                        <span class="stringliteral">"Grism name"</span>, instrume))</div>
+<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in arc "</span></div>
+<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span> </div>
+<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,</div>
+<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>                        <span class="stringliteral">"Grism identifier"</span>, instrume))</div>
+<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in arc "</span></div>
+<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span> </div>
+<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>         <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))</div>
+<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span>         <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>                        <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span> </div>
+<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,</div>
+<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>                        <span class="stringliteral">"Collimator name"</span>, instrume))</div>
+<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in arc "</span></div>
+<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span> </div>
+<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>                        <span class="stringliteral">"Chip identifier"</span>, instrume))</div>
+<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in arc "</span></div>
+<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span> </div>
+<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>                        <span class="stringliteral">"Archive name of input data"</span>, </div>
+<div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>                        instrume))</div>
+<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ARCFILE in arc "</span></div>
+<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span> </div>
+<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>         pipefile = dfs_generate_filename_tfits(reduced_nul_v_tag);</div>
+<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>                      <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);</div>
+<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>         cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span> </div>
+<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span> </div>
+<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span> <span class="comment">         * QC1 parameters</span></div>
+<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span> </div>
+<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>         keyname = <span class="stringliteral">"QC.NULL.V.MEAN"</span>;</div>
+<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>             </div>
+<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qheader, mean_vnull,</div>
+<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>                     keyname, NULL,</div>
+<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>                     <span class="stringliteral">"Mean V null parameter"</span>,</div>
+<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>                     instrume)) {</div>
+<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write mean Q null parameter "</span></div>
+<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>                      <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span>         }</div>
+<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span> </div>
+<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span>         <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span> </div>
+<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pvnull_im, reduced_nul_v_tag, qheader, </div>
+<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>                    parlist, recipe, version))</div>
+<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span> </div>
+<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>         cpl_propertylist_delete(qheader);</div>
+<div class="line"><a name="l02109"></a><span class="lineno"> 2109</span>     }</div>
+<div class="line"><a name="l02110"></a><span class="lineno"> 2110</span> </div>
+<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, perr_im, reduced_error_v_tag, header, </div>
+<div class="line"><a name="l02112"></a><span class="lineno"> 2112</span>                parlist, recipe, version))</div>
+<div class="line"><a name="l02113"></a><span class="lineno"> 2113</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02114"></a><span class="lineno"> 2114</span> </div>
+<div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>     cpl_image_delete(pv_im);</div>
+<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span>     cpl_image_delete(pvnull_im);</div>
+<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span>     cpl_image_delete(perr_im);</div>
+<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>     cpl_image        *pq_im          = NULL;</div>
+<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>     cpl_image        *pu_im          = NULL;</div>
+<div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>     cpl_image        *pl_im          = NULL;</div>
+<div class="line"><a name="l02122"></a><span class="lineno"> 2122</span> </div>
+<div class="line"><a name="l02123"></a><span class="lineno"> 2123</span>     cpl_image        *pqnull_im      = NULL;</div>
+<div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>     cpl_image        *punull_im      = NULL;</div>
+<div class="line"><a name="l02125"></a><span class="lineno"> 2125</span> </div>
+<div class="line"><a name="l02126"></a><span class="lineno"> 2126</span>     cpl_image        *pqerr_im        = NULL;</div>
+<div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>     cpl_image        *puerr_im        = NULL;</div>
+<div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>     cpl_image        *plerr_im        = NULL;</div>
+<div class="line"><a name="l02129"></a><span class="lineno"> 2129</span> </div>
+<div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>     cpl_image        *pang_im        = NULL;</div>
+<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>     cpl_image        *pangerr_im        = NULL;</div>
+<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span> </div>
+<div class="line"><a name="l02133"></a><span class="lineno"> 2133</span>     <span class="keywordtype">double</span>           *p_q            = NULL;</div>
+<div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>     <span class="keywordtype">double</span>           *p_u            = NULL;</div>
+<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>     <span class="keywordtype">double</span>           *p_l            = NULL;</div>
+<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span> </div>
+<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>     <span class="keywordtype">double</span>           *p_qnull        = NULL;</div>
+<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>     <span class="keywordtype">double</span>           *p_unull        = NULL;</div>
+<div class="line"><a name="l02139"></a><span class="lineno"> 2139</span> </div>
+<div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>     <span class="keywordtype">double</span>           *pqerr           = NULL;</div>
+<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>     <span class="keywordtype">double</span>           *puerr           = NULL;</div>
+<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>     <span class="keywordtype">double</span>           *plerr           = NULL;</div>
+<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span> </div>
+<div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>     <span class="keywordtype">double</span>           *pang           = NULL;</div>
+<div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>     <span class="keywordtype">double</span>           *pangerr           = NULL;</div>
+<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span> </div>
+<div class="line"><a name="l02147"></a><span class="lineno"> 2147</span>     <span class="keywordtype">int</span> k, m;</div>
+<div class="line"><a name="l02148"></a><span class="lineno"> 2148</span> </div>
+<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>     cpl_image * correct_im = cpl_image_new(nx, 1, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>     <span class="keywordtype">double</span>    * correct    = cpl_image_get_data_double(correct_im);</div>
+<div class="line"><a name="l02151"></a><span class="lineno"> 2151</span> </div>
+<div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>     <span class="keywordtype">double</span> mean_unull, mean_qnull;</div>
+<div class="line"><a name="l02153"></a><span class="lineno"> 2153</span> </div>
+<div class="line"><a name="l02154"></a><span class="lineno"> 2154</span>     <span class="keywordtype">int</span> p = -1;</div>
+<div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>     <span class="keywordtype">int</span> total = 0;</div>
+<div class="line"><a name="l02156"></a><span class="lineno"> 2156</span> </div>
+<div class="line"><a name="l02157"></a><span class="lineno"> 2157</span>     pq_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02158"></a><span class="lineno"> 2158</span>     pu_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>     pl_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02160"></a><span class="lineno"> 2160</span> </div>
+<div class="line"><a name="l02161"></a><span class="lineno"> 2161</span>     pqerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02162"></a><span class="lineno"> 2162</span>     puerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02163"></a><span class="lineno"> 2163</span>     plerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02164"></a><span class="lineno"> 2164</span> </div>
+<div class="line"><a name="l02165"></a><span class="lineno"> 2165</span>     pang_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02166"></a><span class="lineno"> 2166</span>     pangerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02167"></a><span class="lineno"> 2167</span> </div>
+<div class="line"><a name="l02168"></a><span class="lineno"> 2168</span>     p_q = cpl_image_get_data_double(pq_im);</div>
+<div class="line"><a name="l02169"></a><span class="lineno"> 2169</span>     p_u = cpl_image_get_data_double(pu_im);</div>
+<div class="line"><a name="l02170"></a><span class="lineno"> 2170</span>     p_l = cpl_image_get_data_double(pl_im);</div>
+<div class="line"><a name="l02171"></a><span class="lineno"> 2171</span> </div>
+<div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>     <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02173"></a><span class="lineno"> 2173</span>         pqnull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02174"></a><span class="lineno"> 2174</span>         punull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02175"></a><span class="lineno"> 2175</span> </div>
+<div class="line"><a name="l02176"></a><span class="lineno"> 2176</span>         p_qnull = cpl_image_get_data_double(pqnull_im);</div>
+<div class="line"><a name="l02177"></a><span class="lineno"> 2177</span>         p_unull = cpl_image_get_data_double(punull_im);</div>
+<div class="line"><a name="l02178"></a><span class="lineno"> 2178</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02179"></a><span class="lineno"> 2179</span>         cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l02180"></a><span class="lineno"> 2180</span>                 <span class="stringliteral">"Not enough pairs to compute null parameters"</span>);</div>
+<div class="line"><a name="l02181"></a><span class="lineno"> 2181</span>     }</div>
+<div class="line"><a name="l02182"></a><span class="lineno"> 2182</span> </div>
+<div class="line"><a name="l02183"></a><span class="lineno"> 2183</span>     pqerr = cpl_image_get_data_double(pqerr_im);</div>
+<div class="line"><a name="l02184"></a><span class="lineno"> 2184</span>     puerr = cpl_image_get_data_double(puerr_im);</div>
+<div class="line"><a name="l02185"></a><span class="lineno"> 2185</span>     plerr = cpl_image_get_data_double(plerr_im);</div>
+<div class="line"><a name="l02186"></a><span class="lineno"> 2186</span> </div>
+<div class="line"><a name="l02187"></a><span class="lineno"> 2187</span>     pang = cpl_image_get_data_double(pang_im);</div>
+<div class="line"><a name="l02188"></a><span class="lineno"> 2188</span>     pangerr = cpl_image_get_data_double(pangerr_im);</div>
+<div class="line"><a name="l02189"></a><span class="lineno"> 2189</span> </div>
+<div class="line"><a name="l02190"></a><span class="lineno"> 2190</span>     <span class="keywordflow">if</span> (chromatism) {</div>
+<div class="line"><a name="l02191"></a><span class="lineno"> 2191</span>         cpl_table * chrotbl = </div>
+<div class="line"><a name="l02192"></a><span class="lineno"> 2192</span>         <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, chrom_table_tag, 1);</div>
+<div class="line"><a name="l02193"></a><span class="lineno"> 2193</span> </div>
+<div class="line"><a name="l02194"></a><span class="lineno"> 2194</span>         <span class="keywordtype">int</span>      nrow   = cpl_table_get_nrow(chrotbl);</div>
+<div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>         <span class="keywordtype">float</span>  * lambda = cpl_table_get_data_float(chrotbl, <span class="stringliteral">"lambda"</span>);</div>
+<div class="line"><a name="l02196"></a><span class="lineno"> 2196</span>         <span class="keywordtype">float</span>  * theta  = cpl_table_get_data_float(chrotbl, <span class="stringliteral">"eps_theta"</span>);</div>
+<div class="line"><a name="l02197"></a><span class="lineno"> 2197</span> </div>
+<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>         <span class="keywordflow">for</span> (j = 0; j < nx; j++) {</div>
+<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>         <span class="keywordtype">double</span> c_wave = </div>
+<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>             startwavelength + dispersion / 2 + j * dispersion;</div>
+<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>         </div>
+<div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>         <span class="keywordtype">int</span> found = 0;</div>
+<div class="line"><a name="l02203"></a><span class="lineno"> 2203</span> </div>
+<div class="line"><a name="l02204"></a><span class="lineno"> 2204</span>         <span class="keywordflow">for</span> (k = 0; k < nrow - 1; k++) {</div>
+<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>             <span class="keywordflow">if</span> (lambda[k] <= c_wave && c_wave < lambda[k + 1]) {</div>
+<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>             found = 1;</div>
+<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>             }</div>
+<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>         }</div>
+<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span> </div>
+<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>         <span class="keywordflow">if</span> (found) {</div>
+<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>             correct[j] = (theta [k + 1] - theta [k]) /</div>
+<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>                      (lambda[k + 1] - lambda[k]) *</div>
+<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>                      (c_wave        - lambda[k])   + theta[k];</div>
+<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>                     correct[j] *= M_PI / 180;   <span class="comment">/* Radians */</span></div>
+<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>         }</div>
+<div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (j)</div>
+<div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>                     correct[j] = correct[j-1];</div>
+<div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>                     correct[j] = 0.0;</div>
+<div class="line"><a name="l02221"></a><span class="lineno"> 2221</span> </div>
+<div class="line"><a name="l02222"></a><span class="lineno"> 2222</span>         }</div>
+<div class="line"><a name="l02223"></a><span class="lineno"> 2223</span> </div>
+<div class="line"><a name="l02224"></a><span class="lineno"> 2224</span>         cpl_table_delete(chrotbl);</div>
+<div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>     }</div>
+<div class="line"><a name="l02226"></a><span class="lineno"> 2226</span> </div>
+<div class="line"><a name="l02227"></a><span class="lineno"> 2227</span>     <span class="keywordflow">for</span> (j = 0; j < nobjects; j++) {</div>
+<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>         <span class="keywordtype">double</span> * ip_q,     * ip_u, * ip_l, </div>
+<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>         * ip_qnull, * ip_unull, * ipqerr, * ipuerr, * iplerr,</div>
+<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>         * ipang, * ipangerr;</div>
+<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span> </div>
+<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>         <span class="keywordtype">float</span> * data;</div>
+<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span>         <span class="keywordtype">float</span> * iffq,  * ierrq, * iffu, * ierru;</div>
+<div class="line"><a name="l02234"></a><span class="lineno"> 2234</span> </div>
+<div class="line"><a name="l02235"></a><span class="lineno"> 2235</span>         <span class="keywordtype">int</span> pos, pos_d;</div>
+<div class="line"><a name="l02236"></a><span class="lineno"> 2236</span> </div>
+<div class="line"><a name="l02237"></a><span class="lineno"> 2237</span>         ip_q = p_q + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>         ip_u = p_u + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>         ip_l = p_l + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02240"></a><span class="lineno"> 2240</span> </div>
+<div class="line"><a name="l02241"></a><span class="lineno"> 2241</span>         <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02242"></a><span class="lineno"> 2242</span>         ip_qnull = p_qnull + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>         ip_unull = p_unull + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02244"></a><span class="lineno"> 2244</span>         }</div>
+<div class="line"><a name="l02245"></a><span class="lineno"> 2245</span> </div>
+<div class="line"><a name="l02246"></a><span class="lineno"> 2246</span>         ipqerr = pqerr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02247"></a><span class="lineno"> 2247</span>         ipuerr = puerr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02248"></a><span class="lineno"> 2248</span>         iplerr = plerr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02249"></a><span class="lineno"> 2249</span> </div>
+<div class="line"><a name="l02250"></a><span class="lineno"> 2250</span>         ipang = pang + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02251"></a><span class="lineno"> 2251</span>         ipangerr = pangerr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02252"></a><span class="lineno"> 2252</span> </div>
+<div class="line"><a name="l02253"></a><span class="lineno"> 2253</span>         <span class="keywordflow">while</span> (total < j + 1) {</div>
+<div class="line"><a name="l02254"></a><span class="lineno"> 2254</span>         p++;</div>
+<div class="line"><a name="l02255"></a><span class="lineno"> 2255</span>         total += nobjs_per_slit[p];</div>
+<div class="line"><a name="l02256"></a><span class="lineno"> 2256</span>         }</div>
+<div class="line"><a name="l02257"></a><span class="lineno"> 2257</span> </div>
+<div class="line"><a name="l02258"></a><span class="lineno"> 2258</span>         <span class="keywordflow">for</span> (k = 0; k < nscience / 4; k++) {</div>
+<div class="line"><a name="l02259"></a><span class="lineno"> 2259</span>         <span class="keywordtype">float</span> * if_o,  * if_e,  * ifdelta_o, * ifdelta_e;</div>
+<div class="line"><a name="l02260"></a><span class="lineno"> 2260</span> </div>
+<div class="line"><a name="l02261"></a><span class="lineno"> 2261</span>         <span class="comment">/* First P_Q */</span></div>
+<div class="line"><a name="l02262"></a><span class="lineno"> 2262</span> </div>
+<div class="line"><a name="l02263"></a><span class="lineno"> 2263</span>         pos   = fors_find_angle_pos(angles, nscience, 90 * k);</div>
+<div class="line"><a name="l02264"></a><span class="lineno"> 2264</span>         pos_d = fors_find_angle_pos(angles, nscience, 90 * k + 45);</div>
+<div class="line"><a name="l02265"></a><span class="lineno"> 2265</span> </div>
+<div class="line"><a name="l02266"></a><span class="lineno"> 2266</span>         data = cpl_image_get_data_float(reduceds[pos]);</div>
+<div class="line"><a name="l02267"></a><span class="lineno"> 2267</span> </div>
+<div class="line"><a name="l02268"></a><span class="lineno"> 2268</span>         if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l02269"></a><span class="lineno"> 2269</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02270"></a><span class="lineno"> 2270</span> </div>
+<div class="line"><a name="l02271"></a><span class="lineno"> 2271</span>         if_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02272"></a><span class="lineno"> 2272</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02273"></a><span class="lineno"> 2273</span> </div>
+<div class="line"><a name="l02274"></a><span class="lineno"> 2274</span> <span class="comment">//      if_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span></div>
+<div class="line"><a name="l02275"></a><span class="lineno"> 2275</span> <span class="comment">//      if_e = data +  2 * (nobjects - 1 - j)      * nx;</span></div>
+<div class="line"><a name="l02276"></a><span class="lineno"> 2276</span> </div>
+<div class="line"><a name="l02277"></a><span class="lineno"> 2277</span>         data = cpl_image_get_data_float(reduceds[pos_d]);</div>
+<div class="line"><a name="l02278"></a><span class="lineno"> 2278</span> </div>
+<div class="line"><a name="l02279"></a><span class="lineno"> 2279</span>         ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l02280"></a><span class="lineno"> 2280</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02281"></a><span class="lineno"> 2281</span> </div>
+<div class="line"><a name="l02282"></a><span class="lineno"> 2282</span>         ifdelta_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02283"></a><span class="lineno"> 2283</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02284"></a><span class="lineno"> 2284</span> </div>
+<div class="line"><a name="l02285"></a><span class="lineno"> 2285</span> <span class="comment">//      ifdelta_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span></div>
+<div class="line"><a name="l02286"></a><span class="lineno"> 2286</span> <span class="comment">//      ifdelta_e = data +  2 * (nobjects - 1 - j)      * nx;</span></div>
+<div class="line"><a name="l02287"></a><span class="lineno"> 2287</span> </div>
+<div class="line"><a name="l02288"></a><span class="lineno"> 2288</span>         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l02289"></a><span class="lineno"> 2289</span> </div>
+<div class="line"><a name="l02290"></a><span class="lineno"> 2290</span>             <span class="keywordtype">double</span> quantity = fabs(if_o[m] + if_e[m]) < FLT_MIN ? 0.0 :</div>
+<div class="line"><a name="l02291"></a><span class="lineno"> 2291</span>             (if_o[m]      - if_e[m]     ) /</div>
+<div class="line"><a name="l02292"></a><span class="lineno"> 2292</span>             (if_o[m]      + if_e[m]     ) -</div>
+<div class="line"><a name="l02293"></a><span class="lineno"> 2293</span>             (ifdelta_o[m] - ifdelta_e[m]) /</div>
+<div class="line"><a name="l02294"></a><span class="lineno"> 2294</span>             (ifdelta_o[m] + ifdelta_e[m]);</div>
+<div class="line"><a name="l02295"></a><span class="lineno"> 2295</span> </div>
+<div class="line"><a name="l02296"></a><span class="lineno"> 2296</span>             quantity = isfinite(quantity) ? quantity : 0.0;</div>
+<div class="line"><a name="l02297"></a><span class="lineno"> 2297</span> </div>
+<div class="line"><a name="l02298"></a><span class="lineno"> 2298</span>             <span class="comment">/* PQ map computation */</span></div>
+<div class="line"><a name="l02299"></a><span class="lineno"> 2299</span>             ip_q[m] += quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02300"></a><span class="lineno"> 2300</span> </div>
+<div class="line"><a name="l02301"></a><span class="lineno"> 2301</span>             <span class="comment">/* PQnull map computation */</span></div>
+<div class="line"><a name="l02302"></a><span class="lineno"> 2302</span>             <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02303"></a><span class="lineno"> 2303</span>             <span class="keywordflow">if</span> (k % 2)</div>
+<div class="line"><a name="l02304"></a><span class="lineno"> 2304</span>                 ip_qnull[m] += quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02305"></a><span class="lineno"> 2305</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l02306"></a><span class="lineno"> 2306</span>                 ip_qnull[m] -= quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02307"></a><span class="lineno"> 2307</span>             }</div>
+<div class="line"><a name="l02308"></a><span class="lineno"> 2308</span>         }</div>
+<div class="line"><a name="l02309"></a><span class="lineno"> 2309</span> </div>
+<div class="line"><a name="l02310"></a><span class="lineno"> 2310</span>         <span class="comment">/* Now P_U */</span></div>
+<div class="line"><a name="l02311"></a><span class="lineno"> 2311</span> </div>
+<div class="line"><a name="l02312"></a><span class="lineno"> 2312</span>         pos   = fors_find_angle_pos(angles, nscience, 90 * k + 22.5);</div>
+<div class="line"><a name="l02313"></a><span class="lineno"> 2313</span>         pos_d = fors_find_angle_pos(angles, nscience, 90 * k + 67.5);</div>
+<div class="line"><a name="l02314"></a><span class="lineno"> 2314</span> </div>
+<div class="line"><a name="l02315"></a><span class="lineno"> 2315</span>         data = cpl_image_get_data_float(reduceds[pos]);</div>
+<div class="line"><a name="l02316"></a><span class="lineno"> 2316</span> </div>
+<div class="line"><a name="l02317"></a><span class="lineno"> 2317</span>         if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l02318"></a><span class="lineno"> 2318</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02319"></a><span class="lineno"> 2319</span> </div>
+<div class="line"><a name="l02320"></a><span class="lineno"> 2320</span>         if_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02321"></a><span class="lineno"> 2321</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02322"></a><span class="lineno"> 2322</span> </div>
+<div class="line"><a name="l02323"></a><span class="lineno"> 2323</span> <span class="comment">//      if_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span></div>
+<div class="line"><a name="l02324"></a><span class="lineno"> 2324</span> <span class="comment">//      if_e = data +  2 * (nobjects - 1 - j)      * nx;</span></div>
+<div class="line"><a name="l02325"></a><span class="lineno"> 2325</span> </div>
+<div class="line"><a name="l02326"></a><span class="lineno"> 2326</span>         data = cpl_image_get_data_float(reduceds[pos_d]);</div>
+<div class="line"><a name="l02327"></a><span class="lineno"> 2327</span> </div>
+<div class="line"><a name="l02328"></a><span class="lineno"> 2328</span>         ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l02329"></a><span class="lineno"> 2329</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02330"></a><span class="lineno"> 2330</span> </div>
+<div class="line"><a name="l02331"></a><span class="lineno"> 2331</span>         ifdelta_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02332"></a><span class="lineno"> 2332</span>                    + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02333"></a><span class="lineno"> 2333</span> </div>
+<div class="line"><a name="l02334"></a><span class="lineno"> 2334</span> <span class="comment">//      ifdelta_o = data + (2 * (nobjects - 1 - j) + 1) * nx;</span></div>
+<div class="line"><a name="l02335"></a><span class="lineno"> 2335</span> <span class="comment">//      ifdelta_e = data +  2 * (nobjects - 1 - j)      * nx;</span></div>
+<div class="line"><a name="l02336"></a><span class="lineno"> 2336</span> </div>
+<div class="line"><a name="l02337"></a><span class="lineno"> 2337</span>         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l02338"></a><span class="lineno"> 2338</span> </div>
+<div class="line"><a name="l02339"></a><span class="lineno"> 2339</span>             <span class="keywordtype">double</span> quantity = fabs(if_o[m] + if_e[m]) < FLT_MIN ? 0.0 :</div>
+<div class="line"><a name="l02340"></a><span class="lineno"> 2340</span>             (if_o[m]      - if_e[m]     ) /</div>
+<div class="line"><a name="l02341"></a><span class="lineno"> 2341</span>             (if_o[m]      + if_e[m]     ) -</div>
+<div class="line"><a name="l02342"></a><span class="lineno"> 2342</span>             (ifdelta_o[m] - ifdelta_e[m]) /</div>
+<div class="line"><a name="l02343"></a><span class="lineno"> 2343</span>             (ifdelta_o[m] + ifdelta_e[m]);</div>
+<div class="line"><a name="l02344"></a><span class="lineno"> 2344</span> </div>
+<div class="line"><a name="l02345"></a><span class="lineno"> 2345</span>             quantity = isfinite(quantity) ? quantity : 0.0;</div>
+<div class="line"><a name="l02346"></a><span class="lineno"> 2346</span> </div>
+<div class="line"><a name="l02347"></a><span class="lineno"> 2347</span>             <span class="comment">/* PU map computation */</span></div>
+<div class="line"><a name="l02348"></a><span class="lineno"> 2348</span>             ip_u[m] += quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02349"></a><span class="lineno"> 2349</span> </div>
+<div class="line"><a name="l02350"></a><span class="lineno"> 2350</span>             <span class="comment">/* PUnull map computation */</span></div>
+<div class="line"><a name="l02351"></a><span class="lineno"> 2351</span>             <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02352"></a><span class="lineno"> 2352</span>             <span class="keywordflow">if</span> (k % 2)</div>
+<div class="line"><a name="l02353"></a><span class="lineno"> 2353</span>                 ip_unull[m] += quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02354"></a><span class="lineno"> 2354</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l02355"></a><span class="lineno"> 2355</span>                 ip_unull[m] -= quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02356"></a><span class="lineno"> 2356</span>             }</div>
+<div class="line"><a name="l02357"></a><span class="lineno"> 2357</span>         }</div>
+<div class="line"><a name="l02358"></a><span class="lineno"> 2358</span>         }</div>
+<div class="line"><a name="l02359"></a><span class="lineno"> 2359</span> </div>
+<div class="line"><a name="l02360"></a><span class="lineno"> 2360</span>         <span class="comment">/* Error map */</span></div>
+<div class="line"><a name="l02361"></a><span class="lineno"> 2361</span> </div>
+<div class="line"><a name="l02362"></a><span class="lineno"> 2362</span>         pos   = fors_find_angle_pos(angles, nscience, 0.0);</div>
+<div class="line"><a name="l02363"></a><span class="lineno"> 2363</span> </div>
+<div class="line"><a name="l02364"></a><span class="lineno"> 2364</span>         data = cpl_image_get_data_float(reduceds[pos]);</div>
+<div class="line"><a name="l02365"></a><span class="lineno"> 2365</span>         iffq  = data +  2 * (nobjects - 1 - j)      * nx;</div>
+<div class="line"><a name="l02366"></a><span class="lineno"> 2366</span> </div>
+<div class="line"><a name="l02367"></a><span class="lineno"> 2367</span>         data = cpl_image_get_data_float(rerrors[pos]);</div>
+<div class="line"><a name="l02368"></a><span class="lineno"> 2368</span>         ierrq = data +  2 * (nobjects - 1 - j)      * nx;</div>
+<div class="line"><a name="l02369"></a><span class="lineno"> 2369</span>         </div>
+<div class="line"><a name="l02370"></a><span class="lineno"> 2370</span>         pos   = fors_find_angle_pos(angles, nscience, 22.5);</div>
+<div class="line"><a name="l02371"></a><span class="lineno"> 2371</span> </div>
+<div class="line"><a name="l02372"></a><span class="lineno"> 2372</span>         data = cpl_image_get_data_float(reduceds[pos]);</div>
+<div class="line"><a name="l02373"></a><span class="lineno"> 2373</span>         iffu  = data +  2 * (nobjects - 1 - j)      * nx;</div>
+<div class="line"><a name="l02374"></a><span class="lineno"> 2374</span> </div>
+<div class="line"><a name="l02375"></a><span class="lineno"> 2375</span>         data = cpl_image_get_data_float(rerrors[pos]);</div>
+<div class="line"><a name="l02376"></a><span class="lineno"> 2376</span>         ierru = data +  2 * (nobjects - 1 - j)      * nx;</div>
+<div class="line"><a name="l02377"></a><span class="lineno"> 2377</span> </div>
+<div class="line"><a name="l02378"></a><span class="lineno"> 2378</span>         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l02379"></a><span class="lineno"> 2379</span> </div>
+<div class="line"><a name="l02380"></a><span class="lineno"> 2380</span>         <span class="keywordtype">double</span> radicand; </div>
+<div class="line"><a name="l02381"></a><span class="lineno"> 2381</span> </div>
+<div class="line"><a name="l02382"></a><span class="lineno"> 2382</span>         ipqerr[m] = iffq[m] <= 0.0 ? </div>
+<div class="line"><a name="l02383"></a><span class="lineno"> 2383</span>             0.0 : ierrq[m] / iffq[m] * 0.5 / sqrt (nscience / 4);</div>
+<div class="line"><a name="l02384"></a><span class="lineno"> 2384</span> </div>
+<div class="line"><a name="l02385"></a><span class="lineno"> 2385</span>         ipuerr[m] = iffu[m] <= 0.0 ? </div>
+<div class="line"><a name="l02386"></a><span class="lineno"> 2386</span>             0.0 : ierru[m] / iffu[m] * 0.5 / sqrt (nscience / 4);</div>
+<div class="line"><a name="l02387"></a><span class="lineno"> 2387</span> </div>
+<div class="line"><a name="l02388"></a><span class="lineno"> 2388</span>         iplerr[m] = CPL_MATH_SQRT1_2 * 0.5 * (ipqerr[m] + ipuerr[m]);</div>
+<div class="line"><a name="l02389"></a><span class="lineno"> 2389</span> </div>
+<div class="line"><a name="l02390"></a><span class="lineno"> 2390</span> <span class="comment">/* Added: */</span></div>
+<div class="line"><a name="l02391"></a><span class="lineno"> 2391</span>         <span class="keywordflow">if</span> (chromatism) {</div>
+<div class="line"><a name="l02392"></a><span class="lineno"> 2392</span>             ip_q[m] = ip_q[m] * cos(2 * correct[m]) - </div>
+<div class="line"><a name="l02393"></a><span class="lineno"> 2393</span>                               ip_u[m] * sin(2 * correct[m]);</div>
+<div class="line"><a name="l02394"></a><span class="lineno"> 2394</span> </div>
+<div class="line"><a name="l02395"></a><span class="lineno"> 2395</span>             ip_u[m] = ip_q[m] * sin(2 * correct[m]) + </div>
+<div class="line"><a name="l02396"></a><span class="lineno"> 2396</span>                               ip_u[m] * cos(2 * correct[m]);</div>
+<div class="line"><a name="l02397"></a><span class="lineno"> 2397</span>         }</div>
+<div class="line"><a name="l02398"></a><span class="lineno"> 2398</span> <span class="comment">/* End added */</span></div>
+<div class="line"><a name="l02399"></a><span class="lineno"> 2399</span> </div>
+<div class="line"><a name="l02400"></a><span class="lineno"> 2400</span>         <span class="comment">/* PL computation */</span></div>
+<div class="line"><a name="l02401"></a><span class="lineno"> 2401</span>         ip_l[m] = sqrt(ip_u[m] * ip_u[m] + ip_q[m] * ip_q[m]);</div>
+<div class="line"><a name="l02402"></a><span class="lineno"> 2402</span> </div>
+<div class="line"><a name="l02403"></a><span class="lineno"> 2403</span>         <span class="comment">/* P angle computation */</span></div>
+<div class="line"><a name="l02404"></a><span class="lineno"> 2404</span>         ipang[m] = (ip_q[m] == 0.0 ?</div>
+<div class="line"><a name="l02405"></a><span class="lineno"> 2405</span>             (ip_u[m] > 0.0 ? 45.0 : 135.0)</div>
+<div class="line"><a name="l02406"></a><span class="lineno"> 2406</span>             : 0.5 * (atan2(ip_u[m], ip_q[m]) * 180 / M_PI + </div>
+<div class="line"><a name="l02407"></a><span class="lineno"> 2407</span>                  ((atan2(ip_u[m], ip_q[m]) > 0.0 ? 0.0 : 360.0))));</div>
+<div class="line"><a name="l02408"></a><span class="lineno"> 2408</span> </div>
+<div class="line"><a name="l02409"></a><span class="lineno"> 2409</span>         <span class="comment">/* Error on the angle computation */</span></div>
+<div class="line"><a name="l02410"></a><span class="lineno"> 2410</span>         radicand = ip_q[m] * ip_q[m] * ipuerr[m] * ipuerr[m] + </div>
+<div class="line"><a name="l02411"></a><span class="lineno"> 2411</span>                    ip_u[m] * ip_u[m] * ipqerr[m] * ipqerr[m];</div>
+<div class="line"><a name="l02412"></a><span class="lineno"> 2412</span>   </div>
+<div class="line"><a name="l02413"></a><span class="lineno"> 2413</span>         ipangerr[m] = ip_l[m] == 0.0 ? 0.0 :</div>
+<div class="line"><a name="l02414"></a><span class="lineno"> 2414</span>              sqrt(radicand) * 0.5 / (ip_l[m] * ip_l[m]) * 180 / M_PI;</div>
+<div class="line"><a name="l02415"></a><span class="lineno"> 2415</span> </div>
+<div class="line"><a name="l02416"></a><span class="lineno"> 2416</span>                 <span class="comment">/* </span></div>
+<div class="line"><a name="l02417"></a><span class="lineno"> 2417</span> <span class="comment">                 * Note: no need to apply chromatism correction to angle,</span></div>
+<div class="line"><a name="l02418"></a><span class="lineno"> 2418</span> <span class="comment">                 * it is implicit in Q and U correction applied before.</span></div>
+<div class="line"><a name="l02419"></a><span class="lineno"> 2419</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l02420"></a><span class="lineno"> 2420</span> </div>
+<div class="line"><a name="l02421"></a><span class="lineno"> 2421</span> <span class="comment">/* Removed: </span></div>
+<div class="line"><a name="l02422"></a><span class="lineno"> 2422</span> <span class="comment">        if (chromatism) {</span></div>
+<div class="line"><a name="l02423"></a><span class="lineno"> 2423</span> <span class="comment">            ipang[m] -= correct[m];</span></div>
+<div class="line"><a name="l02424"></a><span class="lineno"> 2424</span> <span class="comment">        </span></div>
+<div class="line"><a name="l02425"></a><span class="lineno"> 2425</span> <span class="comment">            ip_q[m] = ip_q[m] * cos(2 * correct[m]) - </span></div>
+<div class="line"><a name="l02426"></a><span class="lineno"> 2426</span> <span class="comment">                              ip_u[m] * sin(2 * correct[m]);</span></div>
+<div class="line"><a name="l02427"></a><span class="lineno"> 2427</span> <span class="comment"></span></div>
+<div class="line"><a name="l02428"></a><span class="lineno"> 2428</span> <span class="comment">            ip_u[m] = ip_q[m] * sin(2 * correct[m]) + </span></div>
+<div class="line"><a name="l02429"></a><span class="lineno"> 2429</span> <span class="comment">                              ip_u[m] * cos(2 * correct[m]);</span></div>
+<div class="line"><a name="l02430"></a><span class="lineno"> 2430</span> <span class="comment">        </span></div>
+<div class="line"><a name="l02431"></a><span class="lineno"> 2431</span> <span class="comment">        }</span></div>
+<div class="line"><a name="l02432"></a><span class="lineno"> 2432</span> <span class="comment">  end removed */</span></div>
+<div class="line"><a name="l02433"></a><span class="lineno"> 2433</span>         }</div>
+<div class="line"><a name="l02434"></a><span class="lineno"> 2434</span> </div>
+<div class="line"><a name="l02435"></a><span class="lineno"> 2435</span>         <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02436"></a><span class="lineno"> 2436</span>         <span class="keywordtype">float</span> * weights;</div>
+<div class="line"><a name="l02437"></a><span class="lineno"> 2437</span>         <span class="keywordtype">float</span>   max, sum, sum2, imean;</div>
+<div class="line"><a name="l02438"></a><span class="lineno"> 2438</span> </div>
+<div class="line"><a name="l02439"></a><span class="lineno"> 2439</span>         <span class="keywordtype">int</span> k;</div>
+<div class="line"><a name="l02440"></a><span class="lineno"> 2440</span> </div>
+<div class="line"><a name="l02441"></a><span class="lineno"> 2441</span>         <span class="comment">/* QC on U NULL */</span></div>
+<div class="line"><a name="l02442"></a><span class="lineno"> 2442</span>         weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);</div>
+<div class="line"><a name="l02443"></a><span class="lineno"> 2443</span> </div>
+<div class="line"><a name="l02444"></a><span class="lineno"> 2444</span>         max = 0.0;</div>
+<div class="line"><a name="l02445"></a><span class="lineno"> 2445</span>         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02446"></a><span class="lineno"> 2446</span>             <span class="keywordflow">if</span> (max < iffq[k]) max = iffq[k];</div>
+<div class="line"><a name="l02447"></a><span class="lineno"> 2447</span>         }</div>
+<div class="line"><a name="l02448"></a><span class="lineno"> 2448</span>         </div>
+<div class="line"><a name="l02449"></a><span class="lineno"> 2449</span>         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02450"></a><span class="lineno"> 2450</span>             weights[k] = iffq[k] < 0.0 ? </div>
+<div class="line"><a name="l02451"></a><span class="lineno"> 2451</span>             0.0 : iffq[k] * iffq[k] / (max * max);</div>
+<div class="line"><a name="l02452"></a><span class="lineno"> 2452</span>         }</div>
+<div class="line"><a name="l02453"></a><span class="lineno"> 2453</span>         </div>
+<div class="line"><a name="l02454"></a><span class="lineno"> 2454</span>         sum  = 0.0;</div>
+<div class="line"><a name="l02455"></a><span class="lineno"> 2455</span>         sum2 = 0.0;</div>
+<div class="line"><a name="l02456"></a><span class="lineno"> 2456</span>         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02457"></a><span class="lineno"> 2457</span>             sum  += weights[k] * ip_qnull[k];</div>
+<div class="line"><a name="l02458"></a><span class="lineno"> 2458</span>             sum2 += weights[k];</div>
+<div class="line"><a name="l02459"></a><span class="lineno"> 2459</span>         }</div>
+<div class="line"><a name="l02460"></a><span class="lineno"> 2460</span> </div>
+<div class="line"><a name="l02461"></a><span class="lineno"> 2461</span>         cpl_free(weights);</div>
+<div class="line"><a name="l02462"></a><span class="lineno"> 2462</span> </div>
+<div class="line"><a name="l02463"></a><span class="lineno"> 2463</span>         imean = sum / sum2;</div>
+<div class="line"><a name="l02464"></a><span class="lineno"> 2464</span> </div>
+<div class="line"><a name="l02465"></a><span class="lineno"> 2465</span>         mean_qnull += (imean - mean_qnull) / (j + 1.0);</div>
+<div class="line"><a name="l02466"></a><span class="lineno"> 2466</span>           </div>
+<div class="line"><a name="l02467"></a><span class="lineno"> 2467</span>         <span class="comment">/* QC on U NULL */</span></div>
+<div class="line"><a name="l02468"></a><span class="lineno"> 2468</span>         weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);</div>
+<div class="line"><a name="l02469"></a><span class="lineno"> 2469</span>         </div>
+<div class="line"><a name="l02470"></a><span class="lineno"> 2470</span>         max = 0.0;</div>
+<div class="line"><a name="l02471"></a><span class="lineno"> 2471</span>         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02472"></a><span class="lineno"> 2472</span>             <span class="keywordflow">if</span> (max < iffu[k]) max = iffu[k];</div>
+<div class="line"><a name="l02473"></a><span class="lineno"> 2473</span>         }</div>
+<div class="line"><a name="l02474"></a><span class="lineno"> 2474</span>         </div>
+<div class="line"><a name="l02475"></a><span class="lineno"> 2475</span>         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02476"></a><span class="lineno"> 2476</span>             weights[k] = iffu[k] < 0.0 ? </div>
+<div class="line"><a name="l02477"></a><span class="lineno"> 2477</span>             0.0 : iffu[k] * iffu[k] / (max * max);</div>
+<div class="line"><a name="l02478"></a><span class="lineno"> 2478</span>         }</div>
+<div class="line"><a name="l02479"></a><span class="lineno"> 2479</span>         </div>
+<div class="line"><a name="l02480"></a><span class="lineno"> 2480</span>         sum  = 0.0;</div>
+<div class="line"><a name="l02481"></a><span class="lineno"> 2481</span>         sum2 = 0.0;</div>
+<div class="line"><a name="l02482"></a><span class="lineno"> 2482</span>         <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02483"></a><span class="lineno"> 2483</span>             sum  += weights[k] * ip_unull[k];</div>
+<div class="line"><a name="l02484"></a><span class="lineno"> 2484</span>             sum2 += weights[k];</div>
+<div class="line"><a name="l02485"></a><span class="lineno"> 2485</span>         }</div>
+<div class="line"><a name="l02486"></a><span class="lineno"> 2486</span> </div>
+<div class="line"><a name="l02487"></a><span class="lineno"> 2487</span>         cpl_free(weights);</div>
+<div class="line"><a name="l02488"></a><span class="lineno"> 2488</span> </div>
+<div class="line"><a name="l02489"></a><span class="lineno"> 2489</span>         imean = sum / sum2;</div>
+<div class="line"><a name="l02490"></a><span class="lineno"> 2490</span> </div>
+<div class="line"><a name="l02491"></a><span class="lineno"> 2491</span>         mean_unull += (imean - mean_unull) / (j + 1.0);</div>
+<div class="line"><a name="l02492"></a><span class="lineno"> 2492</span>         }</div>
+<div class="line"><a name="l02493"></a><span class="lineno"> 2493</span>     }</div>
+<div class="line"><a name="l02494"></a><span class="lineno"> 2494</span> </div>
+<div class="line"><a name="l02495"></a><span class="lineno"> 2495</span>     cpl_image_delete(correct_im);</div>
+<div class="line"><a name="l02496"></a><span class="lineno"> 2496</span> </div>
+<div class="line"><a name="l02497"></a><span class="lineno"> 2497</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pq_im, reduced_q_tag, header, </div>
+<div class="line"><a name="l02498"></a><span class="lineno"> 2498</span>                parlist, recipe, version))</div>
+<div class="line"><a name="l02499"></a><span class="lineno"> 2499</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02500"></a><span class="lineno"> 2500</span> </div>
+<div class="line"><a name="l02501"></a><span class="lineno"> 2501</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pu_im, reduced_u_tag, header, </div>
+<div class="line"><a name="l02502"></a><span class="lineno"> 2502</span>                parlist, recipe, version))</div>
+<div class="line"><a name="l02503"></a><span class="lineno"> 2503</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02504"></a><span class="lineno"> 2504</span> </div>
+<div class="line"><a name="l02505"></a><span class="lineno"> 2505</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pl_im, reduced_l_tag, header, </div>
+<div class="line"><a name="l02506"></a><span class="lineno"> 2506</span>                parlist, recipe, version))</div>
+<div class="line"><a name="l02507"></a><span class="lineno"> 2507</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02508"></a><span class="lineno"> 2508</span> </div>
+<div class="line"><a name="l02509"></a><span class="lineno"> 2509</span>     <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02510"></a><span class="lineno"> 2510</span>         <span class="keywordtype">char</span> *pipefile; </div>
+<div class="line"><a name="l02511"></a><span class="lineno"> 2511</span>             <span class="keywordtype">char</span> *keyname;</div>
+<div class="line"><a name="l02512"></a><span class="lineno"> 2512</span>         cpl_propertylist *qheader = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, </div>
+<div class="line"><a name="l02513"></a><span class="lineno"> 2513</span>                                                         science_tag, 0);</div>
+<div class="line"><a name="l02514"></a><span class="lineno"> 2514</span> </div>
+<div class="line"><a name="l02515"></a><span class="lineno"> 2515</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l02516"></a><span class="lineno"> 2516</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l02517"></a><span class="lineno"> 2517</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l02518"></a><span class="lineno"> 2518</span>                                startwavelength + dispersion/2);</div>
+<div class="line"><a name="l02519"></a><span class="lineno"> 2519</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l02520"></a><span class="lineno"> 2520</span>             <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l02521"></a><span class="lineno"> 2521</span> <span class="comment">               cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l02522"></a><span class="lineno"> 2522</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l02523"></a><span class="lineno"> 2523</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l02524"></a><span class="lineno"> 2524</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l02525"></a><span class="lineno"> 2525</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l02526"></a><span class="lineno"> 2526</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l02527"></a><span class="lineno"> 2527</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l02528"></a><span class="lineno"> 2528</span> </div>
+<div class="line"><a name="l02529"></a><span class="lineno"> 2529</span>         <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);</div>
+<div class="line"><a name="l02530"></a><span class="lineno"> 2530</span> </div>
+<div class="line"><a name="l02531"></a><span class="lineno"> 2531</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02532"></a><span class="lineno"> 2532</span> <span class="comment">         * QC1 group header</span></div>
+<div class="line"><a name="l02533"></a><span class="lineno"> 2533</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02534"></a><span class="lineno"> 2534</span> </div>
+<div class="line"><a name="l02535"></a><span class="lineno"> 2535</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_q_tag,</div>
+<div class="line"><a name="l02536"></a><span class="lineno"> 2536</span>                      <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l02537"></a><span class="lineno"> 2537</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write product category to "</span></div>
+<div class="line"><a name="l02538"></a><span class="lineno"> 2538</span>                      <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l02539"></a><span class="lineno"> 2539</span> </div>
+<div class="line"><a name="l02540"></a><span class="lineno"> 2540</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l02541"></a><span class="lineno"> 2541</span>                        <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l02542"></a><span class="lineno"> 2542</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DPR TYPE in arc "</span></div>
+<div class="line"><a name="l02543"></a><span class="lineno"> 2543</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02544"></a><span class="lineno"> 2544</span> </div>
+<div class="line"><a name="l02545"></a><span class="lineno"> 2545</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l02546"></a><span class="lineno"> 2546</span>                        <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l02547"></a><span class="lineno"> 2547</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword TPL ID in arc "</span></div>
+<div class="line"><a name="l02548"></a><span class="lineno"> 2548</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02549"></a><span class="lineno"> 2549</span> </div>
+<div class="line"><a name="l02550"></a><span class="lineno"> 2550</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l02551"></a><span class="lineno"> 2551</span>                        <span class="stringliteral">"Grism name"</span>, instrume))</div>
+<div class="line"><a name="l02552"></a><span class="lineno"> 2552</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in arc "</span></div>
+<div class="line"><a name="l02553"></a><span class="lineno"> 2553</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02554"></a><span class="lineno"> 2554</span> </div>
+<div class="line"><a name="l02555"></a><span class="lineno"> 2555</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,</div>
+<div class="line"><a name="l02556"></a><span class="lineno"> 2556</span>                        <span class="stringliteral">"Grism identifier"</span>, instrume))</div>
+<div class="line"><a name="l02557"></a><span class="lineno"> 2557</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in arc "</span></div>
+<div class="line"><a name="l02558"></a><span class="lineno"> 2558</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02559"></a><span class="lineno"> 2559</span> </div>
+<div class="line"><a name="l02560"></a><span class="lineno"> 2560</span>         <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))</div>
+<div class="line"><a name="l02561"></a><span class="lineno"> 2561</span>         <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l02562"></a><span class="lineno"> 2562</span>                        <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l02563"></a><span class="lineno"> 2563</span> </div>
+<div class="line"><a name="l02564"></a><span class="lineno"> 2564</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,</div>
+<div class="line"><a name="l02565"></a><span class="lineno"> 2565</span>                        <span class="stringliteral">"Collimator name"</span>, instrume))</div>
+<div class="line"><a name="l02566"></a><span class="lineno"> 2566</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in arc "</span></div>
+<div class="line"><a name="l02567"></a><span class="lineno"> 2567</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02568"></a><span class="lineno"> 2568</span> </div>
+<div class="line"><a name="l02569"></a><span class="lineno"> 2569</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l02570"></a><span class="lineno"> 2570</span>                        <span class="stringliteral">"Chip identifier"</span>, instrume))</div>
+<div class="line"><a name="l02571"></a><span class="lineno"> 2571</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in arc "</span></div>
+<div class="line"><a name="l02572"></a><span class="lineno"> 2572</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02573"></a><span class="lineno"> 2573</span> </div>
+<div class="line"><a name="l02574"></a><span class="lineno"> 2574</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l02575"></a><span class="lineno"> 2575</span>                        <span class="stringliteral">"Archive name of input data"</span>, </div>
+<div class="line"><a name="l02576"></a><span class="lineno"> 2576</span>                        instrume))</div>
+<div class="line"><a name="l02577"></a><span class="lineno"> 2577</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ARCFILE in arc "</span></div>
+<div class="line"><a name="l02578"></a><span class="lineno"> 2578</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02579"></a><span class="lineno"> 2579</span> </div>
+<div class="line"><a name="l02580"></a><span class="lineno"> 2580</span>         pipefile = dfs_generate_filename_tfits(reduced_nul_q_tag);</div>
+<div class="line"><a name="l02581"></a><span class="lineno"> 2581</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l02582"></a><span class="lineno"> 2582</span>                      <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l02583"></a><span class="lineno"> 2583</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);</div>
+<div class="line"><a name="l02584"></a><span class="lineno"> 2584</span>         cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l02585"></a><span class="lineno"> 2585</span> </div>
+<div class="line"><a name="l02586"></a><span class="lineno"> 2586</span> </div>
+<div class="line"><a name="l02587"></a><span class="lineno"> 2587</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02588"></a><span class="lineno"> 2588</span> <span class="comment">         * QC1 parameters</span></div>
+<div class="line"><a name="l02589"></a><span class="lineno"> 2589</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02590"></a><span class="lineno"> 2590</span> </div>
+<div class="line"><a name="l02591"></a><span class="lineno"> 2591</span>         keyname = <span class="stringliteral">"QC.NULL.Q.MEAN"</span>;</div>
+<div class="line"><a name="l02592"></a><span class="lineno"> 2592</span>             </div>
+<div class="line"><a name="l02593"></a><span class="lineno"> 2593</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qheader, mean_qnull,</div>
+<div class="line"><a name="l02594"></a><span class="lineno"> 2594</span>                     keyname, NULL,</div>
+<div class="line"><a name="l02595"></a><span class="lineno"> 2595</span>                     <span class="stringliteral">"Mean Q null parameter"</span>,</div>
+<div class="line"><a name="l02596"></a><span class="lineno"> 2596</span>                     instrume)) {</div>
+<div class="line"><a name="l02597"></a><span class="lineno"> 2597</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write mean Q null parameter "</span></div>
+<div class="line"><a name="l02598"></a><span class="lineno"> 2598</span>                      <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l02599"></a><span class="lineno"> 2599</span>         }</div>
+<div class="line"><a name="l02600"></a><span class="lineno"> 2600</span> </div>
+<div class="line"><a name="l02601"></a><span class="lineno"> 2601</span>         <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l02602"></a><span class="lineno"> 2602</span> </div>
+<div class="line"><a name="l02603"></a><span class="lineno"> 2603</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pqnull_im, reduced_nul_q_tag, qheader, </div>
+<div class="line"><a name="l02604"></a><span class="lineno"> 2604</span>                    parlist, recipe, version))</div>
+<div class="line"><a name="l02605"></a><span class="lineno"> 2605</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02606"></a><span class="lineno"> 2606</span> </div>
+<div class="line"><a name="l02607"></a><span class="lineno"> 2607</span>         cpl_propertylist_delete(qheader);</div>
+<div class="line"><a name="l02608"></a><span class="lineno"> 2608</span> </div>
+<div class="line"><a name="l02609"></a><span class="lineno"> 2609</span>         qheader = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l02610"></a><span class="lineno"> 2610</span> </div>
+<div class="line"><a name="l02611"></a><span class="lineno"> 2611</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l02612"></a><span class="lineno"> 2612</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l02613"></a><span class="lineno"> 2613</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l02614"></a><span class="lineno"> 2614</span>                                startwavelength + dispersion/2);</div>
+<div class="line"><a name="l02615"></a><span class="lineno"> 2615</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l02616"></a><span class="lineno"> 2616</span>             <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l02617"></a><span class="lineno"> 2617</span> <span class="comment">               cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l02618"></a><span class="lineno"> 2618</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l02619"></a><span class="lineno"> 2619</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l02620"></a><span class="lineno"> 2620</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l02621"></a><span class="lineno"> 2621</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l02622"></a><span class="lineno"> 2622</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l02623"></a><span class="lineno"> 2623</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l02624"></a><span class="lineno"> 2624</span> </div>
+<div class="line"><a name="l02625"></a><span class="lineno"> 2625</span>         <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);</div>
+<div class="line"><a name="l02626"></a><span class="lineno"> 2626</span> </div>
+<div class="line"><a name="l02627"></a><span class="lineno"> 2627</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02628"></a><span class="lineno"> 2628</span> <span class="comment">         * QC1 group header</span></div>
+<div class="line"><a name="l02629"></a><span class="lineno"> 2629</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02630"></a><span class="lineno"> 2630</span> </div>
+<div class="line"><a name="l02631"></a><span class="lineno"> 2631</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_u_tag,</div>
+<div class="line"><a name="l02632"></a><span class="lineno"> 2632</span>                      <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l02633"></a><span class="lineno"> 2633</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write product category to "</span></div>
+<div class="line"><a name="l02634"></a><span class="lineno"> 2634</span>                      <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l02635"></a><span class="lineno"> 2635</span> </div>
+<div class="line"><a name="l02636"></a><span class="lineno"> 2636</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l02637"></a><span class="lineno"> 2637</span>                        <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l02638"></a><span class="lineno"> 2638</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DPR TYPE in arc "</span></div>
+<div class="line"><a name="l02639"></a><span class="lineno"> 2639</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02640"></a><span class="lineno"> 2640</span> </div>
+<div class="line"><a name="l02641"></a><span class="lineno"> 2641</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l02642"></a><span class="lineno"> 2642</span>                        <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l02643"></a><span class="lineno"> 2643</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword TPL ID in arc "</span></div>
+<div class="line"><a name="l02644"></a><span class="lineno"> 2644</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02645"></a><span class="lineno"> 2645</span> </div>
+<div class="line"><a name="l02646"></a><span class="lineno"> 2646</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l02647"></a><span class="lineno"> 2647</span>                        <span class="stringliteral">"Grism name"</span>, instrume))</div>
+<div class="line"><a name="l02648"></a><span class="lineno"> 2648</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in arc "</span></div>
+<div class="line"><a name="l02649"></a><span class="lineno"> 2649</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02650"></a><span class="lineno"> 2650</span> </div>
+<div class="line"><a name="l02651"></a><span class="lineno"> 2651</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,</div>
+<div class="line"><a name="l02652"></a><span class="lineno"> 2652</span>                        <span class="stringliteral">"Grism identifier"</span>, instrume))</div>
+<div class="line"><a name="l02653"></a><span class="lineno"> 2653</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in arc "</span></div>
+<div class="line"><a name="l02654"></a><span class="lineno"> 2654</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02655"></a><span class="lineno"> 2655</span> </div>
+<div class="line"><a name="l02656"></a><span class="lineno"> 2656</span>         <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))</div>
+<div class="line"><a name="l02657"></a><span class="lineno"> 2657</span>         <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l02658"></a><span class="lineno"> 2658</span>                        <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l02659"></a><span class="lineno"> 2659</span> </div>
+<div class="line"><a name="l02660"></a><span class="lineno"> 2660</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,</div>
+<div class="line"><a name="l02661"></a><span class="lineno"> 2661</span>                        <span class="stringliteral">"Collimator name"</span>, instrume))</div>
+<div class="line"><a name="l02662"></a><span class="lineno"> 2662</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in arc "</span></div>
+<div class="line"><a name="l02663"></a><span class="lineno"> 2663</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02664"></a><span class="lineno"> 2664</span> </div>
+<div class="line"><a name="l02665"></a><span class="lineno"> 2665</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l02666"></a><span class="lineno"> 2666</span>                        <span class="stringliteral">"Chip identifier"</span>, instrume))</div>
+<div class="line"><a name="l02667"></a><span class="lineno"> 2667</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in arc "</span></div>
+<div class="line"><a name="l02668"></a><span class="lineno"> 2668</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02669"></a><span class="lineno"> 2669</span> </div>
+<div class="line"><a name="l02670"></a><span class="lineno"> 2670</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l02671"></a><span class="lineno"> 2671</span>                        <span class="stringliteral">"Archive name of input data"</span>, </div>
+<div class="line"><a name="l02672"></a><span class="lineno"> 2672</span>                        instrume))</div>
+<div class="line"><a name="l02673"></a><span class="lineno"> 2673</span>         fors_pmos_extract_exit(<span class="stringliteral">"Missing keyword ARCFILE in arc "</span></div>
+<div class="line"><a name="l02674"></a><span class="lineno"> 2674</span>                      <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l02675"></a><span class="lineno"> 2675</span> </div>
+<div class="line"><a name="l02676"></a><span class="lineno"> 2676</span>         pipefile = dfs_generate_filename_tfits(reduced_nul_u_tag);</div>
+<div class="line"><a name="l02677"></a><span class="lineno"> 2677</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l02678"></a><span class="lineno"> 2678</span>                      <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l02679"></a><span class="lineno"> 2679</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);</div>
+<div class="line"><a name="l02680"></a><span class="lineno"> 2680</span>         cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l02681"></a><span class="lineno"> 2681</span> </div>
+<div class="line"><a name="l02682"></a><span class="lineno"> 2682</span> </div>
+<div class="line"><a name="l02683"></a><span class="lineno"> 2683</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02684"></a><span class="lineno"> 2684</span> <span class="comment">         * QC1 parameters</span></div>
+<div class="line"><a name="l02685"></a><span class="lineno"> 2685</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02686"></a><span class="lineno"> 2686</span> </div>
+<div class="line"><a name="l02687"></a><span class="lineno"> 2687</span>         keyname = <span class="stringliteral">"QC.NULL.U.MEAN"</span>;</div>
+<div class="line"><a name="l02688"></a><span class="lineno"> 2688</span>             </div>
+<div class="line"><a name="l02689"></a><span class="lineno"> 2689</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qheader, mean_unull,</div>
+<div class="line"><a name="l02690"></a><span class="lineno"> 2690</span>                     keyname, NULL,</div>
+<div class="line"><a name="l02691"></a><span class="lineno"> 2691</span>                     <span class="stringliteral">"Mean U null parameter"</span>,</div>
+<div class="line"><a name="l02692"></a><span class="lineno"> 2692</span>                     instrume)) {</div>
+<div class="line"><a name="l02693"></a><span class="lineno"> 2693</span>         fors_pmos_extract_exit(<span class="stringliteral">"Cannot write mean U null parameter "</span></div>
+<div class="line"><a name="l02694"></a><span class="lineno"> 2694</span>                      <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l02695"></a><span class="lineno"> 2695</span>         }</div>
+<div class="line"><a name="l02696"></a><span class="lineno"> 2696</span> </div>
+<div class="line"><a name="l02697"></a><span class="lineno"> 2697</span>         <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l02698"></a><span class="lineno"> 2698</span> </div>
+<div class="line"><a name="l02699"></a><span class="lineno"> 2699</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, punull_im, reduced_nul_u_tag, qheader, </div>
+<div class="line"><a name="l02700"></a><span class="lineno"> 2700</span>                    parlist, recipe, version))</div>
+<div class="line"><a name="l02701"></a><span class="lineno"> 2701</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02702"></a><span class="lineno"> 2702</span> </div>
+<div class="line"><a name="l02703"></a><span class="lineno"> 2703</span>         cpl_propertylist_delete(qheader);</div>
+<div class="line"><a name="l02704"></a><span class="lineno"> 2704</span>     }</div>
+<div class="line"><a name="l02705"></a><span class="lineno"> 2705</span> </div>
+<div class="line"><a name="l02706"></a><span class="lineno"> 2706</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pqerr_im, reduced_error_q_tag, header, </div>
+<div class="line"><a name="l02707"></a><span class="lineno"> 2707</span>                parlist, recipe, version))</div>
+<div class="line"><a name="l02708"></a><span class="lineno"> 2708</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02709"></a><span class="lineno"> 2709</span> </div>
+<div class="line"><a name="l02710"></a><span class="lineno"> 2710</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, puerr_im, reduced_error_u_tag, header, </div>
+<div class="line"><a name="l02711"></a><span class="lineno"> 2711</span>                parlist, recipe, version))</div>
+<div class="line"><a name="l02712"></a><span class="lineno"> 2712</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02713"></a><span class="lineno"> 2713</span> </div>
+<div class="line"><a name="l02714"></a><span class="lineno"> 2714</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, plerr_im, reduced_error_l_tag, header, </div>
+<div class="line"><a name="l02715"></a><span class="lineno"> 2715</span>                parlist, recipe, version))</div>
+<div class="line"><a name="l02716"></a><span class="lineno"> 2716</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02717"></a><span class="lineno"> 2717</span> </div>
+<div class="line"><a name="l02718"></a><span class="lineno"> 2718</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pang_im, reduced_angle_tag, header, </div>
+<div class="line"><a name="l02719"></a><span class="lineno"> 2719</span>                parlist, recipe, version))</div>
+<div class="line"><a name="l02720"></a><span class="lineno"> 2720</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02721"></a><span class="lineno"> 2721</span> </div>
+<div class="line"><a name="l02722"></a><span class="lineno"> 2722</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pangerr_im, reduced_error_angle_tag, </div>
+<div class="line"><a name="l02723"></a><span class="lineno"> 2723</span>                header, parlist, recipe, version))</div>
+<div class="line"><a name="l02724"></a><span class="lineno"> 2724</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02725"></a><span class="lineno"> 2725</span> </div>
+<div class="line"><a name="l02726"></a><span class="lineno"> 2726</span>     cpl_image_delete(pq_im);</div>
+<div class="line"><a name="l02727"></a><span class="lineno"> 2727</span>     cpl_image_delete(pu_im);</div>
+<div class="line"><a name="l02728"></a><span class="lineno"> 2728</span>     cpl_image_delete(pl_im);</div>
+<div class="line"><a name="l02729"></a><span class="lineno"> 2729</span> </div>
+<div class="line"><a name="l02730"></a><span class="lineno"> 2730</span>     cpl_image_delete(pqnull_im);</div>
+<div class="line"><a name="l02731"></a><span class="lineno"> 2731</span>     cpl_image_delete(punull_im);</div>
+<div class="line"><a name="l02732"></a><span class="lineno"> 2732</span> </div>
+<div class="line"><a name="l02733"></a><span class="lineno"> 2733</span>     cpl_image_delete(pqerr_im);</div>
+<div class="line"><a name="l02734"></a><span class="lineno"> 2734</span>     cpl_image_delete(puerr_im);</div>
+<div class="line"><a name="l02735"></a><span class="lineno"> 2735</span>     cpl_image_delete(plerr_im);</div>
+<div class="line"><a name="l02736"></a><span class="lineno"> 2736</span>     cpl_image_delete(pang_im);</div>
+<div class="line"><a name="l02737"></a><span class="lineno"> 2737</span>     cpl_image_delete(pangerr_im);</div>
+<div class="line"><a name="l02738"></a><span class="lineno"> 2738</span>     }</div>
+<div class="line"><a name="l02739"></a><span class="lineno"> 2739</span> </div>
+<div class="line"><a name="l02740"></a><span class="lineno"> 2740</span>     cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l02741"></a><span class="lineno"> 2741</span> </div>
+<div class="line"><a name="l02742"></a><span class="lineno"> 2742</span>     <span class="comment">/* End of Stokes computation */</span></div>
+<div class="line"><a name="l02743"></a><span class="lineno"> 2743</span> </div>
+<div class="line"><a name="l02744"></a><span class="lineno"> 2744</span>     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {</div>
+<div class="line"><a name="l02745"></a><span class="lineno"> 2745</span>     cpl_image_delete(reduceds[j]);</div>
+<div class="line"><a name="l02746"></a><span class="lineno"> 2746</span>     cpl_image_delete(rerrors[j]);</div>
+<div class="line"><a name="l02747"></a><span class="lineno"> 2747</span>     cpl_table_delete(slitss[j]);</div>
+<div class="line"><a name="l02748"></a><span class="lineno"> 2748</span>     cpl_image_delete(mappeds[j]);</div>
+<div class="line"><a name="l02749"></a><span class="lineno"> 2749</span>     }</div>
+<div class="line"><a name="l02750"></a><span class="lineno"> 2750</span> </div>
+<div class="line"><a name="l02751"></a><span class="lineno"> 2751</span>     cpl_free(reduceds);</div>
+<div class="line"><a name="l02752"></a><span class="lineno"> 2752</span>     cpl_free(rerrors);</div>
+<div class="line"><a name="l02753"></a><span class="lineno"> 2753</span>     cpl_free(slitss);</div>
+<div class="line"><a name="l02754"></a><span class="lineno"> 2754</span>     cpl_free(mappeds);</div>
+<div class="line"><a name="l02755"></a><span class="lineno"> 2755</span> </div>
+<div class="line"><a name="l02756"></a><span class="lineno"> 2756</span>     cpl_free(instrume); instrume = NULL;</div>
+<div class="line"><a name="l02757"></a><span class="lineno"> 2757</span> </div>
+<div class="line"><a name="l02758"></a><span class="lineno"> 2758</span>     cpl_free(skylocalmaps);</div>
+<div class="line"><a name="l02759"></a><span class="lineno"> 2759</span>     cpl_free(nobjs_per_slit);</div>
+<div class="line"><a name="l02760"></a><span class="lineno"> 2760</span> </div>
+<div class="line"><a name="l02761"></a><span class="lineno"> 2761</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l02762"></a><span class="lineno"> 2762</span>         cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l02763"></a><span class="lineno"> 2763</span>         fors_pmos_extract_exit(NULL);</div>
+<div class="line"><a name="l02764"></a><span class="lineno"> 2764</span>     }</div>
+<div class="line"><a name="l02765"></a><span class="lineno"> 2765</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l02766"></a><span class="lineno"> 2766</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l02767"></a><span class="lineno"> 2767</span> }</div>
+<div class="line"><a name="l02768"></a><span class="lineno"> 2768</span> </div>
+<div class="line"><a name="l02769"></a><span class="lineno"> 2769</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l02780"></a><span class="lineno"> 2780</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l02781"></a><span class="lineno"> 2781</span> <span class="keyword">static</span> <span class="keywordtype">float</span> * fors_check_angles(cpl_frameset * frameset,</div>
+<div class="line"><a name="l02782"></a><span class="lineno"> 2782</span>                  <span class="keywordtype">int</span> pmos, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, <span class="keywordtype">int</span> * circ)</div>
+<div class="line"><a name="l02783"></a><span class="lineno"> 2783</span> {</div>
+<div class="line"><a name="l02784"></a><span class="lineno"> 2784</span>     <span class="keywordtype">float</span>     *angles  = NULL;</div>
+<div class="line"><a name="l02785"></a><span class="lineno"> 2785</span>     cpl_frame *c_frame = NULL;</div>
+<div class="line"><a name="l02786"></a><span class="lineno"> 2786</span>     <span class="keywordtype">char</span>      *ret_id  = NULL;</div>
+<div class="line"><a name="l02787"></a><span class="lineno"> 2787</span> </div>
+<div class="line"><a name="l02788"></a><span class="lineno"> 2788</span>     <span class="keywordtype">int</span> i = 0;</div>
+<div class="line"><a name="l02789"></a><span class="lineno"> 2789</span> </div>
+<div class="line"><a name="l02790"></a><span class="lineno"> 2790</span>     angles = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * pmos);</div>
+<div class="line"><a name="l02791"></a><span class="lineno"> 2791</span> </div>
+<div class="line"><a name="l02792"></a><span class="lineno"> 2792</span>     <span class="keywordflow">for</span> (c_frame  = cpl_frameset_find(frameset, tag);</div>
+<div class="line"><a name="l02793"></a><span class="lineno"> 2793</span>      c_frame != NULL; c_frame = cpl_frameset_find(frameset, NULL)) {</div>
+<div class="line"><a name="l02794"></a><span class="lineno"> 2794</span> </div>
+<div class="line"><a name="l02795"></a><span class="lineno"> 2795</span>         cpl_propertylist * header =</div>
+<div class="line"><a name="l02796"></a><span class="lineno"> 2796</span>         cpl_propertylist_load(cpl_frame_get_filename(c_frame), 0);</div>
+<div class="line"><a name="l02797"></a><span class="lineno"> 2797</span>     </div>
+<div class="line"><a name="l02798"></a><span class="lineno"> 2798</span>     <span class="keywordflow">if</span> (!ret_id) {</div>
+<div class="line"><a name="l02799"></a><span class="lineno"> 2799</span>         ret_id = cpl_strdup(cpl_propertylist_get_string(header, </div>
+<div class="line"><a name="l02800"></a><span class="lineno"> 2800</span>                                                         <span class="stringliteral">"ESO INS OPTI4 ID"</span>));</div>
+<div class="line"><a name="l02801"></a><span class="lineno"> 2801</span> </div>
+<div class="line"><a name="l02802"></a><span class="lineno"> 2802</span>         <span class="keywordflow">if</span> (ret_id[1] != <span class="charliteral">'5'</span> && ret_id[1] != <span class="charliteral">'4'</span>) {</div>
+<div class="line"><a name="l02803"></a><span class="lineno"> 2803</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l02804"></a><span class="lineno"> 2804</span>                   <span class="stringliteral">"Unknown retarder plate id: %s"</span>, ret_id);</div>
+<div class="line"><a name="l02805"></a><span class="lineno"> 2805</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02806"></a><span class="lineno"> 2806</span>         }</div>
+<div class="line"><a name="l02807"></a><span class="lineno"> 2807</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02808"></a><span class="lineno"> 2808</span>         <span class="keywordtype">char</span> * c_ret_id = (<span class="keywordtype">char</span> *)</div>
+<div class="line"><a name="l02809"></a><span class="lineno"> 2809</span>         cpl_propertylist_get_string(header, <span class="stringliteral">"ESO INS OPTI4 ID"</span>);</div>
+<div class="line"><a name="l02810"></a><span class="lineno"> 2810</span>         <span class="keywordflow">if</span> (ret_id[1] != c_ret_id[1]) {</div>
+<div class="line"><a name="l02811"></a><span class="lineno"> 2811</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Input frames are not from the same "</span></div>
+<div class="line"><a name="l02812"></a><span class="lineno"> 2812</span>                   <span class="stringliteral">"retarder plate"</span>);</div>
+<div class="line"><a name="l02813"></a><span class="lineno"> 2813</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02814"></a><span class="lineno"> 2814</span>         }</div>
+<div class="line"><a name="l02815"></a><span class="lineno"> 2815</span>     }</div>
+<div class="line"><a name="l02816"></a><span class="lineno"> 2816</span>     </div>
+<div class="line"><a name="l02817"></a><span class="lineno"> 2817</span>     <span class="keywordflow">if</span> (ret_id[1] == <span class="charliteral">'5'</span>) {  <span class="comment">/* Linear polarimetry */</span></div>
+<div class="line"><a name="l02818"></a><span class="lineno"> 2818</span>         angles[i] = (float)</div>
+<div class="line"><a name="l02819"></a><span class="lineno"> 2819</span>         cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS RETA2 ROT"</span>);</div>
+<div class="line"><a name="l02820"></a><span class="lineno"> 2820</span>         *circ = 0;</div>
+<div class="line"><a name="l02821"></a><span class="lineno"> 2821</span>     } <span class="keywordflow">else</span> {                 <span class="comment">/* Circular polarimetry */</span></div>
+<div class="line"><a name="l02822"></a><span class="lineno"> 2822</span>         angles[i] = (float)</div>
+<div class="line"><a name="l02823"></a><span class="lineno"> 2823</span>         cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS RETA4 ROT"</span>);</div>
+<div class="line"><a name="l02824"></a><span class="lineno"> 2824</span>         *circ = 1;</div>
+<div class="line"><a name="l02825"></a><span class="lineno"> 2825</span>     }</div>
+<div class="line"><a name="l02826"></a><span class="lineno"> 2826</span> </div>
+<div class="line"><a name="l02827"></a><span class="lineno"> 2827</span>         cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l02828"></a><span class="lineno"> 2828</span>     i++;</div>
+<div class="line"><a name="l02829"></a><span class="lineno"> 2829</span>     }</div>
+<div class="line"><a name="l02830"></a><span class="lineno"> 2830</span> </div>
+<div class="line"><a name="l02831"></a><span class="lineno"> 2831</span>     cpl_free(ret_id);</div>
+<div class="line"><a name="l02832"></a><span class="lineno"> 2832</span> </div>
+<div class="line"><a name="l02833"></a><span class="lineno"> 2833</span>     <span class="keywordflow">if</span> (*circ) {</div>
+<div class="line"><a name="l02834"></a><span class="lineno"> 2834</span>     <span class="keywordflow">if</span> (pmos != 2 && pmos != 4) {</div>
+<div class="line"><a name="l02835"></a><span class="lineno"> 2835</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: %d angles "</span></div>
+<div class="line"><a name="l02836"></a><span class="lineno"> 2836</span>                           <span class="stringliteral">"found, but either 2 or 4 are required for "</span></div>
+<div class="line"><a name="l02837"></a><span class="lineno"> 2837</span>                           <span class="stringliteral">"circular polarization measurements!"</span>, pmos);</div>
+<div class="line"><a name="l02838"></a><span class="lineno"> 2838</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02839"></a><span class="lineno"> 2839</span>     }</div>
+<div class="line"><a name="l02840"></a><span class="lineno"> 2840</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02841"></a><span class="lineno"> 2841</span>     <span class="keywordflow">if</span> (pmos != 4 && pmos != 8 && pmos != 16) {</div>
+<div class="line"><a name="l02842"></a><span class="lineno"> 2842</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: %d angles "</span></div>
+<div class="line"><a name="l02843"></a><span class="lineno"> 2843</span>                           <span class="stringliteral">"found, but either 4, 8, or 16 are required for "</span></div>
+<div class="line"><a name="l02844"></a><span class="lineno"> 2844</span>                           <span class="stringliteral">"linear polarization measurements!"</span>, pmos);</div>
+<div class="line"><a name="l02845"></a><span class="lineno"> 2845</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02846"></a><span class="lineno"> 2846</span>     }</div>
+<div class="line"><a name="l02847"></a><span class="lineno"> 2847</span>     }</div>
+<div class="line"><a name="l02848"></a><span class="lineno"> 2848</span>     </div>
+<div class="line"><a name="l02849"></a><span class="lineno"> 2849</span>     <span class="comment">/* Check completeness */</span></div>
+<div class="line"><a name="l02850"></a><span class="lineno"> 2850</span> </div>
+<div class="line"><a name="l02851"></a><span class="lineno"> 2851</span>     <span class="keywordflow">if</span> (*circ) {</div>
+<div class="line"><a name="l02852"></a><span class="lineno"> 2852</span>         <span class="keywordflow">for</span> (i = 0; i < pmos; i++) {</div>
+<div class="line"><a name="l02853"></a><span class="lineno"> 2853</span>             <span class="keywordflow">if</span> (fors_find_angle_pos(angles, pmos, 90.0 * i - 45.0) < 0) {</div>
+<div class="line"><a name="l02854"></a><span class="lineno"> 2854</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *cangles;</div>
+<div class="line"><a name="l02855"></a><span class="lineno"> 2855</span>                 <span class="keywordflow">switch</span> (pmos) {</div>
+<div class="line"><a name="l02856"></a><span class="lineno"> 2856</span>                 <span class="keywordflow">case</span> 2: cangles  = <span class="stringliteral">"-45.0, 45.0"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02857"></a><span class="lineno"> 2857</span>                 <span class="keywordflow">case</span> 4: cangles  = <span class="stringliteral">"-45.0, 45.0, 135.0, 225.0"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02858"></a><span class="lineno"> 2858</span>                 <span class="keywordflow">default</span>: assert(0);</div>
+<div class="line"><a name="l02859"></a><span class="lineno"> 2859</span>                 }  </div>
+<div class="line"><a name="l02860"></a><span class="lineno"> 2860</span> </div>
+<div class="line"><a name="l02861"></a><span class="lineno"> 2861</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: missing "</span></div>
+<div class="line"><a name="l02862"></a><span class="lineno"> 2862</span>                               <span class="stringliteral">"angle %.2f. All angles %s must be provided."</span>,</div>
+<div class="line"><a name="l02863"></a><span class="lineno"> 2863</span>                               angles[i], cangles);</div>
+<div class="line"><a name="l02864"></a><span class="lineno"> 2864</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02865"></a><span class="lineno"> 2865</span>             }</div>
+<div class="line"><a name="l02866"></a><span class="lineno"> 2866</span>         }</div>
+<div class="line"><a name="l02867"></a><span class="lineno"> 2867</span>     }</div>
+<div class="line"><a name="l02868"></a><span class="lineno"> 2868</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02869"></a><span class="lineno"> 2869</span>         <span class="keywordflow">for</span> (i = 0; i < pmos; i++) {</div>
+<div class="line"><a name="l02870"></a><span class="lineno"> 2870</span>             <span class="keywordflow">if</span> (fors_find_angle_pos(angles, pmos, 22.5 * i) < 0) {</div>
+<div class="line"><a name="l02871"></a><span class="lineno"> 2871</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *cangles;</div>
+<div class="line"><a name="l02872"></a><span class="lineno"> 2872</span>                 <span class="keywordflow">switch</span> (pmos) {</div>
+<div class="line"><a name="l02873"></a><span class="lineno"> 2873</span>                 <span class="keywordflow">case</span> 4: cangles  = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02874"></a><span class="lineno"> 2874</span>                 <span class="keywordflow">case</span> 8: cangles  = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5, "</span></div>
+<div class="line"><a name="l02875"></a><span class="lineno"> 2875</span>                                    <span class="stringliteral">"90.0, 112.5, 135.0, 157.5"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02876"></a><span class="lineno"> 2876</span>                 <span class="keywordflow">case</span> 16: cangles = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5, "</span></div>
+<div class="line"><a name="l02877"></a><span class="lineno"> 2877</span>                                    <span class="stringliteral">"90.0, 112.5, 135.0, 157.5, "</span></div>
+<div class="line"><a name="l02878"></a><span class="lineno"> 2878</span>                                    <span class="stringliteral">"180.0, 202.5, 225.0, 247.5, "</span></div>
+<div class="line"><a name="l02879"></a><span class="lineno"> 2879</span>                                    <span class="stringliteral">"270.0, 292.5, 315.0, 337.5"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02880"></a><span class="lineno"> 2880</span>                 <span class="keywordflow">default</span>: assert(0);</div>
+<div class="line"><a name="l02881"></a><span class="lineno"> 2881</span>                 }  </div>
+<div class="line"><a name="l02882"></a><span class="lineno"> 2882</span> </div>
+<div class="line"><a name="l02883"></a><span class="lineno"> 2883</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: missing "</span></div>
+<div class="line"><a name="l02884"></a><span class="lineno"> 2884</span>                               <span class="stringliteral">"angle %.2f. All angles %s must be provided."</span>,</div>
+<div class="line"><a name="l02885"></a><span class="lineno"> 2885</span>                               angles[i], cangles);</div>
+<div class="line"><a name="l02886"></a><span class="lineno"> 2886</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02887"></a><span class="lineno"> 2887</span>             }</div>
+<div class="line"><a name="l02888"></a><span class="lineno"> 2888</span>         }</div>
+<div class="line"><a name="l02889"></a><span class="lineno"> 2889</span>     }</div>
+<div class="line"><a name="l02890"></a><span class="lineno"> 2890</span> </div>
+<div class="line"><a name="l02891"></a><span class="lineno"> 2891</span>     <span class="keywordflow">return</span> angles;</div>
+<div class="line"><a name="l02892"></a><span class="lineno"> 2892</span> }</div>
+<div class="line"><a name="l02893"></a><span class="lineno"> 2893</span> </div>
+<div class="line"><a name="l02894"></a><span class="lineno"> 2894</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l02902"></a><span class="lineno"> 2902</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l02903"></a><span class="lineno"> 2903</span> <span class="keyword">static</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l02904"></a><span class="lineno"> 2904</span> fors_find_angle_pos(<span class="keywordtype">float</span> * angles, <span class="keywordtype">int</span> nangles, <span class="keywordtype">float</span> angle)</div>
+<div class="line"><a name="l02905"></a><span class="lineno"> 2905</span> {</div>
+<div class="line"><a name="l02906"></a><span class="lineno"> 2906</span>     <span class="keywordtype">int</span> i, match = 0;</div>
+<div class="line"><a name="l02907"></a><span class="lineno"> 2907</span> </div>
+<div class="line"><a name="l02908"></a><span class="lineno"> 2908</span>     <span class="keywordflow">for</span> (i = 0; i < nangles; i++) {</div>
+<div class="line"><a name="l02909"></a><span class="lineno"> 2909</span>     <span class="keywordflow">if</span> (fabs(angles[i]         - angle) < 1.0 || </div>
+<div class="line"><a name="l02910"></a><span class="lineno"> 2910</span>         fabs(angles[i] - 360.0 - angle) < 1.0) {</div>
+<div class="line"><a name="l02911"></a><span class="lineno"> 2911</span>         match = 1;</div>
+<div class="line"><a name="l02912"></a><span class="lineno"> 2912</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02913"></a><span class="lineno"> 2913</span>     }</div>
+<div class="line"><a name="l02914"></a><span class="lineno"> 2914</span>     }</div>
+<div class="line"><a name="l02915"></a><span class="lineno"> 2915</span> </div>
+<div class="line"><a name="l02916"></a><span class="lineno"> 2916</span>     <span class="keywordflow">return</span> match ? i : -1;</div>
+<div class="line"><a name="l02917"></a><span class="lineno"> 2917</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__pmos__science_8c-source.html b/html/fors__pmos__science_8c-source.html
deleted file mode 100644
index ff44286..0000000
--- a/html/fors__pmos__science_8c-source.html
+++ /dev/null
@@ -1,3521 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_pmos_science.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_pmos_science.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_pmos_science.c,v 1.64 2013/04/24 14:14:14 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:14 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.64 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <string.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <ctype.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <assert.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <moses.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_create(cpl_plugin *);
-<a name="l00044"></a>00044 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_exec(cpl_plugin *);
-<a name="l00045"></a>00045 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_destroy(cpl_plugin *);
-<a name="l00046"></a>00046 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science(cpl_parameterlist *, cpl_frameset *);
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="keyword">static</span> <span class="keywordtype">float</span> * fors_check_angles(cpl_frameset *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span> *);
-<a name="l00049"></a>00049 <span class="keyword">static</span> <span class="keywordtype">int</span>
-<a name="l00050"></a>00050 fors_find_angle_pos(<span class="keywordtype">float</span> * angles, <span class="keywordtype">int</span> nangles, <span class="keywordtype">float</span> angle);
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_pmos_science_description[] =
-<a name="l00053"></a>00053 <span class="stringliteral">"This recipe is used to reduce scientific spectra using the extraction\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"mask and the products created by the recipe fors_mpol_calib. The spectra\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"are bias subtracted, flat fielded (if a normalised flat field is specified)\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"and remapped eliminating the optical distortions. The wavelength calibration\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"can be optionally upgraded using a number of sky lines: if no sky lines\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"catalog of wavelengths is specified, an internal one is used instead.\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"If the alignment to the sky lines is performed, the input dispersion\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"coefficients table is upgraded and saved to disk, and a new CCD wavelengths\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"map is created.\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. A grism table (typically\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"depending on the instrument mode, and in particular on the grism used)\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"may also be specified: this table contains a default recipe parameter\n"</span> 
-<a name="l00065"></a>00065 <span class="stringliteral">"setting to control the way spectra are extracted for a specific instrument\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"mode, as it is used for automatic run of the pipeline on Paranal and in\n"</span> 
-<a name="l00067"></a>00067 <span class="stringliteral">"Garching. If this table is specified, it will modify the default recipe\n"</span> 
-<a name="l00068"></a>00068 <span class="stringliteral">"parameter setting, with the exception of those parameters which have been\n"</span> 
-<a name="l00069"></a>00069 <span class="stringliteral">"explicitly modifyed on the command line. If a grism table is not specified,\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"the input recipe parameters values will always be read from the command\n"</span> 
-<a name="l00071"></a>00071 <span class="stringliteral">"line, or from an esorex configuration file if present, or from their\n"</span> 
-<a name="l00072"></a>00072 <span class="stringliteral">"generic default values (that are rarely meaningful).\n"</span> 
-<a name="l00073"></a>00073 <span class="stringliteral">"Either a scientific or a standard star exposure can be specified in input.\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"The acronym SCI on products should be read STD in case of standard stars\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"observations.\n\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00077"></a>00077 <span class="stringliteral">"  DO category:               Type:       Explanation:            Required:\n"</span>
-<a name="l00078"></a>00078 <span class="stringliteral">"  SCIENCE_PMOS                  Raw         Scientific exposure      Y\n"</span>
-<a name="l00079"></a>00079 <span class="stringliteral">"  or STANDARD_PMOS              Raw         Standard star exposure   Y\n"</span>
-<a name="l00080"></a>00080 <span class="stringliteral">"  MASTER_BIAS                   Calib       Master bias              Y\n"</span>
-<a name="l00081"></a>00081 <span class="stringliteral">"  GRISM_TABLE                   Calib       Grism table              .\n"</span>
-<a name="l00082"></a>00082 <span class="stringliteral">"  MASTER_SKYLINECAT             Calib       Sky lines catalog        .\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"  MASTER_NORM_FLAT_PMOS         Calib       Normalised flat field    .\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"  DISP_COEFF_PMOS               Calib       Inverse dispersion       Y\n"</span>
-<a name="l00085"></a>00085 <span class="stringliteral">"  CURV_COEFF_PMOS               Calib       Spectral curvature       Y\n"</span>
-<a name="l00086"></a>00086 <span class="stringliteral">"  SLIT_LOCATION_PMOS            Calib       Slits positions table    Y\n"</span>
-<a name="l00087"></a>00087 <span class="stringliteral">"  RETARDER_WAVEPLATE_CHROMATISM Calib       Chromatism correction    .\n"</span>
-<a name="l00088"></a>00088 <span class="stringliteral">"  STD_PMOS_TABLE                Calib       Linear pol. of std stars .\n"</span>
-<a name="l00089"></a>00089 <span class="stringliteral">"\n"</span>
-<a name="l00090"></a>00090 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"  REDUCED_SCI_PMOS             FITS image  Extracted scientific spectra\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"  REDUCED_SKY_SCI_PMOS         FITS image  Extracted sky spectra\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"  REDUCED_ERROR_SCI_PMOS       FITS image  Errors on extracted spectra\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"  REDUCED_X_SCI_PMOS           FITS image  X Stokes parameter (and L)\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"  REDUCED_ERROR_X_SCI_PMOS     FITS image  Error on X Stokes parameter\n"</span>
-<a name="l00097"></a>00097 <span class="stringliteral">"  REDUCED_NUL_X_SCI_PMOS       FITS image  Null parameter for X\n"</span>
-<a name="l00098"></a>00098 <span class="stringliteral">"  REDUCED_ANGLE_SCI_PMOS       FITS image  Direction of linear polarization\n"</span>
-<a name="l00099"></a>00099 <span class="stringliteral">"  REDUCED_ERROR_ANGLE_SCI_PMOS FITS image  Error on polarization direction\n"</span>
-<a name="l00100"></a>00100 <span class="stringliteral">"  UNMAPPED_SCI_PMOS            FITS image  Sky subtracted scientific spectra\n"</span>
-<a name="l00101"></a>00101 <span class="stringliteral">"  MAPPED_SCI_PMOS              FITS image  Rectified scientific spectra\n"</span>
-<a name="l00102"></a>00102 <span class="stringliteral">"  MAPPED_ALL_SCI_PMOS          FITS image  Rectified science spectra with sky\n"</span>
-<a name="l00103"></a>00103 <span class="stringliteral">"  MAPPED_SKY_SCI_PMOS          FITS image  Rectified sky spectra\n"</span>
-<a name="l00104"></a>00104 <span class="stringliteral">"  UNMAPPED_SKY_SCI_PMOS        FITS image  Sky on CCD\n"</span>
-<a name="l00105"></a>00105 <span class="stringliteral">"  OBJECT_TABLE_SCI_PMOS        FITS table  Positions of detected objects\n"</span>
-<a name="l00106"></a>00106 <span class="stringliteral">"  OBJECT_TABLE_POL_SCI_PMOS    FITS table  Positions of real objects\n"</span>
-<a name="l00107"></a>00107 <span class="stringliteral">"\n"</span>
-<a name="l00108"></a>00108 <span class="stringliteral">"  Only if the sky-alignment of the wavelength solution is requested:\n"</span>
-<a name="l00109"></a>00109 <span class="stringliteral">"  DISP_COEFF_SCI_PMOS          FITS table  Upgraded dispersion coefficients\n"</span>
-<a name="l00110"></a>00110 <span class="stringliteral">"  WAVELENGTH_MAP_SCI_PMOS      FITS image  Upgraded wavelength map\n\n"</span>;
-<a name="l00111"></a>00111 
-<a name="l00112"></a>00112 <span class="preprocessor">#define fors_pmos_science_exit(message)            \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">{                                             \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">cpl_free(instrume);                           \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">cpl_image_delete(dummy);                      \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">cpl_image_delete(smapped);                    \</span>
-<a name="l00121"></a>00121 <span class="preprocessor">cpl_table_delete(offsets);                    \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">cpl_table_delete(sky);                        \</span>
-<a name="l00123"></a>00123 <span class="preprocessor">cpl_image_delete(bias);                       \</span>
-<a name="l00124"></a>00124 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00125"></a>00125 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00126"></a>00126 <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span>
-<a name="l00127"></a>00127 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00128"></a>00128 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00129"></a>00129 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00130"></a>00130 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00131"></a>00131 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00132"></a>00132 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00133"></a>00133 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00134"></a>00134 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00135"></a>00135 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00136"></a>00136 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00137"></a>00137 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00138"></a>00138 <span class="preprocessor">cpl_table_delete(mask_science);               \</span>
-<a name="l00139"></a>00139 <span class="preprocessor">cpl_table_delete(mask_arc);                   \</span>
-<a name="l00140"></a>00140 <span class="preprocessor">cpl_table_delete(mask_flat);                  \</span>
-<a name="l00141"></a>00141 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00142"></a>00142 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00143"></a>00143 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00144"></a>00144 <span class="preprocessor">}</span>
-<a name="l00145"></a>00145 <span class="preprocessor"></span>
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147 <span class="preprocessor">#define fors_pmos_science_exit_memcheck(message)   \</span>
-<a name="l00148"></a>00148 <span class="preprocessor">{                                             \</span>
-<a name="l00149"></a>00149 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span>
-<a name="l00150"></a>00150 <span class="preprocessor">cpl_free(instrume);                           \</span>
-<a name="l00151"></a>00151 <span class="preprocessor">cpl_image_delete(dummy);                      \</span>
-<a name="l00152"></a>00152 <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span>
-<a name="l00153"></a>00153 <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span>
-<a name="l00154"></a>00154 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00155"></a>00155 <span class="preprocessor">cpl_image_delete(smapped);                    \</span>
-<a name="l00156"></a>00156 <span class="preprocessor">cpl_table_delete(offsets);                    \</span>
-<a name="l00157"></a>00157 <span class="preprocessor">cpl_table_delete(sky);                        \</span>
-<a name="l00158"></a>00158 <span class="preprocessor">cpl_image_delete(bias);                       \</span>
-<a name="l00159"></a>00159 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00160"></a>00160 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00161"></a>00161 <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span>
-<a name="l00162"></a>00162 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00163"></a>00163 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00164"></a>00164 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00165"></a>00165 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00166"></a>00166 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00167"></a>00167 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00168"></a>00168 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00169"></a>00169 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00170"></a>00170 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00171"></a>00171 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00172"></a>00172 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00173"></a>00173 <span class="preprocessor">cpl_table_delete(mask_science);               \</span>
-<a name="l00174"></a>00174 <span class="preprocessor">cpl_table_delete(mask_arc);                   \</span>
-<a name="l00175"></a>00175 <span class="preprocessor">cpl_table_delete(mask_flat);                  \</span>
-<a name="l00176"></a>00176 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00177"></a>00177 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00178"></a>00178 <span class="preprocessor">return 0;                                     \</span>
-<a name="l00179"></a>00179 <span class="preprocessor">}</span>
-<a name="l00180"></a>00180 <span class="preprocessor"></span>
-<a name="l00181"></a>00181 
-<a name="l00193"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00193</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00194"></a>00194 {
-<a name="l00195"></a>00195     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00196"></a>00196     cpl_plugin *plugin = &recipe->interface;
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198     cpl_plugin_init(plugin,
-<a name="l00199"></a>00199                     CPL_PLUGIN_API,
-<a name="l00200"></a>00200                     FORS_BINARY_VERSION,
-<a name="l00201"></a>00201                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00202"></a>00202                     <span class="stringliteral">"fors_pmos_science"</span>,
-<a name="l00203"></a>00203                     <span class="stringliteral">"Extraction of scientific spectra"</span>,
-<a name="l00204"></a>00204                     fors_pmos_science_description,
-<a name="l00205"></a>00205                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00206"></a>00206                     PACKAGE_BUGREPORT,
-<a name="l00207"></a>00207     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00208"></a>00208     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00209"></a>00209     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00210"></a>00210     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00211"></a>00211     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00212"></a>00212     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00213"></a>00213     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00214"></a>00214     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00215"></a>00215     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00216"></a>00216     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00217"></a>00217     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00218"></a>00218     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00219"></a>00219     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00220"></a>00220                     fors_pmos_science_create,
-<a name="l00221"></a>00221                     fors_pmos_science_exec,
-<a name="l00222"></a>00222                     fors_pmos_science_destroy);
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224     cpl_pluginlist_append(list, plugin);
-<a name="l00225"></a>00225     
-<a name="l00226"></a>00226     <span class="keywordflow">return</span> 0;
-<a name="l00227"></a>00227 }
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229 
-<a name="l00240"></a>00240 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_create(cpl_plugin *plugin)
-<a name="l00241"></a>00241 {
-<a name="l00242"></a>00242     cpl_recipe    *recipe;
-<a name="l00243"></a>00243     cpl_parameter *p;
-<a name="l00244"></a>00244 
-<a name="l00245"></a>00245 
-<a name="l00246"></a>00246     <span class="comment">/* </span>
-<a name="l00247"></a>00247 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00248"></a>00248 <span class="comment">     */</span>
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00251"></a>00251         recipe = (cpl_recipe *)plugin;
-<a name="l00252"></a>00252     <span class="keywordflow">else</span> 
-<a name="l00253"></a>00253         <span class="keywordflow">return</span> -1;
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255     <span class="comment">/* </span>
-<a name="l00256"></a>00256 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00257"></a>00257 <span class="comment">     */</span>
-<a name="l00258"></a>00258 
-<a name="l00259"></a>00259     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00260"></a>00260 
-<a name="l00261"></a>00261 
-<a name="l00262"></a>00262     <span class="comment">/*</span>
-<a name="l00263"></a>00263 <span class="comment">     * Dispersion</span>
-<a name="l00264"></a>00264 <span class="comment">     */</span>
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.dispersion"</span>,
-<a name="l00267"></a>00267                                 CPL_TYPE_DOUBLE,
-<a name="l00268"></a>00268                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00269"></a>00269                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00270"></a>00270                                 0.0);
-<a name="l00271"></a>00271     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00272"></a>00272     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00273"></a>00273     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275     <span class="comment">/*</span>
-<a name="l00276"></a>00276 <span class="comment">     * Rebin</span>
-<a name="l00277"></a>00277 <span class="comment">     */</span>
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.rebin"</span>,
-<a name="l00280"></a>00280                                 CPL_TYPE_INT,
-<a name="l00281"></a>00281                                 <span class="stringliteral">"Rebin (pixel)"</span>,
-<a name="l00282"></a>00282                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00283"></a>00283                                 1);
-<a name="l00284"></a>00284     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"rebin"</span>);
-<a name="l00285"></a>00285     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00286"></a>00286     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     <span class="comment">/*</span>
-<a name="l00289"></a>00289 <span class="comment">     * Sky lines alignment</span>
-<a name="l00290"></a>00290 <span class="comment">     */</span>
-<a name="l00291"></a>00291 
-<a name="l00292"></a>00292     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.skyalign"</span>,
-<a name="l00293"></a>00293                                 CPL_TYPE_INT,
-<a name="l00294"></a>00294                                 <span class="stringliteral">"Polynomial order for sky lines alignment, "</span>
-<a name="l00295"></a>00295                                 <span class="stringliteral">"or -1 to avoid alignment"</span>,
-<a name="l00296"></a>00296                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00297"></a>00297                                 0);
-<a name="l00298"></a>00298     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);
-<a name="l00299"></a>00299     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00300"></a>00300     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302     <span class="comment">/*</span>
-<a name="l00303"></a>00303 <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span>
-<a name="l00304"></a>00304 <span class="comment">     */</span>
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.wcolumn"</span>,
-<a name="l00307"></a>00307                                 CPL_TYPE_STRING,
-<a name="l00308"></a>00308                                 <span class="stringliteral">"Name of sky line catalog table column "</span>
-<a name="l00309"></a>00309                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00310"></a>00310                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00311"></a>00311                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00312"></a>00312     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00313"></a>00313     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00314"></a>00314     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     <span class="comment">/*</span>
-<a name="l00317"></a>00317 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00318"></a>00318 <span class="comment">     */</span>
-<a name="l00319"></a>00319 
-<a name="l00320"></a>00320     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.startwavelength"</span>,
-<a name="l00321"></a>00321                                 CPL_TYPE_DOUBLE,
-<a name="l00322"></a>00322                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00323"></a>00323                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00324"></a>00324                                 0.0);
-<a name="l00325"></a>00325     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00326"></a>00326     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00327"></a>00327     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00328"></a>00328 
-<a name="l00329"></a>00329     <span class="comment">/*</span>
-<a name="l00330"></a>00330 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00331"></a>00331 <span class="comment">     */</span>
-<a name="l00332"></a>00332 
-<a name="l00333"></a>00333     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.endwavelength"</span>,
-<a name="l00334"></a>00334                                 CPL_TYPE_DOUBLE,
-<a name="l00335"></a>00335                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00336"></a>00336                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00337"></a>00337                                 0.0);
-<a name="l00338"></a>00338     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00339"></a>00339     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00340"></a>00340     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00341"></a>00341 
-<a name="l00342"></a>00342     <span class="comment">/*</span>
-<a name="l00343"></a>00343 <span class="comment">     * Flux conservation</span>
-<a name="l00344"></a>00344 <span class="comment">     */</span>
-<a name="l00345"></a>00345 
-<a name="l00346"></a>00346     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.flux"</span>,
-<a name="l00347"></a>00347                                 CPL_TYPE_BOOL,
-<a name="l00348"></a>00348                                 <span class="stringliteral">"Apply flux conservation"</span>,
-<a name="l00349"></a>00349                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00350"></a>00350                                 TRUE);
-<a name="l00351"></a>00351     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);
-<a name="l00352"></a>00352     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00353"></a>00353     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00354"></a>00354 
-<a name="l00355"></a>00355     <span class="comment">/*</span>
-<a name="l00356"></a>00356 <span class="comment">     * Apply flat field</span>
-<a name="l00357"></a>00357 <span class="comment">     */</span>
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.flatfield"</span>,
-<a name="l00360"></a>00360                                 CPL_TYPE_BOOL,
-<a name="l00361"></a>00361                                 <span class="stringliteral">"Apply flat field"</span>,
-<a name="l00362"></a>00362                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00363"></a>00363                                 TRUE);
-<a name="l00364"></a>00364     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flatfield"</span>);
-<a name="l00365"></a>00365     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00366"></a>00366     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00367"></a>00367 
-<a name="l00368"></a>00368     <span class="comment">/*</span>
-<a name="l00369"></a>00369 <span class="comment">     * Median sky subtraction method</span>
-<a name="l00370"></a>00370 <span class="comment">     */</span>
-<a name="l00371"></a>00371 
-<a name="l00372"></a>00372     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.skymedian"</span>,
-<a name="l00373"></a>00373                                 CPL_TYPE_BOOL,
-<a name="l00374"></a>00374                                 <span class="stringliteral">"Sky subtraction from extracted slit spectra"</span>,
-<a name="l00375"></a>00375                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00376"></a>00376                                 FALSE);
-<a name="l00377"></a>00377     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skymedian"</span>);
-<a name="l00378"></a>00378     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00379"></a>00379     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00380"></a>00380 
-<a name="l00381"></a>00381     <span class="comment">/*</span>
-<a name="l00382"></a>00382 <span class="comment">     * Local sky subtraction on CCD spectra</span>
-<a name="l00383"></a>00383 <span class="comment">     */</span>
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.skylocal"</span>,
-<a name="l00386"></a>00386                                 CPL_TYPE_BOOL,
-<a name="l00387"></a>00387                                 <span class="stringliteral">"Sky subtraction from CCD slit spectra"</span>,
-<a name="l00388"></a>00388                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00389"></a>00389                                 TRUE);
-<a name="l00390"></a>00390     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skylocal"</span>);
-<a name="l00391"></a>00391     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00392"></a>00392     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394     <span class="comment">/*</span>
-<a name="l00395"></a>00395 <span class="comment">     * Cosmic rays removal</span>
-<a name="l00396"></a>00396 <span class="comment">     */</span>
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.cosmics"</span>,
-<a name="l00399"></a>00399                                 CPL_TYPE_BOOL,
-<a name="l00400"></a>00400                                 <span class="stringliteral">"Eliminate cosmic rays hits (only if local "</span>
-<a name="l00401"></a>00401                                 <span class="stringliteral">"sky subtraction is also requested)"</span>,
-<a name="l00402"></a>00402                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00403"></a>00403                                 FALSE);
-<a name="l00404"></a>00404     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);
-<a name="l00405"></a>00405     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00406"></a>00406     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00407"></a>00407 
-<a name="l00408"></a>00408     <span class="comment">/*</span>
-<a name="l00409"></a>00409 <span class="comment">     * Slit margin</span>
-<a name="l00410"></a>00410 <span class="comment">     */</span>
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.slit_margin"</span>,
-<a name="l00413"></a>00413                                 CPL_TYPE_INT,
-<a name="l00414"></a>00414                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span>
-<a name="l00415"></a>00415                                 <span class="stringliteral">"in object detection and extraction"</span>,
-<a name="l00416"></a>00416                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00417"></a>00417                                 3);
-<a name="l00418"></a>00418     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);
-<a name="l00419"></a>00419     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00420"></a>00420     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00421"></a>00421 
-<a name="l00422"></a>00422     <span class="comment">/*</span>
-<a name="l00423"></a>00423 <span class="comment">     * Extraction radius</span>
-<a name="l00424"></a>00424 <span class="comment">     */</span>
-<a name="l00425"></a>00425 
-<a name="l00426"></a>00426     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.ext_radius"</span>,
-<a name="l00427"></a>00427                                 CPL_TYPE_INT,
-<a name="l00428"></a>00428                                 <span class="stringliteral">"Maximum extraction radius for detected "</span>
-<a name="l00429"></a>00429                                 <span class="stringliteral">"objects (pixel)"</span>,
-<a name="l00430"></a>00430                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00431"></a>00431                                 12);
-<a name="l00432"></a>00432     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);
-<a name="l00433"></a>00433     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00434"></a>00434     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00435"></a>00435 
-<a name="l00436"></a>00436     <span class="comment">/*</span>
-<a name="l00437"></a>00437 <span class="comment">     * Contamination radius</span>
-<a name="l00438"></a>00438 <span class="comment">     */</span>
-<a name="l00439"></a>00439 
-<a name="l00440"></a>00440     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.cont_radius"</span>,
-<a name="l00441"></a>00441                                 CPL_TYPE_INT,
-<a name="l00442"></a>00442                                 <span class="stringliteral">"Minimum distance at which two objects "</span>
-<a name="l00443"></a>00443                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span>
-<a name="l00444"></a>00444                                 <span class="stringliteral">"each other (pixel)"</span>,
-<a name="l00445"></a>00445                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00446"></a>00446                                 0);
-<a name="l00447"></a>00447     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);
-<a name="l00448"></a>00448     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00449"></a>00449     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00450"></a>00450 
-<a name="l00451"></a>00451     <span class="comment">/*</span>
-<a name="l00452"></a>00452 <span class="comment">     * Object extraction method</span>
-<a name="l00453"></a>00453 <span class="comment">     */</span>
-<a name="l00454"></a>00454 
-<a name="l00455"></a>00455     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.ext_mode"</span>,
-<a name="l00456"></a>00456                                 CPL_TYPE_INT,
-<a name="l00457"></a>00457                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span>
-<a name="l00458"></a>00458                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,
-<a name="l00459"></a>00459                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00460"></a>00460                                 1);
-<a name="l00461"></a>00461     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);
-<a name="l00462"></a>00462     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00463"></a>00463     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00464"></a>00464 
-<a name="l00465"></a>00465     <span class="comment">/*</span>
-<a name="l00466"></a>00466 <span class="comment">     * Tolerance in object matching</span>
-<a name="l00467"></a>00467 <span class="comment">     */</span>
-<a name="l00468"></a>00468 
-<a name="l00469"></a>00469     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.match_tolerance"</span>,
-<a name="l00470"></a>00470                                 CPL_TYPE_DOUBLE,
-<a name="l00471"></a>00471                                 <span class="stringliteral">"Tolerance for matching spectra from the "</span>
-<a name="l00472"></a>00472                                 <span class="stringliteral">"same object at different angles and beams "</span>
-<a name="l00473"></a>00473                                 <span class="stringliteral">"(pixel)"</span>,
-<a name="l00474"></a>00474                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00475"></a>00475                                 5.0);
-<a name="l00476"></a>00476     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"match_tolerance"</span>);
-<a name="l00477"></a>00477     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00478"></a>00478     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00479"></a>00479 
-<a name="l00480"></a>00480     <span class="comment">/*</span>
-<a name="l00481"></a>00481 <span class="comment">     * Normalise output by exposure time</span>
-<a name="l00482"></a>00482 <span class="comment">     */</span>
-<a name="l00483"></a>00483 
-<a name="l00484"></a>00484     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.time_normalise"</span>,
-<a name="l00485"></a>00485                                 CPL_TYPE_BOOL,
-<a name="l00486"></a>00486                                 <span class="stringliteral">"Normalise output spectra by the exposure time"</span>,
-<a name="l00487"></a>00487                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00488"></a>00488                                 TRUE);
-<a name="l00489"></a>00489     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"time_normalise"</span>);
-<a name="l00490"></a>00490     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00491"></a>00491     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00492"></a>00492 
-<a name="l00493"></a>00493     <span class="comment">/*</span>
-<a name="l00494"></a>00494 <span class="comment">     * Apply chromatism correction to polarization angle</span>
-<a name="l00495"></a>00495 <span class="comment">     */</span>
-<a name="l00496"></a>00496 
-<a name="l00497"></a>00497     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.chromatism"</span>,
-<a name="l00498"></a>00498                                 CPL_TYPE_BOOL,
-<a name="l00499"></a>00499                                 <span class="stringliteral">"Chromatism correction to polarization angles"</span>,
-<a name="l00500"></a>00500                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00501"></a>00501                                 TRUE);
-<a name="l00502"></a>00502     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"chromatism"</span>);
-<a name="l00503"></a>00503     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00504"></a>00504     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00505"></a>00505 
-<a name="l00506"></a>00506     <span class="comment">/*</span>
-<a name="l00507"></a>00507 <span class="comment">     * Rotation correction for linear polarisation</span>
-<a name="l00508"></a>00508 <span class="comment">     */</span>
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.wollaston"</span>,
-<a name="l00511"></a>00511                                 CPL_TYPE_BOOL,
-<a name="l00512"></a>00512                      <span class="stringliteral">"Wollaston mounting (FORS2 only): true = 0 degrees "</span>
-<a name="l00513"></a>00513                      <span class="stringliteral">"(ord. beam on top, extr. beam on bottom), "</span>
-<a name="l00514"></a>00514                      <span class="stringliteral">"false = 180 degrees (beams are reversed), for FORS1 "</span>
-<a name="l00515"></a>00515                      <span class="stringliteral">"is frozen to true"</span>,
-<a name="l00516"></a>00516                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00517"></a>00517                                 TRUE);
-<a name="l00518"></a>00518     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wollaston"</span>);
-<a name="l00519"></a>00519     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00520"></a>00520     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00521"></a>00521 
-<a name="l00522"></a>00522     <span class="comment">/*</span>
-<a name="l00523"></a>00523 <span class="comment">     * Create check products</span>
-<a name="l00524"></a>00524 <span class="comment">     */</span>
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.check"</span>,
-<a name="l00527"></a>00527                                 CPL_TYPE_BOOL,
-<a name="l00528"></a>00528                                 <span class="stringliteral">"Create intermediate products"</span>,
-<a name="l00529"></a>00529                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00530"></a>00530                                 FALSE);
-<a name="l00531"></a>00531     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"check"</span>);
-<a name="l00532"></a>00532     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00533"></a>00533     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00534"></a>00534 
-<a name="l00535"></a>00535     <span class="comment">/*</span>
-<a name="l00536"></a>00536 <span class="comment">     * Computation of QC1 parameters</span>
-<a name="l00537"></a>00537 <span class="comment">     */</span>
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.qc"</span>,
-<a name="l00540"></a>00540                                 CPL_TYPE_BOOL,
-<a name="l00541"></a>00541                                 <span class="stringliteral">"Compute QC1 parameters"</span>,
-<a name="l00542"></a>00542                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,
-<a name="l00543"></a>00543                                 TRUE);
-<a name="l00544"></a>00544     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"qc"</span>);
-<a name="l00545"></a>00545     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00546"></a>00546     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00547"></a>00547 
-<a name="l00548"></a>00548     <span class="keywordflow">return</span> 0;
-<a name="l00549"></a>00549 }
-<a name="l00550"></a>00550 
-<a name="l00551"></a>00551 
-<a name="l00560"></a>00560 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_exec(cpl_plugin *plugin)
-<a name="l00561"></a>00561 {
-<a name="l00562"></a>00562     cpl_recipe *recipe;
-<a name="l00563"></a>00563     
-<a name="l00564"></a>00564     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00565"></a>00565         recipe = (cpl_recipe *)plugin;
-<a name="l00566"></a>00566     <span class="keywordflow">else</span> 
-<a name="l00567"></a>00567         <span class="keywordflow">return</span> -1;
-<a name="l00568"></a>00568 
-<a name="l00569"></a>00569     <span class="keywordflow">return</span> fors_pmos_science(recipe->parameters, recipe->frames);
-<a name="l00570"></a>00570 }
-<a name="l00571"></a>00571 
-<a name="l00572"></a>00572 
-<a name="l00581"></a>00581 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_destroy(cpl_plugin *plugin)
-<a name="l00582"></a>00582 {
-<a name="l00583"></a>00583     cpl_recipe *recipe;
-<a name="l00584"></a>00584     
-<a name="l00585"></a>00585     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00586"></a>00586         recipe = (cpl_recipe *)plugin;
-<a name="l00587"></a>00587     <span class="keywordflow">else</span> 
-<a name="l00588"></a>00588         <span class="keywordflow">return</span> -1;
-<a name="l00589"></a>00589 
-<a name="l00590"></a>00590     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     <span class="keywordflow">return</span> 0;
-<a name="l00593"></a>00593 }
-<a name="l00594"></a>00594 
-<a name="l00595"></a>00595 
-<a name="l00605"></a>00605 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00606"></a>00606 {
-<a name="l00607"></a>00607 
-<a name="l00608"></a>00608     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_pmos_science"</span>;
-<a name="l00609"></a>00609 
-<a name="l00610"></a>00610 
-<a name="l00611"></a>00611     <span class="comment">/*</span>
-<a name="l00612"></a>00612 <span class="comment">     * Input parameters</span>
-<a name="l00613"></a>00613 <span class="comment">     */</span>
-<a name="l00614"></a>00614 
-<a name="l00615"></a>00615     <span class="keywordtype">double</span>      dispersion;
-<a name="l00616"></a>00616     <span class="keywordtype">int</span>         group;
-<a name="l00617"></a>00617     <span class="keywordtype">int</span>         skyalign;
-<a name="l00618"></a>00618     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00619"></a>00619     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00620"></a>00620     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00621"></a>00621     <span class="keywordtype">int</span>         flux;
-<a name="l00622"></a>00622     <span class="keywordtype">int</span>         flatfield;
-<a name="l00623"></a>00623     <span class="keywordtype">int</span>         skylocal;
-<a name="l00624"></a>00624     <span class="keywordtype">int</span>         skymedian;
-<a name="l00625"></a>00625     <span class="keywordtype">int</span>         chromatism;
-<a name="l00626"></a>00626     <span class="keywordtype">double</span>      wollaston;
-<a name="l00627"></a>00627     <span class="keywordtype">int</span>         cosmics;
-<a name="l00628"></a>00628     <span class="keywordtype">int</span>         slit_margin;
-<a name="l00629"></a>00629     <span class="keywordtype">int</span>         ext_radius;
-<a name="l00630"></a>00630     <span class="keywordtype">int</span>         cont_radius;
-<a name="l00631"></a>00631     <span class="keywordtype">int</span>         ext_mode;
-<a name="l00632"></a>00632     <span class="keywordtype">double</span>      tolerance;
-<a name="l00633"></a>00633     <span class="keywordtype">int</span>         time_normalise;
-<a name="l00634"></a>00634     <span class="keywordtype">int</span>         check;
-<a name="l00635"></a>00635     <span class="keywordtype">int</span>         qc;
-<a name="l00636"></a>00636 
-<a name="l00637"></a>00637     <span class="comment">/*</span>
-<a name="l00638"></a>00638 <span class="comment">     * CPL objects</span>
-<a name="l00639"></a>00639 <span class="comment">     */</span>
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641     cpl_image       **images;
-<a name="l00642"></a>00642 
-<a name="l00643"></a>00643     cpl_image       **reduceds       = NULL;
-<a name="l00644"></a>00644     cpl_image       **rerrors        = NULL;
-<a name="l00645"></a>00645     cpl_table       **slitss         = NULL;
-<a name="l00646"></a>00646     cpl_image       **mappeds        = NULL;
-<a name="l00647"></a>00647     cpl_image       **skylocalmaps   = NULL;
-<a name="l00648"></a>00648     
-<a name="l00649"></a>00649     <span class="keywordtype">int</span> nobjects = 0;
-<a name="l00650"></a>00650 
-<a name="l00651"></a>00651     cpl_image        *bias           = NULL;
-<a name="l00652"></a>00652     cpl_image        *norm_flat      = NULL;
-<a name="l00653"></a>00653     cpl_image        *spectra        = NULL;
-<a name="l00654"></a>00654     cpl_image        *rectified      = NULL;
-<a name="l00655"></a>00655     cpl_image        *coordinate     = NULL;
-<a name="l00656"></a>00656     cpl_image        *rainbow        = NULL;
-<a name="l00657"></a>00657     cpl_image        *mapped         = NULL;
-<a name="l00658"></a>00658     cpl_image        *mapped_sky     = NULL;
-<a name="l00659"></a>00659     cpl_image        *mapped_cleaned = NULL;
-<a name="l00660"></a>00660     cpl_image        *smapped        = NULL;
-<a name="l00661"></a>00661     cpl_image        *wavemap        = NULL;
-<a name="l00662"></a>00662     cpl_image        *skymap         = NULL;
-<a name="l00663"></a>00663     cpl_image        *skylocalmap    = NULL;
-<a name="l00664"></a>00664     cpl_image        *dummy          = NULL;
-<a name="l00665"></a>00665 
-<a name="l00666"></a>00666     cpl_table        *grism_table    = NULL;
-<a name="l00667"></a>00667     cpl_table        *overscans      = NULL;
-<a name="l00668"></a>00668     cpl_table        *wavelengths    = NULL;
-<a name="l00669"></a>00669     cpl_table        *idscoeff       = NULL;
-<a name="l00670"></a>00670     cpl_table        *slits          = NULL;
-<a name="l00671"></a>00671     cpl_table        *origslits      = NULL;
-<a name="l00672"></a>00672     cpl_table        *maskslits      = NULL;
-<a name="l00673"></a>00673     cpl_table        *mask_science   = NULL;
-<a name="l00674"></a>00674     cpl_table        *mask_arc       = NULL;
-<a name="l00675"></a>00675     cpl_table        *mask_flat      = NULL;
-<a name="l00676"></a>00676     cpl_table        *polytraces     = NULL;
-<a name="l00677"></a>00677     cpl_table        *offsets        = NULL;
-<a name="l00678"></a>00678     cpl_table        *sky            = NULL;
-<a name="l00679"></a>00679 
-<a name="l00680"></a>00680     cpl_vector       *lines          = NULL;
-<a name="l00681"></a>00681 
-<a name="l00682"></a>00682     cpl_propertylist *header         = NULL;
-<a name="l00683"></a>00683     cpl_propertylist *save_header    = NULL;
-<a name="l00684"></a>00684 
-<a name="l00685"></a>00685     <span class="comment">/*</span>
-<a name="l00686"></a>00686 <span class="comment">     * Auxiliary variables</span>
-<a name="l00687"></a>00687 <span class="comment">     */</span>
-<a name="l00688"></a>00688 
-<a name="l00689"></a>00689     <span class="keywordtype">char</span>    version[80];
-<a name="l00690"></a>00690     <span class="keywordtype">char</span>   *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00691"></a>00691     <span class="keyword">const</span> <span class="keywordtype">char</span>   *science_tag;
-<a name="l00692"></a>00692     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_norm_flat_tag;
-<a name="l00693"></a>00693     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_coeff_tag;
-<a name="l00694"></a>00694     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_coeff_sky_tag;
-<a name="l00695"></a>00695     <span class="keyword">const</span> <span class="keywordtype">char</span>   *wavelength_map_sky_tag;
-<a name="l00696"></a>00696     <span class="keyword">const</span> <span class="keywordtype">char</span>   *curv_coeff_tag;
-<a name="l00697"></a>00697     <span class="keyword">const</span> <span class="keywordtype">char</span>   *slit_location_tag;
-<a name="l00698"></a>00698     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_science_tag;
-<a name="l00699"></a>00699     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_sky_tag;
-<a name="l00700"></a>00700     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_tag;
-<a name="l00701"></a>00701     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_science_tag;
-<a name="l00702"></a>00702     <span class="keyword">const</span> <span class="keywordtype">char</span>   *unmapped_science_tag;
-<a name="l00703"></a>00703     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_science_sky_tag;
-<a name="l00704"></a>00704     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_sky_tag;
-<a name="l00705"></a>00705     <span class="keyword">const</span> <span class="keywordtype">char</span>   *unmapped_sky_tag;
-<a name="l00706"></a>00706     <span class="keyword">const</span> <span class="keywordtype">char</span>   *object_table_tag;
-<a name="l00707"></a>00707     <span class="keyword">const</span> <span class="keywordtype">char</span>   *object_table_pol_tag;
-<a name="l00708"></a>00708     <span class="keyword">const</span> <span class="keywordtype">char</span>   *skylines_offsets_tag;
-<a name="l00709"></a>00709     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_q_tag;
-<a name="l00710"></a>00710     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_u_tag;
-<a name="l00711"></a>00711     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_v_tag;
-<a name="l00712"></a>00712     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_l_tag;
-<a name="l00713"></a>00713     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_i_tag;
-<a name="l00714"></a>00714     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_q_tag;
-<a name="l00715"></a>00715     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_u_tag;
-<a name="l00716"></a>00716     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_v_tag;
-<a name="l00717"></a>00717     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_l_tag;
-<a name="l00718"></a>00718     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_i_tag;
-<a name="l00719"></a>00719     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_q_tag;
-<a name="l00720"></a>00720     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_u_tag;
-<a name="l00721"></a>00721     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_v_tag;
-<a name="l00722"></a>00722     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_angle_tag;
-<a name="l00723"></a>00723     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_angle_tag;
-<a name="l00724"></a>00724     <span class="keyword">const</span> <span class="keywordtype">char</span>   *chrom_table_tag = <span class="stringliteral">"RETARDER_WAVEPLATE_CHROMATISM"</span>;
-<a name="l00725"></a>00725     <span class="keyword">const</span> <span class="keywordtype">char</span>   *std_pmos_table_tag = <span class="stringliteral">"STD_PMOS_TABLE"</span>;
-<a name="l00726"></a>00726     <span class="keywordtype">float</span>  *angles = NULL;
-<a name="l00727"></a>00727     <span class="keywordtype">int</span>     pmos, circ;
-<a name="l00728"></a>00728     <span class="keywordtype">int</span>     nscience;
-<a name="l00729"></a>00729     <span class="keywordtype">double</span>  alltime;
-<a name="l00730"></a>00730     <span class="keywordtype">double</span>  mean_rms;
-<a name="l00731"></a>00731     <span class="keywordtype">int</span>     nlines;
-<a name="l00732"></a>00732     <span class="keywordtype">int</span>     rebin;
-<a name="l00733"></a>00733     <span class="keywordtype">double</span> *line;
-<a name="l00734"></a>00734     <span class="keywordtype">int</span>     nx = 0, ny;
-<a name="l00735"></a>00735     <span class="keywordtype">int</span>     ccd_xsize, ccd_ysize;
-<a name="l00736"></a>00736     <span class="keywordtype">double</span>  reference;
-<a name="l00737"></a>00737     <span class="keywordtype">double</span>  gain;
-<a name="l00738"></a>00738     <span class="keywordtype">double</span>  <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>;
-<a name="l00739"></a>00739     <span class="keywordtype">double</span>  ra, dec;
-<a name="l00740"></a>00740     <span class="keywordtype">char</span>    filter;
-<a name="l00741"></a>00741     <span class="keywordtype">double</span>  qc_angle;
-<a name="l00742"></a>00742     <span class="keywordtype">double</span>  qc_angle_err;
-<a name="l00743"></a>00743     <span class="keywordtype">double</span>  qc_pl;
-<a name="l00744"></a>00744     <span class="keywordtype">double</span>  qc_pl_err;
-<a name="l00745"></a>00745     <span class="keywordtype">int</span>     standard;
-<a name="l00746"></a>00746     <span class="keywordtype">int</span>     polarised;
-<a name="l00747"></a>00747     <span class="keywordtype">int</span>     highres;
-<a name="l00748"></a>00748     <span class="keywordtype">int</span>     i, j;
-<a name="l00749"></a>00749 
-<a name="l00750"></a>00750     <span class="keywordtype">int</span>    *nobjs_per_slit;
-<a name="l00751"></a>00751     <span class="keywordtype">int</span>     nslits;
-<a name="l00752"></a>00752 
-<a name="l00753"></a>00753     <span class="keywordtype">int</span>     bagoo = 0;
-<a name="l00754"></a>00754     <span class="keywordtype">double</span>  blevel = 0.0;
-<a name="l00755"></a>00755     <span class="keywordtype">int</span>     doit = 0;           <span class="comment">// montecarlo simulation</span>
-<a name="l00756"></a>00756     <span class="keywordtype">int</span>     conta = 0;          <span class="comment">// Bagoo, conta gli oggetti con S/N > s2n</span>
-<a name="l00757"></a>00757     <span class="keywordtype">int</span>     bright = 0;         <span class="comment">// Bagoo, marca un oggetto con S/N > s2n</span>
-<a name="l00758"></a>00758     <span class="keywordtype">int</span>     nslits_out_det = 0;
-<a name="l00759"></a>00759 
-<a name="l00760"></a>00760 
-<a name="l00761"></a>00761     cpl_error_code error;
-<a name="l00762"></a>00762 
-<a name="l00763"></a>00763     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00764"></a>00764 
-<a name="l00765"></a>00765     <span class="keywordflow">if</span> (bagoo) {
-<a name="l00766"></a>00766         <span class="keywordtype">char</span> *montecarlo = getenv(<span class="stringliteral">"MONTECARLO"</span>);
-<a name="l00767"></a>00767 
-<a name="l00768"></a>00768         <span class="keywordflow">if</span> (montecarlo) {
-<a name="l00769"></a>00769             doit = atoi(montecarlo);
-<a name="l00770"></a>00770         }
-<a name="l00771"></a>00771     }
-<a name="l00772"></a>00772 
-<a name="l00773"></a>00773     cpl_msg_set_indentation(2);
-<a name="l00774"></a>00774 
-<a name="l00775"></a>00775     <a class="code" href="group__forsdfs.html#g37d74636b6c3f3d52b0312ce3a58e59d">fors_dfs_set_groups</a>(frameset);
-<a name="l00776"></a>00776 
-<a name="l00777"></a>00777 
-<a name="l00778"></a>00778     <span class="comment">/* </span>
-<a name="l00779"></a>00779 <span class="comment">     * Get configuration parameters</span>
-<a name="l00780"></a>00780 <span class="comment">     */</span>
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00783"></a>00783     cpl_msg_indent_more();
-<a name="l00784"></a>00784 
-<a name="l00785"></a>00785     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00786"></a>00786         fors_pmos_science_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);
-<a name="l00787"></a>00787 
-<a name="l00788"></a>00788     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00789"></a>00789 
-<a name="l00790"></a>00790     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00791"></a>00791                     <span class="stringliteral">"fors.fors_pmos_science.dispersion"</span>, grism_table);
-<a name="l00792"></a>00792 
-<a name="l00793"></a>00793     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00794"></a>00794         fors_pmos_science_exit(<span class="stringliteral">"Invalid spectral dispersion"</span>);
-<a name="l00795"></a>00795 
-<a name="l00796"></a>00796     group = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00797"></a>00797                     <span class="stringliteral">"fors.fors_pmos_science.rebin"</span>, NULL);
-<a name="l00798"></a>00798 
-<a name="l00799"></a>00799     <span class="keywordflow">if</span> (group < 1)
-<a name="l00800"></a>00800         fors_pmos_science_exit(<span class="stringliteral">"Invalid rebin factor"</span>);
-<a name="l00801"></a>00801 
-<a name="l00802"></a>00802     skyalign = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00803"></a>00803                     <span class="stringliteral">"fors.fors_pmos_science.skyalign"</span>, NULL);
-<a name="l00804"></a>00804 
-<a name="l00805"></a>00805     <span class="keywordflow">if</span> (skyalign > 2)
-<a name="l00806"></a>00806         fors_pmos_science_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);
-<a name="l00807"></a>00807 
-<a name="l00808"></a>00808     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00809"></a>00809                     <span class="stringliteral">"fors.fors_pmos_science.wcolumn"</span>, NULL);
-<a name="l00810"></a>00810 
-<a name="l00811"></a>00811     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00812"></a>00812                     <span class="stringliteral">"fors.fors_pmos_science.startwavelength"</span>, grism_table);
-<a name="l00813"></a>00813     <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00814"></a>00814         fors_pmos_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00815"></a>00815 
-<a name="l00816"></a>00816     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00817"></a>00817                     <span class="stringliteral">"fors.fors_pmos_science.endwavelength"</span>, grism_table);
-<a name="l00818"></a>00818     <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00819"></a>00819         fors_pmos_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00820"></a>00820 
-<a name="l00821"></a>00821     <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00822"></a>00822         fors_pmos_science_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00823"></a>00823 
-<a name="l00824"></a>00824     flux = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_science.flux"</span>, NULL);
-<a name="l00825"></a>00825 
-<a name="l00826"></a>00826     flatfield = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00827"></a>00827                                        <span class="stringliteral">"fors.fors_pmos_science.flatfield"</span>, 
-<a name="l00828"></a>00828                                        NULL);
-<a name="l00829"></a>00829 
-<a name="l00830"></a>00830     skylocal  = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00831"></a>00831                                        <span class="stringliteral">"fors.fors_pmos_science.skylocal"</span>, 
-<a name="l00832"></a>00832                                        NULL);
-<a name="l00833"></a>00833     skymedian = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00834"></a>00834                                        <span class="stringliteral">"fors.fors_pmos_science.skymedian"</span>, 
-<a name="l00835"></a>00835                                        NULL);
-<a name="l00836"></a>00836     
-<a name="l00837"></a>00837     chromatism = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00838"></a>00838                                         <span class="stringliteral">"fors.fors_pmos_science.chromatism"</span>, 
-<a name="l00839"></a>00839                                         NULL);
-<a name="l00840"></a>00840 
-<a name="l00841"></a>00841     wollaston = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist,
-<a name="l00842"></a>00842                                        <span class="stringliteral">"fors.fors_pmos_science.wollaston"</span>,
-<a name="l00843"></a>00843                                        NULL);
-<a name="l00844"></a>00844 
-<a name="l00845"></a>00845     wollaston = wollaston ? 0 : 1;
-<a name="l00846"></a>00846 
-<a name="l00847"></a>00847     <span class="keywordflow">if</span> (skylocal && skymedian)
-<a name="l00848"></a>00848         fors_pmos_science_exit(<span class="stringliteral">"Cannot apply sky subtraction both on "</span>
-<a name="l00849"></a>00849                                <span class="stringliteral">"extracted and non-extracted spectra"</span>);
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851     cosmics = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00852"></a>00852                                      <span class="stringliteral">"fors.fors_pmos_science.cosmics"</span>, NULL);
-<a name="l00853"></a>00853 
-<a name="l00854"></a>00854     <span class="keywordflow">if</span> (cosmics)
-<a name="l00855"></a>00855         <span class="keywordflow">if</span> (!skylocal)
-<a name="l00856"></a>00856             fors_pmos_science_exit(<span class="stringliteral">"Cosmic rays correction requires "</span>
-<a name="l00857"></a>00857                                    <span class="stringliteral">"skylocal=true"</span>);
-<a name="l00858"></a>00858 
-<a name="l00859"></a>00859     slit_margin = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00860"></a>00860                                         <span class="stringliteral">"fors.fors_pmos_science.slit_margin"</span>,
-<a name="l00861"></a>00861                                         NULL);
-<a name="l00862"></a>00862     <span class="keywordflow">if</span> (slit_margin < 0)
-<a name="l00863"></a>00863         fors_pmos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00864"></a>00864 
-<a name="l00865"></a>00865     ext_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00866"></a>00866                                        <span class="stringliteral">"fors.fors_pmos_science.ext_radius"</span>,
-<a name="l00867"></a>00867                                        NULL);
-<a name="l00868"></a>00868     <span class="keywordflow">if</span> (ext_radius < 0)
-<a name="l00869"></a>00869         fors_pmos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00870"></a>00870 
-<a name="l00871"></a>00871     cont_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00872"></a>00872                                         <span class="stringliteral">"fors.fors_pmos_science.cont_radius"</span>,
-<a name="l00873"></a>00873                                         NULL);
-<a name="l00874"></a>00874     <span class="keywordflow">if</span> (cont_radius < 0)
-<a name="l00875"></a>00875         fors_pmos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00876"></a>00876 
-<a name="l00877"></a>00877     ext_mode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_pmos_science.ext_mode"</span>,
-<a name="l00878"></a>00878                                        NULL);
-<a name="l00879"></a>00879     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)
-<a name="l00880"></a>00880         fors_pmos_science_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);
-<a name="l00881"></a>00881 
-<a name="l00882"></a>00882     tolerance = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00883"></a>00883                     <span class="stringliteral">"fors.fors_pmos_science.match_tolerance"</span>, NULL);
-<a name="l00884"></a>00884     <span class="keywordflow">if</span> (tolerance <= 0.0)
-<a name="l00885"></a>00885         fors_pmos_science_exit(<span class="stringliteral">"Invalid object match tolerance"</span>);
-<a name="l00886"></a>00886 
-<a name="l00887"></a>00887     time_normalise = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00888"></a>00888                              <span class="stringliteral">"fors.fors_pmos_science.time_normalise"</span>, NULL);
-<a name="l00889"></a>00889 
-<a name="l00890"></a>00890     check = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00891"></a>00891                              <span class="stringliteral">"fors.fors_pmos_science.check"</span>, NULL);
-<a name="l00892"></a>00892 
-<a name="l00893"></a>00893     qc = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_science.qc"</span>, NULL);
-<a name="l00894"></a>00894 
-<a name="l00895"></a>00895     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00896"></a>00896 
-<a name="l00897"></a>00897     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00898"></a>00898         fors_pmos_science_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00899"></a>00899 
-<a name="l00900"></a>00900     
-<a name="l00901"></a>00901     <span class="comment">/* </span>
-<a name="l00902"></a>00902 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00903"></a>00903 <span class="comment">     */</span>
-<a name="l00904"></a>00904 
-<a name="l00905"></a>00905     cpl_msg_indent_less();
-<a name="l00906"></a>00906     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00907"></a>00907     cpl_msg_indent_more();
-<a name="l00908"></a>00908 
-<a name="l00909"></a>00909     {
-<a name="l00910"></a>00910         cpl_frameset *subframeset = cpl_frameset_duplicate(frameset);
-<a name="l00911"></a>00911         cpl_frameset_erase(subframeset, <span class="stringliteral">"MASTER_BIAS"</span>);
-<a name="l00912"></a>00912 
-<a name="l00913"></a>00913         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00914"></a>00914             fors_pmos_science_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00915"></a>00915 
-<a name="l00916"></a>00916         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00917"></a>00917             fors_pmos_science_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00918"></a>00918 
-<a name="l00919"></a>00919         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00920"></a>00920             fors_pmos_science_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00921"></a>00921 
-<a name="l00922"></a>00922         cpl_frameset_delete(subframeset);
-<a name="l00923"></a>00923     }
-<a name="l00924"></a>00924 
-<a name="l00925"></a>00925     standard = 0;
-<a name="l00926"></a>00926     pmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_PMOS"</span>);
-<a name="l00927"></a>00927 
-<a name="l00928"></a>00928     <span class="keywordflow">if</span> (pmos == 0) {
-<a name="l00929"></a>00929         pmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_PMOS"</span>);
-<a name="l00930"></a>00930         standard = 1;
-<a name="l00931"></a>00931     }
-<a name="l00932"></a>00932 
-<a name="l00933"></a>00933     <span class="keywordflow">if</span> (pmos == 0)
-<a name="l00934"></a>00934         fors_pmos_science_exit(<span class="stringliteral">"Missing input scientific frame"</span>);
-<a name="l00935"></a>00935 
-<a name="l00936"></a>00936     angles = fors_check_angles(frameset, pmos, 
-<a name="l00937"></a>00937                                 standard ? <span class="stringliteral">"STANDARD_PMOS"</span> : <span class="stringliteral">"SCIENCE_PMOS"</span>, 
-<a name="l00938"></a>00938                                 &circ);
-<a name="l00939"></a>00939     <span class="keywordflow">if</span> (angles == NULL)
-<a name="l00940"></a>00940         fors_pmos_science_exit(<span class="stringliteral">"Polarization angles could not be read"</span>);
-<a name="l00941"></a>00941 
-<a name="l00942"></a>00942     <span class="keywordflow">if</span> (circ)
-<a name="l00943"></a>00943         chromatism = 0; <span class="comment">/* Chromatism correction unrequired for </span>
-<a name="l00944"></a>00944 <span class="comment">                           circular polarimetry */</span>
-<a name="l00945"></a>00945 
-<a name="l00946"></a>00946 
-<a name="l00947"></a>00947     nscience = pmos;
-<a name="l00948"></a>00948 
-<a name="l00949"></a>00949     reduceds = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);
-<a name="l00950"></a>00950     rerrors  = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);
-<a name="l00951"></a>00951     slitss   = (cpl_table **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_table *) * nscience);
-<a name="l00952"></a>00952     mappeds  = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);
-<a name="l00953"></a>00953     skylocalmaps = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);
-<a name="l00954"></a>00954 
-<a name="l00955"></a>00955     <span class="keywordflow">if</span> (pmos) {
-<a name="l00956"></a>00956         cpl_msg_info(recipe, <span class="stringliteral">"PMOS data found"</span>);
-<a name="l00957"></a>00957         <span class="keywordflow">if</span> (standard) {
-<a name="l00958"></a>00958             science_tag             = <span class="stringliteral">"STANDARD_PMOS"</span>;
-<a name="l00959"></a>00959             reduced_science_tag     = <span class="stringliteral">"REDUCED_STD_PMOS"</span>;
-<a name="l00960"></a>00960             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_STD_PMOS"</span>;
-<a name="l00961"></a>00961             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_PMOS"</span>;
-<a name="l00962"></a>00962             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_PMOS"</span>;
-<a name="l00963"></a>00963             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_PMOS"</span>;
-<a name="l00964"></a>00964             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_STD_PMOS"</span>;
-<a name="l00965"></a>00965             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_STD_PMOS"</span>;
-<a name="l00966"></a>00966             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_PMOS"</span>;
-<a name="l00967"></a>00967             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_STD_PMOS"</span>;
-<a name="l00968"></a>00968             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_STD_PMOS"</span>;
-<a name="l00969"></a>00969             object_table_pol_tag    = <span class="stringliteral">"OBJECT_TABLE_POL_STD_PMOS"</span>;
-<a name="l00970"></a>00970             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_STD_PMOS"</span>;
-<a name="l00971"></a>00971             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_STD_PMOS"</span>;
-<a name="l00972"></a>00972             reduced_q_tag           = <span class="stringliteral">"REDUCED_Q_STD_PMOS"</span>;
-<a name="l00973"></a>00973             reduced_u_tag           = <span class="stringliteral">"REDUCED_U_STD_PMOS"</span>;
-<a name="l00974"></a>00974             reduced_v_tag           = <span class="stringliteral">"REDUCED_V_STD_PMOS"</span>;
-<a name="l00975"></a>00975             reduced_l_tag           = <span class="stringliteral">"REDUCED_L_STD_PMOS"</span>;
-<a name="l00976"></a>00976             reduced_i_tag           = <span class="stringliteral">"REDUCED_I_STD_PMOS"</span>;
-<a name="l00977"></a>00977             reduced_error_q_tag     = <span class="stringliteral">"REDUCED_ERROR_Q_STD_PMOS"</span>;
-<a name="l00978"></a>00978             reduced_error_u_tag     = <span class="stringliteral">"REDUCED_ERROR_U_STD_PMOS"</span>;
-<a name="l00979"></a>00979             reduced_error_v_tag     = <span class="stringliteral">"REDUCED_ERROR_V_STD_PMOS"</span>;
-<a name="l00980"></a>00980             reduced_error_l_tag     = <span class="stringliteral">"REDUCED_ERROR_L_STD_PMOS"</span>;
-<a name="l00981"></a>00981             reduced_error_i_tag     = <span class="stringliteral">"REDUCED_ERROR_I_STD_PMOS"</span>;
-<a name="l00982"></a>00982             reduced_nul_q_tag       = <span class="stringliteral">"REDUCED_NUL_Q_STD_PMOS"</span>;
-<a name="l00983"></a>00983             reduced_nul_u_tag       = <span class="stringliteral">"REDUCED_NUL_U_STD_PMOS"</span>;
-<a name="l00984"></a>00984             reduced_nul_v_tag       = <span class="stringliteral">"REDUCED_NUL_V_STD_PMOS"</span>;
-<a name="l00985"></a>00985             reduced_angle_tag       = <span class="stringliteral">"REDUCED_ANGLE_STD_PMOS"</span>;
-<a name="l00986"></a>00986             reduced_error_angle_tag = <span class="stringliteral">"REDUCED_ERROR_ANGLE_STD_PMOS"</span>;
-<a name="l00987"></a>00987         }
-<a name="l00988"></a>00988         <span class="keywordflow">else</span> {
-<a name="l00989"></a>00989             science_tag             = <span class="stringliteral">"SCIENCE_PMOS"</span>;
-<a name="l00990"></a>00990             reduced_science_tag     = <span class="stringliteral">"REDUCED_SCI_PMOS"</span>;
-<a name="l00991"></a>00991             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_SCI_PMOS"</span>;
-<a name="l00992"></a>00992             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_PMOS"</span>;
-<a name="l00993"></a>00993             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_PMOS"</span>;
-<a name="l00994"></a>00994             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_PMOS"</span>;
-<a name="l00995"></a>00995             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_SCI_PMOS"</span>;
-<a name="l00996"></a>00996             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_SCI_PMOS"</span>;
-<a name="l00997"></a>00997             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_PMOS"</span>;
-<a name="l00998"></a>00998             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_SCI_PMOS"</span>;
-<a name="l00999"></a>00999             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_PMOS"</span>;
-<a name="l01000"></a>01000             object_table_pol_tag    = <span class="stringliteral">"OBJECT_TABLE_POL_SCI_PMOS"</span>;
-<a name="l01001"></a>01001             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_SCI_PMOS"</span>;
-<a name="l01002"></a>01002             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_SCI_PMOS"</span>;
-<a name="l01003"></a>01003             reduced_q_tag           = <span class="stringliteral">"REDUCED_Q_SCI_PMOS"</span>;
-<a name="l01004"></a>01004             reduced_u_tag           = <span class="stringliteral">"REDUCED_U_SCI_PMOS"</span>;
-<a name="l01005"></a>01005             reduced_v_tag           = <span class="stringliteral">"REDUCED_V_SCI_PMOS"</span>;
-<a name="l01006"></a>01006             reduced_l_tag           = <span class="stringliteral">"REDUCED_L_SCI_PMOS"</span>;
-<a name="l01007"></a>01007             reduced_i_tag           = <span class="stringliteral">"REDUCED_I_SCI_PMOS"</span>;
-<a name="l01008"></a>01008             reduced_error_q_tag     = <span class="stringliteral">"REDUCED_ERROR_Q_SCI_PMOS"</span>;
-<a name="l01009"></a>01009             reduced_error_u_tag     = <span class="stringliteral">"REDUCED_ERROR_U_SCI_PMOS"</span>;
-<a name="l01010"></a>01010             reduced_error_v_tag     = <span class="stringliteral">"REDUCED_ERROR_V_SCI_PMOS"</span>;
-<a name="l01011"></a>01011             reduced_error_l_tag     = <span class="stringliteral">"REDUCED_ERROR_L_SCI_PMOS"</span>;
-<a name="l01012"></a>01012             reduced_error_i_tag     = <span class="stringliteral">"REDUCED_ERROR_I_SCI_PMOS"</span>;
-<a name="l01013"></a>01013             reduced_nul_q_tag       = <span class="stringliteral">"REDUCED_NUL_Q_SCI_PMOS"</span>;
-<a name="l01014"></a>01014             reduced_nul_u_tag       = <span class="stringliteral">"REDUCED_NUL_U_SCI_PMOS"</span>;
-<a name="l01015"></a>01015             reduced_nul_v_tag       = <span class="stringliteral">"REDUCED_NUL_V_SCI_PMOS"</span>;
-<a name="l01016"></a>01016             reduced_angle_tag       = <span class="stringliteral">"REDUCED_ANGLE_SCI_PMOS"</span>;
-<a name="l01017"></a>01017             reduced_error_angle_tag = <span class="stringliteral">"REDUCED_ERROR_ANGLE_SCI_PMOS"</span>;
-<a name="l01018"></a>01018         }
-<a name="l01019"></a>01019 
-<a name="l01020"></a>01020         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_PMOS"</span>;
-<a name="l01021"></a>01021         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_PMOS"</span>;
-<a name="l01022"></a>01022         curv_coeff_tag          = <span class="stringliteral">"CURV_COEFF_PMOS"</span>;
-<a name="l01023"></a>01023         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_PMOS"</span>;
-<a name="l01024"></a>01024 
-<a name="l01025"></a>01025         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {
-<a name="l01026"></a>01026             master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_PMOS"</span>;
-<a name="l01027"></a>01027             disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_LONG_PMOS"</span>;
-<a name="l01028"></a>01028             slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_LONG_PMOS"</span>;
-<a name="l01029"></a>01029         }
-<a name="l01030"></a>01030     }
-<a name="l01031"></a>01031 
-<a name="l01032"></a>01032     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0)
-<a name="l01033"></a>01033         fors_pmos_science_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS"</span>);
-<a name="l01034"></a>01034 
-<a name="l01035"></a>01035     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)
-<a name="l01036"></a>01036         fors_pmos_science_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);
-<a name="l01037"></a>01037 
-<a name="l01038"></a>01038     <span class="keywordflow">if</span> (skyalign >= 0)
-<a name="l01039"></a>01039         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)
-<a name="l01040"></a>01040             fors_pmos_science_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);
-<a name="l01041"></a>01041 
-<a name="l01042"></a>01042     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) == 0) {
-<a name="l01043"></a>01043         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, disp_coeff_tag);
-<a name="l01044"></a>01044         fors_pmos_science_exit(NULL);
-<a name="l01045"></a>01045     }
-<a name="l01046"></a>01046 
-<a name="l01047"></a>01047     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) > 1) {
-<a name="l01048"></a>01048         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, disp_coeff_tag);
-<a name="l01049"></a>01049         fors_pmos_science_exit(NULL);
-<a name="l01050"></a>01050     }
-<a name="l01051"></a>01051 
-<a name="l01052"></a>01052     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) == 0) {
-<a name="l01053"></a>01053         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>,
-<a name="l01054"></a>01054                       slit_location_tag);
-<a name="l01055"></a>01055         fors_pmos_science_exit(NULL);
-<a name="l01056"></a>01056     }
-<a name="l01057"></a>01057 
-<a name="l01058"></a>01058     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) > 1) {
-<a name="l01059"></a>01059         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, slit_location_tag);
-<a name="l01060"></a>01060         fors_pmos_science_exit(NULL);
-<a name="l01061"></a>01061     }
-<a name="l01062"></a>01062 
-<a name="l01063"></a>01063     <span class="keywordflow">if</span> (chromatism) {
-<a name="l01064"></a>01064         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, chrom_table_tag) == 0) {
-<a name="l01065"></a>01065             cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>,
-<a name="l01066"></a>01066                           chrom_table_tag);
-<a name="l01067"></a>01067             fors_pmos_science_exit(NULL);
-<a name="l01068"></a>01068         }
-<a name="l01069"></a>01069 
-<a name="l01070"></a>01070         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, chrom_table_tag) > 1) {
-<a name="l01071"></a>01071             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, chrom_table_tag);
-<a name="l01072"></a>01072             fors_pmos_science_exit(NULL);
-<a name="l01073"></a>01073         }
-<a name="l01074"></a>01074     }
-<a name="l01075"></a>01075 
-<a name="l01076"></a>01076     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) > 1) {
-<a name="l01077"></a>01077         <span class="keywordflow">if</span> (flatfield) {
-<a name="l01078"></a>01078             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, 
-<a name="l01079"></a>01079                           master_norm_flat_tag);
-<a name="l01080"></a>01080             fors_pmos_science_exit(NULL);
-<a name="l01081"></a>01081         }
-<a name="l01082"></a>01082         <span class="keywordflow">else</span> {
-<a name="l01083"></a>01083             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input are ignored, "</span>
-<a name="l01084"></a>01084                             <span class="stringliteral">"since flat field correction was not requested"</span>, 
-<a name="l01085"></a>01085                             master_norm_flat_tag);
-<a name="l01086"></a>01086         }
-<a name="l01087"></a>01087     }
-<a name="l01088"></a>01088 
-<a name="l01089"></a>01089     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 1) {
-<a name="l01090"></a>01090         <span class="keywordflow">if</span> (!flatfield) {
-<a name="l01091"></a>01091             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input is ignored, "</span>
-<a name="l01092"></a>01092                             <span class="stringliteral">"since flat field correction was not requested"</span>, 
-<a name="l01093"></a>01093                             master_norm_flat_tag);
-<a name="l01094"></a>01094         }
-<a name="l01095"></a>01095     }
-<a name="l01096"></a>01096 
-<a name="l01097"></a>01097     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 0) {
-<a name="l01098"></a>01098         <span class="keywordflow">if</span> (flatfield) {
-<a name="l01099"></a>01099             cpl_msg_error(recipe, <span class="stringliteral">"Flat field correction was requested, "</span>
-<a name="l01100"></a>01100                           <span class="stringliteral">"but no %s are found in input"</span>,
-<a name="l01101"></a>01101                           master_norm_flat_tag);
-<a name="l01102"></a>01102             fors_pmos_science_exit(NULL);
-<a name="l01103"></a>01103         }
-<a name="l01104"></a>01104     }
-<a name="l01105"></a>01105 
-<a name="l01106"></a>01106     <span class="keywordflow">if</span> (standard) {
-<a name="l01107"></a>01107         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, std_pmos_table_tag) > 1) {
-<a name="l01108"></a>01108             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, std_pmos_table_tag);
-<a name="l01109"></a>01109             fors_pmos_science_exit(NULL);
-<a name="l01110"></a>01110         }
-<a name="l01111"></a>01111 
-<a name="l01112"></a>01112         <span class="keywordflow">if</span> (qc) {
-<a name="l01113"></a>01113             <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, std_pmos_table_tag) == 0) {
-<a name="l01114"></a>01114                 cpl_msg_error(recipe, <span class="stringliteral">"QC computation was requested, but no "</span>
-<a name="l01115"></a>01115                               <span class="stringliteral">"%s is found in input"</span>, std_pmos_table_tag);
-<a name="l01116"></a>01116                 fors_pmos_science_exit(NULL);
-<a name="l01117"></a>01117             }
-<a name="l01118"></a>01118         }
-<a name="l01119"></a>01119     }
-<a name="l01120"></a>01120 
-<a name="l01121"></a>01121     cpl_msg_indent_less();
-<a name="l01122"></a>01122 
-<a name="l01123"></a>01123 
-<a name="l01124"></a>01124     <span class="comment">/*</span>
-<a name="l01125"></a>01125 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l01126"></a>01126 <span class="comment">     * dispersion direction from a scientific exposure</span>
-<a name="l01127"></a>01127 <span class="comment">     */</span>
-<a name="l01128"></a>01128 
-<a name="l01129"></a>01129     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01130"></a>01130 
-<a name="l01131"></a>01131     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01132"></a>01132         fors_pmos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01133"></a>01133 
-<a name="l01134"></a>01134     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l01135"></a>01135     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l01136"></a>01136         fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INSTRUME in scientific header"</span>);
-<a name="l01137"></a>01137     instrume = cpl_strdup(instrume);
-<a name="l01138"></a>01138 
-<a name="l01139"></a>01139     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l01140"></a>01140         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l01141"></a>01141     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l01142"></a>01142         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l01143"></a>01143 
-<a name="l01144"></a>01144     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l01145"></a>01145 
-<a name="l01146"></a>01146     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01147"></a>01147         fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in scientific "</span>
-<a name="l01148"></a>01148                         <span class="stringliteral">"frame header"</span>);
-<a name="l01149"></a>01149 
-<a name="l01150"></a>01150     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l01151"></a>01151         reference *= 10;
-<a name="l01152"></a>01152 
-<a name="l01153"></a>01153     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l01154"></a>01154         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l01155"></a>01155                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in scientific frame header"</span>,
-<a name="l01156"></a>01156                       reference);
-<a name="l01157"></a>01157         fors_pmos_science_exit(NULL);
-<a name="l01158"></a>01158     }
-<a name="l01159"></a>01159 
-<a name="l01160"></a>01160     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l01161"></a>01161 
-<a name="l01162"></a>01162     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l01163"></a>01163 
-<a name="l01164"></a>01164     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01165"></a>01165         fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in "</span>
-<a name="l01166"></a>01166                                <span class="stringliteral">"scientific frame header"</span>);
-<a name="l01167"></a>01167 
-<a name="l01168"></a>01168     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l01169"></a>01169         dispersion *= rebin;
-<a name="l01170"></a>01170         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l01171"></a>01171                         <span class="stringliteral">"spectral dispersion used is %f A/pixel"</span>, rebin, 
-<a name="l01172"></a>01172                         dispersion);
-<a name="l01173"></a>01173         ext_radius /= rebin;
-<a name="l01174"></a>01174         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l01175"></a>01175                         <span class="stringliteral">"extraction radius used is %d pixel"</span>, rebin, 
-<a name="l01176"></a>01176                         ext_radius);
-<a name="l01177"></a>01177     }
-<a name="l01178"></a>01178 
-<a name="l01179"></a>01179     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l01180"></a>01180 
-<a name="l01181"></a>01181     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01182"></a>01182         fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in "</span>
-<a name="l01183"></a>01183                           <span class="stringliteral">"scientific frame header"</span>);
-<a name="l01184"></a>01184 
-<a name="l01185"></a>01185     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l01186"></a>01186 
-<a name="l01187"></a>01187     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);
-<a name="l01188"></a>01188 
-<a name="l01189"></a>01189     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01190"></a>01190         fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in "</span>
-<a name="l01191"></a>01191                                <span class="stringliteral">"scientific frame header"</span>);
-<a name="l01192"></a>01192 
-<a name="l01193"></a>01193     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span>
-<a name="l01194"></a>01194 
-<a name="l01195"></a>01195     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);
-<a name="l01196"></a>01196 
-<a name="l01197"></a>01197     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) == 0) {
-<a name="l01198"></a>01198         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, curv_coeff_tag);
-<a name="l01199"></a>01199         fors_pmos_science_exit(NULL);
-<a name="l01200"></a>01200     }
-<a name="l01201"></a>01201 
-<a name="l01202"></a>01202     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) > 1) {
-<a name="l01203"></a>01203         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, curv_coeff_tag);
-<a name="l01204"></a>01204         fors_pmos_science_exit(NULL);
-<a name="l01205"></a>01205     }
-<a name="l01206"></a>01206 
-<a name="l01207"></a>01207     cpl_msg_info(recipe, <span class="stringliteral">"Load normalised flat field (if present)..."</span>);
-<a name="l01208"></a>01208     cpl_msg_indent_more();
-<a name="l01209"></a>01209 
-<a name="l01210"></a>01210     <span class="keywordflow">if</span> (flatfield) {
-<a name="l01211"></a>01211         norm_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, master_norm_flat_tag, 
-<a name="l01212"></a>01212                                    CPL_TYPE_FLOAT, 0, 1);
-<a name="l01213"></a>01213     }
-<a name="l01214"></a>01214 
-<a name="l01215"></a>01215     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01216"></a>01216 
-<a name="l01217"></a>01217         cpl_msg_indent_less();
-<a name="l01218"></a>01218         cpl_msg_info(recipe, <span class="stringliteral">"Load input sky line catalog..."</span>);
-<a name="l01219"></a>01219         cpl_msg_indent_more();
-<a name="l01220"></a>01220 
-<a name="l01221"></a>01221         wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);
-<a name="l01222"></a>01222 
-<a name="l01223"></a>01223         <span class="keywordflow">if</span> (wavelengths) {
-<a name="l01224"></a>01224             <span class="comment">/*</span>
-<a name="l01225"></a>01225 <span class="comment">             * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l01226"></a>01226 <span class="comment">             */</span>
-<a name="l01227"></a>01227 
-<a name="l01228"></a>01228             nlines = cpl_table_get_nrow(wavelengths);
-<a name="l01229"></a>01229 
-<a name="l01230"></a>01230             <span class="keywordflow">if</span> (nlines == 0)
-<a name="l01231"></a>01231                 fors_pmos_science_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);
-<a name="l01232"></a>01232 
-<a name="l01233"></a>01233             <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l01234"></a>01234                 cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span>
-<a name="l01235"></a>01235                               <span class="stringliteral">"catalog table"</span>, wcolumn);
-<a name="l01236"></a>01236                 fors_pmos_science_exit(NULL);
-<a name="l01237"></a>01237             }
-<a name="l01238"></a>01238 
-<a name="l01239"></a>01239             line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01240"></a>01240     
-<a name="l01241"></a>01241             <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l01242"></a>01242                 line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l01243"></a>01243 
-<a name="l01244"></a>01244             cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l01245"></a>01245 
-<a name="l01246"></a>01246             lines = cpl_vector_wrap(nlines, line);
-<a name="l01247"></a>01247         }
-<a name="l01248"></a>01248         <span class="keywordflow">else</span> {
-<a name="l01249"></a>01249             cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);
-<a name="l01250"></a>01250         }
-<a name="l01251"></a>01251     }
-<a name="l01252"></a>01252 
-<a name="l01253"></a>01253     <span class="comment">/*</span>
-<a name="l01254"></a>01254 <span class="comment">     * Keep a table of slit positions according to science, in order to </span>
-<a name="l01255"></a>01255 <span class="comment">     * check its consistency with those from arc and flat.</span>
-<a name="l01256"></a>01256 <span class="comment">     */</span>
-<a name="l01257"></a>01257 
-<a name="l01258"></a>01258     mask_science = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l01259"></a>01259 
-<a name="l01260"></a>01260     cpl_propertylist_delete(header); header = NULL;
-<a name="l01261"></a>01261 
-<a name="l01262"></a>01262     cpl_table_name_column(mask_science, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"science"</span>);
-<a name="l01263"></a>01263 
-<a name="l01264"></a>01264     <span class="comment">/*</span>
-<a name="l01265"></a>01265 <span class="comment">     * Load the wavelength calibration table</span>
-<a name="l01266"></a>01266 <span class="comment">     */</span>
-<a name="l01267"></a>01267 
-<a name="l01268"></a>01268     idscoeff = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, disp_coeff_tag, 1);
-<a name="l01269"></a>01269 
-<a name="l01270"></a>01270     <span class="keywordflow">if</span> (idscoeff == NULL)
-<a name="l01271"></a>01271         fors_pmos_science_exit(<span class="stringliteral">"Cannot load wavelength calibration table"</span>);
-<a name="l01272"></a>01272 
-<a name="l01273"></a>01273     <span class="comment">/*</span>
-<a name="l01274"></a>01274 <span class="comment">     * Keep a table of slit positions according to arc, in order to </span>
-<a name="l01275"></a>01275 <span class="comment">     * check its consistency with those from science and flat.</span>
-<a name="l01276"></a>01276 <span class="comment">     */</span>
-<a name="l01277"></a>01277 
-<a name="l01278"></a>01278     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, disp_coeff_tag, 0);
-<a name="l01279"></a>01279 
-<a name="l01280"></a>01280     mask_arc = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l01281"></a>01281 
-<a name="l01282"></a>01282     cpl_propertylist_delete(header); header = NULL;
-<a name="l01283"></a>01283 
-<a name="l01284"></a>01284     <span class="keywordflow">if</span> (cpl_table_move_column(mask_science, <span class="stringliteral">"xtop"</span>, mask_arc)) {
-<a name="l01285"></a>01285         cpl_error_reset();
-<a name="l01286"></a>01286         cpl_msg_warning(recipe, 
-<a name="l01287"></a>01287                         <span class="stringliteral">"Slit configuration of science and arc differs!"</span>);
-<a name="l01288"></a>01288         cpl_table_delete(mask_arc); mask_arc = NULL;
-<a name="l01289"></a>01289         <span class="keywordflow">goto</span> skip;
-<a name="l01290"></a>01290     }
-<a name="l01291"></a>01291     cpl_table_name_column(mask_science, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"arc"</span>);
-<a name="l01292"></a>01292     cpl_table_delete(mask_arc); mask_arc = NULL;
-<a name="l01293"></a>01293 
-<a name="l01294"></a>01294     <span class="keywordflow">if</span> (norm_flat) {
-<a name="l01295"></a>01295 
-<a name="l01296"></a>01296         <span class="comment">/*</span>
-<a name="l01297"></a>01297 <span class="comment">         * Keep a table of slit positions according to arc, in order to </span>
-<a name="l01298"></a>01298 <span class="comment">         * check its consistency with those from science and flat.</span>
-<a name="l01299"></a>01299 <span class="comment">         */</span>
-<a name="l01300"></a>01300 
-<a name="l01301"></a>01301         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, master_norm_flat_tag, 0);
-<a name="l01302"></a>01302 
-<a name="l01303"></a>01303         mask_flat = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l01304"></a>01304 
-<a name="l01305"></a>01305         cpl_propertylist_delete(header); header = NULL;
-<a name="l01306"></a>01306 
-<a name="l01307"></a>01307         <span class="keywordflow">if</span> (cpl_table_move_column(mask_science, <span class="stringliteral">"xtop"</span>, mask_flat)) {
-<a name="l01308"></a>01308             cpl_error_reset();
-<a name="l01309"></a>01309             cpl_msg_warning(recipe, 
-<a name="l01310"></a>01310                             <span class="stringliteral">"Slit configuration of science and flat differs!"</span>);
-<a name="l01311"></a>01311             cpl_table_delete(mask_flat); mask_flat = NULL;
-<a name="l01312"></a>01312             <span class="keywordflow">goto</span> skip;
-<a name="l01313"></a>01313         }
-<a name="l01314"></a>01314         cpl_table_name_column(mask_science, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"flat"</span>);
-<a name="l01315"></a>01315         cpl_table_delete(mask_flat); mask_flat = NULL;
-<a name="l01316"></a>01316     }
-<a name="l01317"></a>01317 
-<a name="l01318"></a>01318     cpl_table_duplicate_column(mask_science, <span class="stringliteral">"diff"</span>, mask_science, <span class="stringliteral">"science"</span>);
-<a name="l01319"></a>01319     cpl_table_subtract_columns(mask_science, <span class="stringliteral">"diff"</span>, <span class="stringliteral">"arc"</span>);
-<a name="l01320"></a>01320     cpl_table_abs_column(mask_science, <span class="stringliteral">"diff"</span>);
-<a name="l01321"></a>01321 
-<a name="l01322"></a>01322     <span class="keywordflow">if</span> (cpl_table_get_column_max(mask_science, <span class="stringliteral">"diff"</span>) > 0.01)  {
-<a name="l01323"></a>01323         cpl_msg_warning(recipe, 
-<a name="l01324"></a>01324                         <span class="stringliteral">"Slit configuration of science and arc differs!"</span>);
-<a name="l01325"></a>01325         <span class="keywordflow">goto</span> skip;
-<a name="l01326"></a>01326     }
-<a name="l01327"></a>01327 
-<a name="l01328"></a>01328     <span class="keywordflow">if</span> (norm_flat) {
-<a name="l01329"></a>01329         cpl_table_erase_column(mask_science, <span class="stringliteral">"diff"</span>);
-<a name="l01330"></a>01330 
-<a name="l01331"></a>01331         cpl_table_duplicate_column(mask_science, <span class="stringliteral">"diff"</span>, 
-<a name="l01332"></a>01332                                    mask_science, <span class="stringliteral">"science"</span>);
-<a name="l01333"></a>01333         cpl_table_subtract_columns(mask_science, <span class="stringliteral">"diff"</span>, <span class="stringliteral">"flat"</span>);
-<a name="l01334"></a>01334         cpl_table_abs_column(mask_science, <span class="stringliteral">"diff"</span>);
-<a name="l01335"></a>01335 
-<a name="l01336"></a>01336         <span class="keywordflow">if</span> (cpl_table_get_column_max(mask_science, <span class="stringliteral">"diff"</span>) > 0.01)  {
-<a name="l01337"></a>01337             cpl_msg_warning(recipe, 
-<a name="l01338"></a>01338                             <span class="stringliteral">"Slit configuration of science and flat differs!"</span>);
-<a name="l01339"></a>01339             <span class="keywordflow">goto</span> skip;
-<a name="l01340"></a>01340         }
-<a name="l01341"></a>01341     }
-<a name="l01342"></a>01342 
-<a name="l01343"></a>01343 skip:
-<a name="l01344"></a>01344 
-<a name="l01345"></a>01345     cpl_table_delete(mask_science); mask_science = NULL;
-<a name="l01346"></a>01346 
-<a name="l01347"></a>01347     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {
-<a name="l01348"></a>01348         <span class="keywordtype">int</span> k;
-<a name="l01349"></a>01349 
-<a name="l01350"></a>01350         cpl_msg_indent_less();
-<a name="l01351"></a>01351         cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific exposure of angle %.2f "</span>
-<a name="l01352"></a>01352                      <span class="stringliteral">"(%d out of %d) ..."</span>,
-<a name="l01353"></a>01353                      angles[j], j + 1, nscience);
-<a name="l01354"></a>01354         cpl_msg_indent_more();
-<a name="l01355"></a>01355 
-<a name="l01356"></a>01356         cpl_msg_info(recipe, <span class="stringliteral">"Load scientific exposure..."</span>);
-<a name="l01357"></a>01357         cpl_msg_indent_more();
-<a name="l01358"></a>01358 
-<a name="l01359"></a>01359 
-<a name="l01360"></a>01360         <span class="comment">/*</span>
-<a name="l01361"></a>01361 <span class="comment">         * FIXME: Horrible workaround to avoid the problem because of the</span>
-<a name="l01362"></a>01362 <span class="comment">         * multiple encapsulation of cpl_frameset_find() in different </span>
-<a name="l01363"></a>01363 <span class="comment">         * loading functions</span>
-<a name="l01364"></a>01364 <span class="comment">         */</span>
-<a name="l01365"></a>01365 
-<a name="l01366"></a>01366         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01367"></a>01367 
-<a name="l01368"></a>01368         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01369"></a>01369             cpl_propertylist_delete(header);
-<a name="l01370"></a>01370             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01371"></a>01371         }
-<a name="l01372"></a>01372 
-<a name="l01373"></a>01373         spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01374"></a>01374 
-<a name="l01375"></a>01375         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01376"></a>01376             cpl_image_delete(spectra);
-<a name="l01377"></a>01377             spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01378"></a>01378         }
-<a name="l01379"></a>01379 
-<a name="l01380"></a>01380         <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01381"></a>01381             fors_pmos_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l01382"></a>01382             
-<a name="l01383"></a>01383         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01384"></a>01384             fors_pmos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01385"></a>01385 
-<a name="l01386"></a>01386         alltime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l01387"></a>01387 
-<a name="l01388"></a>01388         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01389"></a>01389             fors_pmos_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l01390"></a>01390                                    <span class="stringliteral">"frame header"</span>);
-<a name="l01391"></a>01391 
-<a name="l01392"></a>01392         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame exposure time: %.2f s"</span>, 
-<a name="l01393"></a>01393                      alltime);
-<a name="l01394"></a>01394 
-<a name="l01395"></a>01395         ra = cpl_propertylist_get_double(header, <span class="stringliteral">"RA"</span>);
-<a name="l01396"></a>01396         dec = cpl_propertylist_get_double(header, <span class="stringliteral">"DEC"</span>);
-<a name="l01397"></a>01397 
-<a name="l01398"></a>01398         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01399"></a>01399             fors_pmos_science_exit(<span class="stringliteral">"Missing keywords RA and DEC in scientific "</span>
-<a name="l01400"></a>01400                                    <span class="stringliteral">"frame header"</span>);
-<a name="l01401"></a>01401 
-<a name="l01402"></a>01402         <span class="comment">/* Leave the header on for the next step... */</span>
-<a name="l01403"></a>01403 
-<a name="l01404"></a>01404         cpl_msg_indent_less();
-<a name="l01405"></a>01405 
-<a name="l01406"></a>01406         <span class="comment">/*</span>
-<a name="l01407"></a>01407 <span class="comment">         * Remove the master bias</span>
-<a name="l01408"></a>01408 <span class="comment">         */</span>
-<a name="l01409"></a>01409 
-<a name="l01410"></a>01410         cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l01411"></a>01411 
-<a name="l01412"></a>01412         bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, CPL_TYPE_FLOAT, 0, 1);
-<a name="l01413"></a>01413 
-<a name="l01414"></a>01414         <span class="keywordflow">if</span> (bias == NULL)
-<a name="l01415"></a>01415             fors_pmos_science_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l01416"></a>01416 
-<a name="l01417"></a>01417         <span class="keywordflow">if</span> (doit) {
-<a name="l01418"></a>01418             <span class="keywordflow">if</span> (j == 0)
-<a name="l01419"></a>01419                blevel = cpl_image_get_mean(bias); 
-<a name="l01420"></a>01420             <a class="code" href="group__moses.html#g7557973371ca804e0fab92c40b833f3c">mos_randomise_image</a>(spectra, ron, gain, blevel);
-<a name="l01421"></a>01421         }
-<a name="l01422"></a>01422 
-<a name="l01423"></a>01423         overscans = <a class="code" href="group__moses.html#g83424b665852cb22061bea76a664a730">mos_load_overscans_fors</a>(header);
-<a name="l01424"></a>01424 
-<a name="l01425"></a>01425         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(spectra, bias, overscans);
-<a name="l01426"></a>01426         cpl_image_delete(spectra); spectra = dummy; dummy = NULL;
-<a name="l01427"></a>01427         cpl_image_delete(bias); bias = NULL;
-<a name="l01428"></a>01428         cpl_table_delete(overscans); overscans = NULL;
-<a name="l01429"></a>01429 
-<a name="l01430"></a>01430         <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01431"></a>01431             fors_pmos_science_exit(<span class="stringliteral">"Cannot remove bias from scientific frame"</span>);
-<a name="l01432"></a>01432 
-<a name="l01433"></a>01433         ccd_xsize = nx = cpl_image_get_size_x(spectra);
-<a name="l01434"></a>01434         ccd_ysize = ny = cpl_image_get_size_y(spectra);
-<a name="l01435"></a>01435 
-<a name="l01436"></a>01436         <span class="keywordflow">if</span> (flatfield) {
-<a name="l01437"></a>01437 
-<a name="l01438"></a>01438             <span class="keywordflow">if</span> (norm_flat) {
-<a name="l01439"></a>01439                 cpl_msg_info(recipe, <span class="stringliteral">"Apply flat field correction..."</span>);
-<a name="l01440"></a>01440                 <span class="keywordflow">if</span> (cpl_image_divide(spectra, norm_flat) != CPL_ERROR_NONE) {
-<a name="l01441"></a>01441                     cpl_msg_error(recipe, 
-<a name="l01442"></a>01442                                   <span class="stringliteral">"Failure of flat field correction: %s"</span>,
-<a name="l01443"></a>01443                                   cpl_error_get_message());
-<a name="l01444"></a>01444                     fors_pmos_science_exit(NULL);
-<a name="l01445"></a>01445                 }
-<a name="l01446"></a>01446             }
-<a name="l01447"></a>01447             <span class="keywordflow">else</span> {
-<a name="l01448"></a>01448                 cpl_msg_error(recipe, <span class="stringliteral">"Cannot load input %s for flat field "</span>
-<a name="l01449"></a>01449                               <span class="stringliteral">"correction"</span>, master_norm_flat_tag);
-<a name="l01450"></a>01450                 fors_pmos_science_exit(NULL);
-<a name="l01451"></a>01451             }
-<a name="l01452"></a>01452 
-<a name="l01453"></a>01453         }
-<a name="l01454"></a>01454 
-<a name="l01455"></a>01455         <span class="comment">/*</span>
-<a name="l01456"></a>01456 <span class="comment">         * Load the spectral curvature table</span>
-<a name="l01457"></a>01457 <span class="comment">         */</span>
-<a name="l01458"></a>01458 
-<a name="l01459"></a>01459         polytraces = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, curv_coeff_tag, 1);
-<a name="l01460"></a>01460         <span class="keywordflow">if</span> (polytraces == NULL)
-<a name="l01461"></a>01461             fors_pmos_science_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);
-<a name="l01462"></a>01462 
-<a name="l01463"></a>01463         <span class="comment">/*</span>
-<a name="l01464"></a>01464 <span class="comment">         * Load the slit location table</span>
-<a name="l01465"></a>01465 <span class="comment">         */</span>
-<a name="l01466"></a>01466 
-<a name="l01467"></a>01467         slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l01468"></a>01468         <span class="keywordflow">if</span> (slits == NULL)
-<a name="l01469"></a>01469             fors_pmos_science_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l01470"></a>01470 
-<a name="l01471"></a>01471         cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific spectra..."</span>);
-<a name="l01472"></a>01472 
-<a name="l01473"></a>01473         <span class="comment">/*</span>
-<a name="l01474"></a>01474 <span class="comment">         * This one will also generate the spatial map from the spectral </span>
-<a name="l01475"></a>01475 <span class="comment">         * curvature table (in the case of multislit data)</span>
-<a name="l01476"></a>01476 <span class="comment">         */</span>
-<a name="l01477"></a>01477 
-<a name="l01478"></a>01478         coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01479"></a>01479 
-<a name="l01480"></a>01480         smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, 
-<a name="l01481"></a>01481                                           reference, startwavelength, 
-<a name="l01482"></a>01482                                           endwavelength, dispersion, 
-<a name="l01483"></a>01483                                           flux, coordinate);
-<a name="l01484"></a>01484 
-<a name="l01485"></a>01485         <span class="comment">/*</span>
-<a name="l01486"></a>01486 <span class="comment">         * Generate a rectified wavelength map from the wavelength calibration </span>
-<a name="l01487"></a>01487 <span class="comment">         * table</span>
-<a name="l01488"></a>01488 <span class="comment">         */</span>
-<a name="l01489"></a>01489 
-<a name="l01490"></a>01490         rainbow = <a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength, 
-<a name="l01491"></a>01491                                    endwavelength);
-<a name="l01492"></a>01492 
-<a name="l01493"></a>01493         <span class="keywordflow">if</span> (dispersion > 1.0)
-<a name="l01494"></a>01494             highres = 0;
-<a name="l01495"></a>01495         <span class="keywordflow">else</span>
-<a name="l01496"></a>01496             highres = 1;
-<a name="l01497"></a>01497 
-<a name="l01498"></a>01498         <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01499"></a>01499             <span class="keywordflow">if</span> (skyalign) {
-<a name="l01500"></a>01500                 cpl_msg_info(recipe, 
-<a name="l01501"></a>01501                              <span class="stringliteral">"Align wavelength solution to reference skylines "</span>
-<a name="l01502"></a>01502                              <span class="stringliteral">"applying %d order residual fit..."</span>, skyalign);
-<a name="l01503"></a>01503             }
-<a name="l01504"></a>01504             <span class="keywordflow">else</span> {
-<a name="l01505"></a>01505                 cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l01506"></a>01506                              <span class="stringliteral">"skylines applying median offset..."</span>);
-<a name="l01507"></a>01507             }
-<a name="l01508"></a>01508 
-<a name="l01509"></a>01509             <span class="keywordflow">if</span> (!j) {
-<a name="l01510"></a>01510                 offsets = <a class="code" href="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3">mos_wavelength_align</a>(smapped, slits, reference, 
-<a name="l01511"></a>01511                                                startwavelength, endwavelength, 
-<a name="l01512"></a>01512                                                idscoeff, lines, highres, 
-<a name="l01513"></a>01513                                                skyalign, rainbow, 4);
-<a name="l01514"></a>01514                 <span class="keywordflow">if</span> (offsets) {
-<a name="l01515"></a>01515                     <span class="keywordflow">if</span> (standard)
-<a name="l01516"></a>01516                         cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength "</span>
-<a name="l01517"></a>01517                                         <span class="stringliteral">"solution to reference sky lines may "</span>
-<a name="l01518"></a>01518                                         <span class="stringliteral">"be unreliable in this case!"</span>);
-<a name="l01519"></a>01519 
-<a name="l01520"></a>01520                     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, offsets, skylines_offsets_tag,
-<a name="l01521"></a>01521                                        NULL, parlist, recipe, version)) {
-<a name="l01522"></a>01522                         fors_pmos_science_exit(NULL);
-<a name="l01523"></a>01523                     }
-<a name="l01524"></a>01524 
-<a name="l01525"></a>01525                 } <span class="keywordflow">else</span> {
-<a name="l01526"></a>01526                     cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength "</span>
-<a name="l01527"></a>01527                                     <span class="stringliteral">"solution to reference sky lines could "</span>
-<a name="l01528"></a>01528                                     <span class="stringliteral">"not be done!"</span>);
-<a name="l01529"></a>01529                     skyalign = -1;
-<a name="l01530"></a>01530                 }
-<a name="l01531"></a>01531             }
-<a name="l01532"></a>01532 
-<a name="l01533"></a>01533 
-<a name="l01534"></a>01534         }
-<a name="l01535"></a>01535 
-<a name="l01536"></a>01536         wavemap = <a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(coordinate, rainbow, slits, 
-<a name="l01537"></a>01537                                       polytraces, reference, 
-<a name="l01538"></a>01538                                       startwavelength, endwavelength,
-<a name="l01539"></a>01539                                       dispersion);
-<a name="l01540"></a>01540 
-<a name="l01541"></a>01541 
-<a name="l01542"></a>01542         cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l01543"></a>01543         cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l01544"></a>01544 
-<a name="l01545"></a>01545         <span class="comment">/*</span>
-<a name="l01546"></a>01546 <span class="comment">         * Here the wavelength calibrated slit spectra are created. This frame</span>
-<a name="l01547"></a>01547 <span class="comment">         * contains sky_science.</span>
-<a name="l01548"></a>01548 <span class="comment">         */</span>
-<a name="l01549"></a>01549 
-<a name="l01550"></a>01550         mapped_sky = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, reference,
-<a name="l01551"></a>01551                                                 startwavelength, endwavelength,
-<a name="l01552"></a>01552                                                 dispersion, idscoeff, flux);
-<a name="l01553"></a>01553 
-<a name="l01554"></a>01554         <span class="keywordflow">if</span> (!j) {
-<a name="l01555"></a>01555             cpl_msg_indent_less();
-<a name="l01556"></a>01556             cpl_msg_info(recipe, 
-<a name="l01557"></a>01557                          <span class="stringliteral">"Check applied wavelength against skylines..."</span>);
-<a name="l01558"></a>01558             cpl_msg_indent_more();
-<a name="l01559"></a>01559 
-<a name="l01560"></a>01560             mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(mapped_sky, lines, startwavelength,
-<a name="l01561"></a>01561                                            dispersion, 6, highres);
-<a name="l01562"></a>01562 
-<a name="l01563"></a>01563 
-<a name="l01564"></a>01564             cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f"</span>, mean_rms);
-<a name="l01565"></a>01565 
-<a name="l01566"></a>01566             mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l01567"></a>01567 
-<a name="l01568"></a>01568             cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,
-<a name="l01569"></a>01569                          mean_rms, mean_rms * dispersion);
-<a name="l01570"></a>01570         }
-<a name="l01571"></a>01571 
-<a name="l01572"></a>01572         save_header = cpl_propertylist_duplicate(header);
-<a name="l01573"></a>01573 
-<a name="l01574"></a>01574         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01575"></a>01575         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01576"></a>01576         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01577"></a>01577                                        startwavelength + dispersion/2);
-<a name="l01578"></a>01578         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01579"></a>01579         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01580"></a>01580         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01581"></a>01581         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01582"></a>01582         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01583"></a>01583         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01584"></a>01584         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01585"></a>01585 
-<a name="l01586"></a>01586         <span class="keywordflow">if</span> (time_normalise) {
-<a name="l01587"></a>01587             dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);
-<a name="l01588"></a>01588 
-<a name="l01589"></a>01589             <span class="keywordflow">if</span> (!j) {
-<a name="l01590"></a>01590                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01591"></a>01591                                        mapped_science_sky_tag,
-<a name="l01592"></a>01592                                        recipe, version)) {
-<a name="l01593"></a>01593                     fors_pmos_science_exit(NULL);
-<a name="l01594"></a>01594                 }
-<a name="l01595"></a>01595             }
-<a name="l01596"></a>01596 
-<a name="l01597"></a>01597             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(dummy, mapped_science_sky_tag, header)) {
-<a name="l01598"></a>01598                 fors_pmos_science_exit(NULL);
-<a name="l01599"></a>01599             }
-<a name="l01600"></a>01600 
-<a name="l01601"></a>01601             cpl_image_delete(dummy); dummy = NULL;
-<a name="l01602"></a>01602         }
-<a name="l01603"></a>01603         <span class="keywordflow">else</span> {
-<a name="l01604"></a>01604 
-<a name="l01605"></a>01605             <span class="keywordflow">if</span> (!j) {
-<a name="l01606"></a>01606                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01607"></a>01607                                        mapped_science_sky_tag,
-<a name="l01608"></a>01608                                        recipe, version)) {
-<a name="l01609"></a>01609                     fors_pmos_science_exit(NULL);
-<a name="l01610"></a>01610                 }
-<a name="l01611"></a>01611             }
-<a name="l01612"></a>01612 
-<a name="l01613"></a>01613             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(mapped_sky,
-<a name="l01614"></a>01614                                    mapped_science_sky_tag, header)) {
-<a name="l01615"></a>01615                 fors_pmos_science_exit(NULL);
-<a name="l01616"></a>01616             }
-<a name="l01617"></a>01617 
-<a name="l01618"></a>01618         }
-<a name="l01619"></a>01619 
-<a name="l01620"></a>01620         <span class="keywordflow">if</span> (skymedian == 0 && skylocal == 0) {
-<a name="l01621"></a>01621             cpl_image_delete(mapped_sky); mapped_sky = NULL;
-<a name="l01622"></a>01622         }
-<a name="l01623"></a>01623 
-<a name="l01624"></a>01624         <span class="keywordflow">if</span> (skylocal) {
-<a name="l01625"></a>01625 
-<a name="l01626"></a>01626             cpl_msg_indent_less();
-<a name="l01627"></a>01627 
-<a name="l01628"></a>01628             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l01629"></a>01629             cpl_msg_indent_more();
-<a name="l01630"></a>01630             skymap = <a class="code" href="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f">mos_subtract_sky</a>(spectra, slits, polytraces, reference,
-<a name="l01631"></a>01631                                   startwavelength, endwavelength, dispersion);
-<a name="l01632"></a>01632 
-<a name="l01633"></a>01633             <span class="keywordflow">if</span> (skymap) {
-<a name="l01634"></a>01634                 <span class="keywordflow">if</span> (time_normalise)
-<a name="l01635"></a>01635                     cpl_image_divide_scalar(skymap, alltime);
-<a name="l01636"></a>01636 
-<a name="l01637"></a>01637                 <span class="keywordflow">if</span> (!j) {
-<a name="l01638"></a>01638                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01639"></a>01639                                            unmapped_sky_tag,
-<a name="l01640"></a>01640                                            recipe, version)) {
-<a name="l01641"></a>01641                         fors_pmos_science_exit(NULL);
-<a name="l01642"></a>01642                     }
-<a name="l01643"></a>01643                 }
-<a name="l01644"></a>01644 
-<a name="l01645"></a>01645                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(skymap, unmapped_sky_tag,
-<a name="l01646"></a>01646                                        save_header)) {
-<a name="l01647"></a>01647                     fors_pmos_science_exit(NULL);
-<a name="l01648"></a>01648                 }
-<a name="l01649"></a>01649 
-<a name="l01650"></a>01650                 cpl_image_delete(skymap); skymap = NULL;
-<a name="l01651"></a>01651 
-<a name="l01652"></a>01652                 <span class="keywordflow">if</span> (!j) {
-<a name="l01653"></a>01653                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01654"></a>01654                                            unmapped_science_tag,
-<a name="l01655"></a>01655                                            recipe, version)) {
-<a name="l01656"></a>01656                         fors_pmos_science_exit(NULL);
-<a name="l01657"></a>01657                     }
-<a name="l01658"></a>01658                 }
-<a name="l01659"></a>01659 
-<a name="l01660"></a>01660                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(spectra, unmapped_science_tag,
-<a name="l01661"></a>01661                                        save_header)) {
-<a name="l01662"></a>01662                     fors_pmos_science_exit(NULL);
-<a name="l01663"></a>01663                 }
-<a name="l01664"></a>01664 
-<a name="l01665"></a>01665                 <span class="keywordflow">if</span> (cosmics) {
-<a name="l01666"></a>01666                     cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);
-<a name="l01667"></a>01667                     <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(spectra, gain, -1., -1.);
-<a name="l01668"></a>01668                 }
-<a name="l01669"></a>01669 
-<a name="l01670"></a>01670                 <span class="comment">/*</span>
-<a name="l01671"></a>01671 <span class="comment">                 * The spatially rectified image, that contained the sky,</span>
-<a name="l01672"></a>01672 <span class="comment">                 * is replaced by a sky-subtracted spatially rectified image:</span>
-<a name="l01673"></a>01673 <span class="comment">                 */</span>
-<a name="l01674"></a>01674 
-<a name="l01675"></a>01675                 cpl_image_delete(smapped); smapped = NULL;
-<a name="l01676"></a>01676 
-<a name="l01677"></a>01677                 smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, 
-<a name="l01678"></a>01678                                                   reference, startwavelength, 
-<a name="l01679"></a>01679                                                   endwavelength, dispersion, 
-<a name="l01680"></a>01680                                                   flux, NULL);
-<a name="l01681"></a>01681             }
-<a name="l01682"></a>01682             <span class="keywordflow">else</span> {
-<a name="l01683"></a>01683                 cpl_msg_warning(recipe, <span class="stringliteral">"Sky subtraction failure"</span>);
-<a name="l01684"></a>01684                 <span class="keywordflow">if</span> (cosmics)
-<a name="l01685"></a>01685                     cpl_msg_warning(recipe, 
-<a name="l01686"></a>01686                                     <span class="stringliteral">"Cosmic rays removal not performed!"</span>);
-<a name="l01687"></a>01687                 cosmics = skylocal = 0;
-<a name="l01688"></a>01688             }
-<a name="l01689"></a>01689         }
-<a name="l01690"></a>01690 
-<a name="l01691"></a>01691         cpl_image_delete(spectra); spectra = NULL;
-<a name="l01692"></a>01692         cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l01693"></a>01693 
-<a name="l01694"></a>01694         <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01695"></a>01695             save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01696"></a>01696 
-<a name="l01697"></a>01697             <span class="keywordflow">if</span> (!j) {
-<a name="l01698"></a>01698                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01699"></a>01699                                        wavelength_map_sky_tag,
-<a name="l01700"></a>01700                                        recipe, version)) {
-<a name="l01701"></a>01701                     fors_pmos_science_exit(NULL);
-<a name="l01702"></a>01702                 }
-<a name="l01703"></a>01703             }
-<a name="l01704"></a>01704 
-<a name="l01705"></a>01705             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(wavemap, wavelength_map_sky_tag,
-<a name="l01706"></a>01706                                    save_header)) {
-<a name="l01707"></a>01707                 fors_pmos_science_exit(NULL);
-<a name="l01708"></a>01708             }
-<a name="l01709"></a>01709         }
-<a name="l01710"></a>01710 
-<a name="l01711"></a>01711         cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l01712"></a>01712 
-<a name="l01713"></a>01713         mapped = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, reference,
-<a name="l01714"></a>01714                                             startwavelength, endwavelength,
-<a name="l01715"></a>01715                                             dispersion, idscoeff, flux);
-<a name="l01716"></a>01716 
-<a name="l01717"></a>01717         cpl_image_delete(smapped); smapped = NULL;
-<a name="l01718"></a>01718 
-<a name="l01719"></a>01719         <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01720"></a>01720             <span class="keywordflow">if</span> (!j) {
-<a name="l01721"></a>01721                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_coeff_sky_tag,
-<a name="l01722"></a>01722                                    NULL, parlist, recipe, version)) {
-<a name="l01723"></a>01723                     fors_pmos_science_exit(NULL);
-<a name="l01724"></a>01724                 }
-<a name="l01725"></a>01725             }
-<a name="l01726"></a>01726         }
-<a name="l01727"></a>01727 
-<a name="l01728"></a>01728         <span class="keywordflow">if</span> (skymedian) {
-<a name="l01729"></a>01729             cpl_msg_indent_less();
-<a name="l01730"></a>01730             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l01731"></a>01731             cpl_msg_indent_more();
-<a name="l01732"></a>01732        
-<a name="l01733"></a>01733             skylocalmap = <a class="code" href="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a">mos_sky_local_old</a>(mapped, slits);       
-<a name="l01734"></a>01734             cpl_image_subtract(mapped, skylocalmap);
-<a name="l01735"></a>01735             cpl_image_delete(skylocalmap); skylocalmap = NULL;
-<a name="l01736"></a>01736         }
-<a name="l01737"></a>01737 
-<a name="l01738"></a>01738         <span class="keywordflow">if</span> (skymedian || skylocal) {
-<a name="l01739"></a>01739 
-<a name="l01740"></a>01740             skylocalmap = cpl_image_subtract_create(mapped_sky, mapped);
-<a name="l01741"></a>01741 
-<a name="l01742"></a>01742             cpl_image_delete(mapped_sky); mapped_sky = NULL;
-<a name="l01743"></a>01743 
-<a name="l01744"></a>01744             <span class="keywordflow">if</span> (time_normalise) {
-<a name="l01745"></a>01745                 dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);
-<a name="l01746"></a>01746 
-<a name="l01747"></a>01747                 <span class="keywordflow">if</span> (!j) {
-<a name="l01748"></a>01748                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01749"></a>01749                                            mapped_sky_tag,
-<a name="l01750"></a>01750                                            recipe, version)) {
-<a name="l01751"></a>01751                         fors_pmos_science_exit(NULL);
-<a name="l01752"></a>01752                     }
-<a name="l01753"></a>01753                 }
-<a name="l01754"></a>01754 
-<a name="l01755"></a>01755                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(dummy, mapped_sky_tag,
-<a name="l01756"></a>01756                                        header)) {
-<a name="l01757"></a>01757                     fors_pmos_science_exit(NULL);
-<a name="l01758"></a>01758                 }
-<a name="l01759"></a>01759 
-<a name="l01760"></a>01760                 cpl_image_delete(dummy); dummy = NULL;
-<a name="l01761"></a>01761             }
-<a name="l01762"></a>01762             <span class="keywordflow">else</span> {
-<a name="l01763"></a>01763                 <span class="keywordflow">if</span> (!j) {
-<a name="l01764"></a>01764                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01765"></a>01765                                            mapped_sky_tag,
-<a name="l01766"></a>01766                                            recipe, version)) {
-<a name="l01767"></a>01767                         fors_pmos_science_exit(NULL);
-<a name="l01768"></a>01768                     }
-<a name="l01769"></a>01769                 }
-<a name="l01770"></a>01770 
-<a name="l01771"></a>01771                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(skylocalmap, mapped_sky_tag,
-<a name="l01772"></a>01772                                        header)) {
-<a name="l01773"></a>01773                     fors_pmos_science_exit(NULL);
-<a name="l01774"></a>01774                 }
-<a name="l01775"></a>01775             }
-<a name="l01776"></a>01776 
-<a name="l01777"></a>01777             skylocalmaps[j] = skylocalmap;
-<a name="l01778"></a>01778 
-<a name="l01779"></a>01779             cpl_msg_indent_less();
-<a name="l01780"></a>01780             cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);
-<a name="l01781"></a>01781             cpl_msg_indent_more();
-<a name="l01782"></a>01782 
-<a name="l01783"></a>01783             <span class="keywordflow">if</span> (!j) {
-<a name="l01784"></a>01784                 origslits = cpl_table_duplicate(slits);
-<a name="l01785"></a>01785                 nslits = cpl_table_get_nrow(slits);
-<a name="l01786"></a>01786             }
-<a name="l01787"></a>01787 
-<a name="l01788"></a>01788             <span class="keywordflow">if</span> (cosmics || nscience > 1) {
-<a name="l01789"></a>01789                 dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped, slits, slit_margin, 
-<a name="l01790"></a>01790                                            ext_radius, cont_radius);
-<a name="l01791"></a>01791             }
-<a name="l01792"></a>01792             <span class="keywordflow">else</span> {
-<a name="l01793"></a>01793                 mapped_cleaned = cpl_image_duplicate(mapped);
-<a name="l01794"></a>01794                 <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);
-<a name="l01795"></a>01795                 dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin, 
-<a name="l01796"></a>01796                                            ext_radius, cont_radius);
-<a name="l01797"></a>01797 
-<a name="l01798"></a>01798                 cpl_image_delete(mapped_cleaned); mapped_cleaned = NULL;
-<a name="l01799"></a>01799             }
-<a name="l01800"></a>01800 
-<a name="l01801"></a>01801             cpl_image_delete(dummy); dummy = NULL;
-<a name="l01802"></a>01802 
-<a name="l01803"></a>01803         }
-<a name="l01804"></a>01804 
-<a name="l01805"></a>01805         slitss[j]  = slits;
-<a name="l01806"></a>01806         mappeds[j] = mapped;
-<a name="l01807"></a>01807 
-<a name="l01808"></a>01808         cpl_msg_indent_less();
-<a name="l01809"></a>01809 
-<a name="l01810"></a>01810         cpl_propertylist_delete(header); header = NULL;
-<a name="l01811"></a>01811         cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01812"></a>01812     }
-<a name="l01813"></a>01813 
-<a name="l01814"></a>01814     cpl_table_delete(offsets); offsets = NULL;
-<a name="l01815"></a>01815     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l01816"></a>01816 
-<a name="l01817"></a>01817     cpl_image_delete(norm_flat); norm_flat = NULL;
-<a name="l01818"></a>01818     cpl_vector_delete(lines); lines = NULL;
-<a name="l01819"></a>01819 
-<a name="l01820"></a>01820         
-<a name="l01821"></a>01821     cpl_msg_indent_less();
-<a name="l01822"></a>01822     cpl_msg_info(recipe, 
-<a name="l01823"></a>01823                  <span class="stringliteral">"Check object detection in both beams for all angles..."</span>);
-<a name="l01824"></a>01824     cpl_msg_indent_more();
-<a name="l01825"></a>01825 
-<a name="l01826"></a>01826     <span class="comment">/* </span>
-<a name="l01827"></a>01827 <span class="comment">     * House keeping - selection of objects for which information required </span>
-<a name="l01828"></a>01828 <span class="comment">     * for Stokes parameters computation is present </span>
-<a name="l01829"></a>01829 <span class="comment">     */</span>
-<a name="l01830"></a>01830 
-<a name="l01831"></a>01831     error = <a class="code" href="group__moses.html#g621083edda685c07a318aa94f53bce6f">mos_object_intersect</a>(slitss, origslits, nscience, tolerance);
-<a name="l01832"></a>01832     <span class="keywordflow">if</span> (error == CPL_ERROR_DATA_NOT_FOUND) {
-<a name="l01833"></a>01833         cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: no Stokes "</span>
-<a name="l01834"></a>01834                        <span class="stringliteral">"parameters to compute!"</span>);
-<a name="l01835"></a>01835         <span class="keywordflow">for</span> (j = 0; j < nscience; j++)
-<a name="l01836"></a>01836             cpl_table_delete(slitss[j]);
-<a name="l01837"></a>01837         cpl_free(slitss);
-<a name="l01838"></a>01838         cpl_table_delete(origslits);
-<a name="l01839"></a>01839         <span class="keywordflow">return</span> 0;
-<a name="l01840"></a>01840     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (error) {
-<a name="l01841"></a>01841         fors_pmos_science_exit(<span class="stringliteral">"Problem in polarimetric object selection"</span>);
-<a name="l01842"></a>01842     }
-<a name="l01843"></a>01843 
-<a name="l01844"></a>01844     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, origslits, object_table_pol_tag,
-<a name="l01845"></a>01845                        NULL, parlist, recipe, version)) {
-<a name="l01846"></a>01846         fors_pmos_science_exit(NULL);
-<a name="l01847"></a>01847     }
-<a name="l01848"></a>01848 
-<a name="l01849"></a>01849     <span class="comment">/*</span>
-<a name="l01850"></a>01850 <span class="comment">     * Save also object tables per angle after intersection</span>
-<a name="l01851"></a>01851 <span class="comment">     */</span>
-<a name="l01852"></a>01852 
-<a name="l01853"></a>01853     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {
-<a name="l01854"></a>01854         <span class="keywordflow">if</span> (!j) {
-<a name="l01855"></a>01855             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist, object_table_tag,
-<a name="l01856"></a>01856                                    recipe, version)) {
-<a name="l01857"></a>01857                 fors_pmos_science_exit(NULL);
-<a name="l01858"></a>01858             }
-<a name="l01859"></a>01859         }
-<a name="l01860"></a>01860 
-<a name="l01861"></a>01861         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">dfs_save_table_ext</a>(slitss[j], object_table_tag, NULL)) {
-<a name="l01862"></a>01862             fors_pmos_science_exit(NULL);
-<a name="l01863"></a>01863         }
-<a name="l01864"></a>01864     }
-<a name="l01865"></a>01865 
-<a name="l01866"></a>01866     nobjs_per_slit = <a class="code" href="group__moses.html#ge887675f0978f93eb562934c909590e7">fors_get_nobjs_perslit</a>(origslits);
-<a name="l01867"></a>01867 
-<a name="l01868"></a>01868     cpl_msg_indent_less();
-<a name="l01869"></a>01869     cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);
-<a name="l01870"></a>01870     cpl_msg_indent_more();
-<a name="l01871"></a>01871 
-<a name="l01872"></a>01872     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {
-<a name="l01873"></a>01873         <span class="keywordtype">int</span> k;
-<a name="l01874"></a>01874 
-<a name="l01875"></a>01875         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01876"></a>01876 
-<a name="l01877"></a>01877         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {
-<a name="l01878"></a>01878             cpl_propertylist_delete(header);
-<a name="l01879"></a>01879             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01880"></a>01880         }
-<a name="l01881"></a>01881 
-<a name="l01882"></a>01882         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01883"></a>01883         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01884"></a>01884         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01885"></a>01885                                 startwavelength + (dispersion * group)/2);
-<a name="l01886"></a>01886         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01887"></a>01887         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion * group);
-<a name="l01888"></a>01888         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01889"></a>01889         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01890"></a>01890         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01891"></a>01891         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01892"></a>01892         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01893"></a>01893 
-<a name="l01894"></a>01894         <span class="keywordflow">if</span> (skymedian || skylocal) {
-<a name="l01895"></a>01895 
-<a name="l01896"></a>01896             cpl_msg_info(recipe, <span class="stringliteral">"Extracting at angle %.2f (%d out of %d) ..."</span>,
-<a name="l01897"></a>01897                          angles[j], j + 1, nscience);
-<a name="l01898"></a>01898 
-<a name="l01899"></a>01899             images = <a class="code" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">mos_extract_objects</a>(mappeds[j], skylocalmaps[j],
-<a name="l01900"></a>01900                                          origslits, 
-<a name="l01901"></a>01901                                          ext_mode, ron, gain, 1);
-<a name="l01902"></a>01902 
-<a name="l01903"></a>01903             cpl_image_delete(skylocalmaps[j]); skylocalmaps[j] = NULL;
-<a name="l01904"></a>01904 
-<a name="l01905"></a>01905             <span class="keywordflow">if</span> (images) {
-<a name="l01906"></a>01906                 <span class="keywordflow">if</span> (time_normalise)
-<a name="l01907"></a>01907                     cpl_image_divide_scalar(images[0], alltime);
-<a name="l01908"></a>01908 
-<a name="l01909"></a>01909                 <a class="code" href="group__moses.html#gc189c00acf90455029854a0517e89549">mos_rebin_signal</a>(images, group);
-<a name="l01910"></a>01910 
-<a name="l01911"></a>01911                 <span class="keywordflow">if</span> (!j) {
-<a name="l01912"></a>01912                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01913"></a>01913                                            reduced_science_tag,
-<a name="l01914"></a>01914                                            recipe, version)) {
-<a name="l01915"></a>01915                         fors_pmos_science_exit(NULL);
-<a name="l01916"></a>01916                     }
-<a name="l01917"></a>01917                 }
-<a name="l01918"></a>01918 
-<a name="l01919"></a>01919                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(images[0], reduced_science_tag,
-<a name="l01920"></a>01920                                        header)) {
-<a name="l01921"></a>01921                     fors_pmos_science_exit(NULL);
-<a name="l01922"></a>01922                 }
-<a name="l01923"></a>01923 
-<a name="l01924"></a>01924                 reduceds[j] = images[0];
-<a name="l01925"></a>01925     
-<a name="l01926"></a>01926                 <span class="keywordflow">if</span> (time_normalise)
-<a name="l01927"></a>01927                     cpl_image_divide_scalar(images[1], alltime);
-<a name="l01928"></a>01928 
-<a name="l01929"></a>01929                 <a class="code" href="group__moses.html#gc189c00acf90455029854a0517e89549">mos_rebin_signal</a>(images + 1, group);
-<a name="l01930"></a>01930 
-<a name="l01931"></a>01931                 <span class="keywordflow">if</span> (!j) {
-<a name="l01932"></a>01932                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01933"></a>01933                                            reduced_sky_tag,
-<a name="l01934"></a>01934                                            recipe, version)) {
-<a name="l01935"></a>01935                         fors_pmos_science_exit(NULL);
-<a name="l01936"></a>01936                     }
-<a name="l01937"></a>01937                 }
-<a name="l01938"></a>01938 
-<a name="l01939"></a>01939                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(images[1], reduced_sky_tag,
-<a name="l01940"></a>01940                                        header)) {
-<a name="l01941"></a>01941                     fors_pmos_science_exit(NULL);
-<a name="l01942"></a>01942                 }
-<a name="l01943"></a>01943                 cpl_image_delete(images[1]);
-<a name="l01944"></a>01944     
-<a name="l01945"></a>01945                 <span class="keywordflow">if</span> (time_normalise)
-<a name="l01946"></a>01946                     cpl_image_divide_scalar(images[2], alltime);
-<a name="l01947"></a>01947 
-<a name="l01948"></a>01948                 <a class="code" href="group__moses.html#gc88e237fcb474d9b3fe7d7caed75f0e3">mos_rebin_error</a>(images + 2, group);
-<a name="l01949"></a>01949 
-<a name="l01950"></a>01950                 <span class="keywordflow">if</span> (!j) {
-<a name="l01951"></a>01951                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01952"></a>01952                                            reduced_error_tag,
-<a name="l01953"></a>01953                                            recipe, version)) {
-<a name="l01954"></a>01954                         fors_pmos_science_exit(NULL);
-<a name="l01955"></a>01955                     }
-<a name="l01956"></a>01956                 }
-<a name="l01957"></a>01957 
-<a name="l01958"></a>01958                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(images[2], reduced_error_tag,
-<a name="l01959"></a>01959                                        header)) {
-<a name="l01960"></a>01960                     fors_pmos_science_exit(NULL);
-<a name="l01961"></a>01961                 }
-<a name="l01962"></a>01962 
-<a name="l01963"></a>01963                 rerrors[j] = images[2];
-<a name="l01964"></a>01964 
-<a name="l01965"></a>01965                 cpl_free(images);
-<a name="l01966"></a>01966             }
-<a name="l01967"></a>01967             <span class="keywordflow">else</span> {
-<a name="l01968"></a>01968                 cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span>
-<a name="l01969"></a>01969                                 <span class="stringliteral">"%s, %s, and %s are not created"</span>, 
-<a name="l01970"></a>01970                                 reduced_science_tag, reduced_sky_tag, 
-<a name="l01971"></a>01971                                 reduced_error_tag);
-<a name="l01972"></a>01972             }
-<a name="l01973"></a>01973 
-<a name="l01974"></a>01974         }
-<a name="l01975"></a>01975 
-<a name="l01976"></a>01976         <span class="keywordflow">if</span> (skymedian || skylocal) {
-<a name="l01977"></a>01977             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01978"></a>01978                 cpl_image_divide_scalar(mappeds[j], alltime);
-<a name="l01979"></a>01979 
-<a name="l01980"></a>01980             <span class="keywordflow">if</span> (!j) {
-<a name="l01981"></a>01981                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a>(frameset, parlist,
-<a name="l01982"></a>01982                                        mapped_science_tag,
-<a name="l01983"></a>01983                                        recipe, version)) {
-<a name="l01984"></a>01984                     fors_pmos_science_exit(NULL);
-<a name="l01985"></a>01985                 }
-<a name="l01986"></a>01986             }
-<a name="l01987"></a>01987 
-<a name="l01988"></a>01988             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a>(mappeds[j], mapped_science_tag,
-<a name="l01989"></a>01989                                    header)) {
-<a name="l01990"></a>01990                 fors_pmos_science_exit(NULL);
-<a name="l01991"></a>01991             }
-<a name="l01992"></a>01992         }
-<a name="l01993"></a>01993 
-<a name="l01994"></a>01994         cpl_image_delete(mappeds[j]); mappeds[j] = NULL;
-<a name="l01995"></a>01995         cpl_propertylist_delete(header); header = NULL;
-<a name="l01996"></a>01996 
-<a name="l01997"></a>01997     }
-<a name="l01998"></a>01998 
-<a name="l01999"></a>01999     cpl_table_delete(origslits);
-<a name="l02000"></a>02000 
-<a name="l02001"></a>02001     <span class="comment">/* Stokes computation */</span>
-<a name="l02002"></a>02002 
-<a name="l02003"></a>02003     nobjects = cpl_image_get_size_y(reduceds[0]) / 2;
-<a name="l02004"></a>02004     nx       = cpl_image_get_size_x(reduceds[0]);
-<a name="l02005"></a>02005 
-<a name="l02006"></a>02006     header = cpl_propertylist_new();
-<a name="l02007"></a>02007     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l02008"></a>02008     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02009"></a>02009     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l02010"></a>02010                                    startwavelength + (dispersion * group)/2);
-<a name="l02011"></a>02011     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02012"></a>02012     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion * group);
-<a name="l02013"></a>02013     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02014"></a>02014     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02015"></a>02015     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02016"></a>02016     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02017"></a>02017     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02018"></a>02018     
-<a name="l02019"></a>02019     <span class="keywordflow">if</span> (circ) {
-<a name="l02020"></a>02020 
-<a name="l02021"></a>02021         cpl_image        *pv_im          = NULL;
-<a name="l02022"></a>02022         cpl_image        *pi_im          = NULL;
-<a name="l02023"></a>02023         cpl_image        *pvnull_im      = NULL;
-<a name="l02024"></a>02024         cpl_image        *pierr_im       = NULL;
-<a name="l02025"></a>02025         cpl_image        *perr_im        = NULL;
-<a name="l02026"></a>02026 
-<a name="l02027"></a>02027         <span class="keywordtype">double</span>           *p_v            = NULL;
-<a name="l02028"></a>02028         <span class="keywordtype">double</span>           *p_i            = NULL;
-<a name="l02029"></a>02029         <span class="keywordtype">double</span>           *p_vnull        = NULL;
-<a name="l02030"></a>02030         <span class="keywordtype">double</span>           *perr           = NULL;
-<a name="l02031"></a>02031         <span class="keywordtype">double</span>           *pierr           = NULL;
-<a name="l02032"></a>02032 
-<a name="l02033"></a>02033         <span class="keywordtype">double</span>            mean_vnull;
-<a name="l02034"></a>02034 
-<a name="l02035"></a>02035         <span class="keywordtype">int</span> p = -1;
-<a name="l02036"></a>02036         <span class="keywordtype">int</span> total = 0;
-<a name="l02037"></a>02037 
-<a name="l02038"></a>02038         pv_im     = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02039"></a>02039         perr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02040"></a>02040         pi_im     = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02041"></a>02041         pierr_im  = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02042"></a>02042 
-<a name="l02043"></a>02043         p_v     = cpl_image_get_data_double(pv_im);
-<a name="l02044"></a>02044         perr    = cpl_image_get_data_double(perr_im);
-<a name="l02045"></a>02045         p_i     = cpl_image_get_data_double(pi_im);
-<a name="l02046"></a>02046         pierr   = cpl_image_get_data_double(pierr_im);
-<a name="l02047"></a>02047 
-<a name="l02048"></a>02048         <span class="keywordflow">if</span> (nscience / 2 > 1) {
-<a name="l02049"></a>02049             pvnull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02050"></a>02050             p_vnull = cpl_image_get_data_double(pvnull_im);
-<a name="l02051"></a>02051         }
-<a name="l02052"></a>02052 
-<a name="l02053"></a>02053         <span class="keywordflow">for</span> (j = 0; j < nobjects; j++) {
-<a name="l02054"></a>02054 
-<a name="l02055"></a>02055             FILE *file;               <span class="comment">// Bagoo</span>
-<a name="l02056"></a>02056             <span class="keywordtype">char</span> *filename;           <span class="comment">// Bagoo</span>
-<a name="l02057"></a>02057 
-<a name="l02058"></a>02058             <span class="keywordtype">int</span> k, m;
-<a name="l02059"></a>02059 
-<a name="l02060"></a>02060             <span class="keywordtype">double</span> * ip_v, * ip_i, * ipierr,
-<a name="l02061"></a>02061                    * ip_vnull, * iperr;
-<a name="l02062"></a>02062 
-<a name="l02063"></a>02063             <span class="keywordtype">float</span> * data;
-<a name="l02064"></a>02064             <span class="keywordtype">float</span> * iff,  * ierr;
-<a name="l02065"></a>02065 
-<a name="l02066"></a>02066             ip_v = p_v + (nobjects - 1 - j) * nx;
-<a name="l02067"></a>02067 
-<a name="l02068"></a>02068             <span class="keywordflow">if</span> (nscience / 2 > 1)
-<a name="l02069"></a>02069                 ip_vnull = p_vnull + (nobjects - 1 - j) * nx;
-<a name="l02070"></a>02070 
-<a name="l02071"></a>02071             iperr = perr + (nobjects - 1 - j) * nx;
-<a name="l02072"></a>02072 
-<a name="l02073"></a>02073             ip_i = p_i + (nobjects - 1 - j) * nx;
-<a name="l02074"></a>02074             ipierr = pierr + (nobjects - 1 - j) * nx;
-<a name="l02075"></a>02075 
-<a name="l02076"></a>02076             total = 0;
-<a name="l02077"></a>02077             <span class="keywordflow">for</span> (i = 0; i < nslits; i += 2) {
-<a name="l02078"></a>02078                 total += nobjs_per_slit[i];
-<a name="l02079"></a>02079                 <span class="keywordflow">if</span> (total > j) {
-<a name="l02080"></a>02080                     p = i;
-<a name="l02081"></a>02081                     <span class="keywordflow">break</span>;
-<a name="l02082"></a>02082                 }
-<a name="l02083"></a>02083             }
-<a name="l02084"></a>02084 
-<a name="l02085"></a>02085             <span class="keywordflow">for</span> (k = 0; k < nscience / 2; k++) {
-<a name="l02086"></a>02086                 <span class="keywordtype">float</span> *if_o,  *if_e,  *ifdelta_o, *ifdelta_e;
-<a name="l02087"></a>02087                 <span class="keywordtype">float</span> *if_o_err,  *if_e_err,  *ifdelta_o_err, *ifdelta_e_err;
-<a name="l02088"></a>02088 
-<a name="l02089"></a>02089                 <span class="keywordtype">int</span> pos   = fors_find_angle_pos(angles, nscience, 180 * k - 45);
-<a name="l02090"></a>02090                 <span class="keywordtype">int</span> pos_d = fors_find_angle_pos(angles, nscience, 180 * k + 45);
-<a name="l02091"></a>02091 
-<a name="l02092"></a>02092 
-<a name="l02093"></a>02093                 data = cpl_image_get_data_float(reduceds[pos]);
-<a name="l02094"></a>02094 
-<a name="l02095"></a>02095                 if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l02096"></a>02096                      + (total - j - 1)) * nx;
-<a name="l02097"></a>02097 
-<a name="l02098"></a>02098                 if_e = data + (2 * (nobjects - total) 
-<a name="l02099"></a>02099                      + (total - j - 1)) * nx;
-<a name="l02100"></a>02100 
-<a name="l02101"></a>02101                 data = cpl_image_get_data_float(reduceds[pos_d]);
-<a name="l02102"></a>02102 
-<a name="l02103"></a>02103                 ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l02104"></a>02104                           + (total - j - 1)) * nx;
-<a name="l02105"></a>02105 
-<a name="l02106"></a>02106                 ifdelta_e = data + (2 * (nobjects - total) 
-<a name="l02107"></a>02107                           + (total - j - 1)) * nx;
-<a name="l02108"></a>02108 
-<a name="l02109"></a>02109                 data = cpl_image_get_data_float(rerrors[pos]);
-<a name="l02110"></a>02110 
-<a name="l02111"></a>02111                 if_o_err = data 
-<a name="l02112"></a>02112                          + (2 * (nobjects - total) + nobjs_per_slit[p]
-<a name="l02113"></a>02113                          + (total - j - 1)) * nx;
-<a name="l02114"></a>02114 
-<a name="l02115"></a>02115                 if_e_err = data + (2 * (nobjects - total)
-<a name="l02116"></a>02116                          + (total - j - 1)) * nx;
-<a name="l02117"></a>02117 
-<a name="l02118"></a>02118                 data = cpl_image_get_data_float(rerrors[pos_d]);
-<a name="l02119"></a>02119 
-<a name="l02120"></a>02120                 ifdelta_o_err = data 
-<a name="l02121"></a>02121                               + (2 * (nobjects - total) + nobjs_per_slit[p]
-<a name="l02122"></a>02122                               + (total - j - 1)) * nx;
-<a name="l02123"></a>02123 
-<a name="l02124"></a>02124                 ifdelta_e_err = data + (2 * (nobjects - total)
-<a name="l02125"></a>02125                               + (total - j - 1)) * nx;
-<a name="l02126"></a>02126 
-<a name="l02127"></a>02127                 <span class="keywordflow">if</span> (bagoo) {
-<a name="l02128"></a>02128 
-<a name="l02129"></a>02129                     <span class="keywordtype">char</span> *signal_to_noise  = getenv(<span class="stringliteral">"SIGNAL_TO_NOISE"</span> );
-<a name="l02130"></a>02130                     <span class="keywordtype">float</span> s2n = 100.;
-<a name="l02131"></a>02131                     <span class="keywordtype">char</span> *min_s2n  = getenv(<span class="stringliteral">"MIN_S2N"</span> );
-<a name="l02132"></a>02132                     <span class="keywordtype">int</span>   ms2n = 50;
-<a name="l02133"></a>02133 
-<a name="l02134"></a>02134                     <span class="keywordflow">if</span> (signal_to_noise)
-<a name="l02135"></a>02135                         s2n = atof(signal_to_noise);
-<a name="l02136"></a>02136 
-<a name="l02137"></a>02137                     <span class="keywordflow">if</span> (min_s2n)
-<a name="l02138"></a>02138                         ms2n = atoi(min_s2n);
-<a name="l02139"></a>02139 
-<a name="l02140"></a>02140                     <span class="comment">/*</span>
-<a name="l02141"></a>02141 <span class="comment">                     * Check whether S/N is > s2n in more than ms2n pixels</span>
-<a name="l02142"></a>02142 <span class="comment">                     * (on first frame, on ordinary beam)</span>
-<a name="l02143"></a>02143 <span class="comment">                     */</span>
-<a name="l02144"></a>02144 
-<a name="l02145"></a>02145                     <span class="keywordflow">if</span> (k == 0) {
-<a name="l02146"></a>02146                         bright = 0;
-<a name="l02147"></a>02147                         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l02148"></a>02148                             <span class="keywordflow">if</span> (if_o_err[m] > 0.0) {
-<a name="l02149"></a>02149                                 <span class="keywordflow">if</span> (if_o[m]/if_o_err[m] > s2n) {
-<a name="l02150"></a>02150                                     bright++;
-<a name="l02151"></a>02151                                     <span class="keywordflow">if</span> (bright > ms2n) {
-<a name="l02152"></a>02152                                         <span class="keywordflow">break</span>;
-<a name="l02153"></a>02153                                     }
-<a name="l02154"></a>02154                                 }
-<a name="l02155"></a>02155                             }
-<a name="l02156"></a>02156                         }
-<a name="l02157"></a>02157                     }
-<a name="l02158"></a>02158 
-<a name="l02159"></a>02159                     <span class="keywordflow">if</span> (bright > ms2n) {
-<a name="l02160"></a>02160                         conta++;
-<a name="l02161"></a>02161                         filename = cpl_sprintf(<span class="stringliteral">"angle_%d_%d.dat"</span>, 
-<a name="l02162"></a>02162                                                180*k-45, conta);
-<a name="l02163"></a>02163                         file = fopen(filename, <span class="stringliteral">"w"</span>);
-<a name="l02164"></a>02164     
-<a name="l02165"></a>02165                         fprintf(file, <span class="stringliteral">"%d\n"</span>, p + 2);
-<a name="l02166"></a>02166 
-<a name="l02167"></a>02167                         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l02168"></a>02168                             <span class="keywordtype">double</span> lambda = startwavelength 
-<a name="l02169"></a>02169                                           + dispersion * group * (0.5 + m);
-<a name="l02170"></a>02170                             fprintf(file, <span class="stringliteral">"%.3f %.9e %.9e %.9e %.9e\n"</span>,
-<a name="l02171"></a>02171                                     lambda, if_o[m], if_o_err[m], 
-<a name="l02172"></a>02172                                     if_e[m], if_e_err[m]);
-<a name="l02173"></a>02173                         }
-<a name="l02174"></a>02174 
-<a name="l02175"></a>02175                         fclose(file);
-<a name="l02176"></a>02176                         cpl_free(filename);
-<a name="l02177"></a>02177 
-<a name="l02178"></a>02178                         filename = cpl_sprintf(<span class="stringliteral">"angle_%d_%d.dat"</span>, 
-<a name="l02179"></a>02179                                                180*k+45, conta);
-<a name="l02180"></a>02180                         file = fopen(filename, <span class="stringliteral">"w"</span>);
-<a name="l02181"></a>02181 
-<a name="l02182"></a>02182                         fprintf(file, <span class="stringliteral">"%d\n"</span>, p + 2);
-<a name="l02183"></a>02183 
-<a name="l02184"></a>02184                         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l02185"></a>02185                             <span class="keywordtype">double</span> lambda = startwavelength 
-<a name="l02186"></a>02186                                           + dispersion * group * (0.5 + m);
-<a name="l02187"></a>02187                             fprintf(file, <span class="stringliteral">"%.3f %.9e %.9e %.9e %.9e\n"</span>,
-<a name="l02188"></a>02188                                     lambda, ifdelta_o[m], ifdelta_o_err[m], 
-<a name="l02189"></a>02189                                     ifdelta_e[m], ifdelta_e_err[m]);
-<a name="l02190"></a>02190                         }
-<a name="l02191"></a>02191     
-<a name="l02192"></a>02192                         fclose(file);
-<a name="l02193"></a>02193                         cpl_free(filename);
-<a name="l02194"></a>02194                     }
-<a name="l02195"></a>02195                     <span class="keywordflow">else</span> {
-<a name="l02196"></a>02196                         cpl_msg_info(recipe, 
-<a name="l02197"></a>02197                                      <span class="stringliteral">"Extracted signal not written to "</span>
-<a name="l02198"></a>02198                                      <span class="stringliteral">"ASCII (S/N > %.0f only in %d < %d "</span>
-<a name="l02199"></a>02199                                      <span class="stringliteral">"bins)"</span>, s2n, bright, ms2n);
-<a name="l02200"></a>02200                     }
-<a name="l02201"></a>02201                 }  <span class="comment">// End of bagoo</span>
-<a name="l02202"></a>02202 
-<a name="l02203"></a>02203                 <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l02204"></a>02204 
-<a name="l02205"></a>02205                     <span class="keywordtype">double</span> quantity = if_o[m] + if_e[m] == 0.0 ? 0.0 :
-<a name="l02206"></a>02206                         (if_o[m]      - if_e[m]     ) /
-<a name="l02207"></a>02207                         (if_o[m]      + if_e[m]     ) -
-<a name="l02208"></a>02208                         (ifdelta_o[m] - ifdelta_e[m]) /
-<a name="l02209"></a>02209                         (ifdelta_o[m] + ifdelta_e[m]);
-<a name="l02210"></a>02210 
-<a name="l02211"></a>02211                     quantity = isfinite(quantity) ? quantity : 0.0;
-<a name="l02212"></a>02212 
-<a name="l02213"></a>02213                     <span class="comment">/* PQ map computation */</span>
-<a name="l02214"></a>02214                     ip_v[m] += quantity * 0.5 / (nscience / 2);
-<a name="l02215"></a>02215 
-<a name="l02216"></a>02216                     <span class="comment">/* PQnull map computation */</span>
-<a name="l02217"></a>02217                     <span class="keywordflow">if</span> (nscience / 2 > 1) {
-<a name="l02218"></a>02218                         <span class="keywordflow">if</span> (k % 2)
-<a name="l02219"></a>02219                             ip_vnull[m] += quantity * 0.5 / (nscience / 2);
-<a name="l02220"></a>02220                         <span class="keywordflow">else</span>
-<a name="l02221"></a>02221                             ip_vnull[m] -= quantity * 0.5 / (nscience / 2);
-<a name="l02222"></a>02222                     }
-<a name="l02223"></a>02223 
-<a name="l02224"></a>02224                     <span class="comment">/* I map computation */</span>
-<a name="l02225"></a>02225                     ip_i[m] += (if_o[m] + if_e[m] + 
-<a name="l02226"></a>02226                                 ifdelta_o[m] + ifdelta_e[m]) / nscience;
-<a name="l02227"></a>02227 
-<a name="l02228"></a>02228                     <span class="comment">/* Variance map computation */</span>
-<a name="l02229"></a>02229                     ipierr[m] += (if_o_err[m]      * if_o_err[m]
-<a name="l02230"></a>02230                                 + if_e_err[m]      * if_e_err[m]
-<a name="l02231"></a>02231                                 + ifdelta_o_err[m] * ifdelta_o_err[m]
-<a name="l02232"></a>02232                                 + ifdelta_e_err[m] * ifdelta_e_err[m]) 
-<a name="l02233"></a>02233                                / nscience / nscience;
-<a name="l02234"></a>02234 
-<a name="l02235"></a>02235                 }
-<a name="l02236"></a>02236             }
-<a name="l02237"></a>02237 
-<a name="l02238"></a>02238             <span class="comment">/* Error map */</span>
-<a name="l02239"></a>02239             data = cpl_image_get_data_float(reduceds[0]);
-<a name="l02240"></a>02240             iff  = data + (2 * (nobjects - total) + (total - j - 1)) * nx;
-<a name="l02241"></a>02241 
-<a name="l02242"></a>02242             data = cpl_image_get_data_float(rerrors[0]);
-<a name="l02243"></a>02243             ierr = data + (2 * (nobjects - total) + (total - j - 1)) * nx;
-<a name="l02244"></a>02244 
-<a name="l02245"></a>02245             <span class="keywordflow">for</span> (m = 0; m < nx; m++)
-<a name="l02246"></a>02246                 iperr[m] = iff[m] <= 0.0 ? 
-<a name="l02247"></a>02247                     0.0 : ierr[m] / iff[m] * 0.5 / sqrt (nscience / 2);
-<a name="l02248"></a>02248 
-<a name="l02249"></a>02249             <span class="keywordflow">if</span> (nscience / 2 > 1) {
-<a name="l02250"></a>02250                 <span class="keywordtype">float</span> * weights;
-<a name="l02251"></a>02251                 <span class="keywordtype">float</span>   max, sum, sum2, imean;
-<a name="l02252"></a>02252 
-<a name="l02253"></a>02253                 <span class="keywordtype">int</span> k;
-<a name="l02254"></a>02254 
-<a name="l02255"></a>02255                 <span class="comment">/* QC on U NULL */</span>
-<a name="l02256"></a>02256                 weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);
-<a name="l02257"></a>02257 
-<a name="l02258"></a>02258                 max = 0.0;
-<a name="l02259"></a>02259                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02260"></a>02260                     <span class="keywordflow">if</span> (max < iff[k]) max = iff[k];
-<a name="l02261"></a>02261                 }
-<a name="l02262"></a>02262             
-<a name="l02263"></a>02263                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02264"></a>02264                     weights[k] = iff[k] < 0.0 ? 
-<a name="l02265"></a>02265                         0.0 : iff[k] * iff[k] / (max * max);
-<a name="l02266"></a>02266                 }
-<a name="l02267"></a>02267             
-<a name="l02268"></a>02268                 sum  = 0.0;
-<a name="l02269"></a>02269                 sum2 = 0.0;
-<a name="l02270"></a>02270                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02271"></a>02271                     sum  += weights[k] * ip_vnull[k];
-<a name="l02272"></a>02272                     sum2 += weights[k];
-<a name="l02273"></a>02273                 }
-<a name="l02274"></a>02274 
-<a name="l02275"></a>02275                 cpl_free(weights);
-<a name="l02276"></a>02276 
-<a name="l02277"></a>02277                 imean = sum / sum2;
-<a name="l02278"></a>02278 
-<a name="l02279"></a>02279                 mean_vnull += (imean - mean_vnull) / (j + 1.0);
-<a name="l02280"></a>02280             }
-<a name="l02281"></a>02281         }
-<a name="l02282"></a>02282 
-<a name="l02283"></a>02283         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pv_im, reduced_v_tag, header, 
-<a name="l02284"></a>02284                            parlist, recipe, version))
-<a name="l02285"></a>02285             fors_pmos_science_exit(NULL);
-<a name="l02286"></a>02286 
-<a name="l02287"></a>02287         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pi_im, reduced_i_tag, header, 
-<a name="l02288"></a>02288                            parlist, recipe, version))
-<a name="l02289"></a>02289             fors_pmos_science_exit(NULL);
-<a name="l02290"></a>02290 
-<a name="l02291"></a>02291         <span class="keywordflow">if</span> (nscience / 2 > 1) {
-<a name="l02292"></a>02292             <span class="keywordtype">char</span>             *pipefile;
-<a name="l02293"></a>02293             <span class="keywordtype">char</span>             *keyname;
-<a name="l02294"></a>02294             cpl_propertylist *qheader;
-<a name="l02295"></a>02295 
-<a name="l02296"></a>02296             qheader = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l02297"></a>02297             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l02298"></a>02298             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02299"></a>02299             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l02300"></a>02300                                    startwavelength + (dispersion * group)/2);
-<a name="l02301"></a>02301             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02302"></a>02302             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, 
-<a name="l02303"></a>02303                                            dispersion * group);
-<a name="l02304"></a>02304             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02305"></a>02305             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02306"></a>02306             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02307"></a>02307             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02308"></a>02308             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02309"></a>02309 
-<a name="l02310"></a>02310             <span class="keywordflow">if</span> (qc) {
-<a name="l02311"></a>02311                 <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);
-<a name="l02312"></a>02312 
-<a name="l02313"></a>02313                 <span class="comment">/*</span>
-<a name="l02314"></a>02314 <span class="comment">                 * QC1 group header</span>
-<a name="l02315"></a>02315 <span class="comment">                 */</span>
-<a name="l02316"></a>02316 
-<a name="l02317"></a>02317                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_v_tag,
-<a name="l02318"></a>02318                                          <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l02319"></a>02319                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write product category to "</span>
-<a name="l02320"></a>02320                                            <span class="stringliteral">"QC log file"</span>);
-<a name="l02321"></a>02321 
-<a name="l02322"></a>02322                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l02323"></a>02323                                            <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l02324"></a>02324                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span>
-<a name="l02325"></a>02325                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02326"></a>02326     
-<a name="l02327"></a>02327                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l02328"></a>02328                                            <span class="stringliteral">"Template"</span>, instrume))
-<a name="l02329"></a>02329                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span>
-<a name="l02330"></a>02330                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02331"></a>02331     
-<a name="l02332"></a>02332                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,
-<a name="l02333"></a>02333                                            <span class="stringliteral">"Grism name"</span>, instrume))
-<a name="l02334"></a>02334                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in "</span>
-<a name="l02335"></a>02335                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02336"></a>02336 
-<a name="l02337"></a>02337                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,
-<a name="l02338"></a>02338                                            <span class="stringliteral">"Grism identifier"</span>, instrume))
-<a name="l02339"></a>02339                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in "</span>
-<a name="l02340"></a>02340                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02341"></a>02341 
-<a name="l02342"></a>02342                 <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))
-<a name="l02343"></a>02343                     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,
-<a name="l02344"></a>02344                                            <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l02345"></a>02345 
-<a name="l02346"></a>02346                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,
-<a name="l02347"></a>02347                                            <span class="stringliteral">"Collimator name"</span>, instrume))
-<a name="l02348"></a>02348                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in "</span>
-<a name="l02349"></a>02349                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02350"></a>02350 
-<a name="l02351"></a>02351                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l02352"></a>02352                                            <span class="stringliteral">"Chip identifier"</span>, instrume))
-<a name="l02353"></a>02353                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in "</span>
-<a name="l02354"></a>02354                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02355"></a>02355 
-<a name="l02356"></a>02356                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l02357"></a>02357                                            <span class="stringliteral">"Archive name of input data"</span>, 
-<a name="l02358"></a>02358                                            instrume))
-<a name="l02359"></a>02359                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span>
-<a name="l02360"></a>02360                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02361"></a>02361 
-<a name="l02362"></a>02362                 pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(reduced_nul_v_tag);
-<a name="l02363"></a>02363                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l02364"></a>02364                                          <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l02365"></a>02365                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span>
-<a name="l02366"></a>02366                                            <span class="stringliteral">"QC log file"</span>);
-<a name="l02367"></a>02367                 cpl_free(pipefile); pipefile = NULL;
-<a name="l02368"></a>02368 
-<a name="l02369"></a>02369 
-<a name="l02370"></a>02370                 <span class="comment">/*</span>
-<a name="l02371"></a>02371 <span class="comment">                 * QC1 parameters</span>
-<a name="l02372"></a>02372 <span class="comment">                 */</span>
-<a name="l02373"></a>02373 
-<a name="l02374"></a>02374                 keyname = <span class="stringliteral">"QC.NULL.V.MEAN"</span>;
-<a name="l02375"></a>02375                     
-<a name="l02376"></a>02376                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qheader, mean_vnull,
-<a name="l02377"></a>02377                                             keyname, NULL,
-<a name="l02378"></a>02378                                             <span class="stringliteral">"Mean V null parameter"</span>,
-<a name="l02379"></a>02379                                             instrume)) {
-<a name="l02380"></a>02380                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write mean Q null "</span>
-<a name="l02381"></a>02381                                            <span class="stringliteral">"parameter to QC log file."</span>);
-<a name="l02382"></a>02382                 }
-<a name="l02383"></a>02383 
-<a name="l02384"></a>02384                 keyname = <span class="stringliteral">"QC.NANGLES"</span>;
-<a name="l02385"></a>02385 
-<a name="l02386"></a>02386                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g661730c28a076df446641c371342bf5b">fors_qc_write_qc_int</a>(qheader, nscience,
-<a name="l02387"></a>02387                                          keyname, NULL,
-<a name="l02388"></a>02388                                          <span class="stringliteral">"Number of processed plate angles"</span>,
-<a name="l02389"></a>02389                                          instrume)) {
-<a name="l02390"></a>02390                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write number of processed "</span>
-<a name="l02391"></a>02391                                            <span class="stringliteral">"plate angles."</span>);
-<a name="l02392"></a>02392                 }
-<a name="l02393"></a>02393 
-<a name="l02394"></a>02394                 <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l02395"></a>02395             }
-<a name="l02396"></a>02396 
-<a name="l02397"></a>02397             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pvnull_im, reduced_nul_v_tag, qheader, 
-<a name="l02398"></a>02398                                parlist, recipe, version))
-<a name="l02399"></a>02399                 fors_pmos_science_exit(NULL);
-<a name="l02400"></a>02400 
-<a name="l02401"></a>02401             cpl_propertylist_delete(qheader);
-<a name="l02402"></a>02402         }
-<a name="l02403"></a>02403 
-<a name="l02404"></a>02404         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, perr_im, reduced_error_v_tag, header, 
-<a name="l02405"></a>02405                            parlist, recipe, version))
-<a name="l02406"></a>02406             fors_pmos_science_exit(NULL);
-<a name="l02407"></a>02407 
-<a name="l02408"></a>02408         cpl_image_power(pierr_im, 0.5);
-<a name="l02409"></a>02409 
-<a name="l02410"></a>02410         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pierr_im, reduced_error_i_tag, header, 
-<a name="l02411"></a>02411                            parlist, recipe, version))
-<a name="l02412"></a>02412             fors_pmos_science_exit(NULL);
-<a name="l02413"></a>02413 
-<a name="l02414"></a>02414         cpl_image_delete(pv_im);
-<a name="l02415"></a>02415         cpl_image_delete(pvnull_im);
-<a name="l02416"></a>02416         cpl_image_delete(perr_im);
-<a name="l02417"></a>02417         cpl_image_delete(pi_im);
-<a name="l02418"></a>02418         cpl_image_delete(pierr_im);
-<a name="l02419"></a>02419     } 
-<a name="l02420"></a>02420     <span class="keywordflow">else</span> {                            <span class="comment">/* Linear polarisation */</span>
-<a name="l02421"></a>02421         cpl_image *pq_im      = NULL;
-<a name="l02422"></a>02422         cpl_image *pu_im      = NULL;
-<a name="l02423"></a>02423         cpl_image *pl_im      = NULL;
-<a name="l02424"></a>02424         cpl_image *pi_im      = NULL;
-<a name="l02425"></a>02425 
-<a name="l02426"></a>02426         cpl_image *pqnull_im  = NULL;
-<a name="l02427"></a>02427         cpl_image *punull_im  = NULL;
-<a name="l02428"></a>02428 
-<a name="l02429"></a>02429         cpl_image *pqerr_im   = NULL;
-<a name="l02430"></a>02430         cpl_image *puerr_im   = NULL;
-<a name="l02431"></a>02431         cpl_image *plerr_im   = NULL;
-<a name="l02432"></a>02432         cpl_image *pierr_im   = NULL;
-<a name="l02433"></a>02433 
-<a name="l02434"></a>02434         cpl_image *pang_im    = NULL;
-<a name="l02435"></a>02435         cpl_image *pangerr_im = NULL;
-<a name="l02436"></a>02436 
-<a name="l02437"></a>02437         <span class="keywordtype">double</span>    *p_q        = NULL;
-<a name="l02438"></a>02438         <span class="keywordtype">double</span>    *p_u        = NULL;
-<a name="l02439"></a>02439         <span class="keywordtype">double</span>    *p_l        = NULL;
-<a name="l02440"></a>02440         <span class="keywordtype">double</span>    *p_i        = NULL;
-<a name="l02441"></a>02441 
-<a name="l02442"></a>02442         <span class="keywordtype">double</span>    *p_qnull    = NULL;
-<a name="l02443"></a>02443         <span class="keywordtype">double</span>    *p_unull    = NULL;
-<a name="l02444"></a>02444 
-<a name="l02445"></a>02445         <span class="keywordtype">double</span>    *pqerr      = NULL;
-<a name="l02446"></a>02446         <span class="keywordtype">double</span>    *puerr      = NULL;
-<a name="l02447"></a>02447         <span class="keywordtype">double</span>    *plerr      = NULL;
-<a name="l02448"></a>02448         <span class="keywordtype">double</span>    *pierr      = NULL;
-<a name="l02449"></a>02449 
-<a name="l02450"></a>02450         <span class="keywordtype">double</span>    *pang       = NULL;
-<a name="l02451"></a>02451         <span class="keywordtype">double</span>    *pangerr    = NULL;
-<a name="l02452"></a>02452 
-<a name="l02453"></a>02453         <span class="keywordtype">int</span>        k, m;
-<a name="l02454"></a>02454 
-<a name="l02455"></a>02455         cpl_image *correct_im = cpl_image_new(nx, 1, CPL_TYPE_DOUBLE);
-<a name="l02456"></a>02456         <span class="keywordtype">double</span>    *correct    = cpl_image_get_data_double(correct_im);
-<a name="l02457"></a>02457 
-<a name="l02458"></a>02458         <span class="keywordtype">double</span>     mean_unull, mean_qnull;
-<a name="l02459"></a>02459 
-<a name="l02460"></a>02460         <span class="keywordtype">int</span>        p          = -1;
-<a name="l02461"></a>02461         <span class="keywordtype">int</span>        total      = 0;
-<a name="l02462"></a>02462             
-<a name="l02463"></a>02463         pq_im      = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02464"></a>02464         pu_im      = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02465"></a>02465         pl_im      = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02466"></a>02466         pi_im      = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02467"></a>02467 
-<a name="l02468"></a>02468         pqerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02469"></a>02469         puerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02470"></a>02470         plerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02471"></a>02471         pierr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02472"></a>02472 
-<a name="l02473"></a>02473         pang_im    = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02474"></a>02474         pangerr_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02475"></a>02475 
-<a name="l02476"></a>02476         p_q        = cpl_image_get_data_double(pq_im);
-<a name="l02477"></a>02477         p_u        = cpl_image_get_data_double(pu_im);
-<a name="l02478"></a>02478         p_l        = cpl_image_get_data_double(pl_im);
-<a name="l02479"></a>02479         p_i        = cpl_image_get_data_double(pi_im);
-<a name="l02480"></a>02480 
-<a name="l02481"></a>02481         <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02482"></a>02482             pqnull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02483"></a>02483             punull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);
-<a name="l02484"></a>02484 
-<a name="l02485"></a>02485             p_qnull = cpl_image_get_data_double(pqnull_im);
-<a name="l02486"></a>02486             p_unull = cpl_image_get_data_double(punull_im);
-<a name="l02487"></a>02487         } <span class="keywordflow">else</span> {
-<a name="l02488"></a>02488             cpl_msg_warning(cpl_func, 
-<a name="l02489"></a>02489                             <span class="stringliteral">"Not enough pairs to compute null parameters"</span>);
-<a name="l02490"></a>02490         }
-<a name="l02491"></a>02491 
-<a name="l02492"></a>02492         pqerr = cpl_image_get_data_double(pqerr_im);
-<a name="l02493"></a>02493         puerr = cpl_image_get_data_double(puerr_im);
-<a name="l02494"></a>02494         plerr = cpl_image_get_data_double(plerr_im);
-<a name="l02495"></a>02495         pierr = cpl_image_get_data_double(pierr_im);
-<a name="l02496"></a>02496 
-<a name="l02497"></a>02497         pang = cpl_image_get_data_double(pang_im);
-<a name="l02498"></a>02498         pangerr = cpl_image_get_data_double(pangerr_im);
-<a name="l02499"></a>02499 
-<a name="l02500"></a>02500         <span class="keywordflow">if</span> (chromatism) {
-<a name="l02501"></a>02501             cpl_table * chrotbl = 
-<a name="l02502"></a>02502                 <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, chrom_table_tag, 1);
-<a name="l02503"></a>02503 
-<a name="l02504"></a>02504             <span class="keywordtype">int</span>      nrow   = cpl_table_get_nrow(chrotbl);
-<a name="l02505"></a>02505             <span class="keywordtype">float</span>  * lambda = cpl_table_get_data_float(chrotbl, <span class="stringliteral">"lambda"</span>);
-<a name="l02506"></a>02506             <span class="keywordtype">float</span>  * theta  = cpl_table_get_data_float(chrotbl, <span class="stringliteral">"eps_theta"</span>);
-<a name="l02507"></a>02507 
-<a name="l02508"></a>02508             <span class="keywordflow">for</span> (j = 0; j < nx; j++) {
-<a name="l02509"></a>02509                 <span class="keywordtype">double</span> c_wave = startwavelength 
-<a name="l02510"></a>02510                               + (dispersion * group) / 2 
-<a name="l02511"></a>02511                               + j * dispersion * group;
-<a name="l02512"></a>02512             
-<a name="l02513"></a>02513                 <span class="keywordtype">int</span> found = 0;
-<a name="l02514"></a>02514 
-<a name="l02515"></a>02515                 <span class="keywordflow">for</span> (k = 0; k < nrow - 1; k++) {
-<a name="l02516"></a>02516                     <span class="keywordflow">if</span> (lambda[k] <= c_wave && c_wave < lambda[k + 1]) {
-<a name="l02517"></a>02517                         found = 1;
-<a name="l02518"></a>02518                         <span class="keywordflow">break</span>;
-<a name="l02519"></a>02519                     }
-<a name="l02520"></a>02520                 }
-<a name="l02521"></a>02521 
-<a name="l02522"></a>02522                 <span class="keywordflow">if</span> (found) {
-<a name="l02523"></a>02523                     correct[j] = (theta [k + 1] - theta [k]) /
-<a name="l02524"></a>02524                                  (lambda[k + 1] - lambda[k]) *
-<a name="l02525"></a>02525                                  (c_wave        - lambda[k])   + theta[k];
-<a name="l02526"></a>02526                     correct[j] *= M_PI / 180;   <span class="comment">/* Radians */</span>
-<a name="l02527"></a>02527                 }
-<a name="l02528"></a>02528                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (j)
-<a name="l02529"></a>02529                     correct[j] = correct[j-1];
-<a name="l02530"></a>02530                 <span class="keywordflow">else</span>
-<a name="l02531"></a>02531                     correct[j] = 0.0;
-<a name="l02532"></a>02532             }
-<a name="l02533"></a>02533 
-<a name="l02534"></a>02534             cpl_table_delete(chrotbl);
-<a name="l02535"></a>02535         }
-<a name="l02536"></a>02536 
-<a name="l02537"></a>02537         <span class="keywordflow">for</span> (j = 0; j < nobjects; j++) {
-<a name="l02538"></a>02538             <span class="keywordtype">double</span> *ip_q;
-<a name="l02539"></a>02539             <span class="keywordtype">double</span> *ip_u;
-<a name="l02540"></a>02540             <span class="keywordtype">double</span> *ip_l;
-<a name="l02541"></a>02541             <span class="keywordtype">double</span> *ip_i;
-<a name="l02542"></a>02542             <span class="keywordtype">double</span> *ipierr;
-<a name="l02543"></a>02543             <span class="keywordtype">double</span> *ip_qnull;
-<a name="l02544"></a>02544             <span class="keywordtype">double</span> *ip_unull;
-<a name="l02545"></a>02545             <span class="keywordtype">double</span> *ipqerr;
-<a name="l02546"></a>02546             <span class="keywordtype">double</span> *ipuerr;
-<a name="l02547"></a>02547             <span class="keywordtype">double</span> *iplerr;
-<a name="l02548"></a>02548             <span class="keywordtype">double</span> *ipang;
-<a name="l02549"></a>02549             <span class="keywordtype">double</span> *ipangerr;
-<a name="l02550"></a>02550 
-<a name="l02551"></a>02551             <span class="keywordtype">float</span>  *data;
-<a name="l02552"></a>02552             <span class="keywordtype">float</span>  *iffq;
-<a name="l02553"></a>02553             <span class="keywordtype">float</span>  *ierrq;
-<a name="l02554"></a>02554             <span class="keywordtype">float</span>  *iffu;
-<a name="l02555"></a>02555             <span class="keywordtype">float</span>  *ierru;
-<a name="l02556"></a>02556 
-<a name="l02557"></a>02557             <span class="keywordtype">int</span> pos, pos_d;
-<a name="l02558"></a>02558 
-<a name="l02559"></a>02559             ip_q = p_q + (nobjects - 1 - j) * nx;
-<a name="l02560"></a>02560             ip_u = p_u + (nobjects - 1 - j) * nx;
-<a name="l02561"></a>02561             ip_l = p_l + (nobjects - 1 - j) * nx;
-<a name="l02562"></a>02562             ip_i = p_i + (nobjects - 1 - j) * nx;
-<a name="l02563"></a>02563 
-<a name="l02564"></a>02564             <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02565"></a>02565                 ip_qnull = p_qnull + (nobjects - 1 - j) * nx;
-<a name="l02566"></a>02566                 ip_unull = p_unull + (nobjects - 1 - j) * nx;
-<a name="l02567"></a>02567             }
-<a name="l02568"></a>02568 
-<a name="l02569"></a>02569             ipqerr = pqerr + (nobjects - 1 - j) * nx;
-<a name="l02570"></a>02570             ipuerr = puerr + (nobjects - 1 - j) * nx;
-<a name="l02571"></a>02571             iplerr = plerr + (nobjects - 1 - j) * nx;
-<a name="l02572"></a>02572             ipierr = pierr + (nobjects - 1 - j) * nx;
-<a name="l02573"></a>02573 
-<a name="l02574"></a>02574             ipang = pang + (nobjects - 1 - j) * nx;
-<a name="l02575"></a>02575             ipangerr = pangerr + (nobjects - 1 - j) * nx;
-<a name="l02576"></a>02576 
-<a name="l02577"></a>02577             total = 0;
-<a name="l02578"></a>02578             <span class="keywordflow">for</span> (i = 0; i < nslits; i += 2) {
-<a name="l02579"></a>02579                 total += nobjs_per_slit[i];
-<a name="l02580"></a>02580                 <span class="keywordflow">if</span> (total > j) {
-<a name="l02581"></a>02581                     p = i;
-<a name="l02582"></a>02582                     <span class="keywordflow">break</span>;
-<a name="l02583"></a>02583                 }
-<a name="l02584"></a>02584             }
-<a name="l02585"></a>02585 
-<a name="l02586"></a>02586             <span class="keywordflow">for</span> (k = 0; k < nscience / 4; k++) {
-<a name="l02587"></a>02587                 <span class="keywordtype">float</span> * if_o, * if_e,  * ifdelta_o, * ifdelta_e;
-<a name="l02588"></a>02588                 <span class="keywordtype">float</span> * if_o_err, * if_e_err,  * ifdelta_o_err, * ifdelta_e_err;
-<a name="l02589"></a>02589 
-<a name="l02590"></a>02590                 <span class="comment">/* First P_Q */</span>
-<a name="l02591"></a>02591 
-<a name="l02592"></a>02592                 pos   = fors_find_angle_pos(angles, nscience, 90 * k);
-<a name="l02593"></a>02593                 pos_d = fors_find_angle_pos(angles, nscience, 90 * k + 45);
-<a name="l02594"></a>02594 
-<a name="l02595"></a>02595                 data = cpl_image_get_data_float(reduceds[pos]);
-<a name="l02596"></a>02596 
-<a name="l02597"></a>02597                 if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l02598"></a>02598                                + (total - j - 1)) * nx;
-<a name="l02599"></a>02599 
-<a name="l02600"></a>02600                 if_e = data + (2 * (nobjects - total) 
-<a name="l02601"></a>02601                                + (total - j - 1)) * nx;
-<a name="l02602"></a>02602 
-<a name="l02603"></a>02603                 data = cpl_image_get_data_float(reduceds[pos_d]);
-<a name="l02604"></a>02604 
-<a name="l02605"></a>02605                 ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l02606"></a>02606                                + (total - j - 1)) * nx;
-<a name="l02607"></a>02607 
-<a name="l02608"></a>02608                 ifdelta_e = data + (2 * (nobjects - total) 
-<a name="l02609"></a>02609                                + (total - j - 1)) * nx;
-<a name="l02610"></a>02610 
-<a name="l02611"></a>02611                 data = cpl_image_get_data_float(rerrors[pos]);
-<a name="l02612"></a>02612 
-<a name="l02613"></a>02613                 if_o_err = data + (2 * (nobjects - total) + nobjs_per_slit[p]
-<a name="l02614"></a>02614                                + (total - j - 1)) * nx;
-<a name="l02615"></a>02615 
-<a name="l02616"></a>02616                 if_e_err = data + (2 * (nobjects - total)
-<a name="l02617"></a>02617                                + (total - j - 1)) * nx;
-<a name="l02618"></a>02618 
-<a name="l02619"></a>02619                 data = cpl_image_get_data_float(rerrors[pos_d]);
-<a name="l02620"></a>02620 
-<a name="l02621"></a>02621                 ifdelta_o_err = data + (2 * (nobjects - total) 
-<a name="l02622"></a>02622                               + nobjs_per_slit[p] + (total - j - 1)) * nx;
-<a name="l02623"></a>02623 
-<a name="l02624"></a>02624                 ifdelta_e_err = data + (2 * (nobjects - total)
-<a name="l02625"></a>02625                               + (total - j - 1)) * nx;
-<a name="l02626"></a>02626 
-<a name="l02627"></a>02627                 <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l02628"></a>02628 
-<a name="l02629"></a>02629                     <span class="keywordtype">double</span> quantity = fabs(if_o[m] + if_e[m]) < FLT_MIN ? 0.0 :
-<a name="l02630"></a>02630                         (if_o[m]      - if_e[m]     ) /
-<a name="l02631"></a>02631                         (if_o[m]      + if_e[m]     ) -
-<a name="l02632"></a>02632                         (ifdelta_o[m] - ifdelta_e[m]) /
-<a name="l02633"></a>02633                         (ifdelta_o[m] + ifdelta_e[m]);
-<a name="l02634"></a>02634 
-<a name="l02635"></a>02635                     quantity = isfinite(quantity) ? quantity : 0.0;
-<a name="l02636"></a>02636 
-<a name="l02637"></a>02637                     <span class="comment">/* PQ map computation */</span>
-<a name="l02638"></a>02638                     ip_q[m] += quantity * 0.5 / (nscience / 4);
-<a name="l02639"></a>02639 
-<a name="l02640"></a>02640                     <span class="comment">/* PQnull map computation */</span>
-<a name="l02641"></a>02641                     <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02642"></a>02642                         <span class="keywordflow">if</span> (k % 2)
-<a name="l02643"></a>02643                             ip_qnull[m] += quantity * 0.5 / (nscience / 4);
-<a name="l02644"></a>02644                         <span class="keywordflow">else</span>
-<a name="l02645"></a>02645                             ip_qnull[m] -= quantity * 0.5 / (nscience / 4);
-<a name="l02646"></a>02646                     }
-<a name="l02647"></a>02647 
-<a name="l02648"></a>02648                     <span class="comment">/* I map computation */</span>
-<a name="l02649"></a>02649                     ip_i[m] += (if_o[m] + if_e[m] +
-<a name="l02650"></a>02650                                 ifdelta_o[m] + ifdelta_e[m]) / nscience;
-<a name="l02651"></a>02651 
-<a name="l02652"></a>02652                     <span class="comment">/* Variance map computation */</span>
-<a name="l02653"></a>02653                     ipierr[m] += (if_o_err[m]      * if_o_err[m]
-<a name="l02654"></a>02654                                 + if_e_err[m]      * if_e_err[m]
-<a name="l02655"></a>02655                                 + ifdelta_o_err[m] * ifdelta_o_err[m]
-<a name="l02656"></a>02656                                 + ifdelta_e_err[m] * ifdelta_e_err[m]) 
-<a name="l02657"></a>02657                                / nscience / nscience;
-<a name="l02658"></a>02658                 }
-<a name="l02659"></a>02659 
-<a name="l02660"></a>02660                 <span class="comment">/* Now P_U */</span>
-<a name="l02661"></a>02661 
-<a name="l02662"></a>02662                 pos   = fors_find_angle_pos(angles, nscience, 90 * k + 22.5);
-<a name="l02663"></a>02663                 pos_d = fors_find_angle_pos(angles, nscience, 90 * k + 67.5);
-<a name="l02664"></a>02664 
-<a name="l02665"></a>02665                 data = cpl_image_get_data_float(reduceds[pos]);
-<a name="l02666"></a>02666 
-<a name="l02667"></a>02667                 if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l02668"></a>02668                                + (total - j - 1)) * nx;
-<a name="l02669"></a>02669 
-<a name="l02670"></a>02670                 if_e = data + (2 * (nobjects - total) 
-<a name="l02671"></a>02671                                + (total - j - 1)) * nx;
-<a name="l02672"></a>02672 
-<a name="l02673"></a>02673                 data = cpl_image_get_data_float(reduceds[pos_d]);
-<a name="l02674"></a>02674 
-<a name="l02675"></a>02675                 ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] 
-<a name="l02676"></a>02676                                + (total - j - 1)) * nx;
-<a name="l02677"></a>02677 
-<a name="l02678"></a>02678                 ifdelta_e = data + (2 * (nobjects - total) 
-<a name="l02679"></a>02679                                + (total - j - 1)) * nx;
-<a name="l02680"></a>02680 
-<a name="l02681"></a>02681                 data = cpl_image_get_data_float(rerrors[pos]);
-<a name="l02682"></a>02682 
-<a name="l02683"></a>02683                 if_o_err = data + (2 * (nobjects - total) + nobjs_per_slit[p]
-<a name="l02684"></a>02684                                + (total - j - 1)) * nx;
-<a name="l02685"></a>02685 
-<a name="l02686"></a>02686                 if_e_err = data + (2 * (nobjects - total)
-<a name="l02687"></a>02687                                + (total - j - 1)) * nx;
-<a name="l02688"></a>02688 
-<a name="l02689"></a>02689                 data = cpl_image_get_data_float(rerrors[pos_d]);
-<a name="l02690"></a>02690 
-<a name="l02691"></a>02691                 ifdelta_o_err = data + (2 * (nobjects - total)
-<a name="l02692"></a>02692                               + nobjs_per_slit[p] + (total - j - 1)) * nx;
-<a name="l02693"></a>02693 
-<a name="l02694"></a>02694                 ifdelta_e_err = data + (2 * (nobjects - total)
-<a name="l02695"></a>02695                               + (total - j - 1)) * nx;
-<a name="l02696"></a>02696 
-<a name="l02697"></a>02697                 <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l02698"></a>02698 
-<a name="l02699"></a>02699                     <span class="keywordtype">double</span> quantity = fabs(if_o[m] + if_e[m]) < FLT_MIN ? 0.0 :
-<a name="l02700"></a>02700                         (if_o[m]      - if_e[m]     ) /
-<a name="l02701"></a>02701                         (if_o[m]      + if_e[m]     ) -
-<a name="l02702"></a>02702                         (ifdelta_o[m] - ifdelta_e[m]) /
-<a name="l02703"></a>02703                         (ifdelta_o[m] + ifdelta_e[m]);
-<a name="l02704"></a>02704 
-<a name="l02705"></a>02705                     quantity = isfinite(quantity) ? quantity : 0.0;
-<a name="l02706"></a>02706 
-<a name="l02707"></a>02707                     <span class="comment">/* PU map computation */</span>
-<a name="l02708"></a>02708                     ip_u[m] += quantity * 0.5 / (nscience / 4);
-<a name="l02709"></a>02709 
-<a name="l02710"></a>02710                     <span class="comment">/* PUnull map computation */</span>
-<a name="l02711"></a>02711                     <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02712"></a>02712                         <span class="keywordflow">if</span> (k % 2)
-<a name="l02713"></a>02713                             ip_unull[m] += quantity * 0.5 / (nscience / 4);
-<a name="l02714"></a>02714                         <span class="keywordflow">else</span>
-<a name="l02715"></a>02715                             ip_unull[m] -= quantity * 0.5 / (nscience / 4);
-<a name="l02716"></a>02716                     }
-<a name="l02717"></a>02717 
-<a name="l02718"></a>02718                     <span class="comment">/* I map computation */</span>
-<a name="l02719"></a>02719                     ip_i[m] += (if_o[m] + if_e[m] +
-<a name="l02720"></a>02720                                 ifdelta_o[m] + ifdelta_e[m]) / nscience;
-<a name="l02721"></a>02721 
-<a name="l02722"></a>02722                     <span class="comment">/* Variance map computation */</span>
-<a name="l02723"></a>02723                     ipierr[m] += (if_o_err[m]      * if_o_err[m]
-<a name="l02724"></a>02724                                 + if_e_err[m]      * if_e_err[m]
-<a name="l02725"></a>02725                                 + ifdelta_o_err[m] * ifdelta_o_err[m]
-<a name="l02726"></a>02726                                 + ifdelta_e_err[m] * ifdelta_e_err[m]) 
-<a name="l02727"></a>02727                                / nscience / nscience;
-<a name="l02728"></a>02728                 }
-<a name="l02729"></a>02729             }
-<a name="l02730"></a>02730 
-<a name="l02731"></a>02731             <span class="comment">/* Error map */</span>
-<a name="l02732"></a>02732 
-<a name="l02733"></a>02733             pos   = fors_find_angle_pos(angles, nscience, 0.0);
-<a name="l02734"></a>02734 
-<a name="l02735"></a>02735             data = cpl_image_get_data_float(reduceds[pos]);
-<a name="l02736"></a>02736             iffq = data + (2 * (nobjects - total) + (total - j - 1)) * nx;
-<a name="l02737"></a>02737 
-<a name="l02738"></a>02738             data = cpl_image_get_data_float(rerrors[pos]);
-<a name="l02739"></a>02739             ierrq = data + (2 * (nobjects - total) + (total - j - 1)) * nx;
-<a name="l02740"></a>02740             
-<a name="l02741"></a>02741             pos   = fors_find_angle_pos(angles, nscience, 22.5);
-<a name="l02742"></a>02742 
-<a name="l02743"></a>02743             data = cpl_image_get_data_float(reduceds[pos]);
-<a name="l02744"></a>02744             iffu = data + (2 * (nobjects - total) + (total - j - 1)) * nx;
-<a name="l02745"></a>02745 
-<a name="l02746"></a>02746             data = cpl_image_get_data_float(rerrors[pos]);
-<a name="l02747"></a>02747             ierru = data + (2 * (nobjects - total) + (total - j - 1)) * nx;
-<a name="l02748"></a>02748 
-<a name="l02749"></a>02749             <span class="keywordflow">for</span> (m = 0; m < nx; m++) {
-<a name="l02750"></a>02750 
-<a name="l02751"></a>02751                 <span class="keywordtype">double</span> radicand; 
-<a name="l02752"></a>02752 
-<a name="l02753"></a>02753                 ipqerr[m] = iffq[m] <= 0.0 ? 
-<a name="l02754"></a>02754                     0.0 : ierrq[m] / iffq[m] * 0.5 / sqrt (nscience / 4);
-<a name="l02755"></a>02755 
-<a name="l02756"></a>02756                 ipuerr[m] = iffu[m] <= 0.0 ? 
-<a name="l02757"></a>02757                     0.0 : ierru[m] / iffu[m] * 0.5 / sqrt (nscience / 4);
-<a name="l02758"></a>02758 
-<a name="l02759"></a>02759                 iplerr[m] = 0.5 * (ipqerr[m] + ipuerr[m]);
-<a name="l02760"></a>02760 
-<a name="l02761"></a>02761                 <span class="comment">/* PL computation */</span>
-<a name="l02762"></a>02762                 ip_l[m] = sqrt(ip_u[m] * ip_u[m] + ip_q[m] * ip_q[m]);
-<a name="l02763"></a>02763 
-<a name="l02764"></a>02764                 <span class="comment">/* P angle computation */</span>
-<a name="l02765"></a>02765                 <span class="keywordflow">if</span> (fabs(ip_q[m]) < 0.00001) {
-<a name="l02766"></a>02766                     <span class="keywordflow">if</span> (ip_u[m] > 0.0) {
-<a name="l02767"></a>02767                         ipang[m] = 45.0;
-<a name="l02768"></a>02768                     }
-<a name="l02769"></a>02769                     <span class="keywordflow">else</span> {
-<a name="l02770"></a>02770                         ipang[m] = 135.0;
-<a name="l02771"></a>02771                     }
-<a name="l02772"></a>02772                 }
-<a name="l02773"></a>02773                 <span class="keywordflow">else</span> {
-<a name="l02774"></a>02774                     ipang[m] = 0.5 * atan(ip_u[m] / ip_q[m]) * 180 / M_PI;
-<a name="l02775"></a>02775                     <span class="keywordflow">if</span> (ip_q[m] > 0.0) {
-<a name="l02776"></a>02776                         <span class="keywordflow">if</span> (ip_u[m] < 0.0) {
-<a name="l02777"></a>02777                             ipang[m] += 180.;
-<a name="l02778"></a>02778                         }
-<a name="l02779"></a>02779                     }
-<a name="l02780"></a>02780                     <span class="keywordflow">else</span> {
-<a name="l02781"></a>02781                         ipang[m] += 90.;
-<a name="l02782"></a>02782                     }
-<a name="l02783"></a>02783                 }
-<a name="l02784"></a>02784 
-<a name="l02785"></a>02785                 <span class="comment">/* Error on the angle computation */</span>
-<a name="l02786"></a>02786                 radicand = ip_q[m] * ip_q[m] * ipuerr[m] * ipuerr[m] + 
-<a name="l02787"></a>02787                            ip_u[m] * ip_u[m] * ipqerr[m] * ipqerr[m];
-<a name="l02788"></a>02788   
-<a name="l02789"></a>02789                 ipangerr[m] = (ip_l[m] == 0.0 ? 0.0 :
-<a name="l02790"></a>02790                      sqrt(radicand) * 0.5 / (ip_l[m] * ip_l[m]) * 180 / M_PI);
-<a name="l02791"></a>02791 
-<a name="l02792"></a>02792                 <span class="comment">/*</span>
-<a name="l02793"></a>02793 <span class="comment">                 * This is a quick and dirty patch for FORS2 had the</span>
-<a name="l02794"></a>02794 <span class="comment">                 * Wolly mounted +180 with respect to FORS1. I must</span>
-<a name="l02795"></a>02795 <span class="comment">                 * hardcode it, because there is no such info in the </span>
-<a name="l02796"></a>02796 <span class="comment">                 * header.</span>
-<a name="l02797"></a>02797 <span class="comment">                 */</span>
-<a name="l02798"></a>02798 
-<a name="l02799"></a>02799                 <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>) {
-<a name="l02800"></a>02800 
-<a name="l02801"></a>02801                     <span class="keywordtype">double</span> w_rotation = - wollaston * M_PI / 2;
-<a name="l02802"></a>02802 
-<a name="l02803"></a>02803                     ipang[m] -= w_rotation * 180 / M_PI;
-<a name="l02804"></a>02804 
-<a name="l02805"></a>02805                     ip_q[m] = ip_q[m] * cos(2 * w_rotation)
-<a name="l02806"></a>02806                             + ip_u[m] * sin(2 * w_rotation);
-<a name="l02807"></a>02807 
-<a name="l02808"></a>02808                     ip_u[m] = ip_u[m] * cos(2 * w_rotation)
-<a name="l02809"></a>02809                             - ip_q[m] * sin(2 * w_rotation);
-<a name="l02810"></a>02810                 }
-<a name="l02811"></a>02811 
-<a name="l02812"></a>02812                 <span class="keywordflow">if</span> (chromatism) {
-<a name="l02813"></a>02813                     ipang[m] -= correct[m] * 180 / M_PI;
-<a name="l02814"></a>02814 
-<a name="l02815"></a>02815                     ip_q[m] = ip_q[m] * cos(2 * correct[m])
-<a name="l02816"></a>02816                             + ip_u[m] * sin(2 * correct[m]);
-<a name="l02817"></a>02817     
-<a name="l02818"></a>02818                     ip_u[m] = ip_u[m] * cos(2 * correct[m])
-<a name="l02819"></a>02819                             - ip_q[m] * sin(2 * correct[m]);
-<a name="l02820"></a>02820                 }
-<a name="l02821"></a>02821 
-<a name="l02822"></a>02822                 <span class="keywordflow">if</span> (ipang[m] < 0.0)
-<a name="l02823"></a>02823                     ipang[m] += 180.;
-<a name="l02824"></a>02824                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ipang[m] >= 180.0)
-<a name="l02825"></a>02825                     ipang[m] -= 180.;
-<a name="l02826"></a>02826             }
-<a name="l02827"></a>02827 
-<a name="l02828"></a>02828             <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l02829"></a>02829                 <span class="keywordtype">float</span> * weights;
-<a name="l02830"></a>02830                 <span class="keywordtype">float</span>   max, sum, sum2, imean;
-<a name="l02831"></a>02831 
-<a name="l02832"></a>02832                 <span class="keywordtype">int</span> k;
-<a name="l02833"></a>02833 
-<a name="l02834"></a>02834                 <span class="comment">/* QC on Q NULL */</span>
-<a name="l02835"></a>02835                 weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);
-<a name="l02836"></a>02836 
-<a name="l02837"></a>02837                 max = 0.0;
-<a name="l02838"></a>02838                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02839"></a>02839                     <span class="keywordflow">if</span> (max < iffq[k]) max = iffq[k];
-<a name="l02840"></a>02840                 }
-<a name="l02841"></a>02841             
-<a name="l02842"></a>02842                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02843"></a>02843                     weights[k] = iffq[k] < 0.0 ? 
-<a name="l02844"></a>02844                         0.0 : iffq[k] * iffq[k] / (max * max);
-<a name="l02845"></a>02845                 }
-<a name="l02846"></a>02846             
-<a name="l02847"></a>02847                 sum  = 0.0;
-<a name="l02848"></a>02848                 sum2 = 0.0;
-<a name="l02849"></a>02849                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02850"></a>02850                     sum  += weights[k] * ip_qnull[k];
-<a name="l02851"></a>02851                     sum2 += weights[k];
-<a name="l02852"></a>02852                 }
-<a name="l02853"></a>02853 
-<a name="l02854"></a>02854                 cpl_free(weights);
-<a name="l02855"></a>02855 
-<a name="l02856"></a>02856                 imean = sum / sum2;
-<a name="l02857"></a>02857 
-<a name="l02858"></a>02858                 mean_qnull += (imean - mean_qnull) / (j + 1.0);
-<a name="l02859"></a>02859                   
-<a name="l02860"></a>02860                 <span class="comment">/* QC on U NULL */</span>
-<a name="l02861"></a>02861                 weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);
-<a name="l02862"></a>02862             
-<a name="l02863"></a>02863                 max = 0.0;
-<a name="l02864"></a>02864                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02865"></a>02865                     <span class="keywordflow">if</span> (max < iffu[k]) max = iffu[k];
-<a name="l02866"></a>02866                 }
-<a name="l02867"></a>02867             
-<a name="l02868"></a>02868                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02869"></a>02869                     weights[k] = iffu[k] < 0.0 ? 
-<a name="l02870"></a>02870                         0.0 : iffu[k] * iffu[k] / (max * max);
-<a name="l02871"></a>02871                 }
-<a name="l02872"></a>02872             
-<a name="l02873"></a>02873                 sum  = 0.0;
-<a name="l02874"></a>02874                 sum2 = 0.0;
-<a name="l02875"></a>02875                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l02876"></a>02876                     sum  += weights[k] * ip_unull[k];
-<a name="l02877"></a>02877                     sum2 += weights[k];
-<a name="l02878"></a>02878                 }
-<a name="l02879"></a>02879 
-<a name="l02880"></a>02880                 cpl_free(weights);
-<a name="l02881"></a>02881 
-<a name="l02882"></a>02882                 imean = sum / sum2;
-<a name="l02883"></a>02883 
-<a name="l02884"></a>02884                 mean_unull += (imean - mean_unull) / (j + 1.0);
-<a name="l02885"></a>02885             }
-<a name="l02886"></a>02886         }
-<a name="l02887"></a>02887 
-<a name="l02888"></a>02888         cpl_image_delete(correct_im);
-<a name="l02889"></a>02889 
-<a name="l02890"></a>02890         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pq_im, reduced_q_tag, header, 
-<a name="l02891"></a>02891                            parlist, recipe, version))
-<a name="l02892"></a>02892             fors_pmos_science_exit(NULL);
-<a name="l02893"></a>02893 
-<a name="l02894"></a>02894         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pu_im, reduced_u_tag, header, 
-<a name="l02895"></a>02895                            parlist, recipe, version))
-<a name="l02896"></a>02896             fors_pmos_science_exit(NULL);
-<a name="l02897"></a>02897 
-<a name="l02898"></a>02898         <span class="keywordflow">if</span> (qc && standard) {
-<a name="l02899"></a>02899             cpl_table *polsta = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, std_pmos_table_tag, 1);
-<a name="l02900"></a>02900             cpl_propertylist *qheader = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset,
-<a name="l02901"></a>02901                                                         science_tag, 0);
-<a name="l02902"></a>02902             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l02903"></a>02903             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02904"></a>02904             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l02905"></a>02905                                    startwavelength + (dispersion * group)/2);
-<a name="l02906"></a>02906             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02907"></a>02907             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>,
-<a name="l02908"></a>02908                                            dispersion * group);
-<a name="l02909"></a>02909             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02910"></a>02910             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02911"></a>02911             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02912"></a>02912             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02913"></a>02913             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02914"></a>02914 
-<a name="l02915"></a>02915             <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gd170543de1ad9f6f2e4f1167e3f4ef4e">mos_check_polarisation</a>(pq_im, pqerr_im, pu_im, puerr_im,
-<a name="l02916"></a>02916                                        startwavelength, dispersion, 1000.,
-<a name="l02917"></a>02917                                        polsta, ra, dec, &filter,
-<a name="l02918"></a>02918                                        &polarised,
-<a name="l02919"></a>02919                                        &qc_pl, &qc_pl_err, 
-<a name="l02920"></a>02920                                        &qc_angle, &qc_angle_err)) {
-<a name="l02921"></a>02921                 cpl_msg_warning(cpl_func, <span class="stringliteral">"No QC can be computed"</span>);
-<a name="l02922"></a>02922             }
-<a name="l02923"></a>02923             <span class="keywordflow">else</span> {
-<a name="l02924"></a>02924                 <span class="keywordtype">char</span> *pipefile;
-<a name="l02925"></a>02925                 <span class="keywordtype">char</span> *keyname;
-<a name="l02926"></a>02926                 <span class="keywordtype">char</span> *text;
-<a name="l02927"></a>02927                 <span class="keywordtype">char</span>  band[] = {<span class="charliteral">' '</span>, <span class="charliteral">'\0'</span>};
-<a name="l02928"></a>02928 
-<a name="l02929"></a>02929                 <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);
-<a name="l02930"></a>02930 
-<a name="l02931"></a>02931                 <span class="comment">/*</span>
-<a name="l02932"></a>02932 <span class="comment">                 * QC1 group header</span>
-<a name="l02933"></a>02933 <span class="comment">                 */</span>
-<a name="l02934"></a>02934 
-<a name="l02935"></a>02935                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_l_tag,
-<a name="l02936"></a>02936                                          <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l02937"></a>02937                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write product category to "</span>
-<a name="l02938"></a>02938                                            <span class="stringliteral">"QC log file"</span>);
-<a name="l02939"></a>02939 
-<a name="l02940"></a>02940                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l02941"></a>02941                                            <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l02942"></a>02942                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span>
-<a name="l02943"></a>02943                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02944"></a>02944 
-<a name="l02945"></a>02945                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l02946"></a>02946                                            <span class="stringliteral">"Template"</span>, instrume))
-<a name="l02947"></a>02947                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span>
-<a name="l02948"></a>02948                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02949"></a>02949 
-<a name="l02950"></a>02950                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,
-<a name="l02951"></a>02951                                            <span class="stringliteral">"Grism name"</span>, instrume))
-<a name="l02952"></a>02952                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in "</span>
-<a name="l02953"></a>02953                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02954"></a>02954 
-<a name="l02955"></a>02955                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,
-<a name="l02956"></a>02956                                            <span class="stringliteral">"Grism identifier"</span>, instrume))
-<a name="l02957"></a>02957                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in "</span>
-<a name="l02958"></a>02958                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02959"></a>02959 
-<a name="l02960"></a>02960                 <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))
-<a name="l02961"></a>02961                     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,
-<a name="l02962"></a>02962                                            <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l02963"></a>02963 
-<a name="l02964"></a>02964                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,
-<a name="l02965"></a>02965                                            <span class="stringliteral">"Collimator name"</span>, instrume))
-<a name="l02966"></a>02966                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in "</span>
-<a name="l02967"></a>02967                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02968"></a>02968 
-<a name="l02969"></a>02969                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l02970"></a>02970                                            <span class="stringliteral">"Chip identifier"</span>, instrume))
-<a name="l02971"></a>02971                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in "</span>
-<a name="l02972"></a>02972                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02973"></a>02973 
-<a name="l02974"></a>02974                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l02975"></a>02975                                            <span class="stringliteral">"Archive name of input data"</span>,
-<a name="l02976"></a>02976                                            instrume))
-<a name="l02977"></a>02977                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span>
-<a name="l02978"></a>02978                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02979"></a>02979 
-<a name="l02980"></a>02980                 pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(reduced_nul_q_tag);
-<a name="l02981"></a>02981                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l02982"></a>02982                                          <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l02983"></a>02983                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span>
-<a name="l02984"></a>02984                                            <span class="stringliteral">"QC log file"</span>);
-<a name="l02985"></a>02985                 cpl_free(pipefile); pipefile = NULL;
-<a name="l02986"></a>02986 
-<a name="l02987"></a>02987 
-<a name="l02988"></a>02988                 <span class="comment">/*</span>
-<a name="l02989"></a>02989 <span class="comment">                 * QC1 parameters</span>
-<a name="l02990"></a>02990 <span class="comment">                 */</span>
-<a name="l02991"></a>02991 
-<a name="l02992"></a>02992                 keyname = <span class="stringliteral">"QC.PMOS.BAND"</span>;
-<a name="l02993"></a>02993 
-<a name="l02994"></a>02994                 band[0] = filter;
-<a name="l02995"></a>02995                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4480637fba9623895546614d7a21fb5">fors_qc_write_qc_string</a>(qheader, keyname, band,
-<a name="l02996"></a>02996                                             <span class="stringliteral">"Band where polarisation was "</span>
-<a name="l02997"></a>02997                                             <span class="stringliteral">"measured"</span>, instrume)) {
-<a name="l02998"></a>02998                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write QC.PMOS.BAND "</span>
-<a name="l02999"></a>02999                                            <span class="stringliteral">"parameter to QC log file"</span>);
-<a name="l03000"></a>03000                 }
-<a name="l03001"></a>03001 
-<a name="l03002"></a>03002                 keyname = <span class="stringliteral">"QC.PMOS.POLARISED"</span>;
-<a name="l03003"></a>03003 
-<a name="l03004"></a>03004                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g661730c28a076df446641c371342bf5b">fors_qc_write_qc_int</a>(qheader, polarised, keyname, NULL,
-<a name="l03005"></a>03005                                          <span class="stringliteral">"Polarisation is expected (1 = yes, "</span>
-<a name="l03006"></a>03006                                          <span class="stringliteral">"0 = no)"</span>, instrume)) {
-<a name="l03007"></a>03007                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write QC.PMOS.POLARISED "</span>
-<a name="l03008"></a>03008                                            <span class="stringliteral">"parameter to QC log file"</span>);
-<a name="l03009"></a>03009                 }
-<a name="l03010"></a>03010 
-<a name="l03011"></a>03011                 keyname = <span class="stringliteral">"QC.PMOS.L.OFFSET"</span>;
-<a name="l03012"></a>03012 
-<a name="l03013"></a>03013                 <span class="keywordflow">if</span> (polarised)
-<a name="l03014"></a>03014                     text = <span class="stringliteral">"Linear polarisation relative offset"</span>;
-<a name="l03015"></a>03015                 <span class="keywordflow">else</span>
-<a name="l03016"></a>03016                     text = <span class="stringliteral">"Linear polarisation offset"</span>;
-<a name="l03017"></a>03017 
-<a name="l03018"></a>03018                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qheader, qc_pl, keyname, NULL,
-<a name="l03019"></a>03019                                             text, instrume)) {
-<a name="l03020"></a>03020                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write linear polarisation "</span>
-<a name="l03021"></a>03021                                            <span class="stringliteral">"offset to QC log file"</span>);
-<a name="l03022"></a>03022                 }
-<a name="l03023"></a>03023 
-<a name="l03024"></a>03024                 keyname = <span class="stringliteral">"QC.PMOS.L.OFFSETERR"</span>;
-<a name="l03025"></a>03025 
-<a name="l03026"></a>03026                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qheader, qc_pl_err, keyname, NULL,
-<a name="l03027"></a>03027                                        <span class="stringliteral">"Error on linear polarisation offset"</span>,
-<a name="l03028"></a>03028                                        instrume)) {
-<a name="l03029"></a>03029                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write linear polarisation "</span>
-<a name="l03030"></a>03030                                        <span class="stringliteral">"offset error to QC log file"</span>);
-<a name="l03031"></a>03031                 }
-<a name="l03032"></a>03032 
-<a name="l03033"></a>03033                 <span class="keywordflow">if</span> (polarised) {
-<a name="l03034"></a>03034                     keyname = <span class="stringliteral">"QC.PMOS.ANGLE.OFFSET"</span>;
-<a name="l03035"></a>03035 
-<a name="l03036"></a>03036                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qheader, qc_angle, keyname, NULL,
-<a name="l03037"></a>03037                                                 <span class="stringliteral">"Polarisation angle offset"</span>,
-<a name="l03038"></a>03038                                                 instrume)) {
-<a name="l03039"></a>03039                         fors_pmos_science_exit(<span class="stringliteral">"Cannot write polarisation "</span>
-<a name="l03040"></a>03040                                                <span class="stringliteral">"angle offset to QC log file"</span>);
-<a name="l03041"></a>03041                     }
-<a name="l03042"></a>03042 
-<a name="l03043"></a>03043                     keyname = <span class="stringliteral">"QC.PMOS.ANGLE.OFFSETERR"</span>;
-<a name="l03044"></a>03044 
-<a name="l03045"></a>03045                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qheader, qc_angle_err, keyname, 
-<a name="l03046"></a>03046                                                 NULL, <span class="stringliteral">"Error on polarisation "</span>
-<a name="l03047"></a>03047                                                 <span class="stringliteral">"angle offset"</span>, instrume)) {
-<a name="l03048"></a>03048                         fors_pmos_science_exit(<span class="stringliteral">"Cannot write polarisation "</span>
-<a name="l03049"></a>03049                                                <span class="stringliteral">"angle offset error to QC "</span>
-<a name="l03050"></a>03050                                                <span class="stringliteral">"log file"</span>);
-<a name="l03051"></a>03051                     }
-<a name="l03052"></a>03052                 }
-<a name="l03053"></a>03053 
-<a name="l03054"></a>03054                 <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l03055"></a>03055             }
-<a name="l03056"></a>03056 
-<a name="l03057"></a>03057             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pl_im, reduced_l_tag, qheader,
-<a name="l03058"></a>03058                                parlist, recipe, version))
-<a name="l03059"></a>03059                 fors_pmos_science_exit(NULL);
-<a name="l03060"></a>03060 
-<a name="l03061"></a>03061             cpl_propertylist_delete(qheader);
-<a name="l03062"></a>03062         }
-<a name="l03063"></a>03063         <span class="keywordflow">else</span> {
-<a name="l03064"></a>03064             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pl_im, reduced_l_tag, header, 
-<a name="l03065"></a>03065                                parlist, recipe, version))
-<a name="l03066"></a>03066                 fors_pmos_science_exit(NULL);
-<a name="l03067"></a>03067         }
-<a name="l03068"></a>03068 
-<a name="l03069"></a>03069         <span class="keywordflow">if</span> (nscience / 4 > 1) {
-<a name="l03070"></a>03070             <span class="keywordtype">char</span> *pipefile; 
-<a name="l03071"></a>03071             <span class="keywordtype">char</span> *keyname;
-<a name="l03072"></a>03072             cpl_propertylist *qheader = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, 
-<a name="l03073"></a>03073                                                         science_tag, 0);
-<a name="l03074"></a>03074 
-<a name="l03075"></a>03075             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l03076"></a>03076             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l03077"></a>03077             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l03078"></a>03078                                    startwavelength + (dispersion * group)/2);
-<a name="l03079"></a>03079             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l03080"></a>03080             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, 
-<a name="l03081"></a>03081                                            dispersion * group);
-<a name="l03082"></a>03082             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l03083"></a>03083             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l03084"></a>03084             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l03085"></a>03085             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l03086"></a>03086             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l03087"></a>03087 
-<a name="l03088"></a>03088             <span class="keywordflow">if</span> (qc) {
-<a name="l03089"></a>03089                 <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);
-<a name="l03090"></a>03090 
-<a name="l03091"></a>03091                 <span class="comment">/*</span>
-<a name="l03092"></a>03092 <span class="comment">                 * QC1 group header</span>
-<a name="l03093"></a>03093 <span class="comment">                 */</span>
-<a name="l03094"></a>03094 
-<a name="l03095"></a>03095                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_q_tag,
-<a name="l03096"></a>03096                                          <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l03097"></a>03097                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write product category to "</span>
-<a name="l03098"></a>03098                                            <span class="stringliteral">"QC log file"</span>);
-<a name="l03099"></a>03099 
-<a name="l03100"></a>03100                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l03101"></a>03101                                            <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l03102"></a>03102                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span>
-<a name="l03103"></a>03103                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03104"></a>03104 
-<a name="l03105"></a>03105                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l03106"></a>03106                                            <span class="stringliteral">"Template"</span>, instrume))
-<a name="l03107"></a>03107                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span>
-<a name="l03108"></a>03108                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03109"></a>03109 
-<a name="l03110"></a>03110                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,
-<a name="l03111"></a>03111                                            <span class="stringliteral">"Grism name"</span>, instrume))
-<a name="l03112"></a>03112                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in "</span>
-<a name="l03113"></a>03113                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03114"></a>03114 
-<a name="l03115"></a>03115                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,
-<a name="l03116"></a>03116                                            <span class="stringliteral">"Grism identifier"</span>, instrume))
-<a name="l03117"></a>03117                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in "</span>
-<a name="l03118"></a>03118                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03119"></a>03119 
-<a name="l03120"></a>03120                 <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))
-<a name="l03121"></a>03121                     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,
-<a name="l03122"></a>03122                                            <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l03123"></a>03123 
-<a name="l03124"></a>03124                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,
-<a name="l03125"></a>03125                                            <span class="stringliteral">"Collimator name"</span>, instrume))
-<a name="l03126"></a>03126                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in "</span>
-<a name="l03127"></a>03127                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03128"></a>03128 
-<a name="l03129"></a>03129                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l03130"></a>03130                                            <span class="stringliteral">"Chip identifier"</span>, instrume))
-<a name="l03131"></a>03131                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in "</span>
-<a name="l03132"></a>03132                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03133"></a>03133 
-<a name="l03134"></a>03134                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l03135"></a>03135                                            <span class="stringliteral">"Archive name of input data"</span>, 
-<a name="l03136"></a>03136                                            instrume))
-<a name="l03137"></a>03137                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span>
-<a name="l03138"></a>03138                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03139"></a>03139 
-<a name="l03140"></a>03140                 pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(reduced_nul_q_tag);
-<a name="l03141"></a>03141                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l03142"></a>03142                                          <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l03143"></a>03143                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span>
-<a name="l03144"></a>03144                                            <span class="stringliteral">"QC log file"</span>);
-<a name="l03145"></a>03145                 cpl_free(pipefile); pipefile = NULL;
-<a name="l03146"></a>03146 
-<a name="l03147"></a>03147 
-<a name="l03148"></a>03148                 <span class="comment">/*</span>
-<a name="l03149"></a>03149 <span class="comment">                 * QC1 parameters</span>
-<a name="l03150"></a>03150 <span class="comment">                 */</span>
-<a name="l03151"></a>03151 
-<a name="l03152"></a>03152                 keyname = <span class="stringliteral">"QC.NULL.Q.MEAN"</span>;
-<a name="l03153"></a>03153                     
-<a name="l03154"></a>03154                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qheader, mean_qnull,
-<a name="l03155"></a>03155                                             keyname, NULL,
-<a name="l03156"></a>03156                                             <span class="stringliteral">"Mean Q null parameter"</span>,
-<a name="l03157"></a>03157                                             instrume)) {
-<a name="l03158"></a>03158                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write mean Q null "</span>
-<a name="l03159"></a>03159                                            <span class="stringliteral">"parameter to QC log file"</span>);
-<a name="l03160"></a>03160                 }
-<a name="l03161"></a>03161 
-<a name="l03162"></a>03162                 keyname = <span class="stringliteral">"QC.NANGLES"</span>;
-<a name="l03163"></a>03163 
-<a name="l03164"></a>03164                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g661730c28a076df446641c371342bf5b">fors_qc_write_qc_int</a>(qheader, nscience / 2,
-<a name="l03165"></a>03165                                          keyname, NULL,
-<a name="l03166"></a>03166                                          <span class="stringliteral">"Number of processed plate angles"</span>,
-<a name="l03167"></a>03167                                          instrume)) {
-<a name="l03168"></a>03168                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write number of processed "</span>
-<a name="l03169"></a>03169                                            <span class="stringliteral">"plate angles."</span>);
-<a name="l03170"></a>03170                 }
-<a name="l03171"></a>03171 
-<a name="l03172"></a>03172                 <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l03173"></a>03173             }
-<a name="l03174"></a>03174 
-<a name="l03175"></a>03175             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pqnull_im, reduced_nul_q_tag, qheader, 
-<a name="l03176"></a>03176                                parlist, recipe, version))
-<a name="l03177"></a>03177                 fors_pmos_science_exit(NULL);
-<a name="l03178"></a>03178 
-<a name="l03179"></a>03179             cpl_propertylist_delete(qheader);
-<a name="l03180"></a>03180 
-<a name="l03181"></a>03181             qheader = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l03182"></a>03182 
-<a name="l03183"></a>03183             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l03184"></a>03184             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l03185"></a>03185             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l03186"></a>03186                                    startwavelength + (dispersion * group)/2);
-<a name="l03187"></a>03187             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l03188"></a>03188             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, 
-<a name="l03189"></a>03189                                            dispersion * group);
-<a name="l03190"></a>03190             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l03191"></a>03191             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l03192"></a>03192             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l03193"></a>03193             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l03194"></a>03194             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l03195"></a>03195 
-<a name="l03196"></a>03196             <span class="keywordflow">if</span> (qc) {
-<a name="l03197"></a>03197                 <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);
-<a name="l03198"></a>03198 
-<a name="l03199"></a>03199                 <span class="comment">/*</span>
-<a name="l03200"></a>03200 <span class="comment">                 * QC1 group header</span>
-<a name="l03201"></a>03201 <span class="comment">                 */</span>
-<a name="l03202"></a>03202 
-<a name="l03203"></a>03203                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_u_tag,
-<a name="l03204"></a>03204                                          <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l03205"></a>03205                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write product category to "</span>
-<a name="l03206"></a>03206                                          <span class="stringliteral">"QC log file"</span>);
-<a name="l03207"></a>03207 
-<a name="l03208"></a>03208                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l03209"></a>03209                                            <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l03210"></a>03210                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span>
-<a name="l03211"></a>03211                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03212"></a>03212 
-<a name="l03213"></a>03213                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l03214"></a>03214                                            <span class="stringliteral">"Template"</span>, instrume))
-<a name="l03215"></a>03215                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span>
-<a name="l03216"></a>03216                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03217"></a>03217 
-<a name="l03218"></a>03218                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,
-<a name="l03219"></a>03219                                            <span class="stringliteral">"Grism name"</span>, instrume))
-<a name="l03220"></a>03220                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in "</span>
-<a name="l03221"></a>03221                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03222"></a>03222 
-<a name="l03223"></a>03223                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,
-<a name="l03224"></a>03224                                            <span class="stringliteral">"Grism identifier"</span>, instrume))
-<a name="l03225"></a>03225                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in "</span>
-<a name="l03226"></a>03226                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03227"></a>03227 
-<a name="l03228"></a>03228                 <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))
-<a name="l03229"></a>03229                     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,
-<a name="l03230"></a>03230                                            <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l03231"></a>03231 
-<a name="l03232"></a>03232                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,
-<a name="l03233"></a>03233                                            <span class="stringliteral">"Collimator name"</span>, instrume))
-<a name="l03234"></a>03234                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in "</span>
-<a name="l03235"></a>03235                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03236"></a>03236 
-<a name="l03237"></a>03237                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l03238"></a>03238                                            <span class="stringliteral">"Chip identifier"</span>, instrume))
-<a name="l03239"></a>03239                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in "</span>
-<a name="l03240"></a>03240                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03241"></a>03241 
-<a name="l03242"></a>03242                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l03243"></a>03243                                            <span class="stringliteral">"Archive name of input data"</span>, 
-<a name="l03244"></a>03244                                            instrume))
-<a name="l03245"></a>03245                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span>
-<a name="l03246"></a>03246                                            <span class="stringliteral">"scientific frame header"</span>);
-<a name="l03247"></a>03247 
-<a name="l03248"></a>03248                 pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(reduced_nul_u_tag);
-<a name="l03249"></a>03249                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l03250"></a>03250                                          <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l03251"></a>03251                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span>
-<a name="l03252"></a>03252                                            <span class="stringliteral">"QC log file"</span>);
-<a name="l03253"></a>03253                 cpl_free(pipefile); pipefile = NULL;
-<a name="l03254"></a>03254 
-<a name="l03255"></a>03255 
-<a name="l03256"></a>03256                 <span class="comment">/*</span>
-<a name="l03257"></a>03257 <span class="comment">                 * QC1 parameters</span>
-<a name="l03258"></a>03258 <span class="comment">                 */</span>
-<a name="l03259"></a>03259 
-<a name="l03260"></a>03260                 keyname = <span class="stringliteral">"QC.NULL.U.MEAN"</span>;
-<a name="l03261"></a>03261                     
-<a name="l03262"></a>03262                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qheader, mean_unull,
-<a name="l03263"></a>03263                                             keyname, NULL,
-<a name="l03264"></a>03264                                             <span class="stringliteral">"Mean U null parameter"</span>,
-<a name="l03265"></a>03265                                             instrume)) {
-<a name="l03266"></a>03266                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write mean U null "</span>
-<a name="l03267"></a>03267                                            <span class="stringliteral">"parameter to QC log file"</span>);
-<a name="l03268"></a>03268                 }
-<a name="l03269"></a>03269 
-<a name="l03270"></a>03270                 keyname = <span class="stringliteral">"QC.NANGLES"</span>;
-<a name="l03271"></a>03271 
-<a name="l03272"></a>03272                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g661730c28a076df446641c371342bf5b">fors_qc_write_qc_int</a>(qheader, nscience / 2,
-<a name="l03273"></a>03273                                          keyname, NULL,
-<a name="l03274"></a>03274                                          <span class="stringliteral">"Number of processed plate angles"</span>,
-<a name="l03275"></a>03275                                          instrume)) {
-<a name="l03276"></a>03276                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write number of processed "</span>
-<a name="l03277"></a>03277                                            <span class="stringliteral">"plate angles."</span>);
-<a name="l03278"></a>03278                 }
-<a name="l03279"></a>03279 
-<a name="l03280"></a>03280                 <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l03281"></a>03281             }
-<a name="l03282"></a>03282 
-<a name="l03283"></a>03283             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, punull_im, reduced_nul_u_tag, qheader, 
-<a name="l03284"></a>03284                                parlist, recipe, version))
-<a name="l03285"></a>03285                 fors_pmos_science_exit(NULL);
-<a name="l03286"></a>03286 
-<a name="l03287"></a>03287             cpl_propertylist_delete(qheader);
-<a name="l03288"></a>03288         }
-<a name="l03289"></a>03289 
-<a name="l03290"></a>03290         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pqerr_im, reduced_error_q_tag, header, 
-<a name="l03291"></a>03291                            parlist, recipe, version))
-<a name="l03292"></a>03292             fors_pmos_science_exit(NULL);
-<a name="l03293"></a>03293 
-<a name="l03294"></a>03294         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, puerr_im, reduced_error_u_tag, header, 
-<a name="l03295"></a>03295                            parlist, recipe, version))
-<a name="l03296"></a>03296             fors_pmos_science_exit(NULL);
-<a name="l03297"></a>03297 
-<a name="l03298"></a>03298         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, plerr_im, reduced_error_l_tag, header, 
-<a name="l03299"></a>03299                            parlist, recipe, version))
-<a name="l03300"></a>03300             fors_pmos_science_exit(NULL);
-<a name="l03301"></a>03301 
-<a name="l03302"></a>03302         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pang_im, reduced_angle_tag, header, 
-<a name="l03303"></a>03303                            parlist, recipe, version))
-<a name="l03304"></a>03304             fors_pmos_science_exit(NULL);
-<a name="l03305"></a>03305 
-<a name="l03306"></a>03306         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pangerr_im, reduced_error_angle_tag, 
-<a name="l03307"></a>03307                            header, parlist, recipe, version))
-<a name="l03308"></a>03308             fors_pmos_science_exit(NULL);
-<a name="l03309"></a>03309 
-<a name="l03310"></a>03310         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pi_im, reduced_i_tag, 
-<a name="l03311"></a>03311                            header, parlist, recipe, version))
-<a name="l03312"></a>03312             fors_pmos_science_exit(NULL);
-<a name="l03313"></a>03313 
-<a name="l03314"></a>03314         cpl_image_power(pierr_im, 0.5);
-<a name="l03315"></a>03315 
-<a name="l03316"></a>03316         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, pierr_im, reduced_error_i_tag, 
-<a name="l03317"></a>03317                            header, parlist, recipe, version))
-<a name="l03318"></a>03318             fors_pmos_science_exit(NULL);
-<a name="l03319"></a>03319 
-<a name="l03320"></a>03320 <span class="comment">/* %%% */</span>
-<a name="l03321"></a>03321 
-<a name="l03322"></a>03322         cpl_image_delete(pq_im);
-<a name="l03323"></a>03323         cpl_image_delete(pu_im);
-<a name="l03324"></a>03324         cpl_image_delete(pl_im);
-<a name="l03325"></a>03325         cpl_image_delete(pi_im);
-<a name="l03326"></a>03326 
-<a name="l03327"></a>03327         cpl_image_delete(pqnull_im);
-<a name="l03328"></a>03328         cpl_image_delete(punull_im);
-<a name="l03329"></a>03329 
-<a name="l03330"></a>03330         cpl_image_delete(pqerr_im);
-<a name="l03331"></a>03331         cpl_image_delete(puerr_im);
-<a name="l03332"></a>03332         cpl_image_delete(plerr_im);
-<a name="l03333"></a>03333         cpl_image_delete(pierr_im);
-<a name="l03334"></a>03334         cpl_image_delete(pang_im);
-<a name="l03335"></a>03335         cpl_image_delete(pangerr_im);
-<a name="l03336"></a>03336     }
-<a name="l03337"></a>03337 
-<a name="l03338"></a>03338     cpl_propertylist_delete(header);
-<a name="l03339"></a>03339 
-<a name="l03340"></a>03340     <span class="comment">/* End of Stokes computation */</span>
-<a name="l03341"></a>03341 
-<a name="l03342"></a>03342     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {
-<a name="l03343"></a>03343         cpl_image_delete(reduceds[j]);
-<a name="l03344"></a>03344         cpl_image_delete(rerrors[j]);
-<a name="l03345"></a>03345         cpl_table_delete(slitss[j]);
-<a name="l03346"></a>03346         cpl_image_delete(mappeds[j]);
-<a name="l03347"></a>03347     }
-<a name="l03348"></a>03348 
-<a name="l03349"></a>03349     cpl_free(reduceds);
-<a name="l03350"></a>03350     cpl_free(rerrors);
-<a name="l03351"></a>03351     cpl_free(slitss);
-<a name="l03352"></a>03352     cpl_free(mappeds);
-<a name="l03353"></a>03353 
-<a name="l03354"></a>03354     cpl_free(instrume); instrume = NULL;
-<a name="l03355"></a>03355 
-<a name="l03356"></a>03356     cpl_free(skylocalmaps);
-<a name="l03357"></a>03357 
-<a name="l03358"></a>03358     cpl_free(nobjs_per_slit);
-<a name="l03359"></a>03359 
-<a name="l03360"></a>03360     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l03361"></a>03361         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l03362"></a>03362         fors_pmos_science_exit(NULL);
-<a name="l03363"></a>03363     }
-<a name="l03364"></a>03364     <span class="keywordflow">else</span> 
-<a name="l03365"></a>03365         <span class="keywordflow">return</span> 0;
-<a name="l03366"></a>03366 }
-<a name="l03367"></a>03367 
-<a name="l03368"></a>03368 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03379"></a>03379 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03380"></a>03380 <span class="keyword">static</span> <span class="keywordtype">float</span> * fors_check_angles(cpl_frameset * frameset,
-<a name="l03381"></a>03381                                  <span class="keywordtype">int</span> pmos, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, <span class="keywordtype">int</span> * circ)
-<a name="l03382"></a>03382 {
-<a name="l03383"></a>03383     <span class="keywordtype">float</span>     *angles  = NULL;
-<a name="l03384"></a>03384     cpl_frame *c_frame = NULL;
-<a name="l03385"></a>03385     <span class="keywordtype">char</span>      *ret_id  = NULL;
-<a name="l03386"></a>03386 
-<a name="l03387"></a>03387     <span class="keywordtype">int</span> i = 0;
-<a name="l03388"></a>03388 
-<a name="l03389"></a>03389     angles = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * pmos);
-<a name="l03390"></a>03390 
-<a name="l03391"></a>03391     <span class="keywordflow">for</span> (c_frame  = cpl_frameset_find(frameset, tag);
-<a name="l03392"></a>03392          c_frame != NULL; c_frame = cpl_frameset_find(frameset, NULL)) {
-<a name="l03393"></a>03393 
-<a name="l03394"></a>03394         cpl_propertylist * header =
-<a name="l03395"></a>03395             cpl_propertylist_load(cpl_frame_get_filename(c_frame), 0);
-<a name="l03396"></a>03396         
-<a name="l03397"></a>03397         <span class="keywordflow">if</span> (!ret_id) {
-<a name="l03398"></a>03398             ret_id = cpl_strdup(cpl_propertylist_get_string(header, 
-<a name="l03399"></a>03399                                                         <span class="stringliteral">"ESO INS OPTI4 ID"</span>));
-<a name="l03400"></a>03400 
-<a name="l03401"></a>03401             <span class="keywordflow">if</span> (ret_id[1] != <span class="charliteral">'5'</span> && ret_id[1] != <span class="charliteral">'4'</span>) {
-<a name="l03402"></a>03402                 cpl_msg_error(cpl_func, 
-<a name="l03403"></a>03403                               <span class="stringliteral">"Unknown retarder plate id: %s"</span>, ret_id);
-<a name="l03404"></a>03404                 <span class="keywordflow">return</span> NULL;
-<a name="l03405"></a>03405             }
-<a name="l03406"></a>03406         } <span class="keywordflow">else</span> {
-<a name="l03407"></a>03407             <span class="keywordtype">char</span> * c_ret_id = (<span class="keywordtype">char</span> *)
-<a name="l03408"></a>03408                 cpl_propertylist_get_string(header, <span class="stringliteral">"ESO INS OPTI4 ID"</span>);
-<a name="l03409"></a>03409             <span class="keywordflow">if</span> (ret_id[1] != c_ret_id[1]) {
-<a name="l03410"></a>03410                 cpl_msg_error(cpl_func, <span class="stringliteral">"Input frames are not from the same "</span>
-<a name="l03411"></a>03411                               <span class="stringliteral">"retarder plate"</span>);
-<a name="l03412"></a>03412                 <span class="keywordflow">return</span> NULL;
-<a name="l03413"></a>03413             }
-<a name="l03414"></a>03414         }
-<a name="l03415"></a>03415         
-<a name="l03416"></a>03416         <span class="keywordflow">if</span> (ret_id[1] == <span class="charliteral">'5'</span>) {  <span class="comment">/* Linear polarimetry */</span>
-<a name="l03417"></a>03417             <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS RETA2 ROT"</span>)) {
-<a name="l03418"></a>03418                 angles[i] = (float)floor(2*cpl_propertylist_get_double(header, 
-<a name="l03419"></a>03419                                                 <span class="stringliteral">"ESO INS RETA2 ROT"</span>) + 0.5)/2;
-<a name="l03420"></a>03420             }
-<a name="l03421"></a>03421             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS RETA2 POSANG"</span>)) {
-<a name="l03422"></a>03422                 <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO ADA POSANG"</span>)) {
-<a name="l03423"></a>03423                     <span class="keywordtype">double</span> reta2pos = cpl_propertylist_get_double(header, 
-<a name="l03424"></a>03424                                                      <span class="stringliteral">"ESO INS RETA2 POSANG"</span>);
-<a name="l03425"></a>03425                     <span class="keywordtype">double</span> adapos = cpl_propertylist_get_double(header, 
-<a name="l03426"></a>03426                                                      <span class="stringliteral">"ESO ADA POSANG"</span>);
-<a name="l03427"></a>03427                     angles[i] = (float)floor(2*(reta2pos - adapos) + 0.5)/2;
-<a name="l03428"></a>03428                 }
-<a name="l03429"></a>03429                 <span class="keywordflow">else</span> {
-<a name="l03430"></a>03430                     cpl_msg_error(cpl_func, 
-<a name="l03431"></a>03431                                   <span class="stringliteral">"ESO ADA POSANG not found in header"</span>);
-<a name="l03432"></a>03432                     <span class="keywordflow">return</span> NULL;
-<a name="l03433"></a>03433                 }
-<a name="l03434"></a>03434             }
-<a name="l03435"></a>03435             <span class="keywordflow">else</span> {
-<a name="l03436"></a>03436                 cpl_msg_error(cpl_func, <span class="stringliteral">"Neither ESO INS RETA2 ROT nor "</span>
-<a name="l03437"></a>03437                               <span class="stringliteral">"ESO INS RETA2 POSANG found in header"</span>);
-<a name="l03438"></a>03438                 <span class="keywordflow">return</span> NULL;
-<a name="l03439"></a>03439             }
-<a name="l03440"></a>03440             *circ = 0;
-<a name="l03441"></a>03441         } <span class="keywordflow">else</span> {                 <span class="comment">/* Circular polarimetry */</span>
-<a name="l03442"></a>03442             <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS RETA4 ROT"</span>)) {
-<a name="l03443"></a>03443                 angles[i] = (float)floor(2*cpl_propertylist_get_double(header, 
-<a name="l03444"></a>03444                                                 <span class="stringliteral">"ESO INS RETA4 ROT"</span>) + 0.5)/2;
-<a name="l03445"></a>03445                 <span class="comment">//Check if it makes sense. Change in all other places</span>
-<a name="l03446"></a>03446                 <span class="keywordflow">if</span> (angles[i] < 0) 
-<a name="l03447"></a>03447                     angles[i] = angles[i] + 360;
-<a name="l03448"></a>03448             }
-<a name="l03449"></a>03449             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS RETA4 POSANG"</span>)) {
-<a name="l03450"></a>03450                 <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO ADA POSANG"</span>)) {
-<a name="l03451"></a>03451                     <span class="keywordtype">double</span> reta4pos = cpl_propertylist_get_double(header, 
-<a name="l03452"></a>03452                                                      <span class="stringliteral">"ESO INS RETA4 POSANG"</span>);
-<a name="l03453"></a>03453                     <span class="keywordtype">double</span> adapos = cpl_propertylist_get_double(header, 
-<a name="l03454"></a>03454                                                      <span class="stringliteral">"ESO ADA POSANG"</span>);
-<a name="l03455"></a>03455                     angles[i] = (float)floor(2*(reta4pos - adapos) + 0.5/2);
-<a name="l03456"></a>03456                 }
-<a name="l03457"></a>03457                 <span class="keywordflow">else</span> {
-<a name="l03458"></a>03458                     cpl_msg_error(cpl_func, 
-<a name="l03459"></a>03459                                   <span class="stringliteral">"ESO ADA POSANG not found in header"</span>);
-<a name="l03460"></a>03460                     <span class="keywordflow">return</span> NULL;
-<a name="l03461"></a>03461                 }
-<a name="l03462"></a>03462             }
-<a name="l03463"></a>03463             <span class="keywordflow">else</span> {
-<a name="l03464"></a>03464                 cpl_msg_error(cpl_func, <span class="stringliteral">"Neither ESO INS RETA4 ROT nor "</span>
-<a name="l03465"></a>03465                               <span class="stringliteral">"ESO INS RETA4 POSANG found in header"</span>);
-<a name="l03466"></a>03466                 <span class="keywordflow">return</span> NULL;
-<a name="l03467"></a>03467             }
-<a name="l03468"></a>03468             *circ = 1;
-<a name="l03469"></a>03469         }
-<a name="l03470"></a>03470 
-<a name="l03471"></a>03471         cpl_propertylist_delete(header);
-<a name="l03472"></a>03472         i++;
-<a name="l03473"></a>03473     }
-<a name="l03474"></a>03474 
-<a name="l03475"></a>03475     cpl_free(ret_id);
-<a name="l03476"></a>03476 
-<a name="l03477"></a>03477     <span class="keywordflow">if</span> (*circ) {
-<a name="l03478"></a>03478         <span class="keywordflow">if</span> (pmos != 2 && pmos != 4) {
-<a name="l03479"></a>03479             cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: %d angles "</span>
-<a name="l03480"></a>03480                           <span class="stringliteral">"found, but either 2 or 4 are required for "</span>
-<a name="l03481"></a>03481                           <span class="stringliteral">"circular polarization measurements!"</span>, pmos);
-<a name="l03482"></a>03482             <span class="keywordflow">return</span> NULL;
-<a name="l03483"></a>03483         }
-<a name="l03484"></a>03484     } <span class="keywordflow">else</span> {
-<a name="l03485"></a>03485         <span class="keywordflow">if</span> (pmos != 4 && pmos != 8 && pmos != 16) {
-<a name="l03486"></a>03486             cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: %d angles "</span>
-<a name="l03487"></a>03487                           <span class="stringliteral">"found, but either 4, 8, or 16 are required for "</span>
-<a name="l03488"></a>03488                           <span class="stringliteral">"linear polarization measurements!"</span>, pmos);
-<a name="l03489"></a>03489             <span class="keywordflow">return</span> NULL;
-<a name="l03490"></a>03490         }
-<a name="l03491"></a>03491     }
-<a name="l03492"></a>03492     
-<a name="l03493"></a>03493     <span class="comment">/* Check completeness */</span>
-<a name="l03494"></a>03494 
-<a name="l03495"></a>03495     <span class="keywordflow">if</span> (*circ) {
-<a name="l03496"></a>03496         <span class="keywordflow">for</span> (i = 0; i < pmos; i++) {
-<a name="l03497"></a>03497             <span class="keywordflow">if</span> (fors_find_angle_pos(angles, pmos, 90.0 * i - 45.0) < 0) {
-<a name="l03498"></a>03498                 <span class="keyword">const</span> <span class="keywordtype">char</span> *cangles;
-<a name="l03499"></a>03499                 <span class="keywordflow">switch</span> (pmos) {
-<a name="l03500"></a>03500                 <span class="keywordflow">case</span> 2: cangles  = <span class="stringliteral">"-45.0, 45.0"</span>; <span class="keywordflow">break</span>;
-<a name="l03501"></a>03501                 <span class="keywordflow">case</span> 4: cangles  = <span class="stringliteral">"-45.0, 45.0, 135.0, 225.0"</span>; <span class="keywordflow">break</span>;
-<a name="l03502"></a>03502                 <span class="keywordflow">default</span>: assert(0);
-<a name="l03503"></a>03503                 }  
-<a name="l03504"></a>03504 
-<a name="l03505"></a>03505                 cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: missing "</span>
-<a name="l03506"></a>03506                               <span class="stringliteral">"angle %.2f. All angles %s must be provided."</span>,
-<a name="l03507"></a>03507                               angles[i], cangles);
-<a name="l03508"></a>03508                 <span class="keywordflow">return</span> NULL;
-<a name="l03509"></a>03509             }
-<a name="l03510"></a>03510         }
-<a name="l03511"></a>03511     }
-<a name="l03512"></a>03512     <span class="keywordflow">else</span> {
-<a name="l03513"></a>03513         <span class="keywordflow">for</span> (i = 0; i < pmos; i++) {
-<a name="l03514"></a>03514             <span class="keywordflow">if</span> (fors_find_angle_pos(angles, pmos, 22.5 * i) < 0) {
-<a name="l03515"></a>03515                 <span class="keyword">const</span> <span class="keywordtype">char</span> *cangles;
-<a name="l03516"></a>03516                 <span class="keywordflow">switch</span> (pmos) {
-<a name="l03517"></a>03517                 <span class="keywordflow">case</span> 4: cangles  = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5"</span>; <span class="keywordflow">break</span>;
-<a name="l03518"></a>03518                 <span class="keywordflow">case</span> 8: cangles  = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5, "</span>
-<a name="l03519"></a>03519                                    <span class="stringliteral">"90.0, 112.5, 135.0, 157.5"</span>; <span class="keywordflow">break</span>;
-<a name="l03520"></a>03520                 <span class="keywordflow">case</span> 16: cangles = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5, "</span>
-<a name="l03521"></a>03521                                    <span class="stringliteral">"90.0, 112.5, 135.0, 157.5, "</span>
-<a name="l03522"></a>03522                                    <span class="stringliteral">"180.0, 202.5, 225.0, 247.5, "</span>
-<a name="l03523"></a>03523                                    <span class="stringliteral">"270.0, 292.5, 315.0, 337.5"</span>; <span class="keywordflow">break</span>;
-<a name="l03524"></a>03524                 <span class="keywordflow">default</span>: assert(0);
-<a name="l03525"></a>03525                 }  
-<a name="l03526"></a>03526 
-<a name="l03527"></a>03527                 cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: missing "</span>
-<a name="l03528"></a>03528                               <span class="stringliteral">"angle %.2f. All angles %s must be provided."</span>,
-<a name="l03529"></a>03529                               angles[i], cangles);
-<a name="l03530"></a>03530                 <span class="keywordflow">return</span> NULL;
-<a name="l03531"></a>03531             }
-<a name="l03532"></a>03532         }
-<a name="l03533"></a>03533     }
-<a name="l03534"></a>03534 
-<a name="l03535"></a>03535     <span class="keywordflow">return</span> angles;
-<a name="l03536"></a>03536 }
-<a name="l03537"></a>03537 
-<a name="l03538"></a>03538 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03546"></a>03546 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l03547"></a>03547 <span class="keyword">static</span> <span class="keywordtype">int</span>
-<a name="l03548"></a>03548 fors_find_angle_pos(<span class="keywordtype">float</span> * angles, <span class="keywordtype">int</span> nangles, <span class="keywordtype">float</span> angle)
-<a name="l03549"></a>03549 {
-<a name="l03550"></a>03550     <span class="keywordtype">int</span> i, match = 0;
-<a name="l03551"></a>03551 
-<a name="l03552"></a>03552     <span class="keywordflow">for</span> (i = 0; i < nangles; i++) {
-<a name="l03553"></a>03553         <span class="keywordflow">if</span> (fabs(angles[i]         - angle) < 1.0 || 
-<a name="l03554"></a>03554             fabs(angles[i] - 360.0 - angle) < 1.0) {
-<a name="l03555"></a>03555             match = 1;
-<a name="l03556"></a>03556             <span class="keywordflow">break</span>;
-<a name="l03557"></a>03557         }
-<a name="l03558"></a>03558     }
-<a name="l03559"></a>03559 
-<a name="l03560"></a>03560     <span class="keywordflow">return</span> match ? i : -1;
-<a name="l03561"></a>03561 }
-<a name="l03562"></a>03562 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__pmos__science_8c_source.html b/html/fors__pmos__science_8c_source.html
new file mode 100644
index 0000000..deb416b
--- /dev/null
+++ b/html/fors__pmos__science_8c_source.html
@@ -0,0 +1,3560 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_pmos_science.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_pmos_science.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_pmos_science.c,v 1.65 2013-10-09 15:59:38 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-09 15:59:38 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.65 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <ctype.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <assert.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_create(cpl_plugin *);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keyword">static</span> <span class="keywordtype">float</span> * fors_check_angles(cpl_frameset *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span> *);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keyword">static</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> fors_find_angle_pos(<span class="keywordtype">float</span> * angles, <span class="keywordtype">int</span> nangles, <span class="keywordtype">float</span> angle);</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_pmos_science_description[] =</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"This recipe is used to reduce scientific spectra using the extraction\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"mask and the products created by the recipe fors_mpol_calib. The spectra\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"are bias subtracted, flat fielded (if a normalised flat field is specified)\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"and remapped eliminating the optical distortions. The wavelength calibration\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"can be optionally upgraded using a number of sky lines: if no sky lines\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"catalog of wavelengths is specified, an internal one is used instead.\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"If the alignment to the sky lines is performed, the input dispersion\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"coefficients table is upgraded and saved to disk, and a new CCD wavelengths\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"map is created.\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. A grism table (typically\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"depending on the instrument mode, and in particular on the grism used)\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"may also be specified: this table contains a default recipe parameter\n"</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"setting to control the way spectra are extracted for a specific instrument\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"mode, as it is used for automatic run of the pipeline on Paranal and in\n"</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"Garching. If this table is specified, it will modify the default recipe\n"</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"parameter setting, with the exception of those parameters which have been\n"</span> </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"explicitly modifyed on the command line. If a grism table is not specified,\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"the input recipe parameters values will always be read from the command\n"</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"line, or from an esorex configuration file if present, or from their\n"</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"generic default values (that are rarely meaningful).\n"</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"Either a scientific or a standard star exposure can be specified in input.\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"The acronym SCI on products should be read STD in case of standard stars\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"observations.\n\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"  DO category:               Type:       Explanation:            Required:\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="stringliteral">"  SCIENCE_PMOS                  Raw         Scientific exposure      Y\n"</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="stringliteral">"  or STANDARD_PMOS              Raw         Standard star exposure   Y\n"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="stringliteral">"  MASTER_BIAS                   Calib       Master bias              Y\n"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"  GRISM_TABLE                   Calib       Grism table              .\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"  MASTER_SKYLINECAT             Calib       Sky lines catalog        .\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="stringliteral">"  MASTER_NORM_FLAT_PMOS         Calib       Normalised flat field    .\n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="stringliteral">"  DISP_COEFF_PMOS               Calib       Inverse dispersion       Y\n"</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="stringliteral">"  CURV_COEFF_PMOS               Calib       Spectral curvature       Y\n"</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="stringliteral">"  SLIT_LOCATION_PMOS            Calib       Slits positions table    Y\n"</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="stringliteral">"  RETARDER_WAVEPLATE_CHROMATISM Calib       Chromatism correction    .\n"</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="stringliteral">"  STD_PMOS_TABLE                Calib       Linear pol. of std stars .\n"</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="stringliteral">"  REDUCED_SCI_PMOS             FITS image  Extracted scientific spectra\n"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="stringliteral">"  REDUCED_SKY_SCI_PMOS         FITS image  Extracted sky spectra\n"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="stringliteral">"  REDUCED_ERROR_SCI_PMOS       FITS image  Errors on extracted spectra\n"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"  REDUCED_X_SCI_PMOS           FITS image  X Stokes parameter (and L)\n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"  REDUCED_ERROR_X_SCI_PMOS     FITS image  Error on X Stokes parameter\n"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="stringliteral">"  REDUCED_NUL_X_SCI_PMOS       FITS image  Null parameter for X\n"</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="stringliteral">"  REDUCED_ANGLE_SCI_PMOS       FITS image  Direction of linear polarization\n"</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="stringliteral">"  REDUCED_ERROR_ANGLE_SCI_PMOS FITS image  Error on polarization direction\n"</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="stringliteral">"  UNMAPPED_SCI_PMOS            FITS image  Sky subtracted scientific spectra\n"</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="stringliteral">"  MAPPED_SCI_PMOS              FITS image  Rectified scientific spectra\n"</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="stringliteral">"  MAPPED_ALL_SCI_PMOS          FITS image  Rectified science spectra with sky\n"</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="stringliteral">"  MAPPED_SKY_SCI_PMOS          FITS image  Rectified sky spectra\n"</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="stringliteral">"  UNMAPPED_SKY_SCI_PMOS        FITS image  Sky on CCD\n"</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="stringliteral">"  OBJECT_TABLE_SCI_PMOS        FITS table  Positions of detected objects\n"</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="stringliteral">"  OBJECT_TABLE_POL_SCI_PMOS    FITS table  Positions of real objects\n"</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="stringliteral">"  Only if the sky-alignment of the wavelength solution is requested:\n"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="stringliteral">"  DISP_COEFF_SCI_PMOS          FITS table  Upgraded dispersion coefficients\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="stringliteral">"  WAVELENGTH_MAP_SCI_PMOS      FITS image  Upgraded wavelength map\n\n"</span>;</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">#define fors_pmos_science_exit(message)            \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">cpl_free(instrume);                           \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">cpl_image_delete(dummy);                      \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">cpl_image_delete(smapped);                    \</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">cpl_table_delete(offsets);                    \</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor">cpl_table_delete(sky);                        \</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor">cpl_image_delete(bias);                       \</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="preprocessor">cpl_table_delete(mask_science);               \</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="preprocessor">cpl_table_delete(mask_arc);                   \</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="preprocessor">cpl_table_delete(mask_flat);                  \</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor">#define fors_pmos_science_exit_memcheck(message)   \</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="preprocessor">cpl_free(instrume);                           \</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="preprocessor">cpl_image_delete(dummy);                      \</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="preprocessor">cpl_image_delete(smapped);                    \</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="preprocessor">cpl_table_delete(offsets);                    \</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="preprocessor">cpl_table_delete(sky);                        \</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="preprocessor">cpl_image_delete(bias);                       \</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="preprocessor">cpl_table_delete(mask_science);               \</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="preprocessor">cpl_table_delete(mask_arc);                   \</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor">cpl_table_delete(mask_flat);                  \</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="preprocessor">return 0;                                     \</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> {</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                     <span class="stringliteral">"fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                     <span class="stringliteral">"Extraction of scientific spectra"</span>,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                     fors_pmos_science_description,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>                     fors_pmos_science_create,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                     fors_pmos_science_exec,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                     fors_pmos_science_destroy);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> }</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> {</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> </div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.dispersion"</span>,</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                                 0.0);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="comment">     * Rebin</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.rebin"</span>,</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>                                 <span class="stringliteral">"Rebin (pixel)"</span>,</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>                                 1);</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"rebin"</span>);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> <span class="comment">     * Sky lines alignment</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> </div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.skyalign"</span>,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                                 <span class="stringliteral">"Polynomial order for sky lines alignment, "</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                                 <span class="stringliteral">"or -1 to avoid alignment"</span>,</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                                 0);</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.wcolumn"</span>,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>                                 <span class="stringliteral">"Name of sky line catalog table column "</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.startwavelength"</span>,</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                                 0.0);</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> </div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> </div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.endwavelength"</span>,</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>                                 0.0);</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> </div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> <span class="comment">     * Flux conservation</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.flux"</span>,</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>                                 <span class="stringliteral">"Apply flux conservation"</span>,</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>                                 TRUE);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> <span class="comment">     * Apply flat field</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.flatfield"</span>,</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>                                 <span class="stringliteral">"Apply flat field"</span>,</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                                 TRUE);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flatfield"</span>);</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> </div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> <span class="comment">     * Median sky subtraction method</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> </div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.skymedian"</span>,</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>                                 <span class="stringliteral">"Sky subtraction from extracted slit spectra"</span>,</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>                                 FALSE);</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skymedian"</span>);</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> </div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> <span class="comment">     * Local sky subtraction on CCD spectra</span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.skylocal"</span>,</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>                                 <span class="stringliteral">"Sky subtraction from CCD slit spectra"</span>,</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>                                 TRUE);</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skylocal"</span>);</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment">     * Cosmic rays removal</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.cosmics"</span>,</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>                                 <span class="stringliteral">"Eliminate cosmic rays hits (only if local "</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>                                 <span class="stringliteral">"sky subtraction is also requested)"</span>,</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>                                 FALSE);</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span> </div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> <span class="comment">     * Slit margin</span></div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.slit_margin"</span>,</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span></div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                                 <span class="stringliteral">"in object detection and extraction"</span>,</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>                                 3);</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> </div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> <span class="comment">     * Extraction radius</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span> </div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.ext_radius"</span>,</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>                                 <span class="stringliteral">"Maximum extraction radius for detected "</span></div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>                                 <span class="stringliteral">"objects (pixel)"</span>,</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>                                 12);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span> <span class="comment">     * Contamination radius</span></div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> </div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.cont_radius"</span>,</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>                                 <span class="stringliteral">"Minimum distance at which two objects "</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>                                 <span class="stringliteral">"each other (pixel)"</span>,</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>                                 0);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> </div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> <span class="comment">     * Object extraction method</span></div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.ext_mode"</span>,</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>                                 1);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span> </div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> <span class="comment">     * Tolerance in object matching</span></div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> </div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.match_tolerance"</span>,</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>                                 <span class="stringliteral">"Tolerance for matching spectra from the "</span></div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>                                 <span class="stringliteral">"same object at different angles and beams "</span></div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                                 <span class="stringliteral">"(pixel)"</span>,</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>                                 5.0);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"match_tolerance"</span>);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> <span class="comment">     * Normalise output by exposure time</span></div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> </div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.time_normalise"</span>,</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>                                 <span class="stringliteral">"Normalise output spectra by the exposure time"</span>,</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>                                 TRUE);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"time_normalise"</span>);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> </div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> <span class="comment">     * Apply chromatism correction to polarization angle</span></div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span> </div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.chromatism"</span>,</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>                                 <span class="stringliteral">"Chromatism correction to polarization angles"</span>,</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>                                 TRUE);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"chromatism"</span>);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> </div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> <span class="comment">     * Rotation correction for linear polarisation</span></div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> </div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.wollaston"</span>,</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>                      <span class="stringliteral">"Wollaston mounting (FORS2 only): true = 0 degrees "</span></div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                      <span class="stringliteral">"(ord. beam on top, extr. beam on bottom), "</span></div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>                      <span class="stringliteral">"false = 180 degrees (beams are reversed), for FORS1 "</span></div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>                      <span class="stringliteral">"is frozen to true"</span>,</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>                                 TRUE);</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wollaston"</span>);</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span> </div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> <span class="comment">     * Create check products</span></div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.check"</span>,</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>                                 <span class="stringliteral">"Create intermediate products"</span>,</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>                                 FALSE);</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"check"</span>);</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> <span class="comment">     * Computation of QC1 parameters</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_pmos_science.qc"</span>,</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>                                 <span class="stringliteral">"Compute QC1 parameters"</span>,</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>                                 <span class="stringliteral">"fors.fors_pmos_science"</span>,</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>                                 TRUE);</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"qc"</span>);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span> </div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> }</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span> </div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span> </div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> {</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span> </div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="keywordflow">return</span> fors_pmos_science(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span> }</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> </div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> </div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> {</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     </div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span> </div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> </div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span> }</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> </div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> </div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_pmos_science(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> {</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span> </div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_pmos_science"</span>;</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span> </div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> </div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     <span class="keywordtype">int</span>         group;</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     <span class="keywordtype">int</span>         skyalign;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     <span class="keywordtype">int</span>         flux;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     <span class="keywordtype">int</span>         flatfield;</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     <span class="keywordtype">int</span>         skylocal;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     <span class="keywordtype">int</span>         skymedian;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     <span class="keywordtype">int</span>         chromatism;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     <span class="keywordtype">double</span>      wollaston;</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="keywordtype">int</span>         cosmics;</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>     <span class="keywordtype">int</span>         slit_margin;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     <span class="keywordtype">int</span>         ext_radius;</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     <span class="keywordtype">int</span>         cont_radius;</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     <span class="keywordtype">int</span>         ext_mode;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     <span class="keywordtype">double</span>      tolerance;</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     <span class="keywordtype">int</span>         time_normalise;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     <span class="keywordtype">int</span>         check;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     <span class="keywordtype">int</span>         qc;</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span> </div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     cpl_image       **images;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> </div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     cpl_image       **reduceds       = NULL;</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     cpl_image       **rerrors        = NULL;</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     cpl_table       **slitss         = NULL;</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     cpl_image       **mappeds        = NULL;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     cpl_image       **skylocalmaps   = NULL;</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     </div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     <span class="keywordtype">int</span> nobjects = 0;</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span> </div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>     cpl_image        *bias           = NULL;</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     cpl_image        *norm_flat      = NULL;</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     cpl_image        *spectra        = NULL;</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     cpl_image        *rectified      = NULL;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     cpl_image        *coordinate     = NULL;</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     cpl_image        *rainbow        = NULL;</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     cpl_image        *mapped         = NULL;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>     cpl_image        *mapped_sky     = NULL;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     cpl_image        *mapped_cleaned = NULL;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     cpl_image        *smapped        = NULL;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     cpl_image        *wavemap        = NULL;</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>     cpl_image        *skymap         = NULL;</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     cpl_image        *skylocalmap    = NULL;</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>     cpl_image        *dummy          = NULL;</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span> </div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     cpl_table        *grism_table    = NULL;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>     cpl_table        *overscans      = NULL;</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     cpl_table        *wavelengths    = NULL;</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>     cpl_table        *idscoeff       = NULL;</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>     cpl_table        *slits          = NULL;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     cpl_table        *origslits      = NULL;</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     cpl_table        *maskslits      = NULL;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     cpl_table        *mask_science   = NULL;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     cpl_table        *mask_arc       = NULL;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     cpl_table        *mask_flat      = NULL;</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>     cpl_table        *polytraces     = NULL;</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     cpl_table        *offsets        = NULL;</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     cpl_table        *sky            = NULL;</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span> </div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     cpl_vector       *lines          = NULL;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> </div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     cpl_propertylist *header         = NULL;</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>     cpl_propertylist *save_header    = NULL;</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span> </div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span> </div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     <span class="keywordtype">char</span>    version[80];</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     <span class="keywordtype">char</span>   *instrume = NULL;</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *science_tag;</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *master_norm_flat_tag;</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_coeff_tag;</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *disp_coeff_sky_tag;</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *wavelength_map_sky_tag;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *curv_coeff_tag;</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *slit_location_tag;</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_science_tag;</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_sky_tag;</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_tag;</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_science_tag;</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *unmapped_science_tag;</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_science_sky_tag;</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *mapped_sky_tag;</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *unmapped_sky_tag;</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *object_table_tag;</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *object_table_pol_tag;</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *skylines_offsets_tag;</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_q_tag;</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_u_tag;</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_v_tag;</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_l_tag;</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_i_tag;</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_q_tag;</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_u_tag;</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_v_tag;</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_l_tag;</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_i_tag;</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_q_tag;</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_u_tag;</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_nul_v_tag;</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_angle_tag;</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *reduced_error_angle_tag;</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *chrom_table_tag = <span class="stringliteral">"RETARDER_WAVEPLATE_CHROMATISM"</span>;</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *std_pmos_table_tag = <span class="stringliteral">"STD_PMOS_TABLE"</span>;</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     <span class="keywordtype">float</span>  *angles = NULL;</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     <span class="keywordtype">int</span>     pmos, circ;</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     <span class="keywordtype">int</span>     nscience;</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     <span class="keywordtype">double</span>  alltime;</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     <span class="keywordtype">double</span>  mean_rms;</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     <span class="keywordtype">int</span>     nlines;</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     <span class="keywordtype">int</span>     rebin;</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <span class="keywordtype">double</span> *line;</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     <span class="keywordtype">int</span>     nx = 0, ny;</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     <span class="keywordtype">int</span>     ccd_xsize, ccd_ysize;</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     <span class="keywordtype">double</span>  reference;</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     <span class="keywordtype">double</span>  gain;</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     <span class="keywordtype">double</span>  ron;</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     <span class="keywordtype">double</span>  ra, dec;</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     <span class="keywordtype">char</span>    filter;</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     <span class="keywordtype">double</span>  qc_angle;</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>     <span class="keywordtype">double</span>  qc_angle_err;</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     <span class="keywordtype">double</span>  qc_pl;</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     <span class="keywordtype">double</span>  qc_pl_err;</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     <span class="keywordtype">int</span>     standard;</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     <span class="keywordtype">int</span>     polarised;</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>     <span class="keywordtype">int</span>     highres;</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     <span class="keywordtype">int</span>     i, j;</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span> </div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     <span class="keywordtype">int</span>    *nobjs_per_slit;</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     <span class="keywordtype">int</span>     nslits;</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span> </div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     <span class="keywordtype">int</span>     bagoo = 0;</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     <span class="keywordtype">double</span>  blevel = 0.0;</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>     <span class="keywordtype">int</span>     doit = 0;           <span class="comment">// montecarlo simulation</span></div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     <span class="keywordtype">int</span>     conta = 0;          <span class="comment">// Bagoo, conta gli oggetti con S/N > s2n</span></div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     <span class="keywordtype">int</span>     bright = 0;         <span class="comment">// Bagoo, marca un oggetto con S/N > s2n</span></div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>     <span class="keywordtype">int</span>     nslits_out_det = 0;</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span> </div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span> </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>     cpl_error_code error;</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span> </div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span> </div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>     <span class="keywordflow">if</span> (bagoo) {</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>         <span class="keywordtype">char</span> *montecarlo = getenv(<span class="stringliteral">"MONTECARLO"</span>);</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span> </div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>         <span class="keywordflow">if</span> (montecarlo) {</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>             doit = atoi(montecarlo);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>         }</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     }</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span> </div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     <a class="code" href="group__forsdfs.html#ga5162766f25e67bb99869e7959c3f8201" title="Set the group as RAW or CALIB in a frameset.">fors_dfs_set_groups</a>(frameset);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span> </div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> </div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> </div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> </div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>         fors_pmos_science_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span> </div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> </div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>                     <span class="stringliteral">"fors.fors_pmos_science.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> </div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>         fors_pmos_science_exit(<span class="stringliteral">"Invalid spectral dispersion"</span>);</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> </div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     group = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>                     <span class="stringliteral">"fors.fors_pmos_science.rebin"</span>, NULL);</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span> </div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     <span class="keywordflow">if</span> (group < 1)</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>         fors_pmos_science_exit(<span class="stringliteral">"Invalid rebin factor"</span>);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> </div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     skyalign = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>                     <span class="stringliteral">"fors.fors_pmos_science.skyalign"</span>, NULL);</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span> </div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     <span class="keywordflow">if</span> (skyalign > 2)</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         fors_pmos_science_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span> </div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>                     <span class="stringliteral">"fors.fors_pmos_science.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span> </div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>                     <span class="stringliteral">"fors.fors_pmos_science.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>         fors_pmos_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span> </div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>                     <span class="stringliteral">"fors.fors_pmos_science.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>     <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>         fors_pmos_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span> </div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>     <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>         fors_pmos_science_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span> </div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>     flux = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_science.flux"</span>, NULL);</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span> </div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>     flatfield = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>                                        <span class="stringliteral">"fors.fors_pmos_science.flatfield"</span>, </div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>                                        NULL);</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span> </div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>     skylocal  = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>                                        <span class="stringliteral">"fors.fors_pmos_science.skylocal"</span>, </div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>                                        NULL);</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>     skymedian = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>                                        <span class="stringliteral">"fors.fors_pmos_science.skymedian"</span>, </div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>                                        NULL);</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>     </div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>     chromatism = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>                                         <span class="stringliteral">"fors.fors_pmos_science.chromatism"</span>, </div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>                                         NULL);</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span> </div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     wollaston = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist,</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>                                        <span class="stringliteral">"fors.fors_pmos_science.wollaston"</span>,</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>                                        NULL);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span> </div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>     wollaston = wollaston ? 0 : 1;</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span> </div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>     <span class="keywordflow">if</span> (skylocal && skymedian)</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>         fors_pmos_science_exit(<span class="stringliteral">"Cannot apply sky subtraction both on "</span></div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>                                <span class="stringliteral">"extracted and non-extracted spectra"</span>);</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> </div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>     cosmics = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>                                      <span class="stringliteral">"fors.fors_pmos_science.cosmics"</span>, NULL);</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span> </div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>     <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>         <span class="keywordflow">if</span> (!skylocal)</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>             fors_pmos_science_exit(<span class="stringliteral">"Cosmic rays correction requires "</span></div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>                                    <span class="stringliteral">"skylocal=true"</span>);</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span> </div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>     slit_margin = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>                                         <span class="stringliteral">"fors.fors_pmos_science.slit_margin"</span>,</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>                                         NULL);</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>     <span class="keywordflow">if</span> (slit_margin < 0)</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>         fors_pmos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span> </div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     ext_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>                                        <span class="stringliteral">"fors.fors_pmos_science.ext_radius"</span>,</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>                                        NULL);</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>     <span class="keywordflow">if</span> (ext_radius < 0)</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>         fors_pmos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span> </div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>     cont_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>                                         <span class="stringliteral">"fors.fors_pmos_science.cont_radius"</span>,</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>                                         NULL);</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>     <span class="keywordflow">if</span> (cont_radius < 0)</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>         fors_pmos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span> </div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>     ext_mode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_pmos_science.ext_mode"</span>,</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>                                        NULL);</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>         fors_pmos_science_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span> </div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>     tolerance = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>                     <span class="stringliteral">"fors.fors_pmos_science.match_tolerance"</span>, NULL);</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>     <span class="keywordflow">if</span> (tolerance <= 0.0)</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>         fors_pmos_science_exit(<span class="stringliteral">"Invalid object match tolerance"</span>);</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span> </div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>     time_normalise = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>                              <span class="stringliteral">"fors.fors_pmos_science.time_normalise"</span>, NULL);</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span> </div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>     check = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>                              <span class="stringliteral">"fors.fors_pmos_science.check"</span>, NULL);</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span> </div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>     qc = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_pmos_science.qc"</span>, NULL);</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span> </div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span> </div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>         fors_pmos_science_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span> </div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>     </div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span> <span class="comment">     * Check input set-of-frames</span></div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span> </div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span> </div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>     {</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>         cpl_frameset *subframeset = cpl_frameset_duplicate(frameset);</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>         cpl_frameset_erase(subframeset, <span class="stringliteral">"MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span> </div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>             fors_pmos_science_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span> </div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>             fors_pmos_science_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span> </div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(subframeset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>             fors_pmos_science_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span> </div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>         cpl_frameset_delete(subframeset);</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>     }</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span> </div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>     standard = 0;</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>     pmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_PMOS"</span>);</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span> </div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>     <span class="keywordflow">if</span> (pmos == 0) {</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>         pmos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_PMOS"</span>);</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>         standard = 1;</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>     }</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span> </div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>     <span class="keywordflow">if</span> (pmos == 0)</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>         fors_pmos_science_exit(<span class="stringliteral">"Missing input scientific frame"</span>);</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span> </div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>     angles = fors_check_angles(frameset, pmos, </div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>                                 standard ? <span class="stringliteral">"STANDARD_PMOS"</span> : <span class="stringliteral">"SCIENCE_PMOS"</span>, </div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>                                 &circ);</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>     <span class="keywordflow">if</span> (angles == NULL)</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>         fors_pmos_science_exit(<span class="stringliteral">"Polarization angles could not be read"</span>);</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span> </div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>     <span class="keywordflow">if</span> (circ)</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>         chromatism = 0; <span class="comment">/* Chromatism correction unrequired for </span></div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span> <span class="comment">                           circular polarimetry */</span></div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span> </div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span> </div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>     nscience = pmos;</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span> </div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>     reduceds = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>     rerrors  = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>     slitss   = (cpl_table **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_table *) * nscience);</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>     mappeds  = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);</div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>     skylocalmaps = (cpl_image **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_image *) * nscience);</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span> </div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>     <span class="keywordflow">if</span> (pmos) {</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>         cpl_msg_info(recipe, <span class="stringliteral">"PMOS data found"</span>);</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>             science_tag             = <span class="stringliteral">"STANDARD_PMOS"</span>;</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>             reduced_science_tag     = <span class="stringliteral">"REDUCED_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>             object_table_pol_tag    = <span class="stringliteral">"OBJECT_TABLE_POL_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>             reduced_q_tag           = <span class="stringliteral">"REDUCED_Q_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>             reduced_u_tag           = <span class="stringliteral">"REDUCED_U_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>             reduced_v_tag           = <span class="stringliteral">"REDUCED_V_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>             reduced_l_tag           = <span class="stringliteral">"REDUCED_L_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>             reduced_i_tag           = <span class="stringliteral">"REDUCED_I_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>             reduced_error_q_tag     = <span class="stringliteral">"REDUCED_ERROR_Q_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>             reduced_error_u_tag     = <span class="stringliteral">"REDUCED_ERROR_U_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>             reduced_error_v_tag     = <span class="stringliteral">"REDUCED_ERROR_V_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>             reduced_error_l_tag     = <span class="stringliteral">"REDUCED_ERROR_L_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>             reduced_error_i_tag     = <span class="stringliteral">"REDUCED_ERROR_I_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>             reduced_nul_q_tag       = <span class="stringliteral">"REDUCED_NUL_Q_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>             reduced_nul_u_tag       = <span class="stringliteral">"REDUCED_NUL_U_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>             reduced_nul_v_tag       = <span class="stringliteral">"REDUCED_NUL_V_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>             reduced_angle_tag       = <span class="stringliteral">"REDUCED_ANGLE_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>             reduced_error_angle_tag = <span class="stringliteral">"REDUCED_ERROR_ANGLE_STD_PMOS"</span>;</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>         }</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>             science_tag             = <span class="stringliteral">"SCIENCE_PMOS"</span>;</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>             reduced_science_tag     = <span class="stringliteral">"REDUCED_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>             object_table_pol_tag    = <span class="stringliteral">"OBJECT_TABLE_POL_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>             reduced_q_tag           = <span class="stringliteral">"REDUCED_Q_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>             reduced_u_tag           = <span class="stringliteral">"REDUCED_U_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>             reduced_v_tag           = <span class="stringliteral">"REDUCED_V_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>             reduced_l_tag           = <span class="stringliteral">"REDUCED_L_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>             reduced_i_tag           = <span class="stringliteral">"REDUCED_I_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>             reduced_error_q_tag     = <span class="stringliteral">"REDUCED_ERROR_Q_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>             reduced_error_u_tag     = <span class="stringliteral">"REDUCED_ERROR_U_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>             reduced_error_v_tag     = <span class="stringliteral">"REDUCED_ERROR_V_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>             reduced_error_l_tag     = <span class="stringliteral">"REDUCED_ERROR_L_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>             reduced_error_i_tag     = <span class="stringliteral">"REDUCED_ERROR_I_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>             reduced_nul_q_tag       = <span class="stringliteral">"REDUCED_NUL_Q_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>             reduced_nul_u_tag       = <span class="stringliteral">"REDUCED_NUL_U_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>             reduced_nul_v_tag       = <span class="stringliteral">"REDUCED_NUL_V_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>             reduced_angle_tag       = <span class="stringliteral">"REDUCED_ANGLE_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>             reduced_error_angle_tag = <span class="stringliteral">"REDUCED_ERROR_ANGLE_SCI_PMOS"</span>;</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>         }</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span> </div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_PMOS"</span>;</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_PMOS"</span>;</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>         curv_coeff_tag          = <span class="stringliteral">"CURV_COEFF_PMOS"</span>;</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_PMOS"</span>;</div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span> </div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>             master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_PMOS"</span>;</div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>             disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_LONG_PMOS"</span>;</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>             slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_LONG_PMOS"</span>;</div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>         }</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>     }</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span> </div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0)</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>         fors_pmos_science_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span> </div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>         fors_pmos_science_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span> </div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>     <span class="keywordflow">if</span> (skyalign >= 0)</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>             fors_pmos_science_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span> </div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) == 0) {</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, disp_coeff_tag);</div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>     }</div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span> </div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) > 1) {</div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, disp_coeff_tag);</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>     }</div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span> </div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) == 0) {</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>,</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>                       slit_location_tag);</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>     }</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span> </div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) > 1) {</div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, slit_location_tag);</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>     }</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span> </div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>     <span class="keywordflow">if</span> (chromatism) {</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, chrom_table_tag) == 0) {</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>,</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>                           chrom_table_tag);</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>         }</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span> </div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, chrom_table_tag) > 1) {</div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, chrom_table_tag);</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>         }</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>     }</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span> </div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) > 1) {</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, </div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>                           master_norm_flat_tag);</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>         }</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input are ignored, "</span></div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>                             <span class="stringliteral">"since flat field correction was not requested"</span>, </div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>                             master_norm_flat_tag);</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>         }</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>     }</div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span> </div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 1) {</div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>         <span class="keywordflow">if</span> (!flatfield) {</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input is ignored, "</span></div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>                             <span class="stringliteral">"since flat field correction was not requested"</span>, </div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>                             master_norm_flat_tag);</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>         }</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>     }</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span> </div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 0) {</div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>             cpl_msg_error(recipe, <span class="stringliteral">"Flat field correction was requested, "</span></div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>                           <span class="stringliteral">"but no %s are found in input"</span>,</div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>                           master_norm_flat_tag);</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>         }</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>     }</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span> </div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>     <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, std_pmos_table_tag) > 1) {</div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, std_pmos_table_tag);</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>         }</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span> </div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>         <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>             <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, std_pmos_table_tag) == 0) {</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>                 cpl_msg_error(recipe, <span class="stringliteral">"QC computation was requested, but no "</span></div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>                               <span class="stringliteral">"%s is found in input"</span>, std_pmos_table_tag);</div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>             }</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>         }</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>     }</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span> </div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span> </div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span> </div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span> <span class="comment">     * dispersion direction from a scientific exposure</span></div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span> </div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span> </div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>         fors_pmos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span> </div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>         fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INSTRUME in scientific header"</span>);</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>     instrume = cpl_strdup(instrume);</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span> </div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span> </div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span> </div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>         fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in scientific "</span></div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span> </div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>         reference *= 10;</div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span> </div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in scientific frame header"</span>,</div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>                       reference);</div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>     }</div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span> </div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span> </div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span> </div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>         fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in "</span></div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>                                <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span> </div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>                         <span class="stringliteral">"spectral dispersion used is %f A/pixel"</span>, rebin, </div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>                         dispersion);</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>         ext_radius /= rebin;</div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>                         <span class="stringliteral">"extraction radius used is %d pixel"</span>, rebin, </div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>                         ext_radius);</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>     }</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span> </div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span> </div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>         fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in "</span></div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>                           <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span> </div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span> </div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span> </div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>         fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in "</span></div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>                                <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span> </div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span></div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span> </div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span> </div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) == 0) {</div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, curv_coeff_tag);</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>     }</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span> </div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) > 1) {</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, curv_coeff_tag);</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>     }</div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span> </div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load normalised flat field (if present)..."</span>);</div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span> </div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>     <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>         norm_flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, master_norm_flat_tag, </div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>                                    CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>     }</div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span> </div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span> </div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load input sky line catalog..."</span>);</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span> </div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>         wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span> </div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>         <span class="keywordflow">if</span> (wavelengths) {</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span> <span class="comment">             * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span> </div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>             nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span> </div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>             <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>                 fors_pmos_science_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);</div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span> </div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>             <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>                 cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span></div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>                               <span class="stringliteral">"catalog table"</span>, wcolumn);</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>             }</div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span> </div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>             line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>     </div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>             <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>                 line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span> </div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>             cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span> </div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>             lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>         }</div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>             cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);</div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>         }</div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>     }</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span> </div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span> <span class="comment">     * Keep a table of slit positions according to science, in order to </span></div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span> <span class="comment">     * check its consistency with those from arc and flat.</span></div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span> </div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>     mask_science = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span> </div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span> </div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>     cpl_table_name_column(mask_science, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"science"</span>);</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span> </div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span> <span class="comment">     * Load the wavelength calibration table</span></div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span> </div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>     idscoeff = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, disp_coeff_tag, 1);</div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span> </div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>     <span class="keywordflow">if</span> (idscoeff == NULL)</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>         fors_pmos_science_exit(<span class="stringliteral">"Cannot load wavelength calibration table"</span>);</div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span> </div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span> <span class="comment">     * Keep a table of slit positions according to arc, in order to </span></div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span> <span class="comment">     * check its consistency with those from science and flat.</span></div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span> </div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, disp_coeff_tag, 0);</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span> </div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>     mask_arc = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span> </div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span> </div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>     <span class="keywordflow">if</span> (cpl_table_move_column(mask_science, <span class="stringliteral">"xtop"</span>, mask_arc)) {</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>         cpl_error_reset();</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>         cpl_msg_warning(recipe, </div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>                         <span class="stringliteral">"Slit configuration of science and arc differs!"</span>);</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>         cpl_table_delete(mask_arc); mask_arc = NULL;</div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>         <span class="keywordflow">goto</span> skip;</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>     }</div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>     cpl_table_name_column(mask_science, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"arc"</span>);</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>     cpl_table_delete(mask_arc); mask_arc = NULL;</div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span> </div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>     <span class="keywordflow">if</span> (norm_flat) {</div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span> </div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span> <span class="comment">         * Keep a table of slit positions according to arc, in order to </span></div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span> <span class="comment">         * check its consistency with those from science and flat.</span></div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span> </div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, master_norm_flat_tag, 0);</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span> </div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>         mask_flat = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span> </div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span> </div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>         <span class="keywordflow">if</span> (cpl_table_move_column(mask_science, <span class="stringliteral">"xtop"</span>, mask_flat)) {</div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>             cpl_error_reset();</div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>             cpl_msg_warning(recipe, </div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>                             <span class="stringliteral">"Slit configuration of science and flat differs!"</span>);</div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>             cpl_table_delete(mask_flat); mask_flat = NULL;</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>             <span class="keywordflow">goto</span> skip;</div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>         }</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>         cpl_table_name_column(mask_science, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"flat"</span>);</div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>         cpl_table_delete(mask_flat); mask_flat = NULL;</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>     }</div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span> </div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>     cpl_table_duplicate_column(mask_science, <span class="stringliteral">"diff"</span>, mask_science, <span class="stringliteral">"science"</span>);</div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>     cpl_table_subtract_columns(mask_science, <span class="stringliteral">"diff"</span>, <span class="stringliteral">"arc"</span>);</div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>     cpl_table_abs_column(mask_science, <span class="stringliteral">"diff"</span>);</div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span> </div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>     <span class="keywordflow">if</span> (cpl_table_get_column_max(mask_science, <span class="stringliteral">"diff"</span>) > 0.01)  {</div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>         cpl_msg_warning(recipe, </div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>                         <span class="stringliteral">"Slit configuration of science and arc differs!"</span>);</div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>         <span class="keywordflow">goto</span> skip;</div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>     }</div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span> </div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>     <span class="keywordflow">if</span> (norm_flat) {</div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>         cpl_table_erase_column(mask_science, <span class="stringliteral">"diff"</span>);</div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span> </div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>         cpl_table_duplicate_column(mask_science, <span class="stringliteral">"diff"</span>, </div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>                                    mask_science, <span class="stringliteral">"science"</span>);</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>         cpl_table_subtract_columns(mask_science, <span class="stringliteral">"diff"</span>, <span class="stringliteral">"flat"</span>);</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>         cpl_table_abs_column(mask_science, <span class="stringliteral">"diff"</span>);</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span> </div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>         <span class="keywordflow">if</span> (cpl_table_get_column_max(mask_science, <span class="stringliteral">"diff"</span>) > 0.01)  {</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>             cpl_msg_warning(recipe, </div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>                             <span class="stringliteral">"Slit configuration of science and flat differs!"</span>);</div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>             <span class="keywordflow">goto</span> skip;</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>         }</div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>     }</div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span> </div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span> skip:</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span> </div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>     cpl_table_delete(mask_science); mask_science = NULL;</div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span> </div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {</div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>         <span class="keywordtype">int</span> k;</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span> </div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>         cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific exposure of angle %.2f "</span></div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>                      <span class="stringliteral">"(%d out of %d) ..."</span>,</div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>                      angles[j], j + 1, nscience);</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span> </div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load scientific exposure..."</span>);</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span> </div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span> </div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span> <span class="comment">         * FIXME: Horrible workaround to avoid the problem because of the</span></div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span> <span class="comment">         * multiple encapsulation of cpl_frameset_find() in different </span></div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span> <span class="comment">         * loading functions</span></div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span> </div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span> </div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>             cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>         }</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span> </div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>         spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span> </div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>             cpl_image_delete(spectra);</div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>             spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>         }</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span> </div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>         <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>             fors_pmos_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>             </div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>             fors_pmos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span> </div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>         alltime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span> </div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>             fors_pmos_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>                                    <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span> </div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>                      alltime);</div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span> </div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>         ra = cpl_propertylist_get_double(header, <span class="stringliteral">"RA"</span>);</div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>         dec = cpl_propertylist_get_double(header, <span class="stringliteral">"DEC"</span>);</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span> </div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>             fors_pmos_science_exit(<span class="stringliteral">"Missing keywords RA and DEC in scientific "</span></div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>                                    <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span> </div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>         <span class="comment">/* Leave the header on for the next step... */</span></div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span> </div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span> </div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span> <span class="comment">         * Remove the master bias</span></div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span> </div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>         cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);</div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span> </div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>         bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span> </div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>         <span class="keywordflow">if</span> (bias == NULL)</div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>             fors_pmos_science_exit(<span class="stringliteral">"Cannot load master bias"</span>);</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span> </div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>         <span class="keywordflow">if</span> (doit) {</div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>             <span class="keywordflow">if</span> (j == 0)</div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>                blevel = cpl_image_get_mean(bias); </div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>             <a class="code" href="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2" title="Randomise image.">mos_randomise_image</a>(spectra, ron, gain, blevel);</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>         }</div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span> </div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>         overscans = mos_load_overscans_fors(header);</div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span> </div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>         dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(spectra, bias, overscans);</div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>         cpl_image_delete(spectra); spectra = dummy; dummy = NULL;</div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>         cpl_image_delete(bias); bias = NULL;</div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>         cpl_table_delete(overscans); overscans = NULL;</div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span> </div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>         <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>             fors_pmos_science_exit(<span class="stringliteral">"Cannot remove bias from scientific frame"</span>);</div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span> </div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>         ccd_xsize = nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>         ccd_ysize = ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span> </div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span> </div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>             <span class="keywordflow">if</span> (norm_flat) {</div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>                 cpl_msg_info(recipe, <span class="stringliteral">"Apply flat field correction..."</span>);</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>                 <span class="keywordflow">if</span> (cpl_image_divide(spectra, norm_flat) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>                     cpl_msg_error(recipe, </div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>                                   <span class="stringliteral">"Failure of flat field correction: %s"</span>,</div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>                                   cpl_error_get_message());</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>                 }</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>             }</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>                 cpl_msg_error(recipe, <span class="stringliteral">"Cannot load input %s for flat field "</span></div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>                               <span class="stringliteral">"correction"</span>, master_norm_flat_tag);</div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>             }</div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span> </div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>         }</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span> </div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span> <span class="comment">         * Load the spectral curvature table</span></div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span> </div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>         polytraces = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, curv_coeff_tag, 1);</div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>         <span class="keywordflow">if</span> (polytraces == NULL)</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>             fors_pmos_science_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);</div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span> </div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span> <span class="comment">         * Load the slit location table</span></div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span> </div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>         slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>         <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>             fors_pmos_science_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span> </div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>         cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific spectra..."</span>);</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span> </div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span> <span class="comment">         * This one will also generate the spatial map from the spectral </span></div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span> <span class="comment">         * curvature table (in the case of multislit data)</span></div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span> </div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>         coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span> </div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>         smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, </div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>                                           reference, startwavelength, </div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>                                           endwavelength, dispersion, </div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>                                           flux, coordinate);</div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span> </div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span> <span class="comment">         * Generate a rectified wavelength map from the wavelength calibration </span></div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span> <span class="comment">         * table</span></div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span> </div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>         rainbow = <a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength, </div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>                                    endwavelength);</div>
+<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span> </div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>         <span class="keywordflow">if</span> (dispersion > 1.0)</div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>             highres = 0;</div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>             highres = 1;</div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span> </div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>         <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>             <span class="keywordflow">if</span> (skyalign) {</div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>                 cpl_msg_info(recipe, </div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>                              <span class="stringliteral">"Align wavelength solution to reference skylines "</span></div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>                              <span class="stringliteral">"applying %d order residual fit..."</span>, skyalign);</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>             }</div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>                 cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>                              <span class="stringliteral">"skylines applying median offset..."</span>);</div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>             }</div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span> </div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>             <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>                 offsets = <a class="code" href="group__moses.html#ga634eb7408671a139e7015185776f4513" title="Modify the input wavelength solution to match reference sky lines.">mos_wavelength_align</a>(smapped, slits, reference, </div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>                                                startwavelength, endwavelength, </div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>                                                idscoeff, lines, highres, </div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>                                                skyalign, rainbow, 4);</div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>                 <span class="keywordflow">if</span> (offsets) {</div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>                     <span class="keywordflow">if</span> (standard)</div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>                         cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength "</span></div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>                                         <span class="stringliteral">"solution to reference sky lines may "</span></div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>                                         <span class="stringliteral">"be unreliable in this case!"</span>);</div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span> </div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, offsets, skylines_offsets_tag,</div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>                                        NULL, parlist, recipe, version)) {</div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>                         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>                     }</div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span> </div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>                 } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>                     cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength "</span></div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>                                     <span class="stringliteral">"solution to reference sky lines could "</span></div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>                                     <span class="stringliteral">"not be done!"</span>);</div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>                     skyalign = -1;</div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>                 }</div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>             }</div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span> </div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span> </div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>         }</div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span> </div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>         wavemap = <a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(coordinate, rainbow, slits, </div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>                                       polytraces, reference, </div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>                                       startwavelength, endwavelength,</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>                                       dispersion);</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span> </div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span> </div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>         cpl_image_delete(rainbow); rainbow = NULL;</div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>         cpl_image_delete(coordinate); coordinate = NULL;</div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span> </div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span> <span class="comment">         * Here the wavelength calibrated slit spectra are created. This frame</span></div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span> <span class="comment">         * contains sky_science.</span></div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span> </div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>         mapped_sky = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, reference,</div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>                                                 startwavelength, endwavelength,</div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>                                                 dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span> </div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>             cpl_msg_info(recipe, </div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>                          <span class="stringliteral">"Check applied wavelength against skylines..."</span>);</div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span> </div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>             mean_rms = <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(mapped_sky, lines, startwavelength,</div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>                                            dispersion, 6, highres);</div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span> </div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span> </div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>             cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f"</span>, mean_rms);</div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span> </div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>             mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span> </div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>             cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,</div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>                          mean_rms, mean_rms * dispersion);</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>         }</div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span> </div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>         save_header = cpl_propertylist_duplicate(header);</div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span> </div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>                                        startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span> </div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>         <span class="keywordflow">if</span> (time_normalise) {</div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>             dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);</div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span> </div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>             <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>                                        mapped_science_sky_tag,</div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>                                        recipe, version)) {</div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>                 }</div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>             }</div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span> </div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(dummy, mapped_science_sky_tag, header)) {</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>             }</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span> </div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>             cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>         }</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span> </div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>             <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>                                        mapped_science_sky_tag,</div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>                                        recipe, version)) {</div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>                 }</div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>             }</div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span> </div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(mapped_sky,</div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>                                    mapped_science_sky_tag, header)) {</div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>             }</div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span> </div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>         }</div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span> </div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>         <span class="keywordflow">if</span> (skymedian == 0 && skylocal == 0) {</div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>             cpl_image_delete(mapped_sky); mapped_sky = NULL;</div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>         }</div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span> </div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>         <span class="keywordflow">if</span> (skylocal) {</div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span> </div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span> </div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>             skymap = <a class="code" href="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2" title="Subtract the sky from the scientific CCD exposure.">mos_subtract_sky</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>                                   startwavelength, endwavelength, dispersion);</div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span> </div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>             <span class="keywordflow">if</span> (skymap) {</div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>                 <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>                     cpl_image_divide_scalar(skymap, alltime);</div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span> </div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>                 <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>                                            unmapped_sky_tag,</div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>                                            recipe, version)) {</div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>                         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>                     }</div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>                 }</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span> </div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(skymap, unmapped_sky_tag,</div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>                                        save_header)) {</div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>                 }</div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span> </div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>                 cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span> </div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>                 <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>                                            unmapped_science_tag,</div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>                                            recipe, version)) {</div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>                         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>                     }</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>                 }</div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span> </div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(spectra, unmapped_science_tag,</div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>                                        save_header)) {</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>                 }</div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span> </div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>                 <span class="keywordflow">if</span> (cosmics) {</div>
+<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>                     cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);</div>
+<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>                     <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(spectra, gain, -1., -1.);</div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>                 }</div>
+<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span> </div>
+<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span> <span class="comment">                 * The spatially rectified image, that contained the sky,</span></div>
+<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span> <span class="comment">                 * is replaced by a sky-subtracted spatially rectified image:</span></div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span> </div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>                 cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span> </div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>                 smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, </div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>                                                   reference, startwavelength, </div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>                                                   endwavelength, dispersion, </div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>                                                   flux, NULL);</div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>             }</div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>                 cpl_msg_warning(recipe, <span class="stringliteral">"Sky subtraction failure"</span>);</div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>                 <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>                     cpl_msg_warning(recipe, </div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>                                     <span class="stringliteral">"Cosmic rays removal not performed!"</span>);</div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>                 cosmics = skylocal = 0;</div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>             }</div>
+<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span>         }</div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span> </div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>         cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>         cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span> </div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>         <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>             save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span> </div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>             <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>                                        wavelength_map_sky_tag,</div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>                                        recipe, version)) {</div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>                 }</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>             }</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span> </div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(wavemap, wavelength_map_sky_tag,</div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>                                    save_header)) {</div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>             }</div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>         }</div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span> </div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>         cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span> </div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>         mapped = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, reference,</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>                                             startwavelength, endwavelength,</div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>                                             dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span> </div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>         cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span> </div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>         <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>             <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, idscoeff, disp_coeff_sky_tag,</div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>                                    NULL, parlist, recipe, version)) {</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>                 }</div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>             }</div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>         }</div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span> </div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>         <span class="keywordflow">if</span> (skymedian) {</div>
+<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>        </div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>             skylocalmap = <a class="code" href="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8" title="Local determination of sky.">mos_sky_local_old</a>(mapped, slits);       </div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>             cpl_image_subtract(mapped, skylocalmap);</div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>             cpl_image_delete(skylocalmap); skylocalmap = NULL;</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>         }</div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span> </div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>         <span class="keywordflow">if</span> (skymedian || skylocal) {</div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span> </div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>             skylocalmap = cpl_image_subtract_create(mapped_sky, mapped);</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span> </div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>             cpl_image_delete(mapped_sky); mapped_sky = NULL;</div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span> </div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>             <span class="keywordflow">if</span> (time_normalise) {</div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>                 dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);</div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span> </div>
+<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>                 <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>                                            mapped_sky_tag,</div>
+<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>                                            recipe, version)) {</div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>                         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>                     }</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>                 }</div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span> </div>
+<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(dummy, mapped_sky_tag,</div>
+<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>                                        header)) {</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>                 }</div>
+<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span> </div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>                 cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>             }</div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>                 <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>                                            mapped_sky_tag,</div>
+<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>                                            recipe, version)) {</div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>                         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>                     }</div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>                 }</div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span> </div>
+<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(skylocalmap, mapped_sky_tag,</div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>                                        header)) {</div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>                 }</div>
+<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>             }</div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span> </div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>             skylocalmaps[j] = skylocalmap;</div>
+<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span> </div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>             cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);</div>
+<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span> </div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>             <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>                 origslits = cpl_table_duplicate(slits);</div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>                 nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>             }</div>
+<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span> </div>
+<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>             <span class="keywordflow">if</span> (cosmics || nscience > 1) {</div>
+<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>                 dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped, slits, slit_margin, </div>
+<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>                                            ext_radius, cont_radius);</div>
+<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>             }</div>
+<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span>                 mapped_cleaned = cpl_image_duplicate(mapped);</div>
+<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>                 <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);</div>
+<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span>                 dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin, </div>
+<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>                                            ext_radius, cont_radius);</div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span> </div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>                 cpl_image_delete(mapped_cleaned); mapped_cleaned = NULL;</div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>             }</div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span> </div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>             cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span> </div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>         }</div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span> </div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>         slitss[j]  = slits;</div>
+<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>         mappeds[j] = mapped;</div>
+<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span> </div>
+<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span> </div>
+<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>         cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>     }</div>
+<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span> </div>
+<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>     cpl_table_delete(offsets); offsets = NULL;</div>
+<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span> </div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>     cpl_image_delete(norm_flat); norm_flat = NULL;</div>
+<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>     cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span> </div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>         </div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>     cpl_msg_info(recipe, </div>
+<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>                  <span class="stringliteral">"Check object detection in both beams for all angles..."</span>);</div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span> </div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span> <span class="comment">     * House keeping - selection of objects for which information required </span></div>
+<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span> <span class="comment">     * for Stokes parameters computation is present </span></div>
+<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span> </div>
+<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>     error = <a class="code" href="group__moses.html#ga5f9947ec541f1291f7c9fb20bd081280" title="Intersect a number of slit tables.">mos_object_intersect</a>(slitss, origslits, nscience, tolerance);</div>
+<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>     <span class="keywordflow">if</span> (error == CPL_ERROR_DATA_NOT_FOUND) {</div>
+<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span>         cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: no Stokes "</span></div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>                        <span class="stringliteral">"parameters to compute!"</span>);</div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>         <span class="keywordflow">for</span> (j = 0; j < nscience; j++)</div>
+<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>             cpl_table_delete(slitss[j]);</div>
+<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>         cpl_free(slitss);</div>
+<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>         cpl_table_delete(origslits);</div>
+<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (error) {</div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>         fors_pmos_science_exit(<span class="stringliteral">"Problem in polarimetric object selection"</span>);</div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>     }</div>
+<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span> </div>
+<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, origslits, object_table_pol_tag,</div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>                        NULL, parlist, recipe, version)) {</div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>     }</div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span> </div>
+<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span> <span class="comment">     * Save also object tables per angle after intersection</span></div>
+<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span> </div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {</div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>         <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>             <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist, object_table_tag,</div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>                                    recipe, version)) {</div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>             }</div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>         }</div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span> </div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489" title="Save a table in a extension (different from the first one)">dfs_save_table_ext</a>(slitss[j], object_table_tag, NULL)) {</div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>         }</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>     }</div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span> </div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>     nobjs_per_slit = fors_get_nobjs_perslit(origslits);</div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span> </div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>     cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);</div>
+<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span> </div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {</div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>         <span class="keywordtype">int</span> k;</div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span> </div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span> </div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>         <span class="keywordflow">for</span> (k = 0; k < j; k ++) {</div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>             cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>         }</div>
+<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span> </div>
+<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>                                 startwavelength + (dispersion * group)/2);</div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion * group);</div>
+<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span> </div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>         <span class="keywordflow">if</span> (skymedian || skylocal) {</div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span> </div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>             cpl_msg_info(recipe, <span class="stringliteral">"Extracting at angle %.2f (%d out of %d) ..."</span>,</div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>                          angles[j], j + 1, nscience);</div>
+<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span> </div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>             images = <a class="code" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522" title="Extract detected objects from rectified scientific frame.">mos_extract_objects</a>(mappeds[j], skylocalmaps[j],</div>
+<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>                                          origslits, </div>
+<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>                                          ext_mode, ron, gain, 1);</div>
+<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span> </div>
+<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>             cpl_image_delete(skylocalmaps[j]); skylocalmaps[j] = NULL;</div>
+<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span> </div>
+<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>             <span class="keywordflow">if</span> (images) {</div>
+<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>                 <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>                     cpl_image_divide_scalar(images[0], alltime);</div>
+<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span> </div>
+<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>                 mos_rebin_signal(images, group);</div>
+<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span> </div>
+<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>                 <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span>                                            reduced_science_tag,</div>
+<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>                                            recipe, version)) {</div>
+<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>                         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>                     }</div>
+<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>                 }</div>
+<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span> </div>
+<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(images[0], reduced_science_tag,</div>
+<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>                                        header)) {</div>
+<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>                 }</div>
+<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span> </div>
+<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>                 reduceds[j] = images[0];</div>
+<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>     </div>
+<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>                 <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>                     cpl_image_divide_scalar(images[1], alltime);</div>
+<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span> </div>
+<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>                 mos_rebin_signal(images + 1, group);</div>
+<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span> </div>
+<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>                 <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>                                            reduced_sky_tag,</div>
+<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>                                            recipe, version)) {</div>
+<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>                         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>                     }</div>
+<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>                 }</div>
+<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span> </div>
+<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(images[1], reduced_sky_tag,</div>
+<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>                                        header)) {</div>
+<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>                 }</div>
+<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>                 cpl_image_delete(images[1]);</div>
+<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>     </div>
+<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>                 <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>                     cpl_image_divide_scalar(images[2], alltime);</div>
+<div class="line"><a name="l01947"></a><span class="lineno"> 1947</span> </div>
+<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>                 mos_rebin_error(images + 2, group);</div>
+<div class="line"><a name="l01949"></a><span class="lineno"> 1949</span> </div>
+<div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>                 <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>                     <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01952"></a><span class="lineno"> 1952</span>                                            reduced_error_tag,</div>
+<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>                                            recipe, version)) {</div>
+<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>                         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span>                     }</div>
+<div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>                 }</div>
+<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span> </div>
+<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(images[2], reduced_error_tag,</div>
+<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>                                        header)) {</div>
+<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>                 }</div>
+<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span> </div>
+<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>                 rerrors[j] = images[2];</div>
+<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span> </div>
+<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>                 cpl_free(images);</div>
+<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>             }</div>
+<div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>                 cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span></div>
+<div class="line"><a name="l01969"></a><span class="lineno"> 1969</span>                                 <span class="stringliteral">"%s, %s, and %s are not created"</span>, </div>
+<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>                                 reduced_science_tag, reduced_sky_tag, </div>
+<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>                                 reduced_error_tag);</div>
+<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>             }</div>
+<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span> </div>
+<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>         }</div>
+<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span> </div>
+<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>         <span class="keywordflow">if</span> (skymedian || skylocal) {</div>
+<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>             <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>                 cpl_image_divide_scalar(mappeds[j], alltime);</div>
+<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span> </div>
+<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>             <span class="keywordflow">if</span> (!j) {</div>
+<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>                 <span class="keywordflow">if</span>(<a class="code" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b" title="Save a product with an empty primary extension.">dfs_save_image_null</a>(frameset, parlist,</div>
+<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>                                        mapped_science_tag,</div>
+<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>                                        recipe, version)) {</div>
+<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>                     fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>                 }</div>
+<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>             }</div>
+<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span> </div>
+<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee" title="Save an image in a extension.">dfs_save_image_ext</a>(mappeds[j], mapped_science_tag,</div>
+<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>                                    header)) {</div>
+<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>             }</div>
+<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>         }</div>
+<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span> </div>
+<div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>         cpl_image_delete(mappeds[j]); mappeds[j] = NULL;</div>
+<div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01996"></a><span class="lineno"> 1996</span> </div>
+<div class="line"><a name="l01997"></a><span class="lineno"> 1997</span>     }</div>
+<div class="line"><a name="l01998"></a><span class="lineno"> 1998</span> </div>
+<div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>     cpl_table_delete(origslits);</div>
+<div class="line"><a name="l02000"></a><span class="lineno"> 2000</span> </div>
+<div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>     <span class="comment">/* Stokes computation */</span></div>
+<div class="line"><a name="l02002"></a><span class="lineno"> 2002</span> </div>
+<div class="line"><a name="l02003"></a><span class="lineno"> 2003</span>     nobjects = cpl_image_get_size_y(reduceds[0]) / 2;</div>
+<div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>     nx       = cpl_image_get_size_x(reduceds[0]);</div>
+<div class="line"><a name="l02005"></a><span class="lineno"> 2005</span> </div>
+<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>     header = cpl_propertylist_new();</div>
+<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l02009"></a><span class="lineno"> 2009</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>                                    startwavelength + (dispersion * group)/2);</div>
+<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion * group);</div>
+<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>     </div>
+<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>     <span class="keywordflow">if</span> (circ) {</div>
+<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span> </div>
+<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>         cpl_image        *pv_im          = NULL;</div>
+<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>         cpl_image        *pi_im          = NULL;</div>
+<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>         cpl_image        *pvnull_im      = NULL;</div>
+<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>         cpl_image        *pierr_im       = NULL;</div>
+<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>         cpl_image        *perr_im        = NULL;</div>
+<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span> </div>
+<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>         <span class="keywordtype">double</span>           *p_v            = NULL;</div>
+<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>         <span class="keywordtype">double</span>           *p_i            = NULL;</div>
+<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>         <span class="keywordtype">double</span>           *p_vnull        = NULL;</div>
+<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>         <span class="keywordtype">double</span>           *perr           = NULL;</div>
+<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>         <span class="keywordtype">double</span>           *pierr           = NULL;</div>
+<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span> </div>
+<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>         <span class="keywordtype">double</span>            mean_vnull;</div>
+<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span> </div>
+<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span>         <span class="keywordtype">int</span> p = -1;</div>
+<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>         <span class="keywordtype">int</span> total = 0;</div>
+<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span> </div>
+<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>         pv_im     = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>         perr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span>         pi_im     = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>         pierr_im  = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span> </div>
+<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>         p_v     = cpl_image_get_data_double(pv_im);</div>
+<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>         perr    = cpl_image_get_data_double(perr_im);</div>
+<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>         p_i     = cpl_image_get_data_double(pi_im);</div>
+<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span>         pierr   = cpl_image_get_data_double(pierr_im);</div>
+<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span> </div>
+<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>         <span class="keywordflow">if</span> (nscience / 2 > 1) {</div>
+<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>             pvnull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span>             p_vnull = cpl_image_get_data_double(pvnull_im);</div>
+<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>         }</div>
+<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span> </div>
+<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>         <span class="keywordflow">for</span> (j = 0; j < nobjects; j++) {</div>
+<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span> </div>
+<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>             FILE *file;               <span class="comment">// Bagoo</span></div>
+<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span>             <span class="keywordtype">char</span> *filename;           <span class="comment">// Bagoo</span></div>
+<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span> </div>
+<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>             <span class="keywordtype">int</span> k, m;</div>
+<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span> </div>
+<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>             <span class="keywordtype">double</span> * ip_v, * ip_i, * ipierr,</div>
+<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>                    * ip_vnull, * iperr;</div>
+<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span> </div>
+<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>             <span class="keywordtype">float</span> * data;</div>
+<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span>             <span class="keywordtype">float</span> * iff,  * ierr;</div>
+<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span> </div>
+<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>             ip_v = p_v + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span> </div>
+<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>             <span class="keywordflow">if</span> (nscience / 2 > 1)</div>
+<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>                 ip_vnull = p_vnull + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span> </div>
+<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>             iperr = perr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span> </div>
+<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>             ip_i = p_i + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span>             ipierr = pierr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span> </div>
+<div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>             total = 0;</div>
+<div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>             <span class="keywordflow">for</span> (i = 0; i < nslits; i += 2) {</div>
+<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>                 total += nobjs_per_slit[i];</div>
+<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>                 <span class="keywordflow">if</span> (total > j) {</div>
+<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>                     p = i;</div>
+<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>                 }</div>
+<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>             }</div>
+<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span> </div>
+<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>             <span class="keywordflow">for</span> (k = 0; k < nscience / 2; k++) {</div>
+<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>                 <span class="keywordtype">float</span> *if_o,  *if_e,  *ifdelta_o, *ifdelta_e;</div>
+<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>                 <span class="keywordtype">float</span> *if_o_err,  *if_e_err,  *ifdelta_o_err, *ifdelta_e_err;</div>
+<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span> </div>
+<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>                 <span class="keywordtype">int</span> pos   = fors_find_angle_pos(angles, nscience, 180 * k - 45);</div>
+<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>                 <span class="keywordtype">int</span> pos_d = fors_find_angle_pos(angles, nscience, 180 * k + 45);</div>
+<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span> </div>
+<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span> </div>
+<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>                 data = cpl_image_get_data_float(reduceds[pos]);</div>
+<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span> </div>
+<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>                 if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>                      + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span> </div>
+<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>                 if_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>                      + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span> </div>
+<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>                 data = cpl_image_get_data_float(reduceds[pos_d]);</div>
+<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span> </div>
+<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>                 ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>                           + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span> </div>
+<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>                 ifdelta_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>                           + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span> </div>
+<div class="line"><a name="l02109"></a><span class="lineno"> 2109</span>                 data = cpl_image_get_data_float(rerrors[pos]);</div>
+<div class="line"><a name="l02110"></a><span class="lineno"> 2110</span> </div>
+<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>                 if_o_err = data </div>
+<div class="line"><a name="l02112"></a><span class="lineno"> 2112</span>                          + (2 * (nobjects - total) + nobjs_per_slit[p]</div>
+<div class="line"><a name="l02113"></a><span class="lineno"> 2113</span>                          + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02114"></a><span class="lineno"> 2114</span> </div>
+<div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>                 if_e_err = data + (2 * (nobjects - total)</div>
+<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span>                          + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span> </div>
+<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>                 data = cpl_image_get_data_float(rerrors[pos_d]);</div>
+<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span> </div>
+<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>                 ifdelta_o_err = data </div>
+<div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>                               + (2 * (nobjects - total) + nobjs_per_slit[p]</div>
+<div class="line"><a name="l02122"></a><span class="lineno"> 2122</span>                               + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02123"></a><span class="lineno"> 2123</span> </div>
+<div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>                 ifdelta_e_err = data + (2 * (nobjects - total)</div>
+<div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>                               + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02126"></a><span class="lineno"> 2126</span> </div>
+<div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>                 <span class="keywordflow">if</span> (bagoo) {</div>
+<div class="line"><a name="l02128"></a><span class="lineno"> 2128</span> </div>
+<div class="line"><a name="l02129"></a><span class="lineno"> 2129</span>                     <span class="keywordtype">char</span> *signal_to_noise  = getenv(<span class="stringliteral">"SIGNAL_TO_NOISE"</span> );</div>
+<div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>                     <span class="keywordtype">float</span> s2n = 100.;</div>
+<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>                     <span class="keywordtype">char</span> *min_s2n  = getenv(<span class="stringliteral">"MIN_S2N"</span> );</div>
+<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>                     <span class="keywordtype">int</span>   ms2n = 50;</div>
+<div class="line"><a name="l02133"></a><span class="lineno"> 2133</span> </div>
+<div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>                     <span class="keywordflow">if</span> (signal_to_noise)</div>
+<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>                         s2n = atof(signal_to_noise);</div>
+<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span> </div>
+<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>                     <span class="keywordflow">if</span> (min_s2n)</div>
+<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>                         ms2n = atoi(min_s2n);</div>
+<div class="line"><a name="l02139"></a><span class="lineno"> 2139</span> </div>
+<div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span> <span class="comment">                     * Check whether S/N is > s2n in more than ms2n pixels</span></div>
+<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span> <span class="comment">                     * (on first frame, on ordinary beam)</span></div>
+<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l02144"></a><span class="lineno"> 2144</span> </div>
+<div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>                     <span class="keywordflow">if</span> (k == 0) {</div>
+<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>                         bright = 0;</div>
+<div class="line"><a name="l02147"></a><span class="lineno"> 2147</span>                         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>                             <span class="keywordflow">if</span> (if_o_err[m] > 0.0) {</div>
+<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>                                 <span class="keywordflow">if</span> (if_o[m]/if_o_err[m] > s2n) {</div>
+<div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>                                     bright++;</div>
+<div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>                                     <span class="keywordflow">if</span> (bright > ms2n) {</div>
+<div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>                                         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02153"></a><span class="lineno"> 2153</span>                                     }</div>
+<div class="line"><a name="l02154"></a><span class="lineno"> 2154</span>                                 }</div>
+<div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>                             }</div>
+<div class="line"><a name="l02156"></a><span class="lineno"> 2156</span>                         }</div>
+<div class="line"><a name="l02157"></a><span class="lineno"> 2157</span>                     }</div>
+<div class="line"><a name="l02158"></a><span class="lineno"> 2158</span> </div>
+<div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>                     <span class="keywordflow">if</span> (bright > ms2n) {</div>
+<div class="line"><a name="l02160"></a><span class="lineno"> 2160</span>                         conta++;</div>
+<div class="line"><a name="l02161"></a><span class="lineno"> 2161</span>                         filename = cpl_sprintf(<span class="stringliteral">"angle_%d_%d.dat"</span>, </div>
+<div class="line"><a name="l02162"></a><span class="lineno"> 2162</span>                                                180*k-45, conta);</div>
+<div class="line"><a name="l02163"></a><span class="lineno"> 2163</span>                         file = fopen(filename, <span class="stringliteral">"w"</span>);</div>
+<div class="line"><a name="l02164"></a><span class="lineno"> 2164</span>     </div>
+<div class="line"><a name="l02165"></a><span class="lineno"> 2165</span>                         fprintf(file, <span class="stringliteral">"%d\n"</span>, p + 2);</div>
+<div class="line"><a name="l02166"></a><span class="lineno"> 2166</span> </div>
+<div class="line"><a name="l02167"></a><span class="lineno"> 2167</span>                         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l02168"></a><span class="lineno"> 2168</span>                             <span class="keywordtype">double</span> lambda = startwavelength </div>
+<div class="line"><a name="l02169"></a><span class="lineno"> 2169</span>                                           + dispersion * group * (0.5 + m);</div>
+<div class="line"><a name="l02170"></a><span class="lineno"> 2170</span>                             fprintf(file, <span class="stringliteral">"%.3f %.9e %.9e %.9e %.9e\n"</span>,</div>
+<div class="line"><a name="l02171"></a><span class="lineno"> 2171</span>                                     lambda, if_o[m], if_o_err[m], </div>
+<div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>                                     if_e[m], if_e_err[m]);</div>
+<div class="line"><a name="l02173"></a><span class="lineno"> 2173</span>                         }</div>
+<div class="line"><a name="l02174"></a><span class="lineno"> 2174</span> </div>
+<div class="line"><a name="l02175"></a><span class="lineno"> 2175</span>                         fclose(file);</div>
+<div class="line"><a name="l02176"></a><span class="lineno"> 2176</span>                         cpl_free(filename);</div>
+<div class="line"><a name="l02177"></a><span class="lineno"> 2177</span> </div>
+<div class="line"><a name="l02178"></a><span class="lineno"> 2178</span>                         filename = cpl_sprintf(<span class="stringliteral">"angle_%d_%d.dat"</span>, </div>
+<div class="line"><a name="l02179"></a><span class="lineno"> 2179</span>                                                180*k+45, conta);</div>
+<div class="line"><a name="l02180"></a><span class="lineno"> 2180</span>                         file = fopen(filename, <span class="stringliteral">"w"</span>);</div>
+<div class="line"><a name="l02181"></a><span class="lineno"> 2181</span> </div>
+<div class="line"><a name="l02182"></a><span class="lineno"> 2182</span>                         fprintf(file, <span class="stringliteral">"%d\n"</span>, p + 2);</div>
+<div class="line"><a name="l02183"></a><span class="lineno"> 2183</span> </div>
+<div class="line"><a name="l02184"></a><span class="lineno"> 2184</span>                         <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l02185"></a><span class="lineno"> 2185</span>                             <span class="keywordtype">double</span> lambda = startwavelength </div>
+<div class="line"><a name="l02186"></a><span class="lineno"> 2186</span>                                           + dispersion * group * (0.5 + m);</div>
+<div class="line"><a name="l02187"></a><span class="lineno"> 2187</span>                             fprintf(file, <span class="stringliteral">"%.3f %.9e %.9e %.9e %.9e\n"</span>,</div>
+<div class="line"><a name="l02188"></a><span class="lineno"> 2188</span>                                     lambda, ifdelta_o[m], ifdelta_o_err[m], </div>
+<div class="line"><a name="l02189"></a><span class="lineno"> 2189</span>                                     ifdelta_e[m], ifdelta_e_err[m]);</div>
+<div class="line"><a name="l02190"></a><span class="lineno"> 2190</span>                         }</div>
+<div class="line"><a name="l02191"></a><span class="lineno"> 2191</span>     </div>
+<div class="line"><a name="l02192"></a><span class="lineno"> 2192</span>                         fclose(file);</div>
+<div class="line"><a name="l02193"></a><span class="lineno"> 2193</span>                         cpl_free(filename);</div>
+<div class="line"><a name="l02194"></a><span class="lineno"> 2194</span>                     }</div>
+<div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02196"></a><span class="lineno"> 2196</span>                         cpl_msg_info(recipe, </div>
+<div class="line"><a name="l02197"></a><span class="lineno"> 2197</span>                                      <span class="stringliteral">"Extracted signal not written to "</span></div>
+<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>                                      <span class="stringliteral">"ASCII (S/N > %.0f only in %d < %d "</span></div>
+<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>                                      <span class="stringliteral">"bins)"</span>, s2n, bright, ms2n);</div>
+<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>                     }</div>
+<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>                 }  <span class="comment">// End of bagoo</span></div>
+<div class="line"><a name="l02202"></a><span class="lineno"> 2202</span> </div>
+<div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>                 <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l02204"></a><span class="lineno"> 2204</span> </div>
+<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>                     <span class="keywordtype">double</span> quantity = if_o[m] + if_e[m] == 0.0 ? 0.0 :</div>
+<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>                         (if_o[m]      - if_e[m]     ) /</div>
+<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>                         (if_o[m]      + if_e[m]     ) -</div>
+<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>                         (ifdelta_o[m] - ifdelta_e[m]) /</div>
+<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>                         (ifdelta_o[m] + ifdelta_e[m]);</div>
+<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span> </div>
+<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>                     quantity = isfinite(quantity) ? quantity : 0.0;</div>
+<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span> </div>
+<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>                     <span class="comment">/* PQ map computation */</span></div>
+<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>                     ip_v[m] += quantity * 0.5 / (nscience / 2);</div>
+<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span> </div>
+<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>                     <span class="comment">/* PQnull map computation */</span></div>
+<div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>                     <span class="keywordflow">if</span> (nscience / 2 > 1) {</div>
+<div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>                         <span class="keywordflow">if</span> (k % 2)</div>
+<div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>                             ip_vnull[m] += quantity * 0.5 / (nscience / 2);</div>
+<div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>                         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>                             ip_vnull[m] -= quantity * 0.5 / (nscience / 2);</div>
+<div class="line"><a name="l02222"></a><span class="lineno"> 2222</span>                     }</div>
+<div class="line"><a name="l02223"></a><span class="lineno"> 2223</span> </div>
+<div class="line"><a name="l02224"></a><span class="lineno"> 2224</span>                     <span class="comment">/* I map computation */</span></div>
+<div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>                     ip_i[m] += (if_o[m] + if_e[m] + </div>
+<div class="line"><a name="l02226"></a><span class="lineno"> 2226</span>                                 ifdelta_o[m] + ifdelta_e[m]) / nscience;</div>
+<div class="line"><a name="l02227"></a><span class="lineno"> 2227</span> </div>
+<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>                     <span class="comment">/* Variance map computation */</span></div>
+<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>                     ipierr[m] += (if_o_err[m]      * if_o_err[m]</div>
+<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>                                 + if_e_err[m]      * if_e_err[m]</div>
+<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>                                 + ifdelta_o_err[m] * ifdelta_o_err[m]</div>
+<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>                                 + ifdelta_e_err[m] * ifdelta_e_err[m]) </div>
+<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span>                                / nscience / nscience;</div>
+<div class="line"><a name="l02234"></a><span class="lineno"> 2234</span> </div>
+<div class="line"><a name="l02235"></a><span class="lineno"> 2235</span>                 }</div>
+<div class="line"><a name="l02236"></a><span class="lineno"> 2236</span>             }</div>
+<div class="line"><a name="l02237"></a><span class="lineno"> 2237</span> </div>
+<div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>             <span class="comment">/* Error map */</span></div>
+<div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>             data = cpl_image_get_data_float(reduceds[0]);</div>
+<div class="line"><a name="l02240"></a><span class="lineno"> 2240</span>             iff  = data + (2 * (nobjects - total) + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02241"></a><span class="lineno"> 2241</span> </div>
+<div class="line"><a name="l02242"></a><span class="lineno"> 2242</span>             data = cpl_image_get_data_float(rerrors[0]);</div>
+<div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>             ierr = data + (2 * (nobjects - total) + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02244"></a><span class="lineno"> 2244</span> </div>
+<div class="line"><a name="l02245"></a><span class="lineno"> 2245</span>             <span class="keywordflow">for</span> (m = 0; m < nx; m++)</div>
+<div class="line"><a name="l02246"></a><span class="lineno"> 2246</span>                 iperr[m] = iff[m] <= 0.0 ? </div>
+<div class="line"><a name="l02247"></a><span class="lineno"> 2247</span>                     0.0 : ierr[m] / iff[m] * 0.5 / sqrt (nscience / 2);</div>
+<div class="line"><a name="l02248"></a><span class="lineno"> 2248</span> </div>
+<div class="line"><a name="l02249"></a><span class="lineno"> 2249</span>             <span class="keywordflow">if</span> (nscience / 2 > 1) {</div>
+<div class="line"><a name="l02250"></a><span class="lineno"> 2250</span>                 <span class="keywordtype">float</span> * weights;</div>
+<div class="line"><a name="l02251"></a><span class="lineno"> 2251</span>                 <span class="keywordtype">float</span>   max, sum, sum2, imean;</div>
+<div class="line"><a name="l02252"></a><span class="lineno"> 2252</span> </div>
+<div class="line"><a name="l02253"></a><span class="lineno"> 2253</span>                 <span class="keywordtype">int</span> k;</div>
+<div class="line"><a name="l02254"></a><span class="lineno"> 2254</span> </div>
+<div class="line"><a name="l02255"></a><span class="lineno"> 2255</span>                 <span class="comment">/* QC on U NULL */</span></div>
+<div class="line"><a name="l02256"></a><span class="lineno"> 2256</span>                 weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);</div>
+<div class="line"><a name="l02257"></a><span class="lineno"> 2257</span> </div>
+<div class="line"><a name="l02258"></a><span class="lineno"> 2258</span>                 max = 0.0;</div>
+<div class="line"><a name="l02259"></a><span class="lineno"> 2259</span>                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02260"></a><span class="lineno"> 2260</span>                     <span class="keywordflow">if</span> (max < iff[k]) max = iff[k];</div>
+<div class="line"><a name="l02261"></a><span class="lineno"> 2261</span>                 }</div>
+<div class="line"><a name="l02262"></a><span class="lineno"> 2262</span>             </div>
+<div class="line"><a name="l02263"></a><span class="lineno"> 2263</span>                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02264"></a><span class="lineno"> 2264</span>                     weights[k] = iff[k] < 0.0 ? </div>
+<div class="line"><a name="l02265"></a><span class="lineno"> 2265</span>                         0.0 : iff[k] * iff[k] / (max * max);</div>
+<div class="line"><a name="l02266"></a><span class="lineno"> 2266</span>                 }</div>
+<div class="line"><a name="l02267"></a><span class="lineno"> 2267</span>             </div>
+<div class="line"><a name="l02268"></a><span class="lineno"> 2268</span>                 sum  = 0.0;</div>
+<div class="line"><a name="l02269"></a><span class="lineno"> 2269</span>                 sum2 = 0.0;</div>
+<div class="line"><a name="l02270"></a><span class="lineno"> 2270</span>                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02271"></a><span class="lineno"> 2271</span>                     sum  += weights[k] * ip_vnull[k];</div>
+<div class="line"><a name="l02272"></a><span class="lineno"> 2272</span>                     sum2 += weights[k];</div>
+<div class="line"><a name="l02273"></a><span class="lineno"> 2273</span>                 }</div>
+<div class="line"><a name="l02274"></a><span class="lineno"> 2274</span> </div>
+<div class="line"><a name="l02275"></a><span class="lineno"> 2275</span>                 cpl_free(weights);</div>
+<div class="line"><a name="l02276"></a><span class="lineno"> 2276</span> </div>
+<div class="line"><a name="l02277"></a><span class="lineno"> 2277</span>                 imean = sum / sum2;</div>
+<div class="line"><a name="l02278"></a><span class="lineno"> 2278</span> </div>
+<div class="line"><a name="l02279"></a><span class="lineno"> 2279</span>                 mean_vnull += (imean - mean_vnull) / (j + 1.0);</div>
+<div class="line"><a name="l02280"></a><span class="lineno"> 2280</span>             }</div>
+<div class="line"><a name="l02281"></a><span class="lineno"> 2281</span>         }</div>
+<div class="line"><a name="l02282"></a><span class="lineno"> 2282</span> </div>
+<div class="line"><a name="l02283"></a><span class="lineno"> 2283</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pv_im, reduced_v_tag, header, </div>
+<div class="line"><a name="l02284"></a><span class="lineno"> 2284</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l02285"></a><span class="lineno"> 2285</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l02286"></a><span class="lineno"> 2286</span> </div>
+<div class="line"><a name="l02287"></a><span class="lineno"> 2287</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pi_im, reduced_i_tag, header, </div>
+<div class="line"><a name="l02288"></a><span class="lineno"> 2288</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l02289"></a><span class="lineno"> 2289</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l02290"></a><span class="lineno"> 2290</span> </div>
+<div class="line"><a name="l02291"></a><span class="lineno"> 2291</span>         <span class="keywordflow">if</span> (nscience / 2 > 1) {</div>
+<div class="line"><a name="l02292"></a><span class="lineno"> 2292</span>             <span class="keywordtype">char</span>             *pipefile;</div>
+<div class="line"><a name="l02293"></a><span class="lineno"> 2293</span>             <span class="keywordtype">char</span>             *keyname;</div>
+<div class="line"><a name="l02294"></a><span class="lineno"> 2294</span>             cpl_propertylist *qheader;</div>
+<div class="line"><a name="l02295"></a><span class="lineno"> 2295</span> </div>
+<div class="line"><a name="l02296"></a><span class="lineno"> 2296</span>             qheader = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l02297"></a><span class="lineno"> 2297</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l02298"></a><span class="lineno"> 2298</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l02299"></a><span class="lineno"> 2299</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l02300"></a><span class="lineno"> 2300</span>                                    startwavelength + (dispersion * group)/2);</div>
+<div class="line"><a name="l02301"></a><span class="lineno"> 2301</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l02302"></a><span class="lineno"> 2302</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, </div>
+<div class="line"><a name="l02303"></a><span class="lineno"> 2303</span>                                            dispersion * group);</div>
+<div class="line"><a name="l02304"></a><span class="lineno"> 2304</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l02305"></a><span class="lineno"> 2305</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l02306"></a><span class="lineno"> 2306</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l02307"></a><span class="lineno"> 2307</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l02308"></a><span class="lineno"> 2308</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l02309"></a><span class="lineno"> 2309</span> </div>
+<div class="line"><a name="l02310"></a><span class="lineno"> 2310</span>             <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l02311"></a><span class="lineno"> 2311</span>                 <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);</div>
+<div class="line"><a name="l02312"></a><span class="lineno"> 2312</span> </div>
+<div class="line"><a name="l02313"></a><span class="lineno"> 2313</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l02314"></a><span class="lineno"> 2314</span> <span class="comment">                 * QC1 group header</span></div>
+<div class="line"><a name="l02315"></a><span class="lineno"> 2315</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l02316"></a><span class="lineno"> 2316</span> </div>
+<div class="line"><a name="l02317"></a><span class="lineno"> 2317</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_v_tag,</div>
+<div class="line"><a name="l02318"></a><span class="lineno"> 2318</span>                                          <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l02319"></a><span class="lineno"> 2319</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write product category to "</span></div>
+<div class="line"><a name="l02320"></a><span class="lineno"> 2320</span>                                            <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l02321"></a><span class="lineno"> 2321</span> </div>
+<div class="line"><a name="l02322"></a><span class="lineno"> 2322</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l02323"></a><span class="lineno"> 2323</span>                                            <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l02324"></a><span class="lineno"> 2324</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span></div>
+<div class="line"><a name="l02325"></a><span class="lineno"> 2325</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02326"></a><span class="lineno"> 2326</span>     </div>
+<div class="line"><a name="l02327"></a><span class="lineno"> 2327</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l02328"></a><span class="lineno"> 2328</span>                                            <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l02329"></a><span class="lineno"> 2329</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span></div>
+<div class="line"><a name="l02330"></a><span class="lineno"> 2330</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02331"></a><span class="lineno"> 2331</span>     </div>
+<div class="line"><a name="l02332"></a><span class="lineno"> 2332</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l02333"></a><span class="lineno"> 2333</span>                                            <span class="stringliteral">"Grism name"</span>, instrume))</div>
+<div class="line"><a name="l02334"></a><span class="lineno"> 2334</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in "</span></div>
+<div class="line"><a name="l02335"></a><span class="lineno"> 2335</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02336"></a><span class="lineno"> 2336</span> </div>
+<div class="line"><a name="l02337"></a><span class="lineno"> 2337</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,</div>
+<div class="line"><a name="l02338"></a><span class="lineno"> 2338</span>                                            <span class="stringliteral">"Grism identifier"</span>, instrume))</div>
+<div class="line"><a name="l02339"></a><span class="lineno"> 2339</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in "</span></div>
+<div class="line"><a name="l02340"></a><span class="lineno"> 2340</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02341"></a><span class="lineno"> 2341</span> </div>
+<div class="line"><a name="l02342"></a><span class="lineno"> 2342</span>                 <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))</div>
+<div class="line"><a name="l02343"></a><span class="lineno"> 2343</span>                     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l02344"></a><span class="lineno"> 2344</span>                                            <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l02345"></a><span class="lineno"> 2345</span> </div>
+<div class="line"><a name="l02346"></a><span class="lineno"> 2346</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,</div>
+<div class="line"><a name="l02347"></a><span class="lineno"> 2347</span>                                            <span class="stringliteral">"Collimator name"</span>, instrume))</div>
+<div class="line"><a name="l02348"></a><span class="lineno"> 2348</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in "</span></div>
+<div class="line"><a name="l02349"></a><span class="lineno"> 2349</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02350"></a><span class="lineno"> 2350</span> </div>
+<div class="line"><a name="l02351"></a><span class="lineno"> 2351</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l02352"></a><span class="lineno"> 2352</span>                                            <span class="stringliteral">"Chip identifier"</span>, instrume))</div>
+<div class="line"><a name="l02353"></a><span class="lineno"> 2353</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in "</span></div>
+<div class="line"><a name="l02354"></a><span class="lineno"> 2354</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02355"></a><span class="lineno"> 2355</span> </div>
+<div class="line"><a name="l02356"></a><span class="lineno"> 2356</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l02357"></a><span class="lineno"> 2357</span>                                            <span class="stringliteral">"Archive name of input data"</span>, </div>
+<div class="line"><a name="l02358"></a><span class="lineno"> 2358</span>                                            instrume))</div>
+<div class="line"><a name="l02359"></a><span class="lineno"> 2359</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span></div>
+<div class="line"><a name="l02360"></a><span class="lineno"> 2360</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02361"></a><span class="lineno"> 2361</span> </div>
+<div class="line"><a name="l02362"></a><span class="lineno"> 2362</span>                 pipefile = dfs_generate_filename_tfits(reduced_nul_v_tag);</div>
+<div class="line"><a name="l02363"></a><span class="lineno"> 2363</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l02364"></a><span class="lineno"> 2364</span>                                          <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l02365"></a><span class="lineno"> 2365</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span></div>
+<div class="line"><a name="l02366"></a><span class="lineno"> 2366</span>                                            <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l02367"></a><span class="lineno"> 2367</span>                 cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l02368"></a><span class="lineno"> 2368</span> </div>
+<div class="line"><a name="l02369"></a><span class="lineno"> 2369</span> </div>
+<div class="line"><a name="l02370"></a><span class="lineno"> 2370</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l02371"></a><span class="lineno"> 2371</span> <span class="comment">                 * QC1 parameters</span></div>
+<div class="line"><a name="l02372"></a><span class="lineno"> 2372</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l02373"></a><span class="lineno"> 2373</span> </div>
+<div class="line"><a name="l02374"></a><span class="lineno"> 2374</span>                 keyname = <span class="stringliteral">"QC.NULL.V.MEAN"</span>;</div>
+<div class="line"><a name="l02375"></a><span class="lineno"> 2375</span>                     </div>
+<div class="line"><a name="l02376"></a><span class="lineno"> 2376</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qheader, mean_vnull,</div>
+<div class="line"><a name="l02377"></a><span class="lineno"> 2377</span>                                             keyname, NULL,</div>
+<div class="line"><a name="l02378"></a><span class="lineno"> 2378</span>                                             <span class="stringliteral">"Mean V null parameter"</span>,</div>
+<div class="line"><a name="l02379"></a><span class="lineno"> 2379</span>                                             instrume)) {</div>
+<div class="line"><a name="l02380"></a><span class="lineno"> 2380</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write mean Q null "</span></div>
+<div class="line"><a name="l02381"></a><span class="lineno"> 2381</span>                                            <span class="stringliteral">"parameter to QC log file."</span>);</div>
+<div class="line"><a name="l02382"></a><span class="lineno"> 2382</span>                 }</div>
+<div class="line"><a name="l02383"></a><span class="lineno"> 2383</span> </div>
+<div class="line"><a name="l02384"></a><span class="lineno"> 2384</span>                 keyname = <span class="stringliteral">"QC.NANGLES"</span>;</div>
+<div class="line"><a name="l02385"></a><span class="lineno"> 2385</span> </div>
+<div class="line"><a name="l02386"></a><span class="lineno"> 2386</span>                 <span class="keywordflow">if</span> (fors_qc_write_qc_int(qheader, nscience,</div>
+<div class="line"><a name="l02387"></a><span class="lineno"> 2387</span>                                          keyname, NULL,</div>
+<div class="line"><a name="l02388"></a><span class="lineno"> 2388</span>                                          <span class="stringliteral">"Number of processed plate angles"</span>,</div>
+<div class="line"><a name="l02389"></a><span class="lineno"> 2389</span>                                          instrume)) {</div>
+<div class="line"><a name="l02390"></a><span class="lineno"> 2390</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write number of processed "</span></div>
+<div class="line"><a name="l02391"></a><span class="lineno"> 2391</span>                                            <span class="stringliteral">"plate angles."</span>);</div>
+<div class="line"><a name="l02392"></a><span class="lineno"> 2392</span>                 }</div>
+<div class="line"><a name="l02393"></a><span class="lineno"> 2393</span> </div>
+<div class="line"><a name="l02394"></a><span class="lineno"> 2394</span>                 <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l02395"></a><span class="lineno"> 2395</span>             }</div>
+<div class="line"><a name="l02396"></a><span class="lineno"> 2396</span> </div>
+<div class="line"><a name="l02397"></a><span class="lineno"> 2397</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pvnull_im, reduced_nul_v_tag, qheader, </div>
+<div class="line"><a name="l02398"></a><span class="lineno"> 2398</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l02399"></a><span class="lineno"> 2399</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l02400"></a><span class="lineno"> 2400</span> </div>
+<div class="line"><a name="l02401"></a><span class="lineno"> 2401</span>             cpl_propertylist_delete(qheader);</div>
+<div class="line"><a name="l02402"></a><span class="lineno"> 2402</span>         }</div>
+<div class="line"><a name="l02403"></a><span class="lineno"> 2403</span> </div>
+<div class="line"><a name="l02404"></a><span class="lineno"> 2404</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, perr_im, reduced_error_v_tag, header, </div>
+<div class="line"><a name="l02405"></a><span class="lineno"> 2405</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l02406"></a><span class="lineno"> 2406</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l02407"></a><span class="lineno"> 2407</span> </div>
+<div class="line"><a name="l02408"></a><span class="lineno"> 2408</span>         cpl_image_power(pierr_im, 0.5);</div>
+<div class="line"><a name="l02409"></a><span class="lineno"> 2409</span> </div>
+<div class="line"><a name="l02410"></a><span class="lineno"> 2410</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pierr_im, reduced_error_i_tag, header, </div>
+<div class="line"><a name="l02411"></a><span class="lineno"> 2411</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l02412"></a><span class="lineno"> 2412</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l02413"></a><span class="lineno"> 2413</span> </div>
+<div class="line"><a name="l02414"></a><span class="lineno"> 2414</span>         cpl_image_delete(pv_im);</div>
+<div class="line"><a name="l02415"></a><span class="lineno"> 2415</span>         cpl_image_delete(pvnull_im);</div>
+<div class="line"><a name="l02416"></a><span class="lineno"> 2416</span>         cpl_image_delete(perr_im);</div>
+<div class="line"><a name="l02417"></a><span class="lineno"> 2417</span>         cpl_image_delete(pi_im);</div>
+<div class="line"><a name="l02418"></a><span class="lineno"> 2418</span>         cpl_image_delete(pierr_im);</div>
+<div class="line"><a name="l02419"></a><span class="lineno"> 2419</span>     } </div>
+<div class="line"><a name="l02420"></a><span class="lineno"> 2420</span>     <span class="keywordflow">else</span> {                            <span class="comment">/* Linear polarisation */</span></div>
+<div class="line"><a name="l02421"></a><span class="lineno"> 2421</span>         cpl_image *pq_im      = NULL;</div>
+<div class="line"><a name="l02422"></a><span class="lineno"> 2422</span>         cpl_image *pu_im      = NULL;</div>
+<div class="line"><a name="l02423"></a><span class="lineno"> 2423</span>         cpl_image *pl_im      = NULL;</div>
+<div class="line"><a name="l02424"></a><span class="lineno"> 2424</span>         cpl_image *pi_im      = NULL;</div>
+<div class="line"><a name="l02425"></a><span class="lineno"> 2425</span> </div>
+<div class="line"><a name="l02426"></a><span class="lineno"> 2426</span>         cpl_image *pqnull_im  = NULL;</div>
+<div class="line"><a name="l02427"></a><span class="lineno"> 2427</span>         cpl_image *punull_im  = NULL;</div>
+<div class="line"><a name="l02428"></a><span class="lineno"> 2428</span> </div>
+<div class="line"><a name="l02429"></a><span class="lineno"> 2429</span>         cpl_image *pqerr_im   = NULL;</div>
+<div class="line"><a name="l02430"></a><span class="lineno"> 2430</span>         cpl_image *puerr_im   = NULL;</div>
+<div class="line"><a name="l02431"></a><span class="lineno"> 2431</span>         cpl_image *plerr_im   = NULL;</div>
+<div class="line"><a name="l02432"></a><span class="lineno"> 2432</span>         cpl_image *pierr_im   = NULL;</div>
+<div class="line"><a name="l02433"></a><span class="lineno"> 2433</span> </div>
+<div class="line"><a name="l02434"></a><span class="lineno"> 2434</span>         cpl_image *pang_im    = NULL;</div>
+<div class="line"><a name="l02435"></a><span class="lineno"> 2435</span>         cpl_image *pangerr_im = NULL;</div>
+<div class="line"><a name="l02436"></a><span class="lineno"> 2436</span> </div>
+<div class="line"><a name="l02437"></a><span class="lineno"> 2437</span>         <span class="keywordtype">double</span>    *p_q        = NULL;</div>
+<div class="line"><a name="l02438"></a><span class="lineno"> 2438</span>         <span class="keywordtype">double</span>    *p_u        = NULL;</div>
+<div class="line"><a name="l02439"></a><span class="lineno"> 2439</span>         <span class="keywordtype">double</span>    *p_l        = NULL;</div>
+<div class="line"><a name="l02440"></a><span class="lineno"> 2440</span>         <span class="keywordtype">double</span>    *p_i        = NULL;</div>
+<div class="line"><a name="l02441"></a><span class="lineno"> 2441</span> </div>
+<div class="line"><a name="l02442"></a><span class="lineno"> 2442</span>         <span class="keywordtype">double</span>    *p_qnull    = NULL;</div>
+<div class="line"><a name="l02443"></a><span class="lineno"> 2443</span>         <span class="keywordtype">double</span>    *p_unull    = NULL;</div>
+<div class="line"><a name="l02444"></a><span class="lineno"> 2444</span> </div>
+<div class="line"><a name="l02445"></a><span class="lineno"> 2445</span>         <span class="keywordtype">double</span>    *pqerr      = NULL;</div>
+<div class="line"><a name="l02446"></a><span class="lineno"> 2446</span>         <span class="keywordtype">double</span>    *puerr      = NULL;</div>
+<div class="line"><a name="l02447"></a><span class="lineno"> 2447</span>         <span class="keywordtype">double</span>    *plerr      = NULL;</div>
+<div class="line"><a name="l02448"></a><span class="lineno"> 2448</span>         <span class="keywordtype">double</span>    *pierr      = NULL;</div>
+<div class="line"><a name="l02449"></a><span class="lineno"> 2449</span> </div>
+<div class="line"><a name="l02450"></a><span class="lineno"> 2450</span>         <span class="keywordtype">double</span>    *pang       = NULL;</div>
+<div class="line"><a name="l02451"></a><span class="lineno"> 2451</span>         <span class="keywordtype">double</span>    *pangerr    = NULL;</div>
+<div class="line"><a name="l02452"></a><span class="lineno"> 2452</span> </div>
+<div class="line"><a name="l02453"></a><span class="lineno"> 2453</span>         <span class="keywordtype">int</span>        k, m;</div>
+<div class="line"><a name="l02454"></a><span class="lineno"> 2454</span> </div>
+<div class="line"><a name="l02455"></a><span class="lineno"> 2455</span>         cpl_image *correct_im = cpl_image_new(nx, 1, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02456"></a><span class="lineno"> 2456</span>         <span class="keywordtype">double</span>    *correct    = cpl_image_get_data_double(correct_im);</div>
+<div class="line"><a name="l02457"></a><span class="lineno"> 2457</span> </div>
+<div class="line"><a name="l02458"></a><span class="lineno"> 2458</span>         <span class="keywordtype">double</span>     mean_unull, mean_qnull;</div>
+<div class="line"><a name="l02459"></a><span class="lineno"> 2459</span> </div>
+<div class="line"><a name="l02460"></a><span class="lineno"> 2460</span>         <span class="keywordtype">int</span>        p          = -1;</div>
+<div class="line"><a name="l02461"></a><span class="lineno"> 2461</span>         <span class="keywordtype">int</span>        total      = 0;</div>
+<div class="line"><a name="l02462"></a><span class="lineno"> 2462</span>             </div>
+<div class="line"><a name="l02463"></a><span class="lineno"> 2463</span>         pq_im      = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02464"></a><span class="lineno"> 2464</span>         pu_im      = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02465"></a><span class="lineno"> 2465</span>         pl_im      = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02466"></a><span class="lineno"> 2466</span>         pi_im      = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02467"></a><span class="lineno"> 2467</span> </div>
+<div class="line"><a name="l02468"></a><span class="lineno"> 2468</span>         pqerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02469"></a><span class="lineno"> 2469</span>         puerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02470"></a><span class="lineno"> 2470</span>         plerr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02471"></a><span class="lineno"> 2471</span>         pierr_im   = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02472"></a><span class="lineno"> 2472</span> </div>
+<div class="line"><a name="l02473"></a><span class="lineno"> 2473</span>         pang_im    = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02474"></a><span class="lineno"> 2474</span>         pangerr_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02475"></a><span class="lineno"> 2475</span> </div>
+<div class="line"><a name="l02476"></a><span class="lineno"> 2476</span>         p_q        = cpl_image_get_data_double(pq_im);</div>
+<div class="line"><a name="l02477"></a><span class="lineno"> 2477</span>         p_u        = cpl_image_get_data_double(pu_im);</div>
+<div class="line"><a name="l02478"></a><span class="lineno"> 2478</span>         p_l        = cpl_image_get_data_double(pl_im);</div>
+<div class="line"><a name="l02479"></a><span class="lineno"> 2479</span>         p_i        = cpl_image_get_data_double(pi_im);</div>
+<div class="line"><a name="l02480"></a><span class="lineno"> 2480</span> </div>
+<div class="line"><a name="l02481"></a><span class="lineno"> 2481</span>         <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02482"></a><span class="lineno"> 2482</span>             pqnull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02483"></a><span class="lineno"> 2483</span>             punull_im = cpl_image_new(nx, nobjects, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02484"></a><span class="lineno"> 2484</span> </div>
+<div class="line"><a name="l02485"></a><span class="lineno"> 2485</span>             p_qnull = cpl_image_get_data_double(pqnull_im);</div>
+<div class="line"><a name="l02486"></a><span class="lineno"> 2486</span>             p_unull = cpl_image_get_data_double(punull_im);</div>
+<div class="line"><a name="l02487"></a><span class="lineno"> 2487</span>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02488"></a><span class="lineno"> 2488</span>             cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l02489"></a><span class="lineno"> 2489</span>                             <span class="stringliteral">"Not enough pairs to compute null parameters"</span>);</div>
+<div class="line"><a name="l02490"></a><span class="lineno"> 2490</span>         }</div>
+<div class="line"><a name="l02491"></a><span class="lineno"> 2491</span> </div>
+<div class="line"><a name="l02492"></a><span class="lineno"> 2492</span>         pqerr = cpl_image_get_data_double(pqerr_im);</div>
+<div class="line"><a name="l02493"></a><span class="lineno"> 2493</span>         puerr = cpl_image_get_data_double(puerr_im);</div>
+<div class="line"><a name="l02494"></a><span class="lineno"> 2494</span>         plerr = cpl_image_get_data_double(plerr_im);</div>
+<div class="line"><a name="l02495"></a><span class="lineno"> 2495</span>         pierr = cpl_image_get_data_double(pierr_im);</div>
+<div class="line"><a name="l02496"></a><span class="lineno"> 2496</span> </div>
+<div class="line"><a name="l02497"></a><span class="lineno"> 2497</span>         pang = cpl_image_get_data_double(pang_im);</div>
+<div class="line"><a name="l02498"></a><span class="lineno"> 2498</span>         pangerr = cpl_image_get_data_double(pangerr_im);</div>
+<div class="line"><a name="l02499"></a><span class="lineno"> 2499</span> </div>
+<div class="line"><a name="l02500"></a><span class="lineno"> 2500</span>         <span class="keywordflow">if</span> (chromatism) {</div>
+<div class="line"><a name="l02501"></a><span class="lineno"> 2501</span>             cpl_table * chrotbl = </div>
+<div class="line"><a name="l02502"></a><span class="lineno"> 2502</span>                 <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, chrom_table_tag, 1);</div>
+<div class="line"><a name="l02503"></a><span class="lineno"> 2503</span> </div>
+<div class="line"><a name="l02504"></a><span class="lineno"> 2504</span>             <span class="keywordtype">int</span>      nrow   = cpl_table_get_nrow(chrotbl);</div>
+<div class="line"><a name="l02505"></a><span class="lineno"> 2505</span>             <span class="keywordtype">float</span>  * lambda = cpl_table_get_data_float(chrotbl, <span class="stringliteral">"lambda"</span>);</div>
+<div class="line"><a name="l02506"></a><span class="lineno"> 2506</span>             <span class="keywordtype">float</span>  * theta  = cpl_table_get_data_float(chrotbl, <span class="stringliteral">"eps_theta"</span>);</div>
+<div class="line"><a name="l02507"></a><span class="lineno"> 2507</span> </div>
+<div class="line"><a name="l02508"></a><span class="lineno"> 2508</span>             <span class="keywordflow">for</span> (j = 0; j < nx; j++) {</div>
+<div class="line"><a name="l02509"></a><span class="lineno"> 2509</span>                 <span class="keywordtype">double</span> c_wave = startwavelength </div>
+<div class="line"><a name="l02510"></a><span class="lineno"> 2510</span>                               + (dispersion * group) / 2 </div>
+<div class="line"><a name="l02511"></a><span class="lineno"> 2511</span>                               + j * dispersion * group;</div>
+<div class="line"><a name="l02512"></a><span class="lineno"> 2512</span>             </div>
+<div class="line"><a name="l02513"></a><span class="lineno"> 2513</span>                 <span class="keywordtype">int</span> found = 0;</div>
+<div class="line"><a name="l02514"></a><span class="lineno"> 2514</span> </div>
+<div class="line"><a name="l02515"></a><span class="lineno"> 2515</span>                 <span class="keywordflow">for</span> (k = 0; k < nrow - 1; k++) {</div>
+<div class="line"><a name="l02516"></a><span class="lineno"> 2516</span>                     <span class="keywordflow">if</span> (lambda[k] <= c_wave && c_wave < lambda[k + 1]) {</div>
+<div class="line"><a name="l02517"></a><span class="lineno"> 2517</span>                         found = 1;</div>
+<div class="line"><a name="l02518"></a><span class="lineno"> 2518</span>                         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02519"></a><span class="lineno"> 2519</span>                     }</div>
+<div class="line"><a name="l02520"></a><span class="lineno"> 2520</span>                 }</div>
+<div class="line"><a name="l02521"></a><span class="lineno"> 2521</span> </div>
+<div class="line"><a name="l02522"></a><span class="lineno"> 2522</span>                 <span class="keywordflow">if</span> (found) {</div>
+<div class="line"><a name="l02523"></a><span class="lineno"> 2523</span>                     correct[j] = (theta [k + 1] - theta [k]) /</div>
+<div class="line"><a name="l02524"></a><span class="lineno"> 2524</span>                                  (lambda[k + 1] - lambda[k]) *</div>
+<div class="line"><a name="l02525"></a><span class="lineno"> 2525</span>                                  (c_wave        - lambda[k])   + theta[k];</div>
+<div class="line"><a name="l02526"></a><span class="lineno"> 2526</span>                     correct[j] *= M_PI / 180;   <span class="comment">/* Radians */</span></div>
+<div class="line"><a name="l02527"></a><span class="lineno"> 2527</span>                 }</div>
+<div class="line"><a name="l02528"></a><span class="lineno"> 2528</span>                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (j)</div>
+<div class="line"><a name="l02529"></a><span class="lineno"> 2529</span>                     correct[j] = correct[j-1];</div>
+<div class="line"><a name="l02530"></a><span class="lineno"> 2530</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l02531"></a><span class="lineno"> 2531</span>                     correct[j] = 0.0;</div>
+<div class="line"><a name="l02532"></a><span class="lineno"> 2532</span>             }</div>
+<div class="line"><a name="l02533"></a><span class="lineno"> 2533</span> </div>
+<div class="line"><a name="l02534"></a><span class="lineno"> 2534</span>             cpl_table_delete(chrotbl);</div>
+<div class="line"><a name="l02535"></a><span class="lineno"> 2535</span>         }</div>
+<div class="line"><a name="l02536"></a><span class="lineno"> 2536</span> </div>
+<div class="line"><a name="l02537"></a><span class="lineno"> 2537</span>         <span class="keywordflow">for</span> (j = 0; j < nobjects; j++) {</div>
+<div class="line"><a name="l02538"></a><span class="lineno"> 2538</span>             <span class="keywordtype">double</span> *ip_q;</div>
+<div class="line"><a name="l02539"></a><span class="lineno"> 2539</span>             <span class="keywordtype">double</span> *ip_u;</div>
+<div class="line"><a name="l02540"></a><span class="lineno"> 2540</span>             <span class="keywordtype">double</span> *ip_l;</div>
+<div class="line"><a name="l02541"></a><span class="lineno"> 2541</span>             <span class="keywordtype">double</span> *ip_i;</div>
+<div class="line"><a name="l02542"></a><span class="lineno"> 2542</span>             <span class="keywordtype">double</span> *ipierr;</div>
+<div class="line"><a name="l02543"></a><span class="lineno"> 2543</span>             <span class="keywordtype">double</span> *ip_qnull;</div>
+<div class="line"><a name="l02544"></a><span class="lineno"> 2544</span>             <span class="keywordtype">double</span> *ip_unull;</div>
+<div class="line"><a name="l02545"></a><span class="lineno"> 2545</span>             <span class="keywordtype">double</span> *ipqerr;</div>
+<div class="line"><a name="l02546"></a><span class="lineno"> 2546</span>             <span class="keywordtype">double</span> *ipuerr;</div>
+<div class="line"><a name="l02547"></a><span class="lineno"> 2547</span>             <span class="keywordtype">double</span> *iplerr;</div>
+<div class="line"><a name="l02548"></a><span class="lineno"> 2548</span>             <span class="keywordtype">double</span> *ipang;</div>
+<div class="line"><a name="l02549"></a><span class="lineno"> 2549</span>             <span class="keywordtype">double</span> *ipangerr;</div>
+<div class="line"><a name="l02550"></a><span class="lineno"> 2550</span> </div>
+<div class="line"><a name="l02551"></a><span class="lineno"> 2551</span>             <span class="keywordtype">float</span>  *data;</div>
+<div class="line"><a name="l02552"></a><span class="lineno"> 2552</span>             <span class="keywordtype">float</span>  *iffq;</div>
+<div class="line"><a name="l02553"></a><span class="lineno"> 2553</span>             <span class="keywordtype">float</span>  *ierrq;</div>
+<div class="line"><a name="l02554"></a><span class="lineno"> 2554</span>             <span class="keywordtype">float</span>  *iffu;</div>
+<div class="line"><a name="l02555"></a><span class="lineno"> 2555</span>             <span class="keywordtype">float</span>  *ierru;</div>
+<div class="line"><a name="l02556"></a><span class="lineno"> 2556</span> </div>
+<div class="line"><a name="l02557"></a><span class="lineno"> 2557</span>             <span class="keywordtype">int</span> pos, pos_d;</div>
+<div class="line"><a name="l02558"></a><span class="lineno"> 2558</span> </div>
+<div class="line"><a name="l02559"></a><span class="lineno"> 2559</span>             ip_q = p_q + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02560"></a><span class="lineno"> 2560</span>             ip_u = p_u + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02561"></a><span class="lineno"> 2561</span>             ip_l = p_l + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02562"></a><span class="lineno"> 2562</span>             ip_i = p_i + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02563"></a><span class="lineno"> 2563</span> </div>
+<div class="line"><a name="l02564"></a><span class="lineno"> 2564</span>             <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02565"></a><span class="lineno"> 2565</span>                 ip_qnull = p_qnull + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02566"></a><span class="lineno"> 2566</span>                 ip_unull = p_unull + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02567"></a><span class="lineno"> 2567</span>             }</div>
+<div class="line"><a name="l02568"></a><span class="lineno"> 2568</span> </div>
+<div class="line"><a name="l02569"></a><span class="lineno"> 2569</span>             ipqerr = pqerr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02570"></a><span class="lineno"> 2570</span>             ipuerr = puerr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02571"></a><span class="lineno"> 2571</span>             iplerr = plerr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02572"></a><span class="lineno"> 2572</span>             ipierr = pierr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02573"></a><span class="lineno"> 2573</span> </div>
+<div class="line"><a name="l02574"></a><span class="lineno"> 2574</span>             ipang = pang + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02575"></a><span class="lineno"> 2575</span>             ipangerr = pangerr + (nobjects - 1 - j) * nx;</div>
+<div class="line"><a name="l02576"></a><span class="lineno"> 2576</span> </div>
+<div class="line"><a name="l02577"></a><span class="lineno"> 2577</span>             total = 0;</div>
+<div class="line"><a name="l02578"></a><span class="lineno"> 2578</span>             <span class="keywordflow">for</span> (i = 0; i < nslits; i += 2) {</div>
+<div class="line"><a name="l02579"></a><span class="lineno"> 2579</span>                 total += nobjs_per_slit[i];</div>
+<div class="line"><a name="l02580"></a><span class="lineno"> 2580</span>                 <span class="keywordflow">if</span> (total > j) {</div>
+<div class="line"><a name="l02581"></a><span class="lineno"> 2581</span>                     p = i;</div>
+<div class="line"><a name="l02582"></a><span class="lineno"> 2582</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02583"></a><span class="lineno"> 2583</span>                 }</div>
+<div class="line"><a name="l02584"></a><span class="lineno"> 2584</span>             }</div>
+<div class="line"><a name="l02585"></a><span class="lineno"> 2585</span> </div>
+<div class="line"><a name="l02586"></a><span class="lineno"> 2586</span>             <span class="keywordflow">for</span> (k = 0; k < nscience / 4; k++) {</div>
+<div class="line"><a name="l02587"></a><span class="lineno"> 2587</span>                 <span class="keywordtype">float</span> * if_o, * if_e,  * ifdelta_o, * ifdelta_e;</div>
+<div class="line"><a name="l02588"></a><span class="lineno"> 2588</span>                 <span class="keywordtype">float</span> * if_o_err, * if_e_err,  * ifdelta_o_err, * ifdelta_e_err;</div>
+<div class="line"><a name="l02589"></a><span class="lineno"> 2589</span> </div>
+<div class="line"><a name="l02590"></a><span class="lineno"> 2590</span>                 <span class="comment">/* First P_Q */</span></div>
+<div class="line"><a name="l02591"></a><span class="lineno"> 2591</span> </div>
+<div class="line"><a name="l02592"></a><span class="lineno"> 2592</span>                 pos   = fors_find_angle_pos(angles, nscience, 90 * k);</div>
+<div class="line"><a name="l02593"></a><span class="lineno"> 2593</span>                 pos_d = fors_find_angle_pos(angles, nscience, 90 * k + 45);</div>
+<div class="line"><a name="l02594"></a><span class="lineno"> 2594</span> </div>
+<div class="line"><a name="l02595"></a><span class="lineno"> 2595</span>                 data = cpl_image_get_data_float(reduceds[pos]);</div>
+<div class="line"><a name="l02596"></a><span class="lineno"> 2596</span> </div>
+<div class="line"><a name="l02597"></a><span class="lineno"> 2597</span>                 if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l02598"></a><span class="lineno"> 2598</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02599"></a><span class="lineno"> 2599</span> </div>
+<div class="line"><a name="l02600"></a><span class="lineno"> 2600</span>                 if_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02601"></a><span class="lineno"> 2601</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02602"></a><span class="lineno"> 2602</span> </div>
+<div class="line"><a name="l02603"></a><span class="lineno"> 2603</span>                 data = cpl_image_get_data_float(reduceds[pos_d]);</div>
+<div class="line"><a name="l02604"></a><span class="lineno"> 2604</span> </div>
+<div class="line"><a name="l02605"></a><span class="lineno"> 2605</span>                 ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l02606"></a><span class="lineno"> 2606</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02607"></a><span class="lineno"> 2607</span> </div>
+<div class="line"><a name="l02608"></a><span class="lineno"> 2608</span>                 ifdelta_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02609"></a><span class="lineno"> 2609</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02610"></a><span class="lineno"> 2610</span> </div>
+<div class="line"><a name="l02611"></a><span class="lineno"> 2611</span>                 data = cpl_image_get_data_float(rerrors[pos]);</div>
+<div class="line"><a name="l02612"></a><span class="lineno"> 2612</span> </div>
+<div class="line"><a name="l02613"></a><span class="lineno"> 2613</span>                 if_o_err = data + (2 * (nobjects - total) + nobjs_per_slit[p]</div>
+<div class="line"><a name="l02614"></a><span class="lineno"> 2614</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02615"></a><span class="lineno"> 2615</span> </div>
+<div class="line"><a name="l02616"></a><span class="lineno"> 2616</span>                 if_e_err = data + (2 * (nobjects - total)</div>
+<div class="line"><a name="l02617"></a><span class="lineno"> 2617</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02618"></a><span class="lineno"> 2618</span> </div>
+<div class="line"><a name="l02619"></a><span class="lineno"> 2619</span>                 data = cpl_image_get_data_float(rerrors[pos_d]);</div>
+<div class="line"><a name="l02620"></a><span class="lineno"> 2620</span> </div>
+<div class="line"><a name="l02621"></a><span class="lineno"> 2621</span>                 ifdelta_o_err = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02622"></a><span class="lineno"> 2622</span>                               + nobjs_per_slit[p] + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02623"></a><span class="lineno"> 2623</span> </div>
+<div class="line"><a name="l02624"></a><span class="lineno"> 2624</span>                 ifdelta_e_err = data + (2 * (nobjects - total)</div>
+<div class="line"><a name="l02625"></a><span class="lineno"> 2625</span>                               + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02626"></a><span class="lineno"> 2626</span> </div>
+<div class="line"><a name="l02627"></a><span class="lineno"> 2627</span>                 <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l02628"></a><span class="lineno"> 2628</span> </div>
+<div class="line"><a name="l02629"></a><span class="lineno"> 2629</span>                     <span class="keywordtype">double</span> quantity = fabs(if_o[m] + if_e[m]) < FLT_MIN ? 0.0 :</div>
+<div class="line"><a name="l02630"></a><span class="lineno"> 2630</span>                         (if_o[m]      - if_e[m]     ) /</div>
+<div class="line"><a name="l02631"></a><span class="lineno"> 2631</span>                         (if_o[m]      + if_e[m]     ) -</div>
+<div class="line"><a name="l02632"></a><span class="lineno"> 2632</span>                         (ifdelta_o[m] - ifdelta_e[m]) /</div>
+<div class="line"><a name="l02633"></a><span class="lineno"> 2633</span>                         (ifdelta_o[m] + ifdelta_e[m]);</div>
+<div class="line"><a name="l02634"></a><span class="lineno"> 2634</span> </div>
+<div class="line"><a name="l02635"></a><span class="lineno"> 2635</span>                     quantity = isfinite(quantity) ? quantity : 0.0;</div>
+<div class="line"><a name="l02636"></a><span class="lineno"> 2636</span> </div>
+<div class="line"><a name="l02637"></a><span class="lineno"> 2637</span>                     <span class="comment">/* PQ map computation */</span></div>
+<div class="line"><a name="l02638"></a><span class="lineno"> 2638</span>                     ip_q[m] += quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02639"></a><span class="lineno"> 2639</span> </div>
+<div class="line"><a name="l02640"></a><span class="lineno"> 2640</span>                     <span class="comment">/* PQnull map computation */</span></div>
+<div class="line"><a name="l02641"></a><span class="lineno"> 2641</span>                     <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02642"></a><span class="lineno"> 2642</span>                         <span class="keywordflow">if</span> (k % 2)</div>
+<div class="line"><a name="l02643"></a><span class="lineno"> 2643</span>                             ip_qnull[m] += quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02644"></a><span class="lineno"> 2644</span>                         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l02645"></a><span class="lineno"> 2645</span>                             ip_qnull[m] -= quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02646"></a><span class="lineno"> 2646</span>                     }</div>
+<div class="line"><a name="l02647"></a><span class="lineno"> 2647</span> </div>
+<div class="line"><a name="l02648"></a><span class="lineno"> 2648</span>                     <span class="comment">/* I map computation */</span></div>
+<div class="line"><a name="l02649"></a><span class="lineno"> 2649</span>                     ip_i[m] += (if_o[m] + if_e[m] +</div>
+<div class="line"><a name="l02650"></a><span class="lineno"> 2650</span>                                 ifdelta_o[m] + ifdelta_e[m]) / nscience;</div>
+<div class="line"><a name="l02651"></a><span class="lineno"> 2651</span> </div>
+<div class="line"><a name="l02652"></a><span class="lineno"> 2652</span>                     <span class="comment">/* Variance map computation */</span></div>
+<div class="line"><a name="l02653"></a><span class="lineno"> 2653</span>                     ipierr[m] += (if_o_err[m]      * if_o_err[m]</div>
+<div class="line"><a name="l02654"></a><span class="lineno"> 2654</span>                                 + if_e_err[m]      * if_e_err[m]</div>
+<div class="line"><a name="l02655"></a><span class="lineno"> 2655</span>                                 + ifdelta_o_err[m] * ifdelta_o_err[m]</div>
+<div class="line"><a name="l02656"></a><span class="lineno"> 2656</span>                                 + ifdelta_e_err[m] * ifdelta_e_err[m]) </div>
+<div class="line"><a name="l02657"></a><span class="lineno"> 2657</span>                                / nscience / nscience;</div>
+<div class="line"><a name="l02658"></a><span class="lineno"> 2658</span>                 }</div>
+<div class="line"><a name="l02659"></a><span class="lineno"> 2659</span> </div>
+<div class="line"><a name="l02660"></a><span class="lineno"> 2660</span>                 <span class="comment">/* Now P_U */</span></div>
+<div class="line"><a name="l02661"></a><span class="lineno"> 2661</span> </div>
+<div class="line"><a name="l02662"></a><span class="lineno"> 2662</span>                 pos   = fors_find_angle_pos(angles, nscience, 90 * k + 22.5);</div>
+<div class="line"><a name="l02663"></a><span class="lineno"> 2663</span>                 pos_d = fors_find_angle_pos(angles, nscience, 90 * k + 67.5);</div>
+<div class="line"><a name="l02664"></a><span class="lineno"> 2664</span> </div>
+<div class="line"><a name="l02665"></a><span class="lineno"> 2665</span>                 data = cpl_image_get_data_float(reduceds[pos]);</div>
+<div class="line"><a name="l02666"></a><span class="lineno"> 2666</span> </div>
+<div class="line"><a name="l02667"></a><span class="lineno"> 2667</span>                 if_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l02668"></a><span class="lineno"> 2668</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02669"></a><span class="lineno"> 2669</span> </div>
+<div class="line"><a name="l02670"></a><span class="lineno"> 2670</span>                 if_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02671"></a><span class="lineno"> 2671</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02672"></a><span class="lineno"> 2672</span> </div>
+<div class="line"><a name="l02673"></a><span class="lineno"> 2673</span>                 data = cpl_image_get_data_float(reduceds[pos_d]);</div>
+<div class="line"><a name="l02674"></a><span class="lineno"> 2674</span> </div>
+<div class="line"><a name="l02675"></a><span class="lineno"> 2675</span>                 ifdelta_o = data + (2 * (nobjects - total) + nobjs_per_slit[p] </div>
+<div class="line"><a name="l02676"></a><span class="lineno"> 2676</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02677"></a><span class="lineno"> 2677</span> </div>
+<div class="line"><a name="l02678"></a><span class="lineno"> 2678</span>                 ifdelta_e = data + (2 * (nobjects - total) </div>
+<div class="line"><a name="l02679"></a><span class="lineno"> 2679</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02680"></a><span class="lineno"> 2680</span> </div>
+<div class="line"><a name="l02681"></a><span class="lineno"> 2681</span>                 data = cpl_image_get_data_float(rerrors[pos]);</div>
+<div class="line"><a name="l02682"></a><span class="lineno"> 2682</span> </div>
+<div class="line"><a name="l02683"></a><span class="lineno"> 2683</span>                 if_o_err = data + (2 * (nobjects - total) + nobjs_per_slit[p]</div>
+<div class="line"><a name="l02684"></a><span class="lineno"> 2684</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02685"></a><span class="lineno"> 2685</span> </div>
+<div class="line"><a name="l02686"></a><span class="lineno"> 2686</span>                 if_e_err = data + (2 * (nobjects - total)</div>
+<div class="line"><a name="l02687"></a><span class="lineno"> 2687</span>                                + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02688"></a><span class="lineno"> 2688</span> </div>
+<div class="line"><a name="l02689"></a><span class="lineno"> 2689</span>                 data = cpl_image_get_data_float(rerrors[pos_d]);</div>
+<div class="line"><a name="l02690"></a><span class="lineno"> 2690</span> </div>
+<div class="line"><a name="l02691"></a><span class="lineno"> 2691</span>                 ifdelta_o_err = data + (2 * (nobjects - total)</div>
+<div class="line"><a name="l02692"></a><span class="lineno"> 2692</span>                               + nobjs_per_slit[p] + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02693"></a><span class="lineno"> 2693</span> </div>
+<div class="line"><a name="l02694"></a><span class="lineno"> 2694</span>                 ifdelta_e_err = data + (2 * (nobjects - total)</div>
+<div class="line"><a name="l02695"></a><span class="lineno"> 2695</span>                               + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02696"></a><span class="lineno"> 2696</span> </div>
+<div class="line"><a name="l02697"></a><span class="lineno"> 2697</span>                 <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l02698"></a><span class="lineno"> 2698</span> </div>
+<div class="line"><a name="l02699"></a><span class="lineno"> 2699</span>                     <span class="keywordtype">double</span> quantity = fabs(if_o[m] + if_e[m]) < FLT_MIN ? 0.0 :</div>
+<div class="line"><a name="l02700"></a><span class="lineno"> 2700</span>                         (if_o[m]      - if_e[m]     ) /</div>
+<div class="line"><a name="l02701"></a><span class="lineno"> 2701</span>                         (if_o[m]      + if_e[m]     ) -</div>
+<div class="line"><a name="l02702"></a><span class="lineno"> 2702</span>                         (ifdelta_o[m] - ifdelta_e[m]) /</div>
+<div class="line"><a name="l02703"></a><span class="lineno"> 2703</span>                         (ifdelta_o[m] + ifdelta_e[m]);</div>
+<div class="line"><a name="l02704"></a><span class="lineno"> 2704</span> </div>
+<div class="line"><a name="l02705"></a><span class="lineno"> 2705</span>                     quantity = isfinite(quantity) ? quantity : 0.0;</div>
+<div class="line"><a name="l02706"></a><span class="lineno"> 2706</span> </div>
+<div class="line"><a name="l02707"></a><span class="lineno"> 2707</span>                     <span class="comment">/* PU map computation */</span></div>
+<div class="line"><a name="l02708"></a><span class="lineno"> 2708</span>                     ip_u[m] += quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02709"></a><span class="lineno"> 2709</span> </div>
+<div class="line"><a name="l02710"></a><span class="lineno"> 2710</span>                     <span class="comment">/* PUnull map computation */</span></div>
+<div class="line"><a name="l02711"></a><span class="lineno"> 2711</span>                     <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02712"></a><span class="lineno"> 2712</span>                         <span class="keywordflow">if</span> (k % 2)</div>
+<div class="line"><a name="l02713"></a><span class="lineno"> 2713</span>                             ip_unull[m] += quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02714"></a><span class="lineno"> 2714</span>                         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l02715"></a><span class="lineno"> 2715</span>                             ip_unull[m] -= quantity * 0.5 / (nscience / 4);</div>
+<div class="line"><a name="l02716"></a><span class="lineno"> 2716</span>                     }</div>
+<div class="line"><a name="l02717"></a><span class="lineno"> 2717</span> </div>
+<div class="line"><a name="l02718"></a><span class="lineno"> 2718</span>                     <span class="comment">/* I map computation */</span></div>
+<div class="line"><a name="l02719"></a><span class="lineno"> 2719</span>                     ip_i[m] += (if_o[m] + if_e[m] +</div>
+<div class="line"><a name="l02720"></a><span class="lineno"> 2720</span>                                 ifdelta_o[m] + ifdelta_e[m]) / nscience;</div>
+<div class="line"><a name="l02721"></a><span class="lineno"> 2721</span> </div>
+<div class="line"><a name="l02722"></a><span class="lineno"> 2722</span>                     <span class="comment">/* Variance map computation */</span></div>
+<div class="line"><a name="l02723"></a><span class="lineno"> 2723</span>                     ipierr[m] += (if_o_err[m]      * if_o_err[m]</div>
+<div class="line"><a name="l02724"></a><span class="lineno"> 2724</span>                                 + if_e_err[m]      * if_e_err[m]</div>
+<div class="line"><a name="l02725"></a><span class="lineno"> 2725</span>                                 + ifdelta_o_err[m] * ifdelta_o_err[m]</div>
+<div class="line"><a name="l02726"></a><span class="lineno"> 2726</span>                                 + ifdelta_e_err[m] * ifdelta_e_err[m]) </div>
+<div class="line"><a name="l02727"></a><span class="lineno"> 2727</span>                                / nscience / nscience;</div>
+<div class="line"><a name="l02728"></a><span class="lineno"> 2728</span>                 }</div>
+<div class="line"><a name="l02729"></a><span class="lineno"> 2729</span>             }</div>
+<div class="line"><a name="l02730"></a><span class="lineno"> 2730</span> </div>
+<div class="line"><a name="l02731"></a><span class="lineno"> 2731</span>             <span class="comment">/* Error map */</span></div>
+<div class="line"><a name="l02732"></a><span class="lineno"> 2732</span> </div>
+<div class="line"><a name="l02733"></a><span class="lineno"> 2733</span>             pos   = fors_find_angle_pos(angles, nscience, 0.0);</div>
+<div class="line"><a name="l02734"></a><span class="lineno"> 2734</span> </div>
+<div class="line"><a name="l02735"></a><span class="lineno"> 2735</span>             data = cpl_image_get_data_float(reduceds[pos]);</div>
+<div class="line"><a name="l02736"></a><span class="lineno"> 2736</span>             iffq = data + (2 * (nobjects - total) + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02737"></a><span class="lineno"> 2737</span> </div>
+<div class="line"><a name="l02738"></a><span class="lineno"> 2738</span>             data = cpl_image_get_data_float(rerrors[pos]);</div>
+<div class="line"><a name="l02739"></a><span class="lineno"> 2739</span>             ierrq = data + (2 * (nobjects - total) + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02740"></a><span class="lineno"> 2740</span>             </div>
+<div class="line"><a name="l02741"></a><span class="lineno"> 2741</span>             pos   = fors_find_angle_pos(angles, nscience, 22.5);</div>
+<div class="line"><a name="l02742"></a><span class="lineno"> 2742</span> </div>
+<div class="line"><a name="l02743"></a><span class="lineno"> 2743</span>             data = cpl_image_get_data_float(reduceds[pos]);</div>
+<div class="line"><a name="l02744"></a><span class="lineno"> 2744</span>             iffu = data + (2 * (nobjects - total) + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02745"></a><span class="lineno"> 2745</span> </div>
+<div class="line"><a name="l02746"></a><span class="lineno"> 2746</span>             data = cpl_image_get_data_float(rerrors[pos]);</div>
+<div class="line"><a name="l02747"></a><span class="lineno"> 2747</span>             ierru = data + (2 * (nobjects - total) + (total - j - 1)) * nx;</div>
+<div class="line"><a name="l02748"></a><span class="lineno"> 2748</span> </div>
+<div class="line"><a name="l02749"></a><span class="lineno"> 2749</span>             <span class="keywordflow">for</span> (m = 0; m < nx; m++) {</div>
+<div class="line"><a name="l02750"></a><span class="lineno"> 2750</span> </div>
+<div class="line"><a name="l02751"></a><span class="lineno"> 2751</span>                 <span class="keywordtype">double</span> radicand; </div>
+<div class="line"><a name="l02752"></a><span class="lineno"> 2752</span> </div>
+<div class="line"><a name="l02753"></a><span class="lineno"> 2753</span>                 ipqerr[m] = iffq[m] <= 0.0 ? </div>
+<div class="line"><a name="l02754"></a><span class="lineno"> 2754</span>                     0.0 : ierrq[m] / iffq[m] * 0.5 / sqrt (nscience / 4);</div>
+<div class="line"><a name="l02755"></a><span class="lineno"> 2755</span> </div>
+<div class="line"><a name="l02756"></a><span class="lineno"> 2756</span>                 ipuerr[m] = iffu[m] <= 0.0 ? </div>
+<div class="line"><a name="l02757"></a><span class="lineno"> 2757</span>                     0.0 : ierru[m] / iffu[m] * 0.5 / sqrt (nscience / 4);</div>
+<div class="line"><a name="l02758"></a><span class="lineno"> 2758</span> </div>
+<div class="line"><a name="l02759"></a><span class="lineno"> 2759</span>                 iplerr[m] = 0.5 * (ipqerr[m] + ipuerr[m]);</div>
+<div class="line"><a name="l02760"></a><span class="lineno"> 2760</span> </div>
+<div class="line"><a name="l02761"></a><span class="lineno"> 2761</span>                 <span class="comment">/* PL computation */</span></div>
+<div class="line"><a name="l02762"></a><span class="lineno"> 2762</span>                 ip_l[m] = sqrt(ip_u[m] * ip_u[m] + ip_q[m] * ip_q[m]);</div>
+<div class="line"><a name="l02763"></a><span class="lineno"> 2763</span> </div>
+<div class="line"><a name="l02764"></a><span class="lineno"> 2764</span>                 <span class="comment">/* P angle computation */</span></div>
+<div class="line"><a name="l02765"></a><span class="lineno"> 2765</span>                 <span class="keywordflow">if</span> (fabs(ip_q[m]) < 0.00001) {</div>
+<div class="line"><a name="l02766"></a><span class="lineno"> 2766</span>                     <span class="keywordflow">if</span> (ip_u[m] > 0.0) {</div>
+<div class="line"><a name="l02767"></a><span class="lineno"> 2767</span>                         ipang[m] = 45.0;</div>
+<div class="line"><a name="l02768"></a><span class="lineno"> 2768</span>                     }</div>
+<div class="line"><a name="l02769"></a><span class="lineno"> 2769</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02770"></a><span class="lineno"> 2770</span>                         ipang[m] = 135.0;</div>
+<div class="line"><a name="l02771"></a><span class="lineno"> 2771</span>                     }</div>
+<div class="line"><a name="l02772"></a><span class="lineno"> 2772</span>                 }</div>
+<div class="line"><a name="l02773"></a><span class="lineno"> 2773</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02774"></a><span class="lineno"> 2774</span>                     ipang[m] = 0.5 * atan(ip_u[m] / ip_q[m]) * 180 / M_PI;</div>
+<div class="line"><a name="l02775"></a><span class="lineno"> 2775</span>                     <span class="keywordflow">if</span> (ip_q[m] > 0.0) {</div>
+<div class="line"><a name="l02776"></a><span class="lineno"> 2776</span>                         <span class="keywordflow">if</span> (ip_u[m] < 0.0) {</div>
+<div class="line"><a name="l02777"></a><span class="lineno"> 2777</span>                             ipang[m] += 180.;</div>
+<div class="line"><a name="l02778"></a><span class="lineno"> 2778</span>                         }</div>
+<div class="line"><a name="l02779"></a><span class="lineno"> 2779</span>                     }</div>
+<div class="line"><a name="l02780"></a><span class="lineno"> 2780</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02781"></a><span class="lineno"> 2781</span>                         ipang[m] += 90.;</div>
+<div class="line"><a name="l02782"></a><span class="lineno"> 2782</span>                     }</div>
+<div class="line"><a name="l02783"></a><span class="lineno"> 2783</span>                 }</div>
+<div class="line"><a name="l02784"></a><span class="lineno"> 2784</span> </div>
+<div class="line"><a name="l02785"></a><span class="lineno"> 2785</span>                 <span class="comment">/* Error on the angle computation */</span></div>
+<div class="line"><a name="l02786"></a><span class="lineno"> 2786</span>                 radicand = ip_q[m] * ip_q[m] * ipuerr[m] * ipuerr[m] + </div>
+<div class="line"><a name="l02787"></a><span class="lineno"> 2787</span>                            ip_u[m] * ip_u[m] * ipqerr[m] * ipqerr[m];</div>
+<div class="line"><a name="l02788"></a><span class="lineno"> 2788</span>   </div>
+<div class="line"><a name="l02789"></a><span class="lineno"> 2789</span>                 ipangerr[m] = (ip_l[m] == 0.0 ? 0.0 :</div>
+<div class="line"><a name="l02790"></a><span class="lineno"> 2790</span>                      sqrt(radicand) * 0.5 / (ip_l[m] * ip_l[m]) * 180 / M_PI);</div>
+<div class="line"><a name="l02791"></a><span class="lineno"> 2791</span> </div>
+<div class="line"><a name="l02792"></a><span class="lineno"> 2792</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l02793"></a><span class="lineno"> 2793</span> <span class="comment">                 * This is a quick and dirty patch for FORS2 had the</span></div>
+<div class="line"><a name="l02794"></a><span class="lineno"> 2794</span> <span class="comment">                 * Wolly mounted +180 with respect to FORS1. I must</span></div>
+<div class="line"><a name="l02795"></a><span class="lineno"> 2795</span> <span class="comment">                 * hardcode it, because there is no such info in the </span></div>
+<div class="line"><a name="l02796"></a><span class="lineno"> 2796</span> <span class="comment">                 * header.</span></div>
+<div class="line"><a name="l02797"></a><span class="lineno"> 2797</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l02798"></a><span class="lineno"> 2798</span> </div>
+<div class="line"><a name="l02799"></a><span class="lineno"> 2799</span>                 <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>) {</div>
+<div class="line"><a name="l02800"></a><span class="lineno"> 2800</span> </div>
+<div class="line"><a name="l02801"></a><span class="lineno"> 2801</span>                     <span class="keywordtype">double</span> w_rotation = - wollaston * M_PI / 2;</div>
+<div class="line"><a name="l02802"></a><span class="lineno"> 2802</span> </div>
+<div class="line"><a name="l02803"></a><span class="lineno"> 2803</span>                     ipang[m] -= w_rotation * 180 / M_PI;</div>
+<div class="line"><a name="l02804"></a><span class="lineno"> 2804</span> </div>
+<div class="line"><a name="l02805"></a><span class="lineno"> 2805</span>                     ip_q[m] = ip_q[m] * cos(2 * w_rotation)</div>
+<div class="line"><a name="l02806"></a><span class="lineno"> 2806</span>                             + ip_u[m] * sin(2 * w_rotation);</div>
+<div class="line"><a name="l02807"></a><span class="lineno"> 2807</span> </div>
+<div class="line"><a name="l02808"></a><span class="lineno"> 2808</span>                     ip_u[m] = ip_u[m] * cos(2 * w_rotation)</div>
+<div class="line"><a name="l02809"></a><span class="lineno"> 2809</span>                             - ip_q[m] * sin(2 * w_rotation);</div>
+<div class="line"><a name="l02810"></a><span class="lineno"> 2810</span>                 }</div>
+<div class="line"><a name="l02811"></a><span class="lineno"> 2811</span> </div>
+<div class="line"><a name="l02812"></a><span class="lineno"> 2812</span>                 <span class="keywordflow">if</span> (chromatism) {</div>
+<div class="line"><a name="l02813"></a><span class="lineno"> 2813</span>                     ipang[m] -= correct[m] * 180 / M_PI;</div>
+<div class="line"><a name="l02814"></a><span class="lineno"> 2814</span> </div>
+<div class="line"><a name="l02815"></a><span class="lineno"> 2815</span>                     ip_q[m] = ip_q[m] * cos(2 * correct[m])</div>
+<div class="line"><a name="l02816"></a><span class="lineno"> 2816</span>                             + ip_u[m] * sin(2 * correct[m]);</div>
+<div class="line"><a name="l02817"></a><span class="lineno"> 2817</span>     </div>
+<div class="line"><a name="l02818"></a><span class="lineno"> 2818</span>                     ip_u[m] = ip_u[m] * cos(2 * correct[m])</div>
+<div class="line"><a name="l02819"></a><span class="lineno"> 2819</span>                             - ip_q[m] * sin(2 * correct[m]);</div>
+<div class="line"><a name="l02820"></a><span class="lineno"> 2820</span>                 }</div>
+<div class="line"><a name="l02821"></a><span class="lineno"> 2821</span> </div>
+<div class="line"><a name="l02822"></a><span class="lineno"> 2822</span>                 <span class="keywordflow">if</span> (ipang[m] < 0.0)</div>
+<div class="line"><a name="l02823"></a><span class="lineno"> 2823</span>                     ipang[m] += 180.;</div>
+<div class="line"><a name="l02824"></a><span class="lineno"> 2824</span>                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ipang[m] >= 180.0)</div>
+<div class="line"><a name="l02825"></a><span class="lineno"> 2825</span>                     ipang[m] -= 180.;</div>
+<div class="line"><a name="l02826"></a><span class="lineno"> 2826</span>             }</div>
+<div class="line"><a name="l02827"></a><span class="lineno"> 2827</span> </div>
+<div class="line"><a name="l02828"></a><span class="lineno"> 2828</span>             <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l02829"></a><span class="lineno"> 2829</span>                 <span class="keywordtype">float</span> * weights;</div>
+<div class="line"><a name="l02830"></a><span class="lineno"> 2830</span>                 <span class="keywordtype">float</span>   max, sum, sum2, imean;</div>
+<div class="line"><a name="l02831"></a><span class="lineno"> 2831</span> </div>
+<div class="line"><a name="l02832"></a><span class="lineno"> 2832</span>                 <span class="keywordtype">int</span> k;</div>
+<div class="line"><a name="l02833"></a><span class="lineno"> 2833</span> </div>
+<div class="line"><a name="l02834"></a><span class="lineno"> 2834</span>                 <span class="comment">/* QC on Q NULL */</span></div>
+<div class="line"><a name="l02835"></a><span class="lineno"> 2835</span>                 weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);</div>
+<div class="line"><a name="l02836"></a><span class="lineno"> 2836</span> </div>
+<div class="line"><a name="l02837"></a><span class="lineno"> 2837</span>                 max = 0.0;</div>
+<div class="line"><a name="l02838"></a><span class="lineno"> 2838</span>                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02839"></a><span class="lineno"> 2839</span>                     <span class="keywordflow">if</span> (max < iffq[k]) max = iffq[k];</div>
+<div class="line"><a name="l02840"></a><span class="lineno"> 2840</span>                 }</div>
+<div class="line"><a name="l02841"></a><span class="lineno"> 2841</span>             </div>
+<div class="line"><a name="l02842"></a><span class="lineno"> 2842</span>                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02843"></a><span class="lineno"> 2843</span>                     weights[k] = iffq[k] < 0.0 ? </div>
+<div class="line"><a name="l02844"></a><span class="lineno"> 2844</span>                         0.0 : iffq[k] * iffq[k] / (max * max);</div>
+<div class="line"><a name="l02845"></a><span class="lineno"> 2845</span>                 }</div>
+<div class="line"><a name="l02846"></a><span class="lineno"> 2846</span>             </div>
+<div class="line"><a name="l02847"></a><span class="lineno"> 2847</span>                 sum  = 0.0;</div>
+<div class="line"><a name="l02848"></a><span class="lineno"> 2848</span>                 sum2 = 0.0;</div>
+<div class="line"><a name="l02849"></a><span class="lineno"> 2849</span>                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02850"></a><span class="lineno"> 2850</span>                     sum  += weights[k] * ip_qnull[k];</div>
+<div class="line"><a name="l02851"></a><span class="lineno"> 2851</span>                     sum2 += weights[k];</div>
+<div class="line"><a name="l02852"></a><span class="lineno"> 2852</span>                 }</div>
+<div class="line"><a name="l02853"></a><span class="lineno"> 2853</span> </div>
+<div class="line"><a name="l02854"></a><span class="lineno"> 2854</span>                 cpl_free(weights);</div>
+<div class="line"><a name="l02855"></a><span class="lineno"> 2855</span> </div>
+<div class="line"><a name="l02856"></a><span class="lineno"> 2856</span>                 imean = sum / sum2;</div>
+<div class="line"><a name="l02857"></a><span class="lineno"> 2857</span> </div>
+<div class="line"><a name="l02858"></a><span class="lineno"> 2858</span>                 mean_qnull += (imean - mean_qnull) / (j + 1.0);</div>
+<div class="line"><a name="l02859"></a><span class="lineno"> 2859</span>                   </div>
+<div class="line"><a name="l02860"></a><span class="lineno"> 2860</span>                 <span class="comment">/* QC on U NULL */</span></div>
+<div class="line"><a name="l02861"></a><span class="lineno"> 2861</span>                 weights = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * nx);</div>
+<div class="line"><a name="l02862"></a><span class="lineno"> 2862</span>             </div>
+<div class="line"><a name="l02863"></a><span class="lineno"> 2863</span>                 max = 0.0;</div>
+<div class="line"><a name="l02864"></a><span class="lineno"> 2864</span>                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02865"></a><span class="lineno"> 2865</span>                     <span class="keywordflow">if</span> (max < iffu[k]) max = iffu[k];</div>
+<div class="line"><a name="l02866"></a><span class="lineno"> 2866</span>                 }</div>
+<div class="line"><a name="l02867"></a><span class="lineno"> 2867</span>             </div>
+<div class="line"><a name="l02868"></a><span class="lineno"> 2868</span>                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02869"></a><span class="lineno"> 2869</span>                     weights[k] = iffu[k] < 0.0 ? </div>
+<div class="line"><a name="l02870"></a><span class="lineno"> 2870</span>                         0.0 : iffu[k] * iffu[k] / (max * max);</div>
+<div class="line"><a name="l02871"></a><span class="lineno"> 2871</span>                 }</div>
+<div class="line"><a name="l02872"></a><span class="lineno"> 2872</span>             </div>
+<div class="line"><a name="l02873"></a><span class="lineno"> 2873</span>                 sum  = 0.0;</div>
+<div class="line"><a name="l02874"></a><span class="lineno"> 2874</span>                 sum2 = 0.0;</div>
+<div class="line"><a name="l02875"></a><span class="lineno"> 2875</span>                 <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l02876"></a><span class="lineno"> 2876</span>                     sum  += weights[k] * ip_unull[k];</div>
+<div class="line"><a name="l02877"></a><span class="lineno"> 2877</span>                     sum2 += weights[k];</div>
+<div class="line"><a name="l02878"></a><span class="lineno"> 2878</span>                 }</div>
+<div class="line"><a name="l02879"></a><span class="lineno"> 2879</span> </div>
+<div class="line"><a name="l02880"></a><span class="lineno"> 2880</span>                 cpl_free(weights);</div>
+<div class="line"><a name="l02881"></a><span class="lineno"> 2881</span> </div>
+<div class="line"><a name="l02882"></a><span class="lineno"> 2882</span>                 imean = sum / sum2;</div>
+<div class="line"><a name="l02883"></a><span class="lineno"> 2883</span> </div>
+<div class="line"><a name="l02884"></a><span class="lineno"> 2884</span>                 mean_unull += (imean - mean_unull) / (j + 1.0);</div>
+<div class="line"><a name="l02885"></a><span class="lineno"> 2885</span>             }</div>
+<div class="line"><a name="l02886"></a><span class="lineno"> 2886</span>         }</div>
+<div class="line"><a name="l02887"></a><span class="lineno"> 2887</span> </div>
+<div class="line"><a name="l02888"></a><span class="lineno"> 2888</span>         cpl_image_delete(correct_im);</div>
+<div class="line"><a name="l02889"></a><span class="lineno"> 2889</span> </div>
+<div class="line"><a name="l02890"></a><span class="lineno"> 2890</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pq_im, reduced_q_tag, header, </div>
+<div class="line"><a name="l02891"></a><span class="lineno"> 2891</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l02892"></a><span class="lineno"> 2892</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l02893"></a><span class="lineno"> 2893</span> </div>
+<div class="line"><a name="l02894"></a><span class="lineno"> 2894</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pu_im, reduced_u_tag, header, </div>
+<div class="line"><a name="l02895"></a><span class="lineno"> 2895</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l02896"></a><span class="lineno"> 2896</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l02897"></a><span class="lineno"> 2897</span> </div>
+<div class="line"><a name="l02898"></a><span class="lineno"> 2898</span>         <span class="keywordflow">if</span> (qc && standard) {</div>
+<div class="line"><a name="l02899"></a><span class="lineno"> 2899</span>             cpl_table *polsta = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, std_pmos_table_tag, 1);</div>
+<div class="line"><a name="l02900"></a><span class="lineno"> 2900</span>             cpl_propertylist *qheader = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset,</div>
+<div class="line"><a name="l02901"></a><span class="lineno"> 2901</span>                                                         science_tag, 0);</div>
+<div class="line"><a name="l02902"></a><span class="lineno"> 2902</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l02903"></a><span class="lineno"> 2903</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l02904"></a><span class="lineno"> 2904</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>,</div>
+<div class="line"><a name="l02905"></a><span class="lineno"> 2905</span>                                    startwavelength + (dispersion * group)/2);</div>
+<div class="line"><a name="l02906"></a><span class="lineno"> 2906</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l02907"></a><span class="lineno"> 2907</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>,</div>
+<div class="line"><a name="l02908"></a><span class="lineno"> 2908</span>                                            dispersion * group);</div>
+<div class="line"><a name="l02909"></a><span class="lineno"> 2909</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l02910"></a><span class="lineno"> 2910</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l02911"></a><span class="lineno"> 2911</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l02912"></a><span class="lineno"> 2912</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l02913"></a><span class="lineno"> 2913</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l02914"></a><span class="lineno"> 2914</span> </div>
+<div class="line"><a name="l02915"></a><span class="lineno"> 2915</span>             <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gae97d35cc8cb29cbb0b43d4fc84e4d34b" title="Estimate linear polarisation parameters on spectral interval.">mos_check_polarisation</a>(pq_im, pqerr_im, pu_im, puerr_im,</div>
+<div class="line"><a name="l02916"></a><span class="lineno"> 2916</span>                                        startwavelength, dispersion, 1000.,</div>
+<div class="line"><a name="l02917"></a><span class="lineno"> 2917</span>                                        polsta, ra, dec, &filter,</div>
+<div class="line"><a name="l02918"></a><span class="lineno"> 2918</span>                                        &polarised,</div>
+<div class="line"><a name="l02919"></a><span class="lineno"> 2919</span>                                        &qc_pl, &qc_pl_err, </div>
+<div class="line"><a name="l02920"></a><span class="lineno"> 2920</span>                                        &qc_angle, &qc_angle_err)) {</div>
+<div class="line"><a name="l02921"></a><span class="lineno"> 2921</span>                 cpl_msg_warning(cpl_func, <span class="stringliteral">"No QC can be computed"</span>);</div>
+<div class="line"><a name="l02922"></a><span class="lineno"> 2922</span>             }</div>
+<div class="line"><a name="l02923"></a><span class="lineno"> 2923</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02924"></a><span class="lineno"> 2924</span>                 <span class="keywordtype">char</span> *pipefile;</div>
+<div class="line"><a name="l02925"></a><span class="lineno"> 2925</span>                 <span class="keywordtype">char</span> *keyname;</div>
+<div class="line"><a name="l02926"></a><span class="lineno"> 2926</span>                 <span class="keywordtype">char</span> *text;</div>
+<div class="line"><a name="l02927"></a><span class="lineno"> 2927</span>                 <span class="keywordtype">char</span>  band[] = {<span class="charliteral">' '</span>, <span class="charliteral">'\0'</span>};</div>
+<div class="line"><a name="l02928"></a><span class="lineno"> 2928</span> </div>
+<div class="line"><a name="l02929"></a><span class="lineno"> 2929</span>                 <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);</div>
+<div class="line"><a name="l02930"></a><span class="lineno"> 2930</span> </div>
+<div class="line"><a name="l02931"></a><span class="lineno"> 2931</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l02932"></a><span class="lineno"> 2932</span> <span class="comment">                 * QC1 group header</span></div>
+<div class="line"><a name="l02933"></a><span class="lineno"> 2933</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l02934"></a><span class="lineno"> 2934</span> </div>
+<div class="line"><a name="l02935"></a><span class="lineno"> 2935</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_l_tag,</div>
+<div class="line"><a name="l02936"></a><span class="lineno"> 2936</span>                                          <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l02937"></a><span class="lineno"> 2937</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write product category to "</span></div>
+<div class="line"><a name="l02938"></a><span class="lineno"> 2938</span>                                            <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l02939"></a><span class="lineno"> 2939</span> </div>
+<div class="line"><a name="l02940"></a><span class="lineno"> 2940</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l02941"></a><span class="lineno"> 2941</span>                                            <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l02942"></a><span class="lineno"> 2942</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span></div>
+<div class="line"><a name="l02943"></a><span class="lineno"> 2943</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02944"></a><span class="lineno"> 2944</span> </div>
+<div class="line"><a name="l02945"></a><span class="lineno"> 2945</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l02946"></a><span class="lineno"> 2946</span>                                            <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l02947"></a><span class="lineno"> 2947</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span></div>
+<div class="line"><a name="l02948"></a><span class="lineno"> 2948</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02949"></a><span class="lineno"> 2949</span> </div>
+<div class="line"><a name="l02950"></a><span class="lineno"> 2950</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l02951"></a><span class="lineno"> 2951</span>                                            <span class="stringliteral">"Grism name"</span>, instrume))</div>
+<div class="line"><a name="l02952"></a><span class="lineno"> 2952</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in "</span></div>
+<div class="line"><a name="l02953"></a><span class="lineno"> 2953</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02954"></a><span class="lineno"> 2954</span> </div>
+<div class="line"><a name="l02955"></a><span class="lineno"> 2955</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,</div>
+<div class="line"><a name="l02956"></a><span class="lineno"> 2956</span>                                            <span class="stringliteral">"Grism identifier"</span>, instrume))</div>
+<div class="line"><a name="l02957"></a><span class="lineno"> 2957</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in "</span></div>
+<div class="line"><a name="l02958"></a><span class="lineno"> 2958</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02959"></a><span class="lineno"> 2959</span> </div>
+<div class="line"><a name="l02960"></a><span class="lineno"> 2960</span>                 <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))</div>
+<div class="line"><a name="l02961"></a><span class="lineno"> 2961</span>                     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l02962"></a><span class="lineno"> 2962</span>                                            <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l02963"></a><span class="lineno"> 2963</span> </div>
+<div class="line"><a name="l02964"></a><span class="lineno"> 2964</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,</div>
+<div class="line"><a name="l02965"></a><span class="lineno"> 2965</span>                                            <span class="stringliteral">"Collimator name"</span>, instrume))</div>
+<div class="line"><a name="l02966"></a><span class="lineno"> 2966</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in "</span></div>
+<div class="line"><a name="l02967"></a><span class="lineno"> 2967</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02968"></a><span class="lineno"> 2968</span> </div>
+<div class="line"><a name="l02969"></a><span class="lineno"> 2969</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l02970"></a><span class="lineno"> 2970</span>                                            <span class="stringliteral">"Chip identifier"</span>, instrume))</div>
+<div class="line"><a name="l02971"></a><span class="lineno"> 2971</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in "</span></div>
+<div class="line"><a name="l02972"></a><span class="lineno"> 2972</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02973"></a><span class="lineno"> 2973</span> </div>
+<div class="line"><a name="l02974"></a><span class="lineno"> 2974</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l02975"></a><span class="lineno"> 2975</span>                                            <span class="stringliteral">"Archive name of input data"</span>,</div>
+<div class="line"><a name="l02976"></a><span class="lineno"> 2976</span>                                            instrume))</div>
+<div class="line"><a name="l02977"></a><span class="lineno"> 2977</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span></div>
+<div class="line"><a name="l02978"></a><span class="lineno"> 2978</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02979"></a><span class="lineno"> 2979</span> </div>
+<div class="line"><a name="l02980"></a><span class="lineno"> 2980</span>                 pipefile = dfs_generate_filename_tfits(reduced_nul_q_tag);</div>
+<div class="line"><a name="l02981"></a><span class="lineno"> 2981</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l02982"></a><span class="lineno"> 2982</span>                                          <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l02983"></a><span class="lineno"> 2983</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span></div>
+<div class="line"><a name="l02984"></a><span class="lineno"> 2984</span>                                            <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l02985"></a><span class="lineno"> 2985</span>                 cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l02986"></a><span class="lineno"> 2986</span> </div>
+<div class="line"><a name="l02987"></a><span class="lineno"> 2987</span> </div>
+<div class="line"><a name="l02988"></a><span class="lineno"> 2988</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l02989"></a><span class="lineno"> 2989</span> <span class="comment">                 * QC1 parameters</span></div>
+<div class="line"><a name="l02990"></a><span class="lineno"> 2990</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l02991"></a><span class="lineno"> 2991</span> </div>
+<div class="line"><a name="l02992"></a><span class="lineno"> 2992</span>                 keyname = <span class="stringliteral">"QC.PMOS.BAND"</span>;</div>
+<div class="line"><a name="l02993"></a><span class="lineno"> 2993</span> </div>
+<div class="line"><a name="l02994"></a><span class="lineno"> 2994</span>                 band[0] = filter;</div>
+<div class="line"><a name="l02995"></a><span class="lineno"> 2995</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga47dfe71df58ec7c851d4f3853f9f9b00" title="Write a string value to the active QC1 PAF object and to a header.">fors_qc_write_qc_string</a>(qheader, keyname, band,</div>
+<div class="line"><a name="l02996"></a><span class="lineno"> 2996</span>                                             <span class="stringliteral">"Band where polarisation was "</span></div>
+<div class="line"><a name="l02997"></a><span class="lineno"> 2997</span>                                             <span class="stringliteral">"measured"</span>, instrume)) {</div>
+<div class="line"><a name="l02998"></a><span class="lineno"> 2998</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write QC.PMOS.BAND "</span></div>
+<div class="line"><a name="l02999"></a><span class="lineno"> 2999</span>                                            <span class="stringliteral">"parameter to QC log file"</span>);</div>
+<div class="line"><a name="l03000"></a><span class="lineno"> 3000</span>                 }</div>
+<div class="line"><a name="l03001"></a><span class="lineno"> 3001</span> </div>
+<div class="line"><a name="l03002"></a><span class="lineno"> 3002</span>                 keyname = <span class="stringliteral">"QC.PMOS.POLARISED"</span>;</div>
+<div class="line"><a name="l03003"></a><span class="lineno"> 3003</span> </div>
+<div class="line"><a name="l03004"></a><span class="lineno"> 3004</span>                 <span class="keywordflow">if</span> (fors_qc_write_qc_int(qheader, polarised, keyname, NULL,</div>
+<div class="line"><a name="l03005"></a><span class="lineno"> 3005</span>                                          <span class="stringliteral">"Polarisation is expected (1 = yes, "</span></div>
+<div class="line"><a name="l03006"></a><span class="lineno"> 3006</span>                                          <span class="stringliteral">"0 = no)"</span>, instrume)) {</div>
+<div class="line"><a name="l03007"></a><span class="lineno"> 3007</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write QC.PMOS.POLARISED "</span></div>
+<div class="line"><a name="l03008"></a><span class="lineno"> 3008</span>                                            <span class="stringliteral">"parameter to QC log file"</span>);</div>
+<div class="line"><a name="l03009"></a><span class="lineno"> 3009</span>                 }</div>
+<div class="line"><a name="l03010"></a><span class="lineno"> 3010</span> </div>
+<div class="line"><a name="l03011"></a><span class="lineno"> 3011</span>                 keyname = <span class="stringliteral">"QC.PMOS.L.OFFSET"</span>;</div>
+<div class="line"><a name="l03012"></a><span class="lineno"> 3012</span> </div>
+<div class="line"><a name="l03013"></a><span class="lineno"> 3013</span>                 <span class="keywordflow">if</span> (polarised)</div>
+<div class="line"><a name="l03014"></a><span class="lineno"> 3014</span>                     text = <span class="stringliteral">"Linear polarisation relative offset"</span>;</div>
+<div class="line"><a name="l03015"></a><span class="lineno"> 3015</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l03016"></a><span class="lineno"> 3016</span>                     text = <span class="stringliteral">"Linear polarisation offset"</span>;</div>
+<div class="line"><a name="l03017"></a><span class="lineno"> 3017</span> </div>
+<div class="line"><a name="l03018"></a><span class="lineno"> 3018</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qheader, qc_pl, keyname, NULL,</div>
+<div class="line"><a name="l03019"></a><span class="lineno"> 3019</span>                                             text, instrume)) {</div>
+<div class="line"><a name="l03020"></a><span class="lineno"> 3020</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write linear polarisation "</span></div>
+<div class="line"><a name="l03021"></a><span class="lineno"> 3021</span>                                            <span class="stringliteral">"offset to QC log file"</span>);</div>
+<div class="line"><a name="l03022"></a><span class="lineno"> 3022</span>                 }</div>
+<div class="line"><a name="l03023"></a><span class="lineno"> 3023</span> </div>
+<div class="line"><a name="l03024"></a><span class="lineno"> 3024</span>                 keyname = <span class="stringliteral">"QC.PMOS.L.OFFSETERR"</span>;</div>
+<div class="line"><a name="l03025"></a><span class="lineno"> 3025</span> </div>
+<div class="line"><a name="l03026"></a><span class="lineno"> 3026</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qheader, qc_pl_err, keyname, NULL,</div>
+<div class="line"><a name="l03027"></a><span class="lineno"> 3027</span>                                        <span class="stringliteral">"Error on linear polarisation offset"</span>,</div>
+<div class="line"><a name="l03028"></a><span class="lineno"> 3028</span>                                        instrume)) {</div>
+<div class="line"><a name="l03029"></a><span class="lineno"> 3029</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write linear polarisation "</span></div>
+<div class="line"><a name="l03030"></a><span class="lineno"> 3030</span>                                        <span class="stringliteral">"offset error to QC log file"</span>);</div>
+<div class="line"><a name="l03031"></a><span class="lineno"> 3031</span>                 }</div>
+<div class="line"><a name="l03032"></a><span class="lineno"> 3032</span> </div>
+<div class="line"><a name="l03033"></a><span class="lineno"> 3033</span>                 <span class="keywordflow">if</span> (polarised) {</div>
+<div class="line"><a name="l03034"></a><span class="lineno"> 3034</span>                     keyname = <span class="stringliteral">"QC.PMOS.ANGLE.OFFSET"</span>;</div>
+<div class="line"><a name="l03035"></a><span class="lineno"> 3035</span> </div>
+<div class="line"><a name="l03036"></a><span class="lineno"> 3036</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qheader, qc_angle, keyname, NULL,</div>
+<div class="line"><a name="l03037"></a><span class="lineno"> 3037</span>                                                 <span class="stringliteral">"Polarisation angle offset"</span>,</div>
+<div class="line"><a name="l03038"></a><span class="lineno"> 3038</span>                                                 instrume)) {</div>
+<div class="line"><a name="l03039"></a><span class="lineno"> 3039</span>                         fors_pmos_science_exit(<span class="stringliteral">"Cannot write polarisation "</span></div>
+<div class="line"><a name="l03040"></a><span class="lineno"> 3040</span>                                                <span class="stringliteral">"angle offset to QC log file"</span>);</div>
+<div class="line"><a name="l03041"></a><span class="lineno"> 3041</span>                     }</div>
+<div class="line"><a name="l03042"></a><span class="lineno"> 3042</span> </div>
+<div class="line"><a name="l03043"></a><span class="lineno"> 3043</span>                     keyname = <span class="stringliteral">"QC.PMOS.ANGLE.OFFSETERR"</span>;</div>
+<div class="line"><a name="l03044"></a><span class="lineno"> 3044</span> </div>
+<div class="line"><a name="l03045"></a><span class="lineno"> 3045</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qheader, qc_angle_err, keyname, </div>
+<div class="line"><a name="l03046"></a><span class="lineno"> 3046</span>                                                 NULL, <span class="stringliteral">"Error on polarisation "</span></div>
+<div class="line"><a name="l03047"></a><span class="lineno"> 3047</span>                                                 <span class="stringliteral">"angle offset"</span>, instrume)) {</div>
+<div class="line"><a name="l03048"></a><span class="lineno"> 3048</span>                         fors_pmos_science_exit(<span class="stringliteral">"Cannot write polarisation "</span></div>
+<div class="line"><a name="l03049"></a><span class="lineno"> 3049</span>                                                <span class="stringliteral">"angle offset error to QC "</span></div>
+<div class="line"><a name="l03050"></a><span class="lineno"> 3050</span>                                                <span class="stringliteral">"log file"</span>);</div>
+<div class="line"><a name="l03051"></a><span class="lineno"> 3051</span>                     }</div>
+<div class="line"><a name="l03052"></a><span class="lineno"> 3052</span>                 }</div>
+<div class="line"><a name="l03053"></a><span class="lineno"> 3053</span> </div>
+<div class="line"><a name="l03054"></a><span class="lineno"> 3054</span>                 <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l03055"></a><span class="lineno"> 3055</span>             }</div>
+<div class="line"><a name="l03056"></a><span class="lineno"> 3056</span> </div>
+<div class="line"><a name="l03057"></a><span class="lineno"> 3057</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pl_im, reduced_l_tag, qheader,</div>
+<div class="line"><a name="l03058"></a><span class="lineno"> 3058</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l03059"></a><span class="lineno"> 3059</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03060"></a><span class="lineno"> 3060</span> </div>
+<div class="line"><a name="l03061"></a><span class="lineno"> 3061</span>             cpl_propertylist_delete(qheader);</div>
+<div class="line"><a name="l03062"></a><span class="lineno"> 3062</span>         }</div>
+<div class="line"><a name="l03063"></a><span class="lineno"> 3063</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03064"></a><span class="lineno"> 3064</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pl_im, reduced_l_tag, header, </div>
+<div class="line"><a name="l03065"></a><span class="lineno"> 3065</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l03066"></a><span class="lineno"> 3066</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03067"></a><span class="lineno"> 3067</span>         }</div>
+<div class="line"><a name="l03068"></a><span class="lineno"> 3068</span> </div>
+<div class="line"><a name="l03069"></a><span class="lineno"> 3069</span>         <span class="keywordflow">if</span> (nscience / 4 > 1) {</div>
+<div class="line"><a name="l03070"></a><span class="lineno"> 3070</span>             <span class="keywordtype">char</span> *pipefile; </div>
+<div class="line"><a name="l03071"></a><span class="lineno"> 3071</span>             <span class="keywordtype">char</span> *keyname;</div>
+<div class="line"><a name="l03072"></a><span class="lineno"> 3072</span>             cpl_propertylist *qheader = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, </div>
+<div class="line"><a name="l03073"></a><span class="lineno"> 3073</span>                                                         science_tag, 0);</div>
+<div class="line"><a name="l03074"></a><span class="lineno"> 3074</span> </div>
+<div class="line"><a name="l03075"></a><span class="lineno"> 3075</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l03076"></a><span class="lineno"> 3076</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l03077"></a><span class="lineno"> 3077</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l03078"></a><span class="lineno"> 3078</span>                                    startwavelength + (dispersion * group)/2);</div>
+<div class="line"><a name="l03079"></a><span class="lineno"> 3079</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l03080"></a><span class="lineno"> 3080</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, </div>
+<div class="line"><a name="l03081"></a><span class="lineno"> 3081</span>                                            dispersion * group);</div>
+<div class="line"><a name="l03082"></a><span class="lineno"> 3082</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l03083"></a><span class="lineno"> 3083</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l03084"></a><span class="lineno"> 3084</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l03085"></a><span class="lineno"> 3085</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l03086"></a><span class="lineno"> 3086</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l03087"></a><span class="lineno"> 3087</span> </div>
+<div class="line"><a name="l03088"></a><span class="lineno"> 3088</span>             <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l03089"></a><span class="lineno"> 3089</span>                 <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);</div>
+<div class="line"><a name="l03090"></a><span class="lineno"> 3090</span> </div>
+<div class="line"><a name="l03091"></a><span class="lineno"> 3091</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l03092"></a><span class="lineno"> 3092</span> <span class="comment">                 * QC1 group header</span></div>
+<div class="line"><a name="l03093"></a><span class="lineno"> 3093</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l03094"></a><span class="lineno"> 3094</span> </div>
+<div class="line"><a name="l03095"></a><span class="lineno"> 3095</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_q_tag,</div>
+<div class="line"><a name="l03096"></a><span class="lineno"> 3096</span>                                          <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l03097"></a><span class="lineno"> 3097</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write product category to "</span></div>
+<div class="line"><a name="l03098"></a><span class="lineno"> 3098</span>                                            <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l03099"></a><span class="lineno"> 3099</span> </div>
+<div class="line"><a name="l03100"></a><span class="lineno"> 3100</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l03101"></a><span class="lineno"> 3101</span>                                            <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l03102"></a><span class="lineno"> 3102</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span></div>
+<div class="line"><a name="l03103"></a><span class="lineno"> 3103</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03104"></a><span class="lineno"> 3104</span> </div>
+<div class="line"><a name="l03105"></a><span class="lineno"> 3105</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l03106"></a><span class="lineno"> 3106</span>                                            <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l03107"></a><span class="lineno"> 3107</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span></div>
+<div class="line"><a name="l03108"></a><span class="lineno"> 3108</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03109"></a><span class="lineno"> 3109</span> </div>
+<div class="line"><a name="l03110"></a><span class="lineno"> 3110</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l03111"></a><span class="lineno"> 3111</span>                                            <span class="stringliteral">"Grism name"</span>, instrume))</div>
+<div class="line"><a name="l03112"></a><span class="lineno"> 3112</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in "</span></div>
+<div class="line"><a name="l03113"></a><span class="lineno"> 3113</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03114"></a><span class="lineno"> 3114</span> </div>
+<div class="line"><a name="l03115"></a><span class="lineno"> 3115</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,</div>
+<div class="line"><a name="l03116"></a><span class="lineno"> 3116</span>                                            <span class="stringliteral">"Grism identifier"</span>, instrume))</div>
+<div class="line"><a name="l03117"></a><span class="lineno"> 3117</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in "</span></div>
+<div class="line"><a name="l03118"></a><span class="lineno"> 3118</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03119"></a><span class="lineno"> 3119</span> </div>
+<div class="line"><a name="l03120"></a><span class="lineno"> 3120</span>                 <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))</div>
+<div class="line"><a name="l03121"></a><span class="lineno"> 3121</span>                     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l03122"></a><span class="lineno"> 3122</span>                                            <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l03123"></a><span class="lineno"> 3123</span> </div>
+<div class="line"><a name="l03124"></a><span class="lineno"> 3124</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,</div>
+<div class="line"><a name="l03125"></a><span class="lineno"> 3125</span>                                            <span class="stringliteral">"Collimator name"</span>, instrume))</div>
+<div class="line"><a name="l03126"></a><span class="lineno"> 3126</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in "</span></div>
+<div class="line"><a name="l03127"></a><span class="lineno"> 3127</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03128"></a><span class="lineno"> 3128</span> </div>
+<div class="line"><a name="l03129"></a><span class="lineno"> 3129</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l03130"></a><span class="lineno"> 3130</span>                                            <span class="stringliteral">"Chip identifier"</span>, instrume))</div>
+<div class="line"><a name="l03131"></a><span class="lineno"> 3131</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in "</span></div>
+<div class="line"><a name="l03132"></a><span class="lineno"> 3132</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03133"></a><span class="lineno"> 3133</span> </div>
+<div class="line"><a name="l03134"></a><span class="lineno"> 3134</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l03135"></a><span class="lineno"> 3135</span>                                            <span class="stringliteral">"Archive name of input data"</span>, </div>
+<div class="line"><a name="l03136"></a><span class="lineno"> 3136</span>                                            instrume))</div>
+<div class="line"><a name="l03137"></a><span class="lineno"> 3137</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span></div>
+<div class="line"><a name="l03138"></a><span class="lineno"> 3138</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03139"></a><span class="lineno"> 3139</span> </div>
+<div class="line"><a name="l03140"></a><span class="lineno"> 3140</span>                 pipefile = dfs_generate_filename_tfits(reduced_nul_q_tag);</div>
+<div class="line"><a name="l03141"></a><span class="lineno"> 3141</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l03142"></a><span class="lineno"> 3142</span>                                          <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l03143"></a><span class="lineno"> 3143</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span></div>
+<div class="line"><a name="l03144"></a><span class="lineno"> 3144</span>                                            <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l03145"></a><span class="lineno"> 3145</span>                 cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l03146"></a><span class="lineno"> 3146</span> </div>
+<div class="line"><a name="l03147"></a><span class="lineno"> 3147</span> </div>
+<div class="line"><a name="l03148"></a><span class="lineno"> 3148</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l03149"></a><span class="lineno"> 3149</span> <span class="comment">                 * QC1 parameters</span></div>
+<div class="line"><a name="l03150"></a><span class="lineno"> 3150</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l03151"></a><span class="lineno"> 3151</span> </div>
+<div class="line"><a name="l03152"></a><span class="lineno"> 3152</span>                 keyname = <span class="stringliteral">"QC.NULL.Q.MEAN"</span>;</div>
+<div class="line"><a name="l03153"></a><span class="lineno"> 3153</span>                     </div>
+<div class="line"><a name="l03154"></a><span class="lineno"> 3154</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qheader, mean_qnull,</div>
+<div class="line"><a name="l03155"></a><span class="lineno"> 3155</span>                                             keyname, NULL,</div>
+<div class="line"><a name="l03156"></a><span class="lineno"> 3156</span>                                             <span class="stringliteral">"Mean Q null parameter"</span>,</div>
+<div class="line"><a name="l03157"></a><span class="lineno"> 3157</span>                                             instrume)) {</div>
+<div class="line"><a name="l03158"></a><span class="lineno"> 3158</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write mean Q null "</span></div>
+<div class="line"><a name="l03159"></a><span class="lineno"> 3159</span>                                            <span class="stringliteral">"parameter to QC log file"</span>);</div>
+<div class="line"><a name="l03160"></a><span class="lineno"> 3160</span>                 }</div>
+<div class="line"><a name="l03161"></a><span class="lineno"> 3161</span> </div>
+<div class="line"><a name="l03162"></a><span class="lineno"> 3162</span>                 keyname = <span class="stringliteral">"QC.NANGLES"</span>;</div>
+<div class="line"><a name="l03163"></a><span class="lineno"> 3163</span> </div>
+<div class="line"><a name="l03164"></a><span class="lineno"> 3164</span>                 <span class="keywordflow">if</span> (fors_qc_write_qc_int(qheader, nscience / 2,</div>
+<div class="line"><a name="l03165"></a><span class="lineno"> 3165</span>                                          keyname, NULL,</div>
+<div class="line"><a name="l03166"></a><span class="lineno"> 3166</span>                                          <span class="stringliteral">"Number of processed plate angles"</span>,</div>
+<div class="line"><a name="l03167"></a><span class="lineno"> 3167</span>                                          instrume)) {</div>
+<div class="line"><a name="l03168"></a><span class="lineno"> 3168</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write number of processed "</span></div>
+<div class="line"><a name="l03169"></a><span class="lineno"> 3169</span>                                            <span class="stringliteral">"plate angles."</span>);</div>
+<div class="line"><a name="l03170"></a><span class="lineno"> 3170</span>                 }</div>
+<div class="line"><a name="l03171"></a><span class="lineno"> 3171</span> </div>
+<div class="line"><a name="l03172"></a><span class="lineno"> 3172</span>                 <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l03173"></a><span class="lineno"> 3173</span>             }</div>
+<div class="line"><a name="l03174"></a><span class="lineno"> 3174</span> </div>
+<div class="line"><a name="l03175"></a><span class="lineno"> 3175</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pqnull_im, reduced_nul_q_tag, qheader, </div>
+<div class="line"><a name="l03176"></a><span class="lineno"> 3176</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l03177"></a><span class="lineno"> 3177</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03178"></a><span class="lineno"> 3178</span> </div>
+<div class="line"><a name="l03179"></a><span class="lineno"> 3179</span>             cpl_propertylist_delete(qheader);</div>
+<div class="line"><a name="l03180"></a><span class="lineno"> 3180</span> </div>
+<div class="line"><a name="l03181"></a><span class="lineno"> 3181</span>             qheader = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l03182"></a><span class="lineno"> 3182</span> </div>
+<div class="line"><a name="l03183"></a><span class="lineno"> 3183</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l03184"></a><span class="lineno"> 3184</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l03185"></a><span class="lineno"> 3185</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l03186"></a><span class="lineno"> 3186</span>                                    startwavelength + (dispersion * group)/2);</div>
+<div class="line"><a name="l03187"></a><span class="lineno"> 3187</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l03188"></a><span class="lineno"> 3188</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_1"</span>, </div>
+<div class="line"><a name="l03189"></a><span class="lineno"> 3189</span>                                            dispersion * group);</div>
+<div class="line"><a name="l03190"></a><span class="lineno"> 3190</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l03191"></a><span class="lineno"> 3191</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l03192"></a><span class="lineno"> 3192</span>             cpl_propertylist_update_double(qheader, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l03193"></a><span class="lineno"> 3193</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l03194"></a><span class="lineno"> 3194</span>             cpl_propertylist_update_string(qheader, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l03195"></a><span class="lineno"> 3195</span> </div>
+<div class="line"><a name="l03196"></a><span class="lineno"> 3196</span>             <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l03197"></a><span class="lineno"> 3197</span>                 <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qheader, <span class="stringliteral">"2.0"</span>, instrume);</div>
+<div class="line"><a name="l03198"></a><span class="lineno"> 3198</span> </div>
+<div class="line"><a name="l03199"></a><span class="lineno"> 3199</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l03200"></a><span class="lineno"> 3200</span> <span class="comment">                 * QC1 group header</span></div>
+<div class="line"><a name="l03201"></a><span class="lineno"> 3201</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l03202"></a><span class="lineno"> 3202</span> </div>
+<div class="line"><a name="l03203"></a><span class="lineno"> 3203</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, reduced_nul_u_tag,</div>
+<div class="line"><a name="l03204"></a><span class="lineno"> 3204</span>                                          <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l03205"></a><span class="lineno"> 3205</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write product category to "</span></div>
+<div class="line"><a name="l03206"></a><span class="lineno"> 3206</span>                                          <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l03207"></a><span class="lineno"> 3207</span> </div>
+<div class="line"><a name="l03208"></a><span class="lineno"> 3208</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l03209"></a><span class="lineno"> 3209</span>                                            <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l03210"></a><span class="lineno"> 3210</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span></div>
+<div class="line"><a name="l03211"></a><span class="lineno"> 3211</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03212"></a><span class="lineno"> 3212</span> </div>
+<div class="line"><a name="l03213"></a><span class="lineno"> 3213</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l03214"></a><span class="lineno"> 3214</span>                                            <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l03215"></a><span class="lineno"> 3215</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span></div>
+<div class="line"><a name="l03216"></a><span class="lineno"> 3216</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03217"></a><span class="lineno"> 3217</span> </div>
+<div class="line"><a name="l03218"></a><span class="lineno"> 3218</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l03219"></a><span class="lineno"> 3219</span>                                            <span class="stringliteral">"Grism name"</span>, instrume))</div>
+<div class="line"><a name="l03220"></a><span class="lineno"> 3220</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in "</span></div>
+<div class="line"><a name="l03221"></a><span class="lineno"> 3221</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03222"></a><span class="lineno"> 3222</span> </div>
+<div class="line"><a name="l03223"></a><span class="lineno"> 3223</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,</div>
+<div class="line"><a name="l03224"></a><span class="lineno"> 3224</span>                                            <span class="stringliteral">"Grism identifier"</span>, instrume))</div>
+<div class="line"><a name="l03225"></a><span class="lineno"> 3225</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in "</span></div>
+<div class="line"><a name="l03226"></a><span class="lineno"> 3226</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03227"></a><span class="lineno"> 3227</span> </div>
+<div class="line"><a name="l03228"></a><span class="lineno"> 3228</span>                 <span class="keywordflow">if</span> (cpl_propertylist_has(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))</div>
+<div class="line"><a name="l03229"></a><span class="lineno"> 3229</span>                     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l03230"></a><span class="lineno"> 3230</span>                                            <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l03231"></a><span class="lineno"> 3231</span> </div>
+<div class="line"><a name="l03232"></a><span class="lineno"> 3232</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,</div>
+<div class="line"><a name="l03233"></a><span class="lineno"> 3233</span>                                            <span class="stringliteral">"Collimator name"</span>, instrume))</div>
+<div class="line"><a name="l03234"></a><span class="lineno"> 3234</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in "</span></div>
+<div class="line"><a name="l03235"></a><span class="lineno"> 3235</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03236"></a><span class="lineno"> 3236</span> </div>
+<div class="line"><a name="l03237"></a><span class="lineno"> 3237</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l03238"></a><span class="lineno"> 3238</span>                                            <span class="stringliteral">"Chip identifier"</span>, instrume))</div>
+<div class="line"><a name="l03239"></a><span class="lineno"> 3239</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in "</span></div>
+<div class="line"><a name="l03240"></a><span class="lineno"> 3240</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03241"></a><span class="lineno"> 3241</span> </div>
+<div class="line"><a name="l03242"></a><span class="lineno"> 3242</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qheader, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l03243"></a><span class="lineno"> 3243</span>                                            <span class="stringliteral">"Archive name of input data"</span>, </div>
+<div class="line"><a name="l03244"></a><span class="lineno"> 3244</span>                                            instrume))</div>
+<div class="line"><a name="l03245"></a><span class="lineno"> 3245</span>                     fors_pmos_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span></div>
+<div class="line"><a name="l03246"></a><span class="lineno"> 3246</span>                                            <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l03247"></a><span class="lineno"> 3247</span> </div>
+<div class="line"><a name="l03248"></a><span class="lineno"> 3248</span>                 pipefile = dfs_generate_filename_tfits(reduced_nul_u_tag);</div>
+<div class="line"><a name="l03249"></a><span class="lineno"> 3249</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l03250"></a><span class="lineno"> 3250</span>                                          <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l03251"></a><span class="lineno"> 3251</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span></div>
+<div class="line"><a name="l03252"></a><span class="lineno"> 3252</span>                                            <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l03253"></a><span class="lineno"> 3253</span>                 cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l03254"></a><span class="lineno"> 3254</span> </div>
+<div class="line"><a name="l03255"></a><span class="lineno"> 3255</span> </div>
+<div class="line"><a name="l03256"></a><span class="lineno"> 3256</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l03257"></a><span class="lineno"> 3257</span> <span class="comment">                 * QC1 parameters</span></div>
+<div class="line"><a name="l03258"></a><span class="lineno"> 3258</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l03259"></a><span class="lineno"> 3259</span> </div>
+<div class="line"><a name="l03260"></a><span class="lineno"> 3260</span>                 keyname = <span class="stringliteral">"QC.NULL.U.MEAN"</span>;</div>
+<div class="line"><a name="l03261"></a><span class="lineno"> 3261</span>                     </div>
+<div class="line"><a name="l03262"></a><span class="lineno"> 3262</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qheader, mean_unull,</div>
+<div class="line"><a name="l03263"></a><span class="lineno"> 3263</span>                                             keyname, NULL,</div>
+<div class="line"><a name="l03264"></a><span class="lineno"> 3264</span>                                             <span class="stringliteral">"Mean U null parameter"</span>,</div>
+<div class="line"><a name="l03265"></a><span class="lineno"> 3265</span>                                             instrume)) {</div>
+<div class="line"><a name="l03266"></a><span class="lineno"> 3266</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write mean U null "</span></div>
+<div class="line"><a name="l03267"></a><span class="lineno"> 3267</span>                                            <span class="stringliteral">"parameter to QC log file"</span>);</div>
+<div class="line"><a name="l03268"></a><span class="lineno"> 3268</span>                 }</div>
+<div class="line"><a name="l03269"></a><span class="lineno"> 3269</span> </div>
+<div class="line"><a name="l03270"></a><span class="lineno"> 3270</span>                 keyname = <span class="stringliteral">"QC.NANGLES"</span>;</div>
+<div class="line"><a name="l03271"></a><span class="lineno"> 3271</span> </div>
+<div class="line"><a name="l03272"></a><span class="lineno"> 3272</span>                 <span class="keywordflow">if</span> (fors_qc_write_qc_int(qheader, nscience / 2,</div>
+<div class="line"><a name="l03273"></a><span class="lineno"> 3273</span>                                          keyname, NULL,</div>
+<div class="line"><a name="l03274"></a><span class="lineno"> 3274</span>                                          <span class="stringliteral">"Number of processed plate angles"</span>,</div>
+<div class="line"><a name="l03275"></a><span class="lineno"> 3275</span>                                          instrume)) {</div>
+<div class="line"><a name="l03276"></a><span class="lineno"> 3276</span>                     fors_pmos_science_exit(<span class="stringliteral">"Cannot write number of processed "</span></div>
+<div class="line"><a name="l03277"></a><span class="lineno"> 3277</span>                                            <span class="stringliteral">"plate angles."</span>);</div>
+<div class="line"><a name="l03278"></a><span class="lineno"> 3278</span>                 }</div>
+<div class="line"><a name="l03279"></a><span class="lineno"> 3279</span> </div>
+<div class="line"><a name="l03280"></a><span class="lineno"> 3280</span>                 <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l03281"></a><span class="lineno"> 3281</span>             }</div>
+<div class="line"><a name="l03282"></a><span class="lineno"> 3282</span> </div>
+<div class="line"><a name="l03283"></a><span class="lineno"> 3283</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, punull_im, reduced_nul_u_tag, qheader, </div>
+<div class="line"><a name="l03284"></a><span class="lineno"> 3284</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l03285"></a><span class="lineno"> 3285</span>                 fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03286"></a><span class="lineno"> 3286</span> </div>
+<div class="line"><a name="l03287"></a><span class="lineno"> 3287</span>             cpl_propertylist_delete(qheader);</div>
+<div class="line"><a name="l03288"></a><span class="lineno"> 3288</span>         }</div>
+<div class="line"><a name="l03289"></a><span class="lineno"> 3289</span> </div>
+<div class="line"><a name="l03290"></a><span class="lineno"> 3290</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pqerr_im, reduced_error_q_tag, header, </div>
+<div class="line"><a name="l03291"></a><span class="lineno"> 3291</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l03292"></a><span class="lineno"> 3292</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03293"></a><span class="lineno"> 3293</span> </div>
+<div class="line"><a name="l03294"></a><span class="lineno"> 3294</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, puerr_im, reduced_error_u_tag, header, </div>
+<div class="line"><a name="l03295"></a><span class="lineno"> 3295</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l03296"></a><span class="lineno"> 3296</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03297"></a><span class="lineno"> 3297</span> </div>
+<div class="line"><a name="l03298"></a><span class="lineno"> 3298</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, plerr_im, reduced_error_l_tag, header, </div>
+<div class="line"><a name="l03299"></a><span class="lineno"> 3299</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l03300"></a><span class="lineno"> 3300</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03301"></a><span class="lineno"> 3301</span> </div>
+<div class="line"><a name="l03302"></a><span class="lineno"> 3302</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pang_im, reduced_angle_tag, header, </div>
+<div class="line"><a name="l03303"></a><span class="lineno"> 3303</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l03304"></a><span class="lineno"> 3304</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03305"></a><span class="lineno"> 3305</span> </div>
+<div class="line"><a name="l03306"></a><span class="lineno"> 3306</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pangerr_im, reduced_error_angle_tag, </div>
+<div class="line"><a name="l03307"></a><span class="lineno"> 3307</span>                            header, parlist, recipe, version))</div>
+<div class="line"><a name="l03308"></a><span class="lineno"> 3308</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03309"></a><span class="lineno"> 3309</span> </div>
+<div class="line"><a name="l03310"></a><span class="lineno"> 3310</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pi_im, reduced_i_tag, </div>
+<div class="line"><a name="l03311"></a><span class="lineno"> 3311</span>                            header, parlist, recipe, version))</div>
+<div class="line"><a name="l03312"></a><span class="lineno"> 3312</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03313"></a><span class="lineno"> 3313</span> </div>
+<div class="line"><a name="l03314"></a><span class="lineno"> 3314</span>         cpl_image_power(pierr_im, 0.5);</div>
+<div class="line"><a name="l03315"></a><span class="lineno"> 3315</span> </div>
+<div class="line"><a name="l03316"></a><span class="lineno"> 3316</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, pierr_im, reduced_error_i_tag, </div>
+<div class="line"><a name="l03317"></a><span class="lineno"> 3317</span>                            header, parlist, recipe, version))</div>
+<div class="line"><a name="l03318"></a><span class="lineno"> 3318</span>             fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03319"></a><span class="lineno"> 3319</span> </div>
+<div class="line"><a name="l03320"></a><span class="lineno"> 3320</span> <span class="comment">/* %%% */</span></div>
+<div class="line"><a name="l03321"></a><span class="lineno"> 3321</span> </div>
+<div class="line"><a name="l03322"></a><span class="lineno"> 3322</span>         cpl_image_delete(pq_im);</div>
+<div class="line"><a name="l03323"></a><span class="lineno"> 3323</span>         cpl_image_delete(pu_im);</div>
+<div class="line"><a name="l03324"></a><span class="lineno"> 3324</span>         cpl_image_delete(pl_im);</div>
+<div class="line"><a name="l03325"></a><span class="lineno"> 3325</span>         cpl_image_delete(pi_im);</div>
+<div class="line"><a name="l03326"></a><span class="lineno"> 3326</span> </div>
+<div class="line"><a name="l03327"></a><span class="lineno"> 3327</span>         cpl_image_delete(pqnull_im);</div>
+<div class="line"><a name="l03328"></a><span class="lineno"> 3328</span>         cpl_image_delete(punull_im);</div>
+<div class="line"><a name="l03329"></a><span class="lineno"> 3329</span> </div>
+<div class="line"><a name="l03330"></a><span class="lineno"> 3330</span>         cpl_image_delete(pqerr_im);</div>
+<div class="line"><a name="l03331"></a><span class="lineno"> 3331</span>         cpl_image_delete(puerr_im);</div>
+<div class="line"><a name="l03332"></a><span class="lineno"> 3332</span>         cpl_image_delete(plerr_im);</div>
+<div class="line"><a name="l03333"></a><span class="lineno"> 3333</span>         cpl_image_delete(pierr_im);</div>
+<div class="line"><a name="l03334"></a><span class="lineno"> 3334</span>         cpl_image_delete(pang_im);</div>
+<div class="line"><a name="l03335"></a><span class="lineno"> 3335</span>         cpl_image_delete(pangerr_im);</div>
+<div class="line"><a name="l03336"></a><span class="lineno"> 3336</span>     }</div>
+<div class="line"><a name="l03337"></a><span class="lineno"> 3337</span> </div>
+<div class="line"><a name="l03338"></a><span class="lineno"> 3338</span>     cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l03339"></a><span class="lineno"> 3339</span> </div>
+<div class="line"><a name="l03340"></a><span class="lineno"> 3340</span>     <span class="comment">/* End of Stokes computation */</span></div>
+<div class="line"><a name="l03341"></a><span class="lineno"> 3341</span> </div>
+<div class="line"><a name="l03342"></a><span class="lineno"> 3342</span>     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {</div>
+<div class="line"><a name="l03343"></a><span class="lineno"> 3343</span>         cpl_image_delete(reduceds[j]);</div>
+<div class="line"><a name="l03344"></a><span class="lineno"> 3344</span>         cpl_image_delete(rerrors[j]);</div>
+<div class="line"><a name="l03345"></a><span class="lineno"> 3345</span>         cpl_table_delete(slitss[j]);</div>
+<div class="line"><a name="l03346"></a><span class="lineno"> 3346</span>         cpl_image_delete(mappeds[j]);</div>
+<div class="line"><a name="l03347"></a><span class="lineno"> 3347</span>     }</div>
+<div class="line"><a name="l03348"></a><span class="lineno"> 3348</span> </div>
+<div class="line"><a name="l03349"></a><span class="lineno"> 3349</span>     cpl_free(reduceds);</div>
+<div class="line"><a name="l03350"></a><span class="lineno"> 3350</span>     cpl_free(rerrors);</div>
+<div class="line"><a name="l03351"></a><span class="lineno"> 3351</span>     cpl_free(slitss);</div>
+<div class="line"><a name="l03352"></a><span class="lineno"> 3352</span>     cpl_free(mappeds);</div>
+<div class="line"><a name="l03353"></a><span class="lineno"> 3353</span> </div>
+<div class="line"><a name="l03354"></a><span class="lineno"> 3354</span>     cpl_free(instrume); instrume = NULL;</div>
+<div class="line"><a name="l03355"></a><span class="lineno"> 3355</span> </div>
+<div class="line"><a name="l03356"></a><span class="lineno"> 3356</span>     cpl_free(skylocalmaps);</div>
+<div class="line"><a name="l03357"></a><span class="lineno"> 3357</span> </div>
+<div class="line"><a name="l03358"></a><span class="lineno"> 3358</span>     cpl_free(nobjs_per_slit);</div>
+<div class="line"><a name="l03359"></a><span class="lineno"> 3359</span> </div>
+<div class="line"><a name="l03360"></a><span class="lineno"> 3360</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l03361"></a><span class="lineno"> 3361</span>         cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l03362"></a><span class="lineno"> 3362</span>         fors_pmos_science_exit(NULL);</div>
+<div class="line"><a name="l03363"></a><span class="lineno"> 3363</span>     }</div>
+<div class="line"><a name="l03364"></a><span class="lineno"> 3364</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l03365"></a><span class="lineno"> 3365</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l03366"></a><span class="lineno"> 3366</span> }</div>
+<div class="line"><a name="l03367"></a><span class="lineno"> 3367</span> </div>
+<div class="line"><a name="l03368"></a><span class="lineno"> 3368</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03379"></a><span class="lineno"> 3379</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03380"></a><span class="lineno"> 3380</span> <span class="keyword">static</span> <span class="keywordtype">float</span> * fors_check_angles(cpl_frameset * frameset,</div>
+<div class="line"><a name="l03381"></a><span class="lineno"> 3381</span>                                  <span class="keywordtype">int</span> pmos, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, <span class="keywordtype">int</span> * circ)</div>
+<div class="line"><a name="l03382"></a><span class="lineno"> 3382</span> {</div>
+<div class="line"><a name="l03383"></a><span class="lineno"> 3383</span>     <span class="keywordtype">float</span>     *angles  = NULL;</div>
+<div class="line"><a name="l03384"></a><span class="lineno"> 3384</span>     cpl_frame *c_frame = NULL;</div>
+<div class="line"><a name="l03385"></a><span class="lineno"> 3385</span>     <span class="keywordtype">char</span>      *ret_id  = NULL;</div>
+<div class="line"><a name="l03386"></a><span class="lineno"> 3386</span> </div>
+<div class="line"><a name="l03387"></a><span class="lineno"> 3387</span>     <span class="keywordtype">int</span> i = 0;</div>
+<div class="line"><a name="l03388"></a><span class="lineno"> 3388</span> </div>
+<div class="line"><a name="l03389"></a><span class="lineno"> 3389</span>     angles = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>) * pmos);</div>
+<div class="line"><a name="l03390"></a><span class="lineno"> 3390</span> </div>
+<div class="line"><a name="l03391"></a><span class="lineno"> 3391</span>     <span class="keywordflow">for</span> (c_frame  = cpl_frameset_find(frameset, tag);</div>
+<div class="line"><a name="l03392"></a><span class="lineno"> 3392</span>          c_frame != NULL; c_frame = cpl_frameset_find(frameset, NULL)) {</div>
+<div class="line"><a name="l03393"></a><span class="lineno"> 3393</span> </div>
+<div class="line"><a name="l03394"></a><span class="lineno"> 3394</span>         cpl_propertylist * header =</div>
+<div class="line"><a name="l03395"></a><span class="lineno"> 3395</span>             cpl_propertylist_load(cpl_frame_get_filename(c_frame), 0);</div>
+<div class="line"><a name="l03396"></a><span class="lineno"> 3396</span>         </div>
+<div class="line"><a name="l03397"></a><span class="lineno"> 3397</span>         <span class="keywordflow">if</span> (!ret_id) {</div>
+<div class="line"><a name="l03398"></a><span class="lineno"> 3398</span>             ret_id = cpl_strdup(cpl_propertylist_get_string(header, </div>
+<div class="line"><a name="l03399"></a><span class="lineno"> 3399</span>                                                         <span class="stringliteral">"ESO INS OPTI4 ID"</span>));</div>
+<div class="line"><a name="l03400"></a><span class="lineno"> 3400</span> </div>
+<div class="line"><a name="l03401"></a><span class="lineno"> 3401</span>             <span class="keywordflow">if</span> (ret_id[1] != <span class="charliteral">'5'</span> && ret_id[1] != <span class="charliteral">'4'</span>) {</div>
+<div class="line"><a name="l03402"></a><span class="lineno"> 3402</span>                 cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l03403"></a><span class="lineno"> 3403</span>                               <span class="stringliteral">"Unknown retarder plate id: %s"</span>, ret_id);</div>
+<div class="line"><a name="l03404"></a><span class="lineno"> 3404</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03405"></a><span class="lineno"> 3405</span>             }</div>
+<div class="line"><a name="l03406"></a><span class="lineno"> 3406</span>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03407"></a><span class="lineno"> 3407</span>             <span class="keywordtype">char</span> * c_ret_id = (<span class="keywordtype">char</span> *)</div>
+<div class="line"><a name="l03408"></a><span class="lineno"> 3408</span>                 cpl_propertylist_get_string(header, <span class="stringliteral">"ESO INS OPTI4 ID"</span>);</div>
+<div class="line"><a name="l03409"></a><span class="lineno"> 3409</span>             <span class="keywordflow">if</span> (ret_id[1] != c_ret_id[1]) {</div>
+<div class="line"><a name="l03410"></a><span class="lineno"> 3410</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"Input frames are not from the same "</span></div>
+<div class="line"><a name="l03411"></a><span class="lineno"> 3411</span>                               <span class="stringliteral">"retarder plate"</span>);</div>
+<div class="line"><a name="l03412"></a><span class="lineno"> 3412</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03413"></a><span class="lineno"> 3413</span>             }</div>
+<div class="line"><a name="l03414"></a><span class="lineno"> 3414</span>         }</div>
+<div class="line"><a name="l03415"></a><span class="lineno"> 3415</span>         </div>
+<div class="line"><a name="l03416"></a><span class="lineno"> 3416</span>         <span class="keywordflow">if</span> (ret_id[1] == <span class="charliteral">'5'</span>) {  <span class="comment">/* Linear polarimetry */</span></div>
+<div class="line"><a name="l03417"></a><span class="lineno"> 3417</span>             <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS RETA2 ROT"</span>)) {</div>
+<div class="line"><a name="l03418"></a><span class="lineno"> 3418</span>                 angles[i] = (float)floor(2*cpl_propertylist_get_double(header, </div>
+<div class="line"><a name="l03419"></a><span class="lineno"> 3419</span>                                                 <span class="stringliteral">"ESO INS RETA2 ROT"</span>) + 0.5)/2;</div>
+<div class="line"><a name="l03420"></a><span class="lineno"> 3420</span>             }</div>
+<div class="line"><a name="l03421"></a><span class="lineno"> 3421</span>             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS RETA2 POSANG"</span>)) {</div>
+<div class="line"><a name="l03422"></a><span class="lineno"> 3422</span>                 <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO ADA POSANG"</span>)) {</div>
+<div class="line"><a name="l03423"></a><span class="lineno"> 3423</span>                     <span class="keywordtype">double</span> reta2pos = cpl_propertylist_get_double(header, </div>
+<div class="line"><a name="l03424"></a><span class="lineno"> 3424</span>                                                      <span class="stringliteral">"ESO INS RETA2 POSANG"</span>);</div>
+<div class="line"><a name="l03425"></a><span class="lineno"> 3425</span>                     <span class="keywordtype">double</span> adapos = cpl_propertylist_get_double(header, </div>
+<div class="line"><a name="l03426"></a><span class="lineno"> 3426</span>                                                      <span class="stringliteral">"ESO ADA POSANG"</span>);</div>
+<div class="line"><a name="l03427"></a><span class="lineno"> 3427</span>                     angles[i] = (float)floor(2*(reta2pos - adapos) + 0.5)/2;</div>
+<div class="line"><a name="l03428"></a><span class="lineno"> 3428</span>                 }</div>
+<div class="line"><a name="l03429"></a><span class="lineno"> 3429</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03430"></a><span class="lineno"> 3430</span>                     cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l03431"></a><span class="lineno"> 3431</span>                                   <span class="stringliteral">"ESO ADA POSANG not found in header"</span>);</div>
+<div class="line"><a name="l03432"></a><span class="lineno"> 3432</span>                     <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03433"></a><span class="lineno"> 3433</span>                 }</div>
+<div class="line"><a name="l03434"></a><span class="lineno"> 3434</span>             }</div>
+<div class="line"><a name="l03435"></a><span class="lineno"> 3435</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03436"></a><span class="lineno"> 3436</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"Neither ESO INS RETA2 ROT nor "</span></div>
+<div class="line"><a name="l03437"></a><span class="lineno"> 3437</span>                               <span class="stringliteral">"ESO INS RETA2 POSANG found in header"</span>);</div>
+<div class="line"><a name="l03438"></a><span class="lineno"> 3438</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03439"></a><span class="lineno"> 3439</span>             }</div>
+<div class="line"><a name="l03440"></a><span class="lineno"> 3440</span>             *circ = 0;</div>
+<div class="line"><a name="l03441"></a><span class="lineno"> 3441</span>         } <span class="keywordflow">else</span> {                 <span class="comment">/* Circular polarimetry */</span></div>
+<div class="line"><a name="l03442"></a><span class="lineno"> 3442</span>             <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS RETA4 ROT"</span>)) {</div>
+<div class="line"><a name="l03443"></a><span class="lineno"> 3443</span>                 angles[i] = (float)floor(2*cpl_propertylist_get_double(header, </div>
+<div class="line"><a name="l03444"></a><span class="lineno"> 3444</span>                                                 <span class="stringliteral">"ESO INS RETA4 ROT"</span>) + 0.5)/2;</div>
+<div class="line"><a name="l03445"></a><span class="lineno"> 3445</span>                 <span class="comment">//Check if it makes sense. Change in all other places</span></div>
+<div class="line"><a name="l03446"></a><span class="lineno"> 3446</span>                 <span class="keywordflow">if</span> (angles[i] < 0) </div>
+<div class="line"><a name="l03447"></a><span class="lineno"> 3447</span>                     angles[i] = angles[i] + 360;</div>
+<div class="line"><a name="l03448"></a><span class="lineno"> 3448</span>             }</div>
+<div class="line"><a name="l03449"></a><span class="lineno"> 3449</span>             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS RETA4 POSANG"</span>)) {</div>
+<div class="line"><a name="l03450"></a><span class="lineno"> 3450</span>                 <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO ADA POSANG"</span>)) {</div>
+<div class="line"><a name="l03451"></a><span class="lineno"> 3451</span>                     <span class="keywordtype">double</span> reta4pos = cpl_propertylist_get_double(header, </div>
+<div class="line"><a name="l03452"></a><span class="lineno"> 3452</span>                                                      <span class="stringliteral">"ESO INS RETA4 POSANG"</span>);</div>
+<div class="line"><a name="l03453"></a><span class="lineno"> 3453</span>                     <span class="keywordtype">double</span> adapos = cpl_propertylist_get_double(header, </div>
+<div class="line"><a name="l03454"></a><span class="lineno"> 3454</span>                                                      <span class="stringliteral">"ESO ADA POSANG"</span>);</div>
+<div class="line"><a name="l03455"></a><span class="lineno"> 3455</span>                     angles[i] = (float)floor(2*(reta4pos - adapos) + 0.5/2);</div>
+<div class="line"><a name="l03456"></a><span class="lineno"> 3456</span>                 }</div>
+<div class="line"><a name="l03457"></a><span class="lineno"> 3457</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03458"></a><span class="lineno"> 3458</span>                     cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l03459"></a><span class="lineno"> 3459</span>                                   <span class="stringliteral">"ESO ADA POSANG not found in header"</span>);</div>
+<div class="line"><a name="l03460"></a><span class="lineno"> 3460</span>                     <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03461"></a><span class="lineno"> 3461</span>                 }</div>
+<div class="line"><a name="l03462"></a><span class="lineno"> 3462</span>             }</div>
+<div class="line"><a name="l03463"></a><span class="lineno"> 3463</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03464"></a><span class="lineno"> 3464</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"Neither ESO INS RETA4 ROT nor "</span></div>
+<div class="line"><a name="l03465"></a><span class="lineno"> 3465</span>                               <span class="stringliteral">"ESO INS RETA4 POSANG found in header"</span>);</div>
+<div class="line"><a name="l03466"></a><span class="lineno"> 3466</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03467"></a><span class="lineno"> 3467</span>             }</div>
+<div class="line"><a name="l03468"></a><span class="lineno"> 3468</span>             *circ = 1;</div>
+<div class="line"><a name="l03469"></a><span class="lineno"> 3469</span>         }</div>
+<div class="line"><a name="l03470"></a><span class="lineno"> 3470</span> </div>
+<div class="line"><a name="l03471"></a><span class="lineno"> 3471</span>         cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l03472"></a><span class="lineno"> 3472</span>         i++;</div>
+<div class="line"><a name="l03473"></a><span class="lineno"> 3473</span>     }</div>
+<div class="line"><a name="l03474"></a><span class="lineno"> 3474</span> </div>
+<div class="line"><a name="l03475"></a><span class="lineno"> 3475</span>     cpl_free(ret_id);</div>
+<div class="line"><a name="l03476"></a><span class="lineno"> 3476</span> </div>
+<div class="line"><a name="l03477"></a><span class="lineno"> 3477</span>     <span class="keywordflow">if</span> (*circ) {</div>
+<div class="line"><a name="l03478"></a><span class="lineno"> 3478</span>         <span class="keywordflow">if</span> (pmos != 2 && pmos != 4) {</div>
+<div class="line"><a name="l03479"></a><span class="lineno"> 3479</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: %d angles "</span></div>
+<div class="line"><a name="l03480"></a><span class="lineno"> 3480</span>                           <span class="stringliteral">"found, but either 2 or 4 are required for "</span></div>
+<div class="line"><a name="l03481"></a><span class="lineno"> 3481</span>                           <span class="stringliteral">"circular polarization measurements!"</span>, pmos);</div>
+<div class="line"><a name="l03482"></a><span class="lineno"> 3482</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03483"></a><span class="lineno"> 3483</span>         }</div>
+<div class="line"><a name="l03484"></a><span class="lineno"> 3484</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03485"></a><span class="lineno"> 3485</span>         <span class="keywordflow">if</span> (pmos != 4 && pmos != 8 && pmos != 16) {</div>
+<div class="line"><a name="l03486"></a><span class="lineno"> 3486</span>             cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: %d angles "</span></div>
+<div class="line"><a name="l03487"></a><span class="lineno"> 3487</span>                           <span class="stringliteral">"found, but either 4, 8, or 16 are required for "</span></div>
+<div class="line"><a name="l03488"></a><span class="lineno"> 3488</span>                           <span class="stringliteral">"linear polarization measurements!"</span>, pmos);</div>
+<div class="line"><a name="l03489"></a><span class="lineno"> 3489</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03490"></a><span class="lineno"> 3490</span>         }</div>
+<div class="line"><a name="l03491"></a><span class="lineno"> 3491</span>     }</div>
+<div class="line"><a name="l03492"></a><span class="lineno"> 3492</span>     </div>
+<div class="line"><a name="l03493"></a><span class="lineno"> 3493</span>     <span class="comment">/* Check completeness */</span></div>
+<div class="line"><a name="l03494"></a><span class="lineno"> 3494</span> </div>
+<div class="line"><a name="l03495"></a><span class="lineno"> 3495</span>     <span class="keywordflow">if</span> (*circ) {</div>
+<div class="line"><a name="l03496"></a><span class="lineno"> 3496</span>         <span class="keywordflow">for</span> (i = 0; i < pmos; i++) {</div>
+<div class="line"><a name="l03497"></a><span class="lineno"> 3497</span>             <span class="keywordflow">if</span> (fors_find_angle_pos(angles, pmos, 90.0 * i - 45.0) < 0) {</div>
+<div class="line"><a name="l03498"></a><span class="lineno"> 3498</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *cangles;</div>
+<div class="line"><a name="l03499"></a><span class="lineno"> 3499</span>                 <span class="keywordflow">switch</span> (pmos) {</div>
+<div class="line"><a name="l03500"></a><span class="lineno"> 3500</span>                 <span class="keywordflow">case</span> 2: cangles  = <span class="stringliteral">"-45.0, 45.0"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l03501"></a><span class="lineno"> 3501</span>                 <span class="keywordflow">case</span> 4: cangles  = <span class="stringliteral">"-45.0, 45.0, 135.0, 225.0"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l03502"></a><span class="lineno"> 3502</span>                 <span class="keywordflow">default</span>: assert(0);</div>
+<div class="line"><a name="l03503"></a><span class="lineno"> 3503</span>                 }  </div>
+<div class="line"><a name="l03504"></a><span class="lineno"> 3504</span> </div>
+<div class="line"><a name="l03505"></a><span class="lineno"> 3505</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: missing "</span></div>
+<div class="line"><a name="l03506"></a><span class="lineno"> 3506</span>                               <span class="stringliteral">"angle %.2f. All angles %s must be provided."</span>,</div>
+<div class="line"><a name="l03507"></a><span class="lineno"> 3507</span>                               angles[i], cangles);</div>
+<div class="line"><a name="l03508"></a><span class="lineno"> 3508</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03509"></a><span class="lineno"> 3509</span>             }</div>
+<div class="line"><a name="l03510"></a><span class="lineno"> 3510</span>         }</div>
+<div class="line"><a name="l03511"></a><span class="lineno"> 3511</span>     }</div>
+<div class="line"><a name="l03512"></a><span class="lineno"> 3512</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03513"></a><span class="lineno"> 3513</span>         <span class="keywordflow">for</span> (i = 0; i < pmos; i++) {</div>
+<div class="line"><a name="l03514"></a><span class="lineno"> 3514</span>             <span class="keywordflow">if</span> (fors_find_angle_pos(angles, pmos, 22.5 * i) < 0) {</div>
+<div class="line"><a name="l03515"></a><span class="lineno"> 3515</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *cangles;</div>
+<div class="line"><a name="l03516"></a><span class="lineno"> 3516</span>                 <span class="keywordflow">switch</span> (pmos) {</div>
+<div class="line"><a name="l03517"></a><span class="lineno"> 3517</span>                 <span class="keywordflow">case</span> 4: cangles  = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l03518"></a><span class="lineno"> 3518</span>                 <span class="keywordflow">case</span> 8: cangles  = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5, "</span></div>
+<div class="line"><a name="l03519"></a><span class="lineno"> 3519</span>                                    <span class="stringliteral">"90.0, 112.5, 135.0, 157.5"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l03520"></a><span class="lineno"> 3520</span>                 <span class="keywordflow">case</span> 16: cangles = <span class="stringliteral">"0.0, 22.5, 45.0, 67.5, "</span></div>
+<div class="line"><a name="l03521"></a><span class="lineno"> 3521</span>                                    <span class="stringliteral">"90.0, 112.5, 135.0, 157.5, "</span></div>
+<div class="line"><a name="l03522"></a><span class="lineno"> 3522</span>                                    <span class="stringliteral">"180.0, 202.5, 225.0, 247.5, "</span></div>
+<div class="line"><a name="l03523"></a><span class="lineno"> 3523</span>                                    <span class="stringliteral">"270.0, 292.5, 315.0, 337.5"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l03524"></a><span class="lineno"> 3524</span>                 <span class="keywordflow">default</span>: assert(0);</div>
+<div class="line"><a name="l03525"></a><span class="lineno"> 3525</span>                 }  </div>
+<div class="line"><a name="l03526"></a><span class="lineno"> 3526</span> </div>
+<div class="line"><a name="l03527"></a><span class="lineno"> 3527</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong angle configuration: missing "</span></div>
+<div class="line"><a name="l03528"></a><span class="lineno"> 3528</span>                               <span class="stringliteral">"angle %.2f. All angles %s must be provided."</span>,</div>
+<div class="line"><a name="l03529"></a><span class="lineno"> 3529</span>                               angles[i], cangles);</div>
+<div class="line"><a name="l03530"></a><span class="lineno"> 3530</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03531"></a><span class="lineno"> 3531</span>             }</div>
+<div class="line"><a name="l03532"></a><span class="lineno"> 3532</span>         }</div>
+<div class="line"><a name="l03533"></a><span class="lineno"> 3533</span>     }</div>
+<div class="line"><a name="l03534"></a><span class="lineno"> 3534</span> </div>
+<div class="line"><a name="l03535"></a><span class="lineno"> 3535</span>     <span class="keywordflow">return</span> angles;</div>
+<div class="line"><a name="l03536"></a><span class="lineno"> 3536</span> }</div>
+<div class="line"><a name="l03537"></a><span class="lineno"> 3537</span> </div>
+<div class="line"><a name="l03538"></a><span class="lineno"> 3538</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03546"></a><span class="lineno"> 3546</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l03547"></a><span class="lineno"> 3547</span> <span class="keyword">static</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l03548"></a><span class="lineno"> 3548</span> fors_find_angle_pos(<span class="keywordtype">float</span> * angles, <span class="keywordtype">int</span> nangles, <span class="keywordtype">float</span> angle)</div>
+<div class="line"><a name="l03549"></a><span class="lineno"> 3549</span> {</div>
+<div class="line"><a name="l03550"></a><span class="lineno"> 3550</span>     <span class="keywordtype">int</span> i, match = 0;</div>
+<div class="line"><a name="l03551"></a><span class="lineno"> 3551</span> </div>
+<div class="line"><a name="l03552"></a><span class="lineno"> 3552</span>     <span class="keywordflow">for</span> (i = 0; i < nangles; i++) {</div>
+<div class="line"><a name="l03553"></a><span class="lineno"> 3553</span>         <span class="keywordflow">if</span> (fabs(angles[i]         - angle) < 1.0 || </div>
+<div class="line"><a name="l03554"></a><span class="lineno"> 3554</span>             fabs(angles[i] - 360.0 - angle) < 1.0) {</div>
+<div class="line"><a name="l03555"></a><span class="lineno"> 3555</span>             match = 1;</div>
+<div class="line"><a name="l03556"></a><span class="lineno"> 3556</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l03557"></a><span class="lineno"> 3557</span>         }</div>
+<div class="line"><a name="l03558"></a><span class="lineno"> 3558</span>     }</div>
+<div class="line"><a name="l03559"></a><span class="lineno"> 3559</span> </div>
+<div class="line"><a name="l03560"></a><span class="lineno"> 3560</span>     <span class="keywordflow">return</span> match ? i : -1;</div>
+<div class="line"><a name="l03561"></a><span class="lineno"> 3561</span> }</div>
+<div class="line"><a name="l03562"></a><span class="lineno"> 3562</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__point-test_8c-source.html b/html/fors__point-test_8c-source.html
deleted file mode 100644
index 7ca9d1d..0000000
--- a/html/fors__point-test_8c-source.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_point-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_point-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_point-test.c,v 1.1 2007/08/28 13:33:09 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/08/28 13:33:09 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_point.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <test.h></span>
-<a name="l00034"></a>00034 
-<a name="l00044"></a>00044 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00045"></a><a class="code" href="group__fors__point__test.html#g8780ed589661ab74a9969ab904805731">00045</a> <a class="code" href="group__fors__point__test.html#g8780ed589661ab74a9969ab904805731">test_point</a>(<span class="keywordtype">void</span>)
-<a name="l00046"></a>00046 {
-<a name="l00047"></a>00047     fors_point *p1 = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(1, 2);
-<a name="l00048"></a>00048     fors_point *p2 = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(2, 2);
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050     test_abs( <a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(p1, p2), 1.0, 0.01 );
-<a name="l00051"></a>00051     
-<a name="l00052"></a>00052     <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&p1);
-<a name="l00053"></a>00053     <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&p2);
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055     <span class="keywordflow">return</span>;
-<a name="l00056"></a>00056 }
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058 
-<a name="l00062"></a>00062 <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     TEST_INIT;
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066     <a class="code" href="group__fors__point__test.html#g8780ed589661ab74a9969ab904805731">test_point</a>();
-<a name="l00067"></a>00067 
-<a name="l00068"></a>00068     TEST_END;
-<a name="l00069"></a>00069 }
-<a name="l00070"></a>00070 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__point-test_8c_source.html b/html/fors__point-test_8c_source.html
new file mode 100644
index 0000000..3855d2e
--- /dev/null
+++ b/html/fors__point-test_8c_source.html
@@ -0,0 +1,119 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_point-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_point-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_point-test.c,v 1.1 2007-08-28 13:33:09 jmlarsen Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: jmlarsen $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007-08-28 13:33:09 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.1 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_point.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno"><a class="code" href="group__fors__point__test.html#ga2c261e462483c35aa06be9ac1ff0d683">   45</a></span> <a class="code" href="group__fors__point__test.html#ga2c261e462483c35aa06be9ac1ff0d683" title="test">test_point</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> {</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     fors_point *p1 = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(1, 2);</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>     fors_point *p2 = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(2, 2);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>     test_abs( <a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(p1, p2), 1.0, 0.01 );</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>     </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>     <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&p1);</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>     <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&p2);</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> }</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     TEST_INIT;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     <a class="code" href="group__fors__point__test.html#ga2c261e462483c35aa06be9ac1ff0d683" title="test">test_point</a>();</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     TEST_END;</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> }</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__point_8c-source.html b/html/fors__point_8c-source.html
deleted file mode 100644
index daf38db..0000000
--- a/html/fors__point_8c-source.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_point.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_point.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_point.c,v 1.3 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.3 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_point.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00042"></a><a class="code" href="group__fors__point.html#gb79164ea3a1118352c6ca0ea9a9840ea">00042</a> <span class="preprocessor">#define LIST_DEFINE</span>
-<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00044"></a><a class="code" href="group__fors__point.html#g9d7995a21a54c1d39a0bc87d7f498029">00044</a> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_point</span>
-<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00046"></a>00046 
-<a name="l00053"></a><a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">00053</a> fors_point *<a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y)
-<a name="l00054"></a>00054 {
-<a name="l00055"></a>00055     fors_point *p = cpl_malloc(<span class="keyword">sizeof</span>(*p));
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057     p->x = x;
-<a name="l00058"></a>00058     p->y = y;
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060     <span class="keywordflow">return</span> p;    
-<a name="l00061"></a>00061 }
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063 <span class="preprocessor">#undef cleanup</span>
-<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00065"></a>00065 <span class="preprocessor"></span>
-<a name="l00070"></a><a class="code" href="group__fors__point.html#gc5a8341742fc371f6e7332600286045e">00070</a> fors_point *<a class="code" href="group__fors__point.html#gc5a8341742fc371f6e7332600286045e">fors_point_duplicate</a>(<span class="keyword">const</span> fors_point *p)
-<a name="l00071"></a>00071 {
-<a name="l00072"></a>00072     fors_point *p2 = NULL;
-<a name="l00073"></a>00073     
-<a name="l00074"></a>00074     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( p != NULL, <span class="keywordflow">return</span> p2, NULL );
-<a name="l00075"></a>00075 
-<a name="l00076"></a>00076     p2 = cpl_malloc(<span class="keyword">sizeof</span>(*p2));
-<a name="l00077"></a>00077     p2->x = p->x;
-<a name="l00078"></a>00078     p2->y = p->y;
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080     <span class="keywordflow">return</span> p2;
-<a name="l00081"></a>00081 }
-<a name="l00082"></a>00082 
-<a name="l00087"></a><a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">00087</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(fors_point **p)
-<a name="l00088"></a>00088 {
-<a name="l00089"></a>00089     <span class="keywordflow">if</span> (p && *p) {
-<a name="l00090"></a>00090         cpl_free(*p); *p = NULL;
-<a name="l00091"></a>00091     }
-<a name="l00092"></a>00092     <span class="keywordflow">return</span>;
-<a name="l00093"></a>00093 }
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095 <span class="preprocessor">#undef cleanup</span>
-<a name="l00096"></a><a class="code" href="group__fors__point.html#g57cf6e6e2826eb178fd2d9c3e5695343">00096</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00097"></a>00097 <span class="preprocessor"></span>
-<a name="l00103"></a><a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">00103</a> <span class="keywordtype">double</span> <a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(<span class="keyword">const</span> fors_point *p,
-<a name="l00104"></a>00104              <span class="keyword">const</span> fors_point *q)
-<a name="l00105"></a>00105 {
-<a name="l00106"></a>00106     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( p != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00107"></a>00107     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( q != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00108"></a>00108 
-<a name="l00109"></a>00109     <span class="keywordflow">return</span> (
-<a name="l00110"></a>00110         (p->x - q->x)*(p->x - q->x) +
-<a name="l00111"></a>00111         (p->y - q->y)*(p->y - q->y));
-<a name="l00112"></a>00112 }
-<a name="l00113"></a>00113 
-<a name="l00120"></a><a class="code" href="group__fors__point.html#g5f09413dd7958d3ebbe1ba7700b27377">00120</a> <span class="keywordtype">bool</span> <a class="code" href="group__fors__point.html#g5f09413dd7958d3ebbe1ba7700b27377">fors_point_equal</a>(<span class="keyword">const</span> fors_point *p,
-<a name="l00121"></a>00121               <span class="keyword">const</span> fors_point *q)
-<a name="l00122"></a>00122 {
-<a name="l00123"></a>00123     <span class="keywordflow">return</span> <a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(p, q) <= DBL_EPSILON;
-<a name="l00124"></a>00124 }
-<a name="l00125"></a>00125 
-<a name="l00126"></a>00126 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__point_8c_source.html b/html/fors__point_8c_source.html
new file mode 100644
index 0000000..53d9780
--- /dev/null
+++ b/html/fors__point_8c_source.html
@@ -0,0 +1,156 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_point.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_point.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_point.c,v 1.3 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.3 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_point.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#define LIST_DEFINE</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_point</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno"><a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d">   53</a></span> fors_point *<a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y)</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> {</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>     fors_point *p = cpl_malloc(<span class="keyword">sizeof</span>(*p));</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>     p->x = x;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>     p->y = y;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     <span class="keywordflow">return</span> p;    </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> }</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="group__fors__point.html#gaefadbecbfc8e491ca544292027d8b69e">   70</a></span> fors_point *<a class="code" href="group__fors__point.html#gaefadbecbfc8e491ca544292027d8b69e" title="Copy constructor.">fors_point_duplicate</a>(<span class="keyword">const</span> fors_point *p)</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> {</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     fors_point *p2 = NULL;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     </div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( p != NULL, <span class="keywordflow">return</span> p2, NULL );</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     p2 = cpl_malloc(<span class="keyword">sizeof</span>(*p2));</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     p2->x = p->x;</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     p2->y = p->y;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     <span class="keywordflow">return</span> p2;</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> }</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0">   87</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(fors_point **p)</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> {</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     <span class="keywordflow">if</span> (p && *p) {</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>         cpl_free(*p); *p = NULL;</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     }</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> }</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142">  103</a></span> <span class="keywordtype">double</span> <a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(<span class="keyword">const</span> fors_point *p,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>              <span class="keyword">const</span> fors_point *q)</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> {</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( p != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( q != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="keywordflow">return</span> (</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>         (p->x - q->x)*(p->x - q->x) +</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>         (p->y - q->y)*(p->y - q->y));</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> }</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> </div>
+<div class="line"><a name="l00120"></a><span class="lineno"><a class="code" href="group__fors__point.html#ga08402a65da099406fc85d21041df7f9d">  120</a></span> <span class="keywordtype">bool</span> <a class="code" href="group__fors__point.html#ga08402a65da099406fc85d21041df7f9d" title="Equality.">fors_point_equal</a>(<span class="keyword">const</span> fors_point *p,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>               <span class="keyword">const</span> fors_point *q)</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> {</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(p, q) <= DBL_EPSILON;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> }</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__point_8h-source.html b/html/fors__point_8h-source.html
deleted file mode 100644
index 50b3d0f..0000000
--- a/html/fors__point_8h-source.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_point.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_point.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_point.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_POINT_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_POINT_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a><a class="code" href="struct__fors__point.html">00035</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__point.html">_fors_point</a>
-<a name="l00036"></a>00036 {
-<a name="l00037"></a><a class="code" href="struct__fors__point.html#0c7d2a164217d83715d8170573798fbc">00037</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__point.html#001799342df066a6b324fa53862476cd">x</a>, <a class="code" href="struct__fors__point.html#0c7d2a164217d83715d8170573798fbc">y</a>;
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 } fors_point;
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_point</span>
-<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 fors_point *<a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y);
-<a name="l00046"></a>00046 fors_point *<a class="code" href="group__fors__point.html#gc5a8341742fc371f6e7332600286045e">fors_point_duplicate</a>(<span class="keyword">const</span> fors_point *p);
-<a name="l00047"></a>00047 <span class="keywordtype">void</span> <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(fors_point **point);
-<a name="l00048"></a>00048 <span class="keywordtype">void</span> fors_point_delete_list(fors_point ***point);
-<a name="l00049"></a>00049 <span class="keywordtype">void</span> fors_point_print(<span class="keyword">const</span> fors_point *s);
-<a name="l00050"></a>00050 <span class="keywordtype">bool</span> <a class="code" href="group__fors__point.html#g5f09413dd7958d3ebbe1ba7700b27377">fors_point_equal</a>(<span class="keyword">const</span> fors_point *p,
-<a name="l00051"></a>00051               <span class="keyword">const</span> fors_point *q);
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="keywordtype">double</span> <a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(<span class="keyword">const</span> fors_point *p,
-<a name="l00054"></a>00054              <span class="keyword">const</span> fors_point *q);
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 CPL_END_DECLS
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__point_8h_source.html b/html/fors__point_8h_source.html
new file mode 100644
index 0000000..f216719
--- /dev/null
+++ b/html/fors__point_8h_source.html
@@ -0,0 +1,120 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_point.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_point.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_point.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.4 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_POINT_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_POINT_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="struct__fors__point.html">   35</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__point.html">_fors_point</a></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> {</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span>     <span class="keywordtype">double</span> x, y;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> } fors_point;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_point</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> fors_point *<a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y);</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> fors_point *<a class="code" href="group__fors__point.html#gaefadbecbfc8e491ca544292027d8b69e" title="Copy constructor.">fors_point_duplicate</a>(<span class="keyword">const</span> fors_point *p);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(fors_point **point);</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keywordtype">void</span> fors_point_delete_list(fors_point ***point);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="keywordtype">void</span> fors_point_print(<span class="keyword">const</span> fors_point *s);</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keywordtype">bool</span> <a class="code" href="group__fors__point.html#ga08402a65da099406fc85d21041df7f9d" title="Equality.">fors_point_equal</a>(<span class="keyword">const</span> fors_point *p,</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>               <span class="keyword">const</span> fors_point *q);</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(<span class="keyword">const</span> fors_point *p,</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>              <span class="keyword">const</span> fors_point *q);</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__polynomial_8c-source.html b/html/fors__polynomial_8c-source.html
deleted file mode 100644
index 1c0ee81..0000000
--- a/html/fors__polynomial_8c-source.html
+++ /dev/null
@@ -1,569 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_polynomial.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_polynomial.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_polynomial.c,v 1.9 2013/02/15 10:55:19 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/02/15 10:55:19 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.9 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include "fors_polynomial.h"</span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include "fors_utils.h"</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <math.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <string.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00044"></a>00044 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00045"></a>00045 
-<a name="l00047"></a>00047 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00048"></a>00048 <span class="comment">    Prototypes</span>
-<a name="l00049"></a>00049 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00052"></a>00052 <a class="code" href="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5">fors_polynomial_is_coeff_set</a>(               <span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00053"></a>00053                                             <span class="keyword">const</span> cpl_size          *powers);
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00056"></a>00056 <a class="code" href="group__fors__polynomial.html#g5d5e2697050554c599837146744408fc">fors_polynomial_powers_next</a>(                <span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00057"></a>00057                                             cpl_size                *powers);
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00060"></a>00060 <span class="comment">    Private Implementation</span>
-<a name="l00061"></a>00061 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00064"></a>00064 <span class="preprocessor">#undef cleanup</span>
-<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00066"></a>00066 <span class="preprocessor"></span>
-<a name="l00072"></a>00072 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00074"></a><a class="code" href="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5">00074</a> <a class="code" href="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5">fors_polynomial_is_coeff_set</a>(               <span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00075"></a>00075                                             <span class="keyword">const</span> cpl_size          *powers)
-<a name="l00076"></a>00076 {
-<a name="l00077"></a>00077     cassure_automsg(                        p != NULL,
-<a name="l00078"></a>00078                                             CPL_ERROR_NULL_INPUT,
-<a name="l00079"></a>00079                                             <span class="keywordflow">return</span> <span class="keyword">false</span>);
-<a name="l00080"></a>00080     cassure_automsg(                        powers != NULL,
-<a name="l00081"></a>00081                                             CPL_ERROR_NULL_INPUT,
-<a name="l00082"></a>00082                                             <span class="keywordflow">return</span> <span class="keyword">false</span>);
-<a name="l00083"></a>00083     
-<a name="l00084"></a>00084     <span class="keywordflow">return</span> (fabs(cpl_polynomial_get_coeff(p, powers)) > DBL_EPSILON);
-<a name="l00085"></a>00085 }
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00088"></a>00088 <span class="preprocessor">#undef cleanup</span>
-<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00090"></a>00090 <span class="preprocessor"></span>
-<a name="l00096"></a>00096 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00097"></a>00097 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00098"></a><a class="code" href="group__fors__polynomial.html#g5d5e2697050554c599837146744408fc">00098</a> <a class="code" href="group__fors__polynomial.html#g5d5e2697050554c599837146744408fc">fors_polynomial_powers_next</a>(<span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00099"></a>00099                             cpl_size                *powers)
-<a name="l00100"></a>00100 {
-<a name="l00101"></a>00101     <span class="keywordtype">int</span>             dim = 0,
-<a name="l00102"></a>00102                     ndims,
-<a name="l00103"></a>00103                     ndegs;
-<a name="l00104"></a>00104     <span class="keywordtype">bool</span>            overflow = <span class="keyword">false</span>;
-<a name="l00105"></a>00105     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00106"></a>00106     
-<a name="l00107"></a>00107     cassure_automsg(                        p != NULL,
-<a name="l00108"></a>00108                                             CPL_ERROR_NULL_INPUT,
-<a name="l00109"></a>00109                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);
-<a name="l00110"></a>00110     cassure_automsg(                        powers != NULL,
-<a name="l00111"></a>00111                                             CPL_ERROR_NULL_INPUT,
-<a name="l00112"></a>00112                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);
-<a name="l00113"></a>00113     
-<a name="l00114"></a>00114     ndims = cpl_polynomial_get_dimension(p);
-<a name="l00115"></a>00115     ndegs = cpl_polynomial_get_degree(p);
-<a name="l00116"></a>00116     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> <span class="keyword">true</span>);
-<a name="l00117"></a>00117     
-<a name="l00118"></a>00118     powers[dim]++;
-<a name="l00119"></a>00119     <span class="keywordflow">while</span>(dim < ndims && powers[dim] > ndegs) <span class="comment">/* carry over */</span>
-<a name="l00120"></a>00120     {
-<a name="l00121"></a>00121         powers[dim] = 0;
-<a name="l00122"></a>00122         dim++;
-<a name="l00123"></a>00123         overflow = (!(dim < ndims));
-<a name="l00124"></a>00124         <span class="keywordflow">if</span> (!overflow)
-<a name="l00125"></a>00125             powers[dim]++;
-<a name="l00126"></a>00126     }
-<a name="l00127"></a>00127     
-<a name="l00128"></a>00128     <span class="keywordflow">return</span> overflow;
-<a name="l00129"></a>00129 }
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00132"></a>00132 <span class="comment">    Public Implementation</span>
-<a name="l00133"></a>00133 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00136"></a>00136 <span class="preprocessor">#undef cleanup</span>
-<a name="l00137"></a>00137 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00138"></a>00138 <span class="preprocessor">do { \</span>
-<a name="l00139"></a>00139 <span class="preprocessor">    if (pows != NULL) \</span>
-<a name="l00140"></a>00140 <span class="preprocessor">        cpl_free(pows); \</span>
-<a name="l00141"></a>00141 <span class="preprocessor">    pows = NULL; \</span>
-<a name="l00142"></a>00142 <span class="preprocessor">} while (0)</span>
-<a name="l00143"></a>00143 <span class="preprocessor"></span>
-<a name="l00148"></a>00148 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00149"></a>00149 <span class="keywordtype">int</span>
-<a name="l00150"></a><a class="code" href="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679">00150</a> <a class="code" href="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679">fors_polynomial_count_coeff</a>(                <span class="keyword">const</span> cpl_polynomial    *p)
-<a name="l00151"></a>00151 {
-<a name="l00152"></a>00152     <span class="keywordtype">int</span>             ndims,
-<a name="l00153"></a>00153                     Ncoeff = 0;
-<a name="l00154"></a>00154     cpl_size       *pows = NULL;
-<a name="l00155"></a>00155     <span class="keywordtype">bool</span>            overflow = <span class="keyword">false</span>;
-<a name="l00156"></a>00156     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00157"></a>00157     
-<a name="l00158"></a>00158     cassure_automsg(                        p != NULL,
-<a name="l00159"></a>00159                                             CPL_ERROR_NULL_INPUT,
-<a name="l00160"></a>00160                                             <span class="keywordflow">return</span> 0);
-<a name="l00161"></a>00161     
-<a name="l00162"></a>00162     ndims = cpl_polynomial_get_dimension(p);
-<a name="l00163"></a>00163     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> 0);
-<a name="l00164"></a>00164     
-<a name="l00165"></a>00165     pows = cpl_calloc(ndims, <span class="keyword">sizeof</span>(*pows));
-<a name="l00166"></a>00166     
-<a name="l00167"></a>00167     <span class="keywordflow">while</span> (!overflow) 
-<a name="l00168"></a>00168     {
-<a name="l00169"></a>00169         <span class="keywordflow">if</span> (<a class="code" href="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5">fors_polynomial_is_coeff_set</a>(p, pows))
-<a name="l00170"></a>00170             Ncoeff++;
-<a name="l00171"></a>00171         
-<a name="l00172"></a>00172         overflow = <a class="code" href="group__fors__polynomial.html#g5d5e2697050554c599837146744408fc">fors_polynomial_powers_next</a>(p, pows);
-<a name="l00173"></a>00173     }
-<a name="l00174"></a>00174     
-<a name="l00175"></a>00175     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> 0);
-<a name="l00176"></a>00176     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00177"></a>00177     
-<a name="l00178"></a>00178     <span class="keywordflow">return</span> Ncoeff;
-<a name="l00179"></a>00179 }
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00182"></a>00182 <span class="preprocessor">#undef cleanup</span>
-<a name="l00183"></a>00183 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00184"></a>00184 <span class="preprocessor"></span>
-<a name="l00190"></a>00190 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00191"></a>00191 <span class="keywordtype">int</span>
-<a name="l00192"></a><a class="code" href="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0">00192</a> <a class="code" href="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0">fors_polynomial_powers_find_first_coeff</a>(<span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00193"></a>00193                                         cpl_size                *powers)
-<a name="l00194"></a>00194 {
-<a name="l00195"></a>00195     <span class="keywordtype">int</span>             ndims,
-<a name="l00196"></a>00196                     dim;
-<a name="l00197"></a>00197     <span class="keywordtype">bool</span>            overflow;
-<a name="l00198"></a>00198     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00199"></a>00199     
-<a name="l00200"></a>00200     cassure_automsg(                        p != NULL,
-<a name="l00201"></a>00201                                             CPL_ERROR_NULL_INPUT,
-<a name="l00202"></a>00202                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);
-<a name="l00203"></a>00203     cassure_automsg(                        powers != NULL,
-<a name="l00204"></a>00204                                             CPL_ERROR_NULL_INPUT,
-<a name="l00205"></a>00205                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);
-<a name="l00206"></a>00206     
-<a name="l00207"></a>00207     ndims = cpl_polynomial_get_dimension(p);
-<a name="l00208"></a>00208     <span class="keywordflow">for</span> (dim = 0; dim < ndims; dim++)
-<a name="l00209"></a>00209         powers[dim] = 0;
-<a name="l00210"></a>00210     
-<a name="l00211"></a>00211     <span class="keywordflow">if</span> (<a class="code" href="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5">fors_polynomial_is_coeff_set</a>(p, powers))
-<a name="l00212"></a>00212         <span class="keywordflow">return</span> <span class="keyword">false</span>;
-<a name="l00213"></a>00213     
-<a name="l00214"></a>00214     overflow = <a class="code" href="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073">fors_polynomial_powers_find_next_coeff</a>(p, powers);
-<a name="l00215"></a>00215     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> <span class="keyword">true</span>);
-<a name="l00216"></a>00216     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00217"></a>00217     
-<a name="l00218"></a>00218     <span class="keywordflow">return</span> overflow;
-<a name="l00219"></a>00219 }
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00222"></a>00222 <span class="preprocessor">#undef cleanup</span>
-<a name="l00223"></a>00223 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00224"></a>00224 <span class="preprocessor"></span>
-<a name="l00230"></a>00230 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00231"></a>00231 <span class="keywordtype">int</span>
-<a name="l00232"></a><a class="code" href="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073">00232</a> <a class="code" href="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073">fors_polynomial_powers_find_next_coeff</a>(<span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00233"></a>00233                                        cpl_size                *powers)
-<a name="l00234"></a>00234 {
-<a name="l00235"></a>00235     <span class="keywordtype">bool</span>            overflow;
-<a name="l00236"></a>00236     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00237"></a>00237     
-<a name="l00238"></a>00238     cassure_automsg(                        p != NULL,
-<a name="l00239"></a>00239                                             CPL_ERROR_NULL_INPUT,
-<a name="l00240"></a>00240                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);
-<a name="l00241"></a>00241     cassure_automsg(                        powers != NULL,
-<a name="l00242"></a>00242                                             CPL_ERROR_NULL_INPUT,
-<a name="l00243"></a>00243                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);
-<a name="l00244"></a>00244     
-<a name="l00245"></a>00245     overflow = <a class="code" href="group__fors__polynomial.html#g5d5e2697050554c599837146744408fc">fors_polynomial_powers_next</a>(p, powers);
-<a name="l00246"></a>00246     <span class="keywordflow">while</span> (!overflow)
-<a name="l00247"></a>00247     {
-<a name="l00248"></a>00248         <span class="keywordflow">if</span> (<a class="code" href="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5">fors_polynomial_is_coeff_set</a>(p, powers))
-<a name="l00249"></a>00249             <span class="keywordflow">break</span>;
-<a name="l00250"></a>00250         
-<a name="l00251"></a>00251         overflow = <a class="code" href="group__fors__polynomial.html#g5d5e2697050554c599837146744408fc">fors_polynomial_powers_next</a>(p, powers);
-<a name="l00252"></a>00252     }
-<a name="l00253"></a>00253     
-<a name="l00254"></a>00254     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> <span class="keyword">true</span>);
-<a name="l00255"></a>00255     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00256"></a>00256     
-<a name="l00257"></a>00257     <span class="keywordflow">return</span> overflow;
-<a name="l00258"></a>00258 }
-<a name="l00259"></a>00259 
-<a name="l00260"></a>00260 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00261"></a>00261 <span class="preprocessor">#undef cleanup</span>
-<a name="l00262"></a>00262 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00263"></a>00263 <span class="preprocessor">do { \</span>
-<a name="l00264"></a>00264 <span class="preprocessor">    if (pows != NULL) \</span>
-<a name="l00265"></a>00265 <span class="preprocessor">        cpl_free(pows); \</span>
-<a name="l00266"></a>00266 <span class="preprocessor">    pows = NULL; \</span>
-<a name="l00267"></a>00267 <span class="preprocessor">} while (0)</span>
-<a name="l00268"></a>00268 <span class="preprocessor"></span>
-<a name="l00275"></a>00275 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00276"></a>00276 cpl_error_code
-<a name="l00277"></a><a class="code" href="group__fors__polynomial.html#g2255e6cc731c54c6b5575e506bd5fea8">00277</a> <a class="code" href="group__fors__polynomial.html#g2255e6cc731c54c6b5575e506bd5fea8">fors_polynomial_set_existing_coeff</a>(         cpl_polynomial  *p,
-<a name="l00278"></a>00278                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *coeffs,
-<a name="l00279"></a>00279                                             <span class="keywordtype">int</span>             n_coeffs)
-<a name="l00280"></a>00280 {
-<a name="l00281"></a>00281     <span class="keywordtype">int</span>             n,
-<a name="l00282"></a>00282                     ndims;
-<a name="l00283"></a>00283     cpl_size       *pows = NULL;
-<a name="l00284"></a>00284     <span class="keywordtype">bool</span>            overflow = <span class="keyword">false</span>;
-<a name="l00285"></a>00285     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00286"></a>00286     
-<a name="l00287"></a>00287     <span class="keywordflow">if</span> (p == NULL)
-<a name="l00288"></a>00288         <span class="keywordflow">return</span> 0;
-<a name="l00289"></a>00289     
-<a name="l00290"></a>00290     <span class="comment">/* check input */</span>
-<a name="l00291"></a>00291     cassure_automsg(                        p != NULL,
-<a name="l00292"></a>00292                                             CPL_ERROR_NULL_INPUT,
-<a name="l00293"></a>00293                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00294"></a>00294     cassure_automsg(                        coeffs != NULL,
-<a name="l00295"></a>00295                                             CPL_ERROR_NULL_INPUT,
-<a name="l00296"></a>00296                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00297"></a>00297     cassure_automsg(                        n_coeffs > 0,
-<a name="l00298"></a>00298                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00299"></a>00299                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00300"></a>00300     
-<a name="l00301"></a>00301     <span class="comment">/* start */</span>
-<a name="l00302"></a>00302     ndims = cpl_polynomial_get_dimension(p);
-<a name="l00303"></a>00303     pows = cpl_calloc(ndims, <span class="keyword">sizeof</span>(*pows));
-<a name="l00304"></a>00304     
-<a name="l00305"></a>00305     overflow = <a class="code" href="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0">fors_polynomial_powers_find_first_coeff</a>(p, pows);
-<a name="l00306"></a>00306     n = 0;
-<a name="l00307"></a>00307     <span class="keywordflow">while</span> (!overflow)
-<a name="l00308"></a>00308     {
-<a name="l00309"></a>00309         cassure(                            n < n_coeffs,
-<a name="l00310"></a>00310                                             CPL_ERROR_ACCESS_OUT_OF_RANGE,
-<a name="l00311"></a>00311                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l00312"></a>00312                                             <span class="stringliteral">"p contains more coefficients "</span>
-<a name="l00313"></a>00313                                             <span class="stringliteral">"than coeffs"</span>);
-<a name="l00314"></a>00314         cpl_polynomial_set_coeff(p, pows, coeffs[n]);
-<a name="l00315"></a>00315         n++;
-<a name="l00316"></a>00316         
-<a name="l00317"></a>00317         overflow = <a class="code" href="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073">fors_polynomial_powers_find_next_coeff</a>(p, pows);
-<a name="l00318"></a>00318     }
-<a name="l00319"></a>00319     
-<a name="l00320"></a>00320     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00321"></a>00321     
-<a name="l00322"></a>00322     <span class="keywordflow">return</span>  cpl_errorstate_is_equal(errstat) ?
-<a name="l00323"></a>00323                 CPL_ERROR_NONE :
-<a name="l00324"></a>00324                 cpl_error_get_code();
-<a name="l00325"></a>00325 }
-<a name="l00326"></a>00326 
-<a name="l00327"></a>00327 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00328"></a>00328 <span class="preprocessor">#undef cleanup</span>
-<a name="l00329"></a>00329 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00330"></a>00330 <span class="preprocessor">do { \</span>
-<a name="l00331"></a>00331 <span class="preprocessor">    if (powersA != NULL) { cpl_free(powersA); powersA = NULL;} \</span>
-<a name="l00332"></a>00332 <span class="preprocessor">    if (powersB != NULL) { cpl_free(powersB); powersB = NULL;} \</span>
-<a name="l00333"></a>00333 <span class="preprocessor">    if (powersE != NULL) { cpl_free(powersE); powersE = NULL;} \</span>
-<a name="l00334"></a>00334 <span class="preprocessor">    cpl_polynomial_delete(ep); ep = NULL; \</span>
-<a name="l00335"></a>00335 <span class="preprocessor">} while (0)</span>
-<a name="l00336"></a>00336 <span class="preprocessor"></span>
-<a name="l00354"></a>00354 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00355"></a>00355 cpl_polynomial*
-<a name="l00356"></a><a class="code" href="group__fors__polynomial.html#ga116e293092bfb1db2c5e90504e90cc0">00356</a> <a class="code" href="group__fors__polynomial.html#ga116e293092bfb1db2c5e90504e90cc0">fors_polynomial_create_variance_polynomial</a>( <span class="keyword">const</span> cpl_polynomial    *p_def,
-<a name="l00357"></a>00357                                             <span class="keyword">const</span> cpl_matrix        *cov_coeff)
-<a name="l00358"></a>00358 {
-<a name="l00359"></a>00359     <span class="keywordtype">int</span>             n_dims,
-<a name="l00360"></a>00360                     n_coeffs,
-<a name="l00361"></a>00361                     n_col,
-<a name="l00362"></a>00362                     ia = 0;
-<a name="l00363"></a>00363     cpl_size        *powersA = NULL,
-<a name="l00364"></a>00364                     *powersB = NULL,
-<a name="l00365"></a>00365                     *powersE = NULL;
-<a name="l00366"></a>00366     cpl_polynomial  *ep = NULL;
-<a name="l00367"></a>00367     <span class="keywordtype">bool</span>            overflowa = <span class="keyword">false</span>;
-<a name="l00368"></a>00368     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00369"></a>00369     
-<a name="l00370"></a>00370     <span class="comment">/* check input */</span>
-<a name="l00371"></a>00371     cassure_automsg(                        p_def != NULL,
-<a name="l00372"></a>00372                                             CPL_ERROR_NULL_INPUT,
-<a name="l00373"></a>00373                                             <span class="keywordflow">return</span> ep);
-<a name="l00374"></a>00374     cassure_automsg(                        cov_coeff != NULL,
-<a name="l00375"></a>00375                                             CPL_ERROR_NULL_INPUT,
-<a name="l00376"></a>00376                                             <span class="keywordflow">return</span> ep);
-<a name="l00377"></a>00377     
-<a name="l00378"></a>00378     n_coeffs = <a class="code" href="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679">fors_polynomial_count_coeff</a>(p_def);
-<a name="l00379"></a>00379     n_dims = cpl_polynomial_get_dimension(p_def);
-<a name="l00380"></a>00380     n_col = cpl_matrix_get_ncol(cov_coeff);
-<a name="l00381"></a>00381     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> ep);
-<a name="l00382"></a>00382     
-<a name="l00383"></a>00383     cassure(                                n_coeffs == n_col,
-<a name="l00384"></a>00384                                             CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l00385"></a>00385                                             <span class="keywordflow">return</span> ep,
-<a name="l00386"></a>00386                                             <span class="stringliteral">"number of p_def coefficients "</span>
-<a name="l00387"></a>00387                                             <span class="stringliteral">"!= nr of columns"</span>);
-<a name="l00388"></a>00388     cassure(                                n_col == cpl_matrix_get_nrow(
-<a name="l00389"></a>00389                                                         cov_coeff),
-<a name="l00390"></a>00390                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00391"></a>00391                                             <span class="keywordflow">return</span> ep,
-<a name="l00392"></a>00392                                             <span class="stringliteral">"cov_coeff is not square"</span>);
-<a name="l00393"></a>00393     
-<a name="l00394"></a>00394     ep = cpl_polynomial_new(n_dims);
-<a name="l00395"></a>00395     powersA = cpl_calloc(n_dims, <span class="keyword">sizeof</span>(*powersA));
-<a name="l00396"></a>00396     powersB = cpl_calloc(n_dims, <span class="keyword">sizeof</span>(*powersB));
-<a name="l00397"></a>00397     powersE = cpl_calloc(n_dims, <span class="keyword">sizeof</span>(*powersE));
-<a name="l00398"></a>00398     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> ep);
-<a name="l00399"></a>00399     
-<a name="l00400"></a>00400     overflowa = <a class="code" href="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0">fors_polynomial_powers_find_first_coeff</a>(p_def, powersA);
-<a name="l00401"></a>00401     <span class="keywordflow">while</span> (!overflowa)
-<a name="l00402"></a>00402     {
-<a name="l00403"></a>00403         <span class="keywordtype">bool</span>    overflowb = <span class="keyword">false</span>;
-<a name="l00404"></a>00404         <span class="keywordtype">int</span>     ib = 0;
-<a name="l00405"></a>00405         
-<a name="l00406"></a>00406         overflowb = <a class="code" href="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0">fors_polynomial_powers_find_first_coeff</a>(p_def, powersB);
-<a name="l00407"></a>00407         <span class="keywordflow">while</span> (!overflowb)
-<a name="l00408"></a>00408         {
-<a name="l00409"></a>00409             <span class="keywordtype">double</span>  coeff;
-<a name="l00410"></a>00410             <span class="keywordtype">int</span>     d;
-<a name="l00411"></a>00411             passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> ep);
-<a name="l00412"></a>00412             <span class="comment">/* Add cov_ij to the proper coeff:</span>
-<a name="l00413"></a>00413 <span class="comment">             * cov_ij * dp/d(ai) * dp/d(aj) =</span>
-<a name="l00414"></a>00414 <span class="comment">             * cov_ij * (x^degx[i] * y^degy[i]) * (x^degx[i] * y^degy[i]) =</span>
-<a name="l00415"></a>00415 <span class="comment">             * cov_ij * x^(degx[i]+degx[j]) * y^(degy[i] + degy[j]),</span>
-<a name="l00416"></a>00416 <span class="comment">             * </span>
-<a name="l00417"></a>00417 <span class="comment">             * i.e. add cov_ij to</span>
-<a name="l00418"></a>00418 <span class="comment">             * coeff (degx[i]+degx[j], degy[i]+degy[j]) </span>
-<a name="l00419"></a>00419 <span class="comment">             */</span>
-<a name="l00420"></a>00420             <span class="keywordflow">for</span> (d = 0; d < n_dims; d++)
-<a name="l00421"></a>00421                 powersE[d] = powersA[d] + powersB[d];
-<a name="l00422"></a>00422             
-<a name="l00423"></a>00423             coeff = cpl_polynomial_get_coeff(ep, powersE);
-<a name="l00424"></a>00424             cpl_polynomial_set_coeff(ep, powersE,
-<a name="l00425"></a>00425                                      coeff
-<a name="l00426"></a>00426                                      + cpl_matrix_get(
-<a name="l00427"></a>00427                                         cov_coeff, ia, ib));
-<a name="l00428"></a>00428             
-<a name="l00429"></a>00429             ib++;
-<a name="l00430"></a>00430             overflowb = <a class="code" href="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073">fors_polynomial_powers_find_next_coeff</a>(p_def, powersB);
-<a name="l00431"></a>00431         }
-<a name="l00432"></a>00432         ia++;
-<a name="l00433"></a>00433         overflowa = <a class="code" href="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073">fors_polynomial_powers_find_next_coeff</a>(p_def, powersA);
-<a name="l00434"></a>00434     }
-<a name="l00435"></a>00435     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> ep);
-<a name="l00436"></a>00436     
-<a name="l00437"></a>00437     cpl_polynomial  *ret_ep = ep; ep = NULL;
-<a name="l00438"></a>00438     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00439"></a>00439     
-<a name="l00440"></a>00440     <span class="keywordflow">return</span> ret_ep;
-<a name="l00441"></a>00441 }
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00444"></a>00444 <span class="preprocessor">#undef cleanup</span>
-<a name="l00445"></a>00445 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00446"></a>00446 <span class="preprocessor">do { \</span>
-<a name="l00447"></a>00447 <span class="preprocessor">    if (pows != NULL) \</span>
-<a name="l00448"></a>00448 <span class="preprocessor">        cpl_free(pows); \</span>
-<a name="l00449"></a>00449 <span class="preprocessor">    pows = NULL; \</span>
-<a name="l00450"></a>00450 <span class="preprocessor">    if (ndxstr != NULL) \</span>
-<a name="l00451"></a>00451 <span class="preprocessor">        cpl_free(ndxstr); \</span>
-<a name="l00452"></a>00452 <span class="preprocessor">    ndxstr = NULL; \</span>
-<a name="l00453"></a>00453 <span class="preprocessor">} while (0)</span>
-<a name="l00454"></a>00454 <span class="preprocessor"></span>
-<a name="l00463"></a>00463 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00464"></a>00464 cpl_error_code
-<a name="l00465"></a><a class="code" href="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb">00465</a> <a class="code" href="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb">fors_polynomial_dump</a>(                       <span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00466"></a>00466                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name,
-<a name="l00467"></a>00467                                             cpl_msg_severity        level,
-<a name="l00468"></a>00468                                             <span class="keyword">const</span> cpl_polynomial    *p_def)
-<a name="l00469"></a>00469 {
-<a name="l00470"></a>00470     <span class="keywordtype">int</span>             ndims,
-<a name="l00471"></a>00471                     ndegs,
-<a name="l00472"></a>00472                     dim;
-<a name="l00473"></a>00473     cpl_size        *pows = NULL;
-<a name="l00474"></a>00474     <span class="keywordtype">char</span>            *ndxstr = NULL;
-<a name="l00475"></a>00475     <span class="keywordtype">char</span>            max_ndx_str[15];
-<a name="l00476"></a>00476     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00477"></a>00477     
-<a name="l00478"></a>00478     <span class="comment">/* check input */</span>
-<a name="l00479"></a>00479     cassure_automsg(                        p != NULL,
-<a name="l00480"></a>00480                                             CPL_ERROR_NULL_INPUT,
-<a name="l00481"></a>00481                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00482"></a>00482     
-<a name="l00483"></a>00483     <span class="keywordflow">if</span> (p_def != NULL)
-<a name="l00484"></a>00484     {
-<a name="l00485"></a>00485         ndims = cpl_polynomial_get_dimension(p_def);
-<a name="l00486"></a>00486         cassure_automsg(                    ndims
-<a name="l00487"></a>00487                                             = cpl_polynomial_get_dimension(p),
-<a name="l00488"></a>00488                                             CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l00489"></a>00489                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00490"></a>00490     }
-<a name="l00491"></a>00491     <span class="keywordflow">else</span>
-<a name="l00492"></a>00492     {
-<a name="l00493"></a>00493         ndims = cpl_polynomial_get_dimension(p);
-<a name="l00494"></a>00494         p_def = p;
-<a name="l00495"></a>00495     }
-<a name="l00496"></a>00496     
-<a name="l00497"></a>00497     ndegs = cpl_polynomial_get_degree(p_def);
-<a name="l00498"></a>00498     
-<a name="l00499"></a>00499     pows = cpl_calloc(ndims, <span class="keyword">sizeof</span>(*pows));
-<a name="l00500"></a>00500     <span class="comment">/* allocate a string that can contain "%d,%d,...,%d" */</span>
-<a name="l00501"></a>00501     sprintf(max_ndx_str, <span class="stringliteral">"%d"</span>, ndegs);
-<a name="l00502"></a>00502     ndxstr = cpl_calloc(ndims*(strlen(max_ndx_str)+1), <span class="keyword">sizeof</span>(*ndxstr));
-<a name="l00503"></a>00503     
-<a name="l00504"></a>00504     <span class="comment">/* ATTENTION: below, the last dimension is the fastest index (for nicer</span>
-<a name="l00505"></a>00505 <span class="comment">     * printing). This differs from the strategy in all other polynomial</span>
-<a name="l00506"></a>00506 <span class="comment">     * handling functions above, so be careful when doing copy & paste!</span>
-<a name="l00507"></a>00507 <span class="comment">     */</span>
-<a name="l00508"></a>00508     <span class="keywordflow">while</span> (pows[0] <= ndegs) 
-<a name="l00509"></a>00509     {
-<a name="l00510"></a>00510         <span class="keywordflow">if</span> (<a class="code" href="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5">fors_polynomial_is_coeff_set</a>(p_def, pows))
-<a name="l00511"></a>00511         {
-<a name="l00512"></a>00512             <span class="keywordtype">double</span>  coeff;
-<a name="l00513"></a>00513             coeff = cpl_polynomial_get_coeff(p, pows);
-<a name="l00514"></a>00514             <span class="comment">/* create the index string */</span>
-<a name="l00515"></a>00515             sprintf(ndxstr, <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT, pows[0]);
-<a name="l00516"></a>00516             <span class="keywordflow">for</span> (dim = 1; dim < ndims; dim++)
-<a name="l00517"></a>00517                 sprintf(ndxstr+strlen(ndxstr), <span class="stringliteral">",%"</span>CPL_SIZE_FORMAT, pows[dim]);
-<a name="l00518"></a>00518             fors_msg(                       level,
-<a name="l00519"></a>00519                                             <span class="stringliteral">"%s_%s = %e"</span>,
-<a name="l00520"></a>00520                                             (name != NULL) ? name : <span class="stringliteral">"p"</span>,
-<a name="l00521"></a>00521                                             ndxstr,
-<a name="l00522"></a>00522                                             coeff);
-<a name="l00523"></a>00523         }
-<a name="l00524"></a>00524         
-<a name="l00525"></a>00525         dim = ndims-1;
-<a name="l00526"></a>00526         pows[dim]++;
-<a name="l00527"></a>00527         <span class="keywordflow">while</span>(dim > 0 && pows[dim] > ndegs) <span class="comment">/* carry over */</span>
-<a name="l00528"></a>00528         {
-<a name="l00529"></a>00529             pows[dim] = 0;
-<a name="l00530"></a>00530             dim--;
-<a name="l00531"></a>00531             pows[dim]++;
-<a name="l00532"></a>00532         }
-<a name="l00533"></a>00533     }
-<a name="l00534"></a>00534     
-<a name="l00535"></a>00535     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00536"></a>00536     
-<a name="l00537"></a>00537     <span class="keywordflow">return</span>  cpl_errorstate_is_equal(errstat) ?
-<a name="l00538"></a>00538                 CPL_ERROR_NONE :
-<a name="l00539"></a>00539                 cpl_error_get_code();
-<a name="l00540"></a>00540 }
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00543"></a>00543 <span class="preprocessor">#undef cleanup</span>
-<a name="l00544"></a><a class="code" href="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343">00544</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00545"></a>00545 <span class="preprocessor">do { \</span>
-<a name="l00546"></a>00546 <span class="preprocessor">    if (ndxstr != NULL) \</span>
-<a name="l00547"></a>00547 <span class="preprocessor">        cpl_free(ndxstr); \</span>
-<a name="l00548"></a>00548 <span class="preprocessor">    ndxstr = NULL; \</span>
-<a name="l00549"></a>00549 <span class="preprocessor">} while (0)</span>
-<a name="l00550"></a>00550 <span class="preprocessor"></span>
-<a name="l00561"></a>00561 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00562"></a>00562 <span class="keywordtype">char</span>*
-<a name="l00563"></a><a class="code" href="group__fors__polynomial.html#g54a749f0fe51db3713c776ffe5dd0b57">00563</a> <a class="code" href="group__fors__polynomial.html#g54a749f0fe51db3713c776ffe5dd0b57">fors_polynomial_sprint_coeff</a>(               <span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00564"></a>00564                                             cpl_size                *powers,
-<a name="l00565"></a>00565                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *prefix)
-<a name="l00566"></a>00566 {
-<a name="l00567"></a>00567     <span class="keywordtype">int</span>             ndims,
-<a name="l00568"></a>00568                     ndegs,
-<a name="l00569"></a>00569                     dim,
-<a name="l00570"></a>00570                     max_nr,
-<a name="l00571"></a>00571                     max_nr_strlen;
-<a name="l00572"></a>00572     <span class="keywordtype">char</span>            *ndxstr = NULL;
-<a name="l00573"></a>00573     <span class="keywordtype">char</span>            max_ndx_str[15];
-<a name="l00574"></a>00574     
-<a name="l00575"></a>00575     <span class="comment">/* check input */</span>
-<a name="l00576"></a>00576     cassure_automsg(                        p != NULL,
-<a name="l00577"></a>00577                                             CPL_ERROR_NULL_INPUT,
-<a name="l00578"></a>00578                                             <span class="keywordflow">return</span> ndxstr);
-<a name="l00579"></a>00579     cassure_automsg(                        powers != NULL,
-<a name="l00580"></a>00580                                             CPL_ERROR_NULL_INPUT,
-<a name="l00581"></a>00581                                             <span class="keywordflow">return</span> ndxstr);
-<a name="l00582"></a>00582     
-<a name="l00583"></a>00583     ndims = cpl_polynomial_get_dimension(p);
-<a name="l00584"></a>00584     ndegs = cpl_polynomial_get_degree(p);
-<a name="l00585"></a>00585     
-<a name="l00586"></a>00586     <span class="comment">/* be safe to cover maximum required str length */</span>
-<a name="l00587"></a>00587     <span class="comment">/* FIXME: catch negative numbers */</span>
-<a name="l00588"></a>00588     max_nr = ndegs;
-<a name="l00589"></a>00589     <span class="keywordflow">for</span> (dim = 0; dim < ndims; dim++)
-<a name="l00590"></a>00590         <span class="keywordflow">if</span> (powers[dim] > max_nr)
-<a name="l00591"></a>00591             max_nr = powers[dim];
-<a name="l00592"></a>00592     
-<a name="l00593"></a>00593     sprintf(max_ndx_str, <span class="stringliteral">"%d"</span>, max_nr);
-<a name="l00594"></a>00594     max_nr_strlen = strlen(max_ndx_str);
-<a name="l00595"></a>00595     <span class="keywordflow">if</span> (prefix != NULL && prefix[0] != <span class="charliteral">'\0'</span>)
-<a name="l00596"></a>00596     {
-<a name="l00597"></a>00597         <span class="keywordtype">int</span> len = strlen(prefix) + 1 + ndims*(max_nr_strlen+1);
-<a name="l00598"></a>00598         ndxstr = cpl_calloc(len, <span class="keyword">sizeof</span>(*ndxstr));
-<a name="l00599"></a>00599         sprintf(ndxstr, <span class="stringliteral">"%s_"</span>, prefix);
-<a name="l00600"></a>00600     }
-<a name="l00601"></a>00601     <span class="keywordflow">else</span>
-<a name="l00602"></a>00602     {
-<a name="l00603"></a>00603         ndxstr = cpl_calloc(ndims*(max_nr_strlen+1), <span class="keyword">sizeof</span>(*ndxstr));
-<a name="l00604"></a>00604     }
-<a name="l00605"></a>00605     <span class="comment">/* specify max length for snprintf including nul char */</span>
-<a name="l00606"></a>00606     snprintf(ndxstr+strlen(ndxstr),         max_nr_strlen+1,
-<a name="l00607"></a>00607                                             (powers[0] >= 0) ? <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT : <span class="stringliteral">"?"</span>,
-<a name="l00608"></a>00608                                             powers[0]);
-<a name="l00609"></a>00609     <span class="keywordflow">for</span> (dim = 1; dim < ndims; dim++)
-<a name="l00610"></a>00610         snprintf(ndxstr+strlen(ndxstr),     max_nr_strlen+2,
-<a name="l00611"></a>00611                                             (powers[dim] >= 0) ? <span class="stringliteral">",%"</span>CPL_SIZE_FORMAT : <span class="stringliteral">"?"</span>,
-<a name="l00612"></a>00612                                             powers[dim]);
-<a name="l00613"></a>00613     
-<a name="l00614"></a>00614     <span class="keywordflow">return</span> ndxstr;
-<a name="l00615"></a>00615 }
-<a name="l00616"></a>00616 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__polynomial_8c_source.html b/html/fors__polynomial_8c_source.html
new file mode 100644
index 0000000..9a63902
--- /dev/null
+++ b/html/fors__polynomial_8c_source.html
@@ -0,0 +1,608 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_polynomial.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_polynomial.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_polynomial.c,v 1.9 2013-02-15 10:55:19 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-02-15 10:55:19 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.9 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include "fors_polynomial.h"</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include "fors_utils.h"</span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="comment">    Prototypes</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <a class="code" href="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195" title="Implementation of the check whether a coefficient exists.">fors_polynomial_is_coeff_set</a>(               <span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>                                             <span class="keyword">const</span> cpl_size          *powers);</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <a class="code" href="group__fors__polynomial.html#ga16814ff8371aba44b9730bc3d516ef5f" title="Step the powers of a polynomials coefficient to the next.">fors_polynomial_powers_next</a>(                <span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>                                             cpl_size                *powers);</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="comment">    Private Implementation</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno"><a class="code" href="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195">   74</a></span> <a class="code" href="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195" title="Implementation of the check whether a coefficient exists.">fors_polynomial_is_coeff_set</a>(               <span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                                             <span class="keyword">const</span> cpl_size          *powers)</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> {</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     cassure_automsg(                        p != NULL,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                                             <span class="keywordflow">return</span> <span class="keyword">false</span>);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     cassure_automsg(                        powers != NULL,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                                             <span class="keywordflow">return</span> <span class="keyword">false</span>);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <span class="keywordflow">return</span> (fabs(cpl_polynomial_get_coeff(p, powers)) > DBL_EPSILON);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> }</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="group__fors__polynomial.html#ga16814ff8371aba44b9730bc3d516ef5f">   98</a></span> <a class="code" href="group__fors__polynomial.html#ga16814ff8371aba44b9730bc3d516ef5f" title="Step the powers of a polynomials coefficient to the next.">fors_polynomial_powers_next</a>(<span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>                             cpl_size                *powers)</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> {</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <span class="keywordtype">int</span>             dim = 0,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                     ndims,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                     ndegs;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="keywordtype">bool</span>            overflow = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     cassure_automsg(                        p != NULL,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     cassure_automsg(                        powers != NULL,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     ndims = cpl_polynomial_get_dimension(p);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     ndegs = cpl_polynomial_get_degree(p);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> <span class="keyword">true</span>);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     powers[dim]++;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="keywordflow">while</span>(dim < ndims && powers[dim] > ndegs) <span class="comment">/* carry over */</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     {</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>         powers[dim] = 0;</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>         dim++;</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>         overflow = (!(dim < ndims));</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>         <span class="keywordflow">if</span> (!overflow)</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>             powers[dim]++;</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     }</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     </div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">return</span> overflow;</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> }</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="comment">    Public Implementation</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="preprocessor">    if (pows != NULL) \</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="preprocessor">        cpl_free(pows); \</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="preprocessor">    pows = NULL; \</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno"><a class="code" href="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff">  150</a></span> <a class="code" href="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff" title="Count the total number of non-zero coefficients.">fors_polynomial_count_coeff</a>(                <span class="keyword">const</span> cpl_polynomial    *p)</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> {</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="keywordtype">int</span>             ndims,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                     Ncoeff = 0;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     cpl_size       *pows = NULL;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="keywordtype">bool</span>            overflow = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     </div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     cassure_automsg(                        p != NULL,</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>                                             <span class="keywordflow">return</span> 0);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     ndims = cpl_polynomial_get_dimension(p);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> 0);</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     pows = cpl_calloc(ndims, <span class="keyword">sizeof</span>(*pows));</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="keywordflow">while</span> (!overflow) </div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     {</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>         <span class="keywordflow">if</span> (<a class="code" href="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195" title="Implementation of the check whether a coefficient exists.">fors_polynomial_is_coeff_set</a>(p, pows))</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>             Ncoeff++;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>         </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         overflow = <a class="code" href="group__fors__polynomial.html#ga16814ff8371aba44b9730bc3d516ef5f" title="Step the powers of a polynomials coefficient to the next.">fors_polynomial_powers_next</a>(p, pows);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> 0);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     cleanup;</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">return</span> Ncoeff;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> }</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno"><a class="code" href="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e">  192</a></span> <a class="code" href="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e" title="Find the first non-zero coefficient.">fors_polynomial_powers_find_first_coeff</a>(<span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                                         cpl_size                *powers)</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> {</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordtype">int</span>             ndims,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                     dim;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="keywordtype">bool</span>            overflow;</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     cassure_automsg(                        p != NULL,</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     cassure_automsg(                        powers != NULL,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     </div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     ndims = cpl_polynomial_get_dimension(p);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     <span class="keywordflow">for</span> (dim = 0; dim < ndims; dim++)</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>         powers[dim] = 0;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">if</span> (<a class="code" href="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195" title="Implementation of the check whether a coefficient exists.">fors_polynomial_is_coeff_set</a>(p, powers))</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     overflow = <a class="code" href="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c" title="Find the next non-zero coefficient.">fors_polynomial_powers_find_next_coeff</a>(p, powers);</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> <span class="keyword">true</span>);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     cleanup;</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     <span class="keywordflow">return</span> overflow;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> }</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno"><a class="code" href="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c">  232</a></span> <a class="code" href="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c" title="Find the next non-zero coefficient.">fors_polynomial_powers_find_next_coeff</a>(<span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                                        cpl_size                *powers)</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> {</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     <span class="keywordtype">bool</span>            overflow;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     </div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cassure_automsg(                        p != NULL,</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     cassure_automsg(                        powers != NULL,</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>                                             <span class="keywordflow">return</span> <span class="keyword">true</span>);</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     overflow = <a class="code" href="group__fors__polynomial.html#ga16814ff8371aba44b9730bc3d516ef5f" title="Step the powers of a polynomials coefficient to the next.">fors_polynomial_powers_next</a>(p, powers);</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="keywordflow">while</span> (!overflow)</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     {</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>         <span class="keywordflow">if</span> (<a class="code" href="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195" title="Implementation of the check whether a coefficient exists.">fors_polynomial_is_coeff_set</a>(p, powers))</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>         </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>         overflow = <a class="code" href="group__fors__polynomial.html#ga16814ff8371aba44b9730bc3d516ef5f" title="Step the powers of a polynomials coefficient to the next.">fors_polynomial_powers_next</a>(p, powers);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     }</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> <span class="keyword">true</span>);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     cleanup;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordflow">return</span> overflow;</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> }</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> <span class="preprocessor">    if (pows != NULL) \</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> <span class="preprocessor">        cpl_free(pows); \</span></div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> <span class="preprocessor">    pows = NULL; \</span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> cpl_error_code</div>
+<div class="line"><a name="l00277"></a><span class="lineno"><a class="code" href="group__fors__polynomial.html#ga9363bc98285fa909170db1684e81a240">  277</a></span> <a class="code" href="group__fors__polynomial.html#ga9363bc98285fa909170db1684e81a240" title="Set the already existing coefficients in a polynomial to values taken from an array.">fors_polynomial_set_existing_coeff</a>(         cpl_polynomial  *p,</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *coeffs,</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>                                             <span class="keywordtype">int</span>             n_coeffs)</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> {</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     <span class="keywordtype">int</span>             n,</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>                     ndims;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_size       *pows = NULL;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="keywordtype">bool</span>            overflow = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">if</span> (p == NULL)</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     </div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     <span class="comment">/* check input */</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cassure_automsg(                        p != NULL,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     cassure_automsg(                        coeffs != NULL,</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     cassure_automsg(                        n_coeffs > 0,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="comment">/* start */</span></div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     ndims = cpl_polynomial_get_dimension(p);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     pows = cpl_calloc(ndims, <span class="keyword">sizeof</span>(*pows));</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     overflow = <a class="code" href="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e" title="Find the first non-zero coefficient.">fors_polynomial_powers_find_first_coeff</a>(p, pows);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     n = 0;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordflow">while</span> (!overflow)</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     {</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>         cassure(                            n < n_coeffs,</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                                             CPL_ERROR_ACCESS_OUT_OF_RANGE,</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>                                             <span class="stringliteral">"p contains more coefficients "</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                                             <span class="stringliteral">"than coeffs"</span>);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>         cpl_polynomial_set_coeff(p, pows, coeffs[n]);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         n++;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>         </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         overflow = <a class="code" href="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c" title="Find the next non-zero coefficient.">fors_polynomial_powers_find_next_coeff</a>(p, pows);</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     }</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     cleanup;</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     <span class="keywordflow">return</span>  cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                 CPL_ERROR_NONE :</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                 cpl_error_get_code();</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> }</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> </div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> <span class="preprocessor">    if (powersA != NULL) { cpl_free(powersA); powersA = NULL;} \</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> <span class="preprocessor">    if (powersB != NULL) { cpl_free(powersB); powersB = NULL;} \</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> <span class="preprocessor">    if (powersE != NULL) { cpl_free(powersE); powersE = NULL;} \</span></div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> <span class="preprocessor">    cpl_polynomial_delete(ep); ep = NULL; \</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> cpl_polynomial*</div>
+<div class="line"><a name="l00356"></a><span class="lineno"><a class="code" href="group__fors__polynomial.html#ga2de60ddde27a60692e8e116939ef5007">  356</a></span> <a class="code" href="group__fors__polynomial.html#ga2de60ddde27a60692e8e116939ef5007" title="Create a polynomial modelling the squared influence of the error of the coefficients of another polyn...">fors_polynomial_create_variance_polynomial</a>( <span class="keyword">const</span> cpl_polynomial    *p_def,</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>                                             <span class="keyword">const</span> cpl_matrix        *cov_coeff)</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> {</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     <span class="keywordtype">int</span>             n_dims,</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                     n_coeffs,</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>                     n_col,</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>                     ia = 0;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     cpl_size        *powersA = NULL,</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>                     *powersB = NULL,</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                     *powersE = NULL;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     cpl_polynomial  *ep = NULL;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keywordtype">bool</span>            overflowa = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     </div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="comment">/* check input */</span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     cassure_automsg(                        p_def != NULL,</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>                                             <span class="keywordflow">return</span> ep);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     cassure_automsg(                        cov_coeff != NULL,</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>                                             <span class="keywordflow">return</span> ep);</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     n_coeffs = <a class="code" href="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff" title="Count the total number of non-zero coefficients.">fors_polynomial_count_coeff</a>(p_def);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     n_dims = cpl_polynomial_get_dimension(p_def);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     n_col = cpl_matrix_get_ncol(cov_coeff);</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> ep);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     cassure(                                n_coeffs == n_col,</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>                                             CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>                                             <span class="keywordflow">return</span> ep,</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>                                             <span class="stringliteral">"number of p_def coefficients "</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>                                             <span class="stringliteral">"!= nr of columns"</span>);</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     cassure(                                n_col == cpl_matrix_get_nrow(</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>                                                         cov_coeff),</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>                                             <span class="keywordflow">return</span> ep,</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>                                             <span class="stringliteral">"cov_coeff is not square"</span>);</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     ep = cpl_polynomial_new(n_dims);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     powersA = cpl_calloc(n_dims, <span class="keyword">sizeof</span>(*powersA));</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     powersB = cpl_calloc(n_dims, <span class="keyword">sizeof</span>(*powersB));</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     powersE = cpl_calloc(n_dims, <span class="keyword">sizeof</span>(*powersE));</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> ep);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     </div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     overflowa = <a class="code" href="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e" title="Find the first non-zero coefficient.">fors_polynomial_powers_find_first_coeff</a>(p_def, powersA);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     <span class="keywordflow">while</span> (!overflowa)</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     {</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>         <span class="keywordtype">bool</span>    overflowb = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>         <span class="keywordtype">int</span>     ib = 0;</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>         </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>         overflowb = <a class="code" href="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e" title="Find the first non-zero coefficient.">fors_polynomial_powers_find_first_coeff</a>(p_def, powersB);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         <span class="keywordflow">while</span> (!overflowb)</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         {</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>             <span class="keywordtype">double</span>  coeff;</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>             <span class="keywordtype">int</span>     d;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>             passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> ep);</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>             <span class="comment">/* Add cov_ij to the proper coeff:</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> <span class="comment">             * cov_ij * dp/d(ai) * dp/d(aj) =</span></div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> <span class="comment">             * cov_ij * (x^degx[i] * y^degy[i]) * (x^degx[i] * y^degy[i]) =</span></div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> <span class="comment">             * cov_ij * x^(degx[i]+degx[j]) * y^(degy[i] + degy[j]),</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> <span class="comment">             * </span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> <span class="comment">             * i.e. add cov_ij to</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> <span class="comment">             * coeff (degx[i]+degx[j], degy[i]+degy[j]) </span></div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>             <span class="keywordflow">for</span> (d = 0; d < n_dims; d++)</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                 powersE[d] = powersA[d] + powersB[d];</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>             </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>             coeff = cpl_polynomial_get_coeff(ep, powersE);</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>             cpl_polynomial_set_coeff(ep, powersE,</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>                                      coeff</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>                                      + cpl_matrix_get(</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                                         cov_coeff, ia, ib));</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>             </div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>             ib++;</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>             overflowb = <a class="code" href="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c" title="Find the next non-zero coefficient.">fors_polynomial_powers_find_next_coeff</a>(p_def, powersB);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>         }</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>         ia++;</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         overflowa = <a class="code" href="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c" title="Find the next non-zero coefficient.">fors_polynomial_powers_find_next_coeff</a>(p_def, powersA);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     }</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> ep);</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     </div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     cpl_polynomial  *ret_ep = ep; ep = NULL;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     cleanup;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     </div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     <span class="keywordflow">return</span> ret_ep;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> }</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> <span class="preprocessor">    if (pows != NULL) \</span></div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> <span class="preprocessor">        cpl_free(pows); \</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> <span class="preprocessor">    pows = NULL; \</span></div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> <span class="preprocessor">    if (ndxstr != NULL) \</span></div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> <span class="preprocessor">        cpl_free(ndxstr); \</span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> <span class="preprocessor">    ndxstr = NULL; \</span></div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span> cpl_error_code</div>
+<div class="line"><a name="l00465"></a><span class="lineno"><a class="code" href="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981">  465</a></span> <a class="code" href="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981" title="Count the total number of non-zero coefficients.">fors_polynomial_dump</a>(                       <span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name,</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>                                             cpl_msg_severity        level,</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>                                             <span class="keyword">const</span> cpl_polynomial    *p_def)</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> {</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     <span class="keywordtype">int</span>             ndims,</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>                     ndegs,</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>                     dim;</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     cpl_size        *pows = NULL;</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     <span class="keywordtype">char</span>            *ndxstr = NULL;</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="keywordtype">char</span>            max_ndx_str[15];</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     <span class="comment">/* check input */</span></div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     cassure_automsg(                        p != NULL,</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     <span class="keywordflow">if</span> (p_def != NULL)</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     {</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         ndims = cpl_polynomial_get_dimension(p_def);</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         cassure_automsg(                    ndims</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                                             = cpl_polynomial_get_dimension(p),</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>                                             CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     }</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     {</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>         ndims = cpl_polynomial_get_dimension(p);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         p_def = p;</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     }</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     </div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     ndegs = cpl_polynomial_get_degree(p_def);</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     </div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     pows = cpl_calloc(ndims, <span class="keyword">sizeof</span>(*pows));</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     <span class="comment">/* allocate a string that can contain "%d,%d,...,%d" */</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     sprintf(max_ndx_str, <span class="stringliteral">"%d"</span>, ndegs);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     ndxstr = cpl_calloc(ndims*(strlen(max_ndx_str)+1), <span class="keyword">sizeof</span>(*ndxstr));</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     </div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     <span class="comment">/* ATTENTION: below, the last dimension is the fastest index (for nicer</span></div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> <span class="comment">     * printing). This differs from the strategy in all other polynomial</span></div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> <span class="comment">     * handling functions above, so be careful when doing copy & paste!</span></div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     <span class="keywordflow">while</span> (pows[0] <= ndegs) </div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     {</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         <span class="keywordflow">if</span> (<a class="code" href="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195" title="Implementation of the check whether a coefficient exists.">fors_polynomial_is_coeff_set</a>(p_def, pows))</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>         {</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>             <span class="keywordtype">double</span>  coeff;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>             coeff = cpl_polynomial_get_coeff(p, pows);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>             <span class="comment">/* create the index string */</span></div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>             sprintf(ndxstr, <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT, pows[0]);</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>             <span class="keywordflow">for</span> (dim = 1; dim < ndims; dim++)</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>                 sprintf(ndxstr+strlen(ndxstr), <span class="stringliteral">",%"</span>CPL_SIZE_FORMAT, pows[dim]);</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>             fors_msg(                       level,</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>                                             <span class="stringliteral">"%s_%s = %e"</span>,</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>                                             (name != NULL) ? name : <span class="stringliteral">"p"</span>,</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>                                             ndxstr,</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>                                             coeff);</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>         }</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>         </div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>         dim = ndims-1;</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>         pows[dim]++;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>         <span class="keywordflow">while</span>(dim > 0 && pows[dim] > ndegs) <span class="comment">/* carry over */</span></div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>         {</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>             pows[dim] = 0;</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>             dim--;</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>             pows[dim]++;</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>         }</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     }</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     cleanup;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     </div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keywordflow">return</span>  cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>                 CPL_ERROR_NONE :</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>                 cpl_error_get_code();</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> }</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> </div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span> <span class="preprocessor">    if (ndxstr != NULL) \</span></div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span> <span class="preprocessor">        cpl_free(ndxstr); \</span></div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span> <span class="preprocessor">    ndxstr = NULL; \</span></div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span> <span class="keywordtype">char</span>*</div>
+<div class="line"><a name="l00563"></a><span class="lineno"><a class="code" href="group__fors__polynomial.html#ga498733e7d062578c77b1ae5c0f6f2935">  563</a></span> <a class="code" href="group__fors__polynomial.html#ga498733e7d062578c77b1ae5c0f6f2935" title="Print a coefficient's name into a newly allocated string.">fors_polynomial_sprint_coeff</a>(               <span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>                                             cpl_size                *powers,</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *prefix)</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> {</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     <span class="keywordtype">int</span>             ndims,</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>                     ndegs,</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>                     dim,</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>                     max_nr,</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>                     max_nr_strlen;</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     <span class="keywordtype">char</span>            *ndxstr = NULL;</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     <span class="keywordtype">char</span>            max_ndx_str[15];</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     <span class="comment">/* check input */</span></div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     cassure_automsg(                        p != NULL,</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>                                             <span class="keywordflow">return</span> ndxstr);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>     cassure_automsg(                        powers != NULL,</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>                                             <span class="keywordflow">return</span> ndxstr);</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>     </div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     ndims = cpl_polynomial_get_dimension(p);</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     ndegs = cpl_polynomial_get_degree(p);</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     </div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     <span class="comment">/* be safe to cover maximum required str length */</span></div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     <span class="comment">/* FIXME: catch negative numbers */</span></div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     max_nr = ndegs;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordflow">for</span> (dim = 0; dim < ndims; dim++)</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>         <span class="keywordflow">if</span> (powers[dim] > max_nr)</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>             max_nr = powers[dim];</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     </div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     sprintf(max_ndx_str, <span class="stringliteral">"%d"</span>, max_nr);</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     max_nr_strlen = strlen(max_ndx_str);</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordflow">if</span> (prefix != NULL && prefix[0] != <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     {</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         <span class="keywordtype">int</span> len = strlen(prefix) + 1 + ndims*(max_nr_strlen+1);</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         ndxstr = cpl_calloc(len, <span class="keyword">sizeof</span>(*ndxstr));</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>         sprintf(ndxstr, <span class="stringliteral">"%s_"</span>, prefix);</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     }</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     {</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         ndxstr = cpl_calloc(ndims*(max_nr_strlen+1), <span class="keyword">sizeof</span>(*ndxstr));</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     }</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     <span class="comment">/* specify max length for snprintf including nul char */</span></div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     snprintf(ndxstr+strlen(ndxstr),         max_nr_strlen+1,</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>                                             (powers[0] >= 0) ? <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT : <span class="stringliteral">"?"</span>,</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>                                             powers[0]);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     <span class="keywordflow">for</span> (dim = 1; dim < ndims; dim++)</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         snprintf(ndxstr+strlen(ndxstr),     max_nr_strlen+2,</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>                                             (powers[dim] >= 0) ? <span class="stringliteral">",%"</span>CPL_SIZE_FORMAT : <span class="stringliteral">"?"</span>,</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>                                             powers[dim]);</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     </div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     <span class="keywordflow">return</span> ndxstr;</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> }</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__polynomial_8h-source.html b/html/fors__polynomial_8h-source.html
deleted file mode 100644
index 7139a35..0000000
--- a/html/fors__polynomial_8h-source.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_polynomial.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_polynomial.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_polynomial.h,v 1.5 2012/01/27 18:51:59 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/01/27 18:51:59 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.5 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_POLYNOMIAL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_POLYNOMIAL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keywordtype">int</span>
-<a name="l00036"></a>00036 <a class="code" href="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679">fors_polynomial_count_coeff</a>(                <span class="keyword">const</span> cpl_polynomial    *p);
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keywordtype">int</span>
-<a name="l00039"></a>00039 <a class="code" href="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0">fors_polynomial_powers_find_first_coeff</a>(    <span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00040"></a>00040                                             cpl_size                *powers);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keywordtype">int</span>
-<a name="l00043"></a>00043 <a class="code" href="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073">fors_polynomial_powers_find_next_coeff</a>(     <span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00044"></a>00044                                             cpl_size                *powers);
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 cpl_error_code
-<a name="l00047"></a>00047 <a class="code" href="group__fors__polynomial.html#g2255e6cc731c54c6b5575e506bd5fea8">fors_polynomial_set_existing_coeff</a>(         cpl_polynomial          *p,
-<a name="l00048"></a>00048                                             <span class="keyword">const</span> <span class="keywordtype">double</span>            *coeffs,
-<a name="l00049"></a>00049                                             <span class="keywordtype">int</span>                     n_coeffs);
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 cpl_polynomial*
-<a name="l00052"></a>00052 <a class="code" href="group__fors__polynomial.html#ga116e293092bfb1db2c5e90504e90cc0">fors_polynomial_create_variance_polynomial</a>( <span class="keyword">const</span> cpl_polynomial    *p_def,
-<a name="l00053"></a>00053                                             <span class="keyword">const</span> cpl_matrix        *cov_coeff);
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 cpl_error_code
-<a name="l00056"></a>00056 <a class="code" href="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb">fors_polynomial_dump</a>(                       <span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00057"></a>00057                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name,
-<a name="l00058"></a>00058                                             cpl_msg_severity        level,
-<a name="l00059"></a>00059                                             <span class="keyword">const</span> cpl_polynomial    *p_def);
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 <span class="keywordtype">char</span>*
-<a name="l00062"></a>00062 <a class="code" href="group__fors__polynomial.html#g54a749f0fe51db3713c776ffe5dd0b57">fors_polynomial_sprint_coeff</a>(               <span class="keyword">const</span> cpl_polynomial    *p,
-<a name="l00063"></a>00063                                             cpl_size                *powers,
-<a name="l00064"></a>00064                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *prefix);
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 CPL_END_DECLS
-<a name="l00067"></a>00067 
-<a name="l00068"></a>00068 <span class="preprocessor">#endif  </span><span class="comment">/* FORS_POLYNOMIAL_H */</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__polynomial_8h_source.html b/html/fors__polynomial_8h_source.html
new file mode 100644
index 0000000..33f0bd8
--- /dev/null
+++ b/html/fors__polynomial_8h_source.html
@@ -0,0 +1,129 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_polynomial.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_polynomial.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_polynomial.h,v 1.5 2012-01-27 18:51:59 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012-01-27 18:51:59 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.5 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_POLYNOMIAL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_POLYNOMIAL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <a class="code" href="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff" title="Count the total number of non-zero coefficients.">fors_polynomial_count_coeff</a>(                <span class="keyword">const</span> cpl_polynomial    *p);</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <a class="code" href="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e" title="Find the first non-zero coefficient.">fors_polynomial_powers_find_first_coeff</a>(    <span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>                                             cpl_size                *powers);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <a class="code" href="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c" title="Find the next non-zero coefficient.">fors_polynomial_powers_find_next_coeff</a>(     <span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>                                             cpl_size                *powers);</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> cpl_error_code</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <a class="code" href="group__fors__polynomial.html#ga9363bc98285fa909170db1684e81a240" title="Set the already existing coefficients in a polynomial to values taken from an array.">fors_polynomial_set_existing_coeff</a>(         cpl_polynomial          *p,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>                                             <span class="keyword">const</span> <span class="keywordtype">double</span>            *coeffs,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>                                             <span class="keywordtype">int</span>                     n_coeffs);</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> cpl_polynomial*</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <a class="code" href="group__fors__polynomial.html#ga2de60ddde27a60692e8e116939ef5007" title="Create a polynomial modelling the squared influence of the error of the coefficients of another polyn...">fors_polynomial_create_variance_polynomial</a>( <span class="keyword">const</span> cpl_polynomial    *p_def,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>                                             <span class="keyword">const</span> cpl_matrix        *cov_coeff);</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> cpl_error_code</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <a class="code" href="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981" title="Count the total number of non-zero coefficients.">fors_polynomial_dump</a>(                       <span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *name,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>                                             cpl_msg_severity        level,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>                                             <span class="keyword">const</span> cpl_polynomial    *p_def);</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keywordtype">char</span>*</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <a class="code" href="group__fors__polynomial.html#ga498733e7d062578c77b1ae5c0f6f2935" title="Print a coefficient's name into a newly allocated string.">fors_polynomial_sprint_coeff</a>(               <span class="keyword">const</span> cpl_polynomial    *p,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>                                             cpl_size                *powers,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>              *prefix);</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">#endif  </span><span class="comment">/* FORS_POLYNOMIAL_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__qc-test_8c-source.html b/html/fors__qc-test_8c-source.html
deleted file mode 100644
index 5ab4e04..0000000
--- a/html/fors__qc-test_8c-source.html
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_qc-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_qc-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_qc-test.c,v 1.8 2007/10/12 11:17:47 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/10/12 11:17:47 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <test.h></span>
-<a name="l00034"></a>00034 
-<a name="l00044"></a>00044 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00045"></a><a class="code" href="group__fors__qc__test.html#gc197343ddbbc1be506ec5a221e90dadd">00045</a> <a class="code" href="group__fors__qc__test.html#gc197343ddbbc1be506ec5a221e90dadd">test_qc</a>(<span class="keywordtype">void</span>)
-<a name="l00046"></a>00046 {
-<a name="l00047"></a>00047     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qcdic_version = <span class="stringliteral">"2.0"</span>;
-<a name="l00048"></a>00048     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> instrument[] = {<span class="stringliteral">"FORS1"</span>, <span class="stringliteral">"FORS2"</span>};
-<a name="l00049"></a>00049     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc_name[] = {<span class="stringliteral">"SOME.QC"</span>, <span class="stringliteral">"SOME.OTHER.QC"</span>};
-<a name="l00050"></a>00050     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc_value[] = {<span class="stringliteral">"some value"</span>, <span class="stringliteral">"some other value"</span>};
-<a name="l00051"></a>00051     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc_comment[] = {<span class="stringliteral">"some comment"</span>, <span class="stringliteral">"some other comment"</span>};
-<a name="l00052"></a>00052     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> keyword_name[] = {<span class="stringliteral">"ESO SOME KEYWORD"</span>, 
-<a name="l00053"></a>00053                                         <span class="stringliteral">"ESO SOME OTHER KEYWORD"</span>};
-<a name="l00054"></a>00054     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> keyword_value[] = {<span class="stringliteral">"some key value"</span>, 
-<a name="l00055"></a>00055                                          <span class="stringliteral">"some other key value"</span>};
-<a name="l00056"></a>00056     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> keyword_unit[] = {<span class="stringliteral">"some key unit"</span>, 
-<a name="l00057"></a>00057                                          <span class="stringliteral">"some other key unit"</span>};
-<a name="l00058"></a>00058     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> keyword_comment[] = {<span class="stringliteral">"some key comment"</span>, 
-<a name="l00059"></a>00059                                            <span class="stringliteral">"some other key comment"</span>};
-<a name="l00060"></a>00060     
-<a name="l00061"></a>00061     
-<a name="l00062"></a>00062     cpl_propertylist *header = cpl_propertylist_new();
-<a name="l00063"></a>00063     <span class="keywordtype">int</span> i;
-<a name="l00064"></a>00064     
-<a name="l00065"></a>00065     <span class="keywordflow">for</span> (i = 0; i < 2; i++) {
-<a name="l00066"></a>00066         cpl_propertylist_append_string(header, 
-<a name="l00067"></a>00067                                        keyword_name[i],
-<a name="l00068"></a>00068                                        keyword_value[i]);
-<a name="l00069"></a>00069     }
-<a name="l00070"></a>00070     
-<a name="l00071"></a>00071     <span class="keywordflow">for</span> (i = 0; i < 2; i++) {
-<a name="l00072"></a>00072         <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(header, qcdic_version, 
-<a name="l00073"></a>00073                             instrument[i]);
-<a name="l00074"></a>00074         
-<a name="l00075"></a>00075         <a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(qc_name[i], qc_value[i],
-<a name="l00076"></a>00076                              qc_comment[i], instrument[i]);
-<a name="l00077"></a>00077         
-<a name="l00078"></a>00078         <a class="code" href="group__forsqc.html#g033fc0f2f9e321c4ac98ee7f412b2c6e">fors_qc_write_double</a>(<span class="stringliteral">"QC.ZEROPOINT"</span>, 5.3, <span class="stringliteral">"mag"</span>,
-<a name="l00079"></a>00079                              <span class="stringliteral">"mean zeropoint"</span>, instrument[i]);
-<a name="l00080"></a>00080         
-<a name="l00081"></a>00081         <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, 
-<a name="l00082"></a>00082                                keyword_name[i],
-<a name="l00083"></a>00083                                keyword_unit[i],
-<a name="l00084"></a>00084                                keyword_comment[i],
-<a name="l00085"></a>00085                                instrument[i]);
-<a name="l00086"></a>00086         
-<a name="l00087"></a>00087         <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l00088"></a>00088     }
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090     cpl_propertylist_delete(header);
-<a name="l00091"></a>00091     <span class="keywordflow">return</span>;
-<a name="l00092"></a>00092 }
-<a name="l00093"></a>00093 
-<a name="l00094"></a>00094 
-<a name="l00098"></a><a class="code" href="group__fors__qc__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00098</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00099"></a>00099 {
-<a name="l00100"></a>00100     TEST_INIT;
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102     <a class="code" href="group__fors__qc__test.html#gc197343ddbbc1be506ec5a221e90dadd">test_qc</a>();
-<a name="l00103"></a>00103 
-<a name="l00104"></a>00104     TEST_END;
-<a name="l00105"></a>00105 }
-<a name="l00106"></a>00106 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__qc-test_8c_source.html b/html/fors__qc-test_8c_source.html
new file mode 100644
index 0000000..62561b3
--- /dev/null
+++ b/html/fors__qc-test_8c_source.html
@@ -0,0 +1,155 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_qc-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_qc-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_qc-test.c,v 1.8 2007-10-12 11:17:47 jmlarsen Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: jmlarsen $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007-10-12 11:17:47 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno"><a class="code" href="group__fors__qc__test.html#gabf987906c0b52a3ada25d6c611845f5c">   45</a></span> <a class="code" href="group__fors__qc__test.html#gabf987906c0b52a3ada25d6c611845f5c" title="Write QC log.">test_qc</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> {</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qcdic_version = <span class="stringliteral">"2.0"</span>;</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> instrument[] = {<span class="stringliteral">"FORS1"</span>, <span class="stringliteral">"FORS2"</span>};</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc_name[] = {<span class="stringliteral">"SOME.QC"</span>, <span class="stringliteral">"SOME.OTHER.QC"</span>};</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc_value[] = {<span class="stringliteral">"some value"</span>, <span class="stringliteral">"some other value"</span>};</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc_comment[] = {<span class="stringliteral">"some comment"</span>, <span class="stringliteral">"some other comment"</span>};</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> keyword_name[] = {<span class="stringliteral">"ESO SOME KEYWORD"</span>, </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>                                         <span class="stringliteral">"ESO SOME OTHER KEYWORD"</span>};</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> keyword_value[] = {<span class="stringliteral">"some key value"</span>, </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>                                          <span class="stringliteral">"some other key value"</span>};</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> keyword_unit[] = {<span class="stringliteral">"some key unit"</span>, </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>                                          <span class="stringliteral">"some other key unit"</span>};</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> keyword_comment[] = {<span class="stringliteral">"some key comment"</span>, </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>                                            <span class="stringliteral">"some other key comment"</span>};</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>     cpl_propertylist *header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     <span class="keywordflow">for</span> (i = 0; i < 2; i++) {</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>         cpl_propertylist_append_string(header, </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                                        keyword_name[i],</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                        keyword_value[i]);</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     }</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <span class="keywordflow">for</span> (i = 0; i < 2; i++) {</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>         <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(header, qcdic_version, </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                             instrument[i]);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>         </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>         <a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(qc_name[i], qc_value[i],</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>                              qc_comment[i], instrument[i]);</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>         </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>         <a class="code" href="group__forsqc.html#ga8355f62ab2783be464130e8de57487b3" title="Add double parameter to current QC1 group.">fors_qc_write_double</a>(<span class="stringliteral">"QC.ZEROPOINT"</span>, 5.3, <span class="stringliteral">"mag"</span>,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                              <span class="stringliteral">"mean zeropoint"</span>, instrument[i]);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>         </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>         <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                                keyword_name[i],</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                                keyword_unit[i],</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                                keyword_comment[i],</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                                instrument[i]);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>         </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>         <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     }</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> }</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="group__fors__qc__test.html#ga840291bc02cba5474a4cb46a9b9566fe">   98</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> {</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     TEST_INIT;</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <a class="code" href="group__fors__qc__test.html#gabf987906c0b52a3ada25d6c611845f5c" title="Write QC log.">test_qc</a>();</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     TEST_END;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> }</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__qc_8c-source.html b/html/fors__qc_8c-source.html
deleted file mode 100644
index e9bd63e..0000000
--- a/html/fors__qc_8c-source.html
+++ /dev/null
@@ -1,662 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_qc.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_qc.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_qc.c,v 1.10 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.10 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <ctype.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <string.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <unistd.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <math.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <fors_paf.h></span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#define DICT_LINE_LENGTH    (80)</span>
-<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#define MAX_PAF_NAME_LENGTH (80)</span>
-<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define PAF_ROOT_NAME       "qc"</span>
-<a name="l00048"></a>00048 <span class="preprocessor"></span>
-<a name="l00056"></a><a class="code" href="group__forsqc.html#gf875be6d318687206fdb50a7c61b7924">00056</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__forsqc.html#gf875be6d318687206fdb50a7c61b7924">fors_qc_dic_version</a> = <span class="stringliteral">"2.0"</span>;
-<a name="l00057"></a>00057 
-<a name="l00058"></a><a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">00058</a> <span class="keyword">static</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a> = NULL;
-<a name="l00059"></a><a class="code" href="group__forsqc.html#g5df2835c1cca8f93d1a98f3caff40ff4">00059</a> <span class="keyword">static</span> <span class="keywordtype">int</span>     <a class="code" href="group__forsqc.html#g5df2835c1cca8f93d1a98f3caff40ff4">pafIndex</a> = 0;
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 
-<a name="l00077"></a><a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">00077</a> cpl_error_code <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(cpl_propertylist *header,
-<a name="l00078"></a>00078                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *qcdic_version, 
-<a name="l00079"></a>00079                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)
-<a name="l00080"></a>00080 {
-<a name="l00081"></a>00081     <span class="keywordtype">char</span> pafName[MAX_PAF_NAME_LENGTH];
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a>)
-<a name="l00084"></a>00084         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_start_group"</span>, CPL_ERROR_FILE_ALREADY_OPEN);
-<a name="l00085"></a>00085 
-<a name="l00086"></a>00086     sprintf(pafName, <span class="stringliteral">"%s%.4d.paf"</span>, PAF_ROOT_NAME, <a class="code" href="group__forsqc.html#g5df2835c1cca8f93d1a98f3caff40ff4">pafIndex</a>);
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088     <span class="keywordflow">if</span> (!(<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a> = <a class="code" href="group__forsPaf.html#gb2e886163098d674eb07e95d96b38229">newForsPAF</a>(pafName, <span class="stringliteral">"QC1 parameters"</span>, NULL, NULL)))
-<a name="l00089"></a>00089         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_start_group"</span>, CPL_ERROR_FILE_NOT_CREATED);
-<a name="l00090"></a>00090     
-<a name="l00091"></a>00091     <a class="code" href="group__forsqc.html#ga4480637fba9623895546614d7a21fb5">fors_qc_write_qc_string</a>(header, 
-<a name="l00092"></a>00092                             <span class="stringliteral">"QC.DID"</span>, qcdic_version, <span class="stringliteral">"QC1 dictionary"</span>,
-<a name="l00093"></a>00093                             instrument);
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00096"></a>00096 
-<a name="l00097"></a>00097 }
-<a name="l00098"></a>00098 
-<a name="l00099"></a>00099 <span class="preprocessor">#undef cleanup</span>
-<a name="l00100"></a><a class="code" href="group__forsqc.html#g57cf6e6e2826eb178fd2d9c3e5695343">00100</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">do { \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">    cpl_propertylist_delete(header); \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">} while(0)</span>
-<a name="l00104"></a>00104 <span class="preprocessor"></span>
-<a name="l00115"></a><a class="code" href="group__forsqc.html#g1ccea526719a1be6c14de81963d81955">00115</a> <span class="keywordtype">void</span> <a class="code" href="group__forsqc.html#g1ccea526719a1be6c14de81963d81955">fors_qc_write_group_heading</a>(<span class="keyword">const</span> cpl_frame *raw_frame,
-<a name="l00116"></a>00116                                  <span class="keyword">const</span> <span class="keywordtype">char</span> *pro_catg,
-<a name="l00117"></a>00117                                  <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)
-<a name="l00118"></a>00118 {
-<a name="l00119"></a>00119     cpl_propertylist *header = NULL;
-<a name="l00120"></a>00120     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( raw_frame != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00121"></a>00121     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frame_get_filename(raw_frame) != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123     header = cpl_propertylist_load(cpl_frame_get_filename(raw_frame), 0);
-<a name="l00124"></a>00124     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load %s header"</span>,
-<a name="l00125"></a>00125             cpl_frame_get_filename(raw_frame));
-<a name="l00126"></a>00126     
-<a name="l00127"></a>00127     <a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, pro_catg,
-<a name="l00128"></a>00128                          <span class="stringliteral">"Product category"</span>, instrument);
-<a name="l00129"></a>00129     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Cannot write product category to "</span>
-<a name="l00130"></a>00130             <span class="stringliteral">"QC log file"</span>);
-<a name="l00131"></a>00131     
-<a name="l00132"></a>00132     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL, 
-<a name="l00133"></a>00133                            <span class="stringliteral">"DPR type"</span>, instrument);
-<a name="l00134"></a>00134     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword DPR TYPE in raw "</span>
-<a name="l00135"></a>00135             <span class="stringliteral">"frame header"</span>);
-<a name="l00136"></a>00136     
-<a name="l00137"></a>00137     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO TPL ID"</span>, NULL, 
-<a name="l00138"></a>00138                            <span class="stringliteral">"Template"</span>, instrument);
-<a name="l00139"></a>00139     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword TPL ID in raw "</span>
-<a name="l00140"></a>00140             <span class="stringliteral">"frame header"</span>);
-<a name="l00141"></a>00141     
-<a name="l00142"></a>00142     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS FILT1 NAME"</span>)) {
-<a name="l00143"></a>00143         <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,
-<a name="l00144"></a>00144                                <span class="stringliteral">"Filter name"</span>, instrument);
-<a name="l00145"></a>00145         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Failed to write ESO INS FILT1 NAME"</span>);
-<a name="l00146"></a>00146     }
-<a name="l00147"></a>00147     
-<a name="l00148"></a>00148     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,
-<a name="l00149"></a>00149                            <span class="stringliteral">"Collimator name"</span>, instrument);
-<a name="l00150"></a>00150     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword INS COLL NAME in raw "</span>
-<a name="l00151"></a>00151             <span class="stringliteral">"frame header"</span>);
-<a name="l00152"></a>00152     
-<a name="l00153"></a>00153     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l00154"></a>00154                            <span class="stringliteral">"Chip identifier"</span>, instrument);
-<a name="l00155"></a>00155     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword DET CHIP1 ID in raw "</span>
-<a name="l00156"></a>00156             <span class="stringliteral">"frame header"</span>);
-<a name="l00157"></a>00157     
-<a name="l00158"></a>00158     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>, NULL,    
-<a name="l00159"></a>00159                            <span class="stringliteral">"Binning factor along X"</span>, instrument);
-<a name="l00160"></a>00160     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00161"></a>00161             <span class="stringliteral">"in raw frame header"</span>);
-<a name="l00162"></a>00162     
-<a name="l00163"></a>00163     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET WIN1 BINY"</span>, NULL,
-<a name="l00164"></a>00164                            <span class="stringliteral">"Binning factor along Y"</span>, instrument);
-<a name="l00165"></a>00165     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword ESO DET WIN1 BINY "</span>
-<a name="l00166"></a>00166             <span class="stringliteral">"in raw frame header"</span>);
-<a name="l00167"></a>00167     
-<a name="l00168"></a>00168     <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l00169"></a>00169                            <span class="stringliteral">"Archive name of input data"</span>, 
-<a name="l00170"></a>00170                            instrument);
-<a name="l00171"></a>00171     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword ARCFILE in raw "</span>
-<a name="l00172"></a>00172             <span class="stringliteral">"frame header"</span>);
-<a name="l00173"></a>00173     
-<a name="l00174"></a>00174     {
-<a name="l00175"></a>00175         <span class="keywordtype">char</span> *pipefile = <a class="code" href="group__forsdfs.html#g34ac001c0471b1dc6dab4a0a38b7c4a2">dfs_generate_filename</a>(pro_catg);
-<a name="l00176"></a>00176         <a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile, 
-<a name="l00177"></a>00177                              <span class="stringliteral">"Pipeline product name"</span>, instrument);
-<a name="l00178"></a>00178         cpl_free(pipefile); pipefile = NULL;
-<a name="l00179"></a>00179         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);
-<a name="l00180"></a>00180     }
-<a name="l00181"></a>00181 
-<a name="l00182"></a>00182     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00183"></a>00183     <span class="keywordflow">return</span>;
-<a name="l00184"></a>00184 }
-<a name="l00185"></a>00185 
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187 
-<a name="l00200"></a><a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">00200</a> cpl_error_code <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>(<span class="keywordtype">void</span>)
-<a name="l00201"></a>00201 {
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203     <span class="keywordflow">if</span> (!<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a>)
-<a name="l00204"></a>00204         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_end_group"</span>, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206     <span class="keywordflow">if</span> (!<a class="code" href="group__forsPaf.html#ge80d2196e3845f5857f374416333edbc">forsPAFIsEmpty</a>(<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a>)) {
-<a name="l00207"></a>00207         <a class="code" href="group__forsPaf.html#g2cceff721bbbd99c1a4bddfb57ed688b">forsPAFWrite</a>(<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a>);
-<a name="l00208"></a>00208         <a class="code" href="group__forsqc.html#g5df2835c1cca8f93d1a98f3caff40ff4">pafIndex</a>++;
-<a name="l00209"></a>00209     }
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211     <a class="code" href="group__forsPaf.html#gefe94695ad068025eff46fe69998e75d">deleteForsPAF</a>(<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a>);
-<a name="l00212"></a>00212     <a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a> = NULL;
-<a name="l00213"></a>00213 
-<a name="l00214"></a>00214     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00215"></a>00215 
-<a name="l00216"></a>00216 }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218 
-<a name="l00235"></a><a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">00235</a> cpl_error_code <a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value, 
-<a name="l00236"></a>00236                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *comment, <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)
-<a name="l00237"></a>00237 {
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239     <span class="keywordtype">int</span> status;
-<a name="l00240"></a>00240     <span class="keywordtype">int</span>   length = strlen(instrument) + 3;
-<a name="l00241"></a>00241     <span class="keywordtype">char</span> *allComment;
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     <span class="keywordflow">if</span> (comment == NULL || name == NULL || instrument == NULL)
-<a name="l00245"></a>00245         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_write_string"</span>, CPL_ERROR_NULL_INPUT);
-<a name="l00246"></a>00246 
-<a name="l00247"></a>00247     length += strlen(comment) + 1;
-<a name="l00248"></a>00248 
-<a name="l00249"></a>00249     allComment = cpl_malloc(length * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l00250"></a>00250 
-<a name="l00251"></a>00251     sprintf(allComment, <span class="stringliteral">"%s [%s]"</span>, comment, instrument);
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253     status = <a class="code" href="group__forsPaf.html#gf615f1fbc45dd108391de129e67d58b2">forsPAFAppendString</a>(<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a>, name, value, allComment);
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255     cpl_free(allComment);
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257     <span class="keywordflow">if</span> (status)
-<a name="l00258"></a>00258         cpl_msg_error(<span class="stringliteral">"fors_qc_write_string"</span>, 
-<a name="l00259"></a>00259                       <span class="stringliteral">"Cannot write parameter %s to QC1 PAF"</span>, name);
-<a name="l00260"></a>00260 
-<a name="l00261"></a>00261     cpl_msg_debug(cpl_func, <span class="stringliteral">"%s [%s] = '%s'"</span>, comment, name, value);
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00264"></a>00264 
-<a name="l00265"></a>00265 }
-<a name="l00266"></a>00266 
-<a name="l00267"></a><a class="code" href="group__forsqc.html#ge4f20b9c870f3d6b30e3ee7a91c1db12">00267</a> cpl_error_code <a class="code" href="group__forsqc.html#ge4f20b9c870f3d6b30e3ee7a91c1db12">fors_qc_write_string_chat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value,
-<a name="l00268"></a>00268                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *comment, <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)
-<a name="l00269"></a>00269 {
-<a name="l00270"></a>00270 
-<a name="l00271"></a>00271     <span class="keywordtype">int</span> status;
-<a name="l00272"></a>00272     <span class="keywordtype">int</span>   length = strlen(instrument) + 3;
-<a name="l00273"></a>00273     <span class="keywordtype">char</span> *allComment;
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275 
-<a name="l00276"></a>00276     <span class="keywordflow">if</span> (comment == NULL || name == NULL || instrument == NULL)
-<a name="l00277"></a>00277         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_write_string_chat"</span>, CPL_ERROR_NULL_INPUT);
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     length += strlen(comment) + 1;
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281     allComment = cpl_malloc(length * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283     sprintf(allComment, <span class="stringliteral">"%s [%s]"</span>, comment, instrument);
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285     status = <a class="code" href="group__forsPaf.html#gf615f1fbc45dd108391de129e67d58b2">forsPAFAppendString</a>(<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a>, name, value, allComment);
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287     cpl_free(allComment);
-<a name="l00288"></a>00288 
-<a name="l00289"></a>00289     <span class="keywordflow">if</span> (status)
-<a name="l00290"></a>00290         cpl_msg_error(<span class="stringliteral">"fors_qc_write_string_chat"</span>,
-<a name="l00291"></a>00291                       <span class="stringliteral">"Cannot write parameter %s to QC1 PAF"</span>, name);
-<a name="l00292"></a>00292 
-<a name="l00293"></a>00293     cpl_msg_info(cpl_func, <span class="stringliteral">"%s [%s] = '%s'"</span>, comment, name, value);
-<a name="l00294"></a>00294 
-<a name="l00295"></a>00295     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297 }
-<a name="l00298"></a>00298 
-<a name="l00299"></a>00299 
-<a name="l00321"></a><a class="code" href="group__forsqc.html#g033fc0f2f9e321c4ac98ee7f412b2c6e">00321</a> cpl_error_code <a class="code" href="group__forsqc.html#g033fc0f2f9e321c4ac98ee7f412b2c6e">fors_qc_write_double</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">double</span> value, 
-<a name="l00322"></a>00322                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, <span class="keyword">const</span> <span class="keywordtype">char</span> *comment,
-<a name="l00323"></a>00323                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)
-<a name="l00324"></a>00324 {
-<a name="l00325"></a>00325 
-<a name="l00326"></a>00326     cpl_error_code status;
-<a name="l00327"></a>00327     <span class="keywordtype">int</span>   length = strlen(instrument) + 3;
-<a name="l00328"></a>00328     <span class="keywordtype">char</span> *allComment;
-<a name="l00329"></a>00329 
-<a name="l00330"></a>00330 
-<a name="l00331"></a>00331     <span class="keywordflow">if</span> (comment == NULL || name == NULL || instrument == NULL)
-<a name="l00332"></a>00332         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_write_double"</span>, CPL_ERROR_NULL_INPUT);
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     length += strlen(comment) + 1;
-<a name="l00335"></a>00335 
-<a name="l00336"></a>00336     <span class="keywordflow">if</span> (unit)
-<a name="l00337"></a>00337       length += strlen(unit) + 3;
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339     allComment = cpl_malloc(length * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l00340"></a>00340 
-<a name="l00341"></a>00341     <span class="keywordflow">if</span> (unit)
-<a name="l00342"></a>00342       sprintf(allComment, <span class="stringliteral">"%s (%s) [%s]"</span>, comment, unit, instrument);
-<a name="l00343"></a>00343     <span class="keywordflow">else</span>
-<a name="l00344"></a>00344       sprintf(allComment, <span class="stringliteral">"%s [%s]"</span>, comment, instrument);
-<a name="l00345"></a>00345 
-<a name="l00346"></a>00346     status = <a class="code" href="group__forsPaf.html#gdd6ed0c50b7cf4c62fdbabd0794487e4">forsPAFAppendDouble</a>(<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a>, name, value, allComment);
-<a name="l00347"></a>00347 
-<a name="l00348"></a>00348     cpl_free(allComment);
-<a name="l00349"></a>00349 
-<a name="l00350"></a>00350     <span class="keywordflow">if</span> (status)
-<a name="l00351"></a>00351         cpl_msg_error(<span class="stringliteral">"fors_qc_write_double"</span>, 
-<a name="l00352"></a>00352                       <span class="stringliteral">"Cannot write parameter %s to QC1 PAF"</span>, name);
-<a name="l00353"></a>00353 
-<a name="l00354"></a>00354     cpl_msg_info(cpl_func, <span class="stringliteral">"%s [%s] = %f %s"</span>, 
-<a name="l00355"></a>00355                  comment, name, value, (unit != NULL) ? unit : <span class="stringliteral">""</span>);
-<a name="l00356"></a>00356 
-<a name="l00357"></a>00357     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359 }
-<a name="l00360"></a>00360 
-<a name="l00361"></a>00361 
-<a name="l00362"></a><a class="code" href="group__forsqc.html#gaa58844eac4549649cf2ae56b6405903">00362</a> cpl_error_code <a class="code" href="group__forsqc.html#gaa58844eac4549649cf2ae56b6405903">fors_qc_write_int</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">int</span> value, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, 
-<a name="l00363"></a>00363                              <span class="keyword">const</span> <span class="keywordtype">char</span> *comment, <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)
-<a name="l00364"></a>00364 {
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     cpl_error_code status;
-<a name="l00367"></a>00367     <span class="keywordtype">int</span>   length = strlen(instrument) + 3;
-<a name="l00368"></a>00368     <span class="keywordtype">char</span> *allComment;
-<a name="l00369"></a>00369 
-<a name="l00370"></a>00370 
-<a name="l00371"></a>00371     <span class="keywordflow">if</span> (comment == NULL || name == NULL || instrument == NULL)
-<a name="l00372"></a>00372         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_write_int"</span>, CPL_ERROR_NULL_INPUT);
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374     length += strlen(comment) + 1;
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     <span class="keywordflow">if</span> (unit)
-<a name="l00377"></a>00377       length += strlen(unit) + 3;
-<a name="l00378"></a>00378 
-<a name="l00379"></a>00379     allComment = cpl_malloc(length * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
-<a name="l00380"></a>00380 
-<a name="l00381"></a>00381     <span class="keywordflow">if</span> (unit)
-<a name="l00382"></a>00382       sprintf(allComment, <span class="stringliteral">"%s (%s) [%s]"</span>, comment, unit, instrument);
-<a name="l00383"></a>00383     <span class="keywordflow">else</span>
-<a name="l00384"></a>00384       sprintf(allComment, <span class="stringliteral">"%s [%s]"</span>, comment, instrument);
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386     status = <a class="code" href="group__forsPaf.html#gde7f65f7ca0d7e3e24babefd2c8d8716">forsPAFAppendInt</a>(<a class="code" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a>, name, value, allComment);
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388     cpl_free(allComment);
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390     <span class="keywordflow">if</span> (status)
-<a name="l00391"></a>00391         cpl_msg_error(<span class="stringliteral">"fors_qc_write_int"</span>, 
-<a name="l00392"></a>00392                       <span class="stringliteral">"Cannot write parameter %s to QC1 PAF"</span>, name);
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394     cpl_msg_info(cpl_func, <span class="stringliteral">"%s [%s] = %d %s"</span>, 
-<a name="l00395"></a>00395                  comment, name, value, (unit != NULL) ? unit : <span class="stringliteral">""</span>);
-<a name="l00396"></a>00396  
-<a name="l00397"></a>00397     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00398"></a>00398 
-<a name="l00399"></a>00399 }
-<a name="l00400"></a>00400 
-<a name="l00401"></a>00401 
-<a name="l00425"></a><a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">00425</a> cpl_error_code <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(cpl_propertylist *header, 
-<a name="l00426"></a>00426                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, 
-<a name="l00427"></a>00427                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *comment, 
-<a name="l00428"></a>00428                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)
-<a name="l00429"></a>00429 {
-<a name="l00430"></a>00430 
-<a name="l00431"></a>00431   <span class="keyword">const</span> <span class="keywordtype">char</span> func[] = <span class="stringliteral">"fors_qc_keyword_to_paf"</span>;
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433   <span class="keywordtype">char</span>            *keyName;
-<a name="l00434"></a>00434   <span class="keywordtype">char</span>            *keep;
-<a name="l00435"></a>00435   <span class="keywordtype">char</span>            *pos;
-<a name="l00436"></a>00436   <span class="keywordtype">int</span>              ivalue;
-<a name="l00437"></a>00437   <span class="keywordtype">float</span>            fvalue;
-<a name="l00438"></a>00438   <span class="keywordtype">double</span>           dvalue;
-<a name="l00439"></a>00439   <span class="keywordtype">char</span>            *svalue = NULL;
-<a name="l00440"></a>00440   <span class="keywordtype">int</span>              status;
-<a name="l00441"></a>00441   <span class="keywordtype">int</span>              i;
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443 
-<a name="l00444"></a>00444   <span class="keywordflow">if</span> (header == NULL) {
-<a name="l00445"></a>00445     cpl_msg_error(func, <span class="stringliteral">"Empty header"</span>);
-<a name="l00446"></a>00446     <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l00447"></a>00447   }
-<a name="l00448"></a>00448 
-<a name="l00449"></a>00449   <span class="keywordflow">if</span> (!cpl_propertylist_has(header, name)) {
-<a name="l00450"></a>00450     cpl_msg_error(func, <span class="stringliteral">"Keyword %s not found"</span>, name);
-<a name="l00451"></a>00451     <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l00452"></a>00452   }
-<a name="l00453"></a>00453 
-<a name="l00454"></a>00454   <span class="keywordflow">switch</span> (cpl_propertylist_get_type(header, name)) {
-<a name="l00455"></a>00455   <span class="keywordflow">case</span> CPL_TYPE_INT :
-<a name="l00456"></a>00456     ivalue = cpl_propertylist_get_int(header, name);
-<a name="l00457"></a>00457     <span class="keywordflow">break</span>;
-<a name="l00458"></a>00458   <span class="keywordflow">case</span> CPL_TYPE_FLOAT :
-<a name="l00459"></a>00459     fvalue = cpl_propertylist_get_float(header, name);
-<a name="l00460"></a>00460     <span class="keywordflow">break</span>;
-<a name="l00461"></a>00461   <span class="keywordflow">case</span> CPL_TYPE_DOUBLE :
-<a name="l00462"></a>00462     dvalue = cpl_propertylist_get_double(header, name);
-<a name="l00463"></a>00463     <span class="keywordflow">break</span>;
-<a name="l00464"></a>00464   <span class="keywordflow">case</span> CPL_TYPE_STRING :
-<a name="l00465"></a>00465     svalue = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, name);
-<a name="l00466"></a>00466     <span class="keywordflow">break</span>;
-<a name="l00467"></a>00467   <span class="keywordflow">default</span> :
-<a name="l00468"></a>00468     cpl_msg_error(func, <span class="stringliteral">"Unsupported keyword type"</span>);
-<a name="l00469"></a>00469     <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l00470"></a>00470   }
-<a name="l00471"></a>00471 
-<a name="l00472"></a>00472 
-<a name="l00473"></a>00473   <span class="comment">/*</span>
-<a name="l00474"></a>00474 <span class="comment">   *  Construct entry name for PAF</span>
-<a name="l00475"></a>00475 <span class="comment">   */</span>
-<a name="l00476"></a>00476 
-<a name="l00477"></a>00477   keep = keyName = cpl_strdup(name);
-<a name="l00478"></a>00478 
-<a name="l00479"></a>00479   pos = strstr(keyName, <span class="stringliteral">"ESO "</span>);
-<a name="l00480"></a>00480 
-<a name="l00481"></a>00481   <span class="keywordflow">if</span> (pos == keyName)
-<a name="l00482"></a>00482     keyName += 4;
-<a name="l00483"></a>00483 
-<a name="l00484"></a>00484   <span class="keywordflow">for</span> (i = 0; keyName[i] != <span class="charliteral">'\0'</span>; i++)
-<a name="l00485"></a>00485     <span class="keywordflow">if</span> (keyName[i] == <span class="charliteral">' '</span>)
-<a name="l00486"></a>00486       keyName[i] = <span class="charliteral">'.'</span>;
-<a name="l00487"></a>00487 
-<a name="l00488"></a>00488   <span class="comment">/*</span>
-<a name="l00489"></a>00489 <span class="comment">   *  Now write entry to PAF object.</span>
-<a name="l00490"></a>00490 <span class="comment">   */</span>
-<a name="l00491"></a>00491 
-<a name="l00492"></a>00492   <span class="keywordflow">switch</span> (cpl_propertylist_get_type(header, name)) {
-<a name="l00493"></a>00493   <span class="keywordflow">case</span> CPL_TYPE_INT :
-<a name="l00494"></a>00494     status = <a class="code" href="group__forsqc.html#gaa58844eac4549649cf2ae56b6405903">fors_qc_write_int</a>(keyName, ivalue, unit, comment, instrument);
-<a name="l00495"></a>00495     <span class="keywordflow">break</span>;
-<a name="l00496"></a>00496   <span class="keywordflow">case</span> CPL_TYPE_FLOAT :
-<a name="l00497"></a>00497     dvalue = fvalue;
-<a name="l00498"></a>00498   <span class="keywordflow">case</span> CPL_TYPE_DOUBLE :
-<a name="l00499"></a>00499     status = <a class="code" href="group__forsqc.html#g033fc0f2f9e321c4ac98ee7f412b2c6e">fors_qc_write_double</a>(keyName, dvalue, unit, comment, instrument);
-<a name="l00500"></a>00500     <span class="keywordflow">break</span>;
-<a name="l00501"></a>00501   <span class="keywordflow">default</span> :    <span class="comment">/* CPL_TYPE_STRING */</span>
-<a name="l00502"></a>00502     status = <a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(keyName, svalue, comment, instrument);
-<a name="l00503"></a>00503   }
-<a name="l00504"></a>00504 
-<a name="l00505"></a>00505   <span class="keywordflow">if</span> (status)
-<a name="l00506"></a>00506     cpl_msg_error(func, <span class="stringliteral">"Could not copy keyword value to QC1 PAF!"</span>);
-<a name="l00507"></a>00507 
-<a name="l00508"></a>00508   cpl_free(keep);
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510   <span class="keywordflow">return</span> status;
-<a name="l00511"></a>00511 
-<a name="l00512"></a>00512 }
-<a name="l00513"></a>00513 
-<a name="l00535"></a><a class="code" href="group__forsqc.html#ga4480637fba9623895546614d7a21fb5">00535</a> cpl_error_code <a class="code" href="group__forsqc.html#ga4480637fba9623895546614d7a21fb5">fors_qc_write_qc_string</a>(cpl_propertylist *header,
-<a name="l00536"></a>00536                                        <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value, 
-<a name="l00537"></a>00537                                        <span class="keyword">const</span> <span class="keywordtype">char</span> *comment, 
-<a name="l00538"></a>00538                                        <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)
-<a name="l00539"></a>00539 {
-<a name="l00540"></a>00540     <span class="keyword">const</span> <span class="keywordtype">char</span> func[] = <span class="stringliteral">"fors_qc_write_qc_string"</span>;
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542     <span class="keywordtype">char</span> *header_name;
-<a name="l00543"></a>00543     <span class="keywordtype">int</span>   i;
-<a name="l00544"></a>00544 
-<a name="l00545"></a>00545     <span class="keywordflow">if</span> (strcmp(<span class="stringliteral">"QC.DID"</span>, name)) {
-<a name="l00546"></a>00546         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ge4f20b9c870f3d6b30e3ee7a91c1db12">fors_qc_write_string_chat</a>(name, value, comment, instrument)) {
-<a name="l00547"></a>00547             cpl_error_set_where(func);
-<a name="l00548"></a>00548             <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00549"></a>00549         }
-<a name="l00550"></a>00550     }
-<a name="l00551"></a>00551     <span class="keywordflow">else</span> {
-<a name="l00552"></a>00552         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(name, value, comment, instrument)) {
-<a name="l00553"></a>00553             cpl_error_set_where(func);
-<a name="l00554"></a>00554             <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00555"></a>00555         }
-<a name="l00556"></a>00556     }
-<a name="l00557"></a>00557 
-<a name="l00558"></a>00558     header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));
-<a name="l00559"></a>00559 
-<a name="l00560"></a>00560     strcpy(header_name, <span class="stringliteral">"ESO "</span>);
-<a name="l00561"></a>00561     strcat(header_name, name);
-<a name="l00562"></a>00562 
-<a name="l00563"></a>00563     <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)
-<a name="l00564"></a>00564         <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)
-<a name="l00565"></a>00565             header_name[i] = <span class="charliteral">' '</span>;
-<a name="l00566"></a>00566 
-<a name="l00567"></a>00567     <span class="keywordflow">if</span> (cpl_propertylist_update_string(header, header_name, value)) {
-<a name="l00568"></a>00568         cpl_free(header_name);
-<a name="l00569"></a>00569         cpl_error_set_where(func);
-<a name="l00570"></a>00570         <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00571"></a>00571     }
-<a name="l00572"></a>00572 
-<a name="l00573"></a>00573     cpl_propertylist_set_comment(header, header_name, comment);
-<a name="l00574"></a>00574 
-<a name="l00575"></a>00575     cpl_free(header_name);
-<a name="l00576"></a>00576 
-<a name="l00577"></a>00577     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00578"></a>00578 }
-<a name="l00579"></a>00579 
-<a name="l00604"></a><a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">00604</a> cpl_error_code <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(cpl_propertylist *header, <span class="keywordtype">double</span> value, 
-<a name="l00605"></a>00605                                       <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, 
-<a name="l00606"></a>00606                                       <span class="keyword">const</span> <span class="keywordtype">char</span> *comment,
-<a name="l00607"></a>00607                                       <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)
-<a name="l00608"></a>00608 {
-<a name="l00609"></a>00609 
-<a name="l00610"></a>00610   <span class="keyword">const</span> <span class="keywordtype">char</span> func[] = <span class="stringliteral">"fors_qc_write_qc_double"</span>;
-<a name="l00611"></a>00611 
-<a name="l00612"></a>00612   <span class="keywordtype">char</span> *header_name;
-<a name="l00613"></a>00613   <span class="keywordtype">int</span>   i;
-<a name="l00614"></a>00614 
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616   <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g033fc0f2f9e321c4ac98ee7f412b2c6e">fors_qc_write_double</a>(name, value, unit, comment, instrument)) {
-<a name="l00617"></a>00617       cpl_error_set_where(func);
-<a name="l00618"></a>00618       <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00619"></a>00619   }
-<a name="l00620"></a>00620 
-<a name="l00621"></a>00621   header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));
-<a name="l00622"></a>00622 
-<a name="l00623"></a>00623   strcpy(header_name, <span class="stringliteral">"ESO "</span>);
-<a name="l00624"></a>00624   strcat(header_name, name);
-<a name="l00625"></a>00625 
-<a name="l00626"></a>00626   <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)
-<a name="l00627"></a>00627     <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)
-<a name="l00628"></a>00628       header_name[i] = <span class="charliteral">' '</span>;
-<a name="l00629"></a>00629 
-<a name="l00630"></a>00630   <span class="keywordflow">if</span> (cpl_propertylist_update_double(header, header_name, value)) {
-<a name="l00631"></a>00631       cpl_free(header_name);
-<a name="l00632"></a>00632       cpl_error_set_where(func);
-<a name="l00633"></a>00633       <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00634"></a>00634   }
-<a name="l00635"></a>00635 
-<a name="l00636"></a>00636   cpl_propertylist_set_comment(header, header_name, comment);
-<a name="l00637"></a>00637 
-<a name="l00638"></a>00638   cpl_free(header_name);
-<a name="l00639"></a>00639 
-<a name="l00640"></a>00640   <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00641"></a>00641 
-<a name="l00642"></a>00642 }
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644 
-<a name="l00645"></a><a class="code" href="group__forsqc.html#g661730c28a076df446641c371342bf5b">00645</a> cpl_error_code <a class="code" href="group__forsqc.html#g661730c28a076df446641c371342bf5b">fors_qc_write_qc_int</a>(cpl_propertylist *header, <span class="keywordtype">int</span> value,
-<a name="l00646"></a>00646                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit,
-<a name="l00647"></a>00647                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *comment,
-<a name="l00648"></a>00648                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)
-<a name="l00649"></a>00649 {
-<a name="l00650"></a>00650 
-<a name="l00651"></a>00651   <span class="keyword">const</span> <span class="keywordtype">char</span> func[] = <span class="stringliteral">"fors_qc_write_qc_int"</span>;
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653   <span class="keywordtype">char</span> *header_name;
-<a name="l00654"></a>00654   <span class="keywordtype">int</span>   i;
-<a name="l00655"></a>00655 
-<a name="l00656"></a>00656 
-<a name="l00657"></a>00657   <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gaa58844eac4549649cf2ae56b6405903">fors_qc_write_int</a>(name, value, unit, comment, instrument)) {
-<a name="l00658"></a>00658       cpl_error_set_where(func);
-<a name="l00659"></a>00659       <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00660"></a>00660   }
-<a name="l00661"></a>00661 
-<a name="l00662"></a>00662   header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));
-<a name="l00663"></a>00663 
-<a name="l00664"></a>00664   strcpy(header_name, <span class="stringliteral">"ESO "</span>);
-<a name="l00665"></a>00665   strcat(header_name, name);
-<a name="l00666"></a>00666 
-<a name="l00667"></a>00667   <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)
-<a name="l00668"></a>00668     <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)
-<a name="l00669"></a>00669       header_name[i] = <span class="charliteral">' '</span>;
-<a name="l00670"></a>00670 
-<a name="l00671"></a>00671   <span class="keywordflow">if</span> (cpl_propertylist_update_int(header, header_name, value)) {
-<a name="l00672"></a>00672       cpl_free(header_name);
-<a name="l00673"></a>00673       cpl_error_set_where(func);
-<a name="l00674"></a>00674       <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00675"></a>00675   }
-<a name="l00676"></a>00676 
-<a name="l00677"></a>00677   cpl_propertylist_set_comment(header, header_name, comment);
-<a name="l00678"></a>00678 
-<a name="l00679"></a>00679   cpl_free(header_name);
-<a name="l00680"></a>00680 
-<a name="l00681"></a>00681   <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00682"></a>00682 
-<a name="l00683"></a>00683 }
-<a name="l00684"></a>00684 
-<a name="l00685"></a>00685 <span class="comment">/*</span>
-<a name="l00686"></a>00686 <span class="comment"> * @brief</span>
-<a name="l00687"></a>00687 <span class="comment"> *   Write an integer value to the active QC1 PAF object and to a header.</span>
-<a name="l00688"></a>00688 <span class="comment"> *</span>
-<a name="l00689"></a>00689 <span class="comment"> * @return @c CPL_ERROR_NONE on success</span>
-<a name="l00690"></a>00690 <span class="comment"> *</span>
-<a name="l00691"></a>00691 <span class="comment"> * @param filnam  Name of existing FITS file.</span>
-<a name="l00692"></a>00692 <span class="comment"> * @param value   Value to write.</span>
-<a name="l00693"></a>00693 <span class="comment"> * @param name    QC1 PAF entry name.</span>
-<a name="l00694"></a>00694 <span class="comment"> * @param unit    Optional unit to be associated to value.</span>
-<a name="l00695"></a>00695 <span class="comment"> * @param comment Optional comment to be associated to value.</span>
-<a name="l00696"></a>00696 <span class="comment"> *</span>
-<a name="l00697"></a>00697 <span class="comment"> * @doc</span>
-<a name="l00698"></a>00698 <span class="comment"> *   This function writes the header entries directly to the header </span>
-<a name="l00699"></a>00699 <span class="comment"> *   of the FITS file written to disk, using the qfits_replace_card() call.</span>
-<a name="l00700"></a>00700 <span class="comment"> *   An entry with the specified @em name is written to the current QC1 PAF </span>
-<a name="l00701"></a>00701 <span class="comment"> *   object. From the entry @em name, the name of the QC keyword that</span>
-<a name="l00702"></a>00702 <span class="comment"> *   should be written to header is derived prepending the string "ESO "</span>
-<a name="l00703"></a>00703 <span class="comment"> *   and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN"</span>
-<a name="l00704"></a>00704 <span class="comment"> *   becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword</span>
-<a name="l00705"></a>00705 <span class="comment"> *   is written to the header. Note that before calling this funtion </span>
-<a name="l00706"></a>00706 <span class="comment"> *   a QC1 PAF object must be created with a call to fors_qc_start_group().</span>
-<a name="l00707"></a>00707 <span class="comment"> */</span>
-<a name="l00708"></a>00708 
-<a name="l00709"></a>00709 <span class="comment">/*</span>
-<a name="l00710"></a>00710 <span class="comment">cpl_error_code fors_qc_write_qc_int(char *filnam, int value, const char *name,</span>
-<a name="l00711"></a>00711 <span class="comment">                               const char *unit, const char *comment,</span>
-<a name="l00712"></a>00712 <span class="comment">                               const char *instrument)</span>
-<a name="l00713"></a>00713 <span class="comment">{</span>
-<a name="l00714"></a>00714 <span class="comment"></span>
-<a name="l00715"></a>00715 <span class="comment">  const char func[] = "fors_qc_write_qc_int";</span>
-<a name="l00716"></a>00716 <span class="comment"></span>
-<a name="l00717"></a>00717 <span class="comment">  char             line[81];</span>
-<a name="l00718"></a>00718 <span class="comment">  char             val[81];</span>
-<a name="l00719"></a>00719 <span class="comment">  char            *descName;</span>
-<a name="l00720"></a>00720 <span class="comment">  int              i;</span>
-<a name="l00721"></a>00721 <span class="comment"></span>
-<a name="l00722"></a>00722 <span class="comment"></span>
-<a name="l00723"></a>00723 <span class="comment">  if (fors_qc_write_int(name, value, unit, comment, instrument)) {</span>
-<a name="l00724"></a>00724 <span class="comment">    cpl_msg_error(func, "Could not copy value to QC1 PAF!");</span>
-<a name="l00725"></a>00725 <span class="comment">    cpl_error_set_where(func);</span>
-<a name="l00726"></a>00726 <span class="comment">    return cpl_error_get_code();</span>
-<a name="l00727"></a>00727 <span class="comment">  }</span>
-<a name="l00728"></a>00728 <span class="comment"></span>
-<a name="l00729"></a>00729 <span class="comment">  descName = cpl_malloc((strlen(name) + 15) * sizeof(char *));</span>
-<a name="l00730"></a>00730 <span class="comment"></span>
-<a name="l00731"></a>00731 <span class="comment">  strcpy(descName, "HIERARCH ESO ");</span>
-<a name="l00732"></a>00732 <span class="comment">  strcat(descName, name);</span>
-<a name="l00733"></a>00733 <span class="comment"></span>
-<a name="l00734"></a>00734 <span class="comment">  for (i = 0; descName[i] != '\0'; i++)</span>
-<a name="l00735"></a>00735 <span class="comment">    if (descName[i] == '.')</span>
-<a name="l00736"></a>00736 <span class="comment">      descName[i] = ' ';</span>
-<a name="l00737"></a>00737 <span class="comment"></span>
-<a name="l00738"></a>00738 <span class="comment">  sprintf(val, "%d", value);</span>
-<a name="l00739"></a>00739 <span class="comment">  keytuple2str(line, descName, val, (char *)comment);</span>
-<a name="l00740"></a>00740 <span class="comment">  qfits_replace_card(filnam, descName, line);</span>
-<a name="l00741"></a>00741 <span class="comment"></span>
-<a name="l00742"></a>00742 <span class="comment">  cpl_free(descName);</span>
-<a name="l00743"></a>00743 <span class="comment"></span>
-<a name="l00744"></a>00744 <span class="comment">  return CPL_ERROR_NONE;</span>
-<a name="l00745"></a>00745 <span class="comment"></span>
-<a name="l00746"></a>00746 <span class="comment">}</span>
-<a name="l00747"></a>00747 <span class="comment"></span>
-<a name="l00748"></a>00748 <span class="comment"></span>
-<a name="l00749"></a>00749 <span class="comment">cpl_error_code fors_qc_write_qc_double(char *filnam, double value, </span>
-<a name="l00750"></a>00750 <span class="comment">                                      const char *name, const char *unit, </span>
-<a name="l00751"></a>00751 <span class="comment">                                      const char *comment,</span>
-<a name="l00752"></a>00752 <span class="comment">                                      const char *instrument)</span>
-<a name="l00753"></a>00753 <span class="comment">{</span>
-<a name="l00754"></a>00754 <span class="comment"></span>
-<a name="l00755"></a>00755 <span class="comment">  const char func[] = "fors_qc_write_qc_double";</span>
-<a name="l00756"></a>00756 <span class="comment"></span>
-<a name="l00757"></a>00757 <span class="comment">  char             line[81];</span>
-<a name="l00758"></a>00758 <span class="comment">  char             val[81];</span>
-<a name="l00759"></a>00759 <span class="comment">  char            *descName;</span>
-<a name="l00760"></a>00760 <span class="comment">  int              i;</span>
-<a name="l00761"></a>00761 <span class="comment"></span>
-<a name="l00762"></a>00762 <span class="comment"></span>
-<a name="l00763"></a>00763 <span class="comment">  if (fors_qc_write_double(name, value, unit, comment, instrument)) {</span>
-<a name="l00764"></a>00764 <span class="comment">    cpl_msg_error(func, "Could not copy value to QC1 PAF!");</span>
-<a name="l00765"></a>00765 <span class="comment">    cpl_error_set_where(func);</span>
-<a name="l00766"></a>00766 <span class="comment">    return cpl_error_get_code();</span>
-<a name="l00767"></a>00767 <span class="comment">  }</span>
-<a name="l00768"></a>00768 <span class="comment"></span>
-<a name="l00769"></a>00769 <span class="comment">  descName = cpl_malloc((strlen(name) + 15) * sizeof(char *));</span>
-<a name="l00770"></a>00770 <span class="comment"></span>
-<a name="l00771"></a>00771 <span class="comment">  strcpy(descName, "HIERARCH ESO ");</span>
-<a name="l00772"></a>00772 <span class="comment">  strcat(descName, name);</span>
-<a name="l00773"></a>00773 <span class="comment"></span>
-<a name="l00774"></a>00774 <span class="comment">  for (i = 0; descName[i] != '\0'; i++)</span>
-<a name="l00775"></a>00775 <span class="comment">    if (descName[i] == '.')</span>
-<a name="l00776"></a>00776 <span class="comment">      descName[i] = ' ';</span>
-<a name="l00777"></a>00777 <span class="comment"></span>
-<a name="l00778"></a>00778 <span class="comment">  sprintf(val, "%1.6e", value);</span>
-<a name="l00779"></a>00779 <span class="comment">  keytuple2str(line, descName, val, (char *)comment);</span>
-<a name="l00780"></a>00780 <span class="comment">  qfits_replace_card(filnam, descName, line);</span>
-<a name="l00781"></a>00781 <span class="comment"></span>
-<a name="l00782"></a>00782 <span class="comment">  cpl_free(descName);</span>
-<a name="l00783"></a>00783 <span class="comment"></span>
-<a name="l00784"></a>00784 <span class="comment">  return CPL_ERROR_NONE;</span>
-<a name="l00785"></a>00785 <span class="comment"></span>
-<a name="l00786"></a>00786 <span class="comment">}</span>
-<a name="l00787"></a>00787 <span class="comment"></span>
-<a name="l00788"></a>00788 <span class="comment">*/</span>
-<a name="l00789"></a>00789 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__qc_8c_source.html b/html/fors__qc_8c_source.html
new file mode 100644
index 0000000..fbe166d
--- /dev/null
+++ b/html/fors__qc_8c_source.html
@@ -0,0 +1,701 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_qc.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_qc.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_qc.c,v 1.10 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.10 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <ctype.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <unistd.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <fors_paf.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#define DICT_LINE_LENGTH    (80)</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor"></span><span class="preprocessor">#define MAX_PAF_NAME_LENGTH (80)</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor"></span><span class="preprocessor">#define PAF_ROOT_NAME       "qc"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_qc_dic_version = <span class="stringliteral">"2.0"</span>;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="keyword">static</span> <a class="code" href="struct__FORS__PAF__.html">ForsPAF</a> *pafFile = NULL;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> <span class="keywordtype">int</span>     pafIndex = 0;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451">   77</a></span> cpl_error_code <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(cpl_propertylist *header,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *qcdic_version, </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> {</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     <span class="keywordtype">char</span> pafName[MAX_PAF_NAME_LENGTH];</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     <span class="keywordflow">if</span> (pafFile)</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_start_group"</span>, CPL_ERROR_FILE_ALREADY_OPEN);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> </div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     sprintf(pafName, <span class="stringliteral">"%s%.4d.paf"</span>, PAF_ROOT_NAME, pafIndex);</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     <span class="keywordflow">if</span> (!(pafFile = <a class="code" href="group__forsPaf.html#ga7aef24280b6605d6dfbb063bab8da2f4" title="Create a new PAF object.">newForsPAF</a>(pafName, <span class="stringliteral">"QC1 parameters"</span>, NULL, NULL)))</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_start_group"</span>, CPL_ERROR_FILE_NOT_CREATED);</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     </div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     <a class="code" href="group__forsqc.html#ga47dfe71df58ec7c851d4f3853f9f9b00" title="Write a string value to the active QC1 PAF object and to a header.">fors_qc_write_qc_string</a>(header, </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                             <span class="stringliteral">"QC.DID"</span>, qcdic_version, <span class="stringliteral">"QC1 dictionary"</span>,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                             instrument);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> }</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">    cpl_propertylist_delete(header); \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00115"></a><span class="lineno"><a class="code" href="group__forsqc.html#ga9ff2c73c315e805ab5d1415a2de9ce0b">  115</a></span> <span class="keywordtype">void</span> <a class="code" href="group__forsqc.html#ga9ff2c73c315e805ab5d1415a2de9ce0b" title="Initiate a new QC1 group and log basic QC.">fors_qc_write_group_heading</a>(<span class="keyword">const</span> cpl_frame *raw_frame,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                                  <span class="keyword">const</span> <span class="keywordtype">char</span> *pro_catg,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                                  <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> {</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     cpl_propertylist *header = NULL;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( raw_frame != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frame_get_filename(raw_frame) != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     header = cpl_propertylist_load(cpl_frame_get_filename(raw_frame), 0);</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load %s header"</span>,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>             cpl_frame_get_filename(raw_frame));</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     <a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, pro_catg,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                          <span class="stringliteral">"Product category"</span>, instrument);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Cannot write product category to "</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>             <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL, </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                            <span class="stringliteral">"DPR type"</span>, instrument);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword DPR TYPE in raw "</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>             <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO TPL ID"</span>, NULL, </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                            <span class="stringliteral">"Template"</span>, instrument);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword TPL ID in raw "</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>             <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS FILT1 NAME"</span>)) {</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                                <span class="stringliteral">"Filter name"</span>, instrument);</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Failed to write ESO INS FILT1 NAME"</span>);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     }</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                            <span class="stringliteral">"Collimator name"</span>, instrument);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword INS COLL NAME in raw "</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>             <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                            <span class="stringliteral">"Chip identifier"</span>, instrument);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword DET CHIP1 ID in raw "</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>             <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     </div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>, NULL,    </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                            <span class="stringliteral">"Binning factor along X"</span>, instrument);</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>             <span class="stringliteral">"in raw frame header"</span>);</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET WIN1 BINY"</span>, NULL,</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>                            <span class="stringliteral">"Binning factor along Y"</span>, instrument);</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword ESO DET WIN1 BINY "</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>             <span class="stringliteral">"in raw frame header"</span>);</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     </div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>                            <span class="stringliteral">"Archive name of input data"</span>, </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>                            instrument);</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Missing keyword ARCFILE in raw "</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>             <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         <span class="keywordtype">char</span> *pipefile = dfs_generate_filename(pro_catg);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>         <a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile, </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>                              <span class="stringliteral">"Pipeline product name"</span>, instrument);</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>         cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     }</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     cleanup;</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> }</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> </div>
+<div class="line"><a name="l00200"></a><span class="lineno"><a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda">  200</a></span> cpl_error_code <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> {</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="keywordflow">if</span> (!pafFile)</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_end_group"</span>, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsPaf.html#ga84dbb309c51aee01813cc9b90dde96cb" title="Check whether a PAF object is empty.">forsPAFIsEmpty</a>(pafFile)) {</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         <a class="code" href="group__forsPaf.html#ga3e16371f03930ae272a5454ad6100f83" title="Write a PAF object to a disk file.">forsPAFWrite</a>(pafFile);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>         pafIndex++;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     }</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <a class="code" href="group__forsPaf.html#ga5d62f23bc1a07c4136aecccfcea2459d" title="Destroy a PAF object.">deleteForsPAF</a>(pafFile);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     pafFile = NULL;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> </div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> </div>
+<div class="line"><a name="l00235"></a><span class="lineno"><a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4">  235</a></span> cpl_error_code <a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value, </div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *comment, <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> {</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="keywordtype">int</span> status;</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="keywordtype">int</span>   length = strlen(instrument) + 3;</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="keywordtype">char</span> *allComment;</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="keywordflow">if</span> (comment == NULL || name == NULL || instrument == NULL)</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_write_string"</span>, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> </div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     length += strlen(comment) + 1;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> </div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     allComment = cpl_malloc(length * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     sprintf(allComment, <span class="stringliteral">"%s [%s]"</span>, comment, instrument);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     status = <a class="code" href="group__forsPaf.html#gad23a2cd11683bd001f954383a282b9c3" title="Append a string value to a PAF object.">forsPAFAppendString</a>(pafFile, name, value, allComment);</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     cpl_free(allComment);</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordflow">if</span> (status)</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>         cpl_msg_error(<span class="stringliteral">"fors_qc_write_string"</span>, </div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                       <span class="stringliteral">"Cannot write parameter %s to QC1 PAF"</span>, name);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     cpl_msg_debug(cpl_func, <span class="stringliteral">"%s [%s] = '%s'"</span>, comment, name, value);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> }</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> cpl_error_code fors_qc_write_string_chat(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value,</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *comment, <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> {</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> </div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <span class="keywordtype">int</span> status;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <span class="keywordtype">int</span>   length = strlen(instrument) + 3;</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="keywordtype">char</span> *allComment;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     <span class="keywordflow">if</span> (comment == NULL || name == NULL || instrument == NULL)</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_write_string_chat"</span>, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     length += strlen(comment) + 1;</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     allComment = cpl_malloc(length * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     sprintf(allComment, <span class="stringliteral">"%s [%s]"</span>, comment, instrument);</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     status = <a class="code" href="group__forsPaf.html#gad23a2cd11683bd001f954383a282b9c3" title="Append a string value to a PAF object.">forsPAFAppendString</a>(pafFile, name, value, allComment);</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     cpl_free(allComment);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> </div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keywordflow">if</span> (status)</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         cpl_msg_error(<span class="stringliteral">"fors_qc_write_string_chat"</span>,</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                       <span class="stringliteral">"Cannot write parameter %s to QC1 PAF"</span>, name);</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"%s [%s] = '%s'"</span>, comment, name, value);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> </div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> }</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> </div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno"><a class="code" href="group__forsqc.html#ga8355f62ab2783be464130e8de57487b3">  321</a></span> cpl_error_code <a class="code" href="group__forsqc.html#ga8355f62ab2783be464130e8de57487b3" title="Add double parameter to current QC1 group.">fors_qc_write_double</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">double</span> value, </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, <span class="keyword">const</span> <span class="keywordtype">char</span> *comment,</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                                 <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> {</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> </div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     cpl_error_code status;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <span class="keywordtype">int</span>   length = strlen(instrument) + 3;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="keywordtype">char</span> *allComment;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> </div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <span class="keywordflow">if</span> (comment == NULL || name == NULL || instrument == NULL)</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_write_double"</span>, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     length += strlen(comment) + 1;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> </div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keywordflow">if</span> (unit)</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>       length += strlen(unit) + 3;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     allComment = cpl_malloc(length * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> </div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordflow">if</span> (unit)</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>       sprintf(allComment, <span class="stringliteral">"%s (%s) [%s]"</span>, comment, unit, instrument);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>       sprintf(allComment, <span class="stringliteral">"%s [%s]"</span>, comment, instrument);</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     status = <a class="code" href="group__forsPaf.html#ga83aca84f4fb88e3db7a233b442cd644a" title="Append a double value to a PAF object.">forsPAFAppendDouble</a>(pafFile, name, value, allComment);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     cpl_free(allComment);</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     <span class="keywordflow">if</span> (status)</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>         cpl_msg_error(<span class="stringliteral">"fors_qc_write_double"</span>, </div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>                       <span class="stringliteral">"Cannot write parameter %s to QC1 PAF"</span>, name);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> </div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"%s [%s] = %f %s"</span>, </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                  comment, name, value, (unit != NULL) ? unit : <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> </div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> }</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> cpl_error_code fors_qc_write_int(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">int</span> value, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                              <span class="keyword">const</span> <span class="keywordtype">char</span> *comment, <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> {</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     cpl_error_code status;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keywordtype">int</span>   length = strlen(instrument) + 3;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     <span class="keywordtype">char</span> *allComment;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> </div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keywordflow">if</span> (comment == NULL || name == NULL || instrument == NULL)</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>         <span class="keywordflow">return</span> cpl_error_set(<span class="stringliteral">"fors_qc_write_int"</span>, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     length += strlen(comment) + 1;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">if</span> (unit)</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>       length += strlen(unit) + 3;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     allComment = cpl_malloc(length * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> </div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="keywordflow">if</span> (unit)</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>       sprintf(allComment, <span class="stringliteral">"%s (%s) [%s]"</span>, comment, unit, instrument);</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>       sprintf(allComment, <span class="stringliteral">"%s [%s]"</span>, comment, instrument);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     status = <a class="code" href="group__forsPaf.html#gae15f3d1ee9b849039f26cd82d3568913" title="Append a integer value to a PAF object.">forsPAFAppendInt</a>(pafFile, name, value, allComment);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     cpl_free(allComment);</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     <span class="keywordflow">if</span> (status)</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>         cpl_msg_error(<span class="stringliteral">"fors_qc_write_int"</span>, </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>                       <span class="stringliteral">"Cannot write parameter %s to QC1 PAF"</span>, name);</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"%s [%s] = %d %s"</span>, </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>                  comment, name, value, (unit != NULL) ? unit : <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>  </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> }</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00425"></a><span class="lineno"><a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56">  425</a></span> cpl_error_code <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(cpl_propertylist *header, </div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, </div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *comment, </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>                                      <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> {</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>   <span class="keyword">const</span> <span class="keywordtype">char</span> func[] = <span class="stringliteral">"fors_qc_keyword_to_paf"</span>;</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>   <span class="keywordtype">char</span>            *keyName;</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>   <span class="keywordtype">char</span>            *keep;</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>   <span class="keywordtype">char</span>            *pos;</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>   <span class="keywordtype">int</span>              ivalue;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>   <span class="keywordtype">float</span>            fvalue;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>   <span class="keywordtype">double</span>           dvalue;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>   <span class="keywordtype">char</span>            *svalue = NULL;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>   <span class="keywordtype">int</span>              status;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>   <span class="keywordtype">int</span>              i;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>   <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     cpl_msg_error(func, <span class="stringliteral">"Empty header"</span>);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>   }</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> </div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>   <span class="keywordflow">if</span> (!cpl_propertylist_has(header, name)) {</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     cpl_msg_error(func, <span class="stringliteral">"Keyword %s not found"</span>, name);</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>   }</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> </div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>   <span class="keywordflow">switch</span> (cpl_propertylist_get_type(header, name)) {</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>   <span class="keywordflow">case</span> CPL_TYPE_INT :</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     ivalue = cpl_propertylist_get_int(header, name);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>   <span class="keywordflow">case</span> CPL_TYPE_FLOAT :</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     fvalue = cpl_propertylist_get_float(header, name);</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>   <span class="keywordflow">case</span> CPL_TYPE_DOUBLE :</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     dvalue = cpl_propertylist_get_double(header, name);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>   <span class="keywordflow">case</span> CPL_TYPE_STRING :</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     svalue = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, name);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>   <span class="keywordflow">default</span> :</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     cpl_msg_error(func, <span class="stringliteral">"Unsupported keyword type"</span>);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>   }</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> </div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> <span class="comment">   *  Construct entry name for PAF</span></div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> </div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>   keep = keyName = cpl_strdup(name);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> </div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>   pos = strstr(keyName, <span class="stringliteral">"ESO "</span>);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> </div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>   <span class="keywordflow">if</span> (pos == keyName)</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     keyName += 4;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> </div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>   <span class="keywordflow">for</span> (i = 0; keyName[i] != <span class="charliteral">'\0'</span>; i++)</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     <span class="keywordflow">if</span> (keyName[i] == <span class="charliteral">' '</span>)</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>       keyName[i] = <span class="charliteral">'.'</span>;</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span> </div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> <span class="comment">   *  Now write entry to PAF object.</span></div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>   <span class="keywordflow">switch</span> (cpl_propertylist_get_type(header, name)) {</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>   <span class="keywordflow">case</span> CPL_TYPE_INT :</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     status = fors_qc_write_int(keyName, ivalue, unit, comment, instrument);</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>   <span class="keywordflow">case</span> CPL_TYPE_FLOAT :</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     dvalue = fvalue;</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>   <span class="keywordflow">case</span> CPL_TYPE_DOUBLE :</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     status = <a class="code" href="group__forsqc.html#ga8355f62ab2783be464130e8de57487b3" title="Add double parameter to current QC1 group.">fors_qc_write_double</a>(keyName, dvalue, unit, comment, instrument);</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>   <span class="keywordflow">default</span> :    <span class="comment">/* CPL_TYPE_STRING */</span></div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     status = <a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(keyName, svalue, comment, instrument);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>   }</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span> </div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>   <span class="keywordflow">if</span> (status)</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     cpl_msg_error(func, <span class="stringliteral">"Could not copy keyword value to QC1 PAF!"</span>);</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> </div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>   cpl_free(keep);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> </div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>   <span class="keywordflow">return</span> status;</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span> }</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span> </div>
+<div class="line"><a name="l00535"></a><span class="lineno"><a class="code" href="group__forsqc.html#ga47dfe71df58ec7c851d4f3853f9f9b00">  535</a></span> cpl_error_code <a class="code" href="group__forsqc.html#ga47dfe71df58ec7c851d4f3853f9f9b00" title="Write a string value to the active QC1 PAF object and to a header.">fors_qc_write_qc_string</a>(cpl_propertylist *header,</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>                                        <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *value, </div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>                                        <span class="keyword">const</span> <span class="keywordtype">char</span> *comment, </div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>                                        <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span> {</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> func[] = <span class="stringliteral">"fors_qc_write_qc_string"</span>;</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> </div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>     <span class="keywordtype">char</span> *header_name;</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     <span class="keywordtype">int</span>   i;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keywordflow">if</span> (strcmp(<span class="stringliteral">"QC.DID"</span>, name)) {</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>         <span class="keywordflow">if</span> (fors_qc_write_string_chat(name, value, comment, instrument)) {</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>             cpl_error_set_where(func);</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>             <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         }</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     }</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(name, value, comment, instrument)) {</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>             cpl_error_set_where(func);</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>             <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>         }</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     }</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> </div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     strcpy(header_name, <span class="stringliteral">"ESO "</span>);</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     strcat(header_name, name);</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span> </div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>             header_name[i] = <span class="charliteral">' '</span>;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> </div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     <span class="keywordflow">if</span> (cpl_propertylist_update_string(header, header_name, value)) {</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>         cpl_free(header_name);</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>         cpl_error_set_where(func);</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     }</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> </div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     cpl_propertylist_set_comment(header, header_name, comment);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span> </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     cpl_free(header_name);</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span> </div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> }</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00604"></a><span class="lineno"><a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f">  604</a></span> cpl_error_code <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(cpl_propertylist *header, <span class="keywordtype">double</span> value, </div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>                                       <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit, </div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>                                       <span class="keyword">const</span> <span class="keywordtype">char</span> *comment,</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>                                       <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> {</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>   <span class="keyword">const</span> <span class="keywordtype">char</span> func[] = <span class="stringliteral">"fors_qc_write_qc_double"</span>;</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span> </div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>   <span class="keywordtype">char</span> *header_name;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>   <span class="keywordtype">int</span>   i;</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> </div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> </div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>   <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga8355f62ab2783be464130e8de57487b3" title="Add double parameter to current QC1 group.">fors_qc_write_double</a>(name, value, unit, comment, instrument)) {</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>       cpl_error_set_where(func);</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>       <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>   }</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>   header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span> </div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>   strcpy(header_name, <span class="stringliteral">"ESO "</span>);</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>   strcat(header_name, name);</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span> </div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>   <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>       header_name[i] = <span class="charliteral">' '</span>;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> </div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>   <span class="keywordflow">if</span> (cpl_propertylist_update_double(header, header_name, value)) {</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>       cpl_free(header_name);</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>       cpl_error_set_where(func);</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>       <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>   }</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>   cpl_propertylist_set_comment(header, header_name, comment);</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> </div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>   cpl_free(header_name);</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> </div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>   <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> </div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> }</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> </div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> </div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span> cpl_error_code fors_qc_write_qc_int(cpl_propertylist *header, <span class="keywordtype">int</span> value,</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *unit,</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *comment,</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>                                    <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument)</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> {</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span> </div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>   <span class="keyword">const</span> <span class="keywordtype">char</span> func[] = <span class="stringliteral">"fors_qc_write_qc_int"</span>;</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> </div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>   <span class="keywordtype">char</span> *header_name;</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>   <span class="keywordtype">int</span>   i;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span> </div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>   <span class="keywordflow">if</span> (fors_qc_write_int(name, value, unit, comment, instrument)) {</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>       cpl_error_set_where(func);</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>       <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>   }</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> </div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>   header_name = cpl_malloc((strlen(name) + 6) * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *));</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span> </div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>   strcpy(header_name, <span class="stringliteral">"ESO "</span>);</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>   strcat(header_name, name);</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span> </div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>   <span class="keywordflow">for</span> (i = 0; header_name[i] != <span class="charliteral">'\0'</span>; i++)</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     <span class="keywordflow">if</span> (header_name[i] == <span class="charliteral">'.'</span>)</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>       header_name[i] = <span class="charliteral">' '</span>;</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> </div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>   <span class="keywordflow">if</span> (cpl_propertylist_update_int(header, header_name, value)) {</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>       cpl_free(header_name);</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>       cpl_error_set_where(func);</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>       <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>   }</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> </div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>   cpl_propertylist_set_comment(header, header_name, comment);</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span> </div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>   cpl_free(header_name);</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span> </div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>   <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> </div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> }</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span> </div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span> <span class="comment"> * @brief</span></div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span> <span class="comment"> *   Write an integer value to the active QC1 PAF object and to a header.</span></div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> <span class="comment"> * @return @c CPL_ERROR_NONE on success</span></div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span> <span class="comment"> * @param filnam  Name of existing FITS file.</span></div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span> <span class="comment"> * @param value   Value to write.</span></div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span> <span class="comment"> * @param name    QC1 PAF entry name.</span></div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span> <span class="comment"> * @param unit    Optional unit to be associated to value.</span></div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span> <span class="comment"> * @param comment Optional comment to be associated to value.</span></div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> <span class="comment"> * @doc</span></div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span> <span class="comment"> *   This function writes the header entries directly to the header </span></div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> <span class="comment"> *   of the FITS file written to disk, using the qfits_replace_card() call.</span></div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span> <span class="comment"> *   An entry with the specified @em name is written to the current QC1 PAF </span></div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> <span class="comment"> *   object. From the entry @em name, the name of the QC keyword that</span></div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span> <span class="comment"> *   should be written to header is derived prepending the string "ESO "</span></div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> <span class="comment"> *   and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN"</span></div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> <span class="comment"> *   becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword</span></div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span> <span class="comment"> *   is written to the header. Note that before calling this funtion </span></div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> <span class="comment"> *   a QC1 PAF object must be created with a call to fors_qc_start_group().</span></div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> </div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span> <span class="comment">cpl_error_code fors_qc_write_qc_int(char *filnam, int value, const char *name,</span></div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> <span class="comment">                               const char *unit, const char *comment,</span></div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span> <span class="comment">                               const char *instrument)</span></div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> <span class="comment">{</span></div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> <span class="comment"></span></div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> <span class="comment">  const char func[] = "fors_qc_write_qc_int";</span></div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span> <span class="comment"></span></div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span> <span class="comment">  char             line[81];</span></div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span> <span class="comment">  char             val[81];</span></div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> <span class="comment">  char            *descName;</span></div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span> <span class="comment">  int              i;</span></div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> <span class="comment"></span></div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span> <span class="comment"></span></div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span> <span class="comment">  if (fors_qc_write_int(name, value, unit, comment, instrument)) {</span></div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span> <span class="comment">    cpl_msg_error(func, "Could not copy value to QC1 PAF!");</span></div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span> <span class="comment">    cpl_error_set_where(func);</span></div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span> <span class="comment">    return cpl_error_get_code();</span></div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> <span class="comment">  }</span></div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span> <span class="comment"></span></div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span> <span class="comment">  descName = cpl_malloc((strlen(name) + 15) * sizeof(char *));</span></div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span> <span class="comment"></span></div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span> <span class="comment">  strcpy(descName, "HIERARCH ESO ");</span></div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> <span class="comment">  strcat(descName, name);</span></div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span> <span class="comment"></span></div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span> <span class="comment">  for (i = 0; descName[i] != '\0'; i++)</span></div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> <span class="comment">    if (descName[i] == '.')</span></div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span> <span class="comment">      descName[i] = ' ';</span></div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> <span class="comment"></span></div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span> <span class="comment">  sprintf(val, "%d", value);</span></div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span> <span class="comment">  keytuple2str(line, descName, val, (char *)comment);</span></div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span> <span class="comment">  qfits_replace_card(filnam, descName, line);</span></div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> <span class="comment"></span></div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span> <span class="comment">  cpl_free(descName);</span></div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span> <span class="comment"></span></div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> <span class="comment">  return CPL_ERROR_NONE;</span></div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span> <span class="comment"></span></div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span> <span class="comment">}</span></div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> <span class="comment"></span></div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span> <span class="comment"></span></div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span> <span class="comment">cpl_error_code fors_qc_write_qc_double(char *filnam, double value, </span></div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span> <span class="comment">                                      const char *name, const char *unit, </span></div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span> <span class="comment">                                      const char *comment,</span></div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span> <span class="comment">                                      const char *instrument)</span></div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span> <span class="comment">{</span></div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span> <span class="comment"></span></div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span> <span class="comment">  const char func[] = "fors_qc_write_qc_double";</span></div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span> <span class="comment"></span></div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span> <span class="comment">  char             line[81];</span></div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span> <span class="comment">  char             val[81];</span></div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span> <span class="comment">  char            *descName;</span></div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span> <span class="comment">  int              i;</span></div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span> <span class="comment"></span></div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span> <span class="comment"></span></div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> <span class="comment">  if (fors_qc_write_double(name, value, unit, comment, instrument)) {</span></div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span> <span class="comment">    cpl_msg_error(func, "Could not copy value to QC1 PAF!");</span></div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span> <span class="comment">    cpl_error_set_where(func);</span></div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span> <span class="comment">    return cpl_error_get_code();</span></div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span> <span class="comment">  }</span></div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span> <span class="comment"></span></div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span> <span class="comment">  descName = cpl_malloc((strlen(name) + 15) * sizeof(char *));</span></div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span> <span class="comment"></span></div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span> <span class="comment">  strcpy(descName, "HIERARCH ESO ");</span></div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span> <span class="comment">  strcat(descName, name);</span></div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span> <span class="comment"></span></div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> <span class="comment">  for (i = 0; descName[i] != '\0'; i++)</span></div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span> <span class="comment">    if (descName[i] == '.')</span></div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span> <span class="comment">      descName[i] = ' ';</span></div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> <span class="comment"></span></div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span> <span class="comment">  sprintf(val, "%1.6e", value);</span></div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span> <span class="comment">  keytuple2str(line, descName, val, (char *)comment);</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> <span class="comment">  qfits_replace_card(filnam, descName, line);</span></div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> <span class="comment"></span></div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> <span class="comment">  cpl_free(descName);</span></div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span> <span class="comment"></span></div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> <span class="comment">  return CPL_ERROR_NONE;</span></div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span> <span class="comment"></span></div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> <span class="comment">}</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span> <span class="comment"></span></div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__qc_8h-source.html b/html/fors__qc_8h-source.html
deleted file mode 100644
index f7e2516..0000000
--- a/html/fors__qc_8h-source.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_qc.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_qc.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_qc.h,v 1.6 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.6 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_QC_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_QC_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__forsqc.html#gf875be6d318687206fdb50a7c61b7924">fors_qc_dic_version</a>;
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 cpl_error_code <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(cpl_propertylist *, 
-<a name="l00038"></a>00038                    <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00039"></a>00039 cpl_error_code <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>(<span class="keywordtype">void</span>);
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="group__forsqc.html#g1ccea526719a1be6c14de81963d81955">fors_qc_write_group_heading</a>(<span class="keyword">const</span> cpl_frame *raw_frame,
-<a name="l00042"></a>00042                                  <span class="keyword">const</span> <span class="keywordtype">char</span> *pro_catg,
-<a name="l00043"></a>00043                                  <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument);
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 cpl_error_code <a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
-<a name="l00046"></a>00046                     <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00047"></a>00047 cpl_error_code <a class="code" href="group__forsqc.html#ge4f20b9c870f3d6b30e3ee7a91c1db12">fors_qc_write_string_chat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
-<a name="l00048"></a>00048                     <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00049"></a>00049 cpl_error_code <a class="code" href="group__forsqc.html#g033fc0f2f9e321c4ac98ee7f412b2c6e">fors_qc_write_double</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00050"></a>00050                     <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00051"></a>00051 cpl_error_code <a class="code" href="group__forsqc.html#gaa58844eac4549649cf2ae56b6405903">fors_qc_write_int</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00052"></a>00052                  <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00053"></a>00053 cpl_error_code <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(cpl_propertylist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00054"></a>00054                       <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00055"></a>00055 cpl_error_code <a class="code" href="group__forsqc.html#ga4480637fba9623895546614d7a21fb5">fors_qc_write_qc_string</a>(cpl_propertylist *,
-<a name="l00056"></a>00056                        <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
-<a name="l00057"></a>00057                        <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00058"></a>00058 cpl_error_code <a class="code" href="group__forsqc.html#g661730c28a076df446641c371342bf5b">fors_qc_write_qc_int</a>(cpl_propertylist *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00059"></a>00059                     <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00060"></a>00060 cpl_error_code <a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(cpl_propertylist *, <span class="keywordtype">double</span>, 
-<a name="l00061"></a>00061                        <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, 
-<a name="l00062"></a>00062                        <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 CPL_END_DECLS
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066 <span class="preprocessor">#endif </span><span class="comment">/* FORS_QC_H */</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__qc_8h_source.html b/html/fors__qc_8h_source.html
new file mode 100644
index 0000000..a7089f5
--- /dev/null
+++ b/html/fors__qc_8h_source.html
@@ -0,0 +1,127 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_qc.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_qc.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_qc.h,v 1.6 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.6 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_QC_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_QC_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_qc_dic_version;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> cpl_error_code <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(cpl_propertylist *, </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> cpl_error_code <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keywordtype">void</span> <a class="code" href="group__forsqc.html#ga9ff2c73c315e805ab5d1415a2de9ce0b" title="Initiate a new QC1 group and log basic QC.">fors_qc_write_group_heading</a>(<span class="keyword">const</span> cpl_frame *raw_frame,</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>                                  <span class="keyword">const</span> <span class="keywordtype">char</span> *pro_catg,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>                                  <span class="keyword">const</span> <span class="keywordtype">char</span> *instrument);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> cpl_error_code <a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> cpl_error_code fors_qc_write_string_chat(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> cpl_error_code <a class="code" href="group__forsqc.html#ga8355f62ab2783be464130e8de57487b3" title="Add double parameter to current QC1 group.">fors_qc_write_double</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> cpl_error_code fors_qc_write_int(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>                  <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> cpl_error_code <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(cpl_propertylist *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>                       <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> cpl_error_code <a class="code" href="group__forsqc.html#ga47dfe71df58ec7c851d4f3853f9f9b00" title="Write a string value to the active QC1 PAF object and to a header.">fors_qc_write_qc_string</a>(cpl_propertylist *,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>                        <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>                        <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> cpl_error_code fors_qc_write_qc_int(cpl_propertylist *, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> cpl_error_code <a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(cpl_propertylist *, <span class="keywordtype">double</span>, </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>                        <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>                        <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">#endif </span><span class="comment">/* FORS_QC_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__recipe_8c-source.html b/html/fors__recipe_8c-source.html
deleted file mode 100644
index d9ecb82..0000000
--- a/html/fors__recipe_8c-source.html
+++ /dev/null
@@ -1,200 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_recipe.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_recipe.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_recipe.c,v 1.3 2010/09/14 07:38:16 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:38:16 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.3 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_recipe_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#g9de4437d5a4d68fdd594724e002b8388">fors_recipe_create</a>(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#g2e82215d74913efed45e3dce601076aa">fors_recipe_exec</a>(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#g351e58c2312f291e40fc17e8d9e09982">fors_recipe_destroy</a>(cpl_plugin *);
-<a name="l00041"></a>00041 
-<a name="l00062"></a><a class="code" href="group__fors__recipe.html#g4abb403976fc3ddcaa614c59a44590c9">00062</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00065"></a>00065     cpl_plugin *plugin = &recipe->interface;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>())
-<a name="l00068"></a>00068     {
-<a name="l00069"></a>00069         cpl_msg_error(cpl_func, 
-<a name="l00070"></a>00070               <span class="stringliteral">"I am fors_recipe version %d, but I am linking "</span>
-<a name="l00071"></a>00071               <span class="stringliteral">"against the FORS library version %d. "</span>
-<a name="l00072"></a>00072               <span class="stringliteral">"This will not work. "</span>
-<a name="l00073"></a>00073               <span class="stringliteral">"Please remove all previous installations "</span>
-<a name="l00074"></a>00074               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,
-<a name="l00075"></a>00075               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>());
-<a name="l00076"></a>00076         <span class="keywordflow">return</span> 1;
-<a name="l00077"></a>00077     }
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079     cpl_plugin_init(plugin,
-<a name="l00080"></a>00080                     CPL_PLUGIN_API,
-<a name="l00081"></a>00081                     FORS_BINARY_VERSION,
-<a name="l00082"></a>00082                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00083"></a>00083                     fors_recipe_name,
-<a name="l00084"></a>00084                     fors_recipe_description_short,
-<a name="l00085"></a>00085                     fors_recipe_description,
-<a name="l00086"></a>00086                     fors_recipe_author,
-<a name="l00087"></a>00087                     fors_recipe_email,
-<a name="l00088"></a>00088                     fors_license,
-<a name="l00089"></a>00089                     <a class="code" href="group__fors__recipe.html#g9de4437d5a4d68fdd594724e002b8388">fors_recipe_create</a>,
-<a name="l00090"></a>00090                     <a class="code" href="group__fors__recipe.html#g2e82215d74913efed45e3dce601076aa">fors_recipe_exec</a>,
-<a name="l00091"></a>00091                     <a class="code" href="group__fors__recipe.html#g351e58c2312f291e40fc17e8d9e09982">fors_recipe_destroy</a>);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     cpl_pluginlist_append(list, plugin);
-<a name="l00094"></a>00094     
-<a name="l00095"></a>00095     <span class="keywordflow">return</span> 0;
-<a name="l00096"></a>00096 }
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 
-<a name="l00109"></a><a class="code" href="group__fors__recipe.html#g9de4437d5a4d68fdd594724e002b8388">00109</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#g9de4437d5a4d68fdd594724e002b8388">fors_recipe_create</a>(cpl_plugin *plugin)
-<a name="l00110"></a>00110 {
-<a name="l00111"></a>00111     cpl_recipe    *recipe;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00114"></a>00114         cpl_msg_error(cpl_func, 
-<a name="l00115"></a>00115                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00116"></a>00116                       <span class="stringliteral">"refusing to create recipe fors_recipe"</span>, 
-<a name="l00117"></a>00117                       cpl_error_get_message());
-<a name="l00118"></a>00118         <span class="keywordflow">return</span> 1;
-<a name="l00119"></a>00119     }
-<a name="l00120"></a>00120     
-<a name="l00121"></a>00121     <span class="comment">/* </span>
-<a name="l00122"></a>00122 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00123"></a>00123 <span class="comment">     */</span>
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00126"></a>00126         recipe = (cpl_recipe *)plugin;
-<a name="l00127"></a>00127     }
-<a name="l00128"></a>00128     <span class="keywordflow">else</span> {
-<a name="l00129"></a>00129         <span class="keywordflow">return</span> 1;
-<a name="l00130"></a>00130     }
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* </span>
-<a name="l00133"></a>00133 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00134"></a>00134 <span class="comment">     */</span>
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00137"></a>00137     
-<a name="l00138"></a>00138     fors_recipe_define_parameters(recipe->parameters);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00141"></a>00141         cpl_msg_error(cpl_func, 
-<a name="l00142"></a>00142                       <span class="stringliteral">"Could not create fors_recipe parameters"</span>);
-<a name="l00143"></a>00143         <span class="keywordflow">return</span> 1;
-<a name="l00144"></a>00144     }
-<a name="l00145"></a>00145         
-<a name="l00146"></a>00146     <span class="keywordflow">return</span> 0;
-<a name="l00147"></a>00147 }
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 
-<a name="l00158"></a><a class="code" href="group__fors__recipe.html#g2e82215d74913efed45e3dce601076aa">00158</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#g2e82215d74913efed45e3dce601076aa">fors_recipe_exec</a>(cpl_plugin *plugin)
-<a name="l00159"></a>00159 {
-<a name="l00160"></a>00160     cpl_recipe *recipe;
-<a name="l00161"></a>00161     cpl_errorstate initial_errorstate = cpl_errorstate_get();
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00164"></a>00164         cpl_msg_error(cpl_func, 
-<a name="l00165"></a>00165                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00166"></a>00166                       <span class="stringliteral">"refusing to execute recipe fors_recipe"</span>, 
-<a name="l00167"></a>00167                       cpl_error_get_message());
-<a name="l00168"></a>00168         <span class="keywordflow">return</span> 1;
-<a name="l00169"></a>00169     }
-<a name="l00170"></a>00170     
-<a name="l00171"></a>00171     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00172"></a>00172         recipe = (cpl_recipe *)plugin;
-<a name="l00173"></a>00173     }
-<a name="l00174"></a>00174     <span class="keywordflow">else</span> {
-<a name="l00175"></a>00175         cpl_msg_error(cpl_func, 
-<a name="l00176"></a>00176                       <span class="stringliteral">"Plugin is not a recipe"</span>);
-<a name="l00177"></a>00177         <span class="keywordflow">return</span> 1;
-<a name="l00178"></a>00178     }
-<a name="l00179"></a>00179 
-<a name="l00180"></a>00180     <span class="keywordflow">if</span> (recipe->frames == NULL) {
-<a name="l00181"></a>00181         cpl_msg_error(cpl_func, 
-<a name="l00182"></a>00182                       <span class="stringliteral">"Null frameset"</span>);
-<a name="l00183"></a>00183         <span class="keywordflow">return</span> 1;
-<a name="l00184"></a>00184     }
-<a name="l00185"></a>00185 
-<a name="l00186"></a>00186     <span class="keywordflow">if</span> (recipe->parameters == NULL) {
-<a name="l00187"></a>00187         cpl_msg_error(cpl_func, 
-<a name="l00188"></a>00188                       <span class="stringliteral">"Null parameter list"</span>);
-<a name="l00189"></a>00189         <span class="keywordflow">return</span> 1;
-<a name="l00190"></a>00190     }
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a>(recipe->frames,
-<a name="l00193"></a>00193                fors_recipe_description_short);
-<a name="l00194"></a>00194     
-<a name="l00195"></a>00195     fors_recipe(recipe->frames, recipe->parameters);
-<a name="l00196"></a>00196 
-<a name="l00197"></a>00197     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a>(recipe->frames, initial_errorstate);
-<a name="l00198"></a>00198 }
-<a name="l00199"></a>00199 
-<a name="l00200"></a>00200 
-<a name="l00209"></a><a class="code" href="group__fors__recipe.html#g351e58c2312f291e40fc17e8d9e09982">00209</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#g351e58c2312f291e40fc17e8d9e09982">fors_recipe_destroy</a>(cpl_plugin *plugin)
-<a name="l00210"></a>00210 {
-<a name="l00211"></a>00211     cpl_recipe *recipe;
-<a name="l00212"></a>00212     
-<a name="l00213"></a>00213     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00214"></a>00214         recipe = (cpl_recipe *)plugin;
-<a name="l00215"></a>00215     }
-<a name="l00216"></a>00216     <span class="keywordflow">else</span> {
-<a name="l00217"></a>00217         <span class="keywordflow">return</span> -1;
-<a name="l00218"></a>00218     }
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00221"></a>00221 
-<a name="l00222"></a>00222     <span class="keywordflow">return</span> 0;
-<a name="l00223"></a>00223 }
-<a name="l00224"></a>00224 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__recipe_8c_source.html b/html/fors__recipe_8c_source.html
new file mode 100644
index 0000000..6dba6e6
--- /dev/null
+++ b/html/fors__recipe_8c_source.html
@@ -0,0 +1,239 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_recipe.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_recipe.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_recipe.c,v 1.3 2010-09-14 07:38:16 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:38:16 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.3 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_recipe_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#gaccb93c75d494370cf0262930557dc4e2" title="Setup the recipe options.">fors_recipe_create</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#ga3a1716720583090ad664ae953d665d5b" title="Execute the plugin instance given by the interface.">fors_recipe_exec</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#ga455905b384dd9b68150677beda6bcee1" title="Destroy what has been created by the 'create' function.">fors_recipe_destroy</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__recipe.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">   62</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>())</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     {</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>               <span class="stringliteral">"I am fors_recipe version %d, but I am linking "</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>               <span class="stringliteral">"against the FORS library version %d. "</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>               <span class="stringliteral">"This will not work. "</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>               <span class="stringliteral">"Please remove all previous installations "</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>());</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     }</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                     fors_recipe_name,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                     fors_recipe_description_short,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     fors_recipe_description,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                     fors_recipe_author,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                     fors_recipe_email,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     fors_license,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     <a class="code" href="group__fors__recipe.html#gaccb93c75d494370cf0262930557dc4e2" title="Setup the recipe options.">fors_recipe_create</a>,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     <a class="code" href="group__fors__recipe.html#ga3a1716720583090ad664ae953d665d5b" title="Execute the plugin instance given by the interface.">fors_recipe_exec</a>,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <a class="code" href="group__fors__recipe.html#ga455905b384dd9b68150677beda6bcee1" title="Destroy what has been created by the 'create' function.">fors_recipe_destroy</a>);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> }</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="group__fors__recipe.html#gaccb93c75d494370cf0262930557dc4e2">  109</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#gaccb93c75d494370cf0262930557dc4e2" title="Setup the recipe options.">fors_recipe_create</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                       <span class="stringliteral">"refusing to create recipe fors_recipe"</span>, </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     }</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     }</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     fors_recipe_define_parameters(recipe->parameters);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                       <span class="stringliteral">"Could not create fors_recipe parameters"</span>);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     }</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> }</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="group__fors__recipe.html#ga3a1716720583090ad664ae953d665d5b">  158</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#ga3a1716720583090ad664ae953d665d5b" title="Execute the plugin instance given by the interface.">fors_recipe_exec</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> {</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_errorstate initial_errorstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                       <span class="stringliteral">"refusing to execute recipe fors_recipe"</span>, </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>                       <span class="stringliteral">"Plugin is not a recipe"</span>);</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     }</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     <span class="keywordflow">if</span> (recipe->frames == NULL) {</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>                       <span class="stringliteral">"Null frameset"</span>);</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     }</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL) {</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>                       <span class="stringliteral">"Null parameter list"</span>);</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     }</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce" title="Start recipe execution.">fors_begin</a>(recipe->frames,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                fors_recipe_description_short);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     fors_recipe(recipe->frames, recipe->parameters);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9" title="End recipe execution.">fors_end</a>(recipe->frames, initial_errorstate);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> }</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00209"></a><span class="lineno"><a class="code" href="group__fors__recipe.html#ga455905b384dd9b68150677beda6bcee1">  209</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__recipe.html#ga455905b384dd9b68150677beda6bcee1" title="Destroy what has been created by the 'create' function.">fors_recipe_destroy</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> {</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     }</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     }</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> </div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> }</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__recipe__impl_8h-source.html b/html/fors__recipe__impl_8h-source.html
deleted file mode 100644
index 8f7c973..0000000
--- a/html/fors__recipe__impl_8h-source.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_recipe_impl.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_recipe_impl.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_recipe_impl.h,v 1.2 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_RECIPE_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_RECIPE_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_recipe_name;
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_recipe_description_short;
-<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_recipe_author;
-<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_recipe_email;
-<a name="l00039"></a>00039 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_recipe_description;
-<a name="l00040"></a>00040 <span class="keywordtype">void</span> fors_recipe_define_parameters(cpl_parameterlist *parameters);
-<a name="l00041"></a>00041 <span class="keywordtype">void</span> fors_recipe(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 CPL_END_DECLS
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__recipe__impl_8h_source.html b/html/fors__recipe__impl_8h_source.html
new file mode 100644
index 0000000..4d50cc2
--- /dev/null
+++ b/html/fors__recipe__impl_8h_source.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_recipe_impl.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_recipe_impl.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_recipe_impl.h,v 1.2 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.2 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_RECIPE_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_RECIPE_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_recipe_name;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_recipe_description_short;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_recipe_author;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_recipe_email;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_recipe_description;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keywordtype">void</span> fors_recipe_define_parameters(cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keywordtype">void</span> fors_recipe(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__remove__bias_8c-source.html b/html/fors__remove__bias_8c-source.html
deleted file mode 100644
index e1c69c4..0000000
--- a/html/fors__remove__bias_8c-source.html
+++ /dev/null
@@ -1,376 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_remove_bias.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_remove_bias.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_remove_bias.c,v 1.7 2013/04/24 14:14:14 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:14 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_remove_bias_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to subtract the master bias, produced by the recipe\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"fors_bias, from one raw data frame. The overscan regions, if present, are\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"used to compensate for variations of the bias level between master bias\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"and input raw frame. The overscan regions are then trimmed from the result.\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"LSS.\n\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"  LAMP_MXU\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"  or SCIENCE_MXU\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"  or STANDARD_MXU            Raw         Raw data frame          Y\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"  MASTER_BIAS                Calib       Master bias frame       Y\n\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  LAMP_UNBIAS_MXU\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  or SCIENCE_UNBIAS_MXU\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  or STANDARD_UNBIAS_MXU     FITS image  Bias subtracted frame\n\n"</span>;
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 <span class="preprocessor">#define fors_remove_bias_exit(message)        \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">{                                             \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">cpl_image_delete(raw_image);                  \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">cpl_image_delete(master_bias);                \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00067"></a>00067 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">}</span>
-<a name="l00071"></a>00071 <span class="preprocessor"></span>
-<a name="l00072"></a>00072 <span class="preprocessor">#define fors_remove_bias_exit_memcheck(message) \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">{                                               \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">printf("free raw_image (%p)\n", raw_image);     \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_image_delete(raw_image);                    \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">printf("free master_bias (%p)\n", master_bias); \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_image_delete(master_bias);                  \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">printf("free overscans (%p)\n", overscans);     \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_table_delete(overscans);                    \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">}</span>
-<a name="l00086"></a>00086 <span class="preprocessor"></span>
-<a name="l00087"></a>00087 
-<a name="l00099"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00099</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00100"></a>00100 {
-<a name="l00101"></a>00101     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00102"></a>00102     cpl_plugin *plugin = &recipe->interface;
-<a name="l00103"></a>00103 
-<a name="l00104"></a>00104     cpl_plugin_init(plugin,
-<a name="l00105"></a>00105                     CPL_PLUGIN_API,
-<a name="l00106"></a>00106                     FORS_BINARY_VERSION,
-<a name="l00107"></a>00107                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00108"></a>00108                     <span class="stringliteral">"fors_remove_bias"</span>,
-<a name="l00109"></a>00109                     <span class="stringliteral">"Subtract bias from input frame"</span>,
-<a name="l00110"></a>00110                     fors_remove_bias_description,
-<a name="l00111"></a>00111                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00112"></a>00112                     PACKAGE_BUGREPORT,
-<a name="l00113"></a>00113     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00114"></a>00114     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00115"></a>00115     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00116"></a>00116     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00117"></a>00117     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00118"></a>00118     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00119"></a>00119     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00120"></a>00120     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00121"></a>00121     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00122"></a>00122     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00123"></a>00123     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00124"></a>00124     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00125"></a>00125     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00126"></a>00126                     fors_remove_bias_create,
-<a name="l00127"></a>00127                     fors_remove_bias_exec,
-<a name="l00128"></a>00128                     fors_remove_bias_destroy);
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130     cpl_pluginlist_append(list, plugin);
-<a name="l00131"></a>00131     
-<a name="l00132"></a>00132     <span class="keywordflow">return</span> 0;
-<a name="l00133"></a>00133 }
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135 
-<a name="l00146"></a>00146 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_create(cpl_plugin *plugin)
-<a name="l00147"></a>00147 {
-<a name="l00148"></a>00148     cpl_recipe    *recipe;
-<a name="l00149"></a>00149 <span class="comment">/* Uncomment in case parameters are defined</span>
-<a name="l00150"></a>00150 <span class="comment">    cpl_parameter *p;</span>
-<a name="l00151"></a>00151 <span class="comment">*/</span>
-<a name="l00152"></a>00152 
-<a name="l00153"></a>00153     <span class="comment">/* </span>
-<a name="l00154"></a>00154 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00155"></a>00155 <span class="comment">     */</span>
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00158"></a>00158         recipe = (cpl_recipe *)plugin;
-<a name="l00159"></a>00159     <span class="keywordflow">else</span> 
-<a name="l00160"></a>00160         <span class="keywordflow">return</span> -1;
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162     <span class="comment">/* </span>
-<a name="l00163"></a>00163 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00164"></a>00164 <span class="comment">     */</span>
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00167"></a>00167 
-<a name="l00168"></a>00168     <span class="keywordflow">return</span> 0;
-<a name="l00169"></a>00169 }
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171 
-<a name="l00180"></a>00180 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_exec(cpl_plugin *plugin)
-<a name="l00181"></a>00181 {
-<a name="l00182"></a>00182     cpl_recipe *recipe;
-<a name="l00183"></a>00183     
-<a name="l00184"></a>00184     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00185"></a>00185         recipe = (cpl_recipe *)plugin;
-<a name="l00186"></a>00186     <span class="keywordflow">else</span> 
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> -1;
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189     <span class="keywordflow">return</span> fors_remove_bias(recipe->parameters, recipe->frames);
-<a name="l00190"></a>00190 }
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192 
-<a name="l00201"></a>00201 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_destroy(cpl_plugin *plugin)
-<a name="l00202"></a>00202 {
-<a name="l00203"></a>00203     cpl_recipe *recipe;
-<a name="l00204"></a>00204     
-<a name="l00205"></a>00205     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00206"></a>00206         recipe = (cpl_recipe *)plugin;
-<a name="l00207"></a>00207     <span class="keywordflow">else</span> 
-<a name="l00208"></a>00208         <span class="keywordflow">return</span> -1;
-<a name="l00209"></a>00209 
-<a name="l00210"></a>00210     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00211"></a>00211 
-<a name="l00212"></a>00212     <span class="keywordflow">return</span> 0;
-<a name="l00213"></a>00213 }
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215 
-<a name="l00225"></a>00225 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00226"></a>00226 {
-<a name="l00227"></a>00227 
-<a name="l00228"></a>00228     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_remove_bias"</span>;
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230 
-<a name="l00231"></a>00231     <span class="comment">/*</span>
-<a name="l00232"></a>00232 <span class="comment">     * CPL objects</span>
-<a name="l00233"></a>00233 <span class="comment">     */</span>
-<a name="l00234"></a>00234 
-<a name="l00235"></a>00235     cpl_image        *raw_image   = NULL;
-<a name="l00236"></a>00236     cpl_image        *master_bias = NULL;
-<a name="l00237"></a>00237     cpl_image        *dummy       = NULL;
-<a name="l00238"></a>00238     cpl_table        *overscans   = NULL;
-<a name="l00239"></a>00239     cpl_propertylist *header      = NULL;
-<a name="l00240"></a>00240 
-<a name="l00241"></a>00241     <span class="comment">/*</span>
-<a name="l00242"></a>00242 <span class="comment">     * Auxiliary variables</span>
-<a name="l00243"></a>00243 <span class="comment">     */</span>
-<a name="l00244"></a>00244 
-<a name="l00245"></a>00245     <span class="keywordtype">char</span>        version[80];
-<a name="l00246"></a>00246     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_bias_tag = <span class="stringliteral">"MASTER_BIAS"</span>;
-<a name="l00247"></a>00247     <span class="keyword">const</span> <span class="keywordtype">char</span> *raw_image_tag;
-<a name="l00248"></a>00248     <span class="keyword">const</span> <span class="keywordtype">char</span> *pro_image_tag;
-<a name="l00249"></a>00249     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00250"></a>00250     <span class="keywordtype">int</span>         lamp_mxu;
-<a name="l00251"></a>00251     <span class="keywordtype">int</span>         lamp_mos;
-<a name="l00252"></a>00252     <span class="keywordtype">int</span>         lamp_lss;
-<a name="l00253"></a>00253     <span class="keywordtype">int</span>         science_mxu;
-<a name="l00254"></a>00254     <span class="keywordtype">int</span>         science_mos;
-<a name="l00255"></a>00255     <span class="keywordtype">int</span>         science_lss;
-<a name="l00256"></a>00256     <span class="keywordtype">int</span>         standard_mxu;
-<a name="l00257"></a>00257     <span class="keywordtype">int</span>         standard_mos;
-<a name="l00258"></a>00258     <span class="keywordtype">int</span>         standard_lss;
-<a name="l00259"></a>00259     <span class="keywordtype">int</span>         nbias, nframe;
-<a name="l00260"></a>00260 
-<a name="l00261"></a>00261 
-<a name="l00262"></a>00262     cpl_msg_set_indentation(2);
-<a name="l00263"></a>00263 
-<a name="l00264"></a>00264 
-<a name="l00265"></a>00265     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00266"></a>00266     cpl_msg_indent_more();
-<a name="l00267"></a>00267 
-<a name="l00268"></a>00268     nbias = cpl_frameset_count_tags(frameset, master_bias_tag);
-<a name="l00269"></a>00269     <span class="keywordflow">if</span> (nbias == 0) {
-<a name="l00270"></a>00270         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, master_bias_tag);
-<a name="l00271"></a>00271         fors_remove_bias_exit(NULL);
-<a name="l00272"></a>00272     }
-<a name="l00273"></a>00273     <span class="keywordflow">if</span> (nbias > 1) {
-<a name="l00274"></a>00274         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input (%d > 1): %s"</span>, 
-<a name="l00275"></a>00275                       nbias, master_bias_tag);
-<a name="l00276"></a>00276         fors_remove_bias_exit(NULL);
-<a name="l00277"></a>00277     }
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     nframe  = lamp_mxu     = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_MXU"</span>);
-<a name="l00280"></a>00280     nframe += lamp_mos     = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_MOS"</span>);
-<a name="l00281"></a>00281     nframe += lamp_lss     = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_LSS"</span>);
-<a name="l00282"></a>00282     nframe += science_mxu  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MXU"</span>);
-<a name="l00283"></a>00283     nframe += science_mos  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MOS"</span>);
-<a name="l00284"></a>00284     nframe += science_lss  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_LSS"</span>);
-<a name="l00285"></a>00285     nframe += standard_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MXU"</span>);
-<a name="l00286"></a>00286     nframe += standard_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MOS"</span>);
-<a name="l00287"></a>00287     nframe += standard_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_LSS"</span>);
-<a name="l00288"></a>00288 
-<a name="l00289"></a>00289     <span class="keywordflow">if</span> (nframe == 0) {
-<a name="l00290"></a>00290         fors_remove_bias_exit(<span class="stringliteral">"Missing required input raw frame"</span>);
-<a name="l00291"></a>00291     }
-<a name="l00292"></a>00292     <span class="keywordflow">if</span> (nframe > 1) {
-<a name="l00293"></a>00293         cpl_msg_error(recipe, <span class="stringliteral">"Too many input raw frames (%d > 1)"</span>, nframe);
-<a name="l00294"></a>00294         fors_remove_bias_exit(NULL);
-<a name="l00295"></a>00295     }
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297     <span class="keywordflow">if</span> (lamp_mxu) {
-<a name="l00298"></a>00298         raw_image_tag = <span class="stringliteral">"LAMP_MXU"</span>;
-<a name="l00299"></a>00299         pro_image_tag = <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>;
-<a name="l00300"></a>00300     }
-<a name="l00301"></a>00301     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_mos) {
-<a name="l00302"></a>00302         raw_image_tag = <span class="stringliteral">"LAMP_MOS"</span>;
-<a name="l00303"></a>00303         pro_image_tag = <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>;
-<a name="l00304"></a>00304     }
-<a name="l00305"></a>00305     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_lss) {
-<a name="l00306"></a>00306         raw_image_tag = <span class="stringliteral">"LAMP_LSS"</span>;
-<a name="l00307"></a>00307         pro_image_tag = <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>;
-<a name="l00308"></a>00308     }
-<a name="l00309"></a>00309     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (science_mxu) {
-<a name="l00310"></a>00310         raw_image_tag = <span class="stringliteral">"SCIENCE_MXU"</span>;
-<a name="l00311"></a>00311         pro_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;
-<a name="l00312"></a>00312     }
-<a name="l00313"></a>00313     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (science_mos) {
-<a name="l00314"></a>00314         raw_image_tag = <span class="stringliteral">"SCIENCE_MOS"</span>;
-<a name="l00315"></a>00315         pro_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;
-<a name="l00316"></a>00316     }
-<a name="l00317"></a>00317     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (science_lss) {
-<a name="l00318"></a>00318         raw_image_tag = <span class="stringliteral">"SCIENCE_LSS"</span>;
-<a name="l00319"></a>00319         pro_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>;
-<a name="l00320"></a>00320     }
-<a name="l00321"></a>00321     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_mxu) {
-<a name="l00322"></a>00322         raw_image_tag = <span class="stringliteral">"STANDARD_MXU"</span>;
-<a name="l00323"></a>00323         pro_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;
-<a name="l00324"></a>00324     }
-<a name="l00325"></a>00325     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_mos) {
-<a name="l00326"></a>00326         raw_image_tag = <span class="stringliteral">"STANDARD_MOS"</span>;
-<a name="l00327"></a>00327         pro_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;
-<a name="l00328"></a>00328     }
-<a name="l00329"></a>00329     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_lss) {
-<a name="l00330"></a>00330         raw_image_tag = <span class="stringliteral">"STANDARD_LSS"</span>;
-<a name="l00331"></a>00331         pro_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>;
-<a name="l00332"></a>00332     }
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>)) 
-<a name="l00335"></a>00335         fors_remove_bias_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, raw_image_tag, 0);
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l00340"></a>00340         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load header of %s frame"</span>, raw_image_tag);
-<a name="l00341"></a>00341         fors_remove_bias_exit(NULL);
-<a name="l00342"></a>00342     }
-<a name="l00343"></a>00343 
-<a name="l00344"></a>00344     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00345"></a>00345     <span class="keywordflow">if</span> (instrume == NULL) {
-<a name="l00346"></a>00346         cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword INSTRUME in %s header"</span>, 
-<a name="l00347"></a>00347                       raw_image_tag);
-<a name="l00348"></a>00348         fors_remove_bias_exit(NULL);
-<a name="l00349"></a>00349     }
-<a name="l00350"></a>00350 
-<a name="l00351"></a>00351     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00352"></a>00352         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00353"></a>00353     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00354"></a>00354         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356     cpl_msg_indent_less();
-<a name="l00357"></a>00357     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames:"</span>);
-<a name="l00358"></a>00358     cpl_msg_indent_more();
-<a name="l00359"></a>00359 
-<a name="l00360"></a>00360     master_bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, 
-<a name="l00361"></a>00361                                  master_bias_tag, CPL_TYPE_FLOAT, 0, 1);
-<a name="l00362"></a>00362     <span class="keywordflow">if</span> (master_bias == NULL)
-<a name="l00363"></a>00363         fors_remove_bias_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l00364"></a>00364 
-<a name="l00365"></a>00365     raw_image = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, 
-<a name="l00366"></a>00366                                raw_image_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00367"></a>00367     <span class="keywordflow">if</span> (raw_image == NULL) {
-<a name="l00368"></a>00368         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load %s frame"</span>, raw_image_tag);
-<a name="l00369"></a>00369         fors_remove_bias_exit(NULL);
-<a name="l00370"></a>00370     }
-<a name="l00371"></a>00371 
-<a name="l00372"></a>00372     overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 1);
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374     cpl_msg_indent_less();
-<a name="l00375"></a>00375     cpl_msg_info(recipe, <span class="stringliteral">"Subtract the master bias from input %s..."</span>, 
-<a name="l00376"></a>00376                  raw_image_tag);
-<a name="l00377"></a>00377     cpl_msg_indent_more();
-<a name="l00378"></a>00378 
-<a name="l00379"></a>00379     dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(raw_image, master_bias, overscans);
-<a name="l00380"></a>00380     cpl_table_delete(overscans); overscans = NULL;
-<a name="l00381"></a>00381     cpl_image_delete(master_bias); master_bias = NULL;
-<a name="l00382"></a>00382     cpl_image_delete(raw_image); raw_image = dummy;
-<a name="l00383"></a>00383 
-<a name="l00384"></a>00384     <span class="keywordflow">if</span> (raw_image == NULL) {
-<a name="l00385"></a>00385         cpl_msg_error(recipe, <span class="stringliteral">"Cannot remove bias from %s frame"</span>, 
-<a name="l00386"></a>00386                       raw_image_tag);
-<a name="l00387"></a>00387         fors_remove_bias_exit(NULL);
-<a name="l00388"></a>00388     }
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390     cpl_msg_indent_less();
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, raw_image, pro_image_tag,
-<a name="l00393"></a>00393                        header, parlist, recipe, version))
-<a name="l00394"></a>00394         fors_remove_bias_exit(NULL);
-<a name="l00395"></a>00395 
-<a name="l00396"></a>00396     cpl_propertylist_delete(header); header = NULL;
-<a name="l00397"></a>00397     cpl_image_delete(raw_image); raw_image = NULL;
-<a name="l00398"></a>00398 
-<a name="l00399"></a>00399     <span class="keywordflow">return</span> 0;
-<a name="l00400"></a>00400 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__remove__bias_8c_source.html b/html/fors__remove__bias_8c_source.html
new file mode 100644
index 0000000..8ffd3ca
--- /dev/null
+++ b/html/fors__remove__bias_8c_source.html
@@ -0,0 +1,415 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_remove_bias.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_remove_bias.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_remove_bias.c,v 1.7 2013-04-24 14:14:14 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-04-24 14:14:14 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.7 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_remove_bias_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to subtract the master bias, produced by the recipe\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"fors_bias, from one raw data frame. The overscan regions, if present, are\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"used to compensate for variations of the bias level between master bias\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"and input raw frame. The overscan regions are then trimmed from the result.\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS and\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"LSS.\n\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"  LAMP_MXU\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"  or SCIENCE_MXU\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"  or STANDARD_MXU            Raw         Raw data frame          Y\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"  MASTER_BIAS                Calib       Master bias frame       Y\n\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  LAMP_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  or SCIENCE_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  or STANDARD_UNBIAS_MXU     FITS image  Bias subtracted frame\n\n"</span>;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">#define fors_remove_bias_exit(message)        \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">cpl_image_delete(raw_image);                  \</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">cpl_image_delete(master_bias);                \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">#define fors_remove_bias_exit_memcheck(message) \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">printf("free raw_image (%p)\n", raw_image);     \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_image_delete(raw_image);                    \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">printf("free master_bias (%p)\n", master_bias); \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_image_delete(master_bias);                  \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">printf("free overscans (%p)\n", overscans);     \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_table_delete(overscans);                    \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> {</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                     <span class="stringliteral">"fors_remove_bias"</span>,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                     <span class="stringliteral">"Subtract bias from input frame"</span>,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     fors_remove_bias_description,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                     fors_remove_bias_create,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                     fors_remove_bias_exec,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                     fors_remove_bias_destroy);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> }</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> {</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="comment">/* Uncomment in case parameters are defined</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="comment">    cpl_parameter *p;</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> </div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> {</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     <span class="keywordflow">return</span> fors_remove_bias(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> }</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> {</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> </div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> }</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> </div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_remove_bias(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> {</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> </div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_remove_bias"</span>;</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_image        *raw_image   = NULL;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_image        *master_bias = NULL;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_image        *dummy       = NULL;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_table        *overscans   = NULL;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> </div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_bias_tag = <span class="stringliteral">"MASTER_BIAS"</span>;</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *raw_image_tag;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *pro_image_tag;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keywordtype">int</span>         lamp_mxu;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     <span class="keywordtype">int</span>         lamp_mos;</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="keywordtype">int</span>         lamp_lss;</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="keywordtype">int</span>         science_mxu;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="keywordtype">int</span>         science_mos;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <span class="keywordtype">int</span>         science_lss;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="keywordtype">int</span>         standard_mxu;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordtype">int</span>         standard_mos;</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     <span class="keywordtype">int</span>         standard_lss;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     <span class="keywordtype">int</span>         nbias, nframe;</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     nbias = cpl_frameset_count_tags(frameset, master_bias_tag);</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="keywordflow">if</span> (nbias == 0) {</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, master_bias_tag);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>         fors_remove_bias_exit(NULL);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     }</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="keywordflow">if</span> (nbias > 1) {</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input (%d > 1): %s"</span>, </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                       nbias, master_bias_tag);</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>         fors_remove_bias_exit(NULL);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     }</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     nframe  = lamp_mxu     = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_MXU"</span>);</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     nframe += lamp_mos     = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_MOS"</span>);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     nframe += lamp_lss     = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_LSS"</span>);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     nframe += science_mxu  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MXU"</span>);</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     nframe += science_mos  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MOS"</span>);</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     nframe += science_lss  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_LSS"</span>);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     nframe += standard_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MXU"</span>);</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     nframe += standard_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MOS"</span>);</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     nframe += standard_lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_LSS"</span>);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> </div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keywordflow">if</span> (nframe == 0) {</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         fors_remove_bias_exit(<span class="stringliteral">"Missing required input raw frame"</span>);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     }</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     <span class="keywordflow">if</span> (nframe > 1) {</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input raw frames (%d > 1)"</span>, nframe);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>         fors_remove_bias_exit(NULL);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     }</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keywordflow">if</span> (lamp_mxu) {</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>         raw_image_tag = <span class="stringliteral">"LAMP_MXU"</span>;</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>         pro_image_tag = <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     }</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_mos) {</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         raw_image_tag = <span class="stringliteral">"LAMP_MOS"</span>;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>         pro_image_tag = <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     }</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_lss) {</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         raw_image_tag = <span class="stringliteral">"LAMP_LSS"</span>;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         pro_image_tag = <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     }</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (science_mxu) {</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>         raw_image_tag = <span class="stringliteral">"SCIENCE_MXU"</span>;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>         pro_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     }</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (science_mos) {</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>         raw_image_tag = <span class="stringliteral">"SCIENCE_MOS"</span>;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         pro_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     }</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (science_lss) {</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>         raw_image_tag = <span class="stringliteral">"SCIENCE_LSS"</span>;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>         pro_image_tag = <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     }</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_mxu) {</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>         raw_image_tag = <span class="stringliteral">"STANDARD_MXU"</span>;</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>         pro_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     }</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_mos) {</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>         raw_image_tag = <span class="stringliteral">"STANDARD_MOS"</span>;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>         pro_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     }</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (standard_lss) {</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>         raw_image_tag = <span class="stringliteral">"STANDARD_LSS"</span>;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>         pro_image_tag = <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     }</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>)) </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>         fors_remove_bias_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, raw_image_tag, 0);</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load header of %s frame"</span>, raw_image_tag);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>         fors_remove_bias_exit(NULL);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     }</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> </div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     <span class="keywordflow">if</span> (instrume == NULL) {</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword INSTRUME in %s header"</span>, </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>                       raw_image_tag);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>         fors_remove_bias_exit(NULL);</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     }</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> </div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> </div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames:"</span>);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     master_bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>                                  master_bias_tag, CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     <span class="keywordflow">if</span> (master_bias == NULL)</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>         fors_remove_bias_exit(<span class="stringliteral">"Cannot load master bias"</span>);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     raw_image = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                                raw_image_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keywordflow">if</span> (raw_image == NULL) {</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>         cpl_msg_error(recipe, <span class="stringliteral">"Cannot load %s frame"</span>, raw_image_tag);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>         fors_remove_bias_exit(NULL);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     }</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> </div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     overscans = <a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(header, 1);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     cpl_msg_info(recipe, <span class="stringliteral">"Subtract the master bias from input %s..."</span>, </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>                  raw_image_tag);</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(raw_image, master_bias, overscans);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     cpl_table_delete(overscans); overscans = NULL;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     cpl_image_delete(master_bias); master_bias = NULL;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     cpl_image_delete(raw_image); raw_image = dummy;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="keywordflow">if</span> (raw_image == NULL) {</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>         cpl_msg_error(recipe, <span class="stringliteral">"Cannot remove bias from %s frame"</span>, </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>                       raw_image_tag);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>         fors_remove_bias_exit(NULL);</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     }</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, raw_image, pro_image_tag,</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>                        header, parlist, recipe, version))</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>         fors_remove_bias_exit(NULL);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> </div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     cpl_image_delete(raw_image); raw_image = NULL;</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__resample_8c-source.html b/html/fors__resample_8c-source.html
deleted file mode 100644
index b5883fe..0000000
--- a/html/fors__resample_8c-source.html
+++ /dev/null
@@ -1,803 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_resample.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_resample.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_resample.c,v 1.10 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.10 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_resample_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to resample at constant wavelength step spatially\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"rectified spectra. The input frames are produced using either the recipe\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"fors_extract_slits in the case of MOS/MXU multi slit exposures, or the\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"recipes fors_remove_bias and fors_flatfield in the case of LSS or long-slit\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"like MOS/MXU data. Only in case of LSS or LSS-like data the SLIT_LOCATION\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"table is required in input. Please refer to the FORS Pipeline User's Manual\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"for more details.\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"In the table below the MXU acronym can also be read as MOS and LSS, SCI\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"can be read as STD, and SCIENCE as STANDARD.\n\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"  LAMP_UNBIAS_MXU\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"  or SCIENCE_UNBIAS_MXU\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  or SCIENCE_UNFLAT_MXU\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  or RECTIFIED_LAMP_MXU\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  or RECTIFIED_ALL_SCI_MXU\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"  or RECTIFIED_SCI_MXU\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"  or RECTIFIED_SKY_SCI_MXU   Calib       Frame to resample       Y\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"  DISP_COEFF_MXU\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  or DISP_COEFF_SCI_MXU      Calib       Dispersion coefficients Y\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location table     Y\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  MAPPED_LAMP_MXU\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  or MAPPED_ALL_SCI_MXU\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"  or MAPPED_SCI_MXU\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"  or MAPPED_SKY_SCI_MXU      FITS image  Resampled spectra\n\n"</span>;
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073 <span class="preprocessor">#define fors_resample_exit(message)           \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">{                                             \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">cpl_image_delete(mapped);                     \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">}</span>
-<a name="l00085"></a>00085 <span class="preprocessor"></span>
-<a name="l00086"></a>00086 <span class="preprocessor">#define fors_resample_exit_memcheck(message)    \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">{                                               \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">cpl_image_delete(spectra);                      \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">printf("free mapped (%p)\n", mapped);           \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">cpl_image_delete(mapped);                       \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span>
-<a name="l00094"></a>00094 <span class="preprocessor">cpl_table_delete(grism_table);                  \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);       \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">cpl_table_delete(idscoeff);                     \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">cpl_table_delete(slits);                        \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">}</span>
-<a name="l00104"></a>00104 <span class="preprocessor"></span>
-<a name="l00105"></a>00105 
-<a name="l00117"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00117</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00118"></a>00118 {
-<a name="l00119"></a>00119     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00120"></a>00120     cpl_plugin *plugin = &recipe->interface;
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122     cpl_plugin_init(plugin,
-<a name="l00123"></a>00123                     CPL_PLUGIN_API,
-<a name="l00124"></a>00124                     FORS_BINARY_VERSION,
-<a name="l00125"></a>00125                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00126"></a>00126                     <span class="stringliteral">"fors_resample"</span>,
-<a name="l00127"></a>00127                     <span class="stringliteral">"Resample input spectra at constant wavelength step"</span>,
-<a name="l00128"></a>00128                     fors_resample_description,
-<a name="l00129"></a>00129                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00130"></a>00130                     PACKAGE_BUGREPORT,
-<a name="l00131"></a>00131     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00132"></a>00132     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00133"></a>00133     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00134"></a>00134     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00135"></a>00135     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00136"></a>00136     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00137"></a>00137     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00138"></a>00138     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00139"></a>00139     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00140"></a>00140     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00141"></a>00141     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00142"></a>00142     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00143"></a>00143     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00144"></a>00144                     fors_resample_create,
-<a name="l00145"></a>00145                     fors_resample_exec,
-<a name="l00146"></a>00146                     fors_resample_destroy);
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     cpl_pluginlist_append(list, plugin);
-<a name="l00149"></a>00149     
-<a name="l00150"></a>00150     <span class="keywordflow">return</span> 0;
-<a name="l00151"></a>00151 }
-<a name="l00152"></a>00152 
-<a name="l00153"></a>00153 
-<a name="l00164"></a>00164 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_create(cpl_plugin *plugin)
-<a name="l00165"></a>00165 {
-<a name="l00166"></a>00166     cpl_recipe    *recipe;
-<a name="l00167"></a>00167     cpl_parameter *p;
-<a name="l00168"></a>00168 
-<a name="l00169"></a>00169     <span class="comment">/* </span>
-<a name="l00170"></a>00170 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00171"></a>00171 <span class="comment">     */</span>
-<a name="l00172"></a>00172 
-<a name="l00173"></a>00173     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00174"></a>00174         recipe = (cpl_recipe *)plugin;
-<a name="l00175"></a>00175     <span class="keywordflow">else</span> 
-<a name="l00176"></a>00176         <span class="keywordflow">return</span> -1;
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="comment">/* </span>
-<a name="l00179"></a>00179 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00180"></a>00180 <span class="comment">     */</span>
-<a name="l00181"></a>00181 
-<a name="l00182"></a>00182     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="comment">/*</span>
-<a name="l00185"></a>00185 <span class="comment">     * Dispersion</span>
-<a name="l00186"></a>00186 <span class="comment">     */</span>
-<a name="l00187"></a>00187 
-<a name="l00188"></a>00188     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_resample.dispersion"</span>,
-<a name="l00189"></a>00189                                 CPL_TYPE_DOUBLE,
-<a name="l00190"></a>00190                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00191"></a>00191                                 <span class="stringliteral">"fors.fors_resample"</span>,
-<a name="l00192"></a>00192                                 0.0);
-<a name="l00193"></a>00193     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00194"></a>00194     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00195"></a>00195     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00196"></a>00196 
-<a name="l00197"></a>00197     <span class="comment">/*</span>
-<a name="l00198"></a>00198 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00199"></a>00199 <span class="comment">     */</span>
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_resample.startwavelength"</span>,
-<a name="l00202"></a>00202                                 CPL_TYPE_DOUBLE,
-<a name="l00203"></a>00203                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00204"></a>00204                                 <span class="stringliteral">"fors.fors_resample"</span>,
-<a name="l00205"></a>00205                                 0.0);
-<a name="l00206"></a>00206     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00207"></a>00207     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00208"></a>00208     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00209"></a>00209 
-<a name="l00210"></a>00210     <span class="comment">/*</span>
-<a name="l00211"></a>00211 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00212"></a>00212 <span class="comment">     */</span>
-<a name="l00213"></a>00213 
-<a name="l00214"></a>00214     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_resample.endwavelength"</span>,
-<a name="l00215"></a>00215                                 CPL_TYPE_DOUBLE,
-<a name="l00216"></a>00216                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00217"></a>00217                                 <span class="stringliteral">"fors.fors_resample"</span>,
-<a name="l00218"></a>00218                                 0.0);
-<a name="l00219"></a>00219     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00220"></a>00220     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00221"></a>00221     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00222"></a>00222 
-<a name="l00223"></a>00223     <span class="comment">/*</span>
-<a name="l00224"></a>00224 <span class="comment">     * Flux conservation</span>
-<a name="l00225"></a>00225 <span class="comment">     */</span>
-<a name="l00226"></a>00226  
-<a name="l00227"></a>00227     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_resample.flux"</span>,
-<a name="l00228"></a>00228                                 CPL_TYPE_BOOL,
-<a name="l00229"></a>00229                                 <span class="stringliteral">"Apply flux conservation"</span>,
-<a name="l00230"></a>00230                                 <span class="stringliteral">"fors.fors_resample"</span>,
-<a name="l00231"></a>00231                                 TRUE);
-<a name="l00232"></a>00232     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);
-<a name="l00233"></a>00233     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00234"></a>00234     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00235"></a>00235 
-<a name="l00236"></a>00236     <span class="keywordflow">return</span> 0;
-<a name="l00237"></a>00237 }
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239 
-<a name="l00248"></a>00248 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_exec(cpl_plugin *plugin)
-<a name="l00249"></a>00249 {
-<a name="l00250"></a>00250     cpl_recipe *recipe;
-<a name="l00251"></a>00251     
-<a name="l00252"></a>00252     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00253"></a>00253         recipe = (cpl_recipe *)plugin;
-<a name="l00254"></a>00254     <span class="keywordflow">else</span> 
-<a name="l00255"></a>00255         <span class="keywordflow">return</span> -1;
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257     <span class="keywordflow">return</span> fors_resample(recipe->parameters, recipe->frames);
-<a name="l00258"></a>00258 }
-<a name="l00259"></a>00259 
-<a name="l00260"></a>00260 
-<a name="l00269"></a>00269 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_destroy(cpl_plugin *plugin)
-<a name="l00270"></a>00270 {
-<a name="l00271"></a>00271     cpl_recipe *recipe;
-<a name="l00272"></a>00272     
-<a name="l00273"></a>00273     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00274"></a>00274         recipe = (cpl_recipe *)plugin;
-<a name="l00275"></a>00275     <span class="keywordflow">else</span> 
-<a name="l00276"></a>00276         <span class="keywordflow">return</span> -1;
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00279"></a>00279 
-<a name="l00280"></a>00280     <span class="keywordflow">return</span> 0;
-<a name="l00281"></a>00281 }
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283 
-<a name="l00293"></a>00293 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample(cpl_parameterlist *parlist, 
-<a name="l00294"></a>00294                                cpl_frameset *frameset)
-<a name="l00295"></a>00295 {
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_resample"</span>;
-<a name="l00298"></a>00298 
-<a name="l00299"></a>00299 
-<a name="l00300"></a>00300     <span class="comment">/*</span>
-<a name="l00301"></a>00301 <span class="comment">     * Input parameters</span>
-<a name="l00302"></a>00302 <span class="comment">     */</span>
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304     <span class="keywordtype">double</span>      dispersion;
-<a name="l00305"></a>00305     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00306"></a>00306     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00307"></a>00307     <span class="keywordtype">int</span>         flux;
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309     <span class="comment">/*</span>
-<a name="l00310"></a>00310 <span class="comment">     * CPL objects</span>
-<a name="l00311"></a>00311 <span class="comment">     */</span>
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313     cpl_image        *spectra     = NULL;
-<a name="l00314"></a>00314     cpl_image        *mapped      = NULL;
-<a name="l00315"></a>00315     cpl_table        *grism_table = NULL;
-<a name="l00316"></a>00316     cpl_table        *maskslits   = NULL;
-<a name="l00317"></a>00317     cpl_table        *slits       = NULL;
-<a name="l00318"></a>00318     cpl_table        *idscoeff    = NULL;
-<a name="l00319"></a>00319     cpl_propertylist *header      = NULL;
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321     <span class="comment">/*</span>
-<a name="l00322"></a>00322 <span class="comment">     * Auxiliary variables</span>
-<a name="l00323"></a>00323 <span class="comment">     */</span>
-<a name="l00324"></a>00324 
-<a name="l00325"></a>00325     <span class="keywordtype">char</span>        version[80];
-<a name="l00326"></a>00326     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;
-<a name="l00327"></a>00327     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00328"></a>00328     <span class="keyword">const</span> <span class="keywordtype">char</span> *rectified_tag;
-<a name="l00329"></a>00329     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_tag;
-<a name="l00330"></a>00330     <span class="keywordtype">int</span>         nframes;
-<a name="l00331"></a>00331     <span class="keywordtype">int</span>         rebin;
-<a name="l00332"></a>00332     <span class="keywordtype">double</span>      reference;
-<a name="l00333"></a>00333     <span class="keywordtype">double</span>     *xpos;
-<a name="l00334"></a>00334     <span class="keywordtype">double</span>      mxpos;
-<a name="l00335"></a>00335     <span class="keywordtype">int</span>         treat_as_lss = 0;
-<a name="l00336"></a>00336     <span class="keywordtype">int</span>         nslits, i;
-<a name="l00337"></a>00337     <span class="keywordtype">int</span>         mxu, mos, lss;
-<a name="l00338"></a>00338     <span class="keywordtype">int</span>         disp;
-<a name="l00339"></a>00339     <span class="keywordtype">int</span>         dispsci;
-<a name="l00340"></a>00340     <span class="keywordtype">int</span>         dispstd;
-<a name="l00341"></a>00341     <span class="keywordtype">int</span>         sciall;
-<a name="l00342"></a>00342     <span class="keywordtype">int</span>         stdall;
-<a name="l00343"></a>00343     <span class="keywordtype">int</span>         scisky;
-<a name="l00344"></a>00344     <span class="keywordtype">int</span>         stdsky;
-<a name="l00345"></a>00345     <span class="keywordtype">int</span>         sci;
-<a name="l00346"></a>00346     <span class="keywordtype">int</span>         std;
-<a name="l00347"></a>00347     <span class="keywordtype">int</span>         lamp;
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00350"></a>00350 
-<a name="l00351"></a>00351 
-<a name="l00352"></a>00352     cpl_msg_set_indentation(2);
-<a name="l00353"></a>00353 
-<a name="l00354"></a>00354     <span class="comment">/*</span>
-<a name="l00355"></a>00355 <span class="comment">     * Get configuration parameters</span>
-<a name="l00356"></a>00356 <span class="comment">     */</span>
-<a name="l00357"></a>00357 
-<a name="l00358"></a>00358     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00359"></a>00359     cpl_msg_indent_more();
-<a name="l00360"></a>00360     
-<a name="l00361"></a>00361     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00362"></a>00362         fors_resample_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); 
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00367"></a>00367                     <span class="stringliteral">"fors.fors_resample.dispersion"</span>, grism_table);
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00370"></a>00370         fors_resample_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00371"></a>00371 
-<a name="l00372"></a>00372     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00373"></a>00373                     <span class="stringliteral">"fors.fors_resample.startwavelength"</span>, grism_table);
-<a name="l00374"></a>00374     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00375"></a>00375         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00376"></a>00376             fors_resample_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00377"></a>00377 
-<a name="l00378"></a>00378     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00379"></a>00379                     <span class="stringliteral">"fors.fors_resample.endwavelength"</span>, grism_table);
-<a name="l00380"></a>00380     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00381"></a>00381         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00382"></a>00382             fors_resample_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00383"></a>00383         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00384"></a>00384             fors_resample_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00385"></a>00385     }
-<a name="l00386"></a>00386 
-<a name="l00387"></a>00387     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00388"></a>00388         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00389"></a>00389             fors_resample_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00390"></a>00390 
-<a name="l00391"></a>00391     flux = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_resample.flux"</span>, NULL);
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00396"></a>00396         fors_resample_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398 
-<a name="l00399"></a>00399     cpl_msg_indent_less();
-<a name="l00400"></a>00400     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00401"></a>00401     cpl_msg_indent_more();
-<a name="l00402"></a>00402 
-<a name="l00403"></a>00403     mxu  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_MXU"</span>);
-<a name="l00404"></a>00404     mxu += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>);
-<a name="l00405"></a>00405     mxu += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>);
-<a name="l00406"></a>00406     mos  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_MOS"</span>);
-<a name="l00407"></a>00407     mos += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>);
-<a name="l00408"></a>00408     mos += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>);
-<a name="l00409"></a>00409     lss  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_LSS"</span>);
-<a name="l00410"></a>00410     lss += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>);
-<a name="l00411"></a>00411     lss += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>);
-<a name="l00412"></a>00412 
-<a name="l00413"></a>00413     nframes = mos + mxu + lss;
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00416"></a>00416         fors_resample_exit(<span class="stringliteral">"Missing dispersion coefficients table"</span>);
-<a name="l00417"></a>00417     }
-<a name="l00418"></a>00418     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00419"></a>00419         cpl_msg_error(recipe, 
-<a name="l00420"></a>00420                       <span class="stringliteral">"Too many input dispersion coefficients tables (%d > 1)"</span>,
-<a name="l00421"></a>00421                       nframes);
-<a name="l00422"></a>00422         fors_resample_exit(NULL);
-<a name="l00423"></a>00423     }
-<a name="l00424"></a>00424 
-<a name="l00425"></a>00425     disp     = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_MXU"</span>);
-<a name="l00426"></a>00426     disp    += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_MOS"</span>);
-<a name="l00427"></a>00427     disp    += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_LSS"</span>);
-<a name="l00428"></a>00428     dispsci  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>);
-<a name="l00429"></a>00429     dispsci += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>);
-<a name="l00430"></a>00430     dispsci += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>);
-<a name="l00431"></a>00431     dispstd  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>);
-<a name="l00432"></a>00432     dispstd += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>);
-<a name="l00433"></a>00433     dispstd += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>);
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435     <span class="keywordflow">if</span> (mxu) {
-<a name="l00436"></a>00436         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00437"></a>00437         <span class="keywordflow">if</span> (disp)
-<a name="l00438"></a>00438             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_MXU"</span>;
-<a name="l00439"></a>00439         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dispsci)
-<a name="l00440"></a>00440             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;
-<a name="l00441"></a>00441         <span class="keywordflow">else</span>
-<a name="l00442"></a>00442             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;
-<a name="l00443"></a>00443     }
-<a name="l00444"></a>00444     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00445"></a>00445         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00446"></a>00446         <span class="keywordflow">if</span> (disp)
-<a name="l00447"></a>00447             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_MOS"</span>;
-<a name="l00448"></a>00448         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dispsci)
-<a name="l00449"></a>00449             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;
-<a name="l00450"></a>00450         <span class="keywordflow">else</span>
-<a name="l00451"></a>00451             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;
-<a name="l00452"></a>00452     }
-<a name="l00453"></a>00453     <span class="keywordflow">else</span> {
-<a name="l00454"></a>00454         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;
-<a name="l00455"></a>00455         <span class="keywordflow">if</span> (disp)
-<a name="l00456"></a>00456             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_LSS"</span>;
-<a name="l00457"></a>00457         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dispsci)
-<a name="l00458"></a>00458             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>;
-<a name="l00459"></a>00459         <span class="keywordflow">else</span>
-<a name="l00460"></a>00460             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>;
-<a name="l00461"></a>00461     }
-<a name="l00462"></a>00462 
-<a name="l00463"></a>00463     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, disp_coeff_tag, 0);
-<a name="l00464"></a>00464 
-<a name="l00465"></a>00465     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00466"></a>00466         fors_resample_exit(<span class="stringliteral">"Cannot load dispersion coefficients table header"</span>);
-<a name="l00467"></a>00467 
-<a name="l00468"></a>00468     <span class="keywordflow">if</span> (mos || mxu) {
-<a name="l00469"></a>00469         <span class="keywordtype">int</span> nslits_out_det = 0;
-<a name="l00470"></a>00470 
-<a name="l00471"></a>00471         <span class="keywordflow">if</span> (mos)
-<a name="l00472"></a>00472             maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00473"></a>00473         <span class="keywordflow">else</span>
-<a name="l00474"></a>00474             maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476         <span class="comment">/*</span>
-<a name="l00477"></a>00477 <span class="comment">         * Check if all slits have the same X offset.</span>
-<a name="l00478"></a>00478 <span class="comment">         */</span>
-<a name="l00479"></a>00479 
-<a name="l00480"></a>00480         treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l00481"></a>00481 
-<a name="l00482"></a>00482         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00483"></a>00483     }
-<a name="l00484"></a>00484 
-<a name="l00485"></a>00485     cpl_propertylist_delete(header); header = NULL;
-<a name="l00486"></a>00486 
-<a name="l00487"></a>00487     <span class="keywordflow">if</span> (mxu) {
-<a name="l00488"></a>00488         <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00489"></a>00489             sciall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>);
-<a name="l00490"></a>00490             stdall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>);
-<a name="l00491"></a>00491             scisky = 0;
-<a name="l00492"></a>00492             stdsky = 0;
-<a name="l00493"></a>00493             sci    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>);
-<a name="l00494"></a>00494             std    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>);
-<a name="l00495"></a>00495             lamp   = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>);
-<a name="l00496"></a>00496         }
-<a name="l00497"></a>00497         <span class="keywordflow">else</span> {
-<a name="l00498"></a>00498             sciall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>);
-<a name="l00499"></a>00499             stdall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>);
-<a name="l00500"></a>00500             scisky = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_SCI_MXU"</span>);
-<a name="l00501"></a>00501             stdsky = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_STD_MXU"</span>);
-<a name="l00502"></a>00502             sci    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SCI_MXU"</span>);
-<a name="l00503"></a>00503             std    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_STD_MXU"</span>);
-<a name="l00504"></a>00504             lamp   = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_LAMP_MXU"</span>);
-<a name="l00505"></a>00505         }
-<a name="l00506"></a>00506     }
-<a name="l00507"></a>00507     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00508"></a>00508         <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00509"></a>00509             sciall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>);
-<a name="l00510"></a>00510             stdall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>);
-<a name="l00511"></a>00511             scisky = 0;
-<a name="l00512"></a>00512             stdsky = 0;
-<a name="l00513"></a>00513             sci    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>);
-<a name="l00514"></a>00514             std    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>);
-<a name="l00515"></a>00515             lamp   = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>);
-<a name="l00516"></a>00516         }
-<a name="l00517"></a>00517         <span class="keywordflow">else</span> {
-<a name="l00518"></a>00518             sciall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>);
-<a name="l00519"></a>00519             stdall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>);
-<a name="l00520"></a>00520             scisky = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_SCI_MOS"</span>);
-<a name="l00521"></a>00521             stdsky = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_STD_MOS"</span>);
-<a name="l00522"></a>00522             sci    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SCI_MOS"</span>);
-<a name="l00523"></a>00523             std    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_STD_MOS"</span>);
-<a name="l00524"></a>00524             lamp   = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_LAMP_MOS"</span>);
-<a name="l00525"></a>00525         }
-<a name="l00526"></a>00526     }
-<a name="l00527"></a>00527     <span class="keywordflow">else</span> {
-<a name="l00528"></a>00528         sciall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>);
-<a name="l00529"></a>00529         stdall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>);
-<a name="l00530"></a>00530         scisky = 0;
-<a name="l00531"></a>00531         stdsky = 0;
-<a name="l00532"></a>00532         sci    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>);
-<a name="l00533"></a>00533         std    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>);
-<a name="l00534"></a>00534         lamp   = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>);
-<a name="l00535"></a>00535     }
-<a name="l00536"></a>00536 
-<a name="l00537"></a>00537     nframes = sciall + stdall + scisky + stdsky + sci + std + lamp;
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539     <span class="keywordflow">if</span> (nframes == 0)
-<a name="l00540"></a>00540         fors_resample_exit(<span class="stringliteral">"Missing input spectral frame"</span>);
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00543"></a>00543         cpl_msg_error(recipe, <span class="stringliteral">"Too many input spectral frames (%d > 1)"</span>, 
-<a name="l00544"></a>00544                       nframes);
-<a name="l00545"></a>00545         fors_resample_exit(NULL);
-<a name="l00546"></a>00546     }
-<a name="l00547"></a>00547 
-<a name="l00548"></a>00548     <span class="keywordflow">if</span> (sciall) {
-<a name="l00549"></a>00549         <span class="keywordflow">if</span> (mxu) {
-<a name="l00550"></a>00550             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00551"></a>00551                 rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>;
-<a name="l00552"></a>00552                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;
-<a name="l00553"></a>00553             }
-<a name="l00554"></a>00554             <span class="keywordflow">else</span> {
-<a name="l00555"></a>00555                 rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>;
-<a name="l00556"></a>00556                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;
-<a name="l00557"></a>00557             }
-<a name="l00558"></a>00558         }
-<a name="l00559"></a>00559         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00560"></a>00560             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00561"></a>00561                 rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>;
-<a name="l00562"></a>00562                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;
-<a name="l00563"></a>00563             }
-<a name="l00564"></a>00564             <span class="keywordflow">else</span> {
-<a name="l00565"></a>00565                 rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>;
-<a name="l00566"></a>00566                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;
-<a name="l00567"></a>00567             }
-<a name="l00568"></a>00568         }
-<a name="l00569"></a>00569         <span class="keywordflow">else</span> {
-<a name="l00570"></a>00570             rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>;
-<a name="l00571"></a>00571             mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>;
-<a name="l00572"></a>00572         }
-<a name="l00573"></a>00573     }
-<a name="l00574"></a>00574     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdall) {
-<a name="l00575"></a>00575         <span class="keywordflow">if</span> (mxu) {
-<a name="l00576"></a>00576             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00577"></a>00577                 rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>;
-<a name="l00578"></a>00578                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;
-<a name="l00579"></a>00579             }
-<a name="l00580"></a>00580             <span class="keywordflow">else</span> {
-<a name="l00581"></a>00581                 rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>;
-<a name="l00582"></a>00582                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;
-<a name="l00583"></a>00583             }
-<a name="l00584"></a>00584         }
-<a name="l00585"></a>00585         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00586"></a>00586             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00587"></a>00587                 rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>;
-<a name="l00588"></a>00588                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;
-<a name="l00589"></a>00589             }
-<a name="l00590"></a>00590             <span class="keywordflow">else</span> {
-<a name="l00591"></a>00591                 rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>;
-<a name="l00592"></a>00592                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;
-<a name="l00593"></a>00593             }
-<a name="l00594"></a>00594         }
-<a name="l00595"></a>00595         <span class="keywordflow">else</span> {
-<a name="l00596"></a>00596             rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>;
-<a name="l00597"></a>00597             mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>;
-<a name="l00598"></a>00598         }
-<a name="l00599"></a>00599     }
-<a name="l00600"></a>00600     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scisky) {
-<a name="l00601"></a>00601         <span class="keywordflow">if</span> (mxu) {
-<a name="l00602"></a>00602             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MXU"</span>;
-<a name="l00603"></a>00603             mapped_tag    = <span class="stringliteral">"MAPPED_SKY_SCI_MXU"</span>;
-<a name="l00604"></a>00604         }
-<a name="l00605"></a>00605         <span class="keywordflow">else</span> {
-<a name="l00606"></a>00606             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MOS"</span>;
-<a name="l00607"></a>00607             mapped_tag    = <span class="stringliteral">"MAPPED_SKY_SCI_MOS"</span>;
-<a name="l00608"></a>00608         }
-<a name="l00609"></a>00609     }
-<a name="l00610"></a>00610     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdsky) {
-<a name="l00611"></a>00611         <span class="keywordflow">if</span> (mxu) {
-<a name="l00612"></a>00612             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MXU"</span>;
-<a name="l00613"></a>00613             mapped_tag    = <span class="stringliteral">"MAPPED_SKY_STD_MXU"</span>;
-<a name="l00614"></a>00614         }
-<a name="l00615"></a>00615         <span class="keywordflow">else</span> {
-<a name="l00616"></a>00616             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MOS"</span>;
-<a name="l00617"></a>00617             mapped_tag    = <span class="stringliteral">"MAPPED_SKY_STD_MOS"</span>;
-<a name="l00618"></a>00618         }
-<a name="l00619"></a>00619     }
-<a name="l00620"></a>00620     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sci) {
-<a name="l00621"></a>00621         <span class="keywordflow">if</span> (mxu) {
-<a name="l00622"></a>00622             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00623"></a>00623                 rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;
-<a name="l00624"></a>00624                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;
-<a name="l00625"></a>00625             }
-<a name="l00626"></a>00626             <span class="keywordflow">else</span> {
-<a name="l00627"></a>00627                 rectified_tag = <span class="stringliteral">"RECTIFIED_SCI_MXU"</span>;
-<a name="l00628"></a>00628                 mapped_tag    = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;
-<a name="l00629"></a>00629             }
-<a name="l00630"></a>00630         }
-<a name="l00631"></a>00631         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00632"></a>00632             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00633"></a>00633                 rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;
-<a name="l00634"></a>00634                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;
-<a name="l00635"></a>00635             }
-<a name="l00636"></a>00636             <span class="keywordflow">else</span> {
-<a name="l00637"></a>00637                 rectified_tag = <span class="stringliteral">"RECTIFIED_SCI_MOS"</span>;
-<a name="l00638"></a>00638                 mapped_tag    = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;
-<a name="l00639"></a>00639             }
-<a name="l00640"></a>00640         }
-<a name="l00641"></a>00641         <span class="keywordflow">else</span> {
-<a name="l00642"></a>00642             rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>;
-<a name="l00643"></a>00643             mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>;
-<a name="l00644"></a>00644         }
-<a name="l00645"></a>00645     }
-<a name="l00646"></a>00646     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std) {
-<a name="l00647"></a>00647         <span class="keywordflow">if</span> (mxu) {
-<a name="l00648"></a>00648             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00649"></a>00649                 rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;
-<a name="l00650"></a>00650                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;
-<a name="l00651"></a>00651             }
-<a name="l00652"></a>00652             <span class="keywordflow">else</span> {
-<a name="l00653"></a>00653                 rectified_tag = <span class="stringliteral">"RECTIFIED_STD_MXU"</span>;
-<a name="l00654"></a>00654                 mapped_tag    = <span class="stringliteral">"MAPPED_STD_MXU"</span>;
-<a name="l00655"></a>00655             }
-<a name="l00656"></a>00656         }
-<a name="l00657"></a>00657         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00658"></a>00658             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00659"></a>00659                 rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;
-<a name="l00660"></a>00660                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;
-<a name="l00661"></a>00661             }
-<a name="l00662"></a>00662             <span class="keywordflow">else</span> {
-<a name="l00663"></a>00663                 rectified_tag = <span class="stringliteral">"RECTIFIED_STD_MOS"</span>;
-<a name="l00664"></a>00664                 mapped_tag    = <span class="stringliteral">"MAPPED_STD_MOS"</span>;
-<a name="l00665"></a>00665             }
-<a name="l00666"></a>00666         }
-<a name="l00667"></a>00667         <span class="keywordflow">else</span> {
-<a name="l00668"></a>00668             rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>;
-<a name="l00669"></a>00669             mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>;
-<a name="l00670"></a>00670         }
-<a name="l00671"></a>00671     }
-<a name="l00672"></a>00672     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp) {
-<a name="l00673"></a>00673         <span class="keywordflow">if</span> (mxu) {
-<a name="l00674"></a>00674             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00675"></a>00675                 rectified_tag = <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>;
-<a name="l00676"></a>00676                 mapped_tag    = <span class="stringliteral">"MAPPED_LAMP_MXU"</span>;
-<a name="l00677"></a>00677             }
-<a name="l00678"></a>00678             <span class="keywordflow">else</span> {
-<a name="l00679"></a>00679                 rectified_tag = <span class="stringliteral">"RECTIFIED_LAMP_MXU"</span>;
-<a name="l00680"></a>00680                 mapped_tag    = <span class="stringliteral">"MAPPED_LAMP_MXU"</span>;
-<a name="l00681"></a>00681             }
-<a name="l00682"></a>00682         }
-<a name="l00683"></a>00683         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00684"></a>00684             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00685"></a>00685                 rectified_tag = <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>;
-<a name="l00686"></a>00686                 mapped_tag    = <span class="stringliteral">"MAPPED_LAMP_MOS"</span>;
-<a name="l00687"></a>00687             }
-<a name="l00688"></a>00688             <span class="keywordflow">else</span> {
-<a name="l00689"></a>00689                 rectified_tag = <span class="stringliteral">"RECTIFIED_LAMP_MOS"</span>;
-<a name="l00690"></a>00690                 mapped_tag    = <span class="stringliteral">"MAPPED_LAMP_MOS"</span>;
-<a name="l00691"></a>00691             }
-<a name="l00692"></a>00692         }
-<a name="l00693"></a>00693         <span class="keywordflow">else</span> {
-<a name="l00694"></a>00694             rectified_tag = <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>;
-<a name="l00695"></a>00695             mapped_tag    = <span class="stringliteral">"MAPPED_LAMP_LSS"</span>;
-<a name="l00696"></a>00696         }
-<a name="l00697"></a>00697     }
-<a name="l00698"></a>00698 
-<a name="l00699"></a>00699     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, rectified_tag, 0);
-<a name="l00700"></a>00700 
-<a name="l00701"></a>00701     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00702"></a>00702         fors_resample_exit(<span class="stringliteral">"Cannot load spectral frame header"</span>);
-<a name="l00703"></a>00703 
-<a name="l00704"></a>00704 
-<a name="l00705"></a>00705     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00706"></a>00706         fors_resample_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00707"></a>00707 
-<a name="l00708"></a>00708     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00709"></a>00709         fors_resample_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00710"></a>00710 
-<a name="l00711"></a>00711     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00712"></a>00712         fors_resample_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00713"></a>00713 
-<a name="l00714"></a>00714 
-<a name="l00715"></a>00715     <span class="comment">/*</span>
-<a name="l00716"></a>00716 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00717"></a>00717 <span class="comment">     * dispersion direction from the reference frame</span>
-<a name="l00718"></a>00718 <span class="comment">     */</span>
-<a name="l00719"></a>00719 
-<a name="l00720"></a>00720     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00721"></a>00721     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00722"></a>00722         fors_resample_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span>
-<a name="l00723"></a>00723                             <span class="stringliteral">"header"</span>);
-<a name="l00724"></a>00724 
-<a name="l00725"></a>00725     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00726"></a>00726         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00727"></a>00727     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00728"></a>00728         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00729"></a>00729 
-<a name="l00730"></a>00730     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00731"></a>00731 
-<a name="l00732"></a>00732     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00733"></a>00733         fors_resample_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span>
-<a name="l00734"></a>00734                             <span class="stringliteral">"in reference frame header"</span>);
-<a name="l00735"></a>00735 
-<a name="l00736"></a>00736     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l00737"></a>00737         reference *= 10;
-<a name="l00738"></a>00738 
-<a name="l00739"></a>00739     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l00740"></a>00740         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l00741"></a>00741                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in reference frame header"</span>,
-<a name="l00742"></a>00742                       reference);
-<a name="l00743"></a>00743         fors_resample_exit(NULL);
-<a name="l00744"></a>00744     }
-<a name="l00745"></a>00745 
-<a name="l00746"></a>00746     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l00747"></a>00747 
-<a name="l00748"></a>00748     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00749"></a>00749 
-<a name="l00750"></a>00750     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00751"></a>00751         fors_resample_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00752"></a>00752                             <span class="stringliteral">"in reference frame header"</span>);
-<a name="l00753"></a>00753 
-<a name="l00754"></a>00754     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l00755"></a>00755         dispersion *= rebin;
-<a name="l00756"></a>00756         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l00757"></a>00757                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,
-<a name="l00758"></a>00758                         dispersion);
-<a name="l00759"></a>00759     }
-<a name="l00760"></a>00760 
-<a name="l00761"></a>00761 
-<a name="l00762"></a>00762     cpl_msg_indent_less();
-<a name="l00763"></a>00763     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);
-<a name="l00764"></a>00764     cpl_msg_indent_more();
-<a name="l00765"></a>00765 
-<a name="l00766"></a>00766     spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, rectified_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00767"></a>00767     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00768"></a>00768         fors_resample_exit(<span class="stringliteral">"Cannot load input spectral frame"</span>);
-<a name="l00769"></a>00769 
-<a name="l00770"></a>00770     idscoeff = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, disp_coeff_tag, 1);
-<a name="l00771"></a>00771     <span class="keywordflow">if</span> (idscoeff == NULL)
-<a name="l00772"></a>00772         fors_resample_exit(<span class="stringliteral">"Cannot load dispersion solution table"</span>);
-<a name="l00773"></a>00773 
-<a name="l00774"></a>00774     <span class="keywordflow">if</span> (lss || treat_as_lss) {
-<a name="l00775"></a>00775         <span class="keywordtype">int</span>        first_row, last_row, ylow, yhig, nx;
-<a name="l00776"></a>00776         cpl_image *dummy;
-<a name="l00777"></a>00777 
-<a name="l00778"></a>00778         slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l00779"></a>00779         <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00780"></a>00780             fors_resample_exit(<span class="stringliteral">"Cannot load slit location table"</span>);
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782         first_row = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, 0, NULL);
-<a name="l00783"></a>00783         last_row = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, 0, NULL);
-<a name="l00784"></a>00784 
-<a name="l00785"></a>00785         ylow = first_row + 1;
-<a name="l00786"></a>00786         yhig = last_row + 1;
-<a name="l00787"></a>00787 
-<a name="l00788"></a>00788         nx = cpl_image_get_size_x(spectra);
-<a name="l00789"></a>00789 
-<a name="l00790"></a>00790         dummy = cpl_image_extract(spectra, 1, ylow, nx, yhig);
-<a name="l00791"></a>00791         cpl_image_delete(spectra); spectra = dummy;
-<a name="l00792"></a>00792     }
-<a name="l00793"></a>00793 
-<a name="l00794"></a>00794     cpl_msg_indent_less();
-<a name="l00795"></a>00795     cpl_msg_info(recipe, <span class="stringliteral">"Spectral resampling..."</span>);
-<a name="l00796"></a>00796     cpl_msg_indent_more();
-<a name="l00797"></a>00797 
-<a name="l00798"></a>00798     mapped = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(spectra, reference,
-<a name="l00799"></a>00799                                         startwavelength, endwavelength,
-<a name="l00800"></a>00800                                         dispersion, idscoeff, flux);
-<a name="l00801"></a>00801 
-<a name="l00802"></a>00802     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l00803"></a>00803     cpl_image_delete(spectra); spectra = NULL;
-<a name="l00804"></a>00804 
-<a name="l00805"></a>00805     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l00806"></a>00806     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l00807"></a>00807     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l00808"></a>00808                                    startwavelength + dispersion/2);
-<a name="l00809"></a>00809     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l00810"></a>00810     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l00811"></a>00811 <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l00812"></a>00812     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l00813"></a>00813     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l00814"></a>00814     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l00815"></a>00815     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l00816"></a>00816     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l00817"></a>00817     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l00818"></a>00818 
-<a name="l00819"></a>00819     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped, mapped_tag,
-<a name="l00820"></a>00820                        header, parlist, recipe, version))
-<a name="l00821"></a>00821         fors_resample_exit(NULL);
-<a name="l00822"></a>00822 
-<a name="l00823"></a>00823     cpl_image_delete(mapped); mapped = NULL;
-<a name="l00824"></a>00824     cpl_propertylist_delete(header); header = NULL;
-<a name="l00825"></a>00825 
-<a name="l00826"></a>00826     <span class="keywordflow">return</span> 0;
-<a name="l00827"></a>00827 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__resample_8c_source.html b/html/fors__resample_8c_source.html
new file mode 100644
index 0000000..25adb69
--- /dev/null
+++ b/html/fors__resample_8c_source.html
@@ -0,0 +1,839 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_resample.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_resample.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_resample.c,v 1.11 2013-08-14 16:11:42 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-14 16:11:42 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.11 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_resample_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to resample at constant wavelength step spatially\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"rectified spectra. The input frames are produced using either the recipe\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"fors_extract_slits in the case of MOS/MXU multi slit exposures, or the\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"recipes fors_remove_bias and fors_flatfield in the case of LSS or long-slit\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"like MOS/MXU data. Only in case of LSS or LSS-like data the SLIT_LOCATION\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"table is required in input. Please refer to the FORS Pipeline User's Manual\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"for more details.\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"In the table below the MXU acronym can also be read as MOS and LSS, SCI\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"can be read as STD, and SCIENCE as STANDARD.\n\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"  LAMP_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"  or SCIENCE_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  or SCIENCE_UNFLAT_MXU\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  or RECTIFIED_LAMP_MXU\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  or RECTIFIED_ALL_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"  or RECTIFIED_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"  or RECTIFIED_SKY_SCI_MXU   Calib       Frame to resample       Y\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"  DISP_COEFF_MXU\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  or DISP_COEFF_SCI_MXU      Calib       Dispersion coefficients Y\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location table     Y\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  MAPPED_LAMP_MXU\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  or MAPPED_ALL_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"  or MAPPED_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"  or MAPPED_SKY_SCI_MXU      FITS image  Resampled spectra\n\n"</span>;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">#define fors_resample_exit(message)           \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">cpl_image_delete(mapped);                     \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">#define fors_resample_exit_memcheck(message)    \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">cpl_image_delete(spectra);                      \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">printf("free mapped (%p)\n", mapped);           \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">cpl_image_delete(mapped);                       \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">cpl_table_delete(grism_table);                  \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);       \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">cpl_table_delete(idscoeff);                     \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">cpl_table_delete(slits);                        \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> {</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                     <span class="stringliteral">"fors_resample"</span>,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                     <span class="stringliteral">"Resample input spectra at constant wavelength step"</span>,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                     fors_resample_description,</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                     fors_resample_create,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                     fors_resample_exec,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                     fors_resample_destroy);</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> }</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> {</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> </div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_resample.dispersion"</span>,</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                                 <span class="stringliteral">"fors.fors_resample"</span>,</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                                 0.0);</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_resample.startwavelength"</span>,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                                 <span class="stringliteral">"fors.fors_resample"</span>,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                 0.0);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_resample.endwavelength"</span>,</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                                 <span class="stringliteral">"fors.fors_resample"</span>,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                                 0.0);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> <span class="comment">     * Flux conservation</span></div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>  </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_resample.flux"</span>,</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>                                 <span class="stringliteral">"Apply flux conservation"</span>,</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                                 <span class="stringliteral">"fors.fors_resample"</span>,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                 TRUE);</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> </div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> }</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> {</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordflow">return</span> fors_resample(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> }</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> {</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> }</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_resample(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> {</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_resample"</span>;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> </div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordtype">int</span>         flux;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     cpl_image        *spectra     = NULL;</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     cpl_image        *mapped      = NULL;</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cpl_table        *maskslits   = NULL;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     cpl_table        *idscoeff    = NULL;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> </div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *rectified_tag;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_tag;</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="keywordtype">int</span>         nframes;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keywordtype">int</span>         treat_as_lss = 0;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordtype">int</span>         mxu, mos, lss;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keywordtype">int</span>         disp;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keywordtype">int</span>         dispsci;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordtype">int</span>         dispstd;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordtype">int</span>         sciall;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordtype">int</span>         stdall;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordtype">int</span>         scisky;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordtype">int</span>         stdsky;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     <span class="keywordtype">int</span>         sci;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordtype">int</span>         std;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="keywordtype">int</span>         lamp;</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> </div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>         fors_resample_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>                     <span class="stringliteral">"fors.fors_resample.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>         fors_resample_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>                     <span class="stringliteral">"fors.fors_resample.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>             fors_resample_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> </div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>                     <span class="stringliteral">"fors.fors_resample.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>             fors_resample_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>             fors_resample_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     }</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>             fors_resample_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     flux = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_resample.flux"</span>, NULL);</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>         fors_resample_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> </div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> </div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     mxu  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_MXU"</span>);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     mxu += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     mxu += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     mos  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_MOS"</span>);</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     mos += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     mos += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     lss  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_LSS"</span>);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     lss += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>);</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     lss += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> </div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     nframes = mos + mxu + lss;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         fors_resample_exit(<span class="stringliteral">"Missing dispersion coefficients table"</span>);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     }</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         cpl_msg_error(recipe, </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>                       <span class="stringliteral">"Too many input dispersion coefficients tables (%d > 1)"</span>,</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>                       nframes);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>         fors_resample_exit(NULL);</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     }</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> </div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     disp     = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_MXU"</span>);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     disp    += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_MOS"</span>);</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     disp    += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_LSS"</span>);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     dispsci  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     dispsci += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     dispsci += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     dispstd  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     dispstd += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     dispstd += cpl_frameset_count_tags(frameset, <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> </div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         <span class="keywordflow">if</span> (disp)</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dispsci)</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     }</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>         <span class="keywordflow">if</span> (disp)</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dispsci)</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     }</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>         <span class="keywordflow">if</span> (disp)</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_LSS"</span>;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dispsci)</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>             disp_coeff_tag = <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     }</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, disp_coeff_tag, 0);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         fors_resample_exit(<span class="stringliteral">"Cannot load dispersion coefficients table header"</span>);</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span> </div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     <span class="keywordflow">if</span> (mos || mxu) {</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         <span class="keywordtype">int</span> nslits_out_det = 0;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> </div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>             maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>             maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> </div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> <span class="comment">         * Check if all slits have the same X offset.</span></div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> </div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> </div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     }</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> </div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>             sciall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>);</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>             stdall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>             scisky = 0;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>             stdsky = 0;</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>             sci    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>             std    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>             lamp   = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>         }</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>             sciall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>             stdall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>);</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>             scisky = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>             stdsky = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_STD_MXU"</span>);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>             sci    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>             std    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_STD_MXU"</span>);</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>             lamp   = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_LAMP_MXU"</span>);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>         }</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     }</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>             sciall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>);</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>             stdall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>);</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>             scisky = 0;</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>             stdsky = 0;</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>             sci    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>             std    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>             lamp   = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>         }</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>             sciall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>             stdall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>);</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>             scisky = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>             stdsky = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SKY_STD_MOS"</span>);</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>             sci    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>             std    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_STD_MOS"</span>);</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>             lamp   = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_LAMP_MOS"</span>);</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>         }</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>     }</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>         sciall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>);</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>         stdall = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>);</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>         scisky = 0;</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>         stdsky = 0;</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>         sci    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>         std    = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>         lamp   = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     }</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> </div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     nframes = sciall + stdall + scisky + stdsky + sci + std + lamp;</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> </div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordflow">if</span> (nframes == 0)</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>         fors_resample_exit(<span class="stringliteral">"Missing input spectral frame"</span>);</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input spectral frames (%d > 1)"</span>, </div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>                       nframes);</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         fors_resample_exit(NULL);</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     }</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keywordflow">if</span> (sciall) {</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>                 rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>             }</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>                 rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>             }</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>         }</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>                 rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>             }</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>                 rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>             }</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>         }</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>             rectified_tag = <span class="stringliteral">"SCIENCE_UNFLAT_LSS"</span>;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>             mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>         }</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     }</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdall) {</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>                 rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>             }</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>                 rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MXU"</span>;</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>             }</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>         }</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>                 rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>;</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>             }</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>                 rectified_tag = <span class="stringliteral">"RECTIFIED_ALL_STD_MOS"</span>;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>             }</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>         }</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>             rectified_tag = <span class="stringliteral">"STANDARD_UNFLAT_LSS"</span>;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>             mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>;</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>         }</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     }</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (scisky) {</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>             mapped_tag    = <span class="stringliteral">"MAPPED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>         }</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>             mapped_tag    = <span class="stringliteral">"MAPPED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>         }</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     }</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (stdsky) {</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>             mapped_tag    = <span class="stringliteral">"MAPPED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>         }</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>             rectified_tag = <span class="stringliteral">"RECTIFIED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>             mapped_tag    = <span class="stringliteral">"MAPPED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         }</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     }</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sci) {</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>                 rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>             }</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>                 rectified_tag = <span class="stringliteral">"RECTIFIED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>             }</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>         }</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>                 rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>             }</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>                 rectified_tag = <span class="stringliteral">"RECTIFIED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>             }</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>         }</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>             rectified_tag = <span class="stringliteral">"SCIENCE_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>             mapped_tag    = <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>         }</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     }</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std) {</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>                 rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>             }</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>                 rectified_tag = <span class="stringliteral">"RECTIFIED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>             }</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>         }</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>                 rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>             }</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>                 rectified_tag = <span class="stringliteral">"RECTIFIED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>             }</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>         }</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>             rectified_tag = <span class="stringliteral">"STANDARD_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>             mapped_tag    = <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>         }</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     }</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp) {</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>                 rectified_tag = <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_LAMP_MXU"</span>;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>             }</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>                 rectified_tag = <span class="stringliteral">"RECTIFIED_LAMP_MXU"</span>;</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_LAMP_MXU"</span>;</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>             }</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>         }</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>                 rectified_tag = <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_LAMP_MOS"</span>;</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>             }</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>                 rectified_tag = <span class="stringliteral">"RECTIFIED_LAMP_MOS"</span>;</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>                 mapped_tag    = <span class="stringliteral">"MAPPED_LAMP_MOS"</span>;</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>             }</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>         }</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>             rectified_tag = <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>             mapped_tag    = <span class="stringliteral">"MAPPED_LAMP_LSS"</span>;</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>         }</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     }</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span> </div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, rectified_tag, 0);</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> </div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>         fors_resample_exit(<span class="stringliteral">"Cannot load spectral frame header"</span>);</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span> </div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> </div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>         fors_resample_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> </div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>         fors_resample_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> </div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>         fors_resample_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span> </div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> </div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> <span class="comment">     * dispersion direction from the reference frame</span></div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span> </div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>         fors_resample_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span></div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>                             <span class="stringliteral">"header"</span>);</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> </div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span> </div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span> </div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>         fors_resample_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span></div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>                             <span class="stringliteral">"in reference frame header"</span>);</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>         reference *= 10;</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> </div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in reference frame header"</span>,</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>                       reference);</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>         fors_resample_exit(NULL);</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     }</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span> </div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> </div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span> </div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>         fors_resample_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>                             <span class="stringliteral">"in reference frame header"</span>);</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span> </div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>                         dispersion);</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     }</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span> </div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span> </div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span> </div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>     spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, rectified_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>         fors_resample_exit(<span class="stringliteral">"Cannot load input spectral frame"</span>);</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span> </div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     idscoeff = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, disp_coeff_tag, 1);</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>     <span class="keywordflow">if</span> (idscoeff == NULL)</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>         fors_resample_exit(<span class="stringliteral">"Cannot load dispersion solution table"</span>);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span> </div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     <span class="keywordflow">if</span> (lss || treat_as_lss) {</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>         <span class="keywordtype">int</span>        first_row, last_row, ylow, yhig, nx;</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>         cpl_image *dummy;</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>         slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>         <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>             fors_resample_exit(<span class="stringliteral">"Cannot load slit location table"</span>);</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span> </div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>         first_row = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, 0, NULL);</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>         last_row = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, 0, NULL);</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> </div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>         ylow = first_row + 1;</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>         yhig = last_row + 1;</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> </div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>         nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> </div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>         dummy = cpl_image_extract(spectra, 1, ylow, nx, yhig);</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>         cpl_image_delete(spectra); spectra = dummy;</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     }</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span> </div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>     cpl_msg_info(recipe, <span class="stringliteral">"Spectral resampling..."</span>);</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span> </div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>     mapped = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(spectra, reference,</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>                                         startwavelength, endwavelength,</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>                                         dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span> </div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> </div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>                                    startwavelength + dispersion/2);</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span> <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span> </div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, mapped, mapped_tag,</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>                        header, parlist, recipe, version))</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>         fors_resample_exit(NULL);</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span> </div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>     cpl_image_delete(mapped); mapped = NULL;</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span> </div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__science_8c-source.html b/html/fors__science_8c-source.html
deleted file mode 100644
index 200b62a..0000000
--- a/html/fors__science_8c-source.html
+++ /dev/null
@@ -1,2299 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_science.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_science.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_science.c,v 1.39 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.39 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H </span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <string.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <moses.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_tools.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_create(cpl_plugin *);
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_exec(cpl_plugin *);
-<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_destroy(cpl_plugin *);
-<a name="l00044"></a>00044 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science(cpl_parameterlist *, cpl_frameset *);
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_science_description[] =
-<a name="l00048"></a>00048 <span class="stringliteral">"This recipe is used to reduce scientific spectra using the extraction\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"mask and the products created by the recipe fors_calib. The spectra are\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"bias subtracted, flat fielded (if a normalised flat field is specified)\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"and remapped eliminating the optical distortions. The wavelength calibration\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"can be optionally upgraded using a number of sky lines: if no sky lines\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"catalog of wavelengths is specified, an internal one is used instead.\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"If the alignment to the sky lines is performed, the input dispersion\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"coefficients table is upgraded and saved to disk, and a new CCD wavelengths\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"map is created.\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. A grism table (typically\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"depending on the instrument mode, and in particular on the grism used)\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"may also be specified: this table contains a default recipe parameter\n"</span> 
-<a name="l00060"></a>00060 <span class="stringliteral">"setting to control the way spectra are extracted for a specific instrument\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"mode, as it is used for automatic run of the pipeline on Paranal and in\n"</span> 
-<a name="l00062"></a>00062 <span class="stringliteral">"Garching. If this table is specified, it will modify the default recipe\n"</span> 
-<a name="l00063"></a>00063 <span class="stringliteral">"parameter setting, with the exception of those parameters which have been\n"</span> 
-<a name="l00064"></a>00064 <span class="stringliteral">"explicitly modifyed on the command line. If a grism table is not specified,\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"the input recipe parameters values will always be read from the command\n"</span> 
-<a name="l00066"></a>00066 <span class="stringliteral">"line, or from an esorex configuration file if present, or from their\n"</span> 
-<a name="l00067"></a>00067 <span class="stringliteral">"generic default values (that are rarely meaningful).\n"</span> 
-<a name="l00068"></a>00068 <span class="stringliteral">"In the table below the MXU acronym can be read alternatively as MOS\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"and LSS, depending on the instrument mode of the input data. The acronym\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"SCI on products should be read STD in case of standard stars observations\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"A CURV_COEFF table is not (yet) expected for LSS data.\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"Either a scientific or a standard star exposure can be specified in input.\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"Only in case of a standard star exposure input, the atmospheric extinction\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"table and a table with the physical fluxes of the observed standard star\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"must be specified in input, and a spectro-photometric table is created in\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"output. This table can then be input again to this recipe, always with an\n"</span>
-<a name="l00077"></a>00077 <span class="stringliteral">"atmospheric extinction table, and if a photometric calibration is requested\n"</span>
-<a name="l00078"></a>00078 <span class="stringliteral">"then flux calibrated spectra (in units of erg/cm/cm/s/Angstrom) are also\n"</span> 
-<a name="l00079"></a>00079 <span class="stringliteral">"written in output.\n\n"</span>
-<a name="l00080"></a>00080 
-<a name="l00081"></a>00081 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00082"></a>00082 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"  SCIENCE_MXU                Raw         Scientific exposure     Y\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"  or STANDARD_MXU            Raw         Standard star exposure  Y\n"</span>
-<a name="l00085"></a>00085 <span class="stringliteral">"  MASTER_BIAS                Calib       Master bias             Y\n"</span>
-<a name="l00086"></a>00086 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n"</span>
-<a name="l00087"></a>00087 <span class="stringliteral">"  MASTER_SKYLINECAT          Calib       Sky lines catalog       .\n"</span>
-<a name="l00088"></a>00088 <span class="stringliteral">"\n"</span>
-<a name="l00089"></a>00089 <span class="stringliteral">"  MASTER_NORM_FLAT_MXU       Calib       Normalised flat field   .\n"</span>
-<a name="l00090"></a>00090 <span class="stringliteral">"  DISP_COEFF_MXU             Calib       Inverse dispersion      Y\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      Y\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slits positions table   Y\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"  or, in case of LSS-like MOS/MXU data,\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"  MASTER_NORM_FLAT_LONG_MXU  Calib       Normalised flat field   .\n"</span>
-<a name="l00097"></a>00097 <span class="stringliteral">"  DISP_COEFF_LONG_MXU        Calib       Inverse dispersion      Y\n"</span>
-<a name="l00098"></a>00098 <span class="stringliteral">"\n"</span>
-<a name="l00099"></a>00099 <span class="stringliteral">"  In case STANDARD_MXU is specified in input,\n"</span>
-<a name="l00100"></a>00100 <span class="stringliteral">"\n"</span>
-<a name="l00101"></a>00101 <span class="stringliteral">"  EXTINCT_TABLE              Calib       Atmospheric extinction  Y\n"</span>
-<a name="l00102"></a>00102 <span class="stringliteral">"  STD_FLUX_TABLE             Calib       Standard star flux      Y\n"</span>
-<a name="l00103"></a>00103 <span class="stringliteral">"\n"</span>
-<a name="l00104"></a>00104 <span class="stringliteral">"  In case a photometric calibration is requested for scientific\n"</span>
-<a name="l00105"></a>00105 <span class="stringliteral">"  data, the following inputs are mandatory:\n"</span>
-<a name="l00106"></a>00106 <span class="stringliteral">"\n"</span>
-<a name="l00107"></a>00107 <span class="stringliteral">"  EXTINCT_TABLE              Calib       Atmospheric extinction  Y\n"</span>
-<a name="l00108"></a>00108 <span class="stringliteral">"  SPECPHOT_TABLE             Calib       Response curves         Y\n"</span>
-<a name="l00109"></a>00109 <span class="stringliteral">"\n"</span>
-<a name="l00110"></a>00110 <span class="stringliteral">"  If requested for standard star data, the SPECPHOT_TABLE can be dropped:\n"</span>
-<a name="l00111"></a>00111 <span class="stringliteral">"  in this case the correction is applied using the SPECPHOT_TABLE produced\n"</span>
-<a name="l00112"></a>00112 <span class="stringliteral">"  in the same run.\n"</span>
-<a name="l00113"></a>00113 <span class="stringliteral">"\n"</span>
-<a name="l00114"></a>00114 <span class="stringliteral">"Output files:\n"</span>
-<a name="l00115"></a>00115 <span class="stringliteral">"\n"</span>
-<a name="l00116"></a>00116 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00117"></a>00117 <span class="stringliteral">"  REDUCED_SCI_MXU            FITS image  Extracted scientific spectra\n"</span>
-<a name="l00118"></a>00118 <span class="stringliteral">"  REDUCED_SKY_SCI_MXU        FITS image  Extracted sky spectra\n"</span>
-<a name="l00119"></a>00119 <span class="stringliteral">"  REDUCED_ERROR_SCI_MXU      FITS image  Errors on extracted spectra\n"</span>
-<a name="l00120"></a>00120 <span class="stringliteral">"  UNMAPPED_SCI_MXU           FITS image  Sky subtracted scientific spectra\n"</span>
-<a name="l00121"></a>00121 <span class="stringliteral">"  MAPPED_SCI_MXU             FITS image  Rectified scientific spectra\n"</span>
-<a name="l00122"></a>00122 <span class="stringliteral">"  MAPPED_ALL_SCI_MXU         FITS image  Rectified science spectra with sky\n"</span>
-<a name="l00123"></a>00123 <span class="stringliteral">"  MAPPED_SKY_SCI_MXU         FITS image  Rectified sky spectra\n"</span>
-<a name="l00124"></a>00124 <span class="stringliteral">"  UNMAPPED_SKY_SCI_MXU       FITS image  Sky on CCD\n"</span>
-<a name="l00125"></a>00125 <span class="stringliteral">"  OBJECT_TABLE_SCI_MXU       FITS table  Positions of detected objects\n"</span>
-<a name="l00126"></a>00126 <span class="stringliteral">"\n"</span>
-<a name="l00127"></a>00127 <span class="stringliteral">"  Only if the global sky subtraction is requested:\n"</span>
-<a name="l00128"></a>00128 <span class="stringliteral">"  GLOBAL_SKY_SPECTRUM_MXU    FITS table  Global sky spectrum\n"</span>
-<a name="l00129"></a>00129 <span class="stringliteral">"\n"</span>
-<a name="l00130"></a>00130 <span class="stringliteral">"  Only if the sky-alignment of the wavelength solution is requested:\n"</span>
-<a name="l00131"></a>00131 <span class="stringliteral">"  SKY_SHIFTS_LONG_SCI_MXU    FITS table  Sky lines offsets (LSS-like data)\n"</span>
-<a name="l00132"></a>00132 <span class="stringliteral">"  or SKY_SHIFTS_SLIT_SCI_MXU FITS table  Sky lines offsets (MOS-like data)\n"</span>
-<a name="l00133"></a>00133 <span class="stringliteral">"  DISP_COEFF_SCI_MXU         FITS table  Upgraded dispersion coefficients\n"</span>
-<a name="l00134"></a>00134 <span class="stringliteral">"  WAVELENGTH_MAP_SCI_MXU     FITS image  Upgraded wavelength map\n"</span>
-<a name="l00135"></a>00135 <span class="stringliteral">"\n"</span>
-<a name="l00136"></a>00136 <span class="stringliteral">"  Only if a STANDARD_MXU is specified in input:\n"</span>
-<a name="l00137"></a>00137 <span class="stringliteral">"  SPECPHOT_TABLE             FITS table  Efficiency and response curves\n"</span>
-<a name="l00138"></a>00138 <span class="stringliteral">"\n"</span>
-<a name="l00139"></a>00139 <span class="stringliteral">"  Only if a photometric calibration was requested:\n"</span>
-<a name="l00140"></a>00140 <span class="stringliteral">"  REDUCED_FLUX_SCI_MXU       FITS image  Flux calibrated scientific spectra\n"</span>
-<a name="l00141"></a>00141 <span class="stringliteral">"  REDUCED_FLUX_ERROR_SCI_MXU FITS image  Errors on flux calibrated spectra\n"</span>
-<a name="l00142"></a>00142 <span class="stringliteral">"  MAPPED_FLUX_SCI_MXU        FITS image  Flux calibrated slit spectra\n\n"</span>;
-<a name="l00143"></a>00143 
-<a name="l00144"></a>00144 <span class="preprocessor">#define fors_science_exit(message)            \</span>
-<a name="l00145"></a>00145 <span class="preprocessor">{                                             \</span>
-<a name="l00146"></a>00146 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00147"></a>00147 <span class="preprocessor">cpl_free(exptime);                            \</span>
-<a name="l00148"></a>00148 <span class="preprocessor">cpl_free(instrume);                           \</span>
-<a name="l00149"></a>00149 <span class="preprocessor">cpl_image_delete(dummy);                      \</span>
-<a name="l00150"></a>00150 <span class="preprocessor">cpl_image_delete(mapped);                     \</span>
-<a name="l00151"></a>00151 <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span>
-<a name="l00152"></a>00152 <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span>
-<a name="l00153"></a>00153 <span class="preprocessor">cpl_image_delete(skylocalmap);                \</span>
-<a name="l00154"></a>00154 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00155"></a>00155 <span class="preprocessor">cpl_image_delete(smapped);                    \</span>
-<a name="l00156"></a>00156 <span class="preprocessor">cpl_table_delete(offsets);                    \</span>
-<a name="l00157"></a>00157 <span class="preprocessor">cpl_table_delete(photcal);                    \</span>
-<a name="l00158"></a>00158 <span class="preprocessor">cpl_table_delete(sky);                        \</span>
-<a name="l00159"></a>00159 <span class="preprocessor">cpl_image_delete(bias);                       \</span>
-<a name="l00160"></a>00160 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00161"></a>00161 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00162"></a>00162 <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span>
-<a name="l00163"></a>00163 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00164"></a>00164 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00165"></a>00165 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00166"></a>00166 <span class="preprocessor">cpl_image_delete(wavemaplss);                 \</span>
-<a name="l00167"></a>00167 <span class="preprocessor">cpl_propertylist_delete(qclist);              \</span>
-<a name="l00168"></a>00168 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00169"></a>00169 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00170"></a>00170 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00171"></a>00171 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00172"></a>00172 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00173"></a>00173 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00174"></a>00174 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00175"></a>00175 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00176"></a>00176 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00177"></a>00177 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00178"></a>00178 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00179"></a>00179 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00180"></a>00180 <span class="preprocessor">}</span>
-<a name="l00181"></a>00181 <span class="preprocessor"></span>
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183 <span class="preprocessor">#define fors_science_exit_memcheck(message)   \</span>
-<a name="l00184"></a>00184 <span class="preprocessor">{                                             \</span>
-<a name="l00185"></a>00185 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span>
-<a name="l00186"></a>00186 <span class="preprocessor">cpl_free(exptime);                            \</span>
-<a name="l00187"></a>00187 <span class="preprocessor">cpl_free(instrume);                           \</span>
-<a name="l00188"></a>00188 <span class="preprocessor">cpl_image_delete(dummy);                      \</span>
-<a name="l00189"></a>00189 <span class="preprocessor">cpl_image_delete(mapped);                     \</span>
-<a name="l00190"></a>00190 <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span>
-<a name="l00191"></a>00191 <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span>
-<a name="l00192"></a>00192 <span class="preprocessor">cpl_image_delete(skylocalmap);                \</span>
-<a name="l00193"></a>00193 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00194"></a>00194 <span class="preprocessor">cpl_image_delete(smapped);                    \</span>
-<a name="l00195"></a>00195 <span class="preprocessor">cpl_table_delete(offsets);                    \</span>
-<a name="l00196"></a>00196 <span class="preprocessor">cpl_table_delete(photcal);                    \</span>
-<a name="l00197"></a>00197 <span class="preprocessor">cpl_table_delete(sky);                        \</span>
-<a name="l00198"></a>00198 <span class="preprocessor">cpl_image_delete(bias);                       \</span>
-<a name="l00199"></a>00199 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00200"></a>00200 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00201"></a>00201 <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span>
-<a name="l00202"></a>00202 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00203"></a>00203 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00204"></a>00204 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00205"></a>00205 <span class="preprocessor">cpl_image_delete(wavemaplss);                 \</span>
-<a name="l00206"></a>00206 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00207"></a>00207 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00208"></a>00208 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00209"></a>00209 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00210"></a>00210 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00211"></a>00211 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00212"></a>00212 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00213"></a>00213 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00214"></a>00214 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00215"></a>00215 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00216"></a>00216 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00217"></a>00217 <span class="preprocessor">return 0;                                     \</span>
-<a name="l00218"></a>00218 <span class="preprocessor">}</span>
-<a name="l00219"></a>00219 <span class="preprocessor"></span>
-<a name="l00220"></a>00220 
-<a name="l00232"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00232</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00233"></a>00233 {
-<a name="l00234"></a>00234     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00235"></a>00235     cpl_plugin *plugin = &recipe->interface;
-<a name="l00236"></a>00236 
-<a name="l00237"></a>00237     cpl_plugin_init(plugin,
-<a name="l00238"></a>00238                     CPL_PLUGIN_API,
-<a name="l00239"></a>00239                     FORS_BINARY_VERSION,
-<a name="l00240"></a>00240                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00241"></a>00241                     <span class="stringliteral">"fors_science"</span>,
-<a name="l00242"></a>00242                     <span class="stringliteral">"Extraction of scientific spectra"</span>,
-<a name="l00243"></a>00243                     fors_science_description,
-<a name="l00244"></a>00244                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00245"></a>00245                     PACKAGE_BUGREPORT,
-<a name="l00246"></a>00246                     <a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a>(),
-<a name="l00247"></a>00247                     fors_science_create,
-<a name="l00248"></a>00248                     fors_science_exec,
-<a name="l00249"></a>00249                     fors_science_destroy);
-<a name="l00250"></a>00250 
-<a name="l00251"></a>00251     cpl_pluginlist_append(list, plugin);
-<a name="l00252"></a>00252     
-<a name="l00253"></a>00253     <span class="keywordflow">return</span> 0;
-<a name="l00254"></a>00254 }
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256 
-<a name="l00267"></a>00267 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_create(cpl_plugin *plugin)
-<a name="l00268"></a>00268 {
-<a name="l00269"></a>00269     cpl_recipe    *recipe;
-<a name="l00270"></a>00270     cpl_parameter *p;
-<a name="l00271"></a>00271 
-<a name="l00272"></a>00272 
-<a name="l00273"></a>00273     <span class="comment">/* </span>
-<a name="l00274"></a>00274 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00275"></a>00275 <span class="comment">     */</span>
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00278"></a>00278         recipe = (cpl_recipe *)plugin;
-<a name="l00279"></a>00279     <span class="keywordflow">else</span> 
-<a name="l00280"></a>00280         <span class="keywordflow">return</span> -1;
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282     <span class="comment">/* </span>
-<a name="l00283"></a>00283 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00284"></a>00284 <span class="comment">     */</span>
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288 
-<a name="l00289"></a>00289     <span class="comment">/*</span>
-<a name="l00290"></a>00290 <span class="comment">     * Dispersion</span>
-<a name="l00291"></a>00291 <span class="comment">     */</span>
-<a name="l00292"></a>00292 
-<a name="l00293"></a>00293     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.dispersion"</span>,
-<a name="l00294"></a>00294                                 CPL_TYPE_DOUBLE,
-<a name="l00295"></a>00295                                 <span class="stringliteral">"Resampling step (Angstrom/pixel)"</span>,
-<a name="l00296"></a>00296                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00297"></a>00297                                 0.0);
-<a name="l00298"></a>00298     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00299"></a>00299     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00300"></a>00300     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302     <span class="comment">/*</span>
-<a name="l00303"></a>00303 <span class="comment">     * Sky lines alignment</span>
-<a name="l00304"></a>00304 <span class="comment">     */</span>
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.skyalign"</span>,
-<a name="l00307"></a>00307                                 CPL_TYPE_INT,
-<a name="l00308"></a>00308                                 <span class="stringliteral">"Polynomial order for sky lines alignment, "</span>
-<a name="l00309"></a>00309                                 <span class="stringliteral">"or -1 to avoid alignment"</span>,
-<a name="l00310"></a>00310                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00311"></a>00311                                 0);
-<a name="l00312"></a>00312     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);
-<a name="l00313"></a>00313     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00314"></a>00314     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     <span class="comment">/*</span>
-<a name="l00317"></a>00317 <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span>
-<a name="l00318"></a>00318 <span class="comment">     */</span>
-<a name="l00319"></a>00319 
-<a name="l00320"></a>00320     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.wcolumn"</span>,
-<a name="l00321"></a>00321                                 CPL_TYPE_STRING,
-<a name="l00322"></a>00322                                 <span class="stringliteral">"Name of sky line catalog table column "</span>
-<a name="l00323"></a>00323                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00324"></a>00324                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00325"></a>00325                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00326"></a>00326     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00327"></a>00327     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00328"></a>00328     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00329"></a>00329 
-<a name="l00330"></a>00330     <span class="comment">/*</span>
-<a name="l00331"></a>00331 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00332"></a>00332 <span class="comment">     */</span>
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.startwavelength"</span>,
-<a name="l00335"></a>00335                                 CPL_TYPE_DOUBLE,
-<a name="l00336"></a>00336                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00337"></a>00337                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00338"></a>00338                                 0.0);
-<a name="l00339"></a>00339     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00340"></a>00340     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00341"></a>00341     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343     <span class="comment">/*</span>
-<a name="l00344"></a>00344 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00345"></a>00345 <span class="comment">     */</span>
-<a name="l00346"></a>00346 
-<a name="l00347"></a>00347     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.endwavelength"</span>,
-<a name="l00348"></a>00348                                 CPL_TYPE_DOUBLE,
-<a name="l00349"></a>00349                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00350"></a>00350                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00351"></a>00351                                 0.0);
-<a name="l00352"></a>00352     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00353"></a>00353     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00354"></a>00354     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356     <span class="comment">/*</span>
-<a name="l00357"></a>00357 <span class="comment">     * Flux conservation</span>
-<a name="l00358"></a>00358 <span class="comment">     */</span>
-<a name="l00359"></a>00359 
-<a name="l00360"></a>00360     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.flux"</span>,
-<a name="l00361"></a>00361                                 CPL_TYPE_BOOL,
-<a name="l00362"></a>00362                                 <span class="stringliteral">"Apply flux conservation"</span>,
-<a name="l00363"></a>00363                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00364"></a>00364                                 TRUE);
-<a name="l00365"></a>00365     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);
-<a name="l00366"></a>00366     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00367"></a>00367     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369     <span class="comment">/*</span>
-<a name="l00370"></a>00370 <span class="comment">     * Apply flat field</span>
-<a name="l00371"></a>00371 <span class="comment">     */</span>
-<a name="l00372"></a>00372 
-<a name="l00373"></a>00373     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.flatfield"</span>,
-<a name="l00374"></a>00374                                 CPL_TYPE_BOOL,
-<a name="l00375"></a>00375                                 <span class="stringliteral">"Apply flat field"</span>,
-<a name="l00376"></a>00376                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00377"></a>00377                                 TRUE);
-<a name="l00378"></a>00378     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flatfield"</span>);
-<a name="l00379"></a>00379     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00380"></a>00380     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00381"></a>00381 
-<a name="l00382"></a>00382     <span class="comment">/*</span>
-<a name="l00383"></a>00383 <span class="comment">     * Global sky subtraction</span>
-<a name="l00384"></a>00384 <span class="comment">     */</span>
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.skyglobal"</span>,
-<a name="l00387"></a>00387                                 CPL_TYPE_BOOL,
-<a name="l00388"></a>00388                                 <span class="stringliteral">"Subtract global sky spectrum from CCD"</span>,
-<a name="l00389"></a>00389                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00390"></a>00390                                 FALSE);
-<a name="l00391"></a>00391     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyglobal"</span>);
-<a name="l00392"></a>00392     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00393"></a>00393     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395     <span class="comment">/*</span>
-<a name="l00396"></a>00396 <span class="comment">     * Local sky subtraction on extracted spectra</span>
-<a name="l00397"></a>00397 <span class="comment">     */</span>
-<a name="l00398"></a>00398 
-<a name="l00399"></a>00399 <span class="comment">/*** New sky subtraction (search NSS)</span>
-<a name="l00400"></a>00400 <span class="comment">    p = cpl_parameter_new_value("fors.fors_science.skymedian",</span>
-<a name="l00401"></a>00401 <span class="comment">                                CPL_TYPE_INT,</span>
-<a name="l00402"></a>00402 <span class="comment">                                "Degree of sky fitting polynomial for "</span>
-<a name="l00403"></a>00403 <span class="comment">                                "sky subtraction from extracted "</span>
-<a name="l00404"></a>00404 <span class="comment">                                "slit spectra (MOS/MXU only, -1 to disable it)",</span>
-<a name="l00405"></a>00405 <span class="comment">                                "fors.fors_science",</span>
-<a name="l00406"></a>00406 <span class="comment">                                0);</span>
-<a name="l00407"></a>00407 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "skymedian");</span>
-<a name="l00408"></a>00408 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00409"></a>00409 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00410"></a>00410 <span class="comment">***/</span>
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.skymedian"</span>,
-<a name="l00413"></a>00413                                 CPL_TYPE_BOOL,
-<a name="l00414"></a>00414                                 <span class="stringliteral">"Sky subtraction from extracted slit spectra"</span>,
-<a name="l00415"></a>00415                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00416"></a>00416                                 FALSE);
-<a name="l00417"></a>00417     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skymedian"</span>);
-<a name="l00418"></a>00418     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00419"></a>00419     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00420"></a>00420 
-<a name="l00421"></a>00421     <span class="comment">/*</span>
-<a name="l00422"></a>00422 <span class="comment">     * Local sky subtraction on CCD spectra</span>
-<a name="l00423"></a>00423 <span class="comment">     */</span>
-<a name="l00424"></a>00424 
-<a name="l00425"></a>00425     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.skylocal"</span>,
-<a name="l00426"></a>00426                                 CPL_TYPE_BOOL,
-<a name="l00427"></a>00427                                 <span class="stringliteral">"Sky subtraction from CCD slit spectra"</span>,
-<a name="l00428"></a>00428                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00429"></a>00429                                 TRUE);
-<a name="l00430"></a>00430     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skylocal"</span>);
-<a name="l00431"></a>00431     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00432"></a>00432     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00433"></a>00433 
-<a name="l00434"></a>00434     <span class="comment">/*</span>
-<a name="l00435"></a>00435 <span class="comment">     * Cosmic rays removal</span>
-<a name="l00436"></a>00436 <span class="comment">     */</span>
-<a name="l00437"></a>00437 
-<a name="l00438"></a>00438     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.cosmics"</span>,
-<a name="l00439"></a>00439                                 CPL_TYPE_BOOL,
-<a name="l00440"></a>00440                                 <span class="stringliteral">"Eliminate cosmic rays hits (only if global "</span>
-<a name="l00441"></a>00441                                 <span class="stringliteral">"sky subtraction is also requested)"</span>,
-<a name="l00442"></a>00442                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00443"></a>00443                                 FALSE);
-<a name="l00444"></a>00444     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);
-<a name="l00445"></a>00445     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00446"></a>00446     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00447"></a>00447 
-<a name="l00448"></a>00448     <span class="comment">/*</span>
-<a name="l00449"></a>00449 <span class="comment">     * Slit margin</span>
-<a name="l00450"></a>00450 <span class="comment">     */</span>
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.slit_margin"</span>,
-<a name="l00453"></a>00453                                 CPL_TYPE_INT,
-<a name="l00454"></a>00454                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span>
-<a name="l00455"></a>00455                                 <span class="stringliteral">"in object detection and extraction"</span>,
-<a name="l00456"></a>00456                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00457"></a>00457                                 3);
-<a name="l00458"></a>00458     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);
-<a name="l00459"></a>00459     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00460"></a>00460     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     <span class="comment">/*</span>
-<a name="l00463"></a>00463 <span class="comment">     * Extraction radius</span>
-<a name="l00464"></a>00464 <span class="comment">     */</span>
-<a name="l00465"></a>00465 
-<a name="l00466"></a>00466     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.ext_radius"</span>,
-<a name="l00467"></a>00467                                 CPL_TYPE_INT,
-<a name="l00468"></a>00468                                 <span class="stringliteral">"Maximum extraction radius for detected "</span>
-<a name="l00469"></a>00469                                 <span class="stringliteral">"objects (pixel)"</span>,
-<a name="l00470"></a>00470                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00471"></a>00471                                 12);
-<a name="l00472"></a>00472     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);
-<a name="l00473"></a>00473     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00474"></a>00474     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476     <span class="comment">/*</span>
-<a name="l00477"></a>00477 <span class="comment">     * Contamination radius</span>
-<a name="l00478"></a>00478 <span class="comment">     */</span>
-<a name="l00479"></a>00479 
-<a name="l00480"></a>00480     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.cont_radius"</span>,
-<a name="l00481"></a>00481                                 CPL_TYPE_INT,
-<a name="l00482"></a>00482                                 <span class="stringliteral">"Minimum distance at which two objects "</span>
-<a name="l00483"></a>00483                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span>
-<a name="l00484"></a>00484                                 <span class="stringliteral">"each other (pixel)"</span>,
-<a name="l00485"></a>00485                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00486"></a>00486                                 0);
-<a name="l00487"></a>00487     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);
-<a name="l00488"></a>00488     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00489"></a>00489     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00490"></a>00490 
-<a name="l00491"></a>00491     <span class="comment">/*</span>
-<a name="l00492"></a>00492 <span class="comment">     * Object extraction method</span>
-<a name="l00493"></a>00493 <span class="comment">     */</span>
-<a name="l00494"></a>00494 
-<a name="l00495"></a>00495     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.ext_mode"</span>,
-<a name="l00496"></a>00496                                 CPL_TYPE_INT,
-<a name="l00497"></a>00497                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span>
-<a name="l00498"></a>00498                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,
-<a name="l00499"></a>00499                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00500"></a>00500                                 1);
-<a name="l00501"></a>00501     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);
-<a name="l00502"></a>00502     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00503"></a>00503     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00504"></a>00504 
-<a name="l00505"></a>00505     <span class="comment">/*</span>
-<a name="l00506"></a>00506 <span class="comment">     * Normalise output by exposure time</span>
-<a name="l00507"></a>00507 <span class="comment">     */</span>
-<a name="l00508"></a>00508 
-<a name="l00509"></a>00509     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.time_normalise"</span>,
-<a name="l00510"></a>00510                                 CPL_TYPE_BOOL,
-<a name="l00511"></a>00511                                 <span class="stringliteral">"Normalise output spectra by the exposure time"</span>,
-<a name="l00512"></a>00512                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00513"></a>00513                                 TRUE);
-<a name="l00514"></a>00514     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"time_normalise"</span>);
-<a name="l00515"></a>00515     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00516"></a>00516     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00517"></a>00517 
-<a name="l00518"></a>00518     <span class="comment">/*</span>
-<a name="l00519"></a>00519 <span class="comment">     * Order of polynomial modeling the instrument response.</span>
-<a name="l00520"></a>00520 <span class="comment">     */</span>
-<a name="l00521"></a>00521 
-<a name="l00522"></a>00522     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.response"</span>,
-<a name="l00523"></a>00523                                 CPL_TYPE_INT,
-<a name="l00524"></a>00524                                 <span class="stringliteral">"Order of polynomial modeling the "</span>
-<a name="l00525"></a>00525                                 <span class="stringliteral">"instrument response"</span>,
-<a name="l00526"></a>00526                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00527"></a>00527                                 5);
-<a name="l00528"></a>00528     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"response"</span>);
-<a name="l00529"></a>00529     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00530"></a>00530     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00531"></a>00531 
-<a name="l00532"></a>00532     <span class="comment">/*</span>
-<a name="l00533"></a>00533 <span class="comment">     * Order of polynomial modeling the instrument response.</span>
-<a name="l00534"></a>00534 <span class="comment">     */</span>
-<a name="l00535"></a>00535 
-<a name="l00536"></a>00536     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.photometry"</span>,
-<a name="l00537"></a>00537                                 CPL_TYPE_BOOL,
-<a name="l00538"></a>00538                                 <span class="stringliteral">"Apply spectrophotometric calibration"</span>,
-<a name="l00539"></a>00539                                 <span class="stringliteral">"fors.fors_science"</span>,
-<a name="l00540"></a>00540                                 FALSE);
-<a name="l00541"></a>00541     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"photometry"</span>);
-<a name="l00542"></a>00542     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00543"></a>00543     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00544"></a>00544 
-<a name="l00545"></a>00545     <span class="keywordflow">return</span> 0;
-<a name="l00546"></a>00546 }
-<a name="l00547"></a>00547 
-<a name="l00548"></a>00548 
-<a name="l00557"></a>00557 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_exec(cpl_plugin *plugin)
-<a name="l00558"></a>00558 {
-<a name="l00559"></a>00559     cpl_recipe *recipe;
-<a name="l00560"></a>00560     
-<a name="l00561"></a>00561     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00562"></a>00562         recipe = (cpl_recipe *)plugin;
-<a name="l00563"></a>00563     <span class="keywordflow">else</span> 
-<a name="l00564"></a>00564         <span class="keywordflow">return</span> -1;
-<a name="l00565"></a>00565 
-<a name="l00566"></a>00566     <span class="keywordflow">return</span> fors_science(recipe->parameters, recipe->frames);
-<a name="l00567"></a>00567 }
-<a name="l00568"></a>00568 
-<a name="l00569"></a>00569 
-<a name="l00578"></a>00578 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_destroy(cpl_plugin *plugin)
-<a name="l00579"></a>00579 {
-<a name="l00580"></a>00580     cpl_recipe *recipe;
-<a name="l00581"></a>00581     
-<a name="l00582"></a>00582     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00583"></a>00583         recipe = (cpl_recipe *)plugin;
-<a name="l00584"></a>00584     <span class="keywordflow">else</span> 
-<a name="l00585"></a>00585         <span class="keywordflow">return</span> -1;
-<a name="l00586"></a>00586 
-<a name="l00587"></a>00587     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00588"></a>00588 
-<a name="l00589"></a>00589     <span class="keywordflow">return</span> 0;
-<a name="l00590"></a>00590 }
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592 
-<a name="l00602"></a>00602 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00603"></a>00603 {
-<a name="l00604"></a>00604 
-<a name="l00605"></a>00605     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_science"</span>;
-<a name="l00606"></a>00606 
-<a name="l00607"></a>00607 
-<a name="l00608"></a>00608     <span class="comment">/*</span>
-<a name="l00609"></a>00609 <span class="comment">     * Input parameters</span>
-<a name="l00610"></a>00610 <span class="comment">     */</span>
-<a name="l00611"></a>00611 
-<a name="l00612"></a>00612     <span class="keywordtype">double</span>      dispersion;
-<a name="l00613"></a>00613     <span class="keywordtype">int</span>         skyalign;
-<a name="l00614"></a>00614     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00615"></a>00615     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00616"></a>00616     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00617"></a>00617     <span class="keywordtype">int</span>         flux;
-<a name="l00618"></a>00618     <span class="keywordtype">int</span>         flatfield;
-<a name="l00619"></a>00619     <span class="keywordtype">int</span>         skyglobal;
-<a name="l00620"></a>00620     <span class="keywordtype">int</span>         skylocal;
-<a name="l00621"></a>00621     <span class="keywordtype">int</span>         skymedian;
-<a name="l00622"></a>00622     <span class="keywordtype">int</span>         cosmics;
-<a name="l00623"></a>00623     <span class="keywordtype">int</span>         slit_margin;
-<a name="l00624"></a>00624     <span class="keywordtype">int</span>         ext_radius;
-<a name="l00625"></a>00625     <span class="keywordtype">int</span>         cont_radius;
-<a name="l00626"></a>00626     <span class="keywordtype">int</span>         ext_mode;
-<a name="l00627"></a>00627     <span class="keywordtype">int</span>         time_normalise;
-<a name="l00628"></a>00628     <span class="keywordtype">int</span>         res_order;
-<a name="l00629"></a>00629     <span class="keywordtype">int</span>         photometry;
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631 
-<a name="l00632"></a>00632     <span class="comment">/*</span>
-<a name="l00633"></a>00633 <span class="comment">     * CPL objects</span>
-<a name="l00634"></a>00634 <span class="comment">     */</span>
-<a name="l00635"></a>00635 
-<a name="l00636"></a>00636     cpl_imagelist    *all_science;
-<a name="l00637"></a>00637     cpl_image       **images;
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639     cpl_image        *bias           = NULL;
-<a name="l00640"></a>00640     cpl_image        *norm_flat      = NULL;
-<a name="l00641"></a>00641     cpl_image        *spectra        = NULL;
-<a name="l00642"></a>00642     cpl_image        *rectified      = NULL;
-<a name="l00643"></a>00643     cpl_image        *coordinate     = NULL;
-<a name="l00644"></a>00644     cpl_image        *rainbow        = NULL;
-<a name="l00645"></a>00645     cpl_image        *mapped         = NULL;
-<a name="l00646"></a>00646     cpl_image        *mapped_sky     = NULL;
-<a name="l00647"></a>00647     cpl_image        *mapped_cleaned = NULL;
-<a name="l00648"></a>00648     cpl_image        *smapped        = NULL;
-<a name="l00649"></a>00649     cpl_image        *wavemap        = NULL;
-<a name="l00650"></a>00650     cpl_image        *wavemaplss     = NULL;
-<a name="l00651"></a>00651     cpl_image        *skymap         = NULL;
-<a name="l00652"></a>00652     cpl_image        *skylocalmap    = NULL;
-<a name="l00653"></a>00653     cpl_image        *dummy          = NULL;
-<a name="l00654"></a>00654 
-<a name="l00655"></a>00655     cpl_table        *grism_table    = NULL;
-<a name="l00656"></a>00656     cpl_table        *overscans      = NULL;
-<a name="l00657"></a>00657     cpl_table        *wavelengths    = NULL;
-<a name="l00658"></a>00658     cpl_table        *idscoeff       = NULL;
-<a name="l00659"></a>00659     cpl_table        *slits          = NULL;
-<a name="l00660"></a>00660     cpl_table        *maskslits      = NULL;
-<a name="l00661"></a>00661     cpl_table        *polytraces     = NULL;
-<a name="l00662"></a>00662     cpl_table        *offsets        = NULL;
-<a name="l00663"></a>00663     cpl_table        *sky            = NULL;
-<a name="l00664"></a>00664     cpl_table        *photcal        = NULL;
-<a name="l00665"></a>00665 
-<a name="l00666"></a>00666     cpl_vector       *lines          = NULL;
-<a name="l00667"></a>00667 
-<a name="l00668"></a>00668     cpl_propertylist *header         = NULL;
-<a name="l00669"></a>00669     cpl_propertylist *save_header    = NULL;
-<a name="l00670"></a>00670     cpl_propertylist *qclist         = NULL;
-<a name="l00671"></a>00671 
-<a name="l00672"></a>00672 
-<a name="l00673"></a>00673     <span class="comment">/*</span>
-<a name="l00674"></a>00674 <span class="comment">     * Auxiliary variables</span>
-<a name="l00675"></a>00675 <span class="comment">     */</span>
-<a name="l00676"></a>00676 
-<a name="l00677"></a>00677     <span class="keywordtype">char</span>        version[80];
-<a name="l00678"></a>00678     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00679"></a>00679     <span class="keywordtype">char</span>       *wheel4;
-<a name="l00680"></a>00680     <span class="keyword">const</span> <span class="keywordtype">char</span> *science_tag = NULL;
-<a name="l00681"></a>00681     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_norm_flat_tag = NULL;
-<a name="l00682"></a>00682     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag = NULL;
-<a name="l00683"></a>00683     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_sky_tag = NULL;
-<a name="l00684"></a>00684     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_sky_tag = NULL;
-<a name="l00685"></a>00685     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag = NULL;
-<a name="l00686"></a>00686     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag = NULL;
-<a name="l00687"></a>00687     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_science_tag = NULL;
-<a name="l00688"></a>00688     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_flux_science_tag = NULL;
-<a name="l00689"></a>00689     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_sky_tag = NULL;
-<a name="l00690"></a>00690     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_error_tag = NULL;
-<a name="l00691"></a>00691     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_flux_error_tag = NULL;
-<a name="l00692"></a>00692     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_tag = NULL;
-<a name="l00693"></a>00693     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_flux_science_tag = NULL;
-<a name="l00694"></a>00694     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_science_tag = NULL;
-<a name="l00695"></a>00695     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_sky_tag = NULL;
-<a name="l00696"></a>00696     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_sky_tag = NULL;
-<a name="l00697"></a>00697     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_sky_tag = NULL;
-<a name="l00698"></a>00698     <span class="keyword">const</span> <span class="keywordtype">char</span> *global_sky_spectrum_tag = NULL;
-<a name="l00699"></a>00699     <span class="keyword">const</span> <span class="keywordtype">char</span> *object_table_tag = NULL;
-<a name="l00700"></a>00700     <span class="keyword">const</span> <span class="keywordtype">char</span> *skylines_offsets_tag = NULL;
-<a name="l00701"></a>00701     <span class="keyword">const</span> <span class="keywordtype">char</span> *specphot_tag;
-<a name="l00702"></a>00702     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_specphot_tag = <span class="stringliteral">"MASTER_SPECPHOT_TABLE"</span>;
-<a name="l00703"></a>00703     <span class="keywordtype">int</span>         mxu, mos, lss;
-<a name="l00704"></a>00704     <span class="keywordtype">int</span>         treat_as_lss = 0;
-<a name="l00705"></a>00705     <span class="keywordtype">int</span>         have_phot = 0;
-<a name="l00706"></a>00706     <span class="keywordtype">int</span>         nscience;
-<a name="l00707"></a>00707     <span class="keywordtype">double</span>     *exptime = NULL;
-<a name="l00708"></a>00708     <span class="keywordtype">double</span>      alltime;
-<a name="l00709"></a>00709     <span class="keywordtype">double</span>      airmass = -1;
-<a name="l00710"></a>00710     <span class="keywordtype">double</span>      mxpos;
-<a name="l00711"></a>00711     <span class="keywordtype">double</span>      mean_rms;
-<a name="l00712"></a>00712     <span class="keywordtype">int</span>         nlines;
-<a name="l00713"></a>00713     <span class="keywordtype">int</span>         rebin;
-<a name="l00714"></a>00714     <span class="keywordtype">double</span>     *line;
-<a name="l00715"></a>00715     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00716"></a>00716     <span class="keywordtype">int</span>         ccd_xsize, ccd_ysize;
-<a name="l00717"></a>00717     <span class="keywordtype">double</span>      reference;
-<a name="l00718"></a>00718     <span class="keywordtype">double</span>      gain;
-<a name="l00719"></a>00719     <span class="keywordtype">double</span>      <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>;
-<a name="l00720"></a>00720     <span class="keywordtype">int</span>         standard;
-<a name="l00721"></a>00721     <span class="keywordtype">int</span>         highres;
-<a name="l00722"></a>00722     <span class="keywordtype">int</span>         i;
-<a name="l00723"></a>00723     <span class="keywordtype">double</span>      wstart;
-<a name="l00724"></a>00724     <span class="keywordtype">double</span>      wstep;
-<a name="l00725"></a>00725     <span class="keywordtype">int</span>         wcount;
-<a name="l00726"></a>00726 
-<a name="l00727"></a>00727 
-<a name="l00728"></a>00728     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00729"></a>00729 
-<a name="l00730"></a>00730     cpl_msg_set_indentation(2);
-<a name="l00731"></a>00731 
-<a name="l00732"></a>00732 
-<a name="l00733"></a>00733     <span class="comment">/* </span>
-<a name="l00734"></a>00734 <span class="comment">     * Get configuration parameters</span>
-<a name="l00735"></a>00735 <span class="comment">     */</span>
-<a name="l00736"></a>00736 
-<a name="l00737"></a>00737     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00738"></a>00738     cpl_msg_indent_more();
-<a name="l00739"></a>00739 
-<a name="l00740"></a>00740     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00741"></a>00741         fors_science_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);
-<a name="l00742"></a>00742 
-<a name="l00743"></a>00743     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00744"></a>00744 
-<a name="l00745"></a>00745     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00746"></a>00746                     <span class="stringliteral">"fors.fors_science.dispersion"</span>, grism_table);
-<a name="l00747"></a>00747 
-<a name="l00748"></a>00748     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00749"></a>00749         fors_science_exit(<span class="stringliteral">"Invalid resampling step"</span>);
-<a name="l00750"></a>00750 
-<a name="l00751"></a>00751     skyalign = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00752"></a>00752                     <span class="stringliteral">"fors.fors_science.skyalign"</span>, NULL);
-<a name="l00753"></a>00753 
-<a name="l00754"></a>00754     <span class="keywordflow">if</span> (skyalign > 2)
-<a name="l00755"></a>00755         fors_science_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);
-<a name="l00756"></a>00756 
-<a name="l00757"></a>00757     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00758"></a>00758                     <span class="stringliteral">"fors.fors_science.wcolumn"</span>, NULL);
-<a name="l00759"></a>00759 
-<a name="l00760"></a>00760     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00761"></a>00761                     <span class="stringliteral">"fors.fors_science.startwavelength"</span>, grism_table);
-<a name="l00762"></a>00762     <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00763"></a>00763         fors_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00764"></a>00764 
-<a name="l00765"></a>00765     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00766"></a>00766                     <span class="stringliteral">"fors.fors_science.endwavelength"</span>, grism_table);
-<a name="l00767"></a>00767     <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00768"></a>00768         fors_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00769"></a>00769 
-<a name="l00770"></a>00770     <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00771"></a>00771         fors_science_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00772"></a>00772 
-<a name="l00773"></a>00773     flux = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_science.flux"</span>, NULL);
-<a name="l00774"></a>00774 
-<a name="l00775"></a>00775     flatfield = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_science.flatfield"</span>, 
-<a name="l00776"></a>00776                                        NULL);
-<a name="l00777"></a>00777 
-<a name="l00778"></a>00778     skyglobal = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_science.skyglobal"</span>, 
-<a name="l00779"></a>00779                                        NULL);
-<a name="l00780"></a>00780     skylocal  = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_science.skylocal"</span>, 
-<a name="l00781"></a>00781                                        NULL);
-<a name="l00782"></a>00782     skymedian = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_science.skymedian"</span>, 
-<a name="l00783"></a>00783                                        NULL);
-<a name="l00784"></a>00784 <span class="comment">/* NSS</span>
-<a name="l00785"></a>00785 <span class="comment">    skymedian = dfs_get_parameter_int(parlist, "fors.fors_science.skymedian", </span>
-<a name="l00786"></a>00786 <span class="comment">                                       NULL);</span>
-<a name="l00787"></a>00787 <span class="comment">*/</span>
-<a name="l00788"></a>00788 
-<a name="l00789"></a>00789     <span class="keywordflow">if</span> (skylocal && skyglobal)
-<a name="l00790"></a>00790         fors_science_exit(<span class="stringliteral">"Cannot apply both local and global sky subtraction"</span>);
-<a name="l00791"></a>00791 
-<a name="l00792"></a>00792     <span class="keywordflow">if</span> (skylocal && skymedian)
-<a name="l00793"></a>00793         fors_science_exit(<span class="stringliteral">"Cannot apply sky subtraction both on extracted "</span>
-<a name="l00794"></a>00794                           <span class="stringliteral">"and non-extracted spectra"</span>);
-<a name="l00795"></a>00795 
-<a name="l00796"></a>00796     cosmics = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00797"></a>00797                                      <span class="stringliteral">"fors.fors_science.cosmics"</span>, NULL);
-<a name="l00798"></a>00798 
-<a name="l00799"></a>00799     <span class="keywordflow">if</span> (cosmics)
-<a name="l00800"></a>00800         <span class="keywordflow">if</span> (!(skyglobal || skylocal))
-<a name="l00801"></a>00801             fors_science_exit(<span class="stringliteral">"Cosmic rays correction requires "</span>
-<a name="l00802"></a>00802                               <span class="stringliteral">"either skylocal=true or skyglobal=true"</span>);
-<a name="l00803"></a>00803 
-<a name="l00804"></a>00804     slit_margin = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00805"></a>00805                                         <span class="stringliteral">"fors.fors_science.slit_margin"</span>,
-<a name="l00806"></a>00806                                         NULL);
-<a name="l00807"></a>00807     <span class="keywordflow">if</span> (slit_margin < 0)
-<a name="l00808"></a>00808         fors_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00809"></a>00809 
-<a name="l00810"></a>00810     ext_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_science.ext_radius"</span>,
-<a name="l00811"></a>00811                                        NULL);
-<a name="l00812"></a>00812     <span class="keywordflow">if</span> (ext_radius < 0)
-<a name="l00813"></a>00813         fors_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00814"></a>00814 
-<a name="l00815"></a>00815     cont_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00816"></a>00816                                         <span class="stringliteral">"fors.fors_science.cont_radius"</span>,
-<a name="l00817"></a>00817                                         NULL);
-<a name="l00818"></a>00818     <span class="keywordflow">if</span> (cont_radius < 0)
-<a name="l00819"></a>00819         fors_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00820"></a>00820 
-<a name="l00821"></a>00821     ext_mode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_science.ext_mode"</span>,
-<a name="l00822"></a>00822                                        NULL);
-<a name="l00823"></a>00823     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)
-<a name="l00824"></a>00824         fors_science_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);
-<a name="l00825"></a>00825 
-<a name="l00826"></a>00826     time_normalise = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00827"></a>00827                              <span class="stringliteral">"fors.fors_science.time_normalise"</span>, NULL);
-<a name="l00828"></a>00828 
-<a name="l00829"></a>00829     res_order = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_science.response"</span>,
-<a name="l00830"></a>00830                                       NULL);
-<a name="l00831"></a>00831     <span class="keywordflow">if</span> (res_order < 2 || res_order > 10)
-<a name="l00832"></a>00832         fors_science_exit(<span class="stringliteral">"Invalid instrument response modeling polynomial"</span>);
-<a name="l00833"></a>00833 
-<a name="l00834"></a>00834     photometry = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist,
-<a name="l00835"></a>00835                              <span class="stringliteral">"fors.fors_science.photometry"</span>, NULL);
-<a name="l00836"></a>00836 
-<a name="l00837"></a>00837     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00838"></a>00838 
-<a name="l00839"></a>00839     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00840"></a>00840         fors_science_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00841"></a>00841 
-<a name="l00842"></a>00842     
-<a name="l00843"></a>00843     <span class="comment">/* </span>
-<a name="l00844"></a>00844 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00845"></a>00845 <span class="comment">     */</span>
-<a name="l00846"></a>00846 
-<a name="l00847"></a>00847     cpl_msg_indent_less();
-<a name="l00848"></a>00848     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00849"></a>00849     cpl_msg_indent_more();
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851     mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MXU"</span>);
-<a name="l00852"></a>00852     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MOS"</span>);
-<a name="l00853"></a>00853     lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_LSS"</span>);
-<a name="l00854"></a>00854     standard = 0;
-<a name="l00855"></a>00855 
-<a name="l00856"></a>00856     <span class="keywordflow">if</span> (mxu + mos + lss == 0) {
-<a name="l00857"></a>00857         mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MXU"</span>);
-<a name="l00858"></a>00858         mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MOS"</span>);
-<a name="l00859"></a>00859         lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_LSS"</span>);
-<a name="l00860"></a>00860         standard = 1;
-<a name="l00861"></a>00861     }
-<a name="l00862"></a>00862 
-<a name="l00863"></a>00863     <span class="keywordflow">if</span> (mxu + mos + lss == 0)
-<a name="l00864"></a>00864         fors_science_exit(<span class="stringliteral">"Missing input scientific frame"</span>);
-<a name="l00865"></a>00865 
-<a name="l00866"></a>00866     nscience = mxu + mos + lss;
-<a name="l00867"></a>00867 
-<a name="l00868"></a>00868     <span class="keywordflow">if</span> (mxu && mxu < nscience)
-<a name="l00869"></a>00869         fors_science_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); 
-<a name="l00870"></a>00870 
-<a name="l00871"></a>00871     <span class="keywordflow">if</span> (mos && mos < nscience)
-<a name="l00872"></a>00872         fors_science_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); 
-<a name="l00873"></a>00873 
-<a name="l00874"></a>00874     <span class="keywordflow">if</span> (lss && lss < nscience)
-<a name="l00875"></a>00875         fors_science_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); 
-<a name="l00876"></a>00876 
-<a name="l00877"></a>00877     <span class="keywordflow">if</span> (mxu) {
-<a name="l00878"></a>00878         cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);
-<a name="l00879"></a>00879         <span class="keywordflow">if</span> (standard) {
-<a name="l00880"></a>00880             science_tag              = <span class="stringliteral">"STANDARD_MXU"</span>;
-<a name="l00881"></a>00881             reduced_science_tag      = <span class="stringliteral">"REDUCED_STD_MXU"</span>;
-<a name="l00882"></a>00882             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_STD_MXU"</span>;
-<a name="l00883"></a>00883             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_STD_MXU"</span>;
-<a name="l00884"></a>00884             mapped_science_tag       = <span class="stringliteral">"MAPPED_STD_MXU"</span>;
-<a name="l00885"></a>00885             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_STD_MXU"</span>;
-<a name="l00886"></a>00886             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;
-<a name="l00887"></a>00887             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MXU"</span>;
-<a name="l00888"></a>00888             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;
-<a name="l00889"></a>00889             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;
-<a name="l00890"></a>00890             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_MXU"</span>;
-<a name="l00891"></a>00891             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>;
-<a name="l00892"></a>00892             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_STD_MXU"</span>;
-<a name="l00893"></a>00893             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_STD_MXU"</span>;
-<a name="l00894"></a>00894             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_STD_MXU"</span>;
-<a name="l00895"></a>00895             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_STD_MXU"</span>;
-<a name="l00896"></a>00896             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;
-<a name="l00897"></a>00897         }
-<a name="l00898"></a>00898         <span class="keywordflow">else</span> {
-<a name="l00899"></a>00899             science_tag              = <span class="stringliteral">"SCIENCE_MXU"</span>;
-<a name="l00900"></a>00900             reduced_science_tag      = <span class="stringliteral">"REDUCED_SCI_MXU"</span>;
-<a name="l00901"></a>00901             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_SCI_MXU"</span>;
-<a name="l00902"></a>00902             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>;
-<a name="l00903"></a>00903             mapped_science_tag       = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;
-<a name="l00904"></a>00904             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_SCI_MXU"</span>;
-<a name="l00905"></a>00905             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;
-<a name="l00906"></a>00906             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MXU"</span>;
-<a name="l00907"></a>00907             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;
-<a name="l00908"></a>00908             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;
-<a name="l00909"></a>00909             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_MXU"</span>;
-<a name="l00910"></a>00910             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>;
-<a name="l00911"></a>00911             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;
-<a name="l00912"></a>00912             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_SCI_MXU"</span>;
-<a name="l00913"></a>00913             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_SCI_MXU"</span>;
-<a name="l00914"></a>00914             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_SCI_MXU"</span>;
-<a name="l00915"></a>00915             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;
-<a name="l00916"></a>00916         }
-<a name="l00917"></a>00917 
-<a name="l00918"></a>00918         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;
-<a name="l00919"></a>00919         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MXU"</span>;
-<a name="l00920"></a>00920         curv_coeff_tag          = <span class="stringliteral">"CURV_COEFF_MXU"</span>;
-<a name="l00921"></a>00921         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00922"></a>00922         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_MXU"</span>;
-<a name="l00923"></a>00923 
-<a name="l00924"></a>00924         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {
-<a name="l00925"></a>00925             master_norm_flat_tag   = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_MXU"</span>;
-<a name="l00926"></a>00926             disp_coeff_tag         = <span class="stringliteral">"DISP_COEFF_LONG_MXU"</span>;
-<a name="l00927"></a>00927             slit_location_tag      = <span class="stringliteral">"SLIT_LOCATION_LONG_MXU"</span>;
-<a name="l00928"></a>00928         }
-<a name="l00929"></a>00929     }
-<a name="l00930"></a>00930 
-<a name="l00931"></a>00931     <span class="keywordflow">if</span> (lss) {
-<a name="l00932"></a>00932         cpl_msg_info(recipe, <span class="stringliteral">"LSS data found"</span>);
-<a name="l00933"></a>00933 
-<a name="l00934"></a>00934         <span class="keywordflow">if</span> (cosmics && !skyglobal)
-<a name="l00935"></a>00935             fors_science_exit(<span class="stringliteral">"Cosmic rays correction for LSS "</span>
-<a name="l00936"></a>00936                               <span class="stringliteral">"data requires --skyglobal=true"</span>);
-<a name="l00937"></a>00937 
-<a name="l00938"></a>00938         <span class="keywordflow">if</span> (standard) {
-<a name="l00939"></a>00939             science_tag              = <span class="stringliteral">"STANDARD_LSS"</span>;
-<a name="l00940"></a>00940             reduced_science_tag      = <span class="stringliteral">"REDUCED_STD_LSS"</span>;
-<a name="l00941"></a>00941             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_STD_LSS"</span>;
-<a name="l00942"></a>00942             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_STD_LSS"</span>;
-<a name="l00943"></a>00943             mapped_science_tag       = <span class="stringliteral">"MAPPED_STD_LSS"</span>;
-<a name="l00944"></a>00944             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_STD_LSS"</span>;
-<a name="l00945"></a>00945             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>;
-<a name="l00946"></a>00946             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_LSS"</span>;
-<a name="l00947"></a>00947             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_LSS"</span>;
-<a name="l00948"></a>00948             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>;
-<a name="l00949"></a>00949             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_LSS"</span>;
-<a name="l00950"></a>00950             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_STD_LSS"</span>;
-<a name="l00951"></a>00951             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_STD_LSS"</span>;
-<a name="l00952"></a>00952             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_STD_LSS"</span>;
-<a name="l00953"></a>00953             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_STD_LSS"</span>;
-<a name="l00954"></a>00954             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_STD_LSS"</span>;
-<a name="l00955"></a>00955             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;
-<a name="l00956"></a>00956         }
-<a name="l00957"></a>00957         <span class="keywordflow">else</span> {
-<a name="l00958"></a>00958             science_tag              = <span class="stringliteral">"SCIENCE_LSS"</span>;
-<a name="l00959"></a>00959             reduced_science_tag      = <span class="stringliteral">"REDUCED_SCI_LSS"</span>;
-<a name="l00960"></a>00960             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_SCI_LSS"</span>;
-<a name="l00961"></a>00961             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_SCI_LSS"</span>;
-<a name="l00962"></a>00962             mapped_science_tag       = <span class="stringliteral">"MAPPED_SCI_LSS"</span>;
-<a name="l00963"></a>00963             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_SCI_LSS"</span>;
-<a name="l00964"></a>00964             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>;
-<a name="l00965"></a>00965             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_LSS"</span>;
-<a name="l00966"></a>00966             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_LSS"</span>;
-<a name="l00967"></a>00967             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>;
-<a name="l00968"></a>00968             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_LSS"</span>;
-<a name="l00969"></a>00969             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_SCI_LSS"</span>;
-<a name="l00970"></a>00970             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;
-<a name="l00971"></a>00971             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_SCI_LSS"</span>;
-<a name="l00972"></a>00972             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_SCI_LSS"</span>;
-<a name="l00973"></a>00973             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_SCI_LSS"</span>;
-<a name="l00974"></a>00974             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;
-<a name="l00975"></a>00975         }
-<a name="l00976"></a>00976 
-<a name="l00977"></a>00977         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;
-<a name="l00978"></a>00978         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_LSS"</span>;
-<a name="l00979"></a>00979         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;
-<a name="l00980"></a>00980         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_LSS"</span>;
-<a name="l00981"></a>00981     }
-<a name="l00982"></a>00982 
-<a name="l00983"></a>00983     <span class="keywordflow">if</span> (mos) {
-<a name="l00984"></a>00984         cpl_msg_info(recipe, <span class="stringliteral">"MOS data found"</span>);
-<a name="l00985"></a>00985         <span class="keywordflow">if</span> (standard) {
-<a name="l00986"></a>00986             science_tag              = <span class="stringliteral">"STANDARD_MOS"</span>;
-<a name="l00987"></a>00987             reduced_science_tag      = <span class="stringliteral">"REDUCED_STD_MOS"</span>;
-<a name="l00988"></a>00988             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_STD_MOS"</span>;
-<a name="l00989"></a>00989             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_STD_MOS"</span>;
-<a name="l00990"></a>00990             mapped_science_tag       = <span class="stringliteral">"MAPPED_STD_MOS"</span>;
-<a name="l00991"></a>00991             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_STD_MOS"</span>;
-<a name="l00992"></a>00992             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;
-<a name="l00993"></a>00993             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MOS"</span>;
-<a name="l00994"></a>00994             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;
-<a name="l00995"></a>00995             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;
-<a name="l00996"></a>00996             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_MOS"</span>;
-<a name="l00997"></a>00997             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>;
-<a name="l00998"></a>00998             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_STD_MOS"</span>;
-<a name="l00999"></a>00999             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_STD_MOS"</span>;
-<a name="l01000"></a>01000             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_STD_MOS"</span>;
-<a name="l01001"></a>01001             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_STD_MOS"</span>;
-<a name="l01002"></a>01002             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;
-<a name="l01003"></a>01003         }
-<a name="l01004"></a>01004         <span class="keywordflow">else</span> {
-<a name="l01005"></a>01005             science_tag              = <span class="stringliteral">"SCIENCE_MOS"</span>;
-<a name="l01006"></a>01006             reduced_science_tag      = <span class="stringliteral">"REDUCED_SCI_MOS"</span>;
-<a name="l01007"></a>01007             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_SCI_MOS"</span>;
-<a name="l01008"></a>01008             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>;
-<a name="l01009"></a>01009             mapped_science_tag       = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;
-<a name="l01010"></a>01010             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_SCI_MOS"</span>;
-<a name="l01011"></a>01011             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;
-<a name="l01012"></a>01012             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MOS"</span>;
-<a name="l01013"></a>01013             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;
-<a name="l01014"></a>01014             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;
-<a name="l01015"></a>01015             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_MOS"</span>;
-<a name="l01016"></a>01016             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>;
-<a name="l01017"></a>01017             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;
-<a name="l01018"></a>01018             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_SCI_MOS"</span>;
-<a name="l01019"></a>01019             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_SCI_MOS"</span>;
-<a name="l01020"></a>01020             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_SCI_MOS"</span>;
-<a name="l01021"></a>01021             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;
-<a name="l01022"></a>01022         }
-<a name="l01023"></a>01023 
-<a name="l01024"></a>01024         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;
-<a name="l01025"></a>01025         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MOS"</span>;
-<a name="l01026"></a>01026         curv_coeff_tag          = <span class="stringliteral">"CURV_COEFF_MOS"</span>;
-<a name="l01027"></a>01027         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l01028"></a>01028         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_MOS"</span>;
-<a name="l01029"></a>01029 
-<a name="l01030"></a>01030         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {
-<a name="l01031"></a>01031             master_norm_flat_tag   = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_MOS"</span>;
-<a name="l01032"></a>01032             disp_coeff_tag         = <span class="stringliteral">"DISP_COEFF_LONG_MOS"</span>;
-<a name="l01033"></a>01033             slit_location_tag      = <span class="stringliteral">"SLIT_LOCATION_LONG_MOS"</span>;
-<a name="l01034"></a>01034         }
-<a name="l01035"></a>01035     }
-<a name="l01036"></a>01036 
-<a name="l01037"></a>01037     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0)
-<a name="l01038"></a>01038         fors_science_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS"</span>);
-<a name="l01039"></a>01039 
-<a name="l01040"></a>01040     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)
-<a name="l01041"></a>01041         fors_science_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);
-<a name="l01042"></a>01042 
-<a name="l01043"></a>01043     <span class="keywordflow">if</span> (skyalign >= 0)
-<a name="l01044"></a>01044         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)
-<a name="l01045"></a>01045             fors_science_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);
-<a name="l01046"></a>01046 
-<a name="l01047"></a>01047     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) == 0) {
-<a name="l01048"></a>01048         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, disp_coeff_tag);
-<a name="l01049"></a>01049         fors_science_exit(NULL);
-<a name="l01050"></a>01050     }
-<a name="l01051"></a>01051 
-<a name="l01052"></a>01052     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) > 1) {
-<a name="l01053"></a>01053         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, disp_coeff_tag);
-<a name="l01054"></a>01054         fors_science_exit(NULL);
-<a name="l01055"></a>01055     }
-<a name="l01056"></a>01056 
-<a name="l01057"></a>01057     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) == 0) {
-<a name="l01058"></a>01058         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>,
-<a name="l01059"></a>01059                       slit_location_tag);
-<a name="l01060"></a>01060         fors_science_exit(NULL);
-<a name="l01061"></a>01061     }
-<a name="l01062"></a>01062 
-<a name="l01063"></a>01063     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) > 1) {
-<a name="l01064"></a>01064         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, slit_location_tag);
-<a name="l01065"></a>01065         fors_science_exit(NULL);
-<a name="l01066"></a>01066     }
-<a name="l01067"></a>01067 
-<a name="l01068"></a>01068     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) > 1) {
-<a name="l01069"></a>01069         <span class="keywordflow">if</span> (flatfield) {
-<a name="l01070"></a>01070             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, 
-<a name="l01071"></a>01071                           master_norm_flat_tag);
-<a name="l01072"></a>01072             fors_science_exit(NULL);
-<a name="l01073"></a>01073         }
-<a name="l01074"></a>01074         <span class="keywordflow">else</span> {
-<a name="l01075"></a>01075             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input are ignored, "</span>
-<a name="l01076"></a>01076                             <span class="stringliteral">"since flat field correction was not requested"</span>, 
-<a name="l01077"></a>01077                             master_norm_flat_tag);
-<a name="l01078"></a>01078         }
-<a name="l01079"></a>01079     }
-<a name="l01080"></a>01080 
-<a name="l01081"></a>01081     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 1) {
-<a name="l01082"></a>01082         <span class="keywordflow">if</span> (!flatfield) {
-<a name="l01083"></a>01083             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input is ignored, "</span>
-<a name="l01084"></a>01084                             <span class="stringliteral">"since flat field correction was not requested"</span>, 
-<a name="l01085"></a>01085                             master_norm_flat_tag);
-<a name="l01086"></a>01086         }
-<a name="l01087"></a>01087     }
-<a name="l01088"></a>01088 
-<a name="l01089"></a>01089     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 0) {
-<a name="l01090"></a>01090         <span class="keywordflow">if</span> (flatfield) {
-<a name="l01091"></a>01091             cpl_msg_error(recipe, <span class="stringliteral">"Flat field correction was requested, "</span>
-<a name="l01092"></a>01092                           <span class="stringliteral">"but no %s are found in input"</span>,
-<a name="l01093"></a>01093                           master_norm_flat_tag);
-<a name="l01094"></a>01094             fors_science_exit(NULL);
-<a name="l01095"></a>01095         }
-<a name="l01096"></a>01096     }
-<a name="l01097"></a>01097 
-<a name="l01098"></a>01098     <span class="keywordflow">if</span> (standard) {
-<a name="l01099"></a>01099     
-<a name="l01100"></a>01100         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) == 0) {
-<a name="l01101"></a>01101             cpl_msg_warning(recipe, <span class="stringliteral">"An EXTINCT_TABLE was not found in input: "</span>
-<a name="l01102"></a>01102                             <span class="stringliteral">"instrument response curve will not be produced."</span>);
-<a name="l01103"></a>01103             standard = 0;
-<a name="l01104"></a>01104         }
-<a name="l01105"></a>01105 
-<a name="l01106"></a>01106         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) > 1)
-<a name="l01107"></a>01107             fors_science_exit(<span class="stringliteral">"Too many in input: EXTINCT_TABLE"</span>);
-<a name="l01108"></a>01108     
-<a name="l01109"></a>01109         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>) == 0) {
-<a name="l01110"></a>01110             cpl_msg_warning(recipe, <span class="stringliteral">"A STD_FLUX_TABLE was not found in input: "</span>
-<a name="l01111"></a>01111                             <span class="stringliteral">"instrument response curve will not be produced."</span>);
-<a name="l01112"></a>01112             standard = 0;
-<a name="l01113"></a>01113         }
-<a name="l01114"></a>01114 
-<a name="l01115"></a>01115         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>) > 1)
-<a name="l01116"></a>01116             fors_science_exit(<span class="stringliteral">"Too many in input: STD_FLUX_TABLE"</span>);
-<a name="l01117"></a>01117 
-<a name="l01118"></a>01118         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO OBS TARG NAME"</span>)) {
-<a name="l01119"></a>01119             cpl_msg_warning(recipe, <span class="stringliteral">"The target name of observation does not "</span>
-<a name="l01120"></a>01120                             <span class="stringliteral">"match the standard star catalog: "</span>
-<a name="l01121"></a>01121                             <span class="stringliteral">"instrument response curve will not be produced."</span>);
-<a name="l01122"></a>01122             standard = 0;
-<a name="l01123"></a>01123         }
-<a name="l01124"></a>01124     }
-<a name="l01125"></a>01125 
-<a name="l01126"></a>01126     <span class="keywordflow">if</span> (photometry) {
-<a name="l01127"></a>01127         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) == 0) {
-<a name="l01128"></a>01128             fors_science_exit(<span class="stringliteral">"An EXTINCT_TABLE was not found in input: "</span>
-<a name="l01129"></a>01129                               <span class="stringliteral">"the requested photometric calibrated spectra "</span>
-<a name="l01130"></a>01130                               <span class="stringliteral">"cannot be produced."</span>);
-<a name="l01131"></a>01131         }
-<a name="l01132"></a>01132 
-<a name="l01133"></a>01133         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) > 1)
-<a name="l01134"></a>01134             fors_science_exit(<span class="stringliteral">"Too many in input: EXTINCT_TABLE"</span>);
-<a name="l01135"></a>01135 
-<a name="l01136"></a>01136         have_phot  = cpl_frameset_count_tags(frameset, specphot_tag);
-<a name="l01137"></a>01137         have_phot += cpl_frameset_count_tags(frameset, master_specphot_tag);
-<a name="l01138"></a>01138 
-<a name="l01139"></a>01139         <span class="keywordflow">if</span> (!standard) {
-<a name="l01140"></a>01140             <span class="keywordflow">if</span> (have_phot == 0) {
-<a name="l01141"></a>01141                 cpl_msg_warning(recipe, 
-<a name="l01142"></a>01142                                 <span class="stringliteral">"A SPECPHOT_TABLE was not found in input: "</span>
-<a name="l01143"></a>01143                                 <span class="stringliteral">"the requested photometric calibrated "</span>
-<a name="l01144"></a>01144                                 <span class="stringliteral">"spectra cannot be produced."</span>);
-<a name="l01145"></a>01145                 photometry = 0;
-<a name="l01146"></a>01146             }
-<a name="l01147"></a>01147 
-<a name="l01148"></a>01148             <span class="keywordflow">if</span> (have_phot > 1)
-<a name="l01149"></a>01149                 fors_science_exit(<span class="stringliteral">"Too many in input: SPECPHOT_TABLE"</span>);
-<a name="l01150"></a>01150         }
-<a name="l01151"></a>01151     }
-<a name="l01152"></a>01152 
-<a name="l01153"></a>01153     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l01154"></a>01154         fors_science_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l01155"></a>01155 
-<a name="l01156"></a>01156     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l01157"></a>01157         fors_science_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l01158"></a>01158 
-<a name="l01159"></a>01159     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"SPECPHOT_TABLE"</span>))
-<a name="l01160"></a>01160     {
-<a name="l01161"></a>01161         cpl_frameset * frameset_nostd = cpl_frameset_duplicate(frameset);
-<a name="l01162"></a>01162         cpl_frameset_erase(frameset_nostd, <span class="stringliteral">"SPECPHOT_TABLE"</span>);
-<a name="l01163"></a>01163         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset_nostd, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l01164"></a>01164              fors_science_exit(<span class="stringliteral">"Input frames are not from the same chip."</span>
-<a name="l01165"></a>01165                                <span class="stringliteral">" This does not apply to specphot table."</span>);
-<a name="l01166"></a>01166         cpl_frameset_delete(frameset_nostd);
-<a name="l01167"></a>01167     }
-<a name="l01168"></a>01168     <span class="keywordflow">else</span>
-<a name="l01169"></a>01169     {
-<a name="l01170"></a>01170         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l01171"></a>01171             fors_science_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l01172"></a>01172     }
-<a name="l01173"></a>01173 
-<a name="l01174"></a>01174     {
-<a name="l01175"></a>01175         cpl_frameset * frameset_detector = cpl_frameset_duplicate(frameset);
-<a name="l01176"></a>01176         cpl_frameset_erase(frameset_detector, <span class="stringliteral">"GRISM_TABLE"</span>);
-<a name="l01177"></a>01177         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset_detector, <span class="stringliteral">"ESO DET CHIP1 NAME"</span>))
-<a name="l01178"></a>01178             fors_science_exit(<span class="stringliteral">"Input frames are not from the same chip mosaic"</span>);
-<a name="l01179"></a>01179         cpl_frameset_delete(frameset_detector);
-<a name="l01180"></a>01180     }
-<a name="l01181"></a>01181  
-<a name="l01182"></a>01182     cpl_msg_indent_less();
-<a name="l01183"></a>01183 
-<a name="l01184"></a>01184 
-<a name="l01185"></a>01185     <span class="comment">/*</span>
-<a name="l01186"></a>01186 <span class="comment">     * Loading input data</span>
-<a name="l01187"></a>01187 <span class="comment">     */</span>
-<a name="l01188"></a>01188 
-<a name="l01189"></a>01189     exptime = cpl_calloc(nscience, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01190"></a>01190 
-<a name="l01191"></a>01191     <span class="keywordflow">if</span> (nscience > 1) {
-<a name="l01192"></a>01192 
-<a name="l01193"></a>01193         cpl_msg_info(recipe, <span class="stringliteral">"Load %d scientific frames and median them..."</span>,
-<a name="l01194"></a>01194                      nscience);
-<a name="l01195"></a>01195         cpl_msg_indent_more();
-<a name="l01196"></a>01196 
-<a name="l01197"></a>01197         all_science = cpl_imagelist_new();
-<a name="l01198"></a>01198 
-<a name="l01199"></a>01199         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01200"></a>01200 
-<a name="l01201"></a>01201         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01202"></a>01202             fors_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01203"></a>01203 
-<a name="l01204"></a>01204         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l01205"></a>01205 
-<a name="l01206"></a>01206         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01207"></a>01207             fors_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l01208"></a>01208                               <span class="stringliteral">"frame header"</span>);
-<a name="l01209"></a>01209 
-<a name="l01210"></a>01210         <span class="keywordflow">if</span> (standard || photometry) {
-<a name="l01211"></a>01211             airmass = <a class="code" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">fors_get_airmass</a>(header);
-<a name="l01212"></a>01212             <span class="keywordflow">if</span> (airmass < 0.0) 
-<a name="l01213"></a>01213                 fors_science_exit(<span class="stringliteral">"Missing airmass information in "</span>
-<a name="l01214"></a>01214                                   <span class="stringliteral">"scientific frame header"</span>);
-<a name="l01215"></a>01215         }
-<a name="l01216"></a>01216 
-<a name="l01217"></a>01217         cpl_propertylist_delete(header); header = NULL;
-<a name="l01218"></a>01218 
-<a name="l01219"></a>01219         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame 1 exposure time: %.2f s"</span>, 
-<a name="l01220"></a>01220                      exptime[0]);
-<a name="l01221"></a>01221 
-<a name="l01222"></a>01222         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {
-<a name="l01223"></a>01223 
-<a name="l01224"></a>01224             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01225"></a>01225 
-<a name="l01226"></a>01226             <span class="keywordflow">if</span> (header == NULL)
-<a name="l01227"></a>01227                 fors_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01228"></a>01228     
-<a name="l01229"></a>01229             exptime[i] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l01230"></a>01230 
-<a name="l01231"></a>01231             alltime += exptime[i];
-<a name="l01232"></a>01232     
-<a name="l01233"></a>01233             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01234"></a>01234                 fors_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l01235"></a>01235                                   <span class="stringliteral">"frame header"</span>);
-<a name="l01236"></a>01236     
-<a name="l01237"></a>01237             cpl_propertylist_delete(header); header = NULL;
-<a name="l01238"></a>01238 
-<a name="l01239"></a>01239             cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame %d exposure time: %.2f s"</span>, 
-<a name="l01240"></a>01240                          i+1, exptime[i]);
-<a name="l01241"></a>01241         }
-<a name="l01242"></a>01242 
-<a name="l01243"></a>01243         spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01244"></a>01244 
-<a name="l01245"></a>01245         <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01246"></a>01246             fors_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l01247"></a>01247 
-<a name="l01248"></a>01248         cpl_image_divide_scalar(spectra, exptime[0]);
-<a name="l01249"></a>01249         cpl_imagelist_set(all_science, spectra, 0); spectra = NULL;
-<a name="l01250"></a>01250 
-<a name="l01251"></a>01251         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {
-<a name="l01252"></a>01252 
-<a name="l01253"></a>01253             spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01254"></a>01254 
-<a name="l01255"></a>01255             <span class="keywordflow">if</span> (spectra) {
-<a name="l01256"></a>01256                 cpl_image_divide_scalar(spectra, exptime[i]);
-<a name="l01257"></a>01257                 cpl_imagelist_set(all_science, spectra, i); spectra = NULL;
-<a name="l01258"></a>01258             }
-<a name="l01259"></a>01259             <span class="keywordflow">else</span>
-<a name="l01260"></a>01260                 fors_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l01261"></a>01261 
-<a name="l01262"></a>01262         }
-<a name="l01263"></a>01263 
-<a name="l01264"></a>01264         spectra = cpl_imagelist_collapse_median_create(all_science);
-<a name="l01265"></a>01265         cpl_image_multiply_scalar(spectra, alltime);
-<a name="l01266"></a>01266 
-<a name="l01267"></a>01267         cpl_imagelist_delete(all_science);
-<a name="l01268"></a>01268     }
-<a name="l01269"></a>01269     <span class="keywordflow">else</span> {
-<a name="l01270"></a>01270         cpl_msg_info(recipe, <span class="stringliteral">"Load scientific exposure..."</span>);
-<a name="l01271"></a>01271         cpl_msg_indent_more();
-<a name="l01272"></a>01272 
-<a name="l01273"></a>01273         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01274"></a>01274 
-<a name="l01275"></a>01275         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01276"></a>01276             fors_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01277"></a>01277 
-<a name="l01278"></a>01278         <span class="keywordflow">if</span> (standard || photometry) {
-<a name="l01279"></a>01279             airmass = <a class="code" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">fors_get_airmass</a>(header);
-<a name="l01280"></a>01280             <span class="keywordflow">if</span> (airmass < 0.0) 
-<a name="l01281"></a>01281                 fors_science_exit(<span class="stringliteral">"Missing airmass information in "</span>
-<a name="l01282"></a>01282                                   <span class="stringliteral">"scientific frame header"</span>);
-<a name="l01283"></a>01283         }
-<a name="l01284"></a>01284 
-<a name="l01285"></a>01285         <span class="comment">/*</span>
-<a name="l01286"></a>01286 <span class="comment">         * Insert here a check on supported filters:</span>
-<a name="l01287"></a>01287 <span class="comment">         */</span>
-<a name="l01288"></a>01288 
-<a name="l01289"></a>01289         wheel4 = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, 
-<a name="l01290"></a>01290                                                      <span class="stringliteral">"ESO INS OPTI9 TYPE"</span>);
-<a name="l01291"></a>01291         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l01292"></a>01292             fors_science_exit(<span class="stringliteral">"Missing ESO INS OPTI9 TYPE in flat header"</span>);
-<a name="l01293"></a>01293         }
-<a name="l01294"></a>01294 
-<a name="l01295"></a>01295         <span class="keywordflow">if</span> (strcmp(<span class="stringliteral">"FILT"</span>, wheel4) == 0) {
-<a name="l01296"></a>01296             wheel4 = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header,
-<a name="l01297"></a>01297                                                          <span class="stringliteral">"ESO INS OPTI9 NAME"</span>);
-<a name="l01298"></a>01298             cpl_msg_error(recipe, <span class="stringliteral">"Unsupported filter: %s"</span>, wheel4);
-<a name="l01299"></a>01299             fors_science_exit(NULL);
-<a name="l01300"></a>01300         }
-<a name="l01301"></a>01301 
-<a name="l01302"></a>01302         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l01303"></a>01303 
-<a name="l01304"></a>01304         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01305"></a>01305             fors_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l01306"></a>01306                               <span class="stringliteral">"frame header"</span>);
-<a name="l01307"></a>01307 
-<a name="l01308"></a>01308         cpl_propertylist_delete(header); header = NULL;
-<a name="l01309"></a>01309 
-<a name="l01310"></a>01310         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame exposure time: %.2f s"</span>, 
-<a name="l01311"></a>01311                      exptime[0]);
-<a name="l01312"></a>01312 
-<a name="l01313"></a>01313         spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01314"></a>01314     }
-<a name="l01315"></a>01315 
-<a name="l01316"></a>01316     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01317"></a>01317         fors_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l01318"></a>01318 
-<a name="l01319"></a>01319     cpl_free(exptime); exptime = NULL;
-<a name="l01320"></a>01320 
-<a name="l01321"></a>01321     cpl_msg_indent_less();
-<a name="l01322"></a>01322 
-<a name="l01323"></a>01323 
-<a name="l01324"></a>01324     <span class="comment">/*</span>
-<a name="l01325"></a>01325 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l01326"></a>01326 <span class="comment">     * dispersion direction from a scientific exposure</span>
-<a name="l01327"></a>01327 <span class="comment">     */</span>
-<a name="l01328"></a>01328 
-<a name="l01329"></a>01329     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01330"></a>01330 
-<a name="l01331"></a>01331     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01332"></a>01332         fors_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01333"></a>01333 
-<a name="l01334"></a>01334     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l01335"></a>01335     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l01336"></a>01336         fors_science_exit(<span class="stringliteral">"Missing keyword INSTRUME in scientific header"</span>);
-<a name="l01337"></a>01337     instrume = cpl_strdup(instrume);
-<a name="l01338"></a>01338 
-<a name="l01339"></a>01339     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l01340"></a>01340         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l01341"></a>01341     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l01342"></a>01342         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l01343"></a>01343 
-<a name="l01344"></a>01344     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l01345"></a>01345 
-<a name="l01346"></a>01346     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01347"></a>01347         fors_science_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in scientific "</span>
-<a name="l01348"></a>01348                         <span class="stringliteral">"frame header"</span>);
-<a name="l01349"></a>01349 
-<a name="l01350"></a>01350     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l01351"></a>01351         reference *= 10;
-<a name="l01352"></a>01352 
-<a name="l01353"></a>01353     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l01354"></a>01354         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l01355"></a>01355                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in scientific frame header"</span>,
-<a name="l01356"></a>01356                       reference);
-<a name="l01357"></a>01357         fors_science_exit(NULL);
-<a name="l01358"></a>01358     }
-<a name="l01359"></a>01359 
-<a name="l01360"></a>01360     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l01361"></a>01361 
-<a name="l01362"></a>01362     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l01363"></a>01363 
-<a name="l01364"></a>01364     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01365"></a>01365         fors_science_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in scientific "</span>
-<a name="l01366"></a>01366                         <span class="stringliteral">"frame header"</span>);
-<a name="l01367"></a>01367 
-<a name="l01368"></a>01368     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l01369"></a>01369         dispersion *= rebin;
-<a name="l01370"></a>01370         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l01371"></a>01371                         <span class="stringliteral">"resampling step used is %f A/pixel"</span>, rebin, 
-<a name="l01372"></a>01372                         dispersion);
-<a name="l01373"></a>01373         ext_radius /= rebin;
-<a name="l01374"></a>01374         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l01375"></a>01375                         <span class="stringliteral">"extraction radius used is %d pixel"</span>, rebin, 
-<a name="l01376"></a>01376                         ext_radius);
-<a name="l01377"></a>01377     }
-<a name="l01378"></a>01378 
-<a name="l01379"></a>01379     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l01380"></a>01380 
-<a name="l01381"></a>01381     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01382"></a>01382         fors_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in scientific "</span>
-<a name="l01383"></a>01383                           <span class="stringliteral">"frame header"</span>);
-<a name="l01384"></a>01384 
-<a name="l01385"></a>01385     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l01386"></a>01386 
-<a name="l01387"></a>01387     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);
-<a name="l01388"></a>01388 
-<a name="l01389"></a>01389     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01390"></a>01390         fors_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in scientific "</span>
-<a name="l01391"></a>01391                           <span class="stringliteral">"frame header"</span>);
-<a name="l01392"></a>01392 
-<a name="l01393"></a>01393     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span>
-<a name="l01394"></a>01394 
-<a name="l01395"></a>01395     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);
-<a name="l01396"></a>01396 
-<a name="l01397"></a>01397     <span class="keywordflow">if</span> (mos || mxu) {
-<a name="l01398"></a>01398         <span class="keywordtype">int</span> nslits_out_det = 0;
-<a name="l01399"></a>01399 <span class="comment">/* goto skip; */</span>
-<a name="l01400"></a>01400         <span class="keywordflow">if</span> (mos)
-<a name="l01401"></a>01401             maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l01402"></a>01402         <span class="keywordflow">else</span>
-<a name="l01403"></a>01403             maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l01404"></a>01404 
-<a name="l01405"></a>01405         <span class="comment">/*</span>
-<a name="l01406"></a>01406 <span class="comment">         * Check if all slits have the same X offset: in such case,</span>
-<a name="l01407"></a>01407 <span class="comment">         * treat the observation as a long-slit one!</span>
-<a name="l01408"></a>01408 <span class="comment">         */</span>
-<a name="l01409"></a>01409 
-<a name="l01410"></a>01410         mxpos = cpl_table_get_column_median(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l01411"></a>01411      
-<a name="l01412"></a>01412         treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l01413"></a>01413 
-<a name="l01414"></a>01414         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l01415"></a>01415 <span class="comment">/* skip: */</span>
-<a name="l01416"></a>01416 
-<a name="l01417"></a>01417         <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l01418"></a>01418             cpl_msg_warning(recipe, <span class="stringliteral">"All MOS slits have the same offset: %.2f\n"</span>
-<a name="l01419"></a>01419                             <span class="stringliteral">"The LSS data reduction strategy is applied!"</span>,
-<a name="l01420"></a>01420                             mxpos);
-<a name="l01421"></a>01421             <span class="keywordflow">if</span> (mos) {
-<a name="l01422"></a>01422                 <span class="keywordflow">if</span> (standard) {
-<a name="l01423"></a>01423                     skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MOS"</span>;
-<a name="l01424"></a>01424                 }
-<a name="l01425"></a>01425                 <span class="keywordflow">else</span> {
-<a name="l01426"></a>01426                     skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MOS"</span>;
-<a name="l01427"></a>01427                 }
-<a name="l01428"></a>01428             }
-<a name="l01429"></a>01429             <span class="keywordflow">else</span> {
-<a name="l01430"></a>01430                 <span class="keywordflow">if</span> (standard) {
-<a name="l01431"></a>01431                     skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MXU"</span>;
-<a name="l01432"></a>01432                 }
-<a name="l01433"></a>01433                 <span class="keywordflow">else</span> {
-<a name="l01434"></a>01434                     skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MXU"</span>;
-<a name="l01435"></a>01435                 }
-<a name="l01436"></a>01436             }
-<a name="l01437"></a>01437         }
-<a name="l01438"></a>01438     }
-<a name="l01439"></a>01439 
-<a name="l01440"></a>01440     <span class="keywordflow">if</span> (lss || treat_as_lss) {
-<a name="l01441"></a>01441         <span class="keywordflow">if</span> (skylocal) {
-<a name="l01442"></a>01442             <span class="keywordflow">if</span> (cosmics)
-<a name="l01443"></a>01443                 fors_science_exit(<span class="stringliteral">"Cosmic rays correction for LSS or LSS-like "</span>
-<a name="l01444"></a>01444                                   <span class="stringliteral">"data requires --skyglobal=true"</span>);
-<a name="l01445"></a>01445             skymedian = skylocal;
-<a name="l01446"></a>01446             skylocal = 0;
-<a name="l01447"></a>01447         }
-<a name="l01448"></a>01448     }
-<a name="l01449"></a>01449     <span class="keywordflow">else</span> {
-<a name="l01450"></a>01450         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) == 0) {
-<a name="l01451"></a>01451             cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, curv_coeff_tag);
-<a name="l01452"></a>01452             fors_science_exit(NULL);
-<a name="l01453"></a>01453         }
-<a name="l01454"></a>01454 
-<a name="l01455"></a>01455         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) > 1) {
-<a name="l01456"></a>01456             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, curv_coeff_tag);
-<a name="l01457"></a>01457             fors_science_exit(NULL);
-<a name="l01458"></a>01458         }
-<a name="l01459"></a>01459     }
-<a name="l01460"></a>01460 
-<a name="l01461"></a>01461     <span class="comment">/* Leave the header on for the next step... */</span>
-<a name="l01462"></a>01462 
-<a name="l01463"></a>01463 
-<a name="l01464"></a>01464     <span class="comment">/*</span>
-<a name="l01465"></a>01465 <span class="comment">     * Remove the master bias</span>
-<a name="l01466"></a>01466 <span class="comment">     */</span>
-<a name="l01467"></a>01467 
-<a name="l01468"></a>01468     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l01469"></a>01469 
-<a name="l01470"></a>01470     bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, CPL_TYPE_FLOAT, 0, 1);
-<a name="l01471"></a>01471 
-<a name="l01472"></a>01472     <span class="keywordflow">if</span> (bias == NULL)
-<a name="l01473"></a>01473         fors_science_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l01474"></a>01474 
-<a name="l01475"></a>01475     overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 1);
-<a name="l01476"></a>01476     cpl_propertylist_delete(header); header = NULL;
-<a name="l01477"></a>01477     dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(spectra, bias, overscans);
-<a name="l01478"></a>01478     cpl_image_delete(spectra); spectra = dummy; dummy = NULL;
-<a name="l01479"></a>01479     cpl_image_delete(bias); bias = NULL;
-<a name="l01480"></a>01480     cpl_table_delete(overscans); overscans = NULL;
-<a name="l01481"></a>01481 
-<a name="l01482"></a>01482     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01483"></a>01483         fors_science_exit(<span class="stringliteral">"Cannot remove bias from scientific frame"</span>);
-<a name="l01484"></a>01484 
-<a name="l01485"></a>01485     ccd_xsize = nx = cpl_image_get_size_x(spectra);
-<a name="l01486"></a>01486     ccd_ysize = ny = cpl_image_get_size_y(spectra);
-<a name="l01487"></a>01487 
-<a name="l01488"></a>01488     cpl_msg_indent_less();
-<a name="l01489"></a>01489     cpl_msg_info(recipe, <span class="stringliteral">"Load normalised flat field (if present)..."</span>);
-<a name="l01490"></a>01490     cpl_msg_indent_more();
-<a name="l01491"></a>01491 
-<a name="l01492"></a>01492     <span class="keywordflow">if</span> (flatfield) {
-<a name="l01493"></a>01493 
-<a name="l01494"></a>01494         norm_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, master_norm_flat_tag, 
-<a name="l01495"></a>01495                                    CPL_TYPE_FLOAT, 0, 1);
-<a name="l01496"></a>01496 
-<a name="l01497"></a>01497         <span class="keywordflow">if</span> (norm_flat) {
-<a name="l01498"></a>01498             cpl_msg_info(recipe, <span class="stringliteral">"Apply flat field correction..."</span>);
-<a name="l01499"></a>01499             <span class="keywordflow">if</span> (cpl_image_divide(spectra, norm_flat) != CPL_ERROR_NONE) {
-<a name="l01500"></a>01500                 cpl_msg_error(recipe, <span class="stringliteral">"Failure of flat field correction: %s"</span>,
-<a name="l01501"></a>01501                               cpl_error_get_message());
-<a name="l01502"></a>01502                 fors_science_exit(NULL);
-<a name="l01503"></a>01503             }
-<a name="l01504"></a>01504             cpl_image_delete(norm_flat); norm_flat = NULL;
-<a name="l01505"></a>01505         }
-<a name="l01506"></a>01506         <span class="keywordflow">else</span> {
-<a name="l01507"></a>01507             cpl_msg_error(recipe, <span class="stringliteral">"Cannot load input %s for flat field "</span>
-<a name="l01508"></a>01508                           <span class="stringliteral">"correction"</span>, master_norm_flat_tag);
-<a name="l01509"></a>01509             fors_science_exit(NULL);
-<a name="l01510"></a>01510         }
-<a name="l01511"></a>01511 
-<a name="l01512"></a>01512     }
-<a name="l01513"></a>01513 
-<a name="l01514"></a>01514 
-<a name="l01515"></a>01515     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01516"></a>01516         cpl_msg_indent_less();
-<a name="l01517"></a>01517         cpl_msg_info(recipe, <span class="stringliteral">"Load input sky line catalog..."</span>);
-<a name="l01518"></a>01518         cpl_msg_indent_more();
-<a name="l01519"></a>01519 
-<a name="l01520"></a>01520         wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);
-<a name="l01521"></a>01521 
-<a name="l01522"></a>01522         <span class="keywordflow">if</span> (wavelengths) {
-<a name="l01523"></a>01523 
-<a name="l01524"></a>01524             <span class="comment">/*</span>
-<a name="l01525"></a>01525 <span class="comment">             * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l01526"></a>01526 <span class="comment">             */</span>
-<a name="l01527"></a>01527 
-<a name="l01528"></a>01528             nlines = cpl_table_get_nrow(wavelengths);
-<a name="l01529"></a>01529 
-<a name="l01530"></a>01530             <span class="keywordflow">if</span> (nlines == 0)
-<a name="l01531"></a>01531                 fors_science_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);
-<a name="l01532"></a>01532 
-<a name="l01533"></a>01533             <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l01534"></a>01534                 cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span>
-<a name="l01535"></a>01535                               <span class="stringliteral">"catalog table"</span>, wcolumn);
-<a name="l01536"></a>01536                 fors_science_exit(NULL);
-<a name="l01537"></a>01537             }
-<a name="l01538"></a>01538 
-<a name="l01539"></a>01539             line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01540"></a>01540     
-<a name="l01541"></a>01541             <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l01542"></a>01542                 line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l01543"></a>01543 
-<a name="l01544"></a>01544             cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l01545"></a>01545 
-<a name="l01546"></a>01546             lines = cpl_vector_wrap(nlines, line);
-<a name="l01547"></a>01547         }
-<a name="l01548"></a>01548         <span class="keywordflow">else</span> {
-<a name="l01549"></a>01549             cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);
-<a name="l01550"></a>01550         }
-<a name="l01551"></a>01551     }
-<a name="l01552"></a>01552 
-<a name="l01553"></a>01553 
-<a name="l01554"></a>01554     <span class="comment">/*</span>
-<a name="l01555"></a>01555 <span class="comment">     * Load the spectral curvature table, or provide a dummy one</span>
-<a name="l01556"></a>01556 <span class="comment">     * in case of LSS or LSS-like data (single slit with flat curvature)</span>
-<a name="l01557"></a>01557 <span class="comment">     */</span>
-<a name="l01558"></a>01558 
-<a name="l01559"></a>01559     <span class="keywordflow">if</span> (!(lss || treat_as_lss)) {
-<a name="l01560"></a>01560         polytraces = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, curv_coeff_tag, 1);
-<a name="l01561"></a>01561         <span class="keywordflow">if</span> (polytraces == NULL)
-<a name="l01562"></a>01562             fors_science_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);
-<a name="l01563"></a>01563     }
-<a name="l01564"></a>01564 
-<a name="l01565"></a>01565 
-<a name="l01566"></a>01566     <span class="comment">/*</span>
-<a name="l01567"></a>01567 <span class="comment">     * Load the slit location table</span>
-<a name="l01568"></a>01568 <span class="comment">     */</span>
-<a name="l01569"></a>01569 
-<a name="l01570"></a>01570     slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l01571"></a>01571     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l01572"></a>01572         fors_science_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l01573"></a>01573 
-<a name="l01574"></a>01574     <span class="keywordflow">if</span> (lss || treat_as_lss) {
-<a name="l01575"></a>01575         <span class="keywordtype">int</span> first_row = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, 0, NULL);
-<a name="l01576"></a>01576         <span class="keywordtype">int</span> last_row = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, 0, NULL);
-<a name="l01577"></a>01577         <span class="keywordtype">int</span> ylow, yhig;
-<a name="l01578"></a>01578 
-<a name="l01579"></a>01579         ylow = first_row + 1;
-<a name="l01580"></a>01580         yhig = last_row + 1;
-<a name="l01581"></a>01581 
-<a name="l01582"></a>01582         dummy = cpl_image_extract(spectra, 1, ylow, nx, yhig);
-<a name="l01583"></a>01583         cpl_image_delete(spectra); spectra = dummy; dummy = NULL;
-<a name="l01584"></a>01584         ny = cpl_image_get_size_y(spectra);
-<a name="l01585"></a>01585     }
-<a name="l01586"></a>01586 
-<a name="l01587"></a>01587 
-<a name="l01588"></a>01588     <span class="comment">/*</span>
-<a name="l01589"></a>01589 <span class="comment">     * Load the wavelength calibration table</span>
-<a name="l01590"></a>01590 <span class="comment">     */</span>
-<a name="l01591"></a>01591 
-<a name="l01592"></a>01592     idscoeff = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, disp_coeff_tag, 1);
-<a name="l01593"></a>01593     <span class="keywordflow">if</span> (idscoeff == NULL)
-<a name="l01594"></a>01594         fors_science_exit(<span class="stringliteral">"Cannot load wavelength calibration table"</span>);
-<a name="l01595"></a>01595 
-<a name="l01596"></a>01596     cpl_msg_indent_less();
-<a name="l01597"></a>01597     cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific spectra..."</span>);
-<a name="l01598"></a>01598     cpl_msg_indent_more();
-<a name="l01599"></a>01599 
-<a name="l01600"></a>01600     <span class="comment">/*</span>
-<a name="l01601"></a>01601 <span class="comment">     * This one will also generate the spatial map from the spectral </span>
-<a name="l01602"></a>01602 <span class="comment">     * curvature table (in the case of multislit data)</span>
-<a name="l01603"></a>01603 <span class="comment">     */</span>
-<a name="l01604"></a>01604 
-<a name="l01605"></a>01605     <span class="keywordflow">if</span> (lss || treat_as_lss) {
-<a name="l01606"></a>01606         smapped = cpl_image_duplicate(spectra);
-<a name="l01607"></a>01607     }
-<a name="l01608"></a>01608     <span class="keywordflow">else</span> {
-<a name="l01609"></a>01609         coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01610"></a>01610 
-<a name="l01611"></a>01611         smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, reference,
-<a name="l01612"></a>01612                                           startwavelength, endwavelength,
-<a name="l01613"></a>01613                                           dispersion, flux, coordinate);
-<a name="l01614"></a>01614     }
-<a name="l01615"></a>01615 
-<a name="l01616"></a>01616 
-<a name="l01617"></a>01617     <span class="comment">/*</span>
-<a name="l01618"></a>01618 <span class="comment">     * Generate a rectified wavelength map from the wavelength calibration </span>
-<a name="l01619"></a>01619 <span class="comment">     * table</span>
-<a name="l01620"></a>01620 <span class="comment">     */</span>
-<a name="l01621"></a>01621 
-<a name="l01622"></a>01622     rainbow = <a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength, 
-<a name="l01623"></a>01623                                endwavelength);
-<a name="l01624"></a>01624 
-<a name="l01625"></a>01625     <span class="keywordflow">if</span> (dispersion > 1.0)
-<a name="l01626"></a>01626         highres = 0;
-<a name="l01627"></a>01627     <span class="keywordflow">else</span>
-<a name="l01628"></a>01628         highres = 1;
-<a name="l01629"></a>01629 
-<a name="l01630"></a>01630     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01631"></a>01631         <span class="keywordflow">if</span> (skyalign) {
-<a name="l01632"></a>01632             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l01633"></a>01633             <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);
-<a name="l01634"></a>01634         }
-<a name="l01635"></a>01635         <span class="keywordflow">else</span> {
-<a name="l01636"></a>01636             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l01637"></a>01637             <span class="stringliteral">"skylines applying median offset..."</span>);
-<a name="l01638"></a>01638         }
-<a name="l01639"></a>01639 
-<a name="l01640"></a>01640         <span class="keywordflow">if</span> (lss || treat_as_lss) {
-<a name="l01641"></a>01641             offsets = <a class="code" href="group__moses.html#g2523d130beaf8538187729f767c38805">mos_wavelength_align_lss</a>(smapped, reference, 
-<a name="l01642"></a>01642                                                startwavelength, endwavelength, 
-<a name="l01643"></a>01643                                                idscoeff, lines, highres, 
-<a name="l01644"></a>01644                                                skyalign, rainbow, 4);
-<a name="l01645"></a>01645         }
-<a name="l01646"></a>01646         <span class="keywordflow">else</span> {
-<a name="l01647"></a>01647             offsets = <a class="code" href="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3">mos_wavelength_align</a>(smapped, slits, reference, 
-<a name="l01648"></a>01648                                            startwavelength, endwavelength, 
-<a name="l01649"></a>01649                                            idscoeff, lines, highres, skyalign, 
-<a name="l01650"></a>01650                                            rainbow, 4);
-<a name="l01651"></a>01651         }
-<a name="l01652"></a>01652 
-<a name="l01653"></a>01653         <span class="keywordflow">if</span> (offsets) {
-<a name="l01654"></a>01654             <span class="keywordflow">if</span> (standard)
-<a name="l01655"></a>01655                 cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span>
-<a name="l01656"></a>01656                                 <span class="stringliteral">"to reference sky lines may be unreliable in "</span>
-<a name="l01657"></a>01657                                 <span class="stringliteral">"this case!"</span>);
-<a name="l01658"></a>01658 
-<a name="l01659"></a>01659             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, offsets, skylines_offsets_tag, NULL, 
-<a name="l01660"></a>01660                                parlist, recipe, version))
-<a name="l01661"></a>01661                 fors_science_exit(NULL);
-<a name="l01662"></a>01662 
-<a name="l01663"></a>01663             cpl_table_delete(offsets); offsets = NULL;
-<a name="l01664"></a>01664         }
-<a name="l01665"></a>01665         <span class="keywordflow">else</span> {
-<a name="l01666"></a>01666             <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01667"></a>01667                 <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_INCOMPATIBLE_INPUT) {
-<a name="l01668"></a>01668                     cpl_msg_error(recipe, <span class="stringliteral">"The IDS coeff table is "</span>
-<a name="l01669"></a>01669                     <span class="stringliteral">"incompatible with the input slit position table."</span>);
-<a name="l01670"></a>01670                 }
-<a name="l01671"></a>01671                 cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01672"></a>01672                 fors_science_exit(NULL);
-<a name="l01673"></a>01673             }
-<a name="l01674"></a>01674             cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span>
-<a name="l01675"></a>01675                             <span class="stringliteral">"to reference sky lines could not be done!"</span>);
-<a name="l01676"></a>01676             skyalign = -1;
-<a name="l01677"></a>01677         }
-<a name="l01678"></a>01678 
-<a name="l01679"></a>01679     }
-<a name="l01680"></a>01680 
-<a name="l01681"></a>01681     <span class="keywordflow">if</span> (lss || treat_as_lss) {
-<a name="l01682"></a>01682         <span class="keywordtype">int</span> first_row = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, 0, NULL);
-<a name="l01683"></a>01683         <span class="keywordtype">int</span> last_row = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, 0, NULL);
-<a name="l01684"></a>01684         <span class="keywordtype">int</span> ylow, yhig;
-<a name="l01685"></a>01685 
-<a name="l01686"></a>01686         ylow = first_row + 1;
-<a name="l01687"></a>01687         yhig = last_row + 1;
-<a name="l01688"></a>01688 
-<a name="l01689"></a>01689         wavemap = cpl_image_new(ccd_xsize, ccd_ysize, CPL_TYPE_FLOAT);
-<a name="l01690"></a>01690         cpl_image_copy(wavemap, rainbow, 1, ylow);
-<a name="l01691"></a>01691 
-<a name="l01692"></a>01692         wavemaplss = cpl_image_extract(wavemap, 1, ylow, nx, yhig);
-<a name="l01693"></a>01693     }
-<a name="l01694"></a>01694     <span class="keywordflow">else</span> {
-<a name="l01695"></a>01695         wavemap = <a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(coordinate, rainbow, slits, 
-<a name="l01696"></a>01696                                       polytraces, reference, 
-<a name="l01697"></a>01697                                       startwavelength, endwavelength,
-<a name="l01698"></a>01698                                       dispersion);
-<a name="l01699"></a>01699     }
-<a name="l01700"></a>01700 
-<a name="l01701"></a>01701     cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l01702"></a>01702     cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l01703"></a>01703 
-<a name="l01704"></a>01704     <span class="comment">/*</span>
-<a name="l01705"></a>01705 <span class="comment">     * Here the wavelength calibrated slit spectra are created. This frame</span>
-<a name="l01706"></a>01706 <span class="comment">     * contains sky_science.</span>
-<a name="l01707"></a>01707 <span class="comment">     */</span>
-<a name="l01708"></a>01708 
-<a name="l01709"></a>01709     mapped_sky = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, reference,
-<a name="l01710"></a>01710                                             startwavelength, endwavelength,
-<a name="l01711"></a>01711                                             dispersion, idscoeff, flux);
-<a name="l01712"></a>01712 
-<a name="l01713"></a>01713     cpl_msg_indent_less();
-<a name="l01714"></a>01714     cpl_msg_info(recipe, <span class="stringliteral">"Check applied wavelength against skylines..."</span>);
-<a name="l01715"></a>01715     cpl_msg_indent_more();
-<a name="l01716"></a>01716 
-<a name="l01717"></a>01717     mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(mapped_sky, lines, startwavelength,
-<a name="l01718"></a>01718                                    dispersion, 6, highres);
-<a name="l01719"></a>01719 
-<a name="l01720"></a>01720     cpl_vector_delete(lines); lines = NULL;
-<a name="l01721"></a>01721 
-<a name="l01722"></a>01722     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f"</span>, mean_rms);
-<a name="l01723"></a>01723 
-<a name="l01724"></a>01724     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l01725"></a>01725 
-<a name="l01726"></a>01726     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,
-<a name="l01727"></a>01727                  mean_rms, mean_rms * dispersion);
-<a name="l01728"></a>01728 
-<a name="l01729"></a>01729     header = cpl_propertylist_new();
-<a name="l01730"></a>01730     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01731"></a>01731     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01732"></a>01732     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01733"></a>01733                                    startwavelength + dispersion/2);
-<a name="l01734"></a>01734     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01735"></a>01735     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01736"></a>01736 <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01737"></a>01737     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01738"></a>01738     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01739"></a>01739     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01740"></a>01740     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01741"></a>01741     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01742"></a>01742     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01743"></a>01743 
-<a name="l01744"></a>01744     <span class="keywordflow">if</span> (time_normalise) {
-<a name="l01745"></a>01745         cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU/s"</span>);
-<a name="l01746"></a>01746         dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);
-<a name="l01747"></a>01747         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, dummy, mapped_science_sky_tag, header, 
-<a name="l01748"></a>01748                            parlist, recipe, version))
-<a name="l01749"></a>01749             fors_science_exit(NULL);
-<a name="l01750"></a>01750         cpl_image_delete(dummy); dummy = NULL;
-<a name="l01751"></a>01751     }
-<a name="l01752"></a>01752     <span class="keywordflow">else</span> {
-<a name="l01753"></a>01753         cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU"</span>);
-<a name="l01754"></a>01754         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped_sky, mapped_science_sky_tag, 
-<a name="l01755"></a>01755                            header, parlist, recipe, version))
-<a name="l01756"></a>01756             fors_science_exit(NULL);
-<a name="l01757"></a>01757     }
-<a name="l01758"></a>01758 
-<a name="l01759"></a>01759 <span class="comment">/*    if (skyglobal == 0 && skymedian < 0) {    NSS */</span>
-<a name="l01760"></a>01760     <span class="keywordflow">if</span> (skyglobal == 0 && skymedian == 0 && skylocal == 0) {
-<a name="l01761"></a>01761         cpl_image_delete(mapped_sky); mapped_sky = NULL;
-<a name="l01762"></a>01762     }
-<a name="l01763"></a>01763 
-<a name="l01764"></a>01764     <span class="keywordflow">if</span> (skyglobal || skylocal) {
-<a name="l01765"></a>01765 
-<a name="l01766"></a>01766         cpl_msg_indent_less();
-<a name="l01767"></a>01767 
-<a name="l01768"></a>01768         <span class="keywordflow">if</span> (skyglobal) {
-<a name="l01769"></a>01769             cpl_msg_info(recipe, <span class="stringliteral">"Global sky determination..."</span>);
-<a name="l01770"></a>01770             cpl_msg_indent_more();
-<a name="l01771"></a>01771             skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01772"></a>01772             <span class="keywordflow">if</span> (lss || treat_as_lss) {
-<a name="l01773"></a>01773                 sky = <a class="code" href="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1">mos_sky_map_super</a>(spectra, wavemaplss, dispersion, 
-<a name="l01774"></a>01774                                         2.0, 50, skymap);
-<a name="l01775"></a>01775             }
-<a name="l01776"></a>01776             <span class="keywordflow">else</span> {
-<a name="l01777"></a>01777                 sky = <a class="code" href="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1">mos_sky_map_super</a>(spectra, wavemap, dispersion, 
-<a name="l01778"></a>01778                                         2.0, 50, skymap);
-<a name="l01779"></a>01779             }
-<a name="l01780"></a>01780             <span class="keywordflow">if</span> (sky) {
-<a name="l01781"></a>01781                 cpl_image_subtract(spectra, skymap);
-<a name="l01782"></a>01782             }
-<a name="l01783"></a>01783             <span class="keywordflow">else</span> {
-<a name="l01784"></a>01784                 cpl_image_delete(skymap); skymap = NULL;
-<a name="l01785"></a>01785             }
-<a name="l01786"></a>01786         }
-<a name="l01787"></a>01787         <span class="keywordflow">else</span> {
-<a name="l01788"></a>01788             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l01789"></a>01789             cpl_msg_indent_more();
-<a name="l01790"></a>01790             skymap = <a class="code" href="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f">mos_subtract_sky</a>(spectra, slits, polytraces, reference,
-<a name="l01791"></a>01791                            startwavelength, endwavelength, dispersion);
-<a name="l01792"></a>01792         }
-<a name="l01793"></a>01793 
-<a name="l01794"></a>01794         <span class="keywordflow">if</span> (skymap) {
-<a name="l01795"></a>01795             <span class="keywordflow">if</span> (skyglobal) {
-<a name="l01796"></a>01796                 <span class="keywordflow">if</span> (time_normalise)
-<a name="l01797"></a>01797                     cpl_table_divide_scalar(sky, <span class="stringliteral">"sky"</span>, alltime);
-<a name="l01798"></a>01798                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, sky, global_sky_spectrum_tag, 
-<a name="l01799"></a>01799                                    NULL, parlist, recipe, version))
-<a name="l01800"></a>01800                     fors_science_exit(NULL);
-<a name="l01801"></a>01801     
-<a name="l01802"></a>01802                 cpl_table_delete(sky); sky = NULL;
-<a name="l01803"></a>01803             }
-<a name="l01804"></a>01804 
-<a name="l01805"></a>01805             save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01806"></a>01806 
-<a name="l01807"></a>01807             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01808"></a>01808                 cpl_image_divide_scalar(skymap, alltime);
-<a name="l01809"></a>01809             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, skymap, unmapped_sky_tag,
-<a name="l01810"></a>01810                                save_header, parlist, recipe, version))
-<a name="l01811"></a>01811                 fors_science_exit(NULL);
-<a name="l01812"></a>01812 
-<a name="l01813"></a>01813             cpl_image_delete(skymap); skymap = NULL;
-<a name="l01814"></a>01814 
-<a name="l01815"></a>01815             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, spectra, unmapped_science_tag,
-<a name="l01816"></a>01816                                save_header, parlist, recipe, version))
-<a name="l01817"></a>01817                 fors_science_exit(NULL);
-<a name="l01818"></a>01818 
-<a name="l01819"></a>01819             cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01820"></a>01820 
-<a name="l01821"></a>01821             <span class="keywordflow">if</span> (cosmics) {
-<a name="l01822"></a>01822                 cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);
-<a name="l01823"></a>01823                 <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(spectra, gain, -1., -1.);
-<a name="l01824"></a>01824             }
-<a name="l01825"></a>01825 
-<a name="l01826"></a>01826             <span class="comment">/*</span>
-<a name="l01827"></a>01827 <span class="comment">             * The spatially rectified image, that contained the sky,</span>
-<a name="l01828"></a>01828 <span class="comment">             * is replaced by a sky-subtracted spatially rectified image:</span>
-<a name="l01829"></a>01829 <span class="comment">             */</span>
-<a name="l01830"></a>01830 
-<a name="l01831"></a>01831             cpl_image_delete(smapped); smapped = NULL;
-<a name="l01832"></a>01832 
-<a name="l01833"></a>01833             <span class="keywordflow">if</span> (lss || treat_as_lss) {
-<a name="l01834"></a>01834                 smapped = cpl_image_duplicate(spectra);
-<a name="l01835"></a>01835             }
-<a name="l01836"></a>01836             <span class="keywordflow">else</span> {
-<a name="l01837"></a>01837                 smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, 
-<a name="l01838"></a>01838                                                   reference, startwavelength, 
-<a name="l01839"></a>01839                                                   endwavelength, dispersion, 
-<a name="l01840"></a>01840                                                   flux, NULL);
-<a name="l01841"></a>01841             }
-<a name="l01842"></a>01842         }
-<a name="l01843"></a>01843         <span class="keywordflow">else</span> {
-<a name="l01844"></a>01844             cpl_msg_warning(recipe, <span class="stringliteral">"Sky subtraction failure"</span>);
-<a name="l01845"></a>01845             <span class="keywordflow">if</span> (cosmics)
-<a name="l01846"></a>01846                 cpl_msg_warning(recipe, <span class="stringliteral">"Cosmic rays removal not performed!"</span>);
-<a name="l01847"></a>01847             cosmics = skylocal = skyglobal = 0;
-<a name="l01848"></a>01848         }
-<a name="l01849"></a>01849     }
-<a name="l01850"></a>01850 
-<a name="l01851"></a>01851     cpl_image_delete(spectra); spectra = NULL;
-<a name="l01852"></a>01852     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l01853"></a>01853     <span class="keywordflow">if</span> (lss || treat_as_lss) 
-<a name="l01854"></a>01854         cpl_image_delete(wavemaplss); wavemaplss = NULL;
-<a name="l01855"></a>01855 
-<a name="l01856"></a>01856     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01857"></a>01857         save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01858"></a>01858         cpl_propertylist_update_string(save_header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"Angstrom"</span>);
-<a name="l01859"></a>01859         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, wavemap, wavelength_map_sky_tag,
-<a name="l01860"></a>01860                            save_header, parlist, recipe, version))
-<a name="l01861"></a>01861             fors_science_exit(NULL);
-<a name="l01862"></a>01862         cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01863"></a>01863     }
-<a name="l01864"></a>01864 
-<a name="l01865"></a>01865     cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l01866"></a>01866 
-<a name="l01867"></a>01867     mapped = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, reference,
-<a name="l01868"></a>01868                                         startwavelength, endwavelength,
-<a name="l01869"></a>01869                                         dispersion, idscoeff, flux);
-<a name="l01870"></a>01870 
-<a name="l01871"></a>01871     cpl_image_delete(smapped); smapped = NULL;
-<a name="l01872"></a>01872 
-<a name="l01873"></a>01873 <span class="comment">/*    if (skymedian >= 0) {    NSS */</span>
-<a name="l01874"></a>01874     <span class="keywordflow">if</span> (skymedian) {
-<a name="l01875"></a>01875             cpl_msg_indent_less();
-<a name="l01876"></a>01876             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l01877"></a>01877             cpl_msg_indent_more();
-<a name="l01878"></a>01878        
-<a name="l01879"></a>01879 <span class="comment">/*   NSS      skylocalmap = mos_sky_local(mapped, slits, skymedian); */</span>
-<a name="l01880"></a>01880 <span class="comment">/*            skylocalmap = mos_sky_local(mapped, slits, 0);        */</span>
-<a name="l01881"></a>01881             skylocalmap = <a class="code" href="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a">mos_sky_local_old</a>(mapped, slits);       
-<a name="l01882"></a>01882             cpl_image_subtract(mapped, skylocalmap);
-<a name="l01883"></a>01883 <span class="comment">/*</span>
-<a name="l01884"></a>01884 <span class="comment">            if (dfs_save_image(frameset, skylocalmap, mapped_sky_tag, header, </span>
-<a name="l01885"></a>01885 <span class="comment">                               parlist, recipe, version))</span>
-<a name="l01886"></a>01886 <span class="comment">                fors_science_exit(NULL);</span>
-<a name="l01887"></a>01887 <span class="comment">*/</span>
-<a name="l01888"></a>01888             cpl_image_delete(skylocalmap); skylocalmap = NULL;
-<a name="l01889"></a>01889     }
-<a name="l01890"></a>01890 
-<a name="l01891"></a>01891 <span class="comment">/*    if (skyglobal || skymedian >= 0 || skylocal) {   NSS */</span>
-<a name="l01892"></a>01892     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {
-<a name="l01893"></a>01893 
-<a name="l01894"></a>01894         skylocalmap = cpl_image_subtract_create(mapped_sky, mapped);
-<a name="l01895"></a>01895 
-<a name="l01896"></a>01896         cpl_image_delete(mapped_sky); mapped_sky = NULL;
-<a name="l01897"></a>01897 
-<a name="l01898"></a>01898         <span class="keywordflow">if</span> (time_normalise) {
-<a name="l01899"></a>01899             cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU/s"</span>);
-<a name="l01900"></a>01900             dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);
-<a name="l01901"></a>01901             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, dummy, mapped_sky_tag, header,
-<a name="l01902"></a>01902                                parlist, recipe, version))
-<a name="l01903"></a>01903                 fors_science_exit(NULL);
-<a name="l01904"></a>01904             cpl_image_delete(dummy); dummy = NULL;
-<a name="l01905"></a>01905         }
-<a name="l01906"></a>01906         <span class="keywordflow">else</span> {
-<a name="l01907"></a>01907             cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU"</span>);
-<a name="l01908"></a>01908             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, skylocalmap, mapped_sky_tag, header,
-<a name="l01909"></a>01909                                parlist, recipe, version))
-<a name="l01910"></a>01910                 fors_science_exit(NULL);
-<a name="l01911"></a>01911         }
-<a name="l01912"></a>01912 
-<a name="l01913"></a>01913         cpl_msg_indent_less();
-<a name="l01914"></a>01914         cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);
-<a name="l01915"></a>01915         cpl_msg_indent_more();
-<a name="l01916"></a>01916 
-<a name="l01917"></a>01917         <span class="keywordflow">if</span> (cosmics || nscience > 1) {
-<a name="l01918"></a>01918             dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped, slits, slit_margin, ext_radius, 
-<a name="l01919"></a>01919                                        cont_radius);
-<a name="l01920"></a>01920         }
-<a name="l01921"></a>01921         <span class="keywordflow">else</span> {
-<a name="l01922"></a>01922             mapped_cleaned = cpl_image_duplicate(mapped);
-<a name="l01923"></a>01923             <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);
-<a name="l01924"></a>01924             dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin, 
-<a name="l01925"></a>01925                                        ext_radius, cont_radius);
-<a name="l01926"></a>01926 
-<a name="l01927"></a>01927             cpl_image_delete(mapped_cleaned); mapped_cleaned = NULL;
-<a name="l01928"></a>01928         }
-<a name="l01929"></a>01929 
-<a name="l01930"></a>01930         cpl_image_delete(dummy); dummy = NULL;
-<a name="l01931"></a>01931 
-<a name="l01932"></a>01932         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, object_table_tag, NULL, parlist, 
-<a name="l01933"></a>01933                            recipe, version))
-<a name="l01934"></a>01934             fors_science_exit(NULL);
-<a name="l01935"></a>01935 
-<a name="l01936"></a>01936         cpl_msg_indent_less();
-<a name="l01937"></a>01937         cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);
-<a name="l01938"></a>01938         cpl_msg_indent_more();
-<a name="l01939"></a>01939 
-<a name="l01940"></a>01940         images = <a class="code" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">mos_extract_objects</a>(mapped, skylocalmap, slits, 
-<a name="l01941"></a>01941                                      ext_mode, ron, gain, 1);
-<a name="l01942"></a>01942 
-<a name="l01943"></a>01943         cpl_image_delete(skylocalmap); skylocalmap = NULL;
-<a name="l01944"></a>01944 
-<a name="l01945"></a>01945         <span class="keywordflow">if</span> (images) {
-<a name="l01946"></a>01946             <span class="keywordflow">if</span> (standard) {
-<a name="l01947"></a>01947                 cpl_table *ext_table  = NULL;
-<a name="l01948"></a>01948                 cpl_table *flux_table = NULL;
-<a name="l01949"></a>01949 
-<a name="l01950"></a>01950                 ext_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>, 1);
-<a name="l01951"></a>01951                 flux_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>, 1);
-<a name="l01952"></a>01952 
-<a name="l01953"></a>01953                 photcal = <a class="code" href="group__moses.html#gf3dd5a20a5f31b853c53ca419a8171e3">mos_photometric_calibration</a>(images[0], 
-<a name="l01954"></a>01954                                                       startwavelength,
-<a name="l01955"></a>01955                                                       dispersion, gain,
-<a name="l01956"></a>01956                                                       alltime, ext_table,
-<a name="l01957"></a>01957                                                       airmass, flux_table,
-<a name="l01958"></a>01958                                                       res_order);
-<a name="l01959"></a>01959 
-<a name="l01960"></a>01960                 cpl_table_delete(ext_table);
-<a name="l01961"></a>01961                 cpl_table_delete(flux_table);
-<a name="l01962"></a>01962 
-<a name="l01963"></a>01963                 <span class="keywordflow">if</span> (photcal) {
-<a name="l01964"></a>01964 
-<a name="l01965"></a>01965                     <span class="keywordtype">float</span> *data;
-<a name="l01966"></a>01966                     <span class="keywordtype">char</span>  *pipefile = NULL;
-<a name="l01967"></a>01967                     <span class="keywordtype">char</span>   keyname[30];
-<a name="l01968"></a>01968 
-<a name="l01969"></a>01969                     qclist = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01970"></a>01970 
-<a name="l01971"></a>01971                     <span class="keywordflow">if</span> (qclist == NULL)
-<a name="l01972"></a>01972                         fors_science_exit(<span class="stringliteral">"Cannot reload scientific "</span>
-<a name="l01973"></a>01973                                 <span class="stringliteral">"frame header"</span>);
-<a name="l01974"></a>01974 
-<a name="l01975"></a>01975                     <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qclist, <span class="stringliteral">"2.0"</span>, instrume);
-<a name="l01976"></a>01976 
-<a name="l01977"></a>01977 
-<a name="l01978"></a>01978                     <span class="comment">/*</span>
-<a name="l01979"></a>01979 <span class="comment">                     * QC1 group header</span>
-<a name="l01980"></a>01980 <span class="comment">                     */</span>
-<a name="l01981"></a>01981 
-<a name="l01982"></a>01982                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, specphot_tag,
-<a name="l01983"></a>01983                             <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l01984"></a>01984                         fors_science_exit(<span class="stringliteral">"Cannot write product category "</span>
-<a name="l01985"></a>01985                                 <span class="stringliteral">"to QC log file"</span>);
-<a name="l01986"></a>01986 
-<a name="l01987"></a>01987                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l01988"></a>01988                             <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l01989"></a>01989                         fors_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span>
-<a name="l01990"></a>01990                                 <span class="stringliteral">"scientific frame header"</span>);
-<a name="l01991"></a>01991 
-<a name="l01992"></a>01992                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l01993"></a>01993                             <span class="stringliteral">"Template"</span>, instrume))
-<a name="l01994"></a>01994                         fors_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span>
-<a name="l01995"></a>01995                                 <span class="stringliteral">"scientific frame header"</span>);
-<a name="l01996"></a>01996 
-<a name="l01997"></a>01997                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, 
-<a name="l01998"></a>01998                             <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,
-<a name="l01999"></a>01999                             <span class="stringliteral">"Grism name"</span>, instrume))
-<a name="l02000"></a>02000                         fors_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME "</span>
-<a name="l02001"></a>02001                                 <span class="stringliteral">"in scientific frame header"</span>);
-<a name="l02002"></a>02002 
-<a name="l02003"></a>02003                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, 
-<a name="l02004"></a>02004                             <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,
-<a name="l02005"></a>02005                             <span class="stringliteral">"Grism identifier"</span>, 
-<a name="l02006"></a>02006                             instrume))
-<a name="l02007"></a>02007                         fors_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID "</span>
-<a name="l02008"></a>02008                                 <span class="stringliteral">"in scientific frame header"</span>);
-<a name="l02009"></a>02009 
-<a name="l02010"></a>02010                     <span class="keywordflow">if</span> (cpl_propertylist_has(qclist, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))
-<a name="l02011"></a>02011                         <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, 
-<a name="l02012"></a>02012                                 <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,
-<a name="l02013"></a>02013                                 <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l02014"></a>02014 
-<a name="l02015"></a>02015                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, 
-<a name="l02016"></a>02016                             <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,
-<a name="l02017"></a>02017                             <span class="stringliteral">"Collimator name"</span>, 
-<a name="l02018"></a>02018                             instrume))
-<a name="l02019"></a>02019                         fors_science_exit(<span class="stringliteral">"Missing keyword INS COLL NAME "</span>
-<a name="l02020"></a>02020                                 <span class="stringliteral">"in scientific frame header"</span>);
-<a name="l02021"></a>02021 
-<a name="l02022"></a>02022                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, 
-<a name="l02023"></a>02023                             <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l02024"></a>02024                             <span class="stringliteral">"Chip identifier"</span>, 
-<a name="l02025"></a>02025                             instrume))
-<a name="l02026"></a>02026                         fors_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID "</span>
-<a name="l02027"></a>02027                                 <span class="stringliteral">"in scientific frame header"</span>);
-<a name="l02028"></a>02028 
-<a name="l02029"></a>02029                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, 
-<a name="l02030"></a>02030                             <span class="stringliteral">"ESO INS MOS10 WID"</span>,
-<a name="l02031"></a>02031                             <span class="stringliteral">"arcsec"</span>, <span class="stringliteral">"Slit width"</span>, 
-<a name="l02032"></a>02032                             instrume)) {
-<a name="l02033"></a>02033                         cpl_error_reset();
-<a name="l02034"></a>02034                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, 
-<a name="l02035"></a>02035                                 <span class="stringliteral">"ESO INS SLIT WID"</span>,
-<a name="l02036"></a>02036                                 <span class="stringliteral">"arcsec"</span>, <span class="stringliteral">"Slit width"</span>, 
-<a name="l02037"></a>02037                                 instrume)) {
-<a name="l02038"></a>02038                             <span class="keywordflow">if</span> (mos) {
-<a name="l02039"></a>02039                                 fors_science_exit(<span class="stringliteral">"Missing keyword "</span>
-<a name="l02040"></a>02040                                         <span class="stringliteral">"ESO INS MOS10 WID in "</span>
-<a name="l02041"></a>02041                                         <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02042"></a>02042                             }
-<a name="l02043"></a>02043                             <span class="keywordflow">else</span> {
-<a name="l02044"></a>02044                                 fors_science_exit(<span class="stringliteral">"Missing keyword "</span>
-<a name="l02045"></a>02045                                         <span class="stringliteral">"ESO INS SLIT WID in "</span>
-<a name="l02046"></a>02046                                         <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02047"></a>02047                             }
-<a name="l02048"></a>02048                         }
-<a name="l02049"></a>02049                     }
-<a name="l02050"></a>02050 
-<a name="l02051"></a>02051                     <span class="comment">/*</span>
-<a name="l02052"></a>02052 <span class="comment">                        if (mos) {</span>
-<a name="l02053"></a>02053 <span class="comment">                            if (fors_qc_keyword_to_paf(qclist, </span>
-<a name="l02054"></a>02054 <span class="comment">                                                       "ESO INS MOS10 WID",</span>
-<a name="l02055"></a>02055 <span class="comment">                                                       "arcsec", "Slit width", </span>
-<a name="l02056"></a>02056 <span class="comment">                                                       instrume))</span>
-<a name="l02057"></a>02057 <span class="comment">                                fors_science_exit("Missing keyword "</span>
-<a name="l02058"></a>02058 <span class="comment">                                                  "ESO INS MOS10 WID in "</span>
-<a name="l02059"></a>02059 <span class="comment">                                                  "scientific frame header");</span>
-<a name="l02060"></a>02060 <span class="comment">                        }</span>
-<a name="l02061"></a>02061 <span class="comment">                        else {</span>
-<a name="l02062"></a>02062 <span class="comment">                            if (fors_qc_keyword_to_paf(qclist, </span>
-<a name="l02063"></a>02063 <span class="comment">                                                       "ESO INS SLIT WID",</span>
-<a name="l02064"></a>02064 <span class="comment">                                                       "arcsec", "Slit width", </span>
-<a name="l02065"></a>02065 <span class="comment">                                                       instrume))</span>
-<a name="l02066"></a>02066 <span class="comment">                                fors_science_exit("Missing keyword "</span>
-<a name="l02067"></a>02067 <span class="comment">                                                  "ESO INS SLIT WID in "</span>
-<a name="l02068"></a>02068 <span class="comment">                                                  "scientific frame header");</span>
-<a name="l02069"></a>02069 <span class="comment">                        }</span>
-<a name="l02070"></a>02070 <span class="comment">                     */</span>
-<a name="l02071"></a>02071 
-<a name="l02072"></a>02072                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, 
-<a name="l02073"></a>02073                             <span class="stringliteral">"ESO DET WIN1 BINX"</span>, NULL,
-<a name="l02074"></a>02074                             <span class="stringliteral">"Binning factor along X"</span>, 
-<a name="l02075"></a>02075                             instrume))
-<a name="l02076"></a>02076                         fors_science_exit(<span class="stringliteral">"Missing keyword ESO "</span>
-<a name="l02077"></a>02077                                 <span class="stringliteral">"DET WIN1 BINX "</span>
-<a name="l02078"></a>02078                                 <span class="stringliteral">"in scientific frame header"</span>);
-<a name="l02079"></a>02079 
-<a name="l02080"></a>02080                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, 
-<a name="l02081"></a>02081                             <span class="stringliteral">"ESO DET WIN1 BINY"</span>, NULL,
-<a name="l02082"></a>02082                             <span class="stringliteral">"Binning factor along Y"</span>, 
-<a name="l02083"></a>02083                             instrume))
-<a name="l02084"></a>02084                         fors_science_exit(<span class="stringliteral">"Missing keyword "</span>
-<a name="l02085"></a>02085                                 <span class="stringliteral">"ESO DET WIN1 BINY "</span>
-<a name="l02086"></a>02086                                 <span class="stringliteral">"in scientific frame header"</span>);
-<a name="l02087"></a>02087 
-<a name="l02088"></a>02088                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l02089"></a>02089                             <span class="stringliteral">"Archive name of input data"</span>,
-<a name="l02090"></a>02090                             instrume))
-<a name="l02091"></a>02091                         fors_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span>
-<a name="l02092"></a>02092                                 <span class="stringliteral">"scientific frame header"</span>);
-<a name="l02093"></a>02093 
-<a name="l02094"></a>02094                     pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(specphot_tag);
-<a name="l02095"></a>02095                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l02096"></a>02096                             <span class="stringliteral">"Pipeline product name"</span>, 
-<a name="l02097"></a>02097                             instrume))
-<a name="l02098"></a>02098                         fors_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span>
-<a name="l02099"></a>02099                                 <span class="stringliteral">"QC log file"</span>);
-<a name="l02100"></a>02100                     cpl_free(pipefile);
-<a name="l02101"></a>02101 
-<a name="l02102"></a>02102 
-<a name="l02103"></a>02103                     <span class="comment">/*</span>
-<a name="l02104"></a>02104 <span class="comment">                     * QC1 parameters</span>
-<a name="l02105"></a>02105 <span class="comment">                     */</span>
-<a name="l02106"></a>02106 
-<a name="l02107"></a>02107                     wstart = 3700.;
-<a name="l02108"></a>02108                     wstep  = 400.;
-<a name="l02109"></a>02109                     wcount = 15;
-<a name="l02110"></a>02110 
-<a name="l02111"></a>02111                     dummy = cpl_image_new(wcount, 1, CPL_TYPE_FLOAT);
-<a name="l02112"></a>02112                     data = cpl_image_get_data_float(dummy);
-<a name="l02113"></a>02113                     <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(dummy, wstart, wstep, photcal, 
-<a name="l02114"></a>02114                               <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"EFFICIENCY"</span>);
-<a name="l02115"></a>02115 
-<a name="l02116"></a>02116                     <span class="keywordflow">for</span> (i = 0; i < wcount; i++) {
-<a name="l02117"></a>02117                         sprintf(keyname, <span class="stringliteral">"QC.SPEC.EFFICIENCY%d.LAMBDA"</span>, 
-<a name="l02118"></a>02118                                 i + 1);
-<a name="l02119"></a>02119                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qclist, 
-<a name="l02120"></a>02120                                 wstart + wstep * i,
-<a name="l02121"></a>02121                                 keyname, <span class="stringliteral">"Angstrom"</span>,
-<a name="l02122"></a>02122                                 <span class="stringliteral">"Wavelength of "</span>
-<a name="l02123"></a>02123                                 <span class="stringliteral">"efficiency evaluation"</span>,
-<a name="l02124"></a>02124                                 instrume)) {
-<a name="l02125"></a>02125                             fors_science_exit(<span class="stringliteral">"Cannot write wavelength of "</span>
-<a name="l02126"></a>02126                                     <span class="stringliteral">"efficiency evaluation"</span>);
-<a name="l02127"></a>02127                         }
-<a name="l02128"></a>02128 
-<a name="l02129"></a>02129                         sprintf(keyname, <span class="stringliteral">"QC.SPEC.EFFICIENCY%d"</span>, i + 1);
-<a name="l02130"></a>02130                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qclist,
-<a name="l02131"></a>02131                                 data[i],
-<a name="l02132"></a>02132                                 keyname, <span class="stringliteral">"e-/photon"</span>,
-<a name="l02133"></a>02133                                 <span class="stringliteral">"Efficiency"</span>,
-<a name="l02134"></a>02134                                 instrume)) {
-<a name="l02135"></a>02135                             fors_science_exit(<span class="stringliteral">"Cannot write wavelength of "</span>
-<a name="l02136"></a>02136                                     <span class="stringliteral">"efficiency evaluation"</span>);
-<a name="l02137"></a>02137                         }
-<a name="l02138"></a>02138                     }
-<a name="l02139"></a>02139 
-<a name="l02140"></a>02140                     cpl_image_delete(dummy); dummy = NULL;
-<a name="l02141"></a>02141 
-<a name="l02142"></a>02142                     <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l02143"></a>02143         
-<a name="l02144"></a>02144                     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, photcal, specphot_tag, qclist,
-<a name="l02145"></a>02145                                        parlist, recipe, version))
-<a name="l02146"></a>02146                         fors_science_exit(NULL);
-<a name="l02147"></a>02147 
-<a name="l02148"></a>02148                     cpl_propertylist_delete(qclist); qclist = NULL;
-<a name="l02149"></a>02149 
-<a name="l02150"></a>02150                     <span class="keywordflow">if</span> (have_phot) {
-<a name="l02151"></a>02151                         cpl_table_delete(photcal); photcal = NULL;
-<a name="l02152"></a>02152                     }
-<a name="l02153"></a>02153                 }
-<a name="l02154"></a>02154             }
-<a name="l02155"></a>02155 
-<a name="l02156"></a>02156             <span class="keywordflow">if</span> (photometry) {
-<a name="l02157"></a>02157                 cpl_image *calibrated;
-<a name="l02158"></a>02158                 cpl_table *ext_table;
-<a name="l02159"></a>02159 
-<a name="l02160"></a>02160                 ext_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>, 1);
-<a name="l02161"></a>02161 
-<a name="l02162"></a>02162                 <span class="keywordflow">if</span> (have_phot) {
-<a name="l02163"></a>02163                     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, specphot_tag) == 0) {
-<a name="l02164"></a>02164                         photcal = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, 
-<a name="l02165"></a>02165                                                  master_specphot_tag, 1);
-<a name="l02166"></a>02166                     }
-<a name="l02167"></a>02167                     <span class="keywordflow">else</span> {
-<a name="l02168"></a>02168                         photcal = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, specphot_tag, 1);
-<a name="l02169"></a>02169                     }
-<a name="l02170"></a>02170                 }
-<a name="l02171"></a>02171 
-<a name="l02172"></a>02172                 calibrated = <a class="code" href="group__moses.html#gd97e4b6ea81acb77e5ef8567a376482b">mos_apply_photometry</a>(images[0], photcal, 
-<a name="l02173"></a>02173                                                   ext_table, startwavelength, 
-<a name="l02174"></a>02174                                                   dispersion, gain, alltime, 
-<a name="l02175"></a>02175                                                   airmass);
-<a name="l02176"></a>02176                 cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, 
-<a name="l02177"></a>02177                                    <span class="stringliteral">"10^(-16) erg/(cm^2 s Angstrom)"</span>);
-<a name="l02178"></a>02178 
-<a name="l02179"></a>02179                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, calibrated,
-<a name="l02180"></a>02180                                    reduced_flux_science_tag, header,
-<a name="l02181"></a>02181                                    parlist, recipe, version)) {
-<a name="l02182"></a>02182                     cpl_image_delete(calibrated);
-<a name="l02183"></a>02183                     fors_science_exit(NULL);
-<a name="l02184"></a>02184                 }
-<a name="l02185"></a>02185 
-<a name="l02186"></a>02186                 cpl_table_delete(ext_table);
-<a name="l02187"></a>02187                 cpl_image_delete(calibrated);
-<a name="l02188"></a>02188             }
-<a name="l02189"></a>02189 
-<a name="l02190"></a>02190             <span class="keywordflow">if</span> (time_normalise) {
-<a name="l02191"></a>02191                 cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU/s"</span>);
-<a name="l02192"></a>02192                 cpl_image_divide_scalar(images[0], alltime);
-<a name="l02193"></a>02193             }
-<a name="l02194"></a>02194             <span class="keywordflow">else</span> {
-<a name="l02195"></a>02195                 cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU"</span>);
-<a name="l02196"></a>02196             }
-<a name="l02197"></a>02197 
-<a name="l02198"></a>02198             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[0], reduced_science_tag, header,
-<a name="l02199"></a>02199                                parlist, recipe, version))
-<a name="l02200"></a>02200                 fors_science_exit(NULL);
-<a name="l02201"></a>02201 
-<a name="l02202"></a>02202             <span class="keywordflow">if</span> (time_normalise)
-<a name="l02203"></a>02203                 cpl_image_divide_scalar(images[1], alltime);
-<a name="l02204"></a>02204 
-<a name="l02205"></a>02205             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[1], reduced_sky_tag, header,
-<a name="l02206"></a>02206                                parlist, recipe, version))
-<a name="l02207"></a>02207                 fors_science_exit(NULL);
-<a name="l02208"></a>02208 
-<a name="l02209"></a>02209             cpl_image_delete(images[1]);
-<a name="l02210"></a>02210 
-<a name="l02211"></a>02211             <span class="keywordflow">if</span> (photometry) {
-<a name="l02212"></a>02212                 cpl_image *calibrated;
-<a name="l02213"></a>02213                 cpl_table *ext_table; 
-<a name="l02214"></a>02214  
-<a name="l02215"></a>02215                 ext_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>, 1);
-<a name="l02216"></a>02216 
-<a name="l02217"></a>02217                 calibrated = <a class="code" href="group__moses.html#ge20fadc56d3b4506d4ffd3015f394695">mos_propagate_photometry_error</a>(images[0], 
-<a name="l02218"></a>02218                                                   images[2], photcal,
-<a name="l02219"></a>02219                                                   ext_table, startwavelength,
-<a name="l02220"></a>02220                                                   dispersion, gain, alltime,
-<a name="l02221"></a>02221                                                   airmass);
-<a name="l02222"></a>02222 
-<a name="l02223"></a>02223                 cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, 
-<a name="l02224"></a>02224                                    <span class="stringliteral">"10^(-16) erg/(cm^2 s Angstrom)"</span>);
-<a name="l02225"></a>02225 
-<a name="l02226"></a>02226                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, calibrated,
-<a name="l02227"></a>02227                                    reduced_flux_error_tag, header,
-<a name="l02228"></a>02228                                    parlist, recipe, version)) {
-<a name="l02229"></a>02229                     cpl_image_delete(calibrated);
-<a name="l02230"></a>02230                     fors_science_exit(NULL);
-<a name="l02231"></a>02231                 }
-<a name="l02232"></a>02232 
-<a name="l02233"></a>02233                 cpl_table_delete(ext_table);
-<a name="l02234"></a>02234                 cpl_image_delete(calibrated);
-<a name="l02235"></a>02235             }
-<a name="l02236"></a>02236 
-<a name="l02237"></a>02237     
-<a name="l02238"></a>02238             <span class="keywordflow">if</span> (time_normalise) {
-<a name="l02239"></a>02239                 cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU/s"</span>);
-<a name="l02240"></a>02240                 cpl_image_divide_scalar(images[2], alltime);
-<a name="l02241"></a>02241             }
-<a name="l02242"></a>02242             <span class="keywordflow">else</span> {
-<a name="l02243"></a>02243                 cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU"</span>);
-<a name="l02244"></a>02244             }
-<a name="l02245"></a>02245 
-<a name="l02246"></a>02246             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[2], reduced_error_tag, header,
-<a name="l02247"></a>02247                                parlist, recipe, version))
-<a name="l02248"></a>02248                 fors_science_exit(NULL);
-<a name="l02249"></a>02249 
-<a name="l02250"></a>02250             cpl_image_delete(images[0]);
-<a name="l02251"></a>02251             cpl_image_delete(images[2]);
-<a name="l02252"></a>02252 
-<a name="l02253"></a>02253             cpl_free(images);
-<a name="l02254"></a>02254         }
-<a name="l02255"></a>02255         <span class="keywordflow">else</span> {
-<a name="l02256"></a>02256             cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span>
-<a name="l02257"></a>02257                             <span class="stringliteral">"%s, %s, and %s are not created"</span>, 
-<a name="l02258"></a>02258                             reduced_science_tag, reduced_sky_tag, 
-<a name="l02259"></a>02259                             reduced_error_tag);
-<a name="l02260"></a>02260         }
-<a name="l02261"></a>02261 
-<a name="l02262"></a>02262     }
-<a name="l02263"></a>02263 
-<a name="l02264"></a>02264     cpl_free(instrume); instrume = NULL;
-<a name="l02265"></a>02265     cpl_table_delete(slits); slits = NULL;
-<a name="l02266"></a>02266 
-<a name="l02267"></a>02267     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l02268"></a>02268         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_coeff_sky_tag, NULL, 
-<a name="l02269"></a>02269                            parlist, recipe, version))
-<a name="l02270"></a>02270             fors_science_exit(NULL);
-<a name="l02271"></a>02271     }
-<a name="l02272"></a>02272 
-<a name="l02273"></a>02273     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l02274"></a>02274 
-<a name="l02275"></a>02275     <span class="keywordflow">if</span> (photometry && photcal) {
-<a name="l02276"></a>02276         cpl_image *calibrated;
-<a name="l02277"></a>02277         cpl_table *ext_table; 
-<a name="l02278"></a>02278 
-<a name="l02279"></a>02279         ext_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>, 1);
-<a name="l02280"></a>02280 
-<a name="l02281"></a>02281         calibrated = <a class="code" href="group__moses.html#gd97e4b6ea81acb77e5ef8567a376482b">mos_apply_photometry</a>(mapped, photcal,
-<a name="l02282"></a>02282                 ext_table, startwavelength,
-<a name="l02283"></a>02283                 dispersion, gain, alltime,
-<a name="l02284"></a>02284                 airmass);
-<a name="l02285"></a>02285 
-<a name="l02286"></a>02286         cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, 
-<a name="l02287"></a>02287                                        <span class="stringliteral">"10^(-16) erg/(cm^2 s Angstrom)"</span>);
-<a name="l02288"></a>02288 
-<a name="l02289"></a>02289         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, calibrated,
-<a name="l02290"></a>02290                 mapped_flux_science_tag, header,
-<a name="l02291"></a>02291                 parlist, recipe, version)) {
-<a name="l02292"></a>02292             cpl_image_delete(calibrated);
-<a name="l02293"></a>02293             fors_science_exit(NULL);
-<a name="l02294"></a>02294         }
-<a name="l02295"></a>02295 
-<a name="l02296"></a>02296         cpl_table_delete(ext_table);
-<a name="l02297"></a>02297         cpl_image_delete(calibrated);
-<a name="l02298"></a>02298     }
-<a name="l02299"></a>02299 
-<a name="l02300"></a>02300     <span class="keywordflow">if</span> (time_normalise) {
-<a name="l02301"></a>02301         cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU/s"</span>);
-<a name="l02302"></a>02302         cpl_image_divide_scalar(mapped, alltime);
-<a name="l02303"></a>02303     }
-<a name="l02304"></a>02304     <span class="keywordflow">else</span> {
-<a name="l02305"></a>02305         cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU"</span>);
-<a name="l02306"></a>02306     }
-<a name="l02307"></a>02307 
-<a name="l02308"></a>02308     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped, mapped_science_tag, header, 
-<a name="l02309"></a>02309             parlist, recipe, version))
-<a name="l02310"></a>02310         fors_science_exit(NULL);
-<a name="l02311"></a>02311 
-<a name="l02312"></a>02312     cpl_table_delete(photcal); photcal = NULL;
-<a name="l02313"></a>02313     cpl_image_delete(mapped); mapped = NULL;
-<a name="l02314"></a>02314     cpl_propertylist_delete(header); header = NULL;
-<a name="l02315"></a>02315 
-<a name="l02316"></a>02316     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l02317"></a>02317         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l02318"></a>02318         fors_science_exit(NULL);
-<a name="l02319"></a>02319     }
-<a name="l02320"></a>02320     <span class="keywordflow">else</span> 
-<a name="l02321"></a>02321         <span class="keywordflow">return</span> 0;
-<a name="l02322"></a>02322     <span class="keywordflow">return</span> 0;
-<a name="l02323"></a>02323 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__science_8c_source.html b/html/fors__science_8c_source.html
new file mode 100644
index 0000000..dccfcbd
--- /dev/null
+++ b/html/fors__science_8c_source.html
@@ -0,0 +1,2297 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_science.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_science.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_science.c,v 1.42 2013-08-14 15:04:57 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-14 15:04:57 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.42 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H </span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_tools.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_create(cpl_plugin *);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_science_description[] =</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"This recipe is used to reduce scientific spectra using the extraction\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"mask and the products created by the recipe fors_calib. The spectra are\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"bias subtracted, flat fielded (if a normalised flat field is specified)\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"and remapped eliminating the optical distortions. The wavelength calibration\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"can be optionally upgraded using a number of sky lines: if no sky lines\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"catalog of wavelengths is specified, an internal one is used instead.\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"If the alignment to the sky lines is performed, the input dispersion\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"coefficients table is upgraded and saved to disk, and a new CCD wavelengths\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"map is created.\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. A grism table (typically\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"depending on the instrument mode, and in particular on the grism used)\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"may also be specified: this table contains a default recipe parameter\n"</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"setting to control the way spectra are extracted for a specific instrument\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"mode, as it is used for automatic run of the pipeline on Paranal and in\n"</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"Garching. If this table is specified, it will modify the default recipe\n"</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"parameter setting, with the exception of those parameters which have been\n"</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"explicitly modifyed on the command line. If a grism table is not specified,\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"the input recipe parameters values will always be read from the command\n"</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"line, or from an esorex configuration file if present, or from their\n"</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"generic default values (that are rarely meaningful).\n"</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"In the table below the MXU acronym can be read alternatively as MOS\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"and LSS, depending on the instrument mode of the input data. The acronym\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"SCI on products should be read STD in case of standard stars observations\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"A CURV_COEFF table is not (yet) expected for LSS data.\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"Either a scientific or a standard star exposure can be specified in input.\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"Only in case of a standard star exposure input, the atmospheric extinction\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"table and a table with the physical fluxes of the observed standard star\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"must be specified in input, and a spectro-photometric table is created in\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"output. This table can then be input again to this recipe, always with an\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"atmospheric extinction table, and if a photometric calibration is requested\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="stringliteral">"then flux calibrated spectra (in units of erg/cm/cm/s/Angstrom) are also\n"</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="stringliteral">"written in output.\n\n"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="stringliteral">"  SCIENCE_MXU                Raw         Scientific exposure     Y\n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="stringliteral">"  or STANDARD_MXU            Raw         Standard star exposure  Y\n"</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="stringliteral">"  MASTER_BIAS                Calib       Master bias             Y\n"</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n"</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="stringliteral">"  MASTER_SKYLINECAT          Calib       Sky lines catalog       .\n"</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="stringliteral">"  MASTER_NORM_FLAT_MXU       Calib       Normalised flat field   .\n"</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="stringliteral">"  DISP_COEFF_MXU             Calib       Inverse dispersion      Y\n"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      Y\n"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slits positions table   Y\n"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="stringliteral">"  or, in case of LSS-like MOS/MXU data,\n"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"  MASTER_NORM_FLAT_LONG_MXU  Calib       Normalised flat field   .\n"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="stringliteral">"  DISP_COEFF_LONG_MXU        Calib       Inverse dispersion      Y\n"</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="stringliteral">"  In case STANDARD_MXU is specified in input,\n"</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="stringliteral">"  EXTINCT_TABLE              Calib       Atmospheric extinction  Y\n"</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="stringliteral">"  STD_FLUX_TABLE             Calib       Standard star flux      Y\n"</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="stringliteral">"  In case a photometric calibration is requested for scientific\n"</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="stringliteral">"  data, the following inputs are mandatory:\n"</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="stringliteral">"  EXTINCT_TABLE              Calib       Atmospheric extinction  Y\n"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="stringliteral">"  SPECPHOT_TABLE             Calib       Response curves         Y\n"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="stringliteral">"  If requested for standard star data, the SPECPHOT_TABLE can be dropped:\n"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="stringliteral">"  in this case the correction is applied using the SPECPHOT_TABLE produced\n"</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="stringliteral">"  in the same run.\n"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="stringliteral">"  REDUCED_SCI_MXU            FITS image  Extracted scientific spectra\n"</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="stringliteral">"  REDUCED_SKY_SCI_MXU        FITS image  Extracted sky spectra\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="stringliteral">"  REDUCED_ERROR_SCI_MXU      FITS image  Errors on extracted spectra\n"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="stringliteral">"  UNMAPPED_SCI_MXU           FITS image  Sky subtracted scientific spectra\n"</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="stringliteral">"  MAPPED_SCI_MXU             FITS image  Rectified scientific spectra\n"</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="stringliteral">"  MAPPED_ALL_SCI_MXU         FITS image  Rectified science spectra with sky\n"</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="stringliteral">"  MAPPED_SKY_SCI_MXU         FITS image  Rectified sky spectra\n"</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="stringliteral">"  UNMAPPED_SKY_SCI_MXU       FITS image  Sky on CCD\n"</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="stringliteral">"  OBJECT_TABLE_SCI_MXU       FITS table  Positions of detected objects\n"</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="stringliteral">"  Only if the global sky subtraction is requested:\n"</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="stringliteral">"  GLOBAL_SKY_SPECTRUM_MXU    FITS table  Global sky spectrum\n"</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="stringliteral">"  Only if the sky-alignment of the wavelength solution is requested:\n"</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="stringliteral">"  SKY_SHIFTS_LONG_SCI_MXU    FITS table  Sky lines offsets (LSS-like data)\n"</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="stringliteral">"  or SKY_SHIFTS_SLIT_SCI_MXU FITS table  Sky lines offsets (MOS-like data)\n"</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="stringliteral">"  DISP_COEFF_SCI_MXU         FITS table  Upgraded dispersion coefficients\n"</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="stringliteral">"  WAVELENGTH_MAP_SCI_MXU     FITS image  Upgraded wavelength map\n"</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="stringliteral">"  Only if a STANDARD_MXU is specified in input:\n"</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="stringliteral">"  SPECPHOT_TABLE             FITS table  Efficiency and response curves\n"</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="stringliteral">"  Only if a photometric calibration was requested:\n"</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="stringliteral">"  REDUCED_FLUX_SCI_MXU       FITS image  Flux calibrated scientific spectra\n"</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="stringliteral">"  REDUCED_FLUX_ERROR_SCI_MXU FITS image  Errors on flux calibrated spectra\n"</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="stringliteral">"  MAPPED_FLUX_SCI_MXU        FITS image  Flux calibrated slit spectra\n\n"</span>;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="preprocessor">#define fors_science_exit(message)            \</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor">cpl_free(exptime);                            \</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="preprocessor">cpl_free(instrume);                           \</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="preprocessor">cpl_image_delete(dummy);                      \</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="preprocessor">cpl_image_delete(mapped);                     \</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="preprocessor">cpl_image_delete(skylocalmap);                \</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="preprocessor">cpl_image_delete(smapped);                    \</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="preprocessor">cpl_table_delete(offsets);                    \</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="preprocessor">cpl_table_delete(photcal);                    \</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="preprocessor">cpl_table_delete(sky);                        \</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="preprocessor">cpl_image_delete(bias);                       \</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor">cpl_image_delete(wavemaplss);                 \</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="preprocessor">cpl_propertylist_delete(qclist);              \</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="preprocessor">#define fors_science_exit_memcheck(message)   \</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="preprocessor">cpl_free(exptime);                            \</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="preprocessor">cpl_free(instrume);                           \</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="preprocessor">cpl_image_delete(dummy);                      \</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="preprocessor">cpl_image_delete(mapped);                     \</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="preprocessor">cpl_image_delete(skylocalmap);                \</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="preprocessor">cpl_image_delete(smapped);                    \</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="preprocessor">cpl_table_delete(offsets);                    \</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="preprocessor">cpl_table_delete(photcal);                    \</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="preprocessor">cpl_table_delete(sky);                        \</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="preprocessor">cpl_image_delete(bias);                       \</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="preprocessor">cpl_image_delete(wavemaplss);                 \</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="preprocessor">return 0;                                     \</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> {</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>                     <span class="stringliteral">"fors_science"</span>,</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>                     <span class="stringliteral">"Extraction of scientific spectra"</span>,</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>                     fors_science_description,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                     <a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87" title="Get the pipeline copyright and license.">fors_get_license</a>(),</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                     fors_science_create,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                     fors_science_exec,</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>                     fors_science_destroy);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> }</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> {</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> </div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.dispersion"</span>,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                                 <span class="stringliteral">"Resampling step (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                                 0.0);</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> <span class="comment">     * Sky lines alignment</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.skyalign"</span>,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>                                 <span class="stringliteral">"Polynomial order for sky lines alignment, "</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>                                 <span class="stringliteral">"or -1 to avoid alignment"</span>,</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>                                 0);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.wcolumn"</span>,</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                                 <span class="stringliteral">"Name of sky line catalog table column "</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.startwavelength"</span>,</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>                                 0.0);</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.endwavelength"</span>,</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>                                 0.0);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> </div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> <span class="comment">     * Apply flat field</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.flatfield"</span>,</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>                                 <span class="stringliteral">"Apply flat field"</span>,</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>                                 TRUE);</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flatfield"</span>);</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> <span class="comment">     * Global sky subtraction</span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> </div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.skyglobal"</span>,</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>                                 <span class="stringliteral">"Subtract global sky spectrum from CCD"</span>,</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>                                 FALSE);</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyglobal"</span>);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> </div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> <span class="comment">     * Local sky subtraction on extracted spectra</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> <span class="comment">/*** New sky subtraction (search NSS)</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_science.skymedian",</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="comment">                                CPL_TYPE_INT,</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="comment">                                "Degree of sky fitting polynomial for "</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="comment">                                "sky subtraction from extracted "</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="comment">                                "slit spectra (MOS/MXU only, -1 to disable it)",</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="comment">                                "fors.fors_science",</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> <span class="comment">                                0);</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "skymedian");</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> <span class="comment">***/</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.skymedian"</span>,</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>                                 <span class="stringliteral">"Sky subtraction from extracted slit spectra"</span>,</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>                                 FALSE);</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skymedian"</span>);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span> </div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> <span class="comment">     * Local sky subtraction on CCD spectra</span></div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.skylocal"</span>,</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>                                 <span class="stringliteral">"Sky subtraction from CCD slit spectra"</span>,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>                                 TRUE);</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skylocal"</span>);</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> </div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> <span class="comment">     * Cosmic rays removal</span></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span> </div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.cosmics"</span>,</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                                 <span class="stringliteral">"Eliminate cosmic rays hits (only if global "</span></div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>                                 <span class="stringliteral">"sky subtraction is also requested)"</span>,</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>                                 FALSE);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> </div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span> <span class="comment">     * Slit margin</span></div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.slit_margin"</span>,</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>                                 <span class="stringliteral">"in object detection and extraction"</span>,</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>                                 3);</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> </div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> <span class="comment">     * Extraction radius</span></div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> </div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.ext_radius"</span>,</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>                                 <span class="stringliteral">"Maximum extraction radius for detected "</span></div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>                                 <span class="stringliteral">"objects (pixel)"</span>,</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>                                 12);</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span> </div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span> <span class="comment">     * Contamination radius</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> </div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.cont_radius"</span>,</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>                                 <span class="stringliteral">"Minimum distance at which two objects "</span></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span></div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>                                 <span class="stringliteral">"each other (pixel)"</span>,</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                                 0);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> <span class="comment">     * Object extraction method</span></div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.ext_mode"</span>,</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                                 1);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> <span class="comment">     * Order of polynomial modeling the instrument response.</span></div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> </div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.response"</span>,</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>                                 <span class="stringliteral">"Order of polynomial modeling the "</span></div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>                                 <span class="stringliteral">"instrument response"</span>,</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>                                 5);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"response"</span>);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> </div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> <span class="comment">     * Order of polynomial modeling the instrument response.</span></div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> </div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_science.photometry"</span>,</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>                                 <span class="stringliteral">"Apply spectrophotometric calibration"</span>,</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                                 <span class="stringliteral">"fors.fors_science"</span>,</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>                                 FALSE);</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"photometry"</span>);</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> </div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> }</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span> </div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span> </div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span> {</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span> </div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     <span class="keywordflow">return</span> fors_science(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> }</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> </div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span> </div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span> {</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     </div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> </div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span> </div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span> }</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span> </div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> </div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> {</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> </div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_science"</span>;</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> </div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span> </div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span> </div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     <span class="keywordtype">int</span>         skyalign;</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     <span class="keywordtype">int</span>         flatfield;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="keywordtype">int</span>         skyglobal;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     <span class="keywordtype">int</span>         skylocal;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     <span class="keywordtype">int</span>         skymedian;</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordtype">int</span>         cosmics;</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="keywordtype">int</span>         slit_margin;</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     <span class="keywordtype">int</span>         ext_radius;</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     <span class="keywordtype">int</span>         cont_radius;</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     <span class="keywordtype">int</span>         ext_mode;</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordtype">int</span>         res_order;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     <span class="keywordtype">int</span>         photometry;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span> </div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> </div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span> </div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     cpl_imagelist    *all_science;</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     cpl_image       **images;</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span> </div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     cpl_image        *bias           = NULL;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     cpl_image        *norm_flat      = NULL;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     cpl_image        *spectra        = NULL;</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     cpl_image        *rectified      = NULL;</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     cpl_image        *coordinate     = NULL;</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     cpl_image        *rainbow        = NULL;</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     cpl_image        *mapped         = NULL;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     cpl_image        *mapped_sky     = NULL;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     cpl_image        *mapped_cleaned = NULL;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     cpl_image        *smapped        = NULL;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     cpl_image        *wavemap        = NULL;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     cpl_image        *wavemaplss     = NULL;</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     cpl_image        *skymap         = NULL;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     cpl_image        *skylocalmap    = NULL;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     cpl_image        *dummy          = NULL;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> </div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     cpl_table        *grism_table    = NULL;</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>     cpl_table        *overscans      = NULL;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     cpl_table        *wavelengths    = NULL;</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     cpl_table        *idscoeff       = NULL;</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     cpl_table        *slits          = NULL;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     cpl_table        *maskslits      = NULL;</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     cpl_table        *polytraces     = NULL;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     cpl_table        *offsets        = NULL;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     cpl_table        *sky            = NULL;</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     cpl_table        *photcal        = NULL;</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> </div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     cpl_vector       *lines          = NULL;</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> </div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     cpl_propertylist *header         = NULL;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     cpl_propertylist *save_header    = NULL;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     cpl_propertylist *qclist         = NULL;</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> </div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> </div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span> </div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>     <span class="keywordtype">char</span>       *wheel4;</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *science_tag = NULL;</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_norm_flat_tag = NULL;</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag = NULL;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_sky_tag = NULL;</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_sky_tag = NULL;</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag = NULL;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag = NULL;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_science_tag = NULL;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_flux_science_tag = NULL;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_sky_tag = NULL;</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_error_tag = NULL;</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_flux_error_tag = NULL;</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_tag = NULL;</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_flux_science_tag = NULL;</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_science_tag = NULL;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_sky_tag = NULL;</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_sky_tag = NULL;</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_sky_tag = NULL;</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *global_sky_spectrum_tag = NULL;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *object_table_tag = NULL;</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *skylines_offsets_tag = NULL;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *specphot_tag;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_specphot_tag = <span class="stringliteral">"MASTER_SPECPHOT_TABLE"</span>;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="keywordtype">int</span>         mxu, mos, lss;</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>     <span class="keywordtype">int</span>         treat_as_lss = 0;</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     <span class="keywordtype">int</span>         have_phot = 0;</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     <span class="keywordtype">int</span>         nscience;</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     <span class="keywordtype">double</span>     *exptime = NULL;</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     <span class="keywordtype">double</span>      alltime;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     <span class="keywordtype">double</span>      airmass = -1;</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>     <span class="keywordtype">double</span>      mean_rms;</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     <span class="keywordtype">int</span>         nlines;</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     <span class="keywordtype">double</span>     *line;</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     <span class="keywordtype">int</span>         ccd_xsize, ccd_ysize;</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     <span class="keywordtype">double</span>      gain;</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>     <span class="keywordtype">double</span>      ron;</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     <span class="keywordtype">int</span>         standard;</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>     <span class="keywordtype">int</span>         highres;</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     <span class="keywordtype">double</span>      wstart;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     <span class="keywordtype">double</span>      wstep;</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     <span class="keywordtype">int</span>         wcount;</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span> </div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> </div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> </div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> </div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> </div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> </div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>         fors_science_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> </div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span> </div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>                     <span class="stringliteral">"fors.fors_science.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> </div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>         fors_science_exit(<span class="stringliteral">"Invalid resampling step"</span>);</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span> </div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>     skyalign = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>                     <span class="stringliteral">"fors.fors_science.skyalign"</span>, NULL);</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span> </div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     <span class="keywordflow">if</span> (skyalign > 2)</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>         fors_science_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span> </div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>                     <span class="stringliteral">"fors.fors_science.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span> </div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>                     <span class="stringliteral">"fors.fors_science.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>         fors_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span> </div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>                     <span class="stringliteral">"fors.fors_science.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>         fors_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> </div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>     <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>         fors_science_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> </div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     flatfield = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_science.flatfield"</span>, </div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>                                        NULL);</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     skyglobal = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_science.skyglobal"</span>, </div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>                                        NULL);</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     skylocal  = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_science.skylocal"</span>, </div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>                                        NULL);</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     skymedian = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_science.skymedian"</span>, </div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>                                        NULL);</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span> <span class="comment">/* NSS</span></div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span> <span class="comment">    skymedian = dfs_get_parameter_int(parlist, "fors.fors_science.skymedian", </span></div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span> <span class="comment">                                       NULL);</span></div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span> </div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     <span class="keywordflow">if</span> (skylocal && skyglobal)</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>         fors_science_exit(<span class="stringliteral">"Cannot apply both local and global sky subtraction"</span>);</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span> </div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>     <span class="keywordflow">if</span> (skylocal && skymedian)</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>         fors_science_exit(<span class="stringliteral">"Cannot apply sky subtraction both on extracted "</span></div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>                           <span class="stringliteral">"and non-extracted spectra"</span>);</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span> </div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>     cosmics = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>                                      <span class="stringliteral">"fors.fors_science.cosmics"</span>, NULL);</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span> </div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>         <span class="keywordflow">if</span> (!(skyglobal || skylocal))</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>             fors_science_exit(<span class="stringliteral">"Cosmic rays correction requires "</span></div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>                               <span class="stringliteral">"either skylocal=true or skyglobal=true"</span>);</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span> </div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>     slit_margin = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>                                         <span class="stringliteral">"fors.fors_science.slit_margin"</span>,</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>                                         NULL);</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>     <span class="keywordflow">if</span> (slit_margin < 0)</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>         fors_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span> </div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>     ext_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_science.ext_radius"</span>,</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>                                        NULL);</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>     <span class="keywordflow">if</span> (ext_radius < 0)</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>         fors_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> </div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     cont_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>                                         <span class="stringliteral">"fors.fors_science.cont_radius"</span>,</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>                                         NULL);</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     <span class="keywordflow">if</span> (cont_radius < 0)</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>         fors_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span> </div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     ext_mode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_science.ext_mode"</span>,</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>                                        NULL);</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>         fors_science_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> </div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     res_order = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_science.response"</span>,</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>                                       NULL);</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>     <span class="keywordflow">if</span> (res_order < 2 || res_order > 10)</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>         fors_science_exit(<span class="stringliteral">"Invalid instrument response modeling polynomial"</span>);</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span> </div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>     photometry = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist,</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>                              <span class="stringliteral">"fors.fors_science.photometry"</span>, NULL);</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span> </div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span> </div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>         fors_science_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span> </div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     </div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span> <span class="comment">     * Check input set-of-frames</span></div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span> </div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span> </div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>     mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MXU"</span>);</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MOS"</span>);</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>     lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_LSS"</span>);</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>     standard = 0;</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span> </div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>     <span class="keywordflow">if</span> (mxu + mos + lss == 0) {</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>         mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MXU"</span>);</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>         mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MOS"</span>);</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>         lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_LSS"</span>);</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>         standard = 1;</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>     }</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span> </div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>     <span class="keywordflow">if</span> (mxu + mos + lss == 0)</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>         fors_science_exit(<span class="stringliteral">"Missing input scientific frame"</span>);</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span> </div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>     nscience = mxu + mos + lss;</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span> </div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>     <span class="keywordflow">if</span> (mxu && mxu < nscience)</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>         fors_science_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); </div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span> </div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>     <span class="keywordflow">if</span> (mos && mos < nscience)</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>         fors_science_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); </div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span> </div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     <span class="keywordflow">if</span> (lss && lss < nscience)</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>         fors_science_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); </div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span> </div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>         cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>             science_tag              = <span class="stringliteral">"STANDARD_MXU"</span>;</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>             reduced_science_tag      = <span class="stringliteral">"REDUCED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_STD_MXU"</span>;</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>             mapped_science_tag       = <span class="stringliteral">"MAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_STD_MXU"</span>;</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MXU"</span>;</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_STD_MXU"</span>;</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_STD_MXU"</span>;</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_STD_MXU"</span>;</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>         }</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>             science_tag              = <span class="stringliteral">"SCIENCE_MXU"</span>;</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>             reduced_science_tag      = <span class="stringliteral">"REDUCED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>             mapped_science_tag       = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>         }</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span> </div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>         curv_coeff_tag          = <span class="stringliteral">"CURV_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_MXU"</span>;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span> </div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>             master_norm_flat_tag   = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_MXU"</span>;</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>             disp_coeff_tag         = <span class="stringliteral">"DISP_COEFF_LONG_MXU"</span>;</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>             slit_location_tag      = <span class="stringliteral">"SLIT_LOCATION_LONG_MXU"</span>;</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>         }</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>     }</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span> </div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>     <span class="keywordflow">if</span> (lss) {</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>         cpl_msg_info(recipe, <span class="stringliteral">"LSS data found"</span>);</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span> </div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>         <span class="keywordflow">if</span> (cosmics && !skyglobal)</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>             fors_science_exit(<span class="stringliteral">"Cosmic rays correction for LSS "</span></div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>                               <span class="stringliteral">"data requires --skyglobal=true"</span>);</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span> </div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>             science_tag              = <span class="stringliteral">"STANDARD_LSS"</span>;</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>             reduced_science_tag      = <span class="stringliteral">"REDUCED_STD_LSS"</span>;</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_STD_LSS"</span>;</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_STD_LSS"</span>;</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>             mapped_science_tag       = <span class="stringliteral">"MAPPED_STD_LSS"</span>;</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_STD_LSS"</span>;</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>;</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_LSS"</span>;</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_LSS"</span>;</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>;</div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_LSS"</span>;</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_STD_LSS"</span>;</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_STD_LSS"</span>;</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_STD_LSS"</span>;</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_STD_LSS"</span>;</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_STD_LSS"</span>;</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>         }</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>             science_tag              = <span class="stringliteral">"SCIENCE_LSS"</span>;</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>             reduced_science_tag      = <span class="stringliteral">"REDUCED_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>             mapped_science_tag       = <span class="stringliteral">"MAPPED_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>         }</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span> </div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;</div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_LSS"</span>;</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_LSS"</span>;</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span>     }</div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span> </div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>     <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>         cpl_msg_info(recipe, <span class="stringliteral">"MOS data found"</span>);</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>             science_tag              = <span class="stringliteral">"STANDARD_MOS"</span>;</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>             reduced_science_tag      = <span class="stringliteral">"REDUCED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_STD_MOS"</span>;</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>             mapped_science_tag       = <span class="stringliteral">"MAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_STD_MOS"</span>;</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MOS"</span>;</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_STD_MOS"</span>;</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_STD_MOS"</span>;</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_STD_MOS"</span>;</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>         }</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>             science_tag              = <span class="stringliteral">"SCIENCE_MOS"</span>;</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>             reduced_science_tag      = <span class="stringliteral">"REDUCED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>             reduced_flux_science_tag = <span class="stringliteral">"REDUCED_FLUX_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>             unmapped_science_tag     = <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>             mapped_science_tag       = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>             mapped_flux_science_tag  = <span class="stringliteral">"MAPPED_FLUX_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>             mapped_science_sky_tag   = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>             skylines_offsets_tag     = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>             wavelength_map_sky_tag   = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>             disp_coeff_sky_tag       = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>             mapped_sky_tag           = <span class="stringliteral">"MAPPED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>             unmapped_sky_tag         = <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>             object_table_tag         = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>             reduced_sky_tag          = <span class="stringliteral">"REDUCED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>             reduced_error_tag        = <span class="stringliteral">"REDUCED_ERROR_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>             reduced_flux_error_tag   = <span class="stringliteral">"REDUCED_FLUX_ERROR_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>             specphot_tag             = <span class="stringliteral">"SPECPHOT_TABLE"</span>;</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>         }</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span> </div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>         curv_coeff_tag          = <span class="stringliteral">"CURV_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_MOS"</span>;</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span> </div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>             master_norm_flat_tag   = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_MOS"</span>;</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>             disp_coeff_tag         = <span class="stringliteral">"DISP_COEFF_LONG_MOS"</span>;</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>             slit_location_tag      = <span class="stringliteral">"SLIT_LOCATION_LONG_MOS"</span>;</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>         }</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>     }</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span> </div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0)</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>         fors_science_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span> </div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>         fors_science_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span> </div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>     <span class="keywordflow">if</span> (skyalign >= 0)</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>             fors_science_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);</div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span> </div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) == 0) {</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, disp_coeff_tag);</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>         fors_science_exit(NULL);</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>     }</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span> </div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) > 1) {</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, disp_coeff_tag);</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>         fors_science_exit(NULL);</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>     }</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span> </div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) == 0) {</div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>,</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>                       slit_location_tag);</div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>         fors_science_exit(NULL);</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>     }</div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span> </div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) > 1) {</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, slit_location_tag);</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>         fors_science_exit(NULL);</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>     }</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span> </div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) > 1) {</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, </div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>                           master_norm_flat_tag);</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>         }</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input are ignored, "</span></div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>                             <span class="stringliteral">"since flat field correction was not requested"</span>, </div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>                             master_norm_flat_tag);</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>         }</div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>     }</div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span> </div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 1) {</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>         <span class="keywordflow">if</span> (!flatfield) {</div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input is ignored, "</span></div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>                             <span class="stringliteral">"since flat field correction was not requested"</span>, </div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>                             master_norm_flat_tag);</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>         }</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>     }</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span> </div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 0) {</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>             cpl_msg_error(recipe, <span class="stringliteral">"Flat field correction was requested, "</span></div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>                           <span class="stringliteral">"but no %s are found in input"</span>,</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>                           master_norm_flat_tag);</div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>         }</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>     }</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span> </div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>     <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>     </div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) == 0) {</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>             cpl_msg_warning(recipe, <span class="stringliteral">"An EXTINCT_TABLE was not found in input: "</span></div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>                             <span class="stringliteral">"instrument response curve will not be produced."</span>);</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>             standard = 0;</div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>         }</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span> </div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>             fors_science_exit(<span class="stringliteral">"Too many in input: EXTINCT_TABLE"</span>);</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>     </div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>) == 0) {</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>             cpl_msg_warning(recipe, <span class="stringliteral">"A STD_FLUX_TABLE was not found in input: "</span></div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>                             <span class="stringliteral">"instrument response curve will not be produced."</span>);</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>             standard = 0;</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>         }</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span> </div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>             fors_science_exit(<span class="stringliteral">"Too many in input: STD_FLUX_TABLE"</span>);</div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span> </div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO OBS TARG NAME"</span>)) {</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>             cpl_msg_warning(recipe, <span class="stringliteral">"The target name of observation does not "</span></div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>                             <span class="stringliteral">"match the standard star catalog: "</span></div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>                             <span class="stringliteral">"instrument response curve will not be produced."</span>);</div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>             standard = 0;</div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>         }</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>     }</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span> </div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>     <span class="keywordflow">if</span> (photometry) {</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) == 0) {</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>             fors_science_exit(<span class="stringliteral">"An EXTINCT_TABLE was not found in input: "</span></div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>                               <span class="stringliteral">"the requested photometric calibrated spectra "</span></div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>                               <span class="stringliteral">"cannot be produced."</span>);</div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>         }</div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span> </div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>             fors_science_exit(<span class="stringliteral">"Too many in input: EXTINCT_TABLE"</span>);</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span> </div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>         have_phot  = cpl_frameset_count_tags(frameset, specphot_tag);</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>         have_phot += cpl_frameset_count_tags(frameset, master_specphot_tag);</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span> </div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>         <span class="keywordflow">if</span> (!standard) {</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>             <span class="keywordflow">if</span> (have_phot == 0) {</div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>                 cpl_msg_warning(recipe, </div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>                                 <span class="stringliteral">"A SPECPHOT_TABLE was not found in input: "</span></div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>                                 <span class="stringliteral">"the requested photometric calibrated "</span></div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>                                 <span class="stringliteral">"spectra cannot be produced."</span>);</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>                 photometry = 0;</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>             }</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span> </div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>             <span class="keywordflow">if</span> (have_phot > 1)</div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>                 fors_science_exit(<span class="stringliteral">"Too many in input: SPECPHOT_TABLE"</span>);</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>         }</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>     }</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span> </div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>         fors_science_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span> </div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>         fors_science_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span> </div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"SPECPHOT_TABLE"</span>))</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>     {</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>         cpl_frameset * frameset_nostd = cpl_frameset_duplicate(frameset);</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>         cpl_frameset_erase(frameset_nostd, <span class="stringliteral">"SPECPHOT_TABLE"</span>);</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset_nostd, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>              fors_science_exit(<span class="stringliteral">"Input frames are not from the same chip."</span></div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>                                <span class="stringliteral">" This does not apply to specphot table."</span>);</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>         cpl_frameset_delete(frameset_nostd);</div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>     }</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>     {</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>             fors_science_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>     }</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span> </div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>     {</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>         cpl_frameset * frameset_detector = cpl_frameset_duplicate(frameset);</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>         cpl_frameset_erase(frameset_detector, <span class="stringliteral">"GRISM_TABLE"</span>);</div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset_detector, <span class="stringliteral">"ESO DET CHIP1 NAME"</span>))</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>             fors_science_exit(<span class="stringliteral">"Input frames are not from the same chip mosaic"</span>);</div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>         cpl_frameset_delete(frameset_detector);</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>     }</div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>  </div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span> </div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span> </div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span> <span class="comment">     * Loading input data</span></div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span> </div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>     exptime = cpl_calloc(nscience, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span> </div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>     <span class="keywordflow">if</span> (nscience > 1) {</div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span> </div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load %d scientific frames and median them..."</span>,</div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>                      nscience);</div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span> </div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>         all_science = cpl_imagelist_new();</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span> </div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span> </div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>             fors_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span> </div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span> </div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>             fors_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>                               <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span> </div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>         <span class="keywordflow">if</span> (standard || photometry) {</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>             airmass = <a class="code" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b" title="Compute average airmass.">fors_get_airmass</a>(header);</div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>             <span class="keywordflow">if</span> (airmass < 0.0) </div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>                 fors_science_exit(<span class="stringliteral">"Missing airmass information in "</span></div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>                                   <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>         }</div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span> </div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span> </div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame 1 exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>                      exptime[0]);</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span> </div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span> </div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span> </div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>             <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>                 fors_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>     </div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>             exptime[i] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span> </div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>             alltime += exptime[i];</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>     </div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>                 fors_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>                                   <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>     </div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>             cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span> </div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>             cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame %d exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>                          i+1, exptime[i]);</div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>         }</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span> </div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>         spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span> </div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>         <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>             fors_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span> </div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>         cpl_image_divide_scalar(spectra, exptime[0]);</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>         cpl_imagelist_set(all_science, spectra, 0); spectra = NULL;</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span> </div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span> </div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>             spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span> </div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>             <span class="keywordflow">if</span> (spectra) {</div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>                 cpl_image_divide_scalar(spectra, exptime[i]);</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>                 cpl_imagelist_set(all_science, spectra, i); spectra = NULL;</div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>             }</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>                 fors_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span> </div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>         }</div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span> </div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>         spectra = cpl_imagelist_collapse_median_create(all_science);</div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>         cpl_image_multiply_scalar(spectra, alltime);</div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span> </div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>         cpl_imagelist_delete(all_science);</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>     }</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load scientific exposure..."</span>);</div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span> </div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span> </div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>             fors_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span> </div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>         <span class="keywordflow">if</span> (standard || photometry) {</div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>             airmass = <a class="code" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b" title="Compute average airmass.">fors_get_airmass</a>(header);</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>             <span class="keywordflow">if</span> (airmass < 0.0) </div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>                 fors_science_exit(<span class="stringliteral">"Missing airmass information in "</span></div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>                                   <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>         }</div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span> </div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span> <span class="comment">         * Insert here a check on supported filters:</span></div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span> </div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>         wheel4 = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, </div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>                                                      <span class="stringliteral">"ESO INS OPTI9 TYPE"</span>);</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>             fors_science_exit(<span class="stringliteral">"Missing ESO INS OPTI9 TYPE in flat header"</span>);</div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>         }</div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span> </div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>         <span class="keywordflow">if</span> (strcmp(<span class="stringliteral">"FILT"</span>, wheel4) == 0) {</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>             wheel4 = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header,</div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>                                                          <span class="stringliteral">"ESO INS OPTI9 NAME"</span>);</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>             cpl_msg_error(recipe, <span class="stringliteral">"Unsupported filter: %s"</span>, wheel4);</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>         }</div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span> </div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span> </div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>             fors_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>                               <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span> </div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span> </div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>                      exptime[0]);</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span> </div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>         spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>     }</div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span> </div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>         fors_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span> </div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>     cpl_free(exptime); exptime = NULL;</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span> </div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span> </div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span> </div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span> <span class="comment">     * dispersion direction from a scientific exposure</span></div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span> </div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span> </div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>         fors_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span> </div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>         fors_science_exit(<span class="stringliteral">"Missing keyword INSTRUME in scientific header"</span>);</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>     instrume = cpl_strdup(instrume);</div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span> </div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span> </div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span> </div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>         fors_science_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in scientific "</span></div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span> </div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>         reference *= 10;</div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span> </div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in scientific frame header"</span>,</div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>                       reference);</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>         fors_science_exit(NULL);</div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>     }</div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span> </div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span> </div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span> </div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>         fors_science_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in scientific "</span></div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span> </div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>                         <span class="stringliteral">"resampling step used is %f A/pixel"</span>, rebin, </div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>                         dispersion);</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>         ext_radius /= rebin;</div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>                         <span class="stringliteral">"extraction radius used is %d pixel"</span>, rebin, </div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>                         ext_radius);</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>     }</div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span> </div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span> </div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>         fors_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in scientific "</span></div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span> </div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span> </div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);</div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span> </div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>         fors_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in scientific "</span></div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span> </div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span></div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span> </div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);</div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span> </div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>     <span class="keywordflow">if</span> (mos || mxu) {</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>         <span class="keywordtype">int</span> nslits_out_det = 0;</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span> <span class="comment">/* goto skip; */</span></div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>         <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>             maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>             maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span> </div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span> <span class="comment">         * Check if all slits have the same X offset: in such case,</span></div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span> <span class="comment">         * treat the observation as a long-slit one!</span></div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span> </div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>         mxpos = cpl_table_get_column_median(maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>      </div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>         treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span> </div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span> <span class="comment">/* skip: */</span></div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span> </div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>         <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>             cpl_msg_warning(recipe, <span class="stringliteral">"All MOS slits have the same offset: %.2f\n"</span></div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>                             <span class="stringliteral">"The LSS data reduction strategy is applied!"</span>,</div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>                             mxpos);</div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>             <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>                 <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>                     skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MOS"</span>;</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>                 }</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>                     skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MOS"</span>;</div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>                 }</div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>             }</div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>                 <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>                     skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_MXU"</span>;</div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>                 }</div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>                     skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_MXU"</span>;</div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>                 }</div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>             }</div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>         }</div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>     }</div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span> </div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>     <span class="keywordflow">if</span> (lss || treat_as_lss) {</div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>         <span class="keywordflow">if</span> (skylocal) {</div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>             <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>                 fors_science_exit(<span class="stringliteral">"Cosmic rays correction for LSS or LSS-like "</span></div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>                                   <span class="stringliteral">"data requires --skyglobal=true"</span>);</div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>             skymedian = skylocal;</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>             skylocal = 0;</div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>         }</div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>     }</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) == 0) {</div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, curv_coeff_tag);</div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>         }</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span> </div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) > 1) {</div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, curv_coeff_tag);</div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>         }</div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>     }</div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span> </div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>     <span class="comment">/* Leave the header on for the next step... */</span></div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span> </div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span> </div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span> <span class="comment">     * Remove the master bias</span></div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span> </div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span> </div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>     bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span> </div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>     <span class="keywordflow">if</span> (bias == NULL)</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>         fors_science_exit(<span class="stringliteral">"Cannot load master bias"</span>);</div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span> </div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>     overscans = <a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(header, 1);</div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>     dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(spectra, bias, overscans);</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>     cpl_image_delete(spectra); spectra = dummy; dummy = NULL;</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>     cpl_image_delete(bias); bias = NULL;</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>     cpl_table_delete(overscans); overscans = NULL;</div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span> </div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>         fors_science_exit(<span class="stringliteral">"Cannot remove bias from scientific frame"</span>);</div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span> </div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>     ccd_xsize = nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>     ccd_ysize = ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span> </div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load normalised flat field (if present)..."</span>);</div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span> </div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>     <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span> </div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>         norm_flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, master_norm_flat_tag, </div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>                                    CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span> </div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>         <span class="keywordflow">if</span> (norm_flat) {</div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>             cpl_msg_info(recipe, <span class="stringliteral">"Apply flat field correction..."</span>);</div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>             <span class="keywordflow">if</span> (cpl_image_divide(spectra, norm_flat) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>                 cpl_msg_error(recipe, <span class="stringliteral">"Failure of flat field correction: %s"</span>,</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>                               cpl_error_get_message());</div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>                 fors_science_exit(NULL);</div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>             }</div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>             cpl_image_delete(norm_flat); norm_flat = NULL;</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>         }</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>             cpl_msg_error(recipe, <span class="stringliteral">"Cannot load input %s for flat field "</span></div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>                           <span class="stringliteral">"correction"</span>, master_norm_flat_tag);</div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>         }</div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span> </div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>     }</div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span> </div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span> </div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load input sky line catalog..."</span>);</div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span> </div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>         wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);</div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span> </div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>         <span class="keywordflow">if</span> (wavelengths) {</div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span> </div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span> <span class="comment">             * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span> </div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>             nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span> </div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>             <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>                 fors_science_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);</div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span> </div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>             <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>                 cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span></div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>                               <span class="stringliteral">"catalog table"</span>, wcolumn);</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>                 fors_science_exit(NULL);</div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>             }</div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span> </div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>             line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>     </div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>             <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>                 line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span> </div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>             cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span> </div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>             lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>         }</div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>             cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);</div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>         }</div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>     }</div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span> </div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span> </div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span> <span class="comment">     * Load the spectral curvature table, or provide a dummy one</span></div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span> <span class="comment">     * in case of LSS or LSS-like data (single slit with flat curvature)</span></div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span> </div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>     <span class="keywordflow">if</span> (!(lss || treat_as_lss)) {</div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>         polytraces = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, curv_coeff_tag, 1);</div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>         <span class="keywordflow">if</span> (polytraces == NULL)</div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>             fors_science_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);</div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>     }</div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span> </div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span> </div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span> <span class="comment">     * Load the slit location table</span></div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span> </div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>     slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>         fors_science_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span> </div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>     <span class="keywordflow">if</span> (lss || treat_as_lss) {</div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>         <span class="keywordtype">int</span> first_row = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, 0, NULL);</div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>         <span class="keywordtype">int</span> last_row = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, 0, NULL);</div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>         <span class="keywordtype">int</span> ylow, yhig;</div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span> </div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>         ylow = first_row + 1;</div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>         yhig = last_row + 1;</div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span> </div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>         dummy = cpl_image_extract(spectra, 1, ylow, nx, yhig);</div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>         cpl_image_delete(spectra); spectra = dummy; dummy = NULL;</div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>         ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>     }</div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span> </div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span> </div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span> <span class="comment">     * Load the wavelength calibration table</span></div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span> </div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>     idscoeff = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, disp_coeff_tag, 1);</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>     <span class="keywordflow">if</span> (idscoeff == NULL)</div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>         fors_science_exit(<span class="stringliteral">"Cannot load wavelength calibration table"</span>);</div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span> </div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>     cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific spectra..."</span>);</div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span> </div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span> <span class="comment">     * This one will also generate the spatial map from the spectral </span></div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span> <span class="comment">     * curvature table (in the case of multislit data)</span></div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span> </div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>     <span class="keywordflow">if</span> (lss || treat_as_lss) {</div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>         smapped = cpl_image_duplicate(spectra);</div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>     }</div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>         coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span> </div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>         smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>                                           startwavelength, endwavelength,</div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>                                           dispersion, 1, coordinate);</div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>     }</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span> </div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span> </div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span> <span class="comment">     * Generate a rectified wavelength map from the wavelength calibration </span></div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span> <span class="comment">     * table</span></div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span> </div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>     rainbow = <a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength, </div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>                                endwavelength);</div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span> </div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>     <span class="keywordflow">if</span> (dispersion > 1.0)</div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>         highres = 0;</div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>         highres = 1;</div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span> </div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>         <span class="keywordflow">if</span> (skyalign) {</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>             <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);</div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>         }</div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>             <span class="stringliteral">"skylines applying median offset..."</span>);</div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>         }</div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span> </div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>         <span class="keywordflow">if</span> (lss || treat_as_lss) {</div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>             offsets = <a class="code" href="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1" title="Modify the input wavelength solution to match reference sky lines (LSS).">mos_wavelength_align_lss</a>(smapped, reference, </div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>                                                startwavelength, endwavelength, </div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>                                                idscoeff, lines, highres, </div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>                                                skyalign, rainbow, 4);</div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>         }</div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>             offsets = <a class="code" href="group__moses.html#ga634eb7408671a139e7015185776f4513" title="Modify the input wavelength solution to match reference sky lines.">mos_wavelength_align</a>(smapped, slits, reference, </div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>                                            startwavelength, endwavelength, </div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>                                            idscoeff, lines, highres, skyalign, </div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>                                            rainbow, 4);</div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>         }</div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span> </div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>         <span class="keywordflow">if</span> (offsets) {</div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>             <span class="keywordflow">if</span> (standard)</div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>                 cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span></div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>                                 <span class="stringliteral">"to reference sky lines may be unreliable in "</span></div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>                                 <span class="stringliteral">"this case!"</span>);</div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span> </div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, offsets, skylines_offsets_tag, NULL, </div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>                 fors_science_exit(NULL);</div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span> </div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>             cpl_table_delete(offsets); offsets = NULL;</div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>         }</div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>             <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>                 <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_INCOMPATIBLE_INPUT) {</div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>                     cpl_msg_error(recipe, <span class="stringliteral">"The IDS coeff table is "</span></div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>                     <span class="stringliteral">"incompatible with the input slit position table."</span>);</div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>                 }</div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>                 cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>                               cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>                 fors_science_exit(NULL);</div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>             }</div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span></div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>                             <span class="stringliteral">"to reference sky lines could not be done!"</span>);</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>             skyalign = -1;</div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>         }</div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span> </div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>     }</div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span> </div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>     <span class="keywordflow">if</span> (lss || treat_as_lss) {</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>         <span class="keywordtype">int</span> first_row = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, 0, NULL);</div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>         <span class="keywordtype">int</span> last_row = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, 0, NULL);</div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>         <span class="keywordtype">int</span> ylow, yhig;</div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span> </div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>         ylow = first_row + 1;</div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>         yhig = last_row + 1;</div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span> </div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>         wavemap = cpl_image_new(ccd_xsize, ccd_ysize, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>         cpl_image_copy(wavemap, rainbow, 1, ylow);</div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span> </div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>         wavemaplss = cpl_image_extract(wavemap, 1, ylow, nx, yhig);</div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>     }</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>         wavemap = <a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(coordinate, rainbow, slits, </div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>                                       polytraces, reference, </div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>                                       startwavelength, endwavelength,</div>
+<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>                                       dispersion);</div>
+<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>     }</div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span> </div>
+<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>     cpl_image_delete(rainbow); rainbow = NULL;</div>
+<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>     cpl_image_delete(coordinate); coordinate = NULL;</div>
+<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span> </div>
+<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span> <span class="comment">     * Here the wavelength calibrated slit spectra are created. This frame</span></div>
+<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span> <span class="comment">     * contains sky_science.</span></div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span> </div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>     mapped_sky = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, reference,</div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>                                             startwavelength, endwavelength,</div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>                                             dispersion, idscoeff, 1);</div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span> </div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check applied wavelength against skylines..."</span>);</div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span> </div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>     mean_rms = <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(mapped_sky, lines, startwavelength,</div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>                                    dispersion, 6, highres);</div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span> </div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>     cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span> </div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f"</span>, mean_rms);</div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span> </div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span> </div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,</div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>                  mean_rms, mean_rms * dispersion);</div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span> </div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>     header = cpl_propertylist_new();</div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>                                    startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span> <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span> </div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>     <span class="comment">/* Perform time normalisation */</span></div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU/s"</span>);</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>     dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);</div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, dummy, mapped_science_sky_tag, header, </div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>             parlist, recipe, version))</div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>         fors_science_exit(NULL);</div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>     cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span> </div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span> <span class="comment">/*    if (skyglobal == 0 && skymedian < 0) {    NSS */</span></div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>     <span class="keywordflow">if</span> (skyglobal == 0 && skymedian == 0 && skylocal == 0) {</div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>         cpl_image_delete(mapped_sky); mapped_sky = NULL;</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>     }</div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span> </div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>     <span class="keywordflow">if</span> (skyglobal || skylocal) {</div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span> </div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span> </div>
+<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>         <span class="keywordflow">if</span> (skyglobal) {</div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>             cpl_msg_info(recipe, <span class="stringliteral">"Global sky determination..."</span>);</div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>             skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>             <span class="keywordflow">if</span> (lss || treat_as_lss) {</div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>                 sky = <a class="code" href="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d" title="Create a CCD median sky map.">mos_sky_map_super</a>(spectra, wavemaplss, dispersion, </div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>                                         2.0, 50, skymap);</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>             }</div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>                 sky = <a class="code" href="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d" title="Create a CCD median sky map.">mos_sky_map_super</a>(spectra, wavemap, dispersion, </div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>                                         2.0, 50, skymap);</div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>             }</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>             <span class="keywordflow">if</span> (sky) {</div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>                 cpl_image_subtract(spectra, skymap);</div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>             }</div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>                 cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>             }</div>
+<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>         }</div>
+<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>             skymap = <a class="code" href="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2" title="Subtract the sky from the scientific CCD exposure.">mos_subtract_sky</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>                            startwavelength, endwavelength, dispersion);</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>         }</div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span> </div>
+<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>         <span class="keywordflow">if</span> (skymap) {</div>
+<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>             <span class="keywordflow">if</span> (skyglobal) {</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>                 <span class="comment">/* Perform time normalisation */</span></div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>                 cpl_table_divide_scalar(sky, <span class="stringliteral">"sky"</span>, alltime);</div>
+<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span> </div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, sky, global_sky_spectrum_tag, </div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>                                    NULL, parlist, recipe, version))</div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>                     fors_science_exit(NULL);</div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>     </div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>                 cpl_table_delete(sky); sky = NULL;</div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>             }</div>
+<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span> </div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>             save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span> </div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>             <span class="comment">/* Perform time normalisation */</span></div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>             cpl_image_divide_scalar(skymap, alltime);</div>
+<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>             </div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, skymap, unmapped_sky_tag,</div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>                                save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>                 fors_science_exit(NULL);</div>
+<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span> </div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>             cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span> </div>
+<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, spectra, unmapped_science_tag,</div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>                                save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>                 fors_science_exit(NULL);</div>
+<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span> </div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>             cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span> </div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>             <span class="keywordflow">if</span> (cosmics) {</div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>                 cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);</div>
+<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>                 <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(spectra, gain, -1., -1.);</div>
+<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>             }</div>
+<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span> </div>
+<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span> <span class="comment">             * The spatially rectified image, that contained the sky,</span></div>
+<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span> <span class="comment">             * is replaced by a sky-subtracted spatially rectified image:</span></div>
+<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span> </div>
+<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>             cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span> </div>
+<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>             <span class="keywordflow">if</span> (lss || treat_as_lss) {</div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>                 smapped = cpl_image_duplicate(spectra);</div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>             }</div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>                 smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, </div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>                                                   reference, startwavelength, </div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>                                                   endwavelength, dispersion, </div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>                                                   1, NULL);</div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>             }</div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>         }</div>
+<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Sky subtraction failure"</span>);</div>
+<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>             <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span>                 cpl_msg_warning(recipe, <span class="stringliteral">"Cosmic rays removal not performed!"</span>);</div>
+<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>             cosmics = skylocal = skyglobal = 0;</div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>         }</div>
+<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>     }</div>
+<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span> </div>
+<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>     <span class="keywordflow">if</span> (lss || treat_as_lss) </div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>         cpl_image_delete(wavemaplss); wavemaplss = NULL;</div>
+<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span> </div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>         save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>         cpl_propertylist_update_string(save_header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"Angstrom"</span>);</div>
+<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, wavemap, wavelength_map_sky_tag,</div>
+<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>                            save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>         cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>     }</div>
+<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span> </div>
+<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>     cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span> </div>
+<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>     mapped = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, reference,</div>
+<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>                                         startwavelength, endwavelength,</div>
+<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>                                         dispersion, idscoeff, 1);</div>
+<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span> </div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>     cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span> </div>
+<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span> <span class="comment">/*    if (skymedian >= 0) {    NSS */</span></div>
+<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>     <span class="keywordflow">if</span> (skymedian) {</div>
+<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>        </div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span> <span class="comment">/*   NSS      skylocalmap = mos_sky_local(mapped, slits, skymedian); */</span></div>
+<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span> <span class="comment">/*            skylocalmap = mos_sky_local(mapped, slits, 0);        */</span></div>
+<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>             skylocalmap = <a class="code" href="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8" title="Local determination of sky.">mos_sky_local_old</a>(mapped, slits);       </div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>             cpl_image_subtract(mapped, skylocalmap);</div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span> <span class="comment">            if (dfs_save_image(frameset, skylocalmap, mapped_sky_tag, header, </span></div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span> <span class="comment">                               parlist, recipe, version))</span></div>
+<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span> <span class="comment">                fors_science_exit(NULL);</span></div>
+<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>             cpl_image_delete(skylocalmap); skylocalmap = NULL;</div>
+<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>     }</div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span> </div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>     <span class="keywordflow">if</span> (photometry) {</div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>         <span class="keywordflow">if</span> (have_phot && !standard) {</div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>             <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, specphot_tag) == 0) {</div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>                 photcal = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, </div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>                                          master_specphot_tag, 1);</div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>             }</div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>                 photcal = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, specphot_tag, 1);</div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>             }</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>         }</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>     }    </div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>     </div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>     </div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span> <span class="comment">/*    if (skyglobal || skymedian >= 0 || skylocal) {   NSS */</span></div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {</div>
+<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span> </div>
+<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>         skylocalmap = cpl_image_subtract_create(mapped_sky, mapped);</div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span> </div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>         cpl_image_delete(mapped_sky); mapped_sky = NULL;</div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span> </div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>         <span class="comment">/* Perform time normalisation */</span></div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU/s"</span>);</div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>         dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);</div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, dummy, mapped_sky_tag, header,</div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>                 parlist, recipe, version))</div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>         cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span> </div>
+<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>         cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);</div>
+<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span> </div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>         <span class="keywordflow">if</span> (cosmics || nscience > 1) {</div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>             dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped, slits, slit_margin, ext_radius, </div>
+<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>                                        cont_radius);</div>
+<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span>         }</div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>             mapped_cleaned = cpl_image_duplicate(mapped);</div>
+<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>             <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);</div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>             dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin, </div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>                                        ext_radius, cont_radius);</div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span> </div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>             cpl_image_delete(mapped_cleaned); mapped_cleaned = NULL;</div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>         }</div>
+<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span> </div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>         cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span> </div>
+<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, slits, object_table_tag, NULL, parlist, </div>
+<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>                            recipe, version))</div>
+<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span> </div>
+<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>         cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);</div>
+<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span> </div>
+<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>         images = <a class="code" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522" title="Extract detected objects from rectified scientific frame.">mos_extract_objects</a>(mapped, skylocalmap, slits, </div>
+<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>                                      ext_mode, ron, gain, 1);</div>
+<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span> </div>
+<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>         cpl_image_delete(skylocalmap); skylocalmap = NULL;</div>
+<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span> </div>
+<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>         <span class="keywordflow">if</span> (images) {</div>
+<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>             <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>                 cpl_table *ext_table  = NULL;</div>
+<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>                 cpl_table *flux_table = NULL;</div>
+<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span> </div>
+<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>                 ext_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>, 1);</div>
+<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>                 flux_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>, 1);</div>
+<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span> </div>
+<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>                 photcal = <a class="code" href="group__moses.html#gaad62d9ba866b8abafb2da02053584bf2" title="Produce instrument response curve, with some ancillary information.">mos_photometric_calibration</a>(images[0], </div>
+<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>                                                       startwavelength,</div>
+<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>                                                       dispersion, gain,</div>
+<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>                                                       alltime, ext_table,</div>
+<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>                                                       airmass, flux_table,</div>
+<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>                                                       res_order);</div>
+<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span> </div>
+<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>                 cpl_table_delete(ext_table);</div>
+<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>                 cpl_table_delete(flux_table);</div>
+<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span> </div>
+<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>                 <span class="keywordflow">if</span> (photcal) {</div>
+<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span> </div>
+<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>                     <span class="keywordtype">float</span> *data;</div>
+<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>                     <span class="keywordtype">char</span>  *pipefile = NULL;</div>
+<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>                     <span class="keywordtype">char</span>   keyname[30];</div>
+<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span> </div>
+<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>                     qclist = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span> </div>
+<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>                     <span class="keywordflow">if</span> (qclist == NULL)</div>
+<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>                         fors_science_exit(<span class="stringliteral">"Cannot reload scientific "</span></div>
+<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>                                 <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span> </div>
+<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>                     <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qclist, <span class="stringliteral">"2.0"</span>, instrume);</div>
+<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span> </div>
+<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span> </div>
+<div class="line"><a name="l01947"></a><span class="lineno"> 1947</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span> <span class="comment">                     * QC1 group header</span></div>
+<div class="line"><a name="l01949"></a><span class="lineno"> 1949</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l01950"></a><span class="lineno"> 1950</span> </div>
+<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, specphot_tag,</div>
+<div class="line"><a name="l01952"></a><span class="lineno"> 1952</span>                             <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>                         fors_science_exit(<span class="stringliteral">"Cannot write product category "</span></div>
+<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>                                 <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span> </div>
+<div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>                             <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>                         fors_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span></div>
+<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>                                 <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span> </div>
+<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span>                             <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>                         fors_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span></div>
+<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>                                 <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span> </div>
+<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, </div>
+<div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>                             <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>                             <span class="stringliteral">"Grism name"</span>, instrume))</div>
+<div class="line"><a name="l01969"></a><span class="lineno"> 1969</span>                         fors_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME "</span></div>
+<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>                                 <span class="stringliteral">"in scientific frame header"</span>);</div>
+<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span> </div>
+<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, </div>
+<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>                             <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,</div>
+<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>                             <span class="stringliteral">"Grism identifier"</span>, </div>
+<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>                             instrume))</div>
+<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>                         fors_science_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID "</span></div>
+<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>                                 <span class="stringliteral">"in scientific frame header"</span>);</div>
+<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span> </div>
+<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>                     <span class="keywordflow">if</span> (cpl_propertylist_has(qclist, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))</div>
+<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>                         <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, </div>
+<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>                                 <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>                                 <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span> </div>
+<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, </div>
+<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>                             <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,</div>
+<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>                             <span class="stringliteral">"Collimator name"</span>, </div>
+<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>                             instrume))</div>
+<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>                         fors_science_exit(<span class="stringliteral">"Missing keyword INS COLL NAME "</span></div>
+<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>                                 <span class="stringliteral">"in scientific frame header"</span>);</div>
+<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span> </div>
+<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, </div>
+<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>                             <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>                             <span class="stringliteral">"Chip identifier"</span>, </div>
+<div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>                             instrume))</div>
+<div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>                         fors_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID "</span></div>
+<div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>                                 <span class="stringliteral">"in scientific frame header"</span>);</div>
+<div class="line"><a name="l01997"></a><span class="lineno"> 1997</span> </div>
+<div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, </div>
+<div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>                             <span class="stringliteral">"ESO INS MOS10 WID"</span>,</div>
+<div class="line"><a name="l02000"></a><span class="lineno"> 2000</span>                             <span class="stringliteral">"arcsec"</span>, <span class="stringliteral">"Slit width"</span>, </div>
+<div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>                             instrume)) {</div>
+<div class="line"><a name="l02002"></a><span class="lineno"> 2002</span>                         cpl_error_reset();</div>
+<div class="line"><a name="l02003"></a><span class="lineno"> 2003</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, </div>
+<div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>                                 <span class="stringliteral">"ESO INS SLIT WID"</span>,</div>
+<div class="line"><a name="l02005"></a><span class="lineno"> 2005</span>                                 <span class="stringliteral">"arcsec"</span>, <span class="stringliteral">"Slit width"</span>, </div>
+<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>                                 instrume)) {</div>
+<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>                             <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>                                 fors_science_exit(<span class="stringliteral">"Missing keyword "</span></div>
+<div class="line"><a name="l02009"></a><span class="lineno"> 2009</span>                                         <span class="stringliteral">"ESO INS MOS10 WID in "</span></div>
+<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>                                         <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>                             }</div>
+<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>                             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>                                 fors_science_exit(<span class="stringliteral">"Missing keyword "</span></div>
+<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>                                         <span class="stringliteral">"ESO INS SLIT WID in "</span></div>
+<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>                                         <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>                             }</div>
+<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>                         }</div>
+<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>                     }</div>
+<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span> </div>
+<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span> <span class="comment">                        if (mos) {</span></div>
+<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span> <span class="comment">                            if (fors_qc_keyword_to_paf(qclist, </span></div>
+<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span> <span class="comment">                                                       "ESO INS MOS10 WID",</span></div>
+<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span> <span class="comment">                                                       "arcsec", "Slit width", </span></div>
+<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span> <span class="comment">                                                       instrume))</span></div>
+<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span> <span class="comment">                                fors_science_exit("Missing keyword "</span></div>
+<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span> <span class="comment">                                                  "ESO INS MOS10 WID in "</span></div>
+<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span> <span class="comment">                                                  "scientific frame header");</span></div>
+<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span> <span class="comment">                        }</span></div>
+<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span> <span class="comment">                        else {</span></div>
+<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span> <span class="comment">                            if (fors_qc_keyword_to_paf(qclist, </span></div>
+<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span> <span class="comment">                                                       "ESO INS SLIT WID",</span></div>
+<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span> <span class="comment">                                                       "arcsec", "Slit width", </span></div>
+<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span> <span class="comment">                                                       instrume))</span></div>
+<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span> <span class="comment">                                fors_science_exit("Missing keyword "</span></div>
+<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span> <span class="comment">                                                  "ESO INS SLIT WID in "</span></div>
+<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span> <span class="comment">                                                  "scientific frame header");</span></div>
+<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span> <span class="comment">                        }</span></div>
+<div class="line"><a name="l02039"></a><span class="lineno"> 2039</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span> </div>
+<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, </div>
+<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>                             <span class="stringliteral">"ESO DET WIN1 BINX"</span>, NULL,</div>
+<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>                             <span class="stringliteral">"Binning factor along X"</span>, </div>
+<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>                             instrume))</div>
+<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>                         fors_science_exit(<span class="stringliteral">"Missing keyword ESO "</span></div>
+<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span>                                 <span class="stringliteral">"DET WIN1 BINX "</span></div>
+<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>                                 <span class="stringliteral">"in scientific frame header"</span>);</div>
+<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span> </div>
+<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, </div>
+<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span>                             <span class="stringliteral">"ESO DET WIN1 BINY"</span>, NULL,</div>
+<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>                             <span class="stringliteral">"Binning factor along Y"</span>, </div>
+<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>                             instrume))</div>
+<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>                         fors_science_exit(<span class="stringliteral">"Missing keyword "</span></div>
+<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>                                 <span class="stringliteral">"ESO DET WIN1 BINY "</span></div>
+<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>                                 <span class="stringliteral">"in scientific frame header"</span>);</div>
+<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span> </div>
+<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>                             <span class="stringliteral">"Archive name of input data"</span>,</div>
+<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>                             instrume))</div>
+<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>                         fors_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span></div>
+<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>                                 <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span> </div>
+<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>                     pipefile = dfs_generate_filename_tfits(specphot_tag);</div>
+<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>                             <span class="stringliteral">"Pipeline product name"</span>, </div>
+<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>                             instrume))</div>
+<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span>                         fors_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span></div>
+<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>                                 <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>                     cpl_free(pipefile);</div>
+<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span> </div>
+<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span> </div>
+<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span> <span class="comment">                     * QC1 parameters</span></div>
+<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span> </div>
+<div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>                     wstart = 3700.;</div>
+<div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>                     wstep  = 400.;</div>
+<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>                     wcount = 15;</div>
+<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span> </div>
+<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>                     dummy = cpl_image_new(wcount, 1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>                     data = cpl_image_get_data_float(dummy);</div>
+<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>                     map_table(dummy, wstart, wstep, photcal, </div>
+<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>                               <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"EFFICIENCY"</span>);</div>
+<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span> </div>
+<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>                     <span class="keywordflow">for</span> (i = 0; i < wcount; i++) {</div>
+<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>                         sprintf(keyname, <span class="stringliteral">"QC.SPEC.EFFICIENCY%d.LAMBDA"</span>, </div>
+<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>                                 i + 1);</div>
+<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qclist, </div>
+<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>                                 wstart + wstep * i,</div>
+<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>                                 keyname, <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>                                 <span class="stringliteral">"Wavelength of "</span></div>
+<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>                                 <span class="stringliteral">"efficiency evaluation"</span>,</div>
+<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>                                 instrume)) {</div>
+<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>                             fors_science_exit(<span class="stringliteral">"Cannot write wavelength of "</span></div>
+<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>                                     <span class="stringliteral">"efficiency evaluation"</span>);</div>
+<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>                         }</div>
+<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span> </div>
+<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>                         sprintf(keyname, <span class="stringliteral">"QC.SPEC.EFFICIENCY%d"</span>, i + 1);</div>
+<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qclist,</div>
+<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span>                                 data[i],</div>
+<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>                                 keyname, <span class="stringliteral">"e-/photon"</span>,</div>
+<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span>                                 <span class="stringliteral">"Efficiency"</span>,</div>
+<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>                                 instrume)) {</div>
+<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>                             fors_science_exit(<span class="stringliteral">"Cannot write wavelength of "</span></div>
+<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>                                     <span class="stringliteral">"efficiency evaluation"</span>);</div>
+<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>                         }</div>
+<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>                     }</div>
+<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span> </div>
+<div class="line"><a name="l02109"></a><span class="lineno"> 2109</span>                     cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l02110"></a><span class="lineno"> 2110</span> </div>
+<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>                     <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l02112"></a><span class="lineno"> 2112</span>         </div>
+<div class="line"><a name="l02113"></a><span class="lineno"> 2113</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, photcal, specphot_tag, qclist,</div>
+<div class="line"><a name="l02114"></a><span class="lineno"> 2114</span>                                        parlist, recipe, version))</div>
+<div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>                         fors_science_exit(NULL);</div>
+<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span> </div>
+<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span>                     cpl_propertylist_delete(qclist); qclist = NULL;</div>
+<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span> </div>
+<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>                     <span class="keywordflow">if</span> (have_phot) {</div>
+<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>                         cpl_table_delete(photcal); photcal = NULL;</div>
+<div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>                     }</div>
+<div class="line"><a name="l02122"></a><span class="lineno"> 2122</span>                 }</div>
+<div class="line"><a name="l02123"></a><span class="lineno"> 2123</span>             }</div>
+<div class="line"><a name="l02124"></a><span class="lineno"> 2124</span> </div>
+<div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>             <span class="keywordflow">if</span> (photometry) {</div>
+<div class="line"><a name="l02126"></a><span class="lineno"> 2126</span>                 cpl_image *calibrated;</div>
+<div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>                 cpl_table *ext_table;</div>
+<div class="line"><a name="l02128"></a><span class="lineno"> 2128</span> </div>
+<div class="line"><a name="l02129"></a><span class="lineno"> 2129</span>                 ext_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>, 1);</div>
+<div class="line"><a name="l02130"></a><span class="lineno"> 2130</span> </div>
+<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>                 <span class="keywordflow">if</span> (have_phot) {</div>
+<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>                     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, specphot_tag) == 0) {</div>
+<div class="line"><a name="l02133"></a><span class="lineno"> 2133</span>                         photcal = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, </div>
+<div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>                                                  master_specphot_tag, 1);</div>
+<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>                     }</div>
+<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>                         photcal = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, specphot_tag, 1);</div>
+<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>                     }</div>
+<div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>                 }</div>
+<div class="line"><a name="l02140"></a><span class="lineno"> 2140</span> </div>
+<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>                 calibrated = <a class="code" href="group__moses.html#ga2244278b632992a44067afcc42530954" title="Apply response curve to extracted spectra.">mos_apply_photometry</a>(images[0], photcal, </div>
+<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>                                                   ext_table, startwavelength, </div>
+<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>                                                   dispersion, gain, alltime, </div>
+<div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>                                                   airmass);</div>
+<div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>                 cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, </div>
+<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>                                    <span class="stringliteral">"10^(-16) erg/(cm^2 s Angstrom)"</span>);</div>
+<div class="line"><a name="l02147"></a><span class="lineno"> 2147</span> </div>
+<div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, calibrated,</div>
+<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>                                    reduced_flux_science_tag, header,</div>
+<div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>                                    parlist, recipe, version)) {</div>
+<div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>                     cpl_image_delete(calibrated);</div>
+<div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>                     fors_science_exit(NULL);</div>
+<div class="line"><a name="l02153"></a><span class="lineno"> 2153</span>                 }</div>
+<div class="line"><a name="l02154"></a><span class="lineno"> 2154</span> </div>
+<div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>                 cpl_table_delete(ext_table);</div>
+<div class="line"><a name="l02156"></a><span class="lineno"> 2156</span>                 cpl_image_delete(calibrated);</div>
+<div class="line"><a name="l02157"></a><span class="lineno"> 2157</span>             }</div>
+<div class="line"><a name="l02158"></a><span class="lineno"> 2158</span> </div>
+<div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>             <span class="comment">/* Perform time normalisation */</span></div>
+<div class="line"><a name="l02160"></a><span class="lineno"> 2160</span>             cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU/s"</span>);</div>
+<div class="line"><a name="l02161"></a><span class="lineno"> 2161</span>             cpl_image_divide_scalar(images[0], alltime);</div>
+<div class="line"><a name="l02162"></a><span class="lineno"> 2162</span> </div>
+<div class="line"><a name="l02163"></a><span class="lineno"> 2163</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[0], reduced_science_tag, header,</div>
+<div class="line"><a name="l02164"></a><span class="lineno"> 2164</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l02165"></a><span class="lineno"> 2165</span>                 fors_science_exit(NULL);</div>
+<div class="line"><a name="l02166"></a><span class="lineno"> 2166</span> </div>
+<div class="line"><a name="l02167"></a><span class="lineno"> 2167</span>             <span class="comment">/* Perform time normalisation */</span></div>
+<div class="line"><a name="l02168"></a><span class="lineno"> 2168</span>             cpl_image_divide_scalar(images[1], alltime);</div>
+<div class="line"><a name="l02169"></a><span class="lineno"> 2169</span> </div>
+<div class="line"><a name="l02170"></a><span class="lineno"> 2170</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[1], reduced_sky_tag, header,</div>
+<div class="line"><a name="l02171"></a><span class="lineno"> 2171</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>                 fors_science_exit(NULL);</div>
+<div class="line"><a name="l02173"></a><span class="lineno"> 2173</span> </div>
+<div class="line"><a name="l02174"></a><span class="lineno"> 2174</span>             cpl_image_delete(images[1]);</div>
+<div class="line"><a name="l02175"></a><span class="lineno"> 2175</span> </div>
+<div class="line"><a name="l02176"></a><span class="lineno"> 2176</span>             <span class="keywordflow">if</span> (photometry) {</div>
+<div class="line"><a name="l02177"></a><span class="lineno"> 2177</span>                 cpl_image *calibrated;</div>
+<div class="line"><a name="l02178"></a><span class="lineno"> 2178</span>                 cpl_table *ext_table; </div>
+<div class="line"><a name="l02179"></a><span class="lineno"> 2179</span>  </div>
+<div class="line"><a name="l02180"></a><span class="lineno"> 2180</span>                 ext_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>, 1);</div>
+<div class="line"><a name="l02181"></a><span class="lineno"> 2181</span> </div>
+<div class="line"><a name="l02182"></a><span class="lineno"> 2182</span>                 calibrated = <a class="code" href="group__moses.html#gae8e4a9d1a1146de7ba72dd148848342d" title="Propagate errors from response curve and extracted spectra.">mos_propagate_photometry_error</a>(images[0], </div>
+<div class="line"><a name="l02183"></a><span class="lineno"> 2183</span>                                                   images[2], photcal,</div>
+<div class="line"><a name="l02184"></a><span class="lineno"> 2184</span>                                                   ext_table, startwavelength,</div>
+<div class="line"><a name="l02185"></a><span class="lineno"> 2185</span>                                                   dispersion, gain, alltime,</div>
+<div class="line"><a name="l02186"></a><span class="lineno"> 2186</span>                                                   airmass);</div>
+<div class="line"><a name="l02187"></a><span class="lineno"> 2187</span> </div>
+<div class="line"><a name="l02188"></a><span class="lineno"> 2188</span>                 cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, </div>
+<div class="line"><a name="l02189"></a><span class="lineno"> 2189</span>                                    <span class="stringliteral">"10^(-16) erg/(cm^2 s Angstrom)"</span>);</div>
+<div class="line"><a name="l02190"></a><span class="lineno"> 2190</span> </div>
+<div class="line"><a name="l02191"></a><span class="lineno"> 2191</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, calibrated,</div>
+<div class="line"><a name="l02192"></a><span class="lineno"> 2192</span>                                    reduced_flux_error_tag, header,</div>
+<div class="line"><a name="l02193"></a><span class="lineno"> 2193</span>                                    parlist, recipe, version)) {</div>
+<div class="line"><a name="l02194"></a><span class="lineno"> 2194</span>                     cpl_image_delete(calibrated);</div>
+<div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>                     fors_science_exit(NULL);</div>
+<div class="line"><a name="l02196"></a><span class="lineno"> 2196</span>                 }</div>
+<div class="line"><a name="l02197"></a><span class="lineno"> 2197</span> </div>
+<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>                 cpl_table_delete(ext_table);</div>
+<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>                 cpl_image_delete(calibrated);</div>
+<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>             }</div>
+<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span> </div>
+<div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>     </div>
+<div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>             <span class="comment">/* Perform time normalisation */</span></div>
+<div class="line"><a name="l02204"></a><span class="lineno"> 2204</span>             cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU/s"</span>);</div>
+<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>             cpl_image_divide_scalar(images[2], alltime);</div>
+<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span> </div>
+<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[2], reduced_error_tag, header,</div>
+<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>                 fors_science_exit(NULL);</div>
+<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span> </div>
+<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>             cpl_image_delete(images[0]);</div>
+<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>             cpl_image_delete(images[2]);</div>
+<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span> </div>
+<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>             cpl_free(images);</div>
+<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>         }</div>
+<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>             cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span></div>
+<div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>                             <span class="stringliteral">"%s, %s, and %s are not created"</span>, </div>
+<div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>                             reduced_science_tag, reduced_sky_tag, </div>
+<div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>                             reduced_error_tag);</div>
+<div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>         }</div>
+<div class="line"><a name="l02222"></a><span class="lineno"> 2222</span> </div>
+<div class="line"><a name="l02223"></a><span class="lineno"> 2223</span>     }</div>
+<div class="line"><a name="l02224"></a><span class="lineno"> 2224</span> </div>
+<div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>     cpl_free(instrume); instrume = NULL;</div>
+<div class="line"><a name="l02226"></a><span class="lineno"> 2226</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l02227"></a><span class="lineno"> 2227</span> </div>
+<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, idscoeff, disp_coeff_sky_tag, NULL, </div>
+<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>     }</div>
+<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span> </div>
+<div class="line"><a name="l02234"></a><span class="lineno"> 2234</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l02235"></a><span class="lineno"> 2235</span> </div>
+<div class="line"><a name="l02236"></a><span class="lineno"> 2236</span>     <span class="keywordflow">if</span> (photometry && photcal) {</div>
+<div class="line"><a name="l02237"></a><span class="lineno"> 2237</span>         cpl_image *calibrated;</div>
+<div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>         cpl_table *ext_table; </div>
+<div class="line"><a name="l02239"></a><span class="lineno"> 2239</span> </div>
+<div class="line"><a name="l02240"></a><span class="lineno"> 2240</span> </div>
+<div class="line"><a name="l02241"></a><span class="lineno"> 2241</span>         ext_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>, 1);</div>
+<div class="line"><a name="l02242"></a><span class="lineno"> 2242</span> </div>
+<div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>         calibrated = <a class="code" href="group__moses.html#ga2244278b632992a44067afcc42530954" title="Apply response curve to extracted spectra.">mos_apply_photometry</a>(mapped, photcal,</div>
+<div class="line"><a name="l02244"></a><span class="lineno"> 2244</span>                 ext_table, startwavelength,</div>
+<div class="line"><a name="l02245"></a><span class="lineno"> 2245</span>                 dispersion, gain, alltime,</div>
+<div class="line"><a name="l02246"></a><span class="lineno"> 2246</span>                 airmass);</div>
+<div class="line"><a name="l02247"></a><span class="lineno"> 2247</span> </div>
+<div class="line"><a name="l02248"></a><span class="lineno"> 2248</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, </div>
+<div class="line"><a name="l02249"></a><span class="lineno"> 2249</span>                                        <span class="stringliteral">"10^(-16) erg/(cm^2 s Angstrom)"</span>);</div>
+<div class="line"><a name="l02250"></a><span class="lineno"> 2250</span> </div>
+<div class="line"><a name="l02251"></a><span class="lineno"> 2251</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, calibrated,</div>
+<div class="line"><a name="l02252"></a><span class="lineno"> 2252</span>                 mapped_flux_science_tag, header,</div>
+<div class="line"><a name="l02253"></a><span class="lineno"> 2253</span>                 parlist, recipe, version)) {</div>
+<div class="line"><a name="l02254"></a><span class="lineno"> 2254</span>             cpl_image_delete(calibrated);</div>
+<div class="line"><a name="l02255"></a><span class="lineno"> 2255</span>             fors_science_exit(NULL);</div>
+<div class="line"><a name="l02256"></a><span class="lineno"> 2256</span>         }</div>
+<div class="line"><a name="l02257"></a><span class="lineno"> 2257</span> </div>
+<div class="line"><a name="l02258"></a><span class="lineno"> 2258</span>         cpl_table_delete(ext_table);</div>
+<div class="line"><a name="l02259"></a><span class="lineno"> 2259</span>         cpl_image_delete(calibrated);</div>
+<div class="line"><a name="l02260"></a><span class="lineno"> 2260</span>     }</div>
+<div class="line"><a name="l02261"></a><span class="lineno"> 2261</span> </div>
+<div class="line"><a name="l02262"></a><span class="lineno"> 2262</span>     <span class="comment">/* Perform time normalisation */</span></div>
+<div class="line"><a name="l02263"></a><span class="lineno"> 2263</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"BUNIT"</span>, <span class="stringliteral">"ADU/s"</span>);</div>
+<div class="line"><a name="l02264"></a><span class="lineno"> 2264</span>     cpl_image_divide_scalar(mapped, alltime);</div>
+<div class="line"><a name="l02265"></a><span class="lineno"> 2265</span> </div>
+<div class="line"><a name="l02266"></a><span class="lineno"> 2266</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, mapped, mapped_science_tag, header, </div>
+<div class="line"><a name="l02267"></a><span class="lineno"> 2267</span>             parlist, recipe, version))</div>
+<div class="line"><a name="l02268"></a><span class="lineno"> 2268</span>         fors_science_exit(NULL);</div>
+<div class="line"><a name="l02269"></a><span class="lineno"> 2269</span> </div>
+<div class="line"><a name="l02270"></a><span class="lineno"> 2270</span>     cpl_table_delete(photcal); photcal = NULL;</div>
+<div class="line"><a name="l02271"></a><span class="lineno"> 2271</span>     cpl_image_delete(mapped); mapped = NULL;</div>
+<div class="line"><a name="l02272"></a><span class="lineno"> 2272</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l02273"></a><span class="lineno"> 2273</span> </div>
+<div class="line"><a name="l02274"></a><span class="lineno"> 2274</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l02275"></a><span class="lineno"> 2275</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Error found in %s: %s"</span>,</div>
+<div class="line"><a name="l02276"></a><span class="lineno"> 2276</span>                       cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l02277"></a><span class="lineno"> 2277</span>         fors_science_exit(NULL);</div>
+<div class="line"><a name="l02278"></a><span class="lineno"> 2278</span>     }</div>
+<div class="line"><a name="l02279"></a><span class="lineno"> 2279</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l02280"></a><span class="lineno"> 2280</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l02281"></a><span class="lineno"> 2281</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l02282"></a><span class="lineno"> 2282</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__setting-test_8c-source.html b/html/fors__setting-test_8c-source.html
deleted file mode 100644
index 17ac7f8..0000000
--- a/html/fors__setting-test_8c-source.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_setting-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_setting-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_setting-test.c,v 1.2 2007/09/27 12:48:52 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/09/27 12:48:52 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_setting.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <test.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 
-<a name="l00047"></a>00047 <span class="preprocessor">#undef cleanup</span>
-<a name="l00048"></a><a class="code" href="group__fors__setting__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00048</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">do { \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">    cpl_frame_delete(sflat); \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">} while (0)</span>
-<a name="l00053"></a>00053 <span class="preprocessor"></span>
-<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00057"></a><a class="code" href="group__fors__setting__test.html#g718b4121a26b3a17c0adb661e427ae39">00057</a> <a class="code" href="group__fors__setting__test.html#g718b4121a26b3a17c0adb661e427ae39">test_setting</a>(<span class="keywordtype">void</span>)
-<a name="l00058"></a>00058 {
-<a name="l00059"></a>00059     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00060"></a>00060     <span class="keywordtype">double</span> exptime = 1.0;
-<a name="l00061"></a>00061     cpl_frame *sflat = <a class="code" href="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669">create_sky_flat</a>(<span class="stringliteral">"setting_raw.fits"</span>,
-<a name="l00062"></a>00062                                        SKY_FLAT_IMG, CPL_FRAME_GROUP_RAW,
-<a name="l00063"></a>00063                                        exptime);
-<a name="l00064"></a>00064 
-<a name="l00065"></a>00065     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(sflat);
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     test_rel(setting-><a class="code" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">exposure_time</a>, exptime, 0.001);
-<a name="l00068"></a>00068    
-<a name="l00069"></a>00069     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00070"></a>00070     <span class="keywordflow">return</span>;
-<a name="l00071"></a>00071 }
-<a name="l00072"></a>00072 
-<a name="l00076"></a><a class="code" href="group__fors__setting__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00076</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00077"></a>00077 {
-<a name="l00078"></a>00078     TEST_INIT;
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span>
-<a name="l00081"></a>00081     <a class="code" href="group__fors__setting__test.html#g718b4121a26b3a17c0adb661e427ae39">test_setting</a>();
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083     TEST_END;
-<a name="l00084"></a>00084 }
-<a name="l00085"></a>00085 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__setting-test_8c_source.html b/html/fors__setting-test_8c_source.html
new file mode 100644
index 0000000..de3b133
--- /dev/null
+++ b/html/fors__setting-test_8c_source.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_setting-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_setting-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_setting-test.c,v 1.2 2007-09-27 12:48:52 jmlarsen Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: jmlarsen $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007-09-27 12:48:52 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.2 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_setting.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">    cpl_frame_delete(sflat); \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="group__fors__setting__test.html#gafa8c7ae8a3758428e457eb26c91c0da7">   57</a></span> <a class="code" href="group__fors__setting__test.html#gafa8c7ae8a3758428e457eb26c91c0da7" title="Test instrument setting.">test_setting</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> {</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     <span class="keywordtype">double</span> exptime = 1.0;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     cpl_frame *sflat = <a class="code" href="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103" title="Simulate sky flat image.">create_sky_flat</a>(<span class="stringliteral">"setting_raw.fits"</span>,</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>                                        SKY_FLAT_IMG, CPL_FRAME_GROUP_RAW,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>                                        exptime);</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(sflat);</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     test_rel(setting->exposure_time, exptime, 0.001);</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>    </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     cleanup;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> }</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="group__fors__setting__test.html#ga840291bc02cba5474a4cb46a9b9566fe">   76</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> {</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     TEST_INIT;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     <a class="code" href="group__fors__setting__test.html#gafa8c7ae8a3758428e457eb26c91c0da7" title="Test instrument setting.">test_setting</a>();</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     TEST_END;</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> }</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__setting_8c-source.html b/html/fors__setting_8c-source.html
deleted file mode 100644
index 6dde8ac..0000000
--- a/html/fors__setting_8c-source.html
+++ /dev/null
@@ -1,501 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_setting.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_setting.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_setting.c,v 1.19 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.19 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_setting.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_instrument.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <string.h></span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include <math.h></span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00048"></a>00048 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00049"></a>00049 
-<a name="l00052"></a>00052 <span class="keyword">static</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *
-<a name="l00053"></a>00053 <a class="code" href="group__fors__setting.html#gd72375aaa7f1199f3271f15afd724ded">fors_setting_new_level</a>(<span class="keyword">const</span> cpl_frame *raw, cpl_msg_severity level);
-<a name="l00054"></a>00054 
-<a name="l00055"></a>00055 
-<a name="l00063"></a>00063 <a class="code" href="struct__fors__setting.html">fors_setting</a> *
-<a name="l00064"></a><a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">00064</a> <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(<span class="keyword">const</span> cpl_frame *raw)
-<a name="l00065"></a>00065 {
-<a name="l00066"></a>00066     <span class="keywordflow">return</span> <a class="code" href="group__fors__setting.html#gd72375aaa7f1199f3271f15afd724ded">fors_setting_new_level</a>(raw, CPL_MSG_INFO);
-<a name="l00067"></a>00067 }
-<a name="l00068"></a>00068 
-<a name="l00069"></a>00069 <span class="preprocessor">#undef cleanup</span>
-<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00071"></a>00071 <span class="preprocessor">do { \</span>
-<a name="l00072"></a>00072 <span class="preprocessor">    cpl_propertylist_delete(header); \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">} while (0)</span>
-<a name="l00074"></a>00074 <span class="preprocessor"></span>
-<a name="l00081"></a>00081 <span class="keyword">static</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *
-<a name="l00082"></a><a class="code" href="group__fors__setting.html#gd72375aaa7f1199f3271f15afd724ded">00082</a> <a class="code" href="group__fors__setting.html#gd72375aaa7f1199f3271f15afd724ded">fors_setting_new_level</a>(<span class="keyword">const</span> cpl_frame *raw, cpl_msg_severity level)
-<a name="l00083"></a>00083 {
-<a name="l00084"></a>00084     <a class="code" href="struct__fors__setting.html">fors_setting</a> *s = NULL;
-<a name="l00085"></a>00085     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename;
-<a name="l00086"></a>00086     cpl_propertylist *header = NULL;
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( raw != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090     fors_msg(level, <span class="stringliteral">"Instrument setting:"</span>);
-<a name="l00091"></a>00091     cpl_msg_indent_more();
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     <span class="comment">/* Load header */</span>
-<a name="l00094"></a>00094     filename = cpl_frame_get_filename(raw);
-<a name="l00095"></a>00095     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( filename != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Missing frame filename"</span> );
-<a name="l00096"></a>00096     header = cpl_propertylist_load(filename, 0);
-<a name="l00097"></a>00097     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, 
-<a name="l00098"></a>00098             <span class="stringliteral">"Could not read %s primary header"</span>, filename );
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100     cpl_msg_debug(cpl_func, <span class="stringliteral">"Reading setting from %s"</span>, filename );
-<a name="l00101"></a>00101         
-<a name="l00102"></a>00102     <span class="comment">/* Read relevant contents */</span>
-<a name="l00103"></a>00103     s = cpl_malloc(<span class="keyword">sizeof</span>(*s));
-<a name="l00104"></a>00104 
-<a name="l00105"></a>00105     s->filter_name = NULL;
-<a name="l00106"></a>00106     s->read_clock = NULL;
-<a name="l00107"></a>00107     s->chip_id = NULL;
-<a name="l00108"></a>00108     s->instrument = NULL;
-<a name="l00109"></a>00109     s->version = NULL;
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111     s->binx = cpl_propertylist_get_int(header, <a class="code" href="group__fors__pfits.html#ge144a58d19a4028977a4993eb37211b6">FORS_PFITS_BINX</a>);
-<a name="l00112"></a>00112     <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00113"></a>00113         cpl_msg_error(cpl_func, 
-<a name="l00114"></a>00114                       <span class="stringliteral">"Keyword %s is not an integer"</span>, <a class="code" href="group__fors__pfits.html#ge144a58d19a4028977a4993eb37211b6">FORS_PFITS_BINX</a>);
-<a name="l00115"></a>00115     }
-<a name="l00116"></a>00116     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,
-<a name="l00117"></a>00117             <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00118"></a>00118             <a class="code" href="group__fors__pfits.html#ge144a58d19a4028977a4993eb37211b6">FORS_PFITS_BINX</a>, filename);
-<a name="l00119"></a>00119     
-<a name="l00120"></a>00120     fors_msg(level, <span class="stringliteral">"Detector x-binning (%s) = %d"</span>, <a class="code" href="group__fors__pfits.html#ge144a58d19a4028977a4993eb37211b6">FORS_PFITS_BINX</a>, s->binx);
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122     s->biny = cpl_propertylist_get_int(header, <a class="code" href="group__fors__pfits.html#gac44799b56c43a52fd8846bb493c4444">FORS_PFITS_BINY</a>);
-<a name="l00123"></a>00123     <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00124"></a>00124         cpl_msg_error(cpl_func, 
-<a name="l00125"></a>00125                       <span class="stringliteral">"Keyword %s is not an integer"</span>, <a class="code" href="group__fors__pfits.html#gac44799b56c43a52fd8846bb493c4444">FORS_PFITS_BINY</a>);
-<a name="l00126"></a>00126     }
-<a name="l00127"></a>00127     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,
-<a name="l00128"></a>00128             <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00129"></a>00129             <a class="code" href="group__fors__pfits.html#gac44799b56c43a52fd8846bb493c4444">FORS_PFITS_BINY</a>, filename);
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131     fors_msg(level, <span class="stringliteral">"Detector y-binning (%s) = %d"</span>, <a class="code" href="group__fors__pfits.html#gac44799b56c43a52fd8846bb493c4444">FORS_PFITS_BINY</a>, s->biny);
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133     
-<a name="l00134"></a>00134     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <a class="code" href="group__fors__pfits.html#g06cb15f701f99b2615b057941aa115ae">FORS_PFITS_PRESCANX</a>)) {
-<a name="l00135"></a>00135         
-<a name="l00136"></a>00136         s->prescan_x = cpl_propertylist_get_int(header, <a class="code" href="group__fors__pfits.html#g06cb15f701f99b2615b057941aa115ae">FORS_PFITS_PRESCANX</a>);
-<a name="l00137"></a>00137         <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00138"></a>00138             cpl_msg_error(cpl_func, 
-<a name="l00139"></a>00139                           <span class="stringliteral">"Keyword %s is not an integer"</span>, <a class="code" href="group__fors__pfits.html#g06cb15f701f99b2615b057941aa115ae">FORS_PFITS_PRESCANX</a>);
-<a name="l00140"></a>00140         }
-<a name="l00141"></a>00141         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,
-<a name="l00142"></a>00142                 <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00143"></a>00143                 <a class="code" href="group__fors__pfits.html#g06cb15f701f99b2615b057941aa115ae">FORS_PFITS_PRESCANX</a>, filename);
-<a name="l00144"></a>00144         
-<a name="l00145"></a>00145     }
-<a name="l00146"></a>00146     <span class="keywordflow">else</span> {
-<a name="l00147"></a>00147         s->prescan_x = 0;
-<a name="l00148"></a>00148     }
-<a name="l00149"></a>00149     
-<a name="l00150"></a>00150     fors_msg(level, <span class="stringliteral">"Detector x-prescan (%s) = %d"</span>,
-<a name="l00151"></a>00151              <a class="code" href="group__fors__pfits.html#g06cb15f701f99b2615b057941aa115ae">FORS_PFITS_PRESCANX</a>, s->prescan_x);
-<a name="l00152"></a>00152 
-<a name="l00153"></a>00153 
-<a name="l00154"></a>00154     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <a class="code" href="group__fors__pfits.html#g2701275da3ccfdcbf3ceaf2b3dcc02fc">FORS_PFITS_PRESCANY</a>)) {
-<a name="l00155"></a>00155         
-<a name="l00156"></a>00156         s->prescan_y = cpl_propertylist_get_int(header, <a class="code" href="group__fors__pfits.html#g2701275da3ccfdcbf3ceaf2b3dcc02fc">FORS_PFITS_PRESCANY</a>);
-<a name="l00157"></a>00157         <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00158"></a>00158             cpl_msg_error(cpl_func, 
-<a name="l00159"></a>00159                           <span class="stringliteral">"Keyword %s is not an integer"</span>, <a class="code" href="group__fors__pfits.html#g2701275da3ccfdcbf3ceaf2b3dcc02fc">FORS_PFITS_PRESCANY</a>);
-<a name="l00160"></a>00160         }
-<a name="l00161"></a>00161         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,
-<a name="l00162"></a>00162                 <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00163"></a>00163                 <a class="code" href="group__fors__pfits.html#g2701275da3ccfdcbf3ceaf2b3dcc02fc">FORS_PFITS_PRESCANY</a>, filename);
-<a name="l00164"></a>00164         
-<a name="l00165"></a>00165     }
-<a name="l00166"></a>00166     <span class="keywordflow">else</span> {
-<a name="l00167"></a>00167         s->prescan_y = 0;
-<a name="l00168"></a>00168     }
-<a name="l00169"></a>00169     
-<a name="l00170"></a>00170     fors_msg(level, <span class="stringliteral">"Detector y-prescan (%s) = %d"</span>,
-<a name="l00171"></a>00171              <a class="code" href="group__fors__pfits.html#g2701275da3ccfdcbf3ceaf2b3dcc02fc">FORS_PFITS_PRESCANY</a>, s->prescan_y);
-<a name="l00172"></a>00172 
-<a name="l00173"></a>00173 
-<a name="l00174"></a>00174     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <a class="code" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">FORS_PFITS_FILTER_NAME</a>)) {
-<a name="l00175"></a>00175         
-<a name="l00176"></a>00176         s->filter_name = cpl_propertylist_get_string(header, 
-<a name="l00177"></a>00177                                                      <a class="code" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">FORS_PFITS_FILTER_NAME</a>);
-<a name="l00178"></a>00178         <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00179"></a>00179             cpl_msg_error(cpl_func, 
-<a name="l00180"></a>00180                           <span class="stringliteral">"Keyword %s is not a string"</span>, 
-<a name="l00181"></a>00181                           <a class="code" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">FORS_PFITS_FILTER_NAME</a>);
-<a name="l00182"></a>00182         }
-<a name="l00183"></a>00183         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,
-<a name="l00184"></a>00184                 <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00185"></a>00185                 <a class="code" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">FORS_PFITS_FILTER_NAME</a>, filename);
-<a name="l00186"></a>00186     
-<a name="l00187"></a>00187         <span class="comment">/* Allocate new string (after the check for NULL and</span>
-<a name="l00188"></a>00188 <span class="comment">           before deallocating the cpl_propertylist) */</span>
-<a name="l00189"></a>00189         s->filter_name = cpl_strdup(s->filter_name);
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191         fors_msg(level, <span class="stringliteral">"Filter name (%s) = %s"</span>, 
-<a name="l00192"></a>00192                      <a class="code" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">FORS_PFITS_FILTER_NAME</a>, s->filter_name);
-<a name="l00193"></a>00193         
-<a name="l00194"></a>00194         cpl_errorstate  es = cpl_errorstate_get();
-<a name="l00195"></a>00195         s->filterband = fors_instrument_filterband_get_by_setting(s);
-<a name="l00196"></a>00196         <span class="comment">/* for some reason, the old code did not set an error, so reset */</span>
-<a name="l00197"></a>00197         cpl_errorstate_set(es);
-<a name="l00198"></a>00198         
-<a name="l00199"></a>00199         <span class="keywordtype">bool</span> recognized = fors_instrument_filterband_is_defined(s->filterband);
-<a name="l00200"></a>00200         
-<a name="l00201"></a>00201 <span class="comment">/* %%% New part...  */</span>
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203         <span class="keywordflow">if</span> (!recognized) {
-<a name="l00204"></a>00204             cpl_msg_warning(cpl_func, <span class="stringliteral">"Non-standard filter..."</span>);
-<a name="l00205"></a>00205             <span class="comment">/*s->filter = FILTER_U;*/</span> <span class="comment">//fixme</span>
-<a name="l00206"></a>00206             cpl_free(s->filter_name);
-<a name="l00207"></a>00207             s->filter_name = NULL;
-<a name="l00208"></a>00208         }
-<a name="l00209"></a>00209 
-<a name="l00210"></a>00210 <span class="comment">/***</span>
-<a name="l00211"></a>00211 <span class="comment">        assure( recognized, return s, "%s: %s: Unrecognized filter name: '%s'",</span>
-<a name="l00212"></a>00212 <span class="comment">                filename, FORS_PFITS_FILTER_NAME, s->filter_name );</span>
-<a name="l00213"></a>00213 <span class="comment">***/</span>
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215     }
-<a name="l00216"></a>00216     <span class="keywordflow">else</span> {
-<a name="l00217"></a>00217         <span class="comment">/* No raw frame filter (e.g. rawbias) */</span>
-<a name="l00218"></a>00218         s->filterband = fors_instrument_filterband_value_unknown();
-<a name="l00219"></a>00219         <span class="comment">/*s->filter = FILTER_U;*/</span> <span class="comment">//fixme</span>
-<a name="l00220"></a>00220         s->filter_name = NULL;
-<a name="l00221"></a>00221     }
-<a name="l00222"></a>00222     
-<a name="l00223"></a>00223     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a>)) {
-<a name="l00224"></a>00224         s->exposure_time = cpl_propertylist_get_double(header, 
-<a name="l00225"></a>00225                            <a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a>);
-<a name="l00226"></a>00226         <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00227"></a>00227             cpl_msg_error(cpl_func, 
-<a name="l00228"></a>00228                           <span class="stringliteral">"Keyword %s is not a double precision type"</span>, 
-<a name="l00229"></a>00229                           <a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a>);
-<a name="l00230"></a>00230         }
-<a name="l00231"></a>00231         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, 
-<a name="l00232"></a>00232                 <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00233"></a>00233                 <a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a>, filename);
-<a name="l00234"></a>00234         
-<a name="l00235"></a>00235         fors_msg(level, <span class="stringliteral">"Exposure time (%s) = %f s"</span>, 
-<a name="l00236"></a>00236                      <a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a>, s->exposure_time);
-<a name="l00237"></a>00237     }
-<a name="l00238"></a>00238     <span class="keywordflow">else</span> {
-<a name="l00239"></a>00239         cpl_msg_debug(cpl_func, <span class="stringliteral">"%s: Missing keyword '%s'"</span>,
-<a name="l00240"></a>00240                       filename, <a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a>);
-<a name="l00241"></a>00241     }
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243     s->pixel_scale = cpl_propertylist_get_double(header, <a class="code" href="group__fors__pfits.html#g4eb732430cac676ad4e2bf1f68a3f5f0">FORS_PFITS_PIXSCALE</a>);
-<a name="l00244"></a>00244     <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00245"></a>00245         cpl_msg_error(cpl_func, 
-<a name="l00246"></a>00246                       <span class="stringliteral">"Keyword %s is not a double precision type"</span>, 
-<a name="l00247"></a>00247                       <a class="code" href="group__fors__pfits.html#g4eb732430cac676ad4e2bf1f68a3f5f0">FORS_PFITS_PIXSCALE</a>);
-<a name="l00248"></a>00248     }
-<a name="l00249"></a>00249     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, 
-<a name="l00250"></a>00250             <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00251"></a>00251             <a class="code" href="group__fors__pfits.html#g4eb732430cac676ad4e2bf1f68a3f5f0">FORS_PFITS_PIXSCALE</a>, filename);
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253     fors_msg(level, <span class="stringliteral">"Pixel scale (%s) = %f arcsec/pixel"</span>, 
-<a name="l00254"></a>00254                  <a class="code" href="group__fors__pfits.html#g4eb732430cac676ad4e2bf1f68a3f5f0">FORS_PFITS_PIXSCALE</a>, s->pixel_scale);
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s->pixel_scale > 0, <span class="keywordflow">return</span> s,
-<a name="l00257"></a>00257             <span class="stringliteral">"%s: %s is non-positive (%f arcsec/pixel)"</span>,
-<a name="l00258"></a>00258             filename, <a class="code" href="group__fors__pfits.html#g4eb732430cac676ad4e2bf1f68a3f5f0">FORS_PFITS_PIXSCALE</a>, s->pixel_scale);
-<a name="l00259"></a>00259     
-<a name="l00260"></a>00260     s->version = <a class="code" href="group__forsdfs.html#g61956e9dcf77f5c71db911e0390f63f3">fors_dfs_pipeline_version</a>(header, &(s->instrument));
-<a name="l00261"></a>00261     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,
-<a name="l00262"></a>00262             <span class="stringliteral">"Could not read instrument version from %s header"</span>, 
-<a name="l00263"></a>00263             filename);
-<a name="l00264"></a>00264 
-<a name="l00265"></a>00265     fors_msg(level, <span class="stringliteral">"Instrument (%s) = %s"</span>, 
-<a name="l00266"></a>00266              <a class="code" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">FORS_PFITS_INSTRUME</a>, s->instrument);
-<a name="l00267"></a>00267 
-<a name="l00268"></a>00268     {
-<a name="l00269"></a>00269     <span class="keywordtype">int</span> outputs = cpl_propertylist_get_int(header, <a class="code" href="group__fors__pfits.html#gfaec82e5fe2051be0f32d0e8e01a7060">FORS_PFITS_OUTPUTS</a>);
-<a name="l00270"></a>00270         <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00271"></a>00271             cpl_msg_error(cpl_func, 
-<a name="l00272"></a>00272                           <span class="stringliteral">"Keyword %s is not integer"</span>, 
-<a name="l00273"></a>00273                           <a class="code" href="group__fors__pfits.html#gfaec82e5fe2051be0f32d0e8e01a7060">FORS_PFITS_OUTPUTS</a>);
-<a name="l00274"></a>00274         }
-<a name="l00275"></a>00275     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, 
-<a name="l00276"></a>00276         <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00277"></a>00277         <a class="code" href="group__fors__pfits.html#gfaec82e5fe2051be0f32d0e8e01a7060">FORS_PFITS_OUTPUTS</a>, filename);
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     fors_msg(level, <span class="stringliteral">"Output ports (%s) = %d"</span>, 
-<a name="l00280"></a>00280          <a class="code" href="group__fors__pfits.html#gfaec82e5fe2051be0f32d0e8e01a7060">FORS_PFITS_OUTPUTS</a>, outputs);
-<a name="l00281"></a>00281     
-<a name="l00282"></a>00282     <span class="comment">/* Support only new and old FORS data, where the approximation</span>
-<a name="l00283"></a>00283 <span class="comment">       about using average ron/conad is fine. </span>
-<a name="l00284"></a>00284 <span class="comment">    */</span>
-<a name="l00285"></a>00285     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( outputs == 1 || outputs == 4, <span class="keywordflow">return</span> s,
-<a name="l00286"></a>00286         <span class="stringliteral">"1 or 4 output ports required"</span>);
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     <span class="keywordtype">int</span> i;
-<a name="l00289"></a>00289     s->average_gain = 0;
-<a name="l00290"></a>00290     s->ron = 0;
-<a name="l00291"></a>00291     <span class="keywordflow">for</span>(i = 0; i < outputs; i++) {
-<a name="l00292"></a>00292         
-<a name="l00293"></a>00293         <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a> = cpl_propertylist_get_double(header, 
-<a name="l00294"></a>00294                                                        <a class="code" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a>[i]);
-<a name="l00295"></a>00295             <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00296"></a>00296                 cpl_msg_error(cpl_func, 
-<a name="l00297"></a>00297                               <span class="stringliteral">"Keyword %s is not a double precision type"</span>, 
-<a name="l00298"></a>00298                               <a class="code" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a>[i]);
-<a name="l00299"></a>00299             }
-<a name="l00300"></a>00300         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, 
-<a name="l00301"></a>00301             <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00302"></a>00302             <a class="code" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a>[i], filename);
-<a name="l00303"></a>00303         
-<a name="l00304"></a>00304         fors_msg(level, <span class="stringliteral">"Gain factor (%s) = %.2f e-/ADU"</span>, 
-<a name="l00305"></a>00305              <a class="code" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a>[i], <a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>);
-<a name="l00306"></a>00306         
-<a name="l00307"></a>00307         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a> > 0, <span class="keywordflow">return</span> s, <span class="stringliteral">"%s: Illegal %s: %f, must be positive"</span>,
-<a name="l00308"></a>00308             filename, <a class="code" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a>[i], <a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>);
-<a name="l00309"></a>00309         
-<a name="l00310"></a>00310         <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a> = cpl_propertylist_get_double(header, <a class="code" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">FORS_PFITS_RON</a>[i]);
-<a name="l00311"></a>00311             <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00312"></a>00312                 cpl_msg_error(cpl_func, 
-<a name="l00313"></a>00313                               <span class="stringliteral">"Keyword %s is not a double precision type"</span>, 
-<a name="l00314"></a>00314                               <a class="code" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">FORS_PFITS_RON</a>[i]);
-<a name="l00315"></a>00315             }
-<a name="l00316"></a>00316         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, 
-<a name="l00317"></a>00317             <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00318"></a>00318             <a class="code" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">FORS_PFITS_RON</a>[i], filename);
-<a name="l00319"></a>00319         
-<a name="l00320"></a>00320         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( ron > 0, <span class="keywordflow">return</span> s,
-<a name="l00321"></a>00321             <span class="stringliteral">"%s: Illegal %s: %f, must be positive"</span>,
-<a name="l00322"></a>00322             filename, <a class="code" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">FORS_PFITS_RON</a>[i], ron);
-<a name="l00323"></a>00323         
-<a name="l00324"></a>00324         ron /= <a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>; <span class="comment">/* electrons -> ADU */</span>
-<a name="l00325"></a>00325 
-<a name="l00326"></a>00326         fors_msg(level, <span class="stringliteral">"Read-out-noise (%s) = %.2f ADU"</span>, 
-<a name="l00327"></a>00327              <a class="code" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">FORS_PFITS_RON</a>[i], ron);
-<a name="l00328"></a>00328 
-<a name="l00329"></a>00329         <span class="comment">/* accumulate */</span>
-<a name="l00330"></a>00330         s->ron += ron;
-<a name="l00331"></a>00331         s->average_gain += 1.0/<a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>;
-<a name="l00332"></a>00332     }
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="comment">/* get average */</span>
-<a name="l00335"></a>00335     s->ron          /= outputs;
-<a name="l00336"></a>00336     s->average_gain /= outputs;
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338     <span class="keywordflow">if</span> (outputs > 1) {
-<a name="l00339"></a>00339         fors_msg(level, <span class="stringliteral">"Average gain factor = %.2f e-/ADU"</span>, 
-<a name="l00340"></a>00340              1.0/s->average_gain);
-<a name="l00341"></a>00341 
-<a name="l00342"></a>00342         fors_msg(level, <span class="stringliteral">"Read-out-noise = %.2f ADU"</span>, 
-<a name="l00343"></a>00343              s->ron);
-<a name="l00344"></a>00344     }
-<a name="l00345"></a>00345     }
-<a name="l00346"></a>00346     
-<a name="l00347"></a>00347     s->read_clock = cpl_propertylist_get_string(header, <a class="code" href="group__fors__pfits.html#g43f0b7ed1c32b140f3da959293f924eb">FORS_PFITS_READ_CLOCK</a>);
-<a name="l00348"></a>00348     <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00349"></a>00349         cpl_msg_error(cpl_func, 
-<a name="l00350"></a>00350                       <span class="stringliteral">"Keyword %s is not a string"</span>, 
-<a name="l00351"></a>00351                       <a class="code" href="group__fors__pfits.html#g43f0b7ed1c32b140f3da959293f924eb">FORS_PFITS_READ_CLOCK</a>);
-<a name="l00352"></a>00352     }
-<a name="l00353"></a>00353     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, 
-<a name="l00354"></a>00354             <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00355"></a>00355             <a class="code" href="group__fors__pfits.html#g43f0b7ed1c32b140f3da959293f924eb">FORS_PFITS_READ_CLOCK</a>, filename);
-<a name="l00356"></a>00356 
-<a name="l00357"></a>00357     s->read_clock = cpl_strdup(s->read_clock);
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     fors_msg(level, <span class="stringliteral">"Readout clock pattern (%s) = %s"</span>, 
-<a name="l00360"></a>00360                  <a class="code" href="group__fors__pfits.html#g43f0b7ed1c32b140f3da959293f924eb">FORS_PFITS_READ_CLOCK</a>, s->read_clock);
-<a name="l00361"></a>00361     
-<a name="l00362"></a>00362 
-<a name="l00363"></a>00363     s->chip_id = cpl_propertylist_get_string(header, <a class="code" href="group__fors__pfits.html#g0eb4a071376ffab7bd7fb36186e16dda">FORS_PFITS_CHIP_ID</a>);
-<a name="l00364"></a>00364     <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {
-<a name="l00365"></a>00365         cpl_msg_error(cpl_func, 
-<a name="l00366"></a>00366                       <span class="stringliteral">"Keyword %s is not a string"</span>, 
-<a name="l00367"></a>00367                       <a class="code" href="group__fors__pfits.html#g0eb4a071376ffab7bd7fb36186e16dda">FORS_PFITS_CHIP_ID</a>);
-<a name="l00368"></a>00368     }
-<a name="l00369"></a>00369     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, 
-<a name="l00370"></a>00370             <span class="stringliteral">"Could not read %s from %s header"</span>, 
-<a name="l00371"></a>00371             <a class="code" href="group__fors__pfits.html#g0eb4a071376ffab7bd7fb36186e16dda">FORS_PFITS_CHIP_ID</a>, filename);
-<a name="l00372"></a>00372 
-<a name="l00373"></a>00373     s->chip_id = cpl_strdup(s->chip_id);
-<a name="l00374"></a>00374 
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     fors_msg(level, <span class="stringliteral">"Chip ID (%s) = %s"</span>, 
-<a name="l00377"></a>00377                  <a class="code" href="group__fors__pfits.html#g0eb4a071376ffab7bd7fb36186e16dda">FORS_PFITS_CHIP_ID</a>, s->chip_id);
-<a name="l00378"></a>00378 
-<a name="l00379"></a>00379     cpl_msg_indent_less();
-<a name="l00380"></a>00380     
-<a name="l00381"></a>00381     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00382"></a>00382     <span class="keywordflow">return</span> s;
-<a name="l00383"></a>00383 }
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385 <span class="preprocessor">#undef cleanup</span>
-<a name="l00386"></a><a class="code" href="group__fors__setting.html#g57cf6e6e2826eb178fd2d9c3e5695343">00386</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00387"></a>00387 <span class="preprocessor">do { \</span>
-<a name="l00388"></a>00388 <span class="preprocessor">    fors_setting_delete(&input_setting); \</span>
-<a name="l00389"></a>00389 <span class="preprocessor">} while (0)</span>
-<a name="l00390"></a>00390 <span class="preprocessor"></span>
-<a name="l00400"></a>00400 <span class="keywordtype">void</span>
-<a name="l00401"></a><a class="code" href="group__fors__setting.html#gccd3b501cb380066770b1250942fa02a">00401</a> <a class="code" href="group__fors__setting.html#gccd3b501cb380066770b1250942fa02a">fors_setting_verify</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *ref_setting, <span class="keyword">const</span> cpl_frame *frame,
-<a name="l00402"></a>00402             <a class="code" href="struct__fors__setting.html">fors_setting</a> **setting)
-<a name="l00403"></a>00403 {
-<a name="l00404"></a>00404     <a class="code" href="struct__fors__setting.html">fors_setting</a> *input_setting = NULL;
-<a name="l00405"></a>00405 
-<a name="l00406"></a>00406     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( ref_setting != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00407"></a>00407     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( frame       != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00408"></a>00408     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frame_get_filename(frame) != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410     input_setting = <a class="code" href="group__fors__setting.html#gd72375aaa7f1199f3271f15afd724ded">fors_setting_new_level</a>(frame, CPL_MSG_DEBUG);
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00413"></a>00413             <span class="stringliteral">"Could not get %s instrument setting"</span>,
-<a name="l00414"></a>00414             cpl_frame_get_filename(frame));
-<a name="l00415"></a>00415     
-<a name="l00416"></a>00416 
-<a name="l00417"></a>00417     <span class="keywordflow">if</span> (ref_setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a> != input_setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a> ||
-<a name="l00418"></a>00418         ref_setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a> != input_setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>) {
-<a name="l00419"></a>00419         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible CCD binning: %dx%d"</span>,
-<a name="l00420"></a>00420                         input_setting-><a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>, input_setting-><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>);
-<a name="l00421"></a>00421     }
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423     <span class="keywordflow">if</span> (ref_setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a> != NULL && 
-<a name="l00424"></a>00424         input_setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a> != NULL &&
-<a name="l00425"></a>00425         strcmp(ref_setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a>, input_setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a>) != 0) {
-<a name="l00426"></a>00426         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible filter names: '%s'"</span>,
-<a name="l00427"></a>00427                         input_setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a>);
-<a name="l00428"></a>00428     }
-<a name="l00429"></a>00429 
-<a name="l00430"></a>00430     <span class="keywordflow">if</span> ((ref_setting-><a class="code" href="struct__fors__setting.html#73c8992df1265002a5ad94acbb1f36c9">prescan_x</a> != input_setting-><a class="code" href="struct__fors__setting.html#73c8992df1265002a5ad94acbb1f36c9">prescan_x</a> &&
-<a name="l00431"></a>00431          input_setting-><a class="code" href="struct__fors__setting.html#73c8992df1265002a5ad94acbb1f36c9">prescan_x</a> != 0) ||
-<a name="l00432"></a>00432         (ref_setting-><a class="code" href="struct__fors__setting.html#21a646d60ba3e80ce7ced6c1af9ca03b">prescan_y</a> != input_setting-><a class="code" href="struct__fors__setting.html#21a646d60ba3e80ce7ced6c1af9ca03b">prescan_y</a> &&
-<a name="l00433"></a>00433          input_setting-><a class="code" href="struct__fors__setting.html#21a646d60ba3e80ce7ced6c1af9ca03b">prescan_y</a> != 0)) {
-<a name="l00434"></a>00434         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible CCD x-prescan areas: %dx%d"</span>,
-<a name="l00435"></a>00435                         input_setting-><a class="code" href="struct__fors__setting.html#73c8992df1265002a5ad94acbb1f36c9">prescan_x</a>,
-<a name="l00436"></a>00436                         input_setting-><a class="code" href="struct__fors__setting.html#21a646d60ba3e80ce7ced6c1af9ca03b">prescan_y</a>);
-<a name="l00437"></a>00437     }
-<a name="l00438"></a>00438 
-<a name="l00439"></a>00439     <span class="comment">/* no check on exposure time */</span>
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441     <span class="keywordflow">if</span> (fabs((ref_setting-><a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a> - input_setting-><a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a>) /
-<a name="l00442"></a>00442              ref_setting-><a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a>) > 0.01) {
-<a name="l00443"></a>00443 
-<a name="l00444"></a>00444         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible gain factor: %f e-/ADU"</span>,
-<a name="l00445"></a>00445                         input_setting-><a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a>);
-<a name="l00446"></a>00446     }
-<a name="l00447"></a>00447 
-<a name="l00448"></a>00448 
-<a name="l00449"></a>00449     <span class="keywordflow">if</span> (fabs((ref_setting-><a class="code" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">ron</a> - input_setting-><a class="code" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">ron</a>) /
-<a name="l00450"></a>00450              ref_setting-><a class="code" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">ron</a>) > 0.01) {
-<a name="l00451"></a>00451         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible read-out-noise: %f ADU"</span>,
-<a name="l00452"></a>00452                         input_setting-><a class="code" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">ron</a>);
-<a name="l00453"></a>00453     }
-<a name="l00454"></a>00454 
-<a name="l00455"></a>00455     <span class="keywordflow">if</span> (fabs((ref_setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a> - input_setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>) /
-<a name="l00456"></a>00456              ref_setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>) > 0.01) {
-<a name="l00457"></a>00457         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible pixel scale: %f arcsec/pixel"</span>,
-<a name="l00458"></a>00458                         input_setting-><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>);
-<a name="l00459"></a>00459     }
-<a name="l00460"></a>00460 
-<a name="l00461"></a>00461     <span class="keywordflow">if</span> (strcmp(ref_setting-><a class="code" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">chip_id</a>, input_setting-><a class="code" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">chip_id</a>) != 0) {
-<a name="l00462"></a>00462         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible chip ID: '%s'"</span>,
-<a name="l00463"></a>00463                         input_setting-><a class="code" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">chip_id</a>);
-<a name="l00464"></a>00464     }
-<a name="l00465"></a>00465 
-<a name="l00466"></a>00466     <span class="keywordflow">if</span> (strcmp(ref_setting-><a class="code" href="struct__fors__setting.html#aa40f494f6270154210834327570d1d9">read_clock</a>, input_setting-><a class="code" href="struct__fors__setting.html#aa40f494f6270154210834327570d1d9">read_clock</a>) != 0) {
-<a name="l00467"></a>00467         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible readout clock pattern: '%s'"</span>,
-<a name="l00468"></a>00468                         input_setting-><a class="code" href="struct__fors__setting.html#aa40f494f6270154210834327570d1d9">read_clock</a>);
-<a name="l00469"></a>00469     }
-<a name="l00470"></a>00470 
-<a name="l00471"></a>00471     <span class="keywordflow">if</span> (strcmp(ref_setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>, input_setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>) != 0) {
-<a name="l00472"></a>00472         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible instrument name: '%s'"</span>,
-<a name="l00473"></a>00473                         input_setting-><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>);
-<a name="l00474"></a>00474     }
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476     <span class="keywordflow">if</span> (strcmp(ref_setting-><a class="code" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">version</a>, input_setting-><a class="code" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">version</a>) != 0) {
-<a name="l00477"></a>00477         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible version: '%s'"</span>,
-<a name="l00478"></a>00478                         input_setting-><a class="code" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">version</a>);
-<a name="l00479"></a>00479     }   
-<a name="l00480"></a>00480 
-<a name="l00481"></a>00481     <span class="comment">/* Return setting if requested */</span>
-<a name="l00482"></a>00482     <span class="keywordflow">if</span> (setting != NULL) {
-<a name="l00483"></a>00483         *setting = input_setting;
-<a name="l00484"></a>00484         input_setting = NULL;
-<a name="l00485"></a>00485     }
-<a name="l00486"></a>00486 
-<a name="l00487"></a>00487     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00488"></a>00488     <span class="keywordflow">return</span>;
-<a name="l00489"></a>00489 
-<a name="l00490"></a>00490 }
-<a name="l00491"></a>00491 
-<a name="l00492"></a>00492 
-<a name="l00493"></a>00493 
-<a name="l00498"></a><a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">00498</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(<a class="code" href="struct__fors__setting.html">fors_setting</a> **s)
-<a name="l00499"></a>00499 {
-<a name="l00500"></a>00500     <span class="keywordflow">if</span> (s && *s) {
-<a name="l00501"></a>00501         <span class="keywordflow">if</span> ((*s)->filter_name != NULL) cpl_free((<span class="keywordtype">void</span> *)((*s)->filter_name));
-<a name="l00502"></a>00502         cpl_free((<span class="keywordtype">void</span> *)((*s)->read_clock));
-<a name="l00503"></a>00503         cpl_free((<span class="keywordtype">void</span> *)((*s)->chip_id));
-<a name="l00504"></a>00504         cpl_free((<span class="keywordtype">void</span> *)((*s)->version));
-<a name="l00505"></a>00505         cpl_free((<span class="keywordtype">void</span> *)((*s)->instrument));
-<a name="l00506"></a>00506         cpl_free(*s); *s = NULL;
-<a name="l00507"></a>00507     }
-<a name="l00508"></a>00508     <span class="keywordflow">return</span>;
-<a name="l00509"></a>00509 }
-<a name="l00510"></a>00510 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__setting_8c_source.html b/html/fors__setting_8c_source.html
new file mode 100644
index 0000000..14bdebe
--- /dev/null
+++ b/html/fors__setting_8c_source.html
@@ -0,0 +1,540 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_setting.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_setting.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_setting.c,v 1.19 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.19 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_setting.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_instrument.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">static</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <a class="code" href="group__fors__setting.html#ga05ebcfdde1706094627a0dd4af5186ae" title="Create setting from FITS header.">fors_setting_new_level</a>(<span class="keyword">const</span> cpl_frame *raw, cpl_msg_severity level);</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *</div>
+<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15">   64</a></span> <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(<span class="keyword">const</span> cpl_frame *raw)</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> {</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__setting.html#ga05ebcfdde1706094627a0dd4af5186ae" title="Create setting from FITS header.">fors_setting_new_level</a>(raw, CPL_MSG_INFO);</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> }</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">    cpl_propertylist_delete(header); \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keyword">static</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *</div>
+<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="group__fors__setting.html#ga05ebcfdde1706094627a0dd4af5186ae">   82</a></span> <a class="code" href="group__fors__setting.html#ga05ebcfdde1706094627a0dd4af5186ae" title="Create setting from FITS header.">fors_setting_new_level</a>(<span class="keyword">const</span> cpl_frame *raw, cpl_msg_severity level)</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> {</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *s = NULL;</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     cpl_propertylist *header = NULL;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( raw != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     fors_msg(level, <span class="stringliteral">"Instrument setting:"</span>);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     <span class="comment">/* Load header */</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     filename = cpl_frame_get_filename(raw);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( filename != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Missing frame filename"</span> );</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     header = cpl_propertylist_load(filename, 0);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>             <span class="stringliteral">"Could not read %s primary header"</span>, filename );</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     cpl_msg_debug(cpl_func, <span class="stringliteral">"Reading setting from %s"</span>, filename );</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>         </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="comment">/* Read relevant contents */</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     s = cpl_malloc(<span class="keyword">sizeof</span>(*s));</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> </div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     s->filter_name = NULL;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     s->read_clock = NULL;</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     s->chip_id = NULL;</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     s->instrument = NULL;</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     s->version = NULL;</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     s->binx = cpl_propertylist_get_int(header, FORS_PFITS_BINX);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                       <span class="stringliteral">"Keyword %s is not an integer"</span>, FORS_PFITS_BINX);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     }</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>             <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>             FORS_PFITS_BINX, filename);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     fors_msg(level, <span class="stringliteral">"Detector x-binning (%s) = %d"</span>, FORS_PFITS_BINX, s->binx);</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     s->biny = cpl_propertylist_get_int(header, FORS_PFITS_BINY);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                       <span class="stringliteral">"Keyword %s is not an integer"</span>, FORS_PFITS_BINY);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     }</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>             <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>             FORS_PFITS_BINY, filename);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     fors_msg(level, <span class="stringliteral">"Detector y-binning (%s) = %d"</span>, FORS_PFITS_BINY, s->biny);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, FORS_PFITS_PRESCANX)) {</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>         </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         s->prescan_x = cpl_propertylist_get_int(header, FORS_PFITS_PRESCANX);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>         <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>             cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                           <span class="stringliteral">"Keyword %s is not an integer"</span>, FORS_PFITS_PRESCANX);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>         }</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                 <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                 FORS_PFITS_PRESCANX, filename);</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>         </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     }</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>         s->prescan_x = 0;</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     }</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     fors_msg(level, <span class="stringliteral">"Detector x-prescan (%s) = %d"</span>,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>              FORS_PFITS_PRESCANX, s->prescan_x);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, FORS_PFITS_PRESCANY)) {</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>         </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>         s->prescan_y = cpl_propertylist_get_int(header, FORS_PFITS_PRESCANY);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>         <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>             cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                           <span class="stringliteral">"Keyword %s is not an integer"</span>, FORS_PFITS_PRESCANY);</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>         }</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>                 <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>                 FORS_PFITS_PRESCANY, filename);</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     }</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>         s->prescan_y = 0;</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     }</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     fors_msg(level, <span class="stringliteral">"Detector y-prescan (%s) = %d"</span>,</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>              FORS_PFITS_PRESCANY, s->prescan_y);</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, FORS_PFITS_FILTER_NAME)) {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>         s->filter_name = cpl_propertylist_get_string(header, </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>                                                      FORS_PFITS_FILTER_NAME);</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>         <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>             cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                           <span class="stringliteral">"Keyword %s is not a string"</span>, </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                           FORS_PFITS_FILTER_NAME);</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>         }</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>                 <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                 FORS_PFITS_FILTER_NAME, filename);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         <span class="comment">/* Allocate new string (after the check for NULL and</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="comment">           before deallocating the cpl_propertylist) */</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>         s->filter_name = cpl_strdup(s->filter_name);</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>         fors_msg(level, <span class="stringliteral">"Filter name (%s) = %s"</span>, </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                      FORS_PFITS_FILTER_NAME, s->filter_name);</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>         </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>         cpl_errorstate  es = cpl_errorstate_get();</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>         s->filterband = fors_instrument_filterband_get_by_setting(s);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>         <span class="comment">/* for some reason, the old code did not set an error, so reset */</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>         cpl_errorstate_set(es);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>         </div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>         <span class="keywordtype">bool</span> recognized = fors_instrument_filterband_is_defined(s->filterband);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>         </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="comment">/* %%% New part...  */</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>         <span class="keywordflow">if</span> (!recognized) {</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Non-standard filter..."</span>);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>             <span class="comment">/*s->filter = FILTER_U;*/</span> <span class="comment">//fixme</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>             cpl_free(s->filter_name);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>             s->filter_name = NULL;</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>         }</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="comment">/***</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> <span class="comment">        assure( recognized, return s, "%s: %s: Unrecognized filter name: '%s'",</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="comment">                filename, FORS_PFITS_FILTER_NAME, s->filter_name );</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="comment">***/</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     }</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>         <span class="comment">/* No raw frame filter (e.g. rawbias) */</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>         s->filterband = fors_instrument_filterband_value_unknown();</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>         <span class="comment">/*s->filter = FILTER_U;*/</span> <span class="comment">//fixme</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>         s->filter_name = NULL;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     }</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     </div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, FORS_PFITS_EXPOSURE_TIME)) {</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>         s->exposure_time = cpl_propertylist_get_double(header, </div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                            FORS_PFITS_EXPOSURE_TIME);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>         <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>             cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>                           <span class="stringliteral">"Keyword %s is not a double precision type"</span>, </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>                           FORS_PFITS_EXPOSURE_TIME);</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>         }</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, </div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                 <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                 FORS_PFITS_EXPOSURE_TIME, filename);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>         </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>         fors_msg(level, <span class="stringliteral">"Exposure time (%s) = %f s"</span>, </div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                      FORS_PFITS_EXPOSURE_TIME, s->exposure_time);</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     }</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"%s: Missing keyword '%s'"</span>,</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>                       filename, FORS_PFITS_EXPOSURE_TIME);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     }</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     s->pixel_scale = cpl_propertylist_get_double(header, FORS_PFITS_PIXSCALE);</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                       <span class="stringliteral">"Keyword %s is not a double precision type"</span>, </div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                       FORS_PFITS_PIXSCALE);</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     }</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>             <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>             FORS_PFITS_PIXSCALE, filename);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     fors_msg(level, <span class="stringliteral">"Pixel scale (%s) = %f arcsec/pixel"</span>, </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>                  FORS_PFITS_PIXSCALE, s->pixel_scale);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s->pixel_scale > 0, <span class="keywordflow">return</span> s,</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>             <span class="stringliteral">"%s: %s is non-positive (%f arcsec/pixel)"</span>,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>             filename, FORS_PFITS_PIXSCALE, s->pixel_scale);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     s->version = <a class="code" href="group__forsdfs.html#ga31c40f4add0fc7ef1e992d99493f5d1a" title="Get pipeline and instrument versions.">fors_dfs_pipeline_version</a>(header, &(s->instrument));</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>             <span class="stringliteral">"Could not read instrument version from %s header"</span>, </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>             filename);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     fors_msg(level, <span class="stringliteral">"Instrument (%s) = %s"</span>, </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>              FORS_PFITS_INSTRUME, s->instrument);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     {</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="keywordtype">int</span> outputs = cpl_propertylist_get_int(header, FORS_PFITS_OUTPUTS);</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>         <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>             cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>                           <span class="stringliteral">"Keyword %s is not integer"</span>, </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                           FORS_PFITS_OUTPUTS);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>         }</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>         <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>         FORS_PFITS_OUTPUTS, filename);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     fors_msg(level, <span class="stringliteral">"Output ports (%s) = %d"</span>, </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>          FORS_PFITS_OUTPUTS, outputs);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="comment">/* Support only new and old FORS data, where the approximation</span></div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> <span class="comment">       about using average ron/conad is fine. </span></div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( outputs == 1 || outputs == 4, <span class="keywordflow">return</span> s,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>         <span class="stringliteral">"1 or 4 output ports required"</span>);</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     s->average_gain = 0;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     s->ron = 0;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     <span class="keywordflow">for</span>(i = 0; i < outputs; i++) {</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>         </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>         <span class="keywordtype">double</span> conad = cpl_propertylist_get_double(header, </div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                                                        FORS_PFITS_CONAD[i]);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>             <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                 cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                               <span class="stringliteral">"Keyword %s is not a double precision type"</span>, </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                               FORS_PFITS_CONAD[i]);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>             }</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>             <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>             FORS_PFITS_CONAD[i], filename);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>         </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>         fors_msg(level, <span class="stringliteral">"Gain factor (%s) = %.2f e-/ADU"</span>, </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>              FORS_PFITS_CONAD[i], conad);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( conad > 0, <span class="keywordflow">return</span> s, <span class="stringliteral">"%s: Illegal %s: %f, must be positive"</span>,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>             filename, FORS_PFITS_CONAD[i], conad);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>         </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>         <span class="keywordtype">double</span> ron = cpl_propertylist_get_double(header, FORS_PFITS_RON[i]);</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>             <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>                 cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                               <span class="stringliteral">"Keyword %s is not a double precision type"</span>, </div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                               FORS_PFITS_RON[i]);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>             }</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>             <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>             FORS_PFITS_RON[i], filename);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>         </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( ron > 0, <span class="keywordflow">return</span> s,</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>             <span class="stringliteral">"%s: Illegal %s: %f, must be positive"</span>,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>             filename, FORS_PFITS_RON[i], ron);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>         </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>         ron /= conad; <span class="comment">/* electrons -> ADU */</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> </div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>         fors_msg(level, <span class="stringliteral">"Read-out-noise (%s) = %.2f ADU"</span>, </div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>              FORS_PFITS_RON[i], ron);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> </div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>         <span class="comment">/* accumulate */</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>         s->ron += ron;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>         s->average_gain += 1.0/conad;</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     }</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="comment">/* get average */</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     s->ron          /= outputs;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     s->average_gain /= outputs;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordflow">if</span> (outputs > 1) {</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>         fors_msg(level, <span class="stringliteral">"Average gain factor = %.2f e-/ADU"</span>, </div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>              1.0/s->average_gain);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> </div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         fors_msg(level, <span class="stringliteral">"Read-out-noise = %.2f ADU"</span>, </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>              s->ron);</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     }</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     }</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     s->read_clock = cpl_propertylist_get_string(header, FORS_PFITS_READ_CLOCK);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>                       <span class="stringliteral">"Keyword %s is not a string"</span>, </div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>                       FORS_PFITS_READ_CLOCK);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     }</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, </div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>             <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>             FORS_PFITS_READ_CLOCK, filename);</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> </div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     s->read_clock = cpl_strdup(s->read_clock);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     fors_msg(level, <span class="stringliteral">"Readout clock pattern (%s) = %s"</span>, </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>                  FORS_PFITS_READ_CLOCK, s->read_clock);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     s->chip_id = cpl_propertylist_get_string(header, FORS_PFITS_CHIP_ID);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="keywordflow">if</span> (CPL_ERROR_TYPE_MISMATCH == cpl_error_get_code()) {</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                       <span class="stringliteral">"Keyword %s is not a string"</span>, </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                       FORS_PFITS_CHIP_ID);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     }</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> s, </div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>             <span class="stringliteral">"Could not read %s from %s header"</span>, </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>             FORS_PFITS_CHIP_ID, filename);</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> </div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     s->chip_id = cpl_strdup(s->chip_id);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> </div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     fors_msg(level, <span class="stringliteral">"Chip ID (%s) = %s"</span>, </div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>                  FORS_PFITS_CHIP_ID, s->chip_id);</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     </div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     cleanup;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keywordflow">return</span> s;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> }</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="preprocessor">    fors_setting_delete(&input_setting); \</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno"><a class="code" href="group__fors__setting.html#ga160a93959e72b826426891ca8e0f80aa">  401</a></span> <a class="code" href="group__fors__setting.html#ga160a93959e72b826426891ca8e0f80aa" title="Verify that instrument settings are compatible.">fors_setting_verify</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *ref_setting, <span class="keyword">const</span> cpl_frame * [...]
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>             <a class="code" href="struct__fors__setting.html">fors_setting</a> **setting)</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> {</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *input_setting = NULL;</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( ref_setting != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( frame       != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frame_get_filename(frame) != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> </div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     input_setting = <a class="code" href="group__fors__setting.html#ga05ebcfdde1706094627a0dd4af5186ae" title="Create setting from FITS header.">fors_setting_new_level</a>(frame, CPL_MSG_DEBUG);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>             <span class="stringliteral">"Could not get %s instrument setting"</span>,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>             cpl_frame_get_filename(frame));</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     </div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     <span class="keywordflow">if</span> (ref_setting->binx != input_setting->binx ||</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>         ref_setting->biny != input_setting->biny) {</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible CCD binning: %dx%d"</span>,</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                         input_setting->binx, input_setting->biny);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     }</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     <span class="keywordflow">if</span> (ref_setting->filter_name != NULL && </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>         input_setting->filter_name != NULL &&</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         strcmp(ref_setting->filter_name, input_setting->filter_name) != 0) {</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible filter names: '%s'"</span>,</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                         input_setting->filter_name);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     }</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> </div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     <span class="keywordflow">if</span> ((ref_setting->prescan_x != input_setting->prescan_x &&</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>          input_setting->prescan_x != 0) ||</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>         (ref_setting->prescan_y != input_setting->prescan_y &&</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>          input_setting->prescan_y != 0)) {</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible CCD x-prescan areas: %dx%d"</span>,</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                         input_setting->prescan_x,</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                         input_setting->prescan_y);</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     }</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <span class="comment">/* no check on exposure time */</span></div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordflow">if</span> (fabs((ref_setting->average_gain - input_setting->average_gain) /</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>              ref_setting->average_gain) > 0.01) {</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible gain factor: %f e-/ADU"</span>,</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>                         input_setting->average_gain);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     }</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> </div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     <span class="keywordflow">if</span> (fabs((ref_setting->ron - input_setting->ron) /</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>              ref_setting->ron) > 0.01) {</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible read-out-noise: %f ADU"</span>,</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>                         input_setting->ron);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     }</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordflow">if</span> (fabs((ref_setting->pixel_scale - input_setting->pixel_scale) /</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>              ref_setting->pixel_scale) > 0.01) {</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible pixel scale: %f arcsec/pixel"</span>,</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>                         input_setting->pixel_scale);</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     }</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span> </div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     <span class="keywordflow">if</span> (strcmp(ref_setting->chip_id, input_setting->chip_id) != 0) {</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible chip ID: '%s'"</span>,</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>                         input_setting->chip_id);</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     }</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> </div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     <span class="keywordflow">if</span> (strcmp(ref_setting->read_clock, input_setting->read_clock) != 0) {</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible readout clock pattern: '%s'"</span>,</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>                         input_setting->read_clock);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     }</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     <span class="keywordflow">if</span> (strcmp(ref_setting->instrument, input_setting->instrument) != 0) {</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible instrument name: '%s'"</span>,</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                         input_setting->instrument);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     }</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> </div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     <span class="keywordflow">if</span> (strcmp(ref_setting->version, input_setting->version) != 0) {</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Incompatible version: '%s'"</span>,</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>                         input_setting->version);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     }   </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> </div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     <span class="comment">/* Return setting if requested */</span></div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     <span class="keywordflow">if</span> (setting != NULL) {</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         *setting = input_setting;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>         input_setting = NULL;</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     }</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> </div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     cleanup;</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> </div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span> }</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> </div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> </div>
+<div class="line"><a name="l00498"></a><span class="lineno"><a class="code" href="group__fors__setting.html#ga6a9999a057167a310f81224d0218cb83">  498</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__setting.html#ga6a9999a057167a310f81224d0218cb83" title="Deallocate and and set pointer to NULL.">fors_setting_delete</a>(<a class="code" href="struct__fors__setting.html">fors_setting</a> **s)</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> {</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     <span class="keywordflow">if</span> (s && *s) {</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>         <span class="keywordflow">if</span> ((*s)->filter_name != NULL) cpl_free((<span class="keywordtype">void</span> *)((*s)->filter_name));</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>         cpl_free((<span class="keywordtype">void</span> *)((*s)->read_clock));</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>         cpl_free((<span class="keywordtype">void</span> *)((*s)->chip_id));</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         cpl_free((<span class="keywordtype">void</span> *)((*s)->version));</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         cpl_free((<span class="keywordtype">void</span> *)((*s)->instrument));</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         cpl_free(*s); *s = NULL;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     }</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> }</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__setting_8h-source.html b/html/fors__setting_8h-source.html
deleted file mode 100644
index 96e5bcf..0000000
--- a/html/fors__setting_8h-source.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_setting.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_setting.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_setting.h,v 1.16 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.16 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_SETTING_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_SETTING_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 <span class="comment">/* deprecate this, only kept for now for</span>
-<a name="l00034"></a>00034 <span class="comment"> * create_phot.c, fors_data.c, test_simulate.c */</span>
-<a name="l00035"></a>00035     <span class="keyword">enum</span> filter
-<a name="l00036"></a>00036     {
-<a name="l00037"></a>00037         FILTER_U, 
-<a name="l00038"></a>00038         FILTER_B, 
-<a name="l00039"></a>00039         FILTER_G,
-<a name="l00040"></a>00040         FILTER_V, 
-<a name="l00041"></a>00041         FILTER_R, 
-<a name="l00042"></a>00042         FILTER_I, 
-<a name="l00043"></a>00043         FILTER_Z
-<a name="l00044"></a>00044     };
-<a name="l00045"></a>00045 <span class="preprocessor">    #define FORS_NUM_FILTER 7</span>
-<a name="l00046"></a>00046 <span class="preprocessor"></span>
-<a name="l00047"></a><a class="code" href="struct__fors__setting.html">00047</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__setting.html">_fors_setting</a> {
-<a name="l00048"></a>00048 
-<a name="l00049"></a><a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">00049</a>     <span class="keywordtype">int</span>         <a class="code" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a>,
-<a name="l00050"></a>00050                 <a class="code" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a>;
-<a name="l00051"></a>00051 
-<a name="l00052"></a><a class="code" href="struct__fors__setting.html#21a646d60ba3e80ce7ced6c1af9ca03b">00052</a>     <span class="keywordtype">int</span>         <a class="code" href="struct__fors__setting.html#73c8992df1265002a5ad94acbb1f36c9">prescan_x</a>,
-<a name="l00053"></a>00053                 <a class="code" href="struct__fors__setting.html#21a646d60ba3e80ce7ced6c1af9ca03b">prescan_y</a>;   <span class="comment">/* prescan width in </span>
-<a name="l00054"></a>00054 <span class="comment">                   software (binned) pixels */</span>
-<a name="l00055"></a>00055     
-<a name="l00056"></a>00056 <span class="comment">/* not used for now</span>
-<a name="l00057"></a>00057 <span class="comment">   int ccd_x, ccd_y;  / * CCD size in</span>
-<a name="l00058"></a>00058 <span class="comment">              physical pixels,</span>
-<a name="l00059"></a>00059 <span class="comment">              not FITS pixels </span>
-<a name="l00060"></a>00060 <span class="comment">               */</span>
-<a name="l00061"></a><a class="code" href="struct__fors__setting.html#1bc4ab059bf8d162814b5c2cb231142c">00061</a>     <span class="keywordtype">char</span>        <a class="code" href="struct__fors__setting.html#1bc4ab059bf8d162814b5c2cb231142c">filterband</a>;
-<a name="l00062"></a>00062 
-<a name="l00063"></a><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">00063</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *<a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a>; <span class="comment">/* NULL if no filter */</span>
-<a name="l00064"></a>00064 
-<a name="l00065"></a><a class="code" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">00065</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">exposure_time</a>;  <span class="comment">/* seconds */</span>
-<a name="l00066"></a>00066 
-<a name="l00067"></a><a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">00067</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a>;  <span class="comment">/* average ESO gain of all read-out ports */</span>
-<a name="l00068"></a>00068 
-<a name="l00069"></a><a class="code" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">00069</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">ron</a>;    <span class="comment">/* average read-out-noise (ADU) of all read-out ports */</span>
-<a name="l00070"></a>00070 
-<a name="l00071"></a><a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">00071</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a>;  <span class="comment">/*  arcsec/pixel, positive */</span>
-<a name="l00072"></a>00072 
-<a name="l00073"></a><a class="code" href="struct__fors__setting.html#aa40f494f6270154210834327570d1d9">00073</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *<a class="code" href="struct__fors__setting.html#aa40f494f6270154210834327570d1d9">read_clock</a>;
-<a name="l00074"></a><a class="code" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">00074</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *<a class="code" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">chip_id</a>;
-<a name="l00075"></a>00075 
-<a name="l00076"></a><a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">00076</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *<a class="code" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a>;  <span class="comment">/* e.g. fors1 */</span>
-<a name="l00077"></a><a class="code" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">00077</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *<a class="code" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">version</a>;     <span class="comment">/* e.g. fors1/4.0.0 */</span>
-<a name="l00078"></a>00078     
-<a name="l00079"></a>00079 } <a class="code" href="struct__fors__setting.html">fors_setting</a>;
-<a name="l00080"></a>00080 
-<a name="l00081"></a>00081 <a class="code" href="struct__fors__setting.html">fors_setting</a> *
-<a name="l00082"></a>00082 <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(<span class="keyword">const</span> cpl_frame *raw);
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084 <span class="keywordtype">void</span>
-<a name="l00085"></a>00085 <a class="code" href="group__fors__setting.html#gccd3b501cb380066770b1250942fa02a">fors_setting_verify</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *ref_setting, <span class="keyword">const</span> cpl_frame *frame,
-<a name="l00086"></a>00086             <a class="code" href="struct__fors__setting.html">fors_setting</a> **setting);
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 <span class="keywordtype">void</span> <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(<a class="code" href="struct__fors__setting.html">fors_setting</a> **s);
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__setting_8h_source.html b/html/fors__setting_8h_source.html
new file mode 100644
index 0000000..605dc57
--- /dev/null
+++ b/html/fors__setting_8h_source.html
@@ -0,0 +1,151 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_setting.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_setting.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_setting.h,v 1.16 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.16 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_SETTING_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_SETTING_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">/* deprecate this, only kept for now for</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="comment"> * create_phot.c, fors_data.c, test_simulate.c */</span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span>     <span class="keyword">enum</span> filter</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span>     {</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span>         FILTER_U, </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span>         FILTER_B, </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>         FILTER_G,</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>         FILTER_V, </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>         FILTER_R, </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>         FILTER_I, </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>         FILTER_Z</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>     };</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">    #define FORS_NUM_FILTER 7</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="struct__fors__setting.html">   47</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__setting.html">_fors_setting</a> {</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>     <span class="keywordtype">int</span>         binx,</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>                 biny;</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>     <span class="keywordtype">int</span>         prescan_x,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>                 prescan_y;   <span class="comment">/* prescan width in </span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">                   software (binned) pixels */</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>     </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="comment">/* not used for now</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="comment">   int ccd_x, ccd_y;  / * CCD size in</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="comment">              physical pixels,</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="comment">              not FITS pixels </span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="comment">               */</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <span class="keywordtype">char</span>        filterband;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *filter_name; <span class="comment">/* NULL if no filter */</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     <span class="keywordtype">double</span>      exposure_time;  <span class="comment">/* seconds */</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordtype">double</span>      average_gain;  <span class="comment">/* average ESO gain of all read-out ports */</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <span class="keywordtype">double</span>      ron;    <span class="comment">/* average read-out-noise (ADU) of all read-out ports */</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <span class="keywordtype">double</span>      pixel_scale;  <span class="comment">/*  arcsec/pixel, positive */</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *read_clock;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *chip_id;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *instrument;  <span class="comment">/* e.g. fors1 */</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *version;     <span class="comment">/* e.g. fors1/4.0.0 */</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> } <a class="code" href="struct__fors__setting.html">fors_setting</a>;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(<span class="keyword">const</span> cpl_frame *raw);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <a class="code" href="group__fors__setting.html#ga160a93959e72b826426891ca8e0f80aa" title="Verify that instrument settings are compatible.">fors_setting_verify</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *ref_setting, <span class="keyword">const</span> cpl_frame *frame,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>             <a class="code" href="struct__fors__setting.html">fors_setting</a> **setting);</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__setting.html#ga6a9999a057167a310f81224d0218cb83" title="Deallocate and and set pointer to NULL.">fors_setting_delete</a>(<a class="code" href="struct__fors__setting.html">fors_setting</a> **s);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__stack-test_8c-source.html b/html/fors__stack-test_8c-source.html
deleted file mode 100644
index e2acf0d..0000000
--- a/html/fors__stack-test_8c-source.html
+++ /dev/null
@@ -1,175 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_stack-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_stack-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_stack-test.c,v 1.9 2008/02/28 15:06:54 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2008/02/28 15:06:54 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.9 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_stack.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <test.h></span>
-<a name="l00039"></a>00039 
-<a name="l00046"></a>00046 <span class="preprocessor">#undef cleanup</span>
-<a name="l00047"></a><a class="code" href="group__fors__stack__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00047</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00048"></a>00048 <span class="preprocessor">do { \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">    cpl_frameset_delete(raw); \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">    fors_stack_method_delete(&sm); \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">    fors_image_list_delete_const(&ilist, fors_image_delete); \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">} while(0)</span>
-<a name="l00055"></a>00055 <span class="preprocessor"></span>
-<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00060"></a><a class="code" href="group__fors__stack__test.html#gebc137d2e81f7bcda320a7f92beca077">00060</a> <a class="code" href="group__fors__stack__test.html#gebc137d2e81f7bcda320a7f92beca077">test_stack</a>(<span class="keywordtype">void</span>)
-<a name="l00061"></a>00061 {
-<a name="l00062"></a>00062     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> N = 3;
-<a name="l00063"></a>00063     <span class="keyword">const</span> fors_image_list *ilist = NULL;
-<a name="l00064"></a>00064     cpl_frameset *raw = cpl_frameset_new();
-<a name="l00065"></a>00065     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00066"></a>00066     stack_method *sm = NULL;
-<a name="l00067"></a>00067     <a class="code" href="struct__fors__image.html">fors_image</a> *master = NULL;
-<a name="l00068"></a>00068     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_filename = NULL;
-<a name="l00069"></a>00069     cpl_parameterlist *parameters = NULL;
-<a name="l00070"></a>00070     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename[] = {<span class="stringliteral">"stack_bias_1.fits"</span>,
-<a name="l00071"></a>00071                               <span class="stringliteral">"stack_bias_2.fits"</span>,
-<a name="l00072"></a>00072                               <span class="stringliteral">"stack_bias_3.fits"</span>};
-<a name="l00073"></a>00073 
-<a name="l00074"></a>00074     <span class="keyword">const</span> <span class="keywordtype">char</span> *method[] = {<span class="stringliteral">"average"</span>,
-<a name="l00075"></a>00075                             <span class="stringliteral">"median"</span>,
-<a name="l00076"></a>00076                             <span class="stringliteral">"minmax"</span>,
-<a name="l00077"></a>00077                             <span class="stringliteral">"ksigma"</span>};
-<a name="l00078"></a>00078     <span class="keywordtype">unsigned</span> i;
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080     <span class="comment">/* Simulate raw bias */</span>
-<a name="l00081"></a>00081     <span class="keywordflow">for</span> (i = 0; i < N; i++) {
-<a name="l00082"></a>00082         cpl_frame *bias;
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084         bias = <a class="code" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">create_bias</a>(filename[i], BIAS, CPL_FRAME_GROUP_RAW);
-<a name="l00085"></a>00085 
-<a name="l00086"></a>00086         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00087"></a>00087                 <span class="stringliteral">"Create bias %s failed"</span>, filename[i] );
-<a name="l00088"></a>00088     
-<a name="l00089"></a>00089         cpl_frameset_insert(raw, bias);
-<a name="l00090"></a>00090     }
-<a name="l00091"></a>00091 
-<a name="l00092"></a>00092     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_get_first(raw));
-<a name="l00093"></a>00093 
-<a name="l00094"></a>00094     ilist = <a class="code" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list</a>(raw, NULL, setting, NULL);
-<a name="l00095"></a>00095     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( ilist != NULL, <span class="keywordflow">return</span>, <span class="stringliteral">"Loading list failed"</span> );
-<a name="l00096"></a>00096     
-<a name="l00097"></a>00097     test_eq( fors_image_list_size(ilist), 3 );
-<a name="l00098"></a>00098     
-<a name="l00099"></a>00099     <span class="comment">/* For each stack method */</span>
-<a name="l00100"></a>00100     <span class="keywordflow">for</span> (i = 0; i < 2; i++) {
-<a name="l00101"></a>00101 <span class="comment">//fixme: enable these tests    for (i = 0; i < sizeof(method)/sizeof(char *); i++) {</span>
-<a name="l00102"></a>00102         <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> context = <span class="stringliteral">"test"</span>;
-<a name="l00103"></a>00103         
-<a name="l00104"></a>00104         parameters = cpl_parameterlist_new();
-<a name="l00105"></a>00105         
-<a name="l00106"></a>00106         <a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a>(parameters, context, <span class="stringliteral">"median"</span>);
-<a name="l00107"></a>00107         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00108"></a>00108                 <span class="stringliteral">"Define parameters"</span> );
-<a name="l00109"></a>00109         
-<a name="l00110"></a>00110         cpl_parameter_set_string(cpl_parameterlist_find(
-<a name="l00111"></a>00111                                      parameters, <span class="stringliteral">"test.stack_method"</span>),
-<a name="l00112"></a>00112                                  method[i]);
-<a name="l00113"></a>00113         
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115         sm = <a class="code" href="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af">fors_stack_method_new</a>(parameters, context);
-<a name="l00116"></a>00116         
-<a name="l00117"></a>00117         <span class="comment">/* Call function */</span>
-<a name="l00118"></a>00118         master = <a class="code" href="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac">fors_stack_const</a>(ilist, sm);
-<a name="l00119"></a>00119         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00120"></a>00120                 <span class="stringliteral">"Could not stack images using method %s"</span>, method[i]);
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122         <span class="comment">/* Compare results */</span>
-<a name="l00123"></a>00123         
-<a name="l00124"></a>00124         <span class="comment">/* Same level */</span>
-<a name="l00125"></a>00125         test_abs( <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(master, NULL), 
-<a name="l00126"></a>00126                   <a class="code" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a>(fors_image_list_first_const(ilist), NULL), 1.0);
-<a name="l00127"></a>00127 
-<a name="l00128"></a>00128         <span class="comment">/* Test that avg(sigma_i) is consistent with empirical stdev */</span>
-<a name="l00129"></a>00129         test_rel( <a class="code" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">fors_image_get_stdev</a>(master, NULL), 
-<a name="l00130"></a>00130                   <a class="code" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a>(master, NULL), 
-<a name="l00131"></a>00131                   i == 0 ? 0.01 :
-<a name="l00132"></a>00132                   i == 1 ? 0.1 : 0.01);
-<a name="l00133"></a>00133 
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135         <span class="comment">/* Save */</span>
-<a name="l00136"></a>00136         master_filename = cpl_sprintf(<span class="stringliteral">"stack_master_bias_%s.fits"</span>, method[i]);
-<a name="l00137"></a>00137         
-<a name="l00138"></a>00138         <a class="code" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save</a>(master, NULL, master_filename);
-<a name="l00139"></a>00139         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00140"></a>00140                 <span class="stringliteral">"Error saving stacked image to %s"</span>, master_filename);
-<a name="l00141"></a>00141 
-<a name="l00142"></a>00142 
-<a name="l00143"></a>00143         <a class="code" href="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13">fors_stack_method_delete</a>(&sm);
-<a name="l00144"></a>00144         cpl_parameterlist_delete(parameters); parameters = NULL;        
-<a name="l00145"></a>00145         <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master);                        
-<a name="l00146"></a>00146         cpl_free((<span class="keywordtype">void</span> *)master_filename); master_filename = NULL;
-<a name="l00147"></a>00147     }
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00150"></a>00150     <span class="keywordflow">return</span>;
-<a name="l00151"></a>00151 }
-<a name="l00152"></a>00152 
-<a name="l00156"></a><a class="code" href="group__fors__stack__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00156</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00157"></a>00157 {
-<a name="l00158"></a>00158     TEST_INIT;
-<a name="l00159"></a>00159 
-<a name="l00160"></a>00160     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span>
-<a name="l00161"></a>00161     <a class="code" href="group__fors__stack__test.html#gebc137d2e81f7bcda320a7f92beca077">test_stack</a>();
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     TEST_END;
-<a name="l00164"></a>00164 }
-<a name="l00165"></a>00165 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__stack-test_8c_source.html b/html/fors__stack-test_8c_source.html
new file mode 100644
index 0000000..7f14729
--- /dev/null
+++ b/html/fors__stack-test_8c_source.html
@@ -0,0 +1,214 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_stack-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_stack-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_stack-test.c,v 1.10 2013-09-11 10:04:50 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-11 10:04:50 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.10 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_stack.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">    cpl_frameset_delete(raw); \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">    fors_stack_method_delete(&sm); \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">    fors_image_list_delete_const(&ilist, fors_image_delete); \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="group__fors__stack__test.html#gafae5d1fcc553808ac2e0c37908648cac">   60</a></span> <a class="code" href="group__fors__stack__test.html#gafae5d1fcc553808ac2e0c37908648cac" title="Test image i/o + stacking.">test_stack</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> {</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> N = 3;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     <span class="keyword">const</span> fors_image_list *ilist = NULL;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_frameset *raw = cpl_frameset_new();</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     stack_method *sm = NULL;</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master = NULL;</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_filename = NULL;</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     cpl_parameterlist *parameters = NULL;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename[] = {<span class="stringliteral">"stack_bias_1.fits"</span>,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                               <span class="stringliteral">"stack_bias_2.fits"</span>,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                               <span class="stringliteral">"stack_bias_3.fits"</span>};</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> </div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *method[] = {<span class="stringliteral">"average"</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                             <span class="stringliteral">"median"</span>,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>                             <span class="stringliteral">"minmax"</span>,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                             <span class="stringliteral">"ksigma"</span>};</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <span class="keywordtype">unsigned</span> i;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     <span class="comment">/* Simulate raw bias */</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     <span class="keywordflow">for</span> (i = 0; i < N; i++) {</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>         cpl_frame *bias;</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>         bias = <a class="code" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e" title="Simulate bias image.">create_bias</a>(filename[i], BIAS, CPL_FRAME_GROUP_RAW);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> </div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                 <span class="stringliteral">"Create bias %s failed"</span>, filename[i] );</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>         cpl_frameset_insert(raw, bias);</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     }</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_get_position(raw, 0));</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     ilist = <a class="code" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list</a>(raw, NULL, setting, NULL);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( ilist != NULL, <span class="keywordflow">return</span>, <span class="stringliteral">"Loading list failed"</span> );</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     test_eq( fors_image_list_size(ilist), 3 );</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     <span class="comment">/* For each stack method */</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="keywordflow">for</span> (i = 0; i < 2; i++) {</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="comment">//fixme: enable these tests    for (i = 0; i < sizeof(method)/sizeof(char *); i++) {</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> context = <span class="stringliteral">"test"</span>;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>         </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>         parameters = cpl_parameterlist_new();</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>         </div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>         <a class="code" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15" title="Define recipe parameters.">fors_stack_define_parameters</a>(parameters, context, <span class="stringliteral">"median"</span>);</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                 <span class="stringliteral">"Define parameters"</span> );</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>         </div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>         cpl_parameter_set_string(cpl_parameterlist_find(</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                                      parameters, <span class="stringliteral">"test.stack_method"</span>),</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                                  method[i]);</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>         </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>         sm = <a class="code" href="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e" title="Get stack method from parameter list.">fors_stack_method_new</a>(parameters, context);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>         </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>         <span class="comment">/* Call function */</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         master = <a class="code" href="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc" title="Stack images.">fors_stack_const</a>(ilist, sm);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                 <span class="stringliteral">"Could not stack images using method %s"</span>, method[i]);</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>         <span class="comment">/* Compare results */</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>         </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>         <span class="comment">/* Same level */</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>         test_abs( <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(master, NULL), </div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                   <a class="code" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f" title="Get mean data value.">fors_image_get_mean</a>(fors_image_list_first_const(ilist), NULL), 1.0);</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> </div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>         <span class="comment">/* Test that avg(sigma_i) is consistent with empirical stdev */</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         test_rel( <a class="code" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e" title="Get empirical stdev of data.">fors_image_get_stdev</a>(master, NULL), </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                   <a class="code" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4" title="Get mean of error bars.">fors_image_get_error_mean</a>(master, NULL), </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                   i == 0 ? 0.01 :</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>                   i == 1 ? 0.1 : 0.01);</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>         <span class="comment">/* Save */</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         master_filename = cpl_sprintf(<span class="stringliteral">"stack_master_bias_%s.fits"</span>, method[i]);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>         </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>         <a class="code" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save</a>(master, NULL, master_filename);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                 <span class="stringliteral">"Error saving stacked image to %s"</span>, master_filename);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <a class="code" href="group__fors__stack.html#ga9b1d85fcb31770b51259b8aa24c47ae2" title="Destructor.">fors_stack_method_delete</a>(&sm);</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>         cpl_parameterlist_delete(parameters); parameters = NULL;        </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&master);                        </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>         cpl_free((<span class="keywordtype">void</span> *)master_filename); master_filename = NULL;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     }</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     cleanup;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> }</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno"><a class="code" href="group__fors__stack__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  156</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> {</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     TEST_INIT;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> </div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <a class="code" href="group__fors__stack__test.html#gafae5d1fcc553808ac2e0c37908648cac" title="Test image i/o + stacking.">test_stack</a>();</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     TEST_END;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> }</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__stack_8c-source.html b/html/fors__stack_8c-source.html
deleted file mode 100644
index 9ff89e4..0000000
--- a/html/fors__stack_8c-source.html
+++ /dev/null
@@ -1,334 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_stack.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_stack.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_stack.c,v 1.17 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.17 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_stack.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <string.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00041"></a>00041 
-<a name="l00055"></a><a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">00055</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a>(cpl_parameterlist *parameters, 
-<a name="l00056"></a>00056                                   <span class="keyword">const</span> <span class="keywordtype">char</span> *context,
-<a name="l00057"></a>00057                                   <span class="keyword">const</span> <span class="keywordtype">char</span> *default_method)
-<a name="l00058"></a>00058 {
-<a name="l00059"></a>00059     cpl_parameter *p;
-<a name="l00060"></a>00060     <span class="keyword">const</span> <span class="keywordtype">char</span> *full_name = NULL;
-<a name="l00061"></a>00061     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
-<a name="l00062"></a>00062 
-<a name="l00063"></a>00063     name = <span class="stringliteral">"stack_method"</span>;
-<a name="l00064"></a>00064     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00065"></a>00065     p = cpl_parameter_new_enum(full_name,
-<a name="l00066"></a>00066                                CPL_TYPE_STRING,
-<a name="l00067"></a>00067                                <span class="stringliteral">"Frames combination method"</span>,
-<a name="l00068"></a>00068                                context,
-<a name="l00069"></a>00069                                default_method, 4,
-<a name="l00070"></a>00070                                <span class="stringliteral">"average"</span>, <span class="stringliteral">"median"</span>, <span class="stringliteral">"minmax"</span>, <span class="stringliteral">"ksigma"</span>);
-<a name="l00071"></a>00071     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00072"></a>00072     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00073"></a>00073     cpl_parameterlist_append(parameters, p);
-<a name="l00074"></a>00074     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00075"></a>00075 
-<a name="l00076"></a>00076 
-<a name="l00077"></a>00077     <span class="comment">/* minmax */</span>
-<a name="l00078"></a>00078     name = <span class="stringliteral">"minrejection"</span>;
-<a name="l00079"></a>00079     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00080"></a>00080     p = cpl_parameter_new_value(full_name,
-<a name="l00081"></a>00081                                 CPL_TYPE_INT,
-<a name="l00082"></a>00082                                 <span class="stringliteral">"Number of lowest values to be rejected"</span>,
-<a name="l00083"></a>00083                                 context,
-<a name="l00084"></a>00084                                 1);
-<a name="l00085"></a>00085     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00086"></a>00086     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00087"></a>00087     cpl_parameterlist_append(parameters, p);
-<a name="l00088"></a>00088     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090     name = <span class="stringliteral">"maxrejection"</span>;
-<a name="l00091"></a>00091     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00092"></a>00092     p = cpl_parameter_new_value(full_name,
-<a name="l00093"></a>00093                                 CPL_TYPE_INT,
-<a name="l00094"></a>00094                                 <span class="stringliteral">"Number of highest values to be rejected"</span>,
-<a name="l00095"></a>00095                                 context,
-<a name="l00096"></a>00096                                 1);
-<a name="l00097"></a>00097     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00098"></a>00098     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00099"></a>00099     cpl_parameterlist_append(parameters, p);
-<a name="l00100"></a>00100     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00101"></a>00101 
-<a name="l00102"></a>00102     <span class="comment">/* ksigma */</span>
-<a name="l00103"></a>00103     name = <span class="stringliteral">"klow"</span>;
-<a name="l00104"></a>00104     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00105"></a>00105     p = cpl_parameter_new_value(full_name,
-<a name="l00106"></a>00106                                 CPL_TYPE_DOUBLE,
-<a name="l00107"></a>00107                                 <span class="stringliteral">"Low threshold in ksigma method"</span>,
-<a name="l00108"></a>00108                                 context,
-<a name="l00109"></a>00109                                 3.0);
-<a name="l00110"></a>00110     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00111"></a>00111     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00112"></a>00112     cpl_parameterlist_append(parameters, p);
-<a name="l00113"></a>00113     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115     name = <span class="stringliteral">"khigh"</span>;
-<a name="l00116"></a>00116     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00117"></a>00117     p = cpl_parameter_new_value(full_name,
-<a name="l00118"></a>00118                                 CPL_TYPE_DOUBLE,
-<a name="l00119"></a>00119                                 <span class="stringliteral">"High threshold in ksigma method"</span>,
-<a name="l00120"></a>00120                                 context,
-<a name="l00121"></a>00121                                 3.0);
-<a name="l00122"></a>00122     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00123"></a>00123     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00124"></a>00124     cpl_parameterlist_append(parameters, p);
-<a name="l00125"></a>00125     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00126"></a>00126 
-<a name="l00127"></a>00127     name = <span class="stringliteral">"kiter"</span>;
-<a name="l00128"></a>00128     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00129"></a>00129     p = cpl_parameter_new_value(full_name,
-<a name="l00130"></a>00130                                 CPL_TYPE_INT,
-<a name="l00131"></a>00131                                 <span class="stringliteral">"Max number of iterations in ksigma method"</span>,
-<a name="l00132"></a>00132                                 context,
-<a name="l00133"></a>00133                                 999);
-<a name="l00134"></a>00134     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00135"></a>00135     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00136"></a>00136     cpl_parameterlist_append(parameters, p);
-<a name="l00137"></a>00137     cpl_free((<span class="keywordtype">void</span> *)full_name);
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139     <span class="keywordflow">return</span>;
-<a name="l00140"></a>00140 }
-<a name="l00141"></a>00141 
-<a name="l00142"></a>00142 <span class="preprocessor">#undef cleanup</span>
-<a name="l00143"></a>00143 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00144"></a>00144 <span class="preprocessor">do { \</span>
-<a name="l00145"></a>00145 <span class="preprocessor">    cpl_free((void *)name); \</span>
-<a name="l00146"></a>00146 <span class="preprocessor">} while (0)</span>
-<a name="l00147"></a>00147 <span class="preprocessor"></span>
-<a name="l00156"></a>00156 stack_method *
-<a name="l00157"></a><a class="code" href="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af">00157</a> <a class="code" href="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af">fors_stack_method_new</a>(<span class="keyword">const</span> cpl_parameterlist *parameters, <span class="keyword">const</span> <span class="keywordtype">char</span> *context)
-<a name="l00158"></a>00158 {
-<a name="l00159"></a>00159     stack_method *sm = cpl_malloc(<span class="keyword">sizeof</span>(stack_method));
-<a name="l00160"></a>00160     <span class="keyword">const</span> <span class="keywordtype">char</span> *name = NULL;
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162     cpl_msg_info(cpl_func, <span class="stringliteral">"Stack method parameters:"</span>);
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164     cpl_msg_indent_more();
-<a name="l00165"></a>00165     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"stack_method"</span>);
-<a name="l00166"></a>00166     sm->method_name = <a class="code" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">dfs_get_parameter_string_const</a>(parameters, 
-<a name="l00167"></a>00167                                             name);
-<a name="l00168"></a>00168     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00169"></a>00169     cpl_msg_indent_less();
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00172"></a>00172     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( sm->method_name != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00173"></a>00173 
-<a name="l00174"></a>00174     <span class="keywordflow">if</span> (strcmp(sm->method_name, <span class="stringliteral">"average"</span>) == 0) {
-<a name="l00175"></a>00175         sm->method = AVERAGE;
-<a name="l00176"></a>00176     }
-<a name="l00177"></a>00177     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(sm->method_name, <span class="stringliteral">"median"</span>) == 0) {
-<a name="l00178"></a>00178         sm->method = MEDIAN;
-<a name="l00179"></a>00179     }
-<a name="l00180"></a>00180     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(sm->method_name, <span class="stringliteral">"minmax"</span>) == 0) {
-<a name="l00181"></a>00181 <span class="comment">/*</span>
-<a name="l00182"></a>00182 <span class="comment">        assure( false, return NULL, "Unsupported stack method %s", sm->method_name);</span>
-<a name="l00183"></a>00183 <span class="comment">*/</span>
-<a name="l00184"></a>00184         sm->method = MINMAX;
-<a name="l00185"></a>00185     }
-<a name="l00186"></a>00186     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(sm->method_name, <span class="stringliteral">"ksigma"</span>) == 0) {
-<a name="l00187"></a>00187         sm->method = KSIGMA;
-<a name="l00188"></a>00188     }
-<a name="l00189"></a>00189     <span class="keywordflow">else</span> {
-<a name="l00190"></a>00190         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Unknown stack method '%s'"</span>, sm->method_name);
-<a name="l00191"></a>00191     }
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <span class="keywordflow">switch</span> (sm->method) {
-<a name="l00194"></a>00194     <span class="keywordflow">case</span> AVERAGE: <span class="keywordflow">break</span>;
-<a name="l00195"></a>00195     <span class="keywordflow">case</span> MEDIAN: <span class="keywordflow">break</span>;
-<a name="l00196"></a>00196     <span class="keywordflow">case</span> MINMAX:
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198         cpl_msg_indent_more();
-<a name="l00199"></a>00199         cpl_msg_indent_more();
-<a name="l00200"></a>00200         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"minrejection"</span>);
-<a name="l00201"></a>00201         sm->pars.minmax.min_reject = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parameters, 
-<a name="l00202"></a>00202                                                                  name);
-<a name="l00203"></a>00203         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00204"></a>00204         cpl_msg_indent_less();
-<a name="l00205"></a>00205         cpl_msg_indent_less();
-<a name="l00206"></a>00206         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00207"></a>00207         
-<a name="l00208"></a>00208         cpl_msg_indent_more();
-<a name="l00209"></a>00209         cpl_msg_indent_more();
-<a name="l00210"></a>00210         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"maxrejection"</span>);
-<a name="l00211"></a>00211         sm->pars.minmax.max_reject = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parameters, 
-<a name="l00212"></a>00212                                                                  name);
-<a name="l00213"></a>00213         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00214"></a>00214         cpl_msg_indent_less();
-<a name="l00215"></a>00215         cpl_msg_indent_less();
-<a name="l00216"></a>00216         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218         <span class="keywordflow">break</span>;
-<a name="l00219"></a>00219     <span class="keywordflow">case</span> KSIGMA:
-<a name="l00220"></a>00220         cpl_msg_indent_more();
-<a name="l00221"></a>00221         cpl_msg_indent_more();
-<a name="l00222"></a>00222         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"klow"</span>);
-<a name="l00223"></a>00223         sm->pars.ksigma.klow = <a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a>(parameters, 
-<a name="l00224"></a>00224                                                               name);
-<a name="l00225"></a>00225         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00226"></a>00226         cpl_msg_indent_less();
-<a name="l00227"></a>00227         cpl_msg_indent_less();
-<a name="l00228"></a>00228         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00229"></a>00229         
-<a name="l00230"></a>00230         cpl_msg_indent_more();
-<a name="l00231"></a>00231         cpl_msg_indent_more();
-<a name="l00232"></a>00232         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"khigh"</span>);
-<a name="l00233"></a>00233         sm->pars.ksigma.khigh = <a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a>(parameters, 
-<a name="l00234"></a>00234                                                                name);
-<a name="l00235"></a>00235         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00236"></a>00236         cpl_msg_indent_less();
-<a name="l00237"></a>00237         cpl_msg_indent_less();
-<a name="l00238"></a>00238         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240         cpl_msg_indent_more();
-<a name="l00241"></a>00241         cpl_msg_indent_more();
-<a name="l00242"></a>00242         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"kiter"</span>);
-<a name="l00243"></a>00243         sm->pars.ksigma.kiter = <a class="code" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a>(parameters, 
-<a name="l00244"></a>00244                                                             name);
-<a name="l00245"></a>00245         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00246"></a>00246         cpl_msg_indent_less();
-<a name="l00247"></a>00247         cpl_msg_indent_less();
-<a name="l00248"></a>00248         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00249"></a>00249         
-<a name="l00250"></a>00250         <span class="keywordflow">break</span>;
-<a name="l00251"></a>00251     <span class="keywordflow">default</span>:
-<a name="l00252"></a>00252         passure( <span class="keyword">false</span>, <span class="keywordflow">return</span> NULL );
-<a name="l00253"></a>00253         <span class="keywordflow">break</span>;
-<a name="l00254"></a>00254     } <span class="comment">/* switch sm->method */</span>
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00257"></a>00257     <span class="keywordflow">return</span> sm;
-<a name="l00258"></a>00258 }
-<a name="l00259"></a>00259 
-<a name="l00264"></a>00264 <span class="keywordtype">void</span>
-<a name="l00265"></a><a class="code" href="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13">00265</a> <a class="code" href="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13">fors_stack_method_delete</a>(stack_method **sm)
-<a name="l00266"></a>00266 {
-<a name="l00267"></a>00267     <span class="keywordflow">if</span> (sm && *sm) {
-<a name="l00268"></a>00268         cpl_free(*sm); *sm = NULL;
-<a name="l00269"></a>00269     }
-<a name="l00270"></a>00270     <span class="keywordflow">return</span>;
-<a name="l00271"></a>00271 }
-<a name="l00272"></a>00272 
-<a name="l00273"></a>00273 <span class="preprocessor">#undef cleanup</span>
-<a name="l00274"></a>00274 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00275"></a>00275 <span class="preprocessor"></span>
-<a name="l00280"></a><a class="code" href="group__fors__stack.html#g245b26490c31d54735bae3f76345b365">00280</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__stack.html#g245b26490c31d54735bae3f76345b365">fors_stack_method_get_string</a>(<span class="keyword">const</span> stack_method *sm)
-<a name="l00281"></a>00281 {
-<a name="l00282"></a>00282     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( sm != NULL, <span class="keywordflow">return</span> <span class="stringliteral">"Null"</span>, NULL );
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     <span class="keywordflow">return</span> sm->method_name;
-<a name="l00285"></a>00285 }
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287 <span class="preprocessor">#undef cleanup</span>
-<a name="l00288"></a><a class="code" href="group__fors__stack.html#g57cf6e6e2826eb178fd2d9c3e5695343">00288</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00289"></a>00289 <span class="preprocessor">do { \</span>
-<a name="l00290"></a>00290 <span class="preprocessor">} while (0)</span>
-<a name="l00291"></a>00291 <span class="preprocessor"></span>
-<a name="l00297"></a>00297 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l00298"></a><a class="code" href="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac">00298</a> <a class="code" href="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac">fors_stack_const</a>(<span class="keyword">const</span> fors_image_list *images, <span class="keyword">const</span> stack_method *sm)
-<a name="l00299"></a>00299 {
-<a name="l00300"></a>00300     <a class="code" href="struct__fors__image.html">fors_image</a> *master = NULL;
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( images != NULL, <span class="keywordflow">return</span> master, NULL );
-<a name="l00303"></a>00303     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( fors_image_list_size(images) > 0, <span class="keywordflow">return</span> master, 
-<a name="l00304"></a>00304            <span class="stringliteral">"No images to collapse"</span>);
-<a name="l00305"></a>00305     
-<a name="l00306"></a>00306     cpl_msg_info(cpl_func, <span class="stringliteral">"Stacking images (method = %s)"</span>,
-<a name="l00307"></a>00307                  <a class="code" href="group__fors__stack.html#g245b26490c31d54735bae3f76345b365">fors_stack_method_get_string</a>(sm)); 
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309     <span class="keywordflow">switch</span> (sm->method) {
-<a name="l00310"></a>00310     <span class="keywordflow">case</span> AVERAGE: 
-<a name="l00311"></a>00311         master = <a class="code" href="group__fors__image.html#g4154f529cbabe4cb4d1203d03e771f8a">fors_image_collapse_create</a>(images);
-<a name="l00312"></a>00312         <span class="keywordflow">break</span>;
-<a name="l00313"></a>00313     <span class="keywordflow">case</span> MEDIAN: 
-<a name="l00314"></a>00314         master = <a class="code" href="group__fors__image.html#gbd2b7e8761473ff4ca42f90fa879e1ad">fors_image_collapse_median_create</a>(images);
-<a name="l00315"></a>00315         <span class="keywordflow">break</span>;
-<a name="l00316"></a>00316     <span class="keywordflow">case</span> MINMAX:
-<a name="l00317"></a>00317         master = <a class="code" href="group__fors__image.html#gfe360dbc95e94b6b1043401aef8cbacc">fors_image_collapse_minmax_create</a>(images, 
-<a name="l00318"></a>00318                                   sm->pars.minmax.min_reject,
-<a name="l00319"></a>00319                                   sm->pars.minmax.max_reject);
-<a name="l00320"></a>00320         <span class="keywordflow">break</span>;
-<a name="l00321"></a>00321     <span class="keywordflow">case</span> KSIGMA: 
-<a name="l00322"></a>00322 <span class="comment">/*</span>
-<a name="l00323"></a>00323 <span class="comment">        assure( false, return NULL, "Unsupported stack method %s",</span>
-<a name="l00324"></a>00324 <span class="comment">                fors_stack_method_get_string(sm));</span>
-<a name="l00325"></a>00325 <span class="comment">*/</span>
-<a name="l00326"></a>00326         master = <a class="code" href="group__fors__image.html#g9f084a5b4f1564f1efb645e342eee2af">fors_image_collapse_ksigma_create</a>(images, 
-<a name="l00327"></a>00327                                   sm->pars.ksigma.klow,
-<a name="l00328"></a>00328                                   sm->pars.ksigma.khigh,
-<a name="l00329"></a>00329                                   sm->pars.ksigma.kiter);
-<a name="l00330"></a>00330         <span class="keywordflow">break</span>;
-<a name="l00331"></a>00331     <span class="keywordflow">default</span>:
-<a name="l00332"></a>00332         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Unknown stack method '%s' (%d)"</span>,
-<a name="l00333"></a>00333                 <a class="code" href="group__fors__stack.html#g245b26490c31d54735bae3f76345b365">fors_stack_method_get_string</a>(sm), sm->method);
-<a name="l00334"></a>00334         <span class="keywordflow">break</span>;
-<a name="l00335"></a>00335     }    
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     <span class="keywordflow">return</span> master;
-<a name="l00338"></a>00338 }
-<a name="l00339"></a>00339 
-<a name="l00343"></a>00343 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l00344"></a><a class="code" href="group__fors__stack.html#g1fd9044444484f1ee859abd3101ce8b4">00344</a> <a class="code" href="group__fors__stack.html#g1fd9044444484f1ee859abd3101ce8b4">fors_stack</a>(fors_image_list *images, <span class="keyword">const</span> stack_method *sm)
-<a name="l00345"></a>00345 {
-<a name="l00346"></a>00346     <span class="keywordflow">return</span> <a class="code" href="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac">fors_stack_const</a>((<span class="keyword">const</span> fors_image_list *)images, sm);
-<a name="l00347"></a>00347 }
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__stack_8c_source.html b/html/fors__stack_8c_source.html
new file mode 100644
index 0000000..9a910bb
--- /dev/null
+++ b/html/fors__stack_8c_source.html
@@ -0,0 +1,373 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_stack.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_stack.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_stack.c,v 1.17 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.17 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_stack.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15">   55</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15" title="Define recipe parameters.">fors_stack_define_parameters</a>(cpl_parameterlist *parameters, </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>                                   <span class="keyword">const</span> <span class="keywordtype">char</span> *context,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>                                   <span class="keyword">const</span> <span class="keywordtype">char</span> *default_method)</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> {</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *full_name = NULL;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     name = <span class="stringliteral">"stack_method"</span>;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     p = cpl_parameter_new_enum(full_name,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>                                CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                                <span class="stringliteral">"Frames combination method"</span>,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                context,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                default_method, 4,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                                <span class="stringliteral">"average"</span>, <span class="stringliteral">"median"</span>, <span class="stringliteral">"minmax"</span>, <span class="stringliteral">"ksigma"</span>);</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> </div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     <span class="comment">/* minmax */</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     name = <span class="stringliteral">"minrejection"</span>;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                                 <span class="stringliteral">"Number of lowest values to be rejected"</span>,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                                 context,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                                 1);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     name = <span class="stringliteral">"maxrejection"</span>;</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                                 <span class="stringliteral">"Number of highest values to be rejected"</span>,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                                 context,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                                 1);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="comment">/* ksigma */</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     name = <span class="stringliteral">"klow"</span>;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                                 <span class="stringliteral">"Low threshold in ksigma method"</span>,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                                 context,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                                 3.0);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     name = <span class="stringliteral">"khigh"</span>;</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                                 <span class="stringliteral">"High threshold in ksigma method"</span>,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                                 context,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                                 3.0);</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     name = <span class="stringliteral">"kiter"</span>;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                                 <span class="stringliteral">"Max number of iterations in ksigma method"</span>,</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>                                 context,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                                 999);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     cpl_free((<span class="keywordtype">void</span> *)full_name);</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> }</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="preprocessor">    cpl_free((void *)name); \</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> stack_method *</div>
+<div class="line"><a name="l00157"></a><span class="lineno"><a class="code" href="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e">  157</a></span> <a class="code" href="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e" title="Get stack method from parameter list.">fors_stack_method_new</a>(<span class="keyword">const</span> cpl_parameterlist *parameters, <span class="keyword">const</span> <span class="keywordtype">char</span> *context)</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> {</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     stack_method *sm = cpl_malloc(<span class="keyword">sizeof</span>(stack_method));</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name = NULL;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Stack method parameters:"</span>);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"stack_method"</span>);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     sm->method_name = <a class="code" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">dfs_get_parameter_string_const</a>(parameters, </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                                             name);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( sm->method_name != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">if</span> (strcmp(sm->method_name, <span class="stringliteral">"average"</span>) == 0) {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         sm->method = AVERAGE;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(sm->method_name, <span class="stringliteral">"median"</span>) == 0) {</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>         sm->method = MEDIAN;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     }</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(sm->method_name, <span class="stringliteral">"minmax"</span>) == 0) {</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="comment">        assure( false, return NULL, "Unsupported stack method %s", sm->method_name);</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>         sm->method = MINMAX;</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     }</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(sm->method_name, <span class="stringliteral">"ksigma"</span>) == 0) {</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         sm->method = KSIGMA;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Unknown stack method '%s'"</span>, sm->method_name);</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     }</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keywordflow">switch</span> (sm->method) {</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     <span class="keywordflow">case</span> AVERAGE: <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">case</span> MEDIAN: <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     <span class="keywordflow">case</span> MINMAX:</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"minrejection"</span>);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>         sm->pars.minmax.min_reject = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parameters, </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                                                                  name);</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"maxrejection"</span>);</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>         sm->pars.minmax.max_reject = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parameters, </div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>                                                                  name);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     <span class="keywordflow">case</span> KSIGMA:</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"klow"</span>);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>         sm->pars.ksigma.klow = <a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a>(parameters, </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                                                               name);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>         </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"khigh"</span>);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>         sm->pars.ksigma.khigh = <a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a>(parameters, </div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                                                name);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>         name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"kiter"</span>);</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>         sm->pars.ksigma.kiter = <a class="code" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a>(parameters, </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                                                             name);</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>         cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>         </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>         passure( <span class="keyword">false</span>, <span class="keywordflow">return</span> NULL );</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     } <span class="comment">/* switch sm->method */</span></div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     cleanup;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordflow">return</span> sm;</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> }</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno"><a class="code" href="group__fors__stack.html#ga9b1d85fcb31770b51259b8aa24c47ae2">  265</a></span> <a class="code" href="group__fors__stack.html#ga9b1d85fcb31770b51259b8aa24c47ae2" title="Destructor.">fors_stack_method_delete</a>(stack_method **sm)</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> {</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <span class="keywordflow">if</span> (sm && *sm) {</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>         cpl_free(*sm); *sm = NULL;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     }</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> }</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00280"></a><span class="lineno"><a class="code" href="group__fors__stack.html#ga5b92c215ed81d61bc8718b55e604ebc2">  280</a></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__stack.html#ga5b92c215ed81d61bc8718b55e604ebc2" title="Stack method as string.">fors_stack_method_get_string</a>(<span class="keyword">const</span> stack_method *sm)</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> {</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( sm != NULL, <span class="keywordflow">return</span> <span class="stringliteral">"Null"</span>, NULL );</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="keywordflow">return</span> sm->method_name;</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> }</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l00298"></a><span class="lineno"><a class="code" href="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc">  298</a></span> <a class="code" href="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc" title="Stack images.">fors_stack_const</a>(<span class="keyword">const</span> fors_image_list *images, <span class="keyword">const</span> stack_method *sm)</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> {</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master = NULL;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( images != NULL, <span class="keywordflow">return</span> master, NULL );</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( fors_image_list_size(images) > 0, <span class="keywordflow">return</span> master, </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>            <span class="stringliteral">"No images to collapse"</span>);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Stacking images (method = %s)"</span>,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>                  <a class="code" href="group__fors__stack.html#ga5b92c215ed81d61bc8718b55e604ebc2" title="Stack method as string.">fors_stack_method_get_string</a>(sm)); </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="keywordflow">switch</span> (sm->method) {</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     <span class="keywordflow">case</span> AVERAGE: </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>         master = <a class="code" href="group__fors__image.html#ga5510f4f5ebec4c99de3d9567b4eca21d" title="Average collapse.">fors_image_collapse_create</a>(images);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordflow">case</span> MEDIAN: </div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>         master = <a class="code" href="group__fors__image.html#ga0d7aab18ef2992f7efba3ab24f7af503" title="Median collapse.">fors_image_collapse_median_create</a>(images);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     <span class="keywordflow">case</span> MINMAX:</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         master = <a class="code" href="group__fors__image.html#ga41938f63e18b05073716d2afed9bd4a3" title="Minmax collapse.">fors_image_collapse_minmax_create</a>(images, </div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                                   sm->pars.minmax.min_reject,</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>                                   sm->pars.minmax.max_reject);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     <span class="keywordflow">case</span> KSIGMA: </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> <span class="comment">        assure( false, return NULL, "Unsupported stack method %s",</span></div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> <span class="comment">                fors_stack_method_get_string(sm));</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>         master = <a class="code" href="group__fors__image.html#ga3789562f96e6c162f90d51388d372a88" title="Ksigma collapse.">fors_image_collapse_ksigma_create</a>(images, </div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>                                   sm->pars.ksigma.klow,</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>                                   sm->pars.ksigma.khigh,</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>                                   sm->pars.ksigma.kiter);</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Unknown stack method '%s' (%d)"</span>,</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>                 <a class="code" href="group__fors__stack.html#ga5b92c215ed81d61bc8718b55e604ebc2" title="Stack method as string.">fors_stack_method_get_string</a>(sm), sm->method);</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     }    </div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordflow">return</span> master;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> }</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l00344"></a><span class="lineno"><a class="code" href="group__fors__stack.html#ga6792068e2f3a973ad54722120779feb1">  344</a></span> <a class="code" href="group__fors__stack.html#ga6792068e2f3a973ad54722120779feb1" title="Same as fors_stack_const()">fors_stack</a>(fors_image_list *images, <span class="keyword">const</span> stack_method *sm)</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> {</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc" title="Stack images.">fors_stack_const</a>((<span class="keyword">const</span> fors_image_list *)images, sm);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> }</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__stack_8h-source.html b/html/fors__stack_8h-source.html
deleted file mode 100644
index b5e62bf..0000000
--- a/html/fors__stack_8h-source.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_stack.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_stack.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_stack.h,v 1.7 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_STACK_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_STACK_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 CPL_BEGIN_DECLS
-<a name="l00035"></a>00035 
-<a name="l00036"></a><a class="code" href="struct__stack__method.html">00036</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__stack__method.html">_stack_method</a>
-<a name="l00037"></a>00037 {
-<a name="l00038"></a>00038     <span class="keyword">enum</span> {AVERAGE, MEDIAN, MINMAX, KSIGMA} method;
-<a name="l00039"></a><a class="code" href="struct__stack__method.html#6f98f0a2b57c86e519dc8bdf9885ab7b">00039</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="struct__stack__method.html#6f98f0a2b57c86e519dc8bdf9885ab7b">method_name</a>;
-<a name="l00040"></a>00040     <span class="keyword">union </span>{
-<a name="l00041"></a>00041         <span class="keyword">struct </span>{
-<a name="l00042"></a><a class="code" href="struct__stack__method.html#32a13b1823d0d86b5c26ff14f8be9eb0">00042</a>             <span class="keywordtype">int</span> <a class="code" href="struct__stack__method.html#32a13b1823d0d86b5c26ff14f8be9eb0">min_reject</a>;
-<a name="l00043"></a><a class="code" href="struct__stack__method.html#dd4b2d1c1a6e255b16a122464c489ac3">00043</a>             <span class="keywordtype">int</span> <a class="code" href="struct__stack__method.html#dd4b2d1c1a6e255b16a122464c489ac3">max_reject</a>;
-<a name="l00044"></a>00044         } minmax;
-<a name="l00045"></a>00045         <span class="keyword">struct </span>{
-<a name="l00046"></a><a class="code" href="struct__stack__method.html#41f6ab3a4ca6f07365f32d63bbe20de3">00046</a>             <span class="keywordtype">double</span> <a class="code" href="struct__stack__method.html#41f6ab3a4ca6f07365f32d63bbe20de3">klow</a>;
-<a name="l00047"></a><a class="code" href="struct__stack__method.html#236ce050034e112bb1d000de525a7895">00047</a>             <span class="keywordtype">double</span> <a class="code" href="struct__stack__method.html#236ce050034e112bb1d000de525a7895">khigh</a>;
-<a name="l00048"></a><a class="code" href="struct__stack__method.html#b98c63a3bb7288969c818ee3653a482b">00048</a>             <span class="keywordtype">int</span> <a class="code" href="struct__stack__method.html#b98c63a3bb7288969c818ee3653a482b">kiter</a>;
-<a name="l00049"></a>00049         } ksigma;
-<a name="l00050"></a>00050     } pars;
-<a name="l00051"></a>00051 } stack_method;
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="keywordtype">void</span> 
-<a name="l00054"></a>00054 <a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a>(cpl_parameterlist *parameters, 
-<a name="l00055"></a>00055                  <span class="keyword">const</span> <span class="keywordtype">char</span> *context, <span class="keyword">const</span> <span class="keywordtype">char</span> *default_method);
-<a name="l00056"></a>00056 stack_method *
-<a name="l00057"></a>00057 <a class="code" href="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af">fors_stack_method_new</a>(<span class="keyword">const</span> cpl_parameterlist *parameters, <span class="keyword">const</span> <span class="keywordtype">char</span> *context);
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="keywordtype">void</span>
-<a name="l00060"></a>00060 <a class="code" href="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13">fors_stack_method_delete</a>(stack_method **sm);
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l00063"></a>00063 <a class="code" href="group__fors__stack.html#g1fd9044444484f1ee859abd3101ce8b4">fors_stack</a>(fors_image_list *images, <span class="keyword">const</span> stack_method *sm);
-<a name="l00064"></a>00064 
-<a name="l00065"></a>00065 <a class="code" href="struct__fors__image.html">fors_image</a> *
-<a name="l00066"></a>00066 <a class="code" href="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac">fors_stack_const</a>(<span class="keyword">const</span> fors_image_list *images, <span class="keyword">const</span> stack_method *sm);
-<a name="l00067"></a>00067 
-<a name="l00068"></a>00068 CPL_END_DECLS
-<a name="l00069"></a>00069 
-<a name="l00070"></a>00070 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__stack_8h_source.html b/html/fors__stack_8h_source.html
new file mode 100644
index 0000000..86b1ad2
--- /dev/null
+++ b/html/fors__stack_8h_source.html
@@ -0,0 +1,131 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_stack.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_stack.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_stack.h,v 1.7 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.7 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_STACK_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_STACK_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno"><a class="code" href="struct__stack__method.html">   36</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__stack__method.html">_stack_method</a></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> {</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span>     <span class="keyword">enum</span> {AVERAGE, MEDIAN, MINMAX, KSIGMA} method;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *method_name;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>     <span class="keyword">union </span>{</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>         <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>             <span class="keywordtype">int</span> min_reject;</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>             <span class="keywordtype">int</span> max_reject;</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>         } minmax;</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>         <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>             <span class="keywordtype">double</span> klow;</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>             <span class="keywordtype">double</span> khigh;</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>             <span class="keywordtype">int</span> kiter;</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>         } ksigma;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>     } pars;</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> } stack_method;</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <a class="code" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15" title="Define recipe parameters.">fors_stack_define_parameters</a>(cpl_parameterlist *parameters, </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>                  <span class="keyword">const</span> <span class="keywordtype">char</span> *context, <span class="keyword">const</span> <span class="keywordtype">char</span> *default_method);</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> stack_method *</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <a class="code" href="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e" title="Get stack method from parameter list.">fors_stack_method_new</a>(<span class="keyword">const</span> cpl_parameterlist *parameters, <span class="keyword">const</span> <span class="keywordtype">char</span> *context);</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <a class="code" href="group__fors__stack.html#ga9b1d85fcb31770b51259b8aa24c47ae2" title="Destructor.">fors_stack_method_delete</a>(stack_method **sm);</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <a class="code" href="group__fors__stack.html#ga6792068e2f3a973ad54722120779feb1" title="Same as fors_stack_const()">fors_stack</a>(fors_image_list *images, <span class="keyword">const</span> stack_method *sm);</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <a class="code" href="struct__fors__image.html">fors_image</a> *</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <a class="code" href="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc" title="Stack images.">fors_stack_const</a>(<span class="keyword">const</span> fors_image_list *images, <span class="keyword">const</span> stack_method *sm);</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__star-test_8c-source.html b/html/fors__star-test_8c-source.html
deleted file mode 100644
index c3638d3..0000000
--- a/html/fors__star-test_8c-source.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_star-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_star-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_star-test.c,v 1.2 2007/10/17 09:17:41 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/10/17 09:17:41 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_star.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <test.h></span>
-<a name="l00037"></a>00037 
-<a name="l00044"></a>00044 <span class="preprocessor">#undef cleanup</span>
-<a name="l00045"></a><a class="code" href="group__fors__star__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00046"></a>00046 <span class="preprocessor">do { \</span>
-<a name="l00047"></a>00047 <span class="preprocessor">    fors_star_delete(&s); \</span>
-<a name="l00048"></a>00048 <span class="preprocessor">    fors_star_delete(&t); \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">} while (0)</span>
-<a name="l00050"></a>00050 <span class="preprocessor"></span>
-<a name="l00053"></a>00053 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00054"></a><a class="code" href="group__fors__star__test.html#g604dc676807fa2e19fb9a98e9239a116">00054</a> <a class="code" href="group__fors__star__test.html#g604dc676807fa2e19fb9a98e9239a116">test_star</a>(<span class="keywordtype">void</span>)
-<a name="l00055"></a>00055 {
-<a name="l00056"></a>00056     <span class="keywordtype">double</span> x = 110;
-<a name="l00057"></a>00057     <span class="keywordtype">double</span> y = 399;
-<a name="l00058"></a>00058     <span class="keywordtype">double</span> smajor = 3;
-<a name="l00059"></a>00059     <span class="keywordtype">double</span> sminor = 2;
-<a name="l00060"></a>00060     <span class="keywordtype">double</span> fwhm = 3.5;
-<a name="l00061"></a>00061     <span class="keywordtype">double</span> theta = -0.1;
-<a name="l00062"></a>00062     <span class="keywordtype">double</span> m = -17;
-<a name="l00063"></a>00063     <span class="keywordtype">double</span> dm = 0.05;
-<a name="l00064"></a>00064     <span class="keywordtype">double</span> si = 1.0;
-<a name="l00065"></a>00065 
-<a name="l00066"></a>00066     <a class="code" href="struct__fors__star.html">fors_star</a> *s = <a class="code" href="group__fors__star.html#g548c477088fd4fbadd74fd84f3becb94">fors_star_new</a>(x, y,
-<a name="l00067"></a>00067                                  fwhm,
-<a name="l00068"></a>00068                                  smajor, sminor,
-<a name="l00069"></a>00069                                  theta,
-<a name="l00070"></a>00070                                  m, dm, si);
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072     <a class="code" href="struct__fors__star.html">fors_star</a> *t = <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>(s);
-<a name="l00073"></a>00073 
-<a name="l00074"></a>00074     test( <a class="code" href="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98">fors_star_equal</a>(s, t) );
-<a name="l00075"></a>00075 
-<a name="l00076"></a>00076     test_abs( <a class="code" href="group__fors__star.html#g21eca2e7981ea38bc0b5a66edfc56bb9">fors_star_distsq</a>(s, t), 0, 0.001 );
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00079"></a>00079     <span class="keywordflow">return</span>;
-<a name="l00080"></a>00080 }
-<a name="l00081"></a>00081 
-<a name="l00082"></a>00082 
-<a name="l00086"></a><a class="code" href="group__fors__star__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00086</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00087"></a>00087 {
-<a name="l00088"></a>00088     TEST_INIT;
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090     <a class="code" href="group__fors__star__test.html#g604dc676807fa2e19fb9a98e9239a116">test_star</a>();
-<a name="l00091"></a>00091 
-<a name="l00092"></a>00092     TEST_END;
-<a name="l00093"></a>00093 }
-<a name="l00094"></a>00094 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__star-test_8c_source.html b/html/fors__star-test_8c_source.html
new file mode 100644
index 0000000..c994c70
--- /dev/null
+++ b/html/fors__star-test_8c_source.html
@@ -0,0 +1,144 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_star-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_star-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_star-test.c,v 1.2 2007-10-17 09:17:41 jmlarsen Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: jmlarsen $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007-10-17 09:17:41 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.2 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_star.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">    fors_star_delete(&s); \</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">    fors_star_delete(&t); \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> test_star(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> {</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>     <span class="keywordtype">double</span> x = 110;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>     <span class="keywordtype">double</span> y = 399;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>     <span class="keywordtype">double</span> smajor = 3;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     <span class="keywordtype">double</span> sminor = 2;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     <span class="keywordtype">double</span> fwhm = 3.5;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     <span class="keywordtype">double</span> theta = -0.1;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>     <span class="keywordtype">double</span> m = -17;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     <span class="keywordtype">double</span> dm = 0.05;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     <span class="keywordtype">double</span> si = 1.0;</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     <a class="code" href="struct__fors__star.html">fors_star</a> *s = <a class="code" href="group__fors__star.html#ga7a8b2a60d5685524ffbb762e066c9b01" title="Constructor.">fors_star_new</a>(x, y,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                                  fwhm,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                  smajor, sminor,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                  theta,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                                  m, dm, si);</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     <a class="code" href="struct__fors__star.html">fors_star</a> *t = <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>(s);</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> </div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     test( <a class="code" href="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1" title="Test for equality.">fors_star_equal</a>(s, t) );</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     test_abs( <a class="code" href="group__fors__star.html#ga53496a5c3e6810c6c59d221120df422b" title="Get distance between stars.">fors_star_distsq</a>(s, t), 0, 0.001 );</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     cleanup;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> }</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="group__fors__star__test.html#ga840291bc02cba5474a4cb46a9b9566fe">   86</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> {</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     TEST_INIT;</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     test_star();</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     TEST_END;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> }</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__star_8c-source.html b/html/fors__star_8c-source.html
deleted file mode 100644
index 4bd38f0..0000000
--- a/html/fors__star_8c-source.html
+++ /dev/null
@@ -1,447 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_star.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_star.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_star.c,v 1.29 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.29 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_star.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="preprocessor">#include <math.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <assert.h></span>
-<a name="l00040"></a>00040 
-<a name="l00049"></a>00049 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00050"></a>00050 <span class="comment">    Prototypes</span>
-<a name="l00051"></a>00051 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="keyword">static</span>
-<a name="l00054"></a>00054 <span class="keywordtype">double</span>  <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(  <span class="keyword">const</span> cpl_table *tab,
-<a name="l00055"></a>00055                                     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,
-<a name="l00056"></a>00056                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *colname);
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00059"></a>00059 <span class="comment">    Private Implementation</span>
-<a name="l00060"></a>00060 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00063"></a>00063 <span class="preprocessor">#undef cleanup</span>
-<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00065"></a>00065 <span class="preprocessor"></span>
-<a name="l00071"></a>00071 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00072"></a>00072 <span class="keyword">static</span>
-<a name="l00073"></a><a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">00073</a> <span class="keywordtype">double</span>  <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(  <span class="keyword">const</span> cpl_table *tab,
-<a name="l00074"></a>00074                                     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,
-<a name="l00075"></a>00075                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *colname)
-<a name="l00076"></a>00076 {
-<a name="l00077"></a>00077     <span class="keywordtype">int</span> null;
-<a name="l00078"></a>00078     <span class="keywordflow">if</span> (colname != NULL && colname[0] != <span class="charliteral">'\0'</span>)
-<a name="l00079"></a>00079     {
-<a name="l00080"></a>00080         <span class="keywordtype">double</span>  d;
-<a name="l00081"></a>00081         d = cpl_table_get(          tab, colname, row, &null);
-<a name="l00082"></a>00082         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                     !cpl_error_get_code(),
-<a name="l00083"></a>00083                                     <span class="keywordflow">return</span> d,
-<a name="l00084"></a>00084                                     <span class="stringliteral">"Missing column: %s"</span>,
-<a name="l00085"></a>00085                                         colname);
-<a name="l00086"></a>00086         <span class="keywordflow">return</span> d;
-<a name="l00087"></a>00087             
-<a name="l00088"></a>00088     }
-<a name="l00089"></a>00089     <span class="keywordflow">else</span>
-<a name="l00090"></a>00090         <span class="keywordflow">return</span> 0.0;
-<a name="l00091"></a>00091 }
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00094"></a>00094 <span class="comment">    Implementation</span>
-<a name="l00095"></a>00095 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00096"></a>00096 
-<a name="l00097"></a>00097 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00098"></a>00098 <span class="preprocessor">#undef cleanup</span>
-<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00100"></a>00100 <span class="preprocessor"></span>
-<a name="l00113"></a>00113 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00114"></a><a class="code" href="group__fors__star.html#g548c477088fd4fbadd74fd84f3becb94">00114</a> <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__fors__star.html#g548c477088fd4fbadd74fd84f3becb94">fors_star_new</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y,
-<a name="l00115"></a>00115                          <span class="keywordtype">double</span> fwhm,
-<a name="l00116"></a>00116                          <span class="keywordtype">double</span> smajor, <span class="keywordtype">double</span> sminor,
-<a name="l00117"></a>00117                          <span class="keywordtype">double</span> orientation,
-<a name="l00118"></a>00118                          <span class="keywordtype">double</span> m, <span class="keywordtype">double</span> dm,
-<a name="l00119"></a>00119                          <span class="keywordtype">double</span> si)
-<a name="l00120"></a>00120 {
-<a name="l00121"></a>00121     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( smajor >= sminor && sminor >= 0, <span class="keywordflow">return</span> NULL,
-<a name="l00122"></a>00122             <span class="stringliteral">"Illegal semi major/minor axes: %g, %g"</span>,
-<a name="l00123"></a>00123             smajor, sminor );
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( 0 <= si && si <= 1, <span class="keywordflow">return</span> NULL,
-<a name="l00126"></a>00126             <span class="stringliteral">"Stellarity index must be between 0 and 1, is %f"</span>,
-<a name="l00127"></a>00127             si);
-<a name="l00128"></a>00128 
-<a name="l00129"></a>00129     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( fwhm >= 0, <span class="keywordflow">return</span> NULL,
-<a name="l00130"></a>00130             <span class="stringliteral">"Star FWHM must be non-negative, is %f"</span>,
-<a name="l00131"></a>00131             fwhm);
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133     <a class="code" href="struct__fors__star.html">fors_star</a> *s = cpl_malloc(<span class="keyword">sizeof</span>(*s));
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     s->pixel = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(x, y);
-<a name="l00136"></a>00136     s->fwhm = fwhm;
-<a name="l00137"></a>00137     s->semi_major = smajor;
-<a name="l00138"></a>00138     s->semi_minor = sminor;
-<a name="l00139"></a>00139     s->stellarity_index = si;
-<a name="l00140"></a>00140     s->orientation = orientation;
-<a name="l00141"></a>00141     s->magnitude = m;
-<a name="l00142"></a>00142     s->dmagnitude = dm;
-<a name="l00143"></a>00143     s->magnitude_corr = 0;
-<a name="l00144"></a>00144     s->dmagnitude_corr = 0;
-<a name="l00145"></a>00145     s->id = NULL;
-<a name="l00146"></a>00146     s->weight = 0;
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     <span class="keywordflow">return</span> s;
-<a name="l00149"></a>00149 }
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00152"></a>00152 <span class="preprocessor">#undef cleanup</span>
-<a name="l00153"></a>00153 <span class="preprocessor"></span><span class="preprocessor">#define cleanup fors_star_delete(&s)</span>
-<a name="l00154"></a>00154 <span class="preprocessor"></span>
-<a name="l00169"></a>00169 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00170"></a><a class="code" href="group__fors__star.html#gec880ac28409dd535ec3138e0b5b001c">00170</a> <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__fors__star.html#gec880ac28409dd535ec3138e0b5b001c">fors_star_new_from_table</a>(<span class="keyword">const</span> cpl_table *tab,
-<a name="l00171"></a>00171                                     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,
-<a name="l00172"></a>00172                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *x_col,
-<a name="l00173"></a>00173                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *y_col,
-<a name="l00174"></a>00174                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *fwhm_col,
-<a name="l00175"></a>00175                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *smaj_col,
-<a name="l00176"></a>00176                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *smin_col,
-<a name="l00177"></a>00177                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *theta_col,
-<a name="l00178"></a>00178                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *mag_col,
-<a name="l00179"></a>00179                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *dmag_col,
-<a name="l00180"></a>00180                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *stlndx_col)
-<a name="l00181"></a>00181 {
-<a name="l00182"></a>00182     <span class="keywordtype">int</span> null;
-<a name="l00183"></a>00183     <a class="code" href="struct__fors__star.html">fors_star</a> *s = cpl_malloc(<span class="keyword">sizeof</span>(*s));
-<a name="l00184"></a>00184 
-<a name="l00185"></a>00185     s->pixel = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(  <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, x_col),
-<a name="l00186"></a>00186                                 <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, y_col));
-<a name="l00187"></a>00187     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);
-<a name="l00188"></a>00188     
-<a name="l00189"></a>00189     s->fwhm =                   <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, fwhm_col);
-<a name="l00190"></a>00190     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);
-<a name="l00191"></a>00191     
-<a name="l00192"></a>00192     s->semi_major =             <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, smaj_col);
-<a name="l00193"></a>00193     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);
-<a name="l00194"></a>00194     
-<a name="l00195"></a>00195     s->semi_minor =             <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, smin_col);
-<a name="l00196"></a>00196     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);
-<a name="l00197"></a>00197     
-<a name="l00198"></a>00198     s->stellarity_index =       <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, stlndx_col);
-<a name="l00199"></a>00199     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);
-<a name="l00200"></a>00200     
-<a name="l00201"></a>00201     s->orientation =            <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, theta_col);
-<a name="l00202"></a>00202     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);
-<a name="l00203"></a>00203     
-<a name="l00204"></a>00204     s->magnitude =              <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, mag_col);
-<a name="l00205"></a>00205     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);
-<a name="l00206"></a>00206     
-<a name="l00207"></a>00207     s->dmagnitude =             <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, dmag_col);
-<a name="l00208"></a>00208     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);
-<a name="l00209"></a>00209     
-<a name="l00210"></a>00210     s->magnitude_corr = 0;
-<a name="l00211"></a>00211     s->dmagnitude_corr = 0;
-<a name="l00212"></a>00212     s->id = NULL;
-<a name="l00213"></a>00213     s->weight = 0;
-<a name="l00214"></a>00214     
-<a name="l00215"></a>00215     <span class="keywordflow">return</span> s;
-<a name="l00216"></a>00216 }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00219"></a>00219 <span class="preprocessor">#undef cleanup</span>
-<a name="l00220"></a>00220 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00221"></a>00221 <span class="preprocessor"></span>
-<a name="l00226"></a>00226 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00227"></a><a class="code" href="group__fors__star.html#g1ef535783913303ad950792cdd1d59c8">00227</a> <span class="keywordtype">bool</span> <a class="code" href="group__fors__star.html#g1ef535783913303ad950792cdd1d59c8">fors_star_check_values</a>(        <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star)
-<a name="l00228"></a>00228 {
-<a name="l00229"></a>00229     <span class="keywordtype">bool</span>    success = 1;
-<a name="l00230"></a>00230     
-<a name="l00231"></a>00231     success &= (star != NULL);
-<a name="l00232"></a>00232     success &= (star-><a class="code" href="struct__fors__star.html#b5357dc5aaf3b7b6edc89d700d563a2c">semi_major</a> >= star-><a class="code" href="struct__fors__star.html#532b4911a7308d705f01ba1da7bc35a1">semi_minor</a>);
-<a name="l00233"></a>00233     success &= (0.0 <= star-><a class="code" href="struct__fors__star.html#cd353ab887426dc767a89db51164271a">stellarity_index</a> && star-><a class="code" href="struct__fors__star.html#cd353ab887426dc767a89db51164271a">stellarity_index</a> <= 1.0);
-<a name="l00234"></a>00234     success &= (star-><a class="code" href="struct__fors__star.html#4bb929a1553cd3239fcf18112c699200">fwhm</a> > 0.0);
-<a name="l00235"></a>00235     
-<a name="l00236"></a>00236     <span class="keywordflow">return</span> success;
-<a name="l00237"></a>00237 }
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00240"></a>00240 <span class="preprocessor">#undef cleanup</span>
-<a name="l00241"></a>00241 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00242"></a>00242 <span class="preprocessor"></span>
-<a name="l00247"></a>00247 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00248"></a><a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">00248</a> <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star)
-<a name="l00249"></a>00249 {
-<a name="l00250"></a>00250     <a class="code" href="struct__fors__star.html">fors_star</a> *d;
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( star != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00253"></a>00253 
-<a name="l00254"></a>00254     d = cpl_malloc(<span class="keyword">sizeof</span>(*d));
-<a name="l00255"></a>00255     *d = *star;  <span class="comment">/* Simple copy of all members, next do</span>
-<a name="l00256"></a>00256 <span class="comment">                    deep copy of pointers */</span>
-<a name="l00257"></a>00257     
-<a name="l00258"></a>00258     d-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a> = <a class="code" href="group__fors__point.html#gc5a8341742fc371f6e7332600286045e">fors_point_duplicate</a>(star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>);
-<a name="l00259"></a>00259 
-<a name="l00260"></a>00260     <span class="keywordflow">if</span> (star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> != NULL) {
-<a name="l00261"></a>00261         d->id = fors_std_star_duplicate(star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>);
-<a name="l00262"></a>00262     }
-<a name="l00263"></a>00263     
-<a name="l00264"></a>00264     <span class="keywordflow">return</span> d;
-<a name="l00265"></a>00265 }
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00272"></a>00272 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00273"></a><a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">00273</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>(<a class="code" href="struct__fors__star.html">fors_star</a> **star)
-<a name="l00274"></a>00274 {
-<a name="l00275"></a>00275     <span class="keywordflow">if</span> (star && *star) {
-<a name="l00276"></a>00276         <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&(*star)->pixel);
-<a name="l00277"></a>00277         <span class="keywordflow">if</span> ((*star)->id != NULL) {
-<a name="l00278"></a>00278             fors_std_star_delete_const(&((*star)->id));
-<a name="l00279"></a>00279         }
-<a name="l00280"></a>00280         cpl_free(*star); *star = NULL;
-<a name="l00281"></a>00281     }
-<a name="l00282"></a>00282     <span class="keywordflow">return</span>;
-<a name="l00283"></a>00283 }
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00290"></a>00290 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00291"></a><a class="code" href="group__fors__star.html#g40fa6037fee74abd5a9d5166137609e0">00291</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__star.html#g40fa6037fee74abd5a9d5166137609e0">fors_star_delete_but_standard</a>(<a class="code" href="struct__fors__star.html">fors_star</a> **star)
-<a name="l00292"></a>00292 {
-<a name="l00293"></a>00293     <span class="keywordflow">if</span> (star && *star) {
-<a name="l00294"></a>00294         <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&(*star)->pixel);
-<a name="l00295"></a>00295         cpl_free(*star); *star = NULL;
-<a name="l00296"></a>00296     }
-<a name="l00297"></a>00297     <span class="keywordflow">return</span>;
-<a name="l00298"></a>00298 }
-<a name="l00299"></a>00299 
-<a name="l00300"></a>00300 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00307"></a>00307 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00308"></a>00308 <span class="keywordtype">bool</span>
-<a name="l00309"></a><a class="code" href="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98">00309</a> <a class="code" href="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98">fors_star_equal</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s,
-<a name="l00310"></a>00310                 <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *t)
-<a name="l00311"></a>00311 {
-<a name="l00312"></a>00312     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL && t != NULL, <span class="keywordflow">return</span> <span class="keyword">true</span>, NULL );
-<a name="l00313"></a>00313     
-<a name="l00314"></a>00314     <span class="keywordflow">return</span> (<a class="code" href="group__fors__point.html#g5f09413dd7958d3ebbe1ba7700b27377">fors_point_equal</a>(s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>, t-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>));
-<a name="l00315"></a>00315 }
-<a name="l00316"></a>00316 
-<a name="l00317"></a>00317 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00318"></a>00318 <span class="preprocessor">#undef clenaup</span>
-<a name="l00319"></a>00319 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00320"></a>00320 <span class="preprocessor"></span>
-<a name="l00327"></a>00327 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00328"></a>00328 <span class="keywordtype">bool</span>
-<a name="l00329"></a><a class="code" href="group__fors__star.html#g100f4290bf02ce348f22092f4e2bc3eb">00329</a> <a class="code" href="group__fors__star.html#g100f4290bf02ce348f22092f4e2bc3eb">fors_star_brighter_than</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s1,
-<a name="l00330"></a>00330                         <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s2,
-<a name="l00331"></a>00331                         <span class="keywordtype">void</span> *data)
-<a name="l00332"></a>00332 {
-<a name="l00333"></a>00333     data = data;
-<a name="l00334"></a>00334     <span class="keywordflow">return</span> (s1-><a class="code" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">magnitude</a> < s2-><a class="code" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">magnitude</a>);
-<a name="l00335"></a>00335 }
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00338"></a>00338 <span class="preprocessor">#undef cleanup</span>
-<a name="l00339"></a>00339 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00340"></a>00340 <span class="preprocessor"></span>
-<a name="l00346"></a>00346 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00347"></a><a class="code" href="group__fors__star.html#g21eca2e7981ea38bc0b5a66edfc56bb9">00347</a> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#g21eca2e7981ea38bc0b5a66edfc56bb9">fors_star_distsq</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *t)
-<a name="l00348"></a>00348 {
-<a name="l00349"></a>00349     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00350"></a>00350     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( t != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00351"></a>00351 
-<a name="l00352"></a>00352     <span class="keywordflow">return</span> <a class="code" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a>(s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>, t-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>);
-<a name="l00353"></a>00353 }
-<a name="l00354"></a>00354 
-<a name="l00355"></a>00355 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00356"></a>00356 <span class="preprocessor">#undef cleanup</span>
-<a name="l00357"></a>00357 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00358"></a>00358 <span class="preprocessor"></span>
-<a name="l00364"></a>00364 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00365"></a><a class="code" href="group__fors__star.html#g4f81e6410fe5c7aefbdbcae907095059">00365</a> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#g4f81e6410fe5c7aefbdbcae907095059">fors_star_extension</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)
-<a name="l00366"></a>00366 {
-<a name="l00367"></a>00367     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00368"></a>00368     data = data;
-<a name="l00369"></a>00369 
-<a name="l00370"></a>00370     <span class="comment">/* return sqrt(s->semi_major * s->semi_minor); */</span>
-<a name="l00371"></a>00371     <span class="keywordflow">return</span> s-><a class="code" href="struct__fors__star.html#4bb929a1553cd3239fcf18112c699200">fwhm</a> / TWOSQRT2LN2;
-<a name="l00372"></a>00372 }
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00375"></a>00375 <span class="preprocessor">#undef cleanup</span>
-<a name="l00376"></a>00376 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00377"></a>00377 <span class="preprocessor"></span>
-<a name="l00383"></a>00383 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00384"></a><a class="code" href="group__fors__star.html#g310c2402602378a7505a36a85ee98c7b">00384</a> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#g310c2402602378a7505a36a85ee98c7b">fors_star_stellarity</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)
-<a name="l00385"></a>00385 {
-<a name="l00386"></a>00386     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00387"></a>00387     data = data;
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389     <span class="keywordflow">return</span> s-><a class="code" href="struct__fors__star.html#cd353ab887426dc767a89db51164271a">stellarity_index</a>;
-<a name="l00390"></a>00390 }
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00393"></a>00393 <span class="preprocessor">#undef cleanup</span>
-<a name="l00394"></a><a class="code" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">00394</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00395"></a>00395 <span class="preprocessor"></span>
-<a name="l00401"></a>00401 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00402"></a><a class="code" href="group__fors__star.html#gdef23fa2c1ad1c4f2b0de18038b0daca">00402</a> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#gdef23fa2c1ad1c4f2b0de18038b0daca">fors_star_ellipticity</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)
-<a name="l00403"></a>00403 {
-<a name="l00404"></a>00404     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00405"></a>00405     data = data;
-<a name="l00406"></a>00406     
-<a name="l00407"></a>00407     <span class="keywordflow">if</span> (s-><a class="code" href="struct__fors__star.html#b5357dc5aaf3b7b6edc89d700d563a2c">semi_major</a> <= 0) <span class="keywordflow">return</span> 1;
-<a name="l00408"></a>00408     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 1 - (s-><a class="code" href="struct__fors__star.html#532b4911a7308d705f01ba1da7bc35a1">semi_minor</a> / s-><a class="code" href="struct__fors__star.html#b5357dc5aaf3b7b6edc89d700d563a2c">semi_major</a>);
-<a name="l00409"></a>00409 }
-<a name="l00410"></a>00410 
-<a name="l00411"></a>00411 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00417"></a>00417 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00418"></a><a class="code" href="group__fors__star.html#g89b5801d41c9760d82ec12097e14b584">00418</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__star.html#g89b5801d41c9760d82ec12097e14b584">fors_star_print</a>(cpl_msg_severity level, <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s)
-<a name="l00419"></a>00419 {
-<a name="l00420"></a>00420     <span class="keywordflow">if</span> (s == NULL) {
-<a name="l00421"></a>00421         fors_msg(level, <span class="stringliteral">"[NULL]"</span>);
-<a name="l00422"></a>00422     }
-<a name="l00423"></a>00423     <span class="keywordflow">else</span> {
-<a name="l00424"></a>00424         fors_msg(level, <span class="stringliteral">"at (%7.2f, %7.2f): m = %g +- %g (mc = %g +- %g), "</span>
-<a name="l00425"></a>00425                  <span class="stringliteral">"shape: (%g, %g, %g)"</span>,
-<a name="l00426"></a>00426                  s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x, s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y,
-<a name="l00427"></a>00427                  s-><a class="code" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">magnitude</a>, s-><a class="code" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">dmagnitude</a>,
-<a name="l00428"></a>00428                  s-><a class="code" href="struct__fors__star.html#20a78115ec557bc3cf1e723619516eb6">magnitude_corr</a>, s-><a class="code" href="struct__fors__star.html#ee281335ef4e49be1cfb5caf7f96d7c3">dmagnitude_corr</a>,
-<a name="l00429"></a>00429                  s-><a class="code" href="struct__fors__star.html#25c48bcbeb48ed5d535e715866f06810">orientation</a>, s-><a class="code" href="struct__fors__star.html#b5357dc5aaf3b7b6edc89d700d563a2c">semi_major</a>, s-><a class="code" href="struct__fors__star.html#532b4911a7308d705f01ba1da7bc35a1">semi_minor</a>);
-<a name="l00430"></a>00430     }
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432     <span class="keywordflow">return</span>;
-<a name="l00433"></a>00433 }
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00441"></a>00441 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00442"></a>00442 <span class="keywordtype">void</span>
-<a name="l00443"></a><a class="code" href="group__fors__star.html#g8ab50c70291d9ed66d075ce9ae93577d">00443</a> <a class="code" href="group__fors__star.html#g8ab50c70291d9ed66d075ce9ae93577d">fors_star_print_list</a>(cpl_msg_severity level, <span class="keyword">const</span> fors_star_list *sl)
-<a name="l00444"></a>00444 {
-<a name="l00445"></a>00445     <span class="keywordflow">if</span> (sl == NULL) fors_msg(level, <span class="stringliteral">"Null list"</span>);
-<a name="l00446"></a>00446     <span class="keywordflow">else</span> {
-<a name="l00447"></a>00447         <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s;
-<a name="l00448"></a>00448         
-<a name="l00449"></a>00449         <span class="keywordflow">for</span> (s = fors_star_list_first_const(sl);
-<a name="l00450"></a>00450              s != NULL;
-<a name="l00451"></a>00451              s = fors_star_list_next_const(sl)) {
-<a name="l00452"></a>00452             <a class="code" href="group__fors__star.html#g89b5801d41c9760d82ec12097e14b584">fors_star_print</a>(level, s);
-<a name="l00453"></a>00453         }
-<a name="l00454"></a>00454     }
-<a name="l00455"></a>00455     <span class="keywordflow">return</span>;
-<a name="l00456"></a>00456 }
-<a name="l00457"></a>00457 
-<a name="l00458"></a>00458 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00465"></a>00465 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00466"></a>00466 <span class="keywordtype">double</span>
-<a name="l00467"></a><a class="code" href="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0">00467</a> <a class="code" href="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0">fors_star_get_x</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)
-<a name="l00468"></a>00468 {
-<a name="l00469"></a>00469     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00470"></a>00470 
-<a name="l00471"></a>00471     data = data;
-<a name="l00472"></a>00472 
-<a name="l00473"></a>00473     <span class="keywordflow">return</span> s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x;
-<a name="l00474"></a>00474 }
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00483"></a>00483 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00484"></a>00484 <span class="keywordtype">double</span>
-<a name="l00485"></a><a class="code" href="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e">00485</a> <a class="code" href="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e">fors_star_get_y</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)
-<a name="l00486"></a>00486 {
-<a name="l00487"></a>00487     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00488"></a>00488 
-<a name="l00489"></a>00489     data = data;
-<a name="l00490"></a>00490 
-<a name="l00491"></a>00491     <span class="keywordflow">return</span> s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y;
-<a name="l00492"></a>00492 }
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494 
-<a name="l00495"></a>00495 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00502"></a>00502 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00503"></a>00503 <span class="keywordtype">double</span>
-<a name="l00504"></a><a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">00504</a> <a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)
-<a name="l00505"></a>00505 {
-<a name="l00506"></a>00506     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s     != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00507"></a>00507     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00508"></a>00508     data = data;
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510     <span class="keywordflow">return</span> (s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->magnitude - s-><a class="code" href="struct__fors__star.html#20a78115ec557bc3cf1e723619516eb6">magnitude_corr</a>);
-<a name="l00511"></a>00511 }
-<a name="l00512"></a>00512 
-<a name="l00513"></a>00513 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00520"></a>00520 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00521"></a>00521 <span class="keywordtype">double</span>
-<a name="l00522"></a><a class="code" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">00522</a> <a class="code" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">fors_star_get_zeropoint_err</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)
-<a name="l00523"></a>00523 {
-<a name="l00524"></a>00524     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s     != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00525"></a>00525     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00526"></a>00526     data = data;
-<a name="l00527"></a>00527     
-<a name="l00528"></a>00528     <span class="keywordflow">return</span> sqrt(s-><a class="code" href="struct__fors__star.html#ee281335ef4e49be1cfb5caf7f96d7c3">dmagnitude_corr</a> * s-><a class="code" href="struct__fors__star.html#ee281335ef4e49be1cfb5caf7f96d7c3">dmagnitude_corr</a> +
-<a name="l00529"></a>00529                 s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->dmagnitude * s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->dmagnitude);
-<a name="l00530"></a>00530 }
-<a name="l00531"></a>00531 
-<a name="l00532"></a>00532 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00539"></a>00539 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00540"></a>00540 <span class="keywordtype">bool</span>
-<a name="l00541"></a><a class="code" href="group__fors__star.html#g41b7ffa8530d0ffbc45916248663ac45">00541</a> <a class="code" href="group__fors__star.html#g41b7ffa8530d0ffbc45916248663ac45">fors_star_is_identified</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)
-<a name="l00542"></a>00542 {
-<a name="l00543"></a>00543     data = data;
-<a name="l00544"></a>00544     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s     != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00545"></a>00545     <span class="keywordflow">return</span> (s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> != NULL && s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->trusted);
-<a name="l00546"></a>00546 }
-<a name="l00547"></a>00547 
-<a name="l00548"></a><a class="code" href="group__fors__star.html#gb79164ea3a1118352c6ca0ea9a9840ea">00548</a> <span class="preprocessor">#define LIST_DEFINE</span>
-<a name="l00549"></a>00549 <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00550"></a><a class="code" href="group__fors__star.html#g9d7995a21a54c1d39a0bc87d7f498029">00550</a> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_star</span>
-<a name="l00551"></a>00551 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00552"></a>00552 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__star_8c_source.html b/html/fors__star_8c_source.html
new file mode 100644
index 0000000..70caebc
--- /dev/null
+++ b/html/fors__star_8c_source.html
@@ -0,0 +1,486 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_star.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_star.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_star.c,v 1.29 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.29 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_star.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <assert.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="comment">    Prototypes</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="keyword">static</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keywordtype">double</span>  <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(  <span class="keyword">const</span> cpl_table *tab,</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>                                     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *colname);</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="comment">    Private Implementation</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="keyword">static</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno"><a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8">   73</a></span> <span class="keywordtype">double</span>  <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(  <span class="keyword">const</span> cpl_table *tab,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                                     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *colname)</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> {</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     <span class="keywordtype">int</span> null;</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <span class="keywordflow">if</span> (colname != NULL && colname[0] != <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     {</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>         <span class="keywordtype">double</span>  d;</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>         d = cpl_table_get(          tab, colname, row, &null);</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                     !cpl_error_get_code(),</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                                     <span class="keywordflow">return</span> d,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                                     <span class="stringliteral">"Missing column: %s"</span>,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                                         colname);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>         <span class="keywordflow">return</span> d;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>             </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     }</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>         <span class="keywordflow">return</span> 0.0;</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> }</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="comment">    Implementation</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga7a8b2a60d5685524ffbb762e066c9b01">  114</a></span> <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__fors__star.html#ga7a8b2a60d5685524ffbb762e066c9b01" title="Constructor.">fors_star_new</a>(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                          <span class="keywordtype">double</span> fwhm,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                          <span class="keywordtype">double</span> smajor, <span class="keywordtype">double</span> sminor,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                          <span class="keywordtype">double</span> orientation,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                          <span class="keywordtype">double</span> m, <span class="keywordtype">double</span> dm,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                          <span class="keywordtype">double</span> si)</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> {</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( smajor >= sminor && sminor >= 0, <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>             <span class="stringliteral">"Illegal semi major/minor axes: %g, %g"</span>,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>             smajor, sminor );</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( 0 <= si && si <= 1, <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>             <span class="stringliteral">"Stellarity index must be between 0 and 1, is %f"</span>,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>             si);</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( fwhm >= 0, <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>             <span class="stringliteral">"Star FWHM must be non-negative, is %f"</span>,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>             fwhm);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <a class="code" href="struct__fors__star.html">fors_star</a> *s = cpl_malloc(<span class="keyword">sizeof</span>(*s));</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     s->pixel = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(x, y);</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     s->fwhm = fwhm;</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     s->semi_major = smajor;</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     s->semi_minor = sminor;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     s->stellarity_index = si;</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     s->orientation = orientation;</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     s->magnitude = m;</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     s->dmagnitude = dm;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     s->magnitude_corr = 0;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     s->dmagnitude_corr = 0;</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     s->id = NULL;</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     s->weight = 0;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="keywordflow">return</span> s;</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> }</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup fors_star_delete(&s)</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga5be8cd6931b5f998692daaf65bcf9755">  170</a></span> <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__fors__star.html#ga5be8cd6931b5f998692daaf65bcf9755" title="Create a star from a table WITHOUT checking.">fors_star_new_from_table</a>(<span class="keyword">const</span> cpl_table *tab,</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                                     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *x_col,</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *y_col,</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *fwhm_col,</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *smaj_col,</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *smin_col,</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *theta_col,</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *mag_col,</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *dmag_col,</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                                     <span class="keyword">const</span> <span class="keywordtype">char</span>      *stlndx_col)</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> {</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     <span class="keywordtype">int</span> null;</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <a class="code" href="struct__fors__star.html">fors_star</a> *s = cpl_malloc(<span class="keyword">sizeof</span>(*s));</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> </div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     s->pixel = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(  <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, x_col),</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                                 <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, y_col));</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     s->fwhm =                   <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, fwhm_col);</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     s->semi_major =             <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, smaj_col);</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     s->semi_minor =             <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, smin_col);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     s->stellarity_index =       <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, stlndx_col);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     s->orientation =            <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, theta_col);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     s->magnitude =              <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, mag_col);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     </div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     s->dmagnitude =             <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, dmag_col);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(!cpl_error_get_code(), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     s->magnitude_corr = 0;</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     s->dmagnitude_corr = 0;</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     s->id = NULL;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     s->weight = 0;</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <span class="keywordflow">return</span> s;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga279f39755ddfa24ee9cfad4a03c01cf3">  227</a></span> <span class="keywordtype">bool</span> <a class="code" href="group__fors__star.html#ga279f39755ddfa24ee9cfad4a03c01cf3" title="Copy constructor.">fors_star_check_values</a>(        <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star)</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> {</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <span class="keywordtype">bool</span>    success = 1;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     success &= (star != NULL);</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     success &= (star->semi_major >= star->semi_minor);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     success &= (0.0 <= star->stellarity_index && star->stellarity_index <= 1.0);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     success &= (star->fwhm > 0.0);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     </div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="keywordflow">return</span> success;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> }</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00248"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a">  248</a></span> <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star)</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> {</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <a class="code" href="struct__fors__star.html">fors_star</a> *d;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( star != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     d = cpl_malloc(<span class="keyword">sizeof</span>(*d));</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     *d = *star;  <span class="comment">/* Simple copy of all members, next do</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> <span class="comment">                    deep copy of pointers */</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     d->pixel = <a class="code" href="group__fors__point.html#gaefadbecbfc8e491ca544292027d8b69e" title="Copy constructor.">fors_point_duplicate</a>(star->pixel);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="keywordflow">if</span> (star->id != NULL) {</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         d->id = fors_std_star_duplicate(star->id);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     }</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     <span class="keywordflow">return</span> d;</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> }</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774">  273</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>(<a class="code" href="struct__fors__star.html">fors_star</a> **star)</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> {</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="keywordflow">if</span> (star && *star) {</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>         <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&(*star)->pixel);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>         <span class="keywordflow">if</span> ((*star)->id != NULL) {</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>             fors_std_star_delete_const(&((*star)->id));</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>         }</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>         cpl_free(*star); *star = NULL;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     }</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> }</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga517c8c542ad4eb8145fa664be9625a98">  291</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__star.html#ga517c8c542ad4eb8145fa664be9625a98" title="Delete object and set pointer to NULL - but ignore the standard star.">fors_star_delete_but_standard</a>(<a class="code" href="struct__fors__star.html">fors_star</a> **star)</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> {</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     <span class="keywordflow">if</span> (star && *star) {</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>         <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&(*star)->pixel);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>         cpl_free(*star); *star = NULL;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     }</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> }</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1">  309</a></span> <a class="code" href="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1" title="Test for equality.">fors_star_equal</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s,</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                 <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *t)</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> {</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL && t != NULL, <span class="keywordflow">return</span> <span class="keyword">true</span>, NULL );</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     </div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     <span class="keywordflow">return</span> (<a class="code" href="group__fors__point.html#ga08402a65da099406fc85d21041df7f9d" title="Equality.">fors_point_equal</a>(s->pixel, t->pixel));</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> }</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="preprocessor">#undef clenaup</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga7672a63fe0deea93cb8bae8362b6d020">  329</a></span> <a class="code" href="group__fors__star.html#ga7672a63fe0deea93cb8bae8362b6d020" title="Compare star brightness.">fors_star_brighter_than</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s1,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                         <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s2,</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>                         <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> {</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     data = data;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordflow">return</span> (s1->magnitude < s2->magnitude);</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> }</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga53496a5c3e6810c6c59d221120df422b">  347</a></span> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#ga53496a5c3e6810c6c59d221120df422b" title="Get distance between stars.">fors_star_distsq</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keyword">const</span> <a class="code"  [...]
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> {</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( t != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> </div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142" title="Metric.">fors_point_distsq</a>(s->pixel, t->pixel);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> }</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga2c97d2c47686016fa04c59b2a3e92b5c">  365</a></span> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#ga2c97d2c47686016fa04c59b2a3e92b5c" title="Get star size.">fors_star_extension</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> {</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     data = data;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> </div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="comment">/* return sqrt(s->semi_major * s->semi_minor); */</span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keywordflow">return</span> s->fwhm / TWOSQRT2LN2;</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> }</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga67451b955667ae4f965146aee484c6bc">  384</a></span> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#ga67451b955667ae4f965146aee484c6bc" title="Get star stellarity.">fors_star_stellarity</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> {</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     data = data;</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     <span class="keywordflow">return</span> s->stellarity_index;</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> }</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga9e7994d44acbe88580cab63d3662df40">  402</a></span> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#ga9e7994d44acbe88580cab63d3662df40" title="Get star ellipticity.">fors_star_ellipticity</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> {</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     data = data;</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     <span class="keywordflow">if</span> (s->semi_major <= 0) <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 1 - (s->semi_minor / s->semi_major);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> }</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> </div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga3443159e600f23336b266f7b557f4ea0">  418</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__star.html#ga3443159e600f23336b266f7b557f4ea0" title="Print object.">fors_star_print</a>(cpl_msg_severity level, <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s)</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> {</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     <span class="keywordflow">if</span> (s == NULL) {</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>         fors_msg(level, <span class="stringliteral">"[NULL]"</span>);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     }</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>         fors_msg(level, <span class="stringliteral">"at (%7.2f, %7.2f): m = %g +- %g (mc = %g +- %g), "</span></div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>                  <span class="stringliteral">"shape: (%g, %g, %g)"</span>,</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>                  s->pixel->x, s->pixel->y,</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                  s->magnitude, s->dmagnitude,</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>                  s->magnitude_corr, s->dmagnitude_corr,</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>                  s->orientation, s->semi_major, s->semi_minor);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     }</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> </div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> }</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> </div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga4e15f3d1dbd18c8e010dc4ef82401d7d">  443</a></span> <a class="code" href="group__fors__star.html#ga4e15f3d1dbd18c8e010dc4ef82401d7d" title="Print list of stars.">fors_star_print_list</a>(cpl_msg_severity level, <span class="keyword">const</span> fors_star_list *sl)</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> {</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     <span class="keywordflow">if</span> (sl == NULL) fors_msg(level, <span class="stringliteral">"Null list"</span>);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>         <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>         </div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>         <span class="keywordflow">for</span> (s = fors_star_list_first_const(sl);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>              s != NULL;</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>              s = fors_star_list_next_const(sl)) {</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>             <a class="code" href="group__fors__star.html#ga3443159e600f23336b266f7b557f4ea0" title="Print object.">fors_star_print</a>(level, s);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>         }</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     }</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> }</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> </div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00467"></a><span class="lineno"><a class="code" href="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165">  467</a></span> <a class="code" href="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165" title="Get position.">fors_star_get_x</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> {</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     data = data;</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> </div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     <span class="keywordflow">return</span> s->pixel->x;</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> }</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> </div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160">  485</a></span> <a class="code" href="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160" title="Get position.">fors_star_get_y</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> {</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span> </div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     data = data;</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span> </div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     <span class="keywordflow">return</span> s->pixel->y;</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> }</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> </div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> </div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00504"></a><span class="lineno"><a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e">  504</a></span> <a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e" title="Get zeropoint.">fors_star_get_zeropoint</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> {</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s     != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s->id != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     data = data;</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> </div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     <span class="keywordflow">return</span> (s->id->magnitude - s->magnitude_corr);</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> }</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span> </div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00522"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183">  522</a></span> <a class="code" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183" title="Get zeropoint error.">fors_star_get_zeropoint_err</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> {</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s     != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s->id != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     data = data;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     <span class="keywordflow">return</span> sqrt(s->dmagnitude_corr * s->dmagnitude_corr +</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>                 s->id->dmagnitude * s->id->dmagnitude);</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> }</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> </div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00541"></a><span class="lineno"><a class="code" href="group__fors__star.html#ga525a48af1f85cf79ee7a60885eb5b13d">  541</a></span> <a class="code" href="group__fors__star.html#ga525a48af1f85cf79ee7a60885eb5b13d" title="Determine if star was identified.">fors_star_is_identified</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> {</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     data = data;</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s     != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keywordflow">return</span> (s->id != NULL && s->id->trusted);</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span> }</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span> </div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span> <span class="preprocessor">#define LIST_DEFINE</span></div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_star</span></div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__star_8h-source.html b/html/fors__star_8h-source.html
deleted file mode 100644
index b224cf7..0000000
--- a/html/fors__star_8h-source.html
+++ /dev/null
@@ -1,146 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_star.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_star.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_star.h,v 1.21 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.21 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_STAR_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_STAR_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_std_star.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a><a class="code" href="struct__fors__star.html">00035</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__star.html">_fors_star</a>
-<a name="l00036"></a>00036 {
-<a name="l00037"></a><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">00037</a>     fors_point *<a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>;
-<a name="l00038"></a><a class="code" href="struct__fors__star.html#b5357dc5aaf3b7b6edc89d700d563a2c">00038</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__star.html#b5357dc5aaf3b7b6edc89d700d563a2c">semi_major</a>;
-<a name="l00039"></a><a class="code" href="struct__fors__star.html#532b4911a7308d705f01ba1da7bc35a1">00039</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__star.html#532b4911a7308d705f01ba1da7bc35a1">semi_minor</a>;
-<a name="l00040"></a><a class="code" href="struct__fors__star.html#4bb929a1553cd3239fcf18112c699200">00040</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__star.html#4bb929a1553cd3239fcf18112c699200">fwhm</a>;
-<a name="l00041"></a><a class="code" href="struct__fors__star.html#cd353ab887426dc767a89db51164271a">00041</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__star.html#cd353ab887426dc767a89db51164271a">stellarity_index</a>;    <span class="comment">/* in [0; 1] */</span>
-<a name="l00042"></a><a class="code" href="struct__fors__star.html#25c48bcbeb48ed5d535e715866f06810">00042</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__star.html#25c48bcbeb48ed5d535e715866f06810">orientation</a>;         <span class="comment">/* radians */</span>
-<a name="l00043"></a>00043 
-<a name="l00044"></a><a class="code" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">00044</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">magnitude</a>;           <span class="comment">/* instrumental magnitude (integrated ADU) */</span>
-<a name="l00045"></a><a class="code" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">00045</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">dmagnitude</a>;          <span class="comment">/* 1 sigma error bar */</span>
-<a name="l00046"></a>00046 
-<a name="l00047"></a><a class="code" href="struct__fors__star.html#20a78115ec557bc3cf1e723619516eb6">00047</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__star.html#20a78115ec557bc3cf1e723619516eb6">magnitude_corr</a>;      <span class="comment">/* magnitude corrected for gain, atmospheric</span>
-<a name="l00048"></a>00048 <span class="comment">                                   extinction, exposure time */</span>
-<a name="l00049"></a><a class="code" href="struct__fors__star.html#ee281335ef4e49be1cfb5caf7f96d7c3">00049</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__star.html#ee281335ef4e49be1cfb5caf7f96d7c3">dmagnitude_corr</a>;
-<a name="l00050"></a>00050 
-<a name="l00051"></a><a class="code" href="struct__fors__star.html#82910b82de5851e8f59e40b205b6f829">00051</a>     <span class="keywordtype">double</span> <a class="code" href="struct__fors__star.html#82910b82de5851e8f59e40b205b6f829">weight</a>;              <span class="comment">/* for the user of this module to define the</span>
-<a name="l00052"></a>00052 <span class="comment">                                   meaning this */</span>
-<a name="l00053"></a>00053 
-<a name="l00054"></a><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">00054</a>     <span class="keyword">const</span> fors_std_star *<a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>;    <span class="comment">/* copy of identified, or NULL */</span>
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 } <a class="code" href="struct__fors__star.html">fors_star</a>;
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058 <span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_star</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__fors__star.html#g548c477088fd4fbadd74fd84f3becb94">fors_star_new</a>(                   <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y,
-<a name="l00063"></a>00063                                                         <span class="keywordtype">double</span> fwhm,
-<a name="l00064"></a>00064                                             <span class="keywordtype">double</span> smajor, <span class="keywordtype">double</span> sminor,
-<a name="l00065"></a>00065                                                         <span class="keywordtype">double</span> orientation,
-<a name="l00066"></a>00066                                                         <span class="keywordtype">double</span> m, <span class="keywordtype">double</span> dm,
-<a name="l00067"></a>00067                                             <span class="keywordtype">double</span> si);
-<a name="l00068"></a>00068 
-<a name="l00069"></a>00069 <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__fors__star.html#gec880ac28409dd535ec3138e0b5b001c">fors_star_new_from_table</a>(        <span class="keyword">const</span> cpl_table *tab,
-<a name="l00070"></a>00070                                             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,
-<a name="l00071"></a>00071                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *x_col,
-<a name="l00072"></a>00072                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *y_col,
-<a name="l00073"></a>00073                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *fwhm_col,
-<a name="l00074"></a>00074                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *smaj_col,
-<a name="l00075"></a>00075                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *smin_col,
-<a name="l00076"></a>00076                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *theta_col,
-<a name="l00077"></a>00077                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *mag_col,
-<a name="l00078"></a>00078                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dmag_col,
-<a name="l00079"></a>00079                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *stlndx_col);
-<a name="l00080"></a>00080 
-<a name="l00081"></a>00081 <span class="keywordtype">bool</span> <a class="code" href="group__fors__star.html#g1ef535783913303ad950792cdd1d59c8">fors_star_check_values</a>(                <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star);
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083 <span class="keywordtype">void</span> <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>(<a class="code" href="struct__fors__star.html">fors_star</a> **star);
-<a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="group__fors__star.html#g40fa6037fee74abd5a9d5166137609e0">fors_star_delete_but_standard</a>(<a class="code" href="struct__fors__star.html">fors_star</a> **star);
-<a name="l00085"></a>00085 
-<a name="l00086"></a>00086 <a class="code" href="struct__fors__star.html">fors_star</a> *
-<a name="l00087"></a>00087 <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star);
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089 <span class="keywordtype">bool</span>
-<a name="l00090"></a>00090 <a class="code" href="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98">fors_star_equal</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s,
-<a name="l00091"></a>00091                 <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *t);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093 <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#g21eca2e7981ea38bc0b5a66edfc56bb9">fors_star_distsq</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *t);
-<a name="l00094"></a>00094 <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#g4f81e6410fe5c7aefbdbcae907095059">fors_star_extension</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);
-<a name="l00095"></a>00095 <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#g310c2402602378a7505a36a85ee98c7b">fors_star_stellarity</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);
-<a name="l00096"></a>00096 <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#gdef23fa2c1ad1c4f2b0de18038b0daca">fors_star_ellipticity</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 <span class="keywordtype">bool</span>
-<a name="l00099"></a>00099 <a class="code" href="group__fors__star.html#g100f4290bf02ce348f22092f4e2bc3eb">fors_star_brighter_than</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s1,
-<a name="l00100"></a>00100                         <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s2,
-<a name="l00101"></a>00101                         <span class="keywordtype">void</span> *data);
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103 <span class="keywordtype">void</span>
-<a name="l00104"></a>00104 <a class="code" href="group__fors__star.html#g89b5801d41c9760d82ec12097e14b584">fors_star_print</a>(cpl_msg_severity level, <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s);
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106 <span class="keywordtype">void</span>
-<a name="l00107"></a>00107 <a class="code" href="group__fors__star.html#g8ab50c70291d9ed66d075ce9ae93577d">fors_star_print_list</a>(cpl_msg_severity level, <span class="keyword">const</span> fors_star_list *sl);
-<a name="l00108"></a>00108 
-<a name="l00109"></a>00109 <span class="keywordtype">double</span>
-<a name="l00110"></a>00110 <a class="code" href="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0">fors_star_get_x</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);
-<a name="l00111"></a>00111 
-<a name="l00112"></a>00112 <span class="keywordtype">double</span>
-<a name="l00113"></a>00113 <a class="code" href="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e">fors_star_get_y</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115 <span class="keywordtype">double</span>
-<a name="l00116"></a>00116 <a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118 <span class="keywordtype">double</span>
-<a name="l00119"></a>00119 <a class="code" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">fors_star_get_zeropoint_err</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);
-<a name="l00120"></a>00120 
-<a name="l00121"></a>00121 <span class="keywordtype">bool</span>
-<a name="l00122"></a>00122 <a class="code" href="group__fors__star.html#g41b7ffa8530d0ffbc45916248663ac45">fors_star_is_identified</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__star_8h_source.html b/html/fors__star_8h_source.html
new file mode 100644
index 0000000..59caf9a
--- /dev/null
+++ b/html/fors__star_8h_source.html
@@ -0,0 +1,185 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_star.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_star.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_star.h,v 1.21 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.21 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_STAR_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_STAR_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_std_star.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="struct__fors__star.html">   35</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__star.html">_fors_star</a></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> {</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span>     fors_point *pixel;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span>     <span class="keywordtype">double</span> semi_major;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>     <span class="keywordtype">double</span> semi_minor;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>     <span class="keywordtype">double</span> fwhm;</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>     <span class="keywordtype">double</span> stellarity_index;    <span class="comment">/* in [0; 1] */</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>     <span class="keywordtype">double</span> orientation;         <span class="comment">/* radians */</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>     <span class="keywordtype">double</span> magnitude;           <span class="comment">/* instrumental magnitude (integrated ADU) */</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>     <span class="keywordtype">double</span> dmagnitude;          <span class="comment">/* 1 sigma error bar */</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     <span class="keywordtype">double</span> magnitude_corr;      <span class="comment">/* magnitude corrected for gain, atmospheric</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="comment">                                   extinction, exposure time */</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>     <span class="keywordtype">double</span> dmagnitude_corr;</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>     <span class="keywordtype">double</span> weight;              <span class="comment">/* for the user of this module to define the</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="comment">                                   meaning this */</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>     <span class="keyword">const</span> fors_std_star *id;    <span class="comment">/* copy of identified, or NULL */</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> } <a class="code" href="struct__fors__star.html">fors_star</a>;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_star</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__fors__star.html#ga7a8b2a60d5685524ffbb762e066c9b01" title="Constructor.">fors_star_new</a>(                   <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>                                                         <span class="keywordtype">double</span> fwhm,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>                                             <span class="keywordtype">double</span> smajor, <span class="keywordtype">double</span> sminor,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>                                                         <span class="keywordtype">double</span> orientation,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>                                                         <span class="keywordtype">double</span> m, <span class="keywordtype">double</span> dm,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                                             <span class="keywordtype">double</span> si);</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <a class="code" href="struct__fors__star.html">fors_star</a> *<a class="code" href="group__fors__star.html#ga5be8cd6931b5f998692daaf65bcf9755" title="Create a star from a table WITHOUT checking.">fors_star_new_from_table</a>(        <span class="keyword">const</span> cpl_table *tab,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                                             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *x_col,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *y_col,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *fwhm_col,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *smaj_col,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *smin_col,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *theta_col,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *mag_col,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dmag_col,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *stlndx_col);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keywordtype">bool</span> <a class="code" href="group__fors__star.html#ga279f39755ddfa24ee9cfad4a03c01cf3" title="Copy constructor.">fors_star_check_values</a>(                <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star);</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>(<a class="code" href="struct__fors__star.html">fors_star</a> **star);</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__star.html#ga517c8c542ad4eb8145fa664be9625a98" title="Delete object and set pointer to NULL - but ignore the standard star.">fors_star_delete_but_standard</a>(<a class="code" href="struct__fors__star.html">fors_star</a> **star);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> </div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <a class="code" href="struct__fors__star.html">fors_star</a> *</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *star);</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <a class="code" href="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1" title="Test for equality.">fors_star_equal</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                 <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *t);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#ga53496a5c3e6810c6c59d221120df422b" title="Get distance between stars.">fors_star_distsq</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *t);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#ga2c97d2c47686016fa04c59b2a3e92b5c" title="Get star size.">fors_star_extension</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#ga67451b955667ae4f965146aee484c6bc" title="Get star stellarity.">fors_star_stellarity</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__star.html#ga9e7994d44acbe88580cab63d3662df40" title="Get star ellipticity.">fors_star_ellipticity</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <a class="code" href="group__fors__star.html#ga7672a63fe0deea93cb8bae8362b6d020" title="Compare star brightness.">fors_star_brighter_than</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s1,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                         <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s2,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                         <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <a class="code" href="group__fors__star.html#ga3443159e600f23336b266f7b557f4ea0" title="Print object.">fors_star_print</a>(cpl_msg_severity level, <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> </div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <a class="code" href="group__fors__star.html#ga4e15f3d1dbd18c8e010dc4ef82401d7d" title="Print list of stars.">fors_star_print_list</a>(cpl_msg_severity level, <span class="keyword">const</span> fors_star_list *sl);</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <a class="code" href="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165" title="Get position.">fors_star_get_x</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <a class="code" href="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160" title="Get position.">fors_star_get_y</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e" title="Get zeropoint.">fors_star_get_zeropoint</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <a class="code" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183" title="Get zeropoint error.">fors_star_get_zeropoint_err</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <a class="code" href="group__fors__star.html#ga525a48af1f85cf79ee7a60885eb5b13d" title="Determine if star was identified.">fors_star_is_identified</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__std__cat_8c-source.html b/html/fors__std__cat_8c-source.html
deleted file mode 100644
index e149cea..0000000
--- a/html/fors__std__cat_8c-source.html
+++ /dev/null
@@ -1,1716 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_std_cat.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_std_cat.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_std_cat.c,v 1.19 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.19 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_std_star.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_instrument.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <math.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <string.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_STD_CAT_COLUMN_RA   = <span class="stringliteral">"RA"</span>;
-<a name="l00041"></a>00041 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_STD_CAT_COLUMN_DEC  = <span class="stringliteral">"DEC"</span>;
-<a name="l00042"></a>00042 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_STD_CAT_COLUMN_NAME = <span class="stringliteral">"OBJECT"</span>;
-<a name="l00043"></a>00043 
-<a name="l00044"></a><a class="code" href="structband__jacobian.html">00044</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structband__jacobian.html">band_jacobian</a> {
-<a name="l00045"></a><a class="code" href="structband__jacobian.html#b448380c1a9359906b9d6739074ee4b4">00045</a>     <span class="keywordtype">char</span>    <a class="code" href="structband__jacobian.html#b448380c1a9359906b9d6739074ee4b4">band</a>;
-<a name="l00046"></a><a class="code" href="structband__jacobian.html#a55c1f441e0583da81dc8e736a890beb">00046</a>     <span class="keywordtype">double</span>  <a class="code" href="structband__jacobian.html#a55c1f441e0583da81dc8e736a890beb">mag</a>[6]; <span class="comment">/* 5 inputs, 1 constant */</span>
-<a name="l00047"></a><a class="code" href="structband__jacobian.html#81d02268a4a5d5366b43d30714ed4f7f">00047</a>     <span class="keywordtype">double</span>  <a class="code" href="structband__jacobian.html#81d02268a4a5d5366b43d30714ed4f7f">col</a>[6]; <span class="comment">/* 5 inputs, 1 constant */</span>
-<a name="l00048"></a>00048 } <a class="code" href="structband__jacobian.html">band_jacobian</a>;
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00051"></a>00051 fors_std_cat_propagate_uncorrelated_inputs( <span class="keyword">const</span> <span class="keywordtype">double</span>    *in,
-<a name="l00052"></a>00052                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *din,
-<a name="l00053"></a>00053                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *jacobi_A,
-<a name="l00054"></a>00054                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *jacobi_B,
-<a name="l00055"></a>00055                                             <span class="keywordtype">int</span>             size,
-<a name="l00056"></a>00056                                             <span class="keywordtype">double</span>          *out_A,
-<a name="l00057"></a>00057                                             <span class="keywordtype">double</span>          *out_B,
-<a name="l00058"></a>00058                                             <span class="keywordtype">double</span>          *dout_A,
-<a name="l00059"></a>00059                                             <span class="keywordtype">double</span>          *dout_B,
-<a name="l00060"></a>00060                                             <span class="keywordtype">double</span>          *cov_AB);
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="keyword">static</span> cpl_error_code
-<a name="l00063"></a>00063 fors_std_cat_import_generic_star(           <span class="keyword">const</span> <span class="keywordtype">double</span>        *band_values,
-<a name="l00064"></a>00064                                             <span class="keyword">const</span> <span class="keywordtype">double</span>        *band_errors,
-<a name="l00065"></a>00065                                             <span class="keyword">const</span> <a class="code" href="structband__jacobian.html">band_jacobian</a> *jacobians,
-<a name="l00066"></a>00066                                             <span class="keywordtype">int</span>                 nband_values,
-<a name="l00067"></a>00067                                             <span class="keywordtype">int</span>                 nbands,
-<a name="l00068"></a>00068                                             <span class="keywordtype">char</span>                band,
-<a name="l00069"></a>00069                                             <span class="keywordtype">double</span>  *cat_mag,
-<a name="l00070"></a>00070                                             <span class="keywordtype">double</span>  *dcat_mag,
-<a name="l00071"></a>00071                                             <span class="keywordtype">double</span>  *color,
-<a name="l00072"></a>00072                                             <span class="keywordtype">double</span>  *dcolor,
-<a name="l00073"></a>00073                                             <span class="keywordtype">double</span>  *cov_catmag_color);
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="keyword">static</span>  <span class="keywordtype">bool</span>
-<a name="l00076"></a>00076 fors_std_cat_check_band_support(            cpl_error_code (*import_func)(
-<a name="l00077"></a>00077                                                 <span class="keywordtype">double</span>  *values,
-<a name="l00078"></a>00078                                                 <span class="keywordtype">double</span>  *errors,
-<a name="l00079"></a>00079                                                 <span class="keywordtype">char</span>    band,
-<a name="l00080"></a>00080                                                 <span class="keywordtype">double</span>  *out_A,
-<a name="l00081"></a>00081                                                 <span class="keywordtype">double</span>  *dout_A,
-<a name="l00082"></a>00082                                                 <span class="keywordtype">double</span>  *out_B,
-<a name="l00083"></a>00083                                                 <span class="keywordtype">double</span>  *dout_B,
-<a name="l00084"></a>00084                                                 <span class="keywordtype">double</span>  *out_cov),
-<a name="l00085"></a>00085                                             <span class="keywordtype">int</span>     nvalues,
-<a name="l00086"></a>00086                                             <span class="keywordtype">char</span>    band);
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 <span class="keyword">static</span>  <span class="keywordtype">bool</span>*
-<a name="l00089"></a>00089 fors_std_cat_determine_required_columns(     cpl_error_code (*import_func)(
-<a name="l00090"></a>00090                                                 <span class="keywordtype">double</span>  *values,
-<a name="l00091"></a>00091                                                 <span class="keywordtype">double</span>  *errors,
-<a name="l00092"></a>00092                                                 <span class="keywordtype">char</span>    band,
-<a name="l00093"></a>00093                                                 <span class="keywordtype">double</span>  *out_A,
-<a name="l00094"></a>00094                                                 <span class="keywordtype">double</span>  *dout_A,
-<a name="l00095"></a>00095                                                 <span class="keywordtype">double</span>  *out_B,
-<a name="l00096"></a>00096                                                 <span class="keywordtype">double</span>  *dout_B,
-<a name="l00097"></a>00097                                                 <span class="keywordtype">double</span>  *out_cov),
-<a name="l00098"></a>00098                                             <span class="keywordtype">int</span>     nvalues,
-<a name="l00099"></a>00099                                             <span class="keywordtype">char</span>    band);
-<a name="l00100"></a>00100 
-<a name="l00101"></a>00101 <span class="keyword">static</span> cpl_error_code
-<a name="l00102"></a>00102 fors_std_cat_reject_not_required_columns(   cpl_array       *column_names,
-<a name="l00103"></a>00103                                             cpl_error_code  (*import_func)(
-<a name="l00104"></a>00104                                                 <span class="keywordtype">double</span>  *values,
-<a name="l00105"></a>00105                                                 <span class="keywordtype">double</span>  *errors,
-<a name="l00106"></a>00106                                                 <span class="keywordtype">char</span>    band,
-<a name="l00107"></a>00107                                                 <span class="keywordtype">double</span>  *out_A,
-<a name="l00108"></a>00108                                                 <span class="keywordtype">double</span>  *dout_A,
-<a name="l00109"></a>00109                                                 <span class="keywordtype">double</span>  *out_B,
-<a name="l00110"></a>00110                                                 <span class="keywordtype">double</span>  *dout_B,
-<a name="l00111"></a>00111                                                 <span class="keywordtype">double</span>  *out_cov),
-<a name="l00112"></a>00112                                             <span class="keywordtype">char</span>            band);
-<a name="l00113"></a>00113 
-<a name="l00114"></a>00114 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00115"></a>00115 fors_std_cat_table_check_columns(           <span class="keyword">const</span> cpl_table *cat_table,
-<a name="l00116"></a>00116                                             <span class="keyword">const</span> cpl_array *columns);
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118 <span class="keyword">static</span> cpl_array    *
-<a name="l00119"></a>00119 fors_std_cat_create_error_column_names(     <span class="keyword">const</span> cpl_array *colnames);
-<a name="l00120"></a>00120 
-<a name="l00121"></a>00121 <span class="keyword">static</span> cpl_error_code
-<a name="l00122"></a>00122 fors_std_cat_landolt_star_import(           <span class="keywordtype">double</span>  v_bv_ub_vr_vi[5],
-<a name="l00123"></a>00123                                             <span class="keywordtype">double</span>  ERR_v_bv_ub_vr_vi[5],
-<a name="l00124"></a>00124                                             <span class="keywordtype">char</span>    band,
-<a name="l00125"></a>00125                                             <span class="keywordtype">double</span>  *cat_mag,
-<a name="l00126"></a>00126                                             <span class="keywordtype">double</span>  *dcat_mag,
-<a name="l00127"></a>00127                                             <span class="keywordtype">double</span>  *color,
-<a name="l00128"></a>00128                                             <span class="keywordtype">double</span>  *dcolor,
-<a name="l00129"></a>00129                                             <span class="keywordtype">double</span>  *cov_catmag_color);
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131 <span class="keyword">static</span> cpl_array    *
-<a name="l00132"></a>00132 fors_std_cat_landolt_get_column_names(      <span class="keywordtype">void</span>);
-<a name="l00133"></a>00133 
-<a name="l00134"></a>00134 <span class="keyword">static</span> cpl_error_code
-<a name="l00135"></a>00135 fors_std_cat_stetson_star_import(           <span class="keywordtype">double</span>  u_b_v_r_i[5],
-<a name="l00136"></a>00136                                             <span class="keywordtype">double</span>  ERR_u_b_v_r_i[5],
-<a name="l00137"></a>00137                                             <span class="keywordtype">char</span>    band,
-<a name="l00138"></a>00138                                             <span class="keywordtype">double</span>  *cat_mag,
-<a name="l00139"></a>00139                                             <span class="keywordtype">double</span>  *dcat_mag,
-<a name="l00140"></a>00140                                             <span class="keywordtype">double</span>  *color,
-<a name="l00141"></a>00141                                             <span class="keywordtype">double</span>  *dcolor,
-<a name="l00142"></a>00142                                             <span class="keywordtype">double</span>  *cov_catmag_color);
-<a name="l00143"></a>00143 
-<a name="l00144"></a>00144 <span class="keyword">static</span> cpl_array    *
-<a name="l00145"></a>00145 fors_std_cat_stetson_get_column_names(      <span class="keywordtype">void</span>);
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00148"></a>00148 fors_std_cat_check_method_and_columns(      cpl_table   *catalogue,
-<a name="l00149"></a>00149                                             cpl_array   *colnames,
-<a name="l00150"></a>00150                                             cpl_error_code  (*import_func)(
-<a name="l00151"></a>00151                                                 <span class="keywordtype">double</span>  *values,
-<a name="l00152"></a>00152                                                 <span class="keywordtype">double</span>  *errors,
-<a name="l00153"></a>00153                                                 <span class="keywordtype">char</span>    band,
-<a name="l00154"></a>00154                                                 <span class="keywordtype">double</span>  *out_A,
-<a name="l00155"></a>00155                                                 <span class="keywordtype">double</span>  *dout_A,
-<a name="l00156"></a>00156                                                 <span class="keywordtype">double</span>  *out_B,
-<a name="l00157"></a>00157                                                 <span class="keywordtype">double</span>  *dout_B,
-<a name="l00158"></a>00158                                                 <span class="keywordtype">double</span>  *out_cov),
-<a name="l00159"></a>00159                                             <span class="keywordtype">char</span>        band,
-<a name="l00160"></a>00160                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *method,
-<a name="l00161"></a>00161                                             cpl_array   **err_colnames,
-<a name="l00162"></a>00162                                             <span class="keywordtype">bool</span>        *method_supports_band);
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164 <span class="preprocessor">#undef cleanup</span>
-<a name="l00165"></a>00165 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00166"></a>00166 <span class="preprocessor"></span>
-<a name="l00180"></a>00180 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00181"></a>00181 fors_std_cat_propagate_uncorrelated_inputs( <span class="keyword">const</span> <span class="keywordtype">double</span>    *in,
-<a name="l00182"></a>00182                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *din,
-<a name="l00183"></a>00183                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *jacobi_A,
-<a name="l00184"></a>00184                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *jacobi_B,
-<a name="l00185"></a>00185                                             <span class="keywordtype">int</span>             size,
-<a name="l00186"></a>00186                                             <span class="keywordtype">double</span>          *out_A,
-<a name="l00187"></a>00187                                             <span class="keywordtype">double</span>          *out_B,
-<a name="l00188"></a>00188                                             <span class="keywordtype">double</span>          *dout_A,
-<a name="l00189"></a>00189                                             <span class="keywordtype">double</span>          *dout_B,
-<a name="l00190"></a>00190                                             <span class="keywordtype">double</span>          *cov_AB)
-<a name="l00191"></a>00191 {
-<a name="l00192"></a>00192     <span class="keywordtype">int</span> n;
-<a name="l00193"></a>00193     
-<a name="l00194"></a>00194     *out_A  = 0;
-<a name="l00195"></a>00195     *out_B  = 0;
-<a name="l00196"></a>00196     *dout_A = 0;
-<a name="l00197"></a>00197     *dout_B = 0;
-<a name="l00198"></a>00198     *cov_AB = 0;
-<a name="l00199"></a>00199     
-<a name="l00200"></a>00200     <span class="keywordflow">for</span> (n = 0; n < size; n++)
-<a name="l00201"></a>00201     {
-<a name="l00202"></a>00202         <span class="comment">/* uncorrelated inputs are assumed! */</span>
-<a name="l00203"></a>00203         *out_A  += (*jacobi_A) * (*in);
-<a name="l00204"></a>00204         *out_B  += (*jacobi_B) * (*in);
-<a name="l00205"></a>00205         *dout_A += (*jacobi_A)*(*jacobi_A) * (*din)*(*din);
-<a name="l00206"></a>00206         *dout_B += (*jacobi_B)*(*jacobi_B) * (*din)*(*din);
-<a name="l00207"></a>00207         *cov_AB += (*jacobi_A)*(*jacobi_B) * (*din)*(*din);
-<a name="l00208"></a>00208         jacobi_A++;
-<a name="l00209"></a>00209         jacobi_B++;
-<a name="l00210"></a>00210         in++;
-<a name="l00211"></a>00211         din++;
-<a name="l00212"></a>00212     }
-<a name="l00213"></a>00213     
-<a name="l00214"></a>00214     *dout_A = sqrt(*dout_A);
-<a name="l00215"></a>00215     *dout_B = sqrt(*dout_B);
-<a name="l00216"></a>00216 }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218 <span class="preprocessor">#undef cleanup</span>
-<a name="l00219"></a>00219 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00220"></a>00220 <span class="preprocessor"></span>
-<a name="l00247"></a>00247 <span class="keyword">static</span> cpl_error_code
-<a name="l00248"></a>00248 fors_std_cat_import_generic_star(           <span class="keyword">const</span> <span class="keywordtype">double</span>        *band_values,
-<a name="l00249"></a>00249                                             <span class="keyword">const</span> <span class="keywordtype">double</span>        *band_errors,
-<a name="l00250"></a>00250                                             <span class="keyword">const</span> <a class="code" href="structband__jacobian.html">band_jacobian</a> *jacobians,
-<a name="l00251"></a>00251                                             <span class="keywordtype">int</span>                 nband_values,
-<a name="l00252"></a>00252                                             <span class="keywordtype">int</span>                 nbands,
-<a name="l00253"></a>00253                                             <span class="keywordtype">char</span>                band,
-<a name="l00254"></a>00254                                             <span class="keywordtype">double</span>  *cat_mag,
-<a name="l00255"></a>00255                                             <span class="keywordtype">double</span>  *dcat_mag,
-<a name="l00256"></a>00256                                             <span class="keywordtype">double</span>  *color,
-<a name="l00257"></a>00257                                             <span class="keywordtype">double</span>  *dcolor,
-<a name="l00258"></a>00258                                             <span class="keywordtype">double</span>  *cov_catmag_color)
-<a name="l00259"></a>00259 {
-<a name="l00260"></a>00260     <span class="keywordtype">int</span> ib;
-<a name="l00261"></a>00261     <span class="keywordflow">for</span> (ib = 0; ib <= nbands; ib++)
-<a name="l00262"></a>00262     {
-<a name="l00263"></a>00263         <span class="keywordflow">if</span> (jacobians[ib].band == band)
-<a name="l00264"></a>00264         {
-<a name="l00265"></a>00265             fors_std_cat_propagate_uncorrelated_inputs(
-<a name="l00266"></a>00266                                             band_values,
-<a name="l00267"></a>00267                                             band_errors,
-<a name="l00268"></a>00268                                             jacobians[ib].mag,
-<a name="l00269"></a>00269                                             jacobians[ib].col,
-<a name="l00270"></a>00270                                             nband_values,
-<a name="l00271"></a>00271                                             cat_mag,
-<a name="l00272"></a>00272                                             color,
-<a name="l00273"></a>00273                                             dcat_mag,
-<a name="l00274"></a>00274                                             dcolor,
-<a name="l00275"></a>00275                                             cov_catmag_color);
-<a name="l00276"></a>00276             <span class="comment">/* constant term */</span>
-<a name="l00277"></a>00277             *cat_mag += jacobians[ib].<a class="code" href="structband__jacobian.html#a55c1f441e0583da81dc8e736a890beb">mag</a>[nband_values];
-<a name="l00278"></a>00278             *color   += jacobians[ib].<a class="code" href="structband__jacobian.html#81d02268a4a5d5366b43d30714ed4f7f">col</a>[nband_values];
-<a name="l00279"></a>00279             
-<a name="l00280"></a>00280             <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l00281"></a>00281         }
-<a name="l00282"></a>00282     }
-<a name="l00283"></a>00283     
-<a name="l00284"></a>00284     cpl_error_set_message(                  cpl_func,
-<a name="l00285"></a>00285                                             CPL_ERROR_UNSUPPORTED_MODE,
-<a name="l00286"></a>00286                                             <span class="stringliteral">"unknown band \'%c\'"</span>,
-<a name="l00287"></a>00287                                             band);
-<a name="l00288"></a>00288     <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00289"></a>00289 }
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291 <span class="preprocessor">#undef cleanup</span>
-<a name="l00292"></a>00292 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00293"></a>00293 <span class="preprocessor">do { \</span>
-<a name="l00294"></a>00294 <span class="preprocessor">    cpl_free(values); values = NULL; \</span>
-<a name="l00295"></a>00295 <span class="preprocessor">    cpl_free(errors); errors = NULL; \</span>
-<a name="l00296"></a>00296 <span class="preprocessor">} while (0)</span>
-<a name="l00297"></a>00297 <span class="preprocessor"></span>
-<a name="l00304"></a>00304 <span class="keyword">static</span>  <span class="keywordtype">bool</span>
-<a name="l00305"></a>00305 fors_std_cat_check_band_support(            cpl_error_code (*import_func)(
-<a name="l00306"></a>00306                                                 <span class="keywordtype">double</span>  *values,
-<a name="l00307"></a>00307                                                 <span class="keywordtype">double</span>  *errors,
-<a name="l00308"></a>00308                                                 <span class="keywordtype">char</span>    band,
-<a name="l00309"></a>00309                                                 <span class="keywordtype">double</span>  *out_A,
-<a name="l00310"></a>00310                                                 <span class="keywordtype">double</span>  *dout_A,
-<a name="l00311"></a>00311                                                 <span class="keywordtype">double</span>  *out_B,
-<a name="l00312"></a>00312                                                 <span class="keywordtype">double</span>  *dout_B,
-<a name="l00313"></a>00313                                                 <span class="keywordtype">double</span>  *out_cov),
-<a name="l00314"></a>00314                                             <span class="keywordtype">int</span>     nvalues,
-<a name="l00315"></a>00315                                             <span class="keywordtype">char</span>    band)
-<a name="l00316"></a>00316 {
-<a name="l00317"></a>00317     <span class="keywordtype">double</span>          *values = NULL,
-<a name="l00318"></a>00318                     *errors = NULL;
-<a name="l00319"></a>00319     <span class="keywordtype">double</span>          out[5];
-<a name="l00320"></a>00320     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00321"></a>00321     
-<a name="l00322"></a>00322     
-<a name="l00323"></a>00323     values = cpl_calloc(nvalues, <span class="keyword">sizeof</span>(*values));
-<a name="l00324"></a>00324     errors = cpl_calloc(nvalues, <span class="keyword">sizeof</span>(*errors));
-<a name="l00325"></a>00325     (*import_func)( values, errors, band,
-<a name="l00326"></a>00326                     out + 0, out + 1, out + 2, out + 3, out + 4);
-<a name="l00327"></a>00327     cpl_free(values);
-<a name="l00328"></a>00328     cpl_free(errors);
-<a name="l00329"></a>00329     
-<a name="l00330"></a>00330     <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))
-<a name="l00331"></a>00331     {
-<a name="l00332"></a>00332         <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_UNSUPPORTED_MODE)
-<a name="l00333"></a>00333         {
-<a name="l00334"></a>00334             cpl_errorstate_set(errstat);    <span class="comment">/* reset error */</span>
-<a name="l00335"></a>00335         }
-<a name="l00336"></a>00336         <span class="keywordflow">else</span>
-<a name="l00337"></a>00337         {
-<a name="l00338"></a>00338             cpl_error_set_where(cpl_func);
-<a name="l00339"></a>00339         }
-<a name="l00340"></a>00340         <span class="keywordflow">return</span> <span class="keyword">false</span>;
-<a name="l00341"></a>00341     }
-<a name="l00342"></a>00342     <span class="keywordflow">else</span>
-<a name="l00343"></a>00343         <span class="keywordflow">return</span> <span class="keyword">true</span>;
-<a name="l00344"></a>00344 }
-<a name="l00345"></a>00345 
-<a name="l00346"></a>00346 <span class="preprocessor">#undef cleanup</span>
-<a name="l00347"></a>00347 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00348"></a>00348 <span class="preprocessor">do { \</span>
-<a name="l00349"></a>00349 <span class="preprocessor">    cpl_free(required); required = NULL; \</span>
-<a name="l00350"></a>00350 <span class="preprocessor">    cpl_free(values); values = NULL; \</span>
-<a name="l00351"></a>00351 <span class="preprocessor">    cpl_free(errors); errors = NULL; \</span>
-<a name="l00352"></a>00352 <span class="preprocessor">} while (0)</span>
-<a name="l00353"></a>00353 <span class="preprocessor"></span>
-<a name="l00364"></a>00364 <span class="keyword">static</span>  <span class="keywordtype">bool</span>*
-<a name="l00365"></a>00365 fors_std_cat_determine_required_columns(     cpl_error_code (*import_func)(
-<a name="l00366"></a>00366                                                 <span class="keywordtype">double</span>  *values,
-<a name="l00367"></a>00367                                                 <span class="keywordtype">double</span>  *errors,
-<a name="l00368"></a>00368                                                 <span class="keywordtype">char</span>    band,
-<a name="l00369"></a>00369                                                 <span class="keywordtype">double</span>  *out_A,
-<a name="l00370"></a>00370                                                 <span class="keywordtype">double</span>  *dout_A,
-<a name="l00371"></a>00371                                                 <span class="keywordtype">double</span>  *out_B,
-<a name="l00372"></a>00372                                                 <span class="keywordtype">double</span>  *dout_B,
-<a name="l00373"></a>00373                                                 <span class="keywordtype">double</span>  *out_cov),
-<a name="l00374"></a>00374                                             <span class="keywordtype">int</span>     nvalues,
-<a name="l00375"></a>00375                                             <span class="keywordtype">char</span>    band)
-<a name="l00376"></a>00376 {
-<a name="l00377"></a>00377     <span class="keywordtype">bool</span>            *required = NULL;
-<a name="l00378"></a>00378     <span class="keywordtype">double</span>          *values = NULL,
-<a name="l00379"></a>00379                     *errors = NULL;
-<a name="l00380"></a>00380     <span class="keywordtype">double</span>          out_offset[5];
-<a name="l00381"></a>00381     <span class="keywordtype">int</span>             n;
-<a name="l00382"></a>00382     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00383"></a>00383     
-<a name="l00384"></a>00384     values = cpl_calloc(nvalues, <span class="keyword">sizeof</span>(*values));
-<a name="l00385"></a>00385     errors = cpl_calloc(nvalues, <span class="keyword">sizeof</span>(*errors));
-<a name="l00386"></a>00386     required = cpl_calloc(nvalues, <span class="keyword">sizeof</span>(*required));
-<a name="l00387"></a>00387     
-<a name="l00388"></a>00388     <span class="comment">/* get offset output values @ all inputs = 0.0 */</span>
-<a name="l00389"></a>00389     (*import_func)(                         values,
-<a name="l00390"></a>00390                                             errors,
-<a name="l00391"></a>00391                                             band,
-<a name="l00392"></a>00392                                             out_offset + 0,
-<a name="l00393"></a>00393                                             out_offset + 1,
-<a name="l00394"></a>00394                                             out_offset + 2,
-<a name="l00395"></a>00395                                             out_offset + 3,
-<a name="l00396"></a>00396                                             out_offset + 4);
-<a name="l00397"></a>00397     
-<a name="l00398"></a>00398     <span class="comment">/* successively switch on inputs</span>
-<a name="l00399"></a>00399 <span class="comment">     * (here we assume of course that they contribute independently) */</span>
-<a name="l00400"></a>00400     <span class="keywordflow">for</span> (n = 0; n < nvalues; n++)
-<a name="l00401"></a>00401     {
-<a name="l00402"></a>00402         <span class="keywordtype">double</span>  out[5];
-<a name="l00403"></a>00403         <span class="keywordtype">int</span>     i;
-<a name="l00404"></a>00404         
-<a name="l00405"></a>00405         values[n] = 1;
-<a name="l00406"></a>00406         errors[n] = 1;
-<a name="l00407"></a>00407         <span class="keywordflow">if</span> (n > 0)
-<a name="l00408"></a>00408         {
-<a name="l00409"></a>00409             values[n-1] = 0;
-<a name="l00410"></a>00410             errors[n-1] = 0;
-<a name="l00411"></a>00411         }
-<a name="l00412"></a>00412         
-<a name="l00413"></a>00413         (*import_func)(                     values,
-<a name="l00414"></a>00414                                             errors,
-<a name="l00415"></a>00415                                             band,
-<a name="l00416"></a>00416                                             out + 0,
-<a name="l00417"></a>00417                                             out + 1,
-<a name="l00418"></a>00418                                             out + 2,
-<a name="l00419"></a>00419                                             out + 3,
-<a name="l00420"></a>00420                                             out + 4);
-<a name="l00421"></a>00421         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))
-<a name="l00422"></a>00422         {
-<a name="l00423"></a>00423             cpl_error_set_where(cpl_func);
-<a name="l00424"></a>00424             <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00425"></a>00425             <span class="keywordflow">return</span> required;
-<a name="l00426"></a>00426         }
-<a name="l00427"></a>00427         
-<a name="l00428"></a>00428         <span class="keywordflow">for</span> (i = 0; i < 5; i++)
-<a name="l00429"></a>00429             <span class="keywordflow">if</span> (fabs(out[i] - out_offset[i]) > 10*DBL_EPSILON)
-<a name="l00430"></a>00430                 required[n] = <span class="keyword">true</span>;
-<a name="l00431"></a>00431     }
-<a name="l00432"></a>00432     
-<a name="l00433"></a>00433     cpl_free(values);
-<a name="l00434"></a>00434     cpl_free(errors);
-<a name="l00435"></a>00435     
-<a name="l00436"></a>00436     <span class="keywordflow">return</span> required;
-<a name="l00437"></a>00437 }
-<a name="l00438"></a>00438 
-<a name="l00439"></a>00439 <span class="preprocessor">#undef cleanup</span>
-<a name="l00440"></a>00440 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00441"></a>00441 <span class="preprocessor">do { \</span>
-<a name="l00442"></a>00442 <span class="preprocessor">    cpl_free(required); required = NULL; \</span>
-<a name="l00443"></a>00443 <span class="preprocessor">} while (0)</span>
-<a name="l00444"></a>00444 <span class="preprocessor"></span>
-<a name="l00451"></a>00451 <span class="keyword">static</span> cpl_error_code
-<a name="l00452"></a>00452 fors_std_cat_reject_not_required_columns(   cpl_array       *column_names,
-<a name="l00453"></a>00453                                             cpl_error_code  (*import_func)(
-<a name="l00454"></a>00454                                                 <span class="keywordtype">double</span>  *values,
-<a name="l00455"></a>00455                                                 <span class="keywordtype">double</span>  *errors,
-<a name="l00456"></a>00456                                                 <span class="keywordtype">char</span>    band,
-<a name="l00457"></a>00457                                                 <span class="keywordtype">double</span>  *out_A,
-<a name="l00458"></a>00458                                                 <span class="keywordtype">double</span>  *dout_A,
-<a name="l00459"></a>00459                                                 <span class="keywordtype">double</span>  *out_B,
-<a name="l00460"></a>00460                                                 <span class="keywordtype">double</span>  *dout_B,
-<a name="l00461"></a>00461                                                 <span class="keywordtype">double</span>  *out_cov),
-<a name="l00462"></a>00462                                             <span class="keywordtype">char</span>            band)
-<a name="l00463"></a>00463 {
-<a name="l00464"></a>00464     <span class="keywordtype">bool</span>            *required = NULL;
-<a name="l00465"></a>00465     <span class="keywordtype">int</span>             ncolumns,
-<a name="l00466"></a>00466                     n;
-<a name="l00467"></a>00467     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00468"></a>00468     
-<a name="l00469"></a>00469     cassure_automsg(                        import_func !=  NULL,
-<a name="l00470"></a>00470                                             CPL_ERROR_NULL_INPUT,
-<a name="l00471"></a>00471                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00472"></a>00472     cassure_automsg(                        column_names !=  NULL,
-<a name="l00473"></a>00473                                             CPL_ERROR_NULL_INPUT,
-<a name="l00474"></a>00474                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00475"></a>00475     cassure_automsg(                        cpl_array_get_type(column_names)
-<a name="l00476"></a>00476                                             == CPL_TYPE_STRING,
-<a name="l00477"></a>00477                                             CPL_ERROR_NULL_INPUT,
-<a name="l00478"></a>00478                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l00479"></a>00479     
-<a name="l00480"></a>00480     ncolumns = cpl_array_get_size(column_names);
-<a name="l00481"></a>00481     required = fors_std_cat_determine_required_columns(
-<a name="l00482"></a>00482                                             import_func,
-<a name="l00483"></a>00483                                             ncolumns,
-<a name="l00484"></a>00484                                             band);
-<a name="l00485"></a>00485     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 cpl_errorstate_is_equal(errstat),
-<a name="l00486"></a>00486                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l00487"></a>00487                                             NULL);
-<a name="l00488"></a>00488     
-<a name="l00489"></a>00489     <span class="keywordflow">for</span> (n = 0; n < ncolumns; n++)
-<a name="l00490"></a>00490     {
-<a name="l00491"></a>00491         <span class="keywordflow">if</span> (!required[n])
-<a name="l00492"></a>00492         {
-<a name="l00493"></a>00493             cpl_array_set_invalid(column_names, n);
-<a name="l00494"></a>00494         }
-<a name="l00495"></a>00495         <span class="keywordflow">else</span>
-<a name="l00496"></a>00496         {
-<a name="l00497"></a>00497             <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
-<a name="l00498"></a>00498             name = cpl_array_get_string(column_names, n);
-<a name="l00499"></a>00499             <span class="keywordflow">if</span> (name == NULL || name[0] == <span class="charliteral">'\0'</span>)
-<a name="l00500"></a>00500             {
-<a name="l00501"></a>00501                 cpl_error_set_message(      cpl_func,
-<a name="l00502"></a>00502                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l00503"></a>00503                                             <span class="stringliteral">"column %d required, but name not "</span>
-<a name="l00504"></a>00504                                             <span class="stringliteral">"specified"</span>,
-<a name="l00505"></a>00505                                             n);
-<a name="l00506"></a>00506                 <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00507"></a>00507                 <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l00508"></a>00508             }
-<a name="l00509"></a>00509         }
-<a name="l00510"></a>00510     }
-<a name="l00511"></a>00511     cpl_free(required);
-<a name="l00512"></a>00512     
-<a name="l00513"></a>00513     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?
-<a name="l00514"></a>00514                 CPL_ERROR_NONE :
-<a name="l00515"></a>00515                 cpl_error_get_code());
-<a name="l00516"></a>00516 }
-<a name="l00517"></a>00517 
-<a name="l00518"></a>00518 <span class="preprocessor">#undef cleanup</span>
-<a name="l00519"></a>00519 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00520"></a>00520 <span class="preprocessor"></span>
-<a name="l00528"></a>00528 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00529"></a>00529 fors_std_cat_table_check_columns(           <span class="keyword">const</span> cpl_table *cat_table,
-<a name="l00530"></a>00530                                             <span class="keyword">const</span> cpl_array *columns)
-<a name="l00531"></a>00531 {
-<a name="l00532"></a>00532     <span class="keywordtype">int</span> ncols,
-<a name="l00533"></a>00533         n;
-<a name="l00534"></a>00534     cassure_automsg(                        cat_table !=  NULL,
-<a name="l00535"></a>00535                                             CPL_ERROR_NULL_INPUT,
-<a name="l00536"></a>00536                                             <span class="keywordflow">return</span> <span class="keyword">false</span>);
-<a name="l00537"></a>00537     cassure_automsg(                        columns !=  NULL,
-<a name="l00538"></a>00538                                             CPL_ERROR_NULL_INPUT,
-<a name="l00539"></a>00539                                             <span class="keywordflow">return</span> <span class="keyword">false</span>);
-<a name="l00540"></a>00540     cassure_automsg(                        cpl_array_get_type(columns)
-<a name="l00541"></a>00541                                             == CPL_TYPE_STRING,
-<a name="l00542"></a>00542                                             CPL_ERROR_NULL_INPUT,
-<a name="l00543"></a>00543                                             <span class="keywordflow">return</span> <span class="keyword">false</span>);
-<a name="l00544"></a>00544 
-<a name="l00545"></a>00545     ncols = cpl_array_get_size(columns);
-<a name="l00546"></a>00546     <span class="keywordflow">for</span> (n = 0; n < ncols; n++)
-<a name="l00547"></a>00547     {
-<a name="l00548"></a>00548         <span class="keyword">const</span> <span class="keywordtype">char</span>  *cs;
-<a name="l00549"></a>00549         cs = cpl_array_get_string(columns, n);
-<a name="l00550"></a>00550         <span class="keywordflow">if</span> (cs != NULL
-<a name="l00551"></a>00551             && (!cpl_table_has_column(cat_table, cs)))
-<a name="l00552"></a>00552         {
-<a name="l00553"></a>00553             <span class="keywordflow">return</span> <span class="keyword">false</span>;
-<a name="l00554"></a>00554         }
-<a name="l00555"></a>00555     }
-<a name="l00556"></a>00556     <span class="keywordflow">return</span> <span class="keyword">true</span>;
-<a name="l00557"></a>00557 }
-<a name="l00558"></a>00558 
-<a name="l00559"></a>00559 <span class="preprocessor">#undef cleanup</span>
-<a name="l00560"></a>00560 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00561"></a>00561 <span class="preprocessor">do { \</span>
-<a name="l00562"></a>00562 <span class="preprocessor">    cpl_array_delete(errcolnames); errcolnames = NULL; \</span>
-<a name="l00563"></a>00563 <span class="preprocessor">} while (0)</span>
-<a name="l00564"></a>00564 <span class="preprocessor"></span>
-<a name="l00571"></a>00571 <span class="keyword">static</span> cpl_array    *
-<a name="l00572"></a>00572 fors_std_cat_create_error_column_names(     <span class="keyword">const</span> cpl_array *colnames)
-<a name="l00573"></a>00573 {
-<a name="l00574"></a>00574     cpl_array   *errcolnames = NULL;
-<a name="l00575"></a>00575     <span class="keywordtype">int</span>         size,
-<a name="l00576"></a>00576                 n;
-<a name="l00577"></a>00577     
-<a name="l00578"></a>00578     cassure_automsg(                        colnames !=  NULL,
-<a name="l00579"></a>00579                                             CPL_ERROR_NULL_INPUT,
-<a name="l00580"></a>00580                                             <span class="keywordflow">return</span> errcolnames);
-<a name="l00581"></a>00581     cassure_automsg(                        cpl_array_get_type(colnames)
-<a name="l00582"></a>00582                                             == CPL_TYPE_STRING,
-<a name="l00583"></a>00583                                             CPL_ERROR_NULL_INPUT,
-<a name="l00584"></a>00584                                             <span class="keywordflow">return</span> errcolnames);
-<a name="l00585"></a>00585     
-<a name="l00586"></a>00586     size = cpl_array_get_size(colnames);
-<a name="l00587"></a>00587     
-<a name="l00588"></a>00588     errcolnames = cpl_array_new(size, CPL_TYPE_STRING);
-<a name="l00589"></a>00589     <span class="keywordflow">for</span> (n = 0; n < size; n++)
-<a name="l00590"></a>00590     {
-<a name="l00591"></a>00591         <span class="keywordtype">char</span>        estr[10];
-<a name="l00592"></a>00592         <span class="keyword">const</span> <span class="keywordtype">char</span>  *cs;
-<a name="l00593"></a>00593         cs = cpl_array_get_string(colnames, n);
-<a name="l00594"></a>00594         <span class="keywordflow">if</span> (cs != NULL)
-<a name="l00595"></a>00595         {
-<a name="l00596"></a>00596             snprintf(estr, 9, <span class="stringliteral">"ERR_%s"</span>, cs);
-<a name="l00597"></a>00597             cpl_array_set_string(errcolnames, n, estr);
-<a name="l00598"></a>00598         }
-<a name="l00599"></a>00599     }
-<a name="l00600"></a>00600     <span class="keywordflow">return</span> errcolnames;
-<a name="l00601"></a>00601 }
-<a name="l00602"></a>00602 
-<a name="l00603"></a>00603 <span class="preprocessor">#undef cleanup</span>
-<a name="l00604"></a>00604 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00605"></a>00605 <span class="preprocessor"></span>
-<a name="l00621"></a>00621 <span class="keyword">static</span> cpl_error_code
-<a name="l00622"></a>00622 fors_std_cat_landolt_star_import(           <span class="keywordtype">double</span>  v_bv_ub_vr_vi[5],
-<a name="l00623"></a>00623                                             <span class="keywordtype">double</span>  ERR_v_bv_ub_vr_vi[5],
-<a name="l00624"></a>00624                                             <span class="keywordtype">char</span>    band,
-<a name="l00625"></a>00625                                             <span class="keywordtype">double</span>  *cat_mag,
-<a name="l00626"></a>00626                                             <span class="keywordtype">double</span>  *dcat_mag,
-<a name="l00627"></a>00627                                             <span class="keywordtype">double</span>  *color,
-<a name="l00628"></a>00628                                             <span class="keywordtype">double</span>  *dcolor,
-<a name="l00629"></a>00629                                             <span class="keywordtype">double</span>  *cov_catmag_color)
-<a name="l00630"></a>00630 {
-<a name="l00631"></a>00631     cpl_error_code  errc;
-<a name="l00632"></a>00632     
-<a name="l00633"></a>00633     <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structband__jacobian.html">band_jacobian</a> jacobians[6] =
-<a name="l00634"></a>00634     { <span class="comment">/*                             V   B-V   U-B   V-R   V-I     1(const) */</span>
-<a name="l00635"></a>00635                     {   <span class="charliteral">'U'</span>,    {    1,    1,    1,    0,    0,    0,},
-<a name="l00636"></a>00636                                 {    0,    0,    1,    0,    0,    0,}, },
-<a name="l00637"></a>00637                     {   <span class="charliteral">'B'</span>,    {    1,    1,    0,    0,    0,    0,},
-<a name="l00638"></a>00638                                 {    0,    1,    0,    0,    0,    0,}, },
-<a name="l00639"></a>00639                                 <span class="comment">/*(Fukugita et al. 1996, AJ 111, p1748)*/</span>
-<a name="l00640"></a>00640                     {   <span class="charliteral">'G'</span>,    {    1, 0.56,    0,    0,    0,-0.12,},
-<a name="l00641"></a>00641                                 {    0,    1,    0,    0,    0,    0,}, },
-<a name="l00642"></a>00642                     {   <span class="charliteral">'V'</span>,    {    1,    0,    0,    0,    0,    0,},
-<a name="l00643"></a>00643                                 {    0,    1,    0,    0,    0,    0,}, },
-<a name="l00644"></a>00644                     {   <span class="charliteral">'R'</span>,    {    1,    0,    0,   -1,    0,    0,},
-<a name="l00645"></a>00645                                 {    0,    0,    0,    1,    0,    0,}, },
-<a name="l00646"></a>00646                     {   <span class="charliteral">'I'</span>,    {    1,    0,    0,    0,   -1,    0,},
-<a name="l00647"></a>00647                                 {    0,    0,    0,    1,    0,    0,}, },
-<a name="l00648"></a>00648     };
-<a name="l00649"></a>00649     
-<a name="l00650"></a>00650     errc = fors_std_cat_import_generic_star(v_bv_ub_vr_vi,
-<a name="l00651"></a>00651                                             ERR_v_bv_ub_vr_vi,
-<a name="l00652"></a>00652                                             jacobians,
-<a name="l00653"></a>00653                                             5,  <span class="comment">/* jac. columns without const */</span>
-<a name="l00654"></a>00654                                             6,  <span class="comment">/* n bands (U, B, G, ...) */</span>
-<a name="l00655"></a>00655                                             band,
-<a name="l00656"></a>00656                                             cat_mag,
-<a name="l00657"></a>00657                                             dcat_mag,
-<a name="l00658"></a>00658                                             color,
-<a name="l00659"></a>00659                                             dcolor,
-<a name="l00660"></a>00660                                             cov_catmag_color);
-<a name="l00661"></a>00661     <span class="keywordflow">if</span> (errc != CPL_ERROR_NONE)
-<a name="l00662"></a>00662         cpl_error_set_where(cpl_func);
-<a name="l00663"></a>00663     <span class="keywordflow">return</span> errc;
-<a name="l00664"></a>00664 }
-<a name="l00665"></a>00665 
-<a name="l00666"></a>00666 <span class="preprocessor">#undef cleanup</span>
-<a name="l00667"></a>00667 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00668"></a>00668 <span class="preprocessor"></span>
-<a name="l00675"></a>00675 <span class="keyword">static</span> cpl_array    *
-<a name="l00676"></a>00676 fors_std_cat_landolt_get_column_names(      <span class="keywordtype">void</span>)
-<a name="l00677"></a>00677 {
-<a name="l00678"></a>00678     <span class="keyword">const</span> <span class="keywordtype">char</span>  landolt_columns[5][4] = { <span class="stringliteral">"V"</span>, <span class="stringliteral">"B_V"</span>, <span class="stringliteral">"U_B"</span>, <span class="stringliteral">"V_R"</span>, <span class="stringliteral">"V_I"</span> };
-<a name="l00679"></a>00679     cpl_array   *columns = NULL;
-<a name="l00680"></a>00680     <span class="keywordtype">int</span>         c;
-<a name="l00681"></a>00681     
-<a name="l00682"></a>00682     columns = cpl_array_new(5, CPL_TYPE_STRING);
-<a name="l00683"></a>00683     
-<a name="l00684"></a>00684     <span class="keywordflow">for</span> (c = 0; c < 5; c++)
-<a name="l00685"></a>00685         cpl_array_set_string(columns, c, landolt_columns[c]);
-<a name="l00686"></a>00686     
-<a name="l00687"></a>00687     <span class="keywordflow">return</span> columns;
-<a name="l00688"></a>00688 }
-<a name="l00689"></a>00689 
-<a name="l00690"></a>00690 <span class="preprocessor">#undef cleanup</span>
-<a name="l00691"></a>00691 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00692"></a>00692 <span class="preprocessor"></span>
-<a name="l00708"></a>00708 <span class="keyword">static</span> cpl_error_code
-<a name="l00709"></a>00709 fors_std_cat_stetson_star_import(           <span class="keywordtype">double</span>  u_b_v_r_i[5],
-<a name="l00710"></a>00710                                             <span class="keywordtype">double</span>  ERR_u_b_v_r_i[5],
-<a name="l00711"></a>00711                                             <span class="keywordtype">char</span>    band,
-<a name="l00712"></a>00712                                             <span class="keywordtype">double</span>  *cat_mag,
-<a name="l00713"></a>00713                                             <span class="keywordtype">double</span>  *dcat_mag,
-<a name="l00714"></a>00714                                             <span class="keywordtype">double</span>  *color,
-<a name="l00715"></a>00715                                             <span class="keywordtype">double</span>  *dcolor,
-<a name="l00716"></a>00716                                             <span class="keywordtype">double</span>  *cov_catmag_color)
-<a name="l00717"></a>00717 {
-<a name="l00718"></a>00718     cpl_error_code  errc;
-<a name="l00719"></a>00719     
-<a name="l00720"></a>00720     <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structband__jacobian.html">band_jacobian</a> jacobians[6] =
-<a name="l00721"></a>00721     { <span class="comment">/*                             U     B     V     R     I     1(const) */</span>
-<a name="l00722"></a>00722                     {   <span class="charliteral">'U'</span>,    {    1,    0,    0,    0,    0,    0,},
-<a name="l00723"></a>00723                                 {    1,   -1,    0,    0,    0,    0,}, },
-<a name="l00724"></a>00724                     {   <span class="charliteral">'B'</span>,    {    0,    1,    0,    0,    0,    0,},
-<a name="l00725"></a>00725                                 {    0,    1,   -1,    0,    0,    0,}, },
-<a name="l00726"></a>00726                                 <span class="comment">/*(Fukugita et al. 1996, AJ 111, p1748)*/</span>
-<a name="l00727"></a>00727                     {   <span class="charliteral">'G'</span>,    {    0, 0.56,(1.0-0.56),0,   0,-0.12,},
-<a name="l00728"></a>00728                                 {    0,    1,   -1,    0,    0,    0,}, },
-<a name="l00729"></a>00729                     {   <span class="charliteral">'V'</span>,    {    0,    0,    1,    0,    0,    0,},
-<a name="l00730"></a>00730                                 {    0,    1,   -1,    0,    0,    0,}, },
-<a name="l00731"></a>00731                     {   <span class="charliteral">'R'</span>,    {    0,    0,    0,    1,    0,    0,},
-<a name="l00732"></a>00732                                 {    0,    0,    1,   -1,    0,    0,}, },
-<a name="l00733"></a>00733                     {   <span class="charliteral">'I'</span>,    {    0,    0,    0,    0,    1,    0,},
-<a name="l00734"></a>00734                                 {    0,    0,    1,   -1,    0,    0,}, },
-<a name="l00735"></a>00735     };
-<a name="l00736"></a>00736     
-<a name="l00737"></a>00737     errc = fors_std_cat_import_generic_star(u_b_v_r_i,
-<a name="l00738"></a>00738                                             ERR_u_b_v_r_i,
-<a name="l00739"></a>00739                                             jacobians,
-<a name="l00740"></a>00740                                             5,  <span class="comment">/* jac. columns without const */</span>
-<a name="l00741"></a>00741                                             6,  <span class="comment">/* n bands (U, B, G, ...) */</span>
-<a name="l00742"></a>00742                                             band,
-<a name="l00743"></a>00743                                             cat_mag,
-<a name="l00744"></a>00744                                             dcat_mag,
-<a name="l00745"></a>00745                                             color,
-<a name="l00746"></a>00746                                             dcolor,
-<a name="l00747"></a>00747                                             cov_catmag_color);
-<a name="l00748"></a>00748     <span class="keywordflow">if</span> (errc != CPL_ERROR_NONE)
-<a name="l00749"></a>00749         cpl_error_set_where(cpl_func);
-<a name="l00750"></a>00750     <span class="keywordflow">return</span> errc;
-<a name="l00751"></a>00751 }
-<a name="l00752"></a>00752 
-<a name="l00753"></a>00753 <span class="preprocessor">#undef cleanup</span>
-<a name="l00754"></a>00754 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00755"></a>00755 <span class="preprocessor"></span>
-<a name="l00762"></a>00762 <span class="keyword">static</span> cpl_array    *
-<a name="l00763"></a>00763 fors_std_cat_stetson_get_column_names(      <span class="keywordtype">void</span>)
-<a name="l00764"></a>00764 {
-<a name="l00765"></a>00765     <span class="keyword">const</span> <span class="keywordtype">char</span>  stetson_columns[5][2] = { <span class="stringliteral">"U"</span>, <span class="stringliteral">"B"</span>, <span class="stringliteral">"V"</span>, <span class="stringliteral">"R"</span>, <span class="stringliteral">"I"</span> };
-<a name="l00766"></a>00766     cpl_array   *columns = NULL;
-<a name="l00767"></a>00767     <span class="keywordtype">int</span>         c;
-<a name="l00768"></a>00768     
-<a name="l00769"></a>00769     columns = cpl_array_new(5, CPL_TYPE_STRING);
-<a name="l00770"></a>00770     
-<a name="l00771"></a>00771     <span class="keywordflow">for</span> (c = 0; c < 5; c++)
-<a name="l00772"></a>00772         cpl_array_set_string(columns, c, stetson_columns[c]);
-<a name="l00773"></a>00773     
-<a name="l00774"></a>00774     <span class="keywordflow">return</span> columns;
-<a name="l00775"></a>00775 }
-<a name="l00776"></a>00776 
-<a name="l00777"></a>00777 <span class="preprocessor">#undef cleanup</span>
-<a name="l00778"></a>00778 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00779"></a>00779 <span class="preprocessor">do { \</span>
-<a name="l00780"></a>00780 <span class="preprocessor">    if (err_colnames != NULL) \</span>
-<a name="l00781"></a>00781 <span class="preprocessor">        { cpl_array_delete(*err_colnames); *err_colnames = NULL; } \</span>
-<a name="l00782"></a>00782 <span class="preprocessor">    cat_type_detected = false; \</span>
-<a name="l00783"></a>00783 <span class="preprocessor">} while (0)</span>
-<a name="l00784"></a>00784 <span class="preprocessor"></span>
-<a name="l00799"></a>00799 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00800"></a>00800 fors_std_cat_check_method_and_columns(      cpl_table   *catalogue,
-<a name="l00801"></a>00801                                             cpl_array   *colnames,
-<a name="l00802"></a>00802                                             cpl_error_code  (*import_func)(
-<a name="l00803"></a>00803                                                 <span class="keywordtype">double</span>  *values,
-<a name="l00804"></a>00804                                                 <span class="keywordtype">double</span>  *errors,
-<a name="l00805"></a>00805                                                 <span class="keywordtype">char</span>    band,
-<a name="l00806"></a>00806                                                 <span class="keywordtype">double</span>  *out_A,
-<a name="l00807"></a>00807                                                 <span class="keywordtype">double</span>  *dout_A,
-<a name="l00808"></a>00808                                                 <span class="keywordtype">double</span>  *out_B,
-<a name="l00809"></a>00809                                                 <span class="keywordtype">double</span>  *dout_B,
-<a name="l00810"></a>00810                                                 <span class="keywordtype">double</span>  *out_cov),
-<a name="l00811"></a>00811                                             <span class="keywordtype">char</span>        band,
-<a name="l00812"></a>00812                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *method,
-<a name="l00813"></a>00813                                             cpl_array   **err_colnames,
-<a name="l00814"></a>00814                                             <span class="keywordtype">bool</span>        *method_supports_band)
-<a name="l00815"></a>00815 {
-<a name="l00816"></a>00816     <span class="keywordtype">bool</span>            band_supported = <span class="keyword">false</span>,
-<a name="l00817"></a>00817                     cat_type_detected = <span class="keyword">false</span>;
-<a name="l00818"></a>00818     <span class="keywordtype">int</span>             ncols;
-<a name="l00819"></a>00819     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00820"></a>00820     
-<a name="l00821"></a>00821     cassure_automsg(                        catalogue != NULL,
-<a name="l00822"></a>00822                                             CPL_ERROR_NULL_INPUT,
-<a name="l00823"></a>00823                                             <span class="keywordflow">return</span> cat_type_detected);
-<a name="l00824"></a>00824     cassure_automsg(                        colnames != NULL,
-<a name="l00825"></a>00825                                             CPL_ERROR_NULL_INPUT,
-<a name="l00826"></a>00826                                             <span class="keywordflow">return</span> cat_type_detected);
-<a name="l00827"></a>00827     cassure_automsg(                        cpl_array_get_type(colnames)
-<a name="l00828"></a>00828                                             == CPL_TYPE_STRING,
-<a name="l00829"></a>00829                                             CPL_ERROR_NULL_INPUT,
-<a name="l00830"></a>00830                                             <span class="keywordflow">return</span> cat_type_detected);
-<a name="l00831"></a>00831     cassure_automsg(                        import_func != NULL,
-<a name="l00832"></a>00832                                             CPL_ERROR_NULL_INPUT,
-<a name="l00833"></a>00833                                             <span class="keywordflow">return</span> cat_type_detected);
-<a name="l00834"></a>00834     cassure_automsg(                        method != NULL,
-<a name="l00835"></a>00835                                             CPL_ERROR_NULL_INPUT,
-<a name="l00836"></a>00836                                             <span class="keywordflow">return</span> cat_type_detected);
-<a name="l00837"></a>00837     cassure_automsg(                        err_colnames != NULL,
-<a name="l00838"></a>00838                                             CPL_ERROR_NULL_INPUT,
-<a name="l00839"></a>00839                                             <span class="keywordflow">return</span> cat_type_detected);
-<a name="l00840"></a>00840     
-<a name="l00841"></a>00841     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00842"></a>00842     
-<a name="l00843"></a>00843     ncols = cpl_array_get_size(colnames);
-<a name="l00844"></a>00844     band_supported = fors_std_cat_check_band_support(
-<a name="l00845"></a>00845                                             import_func,
-<a name="l00846"></a>00846                                             ncols,
-<a name="l00847"></a>00847                                             band);
-<a name="l00848"></a>00848     <span class="keywordflow">if</span> (band_supported)
-<a name="l00849"></a>00849     {
-<a name="l00850"></a>00850         <span class="keywordtype">int</span> n;
-<a name="l00851"></a>00851         <span class="comment">/* determine the required values for the import function,</span>
-<a name="l00852"></a>00852 <span class="comment">         * and set other column names to NULL */</span>
-<a name="l00853"></a>00853         fors_std_cat_reject_not_required_columns(
-<a name="l00854"></a>00854                                             colnames,
-<a name="l00855"></a>00855                                             import_func,
-<a name="l00856"></a>00856                                             band);
-<a name="l00857"></a>00857         
-<a name="l00858"></a>00858         <span class="comment">/* for column names != NULL, prepend "ERR_" */</span>
-<a name="l00859"></a>00859         *err_colnames = fors_std_cat_create_error_column_names(colnames);
-<a name="l00860"></a>00860         
-<a name="l00861"></a>00861         <span class="keywordflow">for</span> (n = 0; n < ncols; n++)
-<a name="l00862"></a>00862         {
-<a name="l00863"></a>00863             <span class="keyword">const</span> <span class="keywordtype">char</span>  *s[2];
-<a name="l00864"></a>00864             <span class="keywordtype">int</span>         i;
-<a name="l00865"></a>00865             s[0] = cpl_array_get_string(colnames, n);
-<a name="l00866"></a>00866             s[1] = cpl_array_get_string(*err_colnames, n);
-<a name="l00867"></a>00867             <span class="keywordflow">if</span> (s[0] != NULL)
-<a name="l00868"></a>00868                 <span class="keywordflow">for</span> (i = 0; i < 2; i++)
-<a name="l00869"></a>00869                 {
-<a name="l00870"></a>00870                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Required %s column for band %c: "</span>
-<a name="l00871"></a>00871                                             <span class="stringliteral">"%s (%sfound)"</span>,
-<a name="l00872"></a>00872                                             method, band, s[i],
-<a name="l00873"></a>00873                                             (   cpl_table_has_column(
-<a name="l00874"></a>00874                                                     catalogue, s[i]) ?
-<a name="l00875"></a>00875                                                 <span class="stringliteral">""</span> : <span class="stringliteral">"not "</span>)
-<a name="l00876"></a>00876                                             );
-<a name="l00877"></a>00877                 }
-<a name="l00878"></a>00878         }
-<a name="l00879"></a>00879         
-<a name="l00880"></a>00880         <span class="comment">/* check presence of column names != NULL */</span>
-<a name="l00881"></a>00881         cat_type_detected = (   fors_std_cat_table_check_columns(
-<a name="l00882"></a>00882                                             catalogue,
-<a name="l00883"></a>00883                                             colnames)
-<a name="l00884"></a>00884                                 && fors_std_cat_table_check_columns(
-<a name="l00885"></a>00885                                             catalogue,
-<a name="l00886"></a>00886                                             *err_colnames));
-<a name="l00887"></a>00887     }
-<a name="l00888"></a>00888     <span class="keywordflow">if</span> (method_supports_band != NULL)
-<a name="l00889"></a>00889         *method_supports_band = band_supported;
-<a name="l00890"></a>00890     
-<a name="l00891"></a>00891     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cat_type_detected, NULL);
-<a name="l00892"></a>00892     
-<a name="l00893"></a>00893     <span class="keywordflow">return</span> cat_type_detected;
-<a name="l00894"></a>00894 }
-<a name="l00895"></a>00895 
-<a name="l00896"></a>00896 <span class="preprocessor">#undef cleanup</span>
-<a name="l00897"></a>00897 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00898"></a>00898 <span class="preprocessor">do { \</span>
-<a name="l00899"></a>00899 <span class="preprocessor">    fors_std_star_list_delete(&stdlist, fors_std_star_delete); \</span>
-<a name="l00900"></a>00900 <span class="preprocessor">    fors_std_star_delete(&std_star); \</span>
-<a name="l00901"></a>00901 <span class="preprocessor">    cpl_array_delete(columns); columns = NULL; \</span>
-<a name="l00902"></a>00902 <span class="preprocessor">    cpl_array_delete(err_columns); err_columns = NULL; \</span>
-<a name="l00903"></a>00903 <span class="preprocessor">    cpl_array_delete(frame_error_messages); frame_error_messages = NULL; \</span>
-<a name="l00904"></a>00904 <span class="preprocessor">    cpl_table_delete(cat_table); cat_table = NULL; \</span>
-<a name="l00905"></a>00905 <span class="preprocessor">    cpl_free(band_values); band_values = NULL; \</span>
-<a name="l00906"></a>00906 <span class="preprocessor">    cpl_free(band_errors); band_errors = NULL; \</span>
-<a name="l00907"></a>00907 <span class="preprocessor">} while (0)</span>
-<a name="l00908"></a>00908 <span class="preprocessor"></span>
-<a name="l00915"></a>00915 fors_std_star_list *
-<a name="l00916"></a>00916 fors_std_cat_load(                          <span class="keyword">const</span> cpl_frameset  *cat_frames,
-<a name="l00917"></a>00917                                             <span class="keywordtype">char</span>            band,
-<a name="l00918"></a>00918                                             <span class="keywordtype">bool</span>            require_all_frames,
-<a name="l00919"></a>00919                                             <span class="keywordtype">double</span>          color_term,
-<a name="l00920"></a>00920                                             <span class="keywordtype">double</span>          dcolor_term)
-<a name="l00921"></a>00921 {
-<a name="l00922"></a>00922     fors_std_star_list  *stdlist = NULL;
-<a name="l00923"></a>00923     fors_std_star       *std_star = NULL;
-<a name="l00924"></a>00924     cpl_array           *columns = NULL,
-<a name="l00925"></a>00925                         *err_columns = NULL,
-<a name="l00926"></a>00926                         *frame_error_messages = NULL;
-<a name="l00927"></a>00927     <span class="keywordtype">char</span>                **frame_error_strings = NULL;
-<a name="l00928"></a>00928     cpl_table           *cat_table = NULL;
-<a name="l00929"></a>00929     <span class="keyword">const</span> cpl_frame     *cat_frame;
-<a name="l00930"></a>00930     <span class="keywordtype">double</span>              *band_values = NULL,
-<a name="l00931"></a>00931                         *band_errors = NULL;
-<a name="l00932"></a>00932     <span class="keywordtype">int</span>                 iframe,
-<a name="l00933"></a>00933                         last_imethod = -1,
-<a name="l00934"></a>00934                         n_cat_entries = 0;
-<a name="l00935"></a>00935     <span class="keywordtype">bool</span>                printed_warning = <span class="keyword">false</span>,
-<a name="l00936"></a>00936                         checked_support = <span class="keyword">false</span>,
-<a name="l00937"></a>00937                         printed_supported = <span class="keyword">false</span>;
-<a name="l00938"></a>00938     cpl_errorstate      errstat = cpl_errorstate_get();
-<a name="l00939"></a>00939     
-<a name="l00940"></a>00940     <span class="keyword">struct </span>method {
-<a name="l00941"></a>00941         cpl_array*      (*get_column_names_func)(void);
-<a name="l00942"></a>00942         cpl_error_code  (*star_import_func)(
-<a name="l00943"></a>00943                         <span class="keywordtype">double</span>  *values,
-<a name="l00944"></a>00944                         <span class="keywordtype">double</span>  *errors,
-<a name="l00945"></a>00945                         <span class="keywordtype">char</span>    band,
-<a name="l00946"></a>00946                         <span class="keywordtype">double</span>  *cat_mag,
-<a name="l00947"></a>00947                         <span class="keywordtype">double</span>  *dcat_mag,
-<a name="l00948"></a>00948                         <span class="keywordtype">double</span>  *color,
-<a name="l00949"></a>00949                         <span class="keywordtype">double</span>  *dcolor,
-<a name="l00950"></a>00950                         <span class="keywordtype">double</span>  *cov_catmag_color);
-<a name="l00951"></a>00951         <span class="keyword">const</span> <span class="keywordtype">char</span>      name[10];
-<a name="l00952"></a>00952         <span class="keywordtype">bool</span>            band_supported;
-<a name="l00953"></a>00953     }           methods[2] = {  {   fors_std_cat_landolt_get_column_names,
-<a name="l00954"></a>00954                                     fors_std_cat_landolt_star_import,
-<a name="l00955"></a>00955                                     <span class="stringliteral">"Landolt"</span>,
-<a name="l00956"></a>00956                                     <span class="keyword">false</span>},
-<a name="l00957"></a>00957                                 {   fors_std_cat_stetson_get_column_names,
-<a name="l00958"></a>00958                                     fors_std_cat_stetson_star_import,
-<a name="l00959"></a>00959                                     <span class="stringliteral">"Stetson"</span>,
-<a name="l00960"></a>00960                                     <span class="keyword">false</span>}
-<a name="l00961"></a>00961                         };
-<a name="l00962"></a>00962     
-<a name="l00963"></a>00963     <span class="comment">/* check input */</span>
-<a name="l00964"></a>00964     cassure_automsg(                        cat_frames != NULL,
-<a name="l00965"></a>00965                                             CPL_ERROR_NULL_INPUT,
-<a name="l00966"></a>00966                                             <span class="keywordflow">return</span> stdlist);
-<a name="l00967"></a>00967     
-<a name="l00968"></a>00968     cassure(                                !fors_instrument_filterband_is_none(
-<a name="l00969"></a>00969                                                 band),
-<a name="l00970"></a>00970                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00971"></a>00971                                             <span class="keywordflow">return</span> stdlist,
-<a name="l00972"></a>00972                                             <span class="stringliteral">"no optical/filter band specified"</span>);
-<a name="l00973"></a>00973     cassure(                             !fors_instrument_filterband_is_unknown(
-<a name="l00974"></a>00974                                                 band),
-<a name="l00975"></a>00975                                             CPL_ERROR_ILLEGAL_INPUT,
-<a name="l00976"></a>00976                                             <span class="keywordflow">return</span> stdlist,
-<a name="l00977"></a>00977                                             <span class="stringliteral">"optical/filter band is unknown"</span>);
-<a name="l00978"></a>00978     
-<a name="l00979"></a>00979     stdlist = fors_std_star_list_new();
-<a name="l00980"></a>00980     <span class="comment">/* error message container, don't abuse the error history for that since</span>
-<a name="l00981"></a>00981 <span class="comment">     * its size is limited */</span>
-<a name="l00982"></a>00982     frame_error_messages = cpl_array_new(   cpl_frameset_get_size(cat_frames),
-<a name="l00983"></a>00983                                             CPL_TYPE_STRING);
-<a name="l00984"></a>00984     frame_error_strings = cpl_array_get_data_string(frame_error_messages);
-<a name="l00985"></a>00985     
-<a name="l00986"></a>00986     <span class="comment">/* import all frames */</span>
-<a name="l00987"></a>00987     <span class="keywordflow">for</span> (cat_frame = cpl_frameset_get_first_const(cat_frames), iframe = 0;
-<a name="l00988"></a>00988          cat_frame != NULL;
-<a name="l00989"></a>00989          cat_frame = cpl_frameset_get_next_const(cat_frames), iframe++)
-<a name="l00990"></a>00990     {
-<a name="l00991"></a>00991         <span class="keywordtype">int</span>         ncolumns,
-<a name="l00992"></a>00992                     row,
-<a name="l00993"></a>00993                     nrows,
-<a name="l00994"></a>00994                     imethod,
-<a name="l00995"></a>00995                     nmethods;
-<a name="l00996"></a>00996         <span class="keyword">const</span> <span class="keywordtype">char</span>  **column_value_names,
-<a name="l00997"></a>00997                     **column_error_names;
-<a name="l00998"></a>00998         <span class="keyword">const</span> <span class="keywordtype">char</span>  *filename;
-<a name="l00999"></a>00999         <span class="keywordtype">bool</span>        cat_type_detected = <span class="keyword">false</span>;
-<a name="l01000"></a>01000         
-<a name="l01001"></a>01001         filename = cpl_frame_get_filename(cat_frame);
-<a name="l01002"></a>01002         cassure(                            filename != NULL,
-<a name="l01003"></a>01003                                             CPL_ERROR_NULL_INPUT,
-<a name="l01004"></a>01004                                             <span class="keywordflow">return</span> stdlist,
-<a name="l01005"></a>01005                                             <span class="stringliteral">"filename of frame %d is NULL"</span>,
-<a name="l01006"></a>01006                                             iframe);
-<a name="l01007"></a>01007 
-<a name="l01008"></a>01008         cpl_table_delete(cat_table);
-<a name="l01009"></a>01009         cat_table = cpl_table_load(filename, 1, 1);
-<a name="l01010"></a>01010         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))
-<a name="l01011"></a>01011         {
-<a name="l01012"></a>01012             frame_error_strings[iframe] = cpl_sprintf(
-<a name="l01013"></a>01013                                             <span class="stringliteral">"could not load FITS table"</span>);
-<a name="l01014"></a>01014             <span class="keywordflow">if</span> (require_all_frames)
-<a name="l01015"></a>01015             {
-<a name="l01016"></a>01016                 cassure(                    0,
-<a name="l01017"></a>01017                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01018"></a>01018                                             <span class="keywordflow">return</span> stdlist,
-<a name="l01019"></a>01019                                             <span class="stringliteral">"%s: %s"</span>,
-<a name="l01020"></a>01020                                             filename,
-<a name="l01021"></a>01021                                             frame_error_strings[iframe]);
-<a name="l01022"></a>01022             }
-<a name="l01023"></a>01023             <span class="keywordflow">else</span>
-<a name="l01024"></a>01024             {
-<a name="l01025"></a>01025                 <span class="comment">/* reset last error */</span>
-<a name="l01026"></a>01026                 cpl_errorstate_set(errstat);
-<a name="l01027"></a>01027                 cpl_msg_warning(            cpl_func, <span class="stringliteral">"Skipping %s (%s)"</span>,
-<a name="l01028"></a>01028                                             filename,
-<a name="l01029"></a>01029                                             frame_error_strings[iframe]);
-<a name="l01030"></a>01030                 <span class="keywordflow">continue</span>;   <span class="comment">/* skip this frame */</span>
-<a name="l01031"></a>01031             }
-<a name="l01032"></a>01032         }
-<a name="l01033"></a>01033         
-<a name="l01034"></a>01034         <span class="comment">/* determine the type of the catalogue, and</span>
-<a name="l01035"></a>01035 <span class="comment">         * accordingly get the names of the required columns.</span>
-<a name="l01036"></a>01036 <span class="comment">         * For the import functions, we keep the array with the correct</span>
-<a name="l01037"></a>01037 <span class="comment">         * order of the input column names, but we just invalidate the</span>
-<a name="l01038"></a>01038 <span class="comment">         * non-required column names. */</span>
-<a name="l01039"></a>01039         nmethods = <span class="keyword">sizeof</span>(methods)/<span class="keyword">sizeof</span>(*methods);
-<a name="l01040"></a>01040         <span class="keywordflow">for</span> (imethod = 0; imethod < nmethods; imethod++)
-<a name="l01041"></a>01041         {
-<a name="l01042"></a>01042             cpl_array_delete(columns);
-<a name="l01043"></a>01043             columns = methods[imethod].get_column_names_func();
-<a name="l01044"></a>01044             
-<a name="l01045"></a>01045             cat_type_detected = fors_std_cat_check_method_and_columns(
-<a name="l01046"></a>01046                                             cat_table,
-<a name="l01047"></a>01047                                             columns,    <span class="comment">/* is modified */</span>
-<a name="l01048"></a>01048                                             methods[imethod].star_import_func,
-<a name="l01049"></a>01049                                             band,
-<a name="l01050"></a>01050                                             methods[imethod].name,
-<a name="l01051"></a>01051                                             &err_columns,
-<a name="l01052"></a>01052                                             &(methods[imethod].band_supported));
-<a name="l01053"></a>01053             passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> stdlist);
-<a name="l01054"></a>01054             <span class="keywordflow">if</span> (cat_type_detected)
-<a name="l01055"></a>01055                 <span class="keywordflow">break</span>;
-<a name="l01056"></a>01056         }
-<a name="l01057"></a>01057         <span class="keywordflow">if</span> (!cat_type_detected)
-<a name="l01058"></a>01058         {
-<a name="l01059"></a>01059             <span class="keywordflow">if</span> (!checked_support)   <span class="comment">/* FIXME: this should be checked in another</span>
-<a name="l01060"></a>01060 <span class="comment">                                       function, called before looping over</span>
-<a name="l01061"></a>01061 <span class="comment">                                       frames */</span>
-<a name="l01062"></a>01062             {
-<a name="l01063"></a>01063                 <span class="keywordtype">bool</span> band_generally_supported = <span class="keyword">false</span>;
-<a name="l01064"></a>01064                 <span class="keywordflow">for</span> (imethod = 0; imethod < nmethods; imethod++)
-<a name="l01065"></a>01065                 {
-<a name="l01066"></a>01066                     band_generally_supported |= methods[imethod].band_supported;
-<a name="l01067"></a>01067                 }
-<a name="l01068"></a>01068                 <span class="keywordflow">if</span> (!band_generally_supported)
-<a name="l01069"></a>01069                 {
-<a name="l01070"></a>01070                     cpl_error_set_message(  cpl_func,
-<a name="l01071"></a>01071                                             CPL_ERROR_UNSUPPORTED_MODE,
-<a name="l01072"></a>01072                                             <span class="stringliteral">"Optical band %c not supported"</span>,
-<a name="l01073"></a>01073                                             band);
-<a name="l01074"></a>01074                     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01075"></a>01075                     <span class="keywordflow">return</span> stdlist;
-<a name="l01076"></a>01076                 }
-<a name="l01077"></a>01077                 checked_support = <span class="keyword">true</span>;
-<a name="l01078"></a>01078             }
-<a name="l01079"></a>01079             
-<a name="l01080"></a>01080             <span class="comment">/* create an error message for this frame */</span>
-<a name="l01081"></a>01081             <span class="keywordflow">if</span> (!printed_supported)
-<a name="l01082"></a>01082             {
-<a name="l01083"></a>01083                 <span class="keywordtype">char</span>    *supported_methods = NULL;
-<a name="l01084"></a>01084                 <span class="keywordflow">for</span> (imethod = 0; imethod < nmethods; imethod++)
-<a name="l01085"></a>01085                 {
-<a name="l01086"></a>01086                     <span class="keywordflow">if</span> (methods[imethod].band_supported)
-<a name="l01087"></a>01087                     {
-<a name="l01088"></a>01088                         <span class="keywordflow">if</span> (supported_methods == NULL)
-<a name="l01089"></a>01089                         {
-<a name="l01090"></a>01090                             supported_methods = cpl_sprintf(
-<a name="l01091"></a>01091                                             <span class="stringliteral">"%s"</span>,
-<a name="l01092"></a>01092                                             methods[imethod].name);
-<a name="l01093"></a>01093                         }
-<a name="l01094"></a>01094                         <span class="keywordflow">else</span>    <span class="comment">/* strcat... */</span>
-<a name="l01095"></a>01095                         {
-<a name="l01096"></a>01096                             <span class="keywordtype">char</span>    *s;
-<a name="l01097"></a>01097                             s = cpl_sprintf(<span class="stringliteral">"%s, %s"</span>,
-<a name="l01098"></a>01098                                             supported_methods,
-<a name="l01099"></a>01099                                             methods[imethod].name);
-<a name="l01100"></a>01100                             cpl_free(supported_methods);
-<a name="l01101"></a>01101                             supported_methods = s;
-<a name="l01102"></a>01102                         }
-<a name="l01103"></a>01103                     }
-<a name="l01104"></a>01104                 }
-<a name="l01105"></a>01105                 cpl_msg_warning(            cpl_func,
-<a name="l01106"></a>01106                                             <span class="stringliteral">"Import of band %c supported for: "</span>
-<a name="l01107"></a>01107                                             <span class="stringliteral">"%s"</span>,
-<a name="l01108"></a>01108                                             band,
-<a name="l01109"></a>01109                                             supported_methods);
-<a name="l01110"></a>01110                 cpl_free(supported_methods);
-<a name="l01111"></a>01111                 printed_supported = <span class="keyword">true</span>;
-<a name="l01112"></a>01112             }
-<a name="l01113"></a>01113             
-<a name="l01114"></a>01114             frame_error_strings[iframe] = cpl_sprintf(
-<a name="l01115"></a>01115                                             <span class="stringliteral">"no cat. data for band %c found"</span>,
-<a name="l01116"></a>01116                                             band);
-<a name="l01117"></a>01117             <span class="keywordflow">if</span> (require_all_frames)
-<a name="l01118"></a>01118             {
-<a name="l01119"></a>01119                 cpl_error_set_message(      cpl_func,
-<a name="l01120"></a>01120                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01121"></a>01121                                             <span class="stringliteral">"%s: %s"</span>,
-<a name="l01122"></a>01122                                             filename,
-<a name="l01123"></a>01123                                             frame_error_strings[iframe]);
-<a name="l01124"></a>01124                 <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01125"></a>01125                 <span class="keywordflow">return</span> stdlist;
-<a name="l01126"></a>01126             }
-<a name="l01127"></a>01127             <span class="keywordflow">else</span>
-<a name="l01128"></a>01128             {
-<a name="l01129"></a>01129                 cpl_msg_warning(            cpl_func, <span class="stringliteral">"Skipping %s (%s)"</span>,
-<a name="l01130"></a>01130                                             filename,
-<a name="l01131"></a>01131                                             frame_error_strings[iframe]);
-<a name="l01132"></a>01132                 <span class="keywordflow">continue</span>;   <span class="comment">/* skip this frame */</span>
-<a name="l01133"></a>01133             }
-<a name="l01134"></a>01134         }
-<a name="l01135"></a>01135         <span class="keywordflow">else</span>
-<a name="l01136"></a>01136         {
-<a name="l01137"></a>01137             cpl_msg_info(                   cpl_func,
-<a name="l01138"></a>01138                                             <span class="stringliteral">"Loading %s catalogue from %s"</span>,
-<a name="l01139"></a>01139                                             methods[imethod].name,
-<a name="l01140"></a>01140                                             filename);
-<a name="l01141"></a>01141         }
-<a name="l01142"></a>01142         <span class="keywordflow">if</span> (last_imethod >= 0 && last_imethod != imethod && !printed_warning)
-<a name="l01143"></a>01143         {
-<a name="l01144"></a>01144             cpl_msg_warning(                cpl_func,
-<a name="l01145"></a>01145                                             <span class="stringliteral">"Merging different types of "</span>
-<a name="l01146"></a>01146                                             <span class="stringliteral">"catalogues"</span>);
-<a name="l01147"></a>01147             printed_warning = <span class="keyword">true</span>;
-<a name="l01148"></a>01148         }
-<a name="l01149"></a>01149         last_imethod = imethod;
-<a name="l01150"></a>01150         
-<a name="l01151"></a>01151         <span class="comment">/* prepare the actual import of catalogue values */</span>
-<a name="l01152"></a>01152         ncolumns = cpl_array_get_size(columns);
-<a name="l01153"></a>01153         
-<a name="l01154"></a>01154         cpl_free(band_values);
-<a name="l01155"></a>01155         band_values = cpl_calloc(ncolumns, <span class="keyword">sizeof</span>(*band_values));
-<a name="l01156"></a>01156         cpl_free(band_errors);
-<a name="l01157"></a>01157         band_errors = cpl_calloc(ncolumns, <span class="keyword">sizeof</span>(*band_errors));
-<a name="l01158"></a>01158         
-<a name="l01159"></a>01159         column_value_names = cpl_array_get_data_string_const(columns);
-<a name="l01160"></a>01160         column_error_names = cpl_array_get_data_string_const(err_columns);
-<a name="l01161"></a>01161         passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> stdlist);
-<a name="l01162"></a>01162         
-<a name="l01163"></a>01163         <span class="comment">/* done with preparation, import stars from table rows */</span>
-<a name="l01164"></a>01164         nrows = cpl_table_get_nrow(cat_table);
-<a name="l01165"></a>01165         n_cat_entries += nrows;
-<a name="l01166"></a>01166         <span class="keywordflow">for</span> (row = 0; row < nrows; row++)
-<a name="l01167"></a>01167         {
-<a name="l01168"></a>01168             <span class="keywordtype">int</span>     ib,
-<a name="l01169"></a>01169                     isnull;
-<a name="l01170"></a>01170             <span class="keywordtype">bool</span>    valid;
-<a name="l01171"></a>01171             
-<a name="l01172"></a>01172             <span class="comment">/* read all required values from table, ignore others to:</span>
-<a name="l01173"></a>01173 <span class="comment">             * a) save time, and</span>
-<a name="l01174"></a>01174 <span class="comment">             * b) use stars that were observed in the required bands but not</span>
-<a name="l01175"></a>01175 <span class="comment">             *    in others */</span>
-<a name="l01176"></a>01176             valid = <span class="keyword">true</span>;
-<a name="l01177"></a>01177             <span class="keywordflow">for</span> (ib = 0; ib < ncolumns; ib++)
-<a name="l01178"></a>01178             {
-<a name="l01179"></a>01179                 <span class="keywordflow">if</span> (column_value_names[ib] != NULL) <span class="comment">/* if required */</span>
-<a name="l01180"></a>01180                 {
-<a name="l01181"></a>01181                     band_values[ib] = cpl_table_get(
-<a name="l01182"></a>01182                                             cat_table,
-<a name="l01183"></a>01183                                             column_value_names[ib],
-<a name="l01184"></a>01184                                             row,
-<a name="l01185"></a>01185                                             &isnull);
-<a name="l01186"></a>01186                     valid &= (isnull == 0);
-<a name="l01187"></a>01187                     
-<a name="l01188"></a>01188                     passure(column_error_names[ib] != NULL, <span class="keywordflow">return</span> stdlist);
-<a name="l01189"></a>01189                     band_errors[ib] = cpl_table_get(
-<a name="l01190"></a>01190                                             cat_table,
-<a name="l01191"></a>01191                                             column_error_names[ib],
-<a name="l01192"></a>01192                                             row,
-<a name="l01193"></a>01193                                             &isnull);
-<a name="l01194"></a>01194                     valid &= (isnull == 0);
-<a name="l01195"></a>01195                 }
-<a name="l01196"></a>01196             }
-<a name="l01197"></a>01197             
-<a name="l01198"></a>01198             <span class="keywordflow">if</span> (!valid)
-<a name="l01199"></a>01199                 <span class="keywordflow">continue</span>;
-<a name="l01200"></a>01200             
-<a name="l01201"></a>01201             std_star = fors_std_star_new_from_table(
-<a name="l01202"></a>01202                                             cat_table,
-<a name="l01203"></a>01203                                             row,
-<a name="l01204"></a>01204                                             FORS_STD_CAT_COLUMN_RA,
-<a name="l01205"></a>01205                                             FORS_STD_CAT_COLUMN_DEC,
-<a name="l01206"></a>01206                                             NULL, NULL, <span class="comment">/* corrected mag */</span>
-<a name="l01207"></a>01207                                             NULL, NULL, <span class="comment">/* catalogue mag */</span>
-<a name="l01208"></a>01208                                             NULL, NULL, <span class="comment">/* color */</span>
-<a name="l01209"></a>01209                                             NULL,       <span class="comment">/* covariance */</span>
-<a name="l01210"></a>01210                                             NULL, NULL, <span class="comment">/* x, y */</span>
-<a name="l01211"></a>01211                                             FORS_STD_CAT_COLUMN_NAME);
-<a name="l01212"></a>01212             <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                         std_star != NULL,
-<a name="l01213"></a>01213                                             <span class="keywordflow">return</span> stdlist,
-<a name="l01214"></a>01214                                             NULL);
-<a name="l01215"></a>01215             
-<a name="l01216"></a>01216             methods[imethod].star_import_func(
-<a name="l01217"></a>01217                                             band_values,
-<a name="l01218"></a>01218                                             band_errors,
-<a name="l01219"></a>01219                                             band,
-<a name="l01220"></a>01220                                             &(std_star->cat_magnitude),
-<a name="l01221"></a>01221                                             &(std_star->dcat_magnitude),
-<a name="l01222"></a>01222                                             &(std_star->color),
-<a name="l01223"></a>01223                                             &(std_star->dcolor),
-<a name="l01224"></a>01224                                             &(std_star->cov_catm_color));
-<a name="l01225"></a>01225             <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                         cpl_errorstate_is_equal(errstat),
-<a name="l01226"></a>01226                                             <span class="keywordflow">return</span> stdlist,
-<a name="l01227"></a>01227                                             NULL);
-<a name="l01228"></a>01228             
-<a name="l01229"></a>01229             fors_std_star_compute_corrected_mag(
-<a name="l01230"></a>01230                                             std_star,
-<a name="l01231"></a>01231                                             color_term,
-<a name="l01232"></a>01232                                             dcolor_term);
-<a name="l01233"></a>01233             
-<a name="l01234"></a>01234             fors_std_star_list_insert(stdlist, std_star);
-<a name="l01235"></a>01235             std_star = NULL;
-<a name="l01236"></a>01236         }
-<a name="l01237"></a>01237     }
-<a name="l01238"></a>01238     
-<a name="l01239"></a>01239     <span class="keywordflow">if</span> (!require_all_frames)
-<a name="l01240"></a>01240     {
-<a name="l01241"></a>01241         cassure(                            cpl_array_has_invalid(
-<a name="l01242"></a>01242                                                 frame_error_messages),
-<a name="l01243"></a>01243                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01244"></a>01244                                             <span class="keywordflow">return</span> stdlist,
-<a name="l01245"></a>01245                                             <span class="stringliteral">"No valid catalogue frame found"</span>);
-<a name="l01246"></a>01246     }
-<a name="l01247"></a>01247     
-<a name="l01248"></a>01248     <span class="comment">/* Fixing the fact that the list object supports no "append" */</span>
-<a name="l01249"></a>01249     <span class="comment">/*fors_std_star_list_reverse(stdlist);*/</span>
-<a name="l01250"></a>01250     
-<a name="l01251"></a>01251     cpl_msg_info(                           cpl_func,
-<a name="l01252"></a>01252                                             <span class="stringliteral">"Found %d catalogue standard stars "</span>
-<a name="l01253"></a>01253                                             <span class="stringliteral">"for band %c (of %d catalogue "</span>
-<a name="l01254"></a>01254                                             <span class="stringliteral">"entries)"</span>,
-<a name="l01255"></a>01255                                             fors_std_star_list_size(stdlist),
-<a name="l01256"></a>01256                                             band,
-<a name="l01257"></a>01257                                             n_cat_entries);
-<a name="l01258"></a>01258     
-<a name="l01259"></a>01259     fors_std_star_list  *retval = stdlist;
-<a name="l01260"></a>01260     stdlist = NULL;
-<a name="l01261"></a>01261     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01262"></a>01262     <span class="keywordflow">return</span> retval;
-<a name="l01263"></a>01263 }
-<a name="l01264"></a>01264 
-<a name="l01265"></a>01265 <span class="comment">/*#undef cleanup</span>
-<a name="l01266"></a>01266 <span class="comment">#define cleanup \</span>
-<a name="l01267"></a>01267 <span class="comment">do { \</span>
-<a name="l01268"></a>01268 <span class="comment">    cpl_array_delete(stetson_columns); stetson_columns = NULL; \</span>
-<a name="l01269"></a>01269 <span class="comment">    cpl_frame_delete(cat_frame); cat_frame = NULL; \</span>
-<a name="l01270"></a>01270 <span class="comment">} while (0)</span>
-<a name="l01271"></a>01271 <span class="comment">*/</span>
-<a name="l01278"></a>01278 <span class="comment">/*cpl_frame   *</span>
-<a name="l01279"></a>01279 <span class="comment">fors_std_cat_test_create_stetson_format(    const fors_std_star_list    *stdl,</span>
-<a name="l01280"></a>01280 <span class="comment">                                            char                        band)</span>
-<a name="l01281"></a>01281 <span class="comment">{</span>
-<a name="l01282"></a>01282 <span class="comment">    cpl_array       *stetson_columns = NULL;</span>
-<a name="l01283"></a>01283 <span class="comment">    cpl_frame       *cat_frame = NULL;</span>
-<a name="l01284"></a>01284 <span class="comment">    cpl_errorstate  errstat = cpl_errorstate_get();</span>
-<a name="l01285"></a>01285 <span class="comment">    </span>
-<a name="l01286"></a>01286 <span class="comment">    stetson_columns = fors_std_cat_stetson_get_column_names();</span>
-<a name="l01287"></a>01287 <span class="comment">    assure(cpl_errorstate_is_equal(errstat), return cat_frame, NULL);</span>
-<a name="l01288"></a>01288 <span class="comment">    fors_std_cat_reject_not_required_columns(</span>
-<a name="l01289"></a>01289 <span class="comment">                                            stetson_columns,</span>
-<a name="l01290"></a>01290 <span class="comment">                                            fors_std_cat_stetson_star_import,</span>
-<a name="l01291"></a>01291 <span class="comment">                                            band);</span>
-<a name="l01292"></a>01292 <span class="comment">    assure(cpl_errorstate_is_equal(errstat), return cat_frame, NULL);</span>
-<a name="l01293"></a>01293 <span class="comment">    ...</span>
-<a name="l01294"></a>01294 <span class="comment">    </span>
-<a name="l01295"></a>01295 <span class="comment">}*/</span>
-<a name="l01296"></a>01296 
-<a name="l01297"></a>01297 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01298"></a>01298 <span class="comment">/* old deprecated code, kept for safety */</span>
-<a name="l01299"></a>01299 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l01300"></a>01300 
-<a name="l01301"></a>01301 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_MAG[FORS_NUM_FILTER] =
-<a name="l01302"></a>01302 {<span class="stringliteral">"U"</span>,
-<a name="l01303"></a>01303  <span class="stringliteral">"B"</span>,
-<a name="l01304"></a>01304  <span class="comment">//"G",</span>
-<a name="l01305"></a>01305  <span class="stringliteral">"V"</span>,  <span class="comment">/* G uses V */</span>
-<a name="l01306"></a>01306  <span class="stringliteral">"V"</span>,
-<a name="l01307"></a>01307  <span class="stringliteral">"R"</span>,
-<a name="l01308"></a>01308  <span class="stringliteral">"I"</span>,
-<a name="l01309"></a>01309  <span class="stringliteral">"Z"</span>};
-<a name="l01310"></a>01310 
-<a name="l01311"></a>01311 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_DMAG[FORS_NUM_FILTER] =
-<a name="l01312"></a>01312 {<span class="stringliteral">"ERR_U"</span>,
-<a name="l01313"></a>01313  <span class="stringliteral">"ERR_B"</span>,
-<a name="l01314"></a>01314  <span class="comment">//"ERR_G",</span>
-<a name="l01315"></a>01315  <span class="stringliteral">"ERR_V"</span>, <span class="comment">/* G uses V */</span>
-<a name="l01316"></a>01316  <span class="stringliteral">"ERR_V"</span>,
-<a name="l01317"></a>01317  <span class="stringliteral">"ERR_R"</span>,
-<a name="l01318"></a>01318  <span class="stringliteral">"ERR_I"</span>,
-<a name="l01319"></a>01319  <span class="stringliteral">"ERR_Z"</span>};
-<a name="l01320"></a>01320 
-<a name="l01321"></a>01321 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_COL[FORS_NUM_FILTER] = 
-<a name="l01322"></a>01322 {<span class="stringliteral">"U_B"</span>,
-<a name="l01323"></a>01323  <span class="stringliteral">"B_V"</span>,
-<a name="l01324"></a>01324  <span class="stringliteral">"B_V"</span>,
-<a name="l01325"></a>01325  <span class="stringliteral">"B_V"</span>,
-<a name="l01326"></a>01326  <span class="stringliteral">"V_R"</span>,
-<a name="l01327"></a>01327  <span class="stringliteral">"V_R"</span>,
-<a name="l01328"></a>01328  <span class="stringliteral">"?Z?"</span>};
-<a name="l01329"></a>01329 
-<a name="l01330"></a>01330 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_RA   = <span class="stringliteral">"RA"</span>;
-<a name="l01331"></a>01331 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_DEC  = <span class="stringliteral">"DEC"</span>;
-<a name="l01332"></a>01332 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_NAME = <span class="stringliteral">"OBJECT"</span>;
-<a name="l01333"></a>01333 
-<a name="l01334"></a>01334 <span class="preprocessor">#undef cleanup</span>
-<a name="l01335"></a>01335 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01336"></a>01336 <span class="preprocessor">do { \</span>
-<a name="l01337"></a>01337 <span class="preprocessor">    cpl_table_delete(t); \</span>
-<a name="l01338"></a>01338 <span class="preprocessor">    cpl_free((void *)ERR_B1); \</span>
-<a name="l01339"></a>01339 <span class="preprocessor">    cpl_free((void *)ERR_C1); \</span>
-<a name="l01340"></a>01340 <span class="preprocessor">    cpl_free((void *)ERR_C2); \</span>
-<a name="l01341"></a>01341 <span class="preprocessor">} while(0)</span>
-<a name="l01342"></a>01342 <span class="preprocessor"></span>
-<a name="l01354"></a>01354 fors_std_star_list *
-<a name="l01355"></a>01355 fors_std_cat_load_old(<span class="keyword">const</span> cpl_frameset *cat_frames,
-<a name="l01356"></a>01356                   <span class="comment">/*const fors_setting *setting,*/</span>
-<a name="l01357"></a>01357                   <span class="keywordtype">char</span>  optical_band,
-<a name="l01358"></a>01358                   <span class="keywordtype">double</span> color_term, <span class="keywordtype">double</span> dcolor_term)
-<a name="l01359"></a>01359 {
-<a name="l01360"></a>01360     fors_std_star_list *c = NULL;
-<a name="l01361"></a>01361     cpl_table *t = NULL;
-<a name="l01362"></a>01362     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename;
-<a name="l01363"></a>01363     <span class="keyword">const</span> <span class="keywordtype">char</span> *ERR_B1 = NULL;
-<a name="l01364"></a>01364     <span class="keyword">const</span> <span class="keywordtype">char</span> *ERR_C1 = NULL;
-<a name="l01365"></a>01365     <span class="keyword">const</span> <span class="keywordtype">char</span> *ERR_C2 = NULL;
-<a name="l01366"></a>01366 
-<a name="l01367"></a>01367     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cat_frames != NULL, <span class="keywordflow">return</span> c, NULL );
-<a name="l01368"></a>01368     <span class="comment">/*assure( setting != NULL, return c, NULL );*/</span>
-<a name="l01369"></a>01369 
-<a name="l01370"></a>01370     <span class="comment">/* For each input table</span>
-<a name="l01371"></a>01371 <span class="comment">           if it contains the required column, then load </span>
-<a name="l01372"></a>01372 <span class="comment">    */</span>
-<a name="l01373"></a>01373     c = fors_std_star_list_new();
-<a name="l01374"></a>01374 
-<a name="l01375"></a>01375     <span class="keyword">const</span> cpl_frame *cat_frame;
-<a name="l01376"></a>01376 
-<a name="l01377"></a>01377     <span class="keywordflow">for</span> (cat_frame = cpl_frameset_get_first_const(cat_frames);
-<a name="l01378"></a>01378          cat_frame != NULL;
-<a name="l01379"></a>01379          cat_frame = cpl_frameset_get_next_const(cat_frames)) {
-<a name="l01380"></a>01380         
-<a name="l01381"></a>01381         
-<a name="l01382"></a>01382         filename = cpl_frame_get_filename(cat_frame);
-<a name="l01383"></a>01383         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( filename != NULL, <span class="keywordflow">return</span> c, NULL );
-<a name="l01384"></a>01384 
-<a name="l01385"></a>01385         cpl_table_delete(t);
-<a name="l01386"></a>01386         t = cpl_table_load(filename, 1, 1);
-<a name="l01387"></a>01387         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> c, <span class="stringliteral">"Could not load FITS catalogue %s"</span>,
-<a name="l01388"></a>01388                 filename);
-<a name="l01389"></a>01389         
-<a name="l01390"></a>01390         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(t, FORS_DATA_STD_RA), <span class="keywordflow">return</span> c, 
-<a name="l01391"></a>01391                 <span class="stringliteral">"%s: Missing column %s"</span>, filename, FORS_DATA_STD_RA);
-<a name="l01392"></a>01392         
-<a name="l01393"></a>01393         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_get_column_type(t, FORS_DATA_STD_RA) == CPL_TYPE_DOUBLE, 
-<a name="l01394"></a>01394                 <span class="keywordflow">return</span> c,
-<a name="l01395"></a>01395                 <span class="stringliteral">"%s: Column %s type is %s, double expected"</span>, filename, FORS_DATA_STD_RA,
-<a name="l01396"></a>01396                 <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(cpl_table_get_column_type(t, FORS_DATA_STD_RA)));
-<a name="l01397"></a>01397         
-<a name="l01398"></a>01398         
-<a name="l01399"></a>01399         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(t, FORS_DATA_STD_DEC), <span class="keywordflow">return</span> c, 
-<a name="l01400"></a>01400                 <span class="stringliteral">"%s: Missing column %s"</span>, filename, FORS_DATA_STD_DEC);
-<a name="l01401"></a>01401         
-<a name="l01402"></a>01402         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_get_column_type(t, FORS_DATA_STD_DEC) == CPL_TYPE_DOUBLE, 
-<a name="l01403"></a>01403                 <span class="keywordflow">return</span> c, 
-<a name="l01404"></a>01404                 <span class="stringliteral">"%s: Column %s type is %s, double expected"</span>, filename, FORS_DATA_STD_DEC,
-<a name="l01405"></a>01405                 <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(cpl_table_get_column_type(t, FORS_DATA_STD_DEC)));
-<a name="l01406"></a>01406 
-<a name="l01407"></a>01407 
-<a name="l01408"></a>01408         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_has_column(t, FORS_DATA_STD_NAME), <span class="keywordflow">return</span> c, 
-<a name="l01409"></a>01409                 <span class="stringliteral">"%s: Missing column %s"</span>, filename, FORS_DATA_STD_NAME);
-<a name="l01410"></a>01410         
-<a name="l01411"></a>01411         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_table_get_column_type(t, FORS_DATA_STD_NAME) == CPL_TYPE_STRING, 
-<a name="l01412"></a>01412                 <span class="keywordflow">return</span> c,
-<a name="l01413"></a>01413                 <span class="stringliteral">"%s: Column %s type is %s, string expected"</span>, filename, 
-<a name="l01414"></a>01414                 FORS_DATA_STD_NAME,
-<a name="l01415"></a>01415                 <a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(cpl_table_get_column_type(t, FORS_DATA_STD_NAME)));
-<a name="l01416"></a>01416         
-<a name="l01417"></a>01417 
-<a name="l01418"></a>01418         <span class="comment">/*const char *B1 = FORS_DATA_STD_MAG[setting->filter];</span>
-<a name="l01419"></a>01419 <span class="comment">        assure( B1 != NULL, return c, NULL );*/</span>
-<a name="l01420"></a>01420         <span class="keywordtype">char</span> B1[2] = {<span class="charliteral">'\0'</span>, <span class="charliteral">'\0'</span>};
-<a name="l01421"></a>01421         <span class="comment">/* *B1 = fors_instrument_filterband_get_by_setting(setting);*/</span>
-<a name="l01422"></a>01422         *B1 = optical_band;
-<a name="l01423"></a>01423         
-<a name="l01424"></a>01424         <span class="keywordflow">if</span> ( cpl_table_has_column(t, B1) ) {
-<a name="l01425"></a>01425             
-<a name="l01426"></a>01426             <span class="comment">/* </span>
-<a name="l01427"></a>01427 <span class="comment">                The error propagation depends on which</span>
-<a name="l01428"></a>01428 <span class="comment">                error bars are available, which are assumed to be</span>
-<a name="l01429"></a>01429 <span class="comment">                uncorrelated</span>
-<a name="l01430"></a>01430 <span class="comment"></span>
-<a name="l01431"></a>01431 <span class="comment">                Pseudo code:</span>
-<a name="l01432"></a>01432 <span class="comment"></span>
-<a name="l01433"></a>01433 <span class="comment">                given band B1 and color term C1-C2</span>
-<a name="l01434"></a>01434 <span class="comment"></span>
-<a name="l01435"></a>01435 <span class="comment">                If have ERR_B1 and ERR_C1 and ERR_C2</span>
-<a name="l01436"></a>01436 <span class="comment">                    // Stetson like</span>
-<a name="l01437"></a>01437 <span class="comment">                    B1   + c(C1 - B1)      =  (1-c)B1  + c C1</span>
-<a name="l01438"></a>01438 <span class="comment">                   (1-c)^2errB1^2 + c^2 errC1^2</span>
-<a name="l01439"></a>01439 <span class="comment">                    +errc^2 * (C1-B1)^2</span>
-<a name="l01440"></a>01440 <span class="comment"></span>
-<a name="l01441"></a>01441 <span class="comment">                    B1   + c(B1 - C2)      =  (1+c)B1  - c C2     </span>
-<a name="l01442"></a>01442 <span class="comment"></span>
-<a name="l01443"></a>01443 <span class="comment">                   (1+c)^2errB1^2 + c^2 errC2^2</span>
-<a name="l01444"></a>01444 <span class="comment">                    +errc^2 (B1-C2)^2</span>
-<a name="l01445"></a>01445 <span class="comment"></span>
-<a name="l01446"></a>01446 <span class="comment">                    B1   + c(C1 - C2)</span>
-<a name="l01447"></a>01447 <span class="comment">                    errB1^2 + c^2 errC1^2 + c^2 errC2^2</span>
-<a name="l01448"></a>01448 <span class="comment">                    +errc^2 (C1-C2)^2</span>
-<a name="l01449"></a>01449 <span class="comment"></span>
-<a name="l01450"></a>01450 <span class="comment">                    Special case:</span>
-<a name="l01451"></a>01451 <span class="comment">                    G = V + 0.56*(B-V) - 0.12  (Fukugita et al. 1996, AJ 111, p1748)</span>
-<a name="l01452"></a>01452 <span class="comment"></span>
-<a name="l01453"></a>01453 <span class="comment">                    magG   = G + c*(B-V) = V + (0.56+c)*(B-V) - 0.12</span>
-<a name="l01454"></a>01454 <span class="comment">                           = (1 - 0.56 - c)*V  + (0.56+c)*B - 0.12</span>
-<a name="l01455"></a>01455 <span class="comment"></span>
-<a name="l01456"></a>01456 <span class="comment">                    errG^2 = (1 - 0.56 - c)^2*errV^2  + (0.56+c)^2*errB^2</span>
-<a name="l01457"></a>01457 <span class="comment">                             +errc^2 (B-V)^2</span>
-<a name="l01458"></a>01458 <span class="comment">                else</span>
-<a name="l01459"></a>01459 <span class="comment">                    // Landolt like</span>
-<a name="l01460"></a>01460 <span class="comment">                    magU  = V      +    (B-V)   + (U-B) + c(U-B)</span>
-<a name="l01461"></a>01461 <span class="comment">                    err^2 = errV^2 + err(B-V)^2 + (1+c)^2 err(U-B)^2</span>
-<a name="l01462"></a>01462 <span class="comment">                          + errc^2 (U-B)^2</span>
-<a name="l01463"></a>01463 <span class="comment"></span>
-<a name="l01464"></a>01464 <span class="comment">                    magB  = V      +    (B-V) + c(B-V)</span>
-<a name="l01465"></a>01465 <span class="comment">                    err^2 = errV^2 + (1+c)^2 err(B-V)^2</span>
-<a name="l01466"></a>01466 <span class="comment">                          + errc^2 (B-V)^2</span>
-<a name="l01467"></a>01467 <span class="comment"></span>
-<a name="l01468"></a>01468 <span class="comment">                    magG  = V + (0.56+c)*(B-V) - 0.12  (Fukugita et al. 1996, AJ 111, p1748)</span>
-<a name="l01469"></a>01469 <span class="comment">                    err^2 = errV^2 + (0.56+c)^2*err(B-V)^2</span>
-<a name="l01470"></a>01470 <span class="comment">                          + errc^2 (B-V)^2</span>
-<a name="l01471"></a>01471 <span class="comment"></span>
-<a name="l01472"></a>01472 <span class="comment">                    magV  = V      + c(B-V)</span>
-<a name="l01473"></a>01473 <span class="comment">                    err^2 = errV^2 + c^2 err(B-V)^2</span>
-<a name="l01474"></a>01474 <span class="comment">                          + errc^2 (B-V)^2</span>
-<a name="l01475"></a>01475 <span class="comment"></span>
-<a name="l01476"></a>01476 <span class="comment">                    magR  = V - (V-R) + c (V-R) = V + (c-1)(V-R)</span>
-<a name="l01477"></a>01477 <span class="comment">                    err^2 = errV^2 + (c-1)^2 err(V-R)^2</span>
-<a name="l01478"></a>01478 <span class="comment">                          + errc^2 (V-R)^2</span>
-<a name="l01479"></a>01479 <span class="comment"></span>
-<a name="l01480"></a>01480 <span class="comment">                    magI  = V      -    (V-I)   + c      (V-R)</span>
-<a name="l01481"></a>01481 <span class="comment">                    err^2 = errV^2 + err(V-I)^2 + c^2 err(V-R)^2</span>
-<a name="l01482"></a>01482 <span class="comment">                          + errc^2 (V-R)^2</span>
-<a name="l01483"></a>01483 <span class="comment">            */</span>
-<a name="l01484"></a>01484 
-<a name="l01485"></a>01485             <span class="comment">/* Find other bands, C1, C2 */</span>
-<a name="l01486"></a>01486             <span class="keyword">const</span> <span class="keywordtype">char</span> *col;<span class="comment">/* =  FORS_DATA_STD_COL[setting->filter];*/</span>
-<a name="l01487"></a>01487             <span class="keywordflow">switch</span> (*B1)
-<a name="l01488"></a>01488             {
-<a name="l01489"></a>01489                 <span class="keywordflow">case</span>    <span class="charliteral">'U'</span>: col = <span class="stringliteral">"U_B"</span>; <span class="keywordflow">break</span>;
-<a name="l01490"></a>01490                 <span class="keywordflow">case</span>    <span class="charliteral">'B'</span>: col = <span class="stringliteral">"B_V"</span>; <span class="keywordflow">break</span>;
-<a name="l01491"></a>01491                 <span class="keywordflow">case</span>    <span class="charliteral">'G'</span>: col = <span class="stringliteral">"B_V"</span>; <span class="keywordflow">break</span>;
-<a name="l01492"></a>01492                 <span class="keywordflow">case</span>    <span class="charliteral">'V'</span>: col = <span class="stringliteral">"B_V"</span>; <span class="keywordflow">break</span>;
-<a name="l01493"></a>01493                 <span class="keywordflow">case</span>    <span class="charliteral">'R'</span>: col = <span class="stringliteral">"V_R"</span>; <span class="keywordflow">break</span>;
-<a name="l01494"></a>01494                 <span class="keywordflow">case</span>    <span class="charliteral">'I'</span>: col = <span class="stringliteral">"V_R"</span>; <span class="keywordflow">break</span>;
-<a name="l01495"></a>01495                 <span class="keywordflow">case</span>    <span class="charliteral">'Z'</span>: col = <span class="stringliteral">"?Z?"</span>; <span class="keywordflow">break</span>;
-<a name="l01496"></a>01496                 <span class="keywordflow">default</span>: col = <span class="stringliteral">""</span>;
-<a name="l01497"></a>01497             }
-<a name="l01498"></a>01498             <span class="keywordtype">double</span> coeff = -color_term;  <span class="comment">/* per convention */</span>
-<a name="l01499"></a>01499             <span class="keywordtype">double</span> dcoeff = dcolor_term;
-<a name="l01500"></a>01500 
-<a name="l01501"></a>01501             <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( strlen(col) == strlen(<span class="stringliteral">"X_Y"</span>), <span class="keywordflow">return</span> c,
-<a name="l01502"></a>01502                     <span class="stringliteral">"Color term column must have format 'X_Y', is '%s'"</span>,
-<a name="l01503"></a>01503                     col );
-<a name="l01504"></a>01504             
-<a name="l01505"></a>01505             <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( col[1] == <span class="charliteral">'_'</span>, <span class="keywordflow">return</span> c,
-<a name="l01506"></a>01506                     <span class="stringliteral">"Color term column must have format 'X_Y', is '%s'"</span>,
-<a name="l01507"></a>01507                     col );
-<a name="l01508"></a>01508             
-<a name="l01509"></a>01509             <span class="keywordtype">char</span> C1[2] = {<span class="charliteral">'\0'</span>, <span class="charliteral">'\0'</span>};
-<a name="l01510"></a>01510             <span class="keywordtype">char</span> C2[2] = {<span class="charliteral">'\0'</span>, <span class="charliteral">'\0'</span>};
-<a name="l01511"></a>01511 
-<a name="l01512"></a>01512             *C1 = col[0];
-<a name="l01513"></a>01513             *C2 = col[2];
-<a name="l01514"></a>01514 
-<a name="l01515"></a>01515             ERR_B1 = cpl_sprintf(<span class="stringliteral">"ERR_%s"</span>, B1);
-<a name="l01516"></a>01516             ERR_C1 = cpl_sprintf(<span class="stringliteral">"ERR_%s"</span>, C1);
-<a name="l01517"></a>01517             ERR_C2 = cpl_sprintf(<span class="stringliteral">"ERR_%s"</span>, C2);
-<a name="l01518"></a>01518 
-<a name="l01519"></a>01519             <span class="comment">/* Catalog data */</span>
-<a name="l01520"></a>01520             <span class="keywordtype">double</span> cat_mag, dcat_mag, color;
-<a name="l01521"></a>01521             
-<a name="l01522"></a>01522             <span class="comment">/* Color corrected magnitude */</span>
-<a name="l01523"></a>01523             <span class="keywordtype">double</span> mag, dmag;
-<a name="l01524"></a>01524 
-<a name="l01525"></a>01525             <span class="keywordtype">int</span> i;
-<a name="l01526"></a>01526             <span class="keywordflow">for</span> (i = 0; i < cpl_table_get_nrow(t); i++) {
-<a name="l01527"></a>01527                 <span class="keywordflow">if</span> (cpl_table_has_column(t, ERR_B1) &&
-<a name="l01528"></a>01528                     cpl_table_has_column(t, ERR_C1) &&
-<a name="l01529"></a>01529                     cpl_table_has_column(t, ERR_C2)) {
-<a name="l01530"></a>01530                     
-<a name="l01531"></a>01531                     <span class="comment">/* Stetson, four cases */</span>
-<a name="l01532"></a>01532 <span class="comment">/*                    if (setting->filter == FILTER_G) {*/</span>
-<a name="l01533"></a>01533                     <span class="keywordflow">if</span> (*B1 == <span class="charliteral">'G'</span>) {
-<a name="l01534"></a>01534                         <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"V"</span>, i) &&
-<a name="l01535"></a>01535                             cpl_table_is_valid(t, <span class="stringliteral">"B"</span>, i) &&
-<a name="l01536"></a>01536                             cpl_table_is_valid(t, <span class="stringliteral">"ERR_B"</span>, i) &&
-<a name="l01537"></a>01537                             cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i)) {
-<a name="l01538"></a>01538                             <span class="keywordtype">double</span>     v = cpl_table_get_float(t, <span class="stringliteral">"V"</span>, i, NULL);
-<a name="l01539"></a>01539                             <span class="keywordtype">double</span>     b = cpl_table_get_float(t, <span class="stringliteral">"B"</span>, i, NULL);
-<a name="l01540"></a>01540                             <span class="keywordtype">double</span> err_b = cpl_table_get_float(t, <span class="stringliteral">"ERR_B"</span>, i, NULL);
-<a name="l01541"></a>01541                             <span class="keywordtype">double</span> err_v = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);
-<a name="l01542"></a>01542 
-<a name="l01543"></a>01543                             color = b-v;
-<a name="l01544"></a>01544                             mag     = (1-0.56-coeff) * v + (0.56+coeff)*b - 0.12;
-<a name="l01545"></a>01545                             cat_mag = (1-0.56      ) * v + (0.56      )*b - 0.12;
-<a name="l01546"></a>01546 
-<a name="l01547"></a>01547                             dmag = 
-<a name="l01548"></a>01548                                 sqrt(
-<a name="l01549"></a>01549                                     (1-0.56-coeff)*(1-0.56-coeff)*err_v*err_v +
-<a name="l01550"></a>01550                                     (0.56  +coeff)*(0.56  +coeff)*err_b*err_b +
-<a name="l01551"></a>01551                                     +
-<a name="l01552"></a>01552                                     dcoeff*dcoeff*color*color);
-<a name="l01553"></a>01553 
-<a name="l01554"></a>01554                             dcat_mag = sqrt(
-<a name="l01555"></a>01555                                 (1-0.56-0)*(1-0.56-0)*err_v*err_v +
-<a name="l01556"></a>01556                                 (0.56  +0)*(0.56  +0)*err_b*err_b);
-<a name="l01557"></a>01557                         }
-<a name="l01558"></a>01558                     }
-<a name="l01559"></a>01559                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*B1 == *C2) {
-<a name="l01560"></a>01560                         <span class="keywordflow">if</span> (cpl_table_is_valid(t, B1, i) &&
-<a name="l01561"></a>01561                             cpl_table_is_valid(t, C1, i) &&
-<a name="l01562"></a>01562                             cpl_table_is_valid(t, ERR_B1, i) &&
-<a name="l01563"></a>01563                             cpl_table_is_valid(t, ERR_C1, i)) {
-<a name="l01564"></a>01564                             <span class="keywordtype">double</span>     b1 = cpl_table_get_float(t, B1, i, NULL);
-<a name="l01565"></a>01565                             <span class="keywordtype">double</span>     c1 = cpl_table_get_float(t, C1, i, NULL);
-<a name="l01566"></a>01566                             <span class="keywordtype">double</span> err_b1 = cpl_table_get_float(t, ERR_B1, i, NULL);
-<a name="l01567"></a>01567                             <span class="keywordtype">double</span> err_c1 = cpl_table_get_float(t, ERR_C1, i, NULL);
-<a name="l01568"></a>01568 
-<a name="l01569"></a>01569                             color = c1-b1;
-<a name="l01570"></a>01570 
-<a name="l01571"></a>01571                             cat_mag = b1;
-<a name="l01572"></a>01572                             dcat_mag = err_b1;
-<a name="l01573"></a>01573 
-<a name="l01574"></a>01574                             mag = 
-<a name="l01575"></a>01575                                 (1-coeff) * b1
-<a name="l01576"></a>01576                                 +  coeff  * c1;
-<a name="l01577"></a>01577                             dmag = 
-<a name="l01578"></a>01578                                 sqrt(
-<a name="l01579"></a>01579                                     (1-coeff)*(1-coeff)*err_b1*err_b1 +
-<a name="l01580"></a>01580                                            coeff*coeff *err_c1*err_c1
-<a name="l01581"></a>01581                                     +
-<a name="l01582"></a>01582                                     dcoeff*dcoeff*color*color);
-<a name="l01583"></a>01583                         }
-<a name="l01584"></a>01584                         <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;
-<a name="l01585"></a>01585                     }
-<a name="l01586"></a>01586                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*B1 == *C1) {
-<a name="l01587"></a>01587                         <span class="keywordflow">if</span> (cpl_table_is_valid(t, B1, i) &&
-<a name="l01588"></a>01588                             cpl_table_is_valid(t, C2, i) &&
-<a name="l01589"></a>01589                             cpl_table_is_valid(t, ERR_B1, i) &&
-<a name="l01590"></a>01590                             cpl_table_is_valid(t, ERR_C2, i)) {
-<a name="l01591"></a>01591                             <span class="keywordtype">double</span>     b1 = cpl_table_get_float(t, B1, i, NULL);
-<a name="l01592"></a>01592                             <span class="keywordtype">double</span>     c2 = cpl_table_get_float(t, C2, i, NULL);
-<a name="l01593"></a>01593                             <span class="keywordtype">double</span> err_b1 = cpl_table_get_float(t, ERR_B1, i, NULL);
-<a name="l01594"></a>01594                             <span class="keywordtype">double</span> err_c2 = cpl_table_get_float(t, ERR_C2, i, NULL);
-<a name="l01595"></a>01595 
-<a name="l01596"></a>01596                             color = b1-c2;
-<a name="l01597"></a>01597                             
-<a name="l01598"></a>01598                             cat_mag = b1;
-<a name="l01599"></a>01599                             dcat_mag = err_b1;
-<a name="l01600"></a>01600                             
-<a name="l01601"></a>01601                             mag = 
-<a name="l01602"></a>01602                                 (1+coeff) * b1
-<a name="l01603"></a>01603                                 -  coeff  * c2;
-<a name="l01604"></a>01604                             dmag = 
-<a name="l01605"></a>01605                                 sqrt(
-<a name="l01606"></a>01606                                     (1+coeff)*(1+coeff)*err_b1*err_b1 +
-<a name="l01607"></a>01607                                     coeff*coeff *err_c2*err_c2
-<a name="l01608"></a>01608                                     +
-<a name="l01609"></a>01609                                     dcoeff*dcoeff*color*color);
-<a name="l01610"></a>01610 
-<a name="l01611"></a>01611                         }
-<a name="l01612"></a>01612                         <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;
-<a name="l01613"></a>01613                     }
-<a name="l01614"></a>01614                     <span class="keywordflow">else</span> {
-<a name="l01615"></a>01615                         <span class="comment">/* All different */</span>
-<a name="l01616"></a>01616                         <span class="keywordflow">if</span> (cpl_table_is_valid(t, B1, i) &&
-<a name="l01617"></a>01617                             cpl_table_is_valid(t, C1, i) &&
-<a name="l01618"></a>01618                             cpl_table_is_valid(t, C2, i) &&
-<a name="l01619"></a>01619                             cpl_table_is_valid(t, ERR_B1, i) &&
-<a name="l01620"></a>01620                             cpl_table_is_valid(t, ERR_C1, i) &&
-<a name="l01621"></a>01621                             cpl_table_is_valid(t, ERR_C2, i)) {
-<a name="l01622"></a>01622                             <span class="keywordtype">double</span>     b1 = cpl_table_get_float(t, B1, i, NULL);
-<a name="l01623"></a>01623                             <span class="keywordtype">double</span>     c1 = cpl_table_get_float(t, C1, i, NULL);
-<a name="l01624"></a>01624                             <span class="keywordtype">double</span>     c2 = cpl_table_get_float(t, C2, i, NULL);
-<a name="l01625"></a>01625                             <span class="keywordtype">double</span> err_b1 = cpl_table_get_float(t, ERR_B1, i, NULL);
-<a name="l01626"></a>01626                             <span class="keywordtype">double</span> err_c1 = cpl_table_get_float(t, ERR_C1, i, NULL);
-<a name="l01627"></a>01627                             <span class="keywordtype">double</span> err_c2 = cpl_table_get_float(t, ERR_C2, i, NULL);
-<a name="l01628"></a>01628 
-<a name="l01629"></a>01629                             color = c1-c2;
-<a name="l01630"></a>01630 
-<a name="l01631"></a>01631                             cat_mag = b1;
-<a name="l01632"></a>01632                             dcat_mag = err_b1;
-<a name="l01633"></a>01633                             
-<a name="l01634"></a>01634                             mag = b1
-<a name="l01635"></a>01635                                 + coeff * c1
-<a name="l01636"></a>01636                                 - coeff * c2;
-<a name="l01637"></a>01637                             dmag = sqrt(
-<a name="l01638"></a>01638                                 err_b1*err_b1 +
-<a name="l01639"></a>01639                                 coeff*coeff * err_c1*err_c1 +
-<a name="l01640"></a>01640                                 coeff*coeff * err_c2*err_c2 +
-<a name="l01641"></a>01641                                 dcoeff*dcoeff * color*color);
-<a name="l01642"></a>01642                         }
-<a name="l01643"></a>01643                         <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;
-<a name="l01644"></a>01644                     }
-<a name="l01645"></a>01645                 } <span class="comment">/* If stetson, else */</span>
-<a name="l01646"></a>01646 <span class="comment">/*                else if (setting->filter == FILTER_G) {*/</span>
-<a name="l01647"></a>01647                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*B1 == <span class="charliteral">'G'</span>) {
-<a name="l01648"></a>01648                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"V"</span>, i) &&
-<a name="l01649"></a>01649                         cpl_table_is_valid(t, <span class="stringliteral">"B_V"</span>, i) &&
-<a name="l01650"></a>01650                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&
-<a name="l01651"></a>01651                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_B_V"</span>, i)) {
-<a name="l01652"></a>01652                         <span class="keywordtype">double</span>     v   = cpl_table_get_float(t, <span class="stringliteral">"V"</span>, i, NULL);
-<a name="l01653"></a>01653                         <span class="keywordtype">double</span>    bv   = cpl_table_get_float(t, <span class="stringliteral">"B_V"</span>, i, NULL);
-<a name="l01654"></a>01654                         <span class="keywordtype">double</span> err_v   = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);
-<a name="l01655"></a>01655                         <span class="keywordtype">double</span> err_b_v = cpl_table_get_float(t, <span class="stringliteral">"ERR_B_V"</span>, i, NULL);
-<a name="l01656"></a>01656 
-<a name="l01657"></a>01657                         color = bv;
-<a name="l01658"></a>01658 
-<a name="l01659"></a>01659                         cat_mag = v + (0.56)*(bv) - 0.12;
-<a name="l01660"></a>01660 
-<a name="l01661"></a>01661                         mag  = v + (0.56+coeff)*(bv) - 0.12;
-<a name="l01662"></a>01662                         dmag = 
-<a name="l01663"></a>01663                             sqrt(
-<a name="l01664"></a>01664                                 err_v*err_v +
-<a name="l01665"></a>01665                                 (0.56+coeff)*(0.56+coeff)*err_b_v*err_b_v +
-<a name="l01666"></a>01666                                 +
-<a name="l01667"></a>01667                                 dcoeff*dcoeff*bv*bv);
-<a name="l01668"></a>01668                         dcat_mag = 
-<a name="l01669"></a>01669                             sqrt(
-<a name="l01670"></a>01670                                 err_v*err_v +
-<a name="l01671"></a>01671                                 (0.56)*(0.56)*err_b_v*err_b_v);
-<a name="l01672"></a>01672                     }
-<a name="l01673"></a>01673                 }
-<a name="l01674"></a>01674                 <span class="keywordflow">else</span> <span class="keywordflow">switch</span> (*B1) {
-<a name="l01675"></a>01675                     <span class="comment">/* Landolt, every band is a special case */</span>
-<a name="l01676"></a>01676                 <span class="keywordflow">case</span> <span class="charliteral">'U'</span>:
-<a name="l01677"></a>01677                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"U"</span>, i) &&
-<a name="l01678"></a>01678                         cpl_table_is_valid(t, <span class="stringliteral">"U_B"</span>, i) &&
-<a name="l01679"></a>01679                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&
-<a name="l01680"></a>01680                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_B_V"</span>, i) &&
-<a name="l01681"></a>01681                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_U_B"</span>, i)) {
-<a name="l01682"></a>01682                         
-<a name="l01683"></a>01683                         <span class="keywordtype">double</span> err_v  = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);
-<a name="l01684"></a>01684                         <span class="keywordtype">double</span> err_bv = cpl_table_get_float(t, <span class="stringliteral">"ERR_B_V"</span>, i, NULL);
-<a name="l01685"></a>01685                         <span class="keywordtype">double</span> err_ub = cpl_table_get_float(t, <span class="stringliteral">"ERR_U_B"</span>, i, NULL);
-<a name="l01686"></a>01686                         <span class="keywordtype">double</span> ub     = cpl_table_get_float(t, <span class="stringliteral">"U_B"</span>, i, NULL);
-<a name="l01687"></a>01687 
-<a name="l01688"></a>01688                         color = ub;
-<a name="l01689"></a>01689 
-<a name="l01690"></a>01690                         cat_mag = cpl_table_get_float(t, <span class="stringliteral">"U"</span>, i, NULL);
-<a name="l01691"></a>01691                         
-<a name="l01692"></a>01692                         mag = cat_mag + coeff * ub;
-<a name="l01693"></a>01693                         dmag = sqrt(err_v*err_v + err_bv*err_bv+
-<a name="l01694"></a>01694                                     (1+coeff)*(1+coeff)*err_ub*err_ub +
-<a name="l01695"></a>01695                                     dcoeff*dcoeff*ub*ub);
-<a name="l01696"></a>01696                         
-<a name="l01697"></a>01697                         dcat_mag = sqrt(err_v*err_v + err_bv*err_bv+
-<a name="l01698"></a>01698                                         err_ub*err_ub);
-<a name="l01699"></a>01699                     } 
-<a name="l01700"></a>01700                     <span class="keywordflow">else</span> <span class="keywordflow">continue</span>; <span class="comment">/* to next for(...) iteration */</span>
-<a name="l01701"></a>01701                     <span class="keywordflow">break</span>; <span class="comment">/* out of switch */</span>
-<a name="l01702"></a>01702                 <span class="keywordflow">case</span> <span class="charliteral">'B'</span>:
-<a name="l01703"></a>01703                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"B"</span>, i) &&
-<a name="l01704"></a>01704                         cpl_table_is_valid(t, <span class="stringliteral">"B_V"</span>, i) &&
-<a name="l01705"></a>01705                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&
-<a name="l01706"></a>01706                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_B_V"</span>, i)) {
-<a name="l01707"></a>01707                         
-<a name="l01708"></a>01708                         <span class="keywordtype">double</span> err_v  = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);
-<a name="l01709"></a>01709                         <span class="keywordtype">double</span> err_bv = cpl_table_get_float(t, <span class="stringliteral">"ERR_B_V"</span>, i, NULL);
-<a name="l01710"></a>01710                         <span class="keywordtype">double</span>     bv = cpl_table_get_float(t, <span class="stringliteral">"B_V"</span>, i, NULL);
-<a name="l01711"></a>01711 
-<a name="l01712"></a>01712                         color = bv;
-<a name="l01713"></a>01713                         cat_mag = cpl_table_get_float(t, <span class="stringliteral">"B"</span>, i, NULL);
-<a name="l01714"></a>01714 
-<a name="l01715"></a>01715                         mag = cat_mag +
-<a name="l01716"></a>01716                             coeff * bv;
-<a name="l01717"></a>01717                         dmag = sqrt(err_v*err_v +
-<a name="l01718"></a>01718                                     (1+coeff)*(1+coeff)*err_bv*err_bv +
-<a name="l01719"></a>01719                                     dcoeff*dcoeff*bv*bv);
-<a name="l01720"></a>01720                         dcat_mag = sqrt(err_v*err_v +
-<a name="l01721"></a>01721                                         err_bv*err_bv);
-<a name="l01722"></a>01722                     }
-<a name="l01723"></a>01723                     <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;
-<a name="l01724"></a>01724                     <span class="keywordflow">break</span>;
-<a name="l01725"></a>01725                 <span class="keywordflow">case</span> <span class="charliteral">'V'</span>:
-<a name="l01726"></a>01726                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"V"</span>, i) &&
-<a name="l01727"></a>01727                         cpl_table_is_valid(t, <span class="stringliteral">"B_V"</span>, i) &&
-<a name="l01728"></a>01728                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&
-<a name="l01729"></a>01729                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_B_V"</span>, i)) {
-<a name="l01730"></a>01730                         
-<a name="l01731"></a>01731                         <span class="keywordtype">double</span> err_v  = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);
-<a name="l01732"></a>01732                         <span class="keywordtype">double</span> err_bv = cpl_table_get_float(t, <span class="stringliteral">"ERR_B_V"</span>, i, NULL);
-<a name="l01733"></a>01733                         <span class="keywordtype">double</span>     bv = cpl_table_get_float(t, <span class="stringliteral">"B_V"</span>, i, NULL);
-<a name="l01734"></a>01734 
-<a name="l01735"></a>01735                         color = bv;
-<a name="l01736"></a>01736                         cat_mag = cpl_table_get_float(t, <span class="stringliteral">"V"</span>, i, NULL);
-<a name="l01737"></a>01737                         dcat_mag = err_v;
-<a name="l01738"></a>01738                         
-<a name="l01739"></a>01739                         mag = cat_mag + coeff * bv;
-<a name="l01740"></a>01740                         dmag = sqrt(err_v*err_v +
-<a name="l01741"></a>01741                                     coeff*coeff*err_bv*err_bv +
-<a name="l01742"></a>01742                                     dcoeff*dcoeff*bv*bv);
-<a name="l01743"></a>01743                     }
-<a name="l01744"></a>01744                     <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;
-<a name="l01745"></a>01745                     <span class="keywordflow">break</span>;
-<a name="l01746"></a>01746                 <span class="keywordflow">case</span> <span class="charliteral">'R'</span>:
-<a name="l01747"></a>01747                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"R"</span>, i) &&
-<a name="l01748"></a>01748                         cpl_table_is_valid(t, <span class="stringliteral">"V_R"</span>, i) &&
-<a name="l01749"></a>01749                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&
-<a name="l01750"></a>01750                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V_R"</span>, i)) {
-<a name="l01751"></a>01751                         
-<a name="l01752"></a>01752                         <span class="keywordtype">double</span> err_v  = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);
-<a name="l01753"></a>01753                         <span class="keywordtype">double</span> err_vr = cpl_table_get_float(t, <span class="stringliteral">"ERR_V_R"</span>, i, NULL);
-<a name="l01754"></a>01754                         <span class="keywordtype">double</span>     vr = cpl_table_get_float(t, <span class="stringliteral">"V_R"</span>, i, NULL);
-<a name="l01755"></a>01755 
-<a name="l01756"></a>01756                         color = vr;
-<a name="l01757"></a>01757                         cat_mag = cpl_table_get_float(t, <span class="stringliteral">"R"</span>, i, NULL);
-<a name="l01758"></a>01758                         mag = cat_mag + coeff * vr;
-<a name="l01759"></a>01759                         dmag = sqrt(err_v*err_v +
-<a name="l01760"></a>01760                                     (1-coeff)*(1-coeff)*err_vr*err_vr +
-<a name="l01761"></a>01761                                     dcoeff*dcoeff*vr*vr);
-<a name="l01762"></a>01762                         dcat_mag = sqrt(err_v*err_v + err_vr*err_vr);
-<a name="l01763"></a>01763                     }
-<a name="l01764"></a>01764                     <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;
-<a name="l01765"></a>01765                     <span class="keywordflow">break</span>;
-<a name="l01766"></a>01766                 <span class="keywordflow">case</span> <span class="charliteral">'I'</span>:
-<a name="l01767"></a>01767                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"I"</span>, i) &&
-<a name="l01768"></a>01768                         cpl_table_is_valid(t, <span class="stringliteral">"V_R"</span>, i) &&
-<a name="l01769"></a>01769                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&
-<a name="l01770"></a>01770                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V_I"</span>, i) &&
-<a name="l01771"></a>01771                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V_R"</span>, i)) {
-<a name="l01772"></a>01772                         
-<a name="l01773"></a>01773                         <span class="keywordtype">double</span> err_v  = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);
-<a name="l01774"></a>01774                         <span class="keywordtype">double</span> err_vi = cpl_table_get_float(t, <span class="stringliteral">"ERR_V_I"</span>, i, NULL);
-<a name="l01775"></a>01775                         <span class="keywordtype">double</span> err_vr = cpl_table_get_float(t, <span class="stringliteral">"ERR_V_R"</span>, i, NULL);
-<a name="l01776"></a>01776                         <span class="keywordtype">double</span>     vr = cpl_table_get_float(t, <span class="stringliteral">"V_R"</span>, i, NULL);
-<a name="l01777"></a>01777 
-<a name="l01778"></a>01778                         color = vr;
-<a name="l01779"></a>01779                         cat_mag = cpl_table_get_float(t, <span class="stringliteral">"I"</span>, i, NULL);
-<a name="l01780"></a>01780                         mag = cat_mag + coeff * vr;
-<a name="l01781"></a>01781                         dmag = sqrt(err_v*err_v + err_vi*err_vi+
-<a name="l01782"></a>01782                                     coeff*coeff*err_vr*err_vr +
-<a name="l01783"></a>01783                                     dcoeff*dcoeff*vr*vr);
-<a name="l01784"></a>01784                         dcat_mag = sqrt(err_v*err_v + err_vi*err_vi);
-<a name="l01785"></a>01785                     }
-<a name="l01786"></a>01786                     <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;
-<a name="l01787"></a>01787                     <span class="keywordflow">break</span>;
-<a name="l01788"></a>01788                 <span class="keywordflow">default</span>:
-<a name="l01789"></a>01789                     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span> c, 
-<a name="l01790"></a>01790                             <span class="stringliteral">"Unknown filter: %s"</span>, B1);
-<a name="l01791"></a>01791                     <span class="keywordflow">break</span>;
-<a name="l01792"></a>01792                 }
-<a name="l01793"></a>01793                 
-<a name="l01794"></a>01794                 <span class="keywordtype">double</span> ra = cpl_table_get_double(t, FORS_DATA_STD_RA,
-<a name="l01795"></a>01795                                                  i, NULL);
-<a name="l01796"></a>01796                 <span class="keywordtype">double</span> dec = cpl_table_get_double(t, FORS_DATA_STD_DEC,
-<a name="l01797"></a>01797                                                   i, NULL);
-<a name="l01798"></a>01798 
-<a name="l01799"></a>01799                 <span class="keyword">const</span> <span class="keywordtype">char</span> *std_name = cpl_table_get_string(t, FORS_DATA_STD_NAME,
-<a name="l01800"></a>01800                                                             i);
-<a name="l01801"></a>01801                 
-<a name="l01802"></a>01802                 fors_std_star_list_insert(
-<a name="l01803"></a>01803                     c, fors_std_star_new(ra, dec, mag, dmag, 
-<a name="l01804"></a>01804                                          cat_mag, dcat_mag,
-<a name="l01805"></a>01805                                          color, -1, -1, std_name));
-<a name="l01806"></a>01806 
-<a name="l01807"></a>01807             } <span class="comment">/* for each table row */</span>
-<a name="l01808"></a>01808 
-<a name="l01809"></a>01809 <span class="preprocessor">#if 0  </span><span class="comment">/* This is old code which removes doublets but is slow (O(n^2)),</span>
-<a name="l01810"></a>01810 <span class="comment">        * Doublets will be removed during identification, after</span>
-<a name="l01811"></a>01811 <span class="comment">        * selecting the (relatively few) stars that fall inside the CCD</span>
-<a name="l01812"></a>01812 <span class="comment">        */</span>
-<a name="l01813"></a>01813                     <span class="keywordtype">double</span> nearest_dist;
-<a name="l01814"></a>01814                     <span class="keywordflow">if</span> (fors_std_star_list_size(c) > 0) {
-<a name="l01815"></a>01815                         fors_std_star *nearest = fors_std_star_list_min_val(
-<a name="l01816"></a>01816                             c,
-<a name="l01817"></a>01817                             (fors_std_star_list_func_eval)
-<a name="l01818"></a>01818                             fors_std_star_dist_arcsec,
-<a name="l01819"></a>01819                             std);
-<a name="l01820"></a>01820                         
-<a name="l01821"></a>01821                         nearest_dist = fors_std_star_dist_arcsec(std, nearest);
-<a name="l01822"></a>01822                         cpl_msg_debug(cpl_func, <span class="stringliteral">"min dist = %f arcseconds"</span>,
-<a name="l01823"></a>01823                                       nearest_dist);
-<a name="l01824"></a>01824                     }
-<a name="l01825"></a>01825                     
-<a name="l01826"></a>01826                     <span class="keywordflow">if</span> (fors_std_star_list_size(c) == 0 || nearest_dist > 5) {
-<a name="l01827"></a>01827                         fors_std_star_list_insert(c, std);
-<a name="l01828"></a>01828                     }
-<a name="l01829"></a>01829                     <span class="keywordflow">else</span> {
-<a name="l01830"></a>01830                         fors_std_star_delete(&std);
-<a name="l01831"></a>01831                     }
-<a name="l01832"></a>01832 <span class="preprocessor">#endif</span>
-<a name="l01833"></a>01833 <span class="preprocessor"></span>        } <span class="comment">/* if has column B1 */</span>
-<a name="l01834"></a>01834         <span class="keywordflow">else</span> {
-<a name="l01835"></a>01835             cpl_msg_info(cpl_func, <span class="stringliteral">"Skipping catalog %s, no column %s"</span>,
-<a name="l01836"></a>01836                          filename, B1);
-<a name="l01837"></a>01837         }
-<a name="l01838"></a>01838     } <span class="comment">/* for each frame */</span>
-<a name="l01839"></a>01839     
-<a name="l01840"></a>01840     cpl_msg_info(cpl_func, <span class="stringliteral">"Found %d catalogue standards"</span>,
-<a name="l01841"></a>01841                  fors_std_star_list_size(c));
-<a name="l01842"></a>01842 
-<a name="l01843"></a>01843     <span class="comment">/* fors_std_cat_print(c); */</span>
-<a name="l01844"></a>01844 
-<a name="l01845"></a>01845     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01846"></a>01846     <span class="keywordflow">return</span> c;
-<a name="l01847"></a>01847 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__std__cat_8c_source.html b/html/fors__std__cat_8c_source.html
new file mode 100644
index 0000000..42f1fe5
--- /dev/null
+++ b/html/fors__std__cat_8c_source.html
@@ -0,0 +1,1755 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_std_cat.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_std_cat.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_std_cat.c,v 1.21 2013-09-10 15:19:08 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 15:19:08 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.21 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_std_star.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_instrument.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_STD_CAT_COLUMN_RA   = <span class="stringliteral">"RA"</span>;</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_STD_CAT_COLUMN_DEC  = <span class="stringliteral">"DEC"</span>;</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_STD_CAT_COLUMN_NAME = <span class="stringliteral">"OBJECT"</span>;</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="structband__jacobian.html">   44</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structband__jacobian.html">band_jacobian</a> {</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>     <span class="keywordtype">char</span>    band;</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>     <span class="keywordtype">double</span>  mag[6]; <span class="comment">/* 5 inputs, 1 constant */</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     <span class="keywordtype">double</span>  col[6]; <span class="comment">/* 5 inputs, 1 constant */</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> } <a class="code" href="structband__jacobian.html">band_jacobian</a>;</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> fors_std_cat_propagate_uncorrelated_inputs( <span class="keyword">const</span> <span class="keywordtype">double</span>    *in,</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *din,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *jacobi_A,</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *jacobi_B,</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>                                             <span class="keywordtype">int</span>             size,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>                                             <span class="keywordtype">double</span>          *out_A,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>                                             <span class="keywordtype">double</span>          *out_B,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>                                             <span class="keywordtype">double</span>          *dout_A,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>                                             <span class="keywordtype">double</span>          *dout_B,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>                                             <span class="keywordtype">double</span>          *cov_AB);</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> fors_std_cat_import_generic_star(           <span class="keyword">const</span> <span class="keywordtype">double</span>        *band_values,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>                                             <span class="keyword">const</span> <span class="keywordtype">double</span>        *band_errors,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>                                             <span class="keyword">const</span> <a class="code" href="structband__jacobian.html">band_jacobian</a> *jacobians,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>                                             <span class="keywordtype">int</span>                 nband_values,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                                             <span class="keywordtype">int</span>                 nbands,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                             <span class="keywordtype">char</span>                band,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                             <span class="keywordtype">double</span>  *cat_mag,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                                             <span class="keywordtype">double</span>  *dcat_mag,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                                             <span class="keywordtype">double</span>  *color,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                                             <span class="keywordtype">double</span>  *dcolor,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                                             <span class="keywordtype">double</span>  *cov_catmag_color);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keyword">static</span>  <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> fors_std_cat_check_band_support(            cpl_error_code (*import_func)(</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                                                 <span class="keywordtype">double</span>  *values,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                                 <span class="keywordtype">double</span>  *errors,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                                                 <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                                                 <span class="keywordtype">double</span>  *out_A,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                                                 <span class="keywordtype">double</span>  *dout_A,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                                                 <span class="keywordtype">double</span>  *out_B,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                                                 <span class="keywordtype">double</span>  *dout_B,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                                                 <span class="keywordtype">double</span>  *out_cov),</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                                             <span class="keywordtype">int</span>     nvalues,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                                             <span class="keywordtype">char</span>    band);</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="keyword">static</span>  <span class="keywordtype">bool</span>*</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> fors_std_cat_determine_required_columns(     cpl_error_code (*import_func)(</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                                                 <span class="keywordtype">double</span>  *values,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                                                 <span class="keywordtype">double</span>  *errors,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                                                 <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                                                 <span class="keywordtype">double</span>  *out_A,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                                                 <span class="keywordtype">double</span>  *dout_A,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                                                 <span class="keywordtype">double</span>  *out_B,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                                                 <span class="keywordtype">double</span>  *dout_B,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                                                 <span class="keywordtype">double</span>  *out_cov),</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>                                             <span class="keywordtype">int</span>     nvalues,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>                                             <span class="keywordtype">char</span>    band);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> fors_std_cat_reject_not_required_columns(   cpl_array       *column_names,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                                             cpl_error_code  (*import_func)(</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                                                 <span class="keywordtype">double</span>  *values,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                                                 <span class="keywordtype">double</span>  *errors,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                                                 <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                                                 <span class="keywordtype">double</span>  *out_A,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                                                 <span class="keywordtype">double</span>  *dout_A,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                                                 <span class="keywordtype">double</span>  *out_B,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                                                 <span class="keywordtype">double</span>  *dout_B,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                                                 <span class="keywordtype">double</span>  *out_cov),</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                                             <span class="keywordtype">char</span>            band);</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> fors_std_cat_table_check_columns(           <span class="keyword">const</span> cpl_table *cat_table,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                                             <span class="keyword">const</span> cpl_array *columns);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="keyword">static</span> cpl_array    *</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> fors_std_cat_create_error_column_names(     <span class="keyword">const</span> cpl_array *colnames);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> fors_std_cat_landolt_star_import(           <span class="keywordtype">double</span>  v_bv_ub_vr_vi[5],</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                                             <span class="keywordtype">double</span>  ERR_v_bv_ub_vr_vi[5],</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                                             <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                                             <span class="keywordtype">double</span>  *cat_mag,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                                             <span class="keywordtype">double</span>  *dcat_mag,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                                             <span class="keywordtype">double</span>  *color,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                                             <span class="keywordtype">double</span>  *dcolor,</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                                             <span class="keywordtype">double</span>  *cov_catmag_color);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="keyword">static</span> cpl_array    *</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> fors_std_cat_landolt_get_column_names(      <span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> fors_std_cat_stetson_star_import(           <span class="keywordtype">double</span>  u_b_v_r_i[5],</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                                             <span class="keywordtype">double</span>  ERR_u_b_v_r_i[5],</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                                             <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                                             <span class="keywordtype">double</span>  *cat_mag,</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                                             <span class="keywordtype">double</span>  *dcat_mag,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                                             <span class="keywordtype">double</span>  *color,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                                             <span class="keywordtype">double</span>  *dcolor,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                                             <span class="keywordtype">double</span>  *cov_catmag_color);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="keyword">static</span> cpl_array    *</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> fors_std_cat_stetson_get_column_names(      <span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> fors_std_cat_check_method_and_columns(      cpl_table   *catalogue,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                                             cpl_array   *colnames,</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>                                             cpl_error_code  (*import_func)(</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>                                                 <span class="keywordtype">double</span>  *values,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                                                 <span class="keywordtype">double</span>  *errors,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                                                 <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                                                 <span class="keywordtype">double</span>  *out_A,</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>                                                 <span class="keywordtype">double</span>  *dout_A,</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>                                                 <span class="keywordtype">double</span>  *out_B,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                                                 <span class="keywordtype">double</span>  *dout_B,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                                                 <span class="keywordtype">double</span>  *out_cov),</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                                             <span class="keywordtype">char</span>        band,</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *method,</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>                                             cpl_array   **err_colnames,</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>                                             <span class="keywordtype">bool</span>        *method_supports_band);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> fors_std_cat_propagate_uncorrelated_inputs( <span class="keyword">const</span> <span class="keywordtype">double</span>    *in,</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *din,</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *jacobi_A,</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>                                             <span class="keyword">const</span> <span class="keywordtype">double</span>    *jacobi_B,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                                             <span class="keywordtype">int</span>             size,</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                                             <span class="keywordtype">double</span>          *out_A,</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>                                             <span class="keywordtype">double</span>          *out_B,</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>                                             <span class="keywordtype">double</span>          *dout_A,</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>                                             <span class="keywordtype">double</span>          *dout_B,</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>                                             <span class="keywordtype">double</span>          *cov_AB)</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> {</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordtype">int</span> n;</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     *out_A  = 0;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     *out_B  = 0;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     *dout_A = 0;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     *dout_B = 0;</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     *cov_AB = 0;</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     <span class="keywordflow">for</span> (n = 0; n < size; n++)</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     {</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>         <span class="comment">/* uncorrelated inputs are assumed! */</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>         *out_A  += (*jacobi_A) * (*in);</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>         *out_B  += (*jacobi_B) * (*in);</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>         *dout_A += (*jacobi_A)*(*jacobi_A) * (*din)*(*din);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>         *dout_B += (*jacobi_B)*(*jacobi_B) * (*din)*(*din);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>         *cov_AB += (*jacobi_A)*(*jacobi_B) * (*din)*(*din);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>         jacobi_A++;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>         jacobi_B++;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>         in++;</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>         din++;</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     }</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     *dout_A = sqrt(*dout_A);</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     *dout_B = sqrt(*dout_B);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> fors_std_cat_import_generic_star(           <span class="keyword">const</span> <span class="keywordtype">double</span>        *band_values,</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>                                             <span class="keyword">const</span> <span class="keywordtype">double</span>        *band_errors,</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>                                             <span class="keyword">const</span> <a class="code" href="structband__jacobian.html">band_jacobian</a> *jacobians,</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>                                             <span class="keywordtype">int</span>                 nband_values,</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>                                             <span class="keywordtype">int</span>                 nbands,</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>                                             <span class="keywordtype">char</span>                band,</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>                                             <span class="keywordtype">double</span>  *cat_mag,</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>                                             <span class="keywordtype">double</span>  *dcat_mag,</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>                                             <span class="keywordtype">double</span>  *color,</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>                                             <span class="keywordtype">double</span>  *dcolor,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>                                             <span class="keywordtype">double</span>  *cov_catmag_color)</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> {</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="keywordtype">int</span> ib;</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="keywordflow">for</span> (ib = 0; ib <= nbands; ib++)</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     {</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>         <span class="keywordflow">if</span> (jacobians[ib].band == band)</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>         {</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>             fors_std_cat_propagate_uncorrelated_inputs(</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>                                             band_values,</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>                                             band_errors,</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>                                             jacobians[ib].mag,</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>                                             jacobians[ib].col,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                                             nband_values,</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>                                             cat_mag,</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>                                             color,</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                                             dcat_mag,</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>                                             dcolor,</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                                             cov_catmag_color);</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>             <span class="comment">/* constant term */</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>             *cat_mag += jacobians[ib].mag[nband_values];</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>             *color   += jacobians[ib].col[nband_values];</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>             </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>             <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>         }</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     }</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_error_set_message(                  cpl_func,</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>                                             CPL_ERROR_UNSUPPORTED_MODE,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                                             <span class="stringliteral">"unknown band \'%c\'"</span>,</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>                                             band);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> }</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> <span class="preprocessor">    cpl_free(values); values = NULL; \</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> <span class="preprocessor">    cpl_free(errors); errors = NULL; \</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> <span class="keyword">static</span>  <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> fors_std_cat_check_band_support(            cpl_error_code (*import_func)(</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>                                                 <span class="keywordtype">double</span>  *values,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>                                                 <span class="keywordtype">double</span>  *errors,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>                                                 <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>                                                 <span class="keywordtype">double</span>  *out_A,</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                                                 <span class="keywordtype">double</span>  *dout_A,</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>                                                 <span class="keywordtype">double</span>  *out_B,</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>                                                 <span class="keywordtype">double</span>  *dout_B,</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                                                 <span class="keywordtype">double</span>  *out_cov),</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                                             <span class="keywordtype">int</span>     nvalues,</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>                                             <span class="keywordtype">char</span>    band)</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> {</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <span class="keywordtype">double</span>          *values = NULL,</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                     *errors = NULL;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     <span class="keywordtype">double</span>          out[5];</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     </div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     values = cpl_calloc(nvalues, <span class="keyword">sizeof</span>(*values));</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     errors = cpl_calloc(nvalues, <span class="keyword">sizeof</span>(*errors));</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     (*import_func)( values, errors, band,</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>                     out + 0, out + 1, out + 2, out + 3, out + 4);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     cpl_free(values);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     cpl_free(errors);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     {</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>         <span class="keywordflow">if</span> (cpl_error_get_code() == CPL_ERROR_UNSUPPORTED_MODE)</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>         {</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>             cpl_errorstate_set(errstat);    <span class="comment">/* reset error */</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>         }</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>         {</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>             cpl_error_set_where(cpl_func);</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>         }</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>         <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     }</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>         <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> }</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> <span class="preprocessor">    cpl_free(required); required = NULL; \</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> <span class="preprocessor">    cpl_free(values); values = NULL; \</span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> <span class="preprocessor">    cpl_free(errors); errors = NULL; \</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> <span class="keyword">static</span>  <span class="keywordtype">bool</span>*</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> fors_std_cat_determine_required_columns(     cpl_error_code (*import_func)(</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                                                 <span class="keywordtype">double</span>  *values,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                                                 <span class="keywordtype">double</span>  *errors,</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>                                                 <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                                                 <span class="keywordtype">double</span>  *out_A,</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>                                                 <span class="keywordtype">double</span>  *dout_A,</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>                                                 <span class="keywordtype">double</span>  *out_B,</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>                                                 <span class="keywordtype">double</span>  *dout_B,</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>                                                 <span class="keywordtype">double</span>  *out_cov),</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>                                             <span class="keywordtype">int</span>     nvalues,</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>                                             <span class="keywordtype">char</span>    band)</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> {</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordtype">bool</span>            *required = NULL;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordtype">double</span>          *values = NULL,</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>                     *errors = NULL;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     <span class="keywordtype">double</span>          out_offset[5];</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="keywordtype">int</span>             n;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     values = cpl_calloc(nvalues, <span class="keyword">sizeof</span>(*values));</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     errors = cpl_calloc(nvalues, <span class="keyword">sizeof</span>(*errors));</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     required = cpl_calloc(nvalues, <span class="keyword">sizeof</span>(*required));</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="comment">/* get offset output values @ all inputs = 0.0 */</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     (*import_func)(                         values,</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>                                             errors,</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>                                             band,</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>                                             out_offset + 0,</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>                                             out_offset + 1,</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                                             out_offset + 2,</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>                                             out_offset + 3,</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>                                             out_offset + 4);</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="comment">/* successively switch on inputs</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="comment">     * (here we assume of course that they contribute independently) */</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     <span class="keywordflow">for</span> (n = 0; n < nvalues; n++)</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     {</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>         <span class="keywordtype">double</span>  out[5];</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>         <span class="keywordtype">int</span>     i;</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>         </div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>         values[n] = 1;</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>         errors[n] = 1;</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         <span class="keywordflow">if</span> (n > 0)</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         {</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>             values[n-1] = 0;</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>             errors[n-1] = 0;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>         }</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>         </div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         (*import_func)(                     values,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>                                             errors,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                                             band,</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>                                             out + 0,</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>                                             out + 1,</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>                                             out + 2,</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>                                             out + 3,</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                                             out + 4);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>         {</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>             cpl_error_set_where(cpl_func);</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>             cleanup;</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>             <span class="keywordflow">return</span> required;</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>         }</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         <span class="keywordflow">for</span> (i = 0; i < 5; i++)</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>             <span class="keywordflow">if</span> (fabs(out[i] - out_offset[i]) > 10*DBL_EPSILON)</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>                 required[n] = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     }</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     cpl_free(values);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     cpl_free(errors);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">return</span> required;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span> }</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> <span class="preprocessor">    cpl_free(required); required = NULL; \</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> fors_std_cat_reject_not_required_columns(   cpl_array       *column_names,</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>                                             cpl_error_code  (*import_func)(</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>                                                 <span class="keywordtype">double</span>  *values,</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>                                                 <span class="keywordtype">double</span>  *errors,</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>                                                 <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>                                                 <span class="keywordtype">double</span>  *out_A,</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>                                                 <span class="keywordtype">double</span>  *dout_A,</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>                                                 <span class="keywordtype">double</span>  *out_B,</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>                                                 <span class="keywordtype">double</span>  *dout_B,</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>                                                 <span class="keywordtype">double</span>  *out_cov),</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>                                             <span class="keywordtype">char</span>            band)</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> {</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="keywordtype">bool</span>            *required = NULL;</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     <span class="keywordtype">int</span>             ncolumns,</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>                     n;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     </div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     cassure_automsg(                        import_func !=  NULL,</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     cassure_automsg(                        column_names !=  NULL,</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     cassure_automsg(                        cpl_array_get_type(column_names)</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>                                             == CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     ncolumns = cpl_array_get_size(column_names);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     required = fors_std_cat_determine_required_columns(</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>                                             import_func,</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>                                             ncolumns,</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>                                             band);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                                             NULL);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     </div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     <span class="keywordflow">for</span> (n = 0; n < ncolumns; n++)</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     {</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>         <span class="keywordflow">if</span> (!required[n])</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>         {</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>             cpl_array_set_invalid(column_names, n);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         }</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>         {</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>             <span class="keyword">const</span> <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>             name = cpl_array_get_string(column_names, n);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>             <span class="keywordflow">if</span> (name == NULL || name[0] == <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>             {</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>                 cpl_error_set_message(      cpl_func,</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>                                             <span class="stringliteral">"column %d required, but name not "</span></div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                                             <span class="stringliteral">"specified"</span>,</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>                                             n);</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>                 cleanup;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>                 <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>             }</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         }</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     }</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>     cpl_free(required);</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     </div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     <span class="keywordflow">return</span> (cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>                 CPL_ERROR_NONE :</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>                 cpl_error_get_code());</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> }</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> </div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> fors_std_cat_table_check_columns(           <span class="keyword">const</span> cpl_table *cat_table,</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>                                             <span class="keyword">const</span> cpl_array *columns)</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> {</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     <span class="keywordtype">int</span> ncols,</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>         n;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     cassure_automsg(                        cat_table !=  NULL,</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>                                             <span class="keywordflow">return</span> <span class="keyword">false</span>);</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     cassure_automsg(                        columns !=  NULL,</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>                                             <span class="keywordflow">return</span> <span class="keyword">false</span>);</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     cassure_automsg(                        cpl_array_get_type(columns)</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>                                             == CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>                                             <span class="keywordflow">return</span> <span class="keyword">false</span>);</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     ncols = cpl_array_get_size(columns);</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keywordflow">for</span> (n = 0; n < ncols; n++)</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     {</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  *cs;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         cs = cpl_array_get_string(columns, n);</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         <span class="keywordflow">if</span> (cs != NULL</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>             && (!cpl_table_has_column(cat_table, cs)))</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>         {</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>             <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>         }</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     }</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> }</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span> </div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span> <span class="preprocessor">    cpl_array_delete(errcolnames); errcolnames = NULL; \</span></div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> <span class="keyword">static</span> cpl_array    *</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> fors_std_cat_create_error_column_names(     <span class="keyword">const</span> cpl_array *colnames)</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span> {</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     cpl_array   *errcolnames = NULL;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     <span class="keywordtype">int</span>         size,</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>                 n;</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     cassure_automsg(                        colnames !=  NULL,</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>                                             <span class="keywordflow">return</span> errcolnames);</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     cassure_automsg(                        cpl_array_get_type(colnames)</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>                                             == CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>                                             <span class="keywordflow">return</span> errcolnames);</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     </div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     size = cpl_array_get_size(colnames);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     </div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     errcolnames = cpl_array_new(size, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordflow">for</span> (n = 0; n < size; n++)</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     {</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>         <span class="keywordtype">char</span>        estr[10];</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  *cs;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>         cs = cpl_array_get_string(colnames, n);</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>         <span class="keywordflow">if</span> (cs != NULL)</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>         {</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>             snprintf(estr, 9, <span class="stringliteral">"ERR_%s"</span>, cs);</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>             cpl_array_set_string(errcolnames, n, estr);</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         }</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     }</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordflow">return</span> errcolnames;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> }</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span> </div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span> fors_std_cat_landolt_star_import(           <span class="keywordtype">double</span>  v_bv_ub_vr_vi[5],</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>                                             <span class="keywordtype">double</span>  ERR_v_bv_ub_vr_vi[5],</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>                                             <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>                                             <span class="keywordtype">double</span>  *cat_mag,</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>                                             <span class="keywordtype">double</span>  *dcat_mag,</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>                                             <span class="keywordtype">double</span>  *color,</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>                                             <span class="keywordtype">double</span>  *dcolor,</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>                                             <span class="keywordtype">double</span>  *cov_catmag_color)</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> {</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     cpl_error_code  errc;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     </div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structband__jacobian.html">band_jacobian</a> jacobians[6] =</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     { <span class="comment">/*                             V   B-V   U-B   V-R   V-I     1(const) */</span></div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>                     {   <span class="charliteral">'U'</span>,    {    1,    1,    1,    0,    0,    0,},</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>                                 {    0,    0,    1,    0,    0,    0,}, },</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>                     {   <span class="charliteral">'B'</span>,    {    1,    1,    0,    0,    0,    0,},</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>                                 {    0,    1,    0,    0,    0,    0,}, },</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>                                 <span class="comment">/*(Fukugita et al. 1996, AJ 111, p1748)*/</span></div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>                     {   <span class="charliteral">'G'</span>,    {    1, 0.56,    0,    0,    0,-0.12,},</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>                                 {    0,    1,    0,    0,    0,    0,}, },</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>                     {   <span class="charliteral">'V'</span>,    {    1,    0,    0,    0,    0,    0,},</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>                                 {    0,    1,    0,    0,    0,    0,}, },</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>                     {   <span class="charliteral">'R'</span>,    {    1,    0,    0,   -1,    0,    0,},</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>                                 {    0,    0,    0,    1,    0,    0,}, },</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>                     {   <span class="charliteral">'I'</span>,    {    1,    0,    0,    0,   -1,    0,},</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>                                 {    0,    0,    0,    1,    0,    0,}, },</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     };</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     errc = fors_std_cat_import_generic_star(v_bv_ub_vr_vi,</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>                                             ERR_v_bv_ub_vr_vi,</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>                                             jacobians,</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>                                             5,  <span class="comment">/* jac. columns without const */</span></div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>                                             6,  <span class="comment">/* n bands (U, B, G, ...) */</span></div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>                                             band,</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>                                             cat_mag,</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>                                             dcat_mag,</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>                                             color,</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>                                             dcolor,</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>                                             cov_catmag_color);</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     <span class="keywordflow">if</span> (errc != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>         cpl_error_set_where(cpl_func);</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     <span class="keywordflow">return</span> errc;</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> }</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span> </div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span> <span class="keyword">static</span> cpl_array    *</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> fors_std_cat_landolt_get_column_names(      <span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> {</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  landolt_columns[5][4] = { <span class="stringliteral">"V"</span>, <span class="stringliteral">"B_V"</span>, <span class="stringliteral">"U_B"</span>, <span class="stringliteral">"V_R"</span>, <span class="stringliteral">"V_I"</span> };</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>     cpl_array   *columns = NULL;</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     <span class="keywordtype">int</span>         c;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     </div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     columns = cpl_array_new(5, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>     </div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     <span class="keywordflow">for</span> (c = 0; c < 5; c++)</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>         cpl_array_set_string(columns, c, landolt_columns[c]);</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     </div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>     <span class="keywordflow">return</span> columns;</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span> }</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> </div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span> fors_std_cat_stetson_star_import(           <span class="keywordtype">double</span>  u_b_v_r_i[5],</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>                                             <span class="keywordtype">double</span>  ERR_u_b_v_r_i[5],</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>                                             <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>                                             <span class="keywordtype">double</span>  *cat_mag,</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>                                             <span class="keywordtype">double</span>  *dcat_mag,</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>                                             <span class="keywordtype">double</span>  *color,</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>                                             <span class="keywordtype">double</span>  *dcolor,</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>                                             <span class="keywordtype">double</span>  *cov_catmag_color)</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span> {</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     cpl_error_code  errc;</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     </div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structband__jacobian.html">band_jacobian</a> jacobians[6] =</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>     { <span class="comment">/*                             U     B     V     R     I     1(const) */</span></div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>                     {   <span class="charliteral">'U'</span>,    {    1,    0,    0,    0,    0,    0,},</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>                                 {    1,   -1,    0,    0,    0,    0,}, },</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>                     {   <span class="charliteral">'B'</span>,    {    0,    1,    0,    0,    0,    0,},</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>                                 {    0,    1,   -1,    0,    0,    0,}, },</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>                                 <span class="comment">/*(Fukugita et al. 1996, AJ 111, p1748)*/</span></div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>                     {   <span class="charliteral">'G'</span>,    {    0, 0.56,(1.0-0.56),0,   0,-0.12,},</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>                                 {    0,    1,   -1,    0,    0,    0,}, },</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>                     {   <span class="charliteral">'V'</span>,    {    0,    0,    1,    0,    0,    0,},</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>                                 {    0,    1,   -1,    0,    0,    0,}, },</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>                     {   <span class="charliteral">'R'</span>,    {    0,    0,    0,    1,    0,    0,},</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>                                 {    0,    0,    1,   -1,    0,    0,}, },</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>                     {   <span class="charliteral">'I'</span>,    {    0,    0,    0,    0,    1,    0,},</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>                                 {    0,    0,    1,   -1,    0,    0,}, },</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     };</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     </div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     errc = fors_std_cat_import_generic_star(u_b_v_r_i,</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>                                             ERR_u_b_v_r_i,</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>                                             jacobians,</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>                                             5,  <span class="comment">/* jac. columns without const */</span></div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>                                             6,  <span class="comment">/* n bands (U, B, G, ...) */</span></div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>                                             band,</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>                                             cat_mag,</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>                                             dcat_mag,</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>                                             color,</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>                                             dcolor,</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>                                             cov_catmag_color);</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     <span class="keywordflow">if</span> (errc != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>         cpl_error_set_where(cpl_func);</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     <span class="keywordflow">return</span> errc;</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span> }</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span> </div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span> <span class="keyword">static</span> cpl_array    *</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> fors_std_cat_stetson_get_column_names(      <span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span> {</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  stetson_columns[5][2] = { <span class="stringliteral">"U"</span>, <span class="stringliteral">"B"</span>, <span class="stringliteral">"V"</span>, <span class="stringliteral">"R"</span>, <span class="stringliteral">"I"</span> };</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>     cpl_array   *columns = NULL;</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     <span class="keywordtype">int</span>         c;</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>     </div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     columns = cpl_array_new(5, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     </div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     <span class="keywordflow">for</span> (c = 0; c < 5; c++)</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>         cpl_array_set_string(columns, c, stetson_columns[c]);</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     </div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>     <span class="keywordflow">return</span> columns;</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span> }</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span> </div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> <span class="preprocessor">    if (err_colnames != NULL) \</span></div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> <span class="preprocessor">        { cpl_array_delete(*err_colnames); *err_colnames = NULL; } \</span></div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> <span class="preprocessor">    cat_type_detected = false; \</span></div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span> fors_std_cat_check_method_and_columns(      cpl_table   *catalogue,</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>                                             cpl_array   *colnames,</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>                                             cpl_error_code  (*import_func)(</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>                                                 <span class="keywordtype">double</span>  *values,</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>                                                 <span class="keywordtype">double</span>  *errors,</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>                                                 <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>                                                 <span class="keywordtype">double</span>  *out_A,</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>                                                 <span class="keywordtype">double</span>  *dout_A,</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>                                                 <span class="keywordtype">double</span>  *out_B,</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>                                                 <span class="keywordtype">double</span>  *dout_B,</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>                                                 <span class="keywordtype">double</span>  *out_cov),</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>                                             <span class="keywordtype">char</span>        band,</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>  *method,</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>                                             cpl_array   **err_colnames,</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>                                             <span class="keywordtype">bool</span>        *method_supports_band)</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span> {</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>     <span class="keywordtype">bool</span>            band_supported = <span class="keyword">false</span>,</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>                     cat_type_detected = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>     <span class="keywordtype">int</span>             ncols;</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>     </div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>     cassure_automsg(                        catalogue != NULL,</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>                                             <span class="keywordflow">return</span> cat_type_detected);</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>     cassure_automsg(                        colnames != NULL,</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>                                             <span class="keywordflow">return</span> cat_type_detected);</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>     cassure_automsg(                        cpl_array_get_type(colnames)</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>                                             == CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>                                             <span class="keywordflow">return</span> cat_type_detected);</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>     cassure_automsg(                        import_func != NULL,</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>                                             <span class="keywordflow">return</span> cat_type_detected);</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>     cassure_automsg(                        method != NULL,</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>                                             <span class="keywordflow">return</span> cat_type_detected);</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>     cassure_automsg(                        err_colnames != NULL,</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>                                             <span class="keywordflow">return</span> cat_type_detected);</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     </div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     cleanup;</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>     </div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     ncols = cpl_array_get_size(colnames);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     band_supported = fors_std_cat_check_band_support(</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>                                             import_func,</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>                                             ncols,</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>                                             band);</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>     <span class="keywordflow">if</span> (band_supported)</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>     {</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>         <span class="keywordtype">int</span> n;</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>         <span class="comment">/* determine the required values for the import function,</span></div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span> <span class="comment">         * and set other column names to NULL */</span></div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>         fors_std_cat_reject_not_required_columns(</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>                                             colnames,</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>                                             import_func,</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>                                             band);</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>         </div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>         <span class="comment">/* for column names != NULL, prepend "ERR_" */</span></div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>         *err_colnames = fors_std_cat_create_error_column_names(colnames);</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>         </div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>         <span class="keywordflow">for</span> (n = 0; n < ncols; n++)</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>         {</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>             <span class="keyword">const</span> <span class="keywordtype">char</span>  *s[2];</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>             <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>             s[0] = cpl_array_get_string(colnames, n);</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>             s[1] = cpl_array_get_string(*err_colnames, n);</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>             <span class="keywordflow">if</span> (s[0] != NULL)</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>                 <span class="keywordflow">for</span> (i = 0; i < 2; i++)</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>                 {</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>                     cpl_msg_debug(cpl_func, <span class="stringliteral">"Required %s column for band %c: "</span></div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>                                             <span class="stringliteral">"%s (%sfound)"</span>,</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>                                             method, band, s[i],</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>                                             (   cpl_table_has_column(</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>                                                     catalogue, s[i]) ?</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>                                                 <span class="stringliteral">""</span> : <span class="stringliteral">"not "</span>)</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>                                             );</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>                 }</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>         }</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>         </div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>         <span class="comment">/* check presence of column names != NULL */</span></div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>         cat_type_detected = (   fors_std_cat_table_check_columns(</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>                                             catalogue,</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>                                             colnames)</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>                                 && fors_std_cat_table_check_columns(</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>                                             catalogue,</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>                                             *err_colnames));</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>     }</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>     <span class="keywordflow">if</span> (method_supports_band != NULL)</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>         *method_supports_band = band_supported;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>     </div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cat_type_detected, NULL);</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>     </div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>     <span class="keywordflow">return</span> cat_type_detected;</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span> }</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span> </div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span> <span class="preprocessor">    fors_std_star_list_delete(&stdlist, fors_std_star_delete); \</span></div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span> <span class="preprocessor">    fors_std_star_delete(&std_star); \</span></div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span> <span class="preprocessor">    cpl_array_delete(columns); columns = NULL; \</span></div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span> <span class="preprocessor">    cpl_array_delete(err_columns); err_columns = NULL; \</span></div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span> <span class="preprocessor">    cpl_array_delete(frame_error_messages); frame_error_messages = NULL; \</span></div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span> <span class="preprocessor">    cpl_table_delete(cat_table); cat_table = NULL; \</span></div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span> <span class="preprocessor">    cpl_free(band_values); band_values = NULL; \</span></div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span> <span class="preprocessor">    cpl_free(band_errors); band_errors = NULL; \</span></div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span> fors_std_star_list *</div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span> fors_std_cat_load(                          <span class="keyword">const</span> cpl_frameset  *cat_frames,</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>                                             <span class="keywordtype">char</span>            band,</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>                                             <span class="keywordtype">bool</span>            require_all_frames,</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>                                             <span class="keywordtype">double</span>          color_term,</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>                                             <span class="keywordtype">double</span>          dcolor_term)</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span> {</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>     fors_std_star_list  *stdlist = NULL;</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>     fors_std_star       *std_star = NULL;</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>     cpl_array           *columns = NULL,</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>                         *err_columns = NULL,</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>                         *frame_error_messages = NULL;</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>     <span class="keywordtype">char</span>                **frame_error_strings = NULL;</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>     cpl_table           *cat_table = NULL;</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>     <span class="keyword">const</span> cpl_frame     *cat_frame;</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>     <span class="keywordtype">double</span>              *band_values = NULL,</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>                         *band_errors = NULL;</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>     <span class="keywordtype">int</span>                 iframe,</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>                         last_imethod = -1,</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>                         n_cat_entries = 0;</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>     <span class="keywordtype">bool</span>                printed_warning = <span class="keyword">false</span>,</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>                         checked_support = <span class="keyword">false</span>,</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>                         printed_supported = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>     cpl_errorstate      errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>     </div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>     <span class="keyword">struct </span>method {</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>         cpl_array*      (*get_column_names_func)(void);</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>         cpl_error_code  (*star_import_func)(</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>                         <span class="keywordtype">double</span>  *values,</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>                         <span class="keywordtype">double</span>  *errors,</div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>                         <span class="keywordtype">char</span>    band,</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>                         <span class="keywordtype">double</span>  *cat_mag,</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>                         <span class="keywordtype">double</span>  *dcat_mag,</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span>                         <span class="keywordtype">double</span>  *color,</div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>                         <span class="keywordtype">double</span>  *dcolor,</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>                         <span class="keywordtype">double</span>  *cov_catmag_color);</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>      name[10];</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>         <span class="keywordtype">bool</span>            band_supported;</div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>     }           methods[2] = {  {   fors_std_cat_landolt_get_column_names,</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>                                     fors_std_cat_landolt_star_import,</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>                                     <span class="stringliteral">"Landolt"</span>,</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>                                     <span class="keyword">false</span>},</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>                                 {   fors_std_cat_stetson_get_column_names,</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>                                     fors_std_cat_stetson_star_import,</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>                                     <span class="stringliteral">"Stetson"</span>,</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>                                     <span class="keyword">false</span>}</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>                         };</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>     </div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>     <span class="comment">/* check input */</span></div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>     cassure_automsg(                        cat_frames != NULL,</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>                                             <span class="keywordflow">return</span> stdlist);</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>     </div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>     cassure(                                !fors_instrument_filterband_is_none(</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>                                                 band),</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>                                             <span class="keywordflow">return</span> stdlist,</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>                                             <span class="stringliteral">"no optical/filter band specified"</span>);</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>     cassure(                             !fors_instrument_filterband_is_unknown(</div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>                                                 band),</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>                                             CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>                                             <span class="keywordflow">return</span> stdlist,</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>                                             <span class="stringliteral">"optical/filter band is unknown"</span>);</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>     </div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>     stdlist = fors_std_star_list_new();</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>     <span class="comment">/* error message container, don't abuse the error history for that since</span></div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span> <span class="comment">     * its size is limited */</span></div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>     frame_error_messages = cpl_array_new(   cpl_frameset_get_size(cat_frames),</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>                                             CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>     frame_error_strings = cpl_array_get_data_string(frame_error_messages);</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>     </div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>     <span class="comment">/* import all frames */</span></div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>     <span class="keywordflow">for</span> (cat_frame = cpl_frameset_get_first_const(cat_frames), iframe = 0;</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>          cat_frame != NULL;</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>          cat_frame = cpl_frameset_get_next_const(cat_frames), iframe++)</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>     {</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>         <span class="keywordtype">int</span>         ncolumns,</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>                     row,</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>                     nrows,</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>                     imethod,</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>                     nmethods;</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  **column_value_names,</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>                     **column_error_names;</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  *filename;</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>         <span class="keywordtype">bool</span>        cat_type_detected = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>         </div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>         filename = cpl_frame_get_filename(cat_frame);</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>         cassure(                            filename != NULL,</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>                                             <span class="keywordflow">return</span> stdlist,</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>                                             <span class="stringliteral">"filename of frame %d is NULL"</span>,</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>                                             iframe);</div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span> </div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>         cpl_table_delete(cat_table);</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>         cat_table = cpl_table_load(filename, 1, 1);</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>         {</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>             frame_error_strings[iframe] = cpl_sprintf(</div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>                                             <span class="stringliteral">"could not load FITS table"</span>);</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>             <span class="keywordflow">if</span> (require_all_frames)</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>             {</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>                 cassure(                    0,</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>                                             <span class="keywordflow">return</span> stdlist,</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>                                             <span class="stringliteral">"%s: %s"</span>,</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>                                             filename,</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>                                             frame_error_strings[iframe]);</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>             }</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>             {</div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>                 <span class="comment">/* reset last error */</span></div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>                 cpl_errorstate_set(errstat);</div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>                 cpl_msg_warning(            cpl_func, <span class="stringliteral">"Skipping %s (%s)"</span>,</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>                                             filename,</div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>                                             frame_error_strings[iframe]);</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>                 <span class="keywordflow">continue</span>;   <span class="comment">/* skip this frame */</span></div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>             }</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>         }</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>         </div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>         <span class="comment">/* determine the type of the catalogue, and</span></div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span> <span class="comment">         * accordingly get the names of the required columns.</span></div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span> <span class="comment">         * For the import functions, we keep the array with the correct</span></div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span> <span class="comment">         * order of the input column names, but we just invalidate the</span></div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span> <span class="comment">         * non-required column names. */</span></div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>         nmethods = <span class="keyword">sizeof</span>(methods)/<span class="keyword">sizeof</span>(*methods);</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>         <span class="keywordflow">for</span> (imethod = 0; imethod < nmethods; imethod++)</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>         {</div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>             cpl_array_delete(columns);</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>             columns = methods[imethod].get_column_names_func();</div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>             </div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>             cat_type_detected = fors_std_cat_check_method_and_columns(</div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>                                             cat_table,</div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>                                             columns,    <span class="comment">/* is modified */</span></div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>                                             methods[imethod].star_import_func,</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>                                             band,</div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>                                             methods[imethod].name,</div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>                                             &err_columns,</div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>                                             &(methods[imethod].band_supported));</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>             passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> stdlist);</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>             <span class="keywordflow">if</span> (cat_type_detected)</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>         }</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>         <span class="keywordflow">if</span> (!cat_type_detected)</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>         {</div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>             <span class="keywordflow">if</span> (!checked_support)   <span class="comment">/* FIXME: this should be checked in another</span></div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span> <span class="comment">                                       function, called before looping over</span></div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span> <span class="comment">                                       frames */</span></div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>             {</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>                 <span class="keywordtype">bool</span> band_generally_supported = <span class="keyword">false</span>;</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>                 <span class="keywordflow">for</span> (imethod = 0; imethod < nmethods; imethod++)</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>                 {</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>                     band_generally_supported |= methods[imethod].band_supported;</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>                 }</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>                 <span class="keywordflow">if</span> (!band_generally_supported)</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>                 {</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>                     cpl_error_set_message(  cpl_func,</div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>                                             CPL_ERROR_UNSUPPORTED_MODE,</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>                                             <span class="stringliteral">"Optical band %c not supported"</span>,</div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>                                             band);</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>                     cleanup;</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>                     <span class="keywordflow">return</span> stdlist;</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>                 }</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>                 checked_support = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>             }</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>             </div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>             <span class="comment">/* create an error message for this frame */</span></div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>             <span class="keywordflow">if</span> (!printed_supported)</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>             {</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>                 <span class="keywordtype">char</span>    *supported_methods = NULL;</div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>                 <span class="keywordflow">for</span> (imethod = 0; imethod < nmethods; imethod++)</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>                 {</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>                     <span class="keywordflow">if</span> (methods[imethod].band_supported)</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>                     {</div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>                         <span class="keywordflow">if</span> (supported_methods == NULL)</div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>                         {</div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>                             supported_methods = cpl_sprintf(</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>                                             <span class="stringliteral">"%s"</span>,</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>                                             methods[imethod].name);</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>                         }</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>                         <span class="keywordflow">else</span>    <span class="comment">/* strcat... */</span></div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>                         {</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>                             <span class="keywordtype">char</span>    *s;</div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>                             s = cpl_sprintf(<span class="stringliteral">"%s, %s"</span>,</div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>                                             supported_methods,</div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>                                             methods[imethod].name);</div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>                             cpl_free(supported_methods);</div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>                             supported_methods = s;</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>                         }</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>                     }</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>                 }</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>                 cpl_msg_warning(            cpl_func,</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>                                             <span class="stringliteral">"Import of band %c supported for: "</span></div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>                                             <span class="stringliteral">"%s"</span>,</div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>                                             band,</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>                                             supported_methods);</div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>                 cpl_free(supported_methods);</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>                 printed_supported = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>             }</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>             </div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>             frame_error_strings[iframe] = cpl_sprintf(</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>                                             <span class="stringliteral">"no cat. data for band %c found"</span>,</div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>                                             band);</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>             <span class="keywordflow">if</span> (require_all_frames)</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>             {</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>                 cpl_error_set_message(      cpl_func,</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>                                             <span class="stringliteral">"%s: %s"</span>,</div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>                                             filename,</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>                                             frame_error_strings[iframe]);</div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>                 cleanup;</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>                 <span class="keywordflow">return</span> stdlist;</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>             }</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>             {</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>                 cpl_msg_warning(            cpl_func, <span class="stringliteral">"Skipping %s (%s)"</span>,</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>                                             filename,</div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>                                             frame_error_strings[iframe]);</div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>                 <span class="keywordflow">continue</span>;   <span class="comment">/* skip this frame */</span></div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>             }</div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>         }</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>         {</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>             cpl_msg_info(                   cpl_func,</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>                                             <span class="stringliteral">"Loading %s catalogue from %s"</span>,</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>                                             methods[imethod].name,</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>                                             filename);</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>         }</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>         <span class="keywordflow">if</span> (last_imethod >= 0 && last_imethod != imethod && !printed_warning)</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>         {</div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>             cpl_msg_warning(                cpl_func,</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>                                             <span class="stringliteral">"Merging different types of "</span></div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>                                             <span class="stringliteral">"catalogues"</span>);</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>             printed_warning = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>         }</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>         last_imethod = imethod;</div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>         </div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>         <span class="comment">/* prepare the actual import of catalogue values */</span></div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>         ncolumns = cpl_array_get_size(columns);</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>         </div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>         cpl_free(band_values);</div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>         band_values = cpl_calloc(ncolumns, <span class="keyword">sizeof</span>(*band_values));</div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>         cpl_free(band_errors);</div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>         band_errors = cpl_calloc(ncolumns, <span class="keyword">sizeof</span>(*band_errors));</div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>         </div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>         column_value_names = cpl_array_get_data_string_const(columns);</div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>         column_error_names = cpl_array_get_data_string_const(err_columns);</div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>         passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> stdlist);</div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>         </div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>         <span class="comment">/* done with preparation, import stars from table rows */</span></div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>         nrows = cpl_table_get_nrow(cat_table);</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>         n_cat_entries += nrows;</div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>         <span class="keywordflow">for</span> (row = 0; row < nrows; row++)</div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>         {</div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>             <span class="keywordtype">int</span>     ib,</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>                     isnull;</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>             <span class="keywordtype">bool</span>    valid;</div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>             </div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>             <span class="comment">/* read all required values from table, ignore others to:</span></div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span> <span class="comment">             * a) save time, and</span></div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span> <span class="comment">             * b) use stars that were observed in the required bands but not</span></div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span> <span class="comment">             *    in others */</span></div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>             valid = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>             <span class="keywordflow">for</span> (ib = 0; ib < ncolumns; ib++)</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>             {</div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>                 <span class="keywordflow">if</span> (column_value_names[ib] != NULL) <span class="comment">/* if required */</span></div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>                 {</div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>                     band_values[ib] = cpl_table_get(</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>                                             cat_table,</div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>                                             column_value_names[ib],</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>                                             row,</div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>                                             &isnull);</div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>                     valid &= (isnull == 0);</div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>                     </div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>                     passure(column_error_names[ib] != NULL, <span class="keywordflow">return</span> stdlist);</div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>                     band_errors[ib] = cpl_table_get(</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>                                             cat_table,</div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>                                             column_error_names[ib],</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>                                             row,</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>                                             &isnull);</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>                     valid &= (isnull == 0);</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>                 }</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>             }</div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>             </div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>             <span class="keywordflow">if</span> (!valid)</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>             </div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>             std_star = fors_std_star_new_from_table(</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>                                             cat_table,</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>                                             row,</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>                                             FORS_STD_CAT_COLUMN_RA,</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>                                             FORS_STD_CAT_COLUMN_DEC,</div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>                                             NULL, NULL, <span class="comment">/* corrected mag */</span></div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>                                             NULL, NULL, <span class="comment">/* catalogue mag */</span></div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>                                             NULL, NULL, <span class="comment">/* color */</span></div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>                                             NULL,       <span class="comment">/* covariance */</span></div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>                                             NULL, NULL, <span class="comment">/* x, y */</span></div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>                                             FORS_STD_CAT_COLUMN_NAME);</div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>             <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                         std_star != NULL,</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>                                             <span class="keywordflow">return</span> stdlist,</div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>                                             NULL);</div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>             </div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>             methods[imethod].star_import_func(</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>                                             band_values,</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>                                             band_errors,</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>                                             band,</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>                                             &(std_star->cat_magnitude),</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>                                             &(std_star->dcat_magnitude),</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>                                             &(std_star->color),</div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>                                             &(std_star->dcolor),</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>                                             &(std_star->cov_catm_color));</div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>             <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                         cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>                                             <span class="keywordflow">return</span> stdlist,</div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>                                             NULL);</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>             </div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>             fors_std_star_compute_corrected_mag(</div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>                                             std_star,</div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>                                             color_term,</div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>                                             dcolor_term);</div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>             </div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>             fors_std_star_list_insert(stdlist, std_star);</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>             std_star = NULL;</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>         }</div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>     }</div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>     </div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>     <span class="keywordflow">if</span> (!require_all_frames)</div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>     {</div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>         cassure(                            cpl_array_has_invalid(</div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>                                                 frame_error_messages),</div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>                                             <span class="keywordflow">return</span> stdlist,</div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>                                             <span class="stringliteral">"No valid catalogue frame found"</span>);</div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>     }</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>     </div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>     <span class="comment">/* Fixing the fact that the list object supports no "append" */</span></div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>     <span class="comment">/*fors_std_star_list_reverse(stdlist);*/</span></div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>     </div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>     cpl_msg_info(                           cpl_func,</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>                                             <span class="stringliteral">"Found %d catalogue standard stars "</span></div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>                                             <span class="stringliteral">"for band %c (of %d catalogue "</span></div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>                                             <span class="stringliteral">"entries)"</span>,</div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>                                             fors_std_star_list_size(stdlist),</div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>                                             band,</div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>                                             n_cat_entries);</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>     </div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>     fors_std_star_list  *retval = stdlist;</div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>     stdlist = NULL;</div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>     cleanup;</div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>     <span class="keywordflow">return</span> retval;</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span> }</div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span> </div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span> <span class="comment">/*#undef cleanup</span></div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span> <span class="comment">#define cleanup \</span></div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span> <span class="comment">do { \</span></div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span> <span class="comment">    cpl_array_delete(stetson_columns); stetson_columns = NULL; \</span></div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span> <span class="comment">    cpl_frame_delete(cat_frame); cat_frame = NULL; \</span></div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span> <span class="comment">} while (0)</span></div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span> <span class="comment">/*cpl_frame   *</span></div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span> <span class="comment">fors_std_cat_test_create_stetson_format(    const fors_std_star_list    *stdl,</span></div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span> <span class="comment">                                            char                        band)</span></div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span> <span class="comment">{</span></div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span> <span class="comment">    cpl_array       *stetson_columns = NULL;</span></div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span> <span class="comment">    cpl_frame       *cat_frame = NULL;</span></div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span> <span class="comment">    cpl_errorstate  errstat = cpl_errorstate_get();</span></div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span> <span class="comment">    </span></div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span> <span class="comment">    stetson_columns = fors_std_cat_stetson_get_column_names();</span></div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span> <span class="comment">    assure(cpl_errorstate_is_equal(errstat), return cat_frame, NULL);</span></div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span> <span class="comment">    fors_std_cat_reject_not_required_columns(</span></div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span> <span class="comment">                                            stetson_columns,</span></div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span> <span class="comment">                                            fors_std_cat_stetson_star_import,</span></div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span> <span class="comment">                                            band);</span></div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span> <span class="comment">    assure(cpl_errorstate_is_equal(errstat), return cat_frame, NULL);</span></div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span> <span class="comment">    ...</span></div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span> <span class="comment">    </span></div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span> <span class="comment">}*/</span></div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span> </div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span> <span class="comment">/* old deprecated code, kept for safety */</span></div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span> </div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_MAG[FORS_NUM_FILTER] =</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span> {<span class="stringliteral">"U"</span>,</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>  <span class="stringliteral">"B"</span>,</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>  <span class="comment">//"G",</span></div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>  <span class="stringliteral">"V"</span>,  <span class="comment">/* G uses V */</span></div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>  <span class="stringliteral">"V"</span>,</div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>  <span class="stringliteral">"R"</span>,</div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>  <span class="stringliteral">"I"</span>,</div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>  <span class="stringliteral">"Z"</span>};</div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span> </div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_DMAG[FORS_NUM_FILTER] =</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span> {<span class="stringliteral">"ERR_U"</span>,</div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>  <span class="stringliteral">"ERR_B"</span>,</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>  <span class="comment">//"ERR_G",</span></div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>  <span class="stringliteral">"ERR_V"</span>, <span class="comment">/* G uses V */</span></div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>  <span class="stringliteral">"ERR_V"</span>,</div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>  <span class="stringliteral">"ERR_R"</span>,</div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>  <span class="stringliteral">"ERR_I"</span>,</div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>  <span class="stringliteral">"ERR_Z"</span>};</div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span> </div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_COL[FORS_NUM_FILTER] = </div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span> {<span class="stringliteral">"U_B"</span>,</div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>  <span class="stringliteral">"B_V"</span>,</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>  <span class="stringliteral">"B_V"</span>,</div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>  <span class="stringliteral">"B_V"</span>,</div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>  <span class="stringliteral">"V_R"</span>,</div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>  <span class="stringliteral">"V_R"</span>,</div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>  <span class="stringliteral">"?Z?"</span>};</div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span> </div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_RA   = <span class="stringliteral">"RA"</span>;</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_DEC  = <span class="stringliteral">"DEC"</span>;</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_NAME = <span class="stringliteral">"OBJECT"</span>;</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span> </div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span> <span class="preprocessor">    cpl_table_delete(t); \</span></div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span> <span class="preprocessor">    cpl_free((void *)ERR_B1); \</span></div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span> <span class="preprocessor">    cpl_free((void *)ERR_C1); \</span></div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span> <span class="preprocessor">    cpl_free((void *)ERR_C2); \</span></div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span> fors_std_star_list *</div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span> fors_std_cat_load_old(<span class="keyword">const</span> cpl_frameset *cat_frames,</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>                   <span class="comment">/*const fors_setting *setting,*/</span></div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>                   <span class="keywordtype">char</span>  optical_band,</div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>                   <span class="keywordtype">double</span> color_term, <span class="keywordtype">double</span> dcolor_term)</div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span> {</div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>     fors_std_star_list *c = NULL;</div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>     cpl_table *t = NULL;</div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename;</div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *ERR_B1 = NULL;</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *ERR_C1 = NULL;</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *ERR_C2 = NULL;</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span> </div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cat_frames != NULL, <span class="keywordflow">return</span> c, NULL );</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>     <span class="comment">/*assure( setting != NULL, return c, NULL );*/</span></div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span> </div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>     <span class="comment">/* For each input table</span></div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span> <span class="comment">           if it contains the required column, then load </span></div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>     c = fors_std_star_list_new();</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span> </div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>     <span class="keyword">const</span> cpl_frame *cat_frame;</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span> </div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>     <span class="keywordflow">for</span> (cat_frame = cpl_frameset_get_first_const(cat_frames);</div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>          cat_frame != NULL;</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>          cat_frame = cpl_frameset_get_next_const(cat_frames)) {</div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>         </div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>         </div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>         filename = cpl_frame_get_filename(cat_frame);</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( filename != NULL, <span class="keywordflow">return</span> c, NULL );</div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span> </div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>         cpl_table_delete(t);</div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>         t = cpl_table_load(filename, 1, 1);</div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> c, <span class="stringliteral">"Could not load FITS catalogue %s"</span>,</div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>                 filename);</div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>         </div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(t, FORS_DATA_STD_RA), <span class="keywordflow">return</span> c, </div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>                 <span class="stringliteral">"%s: Missing column %s"</span>, filename, FORS_DATA_STD_RA);</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>         </div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_get_column_type(t, FORS_DATA_STD_RA) == CPL_TYPE_DOUBLE, </div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>                 <span class="keywordflow">return</span> c,</div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>                 <span class="stringliteral">"%s: Column %s type is %s, double expected"</span>, filename, FORS_DATA_STD_RA,</div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>                 <a class="code" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd" title="Textual representation of CPL type.">fors_type_get_string</a>(cpl_table_get_column_type(t, FORS_DATA_STD_RA)));</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>         </div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>         </div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(t, FORS_DATA_STD_DEC), <span class="keywordflow">return</span> c, </div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>                 <span class="stringliteral">"%s: Missing column %s"</span>, filename, FORS_DATA_STD_DEC);</div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>         </div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_get_column_type(t, FORS_DATA_STD_DEC) == CPL_TYPE_DOUBLE, </div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>                 <span class="keywordflow">return</span> c, </div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>                 <span class="stringliteral">"%s: Column %s type is %s, double expected"</span>, filename, FORS_DATA_STD_DEC,</div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>                 <a class="code" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd" title="Textual representation of CPL type.">fors_type_get_string</a>(cpl_table_get_column_type(t, FORS_DATA_STD_DEC)));</div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span> </div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span> </div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_has_column(t, FORS_DATA_STD_NAME), <span class="keywordflow">return</span> c, </div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>                 <span class="stringliteral">"%s: Missing column %s"</span>, filename, FORS_DATA_STD_NAME);</div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>         </div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_table_get_column_type(t, FORS_DATA_STD_NAME) == CPL_TYPE_STRING, </div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>                 <span class="keywordflow">return</span> c,</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>                 <span class="stringliteral">"%s: Column %s type is %s, string expected"</span>, filename, </div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>                 FORS_DATA_STD_NAME,</div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>                 <a class="code" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd" title="Textual representation of CPL type.">fors_type_get_string</a>(cpl_table_get_column_type(t, FORS_DATA_STD_NAME)));</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>         </div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span> </div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>         <span class="comment">/*const char *B1 = FORS_DATA_STD_MAG[setting->filter];</span></div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span> <span class="comment">        assure( B1 != NULL, return c, NULL );*/</span></div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>         <span class="keywordtype">char</span> B1[2] = {<span class="charliteral">'\0'</span>, <span class="charliteral">'\0'</span>};</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>         <span class="comment">/* *B1 = fors_instrument_filterband_get_by_setting(setting);*/</span></div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>         *B1 = optical_band;</div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>         </div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>         <span class="keywordflow">if</span> ( cpl_table_has_column(t, B1) ) {</div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>             </div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>             <span class="comment">/* </span></div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span> <span class="comment">                The error propagation depends on which</span></div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span> <span class="comment">                error bars are available, which are assumed to be</span></div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span> <span class="comment">                uncorrelated</span></div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span> <span class="comment"></span></div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span> <span class="comment">                Pseudo code:</span></div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span> <span class="comment"></span></div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span> <span class="comment">                given band B1 and color term C1-C2</span></div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span> <span class="comment"></span></div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span> <span class="comment">                If have ERR_B1 and ERR_C1 and ERR_C2</span></div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span> <span class="comment">                    // Stetson like</span></div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span> <span class="comment">                    B1   + c(C1 - B1)      =  (1-c)B1  + c C1</span></div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span> <span class="comment">                   (1-c)^2errB1^2 + c^2 errC1^2</span></div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span> <span class="comment">                    +errc^2 * (C1-B1)^2</span></div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span> <span class="comment"></span></div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span> <span class="comment">                    B1   + c(B1 - C2)      =  (1+c)B1  - c C2     </span></div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span> <span class="comment"></span></div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span> <span class="comment">                   (1+c)^2errB1^2 + c^2 errC2^2</span></div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span> <span class="comment">                    +errc^2 (B1-C2)^2</span></div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span> <span class="comment"></span></div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span> <span class="comment">                    B1   + c(C1 - C2)</span></div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span> <span class="comment">                    errB1^2 + c^2 errC1^2 + c^2 errC2^2</span></div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span> <span class="comment">                    +errc^2 (C1-C2)^2</span></div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span> <span class="comment"></span></div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span> <span class="comment">                    Special case:</span></div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span> <span class="comment">                    G = V + 0.56*(B-V) - 0.12  (Fukugita et al. 1996, AJ 111, p1748)</span></div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span> <span class="comment"></span></div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span> <span class="comment">                    magG   = G + c*(B-V) = V + (0.56+c)*(B-V) - 0.12</span></div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span> <span class="comment">                           = (1 - 0.56 - c)*V  + (0.56+c)*B - 0.12</span></div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span> <span class="comment"></span></div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span> <span class="comment">                    errG^2 = (1 - 0.56 - c)^2*errV^2  + (0.56+c)^2*errB^2</span></div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span> <span class="comment">                             +errc^2 (B-V)^2</span></div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span> <span class="comment">                else</span></div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span> <span class="comment">                    // Landolt like</span></div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span> <span class="comment">                    magU  = V      +    (B-V)   + (U-B) + c(U-B)</span></div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span> <span class="comment">                    err^2 = errV^2 + err(B-V)^2 + (1+c)^2 err(U-B)^2</span></div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span> <span class="comment">                          + errc^2 (U-B)^2</span></div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span> <span class="comment"></span></div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span> <span class="comment">                    magB  = V      +    (B-V) + c(B-V)</span></div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span> <span class="comment">                    err^2 = errV^2 + (1+c)^2 err(B-V)^2</span></div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span> <span class="comment">                          + errc^2 (B-V)^2</span></div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span> <span class="comment"></span></div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span> <span class="comment">                    magG  = V + (0.56+c)*(B-V) - 0.12  (Fukugita et al. 1996, AJ 111, p1748)</span></div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span> <span class="comment">                    err^2 = errV^2 + (0.56+c)^2*err(B-V)^2</span></div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span> <span class="comment">                          + errc^2 (B-V)^2</span></div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span> <span class="comment"></span></div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span> <span class="comment">                    magV  = V      + c(B-V)</span></div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span> <span class="comment">                    err^2 = errV^2 + c^2 err(B-V)^2</span></div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span> <span class="comment">                          + errc^2 (B-V)^2</span></div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span> <span class="comment"></span></div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span> <span class="comment">                    magR  = V - (V-R) + c (V-R) = V + (c-1)(V-R)</span></div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span> <span class="comment">                    err^2 = errV^2 + (c-1)^2 err(V-R)^2</span></div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span> <span class="comment">                          + errc^2 (V-R)^2</span></div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span> <span class="comment"></span></div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span> <span class="comment">                    magI  = V      -    (V-I)   + c      (V-R)</span></div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span> <span class="comment">                    err^2 = errV^2 + err(V-I)^2 + c^2 err(V-R)^2</span></div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span> <span class="comment">                          + errc^2 (V-R)^2</span></div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span> <span class="comment">            */</span></div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span> </div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>             <span class="comment">/* Find other bands, C1, C2 */</span></div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>             <span class="keyword">const</span> <span class="keywordtype">char</span> *col;<span class="comment">/* =  FORS_DATA_STD_COL[setting->filter];*/</span></div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>             <span class="keywordflow">switch</span> (*B1)</div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>             {</div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>                 <span class="keywordflow">case</span>    <span class="charliteral">'U'</span>: col = <span class="stringliteral">"U_B"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>                 <span class="keywordflow">case</span>    <span class="charliteral">'B'</span>: col = <span class="stringliteral">"B_V"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>                 <span class="keywordflow">case</span>    <span class="charliteral">'G'</span>: col = <span class="stringliteral">"B_V"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>                 <span class="keywordflow">case</span>    <span class="charliteral">'V'</span>: col = <span class="stringliteral">"B_V"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>                 <span class="keywordflow">case</span>    <span class="charliteral">'R'</span>: col = <span class="stringliteral">"V_R"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>                 <span class="keywordflow">case</span>    <span class="charliteral">'I'</span>: col = <span class="stringliteral">"V_R"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>                 <span class="keywordflow">case</span>    <span class="charliteral">'Z'</span>: col = <span class="stringliteral">"?Z?"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>                 <span class="keywordflow">default</span>: col = <span class="stringliteral">""</span>;</div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>             }</div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>             <span class="keywordtype">double</span> coeff = -color_term;  <span class="comment">/* per convention */</span></div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>             <span class="keywordtype">double</span> dcoeff = dcolor_term;</div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span> </div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>             <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( strlen(col) == strlen(<span class="stringliteral">"X_Y"</span>), <span class="keywordflow">return</span> c,</div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>                     <span class="stringliteral">"Color term column must have format 'X_Y', is '%s'"</span>,</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>                     col );</div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>             </div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>             <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( col[1] == <span class="charliteral">'_'</span>, <span class="keywordflow">return</span> c,</div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>                     <span class="stringliteral">"Color term column must have format 'X_Y', is '%s'"</span>,</div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>                     col );</div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>             </div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>             <span class="keywordtype">char</span> C1[2] = {<span class="charliteral">'\0'</span>, <span class="charliteral">'\0'</span>};</div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>             <span class="keywordtype">char</span> C2[2] = {<span class="charliteral">'\0'</span>, <span class="charliteral">'\0'</span>};</div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span> </div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>             *C1 = col[0];</div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>             *C2 = col[2];</div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span> </div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>             ERR_B1 = cpl_sprintf(<span class="stringliteral">"ERR_%s"</span>, B1);</div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>             ERR_C1 = cpl_sprintf(<span class="stringliteral">"ERR_%s"</span>, C1);</div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>             ERR_C2 = cpl_sprintf(<span class="stringliteral">"ERR_%s"</span>, C2);</div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span> </div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>             <span class="comment">/* Catalog data */</span></div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>             <span class="keywordtype">double</span> cat_mag, dcat_mag, color;</div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>             </div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>             <span class="comment">/* Color corrected magnitude */</span></div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>             <span class="keywordtype">double</span> mag, dmag;</div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span> </div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>             <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>             <span class="keywordflow">for</span> (i = 0; i < cpl_table_get_nrow(t); i++) {</div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>                 <span class="keywordflow">if</span> (cpl_table_has_column(t, ERR_B1) &&</div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>                     cpl_table_has_column(t, ERR_C1) &&</div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>                     cpl_table_has_column(t, ERR_C2)) {</div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>                     </div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>                     <span class="comment">/* Stetson, four cases */</span></div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span> <span class="comment">/*                    if (setting->filter == FILTER_G) {*/</span></div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>                     <span class="keywordflow">if</span> (*B1 == <span class="charliteral">'G'</span>) {</div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>                         <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"V"</span>, i) &&</div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>                             cpl_table_is_valid(t, <span class="stringliteral">"B"</span>, i) &&</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>                             cpl_table_is_valid(t, <span class="stringliteral">"ERR_B"</span>, i) &&</div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>                             cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i)) {</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>                             <span class="keywordtype">double</span>     v = cpl_table_get_float(t, <span class="stringliteral">"V"</span>, i, NULL);</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>                             <span class="keywordtype">double</span>     b = cpl_table_get_float(t, <span class="stringliteral">"B"</span>, i, NULL);</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>                             <span class="keywordtype">double</span> err_b = cpl_table_get_float(t, <span class="stringliteral">"ERR_B"</span>, i, NULL);</div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>                             <span class="keywordtype">double</span> err_v = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span> </div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>                             color = b-v;</div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>                             mag     = (1-0.56-coeff) * v + (0.56+coeff)*b - 0.12;</div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>                             cat_mag = (1-0.56      ) * v + (0.56      )*b - 0.12;</div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span> </div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>                             dmag = </div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>                                 sqrt(</div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>                                     (1-0.56-coeff)*(1-0.56-coeff)*err_v*err_v +</div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>                                     (0.56  +coeff)*(0.56  +coeff)*err_b*err_b +</div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>                                     +</div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>                                     dcoeff*dcoeff*color*color);</div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span> </div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>                             dcat_mag = sqrt(</div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>                                 (1-0.56-0)*(1-0.56-0)*err_v*err_v +</div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>                                 (0.56  +0)*(0.56  +0)*err_b*err_b);</div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>                         }</div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>                     }</div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*B1 == *C2) {</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>                         <span class="keywordflow">if</span> (cpl_table_is_valid(t, B1, i) &&</div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>                             cpl_table_is_valid(t, C1, i) &&</div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>                             cpl_table_is_valid(t, ERR_B1, i) &&</div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>                             cpl_table_is_valid(t, ERR_C1, i)) {</div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>                             <span class="keywordtype">double</span>     b1 = cpl_table_get_float(t, B1, i, NULL);</div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>                             <span class="keywordtype">double</span>     c1 = cpl_table_get_float(t, C1, i, NULL);</div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>                             <span class="keywordtype">double</span> err_b1 = cpl_table_get_float(t, ERR_B1, i, NULL);</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>                             <span class="keywordtype">double</span> err_c1 = cpl_table_get_float(t, ERR_C1, i, NULL);</div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span> </div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>                             color = c1-b1;</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span> </div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>                             cat_mag = b1;</div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>                             dcat_mag = err_b1;</div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span> </div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>                             mag = </div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>                                 (1-coeff) * b1</div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>                                 +  coeff  * c1;</div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>                             dmag = </div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>                                 sqrt(</div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>                                     (1-coeff)*(1-coeff)*err_b1*err_b1 +</div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>                                            coeff*coeff *err_c1*err_c1</div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>                                     +</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>                                     dcoeff*dcoeff*color*color);</div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>                         }</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>                         <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>                     }</div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*B1 == *C1) {</div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>                         <span class="keywordflow">if</span> (cpl_table_is_valid(t, B1, i) &&</div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>                             cpl_table_is_valid(t, C2, i) &&</div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>                             cpl_table_is_valid(t, ERR_B1, i) &&</div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>                             cpl_table_is_valid(t, ERR_C2, i)) {</div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>                             <span class="keywordtype">double</span>     b1 = cpl_table_get_float(t, B1, i, NULL);</div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>                             <span class="keywordtype">double</span>     c2 = cpl_table_get_float(t, C2, i, NULL);</div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>                             <span class="keywordtype">double</span> err_b1 = cpl_table_get_float(t, ERR_B1, i, NULL);</div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>                             <span class="keywordtype">double</span> err_c2 = cpl_table_get_float(t, ERR_C2, i, NULL);</div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span> </div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>                             color = b1-c2;</div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>                             </div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>                             cat_mag = b1;</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>                             dcat_mag = err_b1;</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>                             </div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>                             mag = </div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>                                 (1+coeff) * b1</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>                                 -  coeff  * c2;</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>                             dmag = </div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>                                 sqrt(</div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>                                     (1+coeff)*(1+coeff)*err_b1*err_b1 +</div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>                                     coeff*coeff *err_c2*err_c2</div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>                                     +</div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>                                     dcoeff*dcoeff*color*color);</div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span> </div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>                         }</div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>                         <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>                     }</div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>                         <span class="comment">/* All different */</span></div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>                         <span class="keywordflow">if</span> (cpl_table_is_valid(t, B1, i) &&</div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>                             cpl_table_is_valid(t, C1, i) &&</div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>                             cpl_table_is_valid(t, C2, i) &&</div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>                             cpl_table_is_valid(t, ERR_B1, i) &&</div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>                             cpl_table_is_valid(t, ERR_C1, i) &&</div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>                             cpl_table_is_valid(t, ERR_C2, i)) {</div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>                             <span class="keywordtype">double</span>     b1 = cpl_table_get_float(t, B1, i, NULL);</div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>                             <span class="keywordtype">double</span>     c1 = cpl_table_get_float(t, C1, i, NULL);</div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>                             <span class="keywordtype">double</span>     c2 = cpl_table_get_float(t, C2, i, NULL);</div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>                             <span class="keywordtype">double</span> err_b1 = cpl_table_get_float(t, ERR_B1, i, NULL);</div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>                             <span class="keywordtype">double</span> err_c1 = cpl_table_get_float(t, ERR_C1, i, NULL);</div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>                             <span class="keywordtype">double</span> err_c2 = cpl_table_get_float(t, ERR_C2, i, NULL);</div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span> </div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>                             color = c1-c2;</div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span> </div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>                             cat_mag = b1;</div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>                             dcat_mag = err_b1;</div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>                             </div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>                             mag = b1</div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>                                 + coeff * c1</div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>                                 - coeff * c2;</div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>                             dmag = sqrt(</div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>                                 err_b1*err_b1 +</div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>                                 coeff*coeff * err_c1*err_c1 +</div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>                                 coeff*coeff * err_c2*err_c2 +</div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>                                 dcoeff*dcoeff * color*color);</div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>                         }</div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>                         <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>                     }</div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>                 } <span class="comment">/* If stetson, else */</span></div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span> <span class="comment">/*                else if (setting->filter == FILTER_G) {*/</span></div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*B1 == <span class="charliteral">'G'</span>) {</div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"V"</span>, i) &&</div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>                         cpl_table_is_valid(t, <span class="stringliteral">"B_V"</span>, i) &&</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&</div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_B_V"</span>, i)) {</div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>                         <span class="keywordtype">double</span>     v   = cpl_table_get_float(t, <span class="stringliteral">"V"</span>, i, NULL);</div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>                         <span class="keywordtype">double</span>    bv   = cpl_table_get_float(t, <span class="stringliteral">"B_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>                         <span class="keywordtype">double</span> err_v   = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>                         <span class="keywordtype">double</span> err_b_v = cpl_table_get_float(t, <span class="stringliteral">"ERR_B_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span> </div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>                         color = bv;</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span> </div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>                         cat_mag = v + (0.56)*(bv) - 0.12;</div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span> </div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>                         mag  = v + (0.56+coeff)*(bv) - 0.12;</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>                         dmag = </div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>                             sqrt(</div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>                                 err_v*err_v +</div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>                                 (0.56+coeff)*(0.56+coeff)*err_b_v*err_b_v +</div>
+<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>                                 +</div>
+<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>                                 dcoeff*dcoeff*bv*bv);</div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>                         dcat_mag = </div>
+<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>                             sqrt(</div>
+<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>                                 err_v*err_v +</div>
+<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>                                 (0.56)*(0.56)*err_b_v*err_b_v);</div>
+<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>                     }</div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span>                 }</div>
+<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>                 <span class="keywordflow">else</span> <span class="keywordflow">switch</span> (*B1) {</div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>                     <span class="comment">/* Landolt, every band is a special case */</span></div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>                 <span class="keywordflow">case</span> <span class="charliteral">'U'</span>:</div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"U"</span>, i) &&</div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>                         cpl_table_is_valid(t, <span class="stringliteral">"U_B"</span>, i) &&</div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&</div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_B_V"</span>, i) &&</div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_U_B"</span>, i)) {</div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>                         </div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>                         <span class="keywordtype">double</span> err_v  = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>                         <span class="keywordtype">double</span> err_bv = cpl_table_get_float(t, <span class="stringliteral">"ERR_B_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>                         <span class="keywordtype">double</span> err_ub = cpl_table_get_float(t, <span class="stringliteral">"ERR_U_B"</span>, i, NULL);</div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>                         <span class="keywordtype">double</span> ub     = cpl_table_get_float(t, <span class="stringliteral">"U_B"</span>, i, NULL);</div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span> </div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>                         color = ub;</div>
+<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span> </div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>                         cat_mag = cpl_table_get_float(t, <span class="stringliteral">"U"</span>, i, NULL);</div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>                         </div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>                         mag = cat_mag + coeff * ub;</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>                         dmag = sqrt(err_v*err_v + err_bv*err_bv+</div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>                                     (1+coeff)*(1+coeff)*err_ub*err_ub +</div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>                                     dcoeff*dcoeff*ub*ub);</div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>                         </div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>                         dcat_mag = sqrt(err_v*err_v + err_bv*err_bv+</div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>                                         err_ub*err_ub);</div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>                     } </div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>                     <span class="keywordflow">else</span> <span class="keywordflow">continue</span>; <span class="comment">/* to next for(...) iteration */</span></div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>                     <span class="keywordflow">break</span>; <span class="comment">/* out of switch */</span></div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>                 <span class="keywordflow">case</span> <span class="charliteral">'B'</span>:</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"B"</span>, i) &&</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>                         cpl_table_is_valid(t, <span class="stringliteral">"B_V"</span>, i) &&</div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&</div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_B_V"</span>, i)) {</div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>                         </div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>                         <span class="keywordtype">double</span> err_v  = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>                         <span class="keywordtype">double</span> err_bv = cpl_table_get_float(t, <span class="stringliteral">"ERR_B_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>                         <span class="keywordtype">double</span>     bv = cpl_table_get_float(t, <span class="stringliteral">"B_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span> </div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>                         color = bv;</div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>                         cat_mag = cpl_table_get_float(t, <span class="stringliteral">"B"</span>, i, NULL);</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span> </div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>                         mag = cat_mag +</div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>                             coeff * bv;</div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>                         dmag = sqrt(err_v*err_v +</div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>                                     (1+coeff)*(1+coeff)*err_bv*err_bv +</div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>                                     dcoeff*dcoeff*bv*bv);</div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>                         dcat_mag = sqrt(err_v*err_v +</div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>                                         err_bv*err_bv);</div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>                     }</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>                     <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>                 <span class="keywordflow">case</span> <span class="charliteral">'V'</span>:</div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"V"</span>, i) &&</div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>                         cpl_table_is_valid(t, <span class="stringliteral">"B_V"</span>, i) &&</div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&</div>
+<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_B_V"</span>, i)) {</div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>                         </div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>                         <span class="keywordtype">double</span> err_v  = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>                         <span class="keywordtype">double</span> err_bv = cpl_table_get_float(t, <span class="stringliteral">"ERR_B_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>                         <span class="keywordtype">double</span>     bv = cpl_table_get_float(t, <span class="stringliteral">"B_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span> </div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>                         color = bv;</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>                         cat_mag = cpl_table_get_float(t, <span class="stringliteral">"V"</span>, i, NULL);</div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>                         dcat_mag = err_v;</div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>                         </div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>                         mag = cat_mag + coeff * bv;</div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>                         dmag = sqrt(err_v*err_v +</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>                                     coeff*coeff*err_bv*err_bv +</div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>                                     dcoeff*dcoeff*bv*bv);</div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>                     }</div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>                     <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>                 <span class="keywordflow">case</span> <span class="charliteral">'R'</span>:</div>
+<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"R"</span>, i) &&</div>
+<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>                         cpl_table_is_valid(t, <span class="stringliteral">"V_R"</span>, i) &&</div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&</div>
+<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V_R"</span>, i)) {</div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>                         </div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>                         <span class="keywordtype">double</span> err_v  = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>                         <span class="keywordtype">double</span> err_vr = cpl_table_get_float(t, <span class="stringliteral">"ERR_V_R"</span>, i, NULL);</div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>                         <span class="keywordtype">double</span>     vr = cpl_table_get_float(t, <span class="stringliteral">"V_R"</span>, i, NULL);</div>
+<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span> </div>
+<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>                         color = vr;</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>                         cat_mag = cpl_table_get_float(t, <span class="stringliteral">"R"</span>, i, NULL);</div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>                         mag = cat_mag + coeff * vr;</div>
+<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>                         dmag = sqrt(err_v*err_v +</div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>                                     (1-coeff)*(1-coeff)*err_vr*err_vr +</div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>                                     dcoeff*dcoeff*vr*vr);</div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>                         dcat_mag = sqrt(err_v*err_v + err_vr*err_vr);</div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>                     }</div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>                     <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>                 <span class="keywordflow">case</span> <span class="charliteral">'I'</span>:</div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>                     <span class="keywordflow">if</span> (cpl_table_is_valid(t, <span class="stringliteral">"I"</span>, i) &&</div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>                         cpl_table_is_valid(t, <span class="stringliteral">"V_R"</span>, i) &&</div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V"</span>, i) &&</div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V_I"</span>, i) &&</div>
+<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>                         cpl_table_is_valid(t, <span class="stringliteral">"ERR_V_R"</span>, i)) {</div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>                         </div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>                         <span class="keywordtype">double</span> err_v  = cpl_table_get_float(t, <span class="stringliteral">"ERR_V"</span>, i, NULL);</div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>                         <span class="keywordtype">double</span> err_vi = cpl_table_get_float(t, <span class="stringliteral">"ERR_V_I"</span>, i, NULL);</div>
+<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>                         <span class="keywordtype">double</span> err_vr = cpl_table_get_float(t, <span class="stringliteral">"ERR_V_R"</span>, i, NULL);</div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>                         <span class="keywordtype">double</span>     vr = cpl_table_get_float(t, <span class="stringliteral">"V_R"</span>, i, NULL);</div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span> </div>
+<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span>                         color = vr;</div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>                         cat_mag = cpl_table_get_float(t, <span class="stringliteral">"I"</span>, i, NULL);</div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>                         mag = cat_mag + coeff * vr;</div>
+<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>                         dmag = sqrt(err_v*err_v + err_vi*err_vi+</div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>                                     coeff*coeff*err_vr*err_vr +</div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>                                     dcoeff*dcoeff*vr*vr);</div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>                         dcat_mag = sqrt(err_v*err_v + err_vi*err_vi);</div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>                     }</div>
+<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>                     <span class="keywordflow">else</span> <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>                 <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>                     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span> c, </div>
+<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>                             <span class="stringliteral">"Unknown filter: %s"</span>, B1);</div>
+<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>                 }</div>
+<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span>                 </div>
+<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>                 <span class="keywordtype">double</span> ra = cpl_table_get_double(t, FORS_DATA_STD_RA,</div>
+<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span>                                                  i, NULL);</div>
+<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>                 <span class="keywordtype">double</span> dec = cpl_table_get_double(t, FORS_DATA_STD_DEC,</div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>                                                   i, NULL);</div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span> </div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *std_name = cpl_table_get_string(t, FORS_DATA_STD_NAME,</div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>                                                             i);</div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>                 </div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>                 fors_std_star_list_insert(</div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>                     c, fors_std_star_new(ra, dec, mag, dmag, </div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>                                          cat_mag, dcat_mag,</div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>                                          color, -1, -1, std_name));</div>
+<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span> </div>
+<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span>             } <span class="comment">/* for each table row */</span></div>
+<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span> </div>
+<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span> <span class="preprocessor">#if 0  </span><span class="comment">/* This is old code which removes doublets but is slow (O(n^2)),</span></div>
+<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span> <span class="comment">        * Doublets will be removed during identification, after</span></div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span> <span class="comment">        * selecting the (relatively few) stars that fall inside the CCD</span></div>
+<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span> <span class="comment">        */</span><span class="preprocessor"></span></div>
+<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span> <span class="preprocessor"></span>                    <span class="keywordtype">double</span> nearest_dist;</div>
+<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>                     <span class="keywordflow">if</span> (fors_std_star_list_size(c) > 0) {</div>
+<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>                         fors_std_star *nearest = fors_std_star_list_min_val(</div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>                             c,</div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>                             (fors_std_star_list_func_eval)</div>
+<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>                             fors_std_star_dist_arcsec,</div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>                             std);</div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>                         </div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>                         nearest_dist = fors_std_star_dist_arcsec(std, nearest);</div>
+<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>                         cpl_msg_debug(cpl_func, <span class="stringliteral">"min dist = %f arcseconds"</span>,</div>
+<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>                                       nearest_dist);</div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>                     }</div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>                     </div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>                     <span class="keywordflow">if</span> (fors_std_star_list_size(c) == 0 || nearest_dist > 5) {</div>
+<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>                         fors_std_star_list_insert(c, std);</div>
+<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>                     }</div>
+<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>                         fors_std_star_delete(&std);</div>
+<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>                     }</div>
+<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span> <span class="preprocessor"></span>        } <span class="comment">/* if has column B1 */</span></div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>             cpl_msg_info(cpl_func, <span class="stringliteral">"Skipping catalog %s, no column %s"</span>,</div>
+<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>                          filename, B1);</div>
+<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>         }</div>
+<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>     } <span class="comment">/* for each frame */</span></div>
+<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>     </div>
+<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Found %d catalogue standards"</span>,</div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>                  fors_std_star_list_size(c));</div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span> </div>
+<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>     <span class="comment">/* fors_std_cat_print(c); */</span></div>
+<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span> </div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>     cleanup;</div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>     <span class="keywordflow">return</span> c;</div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__std__cat_8h-source.html b/html/fors__std__cat_8h-source.html
deleted file mode 100644
index a8b7f2a..0000000
--- a/html/fors__std__cat_8h-source.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_std_cat.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_std_cat.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_std_cat.h,v 1.11 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.11 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_STD_CAT_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_STD_CAT_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_std_star.h></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *FORS_STD_CAT_COLUMN_RA;
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *FORS_STD_CAT_COLUMN_DEC;
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *FORS_STD_CAT_COLUMN_NAME;
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 fors_std_star_list *
-<a name="l00039"></a>00039 fors_std_cat_load(                          <span class="keyword">const</span> cpl_frameset  *cat_frames,
-<a name="l00040"></a>00040                                             <span class="keywordtype">char</span>            band,
-<a name="l00041"></a>00041                                             <span class="keywordtype">bool</span>            require_all_frames,
-<a name="l00042"></a>00042                                             <span class="keywordtype">double</span>          color_term,
-<a name="l00043"></a>00043                                             <span class="keywordtype">double</span>          dcolor_term);
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 fors_std_star_list *
-<a name="l00046"></a>00046 fors_std_cat_load_old(                      <span class="keyword">const</span> cpl_frameset *cat_frames,
-<a name="l00047"></a>00047                                             <span class="comment">/*const fors_setting *setting,*/</span>
-<a name="l00048"></a>00048                                             <span class="keywordtype">char</span>  optical_band,
-<a name="l00049"></a>00049                                             <span class="keywordtype">double</span> color_term,
-<a name="l00050"></a>00050                                             <span class="keywordtype">double</span> dcolor_term);
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="preprocessor">#endif  </span><span class="comment">/* FORS_STD_CAT_H */</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__std__cat_8h_source.html b/html/fors__std__cat_8h_source.html
new file mode 100644
index 0000000..04538fb
--- /dev/null
+++ b/html/fors__std__cat_8h_source.html
@@ -0,0 +1,113 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_std_cat.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_std_cat.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_std_cat.h,v 1.13 2013-09-10 15:19:58 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 15:19:58 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.13 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_STD_CAT_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_STD_CAT_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_std_star.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *FORS_STD_CAT_COLUMN_RA;</div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *FORS_STD_CAT_COLUMN_DEC;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *FORS_STD_CAT_COLUMN_NAME;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> fors_std_star_list *</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> fors_std_cat_load(                          <span class="keyword">const</span> cpl_frameset  *cat_frames,</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>                                             <span class="keywordtype">char</span>            band,</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>                                             <span class="keywordtype">bool</span>            require_all_frames,</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>                                             <span class="keywordtype">double</span>          color_term,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>                                             <span class="keywordtype">double</span>          dcolor_term);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> fors_std_star_list *</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> fors_std_cat_load_old(                      <span class="keyword">const</span> cpl_frameset *cat_frames,</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>                                             <span class="comment">/*const fors_setting *setting,*/</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>                                             <span class="keywordtype">char</span>  optical_band,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>                                             <span class="keywordtype">double</span> color_term,</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>                                             <span class="keywordtype">double</span> dcolor_term);</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#endif  </span><span class="comment">/* FORS_STD_CAT_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__std__star-test_8c-source.html b/html/fors__std__star-test_8c-source.html
deleted file mode 100644
index 4541d9a..0000000
--- a/html/fors__std__star-test_8c-source.html
+++ /dev/null
@@ -1,186 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_std_star-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_std_star-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_std_star-test.c,v 1.22 2009/03/26 20:23:48 hlorch Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: hlorch $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/03/26 20:23:48 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.22 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_data.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_instrument.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_std_cat.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <test.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <math.h></span>
-<a name="l00042"></a>00042 
-<a name="l00050"></a>00050 <span class="preprocessor">#undef cleanup</span>
-<a name="l00051"></a><a class="code" href="group__fors__std__cat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">do { \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">    cpl_frameset_delete(cat_frames); \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">    cpl_frame_delete(raw_frame); \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">    cpl_frame_delete(phot_table); \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</span>
-<a name="l00057"></a>00057 <span class="preprocessor">    fors_setting_delete(&setting); \</span>
-<a name="l00058"></a>00058 <span class="preprocessor">    cpl_propertylist_delete(raw_header); raw_header = NULL; \</span>
-<a name="l00059"></a>00059 <span class="preprocessor">} while (0)</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span>
-<a name="l00064"></a>00064 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00065"></a><a class="code" href="group__fors__std__cat__test.html#g1ca49c9c9cec515e2178eb9be5326843">00065</a> <a class="code" href="group__fors__std__cat__test.html#g1ca49c9c9cec515e2178eb9be5326843">test_new</a>(<span class="keywordtype">void</span>)
-<a name="l00066"></a>00066 {
-<a name="l00067"></a>00067     cpl_frameset *cat_frames = NULL;
-<a name="l00068"></a>00068     cpl_frame *phot_table = NULL;
-<a name="l00069"></a>00069     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename = <span class="stringliteral">"std_cat.fits"</span>;
-<a name="l00070"></a>00070     fors_std_star_list *cat = NULL;
-<a name="l00071"></a>00071     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00072"></a>00072     cpl_propertylist    *raw_header = NULL;
-<a name="l00073"></a>00073     <span class="keywordtype">double</span> color_term, dcolor_term;
-<a name="l00074"></a>00074     <span class="keywordtype">double</span> ext_coeff, dext_coeff;
-<a name="l00075"></a>00075     <span class="keywordtype">double</span> expected_zeropoint, dexpected_zeropoint;
-<a name="l00076"></a>00076     <span class="keywordtype">char</span>    band;
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078     <span class="comment">/* Simulate */</span>
-<a name="l00079"></a>00079     cpl_frame *raw_frame = <a class="code" href="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b">create_standard</a>(<span class="stringliteral">"std_cat_raw.fits"</span>, 
-<a name="l00080"></a>00080                                            STANDARD_IMG, CPL_FRAME_GROUP_RAW);
-<a name="l00081"></a>00081     
-<a name="l00082"></a>00082     phot_table = <a class="code" href="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5">create_phot_table</a>(<span class="stringliteral">"std_cat_phot_table.fits"</span>,
-<a name="l00083"></a>00083                                    PHOT_TABLE, CPL_FRAME_GROUP_CALIB);
-<a name="l00084"></a>00084     
-<a name="l00085"></a>00085     cat_frames = cpl_frameset_new();
-<a name="l00086"></a>00086     cpl_frameset_insert(cat_frames,
-<a name="l00087"></a>00087                         <a class="code" href="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410">create_std_cat</a>(filename, 
-<a name="l00088"></a>00088                                        FLX_STD_IMG, CPL_FRAME_GROUP_CALIB));
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(raw_frame);
-<a name="l00091"></a>00091 
-<a name="l00092"></a>00092     fors_phot_table_load(phot_table, setting,
-<a name="l00093"></a>00093                          &color_term, &dcolor_term,
-<a name="l00094"></a>00094              &ext_coeff, &dext_coeff,
-<a name="l00095"></a>00095              &expected_zeropoint, &dexpected_zeropoint);
-<a name="l00096"></a>00096     
-<a name="l00097"></a>00097     <span class="comment">/* Call function */</span>
-<a name="l00098"></a>00098     band = fors_instrument_filterband_get_by_setting(setting);
-<a name="l00099"></a>00099     cat = fors_std_cat_load(                cat_frames,
-<a name="l00100"></a>00100                                             band,
-<a name="l00101"></a>00101                                             0,
-<a name="l00102"></a>00102                                             color_term,
-<a name="l00103"></a>00103                                             dcolor_term);
-<a name="l00104"></a>00104     raw_header = cpl_propertylist_load(cpl_frame_get_filename(raw_frame), 0);
-<a name="l00105"></a>00105     fors_std_star_list_apply_wcs(cat, raw_header);
-<a name="l00106"></a>00106     
-<a name="l00107"></a>00107     <span class="comment">/* Test results (TBI) */</span>
-<a name="l00108"></a>00108     
-<a name="l00109"></a>00109     fors_std_star_print_list(CPL_MSG_DEBUG, cat);
-<a name="l00110"></a>00110     fors_std_star_print_list(CPL_MSG_INFO, cat);
-<a name="l00111"></a>00111 
-<a name="l00112"></a>00112     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00113"></a>00113     <span class="keywordflow">return</span>;
-<a name="l00114"></a>00114 }
-<a name="l00115"></a>00115 
-<a name="l00116"></a>00116 
-<a name="l00117"></a>00117 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00118"></a><a class="code" href="group__fors__std__cat__test.html#g3cfcd4957686b7530076c681cf27c2fe">00118</a> <a class="code" href="group__fors__std__cat__test.html#g3cfcd4957686b7530076c681cf27c2fe">test_dist</a>(<span class="keywordtype">void</span>)
-<a name="l00119"></a>00119 {
-<a name="l00120"></a>00120     <span class="keywordtype">double</span> ra  = 34.5;
-<a name="l00121"></a>00121     <span class="keywordtype">double</span> dec = -0.4;
-<a name="l00122"></a>00122     <span class="keywordtype">double</span> mag = 15;
-<a name="l00123"></a>00123     <span class="keywordtype">double</span> dmag = 0.51;
-<a name="l00124"></a>00124     <span class="keywordtype">double</span> cmag = 15.2;
-<a name="l00125"></a>00125     <span class="keywordtype">double</span> dcmag = 0.21;
-<a name="l00126"></a>00126     <span class="keywordtype">double</span> color = 0.2;
-<a name="l00127"></a>00127     <span class="keywordtype">double</span> dcolor = dcmag;
-<a name="l00128"></a>00128     <span class="keywordtype">double</span> cov_catm_col = dcolor;
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130     <span class="keywordtype">double</span> shift_arcsecs;
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="keywordflow">for</span> (shift_arcsecs = 0.1; shift_arcsecs <= 100; shift_arcsecs *= 2) {
-<a name="l00133"></a>00133         
-<a name="l00134"></a>00134         fors_std_star *s = fors_std_star_new(ra, dec, mag, dmag, 
-<a name="l00135"></a>00135                          cmag, dcmag,
-<a name="l00136"></a>00136                          color, dcolor,
-<a name="l00137"></a>00137                          cov_catm_col,
-<a name="l00138"></a>00138                          <span class="stringliteral">"some"</span>);
-<a name="l00139"></a>00139         fors_std_star *t = fors_std_star_new(ra  + shift_arcsecs/3600,
-<a name="l00140"></a>00140                                              dec + shift_arcsecs/3600,
-<a name="l00141"></a>00141                                              mag, dmag, 
-<a name="l00142"></a>00142                          cmag, dcmag,
-<a name="l00143"></a>00143                          color, dcolor,
-<a name="l00144"></a>00144                          cov_catm_col,
-<a name="l00145"></a>00145                          <span class="stringliteral">"star"</span>);
-<a name="l00146"></a>00146         
-<a name="l00147"></a>00147         <span class="comment">/* At arcsecond scale and DEC ~= 0, RA and DEC directions</span>
-<a name="l00148"></a>00148 <span class="comment">           are very perpendicular, so</span>
-<a name="l00149"></a>00149 <span class="comment">           expect distance = sqrt(2) * shift_arcsecs </span>
-<a name="l00150"></a>00150 <span class="comment">        */</span>
-<a name="l00151"></a>00151         test_rel( fors_std_star_dist_arcsec(s, t), sqrt(2)*shift_arcsecs, 0.01 );
-<a name="l00152"></a>00152         
-<a name="l00153"></a>00153         fors_std_star_delete(&s);
-<a name="l00154"></a>00154         fors_std_star_delete(&t);
-<a name="l00155"></a>00155     }
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157     <span class="keywordflow">return</span>;
-<a name="l00158"></a>00158 }
-<a name="l00159"></a>00159 
-<a name="l00163"></a><a class="code" href="group__fors__std__cat__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00163</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00164"></a>00164 {
-<a name="l00165"></a>00165     TEST_INIT;
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span>
-<a name="l00168"></a>00168     <a class="code" href="group__fors__std__cat__test.html#g1ca49c9c9cec515e2178eb9be5326843">test_new</a>();
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170     <a class="code" href="group__fors__std__cat__test.html#g1ca49c9c9cec515e2178eb9be5326843">test_new</a>();  <span class="comment">/* The second call tests the reentrancy of WCSLIB and flex,</span>
-<a name="l00171"></a>00171 <span class="comment">                    which is non-trivial */</span>
-<a name="l00172"></a>00172 
-<a name="l00173"></a>00173     <a class="code" href="group__fors__std__cat__test.html#g3cfcd4957686b7530076c681cf27c2fe">test_dist</a>();
-<a name="l00174"></a>00174 
-<a name="l00175"></a>00175     TEST_END;
-<a name="l00176"></a>00176 }
-<a name="l00177"></a>00177 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__std__star-test_8c_source.html b/html/fors__std__star-test_8c_source.html
new file mode 100644
index 0000000..e4d8747
--- /dev/null
+++ b/html/fors__std__star-test_8c_source.html
@@ -0,0 +1,225 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_std_star-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_std_star-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_std_star-test.c,v 1.22 2009-03-26 20:23:48 hlorch Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: hlorch $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009-03-26 20:23:48 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.22 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_data.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_instrument.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_std_cat.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">    cpl_frameset_delete(cat_frames); \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">    cpl_frame_delete(raw_frame); \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">    cpl_frame_delete(phot_table); \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">    cpl_propertylist_delete(raw_header); raw_header = NULL; \</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="group__fors__std__cat__test.html#ga47ae58a634c68c2d37cf5f90ac247fa5">   65</a></span> <a class="code" href="group__fors__std__cat__test.html#ga47ae58a634c68c2d37cf5f90ac247fa5" title="Test loading catalogue.">test_new</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> {</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     cpl_frameset *cat_frames = NULL;</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     cpl_frame *phot_table = NULL;</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *filename = <span class="stringliteral">"std_cat.fits"</span>;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     fors_std_star_list *cat = NULL;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     cpl_propertylist    *raw_header = NULL;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     <span class="keywordtype">double</span> color_term, dcolor_term;</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     <span class="keywordtype">double</span> ext_coeff, dext_coeff;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     <span class="keywordtype">double</span> expected_zeropoint, dexpected_zeropoint;</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="keywordtype">char</span>    band;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <span class="comment">/* Simulate */</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_frame *raw_frame = <a class="code" href="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164" title="Create standard star image.">create_standard</a>(<span class="stringliteral">"std_cat_raw.fits"</span>, </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                                            STANDARD_IMG, CPL_FRAME_GROUP_RAW);</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>     </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     phot_table = <a class="code" href="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b" title="Create photometry table.">create_phot_table</a>(<span class="stringliteral">"std_cat_phot_table.fits"</span>,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                                    PHOT_TABLE, CPL_FRAME_GROUP_CALIB);</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     cat_frames = cpl_frameset_new();</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     cpl_frameset_insert(cat_frames,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                         <a class="code" href="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3" title="Create standard star catalogue.">create_std_cat</a>(filename, </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                                        FLX_STD_IMG, CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(raw_frame);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     fors_phot_table_load(phot_table, setting,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                          &color_term, &dcolor_term,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>              &ext_coeff, &dext_coeff,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>              &expected_zeropoint, &dexpected_zeropoint);</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <span class="comment">/* Call function */</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     band = fors_instrument_filterband_get_by_setting(setting);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     cat = fors_std_cat_load(                cat_frames,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                                             band,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                                             0,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                                             color_term,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                                             dcolor_term);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     raw_header = cpl_propertylist_load(cpl_frame_get_filename(raw_frame), 0);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     fors_std_star_list_apply_wcs(cat, raw_header);</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="comment">/* Test results (TBI) */</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     fors_std_star_print_list(CPL_MSG_DEBUG, cat);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     fors_std_star_print_list(CPL_MSG_INFO, cat);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     cleanup;</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> }</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> </div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> test_dist(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> {</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="keywordtype">double</span> ra  = 34.5;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="keywordtype">double</span> dec = -0.4;</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="keywordtype">double</span> mag = 15;</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="keywordtype">double</span> dmag = 0.51;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="keywordtype">double</span> cmag = 15.2;</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="keywordtype">double</span> dcmag = 0.21;</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="keywordtype">double</span> color = 0.2;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     <span class="keywordtype">double</span> dcolor = dcmag;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordtype">double</span> cov_catm_col = dcolor;</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     <span class="keywordtype">double</span> shift_arcsecs;</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="keywordflow">for</span> (shift_arcsecs = 0.1; shift_arcsecs <= 100; shift_arcsecs *= 2) {</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>         </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         fors_std_star *s = fors_std_star_new(ra, dec, mag, dmag, </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                          cmag, dcmag,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                          color, dcolor,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                          cov_catm_col,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                          <span class="stringliteral">"some"</span>);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>         fors_std_star *t = fors_std_star_new(ra  + shift_arcsecs/3600,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                                              dec + shift_arcsecs/3600,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                                              mag, dmag, </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                          cmag, dcmag,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                          color, dcolor,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                          cov_catm_col,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                          <span class="stringliteral">"star"</span>);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>         </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>         <span class="comment">/* At arcsecond scale and DEC ~= 0, RA and DEC directions</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="comment">           are very perpendicular, so</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="comment">           expect distance = sqrt(2) * shift_arcsecs </span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>         test_rel( fors_std_star_dist_arcsec(s, t), sqrt(2)*shift_arcsecs, 0.01 );</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>         </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>         fors_std_star_delete(&s);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>         fors_std_star_delete(&t);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     }</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> }</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno"><a class="code" href="group__fors__std__cat__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  163</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> {</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     TEST_INIT;</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <a class="code" href="group__fors__std__cat__test.html#ga47ae58a634c68c2d37cf5f90ac247fa5" title="Test loading catalogue.">test_new</a>();</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     <a class="code" href="group__fors__std__cat__test.html#ga47ae58a634c68c2d37cf5f90ac247fa5" title="Test loading catalogue.">test_new</a>();  <span class="comment">/* The second call tests the reentrancy of WCSLIB and flex,</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="comment">                    which is non-trivial */</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     test_dist();</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     TEST_END;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__std__star_8c-source.html b/html/fors__std__star_8c-source.html
deleted file mode 100644
index d1639a0..0000000
--- a/html/fors__std__star_8c-source.html
+++ /dev/null
@@ -1,470 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_std_star.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_std_star.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_std_star.c,v 1.20 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.20 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_star.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include <math.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <assert.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <float.h></span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00043"></a>00043 <span class="comment">    Prototypes</span>
-<a name="l00044"></a>00044 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="keyword">static</span>
-<a name="l00047"></a>00047 <span class="keywordtype">double</span>          <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(  <span class="keyword">const</span> cpl_table *tab,
-<a name="l00048"></a>00048                                             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,
-<a name="l00049"></a>00049                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *colname);
-<a name="l00050"></a>00050 <span class="keyword">static</span>
-<a name="l00051"></a>00051 <span class="keywordtype">double</span>          _square(                    <span class="keywordtype">double</span>  a);
-<a name="l00052"></a>00052 
-<a name="l00053"></a>00053 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00054"></a>00054 <span class="comment">    Private Implementation</span>
-<a name="l00055"></a>00055 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00058"></a>00058 <span class="preprocessor">#undef cleanup</span>
-<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span>
-<a name="l00066"></a>00066 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00067"></a>00067 <span class="keyword">static</span>
-<a name="l00068"></a>00068 <span class="keywordtype">double</span>          <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(  <span class="keyword">const</span> cpl_table *tab,
-<a name="l00069"></a>00069                                             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,
-<a name="l00070"></a>00070                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *colname)
-<a name="l00071"></a>00071 {
-<a name="l00072"></a>00072     <span class="keywordtype">int</span>             null;
-<a name="l00073"></a>00073     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00074"></a>00074     cpl_error_code  errc;
-<a name="l00075"></a>00075     
-<a name="l00076"></a>00076     <span class="keywordflow">if</span> (colname != NULL && colname[0] != <span class="charliteral">'\0'</span>)
-<a name="l00077"></a>00077     {
-<a name="l00078"></a>00078         <span class="keywordtype">double</span>  d;
-<a name="l00079"></a>00079         d = cpl_table_get(                  tab, colname, row, &null);
-<a name="l00080"></a>00080         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))
-<a name="l00081"></a>00081         {
-<a name="l00082"></a>00082             <span class="keywordflow">switch</span> (errc = cpl_error_get_code())
-<a name="l00083"></a>00083             {
-<a name="l00084"></a>00084                 <span class="keywordflow">case</span> CPL_ERROR_DATA_NOT_FOUND:
-<a name="l00085"></a>00085                     cpl_error_set_message(  cpl_func,
-<a name="l00086"></a>00086                                             errc,
-<a name="l00087"></a>00087                                             <span class="stringliteral">"Column \"%s\" not found"</span>,
-<a name="l00088"></a>00088                                             colname);
-<a name="l00089"></a>00089                     <span class="keywordflow">break</span>;
-<a name="l00090"></a>00090                 <span class="keywordflow">case</span> CPL_ERROR_INVALID_TYPE:
-<a name="l00091"></a>00091                     cpl_error_set_message(  cpl_func,
-<a name="l00092"></a>00092                                             errc,
-<a name="l00093"></a>00093                                             <span class="stringliteral">"Column \"%s\" is not numeric"</span>,
-<a name="l00094"></a>00094                                             colname);
-<a name="l00095"></a>00095                     <span class="keywordflow">break</span>;
-<a name="l00096"></a>00096                 <span class="keywordflow">default</span>:    <span class="keywordflow">break</span>;
-<a name="l00097"></a>00097             }
-<a name="l00098"></a>00098             <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00099"></a>00099         }
-<a name="l00100"></a>00100         <span class="keywordflow">else</span>
-<a name="l00101"></a>00101         {
-<a name="l00102"></a>00102             <span class="keywordflow">return</span> d;
-<a name="l00103"></a>00103         }
-<a name="l00104"></a>00104     }
-<a name="l00105"></a>00105     
-<a name="l00106"></a>00106     {
-<a name="l00107"></a>00107         <span class="keywordtype">int</span> n;
-<a name="l00108"></a>00108         <span class="keyword">union </span>_nant {
-<a name="l00109"></a>00109             <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>   bytes[8];
-<a name="l00110"></a>00110             <span class="keywordtype">double</span>          val;
-<a name="l00111"></a>00111         } nan;
-<a name="l00112"></a>00112         <span class="keywordflow">for</span> (n = 0; n < 8; n++)
-<a name="l00113"></a>00113             nan.bytes[n] = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>)255;
-<a name="l00114"></a>00114         <span class="keywordflow">return</span> nan.val;
-<a name="l00115"></a>00115     }
-<a name="l00116"></a>00116 }
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00124"></a>00124 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00125"></a>00125 <span class="keyword">static</span>
-<a name="l00126"></a>00126 <span class="keywordtype">double</span>          _square(                    <span class="keywordtype">double</span>  a)
-<a name="l00127"></a>00127 {
-<a name="l00128"></a>00128     <span class="keywordflow">return</span>  a*a;
-<a name="l00129"></a>00129 }
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00133"></a>00133 <span class="comment">    Implementation</span>
-<a name="l00134"></a>00134 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00137"></a>00137 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00138"></a>00138 <span class="preprocessor">#undef cleanup</span>
-<a name="l00139"></a>00139 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00140"></a>00140 <span class="preprocessor">do { \</span>
-<a name="l00141"></a>00141 <span class="preprocessor">   cpl_table_delete(t); \</span>
-<a name="l00142"></a>00142 <span class="preprocessor">} while(0)</span>
-<a name="l00143"></a>00143 <span class="preprocessor"></span>
-<a name="l00144"></a>00144 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00161"></a>00161 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00162"></a>00162 fors_std_star   *fors_std_star_new(         <span class="keywordtype">double</span> ra, <span class="keywordtype">double</span> dec,
-<a name="l00163"></a>00163                                             <span class="keywordtype">double</span> m, <span class="keywordtype">double</span> dm,
-<a name="l00164"></a>00164                                             <span class="keywordtype">double</span> cat_m, <span class="keywordtype">double</span> dcat_m,
-<a name="l00165"></a>00165                                             <span class="keywordtype">double</span> col, <span class="keywordtype">double</span> dcol,
-<a name="l00166"></a>00166                                             <span class="keywordtype">double</span> cov_catm_col,
-<a name="l00167"></a>00167                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *name)
-<a name="l00168"></a>00168 {
-<a name="l00169"></a>00169     fors_std_star *s = cpl_malloc(<span class="keyword">sizeof</span>(*s));
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171     s->ra               = ra;
-<a name="l00172"></a>00172     s->dec              = dec;
-<a name="l00173"></a>00173     s->magnitude        = m;
-<a name="l00174"></a>00174     s->dmagnitude       = dm;
-<a name="l00175"></a>00175     s->cat_magnitude    = cat_m;
-<a name="l00176"></a>00176     s->dcat_magnitude   = dcat_m;
-<a name="l00177"></a>00177     s->color            = col;
-<a name="l00178"></a>00178     s->dcolor           = dcol;
-<a name="l00179"></a>00179     s->cov_catm_color   = cov_catm_col;
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181     s->pixel     = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(-1, -1);
-<a name="l00182"></a>00182     
-<a name="l00183"></a>00183     <span class="keywordflow">if</span> (name != NULL) {
-<a name="l00184"></a>00184         s->name = cpl_strdup(name);
-<a name="l00185"></a>00185     }
-<a name="l00186"></a>00186     <span class="keywordflow">else</span> {
-<a name="l00187"></a>00187         s->name = NULL;
-<a name="l00188"></a>00188     }
-<a name="l00189"></a>00189     
-<a name="l00190"></a>00190     s->trusted = <span class="keyword">true</span>;
-<a name="l00191"></a>00191     
-<a name="l00192"></a>00192     <span class="keywordflow">return</span> s;
-<a name="l00193"></a>00193 }
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00196"></a>00196 <span class="preprocessor">#undef cleanup</span>
-<a name="l00197"></a>00197 <span class="preprocessor"></span><span class="preprocessor">#define cleanup fors_std_star_delete(&s)</span>
-<a name="l00198"></a>00198 <span class="preprocessor"></span>
-<a name="l00228"></a>00228 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00229"></a>00229 fors_std_star   *fors_std_star_new_from_table(
-<a name="l00230"></a>00230                                             <span class="keyword">const</span> cpl_table *tab,
-<a name="l00231"></a>00231                                             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,
-<a name="l00232"></a>00232                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *ra_col,
-<a name="l00233"></a>00233                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dec_col,
-<a name="l00234"></a>00234                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *mag_col,
-<a name="l00235"></a>00235                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dmag_col,
-<a name="l00236"></a>00236                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *catmag_col,
-<a name="l00237"></a>00237                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dcatmag_col,
-<a name="l00238"></a>00238                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *color_col,
-<a name="l00239"></a>00239                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dcolor_col,
-<a name="l00240"></a>00240                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *cov_catm_color_col,
-<a name="l00241"></a>00241                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *x_col,
-<a name="l00242"></a>00242                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *y_col,
-<a name="l00243"></a>00243                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *name_col)
-<a name="l00244"></a>00244 {
-<a name="l00245"></a>00245     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l00246"></a>00246     <span class="keywordtype">double</span>          x,
-<a name="l00247"></a>00247                     y;
-<a name="l00248"></a>00248     
-<a name="l00249"></a>00249     fors_std_star *s = cpl_malloc(<span class="keyword">sizeof</span>(*s));
-<a name="l00250"></a>00250     s->name = NULL; <span class="comment">/* assign this before calling assure (that calls delete) */</span>
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252     s->ra =                     <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, ra_col);
-<a name="l00253"></a>00253     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);
-<a name="l00254"></a>00254     s->dec =                    <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, dec_col);
-<a name="l00255"></a>00255     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);
-<a name="l00256"></a>00256     s->magnitude =              <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, mag_col);
-<a name="l00257"></a>00257     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);
-<a name="l00258"></a>00258     s->dmagnitude =             <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, dmag_col);
-<a name="l00259"></a>00259     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);
-<a name="l00260"></a>00260     s->cat_magnitude  =       <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, catmag_col);
-<a name="l00261"></a>00261     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);
-<a name="l00262"></a>00262     s->dcat_magnitude =       <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, dcatmag_col);
-<a name="l00263"></a>00263     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);
-<a name="l00264"></a>00264     s->color =                  <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, color_col);
-<a name="l00265"></a>00265     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);
-<a name="l00266"></a>00266     s->dcolor =                 <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, dcolor_col);
-<a name="l00267"></a>00267     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);
-<a name="l00268"></a>00268     s->cov_catm_color =         <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row,
-<a name="l00269"></a>00269                                             cov_catm_color_col);
-<a name="l00270"></a>00270     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);
-<a name="l00271"></a>00271     
-<a name="l00272"></a>00272     x = <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, x_col);
-<a name="l00273"></a>00273     y = <a class="code" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a>(tab, row, y_col);
-<a name="l00274"></a>00274     s->pixel = <a class="code" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a>(  (isnan(x) ? -1 : x),
-<a name="l00275"></a>00275                                 (isnan(y) ? -1 : y));
-<a name="l00276"></a>00276     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);
-<a name="l00277"></a>00277     <span class="keywordflow">if</span> (s->pixel->x < 1) s->pixel->x = -1;
-<a name="l00278"></a>00278     <span class="keywordflow">if</span> (s->pixel->y < 1) s->pixel->y = -1;
-<a name="l00279"></a>00279     
-<a name="l00280"></a>00280     s->name = NULL;
-<a name="l00281"></a>00281     <span class="keywordflow">if</span> (name_col != NULL)
-<a name="l00282"></a>00282     {
-<a name="l00283"></a>00283         <span class="keyword">const</span> <span class="keywordtype">char</span>  *str;
-<a name="l00284"></a>00284         str = cpl_table_get_string(tab, name_col, row);
-<a name="l00285"></a>00285         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))
-<a name="l00286"></a>00286         {
-<a name="l00287"></a>00287             cpl_error_code  errc;
-<a name="l00288"></a>00288             <span class="keywordflow">switch</span> (errc = cpl_error_get_code())
-<a name="l00289"></a>00289             {
-<a name="l00290"></a>00290                 <span class="keywordflow">case</span> CPL_ERROR_DATA_NOT_FOUND:
-<a name="l00291"></a>00291                     cpl_error_set_message(  cpl_func,
-<a name="l00292"></a>00292                                             errc,
-<a name="l00293"></a>00293                                             <span class="stringliteral">"Column \"%s\" not found"</span>,
-<a name="l00294"></a>00294                                             name_col);
-<a name="l00295"></a>00295                     <span class="keywordflow">break</span>;
-<a name="l00296"></a>00296                 <span class="keywordflow">case</span> CPL_ERROR_INVALID_TYPE:
-<a name="l00297"></a>00297                     cpl_error_set_message(  cpl_func,
-<a name="l00298"></a>00298                                             errc,
-<a name="l00299"></a>00299                                             <span class="stringliteral">"Column \"%s\" is not string type"</span>,
-<a name="l00300"></a>00300                                             name_col);
-<a name="l00301"></a>00301                     <span class="keywordflow">break</span>;
-<a name="l00302"></a>00302                 <span class="keywordflow">default</span>:    <span class="keywordflow">break</span>;
-<a name="l00303"></a>00303             }
-<a name="l00304"></a>00304             <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00305"></a>00305             <span class="keywordflow">return</span> s;
-<a name="l00306"></a>00306         }
-<a name="l00307"></a>00307         <span class="keywordflow">if</span> (str != NULL)
-<a name="l00308"></a>00308             s->name = cpl_strdup(str);
-<a name="l00309"></a>00309     }
-<a name="l00310"></a>00310     
-<a name="l00311"></a>00311     s->trusted = <span class="keyword">true</span>;
-<a name="l00312"></a>00312     
-<a name="l00313"></a>00313     <span class="keywordflow">return</span> s;
-<a name="l00314"></a>00314 }
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00321"></a>00321 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00322"></a>00322 <span class="keywordtype">void</span>            fors_std_star_delete(       fors_std_star **s){
-<a name="l00323"></a>00323     <span class="keywordflow">if</span> (s && *s) {
-<a name="l00324"></a>00324         <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>(&(*s)->pixel);
-<a name="l00325"></a>00325         <span class="keywordflow">if</span> ((*s)->name != NULL) {
-<a name="l00326"></a>00326             cpl_free((<span class="keywordtype">void</span> *)(*s)->name); (*s)->name = NULL;
-<a name="l00327"></a>00327         }
-<a name="l00328"></a>00328         cpl_free(*s); *s = NULL;
-<a name="l00329"></a>00329     }
-<a name="l00330"></a>00330     <span class="keywordflow">return</span>;
-<a name="l00331"></a>00331 }
-<a name="l00332"></a>00332 
-<a name="l00333"></a>00333 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00338"></a>00338 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00339"></a>00339 <span class="keywordtype">void</span>            fors_std_star_delete_const( <span class="keyword">const</span> fors_std_star **s){
-<a name="l00340"></a>00340     fors_std_star_delete((fors_std_star **)s);
-<a name="l00341"></a>00341     <span class="keywordflow">return</span>;
-<a name="l00342"></a>00342 }
-<a name="l00343"></a>00343 
-<a name="l00344"></a>00344 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00345"></a>00345 <span class="preprocessor">#undef cleanup</span>
-<a name="l00346"></a>00346 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00347"></a>00347 <span class="preprocessor"></span>
-<a name="l00352"></a>00352 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00353"></a>00353 fors_std_star   *fors_std_star_duplicate(   <span class="keyword">const</span> fors_std_star *s)
-<a name="l00354"></a>00354 {
-<a name="l00355"></a>00355     fors_std_star *d = NULL;
-<a name="l00356"></a>00356 
-<a name="l00357"></a>00357     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL, <span class="keywordflow">return</span> NULL, NULL );
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     d = cpl_malloc(<span class="keyword">sizeof</span>(*d));
-<a name="l00360"></a>00360 
-<a name="l00361"></a>00361     d->ra             = s->ra;
-<a name="l00362"></a>00362     d->dec            = s->dec;
-<a name="l00363"></a>00363     d->magnitude      = s->magnitude;
-<a name="l00364"></a>00364     d->dmagnitude     = s->dmagnitude;
-<a name="l00365"></a>00365     d->cat_magnitude  = s->cat_magnitude;
-<a name="l00366"></a>00366     d->dcat_magnitude = s->dcat_magnitude;
-<a name="l00367"></a>00367     d->color          = s->color;
-<a name="l00368"></a>00368     d->dcolor         = s->dcolor;
-<a name="l00369"></a>00369     d->cov_catm_color = s->cov_catm_color;
-<a name="l00370"></a>00370     
-<a name="l00371"></a>00371     d->pixel          = <a class="code" href="group__fors__point.html#gc5a8341742fc371f6e7332600286045e">fors_point_duplicate</a>(s->pixel);
-<a name="l00372"></a>00372     d->name           = s->name != NULL ? cpl_strdup(s->name) : NULL;
-<a name="l00373"></a>00373     
-<a name="l00374"></a>00374     d->trusted        = s->trusted;
-<a name="l00375"></a>00375     
-<a name="l00376"></a>00376     <span class="keywordflow">return</span> d;    
-<a name="l00377"></a>00377 }
-<a name="l00378"></a>00378 
-<a name="l00379"></a>00379 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00380"></a>00380 <span class="preprocessor">#undef cleanup</span>
-<a name="l00381"></a>00381 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00382"></a>00382 <span class="preprocessor"></span>
-<a name="l00388"></a>00388 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00389"></a>00389 <span class="keywordtype">void</span>            fors_std_star_set_name(     fors_std_star   *s,
-<a name="l00390"></a>00390                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *name)
-<a name="l00391"></a>00391 {
-<a name="l00392"></a>00392     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL, <span class="keywordflow">return</span>, NULL );
-<a name="l00393"></a>00393     
-<a name="l00394"></a>00394     cpl_free(s->name);
-<a name="l00395"></a>00395     s->name = (name != NULL) ? cpl_strdup(name) : NULL;
-<a name="l00396"></a>00396     
-<a name="l00397"></a>00397     <span class="keywordflow">return</span>;
-<a name="l00398"></a>00398 }
-<a name="l00399"></a>00399 
-<a name="l00400"></a>00400 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00409"></a>00409 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00410"></a>00410 <span class="keywordtype">bool</span>            fors_std_star_equal(        <span class="keyword">const</span> fors_std_star *s,
-<a name="l00411"></a>00411                                             <span class="keyword">const</span> fors_std_star *t)
-<a name="l00412"></a>00412 {
-<a name="l00413"></a>00413     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL && t != NULL, <span class="keywordflow">return</span> <span class="keyword">true</span>, NULL );
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     <span class="keywordflow">return</span>( s->trusted && t->trusted &&
-<a name="l00416"></a>00416             fabs(s->ra  - t->ra ) < DBL_EPSILON &&
-<a name="l00417"></a>00417             fabs(s->dec - t->dec) < DBL_EPSILON);
-<a name="l00418"></a>00418 }
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00421"></a>00421 <span class="preprocessor">#undef cleanup</span>
-<a name="l00422"></a>00422 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00423"></a>00423 <span class="preprocessor"></span>
-<a name="l00428"></a>00428 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00429"></a>00429 <span class="keywordtype">void</span>            fors_std_star_print(        cpl_msg_severity level,
-<a name="l00430"></a>00430                                             <span class="keyword">const</span> fors_std_star *star)
-<a name="l00431"></a>00431 {
-<a name="l00432"></a>00432     <span class="keywordflow">if</span> (star == NULL) {
-<a name="l00433"></a>00433         fors_msg(level, <span class="stringliteral">"NULL std.star"</span>);
-<a name="l00434"></a>00434     }
-<a name="l00435"></a>00435     <span class="keywordflow">else</span> {
-<a name="l00436"></a>00436         fors_msg(level, <span class="stringliteral">"(%7.4f, %7.4f): %sm = %g +- %g "</span>
-<a name="l00437"></a>00437                         <span class="stringliteral">"(col = %g +- %g)%s, (x=%7.2f, y=%7.2f) %s"</span>,
-<a name="l00438"></a>00438                  star->ra, star->dec,
-<a name="l00439"></a>00439                  (star->trusted ? <span class="stringliteral">""</span> : <span class="stringliteral">"untrusted magnitude (values are: "</span>),
-<a name="l00440"></a>00440                  star->magnitude, star->dmagnitude,
-<a name="l00441"></a>00441                  star->color, star->dcolor,
-<a name="l00442"></a>00442                  (star->trusted ? <span class="stringliteral">""</span> : <span class="stringliteral">")"</span>),
-<a name="l00443"></a>00443                  star->pixel->x, star->pixel->y,
-<a name="l00444"></a>00444                  ((star->name != NULL) ? star->name : <span class="stringliteral">""</span>));
-<a name="l00445"></a>00445     }
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447     <span class="keywordflow">return</span>;                  
-<a name="l00448"></a>00448 }
-<a name="l00449"></a>00449 
-<a name="l00450"></a>00450 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00451"></a>00451 <span class="preprocessor">#undef cleanup</span>
-<a name="l00452"></a>00452 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00453"></a>00453 <span class="preprocessor"></span>
-<a name="l00458"></a>00458 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00459"></a>00459 <span class="keywordtype">void</span>            fors_std_star_print_list(   cpl_msg_severity level,
-<a name="l00460"></a>00460                                             <span class="keyword">const</span> fors_std_star_list *sl)
-<a name="l00461"></a>00461 {
-<a name="l00462"></a>00462     <span class="keywordflow">if</span> (sl == NULL) fors_msg(level, <span class="stringliteral">"Null list"</span>);
-<a name="l00463"></a>00463     <span class="keywordflow">else</span> {
-<a name="l00464"></a>00464         <span class="keyword">const</span> fors_std_star *s;
-<a name="l00465"></a>00465         
-<a name="l00466"></a>00466         <span class="keywordflow">for</span> (s = fors_std_star_list_first_const(sl);
-<a name="l00467"></a>00467              s != NULL;
-<a name="l00468"></a>00468              s = fors_std_star_list_next_const(sl)) {
-<a name="l00469"></a>00469             
-<a name="l00470"></a>00470             fors_std_star_print(level, s);
-<a name="l00471"></a>00471         }
-<a name="l00472"></a>00472     }
-<a name="l00473"></a>00473     <span class="keywordflow">return</span>;
-<a name="l00474"></a>00474 }
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00484"></a>00484 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00485"></a>00485 <span class="keywordtype">bool</span>            fors_std_star_brighter_than(<span class="keyword">const</span> fors_std_star *s,
-<a name="l00486"></a>00486                                             <span class="keyword">const</span> fors_std_star *t,
-<a name="l00487"></a>00487                                             <span class="keywordtype">void</span> *data){
-<a name="l00488"></a>00488     data = data;
-<a name="l00489"></a>00489     <span class="keywordflow">return</span> (s->trusted && t->trusted &&
-<a name="l00490"></a>00490             s->magnitude < t->magnitude);
-<a name="l00491"></a>00491 }
-<a name="l00492"></a>00492 
-<a name="l00493"></a>00493 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00494"></a>00494 <span class="preprocessor">#undef cleanup</span>
-<a name="l00495"></a>00495 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00496"></a>00496 <span class="preprocessor"></span>
-<a name="l00502"></a>00502 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00503"></a>00503 <span class="keywordtype">double</span>          fors_std_star_dist_arcsec(  <span class="keyword">const</span> fors_std_star *s,
-<a name="l00504"></a>00504                                             <span class="keyword">const</span> fors_std_star *t)
-<a name="l00505"></a>00505 {
-<a name="l00506"></a>00506     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00507"></a>00507     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( t != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00508"></a>00508 
-<a name="l00509"></a>00509     <span class="comment">/* Convert to radians, use stock formula for angular separation,</span>
-<a name="l00510"></a>00510 <span class="comment">       convert */</span>
-<a name="l00511"></a>00511     <span class="keywordtype">double</span> s_ra  = s->ra  * 2*M_PI / 360;
-<a name="l00512"></a>00512     <span class="keywordtype">double</span> s_dec = s->dec * 2*M_PI / 360;
-<a name="l00513"></a>00513     <span class="keywordtype">double</span> t_ra  = t->ra  * 2*M_PI / 360;
-<a name="l00514"></a>00514     <span class="keywordtype">double</span> t_dec = t->dec * 2*M_PI / 360;
-<a name="l00515"></a>00515     
-<a name="l00516"></a>00516     <span class="keywordtype">double</span> cos_separation = 
-<a name="l00517"></a>00517         sin(s_dec)*sin(t_dec) +  
-<a name="l00518"></a>00518         cos(s_dec)*cos(t_dec) * cos(s_ra - t_ra);
-<a name="l00519"></a>00519     
-<a name="l00520"></a>00520     <span class="keywordflow">if</span> (cos_separation < -1) cos_separation = -1;
-<a name="l00521"></a>00521     <span class="keywordflow">if</span> (cos_separation >  1) cos_separation =  1;
-<a name="l00522"></a>00522     
-<a name="l00523"></a>00523     <span class="comment">/* Note: result is always positive */</span>
-<a name="l00524"></a>00524     <span class="keywordflow">return</span> (acos(cos_separation) * 360 / (2*M_PI)) * 3600;
-<a name="l00525"></a>00525 }
-<a name="l00526"></a>00526 
-<a name="l00527"></a>00527 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00537"></a>00537 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00538"></a>00538 <span class="keywordtype">void</span>            fors_std_star_compute_corrected_mag(
-<a name="l00539"></a>00539                                             fors_std_star   *s,
-<a name="l00540"></a>00540                                             <span class="keywordtype">double</span>          color_term,
-<a name="l00541"></a>00541                                             <span class="keywordtype">double</span>          dcolor_term)
-<a name="l00542"></a>00542 {
-<a name="l00543"></a>00543     cassure( s != NULL, CPL_ERROR_NULL_INPUT, <span class="keywordflow">return</span>, NULL);
-<a name="l00544"></a>00544     
-<a name="l00545"></a>00545     s->magnitude = s->cat_magnitude - color_term * s->color;
-<a name="l00546"></a>00546     s->dmagnitude = sqrt(   _square(s->dcat_magnitude)
-<a name="l00547"></a>00547                             - 2.0 * color_term * s->cov_catm_color
-<a name="l00548"></a>00548                             + _square(color_term * s->dcolor)
-<a name="l00549"></a>00549                             + _square(s->color * dcolor_term));
-<a name="l00550"></a>00550 }
-<a name="l00551"></a>00551 
-<a name="l00552"></a>00552 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00553"></a>00553 <span class="preprocessor">#define LIST_DEFINE</span>
-<a name="l00554"></a>00554 <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00555"></a>00555 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_std_star</span>
-<a name="l00556"></a>00556 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00557"></a>00557 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__std__star_8c_source.html b/html/fors__std__star_8c_source.html
new file mode 100644
index 0000000..e2805b5
--- /dev/null
+++ b/html/fors__std__star_8c_source.html
@@ -0,0 +1,509 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_std_star.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_std_star.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_std_star.c,v 1.20 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.20 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_star.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <assert.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <float.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="comment">    Prototypes</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="keyword">static</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keywordtype">double</span>          <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(  <span class="keyword">const</span> cpl_table *tab,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>                                             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *colname);</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keyword">static</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keywordtype">double</span>          _square(                    <span class="keywordtype">double</span>  a);</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> </div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">    Private Implementation</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keyword">static</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="keywordtype">double</span>          <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(  <span class="keyword">const</span> cpl_table *tab,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *colname)</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> {</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     cpl_error_code  errc;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="keywordflow">if</span> (colname != NULL && colname[0] != <span class="charliteral">'\0'</span>)</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     {</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>         <span class="keywordtype">double</span>  d;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>         d = cpl_table_get(                  tab, colname, row, &null);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>         {</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>             <span class="keywordflow">switch</span> (errc = cpl_error_get_code())</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>             {</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                 <span class="keywordflow">case</span> CPL_ERROR_DATA_NOT_FOUND:</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     cpl_error_set_message(  cpl_func,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                                             errc,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                                             <span class="stringliteral">"Column \"%s\" not found"</span>,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                                             colname);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                 <span class="keywordflow">case</span> CPL_ERROR_INVALID_TYPE:</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     cpl_error_set_message(  cpl_func,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                                             errc,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                                             <span class="stringliteral">"Column \"%s\" is not numeric"</span>,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                                             colname);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                 <span class="keywordflow">default</span>:    <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>             }</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>             cleanup;</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>         }</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>         {</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>             <span class="keywordflow">return</span> d;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>         }</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     }</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     </div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     {</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>         <span class="keywordtype">int</span> n;</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>         <span class="keyword">union </span>_nant {</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>             <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>   bytes[8];</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>             <span class="keywordtype">double</span>          val;</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>         } nan;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>         <span class="keywordflow">for</span> (n = 0; n < 8; n++)</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>             nan.bytes[n] = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>)255;</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         <span class="keywordflow">return</span> nan.val;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     }</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> }</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="keyword">static</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="keywordtype">double</span>          _square(                    <span class="keywordtype">double</span>  a)</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> {</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">return</span>  a*a;</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> }</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment">    Implementation</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="preprocessor">   cpl_table_delete(t); \</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> fors_std_star   *fors_std_star_new(         <span class="keywordtype">double</span> ra, <span class="keywordtype">double</span> dec,</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>                                             <span class="keywordtype">double</span> m, <span class="keywordtype">double</span> dm,</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>                                             <span class="keywordtype">double</span> cat_m, <span class="keywordtype">double</span> dcat_m,</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                                             <span class="keywordtype">double</span> col, <span class="keywordtype">double</span> dcol,</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                                             <span class="keywordtype">double</span> cov_catm_col,</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *name)</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> {</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     fors_std_star *s = cpl_malloc(<span class="keyword">sizeof</span>(*s));</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     s->ra               = ra;</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     s->dec              = dec;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     s->magnitude        = m;</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     s->dmagnitude       = dm;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     s->cat_magnitude    = cat_m;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     s->dcat_magnitude   = dcat_m;</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     s->color            = col;</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     s->dcolor           = dcol;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     s->cov_catm_color   = cov_catm_col;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     s->pixel     = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(-1, -1);</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="keywordflow">if</span> (name != NULL) {</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>         s->name = cpl_strdup(name);</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     }</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         s->name = NULL;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     s->trusted = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordflow">return</span> s;</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> }</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup fors_std_star_delete(&s)</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> fors_std_star   *fors_std_star_new_from_table(</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                                             <span class="keyword">const</span> cpl_table *tab,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *ra_col,</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dec_col,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *mag_col,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dmag_col,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *catmag_col,</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dcatmag_col,</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *color_col,</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dcolor_col,</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *cov_catm_color_col,</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *x_col,</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *y_col,</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *name_col)</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> {</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="keywordtype">double</span>          x,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                     y;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     </div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     fors_std_star *s = cpl_malloc(<span class="keyword">sizeof</span>(*s));</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     s->name = NULL; <span class="comment">/* assign this before calling assure (that calls delete) */</span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     s->ra =                     <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, ra_col);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     s->dec =                    <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, dec_col);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     s->magnitude =              <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, mag_col);</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     s->dmagnitude =             <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, dmag_col);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     s->cat_magnitude  =       <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, catmag_col);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     s->dcat_magnitude =       <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, dcatmag_col);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     s->color =                  <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, color_col);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     s->dcolor =                 <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, dcolor_col);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     s->cov_catm_color =         <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row,</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>                                             cov_catm_color_col);</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     x = <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, x_col);</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     y = <a class="code" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8" title="Get a double value from a table.">_get_optional_table_value</a>(tab, row, y_col);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     s->pixel = <a class="code" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d" title="Constructor.">fors_point_new</a>(  (isnan(x) ? -1 : x),</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                                 (isnan(y) ? -1 : y));</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> s, NULL);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordflow">if</span> (s->pixel->x < 1) s->pixel->x = -1;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="keywordflow">if</span> (s->pixel->y < 1) s->pixel->y = -1;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     s->name = NULL;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     <span class="keywordflow">if</span> (name_col != NULL)</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     {</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>  *str;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>         str = cpl_table_get_string(tab, name_col, row);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(errstat))</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>         {</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>             cpl_error_code  errc;</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>             <span class="keywordflow">switch</span> (errc = cpl_error_get_code())</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>             {</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                 <span class="keywordflow">case</span> CPL_ERROR_DATA_NOT_FOUND:</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                     cpl_error_set_message(  cpl_func,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                                             errc,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                                             <span class="stringliteral">"Column \"%s\" not found"</span>,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                                             name_col);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                 <span class="keywordflow">case</span> CPL_ERROR_INVALID_TYPE:</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                     cpl_error_set_message(  cpl_func,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                                             errc,</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                                             <span class="stringliteral">"Column \"%s\" is not string type"</span>,</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                                             name_col);</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                 <span class="keywordflow">default</span>:    <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>             }</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>             cleanup;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>             <span class="keywordflow">return</span> s;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         }</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         <span class="keywordflow">if</span> (str != NULL)</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>             s->name = cpl_strdup(str);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     }</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     s->trusted = <span class="keyword">true</span>;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     <span class="keywordflow">return</span> s;</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> }</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> <span class="keywordtype">void</span>            fors_std_star_delete(       fors_std_star **s){</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     <span class="keywordflow">if</span> (s && *s) {</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>         <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>(&(*s)->pixel);</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>         <span class="keywordflow">if</span> ((*s)->name != NULL) {</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>             cpl_free((<span class="keywordtype">void</span> *)(*s)->name); (*s)->name = NULL;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>         }</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         cpl_free(*s); *s = NULL;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     }</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> }</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> </div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> <span class="keywordtype">void</span>            fors_std_star_delete_const( <span class="keyword">const</span> fors_std_star **s){</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     fors_std_star_delete((fors_std_star **)s);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> }</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> </div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> fors_std_star   *fors_std_star_duplicate(   <span class="keyword">const</span> fors_std_star *s)</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> {</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     fors_std_star *d = NULL;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> </div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL, <span class="keywordflow">return</span> NULL, NULL );</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     d = cpl_malloc(<span class="keyword">sizeof</span>(*d));</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     d->ra             = s->ra;</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     d->dec            = s->dec;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     d->magnitude      = s->magnitude;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     d->dmagnitude     = s->dmagnitude;</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     d->cat_magnitude  = s->cat_magnitude;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     d->dcat_magnitude = s->dcat_magnitude;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     d->color          = s->color;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     d->dcolor         = s->dcolor;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     d->cov_catm_color = s->cov_catm_color;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     d->pixel          = <a class="code" href="group__fors__point.html#gaefadbecbfc8e491ca544292027d8b69e" title="Copy constructor.">fors_point_duplicate</a>(s->pixel);</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     d->name           = s->name != NULL ? cpl_strdup(s->name) : NULL;</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     d->trusted        = s->trusted;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">return</span> d;    </div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> }</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="keywordtype">void</span>            fors_std_star_set_name(     fors_std_star   *s,</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *name)</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> {</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL, <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     cpl_free(s->name);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     s->name = (name != NULL) ? cpl_strdup(name) : NULL;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> }</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> </div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> <span class="keywordtype">bool</span>            fors_std_star_equal(        <span class="keyword">const</span> fors_std_star *s,</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>                                             <span class="keyword">const</span> fors_std_star *t)</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> {</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL && t != NULL, <span class="keywordflow">return</span> <span class="keyword">true</span>, NULL );</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="keywordflow">return</span>( s->trusted && t->trusted &&</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>             fabs(s->ra  - t->ra ) < DBL_EPSILON &&</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>             fabs(s->dec - t->dec) < DBL_EPSILON);</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> }</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> <span class="keywordtype">void</span>            fors_std_star_print(        cpl_msg_severity level,</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>                                             <span class="keyword">const</span> fors_std_star *star)</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> {</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keywordflow">if</span> (star == NULL) {</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         fors_msg(level, <span class="stringliteral">"NULL std.star"</span>);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     }</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>         fors_msg(level, <span class="stringliteral">"(%7.4f, %7.4f): %sm = %g +- %g "</span></div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                         <span class="stringliteral">"(col = %g +- %g)%s, (x=%7.2f, y=%7.2f) %s"</span>,</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                  star->ra, star->dec,</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>                  (star->trusted ? <span class="stringliteral">""</span> : <span class="stringliteral">"untrusted magnitude (values are: "</span>),</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>                  star->magnitude, star->dmagnitude,</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>                  star->color, star->dcolor,</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>                  (star->trusted ? <span class="stringliteral">""</span> : <span class="stringliteral">")"</span>),</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>                  star->pixel->x, star->pixel->y,</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>                  ((star->name != NULL) ? star->name : <span class="stringliteral">""</span>));</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     }</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> </div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     <span class="keywordflow">return</span>;                  </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> }</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> </div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> <span class="keywordtype">void</span>            fors_std_star_print_list(   cpl_msg_severity level,</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>                                             <span class="keyword">const</span> fors_std_star_list *sl)</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> {</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     <span class="keywordflow">if</span> (sl == NULL) fors_msg(level, <span class="stringliteral">"Null list"</span>);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         <span class="keyword">const</span> fors_std_star *s;</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         </div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         <span class="keywordflow">for</span> (s = fors_std_star_list_first_const(sl);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>              s != NULL;</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>              s = fors_std_star_list_next_const(sl)) {</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>             </div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>             fors_std_star_print(level, s);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         }</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     }</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> }</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> </div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span> <span class="keywordtype">bool</span>            fors_std_star_brighter_than(<span class="keyword">const</span> fors_std_star *s,</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>                                             <span class="keyword">const</span> fors_std_star *t,</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                                             <span class="keywordtype">void</span> *data){</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     data = data;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     <span class="keywordflow">return</span> (s->trusted && t->trusted &&</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>             s->magnitude < t->magnitude);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> }</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> </div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span> <span class="keywordtype">double</span>          fors_std_star_dist_arcsec(  <span class="keyword">const</span> fors_std_star *s,</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                                             <span class="keyword">const</span> fors_std_star *t)</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> {</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( s != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( t != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> </div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     <span class="comment">/* Convert to radians, use stock formula for angular separation,</span></div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span> <span class="comment">       convert */</span></div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>     <span class="keywordtype">double</span> s_ra  = s->ra  * 2*M_PI / 360;</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     <span class="keywordtype">double</span> s_dec = s->dec * 2*M_PI / 360;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     <span class="keywordtype">double</span> t_ra  = t->ra  * 2*M_PI / 360;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     <span class="keywordtype">double</span> t_dec = t->dec * 2*M_PI / 360;</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     <span class="keywordtype">double</span> cos_separation = </div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>         sin(s_dec)*sin(t_dec) +  </div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         cos(s_dec)*cos(t_dec) * cos(s_ra - t_ra);</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     </div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     <span class="keywordflow">if</span> (cos_separation < -1) cos_separation = -1;</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>     <span class="keywordflow">if</span> (cos_separation >  1) cos_separation =  1;</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     </div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>     <span class="comment">/* Note: result is always positive */</span></div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     <span class="keywordflow">return</span> (acos(cos_separation) * 360 / (2*M_PI)) * 3600;</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> }</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span> </div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> <span class="keywordtype">void</span>            fors_std_star_compute_corrected_mag(</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>                                             fors_std_star   *s,</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>                                             <span class="keywordtype">double</span>          color_term,</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>                                             <span class="keywordtype">double</span>          dcolor_term)</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> {</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     cassure( s != NULL, CPL_ERROR_NULL_INPUT, <span class="keywordflow">return</span>, NULL);</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>     </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     s->magnitude = s->cat_magnitude - color_term * s->color;</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     s->dmagnitude = sqrt(   _square(s->dcat_magnitude)</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>                             - 2.0 * color_term * s->cov_catm_color</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>                             + _square(color_term * s->dcolor)</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>                             + _square(s->color * dcolor_term));</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span> }</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span> </div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span> <span class="preprocessor">#define LIST_DEFINE</span></div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> <span class="preprocessor"></span><span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_std_star</span></div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__std__star_8h-source.html b/html/fors__std__star_8h-source.html
deleted file mode 100644
index 7f04531..0000000
--- a/html/fors__std__star_8h-source.html
+++ /dev/null
@@ -1,135 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_std_star.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_std_star.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_std_star.h,v 1.14 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.14 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_STD_STAR_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_STD_STAR_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_point.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 CPL_BEGIN_DECLS
-<a name="l00038"></a>00038 
-<a name="l00039"></a><a class="code" href="struct__fors__std__star.html">00039</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__std__star.html">_fors_std_star</a> 
-<a name="l00040"></a>00040 {
-<a name="l00041"></a><a class="code" href="struct__fors__std__star.html#839aff9010bc6a6e44b5b23df543aa35">00041</a>     fors_point  *<a class="code" href="struct__fors__std__star.html#839aff9010bc6a6e44b5b23df543aa35">pixel</a>;
-<a name="l00042"></a><a class="code" href="struct__fors__std__star.html#691cac5c703384c5f731f37a264943fd">00042</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__std__star.html#691cac5c703384c5f731f37a264943fd">ra</a>, <a class="code" href="struct__fors__std__star.html#af20d4b52c06758c47ca0847f77ea03e">dec</a>;
-<a name="l00043"></a><a class="code" href="struct__fors__std__star.html#2d3e959920d6aecfb5c6ae7ade4e8242">00043</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__std__star.html#2d3e959920d6aecfb5c6ae7ade4e8242">magnitude</a>;      <span class="comment">/* Color corrected according to filter used */</span>
-<a name="l00044"></a><a class="code" href="struct__fors__std__star.html#0daa0413ccc6df832707e97c52cbe8f7">00044</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__std__star.html#0daa0413ccc6df832707e97c52cbe8f7">dmagnitude</a>;     <span class="comment">/* 1 sigma error */</span>
-<a name="l00045"></a><a class="code" href="struct__fors__std__star.html#572834d8779cf03a23be21e86c58dd7f">00045</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__std__star.html#572834d8779cf03a23be21e86c58dd7f">cat_magnitude</a>;  <span class="comment">/* From catalog */</span>
-<a name="l00046"></a><a class="code" href="struct__fors__std__star.html#4d258c07f6a7bb5b17f4bd0c7faf75a8">00046</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__std__star.html#4d258c07f6a7bb5b17f4bd0c7faf75a8">dcat_magnitude</a>; <span class="comment">/* From catalog */</span>
-<a name="l00047"></a><a class="code" href="struct__fors__std__star.html#a8620d2a99065a638abe790fd240f5d2">00047</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__std__star.html#a8620d2a99065a638abe790fd240f5d2">color</a>;          <span class="comment">/* color, defined as difference between bands */</span>
-<a name="l00048"></a><a class="code" href="struct__fors__std__star.html#4dbabb1e3ade361a611e54f51aeb2781">00048</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__std__star.html#4dbabb1e3ade361a611e54f51aeb2781">dcolor</a>;         <span class="comment">/* 1 sigma color error */</span>
-<a name="l00049"></a><a class="code" href="struct__fors__std__star.html#7f673b38b2ce3af3959eab9ccf97a356">00049</a>     <span class="keywordtype">double</span>      <a class="code" href="struct__fors__std__star.html#7f673b38b2ce3af3959eab9ccf97a356">cov_catm_color</a>; <span class="comment">/* covariance(cat_magnitude, color) */</span>
-<a name="l00050"></a><a class="code" href="struct__fors__std__star.html#5507a5a98a7739b0c1f9c2a97eb75c42">00050</a>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *<a class="code" href="struct__fors__std__star.html#5507a5a98a7739b0c1f9c2a97eb75c42">name</a>;
-<a name="l00051"></a><a class="code" href="struct__fors__std__star.html#1d7de44e88c02bc012ef3d75a9e43eed">00051</a>     <span class="keywordtype">bool</span>        <a class="code" href="struct__fors__std__star.html#1d7de44e88c02bc012ef3d75a9e43eed">trusted</a>;
-<a name="l00052"></a>00052 } fors_std_star;
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 <span class="preprocessor">#undef LIST_ELEM</span>
-<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_std_star</span>
-<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00057"></a>00057 
-<a name="l00058"></a>00058 fors_std_star   *fors_std_star_new(         <span class="keywordtype">double</span> ra, <span class="keywordtype">double</span> dec,
-<a name="l00059"></a>00059                                             <span class="keywordtype">double</span> m, <span class="keywordtype">double</span> dm,
-<a name="l00060"></a>00060                                             <span class="keywordtype">double</span> cat_m, <span class="keywordtype">double</span> dcat_m,
-<a name="l00061"></a>00061                                             <span class="keywordtype">double</span> col, <span class="keywordtype">double</span> dcol,
-<a name="l00062"></a>00062                                             <span class="keywordtype">double</span> cov_catm_col,
-<a name="l00063"></a>00063                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *name);
-<a name="l00064"></a>00064 
-<a name="l00065"></a>00065 fors_std_star   *fors_std_star_new_from_table(
-<a name="l00066"></a>00066                                             <span class="keyword">const</span> cpl_table *tab,
-<a name="l00067"></a>00067                                             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,
-<a name="l00068"></a>00068                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *ra_col,
-<a name="l00069"></a>00069                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dec_col,
-<a name="l00070"></a>00070                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *mag_col,
-<a name="l00071"></a>00071                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dmag_col,
-<a name="l00072"></a>00072                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *catmag_col,
-<a name="l00073"></a>00073                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dcatmag_col,
-<a name="l00074"></a>00074                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *color_col,
-<a name="l00075"></a>00075                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dcolor_col,
-<a name="l00076"></a>00076                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *cov_catm_color_col,
-<a name="l00077"></a>00077                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *x_col,
-<a name="l00078"></a>00078                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *y_col,
-<a name="l00079"></a>00079                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *name_col);
-<a name="l00080"></a>00080 
-<a name="l00081"></a>00081 <span class="keywordtype">void</span>            fors_std_star_delete(       fors_std_star **s);
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083 <span class="keywordtype">void</span>            fors_std_star_delete_const( <span class="keyword">const</span> fors_std_star **s);
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085 fors_std_star   *fors_std_star_duplicate(   <span class="keyword">const</span> fors_std_star *s);
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087 <span class="keywordtype">void</span>            fors_std_star_set_name(     fors_std_star   *s,
-<a name="l00088"></a>00088                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *name);
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090 <span class="keywordtype">bool</span>            fors_std_star_equal(        <span class="keyword">const</span> fors_std_star *s,
-<a name="l00091"></a>00091                                             <span class="keyword">const</span> fors_std_star *t);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093 <span class="keywordtype">void</span>            fors_std_star_print(        cpl_msg_severity level,
-<a name="l00094"></a>00094                                             <span class="keyword">const</span> fors_std_star *star);
-<a name="l00095"></a>00095 
-<a name="l00096"></a>00096 <span class="keywordtype">void</span>            fors_std_star_print_list(   cpl_msg_severity level,
-<a name="l00097"></a>00097                                             <span class="keyword">const</span> fors_std_star_list *sl);
-<a name="l00098"></a>00098 
-<a name="l00099"></a>00099 <span class="keywordtype">bool</span>            fors_std_star_brighter_than(<span class="keyword">const</span> fors_std_star *s,
-<a name="l00100"></a>00100                                             <span class="keyword">const</span> fors_std_star *t,
-<a name="l00101"></a>00101                                             <span class="keywordtype">void</span> *data);
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103 <span class="keywordtype">double</span>          fors_std_star_dist_arcsec(  <span class="keyword">const</span> fors_std_star *s,
-<a name="l00104"></a>00104                                             <span class="keyword">const</span> fors_std_star *t);
-<a name="l00105"></a>00105 
-<a name="l00106"></a>00106 <span class="keywordtype">void</span>            fors_std_star_compute_corrected_mag(
-<a name="l00107"></a>00107                                             fors_std_star   *s,
-<a name="l00108"></a>00108                                             <span class="keywordtype">double</span>          color_term,
-<a name="l00109"></a>00109                                             <span class="keywordtype">double</span>          dcolor_term);
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111 CPL_END_DECLS
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__std__star_8h_source.html b/html/fors__std__star_8h_source.html
new file mode 100644
index 0000000..7f118fd
--- /dev/null
+++ b/html/fors__std__star_8h_source.html
@@ -0,0 +1,174 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_std_star.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_std_star.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_std_star.h,v 1.14 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.14 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_STD_STAR_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_STD_STAR_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_point.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="struct__fors__std__star.html">   39</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__fors__std__star.html">_fors_std_star</a> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> {</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>     fors_point  *pixel;</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>     <span class="keywordtype">double</span>      ra, dec;</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>     <span class="keywordtype">double</span>      magnitude;      <span class="comment">/* Color corrected according to filter used */</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>     <span class="keywordtype">double</span>      dmagnitude;     <span class="comment">/* 1 sigma error */</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>     <span class="keywordtype">double</span>      cat_magnitude;  <span class="comment">/* From catalog */</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>     <span class="keywordtype">double</span>      dcat_magnitude; <span class="comment">/* From catalog */</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>     <span class="keywordtype">double</span>      color;          <span class="comment">/* color, defined as difference between bands */</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>     <span class="keywordtype">double</span>      dcolor;         <span class="comment">/* 1 sigma color error */</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>     <span class="keywordtype">double</span>      cov_catm_color; <span class="comment">/* covariance(cat_magnitude, color) */</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *name;</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>     <span class="keywordtype">bool</span>        trusted;</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> } fors_std_star;</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">#undef LIST_ELEM</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM fors_std_star</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> fors_std_star   *fors_std_star_new(         <span class="keywordtype">double</span> ra, <span class="keywordtype">double</span> dec,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>                                             <span class="keywordtype">double</span> m, <span class="keywordtype">double</span> dm,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>                                             <span class="keywordtype">double</span> cat_m, <span class="keywordtype">double</span> dcat_m,</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>                                             <span class="keywordtype">double</span> col, <span class="keywordtype">double</span> dcol,</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>                                             <span class="keywordtype">double</span> cov_catm_col,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *name);</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> fors_std_star   *fors_std_star_new_from_table(</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>                                             <span class="keyword">const</span> cpl_table *tab,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                                             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    row,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *ra_col,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dec_col,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *mag_col,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dmag_col,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *catmag_col,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dcatmag_col,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *color_col,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *dcolor_col,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *cov_catm_color_col,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *x_col,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *y_col,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *name_col);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> </div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keywordtype">void</span>            fors_std_star_delete(       fors_std_star **s);</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="keywordtype">void</span>            fors_std_star_delete_const( <span class="keyword">const</span> fors_std_star **s);</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> fors_std_star   *fors_std_star_duplicate(   <span class="keyword">const</span> fors_std_star *s);</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="keywordtype">void</span>            fors_std_star_set_name(     fors_std_star   *s,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                                             <span class="keyword">const</span> <span class="keywordtype">char</span>      *name);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="keywordtype">bool</span>            fors_std_star_equal(        <span class="keyword">const</span> fors_std_star *s,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                                             <span class="keyword">const</span> fors_std_star *t);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="keywordtype">void</span>            fors_std_star_print(        cpl_msg_severity level,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                                             <span class="keyword">const</span> fors_std_star *star);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="keywordtype">void</span>            fors_std_star_print_list(   cpl_msg_severity level,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                                             <span class="keyword">const</span> fors_std_star_list *sl);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="keywordtype">bool</span>            fors_std_star_brighter_than(<span class="keyword">const</span> fors_std_star *s,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                                             <span class="keyword">const</span> fors_std_star *t,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                                             <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="keywordtype">double</span>          fors_std_star_dist_arcsec(  <span class="keyword">const</span> fors_std_star *s,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                                             <span class="keyword">const</span> fors_std_star *t);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> </div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="keywordtype">void</span>            fors_std_star_compute_corrected_mag(</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                                             fors_std_star   *s,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                                             <span class="keywordtype">double</span>          color_term,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                                             <span class="keywordtype">double</span>          dcolor_term);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__subtract__sky_8c-source.html b/html/fors__subtract__sky_8c-source.html
deleted file mode 100644
index ecf54d2..0000000
--- a/html/fors__subtract__sky_8c-source.html
+++ /dev/null
@@ -1,635 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_subtract_sky.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_subtract_sky.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_subtract_sky.c,v 1.8 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_subtract_sky_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to subtract the sky emission from unrebinned slit\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"spectra. This is obtained by robust fitting (i.e., excluding the signal\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"from possible point-like objects in slit) of the emission along the CCD\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"columns within each spectrum). This method doesn't work if extended\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"objects are in slit (it really destroys the object spectra), and is\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"not applicable to LSS data. The input scientific frames are produced\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"by the recipes fors_remove_bias and fors_flatfield.\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"This recipe cannot be applied to LSS or long-slit like data (MOS/MXU with\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"all slits at the same offset). No automatic recipe is available for this.\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"Please refer to the FORS Pipeline User's Manual for more details.\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS, and\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"SCI as STD.\n\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  SCIENCE_UNBIAS_MXU\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"  or SCIENCE_UNFLAT_MXU\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"  or STANDARD_UNBIAS_MXU\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"  or STANDARD_UNFLAT_MXU     Calib       Frame with sky lines    Y\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      Y\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location on CCD    Y\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  UNMAPPED_SCI_MXU\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  or UNMAPPED_STD_MXU        FITS image  Sky subtracted scientific frame\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"  UNMAPPED_SKY_SCI_MXU\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"  or UNMAPPED_SKY_STD_MXU    FITS image  Subtracted sky frame\n\n"</span>;
-<a name="l00072"></a>00072 
-<a name="l00073"></a>00073 <span class="preprocessor">#define fors_subtract_sky_exit(message)       \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">{                                             \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">}</span>
-<a name="l00086"></a>00086 <span class="preprocessor"></span>
-<a name="l00087"></a>00087 <span class="preprocessor">#define fors_subtract_sky_exit_memcheck(message)   \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">{                                               \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">cpl_image_delete(spectra);                      \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">printf("free skymap (%p)\n", skymap);           \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">cpl_image_delete(skymap);                       \</span>
-<a name="l00094"></a>00094 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">cpl_table_delete(grism_table);                  \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">cpl_table_delete(maskslits);                    \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">cpl_table_delete(slits);                        \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">cpl_table_delete(polytraces);                   \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">}</span>
-<a name="l00107"></a>00107 <span class="preprocessor"></span>
-<a name="l00108"></a>00108 
-<a name="l00120"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00120</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00121"></a>00121 {
-<a name="l00122"></a>00122     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00123"></a>00123     cpl_plugin *plugin = &recipe->interface;
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     cpl_plugin_init(plugin,
-<a name="l00126"></a>00126                     CPL_PLUGIN_API,
-<a name="l00127"></a>00127                     FORS_BINARY_VERSION,
-<a name="l00128"></a>00128                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00129"></a>00129                     <span class="stringliteral">"fors_subtract_sky"</span>,
-<a name="l00130"></a>00130                     <span class="stringliteral">"Subtract sky from scientific spectra"</span>,
-<a name="l00131"></a>00131                     fors_subtract_sky_description,
-<a name="l00132"></a>00132                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00133"></a>00133                     PACKAGE_BUGREPORT,
-<a name="l00134"></a>00134     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00135"></a>00135     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00136"></a>00136     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00137"></a>00137     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00138"></a>00138     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00139"></a>00139     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00140"></a>00140     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00141"></a>00141     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00142"></a>00142     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00143"></a>00143     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00144"></a>00144     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00145"></a>00145     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00146"></a>00146     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00147"></a>00147                     fors_subtract_sky_create,
-<a name="l00148"></a>00148                     fors_subtract_sky_exec,
-<a name="l00149"></a>00149                     fors_subtract_sky_destroy);
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     cpl_pluginlist_append(list, plugin);
-<a name="l00152"></a>00152     
-<a name="l00153"></a>00153     <span class="keywordflow">return</span> 0;
-<a name="l00154"></a>00154 }
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156 
-<a name="l00167"></a>00167 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_create(cpl_plugin *plugin)
-<a name="l00168"></a>00168 {
-<a name="l00169"></a>00169     cpl_recipe    *recipe;
-<a name="l00170"></a>00170     cpl_parameter *p;
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172     <span class="comment">/* </span>
-<a name="l00173"></a>00173 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00174"></a>00174 <span class="comment">     */</span>
-<a name="l00175"></a>00175 
-<a name="l00176"></a>00176     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00177"></a>00177         recipe = (cpl_recipe *)plugin;
-<a name="l00178"></a>00178     <span class="keywordflow">else</span> 
-<a name="l00179"></a>00179         <span class="keywordflow">return</span> -1;
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181     <span class="comment">/* </span>
-<a name="l00182"></a>00182 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00183"></a>00183 <span class="comment">     */</span>
-<a name="l00184"></a>00184 
-<a name="l00185"></a>00185     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187     <span class="comment">/*</span>
-<a name="l00188"></a>00188 <span class="comment">     * Dispersion</span>
-<a name="l00189"></a>00189 <span class="comment">     */</span>
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_subtract_sky.dispersion"</span>,
-<a name="l00192"></a>00192                                 CPL_TYPE_DOUBLE,
-<a name="l00193"></a>00193                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00194"></a>00194                                 <span class="stringliteral">"fors.fors_subtract_sky"</span>,
-<a name="l00195"></a>00195                                 0.0);
-<a name="l00196"></a>00196     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00197"></a>00197     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00198"></a>00198     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00199"></a>00199 
-<a name="l00200"></a>00200     <span class="comment">/*</span>
-<a name="l00201"></a>00201 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00202"></a>00202 <span class="comment">     */</span>
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_subtract_sky.startwavelength"</span>,
-<a name="l00205"></a>00205                                 CPL_TYPE_DOUBLE,
-<a name="l00206"></a>00206                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00207"></a>00207                                 <span class="stringliteral">"fors.fors_subtract_sky"</span>,
-<a name="l00208"></a>00208                                 0.0);
-<a name="l00209"></a>00209     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00210"></a>00210     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00211"></a>00211     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213     <span class="comment">/*</span>
-<a name="l00214"></a>00214 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00215"></a>00215 <span class="comment">     */</span>
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_subtract_sky.endwavelength"</span>,
-<a name="l00218"></a>00218                                 CPL_TYPE_DOUBLE,
-<a name="l00219"></a>00219                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00220"></a>00220                                 <span class="stringliteral">"fors.fors_subtract_sky"</span>,
-<a name="l00221"></a>00221                                 0.0);
-<a name="l00222"></a>00222     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00223"></a>00223     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00224"></a>00224     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <span class="comment">/*</span>
-<a name="l00227"></a>00227 <span class="comment">     * Cosmic rays removal</span>
-<a name="l00228"></a>00228 <span class="comment">     */</span>
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_subtract_sky.cosmics"</span>,
-<a name="l00231"></a>00231                                 CPL_TYPE_BOOL,
-<a name="l00232"></a>00232                                 <span class="stringliteral">"Eliminate cosmic rays hits"</span>,
-<a name="l00233"></a>00233                                 <span class="stringliteral">"fors.fors_subtract_sky"</span>,
-<a name="l00234"></a>00234                                 FALSE);
-<a name="l00235"></a>00235     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);
-<a name="l00236"></a>00236     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00237"></a>00237     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239     <span class="keywordflow">return</span> 0;
-<a name="l00240"></a>00240 }
-<a name="l00241"></a>00241 
-<a name="l00242"></a>00242 
-<a name="l00251"></a>00251 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_exec(cpl_plugin *plugin)
-<a name="l00252"></a>00252 {
-<a name="l00253"></a>00253     cpl_recipe *recipe;
-<a name="l00254"></a>00254     
-<a name="l00255"></a>00255     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00256"></a>00256         recipe = (cpl_recipe *)plugin;
-<a name="l00257"></a>00257     <span class="keywordflow">else</span> 
-<a name="l00258"></a>00258         <span class="keywordflow">return</span> -1;
-<a name="l00259"></a>00259 
-<a name="l00260"></a>00260     <span class="keywordflow">return</span> fors_subtract_sky(recipe->parameters, recipe->frames);
-<a name="l00261"></a>00261 }
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263 
-<a name="l00272"></a>00272 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_destroy(cpl_plugin *plugin)
-<a name="l00273"></a>00273 {
-<a name="l00274"></a>00274     cpl_recipe *recipe;
-<a name="l00275"></a>00275     
-<a name="l00276"></a>00276     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00277"></a>00277         recipe = (cpl_recipe *)plugin;
-<a name="l00278"></a>00278     <span class="keywordflow">else</span> 
-<a name="l00279"></a>00279         <span class="keywordflow">return</span> -1;
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283     <span class="keywordflow">return</span> 0;
-<a name="l00284"></a>00284 }
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286 
-<a name="l00296"></a>00296 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky(cpl_parameterlist *parlist, 
-<a name="l00297"></a>00297                                cpl_frameset *frameset)
-<a name="l00298"></a>00298 {
-<a name="l00299"></a>00299 
-<a name="l00300"></a>00300     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_subtract_sky"</span>;
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303     <span class="comment">/*</span>
-<a name="l00304"></a>00304 <span class="comment">     * Input parameters</span>
-<a name="l00305"></a>00305 <span class="comment">     */</span>
-<a name="l00306"></a>00306 
-<a name="l00307"></a>00307     <span class="keywordtype">double</span>      dispersion;
-<a name="l00308"></a>00308     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00309"></a>00309     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00310"></a>00310     <span class="keywordtype">int</span>         cosmics;
-<a name="l00311"></a>00311 
-<a name="l00312"></a>00312     <span class="comment">/*</span>
-<a name="l00313"></a>00313 <span class="comment">     * CPL objects</span>
-<a name="l00314"></a>00314 <span class="comment">     */</span>
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     cpl_image        *spectra     = NULL;
-<a name="l00317"></a>00317     cpl_image        *skymap      = NULL;
-<a name="l00318"></a>00318     cpl_table        *grism_table = NULL;
-<a name="l00319"></a>00319     cpl_table        *polytraces  = NULL;
-<a name="l00320"></a>00320     cpl_table        *slits       = NULL;
-<a name="l00321"></a>00321     cpl_table        *maskslits   = NULL;
-<a name="l00322"></a>00322     cpl_propertylist *header      = NULL;
-<a name="l00323"></a>00323 
-<a name="l00324"></a>00324     <span class="comment">/*</span>
-<a name="l00325"></a>00325 <span class="comment">     * Auxiliary variables</span>
-<a name="l00326"></a>00326 <span class="comment">     */</span>
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328     <span class="keywordtype">char</span>        version[80];
-<a name="l00329"></a>00329     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00330"></a>00330     <span class="keyword">const</span> <span class="keywordtype">char</span> *input_tag;
-<a name="l00331"></a>00331     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;
-<a name="l00332"></a>00332     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_tag;
-<a name="l00333"></a>00333     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_sky_tag;
-<a name="l00334"></a>00334     <span class="keywordtype">int</span>         nframes;
-<a name="l00335"></a>00335     <span class="keywordtype">int</span>         rebin;
-<a name="l00336"></a>00336     <span class="keywordtype">int</span>         nslits;
-<a name="l00337"></a>00337     <span class="keywordtype">int</span>         treat_as_lss;
-<a name="l00338"></a>00338     <span class="keywordtype">int</span>         i;
-<a name="l00339"></a>00339     <span class="keywordtype">double</span>      reference;
-<a name="l00340"></a>00340     <span class="keywordtype">double</span>      gain;
-<a name="l00341"></a>00341     <span class="keywordtype">double</span>     *xpos;
-<a name="l00342"></a>00342     <span class="keywordtype">double</span>      mxpos;
-<a name="l00343"></a>00343     <span class="keywordtype">int</span>         mxu, mos, lss;
-<a name="l00344"></a>00344     <span class="keywordtype">int</span>         rec_scib;
-<a name="l00345"></a>00345     <span class="keywordtype">int</span>         rec_stdb;
-<a name="l00346"></a>00346     <span class="keywordtype">int</span>         rec_scif;
-<a name="l00347"></a>00347     <span class="keywordtype">int</span>         rec_stdf;
-<a name="l00348"></a>00348     <span class="keywordtype">int</span>         nslits_out_det = 0;
-<a name="l00349"></a>00349 
-<a name="l00350"></a>00350     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00351"></a>00351 
-<a name="l00352"></a>00352 
-<a name="l00353"></a>00353     cpl_msg_set_indentation(2);
-<a name="l00354"></a>00354 
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356     <span class="comment">/*</span>
-<a name="l00357"></a>00357 <span class="comment">     * Get configuration parameters</span>
-<a name="l00358"></a>00358 <span class="comment">     */</span>
-<a name="l00359"></a>00359 
-<a name="l00360"></a>00360     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00361"></a>00361     cpl_msg_indent_more();
-<a name="l00362"></a>00362     
-<a name="l00363"></a>00363     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00364"></a>00364         fors_subtract_sky_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); 
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00367"></a>00367 
-<a name="l00368"></a>00368     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00369"></a>00369                     <span class="stringliteral">"fors.fors_subtract_sky.dispersion"</span>, grism_table);
-<a name="l00370"></a>00370 
-<a name="l00371"></a>00371     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00372"></a>00372         fors_subtract_sky_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00375"></a>00375                     <span class="stringliteral">"fors.fors_subtract_sky.startwavelength"</span>, grism_table);
-<a name="l00376"></a>00376     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00377"></a>00377         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00378"></a>00378             fors_subtract_sky_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00381"></a>00381                     <span class="stringliteral">"fors.fors_subtract_sky.endwavelength"</span>, grism_table);
-<a name="l00382"></a>00382     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00383"></a>00383         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00384"></a>00384             fors_subtract_sky_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00385"></a>00385         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00386"></a>00386             fors_subtract_sky_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00387"></a>00387     }
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00390"></a>00390         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00391"></a>00391             fors_subtract_sky_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393     cosmics = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00394"></a>00394                                      <span class="stringliteral">"fors.fors_subtract_sky.cosmics"</span>, NULL);
-<a name="l00395"></a>00395 
-<a name="l00396"></a>00396     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00399"></a>00399         fors_subtract_sky_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);
-<a name="l00400"></a>00400 
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     cpl_msg_indent_less();
-<a name="l00403"></a>00403     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00404"></a>00404     cpl_msg_indent_more();
-<a name="l00405"></a>00405 
-<a name="l00406"></a>00406     mxu  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MXU"</span>);
-<a name="l00407"></a>00407     mos  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MOS"</span>);
-<a name="l00408"></a>00408     lss  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_LSS"</span>);
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410     <span class="keywordflow">if</span> (lss)
-<a name="l00411"></a>00411         fors_subtract_sky_exit(<span class="stringliteral">"Use this recipe just with MOS/MXU data."</span>);
-<a name="l00412"></a>00412 
-<a name="l00413"></a>00413     nframes = mos + mxu;
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00416"></a>00416         fors_subtract_sky_exit(<span class="stringliteral">"Missing input slit location table"</span>);
-<a name="l00417"></a>00417     }
-<a name="l00418"></a>00418     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00419"></a>00419         cpl_msg_error(recipe, 
-<a name="l00420"></a>00420                       <span class="stringliteral">"Too many input slit location tables (%d > 1)"</span>, nframes);
-<a name="l00421"></a>00421         fors_subtract_sky_exit(NULL);
-<a name="l00422"></a>00422     }
-<a name="l00423"></a>00423 
-<a name="l00424"></a>00424     <span class="keywordflow">if</span> (mxu)
-<a name="l00425"></a>00425         curv_coeff_tag = <span class="stringliteral">"CURV_COEFF_MXU"</span>;
-<a name="l00426"></a>00426     <span class="keywordflow">else</span>
-<a name="l00427"></a>00427         curv_coeff_tag = <span class="stringliteral">"CURV_COEFF_MXU"</span>;
-<a name="l00428"></a>00428 
-<a name="l00429"></a>00429     
-<a name="l00430"></a>00430     nframes = cpl_frameset_count_tags(frameset, curv_coeff_tag);
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00433"></a>00433         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s"</span>, curv_coeff_tag);
-<a name="l00434"></a>00434         fors_subtract_sky_exit(NULL);
-<a name="l00435"></a>00435     }
-<a name="l00436"></a>00436     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00437"></a>00437         cpl_msg_error(recipe, <span class="stringliteral">"Too many input %s (%d > 1)"</span>, curv_coeff_tag,
-<a name="l00438"></a>00438                       nframes);
-<a name="l00439"></a>00439         fors_subtract_sky_exit(NULL);
-<a name="l00440"></a>00440     }
-<a name="l00441"></a>00441 
-<a name="l00442"></a>00442     <span class="keywordflow">if</span> (mxu) {
-<a name="l00443"></a>00443         rec_scib = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>);
-<a name="l00444"></a>00444         rec_stdb = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>);
-<a name="l00445"></a>00445         rec_scif = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>);
-<a name="l00446"></a>00446         rec_stdf = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>);
-<a name="l00447"></a>00447     }
-<a name="l00448"></a>00448     <span class="keywordflow">else</span> {
-<a name="l00449"></a>00449         rec_scib = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>);
-<a name="l00450"></a>00450         rec_stdb = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>);
-<a name="l00451"></a>00451         rec_scif = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>);
-<a name="l00452"></a>00452         rec_stdf = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>);
-<a name="l00453"></a>00453     }
-<a name="l00454"></a>00454 
-<a name="l00455"></a>00455     nframes = rec_scib + rec_stdb + rec_scif + rec_stdf;
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457     <span class="keywordflow">if</span> (nframes == 0) {
-<a name="l00458"></a>00458         fors_subtract_sky_exit(<span class="stringliteral">"Missing input scientific spectra"</span>);
-<a name="l00459"></a>00459     }
-<a name="l00460"></a>00460     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00461"></a>00461         cpl_msg_error(recipe, <span class="stringliteral">"Too many input scientific spectra (%d > 1)"</span>, 
-<a name="l00462"></a>00462                       nframes);
-<a name="l00463"></a>00463         fors_subtract_sky_exit(NULL);
-<a name="l00464"></a>00464     }
-<a name="l00465"></a>00465 
-<a name="l00466"></a>00466     <span class="keywordflow">if</span> (rec_scib) {
-<a name="l00467"></a>00467         <span class="keywordflow">if</span> (mxu) {
-<a name="l00468"></a>00468             input_tag         = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;
-<a name="l00469"></a>00469             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00470"></a>00470             unmapped_tag      = <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>;
-<a name="l00471"></a>00471             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>;
-<a name="l00472"></a>00472         }
-<a name="l00473"></a>00473         <span class="keywordflow">else</span> {
-<a name="l00474"></a>00474             input_tag         = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;
-<a name="l00475"></a>00475             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00476"></a>00476             unmapped_tag      = <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>;
-<a name="l00477"></a>00477             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>;
-<a name="l00478"></a>00478         }
-<a name="l00479"></a>00479     }
-<a name="l00480"></a>00480     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stdb) {
-<a name="l00481"></a>00481         <span class="keywordflow">if</span> (mxu) {
-<a name="l00482"></a>00482             input_tag         = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;
-<a name="l00483"></a>00483             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00484"></a>00484             unmapped_tag      = <span class="stringliteral">"UNMAPPED_STD_MXU"</span>;
-<a name="l00485"></a>00485             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>;
-<a name="l00486"></a>00486         }
-<a name="l00487"></a>00487         <span class="keywordflow">else</span> {
-<a name="l00488"></a>00488             input_tag         = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;
-<a name="l00489"></a>00489             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00490"></a>00490             unmapped_tag      = <span class="stringliteral">"UNMAPPED_STD_MOS"</span>;
-<a name="l00491"></a>00491             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>;
-<a name="l00492"></a>00492         }
-<a name="l00493"></a>00493     }
-<a name="l00494"></a>00494     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_scif) {
-<a name="l00495"></a>00495         <span class="keywordflow">if</span> (mxu) {
-<a name="l00496"></a>00496             input_tag         = <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>;
-<a name="l00497"></a>00497             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00498"></a>00498             unmapped_tag      = <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>;
-<a name="l00499"></a>00499             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>;
-<a name="l00500"></a>00500         }
-<a name="l00501"></a>00501         <span class="keywordflow">else</span> {   
-<a name="l00502"></a>00502             input_tag         = <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>;
-<a name="l00503"></a>00503             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00504"></a>00504             unmapped_tag      = <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>;
-<a name="l00505"></a>00505             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>;
-<a name="l00506"></a>00506         }
-<a name="l00507"></a>00507     }
-<a name="l00508"></a>00508     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stdf) {
-<a name="l00509"></a>00509         <span class="keywordflow">if</span> (mxu) {
-<a name="l00510"></a>00510             input_tag         = <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>;
-<a name="l00511"></a>00511             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00512"></a>00512             unmapped_tag      = <span class="stringliteral">"UNMAPPED_STD_MXU"</span>;
-<a name="l00513"></a>00513             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>;
-<a name="l00514"></a>00514         }
-<a name="l00515"></a>00515         <span class="keywordflow">else</span> {   
-<a name="l00516"></a>00516             input_tag         = <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>;
-<a name="l00517"></a>00517             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00518"></a>00518             unmapped_tag      = <span class="stringliteral">"UNMAPPED_STD_MOS"</span>;
-<a name="l00519"></a>00519             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>;
-<a name="l00520"></a>00520         }
-<a name="l00521"></a>00521     }
-<a name="l00522"></a>00522 
-<a name="l00523"></a>00523 
-<a name="l00524"></a>00524     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, input_tag, 0);
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00527"></a>00527         fors_subtract_sky_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l00528"></a>00528 
-<a name="l00529"></a>00529     <span class="keywordflow">if</span> (mos)
-<a name="l00530"></a>00530         maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00531"></a>00531     <span class="keywordflow">else</span>
-<a name="l00532"></a>00532         maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00533"></a>00533 
-<a name="l00534"></a>00534     <span class="comment">/*</span>
-<a name="l00535"></a>00535 <span class="comment">     * Check if all slits have the same X offset: if not, abort!</span>
-<a name="l00536"></a>00536 <span class="comment">     */</span>
-<a name="l00537"></a>00537 
-<a name="l00538"></a>00538     treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l00539"></a>00539 
-<a name="l00540"></a>00540     cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00541"></a>00541 
-<a name="l00542"></a>00542     <span class="keywordflow">if</span> (treat_as_lss)
-<a name="l00543"></a>00543         fors_subtract_sky_exit(<span class="stringliteral">"This recipe cannot process MOS/MXU "</span>
-<a name="l00544"></a>00544                                <span class="stringliteral">"data with all slits at the same offset."</span>);
-<a name="l00545"></a>00545 
-<a name="l00546"></a>00546 
-<a name="l00547"></a>00547     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00548"></a>00548         fors_subtract_sky_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00549"></a>00549 
-<a name="l00550"></a>00550     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00551"></a>00551         fors_subtract_sky_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00552"></a>00552 
-<a name="l00553"></a>00553     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00554"></a>00554         fors_subtract_sky_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00555"></a>00555 
-<a name="l00556"></a>00556 
-<a name="l00557"></a>00557     <span class="comment">/*</span>
-<a name="l00558"></a>00558 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00559"></a>00559 <span class="comment">     * dispersion direction from the reference frame</span>
-<a name="l00560"></a>00560 <span class="comment">     */</span>
-<a name="l00561"></a>00561 
-<a name="l00562"></a>00562     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00563"></a>00563     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00564"></a>00564         fors_subtract_sky_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span>
-<a name="l00565"></a>00565                             <span class="stringliteral">"header"</span>);
-<a name="l00566"></a>00566 
-<a name="l00567"></a>00567     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00568"></a>00568         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00569"></a>00569     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00570"></a>00570         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00571"></a>00571 
-<a name="l00572"></a>00572     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00573"></a>00573 
-<a name="l00574"></a>00574     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00575"></a>00575         fors_subtract_sky_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span>
-<a name="l00576"></a>00576                             <span class="stringliteral">"in reference frame header"</span>);
-<a name="l00577"></a>00577 
-<a name="l00578"></a>00578     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l00579"></a>00579         reference *= 10;
-<a name="l00580"></a>00580 
-<a name="l00581"></a>00581     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l00582"></a>00582         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l00583"></a>00583                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in reference frame header"</span>,
-<a name="l00584"></a>00584                       reference);
-<a name="l00585"></a>00585         fors_subtract_sky_exit(NULL);
-<a name="l00586"></a>00586     }
-<a name="l00587"></a>00587 
-<a name="l00588"></a>00588     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l00589"></a>00589 
-<a name="l00590"></a>00590     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00593"></a>00593         fors_subtract_sky_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00594"></a>00594                             <span class="stringliteral">"in reference frame header"</span>);
-<a name="l00595"></a>00595 
-<a name="l00596"></a>00596     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l00597"></a>00597         dispersion *= rebin;
-<a name="l00598"></a>00598         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l00599"></a>00599                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,
-<a name="l00600"></a>00600                         dispersion);
-<a name="l00601"></a>00601     }
-<a name="l00602"></a>00602 
-<a name="l00603"></a>00603     <span class="keywordflow">if</span> (cosmics) {
-<a name="l00604"></a>00604         gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l00605"></a>00605 
-<a name="l00606"></a>00606         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00607"></a>00607             fors_subtract_sky_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in "</span>
-<a name="l00608"></a>00608                                    <span class="stringliteral">"scientific frame header"</span>);
-<a name="l00609"></a>00609 
-<a name="l00610"></a>00610         cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l00611"></a>00611     }
-<a name="l00612"></a>00612 
-<a name="l00613"></a>00613 
-<a name="l00614"></a>00614     cpl_msg_indent_less();
-<a name="l00615"></a>00615     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);
-<a name="l00616"></a>00616     cpl_msg_indent_more();
-<a name="l00617"></a>00617 
-<a name="l00618"></a>00618     spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, input_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00619"></a>00619     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00620"></a>00620         fors_subtract_sky_exit(<span class="stringliteral">"Cannot load input scientific frame"</span>);
-<a name="l00621"></a>00621 
-<a name="l00622"></a>00622     slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l00623"></a>00623     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00624"></a>00624         fors_subtract_sky_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l00625"></a>00625 
-<a name="l00626"></a>00626     polytraces = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, curv_coeff_tag, 1);
-<a name="l00627"></a>00627     <span class="keywordflow">if</span> (polytraces == NULL)
-<a name="l00628"></a>00628         fors_subtract_sky_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);
-<a name="l00629"></a>00629 
-<a name="l00630"></a>00630     cpl_msg_indent_less();
-<a name="l00631"></a>00631     cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l00632"></a>00632     cpl_msg_indent_more();
-<a name="l00633"></a>00633     skymap = <a class="code" href="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f">mos_subtract_sky</a>(spectra, slits, polytraces, reference,
-<a name="l00634"></a>00634                               startwavelength, endwavelength, dispersion);
-<a name="l00635"></a>00635 
-<a name="l00636"></a>00636     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l00637"></a>00637     cpl_table_delete(slits); slits = NULL;
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639     <span class="keywordflow">if</span> (cosmics) {
-<a name="l00640"></a>00640         cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);
-<a name="l00641"></a>00641         <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(spectra, gain, -1., -1.);
-<a name="l00642"></a>00642     }
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, spectra, unmapped_tag,
-<a name="l00645"></a>00645                        header, parlist, recipe, version))
-<a name="l00646"></a>00646         fors_subtract_sky_exit(NULL);
-<a name="l00647"></a>00647 
-<a name="l00648"></a>00648     cpl_image_delete(spectra); spectra = NULL;
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, skymap, unmapped_sky_tag,
-<a name="l00651"></a>00651                        header, parlist, recipe, version))
-<a name="l00652"></a>00652         fors_subtract_sky_exit(NULL);
-<a name="l00653"></a>00653 
-<a name="l00654"></a>00654     cpl_image_delete(skymap); skymap = NULL;
-<a name="l00655"></a>00655 
-<a name="l00656"></a>00656     cpl_propertylist_delete(header); header = NULL;
-<a name="l00657"></a>00657 
-<a name="l00658"></a>00658     <span class="keywordflow">return</span> 0;
-<a name="l00659"></a>00659 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__subtract__sky_8c_source.html b/html/fors__subtract__sky_8c_source.html
new file mode 100644
index 0000000..8a28500
--- /dev/null
+++ b/html/fors__subtract__sky_8c_source.html
@@ -0,0 +1,674 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_subtract_sky.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_subtract_sky.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_subtract_sky.c,v 1.8 2013-04-24 14:14:13 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-04-24 14:14:13 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_subtract_sky_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to subtract the sky emission from unrebinned slit\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"spectra. This is obtained by robust fitting (i.e., excluding the signal\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"from possible point-like objects in slit) of the emission along the CCD\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"columns within each spectrum). This method doesn't work if extended\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"objects are in slit (it really destroys the object spectra), and is\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"not applicable to LSS data. The input scientific frames are produced\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"by the recipes fors_remove_bias and fors_flatfield.\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"This recipe cannot be applied to LSS or long-slit like data (MOS/MXU with\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"all slits at the same offset). No automatic recipe is available for this.\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"Please refer to the FORS Pipeline User's Manual for more details.\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS, and\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"SCI as STD.\n\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  SCIENCE_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"  or SCIENCE_UNFLAT_MXU\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"  or STANDARD_UNBIAS_MXU\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"  or STANDARD_UNFLAT_MXU     Calib       Frame with sky lines    Y\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      Y\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location on CCD    Y\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  UNMAPPED_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  or UNMAPPED_STD_MXU        FITS image  Sky subtracted scientific frame\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"  UNMAPPED_SKY_SCI_MXU\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"  or UNMAPPED_SKY_STD_MXU    FITS image  Subtracted sky frame\n\n"</span>;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">#define fors_subtract_sky_exit(message)       \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">#define fors_subtract_sky_exit_memcheck(message)   \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">cpl_image_delete(spectra);                      \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">printf("free skymap (%p)\n", skymap);           \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">cpl_image_delete(skymap);                       \</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">cpl_table_delete(grism_table);                  \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">cpl_table_delete(maskslits);                    \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">cpl_table_delete(slits);                        \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">cpl_table_delete(polytraces);                   \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> {</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                     <span class="stringliteral">"fors_subtract_sky"</span>,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                     <span class="stringliteral">"Subtract sky from scientific spectra"</span>,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                     fors_subtract_sky_description,</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                     fors_subtract_sky_create,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                     fors_subtract_sky_exec,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                     fors_subtract_sky_destroy);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> }</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> {</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> </div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_subtract_sky.dispersion"</span>,</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                                 <span class="stringliteral">"fors.fors_subtract_sky"</span>,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                                 0.0);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_subtract_sky.startwavelength"</span>,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                                 <span class="stringliteral">"fors.fors_subtract_sky"</span>,</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                                 0.0);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_subtract_sky.endwavelength"</span>,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>                                 <span class="stringliteral">"fors.fors_subtract_sky"</span>,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                                 0.0);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> <span class="comment">     * Cosmic rays removal</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_subtract_sky.cosmics"</span>,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                                 <span class="stringliteral">"Eliminate cosmic rays hits"</span>,</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                                 <span class="stringliteral">"fors.fors_subtract_sky"</span>,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                 FALSE);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> }</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> </div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> {</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="keywordflow">return</span> fors_subtract_sky(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> }</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> {</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> }</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> </div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> {</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_subtract_sky"</span>;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     <span class="keywordtype">int</span>         cosmics;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> </div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cpl_image        *spectra     = NULL;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     cpl_image        *skymap      = NULL;</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     cpl_table        *polytraces  = NULL;</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     cpl_table        *maskslits   = NULL;</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *input_tag;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_tag;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_sky_tag;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordtype">int</span>         nframes;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keywordtype">int</span>         nslits;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordtype">int</span>         treat_as_lss;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordtype">double</span>      gain;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordtype">double</span>     *xpos;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordtype">int</span>         mxu, mos, lss;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="keywordtype">int</span>         rec_scib;</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     <span class="keywordtype">int</span>         rec_stdb;</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordtype">int</span>         rec_scif;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     <span class="keywordtype">int</span>         rec_stdf;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     <span class="keywordtype">int</span>         nslits_out_det = 0;</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> </div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> </div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> </div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>         fors_subtract_sky_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> </div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                     <span class="stringliteral">"fors.fors_subtract_sky.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>         fors_subtract_sky_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>                     <span class="stringliteral">"fors.fors_subtract_sky.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>             fors_subtract_sky_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> </div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>                     <span class="stringliteral">"fors.fors_subtract_sky.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>             fors_subtract_sky_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>             fors_subtract_sky_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     }</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>             fors_subtract_sky_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     cosmics = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                                      <span class="stringliteral">"fors.fors_subtract_sky.cosmics"</span>, NULL);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> </div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         fors_subtract_sky_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     mxu  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MXU"</span>);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     mos  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_MOS"</span>);</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     lss  = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SLIT_LOCATION_LSS"</span>);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> </div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     <span class="keywordflow">if</span> (lss)</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>         fors_subtract_sky_exit(<span class="stringliteral">"Use this recipe just with MOS/MXU data."</span>);</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> </div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     nframes = mos + mxu;</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         fors_subtract_sky_exit(<span class="stringliteral">"Missing input slit location table"</span>);</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     }</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>         cpl_msg_error(recipe, </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                       <span class="stringliteral">"Too many input slit location tables (%d > 1)"</span>, nframes);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>         fors_subtract_sky_exit(NULL);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     }</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     <span class="keywordflow">if</span> (mxu)</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         curv_coeff_tag = <span class="stringliteral">"CURV_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         curv_coeff_tag = <span class="stringliteral">"CURV_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> </div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     </div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     nframes = cpl_frameset_count_tags(frameset, curv_coeff_tag);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> </div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing input %s"</span>, curv_coeff_tag);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         fors_subtract_sky_exit(NULL);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     }</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input %s (%d > 1)"</span>, curv_coeff_tag,</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                       nframes);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         fors_subtract_sky_exit(NULL);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     }</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> </div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>         rec_scib = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>         rec_stdb = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>         rec_scif = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>         rec_stdf = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     }</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>         rec_scib = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         rec_stdb = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         rec_scif = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>);</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>         rec_stdf = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     }</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     nframes = rec_scib + rec_stdb + rec_scif + rec_stdf;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="keywordflow">if</span> (nframes == 0) {</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>         fors_subtract_sky_exit(<span class="stringliteral">"Missing input scientific spectra"</span>);</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     }</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input scientific spectra (%d > 1)"</span>, </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>                       nframes);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         fors_subtract_sky_exit(NULL);</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     }</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> </div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     <span class="keywordflow">if</span> (rec_scib) {</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>             input_tag         = <span class="stringliteral">"SCIENCE_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>             unmapped_tag      = <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         }</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>             input_tag         = <span class="stringliteral">"SCIENCE_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>             unmapped_tag      = <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         }</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     }</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stdb) {</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>             input_tag         = <span class="stringliteral">"STANDARD_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>             unmapped_tag      = <span class="stringliteral">"UNMAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         }</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>             input_tag         = <span class="stringliteral">"STANDARD_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>             unmapped_tag      = <span class="stringliteral">"UNMAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>         }</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     }</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_scif) {</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>             input_tag         = <span class="stringliteral">"SCIENCE_UNFLAT_MXU"</span>;</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>             unmapped_tag      = <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>         }</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>         <span class="keywordflow">else</span> {   </div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>             input_tag         = <span class="stringliteral">"SCIENCE_UNFLAT_MOS"</span>;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>             unmapped_tag      = <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         }</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     }</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rec_stdf) {</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>             input_tag         = <span class="stringliteral">"STANDARD_UNFLAT_MXU"</span>;</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>             unmapped_tag      = <span class="stringliteral">"UNMAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         }</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>         <span class="keywordflow">else</span> {   </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>             input_tag         = <span class="stringliteral">"STANDARD_UNFLAT_MOS"</span>;</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>             slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>             unmapped_tag      = <span class="stringliteral">"UNMAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>             unmapped_sky_tag  = <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>         }</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>     }</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span> </div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> </div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, input_tag, 0);</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>         fors_subtract_sky_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span> </div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>         maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>         maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> </div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> <span class="comment">     * Check if all slits have the same X offset: if not, abort!</span></div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> </div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span> </div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> </div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>     <span class="keywordflow">if</span> (treat_as_lss)</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>         fors_subtract_sky_exit(<span class="stringliteral">"This recipe cannot process MOS/MXU "</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>                                <span class="stringliteral">"data with all slits at the same offset."</span>);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span> </div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span> </div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         fors_subtract_sky_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         fors_subtract_sky_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> </div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>         fors_subtract_sky_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span> </div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> <span class="comment">     * dispersion direction from the reference frame</span></div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> </div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         fors_subtract_sky_exit(<span class="stringliteral">"Missing keyword INSTRUME in reference frame "</span></div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>                             <span class="stringliteral">"header"</span>);</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> </div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> </div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span> </div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         fors_subtract_sky_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span></div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>                             <span class="stringliteral">"in reference frame header"</span>);</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         reference *= 10;</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> </div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in reference frame header"</span>,</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>                       reference);</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>         fors_subtract_sky_exit(NULL);</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     }</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span> </div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span> </div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> </div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>         fors_subtract_sky_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>                             <span class="stringliteral">"in reference frame header"</span>);</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> </div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>                         dispersion);</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     }</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span> </div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     <span class="keywordflow">if</span> (cosmics) {</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>         gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> </div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>             fors_subtract_sky_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in "</span></div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>                                    <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     }</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span> </div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span> </div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span> </div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, input_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>         fors_subtract_sky_exit(<span class="stringliteral">"Cannot load input scientific frame"</span>);</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span> </div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>         fors_subtract_sky_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span> </div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     polytraces = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, curv_coeff_tag, 1);</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="keywordflow">if</span> (polytraces == NULL)</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         fors_subtract_sky_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> </div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     skymap = <a class="code" href="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2" title="Subtract the sky from the scientific CCD exposure.">mos_subtract_sky</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>                               startwavelength, endwavelength, dispersion);</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> </div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>     <span class="keywordflow">if</span> (cosmics) {</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>         cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>         <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(spectra, gain, -1., -1.);</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     }</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> </div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, spectra, unmapped_tag,</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>                        header, parlist, recipe, version))</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>         fors_subtract_sky_exit(NULL);</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> </div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, skymap, unmapped_sky_tag,</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>                        header, parlist, recipe, version))</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>         fors_subtract_sky_exit(NULL);</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span> </div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span> </div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span> </div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__subtract__sky__lss_8c-source.html b/html/fors__subtract__sky__lss_8c-source.html
deleted file mode 100644
index 2e3c11a..0000000
--- a/html/fors__subtract__sky__lss_8c-source.html
+++ /dev/null
@@ -1,418 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_subtract_sky_lss.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_subtract_sky_lss.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_subtract_sky_lss.c,v 1.5 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.5 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_subtract_sky_lss_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to subtract the sky from wavelength calibrated\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"scientific spectra produced by the recipe fors_resample. A simple median\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"signal level is subtracted from each image column.\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"In the table below the MXU acronym can be read alternatively as MOS\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"and LSS, depending on the instrument mode of the input data. The acronym\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"SCI may be read STD in case of standard stars observations.\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"Note that only LSS or LSS-like MOS/MXU data are to be processed by this\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"recipe.\n\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"  MAPPED_ALL_SCI_MXU         Raw         Scientific exposure     Y\n\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"  MAPPED_SCI_MXU             FITS image  Rectified scientific spectra\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  MAPPED_SKY_SCI_MXU         FITS image  Rectified sky spectra\n\n"</span>;
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="preprocessor">#define fors_subtract_sky_lss_exit(message)            \</span>
-<a name="l00060"></a>00060 <span class="preprocessor">{                                             \</span>
-<a name="l00061"></a>00061 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">cpl_image_delete(sky);                        \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00067"></a>00067 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">}</span>
-<a name="l00069"></a>00069 <span class="preprocessor"></span>
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071 <span class="preprocessor">#define fors_subtract_sky_lss_exit_memcheck(message)   \</span>
-<a name="l00072"></a>00072 <span class="preprocessor">{                                             \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">cpl_image_delete(sky);                        \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">return 0;                                     \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">}</span>
-<a name="l00081"></a>00081 <span class="preprocessor"></span>
-<a name="l00082"></a>00082 
-<a name="l00094"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00094</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00095"></a>00095 {
-<a name="l00096"></a>00096     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00097"></a>00097     cpl_plugin *plugin = &recipe->interface;
-<a name="l00098"></a>00098 
-<a name="l00099"></a>00099     cpl_plugin_init(plugin,
-<a name="l00100"></a>00100                     CPL_PLUGIN_API,
-<a name="l00101"></a>00101                     FORS_BINARY_VERSION,
-<a name="l00102"></a>00102                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00103"></a>00103                     <span class="stringliteral">"fors_subtract_sky_lss"</span>,
-<a name="l00104"></a>00104                     <span class="stringliteral">"Subtract sky from calibrated long slit exposure"</span>,
-<a name="l00105"></a>00105                     fors_subtract_sky_lss_description,
-<a name="l00106"></a>00106                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00107"></a>00107                     PACKAGE_BUGREPORT,
-<a name="l00108"></a>00108     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00109"></a>00109     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00110"></a>00110     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00111"></a>00111     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00112"></a>00112     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00113"></a>00113     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00114"></a>00114     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00115"></a>00115     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00116"></a>00116     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00117"></a>00117     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00118"></a>00118     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00119"></a>00119     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00120"></a>00120     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00121"></a>00121                     fors_subtract_sky_lss_create,
-<a name="l00122"></a>00122                     fors_subtract_sky_lss_exec,
-<a name="l00123"></a>00123                     fors_subtract_sky_lss_destroy);
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     cpl_pluginlist_append(list, plugin);
-<a name="l00126"></a>00126     
-<a name="l00127"></a>00127     <span class="keywordflow">return</span> 0;
-<a name="l00128"></a>00128 }
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130 
-<a name="l00141"></a>00141 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_create(cpl_plugin *plugin)
-<a name="l00142"></a>00142 {
-<a name="l00143"></a>00143     cpl_recipe    *recipe;
-<a name="l00144"></a>00144 <span class="comment">/* Uncomment in case parameters are defined</span>
-<a name="l00145"></a>00145 <span class="comment">    cpl_parameter *p;</span>
-<a name="l00146"></a>00146 <span class="comment">*/</span>
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     <span class="comment">/* </span>
-<a name="l00149"></a>00149 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00150"></a>00150 <span class="comment">     */</span>
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00153"></a>00153         recipe = (cpl_recipe *)plugin;
-<a name="l00154"></a>00154     <span class="keywordflow">else</span> 
-<a name="l00155"></a>00155         <span class="keywordflow">return</span> -1;
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157     <span class="comment">/* </span>
-<a name="l00158"></a>00158 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00159"></a>00159 <span class="comment">     */</span>
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">return</span> 0;
-<a name="l00164"></a>00164 }
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166 
-<a name="l00175"></a>00175 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_exec(cpl_plugin *plugin)
-<a name="l00176"></a>00176 {
-<a name="l00177"></a>00177     cpl_recipe *recipe;
-<a name="l00178"></a>00178     
-<a name="l00179"></a>00179     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00180"></a>00180         recipe = (cpl_recipe *)plugin;
-<a name="l00181"></a>00181     <span class="keywordflow">else</span> 
-<a name="l00182"></a>00182         <span class="keywordflow">return</span> -1;
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">return</span> fors_subtract_sky_lss(recipe->parameters, recipe->frames);
-<a name="l00185"></a>00185 }
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187 
-<a name="l00196"></a>00196 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_destroy(cpl_plugin *plugin)
-<a name="l00197"></a>00197 {
-<a name="l00198"></a>00198     cpl_recipe *recipe;
-<a name="l00199"></a>00199     
-<a name="l00200"></a>00200     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00201"></a>00201         recipe = (cpl_recipe *)plugin;
-<a name="l00202"></a>00202     <span class="keywordflow">else</span> 
-<a name="l00203"></a>00203         <span class="keywordflow">return</span> -1;
-<a name="l00204"></a>00204 
-<a name="l00205"></a>00205     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00206"></a>00206 
-<a name="l00207"></a>00207     <span class="keywordflow">return</span> 0;
-<a name="l00208"></a>00208 }
-<a name="l00209"></a>00209 
-<a name="l00210"></a>00210 
-<a name="l00220"></a>00220 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss(cpl_parameterlist *parlist, 
-<a name="l00221"></a>00221                                  cpl_frameset *frameset)
-<a name="l00222"></a>00222 {
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_subtract_sky_lss"</span>;
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227     <span class="comment">/*</span>
-<a name="l00228"></a>00228 <span class="comment">     * Input parameters (none)</span>
-<a name="l00229"></a>00229 <span class="comment">     */</span>
-<a name="l00230"></a>00230 
-<a name="l00231"></a>00231     <span class="comment">/*</span>
-<a name="l00232"></a>00232 <span class="comment">     * CPL objects</span>
-<a name="l00233"></a>00233 <span class="comment">     */</span>
-<a name="l00234"></a>00234 
-<a name="l00235"></a>00235     cpl_image        *spectra   = NULL;
-<a name="l00236"></a>00236     cpl_image        *skymap    = NULL;
-<a name="l00237"></a>00237     cpl_image        *sky       = NULL;
-<a name="l00238"></a>00238     cpl_table        *maskslits = NULL;
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240     cpl_propertylist *header    = NULL;
-<a name="l00241"></a>00241 
-<a name="l00242"></a>00242     <span class="comment">/*</span>
-<a name="l00243"></a>00243 <span class="comment">     * Auxiliary variables</span>
-<a name="l00244"></a>00244 <span class="comment">     */</span>
-<a name="l00245"></a>00245 
-<a name="l00246"></a>00246     <span class="keywordtype">char</span>        version[80];
-<a name="l00247"></a>00247     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00248"></a>00248     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_tag;
-<a name="l00249"></a>00249     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_sky_tag;
-<a name="l00250"></a>00250     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_sky_tag;
-<a name="l00251"></a>00251     <span class="keywordtype">int</span>         mxu, mos, lss;
-<a name="l00252"></a>00252     <span class="keywordtype">int</span>         treat_as_lss = 0;
-<a name="l00253"></a>00253     <span class="keywordtype">int</span>         nslits;
-<a name="l00254"></a>00254     <span class="keywordtype">int</span>         nscience;
-<a name="l00255"></a>00255     <span class="keywordtype">double</span>     *xpos;
-<a name="l00256"></a>00256     <span class="keywordtype">double</span>      mxpos;
-<a name="l00257"></a>00257     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00258"></a>00258     <span class="keywordtype">int</span>         standard;
-<a name="l00259"></a>00259     <span class="keywordtype">float</span>      *data;
-<a name="l00260"></a>00260     <span class="keywordtype">float</span>      *sdata;
-<a name="l00261"></a>00261     <span class="keywordtype">int</span>         i, j;
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263 
-<a name="l00264"></a>00264     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266     cpl_msg_set_indentation(2);
-<a name="l00267"></a>00267 
-<a name="l00268"></a>00268 
-<a name="l00269"></a>00269     <span class="comment">/* </span>
-<a name="l00270"></a>00270 <span class="comment">     * Get configuration parameters (none)</span>
-<a name="l00271"></a>00271 <span class="comment">     */</span>
-<a name="l00272"></a>00272 
-<a name="l00273"></a>00273     <span class="comment">/* </span>
-<a name="l00274"></a>00274 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00275"></a>00275 <span class="comment">     */</span>
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277     cpl_msg_indent_less();
-<a name="l00278"></a>00278     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00279"></a>00279     cpl_msg_indent_more();
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281     mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>);
-<a name="l00282"></a>00282     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>);
-<a name="l00283"></a>00283     lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>);
-<a name="l00284"></a>00284     standard = 0;
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286     <span class="keywordflow">if</span> (mxu + mos + lss == 0) {
-<a name="l00287"></a>00287         mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>);
-<a name="l00288"></a>00288         mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>);
-<a name="l00289"></a>00289         lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>);
-<a name="l00290"></a>00290         standard = 1;
-<a name="l00291"></a>00291     }
-<a name="l00292"></a>00292 
-<a name="l00293"></a>00293     <span class="keywordflow">if</span> (mxu + mos + lss == 0)
-<a name="l00294"></a>00294         fors_subtract_sky_lss_exit(<span class="stringliteral">"Missing input scientific frame"</span>);
-<a name="l00295"></a>00295 
-<a name="l00296"></a>00296     nscience = mxu + mos + lss;
-<a name="l00297"></a>00297 
-<a name="l00298"></a>00298     <span class="keywordflow">if</span> (nscience > 1)
-<a name="l00299"></a>00299         fors_subtract_sky_lss_exit(<span class="stringliteral">"More than one scientific frame in input"</span>); 
-<a name="l00300"></a>00300 
-<a name="l00301"></a>00301     <span class="keywordflow">if</span> (mxu) {
-<a name="l00302"></a>00302         <span class="keywordflow">if</span> (standard) {
-<a name="l00303"></a>00303             cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);
-<a name="l00304"></a>00304             mapped_science_tag     = <span class="stringliteral">"MAPPED_STD_MXU"</span>;
-<a name="l00305"></a>00305             mapped_science_sky_tag = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;
-<a name="l00306"></a>00306             mapped_sky_tag         = <span class="stringliteral">"MAPPED_SKY_STD_MXU"</span>;
-<a name="l00307"></a>00307         }
-<a name="l00308"></a>00308         <span class="keywordflow">else</span> {
-<a name="l00309"></a>00309             cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);
-<a name="l00310"></a>00310             mapped_science_tag     = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;
-<a name="l00311"></a>00311             mapped_science_sky_tag = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;
-<a name="l00312"></a>00312             mapped_sky_tag         = <span class="stringliteral">"MAPPED_SKY_SCI_MXU"</span>;
-<a name="l00313"></a>00313         }
-<a name="l00314"></a>00314     }
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     <span class="keywordflow">if</span> (lss) {
-<a name="l00317"></a>00317         <span class="keywordflow">if</span> (standard) {
-<a name="l00318"></a>00318             cpl_msg_info(recipe, <span class="stringliteral">"LSS data found"</span>);
-<a name="l00319"></a>00319             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_LSS"</span>;
-<a name="l00320"></a>00320             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>;
-<a name="l00321"></a>00321             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_LSS"</span>;
-<a name="l00322"></a>00322         }
-<a name="l00323"></a>00323         <span class="keywordflow">else</span> {
-<a name="l00324"></a>00324             cpl_msg_info(recipe, <span class="stringliteral">"LSS data found"</span>);
-<a name="l00325"></a>00325             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_LSS"</span>;
-<a name="l00326"></a>00326             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>;
-<a name="l00327"></a>00327             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_LSS"</span>;
-<a name="l00328"></a>00328         }
-<a name="l00329"></a>00329     }
-<a name="l00330"></a>00330 
-<a name="l00331"></a>00331     <span class="keywordflow">if</span> (mos) {
-<a name="l00332"></a>00332         <span class="keywordflow">if</span> (standard) {
-<a name="l00333"></a>00333             cpl_msg_info(recipe, <span class="stringliteral">"MOS data found"</span>);
-<a name="l00334"></a>00334             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_MOS"</span>;
-<a name="l00335"></a>00335             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;
-<a name="l00336"></a>00336             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_MOS"</span>;
-<a name="l00337"></a>00337         }
-<a name="l00338"></a>00338         <span class="keywordflow">else</span> {
-<a name="l00339"></a>00339             cpl_msg_info(recipe, <span class="stringliteral">"MOS data found"</span>);
-<a name="l00340"></a>00340             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;
-<a name="l00341"></a>00341             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;
-<a name="l00342"></a>00342             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_MOS"</span>;
-<a name="l00343"></a>00343         }
-<a name="l00344"></a>00344     }
-<a name="l00345"></a>00345 
-<a name="l00346"></a>00346     <span class="comment">/*</span>
-<a name="l00347"></a>00347 <span class="comment">     * Loading input data</span>
-<a name="l00348"></a>00348 <span class="comment">     */</span>
-<a name="l00349"></a>00349 
-<a name="l00350"></a>00350     cpl_msg_info(recipe, <span class="stringliteral">"Load mapped scientific exposure..."</span>);
-<a name="l00351"></a>00351     cpl_msg_indent_more();
-<a name="l00352"></a>00352 
-<a name="l00353"></a>00353     spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, mapped_science_sky_tag, 
-<a name="l00354"></a>00354                              CPL_TYPE_FLOAT, 0, 0);
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00357"></a>00357         fors_subtract_sky_lss_exit(<span class="stringliteral">"Cannot load input frame"</span>);
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, mapped_science_sky_tag, 0);
-<a name="l00360"></a>00360 
-<a name="l00361"></a>00361     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00362"></a>00362         fors_subtract_sky_lss_exit(<span class="stringliteral">"Cannot load input frame header"</span>);
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00365"></a>00365     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00366"></a>00366         fors_subtract_sky_lss_exit(<span class="stringliteral">"Missing keyword INSTRUME in scientific header"</span>);
-<a name="l00367"></a>00367     instrume = cpl_strdup(instrume);
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00370"></a>00370         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00371"></a>00371     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00372"></a>00372         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374     cpl_free(instrume); instrume = NULL;
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     cpl_msg_indent_less();
-<a name="l00377"></a>00377 
-<a name="l00378"></a>00378     <span class="keywordflow">if</span> (mos || mxu) {
-<a name="l00379"></a>00379         <span class="keywordtype">int</span> nslits_out_det = 0;
-<a name="l00380"></a>00380 
-<a name="l00381"></a>00381         <span class="keywordflow">if</span> (mos)
-<a name="l00382"></a>00382             maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00383"></a>00383         <span class="keywordflow">else</span>
-<a name="l00384"></a>00384             maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386         <span class="comment">/*</span>
-<a name="l00387"></a>00387 <span class="comment">         * Check if all slits have the same X offset: in such case,</span>
-<a name="l00388"></a>00388 <span class="comment">         * treat the observation as a long-slit one!</span>
-<a name="l00389"></a>00389 <span class="comment">         */</span>
-<a name="l00390"></a>00390 
-<a name="l00391"></a>00391         treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395         <span class="keywordflow">if</span> (treat_as_lss)
-<a name="l00396"></a>00396             cpl_msg_info(recipe, <span class="stringliteral">"All MOS slits have the same offset: %.2f\n"</span>
-<a name="l00397"></a>00397                          <span class="stringliteral">"The LSS data reduction strategy is applied."</span>,
-<a name="l00398"></a>00398                          mxpos);
-<a name="l00399"></a>00399         <span class="keywordflow">else</span>
-<a name="l00400"></a>00400             fors_subtract_sky_lss_exit(<span class="stringliteral">"This recipe can only be used "</span>
-<a name="l00401"></a>00401                                        <span class="stringliteral">"with LSS-like data"</span>);
-<a name="l00402"></a>00402     }
-<a name="l00403"></a>00403 
-<a name="l00404"></a>00404     nx = cpl_image_get_size_x(spectra);
-<a name="l00405"></a>00405     ny = cpl_image_get_size_y(spectra);
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407     skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l00408"></a>00408     sky    = cpl_image_collapse_median_create(spectra, 0, 0, 1);
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410     data   = cpl_image_get_data(skymap);
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l00413"></a>00413         sdata  = cpl_image_get_data(sky);
-<a name="l00414"></a>00414         <span class="keywordflow">for</span> (j = 0; j < nx; j++) {
-<a name="l00415"></a>00415             *data++ = *sdata++;
-<a name="l00416"></a>00416         }
-<a name="l00417"></a>00417     }
-<a name="l00418"></a>00418 
-<a name="l00419"></a>00419     cpl_image_delete(sky); sky = NULL;
-<a name="l00420"></a>00420     cpl_image_subtract(spectra, skymap);
-<a name="l00421"></a>00421 
-<a name="l00422"></a>00422     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, skymap, mapped_sky_tag, header,
-<a name="l00423"></a>00423                        parlist, recipe, version))
-<a name="l00424"></a>00424         fors_subtract_sky_lss_exit(NULL);
-<a name="l00425"></a>00425 
-<a name="l00426"></a>00426     cpl_image_delete(skymap); skymap = NULL;
-<a name="l00427"></a>00427 
-<a name="l00428"></a>00428     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, spectra, mapped_science_tag, header,
-<a name="l00429"></a>00429                        parlist, recipe, version))
-<a name="l00430"></a>00430         fors_subtract_sky_lss_exit(NULL);
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432     cpl_image_delete(spectra); spectra = NULL;
-<a name="l00433"></a>00433 
-<a name="l00434"></a>00434     cpl_propertylist_delete(header); header = NULL;
-<a name="l00435"></a>00435 
-<a name="l00436"></a>00436     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l00437"></a>00437         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l00438"></a>00438         fors_subtract_sky_lss_exit(NULL);
-<a name="l00439"></a>00439     }
-<a name="l00440"></a>00440     <span class="keywordflow">else</span> 
-<a name="l00441"></a>00441         <span class="keywordflow">return</span> 0;
-<a name="l00442"></a>00442 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__subtract__sky__lss_8c_source.html b/html/fors__subtract__sky__lss_8c_source.html
new file mode 100644
index 0000000..03c3df4
--- /dev/null
+++ b/html/fors__subtract__sky__lss_8c_source.html
@@ -0,0 +1,457 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_subtract_sky_lss.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_subtract_sky_lss.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_subtract_sky_lss.c,v 1.6 2013-10-09 15:59:38 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-09 15:59:38 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.6 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_subtract_sky_lss_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to subtract the sky from wavelength calibrated\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"scientific spectra produced by the recipe fors_resample. A simple median\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"signal level is subtracted from each image column.\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"In the table below the MXU acronym can be read alternatively as MOS\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"and LSS, depending on the instrument mode of the input data. The acronym\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"SCI may be read STD in case of standard stars observations.\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"Note that only LSS or LSS-like MOS/MXU data are to be processed by this\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"recipe.\n\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"  MAPPED_ALL_SCI_MXU         Raw         Scientific exposure     Y\n\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"  MAPPED_SCI_MXU             FITS image  Rectified scientific spectra\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  MAPPED_SKY_SCI_MXU         FITS image  Rectified sky spectra\n\n"</span>;</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">#define fors_subtract_sky_lss_exit(message)            \</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">cpl_image_delete(sky);                        \</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor">#define fors_subtract_sky_lss_exit_memcheck(message)   \</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">cpl_image_delete(sky);                        \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">return 0;                                     \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> {</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                     <span class="stringliteral">"fors_subtract_sky_lss"</span>,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                     <span class="stringliteral">"Subtract sky from calibrated long slit exposure"</span>,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                     fors_subtract_sky_lss_description,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                     fors_subtract_sky_lss_create,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                     fors_subtract_sky_lss_exec,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                     fors_subtract_sky_lss_destroy);</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> }</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> {</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="comment">/* Uncomment in case parameters are defined</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="comment">    cpl_parameter *p;</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> }</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> {</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">return</span> fors_subtract_sky_lss(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> }</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> {</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> }</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_subtract_sky_lss(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                                  cpl_frameset *frameset)</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> {</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_subtract_sky_lss"</span>;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="comment">     * Input parameters (none)</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_image        *spectra   = NULL;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_image        *skymap    = NULL;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_image        *sky       = NULL;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_table        *maskslits = NULL;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     cpl_propertylist *header    = NULL;</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> </div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_tag;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_sky_tag;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_sky_tag;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     <span class="keywordtype">int</span>         mxu, mos, lss;</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="keywordtype">int</span>         treat_as_lss = 0;</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="keywordtype">int</span>         nslits;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="keywordtype">int</span>         nscience;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <span class="keywordtype">double</span>     *xpos;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     <span class="keywordtype">int</span>         standard;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     <span class="keywordtype">float</span>      *data;</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="keywordtype">float</span>      *sdata;</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="keywordtype">int</span>         i, j;</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> <span class="comment">     * Get configuration parameters (none)</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> <span class="comment">     * Check input set-of-frames</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>);</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>);</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     standard = 0;</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="keywordflow">if</span> (mxu + mos + lss == 0) {</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>         mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>         mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>);</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>         lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>);</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         standard = 1;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     }</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     <span class="keywordflow">if</span> (mxu + mos + lss == 0)</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>         fors_subtract_sky_lss_exit(<span class="stringliteral">"Missing input scientific frame"</span>);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> </div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     nscience = mxu + mos + lss;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     <span class="keywordflow">if</span> (nscience > 1)</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>         fors_subtract_sky_lss_exit(<span class="stringliteral">"More than one scientific frame in input"</span>); </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>             cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>             mapped_science_tag     = <span class="stringliteral">"MAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>             mapped_science_sky_tag = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>             mapped_sky_tag         = <span class="stringliteral">"MAPPED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         }</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>             cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>             mapped_science_tag     = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>             mapped_science_sky_tag = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>             mapped_sky_tag         = <span class="stringliteral">"MAPPED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>         }</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     }</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     <span class="keywordflow">if</span> (lss) {</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>             cpl_msg_info(recipe, <span class="stringliteral">"LSS data found"</span>);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_LSS"</span>;</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>;</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_LSS"</span>;</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>         }</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>             cpl_msg_info(recipe, <span class="stringliteral">"LSS data found"</span>);</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>         }</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     }</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> </div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>             cpl_msg_info(recipe, <span class="stringliteral">"MOS data found"</span>);</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>         }</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>             cpl_msg_info(recipe, <span class="stringliteral">"MOS data found"</span>);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>         }</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     }</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> <span class="comment">     * Loading input data</span></div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load mapped scientific exposure..."</span>);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> </div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, mapped_science_sky_tag, </div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>                              CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> </div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>         fors_subtract_sky_lss_exit(<span class="stringliteral">"Cannot load input frame"</span>);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, mapped_science_sky_tag, 0);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>         fors_subtract_sky_lss_exit(<span class="stringliteral">"Cannot load input frame header"</span>);</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>         fors_subtract_sky_lss_exit(<span class="stringliteral">"Missing keyword INSTRUME in scientific header"</span>);</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     instrume = cpl_strdup(instrume);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     cpl_free(instrume); instrume = NULL;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordflow">if</span> (mos || mxu) {</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>         <span class="keywordtype">int</span> nslits_out_det = 0;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> </div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>         <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>             maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>             maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment">         * Check if all slits have the same X offset: in such case,</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="comment">         * treat the observation as a long-slit one!</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> </div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>         treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>         <span class="keywordflow">if</span> (treat_as_lss)</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>             cpl_msg_info(recipe, <span class="stringliteral">"All MOS slits have the same offset: %.2f\n"</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>                          <span class="stringliteral">"The LSS data reduction strategy is applied."</span>,</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>                          mxpos);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>             fors_subtract_sky_lss_exit(<span class="stringliteral">"This recipe can only be used "</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>                                        <span class="stringliteral">"with LSS-like data"</span>);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     }</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> </div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     sky    = cpl_image_collapse_median_create(spectra, 0, 0, 1);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> </div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     data   = cpl_image_get_data(skymap);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         sdata  = cpl_image_get_data(sky);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>         <span class="keywordflow">for</span> (j = 0; j < nx; j++) {</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>             *data++ = *sdata++;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         }</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     }</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> </div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     cpl_image_delete(sky); sky = NULL;</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     cpl_image_subtract(spectra, skymap);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> </div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, skymap, mapped_sky_tag, header,</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>         fors_subtract_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span> </div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, spectra, mapped_science_tag, header,</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>         fors_subtract_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> </div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> </div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>         cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>         fors_subtract_sky_lss_exit(NULL);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     }</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__sumflux_8c-source.html b/html/fors__sumflux_8c-source.html
deleted file mode 100644
index 20e5ea2..0000000
--- a/html/fors__sumflux_8c-source.html
+++ /dev/null
@@ -1,644 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_sumflux.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_sumflux.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_sumflux.c,v 1.11 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.11 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_create(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_exec(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_destroy(cpl_plugin *);
-<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux(cpl_parameterlist *, cpl_frameset *);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_sumflux_description[] =
-<a name="l00044"></a>00044 <span class="stringliteral">"This recipe is used to monitor any lamp flux on the CCD. The input raw\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"image should be either a FLUX_ARC_LSS or a FLUX_FLAT_LSS frame. After the\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"background subtraction the total signal is integrated and divided by the\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"exposure time and by the total number of CCD original pixels (keeping\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"into account a possible rebinned readout). In the case of FORS2 frames\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"the background is the median level evaluated from the available overscan\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"regions. In the case of FORS1 data, where overscan regions are missing,\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"the background is evaluated as the median level of the first 200 CCD columns\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"for flat field data, while for arc lamp data a background map evaluated\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"from the regions without spectral lines is computed and subtracted. The\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"background subtracted frame is written to output in all cases, and the QC\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"parameters QC LAMP FLUX and QC LAMP FLUXERR are computed.\n\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  DO category:      Type:       Explanation:         Required:\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  FLUX_FLAT_LSS     Raw         Flat field exposure     Y\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  or FLUX_ARC_LSS   Raw         Arc lamp exposure       Y\n\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"  DO category:      Data type:  Explanation:\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"  FLUX_LAMP_LSS     FITS image  Background subtracted integration region\n\n"</span>;
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 <span class="preprocessor">#define fors_sumflux_exit(message)            \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">{                                             \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00067"></a>00067 <span class="preprocessor">cpl_free(instrume);                           \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">cpl_free(pipefile);                           \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">cpl_image_delete(master_bias);                \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">cpl_image_delete(exposure);                   \</span>
-<a name="l00071"></a>00071 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00072"></a>00072 <span class="preprocessor">cpl_propertylist_delete(qclist);              \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">}</span>
-<a name="l00077"></a>00077 <span class="preprocessor"></span>
-<a name="l00078"></a>00078 <span class="preprocessor">#define fors_sumflux_exit_memcheck(message)   \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">{                                             \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">cpl_free(instrume);                           \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_free(pipefile);                           \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_image_delete(master_bias);                \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">cpl_image_delete(exposure);                   \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">cpl_propertylist_delete(qclist);              \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">return 0;                                     \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">}</span>
-<a name="l00091"></a>00091 <span class="preprocessor"></span>
-<a name="l00092"></a>00092 
-<a name="l00104"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00104</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00105"></a>00105 {
-<a name="l00106"></a>00106     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00107"></a>00107     cpl_plugin *plugin = &recipe->interface;
-<a name="l00108"></a>00108 
-<a name="l00109"></a>00109     cpl_plugin_init(plugin,
-<a name="l00110"></a>00110                     CPL_PLUGIN_API,
-<a name="l00111"></a>00111                     FORS_BINARY_VERSION,
-<a name="l00112"></a>00112                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00113"></a>00113                     <span class="stringliteral">"fors_sumflux"</span>,
-<a name="l00114"></a>00114                     <span class="stringliteral">"Integrate flux from all or part of the input frame"</span>,
-<a name="l00115"></a>00115                     fors_sumflux_description,
-<a name="l00116"></a>00116                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00117"></a>00117                     PACKAGE_BUGREPORT,
-<a name="l00118"></a>00118     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00119"></a>00119     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00120"></a>00120     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00121"></a>00121     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00122"></a>00122     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00123"></a>00123     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00124"></a>00124     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00125"></a>00125     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00126"></a>00126     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00127"></a>00127     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00128"></a>00128     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00129"></a>00129     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00130"></a>00130     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00131"></a>00131                     fors_sumflux_create,
-<a name="l00132"></a>00132                     fors_sumflux_exec,
-<a name="l00133"></a>00133                     fors_sumflux_destroy);
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     cpl_pluginlist_append(list, plugin);
-<a name="l00136"></a>00136     
-<a name="l00137"></a>00137     <span class="keywordflow">return</span> 0;
-<a name="l00138"></a>00138 }
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140 
-<a name="l00151"></a>00151 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_create(cpl_plugin *plugin)
-<a name="l00152"></a>00152 {
-<a name="l00153"></a>00153     cpl_recipe    *recipe;
-<a name="l00154"></a>00154     cpl_parameter *p;
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157     <span class="comment">/* </span>
-<a name="l00158"></a>00158 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00159"></a>00159 <span class="comment">     */</span>
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00162"></a>00162         recipe = (cpl_recipe *)plugin;
-<a name="l00163"></a>00163     <span class="keywordflow">else</span> 
-<a name="l00164"></a>00164         <span class="keywordflow">return</span> -1;
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166     <span class="comment">/* </span>
-<a name="l00167"></a>00167 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00168"></a>00168 <span class="comment">     */</span>
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172 
-<a name="l00173"></a>00173     <span class="comment">/*</span>
-<a name="l00174"></a>00174 <span class="comment">     * X coordinate of lower left corner</span>
-<a name="l00175"></a>00175 <span class="comment">     */</span>
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_sumflux.xlow"</span>,
-<a name="l00178"></a>00178                                 CPL_TYPE_INT,
-<a name="l00179"></a>00179                                 <span class="stringliteral">"X coordinate of lower left corner "</span>
-<a name="l00180"></a>00180                                 <span class="stringliteral">"of integration region (pixel)"</span>,
-<a name="l00181"></a>00181                                 <span class="stringliteral">"fors.fors_sumflux"</span>,
-<a name="l00182"></a>00182                                 0);
-<a name="l00183"></a>00183     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xlow"</span>);
-<a name="l00184"></a>00184     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00185"></a>00185     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187     <span class="comment">/*</span>
-<a name="l00188"></a>00188 <span class="comment">     * Y coordinate of lower left corner</span>
-<a name="l00189"></a>00189 <span class="comment">     */</span>
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_sumflux.ylow"</span>,
-<a name="l00192"></a>00192                                 CPL_TYPE_INT,
-<a name="l00193"></a>00193                                 <span class="stringliteral">"Y coordinate of lower left corner "</span>
-<a name="l00194"></a>00194                                 <span class="stringliteral">"of integration region (pixel)"</span>,
-<a name="l00195"></a>00195                                 <span class="stringliteral">"fors.fors_sumflux"</span>,
-<a name="l00196"></a>00196                                 0);
-<a name="l00197"></a>00197     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ylow"</span>);
-<a name="l00198"></a>00198     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00199"></a>00199     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201     <span class="comment">/*</span>
-<a name="l00202"></a>00202 <span class="comment">     * X coordinate of upper right corner</span>
-<a name="l00203"></a>00203 <span class="comment">     */</span>
-<a name="l00204"></a>00204 
-<a name="l00205"></a>00205     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_sumflux.xhigh"</span>,
-<a name="l00206"></a>00206                                 CPL_TYPE_INT,
-<a name="l00207"></a>00207                                 <span class="stringliteral">"X coordinate of upper right corner "</span>
-<a name="l00208"></a>00208                                 <span class="stringliteral">"of integration region (pixel) (0 = CCD size)"</span>,
-<a name="l00209"></a>00209                                 <span class="stringliteral">"fors.fors_sumflux"</span>,
-<a name="l00210"></a>00210                                 0);
-<a name="l00211"></a>00211     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xhigh"</span>);
-<a name="l00212"></a>00212     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00213"></a>00213     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215     <span class="comment">/*</span>
-<a name="l00216"></a>00216 <span class="comment">     * Y coordinate of upper right corner</span>
-<a name="l00217"></a>00217 <span class="comment">     */</span>
-<a name="l00218"></a>00218 
-<a name="l00219"></a>00219     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_sumflux.yhigh"</span>,
-<a name="l00220"></a>00220                                 CPL_TYPE_INT,
-<a name="l00221"></a>00221                                 <span class="stringliteral">"Y coordinate of upper right corner "</span>
-<a name="l00222"></a>00222                                 <span class="stringliteral">"of integration region (pixel) (0 = CCD size)"</span>,
-<a name="l00223"></a>00223                                 <span class="stringliteral">"fors.fors_sumflux"</span>,
-<a name="l00224"></a>00224                                 0);
-<a name="l00225"></a>00225     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"yhigh"</span>);
-<a name="l00226"></a>00226     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00227"></a>00227     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229     <span class="keywordflow">return</span> 0;
-<a name="l00230"></a>00230 }
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232 
-<a name="l00241"></a>00241 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_exec(cpl_plugin *plugin)
-<a name="l00242"></a>00242 {
-<a name="l00243"></a>00243     cpl_recipe *recipe;
-<a name="l00244"></a>00244     
-<a name="l00245"></a>00245     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00246"></a>00246         recipe = (cpl_recipe *)plugin;
-<a name="l00247"></a>00247     <span class="keywordflow">else</span> 
-<a name="l00248"></a>00248         <span class="keywordflow">return</span> -1;
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250     <span class="keywordflow">return</span> fors_sumflux(recipe->parameters, recipe->frames);
-<a name="l00251"></a>00251 }
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253 
-<a name="l00262"></a>00262 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_destroy(cpl_plugin *plugin)
-<a name="l00263"></a>00263 {
-<a name="l00264"></a>00264     cpl_recipe *recipe;
-<a name="l00265"></a>00265     
-<a name="l00266"></a>00266     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00267"></a>00267         recipe = (cpl_recipe *)plugin;
-<a name="l00268"></a>00268     <span class="keywordflow">else</span> 
-<a name="l00269"></a>00269         <span class="keywordflow">return</span> -1;
-<a name="l00270"></a>00270 
-<a name="l00271"></a>00271     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00272"></a>00272 
-<a name="l00273"></a>00273     <span class="keywordflow">return</span> 0;
-<a name="l00274"></a>00274 }
-<a name="l00275"></a>00275 
-<a name="l00276"></a>00276 
-<a name="l00286"></a>00286 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00287"></a>00287 {
-<a name="l00288"></a>00288 
-<a name="l00289"></a>00289     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_sumflux"</span>;
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291 
-<a name="l00292"></a>00292     <span class="comment">/*</span>
-<a name="l00293"></a>00293 <span class="comment">     * Input parameters</span>
-<a name="l00294"></a>00294 <span class="comment">     */</span>
-<a name="l00295"></a>00295 
-<a name="l00296"></a>00296     <span class="keywordtype">int</span> xlow;
-<a name="l00297"></a>00297     <span class="keywordtype">int</span> ylow;
-<a name="l00298"></a>00298     <span class="keywordtype">int</span> xhig;
-<a name="l00299"></a>00299     <span class="keywordtype">int</span> yhig;
-<a name="l00300"></a>00300 
-<a name="l00301"></a>00301     <span class="comment">/*</span>
-<a name="l00302"></a>00302 <span class="comment">     * CPL objects</span>
-<a name="l00303"></a>00303 <span class="comment">     */</span>
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305     cpl_image        *master_bias = NULL;
-<a name="l00306"></a>00306     cpl_image        *exposure    = NULL;
-<a name="l00307"></a>00307     cpl_image        *background  = NULL;
-<a name="l00308"></a>00308     cpl_image        *dummy       = NULL;
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310     cpl_table        *overscans   = NULL;
-<a name="l00311"></a>00311 
-<a name="l00312"></a>00312     cpl_propertylist *header      = NULL;
-<a name="l00313"></a>00313     cpl_propertylist *qclist      = NULL;
-<a name="l00314"></a>00314 
-<a name="l00315"></a>00315     <span class="comment">/*</span>
-<a name="l00316"></a>00316 <span class="comment">     * Auxiliary variables</span>
-<a name="l00317"></a>00317 <span class="comment">     */</span>
-<a name="l00318"></a>00318 
-<a name="l00319"></a>00319     <span class="keyword">const</span> <span class="keywordtype">char</span>   *arc_tag  = <span class="stringliteral">"FLUX_ARC_LSS"</span>;
-<a name="l00320"></a>00320     <span class="keyword">const</span> <span class="keywordtype">char</span>   *flat_tag = <span class="stringliteral">"FLUX_FLAT_LSS"</span>;
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322     <span class="keywordtype">char</span>    version[80];
-<a name="l00323"></a>00323     <span class="keywordtype">char</span>    lamp[20];
-<a name="l00324"></a>00324     <span class="keyword">const</span> <span class="keywordtype">char</span>   *exposure_tag;
-<a name="l00325"></a>00325     <span class="keyword">const</span> <span class="keywordtype">char</span>   *flux_tag = <span class="stringliteral">"FLUX_LAMP_LSS"</span>;
-<a name="l00326"></a>00326     <span class="keywordtype">double</span>  time;
-<a name="l00327"></a>00327     <span class="keywordtype">double</span>  norm_factor;
-<a name="l00328"></a>00328     <span class="keywordtype">int</span>     nframes;
-<a name="l00329"></a>00329     <span class="keywordtype">int</span>     rebin;
-<a name="l00330"></a>00330     <span class="keywordtype">int</span>     nx, ny;
-<a name="l00331"></a>00331     <span class="keywordtype">double</span>  gain;
-<a name="l00332"></a>00332     <span class="keywordtype">double</span>  flux, flux_err;
-<a name="l00333"></a>00333     <span class="keywordtype">int</span>     i;
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335     <span class="keywordtype">char</span>   *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00336"></a>00336     <span class="keywordtype">char</span>   *pipefile = NULL;
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00340"></a>00340 
-<a name="l00341"></a>00341     cpl_msg_set_indentation(2);
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343     <span class="comment">/* </span>
-<a name="l00344"></a>00344 <span class="comment">     * Get configuration parameters</span>
-<a name="l00345"></a>00345 <span class="comment">     */</span>
-<a name="l00346"></a>00346 
-<a name="l00347"></a>00347     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00348"></a>00348     cpl_msg_indent_more();
-<a name="l00349"></a>00349 
-<a name="l00350"></a>00350     xlow = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_sumflux.xlow"</span>, NULL);
-<a name="l00351"></a>00351     ylow = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_sumflux.ylow"</span>, NULL);
-<a name="l00352"></a>00352     xhig = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_sumflux.xhigh"</span>, NULL);
-<a name="l00353"></a>00353     yhig = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_sumflux.yhigh"</span>, NULL);
-<a name="l00354"></a>00354 
-<a name="l00355"></a>00355     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00356"></a>00356         fors_sumflux_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00357"></a>00357 
-<a name="l00358"></a>00358     <span class="keywordflow">if</span> (xlow > xhig || ylow > yhig || xhig < 0 || yhig < 0)
-<a name="l00359"></a>00359         fors_sumflux_exit(<span class="stringliteral">"Invalid integration region"</span>);
-<a name="l00360"></a>00360 
-<a name="l00361"></a>00361     
-<a name="l00362"></a>00362     <span class="comment">/* </span>
-<a name="l00363"></a>00363 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00364"></a>00364 <span class="comment">     */</span>
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     cpl_msg_indent_less();
-<a name="l00367"></a>00367     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00368"></a>00368     cpl_msg_indent_more();
-<a name="l00369"></a>00369 
-<a name="l00370"></a>00370     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>)) 
-<a name="l00371"></a>00371         fors_sumflux_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00372"></a>00372 
-<a name="l00373"></a>00373     nframes = cpl_frameset_count_tags(frameset, arc_tag)
-<a name="l00374"></a>00374             + cpl_frameset_count_tags(frameset, flat_tag);
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     <span class="keywordflow">if</span> (nframes == 0)
-<a name="l00377"></a>00377         fors_sumflux_exit(<span class="stringliteral">"Missing input LSS calibration exposures"</span>);
-<a name="l00378"></a>00378 
-<a name="l00379"></a>00379     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00380"></a>00380         cpl_msg_error(recipe, <span class="stringliteral">"Too many LSS calibration exposures found (%d). "</span>
-<a name="l00381"></a>00381                       <span class="stringliteral">"Just one is required."</span>, nframes);
-<a name="l00382"></a>00382         fors_sumflux_exit(NULL);
-<a name="l00383"></a>00383     }
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, arc_tag) > 0)
-<a name="l00386"></a>00386         exposure_tag = arc_tag;
-<a name="l00387"></a>00387     <span class="keywordflow">else</span>
-<a name="l00388"></a>00388         exposure_tag = flat_tag;
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390 <span class="comment">/*** MASTER BIAS</span>
-<a name="l00391"></a>00391 <span class="comment"></span>
-<a name="l00392"></a>00392 <span class="comment">    if (cpl_frameset_count_tags(frameset, "MASTER_BIAS") == 0)</span>
-<a name="l00393"></a>00393 <span class="comment">        fors_sumflux_exit("Missing required input: MASTER_BIAS");</span>
-<a name="l00394"></a>00394 <span class="comment"></span>
-<a name="l00395"></a>00395 <span class="comment">    if (cpl_frameset_count_tags(frameset, "MASTER_BIAS") > 1)</span>
-<a name="l00396"></a>00396 <span class="comment">        fors_sumflux_exit("Too many in input: MASTER_BIAS");</span>
-<a name="l00397"></a>00397 <span class="comment"></span>
-<a name="l00398"></a>00398 <span class="comment">    cpl_msg_info(recipe, "Load master bias frame...");</span>
-<a name="l00399"></a>00399 <span class="comment">    cpl_msg_indent_more();</span>
-<a name="l00400"></a>00400 <span class="comment"></span>
-<a name="l00401"></a>00401 <span class="comment">    master_bias = dfs_load_image(frameset, "MASTER_BIAS", CPL_TYPE_FLOAT, 0, 1);</span>
-<a name="l00402"></a>00402 <span class="comment">    if (master_bias == NULL)</span>
-<a name="l00403"></a>00403 <span class="comment">        fors_sumflux_exit("Cannot load master bias");</span>
-<a name="l00404"></a>00404 <span class="comment"></span>
-<a name="l00405"></a>00405 <span class="comment">MASTER BIAS ***/</span>
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407     cpl_msg_indent_less();
-<a name="l00408"></a>00408     cpl_msg_info(recipe, <span class="stringliteral">"Load %s frame..."</span>, exposure_tag);
-<a name="l00409"></a>00409     cpl_msg_indent_more();
-<a name="l00410"></a>00410 
-<a name="l00411"></a>00411     exposure = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, exposure_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00412"></a>00412     <span class="keywordflow">if</span> (exposure == NULL)
-<a name="l00413"></a>00413         fors_sumflux_exit(<span class="stringliteral">"Cannot load input frame"</span>);
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     <span class="comment">/*</span>
-<a name="l00416"></a>00416 <span class="comment">     * Get exposure time, rebin factor, gain, etc.</span>
-<a name="l00417"></a>00417 <span class="comment">     */</span>
-<a name="l00418"></a>00418 
-<a name="l00419"></a>00419     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, exposure_tag, 0);
-<a name="l00420"></a>00420 
-<a name="l00421"></a>00421     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00422"></a>00422         fors_sumflux_exit(<span class="stringliteral">"Cannot load input frame header"</span>);
-<a name="l00423"></a>00423 
-<a name="l00424"></a>00424     time = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l00425"></a>00425 
-<a name="l00426"></a>00426     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00427"></a>00427         fors_sumflux_exit(<span class="stringliteral">"Missing keyword EXPTIME in input frame header"</span>);
-<a name="l00428"></a>00428 
-<a name="l00429"></a>00429     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00430"></a>00430     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00431"></a>00431         fors_sumflux_exit(<span class="stringliteral">"Missing keyword INSTRUME in input frame header"</span>);
-<a name="l00432"></a>00432     instrume = cpl_strdup(instrume);
-<a name="l00433"></a>00433 
-<a name="l00434"></a>00434     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00435"></a>00435         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00436"></a>00436     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00437"></a>00437         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00438"></a>00438 
-<a name="l00439"></a>00439     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00442"></a>00442         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in input "</span>
-<a name="l00443"></a>00443                           <span class="stringliteral">"frame header"</span>);
-<a name="l00444"></a>00444 
-<a name="l00445"></a>00445     rebin *= cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINY"</span>);
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00448"></a>00448         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINY in input "</span>
-<a name="l00449"></a>00449                           <span class="stringliteral">"frame header"</span>);
-<a name="l00450"></a>00450 
-<a name="l00451"></a>00451     <span class="keywordflow">if</span> (rebin > 1) {
-<a name="l00452"></a>00452         cpl_msg_info(recipe, 
-<a name="l00453"></a>00453                      <span class="stringliteral">"One readout pixel corresponds to %d chip pixels"</span>, rebin);
-<a name="l00454"></a>00454     }
-<a name="l00455"></a>00455 
-<a name="l00456"></a>00456     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l00457"></a>00457 
-<a name="l00458"></a>00458     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00459"></a>00459         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in arc lamp "</span>
-<a name="l00460"></a>00460                         <span class="stringliteral">"frame header"</span>);
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     <span class="comment">/* Leave the header on for the next step... */</span>
-<a name="l00465"></a>00465 
-<a name="l00466"></a>00466 
-<a name="l00467"></a>00467     <span class="comment">/*</span>
-<a name="l00468"></a>00468 <span class="comment">     * Remove the bias if possible (FORS2), otherwise remove the flux from a </span>
-<a name="l00469"></a>00469 <span class="comment">     * presumably darker part of the image (FORS1).</span>
-<a name="l00470"></a>00470 <span class="comment">     */</span>
-<a name="l00471"></a>00471 
-<a name="l00472"></a>00472     <span class="keywordflow">switch</span> (instrume[4]) {
-<a name="l00473"></a>00473     <span class="keywordflow">case</span> <span class="charliteral">'1'</span>:
-<a name="l00474"></a>00474 <span class="preprocessor">#ifdef OLD_FORS1</span>
-<a name="l00475"></a>00475 <span class="preprocessor"></span>        cpl_msg_info(recipe, <span class="stringliteral">"Remove low-flux region level..."</span>);
-<a name="l00476"></a>00476         <span class="keywordflow">if</span> (exposure_tag == flat_tag) {
-<a name="l00477"></a>00477             overscans = cpl_table_new(2);
-<a name="l00478"></a>00478             cpl_table_new_column(overscans, <span class="stringliteral">"xlow"</span>, CPL_TYPE_INT);
-<a name="l00479"></a>00479             cpl_table_new_column(overscans, <span class="stringliteral">"ylow"</span>, CPL_TYPE_INT);
-<a name="l00480"></a>00480             cpl_table_new_column(overscans, <span class="stringliteral">"xhig"</span>, CPL_TYPE_INT);
-<a name="l00481"></a>00481             cpl_table_new_column(overscans, <span class="stringliteral">"yhig"</span>, CPL_TYPE_INT);
-<a name="l00482"></a>00482     
-<a name="l00483"></a>00483             nx = cpl_image_get_size_x(exposure);
-<a name="l00484"></a>00484             ny = cpl_image_get_size_y(exposure);
-<a name="l00485"></a>00485     
-<a name="l00486"></a>00486             <span class="comment">/* "Valid" region */</span>
-<a name="l00487"></a>00487     
-<a name="l00488"></a>00488             cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, 0, 200);
-<a name="l00489"></a>00489             cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, 0, 0);
-<a name="l00490"></a>00490             cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, 0, nx);
-<a name="l00491"></a>00491             cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, 0, ny);
-<a name="l00492"></a>00492     
-<a name="l00493"></a>00493             <span class="comment">/* "Overscan" (background) region */</span>
-<a name="l00494"></a>00494     
-<a name="l00495"></a>00495             cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, 1, 0);
-<a name="l00496"></a>00496             cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, 1, 0);
-<a name="l00497"></a>00497             cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, 1, 200);
-<a name="l00498"></a>00498             cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, 1, ny);
-<a name="l00499"></a>00499         }
-<a name="l00500"></a>00500         <span class="keywordflow">else</span> {
-<a name="l00501"></a>00501             background = <a class="code" href="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a">mos_arc_background</a>(exposure, 15, 15);
-<a name="l00502"></a>00502             cpl_image_subtract(exposure, background);
-<a name="l00503"></a>00503             cpl_image_delete(background);
-<a name="l00504"></a>00504         }
-<a name="l00505"></a>00505 <span class="preprocessor">#else</span>
-<a name="l00506"></a>00506 <span class="preprocessor"></span>        cpl_msg_info(recipe, <span class="stringliteral">"Remove bias, evaluated on overscan regions..."</span>);
-<a name="l00507"></a>00507         overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 1);
-<a name="l00508"></a>00508 <span class="preprocessor">#endif</span>
-<a name="l00509"></a>00509 <span class="preprocessor"></span>        <span class="keywordflow">break</span>;
-<a name="l00510"></a>00510     <span class="keywordflow">case</span> <span class="charliteral">'2'</span>:
-<a name="l00511"></a>00511         cpl_msg_info(recipe, <span class="stringliteral">"Remove bias, evaluated on overscan regions..."</span>);
-<a name="l00512"></a>00512         overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 1);
-<a name="l00513"></a>00513         <span class="keywordflow">break</span>;
-<a name="l00514"></a>00514     <span class="keywordflow">default</span>:
-<a name="l00515"></a>00515         cpl_msg_error(recipe, <span class="stringliteral">"Invalid instrument name: %s"</span>, instrume);
-<a name="l00516"></a>00516         fors_sumflux_exit(NULL);
-<a name="l00517"></a>00517     }
-<a name="l00518"></a>00518 
-<a name="l00519"></a>00519     <span class="keywordflow">if</span> (overscans) {
-<a name="l00520"></a>00520         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(exposure, NULL, overscans);
-<a name="l00521"></a>00521         cpl_table_delete(overscans); overscans = NULL;
-<a name="l00522"></a>00522         cpl_image_delete(exposure); exposure = dummy;
-<a name="l00523"></a>00523     
-<a name="l00524"></a>00524         <span class="keywordflow">if</span> (exposure == NULL)
-<a name="l00525"></a>00525             fors_sumflux_exit(<span class="stringliteral">"Cannot remove bias from input frame"</span>);
-<a name="l00526"></a>00526     }
-<a name="l00527"></a>00527 
-<a name="l00528"></a>00528     nx = cpl_image_get_size_x(exposure);
-<a name="l00529"></a>00529     ny = cpl_image_get_size_y(exposure);
-<a name="l00530"></a>00530 
-<a name="l00531"></a>00531     <span class="keywordflow">if</span> (xhig == 0)
-<a name="l00532"></a>00532         xhig = nx;
-<a name="l00533"></a>00533 
-<a name="l00534"></a>00534     <span class="keywordflow">if</span> (yhig == 0)
-<a name="l00535"></a>00535         yhig = ny;
-<a name="l00536"></a>00536 
-<a name="l00537"></a>00537     <span class="keywordflow">if</span> (xlow > nx || ylow > ny || xhig < 0 || yhig < 0)
-<a name="l00538"></a>00538         fors_sumflux_exit(<span class="stringliteral">"The integration region lays outside the CCD"</span>);
-<a name="l00539"></a>00539 
-<a name="l00540"></a>00540     <span class="keywordflow">if</span> (xlow == xhig || ylow == yhig)
-<a name="l00541"></a>00541         fors_sumflux_exit(<span class="stringliteral">"The integration area is zero"</span>);
-<a name="l00542"></a>00542 
-<a name="l00543"></a>00543     norm_factor = rebin * time * (xhig - xlow) * (yhig - ylow);
-<a name="l00544"></a>00544 
-<a name="l00545"></a>00545     flux = cpl_image_get_flux(exposure);
-<a name="l00546"></a>00546     <span class="keywordflow">if</span> (flux > 0.0) {
-<a name="l00547"></a>00547         flux_err = sqrt(flux/gain);
-<a name="l00548"></a>00548     }
-<a name="l00549"></a>00549     <span class="keywordflow">else</span> {
-<a name="l00550"></a>00550         flux = 0.0;
-<a name="l00551"></a>00551         flux_err = 0.0;
-<a name="l00552"></a>00552     }
-<a name="l00553"></a>00553 
-<a name="l00554"></a>00554     flux /= norm_factor;
-<a name="l00555"></a>00555     flux_err /= norm_factor;
-<a name="l00556"></a>00556 
-<a name="l00557"></a>00557     cpl_msg_info(recipe, <span class="stringliteral">"Flux: %.4f +/- %.4f (ADU/s*pixel)"</span>, flux, flux_err);
-<a name="l00558"></a>00558 
-<a name="l00559"></a>00559     cpl_image_divide_scalar(exposure, norm_factor);
-<a name="l00560"></a>00560 
-<a name="l00561"></a>00561     <span class="comment">/* Leave the header on for the next step... */</span>
-<a name="l00562"></a>00562 
-<a name="l00563"></a>00563 
-<a name="l00564"></a>00564     <span class="comment">/*</span>
-<a name="l00565"></a>00565 <span class="comment">     * QC1 group header</span>
-<a name="l00566"></a>00566 <span class="comment">     */</span>
-<a name="l00567"></a>00567 
-<a name="l00568"></a>00568     qclist = cpl_propertylist_new();
-<a name="l00569"></a>00569     
-<a name="l00570"></a>00570     <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qclist, <span class="stringliteral">"2.0"</span>, instrume);
-<a name="l00571"></a>00571 
-<a name="l00572"></a>00572     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, flux_tag,
-<a name="l00573"></a>00573                             <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l00574"></a>00574         fors_sumflux_exit(<span class="stringliteral">"Cannot write product category to QC log file"</span>);
-<a name="l00575"></a>00575 
-<a name="l00576"></a>00576     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l00577"></a>00577                               <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l00578"></a>00578         fors_sumflux_exit(<span class="stringliteral">"Missing keyword DPR TYPE in frame header"</span>);
-<a name="l00579"></a>00579 
-<a name="l00580"></a>00580     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l00581"></a>00581                               <span class="stringliteral">"Template"</span>, instrume))
-<a name="l00582"></a>00582         fors_sumflux_exit(<span class="stringliteral">"Missing keyword TPL ID in frame header"</span>);
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,
-<a name="l00585"></a>00585                               <span class="stringliteral">"Grism name"</span>, instrume))
-<a name="l00586"></a>00586         fors_sumflux_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in frame header"</span>);
-<a name="l00587"></a>00587 
-<a name="l00588"></a>00588     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,
-<a name="l00589"></a>00589                               <span class="stringliteral">"Grim identifier"</span>, instrume))
-<a name="l00590"></a>00590         fors_sumflux_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in frame header"</span>);
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))
-<a name="l00593"></a>00593         <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,
-<a name="l00594"></a>00594                               <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l00595"></a>00595 
-<a name="l00596"></a>00596     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,
-<a name="l00597"></a>00597                               <span class="stringliteral">"Collimator name"</span>, instrume))
-<a name="l00598"></a>00598         fors_sumflux_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in frame header"</span>);
-<a name="l00599"></a>00599 
-<a name="l00600"></a>00600     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l00601"></a>00601                               <span class="stringliteral">"Chip identifier"</span>, instrume))
-<a name="l00602"></a>00602         fors_sumflux_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in frame header"</span>);
-<a name="l00603"></a>00603 
-<a name="l00604"></a>00604     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS SLIT WID"</span>,
-<a name="l00605"></a>00605                               <span class="stringliteral">"arcsec"</span>, <span class="stringliteral">"Slit width"</span>, instrume))
-<a name="l00606"></a>00606         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO INS SLIT WID in frame header"</span>);
-<a name="l00607"></a>00607 
-<a name="l00608"></a>00608     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>, <span class="stringliteral">"e-/ADU"</span>, 
-<a name="l00609"></a>00609                               <span class="stringliteral">"Conversion from ADUs to electrons"</span>, instrume))
-<a name="l00610"></a>00610         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in frame header"</span>);
-<a name="l00611"></a>00611 
-<a name="l00612"></a>00612     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>, NULL, 
-<a name="l00613"></a>00613                               <span class="stringliteral">"Binning factor along X"</span>, instrume))
-<a name="l00614"></a>00614         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in frame header"</span>);
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET WIN1 BINY"</span>, NULL, 
-<a name="l00617"></a>00617                               <span class="stringliteral">"Binning factor along Y"</span>, instrume))
-<a name="l00618"></a>00618         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINY in frame header"</span>);
-<a name="l00619"></a>00619 
-<a name="l00620"></a>00620     <span class="keywordflow">for</span> (i = 1; i < 7; i++) {
-<a name="l00621"></a>00621        snprintf(lamp, 20, <span class="stringliteral">"ESO INS LAMP%d NAME"</span>, i);
-<a name="l00622"></a>00622        <span class="keywordflow">if</span> (cpl_propertylist_has(header, lamp))
-<a name="l00623"></a>00623             <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, lamp, NULL,
-<a name="l00624"></a>00624                                   <span class="stringliteral">"Name of lamp on"</span>, instrume);
-<a name="l00625"></a>00625     }
-<a name="l00626"></a>00626 
-<a name="l00627"></a>00627     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l00628"></a>00628                               <span class="stringliteral">"Archive name of input data"</span>, instrume))
-<a name="l00629"></a>00629         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ARCFILE in frame header"</span>);
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631     cpl_propertylist_delete(header); header = NULL;
-<a name="l00632"></a>00632 
-<a name="l00633"></a>00633     pipefile = <a class="code" href="group__forsdfs.html#g34ac001c0471b1dc6dab4a0a38b7c4a2">dfs_generate_filename</a>(flux_tag);
-<a name="l00634"></a>00634     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l00635"></a>00635                             <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l00636"></a>00636         fors_sumflux_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);
-<a name="l00637"></a>00637     cpl_free(pipefile); pipefile = NULL;
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639 
-<a name="l00640"></a>00640     <span class="comment">/*</span>
-<a name="l00641"></a>00641 <span class="comment">     * QC1 parameters</span>
-<a name="l00642"></a>00642 <span class="comment">     */</span>
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qclist, flux, <span class="stringliteral">"QC.LAMP.FLUX"</span>, <span class="stringliteral">"ADU/s*pixel"</span>, 
-<a name="l00645"></a>00645                                <span class="stringliteral">"Total lamp flux"</span>, instrume)) {
-<a name="l00646"></a>00646         fors_sumflux_exit(<span class="stringliteral">"Cannot write total lamp flux to QC log file"</span>);
-<a name="l00647"></a>00647     }
-<a name="l00648"></a>00648     
-<a name="l00649"></a>00649     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qclist, flux_err, <span class="stringliteral">"QC.LAMP.FLUXERR"</span>, 
-<a name="l00650"></a>00650                                <span class="stringliteral">"ADU/s*pixel"</span>, 
-<a name="l00651"></a>00651                                <span class="stringliteral">"Error on lamp flux"</span>, instrume)) {
-<a name="l00652"></a>00652         fors_sumflux_exit(<span class="stringliteral">"Cannot write error on lamp flux to QC log file"</span>);
-<a name="l00653"></a>00653     }
-<a name="l00654"></a>00654 
-<a name="l00655"></a>00655     <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l00656"></a>00656 
-<a name="l00657"></a>00657     cpl_free(instrume); instrume = NULL;
-<a name="l00658"></a>00658 
-<a name="l00659"></a>00659     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, exposure, flux_tag, qclist,
-<a name="l00660"></a>00660                        parlist, recipe, version))
-<a name="l00661"></a>00661         fors_sumflux_exit(NULL);
-<a name="l00662"></a>00662 
-<a name="l00663"></a>00663     cpl_image_delete(exposure); exposure = NULL;
-<a name="l00664"></a>00664     cpl_propertylist_delete(qclist); qclist = NULL;
-<a name="l00665"></a>00665 
-<a name="l00666"></a>00666     <span class="keywordflow">return</span> 0;
-<a name="l00667"></a>00667 
-<a name="l00668"></a>00668 } 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__sumflux_8c_source.html b/html/fors__sumflux_8c_source.html
new file mode 100644
index 0000000..983f9dd
--- /dev/null
+++ b/html/fors__sumflux_8c_source.html
@@ -0,0 +1,683 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_sumflux.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_sumflux.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_sumflux.c,v 1.11 2013-04-24 14:14:13 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-04-24 14:14:13 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.11 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_create(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_sumflux_description[] =</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"This recipe is used to monitor any lamp flux on the CCD. The input raw\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"image should be either a FLUX_ARC_LSS or a FLUX_FLAT_LSS frame. After the\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"background subtraction the total signal is integrated and divided by the\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"exposure time and by the total number of CCD original pixels (keeping\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"into account a possible rebinned readout). In the case of FORS2 frames\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"the background is the median level evaluated from the available overscan\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"regions. In the case of FORS1 data, where overscan regions are missing,\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"the background is evaluated as the median level of the first 200 CCD columns\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"for flat field data, while for arc lamp data a background map evaluated\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"from the regions without spectral lines is computed and subtracted. The\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"background subtracted frame is written to output in all cases, and the QC\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"parameters QC LAMP FLUX and QC LAMP FLUXERR are computed.\n\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  DO category:      Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  FLUX_FLAT_LSS     Raw         Flat field exposure     Y\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  or FLUX_ARC_LSS   Raw         Arc lamp exposure       Y\n\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"  DO category:      Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"  FLUX_LAMP_LSS     FITS image  Background subtracted integration region\n\n"</span>;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">#define fors_sumflux_exit(message)            \</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">cpl_free(instrume);                           \</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">cpl_free(pipefile);                           \</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">cpl_image_delete(master_bias);                \</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">cpl_image_delete(exposure);                   \</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">cpl_propertylist_delete(qclist);              \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">#define fors_sumflux_exit_memcheck(message)   \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">cpl_free(instrume);                           \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_free(pipefile);                           \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_image_delete(master_bias);                \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">cpl_image_delete(exposure);                   \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">cpl_propertylist_delete(qclist);              \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">return 0;                                     \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> {</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                     <span class="stringliteral">"fors_sumflux"</span>,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                     <span class="stringliteral">"Integrate flux from all or part of the input frame"</span>,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                     fors_sumflux_description,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                     fors_sumflux_create,</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>                     fors_sumflux_exec,</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                     fors_sumflux_destroy);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> }</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> {</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="comment">     * X coordinate of lower left corner</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_sumflux.xlow"</span>,</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>                                 <span class="stringliteral">"X coordinate of lower left corner "</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                                 <span class="stringliteral">"of integration region (pixel)"</span>,</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                                 <span class="stringliteral">"fors.fors_sumflux"</span>,</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>                                 0);</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xlow"</span>);</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="comment">     * Y coordinate of lower left corner</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_sumflux.ylow"</span>,</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                                 <span class="stringliteral">"Y coordinate of lower left corner "</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                                 <span class="stringliteral">"of integration region (pixel)"</span>,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                                 <span class="stringliteral">"fors.fors_sumflux"</span>,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                                 0);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ylow"</span>);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="comment">     * X coordinate of upper right corner</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_sumflux.xhigh"</span>,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                                 <span class="stringliteral">"X coordinate of upper right corner "</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                                 <span class="stringliteral">"of integration region (pixel) (0 = CCD size)"</span>,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                                 <span class="stringliteral">"fors.fors_sumflux"</span>,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                                 0);</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xhigh"</span>);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="comment">     * Y coordinate of upper right corner</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_sumflux.yhigh"</span>,</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                                 <span class="stringliteral">"Y coordinate of upper right corner "</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                                 <span class="stringliteral">"of integration region (pixel) (0 = CCD size)"</span>,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                                 <span class="stringliteral">"fors.fors_sumflux"</span>,</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                                 0);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"yhigh"</span>);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> }</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> </div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> </div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> {</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keywordflow">return</span> fors_sumflux(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> }</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> {</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> </div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> }</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_sumflux(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> {</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> </div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_sumflux"</span>;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> </div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> </div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="keywordtype">int</span> xlow;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keywordtype">int</span> ylow;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     <span class="keywordtype">int</span> xhig;</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     <span class="keywordtype">int</span> yhig;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     cpl_image        *master_bias = NULL;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cpl_image        *exposure    = NULL;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     cpl_image        *background  = NULL;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     cpl_image        *dummy       = NULL;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     cpl_table        *overscans   = NULL;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> </div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     cpl_propertylist *qclist      = NULL;</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> </div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *arc_tag  = <span class="stringliteral">"FLUX_ARC_LSS"</span>;</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *flat_tag = <span class="stringliteral">"FLUX_FLAT_LSS"</span>;</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     <span class="keywordtype">char</span>    version[80];</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     <span class="keywordtype">char</span>    lamp[20];</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *exposure_tag;</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *flux_tag = <span class="stringliteral">"FLUX_LAMP_LSS"</span>;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keywordtype">double</span>  time;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <span class="keywordtype">double</span>  norm_factor;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="keywordtype">int</span>     nframes;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <span class="keywordtype">int</span>     rebin;</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="keywordtype">int</span>     nx, ny;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <span class="keywordtype">double</span>  gain;</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keywordtype">double</span>  flux, flux_err;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keywordtype">int</span>     i;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keywordtype">char</span>   *instrume = NULL;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keywordtype">char</span>   *pipefile = NULL;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> </div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     xlow = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_sumflux.xlow"</span>, NULL);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     ylow = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_sumflux.ylow"</span>, NULL);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     xhig = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_sumflux.xhigh"</span>, NULL);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     yhig = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_sumflux.yhigh"</span>, NULL);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>         fors_sumflux_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="keywordflow">if</span> (xlow > xhig || ylow > yhig || xhig < 0 || yhig < 0)</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>         fors_sumflux_exit(<span class="stringliteral">"Invalid integration region"</span>);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> <span class="comment">     * Check input set-of-frames</span></div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> </div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>)) </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>         fors_sumflux_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> </div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     nframes = cpl_frameset_count_tags(frameset, arc_tag)</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>             + cpl_frameset_count_tags(frameset, flat_tag);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">if</span> (nframes == 0)</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>         fors_sumflux_exit(<span class="stringliteral">"Missing input LSS calibration exposures"</span>);</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many LSS calibration exposures found (%d). "</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>                       <span class="stringliteral">"Just one is required."</span>, nframes);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>         fors_sumflux_exit(NULL);</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     }</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, arc_tag) > 0)</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>         exposure_tag = arc_tag;</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>         exposure_tag = flat_tag;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="comment">/*** MASTER BIAS</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="comment"></span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="comment">    if (cpl_frameset_count_tags(frameset, "MASTER_BIAS") == 0)</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> <span class="comment">        fors_sumflux_exit("Missing required input: MASTER_BIAS");</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> <span class="comment"></span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment">    if (cpl_frameset_count_tags(frameset, "MASTER_BIAS") > 1)</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="comment">        fors_sumflux_exit("Too many in input: MASTER_BIAS");</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> <span class="comment"></span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> <span class="comment">    cpl_msg_info(recipe, "Load master bias frame...");</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="comment">    cpl_msg_indent_more();</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="comment"></span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="comment">    master_bias = dfs_load_image(frameset, "MASTER_BIAS", CPL_TYPE_FLOAT, 0, 1);</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> <span class="comment">    if (master_bias == NULL)</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> <span class="comment">        fors_sumflux_exit("Cannot load master bias");</span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="comment"></span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> <span class="comment">MASTER BIAS ***/</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load %s frame..."</span>, exposure_tag);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> </div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     exposure = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, exposure_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     <span class="keywordflow">if</span> (exposure == NULL)</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         fors_sumflux_exit(<span class="stringliteral">"Cannot load input frame"</span>);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> <span class="comment">     * Get exposure time, rebin factor, gain, etc.</span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> </div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, exposure_tag, 0);</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> </div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>         fors_sumflux_exit(<span class="stringliteral">"Cannot load input frame header"</span>);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     time = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span> </div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword EXPTIME in input frame header"</span>);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> </div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword INSTRUME in input frame header"</span>);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     instrume = cpl_strdup(instrume);</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> </div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in input "</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> </div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     rebin *= cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINY"</span>);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> </div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINY in input "</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> </div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     <span class="keywordflow">if</span> (rebin > 1) {</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>         cpl_msg_info(recipe, </div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>                      <span class="stringliteral">"One readout pixel corresponds to %d chip pixels"</span>, rebin);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     }</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> </div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> </div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in arc lamp "</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="comment">/* Leave the header on for the next step... */</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> </div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> </div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> <span class="comment">     * Remove the bias if possible (FORS2), otherwise remove the flux from a </span></div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> <span class="comment">     * presumably darker part of the image (FORS1).</span></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     <span class="keywordflow">switch</span> (instrume[4]) {</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     <span class="keywordflow">case</span> <span class="charliteral">'1'</span>:</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> <span class="preprocessor">#ifdef OLD_FORS1</span></div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> <span class="preprocessor"></span>        cpl_msg_info(recipe, <span class="stringliteral">"Remove low-flux region level..."</span>);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         <span class="keywordflow">if</span> (exposure_tag == flat_tag) {</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>             overscans = cpl_table_new(2);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>             cpl_table_new_column(overscans, <span class="stringliteral">"xlow"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>             cpl_table_new_column(overscans, <span class="stringliteral">"ylow"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>             cpl_table_new_column(overscans, <span class="stringliteral">"xhig"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>             cpl_table_new_column(overscans, <span class="stringliteral">"yhig"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>             nx = cpl_image_get_size_x(exposure);</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>             ny = cpl_image_get_size_y(exposure);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     </div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>             <span class="comment">/* "Valid" region */</span></div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     </div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>             cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, 0, 200);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>             cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, 0, 0);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>             cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, 0, nx);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>             cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, 0, ny);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     </div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>             <span class="comment">/* "Overscan" (background) region */</span></div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     </div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>             cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, 1, 0);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>             cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, 1, 0);</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>             cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, 1, 200);</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>             cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, 1, ny);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>         }</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>             background = <a class="code" href="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b" title="Background determination on emission line spectrum (arc)">mos_arc_background</a>(exposure, 15, 15);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>             cpl_image_subtract(exposure, background);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>             cpl_image_delete(background);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         }</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> <span class="preprocessor"></span>        cpl_msg_info(recipe, <span class="stringliteral">"Remove bias, evaluated on overscan regions..."</span>);</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>         overscans = <a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(header, 1);</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> <span class="preprocessor"></span>        <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     <span class="keywordflow">case</span> <span class="charliteral">'2'</span>:</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>         cpl_msg_info(recipe, <span class="stringliteral">"Remove bias, evaluated on overscan regions..."</span>);</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>         overscans = <a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(header, 1);</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid instrument name: %s"</span>, instrume);</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>         fors_sumflux_exit(NULL);</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     }</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> </div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     <span class="keywordflow">if</span> (overscans) {</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>         dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(exposure, NULL, overscans);</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>         cpl_table_delete(overscans); overscans = NULL;</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>         cpl_image_delete(exposure); exposure = dummy;</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>     </div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>         <span class="keywordflow">if</span> (exposure == NULL)</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>             fors_sumflux_exit(<span class="stringliteral">"Cannot remove bias from input frame"</span>);</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     }</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     nx = cpl_image_get_size_x(exposure);</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     ny = cpl_image_get_size_y(exposure);</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> </div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     <span class="keywordflow">if</span> (xhig == 0)</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>         xhig = nx;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> </div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="keywordflow">if</span> (yhig == 0)</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>         yhig = ny;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> </div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keywordflow">if</span> (xlow > nx || ylow > ny || xhig < 0 || yhig < 0)</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>         fors_sumflux_exit(<span class="stringliteral">"The integration region lays outside the CCD"</span>);</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span> </div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     <span class="keywordflow">if</span> (xlow == xhig || ylow == yhig)</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>         fors_sumflux_exit(<span class="stringliteral">"The integration area is zero"</span>);</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> </div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     norm_factor = rebin * time * (xhig - xlow) * (yhig - ylow);</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     flux = cpl_image_get_flux(exposure);</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keywordflow">if</span> (flux > 0.0) {</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         flux_err = sqrt(flux/gain);</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     }</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         flux = 0.0;</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         flux_err = 0.0;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     }</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span> </div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     flux /= norm_factor;</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     flux_err /= norm_factor;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     cpl_msg_info(recipe, <span class="stringliteral">"Flux: %.4f +/- %.4f (ADU/s*pixel)"</span>, flux, flux_err);</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span> </div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     cpl_image_divide_scalar(exposure, norm_factor);</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> </div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     <span class="comment">/* Leave the header on for the next step... */</span></div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span> </div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span> <span class="comment">     * QC1 group header</span></div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span> </div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     qclist = cpl_propertylist_new();</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     </div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qclist, <span class="stringliteral">"2.0"</span>, instrume);</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> </div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, flux_tag,</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>                             <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         fors_sumflux_exit(<span class="stringliteral">"Cannot write product category to QC log file"</span>);</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span> </div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>                               <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword DPR TYPE in frame header"</span>);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>                               <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword TPL ID in frame header"</span>);</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS GRIS1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>                               <span class="stringliteral">"Grism name"</span>, instrume))</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword INS GRIS1 NAME in frame header"</span>);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span> </div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>                               <span class="stringliteral">"Grim identifier"</span>, instrume))</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword INS GRIS1 ID in frame header"</span>);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> </div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO INS FILT1 NAME"</span>))</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>         <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS FILT1 NAME"</span>, NULL,</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>                               <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> </div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS COLL NAME"</span>, NULL,</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>                               <span class="stringliteral">"Collimator name"</span>, instrume))</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword INS COLL NAME in frame header"</span>);</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>                               <span class="stringliteral">"Chip identifier"</span>, instrume))</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in frame header"</span>);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> </div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO INS SLIT WID"</span>,</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>                               <span class="stringliteral">"arcsec"</span>, <span class="stringliteral">"Slit width"</span>, instrume))</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO INS SLIT WID in frame header"</span>);</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span> </div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>, <span class="stringliteral">"e-/ADU"</span>, </div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>                               <span class="stringliteral">"Conversion from ADUs to electrons"</span>, instrume))</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in frame header"</span>);</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span> </div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>, NULL, </div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>                               <span class="stringliteral">"Binning factor along X"</span>, instrume))</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in frame header"</span>);</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> </div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET WIN1 BINY"</span>, NULL, </div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>                               <span class="stringliteral">"Binning factor along Y"</span>, instrume))</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINY in frame header"</span>);</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span> </div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     <span class="keywordflow">for</span> (i = 1; i < 7; i++) {</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>        snprintf(lamp, 20, <span class="stringliteral">"ESO INS LAMP%d NAME"</span>, i);</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>        <span class="keywordflow">if</span> (cpl_propertylist_has(header, lamp))</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>             <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, lamp, NULL,</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>                                   <span class="stringliteral">"Name of lamp on"</span>, instrume);</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     }</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> </div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>                               <span class="stringliteral">"Archive name of input data"</span>, instrume))</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>         fors_sumflux_exit(<span class="stringliteral">"Missing keyword ARCFILE in frame header"</span>);</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> </div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> </div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     pipefile = dfs_generate_filename(flux_tag);</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>                             <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>         fors_sumflux_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> </div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> </div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> <span class="comment">     * QC1 parameters</span></div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> </div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qclist, flux, <span class="stringliteral">"QC.LAMP.FLUX"</span>, <span class="stringliteral">"ADU/s*pixel"</span>, </div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>                                <span class="stringliteral">"Total lamp flux"</span>, instrume)) {</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>         fors_sumflux_exit(<span class="stringliteral">"Cannot write total lamp flux to QC log file"</span>);</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     }</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     </div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qclist, flux_err, <span class="stringliteral">"QC.LAMP.FLUXERR"</span>, </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>                                <span class="stringliteral">"ADU/s*pixel"</span>, </div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>                                <span class="stringliteral">"Error on lamp flux"</span>, instrume)) {</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>         fors_sumflux_exit(<span class="stringliteral">"Cannot write error on lamp flux to QC log file"</span>);</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     }</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span> </div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     cpl_free(instrume); instrume = NULL;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> </div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, exposure, flux_tag, qclist,</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>         fors_sumflux_exit(NULL);</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span> </div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     cpl_image_delete(exposure); exposure = NULL;</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>     cpl_propertylist_delete(qclist); qclist = NULL;</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span> </div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> </div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span> } </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__tools_8c-source.html b/html/fors__tools_8c-source.html
deleted file mode 100644
index 4da75ee..0000000
--- a/html/fors__tools_8c-source.html
+++ /dev/null
@@ -1,403 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_tools.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_tools.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_tools.c,v 1.22 2012/08/07 15:26:53 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2012/08/07 15:26:53 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.22 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_tools.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <math.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <assert.h></span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00046"></a>00046 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00047"></a>00047 
-<a name="l00050"></a>00050 <span class="preprocessor">#undef cleanup</span>
-<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">do { \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">    cpl_propertylist_delete(header); \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">} while(0)</span>
-<a name="l00055"></a>00055 <span class="preprocessor"></span>
-<a name="l00064"></a>00064 <span class="keywordtype">double</span>
-<a name="l00065"></a><a class="code" href="group__fors__tools.html#g6a1cb404cc2c956f79b10ea46a0611dc">00065</a> <a class="code" href="group__fors__tools.html#g6a1cb404cc2c956f79b10ea46a0611dc">fors_star_ext_corr</a>(fors_star_list *stars, 
-<a name="l00066"></a>00066                    <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00067"></a>00067                    <span class="keywordtype">double</span> ext_coeff,
-<a name="l00068"></a>00068                    <span class="keywordtype">double</span> dext_coeff,
-<a name="l00069"></a>00069                    <span class="keyword">const</span> cpl_frame *raw_frame)
-<a name="l00070"></a>00070 {
-<a name="l00071"></a>00071     cpl_propertylist *header = NULL;
-<a name="l00072"></a>00072     
-<a name="l00073"></a>00073     
-<a name="l00074"></a>00074     cpl_msg_info(cpl_func, <span class="stringliteral">"Extinction correction"</span>);
-<a name="l00075"></a>00075     
-<a name="l00076"></a>00076     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frame_get_filename(raw_frame) != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00077"></a>00077     
-<a name="l00078"></a>00078     header = cpl_propertylist_load(cpl_frame_get_filename(raw_frame), 0);
-<a name="l00079"></a>00079     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> -1,
-<a name="l00080"></a>00080             <span class="stringliteral">"Failed to load %s primary header"</span>,
-<a name="l00081"></a>00081             cpl_frame_get_filename(raw_frame));
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083 
-<a name="l00084"></a>00084     <span class="keywordtype">double</span> avg_airmass = <a class="code" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">fors_get_airmass</a>(header);
-<a name="l00085"></a>00085     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> -1,
-<a name="l00086"></a>00086             <span class="stringliteral">"%s: Could not read airmass"</span>,
-<a name="l00087"></a>00087             cpl_frame_get_filename(raw_frame));
-<a name="l00088"></a>00088 
-<a name="l00089"></a>00089     cpl_msg_indent_more();
-<a name="l00090"></a>00090     cpl_msg_info(cpl_func, <span class="stringliteral">"Exposure time = %f s"</span>, setting-><a class="code" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">exposure_time</a>);
-<a name="l00091"></a>00091     cpl_msg_info(cpl_func, <span class="stringliteral">"Gain          = %f ADU/e-"</span>, setting-><a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a>);
-<a name="l00092"></a>00092     cpl_msg_info(cpl_func, <span class="stringliteral">"Ext. coeff.   = %f +- %f mag/airmass"</span>, 
-<a name="l00093"></a>00093                  ext_coeff, dext_coeff);
-<a name="l00094"></a>00094     cpl_msg_info(cpl_func, <span class="stringliteral">"Avg. airmass  = %f airmass"</span>, avg_airmass);  
-<a name="l00095"></a>00095     <span class="comment">/* The quantity and the unit are both 'airmass' */</span>
-<a name="l00096"></a>00096 
-<a name="l00097"></a>00097     cpl_msg_indent_less();
-<a name="l00098"></a>00098     
-<a name="l00099"></a>00099     {
-<a name="l00100"></a>00100         <a class="code" href="struct__fors__star.html">fors_star</a> *star;
-<a name="l00101"></a>00101         
-<a name="l00102"></a>00102         <span class="keywordflow">for</span> (star = fors_star_list_first(stars);
-<a name="l00103"></a>00103              star != NULL;
-<a name="l00104"></a>00104              star = fors_star_list_next(stars)) {
-<a name="l00105"></a>00105             star-><a class="code" href="struct__fors__star.html#20a78115ec557bc3cf1e723619516eb6">magnitude_corr</a> = star-><a class="code" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">magnitude</a> 
-<a name="l00106"></a>00106                 + 2.5*log(setting-><a class="code" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a>)/log(10)
-<a name="l00107"></a>00107                 + 2.5*log(setting-><a class="code" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">exposure_time</a>)/log(10)
-<a name="l00108"></a>00108                 - ext_coeff * avg_airmass;
-<a name="l00109"></a>00109 
-<a name="l00110"></a>00110             <span class="comment">/* Propagate error from ext.coeff.</span>
-<a name="l00111"></a>00111 <span class="comment">               gain, exptime and airmass</span>
-<a name="l00112"></a>00112 <span class="comment">               have zero error */</span>
-<a name="l00113"></a>00113             star-><a class="code" href="struct__fors__star.html#ee281335ef4e49be1cfb5caf7f96d7c3">dmagnitude_corr</a> = sqrt(star-><a class="code" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">dmagnitude</a> * star-><a class="code" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">dmagnitude</a>
-<a name="l00114"></a>00114                                          + dext_coeff*dext_coeff * avg_airmass*avg_airmass);
-<a name="l00115"></a>00115         }
-<a name="l00116"></a>00116     }
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00119"></a>00119     <span class="keywordflow">return</span> avg_airmass;
-<a name="l00120"></a>00120 }
-<a name="l00121"></a>00121 
-<a name="l00129"></a>00129 cpl_table *
-<a name="l00130"></a><a class="code" href="group__fors__tools.html#g8138511b64d1d365e21b56eb161f2028">00130</a> <a class="code" href="group__fors__tools.html#g8138511b64d1d365e21b56eb161f2028">fors_create_sources_table</a>(fors_star_list *sources)
-<a name="l00131"></a>00131 {
-<a name="l00132"></a>00132     cpl_table *t = NULL;
-<a name="l00133"></a>00133     
-<a name="l00134"></a>00134     t = cpl_table_new(fors_star_list_size(sources));
-<a name="l00135"></a>00135     cpl_table_new_column(t, <span class="stringliteral">"X"</span>, CPL_TYPE_DOUBLE);
-<a name="l00136"></a>00136     cpl_table_new_column(t, <span class="stringliteral">"Y"</span>, CPL_TYPE_DOUBLE);
-<a name="l00137"></a>00137     cpl_table_new_column(t, <span class="stringliteral">"FWHM"</span>, CPL_TYPE_DOUBLE);
-<a name="l00138"></a>00138     cpl_table_new_column(t, <span class="stringliteral">"A"</span>, CPL_TYPE_DOUBLE);
-<a name="l00139"></a>00139     cpl_table_new_column(t, <span class="stringliteral">"B"</span>, CPL_TYPE_DOUBLE);
-<a name="l00140"></a>00140     cpl_table_new_column(t, <span class="stringliteral">"THETA"</span>, CPL_TYPE_DOUBLE);
-<a name="l00141"></a>00141     cpl_table_new_column(t, <span class="stringliteral">"ELL"</span>, CPL_TYPE_DOUBLE);
-<a name="l00142"></a>00142     cpl_table_new_column(t, <span class="stringliteral">"INSTR_MAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00143"></a>00143     cpl_table_new_column(t, <span class="stringliteral">"DINSTR_MAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00144"></a>00144     cpl_table_new_column(t, <span class="stringliteral">"INSTR_CMAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00145"></a>00145     cpl_table_new_column(t, <span class="stringliteral">"DINSTR_CMAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00146"></a>00146     cpl_table_new_column(t, <span class="stringliteral">"CLASS_STAR"</span>, CPL_TYPE_DOUBLE);
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     cpl_table_new_column(t, <span class="stringliteral">"OBJECT"</span>, CPL_TYPE_STRING);
-<a name="l00149"></a>00149     cpl_table_new_column(t, <span class="stringliteral">"RA"</span>, CPL_TYPE_DOUBLE);
-<a name="l00150"></a>00150     cpl_table_new_column(t, <span class="stringliteral">"DEC"</span>, CPL_TYPE_DOUBLE);
-<a name="l00151"></a>00151     cpl_table_new_column(t, <span class="stringliteral">"MAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00152"></a>00152     cpl_table_new_column(t, <span class="stringliteral">"DMAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00153"></a>00153     cpl_table_new_column(t, <span class="stringliteral">"CAT_MAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00154"></a>00154     cpl_table_new_column(t, <span class="stringliteral">"DCAT_MAG"</span>, CPL_TYPE_DOUBLE);
-<a name="l00155"></a>00155     cpl_table_new_column(t, <span class="stringliteral">"COLOR"</span>, CPL_TYPE_DOUBLE);
-<a name="l00156"></a>00156     cpl_table_new_column(t, <span class="stringliteral">"DCOLOR"</span>, CPL_TYPE_DOUBLE);
-<a name="l00157"></a>00157     cpl_table_new_column(t, <span class="stringliteral">"COV_CATM_COL"</span>, CPL_TYPE_DOUBLE);
-<a name="l00158"></a>00158     cpl_table_new_column(t, <span class="stringliteral">"USE_CAT"</span>, CPL_TYPE_INT);
-<a name="l00159"></a>00159     <span class="comment">/* Shift in x and y between initial guess FITS header WCS position</span>
-<a name="l00160"></a>00160 <span class="comment">       and measured position */</span>
-<a name="l00161"></a>00161     cpl_table_new_column(t, <span class="stringliteral">"SHIFT_X"</span>, CPL_TYPE_DOUBLE); 
-<a name="l00162"></a>00162     cpl_table_new_column(t, <span class="stringliteral">"SHIFT_Y"</span>, CPL_TYPE_DOUBLE);
-<a name="l00163"></a>00163     cpl_table_new_column(t, <span class="stringliteral">"ZEROPOINT"</span>, CPL_TYPE_DOUBLE);
-<a name="l00164"></a>00164     cpl_table_new_column(t, <span class="stringliteral">"DZEROPOINT"</span>, CPL_TYPE_DOUBLE);
-<a name="l00165"></a>00165     cpl_table_new_column(t, <span class="stringliteral">"WEIGHT"</span>, CPL_TYPE_DOUBLE);
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     {
-<a name="l00168"></a>00168         <a class="code" href="struct__fors__star.html">fors_star</a> *s;
-<a name="l00169"></a>00169         <span class="keywordtype">int</span> i;
-<a name="l00170"></a>00170         <span class="keywordflow">for</span> (s = fors_star_list_first(sources), i = 0;
-<a name="l00171"></a>00171              s != NULL;
-<a name="l00172"></a>00172              s = fors_star_list_next(sources), i++) {
-<a name="l00173"></a>00173 
-<a name="l00174"></a>00174             <span class="keyword">const</span> fors_std_star *<span class="keywordtype">id</span> = s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>;
-<a name="l00175"></a>00175             
-<a name="l00176"></a>00176             cpl_table_set_double(t, <span class="stringliteral">"X"</span>, i, s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x);
-<a name="l00177"></a>00177             cpl_table_set_double(t, <span class="stringliteral">"Y"</span>, i, s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y);
-<a name="l00178"></a>00178             cpl_table_set_double(t, <span class="stringliteral">"FWHM"</span>, i, s-><a class="code" href="struct__fors__star.html#4bb929a1553cd3239fcf18112c699200">fwhm</a>);
-<a name="l00179"></a>00179             cpl_table_set_double(t, <span class="stringliteral">"A"</span>, i, s-><a class="code" href="struct__fors__star.html#b5357dc5aaf3b7b6edc89d700d563a2c">semi_major</a>);
-<a name="l00180"></a>00180             cpl_table_set_double(t, <span class="stringliteral">"B"</span>, i, s-><a class="code" href="struct__fors__star.html#532b4911a7308d705f01ba1da7bc35a1">semi_minor</a>);
-<a name="l00181"></a>00181             cpl_table_set_double(t, <span class="stringliteral">"THETA"</span>, i, s-><a class="code" href="struct__fors__star.html#25c48bcbeb48ed5d535e715866f06810">orientation</a>);
-<a name="l00182"></a>00182             cpl_table_set_double(t, <span class="stringliteral">"ELL"</span>, i, <a class="code" href="group__fors__star.html#gdef23fa2c1ad1c4f2b0de18038b0daca">fors_star_ellipticity</a>(s, NULL));
-<a name="l00183"></a>00183             cpl_table_set_double(t, <span class="stringliteral">"INSTR_MAG"</span>, i, s-><a class="code" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">magnitude</a>);
-<a name="l00184"></a>00184             cpl_table_set_double(t, <span class="stringliteral">"DINSTR_MAG"</span>, i, s-><a class="code" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">dmagnitude</a>);
-<a name="l00185"></a>00185             cpl_table_set_double(t, <span class="stringliteral">"INSTR_CMAG"</span>, i, s-><a class="code" href="struct__fors__star.html#20a78115ec557bc3cf1e723619516eb6">magnitude_corr</a>);
-<a name="l00186"></a>00186             cpl_table_set_double(t, <span class="stringliteral">"DINSTR_CMAG"</span>, i, s-><a class="code" href="struct__fors__star.html#ee281335ef4e49be1cfb5caf7f96d7c3">dmagnitude_corr</a>);
-<a name="l00187"></a>00187             cpl_table_set_double(t, <span class="stringliteral">"CLASS_STAR"</span>, i, s-><a class="code" href="struct__fors__star.html#cd353ab887426dc767a89db51164271a">stellarity_index</a>);
-<a name="l00188"></a>00188             cpl_table_set_double(t, <span class="stringliteral">"WEIGHT"</span>, i, s-><a class="code" href="struct__fors__star.html#82910b82de5851e8f59e40b205b6f829">weight</a>);
-<a name="l00189"></a>00189             
-<a name="l00190"></a>00190             <span class="keywordflow">if</span> (<span class="keywordtype">id</span> != NULL)
-<a name="l00191"></a>00191             {
-<a name="l00192"></a>00192                 cpl_table_set_string(t, <span class="stringliteral">"OBJECT"</span>,       i, id->name); <span class="comment">/* possibly NULL */</span>
-<a name="l00193"></a>00193                 cpl_table_set_double(t, <span class="stringliteral">"RA"</span>,           i, id->ra);
-<a name="l00194"></a>00194                 cpl_table_set_double(t, <span class="stringliteral">"DEC"</span>,          i, id->dec);
-<a name="l00195"></a>00195                 cpl_table_set_double(t, <span class="stringliteral">"MAG"</span>,          i, id->magnitude);
-<a name="l00196"></a>00196                 cpl_table_set_double(t, <span class="stringliteral">"DMAG"</span>,         i, id->dmagnitude);
-<a name="l00197"></a>00197                 cpl_table_set_double(t, <span class="stringliteral">"CAT_MAG"</span>,      i, id->cat_magnitude);
-<a name="l00198"></a>00198                 cpl_table_set_double(t, <span class="stringliteral">"DCAT_MAG"</span>,     i, id->dcat_magnitude);
-<a name="l00199"></a>00199                 cpl_table_set_double(t, <span class="stringliteral">"COLOR"</span>,        i, id->color);
-<a name="l00200"></a>00200                 cpl_table_set_double(t, <span class="stringliteral">"DCOLOR"</span>,       i, id->dcolor);
-<a name="l00201"></a>00201                 cpl_table_set_double(t, <span class="stringliteral">"COV_CATM_COL"</span>, i, id->cov_catm_color);
-<a name="l00202"></a>00202                 cpl_table_set_double(t, <span class="stringliteral">"SHIFT_X"</span>,      i,  s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x
-<a name="l00203"></a>00203                                                             - id->pixel->x);
-<a name="l00204"></a>00204                 cpl_table_set_double(t, <span class="stringliteral">"SHIFT_Y"</span>,      i,  s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y
-<a name="l00205"></a>00205                                                             - id->pixel->y);
-<a name="l00206"></a>00206                 cpl_table_set_double(t, <span class="stringliteral">"ZEROPOINT"</span>,    i, 
-<a name="l00207"></a>00207                                      <a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a>(s, NULL));
-<a name="l00208"></a>00208                 cpl_table_set_double(t, <span class="stringliteral">"DZEROPOINT"</span>,   i, 
-<a name="l00209"></a>00209                                      <a class="code" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">fors_star_get_zeropoint_err</a>(s, NULL));
-<a name="l00210"></a>00210                 <span class="comment">/* fit this magnitude in fors_photometry? (fit = !trusted) */</span>
-<a name="l00211"></a>00211                 cpl_table_set_int   (t, <span class="stringliteral">"USE_CAT"</span>,      i,
-<a name="l00212"></a>00212                                             ((id->trusted) ? 1 : 0));
-<a name="l00213"></a>00213             }
-<a name="l00214"></a>00214             <span class="keywordflow">else</span> {
-<a name="l00215"></a>00215                 cpl_table_set_invalid(t, <span class="stringliteral">"RA"</span> , i);
-<a name="l00216"></a>00216                 cpl_table_set_invalid(t, <span class="stringliteral">"DEC"</span>, i);
-<a name="l00217"></a>00217                 cpl_table_set_invalid(t, <span class="stringliteral">"MAG"</span>, i);
-<a name="l00218"></a>00218                 cpl_table_set_invalid(t, <span class="stringliteral">"DMAG"</span>, i);
-<a name="l00219"></a>00219                 cpl_table_set_invalid(t, <span class="stringliteral">"SHIFT_X"</span>, i);
-<a name="l00220"></a>00220                 cpl_table_set_invalid(t, <span class="stringliteral">"SHIFT_Y"</span>, i);
-<a name="l00221"></a>00221                 cpl_table_set_invalid(t, <span class="stringliteral">"ZEROPOINT"</span>, i);
-<a name="l00222"></a>00222                 cpl_table_set_invalid(t, <span class="stringliteral">"DZEROPOINT"</span>, i);
-<a name="l00223"></a>00223             }
-<a name="l00224"></a>00224         }
-<a name="l00225"></a>00225     }
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227     <span class="keywordflow">return</span> t;
-<a name="l00228"></a>00228 }
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230 <span class="preprocessor">#undef cleanup</span>
-<a name="l00231"></a>00231 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00232"></a>00232 <span class="preprocessor">do { \</span>
-<a name="l00233"></a>00233 <span class="preprocessor">    fors_image_delete(&image); \</span>
-<a name="l00234"></a>00234 <span class="preprocessor">    fors_image_delete(&image2); \</span>
-<a name="l00235"></a>00235 <span class="preprocessor">} while(0)</span>
-<a name="l00236"></a>00236 <span class="preprocessor"></span>
-<a name="l00243"></a>00243 <span class="keywordtype">double</span>
-<a name="l00244"></a><a class="code" href="group__fors__tools.html#g5637ecda70fb6aeab5c0b22dec2e2e10">00244</a> <a class="code" href="group__fors__tools.html#g5637ecda70fb6aeab5c0b22dec2e2e10">fors_fixed_pattern_noise</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master,
-<a name="l00245"></a>00245                          <span class="keywordtype">double</span> convert_ADU,
-<a name="l00246"></a>00246                          <span class="keywordtype">double</span> master_noise)
-<a name="l00247"></a>00247 {
-<a name="l00248"></a>00248     <span class="keywordtype">double</span> master_fixed_pattern_noise;
-<a name="l00249"></a>00249     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;
-<a name="l00250"></a>00250     <a class="code" href="struct__fors__image.html">fors_image</a> *image2 = NULL;
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( master != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00253"></a>00253 
-<a name="l00254"></a>00254     <span class="comment">/* Use central 101x101 window </span>
-<a name="l00255"></a>00255 <span class="comment">       and 101x101 window shifted (10, 10) from center</span>
-<a name="l00256"></a>00256 <span class="comment">    */</span>
-<a name="l00257"></a>00257     <span class="keywordflow">if</span> (<a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(master) >= 121 &&
-<a name="l00258"></a>00258         <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(master) >= 121) {
-<a name="l00259"></a>00259         
-<a name="l00260"></a>00260         <span class="keywordtype">int</span> mid_x = (<a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(master) + 1) / 2;
-<a name="l00261"></a>00261         <span class="keywordtype">int</span> mid_y = (<a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(master) + 1) / 2;
-<a name="l00262"></a>00262         
-<a name="l00263"></a>00263         image = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(master);       
-<a name="l00264"></a>00264         <a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a>(image, 
-<a name="l00265"></a>00265                         mid_x - 50, mid_y - 50,
-<a name="l00266"></a>00266                         mid_x + 50, mid_y + 50);
-<a name="l00267"></a>00267         
-<a name="l00268"></a>00268         image2 = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(master);       
-<a name="l00269"></a>00269         <a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a>(image2, 
-<a name="l00270"></a>00270                         mid_x + 10 - 50, mid_y + 10 - 50,
-<a name="l00271"></a>00271                         mid_x + 10 + 50, mid_y + 10 + 50);
-<a name="l00272"></a>00272 
-<a name="l00273"></a>00273         <a class="code" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">fors_image_subtract</a>(image, image2);
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275         master_fixed_pattern_noise = 
-<a name="l00276"></a>00276             <a class="code" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">fors_image_get_stdev</a>(image, NULL) / sqrt(2);
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278         <span class="comment">/* Convert to ADU */</span>
-<a name="l00279"></a>00279         master_fixed_pattern_noise *= convert_ADU;
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281         <span class="comment">/* Subtract photon noise */</span>
-<a name="l00282"></a>00282         <span class="keywordflow">if</span> (master_fixed_pattern_noise >= master_noise) {
-<a name="l00283"></a>00283             
-<a name="l00284"></a>00284             master_fixed_pattern_noise = sqrt(master_fixed_pattern_noise*
-<a name="l00285"></a>00285                                               master_fixed_pattern_noise
-<a name="l00286"></a>00286                                               -
-<a name="l00287"></a>00287                                               master_noise*
-<a name="l00288"></a>00288                                               master_noise);
-<a name="l00289"></a>00289         }
-<a name="l00290"></a>00290         <span class="keywordflow">else</span> {
-<a name="l00291"></a>00291             cpl_msg_warning(cpl_func,
-<a name="l00292"></a>00292                             <span class="stringliteral">"Zero-shift noise (%f ADU) is greater than "</span>
-<a name="l00293"></a>00293                             <span class="stringliteral">"accumulated zero-shift and fixed pattern noise (%f ADU), "</span>
-<a name="l00294"></a>00294                             <span class="stringliteral">"setting fixed pattern noise to zero"</span>,
-<a name="l00295"></a>00295                             master_noise,
-<a name="l00296"></a>00296                             master_fixed_pattern_noise);
-<a name="l00297"></a>00297             master_fixed_pattern_noise = 0;
-<a name="l00298"></a>00298         }
-<a name="l00299"></a>00299     }
-<a name="l00300"></a>00300     <span class="keywordflow">else</span> {
-<a name="l00301"></a>00301         cpl_msg_warning(cpl_func,
-<a name="l00302"></a>00302                         <span class="stringliteral">"Master flat too small (%dx%d), "</span>
-<a name="l00303"></a>00303                         <span class="stringliteral">"need size 121x121 to compute master flat "</span>
-<a name="l00304"></a>00304                         <span class="stringliteral">"fixed pattern noise"</span>,
-<a name="l00305"></a>00305                         <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(master),
-<a name="l00306"></a>00306                         <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(master));
-<a name="l00307"></a>00307         master_fixed_pattern_noise = -1;
-<a name="l00308"></a>00308     }
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00311"></a>00311     <span class="keywordflow">return</span> master_fixed_pattern_noise;
-<a name="l00312"></a>00312 }
-<a name="l00313"></a>00313 
-<a name="l00314"></a>00314 
-<a name="l00315"></a>00315 <span class="preprocessor">#undef cleanup</span>
-<a name="l00316"></a>00316 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00317"></a>00317 <span class="preprocessor">do { \</span>
-<a name="l00318"></a>00318 <span class="preprocessor">    fors_image_delete(&image); \</span>
-<a name="l00319"></a>00319 <span class="preprocessor">    fors_image_delete(&image2); \</span>
-<a name="l00320"></a>00320 <span class="preprocessor">} while(0)</span>
-<a name="l00321"></a>00321 <span class="preprocessor"></span>
-<a name="l00328"></a>00328 <span class="keywordtype">double</span>
-<a name="l00329"></a><a class="code" href="group__fors__tools.html#g2e2a80069157183a808349976b3e455a">00329</a> <a class="code" href="group__fors__tools.html#g2e2a80069157183a808349976b3e455a">fors_fixed_pattern_noise_bias</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *first_raw,
-<a name="l00330"></a>00330                               <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *second_raw,
-<a name="l00331"></a>00331                               <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>)
-<a name="l00332"></a>00332 {
-<a name="l00333"></a>00333     <span class="keywordtype">double</span> bias_fixed_pattern_noise;
-<a name="l00334"></a>00334     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;
-<a name="l00335"></a>00335     <a class="code" href="struct__fors__image.html">fors_image</a> *image2 = NULL;
-<a name="l00336"></a>00336     <span class="keywordtype">int</span> nx, ny;
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( first_raw != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00339"></a>00339     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( second_raw != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00340"></a>00340 
-<a name="l00341"></a>00341     <span class="comment">/* </span>
-<a name="l00342"></a>00342 <span class="comment">     * Extract the largest possible two windows shifted (10, 10) </span>
-<a name="l00343"></a>00343 <span class="comment">     */</span>
-<a name="l00344"></a>00344 
-<a name="l00345"></a>00345     nx = <a class="code" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a>(first_raw);
-<a name="l00346"></a>00346     ny = <a class="code" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a>(first_raw);
-<a name="l00347"></a>00347 
-<a name="l00348"></a>00348     image = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(first_raw);       
-<a name="l00349"></a>00349     <a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a>(image, 
-<a name="l00350"></a>00350                     1, 1,
-<a name="l00351"></a>00351                     nx - 10, ny - 10);
-<a name="l00352"></a>00352         
-<a name="l00353"></a>00353     image2 = <a class="code" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a>(second_raw);       
-<a name="l00354"></a>00354     <a class="code" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a>(image2, 
-<a name="l00355"></a>00355                     11, 11,
-<a name="l00356"></a>00356                     nx, ny);
-<a name="l00357"></a>00357 
-<a name="l00358"></a>00358     <a class="code" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">fors_image_subtract</a>(image, image2);
-<a name="l00359"></a>00359 
-<a name="l00360"></a>00360     bias_fixed_pattern_noise = <a class="code" href="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b">fors_image_get_stdev_robust</a>(image, 50, NULL) 
-<a name="l00361"></a>00361                              / sqrt(2);
-<a name="l00362"></a>00362 
-<a name="l00363"></a>00363     <span class="comment">/* </span>
-<a name="l00364"></a>00364 <span class="comment">     * Subtract ron quadratically</span>
-<a name="l00365"></a>00365 <span class="comment">     */</span>
-<a name="l00366"></a>00366 
-<a name="l00367"></a>00367     <span class="keywordflow">if</span> (bias_fixed_pattern_noise > ron) {
-<a name="l00368"></a>00368             
-<a name="l00369"></a>00369         bias_fixed_pattern_noise = sqrt(bias_fixed_pattern_noise *
-<a name="l00370"></a>00370                                         bias_fixed_pattern_noise
-<a name="l00371"></a>00371                                         -
-<a name="l00372"></a>00372                                         ron * ron);
-<a name="l00373"></a>00373     }
-<a name="l00374"></a>00374     <span class="keywordflow">else</span> {
-<a name="l00375"></a>00375         cpl_msg_warning(cpl_func,
-<a name="l00376"></a>00376                         <span class="stringliteral">"Zero-shift noise (%f ADU) is greater than "</span>
-<a name="l00377"></a>00377                         <span class="stringliteral">"accumulated zero-shift and fixed pattern "</span>
-<a name="l00378"></a>00378                         <span class="stringliteral">"noise (%f ADU), "</span>
-<a name="l00379"></a>00379                         <span class="stringliteral">"setting fixed pattern noise to zero"</span>,
-<a name="l00380"></a>00380                         ron,
-<a name="l00381"></a>00381                         bias_fixed_pattern_noise);
-<a name="l00382"></a>00382         bias_fixed_pattern_noise = 0;
-<a name="l00383"></a>00383     }
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00386"></a>00386     <span class="keywordflow">return</span> bias_fixed_pattern_noise;
-<a name="l00387"></a>00387 }
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390 <span class="preprocessor">#undef cleanup</span>
-<a name="l00391"></a><a class="code" href="group__fors__tools.html#g57cf6e6e2826eb178fd2d9c3e5695343">00391</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00392"></a>00392 <span class="preprocessor"></span>
-<a name="l00397"></a>00397 <span class="keywordtype">double</span>
-<a name="l00398"></a><a class="code" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">00398</a> <a class="code" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">fors_get_airmass</a>(<span class="keyword">const</span> cpl_propertylist *header)
-<a name="l00399"></a>00399 {
-<a name="l00400"></a>00400   <span class="keywordtype">double</span> airmass_start, airmass_end;
-<a name="l00401"></a>00401   airmass_start = cpl_propertylist_get_double(header, <a class="code" href="group__fors__pfits.html#g4a9f2c688a6202767e8c004478488994">FORS_PFITS_AIRMASS_START</a>);
-<a name="l00402"></a>00402   <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> -1, 
-<a name="l00403"></a>00403           <span class="stringliteral">"Could not read %s from header"</span>, 
-<a name="l00404"></a>00404           <a class="code" href="group__fors__pfits.html#g4a9f2c688a6202767e8c004478488994">FORS_PFITS_AIRMASS_START</a>);
-<a name="l00405"></a>00405   
-<a name="l00406"></a>00406   airmass_end = cpl_propertylist_get_double(header, <a class="code" href="group__fors__pfits.html#gc3c14efc5b8bb4954172110153ed1965">FORS_PFITS_AIRMASS_END</a>);
-<a name="l00407"></a>00407   <span class="keywordflow">if</span>(cpl_error_get_code())
-<a name="l00408"></a>00408   {
-<a name="l00409"></a>00409       cpl_msg_warning(cpl_func, <span class="stringliteral">"Could not read %s. Using only keyword %s"</span>,
-<a name="l00410"></a>00410                       <a class="code" href="group__fors__pfits.html#gc3c14efc5b8bb4954172110153ed1965">FORS_PFITS_AIRMASS_END</a>, <a class="code" href="group__fors__pfits.html#g4a9f2c688a6202767e8c004478488994">FORS_PFITS_AIRMASS_START</a>);
-<a name="l00411"></a>00411       cpl_error_reset();
-<a name="l00412"></a>00412       <span class="keywordflow">return</span> airmass_start;
-<a name="l00413"></a>00413   }
-<a name="l00414"></a>00414   
-<a name="l00415"></a>00415   <span class="keywordflow">return</span> 0.5 * (airmass_start + airmass_end);
-<a name="l00416"></a>00416 }
-<a name="l00417"></a>00417 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__tools_8c_source.html b/html/fors__tools_8c_source.html
new file mode 100644
index 0000000..89e4a36
--- /dev/null
+++ b/html/fors__tools_8c_source.html
@@ -0,0 +1,442 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_tools.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_tools.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_tools.c,v 1.22 2012-08-07 15:26:53 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2012-08-07 15:26:53 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.22 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_tools.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <assert.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">    cpl_propertylist_delete(header); \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="group__fors__tools.html#ga38ae9b9338fdb3cca9a17d970fac3db3">   65</a></span> <a class="code" href="group__fors__tools.html#ga38ae9b9338fdb3cca9a17d970fac3db3" title="Correct for extinction, gain, exposure time.">fors_star_ext_corr</a>(fors_star_list *stars, </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>                    <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                    <span class="keywordtype">double</span> ext_coeff,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                    <span class="keywordtype">double</span> dext_coeff,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                    <span class="keyword">const</span> cpl_frame *raw_frame)</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> {</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     cpl_propertylist *header = NULL;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     </div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Extinction correction"</span>);</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>     </div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frame_get_filename(raw_frame) != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     header = cpl_propertylist_load(cpl_frame_get_filename(raw_frame), 0);</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> -1,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>             <span class="stringliteral">"Failed to load %s primary header"</span>,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>             cpl_frame_get_filename(raw_frame));</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <span class="keywordtype">double</span> avg_airmass = <a class="code" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b" title="Compute average airmass.">fors_get_airmass</a>(header);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> -1,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>             <span class="stringliteral">"%s: Could not read airmass"</span>,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>             cpl_frame_get_filename(raw_frame));</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Exposure time = %f s"</span>, setting->exposure_time);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Gain          = %f ADU/e-"</span>, setting->average_gain);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Ext. coeff.   = %f +- %f mag/airmass"</span>, </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                  ext_coeff, dext_coeff);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Avg. airmass  = %f airmass"</span>, avg_airmass);  </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="comment">/* The quantity and the unit are both 'airmass' */</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> </div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     {</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>         <a class="code" href="struct__fors__star.html">fors_star</a> *star;</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>         </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>         <span class="keywordflow">for</span> (star = fors_star_list_first(stars);</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>              star != NULL;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>              star = fors_star_list_next(stars)) {</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>             star->magnitude_corr = star->magnitude </div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                 + 2.5*log(setting->average_gain)/log(10)</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                 + 2.5*log(setting->exposure_time)/log(10)</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                 - ext_coeff * avg_airmass;</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> </div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>             <span class="comment">/* Propagate error from ext.coeff.</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="comment">               gain, exptime and airmass</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="comment">               have zero error */</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>             star->dmagnitude_corr = sqrt(star->dmagnitude * star->dmagnitude</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                                          + dext_coeff*dext_coeff * avg_airmass*avg_airmass);</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>         }</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     }</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     cleanup;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="keywordflow">return</span> avg_airmass;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> }</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> cpl_table *</div>
+<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="group__fors__tools.html#gabebf30c47320c004ab4e658f837f75db">  130</a></span> <a class="code" href="group__fors__tools.html#gabebf30c47320c004ab4e658f837f75db" title="Create product.">fors_create_sources_table</a>(fors_star_list *sources)</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> {</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     cpl_table *t = NULL;</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     t = cpl_table_new(fors_star_list_size(sources));</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     cpl_table_new_column(t, <span class="stringliteral">"X"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     cpl_table_new_column(t, <span class="stringliteral">"Y"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     cpl_table_new_column(t, <span class="stringliteral">"FWHM"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     cpl_table_new_column(t, <span class="stringliteral">"A"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     cpl_table_new_column(t, <span class="stringliteral">"B"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     cpl_table_new_column(t, <span class="stringliteral">"THETA"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     cpl_table_new_column(t, <span class="stringliteral">"ELL"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     cpl_table_new_column(t, <span class="stringliteral">"INSTR_MAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     cpl_table_new_column(t, <span class="stringliteral">"DINSTR_MAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     cpl_table_new_column(t, <span class="stringliteral">"INSTR_CMAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     cpl_table_new_column(t, <span class="stringliteral">"DINSTR_CMAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     cpl_table_new_column(t, <span class="stringliteral">"CLASS_STAR"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     cpl_table_new_column(t, <span class="stringliteral">"OBJECT"</span>, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     cpl_table_new_column(t, <span class="stringliteral">"RA"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     cpl_table_new_column(t, <span class="stringliteral">"DEC"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     cpl_table_new_column(t, <span class="stringliteral">"MAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     cpl_table_new_column(t, <span class="stringliteral">"DMAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     cpl_table_new_column(t, <span class="stringliteral">"CAT_MAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     cpl_table_new_column(t, <span class="stringliteral">"DCAT_MAG"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     cpl_table_new_column(t, <span class="stringliteral">"COLOR"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     cpl_table_new_column(t, <span class="stringliteral">"DCOLOR"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     cpl_table_new_column(t, <span class="stringliteral">"COV_CATM_COL"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     cpl_table_new_column(t, <span class="stringliteral">"USE_CAT"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="comment">/* Shift in x and y between initial guess FITS header WCS position</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="comment">       and measured position */</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_table_new_column(t, <span class="stringliteral">"SHIFT_X"</span>, CPL_TYPE_DOUBLE); </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     cpl_table_new_column(t, <span class="stringliteral">"SHIFT_Y"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     cpl_table_new_column(t, <span class="stringliteral">"ZEROPOINT"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     cpl_table_new_column(t, <span class="stringliteral">"DZEROPOINT"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     cpl_table_new_column(t, <span class="stringliteral">"WEIGHT"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     {</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <a class="code" href="struct__fors__star.html">fors_star</a> *s;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>         <span class="keywordflow">for</span> (s = fors_star_list_first(sources), i = 0;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>              s != NULL;</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>              s = fors_star_list_next(sources), i++) {</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>             <span class="keyword">const</span> fors_std_star *<span class="keywordtype">id</span> = s->id;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>             </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>             cpl_table_set_double(t, <span class="stringliteral">"X"</span>, i, s->pixel->x);</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>             cpl_table_set_double(t, <span class="stringliteral">"Y"</span>, i, s->pixel->y);</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>             cpl_table_set_double(t, <span class="stringliteral">"FWHM"</span>, i, s->fwhm);</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>             cpl_table_set_double(t, <span class="stringliteral">"A"</span>, i, s->semi_major);</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>             cpl_table_set_double(t, <span class="stringliteral">"B"</span>, i, s->semi_minor);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>             cpl_table_set_double(t, <span class="stringliteral">"THETA"</span>, i, s->orientation);</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>             cpl_table_set_double(t, <span class="stringliteral">"ELL"</span>, i, <a class="code" href="group__fors__star.html#ga9e7994d44acbe88580cab63d3662df40" title="Get star ellipticity.">fors_star_ellipticity</a>(s, NULL));</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>             cpl_table_set_double(t, <span class="stringliteral">"INSTR_MAG"</span>, i, s->magnitude);</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>             cpl_table_set_double(t, <span class="stringliteral">"DINSTR_MAG"</span>, i, s->dmagnitude);</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>             cpl_table_set_double(t, <span class="stringliteral">"INSTR_CMAG"</span>, i, s->magnitude_corr);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>             cpl_table_set_double(t, <span class="stringliteral">"DINSTR_CMAG"</span>, i, s->dmagnitude_corr);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>             cpl_table_set_double(t, <span class="stringliteral">"CLASS_STAR"</span>, i, s->stellarity_index);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>             cpl_table_set_double(t, <span class="stringliteral">"WEIGHT"</span>, i, s->weight);</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>             </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>             <span class="keywordflow">if</span> (<span class="keywordtype">id</span> != NULL)</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>             {</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                 cpl_table_set_string(t, <span class="stringliteral">"OBJECT"</span>,       i, id->name); <span class="comment">/* possibly NULL */</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                 cpl_table_set_double(t, <span class="stringliteral">"RA"</span>,           i, id->ra);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                 cpl_table_set_double(t, <span class="stringliteral">"DEC"</span>,          i, id->dec);</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                 cpl_table_set_double(t, <span class="stringliteral">"MAG"</span>,          i, id->magnitude);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                 cpl_table_set_double(t, <span class="stringliteral">"DMAG"</span>,         i, id->dmagnitude);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                 cpl_table_set_double(t, <span class="stringliteral">"CAT_MAG"</span>,      i, id->cat_magnitude);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                 cpl_table_set_double(t, <span class="stringliteral">"DCAT_MAG"</span>,     i, id->dcat_magnitude);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                 cpl_table_set_double(t, <span class="stringliteral">"COLOR"</span>,        i, id->color);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                 cpl_table_set_double(t, <span class="stringliteral">"DCOLOR"</span>,       i, id->dcolor);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                 cpl_table_set_double(t, <span class="stringliteral">"COV_CATM_COL"</span>, i, id->cov_catm_color);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                 cpl_table_set_double(t, <span class="stringliteral">"SHIFT_X"</span>,      i,  s->pixel->x</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                                                             - id->pixel->x);</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                 cpl_table_set_double(t, <span class="stringliteral">"SHIFT_Y"</span>,      i,  s->pixel->y</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                                             - id->pixel->y);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                 cpl_table_set_double(t, <span class="stringliteral">"ZEROPOINT"</span>,    i, </div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                                      <a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e" title="Get zeropoint.">fors_star_get_zeropoint</a>(s, NULL));</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                 cpl_table_set_double(t, <span class="stringliteral">"DZEROPOINT"</span>,   i, </div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                                      <a class="code" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183" title="Get zeropoint error.">fors_star_get_zeropoint_err</a>(s, NULL));</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                 <span class="comment">/* fit this magnitude in fors_photometry? (fit = !trusted) */</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                 cpl_table_set_int   (t, <span class="stringliteral">"USE_CAT"</span>,      i,</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>                                             ((id->trusted) ? 1 : 0));</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>             }</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                 cpl_table_set_invalid(t, <span class="stringliteral">"RA"</span> , i);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                 cpl_table_set_invalid(t, <span class="stringliteral">"DEC"</span>, i);</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                 cpl_table_set_invalid(t, <span class="stringliteral">"MAG"</span>, i);</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                 cpl_table_set_invalid(t, <span class="stringliteral">"DMAG"</span>, i);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>                 cpl_table_set_invalid(t, <span class="stringliteral">"SHIFT_X"</span>, i);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>                 cpl_table_set_invalid(t, <span class="stringliteral">"SHIFT_Y"</span>, i);</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                 cpl_table_set_invalid(t, <span class="stringliteral">"ZEROPOINT"</span>, i);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                 cpl_table_set_invalid(t, <span class="stringliteral">"DZEROPOINT"</span>, i);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>             }</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>         }</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     }</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     <span class="keywordflow">return</span> t;</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> }</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <span class="preprocessor">    fors_image_delete(&image); \</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> <span class="preprocessor">    fors_image_delete(&image2); \</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno"><a class="code" href="group__fors__tools.html#ga97b43bda55e1da41fe216364c8408d5b">  244</a></span> <a class="code" href="group__fors__tools.html#ga97b43bda55e1da41fe216364c8408d5b" title="Compute fixed pattern noise in flat field.">fors_fixed_pattern_noise</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                          <span class="keywordtype">double</span> convert_ADU,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                          <span class="keywordtype">double</span> master_noise)</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> {</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keywordtype">double</span> master_fixed_pattern_noise;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image2 = NULL;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( master != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="comment">/* Use central 101x101 window </span></div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="comment">       and 101x101 window shifted (10, 10) from center</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keywordflow">if</span> (<a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(master) >= 121 &&</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>         <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(master) >= 121) {</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>         </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>         <span class="keywordtype">int</span> mid_x = (<a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(master) + 1) / 2;</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         <span class="keywordtype">int</span> mid_y = (<a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(master) + 1) / 2;</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>         </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>         image = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(master);       </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>         <a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053" title="Crop image.">fors_image_crop</a>(image, </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                         mid_x - 50, mid_y - 50,</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>                         mid_x + 50, mid_y + 50);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>         </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>         image2 = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(master);       </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>         <a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053" title="Crop image.">fors_image_crop</a>(image2, </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                         mid_x + 10 - 50, mid_y + 10 - 50,</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>                         mid_x + 10 + 50, mid_y + 10 + 50);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>         <a class="code" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be" title="Subtract images.">fors_image_subtract</a>(image, image2);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>         master_fixed_pattern_noise = </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>             <a class="code" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e" title="Get empirical stdev of data.">fors_image_get_stdev</a>(image, NULL) / sqrt(2);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>         <span class="comment">/* Convert to ADU */</span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>         master_fixed_pattern_noise *= convert_ADU;</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>         <span class="comment">/* Subtract photon noise */</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>         <span class="keywordflow">if</span> (master_fixed_pattern_noise >= master_noise) {</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>             </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>             master_fixed_pattern_noise = sqrt(master_fixed_pattern_noise*</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>                                               master_fixed_pattern_noise</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                                               -</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>                                               master_noise*</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                                               master_noise);</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>         }</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>             cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                             <span class="stringliteral">"Zero-shift noise (%f ADU) is greater than "</span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                             <span class="stringliteral">"accumulated zero-shift and fixed pattern noise (%f ADU), "</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                             <span class="stringliteral">"setting fixed pattern noise to zero"</span>,</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                             master_noise,</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                             master_fixed_pattern_noise);</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>             master_fixed_pattern_noise = 0;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>         }</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     }</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>         cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                         <span class="stringliteral">"Master flat too small (%dx%d), "</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>                         <span class="stringliteral">"need size 121x121 to compute master flat "</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>                         <span class="stringliteral">"fixed pattern noise"</span>,</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>                         <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(master),</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>                         <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(master));</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         master_fixed_pattern_noise = -1;</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     }</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     cleanup;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="keywordflow">return</span> master_fixed_pattern_noise;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> }</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> </div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="preprocessor">    fors_image_delete(&image); \</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> <span class="preprocessor">    fors_image_delete(&image2); \</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno"><a class="code" href="group__fors__tools.html#ga1ea0e4e37d52d6077b39e93ad1c340c3">  329</a></span> <a class="code" href="group__fors__tools.html#ga1ea0e4e37d52d6077b39e93ad1c340c3" title="Compute fixed pattern noise in bias.">fors_fixed_pattern_noise_bias</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *first_raw,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                               <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *second_raw,</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>                               <span class="keywordtype">double</span> ron)</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> {</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keywordtype">double</span> bias_fixed_pattern_noise;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image = NULL;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *image2 = NULL;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keywordtype">int</span> nx, ny;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( first_raw != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( second_raw != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> </div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> <span class="comment">     * Extract the largest possible two windows shifted (10, 10) </span></div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> </div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     nx = <a class="code" href="group__fors__image.html#ga978969a0911531b117735be291f106cc" title="Get image width.">fors_image_get_size_x</a>(first_raw);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     ny = <a class="code" href="group__fors__image.html#ga74854105003c725472595225aab740d7" title="Get image height.">fors_image_get_size_y</a>(first_raw);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     image = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(first_raw);       </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053" title="Crop image.">fors_image_crop</a>(image, </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>                     1, 1,</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>                     nx - 10, ny - 10);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         </div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     image2 = <a class="code" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f" title="Copy constructor.">fors_image_duplicate</a>(second_raw);       </div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     <a class="code" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053" title="Crop image.">fors_image_crop</a>(image2, </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                     11, 11,</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>                     nx, ny);</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <a class="code" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be" title="Subtract images.">fors_image_subtract</a>(image, image2);</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     bias_fixed_pattern_noise = <a class="code" href="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10" title="Get robust empirical stdev of data.">fors_image_get_stdev_robust</a>(image, 50, NULL) </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>                              / sqrt(2);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> <span class="comment">     * Subtract ron quadratically</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keywordflow">if</span> (bias_fixed_pattern_noise > ron) {</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>             </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>         bias_fixed_pattern_noise = sqrt(bias_fixed_pattern_noise *</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>                                         bias_fixed_pattern_noise</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>                                         -</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>                                         ron * ron);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     }</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>         cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>                         <span class="stringliteral">"Zero-shift noise (%f ADU) is greater than "</span></div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>                         <span class="stringliteral">"accumulated zero-shift and fixed pattern "</span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>                         <span class="stringliteral">"noise (%f ADU), "</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>                         <span class="stringliteral">"setting fixed pattern noise to zero"</span>,</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>                         ron,</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>                         bias_fixed_pattern_noise);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>         bias_fixed_pattern_noise = 0;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     }</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     cleanup;</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keywordflow">return</span> bias_fixed_pattern_noise;</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> }</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno"><a class="code" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b">  398</a></span> <a class="code" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b" title="Compute average airmass.">fors_get_airmass</a>(<span class="keyword">const</span> cpl_propertylist *header)</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> {</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>   <span class="keywordtype">double</span> airmass_start, airmass_end;</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>   airmass_start = cpl_propertylist_get_double(header, FORS_PFITS_AIRMASS_START);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>   <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> -1, </div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>           <span class="stringliteral">"Could not read %s from header"</span>, </div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>           FORS_PFITS_AIRMASS_START);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>   </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>   airmass_end = cpl_propertylist_get_double(header, FORS_PFITS_AIRMASS_END);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>   <span class="keywordflow">if</span>(cpl_error_get_code())</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>   {</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>       cpl_msg_warning(cpl_func, <span class="stringliteral">"Could not read %s. Using only keyword %s"</span>,</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                       FORS_PFITS_AIRMASS_END, FORS_PFITS_AIRMASS_START);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>       cpl_error_reset();</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>       <span class="keywordflow">return</span> airmass_start;</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>   }</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>   </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>   <span class="keywordflow">return</span> 0.5 * (airmass_start + airmass_end);</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> }</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__tools_8h-source.html b/html/fors__tools_8h-source.html
deleted file mode 100644
index 41c7884..0000000
--- a/html/fors__tools_8h-source.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_tools.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_tools.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_tools.h,v 1.7 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_TOOLS_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_TOOLS_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_star.h></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_setting.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="keywordtype">double</span>
-<a name="l00037"></a>00037 <a class="code" href="group__fors__tools.html#g6a1cb404cc2c956f79b10ea46a0611dc">fors_star_ext_corr</a>(fors_star_list *stars, 
-<a name="l00038"></a>00038                    <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,
-<a name="l00039"></a>00039                    <span class="keywordtype">double</span> ext_coeff,
-<a name="l00040"></a>00040            <span class="keywordtype">double</span> dext_coeff,
-<a name="l00041"></a>00041                    <span class="keyword">const</span> cpl_frame *raw_frame);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 cpl_table *
-<a name="l00044"></a>00044 <a class="code" href="group__fors__tools.html#g8138511b64d1d365e21b56eb161f2028">fors_create_sources_table</a>(fors_star_list *sources);
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="keywordtype">double</span>
-<a name="l00047"></a>00047 <a class="code" href="group__fors__tools.html#g5637ecda70fb6aeab5c0b22dec2e2e10">fors_fixed_pattern_noise</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master,
-<a name="l00048"></a>00048                          <span class="keywordtype">double</span> convert_ADU,
-<a name="l00049"></a>00049                          <span class="keywordtype">double</span> master_noise);
-<a name="l00050"></a>00050 <span class="keywordtype">double</span>
-<a name="l00051"></a>00051 <a class="code" href="group__fors__tools.html#g2e2a80069157183a808349976b3e455a">fors_fixed_pattern_noise_bias</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *first_raw,
-<a name="l00052"></a>00052                               <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *second_raw,
-<a name="l00053"></a>00053                               <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>);
-<a name="l00054"></a>00054 <span class="keywordtype">double</span>
-<a name="l00055"></a>00055 <a class="code" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">fors_get_airmass</a>(<span class="keyword">const</span> cpl_propertylist *header);
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__tools_8h_source.html b/html/fors__tools_8h_source.html
new file mode 100644
index 0000000..8d5bae7
--- /dev/null
+++ b/html/fors__tools_8h_source.html
@@ -0,0 +1,118 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_tools.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_tools.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_tools.h,v 1.7 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.7 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_TOOLS_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_TOOLS_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_star.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_setting.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <a class="code" href="group__fors__tools.html#ga38ae9b9338fdb3cca9a17d970fac3db3" title="Correct for extinction, gain, exposure time.">fors_star_ext_corr</a>(fors_star_list *stars, </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span>                    <span class="keyword">const</span> <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting,</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>                    <span class="keywordtype">double</span> ext_coeff,</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>            <span class="keywordtype">double</span> dext_coeff,</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>                    <span class="keyword">const</span> cpl_frame *raw_frame);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> cpl_table *</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <a class="code" href="group__fors__tools.html#gabebf30c47320c004ab4e658f837f75db" title="Create product.">fors_create_sources_table</a>(fors_star_list *sources);</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <a class="code" href="group__fors__tools.html#ga97b43bda55e1da41fe216364c8408d5b" title="Compute fixed pattern noise in flat field.">fors_fixed_pattern_noise</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master,</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>                          <span class="keywordtype">double</span> convert_ADU,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>                          <span class="keywordtype">double</span> master_noise);</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <a class="code" href="group__fors__tools.html#ga1ea0e4e37d52d6077b39e93ad1c340c3" title="Compute fixed pattern noise in bias.">fors_fixed_pattern_noise_bias</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *first_raw,</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>                               <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *second_raw,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>                               <span class="keywordtype">double</span> ron);</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <a class="code" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b" title="Compute average airmass.">fors_get_airmass</a>(<span class="keyword">const</span> cpl_propertylist *header);</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__trace__flat_8c-source.html b/html/fors__trace__flat_8c-source.html
deleted file mode 100644
index 270a84f..0000000
--- a/html/fors__trace__flat_8c-source.html
+++ /dev/null
@@ -1,633 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_trace_flat.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_trace_flat.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_trace_flat.c,v 1.7 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_trace_flat_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to trace the edges of MOS/MXU flat field slit spectra\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"and determine the spectral curvature solution. The input master flat field\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"image, product of the recipe fors_flat, is expected to be oriented with\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"horizontal dispersion direction and red wavelengths on the right side.\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"The input slits location table should be the product of the recipe\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"fors_detect_spectra.\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"The input master flat image is shifted one pixel down and is subtracted\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"from the original image. The result is a vertical gradient map. Next,\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"the negative values are forced positive, to obtain an absolute gradient\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"map. The map is passed with a horizontal median filter, and after that\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"the gradient peaks are traced starting from the slits positions listed\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"in the input slits location table. The number of pixels to the left and\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"to the right of the reference pixel is trivially derived from the specified\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"spectral range and spectral dispersion.\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"The output spectral curvature table contains the coefficients of the\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"polynomial fitting of the found traces, while the output trace table\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"contains the traced spectral edges positions in CCD (Y) coordinates for\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"each spectrum, and their comparison with their modeling. A spatial map\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"is also created, where to each CCD pixel is assigned the value of the\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"spatial coordinate along the slit (in pixel). For more details please\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"refer to the FORS Pipeline User's Manual.\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"Note that specifying an input GRISM_TABLE will set some of the recipe\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"configuration parameters to default values valid for a particular grism.\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"Again, see the pipeline manual for more details.\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS.\n\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"  MASTER_SCREEN_FLAT_MXU     Calib       Master flat frame       Y\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"  SLIT_LOCATION_DETECT_MXU   Calib       Slits location          Y\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00077"></a>00077 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00078"></a>00078 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00079"></a>00079 <span class="stringliteral">"  CURV_TRACES_MXU            FITS table  Flat field tracings\n"</span>
-<a name="l00080"></a>00080 <span class="stringliteral">"  CURV_COEFF_MXU             FITS table  Spectral curvature table\n"</span>
-<a name="l00081"></a>00081 <span class="stringliteral">"  SPATIAL_MAP_MXU            FITS image  Map of spatial coordinate\n\n"</span>;
-<a name="l00082"></a>00082 
-<a name="l00083"></a>00083 <span class="preprocessor">#define fors_trace_flat_exit(message)         \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">{                                             \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">cpl_image_delete(master_flat);                \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">cpl_image_delete(spatial);                    \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">cpl_table_delete(traces);                     \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00094"></a>00094 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">}</span>
-<a name="l00098"></a>00098 <span class="preprocessor"></span>
-<a name="l00099"></a>00099 <span class="preprocessor">#define fors_trace_flat_exit_memcheck(message)  \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">{                                               \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">printf("free master_flat (%p)\n", master_flat); \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">cpl_image_delete(master_flat);                  \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">printf("free spatial (%p)\n", spatial);         \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">cpl_image_delete(spatial);                      \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);   \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">cpl_image_delete(coordinate);                   \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">cpl_table_delete(grism_table);                  \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">cpl_table_delete(maskslits);                    \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">cpl_table_delete(slits);                        \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">printf("free traces (%p)\n", traces);           \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">cpl_table_delete(traces);                       \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">cpl_table_delete(polytraces);                   \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00121"></a>00121 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">}</span>
-<a name="l00123"></a>00123 <span class="preprocessor"></span>
-<a name="l00124"></a>00124 
-<a name="l00136"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00136</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00137"></a>00137 {
-<a name="l00138"></a>00138     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00139"></a>00139     cpl_plugin *plugin = &recipe->interface;
-<a name="l00140"></a>00140 
-<a name="l00141"></a>00141     cpl_plugin_init(plugin,
-<a name="l00142"></a>00142                     CPL_PLUGIN_API,
-<a name="l00143"></a>00143                     FORS_BINARY_VERSION,
-<a name="l00144"></a>00144                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00145"></a>00145                     <span class="stringliteral">"fors_trace_flat"</span>,
-<a name="l00146"></a>00146                     <span class="stringliteral">"Determine spectral curvature model"</span>,
-<a name="l00147"></a>00147                     fors_trace_flat_description,
-<a name="l00148"></a>00148                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00149"></a>00149                     PACKAGE_BUGREPORT,
-<a name="l00150"></a>00150     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00151"></a>00151     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00152"></a>00152     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00153"></a>00153     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00154"></a>00154     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00155"></a>00155     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00156"></a>00156     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00157"></a>00157     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00158"></a>00158     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00159"></a>00159     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00160"></a>00160     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00161"></a>00161     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00162"></a>00162     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00163"></a>00163                     fors_trace_flat_create,
-<a name="l00164"></a>00164                     fors_trace_flat_exec,
-<a name="l00165"></a>00165                     fors_trace_flat_destroy);
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     cpl_pluginlist_append(list, plugin);
-<a name="l00168"></a>00168     
-<a name="l00169"></a>00169     <span class="keywordflow">return</span> 0;
-<a name="l00170"></a>00170 }
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172 
-<a name="l00183"></a>00183 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_create(cpl_plugin *plugin)
-<a name="l00184"></a>00184 {
-<a name="l00185"></a>00185     cpl_recipe    *recipe;
-<a name="l00186"></a>00186     cpl_parameter *p;
-<a name="l00187"></a>00187 
-<a name="l00188"></a>00188     <span class="comment">/* </span>
-<a name="l00189"></a>00189 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00190"></a>00190 <span class="comment">     */</span>
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00193"></a>00193         recipe = (cpl_recipe *)plugin;
-<a name="l00194"></a>00194     <span class="keywordflow">else</span> 
-<a name="l00195"></a>00195         <span class="keywordflow">return</span> -1;
-<a name="l00196"></a>00196 
-<a name="l00197"></a>00197     <span class="comment">/* </span>
-<a name="l00198"></a>00198 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00199"></a>00199 <span class="comment">     */</span>
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203     <span class="comment">/*</span>
-<a name="l00204"></a>00204 <span class="comment">     * Dispersion</span>
-<a name="l00205"></a>00205 <span class="comment">     */</span>
-<a name="l00206"></a>00206 
-<a name="l00207"></a>00207     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_trace_flat.dispersion"</span>,
-<a name="l00208"></a>00208                                 CPL_TYPE_DOUBLE,
-<a name="l00209"></a>00209                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00210"></a>00210                                 <span class="stringliteral">"fors.fors_trace_flat"</span>,
-<a name="l00211"></a>00211                                 0.0);
-<a name="l00212"></a>00212     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00213"></a>00213     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00214"></a>00214     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00215"></a>00215 
-<a name="l00216"></a>00216     <span class="comment">/*</span>
-<a name="l00217"></a>00217 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00218"></a>00218 <span class="comment">     */</span>
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_trace_flat.startwavelength"</span>,
-<a name="l00221"></a>00221                                 CPL_TYPE_DOUBLE,
-<a name="l00222"></a>00222                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00223"></a>00223                                 <span class="stringliteral">"fors.fors_trace_flat"</span>,
-<a name="l00224"></a>00224                                 0.0);
-<a name="l00225"></a>00225     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00226"></a>00226     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00227"></a>00227     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229     <span class="comment">/*</span>
-<a name="l00230"></a>00230 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00231"></a>00231 <span class="comment">     */</span>
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_trace_flat.endwavelength"</span>,
-<a name="l00234"></a>00234                                 CPL_TYPE_DOUBLE,
-<a name="l00235"></a>00235                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00236"></a>00236                                 <span class="stringliteral">"fors.fors_trace_flat"</span>,
-<a name="l00237"></a>00237                                 0.0);
-<a name="l00238"></a>00238     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00239"></a>00239     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00240"></a>00240     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00241"></a>00241 
-<a name="l00242"></a>00242     <span class="comment">/*</span>
-<a name="l00243"></a>00243 <span class="comment">     * Degree of spectral curvature polynomial</span>
-<a name="l00244"></a>00244 <span class="comment">     */</span>
-<a name="l00245"></a>00245 
-<a name="l00246"></a>00246     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_trace_flat.cdegree"</span>,
-<a name="l00247"></a>00247                                 CPL_TYPE_INT,
-<a name="l00248"></a>00248                                 <span class="stringliteral">"Degree of spectral curvature polynomial"</span>,
-<a name="l00249"></a>00249                                 <span class="stringliteral">"fors.fors_trace_flat"</span>,
-<a name="l00250"></a>00250                                 0);
-<a name="l00251"></a>00251     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cdegree"</span>);
-<a name="l00252"></a>00252     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00253"></a>00253     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255     <span class="comment">/*</span>
-<a name="l00256"></a>00256 <span class="comment">     * Curvature solution interpolation (for MOS-like data)</span>
-<a name="l00257"></a>00257 <span class="comment">     */</span>
-<a name="l00258"></a>00258 
-<a name="l00259"></a>00259     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_trace_flat.cmode"</span>,
-<a name="l00260"></a>00260                                 CPL_TYPE_INT,
-<a name="l00261"></a>00261                                 <span class="stringliteral">"Interpolation mode of curvature solution "</span>
-<a name="l00262"></a>00262                                 <span class="stringliteral">"applicable to MOS-like data (0 = no "</span>
-<a name="l00263"></a>00263                                 <span class="stringliteral">"interpolation, 1 = fill gaps, 2 = global "</span>
-<a name="l00264"></a>00264                                 <span class="stringliteral">"model)"</span>,
-<a name="l00265"></a>00265                                 <span class="stringliteral">"fors.fors_trace_flat"</span>,
-<a name="l00266"></a>00266                                 1);
-<a name="l00267"></a>00267     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cmode"</span>);
-<a name="l00268"></a>00268     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00269"></a>00269     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00270"></a>00270 
-<a name="l00271"></a>00271     <span class="keywordflow">return</span> 0;
-<a name="l00272"></a>00272 }
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274 
-<a name="l00283"></a>00283 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_exec(cpl_plugin *plugin)
-<a name="l00284"></a>00284 {
-<a name="l00285"></a>00285     cpl_recipe *recipe;
-<a name="l00286"></a>00286     
-<a name="l00287"></a>00287     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00288"></a>00288         recipe = (cpl_recipe *)plugin;
-<a name="l00289"></a>00289     <span class="keywordflow">else</span> 
-<a name="l00290"></a>00290         <span class="keywordflow">return</span> -1;
-<a name="l00291"></a>00291 
-<a name="l00292"></a>00292     <span class="keywordflow">return</span> fors_trace_flat(recipe->parameters, recipe->frames);
-<a name="l00293"></a>00293 }
-<a name="l00294"></a>00294 
-<a name="l00295"></a>00295 
-<a name="l00304"></a>00304 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_destroy(cpl_plugin *plugin)
-<a name="l00305"></a>00305 {
-<a name="l00306"></a>00306     cpl_recipe *recipe;
-<a name="l00307"></a>00307     
-<a name="l00308"></a>00308     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00309"></a>00309         recipe = (cpl_recipe *)plugin;
-<a name="l00310"></a>00310     <span class="keywordflow">else</span> 
-<a name="l00311"></a>00311         <span class="keywordflow">return</span> -1;
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00314"></a>00314 
-<a name="l00315"></a>00315     <span class="keywordflow">return</span> 0;
-<a name="l00316"></a>00316 }
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318 
-<a name="l00328"></a>00328 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat(cpl_parameterlist *parlist, 
-<a name="l00329"></a>00329                                cpl_frameset *frameset)
-<a name="l00330"></a>00330 {
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_trace_flat"</span>;
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335     <span class="comment">/*</span>
-<a name="l00336"></a>00336 <span class="comment">     * Input parameters</span>
-<a name="l00337"></a>00337 <span class="comment">     */</span>
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339     <span class="keywordtype">double</span>      dispersion;
-<a name="l00340"></a>00340     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00341"></a>00341     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00342"></a>00342     <span class="keywordtype">int</span>         cdegree;
-<a name="l00343"></a>00343     <span class="keywordtype">int</span>         cmode;
-<a name="l00344"></a>00344 
-<a name="l00345"></a>00345     <span class="comment">/*</span>
-<a name="l00346"></a>00346 <span class="comment">     * CPL objects</span>
-<a name="l00347"></a>00347 <span class="comment">     */</span>
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349     cpl_image        *master_flat = NULL;
-<a name="l00350"></a>00350     cpl_image        *coordinate  = NULL;
-<a name="l00351"></a>00351     cpl_image        *spatial     = NULL;
-<a name="l00352"></a>00352     cpl_table        *grism_table = NULL;
-<a name="l00353"></a>00353     cpl_table        *maskslits   = NULL;
-<a name="l00354"></a>00354     cpl_table        *slits       = NULL;
-<a name="l00355"></a>00355     cpl_table        *traces      = NULL;
-<a name="l00356"></a>00356     cpl_table        *polytraces  = NULL;
-<a name="l00357"></a>00357     cpl_propertylist *header      = NULL;
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     <span class="comment">/*</span>
-<a name="l00360"></a>00360 <span class="comment">     * Auxiliary variables</span>
-<a name="l00361"></a>00361 <span class="comment">     */</span>
-<a name="l00362"></a>00362 
-<a name="l00363"></a>00363     <span class="keywordtype">char</span>        version[80];
-<a name="l00364"></a>00364     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_flat_tag;
-<a name="l00365"></a>00365     <span class="keyword">const</span> <span class="keywordtype">char</span> *spatial_map_tag;
-<a name="l00366"></a>00366     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_detect_tag;
-<a name="l00367"></a>00367     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00368"></a>00368     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_traces_tag;
-<a name="l00369"></a>00369     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;
-<a name="l00370"></a>00370     <span class="keywordtype">int</span>         flat_mxu;
-<a name="l00371"></a>00371     <span class="keywordtype">int</span>         flat_mos;
-<a name="l00372"></a>00372     <span class="keywordtype">int</span>         flat_lss;
-<a name="l00373"></a>00373     <span class="keywordtype">int</span>         mxu, mos;
-<a name="l00374"></a>00374     <span class="keywordtype">int</span>         nflat;
-<a name="l00375"></a>00375     <span class="keywordtype">int</span>         nslits;
-<a name="l00376"></a>00376     <span class="keywordtype">int</span>         rebin;
-<a name="l00377"></a>00377     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00378"></a>00378     <span class="keywordtype">int</span>         treat_as_lss;
-<a name="l00379"></a>00379     <span class="keywordtype">int</span>         i;
-<a name="l00380"></a>00380     <span class="keywordtype">double</span>      reference;
-<a name="l00381"></a>00381     <span class="keywordtype">double</span>     *xpos;
-<a name="l00382"></a>00382     <span class="keywordtype">double</span>      mxpos;
-<a name="l00383"></a>00383     <span class="keywordtype">int</span>         nslits_out_det = 0;
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00386"></a>00386 
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388     cpl_msg_set_indentation(2);
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390     <span class="comment">/*</span>
-<a name="l00391"></a>00391 <span class="comment">     * Get configuration parameters</span>
-<a name="l00392"></a>00392 <span class="comment">     */</span>
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00395"></a>00395     cpl_msg_indent_more();
-<a name="l00396"></a>00396     
-<a name="l00397"></a>00397     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00398"></a>00398         fors_trace_flat_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); 
-<a name="l00399"></a>00399 
-<a name="l00400"></a>00400     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00403"></a>00403                     <span class="stringliteral">"fors.fors_trace_flat.dispersion"</span>, grism_table);
-<a name="l00404"></a>00404 
-<a name="l00405"></a>00405     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00406"></a>00406         fors_trace_flat_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00407"></a>00407 
-<a name="l00408"></a>00408     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00409"></a>00409                     <span class="stringliteral">"fors.fors_trace_flat.startwavelength"</span>, grism_table);
-<a name="l00410"></a>00410     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00411"></a>00411         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00412"></a>00412             fors_trace_flat_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00413"></a>00413 
-<a name="l00414"></a>00414     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00415"></a>00415                     <span class="stringliteral">"fors.fors_trace_flat.endwavelength"</span>, grism_table);
-<a name="l00416"></a>00416     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00417"></a>00417         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00418"></a>00418             fors_trace_flat_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00419"></a>00419         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00420"></a>00420             fors_trace_flat_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00421"></a>00421     }
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00424"></a>00424         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00425"></a>00425             fors_trace_flat_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00426"></a>00426 
-<a name="l00427"></a>00427     cdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00428"></a>00428                     <span class="stringliteral">"fors.fors_trace_flat.cdegree"</span>, grism_table);
-<a name="l00429"></a>00429 
-<a name="l00430"></a>00430     <span class="keywordflow">if</span> (cdegree < 1)
-<a name="l00431"></a>00431         fors_trace_flat_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433     <span class="keywordflow">if</span> (cdegree > 5)
-<a name="l00434"></a>00434         fors_trace_flat_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00435"></a>00435 
-<a name="l00436"></a>00436     cmode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_trace_flat.cmode"</span>, NULL);
-<a name="l00437"></a>00437 
-<a name="l00438"></a>00438     <span class="keywordflow">if</span> (cmode < 0 || cmode > 2)
-<a name="l00439"></a>00439         fors_trace_flat_exit(<span class="stringliteral">"Invalid curvature solution interpolation mode"</span>);
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00444"></a>00444         fors_trace_flat_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);
-<a name="l00445"></a>00445 
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447     cpl_msg_indent_less();
-<a name="l00448"></a>00448     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00449"></a>00449     cpl_msg_indent_more();
-<a name="l00450"></a>00450 
-<a name="l00451"></a>00451     nflat  = flat_mxu = cpl_frameset_count_tags(frameset, 
-<a name="l00452"></a>00452                                                 <span class="stringliteral">"MASTER_SCREEN_FLAT_MXU"</span>);
-<a name="l00453"></a>00453     nflat += flat_mos = cpl_frameset_count_tags(frameset, 
-<a name="l00454"></a>00454                                                 <span class="stringliteral">"MASTER_SCREEN_FLAT_MOS"</span>);
-<a name="l00455"></a>00455     nflat += flat_lss = cpl_frameset_count_tags(frameset, 
-<a name="l00456"></a>00456                                                 <span class="stringliteral">"MASTER_SCREEN_FLAT_LSS"</span>);
-<a name="l00457"></a>00457 
-<a name="l00458"></a>00458     <span class="keywordflow">if</span> (nflat == 0) {
-<a name="l00459"></a>00459         fors_trace_flat_exit(<span class="stringliteral">"Missing input master flat field frame"</span>);
-<a name="l00460"></a>00460     }
-<a name="l00461"></a>00461     <span class="keywordflow">if</span> (nflat > 1) {
-<a name="l00462"></a>00462         cpl_msg_error(recipe, <span class="stringliteral">"Too many input flat frames (%d > 1)"</span>, nflat);
-<a name="l00463"></a>00463         fors_trace_flat_exit(NULL);
-<a name="l00464"></a>00464     }
-<a name="l00465"></a>00465 
-<a name="l00466"></a>00466     mxu = mos = 0;
-<a name="l00467"></a>00467 
-<a name="l00468"></a>00468     <span class="keywordflow">if</span> (flat_mxu) {
-<a name="l00469"></a>00469         mxu = 1;
-<a name="l00470"></a>00470         master_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_MXU"</span>;
-<a name="l00471"></a>00471         slit_detect_tag   = <span class="stringliteral">"SLIT_LOCATION_DETECT_MXU"</span>;
-<a name="l00472"></a>00472         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00473"></a>00473         curv_traces_tag   = <span class="stringliteral">"CURV_TRACES_MXU"</span>;
-<a name="l00474"></a>00474         curv_coeff_tag    = <span class="stringliteral">"CURV_COEFF_MXU"</span>;
-<a name="l00475"></a>00475         spatial_map_tag   = <span class="stringliteral">"SPATIAL_MAP_MXU"</span>;
-<a name="l00476"></a>00476     }
-<a name="l00477"></a>00477     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (flat_mos) {
-<a name="l00478"></a>00478         mos = 1;
-<a name="l00479"></a>00479         master_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_MOS"</span>;
-<a name="l00480"></a>00480         slit_detect_tag   = <span class="stringliteral">"SLIT_LOCATION_DETECT_MOS"</span>;
-<a name="l00481"></a>00481         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00482"></a>00482         curv_traces_tag   = <span class="stringliteral">"CURV_TRACES_MOS"</span>;
-<a name="l00483"></a>00483         curv_coeff_tag    = <span class="stringliteral">"CURV_COEFF_MOS"</span>;
-<a name="l00484"></a>00484         spatial_map_tag   = <span class="stringliteral">"SPATIAL_MAP_MOS"</span>;
-<a name="l00485"></a>00485     }
-<a name="l00486"></a>00486     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (flat_lss) {
-<a name="l00487"></a>00487         fors_trace_flat_exit(<span class="stringliteral">"LSS spectra are not traceable: use this recipe "</span>
-<a name="l00488"></a>00488                              <span class="stringliteral">"just for MOS/MXU data."</span>);
-<a name="l00489"></a>00489     }
-<a name="l00490"></a>00490 
-<a name="l00491"></a>00491     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_detect_tag) == 0) {
-<a name="l00492"></a>00492         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, slit_detect_tag);
-<a name="l00493"></a>00493         fors_trace_flat_exit(NULL);
-<a name="l00494"></a>00494     }
-<a name="l00495"></a>00495 
-<a name="l00496"></a>00496     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_detect_tag) > 1) {
-<a name="l00497"></a>00497         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, slit_detect_tag);
-<a name="l00498"></a>00498         fors_trace_flat_exit(NULL);
-<a name="l00499"></a>00499     }
-<a name="l00500"></a>00500 
-<a name="l00501"></a>00501     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00502"></a>00502         fors_trace_flat_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00503"></a>00503 
-<a name="l00504"></a>00504     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00505"></a>00505         fors_trace_flat_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00506"></a>00506 
-<a name="l00507"></a>00507     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00508"></a>00508         fors_trace_flat_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511     <span class="comment">/*</span>
-<a name="l00512"></a>00512 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00513"></a>00513 <span class="comment">     * dispersion direction from the master flat frame</span>
-<a name="l00514"></a>00514 <span class="comment">     */</span>
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, master_flat_tag, 0);
-<a name="l00517"></a>00517 
-<a name="l00518"></a>00518     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00519"></a>00519         fors_trace_flat_exit(<span class="stringliteral">"Cannot load master flat frame header"</span>);
-<a name="l00520"></a>00520 
-<a name="l00521"></a>00521     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00522"></a>00522     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00523"></a>00523         fors_trace_flat_exit(<span class="stringliteral">"Missing keyword INSTRUME in master flat header"</span>);
-<a name="l00524"></a>00524 
-<a name="l00525"></a>00525     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00526"></a>00526         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00527"></a>00527     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00528"></a>00528         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00531"></a>00531 
-<a name="l00532"></a>00532     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00533"></a>00533         fors_trace_flat_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span>
-<a name="l00534"></a>00534                                  <span class="stringliteral">"in master flat frame header"</span>);
-<a name="l00535"></a>00535 
-<a name="l00536"></a>00536     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l00537"></a>00537         reference *= 10;
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l00540"></a>00540         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l00541"></a>00541                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in master flat header"</span>,
-<a name="l00542"></a>00542                       reference);
-<a name="l00543"></a>00543         fors_trace_flat_exit(NULL);
-<a name="l00544"></a>00544     }
-<a name="l00545"></a>00545 
-<a name="l00546"></a>00546     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l00547"></a>00547 
-<a name="l00548"></a>00548     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00549"></a>00549 
-<a name="l00550"></a>00550     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00551"></a>00551         fors_trace_flat_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00552"></a>00552                                  <span class="stringliteral">"in master flat header"</span>);
-<a name="l00553"></a>00553 
-<a name="l00554"></a>00554     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l00555"></a>00555         dispersion *= rebin;
-<a name="l00556"></a>00556         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l00557"></a>00557                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,
-<a name="l00558"></a>00558                         dispersion);
-<a name="l00559"></a>00559     }
-<a name="l00560"></a>00560 
-<a name="l00561"></a>00561 
-<a name="l00562"></a>00562     <span class="comment">/*</span>
-<a name="l00563"></a>00563 <span class="comment">     * Check if all slits have the same X offset: in such case, abort!</span>
-<a name="l00564"></a>00564 <span class="comment">     */</span>
-<a name="l00565"></a>00565 
-<a name="l00566"></a>00566     <span class="keywordflow">if</span> (mos)
-<a name="l00567"></a>00567         maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00568"></a>00568     <span class="keywordflow">else</span>
-<a name="l00569"></a>00569         maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00570"></a>00570 
-<a name="l00571"></a>00571     treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l00572"></a>00572 
-<a name="l00573"></a>00573     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00574"></a>00574         cpl_msg_error(recipe, <span class="stringliteral">"All slits have the same offset: %.2f mm\n"</span>
-<a name="l00575"></a>00575                       <span class="stringliteral">"Spectra are not traceable: the LSS data reduction\n"</span>
-<a name="l00576"></a>00576                       <span class="stringliteral">"strategy must be applied."</span>, mxpos);
-<a name="l00577"></a>00577         fors_trace_flat_exit(NULL);
-<a name="l00578"></a>00578     }
-<a name="l00579"></a>00579 
-<a name="l00580"></a>00580     cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00581"></a>00581 
-<a name="l00582"></a>00582 
-<a name="l00583"></a>00583     cpl_msg_indent_less();
-<a name="l00584"></a>00584     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);
-<a name="l00585"></a>00585     cpl_msg_indent_more();
-<a name="l00586"></a>00586 
-<a name="l00587"></a>00587     master_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, master_flat_tag, 
-<a name="l00588"></a>00588                                  CPL_TYPE_FLOAT, 0, 0);
-<a name="l00589"></a>00589     <span class="keywordflow">if</span> (master_flat == NULL)
-<a name="l00590"></a>00590         fors_trace_flat_exit(<span class="stringliteral">"Cannot load master flat field frame"</span>);
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_detect_tag, 1);
-<a name="l00593"></a>00593     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00594"></a>00594         fors_trace_flat_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l00595"></a>00595 
-<a name="l00596"></a>00596 
-<a name="l00597"></a>00597     cpl_msg_indent_less();
-<a name="l00598"></a>00598     cpl_msg_info(recipe, <span class="stringliteral">"Determining spectral curvature..."</span>);
-<a name="l00599"></a>00599     cpl_msg_indent_more();
-<a name="l00600"></a>00600 
-<a name="l00601"></a>00601     cpl_msg_info(recipe, <span class="stringliteral">"Tracing master flat field spectra edges..."</span>);
-<a name="l00602"></a>00602     traces = <a class="code" href="group__moses.html#g168f6aecd869c24634fa9f6690da0b02">mos_trace_flat</a>(master_flat, slits, reference,
-<a name="l00603"></a>00603                             startwavelength, endwavelength, dispersion);
-<a name="l00604"></a>00604 
-<a name="l00605"></a>00605     <span class="keywordflow">if</span> (!traces)
-<a name="l00606"></a>00606         fors_trace_flat_exit(<span class="stringliteral">"Tracing failure"</span>);
-<a name="l00607"></a>00607 
-<a name="l00608"></a>00608     cpl_msg_info(recipe, <span class="stringliteral">"Fitting flat field spectra edges..."</span>);
-<a name="l00609"></a>00609     polytraces = <a class="code" href="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414">mos_poly_trace</a>(slits, traces, cdegree);
-<a name="l00610"></a>00610 
-<a name="l00611"></a>00611     <span class="keywordflow">if</span> (!polytraces)
-<a name="l00612"></a>00612         fors_trace_flat_exit(<span class="stringliteral">"Trace fitting failure"</span>);
-<a name="l00613"></a>00613 
-<a name="l00614"></a>00614     <span class="keywordflow">if</span> (cmode) {
-<a name="l00615"></a>00615         cpl_msg_info(recipe, <span class="stringliteral">"Computing global spectral curvature model..."</span>);
-<a name="l00616"></a>00616         <a class="code" href="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5">mos_global_trace</a>(slits, polytraces, cmode);
-<a name="l00617"></a>00617     }
-<a name="l00618"></a>00618 
-<a name="l00619"></a>00619     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, traces, curv_traces_tag, NULL, parlist,
-<a name="l00620"></a>00620                        recipe, version))
-<a name="l00621"></a>00621         fors_trace_flat_exit(NULL);
-<a name="l00622"></a>00622 
-<a name="l00623"></a>00623     cpl_table_delete(traces); traces = NULL;
-<a name="l00624"></a>00624 
-<a name="l00625"></a>00625     nx = cpl_image_get_size_x(master_flat);
-<a name="l00626"></a>00626     ny = cpl_image_get_size_y(master_flat);
-<a name="l00627"></a>00627     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l00628"></a>00628 
-<a name="l00629"></a>00629     spatial = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(master_flat, slits, polytraces, 
-<a name="l00630"></a>00630                                       reference,
-<a name="l00631"></a>00631                                       startwavelength, endwavelength,
-<a name="l00632"></a>00632                                       dispersion, 0, coordinate);
-<a name="l00633"></a>00633 
-<a name="l00634"></a>00634     cpl_image_delete(master_flat); master_flat = NULL;
-<a name="l00635"></a>00635     cpl_image_delete(spatial); spatial = NULL;
-<a name="l00636"></a>00636 
-<a name="l00637"></a>00637     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, coordinate, spatial_map_tag, header,
-<a name="l00638"></a>00638                        parlist, recipe, version))
-<a name="l00639"></a>00639         fors_trace_flat_exit(NULL);
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641     cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l00642"></a>00642     cpl_propertylist_delete(header); header = NULL;
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,
-<a name="l00645"></a>00645                        parlist, recipe, version))
-<a name="l00646"></a>00646         fors_trace_flat_exit(NULL);
-<a name="l00647"></a>00647 
-<a name="l00648"></a>00648     cpl_table_delete(slits); slits = NULL;
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, polytraces, curv_coeff_tag, NULL,
-<a name="l00651"></a>00651                        parlist, recipe, version))
-<a name="l00652"></a>00652         fors_trace_flat_exit(NULL);
-<a name="l00653"></a>00653 
-<a name="l00654"></a>00654     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l00655"></a>00655 
-<a name="l00656"></a>00656     <span class="keywordflow">return</span> 0;
-<a name="l00657"></a>00657 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__trace__flat_8c_source.html b/html/fors__trace__flat_8c_source.html
new file mode 100644
index 0000000..b95f395
--- /dev/null
+++ b/html/fors__trace__flat_8c_source.html
@@ -0,0 +1,668 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_trace_flat.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_trace_flat.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_trace_flat.c,v 1.8 2013-08-20 16:58:25 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-20 16:58:25 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_trace_flat_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to trace the edges of MOS/MXU flat field slit spectra\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"and determine the spectral curvature solution. The input master flat field\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"image, product of the recipe fors_flat, is expected to be oriented with\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"horizontal dispersion direction and red wavelengths on the right side.\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"The input slits location table should be the product of the recipe\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"fors_detect_spectra.\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"The input master flat image is shifted one pixel down and is subtracted\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"from the original image. The result is a vertical gradient map. Next,\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"the negative values are forced positive, to obtain an absolute gradient\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"map. The map is passed with a horizontal median filter, and after that\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"the gradient peaks are traced starting from the slits positions listed\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"in the input slits location table. The number of pixels to the left and\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"to the right of the reference pixel is trivially derived from the specified\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"spectral range and spectral dispersion.\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"The output spectral curvature table contains the coefficients of the\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"polynomial fitting of the found traces, while the output trace table\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"contains the traced spectral edges positions in CCD (Y) coordinates for\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"each spectrum, and their comparison with their modeling. A spatial map\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"is also created, where to each CCD pixel is assigned the value of the\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"spatial coordinate along the slit (in pixel). For more details please\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"refer to the FORS Pipeline User's Manual.\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"Note that specifying an input GRISM_TABLE will set some of the recipe\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"configuration parameters to default values valid for a particular grism.\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"Again, see the pipeline manual for more details.\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS.\n\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"  MASTER_SCREEN_FLAT_MXU     Calib       Master flat frame       Y\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"  SLIT_LOCATION_DETECT_MXU   Calib       Slits location          Y\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="stringliteral">"  CURV_TRACES_MXU            FITS table  Flat field tracings\n"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="stringliteral">"  CURV_COEFF_MXU             FITS table  Spectral curvature table\n"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"  SPATIAL_MAP_MXU            FITS image  Map of spatial coordinate\n\n"</span>;</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">#define fors_trace_flat_exit(message)         \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">cpl_image_delete(master_flat);                \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">cpl_image_delete(spatial);                    \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">cpl_table_delete(traces);                     \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">#define fors_trace_flat_exit_memcheck(message)  \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">printf("free master_flat (%p)\n", master_flat); \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">cpl_image_delete(master_flat);                  \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">printf("free spatial (%p)\n", spatial);         \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">cpl_image_delete(spatial);                      \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);   \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">cpl_image_delete(coordinate);                   \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">cpl_table_delete(grism_table);                  \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor">cpl_table_delete(maskslits);                    \</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">cpl_table_delete(slits);                        \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">printf("free traces (%p)\n", traces);           \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">cpl_table_delete(traces);                       \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">cpl_table_delete(polytraces);                   \</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> {</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                     <span class="stringliteral">"fors_trace_flat"</span>,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                     <span class="stringliteral">"Determine spectral curvature model"</span>,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                     fors_trace_flat_description,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>                     fors_trace_flat_create,</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>                     fors_trace_flat_exec,</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                     fors_trace_flat_destroy);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     </div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> }</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_trace_flat.dispersion"</span>,</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                                 <span class="stringliteral">"fors.fors_trace_flat"</span>,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                                 0.0);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> </div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_trace_flat.startwavelength"</span>,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                                 <span class="stringliteral">"fors.fors_trace_flat"</span>,</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                                 0.0);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> </div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_trace_flat.endwavelength"</span>,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                                 <span class="stringliteral">"fors.fors_trace_flat"</span>,</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>                                 0.0);</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> </div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="comment">     * Degree of spectral curvature polynomial</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_trace_flat.cdegree"</span>,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                                 <span class="stringliteral">"Degree of spectral curvature polynomial"</span>,</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>                                 <span class="stringliteral">"fors.fors_trace_flat"</span>,</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>                                 0);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cdegree"</span>);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> <span class="comment">     * Curvature solution interpolation (for MOS-like data)</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> </div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_trace_flat.cmode"</span>,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                                 <span class="stringliteral">"Interpolation mode of curvature solution "</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                                 <span class="stringliteral">"applicable to MOS-like data (0 = no "</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                                 <span class="stringliteral">"interpolation, 1 = fill gaps, 2 = global "</span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                                 <span class="stringliteral">"model)"</span>,</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                                 <span class="stringliteral">"fors.fors_trace_flat"</span>,</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>                                 1);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cmode"</span>);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> </div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> }</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> {</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> </div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     <span class="keywordflow">return</span> fors_trace_flat(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> }</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> </div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> {</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> }</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> </div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_trace_flat(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> {</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_trace_flat"</span>;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     <span class="keywordtype">int</span>         cdegree;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordtype">int</span>         cmode;</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> </div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     cpl_image        *master_flat = NULL;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     cpl_image        *coordinate  = NULL;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     cpl_image        *spatial     = NULL;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     cpl_table        *maskslits   = NULL;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     cpl_table        *traces      = NULL;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     cpl_table        *polytraces  = NULL;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_flat_tag;</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *spatial_map_tag;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_detect_tag;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_traces_tag;</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="keywordtype">int</span>         flat_mxu;</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keywordtype">int</span>         flat_mos;</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     <span class="keywordtype">int</span>         flat_lss;</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keywordtype">int</span>         mos;</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     <span class="keywordtype">int</span>         nflat;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordtype">int</span>         treat_as_lss;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     <span class="keywordtype">int</span>         nslits_out_det = 0;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> </div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> </div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> </div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>         fors_trace_flat_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); </div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>                     <span class="stringliteral">"fors.fors_trace_flat.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>         fors_trace_flat_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> </div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>                     <span class="stringliteral">"fors.fors_trace_flat.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>             fors_trace_flat_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> </div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>                     <span class="stringliteral">"fors.fors_trace_flat.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>             fors_trace_flat_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>             fors_trace_flat_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     }</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>             fors_trace_flat_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     cdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>                     <span class="stringliteral">"fors.fors_trace_flat.cdegree"</span>, grism_table);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> </div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     <span class="keywordflow">if</span> (cdegree < 1)</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         fors_trace_flat_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> </div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     <span class="keywordflow">if</span> (cdegree > 5)</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>         fors_trace_flat_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     cmode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_trace_flat.cmode"</span>, NULL);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> </div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     <span class="keywordflow">if</span> (cmode < 0 || cmode > 2)</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>         fors_trace_flat_exit(<span class="stringliteral">"Invalid curvature solution interpolation mode"</span>);</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span> </div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> </div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         fors_trace_flat_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     nflat  = flat_mxu = cpl_frameset_count_tags(frameset, </div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>                                                 <span class="stringliteral">"MASTER_SCREEN_FLAT_MXU"</span>);</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     nflat += flat_mos = cpl_frameset_count_tags(frameset, </div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>                                                 <span class="stringliteral">"MASTER_SCREEN_FLAT_MOS"</span>);</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     nflat += flat_lss = cpl_frameset_count_tags(frameset, </div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>                                                 <span class="stringliteral">"MASTER_SCREEN_FLAT_LSS"</span>);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordflow">if</span> (nflat == 0) {</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>         fors_trace_flat_exit(<span class="stringliteral">"Missing input master flat field frame"</span>);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     }</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     <span class="keywordflow">if</span> (nflat > 1) {</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input flat frames (%d > 1)"</span>, nflat);</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>         fors_trace_flat_exit(NULL);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     }</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span> </div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     mos = 0;</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span> </div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     <span class="keywordflow">if</span> (flat_mxu) {</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         master_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_MXU"</span>;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         slit_detect_tag   = <span class="stringliteral">"SLIT_LOCATION_DETECT_MXU"</span>;</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         curv_traces_tag   = <span class="stringliteral">"CURV_TRACES_MXU"</span>;</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         curv_coeff_tag    = <span class="stringliteral">"CURV_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         spatial_map_tag   = <span class="stringliteral">"SPATIAL_MAP_MXU"</span>;</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     }</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (flat_mos) {</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>         mos = 1;</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>         master_flat_tag   = <span class="stringliteral">"MASTER_SCREEN_FLAT_MOS"</span>;</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         slit_detect_tag   = <span class="stringliteral">"SLIT_LOCATION_DETECT_MOS"</span>;</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         slit_location_tag = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         curv_traces_tag   = <span class="stringliteral">"CURV_TRACES_MOS"</span>;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>         curv_coeff_tag    = <span class="stringliteral">"CURV_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>         spatial_map_tag   = <span class="stringliteral">"SPATIAL_MAP_MOS"</span>;</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     }</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (flat_lss) {</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         fors_trace_flat_exit(<span class="stringliteral">"LSS spectra are not traceable: use this recipe "</span></div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>                              <span class="stringliteral">"just for MOS/MXU data."</span>);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     }</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> </div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_detect_tag) == 0) {</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, slit_detect_tag);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>         fors_trace_flat_exit(NULL);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     }</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_detect_tag) > 1) {</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, slit_detect_tag);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         fors_trace_flat_exit(NULL);</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     }</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span> </div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         fors_trace_flat_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> </div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>         fors_trace_flat_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> </div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         fors_trace_flat_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> </div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> </div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> <span class="comment">     * dispersion direction from the master flat frame</span></div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, master_flat_tag, 0);</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span> </div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>         fors_trace_flat_exit(<span class="stringliteral">"Cannot load master flat frame header"</span>);</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> </div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>         fors_trace_flat_exit(<span class="stringliteral">"Missing keyword INSTRUME in master flat header"</span>);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> </div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>         fors_trace_flat_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span></div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>                                  <span class="stringliteral">"in master flat frame header"</span>);</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> </div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>         reference *= 10;</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in master flat header"</span>,</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>                       reference);</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>         fors_trace_flat_exit(NULL);</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     }</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> </div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span> </div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span> </div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         fors_trace_flat_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>                                  <span class="stringliteral">"in master flat header"</span>);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>                         dispersion);</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     }</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> <span class="comment">     * Check if all slits have the same X offset: in such case, abort!</span></div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> </div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>         maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>         maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> </div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span> </div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         cpl_msg_error(recipe, <span class="stringliteral">"All slits have the same offset: %.2f mm\n"</span></div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>                       <span class="stringliteral">"Spectra are not traceable: the LSS data reduction\n"</span></div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>                       <span class="stringliteral">"strategy must be applied."</span>, mxpos);</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>         fors_trace_flat_exit(NULL);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     }</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span> </div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> </div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input frames..."</span>);</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> </div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     master_flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, master_flat_tag, </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>                                  CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     <span class="keywordflow">if</span> (master_flat == NULL)</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>         fors_trace_flat_exit(<span class="stringliteral">"Cannot load master flat field frame"</span>);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span> </div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_detect_tag, 1);</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>         fors_trace_flat_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> </div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span> </div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     cpl_msg_info(recipe, <span class="stringliteral">"Determining spectral curvature..."</span>);</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span> </div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     cpl_msg_info(recipe, <span class="stringliteral">"Tracing master flat field spectra edges..."</span>);</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     traces = <a class="code" href="group__moses.html#gaad02c30291fd30d07156ac8f397f439f" title="Trace flat field spectra.">mos_trace_flat</a>(master_flat, slits, reference,</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>                             startwavelength, endwavelength, dispersion);</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span> </div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     <span class="keywordflow">if</span> (!traces)</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>         fors_trace_flat_exit(<span class="stringliteral">"Tracing failure"</span>);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> </div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     cpl_msg_info(recipe, <span class="stringliteral">"Fitting flat field spectra edges..."</span>);</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     polytraces = <a class="code" href="group__moses.html#ga7518d66581d93ab64704fcf90996296b" title="Fit spectral traces.">mos_poly_trace</a>(slits, traces, cdegree);</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     <span class="keywordflow">if</span> (!polytraces)</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>         fors_trace_flat_exit(<span class="stringliteral">"Trace fitting failure"</span>);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     <span class="keywordflow">if</span> (cmode) {</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>         cpl_msg_info(recipe, <span class="stringliteral">"Computing global spectral curvature model..."</span>);</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>         <a class="code" href="group__moses.html#ga0eda8a5abf396113ffbe66607fd72fe6" title="Recompute tracing coefficients globally.">mos_global_trace</a>(slits, polytraces, cmode);</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     }</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> </div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, traces, curv_traces_tag, NULL, parlist,</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>                        recipe, version))</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         fors_trace_flat_exit(NULL);</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span> </div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     cpl_table_delete(traces); traces = NULL;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     nx = cpl_image_get_size_x(master_flat);</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     ny = cpl_image_get_size_y(master_flat);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span> </div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     spatial = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(master_flat, slits, polytraces, </div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>                                       reference,</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>                                       startwavelength, endwavelength,</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>                                       dispersion, 0, coordinate);</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> </div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     cpl_image_delete(master_flat); master_flat = NULL;</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     cpl_image_delete(spatial); spatial = NULL;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> </div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, coordinate, spatial_map_tag, header,</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>         fors_trace_flat_exit(NULL);</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span> </div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     cpl_image_delete(coordinate); coordinate = NULL;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> </div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>         fors_trace_flat_exit(NULL);</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> </div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span> </div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, polytraces, curv_coeff_tag, NULL,</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>         fors_trace_flat_exit(NULL);</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span> </div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__utils_8c-source.html b/html/fors__utils_8c-source.html
deleted file mode 100644
index 264d57e..0000000
--- a/html/fors__utils_8c-source.html
+++ /dev/null
@@ -1,717 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_utils.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_utils.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_utils.c,v 1.31 2011/10/13 14:26:54 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/13 14:26:54 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.31 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <math.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00043"></a>00043 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00044"></a>00044 
-<a name="l00047"></a>00047 <span class="comment">/* Required CPL version */</span>
-<a name="l00048"></a><a class="code" href="group__fors__utils.html#g3636991e5e900e3f3545048017667c07">00048</a> <span class="preprocessor">#define REQ_CPL_MAJOR 4</span>
-<a name="l00049"></a><a class="code" href="group__fors__utils.html#g4c528bd8b3c44e5882145a0627393601">00049</a> <span class="preprocessor"></span><span class="preprocessor">#define REQ_CPL_MINOR 0</span>
-<a name="l00050"></a><a class="code" href="group__fors__utils.html#gbca08fe2cbba3584164a3b495bb8b488">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define REQ_CPL_MICRO 0</span>
-<a name="l00051"></a>00051 <span class="preprocessor"></span>
-<a name="l00052"></a><a class="code" href="group__fors__utils.html#gea88c3776498f5f3717413a50289af52">00052</a> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#gea88c3776498f5f3717413a50289af52">STDEV_PR_MAD</a> = 1/0.6744897;  <span class="comment">/* standard deviations per median</span>
-<a name="l00053"></a>00053 <span class="comment">                                             absolute deviation,</span>
-<a name="l00054"></a>00054 <span class="comment">                                             assuming a normal distribution */</span>
-<a name="l00055"></a>00055 
-<a name="l00056"></a>00056 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00064"></a>00064 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00065"></a><a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">00065</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a>(<span class="keywordtype">void</span>)
-<a name="l00066"></a>00066 {
-<a name="l00067"></a>00067     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_license = 
-<a name="l00068"></a>00068         <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00069"></a>00069         <span class="stringliteral">"Copyright (C) 2002-2011 European Southern Observatory\n"</span>
-<a name="l00070"></a>00070         <span class="stringliteral">"\n"</span>
-<a name="l00071"></a>00071         <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00072"></a>00072         <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00073"></a>00073         <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00074"></a>00074         <span class="stringliteral">"(at your option) any later version.\n"</span>
-<a name="l00075"></a>00075         <span class="stringliteral">"\n"</span>
-<a name="l00076"></a>00076         <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00077"></a>00077         <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00078"></a>00078         <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00079"></a>00079         <span class="stringliteral">"GNU General Public License for more details.\n"</span>
-<a name="l00080"></a>00080         <span class="stringliteral">"\n"</span>
-<a name="l00081"></a>00081         <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00082"></a>00082         <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00083"></a>00083         <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>;
-<a name="l00084"></a>00084     <span class="keywordflow">return</span> fors_license ;
-<a name="l00085"></a>00085 }
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00091"></a>00091 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00092"></a><a class="code" href="group__fors__utils.html#g5d402c4f4e0fe13790e410e507af10ef">00092</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#g5d402c4f4e0fe13790e410e507af10ef">fors_print_banner</a>(<span class="keywordtype">void</span>)
-<a name="l00093"></a>00093 {
-<a name="l00094"></a>00094     cpl_msg_info(__func__, <span class="stringliteral">"*****************************************"</span>);
-<a name="l00095"></a>00095     cpl_msg_info(__func__, <span class="stringliteral">"Welcome to FORS Pipeline release %s"</span>,
-<a name="l00096"></a>00096                  PACKAGE_VERSION);
-<a name="l00097"></a>00097     cpl_msg_info(__func__, <span class="stringliteral">"*****************************************"</span>);
-<a name="l00098"></a>00098 }
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00105"></a>00105 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00106"></a>00106 <span class="keywordtype">int</span>
-<a name="l00107"></a><a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">00107</a> <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>(<span class="keywordtype">void</span>)
-<a name="l00108"></a>00108 {
-<a name="l00109"></a>00109     <span class="comment">/*</span>
-<a name="l00110"></a>00110 <span class="comment">      This is a good opportunity to verify that the compile time</span>
-<a name="l00111"></a>00111 <span class="comment">      and runtime CPL versions are recent enough, and consistent </span>
-<a name="l00112"></a>00112 <span class="comment">    */</span>
-<a name="l00113"></a>00113 
-<a name="l00114"></a>00114 <span class="preprocessor">#ifdef CPL_VERSION_CODE</span>
-<a name="l00115"></a>00115 <span class="preprocessor"></span><span class="preprocessor">#if CPL_VERSION_CODE >= CPL_VERSION(REQ_CPL_MAJOR, REQ_CPL_MINOR, REQ_CPL_MICRO)</span>
-<a name="l00116"></a>00116 <span class="preprocessor"></span>    cpl_msg_debug(cpl_func, 
-<a name="l00117"></a>00117                   <span class="stringliteral">"Compile time CPL version code was %d. "</span>
-<a name="l00118"></a>00118                   <span class="stringliteral">"Required is version %d.%d.%d, code %d"</span>,
-<a name="l00119"></a>00119                   CPL_VERSION_CODE, <a class="code" href="group__fors__utils.html#g3636991e5e900e3f3545048017667c07">REQ_CPL_MAJOR</a>, <a class="code" href="group__fors__utils.html#g4c528bd8b3c44e5882145a0627393601">REQ_CPL_MINOR</a>, <a class="code" href="group__fors__utils.html#gbca08fe2cbba3584164a3b495bb8b488">REQ_CPL_MICRO</a>,
-<a name="l00120"></a>00120                   CPL_VERSION(<a class="code" href="group__fors__utils.html#g3636991e5e900e3f3545048017667c07">REQ_CPL_MAJOR</a>, <a class="code" href="group__fors__utils.html#g4c528bd8b3c44e5882145a0627393601">REQ_CPL_MINOR</a>, <a class="code" href="group__fors__utils.html#gbca08fe2cbba3584164a3b495bb8b488">REQ_CPL_MICRO</a>));
-<a name="l00121"></a>00121 <span class="preprocessor">#else</span>
-<a name="l00122"></a>00122 <span class="preprocessor"></span><span class="preprocessor">#error CPL version too old</span>
-<a name="l00123"></a>00123 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
-<a name="l00124"></a>00124 <span class="preprocessor"></span><span class="preprocessor">#else  </span><span class="comment">/* ifdef CPL_VERSION_CODE */</span>
-<a name="l00125"></a>00125 <span class="preprocessor">#error CPL_VERSION_CODE not defined. CPL version too old</span>
-<a name="l00126"></a>00126 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
-<a name="l00127"></a>00127 <span class="preprocessor"></span>
-<a name="l00128"></a>00128     <span class="keywordflow">if</span> (cpl_version_get_major() < <a class="code" href="group__fors__utils.html#g3636991e5e900e3f3545048017667c07">REQ_CPL_MAJOR</a> ||
-<a name="l00129"></a>00129         (cpl_version_get_major() == <a class="code" href="group__fors__utils.html#g3636991e5e900e3f3545048017667c07">REQ_CPL_MAJOR</a> && 
-<a name="l00130"></a>00130          (<span class="keywordtype">int</span>) cpl_version_get_minor() < <a class="code" href="group__fors__utils.html#g4c528bd8b3c44e5882145a0627393601">REQ_CPL_MINOR</a>) ||
-<a name="l00131"></a>00131         
-<a name="l00132"></a>00132         (cpl_version_get_major() == <a class="code" href="group__fors__utils.html#g3636991e5e900e3f3545048017667c07">REQ_CPL_MAJOR</a> &&
-<a name="l00133"></a>00133          cpl_version_get_minor() == <a class="code" href="group__fors__utils.html#g4c528bd8b3c44e5882145a0627393601">REQ_CPL_MINOR</a> && 
-<a name="l00134"></a>00134          (<span class="keywordtype">int</span>) cpl_version_get_micro() < <a class="code" href="group__fors__utils.html#gbca08fe2cbba3584164a3b495bb8b488">REQ_CPL_MICRO</a>)
-<a name="l00135"></a>00135         ) {
-<a name="l00136"></a>00136         <span class="comment">/* cast suppresses warning about comparing unsigned with 0 */</span>
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138         cpl_msg_warning(cpl_func, 
-<a name="l00139"></a>00139                         <span class="stringliteral">"Runtime CPL version %s (%d.%d.%d) "</span>
-<a name="l00140"></a>00140                         <span class="stringliteral">"is not supported. "</span>
-<a name="l00141"></a>00141                         <span class="stringliteral">"Please update to CPL version %d.%d.%d or later"</span>, 
-<a name="l00142"></a>00142                         cpl_version_get_version(),
-<a name="l00143"></a>00143                         cpl_version_get_major(),
-<a name="l00144"></a>00144                         cpl_version_get_minor(),
-<a name="l00145"></a>00145                         cpl_version_get_micro(),
-<a name="l00146"></a>00146                         <a class="code" href="group__fors__utils.html#g3636991e5e900e3f3545048017667c07">REQ_CPL_MAJOR</a>,
-<a name="l00147"></a>00147                         <a class="code" href="group__fors__utils.html#g4c528bd8b3c44e5882145a0627393601">REQ_CPL_MINOR</a>,
-<a name="l00148"></a>00148                         <a class="code" href="group__fors__utils.html#gbca08fe2cbba3584164a3b495bb8b488">REQ_CPL_MICRO</a>);
-<a name="l00149"></a>00149     }
-<a name="l00150"></a>00150     <span class="keywordflow">else</span> {
-<a name="l00151"></a>00151         cpl_msg_debug(cpl_func,
-<a name="l00152"></a>00152                       <span class="stringliteral">"Runtime CPL version %s (%d.%d.%d) detected, "</span>
-<a name="l00153"></a>00153                       <span class="stringliteral">"%d.%d.%d or later required"</span>,
-<a name="l00154"></a>00154                       cpl_version_get_version(),
-<a name="l00155"></a>00155                       cpl_version_get_major(),
-<a name="l00156"></a>00156                       cpl_version_get_minor(),
-<a name="l00157"></a>00157                       cpl_version_get_micro(),
-<a name="l00158"></a>00158                       <a class="code" href="group__fors__utils.html#g3636991e5e900e3f3545048017667c07">REQ_CPL_MAJOR</a>,
-<a name="l00159"></a>00159                       <a class="code" href="group__fors__utils.html#g4c528bd8b3c44e5882145a0627393601">REQ_CPL_MINOR</a>,
-<a name="l00160"></a>00160                       <a class="code" href="group__fors__utils.html#gbca08fe2cbba3584164a3b495bb8b488">REQ_CPL_MICRO</a>);
-<a name="l00161"></a>00161     }
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="comment">/* Fixme: Test that compile and runtime versions compare equal.</span>
-<a name="l00164"></a>00164 <span class="comment">       This requires CPL to provide the major/minor/micro version numbers</span>
-<a name="l00165"></a>00165 <span class="comment">       as preprocessor symbols, not just a code. */</span>
-<a name="l00166"></a>00166     
-<a name="l00167"></a>00167     <span class="comment">/* As defined in config.h */</span>
-<a name="l00168"></a>00168     <span class="keywordflow">return</span> FORS_BINARY_VERSION;
-<a name="l00169"></a>00169 }
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00180"></a>00180 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00181"></a><a class="code" href="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044">00181</a> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044">fors_rand_gauss</a>(<span class="keywordtype">void</span>)
-<a name="l00182"></a>00182 {
-<a name="l00183"></a>00183     <span class="keyword">static</span> <span class="keywordtype">double</span> V1, V2, S;
-<a name="l00184"></a>00184     <span class="keyword">static</span> <span class="keywordtype">int</span> phase = 0;
-<a name="l00185"></a>00185     <span class="keywordtype">double</span> X;
-<a name="l00186"></a>00186     
-<a name="l00187"></a>00187     <span class="keywordflow">if</span>(phase == 0) {
-<a name="l00188"></a>00188     <span class="keywordflow">do</span> {
-<a name="l00189"></a>00189         <span class="keywordtype">double</span> U1 = (double)rand() / RAND_MAX;
-<a name="l00190"></a>00190         <span class="keywordtype">double</span> U2 = (double)rand() / RAND_MAX;
-<a name="l00191"></a>00191         
-<a name="l00192"></a>00192         V1 = 2 * U1 - 1;
-<a name="l00193"></a>00193         V2 = 2 * U2 - 1;
-<a name="l00194"></a>00194         S = V1 * V1 + V2 * V2;
-<a name="l00195"></a>00195     } <span class="keywordflow">while</span>(S >= 1 || S == 0);
-<a name="l00196"></a>00196     
-<a name="l00197"></a>00197     X = V1 * sqrt(-2 * log(S) / S);
-<a name="l00198"></a>00198     } <span class="keywordflow">else</span>
-<a name="l00199"></a>00199     X = V2 * sqrt(-2 * log(S) / S);
-<a name="l00200"></a>00200     
-<a name="l00201"></a>00201     phase = 1 - phase;
-<a name="l00202"></a>00202     
-<a name="l00203"></a>00203     <span class="keywordflow">return</span> X;
-<a name="l00204"></a>00204 }
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00210"></a>00210 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00211"></a><a class="code" href="group__fors__utils.html#g4acaddb1c4b5fbc829b3a58434a08458">00211</a> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#g4acaddb1c4b5fbc829b3a58434a08458">fors_tools_get_kth_double</a>(
-<a name="l00212"></a>00212     <span class="keywordtype">double</span>  *   a,
-<a name="l00213"></a>00213     <span class="keywordtype">int</span>         n,
-<a name="l00214"></a>00214     <span class="keywordtype">int</span>         k)
-<a name="l00215"></a>00215 {
-<a name="l00216"></a>00216     <span class="keywordtype">double</span> x ;
-<a name="l00217"></a>00217     <span class="keywordtype">int</span>    i, j, l, m ;
-<a name="l00218"></a>00218 
-<a name="l00219"></a>00219     cpl_ensure(a, CPL_ERROR_NULL_INPUT, 0.00) ;
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     l=0 ; m=n-1 ;
-<a name="l00222"></a>00222     <span class="keywordflow">while</span> (l<m) {
-<a name="l00223"></a>00223         x=a[k] ;
-<a name="l00224"></a>00224         i=l ;
-<a name="l00225"></a>00225         j=m ;
-<a name="l00226"></a>00226         <span class="keywordflow">do</span> {
-<a name="l00227"></a>00227             <span class="keywordflow">while</span> (a[i]<x) i++ ;
-<a name="l00228"></a>00228             <span class="keywordflow">while</span> (x<a[j]) j-- ;
-<a name="l00229"></a>00229             <span class="keywordflow">if</span> (i<=j) {
-<a name="l00230"></a>00230                 <span class="comment">//CPL_DOUBLE_SWAP(a[i],a[j]) ;</span>
-<a name="l00231"></a>00231                 <span class="keywordtype">double</span> temp = a[i];
-<a name="l00232"></a>00232                 a[i] = a[j];
-<a name="l00233"></a>00233                 a[j] = temp;
-<a name="l00234"></a>00234                 i++ ; j-- ;
-<a name="l00235"></a>00235             }
-<a name="l00236"></a>00236         } <span class="keywordflow">while</span> (i<=j) ;
-<a name="l00237"></a>00237         <span class="keywordflow">if</span> (j<k) l=i ;
-<a name="l00238"></a>00238         <span class="keywordflow">if</span> (k<i) m=j ;
-<a name="l00239"></a>00239     }
-<a name="l00240"></a>00240     <span class="keywordflow">return</span> a[k] ;
-<a name="l00241"></a>00241 }
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243 <span class="preprocessor">#undef cleanup</span>
-<a name="l00244"></a>00244 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00245"></a>00245 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00249"></a>00249 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00250"></a><a class="code" href="group__fors__utils.html#g82a608ac0a7259f2c39a89db274546d3">00250</a> <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#g82a608ac0a7259f2c39a89db274546d3">fors_tools_get_median_float</a>(<span class="keywordtype">float</span> *a, <span class="keywordtype">int</span> n)
-<a name="l00251"></a>00251 {
-<a name="l00252"></a>00252     <span class="keywordflow">return</span> (n % 2 == 0) ?
-<a name="l00253"></a>00253         (<a class="code" href="group__fors__utils.html#g032ad4d4b74b174df587f578f6a70bf2">fors_tools_get_kth_float</a>(a, n, (n-1)/2) +
-<a name="l00254"></a>00254          <a class="code" href="group__fors__utils.html#g032ad4d4b74b174df587f578f6a70bf2">fors_tools_get_kth_float</a>(a, n, (n/2))) / 2.0
-<a name="l00255"></a>00255         : <a class="code" href="group__fors__utils.html#g032ad4d4b74b174df587f578f6a70bf2">fors_tools_get_kth_float</a>(a, n, n/2);
-<a name="l00256"></a>00256 }
-<a name="l00257"></a>00257 
-<a name="l00258"></a>00258 <span class="preprocessor">#undef cleanup</span>
-<a name="l00259"></a>00259 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00260"></a>00260 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00264"></a>00264 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00265"></a><a class="code" href="group__fors__utils.html#g8fcbc5ff472f72a690b4ef8716f66918">00265</a> <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#g8fcbc5ff472f72a690b4ef8716f66918">fors_tools_get_median_fast_float</a>(<span class="keywordtype">float</span> *a, <span class="keywordtype">int</span> n)
-<a name="l00266"></a>00266 {
-<a name="l00267"></a>00267     <span class="keywordflow">return</span> <a class="code" href="group__fors__utils.html#g032ad4d4b74b174df587f578f6a70bf2">fors_tools_get_kth_float</a>(a, n, n/2);
-<a name="l00268"></a>00268 }
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270 <span class="preprocessor">#undef cleanup</span>
-<a name="l00271"></a>00271 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00272"></a>00272 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00276"></a>00276 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00277"></a><a class="code" href="group__fors__utils.html#g032ad4d4b74b174df587f578f6a70bf2">00277</a> <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#g032ad4d4b74b174df587f578f6a70bf2">fors_tools_get_kth_float</a>(
-<a name="l00278"></a>00278     <span class="keywordtype">float</span>  *   a,
-<a name="l00279"></a>00279     <span class="keywordtype">int</span>         n,
-<a name="l00280"></a>00280     <span class="keywordtype">int</span>         k)
-<a name="l00281"></a>00281 {
-<a name="l00282"></a>00282     <span class="keywordtype">float</span> x ;
-<a name="l00283"></a>00283     <span class="keywordtype">int</span>    i, j, l, m ;
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285     cpl_ensure(a, CPL_ERROR_NULL_INPUT, 0.00) ;
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287     l=0 ; m=n-1 ;
-<a name="l00288"></a>00288     <span class="keywordflow">while</span> (l<m) {
-<a name="l00289"></a>00289         x=a[k] ;
-<a name="l00290"></a>00290         i=l ;
-<a name="l00291"></a>00291         j=m ;
-<a name="l00292"></a>00292         <span class="keywordflow">do</span> {
-<a name="l00293"></a>00293             <span class="keywordflow">while</span> (a[i]<x) i++ ;
-<a name="l00294"></a>00294             <span class="keywordflow">while</span> (x<a[j]) j-- ;
-<a name="l00295"></a>00295             <span class="keywordflow">if</span> (i<=j) {
-<a name="l00296"></a>00296                 <span class="comment">//CPL_FLOAT_SWAP(a[i],a[j]) ;</span>
-<a name="l00297"></a>00297                 <span class="keywordtype">float</span> temp = a[i];
-<a name="l00298"></a>00298                 a[i] = a[j];
-<a name="l00299"></a>00299                 a[j] = temp;
-<a name="l00300"></a>00300                 i++ ; j-- ;
-<a name="l00301"></a>00301             }
-<a name="l00302"></a>00302         } <span class="keywordflow">while</span> (i<=j) ;
-<a name="l00303"></a>00303         <span class="keywordflow">if</span> (j<k) l=i ;
-<a name="l00304"></a>00304         <span class="keywordflow">if</span> (k<i) m=j ;
-<a name="l00305"></a>00305     }
-<a name="l00306"></a>00306     <span class="keywordflow">return</span> a[k] ;
-<a name="l00307"></a>00307 }
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309 <span class="preprocessor">#undef cleanup</span>
-<a name="l00310"></a>00310 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00311"></a>00311 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00317"></a>00317 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00318"></a>00318 <span class="keyword">const</span> <span class="keywordtype">char</span> *
-<a name="l00319"></a><a class="code" href="group__fors__utils.html#gf509a28ce04d6804eabe62b2a5817afe">00319</a> <a class="code" href="group__fors__utils.html#gf509a28ce04d6804eabe62b2a5817afe">fors_frame_get_type_string</a>(<span class="keyword">const</span> cpl_frame *f)
-<a name="l00320"></a>00320 {
-<a name="l00321"></a>00321     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( f != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Null frame"</span> );
-<a name="l00322"></a>00322 
-<a name="l00323"></a>00323     <span class="keywordflow">switch</span> (cpl_frame_get_type(f)) {
-<a name="l00324"></a>00324     <span class="keywordflow">case</span> CPL_FRAME_TYPE_NONE:   <span class="keywordflow">return</span> <span class="stringliteral">"NONE"</span>;      <span class="keywordflow">break</span>;
-<a name="l00325"></a>00325     <span class="keywordflow">case</span> CPL_FRAME_TYPE_IMAGE:  <span class="keywordflow">return</span> <span class="stringliteral">"IMAGE"</span>;     <span class="keywordflow">break</span>;
-<a name="l00326"></a>00326     <span class="keywordflow">case</span> CPL_FRAME_TYPE_MATRIX: <span class="keywordflow">return</span> <span class="stringliteral">"MATRIX"</span>;    <span class="keywordflow">break</span>;
-<a name="l00327"></a>00327     <span class="keywordflow">case</span> CPL_FRAME_TYPE_TABLE:  <span class="keywordflow">return</span> <span class="stringliteral">"TABLE"</span>;     <span class="keywordflow">break</span>;
-<a name="l00328"></a>00328     <span class="keywordflow">default</span>: 
-<a name="l00329"></a>00329         <span class="keywordflow">return</span> <span class="stringliteral">"unrecognized frame type"</span>;      
-<a name="l00330"></a>00330         <span class="keywordflow">break</span>;
-<a name="l00331"></a>00331     }
-<a name="l00332"></a>00332 }
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334 <span class="preprocessor">#undef cleanup</span>
-<a name="l00335"></a>00335 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00336"></a>00336 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00342"></a>00342 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00343"></a>00343 <span class="keyword">const</span> <span class="keywordtype">char</span> *
-<a name="l00344"></a><a class="code" href="group__fors__utils.html#gc219cfea8dd4f3c5a0aceb222d19150a">00344</a> <a class="code" href="group__fors__utils.html#gc219cfea8dd4f3c5a0aceb222d19150a">fors_frame_get_group_string</a>(<span class="keyword">const</span> cpl_frame *f)
-<a name="l00345"></a>00345 {
-<a name="l00346"></a>00346     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( f != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Null frame"</span> );
-<a name="l00347"></a>00347     
-<a name="l00348"></a>00348     <span class="keywordflow">switch</span> (cpl_frame_get_group(f)) {
-<a name="l00349"></a>00349     <span class="keywordflow">case</span> CPL_FRAME_GROUP_NONE:    <span class="keywordflow">return</span> <span class="stringliteral">"NONE"</span>;                     <span class="keywordflow">break</span>;
-<a name="l00350"></a>00350     <span class="keywordflow">case</span> CPL_FRAME_GROUP_RAW:     <span class="keywordflow">return</span> CPL_FRAME_GROUP_RAW_ID;     <span class="keywordflow">break</span>;
-<a name="l00351"></a>00351     <span class="keywordflow">case</span> CPL_FRAME_GROUP_CALIB:   <span class="keywordflow">return</span> CPL_FRAME_GROUP_CALIB_ID;   <span class="keywordflow">break</span>;
-<a name="l00352"></a>00352     <span class="keywordflow">case</span> CPL_FRAME_GROUP_PRODUCT: <span class="keywordflow">return</span> CPL_FRAME_GROUP_PRODUCT_ID; <span class="keywordflow">break</span>;
-<a name="l00353"></a>00353     <span class="keywordflow">default</span>:
-<a name="l00354"></a>00354         <span class="keywordflow">return</span> <span class="stringliteral">"unrecognized frame group"</span>;
-<a name="l00355"></a>00355         <span class="keywordflow">break</span>;
-<a name="l00356"></a>00356     }
-<a name="l00357"></a>00357 }
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359 <span class="preprocessor">#undef cleanup</span>
-<a name="l00360"></a>00360 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00361"></a>00361 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00367"></a>00367 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00368"></a>00368 <span class="keyword">const</span> <span class="keywordtype">char</span> *
-<a name="l00369"></a><a class="code" href="group__fors__utils.html#gc02f8fba22227907e45bdcbe6de8655e">00369</a> <a class="code" href="group__fors__utils.html#gc02f8fba22227907e45bdcbe6de8655e">fors_frame_get_level_string</a>(<span class="keyword">const</span> cpl_frame *f)
-<a name="l00370"></a>00370 {
-<a name="l00371"></a>00371     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( f != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Null frame"</span> );
-<a name="l00372"></a>00372     
-<a name="l00373"></a>00373     <span class="keywordflow">switch</span> (cpl_frame_get_level(f)) {
-<a name="l00374"></a>00374     <span class="keywordflow">case</span> CPL_FRAME_LEVEL_NONE:        <span class="keywordflow">return</span> <span class="stringliteral">"NONE"</span>;         <span class="keywordflow">break</span>;
-<a name="l00375"></a>00375     <span class="keywordflow">case</span> CPL_FRAME_LEVEL_TEMPORARY:   <span class="keywordflow">return</span> <span class="stringliteral">"TEMPORARY"</span>;    <span class="keywordflow">break</span>;
-<a name="l00376"></a>00376     <span class="keywordflow">case</span> CPL_FRAME_LEVEL_INTERMEDIATE:<span class="keywordflow">return</span> <span class="stringliteral">"INTERMEDIATE"</span>; <span class="keywordflow">break</span>;
-<a name="l00377"></a>00377     <span class="keywordflow">case</span> CPL_FRAME_LEVEL_FINAL:       <span class="keywordflow">return</span> <span class="stringliteral">"FINAL"</span>;        <span class="keywordflow">break</span>;
-<a name="l00378"></a>00378     <span class="keywordflow">default</span>: 
-<a name="l00379"></a>00379         <span class="keywordflow">return</span> <span class="stringliteral">"unrecognized frame level"</span>;
-<a name="l00380"></a>00380         <span class="keywordflow">break</span>;
-<a name="l00381"></a>00381     }
-<a name="l00382"></a>00382 }
-<a name="l00383"></a>00383 
-<a name="l00384"></a>00384 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00391"></a>00391 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00392"></a>00392 <span class="keywordtype">void</span>
-<a name="l00393"></a><a class="code" href="group__fors__utils.html#gc1181b0023db290ca5bfc42e9980e3a8">00393</a> <a class="code" href="group__fors__utils.html#gc1181b0023db290ca5bfc42e9980e3a8">fors_frameset_print</a>(<span class="keyword">const</span> cpl_frameset *frames)
-<a name="l00394"></a>00394 {
-<a name="l00395"></a>00395     <span class="comment">/* Two special cases: a NULL frame set and an empty frame set */</span>
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397     <span class="keywordflow">if</span> (frames == NULL) {
-<a name="l00398"></a>00398         cpl_msg_info(cpl_func, <span class="stringliteral">"NULL"</span>);
-<a name="l00399"></a>00399     }
-<a name="l00400"></a>00400     <span class="keywordflow">else</span> {
-<a name="l00401"></a>00401         <span class="keyword">const</span> cpl_frame *f = NULL;
-<a name="l00402"></a>00402         f = cpl_frameset_get_first_const(frames);
-<a name="l00403"></a>00403         
-<a name="l00404"></a>00404         <span class="keywordflow">if</span> (f == NULL) {
-<a name="l00405"></a>00405             cpl_msg_info(cpl_func, <span class="stringliteral">"[Empty frame set]"</span>);
-<a name="l00406"></a>00406         }
-<a name="l00407"></a>00407         <span class="keywordflow">else</span> {
-<a name="l00408"></a>00408             <span class="keywordflow">while</span>(f != NULL) {
-<a name="l00409"></a>00409                 <a class="code" href="group__fors__utils.html#g375049f68639265267adcdc11d161bc3">fors_frame_print</a>(f);
-<a name="l00410"></a>00410                 f = cpl_frameset_get_next_const(frames);
-<a name="l00411"></a>00411             }
-<a name="l00412"></a>00412         }
-<a name="l00413"></a>00413     }
-<a name="l00414"></a>00414     
-<a name="l00415"></a>00415     <span class="keywordflow">return</span>;
-<a name="l00416"></a>00416 }
-<a name="l00417"></a>00417 
-<a name="l00418"></a>00418 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00425"></a>00425 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00426"></a>00426 <span class="keywordtype">void</span>
-<a name="l00427"></a><a class="code" href="group__fors__utils.html#g375049f68639265267adcdc11d161bc3">00427</a> <a class="code" href="group__fors__utils.html#g375049f68639265267adcdc11d161bc3">fors_frame_print</a>(<span class="keyword">const</span> cpl_frame *f)
-<a name="l00428"></a>00428 {
-<a name="l00429"></a>00429     <span class="keywordflow">if</span> (f == NULL) {
-<a name="l00430"></a>00430         cpl_msg_info(cpl_func, <span class="stringliteral">"NULL"</span>);
-<a name="l00431"></a>00431     }
-<a name="l00432"></a>00432     <span class="keywordflow">else</span> {
-<a name="l00433"></a>00433         <span class="keyword">const</span> <span class="keywordtype">char</span> *filename = cpl_frame_get_filename(f);
-<a name="l00434"></a>00434         <span class="keyword">const</span> <span class="keywordtype">char</span> *tag = cpl_frame_get_tag(f);
-<a name="l00435"></a>00435         
-<a name="l00436"></a>00436         <span class="keywordflow">if</span> (filename == NULL) {
-<a name="l00437"></a>00437             filename = <span class="stringliteral">"NULL"</span>;
-<a name="l00438"></a>00438         }
-<a name="l00439"></a>00439         <span class="keywordflow">if</span> (tag == NULL) {
-<a name="l00440"></a>00440             tag = <span class="stringliteral">"NULL"</span>;
-<a name="l00441"></a>00441         }
-<a name="l00442"></a>00442         
-<a name="l00443"></a>00443         cpl_msg_info(cpl_func, <span class="stringliteral">"%-7s %-20s %s"</span>, 
-<a name="l00444"></a>00444                      <a class="code" href="group__fors__utils.html#gc219cfea8dd4f3c5a0aceb222d19150a">fors_frame_get_group_string</a>(f),
-<a name="l00445"></a>00445                      tag,
-<a name="l00446"></a>00446                      filename);
-<a name="l00447"></a>00447         
-<a name="l00448"></a>00448         cpl_msg_debug(cpl_func, <span class="stringliteral">"type \t= %s"</span>,  <a class="code" href="group__fors__utils.html#gf509a28ce04d6804eabe62b2a5817afe">fors_frame_get_type_string</a>(f));
-<a name="l00449"></a>00449         cpl_msg_debug(cpl_func, <span class="stringliteral">"group \t= %s"</span>, <a class="code" href="group__fors__utils.html#gc219cfea8dd4f3c5a0aceb222d19150a">fors_frame_get_group_string</a>(f));
-<a name="l00450"></a>00450         cpl_msg_debug(cpl_func, <span class="stringliteral">"level \t= %s"</span>, <a class="code" href="group__fors__utils.html#gc02f8fba22227907e45bdcbe6de8655e">fors_frame_get_level_string</a>(f));
-<a name="l00451"></a>00451     }
-<a name="l00452"></a>00452     
-<a name="l00453"></a>00453     <span class="keywordflow">return</span>;
-<a name="l00454"></a>00454 }
-<a name="l00455"></a>00455 
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457 <span class="preprocessor">#undef cleanup</span>
-<a name="l00458"></a>00458 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00459"></a>00459 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00466"></a>00466 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00467"></a>00467 cpl_frameset *
-<a name="l00468"></a><a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">00468</a> <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(<span class="keyword">const</span> cpl_frameset *frames,
-<a name="l00469"></a>00469                       <span class="keyword">const</span> <span class="keywordtype">char</span> *tag)
-<a name="l00470"></a>00470 {
-<a name="l00471"></a>00471     cpl_frameset *subset = NULL;
-<a name="l00472"></a>00472     <span class="keyword">const</span> cpl_frame *f;
-<a name="l00473"></a>00473 
-<a name="l00474"></a>00474     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( frames != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Null frameset"</span> );
-<a name="l00475"></a>00475     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( tag    != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Null tag"</span> );
-<a name="l00476"></a>00476     
-<a name="l00477"></a>00477     subset = cpl_frameset_new();
-<a name="l00478"></a>00478 
-<a name="l00479"></a>00479     <span class="keywordflow">for</span> (f = cpl_frameset_find_const(frames, tag);
-<a name="l00480"></a>00480          f != NULL;
-<a name="l00481"></a>00481          f = cpl_frameset_find_const(frames, NULL)) {
-<a name="l00482"></a>00482 
-<a name="l00483"></a>00483         cpl_frameset_insert(subset, cpl_frame_duplicate(f));
-<a name="l00484"></a>00484     }
-<a name="l00485"></a>00485 
-<a name="l00486"></a>00486     <span class="keywordflow">return</span> subset;
-<a name="l00487"></a>00487 }
-<a name="l00488"></a>00488 
-<a name="l00489"></a>00489 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00495"></a>00495 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00496"></a><a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">00496</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(cpl_type t)
-<a name="l00497"></a>00497 {
-<a name="l00498"></a>00498     <span class="comment">/* Note that CPL_TYPE_STRING is shorthand</span>
-<a name="l00499"></a>00499 <span class="comment">       for CPL_TYPE_CHAR | CPL_TYPE_FLAG_ARRAY . */</span>
-<a name="l00500"></a>00500     
-<a name="l00501"></a>00501     <span class="keywordflow">if</span> (!(t & CPL_TYPE_FLAG_ARRAY))
-<a name="l00502"></a>00502         <span class="keywordflow">switch</span>(t & (~CPL_TYPE_FLAG_ARRAY)) {
-<a name="l00503"></a>00503         <span class="keywordflow">case</span> CPL_TYPE_CHAR:       <span class="keywordflow">return</span> <span class="stringliteral">"char"</span>;    <span class="keywordflow">break</span>;
-<a name="l00504"></a>00504         <span class="keywordflow">case</span> CPL_TYPE_UCHAR:      <span class="keywordflow">return</span> <span class="stringliteral">"uchar"</span>;   <span class="keywordflow">break</span>;
-<a name="l00505"></a>00505         <span class="keywordflow">case</span> CPL_TYPE_BOOL:       <span class="keywordflow">return</span> <span class="stringliteral">"boolean"</span>; <span class="keywordflow">break</span>;
-<a name="l00506"></a>00506         <span class="keywordflow">case</span> CPL_TYPE_INT:        <span class="keywordflow">return</span> <span class="stringliteral">"int"</span>;     <span class="keywordflow">break</span>;
-<a name="l00507"></a>00507         <span class="keywordflow">case</span> CPL_TYPE_UINT:       <span class="keywordflow">return</span> <span class="stringliteral">"uint"</span>;    <span class="keywordflow">break</span>;
-<a name="l00508"></a>00508         <span class="keywordflow">case</span> CPL_TYPE_LONG:       <span class="keywordflow">return</span> <span class="stringliteral">"long"</span>;    <span class="keywordflow">break</span>;
-<a name="l00509"></a>00509         <span class="keywordflow">case</span> CPL_TYPE_ULONG:      <span class="keywordflow">return</span> <span class="stringliteral">"ulong"</span>;   <span class="keywordflow">break</span>;
-<a name="l00510"></a>00510         <span class="keywordflow">case</span> CPL_TYPE_FLOAT:      <span class="keywordflow">return</span> <span class="stringliteral">"float"</span>;   <span class="keywordflow">break</span>;
-<a name="l00511"></a>00511         <span class="keywordflow">case</span> CPL_TYPE_DOUBLE:     <span class="keywordflow">return</span> <span class="stringliteral">"double"</span>;  <span class="keywordflow">break</span>;
-<a name="l00512"></a>00512         <span class="keywordflow">case</span> CPL_TYPE_POINTER:    <span class="keywordflow">return</span> <span class="stringliteral">"pointer"</span>; <span class="keywordflow">break</span>;
-<a name="l00513"></a>00513         <span class="keywordflow">case</span> CPL_TYPE_INVALID:    <span class="keywordflow">return</span> <span class="stringliteral">"invalid"</span>; <span class="keywordflow">break</span>;
-<a name="l00514"></a>00514         <span class="keywordflow">default</span>:
-<a name="l00515"></a>00515             <span class="keywordflow">return</span> <span class="stringliteral">"unrecognized type"</span>;
-<a name="l00516"></a>00516         }
-<a name="l00517"></a>00517     <span class="keywordflow">else</span>
-<a name="l00518"></a>00518         <span class="keywordflow">switch</span>(t & (~CPL_TYPE_FLAG_ARRAY)) {
-<a name="l00519"></a>00519         <span class="keywordflow">case</span> CPL_TYPE_CHAR:       <span class="keywordflow">return</span> <span class="stringliteral">"string (char array)"</span>; <span class="keywordflow">break</span>;
-<a name="l00520"></a>00520         <span class="keywordflow">case</span> CPL_TYPE_UCHAR:      <span class="keywordflow">return</span> <span class="stringliteral">"uchar array"</span>;         <span class="keywordflow">break</span>;
-<a name="l00521"></a>00521         <span class="keywordflow">case</span> CPL_TYPE_BOOL:       <span class="keywordflow">return</span> <span class="stringliteral">"boolean array"</span>;       <span class="keywordflow">break</span>;
-<a name="l00522"></a>00522         <span class="keywordflow">case</span> CPL_TYPE_INT:        <span class="keywordflow">return</span> <span class="stringliteral">"int array"</span>;           <span class="keywordflow">break</span>;
-<a name="l00523"></a>00523         <span class="keywordflow">case</span> CPL_TYPE_UINT:       <span class="keywordflow">return</span> <span class="stringliteral">"uint array"</span>;          <span class="keywordflow">break</span>;
-<a name="l00524"></a>00524         <span class="keywordflow">case</span> CPL_TYPE_LONG:       <span class="keywordflow">return</span> <span class="stringliteral">"long array"</span>;          <span class="keywordflow">break</span>;
-<a name="l00525"></a>00525         <span class="keywordflow">case</span> CPL_TYPE_ULONG:      <span class="keywordflow">return</span> <span class="stringliteral">"ulong array"</span>;         <span class="keywordflow">break</span>;
-<a name="l00526"></a>00526         <span class="keywordflow">case</span> CPL_TYPE_FLOAT:      <span class="keywordflow">return</span> <span class="stringliteral">"float array"</span>;         <span class="keywordflow">break</span>;
-<a name="l00527"></a>00527         <span class="keywordflow">case</span> CPL_TYPE_DOUBLE:     <span class="keywordflow">return</span> <span class="stringliteral">"double array"</span>;        <span class="keywordflow">break</span>;
-<a name="l00528"></a>00528         <span class="keywordflow">case</span> CPL_TYPE_POINTER:    <span class="keywordflow">return</span> <span class="stringliteral">"pointer array"</span>;       <span class="keywordflow">break</span>;
-<a name="l00529"></a>00529         <span class="keywordflow">case</span> CPL_TYPE_INVALID:    <span class="keywordflow">return</span> <span class="stringliteral">"invalid (array)"</span>;     <span class="keywordflow">break</span>;
-<a name="l00530"></a>00530         <span class="keywordflow">default</span>:
-<a name="l00531"></a>00531             <span class="keywordflow">return</span> <span class="stringliteral">"unrecognized type"</span>;
-<a name="l00532"></a>00532         }
-<a name="l00533"></a>00533 }
-<a name="l00534"></a>00534 
-<a name="l00535"></a>00535 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00543"></a>00543 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00544"></a>00544 <span class="keywordtype">void</span>
-<a name="l00545"></a><a class="code" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">00545</a> <a class="code" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">fors_parameterlist_set_defaults</a>(cpl_parameterlist *parlist)
-<a name="l00546"></a>00546 {
-<a name="l00547"></a>00547     cpl_parameter *p = NULL;
-<a name="l00548"></a>00548     <span class="keywordtype">bool</span> parameter_is_set;
-<a name="l00549"></a>00549 
-<a name="l00550"></a>00550     p = cpl_parameterlist_get_first(parlist);
-<a name="l00551"></a>00551     <span class="keywordflow">while</span> (p != NULL) {
-<a name="l00552"></a>00552 
-<a name="l00553"></a>00553         <span class="comment">/*   EsoRex bug: (well, it's an undocumented-feature </span>
-<a name="l00554"></a>00554 <span class="comment">             that EsoRex, unlike Gasgano, reads the default flag):</span>
-<a name="l00555"></a>00555 <span class="comment">        */</span>
-<a name="l00556"></a>00556         parameter_is_set = cpl_parameter_get_default_flag(p);
-<a name="l00557"></a>00557         
-<a name="l00558"></a>00558         <span class="keywordflow">if</span> (!parameter_is_set) {
-<a name="l00559"></a>00559             cpl_type ptype = cpl_parameter_get_type(p);
-<a name="l00560"></a>00560             <span class="keywordflow">switch</span> (ptype) {
-<a name="l00561"></a>00561             <span class="keywordflow">case</span> CPL_TYPE_BOOL:
-<a name="l00562"></a>00562                 cpl_parameter_set_bool(p, cpl_parameter_get_default_bool(p));
-<a name="l00563"></a>00563                 <span class="keywordflow">break</span>;
-<a name="l00564"></a>00564             <span class="keywordflow">case</span> CPL_TYPE_INT:
-<a name="l00565"></a>00565                 cpl_parameter_set_int(p, cpl_parameter_get_default_int(p));
-<a name="l00566"></a>00566                 <span class="keywordflow">break</span>;
-<a name="l00567"></a>00567             <span class="keywordflow">case</span> CPL_TYPE_DOUBLE:
-<a name="l00568"></a>00568                 cpl_parameter_set_double(p, cpl_parameter_get_default_double(p));
-<a name="l00569"></a>00569                 <span class="keywordflow">break</span>;
-<a name="l00570"></a>00570             <span class="keywordflow">case</span> CPL_TYPE_STRING:
-<a name="l00571"></a>00571                 cpl_parameter_set_string(p, cpl_parameter_get_default_string(p));
-<a name="l00572"></a>00572                 <span class="keywordflow">break</span>;
-<a name="l00573"></a>00573             <span class="keywordflow">default</span>:
-<a name="l00574"></a>00574                 <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span>, <span class="stringliteral">"Unknown type of parameter '%s'"</span>, 
-<a name="l00575"></a>00575                         cpl_parameter_get_name(p));
-<a name="l00576"></a>00576             }
-<a name="l00577"></a>00577         }
-<a name="l00578"></a>00578         p = cpl_parameterlist_get_next(parlist);
-<a name="l00579"></a>00579     }
-<a name="l00580"></a>00580     
-<a name="l00581"></a>00581     <span class="keywordflow">return</span>;
-<a name="l00582"></a>00582 }
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584 <span class="preprocessor">#ifdef CPL_IS_NOT_CRAP</span>
-<a name="l00585"></a>00585 <span class="preprocessor"></span><span class="preprocessor">#else</span>
-<a name="l00586"></a>00586 <span class="preprocessor"></span>
-<a name="l00597"></a><a class="code" href="group__fors__utils.html#g833fbeca7835f9c594deb0a8752d8b74">00597</a> cpl_image *<a class="code" href="group__fors__utils.html#g833fbeca7835f9c594deb0a8752d8b74">fors_imagelist_collapse_create</a>(<span class="keyword">const</span> cpl_imagelist *ilist)
-<a name="l00598"></a>00598 {
-<a name="l00599"></a>00599     cpl_image *result = cpl_imagelist_collapse_create(ilist);
-<a name="l00600"></a>00600     
-<a name="l00601"></a>00601     <span class="keywordflow">if</span> (result != NULL && cpl_image_count_rejected(result) == 0) {
-<a name="l00602"></a>00602         cpl_image_accept_all(result);
-<a name="l00603"></a>00603     }
-<a name="l00604"></a>00604     
-<a name="l00605"></a>00605     <span class="keywordflow">return</span> result;
-<a name="l00606"></a>00606 }
-<a name="l00607"></a>00607 
-<a name="l00608"></a>00608 
-<a name="l00616"></a><a class="code" href="group__fors__utils.html#g2d1787d975000e60e8790fc656d538f6">00616</a> cpl_image *<a class="code" href="group__fors__utils.html#g2d1787d975000e60e8790fc656d538f6">fors_imagelist_collapse_median_create</a>(<span class="keyword">const</span> cpl_imagelist *ilist)
-<a name="l00617"></a>00617 {
-<a name="l00618"></a>00618     cpl_image *result = cpl_imagelist_collapse_median_create(ilist);
-<a name="l00619"></a>00619     
-<a name="l00620"></a>00620     <span class="keywordflow">if</span> (result != NULL && cpl_image_count_rejected(result) == 0) {
-<a name="l00621"></a>00621         cpl_image_accept_all(result);
-<a name="l00622"></a>00622     }
-<a name="l00623"></a>00623     
-<a name="l00624"></a>00624     <span class="keywordflow">return</span> result;
-<a name="l00625"></a>00625 }
-<a name="l00626"></a>00626 <span class="preprocessor">#endif</span>
-<a name="l00627"></a>00627 <span class="preprocessor"></span>
-<a name="l00628"></a>00628 <span class="preprocessor">#undef cleanup</span>
-<a name="l00629"></a>00629 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00630"></a>00630 <span class="preprocessor"></span>
-<a name="l00636"></a><a class="code" href="group__fors__utils.html#g71645af45bc192964d3170f28c671240">00636</a> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#g71645af45bc192964d3170f28c671240">fors_angle_diff</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> *a1, <span class="keyword">const</span> <span class="keywordtype">double</span> *a2)
-<a name="l00637"></a>00637 {
-<a name="l00638"></a>00638     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( a1 != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00639"></a>00639     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( a2 != NULL, <span class="keywordflow">return</span> -1, NULL );
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641     <span class="keywordtype">double</span> d = *a1 - *a2;
-<a name="l00642"></a>00642 
-<a name="l00643"></a>00643     <span class="keywordflow">while</span> (d < -M_PI) d += 2*M_PI;
-<a name="l00644"></a>00644     <span class="keywordflow">while</span> (d >  M_PI) d -= 2*M_PI;
-<a name="l00645"></a>00645     
-<a name="l00646"></a>00646     <span class="keywordflow">return</span> fabs(d);
-<a name="l00647"></a>00647 }
-<a name="l00648"></a>00648 
-<a name="l00649"></a><a class="code" href="group__fors__utils.html#g1ddbaf639cddef891b3619471eea9008">00649</a> <span class="preprocessor">#define MAX_MESSAGE_LENGTH 1024</span>
-<a name="l00650"></a>00650 <span class="preprocessor"></span><span class="preprocessor">#undef cleanup</span>
-<a name="l00651"></a>00651 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00652"></a>00652 <span class="preprocessor"></span>
-<a name="l00660"></a><a class="code" href="group__fors__utils.html#ge561fe29b3673b34094804e26ece5e8e">00660</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#ge561fe29b3673b34094804e26ece5e8e">fors_msg_macro</a>(cpl_msg_severity level, <span class="keyword">const</span> <span class="keywordtype">char</span> *fct, <span class="keyword">const</span> <span class="keywordtype">char</span> *format, ...)
-<a name="l00661"></a>00661 {
-<a name="l00662"></a>00662     <span class="keywordtype">char</span> message[<a class="code" href="group__fors__utils.html#g1ddbaf639cddef891b3619471eea9008">MAX_MESSAGE_LENGTH</a>];
-<a name="l00663"></a>00663     va_list al;
-<a name="l00664"></a>00664     
-<a name="l00665"></a>00665     va_start(al, format);
-<a name="l00666"></a>00666     vsnprintf(message, <a class="code" href="group__fors__utils.html#g1ddbaf639cddef891b3619471eea9008">MAX_MESSAGE_LENGTH</a> - 1, format, al);
-<a name="l00667"></a>00667     va_end(al);
-<a name="l00668"></a>00668     
-<a name="l00669"></a>00669     message[<a class="code" href="group__fors__utils.html#g1ddbaf639cddef891b3619471eea9008">MAX_MESSAGE_LENGTH</a> - 1] = <span class="charliteral">'\0'</span>;
-<a name="l00670"></a>00670 
-<a name="l00671"></a>00671     <span class="keywordflow">switch</span>(level) {
-<a name="l00672"></a>00672     <span class="keywordflow">case</span> CPL_MSG_DEBUG:   cpl_msg_debug  (fct, <span class="stringliteral">"%s"</span>, message); <span class="keywordflow">break</span>;
-<a name="l00673"></a>00673     <span class="keywordflow">case</span> CPL_MSG_INFO:    cpl_msg_info   (fct, <span class="stringliteral">"%s"</span>, message); <span class="keywordflow">break</span>;
-<a name="l00674"></a>00674     <span class="keywordflow">case</span> CPL_MSG_WARNING: cpl_msg_warning(fct, <span class="stringliteral">"%s"</span>, message); <span class="keywordflow">break</span>;
-<a name="l00675"></a>00675     <span class="keywordflow">case</span> CPL_MSG_ERROR:   cpl_msg_error  (fct, <span class="stringliteral">"%s"</span>, message); <span class="keywordflow">break</span>;
-<a name="l00676"></a>00676     <span class="keywordflow">default</span>: 
-<a name="l00677"></a>00677         cpl_msg_error(fct, <span class="stringliteral">"Unknown message level: %d"</span>, level);
-<a name="l00678"></a>00678         cpl_msg_error(fct, message);
-<a name="l00679"></a>00679         <span class="keywordflow">break</span>;
-<a name="l00680"></a>00680     }
-<a name="l00681"></a>00681     <span class="keywordflow">return</span>;
-<a name="l00682"></a>00682 }
-<a name="l00683"></a>00683 
-<a name="l00684"></a>00684 
-<a name="l00685"></a>00685 <span class="preprocessor">#undef cleanup</span>
-<a name="l00686"></a><a class="code" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">00686</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l00687"></a>00687 <span class="preprocessor"></span>
-<a name="l00696"></a><a class="code" href="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3">00696</a> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3">fors_utils_median_corr</a>(<span class="keywordtype">int</span> n)
-<a name="l00697"></a>00697 {
-<a name="l00698"></a>00698     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( n > 0, <span class="keywordflow">return</span> -1, <span class="stringliteral">"Illegal number: %d"</span>, n);
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700     <span class="keyword">const</span> <span class="keywordtype">double</span> c[] = {
-<a name="l00701"></a>00701     <span class="comment">/* Format:  n, corr(n), error</span>
-<a name="l00702"></a>00702 <span class="comment">       Numbers computed by numerical experiment </span>
-<a name="l00703"></a>00703 <span class="comment">       (i.e. generate n normal distributed numbers, </span>
-<a name="l00704"></a>00704 <span class="comment">       get the median (if n is even, mean of middle elements),</span>
-<a name="l00705"></a>00705 <span class="comment">       measure the median error and median's error error)</span>
-<a name="l00706"></a>00706 <span class="comment">    */</span>
-<a name="l00707"></a>00707     1, 0.999892, 0.000405,
-<a name="l00708"></a>00708     2, 0.999868, 0.000413,
-<a name="l00709"></a>00709     3, 1.159685, 0.000467,
-<a name="l00710"></a>00710     4, 1.091738, 0.000431,
-<a name="l00711"></a>00711     5, 1.197186, 0.000473,
-<a name="l00712"></a>00712     6, 1.134358, 0.000454,
-<a name="l00713"></a>00713     7, 1.213364, 0.000481,
-<a name="l00714"></a>00714     8, 1.159116, 0.000466,
-<a name="l00715"></a>00715     9, 1.223264, 0.000487,
-<a name="l00716"></a>00716     10, 1.176252, 0.000468,
-<a name="l00717"></a>00717     11, 1.228136, 0.000491,
-<a name="l00718"></a>00718     12, 1.187431, 0.000476,
-<a name="l00719"></a>00719     13, 1.231643, 0.000498,
-<a name="l00720"></a>00720     14, 1.195670, 0.000488,
-<a name="l00721"></a>00721     15, 1.235724, 0.000491,
-<a name="l00722"></a>00722     16, 1.201223, 0.000482,
-<a name="l00723"></a>00723     17, 1.237393, 0.000487,
-<a name="l00724"></a>00724     18, 1.207451, 0.000487,
-<a name="l00725"></a>00725     19, 1.239745, 0.000502,
-<a name="l00726"></a>00726     20, 1.212639, 0.000490,
-<a name="l00727"></a>00727     21, 1.241837, 0.000498,
-<a name="l00728"></a>00728     22, 1.216330, 0.000492,
-<a name="l00729"></a>00729     23, 1.244426, 0.000508,
-<a name="l00730"></a>00730     24, 1.221290, 0.000493,
-<a name="l00731"></a>00731     25, 1.246456, 0.000507,
-<a name="l00732"></a>00732     26, 1.224591, 0.000498,
-<a name="l00733"></a>00733     27, 1.248254, 0.000500,
-<a name="l00734"></a>00734     28, 1.227300, 0.000498,
-<a name="l00735"></a>00735     29, 1.248467, 0.000503,
-<a name="l00736"></a>00736     30, 1.229101, 0.000485,
-<a name="l00737"></a>00737     31, 1.248270, 0.000498,
-<a name="l00738"></a>00738     32, 1.231945, 0.000493,
-<a name="l00739"></a>00739     33, 1.249087, 0.000509,
-<a name="l00740"></a>00740     34, 1.231960, 0.000486,
-<a name="l00741"></a>00741     35, 1.249525, 0.000500,
-<a name="l00742"></a>00742     36, 1.231679, 0.000496,
-<a name="l00743"></a>00743     37, 1.249156, 0.000510,
-<a name="l00744"></a>00744     38, 1.233630, 0.000494,
-<a name="l00745"></a>00745     39, 1.249173, 0.000483,
-<a name="l00746"></a>00746     40, 1.233669, 0.000492,
-<a name="l00747"></a>00747     41, 1.248756, 0.000510,
-<a name="l00748"></a>00748     42, 1.235170, 0.000493,
-<a name="l00749"></a>00749     43, 1.248498, 0.000497,
-<a name="l00750"></a>00750     44, 1.235864, 0.000501,
-<a name="l00751"></a>00751     45, 1.248986, 0.000487,
-<a name="l00752"></a>00752     46, 1.236148, 0.000495,
-<a name="l00753"></a>00753     47, 1.248720, 0.000507,
-<a name="l00754"></a>00754     48, 1.236461, 0.000499,
-<a name="l00755"></a>00755     49, 1.248677, 0.000500,
-<a name="l00756"></a>00756     50, 1.236832, 0.000499,
-<a name="l00757"></a>00757     51, 1.249143, 0.000510,
-<a name="l00758"></a>00758     52, 1.237251, 0.000497,
-<a name="l00759"></a>00759     53, 1.248619, 0.000510,
-<a name="l00760"></a>00760     54, 1.237826, 0.000490,
-<a name="l00761"></a>00761     55, 1.249292, 0.000499,
-<a name="l00762"></a>00762     56, 1.238721, 0.000492,
-<a name="l00763"></a>00763     57, 1.248719, 0.000502,
-<a name="l00764"></a>00764     58, 1.238830, 0.000482,
-<a name="l00765"></a>00765     59, 1.248869, 0.000491,
-<a name="l00766"></a>00766     60, 1.239892, 0.000501,
-<a name="l00767"></a>00767     61, 1.248980, 0.000505,
-<a name="l00768"></a>00768     62, 1.239435, 0.000506,
-<a name="l00769"></a>00769     63, 1.249534, 0.000506,
-<a name="l00770"></a>00770     64, 1.240748, 0.000507,
-<a name="l00771"></a>00771     65, 1.249158, 0.000501,
-<a name="l00772"></a>00772     66, 1.240053, 0.000503,
-<a name="l00773"></a>00773     67, 1.248843, 0.000500,
-<a name="l00774"></a>00774     68, 1.241417, 0.000499,
-<a name="l00775"></a>00775     69, 1.249386, 0.000506,
-<a name="l00776"></a>00776     70, 1.241106, 0.000499,
-<a name="l00777"></a>00777     71, 1.249540, 0.000509,
-<a name="l00778"></a>00778     72, 1.240998, 0.000491,
-<a name="l00779"></a>00779     73, 1.250202, 0.000502,
-<a name="l00780"></a>00780     74, 1.241989, 0.000491,
-<a name="l00781"></a>00781     75, 1.249485, 0.000497,
-<a name="l00782"></a>00782     76, 1.242218, 0.000503,
-<a name="l00783"></a>00783     77, 1.249733, 0.000506,
-<a name="l00784"></a>00784     78, 1.240815, 0.000517,
-<a name="l00785"></a>00785     79, 1.250652, 0.000494,
-<a name="l00786"></a>00786     80, 1.241356, 0.000501,
-<a name="l00787"></a>00787     81, 1.250115, 0.000511,
-<a name="l00788"></a>00788     82, 1.241610, 0.000506,
-<a name="l00789"></a>00789     83, 1.249751, 0.000504,
-<a name="l00790"></a>00790     84, 1.242905, 0.000485,
-<a name="l00791"></a>00791     85, 1.249906, 0.000512,
-<a name="l00792"></a>00792     86, 1.243211, 0.000502,
-<a name="l00793"></a>00793     87, 1.250671, 0.000503,
-<a name="l00794"></a>00794     88, 1.242750, 0.000489,
-<a name="l00795"></a>00795     89, 1.249779, 0.000502,
-<a name="l00796"></a>00796     90, 1.243191, 0.000507,
-<a name="l00797"></a>00797     91, 1.250325, 0.000494,
-<a name="l00798"></a>00798     92, 1.243411, 0.000493,
-<a name="l00799"></a>00799     93, 1.250774, 0.000508,
-<a name="l00800"></a>00800     94, 1.244007, 0.000492,
-<a name="l00801"></a>00801     95, 1.249777, 0.000503,
-<a name="l00802"></a>00802     96, 1.243910, 0.000507,
-<a name="l00803"></a>00803     97, 1.250147, 0.000503,
-<a name="l00804"></a>00804     98, 1.243634, 0.000501,
-<a name="l00805"></a>00805     99, 1.250931, 0.000504,
-<a name="l00806"></a>00806     100, 1.243948, 0.000504};
-<a name="l00807"></a>00807 
-<a name="l00808"></a>00808     <span class="keywordflow">if</span> (n <= 100) {
-<a name="l00809"></a>00809     <span class="keywordflow">return</span> c[(n-1)*3 + 1];
-<a name="l00810"></a>00810     }
-<a name="l00811"></a>00811     <span class="keywordflow">else</span> {
-<a name="l00812"></a>00812         <span class="keywordflow">return</span> sqrt(M_PI/2);
-<a name="l00813"></a>00813     }
-<a name="l00814"></a>00814 }
-<a name="l00815"></a>00815 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__utils_8c_source.html b/html/fors__utils_8c_source.html
new file mode 100644
index 0000000..c88b5d8
--- /dev/null
+++ b/html/fors__utils_8c_source.html
@@ -0,0 +1,756 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_utils.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_utils.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_utils.c,v 1.32 2013-10-09 15:58:42 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-09 15:58:42 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.32 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="comment">/* Required CPL version */</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#define REQ_CPL_MAJOR 4</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor"></span><span class="preprocessor">#define REQ_CPL_MINOR 0</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor"></span><span class="preprocessor">#define REQ_CPL_MICRO 0</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keyword">const</span> <span class="keywordtype">double</span> STDEV_PR_MAD = 1/0.6744897;  <span class="comment">/* standard deviations per median</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="comment">                                             absolute deviation,</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="comment">                                             assuming a normal distribution */</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87">   65</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87" title="Get the pipeline copyright and license.">fors_get_license</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> {</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_license = </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>         <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         <span class="stringliteral">"Copyright (C) 2002-2011 European Southern Observatory\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>         <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>         <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>         <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>         <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>         <span class="stringliteral">"(at your option) any later version.\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>         <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>         <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>         <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>         <span class="stringliteral">"GNU General Public License for more details.\n"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>         <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>         <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>         <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>         <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>;</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <span class="keywordflow">return</span> fors_license ;</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> }</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="group__fors__utils.html#gaf34da190cb639a584e5f2473de24d887">   92</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#gaf34da190cb639a584e5f2473de24d887" title="Issue a banner with the pipeline version.">fors_print_banner</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> {</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     cpl_msg_info(__func__, <span class="stringliteral">"*****************************************"</span>);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     cpl_msg_info(__func__, <span class="stringliteral">"Welcome to FORS Pipeline release %s"</span>,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                  PACKAGE_VERSION);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     cpl_msg_info(__func__, <span class="stringliteral">"*****************************************"</span>);</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> }</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74">  107</a></span> <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> {</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="comment">      This is a good opportunity to verify that the compile time</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="comment">      and runtime CPL versions are recent enough, and consistent </span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">#ifdef CPL_VERSION_CODE</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor"></span><span class="preprocessor">#if CPL_VERSION_CODE >= CPL_VERSION(REQ_CPL_MAJOR, REQ_CPL_MINOR, REQ_CPL_MICRO)</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor"></span>    cpl_msg_debug(cpl_func, </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                   <span class="stringliteral">"Compile time CPL version code was %d. "</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                   <span class="stringliteral">"Required is version %d.%d.%d, code %d"</span>,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                   CPL_VERSION_CODE, REQ_CPL_MAJOR, REQ_CPL_MINOR, REQ_CPL_MICRO,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                   CPL_VERSION(REQ_CPL_MAJOR, REQ_CPL_MINOR, REQ_CPL_MICRO));</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor"></span><span class="preprocessor">#error CPL version too old</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor"></span><span class="preprocessor">#else  </span><span class="comment">/* ifdef CPL_VERSION_CODE */</span><span class="preprocessor"></span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor"></span><span class="preprocessor">#error CPL_VERSION_CODE not defined. CPL version too old</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">if</span> (cpl_version_get_major() < REQ_CPL_MAJOR ||</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         (cpl_version_get_major() == REQ_CPL_MAJOR && </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>          (<span class="keywordtype">int</span>) cpl_version_get_minor() < REQ_CPL_MINOR) ||</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>         </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         (cpl_version_get_major() == REQ_CPL_MAJOR &&</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>          cpl_version_get_minor() == REQ_CPL_MINOR && </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>          (<span class="keywordtype">int</span>) cpl_version_get_micro() < REQ_CPL_MICRO)</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>         ) {</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         <span class="comment">/* cast suppresses warning about comparing unsigned with 0 */</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>         cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                         <span class="stringliteral">"Runtime CPL version %s (%d.%d.%d) "</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                         <span class="stringliteral">"is not supported. "</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                         <span class="stringliteral">"Please update to CPL version %d.%d.%d or later"</span>, </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                         cpl_version_get_version(),</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                         cpl_version_get_major(),</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                         cpl_version_get_minor(),</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                         cpl_version_get_micro(),</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                         REQ_CPL_MAJOR,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                         REQ_CPL_MINOR,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                         REQ_CPL_MICRO);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     }</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>         cpl_msg_debug(cpl_func,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                       <span class="stringliteral">"Runtime CPL version %s (%d.%d.%d) detected, "</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                       <span class="stringliteral">"%d.%d.%d or later required"</span>,</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                       cpl_version_get_version(),</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>                       cpl_version_get_major(),</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>                       cpl_version_get_minor(),</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                       cpl_version_get_micro(),</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                       REQ_CPL_MAJOR,</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                       REQ_CPL_MINOR,</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>                       REQ_CPL_MICRO);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     }</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="comment">/* Fixme: Test that compile and runtime versions compare equal.</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="comment">       This requires CPL to provide the major/minor/micro version numbers</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="comment">       as preprocessor symbols, not just a code. */</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="comment">/* As defined in config.h */</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <span class="keywordflow">return</span> FORS_BINARY_VERSION;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno"><a class="code" href="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56">  181</a></span> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56" title="Pseudo-random gaussian distributed number.">fors_rand_gauss</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> {</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="keyword">static</span> <span class="keywordtype">double</span> V1, V2, S;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keyword">static</span> <span class="keywordtype">int</span> phase = 0;</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     <span class="keywordtype">double</span> X;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="keywordflow">if</span>(phase == 0) {</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>         <span class="keywordtype">double</span> U1 = (double)rand() / RAND_MAX;</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>         <span class="keywordtype">double</span> U2 = (double)rand() / RAND_MAX;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>         </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>         V1 = 2 * U1 - 1;</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>         V2 = 2 * U2 - 1;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>         S = V1 * V1 + V2 * V2;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     } <span class="keywordflow">while</span>(S >= 1 || S == 0);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     X = V1 * sqrt(-2 * log(S) / S);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     } <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     X = V2 * sqrt(-2 * log(S) / S);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     phase = 1 - phase;</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="keywordflow">return</span> X;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> }</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno"><a class="code" href="group__fors__utils.html#gac3759b058af73511a69998299a11a40f">  211</a></span> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#gac3759b058af73511a69998299a11a40f" title="Same as cpl_tools_get_kth_double.">fors_tools_get_kth_double</a>(</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     <span class="keywordtype">double</span>  *   a,</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="keywordtype">int</span>         n,</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordtype">int</span>         k)</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> {</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     <span class="keywordtype">double</span> x ;</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <span class="keywordtype">int</span>    i, j, l, m ;</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_ensure(a, CPL_ERROR_NULL_INPUT, 0.00) ;</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     l=0 ; m=n-1 ;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     <span class="keywordflow">while</span> (l<m) {</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>         x=a[k] ;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>         i=l ;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>         j=m ;</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>         <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>             <span class="keywordflow">while</span> (a[i]<x) i++ ;</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>             <span class="keywordflow">while</span> (x<a[j]) j-- ;</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>             <span class="keywordflow">if</span> (i<=j) {</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                 <span class="comment">//CPL_DOUBLE_SWAP(a[i],a[j]) ;</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                 <span class="keywordtype">double</span> temp = a[i];</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                 a[i] = a[j];</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                 a[j] = temp;</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                 i++ ; j-- ;</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>             }</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>         } <span class="keywordflow">while</span> (i<=j) ;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>         <span class="keywordflow">if</span> (j<k) l=i ;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>         <span class="keywordflow">if</span> (k<i) m=j ;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     }</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="keywordflow">return</span> a[k] ;</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> }</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00250"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga513ceb86672094a1d13a45d75e01782a">  250</a></span> <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#ga513ceb86672094a1d13a45d75e01782a" title="Unbiased median.">fors_tools_get_median_float</a>(<span class="keywordtype">float</span> *a, <span class="keywordtype">int</span> n)</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> {</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="keywordflow">return</span> (n % 2 == 0) ?</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>         (<a class="code" href="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044" title="Same as cpl_tools_get_kth_float.">fors_tools_get_kth_float</a>(a, n, (n-1)/2) +</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>          <a class="code" href="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044" title="Same as cpl_tools_get_kth_float.">fors_tools_get_kth_float</a>(a, n, (n/2))) / 2.0</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>         : <a class="code" href="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044" title="Same as cpl_tools_get_kth_float.">fors_tools_get_kth_float</a>(a, n, n/2);</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> }</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga5de34c3a7ff32722bc68e1b3a67f3390">  265</a></span> <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#ga5de34c3a7ff32722bc68e1b3a67f3390" title="Biased median.">fors_tools_get_median_fast_float</a>(<span class="keywordtype">float</span> *a, <span class="keywordtype">int</span> n)</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> {</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044" title="Same as cpl_tools_get_kth_float.">fors_tools_get_kth_float</a>(a, n, n/2);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> }</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044">  277</a></span> <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044" title="Same as cpl_tools_get_kth_float.">fors_tools_get_kth_float</a>(</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="keywordtype">float</span>  *   a,</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="keywordtype">int</span>         n,</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     <span class="keywordtype">int</span>         k)</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> {</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordtype">float</span> x ;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     <span class="keywordtype">int</span>    i, j, l, m ;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     cpl_ensure(a, CPL_ERROR_NULL_INPUT, 0.00) ;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     l=0 ; m=n-1 ;</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keywordflow">while</span> (l<m) {</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>         x=a[k] ;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>         i=l ;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>         j=m ;</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>         <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>             <span class="keywordflow">while</span> (a[i]<x) i++ ;</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>             <span class="keywordflow">while</span> (x<a[j]) j-- ;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>             <span class="keywordflow">if</span> (i<=j) {</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                 <span class="comment">//CPL_FLOAT_SWAP(a[i],a[j]) ;</span></div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                 <span class="keywordtype">float</span> temp = a[i];</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                 a[i] = a[j];</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                 a[j] = temp;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                 i++ ; j-- ;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>             }</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         } <span class="keywordflow">while</span> (i<=j) ;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>         <span class="keywordflow">if</span> (j<k) l=i ;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>         <span class="keywordflow">if</span> (k<i) m=j ;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     }</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     <span class="keywordflow">return</span> a[k] ;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> }</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *</div>
+<div class="line"><a name="l00319"></a><span class="lineno"><a class="code" href="group__fors__utils.html#gad97092a91b5de91f84039778596fd759">  319</a></span> <a class="code" href="group__fors__utils.html#gad97092a91b5de91f84039778596fd759" title="Get frame type as a string.">fors_frame_get_type_string</a>(<span class="keyword">const</span> cpl_frame *f)</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> {</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( f != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Null frame"</span> );</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> </div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     <span class="keywordflow">switch</span> (cpl_frame_get_type(f)) {</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     <span class="keywordflow">case</span> CPL_FRAME_TYPE_NONE:   <span class="keywordflow">return</span> <span class="stringliteral">"NONE"</span>;      <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keywordflow">case</span> CPL_FRAME_TYPE_IMAGE:  <span class="keywordflow">return</span> <span class="stringliteral">"IMAGE"</span>;     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keywordflow">case</span> CPL_FRAME_TYPE_MATRIX: <span class="keywordflow">return</span> <span class="stringliteral">"MATRIX"</span>;    <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     <span class="keywordflow">case</span> CPL_FRAME_TYPE_TABLE:  <span class="keywordflow">return</span> <span class="stringliteral">"TABLE"</span>;     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     <span class="keywordflow">default</span>: </div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>         <span class="keywordflow">return</span> <span class="stringliteral">"unrecognized frame type"</span>;      </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     }</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> }</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *</div>
+<div class="line"><a name="l00344"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga3e2178bad7068e3768fc5f78b1d02490">  344</a></span> <a class="code" href="group__fors__utils.html#ga3e2178bad7068e3768fc5f78b1d02490" title="Get frame group as a string.">fors_frame_get_group_string</a>(<span class="keyword">const</span> cpl_frame *f)</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> {</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( f != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Null frame"</span> );</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     <span class="keywordflow">switch</span> (cpl_frame_get_group(f)) {</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <span class="keywordflow">case</span> CPL_FRAME_GROUP_NONE:    <span class="keywordflow">return</span> <span class="stringliteral">"NONE"</span>;                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     <span class="keywordflow">case</span> CPL_FRAME_GROUP_RAW:     <span class="keywordflow">return</span> CPL_FRAME_GROUP_RAW_ID;     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     <span class="keywordflow">case</span> CPL_FRAME_GROUP_CALIB:   <span class="keywordflow">return</span> CPL_FRAME_GROUP_CALIB_ID;   <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     <span class="keywordflow">case</span> CPL_FRAME_GROUP_PRODUCT: <span class="keywordflow">return</span> CPL_FRAME_GROUP_PRODUCT_ID; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         <span class="keywordflow">return</span> <span class="stringliteral">"unrecognized frame group"</span>;</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     }</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> }</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *</div>
+<div class="line"><a name="l00369"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga82f1aaba039c880a3bff109f3729d74a">  369</a></span> <a class="code" href="group__fors__utils.html#ga82f1aaba039c880a3bff109f3729d74a" title="Get frame level as a string.">fors_frame_get_level_string</a>(<span class="keyword">const</span> cpl_frame *f)</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> {</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( f != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Null frame"</span> );</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     </div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     <span class="keywordflow">switch</span> (cpl_frame_get_level(f)) {</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     <span class="keywordflow">case</span> CPL_FRAME_LEVEL_NONE:        <span class="keywordflow">return</span> <span class="stringliteral">"NONE"</span>;         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     <span class="keywordflow">case</span> CPL_FRAME_LEVEL_TEMPORARY:   <span class="keywordflow">return</span> <span class="stringliteral">"TEMPORARY"</span>;    <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">case</span> CPL_FRAME_LEVEL_INTERMEDIATE:<span class="keywordflow">return</span> <span class="stringliteral">"INTERMEDIATE"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="keywordflow">case</span> CPL_FRAME_LEVEL_FINAL:       <span class="keywordflow">return</span> <span class="stringliteral">"FINAL"</span>;        <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordflow">default</span>: </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>         <span class="keywordflow">return</span> <span class="stringliteral">"unrecognized frame level"</span>;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     }</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> }</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga414e1f2d95f271cc76a67e525b910e96">  393</a></span> <a class="code" href="group__fors__utils.html#ga414e1f2d95f271cc76a67e525b910e96" title="Print a frame set.">fors_frameset_print</a>(<span class="keyword">const</span> cpl_frameset *frames)</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> {</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     <span class="comment">/* Two special cases: a NULL frame set and an empty frame set */</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     <span class="keywordflow">if</span> (frames == NULL) {</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"NULL"</span>);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     }</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>         <span class="keyword">const</span> cpl_frame *f = NULL;</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>         f = cpl_frameset_get_first_const(frames);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>         </div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>         <span class="keywordflow">if</span> (f == NULL) {</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>             cpl_msg_info(cpl_func, <span class="stringliteral">"[Empty frame set]"</span>);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>         }</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>             <span class="keywordflow">while</span>(f != NULL) {</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>                 <a class="code" href="group__fors__utils.html#ga6692a0ba541b3e7f99654f844aee40c6" title="Print a frame.">fors_frame_print</a>(f);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                 f = cpl_frameset_get_next_const(frames);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>             }</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>         }</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     }</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> }</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> </div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00427"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga6692a0ba541b3e7f99654f844aee40c6">  427</a></span> <a class="code" href="group__fors__utils.html#ga6692a0ba541b3e7f99654f844aee40c6" title="Print a frame.">fors_frame_print</a>(<span class="keyword">const</span> cpl_frame *f)</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> {</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     <span class="keywordflow">if</span> (f == NULL) {</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"NULL"</span>);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     }</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *filename = cpl_frame_get_filename(f);</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *tag = cpl_frame_get_tag(f);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>         </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>         <span class="keywordflow">if</span> (filename == NULL) {</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>             filename = <span class="stringliteral">"NULL"</span>;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>         }</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         <span class="keywordflow">if</span> (tag == NULL) {</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>             tag = <span class="stringliteral">"NULL"</span>;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         }</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"%-7s %-20s %s"</span>, </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>                      <a class="code" href="group__fors__utils.html#ga3e2178bad7068e3768fc5f78b1d02490" title="Get frame group as a string.">fors_frame_get_group_string</a>(f),</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>                      tag,</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>                      filename);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>         </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"type \t= %s"</span>,  <a class="code" href="group__fors__utils.html#gad97092a91b5de91f84039778596fd759" title="Get frame type as a string.">fors_frame_get_type_string</a>(f));</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"group \t= %s"</span>, <a class="code" href="group__fors__utils.html#ga3e2178bad7068e3768fc5f78b1d02490" title="Get frame group as a string.">fors_frame_get_group_string</a>(f));</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"level \t= %s"</span>, <a class="code" href="group__fors__utils.html#ga82f1aaba039c880a3bff109f3729d74a" title="Get frame level as a string.">fors_frame_get_level_string</a>(f));</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     }</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     </div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> }</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> </div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> cpl_frameset *</div>
+<div class="line"><a name="l00468"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744">  468</a></span> <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(<span class="keyword">const</span> cpl_frameset *frames,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>                       <span class="keyword">const</span> <span class="keywordtype">char</span> *tag)</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> {</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     cpl_frameset *subset = NULL;</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     <span class="keyword">const</span> cpl_frame *f;</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> </div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( frames != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Null frameset"</span> );</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( tag    != NULL, <span class="keywordflow">return</span> NULL, <span class="stringliteral">"Null tag"</span> );</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     </div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     subset = cpl_frameset_new();</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> </div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     <span class="keywordflow">for</span> (f = cpl_frameset_find_const(frames, tag);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>          f != NULL;</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>          f = cpl_frameset_find_const(frames, NULL)) {</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         cpl_frameset_insert(subset, cpl_frame_duplicate(f));</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     }</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span> </div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     <span class="keywordflow">return</span> subset;</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span> }</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span> </div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00496"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd">  496</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd" title="Textual representation of CPL type.">fors_type_get_string</a>(cpl_type t)</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span> {</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     <span class="comment">/* Note that CPL_TYPE_STRING is shorthand</span></div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> <span class="comment">       for CPL_TYPE_CHAR | CPL_TYPE_FLAG_ARRAY . */</span></div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     </div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     <span class="keywordflow">if</span> (!(t & CPL_TYPE_FLAG_ARRAY))</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>         <span class="keywordflow">switch</span>(t & (~CPL_TYPE_FLAG_ARRAY)) {</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>         <span class="keywordflow">case</span> CPL_TYPE_CHAR:       <span class="keywordflow">return</span> <span class="stringliteral">"char"</span>;    <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         <span class="keywordflow">case</span> CPL_TYPE_UCHAR:      <span class="keywordflow">return</span> <span class="stringliteral">"uchar"</span>;   <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         <span class="keywordflow">case</span> CPL_TYPE_BOOL:       <span class="keywordflow">return</span> <span class="stringliteral">"boolean"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         <span class="keywordflow">case</span> CPL_TYPE_INT:        <span class="keywordflow">return</span> <span class="stringliteral">"int"</span>;     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>         <span class="keywordflow">case</span> CPL_TYPE_UINT:       <span class="keywordflow">return</span> <span class="stringliteral">"uint"</span>;    <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>         <span class="keywordflow">case</span> CPL_TYPE_LONG:       <span class="keywordflow">return</span> <span class="stringliteral">"long"</span>;    <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         <span class="keywordflow">case</span> CPL_TYPE_ULONG:      <span class="keywordflow">return</span> <span class="stringliteral">"ulong"</span>;   <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         <span class="keywordflow">case</span> CPL_TYPE_FLOAT:      <span class="keywordflow">return</span> <span class="stringliteral">"float"</span>;   <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>         <span class="keywordflow">case</span> CPL_TYPE_DOUBLE:     <span class="keywordflow">return</span> <span class="stringliteral">"double"</span>;  <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>         <span class="keywordflow">case</span> CPL_TYPE_POINTER:    <span class="keywordflow">return</span> <span class="stringliteral">"pointer"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>         <span class="keywordflow">case</span> CPL_TYPE_INVALID:    <span class="keywordflow">return</span> <span class="stringliteral">"invalid"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>             <span class="keywordflow">return</span> <span class="stringliteral">"unrecognized type"</span>;</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>         }</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         <span class="keywordflow">switch</span>(t & (~CPL_TYPE_FLAG_ARRAY)) {</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>         <span class="keywordflow">case</span> CPL_TYPE_CHAR:       <span class="keywordflow">return</span> <span class="stringliteral">"string (char array)"</span>; <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>         <span class="keywordflow">case</span> CPL_TYPE_UCHAR:      <span class="keywordflow">return</span> <span class="stringliteral">"uchar array"</span>;         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>         <span class="keywordflow">case</span> CPL_TYPE_BOOL:       <span class="keywordflow">return</span> <span class="stringliteral">"boolean array"</span>;       <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>         <span class="keywordflow">case</span> CPL_TYPE_INT:        <span class="keywordflow">return</span> <span class="stringliteral">"int array"</span>;           <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>         <span class="keywordflow">case</span> CPL_TYPE_UINT:       <span class="keywordflow">return</span> <span class="stringliteral">"uint array"</span>;          <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>         <span class="keywordflow">case</span> CPL_TYPE_LONG:       <span class="keywordflow">return</span> <span class="stringliteral">"long array"</span>;          <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>         <span class="keywordflow">case</span> CPL_TYPE_ULONG:      <span class="keywordflow">return</span> <span class="stringliteral">"ulong array"</span>;         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>         <span class="keywordflow">case</span> CPL_TYPE_FLOAT:      <span class="keywordflow">return</span> <span class="stringliteral">"float array"</span>;         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>         <span class="keywordflow">case</span> CPL_TYPE_DOUBLE:     <span class="keywordflow">return</span> <span class="stringliteral">"double array"</span>;        <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>         <span class="keywordflow">case</span> CPL_TYPE_POINTER:    <span class="keywordflow">return</span> <span class="stringliteral">"pointer array"</span>;       <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>         <span class="keywordflow">case</span> CPL_TYPE_INVALID:    <span class="keywordflow">return</span> <span class="stringliteral">"invalid (array)"</span>;     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>         <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>             <span class="keywordflow">return</span> <span class="stringliteral">"unrecognized type"</span>;</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>         }</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> }</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00545"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42">  545</a></span> <a class="code" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42" title="Set unset parameters to default value.">fors_parameterlist_set_defaults</a>(cpl_parameterlist *parlist)</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span> {</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     cpl_parameter *p = NULL;</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     <span class="keywordtype">bool</span> parameter_is_set;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     p = cpl_parameterlist_get_first(parlist);</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     <span class="keywordflow">while</span> (p != NULL) {</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> </div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>         <span class="comment">/*   EsoRex bug: (well, it's an undocumented-feature </span></div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> <span class="comment">             that EsoRex, unlike Gasgano, reads the default flag):</span></div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span> <span class="comment">        */</span></div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>         parameter_is_set = cpl_parameter_get_default_flag(p);</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>         </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>         <span class="keywordflow">if</span> (!parameter_is_set) {</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>             cpl_type ptype = cpl_parameter_get_type(p);</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>             <span class="keywordflow">switch</span> (ptype) {</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>             <span class="keywordflow">case</span> CPL_TYPE_BOOL:</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>                 cpl_parameter_set_bool(p, cpl_parameter_get_default_bool(p));</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>             <span class="keywordflow">case</span> CPL_TYPE_INT:</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>                 cpl_parameter_set_int(p, cpl_parameter_get_default_int(p));</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>             <span class="keywordflow">case</span> CPL_TYPE_DOUBLE:</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>                 cpl_parameter_set_double(p, cpl_parameter_get_default_double(p));</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>             <span class="keywordflow">case</span> CPL_TYPE_STRING:</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>                 cpl_parameter_set_string(p, cpl_parameter_get_default_string(p));</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>             <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>                 <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( <span class="keyword">false</span>, <span class="keywordflow">return</span>, <span class="stringliteral">"Unknown type of parameter '%s'"</span>, </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>                         cpl_parameter_get_name(p));</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>             }</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         }</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>         p = cpl_parameterlist_get_next(parlist);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>     }</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     </div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> }</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span> <span class="preprocessor">#ifdef CPL_IS_NOT_CRAP</span></div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span> <span class="preprocessor"></span><span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00597"></a><span class="lineno"><a class="code" href="group__fors__utils.html#gabb34a534e28308533f300ea11ec7a3a3">  597</a></span> cpl_image *<a class="code" href="group__fors__utils.html#gabb34a534e28308533f300ea11ec7a3a3" title="Workaround for cpl_imagelist_collapse_create.">fors_imagelist_collapse_create</a>(<span class="keyword">const</span> cpl_imagelist *ilist)</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span> {</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     cpl_image *result = cpl_imagelist_collapse_create(ilist);</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     </div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     <span class="keywordflow">if</span> (result != NULL && cpl_image_count_rejected(result) == 0) {</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>         cpl_image_accept_all(result);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     }</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     </div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> }</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span> </div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> </div>
+<div class="line"><a name="l00616"></a><span class="lineno"><a class="code" href="group__fors__utils.html#gaa55c5fd8ade8f10e441297c0cda96093">  616</a></span> cpl_image *<a class="code" href="group__fors__utils.html#gaa55c5fd8ade8f10e441297c0cda96093" title="Workaround for cpl_imagelist_collapse_median_create.">fors_imagelist_collapse_median_create</a>(<span class="keyword">const</span> cpl_imagelist *ilist)</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span> {</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     cpl_image *result = cpl_imagelist_collapse_median_create(ilist);</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     </div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     <span class="keywordflow">if</span> (result != NULL && cpl_image_count_rejected(result) == 0) {</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>         cpl_image_accept_all(result);</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     }</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     </div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span> }</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00636"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga69350709e5f9874601c729becd315e81">  636</a></span> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#ga69350709e5f9874601c729becd315e81" title="Difference between angles.">fors_angle_diff</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> *a1, <span class="keyword">const</span> <span class="keywordtype">double</sp [...]
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> {</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( a1 != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( a2 != NULL, <span class="keywordflow">return</span> -1, NULL );</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="keywordtype">double</span> d = *a1 - *a2;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> </div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     <span class="keywordflow">while</span> (d < -M_PI) d += 2*M_PI;</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     <span class="keywordflow">while</span> (d >  M_PI) d -= 2*M_PI;</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     </div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     <span class="keywordflow">return</span> fabs(d);</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> }</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span> </div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> <span class="preprocessor">#define MAX_MESSAGE_LENGTH 1024</span></div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span> <span class="preprocessor"></span><span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00660"></a><span class="lineno"><a class="code" href="group__fors__utils.html#gae98c540953f671b35817aac071aa4adc">  660</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#gae98c540953f671b35817aac071aa4adc" title="Print message.">fors_msg_macro</a>(cpl_msg_severity level, <span class="keyword">const</span> <span class="keywordtype">char</span> *fct, <span class="keyword">const</span> <span class="keywordtype">ch [...]
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> {</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>     <span class="keywordtype">char</span> message[MAX_MESSAGE_LENGTH];</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     va_list al;</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>     </div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>     va_start(al, format);</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     vsnprintf(message, MAX_MESSAGE_LENGTH - 1, format, al);</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>     va_end(al);</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     </div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>     message[MAX_MESSAGE_LENGTH - 1] = <span class="charliteral">'\0'</span>;</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> </div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     <span class="keywordflow">switch</span>(level) {</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keywordflow">case</span> CPL_MSG_DEBUG:   cpl_msg_debug  (fct, <span class="stringliteral">"%s"</span>, message); <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     <span class="keywordflow">case</span> CPL_MSG_INFO:    cpl_msg_info   (fct, <span class="stringliteral">"%s"</span>, message); <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     <span class="keywordflow">case</span> CPL_MSG_WARNING: cpl_msg_warning(fct, <span class="stringliteral">"%s"</span>, message); <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="keywordflow">case</span> CPL_MSG_ERROR:   cpl_msg_error  (fct, <span class="stringliteral">"%s"</span>, message); <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>     <span class="keywordflow">default</span>: </div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>         cpl_msg_error(fct, <span class="stringliteral">"Unknown message level: %d"</span>, level);</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>         cpl_msg_error(fct, <span class="stringliteral">"%s"</span>, message);</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     }</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> }</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> </div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span> </div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00696"></a><span class="lineno"><a class="code" href="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3">  696</a></span> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3" title="median stacking correction factor">fors_utils_median_corr</a>(<span class="keywordtype">int</span> n)</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> {</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( n > 0, <span class="keywordflow">return</span> -1, <span class="stringliteral">"Illegal number: %d"</span>, n);</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     <span class="keyword">const</span> <span class="keywordtype">double</span> c[] = {</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>     <span class="comment">/* Format:  n, corr(n), error</span></div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span> <span class="comment">       Numbers computed by numerical experiment </span></div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> <span class="comment">       (i.e. generate n normal distributed numbers, </span></div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> <span class="comment">       get the median (if n is even, mean of middle elements),</span></div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span> <span class="comment">       measure the median error and median's error error)</span></div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     1, 0.999892, 0.000405,</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     2, 0.999868, 0.000413,</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     3, 1.159685, 0.000467,</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     4, 1.091738, 0.000431,</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     5, 1.197186, 0.000473,</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     6, 1.134358, 0.000454,</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     7, 1.213364, 0.000481,</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     8, 1.159116, 0.000466,</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     9, 1.223264, 0.000487,</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     10, 1.176252, 0.000468,</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     11, 1.228136, 0.000491,</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     12, 1.187431, 0.000476,</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     13, 1.231643, 0.000498,</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     14, 1.195670, 0.000488,</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>     15, 1.235724, 0.000491,</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     16, 1.201223, 0.000482,</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>     17, 1.237393, 0.000487,</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     18, 1.207451, 0.000487,</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     19, 1.239745, 0.000502,</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     20, 1.212639, 0.000490,</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     21, 1.241837, 0.000498,</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     22, 1.216330, 0.000492,</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     23, 1.244426, 0.000508,</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     24, 1.221290, 0.000493,</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     25, 1.246456, 0.000507,</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     26, 1.224591, 0.000498,</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     27, 1.248254, 0.000500,</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     28, 1.227300, 0.000498,</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     29, 1.248467, 0.000503,</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     30, 1.229101, 0.000485,</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     31, 1.248270, 0.000498,</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     32, 1.231945, 0.000493,</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>     33, 1.249087, 0.000509,</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     34, 1.231960, 0.000486,</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     35, 1.249525, 0.000500,</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>     36, 1.231679, 0.000496,</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     37, 1.249156, 0.000510,</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     38, 1.233630, 0.000494,</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     39, 1.249173, 0.000483,</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     40, 1.233669, 0.000492,</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>     41, 1.248756, 0.000510,</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     42, 1.235170, 0.000493,</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>     43, 1.248498, 0.000497,</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     44, 1.235864, 0.000501,</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     45, 1.248986, 0.000487,</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     46, 1.236148, 0.000495,</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     47, 1.248720, 0.000507,</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     48, 1.236461, 0.000499,</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>     49, 1.248677, 0.000500,</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     50, 1.236832, 0.000499,</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     51, 1.249143, 0.000510,</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>     52, 1.237251, 0.000497,</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     53, 1.248619, 0.000510,</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>     54, 1.237826, 0.000490,</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>     55, 1.249292, 0.000499,</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>     56, 1.238721, 0.000492,</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>     57, 1.248719, 0.000502,</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     58, 1.238830, 0.000482,</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>     59, 1.248869, 0.000491,</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>     60, 1.239892, 0.000501,</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     61, 1.248980, 0.000505,</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>     62, 1.239435, 0.000506,</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     63, 1.249534, 0.000506,</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     64, 1.240748, 0.000507,</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     65, 1.249158, 0.000501,</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>     66, 1.240053, 0.000503,</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     67, 1.248843, 0.000500,</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>     68, 1.241417, 0.000499,</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     69, 1.249386, 0.000506,</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     70, 1.241106, 0.000499,</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>     71, 1.249540, 0.000509,</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     72, 1.240998, 0.000491,</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>     73, 1.250202, 0.000502,</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>     74, 1.241989, 0.000491,</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>     75, 1.249485, 0.000497,</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>     76, 1.242218, 0.000503,</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     77, 1.249733, 0.000506,</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     78, 1.240815, 0.000517,</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     79, 1.250652, 0.000494,</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>     80, 1.241356, 0.000501,</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>     81, 1.250115, 0.000511,</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     82, 1.241610, 0.000506,</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     83, 1.249751, 0.000504,</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     84, 1.242905, 0.000485,</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     85, 1.249906, 0.000512,</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>     86, 1.243211, 0.000502,</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     87, 1.250671, 0.000503,</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>     88, 1.242750, 0.000489,</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>     89, 1.249779, 0.000502,</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     90, 1.243191, 0.000507,</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>     91, 1.250325, 0.000494,</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>     92, 1.243411, 0.000493,</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     93, 1.250774, 0.000508,</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>     94, 1.244007, 0.000492,</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>     95, 1.249777, 0.000503,</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     96, 1.243910, 0.000507,</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     97, 1.250147, 0.000503,</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     98, 1.243634, 0.000501,</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     99, 1.250931, 0.000504,</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     100, 1.243948, 0.000504};</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span> </div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     <span class="keywordflow">if</span> (n <= 100) {</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     <span class="keywordflow">return</span> c[(n-1)*3 + 1];</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     }</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>         <span class="keywordflow">return</span> sqrt(M_PI/2);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     }</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span> }</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__utils_8h-source.html b/html/fors__utils_8h-source.html
deleted file mode 100644
index 8a964f6..0000000
--- a/html/fors__utils_8h-source.html
+++ /dev/null
@@ -1,148 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_utils.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_utils.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_utils.h,v 1.30 2011/10/13 14:26:38 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/13 14:26:38 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.30 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_UTILS_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_UTILS_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_setting.h></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_star.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00035"></a>00035 
-<a name="l00042"></a>00042 <span class="preprocessor">#define assure(condition, action, ...)                      \</span>
-<a name="l00043"></a>00043 <span class="preprocessor">do if (!(condition)) {                                      \</span>
-<a name="l00044"></a>00044 <span class="preprocessor">    cpl_error_set_message(cpl_func,                         \</span>
-<a name="l00045"></a>00045 <span class="preprocessor">              cpl_error_get_code() ?            \</span>
-<a name="l00046"></a>00046 <span class="preprocessor">              cpl_error_get_code() :            \</span>
-<a name="l00047"></a>00047 <span class="preprocessor">                          CPL_ERROR_UNSPECIFIED,            \</span>
-<a name="l00048"></a>00048 <span class="preprocessor">                          __VA_ARGS__);                     \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">    cleanup;                                                \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">    action;                                                 \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">} while(0)</span>
-<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="comment">//    fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n");</span>
-<a name="l00053"></a>00053 
-<a name="l00067"></a>00067 <span class="preprocessor">#define cassure(condition, errc, action, ...)               \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">do if (!(condition)) {                                      \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">    cpl_error_set_message(                  cpl_func,       \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">                                            errc,           \</span>
-<a name="l00071"></a>00071 <span class="preprocessor">                                            __VA_ARGS__);   \</span>
-<a name="l00072"></a>00072 <span class="preprocessor">    cleanup;                                                \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">    action;                                                 \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">} while(0)</span>
-<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="comment">//    fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n");</span>
-<a name="l00076"></a>00076 
-<a name="l00089"></a>00089 <span class="preprocessor">#define cassure_automsg(condition, errc, action)            \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">do if (!(condition)) {                                      \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">    cpl_error_set_message(                  cpl_func,       \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">                                            errc,           \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">                                            "!("#condition")");\</span>
-<a name="l00094"></a>00094 <span class="preprocessor">    cleanup;                                                \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">    action;                                                 \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">} while(0)</span>
-<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="comment">//    fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n");</span>
-<a name="l00098"></a>00098 
-<a name="l00108"></a>00108 <span class="preprocessor">#define passure(condition, action)                                     \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">    assure(condition, action,                                          \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">       "Internal error. Please report to %s", PACKAGE_BUGREPORT)</span>
-<a name="l00111"></a>00111 <span class="preprocessor"></span>
-<a name="l00121"></a>00121 <span class="preprocessor">#define ppassure(condition, errc, action)                              \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">    cassure(condition, errc, action,                                   \</span>
-<a name="l00123"></a>00123 <span class="preprocessor">       "Internal error (!(%s)). Please report to %s", \</span>
-<a name="l00124"></a>00124 <span class="preprocessor">       #condition, \</span>
-<a name="l00125"></a>00125 <span class="preprocessor">       PACKAGE_BUGREPORT)</span>
-<a name="l00126"></a>00126 <span class="preprocessor"></span>
-<a name="l00127"></a>00127 <span class="preprocessor">#define fors_msg(level, ...) fors_msg_macro(level, cpl_func, __VA_ARGS__)</span>
-<a name="l00128"></a>00128 <span class="preprocessor"></span>
-<a name="l00129"></a>00129 <span class="preprocessor">#ifndef M_PI </span>
-<a name="l00130"></a>00130 <span class="preprocessor"></span><span class="preprocessor">#define M_PI 3.1415926535897932384626433832795</span>
-<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
-<a name="l00132"></a>00132 <span class="preprocessor"></span>
-<a name="l00133"></a>00133 <span class="preprocessor">#ifndef M_E</span>
-<a name="l00134"></a>00134 <span class="preprocessor"></span><span class="preprocessor">#define M_E  2.7182818284590452354</span>
-<a name="l00135"></a>00135 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
-<a name="l00136"></a>00136 <span class="preprocessor"></span>
-<a name="l00137"></a>00137 <span class="preprocessor">#define TWOSQRT2LN2 2.35482004503095</span>
-<a name="l00138"></a>00138 <span class="preprocessor"></span>
-<a name="l00139"></a>00139 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#gea88c3776498f5f3717413a50289af52">STDEV_PR_MAD</a>;
-<a name="l00140"></a>00140 
-<a name="l00141"></a>00141 <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#g5d402c4f4e0fe13790e410e507af10ef">fors_print_banner</a>(<span class="keywordtype">void</span>);
-<a name="l00142"></a>00142 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a>(<span class="keywordtype">void</span>);
-<a name="l00143"></a>00143 <span class="keywordtype">int</span> <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>(<span class="keywordtype">void</span>);
-<a name="l00144"></a>00144 <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044">fors_rand_gauss</a>(<span class="keywordtype">void</span>);
-<a name="l00145"></a>00145 
-<a name="l00146"></a>00146 <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#g4acaddb1c4b5fbc829b3a58434a08458">fors_tools_get_kth_double</a>(<span class="keywordtype">double</span> *a, <span class="keywordtype">int</span> n, <span class="keywordtype">int</span> k);
-<a name="l00147"></a>00147 <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#g032ad4d4b74b174df587f578f6a70bf2">fors_tools_get_kth_float</a>(<span class="keywordtype">float</span> *a, <span class="keywordtype">int</span> n, <span class="keywordtype">int</span> k);
-<a name="l00148"></a>00148 <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#g82a608ac0a7259f2c39a89db274546d3">fors_tools_get_median_float</a>( <span class="keywordtype">float</span> *a, <span class="keywordtype">int</span> n);
-<a name="l00149"></a>00149 <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#g8fcbc5ff472f72a690b4ef8716f66918">fors_tools_get_median_fast_float</a>(<span class="keywordtype">float</span> *a, <span class="keywordtype">int</span> n)  ;
-<a name="l00150"></a>00150 <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3">fors_utils_median_corr</a>(<span class="keywordtype">int</span> n);
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152 <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#gc1181b0023db290ca5bfc42e9980e3a8">fors_frameset_print</a>(<span class="keyword">const</span> cpl_frameset *frames);
-<a name="l00153"></a>00153 <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#g375049f68639265267adcdc11d161bc3">fors_frame_print</a>(<span class="keyword">const</span> cpl_frame *f);
-<a name="l00154"></a>00154 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__utils.html#gf509a28ce04d6804eabe62b2a5817afe">fors_frame_get_type_string</a>(<span class="keyword">const</span> cpl_frame *f);
-<a name="l00155"></a>00155 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__utils.html#gc219cfea8dd4f3c5a0aceb222d19150a">fors_frame_get_group_string</a>(<span class="keyword">const</span> cpl_frame *f);
-<a name="l00156"></a>00156 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__utils.html#gc02f8fba22227907e45bdcbe6de8655e">fors_frame_get_level_string</a>(<span class="keyword">const</span> cpl_frame *f);
-<a name="l00157"></a>00157 cpl_frameset *<a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(<span class="keyword">const</span> cpl_frameset *frames,
-<a name="l00158"></a>00158                     <span class="keyword">const</span> <span class="keywordtype">char</span> *tag);
-<a name="l00159"></a>00159 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a>(cpl_type type);
-<a name="l00160"></a>00160 <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">fors_parameterlist_set_defaults</a>(cpl_parameterlist *parlist);
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162 <span class="preprocessor">#ifdef CPL_IS_NOT_CRAP</span>
-<a name="l00163"></a>00163 <span class="preprocessor"></span><span class="preprocessor">#else</span>
-<a name="l00164"></a>00164 <span class="preprocessor"></span>cpl_image *<a class="code" href="group__fors__utils.html#g833fbeca7835f9c594deb0a8752d8b74">fors_imagelist_collapse_create</a>(<span class="keyword">const</span> cpl_imagelist *ilist);
-<a name="l00165"></a>00165 cpl_image *<a class="code" href="group__fors__utils.html#g2d1787d975000e60e8790fc656d538f6">fors_imagelist_collapse_median_create</a>(<span class="keyword">const</span> cpl_imagelist *ilist);
-<a name="l00166"></a>00166 <span class="preprocessor">#endif</span>
-<a name="l00167"></a>00167 <span class="preprocessor"></span>
-<a name="l00168"></a>00168 <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#g71645af45bc192964d3170f28c671240">fors_angle_diff</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> *a1, <span class="keyword">const</span> <span class="keywordtype">double</span> *a2);
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170 <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#ge561fe29b3673b34094804e26ece5e8e">fors_msg_macro</a>(cpl_msg_severity level, <span class="keyword">const</span> <span class="keywordtype">char</span> *fct, <span class="keyword">const</span> <span class="keywordtype">char</span> *format, ...)
-<a name="l00171"></a>00171 <span class="preprocessor">#ifdef __GNUC__</span>
-<a name="l00172"></a>00172 <span class="preprocessor"></span>__attribute__((format (printf, 3, 4)))
-<a name="l00173"></a>00173 <span class="preprocessor">#endif</span>
-<a name="l00174"></a>00174 <span class="preprocessor"></span>;
-<a name="l00175"></a>00175 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__utils_8h_source.html b/html/fors__utils_8h_source.html
new file mode 100644
index 0000000..bf054cb
--- /dev/null
+++ b/html/fors__utils_8h_source.html
@@ -0,0 +1,191 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_utils.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_utils.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_utils.h,v 1.31 2013-07-24 09:56:58 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-07-24 09:56:58 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.31 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_UTILS_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_UTILS_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_setting.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_star.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#define assure(condition, action, ...)                      \</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">do if (!(condition)) {                                      \</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">    cpl_error_set_message(cpl_func,                         \</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">              cpl_error_get_code() ?            \</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">              cpl_error_get_code() :            \</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">                          CPL_ERROR_UNSPECIFIED,            \</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">                          __VA_ARGS__);                     \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">    cleanup;                                                \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">    action;                                                 \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor"></span><span class="comment">//    fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n");</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">#define cassure(condition, errc, action, ...)               \</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">do if (!(condition)) {                                      \</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">    cpl_error_set_message(                  cpl_func,       \</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">                                            errc,           \</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor">                                            __VA_ARGS__);   \</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">    cleanup;                                                \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">    action;                                                 \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor"></span><span class="comment">//    fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n");</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> </div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">#define cassure_automsg(condition, errc, action)            \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">do if (!(condition)) {                                      \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">    cpl_error_set_message(                  cpl_func,       \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">                                            errc,           \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">                                            "!("#condition")");\</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">    cleanup;                                                \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">    action;                                                 \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor"></span><span class="comment">//    fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n");</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">#define passure(condition, action)                                     \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">    assure(condition, action,                                          \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">       "Internal error. Please report to %s", PACKAGE_BUGREPORT)</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">#define ppassure(condition, errc, action)                              \</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor">    cassure(condition, errc, action,                                   \</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor">       "Internal error (!(%s)). Please report to %s", \</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor">       #condition, \</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor">       PACKAGE_BUGREPORT)</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor">#define fors_msg(level, ...) fors_msg_macro(level, cpl_func, __VA_ARGS__)</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="preprocessor">#ifndef M_PI </span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="preprocessor"></span><span class="preprocessor">#define M_PI 3.1415926535897932384626433832795</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="preprocessor">#ifndef M_E</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="preprocessor"></span><span class="preprocessor">#define M_E  2.7182818284590452354</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="preprocessor">#define TWOSQRT2LN2 2.35482004503095</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">double</span> STDEV_PR_MAD;</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#gaf34da190cb639a584e5f2473de24d887" title="Issue a banner with the pipeline version.">fors_print_banner</a>(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87" title="Get the pipeline copyright and license.">fors_get_license</a>(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56" title="Pseudo-random gaussian distributed number.">fors_rand_gauss</a>(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#gac3759b058af73511a69998299a11a40f" title="Same as cpl_tools_get_kth_double.">fors_tools_get_kth_double</a>(<span class="keywordtype">double</span> *a, <span class="keywordtype">int</span> n, <span class="keywordtype">int</span> k);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044" title="Same as cpl_tools_get_kth_float.">fors_tools_get_kth_float</a>(<span class="keywordtype">float</span> *a, <span class="keywordtype">int</span> n, <span class="keywordtype">int</span> k);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#ga513ceb86672094a1d13a45d75e01782a" title="Unbiased median.">fors_tools_get_median_float</a>( <span class="keywordtype">float</span> *a, <span class="keywordtype">int</span> n);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="keywordtype">float</span> <a class="code" href="group__fors__utils.html#ga5de34c3a7ff32722bc68e1b3a67f3390" title="Biased median.">fors_tools_get_median_fast_float</a>(<span class="keywordtype">float</span> *a, <span class="keywordtype">int</span> n)  ;</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3" title="median stacking correction factor">fors_utils_median_corr</a>(<span class="keywordtype">int</span> n);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#ga414e1f2d95f271cc76a67e525b910e96" title="Print a frame set.">fors_frameset_print</a>(<span class="keyword">const</span> cpl_frameset *frames);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#ga6692a0ba541b3e7f99654f844aee40c6" title="Print a frame.">fors_frame_print</a>(<span class="keyword">const</span> cpl_frame *f);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__utils.html#gad97092a91b5de91f84039778596fd759" title="Get frame type as a string.">fors_frame_get_type_string</a>(<span class="keyword">const</span> cpl_frame *f);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__utils.html#ga3e2178bad7068e3768fc5f78b1d02490" title="Get frame group as a string.">fors_frame_get_group_string</a>(<span class="keyword">const</span> cpl_frame *f);</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__utils.html#ga82f1aaba039c880a3bff109f3729d74a" title="Get frame level as a string.">fors_frame_get_level_string</a>(<span class="keyword">const</span> cpl_frame *f);</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> cpl_frameset *<a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(<span class="keyword">const</span> cpl_frameset *frames,</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *tag);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd" title="Textual representation of CPL type.">fors_type_get_string</a>(cpl_type type);</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42" title="Set unset parameters to default value.">fors_parameterlist_set_defaults</a>(cpl_parameterlist *parlist);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="preprocessor">#ifdef CPL_IS_NOT_CRAP</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="preprocessor"></span><span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor"></span>cpl_image *<a class="code" href="group__fors__utils.html#gabb34a534e28308533f300ea11ec7a3a3" title="Workaround for cpl_imagelist_collapse_create.">fors_imagelist_collapse_create</a>(<span class="keyword">const</span> cpl_imagelist *ilist);</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> cpl_image *<a class="code" href="group__fors__utils.html#gaa55c5fd8ade8f10e441297c0cda96093" title="Workaround for cpl_imagelist_collapse_median_create.">fors_imagelist_collapse_median_create</a>(<span class="keyword">const</span> cpl_imagelist *ilist);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="keywordtype">double</span> <a class="code" href="group__fors__utils.html#ga69350709e5f9874601c729becd315e81" title="Difference between angles.">fors_angle_diff</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> *a1, <span class="keyword">const</span> <span class="keywordtype">double</span> *a2);</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__utils.html#gae98c540953f671b35817aac071aa4adc" title="Print message.">fors_msg_macro</a>(cpl_msg_severity level, <span class="keyword">const</span> <span class="keywordtype">char</span> *fct, <span class="keyword">const</span> <span class="keywordtype">char</span> *format, ...)</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="preprocessor">#ifdef __GNUC__</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="preprocessor"></span>__attribute__((format (printf, 3, 4)))</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> CPL_END_DECLS</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__wave__calib_8c-source.html b/html/fors__wave__calib_8c-source.html
deleted file mode 100644
index 4b0c56d..0000000
--- a/html/fors__wave__calib_8c-source.html
+++ /dev/null
@@ -1,893 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_wave_calib.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_wave_calib.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_wave_calib.c,v 1.7 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.7 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_wave_calib_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to wavelength calibrate MOS/MXU slit spectra contained\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"in the rectified arc lamp exposure produced with recipe fors_extract_slits.\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"A pattern-matching algorithm is applied as in recipe fors_detect_spectra.\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"The input spatial map is used in the production of the wavelength map.\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"Use recipe fors_wave_calib_lss for LSS data, or for MOS/MXU data where all\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"slits have the same offset. For more details on this data reduction strategy\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"please refer to the FORS Pipeline User's Manual.\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"Note that specifying an input GRISM_TABLE will set some of the recipe\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"configuration parameters to default values valid for a particular grism.\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS.\n\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  SPATIAL_MAP_MXU            Calib       Spatial map             Y\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"  RECTIFIED_LAMP_MXU         Calib       Rectified arc exposure  Y\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location table     Y\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      Y\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"  MASTER_LINECAT             Calib       Line catalog            Y\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"  REDUCED_LAMP_MXU           FITS image  Calibrated arc lamp exposure\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"  DISP_COEFF_MXU             FITS table  Inverse dispersion coefficients\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  DISP_RESIDUALS_MXU         FITS image  Image of modeling residuals\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  WAVELENGTH_MAP_MXU         FITS image  Wavelengths mapped on CCD\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"  SPECTRAL_RESOLUTION_MXU    FITS table  Spectral resolution table\n\n"</span>;
-<a name="l00071"></a>00071 
-<a name="l00072"></a>00072 <span class="preprocessor">#define fors_wave_calib_exit(message)         \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">{                                             \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_image_delete(spatial);                    \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_image_delete(residual);                   \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">cpl_table_delete(restab);                     \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">}</span>
-<a name="l00094"></a>00094 <span class="preprocessor"></span>
-<a name="l00095"></a>00095 <span class="preprocessor">#define fors_wave_calib_exit_memcheck(message)  \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">{                                               \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">cpl_image_delete(spectra);                      \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">printf("free spatial (%p)\n", spatial);         \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">cpl_image_delete(spatial);                      \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);         \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">cpl_image_delete(rainbow);                      \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">printf("free residual (%p)\n", residual);       \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">cpl_image_delete(residual);                     \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">printf("free rectified (%p)\n", rectified);     \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">cpl_image_delete(rectified);                    \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);         \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">cpl_image_delete(wavemap);                      \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">cpl_table_delete(grism_table);                  \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths); \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">cpl_table_delete(wavelengths);                  \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">cpl_table_delete(maskslits);                    \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);       \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">cpl_table_delete(idscoeff);                     \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">printf("free restab (%p)\n", restab);           \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">cpl_table_delete(restab);                       \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span>
-<a name="l00121"></a>00121 <span class="preprocessor">cpl_table_delete(slits);                        \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span>
-<a name="l00123"></a>00123 <span class="preprocessor">cpl_table_delete(polytraces);                   \</span>
-<a name="l00124"></a>00124 <span class="preprocessor">printf("free lines (%p)\n", lines);             \</span>
-<a name="l00125"></a>00125 <span class="preprocessor">cpl_vector_delete(lines);                       \</span>
-<a name="l00126"></a>00126 <span class="preprocessor">printf("free header (%p)\n", header);           \</span>
-<a name="l00127"></a>00127 <span class="preprocessor">cpl_propertylist_delete(header);                \</span>
-<a name="l00128"></a>00128 <span class="preprocessor">printf("free save_header (%p)\n", save_header); \</span>
-<a name="l00129"></a>00129 <span class="preprocessor">cpl_propertylist_delete(save_header);           \</span>
-<a name="l00130"></a>00130 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00131"></a>00131 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00132"></a>00132 <span class="preprocessor">}</span>
-<a name="l00133"></a>00133 <span class="preprocessor"></span>
-<a name="l00134"></a>00134 
-<a name="l00146"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00146</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00147"></a>00147 {
-<a name="l00148"></a>00148     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00149"></a>00149     cpl_plugin *plugin = &recipe->interface;
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     cpl_plugin_init(plugin,
-<a name="l00152"></a>00152                     CPL_PLUGIN_API,
-<a name="l00153"></a>00153                     FORS_BINARY_VERSION,
-<a name="l00154"></a>00154                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00155"></a>00155                     <span class="stringliteral">"fors_wave_calib"</span>,
-<a name="l00156"></a>00156                     <span class="stringliteral">"Derive dispersion relation from rectified arc lamp frame"</span>,
-<a name="l00157"></a>00157                     fors_wave_calib_description,
-<a name="l00158"></a>00158                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00159"></a>00159                     PACKAGE_BUGREPORT,
-<a name="l00160"></a>00160     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00161"></a>00161     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00162"></a>00162     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00163"></a>00163     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00164"></a>00164     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00165"></a>00165     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00166"></a>00166     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00167"></a>00167     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00168"></a>00168     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00169"></a>00169     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00170"></a>00170     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00171"></a>00171     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00172"></a>00172     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00173"></a>00173                     fors_wave_calib_create,
-<a name="l00174"></a>00174                     fors_wave_calib_exec,
-<a name="l00175"></a>00175                     fors_wave_calib_destroy);
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177     cpl_pluginlist_append(list, plugin);
-<a name="l00178"></a>00178     
-<a name="l00179"></a>00179     <span class="keywordflow">return</span> 0;
-<a name="l00180"></a>00180 }
-<a name="l00181"></a>00181 
-<a name="l00182"></a>00182 
-<a name="l00193"></a>00193 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_create(cpl_plugin *plugin)
-<a name="l00194"></a>00194 {
-<a name="l00195"></a>00195     cpl_recipe    *recipe;
-<a name="l00196"></a>00196     cpl_parameter *p;
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198     <span class="comment">/* </span>
-<a name="l00199"></a>00199 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00200"></a>00200 <span class="comment">     */</span>
-<a name="l00201"></a>00201 
-<a name="l00202"></a>00202     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00203"></a>00203         recipe = (cpl_recipe *)plugin;
-<a name="l00204"></a>00204     <span class="keywordflow">else</span> 
-<a name="l00205"></a>00205         <span class="keywordflow">return</span> -1;
-<a name="l00206"></a>00206 
-<a name="l00207"></a>00207     <span class="comment">/* </span>
-<a name="l00208"></a>00208 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00209"></a>00209 <span class="comment">     */</span>
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213     <span class="comment">/*</span>
-<a name="l00214"></a>00214 <span class="comment">     * Dispersion</span>
-<a name="l00215"></a>00215 <span class="comment">     */</span>
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.dispersion"</span>,
-<a name="l00218"></a>00218                                 CPL_TYPE_DOUBLE,
-<a name="l00219"></a>00219                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00220"></a>00220                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,
-<a name="l00221"></a>00221                                 0.0);
-<a name="l00222"></a>00222     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00223"></a>00223     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00224"></a>00224     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <span class="comment">/*</span>
-<a name="l00227"></a>00227 <span class="comment">     * Peak detection level</span>
-<a name="l00228"></a>00228 <span class="comment">     */</span>
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.peakdetection"</span>,
-<a name="l00231"></a>00231                                 CPL_TYPE_DOUBLE,
-<a name="l00232"></a>00232                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,
-<a name="l00233"></a>00233                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,
-<a name="l00234"></a>00234                                 0.0);
-<a name="l00235"></a>00235     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);
-<a name="l00236"></a>00236     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00237"></a>00237     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239     <span class="comment">/*</span>
-<a name="l00240"></a>00240 <span class="comment">     * Degree of wavelength calibration polynomial</span>
-<a name="l00241"></a>00241 <span class="comment">     */</span>
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.wdegree"</span>,
-<a name="l00244"></a>00244                                 CPL_TYPE_INT,
-<a name="l00245"></a>00245                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,
-<a name="l00246"></a>00246                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,
-<a name="l00247"></a>00247                                 0);
-<a name="l00248"></a>00248     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);
-<a name="l00249"></a>00249     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00250"></a>00250     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252     <span class="comment">/*</span>
-<a name="l00253"></a>00253 <span class="comment">     * Reference lines search radius</span>
-<a name="l00254"></a>00254 <span class="comment">     */</span>
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.wradius"</span>,
-<a name="l00257"></a>00257                                 CPL_TYPE_INT,
-<a name="l00258"></a>00258                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span>
-<a name="l00259"></a>00259                                 <span class="stringliteral">"with first-guess method"</span>,
-<a name="l00260"></a>00260                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,
-<a name="l00261"></a>00261                                 4);
-<a name="l00262"></a>00262     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);
-<a name="l00263"></a>00263     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00264"></a>00264     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266     <span class="comment">/*</span>
-<a name="l00267"></a>00267 <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span>
-<a name="l00268"></a>00268 <span class="comment">     */</span>
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.wreject"</span>,
-<a name="l00271"></a>00271                                 CPL_TYPE_DOUBLE,
-<a name="l00272"></a>00272                                 <span class="stringliteral">"Rejection threshold in dispersion "</span>
-<a name="l00273"></a>00273                                 <span class="stringliteral">"relation fit (pixel)"</span>,
-<a name="l00274"></a>00274                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,
-<a name="l00275"></a>00275                                 0.7);
-<a name="l00276"></a>00276     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);
-<a name="l00277"></a>00277     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00278"></a>00278     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00279"></a>00279 
-<a name="l00280"></a>00280     <span class="comment">/*</span>
-<a name="l00281"></a>00281 <span class="comment">     * Line catalog table column containing the reference wavelengths</span>
-<a name="l00282"></a>00282 <span class="comment">     */</span>
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.wcolumn"</span>,
-<a name="l00285"></a>00285                                 CPL_TYPE_STRING,
-<a name="l00286"></a>00286                                 <span class="stringliteral">"Name of line catalog table column "</span>
-<a name="l00287"></a>00287                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00288"></a>00288                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,
-<a name="l00289"></a>00289                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00290"></a>00290     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00291"></a>00291     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00292"></a>00292     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00293"></a>00293 
-<a name="l00294"></a>00294     <span class="comment">/*</span>
-<a name="l00295"></a>00295 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00296"></a>00296 <span class="comment">     */</span>
-<a name="l00297"></a>00297 
-<a name="l00298"></a>00298     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.startwavelength"</span>,
-<a name="l00299"></a>00299                                 CPL_TYPE_DOUBLE,
-<a name="l00300"></a>00300                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00301"></a>00301                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,
-<a name="l00302"></a>00302                                 0.0);
-<a name="l00303"></a>00303     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00304"></a>00304     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00305"></a>00305     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00306"></a>00306 
-<a name="l00307"></a>00307     <span class="comment">/*</span>
-<a name="l00308"></a>00308 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00309"></a>00309 <span class="comment">     */</span>
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.endwavelength"</span>,
-<a name="l00312"></a>00312                                 CPL_TYPE_DOUBLE,
-<a name="l00313"></a>00313                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00314"></a>00314                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,
-<a name="l00315"></a>00315                                 0.0);
-<a name="l00316"></a>00316     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00317"></a>00317     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00318"></a>00318     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00319"></a>00319 
-<a name="l00320"></a>00320     <span class="keywordflow">return</span> 0;
-<a name="l00321"></a>00321 }
-<a name="l00322"></a>00322 
-<a name="l00323"></a>00323 
-<a name="l00332"></a>00332 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_exec(cpl_plugin *plugin)
-<a name="l00333"></a>00333 {
-<a name="l00334"></a>00334     cpl_recipe *recipe;
-<a name="l00335"></a>00335     
-<a name="l00336"></a>00336     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00337"></a>00337         recipe = (cpl_recipe *)plugin;
-<a name="l00338"></a>00338     <span class="keywordflow">else</span> 
-<a name="l00339"></a>00339         <span class="keywordflow">return</span> -1;
-<a name="l00340"></a>00340 
-<a name="l00341"></a>00341     <span class="keywordflow">return</span> fors_wave_calib(recipe->parameters, recipe->frames);
-<a name="l00342"></a>00342 }
-<a name="l00343"></a>00343 
-<a name="l00344"></a>00344 
-<a name="l00353"></a>00353 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_destroy(cpl_plugin *plugin)
-<a name="l00354"></a>00354 {
-<a name="l00355"></a>00355     cpl_recipe *recipe;
-<a name="l00356"></a>00356     
-<a name="l00357"></a>00357     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00358"></a>00358         recipe = (cpl_recipe *)plugin;
-<a name="l00359"></a>00359     <span class="keywordflow">else</span> 
-<a name="l00360"></a>00360         <span class="keywordflow">return</span> -1;
-<a name="l00361"></a>00361 
-<a name="l00362"></a>00362     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364     <span class="keywordflow">return</span> 0;
-<a name="l00365"></a>00365 }
-<a name="l00366"></a>00366 
-<a name="l00367"></a>00367 
-<a name="l00377"></a>00377 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib(cpl_parameterlist *parlist, 
-<a name="l00378"></a>00378                                cpl_frameset *frameset)
-<a name="l00379"></a>00379 {
-<a name="l00380"></a>00380 
-<a name="l00381"></a>00381     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_wave_calib"</span>;
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383 
-<a name="l00384"></a>00384     <span class="comment">/*</span>
-<a name="l00385"></a>00385 <span class="comment">     * Input parameters</span>
-<a name="l00386"></a>00386 <span class="comment">     */</span>
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388     <span class="keywordtype">double</span>      dispersion;
-<a name="l00389"></a>00389     <span class="keywordtype">double</span>      peakdetection;
-<a name="l00390"></a>00390     <span class="keywordtype">int</span>         wdegree;
-<a name="l00391"></a>00391     <span class="keywordtype">int</span>         wradius;
-<a name="l00392"></a>00392     <span class="keywordtype">double</span>      wreject;
-<a name="l00393"></a>00393     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00394"></a>00394     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00395"></a>00395     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397     <span class="comment">/*</span>
-<a name="l00398"></a>00398 <span class="comment">     * CPL objects</span>
-<a name="l00399"></a>00399 <span class="comment">     */</span>
-<a name="l00400"></a>00400 
-<a name="l00401"></a>00401     cpl_image        *spectra     = NULL;
-<a name="l00402"></a>00402     cpl_image        *spatial     = NULL;
-<a name="l00403"></a>00403     cpl_image        *rectified   = NULL;
-<a name="l00404"></a>00404     cpl_image        *wavemap     = NULL;
-<a name="l00405"></a>00405     cpl_image        *rainbow     = NULL;
-<a name="l00406"></a>00406     cpl_image        *residual    = NULL;
-<a name="l00407"></a>00407     cpl_image        *bimage      = NULL;
-<a name="l00408"></a>00408     cpl_table        *grism_table = NULL;
-<a name="l00409"></a>00409     cpl_table        *wavelengths = NULL;
-<a name="l00410"></a>00410     cpl_table        *slits       = NULL;
-<a name="l00411"></a>00411     cpl_table        *polytraces  = NULL;
-<a name="l00412"></a>00412     cpl_table        *idscoeff    = NULL;
-<a name="l00413"></a>00413     cpl_table        *maskslits   = NULL;
-<a name="l00414"></a>00414     cpl_table        *restab      = NULL;
-<a name="l00415"></a>00415     cpl_vector       *lines       = NULL;
-<a name="l00416"></a>00416     cpl_propertylist *header      = NULL;
-<a name="l00417"></a>00417     cpl_propertylist *save_header = NULL;
-<a name="l00418"></a>00418 
-<a name="l00419"></a>00419     <span class="comment">/*</span>
-<a name="l00420"></a>00420 <span class="comment">     * Auxiliary variables</span>
-<a name="l00421"></a>00421 <span class="comment">     */</span>
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423     <span class="keywordtype">char</span>        version[80];
-<a name="l00424"></a>00424     <span class="keyword">const</span> <span class="keywordtype">char</span> *arc_tag;
-<a name="l00425"></a>00425     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_lamp_tag;
-<a name="l00426"></a>00426     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_tag;
-<a name="l00427"></a>00427     <span class="keyword">const</span> <span class="keywordtype">char</span> *spatial_map_tag;
-<a name="l00428"></a>00428     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_residuals_tag;
-<a name="l00429"></a>00429     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;
-<a name="l00430"></a>00430     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;
-<a name="l00431"></a>00431     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00432"></a>00432     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectral_resolution_tag;
-<a name="l00433"></a>00433     <span class="keywordtype">int</span>         lamp_mxu;
-<a name="l00434"></a>00434     <span class="keywordtype">int</span>         lamp_mos;
-<a name="l00435"></a>00435     <span class="keywordtype">int</span>         mxu, mos;
-<a name="l00436"></a>00436     <span class="keywordtype">int</span>         treat_as_lss = 0;
-<a name="l00437"></a>00437     <span class="keywordtype">int</span>         nslits;
-<a name="l00438"></a>00438     <span class="keywordtype">double</span>      mean_rms;
-<a name="l00439"></a>00439     <span class="keywordtype">double</span>     *xpos;
-<a name="l00440"></a>00440     <span class="keywordtype">double</span>      mxpos;
-<a name="l00441"></a>00441     <span class="keywordtype">int</span>         narc, nref;
-<a name="l00442"></a>00442     <span class="keywordtype">int</span>         nlines;
-<a name="l00443"></a>00443     <span class="keywordtype">int</span>         rebin;
-<a name="l00444"></a>00444     <span class="keywordtype">double</span>     *line;
-<a name="l00445"></a>00445     <span class="keywordtype">double</span>     *fiterror = NULL;
-<a name="l00446"></a>00446     <span class="keywordtype">int</span>        *fitlines = NULL;
-<a name="l00447"></a>00447     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00448"></a>00448     <span class="keywordtype">double</span>      reference;
-<a name="l00449"></a>00449     <span class="keywordtype">int</span>         i;
-<a name="l00450"></a>00450     <span class="keywordtype">int</span>         nslits_out_det = 0;
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452 
-<a name="l00453"></a>00453     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00454"></a>00454 
-<a name="l00455"></a>00455 
-<a name="l00456"></a>00456     cpl_msg_set_indentation(2);
-<a name="l00457"></a>00457 
-<a name="l00458"></a>00458     <span class="comment">/*</span>
-<a name="l00459"></a>00459 <span class="comment">     * Get configuration parameters</span>
-<a name="l00460"></a>00460 <span class="comment">     */</span>
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00463"></a>00463     cpl_msg_indent_more();
-<a name="l00464"></a>00464     
-<a name="l00465"></a>00465     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00466"></a>00466         fors_wave_calib_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); 
-<a name="l00467"></a>00467 
-<a name="l00468"></a>00468     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00469"></a>00469 
-<a name="l00470"></a>00470     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00471"></a>00471                     <span class="stringliteral">"fors.fors_wave_calib.dispersion"</span>, grism_table);
-<a name="l00472"></a>00472 
-<a name="l00473"></a>00473     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00474"></a>00474         fors_wave_calib_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476     peakdetection = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00477"></a>00477                     <span class="stringliteral">"fors.fors_wave_calib.peakdetection"</span>, grism_table);
-<a name="l00478"></a>00478     <span class="keywordflow">if</span> (peakdetection <= 0.0)
-<a name="l00479"></a>00479         fors_wave_calib_exit(<span class="stringliteral">"Invalid peak detection level"</span>);
-<a name="l00480"></a>00480 
-<a name="l00481"></a>00481     wdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00482"></a>00482                     <span class="stringliteral">"fors.fors_wave_calib.wdegree"</span>, grism_table);
-<a name="l00483"></a>00483 
-<a name="l00484"></a>00484     <span class="keywordflow">if</span> (wdegree < 1)
-<a name="l00485"></a>00485         fors_wave_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00486"></a>00486 
-<a name="l00487"></a>00487     <span class="keywordflow">if</span> (wdegree > 5)
-<a name="l00488"></a>00488         fors_wave_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00489"></a>00489 
-<a name="l00490"></a>00490     wradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00491"></a>00491                                     <span class="stringliteral">"fors.fors_wave_calib.wradius"</span>, NULL);
-<a name="l00492"></a>00492 
-<a name="l00493"></a>00493     <span class="keywordflow">if</span> (wradius < 0)
-<a name="l00494"></a>00494         fors_wave_calib_exit(<span class="stringliteral">"Invalid search radius"</span>);
-<a name="l00495"></a>00495 
-<a name="l00496"></a>00496     wreject = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00497"></a>00497                                     <span class="stringliteral">"fors.fors_wave_calib.wreject"</span>, NULL);
-<a name="l00498"></a>00498 
-<a name="l00499"></a>00499     <span class="keywordflow">if</span> (wreject <= 0.0)
-<a name="l00500"></a>00500         fors_wave_calib_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);
-<a name="l00501"></a>00501 
-<a name="l00502"></a>00502     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00503"></a>00503                                     <span class="stringliteral">"fors.fors_wave_calib.wcolumn"</span>, NULL);
-<a name="l00504"></a>00504 
-<a name="l00505"></a>00505     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00506"></a>00506                     <span class="stringliteral">"fors.fors_wave_calib.startwavelength"</span>, grism_table);
-<a name="l00507"></a>00507     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00508"></a>00508         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00509"></a>00509             fors_wave_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00512"></a>00512                     <span class="stringliteral">"fors.fors_wave_calib.endwavelength"</span>, grism_table);
-<a name="l00513"></a>00513     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00514"></a>00514         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00515"></a>00515             fors_wave_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00516"></a>00516         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00517"></a>00517             fors_wave_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00518"></a>00518     }
-<a name="l00519"></a>00519 
-<a name="l00520"></a>00520     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00521"></a>00521         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00522"></a>00522             fors_wave_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00523"></a>00523 
-<a name="l00524"></a>00524     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00527"></a>00527         fors_wave_calib_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);
-<a name="l00528"></a>00528 
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530     cpl_msg_indent_less();
-<a name="l00531"></a>00531     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00532"></a>00532     cpl_msg_indent_more();
-<a name="l00533"></a>00533 
-<a name="l00534"></a>00534     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)
-<a name="l00535"></a>00535         fors_wave_calib_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);
-<a name="l00536"></a>00536 
-<a name="l00537"></a>00537     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)
-<a name="l00538"></a>00538         fors_wave_calib_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);
-<a name="l00539"></a>00539 
-<a name="l00540"></a>00540     lamp_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_LAMP_MXU"</span>);
-<a name="l00541"></a>00541     lamp_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_LAMP_MOS"</span>);
-<a name="l00542"></a>00542 
-<a name="l00543"></a>00543     narc = lamp_mxu + lamp_mos;
-<a name="l00544"></a>00544 
-<a name="l00545"></a>00545     <span class="keywordflow">if</span> (narc == 0) {
-<a name="l00546"></a>00546         fors_wave_calib_exit(<span class="stringliteral">"Missing input rectified arc lamp frame"</span>);
-<a name="l00547"></a>00547     }
-<a name="l00548"></a>00548     <span class="keywordflow">if</span> (narc > 1) {
-<a name="l00549"></a>00549         cpl_msg_error(recipe, <span class="stringliteral">"Too many input rectified arc lamp frames "</span>
-<a name="l00550"></a>00550                       <span class="stringliteral">"(%d > 1)"</span>, narc);
-<a name="l00551"></a>00551         fors_wave_calib_exit(NULL);
-<a name="l00552"></a>00552     }
-<a name="l00553"></a>00553 
-<a name="l00554"></a>00554     mxu = mos = 0;
-<a name="l00555"></a>00555 
-<a name="l00556"></a>00556     <span class="keywordflow">if</span> (lamp_mxu) {
-<a name="l00557"></a>00557         mxu = 1;
-<a name="l00558"></a>00558         arc_tag                 = <span class="stringliteral">"RECTIFIED_LAMP_MXU"</span>;
-<a name="l00559"></a>00559         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00560"></a>00560         spatial_map_tag         = <span class="stringliteral">"SPATIAL_MAP_MXU"</span>;
-<a name="l00561"></a>00561         reduced_lamp_tag        = <span class="stringliteral">"REDUCED_LAMP_MXU"</span>;
-<a name="l00562"></a>00562         disp_residuals_tag      = <span class="stringliteral">"DISP_RESIDUALS_MXU"</span>;
-<a name="l00563"></a>00563         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MXU"</span>;
-<a name="l00564"></a>00564         curv_coeff_tag          = <span class="stringliteral">"CURV_COEFF_MXU"</span>;
-<a name="l00565"></a>00565         wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_MXU"</span>;
-<a name="l00566"></a>00566         spectral_resolution_tag = <span class="stringliteral">"SPECTRAL_RESOLUTION_MXU"</span>;
-<a name="l00567"></a>00567     }
-<a name="l00568"></a>00568     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_mos) {
-<a name="l00569"></a>00569         mos = 1;
-<a name="l00570"></a>00570         arc_tag                 = <span class="stringliteral">"RECTIFIED_LAMP_MOS"</span>;
-<a name="l00571"></a>00571         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00572"></a>00572         spatial_map_tag         = <span class="stringliteral">"SPATIAL_MAP_MOS"</span>;
-<a name="l00573"></a>00573         reduced_lamp_tag        = <span class="stringliteral">"REDUCED_LAMP_MOS"</span>;
-<a name="l00574"></a>00574         disp_residuals_tag      = <span class="stringliteral">"DISP_RESIDUALS_MOS"</span>;
-<a name="l00575"></a>00575         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MOS"</span>;
-<a name="l00576"></a>00576         curv_coeff_tag          = <span class="stringliteral">"CURV_COEFF_MXU"</span>;
-<a name="l00577"></a>00577         wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_MOS"</span>;
-<a name="l00578"></a>00578         spectral_resolution_tag = <span class="stringliteral">"SPECTRAL_RESOLUTION_MOS"</span>;
-<a name="l00579"></a>00579     }
-<a name="l00580"></a>00580 
-<a name="l00581"></a>00581 
-<a name="l00582"></a>00582     nref = cpl_frameset_count_tags(frameset, spatial_map_tag);
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584     <span class="keywordflow">if</span> (nref == 0) {
-<a name="l00585"></a>00585         fors_wave_calib_exit(<span class="stringliteral">"Missing input spatial map"</span>);
-<a name="l00586"></a>00586     }
-<a name="l00587"></a>00587     <span class="keywordflow">if</span> (nref > 1) {
-<a name="l00588"></a>00588         cpl_msg_error(recipe, <span class="stringliteral">"Too many input spatial maps (%d > 1)"</span>, nref);
-<a name="l00589"></a>00589         fors_wave_calib_exit(NULL);
-<a name="l00590"></a>00590     }
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     nref = cpl_frameset_count_tags(frameset, slit_location_tag);
-<a name="l00593"></a>00593 
-<a name="l00594"></a>00594     <span class="keywordflow">if</span> (nref == 0) {
-<a name="l00595"></a>00595         fors_wave_calib_exit(<span class="stringliteral">"Missing input slit location table"</span>);
-<a name="l00596"></a>00596     }
-<a name="l00597"></a>00597     <span class="keywordflow">if</span> (nref > 1) {
-<a name="l00598"></a>00598         cpl_msg_error(recipe, <span class="stringliteral">"Too many input slit location tables (%d > 1)"</span>, 
-<a name="l00599"></a>00599                       nref);
-<a name="l00600"></a>00600         fors_wave_calib_exit(NULL);
-<a name="l00601"></a>00601     }
-<a name="l00602"></a>00602 
-<a name="l00603"></a>00603     nref = cpl_frameset_count_tags(frameset, curv_coeff_tag);
-<a name="l00604"></a>00604 
-<a name="l00605"></a>00605     <span class="keywordflow">if</span> (nref == 0) {
-<a name="l00606"></a>00606         fors_wave_calib_exit(<span class="stringliteral">"Missing input spectral curvature table"</span>);
-<a name="l00607"></a>00607     }
-<a name="l00608"></a>00608     <span class="keywordflow">if</span> (nref > 1) {
-<a name="l00609"></a>00609         cpl_msg_error(recipe, <span class="stringliteral">"Too many input spectral curvature tables "</span>
-<a name="l00610"></a>00610                       <span class="stringliteral">"(%d > 1)"</span>, nref);
-<a name="l00611"></a>00611         fors_wave_calib_exit(NULL);
-<a name="l00612"></a>00612     }
-<a name="l00613"></a>00613 
-<a name="l00614"></a>00614 
-<a name="l00615"></a>00615     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00616"></a>00616         fors_wave_calib_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00617"></a>00617 
-<a name="l00618"></a>00618     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00619"></a>00619         fors_wave_calib_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00620"></a>00620 
-<a name="l00621"></a>00621     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00622"></a>00622         fors_wave_calib_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00623"></a>00623 
-<a name="l00624"></a>00624 
-<a name="l00625"></a>00625     <span class="comment">/*</span>
-<a name="l00626"></a>00626 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00627"></a>00627 <span class="comment">     * dispersion direction from the arc lamp exposure</span>
-<a name="l00628"></a>00628 <span class="comment">     */</span>
-<a name="l00629"></a>00629 
-<a name="l00630"></a>00630     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, spatial_map_tag, 0);
-<a name="l00631"></a>00631 
-<a name="l00632"></a>00632     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00633"></a>00633         fors_wave_calib_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);
-<a name="l00634"></a>00634 
-<a name="l00635"></a>00635     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00636"></a>00636     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00637"></a>00637         fors_wave_calib_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00640"></a>00640         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00641"></a>00641     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00642"></a>00642         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00645"></a>00645 
-<a name="l00646"></a>00646     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00647"></a>00647         fors_wave_calib_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span>
-<a name="l00648"></a>00648                                  <span class="stringliteral">"in arc lamp frame header"</span>);
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l00651"></a>00651         reference *= 10;
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l00654"></a>00654         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l00655"></a>00655                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in arc lamp frame header"</span>,
-<a name="l00656"></a>00656                       reference);
-<a name="l00657"></a>00657         fors_wave_calib_exit(NULL);
-<a name="l00658"></a>00658     }
-<a name="l00659"></a>00659 
-<a name="l00660"></a>00660     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l00661"></a>00661 
-<a name="l00662"></a>00662     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00663"></a>00663 
-<a name="l00664"></a>00664     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00665"></a>00665         fors_wave_calib_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00666"></a>00666                                  <span class="stringliteral">"in arc lamp frame header"</span>);
-<a name="l00667"></a>00667 
-<a name="l00668"></a>00668     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l00669"></a>00669         dispersion *= rebin;
-<a name="l00670"></a>00670         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l00671"></a>00671                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,
-<a name="l00672"></a>00672                         dispersion);
-<a name="l00673"></a>00673     }
-<a name="l00674"></a>00674 
-<a name="l00675"></a>00675 
-<a name="l00676"></a>00676     cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);
-<a name="l00677"></a>00677 
-<a name="l00678"></a>00678     <span class="keywordflow">if</span> (mos)
-<a name="l00679"></a>00679         maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00680"></a>00680     <span class="keywordflow">else</span>
-<a name="l00681"></a>00681         maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00682"></a>00682 
-<a name="l00683"></a>00683 
-<a name="l00684"></a>00684     <span class="comment">/*</span>
-<a name="l00685"></a>00685 <span class="comment">     * Check if all slits have the same X offset: in such case,</span>
-<a name="l00686"></a>00686 <span class="comment">     * treat the observation as a long-slit one!</span>
-<a name="l00687"></a>00687 <span class="comment">     */</span>
-<a name="l00688"></a>00688 
-<a name="l00689"></a>00689     treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l00690"></a>00690 
-<a name="l00691"></a>00691     cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00692"></a>00692 
-<a name="l00693"></a>00693     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00694"></a>00694         cpl_msg_error(recipe, <span class="stringliteral">"All slits have the same offset: %.2f mm\n"</span>
-<a name="l00695"></a>00695                       <span class="stringliteral">"The LSS data reduction strategy must be applied: "</span>
-<a name="l00696"></a>00696                       <span class="stringliteral">"please use recipe fors_wave_calib_lss"</span>, mxpos);
-<a name="l00697"></a>00697         fors_wave_calib_exit(NULL);
-<a name="l00698"></a>00698     }
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700 
-<a name="l00701"></a>00701     cpl_msg_indent_less();
-<a name="l00702"></a>00702     cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);
-<a name="l00703"></a>00703     cpl_msg_indent_more();
-<a name="l00704"></a>00704 
-<a name="l00705"></a>00705     spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00706"></a>00706 
-<a name="l00707"></a>00707     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00708"></a>00708         fors_wave_calib_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);
-<a name="l00709"></a>00709 
-<a name="l00710"></a>00710 
-<a name="l00711"></a>00711     cpl_msg_indent_less();
-<a name="l00712"></a>00712     cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);
-<a name="l00713"></a>00713     cpl_msg_indent_more();
-<a name="l00714"></a>00714 
-<a name="l00715"></a>00715     wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>, 1);
-<a name="l00716"></a>00716 
-<a name="l00717"></a>00717     <span class="keywordflow">if</span> (wavelengths == NULL)
-<a name="l00718"></a>00718         fors_wave_calib_exit(<span class="stringliteral">"Cannot load line catalog"</span>);
-<a name="l00719"></a>00719 
-<a name="l00720"></a>00720 
-<a name="l00721"></a>00721     <span class="comment">/*</span>
-<a name="l00722"></a>00722 <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l00723"></a>00723 <span class="comment">     */</span>
-<a name="l00724"></a>00724 
-<a name="l00725"></a>00725     nlines = cpl_table_get_nrow(wavelengths);
-<a name="l00726"></a>00726 
-<a name="l00727"></a>00727     <span class="keywordflow">if</span> (nlines == 0)
-<a name="l00728"></a>00728         fors_wave_calib_exit(<span class="stringliteral">"Empty input line catalog"</span>);
-<a name="l00729"></a>00729 
-<a name="l00730"></a>00730     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l00731"></a>00731         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,
-<a name="l00732"></a>00732                       wcolumn);
-<a name="l00733"></a>00733         fors_wave_calib_exit(NULL);
-<a name="l00734"></a>00734     }
-<a name="l00735"></a>00735 
-<a name="l00736"></a>00736     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00737"></a>00737 
-<a name="l00738"></a>00738     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l00739"></a>00739         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l00740"></a>00740 
-<a name="l00741"></a>00741     cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l00742"></a>00742 
-<a name="l00743"></a>00743     lines = cpl_vector_wrap(nlines, line);
-<a name="l00744"></a>00744 
-<a name="l00745"></a>00745 
-<a name="l00746"></a>00746     cpl_msg_indent_less();
-<a name="l00747"></a>00747     cpl_msg_info(recipe, <span class="stringliteral">"Load slit location table..."</span>);
-<a name="l00748"></a>00748     cpl_msg_indent_more();
-<a name="l00749"></a>00749 
-<a name="l00750"></a>00750     slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l00751"></a>00751 
-<a name="l00752"></a>00752     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00753"></a>00753         fors_wave_calib_exit(<span class="stringliteral">"Cannot load slit location table"</span>);
-<a name="l00754"></a>00754 
-<a name="l00755"></a>00755 
-<a name="l00756"></a>00756     cpl_msg_indent_less();
-<a name="l00757"></a>00757     cpl_msg_info(recipe, <span class="stringliteral">"Subtract background from input arc exposure..."</span>);
-<a name="l00758"></a>00758     cpl_msg_indent_more();
-<a name="l00759"></a>00759 
-<a name="l00760"></a>00760     bimage = <a class="code" href="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a">mos_arc_background</a>(spectra, 15, 15);
-<a name="l00761"></a>00761     cpl_image_subtract(spectra, bimage);
-<a name="l00762"></a>00762     cpl_image_delete(bimage);
-<a name="l00763"></a>00763 
-<a name="l00764"></a>00764 
-<a name="l00765"></a>00765     cpl_msg_indent_less();
-<a name="l00766"></a>00766     cpl_msg_info(recipe, <span class="stringliteral">"Perform wavelength calibration..."</span>);
-<a name="l00767"></a>00767     cpl_msg_indent_more();
-<a name="l00768"></a>00768 
-<a name="l00769"></a>00769     nx = cpl_image_get_size_x(spectra);
-<a name="l00770"></a>00770     ny = cpl_image_get_size_y(spectra);
-<a name="l00771"></a>00771 
-<a name="l00772"></a>00772     idscoeff = cpl_table_new(ny);
-<a name="l00773"></a>00773     rainbow  = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l00774"></a>00774     residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l00775"></a>00775     fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00776"></a>00776     fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l00777"></a>00777 
-<a name="l00778"></a>00778     rectified = <a class="code" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final</a>(spectra, slits, lines, 
-<a name="l00779"></a>00779                                                  dispersion, peakdetection,
-<a name="l00780"></a>00780                                                  wradius, wdegree, wreject,
-<a name="l00781"></a>00781                                                  reference, &startwavelength,
-<a name="l00782"></a>00782                                                  &endwavelength, fitlines,
-<a name="l00783"></a>00783                                                  fiterror, idscoeff, rainbow,
-<a name="l00784"></a>00784                                                  residual, NULL);
-<a name="l00785"></a>00785 
-<a name="l00786"></a>00786     cpl_image_delete(spectra); spectra = NULL;
-<a name="l00787"></a>00787 
-<a name="l00788"></a>00788     <span class="keywordflow">if</span> (rectified == NULL)
-<a name="l00789"></a>00789         fors_wave_calib_exit(<span class="stringliteral">"Wavelength calibration failure"</span>);
-<a name="l00790"></a>00790 
-<a name="l00791"></a>00791     save_header = cpl_propertylist_new();
-<a name="l00792"></a>00792     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l00793"></a>00793     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l00794"></a>00794     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l00795"></a>00795                                    startwavelength + dispersion/2);
-<a name="l00796"></a>00796     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l00797"></a>00797     <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT1", dispersion);</span>
-<a name="l00798"></a>00798 <span class="comment">    cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span>
-<a name="l00799"></a>00799     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l00800"></a>00800     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l00801"></a>00801     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l00802"></a>00802     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l00803"></a>00803     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l00804"></a>00804     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l00805"></a>00805     cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, 1);
-<a name="l00806"></a>00806 
-<a name="l00807"></a>00807     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, rectified, reduced_lamp_tag, save_header,
-<a name="l00808"></a>00808                        parlist, recipe, version))
-<a name="l00809"></a>00809         fors_wave_calib_exit(NULL);
-<a name="l00810"></a>00810 
-<a name="l00811"></a>00811     cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l00812"></a>00812     save_header = cpl_propertylist_new();
-<a name="l00813"></a>00813 
-<a name="l00814"></a>00814     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l00815"></a>00815     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l00816"></a>00816     <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span>
-<a name="l00817"></a>00817     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, 1.0);
-<a name="l00818"></a>00818     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l00819"></a>00819     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l00820"></a>00820     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l00821"></a>00821     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l00822"></a>00822     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l00823"></a>00823 
-<a name="l00824"></a>00824     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, residual, disp_residuals_tag, save_header,
-<a name="l00825"></a>00825                        parlist, recipe, version))
-<a name="l00826"></a>00826         fors_wave_calib_exit(NULL);
-<a name="l00827"></a>00827 
-<a name="l00828"></a>00828     cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l00829"></a>00829     cpl_image_delete(residual); residual = NULL;
-<a name="l00830"></a>00830 
-<a name="l00831"></a>00831     cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;
-<a name="l00832"></a>00832     cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l00833"></a>00833     cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;
-<a name="l00834"></a>00834 
-<a name="l00835"></a>00835     <span class="keywordflow">for</span> (i = 0; i < ny; i++)
-<a name="l00836"></a>00836         <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))
-<a name="l00837"></a>00837             cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);
-<a name="l00838"></a>00838 
-<a name="l00839"></a>00839     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_coeff_tag, NULL,
-<a name="l00840"></a>00840                        parlist, recipe, version))
-<a name="l00841"></a>00841         fors_wave_calib_exit(NULL);
-<a name="l00842"></a>00842 
-<a name="l00843"></a>00843     mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(rectified, lines, startwavelength,
-<a name="l00844"></a>00844                                    dispersion, 6, 0);
-<a name="l00845"></a>00845 
-<a name="l00846"></a>00846     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f pixel"</span>, mean_rms);
-<a name="l00847"></a>00847 
-<a name="l00848"></a>00848     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l00849"></a>00849 
-<a name="l00850"></a>00850     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,
-<a name="l00851"></a>00851                  mean_rms, mean_rms * dispersion);
-<a name="l00852"></a>00852 
-<a name="l00853"></a>00853     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l00854"></a>00854 
-<a name="l00855"></a>00855     <span class="comment">/*</span>
-<a name="l00856"></a>00856 <span class="comment">     * Create resolution table</span>
-<a name="l00857"></a>00857 <span class="comment">     */</span>
-<a name="l00858"></a>00858 
-<a name="l00859"></a>00859     restab = <a class="code" href="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55">mos_resolution_table</a>(rectified, startwavelength, dispersion,
-<a name="l00860"></a>00860                                   60000, lines);
-<a name="l00861"></a>00861 
-<a name="l00862"></a>00862     cpl_vector_delete(lines); lines = NULL;
-<a name="l00863"></a>00863     cpl_image_delete(rectified); rectified = NULL;
-<a name="l00864"></a>00864 
-<a name="l00865"></a>00865     <span class="keywordflow">if</span> (restab) {
-<a name="l00866"></a>00866         cpl_msg_info(recipe, <span class="stringliteral">"Mean spectral resolution: %.2f"</span>,
-<a name="l00867"></a>00867                    cpl_table_get_column_mean(restab, <span class="stringliteral">"resolution"</span>));
-<a name="l00868"></a>00868         cpl_msg_info(recipe, <span class="stringliteral">"Mean reference lines FWHM: %.2f +/- %.2f pixel"</span>,
-<a name="l00869"></a>00869                    cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm"</span>) / dispersion,
-<a name="l00870"></a>00870                    cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm_rms"</span>) / dispersion);
-<a name="l00871"></a>00871 
-<a name="l00872"></a>00872         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, restab, spectral_resolution_tag, NULL,
-<a name="l00873"></a>00873                            parlist, recipe, version))
-<a name="l00874"></a>00874             fors_wave_calib_exit(NULL);
-<a name="l00875"></a>00875 
-<a name="l00876"></a>00876         cpl_table_delete(restab); restab = NULL;
-<a name="l00877"></a>00877     }
-<a name="l00878"></a>00878     <span class="keywordflow">else</span>
-<a name="l00879"></a>00879         fors_wave_calib_exit(<span class="stringliteral">"Cannot compute the spectral resolution table"</span>);
-<a name="l00880"></a>00880 
-<a name="l00881"></a>00881 
-<a name="l00882"></a>00882     cpl_msg_indent_less();
-<a name="l00883"></a>00883     cpl_msg_info(recipe, <span class="stringliteral">"Load spatial map image..."</span>);
-<a name="l00884"></a>00884     cpl_msg_indent_more();
-<a name="l00885"></a>00885 
-<a name="l00886"></a>00886     spatial = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, spatial_map_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00887"></a>00887 
-<a name="l00888"></a>00888     <span class="keywordflow">if</span> (spatial == NULL)
-<a name="l00889"></a>00889         fors_wave_calib_exit(<span class="stringliteral">"Cannot load spatial map"</span>);
-<a name="l00890"></a>00890 
-<a name="l00891"></a>00891     cpl_msg_indent_less();
-<a name="l00892"></a>00892     cpl_msg_info(recipe, <span class="stringliteral">"Load spectral curvature table..."</span>);
-<a name="l00893"></a>00893     cpl_msg_indent_more();
-<a name="l00894"></a>00894 
-<a name="l00895"></a>00895     polytraces = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, curv_coeff_tag, 1);
-<a name="l00896"></a>00896 
-<a name="l00897"></a>00897     <span class="keywordflow">if</span> (polytraces == NULL)
-<a name="l00898"></a>00898         fors_wave_calib_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);
-<a name="l00899"></a>00899 
-<a name="l00900"></a>00900     wavemap = <a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(spatial, rainbow, slits, polytraces,
-<a name="l00901"></a>00901                                   reference, startwavelength, endwavelength,
-<a name="l00902"></a>00902                                   dispersion);
-<a name="l00903"></a>00903 
-<a name="l00904"></a>00904     cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l00905"></a>00905     cpl_image_delete(spatial); spatial = NULL;
-<a name="l00906"></a>00906     cpl_table_delete(slits); slits = NULL;
-<a name="l00907"></a>00907     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l00908"></a>00908 
-<a name="l00909"></a>00909     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, wavemap, wavelength_map_tag, header,
-<a name="l00910"></a>00910                        parlist, recipe, version))
-<a name="l00911"></a>00911         fors_wave_calib_exit(NULL);
-<a name="l00912"></a>00912 
-<a name="l00913"></a>00913     cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l00914"></a>00914     cpl_propertylist_delete(header); header = NULL;
-<a name="l00915"></a>00915 
-<a name="l00916"></a>00916     <span class="keywordflow">return</span> 0;
-<a name="l00917"></a>00917 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__wave__calib_8c_source.html b/html/fors__wave__calib_8c_source.html
new file mode 100644
index 0000000..04da771
--- /dev/null
+++ b/html/fors__wave__calib_8c_source.html
@@ -0,0 +1,929 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_wave_calib.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_wave_calib.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_wave_calib.c,v 1.9 2013-08-20 17:02:58 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-20 17:02:58 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.9 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_wave_calib_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to wavelength calibrate MOS/MXU slit spectra contained\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"in the rectified arc lamp exposure produced with recipe fors_extract_slits.\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"A pattern-matching algorithm is applied as in recipe fors_detect_spectra.\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"The input spatial map is used in the production of the wavelength map.\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"Use recipe fors_wave_calib_lss for LSS data, or for MOS/MXU data where all\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"slits have the same offset. For more details on this data reduction strategy\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"please refer to the FORS Pipeline User's Manual.\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"Note that specifying an input GRISM_TABLE will set some of the recipe\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"configuration parameters to default values valid for a particular grism.\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"In the table below the MXU acronym can be alternatively read as MOS.\n\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  SPATIAL_MAP_MXU            Calib       Spatial map             Y\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"  RECTIFIED_LAMP_MXU         Calib       Rectified arc exposure  Y\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"  SLIT_LOCATION_MXU          Calib       Slit location table     Y\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"  CURV_COEFF_MXU             Calib       Spectral curvature      Y\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"  MASTER_LINECAT             Calib       Line catalog            Y\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"  REDUCED_LAMP_MXU           FITS image  Calibrated arc lamp exposure\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"  DISP_COEFF_MXU             FITS table  Inverse dispersion coefficients\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  DISP_RESIDUALS_MXU         FITS image  Image of modeling residuals\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  WAVELENGTH_MAP_MXU         FITS image  Wavelengths mapped on CCD\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"  SPECTRAL_RESOLUTION_MXU    FITS table  Spectral resolution table\n\n"</span>;</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">#define fors_wave_calib_exit(message)         \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_image_delete(spatial);                    \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_image_delete(residual);                   \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">cpl_table_delete(restab);                     \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">#define fors_wave_calib_exit_memcheck(message)  \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">printf("free spectra (%p)\n", spectra);         \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">cpl_image_delete(spectra);                      \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">printf("free spatial (%p)\n", spatial);         \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">cpl_image_delete(spatial);                      \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);         \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">cpl_image_delete(rainbow);                      \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">printf("free residual (%p)\n", residual);       \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">cpl_image_delete(residual);                     \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">printf("free rectified (%p)\n", rectified);     \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">cpl_image_delete(rectified);                    \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);         \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">cpl_image_delete(wavemap);                      \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table); \</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor">cpl_table_delete(grism_table);                  \</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths); \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">cpl_table_delete(wavelengths);                  \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);     \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">cpl_table_delete(maskslits);                    \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);       \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">cpl_table_delete(idscoeff);                     \</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor">printf("free restab (%p)\n", restab);           \</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="preprocessor">cpl_table_delete(restab);                       \</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">printf("free slits (%p)\n", slits);             \</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">cpl_table_delete(slits);                        \</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);   \</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor">cpl_table_delete(polytraces);                   \</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor">printf("free lines (%p)\n", lines);             \</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor">cpl_vector_delete(lines);                       \</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor">printf("free header (%p)\n", header);           \</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor">cpl_propertylist_delete(header);                \</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="preprocessor">printf("free save_header (%p)\n", save_header); \</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="preprocessor">cpl_propertylist_delete(save_header);           \</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> {</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>                     <span class="stringliteral">"fors_wave_calib"</span>,</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>                     <span class="stringliteral">"Derive dispersion relation from rectified arc lamp frame"</span>,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                     fors_wave_calib_description,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>                     fors_wave_calib_create,</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>                     fors_wave_calib_exec,</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>                     fors_wave_calib_destroy);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> }</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> {</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.dispersion"</span>,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                                 0.0);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> <span class="comment">     * Peak detection level</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.peakdetection"</span>,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                 0.0);</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="comment">     * Degree of wavelength calibration polynomial</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.wdegree"</span>,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                                 0);</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> <span class="comment">     * Reference lines search radius</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.wradius"</span>,</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                                 <span class="stringliteral">"with first-guess method"</span>,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                                 4);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span></div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.wreject"</span>,</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>                                 <span class="stringliteral">"Rejection threshold in dispersion "</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                                 <span class="stringliteral">"relation fit (pixel)"</span>,</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                                 0.7);</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> <span class="comment">     * Line catalog table column containing the reference wavelengths</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.wcolumn"</span>,</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                                 <span class="stringliteral">"Name of line catalog table column "</span></div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> </div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.startwavelength"</span>,</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                                 0.0);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib.endwavelength"</span>,</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>                                 <span class="stringliteral">"fors.fors_wave_calib"</span>,</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>                                 0.0);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> }</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> </div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> {</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     </div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> </div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordflow">return</span> fors_wave_calib(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> }</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> </div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> </div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> {</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     </div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> }</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> </div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> {</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> </div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_wave_calib"</span>;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     <span class="keywordtype">double</span>      peakdetection;</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     <span class="keywordtype">int</span>         wdegree;</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     <span class="keywordtype">int</span>         wradius;</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <span class="keywordtype">double</span>      wreject;</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     cpl_image        *spectra     = NULL;</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     cpl_image        *spatial     = NULL;</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     cpl_image        *rectified   = NULL;</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     cpl_image        *wavemap     = NULL;</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     cpl_image        *rainbow     = NULL;</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     cpl_image        *residual    = NULL;</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     cpl_image        *bimage      = NULL;</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     cpl_table        *wavelengths = NULL;</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     cpl_table        *polytraces  = NULL;</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     cpl_table        *idscoeff    = NULL;</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     cpl_table        *maskslits   = NULL;</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_table        *restab      = NULL;</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     cpl_vector       *lines       = NULL;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     cpl_propertylist *save_header = NULL;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> </div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *arc_tag;</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_lamp_tag;</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_tag;</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *spatial_map_tag;</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_residuals_tag;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectral_resolution_tag;</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keywordtype">int</span>         lamp_mxu;</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     <span class="keywordtype">int</span>         lamp_mos;</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     <span class="keywordtype">int</span>         mos;</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordtype">int</span>         treat_as_lss = 0;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     <span class="keywordtype">double</span>      mean_rms;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <span class="keywordtype">int</span>         narc, nref;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     <span class="keywordtype">int</span>         nlines;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     <span class="keywordtype">double</span>     *line;</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     <span class="keywordtype">double</span>     *fiterror = NULL;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     <span class="keywordtype">int</span>        *fitlines = NULL;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     <span class="keywordtype">int</span>         nslits_out_det = 0;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> </div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> </div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> </div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> </div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> </div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     </div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         fors_wave_calib_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); </div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> </div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> </div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>                     <span class="stringliteral">"fors.fors_wave_calib.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         fors_wave_calib_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> </div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     peakdetection = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>                     <span class="stringliteral">"fors.fors_wave_calib.peakdetection"</span>, grism_table);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>     <span class="keywordflow">if</span> (peakdetection <= 0.0)</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         fors_wave_calib_exit(<span class="stringliteral">"Invalid peak detection level"</span>);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> </div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     wdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>                     <span class="stringliteral">"fors.fors_wave_calib.wdegree"</span>, grism_table);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     <span class="keywordflow">if</span> (wdegree < 1)</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         fors_wave_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> </div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     <span class="keywordflow">if</span> (wdegree > 5)</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         fors_wave_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span> </div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     wradius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>                                     <span class="stringliteral">"fors.fors_wave_calib.wradius"</span>, NULL);</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span> </div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     <span class="keywordflow">if</span> (wradius < 0)</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>         fors_wave_calib_exit(<span class="stringliteral">"Invalid search radius"</span>);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> </div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     wreject = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>                                     <span class="stringliteral">"fors.fors_wave_calib.wreject"</span>, NULL);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span> </div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     <span class="keywordflow">if</span> (wreject <= 0.0)</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         fors_wave_calib_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> </div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>                                     <span class="stringliteral">"fors.fors_wave_calib.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> </div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                     <span class="stringliteral">"fors.fors_wave_calib.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>             fors_wave_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> </div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>                     <span class="stringliteral">"fors.fors_wave_calib.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>             fors_wave_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>             fors_wave_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     }</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> </div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>             fors_wave_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span> </div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> </div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>         fors_wave_calib_exit(<span class="stringliteral">"Failure reading the configuration parameters"</span>);</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span> </div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> </div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>         fors_wave_calib_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>         fors_wave_calib_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> </div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     lamp_mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_LAMP_MXU"</span>);</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     lamp_mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"RECTIFIED_LAMP_MOS"</span>);</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> </div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     narc = lamp_mxu + lamp_mos;</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> </div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     <span class="keywordflow">if</span> (narc == 0) {</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>         fors_wave_calib_exit(<span class="stringliteral">"Missing input rectified arc lamp frame"</span>);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     }</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keywordflow">if</span> (narc > 1) {</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input rectified arc lamp frames "</span></div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>                       <span class="stringliteral">"(%d > 1)"</span>, narc);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     }</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span> </div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     mos = 0;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span> </div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     <span class="keywordflow">if</span> (lamp_mxu) {</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>         arc_tag                 = <span class="stringliteral">"RECTIFIED_LAMP_MXU"</span>;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>         spatial_map_tag         = <span class="stringliteral">"SPATIAL_MAP_MXU"</span>;</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>         reduced_lamp_tag        = <span class="stringliteral">"REDUCED_LAMP_MXU"</span>;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         disp_residuals_tag      = <span class="stringliteral">"DISP_RESIDUALS_MXU"</span>;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>         curv_coeff_tag          = <span class="stringliteral">"CURV_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>         wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_MXU"</span>;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>         spectral_resolution_tag = <span class="stringliteral">"SPECTRAL_RESOLUTION_MXU"</span>;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>     }</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lamp_mos) {</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         mos = 1;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>         arc_tag                 = <span class="stringliteral">"RECTIFIED_LAMP_MOS"</span>;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>         spatial_map_tag         = <span class="stringliteral">"SPATIAL_MAP_MOS"</span>;</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         reduced_lamp_tag        = <span class="stringliteral">"REDUCED_LAMP_MOS"</span>;</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>         disp_residuals_tag      = <span class="stringliteral">"DISP_RESIDUALS_MOS"</span>;</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>         curv_coeff_tag          = <span class="stringliteral">"CURV_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_MOS"</span>;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         spectral_resolution_tag = <span class="stringliteral">"SPECTRAL_RESOLUTION_MOS"</span>;</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     }</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> </div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>     nref = cpl_frameset_count_tags(frameset, spatial_map_tag);</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span> </div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     <span class="keywordflow">if</span> (nref == 0) {</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         fors_wave_calib_exit(<span class="stringliteral">"Missing input spatial map"</span>);</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     }</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     <span class="keywordflow">if</span> (nref > 1) {</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input spatial maps (%d > 1)"</span>, nref);</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     }</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span> </div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     nref = cpl_frameset_count_tags(frameset, slit_location_tag);</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span> </div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     <span class="keywordflow">if</span> (nref == 0) {</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>         fors_wave_calib_exit(<span class="stringliteral">"Missing input slit location table"</span>);</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     }</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     <span class="keywordflow">if</span> (nref > 1) {</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input slit location tables (%d > 1)"</span>, </div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>                       nref);</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     }</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     nref = cpl_frameset_count_tags(frameset, curv_coeff_tag);</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> </div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     <span class="keywordflow">if</span> (nref == 0) {</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         fors_wave_calib_exit(<span class="stringliteral">"Missing input spectral curvature table"</span>);</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     }</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     <span class="keywordflow">if</span> (nref > 1) {</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input spectral curvature tables "</span></div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>                       <span class="stringliteral">"(%d > 1)"</span>, nref);</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     }</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span> </div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span> </div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>         fors_wave_calib_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> </div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         fors_wave_calib_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span> </div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>         fors_wave_calib_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span> </div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span> <span class="comment">     * dispersion direction from the arc lamp exposure</span></div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> </div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, spatial_map_tag, 0);</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span> </div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>         fors_wave_calib_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span> </div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>         fors_wave_calib_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> </div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>         fors_wave_calib_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span></div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>                                  <span class="stringliteral">"in arc lamp frame header"</span>);</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> </div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>         reference *= 10;</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in arc lamp frame header"</span>,</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>                       reference);</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     }</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> </div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span> </div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>         fors_wave_calib_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>                                  <span class="stringliteral">"in arc lamp frame header"</span>);</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> </div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>                         dispersion);</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>     }</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span> </div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span> </div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>         maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>         maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span> </div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span> </div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> <span class="comment">     * Check if all slits have the same X offset: in such case,</span></div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> <span class="comment">     * treat the observation as a long-slit one!</span></div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> </div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span> </div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> </div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>         cpl_msg_error(recipe, <span class="stringliteral">"All slits have the same offset: %.2f mm\n"</span></div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>                       <span class="stringliteral">"The LSS data reduction strategy must be applied: "</span></div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>                       <span class="stringliteral">"please use recipe fors_wave_calib_lss"</span>, mxpos);</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     }</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> </div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> </div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> </div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> </div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>         fors_wave_calib_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> </div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> </div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>, 1);</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> </div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     <span class="keywordflow">if</span> (wavelengths == NULL)</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>         fors_wave_calib_exit(<span class="stringliteral">"Cannot load line catalog"</span>);</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span> </div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span> </div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> </div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span> </div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>         fors_wave_calib_exit(<span class="stringliteral">"Empty input line catalog"</span>);</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span> </div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>                       wcolumn);</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     }</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span> </div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> </div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span> </div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> </div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span> </div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load slit location table..."</span>);</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span> </div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>     slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span> </div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>         fors_wave_calib_exit(<span class="stringliteral">"Cannot load slit location table"</span>);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span> </div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span> </div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     cpl_msg_info(recipe, <span class="stringliteral">"Subtract background from input arc exposure..."</span>);</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span> </div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     bimage = <a class="code" href="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b" title="Background determination on emission line spectrum (arc)">mos_arc_background</a>(spectra, 15, 15);</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>     cpl_image_subtract(spectra, bimage);</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     cpl_image_delete(bimage);</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span> </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span> </div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>     cpl_msg_info(recipe, <span class="stringliteral">"Perform wavelength calibration..."</span>);</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span> </div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span> </div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     idscoeff = cpl_table_new(ny);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     rainbow  = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>     fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     rectified = <a class="code" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb" title="Derive wavelength calibration from a rectified arc lamp or sky exposure.">mos_wavelength_calibration_final</a>(spectra, slits, lines, </div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>                                                  dispersion, peakdetection,</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>                                                  wradius, wdegree, wreject,</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>                                                  reference, &startwavelength,</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>                                                  &endwavelength, fitlines,</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>                                                  fiterror, idscoeff, rainbow,</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>                                                  residual, NULL, NULL);</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> </div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> </div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     <span class="keywordflow">if</span> (rectified == NULL)</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>         fors_wave_calib_exit(<span class="stringliteral">"Wavelength calibration failure"</span>);</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span> </div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     save_header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL1"</span>,</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>                                    startwavelength + dispersion/2);</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>     <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> <span class="comment">    cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, 1);</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span> </div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, rectified, reduced_lamp_tag, save_header,</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span> </div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     save_header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span> </div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, 1.0);</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span> </div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, residual, disp_residuals_tag, save_header,</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span> </div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>     cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>     cpl_image_delete(residual); residual = NULL;</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span> </div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>     cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>     cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>     cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span> </div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>     <span class="keywordflow">for</span> (i = 0; i < ny; i++)</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>         <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>             cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span> </div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, idscoeff, disp_coeff_tag, NULL,</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span> </div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     mean_rms = <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(rectified, lines, startwavelength,</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>                                    dispersion, 6, 0);</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span> </div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f pixel"</span>, mean_rms);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span> </div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span> </div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>                  mean_rms, mean_rms * dispersion);</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span> </div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span> </div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span> <span class="comment">     * Create resolution table</span></div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span> </div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>     restab = <a class="code" href="group__moses.html#gae9f633b64e1880984c084a19f53047fc" title="Compute mean spectral resolution at a given arc lamp line.">mos_resolution_table</a>(rectified, startwavelength, dispersion,</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>                                   60000, lines);</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span> </div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>     cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>     cpl_image_delete(rectified); rectified = NULL;</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span> </div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>     <span class="keywordflow">if</span> (restab) {</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>         cpl_msg_info(recipe, <span class="stringliteral">"Mean spectral resolution: %.2f"</span>,</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>                    cpl_table_get_column_mean(restab, <span class="stringliteral">"resolution"</span>));</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>         cpl_msg_info(recipe, <span class="stringliteral">"Mean reference lines FWHM: %.2f +/- %.2f pixel"</span>,</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>                    cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm"</span>) / dispersion,</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>                    cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm_rms"</span>) / dispersion);</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span> </div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, restab, spectral_resolution_tag, NULL,</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>             fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span> </div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>         cpl_table_delete(restab); restab = NULL;</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>     }</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>         fors_wave_calib_exit(<span class="stringliteral">"Cannot compute the spectral resolution table"</span>);</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span> </div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span> </div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load spatial map image..."</span>);</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span> </div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>     spatial = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, spatial_map_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span> </div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>     <span class="keywordflow">if</span> (spatial == NULL)</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>         fors_wave_calib_exit(<span class="stringliteral">"Cannot load spatial map"</span>);</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span> </div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load spectral curvature table..."</span>);</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span> </div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>     polytraces = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, curv_coeff_tag, 1);</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span> </div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>     <span class="keywordflow">if</span> (polytraces == NULL)</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>         fors_wave_calib_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span> </div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>     wavemap = <a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(spatial, rainbow, slits, polytraces,</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>                                   reference, startwavelength, endwavelength,</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>                                   dispersion);</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span> </div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>     cpl_image_delete(rainbow); rainbow = NULL;</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>     cpl_image_delete(spatial); spatial = NULL;</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span> </div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, wavemap, wavelength_map_tag, header,</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>         fors_wave_calib_exit(NULL);</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span> </div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>     cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span> </div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__wave__calib__lss_8c-source.html b/html/fors__wave__calib__lss_8c-source.html
deleted file mode 100644
index 26a1b08..0000000
--- a/html/fors__wave__calib__lss_8c-source.html
+++ /dev/null
@@ -1,925 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_wave_calib_lss.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_wave_calib_lss.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_wave_calib_lss.c,v 1.9 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.9 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_wave_calib_lss_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to wavelength calibrate one long slit spectrum, i.e.,\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"a FORS spectral obtained either in LSS mode or in MOS/MXU mode with all\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"slits at the same offset. A pattern-matching algorithm is applied as in\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"recipe fors_detect_spectra. For more details on this data reduction\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"strategy please refer to the FORS Pipeline User's Manual.\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"Note that specifying an input GRISM_TABLE will set some of the recipe\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"configuration parameters to default values valid for a particular grism.\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"In the table below the LSS acronym can be alternatively read as MOS or\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"MXU.\n\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"  LAMP_UNBIAS_LSS            Calib       Arc lamp exposure       Y\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"  MASTER_LINECAT             Calib       Line catalog            Y\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"  REDUCED_LAMP_LSS           FITS image  Calibrated arc lamp exposure\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"  DISP_COEFF_LSS             FITS table  Inverse dispersion coefficients\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"  DISP_RESIDUALS_LSS         FITS image  Image of modeling residuals\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  WAVELENGTH_MAP_LSS         FITS image  Wavelengths mapped on CCD\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  SLIT_LOCATION_LSS          FITS image  Background subtracted arc frame\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"  SPECTRAL_RESOLUTION_LSS    FITS table  Spectral resolution table\n\n"</span>;
-<a name="l00067"></a>00067 
-<a name="l00068"></a>00068 <span class="preprocessor">#define fors_wave_calib_lss_exit(message)     \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">{                                             \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00071"></a>00071 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00072"></a>00072 <span class="preprocessor">cpl_image_delete(residual);                   \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">cpl_table_delete(idscoeff_all);               \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">cpl_table_delete(restab);                     \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">}</span>
-<a name="l00088"></a>00088 <span class="preprocessor"></span>
-<a name="l00089"></a>00089 <span class="preprocessor">#define fors_wave_calib_lss_exit_memcheck(message)  \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">{                                                   \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);         \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">printf("free spectra (%p)\n", spectra);             \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">cpl_image_delete(spectra);                          \</span>
-<a name="l00094"></a>00094 <span class="preprocessor">printf("free residual (%p)\n", residual);           \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">cpl_image_delete(residual);                         \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">printf("free rectified (%p)\n", rectified);         \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">cpl_image_delete(rectified);                        \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);             \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">cpl_image_delete(wavemap);                          \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table);     \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">cpl_table_delete(grism_table);                      \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths);     \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">cpl_table_delete(wavelengths);                      \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);         \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">cpl_table_delete(maskslits);                        \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);           \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">cpl_table_delete(idscoeff);                         \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">printf("free idscoeff_all (%p)\n", idscoeff_all);   \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">cpl_table_delete(idscoeff_all);                     \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">printf("free restab (%p)\n", restab);               \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">cpl_table_delete(restab);                           \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">printf("free slits (%p)\n", slits);                 \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">cpl_table_delete(slits);                            \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">printf("free lines (%p)\n", lines);                 \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">cpl_vector_delete(lines);                           \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">printf("free header (%p)\n", header);               \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">cpl_propertylist_delete(header);                    \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">printf("free save_header (%p)\n", save_header);     \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">cpl_propertylist_delete(save_header);               \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">cpl_msg_indent_less();                              \</span>
-<a name="l00121"></a>00121 <span class="preprocessor">return 0;                                           \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">}</span>
-<a name="l00123"></a>00123 <span class="preprocessor"></span>
-<a name="l00124"></a>00124 
-<a name="l00136"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00136</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00137"></a>00137 {
-<a name="l00138"></a>00138     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00139"></a>00139     cpl_plugin *plugin = &recipe->interface;
-<a name="l00140"></a>00140 
-<a name="l00141"></a>00141     cpl_plugin_init(plugin,
-<a name="l00142"></a>00142                     CPL_PLUGIN_API,
-<a name="l00143"></a>00143                     FORS_BINARY_VERSION,
-<a name="l00144"></a>00144                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00145"></a>00145                     <span class="stringliteral">"fors_wave_calib_lss"</span>,
-<a name="l00146"></a>00146                     <span class="stringliteral">"Derive dispersion relation from long-slit arc lamp frame"</span>,
-<a name="l00147"></a>00147                     fors_wave_calib_lss_description,
-<a name="l00148"></a>00148                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00149"></a>00149                     PACKAGE_BUGREPORT,
-<a name="l00150"></a>00150     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00151"></a>00151     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00152"></a>00152     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00153"></a>00153     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00154"></a>00154     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00155"></a>00155     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00156"></a>00156     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00157"></a>00157     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00158"></a>00158     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00159"></a>00159     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00160"></a>00160     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00161"></a>00161     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00162"></a>00162     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00163"></a>00163                     fors_wave_calib_lss_create,
-<a name="l00164"></a>00164                     fors_wave_calib_lss_exec,
-<a name="l00165"></a>00165                     fors_wave_calib_lss_destroy);
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     cpl_pluginlist_append(list, plugin);
-<a name="l00168"></a>00168     
-<a name="l00169"></a>00169     <span class="keywordflow">return</span> 0;
-<a name="l00170"></a>00170 }
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172 
-<a name="l00183"></a>00183 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_create(cpl_plugin *plugin)
-<a name="l00184"></a>00184 {
-<a name="l00185"></a>00185     cpl_recipe    *recipe;
-<a name="l00186"></a>00186     cpl_parameter *p;
-<a name="l00187"></a>00187 
-<a name="l00188"></a>00188     <span class="comment">/* </span>
-<a name="l00189"></a>00189 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00190"></a>00190 <span class="comment">     */</span>
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00193"></a>00193         recipe = (cpl_recipe *)plugin;
-<a name="l00194"></a>00194     <span class="keywordflow">else</span> 
-<a name="l00195"></a>00195         <span class="keywordflow">return</span> -1;
-<a name="l00196"></a>00196 
-<a name="l00197"></a>00197     <span class="comment">/* </span>
-<a name="l00198"></a>00198 <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span>
-<a name="l00199"></a>00199 <span class="comment">     */</span>
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203     <span class="comment">/*</span>
-<a name="l00204"></a>00204 <span class="comment">     * Dispersion</span>
-<a name="l00205"></a>00205 <span class="comment">     */</span>
-<a name="l00206"></a>00206 
-<a name="l00207"></a>00207     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.dispersion"</span>,
-<a name="l00208"></a>00208                                 CPL_TYPE_DOUBLE,
-<a name="l00209"></a>00209                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00210"></a>00210                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,
-<a name="l00211"></a>00211                                 0.0);
-<a name="l00212"></a>00212     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00213"></a>00213     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00214"></a>00214     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00215"></a>00215 
-<a name="l00216"></a>00216     <span class="comment">/*</span>
-<a name="l00217"></a>00217 <span class="comment">     * Peak detection level</span>
-<a name="l00218"></a>00218 <span class="comment">     */</span>
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.peakdetection"</span>,
-<a name="l00221"></a>00221                                 CPL_TYPE_DOUBLE,
-<a name="l00222"></a>00222                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,
-<a name="l00223"></a>00223                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,
-<a name="l00224"></a>00224                                 0.0);
-<a name="l00225"></a>00225     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);
-<a name="l00226"></a>00226     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00227"></a>00227     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229     <span class="comment">/*</span>
-<a name="l00230"></a>00230 <span class="comment">     * Degree of wavelength calibration polynomial</span>
-<a name="l00231"></a>00231 <span class="comment">     */</span>
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.wdegree"</span>,
-<a name="l00234"></a>00234                                 CPL_TYPE_INT,
-<a name="l00235"></a>00235                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,
-<a name="l00236"></a>00236                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,
-<a name="l00237"></a>00237                                 0);
-<a name="l00238"></a>00238     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);
-<a name="l00239"></a>00239     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00240"></a>00240     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00241"></a>00241 
-<a name="l00242"></a>00242     <span class="comment">/*</span>
-<a name="l00243"></a>00243 <span class="comment">     * Reference lines search radius</span>
-<a name="l00244"></a>00244 <span class="comment">     */</span>
-<a name="l00245"></a>00245 
-<a name="l00246"></a>00246     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.wradius"</span>,
-<a name="l00247"></a>00247                                 CPL_TYPE_INT,
-<a name="l00248"></a>00248                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span>
-<a name="l00249"></a>00249                                 <span class="stringliteral">"with first-guess method"</span>,
-<a name="l00250"></a>00250                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,
-<a name="l00251"></a>00251                                 4);
-<a name="l00252"></a>00252     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);
-<a name="l00253"></a>00253     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00254"></a>00254     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00255"></a>00255 
-<a name="l00256"></a>00256     <span class="comment">/*</span>
-<a name="l00257"></a>00257 <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span>
-<a name="l00258"></a>00258 <span class="comment">     */</span>
-<a name="l00259"></a>00259 
-<a name="l00260"></a>00260     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.wreject"</span>,
-<a name="l00261"></a>00261                                 CPL_TYPE_DOUBLE,
-<a name="l00262"></a>00262                                 <span class="stringliteral">"Rejection threshold in dispersion "</span>
-<a name="l00263"></a>00263                                 <span class="stringliteral">"relation fit (pixel)"</span>,
-<a name="l00264"></a>00264                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,
-<a name="l00265"></a>00265                                 0.7);
-<a name="l00266"></a>00266     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);
-<a name="l00267"></a>00267     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00268"></a>00268     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     <span class="comment">/*</span>
-<a name="l00271"></a>00271 <span class="comment">     * Line catalog table column containing the reference wavelengths</span>
-<a name="l00272"></a>00272 <span class="comment">     */</span>
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.wcolumn"</span>,
-<a name="l00275"></a>00275                                 CPL_TYPE_STRING,
-<a name="l00276"></a>00276                                 <span class="stringliteral">"Name of line catalog table column "</span>
-<a name="l00277"></a>00277                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00278"></a>00278                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,
-<a name="l00279"></a>00279                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00280"></a>00280     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00281"></a>00281     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00282"></a>00282     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     <span class="comment">/*</span>
-<a name="l00285"></a>00285 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00286"></a>00286 <span class="comment">     */</span>
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.startwavelength"</span>,
-<a name="l00289"></a>00289                                 CPL_TYPE_DOUBLE,
-<a name="l00290"></a>00290                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00291"></a>00291                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,
-<a name="l00292"></a>00292                                 0.0);
-<a name="l00293"></a>00293     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00294"></a>00294     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00295"></a>00295     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297     <span class="comment">/*</span>
-<a name="l00298"></a>00298 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00299"></a>00299 <span class="comment">     */</span>
-<a name="l00300"></a>00300 
-<a name="l00301"></a>00301     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.endwavelength"</span>,
-<a name="l00302"></a>00302                                 CPL_TYPE_DOUBLE,
-<a name="l00303"></a>00303                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00304"></a>00304                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,
-<a name="l00305"></a>00305                                 0.0);
-<a name="l00306"></a>00306     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00307"></a>00307     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00308"></a>00308     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310     <span class="comment">/*</span>
-<a name="l00311"></a>00311 <span class="comment">     * Wavelength solution interpolation</span>
-<a name="l00312"></a>00312 <span class="comment">     */</span>
-<a name="l00313"></a>00313  
-<a name="l00314"></a>00314     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.wmode"</span>,
-<a name="l00315"></a>00315                                 CPL_TYPE_INT,
-<a name="l00316"></a>00316                                 <span class="stringliteral">"Interpolation mode of wavelength solution "</span>
-<a name="l00317"></a>00317                                 <span class="stringliteral">"(0 = no interpolation, 1 = fill gaps, "</span>
-<a name="l00318"></a>00318                                 <span class="stringliteral">"2 = global model)"</span>,
-<a name="l00319"></a>00319                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,
-<a name="l00320"></a>00320                                 2);
-<a name="l00321"></a>00321     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wmode"</span>);
-<a name="l00322"></a>00322     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00323"></a>00323     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00324"></a>00324 
-<a name="l00325"></a>00325     <span class="keywordflow">return</span> 0;
-<a name="l00326"></a>00326 }
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328 
-<a name="l00337"></a>00337 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_exec(cpl_plugin *plugin)
-<a name="l00338"></a>00338 {
-<a name="l00339"></a>00339     cpl_recipe *recipe;
-<a name="l00340"></a>00340     
-<a name="l00341"></a>00341     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00342"></a>00342         recipe = (cpl_recipe *)plugin;
-<a name="l00343"></a>00343     <span class="keywordflow">else</span> 
-<a name="l00344"></a>00344         <span class="keywordflow">return</span> -1;
-<a name="l00345"></a>00345 
-<a name="l00346"></a>00346     <span class="keywordflow">return</span> fors_wave_calib_lss(recipe->parameters, recipe->frames);
-<a name="l00347"></a>00347 }
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349 
-<a name="l00358"></a>00358 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_destroy(cpl_plugin *plugin)
-<a name="l00359"></a>00359 {
-<a name="l00360"></a>00360     cpl_recipe *recipe;
-<a name="l00361"></a>00361     
-<a name="l00362"></a>00362     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00363"></a>00363         recipe = (cpl_recipe *)plugin;
-<a name="l00364"></a>00364     <span class="keywordflow">else</span> 
-<a name="l00365"></a>00365         <span class="keywordflow">return</span> -1;
-<a name="l00366"></a>00366 
-<a name="l00367"></a>00367     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369     <span class="keywordflow">return</span> 0;
-<a name="l00370"></a>00370 }
-<a name="l00371"></a>00371 
-<a name="l00372"></a>00372 
-<a name="l00382"></a>00382 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss(cpl_parameterlist *parlist, 
-<a name="l00383"></a>00383                                cpl_frameset *frameset)
-<a name="l00384"></a>00384 {
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_wave_calib_lss"</span>;
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389     <span class="comment">/*</span>
-<a name="l00390"></a>00390 <span class="comment">     * Input parameters</span>
-<a name="l00391"></a>00391 <span class="comment">     */</span>
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393     <span class="keywordtype">double</span>      dispersion;
-<a name="l00394"></a>00394     <span class="keywordtype">double</span>      peakdetection;
-<a name="l00395"></a>00395     <span class="keywordtype">int</span>         wdegree;
-<a name="l00396"></a>00396     <span class="keywordtype">int</span>         wradius;
-<a name="l00397"></a>00397     <span class="keywordtype">double</span>      wreject;
-<a name="l00398"></a>00398     <span class="keywordtype">int</span>         wmode;
-<a name="l00399"></a>00399     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00400"></a>00400     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00401"></a>00401     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00402"></a>00402 
-<a name="l00403"></a>00403     <span class="comment">/*</span>
-<a name="l00404"></a>00404 <span class="comment">     * CPL objects</span>
-<a name="l00405"></a>00405 <span class="comment">     */</span>
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407     cpl_image        *spectra      = NULL;
-<a name="l00408"></a>00408     cpl_image        *rectified    = NULL;
-<a name="l00409"></a>00409     cpl_image        *wavemap      = NULL;
-<a name="l00410"></a>00410     cpl_image        *residual     = NULL;
-<a name="l00411"></a>00411     cpl_image        *dummy        = NULL;
-<a name="l00412"></a>00412     cpl_table        *grism_table  = NULL;
-<a name="l00413"></a>00413     cpl_table        *wavelengths  = NULL;
-<a name="l00414"></a>00414     cpl_table        *slits        = NULL;
-<a name="l00415"></a>00415     cpl_table        *idscoeff     = NULL;
-<a name="l00416"></a>00416     cpl_table        *idscoeff_all = NULL;
-<a name="l00417"></a>00417     cpl_table        *maskslits    = NULL;
-<a name="l00418"></a>00418     cpl_table        *restab       = NULL;
-<a name="l00419"></a>00419     cpl_vector       *lines        = NULL;
-<a name="l00420"></a>00420     cpl_propertylist *header       = NULL;
-<a name="l00421"></a>00421     cpl_propertylist *save_header  = NULL;
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423     <span class="comment">/*</span>
-<a name="l00424"></a>00424 <span class="comment">     * Auxiliary variables</span>
-<a name="l00425"></a>00425 <span class="comment">     */</span>
-<a name="l00426"></a>00426 
-<a name="l00427"></a>00427     <span class="keywordtype">char</span>        version[80];
-<a name="l00428"></a>00428     <span class="keyword">const</span> <span class="keywordtype">char</span> *arc_tag;
-<a name="l00429"></a>00429     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_lamp_tag;
-<a name="l00430"></a>00430     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_tag;
-<a name="l00431"></a>00431     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_residuals_tag;
-<a name="l00432"></a>00432     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;
-<a name="l00433"></a>00433     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00434"></a>00434     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectral_resolution_tag;
-<a name="l00435"></a>00435     <span class="keywordtype">int</span>         mxu;
-<a name="l00436"></a>00436     <span class="keywordtype">int</span>         mos;
-<a name="l00437"></a>00437     <span class="keywordtype">int</span>         lss;
-<a name="l00438"></a>00438     <span class="keywordtype">int</span>         treat_as_lss = 0;
-<a name="l00439"></a>00439     <span class="keywordtype">int</span>         nslits;
-<a name="l00440"></a>00440     <span class="keywordtype">double</span>      mean_rms;
-<a name="l00441"></a>00441     <span class="keywordtype">double</span>     *xpos;
-<a name="l00442"></a>00442     <span class="keywordtype">double</span>      mxpos;
-<a name="l00443"></a>00443     <span class="keywordtype">int</span>         narc;
-<a name="l00444"></a>00444     <span class="keywordtype">int</span>         nlines;
-<a name="l00445"></a>00445     <span class="keywordtype">int</span>         rebin;
-<a name="l00446"></a>00446     <span class="keywordtype">double</span>     *line;
-<a name="l00447"></a>00447     <span class="keywordtype">double</span>     *fiterror = NULL;
-<a name="l00448"></a>00448     <span class="keywordtype">int</span>        *fitlines = NULL;
-<a name="l00449"></a>00449     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00450"></a>00450     <span class="keywordtype">int</span>         first_row, last_row;
-<a name="l00451"></a>00451     <span class="keywordtype">int</span>         ylow, yhig;
-<a name="l00452"></a>00452     <span class="keywordtype">double</span>      reference;
-<a name="l00453"></a>00453     <span class="keywordtype">int</span>         i;
-<a name="l00454"></a>00454 
-<a name="l00455"></a>00455     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457 
-<a name="l00458"></a>00458     cpl_msg_set_indentation(2);
-<a name="l00459"></a>00459 
-<a name="l00460"></a>00460     <span class="comment">/*</span>
-<a name="l00461"></a>00461 <span class="comment">     * Get configuration parameters</span>
-<a name="l00462"></a>00462 <span class="comment">     */</span>
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00465"></a>00465     cpl_msg_indent_more();
-<a name="l00466"></a>00466     
-<a name="l00467"></a>00467     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00468"></a>00468         fors_wave_calib_lss_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); 
-<a name="l00469"></a>00469 
-<a name="l00470"></a>00470     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00471"></a>00471 
-<a name="l00472"></a>00472     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00473"></a>00473                     <span class="stringliteral">"fors.fors_wave_calib_lss.dispersion"</span>, grism_table);
-<a name="l00474"></a>00474 
-<a name="l00475"></a>00475     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00476"></a>00476         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00477"></a>00477 
-<a name="l00478"></a>00478     peakdetection = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00479"></a>00479                     <span class="stringliteral">"fors.fors_wave_calib_lss.peakdetection"</span>, grism_table);
-<a name="l00480"></a>00480     <span class="keywordflow">if</span> (peakdetection <= 0.0)
-<a name="l00481"></a>00481         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid peak detection level"</span>);
-<a name="l00482"></a>00482 
-<a name="l00483"></a>00483     wdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00484"></a>00484                     <span class="stringliteral">"fors.fors_wave_calib_lss.wdegree"</span>, grism_table);
-<a name="l00485"></a>00485 
-<a name="l00486"></a>00486     <span class="keywordflow">if</span> (wdegree < 1)
-<a name="l00487"></a>00487         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00488"></a>00488 
-<a name="l00489"></a>00489     <span class="keywordflow">if</span> (wdegree > 5)
-<a name="l00490"></a>00490         fors_wave_calib_lss_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00491"></a>00491 
-<a name="l00492"></a>00492     wradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00493"></a>00493                                     <span class="stringliteral">"fors.fors_wave_calib_lss.wradius"</span>, NULL);
-<a name="l00494"></a>00494 
-<a name="l00495"></a>00495     <span class="keywordflow">if</span> (wradius < 0)
-<a name="l00496"></a>00496         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid search radius"</span>);
-<a name="l00497"></a>00497 
-<a name="l00498"></a>00498     wreject = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00499"></a>00499                                     <span class="stringliteral">"fors.fors_wave_calib_lss.wreject"</span>, NULL);
-<a name="l00500"></a>00500 
-<a name="l00501"></a>00501     <span class="keywordflow">if</span> (wreject <= 0.0)
-<a name="l00502"></a>00502         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);
-<a name="l00503"></a>00503 
-<a name="l00504"></a>00504     wmode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00505"></a>00505                                     <span class="stringliteral">"fors.fors_wave_calib_lss.wmode"</span>, NULL);
-<a name="l00506"></a>00506 
-<a name="l00507"></a>00507     <span class="keywordflow">if</span> (wmode < 0 || wmode > 2)
-<a name="l00508"></a>00508         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid interpolation mode"</span>);
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00511"></a>00511                                     <span class="stringliteral">"fors.fors_wave_calib_lss.wcolumn"</span>, NULL);
-<a name="l00512"></a>00512 
-<a name="l00513"></a>00513     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00514"></a>00514                     <span class="stringliteral">"fors.fors_wave_calib_lss.startwavelength"</span>, grism_table);
-<a name="l00515"></a>00515     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00516"></a>00516         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00517"></a>00517             fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00518"></a>00518 
-<a name="l00519"></a>00519     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00520"></a>00520                     <span class="stringliteral">"fors.fors_wave_calib_lss.endwavelength"</span>, grism_table);
-<a name="l00521"></a>00521     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00522"></a>00522         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00523"></a>00523             fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00524"></a>00524         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00525"></a>00525             fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00526"></a>00526     }
-<a name="l00527"></a>00527 
-<a name="l00528"></a>00528     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00529"></a>00529         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00530"></a>00530             fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00531"></a>00531 
-<a name="l00532"></a>00532     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00533"></a>00533 
-<a name="l00534"></a>00534     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00535"></a>00535         fors_wave_calib_lss_exit(<span class="stringliteral">"Failure reading the configuration "</span>
-<a name="l00536"></a>00536                                  <span class="stringliteral">"parameters"</span>);
-<a name="l00537"></a>00537 
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539     cpl_msg_indent_less();
-<a name="l00540"></a>00540     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00541"></a>00541     cpl_msg_indent_more();
-<a name="l00542"></a>00542 
-<a name="l00543"></a>00543     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)
-<a name="l00544"></a>00544         fors_wave_calib_lss_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);
-<a name="l00545"></a>00545 
-<a name="l00546"></a>00546     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)
-<a name="l00547"></a>00547         fors_wave_calib_lss_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);
-<a name="l00548"></a>00548 
-<a name="l00549"></a>00549     mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>);
-<a name="l00550"></a>00550     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>);
-<a name="l00551"></a>00551     lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>);
-<a name="l00552"></a>00552 
-<a name="l00553"></a>00553     narc = mxu + mos + lss;
-<a name="l00554"></a>00554 
-<a name="l00555"></a>00555     <span class="keywordflow">if</span> (narc == 0) {
-<a name="l00556"></a>00556         fors_wave_calib_lss_exit(<span class="stringliteral">"Missing input long-slit arc lamp frame"</span>);
-<a name="l00557"></a>00557     }
-<a name="l00558"></a>00558     <span class="keywordflow">if</span> (narc > 1) {
-<a name="l00559"></a>00559         cpl_msg_error(recipe, <span class="stringliteral">"Too many input arc lamp frames (%d > 1)"</span>, narc);
-<a name="l00560"></a>00560         fors_wave_calib_lss_exit(NULL);
-<a name="l00561"></a>00561     }
-<a name="l00562"></a>00562 
-<a name="l00563"></a>00563     <span class="keywordflow">if</span> (mxu) {
-<a name="l00564"></a>00564         arc_tag                 = <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>;
-<a name="l00565"></a>00565         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;
-<a name="l00566"></a>00566         reduced_lamp_tag        = <span class="stringliteral">"REDUCED_LAMP_MXU"</span>;
-<a name="l00567"></a>00567         disp_residuals_tag      = <span class="stringliteral">"DISP_RESIDUALS_MXU"</span>;
-<a name="l00568"></a>00568         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MXU"</span>;
-<a name="l00569"></a>00569         wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_MXU"</span>;
-<a name="l00570"></a>00570         spectral_resolution_tag = <span class="stringliteral">"SPECTRAL_RESOLUTION_MXU"</span>;
-<a name="l00571"></a>00571     }
-<a name="l00572"></a>00572     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {
-<a name="l00573"></a>00573         arc_tag                 = <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>;
-<a name="l00574"></a>00574         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;
-<a name="l00575"></a>00575         reduced_lamp_tag        = <span class="stringliteral">"REDUCED_LAMP_MOS"</span>;
-<a name="l00576"></a>00576         disp_residuals_tag      = <span class="stringliteral">"DISP_RESIDUALS_MOS"</span>;
-<a name="l00577"></a>00577         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MOS"</span>;
-<a name="l00578"></a>00578         wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_MOS"</span>;
-<a name="l00579"></a>00579         spectral_resolution_tag = <span class="stringliteral">"SPECTRAL_RESOLUTION_MOS"</span>;
-<a name="l00580"></a>00580     }
-<a name="l00581"></a>00581     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lss) {
-<a name="l00582"></a>00582         arc_tag                 = <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>;
-<a name="l00583"></a>00583         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;
-<a name="l00584"></a>00584         reduced_lamp_tag        = <span class="stringliteral">"REDUCED_LAMP_LSS"</span>;
-<a name="l00585"></a>00585         disp_residuals_tag      = <span class="stringliteral">"DISP_RESIDUALS_LSS"</span>;
-<a name="l00586"></a>00586         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_LSS"</span>;
-<a name="l00587"></a>00587         wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_LSS"</span>;
-<a name="l00588"></a>00588         spectral_resolution_tag = <span class="stringliteral">"SPECTRAL_RESOLUTION_LSS"</span>;
-<a name="l00589"></a>00589     }
-<a name="l00590"></a>00590 
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00593"></a>00593         fors_wave_calib_lss_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00594"></a>00594 
-<a name="l00595"></a>00595     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00596"></a>00596         fors_wave_calib_lss_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00597"></a>00597 
-<a name="l00598"></a>00598     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00599"></a>00599         fors_wave_calib_lss_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00600"></a>00600 
-<a name="l00601"></a>00601 
-<a name="l00602"></a>00602     <span class="comment">/*</span>
-<a name="l00603"></a>00603 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l00604"></a>00604 <span class="comment">     * dispersion direction from the arc lamp exposure</span>
-<a name="l00605"></a>00605 <span class="comment">     */</span>
-<a name="l00606"></a>00606 
-<a name="l00607"></a>00607     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l00608"></a>00608 
-<a name="l00609"></a>00609     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00610"></a>00610         fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);
-<a name="l00611"></a>00611 
-<a name="l00612"></a>00612     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00613"></a>00613     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00614"></a>00614         fors_wave_calib_lss_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l00617"></a>00617         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l00618"></a>00618     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l00619"></a>00619         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l00620"></a>00620 
-<a name="l00621"></a>00621     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l00622"></a>00622 
-<a name="l00623"></a>00623     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00624"></a>00624         fors_wave_calib_lss_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span>
-<a name="l00625"></a>00625                                  <span class="stringliteral">"in arc lamp frame header"</span>);
-<a name="l00626"></a>00626 
-<a name="l00627"></a>00627     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l00628"></a>00628         reference *= 10;
-<a name="l00629"></a>00629 
-<a name="l00630"></a>00630     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l00631"></a>00631         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l00632"></a>00632                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in arc lamp frame header"</span>,
-<a name="l00633"></a>00633                       reference);
-<a name="l00634"></a>00634         fors_wave_calib_lss_exit(NULL);
-<a name="l00635"></a>00635     }
-<a name="l00636"></a>00636 
-<a name="l00637"></a>00637     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00642"></a>00642         fors_wave_calib_lss_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span>
-<a name="l00643"></a>00643                                  <span class="stringliteral">"in arc lamp frame header"</span>);
-<a name="l00644"></a>00644 
-<a name="l00645"></a>00645     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l00646"></a>00646         dispersion *= rebin;
-<a name="l00647"></a>00647         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l00648"></a>00648                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,
-<a name="l00649"></a>00649                         dispersion);
-<a name="l00650"></a>00650     }
-<a name="l00651"></a>00651 
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653     <span class="keywordflow">if</span> (mos || mxu) {
-<a name="l00654"></a>00654 
-<a name="l00655"></a>00655         <span class="keywordtype">int</span> nslits_out_det = 0;
-<a name="l00656"></a>00656 
-<a name="l00657"></a>00657         <span class="comment">/*</span>
-<a name="l00658"></a>00658 <span class="comment">         * Check if all slits have the same X offset. If not, this is the</span>
-<a name="l00659"></a>00659 <span class="comment">         * wrong recipe...</span>
-<a name="l00660"></a>00660 <span class="comment">         */</span>
-<a name="l00661"></a>00661 
-<a name="l00662"></a>00662         <span class="keywordflow">if</span> (mos)
-<a name="l00663"></a>00663             maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l00664"></a>00664         <span class="keywordflow">else</span>
-<a name="l00665"></a>00665             maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l00666"></a>00666 
-<a name="l00667"></a>00667         treat_as_lss = <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(maskslits, nslits_out_det);
-<a name="l00668"></a>00668 
-<a name="l00669"></a>00669         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00670"></a>00670 
-<a name="l00671"></a>00671         <span class="keywordflow">if</span> (!treat_as_lss)
-<a name="l00672"></a>00672             fors_wave_calib_lss_exit(<span class="stringliteral">"Input data are not long-slit data"</span>);
-<a name="l00673"></a>00673     }
-<a name="l00674"></a>00674 
-<a name="l00675"></a>00675 
-<a name="l00676"></a>00676     cpl_msg_indent_less();
-<a name="l00677"></a>00677     cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);
-<a name="l00678"></a>00678     cpl_msg_indent_more();
-<a name="l00679"></a>00679 
-<a name="l00680"></a>00680     spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00681"></a>00681 
-<a name="l00682"></a>00682     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00683"></a>00683         fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);
-<a name="l00684"></a>00684 
-<a name="l00685"></a>00685 
-<a name="l00686"></a>00686     cpl_msg_indent_less();
-<a name="l00687"></a>00687     cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);
-<a name="l00688"></a>00688     cpl_msg_indent_more();
-<a name="l00689"></a>00689 
-<a name="l00690"></a>00690     wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>, 1);
-<a name="l00691"></a>00691 
-<a name="l00692"></a>00692     <span class="keywordflow">if</span> (wavelengths == NULL)
-<a name="l00693"></a>00693         fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot load line catalog"</span>);
-<a name="l00694"></a>00694 
-<a name="l00695"></a>00695 
-<a name="l00696"></a>00696     <span class="comment">/*</span>
-<a name="l00697"></a>00697 <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l00698"></a>00698 <span class="comment">     */</span>
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700     nlines = cpl_table_get_nrow(wavelengths);
-<a name="l00701"></a>00701 
-<a name="l00702"></a>00702     <span class="keywordflow">if</span> (nlines == 0)
-<a name="l00703"></a>00703         fors_wave_calib_lss_exit(<span class="stringliteral">"Empty input line catalog"</span>);
-<a name="l00704"></a>00704 
-<a name="l00705"></a>00705     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l00706"></a>00706         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,
-<a name="l00707"></a>00707                       wcolumn);
-<a name="l00708"></a>00708         fors_wave_calib_lss_exit(NULL);
-<a name="l00709"></a>00709     }
-<a name="l00710"></a>00710 
-<a name="l00711"></a>00711     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00712"></a>00712 
-<a name="l00713"></a>00713     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l00714"></a>00714         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l00715"></a>00715 
-<a name="l00716"></a>00716     cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l00717"></a>00717 
-<a name="l00718"></a>00718     lines = cpl_vector_wrap(nlines, line);
-<a name="l00719"></a>00719 
-<a name="l00720"></a>00720 
-<a name="l00721"></a>00721     cpl_msg_indent_less();
-<a name="l00722"></a>00722     cpl_msg_info(recipe, <span class="stringliteral">"Perform wavelength calibration..."</span>);
-<a name="l00723"></a>00723     cpl_msg_indent_more();
-<a name="l00724"></a>00724 
-<a name="l00725"></a>00725     nx = cpl_image_get_size_x(spectra);
-<a name="l00726"></a>00726     ny = cpl_image_get_size_y(spectra);
-<a name="l00727"></a>00727 
-<a name="l00728"></a>00728     wavemap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l00729"></a>00729     idscoeff_all = cpl_table_new(ny);
-<a name="l00730"></a>00730 
-<a name="l00731"></a>00731     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(spectra))
-<a name="l00732"></a>00732     fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot process saturation"</span>);
-<a name="l00733"></a>00733 
-<a name="l00734"></a>00734     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(spectra))
-<a name="l00735"></a>00735     fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot subtract the background"</span>);
-<a name="l00736"></a>00736 
-<a name="l00737"></a>00737     rectified = <a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion,
-<a name="l00738"></a>00738                                                peakdetection, wradius,
-<a name="l00739"></a>00739                                                wdegree, wreject, reference,
-<a name="l00740"></a>00740                                                &startwavelength,
-<a name="l00741"></a>00741                                                &endwavelength, NULL,
-<a name="l00742"></a>00742                                                NULL, idscoeff_all, wavemap,
-<a name="l00743"></a>00743                                                NULL, NULL, NULL);
-<a name="l00744"></a>00744 
-<a name="l00745"></a>00745     <span class="keywordflow">if</span> (rectified == NULL)
-<a name="l00746"></a>00746         fors_wave_calib_lss_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l00747"></a>00747 
-<a name="l00748"></a>00748     cpl_image_delete(rectified); rectified = NULL;
-<a name="l00749"></a>00749 
-<a name="l00750"></a>00750     first_row = 0;
-<a name="l00751"></a>00751     <span class="keywordflow">while</span> (!cpl_table_is_valid(idscoeff_all, <span class="stringliteral">"c0"</span>, first_row))
-<a name="l00752"></a>00752         first_row++;
-<a name="l00753"></a>00753 
-<a name="l00754"></a>00754     last_row = ny - 1;
-<a name="l00755"></a>00755     <span class="keywordflow">while</span> (!cpl_table_is_valid(idscoeff_all, <span class="stringliteral">"c0"</span>, last_row))
-<a name="l00756"></a>00756         last_row--;
-<a name="l00757"></a>00757 
-<a name="l00758"></a>00758     ylow = first_row + 1;
-<a name="l00759"></a>00759     yhig = last_row + 1;
-<a name="l00760"></a>00760 
-<a name="l00761"></a>00761     dummy = cpl_image_extract(spectra, 1, ylow, nx, yhig);
-<a name="l00762"></a>00762     cpl_image_delete(spectra); spectra = dummy;
-<a name="l00763"></a>00763 
-<a name="l00764"></a>00764     ny = cpl_image_get_size_y(spectra);
-<a name="l00765"></a>00765 
-<a name="l00766"></a>00766     residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l00767"></a>00767 
-<a name="l00768"></a>00768     fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00769"></a>00769     fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l00770"></a>00770     idscoeff = cpl_table_new(ny);
-<a name="l00771"></a>00771 
-<a name="l00772"></a>00772     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(spectra))
-<a name="l00773"></a>00773     fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot process saturation"</span>);
-<a name="l00774"></a>00774 
-<a name="l00775"></a>00775     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(spectra))
-<a name="l00776"></a>00776     fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot subtract the background"</span>);
-<a name="l00777"></a>00777 
-<a name="l00778"></a>00778     rectified = <a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion,
-<a name="l00779"></a>00779                                                peakdetection, wradius,
-<a name="l00780"></a>00780                                                wdegree, wreject, reference,
-<a name="l00781"></a>00781                                                &startwavelength,
-<a name="l00782"></a>00782                                                &endwavelength, fitlines,
-<a name="l00783"></a>00783                                                fiterror, idscoeff, NULL,
-<a name="l00784"></a>00784                                                residual, NULL, NULL);
-<a name="l00785"></a>00785 
-<a name="l00786"></a>00786     <span class="keywordflow">if</span> (rectified == NULL)
-<a name="l00787"></a>00787         fors_wave_calib_lss_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l00788"></a>00788 
-<a name="l00789"></a>00789     <span class="comment">/*</span>
-<a name="l00790"></a>00790 <span class="comment">     * A dummy slit locations table</span>
-<a name="l00791"></a>00791 <span class="comment">     */</span>
-<a name="l00792"></a>00792 
-<a name="l00793"></a>00793     slits = cpl_table_new(1);
-<a name="l00794"></a>00794     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l00795"></a>00795     cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>, CPL_TYPE_DOUBLE);
-<a name="l00796"></a>00796     cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>, CPL_TYPE_DOUBLE);
-<a name="l00797"></a>00797     cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l00798"></a>00798     cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l00799"></a>00799     cpl_table_new_column(slits, <span class="stringliteral">"position"</span>, CPL_TYPE_INT);
-<a name="l00800"></a>00800     cpl_table_new_column(slits, <span class="stringliteral">"length"</span>, CPL_TYPE_INT);
-<a name="l00801"></a>00801     cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l00802"></a>00802     cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l00803"></a>00803     cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l00804"></a>00804     cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l00805"></a>00805     cpl_table_set_column_unit(slits, <span class="stringliteral">"position"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l00806"></a>00806     cpl_table_set_column_unit(slits, <span class="stringliteral">"length"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l00807"></a>00807     cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 0);
-<a name="l00808"></a>00808     cpl_table_set_double(slits, <span class="stringliteral">"xtop"</span>, 0, 0);
-<a name="l00809"></a>00809     cpl_table_set_double(slits, <span class="stringliteral">"ytop"</span>, 0, last_row);
-<a name="l00810"></a>00810     cpl_table_set_double(slits, <span class="stringliteral">"xbottom"</span>, 0, 0);
-<a name="l00811"></a>00811     cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, 0, first_row);
-<a name="l00812"></a>00812     cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, 0, 0);
-<a name="l00813"></a>00813     cpl_table_set_int(slits, <span class="stringliteral">"length"</span>, 0, ny);
-<a name="l00814"></a>00814 
-<a name="l00815"></a>00815     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,
-<a name="l00816"></a>00816                        parlist, recipe, version))
-<a name="l00817"></a>00817         fors_wave_calib_lss_exit(NULL);
-<a name="l00818"></a>00818 
-<a name="l00819"></a>00819     cpl_table_delete(slits); slits = NULL;
-<a name="l00820"></a>00820 
-<a name="l00821"></a>00821     <span class="keywordflow">if</span> (wmode) {
-<a name="l00822"></a>00822         cpl_image_delete(rectified); rectified = NULL;
-<a name="l00823"></a>00823         cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l00824"></a>00824 
-<a name="l00825"></a>00825         <span class="comment">/*</span>
-<a name="l00826"></a>00826 <span class="comment">         * Wavemap is intentionally NULL in the next two calls</span>
-<a name="l00827"></a>00827 <span class="comment">         */</span>
-<a name="l00828"></a>00828 
-<a name="l00829"></a>00829         <a class="code" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">mos_interpolate_wavecalib</a>(idscoeff, wavemap, wmode, 2);
-<a name="l00830"></a>00830         <a class="code" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">mos_interpolate_wavecalib</a>(idscoeff_all, wavemap, wmode, 2);
-<a name="l00831"></a>00831 
-<a name="l00832"></a>00832         wavemap = <a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(idscoeff_all, nx, reference,
-<a name="l00833"></a>00833                                    startwavelength, endwavelength);
-<a name="l00834"></a>00834         rectified = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(spectra, reference,
-<a name="l00835"></a>00835                                                startwavelength,
-<a name="l00836"></a>00836                                                endwavelength, dispersion,
-<a name="l00837"></a>00837                                                idscoeff, 0);
-<a name="l00838"></a>00838     }
-<a name="l00839"></a>00839 
-<a name="l00840"></a>00840     cpl_table_delete(idscoeff_all); idscoeff_all = NULL;
-<a name="l00841"></a>00841 
-<a name="l00842"></a>00842     cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;
-<a name="l00843"></a>00843     cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l00844"></a>00844     cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;
-<a name="l00845"></a>00845 
-<a name="l00846"></a>00846     <span class="keywordflow">for</span> (i = 0; i < ny; i++)
-<a name="l00847"></a>00847         <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))
-<a name="l00848"></a>00848             cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);
-<a name="l00849"></a>00849 
-<a name="l00850"></a>00850     cpl_msg_info(recipe, <span class="stringliteral">"Valid solutions found: %d out of %d rows"</span>,
-<a name="l00851"></a>00851                  ny - cpl_table_count_invalid(idscoeff, <span class="stringliteral">"c0"</span>), ny);
-<a name="l00852"></a>00852 
-<a name="l00853"></a>00853     cpl_image_delete(spectra); spectra = NULL;
-<a name="l00854"></a>00854 
-<a name="l00855"></a>00855     mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(rectified, lines, startwavelength,
-<a name="l00856"></a>00856                                    dispersion, 6, 0);
-<a name="l00857"></a>00857 
-<a name="l00858"></a>00858     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f pixel"</span>, mean_rms);
-<a name="l00859"></a>00859 
-<a name="l00860"></a>00860     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l00861"></a>00861 
-<a name="l00862"></a>00862     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,
-<a name="l00863"></a>00863                  mean_rms, mean_rms * dispersion);
-<a name="l00864"></a>00864 
-<a name="l00865"></a>00865     restab = <a class="code" href="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55">mos_resolution_table</a>(rectified, startwavelength, dispersion,
-<a name="l00866"></a>00866                                   60000, lines);
-<a name="l00867"></a>00867 
-<a name="l00868"></a>00868     <span class="keywordflow">if</span> (restab) {
-<a name="l00869"></a>00869         cpl_msg_info(recipe, <span class="stringliteral">"Mean spectral resolution: %.2f"</span>,
-<a name="l00870"></a>00870               cpl_table_get_column_mean(restab, <span class="stringliteral">"resolution"</span>));
-<a name="l00871"></a>00871         cpl_msg_info(recipe,
-<a name="l00872"></a>00872               <span class="stringliteral">"Mean reference lines FWHM: %.2f +/- %.2f pixel"</span>,
-<a name="l00873"></a>00873               cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm"</span>) / dispersion,
-<a name="l00874"></a>00874               cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm_rms"</span>) / dispersion);
-<a name="l00875"></a>00875 
-<a name="l00876"></a>00876         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, restab, spectral_resolution_tag,
-<a name="l00877"></a>00877                            NULL, parlist, recipe, version))
-<a name="l00878"></a>00878             fors_wave_calib_lss_exit(NULL);
-<a name="l00879"></a>00879 
-<a name="l00880"></a>00880         cpl_table_delete(restab); restab = NULL;
-<a name="l00881"></a>00881 
-<a name="l00882"></a>00882     }
-<a name="l00883"></a>00883     <span class="keywordflow">else</span>
-<a name="l00884"></a>00884         fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot compute the spectral "</span>
-<a name="l00885"></a>00885                                  <span class="stringliteral">"resolution table"</span>);
-<a name="l00886"></a>00886 
-<a name="l00887"></a>00887     cpl_vector_delete(lines); lines = NULL;
-<a name="l00888"></a>00888 
-<a name="l00889"></a>00889 
-<a name="l00890"></a>00890     <span class="comment">/*</span>
-<a name="l00891"></a>00891 <span class="comment">     * Save rectified arc lamp spectrum to disk</span>
-<a name="l00892"></a>00892 <span class="comment">     */</span>
-<a name="l00893"></a>00893 
-<a name="l00894"></a>00894     save_header = cpl_propertylist_new();
-<a name="l00895"></a>00895     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l00896"></a>00896     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l00897"></a>00897     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l00898"></a>00898                                    startwavelength + dispersion/2);
-<a name="l00899"></a>00899     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l00900"></a>00900     <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT1", dispersion);</span>
-<a name="l00901"></a>00901 <span class="comment">    cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span>
-<a name="l00902"></a>00902     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l00903"></a>00903     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l00904"></a>00904     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l00905"></a>00905     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l00906"></a>00906     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l00907"></a>00907     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l00908"></a>00908     cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, 1);
-<a name="l00909"></a>00909 
-<a name="l00910"></a>00910     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, rectified, reduced_lamp_tag, save_header,
-<a name="l00911"></a>00911                        parlist, recipe, version))
-<a name="l00912"></a>00912         fors_wave_calib_lss_exit(NULL);
-<a name="l00913"></a>00913 
-<a name="l00914"></a>00914     cpl_image_delete(rectified); rectified = NULL;
-<a name="l00915"></a>00915     cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l00916"></a>00916 
-<a name="l00917"></a>00917     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_coeff_tag, NULL,
-<a name="l00918"></a>00918                        parlist, recipe, version))
-<a name="l00919"></a>00919         fors_wave_calib_lss_exit(NULL);
-<a name="l00920"></a>00920 
-<a name="l00921"></a>00921     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l00922"></a>00922 
-<a name="l00923"></a>00923     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, wavemap, wavelength_map_tag, header,
-<a name="l00924"></a>00924                        parlist, recipe, version))
-<a name="l00925"></a>00925         fors_wave_calib_lss_exit(NULL);
-<a name="l00926"></a>00926 
-<a name="l00927"></a>00927     cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l00928"></a>00928     cpl_propertylist_delete(header); header = NULL;
-<a name="l00929"></a>00929     header = cpl_propertylist_new();
-<a name="l00930"></a>00930 
-<a name="l00931"></a>00931     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l00932"></a>00932     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l00933"></a>00933     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l00934"></a>00934     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, 1.0);
-<a name="l00935"></a>00935     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l00936"></a>00936     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l00937"></a>00937     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l00938"></a>00938     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l00939"></a>00939     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l00940"></a>00940 
-<a name="l00941"></a>00941     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, residual, disp_residuals_tag, header,
-<a name="l00942"></a>00942                        parlist, recipe, version))
-<a name="l00943"></a>00943         fors_wave_calib_lss_exit(NULL);
-<a name="l00944"></a>00944 
-<a name="l00945"></a>00945     cpl_image_delete(residual); residual = NULL;
-<a name="l00946"></a>00946     cpl_propertylist_delete(header); header = NULL;
-<a name="l00947"></a>00947 
-<a name="l00948"></a>00948     <span class="keywordflow">return</span> 0;
-<a name="l00949"></a>00949 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__wave__calib__lss_8c_source.html b/html/fors__wave__calib__lss_8c_source.html
new file mode 100644
index 0000000..e372f81
--- /dev/null
+++ b/html/fors__wave__calib__lss_8c_source.html
@@ -0,0 +1,964 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_wave_calib_lss.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_wave_calib_lss.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_wave_calib_lss.c,v 1.10 2013-09-09 12:25:33 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-09 12:25:33 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.10 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_wave_calib_lss_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to wavelength calibrate one long slit spectrum, i.e.,\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"a FORS spectral obtained either in LSS mode or in MOS/MXU mode with all\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"slits at the same offset. A pattern-matching algorithm is applied as in\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"recipe fors_detect_spectra. For more details on this data reduction\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"strategy please refer to the FORS Pipeline User's Manual.\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"Note that specifying an input GRISM_TABLE will set some of the recipe\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"configuration parameters to default values valid for a particular grism.\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"In the table below the LSS acronym can be alternatively read as MOS or\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"MXU.\n\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"  LAMP_UNBIAS_LSS            Calib       Arc lamp exposure       Y\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"  MASTER_LINECAT             Calib       Line catalog            Y\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"  REDUCED_LAMP_LSS           FITS image  Calibrated arc lamp exposure\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"  DISP_COEFF_LSS             FITS table  Inverse dispersion coefficients\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"  DISP_RESIDUALS_LSS         FITS image  Image of modeling residuals\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  WAVELENGTH_MAP_LSS         FITS image  Wavelengths mapped on CCD\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  SLIT_LOCATION_LSS          FITS image  Background subtracted arc frame\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"  SPECTRAL_RESOLUTION_LSS    FITS table  Spectral resolution table\n\n"</span>;</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">#define fors_wave_calib_lss_exit(message)     \</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">cpl_image_delete(residual);                   \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">cpl_table_delete(idscoeff_all);               \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">cpl_table_delete(restab);                     \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">#define fors_wave_calib_lss_exit_memcheck(message)  \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">{                                                   \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);         \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">printf("free spectra (%p)\n", spectra);             \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">cpl_image_delete(spectra);                          \</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">printf("free residual (%p)\n", residual);           \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">cpl_image_delete(residual);                         \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">printf("free rectified (%p)\n", rectified);         \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">cpl_image_delete(rectified);                        \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);             \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">cpl_image_delete(wavemap);                          \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table);     \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">cpl_table_delete(grism_table);                      \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths);     \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">cpl_table_delete(wavelengths);                      \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);         \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">cpl_table_delete(maskslits);                        \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);           \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">cpl_table_delete(idscoeff);                         \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">printf("free idscoeff_all (%p)\n", idscoeff_all);   \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">cpl_table_delete(idscoeff_all);                     \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">printf("free restab (%p)\n", restab);               \</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor">cpl_table_delete(restab);                           \</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">printf("free slits (%p)\n", slits);                 \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">cpl_table_delete(slits);                            \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">printf("free lines (%p)\n", lines);                 \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">cpl_vector_delete(lines);                           \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">printf("free header (%p)\n", header);               \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">cpl_propertylist_delete(header);                    \</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor">printf("free save_header (%p)\n", save_header);     \</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="preprocessor">cpl_propertylist_delete(save_header);               \</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">cpl_msg_indent_less();                              \</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">return 0;                                           \</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> {</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                     <span class="stringliteral">"fors_wave_calib_lss"</span>,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                     <span class="stringliteral">"Derive dispersion relation from long-slit arc lamp frame"</span>,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                     fors_wave_calib_lss_description,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>                     fors_wave_calib_lss_create,</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>                     fors_wave_calib_lss_exec,</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                     fors_wave_calib_lss_destroy);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     </div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> }</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="comment">     * Create the (empty) parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.dispersion"</span>,</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                                 0.0);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> </div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> <span class="comment">     * Peak detection level</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.peakdetection"</span>,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                                 0.0);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="comment">     * Degree of wavelength calibration polynomial</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> </div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.wdegree"</span>,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>                                 0);</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> </div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="comment">     * Reference lines search radius</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.wradius"</span>,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>                                 <span class="stringliteral">"with first-guess method"</span>,</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>                                 4);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> </div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.wreject"</span>,</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>                                 <span class="stringliteral">"Rejection threshold in dispersion "</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                                 <span class="stringliteral">"relation fit (pixel)"</span>,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                                 0.7);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> <span class="comment">     * Line catalog table column containing the reference wavelengths</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.wcolumn"</span>,</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>                                 <span class="stringliteral">"Name of line catalog table column "</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.startwavelength"</span>,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                                 0.0);</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.endwavelength"</span>,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>                                 0.0);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="comment">     * Wavelength solution interpolation</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>  </div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_wave_calib_lss.wmode"</span>,</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>                                 <span class="stringliteral">"Interpolation mode of wavelength solution "</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>                                 <span class="stringliteral">"(0 = no interpolation, 1 = fill gaps, "</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                                 <span class="stringliteral">"2 = global model)"</span>,</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>                                 <span class="stringliteral">"fors.fors_wave_calib_lss"</span>,</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>                                 2);</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wmode"</span>);</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> </div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> }</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> {</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     </div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordflow">return</span> fors_wave_calib_lss(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> }</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> {</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> }</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> </div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> </div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_wave_calib_lss(cpl_parameterlist *parlist, </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>                                cpl_frameset *frameset)</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> {</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_wave_calib_lss"</span>;</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     <span class="keywordtype">double</span>      peakdetection;</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     <span class="keywordtype">int</span>         wdegree;</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     <span class="keywordtype">int</span>         wradius;</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     <span class="keywordtype">double</span>      wreject;</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="keywordtype">int</span>         wmode;</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> </div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     cpl_image        *spectra      = NULL;</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     cpl_image        *rectified    = NULL;</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>     cpl_image        *wavemap      = NULL;</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     cpl_image        *residual     = NULL;</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     cpl_image        *dummy        = NULL;</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     cpl_table        *grism_table  = NULL;</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     cpl_table        *wavelengths  = NULL;</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_table        *slits        = NULL;</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     cpl_table        *idscoeff     = NULL;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     cpl_table        *idscoeff_all = NULL;</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     cpl_table        *maskslits    = NULL;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     cpl_table        *restab       = NULL;</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     cpl_vector       *lines        = NULL;</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     cpl_propertylist *header       = NULL;</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     cpl_propertylist *save_header  = NULL;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> </div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *arc_tag;</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_lamp_tag;</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_tag;</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_residuals_tag;</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectral_resolution_tag;</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     <span class="keywordtype">int</span>         mxu;</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordtype">int</span>         mos;</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>     <span class="keywordtype">int</span>         lss;</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="keywordtype">int</span>         treat_as_lss = 0;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     <span class="keywordtype">int</span>         nslits;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     <span class="keywordtype">double</span>      mean_rms;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     <span class="keywordtype">double</span>     *xpos;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     <span class="keywordtype">int</span>         narc;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     <span class="keywordtype">int</span>         nlines;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     <span class="keywordtype">double</span>     *line;</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     <span class="keywordtype">double</span>     *fiterror = NULL;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     <span class="keywordtype">int</span>        *fitlines = NULL;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     <span class="keywordtype">int</span>         first_row, last_row;</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     <span class="keywordtype">int</span>         ylow, yhig;</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> </div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     </div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>); </div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> </div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                     <span class="stringliteral">"fors.fors_wave_calib_lss.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     peakdetection = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>                     <span class="stringliteral">"fors.fors_wave_calib_lss.peakdetection"</span>, grism_table);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     <span class="keywordflow">if</span> (peakdetection <= 0.0)</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid peak detection level"</span>);</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     wdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>                     <span class="stringliteral">"fors.fors_wave_calib_lss.wdegree"</span>, grism_table);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span> </div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     <span class="keywordflow">if</span> (wdegree < 1)</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span> </div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     <span class="keywordflow">if</span> (wdegree > 5)</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     wradius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>                                     <span class="stringliteral">"fors.fors_wave_calib_lss.wradius"</span>, NULL);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> </div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     <span class="keywordflow">if</span> (wradius < 0)</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid search radius"</span>);</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span> </div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     wreject = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>                                     <span class="stringliteral">"fors.fors_wave_calib_lss.wreject"</span>, NULL);</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span> </div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>     <span class="keywordflow">if</span> (wreject <= 0.0)</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span> </div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     wmode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>                                     <span class="stringliteral">"fors.fors_wave_calib_lss.wmode"</span>, NULL);</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> </div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     <span class="keywordflow">if</span> (wmode < 0 || wmode > 2)</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid interpolation mode"</span>);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> </div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>                                     <span class="stringliteral">"fors.fors_wave_calib_lss.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span> </div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>                     <span class="stringliteral">"fors.fors_wave_calib_lss.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>             fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> </div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>                     <span class="stringliteral">"fors.fors_wave_calib_lss.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>             fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>             fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     }</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>             fors_wave_calib_lss_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> </div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> </div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Failure reading the configuration "</span></div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>                                  <span class="stringliteral">"parameters"</span>);</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> </div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> </div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) == 0)</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Missing required input: MASTER_LINECAT"</span>);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span> </div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>) > 1)</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Too many in input: MASTER_LINECAT"</span>);</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span> </div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>);</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>);</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>);</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> </div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     narc = mxu + mos + lss;</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> </div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     <span class="keywordflow">if</span> (narc == 0) {</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Missing input long-slit arc lamp frame"</span>);</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     }</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     <span class="keywordflow">if</span> (narc > 1) {</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input arc lamp frames (%d > 1)"</span>, narc);</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>         fors_wave_calib_lss_exit(NULL);</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     }</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span> </div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         arc_tag                 = <span class="stringliteral">"LAMP_UNBIAS_MXU"</span>;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MXU"</span>;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         reduced_lamp_tag        = <span class="stringliteral">"REDUCED_LAMP_MXU"</span>;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>         disp_residuals_tag      = <span class="stringliteral">"DISP_RESIDUALS_MXU"</span>;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MXU"</span>;</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>         wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_MXU"</span>;</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         spectral_resolution_tag = <span class="stringliteral">"SPECTRAL_RESOLUTION_MXU"</span>;</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     }</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>         arc_tag                 = <span class="stringliteral">"LAMP_UNBIAS_MOS"</span>;</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_MOS"</span>;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         reduced_lamp_tag        = <span class="stringliteral">"REDUCED_LAMP_MOS"</span>;</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>         disp_residuals_tag      = <span class="stringliteral">"DISP_RESIDUALS_MOS"</span>;</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_MOS"</span>;</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>         wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_MOS"</span>;</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         spectral_resolution_tag = <span class="stringliteral">"SPECTRAL_RESOLUTION_MOS"</span>;</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     }</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lss) {</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         arc_tag                 = <span class="stringliteral">"LAMP_UNBIAS_LSS"</span>;</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>         slit_location_tag       = <span class="stringliteral">"SLIT_LOCATION_LSS"</span>;</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>         reduced_lamp_tag        = <span class="stringliteral">"REDUCED_LAMP_LSS"</span>;</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>         disp_residuals_tag      = <span class="stringliteral">"DISP_RESIDUALS_LSS"</span>;</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>         disp_coeff_tag          = <span class="stringliteral">"DISP_COEFF_LSS"</span>;</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>         wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_LSS"</span>;</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>         spectral_resolution_tag = <span class="stringliteral">"SPECTRAL_RESOLUTION_LSS"</span>;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     }</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span> </div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> </div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> </div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span> </div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span> </div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> </div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span> <span class="comment">     * dispersion direction from the arc lamp exposure</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> </div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span> </div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> </div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span> </div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN "</span></div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>                                  <span class="stringliteral">"in arc lamp frame header"</span>);</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> </div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         reference *= 10;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> </div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in arc lamp frame header"</span>,</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>                       reference);</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>         fors_wave_calib_lss_exit(NULL);</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>     }</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span> </div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> </div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX "</span></div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>                                  <span class="stringliteral">"in arc lamp frame header"</span>);</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> </div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>                         <span class="stringliteral">"working dispersion used is %f A/pixel"</span>, rebin,</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>                         dispersion);</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     }</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span> </div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> </div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     <span class="keywordflow">if</span> (mos || mxu) {</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span> </div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         <span class="keywordtype">int</span> nslits_out_det = 0;</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> <span class="comment">         * Check if all slits have the same X offset. If not, this is the</span></div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span> <span class="comment">         * wrong recipe...</span></div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> </div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>         <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>             maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>             maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span> </div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>         treat_as_lss = fors_mos_is_lss_like(maskslits, nslits_out_det);</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span> </div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> </div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>         <span class="keywordflow">if</span> (!treat_as_lss)</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>             fors_wave_calib_lss_exit(<span class="stringliteral">"Input data are not long-slit data"</span>);</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     }</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span> </div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span> </div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> </div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span> </div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> </div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> </div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_LINECAT"</span>, 1);</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span> </div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     <span class="keywordflow">if</span> (wavelengths == NULL)</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot load line catalog"</span>);</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span> </div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span> </div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> </div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Empty input line catalog"</span>);</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> </div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>                       wcolumn);</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>         fors_wave_calib_lss_exit(NULL);</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     }</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span> </div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span> </div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> </div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span> </div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> </div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span> </div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     cpl_msg_info(recipe, <span class="stringliteral">"Perform wavelength calibration..."</span>);</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span> </div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> </div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     wavemap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     idscoeff_all = cpl_table_new(ny);</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span> </div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#ga854ead782f62a6929aade44b267353e0" title="Process saturation.">mos_saturation_process</a>(spectra))</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot process saturation"</span>);</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span> </div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0" title="Subtract the background.">mos_subtract_background</a>(spectra))</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot subtract the background"</span>);</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span> </div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     rectified = <a class="code" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion,</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>                                                peakdetection, wradius,</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>                                                wdegree, wreject, reference,</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>                                                &startwavelength,</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>                                                &endwavelength, NULL,</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>                                                NULL, idscoeff_all, wavemap,</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>                                                NULL, NULL, NULL, NULL);</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> </div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     <span class="keywordflow">if</span> (rectified == NULL)</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     cpl_image_delete(rectified); rectified = NULL;</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span> </div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     first_row = 0;</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     <span class="keywordflow">while</span> (!cpl_table_is_valid(idscoeff_all, <span class="stringliteral">"c0"</span>, first_row))</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>         first_row++;</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span> </div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     last_row = ny - 1;</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>     <span class="keywordflow">while</span> (!cpl_table_is_valid(idscoeff_all, <span class="stringliteral">"c0"</span>, last_row))</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>         last_row--;</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span> </div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>     ylow = first_row + 1;</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     yhig = last_row + 1;</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span> </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>     dummy = cpl_image_extract(spectra, 1, ylow, nx, yhig);</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>     cpl_image_delete(spectra); spectra = dummy;</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> </div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span> </div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>     residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span> </div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>     fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     idscoeff = cpl_table_new(ny);</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span> </div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#ga854ead782f62a6929aade44b267353e0" title="Process saturation.">mos_saturation_process</a>(spectra))</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot process saturation"</span>);</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0" title="Subtract the background.">mos_subtract_background</a>(spectra))</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot subtract the background"</span>);</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> </div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     rectified = <a class="code" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion,</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>                                                peakdetection, wradius,</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>                                                wdegree, wreject, reference,</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>                                                &startwavelength,</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>                                                &endwavelength, fitlines,</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>                                                fiterror, idscoeff, NULL,</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>                                                residual, NULL, NULL, NULL);</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span> </div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>     <span class="keywordflow">if</span> (rectified == NULL)</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span> </div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span> <span class="comment">     * A dummy slit locations table</span></div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> </div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     slits = cpl_table_new(1);</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>     cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>     cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>     cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     cpl_table_new_column(slits, <span class="stringliteral">"position"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>     cpl_table_new_column(slits, <span class="stringliteral">"length"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"position"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"length"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>     cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 0);</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     cpl_table_set_double(slits, <span class="stringliteral">"xtop"</span>, 0, 0);</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     cpl_table_set_double(slits, <span class="stringliteral">"ytop"</span>, 0, last_row);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     cpl_table_set_double(slits, <span class="stringliteral">"xbottom"</span>, 0, 0);</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, 0, first_row);</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, 0, 0);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     cpl_table_set_int(slits, <span class="stringliteral">"length"</span>, 0, ny);</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span> </div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>         fors_wave_calib_lss_exit(NULL);</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span> </div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span> </div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>     <span class="keywordflow">if</span> (wmode) {</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>         cpl_image_delete(rectified); rectified = NULL;</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>         cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span> </div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span> <span class="comment">         * Wavemap is intentionally NULL in the next two calls</span></div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span> </div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>         <a class="code" href="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4" title="Interpolate LSS wavelength calibration.">mos_interpolate_wavecalib</a>(idscoeff, wavemap, wmode, 2);</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>         <a class="code" href="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4" title="Interpolate LSS wavelength calibration.">mos_interpolate_wavecalib</a>(idscoeff_all, wavemap, wmode, 2);</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span> </div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>         wavemap = <a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(idscoeff_all, nx, reference,</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>                                    startwavelength, endwavelength);</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>         rectified = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(spectra, reference,</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>                                                startwavelength,</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>                                                endwavelength, dispersion,</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>                                                idscoeff, 0);</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>     }</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span> </div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     cpl_table_delete(idscoeff_all); idscoeff_all = NULL;</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span> </div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>     cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span> </div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>     <span class="keywordflow">for</span> (i = 0; i < ny; i++)</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>         <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>             cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span> </div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>     cpl_msg_info(recipe, <span class="stringliteral">"Valid solutions found: %d out of %d rows"</span>,</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>                  ny - cpl_table_count_invalid(idscoeff, <span class="stringliteral">"c0"</span>), ny);</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span> </div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span> </div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>     mean_rms = <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(rectified, lines, startwavelength,</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>                                    dispersion, 6, 0);</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span> </div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f pixel"</span>, mean_rms);</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span> </div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span> </div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>                  mean_rms, mean_rms * dispersion);</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span> </div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     restab = <a class="code" href="group__moses.html#gae9f633b64e1880984c084a19f53047fc" title="Compute mean spectral resolution at a given arc lamp line.">mos_resolution_table</a>(rectified, startwavelength, dispersion,</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>                                   60000, lines);</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span> </div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>     <span class="keywordflow">if</span> (restab) {</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>         cpl_msg_info(recipe, <span class="stringliteral">"Mean spectral resolution: %.2f"</span>,</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>               cpl_table_get_column_mean(restab, <span class="stringliteral">"resolution"</span>));</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>         cpl_msg_info(recipe,</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>               <span class="stringliteral">"Mean reference lines FWHM: %.2f +/- %.2f pixel"</span>,</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>               cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm"</span>) / dispersion,</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>               cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm_rms"</span>) / dispersion);</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span> </div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, restab, spectral_resolution_tag,</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>                            NULL, parlist, recipe, version))</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>             fors_wave_calib_lss_exit(NULL);</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span> </div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>         cpl_table_delete(restab); restab = NULL;</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span> </div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>     }</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>         fors_wave_calib_lss_exit(<span class="stringliteral">"Cannot compute the spectral "</span></div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>                                  <span class="stringliteral">"resolution table"</span>);</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span> </div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>     cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span> </div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span> </div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span> <span class="comment">     * Save rectified arc lamp spectrum to disk</span></div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span> </div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>     save_header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL1"</span>,</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>                                    startwavelength + dispersion/2);</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>     <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span> <span class="comment">    cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>     cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>     cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>     cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, 1);</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span> </div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, rectified, reduced_lamp_tag, save_header,</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>         fors_wave_calib_lss_exit(NULL);</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span> </div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>     cpl_image_delete(rectified); rectified = NULL;</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>     cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span> </div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, idscoeff, disp_coeff_tag, NULL,</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>         fors_wave_calib_lss_exit(NULL);</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span> </div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span> </div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, wavemap, wavelength_map_tag, header,</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>         fors_wave_calib_lss_exit(NULL);</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span> </div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>     cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>     header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span> </div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, 1.0);</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span> </div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, residual, disp_residuals_tag, header,</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>         fors_wave_calib_lss_exit(NULL);</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span> </div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>     cpl_image_delete(residual); residual = NULL;</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span> </div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__zeropoint-test_8c-source.html b/html/fors__zeropoint-test_8c-source.html
deleted file mode 100644
index 541fc8e..0000000
--- a/html/fors__zeropoint-test_8c-source.html
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_zeropoint-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>fors_zeropoint-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_zeropoint-test.c,v 1.18 2011/07/19 15:49:52 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/07/19 15:49:52 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.18 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_zeropoint_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <test.h></span>
-<a name="l00038"></a>00038 
-<a name="l00046"></a>00046 <span class="preprocessor">#undef cleanup</span>
-<a name="l00047"></a><a class="code" href="group__fors__zeropoint__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00047</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00048"></a>00048 <span class="preprocessor">do { \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">    cpl_frameset_delete(frames); \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">} while(0)</span>
-<a name="l00052"></a>00052 <span class="preprocessor"></span>
-<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00057"></a><a class="code" href="group__fors__zeropoint__test.html#gb2ce88d70507512e1c2a930875ef2380">00057</a> <a class="code" href="group__fors__zeropoint__test.html#gb2ce88d70507512e1c2a930875ef2380">test_zeropoint</a>(<span class="keywordtype">void</span>)
-<a name="l00058"></a>00058 {
-<a name="l00059"></a>00059     <span class="comment">/* Input */</span>
-<a name="l00060"></a>00060     cpl_frameset      *frames     = cpl_frameset_new();
-<a name="l00061"></a>00061     cpl_parameterlist *parameters = cpl_parameterlist_new();
-<a name="l00062"></a>00062     cpl_parameter     *p          = NULL;
-<a name="l00063"></a>00063     <span class="keywordtype">double</span> exptime = 1.0;
-<a name="l00064"></a>00064     <span class="comment">/* Products */</span>
-<a name="l00065"></a>00065     
-<a name="l00066"></a>00066     <span class="comment">/* Simulate data */</span>
-<a name="l00067"></a>00067     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b">create_standard</a>(<span class="stringliteral">"zeropoint_standard_img.fits"</span>,
-<a name="l00068"></a>00068                                                 STANDARD_IMG,
-<a name="l00069"></a>00069                                                 CPL_FRAME_GROUP_RAW));
-<a name="l00070"></a>00070     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">create_bias</a>(<span class="stringliteral">"zeropoint_master_bias.fits"</span>,
-<a name="l00071"></a>00071                                             MASTER_BIAS,
-<a name="l00072"></a>00072                                             CPL_FRAME_GROUP_CALIB));
-<a name="l00073"></a>00073     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669">create_sky_flat</a>(<span class="stringliteral">"zeropoint_master_sky_flat.fits"</span>,
-<a name="l00074"></a>00074                                                 MASTER_SKY_FLAT_IMG,
-<a name="l00075"></a>00075                                                 CPL_FRAME_GROUP_CALIB, exptime));
-<a name="l00076"></a>00076     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410">create_std_cat</a>(<span class="stringliteral">"zeropoint_std_cat.fits"</span>,
-<a name="l00077"></a>00077                                                FLX_STD_IMG,
-<a name="l00078"></a>00078                                                CPL_FRAME_GROUP_CALIB));
-<a name="l00079"></a>00079     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5">create_phot_table</a>(<span class="stringliteral">"zeropoint_phot_table.fits"</span>,
-<a name="l00080"></a>00080                                                   PHOT_TABLE,
-<a name="l00081"></a>00081                                                   CPL_FRAME_GROUP_CALIB));
-<a name="l00082"></a>00082     
-<a name="l00083"></a>00083     <span class="comment">/* Set parameters */</span>
-<a name="l00084"></a>00084     <a class="code" href="group__fors__zeropoint.html#gc2cbbec604bd9b8cabf9f83fe71037da">fors_zeropoint_define_parameters</a>(parameters);
-<a name="l00085"></a>00085     p = cpl_parameter_new_enum(<span class="stringliteral">"fors.fors_zeropoint.extract_method"</span>,
-<a name="l00086"></a>00086                                CPL_TYPE_STRING,
-<a name="l00087"></a>00087                                <span class="stringliteral">"Source extraction method"</span>,
-<a name="l00088"></a>00088                                <span class="stringliteral">"fors.fors_zeropoint"</span>,
-<a name="l00089"></a>00089                                <span class="stringliteral">"sex"</span>, 2,
-<a name="l00090"></a>00090                                <span class="stringliteral">"sex"</span>, <span class="stringliteral">"test"</span>);
-<a name="l00091"></a>00091     cpl_parameterlist_append(parameters, p);
-<a name="l00092"></a>00092     
-<a name="l00093"></a>00093     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00094"></a>00094             <span class="stringliteral">"Create parameters failed"</span>);
-<a name="l00095"></a>00095     
-<a name="l00096"></a>00096     <a class="code" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">fors_parameterlist_set_defaults</a>(parameters);
-<a name="l00097"></a>00097  
-<a name="l00098"></a>00098     <span class="comment">/* Do not rely on SExtractor for this unit test */</span>
-<a name="l00099"></a>00099     cpl_parameter_set_string(cpl_parameterlist_find(parameters,
-<a name="l00100"></a>00100                                                     <span class="stringliteral">"fors.fors_zeropoint.extract_method"</span>),
-<a name="l00101"></a>00101                              <span class="stringliteral">"test"</span>);
-<a name="l00102"></a>00102 
-<a name="l00103"></a>00103     <span class="comment">/* Note: the extracted source positions do not match the catalogue,</span>
-<a name="l00104"></a>00104 <span class="comment">       but the recipe will find a solution anyway by increasing the</span>
-<a name="l00105"></a>00105 <span class="comment">       search radius. Suppress warnings */</span>
-<a name="l00106"></a>00106     cpl_msg_severity before = cpl_msg_get_level();
-<a name="l00107"></a>00107     cpl_msg_set_level(CPL_MSG_ERROR);
-<a name="l00108"></a>00108 
-<a name="l00109"></a>00109 <span class="comment">// Disable test until pattern-matching vs robust shift is decided.</span>
-<a name="l00110"></a>00110 <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00111"></a>00111 <span class="keywordflow">return</span>;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <a class="code" href="group__fors__zeropoint.html#gffa00ce29ad3796187cf1336e4fcbb61">fors_zeropoint</a>(frames, parameters);
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115     cpl_msg_set_level(before);
-<a name="l00116"></a>00116 
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118 
-<a name="l00119"></a>00119     <span class="comment">/* Test existence of QC + products */</span>
-<a name="l00120"></a>00120     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[] = {SOURCES_STD, 
-<a name="l00121"></a>00121                                         ALIGNED_PHOT, 
-<a name="l00122"></a>00122                                         STANDARD_REDUCED_IMG, 
-<a name="l00123"></a>00123                                         PHOT_BACKGROUND_STD_IMG};
-<a name="l00124"></a>00124     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[] = 
-<a name="l00125"></a>00125         {<span class="stringliteral">"QC ZPOINT"</span>, <span class="stringliteral">"QC ZPOINTRMS"</span>, <span class="stringliteral">"QC ZPOINT NSTARS"</span>,
-<a name="l00126"></a>00126          <span class="stringliteral">"QC EXTCOEFF"</span>};
-<a name="l00127"></a>00127     <span class="keyword">const</span> <span class="keywordtype">char</span> *main_product = ALIGNED_PHOT;
-<a name="l00128"></a>00128 
-<a name="l00129"></a>00129     <a class="code" href="group__test.html#ge4730f9510e545e738aef9c8b7459b8b">test_recipe_output</a>(frames, 
-<a name="l00130"></a>00130                        product_tags, <span class="keyword">sizeof</span> product_tags / <span class="keyword">sizeof</span> *product_tags,
-<a name="l00131"></a>00131                main_product,
-<a name="l00132"></a>00132                        qc, <span class="keyword">sizeof</span> qc / <span class="keyword">sizeof</span> *qc);
-<a name="l00133"></a>00133         
-<a name="l00134"></a>00134     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00135"></a>00135     <span class="keywordflow">return</span>;
-<a name="l00136"></a>00136 }
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138 
-<a name="l00142"></a><a class="code" href="group__fors__zeropoint__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00142</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00143"></a>00143 {
-<a name="l00144"></a>00144     TEST_INIT;
-<a name="l00145"></a>00145 
-<a name="l00146"></a>00146     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span>
-<a name="l00147"></a>00147     <a class="code" href="group__fors__zeropoint__test.html#gb2ce88d70507512e1c2a930875ef2380">test_zeropoint</a>();
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149     TEST_END;
-<a name="l00150"></a>00150 }
-<a name="l00151"></a>00151 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__zeropoint-test_8c_source.html b/html/fors__zeropoint-test_8c_source.html
new file mode 100644
index 0000000..a1ab565
--- /dev/null
+++ b/html/fors__zeropoint-test_8c_source.html
@@ -0,0 +1,199 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_zeropoint-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_zeropoint-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_zeropoint-test.c,v 1.18 2011-07-19 15:49:52 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-07-19 15:49:52 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.18 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_zeropoint_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">    cpl_frameset_delete(frames); \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">    cpl_parameterlist_delete(parameters); \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="group__fors__zeropoint__test.html#ga593b93a1917f63d7660af1ea61da6f94">   57</a></span> <a class="code" href="group__fors__zeropoint__test.html#ga593b93a1917f63d7660af1ea61da6f94" title="Test zeropoint recipe.">test_zeropoint</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> {</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>     <span class="comment">/* Input */</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>     cpl_frameset      *frames     = cpl_frameset_new();</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>     cpl_parameterlist *parameters = cpl_parameterlist_new();</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>     cpl_parameter     *p          = NULL;</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>     <span class="keywordtype">double</span> exptime = 1.0;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     <span class="comment">/* Products */</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     <span class="comment">/* Simulate data */</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164" title="Create standard star image.">create_standard</a>(<span class="stringliteral">"zeropoint_standard_img.fits"</span>,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                                 STANDARD_IMG,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                                 CPL_FRAME_GROUP_RAW));</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e" title="Simulate bias image.">create_bias</a>(<span class="stringliteral">"zeropoint_master_bias.fits"</span>,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                                             MASTER_BIAS,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                                             CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103" title="Simulate sky flat image.">create_sky_flat</a>(<span class="stringliteral">"zeropoint_master_sky_flat.fits"</span>,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                                                 MASTER_SKY_FLAT_IMG,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                                                 CPL_FRAME_GROUP_CALIB, exptime));</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3" title="Create standard star catalogue.">create_std_cat</a>(<span class="stringliteral">"zeropoint_std_cat.fits"</span>,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                                                FLX_STD_IMG,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                                                CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_frameset_insert(frames, <a class="code" href="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b" title="Create photometry table.">create_phot_table</a>(<span class="stringliteral">"zeropoint_phot_table.fits"</span>,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                                                   PHOT_TABLE,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                                                   CPL_FRAME_GROUP_CALIB));</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     <span class="comment">/* Set parameters */</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     <a class="code" href="group__fors__zeropoint.html#ga1fc8917da8d302964ad2d2dc6d0eff67" title="Define recipe parameters.">fors_zeropoint_define_parameters</a>(parameters);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     p = cpl_parameter_new_enum(<span class="stringliteral">"fors.fors_zeropoint.extract_method"</span>,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                                CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                                <span class="stringliteral">"Source extraction method"</span>,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                                <span class="stringliteral">"fors.fors_zeropoint"</span>,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                                <span class="stringliteral">"sex"</span>, 2,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                                <span class="stringliteral">"sex"</span>, <span class="stringliteral">"test"</span>);</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>             <span class="stringliteral">"Create parameters failed"</span>);</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <a class="code" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42" title="Set unset parameters to default value.">fors_parameterlist_set_defaults</a>(parameters);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>  </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <span class="comment">/* Do not rely on SExtractor for this unit test */</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     cpl_parameter_set_string(cpl_parameterlist_find(parameters,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                                                     <span class="stringliteral">"fors.fors_zeropoint.extract_method"</span>),</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                              <span class="stringliteral">"test"</span>);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> </div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     <span class="comment">/* Note: the extracted source positions do not match the catalogue,</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="comment">       but the recipe will find a solution anyway by increasing the</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="comment">       search radius. Suppress warnings */</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     cpl_msg_severity before = cpl_msg_get_level();</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     cpl_msg_set_level(CPL_MSG_ERROR);</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="comment">// Disable test until pattern-matching vs robust shift is decided.</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> cleanup;</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <a class="code" href="group__fors__zeropoint.html#ga6e4245b398bb089daaaed5ec204e0c4f" title="Do the processing.">fors_zeropoint</a>(frames, parameters);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     cpl_msg_set_level(before);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     <span class="comment">/* Test existence of QC + products */</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[] = {SOURCES_STD, </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                                         ALIGNED_PHOT, </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                                         STANDARD_REDUCED_IMG, </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                                         PHOT_BACKGROUND_STD_IMG};</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[] = </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>         {<span class="stringliteral">"QC ZPOINT"</span>, <span class="stringliteral">"QC ZPOINTRMS"</span>, <span class="stringliteral">"QC ZPOINT NSTARS"</span>,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>          <span class="stringliteral">"QC EXTCOEFF"</span>};</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *main_product = ALIGNED_PHOT;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <a class="code" href="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c" title="Test existence of recipe products.">test_recipe_output</a>(frames, </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                        product_tags, <span class="keyword">sizeof</span> product_tags / <span class="keyword">sizeof</span> *product_tags,</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>                main_product,</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>                        qc, <span class="keyword">sizeof</span> qc / <span class="keyword">sizeof</span> *qc);</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>         </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     cleanup;</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> }</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno"><a class="code" href="group__fors__zeropoint__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  142</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> {</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     TEST_INIT;</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="comment">/* cpl_msg_set_level(CPL_MSG_DEBUG); */</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <a class="code" href="group__fors__zeropoint__test.html#ga593b93a1917f63d7660af1ea61da6f94" title="Test zeropoint recipe.">test_zeropoint</a>();</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     TEST_END;</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> }</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__zeropoint_8c-source.html b/html/fors__zeropoint_8c-source.html
deleted file mode 100644
index 8aac77c..0000000
--- a/html/fors__zeropoint_8c-source.html
+++ /dev/null
@@ -1,198 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_zeropoint.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>fors_zeropoint.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_zeropoint.c,v 1.8 2011/10/12 15:01:16 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2011/10/12 15:01:16 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.8 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_zeropoint_impl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#gb81bff380e7ee1d22c3c6620620771bf">fors_zeropoint_create</a>(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#g9aa95cb40ce84db79ab3006d51e7059d">fors_zeropoint_exec</a>(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#g095db561f9e785a5a4114d97f4597baf">fors_zeropoint_destroy</a>(cpl_plugin *);
-<a name="l00041"></a>00041 
-<a name="l00062"></a><a class="code" href="group__fors__zeropoint.html#g4abb403976fc3ddcaa614c59a44590c9">00062</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00063"></a>00063 {
-<a name="l00064"></a>00064     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00065"></a>00065     cpl_plugin *plugin = &recipe->interface;
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>())
-<a name="l00068"></a>00068     {
-<a name="l00069"></a>00069         cpl_msg_error(cpl_func, 
-<a name="l00070"></a>00070               <span class="stringliteral">"I am fors_zeropoint version %d, but I am linking "</span>
-<a name="l00071"></a>00071               <span class="stringliteral">"against the FORS library version %d. "</span>
-<a name="l00072"></a>00072               <span class="stringliteral">"This will not work. "</span>
-<a name="l00073"></a>00073               <span class="stringliteral">"Please remove all previous installations "</span>
-<a name="l00074"></a>00074               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,
-<a name="l00075"></a>00075               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a>());
-<a name="l00076"></a>00076         <span class="keywordflow">return</span> 1;
-<a name="l00077"></a>00077     }
-<a name="l00078"></a>00078 
-<a name="l00079"></a>00079     cpl_plugin_init(plugin,
-<a name="l00080"></a>00080                     CPL_PLUGIN_API,
-<a name="l00081"></a>00081                     FORS_BINARY_VERSION,
-<a name="l00082"></a>00082                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00083"></a>00083                     <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a>,
-<a name="l00084"></a>00084                     <a class="code" href="group__fors__zeropoint.html#gb767da8d66a60c2cebce3ffcaa774ab2">fors_zeropoint_description_short</a>,
-<a name="l00085"></a>00085                     <a class="code" href="group__fors__zeropoint.html#g69cec4407efc0bcccde712800aaa577c">fors_zeropoint_description</a>,
-<a name="l00086"></a>00086                     <a class="code" href="group__fors__zeropoint.html#g00e12f69bfe9efa90b14931c583e30d5">fors_zeropoint_author</a>,
-<a name="l00087"></a>00087                     <a class="code" href="group__fors__zeropoint.html#g95121b604add15227dc70f28cef1053c">fors_zeropoint_email</a>,
-<a name="l00088"></a>00088                     <a class="code" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a>(),
-<a name="l00089"></a>00089                     <a class="code" href="group__fors__zeropoint.html#gb81bff380e7ee1d22c3c6620620771bf">fors_zeropoint_create</a>,
-<a name="l00090"></a>00090                     <a class="code" href="group__fors__zeropoint.html#g9aa95cb40ce84db79ab3006d51e7059d">fors_zeropoint_exec</a>,
-<a name="l00091"></a>00091                     <a class="code" href="group__fors__zeropoint.html#g095db561f9e785a5a4114d97f4597baf">fors_zeropoint_destroy</a>);
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     cpl_pluginlist_append(list, plugin);
-<a name="l00094"></a>00094     
-<a name="l00095"></a>00095     <span class="keywordflow">return</span> 0;
-<a name="l00096"></a>00096 }
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 
-<a name="l00109"></a><a class="code" href="group__fors__zeropoint.html#gb81bff380e7ee1d22c3c6620620771bf">00109</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#gb81bff380e7ee1d22c3c6620620771bf">fors_zeropoint_create</a>(cpl_plugin *plugin)
-<a name="l00110"></a>00110 {
-<a name="l00111"></a>00111     cpl_recipe    *recipe;
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00114"></a>00114         cpl_msg_error(cpl_func, 
-<a name="l00115"></a>00115                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00116"></a>00116                       <span class="stringliteral">"refusing to create recipe fors_zeropoint"</span>, 
-<a name="l00117"></a>00117                       cpl_error_get_message());
-<a name="l00118"></a>00118         <span class="keywordflow">return</span> 1;
-<a name="l00119"></a>00119     }
-<a name="l00120"></a>00120     
-<a name="l00121"></a>00121     <span class="comment">/* </span>
-<a name="l00122"></a>00122 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00123"></a>00123 <span class="comment">     */</span>
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00126"></a>00126         recipe = (cpl_recipe *)plugin;
-<a name="l00127"></a>00127     }
-<a name="l00128"></a>00128     <span class="keywordflow">else</span> {
-<a name="l00129"></a>00129         <span class="keywordflow">return</span> 1;
-<a name="l00130"></a>00130     }
-<a name="l00131"></a>00131 
-<a name="l00132"></a>00132     <span class="comment">/* </span>
-<a name="l00133"></a>00133 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00134"></a>00134 <span class="comment">     */</span>
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00137"></a>00137     
-<a name="l00138"></a>00138     <a class="code" href="group__fors__zeropoint.html#gc2cbbec604bd9b8cabf9f83fe71037da">fors_zeropoint_define_parameters</a>(recipe->parameters);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00141"></a>00141         cpl_msg_error(cpl_func, 
-<a name="l00142"></a>00142                       <span class="stringliteral">"Could not create fors_zeropoint parameters"</span>);
-<a name="l00143"></a>00143         <span class="keywordflow">return</span> 1;
-<a name="l00144"></a>00144     }
-<a name="l00145"></a>00145         
-<a name="l00146"></a>00146     <span class="keywordflow">return</span> 0;
-<a name="l00147"></a>00147 }
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 
-<a name="l00158"></a><a class="code" href="group__fors__zeropoint.html#g9aa95cb40ce84db79ab3006d51e7059d">00158</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#g9aa95cb40ce84db79ab3006d51e7059d">fors_zeropoint_exec</a>(cpl_plugin *plugin)
-<a name="l00159"></a>00159 {
-<a name="l00160"></a>00160     cpl_recipe *recipe;
-<a name="l00161"></a>00161     cpl_errorstate initial_errorstate = cpl_errorstate_get();
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00164"></a>00164         cpl_msg_error(cpl_func, 
-<a name="l00165"></a>00165                       <span class="stringliteral">"CPL error code is set (%s), "</span>
-<a name="l00166"></a>00166                       <span class="stringliteral">"refusing to execute recipe fors_zeropoint"</span>, 
-<a name="l00167"></a>00167                       cpl_error_get_message());
-<a name="l00168"></a>00168         <span class="keywordflow">return</span> 1;
-<a name="l00169"></a>00169     }
-<a name="l00170"></a>00170     
-<a name="l00171"></a>00171     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00172"></a>00172         recipe = (cpl_recipe *)plugin;
-<a name="l00173"></a>00173     }
-<a name="l00174"></a>00174     <span class="keywordflow">else</span> {
-<a name="l00175"></a>00175         <span class="keywordflow">return</span> 1;
-<a name="l00176"></a>00176     }
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="keywordflow">if</span> (recipe->frames == NULL) {
-<a name="l00179"></a>00179         cpl_msg_error(cpl_func, 
-<a name="l00180"></a>00180                       <span class="stringliteral">"Null frameset"</span>);
-<a name="l00181"></a>00181         <span class="keywordflow">return</span> 1;
-<a name="l00182"></a>00182     }
-<a name="l00183"></a>00183 
-<a name="l00184"></a>00184     <span class="keywordflow">if</span> (recipe->parameters == NULL) {
-<a name="l00185"></a>00185         cpl_msg_error(cpl_func, 
-<a name="l00186"></a>00186                       <span class="stringliteral">"Null parameter list"</span>);
-<a name="l00187"></a>00187         <span class="keywordflow">return</span> 1;
-<a name="l00188"></a>00188     }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190     <a class="code" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a>(recipe->frames,
-<a name="l00191"></a>00191                <a class="code" href="group__fors__zeropoint.html#gb767da8d66a60c2cebce3ffcaa774ab2">fors_zeropoint_description_short</a>);
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193     <a class="code" href="group__fors__zeropoint.html#gffa00ce29ad3796187cf1336e4fcbb61">fors_zeropoint</a>(recipe->frames, recipe->parameters);
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a>(recipe->frames, initial_errorstate);
-<a name="l00196"></a>00196 }
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 
-<a name="l00207"></a><a class="code" href="group__fors__zeropoint.html#g095db561f9e785a5a4114d97f4597baf">00207</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#g095db561f9e785a5a4114d97f4597baf">fors_zeropoint_destroy</a>(cpl_plugin *plugin)
-<a name="l00208"></a>00208 {
-<a name="l00209"></a>00209     cpl_recipe *recipe;
-<a name="l00210"></a>00210     
-<a name="l00211"></a>00211     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {
-<a name="l00212"></a>00212         recipe = (cpl_recipe *)plugin;
-<a name="l00213"></a>00213     }
-<a name="l00214"></a>00214     <span class="keywordflow">else</span> {
-<a name="l00215"></a>00215         <span class="keywordflow">return</span> -1;
-<a name="l00216"></a>00216     }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     <span class="keywordflow">return</span> 0;
-<a name="l00221"></a>00221 }
-<a name="l00222"></a>00222 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__zeropoint_8c_source.html b/html/fors__zeropoint_8c_source.html
new file mode 100644
index 0000000..5533280
--- /dev/null
+++ b/html/fors__zeropoint_8c_source.html
@@ -0,0 +1,237 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_zeropoint.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_zeropoint.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_zeropoint.c,v 1.8 2011-10-12 15:01:16 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2011-10-12 15:01:16 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.8 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_zeropoint_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#ga61984b5bc62bd25dbff9e414a7db42e3" title="Setup the recipe options.">fors_zeropoint_create</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#ga606fac5ca2e3be91e2e65dbb943cdc66" title="Execute the plugin instance given by the interface.">fors_zeropoint_exec</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#ga77d581a8f85987937b006ba302ca4c7e" title="Destroy what has been created by the 'create' function.">fors_zeropoint_destroy</a>(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">   62</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> {</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>     <span class="keywordflow">if</span> (FORS_BINARY_VERSION != <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>())</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>     {</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>               <span class="stringliteral">"I am fors_zeropoint version %d, but I am linking "</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>               <span class="stringliteral">"against the FORS library version %d. "</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>               <span class="stringliteral">"This will not work. "</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>               <span class="stringliteral">"Please remove all previous installations "</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>               <span class="stringliteral">"of the "</span> PACKAGE_NAME <span class="stringliteral">" and try again."</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>               FORS_BINARY_VERSION, <a class="code" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74" title="Get FORS library binary version number.">fors_get_version_binary</a>());</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     }</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> </div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                     fors_zeropoint_name,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                     fors_zeropoint_description_short,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     fors_zeropoint_description,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                     fors_zeropoint_author,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                     fors_zeropoint_email,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     <a class="code" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87" title="Get the pipeline copyright and license.">fors_get_license</a>(),</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     <a class="code" href="group__fors__zeropoint.html#ga61984b5bc62bd25dbff9e414a7db42e3" title="Setup the recipe options.">fors_zeropoint_create</a>,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     <a class="code" href="group__fors__zeropoint.html#ga606fac5ca2e3be91e2e65dbb943cdc66" title="Execute the plugin instance given by the interface.">fors_zeropoint_exec</a>,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <a class="code" href="group__fors__zeropoint.html#ga77d581a8f85987937b006ba302ca4c7e" title="Destroy what has been created by the 'create' function.">fors_zeropoint_destroy</a>);</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> }</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga61984b5bc62bd25dbff9e414a7db42e3">  109</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#ga61984b5bc62bd25dbff9e414a7db42e3" title="Setup the recipe options.">fors_zeropoint_create</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                       <span class="stringliteral">"refusing to create recipe fors_zeropoint"</span>, </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     }</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     }</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     <a class="code" href="group__fors__zeropoint.html#ga1fc8917da8d302964ad2d2dc6d0eff67" title="Define recipe parameters.">fors_zeropoint_define_parameters</a>(recipe->parameters);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                       <span class="stringliteral">"Could not create fors_zeropoint parameters"</span>);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     }</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> }</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga606fac5ca2e3be91e2e65dbb943cdc66">  158</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#ga606fac5ca2e3be91e2e65dbb943cdc66" title="Execute the plugin instance given by the interface.">fors_zeropoint_exec</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> {</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_errorstate initial_errorstate = cpl_errorstate_get();</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                       <span class="stringliteral">"CPL error code is set (%s), "</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>                       <span class="stringliteral">"refusing to execute recipe fors_zeropoint"</span>, </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     }</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keywordflow">if</span> (recipe->frames == NULL) {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                       <span class="stringliteral">"Null frameset"</span>);</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     }</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">if</span> (recipe->parameters == NULL) {</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                       <span class="stringliteral">"Null parameter list"</span>);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <a class="code" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce" title="Start recipe execution.">fors_begin</a>(recipe->frames,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                fors_zeropoint_description_short);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <a class="code" href="group__fors__zeropoint.html#ga6e4245b398bb089daaaed5ec204e0c4f" title="Do the processing.">fors_zeropoint</a>(recipe->frames, recipe->parameters);</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">return</span> <a class="code" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9" title="End recipe execution.">fors_end</a>(recipe->frames, initial_errorstate);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> }</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga77d581a8f85987937b006ba302ca4c7e">  207</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__zeropoint.html#ga77d581a8f85987937b006ba302ca4c7e" title="Destroy what has been created by the 'create' function.">fors_zeropoint_destroy</a>(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> {</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) {</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     }</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> }</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__zeropoint__impl_8c-source.html b/html/fors__zeropoint__impl_8c-source.html
deleted file mode 100644
index 1a66506..0000000
--- a/html/fors__zeropoint__impl_8c-source.html
+++ /dev/null
@@ -1,1537 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_zeropoint_impl.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_zeropoint_impl.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_zeropoint_impl.c,v 1.93 2013/02/15 10:56:21 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/02/15 10:56:21 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.93 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <fors_zeropoint_impl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_extract.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_identify.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_tools.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_star.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_std_cat.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_std_star.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00041"></a>00041 <span class="preprocessor">#include <fors_instrument.h></span>
-<a name="l00042"></a>00042 <span class="preprocessor">#include <fors_data.h></span>
-<a name="l00043"></a>00043 <span class="preprocessor">#include <fors_setting.h></span>
-<a name="l00044"></a>00044 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00045"></a>00045 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00046"></a>00046 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00049"></a>00049 
-<a name="l00050"></a>00050 <span class="preprocessor">#include <math.h></span>
-<a name="l00051"></a>00051 
-<a name="l00058"></a><a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">00058</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a> = <span class="stringliteral">"fors_zeropoint"</span>;
-<a name="l00059"></a><a class="code" href="group__fors__zeropoint.html#gb767da8d66a60c2cebce3ffcaa774ab2">00059</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__zeropoint.html#gb767da8d66a60c2cebce3ffcaa774ab2">fors_zeropoint_description_short</a> = <span class="stringliteral">"Compute zeropoint"</span>;
-<a name="l00060"></a><a class="code" href="group__fors__zeropoint.html#g00e12f69bfe9efa90b14931c583e30d5">00060</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__zeropoint.html#g00e12f69bfe9efa90b14931c583e30d5">fors_zeropoint_author</a> = <span class="stringliteral">"Jonas M. Larsen"</span>;
-<a name="l00061"></a><a class="code" href="group__fors__zeropoint.html#g95121b604add15227dc70f28cef1053c">00061</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__zeropoint.html#g95121b604add15227dc70f28cef1053c">fors_zeropoint_email</a> = PACKAGE_BUGREPORT;
-<a name="l00062"></a><a class="code" href="group__fors__zeropoint.html#g69cec4407efc0bcccde712800aaa577c">00062</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__zeropoint.html#g69cec4407efc0bcccde712800aaa577c">fors_zeropoint_description</a> = 
-<a name="l00063"></a>00063 <span class="stringliteral">"Input files:\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"  DO category:               Type:       Explanation:              Number:\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"  STANDARD_IMG               FITS image  Phot. standard field        1\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flatfield        1\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"  FLX_STD_IMG                FITS table  Standard star catalog       1+\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  PHOT_TABLE                 FITS table  Filter ext. coeff, color    1\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"Output files:\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"  SOURCES_STD_IMG            FITS image  Unfiltered SExtractor output\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"  ALIGNED_PHOT               FITS table\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"  PHOT_BACKGROUND_STD_IMG    FITS image  Reduced science image background\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"  STANDARD_REDUCED_IMG       FITS image  Reduced std image\n"</span>;
-<a name="l00077"></a>00077 
-<a name="l00078"></a>00078 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00079"></a>00079 <a class="code" href="group__fors__zeropoint.html#gfd13851752bdf8327fb014e47c6bb104">get_zeropoint</a>(fors_star_list *stars, 
-<a name="l00080"></a>00080               <span class="keywordtype">double</span> cutoffE,
-<a name="l00081"></a>00081               <span class="keywordtype">double</span> cutoffk,
-<a name="l00082"></a>00082               <span class="keywordtype">double</span> dext_coeff,
-<a name="l00083"></a>00083               <span class="keywordtype">double</span> dcolor_term,
-<a name="l00084"></a>00084               <span class="keywordtype">double</span> avg_airmass,
-<a name="l00085"></a>00085               <span class="keywordtype">double</span> *dzeropoint,
-<a name="l00086"></a>00086               <span class="keywordtype">int</span> *n);
-<a name="l00087"></a>00087 
-<a name="l00088"></a>00088 <span class="keyword">static</span> cpl_error_code
-<a name="l00089"></a>00089 <a class="code" href="group__fors__zeropoint.html#g3222d4735fe218be5da224f3a146580b">fors_zeropoint_astrometry</a>(                  <span class="keyword">const</span> cpl_frameset  *std_cat_frames,
-<a name="l00090"></a>00090                                             <span class="keywordtype">char</span>                filter_band,
-<a name="l00091"></a>00091                                             <span class="keywordtype">double</span>              color_correct,
-<a name="l00092"></a>00092                                             <span class="keywordtype">double</span>              dcolor_correct,
-<a name="l00093"></a>00093                                             <span class="keyword">const</span> identify_method
-<a name="l00094"></a>00094                                                                 *id_method,
-<a name="l00095"></a>00095                                             fors_star_list      *extracted,
-<a name="l00096"></a>00096                                             cpl_propertylist    *wcs_header,
-<a name="l00097"></a>00097                                             fors_std_star_list  **std_cat,
-<a name="l00098"></a>00098                                             cpl_image           **histogram);
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100 <span class="keyword">static</span> cpl_error_code
-<a name="l00101"></a>00101 <a class="code" href="group__fors__zeropoint.html#g5a8ae7f99786a3fdc7df6a07d90d905c">fors_zeropoint_astrometry_get_wcs_shift_px</a>( <span class="keyword">const</span> fors_star_list    *stars,
-<a name="l00102"></a>00102                                             <span class="keywordtype">double</span>                  *dx,
-<a name="l00103"></a>00103                                             <span class="keywordtype">double</span>                  *dy);
-<a name="l00104"></a>00104 
-<a name="l00105"></a>00105 <span class="keyword">static</span> cpl_error_code
-<a name="l00106"></a>00106 <a class="code" href="group__fors__zeropoint.html#gd1a70566b3bf818a95a6c3e2312d0710">fors_zeropoint_astrometry_shift_wcs_origin</a>( cpl_propertylist    *header,
-<a name="l00107"></a>00107                                             <span class="keywordtype">double</span>  dx,
-<a name="l00108"></a>00108                                             <span class="keywordtype">double</span>  dy);
-<a name="l00109"></a>00109 
-<a name="l00110"></a>00110 <span class="keyword">static</span> cpl_error_code
-<a name="l00111"></a>00111 <a class="code" href="group__fors__zeropoint.html#g2ea192495f55d98f1068cae2b1921cea">fors_zeropoint_astrometry_apply_unidentified_xy2radec</a>(
-<a name="l00112"></a>00112                                             fors_star_list          *stars,
-<a name="l00113"></a>00113                                             <span class="keyword">const</span> cpl_propertylist  *header);
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115 <span class="keywordtype">void</span>
-<a name="l00116"></a>00116 <a class="code" href="group__fors__zeropoint.html#g06887d7be84289a1ec9c7b7350e69412">fors_zeropoint_errorstate_dump_as_warning</a>(  <span class="keywordtype">unsigned</span> <span class="keyword">self</span>,
-<a name="l00117"></a>00117                                             <span class="keywordtype">unsigned</span> first,
-<a name="l00118"></a>00118                                             <span class="keywordtype">unsigned</span> last);
-<a name="l00119"></a>00119 
-<a name="l00124"></a><a class="code" href="group__fors__zeropoint.html#gc2cbbec604bd9b8cabf9f83fe71037da">00124</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__zeropoint.html#gc2cbbec604bd9b8cabf9f83fe71037da">fors_zeropoint_define_parameters</a>(cpl_parameterlist *parameters)
-<a name="l00125"></a>00125 {
-<a name="l00126"></a>00126     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a>);
-<a name="l00127"></a>00127     
-<a name="l00128"></a>00128     <a class="code" href="group__fors__extract.html#gd07fd085541e8be0723f2932a29abdb3">fors_extract_define_parameters</a>(parameters, context);
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130     <a class="code" href="group__fors__identify.html#g62b335e73ad633535e1494f9ffd0cd03">fors_identify_define_parameters</a>(parameters, context);
-<a name="l00131"></a>00131     
-<a name="l00132"></a>00132     <span class="keyword">const</span> <span class="keywordtype">char</span> *name, *full_name;
-<a name="l00133"></a>00133     cpl_parameter *p;
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     name = <span class="stringliteral">"magcutE"</span>;
-<a name="l00136"></a>00136     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00137"></a>00137     p = cpl_parameter_new_value(full_name,
-<a name="l00138"></a>00138                                 CPL_TYPE_DOUBLE,
-<a name="l00139"></a>00139                                 <span class="stringliteral">"Zeropoint absolute cutoff (magnitude)"</span>,
-<a name="l00140"></a>00140                                 context,
-<a name="l00141"></a>00141                                 1.0);
-<a name="l00142"></a>00142     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00143"></a>00143     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00144"></a>00144     cpl_parameterlist_append(parameters, p);
-<a name="l00145"></a>00145     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147     name = <span class="stringliteral">"magcutk"</span>;
-<a name="l00148"></a>00148     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00149"></a>00149     p = cpl_parameter_new_value(full_name,
-<a name="l00150"></a>00150                                 CPL_TYPE_DOUBLE,
-<a name="l00151"></a>00151                                 <span class="stringliteral">"Zeropoint kappa rejection parameter"</span>,
-<a name="l00152"></a>00152                                 context,
-<a name="l00153"></a>00153                                 5.0);
-<a name="l00154"></a>00154     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00155"></a>00155     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00156"></a>00156     cpl_parameterlist_append(parameters, p);
-<a name="l00157"></a>00157     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00158"></a>00158 
-<a name="l00159"></a>00159     name = <span class="stringliteral">"magsyserr"</span>;
-<a name="l00160"></a>00160     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);
-<a name="l00161"></a>00161     p = cpl_parameter_new_value(full_name,
-<a name="l00162"></a>00162                                 CPL_TYPE_DOUBLE,
-<a name="l00163"></a>00163                                 <span class="stringliteral">"Systematic error in magnitude"</span>,
-<a name="l00164"></a>00164                                 context,
-<a name="l00165"></a>00165                                 0.01);
-<a name="l00166"></a>00166     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
-<a name="l00167"></a>00167     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00168"></a>00168     cpl_parameterlist_append(parameters, p);
-<a name="l00169"></a>00169     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171 
-<a name="l00172"></a>00172     cpl_free((<span class="keywordtype">void</span> *)context);
-<a name="l00173"></a>00173 
-<a name="l00174"></a>00174     <span class="keywordflow">return</span>;
-<a name="l00175"></a>00175 }
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177 <span class="preprocessor">#undef cleanup</span>
-<a name="l00178"></a>00178 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00179"></a>00179 <span class="preprocessor">do { \</span>
-<a name="l00180"></a>00180 <span class="preprocessor">    cpl_frameset_delete(std_frame); \</span>
-<a name="l00181"></a>00181 <span class="preprocessor">    cpl_frameset_delete(master_bias_frame); \</span>
-<a name="l00182"></a>00182 <span class="preprocessor">    cpl_frameset_delete(master_flat_frame); \</span>
-<a name="l00183"></a>00183 <span class="preprocessor">    cpl_frameset_delete(std_cat_frames); \</span>
-<a name="l00184"></a>00184 <span class="preprocessor">    cpl_frameset_delete(phot_table); \</span>
-<a name="l00185"></a>00185 <span class="preprocessor">    fors_image_delete(&std); \</span>
-<a name="l00186"></a>00186 <span class="preprocessor">    fors_image_delete_const(&master_bias); \</span>
-<a name="l00187"></a>00187 <span class="preprocessor">    fors_image_delete(&master_flat); \</span>
-<a name="l00188"></a>00188 <span class="preprocessor">    cpl_table_delete(aligned_phot); \</span>
-<a name="l00189"></a>00189 <span class="preprocessor">    cpl_image_delete(background); \</span>
-<a name="l00190"></a>00190 <span class="preprocessor">    cpl_table_delete(sources); \</span>
-<a name="l00191"></a>00191 <span class="preprocessor">    fors_extract_method_delete(&em); \</span>
-<a name="l00192"></a>00192 <span class="preprocessor">    fors_identify_method_delete(&im); \</span>
-<a name="l00193"></a>00193 <span class="preprocessor">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</span>
-<a name="l00194"></a>00194 <span class="preprocessor">    </span><span class="comment">/* All std-stars (and non-std-stars) are linked by the respective star */</span> \
-<a name="l00195"></a>00195     <span class="comment">/* objects in "stars", without being referenced by a std-star-list */</span> \
-<a name="l00196"></a>00196     <span class="comment">/* object. So they are deleted together with the function */</span> \
-<a name="l00197"></a>00197     <span class="comment">/* fors_star_delete() while deleting the list "stars". */</span> \
-<a name="l00198"></a>00198     fors_star_list_delete(&stars, fors_star_delete); \
-<a name="l00199"></a>00199     cpl_free((void *)context); \
-<a name="l00200"></a>00200     fors_setting_delete(&setting); \
-<a name="l00201"></a>00201     cpl_propertylist_delete(qc_phot); \
-<a name="l00202"></a>00202     cpl_propertylist_delete(qc_sources); \
-<a name="l00203"></a>00203     cpl_propertylist_delete(product_header); \
-<a name="l00204"></a>00204     cpl_propertylist_delete(raw_header); \
-<a name="l00205"></a>00205 } while (0)
-<a name="l00206"></a>00206 
-<a name="l00215"></a><a class="code" href="group__fors__zeropoint.html#gffa00ce29ad3796187cf1336e4fcbb61">00215</a> <span class="keywordtype">void</span> <a class="code" href="group__fors__zeropoint.html#gffa00ce29ad3796187cf1336e4fcbb61">fors_zeropoint</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)
-<a name="l00216"></a>00216 {
-<a name="l00217"></a>00217     <span class="comment">/* Raw */</span>
-<a name="l00218"></a>00218     cpl_frameset *std_frame      = NULL;
-<a name="l00219"></a>00219     <a class="code" href="struct__fors__image.html">fors_image</a> *std              = NULL;
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     <span class="comment">/* Calibration */</span>
-<a name="l00222"></a>00222     cpl_frameset *master_bias_frame = NULL;
-<a name="l00223"></a>00223     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias   = NULL; 
-<a name="l00224"></a>00224 
-<a name="l00225"></a>00225     cpl_frameset *master_flat_frame = NULL;
-<a name="l00226"></a>00226     <a class="code" href="struct__fors__image.html">fors_image</a> *master_flat         = NULL; 
-<a name="l00227"></a>00227 
-<a name="l00228"></a>00228     cpl_frameset *std_cat_frames    = NULL;
-<a name="l00229"></a>00229     fors_std_star_list *cat         = NULL;
-<a name="l00230"></a>00230 
-<a name="l00231"></a>00231     cpl_frameset *phot_table        = NULL;
-<a name="l00232"></a>00232     <span class="keywordtype">double</span> color_term, dcolor_term;
-<a name="l00233"></a>00233     <span class="keywordtype">double</span> ext_coeff, dext_coeff;
-<a name="l00234"></a>00234     <span class="keywordtype">double</span> expected_zeropoint, dexpected_zeropoint;
-<a name="l00235"></a>00235     
-<a name="l00236"></a>00236     
-<a name="l00237"></a>00237     cpl_propertylist *raw_header  = NULL;
-<a name="l00238"></a>00238     
-<a name="l00239"></a>00239     <span class="comment">/* Products */</span>
-<a name="l00240"></a>00240     <span class="keywordtype">int</span> nzeropoint = -1;             <span class="comment">/* Suppress warning */</span>
-<a name="l00241"></a>00241     cpl_table *aligned_phot = NULL;
-<a name="l00242"></a>00242     cpl_propertylist *qc_phot = NULL;
-<a name="l00243"></a>00243     cpl_propertylist *qc_sources = NULL;
-<a name="l00244"></a>00244     <span class="keywordtype">double</span> zeropoint, dzeropoint;
-<a name="l00245"></a>00245     <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> sky_stats;
-<a name="l00246"></a>00246     cpl_image *background = NULL;
-<a name="l00247"></a>00247     cpl_table *sources    = NULL;
-<a name="l00248"></a>00248     cpl_propertylist *product_header = NULL;
-<a name="l00249"></a>00249     cpl_image *histogram = NULL;
-<a name="l00250"></a>00250         
-<a name="l00251"></a>00251     <span class="comment">/* Parameters */</span>
-<a name="l00252"></a>00252     extract_method  *em = NULL;
-<a name="l00253"></a>00253     identify_method *im = NULL;
-<a name="l00254"></a>00254     <span class="keywordtype">double</span> cutoffE, cutoffk;
-<a name="l00255"></a>00255     <span class="keywordtype">double</span> magsyserr;
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257     <span class="comment">/* Other */</span>
-<a name="l00258"></a>00258     <span class="keyword">const</span> <span class="keywordtype">char</span> *context   = NULL;
-<a name="l00259"></a>00259     fors_star_list *stars = NULL;
-<a name="l00260"></a>00260     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;
-<a name="l00261"></a>00261     <span class="keywordtype">double</span> avg_airmass = 0.0;
-<a name="l00262"></a>00262     <span class="keyword">const</span> <span class="keywordtype">char</span> *target_name = NULL; 
-<a name="l00263"></a>00263     
-<a name="l00264"></a>00264     qc_phot = cpl_propertylist_new();
-<a name="l00265"></a>00265     qc_sources = cpl_propertylist_new();
-<a name="l00266"></a>00266     product_header = cpl_propertylist_new();
-<a name="l00267"></a>00267     context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a>);
-<a name="l00268"></a>00268     
-<a name="l00269"></a>00269     <span class="comment">/* Get parameters */</span>
-<a name="l00270"></a>00270     em = <a class="code" href="group__fors__extract.html#g1f3f1af725e7b5fb1c770507eab8ac09">fors_extract_method_new</a>(parameters, context);
-<a name="l00271"></a>00271     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00272"></a>00272             <span class="stringliteral">"Could not get extraction parameters"</span> );
-<a name="l00273"></a>00273     
-<a name="l00274"></a>00274     im = <a class="code" href="group__fors__identify.html#g2763139bd0ceba14e3be219d5d043e46">fors_identify_method_new</a>(parameters, context);
-<a name="l00275"></a>00275     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00276"></a>00276             <span class="stringliteral">"Could not get identification parameters"</span> );
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     cpl_msg_indent_more();
-<a name="l00280"></a>00280     <span class="keyword">const</span> <span class="keywordtype">char</span> *name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"magcutE"</span>);
-<a name="l00281"></a>00281     cutoffE = <a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a>(parameters, 
-<a name="l00282"></a>00282                                             name);
-<a name="l00283"></a>00283     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00284"></a>00284     cpl_msg_indent_less();
-<a name="l00285"></a>00285     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00286"></a>00286         
-<a name="l00287"></a>00287     cpl_msg_indent_more();
-<a name="l00288"></a>00288     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"magcutk"</span>);
-<a name="l00289"></a>00289     cutoffk = <a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a>(parameters, 
-<a name="l00290"></a>00290                                              name);
-<a name="l00291"></a>00291     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00292"></a>00292     cpl_msg_indent_less();
-<a name="l00293"></a>00293     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00294"></a>00294         
-<a name="l00295"></a>00295     cpl_msg_indent_more();
-<a name="l00296"></a>00296     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"magsyserr"</span>);
-<a name="l00297"></a>00297     magsyserr = <a class="code" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a>(parameters, 
-<a name="l00298"></a>00298                                                name);
-<a name="l00299"></a>00299     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;
-<a name="l00300"></a>00300     cpl_msg_indent_less();
-<a name="l00301"></a>00301     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );
-<a name="l00302"></a>00302     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( magsyserr >= 0, <span class="keywordflow">return</span>, 
-<a name="l00303"></a>00303             <span class="stringliteral">"Input systematic error (magsyserr=%f) cannot be negative"</span>,
-<a name="l00304"></a>00304             magsyserr);
-<a name="l00305"></a>00305         
-<a name="l00306"></a>00306     <span class="comment">/* Find raw */</span>
-<a name="l00307"></a>00307     std_frame = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, STANDARD_IMG);
-<a name="l00308"></a>00308     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(std_frame) == 1, <span class="keywordflow">return</span>, 
-<a name="l00309"></a>00309             <span class="stringliteral">"Exactly 1 %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, 
-<a name="l00310"></a>00310             STANDARD_IMG, cpl_frameset_get_size(std_frame) );
-<a name="l00311"></a>00311 
-<a name="l00312"></a>00312     <span class="comment">/* Find calibration */</span>
-<a name="l00313"></a>00313     master_bias_frame = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, MASTER_BIAS);
-<a name="l00314"></a>00314     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(master_bias_frame) == 1, <span class="keywordflow">return</span>, 
-<a name="l00315"></a>00315             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, 
-<a name="l00316"></a>00316             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame) );
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318     master_flat_frame = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, MASTER_SKY_FLAT_IMG);
-<a name="l00319"></a>00319     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(master_flat_frame) == 1, <span class="keywordflow">return</span>, 
-<a name="l00320"></a>00320             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, 
-<a name="l00321"></a>00321             MASTER_SKY_FLAT_IMG, cpl_frameset_get_size(master_flat_frame) );
-<a name="l00322"></a>00322 
-<a name="l00323"></a>00323     std_cat_frames = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, FLX_STD_IMG);
-<a name="l00324"></a>00324     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(std_cat_frames) >= 1, <span class="keywordflow">return</span>, 
-<a name="l00325"></a>00325             <span class="stringliteral">"One or more %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>,
-<a name="l00326"></a>00326             FLX_STD_IMG, cpl_frameset_get_size(std_cat_frames));
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328     phot_table = <a class="code" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a>(frames, PHOT_TABLE);
-<a name="l00329"></a>00329     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( cpl_frameset_get_size(phot_table) == 1, <span class="keywordflow">return</span>, 
-<a name="l00330"></a>00330             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>,
-<a name="l00331"></a>00331             PHOT_TABLE, cpl_frameset_get_size(phot_table));
-<a name="l00332"></a>00332 
-<a name="l00333"></a>00333     <span class="comment">/* Done finding frames */</span>
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335     <span class="comment">/* Get setting */</span>
-<a name="l00336"></a>00336     setting = <a class="code" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a>(cpl_frameset_get_first(std_frame));
-<a name="l00337"></a>00337     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );
-<a name="l00338"></a>00338     
-<a name="l00339"></a>00339     <span class="comment">/* Load std raw frame header */</span>
-<a name="l00340"></a>00340     raw_header = cpl_propertylist_load(
-<a name="l00341"></a>00341                     cpl_frame_get_filename(
-<a name="l00342"></a>00342                         cpl_frameset_get_first(std_frame)), 0);
-<a name="l00343"></a>00343     <span class="keywordflow">if</span> (raw_header == NULL) {
-<a name="l00344"></a>00344         cpl_msg_error(cpl_func, <span class="stringliteral">"Failed to load raw header"</span>);
-<a name="l00345"></a>00345         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00346"></a>00346         <span class="keywordflow">return</span>;
-<a name="l00347"></a>00347     }
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349     <span class="comment">/* Getting info from std header */</span>
-<a name="l00350"></a>00350     avg_airmass = <a class="code" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">fors_get_airmass</a>(raw_header);
-<a name="l00351"></a>00351     target_name = cpl_propertylist_get_string(raw_header, <a class="code" href="group__fors__pfits.html#g6ef465e799ac380d31708be1255d0a68">FORS_PFITS_TARG_NAME</a>);
-<a name="l00352"></a>00352     cpl_msg_info(cpl_func, <span class="stringliteral">"Target name: %s"</span>, target_name);
-<a name="l00353"></a>00353     
-<a name="l00354"></a>00354     <span class="comment">/* Load master bias */</span>
-<a name="l00355"></a>00355     master_bias = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(cpl_frameset_get_first(master_bias_frame), 
-<a name="l00356"></a>00356                                   NULL, setting, NULL);
-<a name="l00357"></a>00357     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00358"></a>00358             <span class="stringliteral">"Could not load master bias"</span>);
-<a name="l00359"></a>00359 
-<a name="l00360"></a>00360     <span class="comment">/* Load raw frames, subtract bias */</span>
-<a name="l00361"></a>00361     std = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(cpl_frameset_get_first(std_frame), 
-<a name="l00362"></a>00362                           master_bias, setting, NULL);
-<a name="l00363"></a>00363     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load standard image"</span>);
-<a name="l00364"></a>00364     <a class="code" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">fors_image_delete_const</a>(&master_bias);
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     <span class="comment">/* Load master flat */</span>
-<a name="l00367"></a>00367     master_flat = <a class="code" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a>(cpl_frameset_get_first(master_flat_frame), 
-<a name="l00368"></a>00368                                   NULL, setting, NULL);
-<a name="l00369"></a>00369     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load master flat"</span>);
-<a name="l00370"></a>00370     
-<a name="l00371"></a>00371     <span class="comment">/* Divide by flat */</span>
-<a name="l00372"></a>00372     <a class="code" href="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff">fors_image_divide_scalar</a>(master_flat,
-<a name="l00373"></a>00373                              <a class="code" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a>(master_flat, NULL), -1.0);
-<a name="l00374"></a>00374     <a class="code" href="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4">fors_image_divide</a>(std, master_flat);
-<a name="l00375"></a>00375     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not divide by master flat"</span>);
-<a name="l00376"></a>00376     <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_flat);
-<a name="l00377"></a>00377 
-<a name="l00378"></a>00378     <span class="comment">/* Extract sources */</span>
-<a name="l00379"></a>00379     stars = <a class="code" href="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1">fors_extract</a>(std, setting, em, magsyserr,
-<a name="l00380"></a>00380                          &sky_stats, &background, &sources);
-<a name="l00381"></a>00381     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not extract objects"</span>);
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383 
-<a name="l00384"></a>00384     <span class="keywordflow">if</span> (setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a> != NULL)
-<a name="l00385"></a>00385     {
-<a name="l00386"></a>00386         <span class="keywordtype">char</span>            filter_band;
-<a name="l00387"></a>00387         cpl_errorstate  local_ers = cpl_errorstate_get();
-<a name="l00388"></a>00388         
-<a name="l00389"></a>00389         <span class="comment">/* load raw frame header */</span>
-<a name="l00390"></a>00390 
-<a name="l00391"></a>00391 <span class="comment">/* Moved outside by Carlo - start</span>
-<a name="l00392"></a>00392 <span class="comment"></span>
-<a name="l00393"></a>00393 <span class="comment">        raw_header = cpl_propertylist_load(</span>
-<a name="l00394"></a>00394 <span class="comment">                        cpl_frame_get_filename(</span>
-<a name="l00395"></a>00395 <span class="comment">                            cpl_frameset_get_first(std_frame)), 0);</span>
-<a name="l00396"></a>00396 <span class="comment">        assure(                             cpl_errorstate_is_equal(local_ers),</span>
-<a name="l00397"></a>00397 <span class="comment">                                            return,</span>
-<a name="l00398"></a>00398 <span class="comment">                                            "Failed to load raw header");</span>
-<a name="l00399"></a>00399 <span class="comment">Moved outside by Carlo - end */</span>
-<a name="l00400"></a>00400         
-<a name="l00401"></a>00401         <span class="comment">/* Load filter coefficients */</span>
-<a name="l00402"></a>00402         fors_phot_table_load(cpl_frameset_get_first(phot_table), setting,
-<a name="l00403"></a>00403                              &color_term, &dcolor_term,
-<a name="l00404"></a>00404                              &ext_coeff, &dext_coeff,
-<a name="l00405"></a>00405                              &expected_zeropoint, &dexpected_zeropoint);
-<a name="l00406"></a>00406         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                             cpl_errorstate_is_equal(local_ers),
-<a name="l00407"></a>00407                                             <span class="keywordflow">return</span>,
-<a name="l00408"></a>00408                                             <span class="stringliteral">"Could not load photometry table"</span> );
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410         filter_band = fors_instrument_filterband_get_by_setting(setting);
-<a name="l00411"></a>00411         
-<a name="l00412"></a>00412         <span class="comment">/* Do the whole astrometry:</span>
-<a name="l00413"></a>00413 <span class="comment">         * load catalogue, apply wcs, do pattern-matching, correct wcs</span>
-<a name="l00414"></a>00414 <span class="comment">         * (treat errors only as warnings)</span>
-<a name="l00415"></a>00415 <span class="comment">         */</span>
-<a name="l00416"></a>00416         cpl_msg_info(cpl_func, <span class="stringliteral">"Astrometry:"</span>);
-<a name="l00417"></a>00417         cpl_msg_indent_more();
-<a name="l00418"></a>00418         <a class="code" href="group__fors__zeropoint.html#g3222d4735fe218be5da224f3a146580b">fors_zeropoint_astrometry</a>(          std_cat_frames,
-<a name="l00419"></a>00419                                             filter_band,
-<a name="l00420"></a>00420                                             color_term,
-<a name="l00421"></a>00421                                             dcolor_term,
-<a name="l00422"></a>00422                                             im,
-<a name="l00423"></a>00423                                             stars,      <span class="comment">/* sources */</span>
-<a name="l00424"></a>00424                                             raw_header, <span class="comment">/* wcs */</span>
-<a name="l00425"></a>00425                                             &cat,       <span class="comment">/* to draw debug-img */</span>
-<a name="l00426"></a>00426                                             &histogram);
-<a name="l00427"></a>00427         cpl_msg_indent_less();
-<a name="l00428"></a>00428         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(local_ers))
-<a name="l00429"></a>00429         {
-<a name="l00430"></a>00430             cpl_msg_warning(cpl_func, <span class="stringliteral">"Astrometric calibration failed:"</span>);
-<a name="l00431"></a>00431             cpl_msg_indent_more();
-<a name="l00432"></a>00432             cpl_errorstate_dump(local_ers,
-<a name="l00433"></a>00433                                 CPL_FALSE,
-<a name="l00434"></a>00434                                 <a class="code" href="group__fors__zeropoint.html#g06887d7be84289a1ec9c7b7350e69412">fors_zeropoint_errorstate_dump_as_warning</a>);
-<a name="l00435"></a>00435             cpl_msg_indent_less();
-<a name="l00436"></a>00436             <span class="comment">/* reset error */</span>
-<a name="l00437"></a>00437             cpl_errorstate_set(local_ers);
-<a name="l00438"></a>00438         }
-<a name="l00439"></a>00439         <span class="comment">/* The astrometric calibration could fail but nonetheless have</span>
-<a name="l00440"></a>00440 <span class="comment">         * succeeded in identifying some standard stars. So continue trying to</span>
-<a name="l00441"></a>00441 <span class="comment">         * get the zeropoint anyway. */</span>
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443         <span class="comment">/* Correct for atmospheric extinction, gain, exposure time */</span>
-<a name="l00444"></a>00444         <span class="comment">/* FIXME: FAP: use WCS corrected header */</span>
-<a name="l00445"></a>00445         avg_airmass = <a class="code" href="group__fors__tools.html#g6a1cb404cc2c956f79b10ea46a0611dc">fors_star_ext_corr</a>(   stars,
-<a name="l00446"></a>00446                                             setting,
-<a name="l00447"></a>00447                                             ext_coeff,
-<a name="l00448"></a>00448                                             dext_coeff,
-<a name="l00449"></a>00449                                             cpl_frameset_get_first(std_frame));
-<a name="l00450"></a>00450         <span class="comment">/* Get zeropoint. */</span>
-<a name="l00451"></a>00451         <span class="keywordflow">if</span> (cpl_errorstate_is_equal(local_ers))
-<a name="l00452"></a>00452         {
-<a name="l00453"></a>00453             zeropoint = <a class="code" href="group__fors__zeropoint.html#gfd13851752bdf8327fb014e47c6bb104">get_zeropoint</a>(      stars,
-<a name="l00454"></a>00454                                             cutoffE,
-<a name="l00455"></a>00455                                             cutoffk,
-<a name="l00456"></a>00456                                             dext_coeff,
-<a name="l00457"></a>00457                                             dcolor_term,
-<a name="l00458"></a>00458                                             avg_airmass,
-<a name="l00459"></a>00459                                             &dzeropoint,
-<a name="l00460"></a>00460                                             &nzeropoint);
-<a name="l00461"></a>00461         }
-<a name="l00462"></a>00462         
-<a name="l00463"></a>00463         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(local_ers))
-<a name="l00464"></a>00464         {
-<a name="l00465"></a>00465             cpl_msg_warning(cpl_func, <span class="stringliteral">"Failed to get zeropoint"</span>);
-<a name="l00466"></a>00466             cpl_msg_indent_more();
-<a name="l00467"></a>00467             cpl_errorstate_dump(local_ers,
-<a name="l00468"></a>00468                                 CPL_FALSE,
-<a name="l00469"></a>00469                                 <a class="code" href="group__fors__zeropoint.html#g06887d7be84289a1ec9c7b7350e69412">fors_zeropoint_errorstate_dump_as_warning</a>);
-<a name="l00470"></a>00470             cpl_msg_indent_less();
-<a name="l00471"></a>00471             <span class="comment">/* reset error */</span>
-<a name="l00472"></a>00472             cpl_errorstate_set(local_ers);
-<a name="l00473"></a>00473         }
-<a name="l00474"></a>00474     }
-<a name="l00475"></a>00475     <span class="keywordflow">else</span> {
-<a name="l00476"></a>00476        cpl_msg_warning(cpl_func, <span class="stringliteral">"Zeropoint computation is not supported "</span>
-<a name="l00477"></a>00477                        <span class="stringliteral">"for non-standard filters"</span>);
-<a name="l00478"></a>00478        color_term = 0.0;
-<a name="l00479"></a>00479        dcolor_term = 9999.0;
-<a name="l00480"></a>00480        ext_coeff = 0.0;
-<a name="l00481"></a>00481        dext_coeff = 9999.0;
-<a name="l00482"></a>00482        expected_zeropoint = 0.0;
-<a name="l00483"></a>00483        dexpected_zeropoint = 9999.0;
-<a name="l00484"></a>00484        zeropoint = 0.0;
-<a name="l00485"></a>00485        dzeropoint = 0.0;
-<a name="l00486"></a>00486        nzeropoint = 0;
-<a name="l00487"></a>00487     }
-<a name="l00488"></a>00488 
-<a name="l00489"></a>00489     <span class="comment">/* QC */</span>
-<a name="l00490"></a>00490     
-<a name="l00491"></a>00491     cpl_msg_info(cpl_func,<span class="stringliteral">"Frame zeropoint = %f mag"</span>, zeropoint);
-<a name="l00492"></a>00492     cpl_msg_info(cpl_func,<span class="stringliteral">"Frame zeropoint uncertainty = %f mag"</span>, dzeropoint);
-<a name="l00493"></a>00493     cpl_msg_info(cpl_func,<span class="stringliteral">"Number of stars used for zeropoint computation = %d"</span>,
-<a name="l00494"></a>00494                  nzeropoint);
-<a name="l00495"></a>00495     
-<a name="l00496"></a>00496     cpl_propertylist_append_double(qc_phot, <span class="stringliteral">"ESO QC ZPOINT"</span>, zeropoint);
-<a name="l00497"></a>00497     cpl_propertylist_set_comment(qc_phot, <span class="stringliteral">"ESO QC ZPOINT"</span>, <span class="stringliteral">"Frame zeropoint "</span>);
-<a name="l00498"></a>00498 
-<a name="l00499"></a>00499     cpl_propertylist_append_double(qc_phot, <span class="stringliteral">"ESO QC ZPOINTRMS"</span>, dzeropoint);
-<a name="l00500"></a>00500     cpl_propertylist_set_comment(qc_phot, <span class="stringliteral">"ESO QC ZPOINTRMS"</span>, 
-<a name="l00501"></a>00501                                  <span class="stringliteral">"Uncertainty of frame zeropoint [mag]"</span>);
-<a name="l00502"></a>00502 
-<a name="l00503"></a>00503     cpl_propertylist_append_int(qc_phot, <span class="stringliteral">"ESO QC ZPOINT NSTARS"</span>, nzeropoint);
-<a name="l00504"></a>00504     cpl_propertylist_set_comment(qc_phot, <span class="stringliteral">"ESO QC ZPOINT NSTARS"</span>, 
-<a name="l00505"></a>00505                              <span class="stringliteral">"Number of stars used for zeropoint computation"</span>);
-<a name="l00506"></a>00506     
-<a name="l00507"></a>00507     <span class="keywordtype">double</span> derived_ext_coeff, derived_ext_coeff_err;
-<a name="l00508"></a>00508 
-<a name="l00509"></a>00509     <span class="keywordflow">if</span> (setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a> != NULL) {
-<a name="l00510"></a>00510         cpl_msg_info(cpl_func,
-<a name="l00511"></a>00511                      <span class="stringliteral">"Computing extinction "</span>
-<a name="l00512"></a>00512                      <span class="stringliteral">"(assuming zeropoint = %.3f +- %.3f mag)"</span>,
-<a name="l00513"></a>00513                      expected_zeropoint,
-<a name="l00514"></a>00514                      dexpected_zeropoint);
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516         cpl_msg_indent_more();
-<a name="l00517"></a>00517 
-<a name="l00518"></a>00518         <span class="keywordflow">if</span> (nzeropoint > 0) {
-<a name="l00519"></a>00519             derived_ext_coeff = ext_coeff +
-<a name="l00520"></a>00520                 (expected_zeropoint - zeropoint) / avg_airmass;
-<a name="l00521"></a>00521             <span class="comment">/* Things are very correlated here</span>
-<a name="l00522"></a>00522 <span class="comment">               (e.g. ext_coeff was used to compute zeropoint).</span>
-<a name="l00523"></a>00523 <span class="comment">           </span>
-<a name="l00524"></a>00524 <span class="comment">               The final error on the ext.coeff. depends only</span>
-<a name="l00525"></a>00525 <span class="comment">               on the reference and computed zeropoints' errors. </span>
-<a name="l00526"></a>00526 <span class="comment">               The airmass is assumed errorless.</span>
-<a name="l00527"></a>00527 <span class="comment"></span>
-<a name="l00528"></a>00528 <span class="comment">               We assume the 2 zeropoints' errors are not correlated and</span>
-<a name="l00529"></a>00529 <span class="comment">               add in quadrature.</span>
-<a name="l00530"></a>00530 <span class="comment"></span>
-<a name="l00531"></a>00531 <span class="comment">               The derived extinction's error does not suffer from the part</span>
-<a name="l00532"></a>00532 <span class="comment">               of dzeropoint which was due to the error of the assumed </span>
-<a name="l00533"></a>00533 <span class="comment">               extinction.</span>
-<a name="l00534"></a>00534 <span class="comment">            */</span>
-<a name="l00535"></a>00535             derived_ext_coeff_err = sqrt(
-<a name="l00536"></a>00536                 dexpected_zeropoint*dexpected_zeropoint +
-<a name="l00537"></a>00537                 dzeropoint*dzeropoint) / avg_airmass - dext_coeff*dext_coeff;
-<a name="l00538"></a>00538     
-<a name="l00539"></a>00539             cpl_msg_info(cpl_func, <span class="stringliteral">"Atmospheric extinction = "</span>
-<a name="l00540"></a>00540                          <span class="stringliteral">"%f +- %f mag/airmass"</span>, derived_ext_coeff,
-<a name="l00541"></a>00541                          derived_ext_coeff_err);
-<a name="l00542"></a>00542         }
-<a name="l00543"></a>00543         <span class="keywordflow">else</span> {
-<a name="l00544"></a>00544             cpl_msg_warning(cpl_func, <span class="stringliteral">"Too few stars available, "</span>
-<a name="l00545"></a>00545                             <span class="stringliteral">"setting extinction to zero"</span>);
-<a name="l00546"></a>00546             derived_ext_coeff = 0;
-<a name="l00547"></a>00547             derived_ext_coeff_err = 9999;
-<a name="l00548"></a>00548         }
-<a name="l00549"></a>00549     }
-<a name="l00550"></a>00550     <span class="keywordflow">else</span> {
-<a name="l00551"></a>00551         derived_ext_coeff = 0;
-<a name="l00552"></a>00552         derived_ext_coeff_err = 9999;
-<a name="l00553"></a>00553     }
-<a name="l00554"></a>00554 
-<a name="l00555"></a>00555     cpl_msg_info(cpl_func,<span class="stringliteral">"Atmospheric extinction = %f mag/airmass"</span>, 
-<a name="l00556"></a>00556                  derived_ext_coeff);
-<a name="l00557"></a>00557     cpl_msg_info(cpl_func,<span class="stringliteral">"Error in atmospheric extinction = %f mag/airmass"</span>, 
-<a name="l00558"></a>00558                  derived_ext_coeff_err);
-<a name="l00559"></a>00559 
-<a name="l00560"></a>00560     cpl_propertylist_append_double(qc_phot, <span class="stringliteral">"ESO QC EXTCOEFF"</span>,
-<a name="l00561"></a>00561                                    derived_ext_coeff);
-<a name="l00562"></a>00562     cpl_propertylist_set_comment(qc_phot, <span class="stringliteral">"ESO QC EXTCOEFF"</span>, 
-<a name="l00563"></a>00563                                  <span class="stringliteral">"Atmospheric extinction [mag/airmass]"</span>);
-<a name="l00564"></a>00564 
-<a name="l00565"></a>00565     cpl_propertylist_append_double(qc_phot, <span class="stringliteral">"ESO QC EXTCOEFFERR"</span>, 
-<a name="l00566"></a>00566                                    derived_ext_coeff_err);
-<a name="l00567"></a>00567     cpl_propertylist_set_comment(qc_phot, <span class="stringliteral">"ESO QC EXTCOEFFERR"</span>, 
-<a name="l00568"></a>00568                               <span class="stringliteral">"Error on atmospheric extinction [mag/airmass]"</span>);
-<a name="l00569"></a>00569 
-<a name="l00570"></a>00570     cpl_propertylist_append_double(qc_sources, <span class="stringliteral">"ESO QC ZPOINT NSRCEXTRACT"</span>, 
-<a name="l00571"></a>00571                                    cpl_table_get_nrow(sources));
-<a name="l00572"></a>00572     cpl_propertylist_set_comment(qc_sources, <span class="stringliteral">"ESO QC ZPOINT NSRCEXTRACT"</span>, 
-<a name="l00573"></a>00573                            <span class="stringliteral">"Number of sources extracted from the zpoint image"</span>);
-<a name="l00574"></a>00574 
-<a name="l00575"></a>00575     cpl_msg_indent_less();
-<a name="l00576"></a>00576 
-<a name="l00577"></a>00577 
-<a name="l00578"></a>00578     <span class="comment">/* Convert to CPL table */</span>
-<a name="l00579"></a>00579     aligned_phot = <a class="code" href="group__fors__tools.html#g8138511b64d1d365e21b56eb161f2028">fors_create_sources_table</a>(stars);
-<a name="l00580"></a>00580     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>,
-<a name="l00581"></a>00581             <span class="stringliteral">"Failed to create aligned photometry table"</span>);
-<a name="l00582"></a>00582 
-<a name="l00583"></a>00583     <span class="comment">/* Save products */</span>
-<a name="l00584"></a>00584     <span class="comment">/* FIXME: FAP: use WCS corrected header */</span>
-<a name="l00585"></a>00585     <a class="code" href="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42">fors_dfs_save_table</a>(frames, sources, SOURCES_STD,
-<a name="l00586"></a>00586                         qc_sources, parameters, <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a>, 
-<a name="l00587"></a>00587                         cpl_frameset_get_first(std_frame));
-<a name="l00588"></a>00588     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00589"></a>00589             SOURCES_STD);
-<a name="l00590"></a>00590     cpl_propertylist_delete(qc_sources); qc_sources = NULL;
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592     <span class="comment">/* Add keywords necessary for fors_photometry </span>
-<a name="l00593"></a>00593 <span class="comment">       (just reuse/overload to the qc propertylist variable)</span>
-<a name="l00594"></a>00594 <span class="comment">    */</span>
-<a name="l00595"></a>00595     cpl_propertylist_update_double(qc_phot, <a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a>, 
-<a name="l00596"></a>00596                                    setting-><a class="code" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">exposure_time</a>);
-<a name="l00597"></a>00597     cpl_propertylist_update_double(qc_phot, <span class="stringliteral">"AIRMASS"</span>, avg_airmass);
-<a name="l00598"></a>00598     
-<a name="l00599"></a>00599     cpl_table_fill_invalid_int(aligned_phot, <span class="stringliteral">"USE_CAT"</span>, 2);
-<a name="l00600"></a>00600     <span class="comment">/* FIXME: FAP: use WCS corrected header */</span>
-<a name="l00601"></a>00601     <a class="code" href="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42">fors_dfs_save_table</a>(frames, aligned_phot, ALIGNED_PHOT,
-<a name="l00602"></a>00602                         qc_phot, parameters, <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a>, 
-<a name="l00603"></a>00603                         cpl_frameset_get_first(std_frame));
-<a name="l00604"></a>00604     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00605"></a>00605             ALIGNED_PHOT);
-<a name="l00606"></a>00606     
-<a name="l00607"></a>00607     cpl_propertylist_delete(qc_phot); qc_phot = NULL;
-<a name="l00608"></a>00608 
-<a name="l00609"></a>00609     <span class="comment">/* FIXME: FAP: use WCS corrected header */</span>
-<a name="l00610"></a>00610     <a class="code" href="group__forsdfs.html#geb1068e007bd0ebef0cd4a6aa12cf523">fors_dfs_add_wcs</a>(product_header,
-<a name="l00611"></a>00611                      cpl_frameset_get_first(std_frame), setting);
-<a name="l00612"></a>00612     <span class="comment">/* FIXME: FAP: use WCS corrected header */</span>
-<a name="l00613"></a>00613     <a class="code" href="group__forsdfs.html#gea45a5b73ab086e5e08680928adbd0cd">fors_dfs_add_exptime</a>(product_header, 
-<a name="l00614"></a>00614                          cpl_frameset_get_first(std_frame), 0.);
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616     cpl_propertylist_update_double(product_header, <span class="stringliteral">"AIRMASS"</span>, avg_airmass);
-<a name="l00617"></a>00617         
-<a name="l00618"></a>00618     <a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frames, background, PHOT_BACKGROUND_STD_IMG,
-<a name="l00619"></a>00619                    product_header, parameters, <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a>, 
-<a name="l00620"></a>00620                    setting-><a class="code" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">version</a>);
-<a name="l00621"></a>00621     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00622"></a>00622             PHOT_BACKGROUND_STD_IMG);
-<a name="l00623"></a>00623         
-<a name="l00624"></a>00624     cpl_image_delete(background); background = NULL;
-<a name="l00625"></a>00625     
-<a name="l00626"></a>00626     <span class="comment">/* FIXME: FAP: use WCS corrected header */</span>
-<a name="l00627"></a>00627     <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, std, STANDARD_REDUCED_IMG,
-<a name="l00628"></a>00628                         product_header, parameters, <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a>, 
-<a name="l00629"></a>00629                         cpl_frameset_get_first(std_frame));
-<a name="l00630"></a>00630     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00631"></a>00631             STANDARD_REDUCED_IMG);
-<a name="l00632"></a>00632 
-<a name="l00633"></a>00633     <span class="keywordflow">if</span>(histogram != NULL)
-<a name="l00634"></a>00634     {
-<a name="l00635"></a>00635         <a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frames, histogram, OFFSET_HISTOGRAM,
-<a name="l00636"></a>00636                 NULL, parameters, <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a>, 
-<a name="l00637"></a>00637                 setting-><a class="code" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">version</a>);
-<a name="l00638"></a>00638         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00639"></a>00639                 OFFSET_HISTOGRAM);
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641         cpl_image_delete(histogram); histogram = NULL;
-<a name="l00642"></a>00642     }
-<a name="l00643"></a>00643     <span class="keywordflow">else</span>
-<a name="l00644"></a>00644     {
-<a name="l00645"></a>00645         cpl_msg_info(cpl_func,<span class="stringliteral">"Offset histogram not computed, not saving"</span>);
-<a name="l00646"></a>00646     }
-<a name="l00647"></a>00647         
-<a name="l00648"></a>00648     <span class="keywordflow">if</span> (setting-><a class="code" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a> == NULL) {
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650         <span class="comment">/* No debug image can be created */</span>
-<a name="l00651"></a>00651 
-<a name="l00652"></a>00652         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00653"></a>00653         <span class="keywordflow">return</span>;
-<a name="l00654"></a>00654     }
-<a name="l00655"></a>00655 
-<a name="l00656"></a>00656     <span class="comment">/* Create debugging image</span>
-<a name="l00657"></a>00657 <span class="comment"></span>
-<a name="l00658"></a>00658 <span class="comment">       Legend:</span>
-<a name="l00659"></a>00659 <span class="comment"></span>
-<a name="l00660"></a>00660 <span class="comment">        ------  (horiz. line):   detected source</span>
-<a name="l00661"></a>00661 <span class="comment"></span>
-<a name="l00662"></a>00662 <span class="comment">          |</span>
-<a name="l00663"></a>00663 <span class="comment">          |    (vert. line):   catalog position</span>
-<a name="l00664"></a>00664 <span class="comment">          |</span>
-<a name="l00665"></a>00665 <span class="comment"></span>
-<a name="l00666"></a>00666 <span class="comment">          _</span>
-<a name="l00667"></a>00667 <span class="comment">         / \     (circle) :   identified</span>
-<a name="l00668"></a>00668 <span class="comment">         \_/</span>
-<a name="l00669"></a>00669 <span class="comment">    */</span>
-<a name="l00670"></a>00670 
-<a name="l00671"></a>00671     <span class="keywordtype">double</span> color = <a class="code" href="group__fors__image.html#gc4edb9a966bcf97a17ad6a5c1b9d020f">fors_image_get_min</a>(std);
-<a name="l00672"></a>00672     <span class="keywordflow">if</span> (stars != NULL)
-<a name="l00673"></a>00673     {
-<a name="l00674"></a>00674         <a class="code" href="struct__fors__star.html">fors_star</a> *s;
-<a name="l00675"></a>00675         <span class="keywordflow">for</span> (s = fors_star_list_first(stars);
-<a name="l00676"></a>00676              s != NULL; 
-<a name="l00677"></a>00677              s = fors_star_list_next(stars)) {
-<a name="l00678"></a>00678             <a class="code" href="group__fors__image.html#g5b5539c0e15fe20c16bedc58e8263724">fors_image_draw</a>(std, 0,
-<a name="l00679"></a>00679                             s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x,
-<a name="l00680"></a>00680                             s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y,
-<a name="l00681"></a>00681                             10, color);
-<a name="l00682"></a>00682 
-<a name="l00683"></a>00683             <span class="keywordflow">if</span> (s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> != NULL && s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->trusted) {
-<a name="l00684"></a>00684                 <a class="code" href="group__fors__image.html#g5b5539c0e15fe20c16bedc58e8263724">fors_image_draw</a>(std, 2,
-<a name="l00685"></a>00685                                 s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x,
-<a name="l00686"></a>00686                                 s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y,
-<a name="l00687"></a>00687                                 10, color);
-<a name="l00688"></a>00688             }
-<a name="l00689"></a>00689         }
-<a name="l00690"></a>00690     }
-<a name="l00691"></a>00691     <span class="keywordflow">if</span> (cat != NULL)
-<a name="l00692"></a>00692     {
-<a name="l00693"></a>00693         fors_std_star *s;
-<a name="l00694"></a>00694         <span class="keywordflow">for</span> (s = fors_std_star_list_first(cat);
-<a name="l00695"></a>00695              s != NULL; 
-<a name="l00696"></a>00696              s = fors_std_star_list_next(cat))
-<a name="l00697"></a>00697         {
-<a name="l00698"></a>00698             <span class="keywordflow">if</span> (s->trusted)
-<a name="l00699"></a>00699                 <a class="code" href="group__fors__image.html#g5b5539c0e15fe20c16bedc58e8263724">fors_image_draw</a>(std, 1,
-<a name="l00700"></a>00700                             s->pixel->x,
-<a name="l00701"></a>00701                             s->pixel->y,
-<a name="l00702"></a>00702                             10, color);
-<a name="l00703"></a>00703         }
-<a name="l00704"></a>00704         <span class="comment">/* FIXME: FAP: use WCS corrected header */</span>
-<a name="l00705"></a>00705         <a class="code" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a>(frames, std, <span class="stringliteral">"DEBUG"</span>,
-<a name="l00706"></a>00706                             product_header, parameters, <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a>, 
-<a name="l00707"></a>00707                             cpl_frameset_get_first(std_frame));
-<a name="l00708"></a>00708         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,
-<a name="l00709"></a>00709                 <span class="stringliteral">"DEBUG"</span>);
-<a name="l00710"></a>00710     }
-<a name="l00711"></a>00711 
-<a name="l00712"></a>00712     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00713"></a>00713     <span class="keywordflow">return</span>;
-<a name="l00714"></a>00714 }
-<a name="l00715"></a>00715 
-<a name="l00724"></a>00724 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00725"></a><a class="code" href="group__fors__zeropoint.html#g5ce973af397768a6d73de2a88b0d2ab3">00725</a> <a class="code" href="group__fors__zeropoint.html#g5ce973af397768a6d73de2a88b0d2ab3">zeropoint_inside</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s,
-<a name="l00726"></a>00726                  <span class="keywordtype">void</span> *data) 
-<a name="l00727"></a>00727 {
-<a name="l00728"></a>00728     <span class="keyword">struct </span>{
-<a name="l00729"></a>00729         <span class="keywordtype">double</span> hi, lo;   <span class="comment">/* magnitude */</span>
-<a name="l00730"></a>00730         <span class="keywordtype">double</span> z, kappa; <span class="comment">/* avg zeropoint, kappa */</span>
-<a name="l00731"></a>00731     } *cuts = data;
-<a name="l00732"></a>00732     
-<a name="l00733"></a>00733     <span class="keywordtype">double</span> z  = <a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a>(s, NULL);
-<a name="l00734"></a>00734     <span class="keywordtype">double</span> dz = <a class="code" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">fors_star_get_zeropoint_err</a>(s, NULL);
-<a name="l00735"></a>00735 
-<a name="l00736"></a>00736     <span class="keywordflow">return</span>
-<a name="l00737"></a>00737         (cuts->lo                 <= z && z <= cuts->hi) ||
-<a name="l00738"></a>00738         (cuts->z - cuts->kappa*dz <= z && z <= cuts->z + cuts->kappa*dz);
-<a name="l00739"></a>00739 }
-<a name="l00740"></a>00740 
-<a name="l00741"></a>00741 <span class="preprocessor">#undef cleanup</span>
-<a name="l00742"></a>00742 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00743"></a>00743 <span class="preprocessor">do { \</span>
-<a name="l00744"></a>00744 <span class="preprocessor">    fors_star_list_delete(&subset, fors_star_delete); \</span>
-<a name="l00745"></a>00745 <span class="preprocessor">    fors_star_list_delete(&identified, fors_star_delete); \</span>
-<a name="l00746"></a>00746 <span class="preprocessor">} while(0)</span>
-<a name="l00747"></a>00747 <span class="preprocessor"></span>
-<a name="l00759"></a>00759 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00760"></a><a class="code" href="group__fors__zeropoint.html#gfd13851752bdf8327fb014e47c6bb104">00760</a> <a class="code" href="group__fors__zeropoint.html#gfd13851752bdf8327fb014e47c6bb104">get_zeropoint</a>(fors_star_list *stars, 
-<a name="l00761"></a>00761               <span class="keywordtype">double</span> cutoffE,
-<a name="l00762"></a>00762               <span class="keywordtype">double</span> cutoffk,
-<a name="l00763"></a>00763               <span class="keywordtype">double</span> dext_coeff,
-<a name="l00764"></a>00764               <span class="keywordtype">double</span> dcolor_term,
-<a name="l00765"></a>00765               <span class="keywordtype">double</span> avg_airmass,
-<a name="l00766"></a>00766               <span class="keywordtype">double</span> *dzeropoint,
-<a name="l00767"></a>00767               <span class="keywordtype">int</span> *n)
-<a name="l00768"></a>00768 {
-<a name="l00769"></a>00769     fors_star_list *subset = NULL;
-<a name="l00770"></a>00770     fors_star_list *identified = 
-<a name="l00771"></a>00771         fors_star_list_extract(stars, <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>,
-<a name="l00772"></a>00772                                <a class="code" href="group__fors__star.html#g41b7ffa8530d0ffbc45916248663ac45">fors_star_is_identified</a>, NULL);
-<a name="l00773"></a>00773 
-<a name="l00774"></a>00774     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( stars != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00775"></a>00775     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( dzeropoint != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00776"></a>00776     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( n != NULL, <span class="keywordflow">return</span> 0, NULL );
-<a name="l00777"></a>00777 
-<a name="l00778"></a>00778     <span class="keywordflow">if</span> ( fors_star_list_size(identified) == 0 ) {
-<a name="l00779"></a>00779         cpl_msg_warning(cpl_func, 
-<a name="l00780"></a>00780                         <span class="stringliteral">"No identified stars for zeropoint computation"</span>);
-<a name="l00781"></a>00781         *n = 0;
-<a name="l00782"></a>00782         *dzeropoint = 0;
-<a name="l00783"></a>00783         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00784"></a>00784         <span class="keywordflow">return</span> 0;
-<a name="l00785"></a>00785     }
-<a name="l00786"></a>00786     
-<a name="l00787"></a>00787     cpl_msg_info(cpl_func, <span class="stringliteral">"Computing zeropoint (assuming extinction)"</span>);
-<a name="l00788"></a>00788     cpl_msg_indent_more();
-<a name="l00789"></a>00789 
-<a name="l00790"></a>00790     <span class="keywordtype">double</span> zeropoint;
-<a name="l00791"></a>00791     <span class="keywordtype">double</span> red_chisq = -1.0;
-<a name="l00792"></a>00792 
-<a name="l00793"></a>00793     <span class="comment">/* This method does not take into account that the error bars are</span>
-<a name="l00794"></a>00794 <span class="comment">       correlated, and therefore computes an unrealistically low</span>
-<a name="l00795"></a>00795 <span class="comment">       dzeropoint */</span>
-<a name="l00796"></a>00796     zeropoint = fors_star_list_mean_optimal(identified,
-<a name="l00797"></a>00797                                             <a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a>, NULL,
-<a name="l00798"></a>00798                                             <a class="code" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">fors_star_get_zeropoint_err</a>, NULL,
-<a name="l00799"></a>00799                                             dzeropoint,
-<a name="l00800"></a>00800                                             fors_star_list_size(identified) >= 2 ? &red_chisq : NULL);
-<a name="l00801"></a>00801 
-<a name="l00802"></a>00802     cpl_msg_info(cpl_func, <span class="stringliteral">"Optimal zeropoint (no rejection, %d stars) = %f mag"</span>,
-<a name="l00803"></a>00803                  fors_star_list_size(identified), zeropoint);  
-<a name="l00804"></a>00804     
-<a name="l00805"></a>00805     <span class="comment">/* Reject stars that are absolute (0.3 mag) outliers and</span>
-<a name="l00806"></a>00806 <span class="comment">       kappa sigma outliers. For robustness (against error in the initial</span>
-<a name="l00807"></a>00807 <span class="comment">       zeropoint estimates) apply the absolute cut in two steps</span>
-<a name="l00808"></a>00808 <span class="comment">       and update the estimated zeropoint after the first step.</span>
-<a name="l00809"></a>00809 <span class="comment">    */</span>
-<a name="l00810"></a>00810     <span class="keyword">struct </span>{
-<a name="l00811"></a>00811         <span class="keywordtype">double</span> hi, lo;   <span class="comment">/* magnitude */</span>
-<a name="l00812"></a>00812         <span class="keywordtype">double</span> z, kappa; <span class="comment">/* avg zeropoint, kappa */</span>
-<a name="l00813"></a>00813     } cuts;
-<a name="l00814"></a>00814     cuts.hi = zeropoint + 5*cutoffE;
-<a name="l00815"></a>00815     cuts.lo = zeropoint - 5*cutoffE;
-<a name="l00816"></a>00816     cuts.z = zeropoint;
-<a name="l00817"></a>00817     cuts.kappa = cutoffk;
-<a name="l00818"></a>00818     
-<a name="l00819"></a>00819     subset = fors_star_list_extract(identified, <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>,
-<a name="l00820"></a>00820                                     <a class="code" href="group__fors__zeropoint.html#g5ce973af397768a6d73de2a88b0d2ab3">zeropoint_inside</a>, &cuts);
-<a name="l00821"></a>00821 
-<a name="l00822"></a>00822 
-<a name="l00823"></a>00823     <span class="keywordflow">if</span> ( fors_star_list_size(subset) == 0 ) {
-<a name="l00824"></a>00824         cpl_msg_warning(cpl_func, 
-<a name="l00825"></a>00825                         <span class="stringliteral">"All stars rejected (%f mag). Cannot "</span>
-<a name="l00826"></a>00826                         <span class="stringliteral">"compute zeropoint"</span>, 5*cutoffE);
-<a name="l00827"></a>00827         *n = 0;
-<a name="l00828"></a>00828         *dzeropoint = 0;
-<a name="l00829"></a>00829         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00830"></a>00830         <span class="keywordflow">return</span> 0;
-<a name="l00831"></a>00831     }
-<a name="l00832"></a>00832 
-<a name="l00833"></a>00833     zeropoint = fors_star_list_mean_optimal(subset,
-<a name="l00834"></a>00834                                             <a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a>, NULL,
-<a name="l00835"></a>00835                                             <a class="code" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">fors_star_get_zeropoint_err</a>, NULL,
-<a name="l00836"></a>00836                                             dzeropoint,
-<a name="l00837"></a>00837                                             fors_star_list_size(subset) >= 2 ? &red_chisq : NULL);
-<a name="l00838"></a>00838 
-<a name="l00839"></a>00839     cpl_msg_debug(cpl_func, <span class="stringliteral">"Optimal zeropoint (%.2f mag, %.2f sigma rejection) = %f mag"</span>,
-<a name="l00840"></a>00840                   5*cutoffE, cutoffk, zeropoint);  
-<a name="l00841"></a>00841     
-<a name="l00842"></a>00842     cuts.hi = zeropoint + cutoffE;
-<a name="l00843"></a>00843     cuts.lo = zeropoint - cutoffE;
-<a name="l00844"></a>00844     cuts.z = zeropoint;
-<a name="l00845"></a>00845     cuts.kappa = cutoffk;
-<a name="l00846"></a>00846     
-<a name="l00847"></a>00847     {
-<a name="l00848"></a>00848         fors_star_list *tmp = fors_star_list_duplicate(subset, <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>);
-<a name="l00849"></a>00849         fors_star_list_delete(&subset, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>);
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851         subset = fors_star_list_extract(tmp, <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>,
-<a name="l00852"></a>00852                                         <a class="code" href="group__fors__zeropoint.html#g5ce973af397768a6d73de2a88b0d2ab3">zeropoint_inside</a>, &cuts);
-<a name="l00853"></a>00853 
-<a name="l00854"></a>00854         <span class="keywordflow">if</span> ( fors_star_list_size(subset) == 0 ) {
-<a name="l00855"></a>00855             cpl_msg_warning(cpl_func, 
-<a name="l00856"></a>00856                             <span class="stringliteral">"All stars rejected (%f mag, %f sigma). Cannot "</span>
-<a name="l00857"></a>00857                             <span class="stringliteral">"compute zeropoint"</span>, cutoffE, cutoffk);
-<a name="l00858"></a>00858             *n = 0;
-<a name="l00859"></a>00859             *dzeropoint = 0;
-<a name="l00860"></a>00860             <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00861"></a>00861             <span class="keywordflow">return</span> 0;
-<a name="l00862"></a>00862         }
-<a name="l00863"></a>00863 
-<a name="l00864"></a>00864         fors_star_list_delete(&tmp, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>);
-<a name="l00865"></a>00865     }
-<a name="l00866"></a>00866 
-<a name="l00867"></a>00867     zeropoint = fors_star_list_mean_optimal(subset,
-<a name="l00868"></a>00868                                             <a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a>, NULL,
-<a name="l00869"></a>00869                                             <a class="code" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">fors_star_get_zeropoint_err</a>, NULL,
-<a name="l00870"></a>00870                                             dzeropoint,
-<a name="l00871"></a>00871                                             fors_star_list_size(subset) >= 2 ? &red_chisq : NULL);
-<a name="l00872"></a>00872     
-<a name="l00873"></a>00873     cpl_msg_info(cpl_func, <span class="stringliteral">"Optimal zeropoint (%.2f mag, %.2f sigma rejection) = %f mag"</span>,
-<a name="l00874"></a>00874                  cutoffE, cutoffk, zeropoint);  
-<a name="l00875"></a>00875     
-<a name="l00876"></a>00876     *n = fors_star_list_size(subset);
-<a name="l00877"></a>00877     {
-<a name="l00878"></a>00878         <span class="keywordtype">int</span> outliers = 
-<a name="l00879"></a>00879             fors_star_list_size(identified) - fors_star_list_size(subset);
-<a name="l00880"></a>00880         cpl_msg_info(cpl_func, <span class="stringliteral">"%d outlier%s rejected, %d non-outliers"</span>,
-<a name="l00881"></a>00881                      outliers, outliers == 1 ? <span class="stringliteral">""</span> : <span class="stringliteral">"s"</span>,
-<a name="l00882"></a>00882                      *n);
-<a name="l00883"></a>00883     }
-<a name="l00884"></a>00884 
-<a name="l00885"></a>00885     <span class="keywordflow">if</span> ( *n == 0 ) {
-<a name="l00886"></a>00886         cpl_msg_warning(cpl_func, 
-<a name="l00887"></a>00887                         <span class="stringliteral">"All stars were rejected during zeropoint computation"</span> );
-<a name="l00888"></a>00888         *dzeropoint = 0;
-<a name="l00889"></a>00889         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00890"></a>00890         <span class="keywordflow">return</span> 0;
-<a name="l00891"></a>00891     }
-<a name="l00892"></a>00892 
-<a name="l00893"></a>00893 
-<a name="l00894"></a>00894 
-<a name="l00895"></a>00895 
-<a name="l00896"></a>00896 
-<a name="l00897"></a>00897 
-<a name="l00898"></a>00898 
-<a name="l00899"></a>00899     <span class="comment">/*</span>
-<a name="l00900"></a>00900 <span class="comment">      Build zeropoint covariance matrix.</span>
-<a name="l00901"></a>00901 <span class="comment">      We have already the variances from fors_star_get_zeropoint_err().</span>
-<a name="l00902"></a>00902 <span class="comment">      Non-diagonal terms are</span>
-<a name="l00903"></a>00903 <span class="comment">         Cij = airmass^2 * Variance(ext.coeff) + color_i * color_j * Variance(color.coeff)</span>
-<a name="l00904"></a>00904 <span class="comment"></span>
-<a name="l00905"></a>00905 <span class="comment">      It was considered and tried to subtract the term</span>
-<a name="l00906"></a>00906 <span class="comment">               airmass^2 * Variance(ext.coeff)</span>
-<a name="l00907"></a>00907 <span class="comment">      from every Cij. This has no effect on the relative weights, only the weight's overall</span>
-<a name="l00908"></a>00908 <span class="comment">      normalization. Since we use the normalization for computing the zeropoint error this</span>
-<a name="l00909"></a>00909 <span class="comment">      term is kept.</span>
-<a name="l00910"></a>00910 <span class="comment"></span>
-<a name="l00911"></a>00911 <span class="comment">    */</span>
-<a name="l00912"></a>00912     cpl_matrix *covariance = cpl_matrix_new(*n,
-<a name="l00913"></a>00913                                             *n);
-<a name="l00914"></a>00914 
-<a name="l00915"></a>00915     <span class="comment">/* Duplicate the list to allow simultaneous iterations */</span>
-<a name="l00916"></a>00916     fors_star_list *ident_dup = fors_star_list_duplicate(subset, <a class="code" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a>);
-<a name="l00917"></a>00917     {
-<a name="l00918"></a>00918       
-<a name="l00919"></a>00919       <a class="code" href="struct__fors__star.html">fors_star</a> *s, *t;
-<a name="l00920"></a>00920       <span class="keywordtype">int</span> i, j;
-<a name="l00921"></a>00921       <span class="keywordflow">for</span> (s = fors_star_list_first(subset), i = 0;
-<a name="l00922"></a>00922            s != NULL;
-<a name="l00923"></a>00923            s = fors_star_list_next(subset), i++) {
-<a name="l00924"></a>00924 
-<a name="l00925"></a>00925         <span class="keywordflow">for</span> (t = fors_star_list_first(ident_dup), j = 0;
-<a name="l00926"></a>00926              t != NULL;
-<a name="l00927"></a>00927              t = fors_star_list_next(ident_dup), j++) {
-<a name="l00928"></a>00928           
-<a name="l00929"></a>00929           <span class="keywordtype">double</span> cij;
-<a name="l00930"></a>00930 
-<a name="l00931"></a>00931           <span class="keywordflow">if</span> (<a class="code" href="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98">fors_star_equal</a>(s, t)) {
-<a name="l00932"></a>00932               cij = <a class="code" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">fors_star_get_zeropoint_err</a>(s, NULL)*<a class="code" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">fors_star_get_zeropoint_err</a>(s, NULL);
-<a name="l00933"></a>00933               <span class="comment">/*  -avg_airmass*avg_airmass*dext_coeff*dext_coeff */</span>
-<a name="l00934"></a>00934           }
-<a name="l00935"></a>00935           <span class="keywordflow">else</span> {
-<a name="l00936"></a>00936               cij = s->id->color * t-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>->color * dcolor_term*dcolor_term
-<a name="l00937"></a>00937                   + avg_airmass*avg_airmass*dext_coeff*dext_coeff;
-<a name="l00938"></a>00938           }
-<a name="l00939"></a>00939           
-<a name="l00940"></a>00940           cpl_matrix_set(covariance, i, j, cij);
-<a name="l00941"></a>00941         }
-<a name="l00942"></a>00942       }
-<a name="l00943"></a>00943     }
-<a name="l00944"></a>00944     <span class="comment">/* cpl_matrix_dump(covariance, stdout); */</span>
-<a name="l00945"></a>00945     <span class="comment">/* cpl_matrix_dump(cpl_matrix_invert_create(covariance), stdout); */</span>
-<a name="l00946"></a>00946 
-<a name="l00947"></a>00947     <span class="comment">/*</span>
-<a name="l00948"></a>00948 <span class="comment">      Compute optimal weights, w, as</span>
-<a name="l00949"></a>00949 <span class="comment">      </span>
-<a name="l00950"></a>00950 <span class="comment">      w = C^-1 * const</span>
-<a name="l00951"></a>00951 <span class="comment"></span>
-<a name="l00952"></a>00952 <span class="comment">      C    : nxn covariance matrix</span>
-<a name="l00953"></a>00953 <span class="comment">      const: nx1 constant vector with all elements equal to 1</span>
-<a name="l00954"></a>00954 <span class="comment">     */</span>
-<a name="l00955"></a>00955 
-<a name="l00956"></a>00956     cpl_matrix *covariance_inverse = cpl_matrix_invert_create(covariance);
-<a name="l00957"></a>00957 
-<a name="l00958"></a>00958     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> 0,
-<a name="l00959"></a>00959             <span class="stringliteral">"Could not invert zeropoints covariance matrix"</span>);
-<a name="l00960"></a>00960 
-<a name="l00961"></a>00961     <span class="comment">/*  cpl_matrix_dump(cpl_matrix_product_create(covariance_inverse, covariance), stdout); */</span>
-<a name="l00962"></a>00962 
-<a name="l00963"></a>00963     <span class="comment">/* fprintf(stderr, "is_identity = %d\n", cpl_matrix_is_identity(cpl_matrix_product_create(covariance_inverse, covariance),1e-10)); */</span>
-<a name="l00964"></a>00964 
-<a name="l00965"></a>00965     cpl_matrix_delete(covariance); covariance = NULL;
-<a name="l00966"></a>00966 
-<a name="l00967"></a>00967     cpl_matrix *const_vector = cpl_matrix_new(*n, 1);
-<a name="l00968"></a>00968     cpl_matrix_fill(const_vector, 1.0);
-<a name="l00969"></a>00969     
-<a name="l00970"></a>00970     cpl_matrix *weights = cpl_matrix_product_create(covariance_inverse, const_vector);
-<a name="l00971"></a>00971 
-<a name="l00972"></a>00972     cpl_matrix_delete(const_vector); const_vector = NULL;
-<a name="l00973"></a>00973 
-<a name="l00974"></a>00974     <span class="comment">/* cpl_matrix_dump(weights, stdout); */</span>
-<a name="l00975"></a>00975     
-<a name="l00976"></a>00976     
-<a name="l00977"></a>00977     {
-<a name="l00978"></a>00978         <span class="keywordtype">double</span> wz = 0;
-<a name="l00979"></a>00979         <span class="keywordtype">double</span> w = 0;
-<a name="l00980"></a>00980         
-<a name="l00981"></a>00981         <span class="keywordtype">int</span> i;
-<a name="l00982"></a>00982         <a class="code" href="struct__fors__star.html">fors_star</a> *s;
-<a name="l00983"></a>00983         <span class="keywordflow">for</span> (i = 0, s = fors_star_list_first(subset);
-<a name="l00984"></a>00984              s != NULL;
-<a name="l00985"></a>00985              s = fors_star_list_next(subset), i++) {
-<a name="l00986"></a>00986             
-<a name="l00987"></a>00987             <span class="keywordtype">double</span> weight = cpl_matrix_get(weights, i, 0);
-<a name="l00988"></a>00988 
-<a name="l00989"></a>00989             cpl_msg_debug(cpl_func, <span class="stringliteral">"Weight_%d = %f"</span>, i, weight);
-<a name="l00990"></a>00990             
-<a name="l00991"></a>00991             wz += weight * <a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a>(s, NULL);
-<a name="l00992"></a>00992             w += weight;
-<a name="l00993"></a>00993 
-<a name="l00994"></a>00994             <span class="comment">/* Loop through original list to record the weight of this star */</span>
-<a name="l00995"></a>00995             {
-<a name="l00996"></a>00996                 <a class="code" href="struct__fors__star.html">fors_star</a> *t;
-<a name="l00997"></a>00997                 
-<a name="l00998"></a>00998                 <span class="keywordflow">for</span> (t = fors_star_list_first(stars);
-<a name="l00999"></a>00999                      t != NULL;
-<a name="l01000"></a>01000                      t = fors_star_list_next(stars)) {
-<a name="l01001"></a>01001                     
-<a name="l01002"></a>01002                     <span class="keywordflow">if</span> (<a class="code" href="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98">fors_star_equal</a>(s, t)) {
-<a name="l01003"></a>01003                         t-><a class="code" href="struct__fors__star.html#82910b82de5851e8f59e40b205b6f829">weight</a> = weight;
-<a name="l01004"></a>01004                     }
-<a name="l01005"></a>01005                 }
-<a name="l01006"></a>01006             }
-<a name="l01007"></a>01007         }
-<a name="l01008"></a>01008 
-<a name="l01009"></a>01009         cpl_matrix_delete(weights); weights = NULL;
-<a name="l01010"></a>01010 
-<a name="l01011"></a>01011         cpl_msg_debug(cpl_func, <span class="stringliteral">"Sum of weights = %f"</span>, w);
-<a name="l01012"></a>01012 
-<a name="l01013"></a>01013         <span class="comment">/* </span>
-<a name="l01014"></a>01014 <span class="comment">           C is positive definite (because all eigenvalues are positive). Therefore</span>
-<a name="l01015"></a>01015 <span class="comment">           C^-1 is also positive definite, a property of positive definite matrices.</span>
-<a name="l01016"></a>01016 <span class="comment">           </span>
-<a name="l01017"></a>01017 <span class="comment">           Positive definite matrices always have the property that</span>
-<a name="l01018"></a>01018 <span class="comment">                 z* C z > 0     for any non-zero (complex) vector z</span>
-<a name="l01019"></a>01019 <span class="comment"></span>
-<a name="l01020"></a>01020 <span class="comment">           The sum of the weights is just</span>
-<a name="l01021"></a>01021 <span class="comment">                const.* w = const.* C^-1 const.</span>
-<a name="l01022"></a>01022 <span class="comment">           where const. is our constant vector filled with 1. Therefore the sum of</span>
-<a name="l01023"></a>01023 <span class="comment">           the weights should always be positive. But make the paranoia check anyway:</span>
-<a name="l01024"></a>01024 <span class="comment">         */</span>
-<a name="l01025"></a>01025 
-<a name="l01026"></a>01026         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( w != 0, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Sum of optimal weights is zero!"</span> );
-<a name="l01027"></a>01027         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( sqrt(w) != 0, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Square root of sum of optimal weights is zero!"</span> );
-<a name="l01028"></a>01028         
-<a name="l01029"></a>01029         zeropoint = wz / w;
-<a name="l01030"></a>01030         *dzeropoint = 1 / sqrt(w);
-<a name="l01031"></a>01031     }
-<a name="l01032"></a>01032 
-<a name="l01033"></a>01033     <span class="comment">/* Previous code: weighted average, uncorrelated errors</span>
-<a name="l01034"></a>01034 <span class="comment"></span>
-<a name="l01035"></a>01035 <span class="comment">    zeropoint = fors_star_list_mean_optimal(</span>
-<a name="l01036"></a>01036 <span class="comment">        subset, </span>
-<a name="l01037"></a>01037 <span class="comment">        fors_star_get_zeropoint, NULL,</span>
-<a name="l01038"></a>01038 <span class="comment">        fors_star_get_zeropoint_err, NULL,</span>
-<a name="l01039"></a>01039 <span class="comment">        dzeropoint,</span>
-<a name="l01040"></a>01040 <span class="comment">        *n >= 2 ? &red_chisq : NULL);</span>
-<a name="l01041"></a>01041 <span class="comment">    */</span>
-<a name="l01042"></a>01042     
-<a name="l01043"></a>01043     cpl_msg_info(cpl_func, <span class="stringliteral">"Optimal zeropoint = %f +- %f mag"</span>, 
-<a name="l01044"></a>01044                  zeropoint, *dzeropoint);
-<a name="l01045"></a>01045 
-<a name="l01046"></a>01046     <span class="keywordflow">if</span> (*n >= 2) {
-<a name="l01047"></a>01047         <a class="code" href="struct__fors__star.html">fors_star</a> *s, *t;
-<a name="l01048"></a>01048         <span class="keywordtype">int</span> i, j;
-<a name="l01049"></a>01049 
-<a name="l01050"></a>01050         red_chisq = 0;
-<a name="l01051"></a>01051 
-<a name="l01052"></a>01052         <span class="keywordflow">for</span> (s = fors_star_list_first(subset), i = 0;
-<a name="l01053"></a>01053              s != NULL;
-<a name="l01054"></a>01054              s = fors_star_list_next(subset), i++) {
-<a name="l01055"></a>01055             
-<a name="l01056"></a>01056             <span class="keywordflow">for</span> (t = fors_star_list_first(ident_dup), j = 0;
-<a name="l01057"></a>01057                  t != NULL;
-<a name="l01058"></a>01058                  t = fors_star_list_next(ident_dup), j++) {
-<a name="l01059"></a>01059                 
-<a name="l01060"></a>01060                 red_chisq += 
-<a name="l01061"></a>01061                     (<a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a>(s, NULL) - zeropoint) *
-<a name="l01062"></a>01062                     (<a class="code" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a>(t, NULL) - zeropoint) *
-<a name="l01063"></a>01063                     cpl_matrix_get(covariance_inverse, i, j);
-<a name="l01064"></a>01064             }
-<a name="l01065"></a>01065         }
-<a name="l01066"></a>01066         red_chisq /= (*n - 1);
-<a name="l01067"></a>01067     }
-<a name="l01068"></a>01068 
-<a name="l01069"></a>01069     cpl_matrix_delete(covariance_inverse); covariance_inverse = NULL;
-<a name="l01070"></a>01070 
-<a name="l01071"></a>01071     fors_star_list_delete(&ident_dup, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>);
-<a name="l01072"></a>01072     
-<a name="l01073"></a>01073     cpl_msg_info(cpl_func, <span class="stringliteral">"Reduced chi square = %f"</span>, red_chisq);
-<a name="l01074"></a>01074     
-<a name="l01075"></a>01075     cpl_msg_indent_less();
-<a name="l01076"></a>01076 
-<a name="l01077"></a>01077     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01078"></a>01078     <span class="keywordflow">return</span> zeropoint;
-<a name="l01079"></a>01079 }
-<a name="l01080"></a>01080 
-<a name="l01081"></a>01081 <span class="preprocessor">#undef cleanup</span>
-<a name="l01082"></a>01082 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01083"></a>01083 <span class="preprocessor">do { \</span>
-<a name="l01084"></a>01084 <span class="preprocessor">    fors_std_star_list_delete(&internal_cat, fors_std_star_delete); \</span>
-<a name="l01085"></a>01085 <span class="preprocessor">} while (0)</span>
-<a name="l01086"></a>01086 <span class="preprocessor"></span>
-<a name="l01106"></a>01106 <span class="keyword">static</span> cpl_error_code
-<a name="l01107"></a><a class="code" href="group__fors__zeropoint.html#g3222d4735fe218be5da224f3a146580b">01107</a> <a class="code" href="group__fors__zeropoint.html#g3222d4735fe218be5da224f3a146580b">fors_zeropoint_astrometry</a>(                  <span class="keyword">const</span> cpl_frameset  *std_cat_frames,
-<a name="l01108"></a>01108                                             <span class="keywordtype">char</span>                filter_band,
-<a name="l01109"></a>01109                                             <span class="keywordtype">double</span>              color_correct,
-<a name="l01110"></a>01110                                             <span class="keywordtype">double</span>              dcolor_correct,
-<a name="l01111"></a>01111                                             <span class="keyword">const</span> identify_method
-<a name="l01112"></a>01112                                                                 *id_method,
-<a name="l01113"></a>01113                                             fors_star_list      *extracted,
-<a name="l01114"></a>01114                                             cpl_propertylist    *wcs_header,
-<a name="l01115"></a>01115                                             fors_std_star_list  **std_cat,
-<a name="l01116"></a>01116                                             cpl_image           **histogram)
-<a name="l01117"></a>01117 {
-<a name="l01118"></a>01118     <span class="keywordtype">double</span>              dcrpix_x = 0,
-<a name="l01119"></a>01119                         dcrpix_y = 0;
-<a name="l01120"></a>01120     fors_std_star_list  *internal_cat = NULL,
-<a name="l01121"></a>01121                         *used_cat;
-<a name="l01122"></a>01122     cpl_errorstate      errstat = cpl_errorstate_get();
-<a name="l01123"></a>01123 
-<a name="l01124"></a>01124     
-<a name="l01125"></a>01125     <span class="keywordflow">if</span> (std_cat != NULL)
-<a name="l01126"></a>01126         *std_cat = NULL;
-<a name="l01127"></a>01127     
-<a name="l01128"></a>01128     cassure_automsg(                        std_cat_frames != NULL,
-<a name="l01129"></a>01129                                             CPL_ERROR_NULL_INPUT,
-<a name="l01130"></a>01130                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01131"></a>01131     cassure_automsg(                        id_method != NULL,
-<a name="l01132"></a>01132                                             CPL_ERROR_NULL_INPUT,
-<a name="l01133"></a>01133                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01134"></a>01134     cassure_automsg(                        extracted != NULL,
-<a name="l01135"></a>01135                                             CPL_ERROR_NULL_INPUT,
-<a name="l01136"></a>01136                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01137"></a>01137     cassure_automsg(                        wcs_header != NULL,
-<a name="l01138"></a>01138                                             CPL_ERROR_NULL_INPUT,
-<a name="l01139"></a>01139                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01140"></a>01140 
-<a name="l01141"></a>01141     cpl_msg_info(cpl_func, <span class="stringliteral">"Loading standard star catalogue(s):"</span>);
-<a name="l01142"></a>01142     cpl_msg_indent_more();
-<a name="l01143"></a>01143     <span class="comment">/*</span>
-<a name="l01144"></a>01144 <span class="comment">    used_cat = internal_cat = fors_std_cat_load_old(</span>
-<a name="l01145"></a>01145 <span class="comment">                                            std_cat_frames,</span>
-<a name="l01146"></a>01146 <span class="comment">                                            filter_band,</span>
-<a name="l01147"></a>01147 <span class="comment">                                            color_term,</span>
-<a name="l01148"></a>01148 <span class="comment">                                            dcolor_term);</span>
-<a name="l01149"></a>01149 <span class="comment">    */</span>
-<a name="l01150"></a>01150     used_cat = internal_cat = fors_std_cat_load(
-<a name="l01151"></a>01151                                             std_cat_frames,
-<a name="l01152"></a>01152                                             filter_band,
-<a name="l01153"></a>01153                                             0,  <span class="comment">/* don't require all frames */</span>
-<a name="l01154"></a>01154                                             color_correct,
-<a name="l01155"></a>01155                                             dcolor_correct);
-<a name="l01156"></a>01156     cpl_msg_indent_less();
-<a name="l01157"></a>01157     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 cpl_errorstate_is_equal(errstat),
-<a name="l01158"></a>01158                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l01159"></a>01159                                             <span class="stringliteral">"Std catalogue loading failed"</span>);
-<a name="l01160"></a>01160     
-<a name="l01161"></a>01161     <span class="comment">/* keep catalogue for output if desired */</span>
-<a name="l01162"></a>01162     <span class="keywordflow">if</span> (std_cat != NULL)
-<a name="l01163"></a>01163     {
-<a name="l01164"></a>01164         *std_cat = used_cat;
-<a name="l01165"></a>01165         internal_cat = NULL;
-<a name="l01166"></a>01166     }
-<a name="l01167"></a>01167     <span class="keywordflow">if</span> (0) <span class="keywordflow">if</span> (used_cat) fors_std_star_print_list(CPL_MSG_DEBUG, used_cat);
-<a name="l01168"></a>01168 
-<a name="l01169"></a>01169     <span class="comment">/* get (x,y) std star positions */</span>
-<a name="l01170"></a>01170     fors_std_star_list_apply_wcs(           used_cat, wcs_header);
-<a name="l01171"></a>01171     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 cpl_errorstate_is_equal(errstat),
-<a name="l01172"></a>01172                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l01173"></a>01173                                             <span class="stringliteral">"Failed to apply WCS to catalogue"</span>);
-<a name="l01174"></a>01174 
-<a name="l01175"></a>01175     <span class="comment">/* Identify (std stars are duplicated and linked to stars) */</span>
-<a name="l01176"></a>01176     <a class="code" href="group__fors__identify.html#g879f2fc7b296f37722f6203d0ead78b6">fors_identify</a>(extracted, used_cat, id_method, histogram);
-<a name="l01177"></a>01177     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 cpl_errorstate_is_equal(errstat),
-<a name="l01178"></a>01178                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l01179"></a>01179                                             <span class="stringliteral">"Failed to identify sources"</span>);
-<a name="l01180"></a>01180 
-<a name="l01181"></a>01181     <span class="comment">/* correct the wcs */</span>
-<a name="l01182"></a>01182     <a class="code" href="group__fors__zeropoint.html#g5a8ae7f99786a3fdc7df6a07d90d905c">fors_zeropoint_astrometry_get_wcs_shift_px</a>(
-<a name="l01183"></a>01183                                             extracted,
-<a name="l01184"></a>01184                                             &dcrpix_x,
-<a name="l01185"></a>01185                                             &dcrpix_y);
-<a name="l01186"></a>01186     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 cpl_errorstate_is_equal(errstat),
-<a name="l01187"></a>01187                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l01188"></a>01188                                             <span class="stringliteral">"Failed to determine WCS correction"</span>
-<a name="l01189"></a>01189                                             );
-<a name="l01190"></a>01190 
-<a name="l01191"></a>01191     cpl_msg_info(                           cpl_func,
-<a name="l01192"></a>01192                                             <span class="stringliteral">"Correcting the WCS origin by "</span>
-<a name="l01193"></a>01193                                             <span class="stringliteral">"(%f, %f)"</span>,
-<a name="l01194"></a>01194                                             -dcrpix_x,
-<a name="l01195"></a>01195                                             -dcrpix_y);
-<a name="l01196"></a>01196 
-<a name="l01197"></a>01197     <a class="code" href="group__fors__zeropoint.html#gd1a70566b3bf818a95a6c3e2312d0710">fors_zeropoint_astrometry_shift_wcs_origin</a>(
-<a name="l01198"></a>01198                                             wcs_header,
-<a name="l01199"></a>01199                                             -dcrpix_x,
-<a name="l01200"></a>01200                                             -dcrpix_y);
-<a name="l01201"></a>01201     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 cpl_errorstate_is_equal(errstat),
-<a name="l01202"></a>01202                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l01203"></a>01203                                             <span class="stringliteral">"Failed to correct WCS origin"</span>);
-<a name="l01204"></a>01204 
-<a name="l01205"></a>01205     <span class="comment">/* re-apply (x,y) std star positions */</span>
-<a name="l01206"></a>01206     {
-<a name="l01207"></a>01207         <span class="comment">/* create a list of the identified std stars */</span>
-<a name="l01208"></a>01208         <a class="code" href="struct__fors__star.html">fors_star</a>   *s;
-<a name="l01209"></a>01209         fors_std_star_list  *identified;
-<a name="l01210"></a>01210         identified = fors_std_star_list_new();
-<a name="l01211"></a>01211 
-<a name="l01212"></a>01212         <span class="keywordflow">for</span> (   s = fors_star_list_first(extracted);
-<a name="l01213"></a>01213                 s != NULL;
-<a name="l01214"></a>01214                 s = fors_star_list_next(extracted))
-<a name="l01215"></a>01215         {
-<a name="l01216"></a>01216             <span class="keywordflow">if</span> (s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> != NULL)
-<a name="l01217"></a>01217                 fors_std_star_list_insert(  identified,
-<a name="l01218"></a>01218                                             (fors_std_star*)s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>); <span class="comment">/* !const */</span>
-<a name="l01219"></a>01219         }
-<a name="l01220"></a>01220 
-<a name="l01221"></a>01221         <span class="keywordflow">if</span> (fors_std_star_list_size(identified) > 0)
-<a name="l01222"></a>01222             fors_std_star_list_apply_wcs(identified, wcs_header);
-<a name="l01223"></a>01223 
-<a name="l01224"></a>01224         <span class="comment">/* delete the list object but not the std stars */</span>
-<a name="l01225"></a>01225         fors_std_star_list_delete(&identified, NULL);
-<a name="l01226"></a>01226     }
-<a name="l01227"></a>01227     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 cpl_errorstate_is_equal(errstat),
-<a name="l01228"></a>01228                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l01229"></a>01229                                             <span class="stringliteral">"Failed to correct std (x,y)"</span>);
-<a name="l01230"></a>01230 
-<a name="l01231"></a>01231     <span class="comment">/* ATTENTION: the following code links fors_std_star* objects to</span>
-<a name="l01232"></a>01232 <span class="comment">     * the stars, which represent non-std stars (trusted-flag=false).</span>
-<a name="l01233"></a>01233 <span class="comment">     * make sure later invoked functions respect this flag!</span>
-<a name="l01234"></a>01234 <span class="comment">     *</span>
-<a name="l01235"></a>01235 <span class="comment">     * Non-std stars are created and linked to stars.</span>
-<a name="l01236"></a>01236 <span class="comment">     * Btw., those stars can be any sextracted celestial object. */</span>
-<a name="l01237"></a>01237     cpl_msg_info(cpl_func, <span class="stringliteral">"Assigning RA & DEC to non-standard stars"</span>);
-<a name="l01238"></a>01238     cpl_msg_indent_more();
-<a name="l01239"></a>01239     <a class="code" href="group__fors__zeropoint.html#g2ea192495f55d98f1068cae2b1921cea">fors_zeropoint_astrometry_apply_unidentified_xy2radec</a>(
-<a name="l01240"></a>01240                                             extracted,
-<a name="l01241"></a>01241                                             wcs_header);
-<a name="l01242"></a>01242     cpl_msg_indent_less();
-<a name="l01243"></a>01243     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 cpl_errorstate_is_equal(errstat),
-<a name="l01244"></a>01244                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l01245"></a>01245                                             <span class="stringliteral">"Failed to apply WCS to non-"</span>
-<a name="l01246"></a>01246                                             <span class="stringliteral">"identified stars"</span>);
-<a name="l01247"></a>01247 
-<a name="l01248"></a>01248     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01249"></a>01249     <span class="keywordflow">return</span> (    cpl_errorstate_is_equal(errstat) ?
-<a name="l01250"></a>01250                 CPL_ERROR_NONE :
-<a name="l01251"></a>01251                 cpl_error_get_code());
-<a name="l01252"></a>01252 }
-<a name="l01253"></a>01253 
-<a name="l01254"></a>01254 <span class="preprocessor">#undef cleanup</span>
-<a name="l01255"></a>01255 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01256"></a>01256 <span class="preprocessor">do { \</span>
-<a name="l01257"></a>01257 <span class="preprocessor">    cpl_vector_delete(vdx_long); vdx_long = NULL; \</span>
-<a name="l01258"></a>01258 <span class="preprocessor">    cpl_vector_delete(vdy_long); vdy_long = NULL; \</span>
-<a name="l01259"></a>01259 <span class="preprocessor">    cpl_vector_unwrap(vdx_only_std); vdx_only_std = NULL; \</span>
-<a name="l01260"></a>01260 <span class="preprocessor">    cpl_vector_unwrap(vdy_only_std); vdy_only_std = NULL; \</span>
-<a name="l01261"></a>01261 <span class="preprocessor">} while (0)</span>
-<a name="l01262"></a>01262 <span class="preprocessor"></span>
-<a name="l01269"></a>01269 <span class="keyword">static</span> cpl_error_code
-<a name="l01270"></a><a class="code" href="group__fors__zeropoint.html#g5a8ae7f99786a3fdc7df6a07d90d905c">01270</a> <a class="code" href="group__fors__zeropoint.html#g5a8ae7f99786a3fdc7df6a07d90d905c">fors_zeropoint_astrometry_get_wcs_shift_px</a>( <span class="keyword">const</span> fors_star_list    *stars,
-<a name="l01271"></a>01271                                             <span class="keywordtype">double</span>                  *dx,
-<a name="l01272"></a>01272                                             <span class="keywordtype">double</span>                  *dy)
-<a name="l01273"></a>01273 {
-<a name="l01274"></a>01274     <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s;
-<a name="l01275"></a>01275     <span class="keywordtype">int</span>             n_stars,
-<a name="l01276"></a>01276                     n_std_stars = 0;
-<a name="l01277"></a>01277     cpl_vector      *vdx_long = NULL,
-<a name="l01278"></a>01278                     *vdx_only_std = NULL,
-<a name="l01279"></a>01279                     *vdy_long = NULL,
-<a name="l01280"></a>01280                     *vdy_only_std = NULL;
-<a name="l01281"></a>01281     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l01282"></a>01282     
-<a name="l01283"></a>01283     <span class="comment">/* init output */</span>
-<a name="l01284"></a>01284     <span class="keywordflow">if</span> (dx != NULL)
-<a name="l01285"></a>01285         *dx = 0;
-<a name="l01286"></a>01286     <span class="keywordflow">if</span> (dy != NULL)
-<a name="l01287"></a>01287         *dy = 0;
-<a name="l01288"></a>01288     
-<a name="l01289"></a>01289     cassure_automsg(                        stars != NULL,
-<a name="l01290"></a>01290                                             CPL_ERROR_NULL_INPUT,
-<a name="l01291"></a>01291                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01292"></a>01292     cassure_automsg(                        dx != NULL,
-<a name="l01293"></a>01293                                             CPL_ERROR_NULL_INPUT,
-<a name="l01294"></a>01294                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01295"></a>01295     cassure_automsg(                        dy != NULL,
-<a name="l01296"></a>01296                                             CPL_ERROR_NULL_INPUT,
-<a name="l01297"></a>01297                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01298"></a>01298     
-<a name="l01299"></a>01299     n_stars = fors_star_list_size(stars);
-<a name="l01300"></a>01300     
-<a name="l01301"></a>01301     cassure_automsg(                        n_stars > 0,
-<a name="l01302"></a>01302                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01303"></a>01303                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01304"></a>01304     
-<a name="l01305"></a>01305     vdx_long = cpl_vector_new(n_stars);
-<a name="l01306"></a>01306     vdy_long = cpl_vector_new(n_stars);
-<a name="l01307"></a>01307     
-<a name="l01308"></a>01308     <span class="keywordflow">for</span> (   s = fors_star_list_first_const(stars);
-<a name="l01309"></a>01309             s != NULL;
-<a name="l01310"></a>01310             s = fors_star_list_next_const(stars))
-<a name="l01311"></a>01311     {
-<a name="l01312"></a>01312         <span class="keyword">const</span> fors_std_star *<span class="keywordtype">id</span> = s-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a>;
-<a name="l01313"></a>01313         if (<span class="keywordtype">id</span> != NULL)
-<a name="l01314"></a>01314         {
-<a name="l01315"></a>01315             cpl_vector_set(vdx_long, n_std_stars, id->pixel->x - s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x);
-<a name="l01316"></a>01316             cpl_vector_set(vdy_long, n_std_stars, id->pixel->y - s-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y);
-<a name="l01317"></a>01317             n_std_stars++;
-<a name="l01318"></a>01318         }
-<a name="l01319"></a>01319     }
-<a name="l01320"></a>01320     
-<a name="l01321"></a>01321     passure(                                cpl_errorstate_is_equal(errstat),
-<a name="l01322"></a>01322                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01323"></a>01323     cassure_automsg(                        n_std_stars > 0,
-<a name="l01324"></a>01324                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01325"></a>01325                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01326"></a>01326     
-<a name="l01327"></a>01327     vdx_only_std = cpl_vector_wrap(n_std_stars, cpl_vector_get_data(vdx_long));
-<a name="l01328"></a>01328     vdy_only_std = cpl_vector_wrap(n_std_stars, cpl_vector_get_data(vdy_long));
-<a name="l01329"></a>01329     
-<a name="l01330"></a>01330     *dx = cpl_vector_get_median(vdx_only_std);
-<a name="l01331"></a>01331     *dy = cpl_vector_get_median(vdy_only_std);
-<a name="l01332"></a>01332     
-<a name="l01333"></a>01333     passure(                                cpl_errorstate_is_equal(errstat),
-<a name="l01334"></a>01334                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01335"></a>01335     
-<a name="l01336"></a>01336     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01337"></a>01337     
-<a name="l01338"></a>01338     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l01339"></a>01339 }
-<a name="l01340"></a>01340 
-<a name="l01341"></a>01341 <span class="preprocessor">#undef cleanup</span>
-<a name="l01342"></a>01342 <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01343"></a>01343 <span class="preprocessor"></span>
-<a name="l01350"></a>01350 <span class="keyword">static</span> cpl_error_code
-<a name="l01351"></a><a class="code" href="group__fors__zeropoint.html#gd1a70566b3bf818a95a6c3e2312d0710">01351</a> <a class="code" href="group__fors__zeropoint.html#gd1a70566b3bf818a95a6c3e2312d0710">fors_zeropoint_astrometry_shift_wcs_origin</a>( cpl_propertylist    *header,
-<a name="l01352"></a>01352                                             <span class="keywordtype">double</span>  dx,
-<a name="l01353"></a>01353                                             <span class="keywordtype">double</span>  dy)
-<a name="l01354"></a>01354 {
-<a name="l01355"></a>01355     <span class="keywordtype">double</span>          crpix_x,
-<a name="l01356"></a>01356                     crpix_y;
-<a name="l01357"></a>01357     cpl_errorstate  errstat = cpl_errorstate_get();
-<a name="l01358"></a>01358     
-<a name="l01359"></a>01359     cassure_automsg(                        header != NULL,
-<a name="l01360"></a>01360                                             CPL_ERROR_NULL_INPUT,
-<a name="l01361"></a>01361                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01362"></a>01362     
-<a name="l01363"></a>01363     <span class="comment">/* FIXME: wanted: creating wcs from header, modifying wcs, storing</span>
-<a name="l01364"></a>01364 <span class="comment">     * back wcs into header. This was not possible due to the lack</span>
-<a name="l01365"></a>01365 <span class="comment">     * of a function to store a wcs in a property list. */</span>
-<a name="l01366"></a>01366     
-<a name="l01367"></a>01367     <span class="keywordflow">if</span> (!cpl_propertylist_has(header, <span class="stringliteral">"CRPIX1"</span>))
-<a name="l01368"></a>01368     {
-<a name="l01369"></a>01369         cpl_error_set_message(              cpl_func,
-<a name="l01370"></a>01370                                             CPL_ERROR_DATA_NOT_FOUND,
-<a name="l01371"></a>01371                                             <span class="stringliteral">"no WCS found in header"</span>);
-<a name="l01372"></a>01372         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01373"></a>01373         <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l01374"></a>01374     }
-<a name="l01375"></a>01375     <span class="keywordflow">if</span> (!cpl_propertylist_has(header, <span class="stringliteral">"CRPIX2"</span>)
-<a name="l01376"></a>01376         || cpl_propertylist_has(header, <span class="stringliteral">"CRPIX3"</span>))
-<a name="l01377"></a>01377     {
-<a name="l01378"></a>01378         cpl_error_set_message(              cpl_func,
-<a name="l01379"></a>01379                                             CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l01380"></a>01380                                             <span class="stringliteral">"WCS in header is not "</span>
-<a name="l01381"></a>01381                                             <span class="stringliteral">"2-dimensional"</span>);
-<a name="l01382"></a>01382         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01383"></a>01383         <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l01384"></a>01384     }
-<a name="l01385"></a>01385     
-<a name="l01386"></a>01386     
-<a name="l01387"></a>01387     crpix_x = cpl_propertylist_get_double(header, <span class="stringliteral">"CRPIX1"</span>);
-<a name="l01388"></a>01388     crpix_y = cpl_propertylist_get_double(header, <span class="stringliteral">"CRPIX2"</span>);
-<a name="l01389"></a>01389     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(                                 cpl_errorstate_is_equal(errstat),
-<a name="l01390"></a>01390                                             <span class="keywordflow">return</span> cpl_error_get_code(),
-<a name="l01391"></a>01391                                             <span class="stringliteral">"CRPIXn keywords must be of type "</span>
-<a name="l01392"></a>01392                                             <span class="stringliteral">"double"</span>);
-<a name="l01393"></a>01393     crpix_x += dx;
-<a name="l01394"></a>01394     crpix_y += dy;
-<a name="l01395"></a>01395     cpl_propertylist_set_double(header, <span class="stringliteral">"CRPIX1"</span>, crpix_x);
-<a name="l01396"></a>01396     cpl_propertylist_set_double(header, <span class="stringliteral">"CRPIX2"</span>, crpix_y);
-<a name="l01397"></a>01397     
-<a name="l01398"></a>01398     <span class="keywordflow">return</span> (    cpl_errorstate_is_equal(errstat) ?
-<a name="l01399"></a>01399                 CPL_ERROR_NONE :
-<a name="l01400"></a>01400                 cpl_error_get_code());
-<a name="l01401"></a>01401 }
-<a name="l01402"></a>01402 
-<a name="l01403"></a>01403 <span class="preprocessor">#undef cleanup</span>
-<a name="l01404"></a>01404 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l01405"></a>01405 <span class="preprocessor">do { \</span>
-<a name="l01406"></a>01406 <span class="preprocessor">    cpl_wcs_delete(wcs); wcs = NULL; \</span>
-<a name="l01407"></a>01407 <span class="preprocessor">    cpl_matrix_delete(mradec); mradec = NULL; \</span>
-<a name="l01408"></a>01408 <span class="preprocessor">    cpl_matrix_delete(mxy); mxy = NULL; \</span>
-<a name="l01409"></a>01409 <span class="preprocessor">    cpl_array_delete(wcs_conversion_status); wcs_conversion_status = NULL; \</span>
-<a name="l01410"></a>01410 <span class="preprocessor">    fors_std_star_delete(&unknown); \</span>
-<a name="l01411"></a>01411 <span class="preprocessor">} while (0)</span>
-<a name="l01412"></a>01412 <span class="preprocessor"></span>
-<a name="l01422"></a>01422 <span class="keyword">static</span> cpl_error_code
-<a name="l01423"></a><a class="code" href="group__fors__zeropoint.html#g2ea192495f55d98f1068cae2b1921cea">01423</a> <a class="code" href="group__fors__zeropoint.html#g2ea192495f55d98f1068cae2b1921cea">fors_zeropoint_astrometry_apply_unidentified_xy2radec</a>(
-<a name="l01424"></a>01424                                             fors_star_list          *stars,
-<a name="l01425"></a>01425                                             <span class="keyword">const</span> cpl_propertylist  *header)
-<a name="l01426"></a>01426 {
-<a name="l01427"></a>01427     cpl_wcs             *wcs = NULL;
-<a name="l01428"></a>01428     cpl_matrix          *mradec = NULL,
-<a name="l01429"></a>01429                         *mxy = NULL;
-<a name="l01430"></a>01430     cpl_array           *wcs_conversion_status = NULL;
-<a name="l01431"></a>01431     <a class="code" href="struct__fors__star.html">fors_star</a>           *star = NULL;
-<a name="l01432"></a>01432     fors_std_star       *unknown = NULL;
-<a name="l01433"></a>01433     <span class="keywordtype">int</span>                 n_unknowns = 0,
-<a name="l01434"></a>01434                         n_wcs_successes = 0,
-<a name="l01435"></a>01435                         n;
-<a name="l01436"></a>01436     <span class="keywordtype">int</span>                 *sdat;
-<a name="l01437"></a>01437     <span class="keyword">union </span>_nant {
-<a name="l01438"></a>01438         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>   bytes[8];
-<a name="l01439"></a>01439         <span class="keywordtype">double</span>          val;
-<a name="l01440"></a>01440     } nan;
-<a name="l01441"></a>01441     cpl_errorstate      errstat = cpl_errorstate_get();
-<a name="l01442"></a>01442     
-<a name="l01443"></a>01443     cassure_automsg(                        stars != NULL,
-<a name="l01444"></a>01444                                             CPL_ERROR_NULL_INPUT,
-<a name="l01445"></a>01445                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01446"></a>01446     cassure_automsg(                        header != NULL,
-<a name="l01447"></a>01447                                             CPL_ERROR_NULL_INPUT,
-<a name="l01448"></a>01448                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01449"></a>01449     
-<a name="l01450"></a>01450     wcs = cpl_wcs_new_from_propertylist(    header);
-<a name="l01451"></a>01451     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code(), NULL);
-<a name="l01452"></a>01452     
-<a name="l01453"></a>01453     {
-<a name="l01454"></a>01454         <span class="comment">/* create NaN */</span>
-<a name="l01455"></a>01455         <span class="keywordtype">int</span> n;
-<a name="l01456"></a>01456         <span class="keywordflow">for</span> (n = 0; n < 8; n++)
-<a name="l01457"></a>01457             nan.bytes[n] = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>)255;
-<a name="l01458"></a>01458     }
-<a name="l01459"></a>01459     
-<a name="l01460"></a>01460     <span class="comment">/* assuming that cpl_wcs_convert has coordinates in rows */</span>
-<a name="l01461"></a>01461     <span class="comment">/* count unknowns */</span>
-<a name="l01462"></a>01462     <span class="keywordflow">for</span> (   star = fors_star_list_first(stars);
-<a name="l01463"></a>01463             star != NULL;
-<a name="l01464"></a>01464             star = fors_star_list_next(stars))
-<a name="l01465"></a>01465     {
-<a name="l01466"></a>01466         <span class="keywordflow">if</span> (star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> == NULL)
-<a name="l01467"></a>01467             n_unknowns++;
-<a name="l01468"></a>01468     }
-<a name="l01469"></a>01469     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01470"></a>01470 
-<a name="l01471"></a>01471     <span class="keywordflow">if</span> (n_unknowns == 0)
-<a name="l01472"></a>01472         <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l01473"></a>01473             
-<a name="l01474"></a>01474     mxy = cpl_matrix_new(n_unknowns, 2);
-<a name="l01475"></a>01475     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01476"></a>01476     
-<a name="l01477"></a>01477     <span class="comment">/* copy x,y */</span>
-<a name="l01478"></a>01478     <span class="keywordflow">for</span> (   star = fors_star_list_first(stars), n = 0;
-<a name="l01479"></a>01479             star != NULL;
-<a name="l01480"></a>01480             star = fors_star_list_next(stars))
-<a name="l01481"></a>01481     {
-<a name="l01482"></a>01482         <span class="keywordflow">if</span> (star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> == NULL)
-<a name="l01483"></a>01483         {
-<a name="l01484"></a>01484             cpl_matrix_set(mxy, n, 0, star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x);
-<a name="l01485"></a>01485             cpl_matrix_set(mxy, n, 1, star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y);
-<a name="l01486"></a>01486             n++;
-<a name="l01487"></a>01487         }
-<a name="l01488"></a>01488     }
-<a name="l01489"></a>01489     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01490"></a>01490     
-<a name="l01491"></a>01491     cpl_wcs_convert(                        wcs,
-<a name="l01492"></a>01492                                             mxy,
-<a name="l01493"></a>01493                                             &mradec,
-<a name="l01494"></a>01494                                             &wcs_conversion_status,
-<a name="l01495"></a>01495                                             CPL_WCS_PHYS2WORLD);
-<a name="l01496"></a>01496     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code(), NULL);
-<a name="l01497"></a>01497     cpl_matrix_delete(mxy); mxy = NULL;
-<a name="l01498"></a>01498     
-<a name="l01499"></a>01499     passure(n_unknowns == cpl_array_get_size(wcs_conversion_status),
-<a name="l01500"></a>01500             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01501"></a>01501     
-<a name="l01502"></a>01502     <span class="comment">/* FIXME: we have to operate on the data array of wcs_conversion_status,</span>
-<a name="l01503"></a>01503 <span class="comment">     * because currently cpl_wcs_convert() does the same and thus ignores</span>
-<a name="l01504"></a>01504 <span class="comment">     * the "valid" flags */</span>
-<a name="l01505"></a>01505     sdat = cpl_array_get_data_int(wcs_conversion_status);
-<a name="l01506"></a>01506     
-<a name="l01507"></a>01507     <span class="keywordflow">for</span> (   star = fors_star_list_first(stars), n = 0;
-<a name="l01508"></a>01508             star != NULL;
-<a name="l01509"></a>01509             star = fors_star_list_next(stars))
-<a name="l01510"></a>01510     {
-<a name="l01511"></a>01511         <span class="keywordflow">if</span> (star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> == NULL)
-<a name="l01512"></a>01512         {
-<a name="l01513"></a>01513             <span class="keywordflow">if</span> (sdat[n] == 0)
-<a name="l01514"></a>01514             {
-<a name="l01515"></a>01515                 <span class="keywordtype">double</span>  ra,
-<a name="l01516"></a>01516                         dec;
-<a name="l01517"></a>01517                 n_wcs_successes++;
-<a name="l01518"></a>01518                 
-<a name="l01519"></a>01519                 ra = cpl_matrix_get(mradec, n, 0);
-<a name="l01520"></a>01520                 dec = cpl_matrix_get(mradec, n, 1);
-<a name="l01521"></a>01521                 unknown = fors_std_star_new(ra, dec,
-<a name="l01522"></a>01522                                             nan.val, nan.val,
-<a name="l01523"></a>01523                                             nan.val, nan.val,
-<a name="l01524"></a>01524                                             nan.val, nan.val,
-<a name="l01525"></a>01525                                             nan.val,
-<a name="l01526"></a>01526                                             NULL);  <span class="comment">/* no name */</span>
-<a name="l01527"></a>01527                 passure(                    cpl_errorstate_is_equal(errstat),
-<a name="l01528"></a>01528                                             <span class="keywordflow">return</span> cpl_error_get_code());
-<a name="l01529"></a>01529                 
-<a name="l01530"></a>01530                 unknown->trusted = <span class="keyword">false</span>;   <span class="comment">/* this star has no catalogue mag*/</span>
-<a name="l01531"></a>01531                 unknown->pixel->x = star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->x;
-<a name="l01532"></a>01532                 unknown->pixel->y = star-><a class="code" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a>->y;
-<a name="l01533"></a>01533                 
-<a name="l01534"></a>01534                 star-><a class="code" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a> = unknown;
-<a name="l01535"></a>01535                 unknown = NULL;
-<a name="l01536"></a>01536             }
-<a name="l01537"></a>01537             n++;
-<a name="l01538"></a>01538         }
-<a name="l01539"></a>01539     }
-<a name="l01540"></a>01540     
-<a name="l01541"></a>01541     cpl_msg_info(                           cpl_func,
-<a name="l01542"></a>01542                                             <span class="stringliteral">"Assigned RA & DEC to %d unknown "</span>
-<a name="l01543"></a>01543                                             <span class="stringliteral">"stars"</span>,
-<a name="l01544"></a>01544                                             n_wcs_successes);
-<a name="l01545"></a>01545     <span class="keywordflow">if</span> (n_wcs_successes < n_unknowns)
-<a name="l01546"></a>01546         cpl_msg_warning(                    cpl_func,
-<a name="l01547"></a>01547                                             <span class="stringliteral">"%d WCS conversions failed"</span>,
-<a name="l01548"></a>01548                                             n_unknowns - n_wcs_successes);
-<a name="l01549"></a>01549     
-<a name="l01550"></a>01550     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l01551"></a>01551     
-<a name="l01552"></a>01552     <span class="keywordflow">return</span> (    cpl_errorstate_is_equal(errstat) ?
-<a name="l01553"></a>01553                 CPL_ERROR_NONE :
-<a name="l01554"></a>01554                 cpl_error_get_code());
-<a name="l01555"></a>01555 }
-<a name="l01556"></a>01556 
-<a name="l01557"></a>01557 <span class="preprocessor">#undef cleanup</span>
-<a name="l01558"></a><a class="code" href="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343">01558</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span>
-<a name="l01559"></a>01559 <span class="preprocessor"></span>
-<a name="l01566"></a>01566 <span class="keywordtype">void</span>
-<a name="l01567"></a><a class="code" href="group__fors__zeropoint.html#g06887d7be84289a1ec9c7b7350e69412">01567</a> <a class="code" href="group__fors__zeropoint.html#g06887d7be84289a1ec9c7b7350e69412">fors_zeropoint_errorstate_dump_as_warning</a>(  <span class="keywordtype">unsigned</span> <span class="keyword">self</span>,
-<a name="l01568"></a>01568                                             <span class="keywordtype">unsigned</span> first,
-<a name="l01569"></a>01569                                             <span class="keywordtype">unsigned</span> last)
-<a name="l01570"></a>01570 {
-<a name="l01571"></a>01571     <span class="keyword">const</span> cpl_boolean is_reverse = first > last ? CPL_TRUE : CPL_FALSE;
-<a name="l01572"></a>01572     <span class="keyword">const</span> <span class="keywordtype">unsigned</span>    newest     = is_reverse ? first : last;
-<a name="l01573"></a>01573     <span class="comment">/*const unsigned    oldest     = is_reverse ? last : first;*/</span>
-<a name="l01574"></a>01574     <span class="keyword">self</span> = <span class="keyword">self</span>;
-<a name="l01575"></a>01575     first = first;
-<a name="l01576"></a>01576     last = last;
-<a name="l01577"></a>01577     <span class="comment">/*assert( oldest <= self );</span>
-<a name="l01578"></a>01578 <span class="comment">    assert( newest >= self );*/</span>
-<a name="l01579"></a>01579     
-<a name="l01580"></a>01580     <span class="keywordflow">if</span> (newest == 0)
-<a name="l01581"></a>01581     {
-<a name="l01582"></a>01582         <span class="comment">/*assert( oldest == 0);*/</span>
-<a name="l01583"></a>01583         cpl_msg_info(cpl_func, <span class="stringliteral">"Success"</span>);
-<a name="l01584"></a>01584     }
-<a name="l01585"></a>01585     <span class="keywordflow">else</span>
-<a name="l01586"></a>01586     {
-<a name="l01587"></a>01587         <span class="comment">/*assert( oldest > 0);*/</span>
-<a name="l01588"></a>01588         cpl_msg_warning(                    cpl_func,
-<a name="l01589"></a>01589                                             <span class="stringliteral">"- %s (%s(), %s: %d)"</span>,
-<a name="l01590"></a>01590                                             cpl_error_get_message(),
-<a name="l01591"></a>01591                                             cpl_error_get_function(),
-<a name="l01592"></a>01592                                             cpl_error_get_file(),
-<a name="l01593"></a>01593                                             cpl_error_get_line());
-<a name="l01594"></a>01594         <span class="comment">/*if (self == last)</span>
-<a name="l01595"></a>01595 <span class="comment">            cpl_msg_indent_less();*/</span>
-<a name="l01596"></a>01596     }
-<a name="l01597"></a>01597 }
-<a name="l01598"></a>01598 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__zeropoint__impl_8c_source.html b/html/fors__zeropoint__impl_8c_source.html
new file mode 100644
index 0000000..5a4524c
--- /dev/null
+++ b/html/fors__zeropoint__impl_8c_source.html
@@ -0,0 +1,1576 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_zeropoint_impl.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_zeropoint_impl.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_zeropoint_impl.c,v 1.96 2013-09-10 19:21:45 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-10 19:21:45 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.96 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <fors_zeropoint_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_extract.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_identify.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_tools.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_star.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_std_cat.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_std_star.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <fors_instrument.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">#include <fors_data.h></span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <fors_setting.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_zeropoint_name = <span class="stringliteral">"fors_zeropoint"</span>;</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_zeropoint_description_short = <span class="stringliteral">"Compute zeropoint"</span>;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_zeropoint_author = <span class="stringliteral">"Jonas M. Larsen"</span>;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_zeropoint_email = PACKAGE_BUGREPORT;</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_zeropoint_description = </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"  DO category:               Type:       Explanation:              Number:\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"  STANDARD_IMG               FITS image  Phot. standard field        1\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flatfield        1\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"  FLX_STD_IMG                FITS table  Standard star catalog       1+\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  PHOT_TABLE                 FITS table  Filter ext. coeff, color    1\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"  SOURCES_STD_IMG            FITS image  Unfiltered SExtractor output\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"  ALIGNED_PHOT               FITS table\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"  PHOT_BACKGROUND_STD_IMG    FITS image  Reduced science image background\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"  STANDARD_REDUCED_IMG       FITS image  Reduced std image\n"</span>;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> </div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <a class="code" href="group__fors__zeropoint.html#ga00f15117674050804680fcb40ed57945" title="Compute zeropoint.">get_zeropoint</a>(fors_star_list *stars, </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>               <span class="keywordtype">double</span> cutoffE,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>               <span class="keywordtype">double</span> cutoffk,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>               <span class="keywordtype">double</span> dext_coeff,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>               <span class="keywordtype">double</span> dcolor_term,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>               <span class="keywordtype">double</span> avg_airmass,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>               <span class="keywordtype">double</span> *dzeropoint,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>               <span class="keywordtype">int</span> *n);</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <a class="code" href="group__fors__zeropoint.html#gac3585e0948fbad1f1e2046a01baaedb3" title="Load standard star catalogue(s) and do the astrometry.">fors_zeropoint_astrometry</a>(                  <span class="keyword">const</span> cpl_frameset  *std_cat_frames,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                                             <span class="keywordtype">char</span>                filter_band,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                                             <span class="keywordtype">double</span>              color_correct,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                                             <span class="keywordtype">double</span>              dcolor_correct,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                                             <span class="keyword">const</span> identify_method</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                                                                 *id_method,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                                             fors_star_list      *extracted,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                                             cpl_propertylist    *wcs_header,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                                             fors_std_star_list  **std_cat,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>                                             cpl_image           **histogram);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <a class="code" href="group__fors__zeropoint.html#ga34215908758f4269782d8c322f01b266" title="Determine the median difference std_star.pixel - star.pixel.">fors_zeropoint_astrometry_get_wcs_shift_px</a>( <span class="keyword">const</span> fors_star_list    *stars,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                                             <span class="keywordtype">double</span>                  *dx,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                                             <span class="keywordtype">double</span>                  *dy);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> </div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <a class="code" href="group__fors__zeropoint.html#gaff77420ce4f300b2f80d53ebf6130020" title="Shift the origin of the WCS in a 2-dimensional frame header.">fors_zeropoint_astrometry_shift_wcs_origin</a>( cpl_propertylist    *header,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                                             <span class="keywordtype">double</span>  dx,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                                             <span class="keywordtype">double</span>  dy);</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> </div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <a class="code" href="group__fors__zeropoint.html#ga2ec4f355c2423ad8517fd8eb6636f96f" title="Create non-standard stars (using the fors_std_star object) connected to the star list entries and ass...">fors_zeropoint_astrometry_apply_unidentified_xy2radec</a>(</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                                             fors_star_list          *stars,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                                             <span class="keyword">const</span> cpl_propertylist  *header);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <a class="code" href="group__fors__zeropoint.html#ga0292c8d9272f7411e58f3581c8bdab0d" title="Dump one error state of the error history.">fors_zeropoint_errorstate_dump_as_warning</a>(  <span class="keywordtype">unsigned</span> <span class="keyword">self</span>,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                                             <span class="keywordtype">unsigned</span> first,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                                             <span class="keywordtype">unsigned</span> last);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga1fc8917da8d302964ad2d2dc6d0eff67">  124</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__zeropoint.html#ga1fc8917da8d302964ad2d2dc6d0eff67" title="Define recipe parameters.">fors_zeropoint_define_parameters</a>(cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> {</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_zeropoint_name);</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     </div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <a class="code" href="group__fors__extract.html#ga2fe71423afa3cceea5d92dd3b49aca1e" title="Define recipe parameters.">fors_extract_define_parameters</a>(parameters, context);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     <a class="code" href="group__fors__identify.html#gac0dc4fbd9cc717256e5972cad3e7447f" title="Define recipe parameters.">fors_identify_define_parameters</a>(parameters, context);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     </div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name, *full_name;</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     name = <span class="stringliteral">"magcutE"</span>;</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                                 <span class="stringliteral">"Zeropoint absolute cutoff (magnitude)"</span>,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                                 context,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                                 1.0);</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     name = <span class="stringliteral">"magcutk"</span>;</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>                                 <span class="stringliteral">"Zeropoint kappa rejection parameter"</span>,</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>                                 context,</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>                                 5.0);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     name = <span class="stringliteral">"magsyserr"</span>;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     full_name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, name);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     p = cpl_parameter_new_value(full_name,</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>                                 <span class="stringliteral">"Systematic error in magnitude"</span>,</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>                                 context,</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                                 0.01);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     cpl_parameterlist_append(parameters, p);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     cpl_free((<span class="keywordtype">void</span> *)full_name); full_name = NULL;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> </div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     cpl_free((<span class="keywordtype">void</span> *)context);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> </div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> }</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="preprocessor">    cpl_frameset_delete(std_frame); \</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="preprocessor">    cpl_frameset_delete(master_bias_frame); \</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="preprocessor">    cpl_frameset_delete(master_flat_frame); \</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="preprocessor">    cpl_frameset_delete(std_cat_frames); \</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="preprocessor">    cpl_frameset_delete(phot_table); \</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="preprocessor">    fors_image_delete(&std); \</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="preprocessor">    fors_image_delete_const(&master_bias); \</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="preprocessor">    fors_image_delete(&master_flat); \</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="preprocessor">    cpl_table_delete(aligned_phot); \</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="preprocessor">    cpl_image_delete(background); \</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="preprocessor">    cpl_table_delete(sources); \</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="preprocessor">    fors_extract_method_delete(&em); \</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="preprocessor">    fors_identify_method_delete(&im); \</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="preprocessor">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="preprocessor">    </span><span class="comment">/* All std-stars (and non-std-stars) are linked by the respective star */</span><span class="preprocessor"> \</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="preprocessor">    </span><span class="comment">/* objects in "stars", without being referenced by a std-star-list */</span><span class="preprocessor"> \</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="preprocessor">    </span><span class="comment">/* object. So they are deleted together with the function */</span><span class="preprocessor"> \</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="preprocessor">    </span><span class="comment">/* fors_star_delete() while deleting the list "stars". */</span><span class="preprocessor"> \</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="preprocessor">    fors_star_list_delete(&stars, fors_star_delete); \</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="preprocessor">    cpl_free((void *)context); \</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="preprocessor">    fors_setting_delete(&setting); \</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="preprocessor">    cpl_propertylist_delete(qc_phot); \</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="preprocessor">    cpl_propertylist_delete(qc_sources); \</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="preprocessor">    cpl_propertylist_delete(product_header); \</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="preprocessor">    cpl_propertylist_delete(raw_header); \</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00215"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga6e4245b398bb089daaaed5ec204e0c4f">  215</a></span> <span class="keywordtype">void</span> <a class="code" href="group__fors__zeropoint.html#ga6e4245b398bb089daaaed5ec204e0c4f" title="Do the processing.">fors_zeropoint</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters)</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> {</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <span class="comment">/* Raw */</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_frameset *std_frame      = NULL;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *std              = NULL;</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     <span class="comment">/* Calibration */</span></div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_frameset *master_bias_frame = NULL;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__image.html">fors_image</a> *master_bias   = NULL; </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> </div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     cpl_frameset *master_flat_frame = NULL;</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *master_flat         = NULL; </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> </div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     cpl_frameset *std_cat_frames    = NULL;</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     fors_std_star_list *cat         = NULL;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     cpl_frameset *phot_table        = NULL;</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <span class="keywordtype">double</span> color_term, dcolor_term;</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     <span class="keywordtype">double</span> ext_coeff, dext_coeff;</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     <span class="keywordtype">double</span> expected_zeropoint, dexpected_zeropoint;</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     </div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_propertylist *raw_header  = NULL;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="comment">/* Products */</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="keywordtype">int</span> nzeropoint = -1;             <span class="comment">/* Suppress warning */</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     cpl_table *aligned_phot = NULL;</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     cpl_propertylist *qc_phot = NULL;</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     cpl_propertylist *qc_sources = NULL;</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="keywordtype">double</span> zeropoint, dzeropoint;</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     <a class="code" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> sky_stats;</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     cpl_image *background = NULL;</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     cpl_table *sources    = NULL;</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     cpl_propertylist *product_header = NULL;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     cpl_image *histogram = NULL;</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>         </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     <span class="comment">/* Parameters */</span></div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     extract_method  *em = NULL;</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     identify_method *im = NULL;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="keywordtype">double</span> cutoffE, cutoffk;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <span class="keywordtype">double</span> magsyserr;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="comment">/* Other */</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *context   = NULL;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     fors_star_list *stars = NULL;</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <a class="code" href="struct__fors__setting.html">fors_setting</a> *setting = NULL;</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="keywordtype">double</span> avg_airmass = 0.0;</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *target_name = NULL; </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     </div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     qc_phot = cpl_propertylist_new();</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     qc_sources = cpl_propertylist_new();</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     product_header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     context = cpl_sprintf(<span class="stringliteral">"fors.%s"</span>, fors_zeropoint_name);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="comment">/* Get parameters */</span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     em = <a class="code" href="group__fors__extract.html#ga9b1d727905c3cb3f7740900ffaba6b57" title="Get extraction method from parameter list.">fors_extract_method_new</a>(parameters, context);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>             <span class="stringliteral">"Could not get extraction parameters"</span> );</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     im = <a class="code" href="group__fors__identify.html#ga642e6d38ae7b273d1901698a3970fd49" title="Get id method from parameter list.">fors_identify_method_new</a>(parameters, context);</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>             <span class="stringliteral">"Could not get identification parameters"</span> );</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"magcutE"</span>);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     cutoffE = <a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a>(parameters, </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>                                             name);</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>         </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"magcutk"</span>);</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     cutoffk = <a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a>(parameters, </div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                                              name);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>         </div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     name = cpl_sprintf(<span class="stringliteral">"%s.%s"</span>, context, <span class="stringliteral">"magsyserr"</span>);</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     magsyserr = <a class="code" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a>(parameters, </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                                                name);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     cpl_free((<span class="keywordtype">void</span> *)name); name = NULL;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, NULL );</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( magsyserr >= 0, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>             <span class="stringliteral">"Input systematic error (magsyserr=%f) cannot be negative"</span>,</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>             magsyserr);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>         </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     <span class="comment">/* Find raw */</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     std_frame = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, STANDARD_IMG);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(std_frame) == 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>             <span class="stringliteral">"Exactly 1 %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>             STANDARD_IMG, cpl_frameset_get_size(std_frame) );</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> </div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <span class="comment">/* Find calibration */</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     master_bias_frame = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, MASTER_BIAS);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(master_bias_frame) == 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>             MASTER_BIAS, cpl_frameset_get_size(master_bias_frame) );</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> </div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     master_flat_frame = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, MASTER_SKY_FLAT_IMG);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(master_flat_frame) == 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>, </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>             MASTER_SKY_FLAT_IMG, cpl_frameset_get_size(master_flat_frame) );</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> </div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     std_cat_frames = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, FLX_STD_IMG);</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(std_cat_frames) >= 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>             <span class="stringliteral">"One or more %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>,</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>             FLX_STD_IMG, cpl_frameset_get_size(std_cat_frames));</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     phot_table = <a class="code" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744" title="Extract frames with given tag from frameset.">fors_frameset_extract</a>(frames, PHOT_TABLE);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( cpl_frameset_get_size(phot_table) == 1, <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>             <span class="stringliteral">"One %s required. %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" found"</span>,</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>             PHOT_TABLE, cpl_frameset_get_size(phot_table));</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> </div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="comment">/* Done finding frames */</span></div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="comment">/* Get setting */</span></div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     setting = <a class="code" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15" title="Create setting from FITS header.">fors_setting_new</a>(cpl_frameset_get_first(std_frame));</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not get instrument setting"</span> );</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="comment">/* Load std raw frame header */</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     raw_header = cpl_propertylist_load(</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>                     cpl_frame_get_filename(</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>                         cpl_frameset_get_first(std_frame)), 0);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordflow">if</span> (raw_header == NULL) {</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Failed to load raw header"</span>);</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>         cleanup;</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     }</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <span class="comment">/* Getting info from std header */</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     avg_airmass = <a class="code" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b" title="Compute average airmass.">fors_get_airmass</a>(raw_header);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     target_name = cpl_propertylist_get_string(raw_header, FORS_PFITS_TARG_NAME);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Target name: %s"</span>, target_name);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     </div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     <span class="comment">/* Load master bias */</span></div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     master_bias = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(cpl_frameset_get_first(master_bias_frame), </div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>                                   NULL, setting, NULL);</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>             <span class="stringliteral">"Could not load master bias"</span>);</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     <span class="comment">/* Load raw frames, subtract bias */</span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     std = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(cpl_frameset_get_first(std_frame), </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>                           master_bias, setting, NULL);</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load standard image"</span>);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <a class="code" href="group__fors__image.html#ga67d54e90304b185e9f211aba5a620c4f" title="Deallocate image and set pointer to NULL.">fors_image_delete_const</a>(&master_bias);</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="comment">/* Load master flat */</span></div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     master_flat = <a class="code" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load</a>(cpl_frameset_get_first(master_flat_frame), </div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>                                   NULL, setting, NULL);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not load master flat"</span>);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="comment">/* Divide by flat */</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     <a class="code" href="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35" title="Divide by scalar.">fors_image_divide_scalar</a>(master_flat,</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>                              <a class="code" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb" title="Get median data value.">fors_image_get_median</a>(master_flat, NULL), -1.0);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     <a class="code" href="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2" title="Divide images.">fors_image_divide</a>(std, master_flat);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not divide by master flat"</span>);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>(&master_flat);</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> </div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="comment">/* Extract sources */</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     stars = <a class="code" href="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05" title="Extract sources.">fors_extract</a>(std, setting, em, magsyserr,</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>                          &sky_stats, &background, &sources);</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Could not extract objects"</span>);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> </div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     <span class="keywordflow">if</span> (setting->filter_name != NULL)</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     {</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>         <span class="keywordtype">char</span>            filter_band;</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>         cpl_errorstate  local_ers = cpl_errorstate_get();</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>         </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>         <span class="comment">/* load raw frame header */</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> </div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="comment">/* Moved outside by Carlo - start</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="comment"></span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> <span class="comment">        raw_header = cpl_propertylist_load(</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> <span class="comment">                        cpl_frame_get_filename(</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment">                            cpl_frameset_get_first(std_frame)), 0);</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="comment">        assure(                             cpl_errorstate_is_equal(local_ers),</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> <span class="comment">                                            return,</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> <span class="comment">                                            "Failed to load raw header");</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="comment">Moved outside by Carlo - end */</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>         </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>         <span class="comment">/* Load filter coefficients */</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>         fors_phot_table_load(cpl_frameset_get_first(phot_table), setting,</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>                              &color_term, &dcolor_term,</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>                              &ext_coeff, &dext_coeff,</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>                              &expected_zeropoint, &dexpected_zeropoint);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                             cpl_errorstate_is_equal(local_ers),</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>                                             <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                                             <span class="stringliteral">"Could not load photometry table"</span> );</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> </div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>         filter_band = fors_instrument_filterband_get_by_setting(setting);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>         </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>         <span class="comment">/* Do the whole astrometry:</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> <span class="comment">         * load catalogue, apply wcs, do pattern-matching, correct wcs</span></div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> <span class="comment">         * (treat errors only as warnings)</span></div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Astrometry:"</span>);</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>         <a class="code" href="group__fors__zeropoint.html#gac3585e0948fbad1f1e2046a01baaedb3" title="Load standard star catalogue(s) and do the astrometry.">fors_zeropoint_astrometry</a>(          std_cat_frames,</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>                                             filter_band,</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                                             color_term,</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                                             dcolor_term,</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>                                             im,</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                                             stars,      <span class="comment">/* sources */</span></div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>                                             raw_header, <span class="comment">/* wcs */</span></div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>                                             &cat,       <span class="comment">/* to draw debug-img */</span></div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>                                             &histogram);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(local_ers))</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>         {</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Astrometric calibration failed:"</span>);</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>             cpl_errorstate_dump(local_ers,</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>                                 CPL_FALSE,</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>                                 <a class="code" href="group__fors__zeropoint.html#ga0292c8d9272f7411e58f3581c8bdab0d" title="Dump one error state of the error history.">fors_zeropoint_errorstate_dump_as_warning</a>);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>             <span class="comment">/* reset error */</span></div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>             cpl_errorstate_set(local_ers);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>         }</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         <span class="comment">/* The astrometric calibration could fail but nonetheless have</span></div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> <span class="comment">         * succeeded in identifying some standard stars. So continue trying to</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> <span class="comment">         * get the zeropoint anyway. */</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>         <span class="comment">/* Correct for atmospheric extinction, gain, exposure time */</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>         <span class="comment">/* FIXME: FAP: use WCS corrected header */</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>         avg_airmass = <a class="code" href="group__fors__tools.html#ga38ae9b9338fdb3cca9a17d970fac3db3" title="Correct for extinction, gain, exposure time.">fors_star_ext_corr</a>(   stars,</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>                                             setting,</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>                                             ext_coeff,</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>                                             dext_coeff,</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>                                             cpl_frameset_get_first(std_frame));</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         <span class="comment">/* Get zeropoint. */</span></div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>         <span class="keywordflow">if</span> (cpl_errorstate_is_equal(local_ers))</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>         {</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>             zeropoint = <a class="code" href="group__fors__zeropoint.html#ga00f15117674050804680fcb40ed57945" title="Compute zeropoint.">get_zeropoint</a>(      stars,</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>                                             cutoffE,</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>                                             cutoffk,</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>                                             dext_coeff,</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>                                             dcolor_term,</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>                                             avg_airmass,</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>                                             &dzeropoint,</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>                                             &nzeropoint);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>         }</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>         </div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         <span class="keywordflow">if</span> (!cpl_errorstate_is_equal(local_ers))</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         {</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Failed to get zeropoint"</span>);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>             cpl_errorstate_dump(local_ers,</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>                                 CPL_FALSE,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>                                 <a class="code" href="group__fors__zeropoint.html#ga0292c8d9272f7411e58f3581c8bdab0d" title="Dump one error state of the error history.">fors_zeropoint_errorstate_dump_as_warning</a>);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>             <span class="comment">/* reset error */</span></div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>             cpl_errorstate_set(local_ers);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>         }</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     }</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>        cpl_msg_warning(cpl_func, <span class="stringliteral">"Zeropoint computation is not supported "</span></div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>                        <span class="stringliteral">"for non-standard filters"</span>);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>        color_term = 0.0;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>        dcolor_term = 9999.0;</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>        ext_coeff = 0.0;</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>        dext_coeff = 9999.0;</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>        expected_zeropoint = 0.0;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>        dexpected_zeropoint = 9999.0;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>        zeropoint = 0.0;</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>        dzeropoint = 0.0;</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>        nzeropoint = 0;</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     }</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span> </div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>     <span class="comment">/* QC */</span></div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     </div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     cpl_msg_info(cpl_func,<span class="stringliteral">"Frame zeropoint = %f mag"</span>, zeropoint);</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     cpl_msg_info(cpl_func,<span class="stringliteral">"Frame zeropoint uncertainty = %f mag"</span>, dzeropoint);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     cpl_msg_info(cpl_func,<span class="stringliteral">"Number of stars used for zeropoint computation = %d"</span>,</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>                  nzeropoint);</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     </div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     cpl_propertylist_append_double(qc_phot, <span class="stringliteral">"ESO QC ZPOINT"</span>, zeropoint);</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     cpl_propertylist_set_comment(qc_phot, <span class="stringliteral">"ESO QC ZPOINT"</span>, <span class="stringliteral">"Frame zeropoint "</span>);</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span> </div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>     cpl_propertylist_append_double(qc_phot, <span class="stringliteral">"ESO QC ZPOINTRMS"</span>, dzeropoint);</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     cpl_propertylist_set_comment(qc_phot, <span class="stringliteral">"ESO QC ZPOINTRMS"</span>, </div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>                                  <span class="stringliteral">"Uncertainty of frame zeropoint [mag]"</span>);</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> </div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     cpl_propertylist_append_int(qc_phot, <span class="stringliteral">"ESO QC ZPOINT NSTARS"</span>, nzeropoint);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     cpl_propertylist_set_comment(qc_phot, <span class="stringliteral">"ESO QC ZPOINT NSTARS"</span>, </div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>                              <span class="stringliteral">"Number of stars used for zeropoint computation"</span>);</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     </div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     <span class="keywordtype">double</span> derived_ext_coeff, derived_ext_coeff_err;</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> </div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     <span class="keywordflow">if</span> (setting->filter_name != NULL) {</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         cpl_msg_info(cpl_func,</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>                      <span class="stringliteral">"Computing extinction "</span></div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>                      <span class="stringliteral">"(assuming zeropoint = %.3f +- %.3f mag)"</span>,</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                      expected_zeropoint,</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>                      dexpected_zeropoint);</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> </div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         <span class="keywordflow">if</span> (nzeropoint > 0) {</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>             derived_ext_coeff = ext_coeff +</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>                 (expected_zeropoint - zeropoint) / avg_airmass;</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>             <span class="comment">/* Things are very correlated here</span></div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span> <span class="comment">               (e.g. ext_coeff was used to compute zeropoint).</span></div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> <span class="comment">           </span></div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span> <span class="comment">               The final error on the ext.coeff. depends only</span></div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> <span class="comment">               on the reference and computed zeropoints' errors. </span></div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span> <span class="comment">               The airmass is assumed errorless.</span></div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> <span class="comment"></span></div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span> <span class="comment">               We assume the 2 zeropoints' errors are not correlated and</span></div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> <span class="comment">               add in quadrature.</span></div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> <span class="comment"></span></div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> <span class="comment">               The derived extinction's error does not suffer from the part</span></div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span> <span class="comment">               of dzeropoint which was due to the error of the assumed </span></div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> <span class="comment">               extinction.</span></div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> <span class="comment">            */</span></div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>             derived_ext_coeff_err = sqrt(</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>                 dexpected_zeropoint*dexpected_zeropoint +</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>                 dzeropoint*dzeropoint) / avg_airmass - dext_coeff*dext_coeff;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>             cpl_msg_info(cpl_func, <span class="stringliteral">"Atmospheric extinction = "</span></div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>                          <span class="stringliteral">"%f +- %f mag/airmass"</span>, derived_ext_coeff,</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>                          derived_ext_coeff_err);</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         }</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Too few stars available, "</span></div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>                             <span class="stringliteral">"setting extinction to zero"</span>);</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>             derived_ext_coeff = 0;</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>             derived_ext_coeff_err = 9999;</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         }</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     }</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         derived_ext_coeff = 0;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>         derived_ext_coeff_err = 9999;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     }</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> </div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     cpl_msg_info(cpl_func,<span class="stringliteral">"Atmospheric extinction = %f mag/airmass"</span>, </div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>                  derived_ext_coeff);</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     cpl_msg_info(cpl_func,<span class="stringliteral">"Error in atmospheric extinction = %f mag/airmass"</span>, </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>                  derived_ext_coeff_err);</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> </div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     cpl_propertylist_append_double(qc_phot, <span class="stringliteral">"ESO QC EXTCOEFF"</span>,</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>                                    derived_ext_coeff);</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     cpl_propertylist_set_comment(qc_phot, <span class="stringliteral">"ESO QC EXTCOEFF"</span>, </div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>                                  <span class="stringliteral">"Atmospheric extinction [mag/airmass]"</span>);</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span> </div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>     cpl_propertylist_append_double(qc_phot, <span class="stringliteral">"ESO QC EXTCOEFFERR"</span>, </div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>                                    derived_ext_coeff_err);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     cpl_propertylist_set_comment(qc_phot, <span class="stringliteral">"ESO QC EXTCOEFFERR"</span>, </div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>                               <span class="stringliteral">"Error on atmospheric extinction [mag/airmass]"</span>);</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span> </div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     cpl_propertylist_append_double(qc_sources, <span class="stringliteral">"ESO QC ZPOINT NSRCEXTRACT"</span>, </div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>                                    cpl_table_get_nrow(sources));</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     cpl_propertylist_set_comment(qc_sources, <span class="stringliteral">"ESO QC ZPOINT NSRCEXTRACT"</span>, </div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>                            <span class="stringliteral">"Number of sources extracted from the zpoint image"</span>);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span> </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span> </div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     <span class="comment">/* Convert to CPL table */</span></div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>     aligned_phot = <a class="code" href="group__fors__tools.html#gabebf30c47320c004ab4e658f837f75db" title="Create product.">fors_create_sources_table</a>(stars);</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>,</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>             <span class="stringliteral">"Failed to create aligned photometry table"</span>);</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> </div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     <span class="comment">/* Save products */</span></div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     <span class="comment">/* FIXME: FAP: use WCS corrected header */</span></div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     <a class="code" href="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f" title="Save DFS product (table)">fors_dfs_save_table</a>(frames, sources, SOURCES_STD,</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>                         qc_sources, parameters, fors_zeropoint_name, </div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>                         cpl_frameset_get_first(std_frame));</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>             SOURCES_STD);</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     cpl_propertylist_delete(qc_sources); qc_sources = NULL;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> </div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="comment">/* Add keywords necessary for fors_photometry </span></div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span> <span class="comment">       (just reuse/overload to the qc propertylist variable)</span></div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     cpl_propertylist_update_double(qc_phot, FORS_PFITS_EXPOSURE_TIME, </div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>                                    setting->exposure_time);</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>     cpl_propertylist_update_double(qc_phot, <span class="stringliteral">"AIRMASS"</span>, avg_airmass);</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     </div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>     cpl_table_fill_invalid_int(aligned_phot, <span class="stringliteral">"USE_CAT"</span>, 2);</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     <span class="comment">/* FIXME: FAP: use WCS corrected header */</span></div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>     <a class="code" href="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f" title="Save DFS product (table)">fors_dfs_save_table</a>(frames, aligned_phot, ALIGNED_PHOT,</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>                         qc_phot, parameters, fors_zeropoint_name, </div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>                         cpl_frameset_get_first(std_frame));</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>             ALIGNED_PHOT);</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     cpl_propertylist_delete(qc_phot); qc_phot = NULL;</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> </div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     <span class="comment">/* FIXME: FAP: use WCS corrected header */</span></div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     <a class="code" href="group__forsdfs.html#gadbf163fdd77abcf68fac009993f20959" title="add WCS keywords to header">fors_dfs_add_wcs</a>(product_header,</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>                      cpl_frameset_get_first(std_frame), setting);</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     <span class="comment">/* FIXME: FAP: use WCS corrected header */</span></div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     <a class="code" href="group__forsdfs.html#ga71054af8e26681ec2d7e1ea39e7feb17" title="Add keyword EXPTIME to header.">fors_dfs_add_exptime</a>(product_header, </div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>                          cpl_frameset_get_first(std_frame), 0.);</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> </div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     cpl_propertylist_update_double(product_header, <span class="stringliteral">"AIRMASS"</span>, avg_airmass);</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         </div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     <a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frames, background, PHOT_BACKGROUND_STD_IMG,</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>                    product_header, parameters, fors_zeropoint_name, </div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>                    setting->version);</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>             PHOT_BACKGROUND_STD_IMG);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         </div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     cpl_image_delete(background); background = NULL;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     </div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     <span class="comment">/* FIXME: FAP: use WCS corrected header */</span></div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, std, STANDARD_REDUCED_IMG,</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>                         product_header, parameters, fors_zeropoint_name, </div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>                         cpl_frameset_get_first(std_frame));</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>             STANDARD_REDUCED_IMG);</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> </div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     <span class="keywordflow">if</span>(histogram != NULL)</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     {</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>         <a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frames, histogram, OFFSET_HISTOGRAM,</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>                 NULL, parameters, fors_zeropoint_name, </div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>                 setting->version);</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>                 OFFSET_HISTOGRAM);</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>         cpl_image_delete(histogram); histogram = NULL;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     }</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     {</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>         cpl_msg_info(cpl_func,<span class="stringliteral">"Offset histogram not computed, not saving"</span>);</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     }</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>         </div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     <span class="keywordflow">if</span> (setting->filter_name == NULL) {</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>         <span class="comment">/* No debug image can be created */</span></div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span> </div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>         cleanup;</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     }</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span> </div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     <span class="comment">/* Create debugging image</span></div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span> <span class="comment"></span></div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> <span class="comment">       Legend:</span></div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span> <span class="comment"></span></div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span> <span class="comment">        ------  (horiz. line):   detected source</span></div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> <span class="comment"></span></div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span> <span class="comment">          |</span></div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span> <span class="comment">          |    (vert. line):   catalog position</span></div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> <span class="comment">          |</span></div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span> <span class="comment"></span></div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span> <span class="comment">          _</span></div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> <span class="comment">         / \     (circle) :   identified</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span> <span class="comment">         \_/</span></div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> </div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     <span class="keywordtype">double</span> color = <a class="code" href="group__fors__image.html#ga918a9107b07852d77bd457ea44d9b28e" title="Get min data value.">fors_image_get_min</a>(std);</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keywordflow">if</span> (stars != NULL)</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     {</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>         <a class="code" href="struct__fors__star.html">fors_star</a> *s;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>         <span class="keywordflow">for</span> (s = fors_star_list_first(stars);</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>              s != NULL; </div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>              s = fors_star_list_next(stars)) {</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>             <a class="code" href="group__fors__image.html#ga84a11915fdc3ac7ae1c9535d9eadfeeb" title="Draw on image.">fors_image_draw</a>(std, 0,</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>                             s->pixel->x,</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>                             s->pixel->y,</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>                             10, color);</div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> </div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>             <span class="keywordflow">if</span> (s->id != NULL && s->id->trusted) {</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>                 <a class="code" href="group__fors__image.html#ga84a11915fdc3ac7ae1c9535d9eadfeeb" title="Draw on image.">fors_image_draw</a>(std, 2,</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>                                 s->pixel->x,</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>                                 s->pixel->y,</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>                                 10, color);</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>             }</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>         }</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     }</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>     <span class="keywordflow">if</span> (cat != NULL)</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     {</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>         fors_std_star *s;</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>         <span class="keywordflow">for</span> (s = fors_std_star_list_first(cat);</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>              s != NULL; </div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>              s = fors_std_star_list_next(cat))</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>         {</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>             <span class="keywordflow">if</span> (s->trusted)</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>                 <a class="code" href="group__fors__image.html#ga84a11915fdc3ac7ae1c9535d9eadfeeb" title="Draw on image.">fors_image_draw</a>(std, 1,</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>                             s->pixel->x,</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>                             s->pixel->y,</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>                             10, color);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>         }</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>         <span class="comment">/* FIXME: FAP: use WCS corrected header */</span></div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>         <a class="code" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7" title="Save DFS product (image) with it error data.">fors_dfs_save_image_err</a>(frames, std, <span class="stringliteral">"DEBUG"</span>,</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>                             product_header, parameters, fors_zeropoint_name, </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>                             cpl_frameset_get_first(std_frame));</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, <span class="stringliteral">"Saving %s failed"</span>,</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>                 <span class="stringliteral">"DEBUG"</span>);</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     }</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> </div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     cleanup;</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> }</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> </div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00725"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga0fca769fa4f247f3fff26ea6ebdd4429">  725</a></span> <a class="code" href="group__fors__zeropoint.html#ga0fca769fa4f247f3fff26ea6ebdd4429" title="determine if zeropoint is inside cuts">zeropoint_inside</a>(<span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s,</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>                  <span class="keywordtype">void</span> *data) </div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> {</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>         <span class="keywordtype">double</span> hi, lo;   <span class="comment">/* magnitude */</span></div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>         <span class="keywordtype">double</span> z, kappa; <span class="comment">/* avg zeropoint, kappa */</span></div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     } *cuts = data;</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <span class="keywordtype">double</span> z  = <a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e" title="Get zeropoint.">fors_star_get_zeropoint</a>(s, NULL);</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>     <span class="keywordtype">double</span> dz = <a class="code" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183" title="Get zeropoint error.">fors_star_get_zeropoint_err</a>(s, NULL);</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> </div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     <span class="keywordflow">return</span></div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>         (cuts->lo                 <= z && z <= cuts->hi) ||</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>         (cuts->z - cuts->kappa*dz <= z && z <= cuts->z + cuts->kappa*dz);</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span> }</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span> </div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> <span class="preprocessor">    fors_star_list_delete(&subset, fors_star_delete); \</span></div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span> <span class="preprocessor">    fors_star_list_delete(&identified, fors_star_delete); \</span></div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00760"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga00f15117674050804680fcb40ed57945">  760</a></span> <a class="code" href="group__fors__zeropoint.html#ga00f15117674050804680fcb40ed57945" title="Compute zeropoint.">get_zeropoint</a>(fors_star_list *stars, </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>               <span class="keywordtype">double</span> cutoffE,</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>               <span class="keywordtype">double</span> cutoffk,</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>               <span class="keywordtype">double</span> dext_coeff,</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>               <span class="keywordtype">double</span> dcolor_term,</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>               <span class="keywordtype">double</span> avg_airmass,</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>               <span class="keywordtype">double</span> *dzeropoint,</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>               <span class="keywordtype">int</span> *n)</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span> {</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     fors_star_list *subset = NULL;</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     fors_star_list *identified = </div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>         fors_star_list_extract(stars, <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>,</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>                                <a class="code" href="group__fors__star.html#ga525a48af1f85cf79ee7a60885eb5b13d" title="Determine if star was identified.">fors_star_is_identified</a>, NULL);</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span> </div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( stars != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( dzeropoint != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( n != NULL, <span class="keywordflow">return</span> 0, NULL );</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> </div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     <span class="keywordflow">if</span> ( fors_star_list_size(identified) == 0 ) {</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>         cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>                         <span class="stringliteral">"No identified stars for zeropoint computation"</span>);</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>         *n = 0;</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>         *dzeropoint = 0;</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>         cleanup;</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     }</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>     </div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Computing zeropoint (assuming extinction)"</span>);</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> </div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     <span class="keywordtype">double</span> zeropoint;</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     <span class="keywordtype">double</span> red_chisq = -1.0;</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> </div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     <span class="comment">/* This method does not take into account that the error bars are</span></div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span> <span class="comment">       correlated, and therefore computes an unrealistically low</span></div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> <span class="comment">       dzeropoint */</span></div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     zeropoint = fors_star_list_mean_optimal(identified,</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>                                             <a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e" title="Get zeropoint.">fors_star_get_zeropoint</a>, NULL,</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>                                             <a class="code" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183" title="Get zeropoint error.">fors_star_get_zeropoint_err</a>, NULL,</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>                                             dzeropoint,</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>                                             fors_star_list_size(identified) >= 2 ? &red_chisq : NULL);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> </div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Optimal zeropoint (no rejection, %d stars) = %f mag"</span>,</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>                  fors_star_list_size(identified), zeropoint);  </div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     </div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     <span class="comment">/* Reject stars that are absolute (0.3 mag) outliers and</span></div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span> <span class="comment">       kappa sigma outliers. For robustness (against error in the initial</span></div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span> <span class="comment">       zeropoint estimates) apply the absolute cut in two steps</span></div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span> <span class="comment">       and update the estimated zeropoint after the first step.</span></div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>         <span class="keywordtype">double</span> hi, lo;   <span class="comment">/* magnitude */</span></div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>         <span class="keywordtype">double</span> z, kappa; <span class="comment">/* avg zeropoint, kappa */</span></div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>     } cuts;</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     cuts.hi = zeropoint + 5*cutoffE;</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>     cuts.lo = zeropoint - 5*cutoffE;</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>     cuts.z = zeropoint;</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>     cuts.kappa = cutoffk;</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>     </div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>     subset = fors_star_list_extract(identified, <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>,</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>                                     <a class="code" href="group__fors__zeropoint.html#ga0fca769fa4f247f3fff26ea6ebdd4429" title="determine if zeropoint is inside cuts">zeropoint_inside</a>, &cuts);</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span> </div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span> </div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>     <span class="keywordflow">if</span> ( fors_star_list_size(subset) == 0 ) {</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>         cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>                         <span class="stringliteral">"All stars rejected (%f mag). Cannot "</span></div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>                         <span class="stringliteral">"compute zeropoint"</span>, 5*cutoffE);</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>         *n = 0;</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>         *dzeropoint = 0;</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>         cleanup;</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>     }</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span> </div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>     zeropoint = fors_star_list_mean_optimal(subset,</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>                                             <a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e" title="Get zeropoint.">fors_star_get_zeropoint</a>, NULL,</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>                                             <a class="code" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183" title="Get zeropoint error.">fors_star_get_zeropoint_err</a>, NULL,</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>                                             dzeropoint,</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>                                             fors_star_list_size(subset) >= 2 ? &red_chisq : NULL);</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span> </div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>     cpl_msg_debug(cpl_func, <span class="stringliteral">"Optimal zeropoint (%.2f mag, %.2f sigma rejection) = %f mag"</span>,</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>                   5*cutoffE, cutoffk, zeropoint);  </div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     </div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>     cuts.hi = zeropoint + cutoffE;</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     cuts.lo = zeropoint - cutoffE;</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     cuts.z = zeropoint;</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>     cuts.kappa = cutoffk;</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>     </div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>     {</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>         fors_star_list *tmp = fors_star_list_duplicate(subset, <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>);</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>         fors_star_list_delete(&subset, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>);</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> </div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>         subset = fors_star_list_extract(tmp, <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>,</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>                                         <a class="code" href="group__fors__zeropoint.html#ga0fca769fa4f247f3fff26ea6ebdd4429" title="determine if zeropoint is inside cuts">zeropoint_inside</a>, &cuts);</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span> </div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>         <span class="keywordflow">if</span> ( fors_star_list_size(subset) == 0 ) {</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>             cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>                             <span class="stringliteral">"All stars rejected (%f mag, %f sigma). Cannot "</span></div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>                             <span class="stringliteral">"compute zeropoint"</span>, cutoffE, cutoffk);</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>             *n = 0;</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>             *dzeropoint = 0;</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>             cleanup;</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>             <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>         }</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span> </div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>         fors_star_list_delete(&tmp, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>);</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     }</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span> </div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>     zeropoint = fors_star_list_mean_optimal(subset,</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>                                             <a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e" title="Get zeropoint.">fors_star_get_zeropoint</a>, NULL,</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>                                             <a class="code" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183" title="Get zeropoint error.">fors_star_get_zeropoint_err</a>, NULL,</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>                                             dzeropoint,</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>                                             fors_star_list_size(subset) >= 2 ? &red_chisq : NULL);</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>     </div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Optimal zeropoint (%.2f mag, %.2f sigma rejection) = %f mag"</span>,</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>                  cutoffE, cutoffk, zeropoint);  </div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>     </div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>     *n = fors_star_list_size(subset);</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>     {</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>         <span class="keywordtype">int</span> outliers = </div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>             fors_star_list_size(identified) - fors_star_list_size(subset);</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"%d outlier%s rejected, %d non-outliers"</span>,</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>                      outliers, outliers == 1 ? <span class="stringliteral">""</span> : <span class="stringliteral">"s"</span>,</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>                      *n);</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>     }</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span> </div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>     <span class="keywordflow">if</span> ( *n == 0 ) {</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>         cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>                         <span class="stringliteral">"All stars were rejected during zeropoint computation"</span> );</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>         *dzeropoint = 0;</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>         cleanup;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>     }</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span> </div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span> </div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span> </div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span> </div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span> </div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span> </div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span> </div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span> <span class="comment">      Build zeropoint covariance matrix.</span></div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span> <span class="comment">      We have already the variances from fors_star_get_zeropoint_err().</span></div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span> <span class="comment">      Non-diagonal terms are</span></div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span> <span class="comment">         Cij = airmass^2 * Variance(ext.coeff) + color_i * color_j * Variance(color.coeff)</span></div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span> <span class="comment"></span></div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span> <span class="comment">      It was considered and tried to subtract the term</span></div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span> <span class="comment">               airmass^2 * Variance(ext.coeff)</span></div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span> <span class="comment">      from every Cij. This has no effect on the relative weights, only the weight's overall</span></div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span> <span class="comment">      normalization. Since we use the normalization for computing the zeropoint error this</span></div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span> <span class="comment">      term is kept.</span></div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span> <span class="comment"></span></div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>     cpl_matrix *covariance = cpl_matrix_new(*n,</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>                                             *n);</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span> </div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>     <span class="comment">/* Duplicate the list to allow simultaneous iterations */</span></div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>     fors_star_list *ident_dup = fors_star_list_duplicate(subset, <a class="code" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a" title="Copy constructor.">fors_star_duplicate</a>);</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>     {</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>       </div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>       <a class="code" href="struct__fors__star.html">fors_star</a> *s, *t;</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>       <span class="keywordtype">int</span> i, j;</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>       <span class="keywordflow">for</span> (s = fors_star_list_first(subset), i = 0;</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>            s != NULL;</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>            s = fors_star_list_next(subset), i++) {</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span> </div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>         <span class="keywordflow">for</span> (t = fors_star_list_first(ident_dup), j = 0;</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>              t != NULL;</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>              t = fors_star_list_next(ident_dup), j++) {</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>           </div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>           <span class="keywordtype">double</span> cij;</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span> </div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>           <span class="keywordflow">if</span> (<a class="code" href="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1" title="Test for equality.">fors_star_equal</a>(s, t)) {</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>               cij = <a class="code" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183" title="Get zeropoint error.">fors_star_get_zeropoint_err</a>(s, NULL)*<a class="code" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183" title="Get zeropoint error.">fors_star_get_zeropoint_err</a>(s, NULL);</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>               <span class="comment">/*  -avg_airmass*avg_airmass*dext_coeff*dext_coeff */</span></div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>           }</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>           <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>               cij = s->id->color * t->id->color * dcolor_term*dcolor_term</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>                   + avg_airmass*avg_airmass*dext_coeff*dext_coeff;</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>           }</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>           </div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>           cpl_matrix_set(covariance, i, j, cij);</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>         }</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>       }</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>     }</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>     <span class="comment">/* cpl_matrix_dump(covariance, stdout); */</span></div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>     <span class="comment">/* cpl_matrix_dump(cpl_matrix_invert_create(covariance), stdout); */</span></div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span> </div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span> <span class="comment">      Compute optimal weights, w, as</span></div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span> <span class="comment">      </span></div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span> <span class="comment">      w = C^-1 * const</span></div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span> <span class="comment"></span></div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span> <span class="comment">      C    : nxn covariance matrix</span></div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span> <span class="comment">      const: nx1 constant vector with all elements equal to 1</span></div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span> </div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>     cpl_matrix *covariance_inverse = cpl_matrix_invert_create(covariance);</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span> </div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> 0,</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>             <span class="stringliteral">"Could not invert zeropoints covariance matrix"</span>);</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span> </div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>     <span class="comment">/*  cpl_matrix_dump(cpl_matrix_product_create(covariance_inverse, covariance), stdout); */</span></div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span> </div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>     <span class="comment">/* fprintf(stderr, "is_identity = %d\n", cpl_matrix_is_identity(cpl_matrix_product_create(covariance_inverse, covariance),1e-10)); */</span></div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span> </div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>     cpl_matrix_delete(covariance); covariance = NULL;</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span> </div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>     cpl_matrix *const_vector = cpl_matrix_new(*n, 1);</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>     cpl_matrix_fill(const_vector, 1.0);</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>     </div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>     cpl_matrix *weights = cpl_matrix_product_create(covariance_inverse, const_vector);</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span> </div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>     cpl_matrix_delete(const_vector); const_vector = NULL;</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span> </div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>     <span class="comment">/* cpl_matrix_dump(weights, stdout); */</span></div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>     </div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>     </div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>     {</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>         <span class="keywordtype">double</span> wz = 0;</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>         <span class="keywordtype">double</span> w = 0;</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>         </div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>         <a class="code" href="struct__fors__star.html">fors_star</a> *s;</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>         <span class="keywordflow">for</span> (i = 0, s = fors_star_list_first(subset);</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>              s != NULL;</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>              s = fors_star_list_next(subset), i++) {</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>             </div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>             <span class="keywordtype">double</span> weight = cpl_matrix_get(weights, i, 0);</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span> </div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>             cpl_msg_debug(cpl_func, <span class="stringliteral">"Weight_%d = %f"</span>, i, weight);</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>             </div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>             wz += weight * <a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e" title="Get zeropoint.">fors_star_get_zeropoint</a>(s, NULL);</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>             w += weight;</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span> </div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>             <span class="comment">/* Loop through original list to record the weight of this star */</span></div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>             {</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>                 <a class="code" href="struct__fors__star.html">fors_star</a> *t;</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>                 </div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>                 <span class="keywordflow">for</span> (t = fors_star_list_first(stars);</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>                      t != NULL;</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>                      t = fors_star_list_next(stars)) {</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>                     </div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1" title="Test for equality.">fors_star_equal</a>(s, t)) {</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>                         t->weight = weight;</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>                     }</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>                 }</div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>             }</div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>         }</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span> </div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>         cpl_matrix_delete(weights); weights = NULL;</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span> </div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>         cpl_msg_debug(cpl_func, <span class="stringliteral">"Sum of weights = %f"</span>, w);</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span> </div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>         <span class="comment">/* </span></div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span> <span class="comment">           C is positive definite (because all eigenvalues are positive). Therefore</span></div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span> <span class="comment">           C^-1 is also positive definite, a property of positive definite matrices.</span></div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span> <span class="comment">           </span></div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span> <span class="comment">           Positive definite matrices always have the property that</span></div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span> <span class="comment">                 z* C z > 0     for any non-zero (complex) vector z</span></div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span> <span class="comment"></span></div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span> <span class="comment">           The sum of the weights is just</span></div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span> <span class="comment">                const.* w = const.* C^-1 const.</span></div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span> <span class="comment">           where const. is our constant vector filled with 1. Therefore the sum of</span></div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span> <span class="comment">           the weights should always be positive. But make the paranoia check anyway:</span></div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span> </div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( w != 0, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Sum of optimal weights is zero!"</span> );</div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( sqrt(w) != 0, <span class="keywordflow">return</span> 0, <span class="stringliteral">"Square root of sum of optimal weights is zero!"</span> );</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>         </div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>         zeropoint = wz / w;</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>         *dzeropoint = 1 / sqrt(w);</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>     }</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span> </div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>     <span class="comment">/* Previous code: weighted average, uncorrelated errors</span></div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span> <span class="comment"></span></div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span> <span class="comment">    zeropoint = fors_star_list_mean_optimal(</span></div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span> <span class="comment">        subset, </span></div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span> <span class="comment">        fors_star_get_zeropoint, NULL,</span></div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span> <span class="comment">        fors_star_get_zeropoint_err, NULL,</span></div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span> <span class="comment">        dzeropoint,</span></div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span> <span class="comment">        *n >= 2 ? &red_chisq : NULL);</span></div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>     </div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Optimal zeropoint = %f +- %f mag"</span>, </div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>                  zeropoint, *dzeropoint);</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span> </div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>     <span class="keywordflow">if</span> (*n >= 2) {</div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>         <a class="code" href="struct__fors__star.html">fors_star</a> *s, *t;</div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>         <span class="keywordtype">int</span> i, j;</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span> </div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>         red_chisq = 0;</div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span> </div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>         <span class="keywordflow">for</span> (s = fors_star_list_first(subset), i = 0;</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>              s != NULL;</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>              s = fors_star_list_next(subset), i++) {</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>             </div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>             <span class="keywordflow">for</span> (t = fors_star_list_first(ident_dup), j = 0;</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>                  t != NULL;</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>                  t = fors_star_list_next(ident_dup), j++) {</div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>                 </div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>                 red_chisq += </div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>                     (<a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e" title="Get zeropoint.">fors_star_get_zeropoint</a>(s, NULL) - zeropoint) *</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>                     (<a class="code" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e" title="Get zeropoint.">fors_star_get_zeropoint</a>(t, NULL) - zeropoint) *</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>                     cpl_matrix_get(covariance_inverse, i, j);</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>             }</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>         }</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>         red_chisq /= (*n - 1);</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>     }</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span> </div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>     cpl_matrix_delete(covariance_inverse); covariance_inverse = NULL;</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span> </div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>     fors_star_list_delete(&ident_dup, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>);</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>     </div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Reduced chi square = %f"</span>, red_chisq);</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>     </div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span> </div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>     cleanup;</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>     <span class="keywordflow">return</span> zeropoint;</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span> }</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span> </div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span> <span class="preprocessor">    fors_std_star_list_delete(&internal_cat, fors_std_star_delete); \</span></div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l01107"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#gac3585e0948fbad1f1e2046a01baaedb3"> 1107</a></span> <a class="code" href="group__fors__zeropoint.html#gac3585e0948fbad1f1e2046a01baaedb3" title="Load standard star catalogue(s) and do the astrometry.">fors_zeropoint_astrometry</a>(                  <span class="keyword">const</span> cpl_frameset  *std_cat_frames,</div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>                                             <span class="keywordtype">char</span>                filter_band,</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>                                             <span class="keywordtype">double</span>              color_correct,</div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>                                             <span class="keywordtype">double</span>              dcolor_correct,</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>                                             <span class="keyword">const</span> identify_method</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>                                                                 *id_method,</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>                                             fors_star_list      *extracted,</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>                                             cpl_propertylist    *wcs_header,</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>                                             fors_std_star_list  **std_cat,</div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>                                             cpl_image           **histogram)</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span> {</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>     <span class="keywordtype">double</span>              dcrpix_x = 0,</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>                         dcrpix_y = 0;</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>     fors_std_star_list  *internal_cat = NULL,</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>                         *used_cat;</div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>     cpl_errorstate      errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span> </div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>     </div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>     <span class="keywordflow">if</span> (std_cat != NULL)</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>         *std_cat = NULL;</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>     </div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>     cassure_automsg(                        std_cat_frames != NULL,</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>     cassure_automsg(                        id_method != NULL,</div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>     cassure_automsg(                        extracted != NULL,</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>     cassure_automsg(                        wcs_header != NULL,</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span> </div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Loading standard star catalogue(s):"</span>);</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span> <span class="comment">    used_cat = internal_cat = fors_std_cat_load_old(</span></div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span> <span class="comment">                                            std_cat_frames,</span></div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span> <span class="comment">                                            filter_band,</span></div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span> <span class="comment">                                            color_term,</span></div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span> <span class="comment">                                            dcolor_term);</span></div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>     used_cat = internal_cat = fors_std_cat_load(</div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>                                             std_cat_frames,</div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>                                             filter_band,</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>                                             0,  <span class="comment">/* don't require all frames */</span></div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>                                             color_correct,</div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>                                             dcolor_correct);</div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>                                             <span class="stringliteral">"Std catalogue loading failed"</span>);</div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>     </div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>     <span class="comment">/* keep catalogue for output if desired */</span></div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>     <span class="keywordflow">if</span> (std_cat != NULL)</div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>     {</div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>         *std_cat = used_cat;</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>         internal_cat = NULL;</div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>     }</div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>     <span class="keywordflow">if</span> (0) <span class="keywordflow">if</span> (used_cat) fors_std_star_print_list(CPL_MSG_DEBUG, used_cat);</div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span> </div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>     <span class="comment">/* get (x,y) std star positions */</span></div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>     fors_std_star_list_apply_wcs(           used_cat, wcs_header);</div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>                                             <span class="stringliteral">"Failed to apply WCS to catalogue"</span>);</div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span> </div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>     <span class="comment">/* Identify (std stars are duplicated and linked to stars) */</span></div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>     <a class="code" href="group__fors__identify.html#ga734ab55ebf9bec1bed7e6330def7b6d8" title="Identify sources.">fors_identify</a>(extracted, used_cat, id_method, histogram);</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>                                             <span class="stringliteral">"Failed to identify sources"</span>);</div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span> </div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>     <span class="comment">/* correct the wcs */</span></div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>     <a class="code" href="group__fors__zeropoint.html#ga34215908758f4269782d8c322f01b266" title="Determine the median difference std_star.pixel - star.pixel.">fors_zeropoint_astrometry_get_wcs_shift_px</a>(</div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>                                             extracted,</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>                                             &dcrpix_x,</div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>                                             &dcrpix_y);</div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>                                             <span class="stringliteral">"Failed to determine WCS correction"</span></div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>                                             );</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span> </div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>     cpl_msg_info(                           cpl_func,</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>                                             <span class="stringliteral">"Correcting the WCS origin by "</span></div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>                                             <span class="stringliteral">"(%f, %f)"</span>,</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>                                             -dcrpix_x,</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>                                             -dcrpix_y);</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span> </div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>     <a class="code" href="group__fors__zeropoint.html#gaff77420ce4f300b2f80d53ebf6130020" title="Shift the origin of the WCS in a 2-dimensional frame header.">fors_zeropoint_astrometry_shift_wcs_origin</a>(</div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>                                             wcs_header,</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>                                             -dcrpix_x,</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>                                             -dcrpix_y);</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>                                             <span class="stringliteral">"Failed to correct WCS origin"</span>);</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span> </div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>     <span class="comment">/* re-apply (x,y) std star positions */</span></div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>     {</div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>         <span class="comment">/* create a list of the identified std stars */</span></div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>         <a class="code" href="struct__fors__star.html">fors_star</a>   *s;</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>         fors_std_star_list  *identified;</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>         identified = fors_std_star_list_new();</div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span> </div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>         <span class="keywordflow">for</span> (   s = fors_star_list_first(extracted);</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>                 s != NULL;</div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>                 s = fors_star_list_next(extracted))</div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>         {</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>             <span class="keywordflow">if</span> (s->id != NULL)</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>                 fors_std_star_list_insert(  identified,</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>                                             (fors_std_star*)s->id); <span class="comment">/* !const */</span></div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>         }</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span> </div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>         <span class="keywordflow">if</span> (fors_std_star_list_size(identified) > 0)</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>             fors_std_star_list_apply_wcs(identified, wcs_header);</div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span> </div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>         <span class="comment">/* delete the list object but not the std stars */</span></div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>         fors_std_star_list_delete(&identified, NULL);</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>     }</div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>                                             <span class="stringliteral">"Failed to correct std (x,y)"</span>);</div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span> </div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>     <span class="comment">/* ATTENTION: the following code links fors_std_star* objects to</span></div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span> <span class="comment">     * the stars, which represent non-std stars (trusted-flag=false).</span></div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span> <span class="comment">     * make sure later invoked functions respect this flag!</span></div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span> <span class="comment">     * Non-std stars are created and linked to stars.</span></div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span> <span class="comment">     * Btw., those stars can be any sextracted celestial object. */</span></div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Assigning RA & DEC to non-standard stars"</span>);</div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>     <a class="code" href="group__fors__zeropoint.html#ga2ec4f355c2423ad8517fd8eb6636f96f" title="Create non-standard stars (using the fors_std_star object) connected to the star list entries and ass...">fors_zeropoint_astrometry_apply_unidentified_xy2radec</a>(</div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>                                             extracted,</div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>                                             wcs_header);</div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>                                             <span class="stringliteral">"Failed to apply WCS to non-"</span></div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>                                             <span class="stringliteral">"identified stars"</span>);</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span> </div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>     cleanup;</div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>     <span class="keywordflow">return</span> (    cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>                 CPL_ERROR_NONE :</div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>                 cpl_error_get_code());</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span> }</div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span> </div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span> <span class="preprocessor">    cpl_vector_delete(vdx_long); vdx_long = NULL; \</span></div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span> <span class="preprocessor">    cpl_vector_delete(vdy_long); vdy_long = NULL; \</span></div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span> <span class="preprocessor">    cpl_vector_unwrap(vdx_only_std); vdx_only_std = NULL; \</span></div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span> <span class="preprocessor">    cpl_vector_unwrap(vdy_only_std); vdy_only_std = NULL; \</span></div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l01270"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga34215908758f4269782d8c322f01b266"> 1270</a></span> <a class="code" href="group__fors__zeropoint.html#ga34215908758f4269782d8c322f01b266" title="Determine the median difference std_star.pixel - star.pixel.">fors_zeropoint_astrometry_get_wcs_shift_px</a>( <span class="keyword">const</span> fors_star_list    *stars,</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>                                             <span class="keywordtype">double</span>                  *dx,</div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>                                             <span class="keywordtype">double</span>                  *dy)</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span> {</div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>     <span class="keyword">const</span> <a class="code" href="struct__fors__star.html">fors_star</a> *s;</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>     <span class="keywordtype">int</span>             n_stars,</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>                     n_std_stars = 0;</div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>     cpl_vector      *vdx_long = NULL,</div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>                     *vdx_only_std = NULL,</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>                     *vdy_long = NULL,</div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>                     *vdy_only_std = NULL;</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>     </div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>     <span class="comment">/* init output */</span></div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>     <span class="keywordflow">if</span> (dx != NULL)</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>         *dx = 0;</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>     <span class="keywordflow">if</span> (dy != NULL)</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>         *dy = 0;</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>     </div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>     cassure_automsg(                        stars != NULL,</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>     cassure_automsg(                        dx != NULL,</div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>     cassure_automsg(                        dy != NULL,</div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>     </div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>     n_stars = fors_star_list_size(stars);</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>     </div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>     cassure_automsg(                        n_stars > 0,</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>     </div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>     vdx_long = cpl_vector_new(n_stars);</div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>     vdy_long = cpl_vector_new(n_stars);</div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>     </div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>     <span class="keywordflow">for</span> (   s = fors_star_list_first_const(stars);</div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>             s != NULL;</div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>             s = fors_star_list_next_const(stars))</div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>     {</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>         <span class="keyword">const</span> fors_std_star *<span class="keywordtype">id</span> = s->id;</div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>         <span class="keywordflow">if</span> (<span class="keywordtype">id</span> != NULL)</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>         {</div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>             cpl_vector_set(vdx_long, n_std_stars, id->pixel->x - s->pixel->x);</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>             cpl_vector_set(vdy_long, n_std_stars, id->pixel->y - s->pixel->y);</div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>             n_std_stars++;</div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>         }</div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>     }</div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>     </div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>     passure(                                cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>     cassure_automsg(                        n_std_stars > 0,</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>     </div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>     vdx_only_std = cpl_vector_wrap(n_std_stars, cpl_vector_get_data(vdx_long));</div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>     vdy_only_std = cpl_vector_wrap(n_std_stars, cpl_vector_get_data(vdy_long));</div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>     </div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>     *dx = cpl_vector_get_median(vdx_only_std);</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>     *dy = cpl_vector_get_median(vdy_only_std);</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>     </div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>     passure(                                cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>     </div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>     cleanup;</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>     </div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span> }</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span> </div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l01351"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#gaff77420ce4f300b2f80d53ebf6130020"> 1351</a></span> <a class="code" href="group__fors__zeropoint.html#gaff77420ce4f300b2f80d53ebf6130020" title="Shift the origin of the WCS in a 2-dimensional frame header.">fors_zeropoint_astrometry_shift_wcs_origin</a>( cpl_propertylist    *header,</div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>                                             <span class="keywordtype">double</span>  dx,</div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>                                             <span class="keywordtype">double</span>  dy)</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span> {</div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>     <span class="keywordtype">double</span>          crpix_x,</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>                     crpix_y;</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>     cpl_errorstate  errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>     </div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>     cassure_automsg(                        header != NULL,</div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>     </div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>     <span class="comment">/* FIXME: wanted: creating wcs from header, modifying wcs, storing</span></div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span> <span class="comment">     * back wcs into header. This was not possible due to the lack</span></div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span> <span class="comment">     * of a function to store a wcs in a property list. */</span></div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>     </div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>     <span class="keywordflow">if</span> (!cpl_propertylist_has(header, <span class="stringliteral">"CRPIX1"</span>))</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>     {</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>         cpl_error_set_message(              cpl_func,</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>                                             CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>                                             <span class="stringliteral">"no WCS found in header"</span>);</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>         cleanup;</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>         <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>     }</div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>     <span class="keywordflow">if</span> (!cpl_propertylist_has(header, <span class="stringliteral">"CRPIX2"</span>)</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>         || cpl_propertylist_has(header, <span class="stringliteral">"CRPIX3"</span>))</div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>     {</div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>         cpl_error_set_message(              cpl_func,</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>                                             CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>                                             <span class="stringliteral">"WCS in header is not "</span></div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>                                             <span class="stringliteral">"2-dimensional"</span>);</div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>         cleanup;</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>         <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>     }</div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>     </div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>     </div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>     crpix_x = cpl_propertylist_get_double(header, <span class="stringliteral">"CRPIX1"</span>);</div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>     crpix_y = cpl_propertylist_get_double(header, <span class="stringliteral">"CRPIX2"</span>);</div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(                                 cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>                                             <span class="keywordflow">return</span> cpl_error_get_code(),</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>                                             <span class="stringliteral">"CRPIXn keywords must be of type "</span></div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>                                             <span class="stringliteral">"double"</span>);</div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>     crpix_x += dx;</div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>     crpix_y += dy;</div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>     cpl_propertylist_set_double(header, <span class="stringliteral">"CRPIX1"</span>, crpix_x);</div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>     cpl_propertylist_set_double(header, <span class="stringliteral">"CRPIX2"</span>, crpix_y);</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>     </div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>     <span class="keywordflow">return</span> (    cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>                 CPL_ERROR_NONE :</div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>                 cpl_error_get_code());</div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span> }</div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span> </div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span> <span class="preprocessor">    cpl_wcs_delete(wcs); wcs = NULL; \</span></div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span> <span class="preprocessor">    cpl_matrix_delete(mradec); mradec = NULL; \</span></div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span> <span class="preprocessor">    cpl_matrix_delete(mxy); mxy = NULL; \</span></div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span> <span class="preprocessor">    cpl_array_delete(wcs_conversion_status); wcs_conversion_status = NULL; \</span></div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span> <span class="preprocessor">    fors_std_star_delete(&unknown); \</span></div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span> <span class="keyword">static</span> cpl_error_code</div>
+<div class="line"><a name="l01423"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga2ec4f355c2423ad8517fd8eb6636f96f"> 1423</a></span> <a class="code" href="group__fors__zeropoint.html#ga2ec4f355c2423ad8517fd8eb6636f96f" title="Create non-standard stars (using the fors_std_star object) connected to the star list entries and ass...">fors_zeropoint_astrometry_apply_unidentified_xy2radec</a>(</div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>                                             fors_star_list          *stars,</div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>                                             <span class="keyword">const</span> cpl_propertylist  *header)</div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span> {</div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>     cpl_wcs             *wcs = NULL;</div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>     cpl_matrix          *mradec = NULL,</div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>                         *mxy = NULL;</div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>     cpl_array           *wcs_conversion_status = NULL;</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>     <a class="code" href="struct__fors__star.html">fors_star</a>           *star = NULL;</div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>     fors_std_star       *unknown = NULL;</div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>     <span class="keywordtype">int</span>                 n_unknowns = 0,</div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>                         n_wcs_successes = 0,</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>                         n;</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>     <span class="keywordtype">int</span>                 *sdat;</div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>     <span class="keyword">union </span>_nant {</div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>   bytes[8];</div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>         <span class="keywordtype">double</span>          val;</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>     } nan;</div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>     cpl_errorstate      errstat = cpl_errorstate_get();</div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>     </div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>     cassure_automsg(                        stars != NULL,</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>     cassure_automsg(                        header != NULL,</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>                                             CPL_ERROR_NULL_INPUT,</div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>     </div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>     wcs = cpl_wcs_new_from_propertylist(    header);</div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code(), NULL);</div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>     </div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>     {</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>         <span class="comment">/* create NaN */</span></div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>         <span class="keywordtype">int</span> n;</div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>         <span class="keywordflow">for</span> (n = 0; n < 8; n++)</div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>             nan.bytes[n] = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>)255;</div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>     }</div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>     </div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>     <span class="comment">/* assuming that cpl_wcs_convert has coordinates in rows */</span></div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>     <span class="comment">/* count unknowns */</span></div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>     <span class="keywordflow">for</span> (   star = fors_star_list_first(stars);</div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>             star != NULL;</div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>             star = fors_star_list_next(stars))</div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>     {</div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>         <span class="keywordflow">if</span> (star->id == NULL)</div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>             n_unknowns++;</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>     }</div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span> </div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>     <span class="keywordflow">if</span> (n_unknowns == 0)</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>         <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>             </div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>     mxy = cpl_matrix_new(n_unknowns, 2);</div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>     </div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>     <span class="comment">/* copy x,y */</span></div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>     <span class="keywordflow">for</span> (   star = fors_star_list_first(stars), n = 0;</div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>             star != NULL;</div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>             star = fors_star_list_next(stars))</div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>     {</div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>         <span class="keywordflow">if</span> (star->id == NULL)</div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>         {</div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>             cpl_matrix_set(mxy, n, 0, star->pixel->x);</div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>             cpl_matrix_set(mxy, n, 1, star->pixel->y);</div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>             n++;</div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>         }</div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>     }</div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>     passure(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>     </div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>     cpl_wcs_convert(                        wcs,</div>
+<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>                                             mxy,</div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>                                             &mradec,</div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>                                             &wcs_conversion_status,</div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>                                             CPL_WCS_PHYS2WORLD);</div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(cpl_errorstate_is_equal(errstat), <span class="keywordflow">return</span> cpl_error_get_code(), NULL);</div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>     cpl_matrix_delete(mxy); mxy = NULL;</div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>     </div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>     passure(n_unknowns == cpl_array_get_size(wcs_conversion_status),</div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>     </div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>     <span class="comment">/* FIXME: we have to operate on the data array of wcs_conversion_status,</span></div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span> <span class="comment">     * because currently cpl_wcs_convert() does the same and thus ignores</span></div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span> <span class="comment">     * the "valid" flags */</span></div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>     sdat = cpl_array_get_data_int(wcs_conversion_status);</div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>     </div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>     <span class="keywordflow">for</span> (   star = fors_star_list_first(stars), n = 0;</div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>             star != NULL;</div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>             star = fors_star_list_next(stars))</div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>     {</div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>         <span class="keywordflow">if</span> (star->id == NULL)</div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>         {</div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>             <span class="keywordflow">if</span> (sdat[n] == 0)</div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>             {</div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>                 <span class="keywordtype">double</span>  ra,</div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>                         dec;</div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>                 n_wcs_successes++;</div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>                 </div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>                 ra = cpl_matrix_get(mradec, n, 0);</div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>                 dec = cpl_matrix_get(mradec, n, 1);</div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>                 unknown = fors_std_star_new(ra, dec,</div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>                                             nan.val, nan.val,</div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>                                             nan.val, nan.val,</div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>                                             nan.val, nan.val,</div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>                                             nan.val,</div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>                                             NULL);  <span class="comment">/* no name */</span></div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>                 passure(                    cpl_errorstate_is_equal(errstat),</div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>                                             <span class="keywordflow">return</span> cpl_error_get_code());</div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>                 </div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>                 unknown->trusted = <span class="keyword">false</span>;   <span class="comment">/* this star has no catalogue mag*/</span></div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>                 unknown->pixel->x = star->pixel->x;</div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>                 unknown->pixel->y = star->pixel->y;</div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>                 </div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>                 star->id = unknown;</div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>                 unknown = NULL;</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>             }</div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>             n++;</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>         }</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>     }</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>     </div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>     cpl_msg_info(                           cpl_func,</div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>                                             <span class="stringliteral">"Assigned RA & DEC to %d unknown "</span></div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>                                             <span class="stringliteral">"stars"</span>,</div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>                                             n_wcs_successes);</div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>     <span class="keywordflow">if</span> (n_wcs_successes < n_unknowns)</div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>         cpl_msg_warning(                    cpl_func,</div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>                                             <span class="stringliteral">"%d WCS conversions failed"</span>,</div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>                                             n_unknowns - n_wcs_successes);</div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>     </div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>     cleanup;</div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>     </div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>     <span class="keywordflow">return</span> (    cpl_errorstate_is_equal(errstat) ?</div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>                 CPL_ERROR_NONE :</div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>                 cpl_error_get_code());</div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span> }</div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span> </div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup</span></div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l01567"></a><span class="lineno"><a class="code" href="group__fors__zeropoint.html#ga0292c8d9272f7411e58f3581c8bdab0d"> 1567</a></span> <a class="code" href="group__fors__zeropoint.html#ga0292c8d9272f7411e58f3581c8bdab0d" title="Dump one error state of the error history.">fors_zeropoint_errorstate_dump_as_warning</a>(  <span class="keywordtype">unsigned</span> <span class="keyword">self</span>,</div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>                                             <span class="keywordtype">unsigned</span> first,</div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>                                             <span class="keywordtype">unsigned</span> last)</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span> {</div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>     <span class="keyword">const</span> cpl_boolean is_reverse = first > last ? CPL_TRUE : CPL_FALSE;</div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>     <span class="keyword">const</span> <span class="keywordtype">unsigned</span>    newest     = is_reverse ? first : last;</div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>     <span class="comment">/*const unsigned    oldest     = is_reverse ? last : first;*/</span></div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>     <span class="keyword">self</span> = <span class="keyword">self</span>;</div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>     first = first;</div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>     last = last;</div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>     <span class="comment">/*assert( oldest <= self );</span></div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span> <span class="comment">    assert( newest >= self );*/</span></div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>     </div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>     <span class="keywordflow">if</span> (newest == 0)</div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>     {</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>         <span class="comment">/*assert( oldest == 0);*/</span></div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Success"</span>);</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>     }</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>     {</div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>         <span class="comment">/*assert( oldest > 0);*/</span></div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>         cpl_msg_warning(                    cpl_func,</div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>                                             <span class="stringliteral">"- %s (%s(), %s: %d)"</span>,</div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>                                             cpl_error_get_message(),</div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>                                             cpl_error_get_function(),</div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>                                             cpl_error_get_file(),</div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>                                             cpl_error_get_line());</div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>         <span class="comment">/*if (self == last)</span></div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span> <span class="comment">            cpl_msg_indent_less();*/</span></div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>     }</div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span> }</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/fors__zeropoint__impl_8h-source.html b/html/fors__zeropoint__impl_8h-source.html
deleted file mode 100644
index 4d75af3..0000000
--- a/html/fors__zeropoint__impl_8h-source.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_zeropoint_impl.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>fors_zeropoint_impl.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_zeropoint_impl.h,v 1.4 2010/09/14 07:49:30 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:49:30 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef FORS_ZEROPOINT_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FORS_ZEROPOINT_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a>;
-<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__zeropoint.html#gb767da8d66a60c2cebce3ffcaa774ab2">fors_zeropoint_description_short</a>;
-<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__zeropoint.html#g00e12f69bfe9efa90b14931c583e30d5">fors_zeropoint_author</a>;
-<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__zeropoint.html#g95121b604add15227dc70f28cef1053c">fors_zeropoint_email</a>;
-<a name="l00039"></a>00039 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__fors__zeropoint.html#g69cec4407efc0bcccde712800aaa577c">fors_zeropoint_description</a>;
-<a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="group__fors__zeropoint.html#gc2cbbec604bd9b8cabf9f83fe71037da">fors_zeropoint_define_parameters</a>(cpl_parameterlist *parameters);
-<a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="group__fors__zeropoint.html#gffa00ce29ad3796187cf1336e4fcbb61">fors_zeropoint</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 CPL_END_DECLS
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/fors__zeropoint__impl_8h_source.html b/html/fors__zeropoint__impl_8h_source.html
new file mode 100644
index 0000000..7852f08
--- /dev/null
+++ b/html/fors__zeropoint__impl_8h_source.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_zeropoint_impl.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">fors_zeropoint_impl.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_zeropoint_impl.h,v 1.4 2010-09-14 07:49:30 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:49:30 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.4 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef FORS_ZEROPOINT_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define FORS_ZEROPOINT_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_zeropoint_name;</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_zeropoint_description_short;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_zeropoint_author;</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_zeropoint_email;</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> fors_zeropoint_description;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__zeropoint.html#ga1fc8917da8d302964ad2d2dc6d0eff67" title="Define recipe parameters.">fors_zeropoint_define_parameters</a>(cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keywordtype">void</span> <a class="code" href="group__fors__zeropoint.html#ga6e4245b398bb089daaaed5ec204e0c4f" title="Do the processing.">fors_zeropoint</a>(cpl_frameset *frames, <span class="keyword">const</span> cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/ftv2blank.png b/html/ftv2blank.png
new file mode 100644
index 0000000..63c605b
Binary files /dev/null and b/html/ftv2blank.png differ
diff --git a/html/ftv2cl.png b/html/ftv2cl.png
new file mode 100644
index 0000000..132f657
Binary files /dev/null and b/html/ftv2cl.png differ
diff --git a/html/ftv2doc.png b/html/ftv2doc.png
new file mode 100644
index 0000000..17edabf
Binary files /dev/null and b/html/ftv2doc.png differ
diff --git a/html/ftv2folderclosed.png b/html/ftv2folderclosed.png
new file mode 100644
index 0000000..bb8ab35
Binary files /dev/null and b/html/ftv2folderclosed.png differ
diff --git a/html/ftv2folderopen.png b/html/ftv2folderopen.png
new file mode 100644
index 0000000..d6c7f67
Binary files /dev/null and b/html/ftv2folderopen.png differ
diff --git a/html/ftv2lastnode.png b/html/ftv2lastnode.png
new file mode 100644
index 0000000..63c605b
Binary files /dev/null and b/html/ftv2lastnode.png differ
diff --git a/html/ftv2link.png b/html/ftv2link.png
new file mode 100644
index 0000000..17edabf
Binary files /dev/null and b/html/ftv2link.png differ
diff --git a/html/ftv2mlastnode.png b/html/ftv2mlastnode.png
new file mode 100644
index 0000000..0b63f6d
Binary files /dev/null and b/html/ftv2mlastnode.png differ
diff --git a/html/ftv2mnode.png b/html/ftv2mnode.png
new file mode 100644
index 0000000..0b63f6d
Binary files /dev/null and b/html/ftv2mnode.png differ
diff --git a/html/ftv2mo.png b/html/ftv2mo.png
new file mode 100644
index 0000000..4bfb80f
Binary files /dev/null and b/html/ftv2mo.png differ
diff --git a/html/ftv2node.png b/html/ftv2node.png
new file mode 100644
index 0000000..63c605b
Binary files /dev/null and b/html/ftv2node.png differ
diff --git a/html/ftv2ns.png b/html/ftv2ns.png
new file mode 100644
index 0000000..72e3d71
Binary files /dev/null and b/html/ftv2ns.png differ
diff --git a/html/ftv2plastnode.png b/html/ftv2plastnode.png
new file mode 100644
index 0000000..c6ee22f
Binary files /dev/null and b/html/ftv2plastnode.png differ
diff --git a/html/ftv2pnode.png b/html/ftv2pnode.png
new file mode 100644
index 0000000..c6ee22f
Binary files /dev/null and b/html/ftv2pnode.png differ
diff --git a/html/ftv2splitbar.png b/html/ftv2splitbar.png
new file mode 100644
index 0000000..fe895f2
Binary files /dev/null and b/html/ftv2splitbar.png differ
diff --git a/html/ftv2vertline.png b/html/ftv2vertline.png
new file mode 100644
index 0000000..63c605b
Binary files /dev/null and b/html/ftv2vertline.png differ
diff --git a/html/functions.html b/html/functions.html
deleted file mode 100644
index 4874c82..0000000
--- a/html/functions.html
+++ /dev/null
@@ -1,203 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: Data Fields</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li id="current"><a href="functions.html"><span>All</span></a></li>
-    <li><a href="functions_vars.html"><span>Variables</span></a></li>
-  </ul>
-</div>
-<div class="tabs">
-  <ul>
-    <li><a href="#index_a"><span>a</span></a></li>
-    <li><a href="#index_b"><span>b</span></a></li>
-    <li><a href="#index_c"><span>c</span></a></li>
-    <li><a href="#index_d"><span>d</span></a></li>
-    <li><a href="#index_e"><span>e</span></a></li>
-    <li><a href="#index_f"><span>f</span></a></li>
-    <li><a href="#index_g"><span>g</span></a></li>
-    <li><a href="#index_h"><span>h</span></a></li>
-    <li><a href="#index_i"><span>i</span></a></li>
-    <li><a href="#index_k"><span>k</span></a></li>
-    <li><a href="#index_m"><span>m</span></a></li>
-    <li><a href="#index_n"><span>n</span></a></li>
-    <li><a href="#index_o"><span>o</span></a></li>
-    <li><a href="#index_p"><span>p</span></a></li>
-    <li><a href="#index_r"><span>r</span></a></li>
-    <li><a href="#index_s"><span>s</span></a></li>
-    <li><a href="#index_t"><span>t</span></a></li>
-    <li><a href="#index_v"><span>v</span></a></li>
-    <li><a href="#index_w"><span>w</span></a></li>
-    <li><a href="#index_x"><span>x</span></a></li>
-    <li><a href="#index_y"><span>y</span></a></li>
-  </ul>
-</div>
-
-<p>
-Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:
-<p>
-<h3><a class="anchor" name="index_a">- a -</a></h3><ul>
-<li>airmass
-: <a class="el" href="structentry.html#6f585239f5d6905b0cff05055d77bf9c">entry</a><li>atm_ext_identifier
-: <a class="el" href="structentry.html#c85d7b45722824c52fdaa4754c8d64ee">entry</a><li>atm_ext_index
-: <a class="el" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">entry</a><li>average_gain
-: <a class="el" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">_fors_setting</a></ul>
-<h3><a class="anchor" name="index_b">- b -</a></h3><ul>
-<li>back
-: <a class="el" href="structlist.html#08398e899d83978b0fb79e448b685b32">list</a><li>band
-: <a class="el" href="structband__jacobian.html#b448380c1a9359906b9d6739074ee4b4">band_jacobian</a>, <a class="el" href="structfors__filterlist.html#98f2d94bcd86b7376568e913140371ac">fors_filterlist</a><li>binx
-: <a class="el" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">_fors_setting</a><li>biny
-: <a class="el" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">_fors_setting</a><li>bval
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#633c615d76af4c00b82b50bf75cb4b84">_FORS_PAF_RECORD_</a></ul>
-<h3><a class="anchor" name="index_c">- c -</a></h3><ul>
-<li>cat_magnitude
-: <a class="el" href="struct__fors__std__star.html#572834d8779cf03a23be21e86c58dd7f">_fors_std_star</a><li>chip_id
-: <a class="el" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">_fors_setting</a><li>col
-: <a class="el" href="structband__jacobian.html#81d02268a4a5d5366b43d30714ed4f7f">band_jacobian</a><li>color
-: <a class="el" href="struct__fors__std__star.html#a8620d2a99065a638abe790fd240f5d2">_fors_std_star</a><li>comment
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">_FORS_PAF_RECORD_</a><li>cov_catm_color
-: <a class="el" href="struct__fors__std__star.html#7f673b38b2ce3af3959eab9ccf97a356">_fors_std_star</a><li>current
-: <a class="el" href="structlist.html#87b04e0bab57e6949272df159ee19baf">list</a><li>current_p1
-: <a class="el" href="structlist.html#38d7fad1310a6005cefaa130cce4597a">list</a><li>current_p2
-: <a class="el" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">list</a></ul>
-<h3><a class="anchor" name="index_d">- d -</a></h3><ul>
-<li>data
-: <a class="el" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">_fors_image</a><li>dcat_magnitude
-: <a class="el" href="struct__fors__std__star.html#4d258c07f6a7bb5b17f4bd0c7faf75a8">_fors_std_star</a><li>dcolor
-: <a class="el" href="struct__fors__std__star.html#4dbabb1e3ade361a611e54f51aeb2781">_fors_std_star</a><li>dec
-: <a class="el" href="struct__fors__std__star.html#af20d4b52c06758c47ca0847f77ea03e">_fors_std_star</a><li>dims
-: <a class="el" href="struct__fors__cpl__wcs__.html#947b7dc1ce3651b19825dee6fe385666">_fors_cpl_wcs_</a><li>dmagnitude
-: <a class="el" href="struct__fors__std__star.html#0daa0413ccc6df832707e97c52cbe8f7">_fors_std_star</a>, <a class="el" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">_fors_star</a><li>dmagnitude_corr
-: <a class="el" href="struct__fors__star.html#ee281335ef4e49be1cfb5caf7f96d7c3">_fors_star</a><li>dratsq
-: <a class="el" href="struct__fors__pattern.html#b30a8282c5be5dcb81396a14232c6d97">_fors_pattern</a><li>dtheta
-: <a class="el" href="struct__fors__pattern.html#41f94fda5bd41b1e72ef9c679ac73c2b">_fors_pattern</a><li>dval
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#34d5c881a9bc312b95bc3d644d6fb522">_FORS_PAF_RECORD_</a></ul>
-<h3><a class="anchor" name="index_e">- e -</a></h3><ul>
-<li>elements
-: <a class="el" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">list</a><li>exposure_time
-: <a class="el" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">_fors_setting</a><li>exptime
-: <a class="el" href="structentry.html#3e422ef6bc06e1e9c3d2dad3ec2f972b">entry</a></ul>
-<h3><a class="anchor" name="index_f">- f -</a></h3><ul>
-<li>filter_name
-: <a class="el" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">_fors_setting</a><li>filterband
-: <a class="el" href="struct__fors__setting.html#1bc4ab059bf8d162814b5c2cb231142c">_fors_setting</a><li>frame_index
-: <a class="el" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">entry</a><li>fwhm
-: <a class="el" href="struct__fors__star.html#4bb929a1553cd3239fcf18112c699200">_fors_star</a></ul>
-<h3><a class="anchor" name="index_g">- g -</a></h3><ul>
-<li>gain
-: <a class="el" href="structentry.html#9094c40ac744faa1135a2773f85ba1ff">entry</a></ul>
-<h3><a class="anchor" name="index_h">- h -</a></h3><ul>
-<li>header
-: <a class="el" href="struct__FORS__PAF__.html#cdc2007f38750ed7ef260e8409d4eb1f">_FORS_PAF_</a></ul>
-<h3><a class="anchor" name="index_i">- i -</a></h3><ul>
-<li>id
-: <a class="el" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">_fors_star</a><li>instrument
-: <a class="el" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">_fors_setting</a><li>ival
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#880a737b5fffa6baaeaa97653bdb341e">_FORS_PAF_RECORD_</a></ul>
-<h3><a class="anchor" name="index_k">- k -</a></h3><ul>
-<li>kappa
-: <a class="el" href="struct__identify__method.html#1aae6e461fafcb0388b343e5d94adbe6">_identify_method</a><li>khigh
-: <a class="el" href="struct__stack__method.html#236ce050034e112bb1d000de525a7895">_stack_method</a><li>kiter
-: <a class="el" href="struct__stack__method.html#b98c63a3bb7288969c818ee3653a482b">_stack_method</a><li>klow
-: <a class="el" href="struct__stack__method.html#41f6ab3a4ca6f07365f32d63bbe20de3">_stack_method</a></ul>
-<h3><a class="anchor" name="index_m">- m -</a></h3><ul>
-<li>mag
-: <a class="el" href="structband__jacobian.html#a55c1f441e0583da81dc8e736a890beb">band_jacobian</a><li>magnitude
-: <a class="el" href="struct__fors__std__star.html#2d3e959920d6aecfb5c6ae7ade4e8242">_fors_std_star</a>, <a class="el" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">_fors_star</a><li>magnitude_corr
-: <a class="el" href="struct__fors__star.html#20a78115ec557bc3cf1e723619516eb6">_fors_star</a><li>max
-: <a class="el" href="struct__fors__pattern.html#bec8b3d42dee603bd4c07eed85d87665">_fors_pattern</a><li>max_offset
-: <a class="el" href="struct__identify__method.html#d938db4c3b29c4365da3b57bec477970">_identify_method</a><li>max_reject
-: <a class="el" href="struct__stack__method.html#dd4b2d1c1a6e255b16a122464c489ac3">_stack_method</a><li>max_search
-: <a class="el" href="struct__identify__method.html#6dc2396ebd18713f47a577e819f02583">_identify_method</a><li>mean
-: <a class="el" href="structfors__extract__sky__stats.html#b7ca852023d946aa752ef2d3f4f871b9">fors_extract_sky_stats</a><li>median
-: <a class="el" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">fors_extract_sky_stats</a><li>method_name
-: <a class="el" href="struct__stack__method.html#6f98f0a2b57c86e519dc8bdf9885ab7b">_stack_method</a><li>min
-: <a class="el" href="struct__fors__pattern.html#5a91baccbe20c7f8b25bddaa043a1773">_fors_pattern</a><li>min_reject
-: <a class="el" href="struct__stack__method.html#32a13b1823d0d86b5c26ff14f8be9eb0">_stack_method</a></ul>
-<h3><a class="anchor" name="index_n">- n -</a></h3><ul>
-<li>name
-: <a class="el" href="struct__fors__std__star.html#5507a5a98a7739b0c1f9c2a97eb75c42">_fors_std_star</a>, <a class="el" href="struct__FORS__PAF__.html#34a869607ecd20de7f2452c808b64de6">_FORS_PAF_</a>, <a class="el" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">_FORS_PAF_RECORD_</a>, <a class="el" href="structfors__filterlist.html#35bb80c76e8fa9b4526ba6a03fea5520">fors_filterlist</a><li>naxis
-: <a class="el" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">_fors_cpl_wcs_</a><li>ncat
-: <a class="el" href="struct__identify__method.html#ad3758417318402dd98eb910e55d35e8">_identify_method</a><li>nh
-: <a class="el" href="struct__FORS__PAF__.html#8bf1f1454a4b17f7672624a3b8c2bd2c">_FORS_PAF_</a><li>no
-: <a class="el" href="structfors__fit__ncoeff__paropts.html#6fec4d8800eab2df5c1ba89004dc39f1">fors_fit_ncoeff_paropts</a><li>nr
-: <a class="el" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">_FORS_PAF_</a><li>nsource
-: <a class="el" href="struct__identify__method.html#6a2f70f5e0e5a3f34bd0a2ee5d001b8e">_identify_method</a></ul>
-<h3><a class="anchor" name="index_o">- o -</a></h3><ul>
-<li>one
-: <a class="el" href="structfors__fit__ncoeff__paropts.html#7bd4d2efd9c7633b9e865404c93f1d90">fors_fit_ncoeff_paropts</a><li>orientation
-: <a class="el" href="struct__fors__star.html#25c48bcbeb48ed5d535e715866f06810">_fors_star</a></ul>
-<h3><a class="anchor" name="index_p">- p -</a></h3><ul>
-<li>perframe
-: <a class="el" href="structfors__fit__ncoeff__paropts.html#08db6598924e76f81aeb0fb4ecf6873d">fors_fit_ncoeff_paropts</a><li>pernight
-: <a class="el" href="structfors__fit__ncoeff__paropts.html#4e5247458b71d9717197e5a15240f029">fors_fit_ncoeff_paropts</a><li>pixel
-: <a class="el" href="struct__fors__std__star.html#839aff9010bc6a6e44b5b23df543aa35">_fors_std_star</a>, <a class="el" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">_fors_star</a><li>pixel_scale
-: <a class="el" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">_fors_setting</a><li>prescan_x
-: <a class="el" href="struct__fors__setting.html#73c8992df1265002a5ad94acbb1f36c9">_fors_setting</a><li>prescan_y
-: <a class="el" href="struct__fors__setting.html#21a646d60ba3e80ce7ced6c1af9ca03b">_fors_setting</a></ul>
-<h3><a class="anchor" name="index_r">- r -</a></h3><ul>
-<li>ra
-: <a class="el" href="struct__fors__std__star.html#691cac5c703384c5f731f37a264943fd">_fors_std_star</a><li>ratsq
-: <a class="el" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">_fors_pattern</a><li>read_clock
-: <a class="el" href="struct__fors__setting.html#aa40f494f6270154210834327570d1d9">_fors_setting</a><li>records
-: <a class="el" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">_FORS_PAF_</a><li>ref
-: <a class="el" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">_fors_pattern</a><li>rms
-: <a class="el" href="structfors__extract__sky__stats.html#69ed6753cee271b73c8b7e73a016fdeb">fors_extract_sky_stats</a><li>ron
-: <a class="el" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">_fors_setting</a></ul>
-<h3><a class="anchor" name="index_s">- s -</a></h3><ul>
-<li>search
-: <a class="el" href="struct__identify__method.html#8fc2dc70bc04cb6ff4404d394febc4b8">_identify_method</a><li>semi_major
-: <a class="el" href="struct__fors__star.html#b5357dc5aaf3b7b6edc89d700d563a2c">_fors_star</a><li>semi_minor
-: <a class="el" href="struct__fors__star.html#532b4911a7308d705f01ba1da7bc35a1">_fors_star</a><li>sex_config
-: <a class="el" href="struct__extract__method.html#e76dd739b557c30e57acc0b8f69440b0">_extract_method</a><li>sex_exe
-: <a class="el" href="struct__extract__method.html#96e7cec5f46b8c296ed4d2d20e884b4a">_extract_method</a><li>sex_mag
-: <a class="el" href="struct__extract__method.html#1fee7344ac0997d0b446d6339a7760ad">_extract_method</a><li>sex_magerr
-: <a class="el" href="struct__extract__method.html#9e966f3de33443a13329d9a4d602513e">_extract_method</a><li>sex_radius
-: <a class="el" href="struct__extract__method.html#b690a500e917441e8e043ec876bf40c8">_extract_method</a><li>size
-: <a class="el" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">list</a><li>star
-: <a class="el" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">entry</a><li>star_index
-: <a class="el" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">entry</a><li>stellarity_index
-: <a class="el" href="struct__fors__star.html#cd353ab887426dc767a89db51164271a">_fors_star</a><li>sval
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">_FORS_PAF_RECORD_</a></ul>
-<h3><a class="anchor" name="index_t">- t -</a></h3><ul>
-<li>theta
-: <a class="el" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">_fors_pattern</a><li>trusted
-: <a class="el" href="struct__fors__std__star.html#1d7de44e88c02bc012ef3d75a9e43eed">_fors_std_star</a><li>type
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#13b54564388819d2d248117bcb421ab3">_FORS_PAF_RECORD_</a></ul>
-<h3><a class="anchor" name="index_v">- v -</a></h3><ul>
-<li>variance
-: <a class="el" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">_fors_image</a><li>version
-: <a class="el" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">_fors_setting</a></ul>
-<h3><a class="anchor" name="index_w">- w -</a></h3><ul>
-<li>wcsptr
-: <a class="el" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">_fors_cpl_wcs_</a><li>weight
-: <a class="el" href="struct__fors__star.html#82910b82de5851e8f59e40b205b6f829">_fors_star</a></ul>
-<h3><a class="anchor" name="index_x">- x -</a></h3><ul>
-<li>x
-: <a class="el" href="struct__fors__point.html#001799342df066a6b324fa53862476cd">_fors_point</a></ul>
-<h3><a class="anchor" name="index_y">- y -</a></h3><ul>
-<li>y
-: <a class="el" href="struct__fors__point.html#0c7d2a164217d83715d8170573798fbc">_fors_point</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/functions_vars.html b/html/functions_vars.html
deleted file mode 100644
index 13f403f..0000000
--- a/html/functions_vars.html
+++ /dev/null
@@ -1,203 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: Data Fields - Variables</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="functions.html"><span>All</span></a></li>
-    <li id="current"><a href="functions_vars.html"><span>Variables</span></a></li>
-  </ul>
-</div>
-<div class="tabs">
-  <ul>
-    <li><a href="#index_a"><span>a</span></a></li>
-    <li><a href="#index_b"><span>b</span></a></li>
-    <li><a href="#index_c"><span>c</span></a></li>
-    <li><a href="#index_d"><span>d</span></a></li>
-    <li><a href="#index_e"><span>e</span></a></li>
-    <li><a href="#index_f"><span>f</span></a></li>
-    <li><a href="#index_g"><span>g</span></a></li>
-    <li><a href="#index_h"><span>h</span></a></li>
-    <li><a href="#index_i"><span>i</span></a></li>
-    <li><a href="#index_k"><span>k</span></a></li>
-    <li><a href="#index_m"><span>m</span></a></li>
-    <li><a href="#index_n"><span>n</span></a></li>
-    <li><a href="#index_o"><span>o</span></a></li>
-    <li><a href="#index_p"><span>p</span></a></li>
-    <li><a href="#index_r"><span>r</span></a></li>
-    <li><a href="#index_s"><span>s</span></a></li>
-    <li><a href="#index_t"><span>t</span></a></li>
-    <li><a href="#index_v"><span>v</span></a></li>
-    <li><a href="#index_w"><span>w</span></a></li>
-    <li><a href="#index_x"><span>x</span></a></li>
-    <li><a href="#index_y"><span>y</span></a></li>
-  </ul>
-</div>
-
-<p>
- 
-<p>
-<h3><a class="anchor" name="index_a">- a -</a></h3><ul>
-<li>airmass
-: <a class="el" href="structentry.html#6f585239f5d6905b0cff05055d77bf9c">entry</a><li>atm_ext_identifier
-: <a class="el" href="structentry.html#c85d7b45722824c52fdaa4754c8d64ee">entry</a><li>atm_ext_index
-: <a class="el" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">entry</a><li>average_gain
-: <a class="el" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">_fors_setting</a></ul>
-<h3><a class="anchor" name="index_b">- b -</a></h3><ul>
-<li>back
-: <a class="el" href="structlist.html#08398e899d83978b0fb79e448b685b32">list</a><li>band
-: <a class="el" href="structband__jacobian.html#b448380c1a9359906b9d6739074ee4b4">band_jacobian</a>, <a class="el" href="structfors__filterlist.html#98f2d94bcd86b7376568e913140371ac">fors_filterlist</a><li>binx
-: <a class="el" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">_fors_setting</a><li>biny
-: <a class="el" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">_fors_setting</a><li>bval
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#633c615d76af4c00b82b50bf75cb4b84">_FORS_PAF_RECORD_</a></ul>
-<h3><a class="anchor" name="index_c">- c -</a></h3><ul>
-<li>cat_magnitude
-: <a class="el" href="struct__fors__std__star.html#572834d8779cf03a23be21e86c58dd7f">_fors_std_star</a><li>chip_id
-: <a class="el" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">_fors_setting</a><li>col
-: <a class="el" href="structband__jacobian.html#81d02268a4a5d5366b43d30714ed4f7f">band_jacobian</a><li>color
-: <a class="el" href="struct__fors__std__star.html#a8620d2a99065a638abe790fd240f5d2">_fors_std_star</a><li>comment
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">_FORS_PAF_RECORD_</a><li>cov_catm_color
-: <a class="el" href="struct__fors__std__star.html#7f673b38b2ce3af3959eab9ccf97a356">_fors_std_star</a><li>current
-: <a class="el" href="structlist.html#87b04e0bab57e6949272df159ee19baf">list</a><li>current_p1
-: <a class="el" href="structlist.html#38d7fad1310a6005cefaa130cce4597a">list</a><li>current_p2
-: <a class="el" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">list</a></ul>
-<h3><a class="anchor" name="index_d">- d -</a></h3><ul>
-<li>data
-: <a class="el" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">_fors_image</a><li>dcat_magnitude
-: <a class="el" href="struct__fors__std__star.html#4d258c07f6a7bb5b17f4bd0c7faf75a8">_fors_std_star</a><li>dcolor
-: <a class="el" href="struct__fors__std__star.html#4dbabb1e3ade361a611e54f51aeb2781">_fors_std_star</a><li>dec
-: <a class="el" href="struct__fors__std__star.html#af20d4b52c06758c47ca0847f77ea03e">_fors_std_star</a><li>dims
-: <a class="el" href="struct__fors__cpl__wcs__.html#947b7dc1ce3651b19825dee6fe385666">_fors_cpl_wcs_</a><li>dmagnitude
-: <a class="el" href="struct__fors__std__star.html#0daa0413ccc6df832707e97c52cbe8f7">_fors_std_star</a>, <a class="el" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">_fors_star</a><li>dmagnitude_corr
-: <a class="el" href="struct__fors__star.html#ee281335ef4e49be1cfb5caf7f96d7c3">_fors_star</a><li>dratsq
-: <a class="el" href="struct__fors__pattern.html#b30a8282c5be5dcb81396a14232c6d97">_fors_pattern</a><li>dtheta
-: <a class="el" href="struct__fors__pattern.html#41f94fda5bd41b1e72ef9c679ac73c2b">_fors_pattern</a><li>dval
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#34d5c881a9bc312b95bc3d644d6fb522">_FORS_PAF_RECORD_</a></ul>
-<h3><a class="anchor" name="index_e">- e -</a></h3><ul>
-<li>elements
-: <a class="el" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">list</a><li>exposure_time
-: <a class="el" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">_fors_setting</a><li>exptime
-: <a class="el" href="structentry.html#3e422ef6bc06e1e9c3d2dad3ec2f972b">entry</a></ul>
-<h3><a class="anchor" name="index_f">- f -</a></h3><ul>
-<li>filter_name
-: <a class="el" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">_fors_setting</a><li>filterband
-: <a class="el" href="struct__fors__setting.html#1bc4ab059bf8d162814b5c2cb231142c">_fors_setting</a><li>frame_index
-: <a class="el" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">entry</a><li>fwhm
-: <a class="el" href="struct__fors__star.html#4bb929a1553cd3239fcf18112c699200">_fors_star</a></ul>
-<h3><a class="anchor" name="index_g">- g -</a></h3><ul>
-<li>gain
-: <a class="el" href="structentry.html#9094c40ac744faa1135a2773f85ba1ff">entry</a></ul>
-<h3><a class="anchor" name="index_h">- h -</a></h3><ul>
-<li>header
-: <a class="el" href="struct__FORS__PAF__.html#cdc2007f38750ed7ef260e8409d4eb1f">_FORS_PAF_</a></ul>
-<h3><a class="anchor" name="index_i">- i -</a></h3><ul>
-<li>id
-: <a class="el" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">_fors_star</a><li>instrument
-: <a class="el" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">_fors_setting</a><li>ival
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#880a737b5fffa6baaeaa97653bdb341e">_FORS_PAF_RECORD_</a></ul>
-<h3><a class="anchor" name="index_k">- k -</a></h3><ul>
-<li>kappa
-: <a class="el" href="struct__identify__method.html#1aae6e461fafcb0388b343e5d94adbe6">_identify_method</a><li>khigh
-: <a class="el" href="struct__stack__method.html#236ce050034e112bb1d000de525a7895">_stack_method</a><li>kiter
-: <a class="el" href="struct__stack__method.html#b98c63a3bb7288969c818ee3653a482b">_stack_method</a><li>klow
-: <a class="el" href="struct__stack__method.html#41f6ab3a4ca6f07365f32d63bbe20de3">_stack_method</a></ul>
-<h3><a class="anchor" name="index_m">- m -</a></h3><ul>
-<li>mag
-: <a class="el" href="structband__jacobian.html#a55c1f441e0583da81dc8e736a890beb">band_jacobian</a><li>magnitude
-: <a class="el" href="struct__fors__std__star.html#2d3e959920d6aecfb5c6ae7ade4e8242">_fors_std_star</a>, <a class="el" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">_fors_star</a><li>magnitude_corr
-: <a class="el" href="struct__fors__star.html#20a78115ec557bc3cf1e723619516eb6">_fors_star</a><li>max
-: <a class="el" href="struct__fors__pattern.html#bec8b3d42dee603bd4c07eed85d87665">_fors_pattern</a><li>max_offset
-: <a class="el" href="struct__identify__method.html#d938db4c3b29c4365da3b57bec477970">_identify_method</a><li>max_reject
-: <a class="el" href="struct__stack__method.html#dd4b2d1c1a6e255b16a122464c489ac3">_stack_method</a><li>max_search
-: <a class="el" href="struct__identify__method.html#6dc2396ebd18713f47a577e819f02583">_identify_method</a><li>mean
-: <a class="el" href="structfors__extract__sky__stats.html#b7ca852023d946aa752ef2d3f4f871b9">fors_extract_sky_stats</a><li>median
-: <a class="el" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">fors_extract_sky_stats</a><li>method_name
-: <a class="el" href="struct__stack__method.html#6f98f0a2b57c86e519dc8bdf9885ab7b">_stack_method</a><li>min
-: <a class="el" href="struct__fors__pattern.html#5a91baccbe20c7f8b25bddaa043a1773">_fors_pattern</a><li>min_reject
-: <a class="el" href="struct__stack__method.html#32a13b1823d0d86b5c26ff14f8be9eb0">_stack_method</a></ul>
-<h3><a class="anchor" name="index_n">- n -</a></h3><ul>
-<li>name
-: <a class="el" href="struct__fors__std__star.html#5507a5a98a7739b0c1f9c2a97eb75c42">_fors_std_star</a>, <a class="el" href="struct__FORS__PAF__.html#34a869607ecd20de7f2452c808b64de6">_FORS_PAF_</a>, <a class="el" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">_FORS_PAF_RECORD_</a>, <a class="el" href="structfors__filterlist.html#35bb80c76e8fa9b4526ba6a03fea5520">fors_filterlist</a><li>naxis
-: <a class="el" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">_fors_cpl_wcs_</a><li>ncat
-: <a class="el" href="struct__identify__method.html#ad3758417318402dd98eb910e55d35e8">_identify_method</a><li>nh
-: <a class="el" href="struct__FORS__PAF__.html#8bf1f1454a4b17f7672624a3b8c2bd2c">_FORS_PAF_</a><li>no
-: <a class="el" href="structfors__fit__ncoeff__paropts.html#6fec4d8800eab2df5c1ba89004dc39f1">fors_fit_ncoeff_paropts</a><li>nr
-: <a class="el" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">_FORS_PAF_</a><li>nsource
-: <a class="el" href="struct__identify__method.html#6a2f70f5e0e5a3f34bd0a2ee5d001b8e">_identify_method</a></ul>
-<h3><a class="anchor" name="index_o">- o -</a></h3><ul>
-<li>one
-: <a class="el" href="structfors__fit__ncoeff__paropts.html#7bd4d2efd9c7633b9e865404c93f1d90">fors_fit_ncoeff_paropts</a><li>orientation
-: <a class="el" href="struct__fors__star.html#25c48bcbeb48ed5d535e715866f06810">_fors_star</a></ul>
-<h3><a class="anchor" name="index_p">- p -</a></h3><ul>
-<li>perframe
-: <a class="el" href="structfors__fit__ncoeff__paropts.html#08db6598924e76f81aeb0fb4ecf6873d">fors_fit_ncoeff_paropts</a><li>pernight
-: <a class="el" href="structfors__fit__ncoeff__paropts.html#4e5247458b71d9717197e5a15240f029">fors_fit_ncoeff_paropts</a><li>pixel
-: <a class="el" href="struct__fors__std__star.html#839aff9010bc6a6e44b5b23df543aa35">_fors_std_star</a>, <a class="el" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">_fors_star</a><li>pixel_scale
-: <a class="el" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">_fors_setting</a><li>prescan_x
-: <a class="el" href="struct__fors__setting.html#73c8992df1265002a5ad94acbb1f36c9">_fors_setting</a><li>prescan_y
-: <a class="el" href="struct__fors__setting.html#21a646d60ba3e80ce7ced6c1af9ca03b">_fors_setting</a></ul>
-<h3><a class="anchor" name="index_r">- r -</a></h3><ul>
-<li>ra
-: <a class="el" href="struct__fors__std__star.html#691cac5c703384c5f731f37a264943fd">_fors_std_star</a><li>ratsq
-: <a class="el" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">_fors_pattern</a><li>read_clock
-: <a class="el" href="struct__fors__setting.html#aa40f494f6270154210834327570d1d9">_fors_setting</a><li>records
-: <a class="el" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">_FORS_PAF_</a><li>ref
-: <a class="el" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">_fors_pattern</a><li>rms
-: <a class="el" href="structfors__extract__sky__stats.html#69ed6753cee271b73c8b7e73a016fdeb">fors_extract_sky_stats</a><li>ron
-: <a class="el" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">_fors_setting</a></ul>
-<h3><a class="anchor" name="index_s">- s -</a></h3><ul>
-<li>search
-: <a class="el" href="struct__identify__method.html#8fc2dc70bc04cb6ff4404d394febc4b8">_identify_method</a><li>semi_major
-: <a class="el" href="struct__fors__star.html#b5357dc5aaf3b7b6edc89d700d563a2c">_fors_star</a><li>semi_minor
-: <a class="el" href="struct__fors__star.html#532b4911a7308d705f01ba1da7bc35a1">_fors_star</a><li>sex_config
-: <a class="el" href="struct__extract__method.html#e76dd739b557c30e57acc0b8f69440b0">_extract_method</a><li>sex_exe
-: <a class="el" href="struct__extract__method.html#96e7cec5f46b8c296ed4d2d20e884b4a">_extract_method</a><li>sex_mag
-: <a class="el" href="struct__extract__method.html#1fee7344ac0997d0b446d6339a7760ad">_extract_method</a><li>sex_magerr
-: <a class="el" href="struct__extract__method.html#9e966f3de33443a13329d9a4d602513e">_extract_method</a><li>sex_radius
-: <a class="el" href="struct__extract__method.html#b690a500e917441e8e043ec876bf40c8">_extract_method</a><li>size
-: <a class="el" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">list</a><li>star
-: <a class="el" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">entry</a><li>star_index
-: <a class="el" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">entry</a><li>stellarity_index
-: <a class="el" href="struct__fors__star.html#cd353ab887426dc767a89db51164271a">_fors_star</a><li>sval
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">_FORS_PAF_RECORD_</a></ul>
-<h3><a class="anchor" name="index_t">- t -</a></h3><ul>
-<li>theta
-: <a class="el" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">_fors_pattern</a><li>trusted
-: <a class="el" href="struct__fors__std__star.html#1d7de44e88c02bc012ef3d75a9e43eed">_fors_std_star</a><li>type
-: <a class="el" href="struct__FORS__PAF__RECORD__.html#13b54564388819d2d248117bcb421ab3">_FORS_PAF_RECORD_</a></ul>
-<h3><a class="anchor" name="index_v">- v -</a></h3><ul>
-<li>variance
-: <a class="el" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">_fors_image</a><li>version
-: <a class="el" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">_fors_setting</a></ul>
-<h3><a class="anchor" name="index_w">- w -</a></h3><ul>
-<li>wcsptr
-: <a class="el" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">_fors_cpl_wcs_</a><li>weight
-: <a class="el" href="struct__fors__star.html#82910b82de5851e8f59e40b205b6f829">_fors_star</a></ul>
-<h3><a class="anchor" name="index_x">- x -</a></h3><ul>
-<li>x
-: <a class="el" href="struct__fors__point.html#001799342df066a6b324fa53862476cd">_fors_point</a></ul>
-<h3><a class="anchor" name="index_y">- y -</a></h3><ul>
-<li>y
-: <a class="el" href="struct__fors__point.html#0c7d2a164217d83715d8170573798fbc">_fors_point</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/group__forsPaf.html b/html/group__forsPaf.html
index dc27eb8..22c5047 100644
--- a/html/group__forsPaf.html
+++ b/html/group__forsPaf.html
@@ -1,547 +1,564 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: PAF File Utilities</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>PAF File Utilities</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__.html">_FORS_PAF_</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g641d95bede019f7a29f1db650d177c62"></a><!-- doxytag: member="forsPaf::TIME_ISO8601_LENGTH" ref="g641d95bede019f7a29f1db650d177c62" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g641d95bede019f7a29f1db650d177c62">TIME_ISO8601_LENGTH</a>   (20)</td></tr>
-
-<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g0f58f2a4dac229d1a1297ade936bf3f8"></a><!-- doxytag: member="forsPaf::ForsPAFRecord" ref="g0f58f2a4dac229d1a1297ade936bf3f8" args="" -->
-typedef <a class="el" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g0f58f2a4dac229d1a1297ade936bf3f8">ForsPAFRecord</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g77e6970f0c1394755e48983ec30964b8"></a><!-- doxytag: member="forsPaf::getTimeISO8601" ref="g77e6970f0c1394755e48983ec30964b8" args="(void)" -->
-static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g77e6970f0c1394755e48983ec30964b8">getTimeISO8601</a> (void)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2c1e284f8aed1d0ba1742c8bded4bf4a"></a><!-- doxytag: member="forsPaf::_forsPAFValueSize" ref="g2c1e284f8aed1d0ba1742c8bded4bf4a" args="(ForsPAFType type, const void *value)" -->
-static size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g2c1e284f8aed1d0ba1742c8bded4bf4a">_forsPAFValueSize</a> (ForsPAFType type, const void *value)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gfb1c398d9c412268e4845b2c584b1aed"></a><!-- doxytag: member="forsPaf::_forsPAFRecordDestroy" ref="gfb1c398d9c412268e4845b2c584b1aed" args="(ForsPAFRecord *record)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gfb1c398d9c412268e4845b2c584b1aed">_forsPAFRecordDestroy</a> (<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g46037bb92868be7c73210555065f5241"></a><!-- doxytag: member="forsPaf::_forsPAFRecordCreate" ref="g46037bb92868be7c73210555065f5241" args="(const char *name, ForsPAFType type, const void *value, const char *comment)" -->
-static <a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g46037bb92868be7c73210555065f5241">_forsPAFRecordCreate</a> (const char *name, ForsPAFType type, const void *value, const char *comment)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g096710d0ef5d21acd2338ed418c6da7e"></a><!-- doxytag: member="forsPaf::_forsPAFRecordSet" ref="g096710d0ef5d21acd2338ed418c6da7e" args="(ForsPAFRecord *record, const char *name, ForsPAFType type, const void *value, const char *comment)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g096710d0ef5d21acd2338ed418c6da7e">_forsPAFRecordSet</a> (<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record, const char *name, ForsPAFType type, const void *value, const char *comment)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9d2a88b614538fe5c97aac1d32e7905a"></a><!-- doxytag: member="forsPaf::_forsPAFAppend" ref="g9d2a88b614538fe5c97aac1d32e7905a" args="(ForsPAFRecord ***list, int *pos, const char *name, ForsPAFType type, const void *value, const char *comment)" -->
-static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g9d2a88b614538fe5c97aac1d32e7905a">_forsPAFAppend</a> (<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> ***<a class="el" href="structlist.html">list</a>, int *pos, const char *name, ForsPAFType type, const void *value, const char *comment)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g603cc78fa373dc03085f39b09c8f3ff3"></a><!-- doxytag: member="forsPaf::_forsPAFHeaderCreate" ref="g603cc78fa373dc03085f39b09c8f3ff3" args="(const char *name, const char *type, const char *id, const char *desc, int *pos)" -->
-static <a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g603cc78fa373dc03085f39b09c8f3ff3">_forsPAFHeaderCreate</a> (const char *name, const char *type, const char *id, const char *desc, int *pos)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gee350e22bb8d324a29d3aae6033b670f"></a><!-- doxytag: member="forsPaf::_forsPAFFormatRecord" ref="gee350e22bb8d324a29d3aae6033b670f" args="(ForsPAFRecord *record)" -->
-static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gee350e22bb8d324a29d3aae6033b670f">_forsPAFFormatRecord</a> (<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gefe94695ad068025eff46fe69998e75d">deleteForsPAF</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy a PAF object.  <a href="#gefe94695ad068025eff46fe69998e75d"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gb2e886163098d674eb07e95d96b38229">newForsPAF</a> (const char *name, const char *type, const char *id, const char *desc)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new PAF object.  <a href="#gb2e886163098d674eb07e95d96b38229"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#ge80d2196e3845f5857f374416333edbc">forsPAFIsEmpty</a> (const <a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Check whether a PAF object is empty.  <a href="#ge80d2196e3845f5857f374416333edbc"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gb39490ffdb9ac9b2e666d75da2436b65">forsPAFGetSize</a> (const <a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the actual size of the given PAF object.  <a href="#gb39490ffdb9ac9b2e666d75da2436b65"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917">forsPAFIsValidName</a> (const char *name)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Verify that the given string is a valid PAF keyword.  <a href="#g1f2dc4168ff0251fc4f270602a157917"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g15b886f9811c703203b77a91e3bd0e91">forsPAFAppendBool</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, const char *name, int value, const char *comment)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Append a boolean value to a PAF object.  <a href="#g15b886f9811c703203b77a91e3bd0e91"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gde7f65f7ca0d7e3e24babefd2c8d8716">forsPAFAppendInt</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, const char *name, int value, const char *comment)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Append a integer value to a PAF object.  <a href="#gde7f65f7ca0d7e3e24babefd2c8d8716"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gdd6ed0c50b7cf4c62fdbabd0794487e4">forsPAFAppendDouble</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, const char *name, double value, const char *comment)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Append a double value to a PAF object.  <a href="#gdd6ed0c50b7cf4c62fdbabd0794487e4"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gf615f1fbc45dd108391de129e67d58b2">forsPAFAppendString</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, const char *name, const char *value, const char *comment)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Append a string value to a PAF object.  <a href="#gf615f1fbc45dd108391de129e67d58b2"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#g2cceff721bbbd99c1a4bddfb57ed688b">forsPAFWrite</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Write a PAF object to a disk file.  <a href="#g2cceff721bbbd99c1a4bddfb57ed688b"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-TBD <hr><h2>Function Documentation</h2>
-<a class="anchor" name="gefe94695ad068025eff46fe69998e75d"></a><!-- doxytag: member="fors_paf.c::deleteForsPAF" ref="gefe94695ad068025eff46fe69998e75d" args="(ForsPAF *paf)" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Data Structures</a> |
+<a href="#define-members">Macros</a> |
+<a href="#typedef-members">Typedefs</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">PAF File Utilities</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__.html">_FORS_PAF_</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga88f813e34826e731a89a053184474530"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga88f813e34826e731a89a053184474530"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>TIME_ISO8601_LENGTH</b>   (20)</td></tr>
+<tr class="separator:ga88f813e34826e731a89a053184474530"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
+Typedefs</h2></td></tr>
+<tr class="memitem:gae363226233d0cc3c7011274266c562e8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae363226233d0cc3c7011274266c562e8"></a>
+typedef struct <a class="el" href="struct__FORS__PAF__RECORD__.html">_FORS_PAF_RECORD_</a> </td><td class="memItemRight" valign="bottom"><b>ForsPAFRecord</b></td></tr>
+<tr class="separator:gae363226233d0cc3c7011274266c562e8"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga216b2fd87c070e1871f73d29eed94531"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga216b2fd87c070e1871f73d29eed94531"></a>
+static char * </td><td class="memItemRight" valign="bottom"><b>getTimeISO8601</b> (void)</td></tr>
+<tr class="separator:ga216b2fd87c070e1871f73d29eed94531"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga12c533561960f76a20b651673f9d38fd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga12c533561960f76a20b651673f9d38fd"></a>
+static size_t </td><td class="memItemRight" valign="bottom"><b>_forsPAFValueSize</b> (ForsPAFType type, const void *value)</td></tr>
+<tr class="separator:ga12c533561960f76a20b651673f9d38fd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8f34528da23f3d240c68aab76539edca"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8f34528da23f3d240c68aab76539edca"></a>
+static void </td><td class="memItemRight" valign="bottom"><b>_forsPAFRecordDestroy</b> (<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record)</td></tr>
+<tr class="separator:ga8f34528da23f3d240c68aab76539edca"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0f4b8a1dafd89e1978b36032c6a5d48a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0f4b8a1dafd89e1978b36032c6a5d48a"></a>
+static <a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> * </td><td class="memItemRight" valign="bottom"><b>_forsPAFRecordCreate</b> (const char *name, ForsPAFType type, const void *value, const char *comment)</td></tr>
+<tr class="separator:ga0f4b8a1dafd89e1978b36032c6a5d48a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5a2311da25c79df625c7bd8af91853e3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5a2311da25c79df625c7bd8af91853e3"></a>
+static void </td><td class="memItemRight" valign="bottom"><b>_forsPAFRecordSet</b> (<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record, const char *name, ForsPAFType type, const void *value, const char *comment)</td></tr>
+<tr class="separator:ga5a2311da25c79df625c7bd8af91853e3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga801baaad201f88a079f39961001b2272"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga801baaad201f88a079f39961001b2272"></a>
+static int </td><td class="memItemRight" valign="bottom"><b>_forsPAFAppend</b> (<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> ***<a class="el" href="structlist.html">list</a>, int *pos, const char *name, ForsPAFType type, const void *value, const char *comment)</td></tr>
+<tr class="separator:ga801baaad201f88a079f39961001b2272"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gafec1afad71f75b57db50075e5129d01a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafec1afad71f75b57db50075e5129d01a"></a>
+static <a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> ** </td><td class="memItemRight" valign="bottom"><b>_forsPAFHeaderCreate</b> (const char *name, const char *type, const char *id, const char *desc, int *pos)</td></tr>
+<tr class="separator:gafec1afad71f75b57db50075e5129d01a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga31aa555372302db5a189cfc8ddf77925"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga31aa555372302db5a189cfc8ddf77925"></a>
+static const char * </td><td class="memItemRight" valign="bottom"><b>_forsPAFFormatRecord</b> (<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> *record)</td></tr>
+<tr class="separator:ga31aa555372302db5a189cfc8ddf77925"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5d62f23bc1a07c4136aecccfcea2459d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#ga5d62f23bc1a07c4136aecccfcea2459d">deleteForsPAF</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</td></tr>
+<tr class="memdesc:ga5d62f23bc1a07c4136aecccfcea2459d"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a PAF object.  <a href="#ga5d62f23bc1a07c4136aecccfcea2459d">More...</a><br/></td></tr>
+<tr class="separator:ga5d62f23bc1a07c4136aecccfcea2459d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7aef24280b6605d6dfbb063bab8da2f4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#ga7aef24280b6605d6dfbb063bab8da2f4">newForsPAF</a> (const char *name, const char *type, const char *id, const char *desc)</td></tr>
+<tr class="memdesc:ga7aef24280b6605d6dfbb063bab8da2f4"><td class="mdescLeft"> </td><td class="mdescRight">Create a new PAF object.  <a href="#ga7aef24280b6605d6dfbb063bab8da2f4">More...</a><br/></td></tr>
+<tr class="separator:ga7aef24280b6605d6dfbb063bab8da2f4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga84dbb309c51aee01813cc9b90dde96cb"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#ga84dbb309c51aee01813cc9b90dde96cb">forsPAFIsEmpty</a> (const <a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</td></tr>
+<tr class="memdesc:ga84dbb309c51aee01813cc9b90dde96cb"><td class="mdescLeft"> </td><td class="mdescRight">Check whether a PAF object is empty.  <a href="#ga84dbb309c51aee01813cc9b90dde96cb">More...</a><br/></td></tr>
+<tr class="separator:ga84dbb309c51aee01813cc9b90dde96cb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga38a21baf09dfb452f820eb2aded1a6c0"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#ga38a21baf09dfb452f820eb2aded1a6c0">forsPAFGetSize</a> (const <a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</td></tr>
+<tr class="memdesc:ga38a21baf09dfb452f820eb2aded1a6c0"><td class="mdescLeft"> </td><td class="mdescRight">Get the actual size of the given PAF object.  <a href="#ga38a21baf09dfb452f820eb2aded1a6c0">More...</a><br/></td></tr>
+<tr class="separator:ga38a21baf09dfb452f820eb2aded1a6c0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1b521862ddce4498cc3a7b473c12ab37"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37">forsPAFIsValidName</a> (const char *name)</td></tr>
+<tr class="memdesc:ga1b521862ddce4498cc3a7b473c12ab37"><td class="mdescLeft"> </td><td class="mdescRight">Verify that the given string is a valid PAF keyword.  <a href="#ga1b521862ddce4498cc3a7b473c12ab37">More...</a><br/></td></tr>
+<tr class="separator:ga1b521862ddce4498cc3a7b473c12ab37"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaac413514350c777efbd5ed0e1cc26778"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gaac413514350c777efbd5ed0e1cc26778">forsPAFAppendBool</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, const char *name, int value, const char *comment)</td></tr>
+<tr class="memdesc:gaac413514350c777efbd5ed0e1cc26778"><td class="mdescLeft"> </td><td class="mdescRight">Append a boolean value to a PAF object.  <a href="#gaac413514350c777efbd5ed0e1cc26778">More...</a><br/></td></tr>
+<tr class="separator:gaac413514350c777efbd5ed0e1cc26778"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae15f3d1ee9b849039f26cd82d3568913"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gae15f3d1ee9b849039f26cd82d3568913">forsPAFAppendInt</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, const char *name, int value, const char *comment)</td></tr>
+<tr class="memdesc:gae15f3d1ee9b849039f26cd82d3568913"><td class="mdescLeft"> </td><td class="mdescRight">Append a integer value to a PAF object.  <a href="#gae15f3d1ee9b849039f26cd82d3568913">More...</a><br/></td></tr>
+<tr class="separator:gae15f3d1ee9b849039f26cd82d3568913"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga83aca84f4fb88e3db7a233b442cd644a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#ga83aca84f4fb88e3db7a233b442cd644a">forsPAFAppendDouble</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, const char *name, double value, const char *comment)</td></tr>
+<tr class="memdesc:ga83aca84f4fb88e3db7a233b442cd644a"><td class="mdescLeft"> </td><td class="mdescRight">Append a double value to a PAF object.  <a href="#ga83aca84f4fb88e3db7a233b442cd644a">More...</a><br/></td></tr>
+<tr class="separator:ga83aca84f4fb88e3db7a233b442cd644a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad23a2cd11683bd001f954383a282b9c3"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#gad23a2cd11683bd001f954383a282b9c3">forsPAFAppendString</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf, const char *name, const char *value, const char *comment)</td></tr>
+<tr class="memdesc:gad23a2cd11683bd001f954383a282b9c3"><td class="mdescLeft"> </td><td class="mdescRight">Append a string value to a PAF object.  <a href="#gad23a2cd11683bd001f954383a282b9c3">More...</a><br/></td></tr>
+<tr class="separator:gad23a2cd11683bd001f954383a282b9c3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3e16371f03930ae272a5454ad6100f83"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsPaf.html#ga3e16371f03930ae272a5454ad6100f83">forsPAFWrite</a> (<a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> *paf)</td></tr>
+<tr class="memdesc:ga3e16371f03930ae272a5454ad6100f83"><td class="mdescLeft"> </td><td class="mdescRight">Write a PAF object to a disk file.  <a href="#ga3e16371f03930ae272a5454ad6100f83">More...</a><br/></td></tr>
+<tr class="separator:ga3e16371f03930ae272a5454ad6100f83"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>TBD </p>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga5d62f23bc1a07c4136aecccfcea2459d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void deleteForsPAF           </td>
+          <td class="memname">void deleteForsPAF </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
-          <td class="paramname"> <em>paf</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
+          <td class="paramname"><em>paf</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Destroy a PAF object. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>paf</em> </td><td>PAF object to destroy.</td></tr>
+</div><div class="memdoc">
+
+<p>Destroy a PAF object. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">paf</td><td>PAF object to destroy.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Nothing.</dd></dl>
-The function deallocates all memory used for the PAF object <em>paf</em>. 
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00509">509</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00182">_forsPAFRecordDestroy()</a>, <a class="el" href="fors__paf_8c-source.html#l00109">_FORS_PAF_::header</a>, <a class="el" href="fors__paf_8c-source.html#l00106">_FORS_PAF_::name</a>, <a class="el" href="fors__paf_8c-source.html#l00107">_FORS_PAF_::nh</a>, <a class="el" href="fors__paf_8c-source.html#l00108">_FORS_PAF_::nr</a>, and <a class="el" href="fors__paf_8c-source.html#l00110">_FORS_PAF_::records</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00200">fors_qc_end_group()</a>.
+<dl class="section return"><dt>Returns</dt><dd>Nothing.</dd></dl>
+<p>The function deallocates all memory used for the PAF object <em>paf</em>. </p>
+
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00511">511</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__qc_8c_source.html#l00200">fors_qc_end_group()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gb2e886163098d674eb07e95d96b38229"></a><!-- doxytag: member="fors_paf.c::newForsPAF" ref="gb2e886163098d674eb07e95d96b38229" args="(const char *name, const char *type, const char *id, const char *desc)" -->
+<a class="anchor" id="ga7aef24280b6605d6dfbb063bab8da2f4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a>* newForsPAF           </td>
+          <td class="memname"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a>* newForsPAF </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>type</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>type</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>id</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>id</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>desc</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>desc</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create a new PAF object. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Parameter file name. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>Parameter file type. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>Parameter file identifier string. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>desc</em> </td><td>Short description for the parameter file.</td></tr>
+</div><div class="memdoc">
+
+<p>Create a new PAF object. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">name</td><td>Parameter file name. </td></tr>
+    <tr><td class="paramname">type</td><td>Parameter file type. </td></tr>
+    <tr><td class="paramname">id</td><td>Parameter file identifier string. </td></tr>
+    <tr><td class="paramname">desc</td><td>Short description for the parameter file.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The handle for the newly created PAF object.</dd></dl>
-The function allocates the memory for a PAF object and initializes the PAF object with the strings <em>name</em>, <em>type</em>, <em>id</em> and <em>desc</em> passed to the function, where <em>id</em> and <em>desc</em> may be omitted, i.e. <code>NULL</code> maybe passed for <em>id</em> and/or <em>desc</em>. The argument <em>name</em> will be used as the file name in case the PAF object is written to a disk file. 
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00548">548</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00307">_forsPAFHeaderCreate()</a>, <a class="el" href="fors__paf_8c-source.html#l00109">_FORS_PAF_::header</a>, <a class="el" href="fors__paf_8c-source.html#l00106">_FORS_PAF_::name</a>, <a class="el" href="fors__paf_8c-source.html#l00107">_FORS_PAF_::nh</a>, <a class="el" href="fors__paf_8c-source.html#l00108">_FORS_PAF_::nr</a>, and <a class="el" href="fors__paf_8c-source.html#l00110">_FORS_PAF_::records</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00077">fors_qc_start_group()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The handle for the newly created PAF object.</dd></dl>
+<p>The function allocates the memory for a PAF object and initializes the PAF object with the strings <em>name</em>, <em>type</em>, <em>id</em> and <em>desc</em> passed to the function, where <em>id</em> and <em>desc</em> may be omitted, i.e. <code>NULL</code> maybe passed for <em>id</em> and/or <em>desc</em>. The argument <em>name</em> will be used as the file name in case the PAF object is written to a disk file. </p>
+
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00550">550</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__qc_8c_source.html#l00077">fors_qc_start_group()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ge80d2196e3845f5857f374416333edbc"></a><!-- doxytag: member="fors_paf.c::forsPAFIsEmpty" ref="ge80d2196e3845f5857f374416333edbc" args="(const ForsPAF *paf)" -->
+<a class="anchor" id="ga84dbb309c51aee01813cc9b90dde96cb"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int forsPAFIsEmpty           </td>
+          <td class="memname">int forsPAFIsEmpty </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
-          <td class="paramname"> <em>paf</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
+          <td class="paramname"><em>paf</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Check whether a PAF object is empty. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>paf</em> </td><td>PAF object to query.</td></tr>
+</div><div class="memdoc">
+
+<p>Check whether a PAF object is empty. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">paf</td><td>PAF object to query.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The function returns 1 if <em>paf</em> is empty, otherwise the return value is 0.</dd></dl>
-The function checks whether the record list of the PAF object <em>paf</em> contains any records. 
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00587">587</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00108">_FORS_PAF_::nr</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00200">fors_qc_end_group()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The function returns 1 if <em>paf</em> is empty, otherwise the return value is 0.</dd></dl>
+<p>The function checks whether the record list of the PAF object <em>paf</em> contains any records. </p>
+
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00594">594</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__qc_8c_source.html#l00200">fors_qc_end_group()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gb39490ffdb9ac9b2e666d75da2436b65"></a><!-- doxytag: member="fors_paf.c::forsPAFGetSize" ref="gb39490ffdb9ac9b2e666d75da2436b65" args="(const ForsPAF *paf)" -->
+<a class="anchor" id="ga38a21baf09dfb452f820eb2aded1a6c0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">size_t forsPAFGetSize           </td>
+          <td class="memname">size_t forsPAFGetSize </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
-          <td class="paramname"> <em>paf</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
+          <td class="paramname"><em>paf</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get the actual size of the given PAF object. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>paf</em> </td><td>PAF object to query.</td></tr>
+</div><div class="memdoc">
+
+<p>Get the actual size of the given PAF object. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">paf</td><td>PAF object to query.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The number of PAF records currently stored in the record list, or 0 if the PAF object is empty.</dd></dl>
-The function computes the actual size, i.e. the number of parmeter records, stored in the record list of the PAF object <em>paf</em>. Header entries do not contribute the size of a PAF object. 
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00611">611</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00108">_FORS_PAF_::nr</a>.
+<dl class="section return"><dt>Returns</dt><dd>The number of PAF records currently stored in the record list, or 0 if the PAF object is empty.</dd></dl>
+<p>The function computes the actual size, i.e. the number of parmeter records, stored in the record list of the PAF object <em>paf</em>. Header entries do not contribute the size of a PAF object. </p>
+
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00618">618</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g1f2dc4168ff0251fc4f270602a157917"></a><!-- doxytag: member="fors_paf.c::forsPAFIsValidName" ref="g1f2dc4168ff0251fc4f270602a157917" args="(const char *name)" -->
+<a class="anchor" id="ga1b521862ddce4498cc3a7b473c12ab37"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int forsPAFIsValidName           </td>
+          <td class="memname">int forsPAFIsValidName </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Verify that the given string is a valid PAF keyword. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Name string to verify.</td></tr>
+</div><div class="memdoc">
+
+<p>Verify that the given string is a valid PAF keyword. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">name</td><td>Name string to verify.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The function returns 1 if the given name is valid, if not 0 is returned.</dd></dl>
-The function does a simple check on the given string. To be a valid PAF keyword the name should start with a letter, it should only contain upper case letters and it may not contain blanks. 
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00635">635</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.
-<p>
-Referenced by <a class="el" href="fors__paf_8c-source.html#l00688">forsPAFAppendBool()</a>, <a class="el" href="fors__paf_8c-source.html#l00757">forsPAFAppendDouble()</a>, <a class="el" href="fors__paf_8c-source.html#l00722">forsPAFAppendInt()</a>, and <a class="el" href="fors__paf_8c-source.html#l00793">forsPAFAppendString()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The function returns 1 if the given name is valid, if not 0 is returned.</dd></dl>
+<p>The function does a simple check on the given string. To be a valid PAF keyword the name should start with a letter, it should only contain upper case letters and it may not contain blanks. </p>
+
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00642">642</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__paf_8c_source.html#l00695">forsPAFAppendBool()</a>, <a class="el" href="fors__paf_8c_source.html#l00764">forsPAFAppendDouble()</a>, <a class="el" href="fors__paf_8c_source.html#l00729">forsPAFAppendInt()</a>, and <a class="el" href="fors__paf_8c_source.html#l00800">forsPAFAppendString()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g15b886f9811c703203b77a91e3bd0e91"></a><!-- doxytag: member="fors_paf.c::forsPAFAppendBool" ref="g15b886f9811c703203b77a91e3bd0e91" args="(ForsPAF *paf, const char *name, int value, const char *comment)" -->
+<a class="anchor" id="gaac413514350c777efbd5ed0e1cc26778"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int forsPAFAppendBool           </td>
+          <td class="memname">int forsPAFAppendBool </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
-          <td class="paramname"> <em>paf</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
+          <td class="paramname"><em>paf</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Append a boolean value to a PAF object. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>paf</em> </td><td>PAF object to which the record is appended. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Parameter name. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Parameter value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Parameter description.</td></tr>
+</div><div class="memdoc">
+
+<p>Append a boolean value to a PAF object. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">paf</td><td>PAF object to which the record is appended. </td></tr>
+    <tr><td class="paramname">name</td><td>Parameter name. </td></tr>
+    <tr><td class="paramname">value</td><td>Parameter value. </td></tr>
+    <tr><td class="paramname">comment</td><td>Parameter description.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The function returns <code>EXIT_SUCCESS</code> if the record was successfully appended, or <code>EXIT_FAILURE</code> otherwise.</dd></dl>
-The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object <em>paf</em>. 
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00688">688</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00276">_forsPAFAppend()</a>, <a class="el" href="fors__paf_8c-source.html#l00635">forsPAFIsValidName()</a>, <a class="el" href="fors__paf_8c-source.html#l00108">_FORS_PAF_::nr</a>, and <a class="el" href="fors__paf_8c-source.html#l00110">_FORS_PAF_::records</a>.
+<dl class="section return"><dt>Returns</dt><dd>The function returns <code>EXIT_SUCCESS</code> if the record was successfully appended, or <code>EXIT_FAILURE</code> otherwise.</dd></dl>
+<p>The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object <em>paf</em>. </p>
+
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00695">695</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+
+<p>References <a class="el" href="fors__paf_8c_source.html#l00642">forsPAFIsValidName()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gde7f65f7ca0d7e3e24babefd2c8d8716"></a><!-- doxytag: member="fors_paf.c::forsPAFAppendInt" ref="gde7f65f7ca0d7e3e24babefd2c8d8716" args="(ForsPAF *paf, const char *name, int value, const char *comment)" -->
+<a class="anchor" id="gae15f3d1ee9b849039f26cd82d3568913"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int forsPAFAppendInt           </td>
+          <td class="memname">int forsPAFAppendInt </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
-          <td class="paramname"> <em>paf</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
+          <td class="paramname"><em>paf</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Append a integer value to a PAF object. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>paf</em> </td><td>PAF object to which the record is appended. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Parameter name. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Parameter value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Parameter description.</td></tr>
+</div><div class="memdoc">
+
+<p>Append a integer value to a PAF object. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">paf</td><td>PAF object to which the record is appended. </td></tr>
+    <tr><td class="paramname">name</td><td>Parameter name. </td></tr>
+    <tr><td class="paramname">value</td><td>Parameter value. </td></tr>
+    <tr><td class="paramname">comment</td><td>Parameter description.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The function returns <code>EXIT_SUCCESS</code> if the record was successfully appended, or <code>EXIT_FAILURE</code> otherwise.</dd></dl>
-The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object <em>paf</em>. 
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00722">722</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00276">_forsPAFAppend()</a>, <a class="el" href="fors__paf_8c-source.html#l00635">forsPAFIsValidName()</a>, <a class="el" href="fors__paf_8c-source.html#l00108">_FORS_PAF_::nr</a>, and <a class="el" href="fors__paf_8c-source.html#l00110">_FORS_PAF_::records</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00362">fors_qc_write_int()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The function returns <code>EXIT_SUCCESS</code> if the record was successfully appended, or <code>EXIT_FAILURE</code> otherwise.</dd></dl>
+<p>The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object <em>paf</em>. </p>
+
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00729">729</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+
+<p>References <a class="el" href="fors__paf_8c_source.html#l00642">forsPAFIsValidName()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gdd6ed0c50b7cf4c62fdbabd0794487e4"></a><!-- doxytag: member="fors_paf.c::forsPAFAppendDouble" ref="gdd6ed0c50b7cf4c62fdbabd0794487e4" args="(ForsPAF *paf, const char *name, double value, const char *comment)" -->
+<a class="anchor" id="ga83aca84f4fb88e3db7a233b442cd644a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int forsPAFAppendDouble           </td>
+          <td class="memname">int forsPAFAppendDouble </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
-          <td class="paramname"> <em>paf</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
+          <td class="paramname"><em>paf</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Append a double value to a PAF object. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>paf</em> </td><td>PAF object to which the record is appended. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Parameter name. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Parameter value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Parameter description.</td></tr>
+</div><div class="memdoc">
+
+<p>Append a double value to a PAF object. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">paf</td><td>PAF object to which the record is appended. </td></tr>
+    <tr><td class="paramname">name</td><td>Parameter name. </td></tr>
+    <tr><td class="paramname">value</td><td>Parameter value. </td></tr>
+    <tr><td class="paramname">comment</td><td>Parameter description.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The function returns <code>EXIT_SUCCESS</code> if the record was successfully appended, or <code>EXIT_FAILURE</code> otherwise.</dd></dl>
-The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object <em>paf</em>. 
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00757">757</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00276">_forsPAFAppend()</a>, <a class="el" href="fors__paf_8c-source.html#l00635">forsPAFIsValidName()</a>, <a class="el" href="fors__paf_8c-source.html#l00108">_FORS_PAF_::nr</a>, and <a class="el" href="fors__paf_8c-source.html#l00110">_FORS_PAF_::records</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00321">fors_qc_write_double()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The function returns <code>EXIT_SUCCESS</code> if the record was successfully appended, or <code>EXIT_FAILURE</code> otherwise.</dd></dl>
+<p>The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object <em>paf</em>. </p>
+
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00764">764</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+
+<p>References <a class="el" href="fors__paf_8c_source.html#l00642">forsPAFIsValidName()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__qc_8c_source.html#l00321">fors_qc_write_double()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gf615f1fbc45dd108391de129e67d58b2"></a><!-- doxytag: member="fors_paf.c::forsPAFAppendString" ref="gf615f1fbc45dd108391de129e67d58b2" args="(ForsPAF *paf, const char *name, const char *value, const char *comment)" -->
+<a class="anchor" id="gad23a2cd11683bd001f954383a282b9c3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int forsPAFAppendString           </td>
+          <td class="memname">int forsPAFAppendString </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
-          <td class="paramname"> <em>paf</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
+          <td class="paramname"><em>paf</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Append a string value to a PAF object. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>paf</em> </td><td>PAF object to which the record is appended. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Parameter name. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Parameter value string. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Parameter description.</td></tr>
+</div><div class="memdoc">
+
+<p>Append a string value to a PAF object. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">paf</td><td>PAF object to which the record is appended. </td></tr>
+    <tr><td class="paramname">name</td><td>Parameter name. </td></tr>
+    <tr><td class="paramname">value</td><td>Parameter value string. </td></tr>
+    <tr><td class="paramname">comment</td><td>Parameter description.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The function returns <code>EXIT_SUCCESS</code> if the record was successfully appended, or <code>EXIT_FAILURE</code> otherwise.</dd></dl>
-The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object <em>paf</em>. 
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00793">793</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00276">_forsPAFAppend()</a>, <a class="el" href="fors__paf_8c-source.html#l00635">forsPAFIsValidName()</a>, <a class="el" href="fors__paf_8c-source.html#l00108">_FORS_PAF_::nr</a>, and <a class="el" href="fors__paf_8c-source.html#l00110">_FORS_PAF_::records</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00235">fors_qc_write_string()</a>, and <a class="el" href="fors__qc_8c-source.html#l00267">fors_qc_write_string_chat()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The function returns <code>EXIT_SUCCESS</code> if the record was successfully appended, or <code>EXIT_FAILURE</code> otherwise.</dd></dl>
+<p>The function creates a new PAF record for the given name, value and comment and appends it to the record list of the PAF object <em>paf</em>. </p>
+
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00800">800</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+
+<p>References <a class="el" href="fors__paf_8c_source.html#l00642">forsPAFIsValidName()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__qc_8c_source.html#l00235">fors_qc_write_string()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g2cceff721bbbd99c1a4bddfb57ed688b"></a><!-- doxytag: member="fors_paf.c::forsPAFWrite" ref="g2cceff721bbbd99c1a4bddfb57ed688b" args="(ForsPAF *paf)" -->
+<a class="anchor" id="ga3e16371f03930ae272a5454ad6100f83"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int forsPAFWrite           </td>
+          <td class="memname">int forsPAFWrite </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
-          <td class="paramname"> <em>paf</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype"><a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td>
+          <td class="paramname"><em>paf</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Write a PAF object to a disk file. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>paf</em> </td><td>PAF object to save.</td></tr>
+</div><div class="memdoc">
+
+<p>Write a PAF object to a disk file. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">paf</td><td>PAF object to save.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The function returns <code>EXIT_SUCCESS</code> if the object was successfully written to the file, otherwise <code>EXIT_FAILURE</code> is returned.</dd></dl>
-The function converts the PAF object into an ASCII file on disk, using the name used to create the PAF object as a file name for the disk file. 
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00827">827</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00387">_forsPAFFormatRecord()</a>, <a class="el" href="fors__paf_8c-source.html#l00109">_FORS_PAF_::header</a>, <a class="el" href="fors__paf_8c-source.html#l00106">_FORS_PAF_::name</a>, <a class="el" href="fors__paf_8c-source.html#l00107">_FORS_PAF_::nh</a>, <a class="el" href="fors__paf_8c-source.html#l00108">_FORS_PAF_::nr</a>, and <a class="el" href="fors__paf_8c-source.html#l00110">_FORS_PAF_::records</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00200">fors_qc_end_group()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The function returns <code>EXIT_SUCCESS</code> if the object was successfully written to the file, otherwise <code>EXIT_FAILURE</code> is returned.</dd></dl>
+<p>The function converts the PAF object into an ASCII file on disk, using the name used to create the PAF object as a file name for the disk file. </p>
+
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00834">834</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__qc_8c_source.html#l00200">fors_qc_end_group()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__bias.html b/html/group__fors__bias.html
index e9ad38a..b7530fd 100644
--- a/html/group__fors__bias.html
+++ b/html/group__fors__bias.html
@@ -1,354 +1,391 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_recipe Recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>fors_recipe Recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g118f4ff4db4251491395cec26f300577"></a><!-- doxytag: member="fors_bias::write_qc" ref="g118f4ff4db4251491395cec26f300577" args="(cpl_propertylist *qc, const fors_setting *setting, const cpl_frame *first_bias, const fors_image_list *bias, const fors_image *master_bias, const stack_method *sm)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#g118f4ff4db4251491395cec26f300577">write_qc</a> (cpl_propertylist *qc, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, const cpl_frame *first_bias, const fors_image_list *bias, const <a class="el" href="struct__fors__image.html">fors_image</a> *master_bias, const stack_method *sm)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#g4a662bfaa15a38c6190fe7ba15ff1bf9">fors_bias_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#g4a662bfaa15a38c6190fe7ba15ff1bf9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#g0eef24525a05bf717023a0380e5931b2">fors_bias</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#g0eef24525a05bf717023a0380e5931b2"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#g4abb403976fc3ddcaa614c59a44590c9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#g7eae9b8d1a50b0e1b4f13e652b2b2510">fors_bias_create</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#g7eae9b8d1a50b0e1b4f13e652b2b2510"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#gf051ed22200bb5eafa1ce68561ff89ad">fors_bias_exec</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#gf051ed22200bb5eafa1ce68561ff89ad"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#gbac19e9fec13b72b6b5cf2f7bb5cf67c">fors_bias_destroy</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#gbac19e9fec13b72b6b5cf2f7bb5cf67c"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd51c822cab169bae87041e5a4fcd66d4"></a><!-- doxytag: member="fors_bias::fors_bias_name" ref="gd51c822cab169bae87041e5a4fcd66d4" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#gd51c822cab169bae87041e5a4fcd66d4">fors_bias_name</a> = "fors_bias"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gea114b7db6295d739326c18b19a7e913"></a><!-- doxytag: member="fors_bias::fors_bias_description_short" ref="gea114b7db6295d739326c18b19a7e913" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#gea114b7db6295d739326c18b19a7e913">fors_bias_description_short</a> = "Compute the master bias frame"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gac46f7ed3e8a797c8d29848b5cf6b304"></a><!-- doxytag: member="fors_bias::fors_bias_author" ref="gac46f7ed3e8a797c8d29848b5cf6b304" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#gac46f7ed3e8a797c8d29848b5cf6b304">fors_bias_author</a> = "Jonas M. Larsen, Carlo Izzo"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gf0a241a045115f888f5c723675d02e2f"></a><!-- doxytag: member="fors_bias::fors_bias_email" ref="gf0a241a045115f888f5c723675d02e2f" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#gf0a241a045115f888f5c723675d02e2f">fors_bias_email</a> = PACKAGE_BUGREPORT</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#gc1284becbd1c69542318bd9d410756c0">fors_bias_description</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_recipe Recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gabdc231ff21279c9e3d5bff44c3f3fd6f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gabdc231ff21279c9e3d5bff44c3f3fd6f"></a>
+static void </td><td class="memItemRight" valign="bottom"><b>write_qc</b> (cpl_propertylist *qc, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, const cpl_frame *first_bias, const fors_image_list *bias, const <a class="el" href="struct__fors__image.html">fors_image</a> *master_bias, const stack_method *sm)</td></tr>
+<tr class="separator:gabdc231ff21279c9e3d5bff44c3f3fd6f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6573b8822e0f40fbc3872cd034e0b0f4"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#ga6573b8822e0f40fbc3872cd034e0b0f4">fors_bias_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga6573b8822e0f40fbc3872cd034e0b0f4"><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#ga6573b8822e0f40fbc3872cd034e0b0f4">More...</a><br/></td></tr>
+<tr class="separator:ga6573b8822e0f40fbc3872cd034e0b0f4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5d2a46e2354a60d3a45b2c63a665b781"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#ga5d2a46e2354a60d3a45b2c63a665b781">fors_bias</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga5d2a46e2354a60d3a45b2c63a665b781"><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#ga5d2a46e2354a60d3a45b2c63a665b781">More...</a><br/></td></tr>
+<tr class="separator:ga5d2a46e2354a60d3a45b2c63a665b781"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
+<tr class="memdesc:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#ga31d1fccd4cd15b1c1f3c5edc8cb18693">More...</a><br/></td></tr>
+<tr class="separator:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaad1b25bcaa37dff1e986b001f8d37ba1"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#gaad1b25bcaa37dff1e986b001f8d37ba1">fors_bias_create</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:gaad1b25bcaa37dff1e986b001f8d37ba1"><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#gaad1b25bcaa37dff1e986b001f8d37ba1">More...</a><br/></td></tr>
+<tr class="separator:gaad1b25bcaa37dff1e986b001f8d37ba1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga98c9fd3f30badaa1ae4d9ed954f34fcc"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#ga98c9fd3f30badaa1ae4d9ed954f34fcc">fors_bias_exec</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga98c9fd3f30badaa1ae4d9ed954f34fcc"><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#ga98c9fd3f30badaa1ae4d9ed954f34fcc">More...</a><br/></td></tr>
+<tr class="separator:ga98c9fd3f30badaa1ae4d9ed954f34fcc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1db6393658146917d5d8403fd1ed7654"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias.html#ga1db6393658146917d5d8403fd1ed7654">fors_bias_destroy</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga1db6393658146917d5d8403fd1ed7654"><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#ga1db6393658146917d5d8403fd1ed7654">More...</a><br/></td></tr>
+<tr class="separator:ga1db6393658146917d5d8403fd1ed7654"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga592aa688dc3bce8eb844bc2cc1aa10df"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga592aa688dc3bce8eb844bc2cc1aa10df"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_bias_name</b> = "fors_bias"</td></tr>
+<tr class="separator:ga592aa688dc3bce8eb844bc2cc1aa10df"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3060d3f8da61ea96500a709454e0d157"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3060d3f8da61ea96500a709454e0d157"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_bias_description_short</b> = "Compute the master bias frame"</td></tr>
+<tr class="separator:ga3060d3f8da61ea96500a709454e0d157"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga997a109752c13033f89ac7f16b983938"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga997a109752c13033f89ac7f16b983938"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_bias_author</b> = "Jonas M. Larsen, Carlo Izzo"</td></tr>
+<tr class="separator:ga997a109752c13033f89ac7f16b983938"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae9c375d196eba5a2c52cf57b7de8c8e7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae9c375d196eba5a2c52cf57b7de8c8e7"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_bias_email</b> = PACKAGE_BUGREPORT</td></tr>
+<tr class="separator:gae9c375d196eba5a2c52cf57b7de8c8e7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab964eee8b809187efd9925a2d5d5b484"><td class="memItemLeft" align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><b>fors_bias_description</b></td></tr>
+<tr class="separator:gab964eee8b809187efd9925a2d5d5b484"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-See recipe description for details. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_bias_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>See recipe description for details. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(bias_frames); \</div>
+<div class="line">    fors_stack_method_delete(&sm); \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)context); \</div>
+<div class="line">    fors_image_list_delete_const(&bias, <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>); \</div>
+<div class="line">    fors_image_delete(&master_bias); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    cpl_propertylist_delete(qc); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__bias__impl_8c_source.html#l00165">165</a> of file <a class="el" href="fors__bias__impl_8c_source.html">fors_bias_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(bias_frames); \
-    <a class="code" href="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13">fors_stack_method_delete</a>(&sm); \
-    cpl_free((<span class="keywordtype">void</span> *)context); \
-    fors_image_list_delete_const(&bias, <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_bias); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    cpl_propertylist_delete(qc); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__bias__impl_8c-source.html#l00165">165</a> of file <a class="el" href="fors__bias__impl_8c-source.html">fors_bias_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l03446">build_equations_lhs_matrix_from_parameters()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l03735">build_equations_rhs_cov()</a>, <a class="el" href="test__simulate_8c-source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c-source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c-source.html#l00532">create_phot_table()</a>, <a class="el" href="test__si [...]
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_bias_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&image); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__bias__impl_8c_source.html#l00165">165</a> of file <a class="el" href="fors__bias__impl_8c_source.html">fors_bias_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__bias__impl_8c-source.html#l00165">165</a> of file <a class="el" href="fors__bias__impl_8c-source.html">fors_bias_impl.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g4a662bfaa15a38c6190fe7ba15ff1bf9"></a><!-- doxytag: member="fors_bias_impl.c::fors_bias_define_parameters" ref="g4a662bfaa15a38c6190fe7ba15ff1bf9" args="(cpl_parameterlist *parameters)" -->
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga6573b8822e0f40fbc3872cd034e0b0f4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_bias_define_parameters           </td>
+          <td class="memname">void fors_bias_define_parameters </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Define recipe parameters. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameter list to fill </td></tr>
+<p>Define recipe parameters. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>parameter list to fill </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__bias__impl_8c-source.html#l00078">78</a> of file <a class="el" href="fors__bias__impl_8c-source.html">fors_bias_impl.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00052">fors_bias_name</a>, and <a class="el" href="fors__stack_8c-source.html#l00055">fors_stack_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__bias_8c-source.html#l00109">fors_bias_create()</a>, and <a class="el" href="fors__bias-test_8c-source.html#l00062">test_bias()</a>.
+<p>Definition at line <a class="el" href="fors__bias__impl_8c_source.html#l00078">78</a> of file <a class="el" href="fors__bias__impl_8c_source.html">fors_bias_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__stack_8c_source.html#l00055">fors_stack_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias_8c_source.html#l00109">fors_bias_create()</a>, and <a class="el" href="fors__bias-test_8c_source.html#l00062">test_bias()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g0eef24525a05bf717023a0380e5931b2"></a><!-- doxytag: member="fors_bias_impl.c::fors_bias" ref="g0eef24525a05bf717023a0380e5931b2" args="(cpl_frameset *frames, const cpl_parameterlist *parameters)" -->
+</div>
+<a class="anchor" id="ga5d2a46e2354a60d3a45b2c63a665b781"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_bias           </td>
+          <td class="memname">void fors_bias </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em></td><td> </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Do the processing. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>input frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>recipe parameters</td></tr>
+<p>Do the processing. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>input frames </td></tr>
+    <tr><td class="paramname">parameters</td><td>recipe parameters</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__bias__impl_8c_source.html#l00109">109</a> of file <a class="el" href="fors__bias__impl_8c_source.html">fors_bias_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__dfs_8c_source.html#l01200">fors_dfs_save_image_err()</a>, <a class="el" href="fors__utils_8c_source.html#l00468">fors_frameset_extract()</a>, <a class="el" href="fors__image_8c_source.html#l00316">fors_image_load_list_const()</a>, <a class="el" href="fors__setting_8c_source.html#l00064">fors_setting_new()</a>, <a class="el" href="fors__stack_8c_source.html#l00298">fors_stack_const()</a>, < [...]
+
+<p>Referenced by <a class="el" href="fors__bias_8c_source.html#l00158">fors_bias_exec()</a>, and <a class="el" href="fors__bias-test_8c_source.html#l00062">test_bias()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__bias__impl_8c-source.html#l00109">109</a> of file <a class="el" href="fors__bias__impl_8c-source.html">fors_bias_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00052">fors_bias_name</a>, <a class="el" href="fors__dfs_8c-source.html#l01164">fors_dfs_save_image()</a>, <a class="el" href="fors__utils_8c-source.html#l00468">fors_frameset_extract()</a>, <a class="el" href="fors__image_8c-source.html#l00313">fors_image_load_list_const()</a>, <a class="el" h [...]
-<p>
-Referenced by <a class="el" href="fors__bias_8c-source.html#l00158">fors_bias_exec()</a>, and <a class="el" href="fors__bias-test_8c-source.html#l00062">test_bias()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g4abb403976fc3ddcaa614c59a44590c9"></a><!-- doxytag: member="fors_bias.c::cpl_plugin_get_info" ref="g4abb403976fc3ddcaa614c59a44590c9" args="(cpl_pluginlist *list)" -->
+</div>
+<a class="anchor" id="ga31d1fccd4cd15b1c1f3c5edc8cb18693"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int cpl_plugin_get_info           </td>
+          <td class="memname">int cpl_plugin_get_info </td>
           <td>(</td>
-          <td class="paramtype">cpl_pluginlist * </td>
-          <td class="paramname"> <em>list</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_pluginlist * </td>
+          <td class="paramname"><em>list</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Build the list of available plugins, for this module. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>The plugin list</td></tr>
+<p>Build the list of available plugins, for this module. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">list</td><td>The plugin list</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
-Create the recipe instance and make it available to the application using the interface. This function is exported. 
-<p>
-Definition at line <a class="el" href="fors__bias_8c-source.html#l00062">62</a> of file <a class="el" href="fors__bias_8c-source.html">fors_bias.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00054">fors_bias_author</a>, <a class="el" href="fors__bias_8c-source.html#l00109">fors_bias_create()</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00056">fors_bias_description</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00053">fors_bias_description_short</a>, <a class="el" href="fors__bias_8c-source.html#l00207">fors_bias_destroy()</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00055">fo [...]
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<p>Create the recipe instance and make it available to the application using the interface. This function is exported. </p>
+
+<p>Definition at line <a class="el" href="fors__bias_8c_source.html#l00062">62</a> of file <a class="el" href="fors__bias_8c_source.html">fors_bias.c</a>.</p>
+
+<p>References <a class="el" href="fors__bias_8c_source.html#l00109">fors_bias_create()</a>, <a class="el" href="fors__bias_8c_source.html#l00207">fors_bias_destroy()</a>, <a class="el" href="fors__bias_8c_source.html#l00158">fors_bias_exec()</a>, <a class="el" href="fors__utils_8c_source.html#l00065">fors_get_license()</a>, and <a class="el" href="fors__utils_8c_source.html#l00107">fors_get_version_binary()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g7eae9b8d1a50b0e1b4f13e652b2b2510"></a><!-- doxytag: member="fors_bias.c::fors_bias_create" ref="g7eae9b8d1a50b0e1b4f13e652b2b2510" args="(cpl_plugin *plugin)" -->
+</div>
+<a class="anchor" id="gaad1b25bcaa37dff1e986b001f8d37ba1"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_bias_create           </td>
+          <td class="memname">static int fors_bias_create </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Setup the recipe options. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+<p>Setup the recipe options. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok</dd></dl>
-Defining the command-line/configuration parameters for the recipe. 
-<p>
-Definition at line <a class="el" href="fors__bias_8c-source.html#l00109">109</a> of file <a class="el" href="fors__bias_8c-source.html">fors_bias.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00078">fors_bias_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__bias_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok</dd></dl>
+<p>Defining the command-line/configuration parameters for the recipe. </p>
+
+<p>Definition at line <a class="el" href="fors__bias_8c_source.html#l00109">109</a> of file <a class="el" href="fors__bias_8c_source.html">fors_bias.c</a>.</p>
+
+<p>References <a class="el" href="fors__bias__impl_8c_source.html#l00078">fors_bias_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gf051ed22200bb5eafa1ce68561ff89ad"></a><!-- doxytag: member="fors_bias.c::fors_bias_exec" ref="gf051ed22200bb5eafa1ce68561ff89ad" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="ga98c9fd3f30badaa1ae4d9ed954f34fcc"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_bias_exec           </td>
+          <td class="memname">static int fors_bias_exec </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Execute the plugin instance given by the interface. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>the plugin</td></tr>
+<p>Execute the plugin instance given by the interface. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>the plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__bias_8c_source.html#l00158">158</a> of file <a class="el" href="fors__bias_8c_source.html">fors_bias.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00230">fors_begin()</a>, <a class="el" href="fors__bias__impl_8c_source.html#l00109">fors_bias()</a>, and <a class="el" href="fors__dfs_8c_source.html#l00258">fors_end()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__bias_8c-source.html#l00158">158</a> of file <a class="el" href="fors__bias_8c-source.html">fors_bias.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00230">fors_begin()</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00109">fors_bias()</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00053">fors_bias_description_short</a>, and <a class="el" href="fors__dfs_8c-source.html#l00258">fors_end()</a>.
-<p>
-Referenced by <a class="el" href="fors__bias_8c-source.html#l00062">cpl_plugin_get_info()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gbac19e9fec13b72b6b5cf2f7bb5cf67c"></a><!-- doxytag: member="fors_bias.c::fors_bias_destroy" ref="gbac19e9fec13b72b6b5cf2f7bb5cf67c" args="(cpl_plugin *plugin)" -->
+</div>
+<a class="anchor" id="ga1db6393658146917d5d8403fd1ed7654"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_bias_destroy           </td>
+          <td class="memname">static int fors_bias_destroy </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Destroy what has been created by the 'create' function. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+<p>Destroy what has been created by the 'create' function. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__bias_8c_source.html#l00207">207</a> of file <a class="el" href="fors__bias_8c_source.html">fors_bias.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__bias_8c-source.html#l00207">207</a> of file <a class="el" href="fors__bias_8c-source.html">fors_bias.c</a>.
-<p>
-Referenced by <a class="el" href="fors__bias_8c-source.html#l00062">cpl_plugin_get_info()</a>.
 </div>
-</div><p>
-<hr><h2>Variable Documentation</h2>
-<a class="anchor" name="gc1284becbd1c69542318bd9d410756c0"></a><!-- doxytag: member="fors_bias_impl.c::fors_bias_description" ref="gc1284becbd1c69542318bd9d410756c0" args="" -->
+</div>
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="gab964eee8b809187efd9925a2d5d5b484"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* const <a class="el" href="group__fors__bias.html#gc1284becbd1c69542318bd9d410756c0">fors_bias_description</a>          </td>
+          <td class="memname">const char* const fors_bias_description</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">=</div>
+<div class="line"><span class="stringliteral">"This recipe is used to combine input raw BIAS frames into a master bias\n"</span></div>
+<div class="line"><span class="stringliteral">"frame. The overscan regions, if present, are removed from the result.\n\n"</span></div>
+<div class="line"><span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><span class="stringliteral">"  BIAS                       Raw         Bias frame              Y\n\n"</span></div>
+<div class="line"><span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias frame\n\n"</span></div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__bias__impl_8c_source.html#l00056">56</a> of file <a class="el" href="fors__bias__impl_8c_source.html">fors_bias_impl.c</a>.</p>
 
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment">
-<span class="stringliteral">"This recipe is used to combine input raw BIAS frames into a master bias\n"</span>
-<span class="stringliteral">"frame. The overscan regions, if present, are removed from the result.\n\n"</span>
-<span class="stringliteral">"Input files:\n\n"</span>
-<span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<span class="stringliteral">"  BIAS                       Raw         Bias frame              Y\n\n"</span>
-<span class="stringliteral">"Output files:\n\n"</span>
-<span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias frame\n\n"</span>
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__bias__impl_8c-source.html#l00056">56</a> of file <a class="el" href="fors__bias__impl_8c-source.html">fors_bias_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__bias_8c-source.html#l00062">cpl_plugin_get_info()</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__bias__test.html b/html/group__fors__bias__test.html
index db0a91b..ea2be94 100644
--- a/html/group__fors__bias__test.html
+++ b/html/group__fors__bias__test.html
@@ -1,61 +1,96 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: test of master bias recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>test of master bias recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g42640f96b5b36b542e3302fee3c97b75"></a><!-- doxytag: member="fors_bias_test::test_bias" ref="g42640f96b5b36b542e3302fee3c97b75" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias__test.html#g42640f96b5b36b542e3302fee3c97b75">test_bias</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test bias recipe. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_bias_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of image module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_bias-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">test of master bias recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga56ca9e6f3e38b35931c68ecb147b1f75"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga56ca9e6f3e38b35931c68ecb147b1f75"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias__test.html#ga56ca9e6f3e38b35931c68ecb147b1f75">test_bias</a> (void)</td></tr>
+<tr class="memdesc:ga56ca9e6f3e38b35931c68ecb147b1f75"><td class="mdescLeft"> </td><td class="mdescRight">Test bias recipe. <br/></td></tr>
+<tr class="separator:ga56ca9e6f3e38b35931c68ecb147b1f75"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__bias__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of image module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(frames); \</div>
+<div class="line">    cpl_parameterlist_delete(parameters); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    fors_image_delete(&raw_bias); \</div>
+<div class="line">    fors_image_delete(&master_bias); \</div>
+<div class="line">    cpl_propertylist_delete(product_header); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__bias-test_8c_source.html#l00048">48</a> of file <a class="el" href="fors__bias-test_8c_source.html">fors_bias-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(frames); \
-    cpl_parameterlist_delete(parameters); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&raw_bias); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_bias); \
-    cpl_propertylist_delete(product_header); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__bias-test_8c-source.html#l00048">48</a> of file <a class="el" href="fors__bias-test_8c-source.html">fors_bias-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__cpl__wcs.html b/html/group__fors__cpl__wcs.html
index 1b2cae8..457e3b2 100644
--- a/html/group__fors__cpl__wcs.html
+++ b/html/group__fors__cpl__wcs.html
@@ -1,242 +1,290 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: World_Coordinate_Systems</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>World_Coordinate_Systems</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__cpl__wcs__.html">_fors_cpl_wcs_</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9cd93383f8763df38b2245c017e9bcd7"></a><!-- doxytag: member="fors_cpl_wcs::DEGRAD" ref="g9cd93383f8763df38b2245c017e9bcd7" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#g9cd93383f8763df38b2245c017e9bcd7">DEGRAD</a>   57.2957795130823229</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc010b843f505ed7d24c8da36477b5cde"></a><!-- doxytag: member="fors_cpl_wcs::WCSLIB_ERRCODE_MAX" ref="gc010b843f505ed7d24c8da36477b5cde" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#gc010b843f505ed7d24c8da36477b5cde">WCSLIB_ERRCODE_MAX</a>   9</td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#g1ff77ef3ec6654b60865ff114ffb0194">fors_cpl_wcs_init</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an empty wcs structure.  <a href="#g1ff77ef3ec6654b60865ff114ffb0194"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#ge66dce7f4ef9d442dd849595f39b82bf">fors_cpl_wcs_plist2fitsstr</a> (const cpl_propertylist *self, int *nkeys)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert a propertylist to a FITS string.  <a href="#ge66dce7f4ef9d442dd849595f39b82bf"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_propertylist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#g8d23e487c941ebc5b4d30a113f9dc324">fors_cpl_wcs_fitsstr2plist</a> (char *fitsstr)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert a FITS string to a propertylist.  <a href="#g8d23e487c941ebc5b4d30a113f9dc324"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9be6ef771ded8b7466af4ed6485d17f6"></a><!-- doxytag: member="fors_cpl_wcs::fors_ffhdr2str" ref="g9be6ef771ded8b7466af4ed6485d17f6" args="(fitsfile *fptr, int exclude_comm, char **exclist, int nexc, char **header, int *nkeys, int *status)" -->
-static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#g9be6ef771ded8b7466af4ed6485d17f6">fors_ffhdr2str</a> (fitsfile *fptr, int exclude_comm, char **exclist, int nexc, char **header, int *nkeys, int *status)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4636540ea73da854494e3b19f72cdd2a"></a><!-- doxytag: member="fors_cpl_wcs::fors_cpl_wcs_new_from_propertylist" ref="g4636540ea73da854494e3b19f72cdd2a" args="(const cpl_propertylist *plist)" -->
-<a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#g4636540ea73da854494e3b19f72cdd2a">fors_cpl_wcs_new_from_propertylist</a> (const cpl_propertylist *plist)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43">fors_cpl_wcs_delete</a> (<a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy a WCS structure.  <a href="#g56eb9b85f6df5fa8fc5fc53911d3fd43"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g89ddf97c27e31e73417e60d100ab925b"></a><!-- doxytag: member="fors_cpl_wcs::fors_cpl_wcs_convert" ref="g89ddf97c27e31e73417e60d100ab925b" args="(const fors_cpl_wcs *wcs, const cpl_matrix *from, cpl_matrix **to, cpl_array **status, fors_cpl_wcs_trans_mode transform)" -->
-cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#g89ddf97c27e31e73417e60d100ab925b">fors_cpl_wcs_convert</a> (const <a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs, const cpl_matrix *from, cpl_matrix **to, cpl_array **status, fors_cpl_wcs_trans_mode transform)</td></tr>
-
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#ga106b9beff20823017688021d7f008c3">wcslib_errmsgs</a> [WCSLIB_ERRCODE_MAX+1]</td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Data Structures</a> |
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">World_Coordinate_Systems</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__cpl__wcs__.html">_fors_cpl_wcs_</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:gac377a5fa64fdef02d0048cf0e27aca2c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac377a5fa64fdef02d0048cf0e27aca2c"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>DEGRAD</b>   57.2957795130823229</td></tr>
+<tr class="separator:gac377a5fa64fdef02d0048cf0e27aca2c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0e3b1d297467f0a8552c6aa7da80bc4d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0e3b1d297467f0a8552c6aa7da80bc4d"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>WCSLIB_ERRCODE_MAX</b>   9</td></tr>
+<tr class="separator:ga0e3b1d297467f0a8552c6aa7da80bc4d"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga1027310dff52a22788095ccdc54263ac"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#ga1027310dff52a22788095ccdc54263ac">fors_cpl_wcs_init</a> (void)</td></tr>
+<tr class="memdesc:ga1027310dff52a22788095ccdc54263ac"><td class="mdescLeft"> </td><td class="mdescRight">Create an empty wcs structure.  <a href="#ga1027310dff52a22788095ccdc54263ac">More...</a><br/></td></tr>
+<tr class="separator:ga1027310dff52a22788095ccdc54263ac"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa352c368a01171ba9fbfa0b63dd7784e"><td class="memItemLeft" align="right" valign="top">static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#gaa352c368a01171ba9fbfa0b63dd7784e">fors_cpl_wcs_plist2fitsstr</a> (const cpl_propertylist *self, int *nkeys)</td></tr>
+<tr class="memdesc:gaa352c368a01171ba9fbfa0b63dd7784e"><td class="mdescLeft"> </td><td class="mdescRight">Convert a propertylist to a FITS string.  <a href="#gaa352c368a01171ba9fbfa0b63dd7784e">More...</a><br/></td></tr>
+<tr class="separator:gaa352c368a01171ba9fbfa0b63dd7784e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga85c6df963659c6ab9a28649094ae037a"><td class="memItemLeft" align="right" valign="top">static cpl_propertylist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#ga85c6df963659c6ab9a28649094ae037a">fors_cpl_wcs_fitsstr2plist</a> (char *fitsstr)</td></tr>
+<tr class="memdesc:ga85c6df963659c6ab9a28649094ae037a"><td class="mdescLeft"> </td><td class="mdescRight">Convert a FITS string to a propertylist.  <a href="#ga85c6df963659c6ab9a28649094ae037a">More...</a><br/></td></tr>
+<tr class="separator:ga85c6df963659c6ab9a28649094ae037a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab492ce42cd31fc090dea53c30fbea764"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab492ce42cd31fc090dea53c30fbea764"></a>
+static int </td><td class="memItemRight" valign="bottom"><b>fors_ffhdr2str</b> (fitsfile *fptr, int exclude_comm, char **exclist, int nexc, char **header, int *nkeys, int *status)</td></tr>
+<tr class="separator:gab492ce42cd31fc090dea53c30fbea764"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa74bc568f12d11bafedd854ef78a4c45"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa74bc568f12d11bafedd854ef78a4c45"></a>
+<a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> * </td><td class="memItemRight" valign="bottom"><b>fors_cpl_wcs_new_from_propertylist</b> (const cpl_propertylist *plist)</td></tr>
+<tr class="separator:gaa74bc568f12d11bafedd854ef78a4c45"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5f02c917d9059a4472f872989d50fd83"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83">fors_cpl_wcs_delete</a> (<a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs)</td></tr>
+<tr class="memdesc:ga5f02c917d9059a4472f872989d50fd83"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a WCS structure.  <a href="#ga5f02c917d9059a4472f872989d50fd83">More...</a><br/></td></tr>
+<tr class="separator:ga5f02c917d9059a4472f872989d50fd83"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6ade84a0f3d4ce2796e12df3adb776d1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6ade84a0f3d4ce2796e12df3adb776d1"></a>
+cpl_error_code </td><td class="memItemRight" valign="bottom"><b>fors_cpl_wcs_convert</b> (const <a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> *wcs, const cpl_matrix *from, cpl_matrix **to, cpl_array **status, fors_cpl_wcs_trans_mode transform)</td></tr>
+<tr class="separator:ga6ade84a0f3d4ce2796e12df3adb776d1"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:gae98db393c8ca9bdd82fc4e168d570247"><td class="memItemLeft" align="right" valign="top">static char * </td><td class="memItemRight" valign="bottom"><b>wcslib_errmsgs</b> [WCSLIB_ERRCODE_MAX+1]</td></tr>
+<tr class="separator:gae98db393c8ca9bdd82fc4e168d570247"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-This module provides functions to manipulate FITS World Coordinate Systems<p>
-A <em>fors_cpl_wcs</em> is an object containing a pointer to the WCSLIB structure and the physical dimensions of the image from which the WCS was read. The functionality provided includes general transformations between physical and world coordinates as well as a few conveience routines for x,y <=> RA,Dec transformations.<p>
-<dl compact><dt><b>Synopsis:</b></dt><dd><div class="fragment"><pre class="fragment"><span class="preprocessor">   #include "fors_cpl_wcs.h"</span>
-</pre></div> </dd></dl>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g1ff77ef3ec6654b60865ff114ffb0194"></a><!-- doxytag: member="fors_cpl_wcs.c::fors_cpl_wcs_init" ref="g1ff77ef3ec6654b60865ff114ffb0194" args="(void)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>This module provides functions to manipulate FITS World Coordinate Systems</p>
+<p>A <em>fors_cpl_wcs</em> is an object containing a pointer to the WCSLIB structure and the physical dimensions of the image from which the WCS was read. The functionality provided includes general transformations between physical and world coordinates as well as a few conveience routines for x,y <=> RA,Dec transformations.</p>
+<dl class="section user"><dt>Synopsis:</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include "fors_cpl_wcs.h"</span></div>
+</div><!-- fragment --> </dd></dl>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga1027310dff52a22788095ccdc54263ac"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static <a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> * fors_cpl_wcs_init           </td>
+          <td class="memname">static <a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> * fors_cpl_wcs_init </td>
           <td>(</td>
-          <td class="paramtype">void </td>
-          <td class="paramname">          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">void </td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Create an empty wcs structure. </p>
+<dl class="section return"><dt>Returns</dt><dd>The output wcs structure</dd></dl>
+<p>None</p>
+<p>This is a static routine that creates an empty fors_cpl_wcs structure. </p>
 
-<p>
-Create an empty wcs structure. 
-<p>
-<dl compact><dt><b>Returns:</b></dt><dd>The output wcs structure</dd></dl>
-None<p>
-This is a static routine that creates an empty fors_cpl_wcs structure. 
-<p>
-Definition at line <a class="el" href="fors__cpl__wcs_8c-source.html#l00569">569</a> of file <a class="el" href="fors__cpl__wcs_8c-source.html">fors_cpl_wcs.c</a>.
-<p>
-References <a class="el" href="fors__cpl__wcs_8c-source.html#l00092">_fors_cpl_wcs_::dims</a>, <a class="el" href="fors__cpl__wcs_8c-source.html#l00091">_fors_cpl_wcs_::naxis</a>, and <a class="el" href="fors__cpl__wcs_8c-source.html#l00090">_fors_cpl_wcs_::wcsptr</a>.
-<p>
-Referenced by <a class="el" href="fors__cpl__wcs_8c-source.html#l00277">fors_cpl_wcs_new_from_propertylist()</a>.
+<p>Definition at line <a class="el" href="fors__cpl__wcs_8c_source.html#l00569">569</a> of file <a class="el" href="fors__cpl__wcs_8c_source.html">fors_cpl_wcs.c</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ge66dce7f4ef9d442dd849595f39b82bf"></a><!-- doxytag: member="fors_cpl_wcs.c::fors_cpl_wcs_plist2fitsstr" ref="ge66dce7f4ef9d442dd849595f39b82bf" args="(const cpl_propertylist *self, int *nkeys)" -->
+<a class="anchor" id="gaa352c368a01171ba9fbfa0b63dd7784e"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static char * fors_cpl_wcs_plist2fitsstr           </td>
+          <td class="memname">static char * fors_cpl_wcs_plist2fitsstr </td>
           <td>(</td>
-          <td class="paramtype">const cpl_propertylist * </td>
-          <td class="paramname"> <em>self</em>, </td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>self</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>nkeys</em></td><td> </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>nkeys</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Convert a propertylist to a FITS string. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>self</em> </td><td>The input propertylist</td></tr>
+<p>Convert a propertylist to a FITS string. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">self</td><td>The input propertylist</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The output character string with the properties formatted as in a FITS header.</dd></dl>
-<table class="ec" align="center" border="1" cellspacing="3" cellpadding="3">
+<dl class="section return"><dt>Returns</dt><dd>The output character string with the properties formatted as in a FITS header.</dd></dl>
+<table  class="ec" align="center">
 <tr>
 <td class="ecl">CPL_ERROR_NULL_INPUT </td><td class="ecr">The parameter <em>self</em> is a <code>NULL</code> pointer.   </td></tr>
 </table>
-<p>
-This converts a propertylist into a single string with all properties formatted as FITS cards. This is needed for wcspih. The output string must be freed by the calling routine. 
-<p>
-Definition at line <a class="el" href="fors__cpl__wcs_8c-source.html#l00613">613</a> of file <a class="el" href="fors__cpl__wcs_8c-source.html">fors_cpl_wcs.c</a>.
-<p>
-References <a class="el" href="fors__cpl__wcs_8c-source.html#l00130">fors_ffhdr2str()</a>.
-<p>
-Referenced by <a class="el" href="fors__cpl__wcs_8c-source.html#l00277">fors_cpl_wcs_new_from_propertylist()</a>.
+<p>This converts a propertylist into a single string with all properties formatted as FITS cards. This is needed for wcspih. The output string must be freed by the calling routine. </p>
+
+<p>Definition at line <a class="el" href="fors__cpl__wcs_8c_source.html#l00613">613</a> of file <a class="el" href="fors__cpl__wcs_8c_source.html">fors_cpl_wcs.c</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g8d23e487c941ebc5b4d30a113f9dc324"></a><!-- doxytag: member="fors_cpl_wcs.c::fors_cpl_wcs_fitsstr2plist" ref="g8d23e487c941ebc5b4d30a113f9dc324" args="(char *fitsstr)" -->
+<a class="anchor" id="ga85c6df963659c6ab9a28649094ae037a"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_propertylist * fors_cpl_wcs_fitsstr2plist           </td>
+          <td class="memname">static cpl_propertylist * fors_cpl_wcs_fitsstr2plist </td>
           <td>(</td>
-          <td class="paramtype">char * </td>
-          <td class="paramname"> <em>fitsstr</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">char * </td>
+          <td class="paramname"><em>fitsstr</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Convert a FITS string to a propertylist. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>fitsstr</em> </td><td>The input FITS header string</td></tr>
+<p>Convert a FITS string to a propertylist. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">fitsstr</td><td>The input FITS header string</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The output propertylist.</dd></dl>
-<table class="ec" align="center" border="1" cellspacing="3" cellpadding="3">
+<dl class="section return"><dt>Returns</dt><dd>The output propertylist.</dd></dl>
+<table  class="ec" align="center">
 <tr>
 <td class="ecl">CPL_ERROR_NULL_INPUT </td><td class="ecr">The parameter <em>fitsstr</em> is a <code>NULL</code> pointer.   </td></tr>
 </table>
-<p>
-This converts a single string formatted with FITS cards into a propertylist. This is needed for wcspih. The output propertylist must be freed by the calling routine 
-<p>
-Definition at line <a class="el" href="fors__cpl__wcs_8c-source.html#l00682">682</a> of file <a class="el" href="fors__cpl__wcs_8c-source.html">fors_cpl_wcs.c</a>.
+<p>This converts a single string formatted with FITS cards into a propertylist. This is needed for wcspih. The output propertylist must be freed by the calling routine </p>
+
+<p>Definition at line <a class="el" href="fors__cpl__wcs_8c_source.html#l00682">682</a> of file <a class="el" href="fors__cpl__wcs_8c_source.html">fors_cpl_wcs.c</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g56eb9b85f6df5fa8fc5fc53911d3fd43"></a><!-- doxytag: member="fors_cpl_wcs.c::fors_cpl_wcs_delete" ref="g56eb9b85f6df5fa8fc5fc53911d3fd43" args="(fors_cpl_wcs *wcs)" -->
+</div>
+<a class="anchor" id="ga5f02c917d9059a4472f872989d50fd83"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_cpl_wcs_delete           </td>
+          <td class="memname">void fors_cpl_wcs_delete </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> * </td>
-          <td class="paramname"> <em>wcs</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype"><a class="el" href="struct__fors__cpl__wcs__.html">fors_cpl_wcs</a> * </td>
+          <td class="paramname"><em>wcs</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Destroy a WCS structure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>wcs</em> </td><td>The WCS structure to destroy</td></tr>
+<p>Destroy a WCS structure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">wcs</td><td>The WCS structure to destroy</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Nothing.</dd></dl>
-The function destroys the WCS structure <em>wcs</em> and its whole contents. 
-<p>
-Definition at line <a class="el" href="fors__cpl__wcs_8c-source.html#l00367">367</a> of file <a class="el" href="fors__cpl__wcs_8c-source.html">fors_cpl_wcs.c</a>.
-<p>
-References <a class="el" href="fors__cpl__wcs_8c-source.html#l00092">_fors_cpl_wcs_::dims</a>, and <a class="el" href="fors__cpl__wcs_8c-source.html#l00090">_fors_cpl_wcs_::wcsptr</a>.
-<p>
-Referenced by <a class="el" href="fors__cpl__wcs_8c-source.html#l00277">fors_cpl_wcs_new_from_propertylist()</a>.
+<dl class="section return"><dt>Returns</dt><dd>Nothing.</dd></dl>
+<p>The function destroys the WCS structure <em>wcs</em> and its whole contents. </p>
+
+<p>Definition at line <a class="el" href="fors__cpl__wcs_8c_source.html#l00367">367</a> of file <a class="el" href="fors__cpl__wcs_8c_source.html">fors_cpl_wcs.c</a>.</p>
+
 </div>
-</div><p>
-<hr><h2>Variable Documentation</h2>
-<a class="anchor" name="ga106b9beff20823017688021d7f008c3"></a><!-- doxytag: member="fors_cpl_wcs.c::wcslib_errmsgs" ref="ga106b9beff20823017688021d7f008c3" args="[WCSLIB_ERRCODE_MAX+1]" -->
+</div>
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="gae98db393c8ca9bdd82fc4e168d570247"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">char* <a class="el" href="group__fors__cpl__wcs.html#ga106b9beff20823017688021d7f008c3">wcslib_errmsgs</a>[WCSLIB_ERRCODE_MAX+1]<code> [static]</code>          </td>
+          <td class="memname">char* wcslib_errmsgs[WCSLIB_ERRCODE_MAX+1]</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">= {</div>
+<div class="line">                  <span class="stringliteral">""</span>,</div>
+<div class="line">          <span class="stringliteral">"WCSLIB undefined input structure pointer"</span>,</div>
+<div class="line">          <span class="stringliteral">"WCSLIB unable to allocate required memory"</span>,</div>
+<div class="line">          <span class="stringliteral">"WCSLIB linear transformation matrix is singular"</span>,</div>
+<div class="line">          <span class="stringliteral">"WCSLIB invalid coordinate axis types"</span>,</div>
+<div class="line">          <span class="stringliteral">"WCSLIB invalid parameter value"</span>,</div>
+<div class="line">          <span class="stringliteral">"WCSLIB invalid coordinate transformation parameters"</span>,</div>
+<div class="line">          <span class="stringliteral">"WCSLIB Ill-conditioned coordinate transformation parameters"</span>,</div>
+<div class="line">          <span class="stringliteral">"WCSLIB One or more input coordinates invalid"</span>,</div>
+<div class="line">          <span class="stringliteral">"WCSLIB One or more input coordinates invalid"</span>}</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__cpl__wcs_8c_source.html#l00108">108</a> of file <a class="el" href="fors__cpl__wcs_8c_source.html">fors_cpl_wcs.c</a>.</p>
 
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment"> {
-                  <span class="stringliteral">""</span>,
-          <span class="stringliteral">"WCSLIB undefined input structure pointer"</span>,
-          <span class="stringliteral">"WCSLIB unable to allocate required memory"</span>,
-          <span class="stringliteral">"WCSLIB linear transformation matrix is singular"</span>,
-          <span class="stringliteral">"WCSLIB invalid coordinate axis types"</span>,
-          <span class="stringliteral">"WCSLIB invalid parameter value"</span>,
-          <span class="stringliteral">"WCSLIB invalid coordinate transformation parameters"</span>,
-          <span class="stringliteral">"WCSLIB Ill-conditioned coordinate transformation parameters"</span>,
-          <span class="stringliteral">"WCSLIB One or more input coordinates invalid"</span>,
-          <span class="stringliteral">"WCSLIB One or more input coordinates invalid"</span>}
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__cpl__wcs_8c-source.html#l00108">108</a> of file <a class="el" href="fors__cpl__wcs_8c-source.html">fors_cpl_wcs.c</a>.
-<p>
-Referenced by <a class="el" href="fors__cpl__wcs_8c-source.html#l00433">fors_cpl_wcs_convert()</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__dark.html b/html/group__fors__dark.html
index 280a404..06ed497 100644
--- a/html/group__fors__dark.html
+++ b/html/group__fors__dark.html
@@ -1,335 +1,377 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_recipe Recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>fors_recipe Recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#g41900339775a0440158f71fab8e4fe73">fors_dark_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#g41900339775a0440158f71fab8e4fe73"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#g605a72777b8ade477948b511ec213dba">fors_dark</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#g605a72777b8ade477948b511ec213dba"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#g4abb403976fc3ddcaa614c59a44590c9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#gd82957e2524a2c840c990e6f6ac7a3f7">fors_dark_create</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#gd82957e2524a2c840c990e6f6ac7a3f7"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#gb03c103664e7d1ac06cf5819293024da">fors_dark_exec</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#gb03c103664e7d1ac06cf5819293024da"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#g0ae3039ae17bbc8695285b04dab01340">fors_dark_destroy</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#g0ae3039ae17bbc8695285b04dab01340"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g05d943cebf559a584cd08a0bb87c12f6"></a><!-- doxytag: member="fors_dark::fors_dark_name" ref="g05d943cebf559a584cd08a0bb87c12f6" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#g05d943cebf559a584cd08a0bb87c12f6">fors_dark_name</a> = "fors_dark"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g6cfbc19717c1140f0ed3c69cd3753820"></a><!-- doxytag: member="fors_dark::fors_dark_description_short" ref="g6cfbc19717c1140f0ed3c69cd3753820" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#g6cfbc19717c1140f0ed3c69cd3753820">fors_dark_description_short</a> = "Compute master dark frame"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2a0e9352332786f74633bbf15a357769"></a><!-- doxytag: member="fors_dark::fors_dark_author" ref="g2a0e9352332786f74633bbf15a357769" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#g2a0e9352332786f74633bbf15a357769">fors_dark_author</a> = "Jonas M. Larsen"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g7f059c5f1479df00d69390e1ea4f88e6"></a><!-- doxytag: member="fors_dark::fors_dark_email" ref="g7f059c5f1479df00d69390e1ea4f88e6" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#g7f059c5f1479df00d69390e1ea4f88e6">fors_dark_email</a> = PACKAGE_BUGREPORT</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#g6ca1a4a04494b527e073c4fcfc78d074">fors_dark_description</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_recipe Recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga288a7e1b685184b501b448ea67bdf493"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#ga288a7e1b685184b501b448ea67bdf493">fors_dark_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga288a7e1b685184b501b448ea67bdf493"><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#ga288a7e1b685184b501b448ea67bdf493">More...</a><br/></td></tr>
+<tr class="separator:ga288a7e1b685184b501b448ea67bdf493"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5b25632b185b390afe047835ef04708c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#ga5b25632b185b390afe047835ef04708c">fors_dark</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga5b25632b185b390afe047835ef04708c"><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#ga5b25632b185b390afe047835ef04708c">More...</a><br/></td></tr>
+<tr class="separator:ga5b25632b185b390afe047835ef04708c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
+<tr class="memdesc:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#ga31d1fccd4cd15b1c1f3c5edc8cb18693">More...</a><br/></td></tr>
+<tr class="separator:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac68c5042f96db84bf22ca9d3c93f2015"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#gac68c5042f96db84bf22ca9d3c93f2015">fors_dark_create</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:gac68c5042f96db84bf22ca9d3c93f2015"><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#gac68c5042f96db84bf22ca9d3c93f2015">More...</a><br/></td></tr>
+<tr class="separator:gac68c5042f96db84bf22ca9d3c93f2015"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaff0761c9cc96530ee12377f1f014e069"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#gaff0761c9cc96530ee12377f1f014e069">fors_dark_exec</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:gaff0761c9cc96530ee12377f1f014e069"><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#gaff0761c9cc96530ee12377f1f014e069">More...</a><br/></td></tr>
+<tr class="separator:gaff0761c9cc96530ee12377f1f014e069"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga828322574faee993a595ecc93dfe5944"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark.html#ga828322574faee993a595ecc93dfe5944">fors_dark_destroy</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga828322574faee993a595ecc93dfe5944"><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#ga828322574faee993a595ecc93dfe5944">More...</a><br/></td></tr>
+<tr class="separator:ga828322574faee993a595ecc93dfe5944"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga74e2fda28fd70220022c44eb6eee9972"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga74e2fda28fd70220022c44eb6eee9972"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_dark_name</b> = "fors_dark"</td></tr>
+<tr class="separator:ga74e2fda28fd70220022c44eb6eee9972"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1210cd145dddb85ff38dcfedd108116a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1210cd145dddb85ff38dcfedd108116a"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_dark_description_short</b> = "Compute master dark frame"</td></tr>
+<tr class="separator:ga1210cd145dddb85ff38dcfedd108116a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab78855e5600d9c687fef05497032073f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab78855e5600d9c687fef05497032073f"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_dark_author</b> = "Jonas M. Larsen"</td></tr>
+<tr class="separator:gab78855e5600d9c687fef05497032073f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga05c36699290df606292abc2363e1752e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga05c36699290df606292abc2363e1752e"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_dark_email</b> = PACKAGE_BUGREPORT</td></tr>
+<tr class="separator:ga05c36699290df606292abc2363e1752e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae85f9c301c16078b04136f0117be92d7"><td class="memItemLeft" align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><b>fors_dark_description</b></td></tr>
+<tr class="separator:gae85f9c301c16078b04136f0117be92d7"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-See recipe description for details. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_dark_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>See recipe description for details. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(dark_frames); \</div>
+<div class="line">    cpl_frameset_delete(master_bias_frame); \</div>
+<div class="line">    fors_image_delete_const(&master_bias); \</div>
+<div class="line">    fors_stack_method_delete(&sm); \</div>
+<div class="line">    fors_image_delete(&master_dark); \</div>
+<div class="line">    fors_image_list_delete_const(&darks, <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)context); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__dark__impl_8c_source.html#l00083">83</a> of file <a class="el" href="fors__dark__impl_8c_source.html">fors_dark_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(dark_frames); \
-    cpl_frameset_delete(master_bias_frame); \
-    <a class="code" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">fors_image_delete_const</a>(&master_bias); \
-    <a class="code" href="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13">fors_stack_method_delete</a>(&sm); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_dark); \
-    fors_image_list_delete_const(&darks, <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    cpl_free((<span class="keywordtype">void</span> *)context); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__dark__impl_8c-source.html#l00083">83</a> of file <a class="el" href="fors__dark__impl_8c-source.html">fors_dark_impl.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g41900339775a0440158f71fab8e4fe73"></a><!-- doxytag: member="fors_dark_impl.c::fors_dark_define_parameters" ref="g41900339775a0440158f71fab8e4fe73" args="(cpl_parameterlist *parameters)" -->
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga288a7e1b685184b501b448ea67bdf493"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_dark_define_parameters           </td>
+          <td class="memname">void fors_dark_define_parameters </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Define recipe parameters. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameter list to fill </td></tr>
+<p>Define recipe parameters. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>parameter list to fill </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__dark__impl_8c-source.html#l00071">71</a> of file <a class="el" href="fors__dark__impl_8c-source.html">fors_dark_impl.c</a>.
-<p>
-References <a class="el" href="fors__dark__impl_8c-source.html#l00046">fors_dark_name</a>, and <a class="el" href="fors__stack_8c-source.html#l00055">fors_stack_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__dark_8c-source.html#l00109">fors_dark_create()</a>, and <a class="el" href="fors__dark-test_8c-source.html#l00062">test_dark()</a>.
+<p>Definition at line <a class="el" href="fors__dark__impl_8c_source.html#l00071">71</a> of file <a class="el" href="fors__dark__impl_8c_source.html">fors_dark_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__stack_8c_source.html#l00055">fors_stack_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dark_8c_source.html#l00109">fors_dark_create()</a>, and <a class="el" href="fors__dark-test_8c_source.html#l00062">test_dark()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g605a72777b8ade477948b511ec213dba"></a><!-- doxytag: member="fors_dark_impl.c::fors_dark" ref="g605a72777b8ade477948b511ec213dba" args="(cpl_frameset *frames, const cpl_parameterlist *parameters)" -->
+</div>
+<a class="anchor" id="ga5b25632b185b390afe047835ef04708c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_dark           </td>
+          <td class="memname">void fors_dark </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em></td><td> </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Do the processing. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>input frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameters</td></tr>
+<p>Do the processing. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>input frames </td></tr>
+    <tr><td class="paramname">parameters</td><td>parameters</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__dark__impl_8c_source.html#l00103">103</a> of file <a class="el" href="fors__dark__impl_8c_source.html">fors_dark_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__dfs_8c_source.html#l01200">fors_dfs_save_image_err()</a>, <a class="el" href="fors__utils_8c_source.html#l00468">fors_frameset_extract()</a>, <a class="el" href="fors__image_8c_source.html#l00352">fors_image_load()</a>, <a class="el" href="fors__image_8c_source.html#l00316">fors_image_load_list_const()</a>, <a class="el" href="fors__setting_8c_source.html#l00064">fors_setting_new()</a>, <a [...]
 
-<p>
-Definition at line <a class="el" href="fors__dark__impl_8c-source.html#l00103">103</a> of file <a class="el" href="fors__dark__impl_8c-source.html">fors_dark_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00046">fors_dark_name</a>, <a class="el" href="fors__dfs_8c-source.html#l01164">fors_dfs_save_image()</a>, <a class="el" href="fors__utils_8c-source.html#l00468">fors_frameset_extract()</a>, <a class="el" href="fors__image_8c-source.html#l00349">fors_image_load()</a>, <a class="el" href="fors__ [...]
-<p>
-Referenced by <a class="el" href="fors__dark_8c-source.html#l00158">fors_dark_exec()</a>, and <a class="el" href="fors__dark-test_8c-source.html#l00062">test_dark()</a>.
+<p>Referenced by <a class="el" href="fors__dark_8c_source.html#l00158">fors_dark_exec()</a>, and <a class="el" href="fors__dark-test_8c_source.html#l00062">test_dark()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g4abb403976fc3ddcaa614c59a44590c9"></a><!-- doxytag: member="fors_dark.c::cpl_plugin_get_info" ref="g4abb403976fc3ddcaa614c59a44590c9" args="(cpl_pluginlist *list)" -->
+<a class="anchor" id="ga31d1fccd4cd15b1c1f3c5edc8cb18693"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int cpl_plugin_get_info           </td>
+          <td class="memname">int cpl_plugin_get_info </td>
           <td>(</td>
-          <td class="paramtype">cpl_pluginlist * </td>
-          <td class="paramname"> <em>list</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_pluginlist * </td>
+          <td class="paramname"><em>list</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Build the list of available plugins, for this module. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>The plugin list</td></tr>
+<p>Build the list of available plugins, for this module. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">list</td><td>The plugin list</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
-Create the recipe instance and make it available to the application using the interface. This function is exported. 
-<p>
-Definition at line <a class="el" href="fors__dark_8c-source.html#l00062">62</a> of file <a class="el" href="fors__dark_8c-source.html">fors_dark.c</a>.
-<p>
-References <a class="el" href="fors__dark__impl_8c-source.html#l00048">fors_dark_author</a>, <a class="el" href="fors__dark_8c-source.html#l00109">fors_dark_create()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00050">fors_dark_description</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00047">fors_dark_description_short</a>, <a class="el" href="fors__dark_8c-source.html#l00207">fors_dark_destroy()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00049">fo [...]
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<p>Create the recipe instance and make it available to the application using the interface. This function is exported. </p>
+
+<p>Definition at line <a class="el" href="fors__dark_8c_source.html#l00062">62</a> of file <a class="el" href="fors__dark_8c_source.html">fors_dark.c</a>.</p>
+
+<p>References <a class="el" href="fors__dark_8c_source.html#l00109">fors_dark_create()</a>, <a class="el" href="fors__dark_8c_source.html#l00207">fors_dark_destroy()</a>, <a class="el" href="fors__dark_8c_source.html#l00158">fors_dark_exec()</a>, <a class="el" href="fors__utils_8c_source.html#l00065">fors_get_license()</a>, and <a class="el" href="fors__utils_8c_source.html#l00107">fors_get_version_binary()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gd82957e2524a2c840c990e6f6ac7a3f7"></a><!-- doxytag: member="fors_dark.c::fors_dark_create" ref="gd82957e2524a2c840c990e6f6ac7a3f7" args="(cpl_plugin *plugin)" -->
+</div>
+<a class="anchor" id="gac68c5042f96db84bf22ca9d3c93f2015"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_dark_create           </td>
+          <td class="memname">static int fors_dark_create </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Setup the recipe options. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+<p>Setup the recipe options. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok</dd></dl>
-Defining the command-line/configuration parameters for the recipe. 
-<p>
-Definition at line <a class="el" href="fors__dark_8c-source.html#l00109">109</a> of file <a class="el" href="fors__dark_8c-source.html">fors_dark.c</a>.
-<p>
-References <a class="el" href="fors__dark__impl_8c-source.html#l00071">fors_dark_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__dark_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok</dd></dl>
+<p>Defining the command-line/configuration parameters for the recipe. </p>
+
+<p>Definition at line <a class="el" href="fors__dark_8c_source.html#l00109">109</a> of file <a class="el" href="fors__dark_8c_source.html">fors_dark.c</a>.</p>
+
+<p>References <a class="el" href="fors__dark__impl_8c_source.html#l00071">fors_dark_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dark_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gb03c103664e7d1ac06cf5819293024da"></a><!-- doxytag: member="fors_dark.c::fors_dark_exec" ref="gb03c103664e7d1ac06cf5819293024da" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="gaff0761c9cc96530ee12377f1f014e069"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_dark_exec           </td>
+          <td class="memname">static int fors_dark_exec </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Execute the plugin instance given by the interface. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>the plugin</td></tr>
+<p>Execute the plugin instance given by the interface. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>the plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__dark_8c_source.html#l00158">158</a> of file <a class="el" href="fors__dark_8c_source.html">fors_dark.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dark__impl_8c_source.html#l00103">fors_dark()</a>, and <a class="el" href="fors__dfs_8c_source.html#l00258">fors_end()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__dark_8c-source.html#l00158">158</a> of file <a class="el" href="fors__dark_8c-source.html">fors_dark.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00103">fors_dark()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00047">fors_dark_description_short</a>, and <a class="el" href="fors__dfs_8c-source.html#l00258">fors_end()</a>.
-<p>
-Referenced by <a class="el" href="fors__dark_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<p>Referenced by <a class="el" href="fors__dark_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g0ae3039ae17bbc8695285b04dab01340"></a><!-- doxytag: member="fors_dark.c::fors_dark_destroy" ref="g0ae3039ae17bbc8695285b04dab01340" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="ga828322574faee993a595ecc93dfe5944"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_dark_destroy           </td>
+          <td class="memname">static int fors_dark_destroy </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Destroy what has been created by the 'create' function. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+<p>Destroy what has been created by the 'create' function. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__dark_8c_source.html#l00207">207</a> of file <a class="el" href="fors__dark_8c_source.html">fors_dark.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dark_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__dark_8c-source.html#l00207">207</a> of file <a class="el" href="fors__dark_8c-source.html">fors_dark.c</a>.
-<p>
-Referenced by <a class="el" href="fors__dark_8c-source.html#l00062">cpl_plugin_get_info()</a>.
 </div>
-</div><p>
-<hr><h2>Variable Documentation</h2>
-<a class="anchor" name="g6ca1a4a04494b527e073c4fcfc78d074"></a><!-- doxytag: member="fors_dark_impl.c::fors_dark_description" ref="g6ca1a4a04494b527e073c4fcfc78d074" args="" -->
+</div>
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="gae85f9c301c16078b04136f0117be92d7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* const <a class="el" href="group__fors__dark.html#g6ca1a4a04494b527e073c4fcfc78d074">fors_dark_description</a>          </td>
+          <td class="memname">const char* const fors_dark_description</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">=</div>
+<div class="line"><span class="stringliteral">"This recipe is used to combine input raw DARK frames into a master dark\n"</span></div>
+<div class="line"><span class="stringliteral">"frame by subtracing the master bias and using the given stacking method.\n"</span></div>
+<div class="line"><span class="stringliteral">"The overscan regions, if present, are removed from the result.\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+<div class="line"><span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><span class="stringliteral">"  DARK                       Raw         Dark frame              Y\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias             Y\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+<div class="line"><span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_DARK                FITS image  Master dark frame\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__dark__impl_8c_source.html#l00050">50</a> of file <a class="el" href="fors__dark__impl_8c_source.html">fors_dark_impl.c</a>.</p>
 
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment">
-<span class="stringliteral">"This recipe is used to combine input raw DARK frames into a master dark\n"</span>
-<span class="stringliteral">"frame by subtracing the master bias and using the given stacking method.\n"</span>
-<span class="stringliteral">"The overscan regions, if present, are removed from the result.\n"</span>
-<span class="stringliteral">"\n"</span>
-<span class="stringliteral">"Input files:\n"</span>
-<span class="stringliteral">"\n"</span>
-<span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<span class="stringliteral">"  DARK                       Raw         Dark frame              Y\n"</span>
-<span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias             Y\n"</span>
-<span class="stringliteral">"\n"</span>
-<span class="stringliteral">"Output files:\n"</span>
-<span class="stringliteral">"\n"</span>
-<span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<span class="stringliteral">"  MASTER_DARK                FITS image  Master dark frame\n"</span>
-<span class="stringliteral">"\n"</span>
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__dark__impl_8c-source.html#l00050">50</a> of file <a class="el" href="fors__dark__impl_8c-source.html">fors_dark_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__dark_8c-source.html#l00062">cpl_plugin_get_info()</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__dark__test.html b/html/group__fors__dark__test.html
index a04be76..f7ef140 100644
--- a/html/group__fors__dark__test.html
+++ b/html/group__fors__dark__test.html
@@ -1,61 +1,96 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: test of master dark recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>test of master dark recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g373bdc8eb6b8f1c0a07dfd8bad5a8933"></a><!-- doxytag: member="fors_dark_test::test_dark" ref="g373bdc8eb6b8f1c0a07dfd8bad5a8933" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark__test.html#g373bdc8eb6b8f1c0a07dfd8bad5a8933">test_dark</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test dark recipe. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_dark_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of image module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_dark-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">test of master dark recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga6b1c753a8c15cc5119ef13fda435ecbf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6b1c753a8c15cc5119ef13fda435ecbf"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark__test.html#ga6b1c753a8c15cc5119ef13fda435ecbf">test_dark</a> (void)</td></tr>
+<tr class="memdesc:ga6b1c753a8c15cc5119ef13fda435ecbf"><td class="mdescLeft"> </td><td class="mdescRight">Test dark recipe. <br/></td></tr>
+<tr class="separator:ga6b1c753a8c15cc5119ef13fda435ecbf"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__dark__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of image module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(frames); \</div>
+<div class="line">    cpl_parameterlist_delete(parameters); \</div>
+<div class="line">    fors_image_delete(&raw_dark); \</div>
+<div class="line">    fors_image_delete(&master_dark); \</div>
+<div class="line">    fors_image_delete(&master_bias); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__dark-test_8c_source.html#l00048">48</a> of file <a class="el" href="fors__dark-test_8c_source.html">fors_dark-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(frames); \
-    cpl_parameterlist_delete(parameters); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&raw_dark); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_dark); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_bias); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__dark-test_8c-source.html#l00048">48</a> of file <a class="el" href="fors__dark-test_8c-source.html">fors_dark-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__double.html b/html/group__fors__double.html
index 4ef20a5..ef48ebd 100644
--- a/html/group__fors__double.html
+++ b/html/group__fors__double.html
@@ -1,23 +1,53 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: floating point values</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>floating point values</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-This module exists in order to allow operations on a container of doubles <hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">floating point values</div>  </div>
+</div><!--header-->
+<div class="contents">
+<p>This module exists in order to allow operations on a container of doubles </p>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__extract.html b/html/group__fors__extract.html
index 77412ec..c8a2a85 100644
--- a/html/group__fors__extract.html
+++ b/html/group__fors__extract.html
@@ -1,509 +1,555 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Image source extraction</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Image source extraction</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__extract__method.html">_extract_method</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_extract::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_extract::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static fors_star_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#g5237e1161aeef9d828a973333151a36f">extract_sex</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, const char *sex_exe, const char *sex_config, const char *sex_mag, const char *sex_magerr, int radius, [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract sources using SExtractor.  <a href="#g5237e1161aeef9d828a973333151a36f"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static fors_star_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#gedc4ee1e5daa54e4859e929c7ff51f59">extract_test</a> (<a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats, cpl_image **background, cpl_table **extracted_sources)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract sources.  <a href="#gedc4ee1e5daa54e4859e929c7ff51f59"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#gcdd189ebaad6fe5c20ac2dea2eb06dfe">fors_extract_check_sex_flag</a> (unsigned int sex_flag)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Check SExtractor object feature: FLAG.  <a href="#gcdd189ebaad6fe5c20ac2dea2eb06dfe"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#g2c649f2f8802860d4693e38bd640032c">fors_extract_check_sex_star</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *star, const cpl_image *ref_img)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Check a sextracted star for validity.  <a href="#g2c649f2f8802860d4693e38bd640032c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#gd07fd085541e8be0723f2932a29abdb3">fors_extract_define_parameters</a> (cpl_parameterlist *parameters, const char *context)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#gd07fd085541e8be0723f2932a29abdb3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">extract_method * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#g1f3f1af725e7b5fb1c770507eab8ac09">fors_extract_method_new</a> (const cpl_parameterlist *parameters, const char *context)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get extraction method from parameter list.  <a href="#g1f3f1af725e7b5fb1c770507eab8ac09"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2f7149d890f135097366c9389cab25fe"></a><!-- doxytag: member="fors_extract::fors_extract_method_delete" ref="g2f7149d890f135097366c9389cab25fe" args="(extract_method **em)" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#g2f7149d890f135097366c9389cab25fe">fors_extract_method_delete</a> (extract_method **em)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Deallocate extraction method and set the pointer to NULL. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">fors_star_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1">fors_extract</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, const extract_method *em, double magsyserr, <a class="el" href="structfors__extract__sky__stats.html">fors_ [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract sources.  <a href="#g885eea7c483f6fb87cb1751f62ef11c1"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors/fors_extract.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Data Structures</a> |
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Image source extraction</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__extract__method.html">_extract_method</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga179ba42491f97607c78d677e432614a7"><td class="memItemLeft" align="right" valign="top">static fors_star_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#ga179ba42491f97607c78d677e432614a7">extract_sex</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, const char *sex_exe, const char *sex_config, const char  [...]
+<tr class="memdesc:ga179ba42491f97607c78d677e432614a7"><td class="mdescLeft"> </td><td class="mdescRight">Extract sources using SExtractor.  <a href="#ga179ba42491f97607c78d677e432614a7">More...</a><br/></td></tr>
+<tr class="separator:ga179ba42491f97607c78d677e432614a7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6a2e3af8f65f79d338c6f0c46931b89d"><td class="memItemLeft" align="right" valign="top">static fors_star_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#ga6a2e3af8f65f79d338c6f0c46931b89d">extract_test</a> (<a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> *sky_stats, cpl_image **background, cpl_table **extracted_sources)</td></tr>
+<tr class="memdesc:ga6a2e3af8f65f79d338c6f0c46931b89d"><td class="mdescLeft"> </td><td class="mdescRight">Extract sources.  <a href="#ga6a2e3af8f65f79d338c6f0c46931b89d">More...</a><br/></td></tr>
+<tr class="separator:ga6a2e3af8f65f79d338c6f0c46931b89d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0753c9c8f5c40f594ebc0628407df2d4"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#ga0753c9c8f5c40f594ebc0628407df2d4">fors_extract_check_sex_flag</a> (unsigned int sex_flag)</td></tr>
+<tr class="memdesc:ga0753c9c8f5c40f594ebc0628407df2d4"><td class="mdescLeft"> </td><td class="mdescRight">Check SExtractor object feature: FLAG.  <a href="#ga0753c9c8f5c40f594ebc0628407df2d4">More...</a><br/></td></tr>
+<tr class="separator:ga0753c9c8f5c40f594ebc0628407df2d4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab2bb9e07066870dd90dadd6044803dd0"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#gab2bb9e07066870dd90dadd6044803dd0">fors_extract_check_sex_star</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *star, const cpl_image *ref_img)</td></tr>
+<tr class="memdesc:gab2bb9e07066870dd90dadd6044803dd0"><td class="mdescLeft"> </td><td class="mdescRight">Check a sextracted star for validity.  <a href="#gab2bb9e07066870dd90dadd6044803dd0">More...</a><br/></td></tr>
+<tr class="separator:gab2bb9e07066870dd90dadd6044803dd0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2fe71423afa3cceea5d92dd3b49aca1e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#ga2fe71423afa3cceea5d92dd3b49aca1e">fors_extract_define_parameters</a> (cpl_parameterlist *parameters, const char *context)</td></tr>
+<tr class="memdesc:ga2fe71423afa3cceea5d92dd3b49aca1e"><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#ga2fe71423afa3cceea5d92dd3b49aca1e">More...</a><br/></td></tr>
+<tr class="separator:ga2fe71423afa3cceea5d92dd3b49aca1e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9b1d727905c3cb3f7740900ffaba6b57"><td class="memItemLeft" align="right" valign="top">extract_method * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#ga9b1d727905c3cb3f7740900ffaba6b57">fors_extract_method_new</a> (const cpl_parameterlist *parameters, const char *context)</td></tr>
+<tr class="memdesc:ga9b1d727905c3cb3f7740900ffaba6b57"><td class="mdescLeft"> </td><td class="mdescRight">Get extraction method from parameter list.  <a href="#ga9b1d727905c3cb3f7740900ffaba6b57">More...</a><br/></td></tr>
+<tr class="separator:ga9b1d727905c3cb3f7740900ffaba6b57"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga11354d3d250769e1adb67e1a2dbc1a96"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga11354d3d250769e1adb67e1a2dbc1a96"></a>
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#ga11354d3d250769e1adb67e1a2dbc1a96">fors_extract_method_delete</a> (extract_method **em)</td></tr>
+<tr class="memdesc:ga11354d3d250769e1adb67e1a2dbc1a96"><td class="mdescLeft"> </td><td class="mdescRight">Deallocate extraction method and set the pointer to NULL. <br/></td></tr>
+<tr class="separator:ga11354d3d250769e1adb67e1a2dbc1a96"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7b1fcb810d3b1a5f3077a404c7a01a05"><td class="memItemLeft" align="right" valign="top">fors_star_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05">fors_extract</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, const extract_method *em, double magsyserr, <a class="el" href [...]
+<tr class="memdesc:ga7b1fcb810d3b1a5f3077a404c7a01a05"><td class="mdescLeft"> </td><td class="mdescRight">Extract sources.  <a href="#ga7b1fcb810d3b1a5f3077a404c7a01a05">More...</a><br/></td></tr>
+<tr class="separator:ga7b1fcb810d3b1a5f3077a404c7a01a05"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)name); \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)method); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors_2fors__extract_8c_source.html#l00852">852</a> of file <a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_free((<span class="keywordtype">void</span> *)name); \
-    cpl_free((<span class="keywordtype">void</span> *)method); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors_2fors__extract_8c-source.html#l00852">852</a> of file <a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors/fors_extract.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_table_delete(out); out = NULL; \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)command); \</div>
+<div class="line">    cpl_image_delete(work_back); work_back = NULL; \</div>
+<div class="line">    cpl_image_delete(bmaxsigma); bmaxsigma = NULL; \</div>
+<div class="line">    cpl_image_delete(bsigma); bsigma = NULL; \</div>
+<div class="line">    fors_image_delete(&fbsigma); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors_2fors__extract_8c_source.html#l00852">852</a> of file <a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_table_delete(out); out = NULL; \
-    cpl_free((<span class="keywordtype">void</span> *)command); \
-    cpl_image_delete(work_back); work_back = NULL; \
-    cpl_image_delete(bmaxsigma); bmaxsigma = NULL; \
-    cpl_image_delete(bsigma); bsigma = NULL; \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&fbsigma); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors_2fors__extract_8c-source.html#l00852">852</a> of file <a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g5237e1161aeef9d828a973333151a36f"></a><!-- doxytag: member="fors/fors_extract.c::extract_sex" ref="g5237e1161aeef9d828a973333151a36f" args="(const fors_image *image, const fors_setting *setting, const char *sex_exe, const char *sex_config, const char *sex_mag, const char *sex_magerr, int radius, double magsyserr, fors_extract_sky_stats *sky_stats, cpl_image **background, cpl_table **extracted_sources)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga179ba42491f97607c78d677e432614a7"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static fors_star_list * extract_sex           </td>
+          <td class="memname">static fors_star_list * extract_sex </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>sex_exe</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>sex_exe</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>sex_config</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>sex_config</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>sex_mag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>sex_mag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>sex_magerr</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>sex_magerr</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>radius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>radius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>magsyserr</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>magsyserr</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype"><a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> * </td>
-          <td class="paramname"> <em>sky_stats</em>, </td>
+          <td class="paramtype"><a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> * </td>
+          <td class="paramname"><em>sky_stats</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image ** </td>
-          <td class="paramname"> <em>background</em>, </td>
+          <td class="paramtype">cpl_image ** </td>
+          <td class="paramname"><em>background</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table ** </td>
-          <td class="paramname"> <em>extracted_sources</em></td><td> </td>
+          <td class="paramtype">cpl_table ** </td>
+          <td class="paramname"><em>extracted_sources</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Extract sources using SExtractor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>source image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>instrument setting (gain) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sex_exe</em> </td><td>SExtractor executable </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sex_config</em> </td><td>SExtractor configuration file </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sex_mag</em> </td><td>SExtractor catalog magnitude </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sex_magerr</em> </td><td>SExtractor catalog magnitude error </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>radius</em> </td><td>background error map median filter radius </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sky_stats</em> </td><td>(output) statistics on determined sky </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>background</em> </td><td>(output) background image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>extracted_sources</em> </td><td>(output) if non-NULL, SExtractor output table </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Extract sources using SExtractor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>source image </td></tr>
+    <tr><td class="paramname">setting</td><td>instrument setting (gain) </td></tr>
+    <tr><td class="paramname">sex_exe</td><td>SExtractor executable </td></tr>
+    <tr><td class="paramname">sex_config</td><td>SExtractor configuration file </td></tr>
+    <tr><td class="paramname">sex_mag</td><td>SExtractor catalog magnitude </td></tr>
+    <tr><td class="paramname">sex_magerr</td><td>SExtractor catalog magnitude error </td></tr>
+    <tr><td class="paramname">radius</td><td>background error map median filter radius </td></tr>
+    <tr><td class="paramname">sky_stats</td><td>(output) statistics on determined sky </td></tr>
+    <tr><td class="paramname">background</td><td>(output) background image </td></tr>
+    <tr><td class="paramname">extracted_sources</td><td>(output) if non-NULL, SExtractor output table </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated list of stars</dd></dl>
-Note: The gain given in the setting must describe the image. Therefore, if the provided value of the gain is just the detector gain, the input image must not be stacked or normalized to e.g. 1s exposure time.<p>
-A background error map is given to SExtractor. This error map is obtained by applying a median filter to the input image error map (in order to remove sources). 
-<p>
-Definition at line <a class="el" href="fors_2fors__extract_8c-source.html#l00431">431</a> of file <a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__setting_8h-source.html#l00067">_fors_setting::average_gain</a>, <a class="el" href="fors__setting_8h-source.html#l00049">_fors_setting::binx</a>, <a class="el" href="fors__setting_8h-source.html#l00049">_fors_setting::biny</a>, <a class="el" href="fors__setting_8h-source.html#l00074">_fors_setting::chip_id</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class= [...]
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00365">fors_extract()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated list of stars</dd></dl>
+<p>Note: The gain given in the setting must describe the image. Therefore, if the provided value of the gain is just the detector gain, the input image must not be stacked or normalized to e.g. 1s exposure time.</p>
+<p>A background error map is given to SExtractor. This error map is obtained by applying a median filter to the input image error map (in order to remove sources). </p>
+
+<p>Definition at line <a class="el" href="fors_2fors__extract_8c_source.html#l00431">431</a> of file <a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors_2fors__extract_8c_source.html#l00100">fors_extract_check_sex_flag()</a>, <a class="el" href="fors_2fors__extract_8c_source.html#l00122">fors_extract_check_sex_star()</a>, <a class="el" href="fors__image_8c_source.html#l01213">fors_image_crop()</a>, <a class="el" href="fors__image_8c_source.html#l00188">fors_image_delete()</a>, <a class="el" href="fors__image_8c_source.html#l00175">fors_imag [...]
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00365">fors_extract()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gedc4ee1e5daa54e4859e929c7ff51f59"></a><!-- doxytag: member="fors/fors_extract.c::extract_test" ref="gedc4ee1e5daa54e4859e929c7ff51f59" args="(fors_extract_sky_stats *sky_stats, cpl_image **background, cpl_table **extracted_sources)" -->
+<a class="anchor" id="ga6a2e3af8f65f79d338c6f0c46931b89d"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static fors_star_list * extract_test           </td>
+          <td class="memname">static fors_star_list * extract_test </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> * </td>
-          <td class="paramname"> <em>sky_stats</em>, </td>
+          <td class="paramtype"><a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> * </td>
+          <td class="paramname"><em>sky_stats</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image ** </td>
-          <td class="paramname"> <em>background</em>, </td>
+          <td class="paramtype">cpl_image ** </td>
+          <td class="paramname"><em>background</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table ** </td>
-          <td class="paramname"> <em>extracted_sources</em></td><td> </td>
+          <td class="paramtype">cpl_table ** </td>
+          <td class="paramname"><em>extracted_sources</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Extract sources. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>sky_stats</em> </td><td>(output) sky statistics </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>background</em> </td><td>(output) background </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>extracted_sources</em> </td><td>(output) if non-NULL, table of sources </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Extract sources. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">sky_stats</td><td>(output) sky statistics </td></tr>
+    <tr><td class="paramname">background</td><td>(output) background </td></tr>
+    <tr><td class="paramname">extracted_sources</td><td>(output) if non-NULL, table of sources </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated list of extracted stars</dd></dl>
-The star positions are hardcoded!<p>
-This method is used only for testing without relying on external packages 
-<p>
-Definition at line <a class="el" href="fors_2fors__extract_8c-source.html#l00867">867</a> of file <a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__tools_8c-source.html#l00130">fors_create_sources_table()</a>, <a class="el" href="fors__star_8c-source.html#l00114">fors_star_new()</a>, <a class="el" href="fors__extract_8h-source.html#l00041">fors_extract_sky_stats::mean</a>, <a class="el" href="fors__extract_8h-source.html#l00041">fors_extract_sky_stats::median</a>, and <a class="el" href="fors__extract_8h-source.html#l00041">fors_extract_ [...]
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00365">fors_extract()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated list of extracted stars</dd></dl>
+<p>The star positions are hardcoded!</p>
+<p>This method is used only for testing without relying on external packages </p>
+
+<p>Definition at line <a class="el" href="fors_2fors__extract_8c_source.html#l00867">867</a> of file <a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__tools_8c_source.html#l00130">fors_create_sources_table()</a>, and <a class="el" href="fors__star_8c_source.html#l00114">fors_star_new()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00365">fors_extract()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gcdd189ebaad6fe5c20ac2dea2eb06dfe"></a><!-- doxytag: member="fors/fors_extract.c::fors_extract_check_sex_flag" ref="gcdd189ebaad6fe5c20ac2dea2eb06dfe" args="(unsigned int sex_flag)" -->
+<a class="anchor" id="ga0753c9c8f5c40f594ebc0628407df2d4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">bool fors_extract_check_sex_flag           </td>
+          <td class="memname">bool fors_extract_check_sex_flag </td>
           <td>(</td>
-          <td class="paramtype">unsigned int </td>
-          <td class="paramname"> <em>sex_flag</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">unsigned int </td>
+          <td class="paramname"><em>sex_flag</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Check SExtractor object feature: FLAG. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>SExtractor</em> </td><td>object's binary contamination flags </td></tr>
+</div><div class="memdoc">
+
+<p>Check SExtractor object feature: FLAG. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">SExtractor</td><td>object's binary contamination flags </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>1 if successful, 0 on failure</dd></dl>
-All FLAGS 1, 2, 4, ..., 128 are severe enough that we do not want to use the source for photometry see SExtractor doc. for the meaning of each flag. 
-<p>
-Definition at line <a class="el" href="fors_2fors__extract_8c-source.html#l00100">100</a> of file <a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>.
+<dl class="section return"><dt>Returns</dt><dd>1 if successful, 0 on failure</dd></dl>
+<p>All FLAGS 1, 2, 4, ..., 128 are severe enough that we do not want to use the source for photometry see SExtractor doc. for the meaning of each flag. </p>
+
+<p>Definition at line <a class="el" href="fors_2fors__extract_8c_source.html#l00100">100</a> of file <a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g2c649f2f8802860d4693e38bd640032c"></a><!-- doxytag: member="fors/fors_extract.c::fors_extract_check_sex_star" ref="g2c649f2f8802860d4693e38bd640032c" args="(const fors_star *star, const cpl_image *ref_img)" -->
+</div>
+<a class="anchor" id="gab2bb9e07066870dd90dadd6044803dd0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">bool fors_extract_check_sex_star           </td>
+          <td class="memname">bool fors_extract_check_sex_star </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>star</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>star</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_image * </td>
-          <td class="paramname"> <em>ref_img</em></td><td> </td>
+          <td class="paramtype">const cpl_image * </td>
+          <td class="paramname"><em>ref_img</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Check a sextracted star for validity. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>star</em> </td><td>(S)Extracted star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ref_img</em> </td><td>(Optional) reference image (to check for image range) </td></tr>
+</div><div class="memdoc">
+
+<p>Check a sextracted star for validity. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">star</td><td>(S)Extracted star </td></tr>
+    <tr><td class="paramname">ref_img</td><td>(Optional) reference image (to check for image range) </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>1 if successful, 0 on failure</dd></dl>
-The following SExtractor failures are caught:<ul>
-<li>Check for allowed general parameters using <a class="el" href="group__fors__star.html#g1ef535783913303ad950792cdd1d59c8">fors_star_check_values()</a></li><li>Invalid SExtractor magnitude (can be 99.0)</li><li>(x, y) out of range (if <em>ref_img</em> != NULL)</li></ul>
-
-<p>
-Definition at line <a class="el" href="fors_2fors__extract_8c-source.html#l00122">122</a> of file <a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a>.
-<p>
-References <a class="el" href="fors__star_8c-source.html#l00227">fors_star_check_values()</a>, <a class="el" href="fors__star_8h-source.html#l00044">_fors_star::magnitude</a>, and <a class="el" href="fors__star_8h-source.html#l00037">_fors_star::pixel</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l02756">fors_photometry_read_input()</a>.
+<dl class="section return"><dt>Returns</dt><dd>1 if successful, 0 on failure</dd></dl>
+<p>The following SExtractor failures are caught:</p>
+<ul>
+<li>Check for allowed general parameters using <a class="el" href="group__fors__star.html#ga279f39755ddfa24ee9cfad4a03c01cf3" title="Copy constructor.">fors_star_check_values()</a></li>
+<li>Invalid SExtractor magnitude (can be 99.0)</li>
+<li>(x, y) out of range (if <em>ref_img</em> != NULL)</li>
+</ul>
+
+<p>Definition at line <a class="el" href="fors_2fors__extract_8c_source.html#l00122">122</a> of file <a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a>.</p>
+
+<p>References <a class="el" href="fors__star_8c_source.html#l00227">fors_star_check_values()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l02698">fors_photometry_read_input()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gd07fd085541e8be0723f2932a29abdb3"></a><!-- doxytag: member="fors/fors_extract.c::fors_extract_define_parameters" ref="gd07fd085541e8be0723f2932a29abdb3" args="(cpl_parameterlist *parameters, const char *context)" -->
+<a class="anchor" id="ga2fe71423afa3cceea5d92dd3b49aca1e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_extract_define_parameters           </td>
+          <td class="memname">void fors_extract_define_parameters </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>, </td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>context</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>context</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Define recipe parameters. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameter list to fill </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>parameters context </td></tr>
+</div><div class="memdoc">
+
+<p>Define recipe parameters. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>parameter list to fill </td></tr>
+    <tr><td class="paramname">context</td><td>parameters context </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors_2fors__extract_8c-source.html#l00153">153</a> of file <a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00089">fors_img_science_define_parameters()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00124">fors_zeropoint_define_parameters()</a>.
+<p>Definition at line <a class="el" href="fors_2fors__extract_8c_source.html#l00153">153</a> of file <a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00089">fors_img_science_define_parameters()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00124">fors_zeropoint_define_parameters()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g1f3f1af725e7b5fb1c770507eab8ac09"></a><!-- doxytag: member="fors/fors_extract.c::fors_extract_method_new" ref="g1f3f1af725e7b5fb1c770507eab8ac09" args="(const cpl_parameterlist *parameters, const char *context)" -->
+</div>
+<a class="anchor" id="ga9b1d727905c3cb3f7740900ffaba6b57"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">extract_method* fors_extract_method_new           </td>
+          <td class="memname">extract_method* fors_extract_method_new </td>
           <td>(</td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>context</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>context</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get extraction method from parameter list. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>recipe parameter list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>read extraction method from this context </td></tr>
+</div><div class="memdoc">
+
+<p>Get extraction method from parameter list. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>recipe parameter list </td></tr>
+    <tr><td class="paramname">context</td><td>read extraction method from this context </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated extraction method</dd></dl>
-The parameter list should have been previously created using <a class="el" href="group__fors__extract.html#gd07fd085541e8be0723f2932a29abdb3">fors_extract_define_parameters()</a> 
-<p>
-Definition at line <a class="el" href="fors_2fors__extract_8c-source.html#l00258">258</a> of file <a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__dfs_8c-source.html#l00809">dfs_get_parameter_int_const()</a>, and <a class="el" href="fors__dfs_8c-source.html#l00829">dfs_get_parameter_string_const()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated extraction method</dd></dl>
+<p>The parameter list should have been previously created using <a class="el" href="group__fors__extract.html#ga2fe71423afa3cceea5d92dd3b49aca1e" title="Define recipe parameters.">fors_extract_define_parameters()</a> </p>
+
+<p>Definition at line <a class="el" href="fors_2fors__extract_8c_source.html#l00258">258</a> of file <a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__dfs_8c_source.html#l00809">dfs_get_parameter_int_const()</a>, and <a class="el" href="fors__dfs_8c_source.html#l00829">dfs_get_parameter_string_const()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g885eea7c483f6fb87cb1751f62ef11c1"></a><!-- doxytag: member="fors/fors_extract.c::fors_extract" ref="g885eea7c483f6fb87cb1751f62ef11c1" args="(const fors_image *image, const fors_setting *setting, const extract_method *em, double magsyserr, fors_extract_sky_stats *sky_stats, cpl_image **background, cpl_table **extracted_sources)" -->
+<a class="anchor" id="ga7b1fcb810d3b1a5f3077a404c7a01a05"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">fors_star_list* fors_extract           </td>
+          <td class="memname">fors_star_list* fors_extract </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const extract_method * </td>
-          <td class="paramname"> <em>em</em>, </td>
+          <td class="paramtype">const extract_method * </td>
+          <td class="paramname"><em>em</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>magsyserr</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>magsyserr</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype"><a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> * </td>
-          <td class="paramname"> <em>sky_stats</em>, </td>
+          <td class="paramtype"><a class="el" href="structfors__extract__sky__stats.html">fors_extract_sky_stats</a> * </td>
+          <td class="paramname"><em>sky_stats</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image ** </td>
-          <td class="paramname"> <em>background</em>, </td>
+          <td class="paramtype">cpl_image ** </td>
+          <td class="paramname"><em>background</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table ** </td>
-          <td class="paramname"> <em>extracted_sources</em></td><td> </td>
+          <td class="paramtype">cpl_table ** </td>
+          <td class="paramname"><em>extracted_sources</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Extract sources. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>source image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>instrument setting (gain) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>em</em> </td><td>extraction method to use </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sky_stats</em> </td><td>(output) statistics on determined sky </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>background</em> </td><td>(output) inferred background image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>extracted_sources</em> </td><td>(output) if non-NULL, table of extracted sources </td></tr>
+</div><div class="memdoc">
+
+<p>Extract sources. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>source image </td></tr>
+    <tr><td class="paramname">setting</td><td>instrument setting (gain) </td></tr>
+    <tr><td class="paramname">em</td><td>extraction method to use </td></tr>
+    <tr><td class="paramname">sky_stats</td><td>(output) statistics on determined sky </td></tr>
+    <tr><td class="paramname">background</td><td>(output) inferred background image </td></tr>
+    <tr><td class="paramname">extracted_sources</td><td>(output) if non-NULL, table of extracted sources </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated list of extracted stars </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>newly allocated list of extracted stars </dd></dl>
 
-<p>
-Definition at line <a class="el" href="fors_2fors__extract_8c-source.html#l00365">365</a> of file <a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
+<p>Definition at line <a class="el" href="fors_2fors__extract_8c_source.html#l00365">365</a> of file <a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>, and <a class="el" href="fors_2fors__extract_8c_source.html#l00867">extract_test()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__identify.html b/html/group__fors__identify.html
index cb20896..13c79a3 100644
--- a/html/group__fors__identify.html
+++ b/html/group__fors__identify.html
@@ -1,602 +1,669 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Source identification</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Source identification</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__identify__method.html">_identify_method</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#gdfc439dadf11b131119fe17cb19f6e25">inside_region</a> (const fors_std_star *std, void *reg)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Determine if star is inside region.  <a href="#gdfc439dadf11b131119fe17cb19f6e25"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g3c4ce99ce7472d6d48acffcf562b0fb7">match_patterns</a> (const fors_star_list *stars, const fors_std_star_list *std, double kappa, double *sx_00, double *sy_00, double *med_scale, double *med_angle, int *status)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Match patterns.  <a href="#g3c4ce99ce7472d6d48acffcf562b0fb7"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g62b335e73ad633535e1494f9ffd0cd03">fors_identify_define_parameters</a> (cpl_parameterlist *parameters, const char *context)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#g62b335e73ad633535e1494f9ffd0cd03"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">identify_method * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g2763139bd0ceba14e3be219d5d043e46">fors_identify_method_new</a> (const cpl_parameterlist *parameters, const char *context)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get id method from parameter list.  <a href="#g2763139bd0ceba14e3be219d5d043e46"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g265af4d62a463db6eea76b808c2a4e8d"></a><!-- doxytag: member="fors_identify::fors_identify_method_delete" ref="g265af4d62a463db6eea76b808c2a4e8d" args="(identify_method **em)" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g265af4d62a463db6eea76b808c2a4e8d">fors_identify_method_delete</a> (identify_method **em)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Deallocate identifyion method and set the pointer to NULL. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g5e7cadfe27ffb45ccfa00905d520878e">std_brighter_than</a> (const fors_std_star *s1, void *s2)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare brightness.  <a href="#g5e7cadfe27ffb45ccfa00905d520878e"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g4a762f4e872e3f797ba890c9d93eb98c">star_brighter_than</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s1, void *s2)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare brightness.  <a href="#g4a762f4e872e3f797ba890c9d93eb98c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b">distsq_shift</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, const fors_std_star *std, double shiftx, double shifty)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Distance between source and shifted catalog star.  <a href="#g7502079c2fbec8364ec5dfe2e2c6ad9b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#gd13e1eb3050a7a1933760649f74fa14a">star_nearer</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s1, const <a class="el" href="struct__fors__star.html">fors_star</a> *s2, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Tell if a source is closest to a catalog star.  <a href="#gd13e1eb3050a7a1933760649f74fa14a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#g879f2fc7b296f37722f6203d0ead78b6">fors_identify</a> (fors_star_list *stars, fors_std_star_list *cat, const identify_method *im, cpl_image **histogram)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Identify sources.  <a href="#g879f2fc7b296f37722f6203d0ead78b6"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Data Structures</a> |
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Source identification</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__identify__method.html">_identify_method</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga2bf16455ff9dadaa26861905f8999616"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#ga2bf16455ff9dadaa26861905f8999616">inside_region</a> (const fors_std_star *std, void *reg)</td></tr>
+<tr class="memdesc:ga2bf16455ff9dadaa26861905f8999616"><td class="mdescLeft"> </td><td class="mdescRight">Determine if star is inside region.  <a href="#ga2bf16455ff9dadaa26861905f8999616">More...</a><br/></td></tr>
+<tr class="separator:ga2bf16455ff9dadaa26861905f8999616"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabbed61b85afc33d67894bd2dd1f061f3"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#gabbed61b85afc33d67894bd2dd1f061f3">match_patterns</a> (const fors_star_list *stars, const fors_std_star_list *std, double kappa, double *sx_00, double *sy_00, double *med_scale, double *med_angle, int *status)</td></tr>
+<tr class="memdesc:gabbed61b85afc33d67894bd2dd1f061f3"><td class="mdescLeft"> </td><td class="mdescRight">Match patterns.  <a href="#gabbed61b85afc33d67894bd2dd1f061f3">More...</a><br/></td></tr>
+<tr class="separator:gabbed61b85afc33d67894bd2dd1f061f3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac0dc4fbd9cc717256e5972cad3e7447f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#gac0dc4fbd9cc717256e5972cad3e7447f">fors_identify_define_parameters</a> (cpl_parameterlist *parameters, const char *context)</td></tr>
+<tr class="memdesc:gac0dc4fbd9cc717256e5972cad3e7447f"><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#gac0dc4fbd9cc717256e5972cad3e7447f">More...</a><br/></td></tr>
+<tr class="separator:gac0dc4fbd9cc717256e5972cad3e7447f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga642e6d38ae7b273d1901698a3970fd49"><td class="memItemLeft" align="right" valign="top">identify_method * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#ga642e6d38ae7b273d1901698a3970fd49">fors_identify_method_new</a> (const cpl_parameterlist *parameters, const char *context)</td></tr>
+<tr class="memdesc:ga642e6d38ae7b273d1901698a3970fd49"><td class="mdescLeft"> </td><td class="mdescRight">Get id method from parameter list.  <a href="#ga642e6d38ae7b273d1901698a3970fd49">More...</a><br/></td></tr>
+<tr class="separator:ga642e6d38ae7b273d1901698a3970fd49"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaea1f0f7065727f62a6e3a5805549a9ce"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaea1f0f7065727f62a6e3a5805549a9ce"></a>
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#gaea1f0f7065727f62a6e3a5805549a9ce">fors_identify_method_delete</a> (identify_method **em)</td></tr>
+<tr class="memdesc:gaea1f0f7065727f62a6e3a5805549a9ce"><td class="mdescLeft"> </td><td class="mdescRight">Deallocate identifyion method and set the pointer to NULL. <br/></td></tr>
+<tr class="separator:gaea1f0f7065727f62a6e3a5805549a9ce"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1c91776ec58d5026026e00580f18f277"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#ga1c91776ec58d5026026e00580f18f277">std_brighter_than</a> (const fors_std_star *s1, void *s2)</td></tr>
+<tr class="memdesc:ga1c91776ec58d5026026e00580f18f277"><td class="mdescLeft"> </td><td class="mdescRight">Compare brightness.  <a href="#ga1c91776ec58d5026026e00580f18f277">More...</a><br/></td></tr>
+<tr class="separator:ga1c91776ec58d5026026e00580f18f277"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga75bfe0adc06bd97c18925132d4abf937"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#ga75bfe0adc06bd97c18925132d4abf937">star_brighter_than</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s1, void *s2)</td></tr>
+<tr class="memdesc:ga75bfe0adc06bd97c18925132d4abf937"><td class="mdescLeft"> </td><td class="mdescRight">Compare brightness.  <a href="#ga75bfe0adc06bd97c18925132d4abf937">More...</a><br/></td></tr>
+<tr class="separator:ga75bfe0adc06bd97c18925132d4abf937"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0627fa3e8f67fed1bd28cdd65fd19025"><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025">distsq_shift</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, const fors_std_star *std, double shiftx, double shifty)</td></tr>
+<tr class="memdesc:ga0627fa3e8f67fed1bd28cdd65fd19025"><td class="mdescLeft"> </td><td class="mdescRight">Distance between source and shifted catalog star.  <a href="#ga0627fa3e8f67fed1bd28cdd65fd19025">More...</a><br/></td></tr>
+<tr class="separator:ga0627fa3e8f67fed1bd28cdd65fd19025"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga95a6f76b39659c4ce77f5f4ae3366a6f"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#ga95a6f76b39659c4ce77f5f4ae3366a6f">star_nearer</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s1, const <a class="el" href="struct__fors__star.html">fors_star</a> *s2, void *data)</td></tr>
+<tr class="memdesc:ga95a6f76b39659c4ce77f5f4ae3366a6f"><td class="mdescLeft"> </td><td class="mdescRight">Tell if a source is closest to a catalog star.  <a href="#ga95a6f76b39659c4ce77f5f4ae3366a6f">More...</a><br/></td></tr>
+<tr class="separator:ga95a6f76b39659c4ce77f5f4ae3366a6f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga734ab55ebf9bec1bed7e6330def7b6d8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify.html#ga734ab55ebf9bec1bed7e6330def7b6d8">fors_identify</a> (fors_star_list *stars, fors_std_star_list *cat, const identify_method *im, cpl_image **histogram)</td></tr>
+<tr class="memdesc:ga734ab55ebf9bec1bed7e6330def7b6d8"><td class="mdescLeft"> </td><td class="mdescRight">Identify sources.  <a href="#ga734ab55ebf9bec1bed7e6330def7b6d8">More...</a><br/></td></tr>
+<tr class="separator:ga734ab55ebf9bec1bed7e6330def7b6d8"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_identify.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)name); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00992">992</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_free((<span class="keywordtype">void</span> *)name); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00992">992</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_identify.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_std_star_list_delete(&std_ccd       , fors_std_star_delete); \</div>
+<div class="line">    fors_std_star_list_delete(&std_ccd_bright, fors_std_star_delete); \</div>
+<div class="line">    fors_star_list_delete(&source_bright, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00992">992</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    fors_std_star_list_delete(&std_ccd       , fors_std_star_delete); \
-    fors_std_star_list_delete(&std_ccd_bright, fors_std_star_delete); \
-    fors_star_list_delete(&source_bright, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00992">992</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_identify.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_point_list_delete(&std_points, <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>); \</div>
+<div class="line">    fors_point_list_delete(&source_points, <a class="code" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0" title="Destructor.">fors_point_delete</a>); \</div>
+<div class="line">    fors_pattern_list_delete(&std_patterns, fors_pattern_delete); \</div>
+<div class="line">    fors_pattern_list_delete(&source_patterns, fors_pattern_delete); \</div>
+<div class="line">    double_list_delete(&scales, double_delete); \</div>
+<div class="line">    double_list_delete(&angles, double_delete); \</div>
+<div class="line">    double_list_delete(&angle_cos, double_delete); \</div>
+<div class="line">    double_list_delete(&angle_sin, double_delete); \</div>
+<div class="line">    double_list_delete(&match_dist, double_delete); \</div>
+<div class="line">    double_list_delete(&shiftx, double_delete); \</div>
+<div class="line">    double_list_delete(&shifty, double_delete); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00992">992</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    fors_point_list_delete(&std_points, <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>); \
-    fors_point_list_delete(&source_points, <a class="code" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a>); \
-    fors_pattern_list_delete(&std_patterns, fors_pattern_delete); \
-    fors_pattern_list_delete(&source_patterns, fors_pattern_delete); \
-    double_list_delete(&scales, double_delete); \
-    double_list_delete(&angles, double_delete); \
-    double_list_delete(&angle_cos, double_delete); \
-    double_list_delete(&angle_sin, double_delete); \
-    double_list_delete(&match_dist, double_delete); \
-    double_list_delete(&shiftx, double_delete); \
-    double_list_delete(&shifty, double_delete); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00992">992</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="gdfc439dadf11b131119fe17cb19f6e25"></a><!-- doxytag: member="fors_identify.c::inside_region" ref="gdfc439dadf11b131119fe17cb19f6e25" args="(const fors_std_star *std, void *reg)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga2bf16455ff9dadaa26861905f8999616"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static bool inside_region           </td>
+          <td class="memname">static bool inside_region </td>
           <td>(</td>
-          <td class="paramtype">const fors_std_star * </td>
-          <td class="paramname"> <em>std</em>, </td>
+          <td class="paramtype">const fors_std_star * </td>
+          <td class="paramname"><em>std</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>reg</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>reg</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Determine if star is inside region. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>std</em> </td><td>star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reg</em> </td><td>rectangular region, see code for the required type </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Determine if star is inside region. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">std</td><td>star </td></tr>
+    <tr><td class="paramname">reg</td><td>rectangular region, see code for the required type </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true iff the star's pixel coordinates are inside the given region </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>true iff the star's pixel coordinates are inside the given region </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00976">976</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00976">976</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g3c4ce99ce7472d6d48acffcf562b0fb7"></a><!-- doxytag: member="fors_identify.c::match_patterns" ref="g3c4ce99ce7472d6d48acffcf562b0fb7" args="(const fors_star_list *stars, const fors_std_star_list *std, double kappa, double *sx_00, double *sy_00, double *med_scale, double *med_angle, int *status)" -->
+</div>
+<a class="anchor" id="gabbed61b85afc33d67894bd2dd1f061f3"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void match_patterns           </td>
+          <td class="memname">static void match_patterns </td>
           <td>(</td>
-          <td class="paramtype">const fors_star_list * </td>
-          <td class="paramname"> <em>stars</em>, </td>
+          <td class="paramtype">const fors_star_list * </td>
+          <td class="paramname"><em>stars</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const fors_std_star_list * </td>
-          <td class="paramname"> <em>std</em>, </td>
+          <td class="paramtype">const fors_std_star_list * </td>
+          <td class="paramname"><em>std</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>kappa</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>kappa</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>sx_00</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>sx_00</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>sy_00</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>sy_00</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>med_scale</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>med_scale</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>med_angle</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>med_angle</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>status</em></td><td> </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>status</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Match patterns. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>stars</em> </td><td>sources </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>std</em> </td><td>reference stars </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sx_00</em> </td><td>(output) shift in x </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sy_00</em> </td><td>(output) shift in y </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>med_scale</em> </td><td>(output) median scale </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>med_angle</em> </td><td>(output) median angle</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Match patterns. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">stars</td><td>sources </td></tr>
+    <tr><td class="paramname">std</td><td>reference stars </td></tr>
+    <tr><td class="paramname">sx_00</td><td>(output) shift in x </td></tr>
+    <tr><td class="paramname">sy_00</td><td>(output) shift in y </td></tr>
+    <tr><td class="paramname">med_scale</td><td>(output) median scale </td></tr>
+    <tr><td class="paramname">med_angle</td><td>(output) median angle</td></tr>
   </table>
+  </dd>
 </dl>
-For now, the shifts are approximated with constant 2d polynomials as function of detector (x, y) position.<p>
-This function could be extended to fit 2d polynomials of degree > 0, if necessary. 
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l01023">1023</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__utils_8c-source.html#l00636">fors_angle_diff()</a>, <a class="el" href="fors__point_8c-source.html#l00053">fors_point_new()</a>, <a class="el" href="fors__star_8c-source.html#l00365">fors_star_extension()</a>, <a class="el" href="fors__star_8h-source.html#l00037">_fors_star::pixel</a>, and <a class="el" href="fors__utils [...]
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>.
+<p>For now, the shifts are approximated with constant 2d polynomials as function of detector (x, y) position.</p>
+<p>This function could be extended to fit 2d polynomials of degree > 0, if necessary. </p>
+
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l01023">1023</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__utils_8c_source.html#l00636">fors_angle_diff()</a>, <a class="el" href="fors__point_8c_source.html#l00053">fors_point_new()</a>, and <a class="el" href="fors__star_8c_source.html#l00365">fors_star_extension()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g62b335e73ad633535e1494f9ffd0cd03"></a><!-- doxytag: member="fors_identify.c::fors_identify_define_parameters" ref="g62b335e73ad633535e1494f9ffd0cd03" args="(cpl_parameterlist *parameters, const char *context)" -->
+</div>
+<a class="anchor" id="gac0dc4fbd9cc717256e5972cad3e7447f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_identify_define_parameters           </td>
+          <td class="memname">void fors_identify_define_parameters </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>, </td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>context</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>context</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Define recipe parameters. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameter list to fill </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>parameters context </td></tr>
+</div><div class="memdoc">
+
+<p>Define recipe parameters. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>parameter list to fill </td></tr>
+    <tr><td class="paramname">context</td><td>parameters context </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00082">82</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00124">fors_zeropoint_define_parameters()</a>, and <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>.
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00082">82</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00124">fors_zeropoint_define_parameters()</a>, and <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g2763139bd0ceba14e3be219d5d043e46"></a><!-- doxytag: member="fors_identify.c::fors_identify_method_new" ref="g2763139bd0ceba14e3be219d5d043e46" args="(const cpl_parameterlist *parameters, const char *context)" -->
+</div>
+<a class="anchor" id="ga642e6d38ae7b273d1901698a3970fd49"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">identify_method* fors_identify_method_new           </td>
+          <td class="memname">identify_method* fors_identify_method_new </td>
           <td>(</td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>context</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>context</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get id method from parameter list. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>recipe parameter list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>read id method from this context </td></tr>
+</div><div class="memdoc">
+
+<p>Get id method from parameter list. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>recipe parameter list </td></tr>
+    <tr><td class="paramname">context</td><td>read id method from this context </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated id method</dd></dl>
-The parameter list should have been previously created using <a class="el" href="group__fors__identify.html#g62b335e73ad633535e1494f9ffd0cd03">fors_identify_define_parameters()</a> 
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00193">193</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__dfs_8c-source.html#l00819">dfs_get_parameter_double_const()</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>, and <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated id method</dd></dl>
+<p>The parameter list should have been previously created using <a class="el" href="group__fors__identify.html#gac0dc4fbd9cc717256e5972cad3e7447f" title="Define recipe parameters.">fors_identify_define_parameters()</a> </p>
+
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00193">193</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__dfs_8c_source.html#l00819">dfs_get_parameter_double_const()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>, and <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g5e7cadfe27ffb45ccfa00905d520878e"></a><!-- doxytag: member="fors_identify.c::std_brighter_than" ref="g5e7cadfe27ffb45ccfa00905d520878e" args="(const fors_std_star *s1, void *s2)" -->
+<a class="anchor" id="ga1c91776ec58d5026026e00580f18f277"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static bool std_brighter_than           </td>
+          <td class="memname">static bool std_brighter_than </td>
           <td>(</td>
-          <td class="paramtype">const fors_std_star * </td>
-          <td class="paramname"> <em>s1</em>, </td>
+          <td class="paramtype">const fors_std_star * </td>
+          <td class="paramname"><em>s1</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>s2</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>s2</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Compare brightness. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s1</em> </td><td>1st star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>s2</em> </td><td>2nd star </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Compare brightness. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s1</td><td>1st star </td></tr>
+    <tr><td class="paramname">s2</td><td>2nd star </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true if s1 is brighter than s2</dd></dl>
-This function is the same as fors_std_star_brighter_than() but with the interface expected by <a class="el" href="group__multiset.html#g014e03d131a3d24d1d52465fd0f63a2f">list_extract()</a> 
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00274">274</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>.
+<dl class="section return"><dt>Returns</dt><dd>true if s1 is brighter than s2</dd></dl>
+<p>This function is the same as fors_std_star_brighter_than() but with the interface expected by <a class="el" href="group__multiset.html#gaf355fe5f4ce5910b419c80ae14bf5199" title="Extract elements.">list_extract()</a> </p>
+
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00274">274</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g4a762f4e872e3f797ba890c9d93eb98c"></a><!-- doxytag: member="fors_identify.c::star_brighter_than" ref="g4a762f4e872e3f797ba890c9d93eb98c" args="(const fors_star *s1, void *s2)" -->
+</div>
+<a class="anchor" id="ga75bfe0adc06bd97c18925132d4abf937"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static bool star_brighter_than           </td>
+          <td class="memname">static bool star_brighter_than </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s1</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s1</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>s2</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>s2</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Compare brightness. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s1</em> </td><td>1st star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>s2</em> </td><td>2nd star </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Compare brightness. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s1</td><td>1st star </td></tr>
+    <tr><td class="paramname">s2</td><td>2nd star </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true if s1 is brighter than s2</dd></dl>
-This function is the same as <a class="el" href="group__fors__star.html#g100f4290bf02ce348f22092f4e2bc3eb">fors_star_brighter_than()</a> but with the interface expected by <a class="el" href="group__multiset.html#g014e03d131a3d24d1d52465fd0f63a2f">list_extract()</a> 
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00290">290</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
-<p>
-References <a class="el" href="fors__star_8c-source.html#l00329">fors_star_brighter_than()</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>.
+<dl class="section return"><dt>Returns</dt><dd>true if s1 is brighter than s2</dd></dl>
+<p>This function is the same as <a class="el" href="group__fors__star.html#ga7672a63fe0deea93cb8bae8362b6d020" title="Compare star brightness.">fors_star_brighter_than()</a> but with the interface expected by <a class="el" href="group__multiset.html#gaf355fe5f4ce5910b419c80ae14bf5199" title="Extract elements.">list_extract()</a> </p>
+
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00290">290</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
+<p>References <a class="el" href="fors__star_8c_source.html#l00329">fors_star_brighter_than()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g7502079c2fbec8364ec5dfe2e2c6ad9b"></a><!-- doxytag: member="fors_identify.c::distsq_shift" ref="g7502079c2fbec8364ec5dfe2e2c6ad9b" args="(const fors_star *s, const fors_std_star *std, double shiftx, double shifty)" -->
+<a class="anchor" id="ga0627fa3e8f67fed1bd28cdd65fd19025"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static double distsq_shift           </td>
+          <td class="memname">static double distsq_shift </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const fors_std_star * </td>
-          <td class="paramname"> <em>std</em>, </td>
+          <td class="paramtype">const fors_std_star * </td>
+          <td class="paramname"><em>std</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>shiftx</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>shiftx</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>shifty</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>shifty</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Distance between source and shifted catalog star. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>source </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>std</em> </td><td>catalog star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>shiftx</em> </td><td>shift applied to std </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>shifty</em> </td><td>shift applied to std </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Distance between source and shifted catalog star. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>source </td></tr>
+    <tr><td class="paramname">std</td><td>catalog star </td></tr>
+    <tr><td class="paramname">shiftx</td><td>shift applied to std </td></tr>
+    <tr><td class="paramname">shifty</td><td>shift applied to std </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>squared distance between source and shifted catalog star </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00305">305</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
-<p>
-References <a class="el" href="fors__point_8c-source.html#l00087">fors_point_delete()</a>, <a class="el" href="fors__point_8c-source.html#l00103">fors_point_distsq()</a>, <a class="el" href="fors__point_8c-source.html#l00053">fors_point_new()</a>, and <a class="el" href="fors__star_8h-source.html#l00037">_fors_star::pixel</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>, and <a class="el" href="fors__identify_8c-source.html#l00329">star_nearer()</a>.
+<dl class="section return"><dt>Returns</dt><dd>squared distance between source and shifted catalog star </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00305">305</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
+<p>References <a class="el" href="fors__point_8c_source.html#l00087">fors_point_delete()</a>, <a class="el" href="fors__point_8c_source.html#l00103">fors_point_distsq()</a>, and <a class="el" href="fors__point_8c_source.html#l00053">fors_point_new()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>, and <a class="el" href="fors__identify_8c_source.html#l00329">star_nearer()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gd13e1eb3050a7a1933760649f74fa14a"></a><!-- doxytag: member="fors_identify.c::star_nearer" ref="gd13e1eb3050a7a1933760649f74fa14a" args="(const fors_star *s1, const fors_star *s2, void *data)" -->
+<a class="anchor" id="ga95a6f76b39659c4ce77f5f4ae3366a6f"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static bool star_nearer           </td>
+          <td class="memname">static bool star_nearer </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s1</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s1</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s2</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s2</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Tell if a source is closest to a catalog star. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s1</em> </td><td>1st source </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>s2</em> </td><td>2nd source </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>d</em> </td><td>radius, shift, catalog star </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Tell if a source is closest to a catalog star. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s1</td><td>1st source </td></tr>
+    <tr><td class="paramname">s2</td><td>2nd source </td></tr>
+    <tr><td class="paramname">d</td><td>radius, shift, catalog star </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true s1 is closer than s2 to reference, after shifting the reference star </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00329">329</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
-<p>
-References <a class="el" href="fors__identify_8c-source.html#l00305">distsq_shift()</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>.
+<dl class="section return"><dt>Returns</dt><dd>true s1 is closer than s2 to reference, after shifting the reference star </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00329">329</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
+<p>References <a class="el" href="fors__identify_8c_source.html#l00305">distsq_shift()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g879f2fc7b296f37722f6203d0ead78b6"></a><!-- doxytag: member="fors_identify.c::fors_identify" ref="g879f2fc7b296f37722f6203d0ead78b6" args="(fors_star_list *stars, fors_std_star_list *cat, const identify_method *im, cpl_image **histogram)" -->
+<a class="anchor" id="ga734ab55ebf9bec1bed7e6330def7b6d8"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_identify           </td>
+          <td class="memname">void fors_identify </td>
           <td>(</td>
-          <td class="paramtype">fors_star_list * </td>
-          <td class="paramname"> <em>stars</em>, </td>
+          <td class="paramtype">fors_star_list * </td>
+          <td class="paramname"><em>stars</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">fors_std_star_list * </td>
-          <td class="paramname"> <em>cat</em>, </td>
+          <td class="paramtype">fors_std_star_list * </td>
+          <td class="paramname"><em>cat</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const identify_method * </td>
-          <td class="paramname"> <em>im</em>, </td>
+          <td class="paramtype">const identify_method * </td>
+          <td class="paramname"><em>im</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image ** </td>
-          <td class="paramname"> <em>histogram</em></td><td> </td>
+          <td class="paramtype">cpl_image ** </td>
+          <td class="paramname"><em>histogram</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Identify sources. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>stars</em> </td><td>list of stars to identify </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>cat</em> </td><td>list of catalog stars </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>im</em> </td><td>parameters</td></tr>
+</div><div class="memdoc">
+
+<p>Identify sources. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">stars</td><td>list of stars to identify </td></tr>
+    <tr><td class="paramname">cat</td><td>list of catalog stars </td></tr>
+    <tr><td class="paramname">im</td><td>parameters</td></tr>
   </table>
+  </dd>
 </dl>
-pseudocode: Select catalog stars, 10 brightest stars inside CCD Select source stars, brightest 2 x catalog stars Compute reference patterns Compute source patterns For each reference pattern Identify with nearest source, compute scale, orientation Reject outliers, get average shift<p>
-For each catalog star Apply shift Identify with nearest source inside search radius 
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00372">372</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__identify_8c-source.html#l00305">distsq_shift()</a>, <a class="el" href="fors__star_8c-source.html#l00329">fors_star_brighter_than()</a>, <a class="el" href="fors__star_8c-source.html#l00248">fors_star_duplicate()</a>, <a class="el" href="fors__star_8c-source.html#l00467">fors_star_get_x()</a>, <a class="el" href="fors__s [...]
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l01107">fors_zeropoint_astrometry()</a>, and <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>.
+<p>pseudocode: Select catalog stars, 10 brightest stars inside CCD Select source stars, brightest 2 x catalog stars Compute reference patterns Compute source patterns For each reference pattern Identify with nearest source, compute scale, orientation Reject outliers, get average shift</p>
+<p>For each catalog star Apply shift Identify with nearest source inside search radius </p>
+
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00372">372</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__identify_8c_source.html#l00305">distsq_shift()</a>, <a class="el" href="fors__star_8c_source.html#l00329">fors_star_brighter_than()</a>, <a class="el" href="fors__star_8c_source.html#l00248">fors_star_duplicate()</a>, <a class="el" href="fors__star_8c_source.html#l00467">fors_star_get_x()</a>, <a class="el" href="fors__star_8c_source.html#l00485">fors_star_get_y()</a>, <a class="el" href=" [...]
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l01107">fors_zeropoint_astrometry()</a>, and <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__identify__test.html b/html/group__fors__identify__test.html
index 29444f9..c24f27c 100644
--- a/html/group__fors__identify__test.html
+++ b/html/group__fors__identify__test.html
@@ -1,66 +1,101 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: identify unit tests</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>identify unit tests</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb90b25df34e84ac286eea7acaaf2c726"></a><!-- doxytag: member="fors_identify_test::test_identify" ref="gb90b25df34e84ac286eea7acaaf2c726" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify__test.html#gb90b25df34e84ac286eea7acaaf2c726">test_identify</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test identification. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_identify_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of identification module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_identify-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">identify unit tests</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga9d562f61b66fedca2d53604fa93c8328"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9d562f61b66fedca2d53604fa93c8328"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify__test.html#ga9d562f61b66fedca2d53604fa93c8328">test_identify</a> (void)</td></tr>
+<tr class="memdesc:ga9d562f61b66fedca2d53604fa93c8328"><td class="mdescLeft"> </td><td class="mdescRight">Test identification. <br/></td></tr>
+<tr class="separator:ga9d562f61b66fedca2d53604fa93c8328"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__identify__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of identification module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frame_delete(raw_frame); \</div>
+<div class="line">    cpl_frameset_delete(cat_frames); \</div>
+<div class="line">    cpl_frame_delete(phot_table); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    cpl_parameterlist_delete(parameters); \</div>
+<div class="line">    fors_identify_method_delete(&im); \</div>
+<div class="line">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</div>
+<div class="line">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</div>
+<div class="line">    fors_star_list_delete(&stars, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>); \</div>
+<div class="line">    fors_star_list_delete(&stars_id, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>); \</div>
+<div class="line">    cpl_propertylist_delete(raw_header); raw_header = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__identify-test_8c_source.html#l00051">51</a> of file <a class="el" href="fors__identify-test_8c_source.html">fors_identify-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frame_delete(raw_frame); \
-    cpl_frameset_delete(cat_frames); \
-    cpl_frame_delete(phot_table); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    cpl_parameterlist_delete(parameters); \
-    <a class="code" href="group__fors__identify.html#g265af4d62a463db6eea76b808c2a4e8d">fors_identify_method_delete</a>(&im); \
-    fors_std_star_list_delete(&cat, fors_std_star_delete); \
-    fors_std_star_list_delete(&cat, fors_std_star_delete); \
-    fors_star_list_delete(&stars, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>); \
-    fors_star_list_delete(&stars_id, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>); \
-    cpl_propertylist_delete(raw_header); raw_header = NULL; \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__identify-test_8c-source.html#l00051">51</a> of file <a class="el" href="fors__identify-test_8c-source.html">fors_identify-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__image.html b/html/group__fors__image.html
index f9131af..6263a77 100644
--- a/html/group__fors__image.html
+++ b/html/group__fors__image.html
@@ -1,2297 +1,2261 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Image with error bars</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Image with error bars</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__image.html">_fors_image</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gf1d3f1bc9894b624c5fac0ef5eb9b854"></a><!-- doxytag: member="fors_image::FORS_IMAGE_TYPE_MAX" ref="gf1d3f1bc9894b624c5fac0ef5eb9b854" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gf1d3f1bc9894b624c5fac0ef5eb9b854">FORS_IMAGE_TYPE_MAX</a>   FLT_MAX</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb79164ea3a1118352c6ca0ea9a9840ea"></a><!-- doxytag: member="fors_image::LIST_DEFINE" ref="gb79164ea3a1118352c6ca0ea9a9840ea" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9d7995a21a54c1d39a0bc87d7f498029"></a><!-- doxytag: member="fors_image::LIST_ELEM" ref="g9d7995a21a54c1d39a0bc87d7f498029" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g9d7995a21a54c1d39a0bc87d7f498029">LIST_ELEM</a>   <a class="el" href="struct__fors__image.html">fors_image</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g167f96e092eeb578086febe4b86d6df9"></a><!-- doxytag: member="fors_image::max_filter" ref="g167f96e092eeb578086febe4b86d6df9" args="(const float *ibuffer, float *obuffer, int length, int size)" -->
-static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g167f96e092eeb578086febe4b86d6df9">max_filter</a> (const float *ibuffer, float *obuffer, int length, int size)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a> (cpl_image *data, cpl_image *variance)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create image.  <a href="#g1ea76d7c8217ae2f06ad42434a89ca65"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655">fors_image_duplicate</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor.  <a href="#g2dd2a200ff65896f50da127bb5d94655"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a> (<a class="el" href="struct__fors__image.html">fors_image</a> **image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Deallocate image and set pointer to NULL.  <a href="#g619a9da3f407016d4e9a2148cb86e903"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">fors_image_delete_const</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> **image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Deallocate image and set pointer to NULL.  <a href="#ge2384bf878e24641f1c294fe0014dbd6"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">fors_image_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list</a> (const cpl_frameset *frames, const <a class="el" href="struct__fors__image.html">fors_image</a> *bias, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, double *saturated)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load imagelist.  <a href="#g10b7b00c3db675b11d8f396f3ed1c90a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const fors_image_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gab0a6629f36c4db609f1a1515d602477">fors_image_load_list_const</a> (const cpl_frameset *frames, const <a class="el" href="struct__fors__image.html">fors_image</a> *bias, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, double *saturated)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load imagelist.  <a href="#gab0a6629f36c4db609f1a1515d602477"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load</a> (const cpl_frame *frame, const <a class="el" href="struct__fors__image.html">fors_image</a> *bias, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, double *saturated)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load image.  <a href="#g4d8212ca7fa00baa0880a17d2b71e410"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, const cpl_propertylist *header, const char *filename)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save image.  <a href="#gba23ac19606c94a04e9de87bdfe74b42"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g1ddf7d1b81954a8d2113e4f5174301a8">fors_image_save_sex</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, const cpl_propertylist *header, const char *filename_dat, const char *filename_var, int radius)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save image in format useable by SExtractor.  <a href="#g1ddf7d1b81954a8d2113e4f5174301a8"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03">fors_image_get_size_x</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get image width.  <a href="#g5d33557c3f679dbb621e2387018a3b03"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7">fors_image_get_size_y</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get image height.  <a href="#g53bd720f4c81385733f2406a5b22bdb7"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const float * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gdffe6405bb64c769dfcdf71c6a281dad">fors_image_get_data_const</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get pointer to data buffer.  <a href="#gdffe6405bb64c769dfcdf71c6a281dad"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g5ac7cb865a07bab1987284dba3676ceb">fors_image_abs</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Absolute value.  <a href="#g5ac7cb865a07bab1987284dba3676ceb"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g18f269421a43f46c063b667fac72c938">fors_image_square</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Squared.  <a href="#g18f269421a43f46c063b667fac72c938"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712">fors_image_subtract</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *left, const <a class="el" href="struct__fors__image.html">fors_image</a> *right)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Subtract images.  <a href="#gacbedc7a6d48a3838d66923912a5b712"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g0769427c961bdf0fd79eda47fcadeee2">fors_image_multiply_noerr</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *left, const cpl_image *right)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Multiply images.  <a href="#g0769427c961bdf0fd79eda47fcadeee2"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g4c8774a9e651df6d05689d208fb349e1">fors_image_divide_noerr</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *left, cpl_image *right)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Divide images.  <a href="#g4c8774a9e651df6d05689d208fb349e1"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4">fors_image_divide</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *left, const <a class="el" href="struct__fors__image.html">fors_image</a> *right)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Divide images.  <a href="#g56dbb1b1a81ac64b9b19effa13bafec4"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g15f95ab361e6c2ea44bafbada5d8d4a1">fors_image_multiply</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *left, const <a class="el" href="struct__fors__image.html">fors_image</a> *right)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Multiply images.  <a href="#g15f95ab361e6c2ea44bafbada5d8d4a1"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g50a06b605ca558553e0642209b93c100">fors_image_subtract_scalar</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, double s, double ds)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Subtract scalar.  <a href="#g50a06b605ca558553e0642209b93c100"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff">fors_image_divide_scalar</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, double s, double ds)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Divide by scalar.  <a href="#gcc9714a987782f7a8ab25d7548c27eff"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g077f7a5a847fa9c0e458dca2e12e4e6f">fors_image_multiply_scalar</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, double s, double ds)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Multiply by scalar.  <a href="#g077f7a5a847fa9c0e458dca2e12e4e6f"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g78afca4bf8e5c3dc80d0dcd7f682f9e9">fors_image_exponential</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, double b, double db)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Exponential.  <a href="#g78afca4bf8e5c3dc80d0dcd7f682f9e9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gc4edb9a966bcf97a17ad6a5c1b9d020f">fors_image_get_min</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get min data value.  <a href="#gc4edb9a966bcf97a17ad6a5c1b9d020f"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g5c7d9b043db23a40e632ffc34c3f3d5c">fors_image_get_max</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get max data value.  <a href="#g5c7d9b043db23a40e632ffc34c3f3d5c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3">fors_image_get_mean</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, double *dmean)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get mean data value.  <a href="#gfcbb208a8336f751ebf8119b17e70aa3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21">fors_image_get_median</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, double *dmedian)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get median data value.  <a href="#gf4b42869081aad7a0af57b50eedf9f21"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2">fors_image_crop</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, int xlo, int ylo, int xhi, int yhi)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Crop image.  <a href="#gf0bdf78bba3bf571d3eb313233dda2b2"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g96498be3e15cde80921709406c33b6f3">fors_image_filter_median_create</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, int xradius, int yradius, int xstart, int ystart, int xend, int yend, int xstep, int ystep, bool use_data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Smooth image.  <a href="#g96498be3e15cde80921709406c33b6f3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g0a3e3ddaf982b76fc92d9daf7e32059a"></a><!-- doxytag: member="fors_image::fors_image_flat_fit_create" ref="g0a3e3ddaf982b76fc92d9daf7e32059a" args="(fors_image *image, int step, int degree, float level)" -->
-cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g0a3e3ddaf982b76fc92d9daf7e32059a">fors_image_flat_fit_create</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, int step, int degree, float level)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g315f5476160ed7db282a7623f0d354b0">fors_image_filter_max_create</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, int xradius, int yradius, bool use_data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Max filter image.  <a href="#g315f5476160ed7db282a7623f0d354b0"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257">fors_image_get_stdev</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, double *dstdev)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get empirical stdev of data.  <a href="#g9b3437d12d87ecb5a0f69fdfd51d2257"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b">fors_image_get_stdev_robust</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, double cut, double *dstdev)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get robust empirical stdev of data.  <a href="#g6467069b6450c28087a3a0d5a695911b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0">fors_image_get_error_mean</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, double *dmean)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get mean of error bars.  <a href="#g0c54aa21dd94d212c389d89d128580b0"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g4154f529cbabe4cb4d1203d03e771f8a">fors_image_collapse_create</a> (const fors_image_list *images)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Average collapse.  <a href="#g4154f529cbabe4cb4d1203d03e771f8a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gfe360dbc95e94b6b1043401aef8cbacc">fors_image_collapse_minmax_create</a> (const fors_image_list *images, int low, int high)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Minmax collapse.  <a href="#gfe360dbc95e94b6b1043401aef8cbacc"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g9f084a5b4f1564f1efb645e342eee2af">fors_image_collapse_ksigma_create</a> (const fors_image_list *images, int low, int high, int iter)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Ksigma collapse.  <a href="#g9f084a5b4f1564f1efb645e342eee2af"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gbd2b7e8761473ff4ca42f90fa879e1ad">fors_image_collapse_median_create</a> (const fors_image_list *images)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Median collapse.  <a href="#gbd2b7e8761473ff4ca42f90fa879e1ad"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#g5b5539c0e15fe20c16bedc58e8263724">fors_image_draw</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, int type, double x, double y, int radius, double color)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Draw on image.  <a href="#g5b5539c0e15fe20c16bedc58e8263724"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga0147d042c3e054d9e3d2402f4ebe084"></a><!-- doxytag: member="fors_image::FORS_IMAGE_TYPE" ref="ga0147d042c3e054d9e3d2402f4ebe084" args="" -->
-const cpl_type </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a> = CPL_TYPE_FLOAT</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Image data type. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Data Structures</a> |
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">Image with error bars</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__image.html">_fors_image</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga0820fe49afdbef957766d31ece6a93e8"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>FORS_IMAGE_TYPE_MAX</b></td></tr>
+<tr class="separator:ga0820fe49afdbef957766d31ece6a93e8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac0830324b91c374088872a18c876bc34"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac0830324b91c374088872a18c876bc34"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>LIST_DEFINE</b></td></tr>
+<tr class="separator:gac0830324b91c374088872a18c876bc34"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadb231bfc44ec37423962ea7f563a458b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gadb231bfc44ec37423962ea7f563a458b"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>LIST_ELEM</b>   <a class="el" href="struct__fors__image.html">fors_image</a></td></tr>
+<tr class="separator:gadb231bfc44ec37423962ea7f563a458b"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga570d5aab72b5f1a68d458e9690992d2d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga570d5aab72b5f1a68d458e9690992d2d"></a>
+static int </td><td class="memItemRight" valign="bottom"><b>max_filter</b> (const float *ibuffer, float *obuffer, int length, int size)</td></tr>
+<tr class="separator:ga570d5aab72b5f1a68d458e9690992d2d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga29ad1e2da7d1495b2f0a870ee0549363"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363">fors_image_new</a> (cpl_image *data, cpl_image *variance)</td></tr>
+<tr class="memdesc:ga29ad1e2da7d1495b2f0a870ee0549363"><td class="mdescLeft"> </td><td class="mdescRight">Create image.  <a href="#ga29ad1e2da7d1495b2f0a870ee0549363">More...</a><br/></td></tr>
+<tr class="separator:ga29ad1e2da7d1495b2f0a870ee0549363"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9553dd4daa5cbce4eb7b392aa5f6973f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f">fors_image_duplicate</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
+<tr class="memdesc:ga9553dd4daa5cbce4eb7b392aa5f6973f"><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor.  <a href="#ga9553dd4daa5cbce4eb7b392aa5f6973f">More...</a><br/></td></tr>
+<tr class="separator:ga9553dd4daa5cbce4eb7b392aa5f6973f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga558b19ec6c2dc95a42406d264076a1ad"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad">fors_image_delete</a> (<a class="el" href="struct__fors__image.html">fors_image</a> **image)</td></tr>
+<tr class="memdesc:ga558b19ec6c2dc95a42406d264076a1ad"><td class="mdescLeft"> </td><td class="mdescRight">Deallocate image and set pointer to NULL.  <a href="#ga558b19ec6c2dc95a42406d264076a1ad">More...</a><br/></td></tr>
+<tr class="separator:ga558b19ec6c2dc95a42406d264076a1ad"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga67d54e90304b185e9f211aba5a620c4f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga67d54e90304b185e9f211aba5a620c4f">fors_image_delete_const</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> **image)</td></tr>
+<tr class="memdesc:ga67d54e90304b185e9f211aba5a620c4f"><td class="mdescLeft"> </td><td class="mdescRight">Deallocate image and set pointer to NULL.  <a href="#ga67d54e90304b185e9f211aba5a620c4f">More...</a><br/></td></tr>
+<tr class="separator:ga67d54e90304b185e9f211aba5a620c4f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf3015630f60828aa86962af230cd156c"><td class="memItemLeft" align="right" valign="top">fors_image_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c">fors_image_load_list</a> (const cpl_frameset *frames, const <a class="el" href="struct__fors__image.html">fors_image</a> *bias, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, double *saturated)</td></tr>
+<tr class="memdesc:gaf3015630f60828aa86962af230cd156c"><td class="mdescLeft"> </td><td class="mdescRight">Load imagelist.  <a href="#gaf3015630f60828aa86962af230cd156c">More...</a><br/></td></tr>
+<tr class="separator:gaf3015630f60828aa86962af230cd156c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0895dc7573734afe519fa4dff3ea33bd"><td class="memItemLeft" align="right" valign="top">const fors_image_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga0895dc7573734afe519fa4dff3ea33bd">fors_image_load_list_const</a> (const cpl_frameset *frames, const <a class="el" href="struct__fors__image.html">fors_image</a> *bias, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, double *saturate [...]
+<tr class="memdesc:ga0895dc7573734afe519fa4dff3ea33bd"><td class="mdescLeft"> </td><td class="mdescRight">Load imagelist.  <a href="#ga0895dc7573734afe519fa4dff3ea33bd">More...</a><br/></td></tr>
+<tr class="separator:ga0895dc7573734afe519fa4dff3ea33bd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga88d12a30a35a7b792dba116dad95b51a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a">fors_image_load</a> (const cpl_frame *frame, const <a class="el" href="struct__fors__image.html">fors_image</a> *bias, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *s [...]
+<tr class="memdesc:ga88d12a30a35a7b792dba116dad95b51a"><td class="mdescLeft"> </td><td class="mdescRight">Load image.  <a href="#ga88d12a30a35a7b792dba116dad95b51a">More...</a><br/></td></tr>
+<tr class="separator:ga88d12a30a35a7b792dba116dad95b51a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga03726eb0240d1c7711ab32b8479147a1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1">fors_image_save</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, const cpl_propertylist *header, const char *filename)</td></tr>
+<tr class="memdesc:ga03726eb0240d1c7711ab32b8479147a1"><td class="mdescLeft"> </td><td class="mdescRight">Save image.  <a href="#ga03726eb0240d1c7711ab32b8479147a1">More...</a><br/></td></tr>
+<tr class="separator:ga03726eb0240d1c7711ab32b8479147a1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga38eebeb331a65efbffbc6dc04304a786"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga38eebeb331a65efbffbc6dc04304a786">fors_image_save_sex</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, const cpl_propertylist *header, const char *filename_dat, const char *filename_var, int radius)</td></tr>
+<tr class="memdesc:ga38eebeb331a65efbffbc6dc04304a786"><td class="mdescLeft"> </td><td class="mdescRight">Save image in format useable by SExtractor.  <a href="#ga38eebeb331a65efbffbc6dc04304a786">More...</a><br/></td></tr>
+<tr class="separator:ga38eebeb331a65efbffbc6dc04304a786"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga978969a0911531b117735be291f106cc"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga978969a0911531b117735be291f106cc">fors_image_get_size_x</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
+<tr class="memdesc:ga978969a0911531b117735be291f106cc"><td class="mdescLeft"> </td><td class="mdescRight">Get image width.  <a href="#ga978969a0911531b117735be291f106cc">More...</a><br/></td></tr>
+<tr class="separator:ga978969a0911531b117735be291f106cc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga74854105003c725472595225aab740d7"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga74854105003c725472595225aab740d7">fors_image_get_size_y</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
+<tr class="memdesc:ga74854105003c725472595225aab740d7"><td class="mdescLeft"> </td><td class="mdescRight">Get image height.  <a href="#ga74854105003c725472595225aab740d7">More...</a><br/></td></tr>
+<tr class="separator:ga74854105003c725472595225aab740d7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga547b9bf5f615a083bffdcfa9097d0520"><td class="memItemLeft" align="right" valign="top">const float * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga547b9bf5f615a083bffdcfa9097d0520">fors_image_get_data_const</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
+<tr class="memdesc:ga547b9bf5f615a083bffdcfa9097d0520"><td class="mdescLeft"> </td><td class="mdescRight">Get pointer to data buffer.  <a href="#ga547b9bf5f615a083bffdcfa9097d0520">More...</a><br/></td></tr>
+<tr class="separator:ga547b9bf5f615a083bffdcfa9097d0520"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga14651bbe94e495df34aa59b335439b8f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga14651bbe94e495df34aa59b335439b8f">fors_image_abs</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
+<tr class="memdesc:ga14651bbe94e495df34aa59b335439b8f"><td class="mdescLeft"> </td><td class="mdescRight">Absolute value.  <a href="#ga14651bbe94e495df34aa59b335439b8f">More...</a><br/></td></tr>
+<tr class="separator:ga14651bbe94e495df34aa59b335439b8f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad4ecbb0eb96611d66dc9a3a1bc2ae0d8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gad4ecbb0eb96611d66dc9a3a1bc2ae0d8">fors_image_square</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
+<tr class="memdesc:gad4ecbb0eb96611d66dc9a3a1bc2ae0d8"><td class="mdescLeft"> </td><td class="mdescRight">Squared.  <a href="#gad4ecbb0eb96611d66dc9a3a1bc2ae0d8">More...</a><br/></td></tr>
+<tr class="separator:gad4ecbb0eb96611d66dc9a3a1bc2ae0d8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf66086d63ad85bd81e5847ee962fc0be"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be">fors_image_subtract</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *left, const <a class="el" href="struct__fors__image.html">fors_image</a> *right)</td></tr>
+<tr class="memdesc:gaf66086d63ad85bd81e5847ee962fc0be"><td class="mdescLeft"> </td><td class="mdescRight">Subtract images.  <a href="#gaf66086d63ad85bd81e5847ee962fc0be">More...</a><br/></td></tr>
+<tr class="separator:gaf66086d63ad85bd81e5847ee962fc0be"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga25c0e2f6005831b9f5fcf3d81accfc43"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga25c0e2f6005831b9f5fcf3d81accfc43">fors_image_multiply_noerr</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *left, const cpl_image *right)</td></tr>
+<tr class="memdesc:ga25c0e2f6005831b9f5fcf3d81accfc43"><td class="mdescLeft"> </td><td class="mdescRight">Multiply images.  <a href="#ga25c0e2f6005831b9f5fcf3d81accfc43">More...</a><br/></td></tr>
+<tr class="separator:ga25c0e2f6005831b9f5fcf3d81accfc43"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga88aca44b1a0bde06bbd43c487ae58766"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga88aca44b1a0bde06bbd43c487ae58766">fors_image_divide_noerr</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *left, cpl_image *right)</td></tr>
+<tr class="memdesc:ga88aca44b1a0bde06bbd43c487ae58766"><td class="mdescLeft"> </td><td class="mdescRight">Divide images.  <a href="#ga88aca44b1a0bde06bbd43c487ae58766">More...</a><br/></td></tr>
+<tr class="separator:ga88aca44b1a0bde06bbd43c487ae58766"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga19f8c27621d28b8443d49f59af6cc2b2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2">fors_image_divide</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *left, const <a class="el" href="struct__fors__image.html">fors_image</a> *right)</td></tr>
+<tr class="memdesc:ga19f8c27621d28b8443d49f59af6cc2b2"><td class="mdescLeft"> </td><td class="mdescRight">Divide images.  <a href="#ga19f8c27621d28b8443d49f59af6cc2b2">More...</a><br/></td></tr>
+<tr class="separator:ga19f8c27621d28b8443d49f59af6cc2b2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaaa54b1e6e0e3cf5fcf442267896f6dad"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gaaa54b1e6e0e3cf5fcf442267896f6dad">fors_image_multiply</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *left, const <a class="el" href="struct__fors__image.html">fors_image</a> *right)</td></tr>
+<tr class="memdesc:gaaa54b1e6e0e3cf5fcf442267896f6dad"><td class="mdescLeft"> </td><td class="mdescRight">Multiply images.  <a href="#gaaa54b1e6e0e3cf5fcf442267896f6dad">More...</a><br/></td></tr>
+<tr class="separator:gaaa54b1e6e0e3cf5fcf442267896f6dad"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gacbfb7c0518043b1079bb72af95d80961"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gacbfb7c0518043b1079bb72af95d80961">fors_image_subtract_scalar</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, double s, double ds)</td></tr>
+<tr class="memdesc:gacbfb7c0518043b1079bb72af95d80961"><td class="mdescLeft"> </td><td class="mdescRight">Subtract scalar.  <a href="#gacbfb7c0518043b1079bb72af95d80961">More...</a><br/></td></tr>
+<tr class="separator:gacbfb7c0518043b1079bb72af95d80961"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gacfa2ae6fb10e4178a658b96d45daad35"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35">fors_image_divide_scalar</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, double s, double ds)</td></tr>
+<tr class="memdesc:gacfa2ae6fb10e4178a658b96d45daad35"><td class="mdescLeft"> </td><td class="mdescRight">Divide by scalar.  <a href="#gacfa2ae6fb10e4178a658b96d45daad35">More...</a><br/></td></tr>
+<tr class="separator:gacfa2ae6fb10e4178a658b96d45daad35"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadd751e2623f778d5bb2b8f3b628077c2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gadd751e2623f778d5bb2b8f3b628077c2">fors_image_multiply_scalar</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, double s, double ds)</td></tr>
+<tr class="memdesc:gadd751e2623f778d5bb2b8f3b628077c2"><td class="mdescLeft"> </td><td class="mdescRight">Multiply by scalar.  <a href="#gadd751e2623f778d5bb2b8f3b628077c2">More...</a><br/></td></tr>
+<tr class="separator:gadd751e2623f778d5bb2b8f3b628077c2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabe2039c17c13fed0e430d71cb38454bf"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gabe2039c17c13fed0e430d71cb38454bf">fors_image_exponential</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, double b, double db)</td></tr>
+<tr class="memdesc:gabe2039c17c13fed0e430d71cb38454bf"><td class="mdescLeft"> </td><td class="mdescRight">Exponential.  <a href="#gabe2039c17c13fed0e430d71cb38454bf">More...</a><br/></td></tr>
+<tr class="separator:gabe2039c17c13fed0e430d71cb38454bf"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga918a9107b07852d77bd457ea44d9b28e"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga918a9107b07852d77bd457ea44d9b28e">fors_image_get_min</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
+<tr class="memdesc:ga918a9107b07852d77bd457ea44d9b28e"><td class="mdescLeft"> </td><td class="mdescRight">Get min data value.  <a href="#ga918a9107b07852d77bd457ea44d9b28e">More...</a><br/></td></tr>
+<tr class="separator:ga918a9107b07852d77bd457ea44d9b28e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8bde38b5f976d70ab7d6cef4652e1a51"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga8bde38b5f976d70ab7d6cef4652e1a51">fors_image_get_max</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image)</td></tr>
+<tr class="memdesc:ga8bde38b5f976d70ab7d6cef4652e1a51"><td class="mdescLeft"> </td><td class="mdescRight">Get max data value.  <a href="#ga8bde38b5f976d70ab7d6cef4652e1a51">More...</a><br/></td></tr>
+<tr class="separator:ga8bde38b5f976d70ab7d6cef4652e1a51"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf4cbc4ac53ba9049e498abc43eff312f"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f">fors_image_get_mean</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, double *dmean)</td></tr>
+<tr class="memdesc:gaf4cbc4ac53ba9049e498abc43eff312f"><td class="mdescLeft"> </td><td class="mdescRight">Get mean data value.  <a href="#gaf4cbc4ac53ba9049e498abc43eff312f">More...</a><br/></td></tr>
+<tr class="separator:gaf4cbc4ac53ba9049e498abc43eff312f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga428a8273a1d3070a80cd7e82651a2dcb"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb">fors_image_get_median</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, double *dmedian)</td></tr>
+<tr class="memdesc:ga428a8273a1d3070a80cd7e82651a2dcb"><td class="mdescLeft"> </td><td class="mdescRight">Get median data value.  <a href="#ga428a8273a1d3070a80cd7e82651a2dcb">More...</a><br/></td></tr>
+<tr class="separator:ga428a8273a1d3070a80cd7e82651a2dcb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga86343e578ebfa129195e6465e7e60053"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053">fors_image_crop</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, int xlo, int ylo, int xhi, int yhi)</td></tr>
+<tr class="memdesc:ga86343e578ebfa129195e6465e7e60053"><td class="mdescLeft"> </td><td class="mdescRight">Crop image.  <a href="#ga86343e578ebfa129195e6465e7e60053">More...</a><br/></td></tr>
+<tr class="separator:ga86343e578ebfa129195e6465e7e60053"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga395b18920e75b55d9a793dfbcb99755f"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga395b18920e75b55d9a793dfbcb99755f">fors_image_filter_median_create</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, int xradius, int yradius, int xstart, int ystart, int xend, int yend, int xstep, int ystep, bool use_data)</td></tr>
+<tr class="memdesc:ga395b18920e75b55d9a793dfbcb99755f"><td class="mdescLeft"> </td><td class="mdescRight">Smooth image.  <a href="#ga395b18920e75b55d9a793dfbcb99755f">More...</a><br/></td></tr>
+<tr class="separator:ga395b18920e75b55d9a793dfbcb99755f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga80068092bb7559716abb1ddea1cc4814"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga80068092bb7559716abb1ddea1cc4814"></a>
+cpl_image * </td><td class="memItemRight" valign="bottom"><b>fors_image_flat_fit_create</b> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, int step, int degree, float level)</td></tr>
+<tr class="separator:ga80068092bb7559716abb1ddea1cc4814"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga21965427a98e2e07cf0b167e4610da1c"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga21965427a98e2e07cf0b167e4610da1c">fors_image_filter_max_create</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, int xradius, int yradius, bool use_data)</td></tr>
+<tr class="memdesc:ga21965427a98e2e07cf0b167e4610da1c"><td class="mdescLeft"> </td><td class="mdescRight">Max filter image.  <a href="#ga21965427a98e2e07cf0b167e4610da1c">More...</a><br/></td></tr>
+<tr class="separator:ga21965427a98e2e07cf0b167e4610da1c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0729fde58e241c5ab03de7255fc5783e"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e">fors_image_get_stdev</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, double *dstdev)</td></tr>
+<tr class="memdesc:ga0729fde58e241c5ab03de7255fc5783e"><td class="mdescLeft"> </td><td class="mdescRight">Get empirical stdev of data.  <a href="#ga0729fde58e241c5ab03de7255fc5783e">More...</a><br/></td></tr>
+<tr class="separator:ga0729fde58e241c5ab03de7255fc5783e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6dd8e98a349a0711fae2c24ff07c5a10"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10">fors_image_get_stdev_robust</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, double cut, double *dstdev)</td></tr>
+<tr class="memdesc:ga6dd8e98a349a0711fae2c24ff07c5a10"><td class="mdescLeft"> </td><td class="mdescRight">Get robust empirical stdev of data.  <a href="#ga6dd8e98a349a0711fae2c24ff07c5a10">More...</a><br/></td></tr>
+<tr class="separator:ga6dd8e98a349a0711fae2c24ff07c5a10"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1ed97db3c18526c96984e42ced6cc2c4"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4">fors_image_get_error_mean</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *image, double *dmean)</td></tr>
+<tr class="memdesc:ga1ed97db3c18526c96984e42ced6cc2c4"><td class="mdescLeft"> </td><td class="mdescRight">Get mean of error bars.  <a href="#ga1ed97db3c18526c96984e42ced6cc2c4">More...</a><br/></td></tr>
+<tr class="separator:ga1ed97db3c18526c96984e42ced6cc2c4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5510f4f5ebec4c99de3d9567b4eca21d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga5510f4f5ebec4c99de3d9567b4eca21d">fors_image_collapse_create</a> (const fors_image_list *images)</td></tr>
+<tr class="memdesc:ga5510f4f5ebec4c99de3d9567b4eca21d"><td class="mdescLeft"> </td><td class="mdescRight">Average collapse.  <a href="#ga5510f4f5ebec4c99de3d9567b4eca21d">More...</a><br/></td></tr>
+<tr class="separator:ga5510f4f5ebec4c99de3d9567b4eca21d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga41938f63e18b05073716d2afed9bd4a3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga41938f63e18b05073716d2afed9bd4a3">fors_image_collapse_minmax_create</a> (const fors_image_list *images, int low, int high)</td></tr>
+<tr class="memdesc:ga41938f63e18b05073716d2afed9bd4a3"><td class="mdescLeft"> </td><td class="mdescRight">Minmax collapse.  <a href="#ga41938f63e18b05073716d2afed9bd4a3">More...</a><br/></td></tr>
+<tr class="separator:ga41938f63e18b05073716d2afed9bd4a3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3789562f96e6c162f90d51388d372a88"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga3789562f96e6c162f90d51388d372a88">fors_image_collapse_ksigma_create</a> (const fors_image_list *images, int low, int high, int iter)</td></tr>
+<tr class="memdesc:ga3789562f96e6c162f90d51388d372a88"><td class="mdescLeft"> </td><td class="mdescRight">Ksigma collapse.  <a href="#ga3789562f96e6c162f90d51388d372a88">More...</a><br/></td></tr>
+<tr class="separator:ga3789562f96e6c162f90d51388d372a88"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0d7aab18ef2992f7efba3ab24f7af503"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga0d7aab18ef2992f7efba3ab24f7af503">fors_image_collapse_median_create</a> (const fors_image_list *images)</td></tr>
+<tr class="memdesc:ga0d7aab18ef2992f7efba3ab24f7af503"><td class="mdescLeft"> </td><td class="mdescRight">Median collapse.  <a href="#ga0d7aab18ef2992f7efba3ab24f7af503">More...</a><br/></td></tr>
+<tr class="separator:ga0d7aab18ef2992f7efba3ab24f7af503"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga84a11915fdc3ac7ae1c9535d9eadfeeb"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga84a11915fdc3ac7ae1c9535d9eadfeeb">fors_image_draw</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *image, int type, double x, double y, int radius, double color)</td></tr>
+<tr class="memdesc:ga84a11915fdc3ac7ae1c9535d9eadfeeb"><td class="mdescLeft"> </td><td class="mdescRight">Draw on image.  <a href="#ga84a11915fdc3ac7ae1c9535d9eadfeeb">More...</a><br/></td></tr>
+<tr class="separator:ga84a11915fdc3ac7ae1c9535d9eadfeeb"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga1ef4cba4bce1cc6fdde9730bfe6f13a8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1ef4cba4bce1cc6fdde9730bfe6f13a8"></a>
+const cpl_type </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8">FORS_IMAGE_TYPE</a> = CPL_TYPE_FLOAT</td></tr>
+<tr class="memdesc:ga1ef4cba4bce1cc6fdde9730bfe6f13a8"><td class="mdescLeft"> </td><td class="mdescRight">Image data type. <br/></td></tr>
+<tr class="separator:ga1ef4cba4bce1cc6fdde9730bfe6f13a8"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-This object contains<ul>
-<li>the image data values,</li><li>the image data error bars,</li><li>additional relevant properties for the image (detector overscan areas, exposure time, etc.)</li></ul>
-<p>
-For efficiency+convenience the error bars are internally represented as sigma^2 to avoid the repeated conversion between sigma <-> variance <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>This object contains</p>
+<ul>
+<li>the image data values,</li>
+<li>the image data error bars,</li>
+<li>additional relevant properties for the image (detector overscan areas, exposure time, etc.)</li>
+</ul>
+<p>For efficiency+convenience the error bars are internally represented as sigma^2 to avoid the repeated conversion between sigma <-> variance </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga0820fe49afdbef957766d31ece6a93e8"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define FORS_IMAGE_TYPE_MAX</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line">FLT_MAX  <span class="comment">/* Use a #define rather than a variable here</span></div>
+<div class="line"><span class="comment">                                        to avoid type casting */</span></div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00079">79</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    double_list_delete(&sat_percent, double_delete); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    double_list_delete(&sat_percent, double_delete); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+</div>
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_propertylist_delete(header); \
-    cpl_table_delete(overscans); \
-    cpl_image_delete(temp); \
-    cpl_mask_delete(non_saturated); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&frame_setting); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_propertylist_delete(header); \</div>
+<div class="line">    cpl_table_delete(overscans); \</div>
+<div class="line">    cpl_image_delete(temp); \</div>
+<div class="line">    cpl_mask_delete(non_saturated); \</div>
+<div class="line">    fors_setting_delete(&frame_setting); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_image_delete(sigma); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_image_delete(sigma); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_image_delete(var_bkg); \
-    cpl_image_delete(sigma_bkg); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_image_delete(var_bkg); \</div>
+<div class="line">    cpl_image_delete(sigma_bkg); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_image_delete(temp); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_image_delete(temp); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&dupl); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&dupl); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_image_delete(s22d12); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_image_delete(s22d12); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_image_delete(temp); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_image_delete(temp); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_image_delete(input); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_image_delete(input); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_mask_delete(rejected); \
-    cpl_image_delete(im); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_mask_delete(rejected); \</div>
+<div class="line">    cpl_image_delete(im); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_imagelist_delete(datlist); \
-    cpl_imagelist_delete(varlist); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_imagelist_delete(datlist); \</div>
+<div class="line">    cpl_imagelist_delete(varlist); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+</div>
 </div>
-<div class="memdoc">
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">#define cleanup</td>
+        </tr>
+      </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_imagelist_delete(datlist); \</div>
+<div class="line">    cpl_imagelist_delete(varlist); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01899">1899</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_imagelist_delete(datlist); \
-    cpl_imagelist_delete(varlist); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01890">1890</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g1ea76d7c8217ae2f06ad42434a89ca65"></a><!-- doxytag: member="fors_image.c::fors_image_new" ref="g1ea76d7c8217ae2f06ad42434a89ca65" args="(cpl_image *data, cpl_image *variance)" -->
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga29ad1e2da7d1495b2f0a870ee0549363"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_new           </td>
+          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_new </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>data</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>data</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>variance</em></td><td> </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>variance</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Create image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>image data </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>variance</em> </td><td>image data error bars on the form sigma^2 </td></tr>
+<p>Create image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">data</td><td>image data </td></tr>
+    <tr><td class="paramname">variance</td><td>image data error bars on the form sigma^2 </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated image</dd></dl>
-Note: The ownership of the provided images is transferred to the new image object. The input images must therefore not be deallocated 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00128">128</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00078">FORS_IMAGE_TYPE</a>, and <a class="el" href="fors__utils_8c-source.html#l00496">fors_type_get_string()</a>.
-<p>
-Referenced by <a class="el" href="test__simulate_8c-source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c-source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c-source.html#l00328">create_screen_flat()</a>, <a class="el" href="test__simulate_8c-source.html#l00384">create_sky_flat()</a>, <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>, <a class="el" href="fors__image_8c-source.html#l01665">fors_image_collapse_cr [...]
-</div>
-</div><p>
-<a class="anchor" name="g2dd2a200ff65896f50da127bb5d94655"></a><!-- doxytag: member="fors_image.c::fors_image_duplicate" ref="g2dd2a200ff65896f50da127bb5d94655" args="(const fors_image *image)" -->
+<dl class="section return"><dt>Returns</dt><dd>newly allocated image</dd></dl>
+<p>Note: The ownership of the provided images is transferred to the new image object. The input images must therefore not be deallocated </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00128">128</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="test__simulate_8c_source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c_source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c_source.html#l00328">create_screen_flat()</a>, <a class="el" href="test__simulate_8c_source.html#l00384">create_sky_flat()</a>, <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>, <a class="el" href="fors__image_8c_source.html#l01674">fors_image_collapse [...]
+
+</div>
+</div>
+<a class="anchor" id="ga9553dd4daa5cbce4eb7b392aa5f6973f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_duplicate           </td>
+          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_duplicate </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Copy constructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to duplicate </td></tr>
+<p>Copy constructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to duplicate </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated copy of input </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>newly allocated copy of input </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00175">175</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c_source.html#l00128">fors_image_new()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00172">172</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l00128">fors_image_new()</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>, <a class="el" href="fors__tools_8c-source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__tools_8c-source.html#l00329">fors_fixed_pattern_noise_bias()</a>, <a class="el" href="fors__image_8c-source.html#l00925">fors_image_divide()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">fors_img_screen_flat()</a>, and <a class="el" href="fors__bias__ [...]
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>, <a class="el" href="fors__tools_8c_source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__tools_8c_source.html#l00329">fors_fixed_pattern_noise_bias()</a>, <a class="el" href="fors__image_8c_source.html#l00934">fors_image_divide()</a>, <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>, and <a class="el" href="fors__img [...]
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g619a9da3f407016d4e9a2148cb86e903"></a><!-- doxytag: member="fors_image.c::fors_image_delete" ref="g619a9da3f407016d4e9a2148cb86e903" args="(fors_image **image)" -->
+<a class="anchor" id="ga558b19ec6c2dc95a42406d264076a1ad"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_delete           </td>
+          <td class="memname">void fors_image_delete </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> ** </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> ** </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Deallocate image and set pointer to NULL. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to delete </td></tr>
+<p>Deallocate image and set pointer to NULL. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to delete </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00185">185</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>, <a class="el" href="fors__image_8c-source.html#l00200">fors_image_delete_const()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>, <a class="el" href="fors__image-test_8c-source.html#l00056">test_image()</a>, <a class="el" href="fors__image-test_8c-source.html#l [...]
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00188">188</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>, <a class="el" href="fors__image_8c_source.html#l00203">fors_image_delete_const()</a>, <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>, <a class="el" href="fors__image-test_8c_source.html#l00056">test_image()</a>, <a class="el" href="fors__image-test_8c_source.htm [...]
+
 </div>
-</div><p>
-<a class="anchor" name="ge2384bf878e24641f1c294fe0014dbd6"></a><!-- doxytag: member="fors_image.c::fors_image_delete_const" ref="ge2384bf878e24641f1c294fe0014dbd6" args="(const fors_image **image)" -->
+</div>
+<a class="anchor" id="ga67d54e90304b185e9f211aba5a620c4f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_delete_const           </td>
+          <td class="memname">void fors_image_delete_const </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> ** </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> ** </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Deallocate image and set pointer to NULL. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to delete </td></tr>
+<p>Deallocate image and set pointer to NULL. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to delete </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00200">200</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="fors__image_8c-source.html#l00185">fors_image_delete()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00203">203</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="fors__image_8c_source.html#l00188">fors_image_delete()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g10b7b00c3db675b11d8f396f3ed1c90a"></a><!-- doxytag: member="fors_image.c::fors_image_load_list" ref="g10b7b00c3db675b11d8f396f3ed1c90a" args="(const cpl_frameset *frames, const fors_image *bias, const fors_setting *setting, double *saturated)" -->
+</div>
+<a class="anchor" id="gaf3015630f60828aa86962af230cd156c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">fors_image_list* fors_image_load_list           </td>
+          <td class="memname">fors_image_list* fors_image_load_list </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">const cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>bias</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>bias</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>saturated</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>saturated</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Load imagelist. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>all provided frames are loaded </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>bias</em> </td><td>master bias image, or NULL </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>expected instrument setting </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>saturated</em> </td><td>(output) if non-NULL, overall saturation percentage. Defined as > 65534.4 or < 0.5 </td></tr>
+</div><div class="memdoc">
+
+<p>Load imagelist. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>all provided frames are loaded </td></tr>
+    <tr><td class="paramname">bias</td><td>master bias image, or NULL </td></tr>
+    <tr><td class="paramname">setting</td><td>expected instrument setting </td></tr>
+    <tr><td class="paramname">saturated</td><td>(output) if non-NULL, overall saturation percentage. Defined as > 65534.4 or < 0.5 </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Newly allocated list of images</dd></dl>
-The frameset must contain a uniform set of frames.<p>
-See also <a class="el" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load()</a>. 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00257">257</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, and <a class="el" href="fors__image_8c-source.html#l00349">fors_image_load()</a>.
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l00313">fors_image_load_list_const()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, and <a class="el" href="fors__stack-test_8c-source.html#l00060">test_stack()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gab0a6629f36c4db609f1a1515d602477"></a><!-- doxytag: member="fors_image.c::fors_image_load_list_const" ref="gab0a6629f36c4db609f1a1515d602477" args="(const cpl_frameset *frames, const fors_image *bias, const fors_setting *setting, double *saturated)" -->
+<dl class="section return"><dt>Returns</dt><dd>Newly allocated list of images</dd></dl>
+<p>The frameset must contain a uniform set of frames.</p>
+<p>See also <a class="el" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load()</a>. </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00260">260</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c_source.html#l00352">fors_image_load()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__image_8c_source.html#l00316">fors_image_load_list_const()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, and <a class="el" href="fors__stack-test_8c_source.html#l00060">test_stack()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga0895dc7573734afe519fa4dff3ea33bd"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const fors_image_list* fors_image_load_list_const           </td>
+          <td class="memname">const fors_image_list* fors_image_load_list_const </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">const cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>bias</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>bias</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>saturated</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>saturated</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Load imagelist. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>see <a class="el" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list()</a> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>bias</em> </td><td>see <a class="el" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list()</a> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>see <a class="el" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list()</a> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>saturated</em> </td><td>see <a class="el" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list()</a> </td></tr>
+</div><div class="memdoc">
+
+<p>Load imagelist. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>see <a class="el" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list()</a> </td></tr>
+    <tr><td class="paramname">bias</td><td>see <a class="el" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list()</a> </td></tr>
+    <tr><td class="paramname">setting</td><td>see <a class="el" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list()</a> </td></tr>
+    <tr><td class="paramname">saturated</td><td>see <a class="el" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list()</a> </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>see <a class="el" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list()</a></dd></dl>
-This function is the same as <a class="el" href="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a">fors_image_load_list()</a>, but returns an array of const images. 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00313">313</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="fors__image_8c-source.html#l00257">fors_image_load_list()</a>.
-<p>
-Referenced by <a class="el" href="fors__bias__impl_8c-source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00103">fors_dark()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">fors_img_screen_flat()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g4d8212ca7fa00baa0880a17d2b71e410"></a><!-- doxytag: member="fors_image.c::fors_image_load" ref="g4d8212ca7fa00baa0880a17d2b71e410" args="(const cpl_frame *frame, const fors_image *bias, const fors_setting *setting, double *saturated)" -->
+<dl class="section return"><dt>Returns</dt><dd>see <a class="el" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list()</a></dd></dl>
+<p>This function is the same as <a class="el" href="group__fors__image.html#gaf3015630f60828aa86962af230cd156c" title="Load imagelist.">fors_image_load_list()</a>, but returns an array of const images. </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00316">316</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="fors__image_8c_source.html#l00260">fors_image_load_list()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias__impl_8c_source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c_source.html#l00103">fors_dark()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga88d12a30a35a7b792dba116dad95b51a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_load           </td>
+          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_load </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>frame</em>, </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>frame</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>bias</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>bias</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>saturated</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>saturated</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Load image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frame</em> </td><td>to load </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>bias</em> </td><td>master bias image, or NULL </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>expected instrument setting </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>saturated</em> </td><td>(output) If non-NULL, percentage of saturated pixels in the raw frame (before bias subtraction), defined as > 65534.4 or < 0.5 </td></tr>
+</div><div class="memdoc">
+
+<p>Load image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frame</td><td>to load </td></tr>
+    <tr><td class="paramname">bias</td><td>master bias image, or NULL </td></tr>
+    <tr><td class="paramname">setting</td><td>expected instrument setting </td></tr>
+    <tr><td class="paramname">saturated</td><td>(output) If non-NULL, percentage of saturated pixels in the raw frame (before bias subtraction), defined as > 65534.4 or < 0.5 </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Newly allocated bias image, or bias-subtracted image</dd></dl>
-The provided bias image is subtracted and used to define the raw frame error bars. If NULL, the input frame is assumed to be a raw bias and the error bars are given by the read-out-noise as defined in the FITS header. If non-NULL, this bias image is subtracted and the residual flux is used to estimate the photonic noise.<p>
-This function currently does not do overscan area correction. 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00349">349</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__setting_8h-source.html#l00067">_fors_setting::average_gain</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="test__simulate_8c-source.html#l00099">conad</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__utils_8c-source.html#l00344">fors_frame_get_group_string()</a>, <a class="el" href="f [...]
-<p>
-Referenced by <a class="el" href="fors__dark__impl_8c-source.html#l00103">fors_dark()</a>, <a class="el" href="fors__image_8c-source.html#l00257">fors_image_load_list()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__phot [...]
-</div>
-</div><p>
-<a class="anchor" name="gba23ac19606c94a04e9de87bdfe74b42"></a><!-- doxytag: member="fors_image.c::fors_image_save" ref="gba23ac19606c94a04e9de87bdfe74b42" args="(const fors_image *image, const cpl_propertylist *header, const char *filename)" -->
+<dl class="section return"><dt>Returns</dt><dd>Newly allocated bias image, or bias-subtracted image</dd></dl>
+<p>The provided bias image is subtracted and used to define the raw frame error bars. If NULL, the input frame is assumed to be a raw bias and the error bars are given by the read-out-noise as defined in the FITS header. If non-NULL, this bias image is subtracted and the residual flux is used to estimate the photonic noise.</p>
+<p>This function currently does not do overscan area correction. </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00352">352</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__utils_8c_source.html#l00344">fors_frame_get_group_string()</a>, <a class="el" href="fors__image_8c_source.html#l00128">fors_image_new()</a>, <a class="el" href="fors__image_8c_source.html#l00800">fors_image_subtract()</a>, <a class="el" href="fors__image_8c_source.html#l01032">fors_image_subtract_scalar()</a>, <a class="el" href="fors__image_8c_source.html#l00078">FORS_IMAGE_TYPE</a>, and  [...]
+
+<p>Referenced by <a class="el" href="fors__dark__impl_8c_source.html#l00103">fors_dark()</a>, <a class="el" href="fors__image_8c_source.html#l00260">fors_image_load_list()</a>, <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__p [...]
+
+</div>
+</div>
+<a class="anchor" id="ga03726eb0240d1c7711ab32b8479147a1"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_save           </td>
+          <td class="memname">void fors_image_save </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Save image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to save </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>primary FITS header, or NULL </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>filename</em> </td><td>filename</td></tr>
+</div><div class="memdoc">
+
+<p>Save image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to save </td></tr>
+    <tr><td class="paramname">header</td><td>primary FITS header, or NULL </td></tr>
+    <tr><td class="paramname">filename</td><td>filename</td></tr>
   </table>
+  </dd>
 </dl>
-The image is saved to a FITS file in the format expected by <a class="el" href="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410">fors_image_load()</a> 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00584">584</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="test__simulate_8c-source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c-source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c-source.html#l00328">create_screen_flat()</a>, <a class="el" href="test__simulate_8c-source.html#l00384">create_sky_flat()</a>, <a class="el" href="fors__dfs_8c-source.html#l01001">dfs_save()</a>, <a class="el" href="fors__image-test_8c-source.html#l00056">test_image()</a>, and <a class [...]
-</div>
-</div><p>
-<a class="anchor" name="g1ddf7d1b81954a8d2113e4f5174301a8"></a><!-- doxytag: member="fors_image.c::fors_image_save_sex" ref="g1ddf7d1b81954a8d2113e4f5174301a8" args="(const fors_image *image, const cpl_propertylist *header, const char *filename_dat, const char *filename_var, int radius)" -->
+<p>The image is saved to a FITS file in the format expected by <a class="el" href="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a" title="Load image.">fors_image_load()</a> </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00587">587</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="test__simulate_8c_source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c_source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c_source.html#l00328">create_screen_flat()</a>, <a class="el" href="test__simulate_8c_source.html#l00384">create_sky_flat()</a>, <a class="el" href="fors__dfs_8c_source.html#l01001">dfs_save()</a>, <a class="el" href="fors__image-test_8c_source.html#l00056">test_image()</a>, and <a cl [...]
+
+</div>
+</div>
+<a class="anchor" id="ga38eebeb331a65efbffbc6dc04304a786"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_save_sex           </td>
+          <td class="memname">void fors_image_save_sex </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename_dat</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename_dat</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename_var</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename_var</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>radius</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>radius</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Save image in format useable by SExtractor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to save </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>primary FITS header, or NULL </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>filename_dat</em> </td><td>filename of data values </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>filename_var</em> </td><td>filename of variances </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>radius</em> </td><td>median filter radius used to determine background error map</td></tr>
+</div><div class="memdoc">
+
+<p>Save image in format useable by SExtractor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to save </td></tr>
+    <tr><td class="paramname">header</td><td>primary FITS header, or NULL </td></tr>
+    <tr><td class="paramname">filename_dat</td><td>filename of data values </td></tr>
+    <tr><td class="paramname">filename_var</td><td>filename of variances </td></tr>
+    <tr><td class="paramname">radius</td><td>median filter radius used to determine background error map</td></tr>
   </table>
+  </dd>
 </dl>
-The image is saved to two separate FITS files 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00630">630</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l01261">fors_image_filter_median_create()</a>, <a class="el" href="fors__image_8c-source.html#l00703">fors_image_get_size_x()</a>, and <a class="el" href="fors__image_8c-source.html#l00716">fors_image_get_size_y()</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g5d33557c3f679dbb621e2387018a3b03"></a><!-- doxytag: member="fors_image.c::fors_image_get_size_x" ref="g5d33557c3f679dbb621e2387018a3b03" args="(const fors_image *image)" -->
+<p>The image is saved to two separate FITS files </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00633">633</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__image_8c_source.html#l01270">fors_image_filter_median_create()</a>, <a class="el" href="fors__image_8c_source.html#l00706">fors_image_get_size_x()</a>, and <a class="el" href="fors__image_8c_source.html#l00719">fors_image_get_size_y()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga978969a0911531b117735be291f106cc"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int fors_image_get_size_x           </td>
+          <td class="memname">int fors_image_get_size_x </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get image width. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
+<p>Get image width. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>width </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>width </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00706">706</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00703">703</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>, <a class="el" href="fors__tools_8c-source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__tools_8c-source.html#l00329">fors_fixed_pattern_noise_bias()</a>, <a class="el" href="fors__image_8c-source.html#l01204">fors_image_crop()</a>, <a class="el" href="fors__image_8c-source.html#l00630">fors_image_save_sex()</a>, <a class="el" href="fors__photometry__impl_8c-source.html [...]
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>, <a class="el" href="fors__tools_8c_source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__tools_8c_source.html#l00329">fors_fixed_pattern_noise_bias()</a>, <a class="el" href="fors__image_8c_source.html#l01213">fors_image_crop()</a>, <a class="el" href="fors__image_8c_source.html#l00633">fors_image_save_sex()</a>, <a class="el" href="fors__photometry__impl_8c_source.h [...]
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g53bd720f4c81385733f2406a5b22bdb7"></a><!-- doxytag: member="fors_image.c::fors_image_get_size_y" ref="g53bd720f4c81385733f2406a5b22bdb7" args="(const fors_image *image)" -->
+<a class="anchor" id="ga74854105003c725472595225aab740d7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int fors_image_get_size_y           </td>
+          <td class="memname">int fors_image_get_size_y </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get image height. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
+<p>Get image height. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>width </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>width </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00719">719</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00716">716</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>, <a class="el" href="fors__tools_8c-source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__tools_8c-source.html#l00329">fors_fixed_pattern_noise_bias()</a>, <a class="el" href="fors__image_8c-source.html#l01204">fors_image_crop()</a>, <a class="el" href="fors__image_8c-source.html#l00630">fors_image_save_sex()</a>, <a class="el" href="fors__photometry__impl_8c-source.html [...]
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>, <a class="el" href="fors__tools_8c_source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__tools_8c_source.html#l00329">fors_fixed_pattern_noise_bias()</a>, <a class="el" href="fors__image_8c_source.html#l01213">fors_image_crop()</a>, <a class="el" href="fors__image_8c_source.html#l00633">fors_image_save_sex()</a>, <a class="el" href="fors__photometry__impl_8c_source.h [...]
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gdffe6405bb64c769dfcdf71c6a281dad"></a><!-- doxytag: member="fors_image.c::fors_image_get_data_const" ref="gdffe6405bb64c769dfcdf71c6a281dad" args="(const fors_image *image)" -->
+<a class="anchor" id="ga547b9bf5f615a083bffdcfa9097d0520"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const float* fors_image_get_data_const           </td>
+          <td class="memname">const float* fors_image_get_data_const </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get pointer to data buffer. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
+<p>Get pointer to data buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00728">728</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l00078">FORS_IMAGE_TYPE</a>.
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00485">write_qc()</a>.
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00731">731</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c_source.html#l00078">FORS_IMAGE_TYPE</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g5ac7cb865a07bab1987284dba3676ceb"></a><!-- doxytag: member="fors_image.c::fors_image_abs" ref="g5ac7cb865a07bab1987284dba3676ceb" args="(fors_image *image)" -->
+</div>
+<a class="anchor" id="ga14651bbe94e495df34aa59b335439b8f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_abs           </td>
+          <td class="memname">void fors_image_abs </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Absolute value. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image</td></tr>
+<p>Absolute value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image</td></tr>
   </table>
+  </dd>
 </dl>
-Every pixel in the data image is set to its absolute value. The variance image is not touched 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00749">749</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>.
-</div>
-</div><p>
-<a class="anchor" name="g18f269421a43f46c063b667fac72c938"></a><!-- doxytag: member="fors_image.c::fors_image_square" ref="g18f269421a43f46c063b667fac72c938" args="(fors_image *image)" -->
+<p>Every pixel in the data image is set to its absolute value. The variance image is not touched </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00752">752</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gad4ecbb0eb96611d66dc9a3a1bc2ae0d8"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_square           </td>
+          <td class="memname">void fors_image_square </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Squared. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image</td></tr>
+<p>Squared. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image</td></tr>
   </table>
+  </dd>
 </dl>
-Every pixel in the data image is set to p_i := p_i^2 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00768">768</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00485">write_qc()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gacbedc7a6d48a3838d66923912a5b712"></a><!-- doxytag: member="fors_image.c::fors_image_subtract" ref="gacbedc7a6d48a3838d66923912a5b712" args="(fors_image *left, const fors_image *right)" -->
+<p>Every pixel in the data image is set to p_i := p_i^2 </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00771">771</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaf66086d63ad85bd81e5847ee962fc0be"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_subtract           </td>
+          <td class="memname">void fors_image_subtract </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>left</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>left</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>right</em></td><td> </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>right</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Subtract images. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>left</em> </td><td>image to be subtracted from </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>right</em> </td><td>image to subtract</td></tr>
+<p>Subtract images. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">left</td><td>image to be subtracted from </td></tr>
+    <tr><td class="paramname">right</td><td>image to subtract</td></tr>
   </table>
+  </dd>
 </dl>
-New variance image is computed as sigma_left**2 + sigma_right**2 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00797">797</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__tools_8c-source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__tools_8c-source.html#l00329">fors_fixed_pattern_noise_bias()</a>, <a class="el" href="fors__image_8c-source.html#l00349">fors_image_load()</a>, <a class="el" href="fors__image-test_8c-source.html#l00198">test_subtract()</a>, and <a class="el" href="fors__bias__impl_8c-source.html#l00172">write_qc()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g0769427c961bdf0fd79eda47fcadeee2"></a><!-- doxytag: member="fors_image.c::fors_image_multiply_noerr" ref="g0769427c961bdf0fd79eda47fcadeee2" args="(fors_image *left, const cpl_image *right)" -->
+<p>New variance image is computed as sigma_left**2 + sigma_right**2 </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00800">800</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__tools_8c_source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__tools_8c_source.html#l00329">fors_fixed_pattern_noise_bias()</a>, <a class="el" href="fors__image_8c_source.html#l00352">fors_image_load()</a>, <a class="el" href="fors__image-test_8c_source.html#l00198">test_subtract()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga25c0e2f6005831b9f5fcf3d81accfc43"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_multiply_noerr           </td>
+          <td class="memname">void fors_image_multiply_noerr </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>left</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>left</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_image * </td>
-          <td class="paramname"> <em>right</em></td><td> </td>
+          <td class="paramtype">const cpl_image * </td>
+          <td class="paramname"><em>right</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Multiply images. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>left</em> </td><td>image to be change </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>right</em> </td><td>factor</td></tr>
+<p>Multiply images. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">left</td><td>image to be change </td></tr>
+    <tr><td class="paramname">right</td><td>factor</td></tr>
   </table>
+  </dd>
 </dl>
-Data values and error bars change according to<p>
-data_i := data_i * factor_i sigma_i := sigma_i * factor_i 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00825">825</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-</div>
-</div><p>
-<a class="anchor" name="g4c8774a9e651df6d05689d208fb349e1"></a><!-- doxytag: member="fors_image.c::fors_image_divide_noerr" ref="g4c8774a9e651df6d05689d208fb349e1" args="(fors_image *left, cpl_image *right)" -->
+<p>Data values and error bars change according to</p>
+<p>data_i := data_i * factor_i sigma_i := sigma_i * factor_i </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00828">828</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga88aca44b1a0bde06bbd43c487ae58766"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_divide_noerr           </td>
+          <td class="memname">void fors_image_divide_noerr </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>left</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>left</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>right</em></td><td> </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>right</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Divide images. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>left</em> </td><td>image to be divided </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>right</em> </td><td>divisor (modified! zero values are set to one)</td></tr>
+<p>Divide images. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">left</td><td>image to be divided </td></tr>
+    <tr><td class="paramname">right</td><td>divisor (modified! zero values are set to one)</td></tr>
   </table>
+  </dd>
 </dl>
-This function does not propagate the divisor error bars<p>
-Data values and error bars change according to<p>
-data_i := data_i / divisor_i sigma_i := sigma_i / divisor_i for divisor_i != 0<p>
-data_i := 1 sigma_i := infinity for divisor_i == 0 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00863">863</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l00079">FORS_IMAGE_TYPE_MAX</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00299">remove_large_scale()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00407">remove_large_scale_fit()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g56dbb1b1a81ac64b9b19effa13bafec4"></a><!-- doxytag: member="fors_image.c::fors_image_divide" ref="g56dbb1b1a81ac64b9b19effa13bafec4" args="(fors_image *left, const fors_image *right)" -->
+<p>This function does not propagate the divisor error bars</p>
+<p>Data values and error bars change according to</p>
+<p>data_i := data_i / divisor_i sigma_i := sigma_i / divisor_i for divisor_i != 0</p>
+<p>data_i := 1 sigma_i := infinity for divisor_i == 0 </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00869">869</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00299">remove_large_scale()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00409">remove_large_scale_fit()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga19f8c27621d28b8443d49f59af6cc2b2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_divide           </td>
+          <td class="memname">void fors_image_divide </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>left</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>left</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>right</em></td><td> </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>right</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Divide images. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>left</em> </td><td>image to be divided </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>right</em> </td><td>divisor</td></tr>
+<p>Divide images. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">left</td><td>image to be divided </td></tr>
+    <tr><td class="paramname">right</td><td>divisor</td></tr>
   </table>
+  </dd>
 </dl>
-Data values and error bars change according to<p>
-data := data1 / data2 sigma^2 := sigma1^2 / data2^2 + sigma2^2 data1^2 / data2^4<p>
-<em>left</em> and <em>right</em> may point to the same image, note however that the error propagation formula assumes uncorrelated noise<p>
-Division by zero does is not an error but is handled by setting<p>
-data_i := 1 sigma_i := infinity 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00925">925</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l00172">fors_image_duplicate()</a>, <a class="el" href="fors__image_8c-source.html#l00079">FORS_IMAGE_TYPE_MAX</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>, <a class="el" href="fors__image-test_8c-source.html#l00283">test_divide()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00485">write_qc()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g15f95ab361e6c2ea44bafbada5d8d4a1"></a><!-- doxytag: member="fors_image.c::fors_image_multiply" ref="g15f95ab361e6c2ea44bafbada5d8d4a1" args="(fors_image *left, const fors_image *right)" -->
+<p>Data values and error bars change according to</p>
+<p>data := data1 / data2 sigma^2 := sigma1^2 / data2^2 + sigma2^2 data1^2 / data2^4</p>
+<p><em>left</em> and <em>right</em> may point to the same image, note however that the error propagation formula assumes uncorrelated noise</p>
+<p>Division by zero does is not an error but is handled by setting</p>
+<p>data_i := 1 sigma_i := infinity </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00934">934</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c_source.html#l00175">fors_image_duplicate()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>, <a class="el" href="fors__image-test_8c_source.html#l00283">test_divide()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaaa54b1e6e0e3cf5fcf442267896f6dad"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_multiply           </td>
+          <td class="memname">void fors_image_multiply </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>left</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>left</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>right</em></td><td> </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>right</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Multiply images. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>left</em> </td><td>1st factor (changed) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>right</em> </td><td>2nd factor</td></tr>
+<p>Multiply images. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">left</td><td>1st factor (changed) </td></tr>
+    <tr><td class="paramname">right</td><td>2nd factor</td></tr>
   </table>
+  </dd>
 </dl>
-Data values and error bars change according to<p>
-data1 := data1 * data2 sigma1^2 := sigma1^2 data2^2 + sigma2^2 data1^2 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00987">987</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g50a06b605ca558553e0642209b93c100"></a><!-- doxytag: member="fors_image.c::fors_image_subtract_scalar" ref="g50a06b605ca558553e0642209b93c100" args="(fors_image *image, double s, double ds)" -->
+<p>Data values and error bars change according to</p>
+<p>data1 := data1 * data2 sigma1^2 := sigma1^2 data2^2 + sigma2^2 data1^2 </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00996">996</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gacbfb7c0518043b1079bb72af95d80961"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_subtract_scalar           </td>
+          <td class="memname">void fors_image_subtract_scalar </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ds</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ds</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Subtract scalar. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to be divided </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>scalar </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ds</em> </td><td>error (one sigma) of s, a positive error bar is unsupported</td></tr>
+</div><div class="memdoc">
+
+<p>Subtract scalar. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to be divided </td></tr>
+    <tr><td class="paramname">s</td><td>scalar </td></tr>
+    <tr><td class="paramname">ds</td><td>error (one sigma) of s, a positive error bar is unsupported</td></tr>
   </table>
+  </dd>
 </dl>
-If ds is negative, data values and error bars change according to<p>
-data_i := data_i - s sigma_i := sigma_i 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01023">1023</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>.
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l00349">fors_image_load()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00485">write_qc()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gcc9714a987782f7a8ab25d7548c27eff"></a><!-- doxytag: member="fors_image.c::fors_image_divide_scalar" ref="gcc9714a987782f7a8ab25d7548c27eff" args="(fors_image *image, double s, double ds)" -->
+<p>If ds is negative, data values and error bars change according to</p>
+<p>data_i := data_i - s sigma_i := sigma_i </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01032">1032</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__image_8c_source.html#l00352">fors_image_load()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gacfa2ae6fb10e4178a658b96d45daad35"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_divide_scalar           </td>
+          <td class="memname">void fors_image_divide_scalar </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ds</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ds</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Divide by scalar. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to be divided </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>scalar </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ds</em> </td><td>error (one sigma) of s, a positive error bar is unsupported for now</td></tr>
+</div><div class="memdoc">
+
+<p>Divide by scalar. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to be divided </td></tr>
+    <tr><td class="paramname">s</td><td>scalar </td></tr>
+    <tr><td class="paramname">ds</td><td>error (one sigma) of s, a positive error bar is unsupported for now</td></tr>
   </table>
+  </dd>
 </dl>
-If ds is negative, data values and error bars change according to<p>
-data_i := data_i / s sigma_i := sigma_i / s 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01048">1048</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00485">write_qc()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g077f7a5a847fa9c0e458dca2e12e4e6f"></a><!-- doxytag: member="fors_image.c::fors_image_multiply_scalar" ref="g077f7a5a847fa9c0e458dca2e12e4e6f" args="(fors_image *image, double s, double ds)" -->
+<p>If ds is negative, data values and error bars change according to</p>
+<p>data_i := data_i / s sigma_i := sigma_i / s </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01057">1057</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gadd751e2623f778d5bb2b8f3b628077c2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_multiply_scalar           </td>
+          <td class="memname">void fors_image_multiply_scalar </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ds</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ds</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Multiply by scalar. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to be multiplied </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>scalar </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ds</em> </td><td>error (one sigma) of s, a positive error bar is unsupported for now</td></tr>
+</div><div class="memdoc">
+
+<p>Multiply by scalar. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to be multiplied </td></tr>
+    <tr><td class="paramname">s</td><td>scalar </td></tr>
+    <tr><td class="paramname">ds</td><td>error (one sigma) of s, a positive error bar is unsupported for now</td></tr>
   </table>
+  </dd>
 </dl>
-If ds is negative, data values and error bars change according to<p>
-data_i := data_i * s sigma_i := sigma_i * s 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01074">1074</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00485">write_qc()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g78afca4bf8e5c3dc80d0dcd7f682f9e9"></a><!-- doxytag: member="fors_image.c::fors_image_exponential" ref="g78afca4bf8e5c3dc80d0dcd7f682f9e9" args="(fors_image *image, double b, double db)" -->
+<p>If ds is negative, data values and error bars change according to</p>
+<p>data_i := data_i * s sigma_i := sigma_i * s </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01083">1083</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gabe2039c17c13fed0e430d71cb38454bf"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_exponential           </td>
+          <td class="memname">void fors_image_exponential </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>b</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>b</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>db</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>db</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Exponential. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to be exponentiated </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>b</em> </td><td>base </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>db</em> </td><td>error (one sigma) of b, a positive error bar is unsupported</td></tr>
+</div><div class="memdoc">
+
+<p>Exponential. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to be exponentiated </td></tr>
+    <tr><td class="paramname">b</td><td>base </td></tr>
+    <tr><td class="paramname">db</td><td>error (one sigma) of b, a positive error bar is unsupported</td></tr>
   </table>
+  </dd>
 </dl>
-If ds is negative, data values and error bars change according to<p>
-data_i := b ^ data_i sigma_i := b ^ data_i ln(b) sigma_i 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01103">1103</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, and <a class="el" href="fors__image-test_8c-source.html#l00245">test_exponential()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gc4edb9a966bcf97a17ad6a5c1b9d020f"></a><!-- doxytag: member="fors_image.c::fors_image_get_min" ref="gc4edb9a966bcf97a17ad6a5c1b9d020f" args="(const fors_image *image)" -->
+<p>If ds is negative, data values and error bars change according to</p>
+<p>data_i := b ^ data_i sigma_i := b ^ data_i ln(b) sigma_i </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01112">1112</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, and <a class="el" href="fors__image-test_8c_source.html#l00245">test_exponential()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga918a9107b07852d77bd457ea44d9b28e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_image_get_min           </td>
+          <td class="memname">double fors_image_get_min </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get min data value. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
+<p>Get min data value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>min data value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>min data value </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01140">1140</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>, and <a class="el" href="fors__image-test_8c_source.html#l00056">test_image()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01131">1131</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>, and <a class="el" href="fors__image-test_8c-source.html#l00056">test_image()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g5c7d9b043db23a40e632ffc34c3f3d5c"></a><!-- doxytag: member="fors_image.c::fors_image_get_max" ref="g5c7d9b043db23a40e632ffc34c3f3d5c" args="(const fors_image *image)" -->
+</div>
+<a class="anchor" id="ga8bde38b5f976d70ab7d6cef4652e1a51"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_image_get_max           </td>
+          <td class="memname">double fors_image_get_max </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get max data value. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
+<p>Get max data value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>max data value </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>max data value </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01155">1155</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01146">1146</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>.
-<p>
-Referenced by <a class="el" href="fors__image-test_8c-source.html#l00056">test_image()</a>.
+<p>Referenced by <a class="el" href="fors__image-test_8c_source.html#l00056">test_image()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gfcbb208a8336f751ebf8119b17e70aa3"></a><!-- doxytag: member="fors_image.c::fors_image_get_mean" ref="gfcbb208a8336f751ebf8119b17e70aa3" args="(const fors_image *image, double *dmean)" -->
+<a class="anchor" id="gaf4cbc4ac53ba9049e498abc43eff312f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_image_get_mean           </td>
+          <td class="memname">double fors_image_get_mean </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>dmean</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>dmean</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get mean data value. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dmean</em> </td><td>(output) error of estimate </td></tr>
+<p>Get mean data value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
+    <tr><td class="paramname">dmean</td><td>(output) error of estimate </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>arithmetic average </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>arithmetic average </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01171">1171</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias-test_8c_source.html#l00062">test_bias()</a>, <a class="el" href="fors__dark-test_8c_source.html#l00062">test_dark()</a>, <a class="el" href="fors__image-test_8c_source.html#l00283">test_divide()</a>, <a class="el" href="fors__image-test_8c_source.html#l00245">test_exponential()</a>, <a class="el" href="fors__image-test_8c_source.html#l00056">test_image()</a>, <a class="el" href="fors__img__screen__flat-test_8c_source.html#l00065">test_img_s [...]
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01162">1162</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>.
-<p>
-Referenced by <a class="el" href="fors__bias-test_8c-source.html#l00062">test_bias()</a>, <a class="el" href="fors__dark-test_8c-source.html#l00062">test_dark()</a>, <a class="el" href="fors__image-test_8c-source.html#l00283">test_divide()</a>, <a class="el" href="fors__image-test_8c-source.html#l00245">test_exponential()</a>, <a class="el" href="fors__image-test_8c-source.html#l00056">test_image()</a>, <a class="el" href="fors__img__screen__flat-test_8c-source.html#l00065">test_img_scre [...]
 </div>
-</div><p>
-<a class="anchor" name="gf4b42869081aad7a0af57b50eedf9f21"></a><!-- doxytag: member="fors_image.c::fors_image_get_median" ref="gf4b42869081aad7a0af57b50eedf9f21" args="(const fors_image *image, double *dmedian)" -->
+</div>
+<a class="anchor" id="ga428a8273a1d3070a80cd7e82651a2dcb"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_image_get_median           </td>
+          <td class="memname">double fors_image_get_median </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>dmedian</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>dmedian</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get median data value. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dmedian</em> </td><td>(output) error of estimate </td></tr>
+<p>Get median data value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
+    <tr><td class="paramname">dmedian</td><td>(output) error of estimate </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>median of values </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>median of values </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01188">1188</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01179">1179</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>.
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l01590">fors_image_get_stdev_robust()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>, <a class="el" href="fors_ [...]
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__image_8c_source.html#l01599">fors_image_get_stdev_robust()</a>, <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>, <a class="el" href="fo [...]
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gf0bdf78bba3bf571d3eb313233dda2b2"></a><!-- doxytag: member="fors_image.c::fors_image_crop" ref="gf0bdf78bba3bf571d3eb313233dda2b2" args="(fors_image *image, int xlo, int ylo, int xhi, int yhi)" -->
+<a class="anchor" id="ga86343e578ebfa129195e6465e7e60053"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_crop           </td>
+          <td class="memname">void fors_image_crop </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>xlo</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>xlo</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ylo</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ylo</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>xhi</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>xhi</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>yhi</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>yhi</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Crop image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>xlo</em> </td><td>lower left x </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ylo</em> </td><td>lower left y </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>xhi</em> </td><td>upper right x </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>yhi</em> </td><td>upper right y</td></tr>
+</div><div class="memdoc">
+
+<p>Crop image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
+    <tr><td class="paramname">xlo</td><td>lower left x </td></tr>
+    <tr><td class="paramname">ylo</td><td>lower left y </td></tr>
+    <tr><td class="paramname">xhi</td><td>upper right x </td></tr>
+    <tr><td class="paramname">yhi</td><td>upper right y</td></tr>
   </table>
+  </dd>
 </dl>
-This function does a locale image extraction, that is the parts outside the rectangular region (xlo, ylo) - (xhi, yhi) are removed.<p>
-Coordinates are inclusive, counting from 1 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01204">1204</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l00703">fors_image_get_size_x()</a>, <a class="el" href="fors__image_8c-source.html#l00716">fors_image_get_size_y()</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>, <a class="el" href="fors__tools_8c-source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__tools_8c-source.html#l00329">fors_fixed_pattern_noise_bias()</a>, <a class="el" href="fors__image-test_8c-source.html#l00056">test_image()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00485">write_qc()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g96498be3e15cde80921709406c33b6f3"></a><!-- doxytag: member="fors_image.c::fors_image_filter_median_create" ref="g96498be3e15cde80921709406c33b6f3" args="(const fors_image *image, int xradius, int yradius, int xstart, int ystart, int xend, int yend, int xstep, int ystep, bool use_data)" -->
+<p>This function does a locale image extraction, that is the parts outside the rectangular region (xlo, ylo) - (xhi, yhi) are removed.</p>
+<p>Coordinates are inclusive, counting from 1 </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01213">1213</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__image_8c_source.html#l00706">fors_image_get_size_x()</a>, and <a class="el" href="fors__image_8c_source.html#l00719">fors_image_get_size_y()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>, <a class="el" href="fors__tools_8c_source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__tools_8c_source.html#l00329">fors_fixed_pattern_noise_bias()</a>, <a class="el" href="fors__image-test_8c_source.html#l00056">test_image()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga395b18920e75b55d9a793dfbcb99755f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* fors_image_filter_median_create           </td>
+          <td class="memname">cpl_image* fors_image_filter_median_create </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>xradius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>xradius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>yradius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>yradius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>xstart</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>xstart</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ystart</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ystart</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>xend</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>xend</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>yend</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>yend</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>xstep</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>xstep</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ystep</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ystep</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">bool </td>
-          <td class="paramname"> <em>use_data</em></td><td> </td>
+          <td class="paramtype">bool </td>
+          <td class="paramname"><em>use_data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Smooth image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to filter </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>xradius</em> </td><td>half x window size </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>yradius</em> </td><td>half y window size </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>xstart</em> </td><td>x start </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ystart</em> </td><td>y start </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>xend</em> </td><td>x end </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>yend</em> </td><td>y end </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>xstep</em> </td><td>x-distance between kernel sampling positions The value 1 gives a normal median filter. The center of the kernel is always sampled, therefore edge locations are conserved Note: periodic structure on the scale xstep is *not* smoothed out </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ystep</em> </td><td>see xstep </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>use_data</em> </td><td>if true, the data values are filtered, otherwise the variance map is filtered</td></tr>
+</div><div class="memdoc">
+
+<p>Smooth image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to filter </td></tr>
+    <tr><td class="paramname">xradius</td><td>half x window size </td></tr>
+    <tr><td class="paramname">yradius</td><td>half y window size </td></tr>
+    <tr><td class="paramname">xstart</td><td>x start </td></tr>
+    <tr><td class="paramname">ystart</td><td>y start </td></tr>
+    <tr><td class="paramname">xend</td><td>x end </td></tr>
+    <tr><td class="paramname">yend</td><td>y end </td></tr>
+    <tr><td class="paramname">xstep</td><td>x-distance between kernel sampling positions The value 1 gives a normal median filter. The center of the kernel is always sampled, therefore edge locations are conserved Note: periodic structure on the scale xstep is <em>not</em> smoothed out </td></tr>
+    <tr><td class="paramname">ystep</td><td>see xstep </td></tr>
+    <tr><td class="paramname">use_data</td><td>if true, the data values are filtered, otherwise the variance map is filtered</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Newly allocated image, no error bars are provided</dd></dl>
-Window size is (2 * xradius + 1) * (2 * yradius + 1)<p>
-At the image border, the median is computed using the available (fewer) pixels 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01261">1261</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l00078">FORS_IMAGE_TYPE</a>, <a class="el" href="fors__utils_8c-source.html#l00250">fors_tools_get_median_float()</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l00630">fors_image_save_sex()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00299">remove_large_scale()</a>, and <a class="el" href="fors__image-test_8c-source.html#l00148">test_median_filter()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g315f5476160ed7db282a7623f0d354b0"></a><!-- doxytag: member="fors_image.c::fors_image_filter_max_create" ref="g315f5476160ed7db282a7623f0d354b0" args="(const fors_image *image, int xradius, int yradius, bool use_data)" -->
+<dl class="section return"><dt>Returns</dt><dd>Newly allocated image, no error bars are provided</dd></dl>
+<p>Window size is (2 * xradius + 1) * (2 * yradius + 1)</p>
+<p>At the image border, the median is computed using the available (fewer) pixels </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01270">1270</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__image_8c_source.html#l00078">FORS_IMAGE_TYPE</a>, and <a class="el" href="fors__utils_8c_source.html#l00250">fors_tools_get_median_float()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__image_8c_source.html#l00633">fors_image_save_sex()</a>, <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00299">remove_large_scale()</a>, and <a class="el" href="fors__image-test_8c_source.html#l00148">test_median_filter()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga21965427a98e2e07cf0b167e4610da1c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* fors_image_filter_max_create           </td>
+          <td class="memname">cpl_image* fors_image_filter_max_create </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>xradius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>xradius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>yradius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>yradius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">bool </td>
-          <td class="paramname"> <em>use_data</em></td><td> </td>
+          <td class="paramtype">bool </td>
+          <td class="paramname"><em>use_data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Max filter image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to filter </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>xradius</em> </td><td>half x window size </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>yradius</em> </td><td>half y window size </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>use_data</em> </td><td>if true, the data values are filtered, otherwise the variance map is filtered</td></tr>
+</div><div class="memdoc">
+
+<p>Max filter image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to filter </td></tr>
+    <tr><td class="paramname">xradius</td><td>half x window size </td></tr>
+    <tr><td class="paramname">yradius</td><td>half y window size </td></tr>
+    <tr><td class="paramname">use_data</td><td>if true, the data values are filtered, otherwise the variance map is filtered</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Newly allocated image, no error bars are provided</dd></dl>
-Window size is (2 * xradius + 1) * (2 * yradius + 1)<p>
-At the image border, the max value is computed repeating the last found at half window size from the edge. 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01494">1494</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l00078">FORS_IMAGE_TYPE</a>, <a class="el" href="fors__image_8c-source.html#l00092">max_filter()</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g9b3437d12d87ecb5a0f69fdfd51d2257"></a><!-- doxytag: member="fors_image.c::fors_image_get_stdev" ref="g9b3437d12d87ecb5a0f69fdfd51d2257" args="(const fors_image *image, double *dstdev)" -->
+<dl class="section return"><dt>Returns</dt><dd>Newly allocated image, no error bars are provided</dd></dl>
+<p>Window size is (2 * xradius + 1) * (2 * yradius + 1)</p>
+<p>At the image border, the max value is computed repeating the last found at half window size from the edge. </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01503">1503</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c_source.html#l00078">FORS_IMAGE_TYPE</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga0729fde58e241c5ab03de7255fc5783e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_image_get_stdev           </td>
+          <td class="memname">double fors_image_get_stdev </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>dstdev</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>dstdev</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get empirical stdev of data. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dstdev</em> </td><td>(output) error of estimate </td></tr>
+<p>Get empirical stdev of data. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
+    <tr><td class="paramname">dstdev</td><td>(output) error of estimate </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>empirical stdev (scatter around mean) </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>empirical stdev (scatter around mean) </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01578">1578</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01569">1569</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>.
-<p>
-Referenced by <a class="el" href="fors__tools_8c-source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__bias-test_8c-source.html#l00062">test_bias()</a>, <a class="el" href="fors__image-test_8c-source.html#l00056">test_image()</a>, <a class="el" href="fors__stack-test_8c-source.html#l00060">test_stack()</a>, and <a class="el" href="fors__bias__impl_8c-source.html#l00172">write_qc()</a>.
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__tools_8c_source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__bias-test_8c_source.html#l00062">test_bias()</a>, <a class="el" href="fors__image-test_8c_source.html#l00056">test_image()</a>, <a class="el" href="fors__stack-test_8c_source.html#l00060">test_stack()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g6467069b6450c28087a3a0d5a695911b"></a><!-- doxytag: member="fors_image.c::fors_image_get_stdev_robust" ref="g6467069b6450c28087a3a0d5a695911b" args="(const fors_image *image, double cut, double *dstdev)" -->
+<a class="anchor" id="ga6dd8e98a349a0711fae2c24ff07c5a10"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_image_get_stdev_robust           </td>
+          <td class="memname">double fors_image_get_stdev_robust </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>cut</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>cut</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>dstdev</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>dstdev</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get robust empirical stdev of data. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>cut</em> </td><td>pixels outside median +- cut are ignored </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dstdev</em> </td><td>(output) error of estimate </td></tr>
+</div><div class="memdoc">
+
+<p>Get robust empirical stdev of data. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
+    <tr><td class="paramname">cut</td><td>pixels outside median +- cut are ignored </td></tr>
+    <tr><td class="paramname">dstdev</td><td>(output) error of estimate </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>empirical stdev (scatter around median, not mean) </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>empirical stdev (scatter around median, not mean) </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01599">1599</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c_source.html#l01188">fors_image_get_median()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__tools_8c_source.html#l00329">fors_fixed_pattern_noise_bias()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01590">1590</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l01179">fors_image_get_median()</a>.
-<p>
-Referenced by <a class="el" href="fors__tools_8c-source.html#l00329">fors_fixed_pattern_noise_bias()</a>, and <a class="el" href="fors__bias__impl_8c-source.html#l00172">write_qc()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g0c54aa21dd94d212c389d89d128580b0"></a><!-- doxytag: member="fors_image.c::fors_image_get_error_mean" ref="g0c54aa21dd94d212c389d89d128580b0" args="(const fors_image *image, double *dmean)" -->
+</div>
+<a class="anchor" id="ga1ed97db3c18526c96984e42ced6cc2c4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_image_get_error_mean           </td>
+          <td class="memname">double fors_image_get_error_mean </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>dmean</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>dmean</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get mean of error bars. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dmean</em> </td><td>(output) error of estimate </td></tr>
+<p>Get mean of error bars. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>image </td></tr>
+    <tr><td class="paramname">dmean</td><td>(output) error of estimate </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>average of error bars</dd></dl>
-The average is computed as<p>
-(1/N * sum_i sigma_i^2)^(1/2) 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01633">1633</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__bias-test_8c-source.html#l00062">test_bias()</a>, <a class="el" href="fors__dark-test_8c-source.html#l00062">test_dark()</a>, <a class="el" href="fors__image-test_8c-source.html#l00283">test_divide()</a>, <a class="el" href="fors__img__screen__flat-test_8c-source.html#l00065">test_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat-test_8c-source.html#l00062">test_img_sky_flat()</a>, <a class="el" href="fors__stack-test_8c-source.html#l [...]
-</div>
-</div><p>
-<a class="anchor" name="g4154f529cbabe4cb4d1203d03e771f8a"></a><!-- doxytag: member="fors_image.c::fors_image_collapse_create" ref="g4154f529cbabe4cb4d1203d03e771f8a" args="(const fors_image_list *images)" -->
+<dl class="section return"><dt>Returns</dt><dd>average of error bars</dd></dl>
+<p>The average is computed as</p>
+<p>(1/N * sum_i sigma_i^2)^(1/2) </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01642">1642</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias-test_8c_source.html#l00062">test_bias()</a>, <a class="el" href="fors__dark-test_8c_source.html#l00062">test_dark()</a>, <a class="el" href="fors__image-test_8c_source.html#l00283">test_divide()</a>, <a class="el" href="fors__img__screen__flat-test_8c_source.html#l00065">test_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat-test_8c_source.html#l00062">test_img_sky_flat()</a>, <a class="el" href="fors__stack-test_8c_source.htm [...]
+
+</div>
+</div>
+<a class="anchor" id="ga5510f4f5ebec4c99de3d9567b4eca21d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_collapse_create           </td>
+          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_collapse_create </td>
           <td>(</td>
-          <td class="paramtype">const fors_image_list * </td>
-          <td class="paramname"> <em>images</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const fors_image_list * </td>
+          <td class="paramname"><em>images</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Average collapse. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>images</em> </td><td>list of images to collapse </td></tr>
+<p>Average collapse. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">images</td><td>list of images to collapse </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated stacked image</dd></dl>
-Variance is computed as (sum_i var_i) / N*N 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01665">1665</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l00128">fors_image_new()</a>, <a class="el" href="fors__utils_8c-source.html#l00597">fors_imagelist_collapse_create()</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__stack_8c-source.html#l00298">fors_stack_const()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gfe360dbc95e94b6b1043401aef8cbacc"></a><!-- doxytag: member="fors_image.c::fors_image_collapse_minmax_create" ref="gfe360dbc95e94b6b1043401aef8cbacc" args="(const fors_image_list *images, int low, int high)" -->
+<dl class="section return"><dt>Returns</dt><dd>newly allocated stacked image</dd></dl>
+<p>Variance is computed as (sum_i var_i) / N*N </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01674">1674</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__image_8c_source.html#l00128">fors_image_new()</a>, and <a class="el" href="fors__utils_8c_source.html#l00597">fors_imagelist_collapse_create()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__stack_8c_source.html#l00298">fors_stack_const()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga41938f63e18b05073716d2afed9bd4a3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_collapse_minmax_create           </td>
+          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_collapse_minmax_create </td>
           <td>(</td>
-          <td class="paramtype">const fors_image_list * </td>
-          <td class="paramname"> <em>images</em>, </td>
+          <td class="paramtype">const fors_image_list * </td>
+          <td class="paramname"><em>images</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>low</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>low</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>high</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>high</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Minmax collapse. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>images</em> </td><td>list of images to collapse </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>low</em> </td><td>number of low rejected values </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>high</em> </td><td>number of high rejected values </td></tr>
+</div><div class="memdoc">
+
+<p>Minmax collapse. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">images</td><td>list of images to collapse </td></tr>
+    <tr><td class="paramname">low</td><td>number of low rejected values </td></tr>
+    <tr><td class="paramname">high</td><td>number of high rejected values </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated stacked image</dd></dl>
-Variance is computed as (sum_i var_i) / N*N 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01731">1731</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l00128">fors_image_new()</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__stack_8c-source.html#l00298">fors_stack_const()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g9f084a5b4f1564f1efb645e342eee2af"></a><!-- doxytag: member="fors_image.c::fors_image_collapse_ksigma_create" ref="g9f084a5b4f1564f1efb645e342eee2af" args="(const fors_image_list *images, int low, int high, int iter)" -->
+<dl class="section return"><dt>Returns</dt><dd>newly allocated stacked image</dd></dl>
+<p>Variance is computed as (sum_i var_i) / N*N </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01740">1740</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__image_8c_source.html#l00128">fors_image_new()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__stack_8c_source.html#l00298">fors_stack_const()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga3789562f96e6c162f90d51388d372a88"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_collapse_ksigma_create           </td>
+          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_collapse_ksigma_create </td>
           <td>(</td>
-          <td class="paramtype">const fors_image_list * </td>
-          <td class="paramname"> <em>images</em>, </td>
+          <td class="paramtype">const fors_image_list * </td>
+          <td class="paramname"><em>images</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>low</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>low</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>high</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>high</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>iter</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>iter</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Ksigma collapse. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>images</em> </td><td>list of images to collapse </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>low</em> </td><td>lower number of sigmas </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>high</em> </td><td>higher number of sigmas </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>iter</em> </td><td>max number of iterations </td></tr>
+</div><div class="memdoc">
+
+<p>Ksigma collapse. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">images</td><td>list of images to collapse </td></tr>
+    <tr><td class="paramname">low</td><td>lower number of sigmas </td></tr>
+    <tr><td class="paramname">high</td><td>higher number of sigmas </td></tr>
+    <tr><td class="paramname">iter</td><td>max number of iterations </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated stacked image</dd></dl>
-Variance is computed as (sum_i var_i) / N_i*N_i, where N_i is from the contribution map. 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01787">1787</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l00128">fors_image_new()</a>, <a class="el" href="moses_8c-source.html#l17463">mos_ksigma_stack()</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__stack_8c-source.html#l00298">fors_stack_const()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gbd2b7e8761473ff4ca42f90fa879e1ad"></a><!-- doxytag: member="fors_image.c::fors_image_collapse_median_create" ref="gbd2b7e8761473ff4ca42f90fa879e1ad" args="(const fors_image_list *images)" -->
+<dl class="section return"><dt>Returns</dt><dd>newly allocated stacked image</dd></dl>
+<p>Variance is computed as (sum_i var_i) / N_i*N_i, where N_i is from the contribution map. </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01796">1796</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__image_8c_source.html#l00128">fors_image_new()</a>, and <a class="el" href="moses_8c_source.html#l17680">mos_ksigma_stack()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__stack_8c_source.html#l00298">fors_stack_const()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga0d7aab18ef2992f7efba3ab24f7af503"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_collapse_median_create           </td>
+          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_image_collapse_median_create </td>
           <td>(</td>
-          <td class="paramtype">const fors_image_list * </td>
-          <td class="paramname"> <em>images</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const fors_image_list * </td>
+          <td class="paramname"><em>images</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Median collapse. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>images</em> </td><td>list of images to collapse </td></tr>
+<p>Median collapse. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">images</td><td>list of images to collapse </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated stacked image</dd></dl>
-Variance is computed as f(N)^2 (sum_i var_i) / N*N<p>
-where f(N) is given by <a class="el" href="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3">fors_utils_median_corr()</a> 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01839">1839</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, <a class="el" href="fors__image_8c-source.html#l00128">fors_image_new()</a>, <a class="el" href="fors__utils_8c-source.html#l00597">fors_imagelist_collapse_create()</a>, <a class="el" href="fors__utils_8c-source.html#l00616">fors_imagelist_collapse_median_create()</a>,  [...]
-<p>
-Referenced by <a class="el" href="fors__stack_8c-source.html#l00298">fors_stack_const()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g5b5539c0e15fe20c16bedc58e8263724"></a><!-- doxytag: member="fors_image.c::fors_image_draw" ref="g5b5539c0e15fe20c16bedc58e8263724" args="(fors_image *image, int type, double x, double y, int radius, double color)" -->
+<dl class="section return"><dt>Returns</dt><dd>newly allocated stacked image</dd></dl>
+<p>Variance is computed as f(N)^2 (sum_i var_i) / N*N</p>
+<p>where f(N) is given by <a class="el" href="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3" title="median stacking correction factor">fors_utils_median_corr()</a> </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01848">1848</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__image_8c_source.html#l00128">fors_image_new()</a>, <a class="el" href="fors__utils_8c_source.html#l00597">fors_imagelist_collapse_create()</a>, <a class="el" href="fors__utils_8c_source.html#l00616">fors_imagelist_collapse_median_create()</a>, and <a class="el" href="fors__utils_8c_source.html#l00696">fors_utils_median_corr()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__stack_8c_source.html#l00298">fors_stack_const()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga84a11915fdc3ac7ae1c9535d9eadfeeb"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_image_draw           </td>
+          <td class="memname">void fors_image_draw </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>type</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>type</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>x</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>x</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>y</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>y</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>radius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>radius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>color</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>color</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Draw on image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>to draw on </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>type of thing to draw </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>x</em> </td><td>position </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>y</em> </td><td>position </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>radius</em> </td><td>size of thing to draw </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>color</em> </td><td>pixel value used for drawing</td></tr>
+</div><div class="memdoc">
+
+<p>Draw on image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>to draw on </td></tr>
+    <tr><td class="paramname">type</td><td>type of thing to draw </td></tr>
+    <tr><td class="paramname">x</td><td>position </td></tr>
+    <tr><td class="paramname">y</td><td>position </td></tr>
+    <tr><td class="paramname">radius</td><td>size of thing to draw </td></tr>
+    <tr><td class="paramname">color</td><td>pixel value used for drawing</td></tr>
   </table>
+  </dd>
 </dl>
-This function might be used for debugging purposes.<p>
-type 0: horizontal line type 1: vertical line type 2: circle 
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l01908">1908</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l00064">_fors_image::data</a>, and <a class="el" href="fors__image_8c-source.html#l00065">_fors_image::variance</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
-</div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+<p>This function might be used for debugging purposes.</p>
+<p>type 0: horizontal line type 1: vertical line type 2: circle </p>
+
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l01917">1917</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
+</div>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__image__test.html b/html/group__fors__image__test.html
index 5790279..4fc4352 100644
--- a/html/group__fors__image__test.html
+++ b/html/group__fors__image__test.html
@@ -1,139 +1,165 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Test of image module</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Test of image module</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g0565bfec6c6aec9b2991e35e9c929b5b"></a><!-- doxytag: member="fors_image_test::test_image" ref="g0565bfec6c6aec9b2991e35e9c929b5b" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#g0565bfec6c6aec9b2991e35e9c929b5b">test_image</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test functions. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g945cb1e4f748ebddb0ace30b987c5d59"></a><!-- doxytag: member="fors_image_test::test_median_filter" ref="g945cb1e4f748ebddb0ace30b987c5d59" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#g945cb1e4f748ebddb0ace30b987c5d59">test_median_filter</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Median filtering benchmark. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd2be9c987ea7e4114c61df4ebefe5c0e"></a><!-- doxytag: member="fors_image_test::test_subtract" ref="gd2be9c987ea7e4114c61df4ebefe5c0e" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#gd2be9c987ea7e4114c61df4ebefe5c0e">test_subtract</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test image subtraction. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g683ef393a98e1ae90afb2013c635b08a"></a><!-- doxytag: member="fors_image_test::test_exponential" ref="g683ef393a98e1ae90afb2013c635b08a" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#g683ef393a98e1ae90afb2013c635b08a">test_exponential</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test image exponentiation. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g761a8fb6f0c0f22ba364b1e9e231738a"></a><!-- doxytag: member="fors_image_test::test_divide" ref="g761a8fb6f0c0f22ba364b1e9e231738a" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#g761a8fb6f0c0f22ba364b1e9e231738a">test_divide</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test image division. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_image_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of image module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Test of image module</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga8e2e648513e2b6ee3843dd026130d7a2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8e2e648513e2b6ee3843dd026130d7a2"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#ga8e2e648513e2b6ee3843dd026130d7a2">test_image</a> (void)</td></tr>
+<tr class="memdesc:ga8e2e648513e2b6ee3843dd026130d7a2"><td class="mdescLeft"> </td><td class="mdescRight">Test functions. <br/></td></tr>
+<tr class="separator:ga8e2e648513e2b6ee3843dd026130d7a2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3fb4147d1739891fdc6ae6132e87d0bd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3fb4147d1739891fdc6ae6132e87d0bd"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#ga3fb4147d1739891fdc6ae6132e87d0bd">test_median_filter</a> (void)</td></tr>
+<tr class="memdesc:ga3fb4147d1739891fdc6ae6132e87d0bd"><td class="mdescLeft"> </td><td class="mdescRight">Median filtering benchmark. <br/></td></tr>
+<tr class="separator:ga3fb4147d1739891fdc6ae6132e87d0bd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga460806546207179c6e136d31bdb922d5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga460806546207179c6e136d31bdb922d5"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#ga460806546207179c6e136d31bdb922d5">test_subtract</a> (void)</td></tr>
+<tr class="memdesc:ga460806546207179c6e136d31bdb922d5"><td class="mdescLeft"> </td><td class="mdescRight">Test image subtraction. <br/></td></tr>
+<tr class="separator:ga460806546207179c6e136d31bdb922d5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga69074b617f26911b58cda3a0fa13c918"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga69074b617f26911b58cda3a0fa13c918"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#ga69074b617f26911b58cda3a0fa13c918">test_exponential</a> (void)</td></tr>
+<tr class="memdesc:ga69074b617f26911b58cda3a0fa13c918"><td class="mdescLeft"> </td><td class="mdescRight">Test image exponentiation. <br/></td></tr>
+<tr class="separator:ga69074b617f26911b58cda3a0fa13c918"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0383c55336d7d782ab9f4fc614f9b0e0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0383c55336d7d782ab9f4fc614f9b0e0"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#ga0383c55336d7d782ab9f4fc614f9b0e0">test_divide</a> (void)</td></tr>
+<tr class="memdesc:ga0383c55336d7d782ab9f4fc614f9b0e0"><td class="mdescLeft"> </td><td class="mdescRight">Test image division. <br/></td></tr>
+<tr class="separator:ga0383c55336d7d782ab9f4fc614f9b0e0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__image__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of image module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image-test_8c_source.html#l00275">275</a> of file <a class="el" href="fors__image-test_8c_source.html">fors_image-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image-test_8c-source.html#l00275">275</a> of file <a class="el" href="fors__image-test_8c-source.html">fors_image-test.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&left); \</div>
+<div class="line">    fors_image_delete(&right); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image-test_8c_source.html#l00275">275</a> of file <a class="el" href="fors__image-test_8c_source.html">fors_image-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&left); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&right); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image-test_8c-source.html#l00275">275</a> of file <a class="el" href="fors__image-test_8c-source.html">fors_image-test.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&image); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image-test_8c_source.html#l00275">275</a> of file <a class="el" href="fors__image-test_8c_source.html">fors_image-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image-test_8c-source.html#l00275">275</a> of file <a class="el" href="fors__image-test_8c-source.html">fors_image-test.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_image-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&image); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__image-test_8c_source.html#l00275">275</a> of file <a class="el" href="fors__image-test_8c_source.html">fors_image-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__image-test_8c-source.html#l00275">275</a> of file <a class="el" href="fors__image-test_8c-source.html">fors_image-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__img__science.html b/html/group__fors__img__science.html
index 42cacea..c8dcb93 100644
--- a/html/group__fors__img__science.html
+++ b/html/group__fors__img__science.html
@@ -1,501 +1,549 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_recipe Recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>fors_recipe Recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_science::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g2d7fe71bb7c47e2284dea7e2732650fb">get_image_quality</a> (const fors_star_list *sources, double *image_quality_err, double *stellarity, double *ellipticity, double *ellipticity_rms)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute image quality.  <a href="#g2d7fe71bb7c47e2284dea7e2732650fb"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g9391a3b278d25edc38af3cb70db34597">fors_img_science_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#g9391a3b278d25edc38af3cb70db34597"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#gc6a3f5a41cacfa91711e127f612fa064">fors_img_science</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#gc6a3f5a41cacfa91711e127f612fa064"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#gded70f366457b7e7915dc906a4d50a45">is_star</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Determine if source is a star.  <a href="#gded70f366457b7e7915dc906a4d50a45"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#g4abb403976fc3ddcaa614c59a44590c9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g8f20063c6ace32082add0a55898badd5">fors_img_science_create</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#g8f20063c6ace32082add0a55898badd5"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g346ce5737ecd8c688f1f9cd39eda56db">fors_img_science_exec</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#g346ce5737ecd8c688f1f9cd39eda56db"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g034dd2408c1d19371c8f0da3f2ac0ea1">fors_img_science_destroy</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#g034dd2408c1d19371c8f0da3f2ac0ea1"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2db488d8bb3347de66414dec07ba323c"></a><!-- doxytag: member="fors_img_science::fors_img_science_name" ref="g2db488d8bb3347de66414dec07ba323c" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g2db488d8bb3347de66414dec07ba323c">fors_img_science_name</a> = "fors_img_science"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb97915136a3a942113a96d464f9eae30"></a><!-- doxytag: member="fors_img_science::fors_img_science_description_short" ref="gb97915136a3a942113a96d464f9eae30" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#gb97915136a3a942113a96d464f9eae30">fors_img_science_description_short</a> = "Reduce scientific exposure"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g969cdeff825fab5a2f064ae5e7335ded"></a><!-- doxytag: member="fors_img_science::fors_img_science_author" ref="g969cdeff825fab5a2f064ae5e7335ded" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g969cdeff825fab5a2f064ae5e7335ded">fors_img_science_author</a> = "Jonas M. Larsen"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g0b4a7b1ca4765372ccfd735dd1dc8d7b"></a><!-- doxytag: member="fors_img_science::fors_img_science_email" ref="g0b4a7b1ca4765372ccfd735dd1dc8d7b" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g0b4a7b1ca4765372ccfd735dd1dc8d7b">fors_img_science_email</a> = PACKAGE_BUGREPORT</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#g74ec08d9ca0bb98b7d31fc7609531e90">fors_img_science_description</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_recipe Recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga11315f8dbe7bcd79d1f4e7ad691532fe"><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#ga11315f8dbe7bcd79d1f4e7ad691532fe">get_image_quality</a> (const fors_star_list *sources, double *image_quality_err, double *stellarity, double *ellipticity, double *ellipticity_rms)</td></tr>
+<tr class="memdesc:ga11315f8dbe7bcd79d1f4e7ad691532fe"><td class="mdescLeft"> </td><td class="mdescRight">Compute image quality.  <a href="#ga11315f8dbe7bcd79d1f4e7ad691532fe">More...</a><br/></td></tr>
+<tr class="separator:ga11315f8dbe7bcd79d1f4e7ad691532fe"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2a18bf8b29e61bb854f3290fba50bdfd"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#ga2a18bf8b29e61bb854f3290fba50bdfd">fors_img_science_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga2a18bf8b29e61bb854f3290fba50bdfd"><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#ga2a18bf8b29e61bb854f3290fba50bdfd">More...</a><br/></td></tr>
+<tr class="separator:ga2a18bf8b29e61bb854f3290fba50bdfd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6f762068474a2723fd2c17f01b4a82c1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#ga6f762068474a2723fd2c17f01b4a82c1">fors_img_science</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga6f762068474a2723fd2c17f01b4a82c1"><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#ga6f762068474a2723fd2c17f01b4a82c1">More...</a><br/></td></tr>
+<tr class="separator:ga6f762068474a2723fd2c17f01b4a82c1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga52377e795ce68f7de7da06f753b01efc"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#ga52377e795ce68f7de7da06f753b01efc">is_star</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
+<tr class="memdesc:ga52377e795ce68f7de7da06f753b01efc"><td class="mdescLeft"> </td><td class="mdescRight">Determine if source is a star.  <a href="#ga52377e795ce68f7de7da06f753b01efc">More...</a><br/></td></tr>
+<tr class="separator:ga52377e795ce68f7de7da06f753b01efc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
+<tr class="memdesc:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#ga31d1fccd4cd15b1c1f3c5edc8cb18693">More...</a><br/></td></tr>
+<tr class="separator:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga966196c928f588d03aa1a17a486781aa"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#ga966196c928f588d03aa1a17a486781aa">fors_img_science_create</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga966196c928f588d03aa1a17a486781aa"><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#ga966196c928f588d03aa1a17a486781aa">More...</a><br/></td></tr>
+<tr class="separator:ga966196c928f588d03aa1a17a486781aa"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga375da6eaae762d1ee8a202bb62514ad2"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#ga375da6eaae762d1ee8a202bb62514ad2">fors_img_science_exec</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga375da6eaae762d1ee8a202bb62514ad2"><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#ga375da6eaae762d1ee8a202bb62514ad2">More...</a><br/></td></tr>
+<tr class="separator:ga375da6eaae762d1ee8a202bb62514ad2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad9737c625ab9465c8a504a25e67d8a03"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science.html#gad9737c625ab9465c8a504a25e67d8a03">fors_img_science_destroy</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:gad9737c625ab9465c8a504a25e67d8a03"><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#gad9737c625ab9465c8a504a25e67d8a03">More...</a><br/></td></tr>
+<tr class="separator:gad9737c625ab9465c8a504a25e67d8a03"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga96a36a4f3494140425d4157375e72db6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga96a36a4f3494140425d4157375e72db6"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_science_name</b> = "fors_img_science"</td></tr>
+<tr class="separator:ga96a36a4f3494140425d4157375e72db6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga24a50db0e85ee3f7ce7f93899424f2d3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga24a50db0e85ee3f7ce7f93899424f2d3"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_science_description_short</b> = "Reduce scientific exposure"</td></tr>
+<tr class="separator:ga24a50db0e85ee3f7ce7f93899424f2d3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gace503445a2e16523492b2a388fa70a81"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gace503445a2e16523492b2a388fa70a81"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_science_author</b> = "Jonas M. Larsen"</td></tr>
+<tr class="separator:gace503445a2e16523492b2a388fa70a81"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga70f209dbd150348c7f514c65f3babe82"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga70f209dbd150348c7f514c65f3babe82"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_science_email</b> = PACKAGE_BUGREPORT</td></tr>
+<tr class="separator:ga70f209dbd150348c7f514c65f3babe82"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa822f70a5a79b6b9cf87e542d902475c"><td class="memItemLeft" align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_science_description</b></td></tr>
+<tr class="separator:gaa822f70a5a79b6b9cf87e542d902475c"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-See recipe description for details. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_science_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>See recipe description for details. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)full_name); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__science__impl_8c_source.html#l00512">512</a> of file <a class="el" href="fors__img__science__impl_8c_source.html">fors_img_science_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_free((<span class="keywordtype">void</span> *)full_name); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__science__impl_8c-source.html#l00512">512</a> of file <a class="el" href="fors__img__science__impl_8c-source.html">fors_img_science_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_science_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(sci_frame); \</div>
+<div class="line">    cpl_frameset_delete(master_bias_frame); \</div>
+<div class="line">    cpl_frameset_delete(master_flat_frame); \</div>
+<div class="line">    fors_image_delete(&sci); \</div>
+<div class="line">    fors_image_delete_const(&master_bias); \</div>
+<div class="line">    fors_image_delete(&master_flat); \</div>
+<div class="line">    cpl_table_delete(phot); \</div>
+<div class="line">    cpl_table_delete(sources); \</div>
+<div class="line">    cpl_image_delete(background); \</div>
+<div class="line">    fors_extract_method_delete(&em); \</div>
+<div class="line">    fors_star_list_delete(&stars, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>); \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)context); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    cpl_propertylist_delete(qc); \</div>
+<div class="line">    cpl_propertylist_delete(product_header); \</div>
+<div class="line">    cpl_propertylist_delete(header); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__science__impl_8c_source.html#l00512">512</a> of file <a class="el" href="fors__img__science__impl_8c_source.html">fors_img_science_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(sci_frame); \
-    cpl_frameset_delete(master_bias_frame); \
-    cpl_frameset_delete(master_flat_frame); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&sci); \
-    <a class="code" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">fors_image_delete_const</a>(&master_bias); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_flat); \
-    cpl_table_delete(phot); \
-    cpl_table_delete(sources); \
-    cpl_image_delete(background); \
-    <a class="code" href="group__fors__extract.html#g2f7149d890f135097366c9389cab25fe">fors_extract_method_delete</a>(&em); \
-    fors_star_list_delete(&stars, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>); \
-    cpl_free((<span class="keywordtype">void</span> *)context); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    cpl_propertylist_delete(qc); \
-    cpl_propertylist_delete(product_header); \
-    cpl_propertylist_delete(header); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__science__impl_8c-source.html#l00512">512</a> of file <a class="el" href="fors__img__science__impl_8c-source.html">fors_img_science_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_science_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_star_list_delete(&stars, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__science__impl_8c_source.html#l00512">512</a> of file <a class="el" href="fors__img__science__impl_8c_source.html">fors_img_science_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    fors_star_list_delete(&stars, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__science__impl_8c-source.html#l00512">512</a> of file <a class="el" href="fors__img__science__impl_8c-source.html">fors_img_science_impl.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g2d7fe71bb7c47e2284dea7e2732650fb"></a><!-- doxytag: member="fors_img_science_impl.c::get_image_quality" ref="g2d7fe71bb7c47e2284dea7e2732650fb" args="(const fors_star_list *sources, double *image_quality_err, double *stellarity, double *ellipticity, double *ellipticity_rms)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga11315f8dbe7bcd79d1f4e7ad691532fe"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static double get_image_quality           </td>
+          <td class="memname">static double get_image_quality </td>
           <td>(</td>
-          <td class="paramtype">const fors_star_list * </td>
-          <td class="paramname"> <em>sources</em>, </td>
+          <td class="paramtype">const fors_star_list * </td>
+          <td class="paramname"><em>sources</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>image_quality_err</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>image_quality_err</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>stellarity</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>stellarity</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>ellipticity</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>ellipticity</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>ellipticity_rms</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>ellipticity_rms</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Compute image quality. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>sources</em> </td><td>extracted sources </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>image_quality_err</em> </td><td>(output) empirical scatter (based on median absolute deviation) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>stellarity</em> </td><td>(output) average stellarity of sources above stellarity cutoff </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ellipticity</em> </td><td>(output) average ellipticity of sources above stellarity cutoff </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ellipticity_rms</em> </td><td>(output) RMS ellipticity of sources above stellarity cutoff </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>median</em> </td><td>source extension (in the one sigma sense) </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Compute image quality. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">sources</td><td>extracted sources </td></tr>
+    <tr><td class="paramname">image_quality_err</td><td>(output) empirical scatter (based on median absolute deviation) </td></tr>
+    <tr><td class="paramname">stellarity</td><td>(output) average stellarity of sources above stellarity cutoff </td></tr>
+    <tr><td class="paramname">ellipticity</td><td>(output) average ellipticity of sources above stellarity cutoff </td></tr>
+    <tr><td class="paramname">ellipticity_rms</td><td>(output) RMS ellipticity of sources above stellarity cutoff </td></tr>
+    <tr><td class="paramname">median</td><td>source extension (in the one sigma sense) </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__img__science__impl_8c-source.html#l00530">530</a> of file <a class="el" href="fors__img__science__impl_8c-source.html">fors_img_science_impl.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__star_8c-source.html#l00248">fors_star_duplicate()</a>, <a class="el" href="fors__star_8c-source.html#l00402">fors_star_ellipticity()</a>, <a class="el" href="fors__star_8c-source.html#l00365">fors_star_extension()</a>, <a class="el" href="fors__star_8c-source.html#l00384">fors_star_stellarity()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00500">is_star()</a> [...]
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>.
+<p>Definition at line <a class="el" href="fors__img__science__impl_8c_source.html#l00530">530</a> of file <a class="el" href="fors__img__science__impl_8c_source.html">fors_img_science_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__star_8c_source.html#l00248">fors_star_duplicate()</a>, <a class="el" href="fors__star_8c_source.html#l00402">fors_star_ellipticity()</a>, <a class="el" href="fors__star_8c_source.html#l00365">fors_star_extension()</a>, <a class="el" href="fors__star_8c_source.html#l00384">fors_star_stellarity()</a>, and <a class="el" href="fors__img__science__impl_8c_source.html#l00500">is_star()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g9391a3b278d25edc38af3cb70db34597"></a><!-- doxytag: member="fors_img_science_impl.c::fors_img_science_define_parameters" ref="g9391a3b278d25edc38af3cb70db34597" args="(cpl_parameterlist *parameters)" -->
+<a class="anchor" id="ga2a18bf8b29e61bb854f3290fba50bdfd"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_img_science_define_parameters           </td>
+          <td class="memname">void fors_img_science_define_parameters </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Define recipe parameters. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameter list to fill </td></tr>
+</div><div class="memdoc">
+
+<p>Define recipe parameters. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>parameter list to fill </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__img__science__impl_8c-source.html#l00089">89</a> of file <a class="el" href="fors__img__science__impl_8c-source.html">fors_img_science_impl.c</a>.
-<p>
-References <a class="el" href="fors_2fors__extract_8c-source.html#l00153">fors_extract_define_parameters()</a>, and <a class="el" href="fors__img__science__impl_8c-source.html#l00053">fors_img_science_name</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science_8c-source.html#l00109">fors_img_science_create()</a>, and <a class="el" href="fors__img__science-test_8c-source.html#l00057">test_img_science()</a>.
+<p>Definition at line <a class="el" href="fors__img__science__impl_8c_source.html#l00089">89</a> of file <a class="el" href="fors__img__science__impl_8c_source.html">fors_img_science_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors_2fors__extract_8c_source.html#l00153">fors_extract_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science_8c_source.html#l00109">fors_img_science_create()</a>, and <a class="el" href="fors__img__science-test_8c_source.html#l00057">test_img_science()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gc6a3f5a41cacfa91711e127f612fa064"></a><!-- doxytag: member="fors_img_science_impl.c::fors_img_science" ref="gc6a3f5a41cacfa91711e127f612fa064" args="(cpl_frameset *frames, const cpl_parameterlist *parameters)" -->
+</div>
+<a class="anchor" id="ga6f762068474a2723fd2c17f01b4a82c1"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_img_science           </td>
+          <td class="memname">void fors_img_science </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em></td><td> </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Do the processing. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>set of frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameters </td></tr>
+</div><div class="memdoc">
+
+<p>Do the processing. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>set of frames </td></tr>
+    <tr><td class="paramname">parameters</td><td>parameters </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__img__science__impl_8c-source.html#l00161">161</a> of file <a class="el" href="fors__img__science__impl_8c-source.html">fors_img_science_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__dfs_8c-source.html#l00819">dfs_get_parameter_double_const()</a>, <a class="el" href="fors__dfs_8c-source.html#l01323">dfs_save_image()</a>, <a class="el" href="fors__tools_8c-source.html#l00130">fors_create_sources_table()</a>, <a class="el" href="fors__dfs_8c-source.html#l01239">fors_dfs_add_exptime()</a>, <a class="el" [...]
-<p>
-Referenced by <a class="el" href="fors__img__science_8c-source.html#l00158">fors_img_science_exec()</a>, and <a class="el" href="fors__img__science-test_8c-source.html#l00057">test_img_science()</a>.
+<p>Definition at line <a class="el" href="fors__img__science__impl_8c_source.html#l00161">161</a> of file <a class="el" href="fors__img__science__impl_8c_source.html">fors_img_science_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__dfs_8c_source.html#l00819">dfs_get_parameter_double_const()</a>, <a class="el" href="fors__dfs_8c_source.html#l01359">dfs_save_image()</a>, <a class="el" href="fors__tools_8c_source.html#l00130">fors_create_sources_table()</a>, <a class="el" href="fors__dfs_8c_source.html#l01275">fors_dfs_add_exptime()</a>, <a class="el" href="fors__dfs_8c_source.html#l01221">fors_dfs_add_wcs()</a>, <a cla [...]
+
+<p>Referenced by <a class="el" href="fors__img__science_8c_source.html#l00158">fors_img_science_exec()</a>, and <a class="el" href="fors__img__science-test_8c_source.html#l00057">test_img_science()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gded70f366457b7e7915dc906a4d50a45"></a><!-- doxytag: member="fors_img_science_impl.c::is_star" ref="gded70f366457b7e7915dc906a4d50a45" args="(const fors_star *s, void *data)" -->
+<a class="anchor" id="ga52377e795ce68f7de7da06f753b01efc"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static bool is_star           </td>
+          <td class="memname">static bool is_star </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Determine if source is a star. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>sources </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>not used </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Determine if source is a star. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>sources </td></tr>
+    <tr><td class="paramname">data</td><td>not used </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true iff the source is more star-like </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__img__science__impl_8c-source.html#l00500">500</a> of file <a class="el" href="fors__img__science__impl_8c-source.html">fors_img_science_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__star_8h-source.html#l00041">_fors_star::stellarity_index</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00530">get_image_quality()</a>.
+<dl class="section return"><dt>Returns</dt><dd>true iff the source is more star-like </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__img__science__impl_8c_source.html#l00500">500</a> of file <a class="el" href="fors__img__science__impl_8c_source.html">fors_img_science_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00530">get_image_quality()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g4abb403976fc3ddcaa614c59a44590c9"></a><!-- doxytag: member="fors_img_science.c::cpl_plugin_get_info" ref="g4abb403976fc3ddcaa614c59a44590c9" args="(cpl_pluginlist *list)" -->
+<a class="anchor" id="ga31d1fccd4cd15b1c1f3c5edc8cb18693"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int cpl_plugin_get_info           </td>
+          <td class="memname">int cpl_plugin_get_info </td>
           <td>(</td>
-          <td class="paramtype">cpl_pluginlist * </td>
-          <td class="paramname"> <em>list</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_pluginlist * </td>
+          <td class="paramname"><em>list</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Build the list of available plugins, for this module. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>The plugin list</td></tr>
+</div><div class="memdoc">
+
+<p>Build the list of available plugins, for this module. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">list</td><td>The plugin list</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
-Create the recipe instance and make it available to the application using the interface. This function is exported. 
-<p>
-Definition at line <a class="el" href="fors__img__science_8c-source.html#l00062">62</a> of file <a class="el" href="fors__img__science_8c-source.html">fors_img_science.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00065">fors_get_license()</a>, <a class="el" href="fors__utils_8c-source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00055">fors_img_science_author</a>, <a class="el" href="fors__img__science_8c-source.html#l00109">fors_img_science_create()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00057">fors_img_science_description</a>, <a class="el" href="fors [...]
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<p>Create the recipe instance and make it available to the application using the interface. This function is exported. </p>
+
+<p>Definition at line <a class="el" href="fors__img__science_8c_source.html#l00062">62</a> of file <a class="el" href="fors__img__science_8c_source.html">fors_img_science.c</a>.</p>
+
+<p>References <a class="el" href="fors__utils_8c_source.html#l00065">fors_get_license()</a>, <a class="el" href="fors__utils_8c_source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__img__science_8c_source.html#l00109">fors_img_science_create()</a>, <a class="el" href="fors__img__science_8c_source.html#l00207">fors_img_science_destroy()</a>, and <a class="el" href="fors__img__science_8c_source.html#l00158">fors_img_science_exec()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g8f20063c6ace32082add0a55898badd5"></a><!-- doxytag: member="fors_img_science.c::fors_img_science_create" ref="g8f20063c6ace32082add0a55898badd5" args="(cpl_plugin *plugin)" -->
+</div>
+<a class="anchor" id="ga966196c928f588d03aa1a17a486781aa"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_img_science_create           </td>
+          <td class="memname">static int fors_img_science_create </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Setup the recipe options. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Setup the recipe options. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok</dd></dl>
-Defining the command-line/configuration parameters for the recipe. 
-<p>
-Definition at line <a class="el" href="fors__img__science_8c-source.html#l00109">109</a> of file <a class="el" href="fors__img__science_8c-source.html">fors_img_science.c</a>.
-<p>
-References <a class="el" href="fors__img__science__impl_8c-source.html#l00089">fors_img_science_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok</dd></dl>
+<p>Defining the command-line/configuration parameters for the recipe. </p>
+
+<p>Definition at line <a class="el" href="fors__img__science_8c_source.html#l00109">109</a> of file <a class="el" href="fors__img__science_8c_source.html">fors_img_science.c</a>.</p>
+
+<p>References <a class="el" href="fors__img__science__impl_8c_source.html#l00089">fors_img_science_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g346ce5737ecd8c688f1f9cd39eda56db"></a><!-- doxytag: member="fors_img_science.c::fors_img_science_exec" ref="g346ce5737ecd8c688f1f9cd39eda56db" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="ga375da6eaae762d1ee8a202bb62514ad2"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_img_science_exec           </td>
+          <td class="memname">static int fors_img_science_exec </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Execute the plugin instance given by the interface. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>the plugin</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Execute the plugin instance given by the interface. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>the plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__img__science_8c-source.html#l00158">158</a> of file <a class="el" href="fors__img__science_8c-source.html">fors_img_science.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dfs_8c-source.html#l00258">fors_end()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__img__science__impl_8c-source.html#l00054">fors_img_science_description_short</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__img__science_8c_source.html#l00158">158</a> of file <a class="el" href="fors__img__science_8c_source.html">fors_img_science.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dfs_8c_source.html#l00258">fors_end()</a>, and <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g034dd2408c1d19371c8f0da3f2ac0ea1"></a><!-- doxytag: member="fors_img_science.c::fors_img_science_destroy" ref="g034dd2408c1d19371c8f0da3f2ac0ea1" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="gad9737c625ab9465c8a504a25e67d8a03"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_img_science_destroy           </td>
+          <td class="memname">static int fors_img_science_destroy </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Destroy what has been created by the 'create' function. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Destroy what has been created by the 'create' function. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__img__science_8c_source.html#l00207">207</a> of file <a class="el" href="fors__img__science_8c_source.html">fors_img_science.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__img__science_8c-source.html#l00207">207</a> of file <a class="el" href="fors__img__science_8c-source.html">fors_img_science.c</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science_8c-source.html#l00062">cpl_plugin_get_info()</a>.
 </div>
-</div><p>
-<hr><h2>Variable Documentation</h2>
-<a class="anchor" name="g74ec08d9ca0bb98b7d31fc7609531e90"></a><!-- doxytag: member="fors_img_science_impl.c::fors_img_science_description" ref="g74ec08d9ca0bb98b7d31fc7609531e90" args="" -->
+</div>
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="gaa822f70a5a79b6b9cf87e542d902475c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* const <a class="el" href="group__fors__img__science.html#g74ec08d9ca0bb98b7d31fc7609531e90">fors_img_science_description</a>          </td>
+          <td class="memname">const char* const fors_img_science_description</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">= </div>
+<div class="line"><span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span></div>
+<div class="line"><span class="stringliteral">"  SCIENCE_IMG                Raw         Science image               1\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flat field       1\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+<div class="line"><span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><span class="stringliteral">"  SCIENCE_REDUCED_IMG        FITS image  Reduced science image\n"</span></div>
+<div class="line"><span class="stringliteral">"  PHOT_BACKGROUND_SCI_IMG    FITS image  Reduced science image background\n"</span></div>
+<div class="line"><span class="stringliteral">"  SOURCES_SCI_IMG            FITS image  Unfiltered SExtractor output\n"</span></div>
+<div class="line"><span class="stringliteral">"  OBJECT_TABLE_SCI_IMG       FITS table  Extracted sources properties\n"</span></div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__science__impl_8c_source.html#l00057">57</a> of file <a class="el" href="fors__img__science__impl_8c_source.html">fors_img_science_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment"> 
-<span class="stringliteral">"Input files:\n"</span>
-<span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span>
-<span class="stringliteral">"  SCIENCE_IMG                Raw         Science image               1\n"</span>
-<span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span>
-<span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flat field       1\n"</span>
-<span class="stringliteral">"\n"</span>
-<span class="stringliteral">"Output files:\n"</span>
-<span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<span class="stringliteral">"  SCIENCE_REDUCED_IMG        FITS image  Reduced science image\n"</span>
-<span class="stringliteral">"  PHOT_BACKGROUND_SCI_IMG    FITS image  Reduced science image background\n"</span>
-<span class="stringliteral">"  SOURCES_SCI_IMG            FITS image  Unfiltered SExtractor output\n"</span>
-<span class="stringliteral">"  OBJECT_TABLE_SCI_IMG       FITS table  Extracted sources properties\n"</span>
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__science__impl_8c-source.html#l00057">57</a> of file <a class="el" href="fors__img__science__impl_8c-source.html">fors_img_science_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science_8c-source.html#l00062">cpl_plugin_get_info()</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__img__science__test.html b/html/group__fors__img__science__test.html
index 71167cd..de760db 100644
--- a/html/group__fors__img__science__test.html
+++ b/html/group__fors__img__science__test.html
@@ -1,57 +1,92 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: science recipe tests</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>science recipe tests</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb1191beef5be429ab3bbb284e3fc6606"></a><!-- doxytag: member="fors_img_science_test::test_img_science" ref="gb1191beef5be429ab3bbb284e3fc6606" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science__test.html#gb1191beef5be429ab3bbb284e3fc6606">test_img_science</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test science recipe. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_img_science_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of img_science recipe. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_science-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">science recipe tests</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga64116c898e3e40a355dad7fec89f65a8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga64116c898e3e40a355dad7fec89f65a8"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science__test.html#ga64116c898e3e40a355dad7fec89f65a8">test_img_science</a> (void)</td></tr>
+<tr class="memdesc:ga64116c898e3e40a355dad7fec89f65a8"><td class="mdescLeft"> </td><td class="mdescRight">Test science recipe. <br/></td></tr>
+<tr class="separator:ga64116c898e3e40a355dad7fec89f65a8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__science__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of img_science recipe. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(frames); \</div>
+<div class="line">    cpl_parameterlist_delete(parameters); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__science-test_8c_source.html#l00047">47</a> of file <a class="el" href="fors__img__science-test_8c_source.html">fors_img_science-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(frames); \
-    cpl_parameterlist_delete(parameters); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__science-test_8c-source.html#l00047">47</a> of file <a class="el" href="fors__img__science-test_8c-source.html">fors_img_science-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__img__screen__flat.html b/html/group__fors__img__screen__flat.html
index 7cf7256..f6be89f 100644
--- a/html/group__fors__img__screen__flat.html
+++ b/html/group__fors__img__screen__flat.html
@@ -1,615 +1,665 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_recipe Recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>fors_recipe Recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g75a60ee291780e6bbaeeb68313c112f0">remove_large_scale</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *master_screen_flat, const cpl_parameterlist *parameters, const char *context, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Fit and divide out large scale structure.  <a href="#g75a60ee291780e6bbaeeb68313c112f0"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g34064d266d0016050844a2e2c9e1a59c">remove_large_scale_fit</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *master_screen_flat, const cpl_parameterlist *parameters, const char *context, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Fit and divide out large scale structure.  <a href="#g34064d266d0016050844a2e2c9e1a59c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#gff8fa4d76051acfba7263b22a5bc06c3">write_qc</a> (cpl_propertylist *qc, const cpl_frame *first_raw_frame, const fors_image_list *sflats, const <a class="el" href="struct__fors__image.html">fors_image</a> *master_sflat, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, double satur [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute QC.  <a href="#gff8fa4d76051acfba7263b22a5bc06c3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g8bd60f1e1c99dff8aa58da8d21eeeb02">fors_img_screen_flat_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#g8bd60f1e1c99dff8aa58da8d21eeeb02"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g6ada02347c7648aaa61ce6bc000910e5">fors_img_screen_flat</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#g6ada02347c7648aaa61ce6bc000910e5"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#g4abb403976fc3ddcaa614c59a44590c9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g4f7674508424db7a7b62d5a8772bb3cc">fors_img_screen_flat_create</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#g4f7674508424db7a7b62d5a8772bb3cc"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#gcdfb37251e245fe82da375ba0725a3cb">fors_img_screen_flat_exec</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#gcdfb37251e245fe82da375ba0725a3cb"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g4ee16c004f65246f0c474d1c4f5516a8">fors_img_screen_flat_destroy</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#g4ee16c004f65246f0c474d1c4f5516a8"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9423928a6bbf5fa7d8ca95661ced4d1e"></a><!-- doxytag: member="fors_img_screen_flat::fors_img_screen_flat_name" ref="g9423928a6bbf5fa7d8ca95661ced4d1e" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g9423928a6bbf5fa7d8ca95661ced4d1e">fors_img_screen_flat_name</a> = "fors_img_screen_flat"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#gc5ff969a1df38b9da80ab308f823132d">fors_img_screen_flat_description_short</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ge5a540ddd41737890da74f817765cefd"></a><!-- doxytag: member="fors_img_screen_flat::fors_img_screen_flat_author" ref="ge5a540ddd41737890da74f817765cefd" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#ge5a540ddd41737890da74f817765cefd">fors_img_screen_flat_author</a> = "Jonas M. Larsen"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9713c3ac85f9ad32781dd22fcd81775f"></a><!-- doxytag: member="fors_img_screen_flat::fors_img_screen_flat_email" ref="g9713c3ac85f9ad32781dd22fcd81775f" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g9713c3ac85f9ad32781dd22fcd81775f">fors_img_screen_flat_email</a> = PACKAGE_BUGREPORT</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#g584ddcde63f204f4110497cab0e49075">fors_img_screen_flat_description</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-See recipe description for details. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_recipe Recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gabe250dfa6d750ed0de8e583c614a7dae"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#gabe250dfa6d750ed0de8e583c614a7dae">remove_large_scale</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *master_screen_flat, const cpl_parameterlist *parameters, const char *context, const <a class="el" href="struct__fors__setting.html">fors_setting< [...]
+<tr class="memdesc:gabe250dfa6d750ed0de8e583c614a7dae"><td class="mdescLeft"> </td><td class="mdescRight">Fit and divide out large scale structure.  <a href="#gabe250dfa6d750ed0de8e583c614a7dae">More...</a><br/></td></tr>
+<tr class="separator:gabe250dfa6d750ed0de8e583c614a7dae"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga28678e6bba93d507e39ef08578423528"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#ga28678e6bba93d507e39ef08578423528">remove_large_scale_fit</a> (<a class="el" href="struct__fors__image.html">fors_image</a> *master_screen_flat, const cpl_parameterlist *parameters, const char *context, const <a class="el" href="struct__fors__setting.html">fors_sett [...]
+<tr class="memdesc:ga28678e6bba93d507e39ef08578423528"><td class="mdescLeft"> </td><td class="mdescRight">Fit and divide out large scale structure.  <a href="#ga28678e6bba93d507e39ef08578423528">More...</a><br/></td></tr>
+<tr class="separator:ga28678e6bba93d507e39ef08578423528"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga06f1099ef36e41395e5619dbacfe3aa1"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1">write_qc</a> (cpl_propertylist *qc, const cpl_frame *first_raw_frame, const fors_image_list *sflats, const <a class="el" href="struct__fors__image.html">fors_image</a> *master_sflat, const <a class="el" href="struct__fors__setting. [...]
+<tr class="memdesc:ga06f1099ef36e41395e5619dbacfe3aa1"><td class="mdescLeft"> </td><td class="mdescRight">Compute QC.  <a href="#ga06f1099ef36e41395e5619dbacfe3aa1">More...</a><br/></td></tr>
+<tr class="separator:ga06f1099ef36e41395e5619dbacfe3aa1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga19e0710196db92a992d5c1502c35a5f0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#ga19e0710196db92a992d5c1502c35a5f0">fors_img_screen_flat_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga19e0710196db92a992d5c1502c35a5f0"><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#ga19e0710196db92a992d5c1502c35a5f0">More...</a><br/></td></tr>
+<tr class="separator:ga19e0710196db92a992d5c1502c35a5f0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad6f0f603eedc00271082e6dae9dbd2a6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#gad6f0f603eedc00271082e6dae9dbd2a6">fors_img_screen_flat</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:gad6f0f603eedc00271082e6dae9dbd2a6"><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#gad6f0f603eedc00271082e6dae9dbd2a6">More...</a><br/></td></tr>
+<tr class="separator:gad6f0f603eedc00271082e6dae9dbd2a6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
+<tr class="memdesc:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#ga31d1fccd4cd15b1c1f3c5edc8cb18693">More...</a><br/></td></tr>
+<tr class="separator:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaaf1392d5e4fd8d016322a38b2bc1131a"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#gaaf1392d5e4fd8d016322a38b2bc1131a">fors_img_screen_flat_create</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:gaaf1392d5e4fd8d016322a38b2bc1131a"><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#gaaf1392d5e4fd8d016322a38b2bc1131a">More...</a><br/></td></tr>
+<tr class="separator:gaaf1392d5e4fd8d016322a38b2bc1131a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4a8a4add6fd2c7f1300789425e079bce"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#ga4a8a4add6fd2c7f1300789425e079bce">fors_img_screen_flat_exec</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga4a8a4add6fd2c7f1300789425e079bce"><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#ga4a8a4add6fd2c7f1300789425e079bce">More...</a><br/></td></tr>
+<tr class="separator:ga4a8a4add6fd2c7f1300789425e079bce"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0867be809872f262200c7562c3eb0cee"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat.html#ga0867be809872f262200c7562c3eb0cee">fors_img_screen_flat_destroy</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga0867be809872f262200c7562c3eb0cee"><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#ga0867be809872f262200c7562c3eb0cee">More...</a><br/></td></tr>
+<tr class="separator:ga0867be809872f262200c7562c3eb0cee"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga428c4f1b59081eaa3d4c2ac295cc0421"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga428c4f1b59081eaa3d4c2ac295cc0421"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat_name</b> = "fors_img_screen_flat"</td></tr>
+<tr class="separator:ga428c4f1b59081eaa3d4c2ac295cc0421"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4602c49d9d5b738361257d202b8645bb"><td class="memItemLeft" align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat_description_short</b></td></tr>
+<tr class="separator:ga4602c49d9d5b738361257d202b8645bb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga837ec955be0a571f8091ffd46367f272"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga837ec955be0a571f8091ffd46367f272"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat_author</b> = "Jonas M. Larsen"</td></tr>
+<tr class="separator:ga837ec955be0a571f8091ffd46367f272"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab9381b6e448d5951ad7b1f9977b3389e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab9381b6e448d5951ad7b1f9977b3389e"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat_email</b> = PACKAGE_BUGREPORT</td></tr>
+<tr class="separator:gab9381b6e448d5951ad7b1f9977b3389e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga36aeb7e100bc98da1bd77b210e54a41f"><td class="memItemLeft" align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_screen_flat_description</b></td></tr>
+<tr class="separator:ga36aeb7e100bc98da1bd77b210e54a41f"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>See recipe description for details. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(sflat_frames); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    cpl_frameset_delete(master_bias_frame); \</div>
+<div class="line">    fors_image_delete_const(&master_bias); \</div>
+<div class="line">    fors_stack_method_delete(&sm); \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)context); \</div>
+<div class="line">    fors_image_delete(&master_screen_flat); \</div>
+<div class="line">    fors_image_delete(&master_norm_flat); \</div>
+<div class="line">    fors_image_list_delete_const(&sflats, <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>); \</div>
+<div class="line">    cpl_propertylist_delete(qc); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00476">476</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(sflat_frames); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    cpl_frameset_delete(master_bias_frame); \
-    <a class="code" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">fors_image_delete_const</a>(&master_bias); \
-    <a class="code" href="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13">fors_stack_method_delete</a>(&sm); \
-    cpl_free((<span class="keywordtype">void</span> *)context); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_screen_flat); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_norm_flat); \
-    fors_image_list_delete_const(&sflats, <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>); \
-    cpl_propertylist_delete(qc); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00472">472</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_image_delete(smoothed); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00476">476</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_image_delete(smoothed); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00472">472</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_image_delete(smoothed); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00476">476</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_image_delete(smoothed); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00472">472</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&image); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00476">476</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00472">472</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g75a60ee291780e6bbaeeb68313c112f0"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::remove_large_scale" ref="g75a60ee291780e6bbaeeb68313c112f0" args="(fors_image *master_screen_flat, const cpl_parameterlist *parameters, const char *context, const fors_setting *setting)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gabe250dfa6d750ed0de8e583c614a7dae"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void remove_large_scale           </td>
+          <td class="memname">static void remove_large_scale </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>master_screen_flat</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>master_screen_flat</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>context</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>context</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em></td><td> </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Fit and divide out large scale structure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>master_screen_flat</em> </td><td>pre-normalized screen flat image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>smoothing parameters </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>read parameters from this context </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>instrument setting</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Fit and divide out large scale structure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">master_screen_flat</td><td>pre-normalized screen flat image </td></tr>
+    <tr><td class="paramname">parameters</td><td>smoothing parameters </td></tr>
+    <tr><td class="paramname">context</td><td>read parameters from this context </td></tr>
+    <tr><td class="paramname">setting</td><td>instrument setting</td></tr>
   </table>
+  </dd>
 </dl>
-This function applies a median filter to the screen flat field image. The master screen flat field is then divided by this smoothed image which removes large scale structure and normalizes the flat field to one.<p>
-To avoid dealing with correlated noise, the obtained smoothed image is assumed to be effectively noiseless. For a median filter window size of only 11x11, this assumption introduces a relative error in the error bars of only ~ 1/sqrt(11x11) = 10 %. 
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00299">299</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__setting_8h-source.html#l00049">_fors_setting::binx</a>, <a class="el" href="fors__setting_8h-source.html#l00049">_fors_setting::biny</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__dfs_8c-source.html#l00809">dfs_get_parameter_int_const()</a>, <a class="el" href="fors__image_8c-source.html#l00863">fors_image_divide_noerr()</a>, <a class=" [...]
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">fors_img_screen_flat()</a>.
+<p>This function applies a median filter to the screen flat field image. The master screen flat field is then divided by this smoothed image which removes large scale structure and normalizes the flat field to one.</p>
+<p>To avoid dealing with correlated noise, the obtained smoothed image is assumed to be effectively noiseless. For a median filter window size of only 11x11, this assumption introduces a relative error in the error bars of only ~ 1/sqrt(11x11) = 10 %. </p>
+
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00299">299</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__dfs_8c_source.html#l00809">dfs_get_parameter_int_const()</a>, <a class="el" href="fors__image_8c_source.html#l00869">fors_image_divide_noerr()</a>, <a class="el" href="fors__image_8c_source.html#l01270">fors_image_filter_median_create()</a>, <a class="el" href="fors__image_8c_source.html#l00706">fors_image_get_size_x()</a>, <a class="el" href="fors__image_8c_source.html#l00719">fors_image_ [...]
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g34064d266d0016050844a2e2c9e1a59c"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::remove_large_scale_fit" ref="g34064d266d0016050844a2e2c9e1a59c" args="(fors_image *master_screen_flat, const cpl_parameterlist *parameters, const char *context, const fors_setting *setting)" -->
+<a class="anchor" id="ga28678e6bba93d507e39ef08578423528"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void remove_large_scale_fit           </td>
+          <td class="memname">static void remove_large_scale_fit </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>master_screen_flat</em>, </td>
+          <td class="paramtype"><a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>master_screen_flat</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>context</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>context</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em></td><td> </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Fit and divide out large scale structure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>master_screen_flat</em> </td><td>pre-normalized screen flat image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>fitting parameters </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>read parameters from this context </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>instrument setting</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Fit and divide out large scale structure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">master_screen_flat</td><td>pre-normalized screen flat image </td></tr>
+    <tr><td class="paramname">parameters</td><td>fitting parameters </td></tr>
+    <tr><td class="paramname">context</td><td>read parameters from this context </td></tr>
+    <tr><td class="paramname">setting</td><td>instrument setting</td></tr>
   </table>
+  </dd>
 </dl>
-This function fits the illuminated part of the screen flat field frame with a low degree polynomial. The input frame is then divided by this fit-smoothed image which removes large scale structure and normalizes the flat field to one.<p>
-To avoid dealing with correlated noise, the obtained smoothed image is assumed to be effectively noiseless. 
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00407">407</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__dfs_8c-source.html#l00809">dfs_get_parameter_int_const()</a>, <a class="el" href="fors__image_8c-source.html#l00863">fors_image_divide_noerr()</a>, <a class="el" href="fors__image_8c-source.html#l01351">fors_image_flat_fit_create()</a>, and <a class="el" href="fors__image_8c-source.html#l01179">fors_image_get_median()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00299">remove_large_scale()</a>.
+<p>This function fits the illuminated part of the screen flat field frame with a low degree polynomial. The input frame is then divided by this fit-smoothed image which removes large scale structure and normalizes the flat field to one.</p>
+<p>To avoid dealing with correlated noise, the obtained smoothed image is assumed to be effectively noiseless. </p>
+
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00409">409</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__dfs_8c_source.html#l00809">dfs_get_parameter_int_const()</a>, <a class="el" href="fors__image_8c_source.html#l00869">fors_image_divide_noerr()</a>, and <a class="el" href="fors__image_8c_source.html#l01188">fors_image_get_median()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00299">remove_large_scale()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gff8fa4d76051acfba7263b22a5bc06c3"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::write_qc" ref="gff8fa4d76051acfba7263b22a5bc06c3" args="(cpl_propertylist *qc, const cpl_frame *first_raw_frame, const fors_image_list *sflats, const fors_image *master_sflat, const fors_setting *setting, double saturation)" -->
+<a class="anchor" id="ga06f1099ef36e41395e5619dbacfe3aa1"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void write_qc           </td>
+          <td class="memname">static void write_qc </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>qc</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>qc</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>first_raw_frame</em>, </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>first_raw_frame</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const fors_image_list * </td>
-          <td class="paramname"> <em>sflats</em>, </td>
+          <td class="paramtype">const fors_image_list * </td>
+          <td class="paramname"><em>sflats</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>master_sflat</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>master_sflat</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>saturation</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>saturation</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Compute QC. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>qc</em> </td><td>write to this list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sflats</em> </td><td>raw flats (already bias subtracted) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>instrument setting </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>saturation</em> </td><td>previously computed saturation percentage </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Compute QC. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">qc</td><td>write to this list </td></tr>
+    <tr><td class="paramname">sflats</td><td>raw flats (already bias subtracted) </td></tr>
+    <tr><td class="paramname">setting</td><td>instrument setting </td></tr>
+    <tr><td class="paramname">saturation</td><td>previously computed saturation percentage </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00485">485</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="test__simulate_8c-source.html#l00099">conad</a>, <a class="el" href="fors__setting_8h-source.html#l00065">_fors_setting::exposure_time</a>, <a class="el" href="fors__tools_8c-source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__image_8c-source.html#l01204">fors_image_crop()</a>, <a class="el" href="for [...]
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">489</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__tools_8c_source.html#l00244">fors_fixed_pattern_noise()</a>, <a class="el" href="fors__image_8c_source.html#l01213">fors_image_crop()</a>, <a class="el" href="fors__image_8c_source.html#l00188">fors_image_delete()</a>, <a class="el" href="fors__image_8c_source.html#l00934">fors_image_divide()</a>, <a class="el" href="fors__image_8c_source.html#l01057">fors_image_divide_scalar()</a>, <a cla [...]
+
+<p>Referenced by <a class="el" href="fors__bias__impl_8c_source.html#l00109">fors_bias()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g8bd60f1e1c99dff8aa58da8d21eeeb02"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::fors_img_screen_flat_define_parameters" ref="g8bd60f1e1c99dff8aa58da8d21eeeb02" args="(cpl_parameterlist *parameters)" -->
+<a class="anchor" id="ga19e0710196db92a992d5c1502c35a5f0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_img_screen_flat_define_parameters           </td>
+          <td class="memname">void fors_img_screen_flat_define_parameters </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Define recipe parameters. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameter list to fill </td></tr>
+</div><div class="memdoc">
+
+<p>Define recipe parameters. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>parameter list to fill </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00096">96</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
-<p>
-References <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00049">fors_img_screen_flat_name</a>, and <a class="el" href="fors__stack_8c-source.html#l00055">fors_stack_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat_8c-source.html#l00109">fors_img_screen_flat_create()</a>, and <a class="el" href="fors__img__screen__flat-test_8c-source.html#l00065">test_img_screen_flat()</a>.
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00096">96</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__stack_8c_source.html#l00055">fors_stack_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat_8c_source.html#l00109">fors_img_screen_flat_create()</a>, and <a class="el" href="fors__img__screen__flat-test_8c_source.html#l00065">test_img_screen_flat()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g6ada02347c7648aaa61ce6bc000910e5"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::fors_img_screen_flat" ref="g6ada02347c7648aaa61ce6bc000910e5" args="(cpl_frameset *frames, const cpl_parameterlist *parameters)" -->
+<a class="anchor" id="gad6f0f603eedc00271082e6dae9dbd2a6"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_img_screen_flat           </td>
+          <td class="memname">void fors_img_screen_flat </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em></td><td> </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Do the processing. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>input frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>The parameters list</td></tr>
+</div><div class="memdoc">
+
+<p>Do the processing. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>input frames </td></tr>
+    <tr><td class="paramname">parameters</td><td>The parameters list</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">186</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__dfs_8c-source.html#l01164">fors_dfs_save_image()</a>, <a class="el" href="fors__utils_8c-source.html#l00468">fors_frameset_extract()</a>, <a class="el" href="fors__image_8c-source.html#l00172">fors_image_duplicate()</a>, <a class="el" href="fors__image_8c-source.html#l00349">fors_image_load()</a>, <a class="el" href="for [...]
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat_8c-source.html#l00158">fors_img_screen_flat_exec()</a>, and <a class="el" href="fors__img__screen__flat-test_8c-source.html#l00065">test_img_screen_flat()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">186</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__dfs_8c_source.html#l01200">fors_dfs_save_image_err()</a>, <a class="el" href="fors__utils_8c_source.html#l00468">fors_frameset_extract()</a>, <a class="el" href="fors__image_8c_source.html#l00175">fors_image_duplicate()</a>, <a class="el" href="fors__image_8c_source.html#l00352">fors_image_load()</a>, <a class="el" href="fors__image_8c_source.html#l00316">fors_image_load_list_const()</a>,  [...]
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat_8c_source.html#l00158">fors_img_screen_flat_exec()</a>, and <a class="el" href="fors__img__screen__flat-test_8c_source.html#l00065">test_img_screen_flat()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g4abb403976fc3ddcaa614c59a44590c9"></a><!-- doxytag: member="fors_img_screen_flat.c::cpl_plugin_get_info" ref="g4abb403976fc3ddcaa614c59a44590c9" args="(cpl_pluginlist *list)" -->
+<a class="anchor" id="ga31d1fccd4cd15b1c1f3c5edc8cb18693"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int cpl_plugin_get_info           </td>
+          <td class="memname">int cpl_plugin_get_info </td>
           <td>(</td>
-          <td class="paramtype">cpl_pluginlist * </td>
-          <td class="paramname"> <em>list</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_pluginlist * </td>
+          <td class="paramname"><em>list</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Build the list of available plugins, for this module. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>The plugin list</td></tr>
+</div><div class="memdoc">
+
+<p>Build the list of available plugins, for this module. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">list</td><td>The plugin list</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
-Create the recipe instance and make it available to the application using the interface. This function is exported. 
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat_8c-source.html#l00062">62</a> of file <a class="el" href="fors__img__screen__flat_8c-source.html">fors_img_screen_flat.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00065">fors_get_license()</a>, <a class="el" href="fors__utils_8c-source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00052">fors_img_screen_flat_author</a>, <a class="el" href="fors__img__screen__flat_8c-source.html#l00109">fors_img_screen_flat_create()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00054">fors_img_screen_flat_description</a [...]
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<p>Create the recipe instance and make it available to the application using the interface. This function is exported. </p>
+
+<p>Definition at line <a class="el" href="fors__img__screen__flat_8c_source.html#l00062">62</a> of file <a class="el" href="fors__img__screen__flat_8c_source.html">fors_img_screen_flat.c</a>.</p>
+
+<p>References <a class="el" href="fors__utils_8c_source.html#l00065">fors_get_license()</a>, <a class="el" href="fors__utils_8c_source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__img__screen__flat_8c_source.html#l00109">fors_img_screen_flat_create()</a>, <a class="el" href="fors__img__screen__flat_8c_source.html#l00207">fors_img_screen_flat_destroy()</a>, and <a class="el" href="fors__img__screen__flat_8c_source.html#l00158">fors_img_screen_flat_exec()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g4f7674508424db7a7b62d5a8772bb3cc"></a><!-- doxytag: member="fors_img_screen_flat.c::fors_img_screen_flat_create" ref="g4f7674508424db7a7b62d5a8772bb3cc" args="(cpl_plugin *plugin)" -->
+</div>
+<a class="anchor" id="gaaf1392d5e4fd8d016322a38b2bc1131a"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_img_screen_flat_create           </td>
+          <td class="memname">static int fors_img_screen_flat_create </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Setup the recipe options. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Setup the recipe options. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok</dd></dl>
-Defining the command-line/configuration parameters for the recipe. 
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat_8c-source.html#l00109">109</a> of file <a class="el" href="fors__img__screen__flat_8c-source.html">fors_img_screen_flat.c</a>.
-<p>
-References <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00096">fors_img_screen_flat_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok</dd></dl>
+<p>Defining the command-line/configuration parameters for the recipe. </p>
+
+<p>Definition at line <a class="el" href="fors__img__screen__flat_8c_source.html#l00109">109</a> of file <a class="el" href="fors__img__screen__flat_8c_source.html">fors_img_screen_flat.c</a>.</p>
+
+<p>References <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00096">fors_img_screen_flat_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gcdfb37251e245fe82da375ba0725a3cb"></a><!-- doxytag: member="fors_img_screen_flat.c::fors_img_screen_flat_exec" ref="gcdfb37251e245fe82da375ba0725a3cb" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="ga4a8a4add6fd2c7f1300789425e079bce"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_img_screen_flat_exec           </td>
+          <td class="memname">static int fors_img_screen_flat_exec </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Execute the plugin instance given by the interface. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>the plugin</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Execute the plugin instance given by the interface. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>the plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat_8c-source.html#l00158">158</a> of file <a class="el" href="fors__img__screen__flat_8c-source.html">fors_img_screen_flat.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dfs_8c-source.html#l00258">fors_end()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">fors_img_screen_flat()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00050">fors_img_screen_flat_description_short</a>.
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__img__screen__flat_8c_source.html#l00158">158</a> of file <a class="el" href="fors__img__screen__flat_8c_source.html">fors_img_screen_flat.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dfs_8c_source.html#l00258">fors_end()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g4ee16c004f65246f0c474d1c4f5516a8"></a><!-- doxytag: member="fors_img_screen_flat.c::fors_img_screen_flat_destroy" ref="g4ee16c004f65246f0c474d1c4f5516a8" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="ga0867be809872f262200c7562c3eb0cee"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_img_screen_flat_destroy           </td>
+          <td class="memname">static int fors_img_screen_flat_destroy </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Destroy what has been created by the 'create' function. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Destroy what has been created by the 'create' function. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
 
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat_8c-source.html#l00207">207</a> of file <a class="el" href="fors__img__screen__flat_8c-source.html">fors_img_screen_flat.c</a>.
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<p>Definition at line <a class="el" href="fors__img__screen__flat_8c_source.html#l00207">207</a> of file <a class="el" href="fors__img__screen__flat_8c_source.html">fors_img_screen_flat.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr><h2>Variable Documentation</h2>
-<a class="anchor" name="gc5ff969a1df38b9da80ab308f823132d"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::fors_img_screen_flat_description_short" ref="gc5ff969a1df38b9da80ab308f823132d" args="" -->
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="ga4602c49d9d5b738361257d202b8645bb"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* const <a class="el" href="group__fors__img__screen__flat.html#gc5ff969a1df38b9da80ab308f823132d">fors_img_screen_flat_description_short</a>          </td>
+          <td class="memname">const char* const fors_img_screen_flat_description_short</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">= </div>
+<div class="line"><span class="stringliteral">"Compute master screen flat frame"</span></div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00050">50</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment"> 
-<span class="stringliteral">"Compute master screen flat frame"</span>
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00050">50</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat_8c-source.html#l00062">cpl_plugin_get_info()</a>, and <a class="el" href="fors__img__screen__flat_8c-source.html#l00158">fors_img_screen_flat_exec()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g584ddcde63f204f4110497cab0e49075"></a><!-- doxytag: member="fors_img_screen_flat_impl.c::fors_img_screen_flat_description" ref="g584ddcde63f204f4110497cab0e49075" args="" -->
+<a class="anchor" id="ga36aeb7e100bc98da1bd77b210e54a41f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* const <a class="el" href="group__fors__img__screen__flat.html#g584ddcde63f204f4110497cab0e49075">fors_img_screen_flat_description</a>          </td>
+          <td class="memname">const char* const fors_img_screen_flat_description</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">= </div>
+<div class="line"><span class="stringliteral">"After bias subtraction, the input flat field frames are combined using\n"</span></div>
+<div class="line"><span class="stringliteral">"the given stack method. The combined frame is finally normalised dividing\n"</span></div>
+<div class="line"><span class="stringliteral">"it by its large scale illumination trend. The large scale trend is obtained\n"</span></div>
+<div class="line"><span class="stringliteral">"by applying a median filter with a large kernel. To avoid boundary effects, \n"</span></div>
+<div class="line"><span class="stringliteral">"the median filter is applied only to the specified region.\n"</span></div>
+<div class="line"><span class="stringliteral">"The overscan regions, if present, are removed from the result.\n\n"</span></div>
+<div class="line"><span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><span class="stringliteral">"  SCREEN_FLAT_IMG            Raw         Screen flat field    Y\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_BIAS                Raw         Master bias          Y\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+<div class="line"><span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_SCREEN_FLAT_IMG     FITS image  Master screen flat field\n"</span></div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00054">54</a> of file <a class="el" href="fors__img__screen__flat__impl_8c_source.html">fors_img_screen_flat_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment"> 
-<span class="stringliteral">"After bias subtraction, the input flat field frames are combined using\n"</span>
-<span class="stringliteral">"the given stack method. The combined frame is finally normalised dividing\n"</span>
-<span class="stringliteral">"it by its large scale illumination trend. The large scale trend is obtained\n"</span>
-<span class="stringliteral">"by applying a median filter with a large kernel. To avoid boundary effects, \n"</span>
-<span class="stringliteral">"the median filter is applied only to the specified region.\n"</span>
-<span class="stringliteral">"The overscan regions, if present, are removed from the result.\n\n"</span>
-<span class="stringliteral">"Input files:\n"</span>
-<span class="stringliteral">"\n"</span>
-<span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<span class="stringliteral">"  SCREEN_FLAT_IMG            Raw         Screen flat field    Y\n"</span>
-<span class="stringliteral">"  MASTER_BIAS                Raw         Master bias          Y\n"</span>
-<span class="stringliteral">"\n"</span>
-<span class="stringliteral">"Output files:\n\n"</span>
-<span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<span class="stringliteral">"  MASTER_SCREEN_FLAT_IMG     FITS image  Master screen flat field\n"</span>
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00054">54</a> of file <a class="el" href="fors__img__screen__flat__impl_8c-source.html">fors_img_screen_flat_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat_8c-source.html#l00062">cpl_plugin_get_info()</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__img__screen__flat__test.html b/html/group__fors__img__screen__flat__test.html
index 0b009e6..e403d53 100644
--- a/html/group__fors__img__screen__flat__test.html
+++ b/html/group__fors__img__screen__flat__test.html
@@ -1,62 +1,97 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: test of screen flat recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>test of screen flat recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g94a7123b53e71795fea2518b58a1f44d"></a><!-- doxytag: member="fors_img_screen_flat_test::test_img_screen_flat" ref="g94a7123b53e71795fea2518b58a1f44d" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat__test.html#g94a7123b53e71795fea2518b58a1f44d">test_img_screen_flat</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test screen flat recipe. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_img_screen_flat_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of image module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_screen_flat-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">test of screen flat recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gaa7f97a660fe457c4a77d4269200b6162"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa7f97a660fe457c4a77d4269200b6162"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat__test.html#gaa7f97a660fe457c4a77d4269200b6162">test_img_screen_flat</a> (void)</td></tr>
+<tr class="memdesc:gaa7f97a660fe457c4a77d4269200b6162"><td class="mdescLeft"> </td><td class="mdescRight">Test screen flat recipe. <br/></td></tr>
+<tr class="separator:gaa7f97a660fe457c4a77d4269200b6162"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__screen__flat__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of image module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(frames); \</div>
+<div class="line">    cpl_parameterlist_delete(parameters); \</div>
+<div class="line">    fors_image_delete(&raw_sflat); \</div>
+<div class="line">    fors_image_delete(&master_sflat); \</div>
+<div class="line">    fors_image_delete(&master_bias); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    cpl_propertylist_delete(product_header); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__screen__flat-test_8c_source.html#l00050">50</a> of file <a class="el" href="fors__img__screen__flat-test_8c_source.html">fors_img_screen_flat-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(frames); \
-    cpl_parameterlist_delete(parameters); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&raw_sflat); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_sflat); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_bias); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    cpl_propertylist_delete(product_header); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__screen__flat-test_8c-source.html#l00050">50</a> of file <a class="el" href="fors__img__screen__flat-test_8c-source.html">fors_img_screen_flat-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__img__sky__flat.html b/html/group__fors__img__sky__flat.html
index 2988dd4..d6182e9 100644
--- a/html/group__fors__img__sky__flat.html
+++ b/html/group__fors__img__sky__flat.html
@@ -1,329 +1,371 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_recipe Recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>fors_recipe Recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#gec7c64a6e66a6461f399baba1d71640c">fors_img_sky_flat_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#gec7c64a6e66a6461f399baba1d71640c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#g46d79972dcc1d750bb362f17bd454517">fors_img_sky_flat</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#g46d79972dcc1d750bb362f17bd454517"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#g4abb403976fc3ddcaa614c59a44590c9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#g2fd81ec014584d5e4812ceec9fced368">fors_img_sky_flat_create</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#g2fd81ec014584d5e4812ceec9fced368"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#g73801ec3f11f5acf82354dce429c7364">fors_img_sky_flat_exec</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#g73801ec3f11f5acf82354dce429c7364"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#g41907dc5910fef4332bc850d202cdf0a">fors_img_sky_flat_destroy</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#g41907dc5910fef4332bc850d202cdf0a"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g58ccd117747a3c69f4c3639d8c69a8e7"></a><!-- doxytag: member="fors_img_sky_flat::fors_img_sky_flat_name" ref="g58ccd117747a3c69f4c3639d8c69a8e7" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#g58ccd117747a3c69f4c3639d8c69a8e7">fors_img_sky_flat_name</a> = "fors_img_sky_flat"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4c9a895d70a777d2e7e1c6dff6c2523e"></a><!-- doxytag: member="fors_img_sky_flat::fors_img_sky_flat_description_short" ref="g4c9a895d70a777d2e7e1c6dff6c2523e" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#g4c9a895d70a777d2e7e1c6dff6c2523e">fors_img_sky_flat_description_short</a> = "Compute master img_sky_flat frame"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2eb550caafa47d2df3a812a099d0a4f8"></a><!-- doxytag: member="fors_img_sky_flat::fors_img_sky_flat_author" ref="g2eb550caafa47d2df3a812a099d0a4f8" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#g2eb550caafa47d2df3a812a099d0a4f8">fors_img_sky_flat_author</a> = "Jonas M. Larsen"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gda5355fc3361e98892a671bb9757194f"></a><!-- doxytag: member="fors_img_sky_flat::fors_img_sky_flat_email" ref="gda5355fc3361e98892a671bb9757194f" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#gda5355fc3361e98892a671bb9757194f">fors_img_sky_flat_email</a> = PACKAGE_BUGREPORT</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#g6e7c504f168bc6f8319b544b066ceb85">fors_img_sky_flat_description</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_recipe Recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga61b98b9ade434fed2b939774f5c6c7eb"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#ga61b98b9ade434fed2b939774f5c6c7eb">fors_img_sky_flat_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga61b98b9ade434fed2b939774f5c6c7eb"><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#ga61b98b9ade434fed2b939774f5c6c7eb">More...</a><br/></td></tr>
+<tr class="separator:ga61b98b9ade434fed2b939774f5c6c7eb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6624d51caa8c203f494562b809cd9b9b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#ga6624d51caa8c203f494562b809cd9b9b">fors_img_sky_flat</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga6624d51caa8c203f494562b809cd9b9b"><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#ga6624d51caa8c203f494562b809cd9b9b">More...</a><br/></td></tr>
+<tr class="separator:ga6624d51caa8c203f494562b809cd9b9b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
+<tr class="memdesc:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#ga31d1fccd4cd15b1c1f3c5edc8cb18693">More...</a><br/></td></tr>
+<tr class="separator:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga02c59acaaf71d4b2e9b4df6e5a452695"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#ga02c59acaaf71d4b2e9b4df6e5a452695">fors_img_sky_flat_create</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga02c59acaaf71d4b2e9b4df6e5a452695"><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#ga02c59acaaf71d4b2e9b4df6e5a452695">More...</a><br/></td></tr>
+<tr class="separator:ga02c59acaaf71d4b2e9b4df6e5a452695"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3cf0bca5c79ec81295fe4402b9580063"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#ga3cf0bca5c79ec81295fe4402b9580063">fors_img_sky_flat_exec</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga3cf0bca5c79ec81295fe4402b9580063"><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#ga3cf0bca5c79ec81295fe4402b9580063">More...</a><br/></td></tr>
+<tr class="separator:ga3cf0bca5c79ec81295fe4402b9580063"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7182fc139ef9c00488f2df5e96be18b3"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat.html#ga7182fc139ef9c00488f2df5e96be18b3">fors_img_sky_flat_destroy</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga7182fc139ef9c00488f2df5e96be18b3"><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#ga7182fc139ef9c00488f2df5e96be18b3">More...</a><br/></td></tr>
+<tr class="separator:ga7182fc139ef9c00488f2df5e96be18b3"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga9915858245e022e3ac1cb131e4a19649"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9915858245e022e3ac1cb131e4a19649"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat_name</b> = "fors_img_sky_flat"</td></tr>
+<tr class="separator:ga9915858245e022e3ac1cb131e4a19649"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7d9766834c42d36a3fbd7d442371bb3a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7d9766834c42d36a3fbd7d442371bb3a"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat_description_short</b> = "Compute master img_sky_flat frame"</td></tr>
+<tr class="separator:ga7d9766834c42d36a3fbd7d442371bb3a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4992cec4632dfdcab3c4830a341f8095"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4992cec4632dfdcab3c4830a341f8095"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat_author</b> = "Jonas M. Larsen"</td></tr>
+<tr class="separator:ga4992cec4632dfdcab3c4830a341f8095"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8a867c569bd5f246c161b80fe49eef79"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8a867c569bd5f246c161b80fe49eef79"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat_email</b> = PACKAGE_BUGREPORT</td></tr>
+<tr class="separator:ga8a867c569bd5f246c161b80fe49eef79"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaab19885d0f8b55663a425a4609791e9c"><td class="memItemLeft" align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><b>fors_img_sky_flat_description</b></td></tr>
+<tr class="separator:gaab19885d0f8b55663a425a4609791e9c"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-See recipe description for details. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_sky_flat_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>See recipe description for details. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(sflat_frames); \</div>
+<div class="line">    cpl_frameset_delete(master_bias_frame); \</div>
+<div class="line">    fors_stack_method_delete(&sm); \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)context); \</div>
+<div class="line">    fors_image_delete_const(&master_bias); \</div>
+<div class="line">    fors_image_delete(&master_sky_flat); \</div>
+<div class="line">    fors_image_list_delete(&sflats, <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>); \</div>
+<div class="line">    cpl_propertylist_delete(qc); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00077">77</a> of file <a class="el" href="fors__img__sky__flat__impl_8c_source.html">fors_img_sky_flat_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(sflat_frames); \
-    cpl_frameset_delete(master_bias_frame); \
-    <a class="code" href="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13">fors_stack_method_delete</a>(&sm); \
-    cpl_free((<span class="keywordtype">void</span> *)context); \
-    <a class="code" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">fors_image_delete_const</a>(&master_bias); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_sky_flat); \
-    fors_image_list_delete(&sflats, <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>); \
-    cpl_propertylist_delete(qc); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00077">77</a> of file <a class="el" href="fors__img__sky__flat__impl_8c-source.html">fors_img_sky_flat_impl.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="gec7c64a6e66a6461f399baba1d71640c"></a><!-- doxytag: member="fors_img_sky_flat_impl.c::fors_img_sky_flat_define_parameters" ref="gec7c64a6e66a6461f399baba1d71640c" args="(cpl_parameterlist *parameters)" -->
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga61b98b9ade434fed2b939774f5c6c7eb"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_img_sky_flat_define_parameters           </td>
+          <td class="memname">void fors_img_sky_flat_define_parameters </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Define recipe parameters. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameter list to fill </td></tr>
+<p>Define recipe parameters. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>parameter list to fill </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00065">65</a> of file <a class="el" href="fors__img__sky__flat__impl_8c-source.html">fors_img_sky_flat_impl.c</a>.
-<p>
-References <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00047">fors_img_sky_flat_name</a>, and <a class="el" href="fors__stack_8c-source.html#l00055">fors_stack_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__sky__flat_8c-source.html#l00109">fors_img_sky_flat_create()</a>, and <a class="el" href="fors__img__sky__flat-test_8c-source.html#l00062">test_img_sky_flat()</a>.
+<p>Definition at line <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00065">65</a> of file <a class="el" href="fors__img__sky__flat__impl_8c_source.html">fors_img_sky_flat_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__stack_8c_source.html#l00055">fors_stack_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__sky__flat_8c_source.html#l00109">fors_img_sky_flat_create()</a>, and <a class="el" href="fors__img__sky__flat-test_8c_source.html#l00062">test_img_sky_flat()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g46d79972dcc1d750bb362f17bd454517"></a><!-- doxytag: member="fors_img_sky_flat_impl.c::fors_img_sky_flat" ref="g46d79972dcc1d750bb362f17bd454517" args="(cpl_frameset *frames, const cpl_parameterlist *parameters)" -->
+</div>
+<a class="anchor" id="ga6624d51caa8c203f494562b809cd9b9b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_img_sky_flat           </td>
+          <td class="memname">void fors_img_sky_flat </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em></td><td> </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Do the processing. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>input frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>The parameters list</td></tr>
+<p>Do the processing. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>input frames </td></tr>
+    <tr><td class="paramname">parameters</td><td>The parameters list</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">98</a> of file <a class="el" href="fors__img__sky__flat__impl_8c_source.html">fors_img_sky_flat_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__dfs_8c_source.html#l01200">fors_dfs_save_image_err()</a>, <a class="el" href="fors__utils_8c_source.html#l00468">fors_frameset_extract()</a>, <a class="el" href="fors__image_8c_source.html#l01057">fors_image_divide_scalar()</a>, <a class="el" href="fors__image_8c_source.html#l01188">fors_image_get_median()</a>, <a class="el" href="fors__image_8c_source.html#l00352">fors_image_load()</a>, < [...]
 
-<p>
-Definition at line <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">98</a> of file <a class="el" href="fors__img__sky__flat__impl_8c-source.html">fors_img_sky_flat_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__dfs_8c-source.html#l01164">fors_dfs_save_image()</a>, <a class="el" href="fors__utils_8c-source.html#l00468">fors_frameset_extract()</a>, <a class="el" href="fors__image_8c-source.html#l01048">fors_image_divide_scalar()</a>, <a class="el" href="fors__image_8c-source.html#l01179">fors_image_get_median()</a>, <a class="el" [...]
-<p>
-Referenced by <a class="el" href="fors__img__sky__flat_8c-source.html#l00158">fors_img_sky_flat_exec()</a>, and <a class="el" href="fors__img__sky__flat-test_8c-source.html#l00062">test_img_sky_flat()</a>.
+<p>Referenced by <a class="el" href="fors__img__sky__flat_8c_source.html#l00158">fors_img_sky_flat_exec()</a>, and <a class="el" href="fors__img__sky__flat-test_8c_source.html#l00062">test_img_sky_flat()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g4abb403976fc3ddcaa614c59a44590c9"></a><!-- doxytag: member="fors_img_sky_flat.c::cpl_plugin_get_info" ref="g4abb403976fc3ddcaa614c59a44590c9" args="(cpl_pluginlist *list)" -->
+<a class="anchor" id="ga31d1fccd4cd15b1c1f3c5edc8cb18693"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int cpl_plugin_get_info           </td>
+          <td class="memname">int cpl_plugin_get_info </td>
           <td>(</td>
-          <td class="paramtype">cpl_pluginlist * </td>
-          <td class="paramname"> <em>list</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_pluginlist * </td>
+          <td class="paramname"><em>list</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Build the list of available plugins, for this module. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>The plugin list</td></tr>
+<p>Build the list of available plugins, for this module. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">list</td><td>The plugin list</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
-Create the recipe instance and make it available to the application using the interface. This function is exported. 
-<p>
-Definition at line <a class="el" href="fors__img__sky__flat_8c-source.html#l00062">62</a> of file <a class="el" href="fors__img__sky__flat_8c-source.html">fors_img_sky_flat.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00065">fors_get_license()</a>, <a class="el" href="fors__utils_8c-source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00049">fors_img_sky_flat_author</a>, <a class="el" href="fors__img__sky__flat_8c-source.html#l00109">fors_img_sky_flat_create()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00051">fors_img_sky_flat_description</a>, <a class="el" h [...]
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<p>Create the recipe instance and make it available to the application using the interface. This function is exported. </p>
+
+<p>Definition at line <a class="el" href="fors__img__sky__flat_8c_source.html#l00062">62</a> of file <a class="el" href="fors__img__sky__flat_8c_source.html">fors_img_sky_flat.c</a>.</p>
+
+<p>References <a class="el" href="fors__utils_8c_source.html#l00065">fors_get_license()</a>, <a class="el" href="fors__utils_8c_source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__img__sky__flat_8c_source.html#l00109">fors_img_sky_flat_create()</a>, <a class="el" href="fors__img__sky__flat_8c_source.html#l00207">fors_img_sky_flat_destroy()</a>, and <a class="el" href="fors__img__sky__flat_8c_source.html#l00158">fors_img_sky_flat_exec()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g2fd81ec014584d5e4812ceec9fced368"></a><!-- doxytag: member="fors_img_sky_flat.c::fors_img_sky_flat_create" ref="g2fd81ec014584d5e4812ceec9fced368" args="(cpl_plugin *plugin)" -->
+</div>
+<a class="anchor" id="ga02c59acaaf71d4b2e9b4df6e5a452695"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_img_sky_flat_create           </td>
+          <td class="memname">static int fors_img_sky_flat_create </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Setup the recipe options. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+<p>Setup the recipe options. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok</dd></dl>
-Defining the command-line/configuration parameters for the recipe. 
-<p>
-Definition at line <a class="el" href="fors__img__sky__flat_8c-source.html#l00109">109</a> of file <a class="el" href="fors__img__sky__flat_8c-source.html">fors_img_sky_flat.c</a>.
-<p>
-References <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00065">fors_img_sky_flat_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__sky__flat_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok</dd></dl>
+<p>Defining the command-line/configuration parameters for the recipe. </p>
+
+<p>Definition at line <a class="el" href="fors__img__sky__flat_8c_source.html#l00109">109</a> of file <a class="el" href="fors__img__sky__flat_8c_source.html">fors_img_sky_flat.c</a>.</p>
+
+<p>References <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00065">fors_img_sky_flat_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__sky__flat_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g73801ec3f11f5acf82354dce429c7364"></a><!-- doxytag: member="fors_img_sky_flat.c::fors_img_sky_flat_exec" ref="g73801ec3f11f5acf82354dce429c7364" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="ga3cf0bca5c79ec81295fe4402b9580063"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_img_sky_flat_exec           </td>
+          <td class="memname">static int fors_img_sky_flat_exec </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Execute the plugin instance given by the interface. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>the plugin</td></tr>
+<p>Execute the plugin instance given by the interface. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>the plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__img__sky__flat_8c_source.html#l00158">158</a> of file <a class="el" href="fors__img__sky__flat_8c_source.html">fors_img_sky_flat.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dfs_8c_source.html#l00258">fors_end()</a>, and <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__img__sky__flat_8c-source.html#l00158">158</a> of file <a class="el" href="fors__img__sky__flat_8c-source.html">fors_img_sky_flat.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dfs_8c-source.html#l00258">fors_end()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, and <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00048">fors_img_sky_flat_description_short</a>.
-<p>
-Referenced by <a class="el" href="fors__img__sky__flat_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<p>Referenced by <a class="el" href="fors__img__sky__flat_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g41907dc5910fef4332bc850d202cdf0a"></a><!-- doxytag: member="fors_img_sky_flat.c::fors_img_sky_flat_destroy" ref="g41907dc5910fef4332bc850d202cdf0a" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="ga7182fc139ef9c00488f2df5e96be18b3"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_img_sky_flat_destroy           </td>
+          <td class="memname">static int fors_img_sky_flat_destroy </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Destroy what has been created by the 'create' function. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+<p>Destroy what has been created by the 'create' function. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__img__sky__flat_8c_source.html#l00207">207</a> of file <a class="el" href="fors__img__sky__flat_8c_source.html">fors_img_sky_flat.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__sky__flat_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__img__sky__flat_8c-source.html#l00207">207</a> of file <a class="el" href="fors__img__sky__flat_8c-source.html">fors_img_sky_flat.c</a>.
-<p>
-Referenced by <a class="el" href="fors__img__sky__flat_8c-source.html#l00062">cpl_plugin_get_info()</a>.
 </div>
-</div><p>
-<hr><h2>Variable Documentation</h2>
-<a class="anchor" name="g6e7c504f168bc6f8319b544b066ceb85"></a><!-- doxytag: member="fors_img_sky_flat_impl.c::fors_img_sky_flat_description" ref="g6e7c504f168bc6f8319b544b066ceb85" args="" -->
+</div>
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="gaab19885d0f8b55663a425a4609791e9c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* const <a class="el" href="group__fors__img__sky__flat.html#g6e7c504f168bc6f8319b544b066ceb85">fors_img_sky_flat_description</a>          </td>
+          <td class="memname">const char* const fors_img_sky_flat_description</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">= </div>
+<div class="line"><span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span></div>
+<div class="line"><span class="stringliteral">"  SKY_FLAT_IMG               Raw         Jittered sky flat fields    1+\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+<div class="line"><span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flat field\n"</span></div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00051">51</a> of file <a class="el" href="fors__img__sky__flat__impl_8c_source.html">fors_img_sky_flat_impl.c</a>.</p>
 
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment"> 
-<span class="stringliteral">"Input files:\n"</span>
-<span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span>
-<span class="stringliteral">"  SKY_FLAT_IMG               Raw         Jittered sky flat fields    1+\n"</span>
-<span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span>
-<span class="stringliteral">"\n"</span>
-<span class="stringliteral">"Output files:\n"</span>
-<span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flat field\n"</span>
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00051">51</a> of file <a class="el" href="fors__img__sky__flat__impl_8c-source.html">fors_img_sky_flat_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__img__sky__flat_8c-source.html#l00062">cpl_plugin_get_info()</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__img__sky__flat__test.html b/html/group__fors__img__sky__flat__test.html
index 04038ee..d08226a 100644
--- a/html/group__fors__img__sky__flat__test.html
+++ b/html/group__fors__img__sky__flat__test.html
@@ -1,61 +1,96 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: test of sky flat recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>test of sky flat recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g18f82989adfe64f6e50c56a10b9eed98"></a><!-- doxytag: member="fors_img_sky_flat_test::test_img_sky_flat" ref="g18f82989adfe64f6e50c56a10b9eed98" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat__test.html#g18f82989adfe64f6e50c56a10b9eed98">test_img_sky_flat</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test sky flat recipe. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_img_sky_flat_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of image module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_img_sky_flat-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">test of sky flat recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga885513ffa26feb33dd89087279376767"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga885513ffa26feb33dd89087279376767"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat__test.html#ga885513ffa26feb33dd89087279376767">test_img_sky_flat</a> (void)</td></tr>
+<tr class="memdesc:ga885513ffa26feb33dd89087279376767"><td class="mdescLeft"> </td><td class="mdescRight">Test sky flat recipe. <br/></td></tr>
+<tr class="separator:ga885513ffa26feb33dd89087279376767"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__img__sky__flat__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of image module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(frames); \</div>
+<div class="line">    cpl_parameterlist_delete(parameters); \</div>
+<div class="line">    fors_image_delete(&raw_sflat); \</div>
+<div class="line">    fors_image_delete(&master_sflat); \</div>
+<div class="line">    fors_image_delete(&master_bias); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__img__sky__flat-test_8c_source.html#l00048">48</a> of file <a class="el" href="fors__img__sky__flat-test_8c_source.html">fors_img_sky_flat-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(frames); \
-    cpl_parameterlist_delete(parameters); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&raw_sflat); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_sflat); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_bias); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__img__sky__flat-test_8c-source.html#l00048">48</a> of file <a class="el" href="fors__img__sky__flat-test_8c-source.html">fors_img_sky_flat-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__pattern__test.html b/html/group__fors__pattern__test.html
index dc3584b..9ca581f 100644
--- a/html/group__fors__pattern__test.html
+++ b/html/group__fors__pattern__test.html
@@ -1,32 +1,67 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_pattern unit tests</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>fors_pattern unit tests</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g25ce248a1e86361188a657bac8f9ff32"></a><!-- doxytag: member="fors_pattern_test::test_pattern" ref="g25ce248a1e86361188a657bac8f9ff32" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pattern__test.html#g25ce248a1e86361188a657bac8f9ff32">test_pattern</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">test <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_pattern_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pattern__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of QC module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_pattern unit tests</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga05781d2ba3b01b5ddbc4dd9dfe0eda77"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga05781d2ba3b01b5ddbc4dd9dfe0eda77"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pattern__test.html#ga05781d2ba3b01b5ddbc4dd9dfe0eda77">test_pattern</a> (void)</td></tr>
+<tr class="memdesc:ga05781d2ba3b01b5ddbc4dd9dfe0eda77"><td class="mdescLeft"> </td><td class="mdescRight">test <br/></td></tr>
+<tr class="separator:ga05781d2ba3b01b5ddbc4dd9dfe0eda77"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pattern__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of QC module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__pfits.html b/html/group__fors__pfits.html
index 760fd73..e3d6e5b 100644
--- a/html/group__fors__pfits.html
+++ b/html/group__fors__pfits.html
@@ -1,136 +1,161 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: FITS keywords</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>FITS keywords</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g783bff15136576398917fe349d55aab1"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_INSTRUME" ref="g783bff15136576398917fe349d55aab1" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">FORS_PFITS_INSTRUME</a> = "INSTRUME"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5dc9cfd94e4e891afb13c237ca28b031"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_EXPOSURE_TIME" ref="g5dc9cfd94e4e891afb13c237ca28b031" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a> = "EXPTIME"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4a9f2c688a6202767e8c004478488994"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_AIRMASS_START" ref="g4a9f2c688a6202767e8c004478488994" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g4a9f2c688a6202767e8c004478488994">FORS_PFITS_AIRMASS_START</a> = "ESO TEL AIRM START"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc3c14efc5b8bb4954172110153ed1965"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_AIRMASS_END" ref="gc3c14efc5b8bb4954172110153ed1965" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#gc3c14efc5b8bb4954172110153ed1965">FORS_PFITS_AIRMASS_END</a> = "ESO TEL AIRM END"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g787b1866f752fde2b8ffffc413c1bc4b"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_FILTER_NAME" ref="g787b1866f752fde2b8ffffc413c1bc4b" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">FORS_PFITS_FILTER_NAME</a> = "ESO INS FILT1 NAME"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gfaec82e5fe2051be0f32d0e8e01a7060"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_OUTPUTS" ref="gfaec82e5fe2051be0f32d0e8e01a7060" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#gfaec82e5fe2051be0f32d0e8e01a7060">FORS_PFITS_OUTPUTS</a> = "ESO DET OUTPUTS"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a> [4]</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">FORS_PFITS_RON</a> [4]</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ge9a36044b50b5432f2c9018c58a3b98c"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_OVERSCANX" ref="ge9a36044b50b5432f2c9018c58a3b98c" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#ge9a36044b50b5432f2c9018c58a3b98c">FORS_PFITS_OVERSCANX</a> = "ESO DET OUT1 OVSCX"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g7aee125e2c5769eb4927a296a47a63c0"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_OVERSCANY" ref="g7aee125e2c5769eb4927a296a47a63c0" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g7aee125e2c5769eb4927a296a47a63c0">FORS_PFITS_OVERSCANY</a> = "ESO DET OUT1 OVSCY"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g06cb15f701f99b2615b057941aa115ae"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_PRESCANX" ref="g06cb15f701f99b2615b057941aa115ae" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g06cb15f701f99b2615b057941aa115ae">FORS_PFITS_PRESCANX</a> = "ESO DET OUT1 PRSCX"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2701275da3ccfdcbf3ceaf2b3dcc02fc"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_PRESCANY" ref="g2701275da3ccfdcbf3ceaf2b3dcc02fc" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g2701275da3ccfdcbf3ceaf2b3dcc02fc">FORS_PFITS_PRESCANY</a> = "ESO DET OUT1 PRSCY"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g3c36769697845cb20c1c5e5d2193de16"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_CRPIX1" ref="g3c36769697845cb20c1c5e5d2193de16" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g3c36769697845cb20c1c5e5d2193de16">FORS_PFITS_CRPIX1</a> = "CRPIX1"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2fa4424e21e2ca5f1936b814a6d42f97"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_CRPIX2" ref="g2fa4424e21e2ca5f1936b814a6d42f97" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g2fa4424e21e2ca5f1936b814a6d42f97">FORS_PFITS_CRPIX2</a> = "CRPIX2"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g186fc8a1532d8bf60c670ca0071d9047"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_DET_NX" ref="g186fc8a1532d8bf60c670ca0071d9047" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g186fc8a1532d8bf60c670ca0071d9047">FORS_PFITS_DET_NX</a> = "ESO DET OUT1 NX"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g3c7312a701e7edde8da903a85e83ff3f"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_DET_NY" ref="g3c7312a701e7edde8da903a85e83ff3f" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g3c7312a701e7edde8da903a85e83ff3f">FORS_PFITS_DET_NY</a> = "ESO DET OUT1 NY"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ge144a58d19a4028977a4993eb37211b6"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_BINX" ref="ge144a58d19a4028977a4993eb37211b6" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#ge144a58d19a4028977a4993eb37211b6">FORS_PFITS_BINX</a> = "ESO DET WIN1 BINX"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gac44799b56c43a52fd8846bb493c4444"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_BINY" ref="gac44799b56c43a52fd8846bb493c4444" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#gac44799b56c43a52fd8846bb493c4444">FORS_PFITS_BINY</a> = "ESO DET WIN1 BINY"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4eb732430cac676ad4e2bf1f68a3f5f0"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_PIXSCALE" ref="g4eb732430cac676ad4e2bf1f68a3f5f0" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g4eb732430cac676ad4e2bf1f68a3f5f0">FORS_PFITS_PIXSCALE</a> = "ESO INS PIXSCALE"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g43f0b7ed1c32b140f3da959293f924eb"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_READ_CLOCK" ref="g43f0b7ed1c32b140f3da959293f924eb" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g43f0b7ed1c32b140f3da959293f924eb">FORS_PFITS_READ_CLOCK</a> = "ESO DET READ CLOCK"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g0eb4a071376ffab7bd7fb36186e16dda"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_CHIP_ID" ref="g0eb4a071376ffab7bd7fb36186e16dda" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g0eb4a071376ffab7bd7fb36186e16dda">FORS_PFITS_CHIP_ID</a> = "ESO DET CHIP1 ID"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g6ef465e799ac380d31708be1255d0a68"></a><!-- doxytag: member="fors_pfits::FORS_PFITS_TARG_NAME" ref="g6ef465e799ac380d31708be1255d0a68" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__pfits.html#g6ef465e799ac380d31708be1255d0a68">FORS_PFITS_TARG_NAME</a> = "ESO OBS TARG NAME"</td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">FITS keywords</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga9bf38cb93214f1101cb90c6158111719"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9bf38cb93214f1101cb90c6158111719"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_INSTRUME</b> = "INSTRUME"</td></tr>
+<tr class="separator:ga9bf38cb93214f1101cb90c6158111719"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga645edb4dac8c2cac1e0229bb4e220dca"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga645edb4dac8c2cac1e0229bb4e220dca"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_EXPOSURE_TIME</b> = "EXPTIME"</td></tr>
+<tr class="separator:ga645edb4dac8c2cac1e0229bb4e220dca"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae700b45ddce378b17fbd0a6ff922d0cc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae700b45ddce378b17fbd0a6ff922d0cc"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_AIRMASS_START</b> = "ESO TEL AIRM START"</td></tr>
+<tr class="separator:gae700b45ddce378b17fbd0a6ff922d0cc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0cc7efe0e414be58536c6f4adffda19d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0cc7efe0e414be58536c6f4adffda19d"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_AIRMASS_END</b> = "ESO TEL AIRM END"</td></tr>
+<tr class="separator:ga0cc7efe0e414be58536c6f4adffda19d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga84c70df1a23772caf2b2d3accdd21924"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga84c70df1a23772caf2b2d3accdd21924"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_FILTER_NAME</b> = "ESO INS FILT1 NAME"</td></tr>
+<tr class="separator:ga84c70df1a23772caf2b2d3accdd21924"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga346dee1941b5edbc89239af2e889ec15"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga346dee1941b5edbc89239af2e889ec15"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_OUTPUTS</b> = "ESO DET OUTPUTS"</td></tr>
+<tr class="separator:ga346dee1941b5edbc89239af2e889ec15"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga383aa82fd05b4557317d3ee00a151892"><td class="memItemLeft" align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_CONAD</b> [4]</td></tr>
+<tr class="separator:ga383aa82fd05b4557317d3ee00a151892"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac15bb02243c43ef1f7c1c018981439c7"><td class="memItemLeft" align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_RON</b> [4]</td></tr>
+<tr class="separator:gac15bb02243c43ef1f7c1c018981439c7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab662a9e7be3ddd8e28631d86e0ff1adb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab662a9e7be3ddd8e28631d86e0ff1adb"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_OVERSCANX</b> = "ESO DET OUT1 OVSCX"</td></tr>
+<tr class="separator:gab662a9e7be3ddd8e28631d86e0ff1adb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3c4eb0acf69fcc5e2e1c793fb7cb22e3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3c4eb0acf69fcc5e2e1c793fb7cb22e3"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_OVERSCANY</b> = "ESO DET OUT1 OVSCY"</td></tr>
+<tr class="separator:ga3c4eb0acf69fcc5e2e1c793fb7cb22e3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab8c5950ecbdf77455836691453bd426c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab8c5950ecbdf77455836691453bd426c"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_PRESCANX</b> = "ESO DET OUT1 PRSCX"</td></tr>
+<tr class="separator:gab8c5950ecbdf77455836691453bd426c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gafc9fa2200da3dddfeac042d6f6a81c4d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafc9fa2200da3dddfeac042d6f6a81c4d"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_PRESCANY</b> = "ESO DET OUT1 PRSCY"</td></tr>
+<tr class="separator:gafc9fa2200da3dddfeac042d6f6a81c4d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9260ba6382e80e34fcb62cf6820344d9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9260ba6382e80e34fcb62cf6820344d9"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_CRPIX1</b> = "CRPIX1"</td></tr>
+<tr class="separator:ga9260ba6382e80e34fcb62cf6820344d9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2f7430c73e4f0930f46f4cb7d4931b52"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2f7430c73e4f0930f46f4cb7d4931b52"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_CRPIX2</b> = "CRPIX2"</td></tr>
+<tr class="separator:ga2f7430c73e4f0930f46f4cb7d4931b52"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7b94ea972697ac22634885b9faa7e7da"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7b94ea972697ac22634885b9faa7e7da"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_DET_NX</b> = "ESO DET OUT1 NX"</td></tr>
+<tr class="separator:ga7b94ea972697ac22634885b9faa7e7da"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga71e9d8f4f7af8b85c57262318f2b187c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga71e9d8f4f7af8b85c57262318f2b187c"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_DET_NY</b> = "ESO DET OUT1 NY"</td></tr>
+<tr class="separator:ga71e9d8f4f7af8b85c57262318f2b187c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga10e60924de718611ddee862ad3efaab4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga10e60924de718611ddee862ad3efaab4"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_BINX</b> = "ESO DET WIN1 BINX"</td></tr>
+<tr class="separator:ga10e60924de718611ddee862ad3efaab4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gacd25ac95b9c638619ce728f328294797"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gacd25ac95b9c638619ce728f328294797"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_BINY</b> = "ESO DET WIN1 BINY"</td></tr>
+<tr class="separator:gacd25ac95b9c638619ce728f328294797"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga29dfe18bfd9e81ccc07498a70a644487"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga29dfe18bfd9e81ccc07498a70a644487"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_PIXSCALE</b> = "ESO INS PIXSCALE"</td></tr>
+<tr class="separator:ga29dfe18bfd9e81ccc07498a70a644487"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga15a96bee16194fbf57ed99701b5ef354"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga15a96bee16194fbf57ed99701b5ef354"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_READ_CLOCK</b> = "ESO DET READ CLOCK"</td></tr>
+<tr class="separator:ga15a96bee16194fbf57ed99701b5ef354"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa64fd69c327bac649a12a30ffe7ba1ac"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa64fd69c327bac649a12a30ffe7ba1ac"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_CHIP_ID</b> = "ESO DET CHIP1 ID"</td></tr>
+<tr class="separator:gaa64fd69c327bac649a12a30ffe7ba1ac"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2766699b9cde09e660d636b7c29f8896"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2766699b9cde09e660d636b7c29f8896"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>FORS_PFITS_TARG_NAME</b> = "ESO OBS TARG NAME"</td></tr>
+<tr class="separator:ga2766699b9cde09e660d636b7c29f8896"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-Definition of FITS header keywords <hr><h2>Variable Documentation</h2>
-<a class="anchor" name="ge8b3e3bbfe186850a3fa063e98ddcc1f"></a><!-- doxytag: member="fors_pfits.c::FORS_PFITS_CONAD" ref="ge8b3e3bbfe186850a3fa063e98ddcc1f" args="[4]" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>Definition of FITS header keywords </p>
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="ga383aa82fd05b4557317d3ee00a151892"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* const <a class="el" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a>[4]          </td>
+          <td class="memname">const char* const FORS_PFITS_CONAD[4]</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">= {<span class="stringliteral">"ESO DET OUT1 CONAD"</span>,</div>
+<div class="line">                        <span class="stringliteral">"ESO DET OUT2 CONAD"</span>,</div>
+<div class="line">                        <span class="stringliteral">"ESO DET OUT3 CONAD"</span>,</div>
+<div class="line">                        <span class="stringliteral">"ESO DET OUT4 CONAD"</span>}</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__pfits_8c_source.html#l00048">48</a> of file <a class="el" href="fors__pfits_8c_source.html">fors_pfits.c</a>.</p>
 
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment"> {<span class="stringliteral">"ESO DET OUT1 CONAD"</span>,
-                        <span class="stringliteral">"ESO DET OUT2 CONAD"</span>,
-                        <span class="stringliteral">"ESO DET OUT3 CONAD"</span>,
-                        <span class="stringliteral">"ESO DET OUT4 CONAD"</span>}
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__pfits_8c-source.html#l00048">48</a> of file <a class="el" href="fors__pfits_8c-source.html">fors_pfits.c</a>.
-<p>
-Referenced by <a class="el" href="test__simulate_8c-source.html#l00132">create_standard_keys()</a>, <a class="el" href="fors__setting_8c-source.html#l00082">fors_setting_new_level()</a>, and <a class="el" href="fors__img__screen__flat-test_8c-source.html#l00065">test_img_screen_flat()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gff6c938b87cb95065c7503d2718d7fd1"></a><!-- doxytag: member="fors_pfits.c::FORS_PFITS_RON" ref="gff6c938b87cb95065c7503d2718d7fd1" args="[4]" -->
+</div>
+<a class="anchor" id="gac15bb02243c43ef1f7c1c018981439c7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* const <a class="el" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">FORS_PFITS_RON</a>[4]          </td>
+          <td class="memname">const char* const FORS_PFITS_RON[4]</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">= {<span class="stringliteral">"ESO DET OUT1 RON"</span>,</div>
+<div class="line">                        <span class="stringliteral">"ESO DET OUT2 RON"</span>,</div>
+<div class="line">                        <span class="stringliteral">"ESO DET OUT3 RON"</span>,</div>
+<div class="line">                        <span class="stringliteral">"ESO DET OUT4 RON"</span>}</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__pfits_8c_source.html#l00052">52</a> of file <a class="el" href="fors__pfits_8c_source.html">fors_pfits.c</a>.</p>
 
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment"> {<span class="stringliteral">"ESO DET OUT1 RON"</span>,
-                        <span class="stringliteral">"ESO DET OUT2 RON"</span>,
-                        <span class="stringliteral">"ESO DET OUT3 RON"</span>,
-                        <span class="stringliteral">"ESO DET OUT4 RON"</span>}
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__pfits_8c-source.html#l00052">52</a> of file <a class="el" href="fors__pfits_8c-source.html">fors_pfits.c</a>.
-<p>
-Referenced by <a class="el" href="test__simulate_8c-source.html#l00132">create_standard_keys()</a>, and <a class="el" href="fors__setting_8c-source.html#l00082">fors_setting_new_level()</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__photometry.html b/html/group__fors__photometry.html
index 7f82be9..58dda8f 100644
--- a/html/group__fors__photometry.html
+++ b/html/group__fors__photometry.html
@@ -1,2055 +1,2193 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_recipe Recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>fors_recipe Recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structentry.html">entry</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9d7995a21a54c1d39a0bc87d7f498029"></a><!-- doxytag: member="fors_photometry::LIST_ELEM" ref="g9d7995a21a54c1d39a0bc87d7f498029" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g9d7995a21a54c1d39a0bc87d7f498029">LIST_ELEM</a>   <a class="el" href="structentry.html">entry</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb79164ea3a1118352c6ca0ea9a9840ea"></a><!-- doxytag: member="fors_photometry::LIST_DEFINE" ref="gb79164ea3a1118352c6ca0ea9a9840ea" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> { <b>FORS_FIT_NCOEFF_NO</b> =  0, 
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Data Structures</a> |
+<a href="#define-members">Macros</a> |
+<a href="#typedef-members">Typedefs</a> |
+<a href="#enum-members">Enumerations</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_recipe Recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structentry.html">entry</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:gadb231bfc44ec37423962ea7f563a458b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gadb231bfc44ec37423962ea7f563a458b"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>LIST_ELEM</b>   <a class="el" href="structentry.html">entry</a></td></tr>
+<tr class="separator:gadb231bfc44ec37423962ea7f563a458b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac0830324b91c374088872a18c876bc34"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac0830324b91c374088872a18c876bc34"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>LIST_DEFINE</b></td></tr>
+<tr class="separator:gac0830324b91c374088872a18c876bc34"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
+Typedefs</h2></td></tr>
+<tr class="memitem:ga44fc592c11aa7e15ea516df8b1a55fdb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga44fc592c11aa7e15ea516df8b1a55fdb"></a>
+typedef enum fors_fit_ncoeff </td><td class="memItemRight" valign="bottom"><b>fors_fit_ncoeff</b></td></tr>
+<tr class="separator:ga44fc592c11aa7e15ea516df8b1a55fdb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad105fc9ee5d1d81f7c37d1cb17559a18"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad105fc9ee5d1d81f7c37d1cb17559a18"></a>
+typedef struct <a class="el" href="structentry.html">entry</a> </td><td class="memItemRight" valign="bottom"><b>entry</b></td></tr>
+<tr class="separator:gad105fc9ee5d1d81f7c37d1cb17559a18"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
+Enumerations</h2></td></tr>
+<tr class="memitem:gaedc4c1af81e5b92bd1ee285199fd6544"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><b>fors_fit_ncoeff</b> { <b>FORS_FIT_NCOEFF_NO</b> = 0, 
 <b>FORS_FIT_NCOEFF_ONE</b>, 
 <b>FORS_FIT_NCOEFF_PERFRAME</b>, 
 <b>FORS_FIT_NCOEFF_PERNIGHT</b>
  }</td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structentry.html">entry</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gc4cfb3c0bdf31be44324adffdb6277a1">entry_new</a> (int frame_index, int star_index, double airmass, double gain, double exptime, int atm_ext_identifier, <a class="el" href="struct__fors__star.html">fors_star</a> *star)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">entry constructor  <a href="#gc4cfb3c0bdf31be44324adffdb6277a1"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gff8105d58698d673632960edbd21f26c">entry_delete</a> (<a class="el" href="structentry.html">entry</a> **e)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor.  <a href="#gff8105d58698d673632960edbd21f26c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g704bbcab4ba8418ff88419511eb5092b">entry_delete_but_standard</a> (<a class="el" href="structentry.html">entry</a> **e)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor.  <a href="#g704bbcab4ba8418ff88419511eb5092b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc10eb374497333bc41f877a56ff3bf94"></a><!-- doxytag: member="fors_photometry::entry_get_powers_x_y" ref="gc10eb374497333bc41f877a56ff3bf94" args="(const entry *e, const cpl_array *powers)" -->
-static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gc10eb374497333bc41f877a56ff3bf94">entry_get_powers_x_y</a> (const <a class="el" href="structentry.html">entry</a> *e, const cpl_array *powers)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g62dd2afbab9508f260ddcc65d8e00f80">entry_list_print</a> (const entry_list *l, cpl_msg_severity level)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Print list.  <a href="#g62dd2afbab9508f260ddcc65d8e00f80"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4b6948f2884a7356d77f747894bdfd8f"></a><!-- doxytag: member="fors_photometry::entry_get_powers_airmass_color" ref="g4b6948f2884a7356d77f747894bdfd8f" args="(const entry *e, const cpl_array *powers)" -->
-static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g4b6948f2884a7356d77f747894bdfd8f">entry_get_powers_airmass_color</a> (const <a class="el" href="structentry.html">entry</a> *e, const cpl_array *powers)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static entry_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gd9e3544d21c84d8a62c36b859b2a4bcf">fors_photometry_read_input</a> (const cpl_frameset *alphot_frames, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, int(*get_atm_ext_id_function)(const cpl_propertylist *header), bool import_unknown, int *n_frames, fors_std_star_list **std_sta [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Read input data from aligned phot tables.  <a href="#gd9e3544d21c84d8a62c36b859b2a4bcf"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static fors_std_star * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g99be8a6361832a8a2592304da84bc62b">fors_photometry_read_input_listinsert_star_if_new</a> (fors_std_star_list *std_list, fors_std_star *std, double mind_arcsec)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Insert a std star into a list, if the closest existing distance > maxd_arcsec.  <a href="#g99be8a6361832a8a2592304da84bc62b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g27249fb4bf764484d9f553c100e2e2b8">fors_delete_star_lists</a> (entry_list **el, fors_std_star_list **sl)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a fors_std_star_list and an entry list referring to it.  <a href="#g27249fb4bf764484d9f553c100e2e2b8"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gedafdf97c6e7c236d39fe16f9c459953">fors_fits_compare_string</a> (const char *s1, const char *s2)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare two strings while ignoring trailing blanks.  <a href="#gedafdf97c6e7c236d39fe16f9c459953"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a> (cpl_matrix **m)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a cpl_matrix and set the pointer to NULL.  <a href="#g1b0d171c916a3003f4deaf262ed733b3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g99631efe7a94de4d3f563bfff57dc19a"></a><!-- doxytag: member="fors_photometry::fors_matrix_append_delete" ref="g99631efe7a94de4d3f563bfff57dc19a" args="(cpl_matrix **m1, cpl_matrix **m2)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g99631efe7a94de4d3f563bfff57dc19a">fors_matrix_append_delete</a> (cpl_matrix **m1, cpl_matrix **m2)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd7a4fa7744d0bb4be55c0dfbd1138674"></a><!-- doxytag: member="fors_photometry::fors_property_get_num" ref="gd7a4fa7744d0bb4be55c0dfbd1138674" args="(const cpl_property *prop)" -->
-static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gd7a4fa7744d0bb4be55c0dfbd1138674">fors_property_get_num</a> (const cpl_property *prop)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g83ebb31559ea96ff0511c90ad4ea60a5"></a><!-- doxytag: member="fors_photometry::fors_photometry_parameter_get_num" ref="g83ebb31559ea96ff0511c90ad4ea60a5" args="(const cpl_parameterlist *parameters, const char *name, cpl_type type)" -->
-static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g83ebb31559ea96ff0511c90ad4ea60a5">fors_photometry_parameter_get_num</a> (const cpl_parameterlist *parameters, const char *name, cpl_type type)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gbb4b72778a8958b36dff0ffa63f9e6ea"></a><!-- doxytag: member="fors_photometry::fors_photometry_parameter_get_string" ref="gbb4b72778a8958b36dff0ffa63f9e6ea" args="(const cpl_parameterlist *parameters, const char *name)" -->
-static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gbb4b72778a8958b36dff0ffa63f9e6ea">fors_photometry_parameter_get_string</a> (const cpl_parameterlist *parameters, const char *name)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g62ed7eadbdb3468fee3078879e13f25c"></a><!-- doxytag: member="fors_photometry::fors_photometry_parameter_get_ncoeff" ref="g62ed7eadbdb3468fee3078879e13f25c" args="(const cpl_parameterlist *parameters, const char *name)" -->
-static <a class="el" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g62ed7eadbdb3468fee3078879e13f25c">fors_photometry_parameter_get_ncoeff</a> (const cpl_parameterlist *parameters, const char *name)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gecc363f8be41aa6d224d6f604d5a6b30">fors_photometry_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#gecc363f8be41aa6d224d6f604d5a6b30"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ge8d0a82d52e920497d6a5efd435760c6">fors_photometry_define_polyf</a> (int degreef1, int degreef2)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a polynomial containing the desired coefficients (set to 1).  <a href="#ge8d0a82d52e920497d6a5efd435760c6"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga8ebd4e57d8df9c4fb26a5ea59d52182">fors_photometry_define_polyp</a> (int degreep)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a 2-dim polynomial with the desired coefficients (set to 1).  <a href="#ga8ebd4e57d8df9c4fb26a5ea59d52182"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga9ee56261da033d2a3ff241a68569522">fors_photometry_poly_new_from_coefficients</a> (const cpl_polynomial *p_def, const cpl_matrix *coeffs, const cpl_matrix *cov_coeffs, cpl_polynomial **poly, cpl_polynomial **var_poly)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a polynomial from a definition and a coefficients container.  <a href="#ga9ee56261da033d2a3ff241a68569522"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g105a6893a27ad23d6ef02cc271f42c30">fors_photometry_get_timezone_observer</a> (const cpl_propertylist *header)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the timezone of the observer in hours against UT.  <a href="#g105a6893a27ad23d6ef02cc271f42c30"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g294b0010ae795af85c28da476abadb18">fors_photometry_get_night_id</a> (const cpl_propertylist *header)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a unique identifier for the night of the observation.  <a href="#g294b0010ae795af85c28da476abadb18"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g951ded14339fa018b98cbf21a332c7cf">fors_photometry_atm_ext_create_index_by_identifier</a> (entry_list *obs_list)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Collect all atm. extinction identifiers and create the indices.  <a href="#g951ded14339fa018b98cbf21a332c7cf"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g1491e01ccadf9b6d6b85316dfffd7f86">fors_photometry_atm_ext_create_indices</a> (entry_list *obsl, <a class="el" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> fit_e)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create all atmospheric extinction indices.  <a href="#g1491e01ccadf9b6d6b85316dfffd7f86"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga3a88672675c12a7d6f30f9e6cc1459a">fors_photometry_atm_ext_print_index_by_framename</a> (const entry_list *obs_list, const cpl_frameset *frames)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Print the frame filenames for each atm. ext. index.  <a href="#ga3a88672675c12a7d6f30f9e6cc1459a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gfe5618566936c6f9809d639f9148ce4d">fors_photometry_check_input_value</a> (double value, double value_error, const char *value_name, const char *input_name, double min_limit, double max_limit, double max_error)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Check input value and its error to stay in a range.  <a href="#gfe5618566936c6f9809d639f9148ce4d"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g7a7ad98c36de98c254af8f74f436a347">fors_photometry_check_fitparam_atm_ext</a> (entry_list *obsl, <a class="el" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> fit_e, bool fit_z)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Check whether fitting is possible (see below).  <a href="#g7a7ad98c36de98c254af8f74f436a347"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g07d83baf5879b02b0224e2eb59390bed"></a><!-- doxytag: member="fors_photometry::fors_photometry_adjust_fit_mag_flags" ref="g07d83baf5879b02b0224e2eb59390bed" args="(fors_std_star_list *stdl, entry_list *obsl, bool override_fit_m, int *n_mag_fits)" -->
-static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g07d83baf5879b02b0224e2eb59390bed">fors_photometry_adjust_fit_mag_flags</a> (fors_std_star_list *stdl, entry_list *obsl, bool override_fit_m, int *n_mag_fits)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gb82262e58905a5f0d047cf607614aa6d">fors_photometry_remove_unnecessary</a> (fors_std_star_list *std_list, entry_list *obs_list, int *n_mag_fits)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Remove all standard stars which are fitted but were observed only once.  <a href="#gb82262e58905a5f0d047cf607614aa6d"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_array * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gbb6ba893e672e51a2a83674b93fe4733">fors_photometry_count_observations</a> (fors_std_star_list *std_list, entry_list *obs_list)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Count the number of observations of each standard star.  <a href="#gbb6ba893e672e51a2a83674b93fe4733"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_matrix * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gb269a10fede882f376f2e599965cebe4">build_equations_lhs_matrix_from_parameters</a> (const entry_list *obs_list, const fors_std_star_list *std_list, bool fit_z, bool fit_c, int *n_fit_e_cols)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build left hand side matrix equation part.  <a href="#gb269a10fede882f376f2e599965cebe4"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_matrix * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g55817cb490a2517ef207f96a9cf51b8b">build_equations_lhs_matrix_from_poly</a> (const entry_list *obs_list, const cpl_polynomial *poly, const char *pname, double(*powerfunc)(const <a class="el" href="structentry.html">entry</a> *,const cpl_array *))</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build polynomial fitting matrix with coefficients represented in columns.  <a href="#g55817cb490a2517ef207f96a9cf51b8b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ge2d3cb795a4f549322f1febff5596787">build_equations_rhs_cov</a> (const entry_list *obs_list, const fors_std_star_list *std_list, bool fit_z, bool fit_c, bool fit_e, double color_coeff, double dcolor_coeff, double ext_coeff, double dext_coeff, double zpoint, double dzpoint, cpl_matrix **rhs, cpl_matrix **rhs_ [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build right hand side matrix equation part.  <a href="#ge2d3cb795a4f549322f1febff5596787"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g331bcb497e4f6c6520ca1fd2770aa40a"></a><!-- doxytag: member="fors_photometry::myprintf" ref="g331bcb497e4f6c6520ca1fd2770aa40a" args="(const char *format,...)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g331bcb497e4f6c6520ca1fd2770aa40a">myprintf</a> (const char *format,...)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gf9cd7f47ec72c0d957c1e83280b2f1ed"></a><!-- doxytag: member="fors_photometry::matrix_product_normal_create" ref="gf9cd7f47ec72c0d957c1e83280b2f1ed" args="(const cpl_matrix *self)" -->
-static cpl_matrix * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gf9cd7f47ec72c0d957c1e83280b2f1ed">matrix_product_normal_create</a> (const cpl_matrix *self)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5559595786d24c15da25069870a45ddc"></a><!-- doxytag: member="fors_photometry::solve_normal" ref="g5559595786d24c15da25069870a45ddc" args="(const cpl_matrix *coeff, const cpl_matrix *rhs, const cpl_matrix *cov_rhs, double *red_chisq)" -->
-static cpl_matrix * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g5559595786d24c15da25069870a45ddc">solve_normal</a> (const cpl_matrix *coeff, const cpl_matrix *rhs, const cpl_matrix *cov_rhs, double *red_chisq)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g78298a3adaf4b775f4a48a21a2b475ba">fors_photometry</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#g78298a3adaf4b775f4a48a21a2b475ba"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#g4abb403976fc3ddcaa614c59a44590c9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g8caa3f3d513a15a26c0d6e55a17370e3">fors_photometry_create</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#g8caa3f3d513a15a26c0d6e55a17370e3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g71aac253b19e8883e79cfbce6b73076a">fors_photometry_exec</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#g71aac253b19e8883e79cfbce6b73076a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gad02467f38136c506fb860db14783156">fors_photometry_destroy</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#gad02467f38136c506fb860db14783156"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc4589aeb023f342038a4c4683e5664b3"></a><!-- doxytag: member="fors_photometry::fors_photometry_name" ref="gc4589aeb023f342038a4c4683e5664b3" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gc4589aeb023f342038a4c4683e5664b3">fors_photometry_name</a> = "fors_photometry"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc66ce3f4470634c6cee1eab4c05f6985"></a><!-- doxytag: member="fors_photometry::fors_photometry_description_short" ref="gc66ce3f4470634c6cee1eab4c05f6985" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gc66ce3f4470634c6cee1eab4c05f6985">fors_photometry_description_short</a> = "Compute corrected flatfield"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g6772a94b278b89711f7ab2c9d19a6c91"></a><!-- doxytag: member="fors_photometry::fors_photometry_author" ref="g6772a94b278b89711f7ab2c9d19a6c91" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g6772a94b278b89711f7ab2c9d19a6c91">fors_photometry_author</a> = "Jonas M. Larsen"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc03e598cb3c1c63eb2a1b04939aa2f21"></a><!-- doxytag: member="fors_photometry::fors_photometry_email" ref="gc03e598cb3c1c63eb2a1b04939aa2f21" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gc03e598cb3c1c63eb2a1b04939aa2f21">fors_photometry_email</a> = PACKAGE_BUGREPORT</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#g1e4c46bbe3d698da29ad2ca40f5c70cf">fors_photometry_description</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb139bfc01f73748958dc0543e8e9a1c9"></a><!-- doxytag: member="fors_photometry::arcsec_tol" ref="gb139bfc01f73748958dc0543e8e9a1c9" args="" -->
-const double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gb139bfc01f73748958dc0543e8e9a1c9">arcsec_tol</a> = 5.0</td></tr>
-
+<tr class="separator:gaedc4c1af81e5b92bd1ee285199fd6544"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga0a8c8c9ebad2d55ac56e61c820fa3f27"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structentry.html">entry</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga0a8c8c9ebad2d55ac56e61c820fa3f27">entry_new</a> (int frame_index, int star_index, double airmass, double gain, double exptime, int atm_ext_identifier, <a class="el" href="struct__fors__star.html">fors_star</a> *star)</td></tr>
+<tr class="memdesc:ga0a8c8c9ebad2d55ac56e61c820fa3f27"><td class="mdescLeft"> </td><td class="mdescRight">entry constructor  <a href="#ga0a8c8c9ebad2d55ac56e61c820fa3f27">More...</a><br/></td></tr>
+<tr class="separator:ga0a8c8c9ebad2d55ac56e61c820fa3f27"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5a7208d2d524a7660f3e57e269b7305f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga5a7208d2d524a7660f3e57e269b7305f">entry_delete</a> (<a class="el" href="structentry.html">entry</a> **e)</td></tr>
+<tr class="memdesc:ga5a7208d2d524a7660f3e57e269b7305f"><td class="mdescLeft"> </td><td class="mdescRight">Destructor.  <a href="#ga5a7208d2d524a7660f3e57e269b7305f">More...</a><br/></td></tr>
+<tr class="separator:ga5a7208d2d524a7660f3e57e269b7305f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga24e72dc7095e56d37033c584bd279f13"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga24e72dc7095e56d37033c584bd279f13">entry_delete_but_standard</a> (<a class="el" href="structentry.html">entry</a> **e)</td></tr>
+<tr class="memdesc:ga24e72dc7095e56d37033c584bd279f13"><td class="mdescLeft"> </td><td class="mdescRight">Destructor.  <a href="#ga24e72dc7095e56d37033c584bd279f13">More...</a><br/></td></tr>
+<tr class="separator:ga24e72dc7095e56d37033c584bd279f13"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8c955a5540838142f16b310451048f6b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8c955a5540838142f16b310451048f6b"></a>
+static double </td><td class="memItemRight" valign="bottom"><b>entry_get_powers_x_y</b> (const <a class="el" href="structentry.html">entry</a> *e, const cpl_array *powers)</td></tr>
+<tr class="separator:ga8c955a5540838142f16b310451048f6b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf8c135834cc51bd767a6956346885958"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gaf8c135834cc51bd767a6956346885958">entry_list_print</a> (const entry_list *l, cpl_msg_severity level)</td></tr>
+<tr class="memdesc:gaf8c135834cc51bd767a6956346885958"><td class="mdescLeft"> </td><td class="mdescRight">Print list.  <a href="#gaf8c135834cc51bd767a6956346885958">More...</a><br/></td></tr>
+<tr class="separator:gaf8c135834cc51bd767a6956346885958"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga39efe1039b737efd95d51e5dbceb776b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga39efe1039b737efd95d51e5dbceb776b"></a>
+static double </td><td class="memItemRight" valign="bottom"><b>entry_get_powers_airmass_color</b> (const <a class="el" href="structentry.html">entry</a> *e, const cpl_array *powers)</td></tr>
+<tr class="separator:ga39efe1039b737efd95d51e5dbceb776b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabe32026b38c8d511f76b7f1008941f71"><td class="memItemLeft" align="right" valign="top">static entry_list * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gabe32026b38c8d511f76b7f1008941f71">fors_photometry_read_input</a> (const cpl_frameset *alphot_frames, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, int(*get_atm_ext_id_function)(const cpl_propertylist *header), bool import_unknown [...]
+<tr class="memdesc:gabe32026b38c8d511f76b7f1008941f71"><td class="mdescLeft"> </td><td class="mdescRight">Read input data from aligned phot tables.  <a href="#gabe32026b38c8d511f76b7f1008941f71">More...</a><br/></td></tr>
+<tr class="separator:gabe32026b38c8d511f76b7f1008941f71"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabffbeb12c88498ed45e6115a1b529c07"><td class="memItemLeft" align="right" valign="top">static fors_std_star * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gabffbeb12c88498ed45e6115a1b529c07">fors_photometry_read_input_listinsert_star_if_new</a> (fors_std_star_list *std_list, fors_std_star *std, double mind_arcsec)</td></tr>
+<tr class="memdesc:gabffbeb12c88498ed45e6115a1b529c07"><td class="mdescLeft"> </td><td class="mdescRight">Insert a std star into a list, if the closest existing distance > maxd_arcsec.  <a href="#gabffbeb12c88498ed45e6115a1b529c07">More...</a><br/></td></tr>
+<tr class="separator:gabffbeb12c88498ed45e6115a1b529c07"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2271cd483d1b8537a0513251799faaed"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga2271cd483d1b8537a0513251799faaed">fors_delete_star_lists</a> (entry_list **el, fors_std_star_list **sl)</td></tr>
+<tr class="memdesc:ga2271cd483d1b8537a0513251799faaed"><td class="mdescLeft"> </td><td class="mdescRight">Delete a fors_std_star_list and an entry list referring to it.  <a href="#ga2271cd483d1b8537a0513251799faaed">More...</a><br/></td></tr>
+<tr class="separator:ga2271cd483d1b8537a0513251799faaed"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga37834a5427d4d460953d5b818ea79ffa"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga37834a5427d4d460953d5b818ea79ffa">fors_fits_compare_string</a> (const char *s1, const char *s2)</td></tr>
+<tr class="memdesc:ga37834a5427d4d460953d5b818ea79ffa"><td class="mdescLeft"> </td><td class="mdescRight">Compare two strings while ignoring trailing blanks.  <a href="#ga37834a5427d4d460953d5b818ea79ffa">More...</a><br/></td></tr>
+<tr class="separator:ga37834a5427d4d460953d5b818ea79ffa"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga61a65cb67f17d5ddb21dd8b141659b5c"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c">fors_matrix_null</a> (cpl_matrix **m)</td></tr>
+<tr class="memdesc:ga61a65cb67f17d5ddb21dd8b141659b5c"><td class="mdescLeft"> </td><td class="mdescRight">Delete a cpl_matrix and set the pointer to NULL.  <a href="#ga61a65cb67f17d5ddb21dd8b141659b5c">More...</a><br/></td></tr>
+<tr class="separator:ga61a65cb67f17d5ddb21dd8b141659b5c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga482937cec6053ed6fa0fd8d7d3e3932e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga482937cec6053ed6fa0fd8d7d3e3932e"></a>
+static void </td><td class="memItemRight" valign="bottom"><b>fors_matrix_append_delete</b> (cpl_matrix **m1, cpl_matrix **m2)</td></tr>
+<tr class="separator:ga482937cec6053ed6fa0fd8d7d3e3932e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad81190e832f9024944d01b895e619795"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad81190e832f9024944d01b895e619795"></a>
+static double </td><td class="memItemRight" valign="bottom"><b>fors_property_get_num</b> (const cpl_property *prop)</td></tr>
+<tr class="separator:gad81190e832f9024944d01b895e619795"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5a47fe64af3dc9bb9d02fe47cc09066c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5a47fe64af3dc9bb9d02fe47cc09066c"></a>
+static double </td><td class="memItemRight" valign="bottom"><b>fors_photometry_parameter_get_num</b> (const cpl_parameterlist *parameters, const char *name, cpl_type type)</td></tr>
+<tr class="separator:ga5a47fe64af3dc9bb9d02fe47cc09066c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4f8eb79af9ba0ee00be1e4925a64eb2d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4f8eb79af9ba0ee00be1e4925a64eb2d"></a>
+static const char * </td><td class="memItemRight" valign="bottom"><b>fors_photometry_parameter_get_string</b> (const cpl_parameterlist *parameters, const char *name)</td></tr>
+<tr class="separator:ga4f8eb79af9ba0ee00be1e4925a64eb2d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7f2d61505c17bdf8c7adfd1cac8ac842"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7f2d61505c17bdf8c7adfd1cac8ac842"></a>
+static fors_fit_ncoeff </td><td class="memItemRight" valign="bottom"><b>fors_photometry_parameter_get_ncoeff</b> (const cpl_parameterlist *parameters, const char *name)</td></tr>
+<tr class="separator:ga7f2d61505c17bdf8c7adfd1cac8ac842"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4b3a00d660ccc7d889875a00fb629be5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga4b3a00d660ccc7d889875a00fb629be5">fors_photometry_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga4b3a00d660ccc7d889875a00fb629be5"><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#ga4b3a00d660ccc7d889875a00fb629be5">More...</a><br/></td></tr>
+<tr class="separator:ga4b3a00d660ccc7d889875a00fb629be5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa9757bbaea210d70edf5874682ec6660"><td class="memItemLeft" align="right" valign="top">static cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gaa9757bbaea210d70edf5874682ec6660">fors_photometry_define_polyf</a> (int degreef1, int degreef2)</td></tr>
+<tr class="memdesc:gaa9757bbaea210d70edf5874682ec6660"><td class="mdescLeft"> </td><td class="mdescRight">Create a polynomial containing the desired coefficients (set to 1).  <a href="#gaa9757bbaea210d70edf5874682ec6660">More...</a><br/></td></tr>
+<tr class="separator:gaa9757bbaea210d70edf5874682ec6660"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8d413c86621fd2b2e37b6174e935d082"><td class="memItemLeft" align="right" valign="top">static cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga8d413c86621fd2b2e37b6174e935d082">fors_photometry_define_polyp</a> (int degreep)</td></tr>
+<tr class="memdesc:ga8d413c86621fd2b2e37b6174e935d082"><td class="mdescLeft"> </td><td class="mdescRight">Create a 2-dim polynomial with the desired coefficients (set to 1).  <a href="#ga8d413c86621fd2b2e37b6174e935d082">More...</a><br/></td></tr>
+<tr class="separator:ga8d413c86621fd2b2e37b6174e935d082"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga07a5f25084d3a57c92743262a41e0366"><td class="memItemLeft" align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga07a5f25084d3a57c92743262a41e0366">fors_photometry_poly_new_from_coefficients</a> (const cpl_polynomial *p_def, const cpl_matrix *coeffs, const cpl_matrix *cov_coeffs, cpl_polynomial **poly, cpl_polynomial **var_poly)</td></tr>
+<tr class="memdesc:ga07a5f25084d3a57c92743262a41e0366"><td class="mdescLeft"> </td><td class="mdescRight">Create a polynomial from a definition and a coefficients container.  <a href="#ga07a5f25084d3a57c92743262a41e0366">More...</a><br/></td></tr>
+<tr class="separator:ga07a5f25084d3a57c92743262a41e0366"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1ac67d0a2f318cd599a5be4a05a8b4b1"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga1ac67d0a2f318cd599a5be4a05a8b4b1">fors_photometry_get_timezone_observer</a> (const cpl_propertylist *header)</td></tr>
+<tr class="memdesc:ga1ac67d0a2f318cd599a5be4a05a8b4b1"><td class="mdescLeft"> </td><td class="mdescRight">Return the timezone of the observer in hours against UT.  <a href="#ga1ac67d0a2f318cd599a5be4a05a8b4b1">More...</a><br/></td></tr>
+<tr class="separator:ga1ac67d0a2f318cd599a5be4a05a8b4b1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf800d130ebeddcf3e8a655cf0c305f47"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gaf800d130ebeddcf3e8a655cf0c305f47">fors_photometry_get_night_id</a> (const cpl_propertylist *header)</td></tr>
+<tr class="memdesc:gaf800d130ebeddcf3e8a655cf0c305f47"><td class="mdescLeft"> </td><td class="mdescRight">Get a unique identifier for the night of the observation.  <a href="#gaf800d130ebeddcf3e8a655cf0c305f47">More...</a><br/></td></tr>
+<tr class="separator:gaf800d130ebeddcf3e8a655cf0c305f47"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac8322b086764e1db46e5c9d72263a251"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gac8322b086764e1db46e5c9d72263a251">fors_photometry_atm_ext_create_index_by_identifier</a> (entry_list *obs_list)</td></tr>
+<tr class="memdesc:gac8322b086764e1db46e5c9d72263a251"><td class="mdescLeft"> </td><td class="mdescRight">Collect all atm. extinction identifiers and create the indices.  <a href="#gac8322b086764e1db46e5c9d72263a251">More...</a><br/></td></tr>
+<tr class="separator:gac8322b086764e1db46e5c9d72263a251"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gafecdbeccb909ad2d152a857cfd10c2c0"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gafecdbeccb909ad2d152a857cfd10c2c0">fors_photometry_atm_ext_create_indices</a> (entry_list *obsl, fors_fit_ncoeff fit_e)</td></tr>
+<tr class="memdesc:gafecdbeccb909ad2d152a857cfd10c2c0"><td class="mdescLeft"> </td><td class="mdescRight">Create all atmospheric extinction indices.  <a href="#gafecdbeccb909ad2d152a857cfd10c2c0">More...</a><br/></td></tr>
+<tr class="separator:gafecdbeccb909ad2d152a857cfd10c2c0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaadcf6d1ce33dbed7ae0cbd24d675562f"><td class="memItemLeft" align="right" valign="top">static cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gaadcf6d1ce33dbed7ae0cbd24d675562f">fors_photometry_atm_ext_print_index_by_framename</a> (const entry_list *obs_list, const cpl_frameset *frames)</td></tr>
+<tr class="memdesc:gaadcf6d1ce33dbed7ae0cbd24d675562f"><td class="mdescLeft"> </td><td class="mdescRight">Print the frame filenames for each atm. ext. index.  <a href="#gaadcf6d1ce33dbed7ae0cbd24d675562f">More...</a><br/></td></tr>
+<tr class="separator:gaadcf6d1ce33dbed7ae0cbd24d675562f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga104fe70d8a535ae244e71f6b16dcaf5d"><td class="memItemLeft" align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga104fe70d8a535ae244e71f6b16dcaf5d">fors_photometry_check_input_value</a> (double value, double value_error, const char *value_name, const char *input_name, double min_limit, double max_limit, double max_error)</td></tr>
+<tr class="memdesc:ga104fe70d8a535ae244e71f6b16dcaf5d"><td class="mdescLeft"> </td><td class="mdescRight">Check input value and its error to stay in a range.  <a href="#ga104fe70d8a535ae244e71f6b16dcaf5d">More...</a><br/></td></tr>
+<tr class="separator:ga104fe70d8a535ae244e71f6b16dcaf5d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga750adc75acb9310f8dde5fb067a356e9"><td class="memItemLeft" align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga750adc75acb9310f8dde5fb067a356e9">fors_photometry_check_fitparam_atm_ext</a> (entry_list *obsl, fors_fit_ncoeff fit_e, bool fit_z)</td></tr>
+<tr class="memdesc:ga750adc75acb9310f8dde5fb067a356e9"><td class="mdescLeft"> </td><td class="mdescRight">Check whether fitting is possible (see below).  <a href="#ga750adc75acb9310f8dde5fb067a356e9">More...</a><br/></td></tr>
+<tr class="separator:ga750adc75acb9310f8dde5fb067a356e9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga99162f1059bac4baf47022904832e6ca"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga99162f1059bac4baf47022904832e6ca"></a>
+static cpl_error_code </td><td class="memItemRight" valign="bottom"><b>fors_photometry_adjust_fit_mag_flags</b> (fors_std_star_list *stdl, entry_list *obsl, bool override_fit_m, int *n_mag_fits)</td></tr>
+<tr class="separator:ga99162f1059bac4baf47022904832e6ca"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6e8831942438a88bb3287ed491961ec1"><td class="memItemLeft" align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga6e8831942438a88bb3287ed491961ec1">fors_photometry_remove_unnecessary</a> (fors_std_star_list *std_list, entry_list *obs_list, int *n_mag_fits)</td></tr>
+<tr class="memdesc:ga6e8831942438a88bb3287ed491961ec1"><td class="mdescLeft"> </td><td class="mdescRight">Remove all standard stars which are fitted but were observed only once.  <a href="#ga6e8831942438a88bb3287ed491961ec1">More...</a><br/></td></tr>
+<tr class="separator:ga6e8831942438a88bb3287ed491961ec1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga182915aa06bfd142318b3c9443a80e80"><td class="memItemLeft" align="right" valign="top">static cpl_array * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga182915aa06bfd142318b3c9443a80e80">fors_photometry_count_observations</a> (fors_std_star_list *std_list, entry_list *obs_list)</td></tr>
+<tr class="memdesc:ga182915aa06bfd142318b3c9443a80e80"><td class="mdescLeft"> </td><td class="mdescRight">Count the number of observations of each standard star.  <a href="#ga182915aa06bfd142318b3c9443a80e80">More...</a><br/></td></tr>
+<tr class="separator:ga182915aa06bfd142318b3c9443a80e80"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabfcabff5102d27ba7b09e4398e057762"><td class="memItemLeft" align="right" valign="top">static cpl_matrix * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gabfcabff5102d27ba7b09e4398e057762">build_equations_lhs_matrix_from_parameters</a> (const entry_list *obs_list, const fors_std_star_list *std_list, bool fit_z, bool fit_c, int *n_fit_e_cols)</td></tr>
+<tr class="memdesc:gabfcabff5102d27ba7b09e4398e057762"><td class="mdescLeft"> </td><td class="mdescRight">Build left hand side matrix equation part.  <a href="#gabfcabff5102d27ba7b09e4398e057762">More...</a><br/></td></tr>
+<tr class="separator:gabfcabff5102d27ba7b09e4398e057762"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga43e3c1d13157092f683e6d4912cd71d2"><td class="memItemLeft" align="right" valign="top">static cpl_matrix * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga43e3c1d13157092f683e6d4912cd71d2">build_equations_lhs_matrix_from_poly</a> (const entry_list *obs_list, const cpl_polynomial *poly, const char *pname, double(*powerfunc)(const <a class="el" href="structentry.html">entry</a> *,const cpl_array *))</td></tr>
+<tr class="memdesc:ga43e3c1d13157092f683e6d4912cd71d2"><td class="mdescLeft"> </td><td class="mdescRight">Build polynomial fitting matrix with coefficients represented in columns.  <a href="#ga43e3c1d13157092f683e6d4912cd71d2">More...</a><br/></td></tr>
+<tr class="separator:ga43e3c1d13157092f683e6d4912cd71d2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5e4afe6326f0bb9c748fed2286c8c835"><td class="memItemLeft" align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga5e4afe6326f0bb9c748fed2286c8c835">build_equations_rhs_cov</a> (const entry_list *obs_list, const fors_std_star_list *std_list, bool fit_z, bool fit_c, bool fit_e, double color_coeff, double dcolor_coeff, double ext_coeff, double dext_coeff, double zpoint, double [...]
+<tr class="memdesc:ga5e4afe6326f0bb9c748fed2286c8c835"><td class="mdescLeft"> </td><td class="mdescRight">Build right hand side matrix equation part.  <a href="#ga5e4afe6326f0bb9c748fed2286c8c835">More...</a><br/></td></tr>
+<tr class="separator:ga5e4afe6326f0bb9c748fed2286c8c835"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaea9cb9001e8b6630c660038e0bc5eb39"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaea9cb9001e8b6630c660038e0bc5eb39"></a>
+static cpl_matrix * </td><td class="memItemRight" valign="bottom"><b>solve_normal</b> (const cpl_matrix *coeff, const cpl_matrix *rhs, const cpl_matrix *cov_rhs, double *red_chisq)</td></tr>
+<tr class="separator:gaea9cb9001e8b6630c660038e0bc5eb39"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae18d6d686eec800da9538ee3c533aed7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gae18d6d686eec800da9538ee3c533aed7">fors_photometry</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:gae18d6d686eec800da9538ee3c533aed7"><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#gae18d6d686eec800da9538ee3c533aed7">More...</a><br/></td></tr>
+<tr class="separator:gae18d6d686eec800da9538ee3c533aed7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
+<tr class="memdesc:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#ga31d1fccd4cd15b1c1f3c5edc8cb18693">More...</a><br/></td></tr>
+<tr class="separator:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaefb8747dfc072489e0c49686e235db79"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gaefb8747dfc072489e0c49686e235db79">fors_photometry_create</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:gaefb8747dfc072489e0c49686e235db79"><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#gaefb8747dfc072489e0c49686e235db79">More...</a><br/></td></tr>
+<tr class="separator:gaefb8747dfc072489e0c49686e235db79"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa3f56f38e97f7b8afe2cc18c5e9f3a6d"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gaa3f56f38e97f7b8afe2cc18c5e9f3a6d">fors_photometry_exec</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:gaa3f56f38e97f7b8afe2cc18c5e9f3a6d"><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#gaa3f56f38e97f7b8afe2cc18c5e9f3a6d">More...</a><br/></td></tr>
+<tr class="separator:gaa3f56f38e97f7b8afe2cc18c5e9f3a6d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae31960fe5e90f545420ff2f50c33f0a4"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__photometry.html#gae31960fe5e90f545420ff2f50c33f0a4">fors_photometry_destroy</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:gae31960fe5e90f545420ff2f50c33f0a4"><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#gae31960fe5e90f545420ff2f50c33f0a4">More...</a><br/></td></tr>
+<tr class="separator:gae31960fe5e90f545420ff2f50c33f0a4"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga7c0052dbc5fb57a5f2a7aa1aaee81711"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7c0052dbc5fb57a5f2a7aa1aaee81711"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_photometry_name</b> = "fors_photometry"</td></tr>
+<tr class="separator:ga7c0052dbc5fb57a5f2a7aa1aaee81711"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab75492628e8de3301142ea901de2c082"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab75492628e8de3301142ea901de2c082"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_photometry_description_short</b> = "Compute corrected flatfield"</td></tr>
+<tr class="separator:gab75492628e8de3301142ea901de2c082"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac6f46cad39ef72e218e343764932216f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac6f46cad39ef72e218e343764932216f"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_photometry_author</b> = "Jonas M. Larsen"</td></tr>
+<tr class="separator:gac6f46cad39ef72e218e343764932216f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6ea31223abebdf7226188f47a51c073c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6ea31223abebdf7226188f47a51c073c"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_photometry_email</b> = PACKAGE_BUGREPORT</td></tr>
+<tr class="separator:ga6ea31223abebdf7226188f47a51c073c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaac101f33b12a7432e9b4d5ae6143326f"><td class="memItemLeft" align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><b>fors_photometry_description</b></td></tr>
+<tr class="separator:gaac101f33b12a7432e9b4d5ae6143326f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8914070dcfeab65bad628175b5522d62"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a> </td><td class="memItemRight" valign="bottom"><b>fors_fit_ncoeff_paropts</b></td></tr>
+<tr class="separator:ga8914070dcfeab65bad628175b5522d62"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac6b3dfce12019667f63bc05e12093dac"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac6b3dfce12019667f63bc05e12093dac"></a>
+const double </td><td class="memItemRight" valign="bottom"><b>arcsec_tol</b> = 5.0</td></tr>
+<tr class="separator:gac6b3dfce12019667f63bc05e12093dac"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-See recipe description for details. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>See recipe description for details. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_polynomial_delete(polyf); polyf = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_polynomial_delete(polyf); polyf = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_polynomial_delete(polyp); polyp = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_polynomial_delete(polyp); polyp = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    if (poly != NULL) { cpl_polynomial_delete(*poly); *poly = NULL; } \</div>
+<div class="line">    if (var_poly != NULL) {cpl_polynomial_delete(*var_poly); *var_poly = NULL;}\</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <span class="keywordflow">if</span> (poly != NULL) { cpl_polynomial_delete(*poly); *poly = NULL; } \
-    <span class="keywordflow">if</span> (var_poly != NULL) {cpl_polynomial_delete(*var_poly); *var_poly = NULL;}\
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_free(ident_array); ident_array = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_free(ident_array); ident_array = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    if (frame_printed != NULL) \</div>
+<div class="line">    { \</div>
+<div class="line">        cpl_free(frame_printed); \</div>
+<div class="line">        frame_printed = NULL; \</div>
+<div class="line">    } \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+</div>
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <span class="keywordflow">if</span> (frame_printed != NULL) \
-    { \
-        cpl_free(frame_printed); \
-        frame_printed = NULL; \
-    } \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_array_delete(airmasses); airmasses = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_array_delete(airmasses); airmasses = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&solution); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&cov1); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&At); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&AtC); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&AtCA); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&p); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&Ap); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&bAp); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&bApt); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&C1bAp); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&chi2); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_matrix_null(&solution); \</div>
+<div class="line">    fors_matrix_null(&cov1); \</div>
+<div class="line">    fors_matrix_null(&At); \</div>
+<div class="line">    fors_matrix_null(&AtC); \</div>
+<div class="line">    fors_matrix_null(&AtCA); \</div>
+<div class="line">    fors_matrix_null(&p); \</div>
+<div class="line">    fors_matrix_null(&Ap); \</div>
+<div class="line">    fors_matrix_null(&bAp); \</div>
+<div class="line">    fors_matrix_null(&bApt); \</div>
+<div class="line">    fors_matrix_null(&C1bAp); \</div>
+<div class="line">    fors_matrix_null(&chi2); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete((cpl_frameset *)aligned_phot_frames);        \
-    cpl_frameset_delete((cpl_frameset *)master_flat_frame); \
-    cpl_frameset_delete((cpl_frameset *)phot_table); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_flat); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&correction); \
-    cpl_table_delete(phot_coeff); \
-    cpl_table_delete(summary); \
-    <a class="code" href="group__fors__photometry.html#g27249fb4bf764484d9f553c100e2e2b8">fors_delete_star_lists</a>(&obs, &std_star_list); \
-    cpl_array_delete(n_std_star_obs); n_std_star_obs = NULL; \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&eqn_lhs); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&eqn_rhs); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&eqn_cov_rhs); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&eqn_result); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&tmp_mat); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&result_polyf); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&result_cov_polyf); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&result_params); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&result_cov_params); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&result_polyp); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&result_cov_polyp); \
-    cpl_polynomial_delete(polyf); polyf = NULL; \
-    cpl_polynomial_delete(polyf_definition); polyf_definition = NULL; \
-    cpl_polynomial_delete(polyf_variance); polyf_variance = NULL; \
-    cpl_polynomial_delete(polyp); polyp = NULL; \
-    cpl_polynomial_delete(polyp_definition); polyp_definition = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete((cpl_frameset *)aligned_phot_frames);        \</div>
+<div class="line">    cpl_frameset_delete((cpl_frameset *)master_flat_frame); \</div>
+<div class="line">    cpl_frameset_delete((cpl_frameset *)phot_table); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    fors_image_delete(&master_flat); \</div>
+<div class="line">    fors_image_delete(&correction); \</div>
+<div class="line">    cpl_table_delete(phot_coeff); \</div>
+<div class="line">    cpl_table_delete(summary); \</div>
+<div class="line">    fors_delete_star_lists(&obs, &std_star_list); \</div>
+<div class="line">    cpl_array_delete(n_std_star_obs); n_std_star_obs = NULL; \</div>
+<div class="line">    fors_matrix_null(&eqn_lhs); \</div>
+<div class="line">    fors_matrix_null(&eqn_rhs); \</div>
+<div class="line">    fors_matrix_null(&eqn_cov_rhs); \</div>
+<div class="line">    fors_matrix_null(&eqn_result); \</div>
+<div class="line">    fors_matrix_null(&tmp_mat); \</div>
+<div class="line">    fors_matrix_null(&result_polyf); \</div>
+<div class="line">    fors_matrix_null(&result_cov_polyf); \</div>
+<div class="line">    fors_matrix_null(&result_params); \</div>
+<div class="line">    fors_matrix_null(&result_cov_params); \</div>
+<div class="line">    fors_matrix_null(&result_polyp); \</div>
+<div class="line">    fors_matrix_null(&result_cov_polyp); \</div>
+<div class="line">    cpl_polynomial_delete(polyf); polyf = NULL; \</div>
+<div class="line">    cpl_polynomial_delete(polyf_definition); polyf_definition = NULL; \</div>
+<div class="line">    cpl_polynomial_delete(polyf_variance); polyf_variance = NULL; \</div>
+<div class="line">    cpl_polynomial_delete(polyp); polyp = NULL; \</div>
+<div class="line">    cpl_polynomial_delete(polyp_definition); polyp_definition = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    fors_std_star_delete(&std_star); \
-    cpl_propertylist_delete(header); header = NULL; \
-    cpl_table_delete(aligned_phot); aligned_phot = NULL; \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting_f); \
-    <a class="code" href="group__fors__photometry.html#g27249fb4bf764484d9f553c100e2e2b8">fors_delete_star_lists</a>(&obs, std_star_list); \
-    <a class="code" href="group__fors__star.html#g40fa6037fee74abd5a9d5166137609e0">fors_star_delete_but_standard</a>(&obs_star); \
-    fors_std_star_delete(&std_star); \
-    \
-    *n_frames = 0; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_std_star_delete(&std_star); \</div>
+<div class="line">    cpl_propertylist_delete(header); header = NULL; \</div>
+<div class="line">    cpl_table_delete(aligned_phot); aligned_phot = NULL; \</div>
+<div class="line">    fors_setting_delete(&setting_f); \</div>
+<div class="line">    fors_delete_star_lists(&obs, std_star_list); \</div>
+<div class="line">    fors_star_delete_but_standard(&obs_star); \</div>
+<div class="line">    fors_std_star_delete(&std_star); \</div>
+<div class="line">    \</div>
+<div class="line">    *n_frames = 0; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_array_delete(n_obs_per_std); n_obs_per_std = NULL; \</div>
+<div class="line">    fors_std_star_list_delete(&std_list_copy, NULL); \</div>
+<div class="line">    entry_list_delete(&obs_list_copy, NULL); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_array_delete(n_obs_per_std); n_obs_per_std = NULL; \
-    fors_std_star_list_delete(&std_list_copy, NULL); \
-    entry_list_delete(&obs_list_copy, NULL); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_array_unwrap(n_obs_a); n_obs_a = NULL; \</div>
+<div class="line">    cpl_free(n_obs); n_obs = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_array_unwrap(n_obs_a); n_obs_a = NULL; \
-    cpl_free(n_obs); n_obs = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_matrix_null(&lhs); \</div>
+<div class="line">    if (n_fit_e_cols != NULL) \</div>
+<div class="line">        *n_fit_e_cols = 0; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&lhs); \
-    <span class="keywordflow">if</span> (n_fit_e_cols != NULL) \
-        *n_fit_e_cols = 0; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_matrix_null(&mat); \</div>
+<div class="line">    cpl_array_delete(Apowers); Apowers = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&mat); \
-    cpl_array_delete(Apowers); Apowers = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&rhs_input_cov); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&rhs_jacobian); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&rhs_input); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&rhs_jacobian_T); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(&tmp_matrix); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(rhs); \
-    <a class="code" href="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3">fors_matrix_null</a>(rhs_cov); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03708">3708</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-</div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="gc4cfb3c0bdf31be44324adffdb6277a1"></a><!-- doxytag: member="fors_photometry_impl.c::entry_new" ref="gc4cfb3c0bdf31be44324adffdb6277a1" args="(int frame_index, int star_index, double airmass, double gain, double exptime, int atm_ext_identifier, fors_star *star)" -->
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_matrix_null(&rhs_input_cov); \</div>
+<div class="line">    fors_matrix_null(&rhs_jacobian); \</div>
+<div class="line">    fors_matrix_null(&rhs_input); \</div>
+<div class="line">    fors_matrix_null(&rhs_jacobian_T); \</div>
+<div class="line">    fors_matrix_null(&tmp_matrix); \</div>
+<div class="line">    fors_matrix_null(rhs); \</div>
+<div class="line">    fors_matrix_null(rhs_cov); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03650">3650</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+</div>
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga0a8c8c9ebad2d55ac56e61c820fa3f27"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="structentry.html">entry</a> * entry_new           </td>
+          <td class="memname"><a class="el" href="structentry.html">entry</a> * entry_new </td>
           <td>(</td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>frame_index</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>frame_index</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>star_index</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>star_index</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>airmass</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>airmass</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>gain</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>gain</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>exptime</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>exptime</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>atm_ext_identifier</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>atm_ext_identifier</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype"><a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>star</em></td><td> </td>
+          <td class="paramtype"><a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>star</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-entry constructor 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>star</em> </td><td>ownership is transferred, so deallocate only using entry_delete </td></tr>
+<p>entry constructor </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">star</td><td>ownership is transferred, so deallocate only using entry_delete </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00289">289</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l02756">fors_photometry_read_input()</a>.
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00289">289</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l02698">fors_photometry_read_input()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gff8105d58698d673632960edbd21f26c"></a><!-- doxytag: member="fors_photometry_impl.c::entry_delete" ref="gff8105d58698d673632960edbd21f26c" args="(entry **e)" -->
+</div>
+<a class="anchor" id="ga5a7208d2d524a7660f3e57e269b7305f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void entry_delete           </td>
+          <td class="memname">void entry_delete </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="structentry.html">entry</a> ** </td>
-          <td class="paramname"> <em>e</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype"><a class="el" href="structentry.html">entry</a> ** </td>
+          <td class="paramname"><em>e</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Destructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>e</em> </td><td>to delete </td></tr>
+<p>Destructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">e</td><td>to delete </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00320">320</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__star_8c-source.html#l00273">fors_star_delete()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l00414">fors_delete_star_lists()</a>.
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00320">320</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__star_8c_source.html#l00273">fors_star_delete()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l00414">fors_delete_star_lists()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g704bbcab4ba8418ff88419511eb5092b"></a><!-- doxytag: member="fors_photometry_impl.c::entry_delete_but_standard" ref="g704bbcab4ba8418ff88419511eb5092b" args="(entry **e)" -->
+<a class="anchor" id="ga24e72dc7095e56d37033c584bd279f13"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void entry_delete_but_standard           </td>
+          <td class="memname">static void entry_delete_but_standard </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="structentry.html">entry</a> ** </td>
-          <td class="paramname"> <em>e</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype"><a class="el" href="structentry.html">entry</a> ** </td>
+          <td class="paramname"><em>e</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Destructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>e</em> </td><td>to delete </td></tr>
+<p>Destructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">e</td><td>to delete </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00336">336</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__star_8c-source.html#l00291">fors_star_delete_but_standard()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l03249">fors_photometry_remove_unnecessary()</a>.
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00336">336</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__star_8c_source.html#l00291">fors_star_delete_but_standard()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l03191">fors_photometry_remove_unnecessary()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g62dd2afbab9508f260ddcc65d8e00f80"></a><!-- doxytag: member="fors_photometry_impl.c::entry_list_print" ref="g62dd2afbab9508f260ddcc65d8e00f80" args="(const entry_list *l, cpl_msg_severity level)" -->
+<a class="anchor" id="gaf8c135834cc51bd767a6956346885958"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void entry_list_print           </td>
+          <td class="memname">void entry_list_print </td>
           <td>(</td>
-          <td class="paramtype">const entry_list * </td>
-          <td class="paramname"> <em>l</em>, </td>
+          <td class="paramtype">const entry_list * </td>
+          <td class="paramname"><em>l</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_msg_severity </td>
-          <td class="paramname"> <em>level</em></td><td> </td>
+          <td class="paramtype">cpl_msg_severity </td>
+          <td class="paramname"><em>level</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Print list. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>l</em> </td><td>to print </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>message level </td></tr>
+<p>Print list. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">l</td><td>to print </td></tr>
+    <tr><td class="paramname">level</td><td>message level </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00354">354</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00097">entry::airmass</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00097">entry::exptime</a>, <a class="el" href="fors__star_8c-source.html#l00418">fors_star_print()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00093">entry::frame_index</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00097">entry::gain</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l [...]
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00354">354</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__star_8c_source.html#l00418">fors_star_print()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gd9e3544d21c84d8a62c36b859b2a4bcf"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_read_input" ref="gd9e3544d21c84d8a62c36b859b2a4bcf" args="(const cpl_frameset *alphot_frames, const fors_setting *setting, int(*get_atm_ext_id_function)(const cpl_propertylist *header), bool import_unknown, int *n_frames, fors_std_star_list **std_star_list, int filter)" -->
+<a class="anchor" id="gabe32026b38c8d511f76b7f1008941f71"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static entry_list * fors_photometry_read_input           </td>
+          <td class="memname">static entry_list * fors_photometry_read_input </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frameset * </td>
-          <td class="paramname"> <em>alphot_frames</em>, </td>
+          <td class="paramtype">const cpl_frameset * </td>
+          <td class="paramname"><em>alphot_frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int(*)(const cpl_propertylist *header) </td>
-          <td class="paramname"> <em>get_atm_ext_id_function</em>, </td>
+          <td class="paramtype">int(*)(const cpl_propertylist *header) </td>
+          <td class="paramname"><em>get_atm_ext_id_function</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">bool </td>
-          <td class="paramname"> <em>import_unknown</em>, </td>
+          <td class="paramtype">bool </td>
+          <td class="paramname"><em>import_unknown</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>n_frames</em>, </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>n_frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">fors_std_star_list ** </td>
-          <td class="paramname"> <em>std_star_list</em>, </td>
+          <td class="paramtype">fors_std_star_list ** </td>
+          <td class="paramname"><em>std_star_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>filter</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>filter</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Read input data from aligned phot tables. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>alphot_frames</em> </td><td>Input frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>Instrument setting </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>get_atm_ext_id_function</em> </td><td>Function to create an identifier for the atmospheric extinction by frame header </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>import_unknown</em> </td><td>Flag whether to import also untrusted and non-standard stars </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>n_frames</em> </td><td>(Output) number of frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>std_star_list</em> </td><td>(Output) list of standard stars </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Read input data from aligned phot tables. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">alphot_frames</td><td>Input frames </td></tr>
+    <tr><td class="paramname">setting</td><td>Instrument setting </td></tr>
+    <tr><td class="paramname">get_atm_ext_id_function</td><td>Function to create an identifier for the atmospheric extinction by frame header </td></tr>
+    <tr><td class="paramname">import_unknown</td><td>Flag whether to import also untrusted and non-standard stars </td></tr>
+    <tr><td class="paramname">n_frames</td><td>(Output) number of frames </td></tr>
+    <tr><td class="paramname">std_star_list</td><td>(Output) list of standard stars </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>set of observations</dd></dl>
-We match by (RA, DEC) and tolerance, not by OBJECT string which is not unique across different catalogs. 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l02756">2756</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00111">arcsec_tol</a>, <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__setting_8h-source.html#l00067">_fors_setting::average_gain</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__star_8h-source.html#l00045">_fors_star::dmagnitude</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00289">entry_new()</a>, <a class="e [...]
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g99be8a6361832a8a2592304da84bc62b"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_read_input_listinsert_star_if_new" ref="g99be8a6361832a8a2592304da84bc62b" args="(fors_std_star_list *std_list, fors_std_star *std, double mind_arcsec)" -->
+<dl class="section return"><dt>Returns</dt><dd>set of observations</dd></dl>
+<p>We match by (RA, DEC) and tolerance, not by OBJECT string which is not unique across different catalogs. </p>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l02698">2698</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l00289">entry_new()</a>, <a class="el" href="fors_2fors__extract_8c_source.html#l00122">fors_extract_check_sex_star()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l03044">fors_photometry_read_input_listinsert_star_if_new()</a>, <a class="el" href="fors__setting_8c_source.html#l00498">fors_setting_delete()</a>, <a class="el" href="fors__sett [...]
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gabffbeb12c88498ed45e6115a1b529c07"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static fors_std_star * fors_photometry_read_input_listinsert_star_if_new           </td>
+          <td class="memname">static fors_std_star * fors_photometry_read_input_listinsert_star_if_new </td>
           <td>(</td>
-          <td class="paramtype">fors_std_star_list * </td>
-          <td class="paramname"> <em>std_list</em>, </td>
+          <td class="paramtype">fors_std_star_list * </td>
+          <td class="paramname"><em>std_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">fors_std_star * </td>
-          <td class="paramname"> <em>std</em>, </td>
+          <td class="paramtype">fors_std_star * </td>
+          <td class="paramname"><em>std</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>mind_arcsec</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>mind_arcsec</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Insert a std star into a list, if the closest existing distance > maxd_arcsec. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>std_list</em> </td><td>Standard star list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>std</em> </td><td>Standard star to test </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>mind_arcsec</em> </td><td>Minimum distance in arc seconds </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Insert a std star into a list, if the closest existing distance > maxd_arcsec. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">std_list</td><td>Standard star list </td></tr>
+    <tr><td class="paramname">std</td><td>Standard star to test </td></tr>
+    <tr><td class="paramname">mind_arcsec</td><td>Minimum distance in arc seconds </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Pointer either to input star or to list star</dd></dl>
-In the case that the <em>std</em> star is already found in the standard star list, the input <em>std</em> star object is deleted.<p>
-In the case of error, the input star is not deleted and its pointer is returned. 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03102">3102</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l02756">fors_photometry_read_input()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g27249fb4bf764484d9f553c100e2e2b8"></a><!-- doxytag: member="fors_photometry_impl.c::fors_delete_star_lists" ref="g27249fb4bf764484d9f553c100e2e2b8" args="(entry_list **el, fors_std_star_list **sl)" -->
+<dl class="section return"><dt>Returns</dt><dd>Pointer either to input star or to list star</dd></dl>
+<p>In the case that the <em>std</em> star is already found in the standard star list, the input <em>std</em> star object is deleted.</p>
+<p>In the case of error, the input star is not deleted and its pointer is returned. </p>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03044">3044</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l02698">fors_photometry_read_input()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga2271cd483d1b8537a0513251799faaed"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void fors_delete_star_lists           </td>
+          <td class="memname">static void fors_delete_star_lists </td>
           <td>(</td>
-          <td class="paramtype">entry_list ** </td>
-          <td class="paramname"> <em>el</em>, </td>
+          <td class="paramtype">entry_list ** </td>
+          <td class="paramname"><em>el</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">fors_std_star_list ** </td>
-          <td class="paramname"> <em>sl</em></td><td> </td>
+          <td class="paramtype">fors_std_star_list ** </td>
+          <td class="paramname"><em>sl</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Delete a fors_std_star_list and an entry list referring to it. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>el</em> </td><td>Entry list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sl</em> </td><td>Standard star list </td></tr>
+<p>Delete a fors_std_star_list and an entry list referring to it. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">el</td><td>Entry list </td></tr>
+    <tr><td class="paramname">sl</td><td>Standard star list </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Nothing </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>Nothing </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00414">414</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00414">414</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00320">entry_delete()</a>, <a class="el" href="fors__star_8h-source.html#l00054">_fors_star::id</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l00100">entry::star</a>.
+<p>References <a class="el" href="fors__photometry__impl_8c_source.html#l00320">entry_delete()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gedafdf97c6e7c236d39fe16f9c459953"></a><!-- doxytag: member="fors_photometry_impl.c::fors_fits_compare_string" ref="gedafdf97c6e7c236d39fe16f9c459953" args="(const char *s1, const char *s2)" -->
+<a class="anchor" id="ga37834a5427d4d460953d5b818ea79ffa"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static bool fors_fits_compare_string           </td>
+          <td class="memname">static bool fors_fits_compare_string </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>s1</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>s1</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>s2</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>s2</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Compare two strings while ignoring trailing blanks. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s1</em> </td><td>String 1 </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>s2</em> </td><td>String 2 </td></tr>
+<p>Compare two strings while ignoring trailing blanks. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s1</td><td>String 1 </td></tr>
+    <tr><td class="paramname">s2</td><td>String 2 </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true if identic, otherwise false</dd></dl>
-A NULL input is treated as "". 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00443">443</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01039">fors_photometry_get_timezone_observer()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g1b0d171c916a3003f4deaf262ed733b3"></a><!-- doxytag: member="fors_photometry_impl.c::fors_matrix_null" ref="g1b0d171c916a3003f4deaf262ed733b3" args="(cpl_matrix **m)" -->
+<dl class="section return"><dt>Returns</dt><dd>true if identic, otherwise false</dd></dl>
+<p>A NULL input is treated as "". </p>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00443">443</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01039">fors_photometry_get_timezone_observer()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga61a65cb67f17d5ddb21dd8b141659b5c"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void fors_matrix_null           </td>
+          <td class="memname">static void fors_matrix_null </td>
           <td>(</td>
-          <td class="paramtype">cpl_matrix ** </td>
-          <td class="paramname"> <em>m</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_matrix ** </td>
+          <td class="paramname"><em>m</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Delete a cpl_matrix and set the pointer to NULL. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>m</em> </td><td>Matrix to delete </td></tr>
+<p>Delete a cpl_matrix and set the pointer to NULL. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">m</td><td>Matrix to delete </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Nothing </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>Nothing </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00480">480</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l03677">build_equations_rhs_cov()</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00480">480</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l03735">build_equations_rhs_cov()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00492">fors_matrix_append_delete()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l01731">solve_normal()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gecc363f8be41aa6d224d6f604d5a6b30"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_define_parameters" ref="gecc363f8be41aa6d224d6f604d5a6b30" args="(cpl_parameterlist *parameters)" -->
+</div>
+<a class="anchor" id="ga4b3a00d660ccc7d889875a00fb629be5"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_photometry_define_parameters           </td>
+          <td class="memname">void fors_photometry_define_parameters </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Define recipe parameters. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameter list to fill </td></tr>
+<p>Define recipe parameters. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>parameter list to fill </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00669">669</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00056">fors_photometry_name</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry_8c-source.html#l00109">fors_photometry_create()</a>, and <a class="el" href="fors__photometry-test_8c-source.html#l00055">test_photometry()</a>.
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00669">669</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry_8c_source.html#l00109">fors_photometry_create()</a>, and <a class="el" href="fors__photometry-test_8c_source.html#l00055">test_photometry()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="ge8d0a82d52e920497d6a5efd435760c6"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_define_polyf" ref="ge8d0a82d52e920497d6a5efd435760c6" args="(int degreef1, int degreef2)" -->
+</div>
+<a class="anchor" id="gaa9757bbaea210d70edf5874682ec6660"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_polynomial * fors_photometry_define_polyf           </td>
+          <td class="memname">static cpl_polynomial * fors_photometry_define_polyf </td>
           <td>(</td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>degreef1</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>degreef1</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>degreef2</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>degreef2</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Create a polynomial containing the desired coefficients (set to 1). 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>degreef1</em> </td><td>Degree in x (>= 0) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>degreef2</em> </td><td>Degree in y, or negative for triangular coefficient matrix. </td></tr>
+<p>Create a polynomial containing the desired coefficients (set to 1). </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">degreef1</td><td>Degree in x (>= 0) </td></tr>
+    <tr><td class="paramname">degreef2</td><td>Degree in y, or negative for triangular coefficient matrix. </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The polynomial, NULL in the case of error</dd></dl>
-<dl compact><dt><b>Note:</b></dt><dd>This function should contain the only definition of the shape of the <em>f</em> polynomial (according to the manual). </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00805">805</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__polynomial_8c-source.html#l00150">fors_polynomial_count_coeff()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00465">fors_polynomial_dump()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
-</div>
-</div><p>
-<a class="anchor" name="ga8ebd4e57d8df9c4fb26a5ea59d52182"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_define_polyp" ref="ga8ebd4e57d8df9c4fb26a5ea59d52182" args="(int degreep)" -->
+<dl class="section return"><dt>Returns</dt><dd>The polynomial, NULL in the case of error</dd></dl>
+<dl class="section note"><dt>Note</dt><dd>This function should contain the only definition of the shape of the <em>f</em> polynomial (according to the manual). </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00805">805</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__polynomial_8c_source.html#l00150">fors_polynomial_count_coeff()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00465">fors_polynomial_dump()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga8d413c86621fd2b2e37b6174e935d082"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_polynomial * fors_photometry_define_polyp           </td>
+          <td class="memname">static cpl_polynomial * fors_photometry_define_polyp </td>
           <td>(</td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>degreep</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>degreep</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Create a 2-dim polynomial with the desired coefficients (set to 1). 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>degreep</em> </td><td>Total Degree </td></tr>
+<p>Create a 2-dim polynomial with the desired coefficients (set to 1). </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">degreep</td><td>Total Degree </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The polynomial, NULL in the case of error</dd></dl>
-The first dimension refers to the airmass, the second to the color.<p>
-<dl compact><dt><b>Note:</b></dt><dd>This function should contain the only definition of the shape of the <em>p</em> polynomial (according to the manual). </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00885">885</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__polynomial_8c-source.html#l00150">fors_polynomial_count_coeff()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00465">fors_polynomial_dump()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
-</div>
-</div><p>
-<a class="anchor" name="ga9ee56261da033d2a3ff241a68569522"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_poly_new_from_coefficients" ref="ga9ee56261da033d2a3ff241a68569522" args="(const cpl_polynomial *p_def, const cpl_matrix *coeffs, const cpl_matrix *cov_coeffs, cpl_polynomial **poly, cpl_polynomial **var_poly)" -->
+<dl class="section return"><dt>Returns</dt><dd>The polynomial, NULL in the case of error</dd></dl>
+<p>The first dimension refers to the airmass, the second to the color.</p>
+<dl class="section note"><dt>Note</dt><dd>This function should contain the only definition of the shape of the <em>p</em> polynomial (according to the manual). </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00885">885</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__polynomial_8c_source.html#l00150">fors_polynomial_count_coeff()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00465">fors_polynomial_dump()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga07a5f25084d3a57c92743262a41e0366"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_error_code fors_photometry_poly_new_from_coefficients           </td>
+          <td class="memname">static cpl_error_code fors_photometry_poly_new_from_coefficients </td>
           <td>(</td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>p_def</em>, </td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>p_def</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_matrix * </td>
-          <td class="paramname"> <em>coeffs</em>, </td>
+          <td class="paramtype">const cpl_matrix * </td>
+          <td class="paramname"><em>coeffs</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_matrix * </td>
-          <td class="paramname"> <em>cov_coeffs</em>, </td>
+          <td class="paramtype">const cpl_matrix * </td>
+          <td class="paramname"><em>cov_coeffs</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_polynomial ** </td>
-          <td class="paramname"> <em>poly</em>, </td>
+          <td class="paramtype">cpl_polynomial ** </td>
+          <td class="paramname"><em>poly</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_polynomial ** </td>
-          <td class="paramname"> <em>var_poly</em></td><td> </td>
+          <td class="paramtype">cpl_polynomial ** </td>
+          <td class="paramname"><em>var_poly</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create a polynomial from a definition and a coefficients container. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p_def</em> </td><td>Polynomial definition (using non-zero coeffs) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>coeffs</em> </td><td>Column vector (N x 1) containing the coefficients in the order defined by the functions fors_polynomial_*(), ignored if <em>p_def</em> contains no non-zero coefficients </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>cov_coeffs</em> </td><td>(Optional) covariance matrix (N x N) of the coefficients in the order defined by the functions fors_polynomial_*(), ignored if <em>p_def</em> contains no non-zero coefficients or if <em>var_poly</em> == NULL </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>poly</em> </td><td>Output polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>var_poly</em> </td><td>(Optional) output variance polynomial </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Create a polynomial from a definition and a coefficients container. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p_def</td><td>Polynomial definition (using non-zero coeffs) </td></tr>
+    <tr><td class="paramname">coeffs</td><td>Column vector (N x 1) containing the coefficients in the order defined by the functions fors_polynomial_*(), ignored if <em>p_def</em> contains no non-zero coefficients </td></tr>
+    <tr><td class="paramname">cov_coeffs</td><td>(Optional) covariance matrix (N x N) of the coefficients in the order defined by the functions fors_polynomial_*(), ignored if <em>p_def</em> contains no non-zero coefficients or if <em>var_poly</em> == NULL </td></tr>
+    <tr><td class="paramname">poly</td><td>Output polynomial </td></tr>
+    <tr><td class="paramname">var_poly</td><td>(Optional) output variance polynomial </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00952">952</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__polynomial_8c-source.html#l00150">fors_polynomial_count_coeff()</a>, <a class="el" href="fors__polynomial_8c-source.html#l00356">fors_polynomial_create_variance_polynomial()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00277">fors_polynomial_set_existing_coeff()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00952">952</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__polynomial_8c_source.html#l00150">fors_polynomial_count_coeff()</a>, <a class="el" href="fors__polynomial_8c_source.html#l00356">fors_polynomial_create_variance_polynomial()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00277">fors_polynomial_set_existing_coeff()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g105a6893a27ad23d6ef02cc271f42c30"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_get_timezone_observer" ref="g105a6893a27ad23d6ef02cc271f42c30" args="(const cpl_propertylist *header)" -->
+<a class="anchor" id="ga1ac67d0a2f318cd599a5be4a05a8b4b1"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int fors_photometry_get_timezone_observer           </td>
+          <td class="memname">int fors_photometry_get_timezone_observer </td>
           <td>(</td>
-          <td class="paramtype">const cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>header</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Return the timezone of the observer in hours against UT. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Frame header </td></tr>
+<p>Return the timezone of the observer in hours against UT. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>Frame header </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Number of hours in the range [-12 ... +12] </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>Number of hours in the range [-12 ... +12] </dd></dl>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l01039">1039</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00443">fors_fits_compare_string()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01092">fors_photometry_get_night_id()</a>.
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l01039">1039</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__photometry__impl_8c_source.html#l00443">fors_fits_compare_string()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01092">fors_photometry_get_night_id()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g294b0010ae795af85c28da476abadb18"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_get_night_id" ref="g294b0010ae795af85c28da476abadb18" args="(const cpl_propertylist *header)" -->
+<a class="anchor" id="gaf800d130ebeddcf3e8a655cf0c305f47"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int fors_photometry_get_night_id           </td>
+          <td class="memname">int fors_photometry_get_night_id </td>
           <td>(</td>
-          <td class="paramtype">const cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>header</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get a unique identifier for the night of the observation. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Frame header </td></tr>
+<p>Get a unique identifier for the night of the observation. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>Frame header </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>ID</dd></dl>
-In the case of error, the output ID is undefined. 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l01092">1092</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l01039">fors_photometry_get_timezone_observer()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l00517">fors_property_get_num()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g951ded14339fa018b98cbf21a332c7cf"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_atm_ext_create_index_by_identifier" ref="g951ded14339fa018b98cbf21a332c7cf" args="(entry_list *obs_list)" -->
+<dl class="section return"><dt>Returns</dt><dd>ID</dd></dl>
+<p>In the case of error, the output ID is undefined. </p>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l01092">1092</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l01039">fors_photometry_get_timezone_observer()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gac8322b086764e1db46e5c9d72263a251"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_photometry_atm_ext_create_index_by_identifier           </td>
+          <td class="memname">static int fors_photometry_atm_ext_create_index_by_identifier </td>
           <td>(</td>
-          <td class="paramtype">entry_list * </td>
-          <td class="paramname"> <em>obs_list</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">entry_list * </td>
+          <td class="paramname"><em>obs_list</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Collect all atm. extinction identifiers and create the indices. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>obs_list</em> </td><td>Observation list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>Number</em> </td><td>of indices (= max index + 1), 0 in the case of error</td></tr>
+<p>Collect all atm. extinction identifiers and create the indices. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">obs_list</td><td>Observation list </td></tr>
+    <tr><td class="paramname">Number</td><td>of indices (= max index + 1), 0 in the case of error</td></tr>
   </table>
+  </dd>
 </dl>
-The indices are created counting from zero, and in the order their identifiers appear. 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l01170">1170</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00096">entry::atm_ext_identifier</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l00093">entry::atm_ext_index</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01243">fors_photometry_atm_ext_create_indices()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g1491e01ccadf9b6d6b85316dfffd7f86"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_atm_ext_create_indices" ref="g1491e01ccadf9b6d6b85316dfffd7f86" args="(entry_list *obsl, fors_fit_ncoeff fit_e)" -->
+<p>The indices are created counting from zero, and in the order their identifiers appear. </p>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l01170">1170</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01243">fors_photometry_atm_ext_create_indices()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gafecdbeccb909ad2d152a857cfd10c2c0"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_photometry_atm_ext_create_indices           </td>
+          <td class="memname">static int fors_photometry_atm_ext_create_indices </td>
           <td>(</td>
-          <td class="paramtype">entry_list * </td>
-          <td class="paramname"> <em>obsl</em>, </td>
+          <td class="paramtype">entry_list * </td>
+          <td class="paramname"><em>obsl</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype"><a class="el" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> </td>
-          <td class="paramname"> <em>fit_e</em></td><td> </td>
+          <td class="paramtype">fors_fit_ncoeff </td>
+          <td class="paramname"><em>fit_e</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Create all atmospheric extinction indices. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>obsl</em> </td><td>Observation list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fit_e</em> </td><td>How many atmospheric extinctions to fit </td></tr>
+<p>Create all atmospheric extinction indices. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">obsl</td><td>Observation list </td></tr>
+    <tr><td class="paramname">fit_e</td><td>How many atmospheric extinctions to fit </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Number of atmospheric extinction indices, -1 in the case of error</dd></dl>
-The following indices in the entries of <em>obs_list</em> are set:<ul>
-<li>-1: no index (if none to fit)</li><li>0...N-1: normal indices</li><li>undefined: in the case of error</li></ul>
-<p>
-If <em>fit_e</em> is neither FORS_FIT_NCOEFF_NO nor FORS_FIT_NCOEFF_ONE nor FORS_FIT_NCOEFF_PERFRAME, then the atmospheric extinction identifier in the entries of <em>obs_list</em> must be set, otherwise the atmospheric extinction indices will contain garbage. 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l01243">1243</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00093">entry::atm_ext_index</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l01170">fors_photometry_atm_ext_create_index_by_identifier()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l00093">entry::frame_index</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
-</div>
-</div><p>
-<a class="anchor" name="ga3a88672675c12a7d6f30f9e6cc1459a"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_atm_ext_print_index_by_framename" ref="ga3a88672675c12a7d6f30f9e6cc1459a" args="(const entry_list *obs_list, const cpl_frameset *frames)" -->
+<dl class="section return"><dt>Returns</dt><dd>Number of atmospheric extinction indices, -1 in the case of error</dd></dl>
+<p>The following indices in the entries of <em>obs_list</em> are set:</p>
+<ul>
+<li>-1: no index (if none to fit)</li>
+<li>0...N-1: normal indices</li>
+<li>undefined: in the case of error</li>
+</ul>
+<p>If <em>fit_e</em> is neither FORS_FIT_NCOEFF_NO nor FORS_FIT_NCOEFF_ONE nor FORS_FIT_NCOEFF_PERFRAME, then the atmospheric extinction identifier in the entries of <em>obs_list</em> must be set, otherwise the atmospheric extinction indices will contain garbage. </p>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l01243">1243</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__photometry__impl_8c_source.html#l01170">fors_photometry_atm_ext_create_index_by_identifier()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaadcf6d1ce33dbed7ae0cbd24d675562f"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_table * fors_photometry_atm_ext_print_index_by_framename           </td>
+          <td class="memname">static cpl_table * fors_photometry_atm_ext_print_index_by_framename </td>
           <td>(</td>
-          <td class="paramtype">const entry_list * </td>
-          <td class="paramname"> <em>obs_list</em>, </td>
+          <td class="paramtype">const entry_list * </td>
+          <td class="paramname"><em>obs_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em></td><td> </td>
+          <td class="paramtype">const cpl_frameset * </td>
+          <td class="paramname"><em>frames</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Print the frame filenames for each atm. ext. index. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>obs_list</em> </td><td>Observation list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>Frameset used as reference for printing </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>CPL</em> </td><td>error code </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Print the frame filenames for each atm. ext. index. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">obs_list</td><td>Observation list </td></tr>
+    <tr><td class="paramname">frames</td><td>Frameset used as reference for printing </td></tr>
+    <tr><td class="paramname">CPL</td><td>error code </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l01313">1313</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00093">entry::atm_ext_index</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l00093">entry::frame_index</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l01313">1313</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gfe5618566936c6f9809d639f9148ce4d"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_check_input_value" ref="gfe5618566936c6f9809d639f9148ce4d" args="(double value, double value_error, const char *value_name, const char *input_name, double min_limit, double max_limit, double max_error)" -->
+</div>
+<a class="anchor" id="ga104fe70d8a535ae244e71f6b16dcaf5d"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_error_code fors_photometry_check_input_value           </td>
+          <td class="memname">static cpl_error_code fors_photometry_check_input_value </td>
           <td>(</td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>value_error</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>value_error</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>value_name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>value_name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>input_name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>input_name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>min_limit</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>min_limit</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>max_limit</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>max_limit</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>max_error</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>max_error</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Check input value and its error to stay in a range. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Input value to check </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value_error</em> </td><td>Input value's uncertainty (1 sigma) to check </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value_name</em> </td><td>Input value's name to use in error messages </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>input_name</em> </td><td>Input's name (e.g. filename) to use in error messages </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>min_limit</em> </td><td>Minimum limit for <em>value</em> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>max_limit</em> </td><td>Maximum limit for <em>value</em> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>max_error</em> </td><td>Maximum limit for <em>value_error</em> </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Check input value and its error to stay in a range. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">value</td><td>Input value to check </td></tr>
+    <tr><td class="paramname">value_error</td><td>Input value's uncertainty (1 sigma) to check </td></tr>
+    <tr><td class="paramname">value_name</td><td>Input value's name to use in error messages </td></tr>
+    <tr><td class="paramname">input_name</td><td>Input's name (e.g. filename) to use in error messages </td></tr>
+    <tr><td class="paramname">min_limit</td><td>Minimum limit for <em>value</em> </td></tr>
+    <tr><td class="paramname">max_limit</td><td>Maximum limit for <em>value</em> </td></tr>
+    <tr><td class="paramname">max_error</td><td>Maximum limit for <em>value_error</em> </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL error code</dd></dl>
-As a minimum limit for <em>value_error</em>, 0 is supposed. 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l01447">1447</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g7a7ad98c36de98c254af8f74f436a347"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_check_fitparam_atm_ext" ref="g7a7ad98c36de98c254af8f74f436a347" args="(entry_list *obsl, fors_fit_ncoeff fit_e, bool fit_z)" -->
+<dl class="section return"><dt>Returns</dt><dd>CPL error code</dd></dl>
+<p>As a minimum limit for <em>value_error</em>, 0 is supposed. </p>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l01447">1447</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga750adc75acb9310f8dde5fb067a356e9"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_error_code fors_photometry_check_fitparam_atm_ext           </td>
+          <td class="memname">static cpl_error_code fors_photometry_check_fitparam_atm_ext </td>
           <td>(</td>
-          <td class="paramtype">entry_list * </td>
-          <td class="paramname"> <em>obsl</em>, </td>
+          <td class="paramtype">entry_list * </td>
+          <td class="paramname"><em>obsl</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype"><a class="el" href="group__fors__photometry.html#g62a9e943fa2645e365ee3810cdd3b54b">fors_fit_ncoeff</a> </td>
-          <td class="paramname"> <em>fit_e</em>, </td>
+          <td class="paramtype">fors_fit_ncoeff </td>
+          <td class="paramname"><em>fit_e</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">bool </td>
-          <td class="paramname"> <em>fit_z</em></td><td> </td>
+          <td class="paramtype">bool </td>
+          <td class="paramname"><em>fit_z</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Check whether fitting is possible (see below). 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>fit_e</em> </td><td>How many atmospheric extinctions to fit </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fit_z</em> </td><td>Flag whether to fit the zeropoint </td></tr>
+<p>Check whether fitting is possible (see below). </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">fit_e</td><td>How many atmospheric extinctions to fit </td></tr>
+    <tr><td class="paramname">fit_z</td><td>Flag whether to fit the zeropoint </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL error code </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>CPL error code </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l01522">1522</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l01522">1522</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00097">entry::airmass</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l00093">entry::atm_ext_index</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gb82262e58905a5f0d047cf607614aa6d"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_remove_unnecessary" ref="gb82262e58905a5f0d047cf607614aa6d" args="(fors_std_star_list *std_list, entry_list *obs_list, int *n_mag_fits)" -->
+</div>
+<a class="anchor" id="ga6e8831942438a88bb3287ed491961ec1"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_error_code fors_photometry_remove_unnecessary           </td>
+          <td class="memname">static cpl_error_code fors_photometry_remove_unnecessary </td>
           <td>(</td>
-          <td class="paramtype">fors_std_star_list * </td>
-          <td class="paramname"> <em>std_list</em>, </td>
+          <td class="paramtype">fors_std_star_list * </td>
+          <td class="paramname"><em>std_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">entry_list * </td>
-          <td class="paramname"> <em>obs_list</em>, </td>
+          <td class="paramtype">entry_list * </td>
+          <td class="paramname"><em>obs_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>n_mag_fits</em></td><td> </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>n_mag_fits</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Remove all standard stars which are fitted but were observed only once. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>std_list</em> </td><td>Standard star list (modified) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>obs_list</em> </td><td>Observation list (modified) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>n_mag_fits</em> </td><td>(Output) number of remaining untrusted std stars </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Remove all standard stars which are fitted but were observed only once. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">std_list</td><td>Standard star list (modified) </td></tr>
+    <tr><td class="paramname">obs_list</td><td>Observation list (modified) </td></tr>
+    <tr><td class="paramname">n_mag_fits</td><td>(Output) number of remaining untrusted std stars </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL error code </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>CPL error code </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03191">3191</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l00336">entry_delete_but_standard()</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l03321">fors_photometry_count_observations()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03249">3249</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00336">entry_delete_but_standard()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l03379">fors_photometry_count_observations()</a>, <a class="el" href="fors__star_8h-source.html#l00054">_fors_star::id</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00100">e [...]
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gbb6ba893e672e51a2a83674b93fe4733"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_count_observations" ref="gbb6ba893e672e51a2a83674b93fe4733" args="(fors_std_star_list *std_list, entry_list *obs_list)" -->
+</div>
+<a class="anchor" id="ga182915aa06bfd142318b3c9443a80e80"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_array * fors_photometry_count_observations           </td>
+          <td class="memname">static cpl_array * fors_photometry_count_observations </td>
           <td>(</td>
-          <td class="paramtype">fors_std_star_list * </td>
-          <td class="paramname"> <em>std_list</em>, </td>
+          <td class="paramtype">fors_std_star_list * </td>
+          <td class="paramname"><em>std_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">entry_list * </td>
-          <td class="paramname"> <em>obs_list</em></td><td> </td>
+          <td class="paramtype">entry_list * </td>
+          <td class="paramname"><em>obs_list</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Count the number of observations of each standard star. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>std_list</em> </td><td>Standard star list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>obs_list</em> </td><td>Observation list </td></tr>
+<p>Count the number of observations of each standard star. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">std_list</td><td>Standard star list </td></tr>
+    <tr><td class="paramname">obs_list</td><td>Observation list </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Array of type CPL_TYPE_INT and the same size as <em>std_list</em>, NULL in the case of error. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>Array of type CPL_TYPE_INT and the same size as <em>std_list</em>, NULL in the case of error. </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03321">3321</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l03191">fors_photometry_remove_unnecessary()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03379">3379</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00093">entry::star_index</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l03249">fors_photometry_remove_unnecessary()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gb269a10fede882f376f2e599965cebe4"></a><!-- doxytag: member="fors_photometry_impl.c::build_equations_lhs_matrix_from_parameters" ref="gb269a10fede882f376f2e599965cebe4" args="(const entry_list *obs_list, const fors_std_star_list *std_list, bool fit_z, bool fit_c, int *n_fit_e_cols)" -->
+</div>
+<a class="anchor" id="gabfcabff5102d27ba7b09e4398e057762"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_matrix * build_equations_lhs_matrix_from_parameters           </td>
+          <td class="memname">static cpl_matrix * build_equations_lhs_matrix_from_parameters </td>
           <td>(</td>
-          <td class="paramtype">const entry_list * </td>
-          <td class="paramname"> <em>obs_list</em>, </td>
+          <td class="paramtype">const entry_list * </td>
+          <td class="paramname"><em>obs_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const fors_std_star_list * </td>
-          <td class="paramname"> <em>std_list</em>, </td>
+          <td class="paramtype">const fors_std_star_list * </td>
+          <td class="paramname"><em>std_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">bool </td>
-          <td class="paramname"> <em>fit_z</em>, </td>
+          <td class="paramtype">bool </td>
+          <td class="paramname"><em>fit_z</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">bool </td>
-          <td class="paramname"> <em>fit_c</em>, </td>
+          <td class="paramtype">bool </td>
+          <td class="paramname"><em>fit_c</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>n_fit_e_cols</em></td><td> </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>n_fit_e_cols</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Build left hand side matrix equation part. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>obs_list</em> </td><td>List of star observations </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>std_list</em> </td><td>List of std. stars </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fit_z</em> </td><td>fit zeropoint? </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fit_c</em> </td><td>fit color coeff.? </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>n_fit_e_cols</em> </td><td>(Optional) output number of atmospheric extinctions </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Build left hand side matrix equation part. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">obs_list</td><td>List of star observations </td></tr>
+    <tr><td class="paramname">std_list</td><td>List of std. stars </td></tr>
+    <tr><td class="paramname">fit_z</td><td>fit zeropoint? </td></tr>
+    <tr><td class="paramname">fit_c</td><td>fit color coeff.? </td></tr>
+    <tr><td class="paramname">n_fit_e_cols</td><td>(Optional) output number of atmospheric extinctions </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Matrix</dd></dl>
-<dl compact><dt><b>Details:</b></dt><dd><ul>
-<li>This function returns NULL, if the number of parameters is 0 (i.e. if nothing is to be fitted here), without setting an error.</li></ul>
+<dl class="section return"><dt>Returns</dt><dd>Matrix</dd></dl>
+<dl class="section user"><dt>Details:</dt><dd><ul>
+<li>This function returns NULL, if the number of parameters is 0 (i.e. if nothing is to be fitted here), without setting an error.</li>
+</ul>
 </dd></dl>
-<dl compact><dt><b>Atmospheric Extinctions:</b></dt><dd><ul>
-<li>This function creates as many columns for atmospheric extinctions as there are indices for atmospheric extinction found in <em>obs_list</em> (the number can be zero).</li><li>The atmospheric extinction indices (if one should be valid) must count from zero and must not lack numbers inbetween (unchecked).</li><li>Indices < 0 do not contribute, <em>obs_list</em> entries with an index < 0 will get a row of zeros in these columns.</li><li>The number of created columns for the indivi [...]
+<dl class="section user"><dt>Atmospheric Extinctions:</dt><dd><ul>
+<li>This function creates as many columns for atmospheric extinctions as there are indices for atmospheric extinction found in <em>obs_list</em> (the number can be zero).</li>
+<li>The atmospheric extinction indices (if one should be valid) must count from zero and must not lack numbers inbetween (unchecked).</li>
+<li>Indices < 0 do not contribute, <em>obs_list</em> entries with an index < 0 will get a row of zeros in these columns.</li>
+<li>The number of created columns for the individual atmospheric extinctions is returned via <em>n_fit_e_cols</em>. </li>
+</ul>
 </dd></dl>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03446">3446</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00097">entry::airmass</a>, <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00093">entry::atm_ext_index</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00093">entry::frame_index</a>, <a class="el" href="fors__star_8h-source.html#l00054">_fors_star::id</a>, <a cla [...]
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03388">3388</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g55817cb490a2517ef207f96a9cf51b8b"></a><!-- doxytag: member="fors_photometry_impl.c::build_equations_lhs_matrix_from_poly" ref="g55817cb490a2517ef207f96a9cf51b8b" args="(const entry_list *obs_list, const cpl_polynomial *poly, const char *pname, double(*powerfunc)(const entry *,const cpl_array *))" -->
+<a class="anchor" id="ga43e3c1d13157092f683e6d4912cd71d2"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_matrix * build_equations_lhs_matrix_from_poly           </td>
+          <td class="memname">static cpl_matrix * build_equations_lhs_matrix_from_poly </td>
           <td>(</td>
-          <td class="paramtype">const entry_list * </td>
-          <td class="paramname"> <em>obs_list</em>, </td>
+          <td class="paramtype">const entry_list * </td>
+          <td class="paramname"><em>obs_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>poly</em>, </td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>poly</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>pname</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>pname</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double(*)(const <a class="el" href="structentry.html">entry</a> *, const cpl_array *) </td>
-          <td class="paramname"> <em>powerfunc</em></td><td> </td>
+          <td class="paramtype">double(*)(const <a class="el" href="structentry.html">entry</a> *, const cpl_array *) </td>
+          <td class="paramname"><em>powerfunc</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Build polynomial fitting matrix with coefficients represented in columns. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>obs_list</em> </td><td>Observation list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>poly</em> </td><td>Polynomial definition </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>pname</em> </td><td>(Optional) name of the polynomial for debug messages </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>powerfunc</em> </td><td>Function to evaluate a combination of powers </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Build polynomial fitting matrix with coefficients represented in columns. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">obs_list</td><td>Observation list </td></tr>
+    <tr><td class="paramname">poly</td><td>Polynomial definition </td></tr>
+    <tr><td class="paramname">pname</td><td>(Optional) name of the polynomial for debug messages </td></tr>
+    <tr><td class="paramname">powerfunc</td><td>Function to evaluate a combination of powers </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Matrix, NULL if the polynomial contains no non-zero coefficients</dd></dl>
-<dl compact><dt><b>Principle:</b></dt><dd><ul>
-<li>For every observation in <em>obs_list</em>, a matrix row is created,</li><li>for every non-zero coefficient in <em>poly</em>, a matrix column is created,</li><li>looping through the existing coefficients (first dimension is fastest index), the fitting value is inserted into the respective matrix element calling <em>powerfunc</em> with the coefficient'c combination of powers,</li><li>where the powers are provided as a cpl_array whose size equals the number of dimensions of <em>poly</e [...]
+<dl class="section return"><dt>Returns</dt><dd>Matrix, NULL if the polynomial contains no non-zero coefficients</dd></dl>
+<dl class="section user"><dt>Principle:</dt><dd><ul>
+<li>For every observation in <em>obs_list</em>, a matrix row is created,</li>
+<li>for every non-zero coefficient in <em>poly</em>, a matrix column is created,</li>
+<li>looping through the existing coefficients (first dimension is fastest index), the fitting value is inserted into the respective matrix element calling <em>powerfunc</em> with the coefficient'c combination of powers,</li>
+<li>where the powers are provided as a cpl_array whose size equals the number of dimensions of <em>poly</em>,</li>
+<li>if <em>poly</em> has no non-zero coefficients, then NULL is returned. </li>
+</ul>
 </dd></dl>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03624">3624</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__polynomial_8c-source.html#l00150">fors_polynomial_count_coeff()</a>, <a class="el" href="fors__polynomial_8c-source.html#l00192">fors_polynomial_powers_find_first_coeff()</a>, <a class="el" href="fors__polynomial_8c-source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00563">fors_polynomial_sprint_coeff()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03566">3566</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__polynomial_8c_source.html#l00150">fors_polynomial_count_coeff()</a>, <a class="el" href="fors__polynomial_8c_source.html#l00192">fors_polynomial_powers_find_first_coeff()</a>, <a class="el" href="fors__polynomial_8c_source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00563">fors_polynomial_sprint_coeff()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="ge2d3cb795a4f549322f1febff5596787"></a><!-- doxytag: member="fors_photometry_impl.c::build_equations_rhs_cov" ref="ge2d3cb795a4f549322f1febff5596787" args="(const entry_list *obs_list, const fors_std_star_list *std_list, bool fit_z, bool fit_c, bool fit_e, double color_coeff, double dcolor_coeff, double ext_coeff, double dext_coeff, double zpoint, double dzpoint, cpl_matrix **rhs, cpl_matrix **rhs_cov)" -->
+</div>
+<a class="anchor" id="ga5e4afe6326f0bb9c748fed2286c8c835"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_error_code build_equations_rhs_cov           </td>
+          <td class="memname">static cpl_error_code build_equations_rhs_cov </td>
           <td>(</td>
-          <td class="paramtype">const entry_list * </td>
-          <td class="paramname"> <em>obs_list</em>, </td>
+          <td class="paramtype">const entry_list * </td>
+          <td class="paramname"><em>obs_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const fors_std_star_list * </td>
-          <td class="paramname"> <em>std_list</em>, </td>
+          <td class="paramtype">const fors_std_star_list * </td>
+          <td class="paramname"><em>std_list</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">bool </td>
-          <td class="paramname"> <em>fit_z</em>, </td>
+          <td class="paramtype">bool </td>
+          <td class="paramname"><em>fit_z</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">bool </td>
-          <td class="paramname"> <em>fit_c</em>, </td>
+          <td class="paramtype">bool </td>
+          <td class="paramname"><em>fit_c</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">bool </td>
-          <td class="paramname"> <em>fit_e</em>, </td>
+          <td class="paramtype">bool </td>
+          <td class="paramname"><em>fit_e</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>color_coeff</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>color_coeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dcolor_coeff</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dcolor_coeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ext_coeff</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ext_coeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dext_coeff</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dext_coeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>zpoint</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>zpoint</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dzpoint</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dzpoint</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_matrix ** </td>
-          <td class="paramname"> <em>rhs</em>, </td>
+          <td class="paramtype">cpl_matrix ** </td>
+          <td class="paramname"><em>rhs</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_matrix ** </td>
-          <td class="paramname"> <em>rhs_cov</em></td><td> </td>
+          <td class="paramtype">cpl_matrix ** </td>
+          <td class="paramname"><em>rhs_cov</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Build right hand side matrix equation part. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>obs_list</em> </td><td>List of star observations </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>std_list</em> </td><td>List of std. stars </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fit_z</em> </td><td>fit zeropoint? </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fit_c</em> </td><td>fit color coeff.? </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fit_e</em> </td><td>fit extinction coeff.? </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>color_coeff</em> </td><td>color coefficient </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dcolor_coeff</em> </td><td>color coefficient error </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ext_coeff</em> </td><td>extinction coefficient </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dext_coeff</em> </td><td>ext_coeff error </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>rhs</em> </td><td>(output) right hand side </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>rhs_cov</em> </td><td>(output) covariance of rhs </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Build right hand side matrix equation part. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">obs_list</td><td>List of star observations </td></tr>
+    <tr><td class="paramname">std_list</td><td>List of std. stars </td></tr>
+    <tr><td class="paramname">fit_z</td><td>fit zeropoint? </td></tr>
+    <tr><td class="paramname">fit_c</td><td>fit color coeff.? </td></tr>
+    <tr><td class="paramname">fit_e</td><td>fit extinction coeff.? </td></tr>
+    <tr><td class="paramname">color_coeff</td><td>color coefficient </td></tr>
+    <tr><td class="paramname">dcolor_coeff</td><td>color coefficient error </td></tr>
+    <tr><td class="paramname">ext_coeff</td><td>extinction coefficient </td></tr>
+    <tr><td class="paramname">dext_coeff</td><td>ext_coeff error </td></tr>
+    <tr><td class="paramname">rhs</td><td>(output) right hand side </td></tr>
+    <tr><td class="paramname">rhs_cov</td><td>(output) covariance of rhs </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL error code </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>CPL error code </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l03677">3677</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__photometry__impl_8c_source.html#l00480">fors_matrix_null()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l03735">3735</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00097">entry::airmass</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__star_8h-source.html#l00045">_fors_star::dmagnitude</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00097">entry::exptime</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00480">fors_matrix_null()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00097 [...]
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>.
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g78298a3adaf4b775f4a48a21a2b475ba"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry" ref="g78298a3adaf4b775f4a48a21a2b475ba" args="(cpl_frameset *frames, const cpl_parameterlist *parameters)" -->
+<a class="anchor" id="gae18d6d686eec800da9538ee3c533aed7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_photometry           </td>
+          <td class="memname">void fors_photometry </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em></td><td> </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Do the processing. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>input frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>recipe parameters</td></tr>
+<p>Do the processing. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>input frames </td></tr>
+    <tr><td class="paramname">parameters</td><td>recipe parameters</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l01818">1818</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l03388">build_equations_lhs_matrix_from_parameters()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l03566">build_equations_lhs_matrix_from_poly()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l03677">build_equations_rhs_cov()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l00336">entry_delete_but_standard()</ [...]
+
+<p>Referenced by <a class="el" href="fors__photometry_8c_source.html#l00158">fors_photometry_exec()</a>, and <a class="el" href="fors__photometry-test_8c_source.html#l00055">test_photometry()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l01876">1876</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l03446">build_equations_lhs_matrix_from_parameters()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l03624">build_equations_lhs_matrix_from_poly()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l03735">build_equations_rhs_cov()</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors_ [...]
-<p>
-Referenced by <a class="el" href="fors__photometry_8c-source.html#l00158">fors_photometry_exec()</a>, and <a class="el" href="fors__photometry-test_8c-source.html#l00055">test_photometry()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g4abb403976fc3ddcaa614c59a44590c9"></a><!-- doxytag: member="fors_photometry.c::cpl_plugin_get_info" ref="g4abb403976fc3ddcaa614c59a44590c9" args="(cpl_pluginlist *list)" -->
+</div>
+<a class="anchor" id="ga31d1fccd4cd15b1c1f3c5edc8cb18693"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int cpl_plugin_get_info           </td>
+          <td class="memname">int cpl_plugin_get_info </td>
           <td>(</td>
-          <td class="paramtype">cpl_pluginlist * </td>
-          <td class="paramname"> <em>list</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_pluginlist * </td>
+          <td class="paramname"><em>list</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Build the list of available plugins, for this module. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>The plugin list</td></tr>
+<p>Build the list of available plugins, for this module. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">list</td><td>The plugin list</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
-Create the recipe instance and make it available to the application using the interface. This function is exported. 
-<p>
-Definition at line <a class="el" href="fors__photometry_8c-source.html#l00062">62</a> of file <a class="el" href="fors__photometry_8c-source.html">fors_photometry.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00065">fors_get_license()</a>, <a class="el" href="fors__utils_8c-source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00058">fors_photometry_author</a>, <a class="el" href="fors__photometry_8c-source.html#l00109">fors_photometry_create()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00060">fors_photometry_description</a>, <a class="el" href="fors__photome [...]
-</div>
-</div><p>
-<a class="anchor" name="g8caa3f3d513a15a26c0d6e55a17370e3"></a><!-- doxytag: member="fors_photometry.c::fors_photometry_create" ref="g8caa3f3d513a15a26c0d6e55a17370e3" args="(cpl_plugin *plugin)" -->
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<p>Create the recipe instance and make it available to the application using the interface. This function is exported. </p>
+
+<p>Definition at line <a class="el" href="fors__photometry_8c_source.html#l00062">62</a> of file <a class="el" href="fors__photometry_8c_source.html">fors_photometry.c</a>.</p>
+
+<p>References <a class="el" href="fors__utils_8c_source.html#l00065">fors_get_license()</a>, <a class="el" href="fors__utils_8c_source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__photometry_8c_source.html#l00109">fors_photometry_create()</a>, <a class="el" href="fors__photometry_8c_source.html#l00207">fors_photometry_destroy()</a>, and <a class="el" href="fors__photometry_8c_source.html#l00158">fors_photometry_exec()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaefb8747dfc072489e0c49686e235db79"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_photometry_create           </td>
+          <td class="memname">static int fors_photometry_create </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Setup the recipe options. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+<p>Setup the recipe options. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok</dd></dl>
-Defining the command-line/configuration parameters for the recipe. 
-<p>
-Definition at line <a class="el" href="fors__photometry_8c-source.html#l00109">109</a> of file <a class="el" href="fors__photometry_8c-source.html">fors_photometry.c</a>.
-<p>
-References <a class="el" href="fors__photometry__impl_8c-source.html#l00669">fors_photometry_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry_8c-source.html#l00062">cpl_plugin_get_info()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g71aac253b19e8883e79cfbce6b73076a"></a><!-- doxytag: member="fors_photometry.c::fors_photometry_exec" ref="g71aac253b19e8883e79cfbce6b73076a" args="(cpl_plugin *plugin)" -->
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok</dd></dl>
+<p>Defining the command-line/configuration parameters for the recipe. </p>
+
+<p>Definition at line <a class="el" href="fors__photometry_8c_source.html#l00109">109</a> of file <a class="el" href="fors__photometry_8c_source.html">fors_photometry.c</a>.</p>
+
+<p>References <a class="el" href="fors__photometry__impl_8c_source.html#l00669">fors_photometry_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaa3f56f38e97f7b8afe2cc18c5e9f3a6d"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_photometry_exec           </td>
+          <td class="memname">static int fors_photometry_exec </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Execute the plugin instance given by the interface. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>the plugin</td></tr>
+<p>Execute the plugin instance given by the interface. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>the plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry_8c_source.html#l00158">158</a> of file <a class="el" href="fors__photometry_8c_source.html">fors_photometry.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dfs_8c_source.html#l00258">fors_end()</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__photometry_8c-source.html#l00158">158</a> of file <a class="el" href="fors__photometry_8c-source.html">fors_photometry.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dfs_8c-source.html#l00258">fors_end()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l00057">fors_photometry_description_short</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<p>Referenced by <a class="el" href="fors__photometry_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gad02467f38136c506fb860db14783156"></a><!-- doxytag: member="fors_photometry.c::fors_photometry_destroy" ref="gad02467f38136c506fb860db14783156" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="gae31960fe5e90f545420ff2f50c33f0a4"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_photometry_destroy           </td>
+          <td class="memname">static int fors_photometry_destroy </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Destroy what has been created by the 'create' function. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+<p>Destroy what has been created by the 'create' function. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__photometry_8c_source.html#l00207">207</a> of file <a class="el" href="fors__photometry_8c_source.html">fors_photometry.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__photometry_8c-source.html#l00207">207</a> of file <a class="el" href="fors__photometry_8c-source.html">fors_photometry.c</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<p>Referenced by <a class="el" href="fors__photometry_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr><h2>Variable Documentation</h2>
-<a class="anchor" name="g1e4c46bbe3d698da29ad2ca40f5c70cf"></a><!-- doxytag: member="fors_photometry_impl.c::fors_photometry_description" ref="g1e4c46bbe3d698da29ad2ca40f5c70cf" args="" -->
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="gaac101f33b12a7432e9b4d5ae6143326f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* const <a class="el" href="group__fors__photometry.html#g1e4c46bbe3d698da29ad2ca40f5c70cf">fors_photometry_description</a>          </td>
+          <td class="memname">const char* const fors_photometry_description</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment"> 
-<span class="stringliteral">"Input files:\n"</span>
-<span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span>
-<span class="stringliteral">"  PHOT_TABLE                 FITS table  Expected extinction params  1\n"</span>
-<span class="stringliteral">"  ALIGNED_PHOT               FITS table  Photometry                  1+\n"</span>
-<span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master flat field           1\n"</span>
-<span class="stringliteral">"\n"</span>
-<span class="stringliteral">"Output files:\n"</span>
-<span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<span class="stringliteral">"  PHOT_COEFF_TABLE           FITS image  Observed extinction coefficients\n"</span>
-<span class="stringliteral">"  CORRECTION_MAP             FITS image  Correction map (magnitude)\n"</span>
-<span class="stringliteral">"  CORRECTION_FACTOR          FITS image  Correction map (flux)\n"</span>
-<span class="stringliteral">"  MASTER_FLAT_IMG            FITS image  Corrected master flat field\n"</span>
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00060">60</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry_8c-source.html#l00062">cpl_plugin_get_info()</a>.
-</div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">= </div>
+<div class="line"><span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Type:       Explanation:             Number:\n"</span></div>
+<div class="line"><span class="stringliteral">"  PHOT_TABLE                 FITS table  Expected extinction params  1\n"</span></div>
+<div class="line"><span class="stringliteral">"  ALIGNED_PHOT               FITS table  Photometry                  1+\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master flat field           1\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+<div class="line"><span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><span class="stringliteral">"  PHOT_COEFF_TABLE           FITS image  Observed extinction coefficients\n"</span></div>
+<div class="line"><span class="stringliteral">"  CORRECTION_MAP             FITS image  Correction map (magnitude)\n"</span></div>
+<div class="line"><span class="stringliteral">"  CORRECTION_FACTOR          FITS image  Correction map (flux)\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_FLAT_IMG            FITS image  Corrected master flat field\n"</span></div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00060">60</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga8914070dcfeab65bad628175b5522d62"></a>
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">struct <a class="el" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a>  <a class="el" href="structfors__fit__ncoeff__paropts.html">fors_fit_ncoeff_paropts</a></td>
+        </tr>
+      </table>
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">= {       <span class="stringliteral">"no"</span>,</div>
+<div class="line">                                    <span class="stringliteral">"one"</span>,</div>
+<div class="line">                                    <span class="stringliteral">"perframe"</span>,</div>
+<div class="line">                                    <span class="stringliteral">"pernight"</span>}</div>
+</div><!-- fragment -->
+</div>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__point.html b/html/group__fors__point.html
index 33acd61..e1f63c4 100644
--- a/html/group__fors__point.html
+++ b/html/group__fors__point.html
@@ -1,248 +1,274 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: 2d point</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>2d point</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb79164ea3a1118352c6ca0ea9a9840ea"></a><!-- doxytag: member="fors_point::LIST_DEFINE" ref="gb79164ea3a1118352c6ca0ea9a9840ea" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9d7995a21a54c1d39a0bc87d7f498029"></a><!-- doxytag: member="fors_point::LIST_ELEM" ref="g9d7995a21a54c1d39a0bc87d7f498029" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#g9d7995a21a54c1d39a0bc87d7f498029">LIST_ELEM</a>   fors_point</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_point::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_point::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">fors_point * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83">fors_point_new</a> (double x, double y)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor.  <a href="#gcf03321efac4311c0fcee0674c197a83"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">fors_point * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#gc5a8341742fc371f6e7332600286045e">fors_point_duplicate</a> (const fors_point *p)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor.  <a href="#gc5a8341742fc371f6e7332600286045e"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce">fors_point_delete</a> (fors_point **p)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor.  <a href="#gbaf354a8aaff372ed3502ef79702a9ce"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65">fors_point_distsq</a> (const fors_point *p, const fors_point *q)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Metric.  <a href="#g2be6ad652538b2829b762dc58c61aa65"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#g5f09413dd7958d3ebbe1ba7700b27377">fors_point_equal</a> (const fors_point *p, const fors_point *q)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Equality.  <a href="#g5f09413dd7958d3ebbe1ba7700b27377"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="gcf03321efac4311c0fcee0674c197a83"></a><!-- doxytag: member="fors_point.c::fors_point_new" ref="gcf03321efac4311c0fcee0674c197a83" args="(double x, double y)" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">2d point</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:gac0830324b91c374088872a18c876bc34"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac0830324b91c374088872a18c876bc34"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>LIST_DEFINE</b></td></tr>
+<tr class="separator:gac0830324b91c374088872a18c876bc34"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadb231bfc44ec37423962ea7f563a458b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gadb231bfc44ec37423962ea7f563a458b"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>LIST_ELEM</b>   fors_point</td></tr>
+<tr class="separator:gadb231bfc44ec37423962ea7f563a458b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gac3a0346b8dba99b049ab470272c67d0d"><td class="memItemLeft" align="right" valign="top">fors_point * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d">fors_point_new</a> (double x, double y)</td></tr>
+<tr class="memdesc:gac3a0346b8dba99b049ab470272c67d0d"><td class="mdescLeft"> </td><td class="mdescRight">Constructor.  <a href="#gac3a0346b8dba99b049ab470272c67d0d">More...</a><br/></td></tr>
+<tr class="separator:gac3a0346b8dba99b049ab470272c67d0d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaefadbecbfc8e491ca544292027d8b69e"><td class="memItemLeft" align="right" valign="top">fors_point * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#gaefadbecbfc8e491ca544292027d8b69e">fors_point_duplicate</a> (const fors_point *p)</td></tr>
+<tr class="memdesc:gaefadbecbfc8e491ca544292027d8b69e"><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor.  <a href="#gaefadbecbfc8e491ca544292027d8b69e">More...</a><br/></td></tr>
+<tr class="separator:gaefadbecbfc8e491ca544292027d8b69e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gacfd40664615a747765cacb741e0823d0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#gacfd40664615a747765cacb741e0823d0">fors_point_delete</a> (fors_point **p)</td></tr>
+<tr class="memdesc:gacfd40664615a747765cacb741e0823d0"><td class="mdescLeft"> </td><td class="mdescRight">Destructor.  <a href="#gacfd40664615a747765cacb741e0823d0">More...</a><br/></td></tr>
+<tr class="separator:gacfd40664615a747765cacb741e0823d0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae8a4542170e7a3b9a9c39229d4571142"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142">fors_point_distsq</a> (const fors_point *p, const fors_point *q)</td></tr>
+<tr class="memdesc:gae8a4542170e7a3b9a9c39229d4571142"><td class="mdescLeft"> </td><td class="mdescRight">Metric.  <a href="#gae8a4542170e7a3b9a9c39229d4571142">More...</a><br/></td></tr>
+<tr class="separator:gae8a4542170e7a3b9a9c39229d4571142"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga08402a65da099406fc85d21041df7f9d"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point.html#ga08402a65da099406fc85d21041df7f9d">fors_point_equal</a> (const fors_point *p, const fors_point *q)</td></tr>
+<tr class="memdesc:ga08402a65da099406fc85d21041df7f9d"><td class="mdescLeft"> </td><td class="mdescRight">Equality.  <a href="#ga08402a65da099406fc85d21041df7f9d">More...</a><br/></td></tr>
+<tr class="separator:ga08402a65da099406fc85d21041df7f9d"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gac3a0346b8dba99b049ab470272c67d0d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">fors_point* fors_point_new           </td>
+          <td class="memname">fors_point* fors_point_new </td>
           <td>(</td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>x</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>x</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>y</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>y</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Constructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>x</em> </td><td>1st coordinate </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>y</em> </td><td>2nd coordinate </td></tr>
+</div><div class="memdoc">
+
+<p>Constructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x</td><td>1st coordinate </td></tr>
+    <tr><td class="paramname">y</td><td>2nd coordinate </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated point </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>newly allocated point </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__point_8c_source.html#l00053">53</a> of file <a class="el" href="fors__point_8c_source.html">fors_point.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__point_8c-source.html#l00053">53</a> of file <a class="el" href="fors__point_8c-source.html">fors_point.c</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00305">distsq_shift()</a>, <a class="el" href="fors__star_8c-source.html#l00114">fors_star_new()</a>, <a class="el" href="fors__star_8c-source.html#l00170">fors_star_new_from_table()</a>, <a class="el" href="fors__identify_8c-source.html#l01023">match_patterns()</a>, <a class="el" href="fors__pattern-test_8c-source.html#l00046">test_pattern()</a>, and <a class="el" href="fors__point-test_8c-source.html#l00045">test_point()</a>.
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00305">distsq_shift()</a>, <a class="el" href="fors__star_8c_source.html#l00114">fors_star_new()</a>, <a class="el" href="fors__star_8c_source.html#l00170">fors_star_new_from_table()</a>, <a class="el" href="fors__identify_8c_source.html#l01023">match_patterns()</a>, <a class="el" href="fors__pattern-test_8c_source.html#l00046">test_pattern()</a>, and <a class="el" href="fors__point-test_8c_source.html#l00045">test_point [...]
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gc5a8341742fc371f6e7332600286045e"></a><!-- doxytag: member="fors_point.c::fors_point_duplicate" ref="gc5a8341742fc371f6e7332600286045e" args="(const fors_point *p)" -->
+<a class="anchor" id="gaefadbecbfc8e491ca544292027d8b69e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">fors_point* fors_point_duplicate           </td>
+          <td class="memname">fors_point* fors_point_duplicate </td>
           <td>(</td>
-          <td class="paramtype">const fors_point * </td>
-          <td class="paramname"> <em>p</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const fors_point * </td>
+          <td class="paramname"><em>p</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Copy constructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>to duplicate </td></tr>
+</div><div class="memdoc">
+
+<p>Copy constructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>to duplicate </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated point </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__point_8c-source.html#l00070">70</a> of file <a class="el" href="fors__point_8c-source.html">fors_point.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__star_8c-source.html#l00248">fors_star_duplicate()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated point </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__point_8c_source.html#l00070">70</a> of file <a class="el" href="fors__point_8c_source.html">fors_point.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__star_8c_source.html#l00248">fors_star_duplicate()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gbaf354a8aaff372ed3502ef79702a9ce"></a><!-- doxytag: member="fors_point.c::fors_point_delete" ref="gbaf354a8aaff372ed3502ef79702a9ce" args="(fors_point **p)" -->
+</div>
+<a class="anchor" id="gacfd40664615a747765cacb741e0823d0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_point_delete           </td>
+          <td class="memname">void fors_point_delete </td>
           <td>(</td>
-          <td class="paramtype">fors_point ** </td>
-          <td class="paramname"> <em>p</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">fors_point ** </td>
+          <td class="paramname"><em>p</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Destructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>to delete </td></tr>
+</div><div class="memdoc">
+
+<p>Destructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>to delete </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__point_8c-source.html#l00087">87</a> of file <a class="el" href="fors__point_8c-source.html">fors_point.c</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00305">distsq_shift()</a>, <a class="el" href="fors__star_8c-source.html#l00273">fors_star_delete()</a>, <a class="el" href="fors__star_8c-source.html#l00291">fors_star_delete_but_standard()</a>, <a class="el" href="fors__pattern-test_8c-source.html#l00046">test_pattern()</a>, and <a class="el" href="fors__point-test_8c-source.html#l00045">test_point()</a>.
+<p>Definition at line <a class="el" href="fors__point_8c_source.html#l00087">87</a> of file <a class="el" href="fors__point_8c_source.html">fors_point.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00305">distsq_shift()</a>, <a class="el" href="fors__star_8c_source.html#l00273">fors_star_delete()</a>, <a class="el" href="fors__star_8c_source.html#l00291">fors_star_delete_but_standard()</a>, <a class="el" href="fors__pattern-test_8c_source.html#l00046">test_pattern()</a>, and <a class="el" href="fors__point-test_8c_source.html#l00045">test_point()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g2be6ad652538b2829b762dc58c61aa65"></a><!-- doxytag: member="fors_point.c::fors_point_distsq" ref="g2be6ad652538b2829b762dc58c61aa65" args="(const fors_point *p, const fors_point *q)" -->
+<a class="anchor" id="gae8a4542170e7a3b9a9c39229d4571142"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_point_distsq           </td>
+          <td class="memname">double fors_point_distsq </td>
           <td>(</td>
-          <td class="paramtype">const fors_point * </td>
-          <td class="paramname"> <em>p</em>, </td>
+          <td class="paramtype">const fors_point * </td>
+          <td class="paramname"><em>p</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const fors_point * </td>
-          <td class="paramname"> <em>q</em></td><td> </td>
+          <td class="paramtype">const fors_point * </td>
+          <td class="paramname"><em>q</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Metric. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>1st point </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>q</em> </td><td>2nd point </td></tr>
+</div><div class="memdoc">
+
+<p>Metric. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>1st point </td></tr>
+    <tr><td class="paramname">q</td><td>2nd point </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>squared distance </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__point_8c-source.html#l00103">103</a> of file <a class="el" href="fors__point_8c-source.html">fors_point.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00305">distsq_shift()</a>, <a class="el" href="fors__point_8c-source.html#l00120">fors_point_equal()</a>, <a class="el" href="fors__star_8c-source.html#l00347">fors_star_distsq()</a>, and <a class="el" href="fors__point-test_8c-source.html#l00045">test_point()</a>.
+<dl class="section return"><dt>Returns</dt><dd>squared distance </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__point_8c_source.html#l00103">103</a> of file <a class="el" href="fors__point_8c_source.html">fors_point.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00305">distsq_shift()</a>, <a class="el" href="fors__point_8c_source.html#l00120">fors_point_equal()</a>, <a class="el" href="fors__star_8c_source.html#l00347">fors_star_distsq()</a>, and <a class="el" href="fors__point-test_8c_source.html#l00045">test_point()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g5f09413dd7958d3ebbe1ba7700b27377"></a><!-- doxytag: member="fors_point.c::fors_point_equal" ref="g5f09413dd7958d3ebbe1ba7700b27377" args="(const fors_point *p, const fors_point *q)" -->
+</div>
+<a class="anchor" id="ga08402a65da099406fc85d21041df7f9d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">bool fors_point_equal           </td>
+          <td class="memname">bool fors_point_equal </td>
           <td>(</td>
-          <td class="paramtype">const fors_point * </td>
-          <td class="paramname"> <em>p</em>, </td>
+          <td class="paramtype">const fors_point * </td>
+          <td class="paramname"><em>p</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const fors_point * </td>
-          <td class="paramname"> <em>q</em></td><td> </td>
+          <td class="paramtype">const fors_point * </td>
+          <td class="paramname"><em>q</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Equality. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>1st point </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>q</em> </td><td>2nd point </td></tr>
+</div><div class="memdoc">
+
+<p>Equality. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>1st point </td></tr>
+    <tr><td class="paramname">q</td><td>2nd point </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true iff points are equal </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__point_8c-source.html#l00120">120</a> of file <a class="el" href="fors__point_8c-source.html">fors_point.c</a>.
-<p>
-References <a class="el" href="fors__point_8c-source.html#l00103">fors_point_distsq()</a>.
-<p>
-Referenced by <a class="el" href="fors__star_8c-source.html#l00309">fors_star_equal()</a>.
+<dl class="section return"><dt>Returns</dt><dd>true iff points are equal </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__point_8c_source.html#l00120">120</a> of file <a class="el" href="fors__point_8c_source.html">fors_point.c</a>.</p>
+
+<p>References <a class="el" href="fors__point_8c_source.html#l00103">fors_point_distsq()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__star_8c_source.html#l00309">fors_star_equal()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__point__test.html b/html/group__fors__point__test.html
index 4ba9026..ff14cdc 100644
--- a/html/group__fors__point__test.html
+++ b/html/group__fors__point__test.html
@@ -1,62 +1,97 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_point unit tests</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>fors_point unit tests</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gad6ab87338468a53ffe9d19dc578c999"></a><!-- doxytag: member="fors_point_test::test_photometry" ref="gad6ab87338468a53ffe9d19dc578c999" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point__test.html#gad6ab87338468a53ffe9d19dc578c999">test_photometry</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">test <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_point_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of QC module. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g8780ed589661ab74a9969ab904805731"></a><!-- doxytag: member="fors_point_test::test_point" ref="g8780ed589661ab74a9969ab904805731" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point__test.html#g8780ed589661ab74a9969ab904805731">test_point</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">test <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_photometry-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_point unit tests</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gad87df141a27d7e06e22c0e912ae029e6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad87df141a27d7e06e22c0e912ae029e6"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point__test.html#gad87df141a27d7e06e22c0e912ae029e6">test_photometry</a> (void)</td></tr>
+<tr class="memdesc:gad87df141a27d7e06e22c0e912ae029e6"><td class="mdescLeft"> </td><td class="mdescRight">test <br/></td></tr>
+<tr class="separator:gad87df141a27d7e06e22c0e912ae029e6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of QC module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2c261e462483c35aa06be9ac1ff0d683"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2c261e462483c35aa06be9ac1ff0d683"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__point__test.html#ga2c261e462483c35aa06be9ac1ff0d683">test_point</a> (void)</td></tr>
+<tr class="memdesc:ga2c261e462483c35aa06be9ac1ff0d683"><td class="mdescLeft"> </td><td class="mdescRight">test <br/></td></tr>
+<tr class="separator:ga2c261e462483c35aa06be9ac1ff0d683"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(frames); \</div>
+<div class="line">    cpl_parameterlist_delete(parameters); \</div>
+<div class="line">    cpl_propertylist_delete(header); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__photometry-test_8c_source.html#l00045">45</a> of file <a class="el" href="fors__photometry-test_8c_source.html">fors_photometry-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(frames); \
-    cpl_parameterlist_delete(parameters); \
-    cpl_propertylist_delete(header); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__photometry-test_8c-source.html#l00045">45</a> of file <a class="el" href="fors__photometry-test_8c-source.html">fors_photometry-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__polynomial.html b/html/group__fors__polynomial.html
index 07f2c5e..543a1d7 100644
--- a/html/group__fors__polynomial.html
+++ b/html/group__fors__polynomial.html
@@ -1,603 +1,630 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Tools for Polynomial Coefficient Handling</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Tools for Polynomial Coefficient Handling</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_polynomial::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_polynomial::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_polynomial::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_polynomial::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5">fors_polynomial_is_coeff_set</a> (const cpl_polynomial *p, const cpl_size *powers)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Implementation of the check whether a coefficient exists.  <a href="#g9226c84960cf7e2ab0f1b867f8317cd5"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g5d5e2697050554c599837146744408fc">fors_polynomial_powers_next</a> (const cpl_polynomial *p, cpl_size *powers)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Step the powers of a polynomials coefficient to the next.  <a href="#g5d5e2697050554c599837146744408fc"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679">fors_polynomial_count_coeff</a> (const cpl_polynomial *p)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Count the total number of non-zero coefficients.  <a href="#gb42d337eb5aa13043bca8fb1aedb1679"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0">fors_polynomial_powers_find_first_coeff</a> (const cpl_polynomial *p, cpl_size *powers)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Find the first non-zero coefficient.  <a href="#g265e60c227964d991c159e3c9b8a82c0"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073">fors_polynomial_powers_find_next_coeff</a> (const cpl_polynomial *p, cpl_size *powers)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Find the next non-zero coefficient.  <a href="#g2ce4065757620ca5d75d4343e9c8f073"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g2255e6cc731c54c6b5575e506bd5fea8">fors_polynomial_set_existing_coeff</a> (cpl_polynomial *p, const double *coeffs, int n_coeffs)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the already existing coefficients in a polynomial to values taken from an array.  <a href="#g2255e6cc731c54c6b5575e506bd5fea8"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#ga116e293092bfb1db2c5e90504e90cc0">fors_polynomial_create_variance_polynomial</a> (const cpl_polynomial *p_def, const cpl_matrix *cov_coeff)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a polynomial modelling the squared influence of the error of the coefficients of another polynomial.  <a href="#ga116e293092bfb1db2c5e90504e90cc0"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb">fors_polynomial_dump</a> (const cpl_polynomial *p, const char *name, cpl_msg_severity level, const cpl_polynomial *p_def)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Count the total number of non-zero coefficients.  <a href="#g9543c3772a67bbb0ed04ec9f243294bb"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#g54a749f0fe51db3713c776ffe5dd0b57">fors_polynomial_sprint_coeff</a> (const cpl_polynomial *p, cpl_size *powers, const char *prefix)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Print a coefficient's name into a newly allocated string.  <a href="#g54a749f0fe51db3713c776ffe5dd0b57"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_polynomial.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Tools for Polynomial Coefficient Handling</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gae0f30232e4a457f491cbf83809352195"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195">fors_polynomial_is_coeff_set</a> (const cpl_polynomial *p, const cpl_size *powers)</td></tr>
+<tr class="memdesc:gae0f30232e4a457f491cbf83809352195"><td class="mdescLeft"> </td><td class="mdescRight">Implementation of the check whether a coefficient exists.  <a href="#gae0f30232e4a457f491cbf83809352195">More...</a><br/></td></tr>
+<tr class="separator:gae0f30232e4a457f491cbf83809352195"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga16814ff8371aba44b9730bc3d516ef5f"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#ga16814ff8371aba44b9730bc3d516ef5f">fors_polynomial_powers_next</a> (const cpl_polynomial *p, cpl_size *powers)</td></tr>
+<tr class="memdesc:ga16814ff8371aba44b9730bc3d516ef5f"><td class="mdescLeft"> </td><td class="mdescRight">Step the powers of a polynomials coefficient to the next.  <a href="#ga16814ff8371aba44b9730bc3d516ef5f">More...</a><br/></td></tr>
+<tr class="separator:ga16814ff8371aba44b9730bc3d516ef5f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1944b24982e31b3d39b0d8e3f36370ff"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff">fors_polynomial_count_coeff</a> (const cpl_polynomial *p)</td></tr>
+<tr class="memdesc:ga1944b24982e31b3d39b0d8e3f36370ff"><td class="mdescLeft"> </td><td class="mdescRight">Count the total number of non-zero coefficients.  <a href="#ga1944b24982e31b3d39b0d8e3f36370ff">More...</a><br/></td></tr>
+<tr class="separator:ga1944b24982e31b3d39b0d8e3f36370ff"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga14bc37c4ed8a9b8da4483749d2e26d1e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e">fors_polynomial_powers_find_first_coeff</a> (const cpl_polynomial *p, cpl_size *powers)</td></tr>
+<tr class="memdesc:ga14bc37c4ed8a9b8da4483749d2e26d1e"><td class="mdescLeft"> </td><td class="mdescRight">Find the first non-zero coefficient.  <a href="#ga14bc37c4ed8a9b8da4483749d2e26d1e">More...</a><br/></td></tr>
+<tr class="separator:ga14bc37c4ed8a9b8da4483749d2e26d1e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa351eeb0d31616d1dbdb6b96af95a24c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c">fors_polynomial_powers_find_next_coeff</a> (const cpl_polynomial *p, cpl_size *powers)</td></tr>
+<tr class="memdesc:gaa351eeb0d31616d1dbdb6b96af95a24c"><td class="mdescLeft"> </td><td class="mdescRight">Find the next non-zero coefficient.  <a href="#gaa351eeb0d31616d1dbdb6b96af95a24c">More...</a><br/></td></tr>
+<tr class="separator:gaa351eeb0d31616d1dbdb6b96af95a24c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9363bc98285fa909170db1684e81a240"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#ga9363bc98285fa909170db1684e81a240">fors_polynomial_set_existing_coeff</a> (cpl_polynomial *p, const double *coeffs, int n_coeffs)</td></tr>
+<tr class="memdesc:ga9363bc98285fa909170db1684e81a240"><td class="mdescLeft"> </td><td class="mdescRight">Set the already existing coefficients in a polynomial to values taken from an array.  <a href="#ga9363bc98285fa909170db1684e81a240">More...</a><br/></td></tr>
+<tr class="separator:ga9363bc98285fa909170db1684e81a240"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2de60ddde27a60692e8e116939ef5007"><td class="memItemLeft" align="right" valign="top">cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#ga2de60ddde27a60692e8e116939ef5007">fors_polynomial_create_variance_polynomial</a> (const cpl_polynomial *p_def, const cpl_matrix *cov_coeff)</td></tr>
+<tr class="memdesc:ga2de60ddde27a60692e8e116939ef5007"><td class="mdescLeft"> </td><td class="mdescRight">Create a polynomial modelling the squared influence of the error of the coefficients of another polynomial.  <a href="#ga2de60ddde27a60692e8e116939ef5007">More...</a><br/></td></tr>
+<tr class="separator:ga2de60ddde27a60692e8e116939ef5007"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8805f5c4eda84b295b77c0d72fdcf981"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981">fors_polynomial_dump</a> (const cpl_polynomial *p, const char *name, cpl_msg_severity level, const cpl_polynomial *p_def)</td></tr>
+<tr class="memdesc:ga8805f5c4eda84b295b77c0d72fdcf981"><td class="mdescLeft"> </td><td class="mdescRight">Count the total number of non-zero coefficients.  <a href="#ga8805f5c4eda84b295b77c0d72fdcf981">More...</a><br/></td></tr>
+<tr class="separator:ga8805f5c4eda84b295b77c0d72fdcf981"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga498733e7d062578c77b1ae5c0f6f2935"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__polynomial.html#ga498733e7d062578c77b1ae5c0f6f2935">fors_polynomial_sprint_coeff</a> (const cpl_polynomial *p, cpl_size *powers, const char *prefix)</td></tr>
+<tr class="memdesc:ga498733e7d062578c77b1ae5c0f6f2935"><td class="mdescLeft"> </td><td class="mdescRight">Print a coefficient's name into a newly allocated string.  <a href="#ga498733e7d062578c77b1ae5c0f6f2935">More...</a><br/></td></tr>
+<tr class="separator:ga498733e7d062578c77b1ae5c0f6f2935"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    if (pows != NULL) \</div>
+<div class="line">        cpl_free(pows); \</div>
+<div class="line">    pows = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00544">544</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <span class="keywordflow">if</span> (pows != NULL) \
-        cpl_free(pows); \
-    pows = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00544">544</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_polynomial.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    if (pows != NULL) \</div>
+<div class="line">        cpl_free(pows); \</div>
+<div class="line">    pows = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00544">544</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <span class="keywordflow">if</span> (pows != NULL) \
-        cpl_free(pows); \
-    pows = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00544">544</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_polynomial.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    if (powersA != NULL) { cpl_free(powersA); powersA = NULL;} \</div>
+<div class="line">    if (powersB != NULL) { cpl_free(powersB); powersB = NULL;} \</div>
+<div class="line">    if (powersE != NULL) { cpl_free(powersE); powersE = NULL;} \</div>
+<div class="line">    cpl_polynomial_delete(ep); ep = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00544">544</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <span class="keywordflow">if</span> (powersA != NULL) { cpl_free(powersA); powersA = NULL;} \
-    <span class="keywordflow">if</span> (powersB != NULL) { cpl_free(powersB); powersB = NULL;} \
-    <span class="keywordflow">if</span> (powersE != NULL) { cpl_free(powersE); powersE = NULL;} \
-    cpl_polynomial_delete(ep); ep = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00544">544</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_polynomial.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    if (pows != NULL) \</div>
+<div class="line">        cpl_free(pows); \</div>
+<div class="line">    pows = NULL; \</div>
+<div class="line">    if (ndxstr != NULL) \</div>
+<div class="line">        cpl_free(ndxstr); \</div>
+<div class="line">    ndxstr = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00544">544</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <span class="keywordflow">if</span> (pows != NULL) \
-        cpl_free(pows); \
-    pows = NULL; \
-    <span class="keywordflow">if</span> (ndxstr != NULL) \
-        cpl_free(ndxstr); \
-    ndxstr = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00544">544</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_polynomial.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    if (ndxstr != NULL) \</div>
+<div class="line">        cpl_free(ndxstr); \</div>
+<div class="line">    ndxstr = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00544">544</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <span class="keywordflow">if</span> (ndxstr != NULL) \
-        cpl_free(ndxstr); \
-    ndxstr = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00544">544</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g9226c84960cf7e2ab0f1b867f8317cd5"></a><!-- doxytag: member="fors_polynomial.c::fors_polynomial_is_coeff_set" ref="g9226c84960cf7e2ab0f1b867f8317cd5" args="(const cpl_polynomial *p, const cpl_size *powers)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gae0f30232e4a457f491cbf83809352195"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static bool fors_polynomial_is_coeff_set           </td>
+          <td class="memname">static bool fors_polynomial_is_coeff_set </td>
           <td>(</td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>p</em>, </td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>p</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_size * </td>
-          <td class="paramname"> <em>powers</em></td><td> </td>
+          <td class="paramtype">const cpl_size * </td>
+          <td class="paramname"><em>powers</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Implementation of the check whether a coefficient exists. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>Polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>powers</em> </td><td>Integer array (of the same dimension) containing the powers </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Implementation of the check whether a coefficient exists. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>Polynomial </td></tr>
+    <tr><td class="paramname">powers</td><td>Integer array (of the same dimension) containing the powers </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>1 if it exists, 0 otherwise or in the case of error </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>1 if it exists, 0 otherwise or in the case of error </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00074">74</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00074">74</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
-<p>
-Referenced by <a class="el" href="fors__polynomial_8c-source.html#l00150">fors_polynomial_count_coeff()</a>, <a class="el" href="fors__polynomial_8c-source.html#l00465">fors_polynomial_dump()</a>, <a class="el" href="fors__polynomial_8c-source.html#l00192">fors_polynomial_powers_find_first_coeff()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>.
+<p>Referenced by <a class="el" href="fors__polynomial_8c_source.html#l00150">fors_polynomial_count_coeff()</a>, <a class="el" href="fors__polynomial_8c_source.html#l00465">fors_polynomial_dump()</a>, <a class="el" href="fors__polynomial_8c_source.html#l00192">fors_polynomial_powers_find_first_coeff()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g5d5e2697050554c599837146744408fc"></a><!-- doxytag: member="fors_polynomial.c::fors_polynomial_powers_next" ref="g5d5e2697050554c599837146744408fc" args="(const cpl_polynomial *p, cpl_size *powers)" -->
+<a class="anchor" id="ga16814ff8371aba44b9730bc3d516ef5f"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static bool fors_polynomial_powers_next           </td>
+          <td class="memname">static bool fors_polynomial_powers_next </td>
           <td>(</td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>p</em>, </td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>p</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_size * </td>
-          <td class="paramname"> <em>powers</em></td><td> </td>
+          <td class="paramtype">cpl_size * </td>
+          <td class="paramname"><em>powers</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Step the powers of a polynomials coefficient to the next. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>Polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>powers</em> </td><td>Integer array of the same dimensionality as <em>p</em> </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Step the powers of a polynomials coefficient to the next. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>Polynomial </td></tr>
+    <tr><td class="paramname">powers</td><td>Integer array of the same dimensionality as <em>p</em> </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>"true" if overflow or error, otherwise "false" if success </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>"true" if overflow or error, otherwise "false" if success </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00098">98</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__polynomial_8c_source.html#l00150">fors_polynomial_count_coeff()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00098">98</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
-<p>
-Referenced by <a class="el" href="fors__polynomial_8c-source.html#l00150">fors_polynomial_count_coeff()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gb42d337eb5aa13043bca8fb1aedb1679"></a><!-- doxytag: member="fors_polynomial.c::fors_polynomial_count_coeff" ref="gb42d337eb5aa13043bca8fb1aedb1679" args="(const cpl_polynomial *p)" -->
+</div>
+<a class="anchor" id="ga1944b24982e31b3d39b0d8e3f36370ff"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int fors_polynomial_count_coeff           </td>
+          <td class="memname">int fors_polynomial_count_coeff </td>
           <td>(</td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>p</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>p</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Count the total number of non-zero coefficients. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>Polynomial </td></tr>
+</div><div class="memdoc">
+
+<p>Count the total number of non-zero coefficients. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>Polynomial </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Number </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00150">150</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__polynomial_8c-source.html#l00074">fors_polynomial_is_coeff_set()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00098">fors_polynomial_powers_next()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l03624">build_equations_lhs_matrix_from_poly()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00805">fors_photometry_define_polyf()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00885">fors_photometry_define_polyp()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00952">fors_photometry_poly_new_from_coefficients()</a>, and <a class="el" href="fors__polynomial_8c-sour [...]
+<dl class="section return"><dt>Returns</dt><dd>Number </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00150">150</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
+<p>References <a class="el" href="fors__polynomial_8c_source.html#l00074">fors_polynomial_is_coeff_set()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00098">fors_polynomial_powers_next()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l03566">build_equations_lhs_matrix_from_poly()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l00805">fors_photometry_define_polyf()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l00885">fors_photometry_define_polyp()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l00952">fors_photometry_poly_new_from_coefficients()</a>, and <a class="el" href="fors__polynomial_8c_s [...]
+
 </div>
-</div><p>
-<a class="anchor" name="g265e60c227964d991c159e3c9b8a82c0"></a><!-- doxytag: member="fors_polynomial.c::fors_polynomial_powers_find_first_coeff" ref="g265e60c227964d991c159e3c9b8a82c0" args="(const cpl_polynomial *p, cpl_size *powers)" -->
+</div>
+<a class="anchor" id="ga14bc37c4ed8a9b8da4483749d2e26d1e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int fors_polynomial_powers_find_first_coeff           </td>
+          <td class="memname">int fors_polynomial_powers_find_first_coeff </td>
           <td>(</td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>p</em>, </td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>p</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_size * </td>
-          <td class="paramname"> <em>powers</em></td><td> </td>
+          <td class="paramtype">cpl_size * </td>
+          <td class="paramname"><em>powers</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Find the first non-zero coefficient. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>Polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>powers</em> </td><td>Integer array (of the same dimension) containing the powers </td></tr>
+</div><div class="memdoc">
+
+<p>Find the first non-zero coefficient. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>Polynomial </td></tr>
+    <tr><td class="paramname">powers</td><td>Integer array (of the same dimension) containing the powers </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>"true" if overflow or error, otherwise "false" </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00192">192</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__polynomial_8c-source.html#l00074">fors_polynomial_is_coeff_set()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l03624">build_equations_lhs_matrix_from_poly()</a>, <a class="el" href="fors__polynomial_8c-source.html#l00356">fors_polynomial_create_variance_polynomial()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00277">fors_polynomial_set_existing_coeff()</a>.
+<dl class="section return"><dt>Returns</dt><dd>"true" if overflow or error, otherwise "false" </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00192">192</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
+<p>References <a class="el" href="fors__polynomial_8c_source.html#l00074">fors_polynomial_is_coeff_set()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l03566">build_equations_lhs_matrix_from_poly()</a>, <a class="el" href="fors__polynomial_8c_source.html#l00356">fors_polynomial_create_variance_polynomial()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00277">fors_polynomial_set_existing_coeff()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g2ce4065757620ca5d75d4343e9c8f073"></a><!-- doxytag: member="fors_polynomial.c::fors_polynomial_powers_find_next_coeff" ref="g2ce4065757620ca5d75d4343e9c8f073" args="(const cpl_polynomial *p, cpl_size *powers)" -->
+<a class="anchor" id="gaa351eeb0d31616d1dbdb6b96af95a24c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int fors_polynomial_powers_find_next_coeff           </td>
+          <td class="memname">int fors_polynomial_powers_find_next_coeff </td>
           <td>(</td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>p</em>, </td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>p</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_size * </td>
-          <td class="paramname"> <em>powers</em></td><td> </td>
+          <td class="paramtype">cpl_size * </td>
+          <td class="paramname"><em>powers</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Find the next non-zero coefficient. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>Polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>powers</em> </td><td>Integer array (of the same dimension) containing the powers </td></tr>
+</div><div class="memdoc">
+
+<p>Find the next non-zero coefficient. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>Polynomial </td></tr>
+    <tr><td class="paramname">powers</td><td>Integer array (of the same dimension) containing the powers </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>"true" if overflow or error, otherwise "false" </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00232">232</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__polynomial_8c-source.html#l00074">fors_polynomial_is_coeff_set()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00098">fors_polynomial_powers_next()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l03624">build_equations_lhs_matrix_from_poly()</a>, <a class="el" href="fors__polynomial_8c-source.html#l00356">fors_polynomial_create_variance_polynomial()</a>, <a class="el" href="fors__polynomial_8c-source.html#l00192">fors_polynomial_powers_find_first_coeff()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00277">fors_polynomial_set_existing_coeff()</a>.
+<dl class="section return"><dt>Returns</dt><dd>"true" if overflow or error, otherwise "false" </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00232">232</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
+<p>References <a class="el" href="fors__polynomial_8c_source.html#l00074">fors_polynomial_is_coeff_set()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00098">fors_polynomial_powers_next()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l03566">build_equations_lhs_matrix_from_poly()</a>, <a class="el" href="fors__polynomial_8c_source.html#l00356">fors_polynomial_create_variance_polynomial()</a>, <a class="el" href="fors__polynomial_8c_source.html#l00192">fors_polynomial_powers_find_first_coeff()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00277">fors_polynomial_set_existing_coeff()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g2255e6cc731c54c6b5575e506bd5fea8"></a><!-- doxytag: member="fors_polynomial.c::fors_polynomial_set_existing_coeff" ref="g2255e6cc731c54c6b5575e506bd5fea8" args="(cpl_polynomial *p, const double *coeffs, int n_coeffs)" -->
+<a class="anchor" id="ga9363bc98285fa909170db1684e81a240"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_polynomial_set_existing_coeff           </td>
+          <td class="memname">cpl_error_code fors_polynomial_set_existing_coeff </td>
           <td>(</td>
-          <td class="paramtype">cpl_polynomial * </td>
-          <td class="paramname"> <em>p</em>, </td>
+          <td class="paramtype">cpl_polynomial * </td>
+          <td class="paramname"><em>p</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const double * </td>
-          <td class="paramname"> <em>coeffs</em>, </td>
+          <td class="paramtype">const double * </td>
+          <td class="paramname"><em>coeffs</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>n_coeffs</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>n_coeffs</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Set the already existing coefficients in a polynomial to values taken from an array. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>Polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>coeffs</em> </td><td>Array containing coefficient values </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>n_coeffs</em> </td><td>Size of <em>coeffs</em> array </td></tr>
+</div><div class="memdoc">
+
+<p>Set the already existing coefficients in a polynomial to values taken from an array. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>Polynomial </td></tr>
+    <tr><td class="paramname">coeffs</td><td>Array containing coefficient values </td></tr>
+    <tr><td class="paramname">n_coeffs</td><td>Size of <em>coeffs</em> array </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Number </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00277">277</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__polynomial_8c-source.html#l00192">fors_polynomial_powers_find_first_coeff()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l00952">fors_photometry_poly_new_from_coefficients()</a>.
+<dl class="section return"><dt>Returns</dt><dd>Number </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00277">277</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
+<p>References <a class="el" href="fors__polynomial_8c_source.html#l00192">fors_polynomial_powers_find_first_coeff()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l00952">fors_photometry_poly_new_from_coefficients()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ga116e293092bfb1db2c5e90504e90cc0"></a><!-- doxytag: member="fors_polynomial.c::fors_polynomial_create_variance_polynomial" ref="ga116e293092bfb1db2c5e90504e90cc0" args="(const cpl_polynomial *p_def, const cpl_matrix *cov_coeff)" -->
+<a class="anchor" id="ga2de60ddde27a60692e8e116939ef5007"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_polynomial* fors_polynomial_create_variance_polynomial           </td>
+          <td class="memname">cpl_polynomial* fors_polynomial_create_variance_polynomial </td>
           <td>(</td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>p_def</em>, </td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>p_def</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_matrix * </td>
-          <td class="paramname"> <em>cov_coeff</em></td><td> </td>
+          <td class="paramtype">const cpl_matrix * </td>
+          <td class="paramname"><em>cov_coeff</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create a polynomial modelling the squared influence of the error of the coefficients of another polynomial. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p_def</em> </td><td>Polynomial definition (please read below) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>cov_coeff</em> </td><td>Covariance matrix of the coefficients </td></tr>
+</div><div class="memdoc">
+
+<p>Create a polynomial modelling the squared influence of the error of the coefficients of another polynomial. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p_def</td><td>Polynomial definition (please read below) </td></tr>
+    <tr><td class="paramname">cov_coeff</td><td>Covariance matrix of the coefficients </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The error polynomial, NULL in the case of error</dd></dl>
-<dl compact><dt><b>Input Parameter Details:</b></dt><dd><ul>
-<li><em>p_def</em> is a polynomial which is used as a definition of which coefficients are set, therefore:</li><li>the coefficients in <em>p_def</em> must be either zero (treated as non-existing) or significantly different from zero (currently checked against DBL_EPSILON),</li><li><em>cov_coeff</em> must be square, and have as many columns as <em>p_def</em> has coefficients,</li><li>the entries of <em>cov_coeff</em> must refer to the coefficients of <em>p_dev</em> in the order of their o [...]
+<dl class="section return"><dt>Returns</dt><dd>The error polynomial, NULL in the case of error</dd></dl>
+<dl class="section user"><dt>Input Parameter Details:</dt><dd><ul>
+<li><em>p_def</em> is a polynomial which is used as a definition of which coefficients are set, therefore:</li>
+<li>the coefficients in <em>p_def</em> must be either zero (treated as non-existing) or significantly different from zero (currently checked against DBL_EPSILON),</li>
+<li><em>cov_coeff</em> must be square, and have as many columns as <em>p_def</em> has coefficients,</li>
+<li>the entries of <em>cov_coeff</em> must refer to the coefficients of <em>p_dev</em> in the order of their occurrence, with the first dimension of <em>p_dev</em> as the fastest index. </li>
+</ul>
 </dd></dl>
 
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00356">356</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__polynomial_8c-source.html#l00150">fors_polynomial_count_coeff()</a>, <a class="el" href="fors__polynomial_8c-source.html#l00192">fors_polynomial_powers_find_first_coeff()</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l00952">fors_photometry_poly_new_from_coefficients()</a>.
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00356">356</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
+<p>References <a class="el" href="fors__polynomial_8c_source.html#l00150">fors_polynomial_count_coeff()</a>, <a class="el" href="fors__polynomial_8c_source.html#l00192">fors_polynomial_powers_find_first_coeff()</a>, and <a class="el" href="fors__polynomial_8c_source.html#l00232">fors_polynomial_powers_find_next_coeff()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l00952">fors_photometry_poly_new_from_coefficients()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g9543c3772a67bbb0ed04ec9f243294bb"></a><!-- doxytag: member="fors_polynomial.c::fors_polynomial_dump" ref="g9543c3772a67bbb0ed04ec9f243294bb" args="(const cpl_polynomial *p, const char *name, cpl_msg_severity level, const cpl_polynomial *p_def)" -->
+</div>
+<a class="anchor" id="ga8805f5c4eda84b295b77c0d72fdcf981"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_polynomial_dump           </td>
+          <td class="memname">cpl_error_code fors_polynomial_dump </td>
           <td>(</td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>p</em>, </td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>p</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_msg_severity </td>
-          <td class="paramname"> <em>level</em>, </td>
+          <td class="paramtype">cpl_msg_severity </td>
+          <td class="paramname"><em>level</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>p_def</em></td><td> </td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>p_def</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Count the total number of non-zero coefficients. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>Polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>(Optional) name, can be NULL </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>Message level </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>p_def</em> </td><td>(Optional) polynomial definition, used to determine non-zero coefficients </td></tr>
+</div><div class="memdoc">
+
+<p>Count the total number of non-zero coefficients. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>Polynomial </td></tr>
+    <tr><td class="paramname">name</td><td>(Optional) name, can be NULL </td></tr>
+    <tr><td class="paramname">level</td><td>Message level </td></tr>
+    <tr><td class="paramname">p_def</td><td>(Optional) polynomial definition, used to determine non-zero coefficients </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL error code </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00465">465</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, and <a class="el" href="fors__polynomial_8c-source.html#l00074">fors_polynomial_is_coeff_set()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00805">fors_photometry_define_polyf()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l00885">fors_photometry_define_polyp()</a>.
+<dl class="section return"><dt>Returns</dt><dd>CPL error code </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00465">465</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
+<p>References <a class="el" href="fors__polynomial_8c_source.html#l00074">fors_polynomial_is_coeff_set()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l00805">fors_photometry_define_polyf()</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l00885">fors_photometry_define_polyp()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g54a749f0fe51db3713c776ffe5dd0b57"></a><!-- doxytag: member="fors_polynomial.c::fors_polynomial_sprint_coeff" ref="g54a749f0fe51db3713c776ffe5dd0b57" args="(const cpl_polynomial *p, cpl_size *powers, const char *prefix)" -->
+<a class="anchor" id="ga498733e7d062578c77b1ae5c0f6f2935"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">char* fors_polynomial_sprint_coeff           </td>
+          <td class="memname">char* fors_polynomial_sprint_coeff </td>
           <td>(</td>
-          <td class="paramtype">const cpl_polynomial * </td>
-          <td class="paramname"> <em>p</em>, </td>
+          <td class="paramtype">const cpl_polynomial * </td>
+          <td class="paramname"><em>p</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_size * </td>
-          <td class="paramname"> <em>powers</em>, </td>
+          <td class="paramtype">cpl_size * </td>
+          <td class="paramname"><em>powers</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>prefix</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>prefix</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Print a coefficient's name into a newly allocated string. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>Polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>powers</em> </td><td>Integer array (of the same dimension) containing the powers </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>(Optional) name prefix, can be NULL </td></tr>
+</div><div class="memdoc">
+
+<p>Print a coefficient's name into a newly allocated string. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">p</td><td>Polynomial </td></tr>
+    <tr><td class="paramname">powers</td><td>Integer array (of the same dimension) containing the powers </td></tr>
+    <tr><td class="paramname">name</td><td>(Optional) name prefix, can be NULL </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Allocated string, NULL in the case of error</dd></dl>
-A coefficient is printed into a newly allocated string like following:<ul>
-<li>if <em>prefix</em> is NULL or empty, then in the format "%d,%d,%d,...,%d",</li><li>otherwise in the format "%s_%d,%d,...,%d", prefix, etc. </li></ul>
-
-<p>
-Definition at line <a class="el" href="fors__polynomial_8c-source.html#l00563">563</a> of file <a class="el" href="fors__polynomial_8c-source.html">fors_polynomial.c</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l03624">build_equations_lhs_matrix_from_poly()</a>.
+<dl class="section return"><dt>Returns</dt><dd>Allocated string, NULL in the case of error</dd></dl>
+<p>A coefficient is printed into a newly allocated string like following:</p>
+<ul>
+<li>if <em>prefix</em> is NULL or empty, then in the format "%d,%d,%d,...,%d",</li>
+<li>otherwise in the format "%s_%d,%d,...,%d", prefix, etc. </li>
+</ul>
+
+<p>Definition at line <a class="el" href="fors__polynomial_8c_source.html#l00563">563</a> of file <a class="el" href="fors__polynomial_8c_source.html">fors_polynomial.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l03566">build_equations_lhs_matrix_from_poly()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__qc__test.html b/html/group__fors__qc__test.html
index c7b2660..ddf0473 100644
--- a/html/group__fors__qc__test.html
+++ b/html/group__fors__qc__test.html
@@ -1,32 +1,67 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: QC test</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>QC test</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc197343ddbbc1be506ec5a221e90dadd"></a><!-- doxytag: member="fors_qc_test::test_qc" ref="gc197343ddbbc1be506ec5a221e90dadd" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__qc__test.html#gc197343ddbbc1be506ec5a221e90dadd">test_qc</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Write QC log. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_qc_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__qc__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of QC module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">QC test</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gabf987906c0b52a3ada25d6c611845f5c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gabf987906c0b52a3ada25d6c611845f5c"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__qc__test.html#gabf987906c0b52a3ada25d6c611845f5c">test_qc</a> (void)</td></tr>
+<tr class="memdesc:gabf987906c0b52a3ada25d6c611845f5c"><td class="mdescLeft"> </td><td class="mdescRight">Write QC log. <br/></td></tr>
+<tr class="separator:gabf987906c0b52a3ada25d6c611845f5c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__qc__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of QC module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__recipe.html b/html/group__fors__recipe.html
index 10224f6..23ba319 100644
--- a/html/group__fors__recipe.html
+++ b/html/group__fors__recipe.html
@@ -1,168 +1,217 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_recipe Recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>fors_recipe Recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__recipe.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#g4abb403976fc3ddcaa614c59a44590c9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__recipe.html#g9de4437d5a4d68fdd594724e002b8388">fors_recipe_create</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#g9de4437d5a4d68fdd594724e002b8388"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__recipe.html#g2e82215d74913efed45e3dce601076aa">fors_recipe_exec</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#g2e82215d74913efed45e3dce601076aa"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__recipe.html#g351e58c2312f291e40fc17e8d9e09982">fors_recipe_destroy</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#g351e58c2312f291e40fc17e8d9e09982"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-See recipe description for details. <hr><h2>Function Documentation</h2>
-<a class="anchor" name="g4abb403976fc3ddcaa614c59a44590c9"></a><!-- doxytag: member="fors_recipe.c::cpl_plugin_get_info" ref="g4abb403976fc3ddcaa614c59a44590c9" args="(cpl_pluginlist *list)" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_recipe Recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__recipe.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
+<tr class="memdesc:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#ga31d1fccd4cd15b1c1f3c5edc8cb18693">More...</a><br/></td></tr>
+<tr class="separator:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaccb93c75d494370cf0262930557dc4e2"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__recipe.html#gaccb93c75d494370cf0262930557dc4e2">fors_recipe_create</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:gaccb93c75d494370cf0262930557dc4e2"><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#gaccb93c75d494370cf0262930557dc4e2">More...</a><br/></td></tr>
+<tr class="separator:gaccb93c75d494370cf0262930557dc4e2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3a1716720583090ad664ae953d665d5b"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__recipe.html#ga3a1716720583090ad664ae953d665d5b">fors_recipe_exec</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga3a1716720583090ad664ae953d665d5b"><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#ga3a1716720583090ad664ae953d665d5b">More...</a><br/></td></tr>
+<tr class="separator:ga3a1716720583090ad664ae953d665d5b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga455905b384dd9b68150677beda6bcee1"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__recipe.html#ga455905b384dd9b68150677beda6bcee1">fors_recipe_destroy</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga455905b384dd9b68150677beda6bcee1"><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#ga455905b384dd9b68150677beda6bcee1">More...</a><br/></td></tr>
+<tr class="separator:ga455905b384dd9b68150677beda6bcee1"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>See recipe description for details. </p>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga31d1fccd4cd15b1c1f3c5edc8cb18693"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int cpl_plugin_get_info           </td>
+          <td class="memname">int cpl_plugin_get_info </td>
           <td>(</td>
-          <td class="paramtype">cpl_pluginlist * </td>
-          <td class="paramname"> <em>list</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_pluginlist * </td>
+          <td class="paramname"><em>list</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Build the list of available plugins, for this module. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>The plugin list</td></tr>
+</div><div class="memdoc">
+
+<p>Build the list of available plugins, for this module. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">list</td><td>The plugin list</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
-Create the recipe instance and make it available to the application using the interface. This function is exported. 
-<p>
-Definition at line <a class="el" href="fors__recipe_8c-source.html#l00062">62</a> of file <a class="el" href="fors__recipe_8c-source.html">fors_recipe.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__recipe_8c-source.html#l00109">fors_recipe_create()</a>, <a class="el" href="fors__recipe_8c-source.html#l00209">fors_recipe_destroy()</a>, and <a class="el" href="fors__recipe_8c-source.html#l00158">fors_recipe_exec()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<p>Create the recipe instance and make it available to the application using the interface. This function is exported. </p>
+
+<p>Definition at line <a class="el" href="fors__recipe_8c_source.html#l00062">62</a> of file <a class="el" href="fors__recipe_8c_source.html">fors_recipe.c</a>.</p>
+
+<p>References <a class="el" href="fors__utils_8c_source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__recipe_8c_source.html#l00109">fors_recipe_create()</a>, <a class="el" href="fors__recipe_8c_source.html#l00209">fors_recipe_destroy()</a>, and <a class="el" href="fors__recipe_8c_source.html#l00158">fors_recipe_exec()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g9de4437d5a4d68fdd594724e002b8388"></a><!-- doxytag: member="fors_recipe.c::fors_recipe_create" ref="g9de4437d5a4d68fdd594724e002b8388" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="gaccb93c75d494370cf0262930557dc4e2"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_recipe_create           </td>
+          <td class="memname">static int fors_recipe_create </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Setup the recipe options. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Setup the recipe options. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok</dd></dl>
-Defining the command-line/configuration parameters for the recipe. 
-<p>
-Definition at line <a class="el" href="fors__recipe_8c-source.html#l00109">109</a> of file <a class="el" href="fors__recipe_8c-source.html">fors_recipe.c</a>.
-<p>
-Referenced by <a class="el" href="fors__recipe_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok</dd></dl>
+<p>Defining the command-line/configuration parameters for the recipe. </p>
+
+<p>Definition at line <a class="el" href="fors__recipe_8c_source.html#l00109">109</a> of file <a class="el" href="fors__recipe_8c_source.html">fors_recipe.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__recipe_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g2e82215d74913efed45e3dce601076aa"></a><!-- doxytag: member="fors_recipe.c::fors_recipe_exec" ref="g2e82215d74913efed45e3dce601076aa" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="ga3a1716720583090ad664ae953d665d5b"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_recipe_exec           </td>
+          <td class="memname">static int fors_recipe_exec </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Execute the plugin instance given by the interface. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>the plugin</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Execute the plugin instance given by the interface. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>the plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__recipe_8c-source.html#l00158">158</a> of file <a class="el" href="fors__recipe_8c-source.html">fors_recipe.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00230">fors_begin()</a>, and <a class="el" href="fors__dfs_8c-source.html#l00258">fors_end()</a>.
-<p>
-Referenced by <a class="el" href="fors__recipe_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__recipe_8c_source.html#l00158">158</a> of file <a class="el" href="fors__recipe_8c_source.html">fors_recipe.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00230">fors_begin()</a>, and <a class="el" href="fors__dfs_8c_source.html#l00258">fors_end()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__recipe_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g351e58c2312f291e40fc17e8d9e09982"></a><!-- doxytag: member="fors_recipe.c::fors_recipe_destroy" ref="g351e58c2312f291e40fc17e8d9e09982" args="(cpl_plugin *plugin)" -->
+</div>
+<a class="anchor" id="ga455905b384dd9b68150677beda6bcee1"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_recipe_destroy           </td>
+          <td class="memname">static int fors_recipe_destroy </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Destroy what has been created by the 'create' function. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Destroy what has been created by the 'create' function. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
 
-<p>
-Definition at line <a class="el" href="fors__recipe_8c-source.html#l00209">209</a> of file <a class="el" href="fors__recipe_8c-source.html">fors_recipe.c</a>.
-<p>
-Referenced by <a class="el" href="fors__recipe_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<p>Definition at line <a class="el" href="fors__recipe_8c_source.html#l00209">209</a> of file <a class="el" href="fors__recipe_8c_source.html">fors_recipe.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__recipe_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__setting.html b/html/group__fors__setting.html
index 049611c..15cde73 100644
--- a/html/group__fors__setting.html
+++ b/html/group__fors__setting.html
@@ -1,242 +1,274 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Instrument setting</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Instrument setting</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting.html#gd72375aaa7f1199f3271f15afd724ded">fors_setting_new_level</a> (const cpl_frame *raw, cpl_msg_severity level)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create setting from FITS header.  <a href="#gd72375aaa7f1199f3271f15afd724ded"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__setting.html">fors_setting</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting.html#g7598470080174f400b75141530ad2c5a">fors_setting_new</a> (const cpl_frame *raw)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create setting from FITS header.  <a href="#g7598470080174f400b75141530ad2c5a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting.html#gccd3b501cb380066770b1250942fa02a">fors_setting_verify</a> (const <a class="el" href="struct__fors__setting.html">fors_setting</a> *ref_setting, const cpl_frame *frame, <a class="el" href="struct__fors__setting.html">fors_setting</a> **setting)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Verify that instrument settings are compatible.  <a href="#gccd3b501cb380066770b1250942fa02a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a> (<a class="el" href="struct__fors__setting.html">fors_setting</a> **s)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Deallocate and and set pointer to NULL.  <a href="#ge86af8a33ab13c7a2c294a2509b0c8d7"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_setting.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Instrument setting</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga05ebcfdde1706094627a0dd4af5186ae"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting.html#ga05ebcfdde1706094627a0dd4af5186ae">fors_setting_new_level</a> (const cpl_frame *raw, cpl_msg_severity level)</td></tr>
+<tr class="memdesc:ga05ebcfdde1706094627a0dd4af5186ae"><td class="mdescLeft"> </td><td class="mdescRight">Create setting from FITS header.  <a href="#ga05ebcfdde1706094627a0dd4af5186ae">More...</a><br/></td></tr>
+<tr class="separator:ga05ebcfdde1706094627a0dd4af5186ae"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab024c5bd5adc980985132e7fd9ff3b15"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__setting.html">fors_setting</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15">fors_setting_new</a> (const cpl_frame *raw)</td></tr>
+<tr class="memdesc:gab024c5bd5adc980985132e7fd9ff3b15"><td class="mdescLeft"> </td><td class="mdescRight">Create setting from FITS header.  <a href="#gab024c5bd5adc980985132e7fd9ff3b15">More...</a><br/></td></tr>
+<tr class="separator:gab024c5bd5adc980985132e7fd9ff3b15"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga160a93959e72b826426891ca8e0f80aa"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting.html#ga160a93959e72b826426891ca8e0f80aa">fors_setting_verify</a> (const <a class="el" href="struct__fors__setting.html">fors_setting</a> *ref_setting, const cpl_frame *frame, <a class="el" href="struct__fors__setting.html">fors_setting</a> **setting)</td></tr>
+<tr class="memdesc:ga160a93959e72b826426891ca8e0f80aa"><td class="mdescLeft"> </td><td class="mdescRight">Verify that instrument settings are compatible.  <a href="#ga160a93959e72b826426891ca8e0f80aa">More...</a><br/></td></tr>
+<tr class="separator:ga160a93959e72b826426891ca8e0f80aa"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6a9999a057167a310f81224d0218cb83"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting.html#ga6a9999a057167a310f81224d0218cb83">fors_setting_delete</a> (<a class="el" href="struct__fors__setting.html">fors_setting</a> **s)</td></tr>
+<tr class="memdesc:ga6a9999a057167a310f81224d0218cb83"><td class="mdescLeft"> </td><td class="mdescRight">Deallocate and and set pointer to NULL.  <a href="#ga6a9999a057167a310f81224d0218cb83">More...</a><br/></td></tr>
+<tr class="separator:ga6a9999a057167a310f81224d0218cb83"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_propertylist_delete(header); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__setting_8c_source.html#l00386">386</a> of file <a class="el" href="fors__setting_8c_source.html">fors_setting.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_propertylist_delete(header); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__setting_8c-source.html#l00386">386</a> of file <a class="el" href="fors__setting_8c-source.html">fors_setting.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_setting.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_setting_delete(&input_setting); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__setting_8c_source.html#l00386">386</a> of file <a class="el" href="fors__setting_8c_source.html">fors_setting.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&input_setting); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__setting_8c-source.html#l00386">386</a> of file <a class="el" href="fors__setting_8c-source.html">fors_setting.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="gd72375aaa7f1199f3271f15afd724ded"></a><!-- doxytag: member="fors_setting.c::fors_setting_new_level" ref="gd72375aaa7f1199f3271f15afd724ded" args="(const cpl_frame *raw, cpl_msg_severity level)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga05ebcfdde1706094627a0dd4af5186ae"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static <a class="el" href="struct__fors__setting.html">fors_setting</a> * fors_setting_new_level           </td>
+          <td class="memname">static <a class="el" href="struct__fors__setting.html">fors_setting</a> * fors_setting_new_level </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>raw</em>, </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>raw</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_msg_severity </td>
-          <td class="paramname"> <em>level</em></td><td> </td>
+          <td class="paramtype">cpl_msg_severity </td>
+          <td class="paramname"><em>level</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create setting from FITS header. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>raw</em> </td><td>raw frame </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>print instrument setting on this message level </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Create setting from FITS header. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">raw</td><td>raw frame </td></tr>
+    <tr><td class="paramname">level</td><td>print instrument setting on this message level </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated instrument setting </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__setting_8c-source.html#l00082">82</a> of file <a class="el" href="fors__setting_8c-source.html">fors_setting.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="test__simulate_8c-source.html#l00099">conad</a>, <a class="el" href="fors__dfs_8c-source.html#l00363">fors_dfs_pipeline_version()</a>, <a class="el" href="fors__pfits_8c-source.html#l00064">FORS_PFITS_BINX</a>, <a class="el" href="fors__pfits_8c-source.html#l00065">FORS_PFITS_BINY</a>, <a class="el" href="fors__pfits_8c-source [...]
-<p>
-Referenced by <a class="el" href="fors__setting_8c-source.html#l00064">fors_setting_new()</a>, and <a class="el" href="fors__setting_8c-source.html#l00401">fors_setting_verify()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated instrument setting </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__setting_8c_source.html#l00082">82</a> of file <a class="el" href="fors__setting_8c_source.html">fors_setting.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__dfs_8c_source.html#l00363">fors_dfs_pipeline_version()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__setting_8c_source.html#l00064">fors_setting_new()</a>, and <a class="el" href="fors__setting_8c_source.html#l00401">fors_setting_verify()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g7598470080174f400b75141530ad2c5a"></a><!-- doxytag: member="fors_setting.c::fors_setting_new" ref="g7598470080174f400b75141530ad2c5a" args="(const cpl_frame *raw)" -->
+</div>
+<a class="anchor" id="gab024c5bd5adc980985132e7fd9ff3b15"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__setting.html">fors_setting</a>* fors_setting_new           </td>
+          <td class="memname"><a class="el" href="struct__fors__setting.html">fors_setting</a>* fors_setting_new </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>raw</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>raw</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create setting from FITS header. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>raw</em> </td><td>raw frame </td></tr>
+</div><div class="memdoc">
+
+<p>Create setting from FITS header. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">raw</td><td>raw frame </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated instrument setting</dd></dl>
-The instrument setting is printed on the CPL_MSG_INFO level 
-<p>
-Definition at line <a class="el" href="fors__setting_8c-source.html#l00064">64</a> of file <a class="el" href="fors__setting_8c-source.html">fors_setting.c</a>.
-<p>
-References <a class="el" href="fors__setting_8c-source.html#l00082">fors_setting_new_level()</a>.
-<p>
-Referenced by <a class="el" href="fors__bias__impl_8c-source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00103">fors_dark()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry [...]
+<dl class="section return"><dt>Returns</dt><dd>newly allocated instrument setting</dd></dl>
+<p>The instrument setting is printed on the CPL_MSG_INFO level </p>
+
+<p>Definition at line <a class="el" href="fors__setting_8c_source.html#l00064">64</a> of file <a class="el" href="fors__setting_8c_source.html">fors_setting.c</a>.</p>
+
+<p>References <a class="el" href="fors__setting_8c_source.html#l00082">fors_setting_new_level()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias__impl_8c_source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c_source.html#l00103">fors_dark()</a>, <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photome [...]
+
 </div>
-</div><p>
-<a class="anchor" name="gccd3b501cb380066770b1250942fa02a"></a><!-- doxytag: member="fors_setting.c::fors_setting_verify" ref="gccd3b501cb380066770b1250942fa02a" args="(const fors_setting *ref_setting, const cpl_frame *frame, fors_setting **setting)" -->
+</div>
+<a class="anchor" id="ga160a93959e72b826426891ca8e0f80aa"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_setting_verify           </td>
+          <td class="memname">void fors_setting_verify </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>ref_setting</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>ref_setting</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>frame</em>, </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>frame</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype"><a class="el" href="struct__fors__setting.html">fors_setting</a> ** </td>
-          <td class="paramname"> <em>setting</em></td><td> </td>
+          <td class="paramtype"><a class="el" href="struct__fors__setting.html">fors_setting</a> ** </td>
+          <td class="paramname"><em>setting</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Verify that instrument settings are compatible. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>ref_setting</em> </td><td>reference to compare with </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>frame</em> </td><td>input frame </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>(output) if non-NULL, the input frame setting is returned</td></tr>
+</div><div class="memdoc">
+
+<p>Verify that instrument settings are compatible. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">ref_setting</td><td>reference to compare with </td></tr>
+    <tr><td class="paramname">frame</td><td>input frame </td></tr>
+    <tr><td class="paramname">setting</td><td>(output) if non-NULL, the input frame setting is returned</td></tr>
   </table>
+  </dd>
 </dl>
-If the instrument settings are incompatible, a warning is printed but the function does not fail 
-<p>
-Definition at line <a class="el" href="fors__setting_8c-source.html#l00401">401</a> of file <a class="el" href="fors__setting_8c-source.html">fors_setting.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__setting_8h-source.html#l00067">_fors_setting::average_gain</a>, <a class="el" href="fors__setting_8h-source.html#l00049">_fors_setting::binx</a>, <a class="el" href="fors__setting_8h-source.html#l00049">_fors_setting::biny</a>, <a class="el" href="fors__setting_8h-source.html#l00074">_fors_setting::chip_id</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class= [...]
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l00349">fors_image_load()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l02756">fors_photometry_read_input()</a>.
+<p>If the instrument settings are incompatible, a warning is printed but the function does not fail </p>
+
+<p>Definition at line <a class="el" href="fors__setting_8c_source.html#l00401">401</a> of file <a class="el" href="fors__setting_8c_source.html">fors_setting.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__setting_8c_source.html#l00082">fors_setting_new_level()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__image_8c_source.html#l00352">fors_image_load()</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l02698">fors_photometry_read_input()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ge86af8a33ab13c7a2c294a2509b0c8d7"></a><!-- doxytag: member="fors_setting.c::fors_setting_delete" ref="ge86af8a33ab13c7a2c294a2509b0c8d7" args="(fors_setting **s)" -->
+<a class="anchor" id="ga6a9999a057167a310f81224d0218cb83"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_setting_delete           </td>
+          <td class="memname">void fors_setting_delete </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__setting.html">fors_setting</a> ** </td>
-          <td class="paramname"> <em>s</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype"><a class="el" href="struct__fors__setting.html">fors_setting</a> ** </td>
+          <td class="paramname"><em>s</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Deallocate and and set pointer to NULL. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>setting to delete </td></tr>
+</div><div class="memdoc">
+
+<p>Deallocate and and set pointer to NULL. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>setting to delete </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__setting_8c-source.html#l00498">498</a> of file <a class="el" href="fors__setting_8c-source.html">fors_setting.c</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l02756">fors_photometry_read_input()</a>.
+<p>Definition at line <a class="el" href="fors__setting_8c_source.html#l00498">498</a> of file <a class="el" href="fors__setting_8c_source.html">fors_setting.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l02698">fors_photometry_read_input()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__setting__test.html b/html/group__fors__setting__test.html
index 34e12cf..d2c5345 100644
--- a/html/group__fors__setting__test.html
+++ b/html/group__fors__setting__test.html
@@ -1,57 +1,92 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Instrument setting</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Instrument setting</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g718b4121a26b3a17c0adb661e427ae39"></a><!-- doxytag: member="fors_setting_test::test_setting" ref="g718b4121a26b3a17c0adb661e427ae39" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting__test.html#g718b4121a26b3a17c0adb661e427ae39">test_setting</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test instrument setting. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_setting_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of image setting module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_setting-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Instrument setting</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gafa8c7ae8a3758428e457eb26c91c0da7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafa8c7ae8a3758428e457eb26c91c0da7"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting__test.html#gafa8c7ae8a3758428e457eb26c91c0da7">test_setting</a> (void)</td></tr>
+<tr class="memdesc:gafa8c7ae8a3758428e457eb26c91c0da7"><td class="mdescLeft"> </td><td class="mdescRight">Test instrument setting. <br/></td></tr>
+<tr class="separator:gafa8c7ae8a3758428e457eb26c91c0da7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__setting__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of image setting module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    cpl_frame_delete(sflat); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__setting-test_8c_source.html#l00048">48</a> of file <a class="el" href="fors__setting-test_8c_source.html">fors_setting-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    cpl_frame_delete(sflat); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__setting-test_8c-source.html#l00048">48</a> of file <a class="el" href="fors__setting-test_8c-source.html">fors_setting-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__stack.html b/html/group__fors__stack.html
index b76baf5..d80bab9 100644
--- a/html/group__fors__stack.html
+++ b/html/group__fors__stack.html
@@ -1,293 +1,322 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Image stacking</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Image stacking</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_stack::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a> (cpl_parameterlist *parameters, const char *context, const char *default_method)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#g0f1453e93c9e8d66e79fb5f8efcda989"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">stack_method * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af">fors_stack_method_new</a> (const cpl_parameterlist *parameters, const char *context)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get stack method from parameter list.  <a href="#g08c73c19db5c7016279f1c771595e7af"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13">fors_stack_method_delete</a> (stack_method **sm)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor.  <a href="#g2a1deb2be3899390d3ad567725a53e13"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#g245b26490c31d54735bae3f76345b365">fors_stack_method_get_string</a> (const stack_method *sm)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Stack method as string.  <a href="#g245b26490c31d54735bae3f76345b365"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac">fors_stack_const</a> (const fors_image_list *images, const stack_method *sm)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Stack images.  <a href="#gdb3cdc182c4f875222b11aa33e1699ac"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g1fd9044444484f1ee859abd3101ce8b4"></a><!-- doxytag: member="fors_stack::fors_stack" ref="g1fd9044444484f1ee859abd3101ce8b4" args="(fors_image_list *images, const stack_method *sm)" -->
-<a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#g1fd9044444484f1ee859abd3101ce8b4">fors_stack</a> (fors_image_list *images, const stack_method *sm)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Same as fors_stack_const(). <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Image stacking</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gaffedf6eb66366c19b2d7ac5443000d15"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15">fors_stack_define_parameters</a> (cpl_parameterlist *parameters, const char *context, const char *default_method)</td></tr>
+<tr class="memdesc:gaffedf6eb66366c19b2d7ac5443000d15"><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#gaffedf6eb66366c19b2d7ac5443000d15">More...</a><br/></td></tr>
+<tr class="separator:gaffedf6eb66366c19b2d7ac5443000d15"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga88dc5c52ed64ac4911335ffd06fa389e"><td class="memItemLeft" align="right" valign="top">stack_method * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e">fors_stack_method_new</a> (const cpl_parameterlist *parameters, const char *context)</td></tr>
+<tr class="memdesc:ga88dc5c52ed64ac4911335ffd06fa389e"><td class="mdescLeft"> </td><td class="mdescRight">Get stack method from parameter list.  <a href="#ga88dc5c52ed64ac4911335ffd06fa389e">More...</a><br/></td></tr>
+<tr class="separator:ga88dc5c52ed64ac4911335ffd06fa389e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9b1d85fcb31770b51259b8aa24c47ae2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#ga9b1d85fcb31770b51259b8aa24c47ae2">fors_stack_method_delete</a> (stack_method **sm)</td></tr>
+<tr class="memdesc:ga9b1d85fcb31770b51259b8aa24c47ae2"><td class="mdescLeft"> </td><td class="mdescRight">Destructor.  <a href="#ga9b1d85fcb31770b51259b8aa24c47ae2">More...</a><br/></td></tr>
+<tr class="separator:ga9b1d85fcb31770b51259b8aa24c47ae2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5b92c215ed81d61bc8718b55e604ebc2"><td class="memItemLeft" align="right" valign="top">static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#ga5b92c215ed81d61bc8718b55e604ebc2">fors_stack_method_get_string</a> (const stack_method *sm)</td></tr>
+<tr class="memdesc:ga5b92c215ed81d61bc8718b55e604ebc2"><td class="mdescLeft"> </td><td class="mdescRight">Stack method as string.  <a href="#ga5b92c215ed81d61bc8718b55e604ebc2">More...</a><br/></td></tr>
+<tr class="separator:ga5b92c215ed81d61bc8718b55e604ebc2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5d87fc29a7abf6186c6d3090cd5a53cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc">fors_stack_const</a> (const fors_image_list *images, const stack_method *sm)</td></tr>
+<tr class="memdesc:ga5d87fc29a7abf6186c6d3090cd5a53cc"><td class="mdescLeft"> </td><td class="mdescRight">Stack images.  <a href="#ga5d87fc29a7abf6186c6d3090cd5a53cc">More...</a><br/></td></tr>
+<tr class="separator:ga5d87fc29a7abf6186c6d3090cd5a53cc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6792068e2f3a973ad54722120779feb1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6792068e2f3a973ad54722120779feb1"></a>
+<a class="el" href="struct__fors__image.html">fors_image</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack.html#ga6792068e2f3a973ad54722120779feb1">fors_stack</a> (fors_image_list *images, const stack_method *sm)</td></tr>
+<tr class="memdesc:ga6792068e2f3a973ad54722120779feb1"><td class="mdescLeft"> </td><td class="mdescRight">Same as <a class="el" href="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc" title="Stack images.">fors_stack_const()</a> <br/></td></tr>
+<tr class="separator:ga6792068e2f3a973ad54722120779feb1"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_stack.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)name); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__stack_8c_source.html#l00288">288</a> of file <a class="el" href="fors__stack_8c_source.html">fors_stack.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_free((<span class="keywordtype">void</span> *)name); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__stack_8c-source.html#l00288">288</a> of file <a class="el" href="fors__stack_8c-source.html">fors_stack.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_stack.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__stack_8c_source.html#l00288">288</a> of file <a class="el" href="fors__stack_8c_source.html">fors_stack.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__stack_8c-source.html#l00288">288</a> of file <a class="el" href="fors__stack_8c-source.html">fors_stack.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g0f1453e93c9e8d66e79fb5f8efcda989"></a><!-- doxytag: member="fors_stack.c::fors_stack_define_parameters" ref="g0f1453e93c9e8d66e79fb5f8efcda989" args="(cpl_parameterlist *parameters, const char *context, const char *default_method)" -->
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gaffedf6eb66366c19b2d7ac5443000d15"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_stack_define_parameters           </td>
+          <td class="memname">void fors_stack_define_parameters </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>, </td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>context</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>context</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>default_method</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>default_method</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Define recipe parameters. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameter list to fill </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>parameters context </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>default_method</em> </td><td>default stack method </td></tr>
+<p>Define recipe parameters. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>parameter list to fill </td></tr>
+    <tr><td class="paramname">context</td><td>parameters context </td></tr>
+    <tr><td class="paramname">default_method</td><td>default stack method </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__stack_8c-source.html#l00055">55</a> of file <a class="el" href="fors__stack_8c-source.html">fors_stack.c</a>.
-<p>
-Referenced by <a class="el" href="fors__bias__impl_8c-source.html#l00078">fors_bias_define_parameters()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00071">fors_dark_define_parameters()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00096">fors_img_screen_flat_define_parameters()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00065">fors_img_sky_flat_define_parameters()</a>, and <a class="el" href="fors__stack-test_8c-source.html# [...]
+<p>Definition at line <a class="el" href="fors__stack_8c_source.html#l00055">55</a> of file <a class="el" href="fors__stack_8c_source.html">fors_stack.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias__impl_8c_source.html#l00078">fors_bias_define_parameters()</a>, <a class="el" href="fors__dark__impl_8c_source.html#l00071">fors_dark_define_parameters()</a>, <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00096">fors_img_screen_flat_define_parameters()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00065">fors_img_sky_flat_define_parameters()</a>, and <a class="el" href="fors__stack-test_8c_source.ht [...]
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g08c73c19db5c7016279f1c771595e7af"></a><!-- doxytag: member="fors_stack.c::fors_stack_method_new" ref="g08c73c19db5c7016279f1c771595e7af" args="(const cpl_parameterlist *parameters, const char *context)" -->
+<a class="anchor" id="ga88dc5c52ed64ac4911335ffd06fa389e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">stack_method* fors_stack_method_new           </td>
+          <td class="memname">stack_method* fors_stack_method_new </td>
           <td>(</td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>context</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>context</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get stack method from parameter list. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>recipe parameter list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>read stack method from this context </td></tr>
+<p>Get stack method from parameter list. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>recipe parameter list </td></tr>
+    <tr><td class="paramname">context</td><td>read stack method from this context </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated opaque stack method</dd></dl>
-The parameter list should have been previously created using <a class="el" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters()</a> 
-<p>
-Definition at line <a class="el" href="fors__stack_8c-source.html#l00157">157</a> of file <a class="el" href="fors__stack_8c-source.html">fors_stack.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__dfs_8c-source.html#l00819">dfs_get_parameter_double_const()</a>, <a class="el" href="fors__dfs_8c-source.html#l00809">dfs_get_parameter_int_const()</a>, and <a class="el" href="fors__dfs_8c-source.html#l00829">dfs_get_parameter_string_const()</a>.
-<p>
-Referenced by <a class="el" href="fors__bias__impl_8c-source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00103">fors_dark()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, and <a class="el" href="fors__stack-test_8c-source.html#l00060">test_stack()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated opaque stack method</dd></dl>
+<p>The parameter list should have been previously created using <a class="el" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15" title="Define recipe parameters.">fors_stack_define_parameters()</a> </p>
+
+<p>Definition at line <a class="el" href="fors__stack_8c_source.html#l00157">157</a> of file <a class="el" href="fors__stack_8c_source.html">fors_stack.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__dfs_8c_source.html#l00819">dfs_get_parameter_double_const()</a>, <a class="el" href="fors__dfs_8c_source.html#l00809">dfs_get_parameter_int_const()</a>, and <a class="el" href="fors__dfs_8c_source.html#l00829">dfs_get_parameter_string_const()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias__impl_8c_source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c_source.html#l00103">fors_dark()</a>, <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, and <a class="el" href="fors__stack-test_8c_source.html#l00060">test_stack()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g2a1deb2be3899390d3ad567725a53e13"></a><!-- doxytag: member="fors_stack.c::fors_stack_method_delete" ref="g2a1deb2be3899390d3ad567725a53e13" args="(stack_method **sm)" -->
+</div>
+<a class="anchor" id="ga9b1d85fcb31770b51259b8aa24c47ae2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_stack_method_delete           </td>
+          <td class="memname">void fors_stack_method_delete </td>
           <td>(</td>
-          <td class="paramtype">stack_method ** </td>
-          <td class="paramname"> <em>sm</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">stack_method ** </td>
+          <td class="paramname"><em>sm</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Destructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>sm</em> </td><td>object to delete </td></tr>
+<p>Destructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">sm</td><td>object to delete </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__stack_8c-source.html#l00265">265</a> of file <a class="el" href="fors__stack_8c-source.html">fors_stack.c</a>.
-<p>
-Referenced by <a class="el" href="fors__stack-test_8c-source.html#l00060">test_stack()</a>.
+<p>Definition at line <a class="el" href="fors__stack_8c_source.html#l00265">265</a> of file <a class="el" href="fors__stack_8c_source.html">fors_stack.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__stack-test_8c_source.html#l00060">test_stack()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g245b26490c31d54735bae3f76345b365"></a><!-- doxytag: member="fors_stack.c::fors_stack_method_get_string" ref="g245b26490c31d54735bae3f76345b365" args="(const stack_method *sm)" -->
+<a class="anchor" id="ga5b92c215ed81d61bc8718b55e604ebc2"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static const char* fors_stack_method_get_string           </td>
+          <td class="memname">static const char* fors_stack_method_get_string </td>
           <td>(</td>
-          <td class="paramtype">const stack_method * </td>
-          <td class="paramname"> <em>sm</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">const stack_method * </td>
+          <td class="paramname"><em>sm</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Stack method as string. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>sm</em> </td><td>stack method </td></tr>
+<p>Stack method as string. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">sm</td><td>stack method </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>textual representation of the provided stack method </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>textual representation of the provided stack method </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__stack_8c_source.html#l00280">280</a> of file <a class="el" href="fors__stack_8c_source.html">fors_stack.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__stack_8c-source.html#l00280">280</a> of file <a class="el" href="fors__stack_8c-source.html">fors_stack.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__stack_8c-source.html#l00298">fors_stack_const()</a>.
+<p>Referenced by <a class="el" href="fors__stack_8c_source.html#l00298">fors_stack_const()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gdb3cdc182c4f875222b11aa33e1699ac"></a><!-- doxytag: member="fors_stack.c::fors_stack_const" ref="gdb3cdc182c4f875222b11aa33e1699ac" args="(const fors_image_list *images, const stack_method *sm)" -->
+<a class="anchor" id="ga5d87fc29a7abf6186c6d3090cd5a53cc"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_stack_const           </td>
+          <td class="memname"><a class="el" href="struct__fors__image.html">fors_image</a>* fors_stack_const </td>
           <td>(</td>
-          <td class="paramtype">const fors_image_list * </td>
-          <td class="paramname"> <em>images</em>, </td>
+          <td class="paramtype">const fors_image_list * </td>
+          <td class="paramname"><em>images</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const stack_method * </td>
-          <td class="paramname"> <em>sm</em></td><td> </td>
+          <td class="paramtype">const stack_method * </td>
+          <td class="paramname"><em>sm</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Stack images. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>images</em> </td><td>list of images to stack </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sm</em> </td><td>stacking method </td></tr>
+<p>Stack images. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">images</td><td>list of images to stack </td></tr>
+    <tr><td class="paramname">sm</td><td>stacking method </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>master images stacked using the specified method </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>master images stacked using the specified method </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__stack_8c_source.html#l00298">298</a> of file <a class="el" href="fors__stack_8c_source.html">fors_stack.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__image_8c_source.html#l01674">fors_image_collapse_create()</a>, <a class="el" href="fors__image_8c_source.html#l01796">fors_image_collapse_ksigma_create()</a>, <a class="el" href="fors__image_8c_source.html#l01848">fors_image_collapse_median_create()</a>, <a class="el" href="fors__image_8c_source.html#l01740">fors_image_collapse_minmax_create()</a>, and <a class="el" href="fors__stack_8c_so [...]
 
-<p>
-Definition at line <a class="el" href="fors__stack_8c-source.html#l00298">298</a> of file <a class="el" href="fors__stack_8c-source.html">fors_stack.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__image_8c-source.html#l01665">fors_image_collapse_create()</a>, <a class="el" href="fors__image_8c-source.html#l01787">fors_image_collapse_ksigma_create()</a>, <a class="el" href="fors__image_8c-source.html#l01839">fors_image_collapse_median_create()</a>, <a class="el" href="fors__image_8c-source.html#l01731">fors_image_collapse_minmax_create()</a>, and <a class="el" href="fors__stack_8c-sourc [...]
-<p>
-Referenced by <a class="el" href="fors__bias__impl_8c-source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00103">fors_dark()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__stack_8c-source.html#l00344">fors_stack()</a>, and <a class="el" href="fors__stack-test_8c-source.html#l00060">test_stack()</a>.
+<p>Referenced by <a class="el" href="fors__bias__impl_8c_source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c_source.html#l00103">fors_dark()</a>, <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__stack_8c_source.html#l00344">fors_stack()</a>, and <a class="el" href="fors__stack-test_8c_source.html#l00060">test_stack()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__stack__test.html b/html/group__fors__stack__test.html
index 767ea50..ab0b745 100644
--- a/html/group__fors__stack__test.html
+++ b/html/group__fors__stack__test.html
@@ -1,60 +1,95 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Test image stacking</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Test image stacking</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gebc137d2e81f7bcda320a7f92beca077"></a><!-- doxytag: member="fors_stack_test::test_stack" ref="gebc137d2e81f7bcda320a7f92beca077" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack__test.html#gebc137d2e81f7bcda320a7f92beca077">test_stack</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test image i/o + stacking. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_stack_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of image stacking module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_stack-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Test image stacking</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gafae5d1fcc553808ac2e0c37908648cac"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafae5d1fcc553808ac2e0c37908648cac"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack__test.html#gafae5d1fcc553808ac2e0c37908648cac">test_stack</a> (void)</td></tr>
+<tr class="memdesc:gafae5d1fcc553808ac2e0c37908648cac"><td class="mdescLeft"> </td><td class="mdescRight">Test image i/o + stacking. <br/></td></tr>
+<tr class="separator:gafae5d1fcc553808ac2e0c37908648cac"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__stack__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of image stacking module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(raw); \</div>
+<div class="line">    fors_stack_method_delete(&sm); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    cpl_parameterlist_delete(parameters); \</div>
+<div class="line">    fors_image_list_delete_const(&ilist, <a class="code" href="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad" title="Deallocate image and set pointer to NULL.">fors_image_delete</a>); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__stack-test_8c_source.html#l00047">47</a> of file <a class="el" href="fors__stack-test_8c_source.html">fors_stack-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(raw); \
-    <a class="code" href="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13">fors_stack_method_delete</a>(&sm); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    cpl_parameterlist_delete(parameters); \
-    fors_image_list_delete_const(&ilist, <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__stack-test_8c-source.html#l00047">47</a> of file <a class="el" href="fors__stack-test_8c-source.html">fors_stack-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__star.html b/html/group__fors__star.html
index 8683174..210ba37 100644
--- a/html/group__fors__star.html
+++ b/html/group__fors__star.html
@@ -1,1084 +1,1078 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: star</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>star</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>   fors_star_delete(&s)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb79164ea3a1118352c6ca0ea9a9840ea"></a><!-- doxytag: member="fors_star::LIST_DEFINE" ref="gb79164ea3a1118352c6ca0ea9a9840ea" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9d7995a21a54c1d39a0bc87d7f498029"></a><!-- doxytag: member="fors_star::LIST_ELEM" ref="g9d7995a21a54c1d39a0bc87d7f498029" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g9d7995a21a54c1d39a0bc87d7f498029">LIST_ELEM</a>   <a class="el" href="struct__fors__star.html">fors_star</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23">_get_optional_table_value</a> (const cpl_table *tab, unsigned int row, const char *colname)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a double value from a table.  <a href="#ge16bb0528b96ccf4cf953a1bce835b23"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__star.html">fors_star</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g548c477088fd4fbadd74fd84f3becb94">fors_star_new</a> (double x, double y, double fwhm, double smajor, double sminor, double orientation, double m, double dm, double si)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor.  <a href="#g548c477088fd4fbadd74fd84f3becb94"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__star.html">fors_star</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#gec880ac28409dd535ec3138e0b5b001c">fors_star_new_from_table</a> (const cpl_table *tab, unsigned int row, const char *x_col, const char *y_col, const char *fwhm_col, const char *smaj_col, const char *smin_col, const char *theta_col, const char *mag_col, const char *dmag_col,  [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a star from a table WITHOUT checking.  <a href="#gec880ac28409dd535ec3138e0b5b001c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g1ef535783913303ad950792cdd1d59c8">fors_star_check_values</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *star)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor.  <a href="#g1ef535783913303ad950792cdd1d59c8"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct__fors__star.html">fors_star</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62">fors_star_duplicate</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *star)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor.  <a href="#g0505b201c585e91e65e968e84d2c1e62"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a> (<a class="el" href="struct__fors__star.html">fors_star</a> **star)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete object and set pointer to NULL.  <a href="#ga60434ffb49dd362b252cd2fb31d8787"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g40fa6037fee74abd5a9d5166137609e0">fors_star_delete_but_standard</a> (<a class="el" href="struct__fors__star.html">fors_star</a> **star)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete object and set pointer to NULL - but ignore the standard star.  <a href="#g40fa6037fee74abd5a9d5166137609e0"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98">fors_star_equal</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, const <a class="el" href="struct__fors__star.html">fors_star</a> *t)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test for equality.  <a href="#g9c8d5a74ebe2cbcd3fdde0186eef7b98"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g100f4290bf02ce348f22092f4e2bc3eb">fors_star_brighter_than</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s1, const <a class="el" href="struct__fors__star.html">fors_star</a> *s2, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare star brightness.  <a href="#g100f4290bf02ce348f22092f4e2bc3eb"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g21eca2e7981ea38bc0b5a66edfc56bb9">fors_star_distsq</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, const <a class="el" href="struct__fors__star.html">fors_star</a> *t)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get distance between stars.  <a href="#g21eca2e7981ea38bc0b5a66edfc56bb9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g4f81e6410fe5c7aefbdbcae907095059">fors_star_extension</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get star size.  <a href="#g4f81e6410fe5c7aefbdbcae907095059"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g310c2402602378a7505a36a85ee98c7b">fors_star_stellarity</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get star stellarity.  <a href="#g310c2402602378a7505a36a85ee98c7b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#gdef23fa2c1ad1c4f2b0de18038b0daca">fors_star_ellipticity</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get star ellipticity.  <a href="#gdef23fa2c1ad1c4f2b0de18038b0daca"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g89b5801d41c9760d82ec12097e14b584">fors_star_print</a> (cpl_msg_severity level, const <a class="el" href="struct__fors__star.html">fors_star</a> *s)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Print object.  <a href="#g89b5801d41c9760d82ec12097e14b584"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g8ab50c70291d9ed66d075ce9ae93577d">fors_star_print_list</a> (cpl_msg_severity level, const fors_star_list *sl)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Print list of stars.  <a href="#g8ab50c70291d9ed66d075ce9ae93577d"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0">fors_star_get_x</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get position.  <a href="#gf5098d0eb78be73a27de34f0a9b7e9b0"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e">fors_star_get_y</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get position.  <a href="#g724787234aa813e44d2aa7a6cae46b3e"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#gb718ac03773576fc6856847b4211ffba">fors_star_get_zeropoint</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get zeropoint.  <a href="#gb718ac03773576fc6856847b4211ffba"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g22fc7f95537194266794e24345cdda0b">fors_star_get_zeropoint_err</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get zeropoint error.  <a href="#g22fc7f95537194266794e24345cdda0b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#g41b7ffa8530d0ffbc45916248663ac45">fors_star_is_identified</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Determine if star was identified.  <a href="#g41b7ffa8530d0ffbc45916248663ac45"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-A data type used to represent stars on a CCD (position, magnitude, etc.) <hr><h2>Function Documentation</h2>
-<a class="anchor" name="ge16bb0528b96ccf4cf953a1bce835b23"></a><!-- doxytag: member="fors_star.c::_get_optional_table_value" ref="ge16bb0528b96ccf4cf953a1bce835b23" args="(const cpl_table *tab, unsigned int row, const char *colname)" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">star</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b>   <a class="el" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774">fors_star_delete</a>(&s)</td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac0830324b91c374088872a18c876bc34"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac0830324b91c374088872a18c876bc34"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>LIST_DEFINE</b></td></tr>
+<tr class="separator:gac0830324b91c374088872a18c876bc34"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadb231bfc44ec37423962ea7f563a458b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gadb231bfc44ec37423962ea7f563a458b"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>LIST_ELEM</b>   <a class="el" href="struct__fors__star.html">fors_star</a></td></tr>
+<tr class="separator:gadb231bfc44ec37423962ea7f563a458b"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gaab4c629c0b0fafb228595b124b93cfd8"><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8">_get_optional_table_value</a> (const cpl_table *tab, unsigned int row, const char *colname)</td></tr>
+<tr class="memdesc:gaab4c629c0b0fafb228595b124b93cfd8"><td class="mdescLeft"> </td><td class="mdescRight">Get a double value from a table.  <a href="#gaab4c629c0b0fafb228595b124b93cfd8">More...</a><br/></td></tr>
+<tr class="separator:gaab4c629c0b0fafb228595b124b93cfd8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7a8b2a60d5685524ffbb762e066c9b01"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__star.html">fors_star</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga7a8b2a60d5685524ffbb762e066c9b01">fors_star_new</a> (double x, double y, double fwhm, double smajor, double sminor, double orientation, double m, double dm, double si)</td></tr>
+<tr class="memdesc:ga7a8b2a60d5685524ffbb762e066c9b01"><td class="mdescLeft"> </td><td class="mdescRight">Constructor.  <a href="#ga7a8b2a60d5685524ffbb762e066c9b01">More...</a><br/></td></tr>
+<tr class="separator:ga7a8b2a60d5685524ffbb762e066c9b01"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5be8cd6931b5f998692daaf65bcf9755"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__star.html">fors_star</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga5be8cd6931b5f998692daaf65bcf9755">fors_star_new_from_table</a> (const cpl_table *tab, unsigned int row, const char *x_col, const char *y_col, const char *fwhm_col, const char *smaj_col, const char *smin_col, const char *theta_col [...]
+<tr class="memdesc:ga5be8cd6931b5f998692daaf65bcf9755"><td class="mdescLeft"> </td><td class="mdescRight">Create a star from a table WITHOUT checking.  <a href="#ga5be8cd6931b5f998692daaf65bcf9755">More...</a><br/></td></tr>
+<tr class="separator:ga5be8cd6931b5f998692daaf65bcf9755"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga279f39755ddfa24ee9cfad4a03c01cf3"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga279f39755ddfa24ee9cfad4a03c01cf3">fors_star_check_values</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *star)</td></tr>
+<tr class="memdesc:ga279f39755ddfa24ee9cfad4a03c01cf3"><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor.  <a href="#ga279f39755ddfa24ee9cfad4a03c01cf3">More...</a><br/></td></tr>
+<tr class="separator:ga279f39755ddfa24ee9cfad4a03c01cf3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga43a9682d94e1abc97300b00973b2291a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__fors__star.html">fors_star</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a">fors_star_duplicate</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *star)</td></tr>
+<tr class="memdesc:ga43a9682d94e1abc97300b00973b2291a"><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor.  <a href="#ga43a9682d94e1abc97300b00973b2291a">More...</a><br/></td></tr>
+<tr class="separator:ga43a9682d94e1abc97300b00973b2291a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga77f698ef0a6eb8bc4c4919b3d1aa6774"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774">fors_star_delete</a> (<a class="el" href="struct__fors__star.html">fors_star</a> **star)</td></tr>
+<tr class="memdesc:ga77f698ef0a6eb8bc4c4919b3d1aa6774"><td class="mdescLeft"> </td><td class="mdescRight">Delete object and set pointer to NULL.  <a href="#ga77f698ef0a6eb8bc4c4919b3d1aa6774">More...</a><br/></td></tr>
+<tr class="separator:ga77f698ef0a6eb8bc4c4919b3d1aa6774"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga517c8c542ad4eb8145fa664be9625a98"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga517c8c542ad4eb8145fa664be9625a98">fors_star_delete_but_standard</a> (<a class="el" href="struct__fors__star.html">fors_star</a> **star)</td></tr>
+<tr class="memdesc:ga517c8c542ad4eb8145fa664be9625a98"><td class="mdescLeft"> </td><td class="mdescRight">Delete object and set pointer to NULL - but ignore the standard star.  <a href="#ga517c8c542ad4eb8145fa664be9625a98">More...</a><br/></td></tr>
+<tr class="separator:ga517c8c542ad4eb8145fa664be9625a98"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7704963eef38129e5f83e5b9eae36bc1"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1">fors_star_equal</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, const <a class="el" href="struct__fors__star.html">fors_star</a> *t)</td></tr>
+<tr class="memdesc:ga7704963eef38129e5f83e5b9eae36bc1"><td class="mdescLeft"> </td><td class="mdescRight">Test for equality.  <a href="#ga7704963eef38129e5f83e5b9eae36bc1">More...</a><br/></td></tr>
+<tr class="separator:ga7704963eef38129e5f83e5b9eae36bc1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7672a63fe0deea93cb8bae8362b6d020"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga7672a63fe0deea93cb8bae8362b6d020">fors_star_brighter_than</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s1, const <a class="el" href="struct__fors__star.html">fors_star</a> *s2, void *data)</td></tr>
+<tr class="memdesc:ga7672a63fe0deea93cb8bae8362b6d020"><td class="mdescLeft"> </td><td class="mdescRight">Compare star brightness.  <a href="#ga7672a63fe0deea93cb8bae8362b6d020">More...</a><br/></td></tr>
+<tr class="separator:ga7672a63fe0deea93cb8bae8362b6d020"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga53496a5c3e6810c6c59d221120df422b"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga53496a5c3e6810c6c59d221120df422b">fors_star_distsq</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, const <a class="el" href="struct__fors__star.html">fors_star</a> *t)</td></tr>
+<tr class="memdesc:ga53496a5c3e6810c6c59d221120df422b"><td class="mdescLeft"> </td><td class="mdescRight">Get distance between stars.  <a href="#ga53496a5c3e6810c6c59d221120df422b">More...</a><br/></td></tr>
+<tr class="separator:ga53496a5c3e6810c6c59d221120df422b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2c97d2c47686016fa04c59b2a3e92b5c"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga2c97d2c47686016fa04c59b2a3e92b5c">fors_star_extension</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
+<tr class="memdesc:ga2c97d2c47686016fa04c59b2a3e92b5c"><td class="mdescLeft"> </td><td class="mdescRight">Get star size.  <a href="#ga2c97d2c47686016fa04c59b2a3e92b5c">More...</a><br/></td></tr>
+<tr class="separator:ga2c97d2c47686016fa04c59b2a3e92b5c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga67451b955667ae4f965146aee484c6bc"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga67451b955667ae4f965146aee484c6bc">fors_star_stellarity</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
+<tr class="memdesc:ga67451b955667ae4f965146aee484c6bc"><td class="mdescLeft"> </td><td class="mdescRight">Get star stellarity.  <a href="#ga67451b955667ae4f965146aee484c6bc">More...</a><br/></td></tr>
+<tr class="separator:ga67451b955667ae4f965146aee484c6bc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9e7994d44acbe88580cab63d3662df40"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga9e7994d44acbe88580cab63d3662df40">fors_star_ellipticity</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
+<tr class="memdesc:ga9e7994d44acbe88580cab63d3662df40"><td class="mdescLeft"> </td><td class="mdescRight">Get star ellipticity.  <a href="#ga9e7994d44acbe88580cab63d3662df40">More...</a><br/></td></tr>
+<tr class="separator:ga9e7994d44acbe88580cab63d3662df40"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3443159e600f23336b266f7b557f4ea0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga3443159e600f23336b266f7b557f4ea0">fors_star_print</a> (cpl_msg_severity level, const <a class="el" href="struct__fors__star.html">fors_star</a> *s)</td></tr>
+<tr class="memdesc:ga3443159e600f23336b266f7b557f4ea0"><td class="mdescLeft"> </td><td class="mdescRight">Print object.  <a href="#ga3443159e600f23336b266f7b557f4ea0">More...</a><br/></td></tr>
+<tr class="separator:ga3443159e600f23336b266f7b557f4ea0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4e15f3d1dbd18c8e010dc4ef82401d7d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga4e15f3d1dbd18c8e010dc4ef82401d7d">fors_star_print_list</a> (cpl_msg_severity level, const fors_star_list *sl)</td></tr>
+<tr class="memdesc:ga4e15f3d1dbd18c8e010dc4ef82401d7d"><td class="mdescLeft"> </td><td class="mdescRight">Print list of stars.  <a href="#ga4e15f3d1dbd18c8e010dc4ef82401d7d">More...</a><br/></td></tr>
+<tr class="separator:ga4e15f3d1dbd18c8e010dc4ef82401d7d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabd3cf1f281e1cfdb35d8a7fbde6c1165"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165">fors_star_get_x</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
+<tr class="memdesc:gabd3cf1f281e1cfdb35d8a7fbde6c1165"><td class="mdescLeft"> </td><td class="mdescRight">Get position.  <a href="#gabd3cf1f281e1cfdb35d8a7fbde6c1165">More...</a><br/></td></tr>
+<tr class="separator:gabd3cf1f281e1cfdb35d8a7fbde6c1165"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga30e1e4deb8cae2033eb1f501b315d160"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160">fors_star_get_y</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
+<tr class="memdesc:ga30e1e4deb8cae2033eb1f501b315d160"><td class="mdescLeft"> </td><td class="mdescRight">Get position.  <a href="#ga30e1e4deb8cae2033eb1f501b315d160">More...</a><br/></td></tr>
+<tr class="separator:ga30e1e4deb8cae2033eb1f501b315d160"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa65bffc3107e2c3501346be2e5e03b1e"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e">fors_star_get_zeropoint</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
+<tr class="memdesc:gaa65bffc3107e2c3501346be2e5e03b1e"><td class="mdescLeft"> </td><td class="mdescRight">Get zeropoint.  <a href="#gaa65bffc3107e2c3501346be2e5e03b1e">More...</a><br/></td></tr>
+<tr class="separator:gaa65bffc3107e2c3501346be2e5e03b1e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga169dbe9ff4f60cde7e39d487ff510183"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183">fors_star_get_zeropoint_err</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
+<tr class="memdesc:ga169dbe9ff4f60cde7e39d487ff510183"><td class="mdescLeft"> </td><td class="mdescRight">Get zeropoint error.  <a href="#ga169dbe9ff4f60cde7e39d487ff510183">More...</a><br/></td></tr>
+<tr class="separator:ga169dbe9ff4f60cde7e39d487ff510183"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga525a48af1f85cf79ee7a60885eb5b13d"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star.html#ga525a48af1f85cf79ee7a60885eb5b13d">fors_star_is_identified</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
+<tr class="memdesc:ga525a48af1f85cf79ee7a60885eb5b13d"><td class="mdescLeft"> </td><td class="mdescRight">Determine if star was identified.  <a href="#ga525a48af1f85cf79ee7a60885eb5b13d">More...</a><br/></td></tr>
+<tr class="separator:ga525a48af1f85cf79ee7a60885eb5b13d"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>A data type used to represent stars on a CCD (position, magnitude, etc.) </p>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gaab4c629c0b0fafb228595b124b93cfd8"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static double _get_optional_table_value           </td>
+          <td class="memname">static double _get_optional_table_value </td>
           <td>(</td>
-          <td class="paramtype">const cpl_table * </td>
-          <td class="paramname"> <em>tab</em>, </td>
+          <td class="paramtype">const cpl_table * </td>
+          <td class="paramname"><em>tab</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned int </td>
-          <td class="paramname"> <em>row</em>, </td>
+          <td class="paramtype">unsigned int </td>
+          <td class="paramname"><em>row</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>colname</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>colname</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get a double value from a table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>row</em> </td><td>Input row </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>(Optional) Column name, can be NULL </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Get a double value from a table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">row</td><td>Input row </td></tr>
+    <tr><td class="paramname">name</td><td>(Optional) Column name, can be NULL </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The value, 0.0 if no column name was specified or on error </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00073">73</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__star_8c-source.html#l00170">fors_star_new_from_table()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The value, 0.0 if no column name was specified or on error </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00073">73</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__star_8c_source.html#l00170">fors_star_new_from_table()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g548c477088fd4fbadd74fd84f3becb94"></a><!-- doxytag: member="fors_star.c::fors_star_new" ref="g548c477088fd4fbadd74fd84f3becb94" args="(double x, double y, double fwhm, double smajor, double sminor, double orientation, double m, double dm, double si)" -->
+<a class="anchor" id="ga7a8b2a60d5685524ffbb762e066c9b01"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__star.html">fors_star</a>* fors_star_new           </td>
+          <td class="memname"><a class="el" href="struct__fors__star.html">fors_star</a>* fors_star_new </td>
           <td>(</td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>x</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>x</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>y</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>y</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>fwhm</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>fwhm</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>smajor</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>smajor</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>sminor</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>sminor</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>orientation</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>orientation</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>m</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>m</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dm</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dm</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>si</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>si</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Constructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>x</em> </td><td>1st coordinate </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>y</em> </td><td>2nd coordinate </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fwhm</em> </td><td>full width half maximum </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>smajor</em> </td><td>semi-major axis length </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sminor</em> </td><td>semi-minor axis length </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>orientation</em> </td><td>angle between semi-major axis and x-axis </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>m</em> </td><td>magnitude </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dm</em> </td><td>magnitude error </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>si</em> </td><td>stellarity index </td></tr>
+</div><div class="memdoc">
+
+<p>Constructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">x</td><td>1st coordinate </td></tr>
+    <tr><td class="paramname">y</td><td>2nd coordinate </td></tr>
+    <tr><td class="paramname">fwhm</td><td>full width half maximum </td></tr>
+    <tr><td class="paramname">smajor</td><td>semi-major axis length </td></tr>
+    <tr><td class="paramname">sminor</td><td>semi-minor axis length </td></tr>
+    <tr><td class="paramname">orientation</td><td>angle between semi-major axis and x-axis </td></tr>
+    <tr><td class="paramname">m</td><td>magnitude </td></tr>
+    <tr><td class="paramname">dm</td><td>magnitude error </td></tr>
+    <tr><td class="paramname">si</td><td>stellarity index </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated star </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00114">114</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__point_8c-source.html#l00053">fors_point_new()</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00867">extract_test()</a>, <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>, and <a class="el" href="fors__star-test_8c-source.html#l00054">test_star()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated star </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00114">114</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__point_8c_source.html#l00053">fors_point_new()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00867">extract_test()</a>, and <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gec880ac28409dd535ec3138e0b5b001c"></a><!-- doxytag: member="fors_star.c::fors_star_new_from_table" ref="gec880ac28409dd535ec3138e0b5b001c" args="(const cpl_table *tab, unsigned int row, const char *x_col, const char *y_col, const char *fwhm_col, const char *smaj_col, const char *smin_col, const char *theta_col, const char *mag_col, const char *dmag_col, const char *stlndx_col)" -->
+<a class="anchor" id="ga5be8cd6931b5f998692daaf65bcf9755"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__star.html">fors_star</a>* fors_star_new_from_table           </td>
+          <td class="memname"><a class="el" href="struct__fors__star.html">fors_star</a>* fors_star_new_from_table </td>
           <td>(</td>
-          <td class="paramtype">const cpl_table * </td>
-          <td class="paramname"> <em>tab</em>, </td>
+          <td class="paramtype">const cpl_table * </td>
+          <td class="paramname"><em>tab</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned int </td>
-          <td class="paramname"> <em>row</em>, </td>
+          <td class="paramtype">unsigned int </td>
+          <td class="paramname"><em>row</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>x_col</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>x_col</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>y_col</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>y_col</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>fwhm_col</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>fwhm_col</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>smaj_col</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>smaj_col</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>smin_col</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>smin_col</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>theta_col</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>theta_col</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>mag_col</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>mag_col</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>dmag_col</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>dmag_col</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>stlndx_col</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>stlndx_col</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create a star from a table WITHOUT checking. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>tab</em> </td><td>Input table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>row</em> </td><td>Input row index </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>x_col</em> </td><td>(Optional) x column name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>y_col</em> </td><td>(Optional) y column name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fwhm_col</em> </td><td>(Optional) fwhm column name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>smaj_col</em> </td><td>(Optional) s_major column name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>smin_col</em> </td><td>(Optional) s_minor column name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>theta_col</em> </td><td>(Optional) orientation column name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>mag_col</em> </td><td>(Optional) magnitude column name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dmag_col</em> </td><td>(Optional) magnitude error column name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>stlndx_col</em> </td><td>(Optional) stellar index column name </td></tr>
+</div><div class="memdoc">
+
+<p>Create a star from a table WITHOUT checking. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">tab</td><td>Input table </td></tr>
+    <tr><td class="paramname">row</td><td>Input row index </td></tr>
+    <tr><td class="paramname">x_col</td><td>(Optional) x column name </td></tr>
+    <tr><td class="paramname">y_col</td><td>(Optional) y column name </td></tr>
+    <tr><td class="paramname">fwhm_col</td><td>(Optional) fwhm column name </td></tr>
+    <tr><td class="paramname">smaj_col</td><td>(Optional) s_major column name </td></tr>
+    <tr><td class="paramname">smin_col</td><td>(Optional) s_minor column name </td></tr>
+    <tr><td class="paramname">theta_col</td><td>(Optional) orientation column name </td></tr>
+    <tr><td class="paramname">mag_col</td><td>(Optional) magnitude column name </td></tr>
+    <tr><td class="paramname">dmag_col</td><td>(Optional) magnitude error column name </td></tr>
+    <tr><td class="paramname">stlndx_col</td><td>(Optional) stellar index column name </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated star </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00170">170</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="fors__star_8c-source.html#l00073">_get_optional_table_value()</a>, <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__point_8c-source.html#l00053">fors_point_new()</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l02756">fors_photometry_read_input()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated star </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00170">170</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="fors__star_8c_source.html#l00073">_get_optional_table_value()</a>, <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__point_8c_source.html#l00053">fors_point_new()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l02698">fors_photometry_read_input()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g1ef535783913303ad950792cdd1d59c8"></a><!-- doxytag: member="fors_star.c::fors_star_check_values" ref="g1ef535783913303ad950792cdd1d59c8" args="(const fors_star *star)" -->
+</div>
+<a class="anchor" id="ga279f39755ddfa24ee9cfad4a03c01cf3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">bool fors_star_check_values           </td>
+          <td class="memname">bool fors_star_check_values </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>star</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>star</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Copy constructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>star</em> </td><td>Input star </td></tr>
+</div><div class="memdoc">
+
+<p>Copy constructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">star</td><td>Input star </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>1 if successful, 0 on error </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00227">227</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="fors__star_8h-source.html#l00040">_fors_star::fwhm</a>, <a class="el" href="fors__star_8h-source.html#l00038">_fors_star::semi_major</a>, <a class="el" href="fors__star_8h-source.html#l00039">_fors_star::semi_minor</a>, and <a class="el" href="fors__star_8h-source.html#l00041">_fors_star::stellarity_index</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00122">fors_extract_check_sex_star()</a>.
+<dl class="section return"><dt>Returns</dt><dd>1 if successful, 0 on error </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00227">227</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00122">fors_extract_check_sex_star()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g0505b201c585e91e65e968e84d2c1e62"></a><!-- doxytag: member="fors_star.c::fors_star_duplicate" ref="g0505b201c585e91e65e968e84d2c1e62" args="(const fors_star *star)" -->
+<a class="anchor" id="ga43a9682d94e1abc97300b00973b2291a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="struct__fors__star.html">fors_star</a>* fors_star_duplicate           </td>
+          <td class="memname"><a class="el" href="struct__fors__star.html">fors_star</a>* fors_star_duplicate </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>star</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>star</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Copy constructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>star</em> </td><td>to duplicate </td></tr>
+</div><div class="memdoc">
+
+<p>Copy constructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">star</td><td>to duplicate </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated star </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00248">248</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__point_8c-source.html#l00070">fors_point_duplicate()</a>, <a class="el" href="fors__star_8h-source.html#l00054">_fors_star::id</a>, and <a class="el" href="fors__star_8h-source.html#l00037">_fors_star::pixel</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00530">get_image_quality()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00760">get_zeropoint()</a>, <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>, and <a class="el" href="fors__star-test_8c-source.html#l00054">test_star()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated star </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00248">248</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__point_8c_source.html#l00070">fors_point_duplicate()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>, <a class="el" href="fors__img__science__impl_8c_source.html#l00530">get_image_quality()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l00760">get_zeropoint()</a>, and <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ga60434ffb49dd362b252cd2fb31d8787"></a><!-- doxytag: member="fors_star.c::fors_star_delete" ref="ga60434ffb49dd362b252cd2fb31d8787" args="(fors_star **star)" -->
+<a class="anchor" id="ga77f698ef0a6eb8bc4c4919b3d1aa6774"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_star_delete           </td>
+          <td class="memname">void fors_star_delete </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__star.html">fors_star</a> ** </td>
-          <td class="paramname"> <em>star</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype"><a class="el" href="struct__fors__star.html">fors_star</a> ** </td>
+          <td class="paramname"><em>star</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Delete object and set pointer to NULL. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>star</em> </td><td>to delete </td></tr>
+</div><div class="memdoc">
+
+<p>Delete object and set pointer to NULL. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">star</td><td>to delete </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00273">273</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="fors__point_8c-source.html#l00087">fors_point_delete()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l00320">entry_delete()</a>, <a class="el" href="fors_2fors__extract_8c-source.html#l00431">extract_sex()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00760">get_zeropoint()</a>, and <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>.
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00273">273</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="fors__point_8c_source.html#l00087">fors_point_delete()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l00320">entry_delete()</a>, <a class="el" href="fors_2fors__extract_8c_source.html#l00431">extract_sex()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l00760">get_zeropoint()</a>, and <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g40fa6037fee74abd5a9d5166137609e0"></a><!-- doxytag: member="fors_star.c::fors_star_delete_but_standard" ref="g40fa6037fee74abd5a9d5166137609e0" args="(fors_star **star)" -->
+<a class="anchor" id="ga517c8c542ad4eb8145fa664be9625a98"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_star_delete_but_standard           </td>
+          <td class="memname">void fors_star_delete_but_standard </td>
           <td>(</td>
-          <td class="paramtype"><a class="el" href="struct__fors__star.html">fors_star</a> ** </td>
-          <td class="paramname"> <em>star</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype"><a class="el" href="struct__fors__star.html">fors_star</a> ** </td>
+          <td class="paramname"><em>star</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Delete object and set pointer to NULL - but ignore the standard star. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>star</em> </td><td>to delete </td></tr>
+</div><div class="memdoc">
+
+<p>Delete object and set pointer to NULL - but ignore the standard star. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">star</td><td>to delete </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00291">291</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="fors__point_8c-source.html#l00087">fors_point_delete()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l00336">entry_delete_but_standard()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l02756">fors_photometry_read_input()</a>.
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00291">291</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="fors__point_8c_source.html#l00087">fors_point_delete()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l00336">entry_delete_but_standard()</a>, and <a class="el" href="fors__photometry__impl_8c_source.html#l02698">fors_photometry_read_input()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g9c8d5a74ebe2cbcd3fdde0186eef7b98"></a><!-- doxytag: member="fors_star.c::fors_star_equal" ref="g9c8d5a74ebe2cbcd3fdde0186eef7b98" args="(const fors_star *s, const fors_star *t)" -->
+</div>
+<a class="anchor" id="ga7704963eef38129e5f83e5b9eae36bc1"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">bool fors_star_equal           </td>
+          <td class="memname">bool fors_star_equal </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>t</em></td><td> </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>t</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Test for equality. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>1st star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>t</em> </td><td>2nd star </td></tr>
+</div><div class="memdoc">
+
+<p>Test for equality. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>1st star </td></tr>
+    <tr><td class="paramname">t</td><td>2nd star </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true if and only if the two stars compare equal </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00309">309</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__point_8c-source.html#l00120">fors_point_equal()</a>, and <a class="el" href="fors__star_8h-source.html#l00037">_fors_star::pixel</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00760">get_zeropoint()</a>, <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>, and <a class="el" href="fors__star-test_8c-source.html#l00054">test_star()</a>.
+<dl class="section return"><dt>Returns</dt><dd>true if and only if the two stars compare equal </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00309">309</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__point_8c_source.html#l00120">fors_point_equal()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00760">get_zeropoint()</a>, and <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g100f4290bf02ce348f22092f4e2bc3eb"></a><!-- doxytag: member="fors_star.c::fors_star_brighter_than" ref="g100f4290bf02ce348f22092f4e2bc3eb" args="(const fors_star *s1, const fors_star *s2, void *data)" -->
+<a class="anchor" id="ga7672a63fe0deea93cb8bae8362b6d020"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">bool fors_star_brighter_than           </td>
+          <td class="memname">bool fors_star_brighter_than </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s1</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s1</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s2</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s2</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Compare star brightness. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s1</em> </td><td>1st star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>s2</em> </td><td>2nd star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>not used </td></tr>
+</div><div class="memdoc">
+
+<p>Compare star brightness. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s1</td><td>1st star </td></tr>
+    <tr><td class="paramname">s2</td><td>2nd star </td></tr>
+    <tr><td class="paramname">data</td><td>not used </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true iff s1 is brighter than s2 </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00329">329</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="fors__star_8h-source.html#l00044">_fors_star::magnitude</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>, and <a class="el" href="fors__identify_8c-source.html#l00290">star_brighter_than()</a>.
+<dl class="section return"><dt>Returns</dt><dd>true iff s1 is brighter than s2 </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00329">329</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>, and <a class="el" href="fors__identify_8c_source.html#l00290">star_brighter_than()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g21eca2e7981ea38bc0b5a66edfc56bb9"></a><!-- doxytag: member="fors_star.c::fors_star_distsq" ref="g21eca2e7981ea38bc0b5a66edfc56bb9" args="(const fors_star *s, const fors_star *t)" -->
+<a class="anchor" id="ga53496a5c3e6810c6c59d221120df422b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_star_distsq           </td>
+          <td class="memname">double fors_star_distsq </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>t</em></td><td> </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>t</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get distance between stars. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>1st star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>t</em> </td><td>2nd star </td></tr>
+</div><div class="memdoc">
+
+<p>Get distance between stars. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>1st star </td></tr>
+    <tr><td class="paramname">t</td><td>2nd star </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>squared distance between stars </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00347">347</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__point_8c-source.html#l00103">fors_point_distsq()</a>, and <a class="el" href="fors__star_8h-source.html#l00037">_fors_star::pixel</a>.
-<p>
-Referenced by <a class="el" href="fors__star-test_8c-source.html#l00054">test_star()</a>.
+<dl class="section return"><dt>Returns</dt><dd>squared distance between stars </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00347">347</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__point_8c_source.html#l00103">fors_point_distsq()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g4f81e6410fe5c7aefbdbcae907095059"></a><!-- doxytag: member="fors_star.c::fors_star_extension" ref="g4f81e6410fe5c7aefbdbcae907095059" args="(const fors_star *s, void *data)" -->
+</div>
+<a class="anchor" id="ga2c97d2c47686016fa04c59b2a3e92b5c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_star_extension           </td>
+          <td class="memname">double fors_star_extension </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get star size. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>not used </td></tr>
+</div><div class="memdoc">
+
+<p>Get star size. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>star </td></tr>
+    <tr><td class="paramname">data</td><td>not used </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>average extension (one sigma) </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00365">365</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__star_8h-source.html#l00040">_fors_star::fwhm</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00530">get_image_quality()</a>, and <a class="el" href="fors__identify_8c-source.html#l01023">match_patterns()</a>.
+<dl class="section return"><dt>Returns</dt><dd>average extension (one sigma) </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00365">365</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00530">get_image_quality()</a>, and <a class="el" href="fors__identify_8c_source.html#l01023">match_patterns()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g310c2402602378a7505a36a85ee98c7b"></a><!-- doxytag: member="fors_star.c::fors_star_stellarity" ref="g310c2402602378a7505a36a85ee98c7b" args="(const fors_star *s, void *data)" -->
+<a class="anchor" id="ga67451b955667ae4f965146aee484c6bc"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_star_stellarity           </td>
+          <td class="memname">double fors_star_stellarity </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get star stellarity. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>not used </td></tr>
+</div><div class="memdoc">
+
+<p>Get star stellarity. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>star </td></tr>
+    <tr><td class="paramname">data</td><td>not used </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>stellarity index </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00384">384</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__star_8h-source.html#l00041">_fors_star::stellarity_index</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00530">get_image_quality()</a>.
+<dl class="section return"><dt>Returns</dt><dd>stellarity index </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00384">384</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00530">get_image_quality()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gdef23fa2c1ad1c4f2b0de18038b0daca"></a><!-- doxytag: member="fors_star.c::fors_star_ellipticity" ref="gdef23fa2c1ad1c4f2b0de18038b0daca" args="(const fors_star *s, void *data)" -->
+</div>
+<a class="anchor" id="ga9e7994d44acbe88580cab63d3662df40"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_star_ellipticity           </td>
+          <td class="memname">double fors_star_ellipticity </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get star ellipticity. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>not used </td></tr>
+</div><div class="memdoc">
+
+<p>Get star ellipticity. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>star </td></tr>
+    <tr><td class="paramname">data</td><td>not used </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>geometric average of semi major/minor axes length </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00402">402</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__star_8h-source.html#l00038">_fors_star::semi_major</a>, and <a class="el" href="fors__star_8h-source.html#l00039">_fors_star::semi_minor</a>.
-<p>
-Referenced by <a class="el" href="fors__tools_8c-source.html#l00130">fors_create_sources_table()</a>, and <a class="el" href="fors__img__science__impl_8c-source.html#l00530">get_image_quality()</a>.
+<dl class="section return"><dt>Returns</dt><dd>geometric average of semi major/minor axes length </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00402">402</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__tools_8c_source.html#l00130">fors_create_sources_table()</a>, and <a class="el" href="fors__img__science__impl_8c_source.html#l00530">get_image_quality()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g89b5801d41c9760d82ec12097e14b584"></a><!-- doxytag: member="fors_star.c::fors_star_print" ref="g89b5801d41c9760d82ec12097e14b584" args="(cpl_msg_severity level, const fors_star *s)" -->
+</div>
+<a class="anchor" id="ga3443159e600f23336b266f7b557f4ea0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_star_print           </td>
+          <td class="memname">void fors_star_print </td>
           <td>(</td>
-          <td class="paramtype">cpl_msg_severity </td>
-          <td class="paramname"> <em>level</em>, </td>
+          <td class="paramtype">cpl_msg_severity </td>
+          <td class="paramname"><em>level</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em></td><td> </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Print object. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>message level </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>to print at the info level </td></tr>
+</div><div class="memdoc">
+
+<p>Print object. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">level</td><td>message level </td></tr>
+    <tr><td class="paramname">s</td><td>to print at the info level </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00418">418</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="fors__star_8h-source.html#l00045">_fors_star::dmagnitude</a>, <a class="el" href="fors__star_8h-source.html#l00049">_fors_star::dmagnitude_corr</a>, <a class="el" href="fors__star_8h-source.html#l00044">_fors_star::magnitude</a>, <a class="el" href="fors__star_8h-source.html#l00047">_fors_star::magnitude_corr</a>, <a class="el" href="fors__star_8h-source.html#l00042">_fors_star::orientation</a>, <a class="el" href="fors__star_8h-source.html#l00037">_fors_st [...]
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l00354">entry_list_print()</a>, and <a class="el" href="fors__star_8c-source.html#l00443">fors_star_print_list()</a>.
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00418">418</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l00354">entry_list_print()</a>, and <a class="el" href="fors__star_8c_source.html#l00443">fors_star_print_list()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g8ab50c70291d9ed66d075ce9ae93577d"></a><!-- doxytag: member="fors_star.c::fors_star_print_list" ref="g8ab50c70291d9ed66d075ce9ae93577d" args="(cpl_msg_severity level, const fors_star_list *sl)" -->
+</div>
+<a class="anchor" id="ga4e15f3d1dbd18c8e010dc4ef82401d7d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_star_print_list           </td>
+          <td class="memname">void fors_star_print_list </td>
           <td>(</td>
-          <td class="paramtype">cpl_msg_severity </td>
-          <td class="paramname"> <em>level</em>, </td>
+          <td class="paramtype">cpl_msg_severity </td>
+          <td class="paramname"><em>level</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const fors_star_list * </td>
-          <td class="paramname"> <em>sl</em></td><td> </td>
+          <td class="paramtype">const fors_star_list * </td>
+          <td class="paramname"><em>sl</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Print list of stars. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>message level </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sl</em> </td><td>list to print </td></tr>
+</div><div class="memdoc">
+
+<p>Print list of stars. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">level</td><td>message level </td></tr>
+    <tr><td class="paramname">sl</td><td>list to print </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00443">443</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="fors__star_8c-source.html#l00418">fors_star_print()</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>.
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00443">443</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="fors__star_8c_source.html#l00418">fors_star_print()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gf5098d0eb78be73a27de34f0a9b7e9b0"></a><!-- doxytag: member="fors_star.c::fors_star_get_x" ref="gf5098d0eb78be73a27de34f0a9b7e9b0" args="(const fors_star *s, void *data)" -->
+</div>
+<a class="anchor" id="gabd3cf1f281e1cfdb35d8a7fbde6c1165"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_star_get_x           </td>
+          <td class="memname">double fors_star_get_x </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get position. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>not used </td></tr>
+</div><div class="memdoc">
+
+<p>Get position. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>star </td></tr>
+    <tr><td class="paramname">data</td><td>not used </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>x-position </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00467">467</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__star_8h-source.html#l00037">_fors_star::pixel</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>.
+<dl class="section return"><dt>Returns</dt><dd>x-position </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00467">467</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g724787234aa813e44d2aa7a6cae46b3e"></a><!-- doxytag: member="fors_star.c::fors_star_get_y" ref="g724787234aa813e44d2aa7a6cae46b3e" args="(const fors_star *s, void *data)" -->
+<a class="anchor" id="ga30e1e4deb8cae2033eb1f501b315d160"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_star_get_y           </td>
+          <td class="memname">double fors_star_get_y </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get position. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>not used </td></tr>
+</div><div class="memdoc">
+
+<p>Get position. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>star </td></tr>
+    <tr><td class="paramname">data</td><td>not used </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>y-position </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00485">485</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__star_8h-source.html#l00037">_fors_star::pixel</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>.
+<dl class="section return"><dt>Returns</dt><dd>y-position </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00485">485</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gb718ac03773576fc6856847b4211ffba"></a><!-- doxytag: member="fors_star.c::fors_star_get_zeropoint" ref="gb718ac03773576fc6856847b4211ffba" args="(const fors_star *s, void *data)" -->
+<a class="anchor" id="gaa65bffc3107e2c3501346be2e5e03b1e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_star_get_zeropoint           </td>
+          <td class="memname">double fors_star_get_zeropoint </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get zeropoint. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>star, must be identified </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>not used </td></tr>
+</div><div class="memdoc">
+
+<p>Get zeropoint. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>star, must be identified </td></tr>
+    <tr><td class="paramname">data</td><td>not used </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>zeropoint </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00504">504</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__star_8h-source.html#l00054">_fors_star::id</a>, and <a class="el" href="fors__star_8h-source.html#l00047">_fors_star::magnitude_corr</a>.
-<p>
-Referenced by <a class="el" href="fors__tools_8c-source.html#l00130">fors_create_sources_table()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00760">get_zeropoint()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00725">zeropoint_inside()</a>.
+<dl class="section return"><dt>Returns</dt><dd>zeropoint </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00504">504</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__tools_8c_source.html#l00130">fors_create_sources_table()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l00760">get_zeropoint()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00725">zeropoint_inside()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g22fc7f95537194266794e24345cdda0b"></a><!-- doxytag: member="fors_star.c::fors_star_get_zeropoint_err" ref="g22fc7f95537194266794e24345cdda0b" args="(const fors_star *s, void *data)" -->
+</div>
+<a class="anchor" id="ga169dbe9ff4f60cde7e39d487ff510183"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_star_get_zeropoint_err           </td>
+          <td class="memname">double fors_star_get_zeropoint_err </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get zeropoint error. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>star, must be identified </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>not used </td></tr>
+</div><div class="memdoc">
+
+<p>Get zeropoint error. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>star, must be identified </td></tr>
+    <tr><td class="paramname">data</td><td>not used </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>zeropoint error </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00522">522</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__star_8h-source.html#l00049">_fors_star::dmagnitude_corr</a>, and <a class="el" href="fors__star_8h-source.html#l00054">_fors_star::id</a>.
-<p>
-Referenced by <a class="el" href="fors__tools_8c-source.html#l00130">fors_create_sources_table()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00760">get_zeropoint()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00725">zeropoint_inside()</a>.
+<dl class="section return"><dt>Returns</dt><dd>zeropoint error </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00522">522</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__tools_8c_source.html#l00130">fors_create_sources_table()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l00760">get_zeropoint()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00725">zeropoint_inside()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g41b7ffa8530d0ffbc45916248663ac45"></a><!-- doxytag: member="fors_star.c::fors_star_is_identified" ref="g41b7ffa8530d0ffbc45916248663ac45" args="(const fors_star *s, void *data)" -->
+<a class="anchor" id="ga525a48af1f85cf79ee7a60885eb5b13d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">bool fors_star_is_identified           </td>
+          <td class="memname">bool fors_star_is_identified </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Determine if star was identified. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>not used </td></tr>
+</div><div class="memdoc">
+
+<p>Determine if star was identified. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>star </td></tr>
+    <tr><td class="paramname">data</td><td>not used </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true iff star is identified </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__star_8c-source.html#l00541">541</a> of file <a class="el" href="fors__star_8c-source.html">fors_star.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__star_8h-source.html#l00054">_fors_star::id</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00760">get_zeropoint()</a>.
+<dl class="section return"><dt>Returns</dt><dd>true iff star is identified </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__star_8c_source.html#l00541">541</a> of file <a class="el" href="fors__star_8c_source.html">fors_star.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00760">get_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__star__test.html b/html/group__fors__star__test.html
index 76ea58e..e2f8498 100644
--- a/html/group__fors__star__test.html
+++ b/html/group__fors__star__test.html
@@ -1,56 +1,91 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Star tests</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Star tests</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g604dc676807fa2e19fb9a98e9239a116"></a><!-- doxytag: member="fors_star_test::test_star" ref="g604dc676807fa2e19fb9a98e9239a116" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star__test.html#g604dc676807fa2e19fb9a98e9239a116">test_star</a> (void)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_star_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of star module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_star-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Star tests</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga5f4dac934da293e2cb4d53341350c833"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5f4dac934da293e2cb4d53341350c833"></a>
+static void </td><td class="memItemRight" valign="bottom"><b>test_star</b> (void)</td></tr>
+<tr class="separator:ga5f4dac934da293e2cb4d53341350c833"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__star__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of star module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_star_delete(&s); \</div>
+<div class="line">    fors_star_delete(&t); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__star-test_8c_source.html#l00045">45</a> of file <a class="el" href="fors__star-test_8c_source.html">fors_star-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>(&s); \
-    <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>(&t); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__star-test_8c-source.html#l00045">45</a> of file <a class="el" href="fors__star-test_8c-source.html">fors_star-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__std__cat__test.html b/html/group__fors__std__cat__test.html
index 88dbc06..b73ed63 100644
--- a/html/group__fors__std__cat__test.html
+++ b/html/group__fors__std__cat__test.html
@@ -1,64 +1,99 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Standard star catalogue tests</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Standard star catalogue tests</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__std__cat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g1ca49c9c9cec515e2178eb9be5326843"></a><!-- doxytag: member="fors_std_cat_test::test_new" ref="g1ca49c9c9cec515e2178eb9be5326843" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__std__cat__test.html#g1ca49c9c9cec515e2178eb9be5326843">test_new</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test loading catalogue. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g3cfcd4957686b7530076c681cf27c2fe"></a><!-- doxytag: member="fors_std_cat_test::test_dist" ref="g3cfcd4957686b7530076c681cf27c2fe" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__std__cat__test.html#g3cfcd4957686b7530076c681cf27c2fe">test_dist</a> (void)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_std_cat_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__std__cat__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of QC module. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_std_star-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Standard star catalogue tests</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga47ae58a634c68c2d37cf5f90ac247fa5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga47ae58a634c68c2d37cf5f90ac247fa5"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__std__cat__test.html#ga47ae58a634c68c2d37cf5f90ac247fa5">test_new</a> (void)</td></tr>
+<tr class="memdesc:ga47ae58a634c68c2d37cf5f90ac247fa5"><td class="mdescLeft"> </td><td class="mdescRight">Test loading catalogue. <br/></td></tr>
+<tr class="separator:ga47ae58a634c68c2d37cf5f90ac247fa5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadfc8e1d36263b0fd8876efba7434a5af"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gadfc8e1d36263b0fd8876efba7434a5af"></a>
+static void </td><td class="memItemRight" valign="bottom"><b>test_dist</b> (void)</td></tr>
+<tr class="separator:gadfc8e1d36263b0fd8876efba7434a5af"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__std__cat__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of QC module. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(cat_frames); \</div>
+<div class="line">    cpl_frame_delete(raw_frame); \</div>
+<div class="line">    cpl_frame_delete(phot_table); \</div>
+<div class="line">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    cpl_propertylist_delete(raw_header); raw_header = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__std__star-test_8c_source.html#l00051">51</a> of file <a class="el" href="fors__std__star-test_8c_source.html">fors_std_star-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(cat_frames); \
-    cpl_frame_delete(raw_frame); \
-    cpl_frame_delete(phot_table); \
-    fors_std_star_list_delete(&cat, fors_std_star_delete); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    cpl_propertylist_delete(raw_header); raw_header = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__std__star-test_8c-source.html#l00051">51</a> of file <a class="el" href="fors__std__star-test_8c-source.html">fors_std_star-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__test.html b/html/group__fors__test.html
index c4459b7..987e47e 100644
--- a/html/group__fors__test.html
+++ b/html/group__fors__test.html
@@ -1,60 +1,122 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Basic library test</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Basic library test</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__test.html#g42fa16bf6366aa153d18ccc091115217">test_version</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Check version number.  <a href="#g42fa16bf6366aa153d18ccc091115217"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Generic library tests. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g42fa16bf6366aa153d18ccc091115217"></a><!-- doxytag: member="fors-test.c::test_version" ref="g42fa16bf6366aa153d18ccc091115217" args="(void)" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Basic library test</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gaa0b61563ef767d8d2276e7ffe0b14f5e"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__test.html#gaa0b61563ef767d8d2276e7ffe0b14f5e">test_version</a> (void)</td></tr>
+<tr class="memdesc:gaa0b61563ef767d8d2276e7ffe0b14f5e"><td class="mdescLeft"> </td><td class="mdescRight">Check version number.  <a href="#gaa0b61563ef767d8d2276e7ffe0b14f5e">More...</a><br/></td></tr>
+<tr class="separator:gaa0b61563ef767d8d2276e7ffe0b14f5e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Generic library tests.  <a href="#ga840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gaa0b61563ef767d8d2276e7ffe0b14f5e"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void test_version           </td>
+          <td class="memname">static void test_version </td>
           <td>(</td>
-          <td class="paramtype">void </td>
-          <td class="paramname">          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">void </td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
         </tr>
       </table>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Check version number. </p>
+<p>This is a simple test to verify that we are linking to the correct libraries </p>
+
+<p>Definition at line <a class="el" href="fors-test_8c_source.html#l00048">48</a> of file <a class="el" href="fors-test_8c_source.html">fors-test.c</a>.</p>
+
+<p>References <a class="el" href="fors__utils_8c_source.html#l00107">fors_get_version_binary()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors-test_8c_source.html#l00057">main()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">int main </td>
+          <td>(</td>
+          <td class="paramtype">void </td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
+        </tr>
+      </table>
+</div><div class="memdoc">
+
+<p>Generic library tests. </p>
+<p>Test of QC module. </p>
+
+<p>Definition at line <a class="el" href="fors-test_8c_source.html#l00057">57</a> of file <a class="el" href="fors-test_8c_source.html">fors-test.c</a>.</p>
+
+<p>References <a class="el" href="fors-test_8c_source.html#l00048">test_version()</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-Check version number. 
-<p>
-This is a simple test to verify that we are linking to the correct libraries 
-<p>
-Definition at line <a class="el" href="fors-test_8c-source.html#l00048">48</a> of file <a class="el" href="fors-test_8c-source.html">fors-test.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00107">fors_get_version_binary()</a>.
-<p>
-Referenced by <a class="el" href="fors-test_8c-source.html#l00057">main()</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__tools.html b/html/group__fors__tools.html
index 702b229..629ae53 100644
--- a/html/group__fors__tools.html
+++ b/html/group__fors__tools.html
@@ -1,348 +1,364 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: High level functions</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>High level functions</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_tools::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#g6a1cb404cc2c956f79b10ea46a0611dc">fors_star_ext_corr</a> (fors_star_list *stars, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, double ext_coeff, double dext_coeff, const cpl_frame *raw_frame)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Correct for extinction, gain, exposure time.  <a href="#g6a1cb404cc2c956f79b10ea46a0611dc"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#g8138511b64d1d365e21b56eb161f2028">fors_create_sources_table</a> (fors_star_list *sources)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create product.  <a href="#g8138511b64d1d365e21b56eb161f2028"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#g5637ecda70fb6aeab5c0b22dec2e2e10">fors_fixed_pattern_noise</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *master, double convert_ADU, double master_noise)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute fixed pattern noise in flat field.  <a href="#g5637ecda70fb6aeab5c0b22dec2e2e10"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#g2e2a80069157183a808349976b3e455a">fors_fixed_pattern_noise_bias</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *first_raw, const <a class="el" href="struct__fors__image.html">fors_image</a> *second_raw, double <a class="el" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>)</ [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute fixed pattern noise in bias.  <a href="#g2e2a80069157183a808349976b3e455a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">fors_get_airmass</a> (const cpl_propertylist *header)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute average airmass.  <a href="#g5598e5ffadb4b4949d8c17df0674f437"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">High level functions</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga38ae9b9338fdb3cca9a17d970fac3db3"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#ga38ae9b9338fdb3cca9a17d970fac3db3">fors_star_ext_corr</a> (fors_star_list *stars, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting, double ext_coeff, double dext_coeff, const cpl_frame *raw_frame)</td></tr>
+<tr class="memdesc:ga38ae9b9338fdb3cca9a17d970fac3db3"><td class="mdescLeft"> </td><td class="mdescRight">Correct for extinction, gain, exposure time.  <a href="#ga38ae9b9338fdb3cca9a17d970fac3db3">More...</a><br/></td></tr>
+<tr class="separator:ga38ae9b9338fdb3cca9a17d970fac3db3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabebf30c47320c004ab4e658f837f75db"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#gabebf30c47320c004ab4e658f837f75db">fors_create_sources_table</a> (fors_star_list *sources)</td></tr>
+<tr class="memdesc:gabebf30c47320c004ab4e658f837f75db"><td class="mdescLeft"> </td><td class="mdescRight">Create product.  <a href="#gabebf30c47320c004ab4e658f837f75db">More...</a><br/></td></tr>
+<tr class="separator:gabebf30c47320c004ab4e658f837f75db"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga97b43bda55e1da41fe216364c8408d5b"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#ga97b43bda55e1da41fe216364c8408d5b">fors_fixed_pattern_noise</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *master, double convert_ADU, double master_noise)</td></tr>
+<tr class="memdesc:ga97b43bda55e1da41fe216364c8408d5b"><td class="mdescLeft"> </td><td class="mdescRight">Compute fixed pattern noise in flat field.  <a href="#ga97b43bda55e1da41fe216364c8408d5b">More...</a><br/></td></tr>
+<tr class="separator:ga97b43bda55e1da41fe216364c8408d5b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1ea0e4e37d52d6077b39e93ad1c340c3"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#ga1ea0e4e37d52d6077b39e93ad1c340c3">fors_fixed_pattern_noise_bias</a> (const <a class="el" href="struct__fors__image.html">fors_image</a> *first_raw, const <a class="el" href="struct__fors__image.html">fors_image</a> *second_raw, double ron)</td></tr>
+<tr class="memdesc:ga1ea0e4e37d52d6077b39e93ad1c340c3"><td class="mdescLeft"> </td><td class="mdescRight">Compute fixed pattern noise in bias.  <a href="#ga1ea0e4e37d52d6077b39e93ad1c340c3">More...</a><br/></td></tr>
+<tr class="separator:ga1ea0e4e37d52d6077b39e93ad1c340c3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0a6d06a61e61510f9bcf629f00fa160b"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b">fors_get_airmass</a> (const cpl_propertylist *header)</td></tr>
+<tr class="memdesc:ga0a6d06a61e61510f9bcf629f00fa160b"><td class="mdescLeft"> </td><td class="mdescRight">Compute average airmass.  <a href="#ga0a6d06a61e61510f9bcf629f00fa160b">More...</a><br/></td></tr>
+<tr class="separator:ga0a6d06a61e61510f9bcf629f00fa160b"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_tools.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_propertylist_delete(header); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__tools_8c_source.html#l00391">391</a> of file <a class="el" href="fors__tools_8c_source.html">fors_tools.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_propertylist_delete(header); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__tools_8c-source.html#l00391">391</a> of file <a class="el" href="fors__tools_8c-source.html">fors_tools.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_tools.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&image); \</div>
+<div class="line">    fors_image_delete(&image2); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__tools_8c_source.html#l00391">391</a> of file <a class="el" href="fors__tools_8c_source.html">fors_tools.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image2); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__tools_8c-source.html#l00391">391</a> of file <a class="el" href="fors__tools_8c-source.html">fors_tools.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_tools.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&image); \</div>
+<div class="line">    fors_image_delete(&image2); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__tools_8c_source.html#l00391">391</a> of file <a class="el" href="fors__tools_8c_source.html">fors_tools.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&image2); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__tools_8c-source.html#l00391">391</a> of file <a class="el" href="fors__tools_8c-source.html">fors_tools.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g6a1cb404cc2c956f79b10ea46a0611dc"></a><!-- doxytag: member="fors_tools.c::fors_star_ext_corr" ref="g6a1cb404cc2c956f79b10ea46a0611dc" args="(fors_star_list *stars, const fors_setting *setting, double ext_coeff, double dext_coeff, const cpl_frame *raw_frame)" -->
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga38ae9b9338fdb3cca9a17d970fac3db3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_star_ext_corr           </td>
+          <td class="memname">double fors_star_ext_corr </td>
           <td>(</td>
-          <td class="paramtype">fors_star_list * </td>
-          <td class="paramname"> <em>stars</em>, </td>
+          <td class="paramtype">fors_star_list * </td>
+          <td class="paramname"><em>stars</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ext_coeff</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ext_coeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dext_coeff</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dext_coeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>raw_frame</em></td><td> </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>raw_frame</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Correct for extinction, gain, exposure time. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>stars</em> </td><td>with magnitudes to be corrected </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>setting</em> </td><td>instrument setting </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ext_coeff</em> </td><td>extinction coefficient for this filter </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dext_coeff</em> </td><td>extinction coefficient error </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>raw_frame</em> </td><td>containing airmass, exposure time information </td></tr>
+<p>Correct for extinction, gain, exposure time. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">stars</td><td>with magnitudes to be corrected </td></tr>
+    <tr><td class="paramname">setting</td><td>instrument setting </td></tr>
+    <tr><td class="paramname">ext_coeff</td><td>extinction coefficient for this filter </td></tr>
+    <tr><td class="paramname">dext_coeff</td><td>extinction coefficient error </td></tr>
+    <tr><td class="paramname">raw_frame</td><td>containing airmass, exposure time information </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>average airmass as determined from raw frame </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>average airmass as determined from raw frame </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__tools_8c_source.html#l00065">65</a> of file <a class="el" href="fors__tools_8c_source.html">fors_tools.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="fors__tools_8c_source.html#l00398">fors_get_airmass()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__tools_8c-source.html#l00065">65</a> of file <a class="el" href="fors__tools_8c-source.html">fors_tools.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__setting_8h-source.html#l00067">_fors_setting::average_gain</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__star_8h-source.html#l00045">_fors_star::dmagnitude</a>, <a class="el" href="fors__star_8h-source.html#l00049">_fors_star::dmagnitude_corr</a>, <a class="el" href="fors__setting_8h-source.html#l00065">_fors_setting::exposure_time</a> [...]
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g8138511b64d1d365e21b56eb161f2028"></a><!-- doxytag: member="fors_tools.c::fors_create_sources_table" ref="g8138511b64d1d365e21b56eb161f2028" args="(fors_star_list *sources)" -->
+<a class="anchor" id="gabebf30c47320c004ab4e658f837f75db"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* fors_create_sources_table           </td>
+          <td class="memname">cpl_table* fors_create_sources_table </td>
           <td>(</td>
-          <td class="paramtype">fors_star_list * </td>
-          <td class="paramname"> <em>sources</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">fors_star_list * </td>
+          <td class="paramname"><em>sources</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Create product. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>sources</em> </td><td></td></tr>
+<p>Create product. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">sources</td><td></td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated table of sources properties</dd></dl>
-The given list of objects may or may not be identified 
-<p>
-Definition at line <a class="el" href="fors__tools_8c-source.html#l00130">130</a> of file <a class="el" href="fors__tools_8c-source.html">fors_tools.c</a>.
-<p>
-References <a class="el" href="fors__star_8h-source.html#l00045">_fors_star::dmagnitude</a>, <a class="el" href="fors__star_8h-source.html#l00049">_fors_star::dmagnitude_corr</a>, <a class="el" href="fors__star_8c-source.html#l00402">fors_star_ellipticity()</a>, <a class="el" href="fors__star_8c-source.html#l00504">fors_star_get_zeropoint()</a>, <a class="el" href="fors__star_8c-source.html#l00522">fors_star_get_zeropoint_err()</a>, <a class="el" href="fors__star_8h-source.html#l00040">_ [...]
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00867">extract_test()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated table of sources properties</dd></dl>
+<p>The given list of objects may or may not be identified </p>
+
+<p>Definition at line <a class="el" href="fors__tools_8c_source.html#l00130">130</a> of file <a class="el" href="fors__tools_8c_source.html">fors_tools.c</a>.</p>
+
+<p>References <a class="el" href="fors__star_8c_source.html#l00402">fors_star_ellipticity()</a>, <a class="el" href="fors__star_8c_source.html#l00504">fors_star_get_zeropoint()</a>, and <a class="el" href="fors__star_8c_source.html#l00522">fors_star_get_zeropoint_err()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00867">extract_test()</a>, <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g5637ecda70fb6aeab5c0b22dec2e2e10"></a><!-- doxytag: member="fors_tools.c::fors_fixed_pattern_noise" ref="g5637ecda70fb6aeab5c0b22dec2e2e10" args="(const fors_image *master, double convert_ADU, double master_noise)" -->
+</div>
+<a class="anchor" id="ga97b43bda55e1da41fe216364c8408d5b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_fixed_pattern_noise           </td>
+          <td class="memname">double fors_fixed_pattern_noise </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>master</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>master</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>convert_ADU</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>convert_ADU</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>master_noise</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>master_noise</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Compute fixed pattern noise in flat field. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>master</em> </td><td>master image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>convert_ADU</em> </td><td>factor to convert from master units to ADU </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>master_noise</em> </td><td>master noise (ADU) for a shift of zero </td></tr>
+<p>Compute fixed pattern noise in flat field. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">master</td><td>master image </td></tr>
+    <tr><td class="paramname">convert_ADU</td><td>factor to convert from master units to ADU </td></tr>
+    <tr><td class="paramname">master_noise</td><td>master noise (ADU) for a shift of zero </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>fixed pattern noise. The master noise is quadratically subtracted </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>fixed pattern noise. The master noise is quadratically subtracted </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__tools_8c_source.html#l00244">244</a> of file <a class="el" href="fors__tools_8c_source.html">fors_tools.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__image_8c_source.html#l01213">fors_image_crop()</a>, <a class="el" href="fors__image_8c_source.html#l00175">fors_image_duplicate()</a>, <a class="el" href="fors__image_8c_source.html#l00706">fors_image_get_size_x()</a>, <a class="el" href="fors__image_8c_source.html#l00719">fors_image_get_size_y()</a>, <a class="el" href="fors__image_8c_source.html#l01578">fors_image_get_stdev()</a>, and <a [...]
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__tools_8c-source.html#l00244">244</a> of file <a class="el" href="fors__tools_8c-source.html">fors_tools.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l01204">fors_image_crop()</a>, <a class="el" href="fors__image_8c-source.html#l00172">fors_image_duplicate()</a>, <a class="el" href="fors__image_8c-source.html#l00703">fors_image_get_size_x()</a>, <a class="el" href="fors__image_8c-source.html#l00716">fors_image_get_size_y()</a>, <a class="el" href= [...]
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00485">write_qc()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g2e2a80069157183a808349976b3e455a"></a><!-- doxytag: member="fors_tools.c::fors_fixed_pattern_noise_bias" ref="g2e2a80069157183a808349976b3e455a" args="(const fors_image *first_raw, const fors_image *second_raw, double ron)" -->
+</div>
+<a class="anchor" id="ga1ea0e4e37d52d6077b39e93ad1c340c3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_fixed_pattern_noise_bias           </td>
+          <td class="memname">double fors_fixed_pattern_noise_bias </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>first_raw</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>first_raw</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>second_raw</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>second_raw</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ron</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ron</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Compute fixed pattern noise in bias. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>first_raw</em> </td><td>First raw bias frame </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>second_raw</em> </td><td>Second raw bias frame </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ron</em> </td><td>Read out noise (ADU) for a shift of zero </td></tr>
+<p>Compute fixed pattern noise in bias. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">first_raw</td><td>First raw bias frame </td></tr>
+    <tr><td class="paramname">second_raw</td><td>Second raw bias frame </td></tr>
+    <tr><td class="paramname">ron</td><td>Read out noise (ADU) for a shift of zero </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>fixed pattern noise. The ron is quadratically subtracted </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>fixed pattern noise. The ron is quadratically subtracted </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__tools_8c_source.html#l00329">329</a> of file <a class="el" href="fors__tools_8c_source.html">fors_tools.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__tools_8c-source.html#l00329">329</a> of file <a class="el" href="fors__tools_8c-source.html">fors_tools.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__image_8c-source.html#l01204">fors_image_crop()</a>, <a class="el" href="fors__image_8c-source.html#l00172">fors_image_duplicate()</a>, <a class="el" href="fors__image_8c-source.html#l00703">fors_image_get_size_x()</a>, <a class="el" href="fors__image_8c-source.html#l00716">fors_image_get_size_y()</a>, <a class="el" href= [...]
-<p>
-Referenced by <a class="el" href="fors__bias__impl_8c-source.html#l00172">write_qc()</a>.
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__image_8c_source.html#l01213">fors_image_crop()</a>, <a class="el" href="fors__image_8c_source.html#l00175">fors_image_duplicate()</a>, <a class="el" href="fors__image_8c_source.html#l00706">fors_image_get_size_x()</a>, <a class="el" href="fors__image_8c_source.html#l00719">fors_image_get_size_y()</a>, <a class="el" href="fors__image_8c_source.html#l01599">fors_image_get_stdev_robust()</a>, [...]
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g5598e5ffadb4b4949d8c17df0674f437"></a><!-- doxytag: member="fors_tools.c::fors_get_airmass" ref="g5598e5ffadb4b4949d8c17df0674f437" args="(const cpl_propertylist *header)" -->
+<a class="anchor" id="ga0a6d06a61e61510f9bcf629f00fa160b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_get_airmass           </td>
+          <td class="memname">double fors_get_airmass </td>
           <td>(</td>
-          <td class="paramtype">const cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>header</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Compute average airmass. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>header to read from </td></tr>
+<p>Compute average airmass. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>header to read from </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>average airmass </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>average airmass </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__tools_8c_source.html#l00398">398</a> of file <a class="el" href="fors__tools_8c_source.html">fors_tools.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__tools_8c-source.html#l00398">398</a> of file <a class="el" href="fors__tools_8c-source.html">fors_tools.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__pfits_8c-source.html#l00045">FORS_PFITS_AIRMASS_END</a>, and <a class="el" href="fors__pfits_8c-source.html#l00044">FORS_PFITS_AIRMASS_START</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__tools_8c-source.html#l00065">fors_star_ext_corr()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__tools_8c_source.html#l00065">fors_star_ext_corr()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__utils.html b/html/group__fors__utils.html
index 56e20cb..eabec80 100644
--- a/html/group__fors__utils.html
+++ b/html/group__fors__utils.html
@@ -1,697 +1,695 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Miscellaneous Utilities</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Miscellaneous Utilities</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g3636991e5e900e3f3545048017667c07"></a><!-- doxytag: member="fors_utils::REQ_CPL_MAJOR" ref="g3636991e5e900e3f3545048017667c07" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g3636991e5e900e3f3545048017667c07">REQ_CPL_MAJOR</a>   4</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4c528bd8b3c44e5882145a0627393601"></a><!-- doxytag: member="fors_utils::REQ_CPL_MINOR" ref="g4c528bd8b3c44e5882145a0627393601" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g4c528bd8b3c44e5882145a0627393601">REQ_CPL_MINOR</a>   0</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gbca08fe2cbba3584164a3b495bb8b488"></a><!-- doxytag: member="fors_utils::REQ_CPL_MICRO" ref="gbca08fe2cbba3584164a3b495bb8b488" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gbca08fe2cbba3584164a3b495bb8b488">REQ_CPL_MICRO</a>   0</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_utils::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_utils::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_utils::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_utils::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_utils::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_utils::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_utils::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_utils::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_utils::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_utils::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g1ddbaf639cddef891b3619471eea9008"></a><!-- doxytag: member="fors_utils::MAX_MESSAGE_LENGTH" ref="g1ddbaf639cddef891b3619471eea9008" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g1ddbaf639cddef891b3619471eea9008">MAX_MESSAGE_LENGTH</a>   1024</td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69">fors_get_license</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the pipeline copyright and license.  <a href="#g0c5895083b6713e4dcb39fde4a873c69"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5d402c4f4e0fe13790e410e507af10ef"></a><!-- doxytag: member="fors_utils::fors_print_banner" ref="g5d402c4f4e0fe13790e410e507af10ef" args="(void)" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g5d402c4f4e0fe13790e410e507af10ef">fors_print_banner</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Issue a banner with the pipeline version. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2">fors_get_version_binary</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get FORS library binary version number.  <a href="#ga0b458bea611319b34643787b021d2d2"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044">fors_rand_gauss</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Pseudo-random gaussian distributed number.  <a href="#ga5ff2321d51f9a87b445ccc9392e8044"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4acaddb1c4b5fbc829b3a58434a08458"></a><!-- doxytag: member="fors_utils::fors_tools_get_kth_double" ref="g4acaddb1c4b5fbc829b3a58434a08458" args="(double *a, int n, int k)" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g4acaddb1c4b5fbc829b3a58434a08458">fors_tools_get_kth_double</a> (double *a, int n, int k)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Same as cpl_tools_get_kth_double. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g82a608ac0a7259f2c39a89db274546d3"></a><!-- doxytag: member="fors_utils::fors_tools_get_median_float" ref="g82a608ac0a7259f2c39a89db274546d3" args="(float *a, int n)" -->
-float </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g82a608ac0a7259f2c39a89db274546d3">fors_tools_get_median_float</a> (float *a, int n)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Unbiased median. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g8fcbc5ff472f72a690b4ef8716f66918"></a><!-- doxytag: member="fors_utils::fors_tools_get_median_fast_float" ref="g8fcbc5ff472f72a690b4ef8716f66918" args="(float *a, int n)" -->
-float </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g8fcbc5ff472f72a690b4ef8716f66918">fors_tools_get_median_fast_float</a> (float *a, int n)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Biased median. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g032ad4d4b74b174df587f578f6a70bf2"></a><!-- doxytag: member="fors_utils::fors_tools_get_kth_float" ref="g032ad4d4b74b174df587f578f6a70bf2" args="(float *a, int n, int k)" -->
-float </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g032ad4d4b74b174df587f578f6a70bf2">fors_tools_get_kth_float</a> (float *a, int n, int k)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Same as cpl_tools_get_kth_float. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gf509a28ce04d6804eabe62b2a5817afe">fors_frame_get_type_string</a> (const cpl_frame *f)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get frame type as a string.  <a href="#gf509a28ce04d6804eabe62b2a5817afe"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gc219cfea8dd4f3c5a0aceb222d19150a">fors_frame_get_group_string</a> (const cpl_frame *f)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get frame group as a string.  <a href="#gc219cfea8dd4f3c5a0aceb222d19150a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gc02f8fba22227907e45bdcbe6de8655e">fors_frame_get_level_string</a> (const cpl_frame *f)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get frame level as a string.  <a href="#gc02f8fba22227907e45bdcbe6de8655e"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gc1181b0023db290ca5bfc42e9980e3a8">fors_frameset_print</a> (const cpl_frameset *frames)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Print a frame set.  <a href="#gc1181b0023db290ca5bfc42e9980e3a8"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g375049f68639265267adcdc11d161bc3">fors_frame_print</a> (const cpl_frame *f)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Print a frame.  <a href="#g375049f68639265267adcdc11d161bc3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_frameset * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a">fors_frameset_extract</a> (const cpl_frameset *frames, const char *tag)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract frames with given tag from frameset.  <a href="#gea84af835a842fc000695c7ab11f350a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861">fors_type_get_string</a> (cpl_type t)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Textual representation of CPL type.  <a href="#g2d2de37f396f758d304d234a5c38c861"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4">fors_parameterlist_set_defaults</a> (cpl_parameterlist *parlist)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Set unset parameters to default value.  <a href="#g6f2731cef63a65795c0999284006a7c4"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g833fbeca7835f9c594deb0a8752d8b74">fors_imagelist_collapse_create</a> (const cpl_imagelist *ilist)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Workaround for cpl_imagelist_collapse_create.  <a href="#g833fbeca7835f9c594deb0a8752d8b74"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g2d1787d975000e60e8790fc656d538f6">fors_imagelist_collapse_median_create</a> (const cpl_imagelist *ilist)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Workaround for cpl_imagelist_collapse_median_create.  <a href="#g2d1787d975000e60e8790fc656d538f6"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#g71645af45bc192964d3170f28c671240">fors_angle_diff</a> (const double *a1, const double *a2)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Difference between angles.  <a href="#g71645af45bc192964d3170f28c671240"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ge561fe29b3673b34094804e26ece5e8e">fors_msg_macro</a> (cpl_msg_severity level, const char *fct, const char *format,...)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Print message.  <a href="#ge561fe29b3673b34094804e26ece5e8e"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3">fors_utils_median_corr</a> (int n)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">median stacking correction factor  <a href="#ga3c534a3edd597c2c5a03f0ad0ccc8e3"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gea88c3776498f5f3717413a50289af52"></a><!-- doxytag: member="fors_utils::STDEV_PR_MAD" ref="gea88c3776498f5f3717413a50289af52" args="" -->
-const double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gea88c3776498f5f3717413a50289af52">STDEV_PR_MAD</a> = 1/0.6744897</td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">Miscellaneous Utilities</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:gaa6f08c08604f669d5248a50db05095c6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa6f08c08604f669d5248a50db05095c6"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>REQ_CPL_MAJOR</b>   4</td></tr>
+<tr class="separator:gaa6f08c08604f669d5248a50db05095c6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae2b8645924a1fcbfb414a387b6f33b3b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae2b8645924a1fcbfb414a387b6f33b3b"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>REQ_CPL_MINOR</b>   0</td></tr>
+<tr class="separator:gae2b8645924a1fcbfb414a387b6f33b3b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaab1b7d291b65c497a7a4d32822095d10"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaab1b7d291b65c497a7a4d32822095d10"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>REQ_CPL_MICRO</b>   0</td></tr>
+<tr class="separator:gaab1b7d291b65c497a7a4d32822095d10"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab234d1358562b66925fb7223c087556b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab234d1358562b66925fb7223c087556b"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>MAX_MESSAGE_LENGTH</b>   1024</td></tr>
+<tr class="separator:gab234d1358562b66925fb7223c087556b"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga1c8c5c9fea9db9a6e6cfe7574d79ca87"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87">fors_get_license</a> (void)</td></tr>
+<tr class="memdesc:ga1c8c5c9fea9db9a6e6cfe7574d79ca87"><td class="mdescLeft"> </td><td class="mdescRight">Get the pipeline copyright and license.  <a href="#ga1c8c5c9fea9db9a6e6cfe7574d79ca87">More...</a><br/></td></tr>
+<tr class="separator:ga1c8c5c9fea9db9a6e6cfe7574d79ca87"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf34da190cb639a584e5f2473de24d887"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaf34da190cb639a584e5f2473de24d887"></a>
+void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gaf34da190cb639a584e5f2473de24d887">fors_print_banner</a> (void)</td></tr>
+<tr class="memdesc:gaf34da190cb639a584e5f2473de24d887"><td class="mdescLeft"> </td><td class="mdescRight">Issue a banner with the pipeline version. <br/></td></tr>
+<tr class="separator:gaf34da190cb639a584e5f2473de24d887"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4c7b6a1484c2123934ac4c7a1f9e4a74"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74">fors_get_version_binary</a> (void)</td></tr>
+<tr class="memdesc:ga4c7b6a1484c2123934ac4c7a1f9e4a74"><td class="mdescLeft"> </td><td class="mdescRight">Get FORS library binary version number.  <a href="#ga4c7b6a1484c2123934ac4c7a1f9e4a74">More...</a><br/></td></tr>
+<tr class="separator:ga4c7b6a1484c2123934ac4c7a1f9e4a74"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae3bf120c3732afdf5f126cdee1ed8e56"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56">fors_rand_gauss</a> (void)</td></tr>
+<tr class="memdesc:gae3bf120c3732afdf5f126cdee1ed8e56"><td class="mdescLeft"> </td><td class="mdescRight">Pseudo-random gaussian distributed number.  <a href="#gae3bf120c3732afdf5f126cdee1ed8e56">More...</a><br/></td></tr>
+<tr class="separator:gae3bf120c3732afdf5f126cdee1ed8e56"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac3759b058af73511a69998299a11a40f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac3759b058af73511a69998299a11a40f"></a>
+double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gac3759b058af73511a69998299a11a40f">fors_tools_get_kth_double</a> (double *a, int n, int k)</td></tr>
+<tr class="memdesc:gac3759b058af73511a69998299a11a40f"><td class="mdescLeft"> </td><td class="mdescRight">Same as cpl_tools_get_kth_double. <br/></td></tr>
+<tr class="separator:gac3759b058af73511a69998299a11a40f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga513ceb86672094a1d13a45d75e01782a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga513ceb86672094a1d13a45d75e01782a"></a>
+float </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga513ceb86672094a1d13a45d75e01782a">fors_tools_get_median_float</a> (float *a, int n)</td></tr>
+<tr class="memdesc:ga513ceb86672094a1d13a45d75e01782a"><td class="mdescLeft"> </td><td class="mdescRight">Unbiased median. <br/></td></tr>
+<tr class="separator:ga513ceb86672094a1d13a45d75e01782a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5de34c3a7ff32722bc68e1b3a67f3390"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5de34c3a7ff32722bc68e1b3a67f3390"></a>
+float </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga5de34c3a7ff32722bc68e1b3a67f3390">fors_tools_get_median_fast_float</a> (float *a, int n)</td></tr>
+<tr class="memdesc:ga5de34c3a7ff32722bc68e1b3a67f3390"><td class="mdescLeft"> </td><td class="mdescRight">Biased median. <br/></td></tr>
+<tr class="separator:ga5de34c3a7ff32722bc68e1b3a67f3390"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga86a7f03d90b17ddd5764219a8bd4a044"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga86a7f03d90b17ddd5764219a8bd4a044"></a>
+float </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044">fors_tools_get_kth_float</a> (float *a, int n, int k)</td></tr>
+<tr class="memdesc:ga86a7f03d90b17ddd5764219a8bd4a044"><td class="mdescLeft"> </td><td class="mdescRight">Same as cpl_tools_get_kth_float. <br/></td></tr>
+<tr class="separator:ga86a7f03d90b17ddd5764219a8bd4a044"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad97092a91b5de91f84039778596fd759"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gad97092a91b5de91f84039778596fd759">fors_frame_get_type_string</a> (const cpl_frame *f)</td></tr>
+<tr class="memdesc:gad97092a91b5de91f84039778596fd759"><td class="mdescLeft"> </td><td class="mdescRight">Get frame type as a string.  <a href="#gad97092a91b5de91f84039778596fd759">More...</a><br/></td></tr>
+<tr class="separator:gad97092a91b5de91f84039778596fd759"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3e2178bad7068e3768fc5f78b1d02490"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga3e2178bad7068e3768fc5f78b1d02490">fors_frame_get_group_string</a> (const cpl_frame *f)</td></tr>
+<tr class="memdesc:ga3e2178bad7068e3768fc5f78b1d02490"><td class="mdescLeft"> </td><td class="mdescRight">Get frame group as a string.  <a href="#ga3e2178bad7068e3768fc5f78b1d02490">More...</a><br/></td></tr>
+<tr class="separator:ga3e2178bad7068e3768fc5f78b1d02490"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga82f1aaba039c880a3bff109f3729d74a"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga82f1aaba039c880a3bff109f3729d74a">fors_frame_get_level_string</a> (const cpl_frame *f)</td></tr>
+<tr class="memdesc:ga82f1aaba039c880a3bff109f3729d74a"><td class="mdescLeft"> </td><td class="mdescRight">Get frame level as a string.  <a href="#ga82f1aaba039c880a3bff109f3729d74a">More...</a><br/></td></tr>
+<tr class="separator:ga82f1aaba039c880a3bff109f3729d74a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga414e1f2d95f271cc76a67e525b910e96"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga414e1f2d95f271cc76a67e525b910e96">fors_frameset_print</a> (const cpl_frameset *frames)</td></tr>
+<tr class="memdesc:ga414e1f2d95f271cc76a67e525b910e96"><td class="mdescLeft"> </td><td class="mdescRight">Print a frame set.  <a href="#ga414e1f2d95f271cc76a67e525b910e96">More...</a><br/></td></tr>
+<tr class="separator:ga414e1f2d95f271cc76a67e525b910e96"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6692a0ba541b3e7f99654f844aee40c6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga6692a0ba541b3e7f99654f844aee40c6">fors_frame_print</a> (const cpl_frame *f)</td></tr>
+<tr class="memdesc:ga6692a0ba541b3e7f99654f844aee40c6"><td class="mdescLeft"> </td><td class="mdescRight">Print a frame.  <a href="#ga6692a0ba541b3e7f99654f844aee40c6">More...</a><br/></td></tr>
+<tr class="separator:ga6692a0ba541b3e7f99654f844aee40c6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga467ac093c1e2d21f9e2dfc9afcb97744"><td class="memItemLeft" align="right" valign="top">cpl_frameset * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744">fors_frameset_extract</a> (const cpl_frameset *frames, const char *tag)</td></tr>
+<tr class="memdesc:ga467ac093c1e2d21f9e2dfc9afcb97744"><td class="mdescLeft"> </td><td class="mdescRight">Extract frames with given tag from frameset.  <a href="#ga467ac093c1e2d21f9e2dfc9afcb97744">More...</a><br/></td></tr>
+<tr class="separator:ga467ac093c1e2d21f9e2dfc9afcb97744"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2e98c2130598c09a1c5d3344306463fd"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd">fors_type_get_string</a> (cpl_type t)</td></tr>
+<tr class="memdesc:ga2e98c2130598c09a1c5d3344306463fd"><td class="mdescLeft"> </td><td class="mdescRight">Textual representation of CPL type.  <a href="#ga2e98c2130598c09a1c5d3344306463fd">More...</a><br/></td></tr>
+<tr class="separator:ga2e98c2130598c09a1c5d3344306463fd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga198405eae0245c17f2719e40fc4c8b42"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42">fors_parameterlist_set_defaults</a> (cpl_parameterlist *parlist)</td></tr>
+<tr class="memdesc:ga198405eae0245c17f2719e40fc4c8b42"><td class="mdescLeft"> </td><td class="mdescRight">Set unset parameters to default value.  <a href="#ga198405eae0245c17f2719e40fc4c8b42">More...</a><br/></td></tr>
+<tr class="separator:ga198405eae0245c17f2719e40fc4c8b42"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabb34a534e28308533f300ea11ec7a3a3"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gabb34a534e28308533f300ea11ec7a3a3">fors_imagelist_collapse_create</a> (const cpl_imagelist *ilist)</td></tr>
+<tr class="memdesc:gabb34a534e28308533f300ea11ec7a3a3"><td class="mdescLeft"> </td><td class="mdescRight">Workaround for cpl_imagelist_collapse_create.  <a href="#gabb34a534e28308533f300ea11ec7a3a3">More...</a><br/></td></tr>
+<tr class="separator:gabb34a534e28308533f300ea11ec7a3a3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa55c5fd8ade8f10e441297c0cda96093"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gaa55c5fd8ade8f10e441297c0cda96093">fors_imagelist_collapse_median_create</a> (const cpl_imagelist *ilist)</td></tr>
+<tr class="memdesc:gaa55c5fd8ade8f10e441297c0cda96093"><td class="mdescLeft"> </td><td class="mdescRight">Workaround for cpl_imagelist_collapse_median_create.  <a href="#gaa55c5fd8ade8f10e441297c0cda96093">More...</a><br/></td></tr>
+<tr class="separator:gaa55c5fd8ade8f10e441297c0cda96093"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga69350709e5f9874601c729becd315e81"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga69350709e5f9874601c729becd315e81">fors_angle_diff</a> (const double *a1, const double *a2)</td></tr>
+<tr class="memdesc:ga69350709e5f9874601c729becd315e81"><td class="mdescLeft"> </td><td class="mdescRight">Difference between angles.  <a href="#ga69350709e5f9874601c729becd315e81">More...</a><br/></td></tr>
+<tr class="separator:ga69350709e5f9874601c729becd315e81"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae98c540953f671b35817aac071aa4adc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#gae98c540953f671b35817aac071aa4adc">fors_msg_macro</a> (cpl_msg_severity level, const char *fct, const char *format,...)</td></tr>
+<tr class="memdesc:gae98c540953f671b35817aac071aa4adc"><td class="mdescLeft"> </td><td class="mdescRight">Print message.  <a href="#gae98c540953f671b35817aac071aa4adc">More...</a><br/></td></tr>
+<tr class="separator:gae98c540953f671b35817aac071aa4adc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga42ad9e96d57c915b0a28a40dd838c9a3"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3">fors_utils_median_corr</a> (int n)</td></tr>
+<tr class="memdesc:ga42ad9e96d57c915b0a28a40dd838c9a3"><td class="mdescLeft"> </td><td class="mdescRight">median stacking correction factor  <a href="#ga42ad9e96d57c915b0a28a40dd838c9a3">More...</a><br/></td></tr>
+<tr class="separator:ga42ad9e96d57c915b0a28a40dd838c9a3"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga8e2fcfe074b6da07c0b50aa07467666c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8e2fcfe074b6da07c0b50aa07467666c"></a>
+const double </td><td class="memItemRight" valign="bottom"><b>STDEV_PR_MAD</b> = 1/0.6744897</td></tr>
+<tr class="separator:ga8e2fcfe074b6da07c0b50aa07467666c"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g0c5895083b6713e4dcb39fde4a873c69"></a><!-- doxytag: member="fors_utils.c::fors_get_license" ref="g0c5895083b6713e4dcb39fde4a873c69" args="(void)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga1c8c5c9fea9db9a6e6cfe7574d79ca87"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* fors_get_license           </td>
+          <td class="memname">const char* fors_get_license </td>
           <td>(</td>
-          <td class="paramtype">void </td>
-          <td class="paramname">          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">void </td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get the pipeline copyright and license. 
-<p>
-<dl compact><dt><b>Returns:</b></dt><dd>The copyright and license string</dd></dl>
-The function returns a pointer to the statically allocated license string. This string should not be modified using the returned pointer. 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00065">65</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-Referenced by <a class="el" href="fors__bias_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<p>Get the pipeline copyright and license. </p>
+<dl class="section return"><dt>Returns</dt><dd>The copyright and license string</dd></dl>
+<p>The function returns a pointer to the statically allocated license string. This string should not be modified using the returned pointer. </p>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00065">65</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ga0b458bea611319b34643787b021d2d2"></a><!-- doxytag: member="fors_utils.c::fors_get_version_binary" ref="ga0b458bea611319b34643787b021d2d2" args="(void)" -->
+<a class="anchor" id="ga4c7b6a1484c2123934ac4c7a1f9e4a74"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int fors_get_version_binary           </td>
+          <td class="memname">int fors_get_version_binary </td>
           <td>(</td>
-          <td class="paramtype">void </td>
-          <td class="paramname">          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">void </td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+
+<p>Get FORS library binary version number. </p>
+<dl class="section return"><dt>Returns</dt><dd>Binary version number </dd></dl>
 
-<p>
-Get FORS library binary version number. 
-<p>
-<dl compact><dt><b>Returns:</b></dt><dd>Binary version number </dd></dl>
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00107">107</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00107">107</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00048">REQ_CPL_MAJOR</a>, <a class="el" href="fors__utils_8c-source.html#l00050">REQ_CPL_MICRO</a>, and <a class="el" href="fors__utils_8c-source.html#l00049">REQ_CPL_MINOR</a>.
-<p>
-Referenced by <a class="el" href="fors__bias_8c-source.html#l00062">cpl_plugin_get_info()</a>, and <a class="el" href="fors-test_8c-source.html#l00048">test_version()</a>.
+<p>Referenced by <a class="el" href="fors__bias_8c_source.html#l00062">cpl_plugin_get_info()</a>, and <a class="el" href="fors-test_8c_source.html#l00048">test_version()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ga5ff2321d51f9a87b445ccc9392e8044"></a><!-- doxytag: member="fors_utils.c::fors_rand_gauss" ref="ga5ff2321d51f9a87b445ccc9392e8044" args="(void)" -->
+<a class="anchor" id="gae3bf120c3732afdf5f126cdee1ed8e56"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_rand_gauss           </td>
+          <td class="memname">double fors_rand_gauss </td>
           <td>(</td>
-          <td class="paramtype">void </td>
-          <td class="paramname">          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">void </td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+
+<p>Pseudo-random gaussian distributed number. </p>
+<dl class="section return"><dt>Returns</dt><dd>Pseudo-random gasssian value with mean zero, stdev 1, based on C's rand()</dd></dl>
+<p>It is left to the user when/how to call srand(). </p>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00181">181</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
 
-<p>
-Pseudo-random gaussian distributed number. 
-<p>
-<dl compact><dt><b>Returns:</b></dt><dd>Pseudo-random gasssian value with mean zero, stdev 1, based on C's rand()</dd></dl>
-It is left to the user when/how to call srand(). 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00181">181</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-Referenced by <a class="el" href="test__simulate_8c-source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c-source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c-source.html#l00328">create_screen_flat()</a>, <a class="el" href="test__simulate_8c-source.html#l00384">create_sky_flat()</a>, and <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>.
+<p>Referenced by <a class="el" href="test__simulate_8c_source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c_source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c_source.html#l00328">create_screen_flat()</a>, <a class="el" href="test__simulate_8c_source.html#l00384">create_sky_flat()</a>, and <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gf509a28ce04d6804eabe62b2a5817afe"></a><!-- doxytag: member="fors_utils.c::fors_frame_get_type_string" ref="gf509a28ce04d6804eabe62b2a5817afe" args="(const cpl_frame *f)" -->
+<a class="anchor" id="gad97092a91b5de91f84039778596fd759"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* fors_frame_get_type_string           </td>
+          <td class="memname">const char* fors_frame_get_type_string </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>f</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>f</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get frame type as a string. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>f</em> </td><td>frame </td></tr>
+<p>Get frame type as a string. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">f</td><td>frame </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>frame type, or NULL </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>frame type, or NULL </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00319">319</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__utils_8c_source.html#l00427">fors_frame_print()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00319">319</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__utils_8c-source.html#l00427">fors_frame_print()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gc219cfea8dd4f3c5a0aceb222d19150a"></a><!-- doxytag: member="fors_utils.c::fors_frame_get_group_string" ref="gc219cfea8dd4f3c5a0aceb222d19150a" args="(const cpl_frame *f)" -->
+</div>
+<a class="anchor" id="ga3e2178bad7068e3768fc5f78b1d02490"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* fors_frame_get_group_string           </td>
+          <td class="memname">const char* fors_frame_get_group_string </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>f</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>f</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get frame group as a string. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>f</em> </td><td>frame </td></tr>
+<p>Get frame group as a string. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">f</td><td>frame </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>frame group, or NULL </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>frame group, or NULL </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00344">344</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__utils_8c_source.html#l00427">fors_frame_print()</a>, and <a class="el" href="fors__image_8c_source.html#l00352">fors_image_load()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00344">344</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__utils_8c-source.html#l00427">fors_frame_print()</a>, and <a class="el" href="fors__image_8c-source.html#l00349">fors_image_load()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gc02f8fba22227907e45bdcbe6de8655e"></a><!-- doxytag: member="fors_utils.c::fors_frame_get_level_string" ref="gc02f8fba22227907e45bdcbe6de8655e" args="(const cpl_frame *f)" -->
+</div>
+<a class="anchor" id="ga82f1aaba039c880a3bff109f3729d74a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* fors_frame_get_level_string           </td>
+          <td class="memname">const char* fors_frame_get_level_string </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>f</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>f</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get frame level as a string. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>f</em> </td><td>frame </td></tr>
+<p>Get frame level as a string. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">f</td><td>frame </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>frame level, or NULL </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>frame level, or NULL </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00369">369</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00369">369</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__utils_8c-source.html#l00427">fors_frame_print()</a>.
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__utils_8c_source.html#l00427">fors_frame_print()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gc1181b0023db290ca5bfc42e9980e3a8"></a><!-- doxytag: member="fors_utils.c::fors_frameset_print" ref="gc1181b0023db290ca5bfc42e9980e3a8" args="(const cpl_frameset *frames)" -->
+<a class="anchor" id="ga414e1f2d95f271cc76a67e525b910e96"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_frameset_print           </td>
+          <td class="memname">void fors_frameset_print </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_frameset * </td>
+          <td class="paramname"><em>frames</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Print a frame set. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>Frame set to print</td></tr>
+<p>Print a frame set. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>Frame set to print</td></tr>
   </table>
+  </dd>
 </dl>
-This function prints all frames in a CPL frame set. 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00393">393</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00427">fors_frame_print()</a>.
-<p>
-Referenced by <a class="el" href="fors__dfs_8c-source.html#l00230">fors_begin()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g375049f68639265267adcdc11d161bc3"></a><!-- doxytag: member="fors_utils.c::fors_frame_print" ref="g375049f68639265267adcdc11d161bc3" args="(const cpl_frame *f)" -->
+<p>This function prints all frames in a CPL frame set. </p>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00393">393</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+<p>References <a class="el" href="fors__utils_8c_source.html#l00427">fors_frame_print()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dfs_8c_source.html#l00230">fors_begin()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga6692a0ba541b3e7f99654f844aee40c6"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_frame_print           </td>
+          <td class="memname">void fors_frame_print </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>f</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>f</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Print a frame. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>f</em> </td><td>Frame to print</td></tr>
+<p>Print a frame. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">f</td><td>Frame to print</td></tr>
   </table>
+  </dd>
 </dl>
-This function prints a CPL frame. 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00427">427</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00344">fors_frame_get_group_string()</a>, <a class="el" href="fors__utils_8c-source.html#l00369">fors_frame_get_level_string()</a>, and <a class="el" href="fors__utils_8c-source.html#l00319">fors_frame_get_type_string()</a>.
-<p>
-Referenced by <a class="el" href="fors__dfs_8c-source.html#l00258">fors_end()</a>, and <a class="el" href="fors__utils_8c-source.html#l00393">fors_frameset_print()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gea84af835a842fc000695c7ab11f350a"></a><!-- doxytag: member="fors_utils.c::fors_frameset_extract" ref="gea84af835a842fc000695c7ab11f350a" args="(const cpl_frameset *frames, const char *tag)" -->
+<p>This function prints a CPL frame. </p>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00427">427</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+<p>References <a class="el" href="fors__utils_8c_source.html#l00344">fors_frame_get_group_string()</a>, <a class="el" href="fors__utils_8c_source.html#l00369">fors_frame_get_level_string()</a>, and <a class="el" href="fors__utils_8c_source.html#l00319">fors_frame_get_type_string()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dfs_8c_source.html#l00258">fors_end()</a>, and <a class="el" href="fors__utils_8c_source.html#l00393">fors_frameset_print()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga467ac093c1e2d21f9e2dfc9afcb97744"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_frameset* fors_frameset_extract           </td>
+          <td class="memname">cpl_frameset* fors_frameset_extract </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">const cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Extract frames with given tag from frameset. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>frame set </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>to search for </td></tr>
+<p>Extract frames with given tag from frameset. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>frame set </td></tr>
+    <tr><td class="paramname">tag</td><td>to search for </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated, possibly empty, frameset, or NULL on error </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>newly allocated, possibly empty, frameset, or NULL on error </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00468">468</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias__impl_8c_source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c_source.html#l00103">fors_dark()</a>, <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photome [...]
 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00468">468</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__bias__impl_8c-source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00103">fors_dark()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry [...]
 </div>
-</div><p>
-<a class="anchor" name="g2d2de37f396f758d304d234a5c38c861"></a><!-- doxytag: member="fors_utils.c::fors_type_get_string" ref="g2d2de37f396f758d304d234a5c38c861" args="(cpl_type t)" -->
+</div>
+<a class="anchor" id="ga2e98c2130598c09a1c5d3344306463fd"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* fors_type_get_string           </td>
+          <td class="memname">const char* fors_type_get_string </td>
           <td>(</td>
-          <td class="paramtype">cpl_type </td>
-          <td class="paramname"> <em>t</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_type </td>
+          <td class="paramname"><em>t</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Textual representation of CPL type. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>t</em> </td><td>type </td></tr>
+<p>Textual representation of CPL type. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">t</td><td>type </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>the given type as a string </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the given type as a string </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00496">496</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00496">496</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l00128">fors_image_new()</a>, and <a class="el" href="fors__photometry__impl_8c-source.html#l02756">fors_photometry_read_input()</a>.
+<p>Referenced by <a class="el" href="fors__photometry__impl_8c_source.html#l02698">fors_photometry_read_input()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g6f2731cef63a65795c0999284006a7c4"></a><!-- doxytag: member="fors_utils.c::fors_parameterlist_set_defaults" ref="g6f2731cef63a65795c0999284006a7c4" args="(cpl_parameterlist *parlist)" -->
+<a class="anchor" id="ga198405eae0245c17f2719e40fc4c8b42"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_parameterlist_set_defaults           </td>
+          <td class="memname">void fors_parameterlist_set_defaults </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Set unset parameters to default value. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parlist</em> </td><td>A parameter list</td></tr>
+<p>Set unset parameters to default value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parlist</td><td>A parameter list</td></tr>
   </table>
+  </dd>
 </dl>
-The function initializes the provided parameter list by setting the current parameter values to the default parameter values. 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00545">545</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__bias-test_8c-source.html#l00062">test_bias()</a>, <a class="el" href="fors__dark-test_8c-source.html#l00062">test_dark()</a>, <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>, <a class="el" href="fors__img__science-test_8c-source.html#l00057">test_img_science()</a>, <a class="el" href="fors__img__screen__flat-test_8c-source.html#l00065">test_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat-test_8c-so [...]
-</div>
-</div><p>
-<a class="anchor" name="g833fbeca7835f9c594deb0a8752d8b74"></a><!-- doxytag: member="fors_utils.c::fors_imagelist_collapse_create" ref="g833fbeca7835f9c594deb0a8752d8b74" args="(const cpl_imagelist *ilist)" -->
+<p>The function initializes the provided parameter list by setting the current parameter values to the default parameter values. </p>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00545">545</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias-test_8c_source.html#l00062">test_bias()</a>, <a class="el" href="fors__dark-test_8c_source.html#l00062">test_dark()</a>, <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>, <a class="el" href="fors__img__science-test_8c_source.html#l00057">test_img_science()</a>, <a class="el" href="fors__img__screen__flat-test_8c_source.html#l00065">test_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat-test_8c [...]
+
+</div>
+</div>
+<a class="anchor" id="gabb34a534e28308533f300ea11ec7a3a3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* fors_imagelist_collapse_create           </td>
+          <td class="memname">cpl_image* fors_imagelist_collapse_create </td>
           <td>(</td>
-          <td class="paramtype">const cpl_imagelist * </td>
-          <td class="paramname"> <em>ilist</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_imagelist * </td>
+          <td class="paramname"><em>ilist</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Workaround for cpl_imagelist_collapse_create. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>images</em> </td><td>see cpl_imagelist_collapse_create() </td></tr>
+<p>Workaround for cpl_imagelist_collapse_create. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">images</td><td>see cpl_imagelist_collapse_create() </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>see cpl_imagelist_collapse_create()</dd></dl>
-This function is the same as cpl_imagelist_collapse_create but does not allocate a new bad pixel buffer when it is not needed.<p>
-Images with bpm causes the function cpl_image_get_median_window() to slowdown by a factor ~200000 for a 2 megapixel image and 9 pixel window 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00597">597</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l01665">fors_image_collapse_create()</a>, and <a class="el" href="fors__image_8c-source.html#l01839">fors_image_collapse_median_create()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g2d1787d975000e60e8790fc656d538f6"></a><!-- doxytag: member="fors_utils.c::fors_imagelist_collapse_median_create" ref="g2d1787d975000e60e8790fc656d538f6" args="(const cpl_imagelist *ilist)" -->
+<dl class="section return"><dt>Returns</dt><dd>see cpl_imagelist_collapse_create()</dd></dl>
+<p>This function is the same as cpl_imagelist_collapse_create but does not allocate a new bad pixel buffer when it is not needed.</p>
+<p>Images with bpm causes the function cpl_image_get_median_window() to slowdown by a factor ~200000 for a 2 megapixel image and 9 pixel window </p>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00597">597</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__image_8c_source.html#l01674">fors_image_collapse_create()</a>, and <a class="el" href="fors__image_8c_source.html#l01848">fors_image_collapse_median_create()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaa55c5fd8ade8f10e441297c0cda96093"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* fors_imagelist_collapse_median_create           </td>
+          <td class="memname">cpl_image* fors_imagelist_collapse_median_create </td>
           <td>(</td>
-          <td class="paramtype">const cpl_imagelist * </td>
-          <td class="paramname"> <em>ilist</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const cpl_imagelist * </td>
+          <td class="paramname"><em>ilist</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Workaround for cpl_imagelist_collapse_median_create. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>images</em> </td><td>see fors_imagelist_collapse_create </td></tr>
+<p>Workaround for cpl_imagelist_collapse_median_create. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">images</td><td>see fors_imagelist_collapse_create </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>see fors_imagelist_collapse_create</dd></dl>
-See fors_imagelist_collapse_create 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00616">616</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l01839">fors_image_collapse_median_create()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g71645af45bc192964d3170f28c671240"></a><!-- doxytag: member="fors_utils.c::fors_angle_diff" ref="g71645af45bc192964d3170f28c671240" args="(const double *a1, const double *a2)" -->
+<dl class="section return"><dt>Returns</dt><dd>see fors_imagelist_collapse_create</dd></dl>
+<p>See fors_imagelist_collapse_create </p>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00616">616</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__image_8c_source.html#l01848">fors_image_collapse_median_create()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga69350709e5f9874601c729becd315e81"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_angle_diff           </td>
+          <td class="memname">double fors_angle_diff </td>
           <td>(</td>
-          <td class="paramtype">const double * </td>
-          <td class="paramname"> <em>a1</em>, </td>
+          <td class="paramtype">const double * </td>
+          <td class="paramname"><em>a1</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const double * </td>
-          <td class="paramname"> <em>a2</em></td><td> </td>
+          <td class="paramtype">const double * </td>
+          <td class="paramname"><em>a2</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Difference between angles. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>a1</em> </td><td>1st angle (radians) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>a2</em> </td><td>2nd angle (radians) </td></tr>
+<p>Difference between angles. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">a1</td><td>1st angle (radians) </td></tr>
+    <tr><td class="paramname">a2</td><td>2nd angle (radians) </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>difference in [0;pi] </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>difference in [0;pi] </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00636">636</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00636">636</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l01023">match_patterns()</a>.
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l01023">match_patterns()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ge561fe29b3673b34094804e26ece5e8e"></a><!-- doxytag: member="fors_utils.c::fors_msg_macro" ref="ge561fe29b3673b34094804e26ece5e8e" args="(cpl_msg_severity level, const char *fct, const char *format,...)" -->
+<a class="anchor" id="gae98c540953f671b35817aac071aa4adc"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_msg_macro           </td>
+          <td class="memname">void fors_msg_macro </td>
           <td>(</td>
-          <td class="paramtype">cpl_msg_severity </td>
-          <td class="paramname"> <em>level</em>, </td>
+          <td class="paramtype">cpl_msg_severity </td>
+          <td class="paramname"><em>level</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>fct</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>fct</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>format</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>format</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype"> </td>
-          <td class="paramname"> <em>...</em></td><td> </td>
+          <td class="paramtype"> </td>
+          <td class="paramname"><em>...</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Print message. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>message level </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fct</em> </td><td>function id </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>format</em> </td><td>printf style format string</td></tr>
+</div><div class="memdoc">
+
+<p>Print message. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">level</td><td>message level </td></tr>
+    <tr><td class="paramname">fct</td><td>function id </td></tr>
+    <tr><td class="paramname">format</td><td>printf style format string</td></tr>
   </table>
+  </dd>
 </dl>
-This function can be called directly or through the macro fors_msg() 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00660">660</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00649">MAX_MESSAGE_LENGTH</a>.
-</div>
-</div><p>
-<a class="anchor" name="ga3c534a3edd597c2c5a03f0ad0ccc8e3"></a><!-- doxytag: member="fors_utils.c::fors_utils_median_corr" ref="ga3c534a3edd597c2c5a03f0ad0ccc8e3" args="(int n)" -->
+<p>This function can be called directly or through the macro fors_msg() </p>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00660">660</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga42ad9e96d57c915b0a28a40dd838c9a3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double fors_utils_median_corr           </td>
+          <td class="memname">double fors_utils_median_corr </td>
           <td>(</td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>n</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>n</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-median stacking correction factor 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>number of stacked frames </td></tr>
+<p>median stacking correction factor </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">n</td><td>number of stacked frames </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>correction factor defined as the ratio sigma_median / sigma_avg</dd></dl>
-sigma_median is the propagated error when computing the median of n numbers with the same error. sigma_avg is the propagated error of the average of n numbers with the same error. 
-<p>
-Definition at line <a class="el" href="fors__utils_8c-source.html#l00696">696</a> of file <a class="el" href="fors__utils_8c-source.html">fors_utils.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l01839">fors_image_collapse_median_create()</a>, and <a class="el" href="fors__bias__impl_8c-source.html#l00172">write_qc()</a>.
-</div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+<dl class="section return"><dt>Returns</dt><dd>correction factor defined as the ratio sigma_median / sigma_avg</dd></dl>
+<p>sigma_median is the propagated error when computing the median of n numbers with the same error. sigma_avg is the propagated error of the average of n numbers with the same error. </p>
+
+<p>Definition at line <a class="el" href="fors__utils_8c_source.html#l00696">696</a> of file <a class="el" href="fors__utils_8c_source.html">fors_utils.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__image_8c_source.html#l01848">fors_image_collapse_median_create()</a>.</p>
+
+</div>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__zeropoint.html b/html/group__fors__zeropoint.html
index df9c42f..2cf6383 100644
--- a/html/group__fors__zeropoint.html
+++ b/html/group__fors__zeropoint.html
@@ -1,892 +1,956 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_recipe Recipe</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>fors_recipe Recipe</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_zeropoint::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_zeropoint::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#gfd13851752bdf8327fb014e47c6bb104">get_zeropoint</a> (fors_star_list *stars, double cutoffE, double cutoffk, double dext_coeff, double dcolor_term, double avg_airmass, double *dzeropoint, int *n)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute zeropoint.  <a href="#gfd13851752bdf8327fb014e47c6bb104"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g3222d4735fe218be5da224f3a146580b">fors_zeropoint_astrometry</a> (const cpl_frameset *std_cat_frames, char filter_band, double color_correct, double dcolor_correct, const identify_method *id_method, fors_star_list *extracted, cpl_propertylist *wcs_header, fors_std_star_list **std_cat, cpl_image **histogram)< [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Load standard star catalogue(s) and do the astrometry.  <a href="#g3222d4735fe218be5da224f3a146580b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g5a8ae7f99786a3fdc7df6a07d90d905c">fors_zeropoint_astrometry_get_wcs_shift_px</a> (const fors_star_list *stars, double *dx, double *dy)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Determine the median difference std_star.pixel - star.pixel.  <a href="#g5a8ae7f99786a3fdc7df6a07d90d905c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#gd1a70566b3bf818a95a6c3e2312d0710">fors_zeropoint_astrometry_shift_wcs_origin</a> (cpl_propertylist *header, double dx, double dy)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Shift the origin of the WCS in a 2-dimensional frame header.  <a href="#gd1a70566b3bf818a95a6c3e2312d0710"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g2ea192495f55d98f1068cae2b1921cea">fors_zeropoint_astrometry_apply_unidentified_xy2radec</a> (fors_star_list *stars, const cpl_propertylist *header)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create non-standard stars (using the fors_std_star object) connected to the star list entries and assign RA & DEC.  <a href="#g2ea192495f55d98f1068cae2b1921cea"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g06887d7be84289a1ec9c7b7350e69412">fors_zeropoint_errorstate_dump_as_warning</a> (unsigned self, unsigned first, unsigned last)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Dump one error state of the error history.  <a href="#g06887d7be84289a1ec9c7b7350e69412"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#gc2cbbec604bd9b8cabf9f83fe71037da">fors_zeropoint_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#gc2cbbec604bd9b8cabf9f83fe71037da"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#gffa00ce29ad3796187cf1336e4fcbb61">fors_zeropoint</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#gffa00ce29ad3796187cf1336e4fcbb61"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g5ce973af397768a6d73de2a88b0d2ab3">zeropoint_inside</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">determine if zeropoint is inside cuts  <a href="#g5ce973af397768a6d73de2a88b0d2ab3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#g4abb403976fc3ddcaa614c59a44590c9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#gb81bff380e7ee1d22c3c6620620771bf">fors_zeropoint_create</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#gb81bff380e7ee1d22c3c6620620771bf"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g9aa95cb40ce84db79ab3006d51e7059d">fors_zeropoint_exec</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#g9aa95cb40ce84db79ab3006d51e7059d"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g095db561f9e785a5a4114d97f4597baf">fors_zeropoint_destroy</a> (cpl_plugin *plugin)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#g095db561f9e785a5a4114d97f4597baf"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g340f382a9109a8ad614c360b99465367"></a><!-- doxytag: member="fors_zeropoint::fors_zeropoint_name" ref="g340f382a9109a8ad614c360b99465367" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g340f382a9109a8ad614c360b99465367">fors_zeropoint_name</a> = "fors_zeropoint"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb767da8d66a60c2cebce3ffcaa774ab2"></a><!-- doxytag: member="fors_zeropoint::fors_zeropoint_description_short" ref="gb767da8d66a60c2cebce3ffcaa774ab2" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#gb767da8d66a60c2cebce3ffcaa774ab2">fors_zeropoint_description_short</a> = "Compute zeropoint"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g00e12f69bfe9efa90b14931c583e30d5"></a><!-- doxytag: member="fors_zeropoint::fors_zeropoint_author" ref="g00e12f69bfe9efa90b14931c583e30d5" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g00e12f69bfe9efa90b14931c583e30d5">fors_zeropoint_author</a> = "Jonas M. Larsen"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g95121b604add15227dc70f28cef1053c"></a><!-- doxytag: member="fors_zeropoint::fors_zeropoint_email" ref="g95121b604add15227dc70f28cef1053c" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g95121b604add15227dc70f28cef1053c">fors_zeropoint_email</a> = PACKAGE_BUGREPORT</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#g69cec4407efc0bcccde712800aaa577c">fors_zeropoint_description</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_recipe Recipe</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga00f15117674050804680fcb40ed57945"><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga00f15117674050804680fcb40ed57945">get_zeropoint</a> (fors_star_list *stars, double cutoffE, double cutoffk, double dext_coeff, double dcolor_term, double avg_airmass, double *dzeropoint, int *n)</td></tr>
+<tr class="memdesc:ga00f15117674050804680fcb40ed57945"><td class="mdescLeft"> </td><td class="mdescRight">Compute zeropoint.  <a href="#ga00f15117674050804680fcb40ed57945">More...</a><br/></td></tr>
+<tr class="separator:ga00f15117674050804680fcb40ed57945"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac3585e0948fbad1f1e2046a01baaedb3"><td class="memItemLeft" align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#gac3585e0948fbad1f1e2046a01baaedb3">fors_zeropoint_astrometry</a> (const cpl_frameset *std_cat_frames, char filter_band, double color_correct, double dcolor_correct, const identify_method *id_method, fors_star_list *extracted, cpl_propertylist *wcs_header, fors_std [...]
+<tr class="memdesc:gac3585e0948fbad1f1e2046a01baaedb3"><td class="mdescLeft"> </td><td class="mdescRight">Load standard star catalogue(s) and do the astrometry.  <a href="#gac3585e0948fbad1f1e2046a01baaedb3">More...</a><br/></td></tr>
+<tr class="separator:gac3585e0948fbad1f1e2046a01baaedb3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga34215908758f4269782d8c322f01b266"><td class="memItemLeft" align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga34215908758f4269782d8c322f01b266">fors_zeropoint_astrometry_get_wcs_shift_px</a> (const fors_star_list *stars, double *dx, double *dy)</td></tr>
+<tr class="memdesc:ga34215908758f4269782d8c322f01b266"><td class="mdescLeft"> </td><td class="mdescRight">Determine the median difference std_star.pixel - star.pixel.  <a href="#ga34215908758f4269782d8c322f01b266">More...</a><br/></td></tr>
+<tr class="separator:ga34215908758f4269782d8c322f01b266"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaff77420ce4f300b2f80d53ebf6130020"><td class="memItemLeft" align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#gaff77420ce4f300b2f80d53ebf6130020">fors_zeropoint_astrometry_shift_wcs_origin</a> (cpl_propertylist *header, double dx, double dy)</td></tr>
+<tr class="memdesc:gaff77420ce4f300b2f80d53ebf6130020"><td class="mdescLeft"> </td><td class="mdescRight">Shift the origin of the WCS in a 2-dimensional frame header.  <a href="#gaff77420ce4f300b2f80d53ebf6130020">More...</a><br/></td></tr>
+<tr class="separator:gaff77420ce4f300b2f80d53ebf6130020"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2ec4f355c2423ad8517fd8eb6636f96f"><td class="memItemLeft" align="right" valign="top">static cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga2ec4f355c2423ad8517fd8eb6636f96f">fors_zeropoint_astrometry_apply_unidentified_xy2radec</a> (fors_star_list *stars, const cpl_propertylist *header)</td></tr>
+<tr class="memdesc:ga2ec4f355c2423ad8517fd8eb6636f96f"><td class="mdescLeft"> </td><td class="mdescRight">Create non-standard stars (using the fors_std_star object) connected to the star list entries and assign RA & DEC.  <a href="#ga2ec4f355c2423ad8517fd8eb6636f96f">More...</a><br/></td></tr>
+<tr class="separator:ga2ec4f355c2423ad8517fd8eb6636f96f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0292c8d9272f7411e58f3581c8bdab0d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga0292c8d9272f7411e58f3581c8bdab0d">fors_zeropoint_errorstate_dump_as_warning</a> (unsigned self, unsigned first, unsigned last)</td></tr>
+<tr class="memdesc:ga0292c8d9272f7411e58f3581c8bdab0d"><td class="mdescLeft"> </td><td class="mdescRight">Dump one error state of the error history.  <a href="#ga0292c8d9272f7411e58f3581c8bdab0d">More...</a><br/></td></tr>
+<tr class="separator:ga0292c8d9272f7411e58f3581c8bdab0d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1fc8917da8d302964ad2d2dc6d0eff67"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga1fc8917da8d302964ad2d2dc6d0eff67">fors_zeropoint_define_parameters</a> (cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga1fc8917da8d302964ad2d2dc6d0eff67"><td class="mdescLeft"> </td><td class="mdescRight">Define recipe parameters.  <a href="#ga1fc8917da8d302964ad2d2dc6d0eff67">More...</a><br/></td></tr>
+<tr class="separator:ga1fc8917da8d302964ad2d2dc6d0eff67"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6e4245b398bb089daaaed5ec204e0c4f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga6e4245b398bb089daaaed5ec204e0c4f">fors_zeropoint</a> (cpl_frameset *frames, const cpl_parameterlist *parameters)</td></tr>
+<tr class="memdesc:ga6e4245b398bb089daaaed5ec204e0c4f"><td class="mdescLeft"> </td><td class="mdescRight">Do the processing.  <a href="#ga6e4245b398bb089daaaed5ec204e0c4f">More...</a><br/></td></tr>
+<tr class="separator:ga6e4245b398bb089daaaed5ec204e0c4f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0fca769fa4f247f3fff26ea6ebdd4429"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga0fca769fa4f247f3fff26ea6ebdd4429">zeropoint_inside</a> (const <a class="el" href="struct__fors__star.html">fors_star</a> *s, void *data)</td></tr>
+<tr class="memdesc:ga0fca769fa4f247f3fff26ea6ebdd4429"><td class="mdescLeft"> </td><td class="mdescRight">determine if zeropoint is inside cuts  <a href="#ga0fca769fa4f247f3fff26ea6ebdd4429">More...</a><br/></td></tr>
+<tr class="separator:ga0fca769fa4f247f3fff26ea6ebdd4429"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693">cpl_plugin_get_info</a> (cpl_pluginlist *<a class="el" href="structlist.html">list</a>)</td></tr>
+<tr class="memdesc:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="mdescLeft"> </td><td class="mdescRight">Build the list of available plugins, for this module.  <a href="#ga31d1fccd4cd15b1c1f3c5edc8cb18693">More...</a><br/></td></tr>
+<tr class="separator:ga31d1fccd4cd15b1c1f3c5edc8cb18693"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga61984b5bc62bd25dbff9e414a7db42e3"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga61984b5bc62bd25dbff9e414a7db42e3">fors_zeropoint_create</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga61984b5bc62bd25dbff9e414a7db42e3"><td class="mdescLeft"> </td><td class="mdescRight">Setup the recipe options.  <a href="#ga61984b5bc62bd25dbff9e414a7db42e3">More...</a><br/></td></tr>
+<tr class="separator:ga61984b5bc62bd25dbff9e414a7db42e3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga606fac5ca2e3be91e2e65dbb943cdc66"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga606fac5ca2e3be91e2e65dbb943cdc66">fors_zeropoint_exec</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga606fac5ca2e3be91e2e65dbb943cdc66"><td class="mdescLeft"> </td><td class="mdescRight">Execute the plugin instance given by the interface.  <a href="#ga606fac5ca2e3be91e2e65dbb943cdc66">More...</a><br/></td></tr>
+<tr class="separator:ga606fac5ca2e3be91e2e65dbb943cdc66"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga77d581a8f85987937b006ba302ca4c7e"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint.html#ga77d581a8f85987937b006ba302ca4c7e">fors_zeropoint_destroy</a> (cpl_plugin *plugin)</td></tr>
+<tr class="memdesc:ga77d581a8f85987937b006ba302ca4c7e"><td class="mdescLeft"> </td><td class="mdescRight">Destroy what has been created by the 'create' function.  <a href="#ga77d581a8f85987937b006ba302ca4c7e">More...</a><br/></td></tr>
+<tr class="separator:ga77d581a8f85987937b006ba302ca4c7e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga41f4d11f7d98cbfa83df4f763403d9f4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga41f4d11f7d98cbfa83df4f763403d9f4"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint_name</b> = "fors_zeropoint"</td></tr>
+<tr class="separator:ga41f4d11f7d98cbfa83df4f763403d9f4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gade9dd2a70a958c92b9bbec230cb084e3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gade9dd2a70a958c92b9bbec230cb084e3"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint_description_short</b> = "Compute zeropoint"</td></tr>
+<tr class="separator:gade9dd2a70a958c92b9bbec230cb084e3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa413e01f84b2fe6e34410f303ffcbeed"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa413e01f84b2fe6e34410f303ffcbeed"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint_author</b> = "Jonas M. Larsen"</td></tr>
+<tr class="separator:gaa413e01f84b2fe6e34410f303ffcbeed"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9bab2c41544c905f4b3728bc7fa7cce1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9bab2c41544c905f4b3728bc7fa7cce1"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint_email</b> = PACKAGE_BUGREPORT</td></tr>
+<tr class="separator:ga9bab2c41544c905f4b3728bc7fa7cce1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa95afd3326bfec044eed5eab0f85d1f7"><td class="memItemLeft" align="right" valign="top">const char *const </td><td class="memItemRight" valign="bottom"><b>fors_zeropoint_description</b></td></tr>
+<tr class="separator:gaa95afd3326bfec044eed5eab0f85d1f7"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-See recipe description for details. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_zeropoint_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>See recipe description for details. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(std_frame); \
-    cpl_frameset_delete(master_bias_frame); \
-    cpl_frameset_delete(master_flat_frame); \
-    cpl_frameset_delete(std_cat_frames); \
-    cpl_frameset_delete(phot_table); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&std); \
-    <a class="code" href="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6">fors_image_delete_const</a>(&master_bias); \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&master_flat); \
-    cpl_table_delete(aligned_phot); \
-    cpl_image_delete(background); \
-    cpl_table_delete(sources); \
-    <a class="code" href="group__fors__extract.html#g2f7149d890f135097366c9389cab25fe">fors_extract_method_delete</a>(&em); \
-    <a class="code" href="group__fors__identify.html#g265af4d62a463db6eea76b808c2a4e8d">fors_identify_method_delete</a>(&im); \
-    fors_std_star_list_delete(&cat, fors_std_star_delete); \
-    <span class="comment">/* All std-stars (and non-std-stars) are linked by the respective star */</span> \
-    <span class="comment">/* objects in "stars", without being referenced by a std-star-list */</span> \
-    <span class="comment">/* object. So they are deleted together with the function */</span> \
-    <span class="comment">/* fors_star_delete() while deleting the list "stars". */</span> \
-    fors_star_list_delete(&stars, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>); \
-    cpl_free((<span class="keywordtype">void</span> *)context); \
-    <a class="code" href="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7">fors_setting_delete</a>(&setting); \
-    cpl_propertylist_delete(qc_phot); \
-    cpl_propertylist_delete(qc_sources); \
-    cpl_propertylist_delete(product_header); \
-    cpl_propertylist_delete(raw_header); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l01558">1558</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_zeropoint_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(std_frame); \</div>
+<div class="line">    cpl_frameset_delete(master_bias_frame); \</div>
+<div class="line">    cpl_frameset_delete(master_flat_frame); \</div>
+<div class="line">    cpl_frameset_delete(std_cat_frames); \</div>
+<div class="line">    cpl_frameset_delete(phot_table); \</div>
+<div class="line">    fors_image_delete(&std); \</div>
+<div class="line">    fors_image_delete_const(&master_bias); \</div>
+<div class="line">    fors_image_delete(&master_flat); \</div>
+<div class="line">    cpl_table_delete(aligned_phot); \</div>
+<div class="line">    cpl_image_delete(background); \</div>
+<div class="line">    cpl_table_delete(sources); \</div>
+<div class="line">    fors_extract_method_delete(&em); \</div>
+<div class="line">    fors_identify_method_delete(&im); \</div>
+<div class="line">    fors_std_star_list_delete(&cat, fors_std_star_delete); \</div>
+<div class="line">    <span class="comment">/* All std-stars (and non-std-stars) are linked by the respective star */</span> \</div>
+<div class="line">    <span class="comment">/* objects in "stars", without being referenced by a std-star-list */</span> \</div>
+<div class="line">    <span class="comment">/* object. So they are deleted together with the function */</span> \</div>
+<div class="line">    <span class="comment">/* fors_star_delete() while deleting the list "stars". */</span> \</div>
+<div class="line">    fors_star_list_delete(&stars, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>); \</div>
+<div class="line">    cpl_free((<span class="keywordtype">void</span> *)context); \</div>
+<div class="line">    fors_setting_delete(&setting); \</div>
+<div class="line">    cpl_propertylist_delete(qc_phot); \</div>
+<div class="line">    cpl_propertylist_delete(qc_sources); \</div>
+<div class="line">    cpl_propertylist_delete(product_header); \</div>
+<div class="line">    cpl_propertylist_delete(raw_header); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l01558">1558</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_star_list_delete(&subset, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>); \</div>
+<div class="line">    fors_star_list_delete(&identified, <a class="code" href="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774" title="Delete object and set pointer to NULL.">fors_star_delete</a>); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l01558">1558</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    fors_star_list_delete(&subset, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>); \
-    fors_star_list_delete(&identified, <a class="code" href="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787">fors_star_delete</a>); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l01558">1558</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_zeropoint_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_std_star_list_delete(&internal_cat, fors_std_star_delete); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l01558">1558</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    fors_std_star_list_delete(&internal_cat, fors_std_star_delete); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l01558">1558</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_zeropoint_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_vector_delete(vdx_long); vdx_long = NULL; \</div>
+<div class="line">    cpl_vector_delete(vdy_long); vdy_long = NULL; \</div>
+<div class="line">    cpl_vector_unwrap(vdx_only_std); vdx_only_std = NULL; \</div>
+<div class="line">    cpl_vector_unwrap(vdy_only_std); vdy_only_std = NULL; \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l01558">1558</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_vector_delete(vdx_long); vdx_long = NULL; \
-    cpl_vector_delete(vdy_long); vdy_long = NULL; \
-    cpl_vector_unwrap(vdx_only_std); vdx_only_std = NULL; \
-    cpl_vector_unwrap(vdy_only_std); vdy_only_std = NULL; \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l01558">1558</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_zeropoint_impl.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_wcs_delete(wcs); wcs = NULL; \</div>
+<div class="line">    cpl_matrix_delete(mradec); mradec = NULL; \</div>
+<div class="line">    cpl_matrix_delete(mxy); mxy = NULL; \</div>
+<div class="line">    cpl_array_delete(wcs_conversion_status); wcs_conversion_status = NULL; \</div>
+<div class="line">    fors_std_star_delete(&unknown); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l01558">1558</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_wcs_delete(wcs); wcs = NULL; \
-    cpl_matrix_delete(mradec); mradec = NULL; \
-    cpl_matrix_delete(mxy); mxy = NULL; \
-    cpl_array_delete(wcs_conversion_status); wcs_conversion_status = NULL; \
-    fors_std_star_delete(&unknown); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l01558">1558</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-</div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="gfd13851752bdf8327fb014e47c6bb104"></a><!-- doxytag: member="fors_zeropoint_impl.c::get_zeropoint" ref="gfd13851752bdf8327fb014e47c6bb104" args="(fors_star_list *stars, double cutoffE, double cutoffk, double dext_coeff, double dcolor_term, double avg_airmass, double *dzeropoint, int *n)" -->
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga00f15117674050804680fcb40ed57945"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static double get_zeropoint           </td>
+          <td class="memname">static double get_zeropoint </td>
           <td>(</td>
-          <td class="paramtype">fors_star_list * </td>
-          <td class="paramname"> <em>stars</em>, </td>
+          <td class="paramtype">fors_star_list * </td>
+          <td class="paramname"><em>stars</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>cutoffE</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>cutoffE</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>cutoffk</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>cutoffk</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dext_coeff</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dext_coeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dcolor_term</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dcolor_term</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>avg_airmass</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>avg_airmass</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>dzeropoint</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>dzeropoint</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>n</em></td><td> </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>n</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Compute zeropoint. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>stars</em> </td><td>list of stars, flags are set to 1 iff star is used in final zeropoint computation </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>cutoffE</em> </td><td>rejection parameter (magnitude) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>cutoffk</em> </td><td>rejection parameter (magnitude) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dext_coeff</em> </td><td>extinction coefficient error </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dcolor_term</em> </td><td>color coefficient error </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dzeropoint</em> </td><td>(output) zeropoint stdev </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>(output) number of stars used for zeropoint computation </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Compute zeropoint. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">stars</td><td>list of stars, flags are set to 1 iff star is used in final zeropoint computation </td></tr>
+    <tr><td class="paramname">cutoffE</td><td>rejection parameter (magnitude) </td></tr>
+    <tr><td class="paramname">cutoffk</td><td>rejection parameter (magnitude) </td></tr>
+    <tr><td class="paramname">dext_coeff</td><td>extinction coefficient error </td></tr>
+    <tr><td class="paramname">dcolor_term</td><td>color coefficient error </td></tr>
+    <tr><td class="paramname">dzeropoint</td><td>(output) zeropoint stdev </td></tr>
+    <tr><td class="paramname">n</td><td>(output) number of stars used for zeropoint computation </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>median zeropoint after rejection of negative outliers </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>median zeropoint after rejection of negative outliers </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l00760">760</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__star_8c_source.html#l00273">fors_star_delete()</a>, <a class="el" href="fors__star_8c_source.html#l00248">fors_star_duplicate()</a>, <a class="el" href="fors__star_8c_source.html#l00309">fors_star_equal()</a>, <a class="el" href="fors__star_8c_source.html#l00504">fors_star_get_zeropoint()</a>, <a class="el" href="fors__star_8c_source.html#l00522">fors_star_get_zeropoint_err()</a>, <a class [...]
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l00760">760</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__star_8c-source.html#l00273">fors_star_delete()</a>, <a class="el" href="fors__star_8c-source.html#l00248">fors_star_duplicate()</a>, <a class="el" href="fors__star_8c-source.html#l00309">fors_star_equal()</a>, <a class="el" href="fors__star_8c-source.html#l00504">fors_star_get_zeropoint()</a>, <a class="el" href="fors__s [...]
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g3222d4735fe218be5da224f3a146580b"></a><!-- doxytag: member="fors_zeropoint_impl.c::fors_zeropoint_astrometry" ref="g3222d4735fe218be5da224f3a146580b" args="(const cpl_frameset *std_cat_frames, char filter_band, double color_correct, double dcolor_correct, const identify_method *id_method, fors_star_list *extracted, cpl_propertylist *wcs_header, fors_std_star_list **std_cat, cpl_image **histogram)" -->
+</div>
+<a class="anchor" id="gac3585e0948fbad1f1e2046a01baaedb3"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_error_code fors_zeropoint_astrometry           </td>
+          <td class="memname">static cpl_error_code fors_zeropoint_astrometry </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frameset * </td>
-          <td class="paramname"> <em>std_cat_frames</em>, </td>
+          <td class="paramtype">const cpl_frameset * </td>
+          <td class="paramname"><em>std_cat_frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">char </td>
-          <td class="paramname"> <em>filter_band</em>, </td>
+          <td class="paramtype">char </td>
+          <td class="paramname"><em>filter_band</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>color_correct</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>color_correct</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dcolor_correct</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dcolor_correct</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const identify_method * </td>
-          <td class="paramname"> <em>id_method</em>, </td>
+          <td class="paramtype">const identify_method * </td>
+          <td class="paramname"><em>id_method</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">fors_star_list * </td>
-          <td class="paramname"> <em>extracted</em>, </td>
+          <td class="paramtype">fors_star_list * </td>
+          <td class="paramname"><em>extracted</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>wcs_header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>wcs_header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">fors_std_star_list ** </td>
-          <td class="paramname"> <em>std_cat</em>, </td>
+          <td class="paramtype">fors_std_star_list ** </td>
+          <td class="paramname"><em>std_cat</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image ** </td>
-          <td class="paramname"> <em>histogram</em></td><td> </td>
+          <td class="paramtype">cpl_image ** </td>
+          <td class="paramname"><em>histogram</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Load standard star catalogue(s) and do the astrometry. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>std_cat_frames</em> </td><td>Standard star catalogue frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>filter_band</em> </td><td>Standard star catalogue import: optical filter band </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>color_correct</em> </td><td>Standard star catalogue import: color correction term </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dcolor_correct</em> </td><td>Standard star catalogue import: 1-sigma error of color correction term </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>id_method</em> </td><td>FORS pipeline pattern identification method </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>extracted</em> </td><td>Extracted sources (modified) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wcs_header</em> </td><td>WCS header (modified) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>std_cat</em> </td><td>(Optional) output standard star catalogue, also provided in some error cases, can be NULL </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Load standard star catalogue(s) and do the astrometry. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">std_cat_frames</td><td>Standard star catalogue frames </td></tr>
+    <tr><td class="paramname">filter_band</td><td>Standard star catalogue import: optical filter band </td></tr>
+    <tr><td class="paramname">color_correct</td><td>Standard star catalogue import: color correction term </td></tr>
+    <tr><td class="paramname">dcolor_correct</td><td>Standard star catalogue import: 1-sigma error of color correction term </td></tr>
+    <tr><td class="paramname">id_method</td><td>FORS pipeline pattern identification method </td></tr>
+    <tr><td class="paramname">extracted</td><td>Extracted sources (modified) </td></tr>
+    <tr><td class="paramname">wcs_header</td><td>WCS header (modified) </td></tr>
+    <tr><td class="paramname">std_cat</td><td>(Optional) output standard star catalogue, also provided in some error cases, can be NULL </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL error code</dd></dl>
-<dl compact><dt><b>Output Details:</b></dt><dd><ul>
-<li>If a standard star catalogue could be loaded, it will be returned also in the case of error. This means, that it must always be deleted. </li></ul>
+<dl class="section return"><dt>Returns</dt><dd>CPL error code</dd></dl>
+<dl class="section user"><dt>Output Details:</dt><dd><ul>
+<li>If a standard star catalogue could be loaded, it will be returned also in the case of error. This means, that it must always be deleted. </li>
+</ul>
 </dd></dl>
 
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l01107">1107</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__identify_8c-source.html#l00372">fors_identify()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l01423">fors_zeropoint_astrometry_apply_unidentified_xy2radec()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l01270">fors_zeropoint_astrometry_get_wcs_shift_px()</a>, <a class="el" href="fors__ze [...]
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l01107">1107</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__identify_8c_source.html#l00372">fors_identify()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l01423">fors_zeropoint_astrometry_apply_unidentified_xy2radec()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l01270">fors_zeropoint_astrometry_get_wcs_shift_px()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l01351">fors_zeropoint_astrometry_shi [...]
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g5a8ae7f99786a3fdc7df6a07d90d905c"></a><!-- doxytag: member="fors_zeropoint_impl.c::fors_zeropoint_astrometry_get_wcs_shift_px" ref="g5a8ae7f99786a3fdc7df6a07d90d905c" args="(const fors_star_list *stars, double *dx, double *dy)" -->
+<a class="anchor" id="ga34215908758f4269782d8c322f01b266"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_error_code fors_zeropoint_astrometry_get_wcs_shift_px           </td>
+          <td class="memname">static cpl_error_code fors_zeropoint_astrometry_get_wcs_shift_px </td>
           <td>(</td>
-          <td class="paramtype">const fors_star_list * </td>
-          <td class="paramname"> <em>stars</em>, </td>
+          <td class="paramtype">const fors_star_list * </td>
+          <td class="paramname"><em>stars</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>dx</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>dx</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>dy</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>dy</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Determine the median difference std_star.pixel - star.pixel. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>stars</em> </td><td>Star list contain (at least partially) pointers to std stars </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dx</em> </td><td>(Output) median x difference </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dy</em> </td><td>(Output) median y difference </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Determine the median difference std_star.pixel - star.pixel. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">stars</td><td>Star list contain (at least partially) pointers to std stars </td></tr>
+    <tr><td class="paramname">dx</td><td>(Output) median x difference </td></tr>
+    <tr><td class="paramname">dy</td><td>(Output) median y difference </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL error code </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>CPL error code </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l01270">1270</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l01270">1270</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__star_8h-source.html#l00054">_fors_star::id</a>, and <a class="el" href="fors__star_8h-source.html#l00037">_fors_star::pixel</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l01107">fors_zeropoint_astrometry()</a>.
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l01107">fors_zeropoint_astrometry()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gd1a70566b3bf818a95a6c3e2312d0710"></a><!-- doxytag: member="fors_zeropoint_impl.c::fors_zeropoint_astrometry_shift_wcs_origin" ref="gd1a70566b3bf818a95a6c3e2312d0710" args="(cpl_propertylist *header, double dx, double dy)" -->
+<a class="anchor" id="gaff77420ce4f300b2f80d53ebf6130020"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_error_code fors_zeropoint_astrometry_shift_wcs_origin           </td>
+          <td class="memname">static cpl_error_code fors_zeropoint_astrometry_shift_wcs_origin </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dx</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dx</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dy</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dy</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Shift the origin of the WCS in a 2-dimensional frame header. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Frame header </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dx</em> </td><td>X shift in pixels </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dy</em> </td><td>Y shift in pixels </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Shift the origin of the WCS in a 2-dimensional frame header. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>Frame header </td></tr>
+    <tr><td class="paramname">dx</td><td>X shift in pixels </td></tr>
+    <tr><td class="paramname">dy</td><td>Y shift in pixels </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL error code </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>CPL error code </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l01351">1351</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l01351">1351</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l01107">fors_zeropoint_astrometry()</a>.
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l01107">fors_zeropoint_astrometry()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g2ea192495f55d98f1068cae2b1921cea"></a><!-- doxytag: member="fors_zeropoint_impl.c::fors_zeropoint_astrometry_apply_unidentified_xy2radec" ref="g2ea192495f55d98f1068cae2b1921cea" args="(fors_star_list *stars, const cpl_propertylist *header)" -->
+<a class="anchor" id="ga2ec4f355c2423ad8517fd8eb6636f96f"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_error_code fors_zeropoint_astrometry_apply_unidentified_xy2radec           </td>
+          <td class="memname">static cpl_error_code fors_zeropoint_astrometry_apply_unidentified_xy2radec </td>
           <td>(</td>
-          <td class="paramtype">fors_star_list * </td>
-          <td class="paramname"> <em>stars</em>, </td>
+          <td class="paramtype">fors_star_list * </td>
+          <td class="paramname"><em>stars</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em></td><td> </td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>header</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Create non-standard stars (using the fors_std_star object) connected to the star list entries and assign RA & DEC. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>stars</em> </td><td>Star list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Frame header containing WCS </td></tr>
+<p>Create non-standard stars (using the fors_std_star object) connected to the star list entries and assign RA & DEC. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">stars</td><td>Star list </td></tr>
+    <tr><td class="paramname">header</td><td>Frame header containing WCS </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Non-standard star list, NULL in the case of error</dd></dl>
-This means, that at the end for every star from the star-list the referenced standard-star-object should be deleted, then the existing standard-star-list object without deleting the entries, and finally the star-list-object. 
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l01423">1423</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__star_8h-source.html#l00054">_fors_star::id</a>, and <a class="el" href="fors__star_8h-source.html#l00037">_fors_star::pixel</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l01107">fors_zeropoint_astrometry()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g06887d7be84289a1ec9c7b7350e69412"></a><!-- doxytag: member="fors_zeropoint_impl.c::fors_zeropoint_errorstate_dump_as_warning" ref="g06887d7be84289a1ec9c7b7350e69412" args="(unsigned self, unsigned first, unsigned last)" -->
+<dl class="section return"><dt>Returns</dt><dd>Non-standard star list, NULL in the case of error</dd></dl>
+<p>This means, that at the end for every star from the star-list the referenced standard-star-object should be deleted, then the existing standard-star-list object without deleting the entries, and finally the star-list-object. </p>
+
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l01423">1423</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l01107">fors_zeropoint_astrometry()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga0292c8d9272f7411e58f3581c8bdab0d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_zeropoint_errorstate_dump_as_warning           </td>
+          <td class="memname">void fors_zeropoint_errorstate_dump_as_warning </td>
           <td>(</td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>self</em>, </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>self</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>first</em>, </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>first</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>last</em></td><td> </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>last</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Dump one error state of the error history. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>self</em> </td><td></td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>first</em> </td><td></td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>last</em> </td><td></td></tr>
+</div><div class="memdoc">
+
+<p>Dump one error state of the error history. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">self</td><td></td></tr>
+    <tr><td class="paramname">first</td><td></td></tr>
+    <tr><td class="paramname">last</td><td></td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l01567">1567</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l01567">1567</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gc2cbbec604bd9b8cabf9f83fe71037da"></a><!-- doxytag: member="fors_zeropoint_impl.c::fors_zeropoint_define_parameters" ref="gc2cbbec604bd9b8cabf9f83fe71037da" args="(cpl_parameterlist *parameters)" -->
+</div>
+<a class="anchor" id="ga1fc8917da8d302964ad2d2dc6d0eff67"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_zeropoint_define_parameters           </td>
+          <td class="memname">void fors_zeropoint_define_parameters </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Define recipe parameters. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>parameter list to fill </td></tr>
+<p>Define recipe parameters. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parameters</td><td>parameter list to fill </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l00124">124</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-<p>
-References <a class="el" href="fors_2fors__extract_8c-source.html#l00153">fors_extract_define_parameters()</a>, <a class="el" href="fors__identify_8c-source.html#l00082">fors_identify_define_parameters()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00058">fors_zeropoint_name</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint_8c-source.html#l00109">fors_zeropoint_create()</a>, and <a class="el" href="fors__zeropoint-test_8c-source.html#l00057">test_zeropoint()</a>.
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l00124">124</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors_2fors__extract_8c_source.html#l00153">fors_extract_define_parameters()</a>, and <a class="el" href="fors__identify_8c_source.html#l00082">fors_identify_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint_8c_source.html#l00109">fors_zeropoint_create()</a>, and <a class="el" href="fors__zeropoint-test_8c_source.html#l00057">test_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gffa00ce29ad3796187cf1336e4fcbb61"></a><!-- doxytag: member="fors_zeropoint_impl.c::fors_zeropoint" ref="gffa00ce29ad3796187cf1336e4fcbb61" args="(cpl_frameset *frames, const cpl_parameterlist *parameters)" -->
+<a class="anchor" id="ga6e4245b398bb089daaaed5ec204e0c4f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_zeropoint           </td>
+          <td class="memname">void fors_zeropoint </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parameters</em></td><td> </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parameters</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Do the processing. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>input frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parameters</em> </td><td>recipe parameters</td></tr>
+<p>Do the processing. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>input frames </td></tr>
+    <tr><td class="paramname">parameters</td><td>recipe parameters</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">215</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__dfs_8c_source.html#l00819">dfs_get_parameter_double_const()</a>, <a class="el" href="fors__dfs_8c_source.html#l01359">dfs_save_image()</a>, <a class="el" href="fors__tools_8c_source.html#l00130">fors_create_sources_table()</a>, <a class="el" href="fors__dfs_8c_source.html#l01275">fors_dfs_add_exptime()</a>, <a class="el" href="fors__dfs_8c_source.html#l01221">fors_dfs_add_wcs()</a>, <a cla [...]
+
+<p>Referenced by <a class="el" href="fors__zeropoint_8c_source.html#l00158">fors_zeropoint_exec()</a>, and <a class="el" href="fors__zeropoint-test_8c_source.html#l00057">test_zeropoint()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">215</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__dfs_8c-source.html#l00819">dfs_get_parameter_double_const()</a>, <a class="el" href="fors__dfs_8c-source.html#l01323">dfs_save_image()</a>, <a class="el" href="fors__setting_8h-source.html#l00065">_fors_setting::exposure_time</a>, <a class="el" href="fors__setting_8h-source.html#l00063">_fors_setting::filter_name</a>, <a [...]
-<p>
-Referenced by <a class="el" href="fors__zeropoint_8c-source.html#l00158">fors_zeropoint_exec()</a>, and <a class="el" href="fors__zeropoint-test_8c-source.html#l00057">test_zeropoint()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g5ce973af397768a6d73de2a88b0d2ab3"></a><!-- doxytag: member="fors_zeropoint_impl.c::zeropoint_inside" ref="g5ce973af397768a6d73de2a88b0d2ab3" args="(const fors_star *s, void *data)" -->
+</div>
+<a class="anchor" id="ga0fca769fa4f247f3fff26ea6ebdd4429"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static bool zeropoint_inside           </td>
+          <td class="memname">static bool zeropoint_inside </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
-          <td class="paramname"> <em>s</em>, </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__star.html">fors_star</a> * </td>
+          <td class="paramname"><em>s</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-determine if zeropoint is inside cuts 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>star </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>hi and lo cuts </td></tr>
+<p>determine if zeropoint is inside cuts </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">s</td><td>star </td></tr>
+    <tr><td class="paramname">data</td><td>hi and lo cuts </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>true iff the star's zeropoint is inside the given intervals </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>true iff the star's zeropoint is inside the given intervals </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l00725">725</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l00725">725</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-<p>
-References <a class="el" href="fors__star_8c-source.html#l00504">fors_star_get_zeropoint()</a>, and <a class="el" href="fors__star_8c-source.html#l00522">fors_star_get_zeropoint_err()</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint__impl_8c-source.html#l00760">get_zeropoint()</a>.
+<p>References <a class="el" href="fors__star_8c_source.html#l00504">fors_star_get_zeropoint()</a>, and <a class="el" href="fors__star_8c_source.html#l00522">fors_star_get_zeropoint_err()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint__impl_8c_source.html#l00760">get_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g4abb403976fc3ddcaa614c59a44590c9"></a><!-- doxytag: member="fors_zeropoint.c::cpl_plugin_get_info" ref="g4abb403976fc3ddcaa614c59a44590c9" args="(cpl_pluginlist *list)" -->
+<a class="anchor" id="ga31d1fccd4cd15b1c1f3c5edc8cb18693"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int cpl_plugin_get_info           </td>
+          <td class="memname">int cpl_plugin_get_info </td>
           <td>(</td>
-          <td class="paramtype">cpl_pluginlist * </td>
-          <td class="paramname"> <em>list</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_pluginlist * </td>
+          <td class="paramname"><em>list</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Build the list of available plugins, for this module. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>The plugin list</td></tr>
+<p>Build the list of available plugins, for this module. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">list</td><td>The plugin list</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
-Create the recipe instance and make it available to the application using the interface. This function is exported. 
-<p>
-Definition at line <a class="el" href="fors__zeropoint_8c-source.html#l00062">62</a> of file <a class="el" href="fors__zeropoint_8c-source.html">fors_zeropoint.c</a>.
-<p>
-References <a class="el" href="fors__utils_8c-source.html#l00065">fors_get_license()</a>, <a class="el" href="fors__utils_8c-source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00060">fors_zeropoint_author</a>, <a class="el" href="fors__zeropoint_8c-source.html#l00109">fors_zeropoint_create()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00062">fors_zeropoint_description</a>, <a class="el" href="fors__zeropoint__im [...]
-</div>
-</div><p>
-<a class="anchor" name="gb81bff380e7ee1d22c3c6620620771bf"></a><!-- doxytag: member="fors_zeropoint.c::fors_zeropoint_create" ref="gb81bff380e7ee1d22c3c6620620771bf" args="(cpl_plugin *plugin)" -->
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok, -1 otherwise</dd></dl>
+<p>Create the recipe instance and make it available to the application using the interface. This function is exported. </p>
+
+<p>Definition at line <a class="el" href="fors__zeropoint_8c_source.html#l00062">62</a> of file <a class="el" href="fors__zeropoint_8c_source.html">fors_zeropoint.c</a>.</p>
+
+<p>References <a class="el" href="fors__utils_8c_source.html#l00065">fors_get_license()</a>, <a class="el" href="fors__utils_8c_source.html#l00107">fors_get_version_binary()</a>, <a class="el" href="fors__zeropoint_8c_source.html#l00109">fors_zeropoint_create()</a>, <a class="el" href="fors__zeropoint_8c_source.html#l00207">fors_zeropoint_destroy()</a>, and <a class="el" href="fors__zeropoint_8c_source.html#l00158">fors_zeropoint_exec()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga61984b5bc62bd25dbff9e414a7db42e3"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_zeropoint_create           </td>
+          <td class="memname">static int fors_zeropoint_create </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Setup the recipe options. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+<p>Setup the recipe options. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok</dd></dl>
-Defining the command-line/configuration parameters for the recipe. 
-<p>
-Definition at line <a class="el" href="fors__zeropoint_8c-source.html#l00109">109</a> of file <a class="el" href="fors__zeropoint_8c-source.html">fors_zeropoint.c</a>.
-<p>
-References <a class="el" href="fors__zeropoint__impl_8c-source.html#l00124">fors_zeropoint_define_parameters()</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint_8c-source.html#l00062">cpl_plugin_get_info()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g9aa95cb40ce84db79ab3006d51e7059d"></a><!-- doxytag: member="fors_zeropoint.c::fors_zeropoint_exec" ref="g9aa95cb40ce84db79ab3006d51e7059d" args="(cpl_plugin *plugin)" -->
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok</dd></dl>
+<p>Defining the command-line/configuration parameters for the recipe. </p>
+
+<p>Definition at line <a class="el" href="fors__zeropoint_8c_source.html#l00109">109</a> of file <a class="el" href="fors__zeropoint_8c_source.html">fors_zeropoint.c</a>.</p>
+
+<p>References <a class="el" href="fors__zeropoint__impl_8c_source.html#l00124">fors_zeropoint_define_parameters()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga606fac5ca2e3be91e2e65dbb943cdc66"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_zeropoint_exec           </td>
+          <td class="memname">static int fors_zeropoint_exec </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Execute the plugin instance given by the interface. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>the plugin</td></tr>
+<p>Execute the plugin instance given by the interface. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>the plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
 
-<p>
-Definition at line <a class="el" href="fors__zeropoint_8c-source.html#l00158">158</a> of file <a class="el" href="fors__zeropoint_8c-source.html">fors_zeropoint.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dfs_8c-source.html#l00258">fors_end()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00059">fors_zeropoint_description_short</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<p>Definition at line <a class="el" href="fors__zeropoint_8c_source.html#l00158">158</a> of file <a class="el" href="fors__zeropoint_8c_source.html">fors_zeropoint.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00230">fors_begin()</a>, <a class="el" href="fors__dfs_8c_source.html#l00258">fors_end()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__zeropoint_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g095db561f9e785a5a4114d97f4597baf"></a><!-- doxytag: member="fors_zeropoint.c::fors_zeropoint_destroy" ref="g095db561f9e785a5a4114d97f4597baf" args="(cpl_plugin *plugin)" -->
+<a class="anchor" id="ga77d581a8f85987937b006ba302ca4c7e"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static int fors_zeropoint_destroy           </td>
+          <td class="memname">static int fors_zeropoint_destroy </td>
           <td>(</td>
-          <td class="paramtype">cpl_plugin * </td>
-          <td class="paramname"> <em>plugin</em>          </td>
-          <td> ) </td>
-          <td width="100%"><code> [static]</code></td>
+          <td class="paramtype">cpl_plugin * </td>
+          <td class="paramname"><em>plugin</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
 
-<p>
-Destroy what has been created by the 'create' function. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>plugin</em> </td><td>The plugin</td></tr>
+<p>Destroy what has been created by the 'create' function. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">plugin</td><td>The plugin</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__zeropoint_8c_source.html#l00207">207</a> of file <a class="el" href="fors__zeropoint_8c_source.html">fors_zeropoint.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__zeropoint_8c-source.html#l00207">207</a> of file <a class="el" href="fors__zeropoint_8c-source.html">fors_zeropoint.c</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint_8c-source.html#l00062">cpl_plugin_get_info()</a>.
+<p>Referenced by <a class="el" href="fors__zeropoint_8c_source.html#l00062">cpl_plugin_get_info()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr><h2>Variable Documentation</h2>
-<a class="anchor" name="g69cec4407efc0bcccde712800aaa577c"></a><!-- doxytag: member="fors_zeropoint_impl.c::fors_zeropoint_description" ref="g69cec4407efc0bcccde712800aaa577c" args="" -->
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="gaa95afd3326bfec044eed5eab0f85d1f7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* const <a class="el" href="group__fors__zeropoint.html#g69cec4407efc0bcccde712800aaa577c">fors_zeropoint_description</a>          </td>
+          <td class="memname">const char* const fors_zeropoint_description</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-<b>Initial value:</b><div class="fragment"><pre class="fragment"> 
-<span class="stringliteral">"Input files:\n"</span>
-<span class="stringliteral">"  DO category:               Type:       Explanation:              Number:\n"</span>
-<span class="stringliteral">"  STANDARD_IMG               FITS image  Phot. standard field        1\n"</span>
-<span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span>
-<span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flatfield        1\n"</span>
-<span class="stringliteral">"  FLX_STD_IMG                FITS table  Standard star catalog       1+\n"</span>
-<span class="stringliteral">"  PHOT_TABLE                 FITS table  Filter ext. coeff, color    1\n"</span>
-<span class="stringliteral">"\n"</span>
-<span class="stringliteral">"Output files:\n"</span>
-<span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<span class="stringliteral">"  SOURCES_STD_IMG            FITS image  Unfiltered SExtractor output\n"</span>
-<span class="stringliteral">"  ALIGNED_PHOT               FITS table\n"</span>
-<span class="stringliteral">"  PHOT_BACKGROUND_STD_IMG    FITS image  Reduced science image background\n"</span>
-<span class="stringliteral">"  STANDARD_REDUCED_IMG       FITS image  Reduced std image\n"</span>
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__zeropoint__impl_8c-source.html#l00062">62</a> of file <a class="el" href="fors__zeropoint__impl_8c-source.html">fors_zeropoint_impl.c</a>.
-<p>
-Referenced by <a class="el" href="fors__zeropoint_8c-source.html#l00062">cpl_plugin_get_info()</a>.
-</div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><div class="memdoc">
+<b>Initial value:</b><div class="fragment"><div class="line">= </div>
+<div class="line"><span class="stringliteral">"Input files:\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Type:       Explanation:              Number:\n"</span></div>
+<div class="line"><span class="stringliteral">"  STANDARD_IMG               FITS image  Phot. standard field        1\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_BIAS                FITS image  Master bias                 1\n"</span></div>
+<div class="line"><span class="stringliteral">"  MASTER_SKY_FLAT_IMG        FITS image  Master sky flatfield        1\n"</span></div>
+<div class="line"><span class="stringliteral">"  FLX_STD_IMG                FITS table  Standard star catalog       1+\n"</span></div>
+<div class="line"><span class="stringliteral">"  PHOT_TABLE                 FITS table  Filter ext. coeff, color    1\n"</span></div>
+<div class="line"><span class="stringliteral">"\n"</span></div>
+<div class="line"><span class="stringliteral">"Output files:\n"</span></div>
+<div class="line"><span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><span class="stringliteral">"  SOURCES_STD_IMG            FITS image  Unfiltered SExtractor output\n"</span></div>
+<div class="line"><span class="stringliteral">"  ALIGNED_PHOT               FITS table\n"</span></div>
+<div class="line"><span class="stringliteral">"  PHOT_BACKGROUND_STD_IMG    FITS image  Reduced science image background\n"</span></div>
+<div class="line"><span class="stringliteral">"  STANDARD_REDUCED_IMG       FITS image  Reduced std image\n"</span></div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__zeropoint__impl_8c_source.html#l00062">62</a> of file <a class="el" href="fors__zeropoint__impl_8c_source.html">fors_zeropoint_impl.c</a>.</p>
+
+</div>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__fors__zeropoint__test.html b/html/group__fors__zeropoint__test.html
index c03896c..e446b19 100644
--- a/html/group__fors__zeropoint__test.html
+++ b/html/group__fors__zeropoint__test.html
@@ -1,57 +1,92 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: zeropoint recipe tests</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>zeropoint recipe tests</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb2ce88d70507512e1c2a930875ef2380"></a><!-- doxytag: member="fors_zeropoint_test::test_zeropoint" ref="gb2ce88d70507512e1c2a930875ef2380" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint__test.html#gb2ce88d70507512e1c2a930875ef2380">test_zeropoint</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test zeropoint recipe. <br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="fors_zeropoint_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test of zeropoint recipe. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_zeropoint-test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">zeropoint recipe tests</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga593b93a1917f63d7660af1ea61da6f94"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga593b93a1917f63d7660af1ea61da6f94"></a>
+static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint__test.html#ga593b93a1917f63d7660af1ea61da6f94">test_zeropoint</a> (void)</td></tr>
+<tr class="memdesc:ga593b93a1917f63d7660af1ea61da6f94"><td class="mdescLeft"> </td><td class="mdescRight">Test zeropoint recipe. <br/></td></tr>
+<tr class="separator:ga593b93a1917f63d7660af1ea61da6f94"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fors__zeropoint__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Test of zeropoint recipe. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_frameset_delete(frames); \</div>
+<div class="line">    cpl_parameterlist_delete(parameters); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__zeropoint-test_8c_source.html#l00047">47</a> of file <a class="el" href="fors__zeropoint-test_8c_source.html">fors_zeropoint-test.c</a>.</p>
 
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_frameset_delete(frames); \
-    cpl_parameterlist_delete(parameters); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__zeropoint-test_8c-source.html#l00047">47</a> of file <a class="el" href="fors__zeropoint-test_8c-source.html">fors_zeropoint-test.c</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__forsdfs.html b/html/group__forsdfs.html
index 8afb815..ecd3b72 100644
--- a/html/group__forsdfs.html
+++ b/html/group__forsdfs.html
@@ -1,1575 +1,1645 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: DFS Utilities</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>DFS Utilities</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g0b6879dd3db31db30dd619bcbfc69d5d"></a><!-- doxytag: member="forsdfs::WCS_KEYS" ref="g0b6879dd3db31db30dd619bcbfc69d5d" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g0b6879dd3db31db30dd619bcbfc69d5d">WCS_KEYS</a>   "^((CRVAL|CRPIX|CTYPE|CDELT)[0-9]|RADECSYS|CD[0-9]_[0-9])$"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="forsdfs::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="forsdfs::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc47424d61828381851faa6c2fd25803e"></a><!-- doxytag: member="forsdfs::strlower" ref="gc47424d61828381851faa6c2fd25803e" args="(char *s)" -->
-static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gc47424d61828381851faa6c2fd25803e">strlower</a> (char *s)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g34ac001c0471b1dc6dab4a0a38b7c4a2"></a><!-- doxytag: member="forsdfs::dfs_generate_filename" ref="g34ac001c0471b1dc6dab4a0a38b7c4a2" args="(const char *category)" -->
-char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g34ac001c0471b1dc6dab4a0a38b7c4a2">dfs_generate_filename</a> (const char *category)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gac5e297d5e45e2ae86075dee586cf8d9"></a><!-- doxytag: member="forsdfs::dfs_generate_filename_tfits" ref="gac5e297d5e45e2ae86075dee586cf8d9" args="(const char *category)" -->
-char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a> (const char *category)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g8479954471cd14e92ec92efce09ec87b">errorstate_dump_one</a> (unsigned self, unsigned first, unsigned last)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Dump a single CPL error.  <a href="#g8479954471cd14e92ec92efce09ec87b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757">fors_begin</a> (cpl_frameset *frames, const char *description_short)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Start recipe execution.  <a href="#g040f45f5810f9ac8b6cf4d0b05b18757"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295">fors_end</a> (const cpl_frameset *frames, cpl_errorstate before_exec)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">End recipe execution.  <a href="#gf9d99ef6ed250a731bd0a74eba3d6295"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g37d74636b6c3f3d52b0312ce3a58e59d">fors_dfs_set_groups</a> (cpl_frameset *set)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the group as RAW or CALIB in a frameset.  <a href="#g37d74636b6c3f3d52b0312ce3a58e59d"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g61956e9dcf77f5c71db911e0390f63f3">fors_dfs_pipeline_version</a> (const cpl_propertylist *header, const char **instrument_version)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get pipeline and instrument versions.  <a href="#g61956e9dcf77f5c71db911e0390f63f3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a> (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Reading a recipe integer parameter value.  <a href="#gb0f351141cdcd36711062d98ca80bd59"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a> (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Reading a recipe double parameter value.  <a href="#gff26e2b3063dfeb117ef73030e81894e"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a> (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Reading a recipe string parameter value.  <a href="#gd263350688e3580b7bf20706a795a0cd"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a> (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Reading a recipe boolean parameter value.  <a href="#g29d32919bff2808b25d85dacd496e834"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gfce5eddb71d8700b30c690f49374d2e0">dfs_get_parameter_bool_const</a> (const cpl_parameterlist *parlist, const char *name)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f">dfs_get_parameter_int_const</a> (const cpl_parameterlist *parlist, const char *name)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206">dfs_get_parameter_double_const</a> (const cpl_parameterlist *parlist, const char *name)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753">dfs_get_parameter_string_const</a> (const cpl_parameterlist *parlist, const char *name)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a> (cpl_frameset *frameset, const char *category, cpl_type type, int ext, int calib)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Loading image data of given category.  <a href="#g29a45e1e84aa9d87c1a23773e82c796f"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a> (cpl_frameset *frameset, const char *category, int ext)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Loading table data of given category.  <a href="#g1c15a2052dc4b7f916eff93271aeb27a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_propertylist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a> (cpl_frameset *frameset, const char *category, int ext)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Loading header associated to data of given category.  <a href="#g9774126e0acba5d1bf25bda41a4fb794"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g8670593994ad689ac3aa76cf648e76c3">dfs_save</a> (cpl_frameset *frameset, const void *object, cpl_frame_type type, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const cpl_frame *raw_frame)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save DFS product.  <a href="#g8670593994ad689ac3aa76cf648e76c3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image</a> (cpl_frameset *frameset, const <a class="el" href="struct__fors__image.html">fors_image</a> *image, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const cpl_frame *raw_frame)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save DFS product (image).  <a href="#g810ca5e9d6f0af849344d0b5f60f3cf1"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#geb1068e007bd0ebef0cd4a6aa12cf523">fors_dfs_add_wcs</a> (cpl_propertylist *header, const cpl_frame *frame, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">add WCS keywords to header  <a href="#geb1068e007bd0ebef0cd4a6aa12cf523"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gea45a5b73ab086e5e08680928adbd0cd">fors_dfs_add_exptime</a> (cpl_propertylist *header, const cpl_frame *frame, double exptime)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Add keyword EXPTIME to header.  <a href="#gea45a5b73ab086e5e08680928adbd0cd"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42">fors_dfs_save_table</a> (cpl_frameset *frameset, const cpl_table *table, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const cpl_frame *raw_frame)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save DFS product (table).  <a href="#gf9fc39acdf17a36a3c8aa7d8f008ae42"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a> (cpl_frameset *frameset, const cpl_image *image, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const char *version)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Saving image data of given category.  <a href="#g670873281aac860fb32cce7ef99d3465"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a> (cpl_frameset *frameset, const cpl_table *table, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const char *version)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Saving table data of given category.  <a href="#gd3653f59add0d28a7f53ac0ccffb2616"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a> (cpl_frameset *frameset, const char *keyword)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Saving table data of given category.  <a href="#g318f71668fea717baced57478bd282c8"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29">dfs_save_table_ext</a> (cpl_table *table, const char *tag, cpl_propertylist *extheader)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a table in a extension (different from the first one).  <a href="#gc673cd895f691fdd4903275de721aa29"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2">dfs_save_image_ext</a> (cpl_image *image, const char *tag, cpl_propertylist *extheader)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save an image in a extension.  <a href="#g0c6583af923e2d981ba63d623f7f16f2"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb">dfs_save_image_null</a> (cpl_frameset *frameset, cpl_parameterlist *parlist, const char *tag, const char *recipename, const char *version)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a product with an empty primary extension.  <a href="#ge7d189654778913f074c1f46f801f7fb"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-The module fors_dfs collects medium level functions related to DFS data IO. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_dfs.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">DFS Utilities</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga3b7e23c484da8841aa01d1bed50cf2f0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3b7e23c484da8841aa01d1bed50cf2f0"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>WCS_KEYS</b>   "^((CRVAL|CRPIX|CTYPE|CDELT)[0-9]|RADECSYS|CD[0-9]_[0-9])$"</td></tr>
+<tr class="separator:ga3b7e23c484da8841aa01d1bed50cf2f0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga7238fed70c78643d055c79a8bd510356"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7238fed70c78643d055c79a8bd510356"></a>
+static char * </td><td class="memItemRight" valign="bottom"><b>strlower</b> (char *s)</td></tr>
+<tr class="separator:ga7238fed70c78643d055c79a8bd510356"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6698973ab70fe7b0bd61b993e59e8a53"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6698973ab70fe7b0bd61b993e59e8a53"></a>
+char * </td><td class="memItemRight" valign="bottom"><b>dfs_generate_filename</b> (const char *category)</td></tr>
+<tr class="separator:ga6698973ab70fe7b0bd61b993e59e8a53"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga950b280111a517c7011a120168758de0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga950b280111a517c7011a120168758de0"></a>
+char * </td><td class="memItemRight" valign="bottom"><b>dfs_generate_filename_tfits</b> (const char *category)</td></tr>
+<tr class="separator:ga950b280111a517c7011a120168758de0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa72aa06ad8174e7f9e14b556e1ec130f"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gaa72aa06ad8174e7f9e14b556e1ec130f">errorstate_dump_one</a> (unsigned self, unsigned first, unsigned last)</td></tr>
+<tr class="memdesc:gaa72aa06ad8174e7f9e14b556e1ec130f"><td class="mdescLeft"> </td><td class="mdescRight">Dump a single CPL error.  <a href="#gaa72aa06ad8174e7f9e14b556e1ec130f">More...</a><br/></td></tr>
+<tr class="separator:gaa72aa06ad8174e7f9e14b556e1ec130f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga27fb3567f87be0ee95f6176990f4a4ce"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce">fors_begin</a> (cpl_frameset *frames, const char *description_short)</td></tr>
+<tr class="memdesc:ga27fb3567f87be0ee95f6176990f4a4ce"><td class="mdescLeft"> </td><td class="mdescRight">Start recipe execution.  <a href="#ga27fb3567f87be0ee95f6176990f4a4ce">More...</a><br/></td></tr>
+<tr class="separator:ga27fb3567f87be0ee95f6176990f4a4ce"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab47f2ab911401a6d92628c2b541b17b9"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9">fors_end</a> (const cpl_frameset *frames, cpl_errorstate before_exec)</td></tr>
+<tr class="memdesc:gab47f2ab911401a6d92628c2b541b17b9"><td class="mdescLeft"> </td><td class="mdescRight">End recipe execution.  <a href="#gab47f2ab911401a6d92628c2b541b17b9">More...</a><br/></td></tr>
+<tr class="separator:gab47f2ab911401a6d92628c2b541b17b9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5162766f25e67bb99869e7959c3f8201"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga5162766f25e67bb99869e7959c3f8201">fors_dfs_set_groups</a> (cpl_frameset *set)</td></tr>
+<tr class="memdesc:ga5162766f25e67bb99869e7959c3f8201"><td class="mdescLeft"> </td><td class="mdescRight">Set the group as RAW or CALIB in a frameset.  <a href="#ga5162766f25e67bb99869e7959c3f8201">More...</a><br/></td></tr>
+<tr class="separator:ga5162766f25e67bb99869e7959c3f8201"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga31c40f4add0fc7ef1e992d99493f5d1a"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga31c40f4add0fc7ef1e992d99493f5d1a">fors_dfs_pipeline_version</a> (const cpl_propertylist *header, const char **instrument_version)</td></tr>
+<tr class="memdesc:ga31c40f4add0fc7ef1e992d99493f5d1a"><td class="mdescLeft"> </td><td class="mdescRight">Get pipeline and instrument versions.  <a href="#ga31c40f4add0fc7ef1e992d99493f5d1a">More...</a><br/></td></tr>
+<tr class="separator:ga31c40f4add0fc7ef1e992d99493f5d1a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga09890733c10deff040e30c6920f26b22"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22">dfs_get_parameter_int</a> (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)</td></tr>
+<tr class="memdesc:ga09890733c10deff040e30c6920f26b22"><td class="mdescLeft"> </td><td class="mdescRight">Reading a recipe integer parameter value.  <a href="#ga09890733c10deff040e30c6920f26b22">More...</a><br/></td></tr>
+<tr class="separator:ga09890733c10deff040e30c6920f26b22"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab02dcd2b3ed62a805caca41d11705b96"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96">dfs_get_parameter_double</a> (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)</td></tr>
+<tr class="memdesc:gab02dcd2b3ed62a805caca41d11705b96"><td class="mdescLeft"> </td><td class="mdescRight">Reading a recipe double parameter value.  <a href="#gab02dcd2b3ed62a805caca41d11705b96">More...</a><br/></td></tr>
+<tr class="separator:gab02dcd2b3ed62a805caca41d11705b96"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga57c7568085340fc81eeafec1a1092197"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197">dfs_get_parameter_string</a> (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)</td></tr>
+<tr class="memdesc:ga57c7568085340fc81eeafec1a1092197"><td class="mdescLeft"> </td><td class="mdescRight">Reading a recipe string parameter value.  <a href="#ga57c7568085340fc81eeafec1a1092197">More...</a><br/></td></tr>
+<tr class="separator:ga57c7568085340fc81eeafec1a1092197"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga48768c59ba1e2bf1776ad4770ab09fbb"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb">dfs_get_parameter_bool</a> (cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)</td></tr>
+<tr class="memdesc:ga48768c59ba1e2bf1776ad4770ab09fbb"><td class="mdescLeft"> </td><td class="mdescRight">Reading a recipe boolean parameter value.  <a href="#ga48768c59ba1e2bf1776ad4770ab09fbb">More...</a><br/></td></tr>
+<tr class="separator:ga48768c59ba1e2bf1776ad4770ab09fbb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae0dc63f80258d73a93d35e41b2a8b367"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gae0dc63f80258d73a93d35e41b2a8b367">dfs_get_parameter_bool_const</a> (const cpl_parameterlist *parlist, const char *name)</td></tr>
+<tr class="separator:gae0dc63f80258d73a93d35e41b2a8b367"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaef153fed14f117971d69d1d92fa9a9e6"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6">dfs_get_parameter_int_const</a> (const cpl_parameterlist *parlist, const char *name)</td></tr>
+<tr class="separator:gaef153fed14f117971d69d1d92fa9a9e6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga35b9237db0837319a04e85e6cf9dd50d"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d">dfs_get_parameter_double_const</a> (const cpl_parameterlist *parlist, const char *name)</td></tr>
+<tr class="separator:ga35b9237db0837319a04e85e6cf9dd50d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8cb34aee7c26915499cbfb7d9d38b9cd"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd">dfs_get_parameter_string_const</a> (const cpl_parameterlist *parlist, const char *name)</td></tr>
+<tr class="separator:ga8cb34aee7c26915499cbfb7d9d38b9cd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga326130afab421ef30992def2a444d660"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660">dfs_load_image</a> (cpl_frameset *frameset, const char *category, cpl_type type, int ext, int calib)</td></tr>
+<tr class="memdesc:ga326130afab421ef30992def2a444d660"><td class="mdescLeft"> </td><td class="mdescRight">Loading image data of given category.  <a href="#ga326130afab421ef30992def2a444d660">More...</a><br/></td></tr>
+<tr class="separator:ga326130afab421ef30992def2a444d660"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga010c17942448386415d6e51adebae649"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649">dfs_load_table</a> (cpl_frameset *frameset, const char *category, int ext)</td></tr>
+<tr class="memdesc:ga010c17942448386415d6e51adebae649"><td class="mdescLeft"> </td><td class="mdescRight">Loading table data of given category.  <a href="#ga010c17942448386415d6e51adebae649">More...</a><br/></td></tr>
+<tr class="separator:ga010c17942448386415d6e51adebae649"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadc48c0a3a86ef31943bf2da28ab136cf"><td class="memItemLeft" align="right" valign="top">cpl_propertylist * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf">dfs_load_header</a> (cpl_frameset *frameset, const char *category, int ext)</td></tr>
+<tr class="memdesc:gadc48c0a3a86ef31943bf2da28ab136cf"><td class="mdescLeft"> </td><td class="mdescRight">Loading header associated to data of given category.  <a href="#gadc48c0a3a86ef31943bf2da28ab136cf">More...</a><br/></td></tr>
+<tr class="separator:gadc48c0a3a86ef31943bf2da28ab136cf"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga04ce01a9ddd2c4ddee75010d7fdb81fd"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga04ce01a9ddd2c4ddee75010d7fdb81fd">dfs_save</a> (cpl_frameset *frameset, const void *object, fors_type type, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const cpl_frame *inherit_frame)</td></tr>
+<tr class="memdesc:ga04ce01a9ddd2c4ddee75010d7fdb81fd"><td class="mdescLeft"> </td><td class="mdescRight">Save DFS product.  <a href="#ga04ce01a9ddd2c4ddee75010d7fdb81fd">More...</a><br/></td></tr>
+<tr class="separator:ga04ce01a9ddd2c4ddee75010d7fdb81fd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga45cefe5c9339a8b27be0454c9144a70a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga45cefe5c9339a8b27be0454c9144a70a">fors_dfs_save_image</a> (cpl_frameset *frameset, const cpl_image *image, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const cpl_frame *inherit_frame)</td></tr>
+<tr class="memdesc:ga45cefe5c9339a8b27be0454c9144a70a"><td class="mdescLeft"> </td><td class="mdescRight">Save DFS product (image)  <a href="#ga45cefe5c9339a8b27be0454c9144a70a">More...</a><br/></td></tr>
+<tr class="separator:ga45cefe5c9339a8b27be0454c9144a70a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6f529d571ffaada1dbc4299ca5cdf3d7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7">fors_dfs_save_image_err</a> (cpl_frameset *frameset, const <a class="el" href="struct__fors__image.html">fors_image</a> *image, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const cpl_frame *inh [...]
+<tr class="memdesc:ga6f529d571ffaada1dbc4299ca5cdf3d7"><td class="mdescLeft"> </td><td class="mdescRight">Save DFS product (image) with it error data.  <a href="#ga6f529d571ffaada1dbc4299ca5cdf3d7">More...</a><br/></td></tr>
+<tr class="separator:ga6f529d571ffaada1dbc4299ca5cdf3d7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadbf163fdd77abcf68fac009993f20959"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gadbf163fdd77abcf68fac009993f20959">fors_dfs_add_wcs</a> (cpl_propertylist *header, const cpl_frame *frame, const <a class="el" href="struct__fors__setting.html">fors_setting</a> *setting)</td></tr>
+<tr class="memdesc:gadbf163fdd77abcf68fac009993f20959"><td class="mdescLeft"> </td><td class="mdescRight">add WCS keywords to header  <a href="#gadbf163fdd77abcf68fac009993f20959">More...</a><br/></td></tr>
+<tr class="separator:gadbf163fdd77abcf68fac009993f20959"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga71054af8e26681ec2d7e1ea39e7feb17"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga71054af8e26681ec2d7e1ea39e7feb17">fors_dfs_add_exptime</a> (cpl_propertylist *header, const cpl_frame *frame, double exptime)</td></tr>
+<tr class="memdesc:ga71054af8e26681ec2d7e1ea39e7feb17"><td class="mdescLeft"> </td><td class="mdescRight">Add keyword EXPTIME to header.  <a href="#ga71054af8e26681ec2d7e1ea39e7feb17">More...</a><br/></td></tr>
+<tr class="separator:ga71054af8e26681ec2d7e1ea39e7feb17"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga65ab95dab0ba56844b6b548b18b6487f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f">fors_dfs_save_table</a> (cpl_frameset *frameset, const cpl_table *table, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const cpl_frame *inherit_frame)</td></tr>
+<tr class="memdesc:ga65ab95dab0ba56844b6b548b18b6487f"><td class="mdescLeft"> </td><td class="mdescRight">Save DFS product (table)  <a href="#ga65ab95dab0ba56844b6b548b18b6487f">More...</a><br/></td></tr>
+<tr class="separator:ga65ab95dab0ba56844b6b548b18b6487f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6ad37d6af14278e58f72e820427158c5"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5">dfs_save_image</a> (cpl_frameset *frameset, const cpl_image *image, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const char *version)</td></tr>
+<tr class="memdesc:ga6ad37d6af14278e58f72e820427158c5"><td class="mdescLeft"> </td><td class="mdescRight">Saving image data of given category.  <a href="#ga6ad37d6af14278e58f72e820427158c5">More...</a><br/></td></tr>
+<tr class="separator:ga6ad37d6af14278e58f72e820427158c5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf327994c9f97caba177eef18692b1824"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824">dfs_save_table</a> (cpl_frameset *frameset, const cpl_table *table, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const char *version)</td></tr>
+<tr class="memdesc:gaf327994c9f97caba177eef18692b1824"><td class="mdescLeft"> </td><td class="mdescRight">Saving table data of given category.  <a href="#gaf327994c9f97caba177eef18692b1824">More...</a><br/></td></tr>
+<tr class="separator:gaf327994c9f97caba177eef18692b1824"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae17908f224eaaa5696f0dc084a964435"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435">dfs_equal_keyword</a> (cpl_frameset *frameset, const char *keyword)</td></tr>
+<tr class="memdesc:gae17908f224eaaa5696f0dc084a964435"><td class="mdescLeft"> </td><td class="mdescRight">Saving table data of given category.  <a href="#gae17908f224eaaa5696f0dc084a964435">More...</a><br/></td></tr>
+<tr class="separator:gae17908f224eaaa5696f0dc084a964435"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9fe80dfc0b048b03eb846f68de836489"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489">dfs_save_table_ext</a> (cpl_table *table, const char *tag, cpl_propertylist *extheader)</td></tr>
+<tr class="memdesc:ga9fe80dfc0b048b03eb846f68de836489"><td class="mdescLeft"> </td><td class="mdescRight">Save a table in a extension (different from the first one)  <a href="#ga9fe80dfc0b048b03eb846f68de836489">More...</a><br/></td></tr>
+<tr class="separator:ga9fe80dfc0b048b03eb846f68de836489"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8c69e34b93aa2964cf10be637a4ee9ee"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee">dfs_save_image_ext</a> (cpl_image *image, const char *tag, cpl_propertylist *extheader)</td></tr>
+<tr class="memdesc:ga8c69e34b93aa2964cf10be637a4ee9ee"><td class="mdescLeft"> </td><td class="mdescRight">Save an image in a extension.  <a href="#ga8c69e34b93aa2964cf10be637a4ee9ee">More...</a><br/></td></tr>
+<tr class="separator:ga8c69e34b93aa2964cf10be637a4ee9ee"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga13a196799766da8b28cb89d4ea54ca8b"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b">dfs_save_image_null</a> (cpl_frameset *frameset, cpl_parameterlist *parlist, const char *tag, const char *recipename, const char *version)</td></tr>
+<tr class="memdesc:ga13a196799766da8b28cb89d4ea54ca8b"><td class="mdescLeft"> </td><td class="mdescRight">Save a product with an empty primary extension.  <a href="#ga13a196799766da8b28cb89d4ea54ca8b">More...</a><br/></td></tr>
+<tr class="separator:ga13a196799766da8b28cb89d4ea54ca8b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga080ffcf787c686caacf741989e6e796a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga080ffcf787c686caacf741989e6e796a"></a>
+cpl_frameset * </td><td class="memItemRight" valign="bottom"><b>hawki_extract_frameset</b> (const cpl_frameset *in, const char *tag)</td></tr>
+<tr class="separator:ga080ffcf787c686caacf741989e6e796a"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>The module fors_dfs collects medium level functions related to DFS data IO. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_propertylist_delete(wcs_header); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01258">1258</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_propertylist_delete(wcs_header); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01222">1222</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_dfs.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_propertylist_delete(time_header); \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01258">1258</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_propertylist_delete(time_header); \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01222">1222</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g8479954471cd14e92ec92efce09ec87b"></a><!-- doxytag: member="fors_dfs.c::errorstate_dump_one" ref="g8479954471cd14e92ec92efce09ec87b" args="(unsigned self, unsigned first, unsigned last)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gaa72aa06ad8174e7f9e14b556e1ec130f"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void errorstate_dump_one           </td>
+          <td class="memname">static void errorstate_dump_one </td>
           <td>(</td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>self</em>, </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>self</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>first</em>, </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>first</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>last</em></td><td> </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>last</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Dump a single CPL error. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>self</em> </td><td>The number of the current error to be dumped </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>first</em> </td><td>The number of the first error to be dumped </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>last</em> </td><td>The number of the last error to be dumped</td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Dump a single CPL error. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">self</td><td>The number of the current error to be dumped </td></tr>
+    <tr><td class="paramname">first</td><td>The number of the first error to be dumped </td></tr>
+    <tr><td class="paramname">last</td><td>The number of the last error to be dumped</td></tr>
   </table>
+  </dd>
 </dl>
-This is a callback function to cpl_errorstate_dump()<p>
-<dl compact><dt><b>See also:</b></dt><dd>cpl_errorstate_dump </dd></dl>
+<p>This is a callback function to cpl_errorstate_dump()</p>
+<dl class="section see"><dt>See Also</dt><dd>cpl_errorstate_dump </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00147">147</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00147">147</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-Referenced by <a class="el" href="fors__dfs_8c-source.html#l00258">fors_end()</a>.
+<p>Referenced by <a class="el" href="fors__dfs_8c_source.html#l00258">fors_end()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g040f45f5810f9ac8b6cf4d0b05b18757"></a><!-- doxytag: member="fors_dfs.c::fors_begin" ref="g040f45f5810f9ac8b6cf4d0b05b18757" args="(cpl_frameset *frames, const char *description_short)" -->
+<a class="anchor" id="ga27fb3567f87be0ee95f6176990f4a4ce"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_begin           </td>
+          <td class="memname">void fors_begin </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>description_short</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>description_short</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Start recipe execution. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>recipe input frameset </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>description_short</em> </td><td>recipe short description</td></tr>
+</div><div class="memdoc">
+
+<p>Start recipe execution. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>recipe input frameset </td></tr>
+    <tr><td class="paramname">description_short</td><td>recipe short description</td></tr>
   </table>
+  </dd>
 </dl>
-This function classifies and prints the input frames. It exists in order to avoid duplicating these recipe independent steps in every recipe. 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00230">230</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00296">fors_dfs_set_groups()</a>, and <a class="el" href="fors__utils_8c-source.html#l00393">fors_frameset_print()</a>.
-<p>
-Referenced by <a class="el" href="fors__bias_8c-source.html#l00158">fors_bias_exec()</a>, <a class="el" href="fors__dark_8c-source.html#l00158">fors_dark_exec()</a>, <a class="el" href="fors__img__science_8c-source.html#l00158">fors_img_science_exec()</a>, <a class="el" href="fors__img__screen__flat_8c-source.html#l00158">fors_img_screen_flat_exec()</a>, <a class="el" href="fors__img__sky__flat_8c-source.html#l00158">fors_img_sky_flat_exec()</a>, <a class="el" href="fors__photometry_8c-s [...]
+<p>This function classifies and prints the input frames. It exists in order to avoid duplicating these recipe independent steps in every recipe. </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00230">230</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00296">fors_dfs_set_groups()</a>, and <a class="el" href="fors__utils_8c_source.html#l00393">fors_frameset_print()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias_8c_source.html#l00158">fors_bias_exec()</a>, <a class="el" href="fors__dark_8c_source.html#l00158">fors_dark_exec()</a>, <a class="el" href="fors__img__science_8c_source.html#l00158">fors_img_science_exec()</a>, <a class="el" href="fors__img__screen__flat_8c_source.html#l00158">fors_img_screen_flat_exec()</a>, <a class="el" href="fors__img__sky__flat_8c_source.html#l00158">fors_img_sky_flat_exec()</a>, <a class="el" href="fors__photometry_8 [...]
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gf9d99ef6ed250a731bd0a74eba3d6295"></a><!-- doxytag: member="fors_dfs.c::fors_end" ref="gf9d99ef6ed250a731bd0a74eba3d6295" args="(const cpl_frameset *frames, cpl_errorstate before_exec)" -->
+<a class="anchor" id="gab47f2ab911401a6d92628c2b541b17b9"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int fors_end           </td>
+          <td class="memname">int fors_end </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">const cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_errorstate </td>
-          <td class="paramname"> <em>before_exec</em></td><td> </td>
+          <td class="paramtype">cpl_errorstate </td>
+          <td class="paramname"><em>before_exec</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-End recipe execution. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>recipe output frameset </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>before_exec</em> </td><td>CPL error state at recipe execution start </td></tr>
+</div><div class="memdoc">
+
+<p>End recipe execution. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frames</td><td>recipe output frameset </td></tr>
+    <tr><td class="paramname">before_exec</td><td>CPL error state at recipe execution start </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>zero if and only if no CPL error is set</dd></dl>
-The function prints the product frames successfully produced by the recipe, including the frame tags.<p>
-If a CPL error is set, the error history since recipe execution start is printed. 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00258">258</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00147">errorstate_dump_one()</a>, and <a class="el" href="fors__utils_8c-source.html#l00427">fors_frame_print()</a>.
-<p>
-Referenced by <a class="el" href="fors__bias_8c-source.html#l00158">fors_bias_exec()</a>, <a class="el" href="fors__dark_8c-source.html#l00158">fors_dark_exec()</a>, <a class="el" href="fors__img__science_8c-source.html#l00158">fors_img_science_exec()</a>, <a class="el" href="fors__img__screen__flat_8c-source.html#l00158">fors_img_screen_flat_exec()</a>, <a class="el" href="fors__img__sky__flat_8c-source.html#l00158">fors_img_sky_flat_exec()</a>, <a class="el" href="fors__photometry_8c-s [...]
+<dl class="section return"><dt>Returns</dt><dd>zero if and only if no CPL error is set</dd></dl>
+<p>The function prints the product frames successfully produced by the recipe, including the frame tags.</p>
+<p>If a CPL error is set, the error history since recipe execution start is printed. </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00258">258</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00147">errorstate_dump_one()</a>, and <a class="el" href="fors__utils_8c_source.html#l00427">fors_frame_print()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias_8c_source.html#l00158">fors_bias_exec()</a>, <a class="el" href="fors__dark_8c_source.html#l00158">fors_dark_exec()</a>, <a class="el" href="fors__img__science_8c_source.html#l00158">fors_img_science_exec()</a>, <a class="el" href="fors__img__screen__flat_8c_source.html#l00158">fors_img_screen_flat_exec()</a>, <a class="el" href="fors__img__sky__flat_8c_source.html#l00158">fors_img_sky_flat_exec()</a>, <a class="el" href="fors__photometry_8 [...]
+
 </div>
-</div><p>
-<a class="anchor" name="g37d74636b6c3f3d52b0312ce3a58e59d"></a><!-- doxytag: member="fors_dfs.c::fors_dfs_set_groups" ref="g37d74636b6c3f3d52b0312ce3a58e59d" args="(cpl_frameset *set)" -->
+</div>
+<a class="anchor" id="ga5162766f25e67bb99869e7959c3f8201"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_dfs_set_groups           </td>
+          <td class="memname">void fors_dfs_set_groups </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>set</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>set</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Set the group as RAW or CALIB in a frameset. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>the input frameset </td></tr>
+</div><div class="memdoc">
+
+<p>Set the group as RAW or CALIB in a frameset. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">set</td><td>the input frameset </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00296">296</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>.
-<p>
-Referenced by <a class="el" href="fors__dfs_8c-source.html#l00230">fors_begin()</a>.
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00296">296</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dfs_8c_source.html#l00230">fors_begin()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g61956e9dcf77f5c71db911e0390f63f3"></a><!-- doxytag: member="fors_dfs.c::fors_dfs_pipeline_version" ref="g61956e9dcf77f5c71db911e0390f63f3" args="(const cpl_propertylist *header, const char **instrument_version)" -->
+</div>
+<a class="anchor" id="ga31c40f4add0fc7ef1e992d99493f5d1a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* fors_dfs_pipeline_version           </td>
+          <td class="memname">const char* fors_dfs_pipeline_version </td>
           <td>(</td>
-          <td class="paramtype">const cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char ** </td>
-          <td class="paramname"> <em>instrument_version</em></td><td> </td>
+          <td class="paramtype">const char ** </td>
+          <td class="paramname"><em>instrument_version</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Get pipeline and instrument versions. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>raw header </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>instrument_version</em> </td><td>(output) if non-NULL, newly allocated instrument name </td></tr>
+</div><div class="memdoc">
+
+<p>Get pipeline and instrument versions. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>raw header </td></tr>
+    <tr><td class="paramname">instrument_version</td><td>(output) if non-NULL, newly allocated instrument name </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated pipeline version string </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00363">363</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__pfits_8c-source.html#l00042">FORS_PFITS_INSTRUME</a>, and <a class="el" href="test__simulate_8c-source.html#l00103">instrume</a>.
-<p>
-Referenced by <a class="el" href="fors__dfs_8c-source.html#l01001">dfs_save()</a>, and <a class="el" href="fors__setting_8c-source.html#l00082">fors_setting_new_level()</a>.
+<dl class="section return"><dt>Returns</dt><dd>newly allocated pipeline version string </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00363">363</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dfs_8c_source.html#l01001">dfs_save()</a>, and <a class="el" href="fors__setting_8c_source.html#l00082">fors_setting_new_level()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gb0f351141cdcd36711062d98ca80bd59"></a><!-- doxytag: member="fors_dfs.c::dfs_get_parameter_int" ref="gb0f351141cdcd36711062d98ca80bd59" args="(cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)" -->
+</div>
+<a class="anchor" id="ga09890733c10deff040e30c6920f26b22"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int dfs_get_parameter_int           </td>
+          <td class="memname">int dfs_get_parameter_int </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_table * </td>
-          <td class="paramname"> <em>defaults</em></td><td> </td>
+          <td class="paramtype">const cpl_table * </td>
+          <td class="paramname"><em>defaults</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Reading a recipe integer parameter value. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parlist</em> </td><td>The input parameter list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The parameter name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>defaults</em> </td><td>The defaults table</td></tr>
+</div><div class="memdoc">
+
+<p>Reading a recipe integer parameter value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parlist</td><td>The input parameter list </td></tr>
+    <tr><td class="paramname">name</td><td>The parameter name </td></tr>
+    <tr><td class="paramname">defaults</td><td>The defaults table</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The parameter value</dd></dl>
-This function is just a wrapper to the basic CPL function <code>cpl_parameter_get_int()</code>, but if a <em>defaults</em> table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a <em>defaults</em> table is no [...]
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00410">410</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-Referenced by <a class="el" href="fors__dfs_8c-source.html#l00809">dfs_get_parameter_int_const()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The parameter value</dd></dl>
+<p>This function is just a wrapper to the basic CPL function <code>cpl_parameter_get_int()</code>, but if a <em>defaults</em> table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a <em>defaults</em> table is [...]
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00410">410</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dfs_8c_source.html#l00809">dfs_get_parameter_int_const()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gff26e2b3063dfeb117ef73030e81894e"></a><!-- doxytag: member="fors_dfs.c::dfs_get_parameter_double" ref="gff26e2b3063dfeb117ef73030e81894e" args="(cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)" -->
+</div>
+<a class="anchor" id="gab02dcd2b3ed62a805caca41d11705b96"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double dfs_get_parameter_double           </td>
+          <td class="memname">double dfs_get_parameter_double </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_table * </td>
-          <td class="paramname"> <em>defaults</em></td><td> </td>
+          <td class="paramtype">const cpl_table * </td>
+          <td class="paramname"><em>defaults</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Reading a recipe double parameter value. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parlist</em> </td><td>The input parameter list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The parameter name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>defaults</em> </td><td>The defaults table</td></tr>
+</div><div class="memdoc">
+
+<p>Reading a recipe double parameter value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parlist</td><td>The input parameter list </td></tr>
+    <tr><td class="paramname">name</td><td>The parameter name </td></tr>
+    <tr><td class="paramname">defaults</td><td>The defaults table</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The parameter value</dd></dl>
-This function is just a wrapper to the basic CPL function <code>cpl_parameter_get_double()</code>, but if a <em>defaults</em> table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a <em>defaults</em> table is [...]
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00507">507</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-Referenced by <a class="el" href="fors__dfs_8c-source.html#l00819">dfs_get_parameter_double_const()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The parameter value</dd></dl>
+<p>This function is just a wrapper to the basic CPL function <code>cpl_parameter_get_double()</code>, but if a <em>defaults</em> table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a <em>defaults</em> table [...]
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00507">507</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dfs_8c_source.html#l00819">dfs_get_parameter_double_const()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gd263350688e3580b7bf20706a795a0cd"></a><!-- doxytag: member="fors_dfs.c::dfs_get_parameter_string" ref="gd263350688e3580b7bf20706a795a0cd" args="(cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)" -->
+<a class="anchor" id="ga57c7568085340fc81eeafec1a1092197"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* dfs_get_parameter_string           </td>
+          <td class="memname">const char* dfs_get_parameter_string </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_table * </td>
-          <td class="paramname"> <em>defaults</em></td><td> </td>
+          <td class="paramtype">const cpl_table * </td>
+          <td class="paramname"><em>defaults</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Reading a recipe string parameter value. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parlist</em> </td><td>The input parameter list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The parameter name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>defaults</em> </td><td>The defaults table</td></tr>
+</div><div class="memdoc">
+
+<p>Reading a recipe string parameter value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parlist</td><td>The input parameter list </td></tr>
+    <tr><td class="paramname">name</td><td>The parameter name </td></tr>
+    <tr><td class="paramname">defaults</td><td>The defaults table</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The parameter value</dd></dl>
-This function is just a wrapper to the basic CPL function <code>cpl_parameter_get_string()</code>, but if a <em>defaults</em> table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a <em>defaults</em> table is [...]
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00605">605</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-Referenced by <a class="el" href="fors__dfs_8c-source.html#l00829">dfs_get_parameter_string_const()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The parameter value</dd></dl>
+<p>This function is just a wrapper to the basic CPL function <code>cpl_parameter_get_string()</code>, but if a <em>defaults</em> table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a <em>defaults</em> table [...]
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00605">605</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dfs_8c_source.html#l00829">dfs_get_parameter_string_const()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g29d32919bff2808b25d85dacd496e834"></a><!-- doxytag: member="fors_dfs.c::dfs_get_parameter_bool" ref="g29d32919bff2808b25d85dacd496e834" args="(cpl_parameterlist *parlist, const char *name, const cpl_table *defaults)" -->
+</div>
+<a class="anchor" id="ga48768c59ba1e2bf1776ad4770ab09fbb"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int dfs_get_parameter_bool           </td>
+          <td class="memname">int dfs_get_parameter_bool </td>
           <td>(</td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_table * </td>
-          <td class="paramname"> <em>defaults</em></td><td> </td>
+          <td class="paramtype">const cpl_table * </td>
+          <td class="paramname"><em>defaults</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Reading a recipe boolean parameter value. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parlist</em> </td><td>The input parameter list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The parameter name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>defaults</em> </td><td>The defaults table</td></tr>
+</div><div class="memdoc">
+
+<p>Reading a recipe boolean parameter value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parlist</td><td>The input parameter list </td></tr>
+    <tr><td class="paramname">name</td><td>The parameter name </td></tr>
+    <tr><td class="paramname">defaults</td><td>The defaults table</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The parameter value</dd></dl>
-This function is just a wrapper to the basic CPL function <code>cpl_parameter_get_bool()</code>, but if a <em>defaults</em> table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a <em>defaults</em> table is n [...]
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00704">704</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-Referenced by <a class="el" href="fors__dfs_8c-source.html#l00799">dfs_get_parameter_bool_const()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The parameter value</dd></dl>
+<p>This function is just a wrapper to the basic CPL function <code>cpl_parameter_get_bool()</code>, but if a <em>defaults</em> table is passed then the parameter value is searched in that table. If it is found, the parameter value will be modified also on the input parameter list before being returned, so that it would appear on the recipe products headers. If the parameter is not found, then the parameter value is simply read from the input parameter list. If a <em>defaults</em> table i [...]
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00704">704</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dfs_8c_source.html#l00799">dfs_get_parameter_bool_const()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gfce5eddb71d8700b30c690f49374d2e0"></a><!-- doxytag: member="fors_dfs.c::dfs_get_parameter_bool_const" ref="gfce5eddb71d8700b30c690f49374d2e0" args="(const cpl_parameterlist *parlist, const char *name)" -->
+</div>
+<a class="anchor" id="gae0dc63f80258d73a93d35e41b2a8b367"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int dfs_get_parameter_bool_const           </td>
+          <td class="memname">int dfs_get_parameter_bool_const </td>
           <td>(</td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a> </dd></dl>
 
-<p>
-<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a> </dd></dl>
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00799">799</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00799">799</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00704">dfs_get_parameter_bool()</a>.
-<p>
-Referenced by <a class="el" href="fors__photometry__impl_8c-source.html#l00561">fors_photometry_parameter_get_num()</a>.
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00704">dfs_get_parameter_bool()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g55c3af99cf54ae488cb2c431a75a658f"></a><!-- doxytag: member="fors_dfs.c::dfs_get_parameter_int_const" ref="g55c3af99cf54ae488cb2c431a75a658f" args="(const cpl_parameterlist *parlist, const char *name)" -->
+<a class="anchor" id="gaef153fed14f117971d69d1d92fa9a9e6"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int dfs_get_parameter_int_const           </td>
+          <td class="memname">int dfs_get_parameter_int_const </td>
           <td>(</td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a> </dd></dl>
 
-<p>
-<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a> </dd></dl>
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00809">809</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00410">dfs_get_parameter_int()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00258">fors_extract_method_new()</a>, <a class="el" href="fors__stack_8c_source.html#l00157">fors_stack_method_new()</a>, <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00299">remove_large_scale()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00409">remove_large_scale_fit()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00809">809</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00410">dfs_get_parameter_int()</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00258">fors_extract_method_new()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00561">fors_photometry_parameter_get_num()</a>, <a class="el" href="fors__stack_8c-source.html#l00157">fors_stack_method_new()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00299">remove_large_scale()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00407">remove_large_scal [...]
 </div>
-</div><p>
-<a class="anchor" name="g52067dcd1b5c643c72b7350cdb204206"></a><!-- doxytag: member="fors_dfs.c::dfs_get_parameter_double_const" ref="g52067dcd1b5c643c72b7350cdb204206" args="(const cpl_parameterlist *parlist, const char *name)" -->
+</div>
+<a class="anchor" id="ga35b9237db0837319a04e85e6cf9dd50d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double dfs_get_parameter_double_const           </td>
+          <td class="memname">double dfs_get_parameter_double_const </td>
           <td>(</td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a> </dd></dl>
 
-<p>
-<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a> </dd></dl>
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00819">819</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00819">819</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00507">dfs_get_parameter_double()</a>.
-<p>
-Referenced by <a class="el" href="fors__identify_8c-source.html#l00193">fors_identify_method_new()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00561">fors_photometry_parameter_get_num()</a>, <a class="el" href="fors__stack_8c-source.html#l00157">fors_stack_method_new()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00507">dfs_get_parameter_double()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify_8c_source.html#l00193">fors_identify_method_new()</a>, <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__stack_8c_source.html#l00157">fors_stack_method_new()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g5a310bdfd1e4a39517cb74b1c8696753"></a><!-- doxytag: member="fors_dfs.c::dfs_get_parameter_string_const" ref="g5a310bdfd1e4a39517cb74b1c8696753" args="(const cpl_parameterlist *parlist, const char *name)" -->
+<a class="anchor" id="ga8cb34aee7c26915499cbfb7d9d38b9cd"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">const char* dfs_get_parameter_string_const           </td>
+          <td class="memname">const char* dfs_get_parameter_string_const </td>
           <td>(</td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a> </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00829">829</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00605">dfs_get_parameter_string()</a>.</p>
 
-<p>
-<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a> </dd></dl>
+<p>Referenced by <a class="el" href="fors_2fors__extract_8c_source.html#l00258">fors_extract_method_new()</a>, and <a class="el" href="fors__stack_8c_source.html#l00157">fors_stack_method_new()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00829">829</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00605">dfs_get_parameter_string()</a>.
-<p>
-Referenced by <a class="el" href="fors_2fors__extract_8c-source.html#l00258">fors_extract_method_new()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l00607">fors_photometry_parameter_get_string()</a>, and <a class="el" href="fors__stack_8c-source.html#l00157">fors_stack_method_new()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g29a45e1e84aa9d87c1a23773e82c796f"></a><!-- doxytag: member="fors_dfs.c::dfs_load_image" ref="g29a45e1e84aa9d87c1a23773e82c796f" args="(cpl_frameset *frameset, const char *category, cpl_type type, int ext, int calib)" -->
+</div>
+<a class="anchor" id="ga326130afab421ef30992def2a444d660"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* dfs_load_image           </td>
+          <td class="memname">cpl_image* dfs_load_image </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>category</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>category</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_type </td>
-          <td class="paramname"> <em>type</em>, </td>
+          <td class="paramtype">cpl_type </td>
+          <td class="paramname"><em>type</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ext</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ext</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>calib</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>calib</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Loading image data of given category. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frameset</em> </td><td>The input set-of-frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>category</em> </td><td>The category of the image to load </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>The data type of the loaded image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ext</em> </td><td>The FITS file extension to access (first = 0) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>calib</em> </td><td>1 = calibration file, 0 = raw file</td></tr>
+</div><div class="memdoc">
+
+<p>Loading image data of given category. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frameset</td><td>The input set-of-frames </td></tr>
+    <tr><td class="paramname">category</td><td>The category of the image to load </td></tr>
+    <tr><td class="paramname">type</td><td>The data type of the loaded image </td></tr>
+    <tr><td class="paramname">ext</td><td>The FITS file extension to access (first = 0) </td></tr>
+    <tr><td class="paramname">calib</td><td>1 = calibration file, 0 = raw file</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The loaded image</dd></dl>
-This function is just a wrapper to the basic CPL functions <code>cpl_frameset_find()</code> and <code>cpl_image_load()</code>, as they typically are called every time an image should be loaded by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.<p>
-In case of any error, a <code>NULL</code> pointer is returned. The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to <code>cpl_error_get_where()</code> ) is not modified by this function, and therefore the function where the failure occurred is also reported. 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00863">863</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The loaded image</dd></dl>
+<p>This function is just a wrapper to the basic CPL functions <code>cpl_frameset_find()</code> and <code>cpl_image_load()</code>, as they typically are called every time an image should be loaded by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.</p>
+<p>In case of any error, a <code>NULL</code> pointer is returned. The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to <code>cpl_error_get_where()</code> ) is not modified by this function, and therefore the function where the failure occurred is also reported. </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00863">863</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g1c15a2052dc4b7f916eff93271aeb27a"></a><!-- doxytag: member="fors_dfs.c::dfs_load_table" ref="g1c15a2052dc4b7f916eff93271aeb27a" args="(cpl_frameset *frameset, const char *category, int ext)" -->
+</div>
+<a class="anchor" id="ga010c17942448386415d6e51adebae649"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* dfs_load_table           </td>
+          <td class="memname">cpl_table* dfs_load_table </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>category</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>category</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ext</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ext</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Loading table data of given category. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frameset</em> </td><td>The input set-of-frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>category</em> </td><td>The category of the table to load </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ext</em> </td><td>The FITS file extension to access (first = 0)</td></tr>
+</div><div class="memdoc">
+
+<p>Loading table data of given category. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frameset</td><td>The input set-of-frames </td></tr>
+    <tr><td class="paramname">category</td><td>The category of the table to load </td></tr>
+    <tr><td class="paramname">ext</td><td>The FITS file extension to access (first = 0)</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The loaded table</dd></dl>
-This function is just a wrapper to the basic CPL functions <code>cpl_frameset_find()</code> and <code>cpl_table_load()</code>, as they typically are called every time a table should be loaded by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.<p>
-In case of any error, a <code>NULL</code> pointer is returned. The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to <code>cpl_error_get_where()</code> ) is not modified by this function, and therefore the function where the failure occurred is also reported. 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00919">919</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The loaded table</dd></dl>
+<p>This function is just a wrapper to the basic CPL functions <code>cpl_frameset_find()</code> and <code>cpl_table_load()</code>, as they typically are called every time a table should be loaded by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.</p>
+<p>In case of any error, a <code>NULL</code> pointer is returned. The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to <code>cpl_error_get_where()</code> ) is not modified by this function, and therefore the function where the failure occurred is also reported. </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00919">919</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g9774126e0acba5d1bf25bda41a4fb794"></a><!-- doxytag: member="fors_dfs.c::dfs_load_header" ref="g9774126e0acba5d1bf25bda41a4fb794" args="(cpl_frameset *frameset, const char *category, int ext)" -->
+</div>
+<a class="anchor" id="gadc48c0a3a86ef31943bf2da28ab136cf"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_propertylist* dfs_load_header           </td>
+          <td class="memname">cpl_propertylist* dfs_load_header </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>category</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>category</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ext</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ext</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Loading header associated to data of given category. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frameset</em> </td><td>The input set-of-frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>category</em> </td><td>The category of the frame containing the header </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ext</em> </td><td>The FITS file extension to access (first = 0)</td></tr>
+</div><div class="memdoc">
+
+<p>Loading header associated to data of given category. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frameset</td><td>The input set-of-frames </td></tr>
+    <tr><td class="paramname">category</td><td>The category of the frame containing the header </td></tr>
+    <tr><td class="paramname">ext</td><td>The FITS file extension to access (first = 0)</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The loaded property list</dd></dl>
-This function is just a wrapper to the basic CPL functions <code>cpl_frameset_find()</code> and <code>cpl_propertylist_load()</code>, as they typically are called every time a header should be loaded by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.<p>
-In case of any error, a <code>NULL</code> pointer is returned. The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to <code>cpl_error_get_where()</code> ) is not modified by this function, and therefore the function where the failure occurred is also reported. 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l00969">969</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd>The loaded property list</dd></dl>
+<p>This function is just a wrapper to the basic CPL functions <code>cpl_frameset_find()</code> and <code>cpl_propertylist_load()</code>, as they typically are called every time a header should be loaded by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.</p>
+<p>In case of any error, a <code>NULL</code> pointer is returned. The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to <code>cpl_error_get_where()</code> ) is not modified by this function, and therefore the function where the failure occurred is also reported. </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l00969">969</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g8670593994ad689ac3aa76cf648e76c3"></a><!-- doxytag: member="fors_dfs.c::dfs_save" ref="g8670593994ad689ac3aa76cf648e76c3" args="(cpl_frameset *frameset, const void *object, cpl_frame_type type, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const cpl_frame *raw_frame)" -->
+<a class="anchor" id="ga04ce01a9ddd2c4ddee75010d7fdb81fd"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void dfs_save           </td>
+          <td class="memname">static void dfs_save </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const void * </td>
-          <td class="paramname"> <em>object</em>, </td>
+          <td class="paramtype">const void * </td>
+          <td class="paramname"><em>object</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_frame_type </td>
-          <td class="paramname"> <em>type</em>, </td>
+          <td class="paramtype">fors_type </td>
+          <td class="paramname"><em>type</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>category</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>category</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>recipename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>recipename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>raw_frame</em></td><td> </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>inherit_frame</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Save DFS product. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>CPL_FRAME_TYPE_IMAGE or CPL_FRAME_TYPE_TABLE </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>object</em> </td><td>must be of type fors_image or cpl_table, depending on the parameter <em>type</em> </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Save DFS product. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">type</td><td>CPL_FRAME_TYPE_IMAGE or CPL_FRAME_TYPE_TABLE </td></tr>
+    <tr><td class="paramname">object</td><td>must be of type fors_image or cpl_table, depending on the parameter <em>type</em> </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01001">1001</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00363">fors_dfs_pipeline_version()</a>, <a class="el" href="fors__image_8c-source.html#l00584">fors_image_save()</a>, and <a class="el" href="fors__dfs_8c-source.html#l00069">strlower()</a>.
-<p>
-Referenced by <a class="el" href="fors__dfs_8c-source.html#l01164">fors_dfs_save_image()</a>, and <a class="el" href="fors__dfs_8c-source.html#l01279">fors_dfs_save_table()</a>.
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01001">1001</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l00363">fors_dfs_pipeline_version()</a>, and <a class="el" href="fors__image_8c_source.html#l00587">fors_image_save()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__dfs_8c_source.html#l01166">fors_dfs_save_image()</a>, <a class="el" href="fors__dfs_8c_source.html#l01200">fors_dfs_save_image_err()</a>, and <a class="el" href="fors__dfs_8c_source.html#l01315">fors_dfs_save_table()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g810ca5e9d6f0af849344d0b5f60f3cf1"></a><!-- doxytag: member="fors_dfs.c::fors_dfs_save_image" ref="g810ca5e9d6f0af849344d0b5f60f3cf1" args="(cpl_frameset *frameset, const fors_image *image, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const cpl_frame *raw_frame)" -->
+<a class="anchor" id="ga45cefe5c9339a8b27be0454c9144a70a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_dfs_save_image           </td>
+          <td class="memname">void fors_dfs_save_image </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>category</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>category</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>recipename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>recipename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>raw_frame</em></td><td> </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>inherit_frame</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Save DFS product (image). 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frameset</em> </td><td>see <a class="el" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image()</a> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>image (containing data and error bars) to save </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>category</em> </td><td>see <a class="el" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image()</a> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>see <a class="el" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image()</a> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parlist</em> </td><td>see <a class="el" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image()</a> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>recipename</em> </td><td>see <a class="el" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image()</a> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>raw_frame</em> </td><td>any raw frame used for this product</td></tr>
+</div><div class="memdoc">
+
+<p>Save DFS product (image) </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frameset</td><td>see <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a> </td></tr>
+    <tr><td class="paramname">image</td><td>image (containing data and error bars) to save </td></tr>
+    <tr><td class="paramname">category</td><td>see <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a> </td></tr>
+    <tr><td class="paramname">header</td><td>see <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a> </td></tr>
+    <tr><td class="paramname">parlist</td><td>see <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a> </td></tr>
+    <tr><td class="paramname">recipename</td><td>see <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a> </td></tr>
+    <tr><td class="paramname">raw_frame</td><td>any raw frame used for this product</td></tr>
   </table>
+  </dd>
 </dl>
-This function is the same as <a class="el" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image()</a>, except the image is saved using <a class="el" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save()</a>.<p>
-The instrument version number is determined from the header of the input raw frame. 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01164">1164</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l01001">dfs_save()</a>.
-<p>
-Referenced by <a class="el" href="fors__bias__impl_8c-source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c-source.html#l00103">fors_dark()</a>, <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry [...]
+<p>This function is the same as <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a>, except the image is saved using <a class="el" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save()</a>.</p>
+<p>The instrument version number is determined from the header of the input raw frame. </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01166">1166</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l01001">dfs_save()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="geb1068e007bd0ebef0cd4a6aa12cf523"></a><!-- doxytag: member="fors_dfs.c::fors_dfs_add_wcs" ref="geb1068e007bd0ebef0cd4a6aa12cf523" args="(cpl_propertylist *header, const cpl_frame *frame, const fors_setting *setting)" -->
+</div>
+<a class="anchor" id="ga6f529d571ffaada1dbc4299ca5cdf3d7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_dfs_add_wcs           </td>
+          <td class="memname">void fors_dfs_save_image_err </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const <a class="el" href="struct__fors__image.html">fors_image</a> * </td>
+          <td class="paramname"><em>image</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>category</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>frame</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>recipename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
-          <td class="paramname"> <em>setting</em></td><td> </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>inherit_frame</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-add WCS keywords to header 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>to write to </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>frame</em> </td><td>get keywords from this frame </td></tr>
+</div><div class="memdoc">
+
+<p>Save DFS product (image) with it error data. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frameset</td><td>see <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a> </td></tr>
+    <tr><td class="paramname">image</td><td>image (containing data and error bars) to save </td></tr>
+    <tr><td class="paramname">category</td><td>see <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a> </td></tr>
+    <tr><td class="paramname">header</td><td>see <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a> </td></tr>
+    <tr><td class="paramname">parlist</td><td>see <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a> </td></tr>
+    <tr><td class="paramname">recipename</td><td>see <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a> </td></tr>
+    <tr><td class="paramname">raw_frame</td><td>any raw frame used for this product</td></tr>
   </table>
+  </dd>
 </dl>
+<p>This function is the same as <a class="el" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image()</a>, except the image is saved using <a class="el" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save()</a>.</p>
+<p>The instrument version number is determined from the header of the input raw frame. </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01200">1200</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l01001">dfs_save()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias__impl_8c_source.html#l00109">fors_bias()</a>, <a class="el" href="fors__dark__impl_8c_source.html#l00103">fors_dark()</a>, <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00186">fors_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photome [...]
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01185">1185</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__pfits_8c-source.html#l00060">FORS_PFITS_CRPIX1</a>, <a class="el" href="fors__pfits_8c-source.html#l00061">FORS_PFITS_CRPIX2</a>, <a class="el" href="fors__setting_8h-source.html#l00052">_fors_setting::prescan_x</a>, <a class="el" href="fors__setting_8h-source.html#l00052">_fors_setting::prescan_y</a>, and <a class="el"  [...]
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gea45a5b73ab086e5e08680928adbd0cd"></a><!-- doxytag: member="fors_dfs.c::fors_dfs_add_exptime" ref="gea45a5b73ab086e5e08680928adbd0cd" args="(cpl_propertylist *header, const cpl_frame *frame, double exptime)" -->
+</div>
+<a class="anchor" id="gadbf163fdd77abcf68fac009993f20959"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_dfs_add_exptime           </td>
+          <td class="memname">void fors_dfs_add_wcs </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>frame</em>, </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>frame</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>exptime</em></td><td> </td>
+          <td class="paramtype">const <a class="el" href="struct__fors__setting.html">fors_setting</a> * </td>
+          <td class="paramname"><em>setting</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
+</div><div class="memdoc">
+
+<p>add WCS keywords to header </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>to write to </td></tr>
+    <tr><td class="paramname">frame</td><td>get keywords from this frame </td></tr>
+  </table>
+  </dd>
+</dl>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01221">1221</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
+</div>
 </div>
-<div class="memdoc">
-
-<p>
-Add keyword EXPTIME to header. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>to write to </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>frame</em> </td><td>get keyword from this frame</td></tr>
+<a class="anchor" id="ga71054af8e26681ec2d7e1ea39e7feb17"></a>
+<div class="memitem">
+<div class="memproto">
+      <table class="memname">
+        <tr>
+          <td class="memname">void fors_dfs_add_exptime </td>
+          <td>(</td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>frame</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>exptime</em> </td>
+        </tr>
+        <tr>
+          <td></td>
+          <td>)</td>
+          <td></td><td></td>
+        </tr>
+      </table>
+</div><div class="memdoc">
+
+<p>Add keyword EXPTIME to header. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>to write to </td></tr>
+    <tr><td class="paramname">frame</td><td>get keyword from this frame</td></tr>
   </table>
+  </dd>
 </dl>
-If frame is NULL, a keyword EXPTIME is created in header with the value given in exptime. Otherwise, the value is read from the header of frame. In case of error (i.e., the keyword EXPTIME doesn't exist in frame), nothing is done (and the error is reset). 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01239">1239</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
+<p>If frame is NULL, a keyword EXPTIME is created in header with the value given in exptime. Otherwise, the value is read from the header of frame. In case of error (i.e., the keyword EXPTIME doesn't exist in frame), nothing is done (and the error is reset). </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01275">1275</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gf9fc39acdf17a36a3c8aa7d8f008ae42"></a><!-- doxytag: member="fors_dfs.c::fors_dfs_save_table" ref="gf9fc39acdf17a36a3c8aa7d8f008ae42" args="(cpl_frameset *frameset, const cpl_table *table, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const cpl_frame *raw_frame)" -->
+<a class="anchor" id="ga65ab95dab0ba56844b6b548b18b6487f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_dfs_save_table           </td>
+          <td class="memname">void fors_dfs_save_table </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_table * </td>
-          <td class="paramname"> <em>table</em>, </td>
+          <td class="paramtype">const cpl_table * </td>
+          <td class="paramname"><em>table</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>category</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>category</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>recipename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>recipename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>raw_frame</em></td><td> </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>inherit_frame</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
+</div><div class="memdoc">
+
+<p>Save DFS product (table) </p>
+<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__forsdfs.html#ga45cefe5c9339a8b27be0454c9144a70a" title="Save DFS product (image)">fors_dfs_save_image()</a> </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01315">1315</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l01001">dfs_save()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, and <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-Save DFS product (table). 
-<p>
-<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1">fors_dfs_save_image()</a> </dd></dl>
-
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01279">1279</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l01001">dfs_save()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, and <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g670873281aac860fb32cce7ef99d3465"></a><!-- doxytag: member="fors_dfs.c::dfs_save_image" ref="g670873281aac860fb32cce7ef99d3465" args="(cpl_frameset *frameset, const cpl_image *image, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const char *version)" -->
+<a class="anchor" id="ga6ad37d6af14278e58f72e820427158c5"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int dfs_save_image           </td>
+          <td class="memname">int dfs_save_image </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>category</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>category</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>recipename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>recipename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>version</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>version</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Saving image data of given category. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frameset</em> </td><td>The input set-of-frames (to be upgraded) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>The image to save </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>category</em> </td><td>The category of the image to save </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Header to input to cpl_dfs_setup_product_header() </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parlist</em> </td><td>The recipe parameter list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>recipename</em> </td><td>The name of the recipe </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>version</em> </td><td>The version of the pipeline</td></tr>
+</div><div class="memdoc">
+
+<p>Saving image data of given category. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frameset</td><td>The input set-of-frames (to be upgraded) </td></tr>
+    <tr><td class="paramname">image</td><td>The image to save </td></tr>
+    <tr><td class="paramname">category</td><td>The category of the image to save </td></tr>
+    <tr><td class="paramname">header</td><td>Header to input to cpl_dfs_setup_product_header() </td></tr>
+    <tr><td class="paramname">parlist</td><td>The recipe parameter list </td></tr>
+    <tr><td class="paramname">recipename</td><td>The name of the recipe </td></tr>
+    <tr><td class="paramname">version</td><td>The version of the pipeline</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 in case of success.</dd></dl>
-This function is just a wrapper to the basic CPL functions that are routinely called every time an image product must be saved to disk by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.<p>
-The output file name will be derived from the specified category by lowercasing it and by appending the suffix ".fits". The new image is properly logged in the input set-of-frames in case of success.<p>
-The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to <code>cpl_error_get_where()</code> ) is not modified by this function, and therefore the function where the failure occurred is also reported. 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01323">1323</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00069">strlower()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__zeropoint__impl_8c-source.html#l00215">fors_zeropoint()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 in case of success.</dd></dl>
+<p>This function is just a wrapper to the basic CPL functions that are routinely called every time an image product must be saved to disk by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.</p>
+<p>The output file name will be derived from the specified category by lowercasing it and by appending the suffix ".fits". The new image is properly logged in the input set-of-frames in case of success.</p>
+<p>The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to <code>cpl_error_get_where()</code> ) is not modified by this function, and therefore the function where the failure occurred is also reported. </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01359">1359</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__zeropoint__impl_8c_source.html#l00215">fors_zeropoint()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gd3653f59add0d28a7f53ac0ccffb2616"></a><!-- doxytag: member="fors_dfs.c::dfs_save_table" ref="gd3653f59add0d28a7f53ac0ccffb2616" args="(cpl_frameset *frameset, const cpl_table *table, const char *category, cpl_propertylist *header, const cpl_parameterlist *parlist, const char *recipename, const char *version)" -->
+<a class="anchor" id="gaf327994c9f97caba177eef18692b1824"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int dfs_save_table           </td>
+          <td class="memname">int dfs_save_table </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_table * </td>
-          <td class="paramname"> <em>table</em>, </td>
+          <td class="paramtype">const cpl_table * </td>
+          <td class="paramname"><em>table</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>category</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>category</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">const cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>recipename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>recipename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>version</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>version</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Saving table data of given category. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frameset</em> </td><td>The input set-of-frames (to be upgraded) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>table</em> </td><td>The table to save </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>category</em> </td><td>The category of the table to save </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Header to input to cpl_dfs_setup_product_header() </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parlist</em> </td><td>The recipe parameter list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>recipename</em> </td><td>The name of the recipe </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>version</em> </td><td>The version of the pipeline</td></tr>
+</div><div class="memdoc">
+
+<p>Saving table data of given category. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frameset</td><td>The input set-of-frames (to be upgraded) </td></tr>
+    <tr><td class="paramname">table</td><td>The table to save </td></tr>
+    <tr><td class="paramname">category</td><td>The category of the table to save </td></tr>
+    <tr><td class="paramname">header</td><td>Header to input to cpl_dfs_setup_product_header() </td></tr>
+    <tr><td class="paramname">parlist</td><td>The recipe parameter list </td></tr>
+    <tr><td class="paramname">recipename</td><td>The name of the recipe </td></tr>
+    <tr><td class="paramname">version</td><td>The version of the pipeline</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 in case of success.</dd></dl>
-This function is just a wrapper to the basic CPL functions that are routinely called every time a table product must be saved to disk by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.<p>
-The output file name will be derived from the specified category by lowercasing it and by appending the suffix ".fits". The new table is properly logged in the input set-of-frames in case of success.<p>
-The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to <code>cpl_error_get_where()</code> ) is not modified by this function, and therefore the function where the failure occurred is also reported. 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01458">1458</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00069">strlower()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd>0 in case of success.</dd></dl>
+<p>This function is just a wrapper to the basic CPL functions that are routinely called every time a table product must be saved to disk by a recipe. Error checking and proper messaging are also included here, to give a more readable look to the main recipe code.</p>
+<p>The output file name will be derived from the specified category by lowercasing it and by appending the suffix ".fits". The new table is properly logged in the input set-of-frames in case of success.</p>
+<p>The error codes that are set in this case are the same set by the above mentioned CPL functions. The "where" string (accessible via a call to <code>cpl_error_get_where()</code> ) is not modified by this function, and therefore the function where the failure occurred is also reported. </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01498">1498</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g318f71668fea717baced57478bd282c8"></a><!-- doxytag: member="fors_dfs.c::dfs_equal_keyword" ref="g318f71668fea717baced57478bd282c8" args="(cpl_frameset *frameset, const char *keyword)" -->
+</div>
+<a class="anchor" id="gae17908f224eaaa5696f0dc084a964435"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int dfs_equal_keyword           </td>
+          <td class="memname">int dfs_equal_keyword </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>keyword</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>keyword</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Saving table data of given category. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frameset</em> </td><td>The input set-of-frames </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>keyword</em> </td><td>The keyword that should be identical in all frames</td></tr>
+</div><div class="memdoc">
+
+<p>Saving table data of given category. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frameset</td><td>The input set-of-frames </td></tr>
+    <tr><td class="paramname">keyword</td><td>The keyword that should be identical in all frames</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>1 if consistent, 0 if inconsistent</dd></dl>
-The specified FITS header <em>keyword</em> should be identical in all the input frames. Only the FITS primary header is examined. If <em>keyword</em> is missing this is considered a case of identical keywords. Only integer and string keywords are compared: in case of other types 0 is always returned. If a file is not FITS, it is ignored. 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01584">1584</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd>1 if consistent, 0 if inconsistent</dd></dl>
+<p>The specified FITS header <em>keyword</em> should be identical in all the input frames. Only the FITS primary header is examined. If <em>keyword</em> is missing this is considered a case of identical keywords. Only integer and string keywords are compared: in case of other types 0 is always returned. If a file is not FITS, it is ignored. </p>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01628">1628</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gc673cd895f691fdd4903275de721aa29"></a><!-- doxytag: member="fors_dfs.c::dfs_save_table_ext" ref="gc673cd895f691fdd4903275de721aa29" args="(cpl_table *table, const char *tag, cpl_propertylist *extheader)" -->
+<a class="anchor" id="ga9fe80dfc0b048b03eb846f68de836489"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code dfs_save_table_ext           </td>
+          <td class="memname">cpl_error_code dfs_save_table_ext </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>table</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>table</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>extheader</em></td><td> </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>extheader</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Save a table in a extension (different from the first one). 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>table</em> </td><td>Table to save </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>PRO.CATG of the table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>extheader</em> </td><td>Header for the extension or NULL</td></tr>
+</div><div class="memdoc">
+
+<p>Save a table in a extension (different from the first one) </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">table</td><td>Table to save </td></tr>
+    <tr><td class="paramname">tag</td><td>PRO.CATG of the table </td></tr>
+    <tr><td class="paramname">extheader</td><td>Header for the extension or NULL</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error. </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01756">1756</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01712">1712</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00069">strlower()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g0c6583af923e2d981ba63d623f7f16f2"></a><!-- doxytag: member="fors_dfs.c::dfs_save_image_ext" ref="g0c6583af923e2d981ba63d623f7f16f2" args="(cpl_image *image, const char *tag, cpl_propertylist *extheader)" -->
+</div>
+<a class="anchor" id="ga8c69e34b93aa2964cf10be637a4ee9ee"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code dfs_save_image_ext           </td>
+          <td class="memname">cpl_error_code dfs_save_image_ext </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>extheader</em></td><td> </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>extheader</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Save an image in a extension. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image to save </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>PRO.CATG of the image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>extheader</em> </td><td>Header for the extension or NULL</td></tr>
+</div><div class="memdoc">
+
+<p>Save an image in a extension. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image to save </td></tr>
+    <tr><td class="paramname">tag</td><td>PRO.CATG of the image </td></tr>
+    <tr><td class="paramname">extheader</td><td>Header for the extension or NULL</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error. </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01795">1795</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01751">1751</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00069">strlower()</a>.
 </div>
-</div><p>
-<a class="anchor" name="ge7d189654778913f074c1f46f801f7fb"></a><!-- doxytag: member="fors_dfs.c::dfs_save_image_null" ref="ge7d189654778913f074c1f46f801f7fb" args="(cpl_frameset *frameset, cpl_parameterlist *parlist, const char *tag, const char *recipename, const char *version)" -->
+</div>
+<a class="anchor" id="ga13a196799766da8b28cb89d4ea54ca8b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code dfs_save_image_null           </td>
+          <td class="memname">cpl_error_code dfs_save_image_null </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em>, </td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>recipename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>recipename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>version</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>version</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Save a product with an empty primary extension. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>frameset</em> </td><td>Frameset </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>parlist</em> </td><td>Parlist </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>PRO.CATG of the product </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>recipename</em> </td><td>Name of the recipe </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>version</em> </td><td>Version</td></tr>
+</div><div class="memdoc">
+
+<p>Save a product with an empty primary extension. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">frameset</td><td>Frameset </td></tr>
+    <tr><td class="paramname">parlist</td><td>Parlist </td></tr>
+    <tr><td class="paramname">tag</td><td>PRO.CATG of the product </td></tr>
+    <tr><td class="paramname">recipename</td><td>Name of the recipe </td></tr>
+    <tr><td class="paramname">version</td><td>Version</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error. </dd></dl>
+
+<p>Definition at line <a class="el" href="fors__dfs_8c_source.html#l01838">1838</a> of file <a class="el" href="fors__dfs_8c_source.html">fors_dfs.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="fors__dfs_8c-source.html#l01794">1794</a> of file <a class="el" href="fors__dfs_8c-source.html">fors_dfs.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l00069">strlower()</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__forsqc.html b/html/group__forsqc.html
index e39eb6f..708673d 100644
--- a/html/group__forsqc.html
+++ b/html/group__forsqc.html
@@ -1,680 +1,702 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Quality Control Utilities</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Quality Control Utilities</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g3732f2464bb007412951345e03594a17">fors_header_write_string</a> (cpl_propertylist *header, const char *name, const char *value, const char *comment)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Write a string value to the active QC1 PAF object and to a header.  <a href="#g3732f2464bb007412951345e03594a17"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc">fors_header_write_double</a> (cpl_propertylist *header, double value, const char *name, const char *unit, const char *comment)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Write an integer value to the active QC1 PAF object and to a header.  <a href="#g0bdbc90121da69da75af1f60bfb553cc"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5add57d4e24de85d348f48f8a1c752bb"></a><!-- doxytag: member="forsqc::fors_header_write_int" ref="g5add57d4e24de85d348f48f8a1c752bb" args="(cpl_propertylist *header, int value, const char *name, const char *unit, const char *comment)" -->
-cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g5add57d4e24de85d348f48f8a1c752bb">fors_header_write_int</a> (cpl_propertylist *header, int value, const char *name, const char *unit, const char *comment)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a> (cpl_propertylist *header, const char *qcdic_version, const char *instrument)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Initiate a new QC1 group.  <a href="#g09a7618d5c3bb5bac853d56e30c2dc8b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g1ccea526719a1be6c14de81963d81955">fors_qc_write_group_heading</a> (const cpl_frame *raw_frame, const char *pro_catg, const char *instrument)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Initiate a new QC1 group and log basic QC.  <a href="#g1ccea526719a1be6c14de81963d81955"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Close current QC1 PAF file.  <a href="#g09e2a2672daa14e29aaa138cb4ca8f03"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a> (const char *name, const char *value, const char *comment, const char *instrument)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Add string parameter to current QC1 group.  <a href="#gbf9d98b1564188b3aeaf0ea64c60bfb4"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ge4f20b9c870f3d6b30e3ee7a91c1db12"></a><!-- doxytag: member="forsqc::fors_qc_write_string_chat" ref="ge4f20b9c870f3d6b30e3ee7a91c1db12" args="(const char *name, const char *value, const char *comment, const char *instrument)" -->
-cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ge4f20b9c870f3d6b30e3ee7a91c1db12">fors_qc_write_string_chat</a> (const char *name, const char *value, const char *comment, const char *instrument)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g033fc0f2f9e321c4ac98ee7f412b2c6e">fors_qc_write_double</a> (const char *name, double value, const char *unit, const char *comment, const char *instrument)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Add double parameter to current QC1 group.  <a href="#g033fc0f2f9e321c4ac98ee7f412b2c6e"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gaa58844eac4549649cf2ae56b6405903"></a><!-- doxytag: member="forsqc::fors_qc_write_int" ref="gaa58844eac4549649cf2ae56b6405903" args="(const char *name, int value, const char *unit, const char *comment, const char *instrument)" -->
-cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#gaa58844eac4549649cf2ae56b6405903">fors_qc_write_int</a> (const char *name, int value, const char *unit, const char *comment, const char *instrument)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a> (cpl_propertylist *header, const char *name, const char *unit, const char *comment, const char *instrument)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy a keyword value to the currently active QC1 PAF object.  <a href="#g44d5359f81302747fff155c168c88200"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga4480637fba9623895546614d7a21fb5">fors_qc_write_qc_string</a> (cpl_propertylist *header, const char *name, const char *value, const char *comment, const char *instrument)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Write a string value to the active QC1 PAF object and to a header.  <a href="#ga4480637fba9623895546614d7a21fb5"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a> (cpl_propertylist *header, double value, const char *name, const char *unit, const char *comment, const char *instrument)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Write an integer value to the active QC1 PAF object and to a header.  <a href="#g11cc764a5c68308a0a85432d5bb30b38"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g661730c28a076df446641c371342bf5b"></a><!-- doxytag: member="forsqc::fors_qc_write_qc_int" ref="g661730c28a076df446641c371342bf5b" args="(cpl_propertylist *header, int value, const char *name, const char *unit, const char *comment, const char *instrument)" -->
-cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g661730c28a076df446641c371342bf5b">fors_qc_write_qc_int</a> (cpl_propertylist *header, int value, const char *name, const char *unit, const char *comment, const char *instrument)</td></tr>
-
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gf875be6d318687206fdb50a7c61b7924"></a><!-- doxytag: member="forsqc::fors_qc_dic_version" ref="gf875be6d318687206fdb50a7c61b7924" args="" -->
-const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#gf875be6d318687206fdb50a7c61b7924">fors_qc_dic_version</a> = "2.0"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g6311d57c66597cd3d7c9f99c03f641a5"></a><!-- doxytag: member="forsqc::pafFile" ref="g6311d57c66597cd3d7c9f99c03f641a5" args="" -->
-static <a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g6311d57c66597cd3d7c9f99c03f641a5">pafFile</a> = NULL</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5df2835c1cca8f93d1a98f3caff40ff4"></a><!-- doxytag: member="forsqc::pafIndex" ref="g5df2835c1cca8f93d1a98f3caff40ff4" args="" -->
-static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#g5df2835c1cca8f93d1a98f3caff40ff4">pafIndex</a> = 0</td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">Quality Control Utilities</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga099e4acd38cac975fac5e998c5bd3053"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053">fors_header_write_string</a> (cpl_propertylist *header, const char *name, const char *value, const char *comment)</td></tr>
+<tr class="memdesc:ga099e4acd38cac975fac5e998c5bd3053"><td class="mdescLeft"> </td><td class="mdescRight">Write a string value to the active QC1 PAF object and to a header.  <a href="#ga099e4acd38cac975fac5e998c5bd3053">More...</a><br/></td></tr>
+<tr class="separator:ga099e4acd38cac975fac5e998c5bd3053"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga38cae0339b21e1dac5ae3b9a88c5dd6f"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f">fors_header_write_double</a> (cpl_propertylist *header, double value, const char *name, const char *unit, const char *comment)</td></tr>
+<tr class="memdesc:ga38cae0339b21e1dac5ae3b9a88c5dd6f"><td class="mdescLeft"> </td><td class="mdescRight">Write an integer value to the active QC1 PAF object and to a header.  <a href="#ga38cae0339b21e1dac5ae3b9a88c5dd6f">More...</a><br/></td></tr>
+<tr class="separator:ga38cae0339b21e1dac5ae3b9a88c5dd6f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9d46eab8c3bab95ca0d445645bf4038d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9d46eab8c3bab95ca0d445645bf4038d"></a>
+cpl_error_code </td><td class="memItemRight" valign="bottom"><b>fors_header_write_int</b> (cpl_propertylist *header, int value, const char *name, const char *unit, const char *comment)</td></tr>
+<tr class="separator:ga9d46eab8c3bab95ca0d445645bf4038d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5535c92a2c4ee1ae47ae1dff60e8d451"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451">fors_qc_start_group</a> (cpl_propertylist *header, const char *qcdic_version, const char *instrument)</td></tr>
+<tr class="memdesc:ga5535c92a2c4ee1ae47ae1dff60e8d451"><td class="mdescLeft"> </td><td class="mdescRight">Initiate a new QC1 group.  <a href="#ga5535c92a2c4ee1ae47ae1dff60e8d451">More...</a><br/></td></tr>
+<tr class="separator:ga5535c92a2c4ee1ae47ae1dff60e8d451"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9ff2c73c315e805ab5d1415a2de9ce0b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga9ff2c73c315e805ab5d1415a2de9ce0b">fors_qc_write_group_heading</a> (const cpl_frame *raw_frame, const char *pro_catg, const char *instrument)</td></tr>
+<tr class="memdesc:ga9ff2c73c315e805ab5d1415a2de9ce0b"><td class="mdescLeft"> </td><td class="mdescRight">Initiate a new QC1 group and log basic QC.  <a href="#ga9ff2c73c315e805ab5d1415a2de9ce0b">More...</a><br/></td></tr>
+<tr class="separator:ga9ff2c73c315e805ab5d1415a2de9ce0b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0e0fb873edd66f0e42a50c229c650fda"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda">fors_qc_end_group</a> (void)</td></tr>
+<tr class="memdesc:ga0e0fb873edd66f0e42a50c229c650fda"><td class="mdescLeft"> </td><td class="mdescRight">Close current QC1 PAF file.  <a href="#ga0e0fb873edd66f0e42a50c229c650fda">More...</a><br/></td></tr>
+<tr class="separator:ga0e0fb873edd66f0e42a50c229c650fda"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga59a8c8fece17908fd39670a23b15d6f4"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4">fors_qc_write_string</a> (const char *name, const char *value, const char *comment, const char *instrument)</td></tr>
+<tr class="memdesc:ga59a8c8fece17908fd39670a23b15d6f4"><td class="mdescLeft"> </td><td class="mdescRight">Add string parameter to current QC1 group.  <a href="#ga59a8c8fece17908fd39670a23b15d6f4">More...</a><br/></td></tr>
+<tr class="separator:ga59a8c8fece17908fd39670a23b15d6f4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf13e605c8419c9bd134eccdf1fdfc6e2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaf13e605c8419c9bd134eccdf1fdfc6e2"></a>
+cpl_error_code </td><td class="memItemRight" valign="bottom"><b>fors_qc_write_string_chat</b> (const char *name, const char *value, const char *comment, const char *instrument)</td></tr>
+<tr class="separator:gaf13e605c8419c9bd134eccdf1fdfc6e2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8355f62ab2783be464130e8de57487b3"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga8355f62ab2783be464130e8de57487b3">fors_qc_write_double</a> (const char *name, double value, const char *unit, const char *comment, const char *instrument)</td></tr>
+<tr class="memdesc:ga8355f62ab2783be464130e8de57487b3"><td class="mdescLeft"> </td><td class="mdescRight">Add double parameter to current QC1 group.  <a href="#ga8355f62ab2783be464130e8de57487b3">More...</a><br/></td></tr>
+<tr class="separator:ga8355f62ab2783be464130e8de57487b3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga945d4a157c5a4602fcfb644e63d70d15"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga945d4a157c5a4602fcfb644e63d70d15"></a>
+cpl_error_code </td><td class="memItemRight" valign="bottom"><b>fors_qc_write_int</b> (const char *name, int value, const char *unit, const char *comment, const char *instrument)</td></tr>
+<tr class="separator:ga945d4a157c5a4602fcfb644e63d70d15"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0361cf5642de51ebf8e3412fffe70a56"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56">fors_qc_keyword_to_paf</a> (cpl_propertylist *header, const char *name, const char *unit, const char *comment, const char *instrument)</td></tr>
+<tr class="memdesc:ga0361cf5642de51ebf8e3412fffe70a56"><td class="mdescLeft"> </td><td class="mdescRight">Copy a keyword value to the currently active QC1 PAF object.  <a href="#ga0361cf5642de51ebf8e3412fffe70a56">More...</a><br/></td></tr>
+<tr class="separator:ga0361cf5642de51ebf8e3412fffe70a56"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga47dfe71df58ec7c851d4f3853f9f9b00"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga47dfe71df58ec7c851d4f3853f9f9b00">fors_qc_write_qc_string</a> (cpl_propertylist *header, const char *name, const char *value, const char *comment, const char *instrument)</td></tr>
+<tr class="memdesc:ga47dfe71df58ec7c851d4f3853f9f9b00"><td class="mdescLeft"> </td><td class="mdescRight">Write a string value to the active QC1 PAF object and to a header.  <a href="#ga47dfe71df58ec7c851d4f3853f9f9b00">More...</a><br/></td></tr>
+<tr class="separator:ga47dfe71df58ec7c851d4f3853f9f9b00"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4df6371ce29055b043f72f0417ecdf0f"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f">fors_qc_write_qc_double</a> (cpl_propertylist *header, double value, const char *name, const char *unit, const char *comment, const char *instrument)</td></tr>
+<tr class="memdesc:ga4df6371ce29055b043f72f0417ecdf0f"><td class="mdescLeft"> </td><td class="mdescRight">Write an integer value to the active QC1 PAF object and to a header.  <a href="#ga4df6371ce29055b043f72f0417ecdf0f">More...</a><br/></td></tr>
+<tr class="separator:ga4df6371ce29055b043f72f0417ecdf0f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad44c752c8d0fc214c85cb7aca999870b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad44c752c8d0fc214c85cb7aca999870b"></a>
+cpl_error_code </td><td class="memItemRight" valign="bottom"><b>fors_qc_write_qc_int</b> (cpl_propertylist *header, int value, const char *name, const char *unit, const char *comment, const char *instrument)</td></tr>
+<tr class="separator:gad44c752c8d0fc214c85cb7aca999870b"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:gaf0772ae3abe7bce9ce61ad1da366b480"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaf0772ae3abe7bce9ce61ad1da366b480"></a>
+const char *const </td><td class="memItemRight" valign="bottom"><b>fors_qc_dic_version</b> = "2.0"</td></tr>
+<tr class="separator:gaf0772ae3abe7bce9ce61ad1da366b480"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab071a13455e158378961f71fa097bd52"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab071a13455e158378961f71fa097bd52"></a>
+static <a class="el" href="struct__FORS__PAF__.html">ForsPAF</a> * </td><td class="memItemRight" valign="bottom"><b>pafFile</b> = NULL</td></tr>
+<tr class="separator:gab071a13455e158378961f71fa097bd52"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5c762ae2035aed31e7aeec22229b70c2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5c762ae2035aed31e7aeec22229b70c2"></a>
+static int </td><td class="memItemRight" valign="bottom"><b>pafIndex</b> = 0</td></tr>
+<tr class="separator:ga5c762ae2035aed31e7aeec22229b70c2"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-The module collects utility functions for quality control operations. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="fors_qc.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>The module collects utility functions for quality control operations. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_propertylist_delete(header); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="fors__qc_8c_source.html#l00100">100</a> of file <a class="el" href="fors__qc_8c_source.html">fors_qc.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_propertylist_delete(header); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="fors__qc_8c-source.html#l00100">100</a> of file <a class="el" href="fors__qc_8c-source.html">fors_qc.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g3732f2464bb007412951345e03594a17"></a><!-- doxytag: member="fors_header.c::fors_header_write_string" ref="g3732f2464bb007412951345e03594a17" args="(cpl_propertylist *header, const char *name, const char *value, const char *comment)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga099e4acd38cac975fac5e998c5bd3053"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_header_write_string           </td>
+          <td class="memname">cpl_error_code fors_header_write_string </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Write a string value to the active QC1 PAF object and to a header. 
-<p>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Product header </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>QC1 PAF entry name. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Value to write. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>unit</em> </td><td>Optional unit to be associated to value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Comment to be associated to value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>instrument</em> </td><td>Instrument name</td></tr>
+</div><div class="memdoc">
+
+<p>Write a string value to the active QC1 PAF object and to a header. </p>
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>Product header </td></tr>
+    <tr><td class="paramname">name</td><td>QC1 PAF entry name. </td></tr>
+    <tr><td class="paramname">value</td><td>Value to write. </td></tr>
+    <tr><td class="paramname">unit</td><td>Optional unit to be associated to value. </td></tr>
+    <tr><td class="paramname">comment</td><td>Comment to be associated to value. </td></tr>
+    <tr><td class="paramname">instrument</td><td>Instrument name</td></tr>
   </table>
+  </dd>
 </dl>
-An entry with the specified <em>name</em> is written to the current QC1 PAF object. From the entry <em>name</em>, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to the header. Note that before calling this funtion a QC1 PAF object must be created with a call to <a class="el" href="group__forsqc.html#g0 [...]
-<p>
-Definition at line <a class="el" href="fors__header_8c-source.html#l00078">78</a> of file <a class="el" href="fors__header_8c-source.html">fors_header.c</a>.
-<p>
-Referenced by <a class="el" href="fors__bias__impl_8c-source.html#l00172">write_qc()</a>.
+<p>An entry with the specified <em>name</em> is written to the current QC1 PAF object. From the entry <em>name</em>, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to the header. Note that before calling this funtion a QC1 PAF object must be created with a call to <a class="el" href="group__forsqc.html [...]
+
+<p>Definition at line <a class="el" href="fors__header_8c_source.html#l00078">78</a> of file <a class="el" href="fors__header_8c_source.html">fors_header.c</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g0bdbc90121da69da75af1f60bfb553cc"></a><!-- doxytag: member="fors_header.c::fors_header_write_double" ref="g0bdbc90121da69da75af1f60bfb553cc" args="(cpl_propertylist *header, double value, const char *name, const char *unit, const char *comment)" -->
+</div>
+<a class="anchor" id="ga38cae0339b21e1dac5ae3b9a88c5dd6f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_header_write_double           </td>
+          <td class="memname">cpl_error_code fors_header_write_double </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>unit</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>unit</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Write an integer value to the active QC1 PAF object and to a header. 
-<p>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Product header </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Value to write. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>QC1 PAF entry name. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>unit</em> </td><td>Optional unit to be associated to value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Comment to be associated to value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>instrument</em> </td><td>Instrument name</td></tr>
+</div><div class="memdoc">
+
+<p>Write an integer value to the active QC1 PAF object and to a header. </p>
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>Product header </td></tr>
+    <tr><td class="paramname">value</td><td>Value to write. </td></tr>
+    <tr><td class="paramname">name</td><td>QC1 PAF entry name. </td></tr>
+    <tr><td class="paramname">unit</td><td>Optional unit to be associated to value. </td></tr>
+    <tr><td class="paramname">comment</td><td>Comment to be associated to value. </td></tr>
+    <tr><td class="paramname">instrument</td><td>Instrument name</td></tr>
   </table>
+  </dd>
 </dl>
-This function writes the header entries directly to the header of the FITS file written to disk, using the qfits_replace_card() call. An entry with the specified <em>name</em> is written to the current QC1 PAF object. From the entry <em>name</em>, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to the h [...]
-<p>
-Definition at line <a class="el" href="fors__header_8c-source.html#l00131">131</a> of file <a class="el" href="fors__header_8c-source.html">fors_header.c</a>.
-<p>
-Referenced by <a class="el" href="fors__bias__impl_8c-source.html#l00172">write_qc()</a>.
+<p>This function writes the header entries directly to the header of the FITS file written to disk, using the qfits_replace_card() call. An entry with the specified <em>name</em> is written to the current QC1 PAF object. From the entry <em>name</em>, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to th [...]
+
+<p>Definition at line <a class="el" href="fors__header_8c_source.html#l00131">131</a> of file <a class="el" href="fors__header_8c_source.html">fors_header.c</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g09a7618d5c3bb5bac853d56e30c2dc8b"></a><!-- doxytag: member="fors_qc.c::fors_qc_start_group" ref="g09a7618d5c3bb5bac853d56e30c2dc8b" args="(cpl_propertylist *header, const char *qcdic_version, const char *instrument)" -->
+<a class="anchor" id="ga5535c92a2c4ee1ae47ae1dff60e8d451"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_qc_start_group           </td>
+          <td class="memname">cpl_error_code fors_qc_start_group </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>qcdic_version</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>qcdic_version</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>instrument</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>instrument</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Initiate a new QC1 group. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>product header </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>qcdic_version</em> </td><td>dictionary ID </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>instrument</em> </td><td>instrument name </td></tr>
+</div><div class="memdoc">
+
+<p>Initiate a new QC1 group. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>product header </td></tr>
+    <tr><td class="paramname">qcdic_version</td><td>dictionary ID </td></tr>
+    <tr><td class="paramname">instrument</td><td>instrument name </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
-A new PAF object is initiated, with the name depending on the root PAF_ROOT_NAME and the current pafIndex. If the previous QC1 PAF file is found open, this is an error: <a class="el" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group()</a> should be called first. 
-<p>
-Definition at line <a class="el" href="fors__qc_8c-source.html#l00077">77</a> of file <a class="el" href="fors__qc_8c-source.html">fors_qc.c</a>.
-<p>
-References <a class="el" href="fors__qc_8c-source.html#l00535">fors_qc_write_qc_string()</a>, <a class="el" href="fors__paf_8c-source.html#l00548">newForsPAF()</a>, <a class="el" href="fors__qc_8c-source.html#l00058">pafFile</a>, and <a class="el" href="fors__qc_8c-source.html#l00059">pafIndex</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, <a class="el" href="fors__qc-test_8c-source.html#l00045">test_qc()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, <a class="el" href="vimos__science__impl_8c- [...]
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
+<p>A new PAF object is initiated, with the name depending on the root PAF_ROOT_NAME and the current pafIndex. If the previous QC1 PAF file is found open, this is an error: <a class="el" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group()</a> should be called first. </p>
+
+<p>Definition at line <a class="el" href="fors__qc_8c_source.html#l00077">77</a> of file <a class="el" href="fors__qc_8c_source.html">fors_qc.c</a>.</p>
+
+<p>References <a class="el" href="fors__qc_8c_source.html#l00535">fors_qc_write_qc_string()</a>, and <a class="el" href="fors__paf_8c_source.html#l00550">newForsPAF()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, <a class="el" href="fors__qc-test_8c_source.html#l00045">test_qc()</a>, <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="fors__img__screen [...]
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g1ccea526719a1be6c14de81963d81955"></a><!-- doxytag: member="fors_qc.c::fors_qc_write_group_heading" ref="g1ccea526719a1be6c14de81963d81955" args="(const cpl_frame *raw_frame, const char *pro_catg, const char *instrument)" -->
+<a class="anchor" id="ga9ff2c73c315e805ab5d1415a2de9ce0b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void fors_qc_write_group_heading           </td>
+          <td class="memname">void fors_qc_write_group_heading </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frame * </td>
-          <td class="paramname"> <em>raw_frame</em>, </td>
+          <td class="paramtype">const cpl_frame * </td>
+          <td class="paramname"><em>raw_frame</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>pro_catg</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>pro_catg</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>instrument</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>instrument</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Initiate a new QC1 group and log basic QC. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>raw_frame</em> </td><td>input frame </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>pro_catg</em> </td><td>product category </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>instrument</em> </td><td>instrument name</td></tr>
+</div><div class="memdoc">
+
+<p>Initiate a new QC1 group and log basic QC. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">raw_frame</td><td>input frame </td></tr>
+    <tr><td class="paramname">pro_catg</td><td>product category </td></tr>
+    <tr><td class="paramname">instrument</td><td>instrument name</td></tr>
   </table>
+  </dd>
 </dl>
-This function logs common QC parameters. 
-<p>
-Definition at line <a class="el" href="fors__qc_8c-source.html#l00115">115</a> of file <a class="el" href="fors__qc_8c-source.html">fors_qc.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="fors__dfs_8c-source.html#l00105">dfs_generate_filename()</a>, <a class="el" href="fors__qc_8c-source.html#l00425">fors_qc_keyword_to_paf()</a>, and <a class="el" href="fors__qc_8c-source.html#l00235">fors_qc_write_string()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c-source.html#l00485">write_qc()</a>.
+<p>This function logs common QC parameters. </p>
+
+<p>Definition at line <a class="el" href="fors__qc_8c_source.html#l00115">115</a> of file <a class="el" href="fors__qc_8c_source.html">fors_qc.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="fors__qc_8c_source.html#l00425">fors_qc_keyword_to_paf()</a>, and <a class="el" href="fors__qc_8c_source.html#l00235">fors_qc_write_string()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g09e2a2672daa14e29aaa138cb4ca8f03"></a><!-- doxytag: member="fors_qc.c::fors_qc_end_group" ref="g09e2a2672daa14e29aaa138cb4ca8f03" args="(void)" -->
+<a class="anchor" id="ga0e0fb873edd66f0e42a50c229c650fda"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_qc_end_group           </td>
+          <td class="memname">cpl_error_code fors_qc_end_group </td>
           <td>(</td>
-          <td class="paramtype">void </td>
-          <td class="paramname">          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">void </td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
         </tr>
       </table>
+</div><div class="memdoc">
+
+<p>Close current QC1 PAF file. </p>
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
+<p>The current QC1 PAF object is written to disk file. If no PAF object is present, this is an error: <code><a class="el" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group()</a></code> should be called first. If the PAF file is empty, the PAF object is destroyed, but no PAF file is created. </p>
+
+<p>Definition at line <a class="el" href="fors__qc_8c_source.html#l00200">200</a> of file <a class="el" href="fors__qc_8c_source.html">fors_qc.c</a>.</p>
+
+<p>References <a class="el" href="fors__paf_8c_source.html#l00511">deleteForsPAF()</a>, <a class="el" href="fors__paf_8c_source.html#l00594">forsPAFIsEmpty()</a>, and <a class="el" href="fors__paf_8c_source.html#l00834">forsPAFWrite()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, <a class="el" href="fors__qc-test_8c_source.html#l00045">test_qc()</a>, <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="fors__img__screen [...]
+
 </div>
-<div class="memdoc">
-
-<p>
-Close current QC1 PAF file. 
-<p>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
-The current QC1 PAF object is written to disk file. If no PAF object is present, this is an error: <code><a class="el" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group()</a></code> should be called first. If the PAF file is empty, the PAF object is destroyed, but no PAF file is created. 
-<p>
-Definition at line <a class="el" href="fors__qc_8c-source.html#l00200">200</a> of file <a class="el" href="fors__qc_8c-source.html">fors_qc.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00509">deleteForsPAF()</a>, <a class="el" href="fors__paf_8c-source.html#l00587">forsPAFIsEmpty()</a>, <a class="el" href="fors__paf_8c-source.html#l00827">forsPAFWrite()</a>, <a class="el" href="fors__qc_8c-source.html#l00058">pafFile</a>, and <a class="el" href="fors__qc_8c-source.html#l00059">pafIndex</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, <a class="el" href="fors__qc-test_8c-source.html#l00045">test_qc()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, <a class="el" href="vimos__science__impl_8c- [...]
 </div>
-</div><p>
-<a class="anchor" name="gbf9d98b1564188b3aeaf0ea64c60bfb4"></a><!-- doxytag: member="fors_qc.c::fors_qc_write_string" ref="gbf9d98b1564188b3aeaf0ea64c60bfb4" args="(const char *name, const char *value, const char *comment, const char *instrument)" -->
+<a class="anchor" id="ga59a8c8fece17908fd39670a23b15d6f4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_qc_write_string           </td>
+          <td class="memname">cpl_error_code fors_qc_write_string </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>instrument</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>instrument</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Add string parameter to current QC1 group. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Parameter name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Parameter value </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Parameter comment </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>instrument</em> </td><td>Instrument name</td></tr>
+</div><div class="memdoc">
+
+<p>Add string parameter to current QC1 group. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">name</td><td>Parameter name </td></tr>
+    <tr><td class="paramname">value</td><td>Parameter value </td></tr>
+    <tr><td class="paramname">comment</td><td>Parameter comment </td></tr>
+    <tr><td class="paramname">instrument</td><td>Instrument name</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
-To the current QC1 PAF object is appended a string parameter. If no PAF object is present, this is an error: <a class="el" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group()</a> should be called first. 
-<p>
-Definition at line <a class="el" href="fors__qc_8c-source.html#l00235">235</a> of file <a class="el" href="fors__qc_8c-source.html">fors_qc.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00793">forsPAFAppendString()</a>, and <a class="el" href="fors__qc_8c-source.html#l00058">pafFile</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00425">fors_qc_keyword_to_paf()</a>, <a class="el" href="fors__qc_8c-source.html#l00115">fors_qc_write_group_heading()</a>, <a class="el" href="fors__qc_8c-source.html#l00535">fors_qc_write_qc_string()</a>, <a class="el" href="fors__qc-test_8c-source.html#l00045">test_qc()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081"> [...]
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
+<p>To the current QC1 PAF object is appended a string parameter. If no PAF object is present, this is an error: <a class="el" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group()</a> should be called first. </p>
+
+<p>Definition at line <a class="el" href="fors__qc_8c_source.html#l00235">235</a> of file <a class="el" href="fors__qc_8c_source.html">fors_qc.c</a>.</p>
+
+<p>References <a class="el" href="fors__paf_8c_source.html#l00800">forsPAFAppendString()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__qc_8c_source.html#l00425">fors_qc_keyword_to_paf()</a>, <a class="el" href="fors__qc_8c_source.html#l00115">fors_qc_write_group_heading()</a>, <a class="el" href="fors__qc_8c_source.html#l00535">fors_qc_write_qc_string()</a>, <a class="el" href="fors__qc-test_8c_source.html#l00045">test_qc()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g033fc0f2f9e321c4ac98ee7f412b2c6e"></a><!-- doxytag: member="fors_qc.c::fors_qc_write_double" ref="g033fc0f2f9e321c4ac98ee7f412b2c6e" args="(const char *name, double value, const char *unit, const char *comment, const char *instrument)" -->
+</div>
+<a class="anchor" id="ga8355f62ab2783be464130e8de57487b3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_qc_write_double           </td>
+          <td class="memname">cpl_error_code fors_qc_write_double </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>unit</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>unit</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>instrument</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>instrument</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Add double parameter to current QC1 group. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Parameter name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Parameter value </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>unit</em> </td><td>Parameter unit </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Parameter comment; </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>instrument</em> </td><td>Instrument name</td></tr>
+</div><div class="memdoc">
+
+<p>Add double parameter to current QC1 group. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">name</td><td>Parameter name </td></tr>
+    <tr><td class="paramname">value</td><td>Parameter value </td></tr>
+    <tr><td class="paramname">unit</td><td>Parameter unit </td></tr>
+    <tr><td class="paramname">comment</td><td>Parameter comment; </td></tr>
+    <tr><td class="paramname">instrument</td><td>Instrument name</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
-To the current QC1 PAF object is appended a double parameter. The comment string is mandatory. The parameter unit must be specified, unless the specified parameter is adimensional, otherwise a null pointer should be passed. To the comment string the unit string (if present) will be appended, enclosed in round brackets, and then the string "[@em instrument]". If no PAF object is present, this is an error: <a class="el" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_st [...]
-<p>
-Definition at line <a class="el" href="fors__qc_8c-source.html#l00321">321</a> of file <a class="el" href="fors__qc_8c-source.html">fors_qc.c</a>.
-<p>
-References <a class="el" href="fors__paf_8c-source.html#l00757">forsPAFAppendDouble()</a>, and <a class="el" href="fors__qc_8c-source.html#l00058">pafFile</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00425">fors_qc_keyword_to_paf()</a>, <a class="el" href="fors__qc_8c-source.html#l00604">fors_qc_write_qc_double()</a>, and <a class="el" href="fors__qc-test_8c-source.html#l00045">test_qc()</a>.
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
+<p>To the current QC1 PAF object is appended a double parameter. The comment string is mandatory. The parameter unit must be specified, unless the specified parameter is adimensional, otherwise a null pointer should be passed. To the comment string the unit string (if present) will be appended, enclosed in round brackets, and then the string "[@em instrument]". If no PAF object is present, this is an error: <a class="el" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title= [...]
+
+<p>Definition at line <a class="el" href="fors__qc_8c_source.html#l00321">321</a> of file <a class="el" href="fors__qc_8c_source.html">fors_qc.c</a>.</p>
+
+<p>References <a class="el" href="fors__paf_8c_source.html#l00764">forsPAFAppendDouble()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__qc_8c_source.html#l00425">fors_qc_keyword_to_paf()</a>, <a class="el" href="fors__qc_8c_source.html#l00604">fors_qc_write_qc_double()</a>, and <a class="el" href="fors__qc-test_8c_source.html#l00045">test_qc()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g44d5359f81302747fff155c168c88200"></a><!-- doxytag: member="fors_qc.c::fors_qc_keyword_to_paf" ref="g44d5359f81302747fff155c168c88200" args="(cpl_propertylist *header, const char *name, const char *unit, const char *comment, const char *instrument)" -->
+<a class="anchor" id="ga0361cf5642de51ebf8e3412fffe70a56"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_qc_keyword_to_paf           </td>
+          <td class="memname">cpl_error_code fors_qc_keyword_to_paf </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>unit</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>unit</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>instrument</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>instrument</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Copy a keyword value to the currently active QC1 PAF object. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Pointer to a keyword header. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Keyword name. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>unit</em> </td><td>Optional unit to be associated to keyword value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Optional comment to be associated to keyword value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>instrument</em> </td><td>Instrument name</td></tr>
+</div><div class="memdoc">
+
+<p>Copy a keyword value to the currently active QC1 PAF object. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>Pointer to a keyword header. </td></tr>
+    <tr><td class="paramname">name</td><td>Keyword name. </td></tr>
+    <tr><td class="paramname">unit</td><td>Optional unit to be associated to keyword value. </td></tr>
+    <tr><td class="paramname">comment</td><td>Optional comment to be associated to keyword value. </td></tr>
+    <tr><td class="paramname">instrument</td><td>Instrument name</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
-A keyword with the specified name is searched in the <em>header</em>. Its type is determined, then its value is read with the appropriate interface. From the keyword name the corresponding PAF keyword name is derived by removing any "ESO " at keyword name beginning, and replacing blanks with dots (e.g., "ESO TPL ID" becomes "TPL.ID"). Finally, the new PAF keyword, with the same type as the header keyword, is written to the currently active QC1 PAF object. Note that before calling this fu [...]
-<p>
-Definition at line <a class="el" href="fors__qc_8c-source.html#l00425">425</a> of file <a class="el" href="fors__qc_8c-source.html">fors_qc.c</a>.
-<p>
-References <a class="el" href="fors__qc_8c-source.html#l00321">fors_qc_write_double()</a>, <a class="el" href="fors__qc_8c-source.html#l00362">fors_qc_write_int()</a>, and <a class="el" href="fors__qc_8c-source.html#l00235">fors_qc_write_string()</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00115">fors_qc_write_group_heading()</a>, <a class="el" href="fors__qc-test_8c-source.html#l00045">test_qc()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
+<p>A keyword with the specified name is searched in the <em>header</em>. Its type is determined, then its value is read with the appropriate interface. From the keyword name the corresponding PAF keyword name is derived by removing any "ESO " at keyword name beginning, and replacing blanks with dots (e.g., "ESO TPL ID" becomes "TPL.ID"). Finally, the new PAF keyword, with the same type as the header keyword, is written to the currently active QC1 PAF object. Note that before calling this [...]
+
+<p>Definition at line <a class="el" href="fors__qc_8c_source.html#l00425">425</a> of file <a class="el" href="fors__qc_8c_source.html">fors_qc.c</a>.</p>
+
+<p>References <a class="el" href="fors__qc_8c_source.html#l00321">fors_qc_write_double()</a>, and <a class="el" href="fors__qc_8c_source.html#l00235">fors_qc_write_string()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__qc_8c_source.html#l00115">fors_qc_write_group_heading()</a>, <a class="el" href="fors__qc-test_8c_source.html#l00045">test_qc()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="ga4480637fba9623895546614d7a21fb5"></a><!-- doxytag: member="fors_qc.c::fors_qc_write_qc_string" ref="ga4480637fba9623895546614d7a21fb5" args="(cpl_propertylist *header, const char *name, const char *value, const char *comment, const char *instrument)" -->
+</div>
+<a class="anchor" id="ga47dfe71df58ec7c851d4f3853f9f9b00"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_qc_write_qc_string           </td>
+          <td class="memname">cpl_error_code fors_qc_write_qc_string </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>instrument</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>instrument</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Write a string value to the active QC1 PAF object and to a header. 
-<p>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Product header </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>QC1 PAF entry name. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Value to write. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>unit</em> </td><td>Optional unit to be associated to value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Comment to be associated to value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>instrument</em> </td><td>Instrument name</td></tr>
+</div><div class="memdoc">
+
+<p>Write a string value to the active QC1 PAF object and to a header. </p>
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>Product header </td></tr>
+    <tr><td class="paramname">name</td><td>QC1 PAF entry name. </td></tr>
+    <tr><td class="paramname">value</td><td>Value to write. </td></tr>
+    <tr><td class="paramname">unit</td><td>Optional unit to be associated to value. </td></tr>
+    <tr><td class="paramname">comment</td><td>Comment to be associated to value. </td></tr>
+    <tr><td class="paramname">instrument</td><td>Instrument name</td></tr>
   </table>
+  </dd>
 </dl>
-An entry with the specified <em>name</em> is written to the current QC1 PAF object. From the entry <em>name</em>, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to the header. Note that before calling this funtion a QC1 PAF object must be created with a call to <a class="el" href="group__forsqc.html#g0 [...]
-<p>
-Definition at line <a class="el" href="fors__qc_8c-source.html#l00535">535</a> of file <a class="el" href="fors__qc_8c-source.html">fors_qc.c</a>.
-<p>
-References <a class="el" href="fors__qc_8c-source.html#l00235">fors_qc_write_string()</a>, and <a class="el" href="fors__qc_8c-source.html#l00267">fors_qc_write_string_chat()</a>.
-<p>
-Referenced by <a class="el" href="fors__qc_8c-source.html#l00077">fors_qc_start_group()</a>.
+<p>An entry with the specified <em>name</em> is written to the current QC1 PAF object. From the entry <em>name</em>, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to the header. Note that before calling this funtion a QC1 PAF object must be created with a call to <a class="el" href="group__forsqc.html [...]
+
+<p>Definition at line <a class="el" href="fors__qc_8c_source.html#l00535">535</a> of file <a class="el" href="fors__qc_8c_source.html">fors_qc.c</a>.</p>
+
+<p>References <a class="el" href="fors__qc_8c_source.html#l00235">fors_qc_write_string()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__qc_8c_source.html#l00077">fors_qc_start_group()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g11cc764a5c68308a0a85432d5bb30b38"></a><!-- doxytag: member="fors_qc.c::fors_qc_write_qc_double" ref="g11cc764a5c68308a0a85432d5bb30b38" args="(cpl_propertylist *header, double value, const char *name, const char *unit, const char *comment, const char *instrument)" -->
+<a class="anchor" id="ga4df6371ce29055b043f72f0417ecdf0f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code fors_qc_write_qc_double           </td>
+          <td class="memname">cpl_error_code fors_qc_write_qc_double </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>value</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>value</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>name</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>name</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>unit</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>unit</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>comment</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>comment</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>instrument</em></td><td> </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>instrument</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Write an integer value to the active QC1 PAF object and to a header. 
-<p>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>Product header </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Value to write. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>QC1 PAF entry name. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>unit</em> </td><td>Optional unit to be associated to value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>comment</em> </td><td>Comment to be associated to value. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>instrument</em> </td><td>Instrument name</td></tr>
+</div><div class="memdoc">
+
+<p>Write an integer value to the active QC1 PAF object and to a header. </p>
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>Product header </td></tr>
+    <tr><td class="paramname">value</td><td>Value to write. </td></tr>
+    <tr><td class="paramname">name</td><td>QC1 PAF entry name. </td></tr>
+    <tr><td class="paramname">unit</td><td>Optional unit to be associated to value. </td></tr>
+    <tr><td class="paramname">comment</td><td>Comment to be associated to value. </td></tr>
+    <tr><td class="paramname">instrument</td><td>Instrument name</td></tr>
   </table>
+  </dd>
 </dl>
-This function writes the header entries directly to the header of the FITS file written to disk, using the qfits_replace_card() call. An entry with the specified <em>name</em> is written to the current QC1 PAF object. From the entry <em>name</em>, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to the h [...]
-<p>
-Definition at line <a class="el" href="fors__qc_8c-source.html#l00604">604</a> of file <a class="el" href="fors__qc_8c-source.html">fors_qc.c</a>.
-<p>
-References <a class="el" href="fors__qc_8c-source.html#l00321">fors_qc_write_double()</a>.
-<p>
-Referenced by <a class="el" href="fors__img__science__impl_8c-source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c-source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l01876">fors_photometry()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>, and <a class="el" href="fo [...]
+<p>This function writes the header entries directly to the header of the FITS file written to disk, using the qfits_replace_card() call. An entry with the specified <em>name</em> is written to the current QC1 PAF object. From the entry <em>name</em>, the name of the QC keyword that should be written to header is derived prepending the string "ESO " and replacing all '.' with a blank (e.g., "QC.BIAS.MASTER.MEAN" becomes "ESO QC BIAS MASTER MEAN"). Finally, the new keyword is written to th [...]
+
+<p>Definition at line <a class="el" href="fors__qc_8c_source.html#l00604">604</a> of file <a class="el" href="fors__qc_8c_source.html">fors_qc.c</a>.</p>
+
+<p>References <a class="el" href="fors__qc_8c_source.html#l00321">fors_qc_write_double()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__img__science__impl_8c_source.html#l00161">fors_img_science()</a>, <a class="el" href="fors__img__sky__flat__impl_8c_source.html#l00098">fors_img_sky_flat()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l01818">fors_photometry()</a>, <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="fors__img__screen__flat__impl_8c_source.html#l00489">write_qc()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__list__test.html b/html/group__list__test.html
index 7be0eb4..c0f09df 100644
--- a/html/group__list__test.html
+++ b/html/group__list__test.html
@@ -1,43 +1,78 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: List unit test</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>List unit test</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g717300bf68afba988cb2ab66258225e7"></a><!-- doxytag: member="list_test::int_duplicate" ref="g717300bf68afba988cb2ab66258225e7" args="(const int *i)" -->
-static int * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__list__test.html#g717300bf68afba988cb2ab66258225e7">int_duplicate</a> (const int *i)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g79de0fc8abc8c1a7ae11407462febc70"></a><!-- doxytag: member="list_test::int_delete" ref="g79de0fc8abc8c1a7ae11407462febc70" args="(int **i)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__list__test.html#g79de0fc8abc8c1a7ae11407462febc70">int_delete</a> (int **i)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gec0b1222617728d049412a0bad20b7c2"></a><!-- doxytag: member="list_test::int_less_than" ref="gec0b1222617728d049412a0bad20b7c2" args="(const int *i, const int *j, void *data)" -->
-static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__list__test.html#gec0b1222617728d049412a0bad20b7c2">int_less_than</a> (const int *i, const int *j, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2681ca892db4008185b479cf715f8fee"></a><!-- doxytag: member="list_test::int_evaluate" ref="g2681ca892db4008185b479cf715f8fee" args="(const int *i, void *data)" -->
-static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__list__test.html#g2681ca892db4008185b479cf715f8fee">int_evaluate</a> (const int *i, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5e54209ba6c0f1dcf56028b4e43bfd3b"></a><!-- doxytag: member="list_test::test_list" ref="g5e54209ba6c0f1dcf56028b4e43bfd3b" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__list__test.html#g5e54209ba6c0f1dcf56028b4e43bfd3b">test_list</a> (void)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="list_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__list__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">main <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">List unit test</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga0f396c732804d713483cca7812ec6caf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0f396c732804d713483cca7812ec6caf"></a>
+static int * </td><td class="memItemRight" valign="bottom"><b>int_duplicate</b> (const int *i)</td></tr>
+<tr class="separator:ga0f396c732804d713483cca7812ec6caf"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabfabb64bfcdbd1d4ce160018b20d2da4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gabfabb64bfcdbd1d4ce160018b20d2da4"></a>
+static void </td><td class="memItemRight" valign="bottom"><b>int_delete</b> (int **i)</td></tr>
+<tr class="separator:gabfabb64bfcdbd1d4ce160018b20d2da4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab5525b12fd90be6e9b2e389ab4908edd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab5525b12fd90be6e9b2e389ab4908edd"></a>
+static bool </td><td class="memItemRight" valign="bottom"><b>int_less_than</b> (const int *i, const int *j, void *data)</td></tr>
+<tr class="separator:gab5525b12fd90be6e9b2e389ab4908edd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga41b6ed12528ebb19b15ba0c691dd02eb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga41b6ed12528ebb19b15ba0c691dd02eb"></a>
+static double </td><td class="memItemRight" valign="bottom"><b>int_evaluate</b> (const int *i, void *data)</td></tr>
+<tr class="separator:ga41b6ed12528ebb19b15ba0c691dd02eb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga88f16a899d9e287cf6d84a9ba4754507"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga88f16a899d9e287cf6d84a9ba4754507"></a>
+static void </td><td class="memItemRight" valign="bottom"><b>test_list</b> (void)</td></tr>
+<tr class="separator:ga88f16a899d9e287cf6d84a9ba4754507"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__list__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">main <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__moses.html b/html/group__moses.html
index adb2e46..26abad1 100644
--- a/html/group__moses.html
+++ b/html/group__moses.html
@@ -1,5380 +1,5282 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: MOS data reduction library</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>MOS data reduction library</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g438a2d8f2768c20dde2cfdf609bad6f1"></a><!-- doxytag: member="moses::SEGNO" ref="g438a2d8f2768c20dde2cfdf609bad6f1" args="(a, b)" -->
-#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g438a2d8f2768c20dde2cfdf609bad6f1">SEGNO</a>(a, b)   ((b) >= 0.0 ? fabs(a) : -fabs(a))</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gd6f52daf658d36dcfdd4bddf72153b57">READY</a>   1</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Montecarlo simulation to evaluate error on polynomial fit.  <a href="#gd6f52daf658d36dcfdd4bddf72153b57"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga5a1438d5952d296edd76f7049b06d34"></a><!-- doxytag: member="moses::mos_seed" ref="ga5a1438d5952d296edd76f7049b06d34" args="(void)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga5a1438d5952d296edd76f7049b06d34">mos_seed</a> (void)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g88ec5d9d020d274b54bdce340eef46c6"></a><!-- doxytag: member="moses::mos_randg" ref="g88ec5d9d020d274b54bdce340eef46c6" args="(int seme)" -->
-static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g88ec5d9d020d274b54bdce340eef46c6">mos_randg</a> (int seme)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc69af4e18a5d0018e98bbea88dc4eaac"></a><!-- doxytag: member="moses::mos_image_vertical_median_filter" ref="gc69af4e18a5d0018e98bbea88dc4eaac" args="(cpl_image *ima_in, int filtsizey, int refrow, int above, int below, int step)" -->
-static cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gc69af4e18a5d0018e98bbea88dc4eaac">mos_image_vertical_median_filter</a> (cpl_image *ima_in, int filtsizey, int refrow, int above, int below, int step)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g56f03689ea7eaf37395dbb26a24e3fcf"></a><!-- doxytag: member="moses::peakPosition" ref="g56f03689ea7eaf37395dbb26a24e3fcf" args="(const float *data, int size, float *position, int minPoints)" -->
-static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g56f03689ea7eaf37395dbb26a24e3fcf">peakPosition</a> (const float *data, int size, float *position, int minPoints)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g31da70ff15f996bd4022c26b534c88eb"></a><!-- doxytag: member="moses::values_to_dx" ref="g31da70ff15f996bd4022c26b534c88eb" args="(double v1, double v2, double v3)" -->
-static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g31da70ff15f996bd4022c26b534c88eb">values_to_dx</a> (double v1, double v2, double v3)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g37533cd641acd9d0c7430cb84928c7dd"></a><!-- doxytag: member="moses::min_filter" ref="g37533cd641acd9d0c7430cb84928c7dd" args="(float *buffer, int length, int size)" -->
-static float * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g37533cd641acd9d0c7430cb84928c7dd">min_filter</a> (float *buffer, int length, int size)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g8edb697b1f18f2e19c4811af46ad169a"></a><!-- doxytag: member="moses::max_filter" ref="g8edb697b1f18f2e19c4811af46ad169a" args="(float *buffer, int length, int size)" -->
-static float * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g8edb697b1f18f2e19c4811af46ad169a">max_filter</a> (float *buffer, int length, int size)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g243ac41000f8b1965fadac747928ad05"></a><!-- doxytag: member="moses::smo_filter" ref="g243ac41000f8b1965fadac747928ad05" args="(float *buffer, int length, int size)" -->
-static float * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g243ac41000f8b1965fadac747928ad05">smo_filter</a> (float *buffer, int length, int size)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g61786d7677a2b8dfbde091ae4dfdb54f"></a><!-- doxytag: member="moses::read_global_distortion" ref="g61786d7677a2b8dfbde091ae4dfdb54f" args="(cpl_table *global, cpl_size row)" -->
-static cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a> (cpl_table *global, cpl_size row)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g3ad10f4436b713a1e3e3296f3fc0e1a0"></a><!-- doxytag: member="moses::write_global_distortion" ref="g3ad10f4436b713a1e3e3296f3fc0e1a0" args="(cpl_table *global, int row, cpl_polynomial *poly)" -->
-static cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g3ad10f4436b713a1e3e3296f3fc0e1a0">write_global_distortion</a> (cpl_table *global, int row, cpl_polynomial *poly)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4b6606e2a44434b722cb25862567e4ff"></a><!-- doxytag: member="moses::robustLinearFit" ref="g4b6606e2a44434b722cb25862567e4ff" args="(cpl_bivector *list, double *a, double *b, double *abdev)" -->
-static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g4b6606e2a44434b722cb25862567e4ff">robustLinearFit</a> (cpl_bivector *<a class="el" href="structlist.html">list</a>, double *a, double *b, double *abdev)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g68b5196b98878f3f3b702d58f1477150"></a><!-- doxytag: member="moses::mos_hough_table" ref="g68b5196b98878f3f3b702d58f1477150" args="(cpl_table *table, const char *x, const char *y)" -->
-cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g68b5196b98878f3f3b702d58f1477150">mos_hough_table</a> (cpl_table *table, const char *x, const char *y)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4e645e1d3c927b1cec138cf857554485"></a><!-- doxytag: member="moses::mos_extraction" ref="g4e645e1d3c927b1cec138cf857554485" args="(cpl_image *sciwin, cpl_image *skywin, cpl_image *extracted, cpl_image *sky, cpl_image *error, int nobjects, int extraction, double ron, double conad, int ncomb)" -->
-static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g4e645e1d3c927b1cec138cf857554485">mos_extraction</a> (cpl_image *sciwin, cpl_image *skywin, cpl_image *extracted, cpl_image *sky, cpl_image *error, int nobjects, int extraction, double <a class="el" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>, double <a class="el" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>, int ncomb)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gdf9210c07ebddae07a3e5e99d88d2f5c">mos_global_distortion</a> (cpl_table *slits, cpl_table *maskslits, cpl_table *ids, cpl_table *crv, double reference)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Determine all global distortions models.  <a href="#gdf9210c07ebddae07a3e5e99d88d2f5c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g39dd696d6572e52031e12b1a53e505c2">mos_build_slit_location</a> (cpl_table *global, cpl_table *maskslits, int ysize)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the slit location table from a global distortions table.  <a href="#g39dd696d6572e52031e12b1a53e505c2"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga010593249434f0bb667af2f2c950951">mos_build_curv_coeff</a> (cpl_table *global, cpl_table *maskslits, cpl_table *slits)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the curvature coefficients table from a global distortions table.  <a href="#ga010593249434f0bb667af2f2c950951"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gc4a3f1981baef15668137f04c04cf710">mos_build_disp_coeff</a> (cpl_table *global, cpl_table *slits)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Build the IDS coefficients table from a global distortions table.  <a href="#gc4a3f1981baef15668137f04c04cf710"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f">mos_subtract_sky</a> (cpl_image *science, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Subtract the sky from the scientific CCD exposure.  <a href="#ga2fbacfe291c17a66ab6a299afc9265f"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff">mos_normalise_flat</a> (cpl_image *flat, cpl_image *spatial, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion, int sradius, int polyorder)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Normalise a flat field exposure.  <a href="#g5df3afdc0936c59274ef96866e7c05ff"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g9c5947c76fc1246f203a1c6ebc6c9569">mos_normalise_longflat</a> (cpl_image *flat, int sradius, int dradius, int polyorder)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Normalise a long slit flat field exposure.  <a href="#g9c5947c76fc1246f203a1c6ebc6c9569"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga06affb6c77aac402204d1065f1de8ea">mos_interpolate_wavecalib_slit</a> (cpl_table *idscoeff, cpl_table *slits, int order, int global)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Interpolate MOS wavelength calibration.  <a href="#ga06affb6c77aac402204d1065f1de8ea"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">mos_interpolate_wavecalib</a> (cpl_table *idscoeff, cpl_image *wavemap, int mode, int degree)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Interpolate LSS wavelength calibration.  <a href="#gd9bee279f3122532986a3bc453e1c6b3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a> (cpl_image *image, cpl_image *bias, cpl_table *overscans)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Subtract the bias from a CCD exposure.  <a href="#g35fbde09e98e8c5b0d615ed02e1c7e90"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g8dd9103f12a5e6275cd03c3f2afee77a">mos_arc_background_1D</a> (float *spectrum, float *back, int length, int msize, int fsize)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Background determination on 1D emission line spectrum (arc).  <a href="#g8dd9103f12a5e6275cd03c3f2afee77a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a">mos_arc_background</a> (cpl_image *image, int msize, int fsize)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Background determination on emission line spectrum (arc).  <a href="#g9695f36efcf36d2ae6d57efaca7c5a7a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533">mos_lines_width</a> (const float *spectrum, int length)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Estimate lines widths (in pixel) in arc lamp spectrum.  <a href="#gb1c72eeff22a3f3df027f76aa50e9533"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_vector * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g417edefcade103f40ba21dd3f9c29af1">mos_peak_candidates</a> (const float *spectrum, int length, float level, float exp_width)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Find positions of peaks candidates.  <a href="#g417edefcade103f40ba21dd3f9c29af1"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_vector * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0">mos_refine_peaks</a> (const float *spectrum, int length, cpl_vector *peaks, int sradius)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Improve (when possible) accuracy of peaks candidates positions.  <a href="#g08d1d066f5fd31a11b6a3e8b3f21fba0"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9ea6e7d7f5eb091c72e010069673d080"></a><!-- doxytag: member="moses::mos_set_multiplex" ref="g9ea6e7d7f5eb091c72e010069673d080" args="(int multiplex)" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g9ea6e7d7f5eb091c72e010069673d080">mos_set_multiplex</a> (int multiplex)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_bivector * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g43123c837803fd95b01ba2870522ebaf">mos_identify_peaks</a> (cpl_vector *peaks, cpl_vector *lines, double min_disp, double max_disp, double tolerance)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Identify peak candidates.  <a href="#g43123c837803fd95b01ba2870522ebaf"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g99c7290af152957144e8c0413355e5dd">mos_eval_dds</a> (cpl_polynomial *ids, double blue, double red, double refwave, double pixel)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Evaluate the wavelength of a pixel position.  <a href="#g99c7290af152957144e8c0413355e5dd"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g0c895cc2e971156231313f7a16eb6212">mos_poly_wav2pix</a> (cpl_bivector *pixwav, int order, double reject, int minlines, int *nlines, double *err)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Fit polynomial relation from wavelengths to pixels.  <a href="#g0c895cc2e971156231313f7a16eb6212"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g2d49af6d6595dda815a2475dd6de449a">mos_poly_pix2wav</a> (cpl_bivector *pixwav, int order, double reject, int minlines, int *nlines, double *err)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Fit polynomial relation from pixels to wavelengths.  <a href="#g2d49af6d6595dda815a2475dd6de449a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_bivector * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g84eceb2b87667085a8215974f0a52446">mos_find_peaks</a> (const float *spectrum, int length, cpl_vector *lines, cpl_polynomial *ids, double refwave, int sradius)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Find the reference lines peaks using a polynomial first-guess.  <a href="#g84eceb2b87667085a8215974f0a52446"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a> (const cpl_image *image, cpl_vector *lines, double dispersion, float level, int sradius, int order, double reject, double refwave, double *wavestart, double *waveend, int *nlines, double *error, cpl_table *idscoeff, cpl_image *calibration, cpl_image *residual [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Derive wavelength calibration from a raw arc lamp or sky exposure.  <a href="#gb996d19c52ec78faa69d1b48127e3e0c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_spectra</a> (cpl_mask *mask)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Find the location of detected spectra on the CCD Find the location of detected spectra on the CCD.  <a href="#g884857a604857727d2fc0d293b678209"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g0a1742caa67a002bee7a30f9d5289672">mos_validate_slits</a> (cpl_table *slits)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Check validity of a slit location table.  <a href="#g0a1742caa67a002bee7a30f9d5289672"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a> (cpl_table *slits, int rotation, int nx, int ny)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Rotate a slit location table.  <a href="#ge119e728dd0161fc46fea905861425c1"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits</a> (cpl_table *slits, cpl_table *maskslits, cpl_table *global)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Identify slits listed in a slit location table.  <a href="#g8c6d40d45c078e8bb32dc97f4bda9f98"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ge3e3fb9252ccdfacccd0e063d293dc1f"></a><!-- doxytag: member="moses::mos_identify_slits_fast" ref="ge3e3fb9252ccdfacccd0e063d293dc1f" args="(cpl_table *slits, cpl_table *maskslits, cpl_table *global)" -->
-cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ge3e3fb9252ccdfacccd0e063d293dc1f">mos_identify_slits_fast</a> (cpl_table *slits, cpl_table *maskslits, cpl_table *global)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g168f6aecd869c24634fa9f6690da0b02">mos_trace_flat</a> (cpl_image *flat, cpl_table *slits, double reference, double blue, double red, double dispersion)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Trace flat field spectra.  <a href="#g168f6aecd869c24634fa9f6690da0b02"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414">mos_poly_trace</a> (cpl_table *slits, cpl_table *traces, int order)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Fit spectral traces.  <a href="#gacdfcf9b570d851cc9935b56f6e86414"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5">mos_global_trace</a> (cpl_table *slits, cpl_table *polytraces, int mode)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Recompute tracing coefficients globally.  <a href="#g7f34d564b07538f21cba7ccddc9738c5"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a> (cpl_image *spectra, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion, int flux, cpl_image *calibration)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Spatial remapping of CCD spectra eliminating the spectral curvature.  <a href="#g97cde563aea50318b61faf6c9355bdbe"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final</a> (cpl_image *image, cpl_table *slits, cpl_vector *lines, double dispersion, float level, int sradius, int order, double reject, double refwave, double *wavestart, double *waveend, int *nlines, double *error, cpl_table *idscoeff, cpl_image *calibration, cpl_i [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Derive wavelength calibration from a rectified arc lamp or sky exposure.  <a href="#gf01eea33659a6250ad14f7f0fecd86c2"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a> (cpl_image *image, double refwave, double firstLambda, double lastLambda, double dispersion, cpl_table *idscoeff, int flux)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Remap at constant wavelength step an image of rectified scientific spectra.  <a href="#gb2cc63c200bab0a922efde3d20192443"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3">mos_wavelength_align</a> (cpl_image *image, cpl_table *slits, double refwave, double firstLambda, double lastLambda, cpl_table *idscoeff, cpl_vector *skylines, int highres, int order, cpl_image *calibration, int sradius)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Modify the input wavelength solution to match reference sky lines.  <a href="#gc4557c40d2f1ff46784fdb61c8ee67e3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g2523d130beaf8538187729f767c38805">mos_wavelength_align_lss</a> (cpl_image *image, double refwave, double firstLambda, double lastLambda, cpl_table *idscoeff, cpl_vector *skylines, int highres, int order, cpl_image *calibration, int sradius)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Modify the input wavelength solution to match reference sky lines (LSS).  <a href="#g2523d130beaf8538187729f767c38805"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a> (cpl_image *rectified, cpl_vector *lines, double wavestart, double dispersion, int radius, int highres)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Estimate the spectral distortion modeling goodness.  <a href="#g8b5755fb4323c36b5aea3b4039e3d987"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1">mos_map_pixel</a> (cpl_table *idscoeff, double reference, double blue, double red, double dispersion, int trend)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a pixel map from an IDS coefficients table.  <a href="#g76e55c10fdcb7d46b17fcea7c2f990a1"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a> (cpl_table *idscoeff, int xsize, double reference, double blue, double red)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a wavelengths map from an IDS coefficients table.  <a href="#g81b72d37c4c9090df07a8dd9a21b36ec"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a> (cpl_image *spatial, cpl_image *calibration, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Remapping of spatially rectified wavelengths to original CCD pixels.  <a href="#g7d8ae7b25a9d34a5af7255835e95ab90"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g2940e2350a3c050fc3bff7af0e621c37">mos_map_spectrum</a> (cpl_image *spectra, cpl_image *wavecalib, cpl_image *spatial, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion, int flux)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Remapping of slit spectra into a grid of lambda-space coordinates.  <a href="#g2940e2350a3c050fc3bff7af0e621c37"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1">mos_sky_map_super</a> (cpl_image *spectra, cpl_image *wavemap, double dispersion, double factor, int minpoints, cpl_image *skymap)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a CCD median sky map.  <a href="#gdc24afa605f14e0bbd66884de984a1f1"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g21b37cf8c1fd568441a55740d34e2371">mos_sky_map</a> (cpl_image *spectra, cpl_image *wavemap, double dispersion, cpl_image *skymap)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a CCD median sky map.  <a href="#g21b37cf8c1fd568441a55740d34e2371"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a">mos_sky_local_old</a> (cpl_image *spectra, cpl_table *slits)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Local determination of sky.  <a href="#gd9e2f1aa21dd9dc492c74052ea0a560a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g7cb83f67ed6d349ade9e38e7ed62f6fb">mos_sky_local</a> (cpl_image *spectra, cpl_table *slits, int order)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Local determination of sky.  <a href="#g7cb83f67ed6d349ade9e38e7ed62f6fb"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a> (cpl_image *image, float gain, float threshold, float ratio)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Remove cosmic rays from sky-subtracted CCD spectral exposure.  <a href="#g274cdc673e0d1684d9a730773a526115"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g9be86f4e59f9ef4d604c0e4f24d41655"></a><!-- doxytag: member="moses::mos_clean_bad_pixels" ref="g9be86f4e59f9ef4d604c0e4f24d41655" args="(cpl_image *image, cpl_table *table, int spectral)" -->
-cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g9be86f4e59f9ef4d604c0e4f24d41655">mos_clean_bad_pixels</a> (cpl_image *image, cpl_table *table, int spectral)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ge8df117eba59d1599f3172975b6f7139">mos_spatial_map</a> (cpl_image *spectra, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create coordinate map from spectral curvature table.  <a href="#ge8df117eba59d1599f3172975b6f7139"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a> (cpl_image *image, cpl_table *slits, int margin, int maxradius, int conradius)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Detect objects in rectified scientific frame.  <a href="#gb188299284e0b06070798cd2e80427af"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">mos_extract_objects</a> (cpl_image *science, cpl_image *sky, cpl_table *objects, int extraction, double <a class="el" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>, double gain, int ncombined)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract detected objects from rectified scientific frame.  <a href="#geecf611c458a0b9645edad66538ad6e2"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g9dab2e2448ef188d7f8fddd02483d919">mos_spectral_resolution</a> (cpl_image *image, double lambda, double startwave, double dispersion, int saturation, double *mfwhm, double *rmsfwhm, double *resolution, double *rmsres, int *nlines)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute mean spectral resolution at a given arc lamp line.  <a href="#g9dab2e2448ef188d7f8fddd02483d919"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55">mos_resolution_table</a> (cpl_image *image, double startwave, double dispersion, int saturation, cpl_vector *lines)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute mean spectral resolution at a given arc lamp line.  <a href="#gb3eb0708cf40541643d8169f3f6d3b55"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g51c4d941feada9601c3e391058f4e653">mos_integrate_signal</a> (cpl_image *image, cpl_image *wavemap, int ystart, int yend, double wstart, double wend)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Integrate signal from wavelength and spatial interval.  <a href="#g51c4d941feada9601c3e391058f4e653"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a> (cpl_propertylist *header)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create slit location table from FITS header of FORS2-MXU data.  <a href="#gc6b743c5c9a5e989abe61ab698df148f"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a> (cpl_propertylist *header, int *nslits_out_det)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create slit location table from FITS header of FORS1/2 MOS data.  <a href="#g1786e7d23b46b135a98deb03986916a4"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g9ed25f68a53a8daa15d3c986e7bdfa48">mos_load_slits_fors_lss</a> (cpl_propertylist *header)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create slit location table from FITS header of FORS1/2 LSS data.  <a href="#g9ed25f68a53a8daa15d3c986e7bdfa48"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g75c3cb900989bb07dad294dd545021a6">mos_get_gain_vimos</a> (cpl_propertylist *header)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Return gain factor for a VIMOS exposure.  <a href="#g75c3cb900989bb07dad294dd545021a6"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g3431a4557418ee0f8cd9beefd7153a98">mos_load_slits_vimos</a> (cpl_propertylist *header)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create slit location table from FITS header of VIMOS data.  <a href="#g3431a4557418ee0f8cd9beefd7153a98"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gf2c5b165c7c2c4be802c03ae59d1b8a9">mos_check_multiplex</a> (cpl_table *slits)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Determining whether a VIMOS mask has spectral multplexing or not.  <a href="#gf2c5b165c7c2c4be802c03ae59d1b8a9"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a> (const cpl_propertylist *header, int check_consistency)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the overscan positions from FITS header of VIMOS data.  <a href="#gde22c6582532e051c045baf0ee969e79"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g83424b665852cb22061bea76a664a730"></a><!-- doxytag: member="moses::mos_load_overscans_fors" ref="g83424b665852cb22061bea76a664a730" args="(const cpl_propertylist *header)" -->
-cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g83424b665852cb22061bea76a664a730">mos_load_overscans_fors</a> (const cpl_propertylist *header)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gbdc12afa2f53713a4151907ed3054dd7"></a><!-- doxytag: member="moses::mos_montecarlo_polyfit" ref="gbdc12afa2f53713a4151907ed3054dd7" args="(cpl_table *points, cpl_table *evaluate, int samples, int order)" -->
-cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gbdc12afa2f53713a4151907ed3054dd7">mos_montecarlo_polyfit</a> (cpl_table *points, cpl_table *evaluate, int samples, int order)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g7557973371ca804e0fab92c40b833f3c">mos_randomise_image</a> (cpl_image *image, double <a class="el" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>, double gain, double bias)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Randomise image.  <a href="#g7557973371ca804e0fab92c40b833f3c"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gaabac93f2fab16b6c268e5ab494a7238">mos_refmask_find_gaps</a> (cpl_mask *refmask, cpl_image *master_flat, double level)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Reconstruct the gaps required for slit location.  <a href="#gaabac93f2fab16b6c268e5ab494a7238"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a> (cpl_image *image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Process saturation.  <a href="#g4d2eac0de6bdead5ccdd45c5ca2ae69a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a> (cpl_image *image)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Subtract the background.  <a href="#g7f9a03e1229af2423d82b5f08e674de8"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g621083edda685c07a318aa94f53bce6f">mos_object_intersect</a> (cpl_table **slitss, cpl_table *origslits, int nscience, float tolerance)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Intersect a number of slit tables.  <a href="#g621083edda685c07a318aa94f53bce6f"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">mos_get_maxobjs_per_slit</a> (cpl_table *slits)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the maximum possible number of objects in a slit.  <a href="#g5a6b95084aacc3fbd59249b53912f048"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g7a41fa707f51ab0d55150ed8c4b19657">mos_get_nobjects</a> (cpl_table *slits)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the total number of objects detected in a slits table.  <a href="#g7a41fa707f51ab0d55150ed8c4b19657"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g5ec455544df7dfc83da8fefc91a9afc7">mos_check_slits</a> (cpl_table *slits, float rescale)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Check that all slit have been detected, insert them if not.  <a href="#g5ec455544df7dfc83da8fefc91a9afc7"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g5bc87e2a7c15dd1686e02e2d65e057f5">mos_load_slits_fors_pmos</a> (cpl_propertylist *header, int *nslits_out_det)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create PMOS slit location table from FITS header of FORS1/2 MOS data.  <a href="#g5bc87e2a7c15dd1686e02e2d65e057f5"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ge887675f0978f93eb562934c909590e7"></a><!-- doxytag: member="moses::fors_get_nobjs_perslit" ref="ge887675f0978f93eb562934c909590e7" args="(cpl_table *slits)" -->
-int * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ge887675f0978f93eb562934c909590e7">fors_get_nobjs_perslit</a> (cpl_table *slits)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gf9aaa80a6918561872a29c545aba5f5d"></a><!-- doxytag: member="moses::fors_get_object_position" ref="gf9aaa80a6918561872a29c545aba5f5d" args="(cpl_table *slits, int slit, int object)" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gf9aaa80a6918561872a29c545aba5f5d">fors_get_object_position</a> (cpl_table *slits, int slit, int object)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc189c00acf90455029854a0517e89549"></a><!-- doxytag: member="moses::mos_rebin_signal" ref="gc189c00acf90455029854a0517e89549" args="(cpl_image **image, int rebin)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gc189c00acf90455029854a0517e89549">mos_rebin_signal</a> (cpl_image **image, int rebin)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc88e237fcb474d9b3fe7d7caed75f0e3"></a><!-- doxytag: member="moses::mos_rebin_error" ref="gc88e237fcb474d9b3fe7d7caed75f0e3" args="(cpl_image **image, int rebin)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gc88e237fcb474d9b3fe7d7caed75f0e3">mos_rebin_error</a> (cpl_image **image, int rebin)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc4e4cf26f6fc9b4800eaa7cd9cc0508e"></a><!-- doxytag: member="moses::map_table" ref="gc4e4cf26f6fc9b4800eaa7cd9cc0508e" args="(cpl_image *image, double start, double step, cpl_table *table, char *xname, char *yname)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a> (cpl_image *image, double start, double step, cpl_table *table, char *xname, char *yname)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g031cdfdaafd4ce3f2374478103a3214a"></a><!-- doxytag: member="moses::polysmooth" ref="g031cdfdaafd4ce3f2374478103a3214a" args="(cpl_image *image, int order, int hw)" -->
-static cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g031cdfdaafd4ce3f2374478103a3214a">polysmooth</a> (cpl_image *image, int order, int hw)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gf3dd5a20a5f31b853c53ca419a8171e3">mos_photometric_calibration</a> (cpl_image *spectra, double startwave, double dispersion, double gain, double exptime, cpl_table *ext_table, double airmass, cpl_table *flux_table, int order)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Produce instrument response curve, with some ancillary information.  <a href="#gf3dd5a20a5f31b853c53ca419a8171e3"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g7bb4d25db0fac83f3d5dfb5e741aaf98"></a><!-- doxytag: member="moses::ksigma_vector" ref="g7bb4d25db0fac83f3d5dfb5e741aaf98" args="(cpl_vector *values, double klow, double khigh, int kiter, int *good)" -->
-static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g7bb4d25db0fac83f3d5dfb5e741aaf98">ksigma_vector</a> (cpl_vector *values, double klow, double khigh, int kiter, int *good)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660">mos_ksigma_stack</a> (cpl_imagelist *imlist, double klow, double khigh, int kiter, cpl_image **good)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Stack images using k-sigma clipping.  <a href="#g8fabeef3808c1cb7e888699cd4f4d660"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gd97e4b6ea81acb77e5ef8567a376482b">mos_apply_photometry</a> (cpl_image *spectra, cpl_table *response, cpl_table *ext_table, double startwave, double dispersion, double gain, double exptime, double airmass)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply response curve to extracted spectra.  <a href="#gd97e4b6ea81acb77e5ef8567a376482b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ge20fadc56d3b4506d4ffd3015f394695">mos_propagate_photometry_error</a> (cpl_image *spectra, cpl_image *errors, cpl_table *response, cpl_table *ext_table, double startwave, double dispersion, double gain, double exptime, double airmass)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Propagate errors from response curve and extracted spectra.  <a href="#ge20fadc56d3b4506d4ffd3015f394695"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gd170543de1ad9f6f2e4f1167e3f4ef4e">mos_check_polarisation</a> (cpl_image *q_image, cpl_image *q_error, cpl_image *u_image, cpl_image *u_error, double startwave, double dispersion, double band, cpl_table *pol_sta, double ra, double dec, char *filter, int *polarisation, double *p_offset, double *p_error, double *a_offset, double *a_error [...]
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Estimate linear polarisation parameters on spectral interval.  <a href="#gd170543de1ad9f6f2e4f1167e3f4ef4e"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ge59e20e2bea761316fa1395d5d406965">mos_compute_offset</a> (cpl_table *reference, cpl_table *objects, double *offset)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Estimate offset between two object tables.  <a href="#ge59e20e2bea761316fa1395d5d406965"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gf708c4804f0aa98415025f2f7ed31f11">mos_image_shift</a> (cpl_image *image, double dx, double dy)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Shift values in an image.  <a href="#gf708c4804f0aa98415025f2f7ed31f11"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gc32b3fba956da20bd20530372b1b28d1">mos_slit_closest_to_center</a> (cpl_table *slits, int nx, int ny)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Return slit closest to CCD center.  <a href="#gc32b3fba956da20bd20530372b1b28d1"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gbff2b46bad7584f819ae28fdd8c85343">mos_extract_flux</a> (cpl_image *image, cpl_table *slits, double xwidth, double ywidth, int dx, double gain, double *o_flux, double *o_err)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Measure flux from spectral interval on CCD.  <a href="#gbff2b46bad7584f819ae28fdd8c85343"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga8abda7d8ad43a4c3287b7b9071f5094">mos_extract_flux_mapped</a> (cpl_image *image, cpl_table *slits, double xwidth, double ywidth, double lambda, double startwave, double dispersion, int dx, double gain, double *o_flux, double *o_err)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Measure flux from spectral interval on remapped frame.  <a href="#ga8abda7d8ad43a4c3287b7b9071f5094"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g8395eca2d64406c969f48220024e999b">mos_median_in_slit</a> (cpl_table *table, cpl_table *slits, int slit, char *label, double *mvalue)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute median from a table column section corresponding to a slit.  <a href="#g8395eca2d64406c969f48220024e999b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g4fe5f2fe3227522421783758228cdc39">mos_image_filter_median</a> (cpl_image *image, int nx, int ny)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function for standard median filtering.  <a href="#g4fe5f2fe3227522421783758228cdc39"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g109d8f4044617368e21a9ffe41816497"></a><!-- doxytag: member="moses::fors_mos_is_lss_like" ref="g109d8f4044617368e21a9ffe41816497" args="(cpl_table *maskslits, int nslits_out_det)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a> (cpl_table *maskslits, int nslits_out_det)</td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">MOS data reduction library</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga70f564e02f4b862b24c1d8d9b02013f7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga70f564e02f4b862b24c1d8d9b02013f7"></a>
+#define </td><td class="memItemRight" valign="bottom"><b>SEGNO</b>(a, b)   ((b) >= 0.0 ? fabs(a) : -fabs(a))</td></tr>
+<tr class="separator:ga70f564e02f4b862b24c1d8d9b02013f7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad1235d5ce36f7267285e82dccd428aa6"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gad1235d5ce36f7267285e82dccd428aa6">READY</a>   1</td></tr>
+<tr class="memdesc:gad1235d5ce36f7267285e82dccd428aa6"><td class="mdescLeft"> </td><td class="mdescRight">Montecarlo simulation to evaluate error on polynomial fit.  <a href="#gad1235d5ce36f7267285e82dccd428aa6">More...</a><br/></td></tr>
+<tr class="separator:gad1235d5ce36f7267285e82dccd428aa6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga12f4708f70422ee14ebc3ec5ca5ce981"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga12f4708f70422ee14ebc3ec5ca5ce981"></a>
+static void </td><td class="memItemRight" valign="bottom"><b>mos_seed</b> (void)</td></tr>
+<tr class="separator:ga12f4708f70422ee14ebc3ec5ca5ce981"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga11793c429e949f8fef308f70b0a815b4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga11793c429e949f8fef308f70b0a815b4"></a>
+static double </td><td class="memItemRight" valign="bottom"><b>mos_randg</b> (int seme)</td></tr>
+<tr class="separator:ga11793c429e949f8fef308f70b0a815b4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa3a51e41cbbb1444cec84c4311821508"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa3a51e41cbbb1444cec84c4311821508"></a>
+static cpl_image * </td><td class="memItemRight" valign="bottom"><b>mos_image_vertical_median_filter</b> (cpl_image *ima_in, int filtsizey, int refrow, int above, int below, int step)</td></tr>
+<tr class="separator:gaa3a51e41cbbb1444cec84c4311821508"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac364320ace1ba81e8b8cc6006984fa38"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac364320ace1ba81e8b8cc6006984fa38"></a>
+static int </td><td class="memItemRight" valign="bottom"><b>peakPosition</b> (const float *data, int size, float *position, int minPoints)</td></tr>
+<tr class="separator:gac364320ace1ba81e8b8cc6006984fa38"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga73b4710964bfb9142f3d7b65f5ebea31"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga73b4710964bfb9142f3d7b65f5ebea31"></a>
+static double </td><td class="memItemRight" valign="bottom"><b>values_to_dx</b> (double v1, double v2, double v3)</td></tr>
+<tr class="separator:ga73b4710964bfb9142f3d7b65f5ebea31"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4a3877b69d2b9447dd06bb0a3d7a218d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4a3877b69d2b9447dd06bb0a3d7a218d"></a>
+static float * </td><td class="memItemRight" valign="bottom"><b>min_filter</b> (float *buffer, int length, int size)</td></tr>
+<tr class="separator:ga4a3877b69d2b9447dd06bb0a3d7a218d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa9c11b7a42af4ca35e1b01e6cd9f8fde"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa9c11b7a42af4ca35e1b01e6cd9f8fde"></a>
+static float * </td><td class="memItemRight" valign="bottom"><b>max_filter</b> (float *buffer, int length, int size)</td></tr>
+<tr class="separator:gaa9c11b7a42af4ca35e1b01e6cd9f8fde"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga61e997c247b271c47fd08ff61a533431"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga61e997c247b271c47fd08ff61a533431"></a>
+static float * </td><td class="memItemRight" valign="bottom"><b>smo_filter</b> (float *buffer, int length, int size)</td></tr>
+<tr class="separator:ga61e997c247b271c47fd08ff61a533431"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa4c998dbbc796d2ed8bfa1268b9445fc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa4c998dbbc796d2ed8bfa1268b9445fc"></a>
+static cpl_polynomial * </td><td class="memItemRight" valign="bottom"><b>read_global_distortion</b> (cpl_table *global, cpl_size row)</td></tr>
+<tr class="separator:gaa4c998dbbc796d2ed8bfa1268b9445fc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga598a249ae0afb47b4c7740180195ec98"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga598a249ae0afb47b4c7740180195ec98"></a>
+static cpl_table * </td><td class="memItemRight" valign="bottom"><b>write_global_distortion</b> (cpl_table *global, int row, cpl_polynomial *poly)</td></tr>
+<tr class="separator:ga598a249ae0afb47b4c7740180195ec98"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac14a40e48e9622b47fe4f2499a57c8c6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac14a40e48e9622b47fe4f2499a57c8c6"></a>
+static int </td><td class="memItemRight" valign="bottom"><b>robustLinearFit</b> (cpl_bivector *<a class="el" href="structlist.html">list</a>, double *a, double *b, double *abdev)</td></tr>
+<tr class="separator:gac14a40e48e9622b47fe4f2499a57c8c6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga54bb23fbd64bd5c8a39942bdf0504801"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga54bb23fbd64bd5c8a39942bdf0504801"></a>
+cpl_table * </td><td class="memItemRight" valign="bottom"><b>mos_hough_table</b> (cpl_table *table, const char *x, const char *y)</td></tr>
+<tr class="separator:ga54bb23fbd64bd5c8a39942bdf0504801"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga786e905bbeeb2ed400fdc91da43f34c0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga786e905bbeeb2ed400fdc91da43f34c0"></a>
+static void </td><td class="memItemRight" valign="bottom"><b>mos_extraction</b> (cpl_image *sciwin, cpl_image *skywin, cpl_image *extracted, cpl_image *sky, cpl_image *error, int nobjects, int extraction, double ron, double conad, int ncomb)</td></tr>
+<tr class="separator:ga786e905bbeeb2ed400fdc91da43f34c0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab847fe615b7510fc2d189e80cf5029b5"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gab847fe615b7510fc2d189e80cf5029b5">mos_global_distortion</a> (cpl_table *slits, cpl_table *maskslits, cpl_table *ids, cpl_table *crv, double reference)</td></tr>
+<tr class="memdesc:gab847fe615b7510fc2d189e80cf5029b5"><td class="mdescLeft"> </td><td class="mdescRight">Determine all global distortions models.  <a href="#gab847fe615b7510fc2d189e80cf5029b5">More...</a><br/></td></tr>
+<tr class="separator:gab847fe615b7510fc2d189e80cf5029b5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad9b2789388ba6564011d832d276b2ae6"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gad9b2789388ba6564011d832d276b2ae6">mos_build_slit_location</a> (cpl_table *global, cpl_table *maskslits, int ysize)</td></tr>
+<tr class="memdesc:gad9b2789388ba6564011d832d276b2ae6"><td class="mdescLeft"> </td><td class="mdescRight">Build the slit location table from a global distortions table.  <a href="#gad9b2789388ba6564011d832d276b2ae6">More...</a><br/></td></tr>
+<tr class="separator:gad9b2789388ba6564011d832d276b2ae6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gacff89218baba1abf3641c083a1125861"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gacff89218baba1abf3641c083a1125861">mos_build_curv_coeff</a> (cpl_table *global, cpl_table *maskslits, cpl_table *slits)</td></tr>
+<tr class="memdesc:gacff89218baba1abf3641c083a1125861"><td class="mdescLeft"> </td><td class="mdescRight">Build the curvature coefficients table from a global distortions table.  <a href="#gacff89218baba1abf3641c083a1125861">More...</a><br/></td></tr>
+<tr class="separator:gacff89218baba1abf3641c083a1125861"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4e4da9890ad8d0229f187b4d7eda17be"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga4e4da9890ad8d0229f187b4d7eda17be">mos_build_disp_coeff</a> (cpl_table *global, cpl_table *slits)</td></tr>
+<tr class="memdesc:ga4e4da9890ad8d0229f187b4d7eda17be"><td class="mdescLeft"> </td><td class="mdescRight">Build the IDS coefficients table from a global distortions table.  <a href="#ga4e4da9890ad8d0229f187b4d7eda17be">More...</a><br/></td></tr>
+<tr class="separator:ga4e4da9890ad8d0229f187b4d7eda17be"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0b6cf7b940f617da9ec3f9ce7a9610e2"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2">mos_subtract_sky</a> (cpl_image *science, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion)</td></tr>
+<tr class="memdesc:ga0b6cf7b940f617da9ec3f9ce7a9610e2"><td class="mdescLeft"> </td><td class="mdescRight">Subtract the sky from the scientific CCD exposure.  <a href="#ga0b6cf7b940f617da9ec3f9ce7a9610e2">More...</a><br/></td></tr>
+<tr class="separator:ga0b6cf7b940f617da9ec3f9ce7a9610e2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6b94ed200f4b1b8e281417a80b9aa4b5"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga6b94ed200f4b1b8e281417a80b9aa4b5">mos_normalise_flat</a> (cpl_image *flat, cpl_image *spatial, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion, int sradius, int polyorder)</td></tr>
+<tr class="memdesc:ga6b94ed200f4b1b8e281417a80b9aa4b5"><td class="mdescLeft"> </td><td class="mdescRight">Normalise a flat field exposure.  <a href="#ga6b94ed200f4b1b8e281417a80b9aa4b5">More...</a><br/></td></tr>
+<tr class="separator:ga6b94ed200f4b1b8e281417a80b9aa4b5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2efbe02c8b5535d746bc9dd9ece30296"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga2efbe02c8b5535d746bc9dd9ece30296">mos_normalise_longflat</a> (cpl_image *flat, int sradius, int dradius, int polyorder)</td></tr>
+<tr class="memdesc:ga2efbe02c8b5535d746bc9dd9ece30296"><td class="mdescLeft"> </td><td class="mdescRight">Normalise a long slit flat field exposure.  <a href="#ga2efbe02c8b5535d746bc9dd9ece30296">More...</a><br/></td></tr>
+<tr class="separator:ga2efbe02c8b5535d746bc9dd9ece30296"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae5258889aa86b437e2531cdad02f4159"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gae5258889aa86b437e2531cdad02f4159">mos_interpolate_wavecalib_slit</a> (cpl_table *idscoeff, cpl_table *slits, int order, int global)</td></tr>
+<tr class="memdesc:gae5258889aa86b437e2531cdad02f4159"><td class="mdescLeft"> </td><td class="mdescRight">Interpolate MOS wavelength calibration.  <a href="#gae5258889aa86b437e2531cdad02f4159">More...</a><br/></td></tr>
+<tr class="separator:gae5258889aa86b437e2531cdad02f4159"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac1680aed5b6d5ebf32f6aa3e74f18ad4"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4">mos_interpolate_wavecalib</a> (cpl_table *idscoeff, cpl_image *wavemap, int mode, int degree)</td></tr>
+<tr class="memdesc:gac1680aed5b6d5ebf32f6aa3e74f18ad4"><td class="mdescLeft"> </td><td class="mdescRight">Interpolate LSS wavelength calibration.  <a href="#gac1680aed5b6d5ebf32f6aa3e74f18ad4">More...</a><br/></td></tr>
+<tr class="separator:gac1680aed5b6d5ebf32f6aa3e74f18ad4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0516bbdd85d665b796da6c362e4aab36"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36">mos_remove_bias</a> (cpl_image *image, cpl_image *bias, cpl_table *overscans)</td></tr>
+<tr class="memdesc:ga0516bbdd85d665b796da6c362e4aab36"><td class="mdescLeft"> </td><td class="mdescRight">Subtract the bias from a CCD exposure.  <a href="#ga0516bbdd85d665b796da6c362e4aab36">More...</a><br/></td></tr>
+<tr class="separator:ga0516bbdd85d665b796da6c362e4aab36"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gafeaa9b762d7da8437fef7f5f579c04ba"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gafeaa9b762d7da8437fef7f5f579c04ba">mos_arc_background_1D</a> (float *spectrum, float *back, int length, int msize, int fsize)</td></tr>
+<tr class="memdesc:gafeaa9b762d7da8437fef7f5f579c04ba"><td class="mdescLeft"> </td><td class="mdescRight">Background determination on 1D emission line spectrum (arc)  <a href="#gafeaa9b762d7da8437fef7f5f579c04ba">More...</a><br/></td></tr>
+<tr class="separator:gafeaa9b762d7da8437fef7f5f579c04ba"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga063b7ef9e5f4fe46ecbcb1b170bc254b"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b">mos_arc_background</a> (cpl_image *image, int msize, int fsize)</td></tr>
+<tr class="memdesc:ga063b7ef9e5f4fe46ecbcb1b170bc254b"><td class="mdescLeft"> </td><td class="mdescRight">Background determination on emission line spectrum (arc)  <a href="#ga063b7ef9e5f4fe46ecbcb1b170bc254b">More...</a><br/></td></tr>
+<tr class="separator:ga063b7ef9e5f4fe46ecbcb1b170bc254b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga28871a4ecc1e2779022f06d4da892360"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga28871a4ecc1e2779022f06d4da892360">mos_lines_width</a> (const float *spectrum, int length)</td></tr>
+<tr class="memdesc:ga28871a4ecc1e2779022f06d4da892360"><td class="mdescLeft"> </td><td class="mdescRight">Estimate lines widths (in pixel) in arc lamp spectrum.  <a href="#ga28871a4ecc1e2779022f06d4da892360">More...</a><br/></td></tr>
+<tr class="separator:ga28871a4ecc1e2779022f06d4da892360"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad80729870e3acf9f61c820f488eb83b2"><td class="memItemLeft" align="right" valign="top">cpl_vector * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gad80729870e3acf9f61c820f488eb83b2">mos_peak_candidates</a> (const float *spectrum, int length, float level, float exp_width)</td></tr>
+<tr class="memdesc:gad80729870e3acf9f61c820f488eb83b2"><td class="mdescLeft"> </td><td class="mdescRight">Find positions of peaks candidates.  <a href="#gad80729870e3acf9f61c820f488eb83b2">More...</a><br/></td></tr>
+<tr class="separator:gad80729870e3acf9f61c820f488eb83b2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gacfa971d995aac0c8f05c37499861d191"><td class="memItemLeft" align="right" valign="top">cpl_vector * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gacfa971d995aac0c8f05c37499861d191">mos_refine_peaks</a> (const float *spectrum, int length, cpl_vector *peaks, int sradius)</td></tr>
+<tr class="memdesc:gacfa971d995aac0c8f05c37499861d191"><td class="mdescLeft"> </td><td class="mdescRight">Improve (when possible) accuracy of peaks candidates positions.  <a href="#gacfa971d995aac0c8f05c37499861d191">More...</a><br/></td></tr>
+<tr class="separator:gacfa971d995aac0c8f05c37499861d191"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4d9a8914b84889d4070ec27e446350b6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4d9a8914b84889d4070ec27e446350b6"></a>
+void </td><td class="memItemRight" valign="bottom"><b>mos_set_multiplex</b> (int multiplex)</td></tr>
+<tr class="separator:ga4d9a8914b84889d4070ec27e446350b6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga68dc8cea89fe90cd1990d82a6945ca97"><td class="memItemLeft" align="right" valign="top">cpl_bivector * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97">mos_identify_peaks</a> (cpl_vector *peaks, cpl_vector *lines, double min_disp, double max_disp, double tolerance)</td></tr>
+<tr class="memdesc:ga68dc8cea89fe90cd1990d82a6945ca97"><td class="mdescLeft"> </td><td class="mdescRight">Identify peak candidates.  <a href="#ga68dc8cea89fe90cd1990d82a6945ca97">More...</a><br/></td></tr>
+<tr class="separator:ga68dc8cea89fe90cd1990d82a6945ca97"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga29da0280a1b9f08c181c491f6df0743a"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a">mos_eval_dds</a> (cpl_polynomial *ids, double blue, double red, double refwave, double pixel)</td></tr>
+<tr class="memdesc:ga29da0280a1b9f08c181c491f6df0743a"><td class="mdescLeft"> </td><td class="mdescRight">Evaluate the wavelength of a pixel position.  <a href="#ga29da0280a1b9f08c181c491f6df0743a">More...</a><br/></td></tr>
+<tr class="separator:ga29da0280a1b9f08c181c491f6df0743a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4d584e69389518aab8d6932e5841d399"><td class="memItemLeft" align="right" valign="top">cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga4d584e69389518aab8d6932e5841d399">mos_poly_wav2pix</a> (cpl_bivector *pixwav, int order, double reject, int minlines, int *nlines, double *err)</td></tr>
+<tr class="memdesc:ga4d584e69389518aab8d6932e5841d399"><td class="mdescLeft"> </td><td class="mdescRight">Fit polynomial relation from wavelengths to pixels.  <a href="#ga4d584e69389518aab8d6932e5841d399">More...</a><br/></td></tr>
+<tr class="separator:ga4d584e69389518aab8d6932e5841d399"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8d5305df3cb184677081fb285cba6eb5"><td class="memItemLeft" align="right" valign="top">cpl_polynomial * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga8d5305df3cb184677081fb285cba6eb5">mos_poly_pix2wav</a> (cpl_bivector *pixwav, int order, double reject, int minlines, int *nlines, double *err)</td></tr>
+<tr class="memdesc:ga8d5305df3cb184677081fb285cba6eb5"><td class="mdescLeft"> </td><td class="mdescRight">Fit polynomial relation from pixels to wavelengths.  <a href="#ga8d5305df3cb184677081fb285cba6eb5">More...</a><br/></td></tr>
+<tr class="separator:ga8d5305df3cb184677081fb285cba6eb5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4ae590c72dce616bcbb426a3c2ec6ffe"><td class="memItemLeft" align="right" valign="top">cpl_bivector * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe">mos_find_peaks</a> (const float *spectrum, int length, cpl_vector *lines, cpl_polynomial *ids, double refwave, int sradius)</td></tr>
+<tr class="memdesc:ga4ae590c72dce616bcbb426a3c2ec6ffe"><td class="mdescLeft"> </td><td class="mdescRight">Find the reference lines peaks using a polynomial first-guess.  <a href="#ga4ae590c72dce616bcbb426a3c2ec6ffe">More...</a><br/></td></tr>
+<tr class="separator:ga4ae590c72dce616bcbb426a3c2ec6ffe"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5587125256b4586cee2d1280d7d7c10d"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d">mos_wavelength_calibration_raw</a> (const cpl_image *image, cpl_vector *lines, double dispersion, float level, int sradius, int order, double reject, double refwave, double *wavestart, double *waveend, int *nlines, double *error, cpl_table *idscoeff [...]
+<tr class="memdesc:ga5587125256b4586cee2d1280d7d7c10d"><td class="mdescLeft"> </td><td class="mdescRight">Derive wavelength calibration from a raw arc lamp or sky exposure.  <a href="#ga5587125256b4586cee2d1280d7d7c10d">More...</a><br/></td></tr>
+<tr class="separator:ga5587125256b4586cee2d1280d7d7c10d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4e3f1760e6a202108d47c9ef977aa900"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900">mos_locate_spectra</a> (cpl_mask *mask)</td></tr>
+<tr class="memdesc:ga4e3f1760e6a202108d47c9ef977aa900"><td class="mdescLeft"> </td><td class="mdescRight">Find the location of detected spectra on the CCD.  <a href="#ga4e3f1760e6a202108d47c9ef977aa900">More...</a><br/></td></tr>
+<tr class="separator:ga4e3f1760e6a202108d47c9ef977aa900"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9133e9d4bebf351c1ef75c903efa3e4d"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d">mos_validate_slits</a> (cpl_table *slits)</td></tr>
+<tr class="memdesc:ga9133e9d4bebf351c1ef75c903efa3e4d"><td class="mdescLeft"> </td><td class="mdescRight">Check validity of a slit location table.  <a href="#ga9133e9d4bebf351c1ef75c903efa3e4d">More...</a><br/></td></tr>
+<tr class="separator:ga9133e9d4bebf351c1ef75c903efa3e4d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9880f7b09371ca6babb8b2aa7c9e094f"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f">mos_rotate_slits</a> (cpl_table *slits, int rotation, int nx, int ny)</td></tr>
+<tr class="memdesc:ga9880f7b09371ca6babb8b2aa7c9e094f"><td class="mdescLeft"> </td><td class="mdescRight">Rotate a slit location table.  <a href="#ga9880f7b09371ca6babb8b2aa7c9e094f">More...</a><br/></td></tr>
+<tr class="separator:ga9880f7b09371ca6babb8b2aa7c9e094f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa8023ee69b6004f39e3df20e9bd94364"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364">mos_identify_slits</a> (cpl_table *slits, cpl_table *maskslits, cpl_table *global)</td></tr>
+<tr class="memdesc:gaa8023ee69b6004f39e3df20e9bd94364"><td class="mdescLeft"> </td><td class="mdescRight">Identify slits listed in a slit location table.  <a href="#gaa8023ee69b6004f39e3df20e9bd94364">More...</a><br/></td></tr>
+<tr class="separator:gaa8023ee69b6004f39e3df20e9bd94364"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4cab3d7c4a4179a3057609caeda165ea"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4cab3d7c4a4179a3057609caeda165ea"></a>
+cpl_table * </td><td class="memItemRight" valign="bottom"><b>mos_identify_slits_fast</b> (cpl_table *slits, cpl_table *maskslits, cpl_table *global)</td></tr>
+<tr class="separator:ga4cab3d7c4a4179a3057609caeda165ea"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaad02c30291fd30d07156ac8f397f439f"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gaad02c30291fd30d07156ac8f397f439f">mos_trace_flat</a> (cpl_image *flat, cpl_table *slits, double reference, double blue, double red, double dispersion)</td></tr>
+<tr class="memdesc:gaad02c30291fd30d07156ac8f397f439f"><td class="mdescLeft"> </td><td class="mdescRight">Trace flat field spectra.  <a href="#gaad02c30291fd30d07156ac8f397f439f">More...</a><br/></td></tr>
+<tr class="separator:gaad02c30291fd30d07156ac8f397f439f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7518d66581d93ab64704fcf90996296b"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga7518d66581d93ab64704fcf90996296b">mos_poly_trace</a> (cpl_table *slits, cpl_table *traces, int order)</td></tr>
+<tr class="memdesc:ga7518d66581d93ab64704fcf90996296b"><td class="mdescLeft"> </td><td class="mdescRight">Fit spectral traces.  <a href="#ga7518d66581d93ab64704fcf90996296b">More...</a><br/></td></tr>
+<tr class="separator:ga7518d66581d93ab64704fcf90996296b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0eda8a5abf396113ffbe66607fd72fe6"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga0eda8a5abf396113ffbe66607fd72fe6">mos_global_trace</a> (cpl_table *slits, cpl_table *polytraces, int mode)</td></tr>
+<tr class="memdesc:ga0eda8a5abf396113ffbe66607fd72fe6"><td class="mdescLeft"> </td><td class="mdescRight">Recompute tracing coefficients globally.  <a href="#ga0eda8a5abf396113ffbe66607fd72fe6">More...</a><br/></td></tr>
+<tr class="separator:ga0eda8a5abf396113ffbe66607fd72fe6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6910eeaa28338a6d447e74130666fe13"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13">mos_spatial_calibration</a> (cpl_image *spectra, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion, int flux, cpl_image *calibration)</td></tr>
+<tr class="memdesc:ga6910eeaa28338a6d447e74130666fe13"><td class="mdescLeft"> </td><td class="mdescRight">Spatial remapping of CCD spectra eliminating the spectral curvature.  <a href="#ga6910eeaa28338a6d447e74130666fe13">More...</a><br/></td></tr>
+<tr class="separator:ga6910eeaa28338a6d447e74130666fe13"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6eece9155581f329c3a779cd62b8f1cb"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb">mos_wavelength_calibration_final</a> (cpl_image *image, cpl_table *slits, cpl_vector *lines, double dispersion, float level, int sradius, int order, double reject, double refwave, double *wavestart, double *waveend, int *nlines, double *error, cpl_t [...]
+<tr class="memdesc:ga6eece9155581f329c3a779cd62b8f1cb"><td class="mdescLeft"> </td><td class="mdescRight">Derive wavelength calibration from a rectified arc lamp or sky exposure.  <a href="#ga6eece9155581f329c3a779cd62b8f1cb">More...</a><br/></td></tr>
+<tr class="separator:ga6eece9155581f329c3a779cd62b8f1cb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5c5f54b99d64a52b9d90d65bf7421b6b"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b">mos_wavelength_calibration</a> (cpl_image *image, double refwave, double firstLambda, double lastLambda, double dispersion, cpl_table *idscoeff, int flux)</td></tr>
+<tr class="memdesc:ga5c5f54b99d64a52b9d90d65bf7421b6b"><td class="mdescLeft"> </td><td class="mdescRight">Remap at constant wavelength step an image of rectified scientific spectra.  <a href="#ga5c5f54b99d64a52b9d90d65bf7421b6b">More...</a><br/></td></tr>
+<tr class="separator:ga5c5f54b99d64a52b9d90d65bf7421b6b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga634eb7408671a139e7015185776f4513"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga634eb7408671a139e7015185776f4513">mos_wavelength_align</a> (cpl_image *image, cpl_table *slits, double refwave, double firstLambda, double lastLambda, cpl_table *idscoeff, cpl_vector *skylines, int highres, int order, cpl_image *calibration, int sradius)</td></tr>
+<tr class="memdesc:ga634eb7408671a139e7015185776f4513"><td class="mdescLeft"> </td><td class="mdescRight">Modify the input wavelength solution to match reference sky lines.  <a href="#ga634eb7408671a139e7015185776f4513">More...</a><br/></td></tr>
+<tr class="separator:ga634eb7408671a139e7015185776f4513"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2a7590eb0c36a08b61e08e180d7277d1"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1">mos_wavelength_align_lss</a> (cpl_image *image, double refwave, double firstLambda, double lastLambda, cpl_table *idscoeff, cpl_vector *skylines, int highres, int order, cpl_image *calibration, int sradius)</td></tr>
+<tr class="memdesc:ga2a7590eb0c36a08b61e08e180d7277d1"><td class="mdescLeft"> </td><td class="mdescRight">Modify the input wavelength solution to match reference sky lines (LSS).  <a href="#ga2a7590eb0c36a08b61e08e180d7277d1">More...</a><br/></td></tr>
+<tr class="separator:ga2a7590eb0c36a08b61e08e180d7277d1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae1dbf0de952775b1619a3c636221e2a2"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2">mos_distortions_rms</a> (cpl_image *rectified, cpl_vector *lines, double wavestart, double dispersion, int radius, int highres)</td></tr>
+<tr class="memdesc:gae1dbf0de952775b1619a3c636221e2a2"><td class="mdescLeft"> </td><td class="mdescRight">Estimate the spectral distortion modeling goodness.  <a href="#gae1dbf0de952775b1619a3c636221e2a2">More...</a><br/></td></tr>
+<tr class="separator:gae1dbf0de952775b1619a3c636221e2a2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6187454ef3812203ba2d50d1e2d01326"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga6187454ef3812203ba2d50d1e2d01326">mos_map_pixel</a> (cpl_table *idscoeff, double reference, double blue, double red, double dispersion, int trend)</td></tr>
+<tr class="memdesc:ga6187454ef3812203ba2d50d1e2d01326"><td class="mdescLeft"> </td><td class="mdescRight">Create a pixel map from an IDS coefficients table.  <a href="#ga6187454ef3812203ba2d50d1e2d01326">More...</a><br/></td></tr>
+<tr class="separator:ga6187454ef3812203ba2d50d1e2d01326"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gacec86a61ea4c2b653a551eb067fbcfb5"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5">mos_map_idscoeff</a> (cpl_table *idscoeff, int xsize, double reference, double blue, double red)</td></tr>
+<tr class="memdesc:gacec86a61ea4c2b653a551eb067fbcfb5"><td class="mdescLeft"> </td><td class="mdescRight">Create a wavelengths map from an IDS coefficients table.  <a href="#gacec86a61ea4c2b653a551eb067fbcfb5">More...</a><br/></td></tr>
+<tr class="separator:gacec86a61ea4c2b653a551eb067fbcfb5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2255ec2a344cd3c6f579179c538669b7"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7">mos_map_wavelengths</a> (cpl_image *spatial, cpl_image *calibration, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion)</td></tr>
+<tr class="memdesc:ga2255ec2a344cd3c6f579179c538669b7"><td class="mdescLeft"> </td><td class="mdescRight">Remapping of spatially rectified wavelengths to original CCD pixels.  <a href="#ga2255ec2a344cd3c6f579179c538669b7">More...</a><br/></td></tr>
+<tr class="separator:ga2255ec2a344cd3c6f579179c538669b7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8525f2b52eb7ba887858420f36c53471"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga8525f2b52eb7ba887858420f36c53471">mos_map_spectrum</a> (cpl_image *spectra, cpl_image *wavecalib, cpl_image *spatial, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion, int flux)</td></tr>
+<tr class="memdesc:ga8525f2b52eb7ba887858420f36c53471"><td class="mdescLeft"> </td><td class="mdescRight">Remapping of slit spectra into a grid of lambda-space coordinates.  <a href="#ga8525f2b52eb7ba887858420f36c53471">More...</a><br/></td></tr>
+<tr class="separator:ga8525f2b52eb7ba887858420f36c53471"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga80b4941dee0d34102ac3d4f5fb15674d"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d">mos_sky_map_super</a> (cpl_image *spectra, cpl_image *wavemap, double dispersion, double factor, int minpoints, cpl_image *skymap)</td></tr>
+<tr class="memdesc:ga80b4941dee0d34102ac3d4f5fb15674d"><td class="mdescLeft"> </td><td class="mdescRight">Create a CCD median sky map.  <a href="#ga80b4941dee0d34102ac3d4f5fb15674d">More...</a><br/></td></tr>
+<tr class="separator:ga80b4941dee0d34102ac3d4f5fb15674d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab724daebffef27587b8183a6d765dc02"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gab724daebffef27587b8183a6d765dc02">mos_sky_map</a> (cpl_image *spectra, cpl_image *wavemap, double dispersion, cpl_image *skymap)</td></tr>
+<tr class="memdesc:gab724daebffef27587b8183a6d765dc02"><td class="mdescLeft"> </td><td class="mdescRight">Create a CCD median sky map.  <a href="#gab724daebffef27587b8183a6d765dc02">More...</a><br/></td></tr>
+<tr class="separator:gab724daebffef27587b8183a6d765dc02"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0185eec52be96d5aa325e8fd045406c8"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8">mos_sky_local_old</a> (cpl_image *spectra, cpl_table *slits)</td></tr>
+<tr class="memdesc:ga0185eec52be96d5aa325e8fd045406c8"><td class="mdescLeft"> </td><td class="mdescRight">Local determination of sky.  <a href="#ga0185eec52be96d5aa325e8fd045406c8">More...</a><br/></td></tr>
+<tr class="separator:ga0185eec52be96d5aa325e8fd045406c8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga40e43aa1516aac5fc7e2ccc41381677d"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga40e43aa1516aac5fc7e2ccc41381677d">mos_sky_local</a> (cpl_image *spectra, cpl_table *slits, int order)</td></tr>
+<tr class="memdesc:ga40e43aa1516aac5fc7e2ccc41381677d"><td class="mdescLeft"> </td><td class="mdescRight">Local determination of sky.  <a href="#ga40e43aa1516aac5fc7e2ccc41381677d">More...</a><br/></td></tr>
+<tr class="separator:ga40e43aa1516aac5fc7e2ccc41381677d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1063de1ae8b4d345ea9ccf584e3a5f1a"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a">mos_clean_cosmics</a> (cpl_image *image, float gain, float threshold, float ratio)</td></tr>
+<tr class="memdesc:ga1063de1ae8b4d345ea9ccf584e3a5f1a"><td class="mdescLeft"> </td><td class="mdescRight">Remove cosmic rays from sky-subtracted CCD spectral exposure.  <a href="#ga1063de1ae8b4d345ea9ccf584e3a5f1a">More...</a><br/></td></tr>
+<tr class="separator:ga1063de1ae8b4d345ea9ccf584e3a5f1a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5dcd6d3de142a64713afbe53d027d5dc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5dcd6d3de142a64713afbe53d027d5dc"></a>
+cpl_error_code </td><td class="memItemRight" valign="bottom"><b>mos_clean_bad_pixels</b> (cpl_image *image, cpl_table *table, int spectral)</td></tr>
+<tr class="separator:ga5dcd6d3de142a64713afbe53d027d5dc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4592493a392e23ebc56259ed3bfc0719"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga4592493a392e23ebc56259ed3bfc0719">mos_spatial_map</a> (cpl_image *spectra, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion)</td></tr>
+<tr class="memdesc:ga4592493a392e23ebc56259ed3bfc0719"><td class="mdescLeft"> </td><td class="mdescRight">Create coordinate map from spectral curvature table.  <a href="#ga4592493a392e23ebc56259ed3bfc0719">More...</a><br/></td></tr>
+<tr class="separator:ga4592493a392e23ebc56259ed3bfc0719"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8615d071f23f2cd00eeebea1062163c7"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7">mos_detect_objects</a> (cpl_image *image, cpl_table *slits, int margin, int maxradius, int conradius)</td></tr>
+<tr class="memdesc:ga8615d071f23f2cd00eeebea1062163c7"><td class="mdescLeft"> </td><td class="mdescRight">Detect objects in rectified scientific frame.  <a href="#ga8615d071f23f2cd00eeebea1062163c7">More...</a><br/></td></tr>
+<tr class="separator:ga8615d071f23f2cd00eeebea1062163c7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga28ce64beccf31d6c0274db1dd4c8b522"><td class="memItemLeft" align="right" valign="top">cpl_image ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522">mos_extract_objects</a> (cpl_image *science, cpl_image *sky, cpl_table *objects, int extraction, double ron, double gain, int ncombined)</td></tr>
+<tr class="memdesc:ga28ce64beccf31d6c0274db1dd4c8b522"><td class="mdescLeft"> </td><td class="mdescRight">Extract detected objects from rectified scientific frame.  <a href="#ga28ce64beccf31d6c0274db1dd4c8b522">More...</a><br/></td></tr>
+<tr class="separator:ga28ce64beccf31d6c0274db1dd4c8b522"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga58039ea48fa183baf1701567781ad128"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga58039ea48fa183baf1701567781ad128">mos_spectral_resolution</a> (cpl_image *image, double lambda, double startwave, double dispersion, int saturation, double *mfwhm, double *rmsfwhm, double *resolution, double *rmsres, int *nlines)</td></tr>
+<tr class="memdesc:ga58039ea48fa183baf1701567781ad128"><td class="mdescLeft"> </td><td class="mdescRight">Compute mean spectral resolution at a given arc lamp line.  <a href="#ga58039ea48fa183baf1701567781ad128">More...</a><br/></td></tr>
+<tr class="separator:ga58039ea48fa183baf1701567781ad128"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae9f633b64e1880984c084a19f53047fc"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gae9f633b64e1880984c084a19f53047fc">mos_resolution_table</a> (cpl_image *image, double startwave, double dispersion, int saturation, cpl_vector *lines)</td></tr>
+<tr class="memdesc:gae9f633b64e1880984c084a19f53047fc"><td class="mdescLeft"> </td><td class="mdescRight">Compute mean spectral resolution at a given arc lamp line.  <a href="#gae9f633b64e1880984c084a19f53047fc">More...</a><br/></td></tr>
+<tr class="separator:gae9f633b64e1880984c084a19f53047fc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaba740d24473d57d687f75787e4ecc835"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gaba740d24473d57d687f75787e4ecc835">mos_integrate_signal</a> (cpl_image *image, cpl_image *wavemap, int ystart, int yend, double wstart, double wend)</td></tr>
+<tr class="memdesc:gaba740d24473d57d687f75787e4ecc835"><td class="mdescLeft"> </td><td class="mdescRight">Integrate signal from wavelength and spatial interval.  <a href="#gaba740d24473d57d687f75787e4ecc835">More...</a><br/></td></tr>
+<tr class="separator:gaba740d24473d57d687f75787e4ecc835"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2c9ae818bb4b07cf99dc5ae8e9e78d9c"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c">mos_load_slits_fors_mxu</a> (cpl_propertylist *header)</td></tr>
+<tr class="memdesc:ga2c9ae818bb4b07cf99dc5ae8e9e78d9c"><td class="mdescLeft"> </td><td class="mdescRight">Create slit location table from FITS header of FORS2-MXU data.  <a href="#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c">More...</a><br/></td></tr>
+<tr class="separator:ga2c9ae818bb4b07cf99dc5ae8e9e78d9c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae0112d43e53bdf0d3ba6d628473e17b8"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8">mos_load_slits_fors_mos</a> (cpl_propertylist *header, int *nslits_out_det)</td></tr>
+<tr class="memdesc:gae0112d43e53bdf0d3ba6d628473e17b8"><td class="mdescLeft"> </td><td class="mdescRight">Create slit location table from FITS header of FORS1/2 MOS data.  <a href="#gae0112d43e53bdf0d3ba6d628473e17b8">More...</a><br/></td></tr>
+<tr class="separator:gae0112d43e53bdf0d3ba6d628473e17b8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga43072c6a57d094a5d7d341934a096e80"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga43072c6a57d094a5d7d341934a096e80">mos_load_slits_fors_lss</a> (cpl_propertylist *header)</td></tr>
+<tr class="memdesc:ga43072c6a57d094a5d7d341934a096e80"><td class="mdescLeft"> </td><td class="mdescRight">Create slit location table from FITS header of FORS1/2 LSS data.  <a href="#ga43072c6a57d094a5d7d341934a096e80">More...</a><br/></td></tr>
+<tr class="separator:ga43072c6a57d094a5d7d341934a096e80"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga74be15e9eea7e1a4f025be22ccb12c54"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga74be15e9eea7e1a4f025be22ccb12c54">mos_get_gain_vimos</a> (cpl_propertylist *header)</td></tr>
+<tr class="memdesc:ga74be15e9eea7e1a4f025be22ccb12c54"><td class="mdescLeft"> </td><td class="mdescRight">Return gain factor for a VIMOS exposure.  <a href="#ga74be15e9eea7e1a4f025be22ccb12c54">More...</a><br/></td></tr>
+<tr class="separator:ga74be15e9eea7e1a4f025be22ccb12c54"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3946bc30280b3b041a20ae9c9326f827"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga3946bc30280b3b041a20ae9c9326f827">mos_load_slits_vimos</a> (cpl_propertylist *header)</td></tr>
+<tr class="memdesc:ga3946bc30280b3b041a20ae9c9326f827"><td class="mdescLeft"> </td><td class="mdescRight">Create slit location table from FITS header of VIMOS data.  <a href="#ga3946bc30280b3b041a20ae9c9326f827">More...</a><br/></td></tr>
+<tr class="separator:ga3946bc30280b3b041a20ae9c9326f827"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga332b9bfd8e704446ad24d9fa448f9df2"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga332b9bfd8e704446ad24d9fa448f9df2">mos_check_multiplex</a> (cpl_table *slits)</td></tr>
+<tr class="memdesc:ga332b9bfd8e704446ad24d9fa448f9df2"><td class="mdescLeft"> </td><td class="mdescRight">Determining whether a VIMOS mask has spectral multplexing or not.  <a href="#ga332b9bfd8e704446ad24d9fa448f9df2">More...</a><br/></td></tr>
+<tr class="separator:ga332b9bfd8e704446ad24d9fa448f9df2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf4872d8e8654dd8733369c071843e464"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464">mos_load_overscans_vimos</a> (const cpl_propertylist *header, int check_consistency)</td></tr>
+<tr class="memdesc:gaf4872d8e8654dd8733369c071843e464"><td class="mdescLeft"> </td><td class="mdescRight">Get the overscan positions from FITS header of VIMOS data.  <a href="#gaf4872d8e8654dd8733369c071843e464">More...</a><br/></td></tr>
+<tr class="separator:gaf4872d8e8654dd8733369c071843e464"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gacb7a9fc2e237995f0f806cdf1ffcdaef"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gacb7a9fc2e237995f0f806cdf1ffcdaef"></a>
+cpl_table * </td><td class="memItemRight" valign="bottom"><b>mos_load_overscans_fors</b> (const cpl_propertylist *header)</td></tr>
+<tr class="separator:gacb7a9fc2e237995f0f806cdf1ffcdaef"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga55bdc661b2948918815f967ea860ffd4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga55bdc661b2948918815f967ea860ffd4"></a>
+cpl_polynomial * </td><td class="memItemRight" valign="bottom"><b>mos_montecarlo_polyfit</b> (cpl_table *points, cpl_table *evaluate, int samples, int order)</td></tr>
+<tr class="separator:ga55bdc661b2948918815f967ea860ffd4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab09208f34d27855a6db2d933ff3d02e2"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2">mos_randomise_image</a> (cpl_image *image, double ron, double gain, double bias)</td></tr>
+<tr class="memdesc:gab09208f34d27855a6db2d933ff3d02e2"><td class="mdescLeft"> </td><td class="mdescRight">Randomise image.  <a href="#gab09208f34d27855a6db2d933ff3d02e2">More...</a><br/></td></tr>
+<tr class="separator:gab09208f34d27855a6db2d933ff3d02e2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae623b8129e3fd33516f32d866c5106a8"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gae623b8129e3fd33516f32d866c5106a8">mos_refmask_find_gaps</a> (cpl_mask *refmask, cpl_image *master_flat, double level)</td></tr>
+<tr class="memdesc:gae623b8129e3fd33516f32d866c5106a8"><td class="mdescLeft"> </td><td class="mdescRight">Reconstruct the gaps required for slit location.  <a href="#gae623b8129e3fd33516f32d866c5106a8">More...</a><br/></td></tr>
+<tr class="separator:gae623b8129e3fd33516f32d866c5106a8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga854ead782f62a6929aade44b267353e0"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga854ead782f62a6929aade44b267353e0">mos_saturation_process</a> (cpl_image *image)</td></tr>
+<tr class="memdesc:ga854ead782f62a6929aade44b267353e0"><td class="mdescLeft"> </td><td class="mdescRight">Process saturation.  <a href="#ga854ead782f62a6929aade44b267353e0">More...</a><br/></td></tr>
+<tr class="separator:ga854ead782f62a6929aade44b267353e0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad122076cab5a9b361c652f5c3321ddf0"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0">mos_subtract_background</a> (cpl_image *image)</td></tr>
+<tr class="memdesc:gad122076cab5a9b361c652f5c3321ddf0"><td class="mdescLeft"> </td><td class="mdescRight">Subtract the background.  <a href="#gad122076cab5a9b361c652f5c3321ddf0">More...</a><br/></td></tr>
+<tr class="separator:gad122076cab5a9b361c652f5c3321ddf0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5f9947ec541f1291f7c9fb20bd081280"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga5f9947ec541f1291f7c9fb20bd081280">mos_object_intersect</a> (cpl_table **slitss, cpl_table *origslits, int nscience, float tolerance)</td></tr>
+<tr class="memdesc:ga5f9947ec541f1291f7c9fb20bd081280"><td class="mdescLeft"> </td><td class="mdescRight">Intersect a number of slit tables.  <a href="#ga5f9947ec541f1291f7c9fb20bd081280">More...</a><br/></td></tr>
+<tr class="separator:ga5f9947ec541f1291f7c9fb20bd081280"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae5fb2a72c41bab0464ad35c161e50cac"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac">mos_get_maxobjs_per_slit</a> (cpl_table *slits)</td></tr>
+<tr class="memdesc:gae5fb2a72c41bab0464ad35c161e50cac"><td class="mdescLeft"> </td><td class="mdescRight">Get the maximum possible number of objects in a slit.  <a href="#gae5fb2a72c41bab0464ad35c161e50cac">More...</a><br/></td></tr>
+<tr class="separator:gae5fb2a72c41bab0464ad35c161e50cac"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf4d5e8a0d6cd0356ab38f0b7be241352"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gaf4d5e8a0d6cd0356ab38f0b7be241352">mos_get_nobjects</a> (cpl_table *slits)</td></tr>
+<tr class="memdesc:gaf4d5e8a0d6cd0356ab38f0b7be241352"><td class="mdescLeft"> </td><td class="mdescRight">Get the total number of objects detected in a slits table.  <a href="#gaf4d5e8a0d6cd0356ab38f0b7be241352">More...</a><br/></td></tr>
+<tr class="separator:gaf4d5e8a0d6cd0356ab38f0b7be241352"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga71e13921907ec2f25478957d35318e7f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga71e13921907ec2f25478957d35318e7f">mos_check_slits</a> (cpl_table *slits, float rescale)</td></tr>
+<tr class="memdesc:ga71e13921907ec2f25478957d35318e7f"><td class="mdescLeft"> </td><td class="mdescRight">Check that all slit have been detected, insert them if not.  <a href="#ga71e13921907ec2f25478957d35318e7f">More...</a><br/></td></tr>
+<tr class="separator:ga71e13921907ec2f25478957d35318e7f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga78aebb1592ccefba83f9b7cbb80a9676"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga78aebb1592ccefba83f9b7cbb80a9676">mos_load_slits_fors_pmos</a> (cpl_propertylist *header, int *nslits_out_det)</td></tr>
+<tr class="memdesc:ga78aebb1592ccefba83f9b7cbb80a9676"><td class="mdescLeft"> </td><td class="mdescRight">Create PMOS slit location table from FITS header of FORS1/2 MOS data.  <a href="#ga78aebb1592ccefba83f9b7cbb80a9676">More...</a><br/></td></tr>
+<tr class="separator:ga78aebb1592ccefba83f9b7cbb80a9676"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaad726bcd0d2380b05332fa6c7f1dea86"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaad726bcd0d2380b05332fa6c7f1dea86"></a>
+int * </td><td class="memItemRight" valign="bottom"><b>fors_get_nobjs_perslit</b> (cpl_table *slits)</td></tr>
+<tr class="separator:gaad726bcd0d2380b05332fa6c7f1dea86"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaffc2175d882864b6377743f89b29749b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaffc2175d882864b6377743f89b29749b"></a>
+double </td><td class="memItemRight" valign="bottom"><b>fors_get_object_position</b> (cpl_table *slits, int slit, int object)</td></tr>
+<tr class="separator:gaffc2175d882864b6377743f89b29749b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga471c3968053462d6d945bc25cf36720e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga471c3968053462d6d945bc25cf36720e"></a>
+int </td><td class="memItemRight" valign="bottom"><b>mos_rebin_signal</b> (cpl_image **image, int rebin)</td></tr>
+<tr class="separator:ga471c3968053462d6d945bc25cf36720e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga942c51bf71113349f9b995494697e1a5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga942c51bf71113349f9b995494697e1a5"></a>
+int </td><td class="memItemRight" valign="bottom"><b>mos_rebin_error</b> (cpl_image **image, int rebin)</td></tr>
+<tr class="separator:ga942c51bf71113349f9b995494697e1a5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga42ceb4d744e2387cc5694c8e2d73bf88"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga42ceb4d744e2387cc5694c8e2d73bf88"></a>
+int </td><td class="memItemRight" valign="bottom"><b>map_table</b> (cpl_image *image, double start, double step, cpl_table *table, char *xname, char *yname)</td></tr>
+<tr class="separator:ga42ceb4d744e2387cc5694c8e2d73bf88"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga009ad02d129fce6b3654988294e47083"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga009ad02d129fce6b3654988294e47083"></a>
+static cpl_image * </td><td class="memItemRight" valign="bottom"><b>polysmooth</b> (cpl_image *image, int order, int hw)</td></tr>
+<tr class="separator:ga009ad02d129fce6b3654988294e47083"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaad62d9ba866b8abafb2da02053584bf2"><td class="memItemLeft" align="right" valign="top">cpl_table * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gaad62d9ba866b8abafb2da02053584bf2">mos_photometric_calibration</a> (cpl_image *spectra, double startwave, double dispersion, double gain, double exptime, cpl_table *ext_table, double airmass, cpl_table *flux_table, int order)</td></tr>
+<tr class="memdesc:gaad62d9ba866b8abafb2da02053584bf2"><td class="mdescLeft"> </td><td class="mdescRight">Produce instrument response curve, with some ancillary information.  <a href="#gaad62d9ba866b8abafb2da02053584bf2">More...</a><br/></td></tr>
+<tr class="separator:gaad62d9ba866b8abafb2da02053584bf2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga99b5e66ad0a35407a2966d42e40836a2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga99b5e66ad0a35407a2966d42e40836a2"></a>
+static double </td><td class="memItemRight" valign="bottom"><b>ksigma_vector</b> (cpl_vector *values, double klow, double khigh, int kiter, int *good)</td></tr>
+<tr class="separator:ga99b5e66ad0a35407a2966d42e40836a2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga663cfcd4584b6a3e63e7593cba926688"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga663cfcd4584b6a3e63e7593cba926688">mos_ksigma_stack</a> (cpl_imagelist *imlist, double klow, double khigh, int kiter, cpl_image **good)</td></tr>
+<tr class="memdesc:ga663cfcd4584b6a3e63e7593cba926688"><td class="mdescLeft"> </td><td class="mdescRight">Stack images using k-sigma clipping.  <a href="#ga663cfcd4584b6a3e63e7593cba926688">More...</a><br/></td></tr>
+<tr class="separator:ga663cfcd4584b6a3e63e7593cba926688"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2244278b632992a44067afcc42530954"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga2244278b632992a44067afcc42530954">mos_apply_photometry</a> (cpl_image *spectra, cpl_table *response, cpl_table *ext_table, double startwave, double dispersion, double gain, double exptime, double airmass)</td></tr>
+<tr class="memdesc:ga2244278b632992a44067afcc42530954"><td class="mdescLeft"> </td><td class="mdescRight">Apply response curve to extracted spectra.  <a href="#ga2244278b632992a44067afcc42530954">More...</a><br/></td></tr>
+<tr class="separator:ga2244278b632992a44067afcc42530954"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae8e4a9d1a1146de7ba72dd148848342d"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gae8e4a9d1a1146de7ba72dd148848342d">mos_propagate_photometry_error</a> (cpl_image *spectra, cpl_image *errors, cpl_table *response, cpl_table *ext_table, double startwave, double dispersion, double gain, double exptime, double airmass)</td></tr>
+<tr class="memdesc:gae8e4a9d1a1146de7ba72dd148848342d"><td class="mdescLeft"> </td><td class="mdescRight">Propagate errors from response curve and extracted spectra.  <a href="#gae8e4a9d1a1146de7ba72dd148848342d">More...</a><br/></td></tr>
+<tr class="separator:gae8e4a9d1a1146de7ba72dd148848342d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae97d35cc8cb29cbb0b43d4fc84e4d34b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gae97d35cc8cb29cbb0b43d4fc84e4d34b">mos_check_polarisation</a> (cpl_image *q_image, cpl_image *q_error, cpl_image *u_image, cpl_image *u_error, double startwave, double dispersion, double band, cpl_table *pol_sta, double ra, double dec, char *filter, int *polarisation, double *p_offset, doubl [...]
+<tr class="memdesc:gae97d35cc8cb29cbb0b43d4fc84e4d34b"><td class="mdescLeft"> </td><td class="mdescRight">Estimate linear polarisation parameters on spectral interval.  <a href="#gae97d35cc8cb29cbb0b43d4fc84e4d34b">More...</a><br/></td></tr>
+<tr class="separator:gae97d35cc8cb29cbb0b43d4fc84e4d34b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac442710556a5013dedd29befac482c9d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gac442710556a5013dedd29befac482c9d">mos_compute_offset</a> (cpl_table *reference, cpl_table *objects, double *offset)</td></tr>
+<tr class="memdesc:gac442710556a5013dedd29befac482c9d"><td class="mdescLeft"> </td><td class="mdescRight">Estimate offset between two object tables.  <a href="#gac442710556a5013dedd29befac482c9d">More...</a><br/></td></tr>
+<tr class="separator:gac442710556a5013dedd29befac482c9d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga82c7c158316d8aba35ffa271b44510c6"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga82c7c158316d8aba35ffa271b44510c6">mos_image_shift</a> (cpl_image *image, double dx, double dy)</td></tr>
+<tr class="memdesc:ga82c7c158316d8aba35ffa271b44510c6"><td class="mdescLeft"> </td><td class="mdescRight">Shift values in an image.  <a href="#ga82c7c158316d8aba35ffa271b44510c6">More...</a><br/></td></tr>
+<tr class="separator:ga82c7c158316d8aba35ffa271b44510c6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae575a9875c5e14d7fcb4d74cac44af31"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31">mos_slit_closest_to_center</a> (cpl_table *slits, int nx, int ny)</td></tr>
+<tr class="memdesc:gae575a9875c5e14d7fcb4d74cac44af31"><td class="mdescLeft"> </td><td class="mdescRight">Return slit closest to CCD center.  <a href="#gae575a9875c5e14d7fcb4d74cac44af31">More...</a><br/></td></tr>
+<tr class="separator:gae575a9875c5e14d7fcb4d74cac44af31"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5291b43599e8dec884137f867fe72bfd"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga5291b43599e8dec884137f867fe72bfd">mos_extract_flux</a> (cpl_image *image, cpl_table *slits, double xwidth, double ywidth, int dx, double gain, double *o_flux, double *o_err)</td></tr>
+<tr class="memdesc:ga5291b43599e8dec884137f867fe72bfd"><td class="mdescLeft"> </td><td class="mdescRight">Measure flux from spectral interval on CCD.  <a href="#ga5291b43599e8dec884137f867fe72bfd">More...</a><br/></td></tr>
+<tr class="separator:ga5291b43599e8dec884137f867fe72bfd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf91a99846ae06aa780b59deced1fa215"><td class="memItemLeft" align="right" valign="top">cpl_error_code </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gaf91a99846ae06aa780b59deced1fa215">mos_extract_flux_mapped</a> (cpl_image *image, cpl_table *slits, double xwidth, double ywidth, double lambda, double startwave, double dispersion, int dx, double gain, double *o_flux, double *o_err)</td></tr>
+<tr class="memdesc:gaf91a99846ae06aa780b59deced1fa215"><td class="mdescLeft"> </td><td class="mdescRight">Measure flux from spectral interval on remapped frame.  <a href="#gaf91a99846ae06aa780b59deced1fa215">More...</a><br/></td></tr>
+<tr class="separator:gaf91a99846ae06aa780b59deced1fa215"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac6224c743943d88920b1e93f7394d009"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#gac6224c743943d88920b1e93f7394d009">mos_median_in_slit</a> (cpl_table *table, cpl_table *slits, int slit, char *label, double *mvalue)</td></tr>
+<tr class="memdesc:gac6224c743943d88920b1e93f7394d009"><td class="mdescLeft"> </td><td class="mdescRight">Compute median from a table column section corresponding to a slit.  <a href="#gac6224c743943d88920b1e93f7394d009">More...</a><br/></td></tr>
+<tr class="separator:gac6224c743943d88920b1e93f7394d009"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1f574f5f45840ea69fa03eb26055a1b1"><td class="memItemLeft" align="right" valign="top">cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__moses.html#ga1f574f5f45840ea69fa03eb26055a1b1">mos_image_filter_median</a> (cpl_image *image, int nx, int ny)</td></tr>
+<tr class="memdesc:ga1f574f5f45840ea69fa03eb26055a1b1"><td class="mdescLeft"> </td><td class="mdescRight">Convenience function for standard median filtering.  <a href="#ga1f574f5f45840ea69fa03eb26055a1b1">More...</a><br/></td></tr>
+<tr class="separator:ga1f574f5f45840ea69fa03eb26055a1b1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9bc8b28c29504fc9005fe9745b18450b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9bc8b28c29504fc9005fe9745b18450b"></a>
+int </td><td class="memItemRight" valign="bottom"><b>fors_mos_is_lss_like</b> (cpl_table *maskslits, int nslits_out_det)</td></tr>
+<tr class="separator:ga9bc8b28c29504fc9005fe9745b18450b"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-The module moses collects low/medium level functions related to MOS data reduction. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="gd6f52daf658d36dcfdd4bddf72153b57"></a><!-- doxytag: member="moses.c::READY" ref="gd6f52daf658d36dcfdd4bddf72153b57" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>The module moses collects low/medium level functions related to MOS data reduction. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="gad1235d5ce36f7267285e82dccd428aa6"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define READY   1          </td>
+          <td class="memname">#define READY   1</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Montecarlo simulation to evaluate error on polynomial fit. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>points</em> </td><td>Table with (x,y) coordinates and uncertainties on y. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>evaluate</em> </td><td>Table with x coordinates where to evaluate model variance. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>samples</em> </td><td>Number of simulations. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>Degree of the fitted polynomial.</td></tr>
+</div><div class="memdoc">
+
+<p>Montecarlo simulation to evaluate error on polynomial fit. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">points</td><td>Table with (x,y) coordinates and uncertainties on y. </td></tr>
+    <tr><td class="paramname">evaluate</td><td>Table with x coordinates where to evaluate model variance. </td></tr>
+    <tr><td class="paramname">samples</td><td>Number of simulations. </td></tr>
+    <tr><td class="paramname">order</td><td>Degree of the fitted polynomial.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Polynomial fit</dd></dl>
-This function evaluates the effects of variations of coordinates on a fitted polynomial model. The <em>points</em> table must contain two columns labeled <em>x</em> and <em>y</em>, and optionally a third column labeled <em>y_err</em>. <em>x</em> is assumed errorless, and <em>y_err</em> must be given at 1-sigma error. All columns must be of type CPL_TYPE_DOUBLE. A first (reference) polynomial fit p(x) is made. If the column <em>y_err</em> was not given, one is created and filled with the  [...]
-y = p(x) + y_err * mos_randg(1)<p>
-where p(x) is the fit on the original points, and <em>x</em> are taken from the <em>points</em> table together with the corresponding <em>y_err</em>. The <em>evaluate</em> table should contain a column labeled <em>x</em>, and is returned with a new column labeled <em>sigma</em>, listing the sigma of the model variation at each of the indicated <em>x</em> coordinates. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l15454">15454</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="moses.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<dl class="section return"><dt>Returns</dt><dd>Polynomial fit</dd></dl>
+<p>This function evaluates the effects of variations of coordinates on a fitted polynomial model. The <em>points</em> table must contain two columns labeled <em>x</em> and <em>y</em>, and optionally a third column labeled <em>y_err</em>. <em>x</em> is assumed errorless, and <em>y_err</em> must be given at 1-sigma error. All columns must be of type CPL_TYPE_DOUBLE. A first (reference) polynomial fit p(x) is made. If the column <em>y_err</em> was not given, one is created and filled with t [...]
+<p>y = p(x) + y_err * mos_randg(1)</p>
+<p>where p(x) is the fit on the original points, and <em>x</em> are taken from the <em>points</em> table together with the corresponding <em>y_err</em>. The <em>evaluate</em> table should contain a column labeled <em>x</em>, and is returned with a new column labeled <em>sigma</em>, listing the sigma of the model variation at each of the indicated <em>x</em> coordinates. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l15676">15676</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> {                                  \
-    cpl_image_delete(spectrum);       \
-    cpl_image_delete(flux);           \
-    cpl_image_delete(efficiency);     \
-    cpl_image_delete(smo_efficiency); \
-    cpl_image_delete(extinction);     \
-    cpl_image_delete(response);       \
-    cpl_image_delete(smo_response);   \
-    cpl_image_delete(physical);       \
-} <span class="keywordflow">while</span> (0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l16951">16951</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-</div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="gdf9210c07ebddae07a3e5e99d88d2f5c"></a><!-- doxytag: member="moses.c::mos_global_distortion" ref="gdf9210c07ebddae07a3e5e99d88d2f5c" args="(cpl_table *slits, cpl_table *maskslits, cpl_table *ids, cpl_table *crv, double reference)" -->
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> {                                  \</div>
+<div class="line">    cpl_image_delete(spectrum);       \</div>
+<div class="line">    cpl_image_delete(flux);           \</div>
+<div class="line">    cpl_image_delete(efficiency);     \</div>
+<div class="line">    cpl_image_delete(smo_efficiency); \</div>
+<div class="line">    cpl_image_delete(extinction);     \</div>
+<div class="line">    cpl_image_delete(response);       \</div>
+<div class="line">    cpl_image_delete(smo_response);   \</div>
+<div class="line">    cpl_image_delete(physical);       \</div>
+<div class="line">} <span class="keywordflow">while</span> (0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="moses_8c_source.html#l17168">17168</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gab847fe615b7510fc2d189e80cf5029b5"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_global_distortion           </td>
+          <td class="memname">cpl_table* mos_global_distortion </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>maskslits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>maskslits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>ids</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>ids</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>crv</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>crv</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reference</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reference</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Determine all global distortions models. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Table with slits positions on CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>maskslits</em> </td><td>Table with slits positions on mask </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ids</em> </td><td>IDS coefficients table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>crv</em> </td><td>Spectral curvature coefficients table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference wavelength</td></tr>
+</div><div class="memdoc">
+
+<p>Determine all global distortions models. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Table with slits positions on CCD </td></tr>
+    <tr><td class="paramname">maskslits</td><td>Table with slits positions on mask </td></tr>
+    <tr><td class="paramname">ids</td><td>IDS coefficients table </td></tr>
+    <tr><td class="paramname">crv</td><td>Spectral curvature coefficients table </td></tr>
+    <tr><td class="paramname">reference</td><td>Reference wavelength</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The global distortions table</dd></dl>
-The <em>ids</em> table refers to the spatially rectified spectra, and therefore it has as many rows as the rectified image. The x coordinate of this image corresponds to the x coordinate on the CCD. From the "position" and "length" columns of the <em>slits</em> table it is possible to select from the <em>ids</em> table the rows belonging to the same slit. For each slit the median value of each coefficient is computed, and associated to the CCD coordinates of the slit of the <em>slits</em [...]
-The <em>crv</em> table lists the values of the curvature polynomial for each end of the detected slits. Such values are associated to the mask coordinates listed in the <em>maskslits</em> table having the same "slit_id". Each coefficient can then be modeled as a function of the mask coordinates by fitting a second order bivariate polynomial.<p>
-All the coefficients of the obtained bivariate polynomial are written to the newly created global distortions table. Conventionally this table consists of 6 columns and 10 rows. Each row corresponds to the modeling of one coefficient of the original polynomial coefficients belonging to the local solutions. The first 6 table rows are a description of the IDS coefficients, up to the fifth polynomial degree; these rows are followed by a row where just the first element is assigned the value [...]
-At least 12 valid slits must be listed in the slits tables. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l01180">1180</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00634">write_global_distortion()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g39dd696d6572e52031e12b1a53e505c2"></a><!-- doxytag: member="moses.c::mos_build_slit_location" ref="g39dd696d6572e52031e12b1a53e505c2" args="(cpl_table *global, cpl_table *maskslits, int ysize)" -->
+<dl class="section return"><dt>Returns</dt><dd>The global distortions table</dd></dl>
+<p>The <em>ids</em> table refers to the spatially rectified spectra, and therefore it has as many rows as the rectified image. The x coordinate of this image corresponds to the x coordinate on the CCD. From the "position" and "length" columns of the <em>slits</em> table it is possible to select from the <em>ids</em> table the rows belonging to the same slit. For each slit the median value of each coefficient is computed, and associated to the CCD coordinates of the slit of the <em>slits< [...]
+<p>The <em>crv</em> table lists the values of the curvature polynomial for each end of the detected slits. Such values are associated to the mask coordinates listed in the <em>maskslits</em> table having the same "slit_id". Each coefficient can then be modeled as a function of the mask coordinates by fitting a second order bivariate polynomial.</p>
+<p>All the coefficients of the obtained bivariate polynomial are written to the newly created global distortions table. Conventionally this table consists of 6 columns and 10 rows. Each row corresponds to the modeling of one coefficient of the original polynomial coefficients belonging to the local solutions. The first 6 table rows are a description of the IDS coefficients, up to the fifth polynomial degree; these rows are followed by a row where just the first element is assigned the va [...]
+<p>At least 12 valid slits must be listed in the slits tables. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l01179">1179</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gad9b2789388ba6564011d832d276b2ae6"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_build_slit_location           </td>
+          <td class="memname">cpl_table* mos_build_slit_location </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>global</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>global</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>maskslits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>maskslits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ysize</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ysize</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Build the slit location table from a global distortions table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>global</em> </td><td>Global distortions table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>maskslits</em> </td><td>Table with slits positions on mask </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ysize</em> </td><td>Y size of the CCD</td></tr>
+</div><div class="memdoc">
+
+<p>Build the slit location table from a global distortions table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">global</td><td>Global distortions table </td></tr>
+    <tr><td class="paramname">maskslits</td><td>Table with slits positions on mask </td></tr>
+    <tr><td class="paramname">ysize</td><td>Y size of the CCD</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Slits location table</dd></dl>
-The output slits location table has the same structure of the output of the function <code><a class="el" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits()</a></code>, i.e. the "position" and "length" columns are still missing (such columns would be added by the <code><a class="el" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration()</a></code> function). The column "slit_id" is obtained from the "slit_id" column of the input < [...]
-               xbottom = poly0(mxbottom, mybottom)
-               ytop    = poly7(mxtop, mytop)
-                       + poly8(mxtop, mytop) * xtop;
-                       + poly9(mxtop, mytop) * xtop^2
-               ybottom = poly7(mxbottom, mybottom)
-                       + poly8(mxbottom, mybottom) * xbottom;
-                       + poly9(mxbottom, mybottom) * xbottom^2
-</pre></div> where polyX is the polynomial obtained from row X of the input global distortions table, and mxtop, mytop, mxbottom, mybottom are the coordinates of the slits ends listed in the input <em>maskslits</em> table. The resulting slits location table is finally sorted according to the descending value of "ytop", ordering the slits from top to bottom of the image starting from the first table row. The slits that are completely outside the CCD are excluded from the table. The argume [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l01544">1544</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00608">read_global_distortion()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="ga010593249434f0bb667af2f2c950951"></a><!-- doxytag: member="moses.c::mos_build_curv_coeff" ref="ga010593249434f0bb667af2f2c950951" args="(cpl_table *global, cpl_table *maskslits, cpl_table *slits)" -->
+<dl class="section return"><dt>Returns</dt><dd>Slits location table</dd></dl>
+<p>The output slits location table has the same structure of the output of the function <code><a class="el" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits()</a></code>, i.e. the "position" and "length" columns are still missing (such columns would be added by the <code><a class="el" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spec [...]
+<div class="fragment"><div class="line">xtop    = poly0(mxtop, mytop)</div>
+<div class="line">xbottom = poly0(mxbottom, mybottom)</div>
+<div class="line">ytop    = poly7(mxtop, mytop)</div>
+<div class="line">        + poly8(mxtop, mytop) * xtop;</div>
+<div class="line">        + poly9(mxtop, mytop) * xtop^2</div>
+<div class="line">ybottom = poly7(mxbottom, mybottom)</div>
+<div class="line">        + poly8(mxbottom, mybottom) * xbottom;</div>
+<div class="line">        + poly9(mxbottom, mybottom) * xbottom^2</div>
+</div><!-- fragment --><p> where polyX is the polynomial obtained from row X of the input global distortions table, and mxtop, mytop, mxbottom, mybottom are the coordinates of the slits ends listed in the input <em>maskslits</em> table. The resulting slits location table is finally sorted according to the descending value of "ytop", ordering the slits from top to bottom of the image starting from the first table row. The slits that are completely outside the CCD are excluded from the tab [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l01543">1543</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gacff89218baba1abf3641c083a1125861"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_build_curv_coeff           </td>
+          <td class="memname">cpl_table* mos_build_curv_coeff </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>global</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>global</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>maskslits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>maskslits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em></td><td> </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Build the curvature coefficients table from a global distortions table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>global</em> </td><td>Global distortions table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>maskslits</em> </td><td>Table with slits positions on mask </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Table with slits positions on CCD</td></tr>
+</div><div class="memdoc">
+
+<p>Build the curvature coefficients table from a global distortions table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">global</td><td>Global distortions table </td></tr>
+    <tr><td class="paramname">maskslits</td><td>Table with slits positions on mask </td></tr>
+    <tr><td class="paramname">slits</td><td>Table with slits positions on CCD</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Curvature coefficients table</dd></dl>
-The output curvature coefficients table has the same structure of the output of the function <code><a class="el" href="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414">mos_poly_trace()</a></code>. The column "slit_id" is obtained from the "slit_id" column of the input <em>maskslits</em> table. The coefficients columns are obtained as <div class="fragment"><pre class="fragment">               c0 = poly7(mx, my)
-               c1 = poly8(mx, my)
-               c2 = poly9(mx, my)
-</pre></div> where polyX is the polynomial obtained from row X of the input global distortions table, and (mx, my) are the coordinates of the slits ends listed in the input <em>maskslits</em> table. The slits that are completely outside the CCD are excluded from the table. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l01691">1691</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00608">read_global_distortion()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gc4a3f1981baef15668137f04c04cf710"></a><!-- doxytag: member="moses.c::mos_build_disp_coeff" ref="gc4a3f1981baef15668137f04c04cf710" args="(cpl_table *global, cpl_table *slits)" -->
+<dl class="section return"><dt>Returns</dt><dd>Curvature coefficients table</dd></dl>
+<p>The output curvature coefficients table has the same structure of the output of the function <code><a class="el" href="group__moses.html#ga7518d66581d93ab64704fcf90996296b" title="Fit spectral traces.">mos_poly_trace()</a></code>. The column "slit_id" is obtained from the "slit_id" column of the input <em>maskslits</em> table. The coefficients columns are obtained as </p>
+<div class="fragment"><div class="line">c0 = poly7(mx, my)</div>
+<div class="line">c1 = poly8(mx, my)</div>
+<div class="line">c2 = poly9(mx, my)</div>
+</div><!-- fragment --><p> where polyX is the polynomial obtained from row X of the input global distortions table, and (mx, my) are the coordinates of the slits ends listed in the input <em>maskslits</em> table. The slits that are completely outside the CCD are excluded from the table. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l01690">1690</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga4e4da9890ad8d0229f187b4d7eda17be"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_build_disp_coeff           </td>
+          <td class="memname">cpl_table* mos_build_disp_coeff </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>global</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>global</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em></td><td> </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Build the IDS coefficients table from a global distortions table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>global</em> </td><td>Global distortions table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Table with slits positions on CCD</td></tr>
+<p>Build the IDS coefficients table from a global distortions table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">global</td><td>Global distortions table </td></tr>
+    <tr><td class="paramname">slits</td><td>Table with slits positions on CCD</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>IDS coefficients table</dd></dl>
-The input <em>slits</em> table should be already processed by the function <code><a class="el" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration()</a></code>, i.e., it should already have the columns "position" and "length". The output IDS coefficients table will have the same structure of the one created by <code><a class="el" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final()</a></code>, but without the "error" [...]
-               c1 = poly1(x, y)
-               c2 = poly2(x, y)
-               c3 = poly3(x, y)
-               c4 = poly4(x, y)
-               c5 = poly5(x, y)
-</pre></div> where polyX is the polynomial obtained from row X of the input global distortions table, and the (xmask, ymask) are the slit coordinate on the mask. The value of poly0(xmask, ymask) is already contained in the input <em>slits</em> table (columns "xtop" and "xbottom"). 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l01846">1846</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00608">read_global_distortion()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="ga2fbacfe291c17a66ab6a299afc9265f"></a><!-- doxytag: member="moses.c::mos_subtract_sky" ref="ga2fbacfe291c17a66ab6a299afc9265f" args="(cpl_image *science, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion)" -->
+<dl class="section return"><dt>Returns</dt><dd>IDS coefficients table</dd></dl>
+<p>The input <em>slits</em> table should be already processed by the function <code><a class="el" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration()</a></code>, i.e., it should already have the columns "position" and "length". The output IDS coefficients table will have the same structure of the one created by <code><a class="el" href="group__moses.html#ga6eece9155581f329c3a779 [...]
+<div class="fragment"><div class="line">c0 = poly0(xmask, ymask)</div>
+<div class="line">c1 = poly1(x, y)</div>
+<div class="line">c2 = poly2(x, y)</div>
+<div class="line">c3 = poly3(x, y)</div>
+<div class="line">c4 = poly4(x, y)</div>
+<div class="line">c5 = poly5(x, y)</div>
+</div><!-- fragment --><p> where polyX is the polynomial obtained from row X of the input global distortions table, and the (xmask, ymask) are the slit coordinate on the mask. The value of poly0(xmask, ymask) is already contained in the input <em>slits</em> table (columns "xtop" and "xbottom"). </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l01845">1845</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga0b6cf7b940f617da9ec3f9ce7a9610e2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_subtract_sky           </td>
+          <td class="memname">cpl_image* mos_subtract_sky </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>science</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>science</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>polytraces</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>polytraces</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reference</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reference</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>blue</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>blue</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>red</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>red</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Subtract the sky from the scientific CCD exposure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>science</em> </td><td>Image containing the CCD scientific spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Table with slits positions </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>polytraces</em> </td><td>Coefficients of spectral curvature polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>Start lambda to process </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>End lambda to process </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Mean spectral dispersion</td></tr>
+</div><div class="memdoc">
+
+<p>Subtract the sky from the scientific CCD exposure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">science</td><td>Image containing the CCD scientific spectra </td></tr>
+    <tr><td class="paramname">slits</td><td>Table with slits positions </td></tr>
+    <tr><td class="paramname">polytraces</td><td>Coefficients of spectral curvature polynomials </td></tr>
+    <tr><td class="paramname">reference</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">blue</td><td>Start lambda to process </td></tr>
+    <tr><td class="paramname">red</td><td>End lambda to process </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Mean spectral dispersion</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The sky subtracted scientific image</dd></dl>
-The input <em>science</em> frame should be already bias subtracted, and should be oriented so that the dispersion direction is horizontal with <em>blue</em> on the left and <em>red</em> on the right. The sky level is determined by robust linear fitting of flux along the spatial direction. The input <em>science</em> image is sky subtracted IN PLACE using the obtained sky map, that is also returned. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l01970">1970</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00682">robustLinearFit()</a>.
-<p>
-Referenced by <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g5df3afdc0936c59274ef96866e7c05ff"></a><!-- doxytag: member="moses.c::mos_normalise_flat" ref="g5df3afdc0936c59274ef96866e7c05ff" args="(cpl_image *flat, cpl_image *spatial, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion, int sradius, int polyorder)" -->
+<dl class="section return"><dt>Returns</dt><dd>The sky subtracted scientific image</dd></dl>
+<p>The input <em>science</em> frame should be already bias subtracted, and should be oriented so that the dispersion direction is horizontal with <em>blue</em> on the left and <em>red</em> on the right. The sky level is determined by robust linear fitting of flux along the spatial direction. The input <em>science</em> image is sky subtracted IN PLACE using the obtained sky map, that is also returned. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l01969">1969</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga6b94ed200f4b1b8e281417a80b9aa4b5"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_normalise_flat           </td>
+          <td class="memname">cpl_image* mos_normalise_flat </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>flat</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>flat</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spatial</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spatial</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>polytraces</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>polytraces</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reference</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reference</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>blue</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>blue</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>red</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>red</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>sradius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>sradius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>polyorder</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>polyorder</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Normalise a flat field exposure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>flat</em> </td><td>Image containing the original flat field spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>spatial</em> </td><td>Spatial calibration image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Table with slits positions </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>polytraces</em> </td><td>Coefficients of spectral curvature polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>Start lambda to process </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>End lambda to process </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Mean spectral dispersion </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sradius</em> </td><td>Radius of smoothing box along the dispersion direction </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>polyorder</em> </td><td>Order of fitting polynomial along the dispersion</td></tr>
+</div><div class="memdoc">
+
+<p>Normalise a flat field exposure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">flat</td><td>Image containing the original flat field spectra </td></tr>
+    <tr><td class="paramname">spatial</td><td>Spatial calibration image </td></tr>
+    <tr><td class="paramname">slits</td><td>Table with slits positions </td></tr>
+    <tr><td class="paramname">polytraces</td><td>Coefficients of spectral curvature polynomials </td></tr>
+    <tr><td class="paramname">reference</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">blue</td><td>Start lambda to process </td></tr>
+    <tr><td class="paramname">red</td><td>End lambda to process </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Mean spectral dispersion </td></tr>
+    <tr><td class="paramname">sradius</td><td>Radius of smoothing box along the dispersion direction </td></tr>
+    <tr><td class="paramname">polyorder</td><td>Order of fitting polynomial along the dispersion</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The smoothed flat field exposure used for normalisation</dd></dl>
-The input <em>flat</em> frame should be already bias subtracted, and should be oriented so that the dispersion direction is horizontal with <em>blue</em> on the left and <em>red</em> on the right. The flat field spectra are spatially rectified, heavily smoothed, and then mapped back on the CCD. The original <em>flat</em> image is divided IN PLACE by its smoothed counterpart, which is also returned. If the polynomial <em>polyorder</em> is set to a negative number the smoothing consists of [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l02291">2291</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l08147">mos_spatial_calibration()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g9c5947c76fc1246f203a1c6ebc6c9569"></a><!-- doxytag: member="moses.c::mos_normalise_longflat" ref="g9c5947c76fc1246f203a1c6ebc6c9569" args="(cpl_image *flat, int sradius, int dradius, int polyorder)" -->
+<dl class="section return"><dt>Returns</dt><dd>The smoothed flat field exposure used for normalisation</dd></dl>
+<p>The input <em>flat</em> frame should be already bias subtracted, and should be oriented so that the dispersion direction is horizontal with <em>blue</em> on the left and <em>red</em> on the right. The flat field spectra are spatially rectified, heavily smoothed, and then mapped back on the CCD. The original <em>flat</em> image is divided IN PLACE by its smoothed counterpart, which is also returned. If the polynomial <em>polyorder</em> is set to a negative number the smoothing consists [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l02290">2290</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l08263">mos_spatial_calibration()</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga2efbe02c8b5535d746bc9dd9ece30296"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_normalise_longflat           </td>
+          <td class="memname">cpl_image* mos_normalise_longflat </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>flat</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>flat</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>sradius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>sradius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>dradius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>dradius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>polyorder</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>polyorder</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Normalise a long slit flat field exposure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>flat</em> </td><td>Image containing the original flat field spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sradius</em> </td><td>Radius of smoothing box along the spatial direction </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dradius</em> </td><td>Radius of smoothing box along the dispersion direction </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>polyorder</em> </td><td>Order of fitting polynomial along the spatial direction</td></tr>
+</div><div class="memdoc">
+
+<p>Normalise a long slit flat field exposure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">flat</td><td>Image containing the original flat field spectra </td></tr>
+    <tr><td class="paramname">sradius</td><td>Radius of smoothing box along the spatial direction </td></tr>
+    <tr><td class="paramname">dradius</td><td>Radius of smoothing box along the dispersion direction </td></tr>
+    <tr><td class="paramname">polyorder</td><td>Order of fitting polynomial along the spatial direction</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The smoothed flat field exposure used for normalisation</dd></dl>
-The input <em>flat</em> frame should be already bias subtracted, and should be oriented so that the dispersion direction is horizontal with <em>blue</em> on the left and <em>red</em> on the right. The original <em>flat</em> image is divided IN PLACE by its smoothed counterpart, which is also returned. If the polynomial <em>polyorder</em> is set to a negative number the smoothing consists of a median filtering box of specified sizes. Alternatively, if <em>polyorder</em> is not negative, t [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l02742">2742</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
+<dl class="section return"><dt>Returns</dt><dd>The smoothed flat field exposure used for normalisation</dd></dl>
+<p>The input <em>flat</em> frame should be already bias subtracted, and should be oriented so that the dispersion direction is horizontal with <em>blue</em> on the left and <em>red</em> on the right. The original <em>flat</em> image is divided IN PLACE by its smoothed counterpart, which is also returned. If the polynomial <em>polyorder</em> is set to a negative number the smoothing consists of a median filtering box of specified sizes. Alternatively, if <em>polyorder</em> is not negative [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l02741">2741</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="ga06affb6c77aac402204d1065f1de8ea"></a><!-- doxytag: member="moses.c::mos_interpolate_wavecalib_slit" ref="ga06affb6c77aac402204d1065f1de8ea" args="(cpl_table *idscoeff, cpl_table *slits, int order, int global)" -->
+</div>
+<a class="anchor" id="gae5258889aa86b437e2531cdad02f4159"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_interpolate_wavecalib_slit           </td>
+          <td class="memname">cpl_error_code mos_interpolate_wavecalib_slit </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>idscoeff</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>idscoeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>order</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>order</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>global</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>global</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Interpolate MOS wavelength calibration. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>idscoeff</em> </td><td>Table with IDS polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Table with slits positions </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>0 = median, > 0 order of fitting polynomial.</td></tr>
+</div><div class="memdoc">
+
+<p>Interpolate MOS wavelength calibration. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">idscoeff</td><td>Table with IDS polynomials </td></tr>
+    <tr><td class="paramname">slits</td><td>Table with slits positions </td></tr>
+    <tr><td class="paramname">order</td><td>0 = median, > 0 order of fitting polynomial.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success.</dd></dl>
-This function is used on MOS data, to interpolate the wavelength calibration obtained with the function <code><a class="el" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final()</a></code> also in those image rows where the calibration failed. The input <em>idscoeff</em> table is reprocessed and modified in-place according to what indicated by the <em>mode</em> argument. The <em>idscoeff</em> table coefficients are modeled by low degree polynomials [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l02933">2933</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l03062">mos_interpolate_wavecalib()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gd9bee279f3122532986a3bc453e1c6b3"></a><!-- doxytag: member="moses.c::mos_interpolate_wavecalib" ref="gd9bee279f3122532986a3bc453e1c6b3" args="(cpl_table *idscoeff, cpl_image *wavemap, int mode, int degree)" -->
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success.</dd></dl>
+<p>This function is used on MOS data, to interpolate the wavelength calibration obtained with the function <code><a class="el" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb" title="Derive wavelength calibration from a rectified arc lamp or sky exposure.">mos_wavelength_calibration_final()</a></code> also in those image rows where the calibration failed. The input <em>idscoeff</em> table is reprocessed and modified in-place according to what indicated by the <em>mode</em> arg [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l02932">2932</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l03061">mos_interpolate_wavecalib()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gac1680aed5b6d5ebf32f6aa3e74f18ad4"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_interpolate_wavecalib           </td>
+          <td class="memname">cpl_error_code mos_interpolate_wavecalib </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>idscoeff</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>idscoeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>wavemap</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>wavemap</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>mode</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>mode</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>degree</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>degree</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Interpolate LSS wavelength calibration. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>idscoeff</em> </td><td>Table with IDS polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wavemap</em> </td><td>Wavelength calibration image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>0 = do nothing, 1 = fill gaps, 2 = global model </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>degree</em> </td><td>0 = median, > 0 order of fitting polynomial.</td></tr>
+</div><div class="memdoc">
+
+<p>Interpolate LSS wavelength calibration. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">idscoeff</td><td>Table with IDS polynomials </td></tr>
+    <tr><td class="paramname">wavemap</td><td>Wavelength calibration image </td></tr>
+    <tr><td class="paramname">mode</td><td>0 = do nothing, 1 = fill gaps, 2 = global model </td></tr>
+    <tr><td class="paramname">degree</td><td>0 = median, > 0 order of fitting polynomial.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success.</dd></dl>
-This function is used on LSS data, to interpolate the wavelength calibration obtained with the function <code><a class="el" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw()</a></code> also in those image rows where the calibration failed. The input <em>idscoeff</em> table and <em>wavemap</em> image are reprocessed and modified in-place according to what indicated by the <em>mode</em> argument. The <em>idscoeff</em> table coefficients and the wav [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l03062">3062</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00682">robustLinearFit()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l02933">mos_interpolate_wavecalib_slit()</a>, <a class="el" href="moses_8c-source.html#l08546">mos_wavelength_calibration_final()</a>, and <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g35fbde09e98e8c5b0d615ed02e1c7e90"></a><!-- doxytag: member="moses.c::mos_remove_bias" ref="g35fbde09e98e8c5b0d615ed02e1c7e90" args="(cpl_image *image, cpl_image *bias, cpl_table *overscans)" -->
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success.</dd></dl>
+<p>This function is used on LSS data, to interpolate the wavelength calibration obtained with the function <code><a class="el" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw()</a></code> also in those image rows where the calibration failed. The input <em>idscoeff</em> table and <em>wavemap</em> image are reprocessed and modified in-place according to what indicated by t [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l03061">3061</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l02932">mos_interpolate_wavecalib_slit()</a>, <a class="el" href="moses_8c_source.html#l08668">mos_wavelength_calibration_final()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga0516bbdd85d665b796da6c362e4aab36"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_remove_bias           </td>
+          <td class="memname">cpl_image* mos_remove_bias </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>bias</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>bias</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>overscans</em></td><td> </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>overscans</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Subtract the bias from a CCD exposure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image containing the data to correct </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>bias</em> </td><td>Master bias </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>overscans</em> </td><td>Table with the overscan information</td></tr>
+</div><div class="memdoc">
+
+<p>Subtract the bias from a CCD exposure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image containing the data to correct </td></tr>
+    <tr><td class="paramname">bias</td><td>Master bias </td></tr>
+    <tr><td class="paramname">overscans</td><td>Table with the overscan information</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>A newly allocated bias subtracted image</dd></dl>
-If the master <em>bias</em> has the same sizes of the input <em>image</em> it is simply subtracted from the <em>image</em>. If it has different sizes, they should be compatible with the description in the <em>overscans</em> table produced by one of the functions <em>mos_load_overscans_<instrument>()</em>. In this case the mean level of the master bias is compared with the mean level of the overscan regions of the input image. The master <em>bias</em> and the difference of mean leve [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l03421">3421</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g8dd9103f12a5e6275cd03c3f2afee77a"></a><!-- doxytag: member="moses.c::mos_arc_background_1D" ref="g8dd9103f12a5e6275cd03c3f2afee77a" args="(float *spectrum, float *back, int length, int msize, int fsize)" -->
+<dl class="section return"><dt>Returns</dt><dd>A newly allocated bias subtracted image</dd></dl>
+<p>If the master <em>bias</em> has the same sizes of the input <em>image</em> it is simply subtracted from the <em>image</em>. If it has different sizes, they should be compatible with the description in the <em>overscans</em> table produced by one of the functions <em>mos_load_overscans_<instrument>()</em>. In this case the mean level of the master bias is compared with the mean level of the overscan regions of the input image. The master <em>bias</em> and the difference of mean l [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l03420">3420</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gafeaa9b762d7da8437fef7f5f579c04ba"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_arc_background_1D           </td>
+          <td class="memname">cpl_error_code mos_arc_background_1D </td>
           <td>(</td>
-          <td class="paramtype">float * </td>
-          <td class="paramname"> <em>spectrum</em>, </td>
+          <td class="paramtype">float * </td>
+          <td class="paramname"><em>spectrum</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">float * </td>
-          <td class="paramname"> <em>back</em>, </td>
+          <td class="paramtype">float * </td>
+          <td class="paramname"><em>back</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>length</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>length</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>msize</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>msize</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>fsize</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>fsize</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Background determination on 1D emission line spectrum (arc). 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectrum</em> </td><td>A 1D emission line spectrum </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>back</em> </td><td>A pre-allocated buffer where the background will be written </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>length</em> </td><td>Length of spectrum </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>msize</em> </td><td>Size of min-filter </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fsize</em> </td><td>Size of running-average-filter</td></tr>
+</div><div class="memdoc">
+
+<p>Background determination on 1D emission line spectrum (arc) </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectrum</td><td>A 1D emission line spectrum </td></tr>
+    <tr><td class="paramname">back</td><td>A pre-allocated buffer where the background will be written </td></tr>
+    <tr><td class="paramname">length</td><td>Length of spectrum </td></tr>
+    <tr><td class="paramname">msize</td><td>Size of min-filter </td></tr>
+    <tr><td class="paramname">fsize</td><td>Size of running-average-filter</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE in case of success</dd></dl>
-<table class="ec" align="center" border="1" cellspacing="3" cellpadding="3">
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE in case of success</dd></dl>
+<table  class="ec" align="center">
 <tr>
 <td class="ecl">CPL_ERROR_NULL_INPUT </td><td class="ecr">The input spectrum is a <code>NULL</code> pointer.   </td></tr>
 <tr>
 <td class="ecl">CPL_ERROR_ILLEGAL_INPUT </td><td class="ecr">Either <em>msize</em> is less than 3, or <em>fsize</em> is less than <em>msize</em>, or <em>fsize</em> is greater than <em>length/2</em>.   </td></tr>
 </table>
-<p>
-This function fills the array <em>back</em> with the estimated values of the background along the input spectrum. The algorithm is based on the assumption that there is at least one background value at any position of the min-filter box running along the spectrum. A min-filter is passed on the spectrum, and the result is smoothed by averaging on a running box of size <em>fsize</em>. The min-filter is run between the positions <em>msize</em> / 2 and <em>length</em> - <em>msize</em> / 2, a [...]
-It is required that the <em>back</em> array is at least long as the array <em>spectrum</em>. Moreover <em>msize</em> must be greater than 1, and <em>fsize</em> greater than, or equal to, <em>msize</em>. Likewise, <em>length</em> must be greater than twice <em>fsize</em>. If such conditions are not met, or if the input arrays are <code>NULL</code> pointers, this function will set an error code, and leave the <em>back</em> array untouched. If either <em>msize</em> or <em>fsize</em> are eve [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l03593">3593</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="fors__image_8c-source.html#l00092">max_filter()</a>, <a class="el" href="moses_8c-source.html#l00500">min_filter()</a>, and <a class="el" href="moses_8c-source.html#l00564">smo_filter()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l03695">mos_arc_background()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g9695f36efcf36d2ae6d57efaca7c5a7a"></a><!-- doxytag: member="moses.c::mos_arc_background" ref="g9695f36efcf36d2ae6d57efaca7c5a7a" args="(cpl_image *image, int msize, int fsize)" -->
+<p>This function fills the array <em>back</em> with the estimated values of the background along the input spectrum. The algorithm is based on the assumption that there is at least one background value at any position of the min-filter box running along the spectrum. A min-filter is passed on the spectrum, and the result is smoothed by averaging on a running box of size <em>fsize</em>. The min-filter is run between the positions <em>msize</em> / 2 and <em>length</em> - <em>msize</em> / 2 [...]
+<p>It is required that the <em>back</em> array is at least long as the array <em>spectrum</em>. Moreover <em>msize</em> must be greater than 1, and <em>fsize</em> greater than, or equal to, <em>msize</em>. Likewise, <em>length</em> must be greater than twice <em>fsize</em>. If such conditions are not met, or if the input arrays are <code>NULL</code> pointers, this function will set an error code, and leave the <em>back</em> array untouched. If either <em>msize</em> or <em>fsize</em> are  [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l03593">3593</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l03695">mos_arc_background()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga063b7ef9e5f4fe46ecbcb1b170bc254b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_arc_background           </td>
+          <td class="memname">cpl_image* mos_arc_background </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>msize</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>msize</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>fsize</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>fsize</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Background determination on emission line spectrum (arc). 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>An emission line spectrum exposure </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>msize</em> </td><td>Size of min-filter </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>fsize</em> </td><td>Size of running-average-filter</td></tr>
+</div><div class="memdoc">
+
+<p>Background determination on emission line spectrum (arc) </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>An emission line spectrum exposure </td></tr>
+    <tr><td class="paramname">msize</td><td>Size of min-filter </td></tr>
+    <tr><td class="paramname">fsize</td><td>Size of running-average-filter</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Background image.</dd></dl>
-<table class="ec" align="center" border="1" cellspacing="3" cellpadding="3">
+<dl class="section return"><dt>Returns</dt><dd>Background image.</dd></dl>
+<table  class="ec" align="center">
 <tr>
 <td class="ecl">CPL_ERROR_NULL_INPUT </td><td class="ecr">The input image is a <code>NULL</code> pointer.   </td></tr>
 <tr>
 <td class="ecl">CPL_ERROR_ILLEGAL_INPUT </td><td class="ecr">Either <em>msize</em> is less than 3, or <em>fsize</em> is less than <em>msize</em>, or <em>fsize</em> is greater than half the input image size in the X direction.   </td></tr>
 </table>
-<p>
-The input <em>image</em> is assumed to be of type <code>float</code> and to contain MOS arc lamp line spectra dispersed (roughly) along the X direction. The background is estimated independently for each image row. The algorithm is based on the assumption that there is at least one background value at any position of the 1D-min-filter box running along the image row. A min-filter is passed along the row, and the result is smoothed by averaging on a running box of size <em>fsize</em>. The [...]
-It is required that <em>msize</em> is greater than 1, and <em>fsize</em> greater than, or equal to, <em>msize</em>. Likewise, the image size along the X direction must be greater than <em>fsize</em> / 2. If such conditions are not met, or if the input image is a <code>NULL</code> pointer, this function will set an error code and return a <code>NULL</code> pointer. If either <em>msize</em> or <em>fsize</em> are even numbers, they are made odd by adding 1. Suggested values for <em>msize</e [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l03695">3695</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l03593">mos_arc_background_1D()</a>, and <a class="el" href="moses_8c-source.html#l18731">mos_image_filter_median()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l15857">mos_subtract_background()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gb1c72eeff22a3f3df027f76aa50e9533"></a><!-- doxytag: member="moses.c::mos_lines_width" ref="gb1c72eeff22a3f3df027f76aa50e9533" args="(const float *spectrum, int length)" -->
+<p>The input <em>image</em> is assumed to be of type <code>float</code> and to contain MOS arc lamp line spectra dispersed (roughly) along the X direction. The background is estimated independently for each image row. The algorithm is based on the assumption that there is at least one background value at any position of the 1D-min-filter box running along the image row. A min-filter is passed along the row, and the result is smoothed by averaging on a running box of size <em>fsize</em>.  [...]
+<p>It is required that <em>msize</em> is greater than 1, and <em>fsize</em> greater than, or equal to, <em>msize</em>. Likewise, the image size along the X direction must be greater than <em>fsize</em> / 2. If such conditions are not met, or if the input image is a <code>NULL</code> pointer, this function will set an error code and return a <code>NULL</code> pointer. If either <em>msize</em> or <em>fsize</em> are even numbers, they are made odd by adding 1. Suggested values for <em>msize [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l03695">3695</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l03593">mos_arc_background_1D()</a>, and <a class="el" href="moses_8c_source.html#l18948">mos_image_filter_median()</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l16078">mos_subtract_background()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga28871a4ecc1e2779022f06d4da892360"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int mos_lines_width           </td>
+          <td class="memname">int mos_lines_width </td>
           <td>(</td>
-          <td class="paramtype">const float * </td>
-          <td class="paramname"> <em>spectrum</em>, </td>
+          <td class="paramtype">const float * </td>
+          <td class="paramname"><em>spectrum</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>length</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>length</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Estimate lines widths (in pixel) in arc lamp spectrum. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectrum</em> </td><td>A 1D emission line spectrum </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>length</em> </td><td>Length of spectrum</td></tr>
+<p>Estimate lines widths (in pixel) in arc lamp spectrum. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectrum</td><td>A 1D emission line spectrum </td></tr>
+    <tr><td class="paramname">length</td><td>Length of spectrum</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Mean lines width</dd></dl>
-This function only works with emission lines spectra. The derivative of the input spectrum is calculated. The result is processed once by setting all its negative values to zero, and once by setting all its positive values to zero and then making positive its negative values. The two profiles are cross-correlated, finding in this way the mean width of all the emission lines. Note that the returned width is the width of the lines measured at the point of max steepness of the signal (i.e., [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l03768">3768</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l13982">mos_spectral_resolution()</a>, <a class="el" href="moses_8c-source.html#l08546">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c-source.html#l05213">mos_wavelength_calibration_raw()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g417edefcade103f40ba21dd3f9c29af1"></a><!-- doxytag: member="moses.c::mos_peak_candidates" ref="g417edefcade103f40ba21dd3f9c29af1" args="(const float *spectrum, int length, float level, float exp_width)" -->
+<dl class="section return"><dt>Returns</dt><dd>Mean lines width</dd></dl>
+<p>This function only works with emission lines spectra. The derivative of the input spectrum is calculated. The result is processed once by setting all its negative values to zero, and once by setting all its positive values to zero and then making positive its negative values. The two profiles are cross-correlated, finding in this way the mean width of all the emission lines. Note that the returned width is the width of the lines measured at the point of max steepness of the signal (i. [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l03768">3768</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l14204">mos_spectral_resolution()</a>, <a class="el" href="moses_8c_source.html#l08668">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c_source.html#l05219">mos_wavelength_calibration_raw()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gad80729870e3acf9f61c820f488eb83b2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_vector* mos_peak_candidates           </td>
+          <td class="memname">cpl_vector* mos_peak_candidates </td>
           <td>(</td>
-          <td class="paramtype">const float * </td>
-          <td class="paramname"> <em>spectrum</em>, </td>
+          <td class="paramtype">const float * </td>
+          <td class="paramname"><em>spectrum</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>length</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>length</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">float </td>
-          <td class="paramname"> <em>level</em>, </td>
+          <td class="paramtype">float </td>
+          <td class="paramname"><em>level</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">float </td>
-          <td class="paramname"> <em>exp_width</em></td><td> </td>
+          <td class="paramtype">float </td>
+          <td class="paramname"><em>exp_width</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Find positions of peaks candidates. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectrum</em> </td><td>A 1D emission line spectrum </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>length</em> </td><td>Length of spectrum </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>Significance level </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>exp_width</em> </td><td>Expected lines FWHM (in pixels)</td></tr>
+</div><div class="memdoc">
+
+<p>Find positions of peaks candidates. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectrum</td><td>A 1D emission line spectrum </td></tr>
+    <tr><td class="paramname">length</td><td>Length of spectrum </td></tr>
+    <tr><td class="paramname">level</td><td>Significance level </td></tr>
+    <tr><td class="paramname">exp_width</td><td>Expected lines FWHM (in pixels)</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>List of peaks candidates positions</dd></dl>
-A peak candidate corresponds to any pixel value above <em>level</em> that is preceded and followed by a pixel with lower values. The peak candidate position is determined by parabolic interpolation of the three pixel values. A <code>NULL</code> pointer is returned in case no peak candidate is found. No error code is set in this case.<p>
-If very very broad and flat-topped peaks are expected, i.e., if the expected lines FWHM is more than 5 pixels, the <em>spectrum</em> is slightly smoothed before peaks are searched. If the expected lines FWHM is more than 20 pixels, the spectrum is preliminary sampled at a step of half <em>exp_width</em>. These operations are applied to ensure that the top of an emission line profile is never flat. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l03871">3871</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00475">values_to_dx()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l07371">mos_trace_flat()</a>, <a class="el" href="moses_8c-source.html#l08546">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c-source.html#l05213">mos_wavelength_calibration_raw()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g08d1d066f5fd31a11b6a3e8b3f21fba0"></a><!-- doxytag: member="moses.c::mos_refine_peaks" ref="g08d1d066f5fd31a11b6a3e8b3f21fba0" args="(const float *spectrum, int length, cpl_vector *peaks, int sradius)" -->
+<dl class="section return"><dt>Returns</dt><dd>List of peaks candidates positions</dd></dl>
+<p>A peak candidate corresponds to any pixel value above <em>level</em> that is preceded and followed by a pixel with lower values. The peak candidate position is determined by parabolic interpolation of the three pixel values. A <code>NULL</code> pointer is returned in case no peak candidate is found. No error code is set in this case.</p>
+<p>If very very broad and flat-topped peaks are expected, i.e., if the expected lines FWHM is more than 5 pixels, the <em>spectrum</em> is slightly smoothed before peaks are searched. If the expected lines FWHM is more than 20 pixels, the spectrum is preliminary sampled at a step of half <em>exp_width</em>. These operations are applied to ensure that the top of an emission line profile is never flat. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l03871">3871</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l07487">mos_trace_flat()</a>, <a class="el" href="moses_8c_source.html#l08668">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c_source.html#l05219">mos_wavelength_calibration_raw()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gacfa971d995aac0c8f05c37499861d191"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_vector* mos_refine_peaks           </td>
+          <td class="memname">cpl_vector* mos_refine_peaks </td>
           <td>(</td>
-          <td class="paramtype">const float * </td>
-          <td class="paramname"> <em>spectrum</em>, </td>
+          <td class="paramtype">const float * </td>
+          <td class="paramname"><em>spectrum</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>length</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>length</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_vector * </td>
-          <td class="paramname"> <em>peaks</em>, </td>
+          <td class="paramtype">cpl_vector * </td>
+          <td class="paramname"><em>peaks</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>sradius</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>sradius</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Improve (when possible) accuracy of peaks candidates positions. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectrum</em> </td><td>A 1D emission line spectrum </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>length</em> </td><td>Length of spectrum </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>peaks</em> </td><td>List of peaks candidates </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sradius</em> </td><td>Search radius for expected peaks</td></tr>
+</div><div class="memdoc">
+
+<p>Improve (when possible) accuracy of peaks candidates positions. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectrum</td><td>A 1D emission line spectrum </td></tr>
+    <tr><td class="paramname">length</td><td>Length of spectrum </td></tr>
+    <tr><td class="paramname">peaks</td><td>List of peaks candidates </td></tr>
+    <tr><td class="paramname">sradius</td><td>Search radius for expected peaks</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Vector with refined peak positions</dd></dl>
-The list of input peaks candidates (obtained with the function <code><a class="el" href="group__moses.html#g417edefcade103f40ba21dd3f9c29af1">mos_peak_candidates()</a></code> ) is made more accurate, whenever possible, by applying a line baricenter determination method. In case the baricentric method fails, the corresponding peak position is not rejected, but just kept unchanged. The final peaks candidates list is finally cleaned from peak positions that are closer than 0.5 pixel (to avo [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l03974">3974</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00321">peakPosition()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l08546">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c-source.html#l05213">mos_wavelength_calibration_raw()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g43123c837803fd95b01ba2870522ebaf"></a><!-- doxytag: member="moses.c::mos_identify_peaks" ref="g43123c837803fd95b01ba2870522ebaf" args="(cpl_vector *peaks, cpl_vector *lines, double min_disp, double max_disp, double tolerance)" -->
+<dl class="section return"><dt>Returns</dt><dd>Vector with refined peak positions</dd></dl>
+<p>The list of input peaks candidates (obtained with the function <code><a class="el" href="group__moses.html#gad80729870e3acf9f61c820f488eb83b2" title="Find positions of peaks candidates.">mos_peak_candidates()</a></code> ) is made more accurate, whenever possible, by applying a line baricenter determination method. In case the baricentric method fails, the corresponding peak position is not rejected, but just kept unchanged. The final peaks candidates list is finally cleaned from peak  [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l03974">3974</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l08668">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c_source.html#l05219">mos_wavelength_calibration_raw()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga68dc8cea89fe90cd1990d82a6945ca97"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_bivector* mos_identify_peaks           </td>
+          <td class="memname">cpl_bivector* mos_identify_peaks </td>
           <td>(</td>
-          <td class="paramtype">cpl_vector * </td>
-          <td class="paramname"> <em>peaks</em>, </td>
+          <td class="paramtype">cpl_vector * </td>
+          <td class="paramname"><em>peaks</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_vector * </td>
-          <td class="paramname"> <em>lines</em>, </td>
+          <td class="paramtype">cpl_vector * </td>
+          <td class="paramname"><em>lines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>min_disp</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>min_disp</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>max_disp</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>max_disp</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>tolerance</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>tolerance</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Identify peak candidates. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>peaks</em> </td><td>List of peaks candidates </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lines</em> </td><td>List of wavelengths </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>min_disp</em> </td><td>Min expected spectral dispersion (Angstrom/pixel) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>max_disp</em> </td><td>Max expected spectral dispersion (Angstrom/pixel) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tolerance</em> </td><td>Tolerance for interval ratio comparison</td></tr>
+</div><div class="memdoc">
+
+<p>Identify peak candidates. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">peaks</td><td>List of peaks candidates </td></tr>
+    <tr><td class="paramname">lines</td><td>List of wavelengths </td></tr>
+    <tr><td class="paramname">min_disp</td><td>Min expected spectral dispersion (Angstrom/pixel) </td></tr>
+    <tr><td class="paramname">max_disp</td><td>Max expected spectral dispersion (Angstrom/pixel) </td></tr>
+    <tr><td class="paramname">tolerance</td><td>Tolerance for interval ratio comparison</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>List of pixel positions and wavelengths of all identified peaks</dd></dl>
-The list of input peaks candidates (obtained with the functions <code><a class="el" href="group__moses.html#g417edefcade103f40ba21dd3f9c29af1">mos_peak_candidates()</a></code>, and possibly <code><a class="el" href="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0">mos_refine_peaks()</a></code> ) is compared with a list of expected emission lines wavelengths. The algorithm is based on pattern recognition, where the pattern is contained in the vector <em>lines</em>, and is searched in  [...]
-In order to work, this method just requires a rough expectation value of the spectral dispersion (in Angstrom/pixel), and a line catalog. The line catalog <em>lines</em> should just include lines that are expected somewhere in the CCD exposure of the calibration lamp (note, however, that a catalog including extra lines at its blue and/or red ends is still allowed).<p>
-Typically, the arc lamp lines candidates <em>peak</em> will include light contaminations, hot pixels, and other unwanted signal, but only in extreme cases this prevents the pattern-recognition algorithm from identifying all the spectral lines. The pattern is detected even in the case <em>peak</em> contained more arc lamp lines than actually listed in the input line catalog.<p>
-This method is based on the assumption that the relation between wavelengths and CCD positions is with good approximation locally linear (this is always true, for any existing spectrograph).<p>
-The ratio between consecutive intervals pairs in wavelength and in pixel is invariant to linear transformations, and therefore this quantity can be used in the recognition of local portions of the searched pattern. All the examined sub-patterns will overlap, leading to the final identification of the whole pattern, notwithstanding the overall non-linearity of the relation between pixels and wavelengths.<p>
-Ambiguous cases, caused by exceptional regularities in the pattern, or by a number of undetected (but expected) peaks that disrupt the pattern on the data, are solved by linear interpolation and extrapolation of the safe identifications.<p>
-More details about the applied algorithm can be found in the comments to the function code. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l04083">4083</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l08546">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c-source.html#l05213">mos_wavelength_calibration_raw()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g99c7290af152957144e8c0413355e5dd"></a><!-- doxytag: member="moses.c::mos_eval_dds" ref="g99c7290af152957144e8c0413355e5dd" args="(cpl_polynomial *ids, double blue, double red, double refwave, double pixel)" -->
+<dl class="section return"><dt>Returns</dt><dd>List of pixel positions and wavelengths of all identified peaks</dd></dl>
+<p>The list of input peaks candidates (obtained with the functions <code><a class="el" href="group__moses.html#gad80729870e3acf9f61c820f488eb83b2" title="Find positions of peaks candidates.">mos_peak_candidates()</a></code>, and possibly <code><a class="el" href="group__moses.html#gacfa971d995aac0c8f05c37499861d191" title="Improve (when possible) accuracy of peaks candidates positions.">mos_refine_peaks()</a></code> ) is compared with a list of expected emission lines wavelengths. The al [...]
+<p>In order to work, this method just requires a rough expectation value of the spectral dispersion (in Angstrom/pixel), and a line catalog. The line catalog <em>lines</em> should just include lines that are expected somewhere in the CCD exposure of the calibration lamp (note, however, that a catalog including extra lines at its blue and/or red ends is still allowed).</p>
+<p>Typically, the arc lamp lines candidates <em>peak</em> will include light contaminations, hot pixels, and other unwanted signal, but only in extreme cases this prevents the pattern-recognition algorithm from identifying all the spectral lines. The pattern is detected even in the case <em>peak</em> contained more arc lamp lines than actually listed in the input line catalog.</p>
+<p>This method is based on the assumption that the relation between wavelengths and CCD positions is with good approximation locally linear (this is always true, for any existing spectrograph).</p>
+<p>The ratio between consecutive intervals pairs in wavelength and in pixel is invariant to linear transformations, and therefore this quantity can be used in the recognition of local portions of the searched pattern. All the examined sub-patterns will overlap, leading to the final identification of the whole pattern, notwithstanding the overall non-linearity of the relation between pixels and wavelengths.</p>
+<p>Ambiguous cases, caused by exceptional regularities in the pattern, or by a number of undetected (but expected) peaks that disrupt the pattern on the data, are solved by linear interpolation and extrapolation of the safe identifications.</p>
+<p>More details about the applied algorithm can be found in the comments to the function code. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l04083">4083</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l08668">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c_source.html#l05219">mos_wavelength_calibration_raw()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga29da0280a1b9f08c181c491f6df0743a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double mos_eval_dds           </td>
+          <td class="memname">double mos_eval_dds </td>
           <td>(</td>
-          <td class="paramtype">cpl_polynomial * </td>
-          <td class="paramname"> <em>ids</em>, </td>
+          <td class="paramtype">cpl_polynomial * </td>
+          <td class="paramname"><em>ids</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>blue</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>blue</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>red</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>red</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>refwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>refwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>pixel</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>pixel</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Evaluate the wavelength of a pixel position. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>ids</em> </td><td>Inverse dispersion relation (from wave to pixel) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>Start wavelength of ids validity </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>End wavelength of ids validity </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>refwave</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>pixel</em> </td><td>Pixel position</td></tr>
+</div><div class="memdoc">
+
+<p>Evaluate the wavelength of a pixel position. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">ids</td><td>Inverse dispersion relation (from wave to pixel) </td></tr>
+    <tr><td class="paramname">blue</td><td>Start wavelength of ids validity </td></tr>
+    <tr><td class="paramname">red</td><td>End wavelength of ids validity </td></tr>
+    <tr><td class="paramname">refwave</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">pixel</td><td>Pixel position</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Wavelength of pixel</dd></dl>
-The accuracy of the returned wavelength is guaranteed to be better than 0.02 pixels (converted from wavelength units to pixel). If <em>pixel</em> is outside the <em>ids</em> validity range, the wavelength 0.0 is returned. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l04772">4772</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l10752">mos_map_idscoeff()</a>, <a class="el" href="moses_8c-source.html#l08546">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c-source.html#l05213">mos_wavelength_calibration_raw()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g0c895cc2e971156231313f7a16eb6212"></a><!-- doxytag: member="moses.c::mos_poly_wav2pix" ref="g0c895cc2e971156231313f7a16eb6212" args="(cpl_bivector *pixwav, int order, double reject, int minlines, int *nlines, double *err)" -->
+<dl class="section return"><dt>Returns</dt><dd>Wavelength of pixel</dd></dl>
+<p>The accuracy of the returned wavelength is guaranteed to be better than 0.02 pixels (converted from wavelength units to pixel). If <em>pixel</em> is outside the <em>ids</em> validity range, the wavelength 0.0 is returned. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l04772">4772</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l10975">mos_map_idscoeff()</a>, <a class="el" href="moses_8c_source.html#l08668">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c_source.html#l05219">mos_wavelength_calibration_raw()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga4d584e69389518aab8d6932e5841d399"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_polynomial* mos_poly_wav2pix           </td>
+          <td class="memname">cpl_polynomial* mos_poly_wav2pix </td>
           <td>(</td>
-          <td class="paramtype">cpl_bivector * </td>
-          <td class="paramname"> <em>pixwav</em>, </td>
+          <td class="paramtype">cpl_bivector * </td>
+          <td class="paramname"><em>pixwav</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>order</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>order</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reject</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reject</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>minlines</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>minlines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>nlines</em>, </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>nlines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>err</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>err</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Fit polynomial relation from wavelengths to pixels. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>pixwav</em> </td><td>List of pixel positions and associated wavelengths </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>Order of the fitting polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reject</em> </td><td>Max residual tolerated for line rejection (in pixel) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>minlines</em> </td><td>Min number of lines to be used in the fit </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nlines</em> </td><td>Output number of lines actually used in the fit </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>err</em> </td><td>Output RMS of the fit residuals</td></tr>
+</div><div class="memdoc">
+
+<p>Fit polynomial relation from wavelengths to pixels. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">pixwav</td><td>List of pixel positions and associated wavelengths </td></tr>
+    <tr><td class="paramname">order</td><td>Order of the fitting polynomial </td></tr>
+    <tr><td class="paramname">reject</td><td>Max residual tolerated for line rejection (in pixel) </td></tr>
+    <tr><td class="paramname">minlines</td><td>Min number of lines to be used in the fit </td></tr>
+    <tr><td class="paramname">nlines</td><td>Output number of lines actually used in the fit </td></tr>
+    <tr><td class="paramname">err</td><td>Output RMS of the fit residuals</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Polynomial relation from wavelengths to pixels</dd></dl>
-The list of identified peaks and their wavelengths (obtained either with the function <code><a class="el" href="group__moses.html#g43123c837803fd95b01ba2870522ebaf">mos_identify_peaks()</a></code> or the function <code><a class="el" href="group__moses.html#g84eceb2b87667085a8215974f0a52446">mos_find_peaks()</a></code> ) must contain at least <em>minlines</em> entries. A fit is tried, and all the peaks farther than the <em>reject</em> threshold from the model are rejected. This process is [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l04827">4827</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l04987">mos_poly_pix2wav()</a>, <a class="el" href="moses_8c-source.html#l08546">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c-source.html#l05213">mos_wavelength_calibration_raw()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g2d49af6d6595dda815a2475dd6de449a"></a><!-- doxytag: member="moses.c::mos_poly_pix2wav" ref="g2d49af6d6595dda815a2475dd6de449a" args="(cpl_bivector *pixwav, int order, double reject, int minlines, int *nlines, double *err)" -->
+<dl class="section return"><dt>Returns</dt><dd>Polynomial relation from wavelengths to pixels</dd></dl>
+<p>The list of identified peaks and their wavelengths (obtained either with the function <code><a class="el" href="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97" title="Identify peak candidates.">mos_identify_peaks()</a></code> or the function <code><a class="el" href="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe" title="Find the reference lines peaks using a polynomial first-guess.">mos_find_peaks()</a></code> ) must contain at least <em>minlines</em> entries. A fit is tr [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l04827">4827</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l04987">mos_poly_pix2wav()</a>, <a class="el" href="moses_8c_source.html#l08668">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c_source.html#l05219">mos_wavelength_calibration_raw()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga8d5305df3cb184677081fb285cba6eb5"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_polynomial* mos_poly_pix2wav           </td>
+          <td class="memname">cpl_polynomial* mos_poly_pix2wav </td>
           <td>(</td>
-          <td class="paramtype">cpl_bivector * </td>
-          <td class="paramname"> <em>pixwav</em>, </td>
+          <td class="paramtype">cpl_bivector * </td>
+          <td class="paramname"><em>pixwav</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>order</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>order</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reject</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reject</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>minlines</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>minlines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>nlines</em>, </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>nlines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>err</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>err</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Fit polynomial relation from pixels to wavelengths. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>pixwav</em> </td><td>List of pixel positions and associated wavelengths </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>Order of the fitting polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reject</em> </td><td>Max residual tolerated for line rejection (in wave units) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>minlines</em> </td><td>Min number of lines to be used in the fit </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nlines</em> </td><td>Output number of lines actually used in the fit </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>err</em> </td><td>Output RMS of the fit residuals</td></tr>
+</div><div class="memdoc">
+
+<p>Fit polynomial relation from pixels to wavelengths. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">pixwav</td><td>List of pixel positions and associated wavelengths </td></tr>
+    <tr><td class="paramname">order</td><td>Order of the fitting polynomial </td></tr>
+    <tr><td class="paramname">reject</td><td>Max residual tolerated for line rejection (in wave units) </td></tr>
+    <tr><td class="paramname">minlines</td><td>Min number of lines to be used in the fit </td></tr>
+    <tr><td class="paramname">nlines</td><td>Output number of lines actually used in the fit </td></tr>
+    <tr><td class="paramname">err</td><td>Output RMS of the fit residuals</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Polynomial relation from wavelengths to pixels</dd></dl>
-The list of identified peaks and their wavelengths (obtained with the function <code><a class="el" href="group__moses.html#g43123c837803fd95b01ba2870522ebaf">mos_identify_peaks()</a></code> ) must contain at least <em>minlines</em> entries. A fit is tried, and all the peaks farther than the <em>reject</em> threshold from the model are rejected. This process is iterated until either the number of surviving lines is less than <em>minlines</em> or there are no more outliers (whichever comes [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l04987">4987</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l04827">mos_poly_wav2pix()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g84eceb2b87667085a8215974f0a52446"></a><!-- doxytag: member="moses.c::mos_find_peaks" ref="g84eceb2b87667085a8215974f0a52446" args="(const float *spectrum, int length, cpl_vector *lines, cpl_polynomial *ids, double refwave, int sradius)" -->
+<dl class="section return"><dt>Returns</dt><dd>Polynomial relation from wavelengths to pixels</dd></dl>
+<p>The list of identified peaks and their wavelengths (obtained with the function <code><a class="el" href="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97" title="Identify peak candidates.">mos_identify_peaks()</a></code> ) must contain at least <em>minlines</em> entries. A fit is tried, and all the peaks farther than the <em>reject</em> threshold from the model are rejected. This process is iterated until either the number of surviving lines is less than <em>minlines</em> or there [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l04987">4987</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l04827">mos_poly_wav2pix()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga4ae590c72dce616bcbb426a3c2ec6ffe"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_bivector* mos_find_peaks           </td>
+          <td class="memname">cpl_bivector* mos_find_peaks </td>
           <td>(</td>
-          <td class="paramtype">const float * </td>
-          <td class="paramname"> <em>spectrum</em>, </td>
+          <td class="paramtype">const float * </td>
+          <td class="paramname"><em>spectrum</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>length</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>length</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_vector * </td>
-          <td class="paramname"> <em>lines</em>, </td>
+          <td class="paramtype">cpl_vector * </td>
+          <td class="paramname"><em>lines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_polynomial * </td>
-          <td class="paramname"> <em>ids</em>, </td>
+          <td class="paramtype">cpl_polynomial * </td>
+          <td class="paramname"><em>ids</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>refwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>refwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>sradius</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>sradius</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Find the reference lines peaks using a polynomial first-guess. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectrum</em> </td><td>A 1D emission line spectrum </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>length</em> </td><td>Length of spectrum </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lines</em> </td><td>List of wavelengths </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ids</em> </td><td>Polynomial conversion from wavelengths to pixel </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>refwave</em> </td><td>Zero wavelength used in ids determination </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sradius</em> </td><td>Search radius for expected peaks</td></tr>
+</div><div class="memdoc">
+
+<p>Find the reference lines peaks using a polynomial first-guess. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectrum</td><td>A 1D emission line spectrum </td></tr>
+    <tr><td class="paramname">length</td><td>Length of spectrum </td></tr>
+    <tr><td class="paramname">lines</td><td>List of wavelengths </td></tr>
+    <tr><td class="paramname">ids</td><td>Polynomial conversion from wavelengths to pixel </td></tr>
+    <tr><td class="paramname">refwave</td><td>Zero wavelength used in ids determination </td></tr>
+    <tr><td class="paramname">sradius</td><td>Search radius for expected peaks</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>List of pixel positions and wavelengths of all identified peaks</dd></dl>
-The input polynomial <em>ids</em> is applied to the input wavelengths to find the expected position of the corresponding peak along the input <em>spectrum</em>. The expected peak is searched within a window of radius <em>sradius</em>. A list is returned, with the positions of the detected peaks with their associated wavelengths. The <em>sradius</em> must be at least 1 pixel, and the input spectrum must be at least twice + 1 <em>sradius</em>. In case of error, a <code>NULL</code> pointer  [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l05039">5039</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00321">peakPosition()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l08546">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c-source.html#l05213">mos_wavelength_calibration_raw()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gb996d19c52ec78faa69d1b48127e3e0c"></a><!-- doxytag: member="moses.c::mos_wavelength_calibration_raw" ref="gb996d19c52ec78faa69d1b48127e3e0c" args="(const cpl_image *image, cpl_vector *lines, double dispersion, float level, int sradius, int order, double reject, double refwave, double *wavestart, double *waveend, int *nlines, double *error, cpl_table *idscoeff, cpl_image *calibration, cpl_image *residuals, cpl_table *restable, cpl_mask *refmask)" -->
+<dl class="section return"><dt>Returns</dt><dd>List of pixel positions and wavelengths of all identified peaks</dd></dl>
+<p>The input polynomial <em>ids</em> is applied to the input wavelengths to find the expected position of the corresponding peak along the input <em>spectrum</em>. The expected peak is searched within a window of radius <em>sradius</em>. A list is returned, with the positions of the detected peaks with their associated wavelengths. The <em>sradius</em> must be at least 1 pixel, and the input spectrum must be at least twice + 1 <em>sradius</em>. In case of error, a <code>NULL</code> point [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l05039">5039</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l08668">mos_wavelength_calibration_final()</a>, and <a class="el" href="moses_8c_source.html#l05219">mos_wavelength_calibration_raw()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga5587125256b4586cee2d1280d7d7c10d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_wavelength_calibration_raw           </td>
+          <td class="memname">cpl_image* mos_wavelength_calibration_raw </td>
           <td>(</td>
-          <td class="paramtype">const cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">const cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_vector * </td>
-          <td class="paramname"> <em>lines</em>, </td>
+          <td class="paramtype">cpl_vector * </td>
+          <td class="paramname"><em>lines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">float </td>
-          <td class="paramname"> <em>level</em>, </td>
+          <td class="paramtype">float </td>
+          <td class="paramname"><em>level</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>sradius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>sradius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>order</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>order</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reject</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reject</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>refwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>refwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>wavestart</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>wavestart</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>waveend</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>waveend</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>nlines</em>, </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>nlines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>error</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>error</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>idscoeff</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>idscoeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>calibration</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>calibration</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>residuals</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>residuals</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>restable</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>restable</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_mask * </td>
-          <td class="paramname"> <em>refmask</em></td><td> </td>
+          <td class="paramtype">cpl_mask * </td>
+          <td class="paramname"><em>refmask</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>detected_lines</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Derive wavelength calibration from a raw arc lamp or sky exposure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>An arc lamp or sky exposure </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lines</em> </td><td>List of reference lines wavelengths </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Expected value of the dispersion (wavelength units/pixel) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>Threshold for peak detection </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sradius</em> </td><td>Search radius for expected peaks (pixels) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>Degree of fitting polynomial for wavelength calibration </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reject</em> </td><td>Max residual tolerated for line rejection (pixels) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>refwave</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wavestart</em> </td><td>I/O wavelength of first pixel of resampled image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>waveend</em> </td><td>I/O wavelength of last pixel of resampled image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nlines</em> </td><td>Returned array of number of lines used for each fit </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>error</em> </td><td>Returned array of mean accuracies obtained for each fit </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>idscoeff</em> </td><td>Returned table with IDS polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>calibration</em> </td><td>Returned wavelength calibration image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>residuals</em> </td><td>Returned residuals image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>restable</em> </td><td>Returned residuals table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>refmask</em> </td><td>Returned monochromatic image at reference wavelength</td></tr>
+</div><div class="memdoc">
+
+<p>Derive wavelength calibration from a raw arc lamp or sky exposure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>An arc lamp or sky exposure </td></tr>
+    <tr><td class="paramname">lines</td><td>List of reference lines wavelengths </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Expected value of the dispersion (wavelength units/pixel) </td></tr>
+    <tr><td class="paramname">level</td><td>Threshold for peak detection </td></tr>
+    <tr><td class="paramname">sradius</td><td>Search radius for expected peaks (pixels) </td></tr>
+    <tr><td class="paramname">order</td><td>Degree of fitting polynomial for wavelength calibration </td></tr>
+    <tr><td class="paramname">reject</td><td>Max residual tolerated for line rejection (pixels) </td></tr>
+    <tr><td class="paramname">refwave</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">wavestart</td><td>I/O wavelength of first pixel of resampled image </td></tr>
+    <tr><td class="paramname">waveend</td><td>I/O wavelength of last pixel of resampled image </td></tr>
+    <tr><td class="paramname">nlines</td><td>Returned array of number of lines used for each fit </td></tr>
+    <tr><td class="paramname">error</td><td>Returned array of mean accuracies obtained for each fit </td></tr>
+    <tr><td class="paramname">idscoeff</td><td>Returned table with IDS polynomials </td></tr>
+    <tr><td class="paramname">calibration</td><td>Returned wavelength calibration image </td></tr>
+    <tr><td class="paramname">residuals</td><td>Returned residuals image </td></tr>
+    <tr><td class="paramname">restable</td><td>Returned residuals table </td></tr>
+    <tr><td class="paramname">refmask</td><td>Returned monochromatic image at reference wavelength </td></tr>
+    <tr><td class="paramname">detected_lines</td><td>Returned info on lines detected and used for the fit</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Input exposure resampled at constant wavelength step.</dd></dl>
-The input <em>image</em> must contain spectra with the dispersion direction approximately horizontal, with blue on the left and red on the right.<p>
-The rows of the input <em>image</em> are independently calibrated one by one. First, the function <code><a class="el" href="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a">mos_arc_background()</a></code> is used to subtract the continuum from the input spectrum. Second, the two functions <code><a class="el" href="group__moses.html#g417edefcade103f40ba21dd3f9c29af1">mos_peak_candidates()</a></code> and <code><a class="el" href="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0">mos [...]
-Optionally, in case <em>sradius</em> is positive, the obtained polynomial solution is passed to the function <code><a class="el" href="group__moses.html#g84eceb2b87667085a8215974f0a52446">mos_find_peaks()</a></code>, that searches again along each image row the reference lines candidates around their expected positions, within the specified search radius; The polynomial fitting is then repeated with the new found positions. This option can be useful for recovering very faint (i.e., below [...]
-An array <em>nlines</em>, containing the number of lines used for each fit, and an array <em>error</em>, containing the mean error of the polynomial models (in pixels), are returned. A fit failure is indicated with the corresponding element of <em>nlines</em> set to zero. The mean error of the polynomial model is evaluated by dividing the RMS of the fit residuals by the square root of the number of fitted points divided the degrees of freedom of the model:<p>
-mean error = RMS / sqrt(N / (<em>order</em> + 1))<p>
-The arrays <em>nlines</em> and <em>error</em> must be pre-allocated, and should all have as many elements as the number of rows in the input <em>image</em>. If <code>NULL</code> pointers are passed, they are not computed. In the same way a preallocated <em>idscoeff</em> table may or may not be passed to this function, and it will be filled with the dispersion relation coefficients only in the former case. This table should be preallocated with the same number of rows as the input <em>ima [...]
-As a by-product of the wavelength calibration, the input <em>image</em> is resampled at a constant wavelength step, <em>dispersion</em>, and is returned by this function. In case of error a <code>NULL</code> pointer is returned. If the input arguments <em>wavestart</em> and <em>waveend</em> are greater than 1.0, they are taken as the spectral interval where the spectra are resampled; alternatively, the wavelength range covered by the resampled image is equal to the wavelength range of th [...]
-Optionally, an image of the wavelength calibrated input exposure, <em>calibration</em>, an image of the fit residuals, <em>residuals</em>, and a monochromatic mask image, <em>refmask</em>, that is obtained at a given wavelength <em>refwave</em>, can be returned. These images must be pre-allocated, and should all have the same size of the input <em>image</em>. If <code>NULL</code> pointers are passed, they are not computed. The <em>calibration</em> image consists of pixels having the valu [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l05213">5213</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l04772">mos_eval_dds()</a>, <a class="el" href="moses_8c-source.html#l05039">mos_find_peaks()</a>, <a class="el" href="moses_8c-source.html#l04083">mos_identify_peaks()</a>, <a class="el" href="moses_8c-source.html#l03768">mos_lines_width()</a>, <a class="el" href="moses_8c-source.html#l03871">mos_peak_candidates()</a>, <a class="el" href="moses_8c-source.html#l04827">mos_poly_wav2pix()</a>, and <a class="el" href="moses_8c-source.html# [...]
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g884857a604857727d2fc0d293b678209"></a><!-- doxytag: member="moses.c::mos_locate_spectra" ref="g884857a604857727d2fc0d293b678209" args="(cpl_mask *mask)" -->
+<dl class="section return"><dt>Returns</dt><dd>Input exposure resampled at constant wavelength step.</dd></dl>
+<p>The input <em>image</em> must contain spectra with the dispersion direction approximately horizontal, with blue on the left and red on the right.</p>
+<p>The rows of the input <em>image</em> are independently calibrated one by one. First, the function <code><a class="el" href="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b" title="Background determination on emission line spectrum (arc)">mos_arc_background()</a></code> is used to subtract the continuum from the input spectrum. Second, the two functions <code><a class="el" href="group__moses.html#gad80729870e3acf9f61c820f488eb83b2" title="Find positions of peaks candidates.">mos_p [...]
+<p>Optionally, in case <em>sradius</em> is positive, the obtained polynomial solution is passed to the function <code><a class="el" href="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe" title="Find the reference lines peaks using a polynomial first-guess.">mos_find_peaks()</a></code>, that searches again along each image row the reference lines candidates around their expected positions, within the specified search radius; The polynomial fitting is then repeated with the new found  [...]
+<p>An array <em>nlines</em>, containing the number of lines used for each fit, and an array <em>error</em>, containing the mean error of the polynomial models (in pixels), are returned. A fit failure is indicated with the corresponding element of <em>nlines</em> set to zero. The mean error of the polynomial model is evaluated by dividing the RMS of the fit residuals by the square root of the number of fitted points divided the degrees of freedom of the model: </p>
+<pre class="fragment">          mean error = RMS / sqrt(N / (@em order + 1))
+</pre><p>The arrays <em>nlines</em> and <em>error</em> must be pre-allocated, and should all have as many elements as the number of rows in the input <em>image</em>. If <code>NULL</code> pointers are passed, they are not computed. In the same way a preallocated <em>idscoeff</em> table may or may not be passed to this function, and it will be filled with the dispersion relation coefficients only in the former case. This table should be preallocated with the same number of rows as the inpu [...]
+<p>As a by-product of the wavelength calibration, the input <em>image</em> is resampled at a constant wavelength step, <em>dispersion</em>, and is returned by this function. In case of error a <code>NULL</code> pointer is returned. If the input arguments <em>wavestart</em> and <em>waveend</em> are greater than 1.0, they are taken as the spectral interval where the spectra are resampled; alternatively, the wavelength range covered by the resampled image is equal to the wavelength range of [...]
+<p>Optionally, an image of the wavelength calibrated input exposure, <em>calibration</em>, an image of the fit residuals, <em>residuals</em>, and a monochromatic mask image, <em>refmask</em>, that is obtained at a given wavelength <em>refwave</em>, can be returned. These images must be pre-allocated, and should all have the same size of the input <em>image</em>. If <code>NULL</code> pointers are passed, they are not computed. The <em>calibration</em> image consists of pixels having the v [...]
+<p>If detected_lines table is an input, then a table with the position of the detected lines, its peak flux, wavelength identified and final xpos position in the wavelength calibrated image using the wavelength solution is returned. The table has to be allocated but empty. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l05219">5219</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l04772">mos_eval_dds()</a>, <a class="el" href="moses_8c_source.html#l05039">mos_find_peaks()</a>, <a class="el" href="moses_8c_source.html#l04083">mos_identify_peaks()</a>, <a class="el" href="moses_8c_source.html#l03768">mos_lines_width()</a>, <a class="el" href="moses_8c_source.html#l03871">mos_peak_candidates()</a>, <a class="el" href="moses_8c_source.html#l04827">mos_poly_wav2pix()</a>, and <a class="el" href="moses_8c_source.ht [...]
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga4e3f1760e6a202108d47c9ef977aa900"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_locate_spectra           </td>
+          <td class="memname">cpl_table* mos_locate_spectra </td>
           <td>(</td>
-          <td class="paramtype">cpl_mask * </td>
-          <td class="paramname"> <em>mask</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_mask * </td>
+          <td class="paramname"><em>mask</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Find the location of detected spectra on the CCD Find the location of detected spectra on the CCD. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>mask</em> </td><td>A reference mask at a given reference wavelength</td></tr>
+<p>Find the location of detected spectra on the CCD. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">mask</td><td>A reference mask at a given reference wavelength</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Table with characteristics of the detected spectra</dd></dl>
-The input <em>mask</em> is the one obtained with the function <code><a class="el" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw()</a></code>. The output table contains the start and end image coordinates of the slit on the input <em>mask</em> at reference wavelength. The slits are ordered from top to bottom of the image starting from the first table row.<p>
-Note that possible gaps within the images of the slits will result in splitting the same slit into two or more sub-slits. This kind of problem is solved within the slit identification task, performed by the function <code><a class="el" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits()</a></code>. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l05818">5818</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g0a1742caa67a002bee7a30f9d5289672"></a><!-- doxytag: member="moses.c::mos_validate_slits" ref="g0a1742caa67a002bee7a30f9d5289672" args="(cpl_table *slits)" -->
+<dl class="section return"><dt>Returns</dt><dd>Table with characteristics of the detected spectra</dd></dl>
+<p>The input <em>mask</em> is the one obtained with the function <code><a class="el" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw()</a></code>. The output table contains the start and end image coordinates of the slit on the input <em>mask</em> at reference wavelength. The slits are ordered from top to bottom of the image starting from the first table row.</p>
+<p>Note that possible gaps within the images of the slits will result in splitting the same slit into two or more sub-slits. This kind of problem is solved within the slit identification task, performed by the function <code><a class="el" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits()</a></code>.</p>
+<p>Find the location of detected spectra on the CCD</p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">mask</td><td>A reference mask at a given reference wavelength</td></tr>
+  </table>
+  </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>Table with characteristics of the detected spectra</dd></dl>
+<p>The input <em>mask</em> is the one obtained with the function <code><a class="el" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw()</a></code>. The output table contains the start and end image coordinates of the slit on the input <em>mask</em> at reference wavelength. The slits are ordered from top to bottom of the image starting from the first table row.</p>
+<p>Note that possible gaps within the images of the slits will result in splitting the same slit into two or more sub-slits. This kind of problem is solved within the slit identification task, performed by the function <code><a class="el" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits()</a></code>. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l05920">5920</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga9133e9d4bebf351c1ef75c903efa3e4d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_validate_slits           </td>
+          <td class="memname">cpl_error_code mos_validate_slits </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Check validity of a slit location table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slit location table to validate</td></tr>
+<p>Check validity of a slit location table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Slit location table to validate</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE in case of success</dd></dl>
-The input <em>slits</em> table is the one obtained with the functions <code><a class="el" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_spectra()</a></code> and <code>mos_rotate_slits</code>. This table is expected to contain double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, and this is the check that is performed here. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l05906">5906</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l06084">mos_identify_slits()</a>, <a class="el" href="moses_8c-source.html#l06563">mos_identify_slits_fast()</a>, and <a class="el" href="moses_8c-source.html#l05970">mos_rotate_slits()</a>.
-</div>
-</div><p>
-<a class="anchor" name="ge119e728dd0161fc46fea905861425c1"></a><!-- doxytag: member="moses.c::mos_rotate_slits" ref="ge119e728dd0161fc46fea905861425c1" args="(cpl_table *slits, int rotation, int nx, int ny)" -->
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE in case of success</dd></dl>
+<p>The input <em>slits</em> table is the one obtained with the functions <code><a class="el" href="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900" title="Find the location of detected spectra on the CCD.">mos_locate_spectra()</a></code> and <code>mos_rotate_slits</code>. This table is expected to contain double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, and this is the check that is performed here. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l06008">6008</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l06186">mos_identify_slits()</a>, and <a class="el" href="moses_8c_source.html#l06072">mos_rotate_slits()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga9880f7b09371ca6babb8b2aa7c9e094f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_rotate_slits           </td>
+          <td class="memname">cpl_error_code mos_rotate_slits </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>rotation</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>rotation</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>nx</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>nx</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ny</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ny</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Rotate a slit location table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slit location table to rotate </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>rotation</em> </td><td>Rotation angle in multiples of 90 degrees (counterclockwise) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nx</em> </td><td>X size of reference image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ny</em> </td><td>Y size of reference image</td></tr>
+</div><div class="memdoc">
+
+<p>Rotate a slit location table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Slit location table to rotate </td></tr>
+    <tr><td class="paramname">rotation</td><td>Rotation angle in multiples of 90 degrees (counterclockwise) </td></tr>
+    <tr><td class="paramname">nx</td><td>X size of reference image </td></tr>
+    <tr><td class="paramname">ny</td><td>Y size of reference image</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE in case of success</dd></dl>
-This function is meant to align the input <em>slits</em> table to the mask coordinates convention used for a given instrument. The input <em>slits</em> table is the one obtained with the function <code><a class="el" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_spectra()</a></code>, or by this self. This table is expected to contain double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end i [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l05970">5970</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l05906">mos_validate_slits()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l07371">mos_trace_flat()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g8c6d40d45c078e8bb32dc97f4bda9f98"></a><!-- doxytag: member="moses.c::mos_identify_slits" ref="g8c6d40d45c078e8bb32dc97f4bda9f98" args="(cpl_table *slits, cpl_table *maskslits, cpl_table *global)" -->
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE in case of success</dd></dl>
+<p>This function is meant to align the input <em>slits</em> table to the mask coordinates convention used for a given instrument. The input <em>slits</em> table is the one obtained with the function <code><a class="el" href="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900" title="Find the location of detected spectra on the CCD.">mos_locate_spectra()</a></code>, or by this self. This table is expected to contain double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbot [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l06072">6072</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l06008">mos_validate_slits()</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l07487">mos_trace_flat()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaa8023ee69b6004f39e3df20e9bd94364"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_identify_slits           </td>
+          <td class="memname">cpl_table* mos_identify_slits </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>maskslits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>maskslits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>global</em></td><td> </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>global</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Identify slits listed in a slit location table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slit location on the camera focal plane (CCD pixels). </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>maskslits</em> </td><td>Slit location on the telescope focal plane (mask). </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>global</em> </td><td>Global distortion table.</td></tr>
+</div><div class="memdoc">
+
+<p>Identify slits listed in a slit location table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Slit location on the camera focal plane (CCD pixels). </td></tr>
+    <tr><td class="paramname">maskslits</td><td>Slit location on the telescope focal plane (mask). </td></tr>
+    <tr><td class="paramname">global</td><td>Global distortion table.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>New slit location table</dd></dl>
-This function is meant to assign to the slits positions listed in the input <em>slits</em> table the slit identifiers contained in the input <em>maskslits</em> table. At least 3 slits should be listed in both tables. The input <em>slits</em> table is the one obtained with the function <code><a class="el" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_spectra()</a></code>, with no rotation applied. This table is expected to contain the double precision columns label [...]
-The output slit location table will contain the same columns as the input tables, with the CCD positions of all the slits listed in the <em>maskslits</em> table: such positions are not necessarily all contained in the CCD. The new positions are obtained by mean of a low degree bivariate polynomial model converting from mask positions to CCD positions. This model is derived from a subset of safely identified slits positions. The preliminary identification is performed by matching similar  [...]
-The slit identification may fail in case of masks containing a regular spacing of slits: such masks would invariably lead to ambiguous pattern matching, that would not be processed. This would not prevent that data reduction in itself: simply, the reduced spectra would miss their identification. Note that this is not a real problem, since ambiguous masks are typically masks used for calibration, and not for scientific observations.<p>
-In case a <em>global</em> distortion table is specified in input, the coefficients of the bivariate polynomials describing the relation between mask and CCD coordinates (at reference wavelength) are written to rows 0 and 7. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l06084">6084</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l06563">mos_identify_slits_fast()</a>, <a class="el" href="moses_8c-source.html#l05906">mos_validate_slits()</a>, and <a class="el" href="moses_8c-source.html#l00634">write_global_distortion()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g168f6aecd869c24634fa9f6690da0b02"></a><!-- doxytag: member="moses.c::mos_trace_flat" ref="g168f6aecd869c24634fa9f6690da0b02" args="(cpl_image *flat, cpl_table *slits, double reference, double blue, double red, double dispersion)" -->
+<dl class="section return"><dt>Returns</dt><dd>New slit location table</dd></dl>
+<p>This function is meant to assign to the slits positions listed in the input <em>slits</em> table the slit identifiers contained in the input <em>maskslits</em> table. At least 3 slits should be listed in both tables. The input <em>slits</em> table is the one obtained with the function <code><a class="el" href="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900" title="Find the location of detected spectra on the CCD.">mos_locate_spectra()</a></code>, with no rotation applied. This t [...]
+<p>The output slit location table will contain the same columns as the input tables, with the CCD positions of all the slits listed in the <em>maskslits</em> table: such positions are not necessarily all contained in the CCD. The new positions are obtained by mean of a low degree bivariate polynomial model converting from mask positions to CCD positions. This model is derived from a subset of safely identified slits positions. The preliminary identification is performed by matching simil [...]
+<p>The slit identification may fail in case of masks containing a regular spacing of slits: such masks would invariably lead to ambiguous pattern matching, that would not be processed. This would not prevent that data reduction in itself: simply, the reduced spectra would miss their identification. Note that this is not a real problem, since ambiguous masks are typically masks used for calibration, and not for scientific observations.</p>
+<p>In case a <em>global</em> distortion table is specified in input, the coefficients of the bivariate polynomials describing the relation between mask and CCD coordinates (at reference wavelength) are written to rows 0 and 7. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l06186">6186</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l06008">mos_validate_slits()</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaad02c30291fd30d07156ac8f397f439f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_trace_flat           </td>
+          <td class="memname">cpl_table* mos_trace_flat </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>flat</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>flat</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reference</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reference</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>blue</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>blue</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>red</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>red</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Trace flat field spectra. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>flat</em> </td><td>Flat field image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions on the CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>Start lambda for tracing </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>End lambda for tracing </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Mean spectral dispersion</td></tr>
+</div><div class="memdoc">
+
+<p>Trace flat field spectra. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">flat</td><td>Flat field image </td></tr>
+    <tr><td class="paramname">slits</td><td>Slits positions on the CCD </td></tr>
+    <tr><td class="paramname">reference</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">blue</td><td>Start lambda for tracing </td></tr>
+    <tr><td class="paramname">red</td><td>End lambda for tracing </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Mean spectral dispersion</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>A table with the tracings for each spectrum</dd></dl>
-The input <em>flat</em> field image is expected to be oriented with horizontal dispersion direction and red wavelengths on the right side, and it should be of type <code>CPL_TYPE_FLOAT</code>. The <em>slits</em> table should be the output of either the function <code><a class="el" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits()</a></code> (if available) or the function <code><a class="el" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locat [...]
-The flat image is shifted one pixel down and is subtracted from the original image. The result is a vertical gradient map. Next, the negative values are forced positive, to obtain an absolute gradient map. The map is passed with a horizontal median filter, and after that the gradient peaks are traced starting from the slits positions listed in the input <em>slits</em> table. The number of pixels to the left and to the right of the reference pixel is trivially derived from the specified s [...]
-The output table contains the traced spectral edges positions in CCD (Y) coordinates for each spectrum. The columns are named after the "slit_id" listed in the input <em>slits</em> table, and are preceded by a "t" for upper edges, and by a "b" for bottom edges: for instance, the trace corresponding to the upper edge of a spectrum with id = 123 will be found in a column named "t123". If the "slit_id" column is missing in the input table, one will be created with conventional (unique) numb [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l07371">7371</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00245">mos_image_vertical_median_filter()</a>, <a class="el" href="moses_8c-source.html#l03871">mos_peak_candidates()</a>, and <a class="el" href="moses_8c-source.html#l05970">mos_rotate_slits()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gacdfcf9b570d851cc9935b56f6e86414"></a><!-- doxytag: member="moses.c::mos_poly_trace" ref="gacdfcf9b570d851cc9935b56f6e86414" args="(cpl_table *slits, cpl_table *traces, int order)" -->
+<dl class="section return"><dt>Returns</dt><dd>A table with the tracings for each spectrum</dd></dl>
+<p>The input <em>flat</em> field image is expected to be oriented with horizontal dispersion direction and red wavelengths on the right side, and it should be of type <code>CPL_TYPE_FLOAT</code>. The <em>slits</em> table should be the output of either the function <code><a class="el" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits()</a></code> (if available) or the function <code><a class="el" href="gr [...]
+<p>The flat image is shifted one pixel down and is subtracted from the original image. The result is a vertical gradient map. Next, the negative values are forced positive, to obtain an absolute gradient map. The map is passed with a horizontal median filter, and after that the gradient peaks are traced starting from the slits positions listed in the input <em>slits</em> table. The number of pixels to the left and to the right of the reference pixel is trivially derived from the specifie [...]
+<p>The output table contains the traced spectral edges positions in CCD (Y) coordinates for each spectrum. The columns are named after the "slit_id" listed in the input <em>slits</em> table, and are preceded by a "t" for upper edges, and by a "b" for bottom edges: for instance, the trace corresponding to the upper edge of a spectrum with id = 123 will be found in a column named "t123". If the "slit_id" column is missing in the input table, one will be created with conventional (unique) n [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l07487">7487</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l03871">mos_peak_candidates()</a>, and <a class="el" href="moses_8c_source.html#l06072">mos_rotate_slits()</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga7518d66581d93ab64704fcf90996296b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_poly_trace           </td>
+          <td class="memname">cpl_table* mos_poly_trace </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>traces</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>traces</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>order</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>order</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Fit spectral traces. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions on the CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>traces</em> </td><td>Spectral traces </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>Order of fitting polynomial</td></tr>
+</div><div class="memdoc">
+
+<p>Fit spectral traces. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Slits positions on the CCD </td></tr>
+    <tr><td class="paramname">traces</td><td>Spectral traces </td></tr>
+    <tr><td class="paramname">order</td><td>Order of fitting polynomial</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Table with tracing polynomials coefficients</dd></dl>
-The <em>traces</em> table should be the product of the function <code><a class="el" href="group__moses.html#g168f6aecd869c24634fa9f6690da0b02">mos_trace_flat()</a></code>, and the <em>slits</em> table should be the same used and processed there. The <em>order</em> of the fitting polynomial should not be greater than 5. If the fit of a trace is successful, a column containing the residuals of the fit is added to the <em>traces</em> table. If the fitted data are contained in a column named [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l07805">7805</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g7f34d564b07538f21cba7ccddc9738c5"></a><!-- doxytag: member="moses.c::mos_global_trace" ref="g7f34d564b07538f21cba7ccddc9738c5" args="(cpl_table *slits, cpl_table *polytraces, int mode)" -->
+<dl class="section return"><dt>Returns</dt><dd>Table with tracing polynomials coefficients</dd></dl>
+<p>The <em>traces</em> table should be the product of the function <code><a class="el" href="group__moses.html#gaad02c30291fd30d07156ac8f397f439f" title="Trace flat field spectra.">mos_trace_flat()</a></code>, and the <em>slits</em> table should be the same used and processed there. The <em>order</em> of the fitting polynomial should not be greater than 5. If the fit of a trace is successful, a column containing the residuals of the fit is added to the <em>traces</em> table. If the fitte [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l07921">7921</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga0eda8a5abf396113ffbe66607fd72fe6"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_global_trace           </td>
+          <td class="memname">cpl_error_code mos_global_trace </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>polytraces</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>polytraces</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>mode</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>mode</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Recompute tracing coefficients globally. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions on the CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>polytraces</em> </td><td>Coefficients of spectral curvature polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>0 = do nothing, 1 = fill gaps, 2 = global model</td></tr>
+</div><div class="memdoc">
+
+<p>Recompute tracing coefficients globally. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Slits positions on the CCD </td></tr>
+    <tr><td class="paramname">polytraces</td><td>Coefficients of spectral curvature polynomials </td></tr>
+    <tr><td class="paramname">mode</td><td>0 = do nothing, 1 = fill gaps, 2 = global model</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
-The <em>polytraces</em> table should be the product of the function <code><a class="el" href="group__moses.html#g168f6aecd869c24634fa9f6690da0b02">mos_trace_flat()</a></code>, and the <em>slits</em> table should be the same used and processed there. The trend of the tracing coefficients as a function of the first (offset) coefficient c0 is modelled by a linear fit. If <em>mode</em> is 2, all the coefficients are recomputed according to this model. If <em>mode</em> is 1, just missing solu [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l07966">7966</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00682">robustLinearFit()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g97cde563aea50318b61faf6c9355bdbe"></a><!-- doxytag: member="moses.c::mos_spatial_calibration" ref="g97cde563aea50318b61faf6c9355bdbe" args="(cpl_image *spectra, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion, int flux, cpl_image *calibration)" -->
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success</dd></dl>
+<p>The <em>polytraces</em> table should be the product of the function <code><a class="el" href="group__moses.html#gaad02c30291fd30d07156ac8f397f439f" title="Trace flat field spectra.">mos_trace_flat()</a></code>, and the <em>slits</em> table should be the same used and processed there. The trend of the tracing coefficients as a function of the first (offset) coefficient c0 is modelled by a linear fit. If <em>mode</em> is 2, all the coefficients are recomputed according to this model. If [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l08082">8082</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga6910eeaa28338a6d447e74130666fe13"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_spatial_calibration           </td>
+          <td class="memname">cpl_image* mos_spatial_calibration </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spectra</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spectra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>polytraces</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>polytraces</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reference</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reference</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>blue</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>blue</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>red</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>red</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>flux</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>flux</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>calibration</em></td><td> </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>calibration</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Spatial remapping of CCD spectra eliminating the spectral curvature. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectra</em> </td><td>CCD image of spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions on the CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>polytraces</em> </td><td>Coefficients of spectral curvature polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>Start lambda for spatial remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>End lambda for spatial remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Mean spectral dispersion </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>flux</em> </td><td>If zero, flux conservation is not applied </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>calibration</em> </td><td>Returned spatial calibration image</td></tr>
+</div><div class="memdoc">
+
+<p>Spatial remapping of CCD spectra eliminating the spectral curvature. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectra</td><td>CCD image of spectra </td></tr>
+    <tr><td class="paramname">slits</td><td>Slits positions on the CCD </td></tr>
+    <tr><td class="paramname">polytraces</td><td>Coefficients of spectral curvature polynomials </td></tr>
+    <tr><td class="paramname">reference</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">blue</td><td>Start lambda for spatial remapping </td></tr>
+    <tr><td class="paramname">red</td><td>End lambda for spatial remapping </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Mean spectral dispersion </td></tr>
+    <tr><td class="paramname">flux</td><td>If zero, flux conservation is not applied </td></tr>
+    <tr><td class="paramname">calibration</td><td>Returned spatial calibration image</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Image with the spatially resampled spectra</dd></dl>
-The input <em>spectra</em> image is expected to be oriented with horizontal dispersion direction and red wavelengths on the right side, and it should be of type <code>CPL_TYPE_FLOAT</code>. The <em>slits</em> table should be the output of either the function <code><a class="el" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits()</a></code> (if available) or the function <code><a class="el" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_s [...]
-The spectra are spatially remapped (with a slight oversampling) starting from the pixel containing the reference wavelength (as reported for each entry of the <em>slits</em> table). The number of pixels to the left and to the right of the reference pixel is trivially derived from the specified spectral range <em>blue</em> to <em>red</em> and <em>dispersion</em>.<p>
-At each <em>x</em> pixel position the interval between the top and the bottom edges of each spectrum is linearly remapped into N = ceil(t-b)+1 spatial pseudo-pixels, where t and b are its edges positions at the CCD reference pixel (i.e., if the slit spectrum is widening or narrowing along the wavelength range, it is mapped always to the same number of pseudo-pixels). The returned image will have the same x size of the input <em>spectra</em> image, and a y size equal to the sum of the N s [...]
-Optionally, an image of the spatially calibrated input exposure, <em>calibration</em>, can be returned. This image must be pre-allocated, and should have the same size of the input <em>spectra</em> image. If a <code>NULL</code> pointer is passed, it is not computed. The <em>calibration</em> image will consist of pixels having the value of their spatial coordinate along the slit they belong to, or the value zero if the pixels do not belong to any spectrum.<p>
-In case <em>flux</em> is set to a value different from zero, the remapping is performed applying a correction for flux conservation.<p>
-Here is how the spatial resampling is applied: the value of a spatial pseudo-pixel p (counted from 0, corresponding to the top spectral trace at a given <em>x</em> position on the CCD of a given spectrum), is computed by linear interpolation between the two values of the consecutive CCD pixels closest to the position y = t - p*(t-b)/N, with the same meaning for N, b, and t, described above, and with 0 <= p <= N.<p>
-On the <em>calibration</em> image the original y pixel positions (at a given x) are assigned the value of their distance from the top spectral trace, computed as p = N*(t-y)/(t-b), where p is now a float, and y an integer varying from ceil(t) to floor(b).<p>
-The input <em>slits</em> table is added two new columns, labeled "position" and "length", reporting the number of the first (bottom) row belonging to the corresponding slit spectrum, and its extension in pseudo-pixels on the returned spatially rectified image. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l08147">8147</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l02291">mos_normalise_flat()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gf01eea33659a6250ad14f7f0fecd86c2"></a><!-- doxytag: member="moses.c::mos_wavelength_calibration_final" ref="gf01eea33659a6250ad14f7f0fecd86c2" args="(cpl_image *image, cpl_table *slits, cpl_vector *lines, double dispersion, float level, int sradius, int order, double reject, double refwave, double *wavestart, double *waveend, int *nlines, double *error, cpl_table *idscoeff, cpl_image *calibration, cpl_image *residuals, cpl_table *restable)" -->
+<dl class="section return"><dt>Returns</dt><dd>Image with the spatially resampled spectra</dd></dl>
+<p>The input <em>spectra</em> image is expected to be oriented with horizontal dispersion direction and red wavelengths on the right side, and it should be of type <code>CPL_TYPE_FLOAT</code>. The <em>slits</em> table should be the output of either the function <code><a class="el" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits()</a></code> (if available) or the function <code><a class="el" href="group [...]
+<p>The spectra are spatially remapped (with a slight oversampling) starting from the pixel containing the reference wavelength (as reported for each entry of the <em>slits</em> table). The number of pixels to the left and to the right of the reference pixel is trivially derived from the specified spectral range <em>blue</em> to <em>red</em> and <em>dispersion</em>.</p>
+<p>At each <em>x</em> pixel position the interval between the top and the bottom edges of each spectrum is linearly remapped into N = ceil(t-b)+1 spatial pseudo-pixels, where t and b are its edges positions at the CCD reference pixel (i.e., if the slit spectrum is widening or narrowing along the wavelength range, it is mapped always to the same number of pseudo-pixels). The returned image will have the same x size of the input <em>spectra</em> image, and a y size equal to the sum of the  [...]
+<p>Optionally, an image of the spatially calibrated input exposure, <em>calibration</em>, can be returned. This image must be pre-allocated, and should have the same size of the input <em>spectra</em> image. If a <code>NULL</code> pointer is passed, it is not computed. The <em>calibration</em> image will consist of pixels having the value of their spatial coordinate along the slit they belong to, or the value zero if the pixels do not belong to any spectrum.</p>
+<p>In case <em>flux</em> is set to a value different from zero, the remapping is performed applying a correction for flux conservation.</p>
+<p>Here is how the spatial resampling is applied: the value of a spatial pseudo-pixel p (counted from 0, corresponding to the top spectral trace at a given <em>x</em> position on the CCD of a given spectrum), is computed by linear interpolation between the two values of the consecutive CCD pixels closest to the position y = t - p*(t-b)/N, with the same meaning for N, b, and t, described above, and with 0 <= p <= N.</p>
+<p>On the <em>calibration</em> image the original y pixel positions (at a given x) are assigned the value of their distance from the top spectral trace, computed as p = N*(t-y)/(t-b), where p is now a float, and y an integer varying from ceil(t) to floor(b).</p>
+<p>The input <em>slits</em> table is added two new columns, labeled "position" and "length", reporting the number of the first (bottom) row belonging to the corresponding slit spectrum, and its extension in pseudo-pixels on the returned spatially rectified image. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l08263">8263</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l02290">mos_normalise_flat()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga6eece9155581f329c3a779cd62b8f1cb"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_wavelength_calibration_final           </td>
+          <td class="memname">cpl_image* mos_wavelength_calibration_final </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_vector * </td>
-          <td class="paramname"> <em>lines</em>, </td>
+          <td class="paramtype">cpl_vector * </td>
+          <td class="paramname"><em>lines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">float </td>
-          <td class="paramname"> <em>level</em>, </td>
+          <td class="paramtype">float </td>
+          <td class="paramname"><em>level</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>sradius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>sradius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>order</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>order</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reject</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reject</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>refwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>refwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>wavestart</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>wavestart</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>waveend</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>waveend</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>nlines</em>, </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>nlines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>error</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>error</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>idscoeff</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>idscoeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>calibration</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>calibration</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>residuals</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>residuals</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>restable</em></td><td> </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>restable</em>, </td>
+        </tr>
+        <tr>
+          <td class="paramkey"></td>
+          <td></td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>detected_lines</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Derive wavelength calibration from a rectified arc lamp or sky exposure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>A rectified arc lamp or sky exposure </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lines</em> </td><td>List of reference lines wavelengths </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Expected value of the dispersion (wavelength units/pixel) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>level</em> </td><td>Threshold for peak detection </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sradius</em> </td><td>Search radius for expected peaks (pixels) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>Degree of fitting polynomial for wavelength calibration </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reject</em> </td><td>Max residual tolerated for line rejection (pixels) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>refwave</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wavestart</em> </td><td>I/O wavelength of first pixel of resampled image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>waveend</em> </td><td>I/O wavelength of last pixel of resampled image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nlines</em> </td><td>Returned array of number of lines used for each fit </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>error</em> </td><td>Returned array of mean accuracies obtained for each fit </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>idscoeff</em> </td><td>Returned table with IDS polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>calibration</em> </td><td>Returned wavelength calibration image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>residuals</em> </td><td>Returned residuals image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>restable</em> </td><td>Returned residuals table</td></tr>
+</div><div class="memdoc">
+
+<p>Derive wavelength calibration from a rectified arc lamp or sky exposure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>A rectified arc lamp or sky exposure </td></tr>
+    <tr><td class="paramname">slits</td><td>Slits positions table </td></tr>
+    <tr><td class="paramname">lines</td><td>List of reference lines wavelengths </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Expected value of the dispersion (wavelength units/pixel) </td></tr>
+    <tr><td class="paramname">level</td><td>Threshold for peak detection </td></tr>
+    <tr><td class="paramname">sradius</td><td>Search radius for expected peaks (pixels) </td></tr>
+    <tr><td class="paramname">order</td><td>Degree of fitting polynomial for wavelength calibration </td></tr>
+    <tr><td class="paramname">reject</td><td>Max residual tolerated for line rejection (pixels) </td></tr>
+    <tr><td class="paramname">refwave</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">wavestart</td><td>I/O wavelength of first pixel of resampled image </td></tr>
+    <tr><td class="paramname">waveend</td><td>I/O wavelength of last pixel of resampled image </td></tr>
+    <tr><td class="paramname">nlines</td><td>Returned array of number of lines used for each fit </td></tr>
+    <tr><td class="paramname">error</td><td>Returned array of mean accuracies obtained for each fit </td></tr>
+    <tr><td class="paramname">idscoeff</td><td>Returned table with IDS polynomials </td></tr>
+    <tr><td class="paramname">calibration</td><td>Returned wavelength calibration image </td></tr>
+    <tr><td class="paramname">residuals</td><td>Returned residuals image </td></tr>
+    <tr><td class="paramname">restable</td><td>Returned residuals table </td></tr>
+    <tr><td class="paramname">detected_lines</td><td>Returned info on lines detected and used for the fit</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Input image resampled at constant wavelength step.</dd></dl>
-This function applies the same algorithm for line identification that is applied by the function <code><a class="el" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw()</a></code>. The fundamental difference is that the algorithm is here applied to an image containing just spectra where the spectral curvature was eliminated, as produced by the function <code><a class="el" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibr [...]
-The rows of the input <em>image</em> are independently calibrated one by one. The spectral continuum is assumed to have been already removed (and it should be so, if the function <code><a class="el" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw()</a></code> was earlier called).<p>
-Optionally, in case <em>sradius</em> is positive, the polynomial solutions obtained for all rows of each individual slit are averaged into a single solution, that is used as a first-guess that is passed to the function <code><a class="el" href="group__moses.html#g84eceb2b87667085a8215974f0a52446">mos_find_peaks()</a></code>. This function will search again along each row belonging to that slit the reference lines candidates around their expected positions, within the specified search rad [...]
-An array <em>nlines</em>, containing the number of lines used for each fit, and an array <em>error</em>, containing the mean error of the polynomial models (in pixels), are returned. A fit failure is indicated with the corresponding element of <em>nlines</em> set to zero. The mean error of the polynomial model is evaluated by dividing the RMS of the fit residuals by the square root of the number of fitted points divided the degrees of freedom of the model:<p>
-mean error = RMS / sqrt(N / (<em>order</em> + 1))<p>
-The arrays <em>nlines</em> and <em>error</em> must be pre-allocated, and should all have as many elements as the number of rows in the input <em>image</em>. If <code>NULL</code> pointers are passed, they are not computed.<p>
-In the table <em>idscoeff</em> will be written the polynomial fits coefficients obtained for each input <em>image</em> row: this table must therefore be preallocated, before calling this function, with the same number of rows as the input <em>image</em>. No columns should be defined in this table: they will be created automatically by this function, and will be labeled c0, c1, c2, ... up to the specified <em>order</em> of the fitting polynomial.<p>
-As a by-product of the wavelength calibration, the input <em>image</em> is resampled at a constant wavelength step, <em>dispersion</em>, and is returned by this function. In case of error a <code>NULL</code> pointer is returned. If the input arguments <em>wavestart</em> and <em>waveend</em> are greater than 1.0, they are taken as the spectral interval where the spectra are resampled; alternatively, the wavelength range covered by the resampled image is equal to the wavelength range of th [...]
-Optionally, an image of the wavelength calibrated input exposure, <em>calibration</em>, might be filled with the value of the wavelength for each pixel. This image may be significantly more accurate than the <em>calibration</em> image obtained with the preliminary wavelength calibration, returned by the function <code><a class="el" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw()</a></code>. For this reason it would also be appropriate to map it [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l08546">8546</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l04772">mos_eval_dds()</a>, <a class="el" href="moses_8c-source.html#l05039">mos_find_peaks()</a>, <a class="el" href="moses_8c-source.html#l04083">mos_identify_peaks()</a>, <a class="el" href="moses_8c-source.html#l03062">mos_interpolate_wavecalib()</a>, <a class="el" href="moses_8c-source.html#l03768">mos_lines_width()</a>, <a class="el" href="moses_8c-source.html#l03871">mos_peak_candidates()</a>, <a class="el" href="moses_8c-source. [...]
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gb2cc63c200bab0a922efde3d20192443"></a><!-- doxytag: member="moses.c::mos_wavelength_calibration" ref="gb2cc63c200bab0a922efde3d20192443" args="(cpl_image *image, double refwave, double firstLambda, double lastLambda, double dispersion, cpl_table *idscoeff, int flux)" -->
+<dl class="section return"><dt>Returns</dt><dd>Input image resampled at constant wavelength step.</dd></dl>
+<p>This function applies the same algorithm for line identification that is applied by the function <code><a class="el" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw()</a></code>. The fundamental difference is that the algorithm is here applied to an image containing just spectra where the spectral curvature was eliminated, as produced by the function <code><a class="el [...]
+<p>The rows of the input <em>image</em> are independently calibrated one by one. The spectral continuum is assumed to have been already removed (and it should be so, if the function <code><a class="el" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw()</a></code> was earlier called).</p>
+<p>Optionally, in case <em>sradius</em> is positive, the polynomial solutions obtained for all rows of each individual slit are averaged into a single solution, that is used as a first-guess that is passed to the function <code><a class="el" href="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe" title="Find the reference lines peaks using a polynomial first-guess.">mos_find_peaks()</a></code>. This function will search again along each row belonging to that slit the reference lines  [...]
+<p>An array <em>nlines</em>, containing the number of lines used for each fit, and an array <em>error</em>, containing the mean error of the polynomial models (in pixels), are returned. A fit failure is indicated with the corresponding element of <em>nlines</em> set to zero. The mean error of the polynomial model is evaluated by dividing the RMS of the fit residuals by the square root of the number of fitted points divided the degrees of freedom of the model: </p>
+<pre class="fragment">          mean error = RMS / sqrt(N / (@em order + 1))
+</pre><p>The arrays <em>nlines</em> and <em>error</em> must be pre-allocated, and should all have as many elements as the number of rows in the input <em>image</em>. If <code>NULL</code> pointers are passed, they are not computed.</p>
+<p>In the table <em>idscoeff</em> will be written the polynomial fits coefficients obtained for each input <em>image</em> row: this table must therefore be preallocated, before calling this function, with the same number of rows as the input <em>image</em>. No columns should be defined in this table: they will be created automatically by this function, and will be labeled c0, c1, c2, ... up to the specified <em>order</em> of the fitting polynomial.</p>
+<p>As a by-product of the wavelength calibration, the input <em>image</em> is resampled at a constant wavelength step, <em>dispersion</em>, and is returned by this function. In case of error a <code>NULL</code> pointer is returned. If the input arguments <em>wavestart</em> and <em>waveend</em> are greater than 1.0, they are taken as the spectral interval where the spectra are resampled; alternatively, the wavelength range covered by the resampled image is equal to the wavelength range of [...]
+<p>Optionally, an image of the wavelength calibrated input exposure, <em>calibration</em>, might be filled with the value of the wavelength for each pixel. This image may be significantly more accurate than the <em>calibration</em> image obtained with the preliminary wavelength calibration, returned by the function <code><a class="el" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calib [...]
+<p>If detected_lines table is an input, then a table with the position of the detected lines, its peak flux, wavelength identified and final xpos position in the wavelength calibrated image using the wavelength solution is returned. The table has to be allocated but empty. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l08668">8668</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l04772">mos_eval_dds()</a>, <a class="el" href="moses_8c_source.html#l05039">mos_find_peaks()</a>, <a class="el" href="moses_8c_source.html#l04083">mos_identify_peaks()</a>, <a class="el" href="moses_8c_source.html#l03061">mos_interpolate_wavecalib()</a>, <a class="el" href="moses_8c_source.html#l03768">mos_lines_width()</a>, <a class="el" href="moses_8c_source.html#l03871">mos_peak_candidates()</a>, <a class="el" href="moses_8c_sour [...]
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga5c5f54b99d64a52b9d90d65bf7421b6b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_wavelength_calibration           </td>
+          <td class="memname">cpl_image* mos_wavelength_calibration </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>refwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>refwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>firstLambda</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>firstLambda</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>lastLambda</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>lastLambda</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>idscoeff</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>idscoeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>flux</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>flux</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Remap at constant wavelength step an image of rectified scientific spectra. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image with rectified scientific spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>refwave</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>firstLambda</em> </td><td>Wavelength of first pixel of resampled image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lastLambda</em> </td><td>Wavelength of last pixel of resampled image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Resampling step (wavelength units/pixel) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>idscoeff</em> </td><td>Table with IDS polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>flux</em> </td><td>If zero, flux conservation correction is not applied.</td></tr>
+</div><div class="memdoc">
+
+<p>Remap at constant wavelength step an image of rectified scientific spectra. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image with rectified scientific spectra </td></tr>
+    <tr><td class="paramname">refwave</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">firstLambda</td><td>Wavelength of first pixel of resampled image </td></tr>
+    <tr><td class="paramname">lastLambda</td><td>Wavelength of last pixel of resampled image </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Resampling step (wavelength units/pixel) </td></tr>
+    <tr><td class="paramname">idscoeff</td><td>Table with IDS polynomials </td></tr>
+    <tr><td class="paramname">flux</td><td>If zero, flux conservation correction is not applied.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Input image resampled at constant wavelength step.</dd></dl>
-The input <em>image</em> is the image of the scientific spectra with the spectral curvature removed, as produced by the function <code><a class="el" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration()</a></code>. The table <em>idscoeff</em> contains the polynomial fits coefficients obtained for each input <em>image</em> row, as produced by the function <code><a class="el" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibratio [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l09188">9188</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gc4557c40d2f1ff46784fdb61c8ee67e3"></a><!-- doxytag: member="moses.c::mos_wavelength_align" ref="gc4557c40d2f1ff46784fdb61c8ee67e3" args="(cpl_image *image, cpl_table *slits, double refwave, double firstLambda, double lastLambda, cpl_table *idscoeff, cpl_vector *skylines, int highres, int order, cpl_image *calibration, int sradius)" -->
+<dl class="section return"><dt>Returns</dt><dd>Input image resampled at constant wavelength step.</dd></dl>
+<p>The input <em>image</em> is the image of the scientific spectra with the spectral curvature removed, as produced by the function <code><a class="el" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration()</a></code>. The table <em>idscoeff</em> contains the polynomial fits coefficients obtained for each input <em>image</em> row, as produced by the function <code><a class="el" hre [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l09411">9411</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga634eb7408671a139e7015185776f4513"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_wavelength_align           </td>
+          <td class="memname">cpl_table* mos_wavelength_align </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>refwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>refwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>firstLambda</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>firstLambda</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>lastLambda</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>lastLambda</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>idscoeff</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>idscoeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_vector * </td>
-          <td class="paramname"> <em>skylines</em>, </td>
+          <td class="paramtype">cpl_vector * </td>
+          <td class="paramname"><em>skylines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>highres</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>highres</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>order</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>order</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>calibration</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>calibration</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>sradius</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>sradius</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Modify the input wavelength solution to match reference sky lines. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image with rectified scientific spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>refwave</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>firstLambda</em> </td><td>Wavelength range start </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lastLambda</em> </td><td>Wavelength range end </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>idscoeff</em> </td><td>Table with IDS polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>skylines</em> </td><td>Vector with wavelengths of reference skylines </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>highres</em> </td><td>1 = high resolution data, 0 = low resolution data </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>Order of sky lines offsets fitting polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>calibration</em> </td><td>Rectified wavelength calibration image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sradius</em> </td><td>Search radius for sky lines</td></tr>
+</div><div class="memdoc">
+
+<p>Modify the input wavelength solution to match reference sky lines. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image with rectified scientific spectra </td></tr>
+    <tr><td class="paramname">slits</td><td>Slits positions table </td></tr>
+    <tr><td class="paramname">refwave</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">firstLambda</td><td>Wavelength range start </td></tr>
+    <tr><td class="paramname">lastLambda</td><td>Wavelength range end </td></tr>
+    <tr><td class="paramname">idscoeff</td><td>Table with IDS polynomials </td></tr>
+    <tr><td class="paramname">skylines</td><td>Vector with wavelengths of reference skylines </td></tr>
+    <tr><td class="paramname">highres</td><td>1 = high resolution data, 0 = low resolution data </td></tr>
+    <tr><td class="paramname">order</td><td>Order of sky lines offsets fitting polynomial </td></tr>
+    <tr><td class="paramname">calibration</td><td>Rectified wavelength calibration image </td></tr>
+    <tr><td class="paramname">sradius</td><td>Search radius for sky lines</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Table with measured sky lines offsets (in pixel)</dd></dl>
-The input <em>image</em> is the image of the scientific spectra with the spectral curvature removed, as produced by the function <code><a class="el" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration()</a></code>. The input <em>slits</em> table should be the same used and processed by the same function, containing a column named "position" listing the position of the individual spectra in the rectified image. The table <em>idscoeff</em> contains the polyno [...]
-More in detail: for each slit, a "sky" spectrum is derived by computing the median slit spectrum, reducing in this way possible contamination by bright scientific object(s) contained in the slit. All the IDS polynomials modelling the slit are used to determine the sky lines offsets: with N slit rows, N independent offsets for each reference sky line are found; a new table is created, with columns containing the median offsets obtained for each reference sky line and for each slit. The co [...]
-For each slit, the median offsets are fitted by a polynomial relation that is then summed to all the IDS polynomials pertaining to that slit, modifying in this way the input <em>idscoeff</em> table. It is of course advisable not to go beyond a fitting polynomial of 0th or 1st order, unless many and well distributed reference sky lines are available within the specified range. Note that this way of proceeding is applied to avoid destroying the information about irregularities in the slit  [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l09469">9469</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00321">peakPosition()</a>, and <a class="el" href="moses_8c-source.html#l00682">robustLinearFit()</a>.
-<p>
-Referenced by <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g2523d130beaf8538187729f767c38805"></a><!-- doxytag: member="moses.c::mos_wavelength_align_lss" ref="g2523d130beaf8538187729f767c38805" args="(cpl_image *image, double refwave, double firstLambda, double lastLambda, cpl_table *idscoeff, cpl_vector *skylines, int highres, int order, cpl_image *calibration, int sradius)" -->
+<dl class="section return"><dt>Returns</dt><dd>Table with measured sky lines offsets (in pixel)</dd></dl>
+<p>The input <em>image</em> is the image of the scientific spectra with the spectral curvature removed, as produced by the function <code><a class="el" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration()</a></code>. The input <em>slits</em> table should be the same used and processed by the same function, containing a column named "position" listing the position of the individua [...]
+<p>More in detail: for each slit, a "sky" spectrum is derived by computing the median slit spectrum, reducing in this way possible contamination by bright scientific object(s) contained in the slit. All the IDS polynomials modelling the slit are used to determine the sky lines offsets: with N slit rows, N independent offsets for each reference sky line are found; a new table is created, with columns containing the median offsets obtained for each reference sky line and for each slit. The [...]
+<p>For each slit, the median offsets are fitted by a polynomial relation that is then summed to all the IDS polynomials pertaining to that slit, modifying in this way the input <em>idscoeff</em> table. It is of course advisable not to go beyond a fitting polynomial of 0th or 1st order, unless many and well distributed reference sky lines are available within the specified range. Note that this way of proceeding is applied to avoid destroying the information about irregularities in the sl [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l09692">9692</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga2a7590eb0c36a08b61e08e180d7277d1"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_wavelength_align_lss           </td>
+          <td class="memname">cpl_table* mos_wavelength_align_lss </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>refwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>refwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>firstLambda</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>firstLambda</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>lastLambda</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>lastLambda</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>idscoeff</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>idscoeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_vector * </td>
-          <td class="paramname"> <em>skylines</em>, </td>
+          <td class="paramtype">cpl_vector * </td>
+          <td class="paramname"><em>skylines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>highres</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>highres</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>order</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>order</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>calibration</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>calibration</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>sradius</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>sradius</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Modify the input wavelength solution to match reference sky lines (LSS). 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image with rectified scientific spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>refwave</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>firstLambda</em> </td><td>Wavelength range start </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lastLambda</em> </td><td>Wavelength range end </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>idscoeff</em> </td><td>Table with IDS polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>skylines</em> </td><td>Vector with wavelengths of reference skylines </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>highres</em> </td><td>1 = High resolution, 0 = Low resolution </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>Order of sky lines offsets fitting polynomial </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>calibration</em> </td><td>Rectified wavelength calibration image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sradius</em> </td><td>Search radius for sky lines</td></tr>
+</div><div class="memdoc">
+
+<p>Modify the input wavelength solution to match reference sky lines (LSS). </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image with rectified scientific spectra </td></tr>
+    <tr><td class="paramname">refwave</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">firstLambda</td><td>Wavelength range start </td></tr>
+    <tr><td class="paramname">lastLambda</td><td>Wavelength range end </td></tr>
+    <tr><td class="paramname">idscoeff</td><td>Table with IDS polynomials </td></tr>
+    <tr><td class="paramname">skylines</td><td>Vector with wavelengths of reference skylines </td></tr>
+    <tr><td class="paramname">highres</td><td>1 = High resolution, 0 = Low resolution </td></tr>
+    <tr><td class="paramname">order</td><td>Order of sky lines offsets fitting polynomial </td></tr>
+    <tr><td class="paramname">calibration</td><td>Rectified wavelength calibration image </td></tr>
+    <tr><td class="paramname">sradius</td><td>Search radius for sky lines</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Table with measured sky lines offsets (in pixel)</dd></dl>
-The input <em>image</em> is the image of the scientific spectra with the spectral curvature removed, as produced by the function <code><a class="el" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration()</a></code>. The table <em>idscoeff</em> contains the polynomial fits coefficients obtained for each input <em>image</em> row, as produced by the function <code><a class="el" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibratio [...]
-More in detail: a "sky" spectrum is derived by computing the median spectrum, reducing in this way possible contamination by bright scientific object(s) contained in the image. All the IDS polynomials modelling the image are used to determine the sky lines offsets: with N image rows, N independent offsets for each reference sky line are found; a new table is created, with a column containing the median offsets obtained for each reference sky line and for each image row. This column is na [...]
-For each image row, the measured offsets are fitted by a polynomial relation of given <em>order</em>. The coefficients of all the obtained polynomial relations are then modeled as a function of the image row, and their modeled values are then summed to all the IDS polynomials modifying in this way the input <em>idscoeff</em> table. It is of course advisable not to go beyond a fitting polynomial of 0th or 1st order, unless many and well distributed reference sky lines are available within [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l10022">10022</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00321">peakPosition()</a>, and <a class="el" href="moses_8c-source.html#l00682">robustLinearFit()</a>.
-<p>
-Referenced by <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g8b5755fb4323c36b5aea3b4039e3d987"></a><!-- doxytag: member="moses.c::mos_distortions_rms" ref="g8b5755fb4323c36b5aea3b4039e3d987" args="(cpl_image *rectified, cpl_vector *lines, double wavestart, double dispersion, int radius, int highres)" -->
+<dl class="section return"><dt>Returns</dt><dd>Table with measured sky lines offsets (in pixel)</dd></dl>
+<p>The input <em>image</em> is the image of the scientific spectra with the spectral curvature removed, as produced by the function <code><a class="el" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration()</a></code>. The table <em>idscoeff</em> contains the polynomial fits coefficients obtained for each input <em>image</em> row, as produced by the function <code><a class="el" hre [...]
+<p>More in detail: a "sky" spectrum is derived by computing the median spectrum, reducing in this way possible contamination by bright scientific object(s) contained in the image. All the IDS polynomials modelling the image are used to determine the sky lines offsets: with N image rows, N independent offsets for each reference sky line are found; a new table is created, with a column containing the median offsets obtained for each reference sky line and for each image row. This column is [...]
+<p>For each image row, the measured offsets are fitted by a polynomial relation of given <em>order</em>. The coefficients of all the obtained polynomial relations are then modeled as a function of the image row, and their modeled values are then summed to all the IDS polynomials modifying in this way the input <em>idscoeff</em> table. It is of course advisable not to go beyond a fitting polynomial of 0th or 1st order, unless many and well distributed reference sky lines are available wit [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l10245">10245</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gae1dbf0de952775b1619a3c636221e2a2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double mos_distortions_rms           </td>
+          <td class="memname">double mos_distortions_rms </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>rectified</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>rectified</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_vector * </td>
-          <td class="paramname"> <em>lines</em>, </td>
+          <td class="paramtype">cpl_vector * </td>
+          <td class="paramname"><em>lines</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>wavestart</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>wavestart</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>radius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>radius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>highres</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>highres</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Estimate the spectral distortion modeling goodness. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>rectified</em> </td><td>Calibrated calibration image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lines</em> </td><td>Reference wavelengths (line catalog) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wavestart</em> </td><td>Wavelength of bluest (left) pixel in input image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Angstrom per pixel of input image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>radius</em> </td><td>Search radius (in pixels of input image) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>highres</em> </td><td>1 = high resolution data, 0 = low resolution data</td></tr>
+</div><div class="memdoc">
+
+<p>Estimate the spectral distortion modeling goodness. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">rectified</td><td>Calibrated calibration image </td></tr>
+    <tr><td class="paramname">lines</td><td>Reference wavelengths (line catalog) </td></tr>
+    <tr><td class="paramname">wavestart</td><td>Wavelength of bluest (left) pixel in input image </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Angstrom per pixel of input image </td></tr>
+    <tr><td class="paramname">radius</td><td>Search radius (in pixels of input image) </td></tr>
+    <tr><td class="paramname">highres</td><td>1 = high resolution data, 0 = low resolution data</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Mean RMS of residuals in pixels</dd></dl>
-The input <em>rectified</em> image is the product of either the functions <code><a class="el" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw()</a></code> and <code><a class="el" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final()</a></code> The RMS of the residuals between the expected positions of the arc lamp lines and the actual position of a detected peak is computed. The peak is searched within the  [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l10530">10530</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00321">peakPosition()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g76e55c10fdcb7d46b17fcea7c2f990a1"></a><!-- doxytag: member="moses.c::mos_map_pixel" ref="g76e55c10fdcb7d46b17fcea7c2f990a1" args="(cpl_table *idscoeff, double reference, double blue, double red, double dispersion, int trend)" -->
+<dl class="section return"><dt>Returns</dt><dd>Mean RMS of residuals in pixels</dd></dl>
+<p>The input <em>rectified</em> image is the product of either the functions <code><a class="el" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw()</a></code> and <code><a class="el" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb" title="Derive wavelength calibration from a rectified arc lamp or sky exposure.">mos_wavelength_calibration_final()</a></code> The R [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l10753">10753</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga6187454ef3812203ba2d50d1e2d01326"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_map_pixel           </td>
+          <td class="memname">cpl_image* mos_map_pixel </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>idscoeff</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>idscoeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reference</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reference</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>blue</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>blue</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>red</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>red</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>trend</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>trend</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create a pixel map from an IDS coefficients table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>idscoeff</em> </td><td>Table with IDS polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>Start lambda for spatial remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>End lambda for spatial remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Mean spectral dispersion </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>trend</em> </td><td>Trend to remove from IDS polynomials</td></tr>
+</div><div class="memdoc">
+
+<p>Create a pixel map from an IDS coefficients table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">idscoeff</td><td>Table with IDS polynomials </td></tr>
+    <tr><td class="paramname">reference</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">blue</td><td>Start lambda for spatial remapping </td></tr>
+    <tr><td class="paramname">red</td><td>End lambda for spatial remapping </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Mean spectral dispersion </td></tr>
+    <tr><td class="paramname">trend</td><td>Trend to remove from IDS polynomials</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Pixel map</dd></dl>
-The output pixel map will have the Y size equal to the number of rows in the <em>idscoeff</em> table. The X size is computed as (<em>red</em> - <em>blue</em>) / <em>dispersion</em>. With <em>trend</em> the number of polynomial coefficients to ignore in the computation can be specified. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l10667">10667</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g81b72d37c4c9090df07a8dd9a21b36ec"></a><!-- doxytag: member="moses.c::mos_map_idscoeff" ref="g81b72d37c4c9090df07a8dd9a21b36ec" args="(cpl_table *idscoeff, int xsize, double reference, double blue, double red)" -->
+<dl class="section return"><dt>Returns</dt><dd>Pixel map</dd></dl>
+<p>The output pixel map will have the Y size equal to the number of rows in the <em>idscoeff</em> table. The X size is computed as (<em>red</em> - <em>blue</em>) / <em>dispersion</em>. With <em>trend</em> the number of polynomial coefficients to ignore in the computation can be specified. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l10890">10890</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gacec86a61ea4c2b653a551eb067fbcfb5"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_map_idscoeff           </td>
+          <td class="memname">cpl_image* mos_map_idscoeff </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>idscoeff</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>idscoeff</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>xsize</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>xsize</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reference</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reference</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>blue</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>blue</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>red</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>red</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create a wavelengths map from an IDS coefficients table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>idscoeff</em> </td><td>Table with IDS polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>xsize</em> </td><td>X size of used CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>Start lambda for spatial remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>End lambda for spatial remapping</td></tr>
+</div><div class="memdoc">
+
+<p>Create a wavelengths map from an IDS coefficients table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">idscoeff</td><td>Table with IDS polynomials </td></tr>
+    <tr><td class="paramname">xsize</td><td>X size of used CCD </td></tr>
+    <tr><td class="paramname">reference</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">blue</td><td>Start lambda for spatial remapping </td></tr>
+    <tr><td class="paramname">red</td><td>End lambda for spatial remapping</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Wavelengths map</dd></dl>
-The output wavelength map will have the Y size equal to the number of rows in the <em>idscoeff</em> table. The input <em>xsize</em> will typically be the X size of the used detector. In general this should be identical to the X size of the arc lamp image from where the <em>idscoeff</em> table was derived. The wavelengths map is created by applying the inverses of the IDS polynomials to all the pixel positions of each output image row. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l10752">10752</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l04772">mos_eval_dds()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g7d8ae7b25a9d34a5af7255835e95ab90"></a><!-- doxytag: member="moses.c::mos_map_wavelengths" ref="g7d8ae7b25a9d34a5af7255835e95ab90" args="(cpl_image *spatial, cpl_image *calibration, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion)" -->
+<dl class="section return"><dt>Returns</dt><dd>Wavelengths map</dd></dl>
+<p>The output wavelength map will have the Y size equal to the number of rows in the <em>idscoeff</em> table. The input <em>xsize</em> will typically be the X size of the used detector. In general this should be identical to the X size of the arc lamp image from where the <em>idscoeff</em> table was derived. The wavelengths map is created by applying the inverses of the IDS polynomials to all the pixel positions of each output image row. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l10975">10975</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l04772">mos_eval_dds()</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga2255ec2a344cd3c6f579179c538669b7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_map_wavelengths           </td>
+          <td class="memname">cpl_image* mos_map_wavelengths </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spatial</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spatial</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>calibration</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>calibration</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>polytraces</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>polytraces</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reference</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reference</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>blue</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>blue</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>red</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>red</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Remapping of spatially rectified wavelengths to original CCD pixels. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spatial</em> </td><td>CCD image of spatial coordinates </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>calibration</em> </td><td>Spatially rectified image of wavelengths </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions on the CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>polytraces</em> </td><td>Coefficients of spectral curvature polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>Start lambda for spatial remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>End lambda for spatial remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Mean spectral dispersion</td></tr>
+</div><div class="memdoc">
+
+<p>Remapping of spatially rectified wavelengths to original CCD pixels. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spatial</td><td>CCD image of spatial coordinates </td></tr>
+    <tr><td class="paramname">calibration</td><td>Spatially rectified image of wavelengths </td></tr>
+    <tr><td class="paramname">slits</td><td>Slits positions on the CCD </td></tr>
+    <tr><td class="paramname">polytraces</td><td>Coefficients of spectral curvature polynomials </td></tr>
+    <tr><td class="paramname">reference</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">blue</td><td>Start lambda for spatial remapping </td></tr>
+    <tr><td class="paramname">red</td><td>End lambda for spatial remapping </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Mean spectral dispersion</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Wavelengths mapping on CCD.</dd></dl>
-The input <em>spatial</em> image is the one produced by the function <code><a class="el" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration()</a></code> (argument: <em>calibration</em>). It is expected to be oriented with horizontal dispersion direction and red wavelengths on the right side, and it should have the same x-length of the input <em>calibration</em> image. The <em>calibration</em> image is the one produced by the function <code><a class="el" hr [...]
-For each slit, each (x,y) coordinate on the <em>spatial</em> image is characterised by a spatial coordinate p. The wavelength at that spatial coordinate is derived by linear interpolation of the two wavelengths with the same coordinate x that are closer to p on the <em>calibration</em> image. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l10863">10863</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g2940e2350a3c050fc3bff7af0e621c37"></a><!-- doxytag: member="moses.c::mos_map_spectrum" ref="g2940e2350a3c050fc3bff7af0e621c37" args="(cpl_image *spectra, cpl_image *wavecalib, cpl_image *spatial, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion, int flux)" -->
+<dl class="section return"><dt>Returns</dt><dd>Wavelengths mapping on CCD.</dd></dl>
+<p>The input <em>spatial</em> image is the one produced by the function <code><a class="el" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration()</a></code> (argument: <em>calibration</em>). It is expected to be oriented with horizontal dispersion direction and red wavelengths on the right side, and it should have the same x-length of the input <em>calibration</em> image. The <em> [...]
+<p>For each slit, each (x,y) coordinate on the <em>spatial</em> image is characterised by a spatial coordinate p. The wavelength at that spatial coordinate is derived by linear interpolation of the two wavelengths with the same coordinate x that are closer to p on the <em>calibration</em> image. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l11086">11086</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga8525f2b52eb7ba887858420f36c53471"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_map_spectrum           </td>
+          <td class="memname">cpl_image* mos_map_spectrum </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spectra</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spectra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>wavecalib</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>wavecalib</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spatial</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spatial</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>polytraces</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>polytraces</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reference</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reference</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>blue</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>blue</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>red</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>red</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>flux</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>flux</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Remapping of slit spectra into a grid of lambda-space coordinates. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectra</em> </td><td>CCD image containing the observed slit spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wavecalib</em> </td><td>CCD image of wavelengths </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>spatial</em> </td><td>CCD image of spatial coordinates </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions on the CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>polytraces</em> </td><td>Coefficients of spectral curvature polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>Start lambda for remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>End lambda for remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Mean spectral dispersion </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>flux</em> </td><td>flux = 0 means no flux conservation correction applied</td></tr>
+</div><div class="memdoc">
+
+<p>Remapping of slit spectra into a grid of lambda-space coordinates. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectra</td><td>CCD image containing the observed slit spectra </td></tr>
+    <tr><td class="paramname">wavecalib</td><td>CCD image of wavelengths </td></tr>
+    <tr><td class="paramname">spatial</td><td>CCD image of spatial coordinates </td></tr>
+    <tr><td class="paramname">slits</td><td>Slits positions on the CCD </td></tr>
+    <tr><td class="paramname">polytraces</td><td>Coefficients of spectral curvature polynomials </td></tr>
+    <tr><td class="paramname">reference</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">blue</td><td>Start lambda for remapping </td></tr>
+    <tr><td class="paramname">red</td><td>End lambda for remapping </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Mean spectral dispersion </td></tr>
+    <tr><td class="paramname">flux</td><td>flux = 0 means no flux conservation correction applied</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Extracted slit spectra</dd></dl>
-DO NOT USE THIS FUNCTION, IT GIVES BAD RESULTS (and it should be eventually removed).<p>
-The input <em>wavecalib</em> image is the one returned by the function <code><a class="el" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths()</a></code> or, if this is not available, the approximate one returned by the function <em><a class="el" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw()</a></em>. The input <em>spatial</em> image is the one produced by the function <code><a class="el" href="group__moses.html#g [...]
-The target grid in lambda and pseudo spatial coordinates is defined on the basis of the indicated spectral range and dispersion, while the number of spatial pixels assigned to each slits are compatible with the positions listed in the <em>slits</em> table (column "position") following the convention used in the rest of the spectral reduction, in particular the functions <em><a class="el" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration()</a></em> and <co [...]
-Indicating with (x,y) a pixel position on the CCD, and with (L,S) a pixel position on one extracted slit, the mapping from (x,y) to (L,S) is done in the following way (for each slit): for each (x,y) read the corresponding value of lambda and space from the input images <em>wavecalib</em> and <em>spatial</em>; find the pixel (L,S) on the output (remapped) slit that has the highest lambda and space that are less than the lambda and space obtained above; read the values of the following CCD [...]
-The pixel value to assign to the pixel (L,S) is computed by linear interpolation to its corresponding (x',y') position of the 4 pixel values (horizontal interpolation followed by vertical interpolation of the interpolated values). The corresponding flux-conservation factor, if requested, is computed as (dL/dx)*(dS/dy). The interpolated value is multiplied by this factor before being written to the pixel (L,S).<p>
-DO NOT USE THIS FUNCTION, IT GIVES BAD RESULTS (and it should be eventually removed). 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l11213">11213</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="gdc24afa605f14e0bbd66884de984a1f1"></a><!-- doxytag: member="moses.c::mos_sky_map_super" ref="gdc24afa605f14e0bbd66884de984a1f1" args="(cpl_image *spectra, cpl_image *wavemap, double dispersion, double factor, int minpoints, cpl_image *skymap)" -->
+<dl class="section return"><dt>Returns</dt><dd>Extracted slit spectra</dd></dl>
+<p>DO NOT USE THIS FUNCTION, IT GIVES BAD RESULTS (and it should be eventually removed).</p>
+<p>The input <em>wavecalib</em> image is the one returned by the function <code><a class="el" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths()</a></code> or, if this is not available, the approximate one returned by the function <em><a class="el" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure."> [...]
+<p>The target grid in lambda and pseudo spatial coordinates is defined on the basis of the indicated spectral range and dispersion, while the number of spatial pixels assigned to each slits are compatible with the positions listed in the <em>slits</em> table (column "position") following the convention used in the rest of the spectral reduction, in particular the functions <em><a class="el" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectr [...]
+<p>Indicating with (x,y) a pixel position on the CCD, and with (L,S) a pixel position on one extracted slit, the mapping from (x,y) to (L,S) is done in the following way (for each slit): for each (x,y) read the corresponding value of lambda and space from the input images <em>wavecalib</em> and <em>spatial</em>; find the pixel (L,S) on the output (remapped) slit that has the highest lambda and space that are less than the lambda and space obtained above; read the values of the following  [...]
+geometry"). Typically, it will always be N = 0.</p>
+<p>The pixel value to assign to the pixel (L,S) is computed by linear interpolation to its corresponding (x',y') position of the 4 pixel values (horizontal interpolation followed by vertical interpolation of the interpolated values). The corresponding flux-conservation factor, if requested, is computed as (dL/dx)*(dS/dy). The interpolated value is multiplied by this factor before being written to the pixel (L,S).</p>
+<p>DO NOT USE THIS FUNCTION, IT GIVES BAD RESULTS (and it should be eventually removed). </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l11436">11436</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga80b4941dee0d34102ac3d4f5fb15674d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_sky_map_super           </td>
+          <td class="memname">cpl_table* mos_sky_map_super </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spectra</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spectra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>wavemap</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>wavemap</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>factor</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>factor</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>minpoints</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>minpoints</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>skymap</em></td><td> </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>skymap</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create a CCD median sky map. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectra</em> </td><td>CCD image of spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wavemap</em> </td><td>CCD image of wavelengths </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Mean spectral dispersion </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>factor</em> </td><td>Supersampling factor </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>minpoints</em> </td><td>Minimum points required per supersampled spectrum bin </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>skymap</em> </td><td>Returned CCD image of sky</td></tr>
+</div><div class="memdoc">
+
+<p>Create a CCD median sky map. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectra</td><td>CCD image of spectra </td></tr>
+    <tr><td class="paramname">wavemap</td><td>CCD image of wavelengths </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Mean spectral dispersion </td></tr>
+    <tr><td class="paramname">factor</td><td>Supersampling factor </td></tr>
+    <tr><td class="paramname">minpoints</td><td>Minimum points required per supersampled spectrum bin </td></tr>
+    <tr><td class="paramname">skymap</td><td>Returned CCD image of sky</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Table with median sky spectrum</dd></dl>
-The spectra contained in the input image, <em>spectra</em>, taken all together are assumed to contain at least 50% of their pixels on the sky. Moreover, all slits are assumed to have the same width. The CCD image of wavelengths, <em>wavemap</em>, is the one produced by the function <code><a class="el" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final()</a></code>, possibly modified by the function <code><a class="el" href="group__moses.html#gc455 [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l11625">11625</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g21b37cf8c1fd568441a55740d34e2371"></a><!-- doxytag: member="moses.c::mos_sky_map" ref="g21b37cf8c1fd568441a55740d34e2371" args="(cpl_image *spectra, cpl_image *wavemap, double dispersion, cpl_image *skymap)" -->
+<dl class="section return"><dt>Returns</dt><dd>Table with median sky spectrum</dd></dl>
+<p>The spectra contained in the input image, <em>spectra</em>, taken all together are assumed to contain at least 50% of their pixels on the sky. Moreover, all slits are assumed to have the same width. The CCD image of wavelengths, <em>wavemap</em>, is the one produced by the function <code><a class="el" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb" title="Derive wavelength calibration from a rectified arc lamp or sky exposure.">mos_wavelength_calibration_final()</a></code> [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l11848">11848</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gab724daebffef27587b8183a6d765dc02"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_sky_map           </td>
+          <td class="memname">cpl_table* mos_sky_map </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spectra</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spectra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>wavemap</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>wavemap</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>skymap</em></td><td> </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>skymap</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create a CCD median sky map. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectra</em> </td><td>CCD image of spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wavemap</em> </td><td>CCD image of wavelengths </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Mean spectral dispersion </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>skymap</em> </td><td>Returned CCD image of sky</td></tr>
+</div><div class="memdoc">
+
+<p>Create a CCD median sky map. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectra</td><td>CCD image of spectra </td></tr>
+    <tr><td class="paramname">wavemap</td><td>CCD image of wavelengths </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Mean spectral dispersion </td></tr>
+    <tr><td class="paramname">skymap</td><td>Returned CCD image of sky</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Table with median sky spectrum</dd></dl>
-The spectra contained in the input image, <em>spectra</em>, taken all together are assumed to contain at least 50% of their pixels on the sky. Moreover, all slits are assumed to have the same width. The CCD image of wavelengths, <em>wavemap</em>, is the one produced by the function <code><a class="el" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final()</a></code>, possibly modified by the function <code><a class="el" href="group__moses.html#gc455 [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l11958">11958</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
+<dl class="section return"><dt>Returns</dt><dd>Table with median sky spectrum</dd></dl>
+<p>The spectra contained in the input image, <em>spectra</em>, taken all together are assumed to contain at least 50% of their pixels on the sky. Moreover, all slits are assumed to have the same width. The CCD image of wavelengths, <em>wavemap</em>, is the one produced by the function <code><a class="el" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb" title="Derive wavelength calibration from a rectified arc lamp or sky exposure.">mos_wavelength_calibration_final()</a></code> [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l12181">12181</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gd9e2f1aa21dd9dc492c74052ea0a560a"></a><!-- doxytag: member="moses.c::mos_sky_local_old" ref="gd9e2f1aa21dd9dc492c74052ea0a560a" args="(cpl_image *spectra, cpl_table *slits)" -->
+</div>
+<a class="anchor" id="ga0185eec52be96d5aa325e8fd045406c8"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_sky_local_old           </td>
+          <td class="memname">cpl_image* mos_sky_local_old </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spectra</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spectra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em></td><td> </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Local determination of sky. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectra</em> </td><td>Rectified image of scientific spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions table</td></tr>
+<p>Local determination of sky. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectra</td><td>Rectified image of scientific spectra </td></tr>
+    <tr><td class="paramname">slits</td><td>Slits positions table</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Image of (rectified) sky</dd></dl>
-Each slit spectrum contained in the input image, <em>spectra</em>, is assumed to contain at least 50% of its pixels on the sky. The median level at each wavelength is determined, and the sky map generated in this way is returned. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l12200">12200</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g7cb83f67ed6d349ade9e38e7ed62f6fb"></a><!-- doxytag: member="moses.c::mos_sky_local" ref="g7cb83f67ed6d349ade9e38e7ed62f6fb" args="(cpl_image *spectra, cpl_table *slits, int order)" -->
+<dl class="section return"><dt>Returns</dt><dd>Image of (rectified) sky</dd></dl>
+<p>Each slit spectrum contained in the input image, <em>spectra</em>, is assumed to contain at least 50% of its pixels on the sky. The median level at each wavelength is determined, and the sky map generated in this way is returned. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l12423">12423</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga40e43aa1516aac5fc7e2ccc41381677d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_sky_local           </td>
+          <td class="memname">cpl_image* mos_sky_local </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spectra</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spectra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>order</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>order</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Local determination of sky. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectra</em> </td><td>Rectified image of scientific spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>Order of the polynomial fitting the sky.</td></tr>
+</div><div class="memdoc">
+
+<p>Local determination of sky. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectra</td><td>Rectified image of scientific spectra </td></tr>
+    <tr><td class="paramname">slits</td><td>Slits positions table </td></tr>
+    <tr><td class="paramname">order</td><td>Order of the polynomial fitting the sky.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Image of (rectified) sky</dd></dl>
-The median level at each wavelength is determined and subtracted from the data. The position and extension of the objects is detected and the rest of the pixels are flagged as sky, and used for the final determination of the sky level at each wavelength. If the <em>order</em> of the sky-fitting polynomial is zero the median sky level is determined, otherwise a fit with outliers rejection is applied. The sky map generated in this way is returned. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l12302">12302</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l13427">mos_detect_objects()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g274cdc673e0d1684d9a730773a526115"></a><!-- doxytag: member="moses.c::mos_clean_cosmics" ref="g274cdc673e0d1684d9a730773a526115" args="(cpl_image *image, float gain, float threshold, float ratio)" -->
+<dl class="section return"><dt>Returns</dt><dd>Image of (rectified) sky</dd></dl>
+<p>The median level at each wavelength is determined and subtracted from the data. The position and extension of the objects is detected and the rest of the pixels are flagged as sky, and used for the final determination of the sky level at each wavelength. If the <em>order</em> of the sky-fitting polynomial is zero the median sky level is determined, otherwise a fit with outliers rejection is applied. The sky map generated in this way is returned. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l12525">12525</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l13650">mos_detect_objects()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga1063de1ae8b4d345ea9ccf584e3a5f1a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_clean_cosmics           </td>
+          <td class="memname">cpl_error_code mos_clean_cosmics </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">float </td>
-          <td class="paramname"> <em>gain</em>, </td>
+          <td class="paramtype">float </td>
+          <td class="paramname"><em>gain</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">float </td>
-          <td class="paramname"> <em>threshold</em>, </td>
+          <td class="paramtype">float </td>
+          <td class="paramname"><em>threshold</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">float </td>
-          <td class="paramname"> <em>ratio</em></td><td> </td>
+          <td class="paramtype">float </td>
+          <td class="paramname"><em>ratio</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Remove cosmic rays from sky-subtracted CCD spectral exposure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Input image to be cleaned (in ADU) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>gain</em> </td><td>Inverse gain factor (e-/ADU) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>threshold</em> </td><td>Threshold for cosmics detection, given in noise sigmas </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ratio</em> </td><td>Ratio for discrimination between objects and cosmics</td></tr>
+</div><div class="memdoc">
+
+<p>Remove cosmic rays from sky-subtracted CCD spectral exposure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Input image to be cleaned (in ADU) </td></tr>
+    <tr><td class="paramname">gain</td><td>Inverse gain factor (e-/ADU) </td></tr>
+    <tr><td class="paramname">threshold</td><td>Threshold for cosmics detection, given in noise sigmas </td></tr>
+    <tr><td class="paramname">ratio</td><td>Ratio for discrimination between objects and cosmics</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> in case of success</dd></dl>
-If <em>treshold</em> is negative, it is assigned the value 4.0. If <em>ratio</em> is negative, it is assigned the value 2.0. The algorithm used is the same of the MIDAS command FILTER/COSMIC. This function should be used to process not-rectified spectral exposures from where the sky spectrum was already subtracted. Cosmics are not cleaned if either x or y size of the image is not greater than 3: in this case the function returns without setting an error. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l12657">12657</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l12966">mos_clean_bad_pixels()</a>.
-<p>
-Referenced by <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="ge8df117eba59d1599f3172975b6f7139"></a><!-- doxytag: member="moses.c::mos_spatial_map" ref="ge8df117eba59d1599f3172975b6f7139" args="(cpl_image *spectra, cpl_table *slits, cpl_table *polytraces, double reference, double blue, double red, double dispersion)" -->
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> in case of success</dd></dl>
+<p>If <em>treshold</em> is negative, it is assigned the value 4.0. If <em>ratio</em> is negative, it is assigned the value 2.0. The algorithm used is the same of the MIDAS command FILTER/COSMIC. This function should be used to process not-rectified spectral exposures from where the sky spectrum was already subtracted. Cosmics are not cleaned if either x or y size of the image is not greater than 3: in this case the function returns without setting an error. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l12880">12880</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga4592493a392e23ebc56259ed3bfc0719"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_spatial_map           </td>
+          <td class="memname">cpl_image* mos_spatial_map </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spectra</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spectra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>polytraces</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>polytraces</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>reference</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>reference</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>blue</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>blue</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>red</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>red</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create coordinate map from spectral curvature table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectra</em> </td><td>CCD image of spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits positions on the CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>polytraces</em> </td><td>Coefficients of spectral curvature polynomials </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>blue</em> </td><td>Start lambda for spatial remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>red</em> </td><td>End lambda for spatial remapping </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Mean spectral dispersion</td></tr>
+</div><div class="memdoc">
+
+<p>Create coordinate map from spectral curvature table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectra</td><td>CCD image of spectra </td></tr>
+    <tr><td class="paramname">slits</td><td>Slits positions on the CCD </td></tr>
+    <tr><td class="paramname">polytraces</td><td>Coefficients of spectral curvature polynomials </td></tr>
+    <tr><td class="paramname">reference</td><td>Reference wavelength </td></tr>
+    <tr><td class="paramname">blue</td><td>Start lambda for spatial remapping </td></tr>
+    <tr><td class="paramname">red</td><td>End lambda for spatial remapping </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Mean spectral dispersion</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Coordinate map</dd></dl>
-The input <em>spectra</em> image is expected to be oriented with horizontal dispersion direction and red wavelengths on the right side, and it should be of type <code>CPL_TYPE_FLOAT</code>. The <em>slits</em> table should be the output of either the function <code><a class="el" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits()</a></code> (if available) or the function <code><a class="el" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_s [...]
-The returned image image has the same size of the input <em>spectra</em> image, and it will consist of pixels having the value of their spatial coordinate along the slit they belong to, or the value zero if the pixels do not belong to any spectrum. The original y pixel positions (at a given x) are assigned the value of their distance from the top spectral trace measured in CCD pixels. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l13161">13161</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="gb188299284e0b06070798cd2e80427af"></a><!-- doxytag: member="moses.c::mos_detect_objects" ref="gb188299284e0b06070798cd2e80427af" args="(cpl_image *image, cpl_table *slits, int margin, int maxradius, int conradius)" -->
+<dl class="section return"><dt>Returns</dt><dd>Coordinate map</dd></dl>
+<p>The input <em>spectra</em> image is expected to be oriented with horizontal dispersion direction and red wavelengths on the right side, and it should be of type <code>CPL_TYPE_FLOAT</code>. The <em>slits</em> table should be the output of either the function <code><a class="el" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits()</a></code> (if available) or the function <code><a class="el" href="group [...]
+<p>The returned image image has the same size of the input <em>spectra</em> image, and it will consist of pixels having the value of their spatial coordinate along the slit they belong to, or the value zero if the pixels do not belong to any spectrum. The original y pixel positions (at a given x) are assigned the value of their distance from the top spectral trace measured in CCD pixels. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l13384">13384</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga8615d071f23f2cd00eeebea1062163c7"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_detect_objects           </td>
+          <td class="memname">cpl_image* mos_detect_objects </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>margin</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>margin</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>maxradius</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>maxradius</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>conradius</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>conradius</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Detect objects in rectified scientific frame. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Rectified image of scientific spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Table with slits positions </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>margin</em> </td><td>Number of pixels to exclude at slits edges </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>maxradius</em> </td><td>Maximum extraction radius </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>conradius</em> </td><td>Contamination radius</td></tr>
+</div><div class="memdoc">
+
+<p>Detect objects in rectified scientific frame. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Rectified image of scientific spectra </td></tr>
+    <tr><td class="paramname">slits</td><td>Table with slits positions </td></tr>
+    <tr><td class="paramname">margin</td><td>Number of pixels to exclude at slits edges </td></tr>
+    <tr><td class="paramname">maxradius</td><td>Maximum extraction radius </td></tr>
+    <tr><td class="paramname">conradius</td><td>Contamination radius</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>Slits</code> mean flux spatial profile</dd></dl>
-This function upgrades the input <em>slits</em> position table with the positions of the objects detected within each slit, and their corresponding extraction intervals. The object positions are listed in columns labeled "object_1", "object_2", etc., while the start and end positions of the extraction interval are marked with "start_1", "start_2", ... and "end_1", "end_2", etc., where the pixel coordinate is counted starting from the bottom position of the slit. Objects are not searched  [...]
-The algorithm applied is based on the relative peak intensity of each detected object. First of all, a peak is identified by a positive value that is preceded and followed by two lower positive values that decrease with distance. Also the first and the last (valid) spatial pixel of a slit is considered a peak, if followed or preceded by decreasing pixels, to keep it into account in the computation of the contaminations, but it is never extracted in the end. Each peak is compared with all [...]
-</pre></div> is computed, where C is the indicated contamination radius, <em>conradius</em>, that represents the minimum distance at which two point-like object of equal luminosity can stay without contaminating each others (a typical value for this parameter may be 16 pixels). If the distance between the two peaks is less than S, the examined peak is flagged as contaminated, and is excluded from the <em>final</em> list of detected objects. This empirical formula has the effect of assign [...]
-</pre></div> where P_i is the position of the i-th peak, L_i its peak value, and j = i + 1. The position of the lower limit of the first object is set at the top border of the slit, excluding the number of pixels indicated by the <em>margin</em> argument. Analogously, the position of the upper limit of the last object is set at the bottom border of the slit, excluding the same number of pixels. Finally, the extraction borders exceeding <em>maxradius</em> are corrected accordingly. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l13427">13427</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00475">values_to_dx()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l12302">mos_sky_local()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="geecf611c458a0b9645edad66538ad6e2"></a><!-- doxytag: member="moses.c::mos_extract_objects" ref="geecf611c458a0b9645edad66538ad6e2" args="(cpl_image *science, cpl_image *sky, cpl_table *objects, int extraction, double ron, double gain, int ncombined)" -->
+<dl class="section return"><dt>Returns</dt><dd><code>Slits</code> mean flux spatial profile</dd></dl>
+<p>This function upgrades the input <em>slits</em> position table with the positions of the objects detected within each slit, and their corresponding extraction intervals. The object positions are listed in columns labeled "object_1", "object_2", etc., while the start and end positions of the extraction interval are marked with "start_1", "start_2", ... and "end_1", "end_2", etc., where the pixel coordinate is counted starting from the bottom position of the slit. Objects are not search [...]
+<p>The algorithm applied is based on the relative peak intensity of each detected object. First of all, a peak is identified by a positive value that is preceded and followed by two lower positive values that decrease with distance. Also the first and the last (valid) spatial pixel of a slit is considered a peak, if followed or preceded by decreasing pixels, to keep it into account in the computation of the contaminations, but it is never extracted in the end. Each peak is compared with  [...]
+<div class="fragment"><div class="line">S = C * (L / L_o)</div>
+</div><!-- fragment --><p> is computed, where C is the indicated contamination radius, <em>conradius</em>, that represents the minimum distance at which two point-like object of equal luminosity can stay without contaminating each others (a typical value for this parameter may be 16 pixels). If the distance between the two peaks is less than S, the examined peak is flagged as contaminated, and is excluded from the <em>final</em> list of detected objects. This empirical formula has the ef [...]
+<div class="fragment"><div class="line">B_i = (P_i * L_j + P_j * L_i) / (L_i + L_j)</div>
+</div><!-- fragment --><p> where P_i is the position of the i-th peak, L_i its peak value, and j = i + 1. The position of the lower limit of the first object is set at the top border of the slit, excluding the number of pixels indicated by the <em>margin</em> argument. Analogously, the position of the upper limit of the last object is set at the bottom border of the slit, excluding the same number of pixels. Finally, the extraction borders exceeding <em>maxradius</em> are corrected accor [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l13650">13650</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l12525">mos_sky_local()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga28ce64beccf31d6c0274db1dd4c8b522"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image** mos_extract_objects           </td>
+          <td class="memname">cpl_image** mos_extract_objects </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>science</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>science</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>sky</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>sky</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>objects</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>objects</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>extraction</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>extraction</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ron</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ron</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>gain</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>gain</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ncombined</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ncombined</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Extract detected objects from rectified scientific frame. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>science</em> </td><td>Rectified and sky subtracted scientific spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>sky</em> </td><td>Rectified sky spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>objects</em> </td><td>Spectra and objects position table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>extraction</em> </td><td>Extraction mode: 0 = aperture, 1 = optimal (Horne) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ron</em> </td><td>Read-out-noise in ADU </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>gain</em> </td><td>Conversion from ADU to electrons (e-/ADU) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ncombined</em> </td><td>Number of combined scientific frames</td></tr>
+</div><div class="memdoc">
+
+<p>Extract detected objects from rectified scientific frame. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">science</td><td>Rectified and sky subtracted scientific spectra </td></tr>
+    <tr><td class="paramname">sky</td><td>Rectified sky spectra </td></tr>
+    <tr><td class="paramname">objects</td><td>Spectra and objects position table </td></tr>
+    <tr><td class="paramname">extraction</td><td>Extraction mode: 0 = aperture, 1 = optimal (Horne) </td></tr>
+    <tr><td class="paramname">ron</td><td>Read-out-noise in ADU </td></tr>
+    <tr><td class="paramname">gain</td><td>Conversion from ADU to electrons (e-/ADU) </td></tr>
+    <tr><td class="paramname">ncombined</td><td>Number of combined scientific frames</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>Images</code> with extracted science, sky, and error spectra</dd></dl>
-The objects spatial extraction intervals are those listed in the input <em>objects</em> table produced by the function <code><a class="el" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects()</a></code>. The arguments <em>ron</em>, <em>gain</em>, and <em>ncombined</em> are used only in case the <em>extraction</em> mode is set to 1 (optimal extraction). The optimal extraction is based on Horne, K., (1986), PASP, 98, 609. If the <em>science</em> and <em>science_s [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l13778">13778</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00913">mos_extraction()</a>, and <a class="el" href="list_8c-source.html#l00077">list::size</a>.
-<p>
-Referenced by <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g9dab2e2448ef188d7f8fddd02483d919"></a><!-- doxytag: member="moses.c::mos_spectral_resolution" ref="g9dab2e2448ef188d7f8fddd02483d919" args="(cpl_image *image, double lambda, double startwave, double dispersion, int saturation, double *mfwhm, double *rmsfwhm, double *resolution, double *rmsres, int *nlines)" -->
+<dl class="section return"><dt>Returns</dt><dd><code>Images</code> with extracted science, sky, and error spectra</dd></dl>
+<p>The objects spatial extraction intervals are those listed in the input <em>objects</em> table produced by the function <code><a class="el" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects()</a></code>. The arguments <em>ron</em>, <em>gain</em>, and <em>ncombined</em> are used only in case the <em>extraction</em> mode is set to 1 (optimal extraction). The optimal extraction is based on Horne, K., (1986) [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l14001">14001</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga58039ea48fa183baf1701567781ad128"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int mos_spectral_resolution           </td>
+          <td class="memname">int mos_spectral_resolution </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>lambda</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>lambda</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>startwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>startwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>saturation</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>saturation</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>mfwhm</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>mfwhm</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>rmsfwhm</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>rmsfwhm</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>resolution</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>resolution</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>rmsres</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>rmsres</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>nlines</em></td><td> </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>nlines</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Compute mean spectral resolution at a given arc lamp line. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Rectified and wavelength calibrated arc lamp image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lambda</em> </td><td>Wavelength to examine </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>startwave</em> </td><td>Shortest wavelength in image. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Wavelength units per image pixel </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>saturation</em> </td><td>Saturation value </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>mfwhm</em> </td><td>Returned: median FWHM </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>rmsfwhm</em> </td><td>Returned: RMS of median FWHM </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>resolution</em> </td><td>Returned: spectral resolution </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>rmsres</em> </td><td>Returned: RMS of spectral resolution </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nlines</em> </td><td>Returned: Number of examined line profiles</td></tr>
+</div><div class="memdoc">
+
+<p>Compute mean spectral resolution at a given arc lamp line. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Rectified and wavelength calibrated arc lamp image </td></tr>
+    <tr><td class="paramname">lambda</td><td>Wavelength to examine </td></tr>
+    <tr><td class="paramname">startwave</td><td>Shortest wavelength in image. </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Wavelength units per image pixel </td></tr>
+    <tr><td class="paramname">saturation</td><td>Saturation value </td></tr>
+    <tr><td class="paramname">mfwhm</td><td>Returned: median FWHM </td></tr>
+    <tr><td class="paramname">rmsfwhm</td><td>Returned: RMS of median FWHM </td></tr>
+    <tr><td class="paramname">resolution</td><td>Returned: spectral resolution </td></tr>
+    <tr><td class="paramname">rmsres</td><td>Returned: RMS of spectral resolution </td></tr>
+    <tr><td class="paramname">nlines</td><td>Returned: Number of examined line profiles</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>1 in case of success, 0 in case of failure</dd></dl>
-Given a wavelength, determine spectral resolution from a given arc lamp line. A high S/N is assumed (virtually no noise). Working with 2D extracted images! 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l13982">13982</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l03768">mos_lines_width()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l14178">mos_resolution_table()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gb3eb0708cf40541643d8169f3f6d3b55"></a><!-- doxytag: member="moses.c::mos_resolution_table" ref="gb3eb0708cf40541643d8169f3f6d3b55" args="(cpl_image *image, double startwave, double dispersion, int saturation, cpl_vector *lines)" -->
+<dl class="section return"><dt>Returns</dt><dd>1 in case of success, 0 in case of failure</dd></dl>
+<p>Given a wavelength, determine spectral resolution from a given arc lamp line. A high S/N is assumed (virtually no noise). Working with 2D extracted images! </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l14204">14204</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l03768">mos_lines_width()</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l14400">mos_resolution_table()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gae9f633b64e1880984c084a19f53047fc"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_resolution_table           </td>
+          <td class="memname">cpl_table* mos_resolution_table </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>startwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>startwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>saturation</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>saturation</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_vector * </td>
-          <td class="paramname"> <em>lines</em></td><td> </td>
+          <td class="paramtype">cpl_vector * </td>
+          <td class="paramname"><em>lines</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Compute mean spectral resolution at a given arc lamp line. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Rectified and wavelength calibrated arc lamp image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>startwave</em> </td><td>Shortest wavelength in image. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Wavelength units per image pixel </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>saturation</em> </td><td>Saturation value </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lines</em> </td><td>Line catalog</td></tr>
+</div><div class="memdoc">
+
+<p>Compute mean spectral resolution at a given arc lamp line. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Rectified and wavelength calibrated arc lamp image </td></tr>
+    <tr><td class="paramname">startwave</td><td>Shortest wavelength in image. </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Wavelength units per image pixel </td></tr>
+    <tr><td class="paramname">saturation</td><td>Saturation value </td></tr>
+    <tr><td class="paramname">lines</td><td>Line catalog</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Spectral resolution table</dd></dl>
-This function loops on the function <code><a class="el" href="group__moses.html#g9dab2e2448ef188d7f8fddd02483d919">mos_spectral_resolution()</a></code> for each line of the input line catalog, and creates a spectral resolution table. This table has a column "wavelength" listing the line catalog wavelengths, a column "resolution" containing the corresponding mean spectral resolutions, a column "rms" with the population standard deviation of the measured resolutions, and a column "nlines"  [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l14178">14178</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l13982">mos_spectral_resolution()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g51c4d941feada9601c3e391058f4e653"></a><!-- doxytag: member="moses.c::mos_integrate_signal" ref="g51c4d941feada9601c3e391058f4e653" args="(cpl_image *image, cpl_image *wavemap, int ystart, int yend, double wstart, double wend)" -->
+<dl class="section return"><dt>Returns</dt><dd>Spectral resolution table</dd></dl>
+<p>This function loops on the function <code><a class="el" href="group__moses.html#ga58039ea48fa183baf1701567781ad128" title="Compute mean spectral resolution at a given arc lamp line.">mos_spectral_resolution()</a></code> for each line of the input line catalog, and creates a spectral resolution table. This table has a column "wavelength" listing the line catalog wavelengths, a column "resolution" containing the corresponding mean spectral resolutions, a column "rms" with the population [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l14400">14400</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l14204">mos_spectral_resolution()</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaba740d24473d57d687f75787e4ecc835"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double mos_integrate_signal           </td>
+          <td class="memname">double mos_integrate_signal </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>wavemap</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>wavemap</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ystart</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ystart</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>yend</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>yend</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>wstart</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>wstart</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>wend</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>wend</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Integrate signal from wavelength and spatial interval. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>CCD exposure </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wavemap</em> </td><td>Wavelengths map of CCD exposure </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ystart</em> </td><td>Start Y-pixel coordinate on CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>yend</em> </td><td>End Y-pixel coordinate on CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wstart</em> </td><td>Start wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>wend</em> </td><td>End wavelength</td></tr>
+</div><div class="memdoc">
+
+<p>Integrate signal from wavelength and spatial interval. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>CCD exposure </td></tr>
+    <tr><td class="paramname">wavemap</td><td>Wavelengths map of CCD exposure </td></tr>
+    <tr><td class="paramname">ystart</td><td>Start Y-pixel coordinate on CCD </td></tr>
+    <tr><td class="paramname">yend</td><td>End Y-pixel coordinate on CCD </td></tr>
+    <tr><td class="paramname">wstart</td><td>Start wavelength </td></tr>
+    <tr><td class="paramname">wend</td><td>End wavelength</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Integrated signal</dd></dl>
-This function sum the signal in the specified interval. <em>ystart</em> is inclusive and <em>wend</em> exclusive. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l14250">14250</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
+<dl class="section return"><dt>Returns</dt><dd>Integrated signal</dd></dl>
+<p>This function sum the signal in the specified interval. <em>ystart</em> is inclusive and <em>wend</em> exclusive. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l14472">14472</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gc6b743c5c9a5e989abe61ab698df148f"></a><!-- doxytag: member="moses.c::mos_load_slits_fors_mxu" ref="gc6b743c5c9a5e989abe61ab698df148f" args="(cpl_propertylist *header)" -->
+<a class="anchor" id="ga2c9ae818bb4b07cf99dc5ae8e9e78d9c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_load_slits_fors_mxu           </td>
+          <td class="memname">cpl_table* mos_load_slits_fors_mxu </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Create slit location table from FITS header of FORS2-MXU data. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>FITS header of FORS data containing slits information</td></tr>
+<p>Create slit location table from FITS header of FORS2-MXU data. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>FITS header of FORS data containing slits information</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>A slit position table</dd></dl>
-This function is meant to convert the information contained in FORS2 MXU data FITS header into a slit position table. This table will contain the double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end coordinates of the slits on the telescope focal plane (mask). The coordinates are expected to have a horizontal dispersion direction and red wavelengths on the right side. A flip to the Y coordinate is applied to m [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l14338">14338</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="test__simulate_8c-source.html#l00103">instrume</a>.
-</div>
-</div><p>
-<a class="anchor" name="g1786e7d23b46b135a98deb03986916a4"></a><!-- doxytag: member="moses.c::mos_load_slits_fors_mos" ref="g1786e7d23b46b135a98deb03986916a4" args="(cpl_propertylist *header, int *nslits_out_det)" -->
+<dl class="section return"><dt>Returns</dt><dd>A slit position table</dd></dl>
+<p>This function is meant to convert the information contained in FORS2 MXU data FITS header into a slit position table. This table will contain the double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end coordinates of the slits on the telescope focal plane (mask). The coordinates are expected to have a horizontal dispersion direction and red wavelengths on the right side. A flip to the Y coordinate is applied t [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l14560">14560</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gae0112d43e53bdf0d3ba6d628473e17b8"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_load_slits_fors_mos           </td>
+          <td class="memname">cpl_table* mos_load_slits_fors_mos </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>nslits_out_det</em></td><td> </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>nslits_out_det</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Create slit location table from FITS header of FORS1/2 MOS data. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>FITS header of FORS data containing slits information </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nslits_out_det</em> </td><td>Number of slits which don't lie in the detector</td></tr>
+<p>Create slit location table from FITS header of FORS1/2 MOS data. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>FITS header of FORS data containing slits information </td></tr>
+    <tr><td class="paramname">nslits_out_det</td><td>Number of slits which don't lie in the detector</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>A slit position table</dd></dl>
-This function is meant to convert the information contained in FORS1 and FORS2 MOS data FITS header into a slit position table. This table will contain the double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end coordinates of the slits on the telescope focal plane (mask). The coordinates are expected to have a horizontal dispersion direction and red wavelengths on the right side. A flip to the Y coordinate is ap [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l14578">14578</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="test__simulate_8c-source.html#l00103">instrume</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l16646">mos_load_slits_fors_pmos()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g9ed25f68a53a8daa15d3c986e7bdfa48"></a><!-- doxytag: member="moses.c::mos_load_slits_fors_lss" ref="g9ed25f68a53a8daa15d3c986e7bdfa48" args="(cpl_propertylist *header)" -->
+<dl class="section return"><dt>Returns</dt><dd>A slit position table</dd></dl>
+<p>This function is meant to convert the information contained in FORS1 and FORS2 MOS data FITS header into a slit position table. This table will contain the double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end coordinates of the slits on the telescope focal plane (mask). The coordinates are expected to have a horizontal dispersion direction and red wavelengths on the right side. A flip to the Y coordinate is [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l14800">14800</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l16863">mos_load_slits_fors_pmos()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga43072c6a57d094a5d7d341934a096e80"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_load_slits_fors_lss           </td>
+          <td class="memname">cpl_table* mos_load_slits_fors_lss </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Create slit location table from FITS header of FORS1/2 LSS data. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>FITS header of FORS data containing slits information</td></tr>
+<p>Create slit location table from FITS header of FORS1/2 LSS data. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>FITS header of FORS data containing slits information</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>A slit position table</dd></dl>
-This function is meant to convert the information contained in FORS1 and FORS2 LSS data FITS header into a slit position table. This table will contain the double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end coordinates of the slits on the telescope focal plane (mask). The coordinates are expected to have a horizontal dispersion direction and red wavelengths on the right side. A flip to the Y coordinate is ap [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l14780">14780</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="test__simulate_8c-source.html#l00103">instrume</a>.
-</div>
-</div><p>
-<a class="anchor" name="g75c3cb900989bb07dad294dd545021a6"></a><!-- doxytag: member="moses.c::mos_get_gain_vimos" ref="g75c3cb900989bb07dad294dd545021a6" args="(cpl_propertylist *header)" -->
+<dl class="section return"><dt>Returns</dt><dd>A slit position table</dd></dl>
+<p>This function is meant to convert the information contained in FORS1 and FORS2 LSS data FITS header into a slit position table. This table will contain the double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end coordinates of the slits on the telescope focal plane (mask). The coordinates are expected to have a horizontal dispersion direction and red wavelengths on the right side. A flip to the Y coordinate is [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l15002">15002</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga74be15e9eea7e1a4f025be22ccb12c54"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">double mos_get_gain_vimos           </td>
+          <td class="memname">double mos_get_gain_vimos </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Return gain factor for a VIMOS exposure. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>FITS header of VIMOS data containing information</td></tr>
+<p>Return gain factor for a VIMOS exposure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>FITS header of VIMOS data containing information</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Gain factor (e-/ADU)</dd></dl>
-This function is meant to read the gain factor from VIMOS data FITS headers. In the specific case of VIMOS the keyword used is ESO DET OUT1 CONAD. If no keyword is found a negative gain factor is returned. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l14948">14948</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
+<dl class="section return"><dt>Returns</dt><dd>Gain factor (e-/ADU)</dd></dl>
+<p>This function is meant to read the gain factor from VIMOS data FITS headers. In the specific case of VIMOS the keyword used is ESO DET OUT1 CONAD. If no keyword is found a negative gain factor is returned. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l15170">15170</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g3431a4557418ee0f8cd9beefd7153a98"></a><!-- doxytag: member="moses.c::mos_load_slits_vimos" ref="g3431a4557418ee0f8cd9beefd7153a98" args="(cpl_propertylist *header)" -->
+</div>
+<a class="anchor" id="ga3946bc30280b3b041a20ae9c9326f827"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_load_slits_vimos           </td>
+          <td class="memname">cpl_table* mos_load_slits_vimos </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Create slit location table from FITS header of VIMOS data. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>FITS header of VIMOS data containing slits information</td></tr>
+<p>Create slit location table from FITS header of VIMOS data. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>FITS header of VIMOS data containing slits information</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>A slit position table</dd></dl>
-This function is meant to convert the information contained in VIMOS data FITS header into a slit position table. This table will contain the double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end coordinates of the slits on the telescope focal plane (mask). The coordinates will be rotated to have a horizontal dispersion direction and red wavelengths on the right side. A slit identifying integer column, labeled  [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l14993">14993</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gf2c5b165c7c2c4be802c03ae59d1b8a9"></a><!-- doxytag: member="moses.c::mos_check_multiplex" ref="gf2c5b165c7c2c4be802c03ae59d1b8a9" args="(cpl_table *slits)" -->
+<dl class="section return"><dt>Returns</dt><dd>A slit position table</dd></dl>
+<p>This function is meant to convert the information contained in VIMOS data FITS header into a slit position table. This table will contain the double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end coordinates of the slits on the telescope focal plane (mask). The coordinates will be rotated to have a horizontal dispersion direction and red wavelengths on the right side. A slit identifying integer column, label [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l15215">15215</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga332b9bfd8e704446ad24d9fa448f9df2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int mos_check_multiplex           </td>
+          <td class="memname">int mos_check_multiplex </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Determining whether a VIMOS mask has spectral multplexing or not. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slit positions produced by <a class="el" href="group__moses.html#g3431a4557418ee0f8cd9beefd7153a98">mos_load_slits_vimos()</a></td></tr>
+<p>Determining whether a VIMOS mask has spectral multplexing or not. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Slit positions produced by <a class="el" href="group__moses.html#ga3946bc30280b3b041a20ae9c9326f827" title="Create slit location table from FITS header of VIMOS data.">mos_load_slits_vimos()</a></td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Max observed spectral multiplexing. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>Max observed spectral multiplexing. </dd></dl>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l15104">15104</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
+<p>Definition at line <a class="el" href="moses_8c_source.html#l15326">15326</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gde22c6582532e051c045baf0ee969e79"></a><!-- doxytag: member="moses.c::mos_load_overscans_vimos" ref="gde22c6582532e051c045baf0ee969e79" args="(const cpl_propertylist *header, int check_consistency)" -->
+<a class="anchor" id="gaf4872d8e8654dd8733369c071843e464"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_load_overscans_vimos           </td>
+          <td class="memname">cpl_table* mos_load_overscans_vimos </td>
           <td>(</td>
-          <td class="paramtype">const cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">const cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>check_consistency</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>check_consistency</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get the overscan positions from FITS header of VIMOS data. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>FITS header containing overscan information </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>check_consistency</em> </td><td>If true (non-zero), this function fails if the sum of prescan, overscan and detector size is different from the actual FITS image size. (this does not hold true for old FORS data)</td></tr>
+<p>Get the overscan positions from FITS header of VIMOS data. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>FITS header containing overscan information </td></tr>
+    <tr><td class="paramname">check_consistency</td><td>If true (non-zero), this function fails if the sum of prescan, overscan and detector size is different from the actual FITS image size. (this does not hold true for old FORS data)</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>A overscan position table</dd></dl>
-This function is meant to convert the information contained in VIMOS data FITS header into an overscan position table. This table will contain the integer columns labeled <em>xlow</em>, <em>ylow</em>, <em>xhig</em>, and <em>yhig</em>, containing the pixel coordinates of opposite corners of the overscan regions, and at its first row the corners coordinates of the valid region (i.e., the CCD proper) within the image. This is a standard table valid for all instruments that should be used by [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l15203">15203</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l15350">mos_load_overscans_fors()</a>, <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>, and <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g7557973371ca804e0fab92c40b833f3c"></a><!-- doxytag: member="moses.c::mos_randomise_image" ref="g7557973371ca804e0fab92c40b833f3c" args="(cpl_image *image, double ron, double gain, double bias)" -->
+<dl class="section return"><dt>Returns</dt><dd>A overscan position table</dd></dl>
+<p>This function is meant to convert the information contained in VIMOS data FITS header into an overscan position table. This table will contain the integer columns labeled <em>xlow</em>, <em>ylow</em>, <em>xhig</em>, and <em>yhig</em>, containing the pixel coordinates of opposite corners of the overscan regions, and at its first row the corners coordinates of the valid region (i.e., the CCD proper) within the image. This is a standard table valid for all instruments that should be used [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l15425">15425</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gab09208f34d27855a6db2d933ff3d02e2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_randomise_image           </td>
+          <td class="memname">cpl_error_code mos_randomise_image </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ron</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ron</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>gain</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>gain</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>bias</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>bias</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Randomise image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image to randomise (in place) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ron</em> </td><td>Read out noise (ADU) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>gain</em> </td><td>Gain (electrons/ADU) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>bias</em> </td><td>Bias level (ADU)</td></tr>
+</div><div class="memdoc">
+
+<p>Randomise image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image to randomise (in place) </td></tr>
+    <tr><td class="paramname">ron</td><td>Read out noise (ADU) </td></tr>
+    <tr><td class="paramname">gain</td><td>Gain (electrons/ADU) </td></tr>
+    <tr><td class="paramname">bias</td><td>Bias level (ADU)</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE or corresponding cpl_error_code on error.</dd></dl>
-For each pixel the 1-sigma error is evaluated as the square root of the variance: <div class="fragment"><pre class="fragment">                V = <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>*<a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a> + (S - bias) / gain
-</pre></div> where S is the pixel value. The pixel value is randomised as <div class="fragment"><pre class="fragment">                S = S + sqrt(V) * <a class="code" href="group__moses.html#g88ec5d9d020d274b54bdce340eef46c6">mos_randg</a>(1)
-</pre></div> 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l15654">15654</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l00206">mos_randg()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gaabac93f2fab16b6c268e5ab494a7238"></a><!-- doxytag: member="moses.c::mos_refmask_find_gaps" ref="gaabac93f2fab16b6c268e5ab494a7238" args="(cpl_mask *refmask, cpl_image *master_flat, double level)" -->
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE or corresponding cpl_error_code on error.</dd></dl>
+<p>For each pixel the 1-sigma error is evaluated as the square root of the variance: </p>
+<div class="fragment"><div class="line">V = ron*ron + (S - bias) / gain</div>
+</div><!-- fragment --><p> where S is the pixel value. The pixel value is randomised as </p>
+<div class="fragment"><div class="line">S = S + sqrt(V) * mos_randg(1)</div>
+</div><!-- fragment --> 
+<p>Definition at line <a class="el" href="moses_8c_source.html#l15876">15876</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gae623b8129e3fd33516f32d866c5106a8"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_refmask_find_gaps           </td>
+          <td class="memname">cpl_error_code mos_refmask_find_gaps </td>
           <td>(</td>
-          <td class="paramtype">cpl_mask * </td>
-          <td class="paramname"> <em>refmask</em>, </td>
+          <td class="paramtype">cpl_mask * </td>
+          <td class="paramname"><em>refmask</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>master_flat</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>master_flat</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>level</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>level</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Reconstruct the gaps required for slit location. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>refmask</em> </td><td>Reference mask </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>master_flat</em> </td><td>Masterflat. The gaps are detected and inserted based upon the values found in this image.</td></tr>
+<p>Reconstruct the gaps required for slit location. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">refmask</td><td>Reference mask </td></tr>
+    <tr><td class="paramname">master_flat</td><td>Masterflat. The gaps are detected and inserted based upon the values found in this image.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error.</dd></dl>
-Deviation larger than 1 sigma from median are killed from map. If <em>level</em> is greater than zero, deviations less than <em>level</em> from median are killed. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l15698">15698</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g4d2eac0de6bdead5ccdd45c5ca2ae69a"></a><!-- doxytag: member="moses.c::mos_saturation_process" ref="g4d2eac0de6bdead5ccdd45c5ca2ae69a" args="(cpl_image *image)" -->
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error.</dd></dl>
+<p>Deviation larger than 1 sigma from median are killed from map. If <em>level</em> is greater than zero, deviations less than <em>level</em> from median are killed. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l15920">15920</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga854ead782f62a6929aade44b267353e0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_saturation_process           </td>
+          <td class="memname">cpl_error_code mos_saturation_process </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Process saturation. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image to process saturation</td></tr>
+<p>Process saturation. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image to process saturation</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error. </dd></dl>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l16012">16012</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l15791">15791</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g7f9a03e1229af2423d82b5f08e674de8"></a><!-- doxytag: member="moses.c::mos_subtract_background" ref="g7f9a03e1229af2423d82b5f08e674de8" args="(cpl_image *image)" -->
+</div>
+<a class="anchor" id="gad122076cab5a9b361c652f5c3321ddf0"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_subtract_background           </td>
+          <td class="memname">cpl_error_code mos_subtract_background </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Subtract the background. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image to subtract the background</td></tr>
+<p>Subtract the background. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image to subtract the background</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error. </dd></dl>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l16078">16078</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l03695">mos_arc_background()</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l15857">15857</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l03695">mos_arc_background()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g621083edda685c07a318aa94f53bce6f"></a><!-- doxytag: member="moses.c::mos_object_intersect" ref="g621083edda685c07a318aa94f53bce6f" args="(cpl_table **slitss, cpl_table *origslits, int nscience, float tolerance)" -->
+</div>
+<a class="anchor" id="ga5f9947ec541f1291f7c9fb20bd081280"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_object_intersect           </td>
+          <td class="memname">cpl_error_code mos_object_intersect </td>
           <td>(</td>
-          <td class="paramtype">cpl_table ** </td>
-          <td class="paramname"> <em>slitss</em>, </td>
+          <td class="paramtype">cpl_table ** </td>
+          <td class="paramname"><em>slitss</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>origslits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>origslits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>nscience</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>nscience</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">float </td>
-          <td class="paramname"> <em>tolerance</em></td><td> </td>
+          <td class="paramtype">float </td>
+          <td class="paramname"><em>tolerance</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Intersect a number of slit tables. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slitss</em> </td><td>Pointer to the list of slit tables </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>origslits</em> </td><td>Pointer to output intersected table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nscience</em> </td><td>Number of tables in the list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tolerance</em> </td><td>Tolerance in object position (pixel)</td></tr>
+</div><div class="memdoc">
+
+<p>Intersect a number of slit tables. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slitss</td><td>Pointer to the list of slit tables </td></tr>
+    <tr><td class="paramname">origslits</td><td>Pointer to output intersected table </td></tr>
+    <tr><td class="paramname">nscience</td><td>Number of tables in the list </td></tr>
+    <tr><td class="paramname">tolerance</td><td>Tolerance in object position (pixel)</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error.</dd></dl>
-The intersected table will only contain polarimetric objects which have been detected in all tables in both beams in the input table list (that is, are present at all angles so polarimetric computation is possible) 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l15887">15887</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l16486">mos_get_maxobjs_per_slit()</a>, and <a class="el" href="moses_8c-source.html#l16512">mos_get_nobjects()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g5a6b95084aacc3fbd59249b53912f048"></a><!-- doxytag: member="moses.c::mos_get_maxobjs_per_slit" ref="g5a6b95084aacc3fbd59249b53912f048" args="(cpl_table *slits)" -->
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE of corresponding cpl_error_code on error.</dd></dl>
+<p>The intersected table will only contain polarimetric objects which have been detected in all tables in both beams in the input table list (that is, are present at all angles so polarimetric computation is possible) </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l16108">16108</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l16703">mos_get_maxobjs_per_slit()</a>, and <a class="el" href="moses_8c_source.html#l16729">mos_get_nobjects()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gae5fb2a72c41bab0464ad35c161e50cac"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int mos_get_maxobjs_per_slit           </td>
+          <td class="memname">int mos_get_maxobjs_per_slit </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get the maximum possible number of objects in a slit. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits table</td></tr>
+<p>Get the maximum possible number of objects in a slit. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Slits table</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>maximum possible number of objects in a slit </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>maximum possible number of objects in a slit </dd></dl>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l16703">16703</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l16486">16486</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l16710">fors_get_nobjs_perslit()</a>, <a class="el" href="moses_8c-source.html#l16512">mos_get_nobjects()</a>, and <a class="el" href="moses_8c-source.html#l15887">mos_object_intersect()</a>.
+<p>Referenced by <a class="el" href="moses_8c_source.html#l16729">mos_get_nobjects()</a>, and <a class="el" href="moses_8c_source.html#l16108">mos_object_intersect()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g7a41fa707f51ab0d55150ed8c4b19657"></a><!-- doxytag: member="moses.c::mos_get_nobjects" ref="g7a41fa707f51ab0d55150ed8c4b19657" args="(cpl_table *slits)" -->
+<a class="anchor" id="gaf4d5e8a0d6cd0356ab38f0b7be241352"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int mos_get_nobjects           </td>
+          <td class="memname">int mos_get_nobjects </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Get the total number of objects detected in a slits table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits table</td></tr>
+<p>Get the total number of objects detected in a slits table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Slits table</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>the number of objects in the table </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>the number of objects in the table </dd></dl>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l16512">16512</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l16486">mos_get_maxobjs_per_slit()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l15887">mos_object_intersect()</a>.
+<p>Definition at line <a class="el" href="moses_8c_source.html#l16729">16729</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l16703">mos_get_maxobjs_per_slit()</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l16108">mos_object_intersect()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g5ec455544df7dfc83da8fefc91a9afc7"></a><!-- doxytag: member="moses.c::mos_check_slits" ref="g5ec455544df7dfc83da8fefc91a9afc7" args="(cpl_table *slits, float rescale)" -->
+<a class="anchor" id="ga71e13921907ec2f25478957d35318e7f"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int mos_check_slits           </td>
+          <td class="memname">int mos_check_slits </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">float </td>
-          <td class="paramname"> <em>rescale</em></td><td> </td>
+          <td class="paramtype">float </td>
+          <td class="paramname"><em>rescale</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Check that all slit have been detected, insert them if not. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slits table</td></tr>
+<p>Check that all slit have been detected, insert them if not. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Slits table</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 or -1 on error. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 or -1 on error. </dd></dl>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l16760">16760</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l16543">16543</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g5bc87e2a7c15dd1686e02e2d65e057f5"></a><!-- doxytag: member="moses.c::mos_load_slits_fors_pmos" ref="g5bc87e2a7c15dd1686e02e2d65e057f5" args="(cpl_propertylist *header, int *nslits_out_det)" -->
+</div>
+<a class="anchor" id="ga78aebb1592ccefba83f9b7cbb80a9676"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_load_slits_fors_pmos           </td>
+          <td class="memname">cpl_table* mos_load_slits_fors_pmos </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>nslits_out_det</em></td><td> </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>nslits_out_det</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Create PMOS slit location table from FITS header of FORS1/2 MOS data. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>FITS header of FORS data containing slits information</td></tr>
+<p>Create PMOS slit location table from FITS header of FORS1/2 MOS data. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>FITS header of FORS data containing slits information</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>A slit position table</dd></dl>
-This function is meant to convert the information contained in FORS1 and FORS2 MOS data FITS header into a slit position table. This table will contain the double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end coordinates of the slits on the telescope focal plane (mask). The coordinates are expected to have a horizontal dispersion direction and red wavelengths on the right side. A flip to the Y coordinate is ap [...]
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l16646">16646</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l14578">mos_load_slits_fors_mos()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gf3dd5a20a5f31b853c53ca419a8171e3"></a><!-- doxytag: member="moses.c::mos_photometric_calibration" ref="gf3dd5a20a5f31b853c53ca419a8171e3" args="(cpl_image *spectra, double startwave, double dispersion, double gain, double exptime, cpl_table *ext_table, double airmass, cpl_table *flux_table, int order)" -->
+<dl class="section return"><dt>Returns</dt><dd>A slit position table</dd></dl>
+<p>This function is meant to convert the information contained in FORS1 and FORS2 MOS data FITS header into a slit position table. This table will contain the double precision columns labeled <em>xtop</em>, <em>ytop</em>, <em>xbottom</em>, and <em>ybottom</em>, containing the start and end coordinates of the slits on the telescope focal plane (mask). The coordinates are expected to have a horizontal dispersion direction and red wavelengths on the right side. A flip to the Y coordinate is [...]
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l16863">16863</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l14800">mos_load_slits_fors_mos()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaad62d9ba866b8abafb2da02053584bf2"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_table* mos_photometric_calibration           </td>
+          <td class="memname">cpl_table* mos_photometric_calibration </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spectra</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spectra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>startwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>startwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>gain</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>gain</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>exptime</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>exptime</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>ext_table</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>ext_table</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>airmass</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>airmass</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>flux_table</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>flux_table</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>order</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>order</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Produce instrument response curve, with some ancillary information. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectra</em> </td><td>Image with extracted spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>startwave</em> </td><td>Shortest wavelength in input image (Angstrom) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Angstrom per pixel of input image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>gain</em> </td><td>Gain factor (e-/ADU) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>exptime</em> </td><td>Exposure time (seconds) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ext_table</em> </td><td>Atmospheric extinction table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>airmass</em> </td><td>Airmass of observation </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>flux_table</em> </td><td>Standard star catalog flux </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>order</em> </td><td>Order of polynomial to model the instrument response</td></tr>
+</div><div class="memdoc">
+
+<p>Produce instrument response curve, with some ancillary information. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectra</td><td>Image with extracted spectra </td></tr>
+    <tr><td class="paramname">startwave</td><td>Shortest wavelength in input image (Angstrom) </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Angstrom per pixel of input image </td></tr>
+    <tr><td class="paramname">gain</td><td>Gain factor (e-/ADU) </td></tr>
+    <tr><td class="paramname">exptime</td><td>Exposure time (seconds) </td></tr>
+    <tr><td class="paramname">ext_table</td><td>Atmospheric extinction table </td></tr>
+    <tr><td class="paramname">airmass</td><td>Airmass of observation </td></tr>
+    <tr><td class="paramname">flux_table</td><td>Standard star catalog flux </td></tr>
+    <tr><td class="paramname">order</td><td>Order of polynomial to model the instrument response</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>A slit position table</dd></dl>
-This function is meant to convert the information contained in<p>
-The brightest extracted spectrum in <em>spectra</em> is assumed to be the standard star spectrum. The <em>order</em> of the polynomial fitting the instrument must be at least 2. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l16986">16986</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="moses_8c-source.html#l16802">map_table()</a>, and <a class="el" href="moses_8c-source.html#l16897">polysmooth()</a>.
-<p>
-Referenced by <a class="el" href="vimos__science__impl_8c-source.html#l00081">vimos_science_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g8fabeef3808c1cb7e888699cd4f4d660"></a><!-- doxytag: member="moses.c::mos_ksigma_stack" ref="g8fabeef3808c1cb7e888699cd4f4d660" args="(cpl_imagelist *imlist, double klow, double khigh, int kiter, cpl_image **good)" -->
+<dl class="section return"><dt>Returns</dt><dd>A slit position table</dd></dl>
+<p>This function is meant to convert the information contained in</p>
+<p>The brightest extracted spectrum in <em>spectra</em> is assumed to be the standard star spectrum. The <em>order</em> of the polynomial fitting the instrument must be at least 2. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l17203">17203</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga663cfcd4584b6a3e63e7593cba926688"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_ksigma_stack           </td>
+          <td class="memname">cpl_image* mos_ksigma_stack </td>
           <td>(</td>
-          <td class="paramtype">cpl_imagelist * </td>
-          <td class="paramname"> <em>imlist</em>, </td>
+          <td class="paramtype">cpl_imagelist * </td>
+          <td class="paramname"><em>imlist</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>klow</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>klow</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>khigh</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>khigh</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>kiter</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>kiter</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image ** </td>
-          <td class="paramname"> <em>good</em></td><td> </td>
+          <td class="paramtype">cpl_image ** </td>
+          <td class="paramname"><em>good</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Stack images using k-sigma clipping. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>imlist</em> </td><td>List of images to stack </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>klow</em> </td><td>Number of sigmas for rejection of lowest values </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>khigh</em> </td><td>Number of sigmas for rejection of highest values </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>kiter</em> </td><td>Max number of iterations</td></tr>
+</div><div class="memdoc">
+
+<p>Stack images using k-sigma clipping. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">imlist</td><td>List of images to stack </td></tr>
+    <tr><td class="paramname">klow</td><td>Number of sigmas for rejection of lowest values </td></tr>
+    <tr><td class="paramname">khigh</td><td>Number of sigmas for rejection of highest values </td></tr>
+    <tr><td class="paramname">kiter</td><td>Max number of iterations</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Stacked image.</dd></dl>
-At the first iteration the value of sigma is computed relatively to the median value of all pixels at a given image position. For the next iterations the sigma is computed in the standard way. If at some iteration all points would be rejected, the mean computed at the previous iteration is returned. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l17463">17463</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l17382">ksigma_vector()</a>.
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l01787">fors_image_collapse_ksigma_create()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gd97e4b6ea81acb77e5ef8567a376482b"></a><!-- doxytag: member="moses.c::mos_apply_photometry" ref="gd97e4b6ea81acb77e5ef8567a376482b" args="(cpl_image *spectra, cpl_table *response, cpl_table *ext_table, double startwave, double dispersion, double gain, double exptime, double airmass)" -->
+<dl class="section return"><dt>Returns</dt><dd>Stacked image.</dd></dl>
+<p>At the first iteration the value of sigma is computed relatively to the median value of all pixels at a given image position. For the next iterations the sigma is computed in the standard way. If at some iteration all points would be rejected, the mean computed at the previous iteration is returned. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l17680">17680</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__image_8c_source.html#l01796">fors_image_collapse_ksigma_create()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga2244278b632992a44067afcc42530954"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_apply_photometry           </td>
+          <td class="memname">cpl_image* mos_apply_photometry </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spectra</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spectra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>response</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>response</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>ext_table</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>ext_table</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>startwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>startwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>gain</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>gain</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>exptime</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>exptime</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>airmass</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>airmass</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Apply response curve to extracted spectra. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>spectra</em> </td><td>Image containing extracted spectra (slits or objects) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>response</em> </td><td>Table including the response curve </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ext_table</em> </td><td>Atmospheric extinction table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>startwave</em> </td><td>Start wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Angstrom per pixel of input image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>gain</em> </td><td>Gain factor (e-/ADU) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>exptime</em> </td><td>Exposure time (seconds) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>airmass</em> </td><td>Airmass of observation</td></tr>
+</div><div class="memdoc">
+
+<p>Apply response curve to extracted spectra. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">spectra</td><td>Image containing extracted spectra (slits or objects) </td></tr>
+    <tr><td class="paramname">response</td><td>Table including the response curve </td></tr>
+    <tr><td class="paramname">ext_table</td><td>Atmospheric extinction table </td></tr>
+    <tr><td class="paramname">startwave</td><td>Start wavelength </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Angstrom per pixel of input image </td></tr>
+    <tr><td class="paramname">gain</td><td>Gain factor (e-/ADU) </td></tr>
+    <tr><td class="paramname">exptime</td><td>Exposure time (seconds) </td></tr>
+    <tr><td class="paramname">airmass</td><td>Airmass of observation</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Photometrically calibrated image at airmass 0. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>Photometrically calibrated image at airmass 0. </dd></dl>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l17755">17755</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l17538">17538</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l16802">map_table()</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l17631">mos_propagate_photometry_error()</a>.
+<p>Referenced by <a class="el" href="moses_8c_source.html#l17848">mos_propagate_photometry_error()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ge20fadc56d3b4506d4ffd3015f394695"></a><!-- doxytag: member="moses.c::mos_propagate_photometry_error" ref="ge20fadc56d3b4506d4ffd3015f394695" args="(cpl_image *spectra, cpl_image *errors, cpl_table *response, cpl_table *ext_table, double startwave, double dispersion, double gain, double exptime, double airmass)" -->
+<a class="anchor" id="gae8e4a9d1a1146de7ba72dd148848342d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_propagate_photometry_error           </td>
+          <td class="memname">cpl_image* mos_propagate_photometry_error </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>spectra</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>spectra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>errors</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>errors</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>response</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>response</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>ext_table</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>ext_table</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>startwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>startwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>gain</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>gain</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>exptime</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>exptime</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>airmass</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>airmass</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Propagate errors from response curve and extracted spectra. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>errors</em> </td><td>Image containing errors on extracted spectra (objects) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>response</em> </td><td>Table including the response curve errors </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ext_table</em> </td><td>Atmospheric extinction table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>startwave</em> </td><td>Start wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Angstrom per pixel of input image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>gain</em> </td><td>Gain factor (e-/ADU) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>exptime</em> </td><td>Exposure time (seconds) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>airmass</em> </td><td>Airmass of observation</td></tr>
+</div><div class="memdoc">
+
+<p>Propagate errors from response curve and extracted spectra. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">errors</td><td>Image containing errors on extracted spectra (objects) </td></tr>
+    <tr><td class="paramname">response</td><td>Table including the response curve errors </td></tr>
+    <tr><td class="paramname">ext_table</td><td>Atmospheric extinction table </td></tr>
+    <tr><td class="paramname">startwave</td><td>Start wavelength </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Angstrom per pixel of input image </td></tr>
+    <tr><td class="paramname">gain</td><td>Gain factor (e-/ADU) </td></tr>
+    <tr><td class="paramname">exptime</td><td>Exposure time (seconds) </td></tr>
+    <tr><td class="paramname">airmass</td><td>Airmass of observation</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Error on photometrically calibrated spectrum at airmass 0. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>Error on photometrically calibrated spectrum at airmass 0. </dd></dl>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l17848">17848</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l17631">17631</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l16802">map_table()</a>, and <a class="el" href="moses_8c-source.html#l17538">mos_apply_photometry()</a>.
+<p>References <a class="el" href="moses_8c_source.html#l17755">mos_apply_photometry()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gd170543de1ad9f6f2e4f1167e3f4ef4e"></a><!-- doxytag: member="moses.c::mos_check_polarisation" ref="gd170543de1ad9f6f2e4f1167e3f4ef4e" args="(cpl_image *q_image, cpl_image *q_error, cpl_image *u_image, cpl_image *u_error, double startwave, double dispersion, double band, cpl_table *pol_sta, double ra, double dec, char *filter, int *polarisation, double *p_offset, double *p_error, double *a_offset, double *a_error)" -->
+<a class="anchor" id="gae97d35cc8cb29cbb0b43d4fc84e4d34b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int mos_check_polarisation           </td>
+          <td class="memname">int mos_check_polarisation </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>q_image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>q_image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>q_error</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>q_error</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>u_image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>u_image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>u_error</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>u_error</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>startwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>startwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>band</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>band</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>pol_sta</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>pol_sta</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ra</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ra</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dec</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dec</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">char * </td>
-          <td class="paramname"> <em>filter</em>, </td>
+          <td class="paramtype">char * </td>
+          <td class="paramname"><em>filter</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int * </td>
-          <td class="paramname"> <em>polarisation</em>, </td>
+          <td class="paramtype">int * </td>
+          <td class="paramname"><em>polarisation</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>p_offset</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>p_offset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>p_error</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>p_error</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>a_offset</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>a_offset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>a_error</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>a_error</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Estimate linear polarisation parameters on spectral interval. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>q_image</em> </td><td>Image whose rows correspond to extracted spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>q_error</em> </td><td>Image with errors of <em>q_image</em> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>u_image</em> </td><td>Image whose rows correspond to extracted spectra </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>u_error</em> </td><td>Image with errors of <em>u_image</em> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>startwave</em> </td><td>Start wavelength </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Angstrom per pixel of input image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>band</em> </td><td>Width of band where the signal is averaged (Angstrom) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>pol_sta</em> </td><td>Table with polarimetric standard stars parameters </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ra</em> </td><td>Right Ascension of center of field of view (degrees) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dec</em> </td><td>Declination of center of field of view (degrees) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>filter</em> </td><td>Returned filter (UBVRI) to which the measurement refers </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>polarisation</em> </td><td>Returned polarisation flag (0 = star is not polarised) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>p_offset</em> </td><td>Returned relative variation of P in <em>filter</em> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>p_error</em> </td><td>Returned error on <em>p_offset</em> </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>a_offset</em> </td><td>Returned variation of angle in <em>filter</em> (degrees) </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>a_error</em> </td><td>Returned error on <em>a_offset</em> (degrees)</td></tr>
+</div><div class="memdoc">
+
+<p>Estimate linear polarisation parameters on spectral interval. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">q_image</td><td>Image whose rows correspond to extracted spectra </td></tr>
+    <tr><td class="paramname">q_error</td><td>Image with errors of <em>q_image</em> </td></tr>
+    <tr><td class="paramname">u_image</td><td>Image whose rows correspond to extracted spectra </td></tr>
+    <tr><td class="paramname">u_error</td><td>Image with errors of <em>u_image</em> </td></tr>
+    <tr><td class="paramname">startwave</td><td>Start wavelength </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Angstrom per pixel of input image </td></tr>
+    <tr><td class="paramname">band</td><td>Width of band where the signal is averaged (Angstrom) </td></tr>
+    <tr><td class="paramname">pol_sta</td><td>Table with polarimetric standard stars parameters </td></tr>
+    <tr><td class="paramname">ra</td><td>Right Ascension of center of field of view (degrees) </td></tr>
+    <tr><td class="paramname">dec</td><td>Declination of center of field of view (degrees) </td></tr>
+    <tr><td class="paramname">filter</td><td>Returned filter (UBVRI) to which the measurement refers </td></tr>
+    <tr><td class="paramname">polarisation</td><td>Returned polarisation flag (0 = star is not polarised) </td></tr>
+    <tr><td class="paramname">p_offset</td><td>Returned relative variation of P in <em>filter</em> </td></tr>
+    <tr><td class="paramname">p_error</td><td>Returned error on <em>p_offset</em> </td></tr>
+    <tr><td class="paramname">a_offset</td><td>Returned variation of angle in <em>filter</em> (degrees) </td></tr>
+    <tr><td class="paramname">a_error</td><td>Returned error on <em>a_offset</em> (degrees)</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 on success.</dd></dl>
-This function is used to estimate the deviation of the linear polarization of observed polarimetric standard stars from expected (catalog) values.<p>
-The parameter <em>p_offset</em> is defined as observed minus expected polarisation, divided by expected polarisation. Only in case the expected polarisation is zero, <em>p_offset</em> is simply defined as the observed polarisation.<p>
-The parameter <em>p_error</em> is obtained by propagating the measurement and the catalog errors.<p>
-The parameter <em>a_offset</em> is defined as observed minus expected polarisation angle. In case the expected polarisation is zero, <em>a_offset</em> is simply set to zero.<p>
-The parameter <em>a_error</em> is obtained by propagating the measurement and the catalog errors. In case the expected polarisation is zero, <em>a_error</em> is simply set to zero.<p>
-The applied algorithm is the following:<p>
-Each row of the input images corresponds to a different object. The row corresponding to the standard star is selected as the one where the S/N ratio is the greatest (this check is performed conventionally on <em>q_error</em>, which is minimal for high S/N objects). The selected row is extracted from all input images.<p>
-From the table <em>pol_sta</em> the standard star closest to the specified <em>ra</em> and <em>dec</em> coordinates is found, and if this is closer than half a degree from the input <em>ra</em> and <em>dec</em> is selected. From the available expected values at the different spectral bands (U, B, V, etc.) the one which is closest to the center of the valid spectral interval for the standard star observation is selected (the valid spectral interval is defined here as the region where the  [...]
-U -> 3650 Angstrom B -> 4450 Angstrom V -> 5510 Angstrom R -> 6580 Angstrom I -> 8060 Angstrom<p>
-If the interval <em>band</em> centered at the wavelength closest to center of the valid spectral range is not entirely contained in the valid spectral range, this function fails and 1 is returned. Otherwise, within the defined band, the median values of Q and U, together with their median errors, are determined. From those the values for the output parameters are computed in the usual way. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l17809">17809</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-</div>
-</div><p>
-<a class="anchor" name="ge59e20e2bea761316fa1395d5d406965"></a><!-- doxytag: member="moses.c::mos_compute_offset" ref="ge59e20e2bea761316fa1395d5d406965" args="(cpl_table *reference, cpl_table *objects, double *offset)" -->
+<dl class="section return"><dt>Returns</dt><dd>0 on success.</dd></dl>
+<p>This function is used to estimate the deviation of the linear polarization of observed polarimetric standard stars from expected (catalog) values.</p>
+<p>The parameter <em>p_offset</em> is defined as observed minus expected polarisation, divided by expected polarisation. Only in case the expected polarisation is zero, <em>p_offset</em> is simply defined as the observed polarisation.</p>
+<p>The parameter <em>p_error</em> is obtained by propagating the measurement and the catalog errors.</p>
+<p>The parameter <em>a_offset</em> is defined as observed minus expected polarisation angle. In case the expected polarisation is zero, <em>a_offset</em> is simply set to zero.</p>
+<p>The parameter <em>a_error</em> is obtained by propagating the measurement and the catalog errors. In case the expected polarisation is zero, <em>a_error</em> is simply set to zero.</p>
+<p>The applied algorithm is the following:</p>
+<p>Each row of the input images corresponds to a different object. The row corresponding to the standard star is selected as the one where the S/N ratio is the greatest (this check is performed conventionally on <em>q_error</em>, which is minimal for high S/N objects). The selected row is extracted from all input images.</p>
+<p>From the table <em>pol_sta</em> the standard star closest to the specified <em>ra</em> and <em>dec</em> coordinates is found, and if this is closer than half a degree from the input <em>ra</em> and <em>dec</em> is selected. From the available expected values at the different spectral bands (U, B, V, etc.) the one which is closest to the center of the valid spectral interval for the standard star observation is selected (the valid spectral interval is defined here as the region where t [...]
+<p>U -> 3650 Angstrom B -> 4450 Angstrom V -> 5510 Angstrom R -> 6580 Angstrom I -> 8060 Angstrom</p>
+<p>If the interval <em>band</em> centered at the wavelength closest to center of the valid spectral range is not entirely contained in the valid spectral range, this function fails and 1 is returned. Otherwise, within the defined band, the median values of Q and U, together with their median errors, are determined. From those the values for the output parameters are computed in the usual way. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l18026">18026</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gac442710556a5013dedd29befac482c9d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int mos_compute_offset           </td>
+          <td class="memname">int mos_compute_offset </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>reference</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>reference</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>objects</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>objects</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>offset</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>offset</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Estimate offset between two object tables. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>reference</em> </td><td>Reference object table. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>objects</em> </td><td>Object table from offset frame. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>offset</em> </td><td>Returned offset in CCD pixels.</td></tr>
+</div><div class="memdoc">
+
+<p>Estimate offset between two object tables. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">reference</td><td>Reference object table. </td></tr>
+    <tr><td class="paramname">objects</td><td>Object table from offset frame. </td></tr>
+    <tr><td class="paramname">offset</td><td>Returned offset in CCD pixels.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>CPL_ERROR_NONE in case of success.</dd></dl>
-Given two object tables, derived from two scientific exposures obtained with the same mask, this function determines the offset between the two tables.<p>
-The procedure is the following: For each slit (corresponding to one row of the object tables), two integer arrays of length "length" (read from the object table) are allocated. The position of objects in that slit, as given in both the reference and the offset object tables, are flagged with 1, all the rest is left to zero. The two arrays are correlated, finding a preliminary (integer) offset in pixel. This preliminary offset is just used to match corresponding objects. At a second step, [...]
-</pre></div> in the same convention used in function <code><a class="el" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration()</a></code>. The returned offset is the median offset obtained from all slits. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l18167">18167</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l16710">fors_get_nobjs_perslit()</a>, <a class="el" href="moses_8c-source.html#l16737">fors_get_object_position()</a>, and <a class="el" href="fors__utils_8c-source.html#l00211">fors_tools_get_kth_double()</a>.
-</div>
-</div><p>
-<a class="anchor" name="gf708c4804f0aa98415025f2f7ed31f11"></a><!-- doxytag: member="moses.c::mos_image_shift" ref="gf708c4804f0aa98415025f2f7ed31f11" args="(cpl_image *image, double dx, double dy)" -->
+<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE in case of success.</dd></dl>
+<p>Given two object tables, derived from two scientific exposures obtained with the same mask, this function determines the offset between the two tables.</p>
+<p>The procedure is the following: For each slit (corresponding to one row of the object tables), two integer arrays of length "length" (read from the object table) are allocated. The position of objects in that slit, as given in both the reference and the offset object tables, are flagged with 1, all the rest is left to zero. The two arrays are correlated, finding a preliminary (integer) offset in pixel. This preliminary offset is just used to match corresponding objects. At a second st [...]
+<div class="fragment"><div class="line">CCD_offset = Map_offset * (t - b) / length</div>
+</div><!-- fragment --><p> in the same convention used in function <code><a class="el" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration()</a></code>. The returned offset is the median offset obtained from all slits. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l18384">18384</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="fors__utils_8c_source.html#l00211">fors_tools_get_kth_double()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="ga82c7c158316d8aba35ffa271b44510c6"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_image_shift           </td>
+          <td class="memname">cpl_error_code mos_image_shift </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dx</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dx</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dy</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dy</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Shift values in an image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Input image </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dx</em> </td><td>Shift in x </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dy</em> </td><td>Shift in y</td></tr>
+</div><div class="memdoc">
+
+<p>Shift values in an image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Input image </td></tr>
+    <tr><td class="paramname">dx</td><td>Shift in x </td></tr>
+    <tr><td class="paramname">dy</td><td>Shift in y</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd><code>CPL_ERROR_NONE</code> on success. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd><code>CPL_ERROR_NONE</code> on success. </dd></dl>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l18367">18367</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
+<p>Definition at line <a class="el" href="moses_8c_source.html#l18584">18584</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="gc32b3fba956da20bd20530372b1b28d1"></a><!-- doxytag: member="moses.c::mos_slit_closest_to_center" ref="gc32b3fba956da20bd20530372b1b28d1" args="(cpl_table *slits, int nx, int ny)" -->
+<a class="anchor" id="gae575a9875c5e14d7fcb4d74cac44af31"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int mos_slit_closest_to_center           </td>
+          <td class="memname">int mos_slit_closest_to_center </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>nx</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>nx</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ny</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ny</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Return slit closest to CCD center. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Slit table </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nx</em> </td><td>X size of CCD </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ny</em> </td><td>Y size of CCD</td></tr>
+</div><div class="memdoc">
+
+<p>Return slit closest to CCD center. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">slits</td><td>Slit table </td></tr>
+    <tr><td class="paramname">nx</td><td>X size of CCD </td></tr>
+    <tr><td class="paramname">ny</td><td>Y size of CCD</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Table row with the slit closest to center. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>Table row with the slit closest to center. </dd></dl>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l18645">18645</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="moses_8c_source.html#l18693">mos_extract_flux()</a>, <a class="el" href="moses_8c_source.html#l18810">mos_extract_flux_mapped()</a>, and <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l18428">18428</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="moses_8c-source.html#l18476">mos_extract_flux()</a>, <a class="el" href="moses_8c-source.html#l18593">mos_extract_flux_mapped()</a>, and <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gbff2b46bad7584f819ae28fdd8c85343"></a><!-- doxytag: member="moses.c::mos_extract_flux" ref="gbff2b46bad7584f819ae28fdd8c85343" args="(cpl_image *image, cpl_table *slits, double xwidth, double ywidth, int dx, double gain, double *o_flux, double *o_err)" -->
+</div>
+<a class="anchor" id="ga5291b43599e8dec884137f867fe72bfd"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_extract_flux           </td>
+          <td class="memname">cpl_error_code mos_extract_flux </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>xwidth</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>xwidth</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ywidth</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ywidth</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>dx</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>dx</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>gain</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>gain</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>o_flux</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>o_flux</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>o_err</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>o_err</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Measure flux from spectral interval on CCD. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image containing raw spectra. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Table with slits properties. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dx</em> </td><td>Pixels to extract along the dispersion direction (radius). </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>gain</em> </td><td>In electrons/ADU, used for error computation. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>o_flux</em> </td><td>Returned integrated flux, in ADU/mm^2 </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>o_err</em> </td><td>Returned error on integrated flux.</td></tr>
+</div><div class="memdoc">
+
+<p>Measure flux from spectral interval on CCD. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image containing raw spectra. </td></tr>
+    <tr><td class="paramname">slits</td><td>Table with slits properties. </td></tr>
+    <tr><td class="paramname">dx</td><td>Pixels to extract along the dispersion direction (radius). </td></tr>
+    <tr><td class="paramname">gain</td><td>In electrons/ADU, used for error computation. </td></tr>
+    <tr><td class="paramname">o_flux</td><td>Returned integrated flux, in ADU/mm^2 </td></tr>
+    <tr><td class="paramname">o_err</td><td>Returned error on integrated flux.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Status</dd></dl>
-This one should integrate counts on a rectangle around a given wavelength on a spectrum corresponding to a given slit. Then the counts are normalized to the corresponding physical area on the slit. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l18476">18476</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l18428">mos_slit_closest_to_center()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="ga8abda7d8ad43a4c3287b7b9071f5094"></a><!-- doxytag: member="moses.c::mos_extract_flux_mapped" ref="ga8abda7d8ad43a4c3287b7b9071f5094" args="(cpl_image *image, cpl_table *slits, double xwidth, double ywidth, double lambda, double startwave, double dispersion, int dx, double gain, double *o_flux, double *o_err)" -->
+<dl class="section return"><dt>Returns</dt><dd>Status</dd></dl>
+<p>This one should integrate counts on a rectangle around a given wavelength on a spectrum corresponding to a given slit. Then the counts are normalized to the corresponding physical area on the slit. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l18693">18693</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l18645">mos_slit_closest_to_center()</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gaf91a99846ae06aa780b59deced1fa215"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_error_code mos_extract_flux_mapped           </td>
+          <td class="memname">cpl_error_code mos_extract_flux_mapped </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>xwidth</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>xwidth</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>ywidth</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>ywidth</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>lambda</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>lambda</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>startwave</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>startwave</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>dispersion</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>dispersion</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>dx</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>dx</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>gain</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>gain</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>o_flux</em>, </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>o_flux</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>o_err</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>o_err</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Measure flux from spectral interval on remapped frame. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image containing remapped spectra. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Table with slits properties. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>lambda</em> </td><td>Wavelength to examine </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>startwave</em> </td><td>Shortest wavelength in image. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dispersion</em> </td><td>Wavelength units per image pixel </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>dx</em> </td><td>Pixels to extract along the dispersion direction (radius). </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>gain</em> </td><td>In electrons/ADU, used for error computation. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>o_flux</em> </td><td>Returned integrated flux, in ADU/mm^2 </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>o_err</em> </td><td>Returned error on integrated flux.</td></tr>
+</div><div class="memdoc">
+
+<p>Measure flux from spectral interval on remapped frame. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image containing remapped spectra. </td></tr>
+    <tr><td class="paramname">slits</td><td>Table with slits properties. </td></tr>
+    <tr><td class="paramname">lambda</td><td>Wavelength to examine </td></tr>
+    <tr><td class="paramname">startwave</td><td>Shortest wavelength in image. </td></tr>
+    <tr><td class="paramname">dispersion</td><td>Wavelength units per image pixel </td></tr>
+    <tr><td class="paramname">dx</td><td>Pixels to extract along the dispersion direction (radius). </td></tr>
+    <tr><td class="paramname">gain</td><td>In electrons/ADU, used for error computation. </td></tr>
+    <tr><td class="paramname">o_flux</td><td>Returned integrated flux, in ADU/mm^2 </td></tr>
+    <tr><td class="paramname">o_err</td><td>Returned error on integrated flux.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Status</dd></dl>
-This one should integrate counts on a rectangle around a given wavelength on a spectrum corresponding to the slit closest to the CCD center. Then the counts are normalized to the corresponding physical area on the slit. 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l18593">18593</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-References <a class="el" href="moses_8c-source.html#l18428">mos_slit_closest_to_center()</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
-</div>
-</div><p>
-<a class="anchor" name="g8395eca2d64406c969f48220024e999b"></a><!-- doxytag: member="moses.c::mos_median_in_slit" ref="g8395eca2d64406c969f48220024e999b" args="(cpl_table *table, cpl_table *slits, int slit, char *label, double *mvalue)" -->
+<dl class="section return"><dt>Returns</dt><dd>Status</dd></dl>
+<p>This one should integrate counts on a rectangle around a given wavelength on a spectrum corresponding to the slit closest to the CCD center. Then the counts are normalized to the corresponding physical area on the slit. </p>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l18810">18810</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>References <a class="el" href="moses_8c_source.html#l18645">mos_slit_closest_to_center()</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
+
+</div>
+</div>
+<a class="anchor" id="gac6224c743943d88920b1e93f7394d009"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int mos_median_in_slit           </td>
+          <td class="memname">int mos_median_in_slit </td>
           <td>(</td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>table</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>table</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_table * </td>
-          <td class="paramname"> <em>slits</em>, </td>
+          <td class="paramtype">cpl_table * </td>
+          <td class="paramname"><em>slits</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>slit</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>slit</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">char * </td>
-          <td class="paramname"> <em>label</em>, </td>
+          <td class="paramtype">char * </td>
+          <td class="paramname"><em>label</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double * </td>
-          <td class="paramname"> <em>mvalue</em></td><td> </td>
+          <td class="paramtype">double * </td>
+          <td class="paramname"><em>mvalue</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Compute median from a table column section corresponding to a slit. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>table</em> </td><td>Table with as many rows as rectified images </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slits</em> </td><td>Table with slits properties. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>slit</em> </td><td>Row in slits corresponding to slit to examine </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>label</em> </td><td>Name of column to examine </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>mvalue</em> </td><td>Returned median value</td></tr>
+</div><div class="memdoc">
+
+<p>Compute median from a table column section corresponding to a slit. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">table</td><td>Table with as many rows as rectified images </td></tr>
+    <tr><td class="paramname">slits</td><td>Table with slits properties. </td></tr>
+    <tr><td class="paramname">slit</td><td>Row in slits corresponding to slit to examine </td></tr>
+    <tr><td class="paramname">label</td><td>Name of column to examine </td></tr>
+    <tr><td class="paramname">mvalue</td><td>Returned median value</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 in case of success. </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 in case of success. </dd></dl>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l18920">18920</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
+
+<p>Referenced by <a class="el" href="vimos__calib__impl_8c_source.html#l00174">vimos_calib_impl()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l18703">18703</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="vimos__calib__impl_8c-source.html#l00174">vimos_calib_impl()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g4fe5f2fe3227522421783758228cdc39"></a><!-- doxytag: member="moses.c::mos_image_filter_median" ref="g4fe5f2fe3227522421783758228cdc39" args="(cpl_image *image, int nx, int ny)" -->
+</div>
+<a class="anchor" id="ga1f574f5f45840ea69fa03eb26055a1b1"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_image* mos_image_filter_median           </td>
+          <td class="memname">cpl_image* mos_image_filter_median </td>
           <td>(</td>
-          <td class="paramtype">cpl_image * </td>
-          <td class="paramname"> <em>image</em>, </td>
+          <td class="paramtype">cpl_image * </td>
+          <td class="paramname"><em>image</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>nx</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>nx</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>ny</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>ny</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Convenience function for standard median filtering. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>image</em> </td><td>Image to smooth </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>nx</em> </td><td>Filter size in x. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>ny</em> </td><td>Filter size in y.</td></tr>
+</div><div class="memdoc">
+
+<p>Convenience function for standard median filtering. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">image</td><td>Image to smooth </td></tr>
+    <tr><td class="paramname">nx</td><td>Filter size in x. </td></tr>
+    <tr><td class="paramname">ny</td><td>Filter size in y.</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Filtered image </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>Filtered image </dd></dl>
+
+<p>Definition at line <a class="el" href="moses_8c_source.html#l18948">18948</a> of file <a class="el" href="moses_8c_source.html">moses.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="moses_8c-source.html#l18731">18731</a> of file <a class="el" href="moses_8c-source.html">moses.c</a>.
-<p>
-Referenced by <a class="el" href="fors__image_8c-source.html#l01351">fors_image_flat_fit_create()</a>, <a class="el" href="moses_8c-source.html#l03695">mos_arc_background()</a>, and <a class="el" href="moses_8c-source.html#l00913">mos_extraction()</a>.
+<p>Referenced by <a class="el" href="moses_8c_source.html#l03695">mos_arc_background()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__multiset.html b/html/group__multiset.html
index 31041ce..e48187a 100644
--- a/html/group__multiset.html
+++ b/html/group__multiset.html
@@ -1,329 +1,371 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: container type</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>container type</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structlist.html">list</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>(EXPR)   assert(EXPR)</td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structlist.html">list</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g14ca81b1edd1222975ab52e203cbde59">list_new</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor.  <a href="#g14ca81b1edd1222975ab52e203cbde59"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structlist.html">list</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#ge8bd4915a67367a226dcd3f5c3bd5491">list_duplicate</a> (const <a class="el" href="structlist.html">list</a> *l, void *(*duplicate)(const void *))</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor.  <a href="#ge8bd4915a67367a226dcd3f5c3bd5491"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g6b91588e63479b669eefe0aa72a0b934"></a><!-- doxytag: member="multiset::list_delete_const" ref="g6b91588e63479b669eefe0aa72a0b934" args="(const list **l, void(*delete)(void **))" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g6b91588e63479b669eefe0aa72a0b934">list_delete_const</a> (const <a class="el" href="structlist.html">list</a> **l, void(*delete)(void **))</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g023d28b5567e53901b78d9311fc5ca35"></a><!-- doxytag: member="multiset::list_delete" ref="g023d28b5567e53901b78d9311fc5ca35" args="(list **l, void(*delete)(void **))" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g023d28b5567e53901b78d9311fc5ca35">list_delete</a> (<a class="el" href="structlist.html">list</a> **l, void(*delete)(void **))</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5287413c34475d2be585d0d499284ad0"></a><!-- doxytag: member="multiset::list_size" ref="g5287413c34475d2be585d0d499284ad0" args="(const list *l)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g5287413c34475d2be585d0d499284ad0">list_size</a> (const <a class="el" href="structlist.html">list</a> *l)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5e63a209af7e8b792f9a96225e8b1e9a"></a><!-- doxytag: member="multiset::list_insert" ref="g5e63a209af7e8b792f9a96225e8b1e9a" args="(list *l, void *e)" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g5e63a209af7e8b792f9a96225e8b1e9a">list_insert</a> (<a class="el" href="structlist.html">list</a> *l, void *e)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2fdb96b9da8d926647099d3bd47d603d"></a><!-- doxytag: member="multiset::list_remove_const" ref="g2fdb96b9da8d926647099d3bd47d603d" args="(list *l, const void *e)" -->
-const void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g2fdb96b9da8d926647099d3bd47d603d">list_remove_const</a> (<a class="el" href="structlist.html">list</a> *l, const void *e)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd930cb6af417438f37a442896b48f80a"></a><!-- doxytag: member="multiset::list_remove" ref="gd930cb6af417438f37a442896b48f80a" args="(list *l, void *e)" -->
-void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gd930cb6af417438f37a442896b48f80a">list_remove</a> (<a class="el" href="structlist.html">list</a> *l, void *e)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g276d60cc73b392f762c0ccf4b3754dad"></a><!-- doxytag: member="multiset::list_reverse" ref="g276d60cc73b392f762c0ccf4b3754dad" args="(list *l)" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g276d60cc73b392f762c0ccf4b3754dad">list_reverse</a> (<a class="el" href="structlist.html">list</a> *l)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g6a309c29348190f4a4c5eeadb98087a9"></a><!-- doxytag: member="multiset::list_first_const" ref="g6a309c29348190f4a4c5eeadb98087a9" args="(const list *l)" -->
-const void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g6a309c29348190f4a4c5eeadb98087a9">list_first_const</a> (const <a class="el" href="structlist.html">list</a> *l)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gcd8957206ede65fe202056cf477a70a7"></a><!-- doxytag: member="multiset::list_first" ref="gcd8957206ede65fe202056cf477a70a7" args="(list *l)" -->
-void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gcd8957206ede65fe202056cf477a70a7">list_first</a> (<a class="el" href="structlist.html">list</a> *l)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g26472127771d0bcc4a49191de53233a1"></a><!-- doxytag: member="multiset::list_next_const" ref="g26472127771d0bcc4a49191de53233a1" args="(const list *l)" -->
-const void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g26472127771d0bcc4a49191de53233a1">list_next_const</a> (const <a class="el" href="structlist.html">list</a> *l)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5c52611dbc9f33d472caa4c1df3f2da5"></a><!-- doxytag: member="multiset::list_next" ref="g5c52611dbc9f33d472caa4c1df3f2da5" args="(list *l)" -->
-void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g5c52611dbc9f33d472caa4c1df3f2da5">list_next</a> (<a class="el" href="structlist.html">list</a> *l)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g71a3d48a34a961956cd0fc55c9a8b502"></a><!-- doxytag: member="multiset::list_first_pair_const" ref="g71a3d48a34a961956cd0fc55c9a8b502" args="(const list *l, const void **e1, const void **e2)" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g71a3d48a34a961956cd0fc55c9a8b502">list_first_pair_const</a> (const <a class="el" href="structlist.html">list</a> *l, const void **e1, const void **e2)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g1a78a6f27d351d9e1dc99d2247a2455b"></a><!-- doxytag: member="multiset::list_first_pair" ref="g1a78a6f27d351d9e1dc99d2247a2455b" args="(list *l, void **e1, void **e2)" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g1a78a6f27d351d9e1dc99d2247a2455b">list_first_pair</a> (<a class="el" href="structlist.html">list</a> *l, void **e1, void **e2)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g8723ab90a5925a64e30c250e770d10d0"></a><!-- doxytag: member="multiset::list_next_pair_const" ref="g8723ab90a5925a64e30c250e770d10d0" args="(const list *l, const void **e1, const void **e2)" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g8723ab90a5925a64e30c250e770d10d0">list_next_pair_const</a> (const <a class="el" href="structlist.html">list</a> *l, const void **e1, const void **e2)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g72eca5c2f995f7885c72dff4b77a6dfe"></a><!-- doxytag: member="multiset::list_next_pair" ref="g72eca5c2f995f7885c72dff4b77a6dfe" args="(list *l, void **e1, void **e2)" -->
-void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g72eca5c2f995f7885c72dff4b77a6dfe">list_next_pair</a> (<a class="el" href="structlist.html">list</a> *l, void **e1, void **e2)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structlist.html">list</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g014e03d131a3d24d1d52465fd0f63a2f">list_extract</a> (const <a class="el" href="structlist.html">list</a> *l, void *(*duplicate)(const void *), bool(*predicate)(const void *, void *), void *data)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Extract elements.  <a href="#g014e03d131a3d24d1d52465fd0f63a2f"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gc52f12226db01726e092b3ec7c95ebc4"></a><!-- doxytag: member="multiset::list_min" ref="gc52f12226db01726e092b3ec7c95ebc4" args="(list *l, list_func_lt less_than, void *data)" -->
-void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gc52f12226db01726e092b3ec7c95ebc4">list_min</a> (<a class="el" href="structlist.html">list</a> *l, list_func_lt less_than, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gf6935394b702cbc694e5dda2521c181b"></a><!-- doxytag: member="multiset::list_min_val" ref="gf6935394b702cbc694e5dda2521c181b" args="(list *l, list_func_eval eval, void *data)" -->
-void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gf6935394b702cbc694e5dda2521c181b">list_min_val</a> (<a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g13ef29594314bbfb2d5ecd3a059653f9"></a><!-- doxytag: member="multiset::list_max_val" ref="g13ef29594314bbfb2d5ecd3a059653f9" args="(list *l, list_func_eval eval, void *data)" -->
-void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g13ef29594314bbfb2d5ecd3a059653f9">list_max_val</a> (<a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g39d692d83a67a5554962f19684ebbe70"></a><!-- doxytag: member="multiset::list_max_const" ref="g39d692d83a67a5554962f19684ebbe70" args="(const list *l, list_func_lt less_than, void *data)" -->
-const void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g39d692d83a67a5554962f19684ebbe70">list_max_const</a> (const <a class="el" href="structlist.html">list</a> *l, list_func_lt less_than, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd24f0143a53c96f495c7d2cc7a7e6aca"></a><!-- doxytag: member="multiset::list_max" ref="gd24f0143a53c96f495c7d2cc7a7e6aca" args="(list *l, list_func_lt less_than, void *data)" -->
-void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gd24f0143a53c96f495c7d2cc7a7e6aca">list_max</a> (<a class="el" href="structlist.html">list</a> *l, list_func_lt less_than, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ge1f21da53f4a26ca9dd7e25f19286408"></a><!-- doxytag: member="multiset::kth" ref="ge1f21da53f4a26ca9dd7e25f19286408" args="(const void *a[], int k, int n, list_func_lt less_than, void *data)" -->
-static const void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#ge1f21da53f4a26ca9dd7e25f19286408">kth</a> (const void *a[], int k, int n, list_func_lt less_than, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gbe07f00186264749cbecd016562119d1"></a><!-- doxytag: member="multiset::list_kth_const" ref="gbe07f00186264749cbecd016562119d1" args="(const list *l, int k, list_func_lt less_than, void *data)" -->
-const void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gbe07f00186264749cbecd016562119d1">list_kth_const</a> (const <a class="el" href="structlist.html">list</a> *l, int k, list_func_lt less_than, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gee7de62f4bb9591e4c2cd75056f30c57"></a><!-- doxytag: member="multiset::list_kth" ref="gee7de62f4bb9591e4c2cd75056f30c57" args="(list *l, int k, list_func_lt less_than, void *data)" -->
-void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gee7de62f4bb9591e4c2cd75056f30c57">list_kth</a> (<a class="el" href="structlist.html">list</a> *l, int k, list_func_lt less_than, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g6d335487e4c513ed07ae0683e937670d"></a><!-- doxytag: member="multiset::val_less_than" ref="g6d335487e4c513ed07ae0683e937670d" args="(const void *e1, const void *e2, void *data)" -->
-static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g6d335487e4c513ed07ae0683e937670d">val_less_than</a> (const void *e1, const void *e2, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gf25d4a9d7f9563e177dcf3bc6a8a5c7e"></a><!-- doxytag: member="multiset::list_kth_val_const" ref="gf25d4a9d7f9563e177dcf3bc6a8a5c7e" args="(const list *l, int k, list_func_eval eval, void *data)" -->
-const void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gf25d4a9d7f9563e177dcf3bc6a8a5c7e">list_kth_val_const</a> (const <a class="el" href="structlist.html">list</a> *l, int k, list_func_eval eval, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5eede66c73b61927347fb3c758896353"></a><!-- doxytag: member="multiset::list_kth_val" ref="g5eede66c73b61927347fb3c758896353" args="(list *l, int k, list_func_eval eval, void *data)" -->
-void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g5eede66c73b61927347fb3c758896353">list_kth_val</a> (<a class="el" href="structlist.html">list</a> *l, int k, list_func_eval eval, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g41f7807a7a5b85063ccd7f8b44a22503"></a><!-- doxytag: member="multiset::list_median" ref="g41f7807a7a5b85063ccd7f8b44a22503" args="(const list *l, list_func_eval eval, void *data)" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g41f7807a7a5b85063ccd7f8b44a22503">list_median</a> (const <a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gae34efc79a1739b874206aa063c0d146"></a><!-- doxytag: member="multiset::list_mean" ref="gae34efc79a1739b874206aa063c0d146" args="(const list *l, list_func_eval eval, void *data)" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gae34efc79a1739b874206aa063c0d146">list_mean</a> (const <a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g064d7efd017b52f7a6301dfe305fb5b2"></a><!-- doxytag: member="multiset::list_mean_optimal" ref="g064d7efd017b52f7a6301dfe305fb5b2" args="(const list *l, list_func_eval eval, void *data_eval, list_func_eval eval_err, void *data_err, double *err, double *red_chisq)" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g064d7efd017b52f7a6301dfe305fb5b2">list_mean_optimal</a> (const <a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data_eval, list_func_eval eval_err, void *data_err, double *err, double *red_chisq)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5eb7be510583960ae3d42c84683dbb34"></a><!-- doxytag: member="multiset::abs_dev" ref="g5eb7be510583960ae3d42c84683dbb34" args="(const void *e1, void *data)" -->
-static double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g5eb7be510583960ae3d42c84683dbb34">abs_dev</a> (const void *e1, void *data)</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g2a273e58ffe66d39796a4c2c795256c6"></a><!-- doxytag: member="multiset::list_mad" ref="g2a273e58ffe66d39796a4c2c795256c6" args="(list *l, list_func_eval eval, void *data)" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g2a273e58ffe66d39796a4c2c795256c6">list_mad</a> (<a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data)</td></tr>
-
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void *(*) </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g835886d7e2108ff01e9123261b28eb1e">list_malloc</a> (size_t) = malloc</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g843d830e4acbd1326b14d344203e9ac5"></a><!-- doxytag: member="multiset::list_calloc" ref="g843d830e4acbd1326b14d344203e9ac5" args="(size_t, size_t)" -->
-static void *(*) </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g843d830e4acbd1326b14d344203e9ac5">list_calloc</a> (size_t, size_t) = calloc</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd791852a26bb24410135aa504c029ac8"></a><!-- doxytag: member="multiset::list_realloc" ref="gd791852a26bb24410135aa504c029ac8" args="(void *, size_t)" -->
-static void *(*) </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gd791852a26bb24410135aa504c029ac8">list_realloc</a> (void *, size_t) = realloc</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g7d02aeb71198273b9f07173f4ff19a5b"></a><!-- doxytag: member="multiset::list_free" ref="g7d02aeb71198273b9f07173f4ff19a5b" args="(const void *)" -->
-static void(*) </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#g7d02aeb71198273b9f07173f4ff19a5b">list_free</a> (const void *) = (void (*)(const void *))free</td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#nested-classes">Data Structures</a> |
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">container type</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structlist.html">list</a></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7170ba2dc8c539aee2d29c8a8edd4d5a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>(EXPR)   assert(EXPR)</td></tr>
+<tr class="separator:ga7170ba2dc8c539aee2d29c8a8edd4d5a"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga9b9a23d98f58af888b2d2d3072f8b999"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structlist.html">list</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#ga9b9a23d98f58af888b2d2d3072f8b999">list_new</a> (void)</td></tr>
+<tr class="memdesc:ga9b9a23d98f58af888b2d2d3072f8b999"><td class="mdescLeft"> </td><td class="mdescRight">Constructor.  <a href="#ga9b9a23d98f58af888b2d2d3072f8b999">More...</a><br/></td></tr>
+<tr class="separator:ga9b9a23d98f58af888b2d2d3072f8b999"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac2d7ea2bf8ee3637bc9167916e637f30"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structlist.html">list</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gac2d7ea2bf8ee3637bc9167916e637f30">list_duplicate</a> (const <a class="el" href="structlist.html">list</a> *l, void *(*duplicate)(const void *))</td></tr>
+<tr class="memdesc:gac2d7ea2bf8ee3637bc9167916e637f30"><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor.  <a href="#gac2d7ea2bf8ee3637bc9167916e637f30">More...</a><br/></td></tr>
+<tr class="separator:gac2d7ea2bf8ee3637bc9167916e637f30"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga71cc8d784aff4653ac6bd8e0724780e4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga71cc8d784aff4653ac6bd8e0724780e4"></a>
+void </td><td class="memItemRight" valign="bottom"><b>list_delete_const</b> (const <a class="el" href="structlist.html">list</a> **l, void(*ldelete)(void **))</td></tr>
+<tr class="separator:ga71cc8d784aff4653ac6bd8e0724780e4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga883631f4b10a6d912b5508353743c0da"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga883631f4b10a6d912b5508353743c0da"></a>
+void </td><td class="memItemRight" valign="bottom"><b>list_delete</b> (<a class="el" href="structlist.html">list</a> **l, void(*ldelete)(void **))</td></tr>
+<tr class="separator:ga883631f4b10a6d912b5508353743c0da"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6dd47461521abb4788903e8845df8665"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6dd47461521abb4788903e8845df8665"></a>
+int </td><td class="memItemRight" valign="bottom"><b>list_size</b> (const <a class="el" href="structlist.html">list</a> *l)</td></tr>
+<tr class="separator:ga6dd47461521abb4788903e8845df8665"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gac96b31bf7509ede319e5dd7b6a57c8b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac96b31bf7509ede319e5dd7b6a57c8b7"></a>
+void </td><td class="memItemRight" valign="bottom"><b>list_insert</b> (<a class="el" href="structlist.html">list</a> *l, void *e)</td></tr>
+<tr class="separator:gac96b31bf7509ede319e5dd7b6a57c8b7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad865955a3a3615158490e2ca7eb4e051"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad865955a3a3615158490e2ca7eb4e051"></a>
+const void * </td><td class="memItemRight" valign="bottom"><b>list_remove_const</b> (<a class="el" href="structlist.html">list</a> *l, const void *e)</td></tr>
+<tr class="separator:gad865955a3a3615158490e2ca7eb4e051"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga82f27bf059a874514b690eb87485b3a9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga82f27bf059a874514b690eb87485b3a9"></a>
+void * </td><td class="memItemRight" valign="bottom"><b>list_remove</b> (<a class="el" href="structlist.html">list</a> *l, void *e)</td></tr>
+<tr class="separator:ga82f27bf059a874514b690eb87485b3a9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga46e0a8576f5289344cbacf63e7fbe008"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga46e0a8576f5289344cbacf63e7fbe008"></a>
+void </td><td class="memItemRight" valign="bottom"><b>list_reverse</b> (<a class="el" href="structlist.html">list</a> *l)</td></tr>
+<tr class="separator:ga46e0a8576f5289344cbacf63e7fbe008"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab3cf221632da8cbfa6ba17ce46c19be5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab3cf221632da8cbfa6ba17ce46c19be5"></a>
+const void * </td><td class="memItemRight" valign="bottom"><b>list_first_const</b> (const <a class="el" href="structlist.html">list</a> *l)</td></tr>
+<tr class="separator:gab3cf221632da8cbfa6ba17ce46c19be5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf21759c8c3e2901f5c975b92c242b928"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaf21759c8c3e2901f5c975b92c242b928"></a>
+void * </td><td class="memItemRight" valign="bottom"><b>list_first</b> (<a class="el" href="structlist.html">list</a> *l)</td></tr>
+<tr class="separator:gaf21759c8c3e2901f5c975b92c242b928"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga90ccfa07b503becbebf18febc26bde05"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga90ccfa07b503becbebf18febc26bde05"></a>
+const void * </td><td class="memItemRight" valign="bottom"><b>list_next_const</b> (const <a class="el" href="structlist.html">list</a> *l)</td></tr>
+<tr class="separator:ga90ccfa07b503becbebf18febc26bde05"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadec72210f2c923dfe7892b9d2061ba5c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gadec72210f2c923dfe7892b9d2061ba5c"></a>
+void * </td><td class="memItemRight" valign="bottom"><b>list_next</b> (<a class="el" href="structlist.html">list</a> *l)</td></tr>
+<tr class="separator:gadec72210f2c923dfe7892b9d2061ba5c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gabcb549a35d8d77e9f67f0222b317151f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gabcb549a35d8d77e9f67f0222b317151f"></a>
+void </td><td class="memItemRight" valign="bottom"><b>list_first_pair_const</b> (const <a class="el" href="structlist.html">list</a> *l, const void **e1, const void **e2)</td></tr>
+<tr class="separator:gabcb549a35d8d77e9f67f0222b317151f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9fb3208157c8385a1c5820c70d974221"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9fb3208157c8385a1c5820c70d974221"></a>
+void </td><td class="memItemRight" valign="bottom"><b>list_first_pair</b> (<a class="el" href="structlist.html">list</a> *l, void **e1, void **e2)</td></tr>
+<tr class="separator:ga9fb3208157c8385a1c5820c70d974221"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga92413bd987bc459aa793986b7fdcc0b3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga92413bd987bc459aa793986b7fdcc0b3"></a>
+void </td><td class="memItemRight" valign="bottom"><b>list_next_pair_const</b> (const <a class="el" href="structlist.html">list</a> *l, const void **e1, const void **e2)</td></tr>
+<tr class="separator:ga92413bd987bc459aa793986b7fdcc0b3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae16b00f64fd94c4fd10309662bfd8713"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae16b00f64fd94c4fd10309662bfd8713"></a>
+void </td><td class="memItemRight" valign="bottom"><b>list_next_pair</b> (<a class="el" href="structlist.html">list</a> *l, void **e1, void **e2)</td></tr>
+<tr class="separator:gae16b00f64fd94c4fd10309662bfd8713"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaf355fe5f4ce5910b419c80ae14bf5199"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structlist.html">list</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#gaf355fe5f4ce5910b419c80ae14bf5199">list_extract</a> (const <a class="el" href="structlist.html">list</a> *l, void *(*duplicate)(const void *), bool(*predicate)(const void *, void *), void *data)</td></tr>
+<tr class="memdesc:gaf355fe5f4ce5910b419c80ae14bf5199"><td class="mdescLeft"> </td><td class="mdescRight">Extract elements.  <a href="#gaf355fe5f4ce5910b419c80ae14bf5199">More...</a><br/></td></tr>
+<tr class="separator:gaf355fe5f4ce5910b419c80ae14bf5199"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gafaa8c6edd6f50c03b04bed76ea83a20f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafaa8c6edd6f50c03b04bed76ea83a20f"></a>
+void * </td><td class="memItemRight" valign="bottom"><b>list_min</b> (<a class="el" href="structlist.html">list</a> *l, list_func_lt less_than, void *data)</td></tr>
+<tr class="separator:gafaa8c6edd6f50c03b04bed76ea83a20f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga307e4525ac81a6cabbf03913be5eb0d4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga307e4525ac81a6cabbf03913be5eb0d4"></a>
+void * </td><td class="memItemRight" valign="bottom"><b>list_min_val</b> (<a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data)</td></tr>
+<tr class="separator:ga307e4525ac81a6cabbf03913be5eb0d4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2fabd89564e393c78bf3037468ec546b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2fabd89564e393c78bf3037468ec546b"></a>
+void * </td><td class="memItemRight" valign="bottom"><b>list_max_val</b> (<a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data)</td></tr>
+<tr class="separator:ga2fabd89564e393c78bf3037468ec546b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga44c7a16d614151b241aaf52fdbc2257b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga44c7a16d614151b241aaf52fdbc2257b"></a>
+const void * </td><td class="memItemRight" valign="bottom"><b>list_max_const</b> (const <a class="el" href="structlist.html">list</a> *l, list_func_lt less_than, void *data)</td></tr>
+<tr class="separator:ga44c7a16d614151b241aaf52fdbc2257b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga4a0dc8306e5e3658abe167531b09aa8d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4a0dc8306e5e3658abe167531b09aa8d"></a>
+void * </td><td class="memItemRight" valign="bottom"><b>list_max</b> (<a class="el" href="structlist.html">list</a> *l, list_func_lt less_than, void *data)</td></tr>
+<tr class="separator:ga4a0dc8306e5e3658abe167531b09aa8d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga1d98257a6428bdaa421182c98fa678fb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1d98257a6428bdaa421182c98fa678fb"></a>
+static const void * </td><td class="memItemRight" valign="bottom"><b>kth</b> (const void *a[], int k, int n, list_func_lt less_than, void *data)</td></tr>
+<tr class="separator:ga1d98257a6428bdaa421182c98fa678fb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad758e8f1d12a4ef2b2c70583436a4019"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad758e8f1d12a4ef2b2c70583436a4019"></a>
+const void * </td><td class="memItemRight" valign="bottom"><b>list_kth_const</b> (const <a class="el" href="structlist.html">list</a> *l, int k, list_func_lt less_than, void *data)</td></tr>
+<tr class="separator:gad758e8f1d12a4ef2b2c70583436a4019"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e7725d1601b893517c7b7f80133d73e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7e7725d1601b893517c7b7f80133d73e"></a>
+void * </td><td class="memItemRight" valign="bottom"><b>list_kth</b> (<a class="el" href="structlist.html">list</a> *l, int k, list_func_lt less_than, void *data)</td></tr>
+<tr class="separator:ga7e7725d1601b893517c7b7f80133d73e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga304352750f0a5f58b2d1a0f27debc5b3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga304352750f0a5f58b2d1a0f27debc5b3"></a>
+static bool </td><td class="memItemRight" valign="bottom"><b>val_less_than</b> (const void *e1, const void *e2, void *data)</td></tr>
+<tr class="separator:ga304352750f0a5f58b2d1a0f27debc5b3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga2686278ac8d813c922895dc7497d9328"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2686278ac8d813c922895dc7497d9328"></a>
+const void * </td><td class="memItemRight" valign="bottom"><b>list_kth_val_const</b> (const <a class="el" href="structlist.html">list</a> *l, int k, list_func_eval eval, void *data)</td></tr>
+<tr class="separator:ga2686278ac8d813c922895dc7497d9328"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaca58359f15efcb94ba70cf9a3b70f509"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaca58359f15efcb94ba70cf9a3b70f509"></a>
+void * </td><td class="memItemRight" valign="bottom"><b>list_kth_val</b> (<a class="el" href="structlist.html">list</a> *l, int k, list_func_eval eval, void *data)</td></tr>
+<tr class="separator:gaca58359f15efcb94ba70cf9a3b70f509"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga8d5240ec55c316b3774abeb9333347b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8d5240ec55c316b3774abeb9333347b7"></a>
+double </td><td class="memItemRight" valign="bottom"><b>list_median</b> (const <a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data)</td></tr>
+<tr class="separator:ga8d5240ec55c316b3774abeb9333347b7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga72f528df806c961a28a9c83de3cb89f3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga72f528df806c961a28a9c83de3cb89f3"></a>
+double </td><td class="memItemRight" valign="bottom"><b>list_mean</b> (const <a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data)</td></tr>
+<tr class="separator:ga72f528df806c961a28a9c83de3cb89f3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga6d08786bc84010dfd382ae36608d74f1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6d08786bc84010dfd382ae36608d74f1"></a>
+double </td><td class="memItemRight" valign="bottom"><b>list_mean_optimal</b> (const <a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data_eval, list_func_eval eval_err, void *data_err, double *err, double *red_chisq)</td></tr>
+<tr class="separator:ga6d08786bc84010dfd382ae36608d74f1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga84ddcd8e89c40b0b134af4fbfa620172"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga84ddcd8e89c40b0b134af4fbfa620172"></a>
+static double </td><td class="memItemRight" valign="bottom"><b>abs_dev</b> (const void *e1, void *data)</td></tr>
+<tr class="separator:ga84ddcd8e89c40b0b134af4fbfa620172"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga783b95234c567cbeeb59b3009eead316"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga783b95234c567cbeeb59b3009eead316"></a>
+double </td><td class="memItemRight" valign="bottom"><b>list_mad</b> (<a class="el" href="structlist.html">list</a> *l, list_func_eval eval, void *data)</td></tr>
+<tr class="separator:ga783b95234c567cbeeb59b3009eead316"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga4d27e95761e1b21498ad7653acc80d35"><td class="memItemLeft" align="right" valign="top">static void *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__multiset.html#ga4d27e95761e1b21498ad7653acc80d35">list_malloc</a> )(size_t) = malloc</td></tr>
+<tr class="separator:ga4d27e95761e1b21498ad7653acc80d35"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga53649894f899f4009ab1d2acf776ac58"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga53649894f899f4009ab1d2acf776ac58"></a>
+static void *(* </td><td class="memItemRight" valign="bottom"><b>list_calloc</b> )(size_t, size_t) = calloc</td></tr>
+<tr class="separator:ga53649894f899f4009ab1d2acf776ac58"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7023af2bbc45d072011310fb7c57d102"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7023af2bbc45d072011310fb7c57d102"></a>
+static void *(* </td><td class="memItemRight" valign="bottom"><b>list_realloc</b> )(void *, size_t) = realloc</td></tr>
+<tr class="separator:ga7023af2bbc45d072011310fb7c57d102"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga61ba21429b4fde5f5ab252547acafce2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga61ba21429b4fde5f5ab252547acafce2"></a>
+static void(* </td><td class="memItemRight" valign="bottom"><b>list_free</b> )(const void *) = (void (*)(const void *))free</td></tr>
+<tr class="separator:ga61ba21429b4fde5f5ab252547acafce2"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-The order of elements is undefined and there may be duplicates.<p>
-This container is polymorphic and typesafe. That is, the elements are typed, not void pointers.<p>
-A few things to be aware of:<ul>
-<li>It is left to the user to define whether the list owns (i.e. is responsible for deallocating) its elements. Therefore the <a class="el" href="group__multiset.html#g023d28b5567e53901b78d9311fc5ca35">list_delete()</a> function takes an additional argument which is the element destructor function. If a NULL function pointer is given, the elements are not deleted.</li><li>Iterations: The current position is stored in the list's internal cache. Therefore, more than one simultaneous iterat [...]
-<p>
-To define a class called e.g. integer_list, put in a source file <div class="fragment"><pre class="fragment"><span class="preprocessor">     #define LIST_DEFINE</span>
-<span class="preprocessor"></span><span class="preprocessor">     #define LIST_ELEM integer </span>
-<span class="preprocessor">     #include <list.h></span>
-</pre></div><p>
-And put in the header <div class="fragment"><pre class="fragment"><span class="preprocessor">     #define LIST_ELEM integer </span>
-<span class="preprocessor">     #include <list.h></span>
-</pre></div> <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g867790f186ab6cc04c00a80f80983991"></a><!-- doxytag: member="list.c::assure" ref="g867790f186ab6cc04c00a80f80983991" args="(EXPR)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>The order of elements is undefined and there may be duplicates.</p>
+<p>This container is polymorphic and typesafe. That is, the elements are typed, not void pointers.</p>
+<p>A few things to be aware of:</p>
+<ul>
+<li>It is left to the user to define whether the list owns (i.e. is responsible for deallocating) its elements. Therefore the list_delete() function takes an additional argument which is the element destructor function. If a NULL function pointer is given, the elements are not deleted.</li>
+<li>Iterations: The current position is stored in the list's internal cache. Therefore, more than one simultaneous iteration over a list is not possible. To achieve this functionality, just duplicate the list and iterate over the different copies. (An alternative solution would be to introduce iterator objects with the overhead of that.)</li>
+</ul>
+<p>To define a class called e.g. integer_list, put in a source file </p>
+<div class="fragment"><div class="line"><span class="preprocessor">#define LIST_DEFINE</span></div>
+<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM integer </span></div>
+<div class="line"><span class="preprocessor">#include <list.h></span></div>
+</div><!-- fragment --><p>And put in the header </p>
+<div class="fragment"><div class="line"><span class="preprocessor">#define LIST_ELEM integer </span></div>
+<div class="line"><span class="preprocessor">#include <list.h></span></div>
+</div><!-- fragment --> <h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7170ba2dc8c539aee2d29c8a8edd4d5a"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define assure          </td>
+          <td class="memname">#define assure</td>
           <td>(</td>
-          <td class="paramtype">EXPR </td>
-          <td class="paramname">          </td>
-          <td> ) </td>
-          <td width="100%">   assert(EXPR)</td>
+          <td class="paramtype"> </td>
+          <td class="paramname">EXPR</td><td>)</td>
+          <td>   assert(EXPR)</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+<p>Define error handling here </p>
+
+<p>Definition at line <a class="el" href="list_8c_source.html#l00101">101</a> of file <a class="el" href="list_8c_source.html">list.c</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__star_8c_source.html#l00073">_get_optional_table_value()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l03388">build_equations_lhs_matrix_from_parameters()</a>, <a class="el" href="fors__photometry__impl_8c_source.html#l03566">build_equations_lhs_matrix_from_poly()</a>, <a class="el" href="test__simulate_8c_source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c_source.html#l00273">create_dark()</a>, <a class [...]
 
-<p>
-Define error handling here 
-<p>
-Definition at line <a class="el" href="list_8c-source.html#l00101">101</a> of file <a class="el" href="list_8c-source.html">list.c</a>.
-<p>
-Referenced by <a class="el" href="fors__star_8c-source.html#l00073">_get_optional_table_value()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l03446">build_equations_lhs_matrix_from_parameters()</a>, <a class="el" href="fors__photometry__impl_8c-source.html#l03624">build_equations_lhs_matrix_from_poly()</a>, <a class="el" href="test__simulate_8c-source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c-source.html#l00273">create_dark()</a>, <a class="e [...]
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="g14ca81b1edd1222975ab52e203cbde59"></a><!-- doxytag: member="list.c::list_new" ref="g14ca81b1edd1222975ab52e203cbde59" args="(void)" -->
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga9b9a23d98f58af888b2d2d3072f8b999"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="structlist.html">list</a>* list_new           </td>
+          <td class="memname"><a class="el" href="structlist.html">list</a>* list_new </td>
           <td>(</td>
-          <td class="paramtype">void </td>
-          <td class="paramname">          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">void </td>
+          <td class="paramname"></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
+
+<p>Constructor. </p>
+<dl class="section return"><dt>Returns</dt><dd>newly allocated list </dd></dl>
+
+<p>Definition at line <a class="el" href="list_8c_source.html#l00108">108</a> of file <a class="el" href="list_8c_source.html">list.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00092">list_malloc</a>.</p>
 
-<p>
-Constructor. 
-<p>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated list </dd></dl>
+<p>Referenced by <a class="el" href="list_8c_source.html#l00507">list_extract()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="list_8c-source.html#l00108">108</a> of file <a class="el" href="list_8c-source.html">list.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00092">list_malloc</a>.
-<p>
-Referenced by <a class="el" href="list_8c-source.html#l00507">list_extract()</a>.
 </div>
-</div><p>
-<a class="anchor" name="ge8bd4915a67367a226dcd3f5c3bd5491"></a><!-- doxytag: member="list.c::list_duplicate" ref="ge8bd4915a67367a226dcd3f5c3bd5491" args="(const list *l, void *(*duplicate)(const void *))" -->
+</div>
+<a class="anchor" id="gac2d7ea2bf8ee3637bc9167916e637f30"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="structlist.html">list</a>* list_duplicate           </td>
+          <td class="memname"><a class="el" href="structlist.html">list</a>* list_duplicate </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="structlist.html">list</a> * </td>
-          <td class="paramname"> <em>l</em>, </td>
+          <td class="paramtype">const <a class="el" href="structlist.html">list</a> * </td>
+          <td class="paramname"><em>l</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void *(*)(const void *) </td>
-          <td class="paramname"> <em>duplicate</em></td><td> </td>
+          <td class="paramtype">void *(*)(const void *) </td>
+          <td class="paramname"><em>duplicate</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Copy constructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>l</em> </td><td>list to duplicate </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>duplicate</em> </td><td>element copy constructor, or NULL for no deep copy </td></tr>
+<p>Copy constructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">l</td><td>list to duplicate </td></tr>
+    <tr><td class="paramname">duplicate</td><td>element copy constructor, or NULL for no deep copy </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly allocated list </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>newly allocated list </dd></dl>
+
+<p>Definition at line <a class="el" href="list_8c_source.html#l00126">126</a> of file <a class="el" href="list_8c_source.html">list.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="list_8c_source.html#l00092">list_malloc</a>.</p>
 
-<p>
-Definition at line <a class="el" href="list_8c-source.html#l00126">126</a> of file <a class="el" href="list_8c-source.html">list.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="list_8c-source.html#l00078">list::back</a>, <a class="el" href="list_8c-source.html#l00080">list::current</a>, <a class="el" href="list_8c-source.html#l00082">list::current_p1</a>, <a class="el" href="list_8c-source.html#l00082">list::current_p2</a>, <a class="el" href="list_8c-source.html#l00076">list::elements</a>, <a class="el" href="list_8c-source.html#l00092">list_malloc</a>, and <a class="el" [...]
 </div>
-</div><p>
-<a class="anchor" name="g014e03d131a3d24d1d52465fd0f63a2f"></a><!-- doxytag: member="list.c::list_extract" ref="g014e03d131a3d24d1d52465fd0f63a2f" args="(const list *l, void *(*duplicate)(const void *), bool(*predicate)(const void *, void *), void *data)" -->
+</div>
+<a class="anchor" id="gaf355fe5f4ce5910b419c80ae14bf5199"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname"><a class="el" href="structlist.html">list</a>* list_extract           </td>
+          <td class="memname"><a class="el" href="structlist.html">list</a>* list_extract </td>
           <td>(</td>
-          <td class="paramtype">const <a class="el" href="structlist.html">list</a> * </td>
-          <td class="paramname"> <em>l</em>, </td>
+          <td class="paramtype">const <a class="el" href="structlist.html">list</a> * </td>
+          <td class="paramname"><em>l</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void *(*)(const void *) </td>
-          <td class="paramname"> <em>duplicate</em>, </td>
+          <td class="paramtype">void *(*)(const void *) </td>
+          <td class="paramname"><em>duplicate</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">bool(*)(const void *, void *) </td>
-          <td class="paramname"> <em>predicate</em>, </td>
+          <td class="paramtype">bool(*)(const void *, void *) </td>
+          <td class="paramname"><em>predicate</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">void * </td>
-          <td class="paramname"> <em>data</em></td><td> </td>
+          <td class="paramtype">void * </td>
+          <td class="paramname"><em>data</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Extract elements. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>l</em> </td><td>list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>duplicate</em> </td><td>element copy constructor </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>predicate</em> </td><td>function returning true iff the element (given as the 1st) argument must be extracted. </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>Auxillary data sent to the selection function. May be NULL. </td></tr>
+</div><div class="memdoc">
+
+<p>Extract elements. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">l</td><td>list </td></tr>
+    <tr><td class="paramname">duplicate</td><td>element copy constructor </td></tr>
+    <tr><td class="paramname">predicate</td><td>function returning true iff the element (given as the 1st) argument must be extracted. </td></tr>
+    <tr><td class="paramname">data</td><td>Auxillary data sent to the selection function. May be NULL. </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>Newly allocated, possibly empty, list containing the elements which satisfy the given predicate</dd></dl>
-Time: O(n) 
-<p>
-Definition at line <a class="el" href="list_8c-source.html#l00507">507</a> of file <a class="el" href="list_8c-source.html">list.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="list_8c-source.html#l00076">list::elements</a>, <a class="el" href="list_8c-source.html#l00211">list_insert()</a>, <a class="el" href="list_8c-source.html#l00108">list_new()</a>, and <a class="el" href="list_8c-source.html#l00077">list::size</a>.
+<dl class="section return"><dt>Returns</dt><dd>Newly allocated, possibly empty, list containing the elements which satisfy the given predicate</dd></dl>
+<p>Time: O(n) </p>
+
+<p>Definition at line <a class="el" href="list_8c_source.html#l00507">507</a> of file <a class="el" href="list_8c_source.html">list.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="list_8c_source.html#l00108">list_new()</a>.</p>
+
 </div>
-</div><p>
-<hr><h2>Variable Documentation</h2>
-<a class="anchor" name="g835886d7e2108ff01e9123261b28eb1e"></a><!-- doxytag: member="list.c::list_malloc" ref="g835886d7e2108ff01e9123261b28eb1e" args="(size_t)" -->
+</div>
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="ga4d27e95761e1b21498ad7653acc80d35"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">void*(*) <a class="el" href="group__multiset.html#g835886d7e2108ff01e9123261b28eb1e">list_malloc</a>(size_t) = malloc<code> [static]</code>          </td>
+          <td class="memname">void*(* list_malloc)(size_t) = malloc</td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+<p>Define memory handling here </p>
+
+<p>Definition at line <a class="el" href="list_8c_source.html#l00092">92</a> of file <a class="el" href="list_8c_source.html">list.c</a>.</p>
 
-<p>
-Define memory handling here 
-<p>
-Definition at line <a class="el" href="list_8c-source.html#l00092">92</a> of file <a class="el" href="list_8c-source.html">list.c</a>.
-<p>
-Referenced by <a class="el" href="list_8c-source.html#l00126">list_duplicate()</a>, <a class="el" href="list_8c-source.html#l00709">list_kth_const()</a>, and <a class="el" href="list_8c-source.html#l00108">list_new()</a>.
+<p>Referenced by <a class="el" href="list_8c_source.html#l00126">list_duplicate()</a>, and <a class="el" href="list_8c_source.html#l00108">list_new()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__recipes__test.html b/html/group__recipes__test.html
index 7a78c80..4ef21de 100644
--- a/html/group__recipes__test.html
+++ b/html/group__recipes__test.html
@@ -1,28 +1,63 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Recipes_test</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Recipes_test</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g5ad1c26f00c2399d3a5c7850100212d0"></a><!-- doxytag: member="recipes_test::main" ref="g5ad1c26f00c2399d3a5c7850100212d0" args="(void)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__recipes__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a> (void)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Hello world test. <br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Recipes_test</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga840291bc02cba5474a4cb46a9b9566fe"></a>
+int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__recipes__test.html#ga840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
+<tr class="memdesc:ga840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">Hello world test. <br/></td></tr>
+<tr class="separator:ga840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__test.html b/html/group__test.html
index d7e7a27..ac7a3a3 100644
--- a/html/group__test.html
+++ b/html/group__test.html
@@ -1,721 +1,752 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Unit test infrastructure</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Unit test infrastructure</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#gf80c8e8f1596284c4a41600a7d381e92">_test</a> (int expression, const char *message, const char *function, const char *file, unsigned line)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Evaluate an expression and update an internal counter if it fails.  <a href="#gf80c8e8f1596284c4a41600a7d381e92"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#gab4f8f05aaa5e3f196c6353866f94981">test_macro</a> (int expression, const char *expr_string, const char *function, const char *file, unsigned line)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test a given expression.  <a href="#gab4f8f05aaa5e3f196c6353866f94981"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#g1da2e46a3658d3b80d1060ab04747507">test_eq_macro</a> (int first, const char *first_string, int second, const char *second_string, const char *function, const char *file, unsigned line)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test if two integer expressions are equal.  <a href="#g1da2e46a3658d3b80d1060ab04747507"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#g9c58a98a4f063f11ac233b3e11228485">test_eq_string_macro</a> (const char *first, const char *first_string, const char *second, const char *second_string, const char *function, const char *file, unsigned line)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test if two strings are equal.  <a href="#g9c58a98a4f063f11ac233b3e11228485"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#gfdcc2d4527a4292dffdb89df2e25e3a5">test_abs_macro</a> (double first, const char *first_string, double second, const char *second_string, double tolerance, const char *tolerance_string, const char *function, const char *file, unsigned line)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test if two numerical expressions are within a given (absolute) tolerance.  <a href="#gfdcc2d4527a4292dffdb89df2e25e3a5"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#g179ca9b6adab6c5e9c1b4259f08c16d7">test_rel_macro</a> (double first, const char *first_string, double second, const char *second_string, double tolerance, const char *tolerance_string, const char *function, const char *file, unsigned line)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test if two numerical expressions are within a given relative tolerance.  <a href="#g179ca9b6adab6c5e9c1b4259f08c16d7"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#gdf5b021e357a2554f044454d0b886ec6">test_init_macro</a> (const char *file)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize CPL + messaging.  <a href="#gdf5b021e357a2554f044454d0b886ec6"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#ga03e8561e85f5310576a5bf2ca4ffd63">test_end_macro</a> (const char *function, const char *file, unsigned line)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Perform the final checks and return the number of errors.  <a href="#ga03e8561e85f5310576a5bf2ca4ffd63"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#ge4730f9510e545e738aef9c8b7459b8b">test_recipe_output</a> (const cpl_frameset *frames, const char *const product_tags[], int n_prod, const char *main_product, const char *const qc[], int n_qc)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Test existence of recipe products.  <a href="#ge4730f9510e545e738aef9c8b7459b8b"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#g8bf3870fd210f34561f4f3f6010370a4">test_nfail</a> = 0</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gf18fa33a097747a6e4bb8c4f49bf0ed7"></a><!-- doxytag: member="test::error_init" ref="gf18fa33a097747a6e4bb8c4f49bf0ed7" args="" -->
-static cpl_errorstate </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#gf18fa33a097747a6e4bb8c4f49bf0ed7">error_init</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="test.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">Unit test infrastructure</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga95184b7220504cc982ef1741b9cfe8bd"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd">_test</a> (int expression, const char *message, const char *function, const char *file, unsigned line)</td></tr>
+<tr class="memdesc:ga95184b7220504cc982ef1741b9cfe8bd"><td class="mdescLeft"> </td><td class="mdescRight">Evaluate an expression and update an internal counter if it fails.  <a href="#ga95184b7220504cc982ef1741b9cfe8bd">More...</a><br/></td></tr>
+<tr class="separator:ga95184b7220504cc982ef1741b9cfe8bd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga69c8e2113cda1f0384f518415c224aeb"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#ga69c8e2113cda1f0384f518415c224aeb">test_macro</a> (int expression, const char *expr_string, const char *function, const char *file, unsigned line)</td></tr>
+<tr class="memdesc:ga69c8e2113cda1f0384f518415c224aeb"><td class="mdescLeft"> </td><td class="mdescRight">Test a given expression.  <a href="#ga69c8e2113cda1f0384f518415c224aeb">More...</a><br/></td></tr>
+<tr class="separator:ga69c8e2113cda1f0384f518415c224aeb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga0b29bcb36a03d68f05034d446b93b060"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#ga0b29bcb36a03d68f05034d446b93b060">test_eq_macro</a> (int first, const char *first_string, int second, const char *second_string, const char *function, const char *file, unsigned line)</td></tr>
+<tr class="memdesc:ga0b29bcb36a03d68f05034d446b93b060"><td class="mdescLeft"> </td><td class="mdescRight">Test if two integer expressions are equal.  <a href="#ga0b29bcb36a03d68f05034d446b93b060">More...</a><br/></td></tr>
+<tr class="separator:ga0b29bcb36a03d68f05034d446b93b060"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga393dca2c7f94fd2f47722083cda8d369"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#ga393dca2c7f94fd2f47722083cda8d369">test_eq_string_macro</a> (const char *first, const char *first_string, const char *second, const char *second_string, const char *function, const char *file, unsigned line)</td></tr>
+<tr class="memdesc:ga393dca2c7f94fd2f47722083cda8d369"><td class="mdescLeft"> </td><td class="mdescRight">Test if two strings are equal.  <a href="#ga393dca2c7f94fd2f47722083cda8d369">More...</a><br/></td></tr>
+<tr class="separator:ga393dca2c7f94fd2f47722083cda8d369"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae93f165e1b26c1b98e4ec9457a06714b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#gae93f165e1b26c1b98e4ec9457a06714b">test_abs_macro</a> (double first, const char *first_string, double second, const char *second_string, double tolerance, const char *tolerance_string, const char *function, const char *file, unsigned line)</td></tr>
+<tr class="memdesc:gae93f165e1b26c1b98e4ec9457a06714b"><td class="mdescLeft"> </td><td class="mdescRight">Test if two numerical expressions are within a given (absolute) tolerance.  <a href="#gae93f165e1b26c1b98e4ec9457a06714b">More...</a><br/></td></tr>
+<tr class="separator:gae93f165e1b26c1b98e4ec9457a06714b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga9cdeb6a0e44a5e2197eedce28865f000"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#ga9cdeb6a0e44a5e2197eedce28865f000">test_rel_macro</a> (double first, const char *first_string, double second, const char *second_string, double tolerance, const char *tolerance_string, const char *function, const char *file, unsigned line)</td></tr>
+<tr class="memdesc:ga9cdeb6a0e44a5e2197eedce28865f000"><td class="mdescLeft"> </td><td class="mdescRight">Test if two numerical expressions are within a given relative tolerance.  <a href="#ga9cdeb6a0e44a5e2197eedce28865f000">More...</a><br/></td></tr>
+<tr class="separator:ga9cdeb6a0e44a5e2197eedce28865f000"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gab73f634dbde2ec1403f0508d5c1d987b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#gab73f634dbde2ec1403f0508d5c1d987b">test_init_macro</a> (const char *file)</td></tr>
+<tr class="memdesc:gab73f634dbde2ec1403f0508d5c1d987b"><td class="mdescLeft"> </td><td class="mdescRight">Initialize CPL + messaging.  <a href="#gab73f634dbde2ec1403f0508d5c1d987b">More...</a><br/></td></tr>
+<tr class="separator:gab73f634dbde2ec1403f0508d5c1d987b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga27e574128e77cc503295df8191f583e5"><td class="memItemLeft" align="right" valign="top">unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#ga27e574128e77cc503295df8191f583e5">test_end_macro</a> (const char *function, const char *file, unsigned line)</td></tr>
+<tr class="memdesc:ga27e574128e77cc503295df8191f583e5"><td class="mdescLeft"> </td><td class="mdescRight">Perform the final checks and return the number of errors.  <a href="#ga27e574128e77cc503295df8191f583e5">More...</a><br/></td></tr>
+<tr class="separator:ga27e574128e77cc503295df8191f583e5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae130ff5a0f20a6e926dc7d57c5d4906c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c">test_recipe_output</a> (const cpl_frameset *frames, const char *const product_tags[], int n_prod, const char *main_product, const char *const qc[], int n_qc)</td></tr>
+<tr class="memdesc:gae130ff5a0f20a6e926dc7d57c5d4906c"><td class="mdescLeft"> </td><td class="mdescRight">Test existence of recipe products.  <a href="#gae130ff5a0f20a6e926dc7d57c5d4906c">More...</a><br/></td></tr>
+<tr class="separator:gae130ff5a0f20a6e926dc7d57c5d4906c"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:gafc4fd42e311ceffbc41f1e33da745af8"><td class="memItemLeft" align="right" valign="top">static unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8">test_nfail</a> = 0</td></tr>
+<tr class="separator:gafc4fd42e311ceffbc41f1e33da745af8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad490b5a7e4529d40b2ccad526c9df56d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad490b5a7e4529d40b2ccad526c9df56d"></a>
+static cpl_errorstate </td><td class="memItemRight" valign="bottom"><b>error_init</b></td></tr>
+<tr class="separator:gad490b5a7e4529d40b2ccad526c9df56d"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_propertylist_delete(product_header); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="test_8c_source.html#l00412">412</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_propertylist_delete(product_header); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00412">412</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="gf80c8e8f1596284c4a41600a7d381e92"></a><!-- doxytag: member="test.c::_test" ref="gf80c8e8f1596284c4a41600a7d381e92" args="(int expression, const char *message, const char *function, const char *file, unsigned line)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga95184b7220504cc982ef1741b9cfe8bd"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static void _test           </td>
+          <td class="memname">static void _test </td>
           <td>(</td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>expression</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>expression</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>message</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>message</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>function</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>function</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>file</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>file</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>line</em></td><td> </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>line</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Evaluate an expression and update an internal counter if it fails. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>expression</em> </td><td>The expression to evaluate </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>message</em> </td><td>The text message associated with the expression </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>function</em> </td><td>function name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>file</em> </td><td>filename </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>line</em> </td><td>line number </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Evaluate an expression and update an internal counter if it fails. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">expression</td><td>The expression to evaluate </td></tr>
+    <tr><td class="paramname">message</td><td>The text message associated with the expression </td></tr>
+    <tr><td class="paramname">function</td><td>function name </td></tr>
+    <tr><td class="paramname">file</td><td>filename </td></tr>
+    <tr><td class="paramname">line</td><td>line number </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00063">63</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
-<p>
-References <a class="el" href="test_8c-source.html#l00049">test_nfail</a>.
-<p>
-Referenced by <a class="el" href="test_8c-source.html#l00208">test_abs_macro()</a>, <a class="el" href="test_8c-source.html#l00139">test_eq_macro()</a>, <a class="el" href="test_8c-source.html#l00170">test_eq_string_macro()</a>, <a class="el" href="test_8c-source.html#l00112">test_macro()</a>, and <a class="el" href="test_8c-source.html#l00245">test_rel_macro()</a>.
+<p>Definition at line <a class="el" href="test_8c_source.html#l00063">63</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
+
+<p>References <a class="el" href="test_8c_source.html#l00049">test_nfail</a>.</p>
+
+<p>Referenced by <a class="el" href="test_8c_source.html#l00208">test_abs_macro()</a>, <a class="el" href="test_8c_source.html#l00139">test_eq_macro()</a>, <a class="el" href="test_8c_source.html#l00170">test_eq_string_macro()</a>, <a class="el" href="test_8c_source.html#l00112">test_macro()</a>, and <a class="el" href="test_8c_source.html#l00245">test_rel_macro()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="gab4f8f05aaa5e3f196c6353866f94981"></a><!-- doxytag: member="test.c::test_macro" ref="gab4f8f05aaa5e3f196c6353866f94981" args="(int expression, const char *expr_string, const char *function, const char *file, unsigned line)" -->
+</div>
+<a class="anchor" id="ga69c8e2113cda1f0384f518415c224aeb"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void test_macro           </td>
+          <td class="memname">void test_macro </td>
           <td>(</td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>expression</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>expression</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>expr_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>expr_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>function</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>function</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>file</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>file</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>line</em></td><td> </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>line</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Test a given expression. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>expression</em> </td><td>the expression to evaluate </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>expr_string</em> </td><td>the expression to evaluate as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>function</em> </td><td>function name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>file</em> </td><td>filename </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>line</em> </td><td>line number </td></tr>
+</div><div class="memdoc">
+
+<p>Test a given expression. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">expression</td><td>the expression to evaluate </td></tr>
+    <tr><td class="paramname">expr_string</td><td>the expression to evaluate as a string </td></tr>
+    <tr><td class="paramname">function</td><td>function name </td></tr>
+    <tr><td class="paramname">file</td><td>filename </td></tr>
+    <tr><td class="paramname">line</td><td>line number </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Note:</b></dt><dd>A zero value of the expression is a failure, other values are not </dd></dl>
-
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00112">112</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
-<p>
-References <a class="el" href="test_8c-source.html#l00063">_test()</a>.
-<p>
-Referenced by <a class="el" href="test_8c-source.html#l00381">test_end_macro()</a>.
+<dl class="section note"><dt>Note</dt><dd>A zero value of the expression is a failure, other values are not </dd></dl>
+
+<p>Definition at line <a class="el" href="test_8c_source.html#l00112">112</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
+
+<p>References <a class="el" href="test_8c_source.html#l00063">_test()</a>.</p>
+
+<p>Referenced by <a class="el" href="test_8c_source.html#l00381">test_end_macro()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g1da2e46a3658d3b80d1060ab04747507"></a><!-- doxytag: member="test.c::test_eq_macro" ref="g1da2e46a3658d3b80d1060ab04747507" args="(int first, const char *first_string, int second, const char *second_string, const char *function, const char *file, unsigned line)" -->
+</div>
+<a class="anchor" id="ga0b29bcb36a03d68f05034d446b93b060"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void test_eq_macro           </td>
+          <td class="memname">void test_eq_macro </td>
           <td>(</td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>first</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>first</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>first_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>first_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>second</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>second</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>second_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>second_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>function</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>function</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>file</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>file</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>line</em></td><td> </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>line</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Test if two integer expressions are equal. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>first</em> </td><td>The first value in the comparison </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>first_string</em> </td><td>The first value as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>second</em> </td><td>The second value in the comparison </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>second_string</em> </td><td>The second value as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>function</em> </td><td>function name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>file</em> </td><td>filename </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>line</em> </td><td>line number </td></tr>
+</div><div class="memdoc">
+
+<p>Test if two integer expressions are equal. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">first</td><td>The first value in the comparison </td></tr>
+    <tr><td class="paramname">first_string</td><td>The first value as a string </td></tr>
+    <tr><td class="paramname">second</td><td>The second value in the comparison </td></tr>
+    <tr><td class="paramname">second_string</td><td>The second value as a string </td></tr>
+    <tr><td class="paramname">function</td><td>function name </td></tr>
+    <tr><td class="paramname">file</td><td>filename </td></tr>
+    <tr><td class="paramname">line</td><td>line number </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Note:</b></dt><dd>This function should only be called from the macro TEST_ABS </dd></dl>
-
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00139">139</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
-<p>
-References <a class="el" href="test_8c-source.html#l00063">_test()</a>.
-<p>
-Referenced by <a class="el" href="test_8c-source.html#l00381">test_end_macro()</a>.
+<dl class="section note"><dt>Note</dt><dd>This function should only be called from the macro TEST_ABS </dd></dl>
+
+<p>Definition at line <a class="el" href="test_8c_source.html#l00139">139</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
+
+<p>References <a class="el" href="test_8c_source.html#l00063">_test()</a>.</p>
+
+<p>Referenced by <a class="el" href="test_8c_source.html#l00381">test_end_macro()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g9c58a98a4f063f11ac233b3e11228485"></a><!-- doxytag: member="test.c::test_eq_string_macro" ref="g9c58a98a4f063f11ac233b3e11228485" args="(const char *first, const char *first_string, const char *second, const char *second_string, const char *function, const char *file, unsigned line)" -->
+</div>
+<a class="anchor" id="ga393dca2c7f94fd2f47722083cda8d369"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void test_eq_string_macro           </td>
+          <td class="memname">void test_eq_string_macro </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>first</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>first</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>first_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>first_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>second</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>second</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>second_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>second_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>function</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>function</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>file</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>file</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>line</em></td><td> </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>line</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Test if two strings are equal. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>first</em> </td><td>The first value in the comparison </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>first_string</em> </td><td>The first value as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>second</em> </td><td>The second value in the comparison </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>second_string</em> </td><td>The second value as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>function</em> </td><td>function name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>file</em> </td><td>filename </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>line</em> </td><td>line number </td></tr>
+</div><div class="memdoc">
+
+<p>Test if two strings are equal. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">first</td><td>The first value in the comparison </td></tr>
+    <tr><td class="paramname">first_string</td><td>The first value as a string </td></tr>
+    <tr><td class="paramname">second</td><td>The second value in the comparison </td></tr>
+    <tr><td class="paramname">second_string</td><td>The second value as a string </td></tr>
+    <tr><td class="paramname">function</td><td>function name </td></tr>
+    <tr><td class="paramname">file</td><td>filename </td></tr>
+    <tr><td class="paramname">line</td><td>line number </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Note:</b></dt><dd>This function should only be called from the macro TEST_ABS </dd></dl>
+<dl class="section note"><dt>Note</dt><dd>This function should only be called from the macro TEST_ABS </dd></dl>
+
+<p>Definition at line <a class="el" href="test_8c_source.html#l00170">170</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
+
+<p>References <a class="el" href="test_8c_source.html#l00063">_test()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00170">170</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
-<p>
-References <a class="el" href="test_8c-source.html#l00063">_test()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gfdcc2d4527a4292dffdb89df2e25e3a5"></a><!-- doxytag: member="test.c::test_abs_macro" ref="gfdcc2d4527a4292dffdb89df2e25e3a5" args="(double first, const char *first_string, double second, const char *second_string, double tolerance, const char *tolerance_string, const char *function, const char *file, unsigned line)" -->
+</div>
+<a class="anchor" id="gae93f165e1b26c1b98e4ec9457a06714b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void test_abs_macro           </td>
+          <td class="memname">void test_abs_macro </td>
           <td>(</td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>first</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>first</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>first_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>first_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>second</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>second</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>second_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>second_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>tolerance</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>tolerance</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tolerance_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tolerance_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>function</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>function</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>file</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>file</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>line</em></td><td> </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>line</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Test if two numerical expressions are within a given (absolute) tolerance. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>first</em> </td><td>The first value in the comparison </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>first_string</em> </td><td>The first value as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>second</em> </td><td>The second value in the comparison </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>second_string</em> </td><td>The second value as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tolerance</em> </td><td>A non-negative tolerance </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tolerance_string</em> </td><td>The tolerance as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>function</em> </td><td>function name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>file</em> </td><td>filename </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>line</em> </td><td>line number </td></tr>
+</div><div class="memdoc">
+
+<p>Test if two numerical expressions are within a given (absolute) tolerance. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">first</td><td>The first value in the comparison </td></tr>
+    <tr><td class="paramname">first_string</td><td>The first value as a string </td></tr>
+    <tr><td class="paramname">second</td><td>The second value in the comparison </td></tr>
+    <tr><td class="paramname">second_string</td><td>The second value as a string </td></tr>
+    <tr><td class="paramname">tolerance</td><td>A non-negative tolerance </td></tr>
+    <tr><td class="paramname">tolerance_string</td><td>The tolerance as a string </td></tr>
+    <tr><td class="paramname">function</td><td>function name </td></tr>
+    <tr><td class="paramname">file</td><td>filename </td></tr>
+    <tr><td class="paramname">line</td><td>line number </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Note:</b></dt><dd>This function should only be called from the macro TEST_ABS </dd></dl>
+<dl class="section note"><dt>Note</dt><dd>This function should only be called from the macro TEST_ABS </dd></dl>
+
+<p>Definition at line <a class="el" href="test_8c_source.html#l00208">208</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
+
+<p>References <a class="el" href="test_8c_source.html#l00063">_test()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00208">208</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
-<p>
-References <a class="el" href="test_8c-source.html#l00063">_test()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g179ca9b6adab6c5e9c1b4259f08c16d7"></a><!-- doxytag: member="test.c::test_rel_macro" ref="g179ca9b6adab6c5e9c1b4259f08c16d7" args="(double first, const char *first_string, double second, const char *second_string, double tolerance, const char *tolerance_string, const char *function, const char *file, unsigned line)" -->
+</div>
+<a class="anchor" id="ga9cdeb6a0e44a5e2197eedce28865f000"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void test_rel_macro           </td>
+          <td class="memname">void test_rel_macro </td>
           <td>(</td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>first</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>first</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>first_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>first_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>second</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>second</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>second_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>second_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>tolerance</em>, </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>tolerance</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tolerance_string</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tolerance_string</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>function</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>function</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>file</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>file</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>line</em></td><td> </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>line</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Test if two numerical expressions are within a given relative tolerance. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>first</em> </td><td>The first value in the comparison </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>first_string</em> </td><td>The first value as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>second</em> </td><td>The second value in the comparison </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>second_string</em> </td><td>The second value as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tolerance</em> </td><td>A non-negative tolerance </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tolerance_string</em> </td><td>The tolerance as a string </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>function</em> </td><td>function name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>file</em> </td><td>filename </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>line</em> </td><td>line number </td></tr>
+</div><div class="memdoc">
+
+<p>Test if two numerical expressions are within a given relative tolerance. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">first</td><td>The first value in the comparison </td></tr>
+    <tr><td class="paramname">first_string</td><td>The first value as a string </td></tr>
+    <tr><td class="paramname">second</td><td>The second value in the comparison </td></tr>
+    <tr><td class="paramname">second_string</td><td>The second value as a string </td></tr>
+    <tr><td class="paramname">tolerance</td><td>A non-negative tolerance </td></tr>
+    <tr><td class="paramname">tolerance_string</td><td>The tolerance as a string </td></tr>
+    <tr><td class="paramname">function</td><td>function name </td></tr>
+    <tr><td class="paramname">file</td><td>filename </td></tr>
+    <tr><td class="paramname">line</td><td>line number </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Note:</b></dt><dd>This function should only be called from the macro TEST_REL </dd></dl>
+<dl class="section note"><dt>Note</dt><dd>This function should only be called from the macro TEST_REL </dd></dl>
+
+<p>Definition at line <a class="el" href="test_8c_source.html#l00245">245</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
+
+<p>References <a class="el" href="test_8c_source.html#l00063">_test()</a>.</p>
 
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00245">245</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
-<p>
-References <a class="el" href="test_8c-source.html#l00063">_test()</a>.
 </div>
-</div><p>
-<a class="anchor" name="gdf5b021e357a2554f044454d0b886ec6"></a><!-- doxytag: member="test.c::test_init_macro" ref="gdf5b021e357a2554f044454d0b886ec6" args="(const char *file)" -->
+</div>
+<a class="anchor" id="gab73f634dbde2ec1403f0508d5c1d987b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void test_init_macro           </td>
+          <td class="memname">void test_init_macro </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>file</em>          </td>
-          <td> ) </td>
-          <td width="100%"></td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>file</em></td><td>)</td>
+          <td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Initialize CPL + messaging. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>file</em> </td><td>filename </td></tr>
+</div><div class="memdoc">
+
+<p>Initialize CPL + messaging. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">file</td><td>filename </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Note:</b></dt><dd>This function should be called only by using the macro TEST_INIT </dd></dl>
+<dl class="section note"><dt>Note</dt><dd>This function should be called only by using the macro TEST_INIT </dd></dl>
 
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00290">290</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
-<p>
-References <a class="el" href="test_8c-source.html#l00050">error_init</a>.
+<p>Definition at line <a class="el" href="test_8c_source.html#l00290">290</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ga03e8561e85f5310576a5bf2ca4ffd63"></a><!-- doxytag: member="test.c::test_end_macro" ref="ga03e8561e85f5310576a5bf2ca4ffd63" args="(const char *function, const char *file, unsigned line)" -->
+<a class="anchor" id="ga27e574128e77cc503295df8191f583e5"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">unsigned test_end_macro           </td>
+          <td class="memname">unsigned test_end_macro </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>function</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>function</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>file</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>file</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">unsigned </td>
-          <td class="paramname"> <em>line</em></td><td> </td>
+          <td class="paramtype">unsigned </td>
+          <td class="paramname"><em>line</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Perform the final checks and return the number of errors. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>function</em> </td><td>function name </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>file</em> </td><td>filename </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>line</em> </td><td>line number </td></tr>
+</div><div class="memdoc">
+
+<p>Perform the final checks and return the number of errors. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">function</td><td>function name </td></tr>
+    <tr><td class="paramname">file</td><td>filename </td></tr>
+    <tr><td class="paramname">line</td><td>line number </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>The total number of errors in the tested module </dd></dl>
-<dl compact><dt><b>Note:</b></dt><dd>This function should only be called from the macro TEST_END </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>The total number of errors in the tested module </dd></dl>
+<dl class="section note"><dt>Note</dt><dd>This function should only be called from the macro TEST_END </dd></dl>
+
+<p>Definition at line <a class="el" href="test_8c_source.html#l00381">381</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
 
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00381">381</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
-<p>
-References <a class="el" href="test_8c-source.html#l00050">error_init</a>, <a class="el" href="test_8c-source.html#l00139">test_eq_macro()</a>, <a class="el" href="test_8c-source.html#l00112">test_macro()</a>, and <a class="el" href="test_8c-source.html#l00049">test_nfail</a>.
+<p>References <a class="el" href="test_8c_source.html#l00139">test_eq_macro()</a>, <a class="el" href="test_8c_source.html#l00112">test_macro()</a>, and <a class="el" href="test_8c_source.html#l00049">test_nfail</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="ge4730f9510e545e738aef9c8b7459b8b"></a><!-- doxytag: member="test.c::test_recipe_output" ref="ge4730f9510e545e738aef9c8b7459b8b" args="(const cpl_frameset *frames, const char *const product_tags[], int n_prod, const char *main_product, const char *const qc[], int n_qc)" -->
+<a class="anchor" id="gae130ff5a0f20a6e926dc7d57c5d4906c"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void test_recipe_output           </td>
+          <td class="memname">void test_recipe_output </td>
           <td>(</td>
-          <td class="paramtype">const cpl_frameset * </td>
-          <td class="paramname"> <em>frames</em>, </td>
+          <td class="paramtype">const cpl_frameset * </td>
+          <td class="paramname"><em>frames</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char *const  </td>
-          <td class="paramname"> <em>product_tags</em>[], </td>
+          <td class="paramtype">const char *const </td>
+          <td class="paramname"><em>product_tags</em>[], </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>n_prod</em>, </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>n_prod</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>main_product</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>main_product</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char *const  </td>
-          <td class="paramname"> <em>qc</em>[], </td>
+          <td class="paramtype">const char *const </td>
+          <td class="paramname"><em>qc</em>[], </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">int </td>
-          <td class="paramname"> <em>n_qc</em></td><td> </td>
+          <td class="paramtype">int </td>
+          <td class="paramname"><em>n_qc</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Test existence of recipe products. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>product_tags</em> </td><td>array of expected product tags </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>n_prod</em> </td><td>number of products </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>main_product</em> </td><td>the only product which should contain QC parameters </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>qc</em> </td><td>array of expected QC parameters </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>n_qc</em> </td><td>number of QC parameters </td></tr>
+</div><div class="memdoc">
+
+<p>Test existence of recipe products. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">product_tags</td><td>array of expected product tags </td></tr>
+    <tr><td class="paramname">n_prod</td><td>number of products </td></tr>
+    <tr><td class="paramname">main_product</td><td>the only product which should contain QC parameters </td></tr>
+    <tr><td class="paramname">qc</td><td>array of expected QC parameters </td></tr>
+    <tr><td class="paramname">n_qc</td><td>number of QC parameters </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00428">428</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, and <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>.
-<p>
-Referenced by <a class="el" href="fors__bias-test_8c-source.html#l00062">test_bias()</a>, <a class="el" href="fors__img__science-test_8c-source.html#l00057">test_img_science()</a>, <a class="el" href="fors__img__screen__flat-test_8c-source.html#l00065">test_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat-test_8c-source.html#l00062">test_img_sky_flat()</a>, and <a class="el" href="fors__zeropoint-test_8c-source.html#l00057">test_zeropoint()</a>.
+<p>Definition at line <a class="el" href="test_8c_source.html#l00428">428</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__bias-test_8c_source.html#l00062">test_bias()</a>, <a class="el" href="fors__img__science-test_8c_source.html#l00057">test_img_science()</a>, <a class="el" href="fors__img__screen__flat-test_8c_source.html#l00065">test_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat-test_8c_source.html#l00062">test_img_sky_flat()</a>, and <a class="el" href="fors__zeropoint-test_8c_source.html#l00057">test_zeropoint()</a>.</p>
+
 </div>
-</div><p>
-<hr><h2>Variable Documentation</h2>
-<a class="anchor" name="g8bf3870fd210f34561f4f3f6010370a4"></a><!-- doxytag: member="test.c::test_nfail" ref="g8bf3870fd210f34561f4f3f6010370a4" args="" -->
+</div>
+<h2 class="groupheader">Variable Documentation</h2>
+<a class="anchor" id="gafc4fd42e311ceffbc41f1e33da745af8"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">unsigned long <a class="el" href="group__test.html#g8bf3870fd210f34561f4f3f6010370a4">test_nfail</a> = 0<code> [static]</code>          </td>
+          <td class="memname">unsigned long test_nfail = 0</td>
         </tr>
       </table>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+<p>The number of failures </p>
+
+<p>Definition at line <a class="el" href="test_8c_source.html#l00049">49</a> of file <a class="el" href="test_8c_source.html">test.c</a>.</p>
+
+<p>Referenced by <a class="el" href="test_8c_source.html#l00063">_test()</a>, and <a class="el" href="test_8c_source.html#l00381">test_end_macro()</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-The number of failures 
-<p>
-Definition at line <a class="el" href="test_8c-source.html#l00049">49</a> of file <a class="el" href="test_8c-source.html">test.c</a>.
-<p>
-Referenced by <a class="el" href="test_8c-source.html#l00063">_test()</a>, and <a class="el" href="test_8c-source.html#l00381">test_end_macro()</a>.
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__test__simulate.html b/html/group__test__simulate.html
index 02844da..7ba5476 100644
--- a/html/group__test__simulate.html
+++ b/html/group__test__simulate.html
@@ -1,681 +1,696 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Simulate data for unit testing</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Simulate data for unit testing</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a></td></tr>
-
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">static cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a">frame_new</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Frame constructor.  <a href="#gc654dec250d09a86c73232ad4644b22a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2">create_standard_keys</a> (cpl_propertylist *header, double exptime)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Write FORS standard keywords to simulated header.  <a href="#g8ad58588c66a4e04b69580f5152ccff2"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">create_bias</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Simulate bias image.  <a href="#g55fb50722bc813f909960cff99bf3d0a"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#gb54d8ef52e4f8e0407e522565b8919f6">create_dark</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Simulate dark image.  <a href="#gb54d8ef52e4f8e0407e522565b8919f6"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g474967528c2d1de8ce4dadd24da817ce">create_screen_flat</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Simulate screen flat image.  <a href="#g474967528c2d1de8ce4dadd24da817ce"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669">create_sky_flat</a> (const char *filename, const char *tag, cpl_frame_group group, double exptime)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Simulate sky flat image.  <a href="#g34d07ddc903c3b99789b4a4499a01669"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b">create_standard</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create standard star image.  <a href="#g7d32a52476925e61a30a10d78e4ad16b"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410">create_std_cat</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create standard star catalogue.  <a href="#g385bcf492fd8851be43fad7ec71c7410"></a><br></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5">create_phot_table</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Create photometry table.  <a href="#g8f676f49cfb4e2066d15d240480450c5"></a><br></td></tr>
-<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g97ac5cde48d3ca9bdeae2a8fb53d3207"></a><!-- doxytag: member="test_simulate::det_nx" ref="g97ac5cde48d3ca9bdeae2a8fb53d3207" args="" -->
-static const int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g97ac5cde48d3ca9bdeae2a8fb53d3207">det_nx</a> = 400</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g90b0fe857eac7b0228e6eaebc6a879e6"></a><!-- doxytag: member="test_simulate::det_ny" ref="g90b0fe857eac7b0228e6eaebc6a879e6" args="" -->
-static const int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g90b0fe857eac7b0228e6eaebc6a879e6">det_ny</a> = 400</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gd61bdee2299fb9a98deab7beb8093286"></a><!-- doxytag: member="test_simulate::binx" ref="gd61bdee2299fb9a98deab7beb8093286" args="" -->
-static const int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#gd61bdee2299fb9a98deab7beb8093286">binx</a> = 2</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g0e7ec816bf2ae617d9116fc3e269f18d"></a><!-- doxytag: member="test_simulate::biny" ref="g0e7ec816bf2ae617d9116fc3e269f18d" args="" -->
-static const int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g0e7ec816bf2ae617d9116fc3e269f18d">biny</a> = 2</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g969eb0a34faef89b37e50045944c7dc8"></a><!-- doxytag: member="test_simulate::ron" ref="g969eb0a34faef89b37e50045944c7dc8" args="" -->
-static const double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a> = 4.0</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g7df19c80af6c089b9838fa49031972c5"></a><!-- doxytag: member="test_simulate::conad" ref="g7df19c80af6c089b9838fa49031972c5" args="" -->
-static const double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a> = 0.78</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g6cf924040f9af8a76b40f050c6291059"></a><!-- doxytag: member="test_simulate::bias_avg" ref="g6cf924040f9af8a76b40f050c6291059" args="" -->
-static const double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g6cf924040f9af8a76b40f050c6291059">bias_avg</a> = 200</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g61af7be698d059568dcd5fff61aa606f"></a><!-- doxytag: member="test_simulate::dark_avg" ref="g61af7be698d059568dcd5fff61aa606f" args="" -->
-static const double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g61af7be698d059568dcd5fff61aa606f">dark_avg</a> = 50</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb517f8305d0a56f05b3221ba47b0d8f1"></a><!-- doxytag: member="test_simulate::instrume" ref="gb517f8305d0a56f05b3221ba47b0d8f1" args="" -->
-static const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = "fors2"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g8a365694ad27ccccf1a8c2b57d763e35"></a><!-- doxytag: member="test_simulate::chip_id" ref="g8a365694ad27ccccf1a8c2b57d763e35" args="" -->
-static const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#g8a365694ad27ccccf1a8c2b57d763e35">chip_id</a> = "Test chip 234"</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gbd15ae642503439f227fb714812437dc"></a><!-- doxytag: member="test_simulate::read_clock" ref="gbd15ae642503439f227fb714812437dc" args="" -->
-static const char *const </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#gbd15ae642503439f227fb714812437dc">read_clock</a> = "200Kps/2ports/low_gain"</td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#define-members">Macros</a> |
+<a href="#func-members">Functions</a> |
+<a href="#var-members">Variables</a>  </div>
+  <div class="headertitle">
+<div class="title">Simulate data for unit testing</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7e092177213c592ed05cda8e2296016e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>cleanup</b></td></tr>
+<tr class="separator:ga7e092177213c592ed05cda8e2296016e"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga058fead85edeab17908cfe9c9d4bf53c"><td class="memItemLeft" align="right" valign="top">static cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c">frame_new</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
+<tr class="memdesc:ga058fead85edeab17908cfe9c9d4bf53c"><td class="mdescLeft"> </td><td class="mdescRight">Frame constructor.  <a href="#ga058fead85edeab17908cfe9c9d4bf53c">More...</a><br/></td></tr>
+<tr class="separator:ga058fead85edeab17908cfe9c9d4bf53c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gae70284f55411d4a1fdbc3fc9fbd10bf5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5">create_standard_keys</a> (cpl_propertylist *header, double exptime)</td></tr>
+<tr class="memdesc:gae70284f55411d4a1fdbc3fc9fbd10bf5"><td class="mdescLeft"> </td><td class="mdescRight">Write FORS standard keywords to simulated header.  <a href="#gae70284f55411d4a1fdbc3fc9fbd10bf5">More...</a><br/></td></tr>
+<tr class="separator:gae70284f55411d4a1fdbc3fc9fbd10bf5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga3e86fd58a29b3530210cb4f52b91dc9e"><td class="memItemLeft" align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e">create_bias</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
+<tr class="memdesc:ga3e86fd58a29b3530210cb4f52b91dc9e"><td class="mdescLeft"> </td><td class="mdescRight">Simulate bias image.  <a href="#ga3e86fd58a29b3530210cb4f52b91dc9e">More...</a><br/></td></tr>
+<tr class="separator:ga3e86fd58a29b3530210cb4f52b91dc9e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaebd36d5457a83612601155994a242dda"><td class="memItemLeft" align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#gaebd36d5457a83612601155994a242dda">create_dark</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
+<tr class="memdesc:gaebd36d5457a83612601155994a242dda"><td class="mdescLeft"> </td><td class="mdescRight">Simulate dark image.  <a href="#gaebd36d5457a83612601155994a242dda">More...</a><br/></td></tr>
+<tr class="separator:gaebd36d5457a83612601155994a242dda"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga5e5e21165c992a2062b3ca661e35fe9d"><td class="memItemLeft" align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#ga5e5e21165c992a2062b3ca661e35fe9d">create_screen_flat</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
+<tr class="memdesc:ga5e5e21165c992a2062b3ca661e35fe9d"><td class="mdescLeft"> </td><td class="mdescRight">Simulate screen flat image.  <a href="#ga5e5e21165c992a2062b3ca661e35fe9d">More...</a><br/></td></tr>
+<tr class="separator:ga5e5e21165c992a2062b3ca661e35fe9d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga574cce7cd888bfd5d3f06a4830df5103"><td class="memItemLeft" align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103">create_sky_flat</a> (const char *filename, const char *tag, cpl_frame_group group, double exptime)</td></tr>
+<tr class="memdesc:ga574cce7cd888bfd5d3f06a4830df5103"><td class="mdescLeft"> </td><td class="mdescRight">Simulate sky flat image.  <a href="#ga574cce7cd888bfd5d3f06a4830df5103">More...</a><br/></td></tr>
+<tr class="separator:ga574cce7cd888bfd5d3f06a4830df5103"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7b36d87ede4ad7e7e12a408587ab8164"><td class="memItemLeft" align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164">create_standard</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
+<tr class="memdesc:ga7b36d87ede4ad7e7e12a408587ab8164"><td class="mdescLeft"> </td><td class="mdescRight">Create standard star image.  <a href="#ga7b36d87ede4ad7e7e12a408587ab8164">More...</a><br/></td></tr>
+<tr class="separator:ga7b36d87ede4ad7e7e12a408587ab8164"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga474a5b51d8eba26e437cb9be2719aab3"><td class="memItemLeft" align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3">create_std_cat</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
+<tr class="memdesc:ga474a5b51d8eba26e437cb9be2719aab3"><td class="mdescLeft"> </td><td class="mdescRight">Create standard star catalogue.  <a href="#ga474a5b51d8eba26e437cb9be2719aab3">More...</a><br/></td></tr>
+<tr class="separator:ga474a5b51d8eba26e437cb9be2719aab3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaafef1f08f42e1f9bef0000c27e46169b"><td class="memItemLeft" align="right" valign="top">cpl_frame * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b">create_phot_table</a> (const char *filename, const char *tag, cpl_frame_group group)</td></tr>
+<tr class="memdesc:gaafef1f08f42e1f9bef0000c27e46169b"><td class="mdescLeft"> </td><td class="mdescRight">Create photometry table.  <a href="#gaafef1f08f42e1f9bef0000c27e46169b">More...</a><br/></td></tr>
+<tr class="separator:gaafef1f08f42e1f9bef0000c27e46169b"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:ga8127dadf8f51913034e2891c96fc6462"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8127dadf8f51913034e2891c96fc6462"></a>
+static const int </td><td class="memItemRight" valign="bottom"><b>det_nx</b> = 400</td></tr>
+<tr class="separator:ga8127dadf8f51913034e2891c96fc6462"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7029a6a32fa871757ee996ab390e651c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7029a6a32fa871757ee996ab390e651c"></a>
+static const int </td><td class="memItemRight" valign="bottom"><b>det_ny</b> = 400</td></tr>
+<tr class="separator:ga7029a6a32fa871757ee996ab390e651c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga616bc975cc675200b4e2b71e11b6a111"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga616bc975cc675200b4e2b71e11b6a111"></a>
+static const int </td><td class="memItemRight" valign="bottom"><b>binx</b> = 2</td></tr>
+<tr class="separator:ga616bc975cc675200b4e2b71e11b6a111"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gadd4f1621a17fb8c3cb8a71369dc28f91"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gadd4f1621a17fb8c3cb8a71369dc28f91"></a>
+static const int </td><td class="memItemRight" valign="bottom"><b>biny</b> = 2</td></tr>
+<tr class="separator:gadd4f1621a17fb8c3cb8a71369dc28f91"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga845c0025feb573da6be78f920081e6b4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga845c0025feb573da6be78f920081e6b4"></a>
+static const double </td><td class="memItemRight" valign="bottom"><b>ron</b> = 4.0</td></tr>
+<tr class="separator:ga845c0025feb573da6be78f920081e6b4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga33568fda4dbd442173e671211fa84afc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga33568fda4dbd442173e671211fa84afc"></a>
+static const double </td><td class="memItemRight" valign="bottom"><b>conad</b> = 0.78</td></tr>
+<tr class="separator:ga33568fda4dbd442173e671211fa84afc"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga94d648dbe35921213f324fa814c5c330"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga94d648dbe35921213f324fa814c5c330"></a>
+static const double </td><td class="memItemRight" valign="bottom"><b>bias_avg</b> = 200</td></tr>
+<tr class="separator:ga94d648dbe35921213f324fa814c5c330"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga7b419fb56d0d512c687a6f830d652798"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7b419fb56d0d512c687a6f830d652798"></a>
+static const double </td><td class="memItemRight" valign="bottom"><b>dark_avg</b> = 50</td></tr>
+<tr class="separator:ga7b419fb56d0d512c687a6f830d652798"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaff7bcbeb82fada5cfc426397545258d8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaff7bcbeb82fada5cfc426397545258d8"></a>
+static const char *const </td><td class="memItemRight" valign="bottom"><b>instrume</b> = "fors2"</td></tr>
+<tr class="separator:gaff7bcbeb82fada5cfc426397545258d8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaa2383a6c0ad110007e91b6467b755498"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa2383a6c0ad110007e91b6467b755498"></a>
+static const char *const </td><td class="memItemRight" valign="bottom"><b>chip_id</b> = "Test chip 234"</td></tr>
+<tr class="separator:gaa2383a6c0ad110007e91b6467b755498"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gaccccf93617eb75a09e97cc2ee96b5e28"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaccccf93617eb75a09e97cc2ee96b5e28"></a>
+static const char *const </td><td class="memItemRight" valign="bottom"><b>read_clock</b> = "200Kps/2ports/low_gain"</td></tr>
+<tr class="separator:gaccccf93617eb75a09e97cc2ee96b5e28"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-Note: The images simulated here are not meant to be realistic. The purpose is to test the software's behaviour on known input before introducing the complexity of real world data. <hr><h2>Define Documentation</h2>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="test_simulate.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>Note: The images simulated here are not meant to be realistic. The purpose is to test the software's behaviour on known input before introducing the complexity of real world data. </p>
+<h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&bias); \</div>
+<div class="line">    cpl_propertylist_delete(header); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&bias); \
-    cpl_propertylist_delete(header); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="test_simulate.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&dark); \</div>
+<div class="line">    cpl_propertylist_delete(header); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&dark); \
-    cpl_propertylist_delete(header); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="test_simulate.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&sflat); \</div>
+<div class="line">    cpl_propertylist_delete(header); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&sflat); \
-    cpl_propertylist_delete(header); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="test_simulate.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    fors_image_delete(&sflat); \</div>
+<div class="line">    cpl_propertylist_delete(header); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    <a class="code" href="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903">fors_image_delete</a>(&sflat); \
-    cpl_propertylist_delete(header); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="test_simulate.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_table_delete(t); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_table_delete(t); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
 </div>
-</div><p>
-<a class="anchor" name="g57cf6e6e2826eb178fd2d9c3e5695343"></a><!-- doxytag: member="test_simulate.c::cleanup" ref="g57cf6e6e2826eb178fd2d9c3e5695343" args="" -->
+<a class="anchor" id="ga7e092177213c592ed05cda8e2296016e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">#define cleanup          </td>
+          <td class="memname">#define cleanup</td>
         </tr>
       </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">do</span> { \</div>
+<div class="line">    cpl_table_delete(t); \</div>
+<div class="line">} <span class="keywordflow">while</span>(0)</div>
+</div><!-- fragment -->
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
 </div>
-<div class="memdoc">
-
-<p>
-<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
-    cpl_table_delete(t); \
-} <span class="keywordflow">while</span>(0)
-</pre></div>
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00519">519</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
 </div>
-</div><p>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="gc654dec250d09a86c73232ad4644b22a"></a><!-- doxytag: member="test_simulate.c::frame_new" ref="gc654dec250d09a86c73232ad4644b22a" args="(const char *filename, const char *tag, cpl_frame_group group)" -->
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga058fead85edeab17908cfe9c9d4bf53c"></a>
 <div class="memitem">
 <div class="memproto">
+<table class="mlabels">
+  <tr>
+  <td class="mlabels-left">
       <table class="memname">
         <tr>
-          <td class="memname">static cpl_frame* frame_new           </td>
+          <td class="memname">static cpl_frame* frame_new </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_frame_group </td>
-          <td class="paramname"> <em>group</em></td><td> </td>
+          <td class="paramtype">cpl_frame_group </td>
+          <td class="paramname"><em>group</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"><code> [static]</code></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Frame constructor. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>filename</em> </td><td>frame filename </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>frame tag </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>group</em> </td><td>frame group </td></tr>
+  </td>
+  <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">static</span></span>  </td>
+  </tr>
+</table>
+</div><div class="memdoc">
+
+<p>Frame constructor. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">filename</td><td>frame filename </td></tr>
+    <tr><td class="paramname">tag</td><td>frame tag </td></tr>
+    <tr><td class="paramname">group</td><td>frame group </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>newly callocated frame with the given contents </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>newly callocated frame with the given contents </dd></dl>
+
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00115">115</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
+<p>Referenced by <a class="el" href="test__simulate_8c_source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c_source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c_source.html#l00532">create_phot_table()</a>, <a class="el" href="test__simulate_8c_source.html#l00328">create_screen_flat()</a>, <a class="el" href="test__simulate_8c_source.html#l00384">create_sky_flat()</a>, and <a class="el" href="test__simulate_8c_source.html#l00454">create_std_ [...]
 
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00115">115</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
-<p>
-Referenced by <a class="el" href="test__simulate_8c-source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c-source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c-source.html#l00532">create_phot_table()</a>, <a class="el" href="test__simulate_8c-source.html#l00328">create_screen_flat()</a>, <a class="el" href="test__simulate_8c-source.html#l00384">create_sky_flat()</a>, and <a class="el" href="test__simulate_8c-source.html#l00454">create_std_cat()</a>.
 </div>
-</div><p>
-<a class="anchor" name="g8ad58588c66a4e04b69580f5152ccff2"></a><!-- doxytag: member="test_simulate.c::create_standard_keys" ref="g8ad58588c66a4e04b69580f5152ccff2" args="(cpl_propertylist *header, double exptime)" -->
+</div>
+<a class="anchor" id="gae70284f55411d4a1fdbc3fc9fbd10bf5"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">void create_standard_keys           </td>
+          <td class="memname">void create_standard_keys </td>
           <td>(</td>
-          <td class="paramtype">cpl_propertylist * </td>
-          <td class="paramname"> <em>header</em>, </td>
+          <td class="paramtype">cpl_propertylist * </td>
+          <td class="paramname"><em>header</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>exptime</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>exptime</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Write FORS standard keywords to simulated header. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>header</em> </td><td>to update </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>exptime</em> </td><td>exposure time (s), possibly zero </td></tr>
+</div><div class="memdoc">
+
+<p>Write FORS standard keywords to simulated header. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">header</td><td>to update </td></tr>
+    <tr><td class="paramname">exptime</td><td>exposure time (s), possibly zero </td></tr>
   </table>
+  </dd>
 </dl>
 
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00132">132</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
-<p>
-References <a class="el" href="test__simulate_8c-source.html#l00096">binx</a>, <a class="el" href="test__simulate_8c-source.html#l00097">biny</a>, <a class="el" href="test__simulate_8c-source.html#l00104">chip_id</a>, <a class="el" href="test__simulate_8c-source.html#l00099">conad</a>, <a class="el" href="test__simulate_8c-source.html#l00094">det_nx</a>, <a class="el" href="test__simulate_8c-source.html#l00095">det_ny</a>, <a class="el" href="fors__pfits_8c-source.html#l00045">FORS_PFITS [...]
-<p>
-Referenced by <a class="el" href="test__simulate_8c-source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c-source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c-source.html#l00328">create_screen_flat()</a>, <a class="el" href="test__simulate_8c-source.html#l00384">create_sky_flat()</a>, <a class="el" href="fors__image-test_8c-source.html#l00056">test_image()</a>, and <a class="el" href="fors__photometry-test_8c-source.html#l00055">test_photome [...]
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00132">132</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
+<p>Referenced by <a class="el" href="test__simulate_8c_source.html#l00221">create_bias()</a>, <a class="el" href="test__simulate_8c_source.html#l00273">create_dark()</a>, <a class="el" href="test__simulate_8c_source.html#l00328">create_screen_flat()</a>, <a class="el" href="test__simulate_8c_source.html#l00384">create_sky_flat()</a>, <a class="el" href="fors__image-test_8c_source.html#l00056">test_image()</a>, and <a class="el" href="fors__photometry-test_8c_source.html#l00055">test_phot [...]
+
 </div>
-</div><p>
-<a class="anchor" name="g55fb50722bc813f909960cff99bf3d0a"></a><!-- doxytag: member="test_simulate.c::create_bias" ref="g55fb50722bc813f909960cff99bf3d0a" args="(const char *filename, const char *tag, cpl_frame_group group)" -->
+</div>
+<a class="anchor" id="ga3e86fd58a29b3530210cb4f52b91dc9e"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_frame* create_bias           </td>
+          <td class="memname">cpl_frame* create_bias </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_frame_group </td>
-          <td class="paramname"> <em>group</em></td><td> </td>
+          <td class="paramtype">cpl_frame_group </td>
+          <td class="paramname"><em>group</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Simulate bias image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>filename</em> </td><td>save to this file </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>output frame tag </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>output frame group </td></tr>
+</div><div class="memdoc">
+
+<p>Simulate bias image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">filename</td><td>save to this file </td></tr>
+    <tr><td class="paramname">tag</td><td>output frame tag </td></tr>
+    <tr><td class="paramname">tag</td><td>output frame group </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>bias frame</dd></dl>
-Model: constant + gaussian noise, rounded to nearest integer 
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00221">221</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="test__simulate_8c-source.html#l00101">bias_avg</a>, <a class="el" href="test__simulate_8c-source.html#l00096">binx</a>, <a class="el" href="test__simulate_8c-source.html#l00097">biny</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="test__simulate_8c-source.html#l00132">create_standard_keys()</a>, <a class="el" href="test__simulate_8c-source.html#l000 [...]
-<p>
-Referenced by <a class="el" href="fors__bias-test_8c-source.html#l00062">test_bias()</a>, <a class="el" href="fors__dark-test_8c-source.html#l00062">test_dark()</a>, <a class="el" href="fors__img__science-test_8c-source.html#l00057">test_img_science()</a>, <a class="el" href="fors__img__screen__flat-test_8c-source.html#l00065">test_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat-test_8c-source.html#l00062">test_img_sky_flat()</a>, <a class="el" href="fors__stack-test_8c-s [...]
+<dl class="section return"><dt>Returns</dt><dd>bias frame</dd></dl>
+<p>Model: constant + gaussian noise, rounded to nearest integer </p>
+
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00221">221</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="test__simulate_8c_source.html#l00132">create_standard_keys()</a>, <a class="el" href="fors__image_8c_source.html#l00128">fors_image_new()</a>, <a class="el" href="fors__image_8c_source.html#l00587">fors_image_save()</a>, <a class="el" href="fors__image_8c_source.html#l00078">FORS_IMAGE_TYPE</a>, <a class="el" href="fors__utils_8c_source.html#l00181">fors_rand_gauss()</a>, and <a class="el" href= [...]
+
+<p>Referenced by <a class="el" href="fors__bias-test_8c_source.html#l00062">test_bias()</a>, <a class="el" href="fors__dark-test_8c_source.html#l00062">test_dark()</a>, <a class="el" href="fors__img__science-test_8c_source.html#l00057">test_img_science()</a>, <a class="el" href="fors__img__screen__flat-test_8c_source.html#l00065">test_img_screen_flat()</a>, <a class="el" href="fors__img__sky__flat-test_8c_source.html#l00062">test_img_sky_flat()</a>, <a class="el" href="fors__stack-test_8 [...]
+
 </div>
-</div><p>
-<a class="anchor" name="gb54d8ef52e4f8e0407e522565b8919f6"></a><!-- doxytag: member="test_simulate.c::create_dark" ref="gb54d8ef52e4f8e0407e522565b8919f6" args="(const char *filename, const char *tag, cpl_frame_group group)" -->
+</div>
+<a class="anchor" id="gaebd36d5457a83612601155994a242dda"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_frame* create_dark           </td>
+          <td class="memname">cpl_frame* create_dark </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_frame_group </td>
-          <td class="paramname"> <em>group</em></td><td> </td>
+          <td class="paramtype">cpl_frame_group </td>
+          <td class="paramname"><em>group</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Simulate dark image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>filename</em> </td><td>save to this file </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>output frame tag </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>output frame group </td></tr>
+</div><div class="memdoc">
+
+<p>Simulate dark image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">filename</td><td>save to this file </td></tr>
+    <tr><td class="paramname">tag</td><td>output frame tag </td></tr>
+    <tr><td class="paramname">tag</td><td>output frame group </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>dark frame</dd></dl>
-Model: bias + dark(x,y) Variance = ron**2 + dark(x,y)/conad 
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00273">273</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="test__simulate_8c-source.html#l00101">bias_avg</a>, <a class="el" href="test__simulate_8c-source.html#l00096">binx</a>, <a class="el" href="test__simulate_8c-source.html#l00097">biny</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="test__simulate_8c-source.html#l00099">conad</a>, <a class="el" href="test__simulate_8c-source.html#l00132">create_standa [...]
-<p>
-Referenced by <a class="el" href="fors__dark-test_8c-source.html#l00062">test_dark()</a>.
+<dl class="section return"><dt>Returns</dt><dd>dark frame</dd></dl>
+<p>Model: bias + dark(x,y) Variance = ron**2 + dark(x,y)/conad </p>
+
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00273">273</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="test__simulate_8c_source.html#l00132">create_standard_keys()</a>, <a class="el" href="fors__image_8c_source.html#l00128">fors_image_new()</a>, <a class="el" href="fors__image_8c_source.html#l00587">fors_image_save()</a>, <a class="el" href="fors__image_8c_source.html#l00078">FORS_IMAGE_TYPE</a>, <a class="el" href="fors__utils_8c_source.html#l00181">fors_rand_gauss()</a>, and <a class="el" href= [...]
+
+<p>Referenced by <a class="el" href="fors__dark-test_8c_source.html#l00062">test_dark()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g474967528c2d1de8ce4dadd24da817ce"></a><!-- doxytag: member="test_simulate.c::create_screen_flat" ref="g474967528c2d1de8ce4dadd24da817ce" args="(const char *filename, const char *tag, cpl_frame_group group)" -->
+<a class="anchor" id="ga5e5e21165c992a2062b3ca661e35fe9d"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_frame* create_screen_flat           </td>
+          <td class="memname">cpl_frame* create_screen_flat </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_frame_group </td>
-          <td class="paramname"> <em>group</em></td><td> </td>
+          <td class="paramtype">cpl_frame_group </td>
+          <td class="paramname"><em>group</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Simulate screen flat image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>filename</em> </td><td>save to this file </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>output frame tag </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>group</em> </td><td>output frame group </td></tr>
+</div><div class="memdoc">
+
+<p>Simulate screen flat image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">filename</td><td>save to this file </td></tr>
+    <tr><td class="paramname">tag</td><td>output frame tag </td></tr>
+    <tr><td class="paramname">group</td><td>output frame group </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>screen flat frame</dd></dl>
-Model: bias + flat(x,y) Variance = ron**2 + flat(x,y)/conad 
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00328">328</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="test__simulate_8c-source.html#l00101">bias_avg</a>, <a class="el" href="test__simulate_8c-source.html#l00096">binx</a>, <a class="el" href="test__simulate_8c-source.html#l00097">biny</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="test__simulate_8c-source.html#l00099">conad</a>, <a class="el" href="test__simulate_8c-source.html#l00132">create_standa [...]
-<p>
-Referenced by <a class="el" href="fors__img__screen__flat-test_8c-source.html#l00065">test_img_screen_flat()</a>.
+<dl class="section return"><dt>Returns</dt><dd>screen flat frame</dd></dl>
+<p>Model: bias + flat(x,y) Variance = ron**2 + flat(x,y)/conad </p>
+
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00328">328</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="test__simulate_8c_source.html#l00132">create_standard_keys()</a>, <a class="el" href="fors__image_8c_source.html#l00128">fors_image_new()</a>, <a class="el" href="fors__image_8c_source.html#l00587">fors_image_save()</a>, <a class="el" href="fors__image_8c_source.html#l00078">FORS_IMAGE_TYPE</a>, <a class="el" href="fors__utils_8c_source.html#l00181">fors_rand_gauss()</a>, and <a class="el" href= [...]
+
+<p>Referenced by <a class="el" href="fors__img__screen__flat-test_8c_source.html#l00065">test_img_screen_flat()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g34d07ddc903c3b99789b4a4499a01669"></a><!-- doxytag: member="test_simulate.c::create_sky_flat" ref="g34d07ddc903c3b99789b4a4499a01669" args="(const char *filename, const char *tag, cpl_frame_group group, double exptime)" -->
+<a class="anchor" id="ga574cce7cd888bfd5d3f06a4830df5103"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_frame* create_sky_flat           </td>
+          <td class="memname">cpl_frame* create_sky_flat </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_frame_group </td>
-          <td class="paramname"> <em>group</em>, </td>
+          <td class="paramtype">cpl_frame_group </td>
+          <td class="paramname"><em>group</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">double </td>
-          <td class="paramname"> <em>exptime</em></td><td> </td>
+          <td class="paramtype">double </td>
+          <td class="paramname"><em>exptime</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Simulate sky flat image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>filename</em> </td><td>save to this file </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>output frame tag </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>group</em> </td><td>output frame group </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>exptime</em> </td><td>exposure time </td></tr>
+</div><div class="memdoc">
+
+<p>Simulate sky flat image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">filename</td><td>save to this file </td></tr>
+    <tr><td class="paramname">tag</td><td>output frame tag </td></tr>
+    <tr><td class="paramname">group</td><td>output frame group </td></tr>
+    <tr><td class="paramname">exptime</td><td>exposure time </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>sky flat frame</dd></dl>
-Model: bias + flat(x,y) Variance = ron**2 + flat(x,y)/conad 
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00384">384</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="test__simulate_8c-source.html#l00101">bias_avg</a>, <a class="el" href="test__simulate_8c-source.html#l00096">binx</a>, <a class="el" href="test__simulate_8c-source.html#l00097">biny</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, <a class="el" href="test__simulate_8c-source.html#l00099">conad</a>, <a class="el" href="test__simulate_8c-source.html#l00132">create_standa [...]
-<p>
-Referenced by <a class="el" href="test__simulate_8c-source.html#l00432">create_standard()</a>, <a class="el" href="fors__img__science-test_8c-source.html#l00057">test_img_science()</a>, <a class="el" href="fors__img__sky__flat-test_8c-source.html#l00062">test_img_sky_flat()</a>, <a class="el" href="fors__photometry-test_8c-source.html#l00055">test_photometry()</a>, <a class="el" href="fors__setting-test_8c-source.html#l00057">test_setting()</a>, and <a class="el" href="fors__zeropoint-te [...]
+<dl class="section return"><dt>Returns</dt><dd>sky flat frame</dd></dl>
+<p>Model: bias + flat(x,y) Variance = ron**2 + flat(x,y)/conad </p>
+
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00384">384</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, <a class="el" href="test__simulate_8c_source.html#l00132">create_standard_keys()</a>, <a class="el" href="fors__image_8c_source.html#l00128">fors_image_new()</a>, <a class="el" href="fors__image_8c_source.html#l00587">fors_image_save()</a>, <a class="el" href="fors__image_8c_source.html#l00078">FORS_IMAGE_TYPE</a>, <a class="el" href="fors__utils_8c_source.html#l00181">fors_rand_gauss()</a>, and <a class="el" href= [...]
+
+<p>Referenced by <a class="el" href="test__simulate_8c_source.html#l00432">create_standard()</a>, <a class="el" href="fors__img__science-test_8c_source.html#l00057">test_img_science()</a>, <a class="el" href="fors__img__sky__flat-test_8c_source.html#l00062">test_img_sky_flat()</a>, <a class="el" href="fors__photometry-test_8c_source.html#l00055">test_photometry()</a>, <a class="el" href="fors__setting-test_8c_source.html#l00057">test_setting()</a>, and <a class="el" href="fors__zeropoint [...]
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g7d32a52476925e61a30a10d78e4ad16b"></a><!-- doxytag: member="test_simulate.c::create_standard" ref="g7d32a52476925e61a30a10d78e4ad16b" args="(const char *filename, const char *tag, cpl_frame_group group)" -->
+<a class="anchor" id="ga7b36d87ede4ad7e7e12a408587ab8164"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_frame* create_standard           </td>
+          <td class="memname">cpl_frame* create_standard </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_frame_group </td>
-          <td class="paramname"> <em>group</em></td><td> </td>
+          <td class="paramtype">cpl_frame_group </td>
+          <td class="paramname"><em>group</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create standard star image. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>filename</em> </td><td>save to this file </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>output frame tag </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>group</em> </td><td>output frame group </td></tr>
+</div><div class="memdoc">
+
+<p>Create standard star image. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">filename</td><td>save to this file </td></tr>
+    <tr><td class="paramname">tag</td><td>output frame tag </td></tr>
+    <tr><td class="paramname">group</td><td>output frame group </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>standard field frame </dd></dl>
-
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00432">432</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
-<p>
-References <a class="el" href="test__simulate_8c-source.html#l00384">create_sky_flat()</a>.
-<p>
-Referenced by <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>, <a class="el" href="fors__img__science-test_8c-source.html#l00057">test_img_science()</a>, <a class="el" href="fors__std__star-test_8c-source.html#l00065">test_new()</a>, and <a class="el" href="fors__zeropoint-test_8c-source.html#l00057">test_zeropoint()</a>.
+<dl class="section return"><dt>Returns</dt><dd>standard field frame </dd></dl>
+
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00432">432</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
+<p>References <a class="el" href="test__simulate_8c_source.html#l00384">create_sky_flat()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>, <a class="el" href="fors__img__science-test_8c_source.html#l00057">test_img_science()</a>, <a class="el" href="fors__std__star-test_8c_source.html#l00065">test_new()</a>, and <a class="el" href="fors__zeropoint-test_8c_source.html#l00057">test_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<a class="anchor" name="g385bcf492fd8851be43fad7ec71c7410"></a><!-- doxytag: member="test_simulate.c::create_std_cat" ref="g385bcf492fd8851be43fad7ec71c7410" args="(const char *filename, const char *tag, cpl_frame_group group)" -->
+<a class="anchor" id="ga474a5b51d8eba26e437cb9be2719aab3"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_frame* create_std_cat           </td>
+          <td class="memname">cpl_frame* create_std_cat </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_frame_group </td>
-          <td class="paramname"> <em>group</em></td><td> </td>
+          <td class="paramtype">cpl_frame_group </td>
+          <td class="paramname"><em>group</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create standard star catalogue. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>filename</em> </td><td>save to this file </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>output frame tag </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>group</em> </td><td>output frame group </td></tr>
+</div><div class="memdoc">
+
+<p>Create standard star catalogue. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">filename</td><td>save to this file </td></tr>
+    <tr><td class="paramname">tag</td><td>output frame tag </td></tr>
+    <tr><td class="paramname">group</td><td>output frame group </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>catalogue </dd></dl>
-
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00454">454</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, and <a class="el" href="test__simulate_8c-source.html#l00115">frame_new()</a>.
-<p>
-Referenced by <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>, <a class="el" href="fors__img__science-test_8c-source.html#l00057">test_img_science()</a>, <a class="el" href="fors__std__star-test_8c-source.html#l00065">test_new()</a>, and <a class="el" href="fors__zeropoint-test_8c-source.html#l00057">test_zeropoint()</a>.
+<dl class="section return"><dt>Returns</dt><dd>catalogue </dd></dl>
+
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00454">454</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="test__simulate_8c_source.html#l00115">frame_new()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>, <a class="el" href="fors__img__science-test_8c_source.html#l00057">test_img_science()</a>, <a class="el" href="fors__std__star-test_8c_source.html#l00065">test_new()</a>, and <a class="el" href="fors__zeropoint-test_8c_source.html#l00057">test_zeropoint()</a>.</p>
+
 </div>
-</div><p>
-<a class="anchor" name="g8f676f49cfb4e2066d15d240480450c5"></a><!-- doxytag: member="test_simulate.c::create_phot_table" ref="g8f676f49cfb4e2066d15d240480450c5" args="(const char *filename, const char *tag, cpl_frame_group group)" -->
+</div>
+<a class="anchor" id="gaafef1f08f42e1f9bef0000c27e46169b"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">cpl_frame* create_phot_table           </td>
+          <td class="memname">cpl_frame* create_phot_table </td>
           <td>(</td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>filename</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>filename</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">const char * </td>
-          <td class="paramname"> <em>tag</em>, </td>
+          <td class="paramtype">const char * </td>
+          <td class="paramname"><em>tag</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_frame_group </td>
-          <td class="paramname"> <em>group</em></td><td> </td>
+          <td class="paramtype">cpl_frame_group </td>
+          <td class="paramname"><em>group</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
-
-<p>
-Create photometry table. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>filename</em> </td><td>save to this file </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>tag</em> </td><td>output frame tag </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>group</em> </td><td>output frame group </td></tr>
+</div><div class="memdoc">
+
+<p>Create photometry table. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">filename</td><td>save to this file </td></tr>
+    <tr><td class="paramname">tag</td><td>output frame tag </td></tr>
+    <tr><td class="paramname">group</td><td>output frame group </td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>photometry table </dd></dl>
-
-<p>
-Definition at line <a class="el" href="test__simulate_8c-source.html#l00532">532</a> of file <a class="el" href="test__simulate_8c-source.html">test_simulate.c</a>.
-<p>
-References <a class="el" href="list_8c-source.html#l00101">assure</a>, <a class="el" href="fors__bias__impl_8c-source.html#l00165">cleanup</a>, and <a class="el" href="test__simulate_8c-source.html#l00115">frame_new()</a>.
-<p>
-Referenced by <a class="el" href="fors__identify-test_8c-source.html#l00070">test_identify()</a>, <a class="el" href="fors__img__science-test_8c-source.html#l00057">test_img_science()</a>, <a class="el" href="fors__std__star-test_8c-source.html#l00065">test_new()</a>, <a class="el" href="fors__photometry-test_8c-source.html#l00055">test_photometry()</a>, and <a class="el" href="fors__zeropoint-test_8c-source.html#l00057">test_zeropoint()</a>.
+<dl class="section return"><dt>Returns</dt><dd>photometry table </dd></dl>
+
+<p>Definition at line <a class="el" href="test__simulate_8c_source.html#l00532">532</a> of file <a class="el" href="test__simulate_8c_source.html">test_simulate.c</a>.</p>
+
+<p>References <a class="el" href="list_8c_source.html#l00101">assure</a>, and <a class="el" href="test__simulate_8c_source.html#l00115">frame_new()</a>.</p>
+
+<p>Referenced by <a class="el" href="fors__identify-test_8c_source.html#l00070">test_identify()</a>, <a class="el" href="fors__img__science-test_8c_source.html#l00057">test_img_science()</a>, <a class="el" href="fors__std__star-test_8c_source.html#l00065">test_new()</a>, <a class="el" href="fors__photometry-test_8c_source.html#l00055">test_photometry()</a>, and <a class="el" href="fors__zeropoint-test_8c_source.html#l00057">test_zeropoint()</a>.</p>
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__vimos__calib__impl.html b/html/group__vimos__calib__impl.html
index ddc7ab3..d9879c6 100644
--- a/html/group__vimos__calib__impl.html
+++ b/html/group__vimos__calib__impl.html
@@ -1,70 +1,103 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Vimos_calib_impl</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Vimos_calib_impl</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__vimos__calib__impl.html#gf710e60eea27cfed978ef2989d9b2a33">vimos_calib_impl</a> (cpl_frameset *frameset, cpl_parameterlist *parlist)</td></tr>
-
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Interpret the command line options and execute the data processing.  <a href="#gf710e60eea27cfed978ef2989d9b2a33"></a><br></td></tr>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Vimos_calib_impl</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gaff1b7bb1f87357c0ae0d3bd62c12b096"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__vimos__calib__impl.html#gaff1b7bb1f87357c0ae0d3bd62c12b096">vimos_calib_impl</a> (cpl_frameset *frameset, cpl_parameterlist *parlist)</td></tr>
+<tr class="memdesc:gaff1b7bb1f87357c0ae0d3bd62c12b096"><td class="mdescLeft"> </td><td class="mdescRight">Interpret the command line options and execute the data processing.  <a href="#gaff1b7bb1f87357c0ae0d3bd62c12b096">More...</a><br/></td></tr>
+<tr class="separator:gaff1b7bb1f87357c0ae0d3bd62c12b096"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><h2>Function Documentation</h2>
-<a class="anchor" name="gf710e60eea27cfed978ef2989d9b2a33"></a><!-- doxytag: member="vimos_calib_impl.c::vimos_calib_impl" ref="gf710e60eea27cfed978ef2989d9b2a33" args="(cpl_frameset *frameset, cpl_parameterlist *parlist)" -->
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="gaff1b7bb1f87357c0ae0d3bd62c12b096"></a>
 <div class="memitem">
 <div class="memproto">
       <table class="memname">
         <tr>
-          <td class="memname">int vimos_calib_impl           </td>
+          <td class="memname">int vimos_calib_impl </td>
           <td>(</td>
-          <td class="paramtype">cpl_frameset * </td>
-          <td class="paramname"> <em>frameset</em>, </td>
+          <td class="paramtype">cpl_frameset * </td>
+          <td class="paramname"><em>frameset</em>, </td>
         </tr>
         <tr>
           <td class="paramkey"></td>
           <td></td>
-          <td class="paramtype">cpl_parameterlist * </td>
-          <td class="paramname"> <em>parlist</em></td><td> </td>
+          <td class="paramtype">cpl_parameterlist * </td>
+          <td class="paramname"><em>parlist</em> </td>
         </tr>
         <tr>
           <td></td>
           <td>)</td>
-          <td></td><td></td><td width="100%"></td>
+          <td></td><td></td>
         </tr>
       </table>
-</div>
-<div class="memdoc">
+</div><div class="memdoc">
 
-<p>
-Interpret the command line options and execute the data processing. 
-<p>
-<dl compact><dt><b>Parameters:</b></dt><dd>
-  <table border="0" cellspacing="2" cellpadding="0">
-    <tr><td valign="top"></td><td valign="top"><em>parlist</em> </td><td>The parameters list </td></tr>
-    <tr><td valign="top"></td><td valign="top"><em>frameset</em> </td><td>The set-of-frames</td></tr>
+<p>Interpret the command line options and execute the data processing. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+  <table class="params">
+    <tr><td class="paramname">parlist</td><td>The parameters list </td></tr>
+    <tr><td class="paramname">frameset</td><td>The set-of-frames</td></tr>
   </table>
+  </dd>
 </dl>
-<dl compact><dt><b>Returns:</b></dt><dd>0 if everything is ok </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>0 if everything is ok </dd></dl>
 
-<p>
-Definition at line <a class="el" href="vimos__calib__impl_8c-source.html#l00174">174</a> of file <a class="el" href="vimos__calib__impl_8c-source.html">vimos_calib_impl.c</a>.
-<p>
-References <a class="el" href="fors__dfs_8c-source.html#l01584">dfs_equal_keyword()</a>, <a class="el" href="fors__dfs_8c-source.html#l00117">dfs_generate_filename_tfits()</a>, <a class="el" href="fors__dfs_8c-source.html#l00704">dfs_get_parameter_bool()</a>, <a class="el" href="fors__dfs_8c-source.html#l00507">dfs_get_parameter_double()</a>, <a class="el" href="fors__dfs_8c-source.html#l00410">dfs_get_parameter_int()</a>, <a class="el" href="fors__dfs_8c-source.html#l00605">dfs_get_para [...]
+<p>Definition at line <a class="el" href="vimos__calib__impl_8c_source.html#l00174">174</a> of file <a class="el" href="vimos__calib__impl_8c_source.html">vimos_calib_impl.c</a>.</p>
+
+<p>References <a class="el" href="fors__dfs_8c_source.html#l01628">dfs_equal_keyword()</a>, <a class="el" href="fors__dfs_8c_source.html#l00704">dfs_get_parameter_bool()</a>, <a class="el" href="fors__dfs_8c_source.html#l00507">dfs_get_parameter_double()</a>, <a class="el" href="fors__dfs_8c_source.html#l00410">dfs_get_parameter_int()</a>, <a class="el" href="fors__dfs_8c_source.html#l00605">dfs_get_parameter_string()</a>, <a class="el" href="fors__dfs_8c_source.html#l00969">dfs_load_hea [...]
+
+</div>
 </div>
-</div><p>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/group__vimos__science__impl.html b/html/group__vimos__science__impl.html
index abfb729..5d76490 100644
--- a/html/group__vimos__science__impl.html
+++ b/html/group__vimos__science__impl.html
@@ -1,27 +1,62 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Vimos_science_impl</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>Vimos_science_impl</h1><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g79a502c79f4843218e3d0d4adec9c907"></a><!-- doxytag: member="vimos_science_impl::vimos_science_impl" ref="g79a502c79f4843218e3d0d4adec9c907" args="(cpl_frameset *frameset, cpl_parameterlist *parlist)" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__vimos__science__impl.html#g79a502c79f4843218e3d0d4adec9c907">vimos_science_impl</a> (cpl_frameset *frameset, cpl_parameterlist *parlist)</td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#func-members">Functions</a>  </div>
+  <div class="headertitle">
+<div class="title">Vimos_science_impl</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga193962b82787f8dbdf708dcb78ff159e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga193962b82787f8dbdf708dcb78ff159e"></a>
+int </td><td class="memItemRight" valign="bottom"><b>vimos_science_impl</b> (cpl_frameset *frameset, cpl_parameterlist *parlist)</td></tr>
+<tr class="separator:ga193962b82787f8dbdf708dcb78ff159e"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/index.hhc b/html/index.hhc
index 59c6a7e..5560786 100644
--- a/html/index.hhc
+++ b/html/index.hhc
@@ -8,842 +8,625 @@
   <UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="World_Coordinate_Systems"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_cpl_wcs_"><param name="ImageNumber" value="1"></OBJECT>
       <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs_init"><param name="Local" value="group__fors__cpl__wcs.html#g1ff77ef3ec6654b60865ff114ffb0194"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs_plist2fitsstr"><param name="Local" value="group__fors__cpl__wcs.html#ge66dce7f4ef9d442dd849595f39b82bf"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs_fitsstr2plist"><param name="Local" value="group__fors__cpl__wcs.html#g8d23e487c941ebc5b4d30a113f9dc324"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs_delete"><param name="Local" value="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="wcslib_errmsgs"><param name="Local" value="group__fors__cpl__wcs.html#ga106b9beff20823017688021d7f008c3"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Data Structures"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_cpl_wcs_"><param name="Local" value="struct__fors__cpl__wcs__.html"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="wcsptr"><param name="Local" value="struct__fors__cpl__wcs__.html#a76ffd1e0af7f1d000078931be71a845e"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="naxis"><param name="Local" value="struct__fors__cpl__wcs__.html#aa75d49f978e1ff975e9cb68f09c16c18"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dims"><param name="Local" value="struct__fors__cpl__wcs__.html#aec01adf7519d22a1fb59c61076057595"><param name="ImageNumber" value="11"></OBJECT>
       </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs_init"><param name="Local" value="group__fors__cpl__wcs.html#ga1027310dff52a22788095ccdc54263ac"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs_plist2fitsstr"><param name="Local" value="group__fors__cpl__wcs.html#gaa352c368a01171ba9fbfa0b63dd7784e"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs_fitsstr2plist"><param name="Local" value="group__fors__cpl__wcs.html#ga85c6df963659c6ab9a28649094ae037a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs_delete"><param name="Local" value="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="DFS Utilities"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__forsdfs.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__forsdfs.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="errorstate_dump_one"><param name="Local" value="group__forsdfs.html#g8479954471cd14e92ec92efce09ec87b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_begin"><param name="Local" value="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_end"><param name="Local" value="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_set_groups"><param name="Local" value="group__forsdfs.html#g37d74636b6c3f3d52b0312ce3a58e59d"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_pipeline_version"><param name="Local" value="group__forsdfs.html#g61956e9dcf77f5c71db911e0390f63f3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_int"><param name="Local" value="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_double"><param name="Local" value="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_string"><param name="Local" value="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_bool"><param name="Local" value="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_bool_const"><param name="Local" value="group__forsdfs.html#gfce5eddb71d8700b30c690f49374d2e0"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_int_const"><param name="Local" value="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_double_const"><param name="Local" value="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_string_const"><param name="Local" value="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_load_image"><param name="Local" value="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_load_table"><param name="Local" value="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_load_header"><param name="Local" value="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save"><param name="Local" value="group__forsdfs.html#g8670593994ad689ac3aa76cf648e76c3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_save_image"><param name="Local" value="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_add_wcs"><param name="Local" value="group__forsdfs.html#geb1068e007bd0ebef0cd4a6aa12cf523"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_add_exptime"><param name="Local" value="group__forsdfs.html#gea45a5b73ab086e5e08680928adbd0cd"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_save_table"><param name="Local" value="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save_image"><param name="Local" value="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save_table"><param name="Local" value="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_equal_keyword"><param name="Local" value="group__forsdfs.html#g318f71668fea717baced57478bd282c8"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save_table_ext"><param name="Local" value="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save_image_ext"><param name="Local" value="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save_image_null"><param name="Local" value="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="errorstate_dump_one"><param name="Local" value="group__forsdfs.html#gaa72aa06ad8174e7f9e14b556e1ec130f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_begin"><param name="Local" value="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_end"><param name="Local" value="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_set_groups"><param name="Local" value="group__forsdfs.html#ga5162766f25e67bb99869e7959c3f8201"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_pipeline_version"><param name="Local" value="group__forsdfs.html#ga31c40f4add0fc7ef1e992d99493f5d1a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_int"><param name="Local" value="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_double"><param name="Local" value="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_string"><param name="Local" value="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_bool"><param name="Local" value="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_bool_const"><param name="Local" value="group__forsdfs.html#gae0dc63f80258d73a93d35e41b2a8b367"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_int_const"><param name="Local" value="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_double_const"><param name="Local" value="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_get_parameter_string_const"><param name="Local" value="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_load_image"><param name="Local" value="group__forsdfs.html#ga326130afab421ef30992def2a444d660"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_load_table"><param name="Local" value="group__forsdfs.html#ga010c17942448386415d6e51adebae649"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_load_header"><param name="Local" value="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save"><param name="Local" value="group__forsdfs.html#ga04ce01a9ddd2c4ddee75010d7fdb81fd"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_save_image"><param name="Local" value="group__forsdfs.html#ga45cefe5c9339a8b27be0454c9144a70a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_save_image_err"><param name="Local" value="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_add_wcs"><param name="Local" value="group__forsdfs.html#gadbf163fdd77abcf68fac009993f20959"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_add_exptime"><param name="Local" value="group__forsdfs.html#ga71054af8e26681ec2d7e1ea39e7feb17"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs_save_table"><param name="Local" value="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save_image"><param name="Local" value="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save_table"><param name="Local" value="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_equal_keyword"><param name="Local" value="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save_table_ext"><param name="Local" value="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save_image_ext"><param name="Local" value="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="dfs_save_image_null"><param name="Local" value="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="floating point values"><param name="Local" value="group__fors__double.html"><param name="ImageNumber" value="11"></OBJECT>
     <UL>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Image source extraction"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__extract.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__extract.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="extract_sex"><param name="Local" value="group__fors__extract.html#g5237e1161aeef9d828a973333151a36f"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="extract_test"><param name="Local" value="group__fors__extract.html#gedc4ee1e5daa54e4859e929c7ff51f59"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_check_sex_flag"><param name="Local" value="group__fors__extract.html#gcdd189ebaad6fe5c20ac2dea2eb06dfe"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_check_sex_star"><param name="Local" value="group__fors__extract.html#g2c649f2f8802860d4693e38bd640032c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_define_parameters"><param name="Local" value="group__fors__extract.html#gd07fd085541e8be0723f2932a29abdb3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_method_new"><param name="Local" value="group__fors__extract.html#g1f3f1af725e7b5fb1c770507eab8ac09"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract"><param name="Local" value="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Data Structures"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="_extract_method"><param name="Local" value="struct__extract__method.html"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_extract_method"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="SEX"><param name="Local" value="struct__extract__method.html#a0c08efabb16395acf6dc57359ce2efdca8af9468116051486c500fd1f9bca5f16"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="TEST"><param name="Local" value="struct__extract__method.html#a0c08efabb16395acf6dc57359ce2efdca52b86675c6829bbd9db54deed976d6e3"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="method"><param name="Local" value="struct__extract__method.html#a6d3808d8f76ccba38a0b04b348f55071"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sex_exe"><param name="Local" value="struct__extract__method.html#aa51edfe17fbf90e81405a4d343d6211f"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sex_config"><param name="Local" value="struct__extract__method.html#a4b963442d71be80738b5994e97c75b36"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sex_mag"><param name="Local" value="struct__extract__method.html#a0cb0c99c37ef47b7569955e8f42adbf6"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sex_magerr"><param name="Local" value="struct__extract__method.html#a4ddadecb69b1867762accb298da7e7d7"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sex_radius"><param name="Local" value="struct__extract__method.html#a94aa696ea0cf75d5a40545f6ada13e43"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="extract_sex"><param name="Local" value="group__fors__extract.html#ga179ba42491f97607c78d677e432614a7"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="extract_test"><param name="Local" value="group__fors__extract.html#ga6a2e3af8f65f79d338c6f0c46931b89d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_check_sex_flag"><param name="Local" value="group__fors__extract.html#ga0753c9c8f5c40f594ebc0628407df2d4"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_check_sex_star"><param name="Local" value="group__fors__extract.html#gab2bb9e07066870dd90dadd6044803dd0"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_define_parameters"><param name="Local" value="group__fors__extract.html#ga2fe71423afa3cceea5d92dd3b49aca1e"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_method_new"><param name="Local" value="group__fors__extract.html#ga9b1d727905c3cb3f7740900ffaba6b57"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_method_delete"><param name="Local" value="group__fors__extract.html#ga11354d3d250769e1adb67e1a2dbc1a96"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract"><param name="Local" value="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Quality Control Utilities"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__forsqc.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_header_write_string"><param name="Local" value="group__forsqc.html#g3732f2464bb007412951345e03594a17"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_header_write_double"><param name="Local" value="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_start_group"><param name="Local" value="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_write_group_heading"><param name="Local" value="group__forsqc.html#g1ccea526719a1be6c14de81963d81955"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_end_group"><param name="Local" value="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_write_string"><param name="Local" value="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_write_double"><param name="Local" value="group__forsqc.html#g033fc0f2f9e321c4ac98ee7f412b2c6e"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_keyword_to_paf"><param name="Local" value="group__forsqc.html#g44d5359f81302747fff155c168c88200"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_write_qc_string"><param name="Local" value="group__forsqc.html#ga4480637fba9623895546614d7a21fb5"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_write_qc_double"><param name="Local" value="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_header_write_string"><param name="Local" value="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_header_write_double"><param name="Local" value="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_start_group"><param name="Local" value="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_write_group_heading"><param name="Local" value="group__forsqc.html#ga9ff2c73c315e805ab5d1415a2de9ce0b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_end_group"><param name="Local" value="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_write_string"><param name="Local" value="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_write_double"><param name="Local" value="group__forsqc.html#ga8355f62ab2783be464130e8de57487b3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_keyword_to_paf"><param name="Local" value="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_write_qc_string"><param name="Local" value="group__forsqc.html#ga47dfe71df58ec7c851d4f3853f9f9b00"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc_write_qc_double"><param name="Local" value="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Source identification"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__identify.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__identify.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__identify.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="inside_region"><param name="Local" value="group__fors__identify.html#gdfc439dadf11b131119fe17cb19f6e25"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="match_patterns"><param name="Local" value="group__fors__identify.html#g3c4ce99ce7472d6d48acffcf562b0fb7"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify_define_parameters"><param name="Local" value="group__fors__identify.html#g62b335e73ad633535e1494f9ffd0cd03"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify_method_new"><param name="Local" value="group__fors__identify.html#g2763139bd0ceba14e3be219d5d043e46"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="std_brighter_than"><param name="Local" value="group__fors__identify.html#g5e7cadfe27ffb45ccfa00905d520878e"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="star_brighter_than"><param name="Local" value="group__fors__identify.html#g4a762f4e872e3f797ba890c9d93eb98c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="distsq_shift"><param name="Local" value="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="star_nearer"><param name="Local" value="group__fors__identify.html#gd13e1eb3050a7a1933760649f74fa14a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify"><param name="Local" value="group__fors__identify.html#g879f2fc7b296f37722f6203d0ead78b6"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Data Structures"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="_identify_method"><param name="Local" value="struct__identify__method.html"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_identify_method"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="ncat"><param name="Local" value="struct__identify__method.html#a98ec6209ab8334189fdeb0ba9ad6db62"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="nsource"><param name="Local" value="struct__identify__method.html#a42bd374120c9b0d6c6798af05c91551a"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="kappa"><param name="Local" value="struct__identify__method.html#a7c4345b693fd891d4f343eaddc34979e"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="search"><param name="Local" value="struct__identify__method.html#a751e9793a2bf184209201ec0403db027"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="max_search"><param name="Local" value="struct__identify__method.html#a9b637dbee7a14e588182802a46a33fc9"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="max_offset"><param name="Local" value="struct__identify__method.html#a54fd4d467ce3b51859fb581b23d384b4"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="inside_region"><param name="Local" value="group__fors__identify.html#ga2bf16455ff9dadaa26861905f8999616"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="match_patterns"><param name="Local" value="group__fors__identify.html#gabbed61b85afc33d67894bd2dd1f061f3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify_define_parameters"><param name="Local" value="group__fors__identify.html#gac0dc4fbd9cc717256e5972cad3e7447f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify_method_new"><param name="Local" value="group__fors__identify.html#ga642e6d38ae7b273d1901698a3970fd49"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify_method_delete"><param name="Local" value="group__fors__identify.html#gaea1f0f7065727f62a6e3a5805549a9ce"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="std_brighter_than"><param name="Local" value="group__fors__identify.html#ga1c91776ec58d5026026e00580f18f277"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="star_brighter_than"><param name="Local" value="group__fors__identify.html#ga75bfe0adc06bd97c18925132d4abf937"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="distsq_shift"><param name="Local" value="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="star_nearer"><param name="Local" value="group__fors__identify.html#ga95a6f76b39659c4ce77f5f4ae3366a6f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify"><param name="Local" value="group__fors__identify.html#ga734ab55ebf9bec1bed7e6330def7b6d8"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Image with error bars"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_new"><param name="Local" value="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_duplicate"><param name="Local" value="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_delete"><param name="Local" value="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_delete_const"><param name="Local" value="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_load_list"><param name="Local" value="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_load_list_const"><param name="Local" value="group__fors__image.html#gab0a6629f36c4db609f1a1515d602477"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_load"><param name="Local" value="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_save"><param name="Local" value="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_save_sex"><param name="Local" value="group__fors__image.html#g1ddf7d1b81954a8d2113e4f5174301a8"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_size_x"><param name="Local" value="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_size_y"><param name="Local" value="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_data_const"><param name="Local" value="group__fors__image.html#gdffe6405bb64c769dfcdf71c6a281dad"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_abs"><param name="Local" value="group__fors__image.html#g5ac7cb865a07bab1987284dba3676ceb"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_square"><param name="Local" value="group__fors__image.html#g18f269421a43f46c063b667fac72c938"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_subtract"><param name="Local" value="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_multiply_noerr"><param name="Local" value="group__fors__image.html#g0769427c961bdf0fd79eda47fcadeee2"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_divide_noerr"><param name="Local" value="group__fors__image.html#g4c8774a9e651df6d05689d208fb349e1"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_divide"><param name="Local" value="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_multiply"><param name="Local" value="group__fors__image.html#g15f95ab361e6c2ea44bafbada5d8d4a1"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_subtract_scalar"><param name="Local" value="group__fors__image.html#g50a06b605ca558553e0642209b93c100"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_divide_scalar"><param name="Local" value="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_multiply_scalar"><param name="Local" value="group__fors__image.html#g077f7a5a847fa9c0e458dca2e12e4e6f"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_exponential"><param name="Local" value="group__fors__image.html#g78afca4bf8e5c3dc80d0dcd7f682f9e9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_min"><param name="Local" value="group__fors__image.html#gc4edb9a966bcf97a17ad6a5c1b9d020f"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_max"><param name="Local" value="group__fors__image.html#g5c7d9b043db23a40e632ffc34c3f3d5c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_mean"><param name="Local" value="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_median"><param name="Local" value="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_crop"><param name="Local" value="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_filter_median_create"><param name="Local" value="group__fors__image.html#g96498be3e15cde80921709406c33b6f3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_filter_max_create"><param name="Local" value="group__fors__image.html#g315f5476160ed7db282a7623f0d354b0"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_stdev"><param name="Local" value="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_stdev_robust"><param name="Local" value="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_error_mean"><param name="Local" value="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_collapse_create"><param name="Local" value="group__fors__image.html#g4154f529cbabe4cb4d1203d03e771f8a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_collapse_minmax_create"><param name="Local" value="group__fors__image.html#gfe360dbc95e94b6b1043401aef8cbacc"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_collapse_ksigma_create"><param name="Local" value="group__fors__image.html#g9f084a5b4f1564f1efb645e342eee2af"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_collapse_median_create"><param name="Local" value="group__fors__image.html#gbd2b7e8761473ff4ca42f90fa879e1ad"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_draw"><param name="Local" value="group__fors__image.html#g5b5539c0e15fe20c16bedc58e8263724"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Data Structures"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_image"><param name="Local" value="struct__fors__image.html"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_image"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="data"><param name="Local" value="struct__fors__image.html#a08eca6a1c5d5cfeb4af73b15c7985b3b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="variance"><param name="Local" value="struct__fors__image.html#a88979de9862cd29d904a4f1e616509a4"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_new"><param name="Local" value="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_duplicate"><param name="Local" value="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_delete"><param name="Local" value="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_delete_const"><param name="Local" value="group__fors__image.html#ga67d54e90304b185e9f211aba5a620c4f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_load_list"><param name="Local" value="group__fors__image.html#gaf3015630f60828aa86962af230cd156c"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_load_list_const"><param name="Local" value="group__fors__image.html#ga0895dc7573734afe519fa4dff3ea33bd"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_load"><param name="Local" value="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_save"><param name="Local" value="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_save_sex"><param name="Local" value="group__fors__image.html#ga38eebeb331a65efbffbc6dc04304a786"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_size_x"><param name="Local" value="group__fors__image.html#ga978969a0911531b117735be291f106cc"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_size_y"><param name="Local" value="group__fors__image.html#ga74854105003c725472595225aab740d7"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_data_const"><param name="Local" value="group__fors__image.html#ga547b9bf5f615a083bffdcfa9097d0520"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_abs"><param name="Local" value="group__fors__image.html#ga14651bbe94e495df34aa59b335439b8f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_square"><param name="Local" value="group__fors__image.html#gad4ecbb0eb96611d66dc9a3a1bc2ae0d8"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_subtract"><param name="Local" value="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_multiply_noerr"><param name="Local" value="group__fors__image.html#ga25c0e2f6005831b9f5fcf3d81accfc43"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_divide_noerr"><param name="Local" value="group__fors__image.html#ga88aca44b1a0bde06bbd43c487ae58766"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_divide"><param name="Local" value="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_multiply"><param name="Local" value="group__fors__image.html#gaaa54b1e6e0e3cf5fcf442267896f6dad"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_subtract_scalar"><param name="Local" value="group__fors__image.html#gacbfb7c0518043b1079bb72af95d80961"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_divide_scalar"><param name="Local" value="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_multiply_scalar"><param name="Local" value="group__fors__image.html#gadd751e2623f778d5bb2b8f3b628077c2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_exponential"><param name="Local" value="group__fors__image.html#gabe2039c17c13fed0e430d71cb38454bf"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_min"><param name="Local" value="group__fors__image.html#ga918a9107b07852d77bd457ea44d9b28e"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_max"><param name="Local" value="group__fors__image.html#ga8bde38b5f976d70ab7d6cef4652e1a51"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_mean"><param name="Local" value="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_median"><param name="Local" value="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_crop"><param name="Local" value="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_filter_median_create"><param name="Local" value="group__fors__image.html#ga395b18920e75b55d9a793dfbcb99755f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_filter_max_create"><param name="Local" value="group__fors__image.html#ga21965427a98e2e07cf0b167e4610da1c"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_stdev"><param name="Local" value="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_stdev_robust"><param name="Local" value="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_get_error_mean"><param name="Local" value="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_collapse_create"><param name="Local" value="group__fors__image.html#ga5510f4f5ebec4c99de3d9567b4eca21d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_collapse_minmax_create"><param name="Local" value="group__fors__image.html#ga41938f63e18b05073716d2afed9bd4a3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_collapse_ksigma_create"><param name="Local" value="group__fors__image.html#ga3789562f96e6c162f90d51388d372a88"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_collapse_median_create"><param name="Local" value="group__fors__image.html#ga0d7aab18ef2992f7efba3ab24f7af503"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image_draw"><param name="Local" value="group__fors__image.html#ga84a11915fdc3ac7ae1c9535d9eadfeeb"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="FORS_IMAGE_TYPE"><param name="Local" value="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="PAF File Utilities"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="deleteForsPAF"><param name="Local" value="group__forsPaf.html#gefe94695ad068025eff46fe69998e75d"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="newForsPAF"><param name="Local" value="group__forsPaf.html#gb2e886163098d674eb07e95d96b38229"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFIsEmpty"><param name="Local" value="group__forsPaf.html#ge80d2196e3845f5857f374416333edbc"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFGetSize"><param name="Local" value="group__forsPaf.html#gb39490ffdb9ac9b2e666d75da2436b65"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFIsValidName"><param name="Local" value="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFAppendBool"><param name="Local" value="group__forsPaf.html#g15b886f9811c703203b77a91e3bd0e91"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFAppendInt"><param name="Local" value="group__forsPaf.html#gde7f65f7ca0d7e3e24babefd2c8d8716"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFAppendDouble"><param name="Local" value="group__forsPaf.html#gdd6ed0c50b7cf4c62fdbabd0794487e4"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFAppendString"><param name="Local" value="group__forsPaf.html#gf615f1fbc45dd108391de129e67d58b2"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFWrite"><param name="Local" value="group__forsPaf.html#g2cceff721bbbd99c1a4bddfb57ed688b"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Data Structures"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="_FORS_PAF_RECORD_"><param name="Local" value="struct__FORS__PAF__RECORD__.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="_FORS_PAF_"><param name="Local" value="struct__FORS__PAF__.html"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_FORS_PAF_RECORD_"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="name"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a6d69378eba6870b6fa93c3a3cf63910d"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="comment"><param name="Local" value="struct__FORS__PAF__RECORD__.html#af69bb301a9df55477add23c6a2ad6240"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="type"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a3b157d712d46492bc176a06500980115"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="bval"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a9f6a3cbd6d225d887915e66b0332a602"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="ival"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a4b70add4f59db612cc76ea7d35d9f8f4"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dval"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a6be2b65d15141a111388a7225c833800"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sval"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a5a7a61b02c5b01f9e3681ad2651e2ef2"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="data"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a85d0294d00b7c5b4205fadac85526328"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_FORS_PAF_"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="name"><param name="Local" value="struct__FORS__PAF__.html#a8277746dbb0ef7626fbc103f763ebcf1"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="nh"><param name="Local" value="struct__FORS__PAF__.html#ae6e4dfc62b72ede7cc3eb94f9442567d"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="nr"><param name="Local" value="struct__FORS__PAF__.html#a819813f81b4540eff32231e77d9c52e9"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="header"><param name="Local" value="struct__FORS__PAF__.html#a7f44550c15b50560e761a07c8b78024d"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="records"><param name="Local" value="struct__FORS__PAF__.html#af406fb3edb547a0608a76c93b8b6f6c8"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="deleteForsPAF"><param name="Local" value="group__forsPaf.html#ga5d62f23bc1a07c4136aecccfcea2459d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="newForsPAF"><param name="Local" value="group__forsPaf.html#ga7aef24280b6605d6dfbb063bab8da2f4"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFIsEmpty"><param name="Local" value="group__forsPaf.html#ga84dbb309c51aee01813cc9b90dde96cb"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFGetSize"><param name="Local" value="group__forsPaf.html#ga38a21baf09dfb452f820eb2aded1a6c0"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFIsValidName"><param name="Local" value="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFAppendBool"><param name="Local" value="group__forsPaf.html#gaac413514350c777efbd5ed0e1cc26778"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFAppendInt"><param name="Local" value="group__forsPaf.html#gae15f3d1ee9b849039f26cd82d3568913"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFAppendDouble"><param name="Local" value="group__forsPaf.html#ga83aca84f4fb88e3db7a233b442cd644a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFAppendString"><param name="Local" value="group__forsPaf.html#gad23a2cd11683bd001f954383a282b9c3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="forsPAFWrite"><param name="Local" value="group__forsPaf.html#ga3e16371f03930ae272a5454ad6100f83"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="FITS keywords"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="FORS_PFITS_CONAD"><param name="Local" value="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="FORS_PFITS_RON"><param name="Local" value="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="2d point"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point_new"><param name="Local" value="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point_duplicate"><param name="Local" value="group__fors__point.html#gc5a8341742fc371f6e7332600286045e"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point_delete"><param name="Local" value="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point_distsq"><param name="Local" value="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point_equal"><param name="Local" value="group__fors__point.html#g5f09413dd7958d3ebbe1ba7700b27377"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point_new"><param name="Local" value="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point_duplicate"><param name="Local" value="group__fors__point.html#gaefadbecbfc8e491ca544292027d8b69e"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point_delete"><param name="Local" value="group__fors__point.html#gacfd40664615a747765cacb741e0823d0"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point_distsq"><param name="Local" value="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point_equal"><param name="Local" value="group__fors__point.html#ga08402a65da099406fc85d21041df7f9d"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Tools for Polynomial Coefficient Handling"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_is_coeff_set"><param name="Local" value="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_powers_next"><param name="Local" value="group__fors__polynomial.html#g5d5e2697050554c599837146744408fc"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_count_coeff"><param name="Local" value="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_powers_find_first_coeff"><param name="Local" value="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_powers_find_next_coeff"><param name="Local" value="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_set_existing_coeff"><param name="Local" value="group__fors__polynomial.html#g2255e6cc731c54c6b5575e506bd5fea8"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_create_variance_polynomial"><param name="Local" value="group__fors__polynomial.html#ga116e293092bfb1db2c5e90504e90cc0"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_dump"><param name="Local" value="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_sprint_coeff"><param name="Local" value="group__fors__polynomial.html#g54a749f0fe51db3713c776ffe5dd0b57"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_is_coeff_set"><param name="Local" value="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_powers_next"><param name="Local" value="group__fors__polynomial.html#ga16814ff8371aba44b9730bc3d516ef5f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_count_coeff"><param name="Local" value="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_powers_find_first_coeff"><param name="Local" value="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_powers_find_next_coeff"><param name="Local" value="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_set_existing_coeff"><param name="Local" value="group__fors__polynomial.html#ga9363bc98285fa909170db1684e81a240"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_create_variance_polynomial"><param name="Local" value="group__fors__polynomial.html#ga2de60ddde27a60692e8e116939ef5007"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_dump"><param name="Local" value="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial_sprint_coeff"><param name="Local" value="group__fors__polynomial.html#ga498733e7d062578c77b1ae5c0f6f2935"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Instrument setting"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__setting.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__setting.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting_new_level"><param name="Local" value="group__fors__setting.html#gd72375aaa7f1199f3271f15afd724ded"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting_new"><param name="Local" value="group__fors__setting.html#g7598470080174f400b75141530ad2c5a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting_verify"><param name="Local" value="group__fors__setting.html#gccd3b501cb380066770b1250942fa02a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting_delete"><param name="Local" value="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting_new_level"><param name="Local" value="group__fors__setting.html#ga05ebcfdde1706094627a0dd4af5186ae"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting_new"><param name="Local" value="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting_verify"><param name="Local" value="group__fors__setting.html#ga160a93959e72b826426891ca8e0f80aa"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting_delete"><param name="Local" value="group__fors__setting.html#ga6a9999a057167a310f81224d0218cb83"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Image stacking"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__stack.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__stack.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack_define_parameters"><param name="Local" value="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack_method_new"><param name="Local" value="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack_method_delete"><param name="Local" value="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack_method_get_string"><param name="Local" value="group__fors__stack.html#g245b26490c31d54735bae3f76345b365"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack_const"><param name="Local" value="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack_define_parameters"><param name="Local" value="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack_method_new"><param name="Local" value="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack_method_delete"><param name="Local" value="group__fors__stack.html#ga9b1d85fcb31770b51259b8aa24c47ae2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack_method_get_string"><param name="Local" value="group__fors__stack.html#ga5b92c215ed81d61bc8718b55e604ebc2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack_const"><param name="Local" value="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack"><param name="Local" value="group__fors__stack.html#ga6792068e2f3a973ad54722120779feb1"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="star"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="_get_optional_table_value"><param name="Local" value="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_new"><param name="Local" value="group__fors__star.html#g548c477088fd4fbadd74fd84f3becb94"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_new_from_table"><param name="Local" value="group__fors__star.html#gec880ac28409dd535ec3138e0b5b001c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_check_values"><param name="Local" value="group__fors__star.html#g1ef535783913303ad950792cdd1d59c8"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_duplicate"><param name="Local" value="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_delete"><param name="Local" value="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_delete_but_standard"><param name="Local" value="group__fors__star.html#g40fa6037fee74abd5a9d5166137609e0"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_equal"><param name="Local" value="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_brighter_than"><param name="Local" value="group__fors__star.html#g100f4290bf02ce348f22092f4e2bc3eb"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_distsq"><param name="Local" value="group__fors__star.html#g21eca2e7981ea38bc0b5a66edfc56bb9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_extension"><param name="Local" value="group__fors__star.html#g4f81e6410fe5c7aefbdbcae907095059"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_stellarity"><param name="Local" value="group__fors__star.html#g310c2402602378a7505a36a85ee98c7b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_ellipticity"><param name="Local" value="group__fors__star.html#gdef23fa2c1ad1c4f2b0de18038b0daca"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_print"><param name="Local" value="group__fors__star.html#g89b5801d41c9760d82ec12097e14b584"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_print_list"><param name="Local" value="group__fors__star.html#g8ab50c70291d9ed66d075ce9ae93577d"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_get_x"><param name="Local" value="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_get_y"><param name="Local" value="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_get_zeropoint"><param name="Local" value="group__fors__star.html#gb718ac03773576fc6856847b4211ffba"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_get_zeropoint_err"><param name="Local" value="group__fors__star.html#g22fc7f95537194266794e24345cdda0b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_is_identified"><param name="Local" value="group__fors__star.html#g41b7ffa8530d0ffbc45916248663ac45"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_get_optional_table_value"><param name="Local" value="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_new"><param name="Local" value="group__fors__star.html#ga7a8b2a60d5685524ffbb762e066c9b01"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_new_from_table"><param name="Local" value="group__fors__star.html#ga5be8cd6931b5f998692daaf65bcf9755"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_check_values"><param name="Local" value="group__fors__star.html#ga279f39755ddfa24ee9cfad4a03c01cf3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_duplicate"><param name="Local" value="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_delete"><param name="Local" value="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_delete_but_standard"><param name="Local" value="group__fors__star.html#ga517c8c542ad4eb8145fa664be9625a98"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_equal"><param name="Local" value="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_brighter_than"><param name="Local" value="group__fors__star.html#ga7672a63fe0deea93cb8bae8362b6d020"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_distsq"><param name="Local" value="group__fors__star.html#ga53496a5c3e6810c6c59d221120df422b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_extension"><param name="Local" value="group__fors__star.html#ga2c97d2c47686016fa04c59b2a3e92b5c"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_stellarity"><param name="Local" value="group__fors__star.html#ga67451b955667ae4f965146aee484c6bc"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_ellipticity"><param name="Local" value="group__fors__star.html#ga9e7994d44acbe88580cab63d3662df40"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_print"><param name="Local" value="group__fors__star.html#ga3443159e600f23336b266f7b557f4ea0"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_print_list"><param name="Local" value="group__fors__star.html#ga4e15f3d1dbd18c8e010dc4ef82401d7d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_get_x"><param name="Local" value="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_get_y"><param name="Local" value="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_get_zeropoint"><param name="Local" value="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_get_zeropoint_err"><param name="Local" value="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_is_identified"><param name="Local" value="group__fors__star.html#ga525a48af1f85cf79ee7a60885eb5b13d"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="High level functions"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__tools.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__tools.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__tools.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_ext_corr"><param name="Local" value="group__fors__tools.html#g6a1cb404cc2c956f79b10ea46a0611dc"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_create_sources_table"><param name="Local" value="group__fors__tools.html#g8138511b64d1d365e21b56eb161f2028"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_fixed_pattern_noise"><param name="Local" value="group__fors__tools.html#g5637ecda70fb6aeab5c0b22dec2e2e10"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_fixed_pattern_noise_bias"><param name="Local" value="group__fors__tools.html#g2e2a80069157183a808349976b3e455a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_get_airmass"><param name="Local" value="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star_ext_corr"><param name="Local" value="group__fors__tools.html#ga38ae9b9338fdb3cca9a17d970fac3db3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_create_sources_table"><param name="Local" value="group__fors__tools.html#gabebf30c47320c004ab4e658f837f75db"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_fixed_pattern_noise"><param name="Local" value="group__fors__tools.html#ga97b43bda55e1da41fe216364c8408d5b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_fixed_pattern_noise_bias"><param name="Local" value="group__fors__tools.html#ga1ea0e4e37d52d6077b39e93ad1c340c3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_get_airmass"><param name="Local" value="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Miscellaneous Utilities"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_get_license"><param name="Local" value="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_get_version_binary"><param name="Local" value="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_rand_gauss"><param name="Local" value="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frame_get_type_string"><param name="Local" value="group__fors__utils.html#gf509a28ce04d6804eabe62b2a5817afe"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frame_get_group_string"><param name="Local" value="group__fors__utils.html#gc219cfea8dd4f3c5a0aceb222d19150a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frame_get_level_string"><param name="Local" value="group__fors__utils.html#gc02f8fba22227907e45bdcbe6de8655e"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frameset_print"><param name="Local" value="group__fors__utils.html#gc1181b0023db290ca5bfc42e9980e3a8"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frame_print"><param name="Local" value="group__fors__utils.html#g375049f68639265267adcdc11d161bc3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frameset_extract"><param name="Local" value="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_type_get_string"><param name="Local" value="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_parameterlist_set_defaults"><param name="Local" value="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_imagelist_collapse_create"><param name="Local" value="group__fors__utils.html#g833fbeca7835f9c594deb0a8752d8b74"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_imagelist_collapse_median_create"><param name="Local" value="group__fors__utils.html#g2d1787d975000e60e8790fc656d538f6"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_angle_diff"><param name="Local" value="group__fors__utils.html#g71645af45bc192964d3170f28c671240"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_msg_macro"><param name="Local" value="group__fors__utils.html#ge561fe29b3673b34094804e26ece5e8e"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_utils_median_corr"><param name="Local" value="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_get_license"><param name="Local" value="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_print_banner"><param name="Local" value="group__fors__utils.html#gaf34da190cb639a584e5f2473de24d887"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_get_version_binary"><param name="Local" value="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_rand_gauss"><param name="Local" value="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_tools_get_kth_double"><param name="Local" value="group__fors__utils.html#gac3759b058af73511a69998299a11a40f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_tools_get_median_float"><param name="Local" value="group__fors__utils.html#ga513ceb86672094a1d13a45d75e01782a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_tools_get_median_fast_float"><param name="Local" value="group__fors__utils.html#ga5de34c3a7ff32722bc68e1b3a67f3390"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_tools_get_kth_float"><param name="Local" value="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frame_get_type_string"><param name="Local" value="group__fors__utils.html#gad97092a91b5de91f84039778596fd759"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frame_get_group_string"><param name="Local" value="group__fors__utils.html#ga3e2178bad7068e3768fc5f78b1d02490"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frame_get_level_string"><param name="Local" value="group__fors__utils.html#ga82f1aaba039c880a3bff109f3729d74a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frameset_print"><param name="Local" value="group__fors__utils.html#ga414e1f2d95f271cc76a67e525b910e96"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frame_print"><param name="Local" value="group__fors__utils.html#ga6692a0ba541b3e7f99654f844aee40c6"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_frameset_extract"><param name="Local" value="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_type_get_string"><param name="Local" value="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_parameterlist_set_defaults"><param name="Local" value="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_imagelist_collapse_create"><param name="Local" value="group__fors__utils.html#gabb34a534e28308533f300ea11ec7a3a3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_imagelist_collapse_median_create"><param name="Local" value="group__fors__utils.html#gaa55c5fd8ade8f10e441297c0cda96093"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_angle_diff"><param name="Local" value="group__fors__utils.html#ga69350709e5f9874601c729becd315e81"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_msg_macro"><param name="Local" value="group__fors__utils.html#gae98c540953f671b35817aac071aa4adc"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_utils_median_corr"><param name="Local" value="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="container type"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="assure"><param name="Local" value="group__multiset.html#g867790f186ab6cc04c00a80f80983991"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="list_new"><param name="Local" value="group__multiset.html#g14ca81b1edd1222975ab52e203cbde59"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="list_duplicate"><param name="Local" value="group__multiset.html#ge8bd4915a67367a226dcd3f5c3bd5491"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="list_extract"><param name="Local" value="group__multiset.html#g014e03d131a3d24d1d52465fd0f63a2f"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="list"><param name="ImageNumber" value="1"></OBJECT>
       <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="list_malloc"><param name="Local" value="group__multiset.html#g835886d7e2108ff01e9123261b28eb1e"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Data Structures"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="list"><param name="Local" value="structlist.html"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="elements"><param name="Local" value="structlist.html#aed325b1d7a1acd893dac35006a10ab2c"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="size"><param name="Local" value="structlist.html#a3b03adad0c0429bae9493667ff366dc2"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="back"><param name="Local" value="structlist.html#a66cb2432b3119e08ea9d4e8894888e78"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="current"><param name="Local" value="structlist.html#a1a1cb0ab62efe6895ec181d4ad9ca047"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="current_p1"><param name="Local" value="structlist.html#abd7376537b236a2681c22a6628a6d704"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="current_p2"><param name="Local" value="structlist.html#a72f124431873b5f1f0b7fad24aa788c6"><param name="ImageNumber" value="11"></OBJECT>
       </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="assure"><param name="Local" value="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="list_new"><param name="Local" value="group__multiset.html#ga9b9a23d98f58af888b2d2d3072f8b999"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="list_duplicate"><param name="Local" value="group__multiset.html#gac2d7ea2bf8ee3637bc9167916e637f30"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="list_extract"><param name="Local" value="group__multiset.html#gaf355fe5f4ce5910b419c80ae14bf5199"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="list_malloc"><param name="Local" value="group__multiset.html#ga4d27e95761e1b21498ad7653acc80d35"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="MOS data reduction library"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="READY"><param name="Local" value="group__moses.html#gd6f52daf658d36dcfdd4bddf72153b57"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__moses.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_global_distortion"><param name="Local" value="group__moses.html#gdf9210c07ebddae07a3e5e99d88d2f5c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_build_slit_location"><param name="Local" value="group__moses.html#g39dd696d6572e52031e12b1a53e505c2"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_build_curv_coeff"><param name="Local" value="group__moses.html#ga010593249434f0bb667af2f2c950951"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_build_disp_coeff"><param name="Local" value="group__moses.html#gc4a3f1981baef15668137f04c04cf710"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_subtract_sky"><param name="Local" value="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_normalise_flat"><param name="Local" value="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_normalise_longflat"><param name="Local" value="group__moses.html#g9c5947c76fc1246f203a1c6ebc6c9569"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_interpolate_wavecalib_slit"><param name="Local" value="group__moses.html#ga06affb6c77aac402204d1065f1de8ea"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_interpolate_wavecalib"><param name="Local" value="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_remove_bias"><param name="Local" value="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_arc_background_1D"><param name="Local" value="group__moses.html#g8dd9103f12a5e6275cd03c3f2afee77a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_arc_background"><param name="Local" value="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_lines_width"><param name="Local" value="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_peak_candidates"><param name="Local" value="group__moses.html#g417edefcade103f40ba21dd3f9c29af1"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_refine_peaks"><param name="Local" value="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_identify_peaks"><param name="Local" value="group__moses.html#g43123c837803fd95b01ba2870522ebaf"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_eval_dds"><param name="Local" value="group__moses.html#g99c7290af152957144e8c0413355e5dd"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_poly_wav2pix"><param name="Local" value="group__moses.html#g0c895cc2e971156231313f7a16eb6212"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_poly_pix2wav"><param name="Local" value="group__moses.html#g2d49af6d6595dda815a2475dd6de449a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_find_peaks"><param name="Local" value="group__moses.html#g84eceb2b87667085a8215974f0a52446"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_wavelength_calibration_raw"><param name="Local" value="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_locate_spectra"><param name="Local" value="group__moses.html#g884857a604857727d2fc0d293b678209"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_validate_slits"><param name="Local" value="group__moses.html#g0a1742caa67a002bee7a30f9d5289672"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_rotate_slits"><param name="Local" value="group__moses.html#ge119e728dd0161fc46fea905861425c1"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_identify_slits"><param name="Local" value="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_trace_flat"><param name="Local" value="group__moses.html#g168f6aecd869c24634fa9f6690da0b02"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_poly_trace"><param name="Local" value="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_global_trace"><param name="Local" value="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_spatial_calibration"><param name="Local" value="group__moses.html#g97cde563aea50318b61faf6c9355bdbe"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_wavelength_calibration_final"><param name="Local" value="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_wavelength_calibration"><param name="Local" value="group__moses.html#gb2cc63c200bab0a922efde3d20192443"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_wavelength_align"><param name="Local" value="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_wavelength_align_lss"><param name="Local" value="group__moses.html#g2523d130beaf8538187729f767c38805"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_distortions_rms"><param name="Local" value="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_map_pixel"><param name="Local" value="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_map_idscoeff"><param name="Local" value="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_map_wavelengths"><param name="Local" value="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_map_spectrum"><param name="Local" value="group__moses.html#g2940e2350a3c050fc3bff7af0e621c37"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_sky_map_super"><param name="Local" value="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_sky_map"><param name="Local" value="group__moses.html#g21b37cf8c1fd568441a55740d34e2371"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_sky_local_old"><param name="Local" value="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_sky_local"><param name="Local" value="group__moses.html#g7cb83f67ed6d349ade9e38e7ed62f6fb"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_clean_cosmics"><param name="Local" value="group__moses.html#g274cdc673e0d1684d9a730773a526115"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_spatial_map"><param name="Local" value="group__moses.html#ge8df117eba59d1599f3172975b6f7139"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_detect_objects"><param name="Local" value="group__moses.html#gb188299284e0b06070798cd2e80427af"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_extract_objects"><param name="Local" value="group__moses.html#geecf611c458a0b9645edad66538ad6e2"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_spectral_resolution"><param name="Local" value="group__moses.html#g9dab2e2448ef188d7f8fddd02483d919"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_resolution_table"><param name="Local" value="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_integrate_signal"><param name="Local" value="group__moses.html#g51c4d941feada9601c3e391058f4e653"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_slits_fors_mxu"><param name="Local" value="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_slits_fors_mos"><param name="Local" value="group__moses.html#g1786e7d23b46b135a98deb03986916a4"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_slits_fors_lss"><param name="Local" value="group__moses.html#g9ed25f68a53a8daa15d3c986e7bdfa48"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_get_gain_vimos"><param name="Local" value="group__moses.html#g75c3cb900989bb07dad294dd545021a6"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_slits_vimos"><param name="Local" value="group__moses.html#g3431a4557418ee0f8cd9beefd7153a98"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_check_multiplex"><param name="Local" value="group__moses.html#gf2c5b165c7c2c4be802c03ae59d1b8a9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_overscans_vimos"><param name="Local" value="group__moses.html#gde22c6582532e051c045baf0ee969e79"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_randomise_image"><param name="Local" value="group__moses.html#g7557973371ca804e0fab92c40b833f3c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_refmask_find_gaps"><param name="Local" value="group__moses.html#gaabac93f2fab16b6c268e5ab494a7238"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_saturation_process"><param name="Local" value="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_subtract_background"><param name="Local" value="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_object_intersect"><param name="Local" value="group__moses.html#g621083edda685c07a318aa94f53bce6f"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_get_maxobjs_per_slit"><param name="Local" value="group__moses.html#g5a6b95084aacc3fbd59249b53912f048"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_get_nobjects"><param name="Local" value="group__moses.html#g7a41fa707f51ab0d55150ed8c4b19657"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_check_slits"><param name="Local" value="group__moses.html#g5ec455544df7dfc83da8fefc91a9afc7"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_slits_fors_pmos"><param name="Local" value="group__moses.html#g5bc87e2a7c15dd1686e02e2d65e057f5"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_photometric_calibration"><param name="Local" value="group__moses.html#gf3dd5a20a5f31b853c53ca419a8171e3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_ksigma_stack"><param name="Local" value="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_apply_photometry"><param name="Local" value="group__moses.html#gd97e4b6ea81acb77e5ef8567a376482b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_propagate_photometry_error"><param name="Local" value="group__moses.html#ge20fadc56d3b4506d4ffd3015f394695"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_check_polarisation"><param name="Local" value="group__moses.html#gd170543de1ad9f6f2e4f1167e3f4ef4e"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_compute_offset"><param name="Local" value="group__moses.html#ge59e20e2bea761316fa1395d5d406965"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_image_shift"><param name="Local" value="group__moses.html#gf708c4804f0aa98415025f2f7ed31f11"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_slit_closest_to_center"><param name="Local" value="group__moses.html#gc32b3fba956da20bd20530372b1b28d1"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_extract_flux"><param name="Local" value="group__moses.html#gbff2b46bad7584f819ae28fdd8c85343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_extract_flux_mapped"><param name="Local" value="group__moses.html#ga8abda7d8ad43a4c3287b7b9071f5094"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_median_in_slit"><param name="Local" value="group__moses.html#g8395eca2d64406c969f48220024e999b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_image_filter_median"><param name="Local" value="group__moses.html#g4fe5f2fe3227522421783758228cdc39"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="READY"><param name="Local" value="group__moses.html#gad1235d5ce36f7267285e82dccd428aa6"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_global_distortion"><param name="Local" value="group__moses.html#gab847fe615b7510fc2d189e80cf5029b5"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_build_slit_location"><param name="Local" value="group__moses.html#gad9b2789388ba6564011d832d276b2ae6"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_build_curv_coeff"><param name="Local" value="group__moses.html#gacff89218baba1abf3641c083a1125861"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_build_disp_coeff"><param name="Local" value="group__moses.html#ga4e4da9890ad8d0229f187b4d7eda17be"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_subtract_sky"><param name="Local" value="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_normalise_flat"><param name="Local" value="group__moses.html#ga6b94ed200f4b1b8e281417a80b9aa4b5"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_normalise_longflat"><param name="Local" value="group__moses.html#ga2efbe02c8b5535d746bc9dd9ece30296"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_interpolate_wavecalib_slit"><param name="Local" value="group__moses.html#gae5258889aa86b437e2531cdad02f4159"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_interpolate_wavecalib"><param name="Local" value="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_remove_bias"><param name="Local" value="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_arc_background_1D"><param name="Local" value="group__moses.html#gafeaa9b762d7da8437fef7f5f579c04ba"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_arc_background"><param name="Local" value="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_lines_width"><param name="Local" value="group__moses.html#ga28871a4ecc1e2779022f06d4da892360"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_peak_candidates"><param name="Local" value="group__moses.html#gad80729870e3acf9f61c820f488eb83b2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_refine_peaks"><param name="Local" value="group__moses.html#gacfa971d995aac0c8f05c37499861d191"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_identify_peaks"><param name="Local" value="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_eval_dds"><param name="Local" value="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_poly_wav2pix"><param name="Local" value="group__moses.html#ga4d584e69389518aab8d6932e5841d399"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_poly_pix2wav"><param name="Local" value="group__moses.html#ga8d5305df3cb184677081fb285cba6eb5"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_find_peaks"><param name="Local" value="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_wavelength_calibration_raw"><param name="Local" value="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_locate_spectra"><param name="Local" value="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_validate_slits"><param name="Local" value="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_rotate_slits"><param name="Local" value="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_identify_slits"><param name="Local" value="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_trace_flat"><param name="Local" value="group__moses.html#gaad02c30291fd30d07156ac8f397f439f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_poly_trace"><param name="Local" value="group__moses.html#ga7518d66581d93ab64704fcf90996296b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_global_trace"><param name="Local" value="group__moses.html#ga0eda8a5abf396113ffbe66607fd72fe6"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_spatial_calibration"><param name="Local" value="group__moses.html#ga6910eeaa28338a6d447e74130666fe13"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_wavelength_calibration_final"><param name="Local" value="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_wavelength_calibration"><param name="Local" value="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_wavelength_align"><param name="Local" value="group__moses.html#ga634eb7408671a139e7015185776f4513"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_wavelength_align_lss"><param name="Local" value="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_distortions_rms"><param name="Local" value="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_map_pixel"><param name="Local" value="group__moses.html#ga6187454ef3812203ba2d50d1e2d01326"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_map_idscoeff"><param name="Local" value="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_map_wavelengths"><param name="Local" value="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_map_spectrum"><param name="Local" value="group__moses.html#ga8525f2b52eb7ba887858420f36c53471"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_sky_map_super"><param name="Local" value="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_sky_map"><param name="Local" value="group__moses.html#gab724daebffef27587b8183a6d765dc02"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_sky_local_old"><param name="Local" value="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_sky_local"><param name="Local" value="group__moses.html#ga40e43aa1516aac5fc7e2ccc41381677d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_clean_cosmics"><param name="Local" value="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_spatial_map"><param name="Local" value="group__moses.html#ga4592493a392e23ebc56259ed3bfc0719"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_detect_objects"><param name="Local" value="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_extract_objects"><param name="Local" value="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_spectral_resolution"><param name="Local" value="group__moses.html#ga58039ea48fa183baf1701567781ad128"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_resolution_table"><param name="Local" value="group__moses.html#gae9f633b64e1880984c084a19f53047fc"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_integrate_signal"><param name="Local" value="group__moses.html#gaba740d24473d57d687f75787e4ecc835"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_slits_fors_mxu"><param name="Local" value="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_slits_fors_mos"><param name="Local" value="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_slits_fors_lss"><param name="Local" value="group__moses.html#ga43072c6a57d094a5d7d341934a096e80"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_get_gain_vimos"><param name="Local" value="group__moses.html#ga74be15e9eea7e1a4f025be22ccb12c54"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_slits_vimos"><param name="Local" value="group__moses.html#ga3946bc30280b3b041a20ae9c9326f827"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_check_multiplex"><param name="Local" value="group__moses.html#ga332b9bfd8e704446ad24d9fa448f9df2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_overscans_vimos"><param name="Local" value="group__moses.html#gaf4872d8e8654dd8733369c071843e464"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_randomise_image"><param name="Local" value="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_refmask_find_gaps"><param name="Local" value="group__moses.html#gae623b8129e3fd33516f32d866c5106a8"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_saturation_process"><param name="Local" value="group__moses.html#ga854ead782f62a6929aade44b267353e0"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_subtract_background"><param name="Local" value="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_object_intersect"><param name="Local" value="group__moses.html#ga5f9947ec541f1291f7c9fb20bd081280"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_get_maxobjs_per_slit"><param name="Local" value="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_get_nobjects"><param name="Local" value="group__moses.html#gaf4d5e8a0d6cd0356ab38f0b7be241352"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_check_slits"><param name="Local" value="group__moses.html#ga71e13921907ec2f25478957d35318e7f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_load_slits_fors_pmos"><param name="Local" value="group__moses.html#ga78aebb1592ccefba83f9b7cbb80a9676"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_photometric_calibration"><param name="Local" value="group__moses.html#gaad62d9ba866b8abafb2da02053584bf2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_ksigma_stack"><param name="Local" value="group__moses.html#ga663cfcd4584b6a3e63e7593cba926688"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_apply_photometry"><param name="Local" value="group__moses.html#ga2244278b632992a44067afcc42530954"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_propagate_photometry_error"><param name="Local" value="group__moses.html#gae8e4a9d1a1146de7ba72dd148848342d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_check_polarisation"><param name="Local" value="group__moses.html#gae97d35cc8cb29cbb0b43d4fc84e4d34b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_compute_offset"><param name="Local" value="group__moses.html#gac442710556a5013dedd29befac482c9d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_image_shift"><param name="Local" value="group__moses.html#ga82c7c158316d8aba35ffa271b44510c6"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_slit_closest_to_center"><param name="Local" value="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_extract_flux"><param name="Local" value="group__moses.html#ga5291b43599e8dec884137f867fe72bfd"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_extract_flux_mapped"><param name="Local" value="group__moses.html#gaf91a99846ae06aa780b59deced1fa215"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_median_in_slit"><param name="Local" value="group__moses.html#gac6224c743943d88920b1e93f7394d009"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="mos_image_filter_median"><param name="Local" value="group__moses.html#ga1f574f5f45840ea69fa03eb26055a1b1"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Basic library test"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_version"><param name="Local" value="group__fors__test.html#g42fa16bf6366aa153d18ccc091115217"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_version"><param name="Local" value="group__fors__test.html#gaa0b61563ef767d8d2276e7ffe0b14f5e"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="test of master bias recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__bias__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_bias"><param name="Local" value="group__fors__bias__test.html#ga56ca9e6f3e38b35931c68ecb147b1f75"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__bias__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="test of master dark recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__dark__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_dark"><param name="Local" value="group__fors__dark__test.html#ga6b1c753a8c15cc5119ef13fda435ecbf"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__dark__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="identify unit tests"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__identify__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_identify"><param name="Local" value="group__fors__identify__test.html#ga9d562f61b66fedca2d53604fa93c8328"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__identify__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Test of image module"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__image__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_image"><param name="Local" value="group__fors__image__test.html#ga8e2e648513e2b6ee3843dd026130d7a2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_median_filter"><param name="Local" value="group__fors__image__test.html#ga3fb4147d1739891fdc6ae6132e87d0bd"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_subtract"><param name="Local" value="group__fors__image__test.html#ga460806546207179c6e136d31bdb922d5"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_exponential"><param name="Local" value="group__fors__image__test.html#ga69074b617f26911b58cda3a0fa13c918"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_divide"><param name="Local" value="group__fors__image__test.html#ga0383c55336d7d782ab9f4fc614f9b0e0"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__image__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="science recipe tests"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__science__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_img_science"><param name="Local" value="group__fors__img__science__test.html#ga64116c898e3e40a355dad7fec89f65a8"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__img__science__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="test of screen flat recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__screen__flat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_img_screen_flat"><param name="Local" value="group__fors__img__screen__flat__test.html#gaa7f97a660fe457c4a77d4269200b6162"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__img__screen__flat__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="test of sky flat recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__sky__flat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_img_sky_flat"><param name="Local" value="group__fors__img__sky__flat__test.html#ga885513ffa26feb33dd89087279376767"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__img__sky__flat__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pattern unit tests"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_pattern"><param name="Local" value="group__fors__pattern__test.html#ga05781d2ba3b01b5ddbc4dd9dfe0eda77"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__pattern__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point unit tests"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__point__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_photometry"><param name="Local" value="group__fors__point__test.html#gad87df141a27d7e06e22c0e912ae029e6"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__point__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_point"><param name="Local" value="group__fors__point__test.html#ga2c261e462483c35aa06be9ac1ff0d683"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="QC test"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_qc"><param name="Local" value="group__fors__qc__test.html#gabf987906c0b52a3ada25d6c611845f5c"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__qc__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Instrument setting"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__setting__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_setting"><param name="Local" value="group__fors__setting__test.html#gafa8c7ae8a3758428e457eb26c91c0da7"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__setting__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Test image stacking"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__stack__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_stack"><param name="Local" value="group__fors__stack__test.html#gafae5d1fcc553808ac2e0c37908648cac"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__stack__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Star tests"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__star__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__star__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Standard star catalogue tests"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__std__cat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_new"><param name="Local" value="group__fors__std__cat__test.html#ga47ae58a634c68c2d37cf5f90ac247fa5"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__std__cat__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="zeropoint recipe tests"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__zeropoint__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_zeropoint"><param name="Local" value="group__fors__zeropoint__test.html#ga593b93a1917f63d7660af1ea61da6f94"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__fors__zeropoint__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="List unit test"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__list__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Unit test infrastructure"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="_test"><param name="Local" value="group__test.html#gf80c8e8f1596284c4a41600a7d381e92"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_macro"><param name="Local" value="group__test.html#gab4f8f05aaa5e3f196c6353866f94981"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_eq_macro"><param name="Local" value="group__test.html#g1da2e46a3658d3b80d1060ab04747507"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_eq_string_macro"><param name="Local" value="group__test.html#g9c58a98a4f063f11ac233b3e11228485"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_abs_macro"><param name="Local" value="group__test.html#gfdcc2d4527a4292dffdb89df2e25e3a5"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_rel_macro"><param name="Local" value="group__test.html#g179ca9b6adab6c5e9c1b4259f08c16d7"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_init_macro"><param name="Local" value="group__test.html#gdf5b021e357a2554f044454d0b886ec6"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_end_macro"><param name="Local" value="group__test.html#ga03e8561e85f5310576a5bf2ca4ffd63"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_recipe_output"><param name="Local" value="group__test.html#ge4730f9510e545e738aef9c8b7459b8b"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_nfail"><param name="Local" value="group__test.html#g8bf3870fd210f34561f4f3f6010370a4"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_test"><param name="Local" value="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_macro"><param name="Local" value="group__test.html#ga69c8e2113cda1f0384f518415c224aeb"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_eq_macro"><param name="Local" value="group__test.html#ga0b29bcb36a03d68f05034d446b93b060"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_eq_string_macro"><param name="Local" value="group__test.html#ga393dca2c7f94fd2f47722083cda8d369"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_abs_macro"><param name="Local" value="group__test.html#gae93f165e1b26c1b98e4ec9457a06714b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_rel_macro"><param name="Local" value="group__test.html#ga9cdeb6a0e44a5e2197eedce28865f000"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_init_macro"><param name="Local" value="group__test.html#gab73f634dbde2ec1403f0508d5c1d987b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_end_macro"><param name="Local" value="group__test.html#ga27e574128e77cc503295df8191f583e5"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_recipe_output"><param name="Local" value="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_nfail"><param name="Local" value="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Simulate data for unit testing"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="frame_new"><param name="Local" value="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="create_standard_keys"><param name="Local" value="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="create_bias"><param name="Local" value="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="create_dark"><param name="Local" value="group__test__simulate.html#gb54d8ef52e4f8e0407e522565b8919f6"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="create_screen_flat"><param name="Local" value="group__test__simulate.html#g474967528c2d1de8ce4dadd24da817ce"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="create_sky_flat"><param name="Local" value="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="create_standard"><param name="Local" value="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="create_std_cat"><param name="Local" value="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="create_phot_table"><param name="Local" value="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="frame_new"><param name="Local" value="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_standard_keys"><param name="Local" value="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_bias"><param name="Local" value="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_dark"><param name="Local" value="group__test__simulate.html#gaebd36d5457a83612601155994a242dda"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_screen_flat"><param name="Local" value="group__test__simulate.html#ga5e5e21165c992a2062b3ca661e35fe9d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_sky_flat"><param name="Local" value="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_standard"><param name="Local" value="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_std_cat"><param name="Local" value="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_phot_table"><param name="Local" value="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe Recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_define_parameters"><param name="Local" value="group__fors__bias.html#g4a662bfaa15a38c6190fe7ba15ff1bf9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias"><param name="Local" value="group__fors__bias.html#g0eef24525a05bf717023a0380e5931b2"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_create"><param name="Local" value="group__fors__bias.html#g7eae9b8d1a50b0e1b4f13e652b2b2510"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_exec"><param name="Local" value="group__fors__bias.html#gf051ed22200bb5eafa1ce68561ff89ad"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_destroy"><param name="Local" value="group__fors__bias.html#gbac19e9fec13b72b6b5cf2f7bb5cf67c"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_description"><param name="Local" value="group__fors__bias.html#gc1284becbd1c69542318bd9d410756c0"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_define_parameters"><param name="Local" value="group__fors__bias.html#ga6573b8822e0f40fbc3872cd034e0b0f4"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias"><param name="Local" value="group__fors__bias.html#ga5d2a46e2354a60d3a45b2c63a665b781"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_create"><param name="Local" value="group__fors__bias.html#gaad1b25bcaa37dff1e986b001f8d37ba1"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_exec"><param name="Local" value="group__fors__bias.html#ga98c9fd3f30badaa1ae4d9ed954f34fcc"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_destroy"><param name="Local" value="group__fors__bias.html#ga1db6393658146917d5d8403fd1ed7654"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe Recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__dark.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_define_parameters"><param name="Local" value="group__fors__dark.html#g41900339775a0440158f71fab8e4fe73"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark"><param name="Local" value="group__fors__dark.html#g605a72777b8ade477948b511ec213dba"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__dark.html#g4abb403976fc3ddcaa614c59a44590c9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_create"><param name="Local" value="group__fors__dark.html#gd82957e2524a2c840c990e6f6ac7a3f7"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_exec"><param name="Local" value="group__fors__dark.html#gb03c103664e7d1ac06cf5819293024da"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_destroy"><param name="Local" value="group__fors__dark.html#g0ae3039ae17bbc8695285b04dab01340"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_description"><param name="Local" value="group__fors__dark.html#g6ca1a4a04494b527e073c4fcfc78d074"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_define_parameters"><param name="Local" value="group__fors__dark.html#ga288a7e1b685184b501b448ea67bdf493"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark"><param name="Local" value="group__fors__dark.html#ga5b25632b185b390afe047835ef04708c"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__dark.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_create"><param name="Local" value="group__fors__dark.html#gac68c5042f96db84bf22ca9d3c93f2015"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_exec"><param name="Local" value="group__fors__dark.html#gaff0761c9cc96530ee12377f1f014e069"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_destroy"><param name="Local" value="group__fors__dark.html#ga828322574faee993a595ecc93dfe5944"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe Recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__science.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__science.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__science.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="get_image_quality"><param name="Local" value="group__fors__img__science.html#g2d7fe71bb7c47e2284dea7e2732650fb"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_define_parameters"><param name="Local" value="group__fors__img__science.html#g9391a3b278d25edc38af3cb70db34597"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science"><param name="Local" value="group__fors__img__science.html#gc6a3f5a41cacfa91711e127f612fa064"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="is_star"><param name="Local" value="group__fors__img__science.html#gded70f366457b7e7915dc906a4d50a45"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__img__science.html#g4abb403976fc3ddcaa614c59a44590c9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_create"><param name="Local" value="group__fors__img__science.html#g8f20063c6ace32082add0a55898badd5"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_exec"><param name="Local" value="group__fors__img__science.html#g346ce5737ecd8c688f1f9cd39eda56db"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_destroy"><param name="Local" value="group__fors__img__science.html#g034dd2408c1d19371c8f0da3f2ac0ea1"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_description"><param name="Local" value="group__fors__img__science.html#g74ec08d9ca0bb98b7d31fc7609531e90"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="get_image_quality"><param name="Local" value="group__fors__img__science.html#ga11315f8dbe7bcd79d1f4e7ad691532fe"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_define_parameters"><param name="Local" value="group__fors__img__science.html#ga2a18bf8b29e61bb854f3290fba50bdfd"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science"><param name="Local" value="group__fors__img__science.html#ga6f762068474a2723fd2c17f01b4a82c1"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="is_star"><param name="Local" value="group__fors__img__science.html#ga52377e795ce68f7de7da06f753b01efc"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__img__science.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_create"><param name="Local" value="group__fors__img__science.html#ga966196c928f588d03aa1a17a486781aa"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_exec"><param name="Local" value="group__fors__img__science.html#ga375da6eaae762d1ee8a202bb62514ad2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_destroy"><param name="Local" value="group__fors__img__science.html#gad9737c625ab9465c8a504a25e67d8a03"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe Recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__screen__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__screen__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__screen__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__screen__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="remove_large_scale"><param name="Local" value="group__fors__img__screen__flat.html#g75a60ee291780e6bbaeeb68313c112f0"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="remove_large_scale_fit"><param name="Local" value="group__fors__img__screen__flat.html#g34064d266d0016050844a2e2c9e1a59c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="write_qc"><param name="Local" value="group__fors__img__screen__flat.html#gff8fa4d76051acfba7263b22a5bc06c3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_define_parameters"><param name="Local" value="group__fors__img__screen__flat.html#g8bd60f1e1c99dff8aa58da8d21eeeb02"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat"><param name="Local" value="group__fors__img__screen__flat.html#g6ada02347c7648aaa61ce6bc000910e5"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__img__screen__flat.html#g4abb403976fc3ddcaa614c59a44590c9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_create"><param name="Local" value="group__fors__img__screen__flat.html#g4f7674508424db7a7b62d5a8772bb3cc"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_exec"><param name="Local" value="group__fors__img__screen__flat.html#gcdfb37251e245fe82da375ba0725a3cb"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_destroy"><param name="Local" value="group__fors__img__screen__flat.html#g4ee16c004f65246f0c474d1c4f5516a8"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_description_short"><param name="Local" value="group__fors__img__screen__flat.html#gc5ff969a1df38b9da80ab308f823132d"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_description"><param name="Local" value="group__fors__img__screen__flat.html#g584ddcde63f204f4110497cab0e49075"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="remove_large_scale"><param name="Local" value="group__fors__img__screen__flat.html#gabe250dfa6d750ed0de8e583c614a7dae"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="remove_large_scale_fit"><param name="Local" value="group__fors__img__screen__flat.html#ga28678e6bba93d507e39ef08578423528"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="write_qc"><param name="Local" value="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_define_parameters"><param name="Local" value="group__fors__img__screen__flat.html#ga19e0710196db92a992d5c1502c35a5f0"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat"><param name="Local" value="group__fors__img__screen__flat.html#gad6f0f603eedc00271082e6dae9dbd2a6"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__img__screen__flat.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_create"><param name="Local" value="group__fors__img__screen__flat.html#gaaf1392d5e4fd8d016322a38b2bc1131a"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_exec"><param name="Local" value="group__fors__img__screen__flat.html#ga4a8a4add6fd2c7f1300789425e079bce"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_destroy"><param name="Local" value="group__fors__img__screen__flat.html#ga0867be809872f262200c7562c3eb0cee"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe Recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__img__sky__flat.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_define_parameters"><param name="Local" value="group__fors__img__sky__flat.html#gec7c64a6e66a6461f399baba1d71640c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat"><param name="Local" value="group__fors__img__sky__flat.html#g46d79972dcc1d750bb362f17bd454517"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__img__sky__flat.html#g4abb403976fc3ddcaa614c59a44590c9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_create"><param name="Local" value="group__fors__img__sky__flat.html#g2fd81ec014584d5e4812ceec9fced368"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_exec"><param name="Local" value="group__fors__img__sky__flat.html#g73801ec3f11f5acf82354dce429c7364"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_destroy"><param name="Local" value="group__fors__img__sky__flat.html#g41907dc5910fef4332bc850d202cdf0a"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_description"><param name="Local" value="group__fors__img__sky__flat.html#g6e7c504f168bc6f8319b544b066ceb85"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_define_parameters"><param name="Local" value="group__fors__img__sky__flat.html#ga61b98b9ade434fed2b939774f5c6c7eb"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat"><param name="Local" value="group__fors__img__sky__flat.html#ga6624d51caa8c203f494562b809cd9b9b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__img__sky__flat.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_create"><param name="Local" value="group__fors__img__sky__flat.html#ga02c59acaaf71d4b2e9b4df6e5a452695"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_exec"><param name="Local" value="group__fors__img__sky__flat.html#ga3cf0bca5c79ec81295fe4402b9580063"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_destroy"><param name="Local" value="group__fors__img__sky__flat.html#ga7182fc139ef9c00488f2df5e96be18b3"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe Recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__photometry.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="entry_new"><param name="Local" value="group__fors__photometry.html#gc4cfb3c0bdf31be44324adffdb6277a1"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="entry_delete"><param name="Local" value="group__fors__photometry.html#gff8105d58698d673632960edbd21f26c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="entry_delete_but_standard"><param name="Local" value="group__fors__photometry.html#g704bbcab4ba8418ff88419511eb5092b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="entry_list_print"><param name="Local" value="group__fors__photometry.html#g62dd2afbab9508f260ddcc65d8e00f80"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_read_input"><param name="Local" value="group__fors__photometry.html#gd9e3544d21c84d8a62c36b859b2a4bcf"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_read_input_listinsert_star_if_new"><param name="Local" value="group__fors__photometry.html#g99be8a6361832a8a2592304da84bc62b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_delete_star_lists"><param name="Local" value="group__fors__photometry.html#g27249fb4bf764484d9f553c100e2e2b8"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_fits_compare_string"><param name="Local" value="group__fors__photometry.html#gedafdf97c6e7c236d39fe16f9c459953"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_matrix_null"><param name="Local" value="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_define_parameters"><param name="Local" value="group__fors__photometry.html#gecc363f8be41aa6d224d6f604d5a6b30"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_define_polyf"><param name="Local" value="group__fors__photometry.html#ge8d0a82d52e920497d6a5efd435760c6"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_define_polyp"><param name="Local" value="group__fors__photometry.html#ga8ebd4e57d8df9c4fb26a5ea59d52182"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_poly_new_from_coefficients"><param name="Local" value="group__fors__photometry.html#ga9ee56261da033d2a3ff241a68569522"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_get_timezone_observer"><param name="Local" value="group__fors__photometry.html#g105a6893a27ad23d6ef02cc271f42c30"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_get_night_id"><param name="Local" value="group__fors__photometry.html#g294b0010ae795af85c28da476abadb18"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_atm_ext_create_index_by_identifier"><param name="Local" value="group__fors__photometry.html#g951ded14339fa018b98cbf21a332c7cf"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_atm_ext_create_indices"><param name="Local" value="group__fors__photometry.html#g1491e01ccadf9b6d6b85316dfffd7f86"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_atm_ext_print_index_by_framename"><param name="Local" value="group__fors__photometry.html#ga3a88672675c12a7d6f30f9e6cc1459a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_check_input_value"><param name="Local" value="group__fors__photometry.html#gfe5618566936c6f9809d639f9148ce4d"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_check_fitparam_atm_ext"><param name="Local" value="group__fors__photometry.html#g7a7ad98c36de98c254af8f74f436a347"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_remove_unnecessary"><param name="Local" value="group__fors__photometry.html#gb82262e58905a5f0d047cf607614aa6d"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_count_observations"><param name="Local" value="group__fors__photometry.html#gbb6ba893e672e51a2a83674b93fe4733"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="build_equations_lhs_matrix_from_parameters"><param name="Local" value="group__fors__photometry.html#gb269a10fede882f376f2e599965cebe4"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="build_equations_lhs_matrix_from_poly"><param name="Local" value="group__fors__photometry.html#g55817cb490a2517ef207f96a9cf51b8b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="build_equations_rhs_cov"><param name="Local" value="group__fors__photometry.html#ge2d3cb795a4f549322f1febff5596787"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry"><param name="Local" value="group__fors__photometry.html#g78298a3adaf4b775f4a48a21a2b475ba"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__photometry.html#g4abb403976fc3ddcaa614c59a44590c9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_create"><param name="Local" value="group__fors__photometry.html#g8caa3f3d513a15a26c0d6e55a17370e3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_exec"><param name="Local" value="group__fors__photometry.html#g71aac253b19e8883e79cfbce6b73076a"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_destroy"><param name="Local" value="group__fors__photometry.html#gad02467f38136c506fb860db14783156"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_description"><param name="Local" value="group__fors__photometry.html#g1e4c46bbe3d698da29ad2ca40f5c70cf"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Data Structures"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_fit_ncoeff_paropts"><param name="Local" value="structfors__fit__ncoeff__paropts.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="entry"><param name="Local" value="structentry.html"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_fit_ncoeff_paropts"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="no"><param name="Local" value="structfors__fit__ncoeff__paropts.html#ab76b332d6365e313b87b982ddd8d7e82"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="one"><param name="Local" value="structfors__fit__ncoeff__paropts.html#a08987910ff3a46771ef8be900227a160"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="perframe"><param name="Local" value="structfors__fit__ncoeff__paropts.html#aaff216c4aa211359f1ea111bd01914f8"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="pernight"><param name="Local" value="structfors__fit__ncoeff__paropts.html#afdf29f5482d381fad567846d0ecb1d23"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="entry"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="frame_index"><param name="Local" value="structentry.html#a1172414515f8a0f0c911c6b3836ddc8d"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="star_index"><param name="Local" value="structentry.html#a7cd70b41d3e63bdce7316482b08ed1e3"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="atm_ext_index"><param name="Local" value="structentry.html#a8cfc890cee6e0694b1983d7f295352a8"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="atm_ext_identifier"><param name="Local" value="structentry.html#a3de1b684b7ee37db4e7a31928b63996b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="airmass"><param name="Local" value="structentry.html#ac96f2f0efc7888f88c739a2f5827f601"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="gain"><param name="Local" value="structentry.html#a7b1797bb488330f2904878e6256956d7"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="exptime"><param name="Local" value="structentry.html#ab2ba20da0e2b07f5ad756ecbfa4f68a5"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="star"><param name="Local" value="structentry.html#a7160e3b4c104ece8465a3bc53055b79f"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+      <UL>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="entry_new"><param name="Local" value="group__fors__photometry.html#ga0a8c8c9ebad2d55ac56e61c820fa3f27"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="entry_delete"><param name="Local" value="group__fors__photometry.html#ga5a7208d2d524a7660f3e57e269b7305f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="entry_delete_but_standard"><param name="Local" value="group__fors__photometry.html#ga24e72dc7095e56d37033c584bd279f13"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="entry_list_print"><param name="Local" value="group__fors__photometry.html#gaf8c135834cc51bd767a6956346885958"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_read_input"><param name="Local" value="group__fors__photometry.html#gabe32026b38c8d511f76b7f1008941f71"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_read_input_listinsert_star_if_new"><param name="Local" value="group__fors__photometry.html#gabffbeb12c88498ed45e6115a1b529c07"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_delete_star_lists"><param name="Local" value="group__fors__photometry.html#ga2271cd483d1b8537a0513251799faaed"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_fits_compare_string"><param name="Local" value="group__fors__photometry.html#ga37834a5427d4d460953d5b818ea79ffa"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_matrix_null"><param name="Local" value="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_define_parameters"><param name="Local" value="group__fors__photometry.html#ga4b3a00d660ccc7d889875a00fb629be5"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_define_polyf"><param name="Local" value="group__fors__photometry.html#gaa9757bbaea210d70edf5874682ec6660"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_define_polyp"><param name="Local" value="group__fors__photometry.html#ga8d413c86621fd2b2e37b6174e935d082"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_poly_new_from_coefficients"><param name="Local" value="group__fors__photometry.html#ga07a5f25084d3a57c92743262a41e0366"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_get_timezone_observer"><param name="Local" value="group__fors__photometry.html#ga1ac67d0a2f318cd599a5be4a05a8b4b1"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_get_night_id"><param name="Local" value="group__fors__photometry.html#gaf800d130ebeddcf3e8a655cf0c305f47"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_atm_ext_create_index_by_identifier"><param name="Local" value="group__fors__photometry.html#gac8322b086764e1db46e5c9d72263a251"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_atm_ext_create_indices"><param name="Local" value="group__fors__photometry.html#gafecdbeccb909ad2d152a857cfd10c2c0"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_atm_ext_print_index_by_framename"><param name="Local" value="group__fors__photometry.html#gaadcf6d1ce33dbed7ae0cbd24d675562f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_check_input_value"><param name="Local" value="group__fors__photometry.html#ga104fe70d8a535ae244e71f6b16dcaf5d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_check_fitparam_atm_ext"><param name="Local" value="group__fors__photometry.html#ga750adc75acb9310f8dde5fb067a356e9"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_remove_unnecessary"><param name="Local" value="group__fors__photometry.html#ga6e8831942438a88bb3287ed491961ec1"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_count_observations"><param name="Local" value="group__fors__photometry.html#ga182915aa06bfd142318b3c9443a80e80"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="build_equations_lhs_matrix_from_parameters"><param name="Local" value="group__fors__photometry.html#gabfcabff5102d27ba7b09e4398e057762"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="build_equations_lhs_matrix_from_poly"><param name="Local" value="group__fors__photometry.html#ga43e3c1d13157092f683e6d4912cd71d2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="build_equations_rhs_cov"><param name="Local" value="group__fors__photometry.html#ga5e4afe6326f0bb9c748fed2286c8c835"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry"><param name="Local" value="group__fors__photometry.html#gae18d6d686eec800da9538ee3c533aed7"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__photometry.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_create"><param name="Local" value="group__fors__photometry.html#gaefb8747dfc072489e0c49686e235db79"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_exec"><param name="Local" value="group__fors__photometry.html#gaa3f56f38e97f7b8afe2cc18c5e9f3a6d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_destroy"><param name="Local" value="group__fors__photometry.html#gae31960fe5e90f545420ff2f50c33f0a4"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe Recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__recipe.html#g4abb403976fc3ddcaa614c59a44590c9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe_create"><param name="Local" value="group__fors__recipe.html#g9de4437d5a4d68fdd594724e002b8388"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe_exec"><param name="Local" value="group__fors__recipe.html#g2e82215d74913efed45e3dce601076aa"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe_destroy"><param name="Local" value="group__fors__recipe.html#g351e58c2312f291e40fc17e8d9e09982"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__recipe.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe_create"><param name="Local" value="group__fors__recipe.html#gaccb93c75d494370cf0262930557dc4e2"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe_exec"><param name="Local" value="group__fors__recipe.html#ga3a1716720583090ad664ae953d665d5b"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe_destroy"><param name="Local" value="group__fors__recipe.html#ga455905b384dd9b68150677beda6bcee1"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe Recipe"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Defines"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cleanup"><param name="Local" value="group__fors__zeropoint.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="get_zeropoint"><param name="Local" value="group__fors__zeropoint.html#gfd13851752bdf8327fb014e47c6bb104"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_astrometry"><param name="Local" value="group__fors__zeropoint.html#g3222d4735fe218be5da224f3a146580b"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_astrometry_get_wcs_shift_px"><param name="Local" value="group__fors__zeropoint.html#g5a8ae7f99786a3fdc7df6a07d90d905c"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_astrometry_shift_wcs_origin"><param name="Local" value="group__fors__zeropoint.html#gd1a70566b3bf818a95a6c3e2312d0710"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_astrometry_apply_unidentified_xy2radec"><param name="Local" value="group__fors__zeropoint.html#g2ea192495f55d98f1068cae2b1921cea"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_errorstate_dump_as_warning"><param name="Local" value="group__fors__zeropoint.html#g06887d7be84289a1ec9c7b7350e69412"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_define_parameters"><param name="Local" value="group__fors__zeropoint.html#gc2cbbec604bd9b8cabf9f83fe71037da"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint"><param name="Local" value="group__fors__zeropoint.html#gffa00ce29ad3796187cf1336e4fcbb61"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="zeropoint_inside"><param name="Local" value="group__fors__zeropoint.html#g5ce973af397768a6d73de2a88b0d2ab3"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__zeropoint.html#g4abb403976fc3ddcaa614c59a44590c9"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_create"><param name="Local" value="group__fors__zeropoint.html#gb81bff380e7ee1d22c3c6620620771bf"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_exec"><param name="Local" value="group__fors__zeropoint.html#g9aa95cb40ce84db79ab3006d51e7059d"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_destroy"><param name="Local" value="group__fors__zeropoint.html#g095db561f9e785a5a4114d97f4597baf"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Variables"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_description"><param name="Local" value="group__fors__zeropoint.html#g69cec4407efc0bcccde712800aaa577c"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="get_zeropoint"><param name="Local" value="group__fors__zeropoint.html#ga00f15117674050804680fcb40ed57945"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_astrometry"><param name="Local" value="group__fors__zeropoint.html#gac3585e0948fbad1f1e2046a01baaedb3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_astrometry_get_wcs_shift_px"><param name="Local" value="group__fors__zeropoint.html#ga34215908758f4269782d8c322f01b266"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_astrometry_shift_wcs_origin"><param name="Local" value="group__fors__zeropoint.html#gaff77420ce4f300b2f80d53ebf6130020"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_astrometry_apply_unidentified_xy2radec"><param name="Local" value="group__fors__zeropoint.html#ga2ec4f355c2423ad8517fd8eb6636f96f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_errorstate_dump_as_warning"><param name="Local" value="group__fors__zeropoint.html#ga0292c8d9272f7411e58f3581c8bdab0d"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_define_parameters"><param name="Local" value="group__fors__zeropoint.html#ga1fc8917da8d302964ad2d2dc6d0eff67"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint"><param name="Local" value="group__fors__zeropoint.html#ga6e4245b398bb089daaaed5ec204e0c4f"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="zeropoint_inside"><param name="Local" value="group__fors__zeropoint.html#ga0fca769fa4f247f3fff26ea6ebdd4429"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="cpl_plugin_get_info"><param name="Local" value="group__fors__zeropoint.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_create"><param name="Local" value="group__fors__zeropoint.html#ga61984b5bc62bd25dbff9e414a7db42e3"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_exec"><param name="Local" value="group__fors__zeropoint.html#ga606fac5ca2e3be91e2e65dbb943cdc66"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_destroy"><param name="Local" value="group__fors__zeropoint.html#ga77d581a8f85987937b006ba302ca4c7e"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Recipes_test"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="main"><param name="Local" value="group__recipes__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Vimos_calib_impl"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="Functions"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib_impl"><param name="Local" value="group__vimos__calib__impl.html#gf710e60eea27cfed978ef2989d9b2a33"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib_impl"><param name="Local" value="group__vimos__calib__impl.html#gaff1b7bb1f87357c0ae0d3bd62c12b096"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   <LI><OBJECT type="text/sitemap"><param name="Name" value="Vimos_science_impl"><param name="ImageNumber" value="1"></OBJECT>
     <UL>
@@ -851,304 +634,322 @@
   </UL>
 <LI><OBJECT type="text/sitemap"><param name="Name" value="Data Structures"><param name="ImageNumber" value="1"></OBJECT>
   <UL>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_extract_method"><param name="Local" value="struct__extract__method.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_cpl_wcs_"><param name="Local" value="struct__fors__cpl__wcs__.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_image"><param name="Local" value="struct__fors__image.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_FORS_PAF_"><param name="Local" value="struct__FORS__PAF__.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_FORS_PAF_RECORD_"><param name="Local" value="struct__FORS__PAF__RECORD__.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_pattern"><param name="Local" value="struct__fors__pattern.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_point"><param name="Local" value="struct__fors__point.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_setting"><param name="Local" value="struct__fors__setting.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_star"><param name="Local" value="struct__fors__star.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_std_star"><param name="Local" value="struct__fors__std__star.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_identify_method"><param name="Local" value="struct__identify__method.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="_stack_method"><param name="Local" value="struct__stack__method.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="band_jacobian"><param name="Local" value="structband__jacobian.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="entry"><param name="Local" value="structentry.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_sky_stats"><param name="Local" value="structfors__extract__sky__stats.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_filterlist"><param name="Local" value="structfors__filterlist.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_fit_ncoeff_paropts"><param name="Local" value="structfors__fit__ncoeff__paropts.html"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="list"><param name="Local" value="structlist.html"><param name="ImageNumber" value="11"></OBJECT>
-  </UL>
-<LI><OBJECT type="text/sitemap"><param name="Name" value="Data Fields"><param name="Local" value="functions.html"><param name="ImageNumber" value="11"></OBJECT>
-<LI><OBJECT type="text/sitemap"><param name="Name" value="File List"><param name="ImageNumber" value="1"></OBJECT>
-  <UL>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="create_phot.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="create_stetson.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_align_sky.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_align_sky_lss.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_impl.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_impl.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_calib.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_config.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_impl.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_impl.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_data.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_data.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_detect_objects.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_detect_spectra.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_detlin.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_double.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_double.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors/fors_extract.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="recipes/fors_extract.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_objects.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_slits.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_flat.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_flatfield.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_header.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_header.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_impl.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_impl.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_impl.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_impl.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_impl.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_impl.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_instrument.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_instrument.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_normalise_flat.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_paf.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_paf.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pattern-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pattern.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pattern.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pfits.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pfits.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_impl.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_impl.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pmos_calib.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pmos_extract.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pmos_science.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe_impl.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_remove_bias.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_resample.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_science.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_cat.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_cat.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_star-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_star.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_star.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_subtract_sky.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_subtract_sky_lss.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_sumflux.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_tools.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_tools.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_trace_flat.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_utils.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_utils.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_wave_calib.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_wave_calib_lss.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_impl.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_impl.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="list-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="list.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="list.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="list_void.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="montecarlo.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="moses.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="moses.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="recipes-test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="test.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="test.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="test_hough.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="test_simulate.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="test_simulate.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib_impl.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib_impl.h"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_science.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_science_impl.c"><param name="ImageNumber" value="11"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_science_impl.h"><param name="ImageNumber" value="11"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Name" value="Data Structures"><param name="ImageNumber" value="1"></OBJECT>
+    <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_extract_method"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="SEX"><param name="Local" value="struct__extract__method.html#a0c08efabb16395acf6dc57359ce2efdca8af9468116051486c500fd1f9bca5f16"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="TEST"><param name="Local" value="struct__extract__method.html#a0c08efabb16395acf6dc57359ce2efdca52b86675c6829bbd9db54deed976d6e3"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="method"><param name="Local" value="struct__extract__method.html#a6d3808d8f76ccba38a0b04b348f55071"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sex_exe"><param name="Local" value="struct__extract__method.html#aa51edfe17fbf90e81405a4d343d6211f"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sex_config"><param name="Local" value="struct__extract__method.html#a4b963442d71be80738b5994e97c75b36"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sex_mag"><param name="Local" value="struct__extract__method.html#a0cb0c99c37ef47b7569955e8f42adbf6"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sex_magerr"><param name="Local" value="struct__extract__method.html#a4ddadecb69b1867762accb298da7e7d7"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sex_radius"><param name="Local" value="struct__extract__method.html#a94aa696ea0cf75d5a40545f6ada13e43"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_cpl_wcs_"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="wcsptr"><param name="Local" value="struct__fors__cpl__wcs__.html#a76ffd1e0af7f1d000078931be71a845e"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="naxis"><param name="Local" value="struct__fors__cpl__wcs__.html#aa75d49f978e1ff975e9cb68f09c16c18"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dims"><param name="Local" value="struct__fors__cpl__wcs__.html#aec01adf7519d22a1fb59c61076057595"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_image"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="data"><param name="Local" value="struct__fors__image.html#a08eca6a1c5d5cfeb4af73b15c7985b3b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="variance"><param name="Local" value="struct__fors__image.html#a88979de9862cd29d904a4f1e616509a4"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_FORS_PAF_"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="name"><param name="Local" value="struct__FORS__PAF__.html#a8277746dbb0ef7626fbc103f763ebcf1"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="nh"><param name="Local" value="struct__FORS__PAF__.html#ae6e4dfc62b72ede7cc3eb94f9442567d"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="nr"><param name="Local" value="struct__FORS__PAF__.html#a819813f81b4540eff32231e77d9c52e9"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="header"><param name="Local" value="struct__FORS__PAF__.html#a7f44550c15b50560e761a07c8b78024d"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="records"><param name="Local" value="struct__FORS__PAF__.html#af406fb3edb547a0608a76c93b8b6f6c8"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_FORS_PAF_RECORD_"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="name"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a6d69378eba6870b6fa93c3a3cf63910d"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="comment"><param name="Local" value="struct__FORS__PAF__RECORD__.html#af69bb301a9df55477add23c6a2ad6240"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="type"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a3b157d712d46492bc176a06500980115"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="bval"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a9f6a3cbd6d225d887915e66b0332a602"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="ival"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a4b70add4f59db612cc76ea7d35d9f8f4"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dval"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a6be2b65d15141a111388a7225c833800"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="sval"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a5a7a61b02c5b01f9e3681ad2651e2ef2"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="data"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a85d0294d00b7c5b4205fadac85526328"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_pattern"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="ratsq"><param name="Local" value="struct__fors__pattern.html#aabea542697d213367713130b5e97aa9e"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dratsq"><param name="Local" value="struct__fors__pattern.html#a56e70f56aab145b915ebed443003b823"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="theta"><param name="Local" value="struct__fors__pattern.html#a0f355468abe462670457dc5f2dbfd63b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dtheta"><param name="Local" value="struct__fors__pattern.html#a26b52abfcc19a9488dee27e2921fd3cf"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="ref"><param name="Local" value="struct__fors__pattern.html#a45a7832dd782c60047ff9c16446882fe"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="min"><param name="Local" value="struct__fors__pattern.html#a2686acc25aa9720d0f18bd87371cf7de"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="max"><param name="Local" value="struct__fors__pattern.html#ad4c92aab333c6e87be1323ceaf3c03d8"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_point"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="x"><param name="Local" value="struct__fors__point.html#a7d087815e7403a962b86bb10ada4421d"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="y"><param name="Local" value="struct__fors__point.html#a33a8f245d63d8ae71d43239315076350"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_setting"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="binx"><param name="Local" value="struct__fors__setting.html#a04188f2c5738d1f6092a7a578f8229f5"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="biny"><param name="Local" value="struct__fors__setting.html#a19b3bfb18d923d08670897a7112ae7d0"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="prescan_x"><param name="Local" value="struct__fors__setting.html#afa4b9f6616d7219b907a39644c30d86e"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="prescan_y"><param name="Local" value="struct__fors__setting.html#a460677f3aa1cb2bbccbaf5508a29fad5"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="filterband"><param name="Local" value="struct__fors__setting.html#a6019c0c5914b4a9f6c620f98a84c5dc3"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="filter_name"><param name="Local" value="struct__fors__setting.html#a864b35bebb983c86c7c81581601638e2"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="exposure_time"><param name="Local" value="struct__fors__setting.html#ab1ad3713ba9b86216cea5aa225500c69"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="average_gain"><param name="Local" value="struct__fors__setting.html#ab3110a9852713777090e0031eb4cf057"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="ron"><param name="Local" value="struct__fors__setting.html#ae9590b2375ae5ca7ae94801da9ad76fd"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="pixel_scale"><param name="Local" value="struct__fors__setting.html#ae59b404fa0dba639061578c018d065c3"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="read_clock"><param name="Local" value="struct__fors__setting.html#a34aa5b8ca5d983d3331a702eb2252540"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="chip_id"><param name="Local" value="struct__fors__setting.html#a15ba32ac8b198b9dd15338891d855349"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="instrument"><param name="Local" value="struct__fors__setting.html#ab38c5f7885683ddd1d1a7dc27fb2ba2b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="version"><param name="Local" value="struct__fors__setting.html#a2c3c730074609891796a3fb28138f425"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_star"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="pixel"><param name="Local" value="struct__fors__star.html#ae3f5db0d44371b78ea7b9a48d3959d59"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="semi_major"><param name="Local" value="struct__fors__star.html#a197ac0fb50916f94924f82b189a03ee3"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="semi_minor"><param name="Local" value="struct__fors__star.html#a4897b86d4c154c0764b80c1ddcab20e1"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="fwhm"><param name="Local" value="struct__fors__star.html#ab863d4543dc50ff8fd46622ded9c7200"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="stellarity_index"><param name="Local" value="struct__fors__star.html#a8dd06110ea67874e1272756d9f4d819c"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="orientation"><param name="Local" value="struct__fors__star.html#a92513c57462f561ade748dc83b98a126"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="magnitude"><param name="Local" value="struct__fors__star.html#ab84e2da9886ebd2a68c33fa69a7b55da"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dmagnitude"><param name="Local" value="struct__fors__star.html#a15ddd137fee3e1925e9722057366b29b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="magnitude_corr"><param name="Local" value="struct__fors__star.html#a67fbc8534a37685e633bf46d315a25cd"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dmagnitude_corr"><param name="Local" value="struct__fors__star.html#ad591125b3daa76904f0def386a7b361b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="weight"><param name="Local" value="struct__fors__star.html#a45e679977d24d14f293e0d881dada47a"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="id"><param name="Local" value="struct__fors__star.html#a8ea1d278cd06279fe37bf56238a9f6d8"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_fors_std_star"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="pixel"><param name="Local" value="struct__fors__std__star.html#aea102ea39ac9dabba780b1987f482a16"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="ra"><param name="Local" value="struct__fors__std__star.html#adbe20f51d01cd493bc9509c4a771f0aa"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dec"><param name="Local" value="struct__fors__std__star.html#a850580aa41a7d879eb83fd60d848feeb"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="magnitude"><param name="Local" value="struct__fors__std__star.html#afcf8a50010ad0c894c17b6fc6d0bd227"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dmagnitude"><param name="Local" value="struct__fors__std__star.html#a953ef25f539347013280e7c21d2920cd"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="cat_magnitude"><param name="Local" value="struct__fors__std__star.html#ae67a7a23ee09dd01326802d33bf65b08"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dcat_magnitude"><param name="Local" value="struct__fors__std__star.html#a44c1966a4b6b9e850e25ae7a361af35b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="color"><param name="Local" value="struct__fors__std__star.html#ae731ce7c8647ca73dce568c935ca8470"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="dcolor"><param name="Local" value="struct__fors__std__star.html#a76d13f45de0ac772c7d4fe1fda4cdf6c"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="cov_catm_color"><param name="Local" value="struct__fors__std__star.html#a579256e995dc04bd914d39d5aca89bc3"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="name"><param name="Local" value="struct__fors__std__star.html#ac5b93743c2acada36da7bc7a1813d49a"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="trusted"><param name="Local" value="struct__fors__std__star.html#aa289151fdd925b93c934f8435fd6311f"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_identify_method"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="ncat"><param name="Local" value="struct__identify__method.html#a98ec6209ab8334189fdeb0ba9ad6db62"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="nsource"><param name="Local" value="struct__identify__method.html#a42bd374120c9b0d6c6798af05c91551a"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="kappa"><param name="Local" value="struct__identify__method.html#a7c4345b693fd891d4f343eaddc34979e"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="search"><param name="Local" value="struct__identify__method.html#a751e9793a2bf184209201ec0403db027"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="max_search"><param name="Local" value="struct__identify__method.html#a9b637dbee7a14e588182802a46a33fc9"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="max_offset"><param name="Local" value="struct__identify__method.html#a54fd4d467ce3b51859fb581b23d384b4"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="_stack_method"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="AVERAGE"><param name="Local" value="struct__stack__method.html#aa4ea86d6dbea5b71f1706a87fcfc0044acac589add6742c9c48795ccfac73014b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="MEDIAN"><param name="Local" value="struct__stack__method.html#aa4ea86d6dbea5b71f1706a87fcfc0044aa13cb985542b891d11ca570ade4eca1c"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="MINMAX"><param name="Local" value="struct__stack__method.html#aa4ea86d6dbea5b71f1706a87fcfc0044a7235c27ebdcf40f3ce85be991de8f75d"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="KSIGMA"><param name="Local" value="struct__stack__method.html#aa4ea86d6dbea5b71f1706a87fcfc0044a2d36712602f46af4b774511373add6b1"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="method"><param name="Local" value="struct__stack__method.html#a1ef465157d5630ba9517e8ef2b41a9fe"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="method_name"><param name="Local" value="struct__stack__method.html#a1e2b6c25ab659ca91223e1553c9952b4"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="min_reject"><param name="Local" value="struct__stack__method.html#a41781c79dfb0a9a28eb0f9b306f482d6"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="max_reject"><param name="Local" value="struct__stack__method.html#a05d57589e3074dd61cbc6495a6fad01f"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="minmax"><param name="Local" value="struct__stack__method.html#a4548d1d8af0646a8557aeee11571fcfb"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="klow"><param name="Local" value="struct__stack__method.html#af3899c59161c6190e187c531643f6372"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="khigh"><param name="Local" value="struct__stack__method.html#a21f2b5affe3e2fa3de5738549c3778e1"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="kiter"><param name="Local" value="struct__stack__method.html#a746082dbcf9a1cddbefd92ecc24458b1"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="ksigma"><param name="Local" value="struct__stack__method.html#af798358089f888a51d2f25590f1ed78c"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="pars"><param name="Local" value="struct__stack__method.html#ae9a565dbc8376609af43fe07ed0f0213"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="band_jacobian"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="band"><param name="Local" value="structband__jacobian.html#ac3721fe3669edde3ff7375c79edb60b9"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="mag"><param name="Local" value="structband__jacobian.html#a5a22b2fe8df6300f3d1a2a596a019e70"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="col"><param name="Local" value="structband__jacobian.html#a459ddad4e01b8e99a0486f9b03d236ed"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="entry"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="frame_index"><param name="Local" value="structentry.html#a1172414515f8a0f0c911c6b3836ddc8d"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="star_index"><param name="Local" value="structentry.html#a7cd70b41d3e63bdce7316482b08ed1e3"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="atm_ext_index"><param name="Local" value="structentry.html#a8cfc890cee6e0694b1983d7f295352a8"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="atm_ext_identifier"><param name="Local" value="structentry.html#a3de1b684b7ee37db4e7a31928b63996b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="airmass"><param name="Local" value="structentry.html#ac96f2f0efc7888f88c739a2f5827f601"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="gain"><param name="Local" value="structentry.html#a7b1797bb488330f2904878e6256956d7"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="exptime"><param name="Local" value="structentry.html#ab2ba20da0e2b07f5ad756ecbfa4f68a5"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="star"><param name="Local" value="structentry.html#a7160e3b4c104ece8465a3bc53055b79f"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_sky_stats"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="mean"><param name="Local" value="structfors__extract__sky__stats.html#a34ef7014753f20e3313c0adc61970b9b"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="median"><param name="Local" value="structfors__extract__sky__stats.html#a4b573f007e8305120e3e204a2f0210da"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="rms"><param name="Local" value="structfors__extract__sky__stats.html#a89ab5c0e95ab5b986fb9fcf872479e2f"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_filterlist"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="name"><param name="Local" value="structfors__filterlist.html#a8e52775ad3bdf1e32a80fc71b5f2d766"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="band"><param name="Local" value="structfors__filterlist.html#a213a35009db999a6c4eb7c5b76f95ae7"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_fit_ncoeff_paropts"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="no"><param name="Local" value="structfors__fit__ncoeff__paropts.html#ab76b332d6365e313b87b982ddd8d7e82"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="one"><param name="Local" value="structfors__fit__ncoeff__paropts.html#a08987910ff3a46771ef8be900227a160"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="perframe"><param name="Local" value="structfors__fit__ncoeff__paropts.html#aaff216c4aa211359f1ea111bd01914f8"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="pernight"><param name="Local" value="structfors__fit__ncoeff__paropts.html#afdf29f5482d381fad567846d0ecb1d23"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="list"><param name="ImageNumber" value="1"></OBJECT>
+      <UL>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="elements"><param name="Local" value="structlist.html#aed325b1d7a1acd893dac35006a10ab2c"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="size"><param name="Local" value="structlist.html#a3b03adad0c0429bae9493667ff366dc2"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="back"><param name="Local" value="structlist.html#a66cb2432b3119e08ea9d4e8894888e78"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="current"><param name="Local" value="structlist.html#a1a1cb0ab62efe6895ec181d4ad9ca047"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="current_p1"><param name="Local" value="structlist.html#abd7376537b236a2681c22a6628a6d704"><param name="ImageNumber" value="11"></OBJECT>
+      <LI><OBJECT type="text/sitemap"><param name="Name" value="current_p2"><param name="Local" value="structlist.html#a72f124431873b5f1f0b7fad24aa788c6"><param name="ImageNumber" value="11"></OBJECT>
+      </UL>
+    </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Name" value="Data Structure Index"><param name="Local" value="classes.html"><param name="ImageNumber" value="11"></OBJECT>
   </UL>
-<LI><OBJECT type="text/sitemap"><param name="Name" value="Directories"><param name="ImageNumber" value="1"></OBJECT>
+<LI><OBJECT type="text/sitemap"><param name="Name" value="Files"><param name="ImageNumber" value="1"></OBJECT>
   <UL>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="fors"><param name="ImageNumber" value="1"></OBJECT>
-    <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="tests"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors-test.c"><param name="Local" value="fors-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias-test.c"><param name="Local" value="fors__bias-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs-test.c"><param name="Local" value="fors__cpl__wcs-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark-test.c"><param name="Local" value="fors__dark-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify-test.c"><param name="Local" value="fors__identify-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image-test.c"><param name="Local" value="fors__image-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science-test.c"><param name="Local" value="fors__img__science-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat-test.c"><param name="Local" value="fors__img__screen__flat-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat-test.c"><param name="Local" value="fors__img__sky__flat-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pattern-test.c"><param name="Local" value="fors__pattern-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry-test.c"><param name="Local" value="fors__photometry-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point-test.c"><param name="Local" value="fors__point-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc-test.c"><param name="Local" value="fors__qc-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting-test.c"><param name="Local" value="fors__setting-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack-test.c"><param name="Local" value="fors__stack-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star-test.c"><param name="Local" value="fors__star-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_star-test.c"><param name="Local" value="fors__std__star-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint-test.c"><param name="Local" value="fors__zeropoint-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="list-test.c"><param name="Local" value="list-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test.c"><param name="Local" value="test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test.h"><param name="Local" value="test_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_simulate.c"><param name="Local" value="test__simulate_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="test_simulate.h"><param name="Local" value="test__simulate_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_phot.c"><param name="Local" value="create__phot_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_stetson.c"><param name="Local" value="create__stetson_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_impl.c"><param name="Local" value="fors__bias__impl_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_impl.h"><param name="Local" value="fors__bias__impl_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs.c"><param name="Local" value="fors__cpl__wcs_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs.h"><param name="Local" value="fors__cpl__wcs_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_impl.c"><param name="Local" value="fors__dark__impl_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_impl.h"><param name="Local" value="fors__dark__impl_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_data.c"><param name="Local" value="fors__data_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_data.h"><param name="Local" value="fors__data_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs.c"><param name="Local" value="fors__dfs_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs.h"><param name="Local" value="fors__dfs_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_double.c"><param name="Local" value="fors__double_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_double.h"><param name="Local" value="fors__double_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors/fors_extract.c"><param name="Local" value="fors_2fors__extract_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract.h"><param name="Local" value="fors__extract_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_header.c"><param name="Local" value="fors__header_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_header.h"><param name="Local" value="fors__header_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify.c"><param name="Local" value="fors__identify_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify.h"><param name="Local" value="fors__identify_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image.c"><param name="Local" value="fors__image_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image.h"><param name="Local" value="fors__image_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_impl.c"><param name="Local" value="fors__img__science__impl_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_impl.h"><param name="Local" value="fors__img__science__impl_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_impl.c"><param name="Local" value="fors__img__screen__flat__impl_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_impl.h"><param name="Local" value="fors__img__screen__flat__impl_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_impl.c"><param name="Local" value="fors__img__sky__flat__impl_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_impl.h"><param name="Local" value="fors__img__sky__flat__impl_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_instrument.c"><param name="Local" value="fors__instrument_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_instrument.h"><param name="Local" value="fors__instrument_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_paf.c"><param name="Local" value="fors__paf_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_paf.h"><param name="Local" value="fors__paf_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pattern.c"><param name="Local" value="fors__pattern_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pattern.h"><param name="Local" value="fors__pattern_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pfits.c"><param name="Local" value="fors__pfits_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pfits.h"><param name="Local" value="fors__pfits_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_impl.c"><param name="Local" value="fors__photometry__impl_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_impl.h"><param name="Local" value="fors__photometry__impl_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point.c"><param name="Local" value="fors__point_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point.h"><param name="Local" value="fors__point_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial.c"><param name="Local" value="fors__polynomial_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial.h"><param name="Local" value="fors__polynomial_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc.c"><param name="Local" value="fors__qc_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc.h"><param name="Local" value="fors__qc_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe_impl.h"><param name="Local" value="fors__recipe__impl_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting.c"><param name="Local" value="fors__setting_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting.h"><param name="Local" value="fors__setting_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack.c"><param name="Local" value="fors__stack_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack.h"><param name="Local" value="fors__stack_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star.c"><param name="Local" value="fors__star_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star.h"><param name="Local" value="fors__star_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_cat.c"><param name="Local" value="fors__std__cat_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_cat.h"><param name="Local" value="fors__std__cat_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_star.c"><param name="Local" value="fors__std__star_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_star.h"><param name="Local" value="fors__std__star_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_tools.c"><param name="Local" value="fors__tools_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_tools.h"><param name="Local" value="fors__tools_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_utils.c"><param name="Local" value="fors__utils_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_utils.h"><param name="Local" value="fors__utils_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_impl.c"><param name="Local" value="fors__zeropoint__impl_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_impl.h"><param name="Local" value="fors__zeropoint__impl_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="list.c"><param name="Local" value="list_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="list.h"><param name="Local" value="list_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="list_void.h"><param name="Local" value="list__void_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="moses.c"><param name="Local" value="moses_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="moses.h"><param name="Local" value="moses_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib_impl.c"><param name="Local" value="vimos__calib__impl_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib_impl.h"><param name="Local" value="vimos__calib__impl_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_science_impl.c"><param name="Local" value="vimos__science__impl_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_science_impl.h"><param name="Local" value="vimos__science__impl_8h.html"><param name="ImageNumber" value="11"></OBJECT>
-    </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Name" value="recipes"><param name="ImageNumber" value="1"></OBJECT>
-    <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="tests"><param name="ImageNumber" value="1"></OBJECT>
-      <UL>
-      <LI><OBJECT type="text/sitemap"><param name="Name" value="recipes-test.c"><param name="Local" value="recipes-test_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-      </UL>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_align_sky.c"><param name="Local" value="fors__align__sky_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_align_sky_lss.c"><param name="Local" value="fors__align__sky__lss_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias.c"><param name="Local" value="fors__bias_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_calib.c"><param name="Local" value="fors__calib_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_config.c"><param name="Local" value="fors__config_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark.c"><param name="Local" value="fors__dark_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_detect_objects.c"><param name="Local" value="fors__detect__objects_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_detect_spectra.c"><param name="Local" value="fors__detect__spectra_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_detlin.c"><param name="Local" value="fors__detlin_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="recipes/fors_extract.c"><param name="Local" value="recipes_2fors__extract_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_objects.c"><param name="Local" value="fors__extract__objects_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_slits.c"><param name="Local" value="fors__extract__slits_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_flat.c"><param name="Local" value="fors__flat_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_flatfield.c"><param name="Local" value="fors__flatfield_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science.c"><param name="Local" value="fors__img__science_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat.c"><param name="Local" value="fors__img__screen__flat_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat.c"><param name="Local" value="fors__img__sky__flat_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_normalise_flat.c"><param name="Local" value="fors__normalise__flat_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry.c"><param name="Local" value="fors__photometry_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pmos_calib.c"><param name="Local" value="fors__pmos__calib_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pmos_extract.c"><param name="Local" value="fors__pmos__extract_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pmos_science.c"><param name="Local" value="fors__pmos__science_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe.c"><param name="Local" value="fors__recipe_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_remove_bias.c"><param name="Local" value="fors__remove__bias_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_resample.c"><param name="Local" value="fors__resample_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_science.c"><param name="Local" value="fors__science_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_subtract_sky.c"><param name="Local" value="fors__subtract__sky_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_subtract_sky_lss.c"><param name="Local" value="fors__subtract__sky__lss_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_sumflux.c"><param name="Local" value="fors__sumflux_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_trace_flat.c"><param name="Local" value="fors__trace__flat_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_wave_calib.c"><param name="Local" value="fors__wave__calib_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_wave_calib_lss.c"><param name="Local" value="fors__wave__calib__lss_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint.c"><param name="Local" value="fors__zeropoint_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="montecarlo.c"><param name="Local" value="montecarlo_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_hough.c"><param name="Local" value="test__hough_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib.c"><param name="Local" value="vimos__calib_8c.html"><param name="ImageNumber" value="11"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_science.c"><param name="Local" value="vimos__science_8c.html"><param name="ImageNumber" value="11"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Name" value="File List"><param name="ImageNumber" value="1"></OBJECT>
+    <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_phot.c"><param name="Local" value="create__phot_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="create_stetson.c"><param name="Local" value="create__stetson_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors-test.c"><param name="Local" value="fors-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_align_sky.c"><param name="Local" value="fors__align__sky_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_align_sky_lss.c"><param name="Local" value="fors__align__sky__lss_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias-test.c"><param name="Local" value="fors__bias-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias.c"><param name="Local" value="fors__bias_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_impl.c"><param name="Local" value="fors__bias__impl_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_bias_impl.h"><param name="Local" value="fors__bias__impl_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_config.c"><param name="Local" value="fors__config_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs-test.c"><param name="Local" value="fors__cpl__wcs-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs.c"><param name="Local" value="fors__cpl__wcs_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_cpl_wcs.h"><param name="Local" value="fors__cpl__wcs_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark-test.c"><param name="Local" value="fors__dark-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark.c"><param name="Local" value="fors__dark_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_impl.c"><param name="Local" value="fors__dark__impl_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dark_impl.h"><param name="Local" value="fors__dark__impl_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_data.c"><param name="Local" value="fors__data_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_data.h"><param name="Local" value="fors__data_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_detect_objects.c"><param name="Local" value="fors__detect__objects_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_detect_spectra.c"><param name="Local" value="fors__detect__spectra_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_detected_slits.h"><param name="Local" value="fors__detected__slits_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_detlin.c"><param name="Local" value="fors__detlin_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs.c"><param name="Local" value="fors__dfs_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_dfs.h"><param name="Local" value="fors__dfs_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_double.c"><param name="Local" value="fors__double_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_double.h"><param name="Local" value="fors__double_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors/fors_extract.c"><param name="Local" value="fors_2fors__extract_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="recipes/fors_extract.c"><param name="Local" value="recipes_2fors__extract_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract.h"><param name="Local" value="fors__extract_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_objects.c"><param name="Local" value="fors__extract__objects_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_extract_slits.c"><param name="Local" value="fors__extract__slits_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_flat_normalise.h"><param name="Local" value="fors__flat__normalise_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_flatfield.c"><param name="Local" value="fors__flatfield_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_header.c"><param name="Local" value="fors__header_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_header.h"><param name="Local" value="fors__header_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify-test.c"><param name="Local" value="fors__identify-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify.c"><param name="Local" value="fors__identify_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_identify.h"><param name="Local" value="fors__identify_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image-test.c"><param name="Local" value="fors__image-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image.c"><param name="Local" value="fors__image_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_image.h"><param name="Local" value="fors__image_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science-test.c"><param name="Local" value="fors__img__science-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science.c"><param name="Local" value="fors__img__science_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_impl.c"><param name="Local" value="fors__img__science__impl_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_science_impl.h"><param name="Local" value="fors__img__science__impl_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat-test.c"><param name="Local" value="fors__img__screen__flat-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat.c"><param name="Local" value="fors__img__screen__flat_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_impl.c"><param name="Local" value="fors__img__screen__flat__impl_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_screen_flat_impl.h"><param name="Local" value="fors__img__screen__flat__impl_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat-test.c"><param name="Local" value="fors__img__sky__flat-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat.c"><param name="Local" value="fors__img__sky__flat_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_impl.c"><param name="Local" value="fors__img__sky__flat__impl_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_img_sky_flat_impl.h"><param name="Local" value="fors__img__sky__flat__impl_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_instrument.c"><param name="Local" value="fors__instrument_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_instrument.h"><param name="Local" value="fors__instrument_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_normalise_flat.c"><param name="Local" value="fors__normalise__flat_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_overscan.h"><param name="Local" value="fors__overscan_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_paf.c"><param name="Local" value="fors__paf_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_paf.h"><param name="Local" value="fors__paf_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pattern-test.c"><param name="Local" value="fors__pattern-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pattern.c"><param name="Local" value="fors__pattern_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pattern.h"><param name="Local" value="fors__pattern_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pfits.c"><param name="Local" value="fors__pfits_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pfits.h"><param name="Local" value="fors__pfits_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry-test.c"><param name="Local" value="fors__photometry-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry.c"><param name="Local" value="fors__photometry_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_impl.c"><param name="Local" value="fors__photometry__impl_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_photometry_impl.h"><param name="Local" value="fors__photometry__impl_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pmos_calib.c"><param name="Local" value="fors__pmos__calib_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pmos_extract.c"><param name="Local" value="fors__pmos__extract_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_pmos_science.c"><param name="Local" value="fors__pmos__science_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point-test.c"><param name="Local" value="fors__point-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point.c"><param name="Local" value="fors__point_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_point.h"><param name="Local" value="fors__point_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial.c"><param name="Local" value="fors__polynomial_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_polynomial.h"><param name="Local" value="fors__polynomial_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc-test.c"><param name="Local" value="fors__qc-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc.c"><param name="Local" value="fors__qc_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_qc.h"><param name="Local" value="fors__qc_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe.c"><param name="Local" value="fors__recipe_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_recipe_impl.h"><param name="Local" value="fors__recipe__impl_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_remove_bias.c"><param name="Local" value="fors__remove__bias_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_resample.c"><param name="Local" value="fors__resample_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_science.c"><param name="Local" value="fors__science_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting-test.c"><param name="Local" value="fors__setting-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting.c"><param name="Local" value="fors__setting_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_setting.h"><param name="Local" value="fors__setting_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack-test.c"><param name="Local" value="fors__stack-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack.c"><param name="Local" value="fors__stack_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_stack.h"><param name="Local" value="fors__stack_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star-test.c"><param name="Local" value="fors__star-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star.c"><param name="Local" value="fors__star_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_star.h"><param name="Local" value="fors__star_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_cat.c"><param name="Local" value="fors__std__cat_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_cat.h"><param name="Local" value="fors__std__cat_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_star-test.c"><param name="Local" value="fors__std__star-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_star.c"><param name="Local" value="fors__std__star_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_std_star.h"><param name="Local" value="fors__std__star_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_subtract_sky.c"><param name="Local" value="fors__subtract__sky_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_subtract_sky_lss.c"><param name="Local" value="fors__subtract__sky__lss_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_sumflux.c"><param name="Local" value="fors__sumflux_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_tools.c"><param name="Local" value="fors__tools_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_tools.h"><param name="Local" value="fors__tools_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_trace_flat.c"><param name="Local" value="fors__trace__flat_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_utils.c"><param name="Local" value="fors__utils_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_utils.h"><param name="Local" value="fors__utils_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_wave_calib.c"><param name="Local" value="fors__wave__calib_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_wave_calib_lss.c"><param name="Local" value="fors__wave__calib__lss_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint-test.c"><param name="Local" value="fors__zeropoint-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint.c"><param name="Local" value="fors__zeropoint_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_impl.c"><param name="Local" value="fors__zeropoint__impl_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="fors_zeropoint_impl.h"><param name="Local" value="fors__zeropoint__impl_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="list-test.c"><param name="Local" value="list-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="list.c"><param name="Local" value="list_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="list.h"><param name="Local" value="list_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="list_void.h"><param name="Local" value="list__void_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="montecarlo.c"><param name="Local" value="montecarlo_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="moses.c"><param name="Local" value="moses_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="moses.h"><param name="Local" value="moses_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="recipes-test.c"><param name="Local" value="recipes-test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test.c"><param name="Local" value="test_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test.h"><param name="Local" value="test_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_hough.c"><param name="Local" value="test__hough_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_simulate.c"><param name="Local" value="test__simulate_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="test_simulate.h"><param name="Local" value="test__simulate_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib.c"><param name="Local" value="vimos__calib_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib_impl.c"><param name="Local" value="vimos__calib__impl_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_calib_impl.h"><param name="Local" value="vimos__calib__impl_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_science.c"><param name="Local" value="vimos__science_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_science_impl.c"><param name="Local" value="vimos__science__impl_8c_source.html"><param name="ImageNumber" value="11"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Name" value="vimos_science_impl.h"><param name="Local" value="vimos__science__impl_8h_source.html"><param name="ImageNumber" value="11"></OBJECT>
     </UL>
   </UL>
 </UL>
+</BODY>
+</HTML>
diff --git a/html/index.hhk b/html/index.hhk
index 05a7a98..3d0062b 100644
--- a/html/index.hhk
+++ b/html/index.hhk
@@ -5,834 +5,1747 @@
 </OBJECT>
 <UL>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html"><param name="Name" value="2d point"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html"><param name="Name" value="_extract_method"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce"><param name="Name" value="fors_point_delete"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65"><param name="Name" value="fors_point_distsq"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gc5a8341742fc371f6e7332600286045e"><param name="Name" value="fors_point_duplicate"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#g5f09413dd7958d3ebbe1ba7700b27377"><param name="Name" value="fors_point_equal"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83"><param name="Name" value="fors_point_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a6d3808d8f76ccba38a0b04b348f55071"><param name="Name" value="method"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a4b963442d71be80738b5994e97c75b36"><param name="Name" value="sex_config"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#aa51edfe17fbf90e81405a4d343d6211f"><param name="Name" value="sex_exe"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a0cb0c99c37ef47b7569955e8f42adbf6"><param name="Name" value="sex_mag"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a4ddadecb69b1867762accb298da7e7d7"><param name="Name" value="sex_magerr"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a94aa696ea0cf75d5a40545f6ada13e43"><param name="Name" value="sex_radius"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__cpl__wcs__.html"><param name="Name" value="_fors_cpl_wcs_"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__cpl__wcs__.html#aec01adf7519d22a1fb59c61076057595"><param name="Name" value="dims"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__cpl__wcs__.html#aa75d49f978e1ff975e9cb68f09c16c18"><param name="Name" value="naxis"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__cpl__wcs__.html#a76ffd1e0af7f1d000078931be71a845e"><param name="Name" value="wcsptr"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__image.html"><param name="Name" value="_fors_image"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__image.html#a08eca6a1c5d5cfeb4af73b15c7985b3b"><param name="Name" value="data"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__image.html#a88979de9862cd29d904a4f1e616509a4"><param name="Name" value="variance"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html"><param name="Name" value="_FORS_PAF_"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#a7f44550c15b50560e761a07c8b78024d"><param name="Name" value="header"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#a8277746dbb0ef7626fbc103f763ebcf1"><param name="Name" value="name"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#ae6e4dfc62b72ede7cc3eb94f9442567d"><param name="Name" value="nh"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#a819813f81b4540eff32231e77d9c52e9"><param name="Name" value="nr"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#af406fb3edb547a0608a76c93b8b6f6c8"><param name="Name" value="records"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__RECORD__.html"><param name="Name" value="_FORS_PAF_RECORD_"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__RECORD__.html#af69bb301a9df55477add23c6a2ad6240"><param name="Name" value="comment"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a85d0294d00b7c5b4205fadac85526328"><param name="Name" value="data"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a6d69378eba6870b6fa93c3a3cf63910d"><param name="Name" value="name"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a3b157d712d46492bc176a06500980115"><param name="Name" value="type"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html"><param name="Name" value="_fors_pattern"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#a56e70f56aab145b915ebed443003b823"><param name="Name" value="dratsq"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#a26b52abfcc19a9488dee27e2921fd3cf"><param name="Name" value="dtheta"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#ad4c92aab333c6e87be1323ceaf3c03d8"><param name="Name" value="max"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#a2686acc25aa9720d0f18bd87371cf7de"><param name="Name" value="min"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#aabea542697d213367713130b5e97aa9e"><param name="Name" value="ratsq"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#a45a7832dd782c60047ff9c16446882fe"><param name="Name" value="ref"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#a0f355468abe462670457dc5f2dbfd63b"><param name="Name" value="theta"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__point.html"><param name="Name" value="_fors_point"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__point.html#a7d087815e7403a962b86bb10ada4421d"><param name="Name" value="x"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__point.html#a33a8f245d63d8ae71d43239315076350"><param name="Name" value="y"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html"><param name="Name" value="_fors_setting"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ab3110a9852713777090e0031eb4cf057"><param name="Name" value="average_gain"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a04188f2c5738d1f6092a7a578f8229f5"><param name="Name" value="binx"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a19b3bfb18d923d08670897a7112ae7d0"><param name="Name" value="biny"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a15ba32ac8b198b9dd15338891d855349"><param name="Name" value="chip_id"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ab1ad3713ba9b86216cea5aa225500c69"><param name="Name" value="exposure_time"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a864b35bebb983c86c7c81581601638e2"><param name="Name" value="filter_name"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a6019c0c5914b4a9f6c620f98a84c5dc3"><param name="Name" value="filterband"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ab38c5f7885683ddd1d1a7dc27fb2ba2b"><param name="Name" value="instrument"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ae59b404fa0dba639061578c018d065c3"><param name="Name" value="pixel_scale"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#afa4b9f6616d7219b907a39644c30d86e"><param name="Name" value="prescan_x"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a460677f3aa1cb2bbccbaf5508a29fad5"><param name="Name" value="prescan_y"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a34aa5b8ca5d983d3331a702eb2252540"><param name="Name" value="read_clock"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ae9590b2375ae5ca7ae94801da9ad76fd"><param name="Name" value="ron"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a2c3c730074609891796a3fb28138f425"><param name="Name" value="version"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html"><param name="Name" value="_fors_star"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a15ddd137fee3e1925e9722057366b29b"><param name="Name" value="dmagnitude"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#ad591125b3daa76904f0def386a7b361b"><param name="Name" value="dmagnitude_corr"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#ab863d4543dc50ff8fd46622ded9c7200"><param name="Name" value="fwhm"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a8ea1d278cd06279fe37bf56238a9f6d8"><param name="Name" value="id"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#ab84e2da9886ebd2a68c33fa69a7b55da"><param name="Name" value="magnitude"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a67fbc8534a37685e633bf46d315a25cd"><param name="Name" value="magnitude_corr"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a92513c57462f561ade748dc83b98a126"><param name="Name" value="orientation"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#ae3f5db0d44371b78ea7b9a48d3959d59"><param name="Name" value="pixel"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a197ac0fb50916f94924f82b189a03ee3"><param name="Name" value="semi_major"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a4897b86d4c154c0764b80c1ddcab20e1"><param name="Name" value="semi_minor"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a8dd06110ea67874e1272756d9f4d819c"><param name="Name" value="stellarity_index"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a45e679977d24d14f293e0d881dada47a"><param name="Name" value="weight"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html"><param name="Name" value="_fors_std_star"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#ae67a7a23ee09dd01326802d33bf65b08"><param name="Name" value="cat_magnitude"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#ae731ce7c8647ca73dce568c935ca8470"><param name="Name" value="color"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#a579256e995dc04bd914d39d5aca89bc3"><param name="Name" value="cov_catm_color"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#a44c1966a4b6b9e850e25ae7a361af35b"><param name="Name" value="dcat_magnitude"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#a76d13f45de0ac772c7d4fe1fda4cdf6c"><param name="Name" value="dcolor"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#a850580aa41a7d879eb83fd60d848feeb"><param name="Name" value="dec"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#a953ef25f539347013280e7c21d2920cd"><param name="Name" value="dmagnitude"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#afcf8a50010ad0c894c17b6fc6d0bd227"><param name="Name" value="magnitude"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#ac5b93743c2acada36da7bc7a1813d49a"><param name="Name" value="name"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#aea102ea39ac9dabba780b1987f482a16"><param name="Name" value="pixel"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#adbe20f51d01cd493bc9509c4a771f0aa"><param name="Name" value="ra"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#aa289151fdd925b93c934f8435fd6311f"><param name="Name" value="trusted"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga801baaad201f88a079f39961001b2272"><param name="Name" value="_forsPAFAppend"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga31aa555372302db5a189cfc8ddf77925"><param name="Name" value="_forsPAFFormatRecord"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gafec1afad71f75b57db50075e5129d01a"><param name="Name" value="_forsPAFHeaderCreate"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga0f4b8a1dafd89e1978b36032c6a5d48a"><param name="Name" value="_forsPAFRecordCreate"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga8f34528da23f3d240c68aab76539edca"><param name="Name" value="_forsPAFRecordDestroy"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga5a2311da25c79df625c7bd8af91853e3"><param name="Name" value="_forsPAFRecordSet"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga12c533561960f76a20b651673f9d38fd"><param name="Name" value="_forsPAFValueSize"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8"><param name="Name" value="_get_optional_table_value"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html"><param name="Name" value="_identify_method"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a7c4345b693fd891d4f343eaddc34979e"><param name="Name" value="kappa"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a54fd4d467ce3b51859fb581b23d384b4"><param name="Name" value="max_offset"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a9b637dbee7a14e588182802a46a33fc9"><param name="Name" value="max_search"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a98ec6209ab8334189fdeb0ba9ad6db62"><param name="Name" value="ncat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a42bd374120c9b0d6c6798af05c91551a"><param name="Name" value="nsource"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a751e9793a2bf184209201ec0403db027"><param name="Name" value="search"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__stack__method.html"><param name="Name" value="_stack_method"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__stack__method.html#a1ef465157d5630ba9517e8ef2b41a9fe"><param name="Name" value="method"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__stack__method.html#a1e2b6c25ab659ca91223e1553c9952b4"><param name="Name" value="method_name"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__stack__method.html#ae9a565dbc8376609af43fe07ed0f0213"><param name="Name" value="pars"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd"><param name="Name" value="_test"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga84ddcd8e89c40b0b134af4fbfa620172"><param name="Name" value="abs_dev"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#ac96f2f0efc7888f88c739a2f5827f601"><param name="Name" value="airmass"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gac6b3dfce12019667f63bc05e12093dac"><param name="Name" value="arcsec_tol"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a"><param name="Name" value="assure"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a3de1b684b7ee37db4e7a31928b63996b"><param name="Name" value="atm_ext_identifier"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a8cfc890cee6e0694b1983d7f295352a8"><param name="Name" value="atm_ext_index"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ab3110a9852713777090e0031eb4cf057"><param name="Name" value="average_gain"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#a66cb2432b3119e08ea9d4e8894888e78"><param name="Name" value="back"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structband__jacobian.html#ac3721fe3669edde3ff7375c79edb60b9"><param name="Name" value="band"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structband__jacobian.html#ac3721fe3669edde3ff7375c79edb60b9"><param name="Name" value="band_jacobian"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__filterlist.html#a213a35009db999a6c4eb7c5b76f95ae7"><param name="Name" value="fors_filterlist"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structband__jacobian.html"><param name="Name" value="band_jacobian"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structband__jacobian.html#ac3721fe3669edde3ff7375c79edb60b9"><param name="Name" value="band"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structband__jacobian.html#a459ddad4e01b8e99a0486f9b03d236ed"><param name="Name" value="col"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structband__jacobian.html#a5a22b2fe8df6300f3d1a2a596a019e70"><param name="Name" value="mag"></OBJECT>
   </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23"><param name="Name" value="_get_optional_table_value"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gf80c8e8f1596284c4a41600a7d381e92"><param name="Name" value="_test"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#g867790f186ab6cc04c00a80f80983991"><param name="Name" value="assure"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__test.html"><param name="Name" value="Basic library test"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gb269a10fede882f376f2e599965cebe4"><param name="Name" value="build_equations_lhs_matrix_from_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g55817cb490a2517ef207f96a9cf51b8b"><param name="Name" value="build_equations_lhs_matrix_from_poly"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ge2d3cb795a4f549322f1febff5596787"><param name="Name" value="build_equations_rhs_cov"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-  <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="DFS Utilities"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="fors_point unit tests"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="fors_recipe Recipe"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="High level functions"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="identify unit tests"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Image source extraction"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Image stacking"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Image with error bars"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Instrument setting"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="MOS data reduction library"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Quality Control Utilities"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="science recipe tests"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Simulate data for unit testing"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Source identification"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Standard star catalogue tests"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Star tests"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Test image stacking"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Test of image module"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="test of master bias recipe"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="test of master dark recipe"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="test of screen flat recipe"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="test of sky flat recipe"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Tools for Polynomial Coefficient Handling"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="Unit test infrastructure"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="zeropoint recipe tests"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga94d648dbe35921213f324fa814c5c330"><param name="Name" value="bias_avg"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a04188f2c5738d1f6092a7a578f8229f5"><param name="Name" value="binx"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a04188f2c5738d1f6092a7a578f8229f5"><param name="Name" value="_fors_setting"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga616bc975cc675200b4e2b71e11b6a111"><param name="Name" value="test_simulate"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a19b3bfb18d923d08670897a7112ae7d0"><param name="Name" value="biny"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a19b3bfb18d923d08670897a7112ae7d0"><param name="Name" value="_fors_setting"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gadd4f1621a17fb8c3cb8a71369dc28f91"><param name="Name" value="test_simulate"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gabfcabff5102d27ba7b09e4398e057762"><param name="Name" value="build_equations_lhs_matrix_from_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga43e3c1d13157092f683e6d4912cd71d2"><param name="Name" value="build_equations_lhs_matrix_from_poly"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga5e4afe6326f0bb9c748fed2286c8c835"><param name="Name" value="build_equations_rhs_cov"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#ae67a7a23ee09dd01326802d33bf65b08"><param name="Name" value="cat_magnitude"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a15ba32ac8b198b9dd15338891d855349"><param name="Name" value="chip_id"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a15ba32ac8b198b9dd15338891d855349"><param name="Name" value="_fors_setting"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gaa2383a6c0ad110007e91b6467b755498"><param name="Name" value="test_simulate"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_bias"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_bias_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_dark"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_dark_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_extract"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_identify"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_identify_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_image"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_image_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_img_science"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_img_science_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_img_screen_flat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_img_screen_flat_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_img_sky_flat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_img_sky_flat_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_photometry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_point"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_point_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_polynomial"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_setting"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_setting_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_stack"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_stack_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_star"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_star_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_std_cat_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_tools"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_utils"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_zeropoint"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="fors_zeropoint_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="forsdfs"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="forsqc"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="moses"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="test_simulate"></OBJECT>
   </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structband__jacobian.html#a459ddad4e01b8e99a0486f9b03d236ed"><param name="Name" value="col"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#ae731ce7c8647ca73dce568c935ca8470"><param name="Name" value="color"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__RECORD__.html#af69bb301a9df55477add23c6a2ad6240"><param name="Name" value="comment"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga33568fda4dbd442173e671211fa84afc"><param name="Name" value="conad"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html"><param name="Name" value="container type"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#a579256e995dc04bd914d39d5aca89bc3"><param name="Name" value="cov_catm_color"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="fors_bias"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="fors_dark"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="fors_img_science"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="fors_img_screen_flat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="fors_img_sky_flat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="fors_photometry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="fors_recipe"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="fors_zeropoint"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e"><param name="Name" value="create_bias"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gaebd36d5457a83612601155994a242dda"><param name="Name" value="create_dark"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b"><param name="Name" value="create_phot_table"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga5e5e21165c992a2062b3ca661e35fe9d"><param name="Name" value="create_screen_flat"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103"><param name="Name" value="create_sky_flat"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164"><param name="Name" value="create_standard"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5"><param name="Name" value="create_standard_keys"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3"><param name="Name" value="create_std_cat"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#a1a1cb0ab62efe6895ec181d4ad9ca047"><param name="Name" value="current"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#abd7376537b236a2681c22a6628a6d704"><param name="Name" value="current_p1"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#a72f124431873b5f1f0b7fad24aa788c6"><param name="Name" value="current_p2"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga7b419fb56d0d512c687a6f830d652798"><param name="Name" value="dark_avg"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__image.html#a08eca6a1c5d5cfeb4af73b15c7985b3b"><param name="Name" value="data"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#g867790f186ab6cc04c00a80f80983991"><param name="Name" value="assure"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ge8bd4915a67367a226dcd3f5c3bd5491"><param name="Name" value="list_duplicate"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#g014e03d131a3d24d1d52465fd0f63a2f"><param name="Name" value="list_extract"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#g835886d7e2108ff01e9123261b28eb1e"><param name="Name" value="list_malloc"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#g14ca81b1edd1222975ab52e203cbde59"><param name="Name" value="list_new"></OBJECT>
-  </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a"><param name="Name" value="create_bias"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gb54d8ef52e4f8e0407e522565b8919f6"><param name="Name" value="create_dark"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5"><param name="Name" value="create_phot_table"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g474967528c2d1de8ce4dadd24da817ce"><param name="Name" value="create_screen_flat"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669"><param name="Name" value="create_sky_flat"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b"><param name="Name" value="create_standard"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2"><param name="Name" value="create_standard_keys"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410"><param name="Name" value="create_std_cat"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gefe94695ad068025eff46fe69998e75d"><param name="Name" value="deleteForsPAF"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__image.html#a08eca6a1c5d5cfeb4af73b15c7985b3b"><param name="Name" value="_fors_image"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a85d0294d00b7c5b4205fadac85526328"><param name="Name" value="_FORS_PAF_RECORD_"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#a44c1966a4b6b9e850e25ae7a361af35b"><param name="Name" value="dcat_magnitude"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#a76d13f45de0ac772c7d4fe1fda4cdf6c"><param name="Name" value="dcolor"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#a850580aa41a7d879eb83fd60d848feeb"><param name="Name" value="dec"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#gac377a5fa64fdef02d0048cf0e27aca2c"><param name="Name" value="DEGRAD"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga5d62f23bc1a07c4136aecccfcea2459d"><param name="Name" value="deleteForsPAF"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga8127dadf8f51913034e2891c96fc6462"><param name="Name" value="det_nx"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga7029a6a32fa871757ee996ab390e651c"><param name="Name" value="det_ny"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html"><param name="Name" value="DFS Utilities"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435"><param name="Name" value="dfs_equal_keyword"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga6698973ab70fe7b0bd61b993e59e8a53"><param name="Name" value="dfs_generate_filename"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga950b280111a517c7011a120168758de0"><param name="Name" value="dfs_generate_filename_tfits"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb"><param name="Name" value="dfs_get_parameter_bool"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gae0dc63f80258d73a93d35e41b2a8b367"><param name="Name" value="dfs_get_parameter_bool_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96"><param name="Name" value="dfs_get_parameter_double"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d"><param name="Name" value="dfs_get_parameter_double_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22"><param name="Name" value="dfs_get_parameter_int"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6"><param name="Name" value="dfs_get_parameter_int_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197"><param name="Name" value="dfs_get_parameter_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd"><param name="Name" value="dfs_get_parameter_string_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf"><param name="Name" value="dfs_load_header"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga326130afab421ef30992def2a444d660"><param name="Name" value="dfs_load_image"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga010c17942448386415d6e51adebae649"><param name="Name" value="dfs_load_table"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga04ce01a9ddd2c4ddee75010d7fdb81fd"><param name="Name" value="dfs_save"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5"><param name="Name" value="dfs_save_image"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee"><param name="Name" value="dfs_save_image_ext"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b"><param name="Name" value="dfs_save_image_null"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824"><param name="Name" value="dfs_save_table"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489"><param name="Name" value="dfs_save_table_ext"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__cpl__wcs__.html#aec01adf7519d22a1fb59c61076057595"><param name="Name" value="dims"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025"><param name="Name" value="distsq_shift"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a15ddd137fee3e1925e9722057366b29b"><param name="Name" value="dmagnitude"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a15ddd137fee3e1925e9722057366b29b"><param name="Name" value="_fors_star"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#a953ef25f539347013280e7c21d2920cd"><param name="Name" value="_fors_std_star"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#ad591125b3daa76904f0def386a7b361b"><param name="Name" value="dmagnitude_corr"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#a56e70f56aab145b915ebed443003b823"><param name="Name" value="dratsq"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#a26b52abfcc19a9488dee27e2921fd3cf"><param name="Name" value="dtheta"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#aed325b1d7a1acd893dac35006a10ab2c"><param name="Name" value="elements"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html"><param name="Name" value="entry"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g318f71668fea717baced57478bd282c8"><param name="Name" value="dfs_equal_keyword"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834"><param name="Name" value="dfs_get_parameter_bool"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gfce5eddb71d8700b30c690f49374d2e0"><param name="Name" value="dfs_get_parameter_bool_const"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e"><param name="Name" value="dfs_get_parameter_double"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206"><param name="Name" value="dfs_get_parameter_double_const"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59"><param name="Name" value="dfs_get_parameter_int"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f"><param name="Name" value="dfs_get_parameter_int_const"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd"><param name="Name" value="dfs_get_parameter_string"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753"><param name="Name" value="dfs_get_parameter_string_const"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794"><param name="Name" value="dfs_load_header"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f"><param name="Name" value="dfs_load_image"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a"><param name="Name" value="dfs_load_table"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g8670593994ad689ac3aa76cf648e76c3"><param name="Name" value="dfs_save"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465"><param name="Name" value="dfs_save_image"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2"><param name="Name" value="dfs_save_image_ext"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb"><param name="Name" value="dfs_save_image_null"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616"><param name="Name" value="dfs_save_table"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29"><param name="Name" value="dfs_save_table_ext"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g8479954471cd14e92ec92efce09ec87b"><param name="Name" value="errorstate_dump_one"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757"><param name="Name" value="fors_begin"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gea45a5b73ab086e5e08680928adbd0cd"><param name="Name" value="fors_dfs_add_exptime"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#geb1068e007bd0ebef0cd4a6aa12cf523"><param name="Name" value="fors_dfs_add_wcs"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g61956e9dcf77f5c71db911e0390f63f3"><param name="Name" value="fors_dfs_pipeline_version"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1"><param name="Name" value="fors_dfs_save_image"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42"><param name="Name" value="fors_dfs_save_table"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g37d74636b6c3f3d52b0312ce3a58e59d"><param name="Name" value="fors_dfs_set_groups"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295"><param name="Name" value="fors_end"></OBJECT>
-  </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g318f71668fea717baced57478bd282c8"><param name="Name" value="dfs_equal_keyword"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834"><param name="Name" value="dfs_get_parameter_bool"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gfce5eddb71d8700b30c690f49374d2e0"><param name="Name" value="dfs_get_parameter_bool_const"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e"><param name="Name" value="dfs_get_parameter_double"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g52067dcd1b5c643c72b7350cdb204206"><param name="Name" value="dfs_get_parameter_double_const"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59"><param name="Name" value="dfs_get_parameter_int"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g55c3af99cf54ae488cb2c431a75a658f"><param name="Name" value="dfs_get_parameter_int_const"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd"><param name="Name" value="dfs_get_parameter_string"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g5a310bdfd1e4a39517cb74b1c8696753"><param name="Name" value="dfs_get_parameter_string_const"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794"><param name="Name" value="dfs_load_header"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f"><param name="Name" value="dfs_load_image"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a"><param name="Name" value="dfs_load_table"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g8670593994ad689ac3aa76cf648e76c3"><param name="Name" value="dfs_save"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465"><param name="Name" value="dfs_save_image"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g0c6583af923e2d981ba63d623f7f16f2"><param name="Name" value="dfs_save_image_ext"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ge7d189654778913f074c1f46f801f7fb"><param name="Name" value="dfs_save_image_null"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616"><param name="Name" value="dfs_save_table"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gc673cd895f691fdd4903275de721aa29"><param name="Name" value="dfs_save_table_ext"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b"><param name="Name" value="distsq_shift"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gff8105d58698d673632960edbd21f26c"><param name="Name" value="entry_delete"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g704bbcab4ba8418ff88419511eb5092b"><param name="Name" value="entry_delete_but_standard"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g62dd2afbab9508f260ddcc65d8e00f80"><param name="Name" value="entry_list_print"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gc4cfb3c0bdf31be44324adffdb6277a1"><param name="Name" value="entry_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g8479954471cd14e92ec92efce09ec87b"><param name="Name" value="errorstate_dump_one"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#g5237e1161aeef9d828a973333151a36f"><param name="Name" value="extract_sex"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#gedc4ee1e5daa54e4859e929c7ff51f59"><param name="Name" value="extract_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#ac96f2f0efc7888f88c739a2f5827f601"><param name="Name" value="airmass"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a3de1b684b7ee37db4e7a31928b63996b"><param name="Name" value="atm_ext_identifier"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a8cfc890cee6e0694b1983d7f295352a8"><param name="Name" value="atm_ext_index"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#ab2ba20da0e2b07f5ad756ecbfa4f68a5"><param name="Name" value="exptime"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gad105fc9ee5d1d81f7c37d1cb17559a18"><param name="Name" value="fors_photometry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a1172414515f8a0f0c911c6b3836ddc8d"><param name="Name" value="frame_index"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a7b1797bb488330f2904878e6256956d7"><param name="Name" value="gain"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a7160e3b4c104ece8465a3bc53055b79f"><param name="Name" value="star"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a7cd70b41d3e63bdce7316482b08ed1e3"><param name="Name" value="star_index"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga5a7208d2d524a7660f3e57e269b7305f"><param name="Name" value="entry_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga24e72dc7095e56d37033c584bd279f13"><param name="Name" value="entry_delete_but_standard"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga39efe1039b737efd95d51e5dbceb776b"><param name="Name" value="entry_get_powers_airmass_color"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga8c955a5540838142f16b310451048f6b"><param name="Name" value="entry_get_powers_x_y"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaf8c135834cc51bd767a6956346885958"><param name="Name" value="entry_list_print"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga0a8c8c9ebad2d55ac56e61c820fa3f27"><param name="Name" value="entry_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gad490b5a7e4529d40b2ccad526c9df56d"><param name="Name" value="error_init"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gaa72aa06ad8174e7f9e14b556e1ec130f"><param name="Name" value="errorstate_dump_one"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ab1ad3713ba9b86216cea5aa225500c69"><param name="Name" value="exposure_time"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#ab2ba20da0e2b07f5ad756ecbfa4f68a5"><param name="Name" value="exptime"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga179ba42491f97607c78d677e432614a7"><param name="Name" value="extract_sex"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga6a2e3af8f65f79d338c6f0c46931b89d"><param name="Name" value="extract_test"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a864b35bebb983c86c7c81581601638e2"><param name="Name" value="filter_name"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a6019c0c5914b4a9f6c620f98a84c5dc3"><param name="Name" value="filterband"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html"><param name="Name" value="FITS keywords"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__double.html"><param name="Name" value="floating point values"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga69350709e5f9874601c729becd315e81"><param name="Name" value="fors_angle_diff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce"><param name="Name" value="fors_begin"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html"><param name="Name" value="fors_bias"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga5d2a46e2354a60d3a45b2c63a665b781"><param name="Name" value="fors_bias"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga997a109752c13033f89ac7f16b983938"><param name="Name" value="fors_bias_author"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gaad1b25bcaa37dff1e986b001f8d37ba1"><param name="Name" value="fors_bias_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga6573b8822e0f40fbc3872cd034e0b0f4"><param name="Name" value="fors_bias_define_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gab964eee8b809187efd9925a2d5d5b484"><param name="Name" value="fors_bias_description"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga3060d3f8da61ea96500a709454e0d157"><param name="Name" value="fors_bias_description_short"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga1db6393658146917d5d8403fd1ed7654"><param name="Name" value="fors_bias_destroy"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gae9c375d196eba5a2c52cf57b7de8c8e7"><param name="Name" value="fors_bias_email"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga98c9fd3f30badaa1ae4d9ed954f34fcc"><param name="Name" value="fors_bias_exec"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga592aa688dc3bce8eb844bc2cc1aa10df"><param name="Name" value="fors_bias_name"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gabdc231ff21279c9e3d5bff44c3f3fd6f"><param name="Name" value="write_qc"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga997a109752c13033f89ac7f16b983938"><param name="Name" value="fors_bias_author"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gaad1b25bcaa37dff1e986b001f8d37ba1"><param name="Name" value="fors_bias_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga6573b8822e0f40fbc3872cd034e0b0f4"><param name="Name" value="fors_bias_define_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gab964eee8b809187efd9925a2d5d5b484"><param name="Name" value="fors_bias_description"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga3060d3f8da61ea96500a709454e0d157"><param name="Name" value="fors_bias_description_short"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga1db6393658146917d5d8403fd1ed7654"><param name="Name" value="fors_bias_destroy"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gae9c375d196eba5a2c52cf57b7de8c8e7"><param name="Name" value="fors_bias_email"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga98c9fd3f30badaa1ae4d9ed954f34fcc"><param name="Name" value="fors_bias_exec"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#ga592aa688dc3bce8eb844bc2cc1aa10df"><param name="Name" value="fors_bias_name"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias__test.html"><param name="Name" value="fors_bias_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias__test.html#ga56ca9e6f3e38b35931c68ecb147b1f75"><param name="Name" value="test_bias"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html"><param name="Name" value="fors_cpl_wcs"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#gac377a5fa64fdef02d0048cf0e27aca2c"><param name="Name" value="DEGRAD"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga6ade84a0f3d4ce2796e12df3adb776d1"><param name="Name" value="fors_cpl_wcs_convert"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83"><param name="Name" value="fors_cpl_wcs_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga85c6df963659c6ab9a28649094ae037a"><param name="Name" value="fors_cpl_wcs_fitsstr2plist"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga1027310dff52a22788095ccdc54263ac"><param name="Name" value="fors_cpl_wcs_init"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#gaa74bc568f12d11bafedd854ef78a4c45"><param name="Name" value="fors_cpl_wcs_new_from_propertylist"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#gaa352c368a01171ba9fbfa0b63dd7784e"><param name="Name" value="fors_cpl_wcs_plist2fitsstr"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#gab492ce42cd31fc090dea53c30fbea764"><param name="Name" value="fors_ffhdr2str"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga0e3b1d297467f0a8552c6aa7da80bc4d"><param name="Name" value="WCSLIB_ERRCODE_MAX"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#gae98db393c8ca9bdd82fc4e168d570247"><param name="Name" value="wcslib_errmsgs"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga6ade84a0f3d4ce2796e12df3adb776d1"><param name="Name" value="fors_cpl_wcs_convert"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga5f02c917d9059a4472f872989d50fd83"><param name="Name" value="fors_cpl_wcs_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga85c6df963659c6ab9a28649094ae037a"><param name="Name" value="fors_cpl_wcs_fitsstr2plist"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga1027310dff52a22788095ccdc54263ac"><param name="Name" value="fors_cpl_wcs_init"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#gaa74bc568f12d11bafedd854ef78a4c45"><param name="Name" value="fors_cpl_wcs_new_from_propertylist"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#gaa352c368a01171ba9fbfa0b63dd7784e"><param name="Name" value="fors_cpl_wcs_plist2fitsstr"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#gabebf30c47320c004ab4e658f837f75db"><param name="Name" value="fors_create_sources_table"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html"><param name="Name" value="fors_dark"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga5b25632b185b390afe047835ef04708c"><param name="Name" value="fors_dark"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gab78855e5600d9c687fef05497032073f"><param name="Name" value="fors_dark_author"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gac68c5042f96db84bf22ca9d3c93f2015"><param name="Name" value="fors_dark_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga288a7e1b685184b501b448ea67bdf493"><param name="Name" value="fors_dark_define_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gae85f9c301c16078b04136f0117be92d7"><param name="Name" value="fors_dark_description"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga1210cd145dddb85ff38dcfedd108116a"><param name="Name" value="fors_dark_description_short"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga828322574faee993a595ecc93dfe5944"><param name="Name" value="fors_dark_destroy"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga05c36699290df606292abc2363e1752e"><param name="Name" value="fors_dark_email"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gaff0761c9cc96530ee12377f1f014e069"><param name="Name" value="fors_dark_exec"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga74e2fda28fd70220022c44eb6eee9972"><param name="Name" value="fors_dark_name"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gab78855e5600d9c687fef05497032073f"><param name="Name" value="fors_dark_author"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gac68c5042f96db84bf22ca9d3c93f2015"><param name="Name" value="fors_dark_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga288a7e1b685184b501b448ea67bdf493"><param name="Name" value="fors_dark_define_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gae85f9c301c16078b04136f0117be92d7"><param name="Name" value="fors_dark_description"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga1210cd145dddb85ff38dcfedd108116a"><param name="Name" value="fors_dark_description_short"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga828322574faee993a595ecc93dfe5944"><param name="Name" value="fors_dark_destroy"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga05c36699290df606292abc2363e1752e"><param name="Name" value="fors_dark_email"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gaff0761c9cc96530ee12377f1f014e069"><param name="Name" value="fors_dark_exec"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#ga74e2fda28fd70220022c44eb6eee9972"><param name="Name" value="fors_dark_name"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark__test.html"><param name="Name" value="fors_dark_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark__test.html#ga6b1c753a8c15cc5119ef13fda435ecbf"><param name="Name" value="test_dark"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga2271cd483d1b8537a0513251799faaed"><param name="Name" value="fors_delete_star_lists"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga71054af8e26681ec2d7e1ea39e7feb17"><param name="Name" value="fors_dfs_add_exptime"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gadbf163fdd77abcf68fac009993f20959"><param name="Name" value="fors_dfs_add_wcs"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga31c40f4add0fc7ef1e992d99493f5d1a"><param name="Name" value="fors_dfs_pipeline_version"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga45cefe5c9339a8b27be0454c9144a70a"><param name="Name" value="fors_dfs_save_image"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7"><param name="Name" value="fors_dfs_save_image_err"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f"><param name="Name" value="fors_dfs_save_table"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga5162766f25e67bb99869e7959c3f8201"><param name="Name" value="fors_dfs_set_groups"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9"><param name="Name" value="fors_end"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html"><param name="Name" value="fors_extract"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga179ba42491f97607c78d677e432614a7"><param name="Name" value="extract_sex"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga6a2e3af8f65f79d338c6f0c46931b89d"><param name="Name" value="extract_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05"><param name="Name" value="fors_extract"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga0753c9c8f5c40f594ebc0628407df2d4"><param name="Name" value="fors_extract_check_sex_flag"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#gab2bb9e07066870dd90dadd6044803dd0"><param name="Name" value="fors_extract_check_sex_star"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga2fe71423afa3cceea5d92dd3b49aca1e"><param name="Name" value="fors_extract_define_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga11354d3d250769e1adb67e1a2dbc1a96"><param name="Name" value="fors_extract_method_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga9b1d727905c3cb3f7740900ffaba6b57"><param name="Name" value="fors_extract_method_new"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga0753c9c8f5c40f594ebc0628407df2d4"><param name="Name" value="fors_extract_check_sex_flag"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#gab2bb9e07066870dd90dadd6044803dd0"><param name="Name" value="fors_extract_check_sex_star"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga2fe71423afa3cceea5d92dd3b49aca1e"><param name="Name" value="fors_extract_define_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga11354d3d250769e1adb67e1a2dbc1a96"><param name="Name" value="fors_extract_method_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#ga9b1d727905c3cb3f7740900ffaba6b57"><param name="Name" value="fors_extract_method_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__extract__sky__stats.html"><param name="Name" value="fors_extract_sky_stats"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__extract__sky__stats.html#a34ef7014753f20e3313c0adc61970b9b"><param name="Name" value="mean"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__extract__sky__stats.html#a4b573f007e8305120e3e204a2f0210da"><param name="Name" value="median"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__extract__sky__stats.html#a89ab5c0e95ab5b986fb9fcf872479e2f"><param name="Name" value="rms"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#gab492ce42cd31fc090dea53c30fbea764"><param name="Name" value="fors_ffhdr2str"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__filterlist.html"><param name="Name" value="fors_filterlist"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__filterlist.html#a213a35009db999a6c4eb7c5b76f95ae7"><param name="Name" value="band"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__filterlist.html#a8e52775ad3bdf1e32a80fc71b5f2d766"><param name="Name" value="name"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga44fc592c11aa7e15ea516df8b1a55fdb"><param name="Name" value="fors_fit_ncoeff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__fit__ncoeff__paropts.html"><param name="Name" value="fors_fit_ncoeff_paropts"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga8914070dcfeab65bad628175b5522d62"><param name="Name" value="fors_photometry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__fit__ncoeff__paropts.html#ab76b332d6365e313b87b982ddd8d7e82"><param name="Name" value="no"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__fit__ncoeff__paropts.html#a08987910ff3a46771ef8be900227a160"><param name="Name" value="one"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__fit__ncoeff__paropts.html#aaff216c4aa211359f1ea111bd01914f8"><param name="Name" value="perframe"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__fit__ncoeff__paropts.html#afdf29f5482d381fad567846d0ecb1d23"><param name="Name" value="pernight"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga37834a5427d4d460953d5b818ea79ffa"><param name="Name" value="fors_fits_compare_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#ga97b43bda55e1da41fe216364c8408d5b"><param name="Name" value="fors_fixed_pattern_noise"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#ga1ea0e4e37d52d6077b39e93ad1c340c3"><param name="Name" value="fors_fixed_pattern_noise_bias"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga3e2178bad7068e3768fc5f78b1d02490"><param name="Name" value="fors_frame_get_group_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga82f1aaba039c880a3bff109f3729d74a"><param name="Name" value="fors_frame_get_level_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gad97092a91b5de91f84039778596fd759"><param name="Name" value="fors_frame_get_type_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga6692a0ba541b3e7f99654f844aee40c6"><param name="Name" value="fors_frame_print"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744"><param name="Name" value="fors_frameset_extract"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga414e1f2d95f271cc76a67e525b910e96"><param name="Name" value="fors_frameset_print"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b"><param name="Name" value="fors_get_airmass"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87"><param name="Name" value="fors_get_license"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaad726bcd0d2380b05332fa6c7f1dea86"><param name="Name" value="fors_get_nobjs_perslit"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaffc2175d882864b6377743f89b29749b"><param name="Name" value="fors_get_object_position"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74"><param name="Name" value="fors_get_version_binary"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f"><param name="Name" value="fors_header_write_double"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga9d46eab8c3bab95ca0d445645bf4038d"><param name="Name" value="fors_header_write_int"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053"><param name="Name" value="fors_header_write_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html"><param name="Name" value="fors_identify"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga0627fa3e8f67fed1bd28cdd65fd19025"><param name="Name" value="distsq_shift"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga734ab55ebf9bec1bed7e6330def7b6d8"><param name="Name" value="fors_identify"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#gac0dc4fbd9cc717256e5972cad3e7447f"><param name="Name" value="fors_identify_define_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#gaea1f0f7065727f62a6e3a5805549a9ce"><param name="Name" value="fors_identify_method_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga642e6d38ae7b273d1901698a3970fd49"><param name="Name" value="fors_identify_method_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga2bf16455ff9dadaa26861905f8999616"><param name="Name" value="inside_region"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#gabbed61b85afc33d67894bd2dd1f061f3"><param name="Name" value="match_patterns"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga75bfe0adc06bd97c18925132d4abf937"><param name="Name" value="star_brighter_than"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga95a6f76b39659c4ce77f5f4ae3366a6f"><param name="Name" value="star_nearer"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga1c91776ec58d5026026e00580f18f277"><param name="Name" value="std_brighter_than"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#gac0dc4fbd9cc717256e5972cad3e7447f"><param name="Name" value="fors_identify_define_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#gaea1f0f7065727f62a6e3a5805549a9ce"><param name="Name" value="fors_identify_method_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga642e6d38ae7b273d1901698a3970fd49"><param name="Name" value="fors_identify_method_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify__test.html"><param name="Name" value="fors_identify_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify__test.html#ga9d562f61b66fedca2d53604fa93c8328"><param name="Name" value="test_identify"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html"><param name="Name" value="fors_image"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga14651bbe94e495df34aa59b335439b8f"><param name="Name" value="fors_image_abs"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga5510f4f5ebec4c99de3d9567b4eca21d"><param name="Name" value="fors_image_collapse_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga3789562f96e6c162f90d51388d372a88"><param name="Name" value="fors_image_collapse_ksigma_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga0d7aab18ef2992f7efba3ab24f7af503"><param name="Name" value="fors_image_collapse_median_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga41938f63e18b05073716d2afed9bd4a3"><param name="Name" value="fors_image_collapse_minmax_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053"><param name="Name" value="fors_image_crop"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad"><param name="Name" value="fors_image_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga67d54e90304b185e9f211aba5a620c4f"><param name="Name" value="fors_image_delete_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2"><param name="Name" value="fors_image_divide"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga88aca44b1a0bde06bbd43c487ae58766"><param name="Name" value="fors_image_divide_noerr"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35"><param name="Name" value="fors_image_divide_scalar"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga84a11915fdc3ac7ae1c9535d9eadfeeb"><param name="Name" value="fors_image_draw"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f"><param name="Name" value="fors_image_duplicate"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gabe2039c17c13fed0e430d71cb38454bf"><param name="Name" value="fors_image_exponential"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga21965427a98e2e07cf0b167e4610da1c"><param name="Name" value="fors_image_filter_max_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga395b18920e75b55d9a793dfbcb99755f"><param name="Name" value="fors_image_filter_median_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga80068092bb7559716abb1ddea1cc4814"><param name="Name" value="fors_image_flat_fit_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga547b9bf5f615a083bffdcfa9097d0520"><param name="Name" value="fors_image_get_data_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4"><param name="Name" value="fors_image_get_error_mean"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga8bde38b5f976d70ab7d6cef4652e1a51"><param name="Name" value="fors_image_get_max"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f"><param name="Name" value="fors_image_get_mean"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb"><param name="Name" value="fors_image_get_median"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga918a9107b07852d77bd457ea44d9b28e"><param name="Name" value="fors_image_get_min"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga978969a0911531b117735be291f106cc"><param name="Name" value="fors_image_get_size_x"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga74854105003c725472595225aab740d7"><param name="Name" value="fors_image_get_size_y"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e"><param name="Name" value="fors_image_get_stdev"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10"><param name="Name" value="fors_image_get_stdev_robust"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a"><param name="Name" value="fors_image_load"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gaf3015630f60828aa86962af230cd156c"><param name="Name" value="fors_image_load_list"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga0895dc7573734afe519fa4dff3ea33bd"><param name="Name" value="fors_image_load_list_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gaaa54b1e6e0e3cf5fcf442267896f6dad"><param name="Name" value="fors_image_multiply"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga25c0e2f6005831b9f5fcf3d81accfc43"><param name="Name" value="fors_image_multiply_noerr"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gadd751e2623f778d5bb2b8f3b628077c2"><param name="Name" value="fors_image_multiply_scalar"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363"><param name="Name" value="fors_image_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1"><param name="Name" value="fors_image_save"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga38eebeb331a65efbffbc6dc04304a786"><param name="Name" value="fors_image_save_sex"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gad4ecbb0eb96611d66dc9a3a1bc2ae0d8"><param name="Name" value="fors_image_square"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be"><param name="Name" value="fors_image_subtract"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gacbfb7c0518043b1079bb72af95d80961"><param name="Name" value="fors_image_subtract_scalar"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8"><param name="Name" value="FORS_IMAGE_TYPE"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga0820fe49afdbef957766d31ece6a93e8"><param name="Name" value="FORS_IMAGE_TYPE_MAX"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gac0830324b91c374088872a18c876bc34"><param name="Name" value="LIST_DEFINE"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gadb231bfc44ec37423962ea7f563a458b"><param name="Name" value="LIST_ELEM"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga570d5aab72b5f1a68d458e9690992d2d"><param name="Name" value="max_filter"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga14651bbe94e495df34aa59b335439b8f"><param name="Name" value="fors_image_abs"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga5510f4f5ebec4c99de3d9567b4eca21d"><param name="Name" value="fors_image_collapse_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga3789562f96e6c162f90d51388d372a88"><param name="Name" value="fors_image_collapse_ksigma_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga0d7aab18ef2992f7efba3ab24f7af503"><param name="Name" value="fors_image_collapse_median_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga41938f63e18b05073716d2afed9bd4a3"><param name="Name" value="fors_image_collapse_minmax_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga86343e578ebfa129195e6465e7e60053"><param name="Name" value="fors_image_crop"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga558b19ec6c2dc95a42406d264076a1ad"><param name="Name" value="fors_image_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga67d54e90304b185e9f211aba5a620c4f"><param name="Name" value="fors_image_delete_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga19f8c27621d28b8443d49f59af6cc2b2"><param name="Name" value="fors_image_divide"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga88aca44b1a0bde06bbd43c487ae58766"><param name="Name" value="fors_image_divide_noerr"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gacfa2ae6fb10e4178a658b96d45daad35"><param name="Name" value="fors_image_divide_scalar"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga84a11915fdc3ac7ae1c9535d9eadfeeb"><param name="Name" value="fors_image_draw"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga9553dd4daa5cbce4eb7b392aa5f6973f"><param name="Name" value="fors_image_duplicate"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gabe2039c17c13fed0e430d71cb38454bf"><param name="Name" value="fors_image_exponential"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga21965427a98e2e07cf0b167e4610da1c"><param name="Name" value="fors_image_filter_max_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga395b18920e75b55d9a793dfbcb99755f"><param name="Name" value="fors_image_filter_median_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga80068092bb7559716abb1ddea1cc4814"><param name="Name" value="fors_image_flat_fit_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga547b9bf5f615a083bffdcfa9097d0520"><param name="Name" value="fors_image_get_data_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga1ed97db3c18526c96984e42ced6cc2c4"><param name="Name" value="fors_image_get_error_mean"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga8bde38b5f976d70ab7d6cef4652e1a51"><param name="Name" value="fors_image_get_max"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gaf4cbc4ac53ba9049e498abc43eff312f"><param name="Name" value="fors_image_get_mean"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga428a8273a1d3070a80cd7e82651a2dcb"><param name="Name" value="fors_image_get_median"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga918a9107b07852d77bd457ea44d9b28e"><param name="Name" value="fors_image_get_min"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga978969a0911531b117735be291f106cc"><param name="Name" value="fors_image_get_size_x"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga74854105003c725472595225aab740d7"><param name="Name" value="fors_image_get_size_y"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga0729fde58e241c5ab03de7255fc5783e"><param name="Name" value="fors_image_get_stdev"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga6dd8e98a349a0711fae2c24ff07c5a10"><param name="Name" value="fors_image_get_stdev_robust"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga88d12a30a35a7b792dba116dad95b51a"><param name="Name" value="fors_image_load"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gaf3015630f60828aa86962af230cd156c"><param name="Name" value="fors_image_load_list"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga0895dc7573734afe519fa4dff3ea33bd"><param name="Name" value="fors_image_load_list_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gaaa54b1e6e0e3cf5fcf442267896f6dad"><param name="Name" value="fors_image_multiply"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga25c0e2f6005831b9f5fcf3d81accfc43"><param name="Name" value="fors_image_multiply_noerr"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gadd751e2623f778d5bb2b8f3b628077c2"><param name="Name" value="fors_image_multiply_scalar"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363"><param name="Name" value="fors_image_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1"><param name="Name" value="fors_image_save"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga38eebeb331a65efbffbc6dc04304a786"><param name="Name" value="fors_image_save_sex"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gad4ecbb0eb96611d66dc9a3a1bc2ae0d8"><param name="Name" value="fors_image_square"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gaf66086d63ad85bd81e5847ee962fc0be"><param name="Name" value="fors_image_subtract"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gacbfb7c0518043b1079bb72af95d80961"><param name="Name" value="fors_image_subtract_scalar"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html"><param name="Name" value="fors_image_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga0383c55336d7d782ab9f4fc614f9b0e0"><param name="Name" value="test_divide"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga69074b617f26911b58cda3a0fa13c918"><param name="Name" value="test_exponential"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga8e2e648513e2b6ee3843dd026130d7a2"><param name="Name" value="test_image"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga3fb4147d1739891fdc6ae6132e87d0bd"><param name="Name" value="test_median_filter"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga460806546207179c6e136d31bdb922d5"><param name="Name" value="test_subtract"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8"><param name="Name" value="FORS_IMAGE_TYPE"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga0820fe49afdbef957766d31ece6a93e8"><param name="Name" value="FORS_IMAGE_TYPE_MAX"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gabb34a534e28308533f300ea11ec7a3a3"><param name="Name" value="fors_imagelist_collapse_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gaa55c5fd8ade8f10e441297c0cda96093"><param name="Name" value="fors_imagelist_collapse_median_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html"><param name="Name" value="fors_img_science"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga6f762068474a2723fd2c17f01b4a82c1"><param name="Name" value="fors_img_science"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#gace503445a2e16523492b2a388fa70a81"><param name="Name" value="fors_img_science_author"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga966196c928f588d03aa1a17a486781aa"><param name="Name" value="fors_img_science_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga2a18bf8b29e61bb854f3290fba50bdfd"><param name="Name" value="fors_img_science_define_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#gaa822f70a5a79b6b9cf87e542d902475c"><param name="Name" value="fors_img_science_description"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga24a50db0e85ee3f7ce7f93899424f2d3"><param name="Name" value="fors_img_science_description_short"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#gad9737c625ab9465c8a504a25e67d8a03"><param name="Name" value="fors_img_science_destroy"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga70f209dbd150348c7f514c65f3babe82"><param name="Name" value="fors_img_science_email"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga375da6eaae762d1ee8a202bb62514ad2"><param name="Name" value="fors_img_science_exec"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga96a36a4f3494140425d4157375e72db6"><param name="Name" value="fors_img_science_name"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga11315f8dbe7bcd79d1f4e7ad691532fe"><param name="Name" value="get_image_quality"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga52377e795ce68f7de7da06f753b01efc"><param name="Name" value="is_star"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#gace503445a2e16523492b2a388fa70a81"><param name="Name" value="fors_img_science_author"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga966196c928f588d03aa1a17a486781aa"><param name="Name" value="fors_img_science_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga2a18bf8b29e61bb854f3290fba50bdfd"><param name="Name" value="fors_img_science_define_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#gaa822f70a5a79b6b9cf87e542d902475c"><param name="Name" value="fors_img_science_description"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga24a50db0e85ee3f7ce7f93899424f2d3"><param name="Name" value="fors_img_science_description_short"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#gad9737c625ab9465c8a504a25e67d8a03"><param name="Name" value="fors_img_science_destroy"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga70f209dbd150348c7f514c65f3babe82"><param name="Name" value="fors_img_science_email"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga375da6eaae762d1ee8a202bb62514ad2"><param name="Name" value="fors_img_science_exec"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga96a36a4f3494140425d4157375e72db6"><param name="Name" value="fors_img_science_name"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science__test.html"><param name="Name" value="fors_img_science_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science__test.html#ga64116c898e3e40a355dad7fec89f65a8"><param name="Name" value="test_img_science"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html"><param name="Name" value="fors_img_screen_flat"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gad6f0f603eedc00271082e6dae9dbd2a6"><param name="Name" value="fors_img_screen_flat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga837ec955be0a571f8091ffd46367f272"><param name="Name" value="fors_img_screen_flat_author"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gaaf1392d5e4fd8d016322a38b2bc1131a"><param name="Name" value="fors_img_screen_flat_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga19e0710196db92a992d5c1502c35a5f0"><param name="Name" value="fors_img_screen_flat_define_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga36aeb7e100bc98da1bd77b210e54a41f"><param name="Name" value="fors_img_screen_flat_description"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga4602c49d9d5b738361257d202b8645bb"><param name="Name" value="fors_img_screen_flat_description_short"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga0867be809872f262200c7562c3eb0cee"><param name="Name" value="fors_img_screen_flat_destroy"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gab9381b6e448d5951ad7b1f9977b3389e"><param name="Name" value="fors_img_screen_flat_email"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga4a8a4add6fd2c7f1300789425e079bce"><param name="Name" value="fors_img_screen_flat_exec"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga428c4f1b59081eaa3d4c2ac295cc0421"><param name="Name" value="fors_img_screen_flat_name"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gabe250dfa6d750ed0de8e583c614a7dae"><param name="Name" value="remove_large_scale"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga28678e6bba93d507e39ef08578423528"><param name="Name" value="remove_large_scale_fit"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1"><param name="Name" value="write_qc"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga837ec955be0a571f8091ffd46367f272"><param name="Name" value="fors_img_screen_flat_author"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gaaf1392d5e4fd8d016322a38b2bc1131a"><param name="Name" value="fors_img_screen_flat_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga19e0710196db92a992d5c1502c35a5f0"><param name="Name" value="fors_img_screen_flat_define_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga36aeb7e100bc98da1bd77b210e54a41f"><param name="Name" value="fors_img_screen_flat_description"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga4602c49d9d5b738361257d202b8645bb"><param name="Name" value="fors_img_screen_flat_description_short"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga0867be809872f262200c7562c3eb0cee"><param name="Name" value="fors_img_screen_flat_destroy"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gab9381b6e448d5951ad7b1f9977b3389e"><param name="Name" value="fors_img_screen_flat_email"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga4a8a4add6fd2c7f1300789425e079bce"><param name="Name" value="fors_img_screen_flat_exec"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga428c4f1b59081eaa3d4c2ac295cc0421"><param name="Name" value="fors_img_screen_flat_name"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat__test.html"><param name="Name" value="fors_img_screen_flat_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat__test.html#gaa7f97a660fe457c4a77d4269200b6162"><param name="Name" value="test_img_screen_flat"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html"><param name="Name" value="fors_img_sky_flat"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga6624d51caa8c203f494562b809cd9b9b"><param name="Name" value="fors_img_sky_flat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga4992cec4632dfdcab3c4830a341f8095"><param name="Name" value="fors_img_sky_flat_author"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga02c59acaaf71d4b2e9b4df6e5a452695"><param name="Name" value="fors_img_sky_flat_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga61b98b9ade434fed2b939774f5c6c7eb"><param name="Name" value="fors_img_sky_flat_define_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#gaab19885d0f8b55663a425a4609791e9c"><param name="Name" value="fors_img_sky_flat_description"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga7d9766834c42d36a3fbd7d442371bb3a"><param name="Name" value="fors_img_sky_flat_description_short"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga7182fc139ef9c00488f2df5e96be18b3"><param name="Name" value="fors_img_sky_flat_destroy"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga8a867c569bd5f246c161b80fe49eef79"><param name="Name" value="fors_img_sky_flat_email"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga3cf0bca5c79ec81295fe4402b9580063"><param name="Name" value="fors_img_sky_flat_exec"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga9915858245e022e3ac1cb131e4a19649"><param name="Name" value="fors_img_sky_flat_name"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga4992cec4632dfdcab3c4830a341f8095"><param name="Name" value="fors_img_sky_flat_author"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga02c59acaaf71d4b2e9b4df6e5a452695"><param name="Name" value="fors_img_sky_flat_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga61b98b9ade434fed2b939774f5c6c7eb"><param name="Name" value="fors_img_sky_flat_define_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#gaab19885d0f8b55663a425a4609791e9c"><param name="Name" value="fors_img_sky_flat_description"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga7d9766834c42d36a3fbd7d442371bb3a"><param name="Name" value="fors_img_sky_flat_description_short"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga7182fc139ef9c00488f2df5e96be18b3"><param name="Name" value="fors_img_sky_flat_destroy"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga8a867c569bd5f246c161b80fe49eef79"><param name="Name" value="fors_img_sky_flat_email"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga3cf0bca5c79ec81295fe4402b9580063"><param name="Name" value="fors_img_sky_flat_exec"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#ga9915858245e022e3ac1cb131e4a19649"><param name="Name" value="fors_img_sky_flat_name"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat__test.html"><param name="Name" value="fors_img_sky_flat_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat__test.html#ga885513ffa26feb33dd89087279376767"><param name="Name" value="test_img_sky_flat"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga482937cec6053ed6fa0fd8d7d3e3932e"><param name="Name" value="fors_matrix_append_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c"><param name="Name" value="fors_matrix_null"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga9bc8b28c29504fc9005fe9745b18450b"><param name="Name" value="fors_mos_is_lss_like"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gae98c540953f671b35817aac071aa4adc"><param name="Name" value="fors_msg_macro"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42"><param name="Name" value="fors_parameterlist_set_defaults"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pattern__test.html"><param name="Name" value="fors_pattern unit tests"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pattern__test.html"><param name="Name" value="fors_pattern_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pattern__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pattern__test.html#ga05781d2ba3b01b5ddbc4dd9dfe0eda77"><param name="Name" value="test_pattern"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html"><param name="Name" value="fors_pfits"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f"><param name="Name" value="FORS_PFITS_CONAD"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1"><param name="Name" value="FORS_PFITS_RON"></OBJECT>
-  </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g71645af45bc192964d3170f28c671240"><param name="Name" value="fors_angle_diff"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g040f45f5810f9ac8b6cf4d0b05b18757"><param name="Name" value="fors_begin"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#g0eef24525a05bf717023a0380e5931b2"><param name="Name" value="fors_bias"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#g7eae9b8d1a50b0e1b4f13e652b2b2510"><param name="Name" value="fors_bias_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#g4a662bfaa15a38c6190fe7ba15ff1bf9"><param name="Name" value="fors_bias_define_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gc1284becbd1c69542318bd9d410756c0"><param name="Name" value="fors_bias_description"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gbac19e9fec13b72b6b5cf2f7bb5cf67c"><param name="Name" value="fors_bias_destroy"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gf051ed22200bb5eafa1ce68561ff89ad"><param name="Name" value="fors_bias_exec"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43"><param name="Name" value="fors_cpl_wcs_delete"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#g8d23e487c941ebc5b4d30a113f9dc324"><param name="Name" value="fors_cpl_wcs_fitsstr2plist"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#g1ff77ef3ec6654b60865ff114ffb0194"><param name="Name" value="fors_cpl_wcs_init"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ge66dce7f4ef9d442dd849595f39b82bf"><param name="Name" value="fors_cpl_wcs_plist2fitsstr"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g8138511b64d1d365e21b56eb161f2028"><param name="Name" value="fors_create_sources_table"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#g605a72777b8ade477948b511ec213dba"><param name="Name" value="fors_dark"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gd82957e2524a2c840c990e6f6ac7a3f7"><param name="Name" value="fors_dark_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#g41900339775a0440158f71fab8e4fe73"><param name="Name" value="fors_dark_define_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#g6ca1a4a04494b527e073c4fcfc78d074"><param name="Name" value="fors_dark_description"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#g0ae3039ae17bbc8695285b04dab01340"><param name="Name" value="fors_dark_destroy"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gb03c103664e7d1ac06cf5819293024da"><param name="Name" value="fors_dark_exec"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g27249fb4bf764484d9f553c100e2e2b8"><param name="Name" value="fors_delete_star_lists"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gea45a5b73ab086e5e08680928adbd0cd"><param name="Name" value="fors_dfs_add_exptime"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#geb1068e007bd0ebef0cd4a6aa12cf523"><param name="Name" value="fors_dfs_add_wcs"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g61956e9dcf77f5c71db911e0390f63f3"><param name="Name" value="fors_dfs_pipeline_version"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g810ca5e9d6f0af849344d0b5f60f3cf1"><param name="Name" value="fors_dfs_save_image"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gf9fc39acdf17a36a3c8aa7d8f008ae42"><param name="Name" value="fors_dfs_save_table"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#g37d74636b6c3f3d52b0312ce3a58e59d"><param name="Name" value="fors_dfs_set_groups"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gf9d99ef6ed250a731bd0a74eba3d6295"><param name="Name" value="fors_end"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1"><param name="Name" value="fors_extract"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#gcdd189ebaad6fe5c20ac2dea2eb06dfe"><param name="Name" value="fors_extract_check_sex_flag"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#g2c649f2f8802860d4693e38bd640032c"><param name="Name" value="fors_extract_check_sex_star"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#gd07fd085541e8be0723f2932a29abdb3"><param name="Name" value="fors_extract_define_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#g1f3f1af725e7b5fb1c770507eab8ac09"><param name="Name" value="fors_extract_method_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gedafdf97c6e7c236d39fe16f9c459953"><param name="Name" value="fors_fits_compare_string"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g5637ecda70fb6aeab5c0b22dec2e2e10"><param name="Name" value="fors_fixed_pattern_noise"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g2e2a80069157183a808349976b3e455a"><param name="Name" value="fors_fixed_pattern_noise_bias"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gc219cfea8dd4f3c5a0aceb222d19150a"><param name="Name" value="fors_frame_get_group_string"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gc02f8fba22227907e45bdcbe6de8655e"><param name="Name" value="fors_frame_get_level_string"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gf509a28ce04d6804eabe62b2a5817afe"><param name="Name" value="fors_frame_get_type_string"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g375049f68639265267adcdc11d161bc3"><param name="Name" value="fors_frame_print"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a"><param name="Name" value="fors_frameset_extract"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gc1181b0023db290ca5bfc42e9980e3a8"><param name="Name" value="fors_frameset_print"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437"><param name="Name" value="fors_get_airmass"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69"><param name="Name" value="fors_get_license"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2"><param name="Name" value="fors_get_version_binary"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc"><param name="Name" value="fors_header_write_double"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g3732f2464bb007412951345e03594a17"><param name="Name" value="fors_header_write_string"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g879f2fc7b296f37722f6203d0ead78b6"><param name="Name" value="fors_identify"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g62b335e73ad633535e1494f9ffd0cd03"><param name="Name" value="fors_identify_define_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g2763139bd0ceba14e3be219d5d043e46"><param name="Name" value="fors_identify_method_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g5ac7cb865a07bab1987284dba3676ceb"><param name="Name" value="fors_image_abs"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g4154f529cbabe4cb4d1203d03e771f8a"><param name="Name" value="fors_image_collapse_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g9f084a5b4f1564f1efb645e342eee2af"><param name="Name" value="fors_image_collapse_ksigma_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gbd2b7e8761473ff4ca42f90fa879e1ad"><param name="Name" value="fors_image_collapse_median_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gfe360dbc95e94b6b1043401aef8cbacc"><param name="Name" value="fors_image_collapse_minmax_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2"><param name="Name" value="fors_image_crop"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903"><param name="Name" value="fors_image_delete"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6"><param name="Name" value="fors_image_delete_const"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4"><param name="Name" value="fors_image_divide"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g4c8774a9e651df6d05689d208fb349e1"><param name="Name" value="fors_image_divide_noerr"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff"><param name="Name" value="fors_image_divide_scalar"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g5b5539c0e15fe20c16bedc58e8263724"><param name="Name" value="fors_image_draw"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655"><param name="Name" value="fors_image_duplicate"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g78afca4bf8e5c3dc80d0dcd7f682f9e9"><param name="Name" value="fors_image_exponential"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g315f5476160ed7db282a7623f0d354b0"><param name="Name" value="fors_image_filter_max_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g96498be3e15cde80921709406c33b6f3"><param name="Name" value="fors_image_filter_median_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gdffe6405bb64c769dfcdf71c6a281dad"><param name="Name" value="fors_image_get_data_const"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0"><param name="Name" value="fors_image_get_error_mean"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g5c7d9b043db23a40e632ffc34c3f3d5c"><param name="Name" value="fors_image_get_max"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3"><param name="Name" value="fors_image_get_mean"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21"><param name="Name" value="fors_image_get_median"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gc4edb9a966bcf97a17ad6a5c1b9d020f"><param name="Name" value="fors_image_get_min"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03"><param name="Name" value="fors_image_get_size_x"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7"><param name="Name" value="fors_image_get_size_y"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257"><param name="Name" value="fors_image_get_stdev"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b"><param name="Name" value="fors_image_get_stdev_robust"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410"><param name="Name" value="fors_image_load"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a"><param name="Name" value="fors_image_load_list"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gab0a6629f36c4db609f1a1515d602477"><param name="Name" value="fors_image_load_list_const"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g15f95ab361e6c2ea44bafbada5d8d4a1"><param name="Name" value="fors_image_multiply"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g0769427c961bdf0fd79eda47fcadeee2"><param name="Name" value="fors_image_multiply_noerr"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g077f7a5a847fa9c0e458dca2e12e4e6f"><param name="Name" value="fors_image_multiply_scalar"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65"><param name="Name" value="fors_image_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42"><param name="Name" value="fors_image_save"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g1ddf7d1b81954a8d2113e4f5174301a8"><param name="Name" value="fors_image_save_sex"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g18f269421a43f46c063b667fac72c938"><param name="Name" value="fors_image_square"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712"><param name="Name" value="fors_image_subtract"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g50a06b605ca558553e0642209b93c100"><param name="Name" value="fors_image_subtract_scalar"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g833fbeca7835f9c594deb0a8752d8b74"><param name="Name" value="fors_imagelist_collapse_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g2d1787d975000e60e8790fc656d538f6"><param name="Name" value="fors_imagelist_collapse_median_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#gc6a3f5a41cacfa91711e127f612fa064"><param name="Name" value="fors_img_science"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g8f20063c6ace32082add0a55898badd5"><param name="Name" value="fors_img_science_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g9391a3b278d25edc38af3cb70db34597"><param name="Name" value="fors_img_science_define_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g74ec08d9ca0bb98b7d31fc7609531e90"><param name="Name" value="fors_img_science_description"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g034dd2408c1d19371c8f0da3f2ac0ea1"><param name="Name" value="fors_img_science_destroy"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g346ce5737ecd8c688f1f9cd39eda56db"><param name="Name" value="fors_img_science_exec"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g6ada02347c7648aaa61ce6bc000910e5"><param name="Name" value="fors_img_screen_flat"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g4f7674508424db7a7b62d5a8772bb3cc"><param name="Name" value="fors_img_screen_flat_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g8bd60f1e1c99dff8aa58da8d21eeeb02"><param name="Name" value="fors_img_screen_flat_define_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g584ddcde63f204f4110497cab0e49075"><param name="Name" value="fors_img_screen_flat_description"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gc5ff969a1df38b9da80ab308f823132d"><param name="Name" value="fors_img_screen_flat_description_short"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g4ee16c004f65246f0c474d1c4f5516a8"><param name="Name" value="fors_img_screen_flat_destroy"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gcdfb37251e245fe82da375ba0725a3cb"><param name="Name" value="fors_img_screen_flat_exec"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#g46d79972dcc1d750bb362f17bd454517"><param name="Name" value="fors_img_sky_flat"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#g2fd81ec014584d5e4812ceec9fced368"><param name="Name" value="fors_img_sky_flat_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#gec7c64a6e66a6461f399baba1d71640c"><param name="Name" value="fors_img_sky_flat_define_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#g6e7c504f168bc6f8319b544b066ceb85"><param name="Name" value="fors_img_sky_flat_description"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#g41907dc5910fef4332bc850d202cdf0a"><param name="Name" value="fors_img_sky_flat_destroy"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#g73801ec3f11f5acf82354dce429c7364"><param name="Name" value="fors_img_sky_flat_exec"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3"><param name="Name" value="fors_matrix_null"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ge561fe29b3673b34094804e26ece5e8e"><param name="Name" value="fors_msg_macro"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4"><param name="Name" value="fors_parameterlist_set_defaults"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f"><param name="Name" value="FORS_PFITS_CONAD"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1"><param name="Name" value="FORS_PFITS_RON"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g78298a3adaf4b775f4a48a21a2b475ba"><param name="Name" value="fors_photometry"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g951ded14339fa018b98cbf21a332c7cf"><param name="Name" value="fors_photometry_atm_ext_create_index_by_identifier"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g1491e01ccadf9b6d6b85316dfffd7f86"><param name="Name" value="fors_photometry_atm_ext_create_indices"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga3a88672675c12a7d6f30f9e6cc1459a"><param name="Name" value="fors_photometry_atm_ext_print_index_by_framename"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g7a7ad98c36de98c254af8f74f436a347"><param name="Name" value="fors_photometry_check_fitparam_atm_ext"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gfe5618566936c6f9809d639f9148ce4d"><param name="Name" value="fors_photometry_check_input_value"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gbb6ba893e672e51a2a83674b93fe4733"><param name="Name" value="fors_photometry_count_observations"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g8caa3f3d513a15a26c0d6e55a17370e3"><param name="Name" value="fors_photometry_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gecc363f8be41aa6d224d6f604d5a6b30"><param name="Name" value="fors_photometry_define_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ge8d0a82d52e920497d6a5efd435760c6"><param name="Name" value="fors_photometry_define_polyf"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga8ebd4e57d8df9c4fb26a5ea59d52182"><param name="Name" value="fors_photometry_define_polyp"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g1e4c46bbe3d698da29ad2ca40f5c70cf"><param name="Name" value="fors_photometry_description"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gad02467f38136c506fb860db14783156"><param name="Name" value="fors_photometry_destroy"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g71aac253b19e8883e79cfbce6b73076a"><param name="Name" value="fors_photometry_exec"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g294b0010ae795af85c28da476abadb18"><param name="Name" value="fors_photometry_get_night_id"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g105a6893a27ad23d6ef02cc271f42c30"><param name="Name" value="fors_photometry_get_timezone_observer"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga9ee56261da033d2a3ff241a68569522"><param name="Name" value="fors_photometry_poly_new_from_coefficients"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gd9e3544d21c84d8a62c36b859b2a4bcf"><param name="Name" value="fors_photometry_read_input"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g99be8a6361832a8a2592304da84bc62b"><param name="Name" value="fors_photometry_read_input_listinsert_star_if_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gb82262e58905a5f0d047cf607614aa6d"><param name="Name" value="fors_photometry_remove_unnecessary"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga0cc7efe0e414be58536c6f4adffda19d"><param name="Name" value="FORS_PFITS_AIRMASS_END"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gae700b45ddce378b17fbd0a6ff922d0cc"><param name="Name" value="FORS_PFITS_AIRMASS_START"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga10e60924de718611ddee862ad3efaab4"><param name="Name" value="FORS_PFITS_BINX"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gacd25ac95b9c638619ce728f328294797"><param name="Name" value="FORS_PFITS_BINY"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gaa64fd69c327bac649a12a30ffe7ba1ac"><param name="Name" value="FORS_PFITS_CHIP_ID"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga383aa82fd05b4557317d3ee00a151892"><param name="Name" value="FORS_PFITS_CONAD"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga9260ba6382e80e34fcb62cf6820344d9"><param name="Name" value="FORS_PFITS_CRPIX1"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga2f7430c73e4f0930f46f4cb7d4931b52"><param name="Name" value="FORS_PFITS_CRPIX2"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga7b94ea972697ac22634885b9faa7e7da"><param name="Name" value="FORS_PFITS_DET_NX"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga71e9d8f4f7af8b85c57262318f2b187c"><param name="Name" value="FORS_PFITS_DET_NY"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga645edb4dac8c2cac1e0229bb4e220dca"><param name="Name" value="FORS_PFITS_EXPOSURE_TIME"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga84c70df1a23772caf2b2d3accdd21924"><param name="Name" value="FORS_PFITS_FILTER_NAME"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga9bf38cb93214f1101cb90c6158111719"><param name="Name" value="FORS_PFITS_INSTRUME"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga346dee1941b5edbc89239af2e889ec15"><param name="Name" value="FORS_PFITS_OUTPUTS"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gab662a9e7be3ddd8e28631d86e0ff1adb"><param name="Name" value="FORS_PFITS_OVERSCANX"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga3c4eb0acf69fcc5e2e1c793fb7cb22e3"><param name="Name" value="FORS_PFITS_OVERSCANY"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga29dfe18bfd9e81ccc07498a70a644487"><param name="Name" value="FORS_PFITS_PIXSCALE"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gab8c5950ecbdf77455836691453bd426c"><param name="Name" value="FORS_PFITS_PRESCANX"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gafc9fa2200da3dddfeac042d6f6a81c4d"><param name="Name" value="FORS_PFITS_PRESCANY"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga15a96bee16194fbf57ed99701b5ef354"><param name="Name" value="FORS_PFITS_READ_CLOCK"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gac15bb02243c43ef1f7c1c018981439c7"><param name="Name" value="FORS_PFITS_RON"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga2766699b9cde09e660d636b7c29f8896"><param name="Name" value="FORS_PFITS_TARG_NAME"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga0cc7efe0e414be58536c6f4adffda19d"><param name="Name" value="FORS_PFITS_AIRMASS_END"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gae700b45ddce378b17fbd0a6ff922d0cc"><param name="Name" value="FORS_PFITS_AIRMASS_START"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga10e60924de718611ddee862ad3efaab4"><param name="Name" value="FORS_PFITS_BINX"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gacd25ac95b9c638619ce728f328294797"><param name="Name" value="FORS_PFITS_BINY"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gaa64fd69c327bac649a12a30ffe7ba1ac"><param name="Name" value="FORS_PFITS_CHIP_ID"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga383aa82fd05b4557317d3ee00a151892"><param name="Name" value="FORS_PFITS_CONAD"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga9260ba6382e80e34fcb62cf6820344d9"><param name="Name" value="FORS_PFITS_CRPIX1"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga2f7430c73e4f0930f46f4cb7d4931b52"><param name="Name" value="FORS_PFITS_CRPIX2"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga7b94ea972697ac22634885b9faa7e7da"><param name="Name" value="FORS_PFITS_DET_NX"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga71e9d8f4f7af8b85c57262318f2b187c"><param name="Name" value="FORS_PFITS_DET_NY"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga645edb4dac8c2cac1e0229bb4e220dca"><param name="Name" value="FORS_PFITS_EXPOSURE_TIME"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga84c70df1a23772caf2b2d3accdd21924"><param name="Name" value="FORS_PFITS_FILTER_NAME"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga9bf38cb93214f1101cb90c6158111719"><param name="Name" value="FORS_PFITS_INSTRUME"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga346dee1941b5edbc89239af2e889ec15"><param name="Name" value="FORS_PFITS_OUTPUTS"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gab662a9e7be3ddd8e28631d86e0ff1adb"><param name="Name" value="FORS_PFITS_OVERSCANX"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga3c4eb0acf69fcc5e2e1c793fb7cb22e3"><param name="Name" value="FORS_PFITS_OVERSCANY"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga29dfe18bfd9e81ccc07498a70a644487"><param name="Name" value="FORS_PFITS_PIXSCALE"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gab8c5950ecbdf77455836691453bd426c"><param name="Name" value="FORS_PFITS_PRESCANX"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gafc9fa2200da3dddfeac042d6f6a81c4d"><param name="Name" value="FORS_PFITS_PRESCANY"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga15a96bee16194fbf57ed99701b5ef354"><param name="Name" value="FORS_PFITS_READ_CLOCK"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#gac15bb02243c43ef1f7c1c018981439c7"><param name="Name" value="FORS_PFITS_RON"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pfits.html#ga2766699b9cde09e660d636b7c29f8896"><param name="Name" value="FORS_PFITS_TARG_NAME"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html"><param name="Name" value="fors_photometry"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gac6b3dfce12019667f63bc05e12093dac"><param name="Name" value="arcsec_tol"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gabfcabff5102d27ba7b09e4398e057762"><param name="Name" value="build_equations_lhs_matrix_from_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga43e3c1d13157092f683e6d4912cd71d2"><param name="Name" value="build_equations_lhs_matrix_from_poly"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga5e4afe6326f0bb9c748fed2286c8c835"><param name="Name" value="build_equations_rhs_cov"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gad105fc9ee5d1d81f7c37d1cb17559a18"><param name="Name" value="entry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga5a7208d2d524a7660f3e57e269b7305f"><param name="Name" value="entry_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga24e72dc7095e56d37033c584bd279f13"><param name="Name" value="entry_delete_but_standard"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga39efe1039b737efd95d51e5dbceb776b"><param name="Name" value="entry_get_powers_airmass_color"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga8c955a5540838142f16b310451048f6b"><param name="Name" value="entry_get_powers_x_y"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaf8c135834cc51bd767a6956346885958"><param name="Name" value="entry_list_print"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga0a8c8c9ebad2d55ac56e61c820fa3f27"><param name="Name" value="entry_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga2271cd483d1b8537a0513251799faaed"><param name="Name" value="fors_delete_star_lists"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga44fc592c11aa7e15ea516df8b1a55fdb"><param name="Name" value="fors_fit_ncoeff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga8914070dcfeab65bad628175b5522d62"><param name="Name" value="fors_fit_ncoeff_paropts"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga37834a5427d4d460953d5b818ea79ffa"><param name="Name" value="fors_fits_compare_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga482937cec6053ed6fa0fd8d7d3e3932e"><param name="Name" value="fors_matrix_append_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga61a65cb67f17d5ddb21dd8b141659b5c"><param name="Name" value="fors_matrix_null"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gae18d6d686eec800da9538ee3c533aed7"><param name="Name" value="fors_photometry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga99162f1059bac4baf47022904832e6ca"><param name="Name" value="fors_photometry_adjust_fit_mag_flags"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gac8322b086764e1db46e5c9d72263a251"><param name="Name" value="fors_photometry_atm_ext_create_index_by_identifier"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gafecdbeccb909ad2d152a857cfd10c2c0"><param name="Name" value="fors_photometry_atm_ext_create_indices"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaadcf6d1ce33dbed7ae0cbd24d675562f"><param name="Name" value="fors_photometry_atm_ext_print_index_by_framename"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gac6f46cad39ef72e218e343764932216f"><param name="Name" value="fors_photometry_author"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga750adc75acb9310f8dde5fb067a356e9"><param name="Name" value="fors_photometry_check_fitparam_atm_ext"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga104fe70d8a535ae244e71f6b16dcaf5d"><param name="Name" value="fors_photometry_check_input_value"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga182915aa06bfd142318b3c9443a80e80"><param name="Name" value="fors_photometry_count_observations"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaefb8747dfc072489e0c49686e235db79"><param name="Name" value="fors_photometry_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga4b3a00d660ccc7d889875a00fb629be5"><param name="Name" value="fors_photometry_define_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaa9757bbaea210d70edf5874682ec6660"><param name="Name" value="fors_photometry_define_polyf"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga8d413c86621fd2b2e37b6174e935d082"><param name="Name" value="fors_photometry_define_polyp"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaac101f33b12a7432e9b4d5ae6143326f"><param name="Name" value="fors_photometry_description"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gab75492628e8de3301142ea901de2c082"><param name="Name" value="fors_photometry_description_short"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gae31960fe5e90f545420ff2f50c33f0a4"><param name="Name" value="fors_photometry_destroy"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga6ea31223abebdf7226188f47a51c073c"><param name="Name" value="fors_photometry_email"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaa3f56f38e97f7b8afe2cc18c5e9f3a6d"><param name="Name" value="fors_photometry_exec"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaf800d130ebeddcf3e8a655cf0c305f47"><param name="Name" value="fors_photometry_get_night_id"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga1ac67d0a2f318cd599a5be4a05a8b4b1"><param name="Name" value="fors_photometry_get_timezone_observer"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga7c0052dbc5fb57a5f2a7aa1aaee81711"><param name="Name" value="fors_photometry_name"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga7f2d61505c17bdf8c7adfd1cac8ac842"><param name="Name" value="fors_photometry_parameter_get_ncoeff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga5a47fe64af3dc9bb9d02fe47cc09066c"><param name="Name" value="fors_photometry_parameter_get_num"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga4f8eb79af9ba0ee00be1e4925a64eb2d"><param name="Name" value="fors_photometry_parameter_get_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga07a5f25084d3a57c92743262a41e0366"><param name="Name" value="fors_photometry_poly_new_from_coefficients"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gabe32026b38c8d511f76b7f1008941f71"><param name="Name" value="fors_photometry_read_input"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gabffbeb12c88498ed45e6115a1b529c07"><param name="Name" value="fors_photometry_read_input_listinsert_star_if_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga6e8831942438a88bb3287ed491961ec1"><param name="Name" value="fors_photometry_remove_unnecessary"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gad81190e832f9024944d01b895e619795"><param name="Name" value="fors_property_get_num"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gac0830324b91c374088872a18c876bc34"><param name="Name" value="LIST_DEFINE"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gadb231bfc44ec37423962ea7f563a458b"><param name="Name" value="LIST_ELEM"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaea9cb9001e8b6630c660038e0bc5eb39"><param name="Name" value="solve_normal"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga99162f1059bac4baf47022904832e6ca"><param name="Name" value="fors_photometry_adjust_fit_mag_flags"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gac8322b086764e1db46e5c9d72263a251"><param name="Name" value="fors_photometry_atm_ext_create_index_by_identifier"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gafecdbeccb909ad2d152a857cfd10c2c0"><param name="Name" value="fors_photometry_atm_ext_create_indices"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaadcf6d1ce33dbed7ae0cbd24d675562f"><param name="Name" value="fors_photometry_atm_ext_print_index_by_framename"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gac6f46cad39ef72e218e343764932216f"><param name="Name" value="fors_photometry_author"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga750adc75acb9310f8dde5fb067a356e9"><param name="Name" value="fors_photometry_check_fitparam_atm_ext"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga104fe70d8a535ae244e71f6b16dcaf5d"><param name="Name" value="fors_photometry_check_input_value"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga182915aa06bfd142318b3c9443a80e80"><param name="Name" value="fors_photometry_count_observations"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaefb8747dfc072489e0c49686e235db79"><param name="Name" value="fors_photometry_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga4b3a00d660ccc7d889875a00fb629be5"><param name="Name" value="fors_photometry_define_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaa9757bbaea210d70edf5874682ec6660"><param name="Name" value="fors_photometry_define_polyf"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga8d413c86621fd2b2e37b6174e935d082"><param name="Name" value="fors_photometry_define_polyp"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaac101f33b12a7432e9b4d5ae6143326f"><param name="Name" value="fors_photometry_description"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gab75492628e8de3301142ea901de2c082"><param name="Name" value="fors_photometry_description_short"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gae31960fe5e90f545420ff2f50c33f0a4"><param name="Name" value="fors_photometry_destroy"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga6ea31223abebdf7226188f47a51c073c"><param name="Name" value="fors_photometry_email"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaa3f56f38e97f7b8afe2cc18c5e9f3a6d"><param name="Name" value="fors_photometry_exec"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaf800d130ebeddcf3e8a655cf0c305f47"><param name="Name" value="fors_photometry_get_night_id"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga1ac67d0a2f318cd599a5be4a05a8b4b1"><param name="Name" value="fors_photometry_get_timezone_observer"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga7c0052dbc5fb57a5f2a7aa1aaee81711"><param name="Name" value="fors_photometry_name"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga7f2d61505c17bdf8c7adfd1cac8ac842"><param name="Name" value="fors_photometry_parameter_get_ncoeff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga5a47fe64af3dc9bb9d02fe47cc09066c"><param name="Name" value="fors_photometry_parameter_get_num"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga4f8eb79af9ba0ee00be1e4925a64eb2d"><param name="Name" value="fors_photometry_parameter_get_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga07a5f25084d3a57c92743262a41e0366"><param name="Name" value="fors_photometry_poly_new_from_coefficients"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gabe32026b38c8d511f76b7f1008941f71"><param name="Name" value="fors_photometry_read_input"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gabffbeb12c88498ed45e6115a1b529c07"><param name="Name" value="fors_photometry_read_input_listinsert_star_if_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga6e8831942438a88bb3287ed491961ec1"><param name="Name" value="fors_photometry_remove_unnecessary"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html"><param name="Name" value="fors_point unit tests"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gbaf354a8aaff372ed3502ef79702a9ce"><param name="Name" value="fors_point_delete"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#g2be6ad652538b2829b762dc58c61aa65"><param name="Name" value="fors_point_distsq"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gc5a8341742fc371f6e7332600286045e"><param name="Name" value="fors_point_duplicate"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#g5f09413dd7958d3ebbe1ba7700b27377"><param name="Name" value="fors_point_equal"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gcf03321efac4311c0fcee0674c197a83"><param name="Name" value="fors_point_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679"><param name="Name" value="fors_polynomial_count_coeff"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga116e293092bfb1db2c5e90504e90cc0"><param name="Name" value="fors_polynomial_create_variance_polynomial"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb"><param name="Name" value="fors_polynomial_dump"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5"><param name="Name" value="fors_polynomial_is_coeff_set"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0"><param name="Name" value="fors_polynomial_powers_find_first_coeff"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073"><param name="Name" value="fors_polynomial_powers_find_next_coeff"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g5d5e2697050554c599837146744408fc"><param name="Name" value="fors_polynomial_powers_next"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g2255e6cc731c54c6b5575e506bd5fea8"><param name="Name" value="fors_polynomial_set_existing_coeff"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g54a749f0fe51db3713c776ffe5dd0b57"><param name="Name" value="fors_polynomial_sprint_coeff"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03"><param name="Name" value="fors_qc_end_group"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g44d5359f81302747fff155c168c88200"><param name="Name" value="fors_qc_keyword_to_paf"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b"><param name="Name" value="fors_qc_start_group"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g033fc0f2f9e321c4ac98ee7f412b2c6e"><param name="Name" value="fors_qc_write_double"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g1ccea526719a1be6c14de81963d81955"><param name="Name" value="fors_qc_write_group_heading"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38"><param name="Name" value="fors_qc_write_qc_double"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga4480637fba9623895546614d7a21fb5"><param name="Name" value="fors_qc_write_qc_string"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4"><param name="Name" value="fors_qc_write_string"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044"><param name="Name" value="fors_rand_gauss"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html"><param name="Name" value="fors_recipe Recipe"></OBJECT>
-  <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gb269a10fede882f376f2e599965cebe4"><param name="Name" value="build_equations_lhs_matrix_from_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g55817cb490a2517ef207f96a9cf51b8b"><param name="Name" value="build_equations_lhs_matrix_from_poly"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ge2d3cb795a4f549322f1febff5596787"><param name="Name" value="build_equations_rhs_cov"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gff8105d58698d673632960edbd21f26c"><param name="Name" value="entry_delete"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g704bbcab4ba8418ff88419511eb5092b"><param name="Name" value="entry_delete_but_standard"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g62dd2afbab9508f260ddcc65d8e00f80"><param name="Name" value="entry_list_print"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gc4cfb3c0bdf31be44324adffdb6277a1"><param name="Name" value="entry_new"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#g0eef24525a05bf717023a0380e5931b2"><param name="Name" value="fors_bias"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#g7eae9b8d1a50b0e1b4f13e652b2b2510"><param name="Name" value="fors_bias_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#g4a662bfaa15a38c6190fe7ba15ff1bf9"><param name="Name" value="fors_bias_define_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gc1284becbd1c69542318bd9d410756c0"><param name="Name" value="fors_bias_description"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gbac19e9fec13b72b6b5cf2f7bb5cf67c"><param name="Name" value="fors_bias_destroy"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gf051ed22200bb5eafa1ce68561ff89ad"><param name="Name" value="fors_bias_exec"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#g605a72777b8ade477948b511ec213dba"><param name="Name" value="fors_dark"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gd82957e2524a2c840c990e6f6ac7a3f7"><param name="Name" value="fors_dark_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#g41900339775a0440158f71fab8e4fe73"><param name="Name" value="fors_dark_define_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#g6ca1a4a04494b527e073c4fcfc78d074"><param name="Name" value="fors_dark_description"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#g0ae3039ae17bbc8695285b04dab01340"><param name="Name" value="fors_dark_destroy"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark.html#gb03c103664e7d1ac06cf5819293024da"><param name="Name" value="fors_dark_exec"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g27249fb4bf764484d9f553c100e2e2b8"><param name="Name" value="fors_delete_star_lists"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gedafdf97c6e7c236d39fe16f9c459953"><param name="Name" value="fors_fits_compare_string"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#gc6a3f5a41cacfa91711e127f612fa064"><param name="Name" value="fors_img_science"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g8f20063c6ace32082add0a55898badd5"><param name="Name" value="fors_img_science_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g9391a3b278d25edc38af3cb70db34597"><param name="Name" value="fors_img_science_define_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g74ec08d9ca0bb98b7d31fc7609531e90"><param name="Name" value="fors_img_science_description"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g034dd2408c1d19371c8f0da3f2ac0ea1"><param name="Name" value="fors_img_science_destroy"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g346ce5737ecd8c688f1f9cd39eda56db"><param name="Name" value="fors_img_science_exec"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g6ada02347c7648aaa61ce6bc000910e5"><param name="Name" value="fors_img_screen_flat"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g4f7674508424db7a7b62d5a8772bb3cc"><param name="Name" value="fors_img_screen_flat_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g8bd60f1e1c99dff8aa58da8d21eeeb02"><param name="Name" value="fors_img_screen_flat_define_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g584ddcde63f204f4110497cab0e49075"><param name="Name" value="fors_img_screen_flat_description"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gc5ff969a1df38b9da80ab308f823132d"><param name="Name" value="fors_img_screen_flat_description_short"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g4ee16c004f65246f0c474d1c4f5516a8"><param name="Name" value="fors_img_screen_flat_destroy"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gcdfb37251e245fe82da375ba0725a3cb"><param name="Name" value="fors_img_screen_flat_exec"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#g46d79972dcc1d750bb362f17bd454517"><param name="Name" value="fors_img_sky_flat"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#g2fd81ec014584d5e4812ceec9fced368"><param name="Name" value="fors_img_sky_flat_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#gec7c64a6e66a6461f399baba1d71640c"><param name="Name" value="fors_img_sky_flat_define_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#g6e7c504f168bc6f8319b544b066ceb85"><param name="Name" value="fors_img_sky_flat_description"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#g41907dc5910fef4332bc850d202cdf0a"><param name="Name" value="fors_img_sky_flat_destroy"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat.html#g73801ec3f11f5acf82354dce429c7364"><param name="Name" value="fors_img_sky_flat_exec"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g1b0d171c916a3003f4deaf262ed733b3"><param name="Name" value="fors_matrix_null"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g78298a3adaf4b775f4a48a21a2b475ba"><param name="Name" value="fors_photometry"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g951ded14339fa018b98cbf21a332c7cf"><param name="Name" value="fors_photometry_atm_ext_create_index_by_identifier"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g1491e01ccadf9b6d6b85316dfffd7f86"><param name="Name" value="fors_photometry_atm_ext_create_indices"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga3a88672675c12a7d6f30f9e6cc1459a"><param name="Name" value="fors_photometry_atm_ext_print_index_by_framename"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g7a7ad98c36de98c254af8f74f436a347"><param name="Name" value="fors_photometry_check_fitparam_atm_ext"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gfe5618566936c6f9809d639f9148ce4d"><param name="Name" value="fors_photometry_check_input_value"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gbb6ba893e672e51a2a83674b93fe4733"><param name="Name" value="fors_photometry_count_observations"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g8caa3f3d513a15a26c0d6e55a17370e3"><param name="Name" value="fors_photometry_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gecc363f8be41aa6d224d6f604d5a6b30"><param name="Name" value="fors_photometry_define_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ge8d0a82d52e920497d6a5efd435760c6"><param name="Name" value="fors_photometry_define_polyf"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga8ebd4e57d8df9c4fb26a5ea59d52182"><param name="Name" value="fors_photometry_define_polyp"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g1e4c46bbe3d698da29ad2ca40f5c70cf"><param name="Name" value="fors_photometry_description"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gad02467f38136c506fb860db14783156"><param name="Name" value="fors_photometry_destroy"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g71aac253b19e8883e79cfbce6b73076a"><param name="Name" value="fors_photometry_exec"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g294b0010ae795af85c28da476abadb18"><param name="Name" value="fors_photometry_get_night_id"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g105a6893a27ad23d6ef02cc271f42c30"><param name="Name" value="fors_photometry_get_timezone_observer"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#ga9ee56261da033d2a3ff241a68569522"><param name="Name" value="fors_photometry_poly_new_from_coefficients"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gd9e3544d21c84d8a62c36b859b2a4bcf"><param name="Name" value="fors_photometry_read_input"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#g99be8a6361832a8a2592304da84bc62b"><param name="Name" value="fors_photometry_read_input_listinsert_star_if_new"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gb82262e58905a5f0d047cf607614aa6d"><param name="Name" value="fors_photometry_remove_unnecessary"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#g9de4437d5a4d68fdd594724e002b8388"><param name="Name" value="fors_recipe_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#g351e58c2312f291e40fc17e8d9e09982"><param name="Name" value="fors_recipe_destroy"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#g2e82215d74913efed45e3dce601076aa"><param name="Name" value="fors_recipe_exec"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gffa00ce29ad3796187cf1336e4fcbb61"><param name="Name" value="fors_zeropoint"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g3222d4735fe218be5da224f3a146580b"><param name="Name" value="fors_zeropoint_astrometry"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g2ea192495f55d98f1068cae2b1921cea"><param name="Name" value="fors_zeropoint_astrometry_apply_unidentified_xy2radec"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g5a8ae7f99786a3fdc7df6a07d90d905c"><param name="Name" value="fors_zeropoint_astrometry_get_wcs_shift_px"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gd1a70566b3bf818a95a6c3e2312d0710"><param name="Name" value="fors_zeropoint_astrometry_shift_wcs_origin"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gb81bff380e7ee1d22c3c6620620771bf"><param name="Name" value="fors_zeropoint_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gc2cbbec604bd9b8cabf9f83fe71037da"><param name="Name" value="fors_zeropoint_define_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g69cec4407efc0bcccde712800aaa577c"><param name="Name" value="fors_zeropoint_description"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g095db561f9e785a5a4114d97f4597baf"><param name="Name" value="fors_zeropoint_destroy"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g06887d7be84289a1ec9c7b7350e69412"><param name="Name" value="fors_zeropoint_errorstate_dump_as_warning"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g9aa95cb40ce84db79ab3006d51e7059d"><param name="Name" value="fors_zeropoint_exec"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g2d7fe71bb7c47e2284dea7e2732650fb"><param name="Name" value="get_image_quality"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gfd13851752bdf8327fb014e47c6bb104"><param name="Name" value="get_zeropoint"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#gded70f366457b7e7915dc906a4d50a45"><param name="Name" value="is_star"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g75a60ee291780e6bbaeeb68313c112f0"><param name="Name" value="remove_large_scale"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g34064d266d0016050844a2e2c9e1a59c"><param name="Name" value="remove_large_scale_fit"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gff8fa4d76051acfba7263b22a5bc06c3"><param name="Name" value="write_qc"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g5ce973af397768a6d73de2a88b0d2ab3"><param name="Name" value="zeropoint_inside"></OBJECT>
-  </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#g9de4437d5a4d68fdd594724e002b8388"><param name="Name" value="fors_recipe_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#g351e58c2312f291e40fc17e8d9e09982"><param name="Name" value="fors_recipe_destroy"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#g2e82215d74913efed45e3dce601076aa"><param name="Name" value="fors_recipe_exec"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7"><param name="Name" value="fors_setting_delete"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#g7598470080174f400b75141530ad2c5a"><param name="Name" value="fors_setting_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#gd72375aaa7f1199f3271f15afd724ded"><param name="Name" value="fors_setting_new_level"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#gccd3b501cb380066770b1250942fa02a"><param name="Name" value="fors_setting_verify"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac"><param name="Name" value="fors_stack_const"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989"><param name="Name" value="fors_stack_define_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13"><param name="Name" value="fors_stack_method_delete"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#g245b26490c31d54735bae3f76345b365"><param name="Name" value="fors_stack_method_get_string"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af"><param name="Name" value="fors_stack_method_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g100f4290bf02ce348f22092f4e2bc3eb"><param name="Name" value="fors_star_brighter_than"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g1ef535783913303ad950792cdd1d59c8"><param name="Name" value="fors_star_check_values"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787"><param name="Name" value="fors_star_delete"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g40fa6037fee74abd5a9d5166137609e0"><param name="Name" value="fors_star_delete_but_standard"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g21eca2e7981ea38bc0b5a66edfc56bb9"><param name="Name" value="fors_star_distsq"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62"><param name="Name" value="fors_star_duplicate"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gdef23fa2c1ad1c4f2b0de18038b0daca"><param name="Name" value="fors_star_ellipticity"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98"><param name="Name" value="fors_star_equal"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g6a1cb404cc2c956f79b10ea46a0611dc"><param name="Name" value="fors_star_ext_corr"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g4f81e6410fe5c7aefbdbcae907095059"><param name="Name" value="fors_star_extension"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0"><param name="Name" value="fors_star_get_x"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e"><param name="Name" value="fors_star_get_y"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gb718ac03773576fc6856847b4211ffba"><param name="Name" value="fors_star_get_zeropoint"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g22fc7f95537194266794e24345cdda0b"><param name="Name" value="fors_star_get_zeropoint_err"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g41b7ffa8530d0ffbc45916248663ac45"><param name="Name" value="fors_star_is_identified"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g548c477088fd4fbadd74fd84f3becb94"><param name="Name" value="fors_star_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gec880ac28409dd535ec3138e0b5b001c"><param name="Name" value="fors_star_new_from_table"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g89b5801d41c9760d82ec12097e14b584"><param name="Name" value="fors_star_print"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g8ab50c70291d9ed66d075ce9ae93577d"><param name="Name" value="fors_star_print_list"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g310c2402602378a7505a36a85ee98c7b"><param name="Name" value="fors_star_stellarity"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861"><param name="Name" value="fors_type_get_string"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3"><param name="Name" value="fors_utils_median_corr"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gffa00ce29ad3796187cf1336e4fcbb61"><param name="Name" value="fors_zeropoint"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g3222d4735fe218be5da224f3a146580b"><param name="Name" value="fors_zeropoint_astrometry"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g2ea192495f55d98f1068cae2b1921cea"><param name="Name" value="fors_zeropoint_astrometry_apply_unidentified_xy2radec"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g5a8ae7f99786a3fdc7df6a07d90d905c"><param name="Name" value="fors_zeropoint_astrometry_get_wcs_shift_px"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gd1a70566b3bf818a95a6c3e2312d0710"><param name="Name" value="fors_zeropoint_astrometry_shift_wcs_origin"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gb81bff380e7ee1d22c3c6620620771bf"><param name="Name" value="fors_zeropoint_create"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gc2cbbec604bd9b8cabf9f83fe71037da"><param name="Name" value="fors_zeropoint_define_parameters"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g69cec4407efc0bcccde712800aaa577c"><param name="Name" value="fors_zeropoint_description"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g095db561f9e785a5a4114d97f4597baf"><param name="Name" value="fors_zeropoint_destroy"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g06887d7be84289a1ec9c7b7350e69412"><param name="Name" value="fors_zeropoint_errorstate_dump_as_warning"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g9aa95cb40ce84db79ab3006d51e7059d"><param name="Name" value="fors_zeropoint_exec"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#g15b886f9811c703203b77a91e3bd0e91"><param name="Name" value="forsPAFAppendBool"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gdd6ed0c50b7cf4c62fdbabd0794487e4"><param name="Name" value="forsPAFAppendDouble"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gde7f65f7ca0d7e3e24babefd2c8d8716"><param name="Name" value="forsPAFAppendInt"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gf615f1fbc45dd108391de129e67d58b2"><param name="Name" value="forsPAFAppendString"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gb39490ffdb9ac9b2e666d75da2436b65"><param name="Name" value="forsPAFGetSize"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ge80d2196e3845f5857f374416333edbc"><param name="Name" value="forsPAFIsEmpty"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917"><param name="Name" value="forsPAFIsValidName"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#g2cceff721bbbd99c1a4bddfb57ed688b"><param name="Name" value="forsPAFWrite"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a"><param name="Name" value="frame_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#g2d7fe71bb7c47e2284dea7e2732650fb"><param name="Name" value="get_image_quality"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gfd13851752bdf8327fb014e47c6bb104"><param name="Name" value="get_zeropoint"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html"><param name="Name" value="High level functions"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html"><param name="Name" value="fors_point"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gacfd40664615a747765cacb741e0823d0"><param name="Name" value="fors_point_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142"><param name="Name" value="fors_point_distsq"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gaefadbecbfc8e491ca544292027d8b69e"><param name="Name" value="fors_point_duplicate"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#ga08402a65da099406fc85d21041df7f9d"><param name="Name" value="fors_point_equal"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d"><param name="Name" value="fors_point_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gac0830324b91c374088872a18c876bc34"><param name="Name" value="LIST_DEFINE"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gadb231bfc44ec37423962ea7f563a458b"><param name="Name" value="LIST_ELEM"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gacfd40664615a747765cacb741e0823d0"><param name="Name" value="fors_point_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gae8a4542170e7a3b9a9c39229d4571142"><param name="Name" value="fors_point_distsq"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gaefadbecbfc8e491ca544292027d8b69e"><param name="Name" value="fors_point_duplicate"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#ga08402a65da099406fc85d21041df7f9d"><param name="Name" value="fors_point_equal"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gac3a0346b8dba99b049ab470272c67d0d"><param name="Name" value="fors_point_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html"><param name="Name" value="fors_point_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html#gad87df141a27d7e06e22c0e912ae029e6"><param name="Name" value="test_photometry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html#ga2c261e462483c35aa06be9ac1ff0d683"><param name="Name" value="test_point"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html"><param name="Name" value="fors_polynomial"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff"><param name="Name" value="fors_polynomial_count_coeff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga2de60ddde27a60692e8e116939ef5007"><param name="Name" value="fors_polynomial_create_variance_polynomial"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981"><param name="Name" value="fors_polynomial_dump"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195"><param name="Name" value="fors_polynomial_is_coeff_set"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e"><param name="Name" value="fors_polynomial_powers_find_first_coeff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c"><param name="Name" value="fors_polynomial_powers_find_next_coeff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga16814ff8371aba44b9730bc3d516ef5f"><param name="Name" value="fors_polynomial_powers_next"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga9363bc98285fa909170db1684e81a240"><param name="Name" value="fors_polynomial_set_existing_coeff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga498733e7d062578c77b1ae5c0f6f2935"><param name="Name" value="fors_polynomial_sprint_coeff"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga1944b24982e31b3d39b0d8e3f36370ff"><param name="Name" value="fors_polynomial_count_coeff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga2de60ddde27a60692e8e116939ef5007"><param name="Name" value="fors_polynomial_create_variance_polynomial"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga8805f5c4eda84b295b77c0d72fdcf981"><param name="Name" value="fors_polynomial_dump"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#gae0f30232e4a457f491cbf83809352195"><param name="Name" value="fors_polynomial_is_coeff_set"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga14bc37c4ed8a9b8da4483749d2e26d1e"><param name="Name" value="fors_polynomial_powers_find_first_coeff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#gaa351eeb0d31616d1dbdb6b96af95a24c"><param name="Name" value="fors_polynomial_powers_find_next_coeff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga16814ff8371aba44b9730bc3d516ef5f"><param name="Name" value="fors_polynomial_powers_next"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga9363bc98285fa909170db1684e81a240"><param name="Name" value="fors_polynomial_set_existing_coeff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga498733e7d062578c77b1ae5c0f6f2935"><param name="Name" value="fors_polynomial_sprint_coeff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gaf34da190cb639a584e5f2473de24d887"><param name="Name" value="fors_print_banner"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gad81190e832f9024944d01b895e619795"><param name="Name" value="fors_property_get_num"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#gaf0772ae3abe7bce9ce61ad1da366b480"><param name="Name" value="fors_qc_dic_version"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda"><param name="Name" value="fors_qc_end_group"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56"><param name="Name" value="fors_qc_keyword_to_paf"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451"><param name="Name" value="fors_qc_start_group"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__qc__test.html"><param name="Name" value="fors_qc_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__qc__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__qc__test.html#gabf987906c0b52a3ada25d6c611845f5c"><param name="Name" value="test_qc"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga8355f62ab2783be464130e8de57487b3"><param name="Name" value="fors_qc_write_double"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga9ff2c73c315e805ab5d1415a2de9ce0b"><param name="Name" value="fors_qc_write_group_heading"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga945d4a157c5a4602fcfb644e63d70d15"><param name="Name" value="fors_qc_write_int"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f"><param name="Name" value="fors_qc_write_qc_double"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#gad44c752c8d0fc214c85cb7aca999870b"><param name="Name" value="fors_qc_write_qc_int"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga47dfe71df58ec7c851d4f3853f9f9b00"><param name="Name" value="fors_qc_write_qc_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4"><param name="Name" value="fors_qc_write_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#gaf13e605c8419c9bd134eccdf1fdfc6e2"><param name="Name" value="fors_qc_write_string_chat"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56"><param name="Name" value="fors_rand_gauss"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html"><param name="Name" value="fors_recipe Recipe"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html"><param name="Name" value="fors_recipe"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#gaccb93c75d494370cf0262930557dc4e2"><param name="Name" value="fors_recipe_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#ga455905b384dd9b68150677beda6bcee1"><param name="Name" value="fors_recipe_destroy"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#ga3a1716720583090ad664ae953d665d5b"><param name="Name" value="fors_recipe_exec"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#gaccb93c75d494370cf0262930557dc4e2"><param name="Name" value="fors_recipe_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#ga455905b384dd9b68150677beda6bcee1"><param name="Name" value="fors_recipe_destroy"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__recipe.html#ga3a1716720583090ad664ae953d665d5b"><param name="Name" value="fors_recipe_exec"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html"><param name="Name" value="fors_setting"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#ga6a9999a057167a310f81224d0218cb83"><param name="Name" value="fors_setting_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15"><param name="Name" value="fors_setting_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#ga05ebcfdde1706094627a0dd4af5186ae"><param name="Name" value="fors_setting_new_level"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#ga160a93959e72b826426891ca8e0f80aa"><param name="Name" value="fors_setting_verify"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#ga6a9999a057167a310f81224d0218cb83"><param name="Name" value="fors_setting_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#gab024c5bd5adc980985132e7fd9ff3b15"><param name="Name" value="fors_setting_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#ga05ebcfdde1706094627a0dd4af5186ae"><param name="Name" value="fors_setting_new_level"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting__test.html"><param name="Name" value="fors_setting_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting__test.html#gafa8c7ae8a3758428e457eb26c91c0da7"><param name="Name" value="test_setting"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#ga160a93959e72b826426891ca8e0f80aa"><param name="Name" value="fors_setting_verify"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html"><param name="Name" value="fors_stack"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga6792068e2f3a973ad54722120779feb1"><param name="Name" value="fors_stack"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc"><param name="Name" value="fors_stack_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15"><param name="Name" value="fors_stack_define_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga9b1d85fcb31770b51259b8aa24c47ae2"><param name="Name" value="fors_stack_method_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga5b92c215ed81d61bc8718b55e604ebc2"><param name="Name" value="fors_stack_method_get_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e"><param name="Name" value="fors_stack_method_new"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga5d87fc29a7abf6186c6d3090cd5a53cc"><param name="Name" value="fors_stack_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15"><param name="Name" value="fors_stack_define_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga9b1d85fcb31770b51259b8aa24c47ae2"><param name="Name" value="fors_stack_method_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga5b92c215ed81d61bc8718b55e604ebc2"><param name="Name" value="fors_stack_method_get_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#ga88dc5c52ed64ac4911335ffd06fa389e"><param name="Name" value="fors_stack_method_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack__test.html"><param name="Name" value="fors_stack_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack__test.html#gafae5d1fcc553808ac2e0c37908648cac"><param name="Name" value="test_stack"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html"><param name="Name" value="fors_star"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gaab4c629c0b0fafb228595b124b93cfd8"><param name="Name" value="_get_optional_table_value"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga7672a63fe0deea93cb8bae8362b6d020"><param name="Name" value="fors_star_brighter_than"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga279f39755ddfa24ee9cfad4a03c01cf3"><param name="Name" value="fors_star_check_values"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774"><param name="Name" value="fors_star_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga517c8c542ad4eb8145fa664be9625a98"><param name="Name" value="fors_star_delete_but_standard"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga53496a5c3e6810c6c59d221120df422b"><param name="Name" value="fors_star_distsq"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a"><param name="Name" value="fors_star_duplicate"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga9e7994d44acbe88580cab63d3662df40"><param name="Name" value="fors_star_ellipticity"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1"><param name="Name" value="fors_star_equal"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga2c97d2c47686016fa04c59b2a3e92b5c"><param name="Name" value="fors_star_extension"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165"><param name="Name" value="fors_star_get_x"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160"><param name="Name" value="fors_star_get_y"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e"><param name="Name" value="fors_star_get_zeropoint"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183"><param name="Name" value="fors_star_get_zeropoint_err"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga525a48af1f85cf79ee7a60885eb5b13d"><param name="Name" value="fors_star_is_identified"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga7a8b2a60d5685524ffbb762e066c9b01"><param name="Name" value="fors_star_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga5be8cd6931b5f998692daaf65bcf9755"><param name="Name" value="fors_star_new_from_table"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga3443159e600f23336b266f7b557f4ea0"><param name="Name" value="fors_star_print"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga4e15f3d1dbd18c8e010dc4ef82401d7d"><param name="Name" value="fors_star_print_list"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga67451b955667ae4f965146aee484c6bc"><param name="Name" value="fors_star_stellarity"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gac0830324b91c374088872a18c876bc34"><param name="Name" value="LIST_DEFINE"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gadb231bfc44ec37423962ea7f563a458b"><param name="Name" value="LIST_ELEM"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga7672a63fe0deea93cb8bae8362b6d020"><param name="Name" value="fors_star_brighter_than"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga279f39755ddfa24ee9cfad4a03c01cf3"><param name="Name" value="fors_star_check_values"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga77f698ef0a6eb8bc4c4919b3d1aa6774"><param name="Name" value="fors_star_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga517c8c542ad4eb8145fa664be9625a98"><param name="Name" value="fors_star_delete_but_standard"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga53496a5c3e6810c6c59d221120df422b"><param name="Name" value="fors_star_distsq"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga43a9682d94e1abc97300b00973b2291a"><param name="Name" value="fors_star_duplicate"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga9e7994d44acbe88580cab63d3662df40"><param name="Name" value="fors_star_ellipticity"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga7704963eef38129e5f83e5b9eae36bc1"><param name="Name" value="fors_star_equal"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#ga38ae9b9338fdb3cca9a17d970fac3db3"><param name="Name" value="fors_star_ext_corr"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga2c97d2c47686016fa04c59b2a3e92b5c"><param name="Name" value="fors_star_extension"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gabd3cf1f281e1cfdb35d8a7fbde6c1165"><param name="Name" value="fors_star_get_x"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga30e1e4deb8cae2033eb1f501b315d160"><param name="Name" value="fors_star_get_y"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gaa65bffc3107e2c3501346be2e5e03b1e"><param name="Name" value="fors_star_get_zeropoint"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga169dbe9ff4f60cde7e39d487ff510183"><param name="Name" value="fors_star_get_zeropoint_err"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga525a48af1f85cf79ee7a60885eb5b13d"><param name="Name" value="fors_star_is_identified"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga7a8b2a60d5685524ffbb762e066c9b01"><param name="Name" value="fors_star_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga5be8cd6931b5f998692daaf65bcf9755"><param name="Name" value="fors_star_new_from_table"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga3443159e600f23336b266f7b557f4ea0"><param name="Name" value="fors_star_print"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga4e15f3d1dbd18c8e010dc4ef82401d7d"><param name="Name" value="fors_star_print_list"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga67451b955667ae4f965146aee484c6bc"><param name="Name" value="fors_star_stellarity"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star__test.html"><param name="Name" value="fors_star_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star__test.html#ga5f4dac934da293e2cb4d53341350c833"><param name="Name" value="test_star"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html"><param name="Name" value="fors_std_cat_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html#gadfc8e1d36263b0fd8876efba7434a5af"><param name="Name" value="test_dist"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html#ga47ae58a634c68c2d37cf5f90ac247fa5"><param name="Name" value="test_new"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__test.html"><param name="Name" value="fors_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__test.html#gaa0b61563ef767d8d2276e7ffe0b14f5e"><param name="Name" value="test_version"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html"><param name="Name" value="fors_tools"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#gabebf30c47320c004ab4e658f837f75db"><param name="Name" value="fors_create_sources_table"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#ga97b43bda55e1da41fe216364c8408d5b"><param name="Name" value="fors_fixed_pattern_noise"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#ga1ea0e4e37d52d6077b39e93ad1c340c3"><param name="Name" value="fors_fixed_pattern_noise_bias"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b"><param name="Name" value="fors_get_airmass"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#ga38ae9b9338fdb3cca9a17d970fac3db3"><param name="Name" value="fors_star_ext_corr"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gac3759b058af73511a69998299a11a40f"><param name="Name" value="fors_tools_get_kth_double"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044"><param name="Name" value="fors_tools_get_kth_float"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga5de34c3a7ff32722bc68e1b3a67f3390"><param name="Name" value="fors_tools_get_median_fast_float"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga513ceb86672094a1d13a45d75e01782a"><param name="Name" value="fors_tools_get_median_float"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd"><param name="Name" value="fors_type_get_string"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html"><param name="Name" value="fors_utils"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga69350709e5f9874601c729becd315e81"><param name="Name" value="fors_angle_diff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga3e2178bad7068e3768fc5f78b1d02490"><param name="Name" value="fors_frame_get_group_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga82f1aaba039c880a3bff109f3729d74a"><param name="Name" value="fors_frame_get_level_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gad97092a91b5de91f84039778596fd759"><param name="Name" value="fors_frame_get_type_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga6692a0ba541b3e7f99654f844aee40c6"><param name="Name" value="fors_frame_print"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga467ac093c1e2d21f9e2dfc9afcb97744"><param name="Name" value="fors_frameset_extract"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga414e1f2d95f271cc76a67e525b910e96"><param name="Name" value="fors_frameset_print"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga1c8c5c9fea9db9a6e6cfe7574d79ca87"><param name="Name" value="fors_get_license"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga4c7b6a1484c2123934ac4c7a1f9e4a74"><param name="Name" value="fors_get_version_binary"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gabb34a534e28308533f300ea11ec7a3a3"><param name="Name" value="fors_imagelist_collapse_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gaa55c5fd8ade8f10e441297c0cda96093"><param name="Name" value="fors_imagelist_collapse_median_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gae98c540953f671b35817aac071aa4adc"><param name="Name" value="fors_msg_macro"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga198405eae0245c17f2719e40fc4c8b42"><param name="Name" value="fors_parameterlist_set_defaults"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gaf34da190cb639a584e5f2473de24d887"><param name="Name" value="fors_print_banner"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56"><param name="Name" value="fors_rand_gauss"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gac3759b058af73511a69998299a11a40f"><param name="Name" value="fors_tools_get_kth_double"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga86a7f03d90b17ddd5764219a8bd4a044"><param name="Name" value="fors_tools_get_kth_float"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga5de34c3a7ff32722bc68e1b3a67f3390"><param name="Name" value="fors_tools_get_median_fast_float"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga513ceb86672094a1d13a45d75e01782a"><param name="Name" value="fors_tools_get_median_float"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga2e98c2130598c09a1c5d3344306463fd"><param name="Name" value="fors_type_get_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3"><param name="Name" value="fors_utils_median_corr"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gab234d1358562b66925fb7223c087556b"><param name="Name" value="MAX_MESSAGE_LENGTH"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gaa6f08c08604f669d5248a50db05095c6"><param name="Name" value="REQ_CPL_MAJOR"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gaab1b7d291b65c497a7a4d32822095d10"><param name="Name" value="REQ_CPL_MICRO"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gae2b8645924a1fcbfb414a387b6f33b3b"><param name="Name" value="REQ_CPL_MINOR"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga8e2fcfe074b6da07c0b50aa07467666c"><param name="Name" value="STDEV_PR_MAD"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga42ad9e96d57c915b0a28a40dd838c9a3"><param name="Name" value="fors_utils_median_corr"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html"><param name="Name" value="fors_zeropoint"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693"><param name="Name" value="cpl_plugin_get_info"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga6e4245b398bb089daaaed5ec204e0c4f"><param name="Name" value="fors_zeropoint"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gac3585e0948fbad1f1e2046a01baaedb3"><param name="Name" value="fors_zeropoint_astrometry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga2ec4f355c2423ad8517fd8eb6636f96f"><param name="Name" value="fors_zeropoint_astrometry_apply_unidentified_xy2radec"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga34215908758f4269782d8c322f01b266"><param name="Name" value="fors_zeropoint_astrometry_get_wcs_shift_px"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gaff77420ce4f300b2f80d53ebf6130020"><param name="Name" value="fors_zeropoint_astrometry_shift_wcs_origin"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gaa413e01f84b2fe6e34410f303ffcbeed"><param name="Name" value="fors_zeropoint_author"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga61984b5bc62bd25dbff9e414a7db42e3"><param name="Name" value="fors_zeropoint_create"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga1fc8917da8d302964ad2d2dc6d0eff67"><param name="Name" value="fors_zeropoint_define_parameters"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gaa95afd3326bfec044eed5eab0f85d1f7"><param name="Name" value="fors_zeropoint_description"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gade9dd2a70a958c92b9bbec230cb084e3"><param name="Name" value="fors_zeropoint_description_short"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga77d581a8f85987937b006ba302ca4c7e"><param name="Name" value="fors_zeropoint_destroy"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga9bab2c41544c905f4b3728bc7fa7cce1"><param name="Name" value="fors_zeropoint_email"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga0292c8d9272f7411e58f3581c8bdab0d"><param name="Name" value="fors_zeropoint_errorstate_dump_as_warning"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga606fac5ca2e3be91e2e65dbb943cdc66"><param name="Name" value="fors_zeropoint_exec"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga41f4d11f7d98cbfa83df4f763403d9f4"><param name="Name" value="fors_zeropoint_name"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga00f15117674050804680fcb40ed57945"><param name="Name" value="get_zeropoint"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga0fca769fa4f247f3fff26ea6ebdd4429"><param name="Name" value="zeropoint_inside"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gac3585e0948fbad1f1e2046a01baaedb3"><param name="Name" value="fors_zeropoint_astrometry"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga2ec4f355c2423ad8517fd8eb6636f96f"><param name="Name" value="fors_zeropoint_astrometry_apply_unidentified_xy2radec"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga34215908758f4269782d8c322f01b266"><param name="Name" value="fors_zeropoint_astrometry_get_wcs_shift_px"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gaff77420ce4f300b2f80d53ebf6130020"><param name="Name" value="fors_zeropoint_astrometry_shift_wcs_origin"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gaa413e01f84b2fe6e34410f303ffcbeed"><param name="Name" value="fors_zeropoint_author"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga61984b5bc62bd25dbff9e414a7db42e3"><param name="Name" value="fors_zeropoint_create"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga1fc8917da8d302964ad2d2dc6d0eff67"><param name="Name" value="fors_zeropoint_define_parameters"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gaa95afd3326bfec044eed5eab0f85d1f7"><param name="Name" value="fors_zeropoint_description"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#gade9dd2a70a958c92b9bbec230cb084e3"><param name="Name" value="fors_zeropoint_description_short"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga77d581a8f85987937b006ba302ca4c7e"><param name="Name" value="fors_zeropoint_destroy"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga9bab2c41544c905f4b3728bc7fa7cce1"><param name="Name" value="fors_zeropoint_email"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga0292c8d9272f7411e58f3581c8bdab0d"><param name="Name" value="fors_zeropoint_errorstate_dump_as_warning"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga606fac5ca2e3be91e2e65dbb943cdc66"><param name="Name" value="fors_zeropoint_exec"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga41f4d11f7d98cbfa83df4f763403d9f4"><param name="Name" value="fors_zeropoint_name"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint__test.html"><param name="Name" value="fors_zeropoint_test"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint__test.html#ga593b93a1917f63d7660af1ea61da6f94"><param name="Name" value="test_zeropoint"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html"><param name="Name" value="forsdfs"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435"><param name="Name" value="dfs_equal_keyword"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga6698973ab70fe7b0bd61b993e59e8a53"><param name="Name" value="dfs_generate_filename"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga950b280111a517c7011a120168758de0"><param name="Name" value="dfs_generate_filename_tfits"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb"><param name="Name" value="dfs_get_parameter_bool"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gae0dc63f80258d73a93d35e41b2a8b367"><param name="Name" value="dfs_get_parameter_bool_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96"><param name="Name" value="dfs_get_parameter_double"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga35b9237db0837319a04e85e6cf9dd50d"><param name="Name" value="dfs_get_parameter_double_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22"><param name="Name" value="dfs_get_parameter_int"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gaef153fed14f117971d69d1d92fa9a9e6"><param name="Name" value="dfs_get_parameter_int_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197"><param name="Name" value="dfs_get_parameter_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga8cb34aee7c26915499cbfb7d9d38b9cd"><param name="Name" value="dfs_get_parameter_string_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf"><param name="Name" value="dfs_load_header"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga326130afab421ef30992def2a444d660"><param name="Name" value="dfs_load_image"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga010c17942448386415d6e51adebae649"><param name="Name" value="dfs_load_table"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga04ce01a9ddd2c4ddee75010d7fdb81fd"><param name="Name" value="dfs_save"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5"><param name="Name" value="dfs_save_image"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga8c69e34b93aa2964cf10be637a4ee9ee"><param name="Name" value="dfs_save_image_ext"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga13a196799766da8b28cb89d4ea54ca8b"><param name="Name" value="dfs_save_image_null"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824"><param name="Name" value="dfs_save_table"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga9fe80dfc0b048b03eb846f68de836489"><param name="Name" value="dfs_save_table_ext"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gaa72aa06ad8174e7f9e14b556e1ec130f"><param name="Name" value="errorstate_dump_one"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga27fb3567f87be0ee95f6176990f4a4ce"><param name="Name" value="fors_begin"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga71054af8e26681ec2d7e1ea39e7feb17"><param name="Name" value="fors_dfs_add_exptime"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gadbf163fdd77abcf68fac009993f20959"><param name="Name" value="fors_dfs_add_wcs"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga31c40f4add0fc7ef1e992d99493f5d1a"><param name="Name" value="fors_dfs_pipeline_version"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga45cefe5c9339a8b27be0454c9144a70a"><param name="Name" value="fors_dfs_save_image"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga6f529d571ffaada1dbc4299ca5cdf3d7"><param name="Name" value="fors_dfs_save_image_err"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga65ab95dab0ba56844b6b548b18b6487f"><param name="Name" value="fors_dfs_save_table"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga5162766f25e67bb99869e7959c3f8201"><param name="Name" value="fors_dfs_set_groups"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#gab47f2ab911401a6d92628c2b541b17b9"><param name="Name" value="fors_end"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga080ffcf787c686caacf741989e6e796a"><param name="Name" value="hawki_extract_frameset"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga7238fed70c78643d055c79a8bd510356"><param name="Name" value="strlower"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga3b7e23c484da8841aa01d1bed50cf2f0"><param name="Name" value="WCS_KEYS"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html"><param name="Name" value="forsPaf"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g8138511b64d1d365e21b56eb161f2028"><param name="Name" value="fors_create_sources_table"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g5637ecda70fb6aeab5c0b22dec2e2e10"><param name="Name" value="fors_fixed_pattern_noise"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g2e2a80069157183a808349976b3e455a"><param name="Name" value="fors_fixed_pattern_noise_bias"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437"><param name="Name" value="fors_get_airmass"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html#g6a1cb404cc2c956f79b10ea46a0611dc"><param name="Name" value="fors_star_ext_corr"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga801baaad201f88a079f39961001b2272"><param name="Name" value="_forsPAFAppend"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga31aa555372302db5a189cfc8ddf77925"><param name="Name" value="_forsPAFFormatRecord"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gafec1afad71f75b57db50075e5129d01a"><param name="Name" value="_forsPAFHeaderCreate"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga0f4b8a1dafd89e1978b36032c6a5d48a"><param name="Name" value="_forsPAFRecordCreate"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga8f34528da23f3d240c68aab76539edca"><param name="Name" value="_forsPAFRecordDestroy"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga5a2311da25c79df625c7bd8af91853e3"><param name="Name" value="_forsPAFRecordSet"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga12c533561960f76a20b651673f9d38fd"><param name="Name" value="_forsPAFValueSize"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga5d62f23bc1a07c4136aecccfcea2459d"><param name="Name" value="deleteForsPAF"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gaac413514350c777efbd5ed0e1cc26778"><param name="Name" value="forsPAFAppendBool"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga83aca84f4fb88e3db7a233b442cd644a"><param name="Name" value="forsPAFAppendDouble"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gae15f3d1ee9b849039f26cd82d3568913"><param name="Name" value="forsPAFAppendInt"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gad23a2cd11683bd001f954383a282b9c3"><param name="Name" value="forsPAFAppendString"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga38a21baf09dfb452f820eb2aded1a6c0"><param name="Name" value="forsPAFGetSize"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga84dbb309c51aee01813cc9b90dde96cb"><param name="Name" value="forsPAFIsEmpty"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37"><param name="Name" value="forsPAFIsValidName"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gae363226233d0cc3c7011274266c562e8"><param name="Name" value="ForsPAFRecord"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga3e16371f03930ae272a5454ad6100f83"><param name="Name" value="forsPAFWrite"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga216b2fd87c070e1871f73d29eed94531"><param name="Name" value="getTimeISO8601"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga7aef24280b6605d6dfbb063bab8da2f4"><param name="Name" value="newForsPAF"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga88f813e34826e731a89a053184474530"><param name="Name" value="TIME_ISO8601_LENGTH"></OBJECT>
   </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gaac413514350c777efbd5ed0e1cc26778"><param name="Name" value="forsPAFAppendBool"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga83aca84f4fb88e3db7a233b442cd644a"><param name="Name" value="forsPAFAppendDouble"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gae15f3d1ee9b849039f26cd82d3568913"><param name="Name" value="forsPAFAppendInt"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gad23a2cd11683bd001f954383a282b9c3"><param name="Name" value="forsPAFAppendString"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga38a21baf09dfb452f820eb2aded1a6c0"><param name="Name" value="forsPAFGetSize"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga84dbb309c51aee01813cc9b90dde96cb"><param name="Name" value="forsPAFIsEmpty"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga1b521862ddce4498cc3a7b473c12ab37"><param name="Name" value="forsPAFIsValidName"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gae363226233d0cc3c7011274266c562e8"><param name="Name" value="ForsPAFRecord"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga3e16371f03930ae272a5454ad6100f83"><param name="Name" value="forsPAFWrite"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html"><param name="Name" value="forsqc"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga38cae0339b21e1dac5ae3b9a88c5dd6f"><param name="Name" value="fors_header_write_double"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga9d46eab8c3bab95ca0d445645bf4038d"><param name="Name" value="fors_header_write_int"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga099e4acd38cac975fac5e998c5bd3053"><param name="Name" value="fors_header_write_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#gaf0772ae3abe7bce9ce61ad1da366b480"><param name="Name" value="fors_qc_dic_version"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda"><param name="Name" value="fors_qc_end_group"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56"><param name="Name" value="fors_qc_keyword_to_paf"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451"><param name="Name" value="fors_qc_start_group"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga8355f62ab2783be464130e8de57487b3"><param name="Name" value="fors_qc_write_double"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga9ff2c73c315e805ab5d1415a2de9ce0b"><param name="Name" value="fors_qc_write_group_heading"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga945d4a157c5a4602fcfb644e63d70d15"><param name="Name" value="fors_qc_write_int"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f"><param name="Name" value="fors_qc_write_qc_double"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#gad44c752c8d0fc214c85cb7aca999870b"><param name="Name" value="fors_qc_write_qc_int"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga47dfe71df58ec7c851d4f3853f9f9b00"><param name="Name" value="fors_qc_write_qc_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4"><param name="Name" value="fors_qc_write_string"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#gaf13e605c8419c9bd134eccdf1fdfc6e2"><param name="Name" value="fors_qc_write_string_chat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#gab071a13455e158378961f71fa097bd52"><param name="Name" value="pafFile"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga5c762ae2035aed31e7aeec22229b70c2"><param name="Name" value="pafIndex"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a1172414515f8a0f0c911c6b3836ddc8d"><param name="Name" value="frame_index"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c"><param name="Name" value="frame_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#ab863d4543dc50ff8fd46622ded9c7200"><param name="Name" value="fwhm"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a7b1797bb488330f2904878e6256956d7"><param name="Name" value="gain"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga11315f8dbe7bcd79d1f4e7ad691532fe"><param name="Name" value="get_image_quality"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga00f15117674050804680fcb40ed57945"><param name="Name" value="get_zeropoint"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga216b2fd87c070e1871f73d29eed94531"><param name="Name" value="getTimeISO8601"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga080ffcf787c686caacf741989e6e796a"><param name="Name" value="hawki_extract_frameset"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#a7f44550c15b50560e761a07c8b78024d"><param name="Name" value="header"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__tools.html"><param name="Name" value="High level functions"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a8ea1d278cd06279fe37bf56238a9f6d8"><param name="Name" value="id"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify__test.html"><param name="Name" value="identify unit tests"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html"><param name="Name" value="Image source extraction"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html"><param name="Name" value="Image stacking"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html"><param name="Name" value="Image with error bars"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga2bf16455ff9dadaa26861905f8999616"><param name="Name" value="inside_region"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gaff7bcbeb82fada5cfc426397545258d8"><param name="Name" value="instrume"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html"><param name="Name" value="Instrument setting"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ab38c5f7885683ddd1d1a7dc27fb2ba2b"><param name="Name" value="instrument"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#gabfabb64bfcdbd1d4ce160018b20d2da4"><param name="Name" value="int_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#ga0f396c732804d713483cca7812ec6caf"><param name="Name" value="int_duplicate"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#ga41b6ed12528ebb19b15ba0c691dd02eb"><param name="Name" value="int_evaluate"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#gab5525b12fd90be6e9b2e389ab4908edd"><param name="Name" value="int_less_than"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#ga52377e795ce68f7de7da06f753b01efc"><param name="Name" value="is_star"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a7c4345b693fd891d4f343eaddc34979e"><param name="Name" value="kappa"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga99b5e66ad0a35407a2966d42e40836a2"><param name="Name" value="ksigma_vector"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga1d98257a6428bdaa421182c98fa678fb"><param name="Name" value="kth"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html"><param name="Name" value="list"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html"><param name="Name" value="List unit test"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html"><param name="Name" value="list"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#g5237e1161aeef9d828a973333151a36f"><param name="Name" value="extract_sex"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#gedc4ee1e5daa54e4859e929c7ff51f59"><param name="Name" value="extract_test"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1"><param name="Name" value="fors_extract"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#gcdd189ebaad6fe5c20ac2dea2eb06dfe"><param name="Name" value="fors_extract_check_sex_flag"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#g2c649f2f8802860d4693e38bd640032c"><param name="Name" value="fors_extract_check_sex_star"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#gd07fd085541e8be0723f2932a29abdb3"><param name="Name" value="fors_extract_define_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__extract.html#g1f3f1af725e7b5fb1c770507eab8ac09"><param name="Name" value="fors_extract_method_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#a66cb2432b3119e08ea9d4e8894888e78"><param name="Name" value="back"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#a1a1cb0ab62efe6895ec181d4ad9ca047"><param name="Name" value="current"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#abd7376537b236a2681c22a6628a6d704"><param name="Name" value="current_p1"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#a72f124431873b5f1f0b7fad24aa788c6"><param name="Name" value="current_p2"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#aed325b1d7a1acd893dac35006a10ab2c"><param name="Name" value="elements"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#a3b03adad0c0429bae9493667ff366dc2"><param name="Name" value="size"></OBJECT>
   </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html"><param name="Name" value="Image stacking"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga53649894f899f4009ab1d2acf776ac58"><param name="Name" value="list_calloc"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gac0830324b91c374088872a18c876bc34"><param name="Name" value="LIST_DEFINE"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#gdb3cdc182c4f875222b11aa33e1699ac"><param name="Name" value="fors_stack_const"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989"><param name="Name" value="fors_stack_define_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#g2a1deb2be3899390d3ad567725a53e13"><param name="Name" value="fors_stack_method_delete"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#g245b26490c31d54735bae3f76345b365"><param name="Name" value="fors_stack_method_get_string"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack.html#g08c73c19db5c7016279f1c771595e7af"><param name="Name" value="fors_stack_method_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gac0830324b91c374088872a18c876bc34"><param name="Name" value="fors_image"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gac0830324b91c374088872a18c876bc34"><param name="Name" value="fors_photometry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gac0830324b91c374088872a18c876bc34"><param name="Name" value="fors_point"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gac0830324b91c374088872a18c876bc34"><param name="Name" value="fors_star"></OBJECT>
   </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html"><param name="Name" value="Image with error bars"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga883631f4b10a6d912b5508353743c0da"><param name="Name" value="list_delete"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga71cc8d784aff4653ac6bd8e0724780e4"><param name="Name" value="list_delete_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gac2d7ea2bf8ee3637bc9167916e637f30"><param name="Name" value="list_duplicate"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gadb231bfc44ec37423962ea7f563a458b"><param name="Name" value="LIST_ELEM"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g5ac7cb865a07bab1987284dba3676ceb"><param name="Name" value="fors_image_abs"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g4154f529cbabe4cb4d1203d03e771f8a"><param name="Name" value="fors_image_collapse_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g9f084a5b4f1564f1efb645e342eee2af"><param name="Name" value="fors_image_collapse_ksigma_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gbd2b7e8761473ff4ca42f90fa879e1ad"><param name="Name" value="fors_image_collapse_median_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gfe360dbc95e94b6b1043401aef8cbacc"><param name="Name" value="fors_image_collapse_minmax_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gf0bdf78bba3bf571d3eb313233dda2b2"><param name="Name" value="fors_image_crop"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g619a9da3f407016d4e9a2148cb86e903"><param name="Name" value="fors_image_delete"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ge2384bf878e24641f1c294fe0014dbd6"><param name="Name" value="fors_image_delete_const"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g56dbb1b1a81ac64b9b19effa13bafec4"><param name="Name" value="fors_image_divide"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g4c8774a9e651df6d05689d208fb349e1"><param name="Name" value="fors_image_divide_noerr"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gcc9714a987782f7a8ab25d7548c27eff"><param name="Name" value="fors_image_divide_scalar"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g5b5539c0e15fe20c16bedc58e8263724"><param name="Name" value="fors_image_draw"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g2dd2a200ff65896f50da127bb5d94655"><param name="Name" value="fors_image_duplicate"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g78afca4bf8e5c3dc80d0dcd7f682f9e9"><param name="Name" value="fors_image_exponential"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g315f5476160ed7db282a7623f0d354b0"><param name="Name" value="fors_image_filter_max_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g96498be3e15cde80921709406c33b6f3"><param name="Name" value="fors_image_filter_median_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gdffe6405bb64c769dfcdf71c6a281dad"><param name="Name" value="fors_image_get_data_const"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g0c54aa21dd94d212c389d89d128580b0"><param name="Name" value="fors_image_get_error_mean"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g5c7d9b043db23a40e632ffc34c3f3d5c"><param name="Name" value="fors_image_get_max"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gfcbb208a8336f751ebf8119b17e70aa3"><param name="Name" value="fors_image_get_mean"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gf4b42869081aad7a0af57b50eedf9f21"><param name="Name" value="fors_image_get_median"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gc4edb9a966bcf97a17ad6a5c1b9d020f"><param name="Name" value="fors_image_get_min"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g5d33557c3f679dbb621e2387018a3b03"><param name="Name" value="fors_image_get_size_x"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g53bd720f4c81385733f2406a5b22bdb7"><param name="Name" value="fors_image_get_size_y"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g9b3437d12d87ecb5a0f69fdfd51d2257"><param name="Name" value="fors_image_get_stdev"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g6467069b6450c28087a3a0d5a695911b"><param name="Name" value="fors_image_get_stdev_robust"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g4d8212ca7fa00baa0880a17d2b71e410"><param name="Name" value="fors_image_load"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g10b7b00c3db675b11d8f396f3ed1c90a"><param name="Name" value="fors_image_load_list"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gab0a6629f36c4db609f1a1515d602477"><param name="Name" value="fors_image_load_list_const"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g15f95ab361e6c2ea44bafbada5d8d4a1"><param name="Name" value="fors_image_multiply"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g0769427c961bdf0fd79eda47fcadeee2"><param name="Name" value="fors_image_multiply_noerr"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g077f7a5a847fa9c0e458dca2e12e4e6f"><param name="Name" value="fors_image_multiply_scalar"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65"><param name="Name" value="fors_image_new"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42"><param name="Name" value="fors_image_save"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g1ddf7d1b81954a8d2113e4f5174301a8"><param name="Name" value="fors_image_save_sex"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g18f269421a43f46c063b667fac72c938"><param name="Name" value="fors_image_square"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gacbedc7a6d48a3838d66923912a5b712"><param name="Name" value="fors_image_subtract"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#g50a06b605ca558553e0642209b93c100"><param name="Name" value="fors_image_subtract_scalar"></OBJECT>
-  </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#gdfc439dadf11b131119fe17cb19f6e25"><param name="Name" value="inside_region"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html"><param name="Name" value="Instrument setting"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#gadb231bfc44ec37423962ea7f563a458b"><param name="Name" value="fors_image"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gadb231bfc44ec37423962ea7f563a458b"><param name="Name" value="fors_photometry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point.html#gadb231bfc44ec37423962ea7f563a458b"><param name="Name" value="fors_point"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gadb231bfc44ec37423962ea7f563a458b"><param name="Name" value="fors_star"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gaf355fe5f4ce5910b419c80ae14bf5199"><param name="Name" value="list_extract"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gaf21759c8c3e2901f5c975b92c242b928"><param name="Name" value="list_first"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gab3cf221632da8cbfa6ba17ce46c19be5"><param name="Name" value="list_first_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga9fb3208157c8385a1c5820c70d974221"><param name="Name" value="list_first_pair"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gabcb549a35d8d77e9f67f0222b317151f"><param name="Name" value="list_first_pair_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga61ba21429b4fde5f5ab252547acafce2"><param name="Name" value="list_free"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gac96b31bf7509ede319e5dd7b6a57c8b7"><param name="Name" value="list_insert"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga7e7725d1601b893517c7b7f80133d73e"><param name="Name" value="list_kth"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gad758e8f1d12a4ef2b2c70583436a4019"><param name="Name" value="list_kth_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gaca58359f15efcb94ba70cf9a3b70f509"><param name="Name" value="list_kth_val"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga2686278ac8d813c922895dc7497d9328"><param name="Name" value="list_kth_val_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga783b95234c567cbeeb59b3009eead316"><param name="Name" value="list_mad"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga4d27e95761e1b21498ad7653acc80d35"><param name="Name" value="list_malloc"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga4a0dc8306e5e3658abe167531b09aa8d"><param name="Name" value="list_max"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga44c7a16d614151b241aaf52fdbc2257b"><param name="Name" value="list_max_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga2fabd89564e393c78bf3037468ec546b"><param name="Name" value="list_max_val"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga72f528df806c961a28a9c83de3cb89f3"><param name="Name" value="list_mean"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga6d08786bc84010dfd382ae36608d74f1"><param name="Name" value="list_mean_optimal"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga8d5240ec55c316b3774abeb9333347b7"><param name="Name" value="list_median"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gafaa8c6edd6f50c03b04bed76ea83a20f"><param name="Name" value="list_min"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga307e4525ac81a6cabbf03913be5eb0d4"><param name="Name" value="list_min_val"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga9b9a23d98f58af888b2d2d3072f8b999"><param name="Name" value="list_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gadec72210f2c923dfe7892b9d2061ba5c"><param name="Name" value="list_next"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga90ccfa07b503becbebf18febc26bde05"><param name="Name" value="list_next_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gae16b00f64fd94c4fd10309662bfd8713"><param name="Name" value="list_next_pair"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga92413bd987bc459aa793986b7fdcc0b3"><param name="Name" value="list_next_pair_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga7023af2bbc45d072011310fb7c57d102"><param name="Name" value="list_realloc"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga82f27bf059a874514b690eb87485b3a9"><param name="Name" value="list_remove"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gad865955a3a3615158490e2ca7eb4e051"><param name="Name" value="list_remove_const"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga46e0a8576f5289344cbacf63e7fbe008"><param name="Name" value="list_reverse"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga6dd47461521abb4788903e8845df8665"><param name="Name" value="list_size"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html"><param name="Name" value="list_test"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#ge86af8a33ab13c7a2c294a2509b0c8d7"><param name="Name" value="fors_setting_delete"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#g7598470080174f400b75141530ad2c5a"><param name="Name" value="fors_setting_new"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#gd72375aaa7f1199f3271f15afd724ded"><param name="Name" value="fors_setting_new_level"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting.html#gccd3b501cb380066770b1250942fa02a"><param name="Name" value="fors_setting_verify"></OBJECT>
-  </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science.html#gded70f366457b7e7915dc906a4d50a45"><param name="Name" value="is_star"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ge8bd4915a67367a226dcd3f5c3bd5491"><param name="Name" value="list_duplicate"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#g014e03d131a3d24d1d52465fd0f63a2f"><param name="Name" value="list_extract"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#g835886d7e2108ff01e9123261b28eb1e"><param name="Name" value="list_malloc"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#g14ca81b1edd1222975ab52e203cbde59"><param name="Name" value="list_new"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g3c4ce99ce7472d6d48acffcf562b0fb7"><param name="Name" value="match_patterns"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html"><param name="Name" value="Miscellaneous Utilities"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#gabfabb64bfcdbd1d4ce160018b20d2da4"><param name="Name" value="int_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#ga0f396c732804d713483cca7812ec6caf"><param name="Name" value="int_duplicate"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#ga41b6ed12528ebb19b15ba0c691dd02eb"><param name="Name" value="int_evaluate"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#gab5525b12fd90be6e9b2e389ab4908edd"><param name="Name" value="int_less_than"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#ga88f16a899d9e287cf6d84a9ba4754507"><param name="Name" value="test_list"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structband__jacobian.html#a5a22b2fe8df6300f3d1a2a596a019e70"><param name="Name" value="mag"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#ab84e2da9886ebd2a68c33fa69a7b55da"><param name="Name" value="magnitude"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#ab84e2da9886ebd2a68c33fa69a7b55da"><param name="Name" value="_fors_star"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#afcf8a50010ad0c894c17b6fc6d0bd227"><param name="Name" value="_fors_std_star"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a67fbc8534a37685e633bf46d315a25cd"><param name="Name" value="magnitude_corr"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="main"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_bias_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_dark_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_identify_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_image_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_img_science_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_img_screen_flat_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_img_sky_flat_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pattern__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_pattern_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_point_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__qc__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_qc_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_setting_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_stack_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_star_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_std_cat_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="fors_zeropoint_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="list_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__recipes__test.html#ga840291bc02cba5474a4cb46a9b9566fe"><param name="Name" value="recipes_test"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga42ceb4d744e2387cc5694c8e2d73bf88"><param name="Name" value="map_table"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#gabbed61b85afc33d67894bd2dd1f061f3"><param name="Name" value="match_patterns"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#ad4c92aab333c6e87be1323ceaf3c03d8"><param name="Name" value="max"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga570d5aab72b5f1a68d458e9690992d2d"><param name="Name" value="max_filter"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image.html#ga570d5aab72b5f1a68d458e9690992d2d"><param name="Name" value="fors_image"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaa9c11b7a42af4ca35e1b01e6cd9f8fde"><param name="Name" value="moses"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gab234d1358562b66925fb7223c087556b"><param name="Name" value="MAX_MESSAGE_LENGTH"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a54fd4d467ce3b51859fb581b23d384b4"><param name="Name" value="max_offset"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a9b637dbee7a14e588182802a46a33fc9"><param name="Name" value="max_search"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__extract__sky__stats.html#a34ef7014753f20e3313c0adc61970b9b"><param name="Name" value="mean"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__extract__sky__stats.html#a4b573f007e8305120e3e204a2f0210da"><param name="Name" value="median"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a6d3808d8f76ccba38a0b04b348f55071"><param name="Name" value="method"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g71645af45bc192964d3170f28c671240"><param name="Name" value="fors_angle_diff"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gc219cfea8dd4f3c5a0aceb222d19150a"><param name="Name" value="fors_frame_get_group_string"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gc02f8fba22227907e45bdcbe6de8655e"><param name="Name" value="fors_frame_get_level_string"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gf509a28ce04d6804eabe62b2a5817afe"><param name="Name" value="fors_frame_get_type_string"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g375049f68639265267adcdc11d161bc3"><param name="Name" value="fors_frame_print"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gea84af835a842fc000695c7ab11f350a"><param name="Name" value="fors_frameset_extract"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gc1181b0023db290ca5bfc42e9980e3a8"><param name="Name" value="fors_frameset_print"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g0c5895083b6713e4dcb39fde4a873c69"><param name="Name" value="fors_get_license"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga0b458bea611319b34643787b021d2d2"><param name="Name" value="fors_get_version_binary"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g833fbeca7835f9c594deb0a8752d8b74"><param name="Name" value="fors_imagelist_collapse_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g2d1787d975000e60e8790fc656d538f6"><param name="Name" value="fors_imagelist_collapse_median_create"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ge561fe29b3673b34094804e26ece5e8e"><param name="Name" value="fors_msg_macro"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g6f2731cef63a65795c0999284006a7c4"><param name="Name" value="fors_parameterlist_set_defaults"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044"><param name="Name" value="fors_rand_gauss"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#g2d2de37f396f758d304d234a5c38c861"><param name="Name" value="fors_type_get_string"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga3c534a3edd597c2c5a03f0ad0ccc8e3"><param name="Name" value="fors_utils_median_corr"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a6d3808d8f76ccba38a0b04b348f55071"><param name="Name" value="_extract_method"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__stack__method.html#a1ef465157d5630ba9517e8ef2b41a9fe"><param name="Name" value="_stack_method"></OBJECT>
   </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__stack__method.html#a1e2b6c25ab659ca91223e1553c9952b4"><param name="Name" value="method_name"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#a2686acc25aa9720d0f18bd87371cf7de"><param name="Name" value="min"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4a3877b69d2b9447dd06bb0a3d7a218d"><param name="Name" value="min_filter"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html"><param name="Name" value="Miscellaneous Utilities"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html"><param name="Name" value="MOS data reduction library"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2244278b632992a44067afcc42530954"><param name="Name" value="mos_apply_photometry"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b"><param name="Name" value="mos_arc_background"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gafeaa9b762d7da8437fef7f5f579c04ba"><param name="Name" value="mos_arc_background_1D"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gacff89218baba1abf3641c083a1125861"><param name="Name" value="mos_build_curv_coeff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4e4da9890ad8d0229f187b4d7eda17be"><param name="Name" value="mos_build_disp_coeff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gad9b2789388ba6564011d832d276b2ae6"><param name="Name" value="mos_build_slit_location"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga332b9bfd8e704446ad24d9fa448f9df2"><param name="Name" value="mos_check_multiplex"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae97d35cc8cb29cbb0b43d4fc84e4d34b"><param name="Name" value="mos_check_polarisation"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga71e13921907ec2f25478957d35318e7f"><param name="Name" value="mos_check_slits"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga5dcd6d3de142a64713afbe53d027d5dc"><param name="Name" value="mos_clean_bad_pixels"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a"><param name="Name" value="mos_clean_cosmics"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gac442710556a5013dedd29befac482c9d"><param name="Name" value="mos_compute_offset"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7"><param name="Name" value="mos_detect_objects"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2"><param name="Name" value="mos_distortions_rms"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a"><param name="Name" value="mos_eval_dds"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga5291b43599e8dec884137f867fe72bfd"><param name="Name" value="mos_extract_flux"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaf91a99846ae06aa780b59deced1fa215"><param name="Name" value="mos_extract_flux_mapped"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522"><param name="Name" value="mos_extract_objects"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga786e905bbeeb2ed400fdc91da43f34c0"><param name="Name" value="mos_extraction"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe"><param name="Name" value="mos_find_peaks"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga74be15e9eea7e1a4f025be22ccb12c54"><param name="Name" value="mos_get_gain_vimos"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac"><param name="Name" value="mos_get_maxobjs_per_slit"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaf4d5e8a0d6cd0356ab38f0b7be241352"><param name="Name" value="mos_get_nobjects"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gab847fe615b7510fc2d189e80cf5029b5"><param name="Name" value="mos_global_distortion"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga0eda8a5abf396113ffbe66607fd72fe6"><param name="Name" value="mos_global_trace"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga54bb23fbd64bd5c8a39942bdf0504801"><param name="Name" value="mos_hough_table"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97"><param name="Name" value="mos_identify_peaks"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364"><param name="Name" value="mos_identify_slits"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4cab3d7c4a4179a3057609caeda165ea"><param name="Name" value="mos_identify_slits_fast"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga1f574f5f45840ea69fa03eb26055a1b1"><param name="Name" value="mos_image_filter_median"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga82c7c158316d8aba35ffa271b44510c6"><param name="Name" value="mos_image_shift"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaa3a51e41cbbb1444cec84c4311821508"><param name="Name" value="mos_image_vertical_median_filter"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaba740d24473d57d687f75787e4ecc835"><param name="Name" value="mos_integrate_signal"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4"><param name="Name" value="mos_interpolate_wavecalib"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae5258889aa86b437e2531cdad02f4159"><param name="Name" value="mos_interpolate_wavecalib_slit"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga663cfcd4584b6a3e63e7593cba926688"><param name="Name" value="mos_ksigma_stack"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga28871a4ecc1e2779022f06d4da892360"><param name="Name" value="mos_lines_width"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gacb7a9fc2e237995f0f806cdf1ffcdaef"><param name="Name" value="mos_load_overscans_fors"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaf4872d8e8654dd8733369c071843e464"><param name="Name" value="mos_load_overscans_vimos"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga43072c6a57d094a5d7d341934a096e80"><param name="Name" value="mos_load_slits_fors_lss"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8"><param name="Name" value="mos_load_slits_fors_mos"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c"><param name="Name" value="mos_load_slits_fors_mxu"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga78aebb1592ccefba83f9b7cbb80a9676"><param name="Name" value="mos_load_slits_fors_pmos"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga3946bc30280b3b041a20ae9c9326f827"><param name="Name" value="mos_load_slits_vimos"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900"><param name="Name" value="mos_locate_spectra"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5"><param name="Name" value="mos_map_idscoeff"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga6187454ef3812203ba2d50d1e2d01326"><param name="Name" value="mos_map_pixel"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga8525f2b52eb7ba887858420f36c53471"><param name="Name" value="mos_map_spectrum"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7"><param name="Name" value="mos_map_wavelengths"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gac6224c743943d88920b1e93f7394d009"><param name="Name" value="mos_median_in_slit"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga55bdc661b2948918815f967ea860ffd4"><param name="Name" value="mos_montecarlo_polyfit"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga6b94ed200f4b1b8e281417a80b9aa4b5"><param name="Name" value="mos_normalise_flat"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2efbe02c8b5535d746bc9dd9ece30296"><param name="Name" value="mos_normalise_longflat"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga5f9947ec541f1291f7c9fb20bd081280"><param name="Name" value="mos_object_intersect"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gad80729870e3acf9f61c820f488eb83b2"><param name="Name" value="mos_peak_candidates"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaad62d9ba866b8abafb2da02053584bf2"><param name="Name" value="mos_photometric_calibration"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga8d5305df3cb184677081fb285cba6eb5"><param name="Name" value="mos_poly_pix2wav"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga7518d66581d93ab64704fcf90996296b"><param name="Name" value="mos_poly_trace"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4d584e69389518aab8d6932e5841d399"><param name="Name" value="mos_poly_wav2pix"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae8e4a9d1a1146de7ba72dd148848342d"><param name="Name" value="mos_propagate_photometry_error"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga11793c429e949f8fef308f70b0a815b4"><param name="Name" value="mos_randg"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2"><param name="Name" value="mos_randomise_image"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga942c51bf71113349f9b995494697e1a5"><param name="Name" value="mos_rebin_error"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga471c3968053462d6d945bc25cf36720e"><param name="Name" value="mos_rebin_signal"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gacfa971d995aac0c8f05c37499861d191"><param name="Name" value="mos_refine_peaks"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae623b8129e3fd33516f32d866c5106a8"><param name="Name" value="mos_refmask_find_gaps"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36"><param name="Name" value="mos_remove_bias"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae9f633b64e1880984c084a19f53047fc"><param name="Name" value="mos_resolution_table"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f"><param name="Name" value="mos_rotate_slits"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga854ead782f62a6929aade44b267353e0"><param name="Name" value="mos_saturation_process"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga12f4708f70422ee14ebc3ec5ca5ce981"><param name="Name" value="mos_seed"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4d9a8914b84889d4070ec27e446350b6"><param name="Name" value="mos_set_multiplex"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga40e43aa1516aac5fc7e2ccc41381677d"><param name="Name" value="mos_sky_local"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8"><param name="Name" value="mos_sky_local_old"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gab724daebffef27587b8183a6d765dc02"><param name="Name" value="mos_sky_map"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d"><param name="Name" value="mos_sky_map_super"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31"><param name="Name" value="mos_slit_closest_to_center"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga6910eeaa28338a6d447e74130666fe13"><param name="Name" value="mos_spatial_calibration"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4592493a392e23ebc56259ed3bfc0719"><param name="Name" value="mos_spatial_map"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga58039ea48fa183baf1701567781ad128"><param name="Name" value="mos_spectral_resolution"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0"><param name="Name" value="mos_subtract_background"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2"><param name="Name" value="mos_subtract_sky"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaad02c30291fd30d07156ac8f397f439f"><param name="Name" value="mos_trace_flat"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d"><param name="Name" value="mos_validate_slits"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga634eb7408671a139e7015185776f4513"><param name="Name" value="mos_wavelength_align"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1"><param name="Name" value="mos_wavelength_align_lss"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b"><param name="Name" value="mos_wavelength_calibration"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb"><param name="Name" value="mos_wavelength_calibration_final"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d"><param name="Name" value="mos_wavelength_calibration_raw"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html"><param name="Name" value="moses"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gd97e4b6ea81acb77e5ef8567a376482b"><param name="Name" value="mos_apply_photometry"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a"><param name="Name" value="mos_arc_background"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g8dd9103f12a5e6275cd03c3f2afee77a"><param name="Name" value="mos_arc_background_1D"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga010593249434f0bb667af2f2c950951"><param name="Name" value="mos_build_curv_coeff"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gc4a3f1981baef15668137f04c04cf710"><param name="Name" value="mos_build_disp_coeff"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g39dd696d6572e52031e12b1a53e505c2"><param name="Name" value="mos_build_slit_location"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gf2c5b165c7c2c4be802c03ae59d1b8a9"><param name="Name" value="mos_check_multiplex"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gd170543de1ad9f6f2e4f1167e3f4ef4e"><param name="Name" value="mos_check_polarisation"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g5ec455544df7dfc83da8fefc91a9afc7"><param name="Name" value="mos_check_slits"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g274cdc673e0d1684d9a730773a526115"><param name="Name" value="mos_clean_cosmics"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ge59e20e2bea761316fa1395d5d406965"><param name="Name" value="mos_compute_offset"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gb188299284e0b06070798cd2e80427af"><param name="Name" value="mos_detect_objects"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987"><param name="Name" value="mos_distortions_rms"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g99c7290af152957144e8c0413355e5dd"><param name="Name" value="mos_eval_dds"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gbff2b46bad7584f819ae28fdd8c85343"><param name="Name" value="mos_extract_flux"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga8abda7d8ad43a4c3287b7b9071f5094"><param name="Name" value="mos_extract_flux_mapped"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#geecf611c458a0b9645edad66538ad6e2"><param name="Name" value="mos_extract_objects"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g84eceb2b87667085a8215974f0a52446"><param name="Name" value="mos_find_peaks"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g75c3cb900989bb07dad294dd545021a6"><param name="Name" value="mos_get_gain_vimos"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g5a6b95084aacc3fbd59249b53912f048"><param name="Name" value="mos_get_maxobjs_per_slit"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7a41fa707f51ab0d55150ed8c4b19657"><param name="Name" value="mos_get_nobjects"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gdf9210c07ebddae07a3e5e99d88d2f5c"><param name="Name" value="mos_global_distortion"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5"><param name="Name" value="mos_global_trace"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g43123c837803fd95b01ba2870522ebaf"><param name="Name" value="mos_identify_peaks"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98"><param name="Name" value="mos_identify_slits"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g4fe5f2fe3227522421783758228cdc39"><param name="Name" value="mos_image_filter_median"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gf708c4804f0aa98415025f2f7ed31f11"><param name="Name" value="mos_image_shift"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g51c4d941feada9601c3e391058f4e653"><param name="Name" value="mos_integrate_signal"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3"><param name="Name" value="mos_interpolate_wavecalib"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga06affb6c77aac402204d1065f1de8ea"><param name="Name" value="mos_interpolate_wavecalib_slit"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660"><param name="Name" value="mos_ksigma_stack"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533"><param name="Name" value="mos_lines_width"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gde22c6582532e051c045baf0ee969e79"><param name="Name" value="mos_load_overscans_vimos"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g9ed25f68a53a8daa15d3c986e7bdfa48"><param name="Name" value="mos_load_slits_fors_lss"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g1786e7d23b46b135a98deb03986916a4"><param name="Name" value="mos_load_slits_fors_mos"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f"><param name="Name" value="mos_load_slits_fors_mxu"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g5bc87e2a7c15dd1686e02e2d65e057f5"><param name="Name" value="mos_load_slits_fors_pmos"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g3431a4557418ee0f8cd9beefd7153a98"><param name="Name" value="mos_load_slits_vimos"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g884857a604857727d2fc0d293b678209"><param name="Name" value="mos_locate_spectra"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec"><param name="Name" value="mos_map_idscoeff"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1"><param name="Name" value="mos_map_pixel"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g2940e2350a3c050fc3bff7af0e621c37"><param name="Name" value="mos_map_spectrum"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90"><param name="Name" value="mos_map_wavelengths"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g8395eca2d64406c969f48220024e999b"><param name="Name" value="mos_median_in_slit"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff"><param name="Name" value="mos_normalise_flat"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g9c5947c76fc1246f203a1c6ebc6c9569"><param name="Name" value="mos_normalise_longflat"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g621083edda685c07a318aa94f53bce6f"><param name="Name" value="mos_object_intersect"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g417edefcade103f40ba21dd3f9c29af1"><param name="Name" value="mos_peak_candidates"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gf3dd5a20a5f31b853c53ca419a8171e3"><param name="Name" value="mos_photometric_calibration"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g2d49af6d6595dda815a2475dd6de449a"><param name="Name" value="mos_poly_pix2wav"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414"><param name="Name" value="mos_poly_trace"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g0c895cc2e971156231313f7a16eb6212"><param name="Name" value="mos_poly_wav2pix"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ge20fadc56d3b4506d4ffd3015f394695"><param name="Name" value="mos_propagate_photometry_error"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7557973371ca804e0fab92c40b833f3c"><param name="Name" value="mos_randomise_image"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0"><param name="Name" value="mos_refine_peaks"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaabac93f2fab16b6c268e5ab494a7238"><param name="Name" value="mos_refmask_find_gaps"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90"><param name="Name" value="mos_remove_bias"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55"><param name="Name" value="mos_resolution_table"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ge119e728dd0161fc46fea905861425c1"><param name="Name" value="mos_rotate_slits"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a"><param name="Name" value="mos_saturation_process"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7cb83f67ed6d349ade9e38e7ed62f6fb"><param name="Name" value="mos_sky_local"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a"><param name="Name" value="mos_sky_local_old"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g21b37cf8c1fd568441a55740d34e2371"><param name="Name" value="mos_sky_map"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1"><param name="Name" value="mos_sky_map_super"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gc32b3fba956da20bd20530372b1b28d1"><param name="Name" value="mos_slit_closest_to_center"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g97cde563aea50318b61faf6c9355bdbe"><param name="Name" value="mos_spatial_calibration"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ge8df117eba59d1599f3172975b6f7139"><param name="Name" value="mos_spatial_map"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g9dab2e2448ef188d7f8fddd02483d919"><param name="Name" value="mos_spectral_resolution"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8"><param name="Name" value="mos_subtract_background"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f"><param name="Name" value="mos_subtract_sky"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g168f6aecd869c24634fa9f6690da0b02"><param name="Name" value="mos_trace_flat"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g0a1742caa67a002bee7a30f9d5289672"><param name="Name" value="mos_validate_slits"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3"><param name="Name" value="mos_wavelength_align"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g2523d130beaf8538187729f767c38805"><param name="Name" value="mos_wavelength_align_lss"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gb2cc63c200bab0a922efde3d20192443"><param name="Name" value="mos_wavelength_calibration"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2"><param name="Name" value="mos_wavelength_calibration_final"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c"><param name="Name" value="mos_wavelength_calibration_raw"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gd6f52daf658d36dcfdd4bddf72153b57"><param name="Name" value="READY"></OBJECT>
-  </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gd97e4b6ea81acb77e5ef8567a376482b"><param name="Name" value="mos_apply_photometry"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a"><param name="Name" value="mos_arc_background"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g8dd9103f12a5e6275cd03c3f2afee77a"><param name="Name" value="mos_arc_background_1D"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga010593249434f0bb667af2f2c950951"><param name="Name" value="mos_build_curv_coeff"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gc4a3f1981baef15668137f04c04cf710"><param name="Name" value="mos_build_disp_coeff"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g39dd696d6572e52031e12b1a53e505c2"><param name="Name" value="mos_build_slit_location"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gf2c5b165c7c2c4be802c03ae59d1b8a9"><param name="Name" value="mos_check_multiplex"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gd170543de1ad9f6f2e4f1167e3f4ef4e"><param name="Name" value="mos_check_polarisation"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g5ec455544df7dfc83da8fefc91a9afc7"><param name="Name" value="mos_check_slits"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g274cdc673e0d1684d9a730773a526115"><param name="Name" value="mos_clean_cosmics"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ge59e20e2bea761316fa1395d5d406965"><param name="Name" value="mos_compute_offset"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gb188299284e0b06070798cd2e80427af"><param name="Name" value="mos_detect_objects"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987"><param name="Name" value="mos_distortions_rms"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g99c7290af152957144e8c0413355e5dd"><param name="Name" value="mos_eval_dds"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gbff2b46bad7584f819ae28fdd8c85343"><param name="Name" value="mos_extract_flux"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga8abda7d8ad43a4c3287b7b9071f5094"><param name="Name" value="mos_extract_flux_mapped"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#geecf611c458a0b9645edad66538ad6e2"><param name="Name" value="mos_extract_objects"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g84eceb2b87667085a8215974f0a52446"><param name="Name" value="mos_find_peaks"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g75c3cb900989bb07dad294dd545021a6"><param name="Name" value="mos_get_gain_vimos"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g5a6b95084aacc3fbd59249b53912f048"><param name="Name" value="mos_get_maxobjs_per_slit"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7a41fa707f51ab0d55150ed8c4b19657"><param name="Name" value="mos_get_nobjects"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gdf9210c07ebddae07a3e5e99d88d2f5c"><param name="Name" value="mos_global_distortion"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5"><param name="Name" value="mos_global_trace"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g43123c837803fd95b01ba2870522ebaf"><param name="Name" value="mos_identify_peaks"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98"><param name="Name" value="mos_identify_slits"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g4fe5f2fe3227522421783758228cdc39"><param name="Name" value="mos_image_filter_median"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gf708c4804f0aa98415025f2f7ed31f11"><param name="Name" value="mos_image_shift"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g51c4d941feada9601c3e391058f4e653"><param name="Name" value="mos_integrate_signal"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3"><param name="Name" value="mos_interpolate_wavecalib"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga06affb6c77aac402204d1065f1de8ea"><param name="Name" value="mos_interpolate_wavecalib_slit"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660"><param name="Name" value="mos_ksigma_stack"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533"><param name="Name" value="mos_lines_width"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gde22c6582532e051c045baf0ee969e79"><param name="Name" value="mos_load_overscans_vimos"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g9ed25f68a53a8daa15d3c986e7bdfa48"><param name="Name" value="mos_load_slits_fors_lss"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g1786e7d23b46b135a98deb03986916a4"><param name="Name" value="mos_load_slits_fors_mos"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f"><param name="Name" value="mos_load_slits_fors_mxu"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g5bc87e2a7c15dd1686e02e2d65e057f5"><param name="Name" value="mos_load_slits_fors_pmos"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g3431a4557418ee0f8cd9beefd7153a98"><param name="Name" value="mos_load_slits_vimos"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g884857a604857727d2fc0d293b678209"><param name="Name" value="mos_locate_spectra"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec"><param name="Name" value="mos_map_idscoeff"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1"><param name="Name" value="mos_map_pixel"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g2940e2350a3c050fc3bff7af0e621c37"><param name="Name" value="mos_map_spectrum"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90"><param name="Name" value="mos_map_wavelengths"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g8395eca2d64406c969f48220024e999b"><param name="Name" value="mos_median_in_slit"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff"><param name="Name" value="mos_normalise_flat"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g9c5947c76fc1246f203a1c6ebc6c9569"><param name="Name" value="mos_normalise_longflat"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g621083edda685c07a318aa94f53bce6f"><param name="Name" value="mos_object_intersect"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g417edefcade103f40ba21dd3f9c29af1"><param name="Name" value="mos_peak_candidates"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gf3dd5a20a5f31b853c53ca419a8171e3"><param name="Name" value="mos_photometric_calibration"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g2d49af6d6595dda815a2475dd6de449a"><param name="Name" value="mos_poly_pix2wav"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414"><param name="Name" value="mos_poly_trace"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g0c895cc2e971156231313f7a16eb6212"><param name="Name" value="mos_poly_wav2pix"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ge20fadc56d3b4506d4ffd3015f394695"><param name="Name" value="mos_propagate_photometry_error"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7557973371ca804e0fab92c40b833f3c"><param name="Name" value="mos_randomise_image"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0"><param name="Name" value="mos_refine_peaks"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaabac93f2fab16b6c268e5ab494a7238"><param name="Name" value="mos_refmask_find_gaps"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90"><param name="Name" value="mos_remove_bias"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55"><param name="Name" value="mos_resolution_table"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ge119e728dd0161fc46fea905861425c1"><param name="Name" value="mos_rotate_slits"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a"><param name="Name" value="mos_saturation_process"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7cb83f67ed6d349ade9e38e7ed62f6fb"><param name="Name" value="mos_sky_local"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a"><param name="Name" value="mos_sky_local_old"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g21b37cf8c1fd568441a55740d34e2371"><param name="Name" value="mos_sky_map"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1"><param name="Name" value="mos_sky_map_super"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gc32b3fba956da20bd20530372b1b28d1"><param name="Name" value="mos_slit_closest_to_center"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g97cde563aea50318b61faf6c9355bdbe"><param name="Name" value="mos_spatial_calibration"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ge8df117eba59d1599f3172975b6f7139"><param name="Name" value="mos_spatial_map"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g9dab2e2448ef188d7f8fddd02483d919"><param name="Name" value="mos_spectral_resolution"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8"><param name="Name" value="mos_subtract_background"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f"><param name="Name" value="mos_subtract_sky"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g168f6aecd869c24634fa9f6690da0b02"><param name="Name" value="mos_trace_flat"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g0a1742caa67a002bee7a30f9d5289672"><param name="Name" value="mos_validate_slits"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3"><param name="Name" value="mos_wavelength_align"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#g2523d130beaf8538187729f767c38805"><param name="Name" value="mos_wavelength_align_lss"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gb2cc63c200bab0a922efde3d20192443"><param name="Name" value="mos_wavelength_calibration"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2"><param name="Name" value="mos_wavelength_calibration_final"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c"><param name="Name" value="mos_wavelength_calibration_raw"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gb2e886163098d674eb07e95d96b38229"><param name="Name" value="newForsPAF"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaad726bcd0d2380b05332fa6c7f1dea86"><param name="Name" value="fors_get_nobjs_perslit"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaffc2175d882864b6377743f89b29749b"><param name="Name" value="fors_get_object_position"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga9bc8b28c29504fc9005fe9745b18450b"><param name="Name" value="fors_mos_is_lss_like"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga99b5e66ad0a35407a2966d42e40836a2"><param name="Name" value="ksigma_vector"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga42ceb4d744e2387cc5694c8e2d73bf88"><param name="Name" value="map_table"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaa9c11b7a42af4ca35e1b01e6cd9f8fde"><param name="Name" value="max_filter"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4a3877b69d2b9447dd06bb0a3d7a218d"><param name="Name" value="min_filter"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2244278b632992a44067afcc42530954"><param name="Name" value="mos_apply_photometry"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b"><param name="Name" value="mos_arc_background"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gafeaa9b762d7da8437fef7f5f579c04ba"><param name="Name" value="mos_arc_background_1D"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gacff89218baba1abf3641c083a1125861"><param name="Name" value="mos_build_curv_coeff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4e4da9890ad8d0229f187b4d7eda17be"><param name="Name" value="mos_build_disp_coeff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gad9b2789388ba6564011d832d276b2ae6"><param name="Name" value="mos_build_slit_location"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga332b9bfd8e704446ad24d9fa448f9df2"><param name="Name" value="mos_check_multiplex"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae97d35cc8cb29cbb0b43d4fc84e4d34b"><param name="Name" value="mos_check_polarisation"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga71e13921907ec2f25478957d35318e7f"><param name="Name" value="mos_check_slits"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga5dcd6d3de142a64713afbe53d027d5dc"><param name="Name" value="mos_clean_bad_pixels"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a"><param name="Name" value="mos_clean_cosmics"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gac442710556a5013dedd29befac482c9d"><param name="Name" value="mos_compute_offset"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7"><param name="Name" value="mos_detect_objects"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2"><param name="Name" value="mos_distortions_rms"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a"><param name="Name" value="mos_eval_dds"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga5291b43599e8dec884137f867fe72bfd"><param name="Name" value="mos_extract_flux"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaf91a99846ae06aa780b59deced1fa215"><param name="Name" value="mos_extract_flux_mapped"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522"><param name="Name" value="mos_extract_objects"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga786e905bbeeb2ed400fdc91da43f34c0"><param name="Name" value="mos_extraction"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe"><param name="Name" value="mos_find_peaks"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga74be15e9eea7e1a4f025be22ccb12c54"><param name="Name" value="mos_get_gain_vimos"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac"><param name="Name" value="mos_get_maxobjs_per_slit"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaf4d5e8a0d6cd0356ab38f0b7be241352"><param name="Name" value="mos_get_nobjects"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gab847fe615b7510fc2d189e80cf5029b5"><param name="Name" value="mos_global_distortion"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga0eda8a5abf396113ffbe66607fd72fe6"><param name="Name" value="mos_global_trace"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga54bb23fbd64bd5c8a39942bdf0504801"><param name="Name" value="mos_hough_table"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97"><param name="Name" value="mos_identify_peaks"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364"><param name="Name" value="mos_identify_slits"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4cab3d7c4a4179a3057609caeda165ea"><param name="Name" value="mos_identify_slits_fast"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga1f574f5f45840ea69fa03eb26055a1b1"><param name="Name" value="mos_image_filter_median"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga82c7c158316d8aba35ffa271b44510c6"><param name="Name" value="mos_image_shift"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaa3a51e41cbbb1444cec84c4311821508"><param name="Name" value="mos_image_vertical_median_filter"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaba740d24473d57d687f75787e4ecc835"><param name="Name" value="mos_integrate_signal"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4"><param name="Name" value="mos_interpolate_wavecalib"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae5258889aa86b437e2531cdad02f4159"><param name="Name" value="mos_interpolate_wavecalib_slit"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga663cfcd4584b6a3e63e7593cba926688"><param name="Name" value="mos_ksigma_stack"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga28871a4ecc1e2779022f06d4da892360"><param name="Name" value="mos_lines_width"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gacb7a9fc2e237995f0f806cdf1ffcdaef"><param name="Name" value="mos_load_overscans_fors"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaf4872d8e8654dd8733369c071843e464"><param name="Name" value="mos_load_overscans_vimos"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga43072c6a57d094a5d7d341934a096e80"><param name="Name" value="mos_load_slits_fors_lss"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8"><param name="Name" value="mos_load_slits_fors_mos"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c"><param name="Name" value="mos_load_slits_fors_mxu"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga78aebb1592ccefba83f9b7cbb80a9676"><param name="Name" value="mos_load_slits_fors_pmos"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga3946bc30280b3b041a20ae9c9326f827"><param name="Name" value="mos_load_slits_vimos"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900"><param name="Name" value="mos_locate_spectra"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5"><param name="Name" value="mos_map_idscoeff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga6187454ef3812203ba2d50d1e2d01326"><param name="Name" value="mos_map_pixel"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga8525f2b52eb7ba887858420f36c53471"><param name="Name" value="mos_map_spectrum"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7"><param name="Name" value="mos_map_wavelengths"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gac6224c743943d88920b1e93f7394d009"><param name="Name" value="mos_median_in_slit"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga55bdc661b2948918815f967ea860ffd4"><param name="Name" value="mos_montecarlo_polyfit"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga6b94ed200f4b1b8e281417a80b9aa4b5"><param name="Name" value="mos_normalise_flat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2efbe02c8b5535d746bc9dd9ece30296"><param name="Name" value="mos_normalise_longflat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga5f9947ec541f1291f7c9fb20bd081280"><param name="Name" value="mos_object_intersect"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gad80729870e3acf9f61c820f488eb83b2"><param name="Name" value="mos_peak_candidates"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaad62d9ba866b8abafb2da02053584bf2"><param name="Name" value="mos_photometric_calibration"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga8d5305df3cb184677081fb285cba6eb5"><param name="Name" value="mos_poly_pix2wav"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga7518d66581d93ab64704fcf90996296b"><param name="Name" value="mos_poly_trace"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4d584e69389518aab8d6932e5841d399"><param name="Name" value="mos_poly_wav2pix"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae8e4a9d1a1146de7ba72dd148848342d"><param name="Name" value="mos_propagate_photometry_error"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga11793c429e949f8fef308f70b0a815b4"><param name="Name" value="mos_randg"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2"><param name="Name" value="mos_randomise_image"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga942c51bf71113349f9b995494697e1a5"><param name="Name" value="mos_rebin_error"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga471c3968053462d6d945bc25cf36720e"><param name="Name" value="mos_rebin_signal"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gacfa971d995aac0c8f05c37499861d191"><param name="Name" value="mos_refine_peaks"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae623b8129e3fd33516f32d866c5106a8"><param name="Name" value="mos_refmask_find_gaps"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36"><param name="Name" value="mos_remove_bias"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae9f633b64e1880984c084a19f53047fc"><param name="Name" value="mos_resolution_table"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f"><param name="Name" value="mos_rotate_slits"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga854ead782f62a6929aade44b267353e0"><param name="Name" value="mos_saturation_process"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga12f4708f70422ee14ebc3ec5ca5ce981"><param name="Name" value="mos_seed"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4d9a8914b84889d4070ec27e446350b6"><param name="Name" value="mos_set_multiplex"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga40e43aa1516aac5fc7e2ccc41381677d"><param name="Name" value="mos_sky_local"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8"><param name="Name" value="mos_sky_local_old"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gab724daebffef27587b8183a6d765dc02"><param name="Name" value="mos_sky_map"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d"><param name="Name" value="mos_sky_map_super"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31"><param name="Name" value="mos_slit_closest_to_center"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga6910eeaa28338a6d447e74130666fe13"><param name="Name" value="mos_spatial_calibration"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga4592493a392e23ebc56259ed3bfc0719"><param name="Name" value="mos_spatial_map"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga58039ea48fa183baf1701567781ad128"><param name="Name" value="mos_spectral_resolution"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0"><param name="Name" value="mos_subtract_background"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2"><param name="Name" value="mos_subtract_sky"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaad02c30291fd30d07156ac8f397f439f"><param name="Name" value="mos_trace_flat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d"><param name="Name" value="mos_validate_slits"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga634eb7408671a139e7015185776f4513"><param name="Name" value="mos_wavelength_align"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1"><param name="Name" value="mos_wavelength_align_lss"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b"><param name="Name" value="mos_wavelength_calibration"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb"><param name="Name" value="mos_wavelength_calibration_final"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d"><param name="Name" value="mos_wavelength_calibration_raw"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gac364320ace1ba81e8b8cc6006984fa38"><param name="Name" value="peakPosition"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga009ad02d129fce6b3654988294e47083"><param name="Name" value="polysmooth"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaa4c998dbbc796d2ed8bfa1268b9445fc"><param name="Name" value="read_global_distortion"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gad1235d5ce36f7267285e82dccd428aa6"><param name="Name" value="READY"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gac14a40e48e9622b47fe4f2499a57c8c6"><param name="Name" value="robustLinearFit"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga70f564e02f4b862b24c1d8d9b02013f7"><param name="Name" value="SEGNO"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga61e997c247b271c47fd08ff61a533431"><param name="Name" value="smo_filter"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga73b4710964bfb9142f3d7b65f5ebea31"><param name="Name" value="values_to_dx"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga598a249ae0afb47b4c7740180195ec98"><param name="Name" value="write_global_distortion"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html"><param name="Name" value="multiset"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga84ddcd8e89c40b0b134af4fbfa620172"><param name="Name" value="abs_dev"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a"><param name="Name" value="assure"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga1d98257a6428bdaa421182c98fa678fb"><param name="Name" value="kth"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga53649894f899f4009ab1d2acf776ac58"><param name="Name" value="list_calloc"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga883631f4b10a6d912b5508353743c0da"><param name="Name" value="list_delete"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga71cc8d784aff4653ac6bd8e0724780e4"><param name="Name" value="list_delete_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gac2d7ea2bf8ee3637bc9167916e637f30"><param name="Name" value="list_duplicate"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gaf355fe5f4ce5910b419c80ae14bf5199"><param name="Name" value="list_extract"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gaf21759c8c3e2901f5c975b92c242b928"><param name="Name" value="list_first"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gab3cf221632da8cbfa6ba17ce46c19be5"><param name="Name" value="list_first_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga9fb3208157c8385a1c5820c70d974221"><param name="Name" value="list_first_pair"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gabcb549a35d8d77e9f67f0222b317151f"><param name="Name" value="list_first_pair_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga61ba21429b4fde5f5ab252547acafce2"><param name="Name" value="list_free"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gac96b31bf7509ede319e5dd7b6a57c8b7"><param name="Name" value="list_insert"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga7e7725d1601b893517c7b7f80133d73e"><param name="Name" value="list_kth"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gad758e8f1d12a4ef2b2c70583436a4019"><param name="Name" value="list_kth_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gaca58359f15efcb94ba70cf9a3b70f509"><param name="Name" value="list_kth_val"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga2686278ac8d813c922895dc7497d9328"><param name="Name" value="list_kth_val_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga783b95234c567cbeeb59b3009eead316"><param name="Name" value="list_mad"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga4d27e95761e1b21498ad7653acc80d35"><param name="Name" value="list_malloc"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga4a0dc8306e5e3658abe167531b09aa8d"><param name="Name" value="list_max"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga44c7a16d614151b241aaf52fdbc2257b"><param name="Name" value="list_max_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga2fabd89564e393c78bf3037468ec546b"><param name="Name" value="list_max_val"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga72f528df806c961a28a9c83de3cb89f3"><param name="Name" value="list_mean"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga6d08786bc84010dfd382ae36608d74f1"><param name="Name" value="list_mean_optimal"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga8d5240ec55c316b3774abeb9333347b7"><param name="Name" value="list_median"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gafaa8c6edd6f50c03b04bed76ea83a20f"><param name="Name" value="list_min"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga307e4525ac81a6cabbf03913be5eb0d4"><param name="Name" value="list_min_val"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga9b9a23d98f58af888b2d2d3072f8b999"><param name="Name" value="list_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gadec72210f2c923dfe7892b9d2061ba5c"><param name="Name" value="list_next"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga90ccfa07b503becbebf18febc26bde05"><param name="Name" value="list_next_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gae16b00f64fd94c4fd10309662bfd8713"><param name="Name" value="list_next_pair"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga92413bd987bc459aa793986b7fdcc0b3"><param name="Name" value="list_next_pair_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga7023af2bbc45d072011310fb7c57d102"><param name="Name" value="list_realloc"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga82f27bf059a874514b690eb87485b3a9"><param name="Name" value="list_remove"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#gad865955a3a3615158490e2ca7eb4e051"><param name="Name" value="list_remove_const"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga46e0a8576f5289344cbacf63e7fbe008"><param name="Name" value="list_reverse"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga6dd47461521abb4788903e8845df8665"><param name="Name" value="list_size"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga304352750f0a5f58b2d1a0f27debc5b3"><param name="Name" value="val_less_than"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#a8277746dbb0ef7626fbc103f763ebcf1"><param name="Name" value="name"></OBJECT>
+  <UL>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#a8277746dbb0ef7626fbc103f763ebcf1"><param name="Name" value="_FORS_PAF_"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a6d69378eba6870b6fa93c3a3cf63910d"><param name="Name" value="_FORS_PAF_RECORD_"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#ac5b93743c2acada36da7bc7a1813d49a"><param name="Name" value="_fors_std_star"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__filterlist.html#a8e52775ad3bdf1e32a80fc71b5f2d766"><param name="Name" value="fors_filterlist"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__cpl__wcs__.html#aa75d49f978e1ff975e9cb68f09c16c18"><param name="Name" value="naxis"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a98ec6209ab8334189fdeb0ba9ad6db62"><param name="Name" value="ncat"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga7aef24280b6605d6dfbb063bab8da2f4"><param name="Name" value="newForsPAF"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#ae6e4dfc62b72ede7cc3eb94f9442567d"><param name="Name" value="nh"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__fit__ncoeff__paropts.html#ab76b332d6365e313b87b982ddd8d7e82"><param name="Name" value="no"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#a819813f81b4540eff32231e77d9c52e9"><param name="Name" value="nr"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a42bd374120c9b0d6c6798af05c91551a"><param name="Name" value="nsource"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__fit__ncoeff__paropts.html#a08987910ff3a46771ef8be900227a160"><param name="Name" value="one"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a92513c57462f561ade748dc83b98a126"><param name="Name" value="orientation"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html"><param name="Name" value="PAF File Utilities"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#gab071a13455e158378961f71fa097bd52"><param name="Name" value="pafFile"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga5c762ae2035aed31e7aeec22229b70c2"><param name="Name" value="pafIndex"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__stack__method.html#ae9a565dbc8376609af43fe07ed0f0213"><param name="Name" value="pars"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gac364320ace1ba81e8b8cc6006984fa38"><param name="Name" value="peakPosition"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__fit__ncoeff__paropts.html#aaff216c4aa211359f1ea111bd01914f8"><param name="Name" value="perframe"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__fit__ncoeff__paropts.html#afdf29f5482d381fad567846d0ecb1d23"><param name="Name" value="pernight"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#ae3f5db0d44371b78ea7b9a48d3959d59"><param name="Name" value="pixel"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gefe94695ad068025eff46fe69998e75d"><param name="Name" value="deleteForsPAF"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#g15b886f9811c703203b77a91e3bd0e91"><param name="Name" value="forsPAFAppendBool"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gdd6ed0c50b7cf4c62fdbabd0794487e4"><param name="Name" value="forsPAFAppendDouble"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gde7f65f7ca0d7e3e24babefd2c8d8716"><param name="Name" value="forsPAFAppendInt"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gf615f1fbc45dd108391de129e67d58b2"><param name="Name" value="forsPAFAppendString"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gb39490ffdb9ac9b2e666d75da2436b65"><param name="Name" value="forsPAFGetSize"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ge80d2196e3845f5857f374416333edbc"><param name="Name" value="forsPAFIsEmpty"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#g1f2dc4168ff0251fc4f270602a157917"><param name="Name" value="forsPAFIsValidName"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#g2cceff721bbbd99c1a4bddfb57ed688b"><param name="Name" value="forsPAFWrite"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#gb2e886163098d674eb07e95d96b38229"><param name="Name" value="newForsPAF"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#ae3f5db0d44371b78ea7b9a48d3959d59"><param name="Name" value="_fors_star"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#aea102ea39ac9dabba780b1987f482a16"><param name="Name" value="_fors_std_star"></OBJECT>
   </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ae59b404fa0dba639061578c018d065c3"><param name="Name" value="pixel_scale"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga009ad02d129fce6b3654988294e47083"><param name="Name" value="polysmooth"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#afa4b9f6616d7219b907a39644c30d86e"><param name="Name" value="prescan_x"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a460677f3aa1cb2bbccbaf5508a29fad5"><param name="Name" value="prescan_y"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__qc__test.html"><param name="Name" value="QC test"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html"><param name="Name" value="Quality Control Utilities"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#adbe20f51d01cd493bc9509c4a771f0aa"><param name="Name" value="ra"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#aabea542697d213367713130b5e97aa9e"><param name="Name" value="ratsq"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a34aa5b8ca5d983d3331a702eb2252540"><param name="Name" value="read_clock"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g0bdbc90121da69da75af1f60bfb553cc"><param name="Name" value="fors_header_write_double"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g3732f2464bb007412951345e03594a17"><param name="Name" value="fors_header_write_string"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03"><param name="Name" value="fors_qc_end_group"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g44d5359f81302747fff155c168c88200"><param name="Name" value="fors_qc_keyword_to_paf"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b"><param name="Name" value="fors_qc_start_group"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g033fc0f2f9e321c4ac98ee7f412b2c6e"><param name="Name" value="fors_qc_write_double"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g1ccea526719a1be6c14de81963d81955"><param name="Name" value="fors_qc_write_group_heading"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38"><param name="Name" value="fors_qc_write_qc_double"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#ga4480637fba9623895546614d7a21fb5"><param name="Name" value="fors_qc_write_qc_string"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4"><param name="Name" value="fors_qc_write_string"></OBJECT>
-  </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gd6f52daf658d36dcfdd4bddf72153b57"><param name="Name" value="READY"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g75a60ee291780e6bbaeeb68313c112f0"><param name="Name" value="remove_large_scale"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#g34064d266d0016050844a2e2c9e1a59c"><param name="Name" value="remove_large_scale_fit"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science__test.html"><param name="Name" value="science recipe tests"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html"><param name="Name" value="Simulate data for unit testing"></OBJECT>
-  <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a"><param name="Name" value="create_bias"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gb54d8ef52e4f8e0407e522565b8919f6"><param name="Name" value="create_dark"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5"><param name="Name" value="create_phot_table"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g474967528c2d1de8ce4dadd24da817ce"><param name="Name" value="create_screen_flat"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669"><param name="Name" value="create_sky_flat"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b"><param name="Name" value="create_standard"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2"><param name="Name" value="create_standard_keys"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410"><param name="Name" value="create_std_cat"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a"><param name="Name" value="frame_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a34aa5b8ca5d983d3331a702eb2252540"><param name="Name" value="_fors_setting"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gaccccf93617eb75a09e97cc2ee96b5e28"><param name="Name" value="test_simulate"></OBJECT>
   </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html"><param name="Name" value="Source identification"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gaa4c998dbbc796d2ed8bfa1268b9445fc"><param name="Name" value="read_global_distortion"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gad1235d5ce36f7267285e82dccd428aa6"><param name="Name" value="READY"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__recipes__test.html"><param name="Name" value="Recipes_test"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__recipes__test.html"><param name="Name" value="recipes_test"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__.html#af406fb3edb547a0608a76c93b8b6f6c8"><param name="Name" value="records"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#a45a7832dd782c60047ff9c16446882fe"><param name="Name" value="ref"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gabe250dfa6d750ed0de8e583c614a7dae"><param name="Name" value="remove_large_scale"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga28678e6bba93d507e39ef08578423528"><param name="Name" value="remove_large_scale_fit"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gaa6f08c08604f669d5248a50db05095c6"><param name="Name" value="REQ_CPL_MAJOR"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gaab1b7d291b65c497a7a4d32822095d10"><param name="Name" value="REQ_CPL_MICRO"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#gae2b8645924a1fcbfb414a387b6f33b3b"><param name="Name" value="REQ_CPL_MINOR"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structfors__extract__sky__stats.html#a89ab5c0e95ab5b986fb9fcf872479e2f"><param name="Name" value="rms"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#gac14a40e48e9622b47fe4f2499a57c8c6"><param name="Name" value="robustLinearFit"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ae9590b2375ae5ca7ae94801da9ad76fd"><param name="Name" value="ron"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g7502079c2fbec8364ec5dfe2e2c6ad9b"><param name="Name" value="distsq_shift"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g879f2fc7b296f37722f6203d0ead78b6"><param name="Name" value="fors_identify"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g62b335e73ad633535e1494f9ffd0cd03"><param name="Name" value="fors_identify_define_parameters"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g2763139bd0ceba14e3be219d5d043e46"><param name="Name" value="fors_identify_method_new"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#gdfc439dadf11b131119fe17cb19f6e25"><param name="Name" value="inside_region"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g3c4ce99ce7472d6d48acffcf562b0fb7"><param name="Name" value="match_patterns"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g4a762f4e872e3f797ba890c9d93eb98c"><param name="Name" value="star_brighter_than"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#gd13e1eb3050a7a1933760649f74fa14a"><param name="Name" value="star_nearer"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g5e7cadfe27ffb45ccfa00905d520878e"><param name="Name" value="std_brighter_than"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#ae9590b2375ae5ca7ae94801da9ad76fd"><param name="Name" value="_fors_setting"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga845c0025feb573da6be78f920081e6b4"><param name="Name" value="test_simulate"></OBJECT>
   </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science__test.html"><param name="Name" value="science recipe tests"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__identify__method.html#a751e9793a2bf184209201ec0403db027"><param name="Name" value="search"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga70f564e02f4b862b24c1d8d9b02013f7"><param name="Name" value="SEGNO"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a197ac0fb50916f94924f82b189a03ee3"><param name="Name" value="semi_major"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a4897b86d4c154c0764b80c1ddcab20e1"><param name="Name" value="semi_minor"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a4b963442d71be80738b5994e97c75b36"><param name="Name" value="sex_config"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#aa51edfe17fbf90e81405a4d343d6211f"><param name="Name" value="sex_exe"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a0cb0c99c37ef47b7569955e8f42adbf6"><param name="Name" value="sex_mag"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a4ddadecb69b1867762accb298da7e7d7"><param name="Name" value="sex_magerr"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__extract__method.html#a94aa696ea0cf75d5a40545f6ada13e43"><param name="Name" value="sex_radius"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html"><param name="Name" value="Simulate data for unit testing"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structlist.html#a3b03adad0c0429bae9493667ff366dc2"><param name="Name" value="size"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga61e997c247b271c47fd08ff61a533431"><param name="Name" value="smo_filter"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__photometry.html#gaea9cb9001e8b6630c660038e0bc5eb39"><param name="Name" value="solve_normal"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html"><param name="Name" value="Source identification"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html"><param name="Name" value="Standard star catalogue tests"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star__test.html"><param name="Name" value="Star tests"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html"><param name="Name" value="star"></OBJECT>
-  <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ge16bb0528b96ccf4cf953a1bce835b23"><param name="Name" value="_get_optional_table_value"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g100f4290bf02ce348f22092f4e2bc3eb"><param name="Name" value="fors_star_brighter_than"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g1ef535783913303ad950792cdd1d59c8"><param name="Name" value="fors_star_check_values"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#ga60434ffb49dd362b252cd2fb31d8787"><param name="Name" value="fors_star_delete"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g40fa6037fee74abd5a9d5166137609e0"><param name="Name" value="fors_star_delete_but_standard"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g21eca2e7981ea38bc0b5a66edfc56bb9"><param name="Name" value="fors_star_distsq"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g0505b201c585e91e65e968e84d2c1e62"><param name="Name" value="fors_star_duplicate"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gdef23fa2c1ad1c4f2b0de18038b0daca"><param name="Name" value="fors_star_ellipticity"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g9c8d5a74ebe2cbcd3fdde0186eef7b98"><param name="Name" value="fors_star_equal"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g4f81e6410fe5c7aefbdbcae907095059"><param name="Name" value="fors_star_extension"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gf5098d0eb78be73a27de34f0a9b7e9b0"><param name="Name" value="fors_star_get_x"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g724787234aa813e44d2aa7a6cae46b3e"><param name="Name" value="fors_star_get_y"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gb718ac03773576fc6856847b4211ffba"><param name="Name" value="fors_star_get_zeropoint"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g22fc7f95537194266794e24345cdda0b"><param name="Name" value="fors_star_get_zeropoint_err"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g41b7ffa8530d0ffbc45916248663ac45"><param name="Name" value="fors_star_is_identified"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g548c477088fd4fbadd74fd84f3becb94"><param name="Name" value="fors_star_new"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#gec880ac28409dd535ec3138e0b5b001c"><param name="Name" value="fors_star_new_from_table"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g89b5801d41c9760d82ec12097e14b584"><param name="Name" value="fors_star_print"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g8ab50c70291d9ed66d075ce9ae93577d"><param name="Name" value="fors_star_print_list"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star.html#g310c2402602378a7505a36a85ee98c7b"><param name="Name" value="fors_star_stellarity"></OBJECT>
-  </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g4a762f4e872e3f797ba890c9d93eb98c"><param name="Name" value="star_brighter_than"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#gd13e1eb3050a7a1933760649f74fa14a"><param name="Name" value="star_nearer"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#g5e7cadfe27ffb45ccfa00905d520878e"><param name="Name" value="std_brighter_than"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star__test.html"><param name="Name" value="Star tests"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a7160e3b4c104ece8465a3bc53055b79f"><param name="Name" value="star"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga75bfe0adc06bd97c18925132d4abf937"><param name="Name" value="star_brighter_than"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="structentry.html#a7cd70b41d3e63bdce7316482b08ed1e3"><param name="Name" value="star_index"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga95a6f76b39659c4ce77f5f4ae3366a6f"><param name="Name" value="star_nearer"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify.html#ga1c91776ec58d5026026e00580f18f277"><param name="Name" value="std_brighter_than"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__utils.html#ga8e2fcfe074b6da07c0b50aa07467666c"><param name="Name" value="STDEV_PR_MAD"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a8dd06110ea67874e1272756d9f4d819c"><param name="Name" value="stellarity_index"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga7238fed70c78643d055c79a8bd510356"><param name="Name" value="strlower"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack__test.html"><param name="Name" value="Test image stacking"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html"><param name="Name" value="Test of image module"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias__test.html"><param name="Name" value="test of master bias recipe"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark__test.html"><param name="Name" value="test of master dark recipe"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat__test.html"><param name="Name" value="test of screen flat recipe"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat__test.html"><param name="Name" value="test of sky flat recipe"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gfdcc2d4527a4292dffdb89df2e25e3a5"><param name="Name" value="test_abs_macro"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga03e8561e85f5310576a5bf2ca4ffd63"><param name="Name" value="test_end_macro"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#g1da2e46a3658d3b80d1060ab04747507"><param name="Name" value="test_eq_macro"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#g9c58a98a4f063f11ac233b3e11228485"><param name="Name" value="test_eq_string_macro"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gdf5b021e357a2554f044454d0b886ec6"><param name="Name" value="test_init_macro"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gab4f8f05aaa5e3f196c6353866f94981"><param name="Name" value="test_macro"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#g8bf3870fd210f34561f4f3f6010370a4"><param name="Name" value="test_nfail"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ge4730f9510e545e738aef9c8b7459b8b"><param name="Name" value="test_recipe_output"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#g179ca9b6adab6c5e9c1b4259f08c16d7"><param name="Name" value="test_rel_macro"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__test.html#g42fa16bf6366aa153d18ccc091115217"><param name="Name" value="test_version"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html"><param name="Name" value="Tools for Polynomial Coefficient Handling"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html"><param name="Name" value="test"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#gb42d337eb5aa13043bca8fb1aedb1679"><param name="Name" value="fors_polynomial_count_coeff"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#ga116e293092bfb1db2c5e90504e90cc0"><param name="Name" value="fors_polynomial_create_variance_polynomial"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g9543c3772a67bbb0ed04ec9f243294bb"><param name="Name" value="fors_polynomial_dump"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g9226c84960cf7e2ab0f1b867f8317cd5"><param name="Name" value="fors_polynomial_is_coeff_set"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g265e60c227964d991c159e3c9b8a82c0"><param name="Name" value="fors_polynomial_powers_find_first_coeff"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g2ce4065757620ca5d75d4343e9c8f073"><param name="Name" value="fors_polynomial_powers_find_next_coeff"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g5d5e2697050554c599837146744408fc"><param name="Name" value="fors_polynomial_powers_next"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g2255e6cc731c54c6b5575e506bd5fea8"><param name="Name" value="fors_polynomial_set_existing_coeff"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html#g54a749f0fe51db3713c776ffe5dd0b57"><param name="Name" value="fors_polynomial_sprint_coeff"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd"><param name="Name" value="_test"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gad490b5a7e4529d40b2ccad526c9df56d"><param name="Name" value="error_init"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gae93f165e1b26c1b98e4ec9457a06714b"><param name="Name" value="test_abs_macro"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga27e574128e77cc503295df8191f583e5"><param name="Name" value="test_end_macro"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga0b29bcb36a03d68f05034d446b93b060"><param name="Name" value="test_eq_macro"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga393dca2c7f94fd2f47722083cda8d369"><param name="Name" value="test_eq_string_macro"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gab73f634dbde2ec1403f0508d5c1d987b"><param name="Name" value="test_init_macro"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga69c8e2113cda1f0384f518415c224aeb"><param name="Name" value="test_macro"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8"><param name="Name" value="test_nfail"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c"><param name="Name" value="test_recipe_output"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga9cdeb6a0e44a5e2197eedce28865f000"><param name="Name" value="test_rel_macro"></OBJECT>
   </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html"><param name="Name" value="Unit test infrastructure"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gae93f165e1b26c1b98e4ec9457a06714b"><param name="Name" value="test_abs_macro"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias__test.html#ga56ca9e6f3e38b35931c68ecb147b1f75"><param name="Name" value="test_bias"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__dark__test.html#ga6b1c753a8c15cc5119ef13fda435ecbf"><param name="Name" value="test_dark"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html#gadfc8e1d36263b0fd8876efba7434a5af"><param name="Name" value="test_dist"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga0383c55336d7d782ab9f4fc614f9b0e0"><param name="Name" value="test_divide"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga27e574128e77cc503295df8191f583e5"><param name="Name" value="test_end_macro"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga0b29bcb36a03d68f05034d446b93b060"><param name="Name" value="test_eq_macro"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga393dca2c7f94fd2f47722083cda8d369"><param name="Name" value="test_eq_string_macro"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga69074b617f26911b58cda3a0fa13c918"><param name="Name" value="test_exponential"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__identify__test.html#ga9d562f61b66fedca2d53604fa93c8328"><param name="Name" value="test_identify"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga8e2e648513e2b6ee3843dd026130d7a2"><param name="Name" value="test_image"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__science__test.html#ga64116c898e3e40a355dad7fec89f65a8"><param name="Name" value="test_img_science"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat__test.html#gaa7f97a660fe457c4a77d4269200b6162"><param name="Name" value="test_img_screen_flat"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__sky__flat__test.html#ga885513ffa26feb33dd89087279376767"><param name="Name" value="test_img_sky_flat"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gab73f634dbde2ec1403f0508d5c1d987b"><param name="Name" value="test_init_macro"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__list__test.html#ga88f16a899d9e287cf6d84a9ba4754507"><param name="Name" value="test_list"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga69c8e2113cda1f0384f518415c224aeb"><param name="Name" value="test_macro"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga3fb4147d1739891fdc6ae6132e87d0bd"><param name="Name" value="test_median_filter"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__std__cat__test.html#ga47ae58a634c68c2d37cf5f90ac247fa5"><param name="Name" value="test_new"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8"><param name="Name" value="test_nfail"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__pattern__test.html#ga05781d2ba3b01b5ddbc4dd9dfe0eda77"><param name="Name" value="test_pattern"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html#gad87df141a27d7e06e22c0e912ae029e6"><param name="Name" value="test_photometry"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__point__test.html#ga2c261e462483c35aa06be9ac1ff0d683"><param name="Name" value="test_point"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__qc__test.html#gabf987906c0b52a3ada25d6c611845f5c"><param name="Name" value="test_qc"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c"><param name="Name" value="test_recipe_output"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga9cdeb6a0e44a5e2197eedce28865f000"><param name="Name" value="test_rel_macro"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__setting__test.html#gafa8c7ae8a3758428e457eb26c91c0da7"><param name="Name" value="test_setting"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html"><param name="Name" value="test_simulate"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gf80c8e8f1596284c4a41600a7d381e92"><param name="Name" value="_test"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#g57cf6e6e2826eb178fd2d9c3e5695343"><param name="Name" value="cleanup"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gfdcc2d4527a4292dffdb89df2e25e3a5"><param name="Name" value="test_abs_macro"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ga03e8561e85f5310576a5bf2ca4ffd63"><param name="Name" value="test_end_macro"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#g1da2e46a3658d3b80d1060ab04747507"><param name="Name" value="test_eq_macro"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#g9c58a98a4f063f11ac233b3e11228485"><param name="Name" value="test_eq_string_macro"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gdf5b021e357a2554f044454d0b886ec6"><param name="Name" value="test_init_macro"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#gab4f8f05aaa5e3f196c6353866f94981"><param name="Name" value="test_macro"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#g8bf3870fd210f34561f4f3f6010370a4"><param name="Name" value="test_nfail"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#ge4730f9510e545e738aef9c8b7459b8b"><param name="Name" value="test_recipe_output"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html#g179ca9b6adab6c5e9c1b4259f08c16d7"><param name="Name" value="test_rel_macro"></OBJECT>
-  </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__vimos__calib__impl.html#gf710e60eea27cfed978ef2989d9b2a33"><param name="Name" value="vimos_calib_impl"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga94d648dbe35921213f324fa814c5c330"><param name="Name" value="bias_avg"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga616bc975cc675200b4e2b71e11b6a111"><param name="Name" value="binx"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gadd4f1621a17fb8c3cb8a71369dc28f91"><param name="Name" value="biny"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gaa2383a6c0ad110007e91b6467b755498"><param name="Name" value="chip_id"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga7e092177213c592ed05cda8e2296016e"><param name="Name" value="cleanup"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga33568fda4dbd442173e671211fa84afc"><param name="Name" value="conad"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e"><param name="Name" value="create_bias"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gaebd36d5457a83612601155994a242dda"><param name="Name" value="create_dark"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b"><param name="Name" value="create_phot_table"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga5e5e21165c992a2062b3ca661e35fe9d"><param name="Name" value="create_screen_flat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103"><param name="Name" value="create_sky_flat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164"><param name="Name" value="create_standard"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5"><param name="Name" value="create_standard_keys"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3"><param name="Name" value="create_std_cat"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga7b419fb56d0d512c687a6f830d652798"><param name="Name" value="dark_avg"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga8127dadf8f51913034e2891c96fc6462"><param name="Name" value="det_nx"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga7029a6a32fa871757ee996ab390e651c"><param name="Name" value="det_ny"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c"><param name="Name" value="frame_new"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gaff7bcbeb82fada5cfc426397545258d8"><param name="Name" value="instrume"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#gaccccf93617eb75a09e97cc2ee96b5e28"><param name="Name" value="read_clock"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test__simulate.html#ga845c0025feb573da6be78f920081e6b4"><param name="Name" value="ron"></OBJECT>
+  </UL>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__stack__test.html#gafae5d1fcc553808ac2e0c37908648cac"><param name="Name" value="test_stack"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__star__test.html#ga5f4dac934da293e2cb4d53341350c833"><param name="Name" value="test_star"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__image__test.html#ga460806546207179c6e136d31bdb922d5"><param name="Name" value="test_subtract"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__test.html#gaa0b61563ef767d8d2276e7ffe0b14f5e"><param name="Name" value="test_version"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint__test.html#ga593b93a1917f63d7660af1ea61da6f94"><param name="Name" value="test_zeropoint"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__pattern.html#a0f355468abe462670457dc5f2dbfd63b"><param name="Name" value="theta"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsPaf.html#ga88f813e34826e731a89a053184474530"><param name="Name" value="TIME_ISO8601_LENGTH"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__polynomial.html"><param name="Name" value="Tools for Polynomial Coefficient Handling"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__std__star.html#aa289151fdd925b93c934f8435fd6311f"><param name="Name" value="trusted"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__FORS__PAF__RECORD__.html#a3b157d712d46492bc176a06500980115"><param name="Name" value="type"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__test.html"><param name="Name" value="Unit test infrastructure"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__multiset.html#ga304352750f0a5f58b2d1a0f27debc5b3"><param name="Name" value="val_less_than"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga73b4710964bfb9142f3d7b65f5ebea31"><param name="Name" value="values_to_dx"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__image.html#a88979de9862cd29d904a4f1e616509a4"><param name="Name" value="variance"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__setting.html#a2c3c730074609891796a3fb28138f425"><param name="Name" value="version"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__vimos__calib__impl.html"><param name="Name" value="Vimos_calib_impl"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga106b9beff20823017688021d7f008c3"><param name="Name" value="wcslib_errmsgs"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__vimos__calib__impl.html"><param name="Name" value="vimos_calib_impl"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__vimos__science__impl.html"><param name="Name" value="Vimos_science_impl"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__vimos__science__impl.html"><param name="Name" value="vimos_science_impl"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__forsdfs.html#ga3b7e23c484da8841aa01d1bed50cf2f0"><param name="Name" value="WCS_KEYS"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga0e3b1d297467f0a8552c6aa7da80bc4d"><param name="Name" value="WCSLIB_ERRCODE_MAX"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#gae98db393c8ca9bdd82fc4e168d570247"><param name="Name" value="wcslib_errmsgs"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__cpl__wcs__.html#a76ffd1e0af7f1d000078931be71a845e"><param name="Name" value="wcsptr"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__star.html#a45e679977d24d14f293e0d881dada47a"><param name="Name" value="weight"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html"><param name="Name" value="World_Coordinate_Systems"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__moses.html#ga598a249ae0afb47b4c7740180195ec98"><param name="Name" value="write_global_distortion"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gabdc231ff21279c9e3d5bff44c3f3fd6f"><param name="Name" value="write_qc"></OBJECT>
   <UL>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#g56eb9b85f6df5fa8fc5fc53911d3fd43"><param name="Name" value="fors_cpl_wcs_delete"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#g8d23e487c941ebc5b4d30a113f9dc324"><param name="Name" value="fors_cpl_wcs_fitsstr2plist"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#g1ff77ef3ec6654b60865ff114ffb0194"><param name="Name" value="fors_cpl_wcs_init"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ge66dce7f4ef9d442dd849595f39b82bf"><param name="Name" value="fors_cpl_wcs_plist2fitsstr"></OBJECT>
-    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__cpl__wcs.html#ga106b9beff20823017688021d7f008c3"><param name="Name" value="wcslib_errmsgs"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__bias.html#gabdc231ff21279c9e3d5bff44c3f3fd6f"><param name="Name" value="fors_bias"></OBJECT>
+    <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#ga06f1099ef36e41395e5619dbacfe3aa1"><param name="Name" value="fors_img_screen_flat"></OBJECT>
   </UL>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__img__screen__flat.html#gff8fa4d76051acfba7263b22a5bc06c3"><param name="Name" value="write_qc"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__point.html#a7d087815e7403a962b86bb10ada4421d"><param name="Name" value="x"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="struct__fors__point.html#a33a8f245d63d8ae71d43239315076350"><param name="Name" value="y"></OBJECT>
   <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint__test.html"><param name="Name" value="zeropoint recipe tests"></OBJECT>
-  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#g5ce973af397768a6d73de2a88b0d2ab3"><param name="Name" value="zeropoint_inside"></OBJECT>
+  <LI><OBJECT type="text/sitemap"><param name="Local" value="group__fors__zeropoint.html#ga0fca769fa4f247f3fff26ea6ebdd4429"><param name="Name" value="zeropoint_inside"></OBJECT>
 </UL>
+</BODY>
+</HTML>
diff --git a/html/index.hhp b/html/index.hhp
index 152d3af..67dd347 100644
--- a/html/index.hhp
+++ b/html/index.hhp
@@ -11,141 +11,141 @@ Create CHI file=YES
 Title=FORS Pipeline Reference Manual
 
 [WINDOWS]
-main="FORS Pipeline Reference Manual","index.hhc","index.hhk","index.html","index.html",,,,,0x23520,,0x387e,,,,,,,,0
+main="FORS Pipeline Reference Manual","index.hhc","index.hhk","index.html","index.html",,,,,0x23520,,0x10387e,,,,,,,,0
 
 [FILES]
-index.html
-create__phot_8c-source.html
-create__stetson_8c-source.html
-fors-test_8c-source.html
-fors__align__sky_8c-source.html
-fors__align__sky__lss_8c-source.html
-fors__bias-test_8c-source.html
-fors__bias_8c-source.html
-fors__bias__impl_8c-source.html
-fors__bias__impl_8h-source.html
-fors__calib_8c-source.html
-fors__config_8c-source.html
-fors__cpl__wcs-test_8c-source.html
-fors__cpl__wcs_8c-source.html
-fors__cpl__wcs_8h-source.html
-fors__dark-test_8c-source.html
-fors__dark_8c-source.html
-fors__dark__impl_8c-source.html
-fors__dark__impl_8h-source.html
-fors__data_8c-source.html
-fors__data_8h-source.html
-fors__detect__objects_8c-source.html
-fors__detect__spectra_8c-source.html
-fors__detlin_8c-source.html
-fors__dfs_8c-source.html
-fors__dfs_8h-source.html
-fors__double_8c-source.html
-fors__double_8h-source.html
-fors_2fors__extract_8c-source.html
-recipes_2fors__extract_8c-source.html
-fors__extract_8h-source.html
-fors__extract__objects_8c-source.html
-fors__extract__slits_8c-source.html
-fors__flat_8c-source.html
-fors__flatfield_8c-source.html
-fors__header_8c-source.html
-fors__header_8h-source.html
-fors__identify-test_8c-source.html
-fors__identify_8c-source.html
-fors__identify_8h-source.html
-fors__image-test_8c-source.html
-fors__image_8c-source.html
-fors__image_8h-source.html
-fors__img__science-test_8c-source.html
-fors__img__science_8c-source.html
-fors__img__science__impl_8c-source.html
-fors__img__science__impl_8h-source.html
-fors__img__screen__flat-test_8c-source.html
-fors__img__screen__flat_8c-source.html
-fors__img__screen__flat__impl_8c-source.html
-fors__img__screen__flat__impl_8h-source.html
-fors__img__sky__flat-test_8c-source.html
-fors__img__sky__flat_8c-source.html
-fors__img__sky__flat__impl_8c-source.html
-fors__img__sky__flat__impl_8h-source.html
-fors__instrument_8c-source.html
-fors__instrument_8h-source.html
-fors__normalise__flat_8c-source.html
-fors__paf_8c-source.html
-fors__paf_8h-source.html
-fors__pattern-test_8c-source.html
-fors__pattern_8c-source.html
-fors__pattern_8h-source.html
-fors__pfits_8c-source.html
-fors__pfits_8h-source.html
-fors__photometry-test_8c-source.html
-fors__photometry_8c-source.html
-fors__photometry__impl_8c-source.html
-fors__photometry__impl_8h-source.html
-fors__pmos__calib_8c-source.html
-fors__pmos__extract_8c-source.html
-fors__pmos__science_8c-source.html
-fors__point-test_8c-source.html
-fors__point_8c-source.html
-fors__point_8h-source.html
-fors__polynomial_8c-source.html
-fors__polynomial_8h-source.html
-fors__qc-test_8c-source.html
-fors__qc_8c-source.html
-fors__qc_8h-source.html
-fors__recipe_8c-source.html
-fors__recipe__impl_8h-source.html
-fors__remove__bias_8c-source.html
-fors__resample_8c-source.html
-fors__science_8c-source.html
-fors__setting-test_8c-source.html
-fors__setting_8c-source.html
-fors__setting_8h-source.html
-fors__stack-test_8c-source.html
-fors__stack_8c-source.html
-fors__stack_8h-source.html
-fors__star-test_8c-source.html
-fors__star_8c-source.html
-fors__star_8h-source.html
-fors__std__cat_8c-source.html
-fors__std__cat_8h-source.html
-fors__std__star-test_8c-source.html
-fors__std__star_8c-source.html
-fors__std__star_8h-source.html
-fors__subtract__sky_8c-source.html
-fors__subtract__sky__lss_8c-source.html
-fors__sumflux_8c-source.html
-fors__tools_8c-source.html
-fors__tools_8h-source.html
-fors__trace__flat_8c-source.html
-fors__utils_8c-source.html
-fors__utils_8h-source.html
-fors__wave__calib_8c-source.html
-fors__wave__calib__lss_8c-source.html
-fors__zeropoint-test_8c-source.html
-fors__zeropoint_8c-source.html
-fors__zeropoint__impl_8c-source.html
-fors__zeropoint__impl_8h-source.html
-list-test_8c-source.html
-list_8c-source.html
-list_8h-source.html
-list__void_8h-source.html
-montecarlo_8c-source.html
-moses_8c-source.html
-moses_8h-source.html
-recipes-test_8c-source.html
-test_8c-source.html
-test_8h-source.html
-test__hough_8c-source.html
-test__simulate_8c-source.html
-test__simulate_8h-source.html
-vimos__calib_8c-source.html
-vimos__calib__impl_8c-source.html
-vimos__calib__impl_8h-source.html
-vimos__science_8c-source.html
-vimos__science__impl_8c-source.html
-vimos__science__impl_8h-source.html
+create__phot_8c_source.html
+create__stetson_8c_source.html
+fors-test_8c_source.html
+fors__align__sky_8c_source.html
+fors__align__sky__lss_8c_source.html
+fors__bias-test_8c_source.html
+fors__bias_8c_source.html
+fors__bias__impl_8c_source.html
+fors__bias__impl_8h_source.html
+fors__config_8c_source.html
+fors__cpl__wcs-test_8c_source.html
+fors__cpl__wcs_8c_source.html
+fors__cpl__wcs_8h_source.html
+fors__dark-test_8c_source.html
+fors__dark_8c_source.html
+fors__dark__impl_8c_source.html
+fors__dark__impl_8h_source.html
+fors__data_8c_source.html
+fors__data_8h_source.html
+fors__detect__objects_8c_source.html
+fors__detect__spectra_8c_source.html
+fors__detected__slits_8h_source.html
+fors__detlin_8c_source.html
+fors__dfs_8c_source.html
+fors__dfs_8h_source.html
+fors__double_8c_source.html
+fors__double_8h_source.html
+fors_2fors__extract_8c_source.html
+recipes_2fors__extract_8c_source.html
+fors__extract_8h_source.html
+fors__extract__objects_8c_source.html
+fors__extract__slits_8c_source.html
+fors__flat__normalise_8h_source.html
+fors__flatfield_8c_source.html
+fors__header_8c_source.html
+fors__header_8h_source.html
+fors__identify-test_8c_source.html
+fors__identify_8c_source.html
+fors__identify_8h_source.html
+fors__image-test_8c_source.html
+fors__image_8c_source.html
+fors__image_8h_source.html
+fors__img__science-test_8c_source.html
+fors__img__science_8c_source.html
+fors__img__science__impl_8c_source.html
+fors__img__science__impl_8h_source.html
+fors__img__screen__flat-test_8c_source.html
+fors__img__screen__flat_8c_source.html
+fors__img__screen__flat__impl_8c_source.html
+fors__img__screen__flat__impl_8h_source.html
+fors__img__sky__flat-test_8c_source.html
+fors__img__sky__flat_8c_source.html
+fors__img__sky__flat__impl_8c_source.html
+fors__img__sky__flat__impl_8h_source.html
+fors__instrument_8c_source.html
+fors__instrument_8h_source.html
+fors__normalise__flat_8c_source.html
+fors__overscan_8h_source.html
+fors__paf_8c_source.html
+fors__paf_8h_source.html
+fors__pattern-test_8c_source.html
+fors__pattern_8c_source.html
+fors__pattern_8h_source.html
+fors__pfits_8c_source.html
+fors__pfits_8h_source.html
+fors__photometry-test_8c_source.html
+fors__photometry_8c_source.html
+fors__photometry__impl_8c_source.html
+fors__photometry__impl_8h_source.html
+fors__pmos__calib_8c_source.html
+fors__pmos__extract_8c_source.html
+fors__pmos__science_8c_source.html
+fors__point-test_8c_source.html
+fors__point_8c_source.html
+fors__point_8h_source.html
+fors__polynomial_8c_source.html
+fors__polynomial_8h_source.html
+fors__qc-test_8c_source.html
+fors__qc_8c_source.html
+fors__qc_8h_source.html
+fors__recipe_8c_source.html
+fors__recipe__impl_8h_source.html
+fors__remove__bias_8c_source.html
+fors__resample_8c_source.html
+fors__science_8c_source.html
+fors__setting-test_8c_source.html
+fors__setting_8c_source.html
+fors__setting_8h_source.html
+fors__stack-test_8c_source.html
+fors__stack_8c_source.html
+fors__stack_8h_source.html
+fors__star-test_8c_source.html
+fors__star_8c_source.html
+fors__star_8h_source.html
+fors__std__cat_8c_source.html
+fors__std__cat_8h_source.html
+fors__std__star-test_8c_source.html
+fors__std__star_8c_source.html
+fors__std__star_8h_source.html
+fors__subtract__sky_8c_source.html
+fors__subtract__sky__lss_8c_source.html
+fors__sumflux_8c_source.html
+fors__tools_8c_source.html
+fors__tools_8h_source.html
+fors__trace__flat_8c_source.html
+fors__utils_8c_source.html
+fors__utils_8h_source.html
+fors__wave__calib_8c_source.html
+fors__wave__calib__lss_8c_source.html
+fors__zeropoint-test_8c_source.html
+fors__zeropoint_8c_source.html
+fors__zeropoint__impl_8c_source.html
+fors__zeropoint__impl_8h_source.html
+list-test_8c_source.html
+list_8c_source.html
+list_8h_source.html
+list__void_8h_source.html
+montecarlo_8c_source.html
+moses_8c_source.html
+moses_8h_source.html
+recipes-test_8c_source.html
+test_8c_source.html
+test_8h_source.html
+test__hough_8c_source.html
+test__simulate_8c_source.html
+test__simulate_8h_source.html
+vimos__calib_8c_source.html
+vimos__calib__impl_8c_source.html
+vimos__calib__impl_8h_source.html
+vimos__science_8c_source.html
+vimos__science__impl_8c_source.html
+vimos__science__impl_8h_source.html
 group__fors__cpl__wcs.html
 group__forsdfs.html
 group__fors__double.html
@@ -194,11 +194,6 @@ group__fors__zeropoint.html
 group__recipes__test.html
 group__vimos__calib__impl.html
 group__vimos__science__impl.html
-modules.html
-annotated.html
-classes.html
-functions.html
-functions_vars.html
 struct__extract__method.html
 struct__fors__cpl__wcs__.html
 struct__fors__image.html
@@ -217,13 +212,42 @@ structfors__extract__sky__stats.html
 structfors__filterlist.html
 structfors__fit__ncoeff__paropts.html
 structlist.html
-dir_83e1530f94cacc9068c540ba3fc838a8.html
-dir_9af262a93c54576b7a2b4cc0cd21cc4f.html
-dir_f9b8c94f8f09c10447edf4ed11ceb4e6.html
-dir_59b02a80e553296e42791d17a261b792.html
+dir_95ba833b8cc26b837be271dc0b58e122.html
+dir_b351cdfeb4656d7d168dc72b273024e7.html
+dir_29caecd79ba0d8cf1bf29f8555ca3deb.html
+dir_aab54b8ed0ffe13455bea30ab0dd47dc.html
+index.html
+modules.html
+annotated.html
+classes.html
 files.html
-dirs.html
-tabs.css
-tab_b.gif
-tab_l.gif
-tab_r.gif
+tab_a.png
+tab_b.png
+tab_h.png
+tab_s.png
+nav_h.png
+nav_f.png
+nav_g.png
+bc_s.png
+doxygen.png
+closed.png
+open.png
+bdwn.png
+sync_on.png
+sync_off.png
+ftv2blank.png
+ftv2doc.png
+ftv2folderclosed.png
+ftv2folderopen.png
+ftv2ns.png
+ftv2mo.png
+ftv2cl.png
+ftv2lastnode.png
+ftv2link.png
+ftv2mlastnode.png
+ftv2mnode.png
+ftv2node.png
+ftv2plastnode.png
+ftv2pnode.png
+ftv2vertline.png
+ftv2splitbar.png
diff --git a/html/index.html b/html/index.html
index 453f59b..1033741 100644
--- a/html/index.html
+++ b/html/index.html
@@ -1,22 +1,52 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: Main Page</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li id="current"><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>FORS Pipeline Reference Manual Documentation</h1>
-<p>
-<h3 align="center">4.9.23 </h3><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li class="current"><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">FORS Pipeline Reference Manual Documentation</div>  </div>
+</div><!--header-->
+<div class="contents">
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/jquery.js b/html/jquery.js
new file mode 100644
index 0000000..63939e7
--- /dev/null
+++ b/html/jquery.js
@@ -0,0 +1,8 @@
+/*! jQuery v1.7.1 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement( [...]
+{g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=argumen [...]
+f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]| [...]
+&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsBy [...]
+f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
+{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replac [...]
+{if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m, [...]
diff --git a/html/list-test_8c-source.html b/html/list-test_8c-source.html
deleted file mode 100644
index 95758c7..0000000
--- a/html/list-test_8c-source.html
+++ /dev/null
@@ -1,182 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: list-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>list-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: list-test.c,v 1.5 2007/09/26 13:31:58 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/09/26 13:31:58 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.5 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#define LIST_ELEM int</span>
-<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="preprocessor">#include <test.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#define LIST_DEFINE</span>
-<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM int</span>
-<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span>
-<a name="l00044"></a>00044 
-<a name="l00051"></a>00051 <span class="keyword">static</span> <span class="keywordtype">int</span> *
-<a name="l00052"></a><a class="code" href="group__list__test.html#g717300bf68afba988cb2ab66258225e7">00052</a> <a class="code" href="group__list__test.html#g717300bf68afba988cb2ab66258225e7">int_duplicate</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> *i)
-<a name="l00053"></a>00053 {
-<a name="l00054"></a>00054     <span class="keywordtype">int</span> *j = cpl_malloc(<span class="keyword">sizeof</span> *j);
-<a name="l00055"></a>00055     *j = *i;
-<a name="l00056"></a>00056     <span class="keywordflow">return</span> j;
-<a name="l00057"></a>00057 }
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00060"></a><a class="code" href="group__list__test.html#g79de0fc8abc8c1a7ae11407462febc70">00060</a> <a class="code" href="group__list__test.html#g79de0fc8abc8c1a7ae11407462febc70">int_delete</a>(<span class="keywordtype">int</span> **i)
-<a name="l00061"></a>00061 {
-<a name="l00062"></a>00062     <span class="keywordflow">if</span> (i && *i) {
-<a name="l00063"></a>00063         cpl_free(*i); *i = NULL;
-<a name="l00064"></a>00064     }
-<a name="l00065"></a>00065     <span class="keywordflow">return</span>;
-<a name="l00066"></a>00066 }
-<a name="l00067"></a>00067 
-<a name="l00068"></a>00068 <span class="keyword">static</span> <span class="keywordtype">bool</span>
-<a name="l00069"></a><a class="code" href="group__list__test.html#gec0b1222617728d049412a0bad20b7c2">00069</a> <a class="code" href="group__list__test.html#gec0b1222617728d049412a0bad20b7c2">int_less_than</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> *i, <span class="keyword">const</span> <span class="keywordtype">int</span> *j, <span class="keywordtype">void</span> *data)
-<a name="l00070"></a>00070 {
-<a name="l00071"></a>00071     data = data;
-<a name="l00072"></a>00072     <span class="keywordflow">return</span> (*i < *j);
-<a name="l00073"></a>00073 }
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00076"></a><a class="code" href="group__list__test.html#g2681ca892db4008185b479cf715f8fee">00076</a> <a class="code" href="group__list__test.html#g2681ca892db4008185b479cf715f8fee">int_evaluate</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> *i, <span class="keywordtype">void</span> *data)
-<a name="l00077"></a>00077 {
-<a name="l00078"></a>00078     data = data;
-<a name="l00079"></a>00079     <span class="keywordflow">return</span> *i;
-<a name="l00080"></a>00080 }
-<a name="l00081"></a>00081 
-<a name="l00082"></a>00082 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00083"></a><a class="code" href="group__list__test.html#g5e54209ba6c0f1dcf56028b4e43bfd3b">00083</a> <a class="code" href="group__list__test.html#g5e54209ba6c0f1dcf56028b4e43bfd3b">test_list</a>(<span class="keywordtype">void</span>)
-<a name="l00084"></a>00084 {
-<a name="l00085"></a>00085     int_list *l = int_list_new();
-<a name="l00086"></a>00086     <span class="keywordtype">int</span> x = 8;
-<a name="l00087"></a>00087     
-<a name="l00088"></a>00088     test( l != NULL );
-<a name="l00089"></a>00089     test( int_list_size(l) == 0 );
-<a name="l00090"></a>00090 
-<a name="l00091"></a>00091     int_list_insert(l, <a class="code" href="group__list__test.html#g717300bf68afba988cb2ab66258225e7">int_duplicate</a>(&x));
-<a name="l00092"></a>00092     int_list_insert(l, <a class="code" href="group__list__test.html#g717300bf68afba988cb2ab66258225e7">int_duplicate</a>(&x));
-<a name="l00093"></a>00093     x = 0;
-<a name="l00094"></a>00094     int_list_insert(l, <a class="code" href="group__list__test.html#g717300bf68afba988cb2ab66258225e7">int_duplicate</a>(&x));
-<a name="l00095"></a>00095 
-<a name="l00096"></a>00096     test( int_list_size(l) == 3 );
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098     x = 7;
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100     test_eq( *int_list_min    (l, <a class="code" href="group__list__test.html#gec0b1222617728d049412a0bad20b7c2">int_less_than</a>, NULL), 0 );
-<a name="l00101"></a>00101     test_eq( *int_list_max    (l, <a class="code" href="group__list__test.html#gec0b1222617728d049412a0bad20b7c2">int_less_than</a>, NULL), 8 );
-<a name="l00102"></a>00102     test_eq( *int_list_min_val(l, <a class="code" href="group__list__test.html#g2681ca892db4008185b479cf715f8fee">int_evaluate</a>, NULL), 0 );
-<a name="l00103"></a>00103     test_eq( *int_list_max_val(l, <a class="code" href="group__list__test.html#g2681ca892db4008185b479cf715f8fee">int_evaluate</a>, NULL), 8 );
-<a name="l00104"></a>00104 
-<a name="l00105"></a>00105     {
-<a name="l00106"></a>00106         <span class="keyword">const</span> int_list *l2 = int_list_duplicate(l, <a class="code" href="group__list__test.html#g717300bf68afba988cb2ab66258225e7">int_duplicate</a>);
-<a name="l00107"></a>00107         
-<a name="l00108"></a>00108         test( *int_list_kth_const(l2, 1, <a class="code" href="group__list__test.html#gec0b1222617728d049412a0bad20b7c2">int_less_than</a>, NULL) == 0 );
-<a name="l00109"></a>00109         test( *int_list_kth_const(l2, 3, <a class="code" href="group__list__test.html#gec0b1222617728d049412a0bad20b7c2">int_less_than</a>, NULL) == 8 );
-<a name="l00110"></a>00110         test( *int_list_kth_const(l2, 3, <a class="code" href="group__list__test.html#gec0b1222617728d049412a0bad20b7c2">int_less_than</a>, NULL) == 8 );
-<a name="l00111"></a>00111         test( *int_list_kth_const(l2, 2, <a class="code" href="group__list__test.html#gec0b1222617728d049412a0bad20b7c2">int_less_than</a>, NULL) == 8 );
-<a name="l00112"></a>00112         
-<a name="l00113"></a>00113         test( *int_list_max_const(l2, <a class="code" href="group__list__test.html#gec0b1222617728d049412a0bad20b7c2">int_less_than</a>, NULL) == 8 );
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115         {
-<a name="l00116"></a>00116             <span class="keywordtype">int</span> num_pairs = 0;
-<a name="l00117"></a>00117             <span class="keyword">const</span> <span class="keywordtype">int</span> *p1, *p2;
-<a name="l00118"></a>00118             <span class="keywordflow">for</span> (int_list_first_pair_const(l2, &p1, &p2);
-<a name="l00119"></a>00119                  p1 != NULL;
-<a name="l00120"></a>00120                  int_list_next_pair_const(l2, &p1, &p2)) {
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122                 test( p1 != p2 );
-<a name="l00123"></a>00123                 num_pairs += 1;
-<a name="l00124"></a>00124             }
-<a name="l00125"></a>00125             test( p2 == NULL );
-<a name="l00126"></a>00126             test_eq( num_pairs, (3*2/2));
-<a name="l00127"></a>00127         }
-<a name="l00128"></a>00128 
-<a name="l00129"></a>00129         int_list_delete_const(&l2, <a class="code" href="group__list__test.html#g79de0fc8abc8c1a7ae11407462febc70">int_delete</a>);
-<a name="l00130"></a>00130         test( l2 == NULL );
-<a name="l00131"></a>00131     }
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133     {
-<a name="l00134"></a>00134         <span class="keywordtype">int</span> *ip;
-<a name="l00135"></a>00135         ip = int_list_remove(l, int_list_first(l));
-<a name="l00136"></a>00136         <a class="code" href="group__list__test.html#g79de0fc8abc8c1a7ae11407462febc70">int_delete</a>(&ip);
-<a name="l00137"></a>00137         
-<a name="l00138"></a>00138         test( int_list_size(l) == 2 );
-<a name="l00139"></a>00139         
-<a name="l00140"></a>00140         int_list_first(l);
-<a name="l00141"></a>00141         ip = int_list_remove(l, int_list_next(l));
-<a name="l00142"></a>00142         <a class="code" href="group__list__test.html#g79de0fc8abc8c1a7ae11407462febc70">int_delete</a>(&ip);
-<a name="l00143"></a>00143         test( int_list_size(l) == 1 );
-<a name="l00144"></a>00144         
-<a name="l00145"></a>00145         ip = int_list_remove(l, int_list_first(l));
-<a name="l00146"></a>00146         <a class="code" href="group__list__test.html#g79de0fc8abc8c1a7ae11407462febc70">int_delete</a>(&ip);
-<a name="l00147"></a>00147         test( int_list_size(l) == 0 );
-<a name="l00148"></a>00148     }
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150     int_list_delete(&l, <a class="code" href="group__list__test.html#g79de0fc8abc8c1a7ae11407462febc70">int_delete</a>);
-<a name="l00151"></a>00151     
-<a name="l00152"></a>00152     test( l == NULL );
-<a name="l00153"></a>00153 
-<a name="l00154"></a>00154     <span class="keywordflow">return</span>;
-<a name="l00155"></a>00155 }
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157 
-<a name="l00161"></a><a class="code" href="group__list__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00161</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00162"></a>00162 {
-<a name="l00163"></a>00163     TEST_INIT;
-<a name="l00164"></a>00164 
-<a name="l00165"></a>00165     <a class="code" href="group__list__test.html#g5e54209ba6c0f1dcf56028b4e43bfd3b">test_list</a>();
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167     TEST_END;
-<a name="l00168"></a>00168 }
-<a name="l00169"></a>00169 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/list-test_8c_source.html b/html/list-test_8c_source.html
new file mode 100644
index 0000000..14645ba
--- /dev/null
+++ b/html/list-test_8c_source.html
@@ -0,0 +1,221 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: list-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">list-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: list-test.c,v 1.5 2007-09-26 13:31:58 jmlarsen Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: jmlarsen $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007-09-26 13:31:58 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.5 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#define LIST_ELEM int</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#define LIST_DEFINE</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_ELEM int</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor"></span><span class="preprocessor">#include <list.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keyword">static</span> <span class="keywordtype">int</span> *</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> int_duplicate(<span class="keyword">const</span> <span class="keywordtype">int</span> *i)</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> {</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>     <span class="keywordtype">int</span> *j = cpl_malloc(<span class="keyword">sizeof</span> *j);</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>     *j = *i;</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>     <span class="keywordflow">return</span> j;</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> }</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> int_delete(<span class="keywordtype">int</span> **i)</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> {</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>     <span class="keywordflow">if</span> (i && *i) {</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>         cpl_free(*i); *i = NULL;</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>     }</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> }</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="keyword">static</span> <span class="keywordtype">bool</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> int_less_than(<span class="keyword">const</span> <span class="keywordtype">int</span> *i, <span class="keyword">const</span> <span class="keywordtype">int</span> *j, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> {</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     data = data;</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>     <span class="keywordflow">return</span> (*i < *j);</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> }</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> int_evaluate(<span class="keyword">const</span> <span class="keywordtype">int</span> *i, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> {</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     data = data;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>     <span class="keywordflow">return</span> *i;</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> }</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> test_list(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> {</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     int_list *l = int_list_new();</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     <span class="keywordtype">int</span> x = 8;</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>     test( l != NULL );</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     test( int_list_size(l) == 0 );</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> </div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     int_list_insert(l, int_duplicate(&x));</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     int_list_insert(l, int_duplicate(&x));</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     x = 0;</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     int_list_insert(l, int_duplicate(&x));</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     test( int_list_size(l) == 3 );</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     x = 7;</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     test_eq( *int_list_min    (l, int_less_than, NULL), 0 );</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     test_eq( *int_list_max    (l, int_less_than, NULL), 8 );</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     test_eq( *int_list_min_val(l, int_evaluate, NULL), 0 );</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     test_eq( *int_list_max_val(l, int_evaluate, NULL), 8 );</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> </div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     {</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>         <span class="keyword">const</span> int_list *l2 = int_list_duplicate(l, int_duplicate);</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>         </div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>         test( *int_list_kth_const(l2, 1, int_less_than, NULL) == 0 );</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>         test( *int_list_kth_const(l2, 3, int_less_than, NULL) == 8 );</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>         test( *int_list_kth_const(l2, 3, int_less_than, NULL) == 8 );</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>         test( *int_list_kth_const(l2, 2, int_less_than, NULL) == 8 );</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>         </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>         test( *int_list_max_const(l2, int_less_than, NULL) == 8 );</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>         {</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>             <span class="keywordtype">int</span> num_pairs = 0;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>             <span class="keyword">const</span> <span class="keywordtype">int</span> *p1, *p2;</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>             <span class="keywordflow">for</span> (int_list_first_pair_const(l2, &p1, &p2);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                  p1 != NULL;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                  int_list_next_pair_const(l2, &p1, &p2)) {</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                 test( p1 != p2 );</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                 num_pairs += 1;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>             }</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>             test( p2 == NULL );</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>             test_eq( num_pairs, (3*2/2));</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>         }</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>         int_list_delete_const(&l2, int_delete);</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>         test( l2 == NULL );</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     }</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     {</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         <span class="keywordtype">int</span> *ip;</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>         ip = int_list_remove(l, int_list_first(l));</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         int_delete(&ip);</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>         </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>         test( int_list_size(l) == 2 );</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>         </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>         int_list_first(l);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>         ip = int_list_remove(l, int_list_next(l));</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>         int_delete(&ip);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>         test( int_list_size(l) == 1 );</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>         </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>         ip = int_list_remove(l, int_list_first(l));</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>         int_delete(&ip);</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>         test( int_list_size(l) == 0 );</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     }</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     int_list_delete(&l, int_delete);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     test( l == NULL );</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> }</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno"><a class="code" href="group__list__test.html#ga840291bc02cba5474a4cb46a9b9566fe">  161</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> {</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     TEST_INIT;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     test_list();</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     TEST_END;</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> }</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/list_8c-source.html b/html/list_8c-source.html
deleted file mode 100644
index 7ca4373..0000000
--- a/html/list_8c-source.html
+++ /dev/null
@@ -1,952 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: list.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>list.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: list.c,v 1.18 2009/03/26 09:28:22 hlorch Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00004"></a>00004 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00005"></a>00005 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00006"></a>00006 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00007"></a>00007 <span class="comment"> *</span>
-<a name="l00008"></a>00008 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00009"></a>00009 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00010"></a>00010 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00011"></a>00011 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00012"></a>00012 <span class="comment"> *</span>
-<a name="l00013"></a>00013 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00014"></a>00014 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00015"></a>00015 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00016"></a>00016 <span class="comment"> */</span>
-<a name="l00017"></a>00017 
-<a name="l00018"></a>00018 <span class="comment">/*</span>
-<a name="l00019"></a>00019 <span class="comment"> * $Author: hlorch $</span>
-<a name="l00020"></a>00020 <span class="comment"> * $Date: 2009/03/26 09:28:22 $</span>
-<a name="l00021"></a>00021 <span class="comment"> * $Revision: 1.18 $</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00023"></a>00023 <span class="comment"> */</span>
-<a name="l00024"></a>00024 
-<a name="l00025"></a>00025 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00027"></a>00027 <span class="preprocessor">#endif</span>
-<a name="l00028"></a>00028 <span class="preprocessor"></span>
-<a name="l00029"></a>00029 <span class="preprocessor">#include <list_void.h></span>
-<a name="l00030"></a>00030 
-<a name="l00031"></a>00031 <span class="preprocessor">#include <math.h></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <string.h></span>
-<a name="l00036"></a>00036 
-<a name="l00073"></a>00073 <span class="comment">/* Same data structure as C++ STL's vector */</span>
-<a name="l00074"></a><a class="code" href="structlist.html">00074</a> <span class="keyword">struct </span><a class="code" href="structlist.html">list</a>
-<a name="l00075"></a>00075 {
-<a name="l00076"></a><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">00076</a>     <span class="keywordtype">void</span> **<a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>;
-<a name="l00077"></a><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">00077</a>     <span class="keywordtype">int</span> <a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>;
-<a name="l00078"></a><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">00078</a>     <span class="keywordtype">int</span> <a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a>;    <span class="comment">/* Extra allocated space */</span>
-<a name="l00079"></a>00079 
-<a name="l00080"></a><a class="code" href="structlist.html#87b04e0bab57e6949272df159ee19baf">00080</a>     <span class="keywordtype">int</span> <a class="code" href="structlist.html#87b04e0bab57e6949272df159ee19baf">current</a>; <span class="comment">/* 1 element iteration */</span>
-<a name="l00081"></a>00081 
-<a name="l00082"></a><a class="code" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">00082</a>     <span class="keywordtype">int</span> <a class="code" href="structlist.html#38d7fad1310a6005cefaa130cce4597a">current_p1</a>, <a class="code" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">current_p2</a>; <span class="comment">/* pair iteration */</span>
-<a name="l00083"></a>00083 };
-<a name="l00084"></a>00084 
-<a name="l00088"></a>00088 <span class="comment">//static void *(*const list_malloc)(size_t) = malloc;</span>
-<a name="l00089"></a>00089 <span class="comment">//static void *(*const list_calloc)(size_t, size_t) = calloc;</span>
-<a name="l00090"></a>00090 <span class="comment">//static void *(*const list_realloc)(void *, size_t) = realloc;</span>
-<a name="l00091"></a>00091 <span class="comment">//static void  (*const list_free)(const void *) = (void (*)(const void *))free;</span>
-<a name="l00092"></a><a class="code" href="group__multiset.html#g835886d7e2108ff01e9123261b28eb1e">00092</a> <span class="keyword">static</span> <span class="keywordtype">void</span> *(*list_malloc)(size_t) = malloc;
-<a name="l00093"></a><a class="code" href="group__multiset.html#g843d830e4acbd1326b14d344203e9ac5">00093</a> <span class="keyword">static</span> <span class="keywordtype">void</span> *(*list_calloc)(size_t, size_t) = calloc;
-<a name="l00094"></a><a class="code" href="group__multiset.html#gd791852a26bb24410135aa504c029ac8">00094</a> <span class="keyword">static</span> <span class="keywordtype">void</span> *(*list_realloc)(<span class="keywordtype">void</span> *, size_t) = realloc;
-<a name="l00095"></a><a class="code" href="group__multiset.html#g7d02aeb71198273b9f07173f4ff19a5b">00095</a> <span class="keyword">static</span> void  (*<a class="code" href="group__multiset.html#g7d02aeb71198273b9f07173f4ff19a5b">list_free</a>)(<span class="keyword">const</span> <span class="keywordtype">void</span> *) = (<span class="keywordtype">void</span> (*)(<span class="keyword">const</span> <span class="keywordtype">void</span> *))free;
-<a name="l00096"></a>00096 
-<a name="l00100"></a>00100 <span class="preprocessor">#include <assert.h></span>
-<a name="l00101"></a><a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">00101</a> <span class="preprocessor">#define assure(EXPR) assert(EXPR)</span>
-<a name="l00102"></a>00102 <span class="preprocessor"></span>
-<a name="l00107"></a>00107 <a class="code" href="structlist.html">list</a> *
-<a name="l00108"></a><a class="code" href="group__multiset.html#g14ca81b1edd1222975ab52e203cbde59">00108</a> <a class="code" href="group__multiset.html#g14ca81b1edd1222975ab52e203cbde59">list_new</a>(<span class="keywordtype">void</span>)
-<a name="l00109"></a>00109 {
-<a name="l00110"></a>00110     <a class="code" href="structlist.html">list</a> *l = <a class="code" href="group__multiset.html#g835886d7e2108ff01e9123261b28eb1e">list_malloc</a>(<span class="keyword">sizeof</span>(*l));
-<a name="l00111"></a>00111 
-<a name="l00112"></a>00112     l->elements = NULL;
-<a name="l00113"></a>00113     l->size = 0;
-<a name="l00114"></a>00114     l->back = 0;
-<a name="l00115"></a>00115 
-<a name="l00116"></a>00116     <span class="keywordflow">return</span> l;
-<a name="l00117"></a>00117 }
-<a name="l00118"></a>00118 
-<a name="l00125"></a>00125 <a class="code" href="structlist.html">list</a> *
-<a name="l00126"></a><a class="code" href="group__multiset.html#ge8bd4915a67367a226dcd3f5c3bd5491">00126</a> <a class="code" href="group__multiset.html#ge8bd4915a67367a226dcd3f5c3bd5491">list_duplicate</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">void</span> * (*duplicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *))
-<a name="l00127"></a>00127 {
-<a name="l00128"></a>00128     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130     {
-<a name="l00131"></a>00131         <a class="code" href="structlist.html">list</a> *dupl = <a class="code" href="group__multiset.html#g835886d7e2108ff01e9123261b28eb1e">list_malloc</a>(<span class="keyword">sizeof</span>(*dupl));
-<a name="l00132"></a>00132         
-<a name="l00133"></a>00133         dupl->elements = <a class="code" href="group__multiset.html#g835886d7e2108ff01e9123261b28eb1e">list_malloc</a>((l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>+l-><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a>) * <span class="keyword">sizeof</span>(*dupl->elements));
-<a name="l00134"></a>00134         dupl->size = l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>;
-<a name="l00135"></a>00135         dupl->back = l-><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a>;
-<a name="l00136"></a>00136         dupl->current = l-><a class="code" href="structlist.html#87b04e0bab57e6949272df159ee19baf">current</a>;
-<a name="l00137"></a>00137         dupl->current_p1 = l-><a class="code" href="structlist.html#38d7fad1310a6005cefaa130cce4597a">current_p1</a>;
-<a name="l00138"></a>00138         dupl->current_p2 = l-><a class="code" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">current_p2</a>;
-<a name="l00139"></a>00139         
-<a name="l00140"></a>00140         {
-<a name="l00141"></a>00141             <span class="keywordtype">int</span> i;
-<a name="l00142"></a>00142             <span class="keywordflow">for</span> (i = 0; i < l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>; i++) {
-<a name="l00143"></a>00143                 <span class="keywordflow">if</span> (duplicate != NULL) {
-<a name="l00144"></a>00144                     dupl->elements[i] = duplicate(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i]);
-<a name="l00145"></a>00145                 }
-<a name="l00146"></a>00146                 <span class="keywordflow">else</span> {
-<a name="l00147"></a>00147                     dupl->elements[i] = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i];
-<a name="l00148"></a>00148                 }
-<a name="l00149"></a>00149             }
-<a name="l00150"></a>00150         }
-<a name="l00151"></a>00151         
-<a name="l00152"></a>00152         <span class="keywordflow">return</span> dupl;
-<a name="l00153"></a>00153     }
-<a name="l00154"></a>00154 }
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156 <span class="comment">/*</span>
-<a name="l00157"></a>00157 <span class="comment"> * @brief Destructor</span>
-<a name="l00158"></a>00158 <span class="comment"> * @param l         list to delete</span>
-<a name="l00159"></a>00159 <span class="comment"> * @param delete    element copy constructor. If NULL,</span>
-<a name="l00160"></a>00160 <span class="comment"> *                  elements are not deleted.</span>
-<a name="l00161"></a>00161 <span class="comment"> */</span>
-<a name="l00162"></a>00162 <span class="keywordtype">void</span>
-<a name="l00163"></a><a class="code" href="group__multiset.html#g6b91588e63479b669eefe0aa72a0b934">00163</a> <a class="code" href="group__multiset.html#g6b91588e63479b669eefe0aa72a0b934">list_delete_const</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> **l, <span class="keywordtype">void</span> (*<span class="keyword">delete</span>)(<span class="keywordtype">void</span> **))
-<a name="l00164"></a>00164 {
-<a name="l00165"></a>00165     <span class="keywordflow">if</span> (l != NULL && *l != NULL) {
-<a name="l00166"></a>00166 
-<a name="l00167"></a>00167         <span class="keywordflow">if</span> (<span class="keyword">delete</span> != NULL) {
-<a name="l00168"></a>00168             
-<a name="l00169"></a>00169             <span class="keywordtype">int</span> i;
-<a name="l00170"></a>00170             <span class="keywordflow">for</span> (i = 0; i < (*l)->size; i++) {
-<a name="l00171"></a>00171                 <span class="keyword">delete</span>(&((*l)->elements[i]));
-<a name="l00172"></a>00172             }
-<a name="l00173"></a>00173         }
-<a name="l00174"></a>00174         <a class="code" href="group__multiset.html#g7d02aeb71198273b9f07173f4ff19a5b">list_free</a>((*l)->elements);
-<a name="l00175"></a>00175         <a class="code" href="group__multiset.html#g7d02aeb71198273b9f07173f4ff19a5b">list_free</a>((*l)); *l = NULL;
-<a name="l00176"></a>00176     }
-<a name="l00177"></a>00177     <span class="keywordflow">return</span>;
-<a name="l00178"></a>00178 }
-<a name="l00179"></a>00179 
-<a name="l00180"></a>00180 <span class="keywordtype">void</span>
-<a name="l00181"></a><a class="code" href="group__multiset.html#g023d28b5567e53901b78d9311fc5ca35">00181</a> <a class="code" href="group__multiset.html#g023d28b5567e53901b78d9311fc5ca35">list_delete</a>(<a class="code" href="structlist.html">list</a> **l, <span class="keywordtype">void</span> (*<span class="keyword">delete</span>)(<span class="keywordtype">void</span> **))
-<a name="l00182"></a>00182 {
-<a name="l00183"></a>00183     <a class="code" href="group__multiset.html#g6b91588e63479b669eefe0aa72a0b934">list_delete_const</a>((<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> **)l, <span class="keyword">delete</span>);
-<a name="l00184"></a>00184     <span class="keywordflow">return</span>;
-<a name="l00185"></a>00185 }
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187 <span class="comment">/*</span>
-<a name="l00188"></a>00188 <span class="comment"> * @brief Get list size</span>
-<a name="l00189"></a>00189 <span class="comment"> * @param l         list</span>
-<a name="l00190"></a>00190 <span class="comment"> * @return  number of elements in list </span>
-<a name="l00191"></a>00191 <span class="comment"> *</span>
-<a name="l00192"></a>00192 <span class="comment"> * Time: O(1)</span>
-<a name="l00193"></a>00193 <span class="comment"> */</span>
-<a name="l00194"></a>00194 <span class="keywordtype">int</span>
-<a name="l00195"></a><a class="code" href="group__multiset.html#g5287413c34475d2be585d0d499284ad0">00195</a> <a class="code" href="group__multiset.html#g5287413c34475d2be585d0d499284ad0">list_size</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l)
-<a name="l00196"></a>00196 {
-<a name="l00197"></a>00197     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00198"></a>00198 
-<a name="l00199"></a>00199     <span class="keywordflow">return</span> l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>;
-<a name="l00200"></a>00200 }
-<a name="l00201"></a>00201 
-<a name="l00202"></a>00202 <span class="comment">/*</span>
-<a name="l00203"></a>00203 <span class="comment"> * @brief Insert element</span>
-<a name="l00204"></a>00204 <span class="comment"> * @param l         list </span>
-<a name="l00205"></a>00205 <span class="comment"> * @param e         element to insert. Must be non-NULL</span>
-<a name="l00206"></a>00206 <span class="comment"> * @return  number of elements in list </span>
-<a name="l00207"></a>00207 <span class="comment"> *</span>
-<a name="l00208"></a>00208 <span class="comment"> * Time: Amortized O(1)</span>
-<a name="l00209"></a>00209 <span class="comment"> */</span>
-<a name="l00210"></a>00210 <span class="keywordtype">void</span>
-<a name="l00211"></a><a class="code" href="group__multiset.html#g5e63a209af7e8b792f9a96225e8b1e9a">00211</a> <a class="code" href="group__multiset.html#g5e63a209af7e8b792f9a96225e8b1e9a">list_insert</a>(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">void</span> *e)
-<a name="l00212"></a>00212 {
-<a name="l00213"></a>00213     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( e != NULL );
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215     <span class="keywordflow">if</span> (l-><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a> == 0) {
-<a name="l00216"></a>00216         l-><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a> = l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> + 1;
-<a name="l00217"></a>00217         l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a> = <a class="code" href="group__multiset.html#gd791852a26bb24410135aa504c029ac8">list_realloc</a>(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>, (l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> + l-><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a>) [...]
-<a name="l00218"></a>00218     }
-<a name="l00219"></a>00219     
-<a name="l00220"></a>00220     l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>++;
-<a name="l00221"></a>00221     l-><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a>--;
-<a name="l00222"></a>00222     l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> - 1] = e;
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224     <span class="keywordflow">return</span>;
-<a name="l00225"></a>00225 }
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227 <span class="comment">/*</span>
-<a name="l00228"></a>00228 <span class="comment"> * @brief Remove element</span>
-<a name="l00229"></a>00229 <span class="comment"> * @param l         list</span>
-<a name="l00230"></a>00230 <span class="comment"> * @param e         element to remove. Note: pointer comparison</span>
-<a name="l00231"></a>00231 <span class="comment"> * @return e</span>
-<a name="l00232"></a>00232 <span class="comment"> *</span>
-<a name="l00233"></a>00233 <span class="comment"> * The provided element must exist in the list.</span>
-<a name="l00234"></a>00234 <span class="comment"> * Only one occurrence of e is removed.</span>
-<a name="l00235"></a>00235 <span class="comment"> * The element is removed from the list, but not deallocated.</span>
-<a name="l00236"></a>00236 <span class="comment"> *</span>
-<a name="l00237"></a>00237 <span class="comment"> * For convenience, the function returns the provided element pointer.</span>
-<a name="l00238"></a>00238 <span class="comment"> * This is to allow code like</span>
-<a name="l00239"></a>00239 <span class="comment"> * @code</span>
-<a name="l00240"></a>00240 <span class="comment"> *     element *e = element_list_remove(l, element_list_first(l));</span>
-<a name="l00241"></a>00241 <span class="comment"> * @endcode</span>
-<a name="l00242"></a>00242 <span class="comment"> *</span>
-<a name="l00243"></a>00243 <span class="comment"> * Time: Worst case O(n), O(1) for removing the element returned by list_first()</span>
-<a name="l00244"></a>00244 <span class="comment"> */</span>
-<a name="l00245"></a>00245 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00246"></a><a class="code" href="group__multiset.html#g2fdb96b9da8d926647099d3bd47d603d">00246</a> <a class="code" href="group__multiset.html#g2fdb96b9da8d926647099d3bd47d603d">list_remove_const</a>(<a class="code" href="structlist.html">list</a> *l, <span class="keyword">const</span> <span class="keywordtype">void</span> *e)
-<a name="l00247"></a>00247 {
-<a name="l00248"></a>00248     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00249"></a>00249     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( e != NULL );
-<a name="l00250"></a>00250 
-<a name="l00251"></a>00251     {
-<a name="l00252"></a>00252         <span class="keywordtype">int</span> i;
-<a name="l00253"></a>00253         <span class="keywordtype">int</span> indx = -1;
-<a name="l00254"></a>00254         <span class="keywordflow">for</span> (i = l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> - 1; i >= 0 && indx < 0; i--) {
-<a name="l00255"></a>00255             <span class="keywordflow">if</span> (l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i] == e) {
-<a name="l00256"></a>00256                 indx = i;
-<a name="l00257"></a>00257             }
-<a name="l00258"></a>00258         }
-<a name="l00259"></a>00259         
-<a name="l00260"></a>00260         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( indx >= 0 );
-<a name="l00261"></a>00261         
-<a name="l00262"></a>00262         <span class="keywordflow">for</span> (i = indx; i < l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>-1; i++) {
-<a name="l00263"></a>00263             l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i] = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i+1];
-<a name="l00264"></a>00264         }
-<a name="l00265"></a>00265     }        
-<a name="l00266"></a>00266     
-<a name="l00267"></a>00267     l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>--;
-<a name="l00268"></a>00268     l-><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a>++;
-<a name="l00269"></a>00269     
-<a name="l00270"></a>00270     <span class="keywordflow">if</span> (l-><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a> > 4 * l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>) {
-<a name="l00271"></a>00271         <span class="comment">/* Note: amortized constant time */</span>
-<a name="l00272"></a>00272         l-><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a> = l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>;
-<a name="l00273"></a>00273         l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a> = <a class="code" href="group__multiset.html#gd791852a26bb24410135aa504c029ac8">list_realloc</a>(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>, 
-<a name="l00274"></a>00274                                    (l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> + l-><a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a>) * <span class="keyword">sizeof</span>(*l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>));
-<a name="l00275"></a>00275     }        
-<a name="l00276"></a>00276     
-<a name="l00277"></a>00277     <span class="keywordflow">return</span> e;
-<a name="l00278"></a>00278 }
-<a name="l00279"></a>00279 
-<a name="l00280"></a>00280 <span class="keywordtype">void</span> *
-<a name="l00281"></a><a class="code" href="group__multiset.html#gd930cb6af417438f37a442896b48f80a">00281</a> <a class="code" href="group__multiset.html#gd930cb6af417438f37a442896b48f80a">list_remove</a>(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">void</span> *e)
-<a name="l00282"></a>00282 {
-<a name="l00283"></a>00283     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *)<a class="code" href="group__multiset.html#g2fdb96b9da8d926647099d3bd47d603d">list_remove_const</a>(l, e);    
-<a name="l00284"></a>00284 }
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286 <span class="comment">/*</span>
-<a name="l00287"></a>00287 <span class="comment"> * @brief Reverse the order of list elements</span>
-<a name="l00288"></a>00288 <span class="comment"> * @param l         list</span>
-<a name="l00289"></a>00289 <span class="comment"> * @return  Nothing </span>
-<a name="l00290"></a>00290 <span class="comment"> *</span>
-<a name="l00291"></a>00291 <span class="comment"> * Time: O(N)</span>
-<a name="l00292"></a>00292 <span class="comment"> */</span>
-<a name="l00293"></a>00293 <span class="keywordtype">void</span>
-<a name="l00294"></a><a class="code" href="group__multiset.html#g276d60cc73b392f762c0ccf4b3754dad">00294</a> <a class="code" href="group__multiset.html#g276d60cc73b392f762c0ccf4b3754dad">list_reverse</a>(<a class="code" href="structlist.html">list</a> *l)
-<a name="l00295"></a>00295 {
-<a name="l00296"></a>00296     <span class="keywordtype">int</span> i, k;
-<a name="l00297"></a>00297     
-<a name="l00298"></a>00298     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00299"></a>00299     
-<a name="l00300"></a>00300     <span class="keywordflow">for</span> (i = 0, k = l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>-1; i < k; i++, k--)
-<a name="l00301"></a>00301     {
-<a name="l00302"></a>00302         <span class="keywordtype">void</span>    *tmp;
-<a name="l00303"></a>00303         tmp = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i];
-<a name="l00304"></a>00304         l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i] = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[k];
-<a name="l00305"></a>00305         l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[k] = tmp;
-<a name="l00306"></a>00306     }
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308     <span class="keywordflow">return</span>;
-<a name="l00309"></a>00309 }
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311 <span class="comment">/*</span>
-<a name="l00312"></a>00312 <span class="comment"> * @brief Iterate</span>
-<a name="l00313"></a>00313 <span class="comment"> * @param l         list</span>
-<a name="l00314"></a>00314 <span class="comment"> * @return first element, or NULL if list empty</span>
-<a name="l00315"></a>00315 <span class="comment"> *</span>
-<a name="l00316"></a>00316 <span class="comment"> * @code</span>
-<a name="l00317"></a>00317 <span class="comment"> *     for(element *e = list_first(l);</span>
-<a name="l00318"></a>00318 <span class="comment"> *         e != NULL; </span>
-<a name="l00319"></a>00319 <span class="comment"> *         e = list_next(l)) {...}</span>
-<a name="l00320"></a>00320 <span class="comment"> * @endcode</span>
-<a name="l00321"></a>00321 <span class="comment"> *</span>
-<a name="l00322"></a>00322 <span class="comment"> * The list must not be modified between calls to list_first() or list_next()</span>
-<a name="l00323"></a>00323 <span class="comment"> *</span>
-<a name="l00324"></a>00324 <span class="comment"> * Note: It is not possible to have more simultaneous iterations over the same</span>
-<a name="l00325"></a>00325 <span class="comment"> * list. This functionality can be achived by duplicating the list.</span>
-<a name="l00326"></a>00326 <span class="comment"> *</span>
-<a name="l00327"></a>00327 <span class="comment"> * Time: O(1)</span>
-<a name="l00328"></a>00328 <span class="comment"> */</span>
-<a name="l00329"></a>00329 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00330"></a><a class="code" href="group__multiset.html#g6a309c29348190f4a4c5eeadb98087a9">00330</a> <a class="code" href="group__multiset.html#g6a309c29348190f4a4c5eeadb98087a9">list_first_const</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l)
-<a name="l00331"></a>00331 {
-<a name="l00332"></a>00332     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="keywordflow">if</span> (l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> == 0) <span class="keywordflow">return</span> NULL;
-<a name="l00335"></a>00335 
-<a name="l00336"></a>00336     <span class="comment">/* Loop backwards, faster if user</span>
-<a name="l00337"></a>00337 <span class="comment">       erases the first element */</span>
-<a name="l00338"></a>00338 
-<a name="l00339"></a>00339     ((<a class="code" href="structlist.html">list</a> *)l)->current = l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> - 1;
-<a name="l00340"></a>00340     <span class="keywordflow">return</span> l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[l-><a class="code" href="structlist.html#87b04e0bab57e6949272df159ee19baf">current</a>];
-<a name="l00341"></a>00341 }
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343 <span class="keywordtype">void</span> *
-<a name="l00344"></a><a class="code" href="group__multiset.html#gcd8957206ede65fe202056cf477a70a7">00344</a> <a class="code" href="group__multiset.html#gcd8957206ede65fe202056cf477a70a7">list_first</a>(<a class="code" href="structlist.html">list</a> *l)
-<a name="l00345"></a>00345 {
-<a name="l00346"></a>00346     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *)<a class="code" href="group__multiset.html#g6a309c29348190f4a4c5eeadb98087a9">list_first_const</a>(l);
-<a name="l00347"></a>00347 }
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349 <span class="comment">/*</span>
-<a name="l00350"></a>00350 <span class="comment"> * @brief Iterate</span>
-<a name="l00351"></a>00351 <span class="comment"> * @param l         list</span>
-<a name="l00352"></a>00352 <span class="comment"> * @return next element, or NULL if no more elements</span>
-<a name="l00353"></a>00353 <span class="comment"> *</span>
-<a name="l00354"></a>00354 <span class="comment"> * See list_first().</span>
-<a name="l00355"></a>00355 <span class="comment"> *</span>
-<a name="l00356"></a>00356 <span class="comment"> * Time: O(1)</span>
-<a name="l00357"></a>00357 <span class="comment"> */</span>
-<a name="l00358"></a>00358 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00359"></a><a class="code" href="group__multiset.html#g26472127771d0bcc4a49191de53233a1">00359</a> <a class="code" href="group__multiset.html#g26472127771d0bcc4a49191de53233a1">list_next_const</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l)
-<a name="l00360"></a>00360 {
-<a name="l00361"></a>00361     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00362"></a>00362   
-<a name="l00363"></a>00363     <span class="keywordflow">if</span> (l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> == 0) <span class="keywordflow">return</span> NULL;
-<a name="l00364"></a>00364 
-<a name="l00365"></a>00365     ((<a class="code" href="structlist.html">list</a> *)l)->current -= 1;
-<a name="l00366"></a>00366     
-<a name="l00367"></a>00367     <span class="keywordflow">if</span> (l-><a class="code" href="structlist.html#87b04e0bab57e6949272df159ee19baf">current</a> < 0) <span class="keywordflow">return</span> NULL;
-<a name="l00368"></a>00368     <span class="keywordflow">else</span> <span class="keywordflow">return</span> l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[l-><a class="code" href="structlist.html#87b04e0bab57e6949272df159ee19baf">current</a>];
-<a name="l00369"></a>00369 }
-<a name="l00370"></a>00370 
-<a name="l00371"></a>00371 <span class="keywordtype">void</span> *
-<a name="l00372"></a><a class="code" href="group__multiset.html#g5c52611dbc9f33d472caa4c1df3f2da5">00372</a> <a class="code" href="group__multiset.html#g5c52611dbc9f33d472caa4c1df3f2da5">list_next</a>(<a class="code" href="structlist.html">list</a> *l)
-<a name="l00373"></a>00373 {
-<a name="l00374"></a>00374     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *)<a class="code" href="group__multiset.html#g26472127771d0bcc4a49191de53233a1">list_next_const</a>(l);
-<a name="l00375"></a>00375 }
-<a name="l00376"></a>00376 
-<a name="l00377"></a>00377 <span class="comment">/*</span>
-<a name="l00378"></a>00378 <span class="comment"> * @brief Iterate through pairs</span>
-<a name="l00379"></a>00379 <span class="comment"> * @param l         list</span>
-<a name="l00380"></a>00380 <span class="comment"> * @param e1        (output) first pair 1st element, or NULL if list</span>
-<a name="l00381"></a>00381 <span class="comment">                    has less than two elements</span>
-<a name="l00382"></a>00382 <span class="comment"> * @param e2        (output) first pair 2nd element</span>
-<a name="l00383"></a>00383 <span class="comment"> *</span>
-<a name="l00384"></a>00384 <span class="comment"> * The iteration is through the K(n,2) different pairs, i.e. the</span>
-<a name="l00385"></a>00385 <span class="comment"> * pair (e1,e2) is considered equal to the pair (e2,e1) and only</span>
-<a name="l00386"></a>00386 <span class="comment"> * visited once.</span>
-<a name="l00387"></a>00387 <span class="comment"> *</span>
-<a name="l00388"></a>00388 <span class="comment"> * @code</span>
-<a name="l00389"></a>00389 <span class="comment"> *     for(list_first_pair(l, &e1, &e2);</span>
-<a name="l00390"></a>00390 <span class="comment"> *         e1 != NULL; </span>
-<a name="l00391"></a>00391 <span class="comment"> *         list_next_pair(l, &e1, &e2))</span>
-<a name="l00392"></a>00392 <span class="comment"> * @endcode</span>
-<a name="l00393"></a>00393 <span class="comment"> *</span>
-<a name="l00394"></a>00394 <span class="comment"> * The list must not be modified between calls to</span>
-<a name="l00395"></a>00395 <span class="comment"> * list_first_pair() or list_next_pair()</span>
-<a name="l00396"></a>00396 <span class="comment"> *</span>
-<a name="l00397"></a>00397 <span class="comment"> * The current position is cached in the list object. Therefore simultaneous</span>
-<a name="l00398"></a>00398 <span class="comment"> * pair iterations over the same list is not allowed.</span>
-<a name="l00399"></a>00399 <span class="comment"> *</span>
-<a name="l00400"></a>00400 <span class="comment"> * However, iterating pairs simultaneously with a 1 element iteration (using</span>
-<a name="l00401"></a>00401 <span class="comment"> * list_first() and list_next()) is allowed.</span>
-<a name="l00402"></a>00402 <span class="comment"> *</span>
-<a name="l00403"></a>00403 <span class="comment"> * Time: O(1)</span>
-<a name="l00404"></a>00404 <span class="comment"> */</span>
-<a name="l00405"></a>00405 <span class="keywordtype">void</span>
-<a name="l00406"></a><a class="code" href="group__multiset.html#g71a3d48a34a961956cd0fc55c9a8b502">00406</a> <a class="code" href="group__multiset.html#g71a3d48a34a961956cd0fc55c9a8b502">list_first_pair_const</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l,
-<a name="l00407"></a>00407                       <span class="keyword">const</span> <span class="keywordtype">void</span> **e1,
-<a name="l00408"></a>00408                       <span class="keyword">const</span> <span class="keywordtype">void</span> **e2)
-<a name="l00409"></a>00409 {
-<a name="l00410"></a>00410     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00411"></a>00411     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( e1 != NULL );
-<a name="l00412"></a>00412     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( e2 != NULL );
-<a name="l00413"></a>00413     
-<a name="l00414"></a>00414     <span class="keywordflow">if</span> (l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> <= 1) {
-<a name="l00415"></a>00415         *e1 = NULL;
-<a name="l00416"></a>00416         *e2 = NULL;
-<a name="l00417"></a>00417         <span class="keywordflow">return</span>;
-<a name="l00418"></a>00418     }
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420     ((<a class="code" href="structlist.html">list</a> *)l)->current_p1 = l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> - 1;
-<a name="l00421"></a>00421     ((<a class="code" href="structlist.html">list</a> *)l)->current_p2 = l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> - 2;
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423     *e1 = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[l-><a class="code" href="structlist.html#38d7fad1310a6005cefaa130cce4597a">current_p1</a>];
-<a name="l00424"></a>00424     *e2 = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[l-><a class="code" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">current_p2</a>];
-<a name="l00425"></a>00425     
-<a name="l00426"></a>00426     <span class="keywordflow">return</span>;
-<a name="l00427"></a>00427 }
-<a name="l00428"></a>00428 
-<a name="l00429"></a>00429 <span class="keywordtype">void</span>
-<a name="l00430"></a><a class="code" href="group__multiset.html#g1a78a6f27d351d9e1dc99d2247a2455b">00430</a> <a class="code" href="group__multiset.html#g1a78a6f27d351d9e1dc99d2247a2455b">list_first_pair</a>(<a class="code" href="structlist.html">list</a> *l,
-<a name="l00431"></a>00431                 <span class="keywordtype">void</span> **e1,
-<a name="l00432"></a>00432                 <span class="keywordtype">void</span> **e2)
-<a name="l00433"></a>00433 {
-<a name="l00434"></a>00434     <a class="code" href="group__multiset.html#g71a3d48a34a961956cd0fc55c9a8b502">list_first_pair_const</a>(l, 
-<a name="l00435"></a>00435                           (<span class="keyword">const</span> <span class="keywordtype">void</span> **)e1, 
-<a name="l00436"></a>00436                           (<span class="keyword">const</span> <span class="keywordtype">void</span> **)e2);
-<a name="l00437"></a>00437 
-<a name="l00438"></a>00438     <span class="keywordflow">return</span>;
-<a name="l00439"></a>00439 }
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441 <span class="comment">/*</span>
-<a name="l00442"></a>00442 <span class="comment"> * @brief Iterate through pairs</span>
-<a name="l00443"></a>00443 <span class="comment"> * @param l         list</span>
-<a name="l00444"></a>00444 <span class="comment"> * @param e1        (output) next pair 1st element, or NULL if no more pairs</span>
-<a name="l00445"></a>00445 <span class="comment"> * @param e2        (output) next pair 2nd element, or NULL if no more pairs</span>
-<a name="l00446"></a>00446 <span class="comment"> *</span>
-<a name="l00447"></a>00447 <span class="comment"> * See list_first_pair().</span>
-<a name="l00448"></a>00448 <span class="comment"> *</span>
-<a name="l00449"></a>00449 <span class="comment"> * Time: O(1)</span>
-<a name="l00450"></a>00450 <span class="comment"> */</span>
-<a name="l00451"></a>00451 <span class="keywordtype">void</span>
-<a name="l00452"></a><a class="code" href="group__multiset.html#g8723ab90a5925a64e30c250e770d10d0">00452</a> <a class="code" href="group__multiset.html#g8723ab90a5925a64e30c250e770d10d0">list_next_pair_const</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l,
-<a name="l00453"></a>00453                      <span class="keyword">const</span> <span class="keywordtype">void</span> **e1,
-<a name="l00454"></a>00454                      <span class="keyword">const</span> <span class="keywordtype">void</span> **e2)
-<a name="l00455"></a>00455 {
-<a name="l00456"></a>00456     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00457"></a>00457     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( e1 != NULL );
-<a name="l00458"></a>00458     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( e2 != NULL );
-<a name="l00459"></a>00459   
-<a name="l00460"></a>00460     <span class="keywordflow">if</span> (l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> <= 1) {
-<a name="l00461"></a>00461         *e1 = NULL;
-<a name="l00462"></a>00462         *e2 = NULL;
-<a name="l00463"></a>00463         <span class="keywordflow">return</span>;
-<a name="l00464"></a>00464     }
-<a name="l00465"></a>00465     
-<a name="l00466"></a>00466     ((<a class="code" href="structlist.html">list</a> *)l)->current_p2 -= 1;
-<a name="l00467"></a>00467 
-<a name="l00468"></a>00468     <span class="keywordflow">if</span> (l-><a class="code" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">current_p2</a> < 0) {
-<a name="l00469"></a>00469         ((<a class="code" href="structlist.html">list</a> *)l)->current_p1 -= 1;
-<a name="l00470"></a>00470         ((<a class="code" href="structlist.html">list</a> *)l)->current_p2 = l-><a class="code" href="structlist.html#38d7fad1310a6005cefaa130cce4597a">current_p1</a> - 1;
-<a name="l00471"></a>00471         <span class="keywordflow">if</span> (l-><a class="code" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">current_p2</a> < 0) {
-<a name="l00472"></a>00472             *e1 = NULL;
-<a name="l00473"></a>00473             *e2 = NULL;
-<a name="l00474"></a>00474             <span class="keywordflow">return</span>;
-<a name="l00475"></a>00475         }
-<a name="l00476"></a>00476         *e1 = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[l-><a class="code" href="structlist.html#38d7fad1310a6005cefaa130cce4597a">current_p1</a>];
-<a name="l00477"></a>00477         *e2 = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[l-><a class="code" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">current_p2</a>];
-<a name="l00478"></a>00478         <span class="keywordflow">return</span>;
-<a name="l00479"></a>00479     }
-<a name="l00480"></a>00480     
-<a name="l00481"></a>00481     *e2 = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[l-><a class="code" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">current_p2</a>];
-<a name="l00482"></a>00482     <span class="keywordflow">return</span>;
-<a name="l00483"></a>00483 }
-<a name="l00484"></a>00484 
-<a name="l00485"></a>00485 <span class="keywordtype">void</span>
-<a name="l00486"></a><a class="code" href="group__multiset.html#g72eca5c2f995f7885c72dff4b77a6dfe">00486</a> <a class="code" href="group__multiset.html#g72eca5c2f995f7885c72dff4b77a6dfe">list_next_pair</a>(<a class="code" href="structlist.html">list</a> *l,
-<a name="l00487"></a>00487                <span class="keywordtype">void</span> **e1,
-<a name="l00488"></a>00488                <span class="keywordtype">void</span> **e2)
-<a name="l00489"></a>00489 {
-<a name="l00490"></a>00490     <a class="code" href="group__multiset.html#g8723ab90a5925a64e30c250e770d10d0">list_next_pair_const</a>(l, (<span class="keyword">const</span> <span class="keywordtype">void</span> **)e1, (<span class="keyword">const</span> <span class="keywordtype">void</span> **)e2);
-<a name="l00491"></a>00491     <span class="keywordflow">return</span>;
-<a name="l00492"></a>00492 }
-<a name="l00493"></a>00493 
-<a name="l00506"></a>00506 <a class="code" href="structlist.html">list</a> *
-<a name="l00507"></a><a class="code" href="group__multiset.html#g014e03d131a3d24d1d52465fd0f63a2f">00507</a> <a class="code" href="group__multiset.html#g014e03d131a3d24d1d52465fd0f63a2f">list_extract</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l,
-<a name="l00508"></a>00508              <span class="keywordtype">void</span> *(*duplicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *),
-<a name="l00509"></a>00509              <span class="keywordtype">bool</span> (*predicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *),
-<a name="l00510"></a>00510              <span class="keywordtype">void</span> *data)
-<a name="l00511"></a>00511 {
-<a name="l00512"></a>00512     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00513"></a>00513     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( duplicate != NULL);
-<a name="l00514"></a>00514     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( predicate != NULL);
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516     {
-<a name="l00517"></a>00517         <a class="code" href="structlist.html">list</a> *ex = <a class="code" href="group__multiset.html#g14ca81b1edd1222975ab52e203cbde59">list_new</a>();
-<a name="l00518"></a>00518         <span class="keywordtype">int</span> i;
-<a name="l00519"></a>00519 
-<a name="l00520"></a>00520         <span class="keywordflow">for</span> (i = 0; i < l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>; i++) {
-<a name="l00521"></a>00521             <span class="keywordflow">if</span> (predicate(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i], data)) {
-<a name="l00522"></a>00522                 <a class="code" href="group__multiset.html#g5e63a209af7e8b792f9a96225e8b1e9a">list_insert</a>(ex, duplicate(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i]));
-<a name="l00523"></a>00523             }
-<a name="l00524"></a>00524         }
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526         <span class="keywordflow">return</span> ex;
-<a name="l00527"></a>00527     }
-<a name="l00528"></a>00528 }
-<a name="l00529"></a>00529 
-<a name="l00530"></a>00530 <span class="comment">/*</span>
-<a name="l00531"></a>00531 <span class="comment"> * @brief Find minimum element</span>
-<a name="l00532"></a>00532 <span class="comment"> * @param l          non-empty list</span>
-<a name="l00533"></a>00533 <span class="comment"> * @param less_than  comparison function which must return true, iff</span>
-<a name="l00534"></a>00534 <span class="comment"> *                   its first argument is considered less than the second argument.</span>
-<a name="l00535"></a>00535 <span class="comment"> *                   The 3rd argument is auxillary data used for the comparison.</span>
-<a name="l00536"></a>00536 <span class="comment"> *                   The provided function should be a strict ordering (i.e. behave</span>
-<a name="l00537"></a>00537 <span class="comment"> *                   like <)</span>
-<a name="l00538"></a>00538 <span class="comment"> * @param data       Auxillary data sent to the comparison function. May be NULL.</span>
-<a name="l00539"></a>00539 <span class="comment"> * @return minimum element</span>
-<a name="l00540"></a>00540 <span class="comment"> *</span>
-<a name="l00541"></a>00541 <span class="comment"> * Time: O(n)</span>
-<a name="l00542"></a>00542 <span class="comment"> */</span>
-<a name="l00543"></a>00543 <span class="keywordtype">void</span> *
-<a name="l00544"></a><a class="code" href="group__multiset.html#gc52f12226db01726e092b3ec7c95ebc4">00544</a> <a class="code" href="group__multiset.html#gc52f12226db01726e092b3ec7c95ebc4">list_min</a>(<a class="code" href="structlist.html">list</a> *l, list_func_lt less_than, <span class="keywordtype">void</span> *data)
-<a name="l00545"></a>00545 {
-<a name="l00546"></a>00546     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00547"></a>00547     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( less_than != NULL);
-<a name="l00548"></a>00548     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <a class="code" href="group__multiset.html#g5287413c34475d2be585d0d499284ad0">list_size</a>(l) > 0);
-<a name="l00549"></a>00549 
-<a name="l00550"></a>00550     {
-<a name="l00551"></a>00551         <span class="keywordtype">int</span> minindex = 0;
-<a name="l00552"></a>00552         <span class="keywordtype">int</span> i;
-<a name="l00553"></a>00553         <span class="keywordflow">for</span> (i = 1; i < l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>; i++) {
-<a name="l00554"></a>00554             <span class="keywordflow">if</span> (less_than(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i], l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[minindex], data))
-<a name="l00555"></a>00555                 minindex = i;
-<a name="l00556"></a>00556         }
-<a name="l00557"></a>00557         
-<a name="l00558"></a>00558         <span class="keywordflow">return</span> l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[minindex];
-<a name="l00559"></a>00559     }
-<a name="l00560"></a>00560 }
-<a name="l00561"></a>00561 
-<a name="l00562"></a>00562 <span class="comment">/*</span>
-<a name="l00563"></a>00563 <span class="comment"> * @brief Find minimum element</span>
-<a name="l00564"></a>00564 <span class="comment"> * @param l          non-empty list</span>
-<a name="l00565"></a>00565 <span class="comment"> * @param eval       evaluation function</span>
-<a name="l00566"></a>00566 <span class="comment"> * @param data       Auxillary data sent to the evaluation function. May be NULL.</span>
-<a name="l00567"></a>00567 <span class="comment"> * @return minimum (as defined by the evaluation function) element</span>
-<a name="l00568"></a>00568 <span class="comment"> *</span>
-<a name="l00569"></a>00569 <span class="comment"> * Time: O(n)</span>
-<a name="l00570"></a>00570 <span class="comment"> */</span>
-<a name="l00571"></a>00571 <span class="keywordtype">void</span> *
-<a name="l00572"></a><a class="code" href="group__multiset.html#gf6935394b702cbc694e5dda2521c181b">00572</a> <a class="code" href="group__multiset.html#gf6935394b702cbc694e5dda2521c181b">list_min_val</a>(<a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data)
-<a name="l00573"></a>00573 {
-<a name="l00574"></a>00574     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00575"></a>00575     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( eval != NULL);
-<a name="l00576"></a>00576     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <a class="code" href="group__multiset.html#g5287413c34475d2be585d0d499284ad0">list_size</a>(l) > 0);
-<a name="l00577"></a>00577     
-<a name="l00578"></a>00578     {
-<a name="l00579"></a>00579         <span class="keywordtype">int</span> minindex = 0;
-<a name="l00580"></a>00580         <span class="keywordtype">double</span> minval = eval(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[0], data);
-<a name="l00581"></a>00581         <span class="keywordtype">int</span> i;
-<a name="l00582"></a>00582 
-<a name="l00583"></a>00583         <span class="keywordflow">for</span> (i = 1; i < l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>; i++) {
-<a name="l00584"></a>00584             <span class="keywordtype">double</span> val = eval(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i], data);
-<a name="l00585"></a>00585             if (val < minval) {
-<a name="l00586"></a>00586                 minval = val;
-<a name="l00587"></a>00587                 minindex = i;
-<a name="l00588"></a>00588             }
-<a name="l00589"></a>00589         }
-<a name="l00590"></a>00590         
-<a name="l00591"></a>00591         <span class="keywordflow">return</span> l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[minindex];
-<a name="l00592"></a>00592     }
-<a name="l00593"></a>00593 }
-<a name="l00594"></a>00594 
-<a name="l00595"></a>00595 <span class="comment">/*</span>
-<a name="l00596"></a>00596 <span class="comment"> * @brief Find maximum element</span>
-<a name="l00597"></a>00597 <span class="comment"> * @param l          non-empty list</span>
-<a name="l00598"></a>00598 <span class="comment"> * @param eval       evaluation function</span>
-<a name="l00599"></a>00599 <span class="comment"> * @param data       Auxillary data sent to the evaluation function. May be NULL.</span>
-<a name="l00600"></a>00600 <span class="comment"> * @return maximum (as defined by the evaluation function) element</span>
-<a name="l00601"></a>00601 <span class="comment"> *</span>
-<a name="l00602"></a>00602 <span class="comment"> * Time: O(n)</span>
-<a name="l00603"></a>00603 <span class="comment"> */</span>
-<a name="l00604"></a>00604 <span class="keywordtype">void</span> *
-<a name="l00605"></a><a class="code" href="group__multiset.html#g13ef29594314bbfb2d5ecd3a059653f9">00605</a> <a class="code" href="group__multiset.html#g13ef29594314bbfb2d5ecd3a059653f9">list_max_val</a>(<a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data)
-<a name="l00606"></a>00606 {
-<a name="l00607"></a>00607     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00608"></a>00608     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( eval != NULL);
-<a name="l00609"></a>00609     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <a class="code" href="group__multiset.html#g5287413c34475d2be585d0d499284ad0">list_size</a>(l) > 0);
-<a name="l00610"></a>00610     
-<a name="l00611"></a>00611     {
-<a name="l00612"></a>00612         <span class="keywordtype">int</span> maxindex = 0;
-<a name="l00613"></a>00613         <span class="keywordtype">double</span> maxval = eval(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[0], data);
-<a name="l00614"></a>00614         <span class="keywordtype">int</span> i;
-<a name="l00615"></a>00615         
-<a name="l00616"></a>00616         <span class="keywordflow">for</span> (i = 1; i < l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>; i++) {
-<a name="l00617"></a>00617             <span class="keywordtype">double</span> val = eval(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i], data);
-<a name="l00618"></a>00618             if (val > maxval) {
-<a name="l00619"></a>00619                 maxval = val;
-<a name="l00620"></a>00620                 maxindex = i;
-<a name="l00621"></a>00621             }
-<a name="l00622"></a>00622         }
-<a name="l00623"></a>00623         
-<a name="l00624"></a>00624         <span class="keywordflow">return</span> l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[maxindex];
-<a name="l00625"></a>00625     }
-<a name="l00626"></a>00626 }
-<a name="l00627"></a>00627 
-<a name="l00628"></a>00628 <span class="comment">/*</span>
-<a name="l00629"></a>00629 <span class="comment"> * @brief Find maximum element</span>
-<a name="l00630"></a>00630 <span class="comment"> * @param l          see list_min()</span>
-<a name="l00631"></a>00631 <span class="comment"> * @param less_than  see list_min()</span>
-<a name="l00632"></a>00632 <span class="comment"> * @param data       see list_min()</span>
-<a name="l00633"></a>00633 <span class="comment"> * @return maximum element</span>
-<a name="l00634"></a>00634 <span class="comment"> *</span>
-<a name="l00635"></a>00635 <span class="comment"> * Time: O(n)</span>
-<a name="l00636"></a>00636 <span class="comment"> */</span>
-<a name="l00637"></a>00637 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00638"></a><a class="code" href="group__multiset.html#g39d692d83a67a5554962f19684ebbe70">00638</a> <a class="code" href="group__multiset.html#g39d692d83a67a5554962f19684ebbe70">list_max_const</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, list_func_lt less_than, <span class="keywordtype">void</span> *data)
-<a name="l00639"></a>00639 {
-<a name="l00640"></a>00640     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00641"></a>00641     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( less_than != NULL);
-<a name="l00642"></a>00642     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( <a class="code" href="group__multiset.html#g5287413c34475d2be585d0d499284ad0">list_size</a>(l) > 0);
-<a name="l00643"></a>00643     
-<a name="l00644"></a>00644     {
-<a name="l00645"></a>00645         <span class="keywordtype">int</span> maxindex = 0;
-<a name="l00646"></a>00646         <span class="keywordtype">int</span> i;
-<a name="l00647"></a>00647         <span class="keywordflow">for</span> (i = 1; i < l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>; i++) {
-<a name="l00648"></a>00648             <span class="keywordflow">if</span> (!less_than(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i], l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[maxindex], data))
-<a name="l00649"></a>00649                 maxindex = i;
-<a name="l00650"></a>00650         }
-<a name="l00651"></a>00651         
-<a name="l00652"></a>00652         <span class="keywordflow">return</span> l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[maxindex];
-<a name="l00653"></a>00653     }
-<a name="l00654"></a>00654 }
-<a name="l00655"></a>00655 
-<a name="l00656"></a>00656 <span class="keywordtype">void</span> *
-<a name="l00657"></a><a class="code" href="group__multiset.html#gd24f0143a53c96f495c7d2cc7a7e6aca">00657</a> <a class="code" href="group__multiset.html#gd24f0143a53c96f495c7d2cc7a7e6aca">list_max</a>(<a class="code" href="structlist.html">list</a> *l, list_func_lt less_than, <span class="keywordtype">void</span> *data)
-<a name="l00658"></a>00658 {
-<a name="l00659"></a>00659     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *)<a class="code" href="group__multiset.html#g39d692d83a67a5554962f19684ebbe70">list_max_const</a>(l, less_than, data);
-<a name="l00660"></a>00660 }
-<a name="l00661"></a>00661 
-<a name="l00662"></a>00662 
-<a name="l00663"></a>00663 <span class="comment">/*</span>
-<a name="l00664"></a>00664 <span class="comment"> * @brief Find k'th element</span>
-<a name="l00665"></a>00665 <span class="comment"> * @param l          non-empty list</span>
-<a name="l00666"></a>00666 <span class="comment"> * @param k          between 1 and list size, inclusive.</span>
-<a name="l00667"></a>00667 <span class="comment"> * @param n          list size</span>
-<a name="l00668"></a>00668 <span class="comment"> * @param less_than  see list_min()</span>
-<a name="l00669"></a>00669 <span class="comment"> * @param data       see list_min()</span>
-<a name="l00670"></a>00670 <span class="comment"> * @return k'th element</span>
-<a name="l00671"></a>00671 <span class="comment"> *</span>
-<a name="l00672"></a>00672 <span class="comment"> * Be careful to provide an irreflexive comparison function (i.e.</span>
-<a name="l00673"></a>00673 <span class="comment"> * x < x must always be false), or this function may not return.</span>
-<a name="l00674"></a>00674 <span class="comment"> *</span>
-<a name="l00675"></a>00675 <span class="comment"> * Time: Worst case O(n*n). Average over all input: O(n)</span>
-<a name="l00676"></a>00676 <span class="comment"> */</span>
-<a name="l00677"></a>00677 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00678"></a><a class="code" href="group__multiset.html#ge1f21da53f4a26ca9dd7e25f19286408">00678</a> <a class="code" href="group__multiset.html#ge1f21da53f4a26ca9dd7e25f19286408">kth</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *a[], <span class="keywordtype">int</span> k, <span class="keywordtype">int</span> n, list_func_lt less_than, <span class="keywordtype">void</span> *data)
-<a name="l00679"></a>00679 {
-<a name="l00680"></a>00680     <span class="keywordtype">int</span> i, j, lo, hi;
-<a name="l00681"></a>00681     
-<a name="l00682"></a>00682     k -= 1;
-<a name="l00683"></a>00683 
-<a name="l00684"></a>00684     lo = 0;
-<a name="l00685"></a>00685     hi = n - 1;
-<a name="l00686"></a>00686     <span class="keywordflow">while</span> (lo < hi) {
-<a name="l00687"></a>00687         <span class="keyword">const</span> <span class="keywordtype">void</span> *pivot = a[k];<span class="comment">//fixme select randomly, swap with a[k]</span>
-<a name="l00688"></a>00688         i = lo;
-<a name="l00689"></a>00689         j = hi;
-<a name="l00690"></a>00690         <span class="keywordflow">do</span> {
-<a name="l00691"></a>00691             <span class="keywordflow">while</span> (less_than(a[i], pivot, data)) i++;
-<a name="l00692"></a>00692             <span class="keywordflow">while</span> (less_than(pivot, a[j], data)) {
-<a name="l00693"></a>00693                 j--;
-<a name="l00694"></a>00694             }
-<a name="l00695"></a>00695             <span class="keywordflow">if</span> (i <= j) {
-<a name="l00696"></a>00696                 <span class="keyword">const</span> <span class="keywordtype">void</span> *tmp = a[i];
-<a name="l00697"></a>00697                 a[i] = a[j];
-<a name="l00698"></a>00698                 a[j] = tmp;
-<a name="l00699"></a>00699                 i++; j--;
-<a name="l00700"></a>00700             }
-<a name="l00701"></a>00701         } <span class="keywordflow">while</span> (i <= j);
-<a name="l00702"></a>00702         <span class="keywordflow">if</span> (j < k) lo = i;
-<a name="l00703"></a>00703         <span class="keywordflow">if</span> (k < i) hi = j;
-<a name="l00704"></a>00704     }
-<a name="l00705"></a>00705     <span class="keywordflow">return</span> a[k];
-<a name="l00706"></a>00706 }
-<a name="l00707"></a>00707 
-<a name="l00708"></a>00708 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00709"></a><a class="code" href="group__multiset.html#gbe07f00186264749cbecd016562119d1">00709</a> <a class="code" href="group__multiset.html#gbe07f00186264749cbecd016562119d1">list_kth_const</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k,
-<a name="l00710"></a>00710                list_func_lt less_than, <span class="keywordtype">void</span> *data)
-<a name="l00711"></a>00711 {
-<a name="l00712"></a>00712     <span class="keywordtype">void</span>    *kp;
-<a name="l00713"></a>00713     <span class="keywordtype">void</span>    **elemcpy;
-<a name="l00714"></a>00714     <span class="keywordtype">int</span>     len;
-<a name="l00715"></a>00715     
-<a name="l00716"></a>00716     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00717"></a>00717     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( 1 <= k && k <= l->size );
-<a name="l00718"></a>00718     
-<a name="l00719"></a>00719     <span class="comment">/* the function kth() scrambles the elements, so copy them */</span>
-<a name="l00720"></a>00720     len = l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> * <span class="keyword">sizeof</span>(*l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>);
-<a name="l00721"></a>00721     elemcpy = <a class="code" href="group__multiset.html#g835886d7e2108ff01e9123261b28eb1e">list_malloc</a>(len);
-<a name="l00722"></a>00722     memcpy(elemcpy, l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>, len);
-<a name="l00723"></a>00723     
-<a name="l00724"></a>00724     kp = (<span class="keywordtype">void</span>*)<a class="code" href="group__multiset.html#ge1f21da53f4a26ca9dd7e25f19286408">kth</a>((<span class="keyword">const</span> <span class="keywordtype">void</span> **)elemcpy, k, l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>, less_than, data);
-<a name="l00725"></a>00725     
-<a name="l00726"></a>00726     <a class="code" href="group__multiset.html#g7d02aeb71198273b9f07173f4ff19a5b">list_free</a>(elemcpy);
-<a name="l00727"></a>00727     
-<a name="l00728"></a>00728     <span class="keywordflow">return</span> kp;
-<a name="l00729"></a>00729 }
-<a name="l00730"></a>00730 
-<a name="l00731"></a>00731 <span class="keywordtype">void</span> *
-<a name="l00732"></a><a class="code" href="group__multiset.html#gee7de62f4bb9591e4c2cd75056f30c57">00732</a> <a class="code" href="group__multiset.html#gee7de62f4bb9591e4c2cd75056f30c57">list_kth</a>(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k,
-<a name="l00733"></a>00733          list_func_lt less_than,
-<a name="l00734"></a>00734          <span class="keywordtype">void</span> *data)
-<a name="l00735"></a>00735 {
-<a name="l00736"></a>00736     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *)<a class="code" href="group__multiset.html#gbe07f00186264749cbecd016562119d1">list_kth_const</a>(l, k, less_than, data);
-<a name="l00737"></a>00737 }
-<a name="l00738"></a>00738 
-<a name="l00739"></a>00739 <span class="comment">/*</span>
-<a name="l00740"></a>00740 <span class="comment"> * @brief Determine order of elements given an evaluation function</span>
-<a name="l00741"></a>00741 <span class="comment"> * @param e1         first element</span>
-<a name="l00742"></a>00742 <span class="comment"> * @param e2         second element</span>
-<a name="l00743"></a>00743 <span class="comment"> * @param data       containing the evaluation function, and</span>
-<a name="l00744"></a>00744 <span class="comment"> *                   additional data which is passed to the evaluation function</span>
-<a name="l00745"></a>00745 <span class="comment"> * @return true iff e1 evaluates to a number less than e2</span>
-<a name="l00746"></a>00746 <span class="comment"> */</span>
-<a name="l00747"></a>00747 <span class="keyword">static</span>
-<a name="l00748"></a><a class="code" href="group__multiset.html#g6d335487e4c513ed07ae0683e937670d">00748</a> <span class="keywordtype">bool</span> <a class="code" href="group__multiset.html#g6d335487e4c513ed07ae0683e937670d">val_less_than</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *e1, <span class="keyword">const</span> <span class="keywordtype">void</span> *e2, <span class="keywordtype">void</span> *data)
-<a name="l00749"></a>00749 {
-<a name="l00750"></a>00750     <span class="keyword">struct </span>{
-<a name="l00751"></a>00751         list_func_eval f;
-<a name="l00752"></a>00752         <span class="keywordtype">void</span> *aux_data;
-<a name="l00753"></a>00753     } *d = data;
-<a name="l00754"></a>00754     <span class="comment">/* Cast is safe, see caller of this function */</span>
-<a name="l00755"></a>00755 
-<a name="l00756"></a>00756     
-<a name="l00757"></a>00757     <span class="comment">/* Unfortunately, as the following commented code demonstrated,</span>
-<a name="l00758"></a>00758 <span class="comment">       with GCC-4.2.0 calling the evaluation function two times with the same</span>
-<a name="l00759"></a>00759 <span class="comment">       input can give two numbers which satisfy both equality (==) *and*</span>
-<a name="l00760"></a>00760 <span class="comment">       less than (<) (!) but not greater than (>). This causes the kth function</span>
-<a name="l00761"></a>00761 <span class="comment">       to loop infinitely.</span>
-<a name="l00762"></a>00762 <span class="comment"></span>
-<a name="l00763"></a>00763 <span class="comment">       Avoid that by handling explicitly this special case.</span>
-<a name="l00764"></a>00764 <span class="comment">    */</span>
-<a name="l00765"></a>00765 
-<a name="l00766"></a>00766     <span class="keywordflow">if</span> (e1 == e2) <span class="keywordflow">return</span> <span class="keyword">false</span>;
-<a name="l00767"></a>00767 
-<a name="l00768"></a>00768     <span class="comment">/*</span>
-<a name="l00769"></a>00769 <span class="comment">    double d1 = d->f(e1, d->aux_data);</span>
-<a name="l00770"></a>00770 <span class="comment">    fprintf(stderr, "%s got %f %g \n", __func__, d1, d1);</span>
-<a name="l00771"></a>00771 <span class="comment">    fprintf(stderr, "%.100f\n", d1);</span>
-<a name="l00772"></a>00772 <span class="comment"></span>
-<a name="l00773"></a>00773 <span class="comment">    double d2 = d->f(e2, d->aux_data);</span>
-<a name="l00774"></a>00774 <span class="comment">    fprintf(stderr, "%s %d %d %d\n", __func__, i1, i2, i3);</span>
-<a name="l00775"></a>00775 <span class="comment"></span>
-<a name="l00776"></a>00776 <span class="comment">    fprintf(stderr, "%s got %f %g %d  %d\n", __func__, d2, d2, d1 < d2, e1 == e2);</span>
-<a name="l00777"></a>00777 <span class="comment">    fprintf(stderr, "%.100f  %d %d  %d  %d %d\n", d2, </span>
-<a name="l00778"></a>00778 <span class="comment">            d1 < d2, d2 > d1, d1 == d2, d1 > d2, d2 < d1);</span>
-<a name="l00779"></a>00779 <span class="comment"></span>
-<a name="l00780"></a>00780 <span class="comment">    fprintf(stderr, "l1 = %ld\n", d1);</span>
-<a name="l00781"></a>00781 <span class="comment">    fprintf(stderr, "l2 = %ld\n", d2);</span>
-<a name="l00782"></a>00782 <span class="comment">    */</span>    
-<a name="l00783"></a>00783 
-<a name="l00784"></a>00784     <span class="keywordflow">return</span> (d->f(e1, d->aux_data) < d->f(e2, d->aux_data));
-<a name="l00785"></a>00785 }
-<a name="l00786"></a>00786 
-<a name="l00787"></a>00787 <span class="comment">/*</span>
-<a name="l00788"></a>00788 <span class="comment"> * @brief k'th element</span>
-<a name="l00789"></a>00789 <span class="comment"> * @param    l        list</span>
-<a name="l00790"></a>00790 <span class="comment"> * @param    k        counting from 1</span>
-<a name="l00791"></a>00791 <span class="comment"> * @param    eval     returns the value of an element</span>
-<a name="l00792"></a>00792 <span class="comment"> * @param    data     sent to eval</span>
-<a name="l00793"></a>00793 <span class="comment"> * @return   a k'th element according to the evaluation function</span>
-<a name="l00794"></a>00794 <span class="comment"> */</span>
-<a name="l00795"></a>00795 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00796"></a><a class="code" href="group__multiset.html#gf25d4a9d7f9563e177dcf3bc6a8a5c7e">00796</a> <a class="code" href="group__multiset.html#gf25d4a9d7f9563e177dcf3bc6a8a5c7e">list_kth_val_const</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k, list_func_eval eval, <span class="keywordtype">void</span> *data)
-<a name="l00797"></a>00797 {
-<a name="l00798"></a>00798     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00799"></a>00799     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( 1 <= k && k <= l->size );
-<a name="l00800"></a>00800     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( eval != NULL );
-<a name="l00801"></a>00801 
-<a name="l00802"></a>00802     <span class="keyword">struct </span>{
-<a name="l00803"></a>00803         list_func_eval f;
-<a name="l00804"></a>00804         <span class="keywordtype">void</span> *aux_data;
-<a name="l00805"></a>00805     } d;
-<a name="l00806"></a>00806     d.f = eval;
-<a name="l00807"></a>00807     d.aux_data = data;
-<a name="l00808"></a>00808     
-<a name="l00809"></a>00809     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#gbe07f00186264749cbecd016562119d1">list_kth_const</a>(l, k, <a class="code" href="group__multiset.html#g6d335487e4c513ed07ae0683e937670d">val_less_than</a>, &d);    
-<a name="l00810"></a>00810 }
-<a name="l00811"></a>00811 <span class="keywordtype">void</span> *
-<a name="l00812"></a><a class="code" href="group__multiset.html#g5eede66c73b61927347fb3c758896353">00812</a> <a class="code" href="group__multiset.html#g5eede66c73b61927347fb3c758896353">list_kth_val</a>(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k, list_func_eval eval, <span class="keywordtype">void</span> *data)
-<a name="l00813"></a>00813 {
-<a name="l00814"></a>00814     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *) <a class="code" href="group__multiset.html#gf25d4a9d7f9563e177dcf3bc6a8a5c7e">list_kth_val_const</a>(l, k, eval, data);
-<a name="l00815"></a>00815 }
-<a name="l00816"></a>00816 
-<a name="l00817"></a>00817 <span class="comment">/*</span>
-<a name="l00818"></a>00818 <span class="comment"> * @brief Compute median</span>
-<a name="l00819"></a>00819 <span class="comment"> * @param l          list</span>
-<a name="l00820"></a>00820 <span class="comment"> * @param eval       returns the value of an element</span>
-<a name="l00821"></a>00821 <span class="comment"> * @param data       additional data passed to eval</span>
-<a name="l00822"></a>00822 <span class="comment"> * @return median</span>
-<a name="l00823"></a>00823 <span class="comment"> *</span>
-<a name="l00824"></a>00824 <span class="comment"> * Time: Average O(n).</span>
-<a name="l00825"></a>00825 <span class="comment"> *</span>
-<a name="l00826"></a>00826 <span class="comment"> * For an even number of elements, the median is the</span>
-<a name="l00827"></a>00827 <span class="comment"> * average of the two central values.</span>
-<a name="l00828"></a>00828 <span class="comment"> */</span>
-<a name="l00829"></a>00829 <span class="keywordtype">double</span>
-<a name="l00830"></a><a class="code" href="group__multiset.html#g41f7807a7a5b85063ccd7f8b44a22503">00830</a> <a class="code" href="group__multiset.html#g41f7807a7a5b85063ccd7f8b44a22503">list_median</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data)
-<a name="l00831"></a>00831 {
-<a name="l00832"></a>00832     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00833"></a>00833     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( eval != NULL );
-<a name="l00834"></a>00834     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> > 0 );
-<a name="l00835"></a>00835 
-<a name="l00836"></a>00836     <span class="keyword">const</span> <span class="keywordtype">void</span> *median_element = <a class="code" href="group__multiset.html#gf25d4a9d7f9563e177dcf3bc6a8a5c7e">list_kth_val_const</a>(l, (l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>+1)/2, eval, data);
-<a name="l00837"></a>00837     
-<a name="l00838"></a>00838     <span class="keywordtype">double</span> median_val = eval(median_element, data);
-<a name="l00839"></a>00839 
-<a name="l00840"></a>00840     <span class="keywordflow">if</span> (<a class="code" href="group__multiset.html#g5287413c34475d2be585d0d499284ad0">list_size</a>(l) && 2 == 0)
-<a name="l00841"></a>00841         {
-<a name="l00842"></a>00842             <span class="keyword">const</span> <span class="keywordtype">void</span> *other_median_element = 
-<a name="l00843"></a>00843                 <a class="code" href="group__multiset.html#gf25d4a9d7f9563e177dcf3bc6a8a5c7e">list_kth_val_const</a>(l, (l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>+2)/2, eval, data);
-<a name="l00844"></a>00844             
-<a name="l00845"></a>00845             median_val = (median_val + eval(other_median_element, data) ) / 2.0;
-<a name="l00846"></a>00846         }
-<a name="l00847"></a>00847     
-<a name="l00848"></a>00848     <span class="keywordflow">return</span> median_val;
-<a name="l00849"></a>00849 }
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851 <span class="comment">/*</span>
-<a name="l00852"></a>00852 <span class="comment"> * @brief Compute mean</span>
-<a name="l00853"></a>00853 <span class="comment"> * @param l          list</span>
-<a name="l00854"></a>00854 <span class="comment"> * @param eval       returns the value of an element</span>
-<a name="l00855"></a>00855 <span class="comment"> * @param data       additional data passed to eval</span>
-<a name="l00856"></a>00856 <span class="comment"> * @return arithmetic average</span>
-<a name="l00857"></a>00857 <span class="comment"> *</span>
-<a name="l00858"></a>00858 <span class="comment"> * Time: O(n).</span>
-<a name="l00859"></a>00859 <span class="comment"> */</span>
-<a name="l00860"></a>00860 <span class="keywordtype">double</span>
-<a name="l00861"></a><a class="code" href="group__multiset.html#gae34efc79a1739b874206aa063c0d146">00861</a> <a class="code" href="group__multiset.html#gae34efc79a1739b874206aa063c0d146">list_mean</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data)
-<a name="l00862"></a>00862 {
-<a name="l00863"></a>00863     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00864"></a>00864     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( eval != NULL );
-<a name="l00865"></a>00865     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> > 0 );
-<a name="l00866"></a>00866     
-<a name="l00867"></a>00867     <span class="keywordtype">double</span> result = eval(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[0], data);
-<a name="l00868"></a>00868     <span class="keywordtype">int</span> i;
-<a name="l00869"></a>00869     
-<a name="l00870"></a>00870     <span class="keywordflow">for</span> (i = 1; i < l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>; i++) {
-<a name="l00871"></a>00871         result += eval(l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i], data);
-<a name="l00872"></a>00872     }
-<a name="l00873"></a>00873     
-<a name="l00874"></a>00874     result /= l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>;
-<a name="l00875"></a>00875 
-<a name="l00876"></a>00876     <span class="keywordflow">return</span> result;
-<a name="l00877"></a>00877 }
-<a name="l00878"></a>00878 
-<a name="l00879"></a>00879 <span class="comment">/*</span>
-<a name="l00880"></a>00880 <span class="comment"> * @brief Compute optimally weighted mean</span>
-<a name="l00881"></a>00881 <span class="comment"> * @param l          list with two or more elements</span>
-<a name="l00882"></a>00882 <span class="comment"> * @param eval       returns the value of an element</span>
-<a name="l00883"></a>00883 <span class="comment"> * @param data       additional data passed to eval</span>
-<a name="l00884"></a>00884 <span class="comment"> * @param eval_err   returns the error (1 sigma) of an element,</span>
-<a name="l00885"></a>00885 <span class="comment"> *                   must be positive</span>
-<a name="l00886"></a>00886 <span class="comment"> * @param data_err   additional data passed to eval_err</span>
-<a name="l00887"></a>00887 <span class="comment"> * @param err        (output) square root variance</span>
-<a name="l00888"></a>00888 <span class="comment"> * @param red_chisq  (output) reduced chi square, may be NULL</span>
-<a name="l00889"></a>00889 <span class="comment"> * @return optimal mean</span>
-<a name="l00890"></a>00890 <span class="comment"> *</span>
-<a name="l00891"></a>00891 <span class="comment"> *  average  =  [ sum  x_i / sigma_i^2 ] / [sum 1 / sigma_i^2]</span>
-<a name="l00892"></a>00892 <span class="comment"> *  variance =                         1 / [sum 1 / sigma_i^2]</span>
-<a name="l00893"></a>00893 <span class="comment"> *</span>
-<a name="l00894"></a>00894 <span class="comment"> *  chi^2/(n-1) = sum ((x_i - average) / sigma_i)^2  / (n-1)</span>
-<a name="l00895"></a>00895 <span class="comment"> *</span>
-<a name="l00896"></a>00896 <span class="comment"> * Time: O(n).</span>
-<a name="l00897"></a>00897 <span class="comment"> */</span>
-<a name="l00898"></a>00898 <span class="keywordtype">double</span>
-<a name="l00899"></a><a class="code" href="group__multiset.html#g064d7efd017b52f7a6301dfe305fb5b2">00899</a> <a class="code" href="group__multiset.html#g064d7efd017b52f7a6301dfe305fb5b2">list_mean_optimal</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, 
-<a name="l00900"></a>00900                   list_func_eval eval, <span class="keywordtype">void</span> *data_eval,
-<a name="l00901"></a>00901                   list_func_eval eval_err, <span class="keywordtype">void</span> *data_err,
-<a name="l00902"></a>00902                   <span class="keywordtype">double</span> *err,
-<a name="l00903"></a>00903                   <span class="keywordtype">double</span> *red_chisq)
-<a name="l00904"></a>00904 {
-<a name="l00905"></a>00905     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00906"></a>00906     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> >= 1 );
-<a name="l00907"></a>00907     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( red_chisq == NULL || l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> >= 2 );
-<a name="l00908"></a>00908     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( eval != NULL );
-<a name="l00909"></a>00909     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( eval_err != NULL );
-<a name="l00910"></a>00910     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( err != NULL );
-<a name="l00911"></a>00911 
-<a name="l00912"></a>00912     <span class="keywordtype">double</span> sum_weights = 0;
-<a name="l00913"></a>00913     <span class="keywordtype">double</span> opt_average = 0;
-<a name="l00914"></a>00914     <span class="keywordtype">int</span> i;
-<a name="l00915"></a>00915 
-<a name="l00916"></a>00916     <span class="keywordflow">for</span> (i = 0; i < l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>; i++) {
-<a name="l00917"></a>00917         <span class="keywordtype">void</span> *e = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i];
-<a name="l00918"></a>00918         <span class="keywordtype">double</span> sigma  = eval_err(e, data_err);
-<a name="l00919"></a>00919 
-<a name="l00920"></a>00920         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( sigma > 0 );
-<a name="l00921"></a>00921         
-<a name="l00922"></a>00922         <span class="keywordtype">double</span> weight = 1/(sigma*sigma);
-<a name="l00923"></a>00923         
-<a name="l00924"></a>00924         opt_average += eval(e, data_eval) * weight;
-<a name="l00925"></a>00925         sum_weights += weight;
-<a name="l00926"></a>00926     }
-<a name="l00927"></a>00927     opt_average /= sum_weights;
-<a name="l00928"></a>00928     *err = 1 / sqrt(sum_weights);
-<a name="l00929"></a>00929 
-<a name="l00930"></a>00930     <span class="keywordflow">if</span> (red_chisq != NULL) {
-<a name="l00931"></a>00931         *red_chisq = 0;
-<a name="l00932"></a>00932         <span class="keywordflow">for</span> (i = 0; i < l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>; i++) {
-<a name="l00933"></a>00933             <span class="keywordtype">void</span> *e = l-><a class="code" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a>[i];
-<a name="l00934"></a>00934             <span class="keywordtype">double</span> residual = ((eval(e, data_eval) - opt_average)) / eval_err(e, data_err);
-<a name="l00935"></a>00935             *red_chisq += residual * residual;
-<a name="l00936"></a>00936         }
-<a name="l00937"></a>00937         *red_chisq /= (l-><a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a> - 1);
-<a name="l00938"></a>00938     }
-<a name="l00939"></a>00939 
-<a name="l00940"></a>00940     <span class="keywordflow">return</span> opt_average;
-<a name="l00941"></a>00941 }
-<a name="l00942"></a>00942 
-<a name="l00943"></a>00943 
-<a name="l00944"></a>00944 
-<a name="l00945"></a>00945 <span class="comment">/*</span>
-<a name="l00946"></a>00946 <span class="comment"> * @brief Compute absolute deviation</span>
-<a name="l00947"></a>00947 <span class="comment"> * @param e1        element</span>
-<a name="l00948"></a>00948 <span class="comment"> * @param data      reference value, and evaluation function</span>
-<a name="l00949"></a>00949 <span class="comment"> *                  and additional data passed to the evaluation function</span>
-<a name="l00950"></a>00950 <span class="comment"> * @return absolute difference between e1 and reference point</span>
-<a name="l00951"></a>00951 <span class="comment"> */</span>
-<a name="l00952"></a>00952 <span class="keyword">static</span> <span class="keywordtype">double</span>
-<a name="l00953"></a><a class="code" href="group__multiset.html#g5eb7be510583960ae3d42c84683dbb34">00953</a> <a class="code" href="group__multiset.html#g5eb7be510583960ae3d42c84683dbb34">abs_dev</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *e1, <span class="keywordtype">void</span> *data)
-<a name="l00954"></a>00954 {
-<a name="l00955"></a>00955     <span class="keyword">struct </span>{
-<a name="l00956"></a>00956         <span class="keywordtype">double</span> ref;
-<a name="l00957"></a>00957         list_func_eval f;
-<a name="l00958"></a>00958         <span class="keywordtype">void</span> *aux_data;
-<a name="l00959"></a>00959     } *d = data;
-<a name="l00960"></a>00960     <span class="comment">/* Cast is safe, see caller */</span>
-<a name="l00961"></a>00961 
-<a name="l00962"></a>00962     <span class="keywordflow">return</span> fabs(d->f(e1, d->aux_data) - d->ref);
-<a name="l00963"></a>00963 }
-<a name="l00964"></a>00964 
-<a name="l00965"></a>00965 <span class="comment">/*</span>
-<a name="l00966"></a>00966 <span class="comment"> * @brief Compute median absolute deviation wrt median</span>
-<a name="l00967"></a>00967 <span class="comment"> * @param l          list</span>
-<a name="l00968"></a>00968 <span class="comment"> * @param eval       returns the value of an element</span>
-<a name="l00969"></a>00969 <span class="comment"> * @param data       additional data passed to eval</span>
-<a name="l00970"></a>00970 <span class="comment"> * @return mad</span>
-<a name="l00971"></a>00971 <span class="comment"> *</span>
-<a name="l00972"></a>00972 <span class="comment"> * Time: Average O(n).</span>
-<a name="l00973"></a>00973 <span class="comment"> */</span>
-<a name="l00974"></a>00974 <span class="keywordtype">double</span>
-<a name="l00975"></a><a class="code" href="group__multiset.html#g2a273e58ffe66d39796a4c2c795256c6">00975</a> <a class="code" href="group__multiset.html#g2a273e58ffe66d39796a4c2c795256c6">list_mad</a>(<a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data)
-<a name="l00976"></a>00976 {
-<a name="l00977"></a>00977     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( l != NULL );
-<a name="l00978"></a>00978     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( eval != NULL );
-<a name="l00979"></a>00979 
-<a name="l00980"></a>00980     <span class="keywordtype">double</span> median = <a class="code" href="group__multiset.html#g41f7807a7a5b85063ccd7f8b44a22503">list_median</a>(l, eval, data);
-<a name="l00981"></a>00981 
-<a name="l00982"></a>00982     <span class="keyword">struct </span>{
-<a name="l00983"></a>00983         <span class="keywordtype">double</span> ref;
-<a name="l00984"></a>00984         list_func_eval f;
-<a name="l00985"></a>00985         <span class="keywordtype">void</span> *aux_data;
-<a name="l00986"></a>00986     } d;
-<a name="l00987"></a>00987 
-<a name="l00988"></a>00988     d.ref = median;
-<a name="l00989"></a>00989     d.f = eval;
-<a name="l00990"></a>00990     d.aux_data = data;
-<a name="l00991"></a>00991 
-<a name="l00992"></a>00992     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g41f7807a7a5b85063ccd7f8b44a22503">list_median</a>(l, <a class="code" href="group__multiset.html#g5eb7be510583960ae3d42c84683dbb34">abs_dev</a>, &d);
-<a name="l00993"></a>00993 }
-<a name="l00994"></a>00994 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/list_8c_source.html b/html/list_8c_source.html
new file mode 100644
index 0000000..beb901a
--- /dev/null
+++ b/html/list_8c_source.html
@@ -0,0 +1,991 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: list.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">list.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: list.c,v 1.19 2013-05-16 08:40:07 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> </div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> <span class="comment"> * $Date: 2013-05-16 08:40:07 $</span></div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment"> * $Revision: 1.19 $</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> </div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor">#include <list_void.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> </div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="comment">/* Same data structure as C++ STL's vector */</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno"><a class="code" href="structlist.html">   74</a></span> <span class="keyword">struct </span><a class="code" href="structlist.html">list</a></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> {</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     <span class="keywordtype">void</span> **elements;</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>     <span class="keywordtype">int</span> size;</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>     <span class="keywordtype">int</span> back;    <span class="comment">/* Extra allocated space */</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>     <span class="keywordtype">int</span> current; <span class="comment">/* 1 element iteration */</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>     <span class="keywordtype">int</span> current_p1, current_p2; <span class="comment">/* pair iteration */</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> };</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="comment">//static void *(*const list_malloc)(size_t) = malloc;</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="comment">//static void *(*const list_calloc)(size_t, size_t) = calloc;</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="comment">//static void *(*const list_realloc)(void *, size_t) = realloc;</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="comment">//static void  (*const list_free)(const void *) = (void (*)(const void *))free;</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="group__multiset.html#ga4d27e95761e1b21498ad7653acc80d35">   92</a></span> <span class="keyword">static</span> <span class="keywordtype">void</span> *(*list_malloc)(size_t) = malloc;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="keyword">static</span> <span class="keywordtype">void</span> *(*list_calloc)(size_t, size_t) = calloc;</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="keyword">static</span> <span class="keywordtype">void</span> *(*list_realloc)(<span class="keywordtype">void</span> *, size_t) = realloc;</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keyword">static</span> void  (*list_free)(<span class="keyword">const</span> <span class="keywordtype">void</span> *) = (<span class="keywordtype">void</span> (*)(<span class="keyword">const</span> <span class="keywordtype">void</span> *))free;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">#include <assert.h></span></div>
+<div class="line"><a name="l00101"></a><span class="lineno"><a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">  101</a></span> <span class="preprocessor">#define assure(EXPR) assert(EXPR)</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <a class="code" href="structlist.html">list</a> *</div>
+<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="group__multiset.html#ga9b9a23d98f58af888b2d2d3072f8b999">  108</a></span> <a class="code" href="group__multiset.html#ga9b9a23d98f58af888b2d2d3072f8b999" title="Constructor.">list_new</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> {</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     <a class="code" href="structlist.html">list</a> *l = <a class="code" href="group__multiset.html#ga4d27e95761e1b21498ad7653acc80d35">list_malloc</a>(<span class="keyword">sizeof</span>(*l));</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     l->elements = NULL;</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     l->size = 0;</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     l->back = 0;</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> </div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     <span class="keywordflow">return</span> l;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> }</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <a class="code" href="structlist.html">list</a> *</div>
+<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="group__multiset.html#gac2d7ea2bf8ee3637bc9167916e637f30">  126</a></span> <a class="code" href="group__multiset.html#gac2d7ea2bf8ee3637bc9167916e637f30" title="Copy constructor.">list_duplicate</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">void</span> * (*duplicate)(<span class="keyword">const</span> <span class="keywordtype">void</ [...]
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> {</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     {</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>         <a class="code" href="structlist.html">list</a> *dupl = <a class="code" href="group__multiset.html#ga4d27e95761e1b21498ad7653acc80d35">list_malloc</a>(<span class="keyword">sizeof</span>(*dupl));</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>         </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>         dupl->elements = <a class="code" href="group__multiset.html#ga4d27e95761e1b21498ad7653acc80d35">list_malloc</a>((l->size+l->back) * <span class="keyword">sizeof</span>(*dupl->elements));</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>         dupl->size = l->size;</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>         dupl->back = l->back;</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>         dupl->current = l->current;</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>         dupl->current_p1 = l->current_p1;</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>         dupl->current_p2 = l->current_p2;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>         </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>         {</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>             <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>             <span class="keywordflow">for</span> (i = 0; i < l->size; i++) {</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                 <span class="keywordflow">if</span> (duplicate != NULL) {</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>                     dupl->elements[i] = duplicate(l->elements[i]);</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                 }</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>                     dupl->elements[i] = l->elements[i];</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                 }</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>             }</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>         }</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>         </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>         <span class="keywordflow">return</span> dupl;</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     }</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> }</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="comment"> * @brief Destructor</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="comment"> * @param l         list to delete</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="comment"> * @param delete    element copy constructor. If NULL,</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="comment"> *                  elements are not deleted.</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> list_delete_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> **l, <span class="keywordtype">void</span> (*ldelete)(<span class="keywordtype">void</span> **))</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> {</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <span class="keywordflow">if</span> (l != NULL && *l != NULL) {</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>         <span class="keywordflow">if</span> (ldelete != NULL) {</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>             </div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>             <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>             <span class="keywordflow">for</span> (i = 0; i < (*l)->size; i++) {</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                 ldelete(&((*l)->elements[i]));</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>             }</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>         }</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>         list_free((*l)->elements);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>         list_free((*l)); *l = NULL;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     }</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> }</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> list_delete(<a class="code" href="structlist.html">list</a> **l, <span class="keywordtype">void</span> (*ldelete)(<span class="keywordtype">void</span> **))</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> {</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     list_delete_const((<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> **)l, ldelete);</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> }</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="comment"> * @brief Get list size</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="comment"> * @param l         list</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="comment"> * @return  number of elements in list </span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="comment"> * Time: O(1)</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> list_size(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l)</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> {</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <span class="keywordflow">return</span> l->size;</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> }</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> </div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="comment"> * @brief Insert element</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="comment"> * @param l         list </span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment"> * @param e         element to insert. Must be non-NULL</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="comment"> * @return  number of elements in list </span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="comment"> * Time: Amortized O(1)</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> list_insert(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">void</span> *e)</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> {</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( e != NULL );</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     <span class="keywordflow">if</span> (l->back == 0) {</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>         l->back = l->size + 1;</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>         l->elements = list_realloc(l->elements, (l->size + l->back) * <span class="keyword">sizeof</span>(*l->elements));</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     }</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     l->size++;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     l->back--;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     l->elements[l->size - 1] = e;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> }</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="comment"> * @brief Remove element</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> <span class="comment"> * @param l         list</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="comment"> * @param e         element to remove. Note: pointer comparison</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="comment"> * @return e</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <span class="comment"> * The provided element must exist in the list.</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> <span class="comment"> * Only one occurrence of e is removed.</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> <span class="comment"> * The element is removed from the list, but not deallocated.</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="comment"> * For convenience, the function returns the provided element pointer.</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="comment"> * This is to allow code like</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> <span class="comment"> * @code</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="comment"> *     element *e = element_list_remove(l, element_list_first(l));</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="comment"> * @endcode</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="comment"> * Time: Worst case O(n), O(1) for removing the element returned by list_first()</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> list_remove_const(<a class="code" href="structlist.html">list</a> *l, <span class="keyword">const</span> <span class="keywordtype">void</span> *e)</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> {</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( e != NULL );</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     {</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>         <span class="keywordtype">int</span> indx = -1;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>         <span class="keywordflow">for</span> (i = l->size - 1; i >= 0 && indx < 0; i--) {</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>             <span class="keywordflow">if</span> (l->elements[i] == e) {</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>                 indx = i;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>             }</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>         }</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>         </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( indx >= 0 );</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>         <span class="keywordflow">for</span> (i = indx; i < l->size-1; i++) {</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>             l->elements[i] = l->elements[i+1];</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>         }</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     }        </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     l->size--;</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     l->back++;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="keywordflow">if</span> (l->back > 4 * l->size) {</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>         <span class="comment">/* Note: amortized constant time */</span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>         l->back = l->size;</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>         l->elements = list_realloc(l->elements, </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>                                    (l->size + l->back) * <span class="keyword">sizeof</span>(*l->elements));</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     }        </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordflow">return</span> e;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> }</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> list_remove(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">void</span> *e)</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> {</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *)list_remove_const(l, e);    </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> }</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> <span class="comment"> * @brief Reverse the order of list elements</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> <span class="comment"> * @param l         list</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> <span class="comment"> * @return  Nothing </span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> <span class="comment"> * Time: O(N)</span></div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> list_reverse(<a class="code" href="structlist.html">list</a> *l)</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> {</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="keywordtype">int</span> i, k;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <span class="keywordflow">for</span> (i = 0, k = l->size-1; i < k; i++, k--)</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     {</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>         <span class="keywordtype">void</span>    *tmp;</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>         tmp = l->elements[i];</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>         l->elements[i] = l->elements[k];</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>         l->elements[k] = tmp;</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     }</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> }</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> <span class="comment"> * @brief Iterate</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> <span class="comment"> * @param l         list</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> <span class="comment"> * @return first element, or NULL if list empty</span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="comment"> * @code</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="comment"> *     for(element *e = list_first(l);</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="comment"> *         e != NULL; </span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> <span class="comment"> *         e = list_next(l)) {...}</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> <span class="comment"> * @endcode</span></div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span> <span class="comment"> * The list must not be modified between calls to list_first() or list_next()</span></div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> <span class="comment"> * Note: It is not possible to have more simultaneous iterations over the same</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> <span class="comment"> * list. This functionality can be achived by duplicating the list.</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> <span class="comment"> * Time: O(1)</span></div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> list_first_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l)</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> {</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordflow">if</span> (l->size == 0) <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> </div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="comment">/* Loop backwards, faster if user</span></div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> <span class="comment">       erases the first element */</span></div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span> </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     ((<a class="code" href="structlist.html">list</a> *)l)->current = l->size - 1;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordflow">return</span> l->elements[l->current];</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> }</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> list_first(<a class="code" href="structlist.html">list</a> *l)</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> {</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *)list_first_const(l);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> }</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> <span class="comment"> * @brief Iterate</span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> <span class="comment"> * @param l         list</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="comment"> * @return next element, or NULL if no more elements</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> <span class="comment"> * See list_first().</span></div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> <span class="comment"> * Time: O(1)</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> list_next_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l)</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> {</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>   </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keywordflow">if</span> (l->size == 0) <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> </div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>     ((<a class="code" href="structlist.html">list</a> *)l)->current -= 1;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="keywordflow">if</span> (l->current < 0) <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     <span class="keywordflow">else</span> <span class="keywordflow">return</span> l->elements[l->current];</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> }</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> list_next(<a class="code" href="structlist.html">list</a> *l)</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> {</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *)list_next_const(l);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> }</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> </div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> <span class="comment"> * @brief Iterate through pairs</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> <span class="comment"> * @param l         list</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> <span class="comment"> * @param e1        (output) first pair 1st element, or NULL if list</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> <span class="comment">                    has less than two elements</span></div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> <span class="comment"> * @param e2        (output) first pair 2nd element</span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> <span class="comment"> * The iteration is through the K(n,2) different pairs, i.e. the</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> <span class="comment"> * pair (e1,e2) is considered equal to the pair (e2,e1) and only</span></div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> <span class="comment"> * visited once.</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="comment"> * @code</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="comment"> *     for(list_first_pair(l, &e1, &e2);</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="comment"> *         e1 != NULL; </span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="comment"> *         list_next_pair(l, &e1, &e2))</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="comment"> * @endcode</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> <span class="comment"> * The list must not be modified between calls to</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment"> * list_first_pair() or list_next_pair()</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> <span class="comment"> * The current position is cached in the list object. Therefore simultaneous</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> <span class="comment"> * pair iterations over the same list is not allowed.</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="comment"> * However, iterating pairs simultaneously with a 1 element iteration (using</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="comment"> * list_first() and list_next()) is allowed.</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> <span class="comment"> * Time: O(1)</span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> list_first_pair_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l,</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>                       <span class="keyword">const</span> <span class="keywordtype">void</span> **e1,</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                       <span class="keyword">const</span> <span class="keywordtype">void</span> **e2)</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> {</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( e1 != NULL );</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( e2 != NULL );</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     </div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     <span class="keywordflow">if</span> (l->size <= 1) {</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>         *e1 = NULL;</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         *e2 = NULL;</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>     }</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     ((<a class="code" href="structlist.html">list</a> *)l)->current_p1 = l->size - 1;</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     ((<a class="code" href="structlist.html">list</a> *)l)->current_p2 = l->size - 2;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>     *e1 = l->elements[l->current_p1];</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     *e2 = l->elements[l->current_p2];</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     </div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> }</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> </div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> list_first_pair(<a class="code" href="structlist.html">list</a> *l,</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>                 <span class="keywordtype">void</span> **e1,</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>                 <span class="keywordtype">void</span> **e2)</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> {</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     list_first_pair_const(l, </div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                           (<span class="keyword">const</span> <span class="keywordtype">void</span> **)e1, </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                           (<span class="keyword">const</span> <span class="keywordtype">void</span> **)e2);</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span> </div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> }</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> <span class="comment"> * @brief Iterate through pairs</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> <span class="comment"> * @param l         list</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="comment"> * @param e1        (output) next pair 1st element, or NULL if no more pairs</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> <span class="comment"> * @param e2        (output) next pair 2nd element, or NULL if no more pairs</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> <span class="comment"> * See list_first_pair().</span></div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> <span class="comment"> * Time: O(1)</span></div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> list_next_pair_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l,</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>                      <span class="keyword">const</span> <span class="keywordtype">void</span> **e1,</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>                      <span class="keyword">const</span> <span class="keywordtype">void</span> **e2)</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> {</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( e1 != NULL );</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( e2 != NULL );</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>   </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     <span class="keywordflow">if</span> (l->size <= 1) {</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>         *e1 = NULL;</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>         *e2 = NULL;</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     }</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     </div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>     ((<a class="code" href="structlist.html">list</a> *)l)->current_p2 -= 1;</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> </div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     <span class="keywordflow">if</span> (l->current_p2 < 0) {</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         ((<a class="code" href="structlist.html">list</a> *)l)->current_p1 -= 1;</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         ((<a class="code" href="structlist.html">list</a> *)l)->current_p2 = l->current_p1 - 1;</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         <span class="keywordflow">if</span> (l->current_p2 < 0) {</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>             *e1 = NULL;</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>             *e2 = NULL;</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>             <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>         }</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         *e1 = l->elements[l->current_p1];</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         *e2 = l->elements[l->current_p2];</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     }</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     </div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     *e2 = l->elements[l->current_p2];</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> }</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> </div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> list_next_pair(<a class="code" href="structlist.html">list</a> *l,</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                <span class="keywordtype">void</span> **e1,</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>                <span class="keywordtype">void</span> **e2)</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> {</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     list_next_pair_const(l, (<span class="keyword">const</span> <span class="keywordtype">void</span> **)e1, (<span class="keyword">const</span> <span class="keywordtype">void</span> **)e2);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> }</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> </div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> <a class="code" href="structlist.html">list</a> *</div>
+<div class="line"><a name="l00507"></a><span class="lineno"><a class="code" href="group__multiset.html#gaf355fe5f4ce5910b419c80ae14bf5199">  507</a></span> <a class="code" href="group__multiset.html#gaf355fe5f4ce5910b419c80ae14bf5199" title="Extract elements.">list_extract</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l,</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>              <span class="keywordtype">void</span> *(*duplicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *),</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>              <span class="keywordtype">bool</span> (*predicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *),</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>              <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> {</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( duplicate != NULL);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( predicate != NULL);</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     {</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>         <a class="code" href="structlist.html">list</a> *ex = <a class="code" href="group__multiset.html#ga9b9a23d98f58af888b2d2d3072f8b999" title="Constructor.">list_new</a>();</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span> </div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>         <span class="keywordflow">for</span> (i = 0; i < l->size; i++) {</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>             <span class="keywordflow">if</span> (predicate(l->elements[i], data)) {</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>                 list_insert(ex, duplicate(l->elements[i]));</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>             }</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>         }</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>         <span class="keywordflow">return</span> ex;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     }</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span> }</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> </div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> <span class="comment"> * @brief Find minimum element</span></div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span> <span class="comment"> * @param l          non-empty list</span></div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> <span class="comment"> * @param less_than  comparison function which must return true, iff</span></div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> <span class="comment"> *                   its first argument is considered less than the second argument.</span></div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> <span class="comment"> *                   The 3rd argument is auxillary data used for the comparison.</span></div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> <span class="comment"> *                   The provided function should be a strict ordering (i.e. behave</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> <span class="comment"> *                   like <)</span></div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> <span class="comment"> * @param data       Auxillary data sent to the comparison function. May be NULL.</span></div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span> <span class="comment"> * @return minimum element</span></div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> <span class="comment"> * Time: O(n)</span></div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span> list_min(<a class="code" href="structlist.html">list</a> *l, list_func_lt less_than, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span> {</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( less_than != NULL);</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( list_size(l) > 0);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span> </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     {</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         <span class="keywordtype">int</span> minindex = 0;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>         <span class="keywordflow">for</span> (i = 1; i < l->size; i++) {</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>             <span class="keywordflow">if</span> (less_than(l->elements[i], l->elements[minindex], data))</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>                 minindex = i;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>         }</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>         </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>         <span class="keywordflow">return</span> l->elements[minindex];</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     }</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> }</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> </div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> <span class="comment"> * @brief Find minimum element</span></div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span> <span class="comment"> * @param l          non-empty list</span></div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span> <span class="comment"> * @param eval       evaluation function</span></div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span> <span class="comment"> * @param data       Auxillary data sent to the evaluation function. May be NULL.</span></div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span> <span class="comment"> * @return minimum (as defined by the evaluation function) element</span></div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span> <span class="comment"> * Time: O(n)</span></div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> list_min_val(<a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span> {</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( eval != NULL);</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( list_size(l) > 0);</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>     </div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     {</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         <span class="keywordtype">int</span> minindex = 0;</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>         <span class="keywordtype">double</span> minval = eval(l->elements[0], data);</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> </div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>         <span class="keywordflow">for</span> (i = 1; i < l->size; i++) {</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>             <span class="keywordtype">double</span> val = eval(l->elements[i], data);</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>             <span class="keywordflow">if</span> (val < minval) {</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>                 minval = val;</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>                 minindex = i;</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>             }</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>         }</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>         </div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>         <span class="keywordflow">return</span> l->elements[minindex];</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     }</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span> }</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> </div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span> <span class="comment"> * @brief Find maximum element</span></div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span> <span class="comment"> * @param l          non-empty list</span></div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span> <span class="comment"> * @param eval       evaluation function</span></div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> <span class="comment"> * @param data       Auxillary data sent to the evaluation function. May be NULL.</span></div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span> <span class="comment"> * @return maximum (as defined by the evaluation function) element</span></div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span> <span class="comment"> * Time: O(n)</span></div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> list_max_val(<a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> {</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( eval != NULL);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( list_size(l) > 0);</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     </div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     {</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>         <span class="keywordtype">int</span> maxindex = 0;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>         <span class="keywordtype">double</span> maxval = eval(l->elements[0], data);</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         </div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         <span class="keywordflow">for</span> (i = 1; i < l->size; i++) {</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>             <span class="keywordtype">double</span> val = eval(l->elements[i], data);</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>             <span class="keywordflow">if</span> (val > maxval) {</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>                 maxval = val;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>                 maxindex = i;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>             }</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>         }</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         </div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>         <span class="keywordflow">return</span> l->elements[maxindex];</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     }</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span> }</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span> </div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span> <span class="comment"> * @brief Find maximum element</span></div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> <span class="comment"> * @param l          see list_min()</span></div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span> <span class="comment"> * @param less_than  see list_min()</span></div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> <span class="comment"> * @param data       see list_min()</span></div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span> <span class="comment"> * @return maximum element</span></div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> <span class="comment"> * Time: O(n)</span></div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> list_max_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, list_func_lt less_than, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> {</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( less_than != NULL);</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( list_size(l) > 0);</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     </div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     {</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>         <span class="keywordtype">int</span> maxindex = 0;</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>         <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>         <span class="keywordflow">for</span> (i = 1; i < l->size; i++) {</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>             <span class="keywordflow">if</span> (!less_than(l->elements[i], l->elements[maxindex], data))</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>                 maxindex = i;</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>         }</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>         </div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>         <span class="keywordflow">return</span> l->elements[maxindex];</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     }</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span> }</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span> </div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span> list_max(<a class="code" href="structlist.html">list</a> *l, list_func_lt less_than, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span> {</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *)list_max_const(l, less_than, data);</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span> }</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span> </div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span> </div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> <span class="comment"> * @brief Find k'th element</span></div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span> <span class="comment"> * @param l          non-empty list</span></div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span> <span class="comment"> * @param k          between 1 and list size, inclusive.</span></div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> <span class="comment"> * @param n          list size</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span> <span class="comment"> * @param less_than  see list_min()</span></div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span> <span class="comment"> * @param data       see list_min()</span></div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> <span class="comment"> * @return k'th element</span></div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span> <span class="comment"> * Be careful to provide an irreflexive comparison function (i.e.</span></div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span> <span class="comment"> * x < x must always be false), or this function may not return.</span></div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span> <span class="comment"> * Time: Worst case O(n*n). Average over all input: O(n)</span></div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span> kth(<span class="keyword">const</span> <span class="keywordtype">void</span> *a[], <span class="keywordtype">int</span> k, <span class="keywordtype">int</span> n, list_func_lt less_than, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span> {</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     <span class="keywordtype">int</span> i, j, lo, hi;</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>     </div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     k -= 1;</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> </div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     lo = 0;</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     hi = n - 1;</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     <span class="keywordflow">while</span> (lo < hi) {</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>         <span class="keyword">const</span> <span class="keywordtype">void</span> *pivot = a[k];<span class="comment">//fixme select randomly, swap with a[k]</span></div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>         i = lo;</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>         j = hi;</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>         <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>             <span class="keywordflow">while</span> (less_than(a[i], pivot, data)) i++;</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>             <span class="keywordflow">while</span> (less_than(pivot, a[j], data)) {</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>                 j--;</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>             }</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>             <span class="keywordflow">if</span> (i <= j) {</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>                 <span class="keyword">const</span> <span class="keywordtype">void</span> *tmp = a[i];</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>                 a[i] = a[j];</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>                 a[j] = tmp;</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>                 i++; j--;</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>             }</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>         } <span class="keywordflow">while</span> (i <= j);</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>         <span class="keywordflow">if</span> (j < k) lo = i;</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>         <span class="keywordflow">if</span> (k < i) hi = j;</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     }</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     <span class="keywordflow">return</span> a[k];</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> }</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> </div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span> list_kth_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k,</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>                list_func_lt less_than, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> {</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>     <span class="keywordtype">void</span>    *kp;</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     <span class="keywordtype">void</span>    **elemcpy;</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     <span class="keywordtype">int</span>     len;</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     </div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( 1 <= k && k <= l->size );</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     </div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     <span class="comment">/* the function kth() scrambles the elements, so copy them */</span></div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     len = l->size * <span class="keyword">sizeof</span>(*l->elements);</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>     elemcpy = <a class="code" href="group__multiset.html#ga4d27e95761e1b21498ad7653acc80d35">list_malloc</a>(len);</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     memcpy(elemcpy, l->elements, len);</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>     </div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     kp = (<span class="keywordtype">void</span>*)kth((<span class="keyword">const</span> <span class="keywordtype">void</span> **)elemcpy, k, l->size, less_than, data);</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     </div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     list_free(elemcpy);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     </div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     <span class="keywordflow">return</span> kp;</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span> }</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span> </div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> list_kth(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k,</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>          list_func_lt less_than,</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>          <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> {</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *)list_kth_const(l, k, less_than, data);</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> }</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span> </div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span> <span class="comment"> * @brief Determine order of elements given an evaluation function</span></div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span> <span class="comment"> * @param e1         first element</span></div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span> <span class="comment"> * @param e2         second element</span></div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span> <span class="comment"> * @param data       containing the evaluation function, and</span></div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> <span class="comment"> *                   additional data which is passed to the evaluation function</span></div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span> <span class="comment"> * @return true iff e1 evaluates to a number less than e2</span></div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> <span class="keyword">static</span></div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span> <span class="keywordtype">bool</span> val_less_than(<span class="keyword">const</span> <span class="keywordtype">void</span> *e1, <span class="keyword">const</span> <span class="keywordtype">void</span> *e2, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span> {</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>         list_func_eval f;</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>         <span class="keywordtype">void</span> *aux_data;</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     } *d = data;</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     <span class="comment">/* Cast is safe, see caller of this function */</span></div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span> </div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     </div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     <span class="comment">/* Unfortunately, as the following commented code demonstrated,</span></div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span> <span class="comment">       with GCC-4.2.0 calling the evaluation function two times with the same</span></div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span> <span class="comment">       input can give two numbers which satisfy both equality (==) *and*</span></div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span> <span class="comment">       less than (<) (!) but not greater than (>). This causes the kth function</span></div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span> <span class="comment">       to loop infinitely.</span></div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span> <span class="comment"></span></div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> <span class="comment">       Avoid that by handling explicitly this special case.</span></div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span> </div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>     <span class="keywordflow">if</span> (e1 == e2) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span> </div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span> <span class="comment">    double d1 = d->f(e1, d->aux_data);</span></div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span> <span class="comment">    fprintf(stderr, "%s got %f %g \n", __func__, d1, d1);</span></div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span> <span class="comment">    fprintf(stderr, "%.100f\n", d1);</span></div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span> <span class="comment"></span></div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span> <span class="comment">    double d2 = d->f(e2, d->aux_data);</span></div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> <span class="comment">    fprintf(stderr, "%s %d %d %d\n", __func__, i1, i2, i3);</span></div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span> <span class="comment"></span></div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span> <span class="comment">    fprintf(stderr, "%s got %f %g %d  %d\n", __func__, d2, d2, d1 < d2, e1 == e2);</span></div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> <span class="comment">    fprintf(stderr, "%.100f  %d %d  %d  %d %d\n", d2, </span></div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span> <span class="comment">            d1 < d2, d2 > d1, d1 == d2, d1 > d2, d2 < d1);</span></div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span> <span class="comment"></span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> <span class="comment">    fprintf(stderr, "l1 = %ld\n", d1);</span></div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> <span class="comment">    fprintf(stderr, "l2 = %ld\n", d2);</span></div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> <span class="comment">    */</span>    </div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span> </div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     <span class="keywordflow">return</span> (d->f(e1, d->aux_data) < d->f(e2, d->aux_data));</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span> }</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> </div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span> <span class="comment"> * @brief k'th element</span></div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> <span class="comment"> * @param    l        list</span></div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span> <span class="comment"> * @param    k        counting from 1</span></div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span> <span class="comment"> * @param    eval     returns the value of an element</span></div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> <span class="comment"> * @param    data     sent to eval</span></div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span> <span class="comment"> * @return   a k'th element according to the evaluation function</span></div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span> list_kth_val_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k, list_func_eval eval, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span> {</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( 1 <= k && k <= l->size );</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( eval != NULL );</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> </div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>         list_func_eval f;</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>         <span class="keywordtype">void</span> *aux_data;</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     } d;</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     d.f = eval;</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>     d.aux_data = data;</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     </div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     <span class="keywordflow">return</span> list_kth_const(l, k, val_less_than, &d);    </div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span> }</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span> list_kth_val(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k, list_func_eval eval, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span> {</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     <span class="keywordflow">return</span> (<span class="keywordtype">void</span> *) list_kth_val_const(l, k, eval, data);</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span> }</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span> </div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span> <span class="comment"> * @brief Compute median</span></div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span> <span class="comment"> * @param l          list</span></div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span> <span class="comment"> * @param eval       returns the value of an element</span></div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span> <span class="comment"> * @param data       additional data passed to eval</span></div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span> <span class="comment"> * @return median</span></div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span> <span class="comment"> * Time: Average O(n).</span></div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span> <span class="comment"> * For an even number of elements, the median is the</span></div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span> <span class="comment"> * average of the two central values.</span></div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span> list_median(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span> {</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( eval != NULL );</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l->size > 0 );</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span> </div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>     <span class="keyword">const</span> <span class="keywordtype">void</span> *median_element = list_kth_val_const(l, (l->size+1)/2, eval, data);</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>     </div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>     <span class="keywordtype">double</span> median_val = eval(median_element, data);</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span> </div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     <span class="keywordflow">if</span> (list_size(l) && 2 == 0)</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>         {</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>             <span class="keyword">const</span> <span class="keywordtype">void</span> *other_median_element = </div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>                 list_kth_val_const(l, (l->size+2)/2, eval, data);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>             </div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>             median_val = (median_val + eval(other_median_element, data) ) / 2.0;</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>         }</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>     </div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>     <span class="keywordflow">return</span> median_val;</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span> }</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> </div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span> <span class="comment"> * @brief Compute mean</span></div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span> <span class="comment"> * @param l          list</span></div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span> <span class="comment"> * @param eval       returns the value of an element</span></div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span> <span class="comment"> * @param data       additional data passed to eval</span></div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span> <span class="comment"> * @return arithmetic average</span></div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span> <span class="comment"> * Time: O(n).</span></div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span> list_mean(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span> {</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( eval != NULL );</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l->size > 0 );</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>     </div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>     <span class="keywordtype">double</span> result = eval(l->elements[0], data);</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>     </div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>     <span class="keywordflow">for</span> (i = 1; i < l->size; i++) {</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>         result += eval(l->elements[i], data);</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>     }</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>     </div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>     result /= l->size;</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span> </div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>     <span class="keywordflow">return</span> result;</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span> }</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span> </div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span> <span class="comment"> * @brief Compute optimally weighted mean</span></div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span> <span class="comment"> * @param l          list with two or more elements</span></div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span> <span class="comment"> * @param eval       returns the value of an element</span></div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span> <span class="comment"> * @param data       additional data passed to eval</span></div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span> <span class="comment"> * @param eval_err   returns the error (1 sigma) of an element,</span></div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span> <span class="comment"> *                   must be positive</span></div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span> <span class="comment"> * @param data_err   additional data passed to eval_err</span></div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span> <span class="comment"> * @param err        (output) square root variance</span></div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span> <span class="comment"> * @param red_chisq  (output) reduced chi square, may be NULL</span></div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span> <span class="comment"> * @return optimal mean</span></div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span> <span class="comment"> *  average  =  [ sum  x_i / sigma_i^2 ] / [sum 1 / sigma_i^2]</span></div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span> <span class="comment"> *  variance =                         1 / [sum 1 / sigma_i^2]</span></div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span> <span class="comment"> *  chi^2/(n-1) = sum ((x_i - average) / sigma_i)^2  / (n-1)</span></div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span> <span class="comment"> * Time: O(n).</span></div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span> list_mean_optimal(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, </div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>                   list_func_eval eval, <span class="keywordtype">void</span> *data_eval,</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>                   list_func_eval eval_err, <span class="keywordtype">void</span> *data_err,</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>                   <span class="keywordtype">double</span> *err,</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>                   <span class="keywordtype">double</span> *red_chisq)</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span> {</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l->size >= 1 );</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( red_chisq == NULL || l->size >= 2 );</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( eval != NULL );</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( eval_err != NULL );</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( err != NULL );</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span> </div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>     <span class="keywordtype">double</span> sum_weights = 0;</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>     <span class="keywordtype">double</span> opt_average = 0;</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span> </div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>     <span class="keywordflow">for</span> (i = 0; i < l->size; i++) {</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>         <span class="keywordtype">void</span> *e = l->elements[i];</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>         <span class="keywordtype">double</span> sigma  = eval_err(e, data_err);</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span> </div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( sigma > 0 );</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>         </div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>         <span class="keywordtype">double</span> weight = 1/(sigma*sigma);</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>         </div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>         opt_average += eval(e, data_eval) * weight;</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>         sum_weights += weight;</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>     }</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>     opt_average /= sum_weights;</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>     *err = 1 / sqrt(sum_weights);</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span> </div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>     <span class="keywordflow">if</span> (red_chisq != NULL) {</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>         *red_chisq = 0;</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>         <span class="keywordflow">for</span> (i = 0; i < l->size; i++) {</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>             <span class="keywordtype">void</span> *e = l->elements[i];</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>             <span class="keywordtype">double</span> residual = ((eval(e, data_eval) - opt_average)) / eval_err(e, data_err);</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>             *red_chisq += residual * residual;</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>         }</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>         *red_chisq /= (l->size - 1);</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>     }</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span> </div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>     <span class="keywordflow">return</span> opt_average;</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span> }</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span> </div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span> </div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span> </div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span> <span class="comment"> * @brief Compute absolute deviation</span></div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span> <span class="comment"> * @param e1        element</span></div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span> <span class="comment"> * @param data      reference value, and evaluation function</span></div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span> <span class="comment"> *                  and additional data passed to the evaluation function</span></div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span> <span class="comment"> * @return absolute difference between e1 and reference point</span></div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span> <span class="keyword">static</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span> abs_dev(<span class="keyword">const</span> <span class="keywordtype">void</span> *e1, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span> {</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>         <span class="keywordtype">double</span> ref;</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>         list_func_eval f;</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>         <span class="keywordtype">void</span> *aux_data;</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>     } *d = data;</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>     <span class="comment">/* Cast is safe, see caller */</span></div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span> </div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>     <span class="keywordflow">return</span> fabs(d->f(e1, d->aux_data) - d->ref);</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span> }</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span> </div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span> <span class="comment"> * @brief Compute median absolute deviation wrt median</span></div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span> <span class="comment"> * @param l          list</span></div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span> <span class="comment"> * @param eval       returns the value of an element</span></div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span> <span class="comment"> * @param data       additional data passed to eval</span></div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span> <span class="comment"> * @return mad</span></div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span> <span class="comment"> * Time: Average O(n).</span></div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span> list_mad(<a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span> {</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( l != NULL );</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( eval != NULL );</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span> </div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>     <span class="keywordtype">double</span> median = list_median(l, eval, data);</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span> </div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>         <span class="keywordtype">double</span> ref;</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>         list_func_eval f;</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>         <span class="keywordtype">void</span> *aux_data;</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>     } d;</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span> </div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>     d.ref = median;</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>     d.f = eval;</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>     d.aux_data = data;</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span> </div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>     <span class="keywordflow">return</span> list_median(l, abs_dev, &d);</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span> }</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/list_8h-source.html b/html/list_8h-source.html
deleted file mode 100644
index fbe29e8..0000000
--- a/html/list_8h-source.html
+++ /dev/null
@@ -1,479 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: list.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>list.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: list.h,v 1.9 2009/02/17 15:23:51 hlorch Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00004"></a>00004 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00005"></a>00005 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00006"></a>00006 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00007"></a>00007 <span class="comment"> *</span>
-<a name="l00008"></a>00008 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00009"></a>00009 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00010"></a>00010 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00011"></a>00011 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00012"></a>00012 <span class="comment"> *</span>
-<a name="l00013"></a>00013 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00014"></a>00014 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00015"></a>00015 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00016"></a>00016 <span class="comment"> */</span>
-<a name="l00017"></a>00017 
-<a name="l00018"></a>00018 <span class="comment">/*</span>
-<a name="l00019"></a>00019 <span class="comment"> * $Author: hlorch $</span>
-<a name="l00020"></a>00020 <span class="comment"> * $Date: 2009/02/17 15:23:51 $</span>
-<a name="l00021"></a>00021 <span class="comment"> * $Revision: 1.9 $</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00023"></a>00023 <span class="comment"> */</span>
-<a name="l00024"></a>00024 
-<a name="l00025"></a>00025 <span class="preprocessor">#ifndef LIST_ELEM</span>
-<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#error Define LIST_ELEM before including</span>
-<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
-<a name="l00028"></a>00028 <span class="preprocessor"></span>
-<a name="l00029"></a>00029 <span class="preprocessor">#include <list_void.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00031"></a>00031 
-<a name="l00032"></a>00032 <span class="preprocessor">#define LIST_CON(a,b) a ## _ ## b</span>
-<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define LIST_CAT(a,b) LIST_CON(a,b)</span>
-<a name="l00034"></a>00034 <span class="preprocessor"></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#define LIST LIST_CAT(LIST_ELEM, list)</span>
-<a name="l00036"></a>00036 <span class="preprocessor"></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#ifndef LIST_DEFINE</span>
-<a name="l00038"></a>00038 <span class="preprocessor"></span>
-<a name="l00039"></a>00039 <span class="keyword">typedef</span> <span class="keyword">struct </span>LIST LIST;
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="keyword">typedef</span> double (*LIST_CAT(LIST, func_eval))(<span class="keyword">const</span> <a class="code" href="group__fors__image.html#g9d7995a21a54c1d39a0bc87d7f498029">LIST_ELEM</a> *,
-<a name="l00042"></a>00042                         <span class="keywordtype">void</span> *);
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="keyword">typedef</span> bool (*LIST_CAT(LIST, func_lt))(<span class="keyword">const</span> LIST_ELEM *,
-<a name="l00045"></a>00045                     <span class="keyword">const</span> LIST_ELEM *,
-<a name="l00046"></a>00046                     <span class="keywordtype">void</span> *);
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 <span class="keyword">typedef</span> bool (*LIST_CAT(LIST, func_predicate))(<span class="keyword">const</span> LIST_ELEM *,
-<a name="l00049"></a>00049                            <span class="keywordtype">void</span> *);
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 <span class="preprocessor">#endif</span>
-<a name="l00052"></a>00052 <span class="preprocessor"></span>
-<a name="l00053"></a>00053 LIST *
-<a name="l00054"></a>00054 LIST_CAT(LIST, <span class="keyword">new</span>)(void) 
-<a name="l00055"></a>00055 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00056"></a>00056 {
-<a name="l00057"></a>00057   <span class="keywordflow">return</span> (LIST *) <a class="code" href="group__multiset.html#g14ca81b1edd1222975ab52e203cbde59">list_new</a>();
-<a name="l00058"></a>00058 }
-<a name="l00059"></a>00059 <span class="preprocessor">#else</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span>;
-<a name="l00061"></a>00061 <span class="preprocessor">#endif</span>
-<a name="l00062"></a>00062 <span class="preprocessor"></span>
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 LIST *
-<a name="l00065"></a>00065 LIST_CAT(LIST, duplicate)(<span class="keyword">const</span> LIST *l,
-<a name="l00066"></a>00066               LIST_ELEM * (*duplicate)(<span class="keyword">const</span> LIST_ELEM *))
-<a name="l00067"></a>00067 <span class="preprocessor">#ifdef LIST_DEFINE </span>
-<a name="l00068"></a>00068 <span class="preprocessor"></span>{
-<a name="l00069"></a>00069     <span class="keywordflow">return</span> (LIST *) 
-<a name="l00070"></a>00070         <a class="code" href="group__multiset.html#ge8bd4915a67367a226dcd3f5c3bd5491">list_duplicate</a>((<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *)l,
-<a name="l00071"></a>00071                        (<span class="keywordtype">void</span> *(*)(<span class="keyword">const</span> <span class="keywordtype">void</span> *)) duplicate);
-<a name="l00072"></a>00072 }
-<a name="l00073"></a>00073 <span class="preprocessor">#else</span>
-<a name="l00074"></a>00074 <span class="preprocessor"></span>;
-<a name="l00075"></a>00075 <span class="preprocessor">#endif</span>
-<a name="l00076"></a>00076 <span class="preprocessor"></span>
-<a name="l00077"></a>00077 <span class="keywordtype">void</span>
-<a name="l00078"></a>00078 LIST_CAT(LIST, <span class="keyword">delete</span>)(LIST **l,
-<a name="l00079"></a>00079                                  void (*<span class="keyword">delete</span>)(LIST_ELEM **))
-<a name="l00080"></a>00080 <span class="preprocessor">#ifdef LIST_DEFINE </span>
-<a name="l00081"></a>00081 <span class="preprocessor"></span>{
-<a name="l00082"></a>00082   <a class="code" href="group__multiset.html#g023d28b5567e53901b78d9311fc5ca35">list_delete</a>((list **)l, (<span class="keywordtype">void</span> (*)(<span class="keywordtype">void</span> **))<span class="keyword">delete</span>);
-<a name="l00083"></a>00083 }
-<a name="l00084"></a>00084 <span class="preprocessor">#else</span>
-<a name="l00085"></a>00085 <span class="preprocessor"></span>;
-<a name="l00086"></a>00086 <span class="preprocessor">#endif</span>
-<a name="l00087"></a>00087 <span class="preprocessor"></span>
-<a name="l00088"></a>00088 <span class="keywordtype">void</span>
-<a name="l00089"></a>00089 LIST_CAT(LIST, delete_const)(<span class="keyword">const</span> LIST **l,
-<a name="l00090"></a>00090                  void (*<span class="keyword">delete</span>)(LIST_ELEM **))
-<a name="l00091"></a>00091 <span class="preprocessor">#ifdef LIST_DEFINE </span>
-<a name="l00092"></a>00092 <span class="preprocessor"></span>{
-<a name="l00093"></a>00093     <a class="code" href="group__multiset.html#g6b91588e63479b669eefe0aa72a0b934">list_delete_const</a>((<span class="keyword">const</span> list **)l, (<span class="keywordtype">void</span> (*)(<span class="keywordtype">void</span> **))<span class="keyword">delete</span>);
-<a name="l00094"></a>00094 }
-<a name="l00095"></a>00095 <span class="preprocessor">#else</span>
-<a name="l00096"></a>00096 <span class="preprocessor"></span>;
-<a name="l00097"></a>00097 <span class="preprocessor">#endif</span>
-<a name="l00098"></a>00098 <span class="preprocessor"></span>
-<a name="l00099"></a>00099 <span class="keywordtype">void</span>
-<a name="l00100"></a>00100 LIST_CAT(LIST, insert)(LIST *l, LIST_ELEM *e)
-<a name="l00101"></a>00101 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00102"></a>00102 {
-<a name="l00103"></a>00103   <a class="code" href="group__multiset.html#g5e63a209af7e8b792f9a96225e8b1e9a">list_insert</a>((list *)l, e);
-<a name="l00104"></a>00104 }
-<a name="l00105"></a>00105 <span class="preprocessor">#else</span>
-<a name="l00106"></a>00106 <span class="preprocessor"></span>;
-<a name="l00107"></a>00107 <span class="preprocessor">#endif</span>
-<a name="l00108"></a>00108 <span class="preprocessor"></span>
-<a name="l00109"></a>00109 <span class="keywordtype">void</span>
-<a name="l00110"></a>00110 LIST_CAT(LIST, reverse)(LIST *l)
-<a name="l00111"></a>00111 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00112"></a>00112 {
-<a name="l00113"></a>00113   <a class="code" href="group__multiset.html#g276d60cc73b392f762c0ccf4b3754dad">list_reverse</a>((list *)l);
-<a name="l00114"></a>00114 }
-<a name="l00115"></a>00115 <span class="preprocessor">#else</span>
-<a name="l00116"></a>00116 <span class="preprocessor"></span>;
-<a name="l00117"></a>00117 <span class="preprocessor">#endif</span>
-<a name="l00118"></a>00118 <span class="preprocessor"></span>
-<a name="l00119"></a>00119 <span class="keywordtype">int</span>
-<a name="l00120"></a>00120 LIST_CAT(LIST, size)(<span class="keyword">const</span> LIST *l)
-<a name="l00121"></a>00121 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00122"></a>00122 {
-<a name="l00123"></a>00123     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g5287413c34475d2be585d0d499284ad0">list_size</a>((<span class="keyword">const</span> list *)l);
-<a name="l00124"></a>00124 }
-<a name="l00125"></a>00125 <span class="preprocessor">#else</span>
-<a name="l00126"></a>00126 <span class="preprocessor"></span>;
-<a name="l00127"></a>00127 <span class="preprocessor">#endif</span>
-<a name="l00128"></a>00128 <span class="preprocessor"></span>
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130 LIST_ELEM *
-<a name="l00131"></a>00131 LIST_CAT(LIST, first)(LIST *l)
-<a name="l00132"></a>00132 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00133"></a>00133 {
-<a name="l00134"></a>00134   <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#gcd8957206ede65fe202056cf477a70a7">list_first</a>((list *)l);
-<a name="l00135"></a>00135 }
-<a name="l00136"></a>00136 <span class="preprocessor">#else</span>
-<a name="l00137"></a>00137 <span class="preprocessor"></span>;
-<a name="l00138"></a>00138 <span class="preprocessor">#endif</span>
-<a name="l00139"></a>00139 <span class="preprocessor"></span>
-<a name="l00140"></a>00140 
-<a name="l00141"></a>00141 LIST_ELEM *
-<a name="l00142"></a>00142 LIST_CAT(LIST, next)(LIST *l)
-<a name="l00143"></a>00143 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00144"></a>00144 {
-<a name="l00145"></a>00145   <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g5c52611dbc9f33d472caa4c1df3f2da5">list_next</a>((list *)l);
-<a name="l00146"></a>00146 }
-<a name="l00147"></a>00147 <span class="preprocessor">#else</span>
-<a name="l00148"></a>00148 <span class="preprocessor"></span>;
-<a name="l00149"></a>00149 <span class="preprocessor">#endif</span>
-<a name="l00150"></a>00150 <span class="preprocessor"></span>
-<a name="l00151"></a>00151 
-<a name="l00152"></a>00152 <span class="keyword">const</span> LIST_ELEM *
-<a name="l00153"></a>00153 LIST_CAT(LIST, first_const)(<span class="keyword">const</span> LIST *l)
-<a name="l00154"></a>00154 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00155"></a>00155 {
-<a name="l00156"></a>00156   <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g6a309c29348190f4a4c5eeadb98087a9">list_first_const</a>((list *)l);
-<a name="l00157"></a>00157 }
-<a name="l00158"></a>00158 <span class="preprocessor">#else</span>
-<a name="l00159"></a>00159 <span class="preprocessor"></span>;
-<a name="l00160"></a>00160 <span class="preprocessor">#endif</span>
-<a name="l00161"></a>00161 <span class="preprocessor"></span>
-<a name="l00162"></a>00162 
-<a name="l00163"></a>00163 <span class="keyword">const</span> LIST_ELEM *
-<a name="l00164"></a>00164 LIST_CAT(LIST, next_const)(<span class="keyword">const</span> LIST *l)
-<a name="l00165"></a>00165 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00166"></a>00166 {
-<a name="l00167"></a>00167     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g26472127771d0bcc4a49191de53233a1">list_next_const</a>((<span class="keyword">const</span> list *)l);
-<a name="l00168"></a>00168 }
-<a name="l00169"></a>00169 <span class="preprocessor">#else</span>
-<a name="l00170"></a>00170 <span class="preprocessor"></span>;
-<a name="l00171"></a>00171 <span class="preprocessor">#endif</span>
-<a name="l00172"></a>00172 <span class="preprocessor"></span>
-<a name="l00173"></a>00173 <span class="keywordtype">void</span>
-<a name="l00174"></a>00174 LIST_CAT(LIST, first_pair)(LIST *l, 
-<a name="l00175"></a>00175                      LIST_ELEM **e1,
-<a name="l00176"></a>00176                      LIST_ELEM **e2)
-<a name="l00177"></a>00177 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00178"></a>00178 {
-<a name="l00179"></a>00179     <a class="code" href="group__multiset.html#g1a78a6f27d351d9e1dc99d2247a2455b">list_first_pair</a>((list *)l, (<span class="keywordtype">void</span> **)e1, (<span class="keywordtype">void</span> **)e2);
-<a name="l00180"></a>00180     <span class="keywordflow">return</span>;
-<a name="l00181"></a>00181 }
-<a name="l00182"></a>00182 <span class="preprocessor">#else</span>
-<a name="l00183"></a>00183 <span class="preprocessor"></span>;
-<a name="l00184"></a>00184 <span class="preprocessor">#endif</span>
-<a name="l00185"></a>00185 <span class="preprocessor"></span>
-<a name="l00186"></a>00186 <span class="keywordtype">void</span>
-<a name="l00187"></a>00187 LIST_CAT(LIST, next_pair)(LIST *l, 
-<a name="l00188"></a>00188                     LIST_ELEM **e1,
-<a name="l00189"></a>00189                     LIST_ELEM **e2)
-<a name="l00190"></a>00190 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00191"></a>00191 {
-<a name="l00192"></a>00192     <a class="code" href="group__multiset.html#g72eca5c2f995f7885c72dff4b77a6dfe">list_next_pair</a>((list *)l, (<span class="keywordtype">void</span> **)e1, (<span class="keywordtype">void</span> **)e2);
-<a name="l00193"></a>00193     <span class="keywordflow">return</span>;
-<a name="l00194"></a>00194 }
-<a name="l00195"></a>00195 <span class="preprocessor">#else</span>
-<a name="l00196"></a>00196 <span class="preprocessor"></span>;
-<a name="l00197"></a>00197 <span class="preprocessor">#endif</span>
-<a name="l00198"></a>00198 <span class="preprocessor"></span>
-<a name="l00199"></a>00199 <span class="keywordtype">void</span>
-<a name="l00200"></a>00200 LIST_CAT(LIST, first_pair_const)(<span class="keyword">const</span> LIST *l, 
-<a name="l00201"></a>00201                        <span class="keyword">const</span> LIST_ELEM **e1,
-<a name="l00202"></a>00202                        <span class="keyword">const</span> LIST_ELEM **e2)
-<a name="l00203"></a>00203 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00204"></a>00204 {
-<a name="l00205"></a>00205     <a class="code" href="group__multiset.html#g1a78a6f27d351d9e1dc99d2247a2455b">list_first_pair</a>((list *)l, (<span class="keywordtype">void</span> **)e1, (<span class="keywordtype">void</span> **)e2);
-<a name="l00206"></a>00206     <span class="keywordflow">return</span>;
-<a name="l00207"></a>00207 }
-<a name="l00208"></a>00208 <span class="preprocessor">#else</span>
-<a name="l00209"></a>00209 <span class="preprocessor"></span>;
-<a name="l00210"></a>00210 <span class="preprocessor">#endif</span>
-<a name="l00211"></a>00211 <span class="preprocessor"></span><span class="keywordtype">void</span>
-<a name="l00212"></a>00212 LIST_CAT(LIST, next_pair_const)(<span class="keyword">const</span> LIST *l, 
-<a name="l00213"></a>00213                       <span class="keyword">const</span> LIST_ELEM **e1,
-<a name="l00214"></a>00214                       <span class="keyword">const</span> LIST_ELEM **e2)
-<a name="l00215"></a>00215 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00216"></a>00216 {
-<a name="l00217"></a>00217     <a class="code" href="group__multiset.html#g72eca5c2f995f7885c72dff4b77a6dfe">list_next_pair</a>((list *)l, (<span class="keywordtype">void</span> **)e1, (<span class="keywordtype">void</span> **)e2);
-<a name="l00218"></a>00218     <span class="keywordflow">return</span>;
-<a name="l00219"></a>00219 }
-<a name="l00220"></a>00220 <span class="preprocessor">#else</span>
-<a name="l00221"></a>00221 <span class="preprocessor"></span>;
-<a name="l00222"></a>00222 <span class="preprocessor">#endif</span>
-<a name="l00223"></a>00223 <span class="preprocessor"></span>
-<a name="l00224"></a>00224 <span class="keyword">const</span> LIST_ELEM *
-<a name="l00225"></a>00225 LIST_CAT(LIST, remove_const)(LIST *l, <span class="keyword">const</span> LIST_ELEM *e)
-<a name="l00226"></a>00226 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00227"></a>00227 {
-<a name="l00228"></a>00228     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g2fdb96b9da8d926647099d3bd47d603d">list_remove_const</a>((list *)l, e);
-<a name="l00229"></a>00229 }
-<a name="l00230"></a>00230 <span class="preprocessor">#else</span>
-<a name="l00231"></a>00231 <span class="preprocessor"></span>;
-<a name="l00232"></a>00232 <span class="preprocessor">#endif</span>
-<a name="l00233"></a>00233 <span class="preprocessor"></span>
-<a name="l00234"></a>00234 LIST_ELEM *
-<a name="l00235"></a>00235 LIST_CAT(LIST, remove)(LIST *l, LIST_ELEM *e)
-<a name="l00236"></a>00236 #ifdef <a class="code" href="group__fors__image.html#gb79164ea3a1118352c6ca0ea9a9840ea">LIST_DEFINE</a> 
-<a name="l00237"></a>00237 {
-<a name="l00238"></a>00238     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#gd930cb6af417438f37a442896b48f80a">list_remove</a>((list *)l, e);
-<a name="l00239"></a>00239 }
-<a name="l00240"></a>00240 <span class="preprocessor">#else</span>
-<a name="l00241"></a>00241 <span class="preprocessor"></span>;
-<a name="l00242"></a>00242 <span class="preprocessor">#endif</span>
-<a name="l00243"></a>00243 <span class="preprocessor"></span>
-<a name="l00244"></a>00244 
-<a name="l00245"></a>00245 LIST *
-<a name="l00246"></a>00246 LIST_CAT(LIST, extract)(<span class="keyword">const</span> LIST *l,
-<a name="l00247"></a>00247             LIST_ELEM * (*duplicate)(<span class="keyword">const</span> LIST_ELEM *),
-<a name="l00248"></a>00248             LIST_CAT(LIST, func_predicate) predicate,
-<a name="l00249"></a>00249             <span class="keywordtype">void</span> *data)
-<a name="l00250"></a>00250 <span class="preprocessor">#ifdef LIST_DEFINE </span>
-<a name="l00251"></a>00251 <span class="preprocessor"></span>{
-<a name="l00252"></a>00252     <span class="keywordflow">return</span> (LIST *)<a class="code" href="group__multiset.html#g014e03d131a3d24d1d52465fd0f63a2f">list_extract</a>((<span class="keyword">const</span> list *)l,
-<a name="l00253"></a>00253                 (<span class="keywordtype">void</span> *(*)(<span class="keyword">const</span> <span class="keywordtype">void</span> *))duplicate,
-<a name="l00254"></a>00254                 (list_func_predicate) predicate,
-<a name="l00255"></a>00255                 data);
-<a name="l00256"></a>00256 }
-<a name="l00257"></a>00257 <span class="preprocessor">#else</span>
-<a name="l00258"></a>00258 <span class="preprocessor"></span>;
-<a name="l00259"></a>00259 <span class="preprocessor">#endif</span>
-<a name="l00260"></a>00260 <span class="preprocessor"></span>
-<a name="l00261"></a>00261 
-<a name="l00262"></a>00262 <span class="keyword">const</span> LIST_ELEM *
-<a name="l00263"></a>00263 LIST_CAT(LIST, max_const)(<span class="keyword">const</span> LIST *l,
-<a name="l00264"></a>00264               LIST_CAT(LIST, func_lt) less_than,
-<a name="l00265"></a>00265               <span class="keywordtype">void</span> *data)
-<a name="l00266"></a>00266 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00267"></a>00267 <span class="preprocessor"></span>{
-<a name="l00268"></a>00268     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g39d692d83a67a5554962f19684ebbe70">list_max_const</a>((list *)l, 
-<a name="l00269"></a>00269                           (list_func_lt) less_than,
-<a name="l00270"></a>00270                           data);
-<a name="l00271"></a>00271 }
-<a name="l00272"></a>00272 <span class="preprocessor">#else</span>
-<a name="l00273"></a>00273 <span class="preprocessor"></span>;
-<a name="l00274"></a>00274 <span class="preprocessor">#endif</span>
-<a name="l00275"></a>00275 <span class="preprocessor"></span>
-<a name="l00276"></a>00276 LIST_ELEM *
-<a name="l00277"></a>00277 LIST_CAT(LIST, max)(LIST *l,
-<a name="l00278"></a>00278             LIST_CAT(LIST, func_lt) less_than,
-<a name="l00279"></a>00279             <span class="keywordtype">void</span> *data)
-<a name="l00280"></a>00280 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00281"></a>00281 <span class="preprocessor"></span>{
-<a name="l00282"></a>00282     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#gd24f0143a53c96f495c7d2cc7a7e6aca">list_max</a>((list *)l, 
-<a name="l00283"></a>00283                     (list_func_lt) less_than,
-<a name="l00284"></a>00284                     data);
-<a name="l00285"></a>00285 }
-<a name="l00286"></a>00286 <span class="preprocessor">#else</span>
-<a name="l00287"></a>00287 <span class="preprocessor"></span>;
-<a name="l00288"></a>00288 <span class="preprocessor">#endif</span>
-<a name="l00289"></a>00289 <span class="preprocessor"></span>
-<a name="l00290"></a>00290 LIST_ELEM *
-<a name="l00291"></a>00291 LIST_CAT(LIST, min)(LIST *l,
-<a name="l00292"></a>00292             LIST_CAT(LIST, func_lt) less_than,
-<a name="l00293"></a>00293             <span class="keywordtype">void</span> *data)
-<a name="l00294"></a>00294 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00295"></a>00295 <span class="preprocessor"></span>{
-<a name="l00296"></a>00296     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#gc52f12226db01726e092b3ec7c95ebc4">list_min</a>((list *)l,
-<a name="l00297"></a>00297                     (list_func_lt) less_than,
-<a name="l00298"></a>00298                     data);
-<a name="l00299"></a>00299 }
-<a name="l00300"></a>00300 <span class="preprocessor">#else</span>
-<a name="l00301"></a>00301 <span class="preprocessor"></span>;
-<a name="l00302"></a>00302 <span class="preprocessor">#endif</span>
-<a name="l00303"></a>00303 <span class="preprocessor"></span>
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305 LIST_ELEM *
-<a name="l00306"></a>00306 LIST_CAT(LIST, min_val)(LIST *l,
-<a name="l00307"></a>00307             LIST_CAT(LIST, func_eval) eval,
-<a name="l00308"></a>00308             <span class="keywordtype">void</span> *data)
-<a name="l00309"></a>00309 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00310"></a>00310 <span class="preprocessor"></span>{
-<a name="l00311"></a>00311     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#gf6935394b702cbc694e5dda2521c181b">list_min_val</a>((list *)l,
-<a name="l00312"></a>00312             (list_func_eval) eval,
-<a name="l00313"></a>00313             data);
-<a name="l00314"></a>00314 }
-<a name="l00315"></a>00315 <span class="preprocessor">#else</span>
-<a name="l00316"></a>00316 <span class="preprocessor"></span>;
-<a name="l00317"></a>00317 <span class="preprocessor">#endif</span>
-<a name="l00318"></a>00318 <span class="preprocessor"></span>
-<a name="l00319"></a>00319 
-<a name="l00320"></a>00320 LIST_ELEM *
-<a name="l00321"></a>00321 LIST_CAT(LIST, max_val)(LIST *l,
-<a name="l00322"></a>00322             LIST_CAT(LIST, func_eval) eval,
-<a name="l00323"></a>00323             <span class="keywordtype">void</span> *data)
-<a name="l00324"></a>00324 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00325"></a>00325 <span class="preprocessor"></span>{
-<a name="l00326"></a>00326     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g13ef29594314bbfb2d5ecd3a059653f9">list_max_val</a>((list *)l,
-<a name="l00327"></a>00327             (list_func_eval) eval,
-<a name="l00328"></a>00328             data);
-<a name="l00329"></a>00329 }
-<a name="l00330"></a>00330 <span class="preprocessor">#else</span>
-<a name="l00331"></a>00331 <span class="preprocessor"></span>;
-<a name="l00332"></a>00332 <span class="preprocessor">#endif</span>
-<a name="l00333"></a>00333 <span class="preprocessor"></span>
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335 <span class="keyword">const</span> LIST_ELEM *
-<a name="l00336"></a>00336 LIST_CAT(LIST, kth_const)(<span class="keyword">const</span> LIST *l, <span class="keywordtype">int</span> k,
-<a name="l00337"></a>00337               LIST_CAT(LIST, func_lt) less_than,
-<a name="l00338"></a>00338               <span class="keywordtype">void</span> *data)
-<a name="l00339"></a>00339 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00340"></a>00340 <span class="preprocessor"></span>{
-<a name="l00341"></a>00341   <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#gbe07f00186264749cbecd016562119d1">list_kth_const</a>((list *)l, k,
-<a name="l00342"></a>00342             (list_func_lt) less_than,
-<a name="l00343"></a>00343                         data);
-<a name="l00344"></a>00344 }
-<a name="l00345"></a>00345 <span class="preprocessor">#else</span>
-<a name="l00346"></a>00346 <span class="preprocessor"></span>;
-<a name="l00347"></a>00347 <span class="preprocessor">#endif</span>
-<a name="l00348"></a>00348 <span class="preprocessor"></span>
-<a name="l00349"></a>00349 LIST_ELEM *
-<a name="l00350"></a>00350 LIST_CAT(LIST, <a class="code" href="group__multiset.html#ge1f21da53f4a26ca9dd7e25f19286408">kth</a>)(LIST *l, <span class="keywordtype">int</span> k,
-<a name="l00351"></a>00351             LIST_CAT(LIST, func_lt) less_than,
-<a name="l00352"></a>00352             <span class="keywordtype">void</span> *data)
-<a name="l00353"></a>00353 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00354"></a>00354 <span class="preprocessor"></span>{
-<a name="l00355"></a>00355     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#gee7de62f4bb9591e4c2cd75056f30c57">list_kth</a>((list *)l, k,
-<a name="l00356"></a>00356             (list_func_lt) less_than,
-<a name="l00357"></a>00357                     data);
-<a name="l00358"></a>00358 }
-<a name="l00359"></a>00359 <span class="preprocessor">#else</span>
-<a name="l00360"></a>00360 <span class="preprocessor"></span>;
-<a name="l00361"></a>00361 <span class="preprocessor">#endif</span>
-<a name="l00362"></a>00362 <span class="preprocessor"></span>
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364 LIST_ELEM *
-<a name="l00365"></a>00365 LIST_CAT(LIST, kth_val)(LIST *l, <span class="keywordtype">int</span> k,
-<a name="l00366"></a>00366             LIST_CAT(LIST, func_eval) eval, 
-<a name="l00367"></a>00367             <span class="keywordtype">void</span> *data)
-<a name="l00368"></a>00368 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00369"></a>00369 <span class="preprocessor"></span>{
-<a name="l00370"></a>00370     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g5eede66c73b61927347fb3c758896353">list_kth_val</a>((list *)l, k,
-<a name="l00371"></a>00371             (list_func_eval) eval,
-<a name="l00372"></a>00372             data);
-<a name="l00373"></a>00373 }
-<a name="l00374"></a>00374 <span class="preprocessor">#else</span>
-<a name="l00375"></a>00375 <span class="preprocessor"></span>;
-<a name="l00376"></a>00376 <span class="preprocessor">#endif</span>
-<a name="l00377"></a>00377 <span class="preprocessor"></span>
-<a name="l00378"></a>00378 
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380 <span class="keyword">const</span> LIST_ELEM *
-<a name="l00381"></a>00381 LIST_CAT(LIST, kth_val_const)(<span class="keyword">const</span> LIST *l, <span class="keywordtype">int</span> k,
-<a name="l00382"></a>00382                   LIST_CAT(LIST, func_eval) eval, 
-<a name="l00383"></a>00383                   <span class="keywordtype">void</span> *data)
-<a name="l00384"></a>00384 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00385"></a>00385 <span class="preprocessor"></span>{
-<a name="l00386"></a>00386     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#gf25d4a9d7f9563e177dcf3bc6a8a5c7e">list_kth_val_const</a>((<span class="keyword">const</span> list *)l, k,
-<a name="l00387"></a>00387                   (list_func_eval) eval,
-<a name="l00388"></a>00388                   data);
-<a name="l00389"></a>00389 }
-<a name="l00390"></a>00390 <span class="preprocessor">#else</span>
-<a name="l00391"></a>00391 <span class="preprocessor"></span>;
-<a name="l00392"></a>00392 <span class="preprocessor">#endif</span>
-<a name="l00393"></a>00393 <span class="preprocessor"></span>
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395 
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397 <span class="keywordtype">double</span>
-<a name="l00398"></a>00398 LIST_CAT(LIST, mean)(LIST *l,
-<a name="l00399"></a>00399              LIST_CAT(LIST, func_eval) eval,
-<a name="l00400"></a>00400              <span class="keywordtype">void</span> *data)
-<a name="l00401"></a>00401 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00402"></a>00402 <span class="preprocessor"></span>{
-<a name="l00403"></a>00403     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#gae34efc79a1739b874206aa063c0d146">list_mean</a>((list *)l,
-<a name="l00404"></a>00404              (list_func_eval) eval,
-<a name="l00405"></a>00405              data);
-<a name="l00406"></a>00406 }
-<a name="l00407"></a>00407 <span class="preprocessor">#else</span>
-<a name="l00408"></a>00408 <span class="preprocessor"></span>;
-<a name="l00409"></a>00409 <span class="preprocessor">#endif</span>
-<a name="l00410"></a>00410 <span class="preprocessor"></span>
-<a name="l00411"></a>00411 <span class="keywordtype">double</span>
-<a name="l00412"></a>00412 LIST_CAT(LIST, mean_optimal)(LIST *l,
-<a name="l00413"></a>00413                  LIST_CAT(LIST, func_eval) eval, <span class="keywordtype">void</span> *data_eval,
-<a name="l00414"></a>00414                  LIST_CAT(LIST, func_eval) eval_err, <span class="keywordtype">void</span> *data_err,
-<a name="l00415"></a>00415                  <span class="keywordtype">double</span> *err,
-<a name="l00416"></a>00416                  <span class="keywordtype">double</span> *red_chisq)
-<a name="l00417"></a>00417 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00418"></a>00418 <span class="preprocessor"></span>{
-<a name="l00419"></a>00419     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g064d7efd017b52f7a6301dfe305fb5b2">list_mean_optimal</a>((list *)l,
-<a name="l00420"></a>00420                  (list_func_eval) eval, data_eval,
-<a name="l00421"></a>00421                  (list_func_eval) eval_err, data_err,
-<a name="l00422"></a>00422                  err,
-<a name="l00423"></a>00423                  red_chisq);
-<a name="l00424"></a>00424 }
-<a name="l00425"></a>00425 <span class="preprocessor">#else</span>
-<a name="l00426"></a>00426 <span class="preprocessor"></span>;
-<a name="l00427"></a>00427 <span class="preprocessor">#endif</span>
-<a name="l00428"></a>00428 <span class="preprocessor"></span>
-<a name="l00429"></a>00429 
-<a name="l00430"></a>00430 <span class="keywordtype">double</span>
-<a name="l00431"></a>00431 LIST_CAT(LIST, median)(<span class="keyword">const</span> LIST *l,
-<a name="l00432"></a>00432                LIST_CAT(LIST, func_eval) eval,
-<a name="l00433"></a>00433                <span class="keywordtype">void</span> *data)
-<a name="l00434"></a>00434 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00435"></a>00435 <span class="preprocessor"></span>{
-<a name="l00436"></a>00436     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g41f7807a7a5b85063ccd7f8b44a22503">list_median</a>((<span class="keyword">const</span> list *)l,
-<a name="l00437"></a>00437                (list_func_eval) eval,
-<a name="l00438"></a>00438                data);
-<a name="l00439"></a>00439 }
-<a name="l00440"></a>00440 <span class="preprocessor">#else</span>
-<a name="l00441"></a>00441 <span class="preprocessor"></span>;
-<a name="l00442"></a>00442 <span class="preprocessor">#endif</span>
-<a name="l00443"></a>00443 <span class="preprocessor"></span>
-<a name="l00444"></a>00444 
-<a name="l00445"></a>00445 <span class="keywordtype">double</span>
-<a name="l00446"></a>00446 LIST_CAT(LIST, mad)(LIST *l,
-<a name="l00447"></a>00447             LIST_CAT(LIST, func_eval) eval,
-<a name="l00448"></a>00448             <span class="keywordtype">void</span> *data)
-<a name="l00449"></a>00449 <span class="preprocessor">#ifdef LIST_DEFINE</span>
-<a name="l00450"></a>00450 <span class="preprocessor"></span>{
-<a name="l00451"></a>00451     <span class="keywordflow">return</span> <a class="code" href="group__multiset.html#g2a273e58ffe66d39796a4c2c795256c6">list_mad</a>((list *)l,
-<a name="l00452"></a>00452             (list_func_eval) eval,
-<a name="l00453"></a>00453             data);
-<a name="l00454"></a>00454 }
-<a name="l00455"></a>00455 <span class="preprocessor">#else</span>
-<a name="l00456"></a>00456 <span class="preprocessor"></span>;
-<a name="l00457"></a>00457 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/list_8h_source.html b/html/list_8h_source.html
new file mode 100644
index 0000000..d13a0d3
--- /dev/null
+++ b/html/list_8h_source.html
@@ -0,0 +1,518 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: list.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">list.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: list.h,v 1.10 2013-05-16 08:40:07 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> </div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> <span class="comment"> * $Date: 2013-05-16 08:40:07 $</span></div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment"> * $Revision: 1.10 $</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> </div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="preprocessor">#ifndef LIST_ELEM</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="preprocessor"></span><span class="preprocessor">#error Define LIST_ELEM before including</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> <span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor">#include <list_void.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> </div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#define LIST_CON(a,b) a ## _ ## b</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_CAT(a,b) LIST_CON(a,b)</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#define LIST LIST_CAT(LIST_ELEM, list)</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#ifndef LIST_DEFINE</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">typedef</span> <span class="keyword">struct </span>LIST LIST;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">typedef</span> double (*LIST_CAT(LIST, func_eval))(<span class="keyword">const</span> LIST_ELEM *,</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span>                         <span class="keywordtype">void</span> *);</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">typedef</span> bool (*LIST_CAT(LIST, func_lt))(<span class="keyword">const</span> LIST_ELEM *,</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>                     <span class="keyword">const</span> LIST_ELEM *,</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span>                     <span class="keywordtype">void</span> *);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keyword">typedef</span> bool (*LIST_CAT(LIST, func_predicate))(<span class="keyword">const</span> LIST_ELEM *,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>                            <span class="keywordtype">void</span> *);</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> LIST *</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> LIST_CAT(LIST, <span class="keyword">new</span>)(void) </div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> {</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>   <span class="keywordflow">return</span> (LIST *) <a class="code" href="group__multiset.html#ga9b9a23d98f58af888b2d2d3072f8b999" title="Constructor.">list_new</a>();</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> }</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> LIST *</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> LIST_CAT(LIST, duplicate)(<span class="keyword">const</span> LIST *l,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>               LIST_ELEM * (*duplicate)(<span class="keyword">const</span> LIST_ELEM *))</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">#ifdef LIST_DEFINE </span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>     <span class="keywordflow">return</span> (LIST *) </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>         <a class="code" href="group__multiset.html#gac2d7ea2bf8ee3637bc9167916e637f30" title="Copy constructor.">list_duplicate</a>((<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *)l,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                        (<span class="keywordtype">void</span> *(*)(<span class="keyword">const</span> <span class="keywordtype">void</span> *)) duplicate);</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> }</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> LIST_CAT(LIST, <span class="keyword">delete</span>)(LIST **l,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                                  void (*ldelete)(LIST_ELEM **))</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">#ifdef LIST_DEFINE </span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>   list_delete((<a class="code" href="structlist.html">list</a> **)l, (<span class="keywordtype">void</span> (*)(<span class="keywordtype">void</span> **))ldelete);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> }</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> LIST_CAT(LIST, delete_const)(<span class="keyword">const</span> LIST **l,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                  void (*ldelete)(LIST_ELEM **))</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">#ifdef LIST_DEFINE </span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     list_delete_const((<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> **)l, (<span class="keywordtype">void</span> (*)(<span class="keywordtype">void</span> **))ldelete);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> }</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> LIST_CAT(LIST, insert)(LIST *l, LIST_ELEM *e)</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> {</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>   list_insert((<a class="code" href="structlist.html">list</a> *)l, e);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> }</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> LIST_CAT(LIST, reverse)(LIST *l)</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> {</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>   list_reverse((<a class="code" href="structlist.html">list</a> *)l);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> }</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> LIST_CAT(LIST, size)(<span class="keyword">const</span> LIST *l)</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> {</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="keywordflow">return</span> list_size((<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *)l);</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> }</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> LIST_ELEM *</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> LIST_CAT(LIST, first)(LIST *l)</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> {</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>   <span class="keywordflow">return</span> list_first((<a class="code" href="structlist.html">list</a> *)l);</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> }</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> LIST_ELEM *</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> LIST_CAT(LIST, next)(LIST *l)</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> {</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>   <span class="keywordflow">return</span> list_next((<a class="code" href="structlist.html">list</a> *)l);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> }</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> </div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="keyword">const</span> LIST_ELEM *</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> LIST_CAT(LIST, first_const)(<span class="keyword">const</span> LIST *l)</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> {</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>   <span class="keywordflow">return</span> list_first_const((<a class="code" href="structlist.html">list</a> *)l);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> }</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="keyword">const</span> LIST_ELEM *</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> LIST_CAT(LIST, next_const)(<span class="keyword">const</span> LIST *l)</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> {</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="keywordflow">return</span> list_next_const((<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *)l);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> }</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> LIST_CAT(LIST, first_pair)(LIST *l, </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>                      LIST_ELEM **e1,</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>                      LIST_ELEM **e2)</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     list_first_pair((<a class="code" href="structlist.html">list</a> *)l, (<span class="keywordtype">void</span> **)e1, (<span class="keywordtype">void</span> **)e2);</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> }</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> LIST_CAT(LIST, next_pair)(LIST *l, </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>                     LIST_ELEM **e1,</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>                     LIST_ELEM **e2)</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> {</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     list_next_pair((<a class="code" href="structlist.html">list</a> *)l, (<span class="keywordtype">void</span> **)e1, (<span class="keywordtype">void</span> **)e2);</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> }</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> LIST_CAT(LIST, first_pair_const)(<span class="keyword">const</span> LIST *l, </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                        <span class="keyword">const</span> LIST_ELEM **e1,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                        <span class="keyword">const</span> LIST_ELEM **e2)</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> {</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     list_first_pair((<a class="code" href="structlist.html">list</a> *)l, (<span class="keywordtype">void</span> **)e1, (<span class="keywordtype">void</span> **)e2);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> }</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> <span class="preprocessor"></span><span class="keywordtype">void</span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> LIST_CAT(LIST, next_pair_const)(<span class="keyword">const</span> LIST *l, </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>                       <span class="keyword">const</span> LIST_ELEM **e1,</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>                       <span class="keyword">const</span> LIST_ELEM **e2)</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> {</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     list_next_pair((<a class="code" href="structlist.html">list</a> *)l, (<span class="keywordtype">void</span> **)e1, (<span class="keywordtype">void</span> **)e2);</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> }</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> <span class="keyword">const</span> LIST_ELEM *</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> LIST_CAT(LIST, remove_const)(LIST *l, <span class="keyword">const</span> LIST_ELEM *e)</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> {</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     <span class="keywordflow">return</span> list_remove_const((<a class="code" href="structlist.html">list</a> *)l, e);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> }</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> LIST_ELEM *</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> LIST_CAT(LIST, <span class="keyword">remove</span>)(LIST *l, LIST_ELEM *e)</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> #ifdef LIST_DEFINE </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> {</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     <span class="keywordflow">return</span> list_remove((<a class="code" href="structlist.html">list</a> *)l, e);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> }</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> LIST *</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> LIST_CAT(LIST, extract)(<span class="keyword">const</span> LIST *l,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>             LIST_ELEM * (*duplicate)(<span class="keyword">const</span> LIST_ELEM *),</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>             LIST_CAT(LIST, func_predicate) predicate,</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>             <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> <span class="preprocessor">#ifdef LIST_DEFINE </span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="keywordflow">return</span> (LIST *)<a class="code" href="group__multiset.html#gaf355fe5f4ce5910b419c80ae14bf5199" title="Extract elements.">list_extract</a>((<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *)l,</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>                 (<span class="keywordtype">void</span> *(*)(<span class="keyword">const</span> <span class="keywordtype">void</span> *))duplicate,</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>                 (list_func_predicate) predicate,</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>                 data);</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> }</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="keyword">const</span> LIST_ELEM *</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> LIST_CAT(LIST, max_const)(<span class="keyword">const</span> LIST *l,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>               LIST_CAT(LIST, func_lt) less_than,</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>               <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="keywordflow">return</span> list_max_const((<a class="code" href="structlist.html">list</a> *)l, </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>                           (list_func_lt) less_than,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                           data);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> }</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> LIST_ELEM *</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> LIST_CAT(LIST, max)(LIST *l,</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>             LIST_CAT(LIST, func_lt) less_than,</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>             <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordflow">return</span> list_max((<a class="code" href="structlist.html">list</a> *)l, </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>                     (list_func_lt) less_than,</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>                     data);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> }</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> LIST_ELEM *</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> LIST_CAT(LIST, min)(LIST *l,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>             LIST_CAT(LIST, func_lt) less_than,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>             <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="keywordflow">return</span> list_min((<a class="code" href="structlist.html">list</a> *)l,</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                     (list_func_lt) less_than,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                     data);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> }</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> LIST_ELEM *</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> LIST_CAT(LIST, min_val)(LIST *l,</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>             LIST_CAT(LIST, func_eval) eval,</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>             <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="keywordflow">return</span> list_min_val((<a class="code" href="structlist.html">list</a> *)l,</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>             (list_func_eval) eval,</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>             data);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> }</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> LIST_ELEM *</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> LIST_CAT(LIST, max_val)(LIST *l,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>             LIST_CAT(LIST, func_eval) eval,</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>             <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keywordflow">return</span> list_max_val((<a class="code" href="structlist.html">list</a> *)l,</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>             (list_func_eval) eval,</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>             data);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> }</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span> <span class="keyword">const</span> LIST_ELEM *</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> LIST_CAT(LIST, kth_const)(<span class="keyword">const</span> LIST *l, <span class="keywordtype">int</span> k,</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>               LIST_CAT(LIST, func_lt) less_than,</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>               <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>   <span class="keywordflow">return</span> list_kth_const((<a class="code" href="structlist.html">list</a> *)l, k,</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>             (list_func_lt) less_than,</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>                         data);</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> }</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> LIST_ELEM *</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> LIST_CAT(LIST, kth)(LIST *l, <span class="keywordtype">int</span> k,</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>             LIST_CAT(LIST, func_lt) less_than,</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>             <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     <span class="keywordflow">return</span> list_kth((<a class="code" href="structlist.html">list</a> *)l, k,</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>             (list_func_lt) less_than,</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>                     data);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> }</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> LIST_ELEM *</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> LIST_CAT(LIST, kth_val)(LIST *l, <span class="keywordtype">int</span> k,</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>             LIST_CAT(LIST, func_eval) eval, </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>             <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     <span class="keywordflow">return</span> list_kth_val((<a class="code" href="structlist.html">list</a> *)l, k,</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>             (list_func_eval) eval,</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>             data);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> }</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> </div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> </div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> <span class="keyword">const</span> LIST_ELEM *</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> LIST_CAT(LIST, kth_val_const)(<span class="keyword">const</span> LIST *l, <span class="keywordtype">int</span> k,</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>                   LIST_CAT(LIST, func_eval) eval, </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>                   <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keywordflow">return</span> list_kth_val_const((<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *)l, k,</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>                   (list_func_eval) eval,</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>                   data);</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> }</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> </div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> LIST_CAT(LIST, mean)(LIST *l,</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>              LIST_CAT(LIST, func_eval) eval,</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>              <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     <span class="keywordflow">return</span> list_mean((<a class="code" href="structlist.html">list</a> *)l,</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>              (list_func_eval) eval,</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>              data);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> }</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> LIST_CAT(LIST, mean_optimal)(LIST *l,</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>                  LIST_CAT(LIST, func_eval) eval, <span class="keywordtype">void</span> *data_eval,</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>                  LIST_CAT(LIST, func_eval) eval_err, <span class="keywordtype">void</span> *data_err,</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>                  <span class="keywordtype">double</span> *err,</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>                  <span class="keywordtype">double</span> *red_chisq)</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     <span class="keywordflow">return</span> list_mean_optimal((<a class="code" href="structlist.html">list</a> *)l,</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                  (list_func_eval) eval, data_eval,</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                  (list_func_eval) eval_err, data_err,</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>                  err,</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                  red_chisq);</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span> }</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> </div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> LIST_CAT(LIST, median)(<span class="keyword">const</span> LIST *l,</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>                LIST_CAT(LIST, func_eval) eval,</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>                <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">return</span> list_median((<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *)l,</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                (list_func_eval) eval,</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                data);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> }</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> </div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> LIST_CAT(LIST, mad)(LIST *l,</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>             LIST_CAT(LIST, func_eval) eval,</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>             <span class="keywordtype">void</span> *data)</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> <span class="preprocessor">#ifdef LIST_DEFINE</span></div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> <span class="preprocessor"></span>{</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     <span class="keywordflow">return</span> list_mad((<a class="code" href="structlist.html">list</a> *)l,</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>             (list_func_eval) eval,</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>             data);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> }</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> <span class="preprocessor"></span>;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/list__void_8h-source.html b/html/list__void_8h-source.html
deleted file mode 100644
index f9363ac..0000000
--- a/html/list__void_8h-source.html
+++ /dev/null
@@ -1,178 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: list_void.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>list_void.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: list_void.h,v 1.9 2009/02/17 15:23:51 hlorch Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00004"></a>00004 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00005"></a>00005 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00006"></a>00006 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00007"></a>00007 <span class="comment"> *</span>
-<a name="l00008"></a>00008 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00009"></a>00009 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00010"></a>00010 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00011"></a>00011 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00012"></a>00012 <span class="comment"> *</span>
-<a name="l00013"></a>00013 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00014"></a>00014 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00015"></a>00015 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00016"></a>00016 <span class="comment"> */</span>
-<a name="l00017"></a>00017 
-<a name="l00018"></a>00018 <span class="comment">/*</span>
-<a name="l00019"></a>00019 <span class="comment"> * $Author: hlorch $</span>
-<a name="l00020"></a>00020 <span class="comment"> * $Date: 2009/02/17 15:23:51 $</span>
-<a name="l00021"></a>00021 <span class="comment"> * $Revision: 1.9 $</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00023"></a>00023 <span class="comment"> */</span>
-<a name="l00024"></a>00024 
-<a name="l00025"></a>00025 <span class="preprocessor">#ifndef LIST_VOID_H</span>
-<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define LIST_VOID_H</span>
-<a name="l00027"></a>00027 <span class="preprocessor"></span>
-<a name="l00028"></a>00028 <span class="preprocessor">#include <stdbool.h></span>
-<a name="l00029"></a>00029 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00030"></a>00030 
-<a name="l00031"></a>00031 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structlist.html">list</a> list;
-<a name="l00032"></a>00032 <span class="keyword">typedef</span> double (*list_func_eval)(<span class="keyword">const</span> <span class="keywordtype">void</span> *element,
-<a name="l00033"></a>00033                  <span class="keywordtype">void</span> *data);
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keyword">typedef</span> bool (*list_func_lt)(<span class="keyword">const</span> <span class="keywordtype">void</span> *e1,
-<a name="l00036"></a>00036                  <span class="keyword">const</span> <span class="keywordtype">void</span> *e2,
-<a name="l00037"></a>00037                  <span class="keywordtype">void</span> *data);
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="keyword">typedef</span> bool (*list_func_predicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *);
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="comment">/* Create */</span>
-<a name="l00043"></a>00043 list *<a class="code" href="group__multiset.html#g14ca81b1edd1222975ab52e203cbde59">list_new</a>(<span class="keywordtype">void</span>);
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 list *<a class="code" href="group__multiset.html#ge8bd4915a67367a226dcd3f5c3bd5491">list_duplicate</a>(<span class="keyword">const</span> list *l, <span class="keywordtype">void</span> *(*duplicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *));
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 <span class="comment">/* Delete */</span>
-<a name="l00048"></a>00048 <span class="keywordtype">void</span>
-<a name="l00049"></a>00049 <a class="code" href="group__multiset.html#g023d28b5567e53901b78d9311fc5ca35">list_delete</a>(list **l, <span class="keywordtype">void</span> (*<span class="keyword">delete</span>)(<span class="keywordtype">void</span> **));
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 <span class="keywordtype">void</span>
-<a name="l00052"></a>00052 <a class="code" href="group__multiset.html#g6b91588e63479b669eefe0aa72a0b934">list_delete_const</a>(<span class="keyword">const</span> list **l, <span class="keywordtype">void</span> (*<span class="keyword">delete</span>)(<span class="keywordtype">void</span> **));
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 <span class="keywordtype">int</span>
-<a name="l00055"></a>00055 <a class="code" href="group__multiset.html#g5287413c34475d2be585d0d499284ad0">list_size</a>(<span class="keyword">const</span> list *l);
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="comment">/* Iterate */</span>
-<a name="l00058"></a>00058 <span class="keywordtype">void</span> *
-<a name="l00059"></a>00059 <a class="code" href="group__multiset.html#gcd8957206ede65fe202056cf477a70a7">list_first</a>(list *l);
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 <span class="keywordtype">void</span> *
-<a name="l00062"></a>00062 <a class="code" href="group__multiset.html#g5c52611dbc9f33d472caa4c1df3f2da5">list_next</a>(list *l);
-<a name="l00063"></a>00063 
-<a name="l00064"></a>00064 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00065"></a>00065 <a class="code" href="group__multiset.html#g6a309c29348190f4a4c5eeadb98087a9">list_first_const</a>(<span class="keyword">const</span> list *l);
-<a name="l00066"></a>00066 
-<a name="l00067"></a>00067 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00068"></a>00068 <a class="code" href="group__multiset.html#g26472127771d0bcc4a49191de53233a1">list_next_const</a>(<span class="keyword">const</span> list *l);
-<a name="l00069"></a>00069 
-<a name="l00070"></a>00070 <span class="keywordtype">void</span>
-<a name="l00071"></a>00071 <a class="code" href="group__multiset.html#g1a78a6f27d351d9e1dc99d2247a2455b">list_first_pair</a>(list *l,
-<a name="l00072"></a>00072         <span class="keywordtype">void</span> **e1,
-<a name="l00073"></a>00073         <span class="keywordtype">void</span> **e2);
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="keywordtype">void</span>
-<a name="l00076"></a>00076 <a class="code" href="group__multiset.html#g72eca5c2f995f7885c72dff4b77a6dfe">list_next_pair</a>(list *l,
-<a name="l00077"></a>00077            <span class="keywordtype">void</span> **e1,
-<a name="l00078"></a>00078            <span class="keywordtype">void</span> **e2);
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080 <span class="keywordtype">void</span>
-<a name="l00081"></a>00081 <a class="code" href="group__multiset.html#g71a3d48a34a961956cd0fc55c9a8b502">list_first_pair_const</a>(<span class="keyword">const</span> list *l,
-<a name="l00082"></a>00082               <span class="keyword">const</span> <span class="keywordtype">void</span> **e1,
-<a name="l00083"></a>00083               <span class="keyword">const</span> <span class="keywordtype">void</span> **e2);
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085 <span class="keywordtype">void</span>
-<a name="l00086"></a>00086 <a class="code" href="group__multiset.html#g8723ab90a5925a64e30c250e770d10d0">list_next_pair_const</a>(<span class="keyword">const</span> list *l,
-<a name="l00087"></a>00087              <span class="keyword">const</span> <span class="keywordtype">void</span> **e1,
-<a name="l00088"></a>00088              <span class="keyword">const</span> <span class="keywordtype">void</span> **e2);
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090 
-<a name="l00091"></a>00091 <span class="comment">/* Element */</span>
-<a name="l00092"></a>00092 <span class="keywordtype">void</span>
-<a name="l00093"></a>00093 <a class="code" href="group__multiset.html#g5e63a209af7e8b792f9a96225e8b1e9a">list_insert</a>(list *l, <span class="keywordtype">void</span> *e);
-<a name="l00094"></a>00094 
-<a name="l00095"></a>00095 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00096"></a>00096 <a class="code" href="group__multiset.html#g2fdb96b9da8d926647099d3bd47d603d">list_remove_const</a>(list *l, <span class="keyword">const</span> <span class="keywordtype">void</span> *e);
-<a name="l00097"></a>00097 
-<a name="l00098"></a>00098 <span class="keywordtype">void</span> *
-<a name="l00099"></a>00099 <a class="code" href="group__multiset.html#gd930cb6af417438f37a442896b48f80a">list_remove</a>(list *l, <span class="keywordtype">void</span> *e);
-<a name="l00100"></a>00100 
-<a name="l00101"></a>00101 <span class="comment">/* List */</span>
-<a name="l00102"></a>00102 <span class="keywordtype">void</span>
-<a name="l00103"></a>00103 <a class="code" href="group__multiset.html#g276d60cc73b392f762c0ccf4b3754dad">list_reverse</a>(list *l);
-<a name="l00104"></a>00104 
-<a name="l00105"></a>00105 list *
-<a name="l00106"></a>00106 <a class="code" href="group__multiset.html#g014e03d131a3d24d1d52465fd0f63a2f">list_extract</a>(<span class="keyword">const</span> list *l,
-<a name="l00107"></a>00107              <span class="keywordtype">void</span> *(*duplicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *),
-<a name="l00108"></a>00108          list_func_predicate predicate,
-<a name="l00109"></a>00109              <span class="keywordtype">void</span> *data);
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111 <span class="comment">/* Search */</span>
-<a name="l00112"></a>00112 <span class="keywordtype">void</span> *
-<a name="l00113"></a>00113 <a class="code" href="group__multiset.html#gc52f12226db01726e092b3ec7c95ebc4">list_min</a>(list *l, list_func_lt less_than, <span class="keywordtype">void</span> *data);
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115 <span class="keywordtype">void</span> *
-<a name="l00116"></a>00116 <a class="code" href="group__multiset.html#gf6935394b702cbc694e5dda2521c181b">list_min_val</a>(list *l, list_func_eval eval, <span class="keywordtype">void</span> *data);
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118 <span class="keywordtype">void</span> *
-<a name="l00119"></a>00119 <a class="code" href="group__multiset.html#gd24f0143a53c96f495c7d2cc7a7e6aca">list_max</a>(list *l, list_func_lt less_than, <span class="keywordtype">void</span> *data);
-<a name="l00120"></a>00120 
-<a name="l00121"></a>00121 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00122"></a>00122 <a class="code" href="group__multiset.html#g39d692d83a67a5554962f19684ebbe70">list_max_const</a>(<span class="keyword">const</span> list *l, list_func_lt less_than, <span class="keywordtype">void</span> *data);
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124 <span class="keywordtype">void</span> *
-<a name="l00125"></a>00125 <a class="code" href="group__multiset.html#g13ef29594314bbfb2d5ecd3a059653f9">list_max_val</a>(list *l, list_func_eval eval, <span class="keywordtype">void</span> *data);
-<a name="l00126"></a>00126 
-<a name="l00127"></a>00127 <span class="keywordtype">void</span> *
-<a name="l00128"></a>00128 <a class="code" href="group__multiset.html#gee7de62f4bb9591e4c2cd75056f30c57">list_kth</a>(list *l, <span class="keywordtype">int</span> k, list_func_lt less_than, <span class="keywordtype">void</span> *data);
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00131"></a>00131 <a class="code" href="group__multiset.html#gbe07f00186264749cbecd016562119d1">list_kth_const</a>(<span class="keyword">const</span> list *l, <span class="keywordtype">int</span> k, list_func_lt less_than, <span class="keywordtype">void</span> *data);
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133 <span class="keywordtype">void</span> *
-<a name="l00134"></a>00134 <a class="code" href="group__multiset.html#g5eede66c73b61927347fb3c758896353">list_kth_val</a>(list *l, <span class="keywordtype">int</span> k, list_func_eval eval, <span class="keywordtype">void</span> *data);
-<a name="l00135"></a>00135 
-<a name="l00136"></a>00136 <span class="keyword">const</span> <span class="keywordtype">void</span> *
-<a name="l00137"></a>00137 <a class="code" href="group__multiset.html#gf25d4a9d7f9563e177dcf3bc6a8a5c7e">list_kth_val_const</a>(<span class="keyword">const</span> list *l, <span class="keywordtype">int</span> k, list_func_eval eval, <span class="keywordtype">void</span> *data);
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139 <span class="comment">/* Statistics */</span>
-<a name="l00140"></a>00140 <span class="keywordtype">double</span>
-<a name="l00141"></a>00141 <a class="code" href="group__multiset.html#gae34efc79a1739b874206aa063c0d146">list_mean</a>(<span class="keyword">const</span> list *l, list_func_eval eval, <span class="keywordtype">void</span> *data);
-<a name="l00142"></a>00142 
-<a name="l00143"></a>00143 <span class="keywordtype">double</span>
-<a name="l00144"></a>00144 <a class="code" href="group__multiset.html#g064d7efd017b52f7a6301dfe305fb5b2">list_mean_optimal</a>(<span class="keyword">const</span> list *l, 
-<a name="l00145"></a>00145           list_func_eval eval, <span class="keywordtype">void</span> *data_eval,
-<a name="l00146"></a>00146           list_func_eval eval_err, <span class="keywordtype">void</span> *data_err,
-<a name="l00147"></a>00147           <span class="keywordtype">double</span> *err,
-<a name="l00148"></a>00148                   <span class="keywordtype">double</span> *red_chisq);
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150 <span class="keywordtype">double</span>
-<a name="l00151"></a>00151 <a class="code" href="group__multiset.html#g41f7807a7a5b85063ccd7f8b44a22503">list_median</a>(<span class="keyword">const</span> list *l, list_func_eval eval, <span class="keywordtype">void</span> *data);
-<a name="l00152"></a>00152 
-<a name="l00153"></a>00153 <span class="keywordtype">double</span>
-<a name="l00154"></a>00154 <a class="code" href="group__multiset.html#g2a273e58ffe66d39796a4c2c795256c6">list_mad</a>(list *l, list_func_eval eval, <span class="keywordtype">void</span> *data);
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/list__void_8h_source.html b/html/list__void_8h_source.html
new file mode 100644
index 0000000..47658ca
--- /dev/null
+++ b/html/list__void_8h_source.html
@@ -0,0 +1,217 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: list_void.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">list_void.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: list_void.h,v 1.10 2013-05-16 08:40:07 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> </div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> <span class="comment"> * $Date: 2013-05-16 08:40:07 $</span></div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment"> * $Revision: 1.10 $</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> </div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="preprocessor">#ifndef LIST_VOID_H</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="preprocessor"></span><span class="preprocessor">#define LIST_VOID_H</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#include <stdbool.h></span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> </div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structlist.html">list</a> <a class="code" href="structlist.html">list</a>;</div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="keyword">typedef</span> double (*list_func_eval)(<span class="keyword">const</span> <span class="keywordtype">void</span> *element,</div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span>                  <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keyword">typedef</span> bool (*list_func_lt)(<span class="keyword">const</span> <span class="keywordtype">void</span> *e1,</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span>                  <span class="keyword">const</span> <span class="keywordtype">void</span> *e2,</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span>                  <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">typedef</span> bool (*list_func_predicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="comment">/* Create */</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <a class="code" href="structlist.html">list</a> *<a class="code" href="group__multiset.html#ga9b9a23d98f58af888b2d2d3072f8b999" title="Constructor.">list_new</a>(<span class="keywordtype">void</span>);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <a class="code" href="structlist.html">list</a> *<a class="code" href="group__multiset.html#gac2d7ea2bf8ee3637bc9167916e637f30" title="Copy constructor.">list_duplicate</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">void</span> *(*duplicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *));</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="comment">/* Delete */</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> list_delete(<a class="code" href="structlist.html">list</a> **l, <span class="keywordtype">void</span> (*ldelete)(<span class="keywordtype">void</span> **));</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> list_delete_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> **l, <span class="keywordtype">void</span> (*ldelete)(<span class="keywordtype">void</span> **));</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="keywordtype">int</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> list_size(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l);</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="comment">/* Iterate */</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> list_first(<a class="code" href="structlist.html">list</a> *l);</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> list_next(<a class="code" href="structlist.html">list</a> *l);</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> list_first_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l);</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> list_next_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l);</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> </div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> list_first_pair(<a class="code" href="structlist.html">list</a> *l,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>         <span class="keywordtype">void</span> **e1,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>         <span class="keywordtype">void</span> **e2);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> </div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> list_next_pair(<a class="code" href="structlist.html">list</a> *l,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>            <span class="keywordtype">void</span> **e1,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>            <span class="keywordtype">void</span> **e2);</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> list_first_pair_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>               <span class="keyword">const</span> <span class="keywordtype">void</span> **e1,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>               <span class="keyword">const</span> <span class="keywordtype">void</span> **e2);</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> list_next_pair_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>              <span class="keyword">const</span> <span class="keywordtype">void</span> **e1,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>              <span class="keyword">const</span> <span class="keywordtype">void</span> **e2);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> </div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="comment">/* Element */</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> list_insert(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">void</span> *e);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> </div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> list_remove_const(<a class="code" href="structlist.html">list</a> *l, <span class="keyword">const</span> <span class="keywordtype">void</span> *e);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> list_remove(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">void</span> *e);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="comment">/* List */</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> list_reverse(<a class="code" href="structlist.html">list</a> *l);</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> </div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <a class="code" href="structlist.html">list</a> *</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <a class="code" href="group__multiset.html#gaf355fe5f4ce5910b419c80ae14bf5199" title="Extract elements.">list_extract</a>(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>              <span class="keywordtype">void</span> *(*duplicate)(<span class="keyword">const</span> <span class="keywordtype">void</span> *),</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>          list_func_predicate predicate,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>              <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="comment">/* Search */</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> list_min(<a class="code" href="structlist.html">list</a> *l, list_func_lt less_than, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> list_min_val(<a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> list_max(<a class="code" href="structlist.html">list</a> *l, list_func_lt less_than, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> list_max_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, list_func_lt less_than, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> list_max_val(<a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> list_kth(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k, list_func_lt less_than, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> list_kth_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k, list_func_lt less_than, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> list_kth_val(<a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k, list_func_eval eval, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> </div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> list_kth_val_const(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, <span class="keywordtype">int</span> k, list_func_eval eval, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="comment">/* Statistics */</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> list_mean(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> list_mean_optimal(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>           list_func_eval eval, <span class="keywordtype">void</span> *data_eval,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>           list_func_eval eval_err, <span class="keywordtype">void</span> *data_err,</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>           <span class="keywordtype">double</span> *err,</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>                   <span class="keywordtype">double</span> *red_chisq);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> list_median(<span class="keyword">const</span> <a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="keywordtype">double</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> list_mad(<a class="code" href="structlist.html">list</a> *l, list_func_eval eval, <span class="keywordtype">void</span> *data);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/modules.html b/html/modules.html
index 7b7da44..217be32 100644
--- a/html/modules.html
+++ b/html/modules.html
@@ -1,70 +1,104 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: Module Index</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li id="current"><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<h1>FORS Pipeline Reference Manual Modules</h1>Here is a list of all modules:<ul>
-<li><a class="el" href="group__fors__cpl__wcs.html">World_Coordinate_Systems</a>
-<li><a class="el" href="group__forsdfs.html">DFS Utilities</a>
-<li><a class="el" href="group__fors__double.html">floating point values</a>
-<li><a class="el" href="group__fors__extract.html">Image source extraction</a>
-<li><a class="el" href="group__forsqc.html">Quality Control Utilities</a>
-<li><a class="el" href="group__fors__identify.html">Source identification</a>
-<li><a class="el" href="group__fors__image.html">Image with error bars</a>
-<li><a class="el" href="group__forsPaf.html">PAF File Utilities</a>
-<li><a class="el" href="group__fors__pfits.html">FITS keywords</a>
-<li><a class="el" href="group__fors__point.html">2d point</a>
-<li><a class="el" href="group__fors__polynomial.html">Tools for Polynomial Coefficient Handling</a>
-<li><a class="el" href="group__fors__setting.html">Instrument setting</a>
-<li><a class="el" href="group__fors__stack.html">Image stacking</a>
-<li><a class="el" href="group__fors__star.html">star</a>
-<li><a class="el" href="group__fors__tools.html">High level functions</a>
-<li><a class="el" href="group__fors__utils.html">Miscellaneous Utilities</a>
-<li><a class="el" href="group__multiset.html">container type</a>
-<li><a class="el" href="group__moses.html">MOS data reduction library</a>
-<li><a class="el" href="group__fors__test.html">Basic library test</a>
-<li><a class="el" href="group__fors__bias__test.html">test of master bias recipe</a>
-<li><a class="el" href="group__fors__dark__test.html">test of master dark recipe</a>
-<li><a class="el" href="group__fors__identify__test.html">identify unit tests</a>
-<li><a class="el" href="group__fors__image__test.html">Test of image module</a>
-<li><a class="el" href="group__fors__img__science__test.html">science recipe tests</a>
-<li><a class="el" href="group__fors__img__screen__flat__test.html">test of screen flat recipe</a>
-<li><a class="el" href="group__fors__img__sky__flat__test.html">test of sky flat recipe</a>
-<li><a class="el" href="group__fors__pattern__test.html">fors_pattern unit tests</a>
-<li><a class="el" href="group__fors__point__test.html">fors_point unit tests</a>
-<li><a class="el" href="group__fors__qc__test.html">QC test</a>
-<li><a class="el" href="group__fors__setting__test.html">Instrument setting</a>
-<li><a class="el" href="group__fors__stack__test.html">Test image stacking</a>
-<li><a class="el" href="group__fors__star__test.html">Star tests</a>
-<li><a class="el" href="group__fors__std__cat__test.html">Standard star catalogue tests</a>
-<li><a class="el" href="group__fors__zeropoint__test.html">zeropoint recipe tests</a>
-<li><a class="el" href="group__list__test.html">List unit test</a>
-<li><a class="el" href="group__test.html">Unit test infrastructure</a>
-<li><a class="el" href="group__test__simulate.html">Simulate data for unit testing</a>
-<li><a class="el" href="group__fors__bias.html">fors_recipe Recipe</a>
-<li><a class="el" href="group__fors__dark.html">fors_recipe Recipe</a>
-<li><a class="el" href="group__fors__img__science.html">fors_recipe Recipe</a>
-<li><a class="el" href="group__fors__img__screen__flat.html">fors_recipe Recipe</a>
-<li><a class="el" href="group__fors__img__sky__flat.html">fors_recipe Recipe</a>
-<li><a class="el" href="group__fors__photometry.html">fors_recipe Recipe</a>
-<li><a class="el" href="group__fors__recipe.html">fors_recipe Recipe</a>
-<li><a class="el" href="group__fors__zeropoint.html">fors_recipe Recipe</a>
-<li><a class="el" href="group__recipes__test.html">Recipes_test</a>
-<li><a class="el" href="group__vimos__calib__impl.html">Vimos_calib_impl</a>
-<li><a class="el" href="group__vimos__science__impl.html">Vimos_science_impl</a>
-</ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: Modules</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">Modules</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="textblock">Here is a list of all modules:</div><div class="directory">
+<table class="directory">
+<tr id="row_0_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__cpl__wcs.html" target="_self">World_Coordinate_Systems</a></td><td class="desc"></td></tr>
+<tr id="row_1_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__forsdfs.html" target="_self">DFS Utilities</a></td><td class="desc"></td></tr>
+<tr id="row_2_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__double.html" target="_self">floating point values</a></td><td class="desc"></td></tr>
+<tr id="row_3_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__extract.html" target="_self">Image source extraction</a></td><td class="desc"></td></tr>
+<tr id="row_4_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__forsqc.html" target="_self">Quality Control Utilities</a></td><td class="desc"></td></tr>
+<tr id="row_5_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__identify.html" target="_self">Source identification</a></td><td class="desc"></td></tr>
+<tr id="row_6_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__image.html" target="_self">Image with error bars</a></td><td class="desc"></td></tr>
+<tr id="row_7_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__forsPaf.html" target="_self">PAF File Utilities</a></td><td class="desc"></td></tr>
+<tr id="row_8_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__pfits.html" target="_self">FITS keywords</a></td><td class="desc"></td></tr>
+<tr id="row_9_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__point.html" target="_self">2d point</a></td><td class="desc"></td></tr>
+<tr id="row_10_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__polynomial.html" target="_self">Tools for Polynomial Coefficient Handling</a></td><td class="desc"></td></tr>
+<tr id="row_11_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__setting.html" target="_self">Instrument setting</a></td><td class="desc"></td></tr>
+<tr id="row_12_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__stack.html" target="_self">Image stacking</a></td><td class="desc"></td></tr>
+<tr id="row_13_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__star.html" target="_self">star</a></td><td class="desc"></td></tr>
+<tr id="row_14_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__tools.html" target="_self">High level functions</a></td><td class="desc"></td></tr>
+<tr id="row_15_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__utils.html" target="_self">Miscellaneous Utilities</a></td><td class="desc"></td></tr>
+<tr id="row_16_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__multiset.html" target="_self">container type</a></td><td class="desc"></td></tr>
+<tr id="row_17_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__moses.html" target="_self">MOS data reduction library</a></td><td class="desc"></td></tr>
+<tr id="row_18_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__test.html" target="_self">Basic library test</a></td><td class="desc"></td></tr>
+<tr id="row_19_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__bias__test.html" target="_self">test of master bias recipe</a></td><td class="desc"></td></tr>
+<tr id="row_20_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__dark__test.html" target="_self">test of master dark recipe</a></td><td class="desc"></td></tr>
+<tr id="row_21_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__identify__test.html" target="_self">identify unit tests</a></td><td class="desc"></td></tr>
+<tr id="row_22_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__image__test.html" target="_self">Test of image module</a></td><td class="desc"></td></tr>
+<tr id="row_23_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__img__science__test.html" target="_self">science recipe tests</a></td><td class="desc"></td></tr>
+<tr id="row_24_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__img__screen__flat__test.html" target="_self">test of screen flat recipe</a></td><td class="desc"></td></tr>
+<tr id="row_25_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__img__sky__flat__test.html" target="_self">test of sky flat recipe</a></td><td class="desc"></td></tr>
+<tr id="row_26_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__pattern__test.html" target="_self">fors_pattern unit tests</a></td><td class="desc"></td></tr>
+<tr id="row_27_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__point__test.html" target="_self">fors_point unit tests</a></td><td class="desc"></td></tr>
+<tr id="row_28_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__qc__test.html" target="_self">QC test</a></td><td class="desc"></td></tr>
+<tr id="row_29_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__setting__test.html" target="_self">Instrument setting</a></td><td class="desc"></td></tr>
+<tr id="row_30_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__stack__test.html" target="_self">Test image stacking</a></td><td class="desc"></td></tr>
+<tr id="row_31_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__star__test.html" target="_self">Star tests</a></td><td class="desc"></td></tr>
+<tr id="row_32_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__std__cat__test.html" target="_self">Standard star catalogue tests</a></td><td class="desc"></td></tr>
+<tr id="row_33_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__zeropoint__test.html" target="_self">zeropoint recipe tests</a></td><td class="desc"></td></tr>
+<tr id="row_34_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__list__test.html" target="_self">List unit test</a></td><td class="desc"></td></tr>
+<tr id="row_35_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__test.html" target="_self">Unit test infrastructure</a></td><td class="desc"></td></tr>
+<tr id="row_36_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__test__simulate.html" target="_self">Simulate data for unit testing</a></td><td class="desc"></td></tr>
+<tr id="row_37_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__bias.html" target="_self">fors_recipe Recipe</a></td><td class="desc"></td></tr>
+<tr id="row_38_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__dark.html" target="_self">fors_recipe Recipe</a></td><td class="desc"></td></tr>
+<tr id="row_39_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__img__science.html" target="_self">fors_recipe Recipe</a></td><td class="desc"></td></tr>
+<tr id="row_40_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__img__screen__flat.html" target="_self">fors_recipe Recipe</a></td><td class="desc"></td></tr>
+<tr id="row_41_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__img__sky__flat.html" target="_self">fors_recipe Recipe</a></td><td class="desc"></td></tr>
+<tr id="row_42_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__photometry.html" target="_self">fors_recipe Recipe</a></td><td class="desc"></td></tr>
+<tr id="row_43_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__recipe.html" target="_self">fors_recipe Recipe</a></td><td class="desc"></td></tr>
+<tr id="row_44_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__fors__zeropoint.html" target="_self">fors_recipe Recipe</a></td><td class="desc"></td></tr>
+<tr id="row_45_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__recipes__test.html" target="_self">Recipes_test</a></td><td class="desc"></td></tr>
+<tr id="row_46_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__vimos__calib__impl.html" target="_self">Vimos_calib_impl</a></td><td class="desc"></td></tr>
+<tr id="row_47_"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><a class="el" href="group__vimos__science__impl.html" target="_self">Vimos_science_impl</a></td><td class="desc"></td></tr>
+</table>
+</div><!-- directory -->
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/montecarlo_8c-source.html b/html/montecarlo_8c-source.html
deleted file mode 100644
index 010c5b2..0000000
--- a/html/montecarlo_8c-source.html
+++ /dev/null
@@ -1,456 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: montecarlo.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>montecarlo.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: montecarlo.c,v 1.5 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.5 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <string.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_create(cpl_plugin *);
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_exec(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_destroy(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo(cpl_parameterlist *, cpl_frameset *);
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> montecarlo_description[] =
-<a name="l00043"></a>00043 <span class="stringliteral">"This recipe is used to test the mos_montecarlo_polyfit() function.\n"</span>
-<a name="l00044"></a>00044 <span class="stringliteral">"It accepts a table with columns x, y, y_err, derives the best polynomial\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"fit y = p(x), and produces a table with the polynomial 1-sigma accuracy\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"on the given set of x coordinates.\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"  TABLE                      Raw         Table to evaluate       Y\n\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"  MODEL_ERROR                FITS image  Model error at different x\n\n"</span>;
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 <span class="preprocessor">#define montecarlo_exit(message)               \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">{                                             \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00057"></a>00057 <span class="preprocessor">cpl_table_delete(table);                  \</span>
-<a name="l00058"></a>00058 <span class="preprocessor">cpl_table_delete(points);                  \</span>
-<a name="l00059"></a>00059 <span class="preprocessor">cpl_table_delete(model_error);                  \</span>
-<a name="l00060"></a>00060 <span class="preprocessor">cpl_polynomial_delete(p);                    \</span>
-<a name="l00061"></a>00061 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">}</span>
-<a name="l00064"></a>00064 <span class="preprocessor"></span>
-<a name="l00065"></a>00065 <span class="preprocessor">#define montecarlo_exit_memcheck(message)       \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">{                                               \</span>
-<a name="l00067"></a>00067 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">cpl_table_delete(table);                    \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">cpl_table_delete(points);                  \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">cpl_table_delete(model_error);                  \</span>
-<a name="l00071"></a>00071 <span class="preprocessor">cpl_polynomial_delete(p);                    \</span>
-<a name="l00072"></a>00072 <span class="preprocessor">cpl_msg_indent_less();                          \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">return 0;                                       \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">}</span>
-<a name="l00075"></a>00075 <span class="preprocessor"></span>
-<a name="l00076"></a>00076 
-<a name="l00088"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00088</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00089"></a>00089 {
-<a name="l00090"></a>00090     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00091"></a>00091     cpl_plugin *plugin = &recipe->interface;
-<a name="l00092"></a>00092 
-<a name="l00093"></a>00093     cpl_plugin_init(plugin,
-<a name="l00094"></a>00094                     CPL_PLUGIN_API,
-<a name="l00095"></a>00095                     FORS_BINARY_VERSION,
-<a name="l00096"></a>00096                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00097"></a>00097                     <span class="stringliteral">"montecarlo"</span>,
-<a name="l00098"></a>00098                     <span class="stringliteral">"Test function mos_montecarlo_polyfit()"</span>,
-<a name="l00099"></a>00099                     montecarlo_description,
-<a name="l00100"></a>00100                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00101"></a>00101                     PACKAGE_BUGREPORT,
-<a name="l00102"></a>00102     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00103"></a>00103     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00104"></a>00104     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00105"></a>00105     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00106"></a>00106     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00107"></a>00107     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00108"></a>00108     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00109"></a>00109     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00110"></a>00110     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00111"></a>00111     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00112"></a>00112     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00113"></a>00113     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00114"></a>00114     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00115"></a>00115                     montecarlo_create,
-<a name="l00116"></a>00116                     montecarlo_exec,
-<a name="l00117"></a>00117                     montecarlo_destroy);
-<a name="l00118"></a>00118 
-<a name="l00119"></a>00119     cpl_pluginlist_append(list, plugin);
-<a name="l00120"></a>00120     
-<a name="l00121"></a>00121     <span class="keywordflow">return</span> 0;
-<a name="l00122"></a>00122 }
-<a name="l00123"></a>00123 
-<a name="l00124"></a>00124 
-<a name="l00135"></a>00135 <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_create(cpl_plugin *plugin)
-<a name="l00136"></a>00136 {
-<a name="l00137"></a>00137     cpl_recipe    *recipe;
-<a name="l00138"></a>00138     cpl_parameter *p;
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140 
-<a name="l00141"></a>00141     <span class="comment">/* </span>
-<a name="l00142"></a>00142 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00143"></a>00143 <span class="comment">     */</span>
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00146"></a>00146         recipe = (cpl_recipe *)plugin;
-<a name="l00147"></a>00147     <span class="keywordflow">else</span> 
-<a name="l00148"></a>00148         <span class="keywordflow">return</span> -1;
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150     <span class="comment">/* </span>
-<a name="l00151"></a>00151 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00152"></a>00152 <span class="comment">     */</span>
-<a name="l00153"></a>00153 
-<a name="l00154"></a>00154     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157     <span class="comment">/*</span>
-<a name="l00158"></a>00158 <span class="comment">     * Name of input table columns</span>
-<a name="l00159"></a>00159 <span class="comment">     */</span>
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.x"</span>,
-<a name="l00162"></a>00162                                 CPL_TYPE_STRING,
-<a name="l00163"></a>00163                                 <span class="stringliteral">"Name of independent variable column"</span>,
-<a name="l00164"></a>00164                                 <span class="stringliteral">"fors.montecarlo"</span>,
-<a name="l00165"></a>00165                                 <span class="stringliteral">"x"</span>);
-<a name="l00166"></a>00166     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"x"</span>);
-<a name="l00167"></a>00167     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00168"></a>00168     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00169"></a>00169 
-<a name="l00170"></a>00170     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.y"</span>,
-<a name="l00171"></a>00171                                 CPL_TYPE_STRING,
-<a name="l00172"></a>00172                                 <span class="stringliteral">"Name of dependent variable column"</span>,
-<a name="l00173"></a>00173                                 <span class="stringliteral">"fors.montecarlo"</span>,
-<a name="l00174"></a>00174                                 <span class="stringliteral">"y"</span>);
-<a name="l00175"></a>00175     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"y"</span>);
-<a name="l00176"></a>00176     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00177"></a>00177     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00178"></a>00178 
-<a name="l00179"></a>00179     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.sigma"</span>,
-<a name="l00180"></a>00180                                 CPL_TYPE_STRING,
-<a name="l00181"></a>00181                                 <span class="stringliteral">"Name of error column on dependent variable"</span>,
-<a name="l00182"></a>00182                                 <span class="stringliteral">"fors.montecarlo"</span>,
-<a name="l00183"></a>00183                                 <span class="stringliteral">""</span>);
-<a name="l00184"></a>00184     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sigma"</span>);
-<a name="l00185"></a>00185     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00186"></a>00186     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00187"></a>00187 
-<a name="l00188"></a>00188     <span class="comment">/*</span>
-<a name="l00189"></a>00189 <span class="comment">     * Order of fitting polynomial</span>
-<a name="l00190"></a>00190 <span class="comment">     */</span>
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.order"</span>,
-<a name="l00193"></a>00193                                 CPL_TYPE_INT,
-<a name="l00194"></a>00194                                 <span class="stringliteral">"Order of fitting polynomial"</span>,
-<a name="l00195"></a>00195                                 <span class="stringliteral">"fors.montecarlo"</span>,
-<a name="l00196"></a>00196                                 1);
-<a name="l00197"></a>00197     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"order"</span>);
-<a name="l00198"></a>00198     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00199"></a>00199     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201     <span class="comment">/*</span>
-<a name="l00202"></a>00202 <span class="comment">     * Origin of x for fit</span>
-<a name="l00203"></a>00203 <span class="comment">     */</span>
-<a name="l00204"></a>00204 
-<a name="l00205"></a>00205     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.zero"</span>,
-<a name="l00206"></a>00206                                 CPL_TYPE_DOUBLE,
-<a name="l00207"></a>00207                                 <span class="stringliteral">"Origin of x for fit"</span>,
-<a name="l00208"></a>00208                                 <span class="stringliteral">"fors.montecarlo"</span>,
-<a name="l00209"></a>00209                                 0.0);
-<a name="l00210"></a>00210     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"zero"</span>);
-<a name="l00211"></a>00211     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00212"></a>00212     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00213"></a>00213 
-<a name="l00214"></a>00214     <span class="comment">/*</span>
-<a name="l00215"></a>00215 <span class="comment">     * Start x for evaluation</span>
-<a name="l00216"></a>00216 <span class="comment">     */</span>
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.start"</span>,
-<a name="l00219"></a>00219                                 CPL_TYPE_DOUBLE,
-<a name="l00220"></a>00220                                 <span class="stringliteral">"Start x for evaluation"</span>,
-<a name="l00221"></a>00221                                 <span class="stringliteral">"fors.montecarlo"</span>,
-<a name="l00222"></a>00222                                 0.0);
-<a name="l00223"></a>00223     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"start"</span>);
-<a name="l00224"></a>00224     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00225"></a>00225     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227     <span class="comment">/*</span>
-<a name="l00228"></a>00228 <span class="comment">     * End x for evaluation</span>
-<a name="l00229"></a>00229 <span class="comment">     */</span>
-<a name="l00230"></a>00230 
-<a name="l00231"></a>00231     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.end"</span>,
-<a name="l00232"></a>00232                                 CPL_TYPE_DOUBLE,
-<a name="l00233"></a>00233                                 <span class="stringliteral">"End x for evaluation"</span>,
-<a name="l00234"></a>00234                                 <span class="stringliteral">"fors.montecarlo"</span>,
-<a name="l00235"></a>00235                                 0.0);
-<a name="l00236"></a>00236     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"end"</span>);
-<a name="l00237"></a>00237     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00238"></a>00238     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240     <span class="comment">/*</span>
-<a name="l00241"></a>00241 <span class="comment">     * Evaluation sampling</span>
-<a name="l00242"></a>00242 <span class="comment">     */</span>
-<a name="l00243"></a>00243     
-<a name="l00244"></a>00244     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.step"</span>,
-<a name="l00245"></a>00245                                 CPL_TYPE_DOUBLE,
-<a name="l00246"></a>00246                                 <span class="stringliteral">"x sampling interval"</span>,
-<a name="l00247"></a>00247                                 <span class="stringliteral">"fors.montecarlo"</span>,
-<a name="l00248"></a>00248                                 0.0);
-<a name="l00249"></a>00249     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"step"</span>);
-<a name="l00250"></a>00250     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00251"></a>00251     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253     <span class="comment">/*</span>
-<a name="l00254"></a>00254 <span class="comment">     * Statistical sample</span>
-<a name="l00255"></a>00255 <span class="comment">     */</span>
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.trials"</span>,
-<a name="l00258"></a>00258                                 CPL_TYPE_INT,
-<a name="l00259"></a>00259                                 <span class="stringliteral">"Size of statistical sample"</span>,
-<a name="l00260"></a>00260                                 <span class="stringliteral">"fors.montecarlo"</span>,
-<a name="l00261"></a>00261                                 100);
-<a name="l00262"></a>00262     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"trials"</span>);
-<a name="l00263"></a>00263     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00264"></a>00264     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266     <span class="keywordflow">return</span> 0;
-<a name="l00267"></a>00267 }
-<a name="l00268"></a>00268 
-<a name="l00269"></a>00269 
-<a name="l00278"></a>00278 <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_exec(cpl_plugin *plugin)
-<a name="l00279"></a>00279 {
-<a name="l00280"></a>00280     cpl_recipe *recipe;
-<a name="l00281"></a>00281     
-<a name="l00282"></a>00282     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00283"></a>00283         recipe = (cpl_recipe *)plugin;
-<a name="l00284"></a>00284     <span class="keywordflow">else</span> 
-<a name="l00285"></a>00285         <span class="keywordflow">return</span> -1;
-<a name="l00286"></a>00286 
-<a name="l00287"></a>00287     <span class="keywordflow">return</span> montecarlo(recipe->parameters, recipe->frames);
-<a name="l00288"></a>00288 }
-<a name="l00289"></a>00289 
-<a name="l00290"></a>00290 
-<a name="l00299"></a>00299 <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_destroy(cpl_plugin *plugin)
-<a name="l00300"></a>00300 {
-<a name="l00301"></a>00301     cpl_recipe *recipe;
-<a name="l00302"></a>00302     
-<a name="l00303"></a>00303     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00304"></a>00304         recipe = (cpl_recipe *)plugin;
-<a name="l00305"></a>00305     <span class="keywordflow">else</span> 
-<a name="l00306"></a>00306         <span class="keywordflow">return</span> -1;
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310     <span class="keywordflow">return</span> 0;
-<a name="l00311"></a>00311 }
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313 
-<a name="l00323"></a>00323 <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00324"></a>00324 {
-<a name="l00325"></a>00325 
-<a name="l00326"></a>00326     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"montecarlo"</span>;
-<a name="l00327"></a>00327 
-<a name="l00328"></a>00328 
-<a name="l00329"></a>00329     <span class="comment">/*</span>
-<a name="l00330"></a>00330 <span class="comment">     * Input parameters</span>
-<a name="l00331"></a>00331 <span class="comment">     */</span>
-<a name="l00332"></a>00332 
-<a name="l00333"></a>00333     <span class="keyword">const</span> <span class="keywordtype">char</span> *x;
-<a name="l00334"></a>00334     <span class="keyword">const</span> <span class="keywordtype">char</span> *y;
-<a name="l00335"></a>00335     <span class="keyword">const</span> <span class="keywordtype">char</span> *sigma;
-<a name="l00336"></a>00336     <span class="keywordtype">int</span>         order;
-<a name="l00337"></a>00337     <span class="keywordtype">double</span>      start;
-<a name="l00338"></a>00338     <span class="keywordtype">double</span>      end;
-<a name="l00339"></a>00339     <span class="keywordtype">double</span>      step;
-<a name="l00340"></a>00340     <span class="keywordtype">int</span>         trials;
-<a name="l00341"></a>00341     <span class="keywordtype">double</span>      zero;
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343     <span class="comment">/*</span>
-<a name="l00344"></a>00344 <span class="comment">     * CPL objects</span>
-<a name="l00345"></a>00345 <span class="comment">     */</span>
-<a name="l00346"></a>00346 
-<a name="l00347"></a>00347     cpl_table      *table = NULL;
-<a name="l00348"></a>00348     cpl_table      *model_error = NULL;
-<a name="l00349"></a>00349     cpl_table      *points = NULL;
-<a name="l00350"></a>00350     cpl_polynomial *p = NULL;
-<a name="l00351"></a>00351 
-<a name="l00352"></a>00352     <span class="comment">/*</span>
-<a name="l00353"></a>00353 <span class="comment">     * Auxiliary variables</span>
-<a name="l00354"></a>00354 <span class="comment">     */</span>
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356     <span class="keywordtype">char</span>   *version = <span class="stringliteral">"0.1"</span>;
-<a name="l00357"></a>00357     <span class="keywordtype">char</span>   *table_tag = <span class="stringliteral">"TABLE"</span>;
-<a name="l00358"></a>00358     <span class="keywordtype">char</span>   *model_error_tag = <span class="stringliteral">"MODEL_ERROR"</span>;
-<a name="l00359"></a>00359     <span class="keywordtype">double</span> *xdata;
-<a name="l00360"></a>00360     <span class="keywordtype">int</span>     ntables;
-<a name="l00361"></a>00361     <span class="keywordtype">int</span>     i, count;
-<a name="l00362"></a>00362 
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364     cpl_msg_set_indentation(2);
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366 
-<a name="l00367"></a>00367     <span class="comment">/* </span>
-<a name="l00368"></a>00368 <span class="comment">     * Get configuration parameters</span>
-<a name="l00369"></a>00369 <span class="comment">     */</span>
-<a name="l00370"></a>00370 
-<a name="l00371"></a>00371     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00372"></a>00372     cpl_msg_indent_more();
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374     x = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.montecarlo.x"</span>, NULL);
-<a name="l00375"></a>00375     y = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.montecarlo.y"</span>, NULL);
-<a name="l00376"></a>00376     sigma = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.montecarlo.sigma"</span>, NULL);
-<a name="l00377"></a>00377     order = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.montecarlo.order"</span>, NULL);
-<a name="l00378"></a>00378     <span class="keywordflow">if</span> (order < 0)
-<a name="l00379"></a>00379         montecarlo_exit(<span class="stringliteral">"Invalid polynomial order"</span>);
-<a name="l00380"></a>00380     start = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, <span class="stringliteral">"fors.montecarlo.start"</span>, NULL);
-<a name="l00381"></a>00381     end = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, <span class="stringliteral">"fors.montecarlo.end"</span>, NULL);
-<a name="l00382"></a>00382     <span class="keywordflow">if</span> (end <= start)
-<a name="l00383"></a>00383         montecarlo_exit(<span class="stringliteral">"Invalid interval"</span>);
-<a name="l00384"></a>00384     step = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, <span class="stringliteral">"fors.montecarlo.step"</span>, NULL);
-<a name="l00385"></a>00385     <span class="keywordflow">if</span> (step >= end - start || step <= 0.0)
-<a name="l00386"></a>00386         montecarlo_exit(<span class="stringliteral">"Invalid step"</span>);
-<a name="l00387"></a>00387     trials = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.montecarlo.trials"</span>, NULL);
-<a name="l00388"></a>00388     <span class="keywordflow">if</span> (trials < 2)
-<a name="l00389"></a>00389         montecarlo_exit(<span class="stringliteral">"At least 2 trials should be performed"</span>);
-<a name="l00390"></a>00390     zero = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, <span class="stringliteral">"fors.montecarlo.zero"</span>, NULL);
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00393"></a>00393         montecarlo_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00394"></a>00394 
-<a name="l00395"></a>00395     ntables = cpl_frameset_count_tags(frameset, table_tag);
-<a name="l00396"></a>00396     <span class="keywordflow">if</span> (ntables == 0) {
-<a name="l00397"></a>00397         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, table_tag);
-<a name="l00398"></a>00398         montecarlo_exit(NULL);
-<a name="l00399"></a>00399     }
-<a name="l00400"></a>00400     <span class="keywordflow">if</span> (ntables > 1) {
-<a name="l00401"></a>00401         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, table_tag);
-<a name="l00402"></a>00402         montecarlo_exit(NULL);
-<a name="l00403"></a>00403     }
-<a name="l00404"></a>00404 
-<a name="l00405"></a>00405     table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, table_tag, 1);
-<a name="l00406"></a>00406     points = cpl_table_new(cpl_table_get_nrow(table));
-<a name="l00407"></a>00407 
-<a name="l00408"></a>00408     <span class="keywordflow">if</span> (cpl_table_has_column(table, x)) {
-<a name="l00409"></a>00409         cpl_table_move_column(points, x, table);
-<a name="l00410"></a>00410         <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"x"</span>)) {
-<a name="l00411"></a>00411             cpl_table_name_column(points, x, <span class="stringliteral">"x"</span>);
-<a name="l00412"></a>00412         }
-<a name="l00413"></a>00413     }
-<a name="l00414"></a>00414     <span class="keywordflow">else</span> {
-<a name="l00415"></a>00415         cpl_msg_error(recipe, <span class="stringliteral">"Missing column: %s"</span>, x);
-<a name="l00416"></a>00416         montecarlo_exit(NULL);
-<a name="l00417"></a>00417     }
-<a name="l00418"></a>00418 
-<a name="l00419"></a>00419     cpl_table_subtract_scalar(points, <span class="stringliteral">"x"</span>, zero);
-<a name="l00420"></a>00420 
-<a name="l00421"></a>00421     <span class="keywordflow">if</span> (cpl_table_has_column(table, y)) {
-<a name="l00422"></a>00422         cpl_table_move_column(points, y, table);
-<a name="l00423"></a>00423         <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"y"</span>)) {
-<a name="l00424"></a>00424             cpl_table_name_column(points, y, <span class="stringliteral">"y"</span>);
-<a name="l00425"></a>00425         }
-<a name="l00426"></a>00426     }
-<a name="l00427"></a>00427     <span class="keywordflow">else</span> {
-<a name="l00428"></a>00428         cpl_msg_error(recipe, <span class="stringliteral">"Missing column: %s"</span>, y);
-<a name="l00429"></a>00429         montecarlo_exit(NULL);
-<a name="l00430"></a>00430     }
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432     <span class="keywordflow">if</span> (sigma[0] != <span class="charliteral">'\0'</span>) {
-<a name="l00433"></a>00433         <span class="keywordflow">if</span> (cpl_table_has_column(table, sigma)) {
-<a name="l00434"></a>00434             cpl_table_move_column(points, sigma, table);
-<a name="l00435"></a>00435             <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"y_err"</span>)) {
-<a name="l00436"></a>00436                 cpl_table_name_column(points, sigma, <span class="stringliteral">"y_err"</span>);
-<a name="l00437"></a>00437             }
-<a name="l00438"></a>00438         }
-<a name="l00439"></a>00439         <span class="keywordflow">else</span> {
-<a name="l00440"></a>00440             cpl_msg_error(recipe, <span class="stringliteral">"Missing column: %s"</span>, sigma);
-<a name="l00441"></a>00441             montecarlo_exit(NULL);
-<a name="l00442"></a>00442         }
-<a name="l00443"></a>00443     }
-<a name="l00444"></a>00444 
-<a name="l00445"></a>00445     cpl_table_delete(table); table = NULL;
-<a name="l00446"></a>00446     cpl_table_erase_invalid(points);
-<a name="l00447"></a>00447 
-<a name="l00448"></a>00448     count = 1;
-<a name="l00449"></a>00449     <span class="keywordflow">while</span> (start + step*count <= end)
-<a name="l00450"></a>00450         count++;
-<a name="l00451"></a>00451 
-<a name="l00452"></a>00452     model_error = cpl_table_new(count);
-<a name="l00453"></a>00453     cpl_table_new_column(model_error, <span class="stringliteral">"x"</span>, CPL_TYPE_DOUBLE);
-<a name="l00454"></a>00454     cpl_table_fill_column_window_double(model_error, <span class="stringliteral">"x"</span>, 0, count, 0.0);
-<a name="l00455"></a>00455     xdata = cpl_table_get_data_double(model_error, <span class="stringliteral">"x"</span>);
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457     <span class="keywordflow">for</span> (i = 0; i < count; i++)
-<a name="l00458"></a>00458         xdata[i] = start + step*i - zero;
-<a name="l00459"></a>00459 
-<a name="l00460"></a>00460     p = <a class="code" href="group__moses.html#gbdc12afa2f53713a4151907ed3054dd7">mos_montecarlo_polyfit</a>(points, model_error, trials, order);
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00463"></a>00463         cpl_msg_error(recipe, <span class="stringliteral">"%s"</span>, cpl_error_get_message());
-<a name="l00464"></a>00464         montecarlo_exit(NULL);
-<a name="l00465"></a>00465     }
-<a name="l00466"></a>00466 
-<a name="l00467"></a>00467     <span class="keywordflow">for</span> (i = 0; i < count; i++)
-<a name="l00468"></a>00468         xdata[i] += zero;
-<a name="l00469"></a>00469 
-<a name="l00470"></a>00470     cpl_polynomial_delete(p); p = NULL;
-<a name="l00471"></a>00471     cpl_table_delete(points); points = NULL;
-<a name="l00472"></a>00472 
-<a name="l00473"></a>00473     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, model_error, model_error_tag, NULL,
-<a name="l00474"></a>00474                        parlist, recipe, version))
-<a name="l00475"></a>00475         montecarlo_exit(NULL);
-<a name="l00476"></a>00476 
-<a name="l00477"></a>00477     cpl_table_delete(model_error); model_error = NULL;
-<a name="l00478"></a>00478 
-<a name="l00479"></a>00479     <span class="keywordflow">return</span> 0;
-<a name="l00480"></a>00480 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/montecarlo_8c_source.html b/html/montecarlo_8c_source.html
new file mode 100644
index 0000000..463e72f
--- /dev/null
+++ b/html/montecarlo_8c_source.html
@@ -0,0 +1,495 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: montecarlo.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">montecarlo.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: montecarlo.c,v 1.5 2013-04-24 14:14:13 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-04-24 14:14:13 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.5 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_create(cpl_plugin *);</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">char</span> montecarlo_description[] =</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="stringliteral">"This recipe is used to test the mos_montecarlo_polyfit() function.\n"</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"It accepts a table with columns x, y, y_err, derives the best polynomial\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"fit y = p(x), and produces a table with the polynomial 1-sigma accuracy\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"on the given set of x coordinates.\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"  TABLE                      Raw         Table to evaluate       Y\n\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"  MODEL_ERROR                FITS image  Model error at different x\n\n"</span>;</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">#define montecarlo_exit(message)               \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">cpl_table_delete(table);                  \</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">cpl_table_delete(points);                  \</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">cpl_table_delete(model_error);                  \</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">cpl_polynomial_delete(p);                    \</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">#define montecarlo_exit_memcheck(message)       \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">{                                               \</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);     \</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">cpl_table_delete(table);                    \</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">cpl_table_delete(points);                  \</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">cpl_table_delete(model_error);                  \</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor">cpl_polynomial_delete(p);                    \</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">cpl_msg_indent_less();                          \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">return 0;                                       \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> </div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> {</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> </div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                     <span class="stringliteral">"montecarlo"</span>,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>                     <span class="stringliteral">"Test function mos_montecarlo_polyfit()"</span>,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>                     montecarlo_description,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                     montecarlo_create,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                     montecarlo_exec,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                     montecarlo_destroy);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     </div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> }</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> {</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> </div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="comment">     * Name of input table columns</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.x"</span>,</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>                                 <span class="stringliteral">"Name of independent variable column"</span>,</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>                                 <span class="stringliteral">"fors.montecarlo"</span>,</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>                                 <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.y"</span>,</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>                                 <span class="stringliteral">"Name of dependent variable column"</span>,</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>                                 <span class="stringliteral">"fors.montecarlo"</span>,</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>                                 <span class="stringliteral">"y"</span>);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"y"</span>);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.sigma"</span>,</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                                 <span class="stringliteral">"Name of error column on dependent variable"</span>,</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>                                 <span class="stringliteral">"fors.montecarlo"</span>,</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>                                 <span class="stringliteral">""</span>);</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sigma"</span>);</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="comment">     * Order of fitting polynomial</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.order"</span>,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                                 <span class="stringliteral">"Order of fitting polynomial"</span>,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                                 <span class="stringliteral">"fors.montecarlo"</span>,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                                 1);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"order"</span>);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="comment">     * Origin of x for fit</span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.zero"</span>,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                                 <span class="stringliteral">"Origin of x for fit"</span>,</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>                                 <span class="stringliteral">"fors.montecarlo"</span>,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                                 0.0);</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"zero"</span>);</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="comment">     * Start x for evaluation</span></div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.start"</span>,</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>                                 <span class="stringliteral">"Start x for evaluation"</span>,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                                 <span class="stringliteral">"fors.montecarlo"</span>,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                                 0.0);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"start"</span>);</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="comment">     * End x for evaluation</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.end"</span>,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                                 <span class="stringliteral">"End x for evaluation"</span>,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                 <span class="stringliteral">"fors.montecarlo"</span>,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                 0.0);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"end"</span>);</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="comment">     * Evaluation sampling</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.step"</span>,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                                 <span class="stringliteral">"x sampling interval"</span>,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                                 <span class="stringliteral">"fors.montecarlo"</span>,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                                 0.0);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"step"</span>);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> <span class="comment">     * Statistical sample</span></div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.montecarlo.trials"</span>,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                                 <span class="stringliteral">"Size of statistical sample"</span>,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                                 <span class="stringliteral">"fors.montecarlo"</span>,</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                                 100);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"trials"</span>);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> }</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> {</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> </div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">return</span> montecarlo(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> }</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> </div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> </div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> {</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> }</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> </div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> <span class="keyword">static</span> <span class="keywordtype">int</span> montecarlo(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> {</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span> </div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"montecarlo"</span>;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> </div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> </div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *x;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *y;</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *sigma;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <span class="keywordtype">int</span>         order;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     <span class="keywordtype">double</span>      start;</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordtype">double</span>      end;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <span class="keywordtype">double</span>      step;</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordtype">int</span>         trials;</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     <span class="keywordtype">double</span>      zero;</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     cpl_table      *table = NULL;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     cpl_table      *model_error = NULL;</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     cpl_table      *points = NULL;</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     cpl_polynomial *p = NULL;</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> </div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> </div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <span class="keywordtype">char</span>   *version = <span class="stringliteral">"0.1"</span>;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <span class="keywordtype">char</span>   *table_tag = <span class="stringliteral">"TABLE"</span>;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="keywordtype">char</span>   *model_error_tag = <span class="stringliteral">"MODEL_ERROR"</span>;</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     <span class="keywordtype">double</span> *xdata;</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     <span class="keywordtype">int</span>     ntables;</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     <span class="keywordtype">int</span>     i, count;</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     x = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.montecarlo.x"</span>, NULL);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     y = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.montecarlo.y"</span>, NULL);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     sigma = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, <span class="stringliteral">"fors.montecarlo.sigma"</span>, NULL);</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     order = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.montecarlo.order"</span>, NULL);</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     <span class="keywordflow">if</span> (order < 0)</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>         montecarlo_exit(<span class="stringliteral">"Invalid polynomial order"</span>);</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     start = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, <span class="stringliteral">"fors.montecarlo.start"</span>, NULL);</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     end = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, <span class="stringliteral">"fors.montecarlo.end"</span>, NULL);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keywordflow">if</span> (end <= start)</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>         montecarlo_exit(<span class="stringliteral">"Invalid interval"</span>);</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     step = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, <span class="stringliteral">"fors.montecarlo.step"</span>, NULL);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <span class="keywordflow">if</span> (step >= end - start || step <= 0.0)</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>         montecarlo_exit(<span class="stringliteral">"Invalid step"</span>);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     trials = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.montecarlo.trials"</span>, NULL);</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="keywordflow">if</span> (trials < 2)</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>         montecarlo_exit(<span class="stringliteral">"At least 2 trials should be performed"</span>);</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     zero = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, <span class="stringliteral">"fors.montecarlo.zero"</span>, NULL);</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>         montecarlo_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     ntables = cpl_frameset_count_tags(frameset, table_tag);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     <span class="keywordflow">if</span> (ntables == 0) {</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, table_tag);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>         montecarlo_exit(NULL);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     }</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     <span class="keywordflow">if</span> (ntables > 1) {</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, table_tag);</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>         montecarlo_exit(NULL);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     }</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> </div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, table_tag, 1);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>     points = cpl_table_new(cpl_table_get_nrow(table));</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span> </div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>     <span class="keywordflow">if</span> (cpl_table_has_column(table, x)) {</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>         cpl_table_move_column(points, x, table);</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>         <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"x"</span>)) {</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>             cpl_table_name_column(points, x, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>         }</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     }</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing column: %s"</span>, x);</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>         montecarlo_exit(NULL);</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     }</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> </div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     cpl_table_subtract_scalar(points, <span class="stringliteral">"x"</span>, zero);</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> </div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="keywordflow">if</span> (cpl_table_has_column(table, y)) {</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>         cpl_table_move_column(points, y, table);</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>         <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"y"</span>)) {</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>             cpl_table_name_column(points, y, <span class="stringliteral">"y"</span>);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         }</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     }</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing column: %s"</span>, y);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>         montecarlo_exit(NULL);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     }</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> </div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     <span class="keywordflow">if</span> (sigma[0] != <span class="charliteral">'\0'</span>) {</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>         <span class="keywordflow">if</span> (cpl_table_has_column(table, sigma)) {</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>             cpl_table_move_column(points, sigma, table);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>             <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"y_err"</span>)) {</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                 cpl_table_name_column(points, sigma, <span class="stringliteral">"y_err"</span>);</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>             }</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>         }</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing column: %s"</span>, sigma);</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>             montecarlo_exit(NULL);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         }</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     }</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> </div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     cpl_table_delete(table); table = NULL;</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     cpl_table_erase_invalid(points);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     count = 1;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     <span class="keywordflow">while</span> (start + step*count <= end)</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         count++;</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> </div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     model_error = cpl_table_new(count);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     cpl_table_new_column(model_error, <span class="stringliteral">"x"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_table_fill_column_window_double(model_error, <span class="stringliteral">"x"</span>, 0, count, 0.0);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     xdata = cpl_table_get_data_double(model_error, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="keywordflow">for</span> (i = 0; i < count; i++)</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>         xdata[i] = start + step*i - zero;</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>     p = mos_montecarlo_polyfit(points, model_error, trials, order);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         cpl_msg_error(recipe, <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         montecarlo_exit(NULL);</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>     }</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> </div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     <span class="keywordflow">for</span> (i = 0; i < count; i++)</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         xdata[i] += zero;</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> </div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     cpl_polynomial_delete(p); p = NULL;</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     cpl_table_delete(points); points = NULL;</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> </div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, model_error, model_error_tag, NULL,</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>         montecarlo_exit(NULL);</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> </div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     cpl_table_delete(model_error); model_error = NULL;</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> </div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/moses_8c-source.html b/html/moses_8c-source.html
deleted file mode 100644
index 4dfaf81..0000000
--- a/html/moses_8c-source.html
+++ /dev/null
@@ -1,16473 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: moses.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>moses.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: moses.c,v 1.100 2013/02/28 15:11:12 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the MOSES library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/02/28 15:11:12 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.100 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <stdio.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <string.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <unistd.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <math.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <time.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <moses.h></span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="comment">/* Prototypes */</span>
-<a name="l00043"></a>00043 <span class="keyword">static</span> cpl_polynomial *<a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a>(cpl_table *global, cpl_size row);
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 
-<a name="l00046"></a>00046 <span class="comment">/* Cheating: moving here the cpl_tools_get_median_float() prototype,</span>
-<a name="l00047"></a>00047 <span class="comment"> * even if cpl_tool.h is not public. It should be removed as soon as </span>
-<a name="l00048"></a>00048 <span class="comment"> * an image median filtering with generic kernel will be implemented</span>
-<a name="l00049"></a>00049 <span class="comment"> * in the CPL, or as soon as this module will be moved into the CPL. */</span>
-<a name="l00050"></a>00050 <span class="comment">/* FIXME: This has to be removed!! */</span>
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="keywordtype">float</span> cpl_tools_get_median_float(<span class="keywordtype">float</span> *, cpl_size);
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 <span class="preprocessor">#define MAX_COLNAME      (80)</span>
-<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#define STRETCH_FACTOR   (1.20)</span>
-<a name="l00056"></a>00056 <span class="preprocessor"></span>
-<a name="l00057"></a>00057 <span class="comment">// Related to mos_identify_peaks(), used in multiplex mode</span>
-<a name="l00058"></a>00058 
-<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">int</span> mos_multiplex   = -1;
-<a name="l00060"></a>00060 <span class="keyword">static</span> <span class="keywordtype">int</span> mos_region_size = 800;
-<a name="l00061"></a>00061 
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">double</span> default_lines_hi[] = {   <span class="comment">/* Default sky line catalog */</span>
-<a name="l00063"></a>00063                     5577.338,          <span class="comment">/* for high res data        */</span>
-<a name="l00064"></a>00064                     5889.953,
-<a name="l00065"></a>00065                     5895.923,
-<a name="l00066"></a>00066                     5915.301,
-<a name="l00067"></a>00067                     5932.862,
-<a name="l00068"></a>00068                     5953.420,
-<a name="l00069"></a>00069                     6257.961,
-<a name="l00070"></a>00070                     6287.434,
-<a name="l00071"></a>00071                     6300.304,
-<a name="l00072"></a>00072                     6306.869,
-<a name="l00073"></a>00073                     6363.780,
-<a name="l00074"></a>00074                     6498.729,
-<a name="l00075"></a>00075                     6533.044,
-<a name="l00076"></a>00076                     6553.617,
-<a name="l00077"></a>00077                     6841.945,
-<a name="l00078"></a>00078                     6863.955,
-<a name="l00079"></a>00079                     6870.994,
-<a name="l00080"></a>00080                     6889.288,
-<a name="l00081"></a>00081                     6900.833,
-<a name="l00082"></a>00082                     6912.623,
-<a name="l00083"></a>00083                     6923.220,
-<a name="l00084"></a>00084                     6939.521,
-<a name="l00085"></a>00085                     6969.930,
-<a name="l00086"></a>00086                     7003.858,
-<a name="l00087"></a>00087                     7244.907,
-<a name="l00088"></a>00088                     7276.405,
-<a name="l00089"></a>00089                     7284.439,
-<a name="l00090"></a>00090                     7316.282,
-<a name="l00091"></a>00091                     7329.148,
-<a name="l00092"></a>00092                     7340.885,
-<a name="l00093"></a>00093                     7358.659,
-<a name="l00094"></a>00094                     7571.746,
-<a name="l00095"></a>00095                     7750.640,
-<a name="l00096"></a>00096                     7759.996,
-<a name="l00097"></a>00097                     7794.112,
-<a name="l00098"></a>00098                     7808.467,
-<a name="l00099"></a>00099                     7821.503,
-<a name="l00100"></a>00100                     7841.266,
-<a name="l00101"></a>00101                     7913.708,
-<a name="l00102"></a>00102                     7949.204,
-<a name="l00103"></a>00103                     7964.650,
-<a name="l00104"></a>00104                     7993.332,
-<a name="l00105"></a>00105                     8014.059,
-<a name="l00106"></a>00106                     8310.719,
-<a name="l00107"></a>00107                     8344.602,
-<a name="l00108"></a>00108                     8382.392,
-<a name="l00109"></a>00109                     8399.170,
-<a name="l00110"></a>00110                     8415.231,
-<a name="l00111"></a>00111                     8430.174,
-<a name="l00112"></a>00112                     8452.250,
-<a name="l00113"></a>00113                     8493.389,
-<a name="l00114"></a>00114                     8791.186,
-<a name="l00115"></a>00115                     8827.096,
-<a name="l00116"></a>00116                     8885.850,
-<a name="l00117"></a>00117                     8903.114,
-<a name="l00118"></a>00118                     8943.395,
-<a name="l00119"></a>00119                     8988.366
-<a name="l00120"></a>00120                     };
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122 <span class="keyword">static</span> <span class="keywordtype">double</span> default_lines_lo[] = {   <span class="comment">/* Default sky line catalog */</span>
-<a name="l00123"></a>00123                     5577.338,          <span class="comment">/* for low res data         */</span>
-<a name="l00124"></a>00124                     6300.304,
-<a name="l00125"></a>00125                     6863.955,
-<a name="l00126"></a>00126                     7571.746,
-<a name="l00127"></a>00127                     7964.650,
-<a name="l00128"></a>00128                     7993.332
-<a name="l00129"></a>00129                     };
-<a name="l00130"></a>00130 
-<a name="l00131"></a>00131 
-<a name="l00141"></a>00141 <span class="comment">/*</span>
-<a name="l00142"></a>00142 <span class="comment"> * The following macros and function for finding the k-th smallest</span>
-<a name="l00143"></a>00143 <span class="comment"> * value on a float array will be accessible from cpl_tools once</span>
-<a name="l00144"></a>00144 <span class="comment"> * this module will be moved into the CPL.</span>
-<a name="l00145"></a>00145 <span class="comment"> */</span>
-<a name="l00146"></a>00146 
-<a name="l00147"></a>00147 <span class="comment">/****</span>
-<a name="l00148"></a>00148 <span class="comment"></span>
-<a name="l00149"></a>00149 <span class="comment">#define PIX_SWAP(a,b) { register float t=(a);(a)=(b);(b)=t; }</span>
-<a name="l00150"></a>00150 <span class="comment"></span>
-<a name="l00151"></a>00151 <span class="comment">static float kthSmallest(float a[], int n, int k)</span>
-<a name="l00152"></a>00152 <span class="comment">{</span>
-<a name="l00153"></a>00153 <span class="comment">  register int i,j,l,m;</span>
-<a name="l00154"></a>00154 <span class="comment">  register float x;</span>
-<a name="l00155"></a>00155 <span class="comment"></span>
-<a name="l00156"></a>00156 <span class="comment">  l = 0;</span>
-<a name="l00157"></a>00157 <span class="comment">  m = n-1;</span>
-<a name="l00158"></a>00158 <span class="comment">  while (l < m) {</span>
-<a name="l00159"></a>00159 <span class="comment">    x = a[k];</span>
-<a name="l00160"></a>00160 <span class="comment">    i = l;</span>
-<a name="l00161"></a>00161 <span class="comment">    j = m;</span>
-<a name="l00162"></a>00162 <span class="comment">    do {</span>
-<a name="l00163"></a>00163 <span class="comment">      while (a[i] < x) {</span>
-<a name="l00164"></a>00164 <span class="comment">        i++;</span>
-<a name="l00165"></a>00165 <span class="comment">      }</span>
-<a name="l00166"></a>00166 <span class="comment">      while (x < a[j]) {</span>
-<a name="l00167"></a>00167 <span class="comment">        j--;</span>
-<a name="l00168"></a>00168 <span class="comment">      }</span>
-<a name="l00169"></a>00169 <span class="comment">      if (i <= j) {</span>
-<a name="l00170"></a>00170 <span class="comment">        PIX_SWAP(a[i],a[j]);</span>
-<a name="l00171"></a>00171 <span class="comment">        i++;</span>
-<a name="l00172"></a>00172 <span class="comment">        j--;</span>
-<a name="l00173"></a>00173 <span class="comment">      }</span>
-<a name="l00174"></a>00174 <span class="comment">    } while (i <= j);</span>
-<a name="l00175"></a>00175 <span class="comment"></span>
-<a name="l00176"></a>00176 <span class="comment">    if (j < k) {</span>
-<a name="l00177"></a>00177 <span class="comment">      l = i;</span>
-<a name="l00178"></a>00178 <span class="comment">    }</span>
-<a name="l00179"></a>00179 <span class="comment">    if (k < i) {</span>
-<a name="l00180"></a>00180 <span class="comment">      m = j;</span>
-<a name="l00181"></a>00181 <span class="comment">    }</span>
-<a name="l00182"></a>00182 <span class="comment"></span>
-<a name="l00183"></a>00183 <span class="comment">  }</span>
-<a name="l00184"></a>00184 <span class="comment">  return(a[k]);</span>
-<a name="l00185"></a>00185 <span class="comment">}</span>
-<a name="l00186"></a>00186 <span class="comment"></span>
-<a name="l00187"></a>00187 <span class="comment">#define medianWirth(a, n) kthSmallest(a, n, (((n)&1) ? ((n)/2) : (((n)/2)-1)))</span>
-<a name="l00188"></a>00188 <span class="comment"></span>
-<a name="l00189"></a>00189 <span class="comment">****/</span>
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191 <span class="comment">/* </span>
-<a name="l00192"></a>00192 <span class="comment"> * Return random number with gaussian distribution (mean = 0, variance = 1)</span>
-<a name="l00193"></a>00193 <span class="comment"> * (Box-Mueller method). The mos_randg() argument is either true or false, </span>
-<a name="l00194"></a>00194 <span class="comment"> * indicating whether to "seed" or not the sequence of generated random </span>
-<a name="l00195"></a>00195 <span class="comment"> * numbers. The "seeding" is performed just at the first mos_randg(1) call, </span>
-<a name="l00196"></a>00196 <span class="comment"> * and at further calls the input argument is ignored. This function</span>
-<a name="l00197"></a>00197 <span class="comment"> * generates two random numbers at each call, returning the first one</span>
-<a name="l00198"></a>00198 <span class="comment"> * at odd calls, and the second one at even calls.</span>
-<a name="l00199"></a>00199 <span class="comment"> */</span>
-<a name="l00200"></a>00200 
-<a name="l00201"></a><a class="code" href="group__moses.html#ga5a1438d5952d296edd76f7049b06d34">00201</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="group__moses.html#ga5a1438d5952d296edd76f7049b06d34">mos_seed</a>(<span class="keywordtype">void</span>)
-<a name="l00202"></a>00202 {
-<a name="l00203"></a>00203     srand((<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)time((time_t *)0));
-<a name="l00204"></a>00204 }
-<a name="l00205"></a>00205 
-<a name="l00206"></a><a class="code" href="group__moses.html#g88ec5d9d020d274b54bdce340eef46c6">00206</a> <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g88ec5d9d020d274b54bdce340eef46c6">mos_randg</a>(<span class="keywordtype">int</span> seme)
-<a name="l00207"></a>00207 {
-<a name="l00208"></a>00208     <span class="keyword">static</span> <span class="keywordtype">int</span> doit = 1;
-<a name="l00209"></a>00209     <span class="keyword">static</span> <span class="keywordtype">int</span> gotit = 1;
-<a name="l00210"></a>00210     <span class="keywordtype">double</span> x1, x2, w, y1;
-<a name="l00211"></a>00211     <span class="keyword">static</span> <span class="keywordtype">double</span> y2;
-<a name="l00212"></a>00212 
-<a name="l00213"></a>00213     <span class="keywordflow">if</span> (gotit && seme) {
-<a name="l00214"></a>00214         <a class="code" href="group__moses.html#ga5a1438d5952d296edd76f7049b06d34">mos_seed</a>();
-<a name="l00215"></a>00215         gotit = 0;
-<a name="l00216"></a>00216     }
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     <span class="keywordflow">if</span> (doit) {
-<a name="l00219"></a>00219         doit = 0;
-<a name="l00220"></a>00220         <span class="keywordflow">do</span> {
-<a name="l00221"></a>00221             x1 = 2.0 * (double)rand() / RAND_MAX - 1.0;
-<a name="l00222"></a>00222             x2 = 2.0 * (double)rand() / RAND_MAX - 1.0;
-<a name="l00223"></a>00223             w = x1 * x1 + x2 * x2;
-<a name="l00224"></a>00224         } <span class="keywordflow">while</span> (w >= 1.0 || w == 0.0);
-<a name="l00225"></a>00225     
-<a name="l00226"></a>00226         w = sqrt( (-2.0 * log(w)) / w);
-<a name="l00227"></a>00227     
-<a name="l00228"></a>00228         y1 = x1 * w;
-<a name="l00229"></a>00229         y2 = x2 * w;
-<a name="l00230"></a>00230         <span class="keywordflow">return</span> y1;
-<a name="l00231"></a>00231     }
-<a name="l00232"></a>00232 
-<a name="l00233"></a>00233     doit = 1;
-<a name="l00234"></a>00234     <span class="keywordflow">return</span> y2;
-<a name="l00235"></a>00235 }
-<a name="l00236"></a>00236 
-<a name="l00237"></a>00237 <span class="comment">/* </span>
-<a name="l00238"></a>00238 <span class="comment"> * This function contained a dependency on the VIMOS library</span>
-<a name="l00239"></a>00239 <span class="comment"> * (function medianPixelvalue()): it should be removed as soon as an </span>
-<a name="l00240"></a>00240 <span class="comment"> * image median filtering with generic kernel will be implemented</span>
-<a name="l00241"></a>00241 <span class="comment"> * in the CPL. Currently it has been solved by a direct call to</span>
-<a name="l00242"></a>00242 <span class="comment"> * a cpl_tool function.</span>
-<a name="l00243"></a>00243 <span class="comment"> */</span>
-<a name="l00244"></a>00244 
-<a name="l00245"></a><a class="code" href="group__moses.html#gc69af4e18a5d0018e98bbea88dc4eaac">00245</a> <span class="keyword">static</span> cpl_image *<a class="code" href="group__moses.html#gc69af4e18a5d0018e98bbea88dc4eaac">mos_image_vertical_median_filter</a>(cpl_image *ima_in,
-<a name="l00246"></a>00246                                             <span class="keywordtype">int</span> filtsizey, <span class="keywordtype">int</span> refrow,
-<a name="l00247"></a>00247                                             <span class="keywordtype">int</span> above, <span class="keywordtype">int</span> below, <span class="keywordtype">int</span> step)
-<a name="l00248"></a>00248 {
-<a name="l00249"></a>00249 
-<a name="l00250"></a>00250   <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_image_general_median_filter"</span>;
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252   cpl_image  *filt_img = NULL;
-<a name="l00253"></a>00253   <span class="keywordtype">int</span>         col, row;
-<a name="l00254"></a>00254   <span class="keywordtype">float</span>      *buf = NULL;
-<a name="l00255"></a>00255   <span class="keywordtype">float</span>      *data;
-<a name="l00256"></a>00256   <span class="keywordtype">float</span>      *fdata;
-<a name="l00257"></a>00257   <span class="keywordtype">int</span>         upright_y, loleft_y;
-<a name="l00258"></a>00258   <span class="keywordtype">int</span>         j;
-<a name="l00259"></a>00259   <span class="keywordtype">int</span>         yIsEven = !(filtsizey - (filtsizey/2)*2);
-<a name="l00260"></a>00260   <span class="keywordtype">int</span>         f2y;
-<a name="l00261"></a>00261   <span class="keywordtype">int</span>         nx = cpl_image_get_size_x(ima_in);
-<a name="l00262"></a>00262   <span class="keywordtype">int</span>         ny = cpl_image_get_size_y(ima_in);
-<a name="l00263"></a>00263   <span class="keywordtype">int</span>         firstRow;
-<a name="l00264"></a>00264 
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266   <span class="keywordflow">if</span> (yIsEven) filtsizey++;
-<a name="l00267"></a>00267 
-<a name="l00268"></a>00268   <span class="keywordflow">if</span> (ny <= filtsizey) {
-<a name="l00269"></a>00269     cpl_msg_error(func, 
-<a name="l00270"></a>00270                   <span class="stringliteral">"Median filter size: %d, image size: %d"</span>, filtsizey, ny);
-<a name="l00271"></a>00271     <span class="keywordflow">return</span> NULL;
-<a name="l00272"></a>00272   }
-<a name="l00273"></a>00273 
-<a name="l00274"></a>00274   f2y = filtsizey / 2;
-<a name="l00275"></a>00275 
-<a name="l00276"></a>00276   filt_img = cpl_image_duplicate(ima_in);
-<a name="l00277"></a>00277   buf = cpl_malloc(filtsizey * <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));
-<a name="l00278"></a>00278   data = cpl_image_get_data(ima_in);
-<a name="l00279"></a>00279   fdata = cpl_image_get_data(filt_img);
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281   firstRow = refrow - step * (below / step);
-<a name="l00282"></a>00282   <span class="keywordflow">if</span> (firstRow < f2y)
-<a name="l00283"></a>00283     firstRow += step;
-<a name="l00284"></a>00284 
-<a name="l00285"></a>00285   <span class="keywordflow">for</span> (col = 0; col < nx; col++) {
-<a name="l00286"></a>00286     <span class="keywordflow">for</span> (row = firstRow; row < refrow + above; row += step) {
-<a name="l00287"></a>00287       <span class="keywordflow">if</span> (row >= ny - f2y)
-<a name="l00288"></a>00288         <span class="keywordflow">break</span>;
-<a name="l00289"></a>00289       loleft_y = row - f2y;
-<a name="l00290"></a>00290       upright_y = row + f2y + 1;
-<a name="l00291"></a>00291       <span class="keywordflow">for</span> (j = loleft_y; j < upright_y; j++)
-<a name="l00292"></a>00292         buf[j - loleft_y] = data[col + j * nx];
-<a name="l00293"></a>00293 
-<a name="l00294"></a>00294       fdata[col + row * nx] = cpl_tools_get_median_float(buf, filtsizey);
-<a name="l00295"></a>00295     }
-<a name="l00296"></a>00296   }
-<a name="l00297"></a>00297 
-<a name="l00298"></a>00298   cpl_free(buf);
-<a name="l00299"></a>00299 
-<a name="l00300"></a>00300   <span class="keywordflow">return</span> filt_img;
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302 }
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305 <span class="comment">/*</span>
-<a name="l00306"></a>00306 <span class="comment"> * The following static function is used to find an accurate position</span>
-<a name="l00307"></a>00307 <span class="comment"> * of a peak within a short interval (however at least 5 pixels long). </span>
-<a name="l00308"></a>00308 <span class="comment"> * The basic idea is to find the baricenter of all the pixel values </span>
-<a name="l00309"></a>00309 <span class="comment"> * that pass a threshold level between the median value and the maximum</span>
-<a name="l00310"></a>00310 <span class="comment"> * value within the examined interval (in case such levels are equal,</span>
-<a name="l00311"></a>00311 <span class="comment"> * the input is considered flat and no position is returned). At least</span>
-<a name="l00312"></a>00312 <span class="comment"> * minPoints must pass this threshold, or no position is computed. To</span>
-<a name="l00313"></a>00313 <span class="comment"> * evaluate the significance of the computed baricenter, the variance </span>
-<a name="l00314"></a>00314 <span class="comment"> * of the contributing positions (relative to the found baricenter) is </span>
-<a name="l00315"></a>00315 <span class="comment"> * also evaluated, and compared with the expected variance for a uniform </span>
-<a name="l00316"></a>00316 <span class="comment"> * distribution of positions. If the observed variance is greater than </span>
-<a name="l00317"></a>00317 <span class="comment"> * 80% of the variance of the uniform distribution, the found position </span>
-<a name="l00318"></a>00318 <span class="comment"> * is rejected.</span>
-<a name="l00319"></a>00319 <span class="comment"> */</span>
-<a name="l00320"></a>00320 
-<a name="l00321"></a><a class="code" href="group__moses.html#g56f03689ea7eaf37395dbb26a24e3fcf">00321</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g56f03689ea7eaf37395dbb26a24e3fcf">peakPosition</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *data, <span class="keywordtype">int</span> <a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>, <span class="keywordt [...]
-<a name="l00322"></a>00322                         <span class="keywordtype">int</span> minPoints)
-<a name="l00323"></a>00323 {
-<a name="l00324"></a>00324   <span class="keywordtype">int</span>    i;
-<a name="l00325"></a>00325   <span class="keywordtype">int</span>    count = 0;
-<a name="l00326"></a>00326   <span class="keywordtype">float</span> *copy;
-<a name="l00327"></a>00327   <span class="keywordtype">float</span>  max, median, level, pos, variance, uniformVariance;
-<a name="l00328"></a>00328   <span class="keywordtype">double</span> sum, weights;
-<a name="l00329"></a>00329 
-<a name="l00330"></a>00330 
-<a name="l00331"></a>00331   <span class="keywordflow">if</span> (data == NULL)
-<a name="l00332"></a>00332       <span class="keywordflow">return</span> 1;
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334   <span class="keywordflow">if</span> (size < 5)         <span class="comment">/* Hardcoded, I know... */</span>
-<a name="l00335"></a>00335       <span class="keywordflow">return</span> 1;
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338   <span class="comment">/*</span>
-<a name="l00339"></a>00339 <span class="comment">   *  Find median level</span>
-<a name="l00340"></a>00340 <span class="comment">   */</span>
-<a name="l00341"></a>00341 
-<a name="l00342"></a>00342   copy = (<span class="keywordtype">float</span> *) cpl_malloc(size*<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));
-<a name="l00343"></a>00343   <span class="keywordflow">for</span> (i = 0; i < size; i++)
-<a name="l00344"></a>00344       copy[i] = data[i];
-<a name="l00345"></a>00345   median = cpl_tools_get_median_float(copy, size);
-<a name="l00346"></a>00346   cpl_free(copy);
-<a name="l00347"></a>00347 
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349   <span class="comment">/*</span>
-<a name="l00350"></a>00350 <span class="comment">   *  Find max</span>
-<a name="l00351"></a>00351 <span class="comment">   */</span>
-<a name="l00352"></a>00352 
-<a name="l00353"></a>00353   max = data[0];
-<a name="l00354"></a>00354   <span class="keywordflow">for</span> (i = 1; i < size; i++)
-<a name="l00355"></a>00355       <span class="keywordflow">if</span> (data[i] > max)
-<a name="l00356"></a>00356           max = data[i];
-<a name="l00357"></a>00357 
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359   <span class="comment">/*</span>
-<a name="l00360"></a>00360 <span class="comment">   *  If the max equals the median we have a flat input, therefore</span>
-<a name="l00361"></a>00361 <span class="comment">   *  no peak is found.</span>
-<a name="l00362"></a>00362 <span class="comment">   */</span>
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364   <span class="keywordflow">if</span> (max-median < 0.00001)
-<a name="l00365"></a>00365       <span class="keywordflow">return</span> 1;
-<a name="l00366"></a>00366 
-<a name="l00367"></a>00367 
-<a name="l00368"></a>00368   <span class="comment">/*</span>
-<a name="l00369"></a>00369 <span class="comment">   *  Discrimination level: only pixels with values above this</span>
-<a name="l00370"></a>00370 <span class="comment">   *  level are considered in baricenter calculation.</span>
-<a name="l00371"></a>00371 <span class="comment">   */</span>
-<a name="l00372"></a>00372 
-<a name="l00373"></a>00373   level = (max + median) / 2;
-<a name="l00374"></a>00374 
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376   <span class="comment">/*</span>
-<a name="l00377"></a>00377 <span class="comment">   *  Of the values above this level compute the baricenter and</span>
-<a name="l00378"></a>00378 <span class="comment">   *  then the variance of the positions used. Note that the weights</span>
-<a name="l00379"></a>00379 <span class="comment">   *  are taken as the difference between the pixels values and</span>
-<a name="l00380"></a>00380 <span class="comment">   *  the median level (supposedly the background).</span>
-<a name="l00381"></a>00381 <span class="comment">   */</span>
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383   count = 0;
-<a name="l00384"></a>00384   <span class="keywordflow">for</span> (i = 0, sum = 0., weights = 0.; i < size; i++) {
-<a name="l00385"></a>00385       <span class="keywordflow">if</span> (data[i] > level) {
-<a name="l00386"></a>00386           count++;
-<a name="l00387"></a>00387           weights += (data[i] - median);
-<a name="l00388"></a>00388           sum     += i * (data[i] - median);
-<a name="l00389"></a>00389       }
-<a name="l00390"></a>00390   }
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393   <span class="comment">/*</span>
-<a name="l00394"></a>00394 <span class="comment">   *  If too few values are above threshold, refuse the position</span>
-<a name="l00395"></a>00395 <span class="comment">   *  as insignificant</span>
-<a name="l00396"></a>00396 <span class="comment">   */</span>
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398   <span class="keywordflow">if</span> (count < minPoints)
-<a name="l00399"></a>00399       <span class="keywordflow">return</span> 1;
-<a name="l00400"></a>00400 
-<a name="l00401"></a>00401   pos = sum / weights;
-<a name="l00402"></a>00402   <span class="keywordflow">for</span> (i = 0, sum = 0., weights = 0.; i < size; i++) {
-<a name="l00403"></a>00403       <span class="keywordflow">if</span> (data[i] > level) {
-<a name="l00404"></a>00404           weights++;
-<a name="l00405"></a>00405           sum += (i - pos) * (i - pos);
-<a name="l00406"></a>00406       }
-<a name="l00407"></a>00407   }
-<a name="l00408"></a>00408   variance = sqrt(sum / weights);
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410 
-<a name="l00411"></a>00411  <span class="comment">/*</span>
-<a name="l00412"></a>00412 <span class="comment">  *  The "uniform variance" is the variance that should be obtained</span>
-<a name="l00413"></a>00413 <span class="comment">  *  in the case of uniform distribution of the points positions in</span>
-<a name="l00414"></a>00414 <span class="comment">  *  the selected interval. If the real variance is comparable with</span>
-<a name="l00415"></a>00415 <span class="comment">  *  this value, the peak is considered not found.</span>
-<a name="l00416"></a>00416 <span class="comment">  */</span>
-<a name="l00417"></a>00417 
-<a name="l00418"></a>00418   uniformVariance = sqrt(size*size/3 - pos*size + pos*pos);
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420   <span class="keywordflow">if</span> (variance > 0.8 * uniformVariance)
-<a name="l00421"></a>00421       <span class="keywordflow">return</span> 1;
-<a name="l00422"></a>00422 
-<a name="l00423"></a>00423   *position = pos + 0.5;
-<a name="l00424"></a>00424 
-<a name="l00425"></a>00425   <span class="keywordflow">return</span> 0;
-<a name="l00426"></a>00426 }
-<a name="l00427"></a>00427 
-<a name="l00428"></a>00428 
-<a name="l00429"></a>00429 <span class="comment">/*</span>
-<a name="l00430"></a>00430 <span class="comment"> *  The following static function determines the quantity dx to be</span>
-<a name="l00431"></a>00431 <span class="comment"> *  added to the position of the highest pixel of a fiber profile,</span>
-<a name="l00432"></a>00432 <span class="comment"> *  to get the true position of the profile maximum. All is needed</span>
-<a name="l00433"></a>00433 <span class="comment"> *  is the maximum observed value v2 in the profile, and the observed</span>
-<a name="l00434"></a>00434 <span class="comment"> *  values v1 and v3 of the previous and the next pixels in the profile.</span>
-<a name="l00435"></a>00435 <span class="comment"> *  </span>
-<a name="l00436"></a>00436 <span class="comment"> *  The following ratio is defined:</span>
-<a name="l00437"></a>00437 <span class="comment"> *  </span>
-<a name="l00438"></a>00438 <span class="comment"> *      R = 0.5 (v3 - v1) / (2*v2 - v3 - v1)</span>
-<a name="l00439"></a>00439 <span class="comment"> *      </span>
-<a name="l00440"></a>00440 <span class="comment"> *  This is a conventional ratio that wouldn't diverge for any set of</span>
-<a name="l00441"></a>00441 <span class="comment"> *  pixel values, and that would not depend on the presence of background</span>
-<a name="l00442"></a>00442 <span class="comment"> *  (with the assumption that the background level is the same for the </span>
-<a name="l00443"></a>00443 <span class="comment"> *  three pixels). R has also been chosen in such a way that its value</span>
-<a name="l00444"></a>00444 <span class="comment"> *  is already quite close to the real dx. It should be noted that the</span>
-<a name="l00445"></a>00445 <span class="comment"> *  following condition should be fulfilled:</span>
-<a name="l00446"></a>00446 <span class="comment"> *</span>
-<a name="l00447"></a>00447 <span class="comment"> *           v1  <= v2   and   v3  <  v2</span>
-<a name="l00448"></a>00448 <span class="comment"> *  or</span>
-<a name="l00449"></a>00449 <span class="comment"> *           v1  <  v2   and   v3  <=  v2</span>
-<a name="l00450"></a>00450 <span class="comment"> *</span>
-<a name="l00451"></a>00451 <span class="comment"> *  This implies that dx varies between -0.5 and 0.5 pixels. In such</span>
-<a name="l00452"></a>00452 <span class="comment"> *  boundary cases, one has:</span>
-<a name="l00453"></a>00453 <span class="comment"> *</span>
-<a name="l00454"></a>00454 <span class="comment"> *           v2 = v1   and   R = dx = -0.5</span>
-<a name="l00455"></a>00455 <span class="comment"> *           v2 = v3   and   R = dx =  0.5</span>
-<a name="l00456"></a>00456 <span class="comment"> *</span>
-<a name="l00457"></a>00457 <span class="comment"> *  Another special case is when the observed pixel values are perfectly</span>
-<a name="l00458"></a>00458 <span class="comment"> *  symmetrical:</span>
-<a name="l00459"></a>00459 <span class="comment"> *</span>
-<a name="l00460"></a>00460 <span class="comment"> *           v1 = v3   and   R = dx =  0.0</span>
-<a name="l00461"></a>00461 <span class="comment"> *</span>
-<a name="l00462"></a>00462 <span class="comment"> *  In all the intermediate cases the relation between R and dx depends</span>
-<a name="l00463"></a>00463 <span class="comment"> *  on the shape of the fiber profile, that has been determined elsewhere.</span>
-<a name="l00464"></a>00464 <span class="comment"> *  Using the accurate reconstruction of the fiber profile obtained by </span>
-<a name="l00465"></a>00465 <span class="comment"> *  the *  functions ifuProfile() and rebinProfile(), it can be shown </span>
-<a name="l00466"></a>00466 <span class="comment"> *  that R differs from dx always less than 0.01 pixels. If the condition</span>
-<a name="l00467"></a>00467 <span class="comment"> *</span>
-<a name="l00468"></a>00468 <span class="comment"> *           v1  <= v2   and   v3  <  v2</span>
-<a name="l00469"></a>00469 <span class="comment"> *  or</span>
-<a name="l00470"></a>00470 <span class="comment"> *           v1  <  v2   and   v3  <=  v2</span>
-<a name="l00471"></a>00471 <span class="comment"> *</span>
-<a name="l00472"></a>00472 <span class="comment"> *  is not fulfilled, then this function returns the value 2.0.</span>
-<a name="l00473"></a>00473 <span class="comment"> */</span>
-<a name="l00474"></a>00474 
-<a name="l00475"></a><a class="code" href="group__moses.html#g31da70ff15f996bd4022c26b534c88eb">00475</a> <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g31da70ff15f996bd4022c26b534c88eb">values_to_dx</a>(<span class="keywordtype">double</span> v1, <span class="keywordtype">double</span> v2, <span class="keywordtype">double</span> v3)
-<a name="l00476"></a>00476 {
-<a name="l00477"></a>00477 
-<a name="l00478"></a>00478   <span class="keyword">static</span> <span class="keywordtype">double</span> epsilon = 0.00000001;
-<a name="l00479"></a>00479   <span class="keywordtype">double</span>        r       = 2.0;
-<a name="l00480"></a>00480 
-<a name="l00481"></a>00481 
-<a name="l00482"></a>00482   <span class="keywordflow">if</span> (v1 > v2 || v3 > v2)
-<a name="l00483"></a>00483     <span class="keywordflow">return</span> r;
-<a name="l00484"></a>00484 
-<a name="l00485"></a>00485   <span class="keywordflow">if</span> (2 * v2 - v1 - v3 < epsilon)
-<a name="l00486"></a>00486     <span class="keywordflow">return</span> r;
-<a name="l00487"></a>00487 
-<a name="l00488"></a>00488   r = 0.5 * (v3 - v1) / (2 * v2 - v3 - v1);
-<a name="l00489"></a>00489 
-<a name="l00490"></a>00490   <span class="keywordflow">return</span> r;
-<a name="l00491"></a>00491 
-<a name="l00492"></a>00492 }
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494 
-<a name="l00495"></a>00495 <span class="comment">/*</span>
-<a name="l00496"></a>00496 <span class="comment"> * The following static function passes a min filter of given box</span>
-<a name="l00497"></a>00497 <span class="comment"> * size on the data buffer. The box size must be a positive odd integer.</span>
-<a name="l00498"></a>00498 <span class="comment"> */</span>
-<a name="l00499"></a>00499 
-<a name="l00500"></a><a class="code" href="group__moses.html#g37533cd641acd9d0c7430cb84928c7dd">00500</a> <span class="keyword">static</span> <span class="keywordtype">float</span> *<a class="code" href="group__moses.html#g37533cd641acd9d0c7430cb84928c7dd">min_filter</a>(<span class="keywordtype">float</span> *buffer, <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> <a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>)
-<a name="l00501"></a>00501 {
-<a name="l00502"></a>00502     <span class="keywordtype">float</span> *minf  = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));
-<a name="l00503"></a>00503     <span class="keywordtype">float</span>  min;
-<a name="l00504"></a>00504     <span class="keywordtype">int</span>    start = size / 2;
-<a name="l00505"></a>00505     <span class="keywordtype">int</span>    end   = length - size / 2;
-<a name="l00506"></a>00506     <span class="keywordtype">int</span>    i, j;
-<a name="l00507"></a>00507 
-<a name="l00508"></a>00508 
-<a name="l00509"></a>00509     <span class="keywordflow">for</span> (i = start; i < end; i++) {
-<a name="l00510"></a>00510         min = buffer[i-start];
-<a name="l00511"></a>00511         <span class="keywordflow">for</span> (j = i - start + 1; j <= i + start; j++)
-<a name="l00512"></a>00512             <span class="keywordflow">if</span> (min > buffer[j])
-<a name="l00513"></a>00513                 min = buffer[j];
-<a name="l00514"></a>00514         minf[i] = min;
-<a name="l00515"></a>00515     }
-<a name="l00516"></a>00516 
-<a name="l00517"></a>00517     <span class="keywordflow">for</span> (i = 0; i < start; i++)
-<a name="l00518"></a>00518         minf[i] = minf[start];
-<a name="l00519"></a>00519 
-<a name="l00520"></a>00520     <span class="keywordflow">for</span> (i = end; i < length; i++)
-<a name="l00521"></a>00521         minf[i] = minf[end-1];
-<a name="l00522"></a>00522 
-<a name="l00523"></a>00523     <span class="keywordflow">return</span> minf;
-<a name="l00524"></a>00524 }
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526 
-<a name="l00527"></a>00527 <span class="comment">/*</span>
-<a name="l00528"></a>00528 <span class="comment"> * The following static function passes a max filter of given box</span>
-<a name="l00529"></a>00529 <span class="comment"> * size on the data buffer. The box size must be a positive odd integer.</span>
-<a name="l00530"></a>00530 <span class="comment"> */</span>
-<a name="l00531"></a>00531  
-<a name="l00532"></a><a class="code" href="group__moses.html#g8edb697b1f18f2e19c4811af46ad169a">00532</a> <span class="keyword">static</span> <span class="keywordtype">float</span> *<a class="code" href="group__fors__image.html#g167f96e092eeb578086febe4b86d6df9">max_filter</a>(<span class="keywordtype">float</span> *buffer, <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> <a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>)
-<a name="l00533"></a>00533 {
-<a name="l00534"></a>00534     <span class="keywordtype">float</span> *maxf  = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));
-<a name="l00535"></a>00535     <span class="keywordtype">float</span>  max;
-<a name="l00536"></a>00536     <span class="keywordtype">int</span>    start = size / 2;
-<a name="l00537"></a>00537     <span class="keywordtype">int</span>    end   = length - size / 2;
-<a name="l00538"></a>00538     <span class="keywordtype">int</span>    i, j;
-<a name="l00539"></a>00539 
-<a name="l00540"></a>00540 
-<a name="l00541"></a>00541     <span class="keywordflow">for</span> (i = start; i < end; i++) {
-<a name="l00542"></a>00542         max = buffer[i-start];
-<a name="l00543"></a>00543         <span class="keywordflow">for</span> (j = i - start + 1; j <= i + start; j++)
-<a name="l00544"></a>00544             <span class="keywordflow">if</span> (max < buffer[j])
-<a name="l00545"></a>00545                 max = buffer[j];
-<a name="l00546"></a>00546         maxf[i] = max;
-<a name="l00547"></a>00547     }
-<a name="l00548"></a>00548 
-<a name="l00549"></a>00549     <span class="keywordflow">for</span> (i = 0; i < start; i++)
-<a name="l00550"></a>00550         maxf[i] = maxf[start];
-<a name="l00551"></a>00551 
-<a name="l00552"></a>00552     <span class="keywordflow">for</span> (i = end; i < length; i++)
-<a name="l00553"></a>00553         maxf[i] = maxf[end-1];
-<a name="l00554"></a>00554 
-<a name="l00555"></a>00555     <span class="keywordflow">return</span> maxf;
-<a name="l00556"></a>00556 }
-<a name="l00557"></a>00557 
-<a name="l00558"></a>00558 
-<a name="l00559"></a>00559 <span class="comment">/*</span>
-<a name="l00560"></a>00560 <span class="comment"> * The following static function passes a running average of given box</span>
-<a name="l00561"></a>00561 <span class="comment"> * size on the data buffer. The box size must be a positive odd integer.</span>
-<a name="l00562"></a>00562 <span class="comment"> */</span>
-<a name="l00563"></a>00563  
-<a name="l00564"></a><a class="code" href="group__moses.html#g243ac41000f8b1965fadac747928ad05">00564</a> <span class="keyword">static</span> <span class="keywordtype">float</span> *<a class="code" href="group__moses.html#g243ac41000f8b1965fadac747928ad05">smo_filter</a>(<span class="keywordtype">float</span> *buffer, <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> <a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>)
-<a name="l00565"></a>00565 {
-<a name="l00566"></a>00566     <span class="keywordtype">float</span> *smof  = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));
-<a name="l00567"></a>00567     <span class="keywordtype">double</span> sum;
-<a name="l00568"></a>00568     <span class="keywordtype">int</span>    start = size / 2;
-<a name="l00569"></a>00569     <span class="keywordtype">int</span>    end   = length - size / 2;
-<a name="l00570"></a>00570     <span class="keywordtype">int</span>    i, j;
-<a name="l00571"></a>00571 
-<a name="l00572"></a>00572 
-<a name="l00573"></a>00573     <span class="keywordflow">for</span> (i = start; i < end; i++) {
-<a name="l00574"></a>00574         sum = 0.0;
-<a name="l00575"></a>00575         <span class="keywordflow">for</span> (j = i - start; j <= i + start; j++)
-<a name="l00576"></a>00576             sum += buffer[j];
-<a name="l00577"></a>00577         smof[i] = sum / size;
-<a name="l00578"></a>00578     }
-<a name="l00579"></a>00579 
-<a name="l00580"></a>00580     <span class="keywordflow">for</span> (i = 0; i < start; i++)
-<a name="l00581"></a>00581         smof[i] = smof[start];
-<a name="l00582"></a>00582 
-<a name="l00583"></a>00583     <span class="keywordflow">for</span> (i = end; i < length; i++)
-<a name="l00584"></a>00584         smof[i] = smof[end-1];
-<a name="l00585"></a>00585 
-<a name="l00586"></a>00586     <span class="keywordflow">return</span> smof;
-<a name="l00587"></a>00587 }
-<a name="l00588"></a>00588 
-<a name="l00589"></a>00589 <span class="comment">/*</span>
-<a name="l00590"></a>00590 <span class="comment"> * The following two static functions are used to read and write from the </span>
-<a name="l00591"></a>00591 <span class="comment"> * global distortion table the different model components. Conventionally</span>
-<a name="l00592"></a>00592 <span class="comment"> * the table consists of 6 columns and 10 rows. Each row is just ordered </span>
-<a name="l00593"></a>00593 <span class="comment"> * storage for model coefficients, and these functions guarantee that the</span>
-<a name="l00594"></a>00594 <span class="comment"> * coefficients are read in and written out correctly, independent on their</span>
-<a name="l00595"></a>00595 <span class="comment"> * physical meaning. The first 6 table rows are a description of the IDS</span>
-<a name="l00596"></a>00596 <span class="comment"> * coefficients, followed by a row containing only the used reference </span>
-<a name="l00597"></a>00597 <span class="comment"> * wavelength. The remaining 3 are a description of the spectral curvature.</span>
-<a name="l00598"></a>00598 <span class="comment"> * The first row is a description of coefficient c0, the second of coefficient</span>
-<a name="l00599"></a>00599 <span class="comment"> * c1, etc., of the IDS. The 8th row is a description of coefficient c0,</span>
-<a name="l00600"></a>00600 <span class="comment"> * the 9th of coefficient c1, etc., of the spectral curvature. All are</span>
-<a name="l00601"></a>00601 <span class="comment"> * bivariate polynomialx on x,y mask coordinates. If the input table</span>
-<a name="l00602"></a>00602 <span class="comment"> * to the write routine is NULL, it is allocated and initialised. Also</span>
-<a name="l00603"></a>00603 <span class="comment"> * the input polynomial could be NULL, and nothing would be written to </span>
-<a name="l00604"></a>00604 <span class="comment"> * the table. If both pointers are NULL the function is basically a</span>
-<a name="l00605"></a>00605 <span class="comment"> * constructor of the global distortion table.</span>
-<a name="l00606"></a>00606 <span class="comment"> */</span>
-<a name="l00607"></a>00607 
-<a name="l00608"></a><a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">00608</a> <span class="keyword">static</span> cpl_polynomial *<a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a>(cpl_table *global, cpl_size row)
-<a name="l00609"></a>00609 {
-<a name="l00610"></a>00610     cpl_polynomial *poly = NULL;
-<a name="l00611"></a>00611     cpl_size        p[2];
-<a name="l00612"></a>00612     cpl_size        degree = 2;
-<a name="l00613"></a>00613     <span class="keywordtype">int</span>             null;
-<a name="l00614"></a>00614     <span class="keywordtype">double</span>          coeff;
-<a name="l00615"></a>00615 
-<a name="l00616"></a>00616     <span class="keywordtype">char</span>   name[MAX_COLNAME];
-<a name="l00617"></a>00617 
-<a name="l00618"></a>00618 
-<a name="l00619"></a>00619     <span class="keywordflow">for</span> (p[0] = 0; p[0] <= degree; p[0]++) {
-<a name="l00620"></a>00620         <span class="keywordflow">for</span> (p[1] = 0; p[1] <= degree - p[0]; p[1]++) {
-<a name="l00621"></a>00621             snprintf(name, MAX_COLNAME, <span class="stringliteral">"a%"</span>CPL_SIZE_FORMAT<span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">""</span>, p[0], p[1]);
-<a name="l00622"></a>00622             coeff = cpl_table_get_double(global, name, row, &null);
-<a name="l00623"></a>00623             <span class="keywordflow">if</span> (null)
-<a name="l00624"></a>00624                 <span class="keywordflow">continue</span>;
-<a name="l00625"></a>00625             <span class="keywordflow">if</span> (poly == NULL)
-<a name="l00626"></a>00626                 poly = cpl_polynomial_new(2);
-<a name="l00627"></a>00627             cpl_polynomial_set_coeff(poly, p, coeff);
-<a name="l00628"></a>00628         }
-<a name="l00629"></a>00629     }
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631     <span class="keywordflow">return</span> poly;
-<a name="l00632"></a>00632 }
-<a name="l00633"></a>00633 
-<a name="l00634"></a><a class="code" href="group__moses.html#g3ad10f4436b713a1e3e3296f3fc0e1a0">00634</a> <span class="keyword">static</span> cpl_table *<a class="code" href="group__moses.html#g3ad10f4436b713a1e3e3296f3fc0e1a0">write_global_distortion</a>(cpl_table *global, <span class="keywordtype">int</span> row, 
-<a name="l00635"></a>00635                                           cpl_polynomial *poly)
-<a name="l00636"></a>00636 {
-<a name="l00637"></a>00637     cpl_table *table;
-<a name="l00638"></a>00638     cpl_size   p[2];
-<a name="l00639"></a>00639     cpl_size   degree = 2;
-<a name="l00640"></a>00640     <span class="keywordtype">int</span>        nrow = 10;
-<a name="l00641"></a>00641 
-<a name="l00642"></a>00642     <span class="keywordtype">char</span>       name[MAX_COLNAME];
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644 
-<a name="l00645"></a>00645     <span class="keywordflow">if</span> (global) {
-<a name="l00646"></a>00646         table = global;
-<a name="l00647"></a>00647     }
-<a name="l00648"></a>00648     <span class="keywordflow">else</span> {
-<a name="l00649"></a>00649         table = cpl_table_new(nrow);
-<a name="l00650"></a>00650         <span class="keywordflow">for</span> (p[0] = 0; p[0] <= degree; p[0]++) {
-<a name="l00651"></a>00651             <span class="keywordflow">for</span> (p[1] = 0; p[1] <= degree - p[0]; p[1]++) {
-<a name="l00652"></a>00652                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"a%"</span>CPL_SIZE_FORMAT<span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">""</span>, p[0], p[1]);
-<a name="l00653"></a>00653                 cpl_table_new_column(table, name, CPL_TYPE_DOUBLE);
-<a name="l00654"></a>00654             }
-<a name="l00655"></a>00655         }
-<a name="l00656"></a>00656     }
-<a name="l00657"></a>00657 
-<a name="l00658"></a>00658     <span class="keywordflow">if</span> (poly) {
-<a name="l00659"></a>00659         <span class="keywordflow">for</span> (p[0] = 0; p[0] <= degree; p[0]++) {
-<a name="l00660"></a>00660             <span class="keywordflow">for</span> (p[1] = 0; p[1] <= degree - p[0]; p[1]++) {
-<a name="l00661"></a>00661                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"a%"</span>CPL_SIZE_FORMAT<span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">""</span>, p[0], p[1]);
-<a name="l00662"></a>00662                 cpl_table_set_double(table, name, row, 
-<a name="l00663"></a>00663                                      cpl_polynomial_get_coeff(poly, p));
-<a name="l00664"></a>00664             }
-<a name="l00665"></a>00665         }
-<a name="l00666"></a>00666     }
-<a name="l00667"></a>00667 
-<a name="l00668"></a>00668     <span class="keywordflow">return</span> table;
-<a name="l00669"></a>00669 }
-<a name="l00670"></a>00670 
-<a name="l00671"></a>00671 
-<a name="l00672"></a>00672 <span class="comment">/*</span>
-<a name="l00673"></a>00673 <span class="comment"> * The following static function is performing a robust linear fit</span>
-<a name="l00674"></a>00674 <span class="comment"> * (drawn from the VIMOS library, and originally from ESO-Eclipse).</span>
-<a name="l00675"></a>00675 <span class="comment"> *</span>
-<a name="l00676"></a>00676 <span class="comment"> *  ----> y = a + b * x</span>
-<a name="l00677"></a>00677 <span class="comment"> *</span>
-<a name="l00678"></a>00678 <span class="comment"> * This function return 0 on success.</span>
-<a name="l00679"></a>00679 <span class="comment"> */</span>
-<a name="l00680"></a>00680 
-<a name="l00681"></a><a class="code" href="group__moses.html#g438a2d8f2768c20dde2cfdf609bad6f1">00681</a> <span class="preprocessor">#define SEGNO(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))</span>
-<a name="l00682"></a><a class="code" href="group__moses.html#g4b6606e2a44434b722cb25862567e4ff">00682</a> <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g4b6606e2a44434b722cb25862567e4ff">robustLinearFit</a>(cpl_bivector *<a class="code" href="structlist.html">list</a>, <span class="keywordtype">double</span> *a, <span class="keywordtype">double</span> *b, 
-<a name="l00683"></a>00683                            <span class="keywordtype">double</span> *abdev)
-<a name="l00684"></a>00684 {
-<a name="l00685"></a>00685     cpl_vector *vx;
-<a name="l00686"></a>00686     cpl_vector *vy;
-<a name="l00687"></a>00687     cpl_vector *va;
-<a name="l00688"></a>00688 
-<a name="l00689"></a>00689     <span class="keywordtype">double</span>  aa, bb, bcomp, b1, b2, del, abdevt, f, f1, f2, sigb, temp, d, sum;
-<a name="l00690"></a>00690     <span class="keywordtype">double</span>  sx, sy, sxy, sxx, chisq;
-<a name="l00691"></a>00691     <span class="keywordtype">double</span> *arr;
-<a name="l00692"></a>00692     <span class="keywordtype">double</span>  aa_ls, bb_ls;
-<a name="l00693"></a>00693     <span class="keywordtype">double</span> *x;
-<a name="l00694"></a>00694     <span class="keywordtype">double</span> *y;
-<a name="l00695"></a>00695     <span class="keywordtype">int</span>     np;
-<a name="l00696"></a>00696     <span class="keywordtype">int</span>     iter;
-<a name="l00697"></a>00697     <span class="keywordtype">int</span>     max_iterate = 30;
-<a name="l00698"></a>00698     <span class="keywordtype">int</span>     i;
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700 
-<a name="l00701"></a>00701     np = cpl_bivector_get_size(list);
-<a name="l00702"></a>00702     vx = cpl_bivector_get_x(list);
-<a name="l00703"></a>00703     vy = cpl_bivector_get_y(list);
-<a name="l00704"></a>00704     x = cpl_vector_get_data(vx);
-<a name="l00705"></a>00705     y = cpl_vector_get_data(vy);
-<a name="l00706"></a>00706 
-<a name="l00707"></a>00707     sx = sy = sxx = sxy = 0.00;
-<a name="l00708"></a>00708     <span class="keywordflow">for</span> (i = 0; i < np; i++) {
-<a name="l00709"></a>00709         sx  += x[i];
-<a name="l00710"></a>00710         sy  += y[i];
-<a name="l00711"></a>00711         sxy += x[i] * y[i];
-<a name="l00712"></a>00712         sxx += x[i] * x[i];
-<a name="l00713"></a>00713     }
-<a name="l00714"></a>00714 
-<a name="l00715"></a>00715     del = np * sxx - sx * sx;
-<a name="l00716"></a>00716     aa_ls = aa = (sxx * sy - sx * sxy) / del;
-<a name="l00717"></a>00717     bb_ls = bb = (np * sxy - sx * sy) / del;
-<a name="l00718"></a>00718 
-<a name="l00719"></a>00719     chisq = 0.00;
-<a name="l00720"></a>00720     <span class="keywordflow">for</span> (i = 0; i < np; i++) {
-<a name="l00721"></a>00721         temp = y[i] - (aa+bb*x[i]);
-<a name="l00722"></a>00722         temp *= temp;
-<a name="l00723"></a>00723         chisq += temp;
-<a name="l00724"></a>00724     }
-<a name="l00725"></a>00725 
-<a name="l00726"></a>00726     va = cpl_vector_new(np);
-<a name="l00727"></a>00727     arr = cpl_vector_get_data(va);
-<a name="l00728"></a>00728     sigb = sqrt(chisq/del);
-<a name="l00729"></a>00729     b1 = bb;
-<a name="l00730"></a>00730 
-<a name="l00731"></a>00731     bcomp = b1;
-<a name="l00732"></a>00732     sum = 0.00;
-<a name="l00733"></a>00733     <span class="keywordflow">for</span> (i = 0; i < np; i++) {
-<a name="l00734"></a>00734         arr[i] = y[i] - bcomp * x[i];
-<a name="l00735"></a>00735     }
-<a name="l00736"></a>00736     aa = cpl_vector_get_median_const(va);
-<a name="l00737"></a>00737     abdevt = 0.0;
-<a name="l00738"></a>00738     <span class="keywordflow">for</span> (i = 0; i < np; i++) {
-<a name="l00739"></a>00739         d = y[i] - (bcomp * x[i] + aa);
-<a name="l00740"></a>00740         abdevt += fabs(d);
-<a name="l00741"></a>00741         <span class="keywordflow">if</span> (y[i] != 0.0) 
-<a name="l00742"></a>00742             d /= fabs(y[i]);
-<a name="l00743"></a>00743         <span class="keywordflow">if</span> (fabs(d) > 1e-7) 
-<a name="l00744"></a>00744             sum += (d >= 0.0 ? x[i] : -x[i]);
-<a name="l00745"></a>00745     }
-<a name="l00746"></a>00746     f1 = sum;
-<a name="l00747"></a>00747 
-<a name="l00748"></a>00748     b2 = bb + <a class="code" href="group__moses.html#g438a2d8f2768c20dde2cfdf609bad6f1">SEGNO</a>(3.0 * sigb, f1);
-<a name="l00749"></a>00749 
-<a name="l00750"></a>00750     bcomp = b2;
-<a name="l00751"></a>00751     sum = 0.00;
-<a name="l00752"></a>00752     <span class="keywordflow">for</span> (i = 0; i < np; i++) {
-<a name="l00753"></a>00753         arr[i] = y[i] - bcomp * x[i];
-<a name="l00754"></a>00754     }
-<a name="l00755"></a>00755     aa = cpl_vector_get_median_const(va);
-<a name="l00756"></a>00756     abdevt = 0.0;
-<a name="l00757"></a>00757     <span class="keywordflow">for</span> (i = 0; i < np; i++) {
-<a name="l00758"></a>00758         d = y[i] - (bcomp * x[i] + aa);
-<a name="l00759"></a>00759         abdevt += fabs(d);
-<a name="l00760"></a>00760         <span class="keywordflow">if</span> (y[i] != 0.0) 
-<a name="l00761"></a>00761             d /= fabs(y[i]);
-<a name="l00762"></a>00762         <span class="keywordflow">if</span> (fabs(d) > 1e-7) 
-<a name="l00763"></a>00763             sum += (d >= 0.0 ? x[i] : -x[i]);
-<a name="l00764"></a>00764     }
-<a name="l00765"></a>00765     f2 = sum;
-<a name="l00766"></a>00766 
-<a name="l00767"></a>00767     <span class="keywordflow">if</span> (fabs(b2-b1)<1e-7) {
-<a name="l00768"></a>00768         *a = aa;
-<a name="l00769"></a>00769         *b = bb;
-<a name="l00770"></a>00770         *abdev = abdevt / (double)np;
-<a name="l00771"></a>00771         cpl_vector_delete(va);
-<a name="l00772"></a>00772         <span class="keywordflow">return</span> 0;
-<a name="l00773"></a>00773     }
-<a name="l00774"></a>00774 
-<a name="l00775"></a>00775     iter = 0;
-<a name="l00776"></a>00776     <span class="keywordflow">while</span> (f1*f2 > 0.0) {
-<a name="l00777"></a>00777         bb = 2.0*b2-b1;
-<a name="l00778"></a>00778         b1 = b2;
-<a name="l00779"></a>00779         f1 = f2;
-<a name="l00780"></a>00780         b2 = bb;
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782         bcomp = b2;
-<a name="l00783"></a>00783         sum = 0.00;
-<a name="l00784"></a>00784         <span class="keywordflow">for</span> (i = 0; i < np; i++) {
-<a name="l00785"></a>00785             arr[i] = y[i] - bcomp * x[i];
-<a name="l00786"></a>00786         }
-<a name="l00787"></a>00787         aa = cpl_vector_get_median_const(va);
-<a name="l00788"></a>00788         abdevt = 0.0;
-<a name="l00789"></a>00789         <span class="keywordflow">for</span> (i = 0; i < np; i++) {
-<a name="l00790"></a>00790             d = y[i] - (bcomp * x[i] + aa);
-<a name="l00791"></a>00791             abdevt += fabs(d);
-<a name="l00792"></a>00792             <span class="keywordflow">if</span> (y[i] != 0.0) 
-<a name="l00793"></a>00793                 d /= fabs(y[i]);
-<a name="l00794"></a>00794             <span class="keywordflow">if</span> (fabs(d) > 1e-7) 
-<a name="l00795"></a>00795                 sum += (d >= 0.0 ? x[i] : -x[i]);
-<a name="l00796"></a>00796         }
-<a name="l00797"></a>00797         f2 = sum;
-<a name="l00798"></a>00798         iter++;
-<a name="l00799"></a>00799         <span class="keywordflow">if</span> (iter >= max_iterate) 
-<a name="l00800"></a>00800             <span class="keywordflow">break</span>;
-<a name="l00801"></a>00801     }
-<a name="l00802"></a>00802     <span class="keywordflow">if</span> (iter >= max_iterate) {
-<a name="l00803"></a>00803         *a = aa_ls;
-<a name="l00804"></a>00804         *b = bb_ls;
-<a name="l00805"></a>00805         *abdev = -1.0;
-<a name="l00806"></a>00806         cpl_vector_delete(va);
-<a name="l00807"></a>00807         <span class="keywordflow">return</span> 1;
-<a name="l00808"></a>00808     }
-<a name="l00809"></a>00809 
-<a name="l00810"></a>00810     sigb = 0.01 * sigb;
-<a name="l00811"></a>00811     <span class="keywordflow">while</span> (fabs(b2-b1) > sigb) {
-<a name="l00812"></a>00812         bb = 0.5 * (b1 + b2);
-<a name="l00813"></a>00813         <span class="keywordflow">if</span> ((fabs(bb-b1) < 1e-7) || (fabs(bb-b2) < 1e-7)) 
-<a name="l00814"></a>00814             <span class="keywordflow">break</span>;
-<a name="l00815"></a>00815         bcomp = bb;
-<a name="l00816"></a>00816         sum = 0.0;
-<a name="l00817"></a>00817         <span class="keywordflow">for</span> (i = 0; i < np; i++) {
-<a name="l00818"></a>00818             arr[i] = y[i] - bcomp * x[i];
-<a name="l00819"></a>00819         }
-<a name="l00820"></a>00820         aa = cpl_vector_get_median_const(va);
-<a name="l00821"></a>00821         abdevt = 0.0;
-<a name="l00822"></a>00822         <span class="keywordflow">for</span> (i = 0; i < np; i++) {
-<a name="l00823"></a>00823             d = y[i] - (bcomp * x[i] + aa);
-<a name="l00824"></a>00824             abdevt += fabs(d);
-<a name="l00825"></a>00825             <span class="keywordflow">if</span> (y[i] != 0.0) 
-<a name="l00826"></a>00826                 d /= fabs(y[i]);
-<a name="l00827"></a>00827             <span class="keywordflow">if</span> (fabs(d) > 1e-7) 
-<a name="l00828"></a>00828                 sum += (d >= 0.0 ? x[i] : -x[i]);
-<a name="l00829"></a>00829         }
-<a name="l00830"></a>00830         f = sum;
-<a name="l00831"></a>00831 
-<a name="l00832"></a>00832         <span class="keywordflow">if</span> (f*f1 >= 0.0) {
-<a name="l00833"></a>00833             f1=f;
-<a name="l00834"></a>00834             b1=bb;
-<a name="l00835"></a>00835         } 
-<a name="l00836"></a>00836         <span class="keywordflow">else</span> {
-<a name="l00837"></a>00837             f2=f;
-<a name="l00838"></a>00838             b2=bb;
-<a name="l00839"></a>00839         }
-<a name="l00840"></a>00840     }
-<a name="l00841"></a>00841     cpl_vector_delete(va);
-<a name="l00842"></a>00842     *a = aa;
-<a name="l00843"></a>00843     *b = bb;
-<a name="l00844"></a>00844     *abdev = abdevt / np;
-<a name="l00845"></a>00845     <span class="keywordflow">return</span> 0;
-<a name="l00846"></a>00846 }
-<a name="l00847"></a>00847 <span class="preprocessor">#undef SEGNO</span>
-<a name="l00848"></a>00848 <span class="preprocessor"></span>
-<a name="l00849"></a>00849 <span class="comment">/*      </span>
-<a name="l00850"></a>00850 <span class="comment"> * The following static function applies the Hough transform from a table</span>
-<a name="l00851"></a>00851 <span class="comment"> * of points to another table of points. Given the points p_i = (x_i,y_i)</span>
-<a name="l00852"></a>00852 <span class="comment"> * and p_j = (x_j,y_j), the point (X,Y) with X = (y_i - y_j)/(x_i - x_j)</span>
-<a name="l00853"></a>00853 <span class="comment"> * and Y = y_i - X*x_i is computed and added to the output table for each</span>
-<a name="l00854"></a>00854 <span class="comment"> * p_i, p_j pair. This means that if the input table has N points, the</span>
-<a name="l00855"></a>00855 <span class="comment"> * output table has N*(N-1)/2 points.</span>
-<a name="l00856"></a>00856 <span class="comment"> */</span>
-<a name="l00857"></a>00857     
-<a name="l00858"></a>00858 <span class="comment">/* static */</span>
-<a name="l00859"></a><a class="code" href="group__moses.html#g68b5196b98878f3f3b702d58f1477150">00859</a> cpl_table *<a class="code" href="group__moses.html#g68b5196b98878f3f3b702d58f1477150">mos_hough_table</a>(cpl_table *table, <span class="keyword">const</span> <span class="keywordtype">char</span> *x, <span class="keyword">const</span> <span class="keywordtype">char</span> *y)
-<a name="l00860"></a>00860 {
-<a name="l00861"></a>00861     cpl_table *output;
-<a name="l00862"></a>00862     <span class="keywordtype">double</span>    *xdata;
-<a name="l00863"></a>00863     <span class="keywordtype">double</span>    *ydata;
-<a name="l00864"></a>00864     <span class="keywordtype">double</span>    *xodata;
-<a name="l00865"></a>00865     <span class="keywordtype">double</span>    *yodata;
-<a name="l00866"></a>00866     <span class="keywordtype">int</span>        npoints;
-<a name="l00867"></a>00867     <span class="keywordtype">int</span>        opoints;
-<a name="l00868"></a>00868     <span class="keywordtype">int</span>        i, j, k;
-<a name="l00869"></a>00869 
-<a name="l00870"></a>00870 
-<a name="l00871"></a>00871     npoints = cpl_table_get_nrow(table);
-<a name="l00872"></a>00872     opoints = npoints*(npoints-1)/2;
-<a name="l00873"></a>00873 
-<a name="l00874"></a>00874     output = cpl_table_new(opoints);
-<a name="l00875"></a>00875     cpl_table_new_column(output, <span class="stringliteral">"m"</span>, CPL_TYPE_DOUBLE);
-<a name="l00876"></a>00876     cpl_table_new_column(output, <span class="stringliteral">"q"</span>, CPL_TYPE_DOUBLE);
-<a name="l00877"></a>00877     cpl_table_fill_column_window_double(output, <span class="stringliteral">"m"</span>, 0, opoints, 0.0);
-<a name="l00878"></a>00878     cpl_table_fill_column_window_double(output, <span class="stringliteral">"q"</span>, 0, opoints, 0.0);
-<a name="l00879"></a>00879 
-<a name="l00880"></a>00880     xodata = cpl_table_get_data_double(output, <span class="stringliteral">"m"</span>);
-<a name="l00881"></a>00881     yodata = cpl_table_get_data_double(output, <span class="stringliteral">"q"</span>);
-<a name="l00882"></a>00882     
-<a name="l00883"></a>00883     cpl_table_cast_column(table, x, <span class="stringliteral">"x"</span>, CPL_TYPE_DOUBLE);
-<a name="l00884"></a>00884     cpl_table_cast_column(table, y, <span class="stringliteral">"y"</span>, CPL_TYPE_DOUBLE);
-<a name="l00885"></a>00885 
-<a name="l00886"></a>00886     xdata = cpl_table_get_data_double(table, <span class="stringliteral">"x"</span>);
-<a name="l00887"></a>00887     ydata = cpl_table_get_data_double(table, <span class="stringliteral">"y"</span>);
-<a name="l00888"></a>00888 
-<a name="l00889"></a>00889     k = 0;
-<a name="l00890"></a>00890     <span class="keywordflow">for</span> (i = 0; i < npoints; i++) {
-<a name="l00891"></a>00891         <span class="keywordflow">for</span> (j = i+1; j < npoints; j++) {
-<a name="l00892"></a>00892             xodata[k] = (ydata[i]-ydata[j])/(xdata[i]-xdata[j]);
-<a name="l00893"></a>00893             yodata[k] = ydata[i] - xodata[k] * xdata[i];
-<a name="l00894"></a>00894             k++;
-<a name="l00895"></a>00895         }
-<a name="l00896"></a>00896     }
-<a name="l00897"></a>00897 
-<a name="l00898"></a>00898     <span class="keywordflow">if</span> (k != opoints)
-<a name="l00899"></a>00899         printf(<span class="stringliteral">"Assert k = %d, expected %d\n"</span>, k, opoints);
-<a name="l00900"></a>00900 
-<a name="l00901"></a>00901     cpl_table_erase_column(table, <span class="stringliteral">"x"</span>);
-<a name="l00902"></a>00902     cpl_table_erase_column(table, <span class="stringliteral">"y"</span>);
-<a name="l00903"></a>00903 
-<a name="l00904"></a>00904     <span class="keywordflow">return</span> output;
-<a name="l00905"></a>00905 }
-<a name="l00906"></a>00906 
-<a name="l00907"></a>00907 
-<a name="l00908"></a>00908 <span class="comment">/*</span>
-<a name="l00909"></a>00909 <span class="comment"> * The following static function is performing the spectral</span>
-<a name="l00910"></a>00910 <span class="comment"> * extraction for the function mos_extract_objects()</span>
-<a name="l00911"></a>00911 <span class="comment"> */</span>
-<a name="l00912"></a>00912 
-<a name="l00913"></a><a class="code" href="group__moses.html#g4e645e1d3c927b1cec138cf857554485">00913</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="group__moses.html#g4e645e1d3c927b1cec138cf857554485">mos_extraction</a>(cpl_image *sciwin, cpl_image *skywin, 
-<a name="l00914"></a>00914                            cpl_image *extracted, cpl_image *sky, 
-<a name="l00915"></a>00915                            cpl_image *error, <span class="keywordtype">int</span> nobjects, <span class="keywordtype">int</span> extraction, 
-<a name="l00916"></a>00916                            <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>, <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>, <span class="keywordtype">int</span> ncomb)
-<a name="l00917"></a>00917 {
-<a name="l00918"></a>00918 
-<a name="l00919"></a>00919   cpl_vector *vprofile;
-<a name="l00920"></a>00920   cpl_matrix *kernel;
-<a name="l00921"></a>00921   cpl_image  *smowin;
-<a name="l00922"></a>00922 
-<a name="l00923"></a>00923   <span class="keywordtype">int</span> i, j;
-<a name="l00924"></a>00924   <span class="keywordtype">int</span> specLen;
-<a name="l00925"></a>00925   <span class="keywordtype">int</span> numRows;
-<a name="l00926"></a>00926   <span class="keywordtype">int</span> index;
-<a name="l00927"></a>00927   <span class="keywordtype">int</span> iter;
-<a name="l00928"></a>00928   <span class="keywordtype">int</span> maxIter   = 2;         <span class="comment">/* Not less than 2 !!! */</span>
-<a name="l00929"></a>00929   <span class="keywordtype">int</span> smoothBox = 31;        <span class="comment">/* Not less than 5 !!! */</span>
-<a name="l00930"></a>00930   <span class="keywordtype">double</span> nsigma = 5.0;
-<a name="l00931"></a>00931 
-<a name="l00932"></a>00932   <span class="keywordtype">double</span> sumWeight, sum, sumSky, sumProf, variance, weight;
-<a name="l00933"></a>00933   <span class="keywordtype">double</span> *profile;
-<a name="l00934"></a>00934   <span class="keywordtype">double</span> *buffer;
-<a name="l00935"></a>00935   <span class="keywordtype">float</span>  *edata;
-<a name="l00936"></a>00936   <span class="keywordtype">float</span>  *ekdata;
-<a name="l00937"></a>00937   <span class="keywordtype">float</span>  *endata;
-<a name="l00938"></a>00938   <span class="keywordtype">float</span>  *sdata;
-<a name="l00939"></a>00939   <span class="keywordtype">float</span>  *kdata;
-<a name="l00940"></a>00940   <span class="keywordtype">float</span>  *fdata;
-<a name="l00941"></a>00941 
-<a name="l00942"></a>00942   <span class="keywordtype">double</span> value;
-<a name="l00943"></a>00943 
-<a name="l00944"></a>00944 
-<a name="l00945"></a>00945   specLen = cpl_image_get_size_x(sciwin);
-<a name="l00946"></a>00946   numRows = cpl_image_get_size_y(sciwin);
-<a name="l00947"></a>00947 
-<a name="l00948"></a>00948   edata = cpl_image_get_data(extracted);
-<a name="l00949"></a>00949   edata += nobjects * specLen;
-<a name="l00950"></a>00950 
-<a name="l00951"></a>00951   ekdata = cpl_image_get_data(sky);
-<a name="l00952"></a>00952   ekdata += nobjects * specLen;
-<a name="l00953"></a>00953 
-<a name="l00954"></a>00954   endata = cpl_image_get_data(error);
-<a name="l00955"></a>00955   endata += nobjects * specLen;
-<a name="l00956"></a>00956 
-<a name="l00957"></a>00957   sdata = cpl_image_get_data(sciwin);
-<a name="l00958"></a>00958   kdata = cpl_image_get_data(skywin);
-<a name="l00959"></a>00959 
-<a name="l00960"></a>00960 
-<a name="l00961"></a>00961   <span class="comment">/*</span>
-<a name="l00962"></a>00962 <span class="comment">   * Initial spectrum estimate</span>
-<a name="l00963"></a>00963 <span class="comment">      if (sdata[i + j * specLen] > 0.0)</span>
-<a name="l00964"></a>00964 <span class="comment">   */</span>
-<a name="l00965"></a>00965 
-<a name="l00966"></a>00966   <span class="keywordflow">if</span> (extraction && numRows > 5) {
-<a name="l00967"></a>00967       smowin = <a class="code" href="group__moses.html#g4fe5f2fe3227522421783758228cdc39">mos_image_filter_median</a>(sciwin, 3, 3);
-<a name="l00968"></a>00968       fdata = cpl_image_get_data(smowin);
-<a name="l00969"></a>00969       <span class="keywordflow">for</span> (i = 0; i < specLen; i++)
-<a name="l00970"></a>00970         <span class="keywordflow">for</span> (j = 0, edata[i] = 0.0; j < numRows; j++)
-<a name="l00971"></a>00971             edata[i] += fdata[i + j * specLen];
-<a name="l00972"></a>00972       cpl_image_delete(smowin);
-<a name="l00973"></a>00973   }
-<a name="l00974"></a>00974   <span class="keywordflow">else</span> {
-<a name="l00975"></a>00975       <span class="keywordflow">for</span> (i = 0; i < specLen; i++)
-<a name="l00976"></a>00976         <span class="keywordflow">for</span> (j = 0, edata[i] = 0.0; j < numRows; j++)
-<a name="l00977"></a>00977             edata[i] += sdata[i + j * specLen];
-<a name="l00978"></a>00978   }
-<a name="l00979"></a>00979 
-<a name="l00980"></a>00980   <span class="keywordflow">if</span> (extraction) {
-<a name="l00981"></a>00981 
-<a name="l00982"></a>00982     profile = cpl_calloc(specLen * numRows, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00983"></a>00983     buffer  = cpl_calloc(specLen, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00984"></a>00984 
-<a name="l00985"></a>00985     <span class="keywordflow">for</span> (iter = 0; iter < maxIter; iter++) {
-<a name="l00986"></a>00986 
-<a name="l00987"></a>00987       <span class="comment">/*</span>
-<a name="l00988"></a>00988 <span class="comment">       * Normalised spatial profile</span>
-<a name="l00989"></a>00989 <span class="comment">       */</span>
-<a name="l00990"></a>00990 
-<a name="l00991"></a>00991       <span class="keywordflow">for</span> (i = 0; i < specLen; i++) {
-<a name="l00992"></a>00992         <span class="keywordflow">for</span> (j = 0; j < numRows; j++) {
-<a name="l00993"></a>00993           index = i + j * specLen;
-<a name="l00994"></a>00994 <span class="comment">/*          if (sdata[index] > 0.0 && edata[i] > 0.00001)     */</span>
-<a name="l00995"></a>00995           <span class="keywordflow">if</span> (fabs(edata[i]) > 0.00001)
-<a name="l00996"></a>00996             profile[index] = sdata[index] / edata[i];
-<a name="l00997"></a>00997           <span class="keywordflow">else</span>
-<a name="l00998"></a>00998             profile[index] = 0.0;
-<a name="l00999"></a>00999         }
-<a name="l01000"></a>01000       }
-<a name="l01001"></a>01001 
-<a name="l01002"></a>01002       <span class="keywordflow">for</span> (j = 0; j < numRows; j++) {
-<a name="l01003"></a>01003 
-<a name="l01004"></a>01004         <span class="comment">/*</span>
-<a name="l01005"></a>01005 <span class="comment">         * Smooth each row in the dispersion direction, and enforce positivity</span>
-<a name="l01006"></a>01006 <span class="comment">         */</span>
-<a name="l01007"></a>01007 
-<a name="l01008"></a>01008         <span class="keywordflow">for</span> (i = 0; i < specLen - smoothBox; i++) {
-<a name="l01009"></a>01009           vprofile = cpl_vector_wrap(smoothBox, profile + i + j*specLen);
-<a name="l01010"></a>01010           value = cpl_vector_get_median_const(vprofile);
-<a name="l01011"></a>01011           cpl_vector_unwrap(vprofile);
-<a name="l01012"></a>01012           <span class="keywordflow">if</span> (value < 0)
-<a name="l01013"></a>01013             value = 0.0;
-<a name="l01014"></a>01014           buffer[i + smoothBox / 2] = value;
-<a name="l01015"></a>01015         }
-<a name="l01016"></a>01016 
-<a name="l01017"></a>01017         <span class="comment">/*</span>
-<a name="l01018"></a>01018 <span class="comment">         * Replace the end portions (i.e., not median filtered) with a mean</span>
-<a name="l01019"></a>01019 <span class="comment">         */</span>
-<a name="l01020"></a>01020 
-<a name="l01021"></a>01021         vprofile = cpl_vector_wrap(smoothBox / 2, profile + j*specLen);
-<a name="l01022"></a>01022         value = cpl_vector_get_mean(vprofile);
-<a name="l01023"></a>01023         cpl_vector_unwrap(vprofile);
-<a name="l01024"></a>01024 
-<a name="l01025"></a>01025         <span class="keywordflow">if</span> (value < 0)
-<a name="l01026"></a>01026             value = 0.0;
-<a name="l01027"></a>01027 
-<a name="l01028"></a>01028         <span class="keywordflow">for</span> (i = 0; i < smoothBox / 2; i++)
-<a name="l01029"></a>01029           buffer[i] = value;
-<a name="l01030"></a>01030 
-<a name="l01031"></a>01031         vprofile = cpl_vector_wrap(smoothBox / 2, 
-<a name="l01032"></a>01032                                    profile + specLen - smoothBox/2 + j*specLen);
-<a name="l01033"></a>01033         value = cpl_vector_get_mean(vprofile);
-<a name="l01034"></a>01034         cpl_vector_unwrap(vprofile);
-<a name="l01035"></a>01035 
-<a name="l01036"></a>01036         <span class="keywordflow">if</span> (value < 0)
-<a name="l01037"></a>01037             value = 0.0;
-<a name="l01038"></a>01038 
-<a name="l01039"></a>01039         <span class="keywordflow">for</span> (i = 0; i < smoothBox / 2; i++)
-<a name="l01040"></a>01040           buffer[i + specLen - smoothBox / 2] = value;
-<a name="l01041"></a>01041 
-<a name="l01042"></a>01042         <span class="keywordflow">for</span> (i = 0; i < specLen; i++)
-<a name="l01043"></a>01043           profile[i + j * specLen] = buffer[i];
-<a name="l01044"></a>01044 
-<a name="l01045"></a>01045       }
-<a name="l01046"></a>01046 
-<a name="l01047"></a>01047       <span class="comment">/*</span>
-<a name="l01048"></a>01048 <span class="comment">       * Enforce normalization of spatial profile after smoothing</span>
-<a name="l01049"></a>01049 <span class="comment">       */</span>
-<a name="l01050"></a>01050 
-<a name="l01051"></a>01051       <span class="keywordflow">for</span> (i = 0; i < specLen; i++) {
-<a name="l01052"></a>01052         <span class="keywordflow">for</span> (j = 0, value = 0.0; j < numRows; j++)
-<a name="l01053"></a>01053           value += profile[i + j * specLen];
-<a name="l01054"></a>01054         <span class="keywordflow">if</span> (value > 0.00001)
-<a name="l01055"></a>01055           <span class="keywordflow">for</span> (j = 0; j < numRows; j++)
-<a name="l01056"></a>01056             profile[i + j * specLen] /= value;
-<a name="l01057"></a>01057         <span class="keywordflow">else</span>
-<a name="l01058"></a>01058           <span class="keywordflow">for</span> (j = 0; j < numRows; j++)
-<a name="l01059"></a>01059             profile[i + j * specLen] = 0.0;
-<a name="l01060"></a>01060       }
-<a name="l01061"></a>01061 
-<a name="l01062"></a>01062 
-<a name="l01063"></a>01063       <span class="comment">/*</span>
-<a name="l01064"></a>01064 <span class="comment">       * Optimal extraction</span>
-<a name="l01065"></a>01065 <span class="comment">       */</span>
-<a name="l01066"></a>01066 
-<a name="l01067"></a>01067       <span class="keywordflow">for</span> (i = 0; i < specLen; i++) {
-<a name="l01068"></a>01068         sum = 0.0;
-<a name="l01069"></a>01069         sumSky = 0.0;
-<a name="l01070"></a>01070         sumWeight = 0.0;
-<a name="l01071"></a>01071         sumProf = 0.0;
-<a name="l01072"></a>01072         <span class="keywordflow">for</span> (j = 0; j < numRows; j++) {
-<a name="l01073"></a>01073           index = i + j * specLen;
-<a name="l01074"></a>01074 <span class="comment">/*        </span>
-<a name="l01075"></a>01075 <span class="comment">if (sdata[index] > 0.0) {</span>
-<a name="l01076"></a>01076 <span class="comment">*/</span>
-<a name="l01077"></a>01077             variance = ron*ron + fabs(edata[i] * profile[index] + kdata[index])
-<a name="l01078"></a>01078                      / conad;
-<a name="l01079"></a>01079             variance /= ncomb;  <span class="comment">/* If input dataset is sum of ncomb images */</span>
-<a name="l01080"></a>01080             value = sdata[index] - edata[i] * profile[index];
-<a name="l01081"></a>01081             <span class="keywordflow">if</span> (fabs(value) / sqrt(variance) < nsigma) {
-<a name="l01082"></a>01082               weight = 1000000 * profile[index] / variance;
-<a name="l01083"></a>01083               sum += weight * sdata[index];
-<a name="l01084"></a>01084               sumSky += weight * kdata[index];
-<a name="l01085"></a>01085               sumWeight += weight * profile[index];
-<a name="l01086"></a>01086               sumProf += profile[index];
-<a name="l01087"></a>01087             }
-<a name="l01088"></a>01088 <span class="comment">/*</span>
-<a name="l01089"></a>01089 <span class="comment">}      </span>
-<a name="l01090"></a>01090 <span class="comment">*/</span>
-<a name="l01091"></a>01091         }
-<a name="l01092"></a>01092 
-<a name="l01093"></a>01093         <span class="keywordflow">if</span> (sumWeight > 0.00001) {
-<a name="l01094"></a>01094           edata[i] = sum / sumWeight;
-<a name="l01095"></a>01095           ekdata[i] = sumSky / sumWeight;
-<a name="l01096"></a>01096           endata[i] = 1000 * sqrt(sumProf / sumWeight);
-<a name="l01097"></a>01097         }
-<a name="l01098"></a>01098         <span class="keywordflow">else</span> {
-<a name="l01099"></a>01099 <span class="comment">/*</span>
-<a name="l01100"></a>01100 <span class="comment">          edata[i] = 0.0;</span>
-<a name="l01101"></a>01101 <span class="comment">          ekdata[i] = 0.0;</span>
-<a name="l01102"></a>01102 <span class="comment">          endata[i] = 0.0;</span>
-<a name="l01103"></a>01103 <span class="comment">*/</span>
-<a name="l01104"></a>01104           endata[i] = sqrt(ron*ron + fabs(edata[i] + ekdata[i]) / conad);
-<a name="l01105"></a>01105         }
-<a name="l01106"></a>01106       }
-<a name="l01107"></a>01107     }
-<a name="l01108"></a>01108     cpl_free(profile);
-<a name="l01109"></a>01109     cpl_free(buffer);
-<a name="l01110"></a>01110   }
-<a name="l01111"></a>01111   <span class="keywordflow">else</span> {
-<a name="l01112"></a>01112 
-<a name="l01113"></a>01113     <span class="comment">/*</span>
-<a name="l01114"></a>01114 <span class="comment">     * Add sky estimation for the simple aperture extraction.</span>
-<a name="l01115"></a>01115 <span class="comment">        if (kdata[i + j * specLen] > 0.0)</span>
-<a name="l01116"></a>01116 <span class="comment">     */</span>
-<a name="l01117"></a>01117 
-<a name="l01118"></a>01118     <span class="keywordflow">for</span> (i = 0; i < specLen; i++)
-<a name="l01119"></a>01119       <span class="keywordflow">for</span> (j = 0, ekdata[i] = 0.0; j < numRows; j++)
-<a name="l01120"></a>01120           ekdata[i] += kdata[i + j * specLen];
-<a name="l01121"></a>01121 
-<a name="l01122"></a>01122     <span class="comment">/*</span>
-<a name="l01123"></a>01123 <span class="comment">     * Add error estimation for the simple aperture extraction.</span>
-<a name="l01124"></a>01124 <span class="comment">     */</span>
-<a name="l01125"></a>01125 
-<a name="l01126"></a>01126     <span class="keywordflow">for</span> (i = 0; i < specLen; i++)
-<a name="l01127"></a>01127       endata[i] = sqrt(ron*ron + fabs(edata[i] + ekdata[i]) / conad);
-<a name="l01128"></a>01128 
-<a name="l01129"></a>01129   }
-<a name="l01130"></a>01130 
-<a name="l01131"></a>01131 }
-<a name="l01132"></a>01132 
-<a name="l01133"></a>01133 
-<a name="l01180"></a><a class="code" href="group__moses.html#gdf9210c07ebddae07a3e5e99d88d2f5c">01180</a> cpl_table *<a class="code" href="group__moses.html#gdf9210c07ebddae07a3e5e99d88d2f5c">mos_global_distortion</a>(cpl_table *slits, cpl_table *maskslits,
-<a name="l01181"></a>01181                                  cpl_table *ids, cpl_table *crv, 
-<a name="l01182"></a>01182                                  <span class="keywordtype">double</span> reference)
-<a name="l01183"></a>01183 {
-<a name="l01184"></a>01184     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_global_distortion"</span>;
-<a name="l01185"></a>01185 
-<a name="l01186"></a>01186     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l01187"></a>01187 
-<a name="l01188"></a>01188     cpl_table      *global = NULL;
-<a name="l01189"></a>01189     cpl_table      *coeff;
-<a name="l01190"></a>01190     cpl_table      *dummy;
-<a name="l01191"></a>01191     cpl_vector     *ci;
-<a name="l01192"></a>01192     cpl_vector     *xmask;
-<a name="l01193"></a>01193     cpl_vector     *ymask;
-<a name="l01194"></a>01194     cpl_bivector   *mask;
-<a name="l01195"></a>01195     cpl_vector     *xccd;
-<a name="l01196"></a>01196     cpl_vector     *yccd;
-<a name="l01197"></a>01197     cpl_bivector   *ccd;
-<a name="l01198"></a>01198     cpl_polynomial *poly;
-<a name="l01199"></a>01199     <span class="keywordtype">double</span>         *xtop;
-<a name="l01200"></a>01200     <span class="keywordtype">double</span>         *ytop;
-<a name="l01201"></a>01201     <span class="keywordtype">double</span>         *xbottom;
-<a name="l01202"></a>01202     <span class="keywordtype">double</span>         *ybottom;
-<a name="l01203"></a>01203     <span class="keywordtype">double</span>         *mxtop;
-<a name="l01204"></a>01204     <span class="keywordtype">double</span>         *mytop;
-<a name="l01205"></a>01205     <span class="keywordtype">double</span>         *mxbottom;
-<a name="l01206"></a>01206     <span class="keywordtype">double</span>         *mybottom;
-<a name="l01207"></a>01207     <span class="keywordtype">int</span>            *position;
-<a name="l01208"></a>01208     <span class="keywordtype">int</span>            *length;
-<a name="l01209"></a>01209     <span class="keywordtype">int</span>            *slit_id;
-<a name="l01210"></a>01210     <span class="keywordtype">int</span>            *mslit_id;
-<a name="l01211"></a>01211     <span class="keywordtype">int</span>             nslits, nmaskslits, npoints;
-<a name="l01212"></a>01212     <span class="keywordtype">int</span>             order;
-<a name="l01213"></a>01213     <span class="keywordtype">int</span>             i, j;
-<a name="l01214"></a>01214     <span class="keywordtype">int</span>             minslit = 6;    <span class="comment">// 12;</span>
-<a name="l01215"></a>01215 
-<a name="l01216"></a>01216 
-<a name="l01217"></a>01217 <span class="comment">/* *+</span>
-<a name="l01218"></a>01218 <span class="comment">printf("error1: %s\n", cpl_error_get_message());</span>
-<a name="l01219"></a>01219 <span class="comment">+* */</span>
-<a name="l01220"></a>01220     <span class="keywordflow">if</span> (slits == NULL || maskslits == NULL || ids == NULL || crv == NULL) {
-<a name="l01221"></a>01221         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l01222"></a>01222         <span class="keywordflow">return</span> NULL;
-<a name="l01223"></a>01223     }
-<a name="l01224"></a>01224 <span class="comment">/* *+</span>
-<a name="l01225"></a>01225 <span class="comment">printf("error1a: %s\n", cpl_error_get_message());</span>
-<a name="l01226"></a>01226 <span class="comment">+* */</span>
-<a name="l01227"></a>01227 
-<a name="l01228"></a>01228     nslits = cpl_table_get_nrow(slits);
-<a name="l01229"></a>01229 <span class="comment">/* *+</span>
-<a name="l01230"></a>01230 <span class="comment">printf("error1b: %s\n", cpl_error_get_message());</span>
-<a name="l01231"></a>01231 <span class="comment">+* */</span>
-<a name="l01232"></a>01232 
-<a name="l01233"></a>01233     <span class="keywordflow">if</span> (nslits < minslit) {
-<a name="l01234"></a>01234         cpl_msg_warning(func, <span class="stringliteral">"Too few slits (%d < %d) for global "</span>
-<a name="l01235"></a>01235                         <span class="stringliteral">"distortion model determination"</span>, nslits, minslit);
-<a name="l01236"></a>01236         <span class="keywordflow">return</span> NULL;
-<a name="l01237"></a>01237     }
-<a name="l01238"></a>01238 <span class="comment">/* *+</span>
-<a name="l01239"></a>01239 <span class="comment">printf("error1c: %s\n", cpl_error_get_message());</span>
-<a name="l01240"></a>01240 <span class="comment">+* */</span>
-<a name="l01241"></a>01241 
-<a name="l01242"></a>01242     nmaskslits = cpl_table_get_nrow(maskslits);
-<a name="l01243"></a>01243 
-<a name="l01244"></a>01244     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l01245"></a>01245     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);
-<a name="l01246"></a>01246     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l01247"></a>01247     mslit_id = cpl_table_get_data_int(maskslits, <span class="stringliteral">"slit_id"</span>);
-<a name="l01248"></a>01248     xtop     = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);
-<a name="l01249"></a>01249     ytop     = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);
-<a name="l01250"></a>01250     xbottom  = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);
-<a name="l01251"></a>01251     ybottom  = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);
-<a name="l01252"></a>01252     mxtop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l01253"></a>01253     mytop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);
-<a name="l01254"></a>01254     mxbottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xbottom"</span>);
-<a name="l01255"></a>01255     mybottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ybottom"</span>);
-<a name="l01256"></a>01256 
-<a name="l01257"></a>01257 
-<a name="l01258"></a>01258     <span class="comment">/*</span>
-<a name="l01259"></a>01259 <span class="comment">     * Global IDS</span>
-<a name="l01260"></a>01260 <span class="comment">     */</span>
-<a name="l01261"></a>01261 
-<a name="l01262"></a>01262     coeff = cpl_table_new(nslits);
-<a name="l01263"></a>01263     cpl_table_copy_structure(coeff, ids);
-<a name="l01264"></a>01264     cpl_table_new_column(coeff, <span class="stringliteral">"xccd"</span>, CPL_TYPE_DOUBLE);
-<a name="l01265"></a>01265     cpl_table_new_column(coeff, <span class="stringliteral">"yccd"</span>, CPL_TYPE_DOUBLE);
-<a name="l01266"></a>01266     cpl_table_new_column(coeff, <span class="stringliteral">"xmask"</span>, CPL_TYPE_DOUBLE);
-<a name="l01267"></a>01267     cpl_table_new_column(coeff, <span class="stringliteral">"ymask"</span>, CPL_TYPE_DOUBLE);
-<a name="l01268"></a>01268 
-<a name="l01269"></a>01269 <span class="comment">/* *+</span>
-<a name="l01270"></a>01270 <span class="comment">printf("error2: %s\n", cpl_error_get_message());</span>
-<a name="l01271"></a>01271 <span class="comment">+* */</span>
-<a name="l01272"></a>01272     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l01273"></a>01273         <span class="keywordflow">for</span> (j = 0; j < nmaskslits; j++) {
-<a name="l01274"></a>01274             <span class="keywordflow">if</span> (slit_id[i] == mslit_id[j]) {
-<a name="l01275"></a>01275                 cpl_table_set_double(coeff, <span class="stringliteral">"xmask"</span>, i,
-<a name="l01276"></a>01276                                      (mxtop[j] + mxbottom[j]) / 2);
-<a name="l01277"></a>01277                 cpl_table_set_double(coeff, <span class="stringliteral">"ymask"</span>, i,
-<a name="l01278"></a>01278                                      (mytop[j] + mybottom[j]) / 2);
-<a name="l01279"></a>01279             }
-<a name="l01280"></a>01280         }
-<a name="l01281"></a>01281     }
-<a name="l01282"></a>01282 
-<a name="l01283"></a>01283     <span class="keywordflow">if</span> (cpl_table_has_invalid(coeff, <span class="stringliteral">"xmask"</span>)) {
-<a name="l01284"></a>01284         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l01285"></a>01285         cpl_table_delete(coeff);
-<a name="l01286"></a>01286         <span class="keywordflow">return</span> NULL;
-<a name="l01287"></a>01287     }
-<a name="l01288"></a>01288 
-<a name="l01289"></a>01289     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l01290"></a>01290         cpl_table_set_double(coeff, <span class="stringliteral">"xccd"</span>, i, (xtop[i] + xbottom[i]) / 2);
-<a name="l01291"></a>01291         cpl_table_set_double(coeff, <span class="stringliteral">"yccd"</span>, i, (ytop[i] + ybottom[i]) / 2);
-<a name="l01292"></a>01292     }
-<a name="l01293"></a>01293 
-<a name="l01294"></a>01294 <span class="comment">/* *+</span>
-<a name="l01295"></a>01295 <span class="comment">printf("error3: %s\n", cpl_error_get_message());</span>
-<a name="l01296"></a>01296 <span class="comment">+* */</span>
-<a name="l01297"></a>01297     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l01298"></a>01298 
-<a name="l01299"></a>01299         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l01300"></a>01300             <span class="keywordflow">continue</span>;
-<a name="l01301"></a>01301 
-<a name="l01302"></a>01302         cpl_table_and_selected_window(ids, position[i], length[i]);
-<a name="l01303"></a>01303         dummy = cpl_table_extract_selected(ids);
-<a name="l01304"></a>01304         <span class="keywordflow">for</span> (j = 0; j < 6; j++) {
-<a name="l01305"></a>01305             <span class="keywordflow">if</span> (cpl_table_has_column(dummy, clab[j])) {
-<a name="l01306"></a>01306                 <span class="keywordflow">if</span> (length[i] - cpl_table_count_invalid(dummy, clab[j]) > 10) {
-<a name="l01307"></a>01307                     cpl_table_set_double(coeff, clab[j], i, 
-<a name="l01308"></a>01308                          cpl_table_get_column_median(dummy, clab[j]));
-<a name="l01309"></a>01309                 }
-<a name="l01310"></a>01310             }
-<a name="l01311"></a>01311         }
-<a name="l01312"></a>01312 
-<a name="l01313"></a>01313         cpl_table_delete(dummy);
-<a name="l01314"></a>01314         cpl_table_select_all(ids);
-<a name="l01315"></a>01315             
-<a name="l01316"></a>01316     }
-<a name="l01317"></a>01317 
-<a name="l01318"></a>01318 <span class="comment">/* *+</span>
-<a name="l01319"></a>01319 <span class="comment">printf("error4: %s\n", cpl_error_get_message());</span>
-<a name="l01320"></a>01320 <span class="comment">+* */</span>
-<a name="l01321"></a>01321     <span class="keywordflow">for</span> (j = 0; j < 6; j++) {
-<a name="l01322"></a>01322         <span class="keywordflow">if</span> (cpl_table_has_column(coeff, clab[j])) {
-<a name="l01323"></a>01323             cpl_table_and_selected_invalid(coeff, clab[j]);
-<a name="l01324"></a>01324 
-<a name="l01325"></a>01325             <span class="keywordflow">if</span> (cpl_table_not_selected(coeff))
-<a name="l01326"></a>01326                 dummy = cpl_table_extract_selected(coeff);
-<a name="l01327"></a>01327             <span class="keywordflow">else</span>
-<a name="l01328"></a>01328                 <span class="keywordflow">break</span>;
-<a name="l01329"></a>01329 
-<a name="l01330"></a>01330             npoints = cpl_table_get_nrow(dummy);
-<a name="l01331"></a>01331 
-<a name="l01332"></a>01332             <span class="keywordflow">if</span> (npoints >= 6) {
-<a name="l01333"></a>01333 
-<a name="l01334"></a>01334                 <span class="keywordflow">if</span> (npoints >= 12)
-<a name="l01335"></a>01335                     order = 2;
-<a name="l01336"></a>01336                 <span class="keywordflow">else</span>
-<a name="l01337"></a>01337                     order = 1;
-<a name="l01338"></a>01338                    
-<a name="l01339"></a>01339                 ci = cpl_vector_wrap(npoints,
-<a name="l01340"></a>01340                                      cpl_table_get_data_double(dummy, clab[j]));
-<a name="l01341"></a>01341                 <span class="keywordflow">if</span> (j) {
-<a name="l01342"></a>01342                     xccd = cpl_vector_wrap(npoints,
-<a name="l01343"></a>01343                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"xccd"</span>));
-<a name="l01344"></a>01344                     yccd = cpl_vector_wrap(npoints,
-<a name="l01345"></a>01345                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"yccd"</span>));
-<a name="l01346"></a>01346                     ccd = cpl_bivector_wrap_vectors(xccd, yccd);
-<a name="l01347"></a>01347 
-<a name="l01348"></a>01348 <span class="comment">/* %%% */</span>
-<a name="l01349"></a>01349                     poly = cpl_polynomial_fit_2d_create(ccd, ci, order, NULL);
-<a name="l01350"></a>01350 
-<a name="l01351"></a>01351                     cpl_bivector_unwrap_vectors(ccd);
-<a name="l01352"></a>01352                     cpl_vector_unwrap(xccd);
-<a name="l01353"></a>01353                     cpl_vector_unwrap(yccd);
-<a name="l01354"></a>01354                     cpl_vector_unwrap(ci);
-<a name="l01355"></a>01355                 }
-<a name="l01356"></a>01356                 <span class="keywordflow">else</span> {
-<a name="l01357"></a>01357                     xmask = cpl_vector_wrap(npoints,
-<a name="l01358"></a>01358                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"xmask"</span>));
-<a name="l01359"></a>01359                     ymask = cpl_vector_wrap(npoints,
-<a name="l01360"></a>01360                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"ymask"</span>));
-<a name="l01361"></a>01361                     mask = cpl_bivector_wrap_vectors(xmask, ymask);
-<a name="l01362"></a>01362 
-<a name="l01363"></a>01363 <span class="comment">/* %%% */</span>
-<a name="l01364"></a>01364                     poly = cpl_polynomial_fit_2d_create(mask, ci, order, NULL);
-<a name="l01365"></a>01365 
-<a name="l01366"></a>01366                     cpl_bivector_unwrap_vectors(mask);
-<a name="l01367"></a>01367                     cpl_vector_unwrap(xmask);
-<a name="l01368"></a>01368                     cpl_vector_unwrap(ymask);
-<a name="l01369"></a>01369                     cpl_vector_unwrap(ci);
-<a name="l01370"></a>01370                 }
-<a name="l01371"></a>01371             }
-<a name="l01372"></a>01372             <span class="keywordflow">else</span> {
-<a name="l01373"></a>01373                 cpl_size p[2] = {0, 0};
-<a name="l01374"></a>01374                 poly = cpl_polynomial_new(2);
-<a name="l01375"></a>01375                 cpl_polynomial_set_coeff(poly, p, 
-<a name="l01376"></a>01376                                cpl_table_get_column_median(dummy, clab[j]));
-<a name="l01377"></a>01377             }
-<a name="l01378"></a>01378 
-<a name="l01379"></a>01379             cpl_table_delete(dummy);
-<a name="l01380"></a>01380 
-<a name="l01381"></a>01381             global = <a class="code" href="group__moses.html#g3ad10f4436b713a1e3e3296f3fc0e1a0">write_global_distortion</a>(global, j, poly);
-<a name="l01382"></a>01382 
-<a name="l01383"></a>01383             cpl_polynomial_delete(poly);
-<a name="l01384"></a>01384 
-<a name="l01385"></a>01385             cpl_table_select_all(coeff);
-<a name="l01386"></a>01386         }
-<a name="l01387"></a>01387     }
-<a name="l01388"></a>01388 
-<a name="l01389"></a>01389 <span class="comment">/* *+</span>
-<a name="l01390"></a>01390 <span class="comment">printf("error5: %s\n", cpl_error_get_message());</span>
-<a name="l01391"></a>01391 <span class="comment">+* */</span>
-<a name="l01392"></a>01392     cpl_table_delete(coeff);
-<a name="l01393"></a>01393 <span class="comment">/* *+</span>
-<a name="l01394"></a>01394 <span class="comment">printf("error6: %s\n", cpl_error_get_message());</span>
-<a name="l01395"></a>01395 <span class="comment">+* */</span>
-<a name="l01396"></a>01396 
-<a name="l01397"></a>01397 
-<a name="l01398"></a>01398     <span class="comment">/*</span>
-<a name="l01399"></a>01399 <span class="comment">     * Add model's reference wavelength</span>
-<a name="l01400"></a>01400 <span class="comment">     */</span>
-<a name="l01401"></a>01401 
-<a name="l01402"></a>01402     cpl_table_set_double(global, <span class="stringliteral">"a00"</span>, 6, reference);
-<a name="l01403"></a>01403 
-<a name="l01404"></a>01404 
-<a name="l01405"></a>01405     <span class="comment">/*</span>
-<a name="l01406"></a>01406 <span class="comment">     * Global curvature model</span>
-<a name="l01407"></a>01407 <span class="comment">     */</span>
-<a name="l01408"></a>01408 
-<a name="l01409"></a>01409     coeff = cpl_table_duplicate(crv);
-<a name="l01410"></a>01410     cpl_table_new_column(coeff, <span class="stringliteral">"xmask"</span>, CPL_TYPE_DOUBLE);
-<a name="l01411"></a>01411     cpl_table_new_column(coeff, <span class="stringliteral">"ymask"</span>, CPL_TYPE_DOUBLE);
-<a name="l01412"></a>01412     slit_id = cpl_table_get_data_int(coeff, <span class="stringliteral">"slit_id"</span>);
-<a name="l01413"></a>01413     npoints = cpl_table_get_nrow(coeff);
-<a name="l01414"></a>01414 
-<a name="l01415"></a>01415 <span class="comment">/* *+</span>
-<a name="l01416"></a>01416 <span class="comment">printf("error7: %s\n", cpl_error_get_message());</span>
-<a name="l01417"></a>01417 <span class="comment">+* */</span>
-<a name="l01418"></a>01418     <span class="keywordflow">for</span> (i = 0; i < npoints; i++) {
-<a name="l01419"></a>01419         <span class="keywordflow">for</span> (j = 0; j < nmaskslits; j++) {
-<a name="l01420"></a>01420             <span class="keywordflow">if</span> (slit_id[i] == mslit_id[j]) {
-<a name="l01421"></a>01421                 <span class="keywordflow">if</span> (i%2) {
-<a name="l01422"></a>01422                     cpl_table_set_double(coeff, <span class="stringliteral">"xmask"</span>, i, mxbottom[j]);
-<a name="l01423"></a>01423                     cpl_table_set_double(coeff, <span class="stringliteral">"ymask"</span>, i, mybottom[j]);
-<a name="l01424"></a>01424                 }
-<a name="l01425"></a>01425                 <span class="keywordflow">else</span> {
-<a name="l01426"></a>01426                     cpl_table_set_double(coeff, <span class="stringliteral">"xmask"</span>, i, mxtop[j]);
-<a name="l01427"></a>01427                     cpl_table_set_double(coeff, <span class="stringliteral">"ymask"</span>, i, mytop[j]);
-<a name="l01428"></a>01428                 }
-<a name="l01429"></a>01429             }
-<a name="l01430"></a>01430         }
-<a name="l01431"></a>01431     }
-<a name="l01432"></a>01432 
-<a name="l01433"></a>01433 <span class="comment">/* *+</span>
-<a name="l01434"></a>01434 <span class="comment">printf("error8: %s\n", cpl_error_get_message());</span>
-<a name="l01435"></a>01435 <span class="comment">+* */</span>
-<a name="l01436"></a>01436     <span class="keywordflow">if</span> (cpl_table_has_invalid(coeff, <span class="stringliteral">"xmask"</span>)) {
-<a name="l01437"></a>01437         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l01438"></a>01438         cpl_table_delete(coeff);
-<a name="l01439"></a>01439         <span class="keywordflow">return</span> NULL;
-<a name="l01440"></a>01440     }
-<a name="l01441"></a>01441 
-<a name="l01442"></a>01442 <span class="comment">/* *+</span>
-<a name="l01443"></a>01443 <span class="comment">printf("error9: %s\n", cpl_error_get_message());</span>
-<a name="l01444"></a>01444 <span class="comment">+* */</span>
-<a name="l01445"></a>01445     <span class="keywordflow">for</span> (j = 0; j < 3; j++) {
-<a name="l01446"></a>01446         <span class="keywordflow">if</span> (cpl_table_has_column(coeff, clab[j])) {
-<a name="l01447"></a>01447             cpl_table_and_selected_invalid(coeff, clab[j]);
-<a name="l01448"></a>01448 
-<a name="l01449"></a>01449             <span class="keywordflow">if</span> (cpl_table_not_selected(coeff))
-<a name="l01450"></a>01450                 dummy = cpl_table_extract_selected(coeff);
-<a name="l01451"></a>01451             <span class="keywordflow">else</span>
-<a name="l01452"></a>01452                 <span class="keywordflow">break</span>;
-<a name="l01453"></a>01453 
-<a name="l01454"></a>01454             npoints = cpl_table_get_nrow(dummy);
-<a name="l01455"></a>01455 
-<a name="l01456"></a>01456             <span class="keywordflow">if</span> (npoints >= 6) {
-<a name="l01457"></a>01457 
-<a name="l01458"></a>01458                 <span class="keywordflow">if</span> (npoints >= 12)
-<a name="l01459"></a>01459                     order = 2;
-<a name="l01460"></a>01460                 <span class="keywordflow">else</span>
-<a name="l01461"></a>01461                     order = 1;
-<a name="l01462"></a>01462 
-<a name="l01463"></a>01463                 ci = cpl_vector_wrap(npoints,
-<a name="l01464"></a>01464                                      cpl_table_get_data_double(dummy, clab[j]));
-<a name="l01465"></a>01465                 xmask = cpl_vector_wrap(npoints,
-<a name="l01466"></a>01466                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"xmask"</span>));
-<a name="l01467"></a>01467                 ymask = cpl_vector_wrap(npoints,
-<a name="l01468"></a>01468                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"ymask"</span>));
-<a name="l01469"></a>01469                 mask = cpl_bivector_wrap_vectors(xmask, ymask);
-<a name="l01470"></a>01470 
-<a name="l01471"></a>01471                 poly = cpl_polynomial_fit_2d_create(mask, ci, order, NULL);
-<a name="l01472"></a>01472 
-<a name="l01473"></a>01473                 cpl_bivector_unwrap_vectors(mask);
-<a name="l01474"></a>01474                 cpl_vector_unwrap(ci);
-<a name="l01475"></a>01475                 cpl_vector_unwrap(xmask);
-<a name="l01476"></a>01476                 cpl_vector_unwrap(ymask);
-<a name="l01477"></a>01477             }
-<a name="l01478"></a>01478             <span class="keywordflow">else</span> {
-<a name="l01479"></a>01479                 cpl_size p[2] = {0, 0};
-<a name="l01480"></a>01480                 poly = cpl_polynomial_new(2);
-<a name="l01481"></a>01481                 cpl_polynomial_set_coeff(poly, p,
-<a name="l01482"></a>01482                                cpl_table_get_column_median(dummy, clab[j]));
-<a name="l01483"></a>01483             }
-<a name="l01484"></a>01484 
-<a name="l01485"></a>01485             cpl_table_delete(dummy);
-<a name="l01486"></a>01486 
-<a name="l01487"></a>01487             global = <a class="code" href="group__moses.html#g3ad10f4436b713a1e3e3296f3fc0e1a0">write_global_distortion</a>(global, j + 7, poly);
-<a name="l01488"></a>01488 
-<a name="l01489"></a>01489             cpl_polynomial_delete(poly);
-<a name="l01490"></a>01490             cpl_table_select_all(coeff);
-<a name="l01491"></a>01491         }
-<a name="l01492"></a>01492     }
-<a name="l01493"></a>01493 
-<a name="l01494"></a>01494 <span class="comment">/* *+</span>
-<a name="l01495"></a>01495 <span class="comment">printf("error10: %s\n", cpl_error_get_message());</span>
-<a name="l01496"></a>01496 <span class="comment">+* */</span>
-<a name="l01497"></a>01497     cpl_table_delete(coeff);
-<a name="l01498"></a>01498 <span class="comment">/* *+</span>
-<a name="l01499"></a>01499 <span class="comment">printf("error11: %s\n", cpl_error_get_message());</span>
-<a name="l01500"></a>01500 <span class="comment">+* */</span>
-<a name="l01501"></a>01501 
-<a name="l01502"></a>01502     <span class="keywordflow">return</span> global;
-<a name="l01503"></a>01503 
-<a name="l01504"></a>01504 }
-<a name="l01505"></a>01505 
-<a name="l01506"></a>01506 
-<a name="l01544"></a><a class="code" href="group__moses.html#g39dd696d6572e52031e12b1a53e505c2">01544</a> cpl_table *<a class="code" href="group__moses.html#g39dd696d6572e52031e12b1a53e505c2">mos_build_slit_location</a>(cpl_table *global, cpl_table *maskslits,
-<a name="l01545"></a>01545                                    <span class="keywordtype">int</span> ysize)
-<a name="l01546"></a>01546 {
-<a name="l01547"></a>01547     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_build_slit_location"</span>;
-<a name="l01548"></a>01548 
-<a name="l01549"></a>01549     cpl_propertylist *sort_col;
-<a name="l01550"></a>01550     cpl_polynomial   *ids0;
-<a name="l01551"></a>01551     cpl_polynomial   *crv[3];
-<a name="l01552"></a>01552     cpl_polynomial   *loc_crv;
-<a name="l01553"></a>01553     cpl_vector       *point;
-<a name="l01554"></a>01554     cpl_table        *slits;
-<a name="l01555"></a>01555     cpl_size         nslits;
-<a name="l01556"></a>01556     <span class="keywordtype">int</span>              *slit_id;
-<a name="l01557"></a>01557     <span class="keywordtype">double</span>           *dpoint;
-<a name="l01558"></a>01558     <span class="keywordtype">double</span>           *xtop;
-<a name="l01559"></a>01559     <span class="keywordtype">double</span>           *ytop;
-<a name="l01560"></a>01560     <span class="keywordtype">double</span>           *xbottom;
-<a name="l01561"></a>01561     <span class="keywordtype">double</span>           *ybottom;
-<a name="l01562"></a>01562     <span class="keywordtype">double</span>           *mxtop;
-<a name="l01563"></a>01563     <span class="keywordtype">double</span>           *mytop;
-<a name="l01564"></a>01564     <span class="keywordtype">double</span>           *mxbottom;
-<a name="l01565"></a>01565     <span class="keywordtype">double</span>           *mybottom;
-<a name="l01566"></a>01566     cpl_size          i;
-<a name="l01567"></a>01567     cpl_size          j;
-<a name="l01568"></a>01568 
-<a name="l01569"></a>01569 
-<a name="l01570"></a>01570     <span class="keywordflow">if</span> (global == NULL || maskslits == NULL) {
-<a name="l01571"></a>01571         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l01572"></a>01572         <span class="keywordflow">return</span> NULL;
-<a name="l01573"></a>01573     }
-<a name="l01574"></a>01574 
-<a name="l01575"></a>01575     nslits   = cpl_table_get_nrow(maskslits);
-<a name="l01576"></a>01576     slit_id  = cpl_table_get_data_int(maskslits, <span class="stringliteral">"slit_id"</span>);
-<a name="l01577"></a>01577     mxtop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l01578"></a>01578     mytop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);
-<a name="l01579"></a>01579     mxbottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xbottom"</span>);
-<a name="l01580"></a>01580     mybottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ybottom"</span>);
-<a name="l01581"></a>01581 
-<a name="l01582"></a>01582     slits = cpl_table_duplicate(maskslits);
-<a name="l01583"></a>01583 
-<a name="l01584"></a>01584     xtop    = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);
-<a name="l01585"></a>01585     ytop    = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);
-<a name="l01586"></a>01586     xbottom = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);
-<a name="l01587"></a>01587     ybottom = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);
-<a name="l01588"></a>01588 
-<a name="l01589"></a>01589     ids0 = <a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a>(global, 0);
-<a name="l01590"></a>01590     crv[0] = <a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a>(global, 7);
-<a name="l01591"></a>01591     crv[1] = <a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a>(global, 8);
-<a name="l01592"></a>01592     crv[2] = <a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a>(global, 9);
-<a name="l01593"></a>01593 
-<a name="l01594"></a>01594     loc_crv = cpl_polynomial_new(1);
-<a name="l01595"></a>01595 
-<a name="l01596"></a>01596     point = cpl_vector_new(2);
-<a name="l01597"></a>01597     dpoint = cpl_vector_get_data(point);
-<a name="l01598"></a>01598 
-<a name="l01599"></a>01599     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l01600"></a>01600         dpoint[0] = mxtop[i];
-<a name="l01601"></a>01601         dpoint[1] = mytop[i];
-<a name="l01602"></a>01602 
-<a name="l01603"></a>01603         xtop[i] = cpl_polynomial_eval(ids0, point);
-<a name="l01604"></a>01604 
-<a name="l01605"></a>01605         <span class="keywordflow">for</span> (j = 0; j < 3; j++)
-<a name="l01606"></a>01606             <span class="keywordflow">if</span> (crv[j])
-<a name="l01607"></a>01607                 cpl_polynomial_set_coeff(loc_crv, &j, 
-<a name="l01608"></a>01608                                          cpl_polynomial_eval(crv[j], point));
-<a name="l01609"></a>01609 
-<a name="l01610"></a>01610         ytop[i] = cpl_polynomial_eval_1d(loc_crv, xtop[i], NULL);
-<a name="l01611"></a>01611 
-<a name="l01612"></a>01612         dpoint[0] = mxbottom[i];
-<a name="l01613"></a>01613         dpoint[1] = mybottom[i];
-<a name="l01614"></a>01614         xbottom[i] = cpl_polynomial_eval(ids0, point);
-<a name="l01615"></a>01615 
-<a name="l01616"></a>01616         <span class="keywordflow">for</span> (j = 0; j < 3; j++)
-<a name="l01617"></a>01617             <span class="keywordflow">if</span> (crv[j])
-<a name="l01618"></a>01618                 cpl_polynomial_set_coeff(loc_crv, &j,
-<a name="l01619"></a>01619                                          cpl_polynomial_eval(crv[j], point));
-<a name="l01620"></a>01620 
-<a name="l01621"></a>01621         ybottom[i] = cpl_polynomial_eval_1d(loc_crv, xbottom[i], NULL);
-<a name="l01622"></a>01622     }
-<a name="l01623"></a>01623 
-<a name="l01624"></a>01624     cpl_vector_delete(point);
-<a name="l01625"></a>01625     cpl_polynomial_delete(ids0);
-<a name="l01626"></a>01626     cpl_polynomial_delete(loc_crv);
-<a name="l01627"></a>01627     <span class="keywordflow">for</span> (j = 0; j < 3; j++)
-<a name="l01628"></a>01628         cpl_polynomial_delete(crv[j]);
-<a name="l01629"></a>01629 
-<a name="l01630"></a>01630     sort_col = cpl_propertylist_new();
-<a name="l01631"></a>01631     cpl_propertylist_append_bool(sort_col, <span class="stringliteral">"ytop"</span>, 1);
-<a name="l01632"></a>01632     cpl_table_sort(slits, sort_col);
-<a name="l01633"></a>01633     cpl_table_sort(maskslits, sort_col);
-<a name="l01634"></a>01634     cpl_propertylist_delete(sort_col);
-<a name="l01635"></a>01635 
-<a name="l01636"></a>01636     <span class="comment">/*</span>
-<a name="l01637"></a>01637 <span class="comment">     * Eliminate slits which are _entirely_ outside the CCD</span>
-<a name="l01638"></a>01638 <span class="comment">     */</span>
-<a name="l01639"></a>01639 
-<a name="l01640"></a>01640     cpl_table_and_selected_double(slits, <span class="stringliteral">"ybottom"</span>, CPL_GREATER_THAN, ysize-1);
-<a name="l01641"></a>01641     cpl_table_or_selected_double(slits, <span class="stringliteral">"ytop"</span>, CPL_LESS_THAN, 0);
-<a name="l01642"></a>01642     cpl_table_erase_selected(slits);
-<a name="l01643"></a>01643 
-<a name="l01644"></a>01644     nslits = cpl_table_get_nrow(slits);
-<a name="l01645"></a>01645 
-<a name="l01646"></a>01646     <span class="keywordflow">if</span> (nslits == 0) {
-<a name="l01647"></a>01647         cpl_msg_warning(func, <span class="stringliteral">"No slits found on the CCD"</span>);
-<a name="l01648"></a>01648         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l01649"></a>01649         cpl_table_delete(slits);
-<a name="l01650"></a>01650         <span class="keywordflow">return</span> NULL;
-<a name="l01651"></a>01651     }
-<a name="l01652"></a>01652 
-<a name="l01653"></a>01653     <span class="keywordflow">if</span> (nslits > 1)
-<a name="l01654"></a>01654         cpl_msg_info(func, <span class="stringliteral">"Slit location: %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" slits are entirely or partially "</span>
-<a name="l01655"></a>01655                      <span class="stringliteral">"contained in CCD"</span>, nslits);
-<a name="l01656"></a>01656     <span class="keywordflow">else</span>
-<a name="l01657"></a>01657         cpl_msg_info(func, <span class="stringliteral">"Slit location: %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" slit is entirely or partially "</span>
-<a name="l01658"></a>01658                      <span class="stringliteral">"contained in CCD"</span>, nslits);
-<a name="l01659"></a>01659 
-<a name="l01660"></a>01660     <span class="keywordflow">return</span> slits;
-<a name="l01661"></a>01661 
-<a name="l01662"></a>01662 }
-<a name="l01663"></a>01663 
-<a name="l01664"></a>01664 
-<a name="l01691"></a><a class="code" href="group__moses.html#ga010593249434f0bb667af2f2c950951">01691</a> cpl_table *<a class="code" href="group__moses.html#ga010593249434f0bb667af2f2c950951">mos_build_curv_coeff</a>(cpl_table *global, cpl_table *maskslits,
-<a name="l01692"></a>01692                                 cpl_table *slits)
-<a name="l01693"></a>01693 {
-<a name="l01694"></a>01694     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_build_curv_coeff"</span>;
-<a name="l01695"></a>01695 
-<a name="l01696"></a>01696     <span class="keyword">const</span> <span class="keywordtype">char</span>     *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l01697"></a>01697                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l01698"></a>01698 
-<a name="l01699"></a>01699     cpl_polynomial *crv[3];
-<a name="l01700"></a>01700     cpl_vector     *point;
-<a name="l01701"></a>01701     cpl_table      *polytraces;
-<a name="l01702"></a>01702     <span class="keywordtype">double</span>         *dpoint;
-<a name="l01703"></a>01703     <span class="keywordtype">double</span>         *xtop;
-<a name="l01704"></a>01704     <span class="keywordtype">double</span>         *ytop;
-<a name="l01705"></a>01705     <span class="keywordtype">double</span>         *xbottom;
-<a name="l01706"></a>01706     <span class="keywordtype">double</span>         *ybottom;
-<a name="l01707"></a>01707     <span class="keywordtype">int</span>            *slit_id;
-<a name="l01708"></a>01708     <span class="keywordtype">int</span>            *valid_id;
-<a name="l01709"></a>01709     <span class="keywordtype">int</span>             nslits, nvalid;
-<a name="l01710"></a>01710     <span class="keywordtype">int</span>             found;
-<a name="l01711"></a>01711     <span class="keywordtype">int</span>             i, j, k;
-<a name="l01712"></a>01712 
-<a name="l01713"></a>01713 
-<a name="l01714"></a>01714     <span class="keywordflow">if</span> (global == NULL || slits == NULL || maskslits == NULL) {
-<a name="l01715"></a>01715         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l01716"></a>01716         <span class="keywordflow">return</span> NULL;
-<a name="l01717"></a>01717     }
-<a name="l01718"></a>01718 
-<a name="l01719"></a>01719     nslits  = cpl_table_get_nrow(maskslits);
-<a name="l01720"></a>01720     slit_id = cpl_table_get_data_int(maskslits, <span class="stringliteral">"slit_id"</span>);
-<a name="l01721"></a>01721     xtop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l01722"></a>01722     ytop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);
-<a name="l01723"></a>01723     xbottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xbottom"</span>);
-<a name="l01724"></a>01724     ybottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ybottom"</span>);
-<a name="l01725"></a>01725 
-<a name="l01726"></a>01726     polytraces = cpl_table_new(2*nslits);
-<a name="l01727"></a>01727     cpl_table_new_column(polytraces, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l01728"></a>01728     <span class="keywordflow">for</span> (i = 0; i < 3; i++)
-<a name="l01729"></a>01729         cpl_table_new_column(polytraces, clab[i], CPL_TYPE_DOUBLE);
-<a name="l01730"></a>01730 
-<a name="l01731"></a>01731     crv[0] = <a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a>(global, 7);
-<a name="l01732"></a>01732     crv[1] = <a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a>(global, 8);
-<a name="l01733"></a>01733     crv[2] = <a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a>(global, 9);
-<a name="l01734"></a>01734 
-<a name="l01735"></a>01735     point = cpl_vector_new(2);
-<a name="l01736"></a>01736     dpoint = cpl_vector_get_data(point);
-<a name="l01737"></a>01737 
-<a name="l01738"></a>01738     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l01739"></a>01739         <span class="keywordflow">for</span> (j = 0; j < 2; j++) {  <span class="comment">/* For top and bottom trace of each slit */</span>
-<a name="l01740"></a>01740 
-<a name="l01741"></a>01741             cpl_table_set_int(polytraces, <span class="stringliteral">"slit_id"</span>, 2*i+j, slit_id[i]);
-<a name="l01742"></a>01742 
-<a name="l01743"></a>01743             <span class="keywordflow">if</span> (j) {
-<a name="l01744"></a>01744                 dpoint[0] = xbottom[i];
-<a name="l01745"></a>01745                 dpoint[1] = ybottom[i];                
-<a name="l01746"></a>01746             }
-<a name="l01747"></a>01747             <span class="keywordflow">else</span> {
-<a name="l01748"></a>01748                 dpoint[0] = xtop[i];
-<a name="l01749"></a>01749                 dpoint[1] = ytop[i];                
-<a name="l01750"></a>01750             }
-<a name="l01751"></a>01751 
-<a name="l01752"></a>01752             <span class="keywordflow">for</span> (k = 0; k < 3; k++)
-<a name="l01753"></a>01753                 <span class="keywordflow">if</span> (crv[j])
-<a name="l01754"></a>01754                     cpl_table_set_double(polytraces, clab[k], 2*i+j,
-<a name="l01755"></a>01755                                          cpl_polynomial_eval(crv[k], point));
-<a name="l01756"></a>01756         }
-<a name="l01757"></a>01757     }
-<a name="l01758"></a>01758 
-<a name="l01759"></a>01759     cpl_vector_delete(point);
-<a name="l01760"></a>01760     <span class="keywordflow">for</span> (j = 0; j < 3; j++)
-<a name="l01761"></a>01761         cpl_polynomial_delete(crv[j]);
-<a name="l01762"></a>01762 
-<a name="l01763"></a>01763     <span class="comment">/*</span>
-<a name="l01764"></a>01764 <span class="comment">     * Eliminate slits which are _entirely_ outside the CCD</span>
-<a name="l01765"></a>01765 <span class="comment">     */</span>
-<a name="l01766"></a>01766  
-<a name="l01767"></a>01767     nvalid  = cpl_table_get_nrow(slits);
-<a name="l01768"></a>01768     valid_id = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l01769"></a>01769     cpl_table_unselect_all(polytraces);
-<a name="l01770"></a>01770     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l01771"></a>01771         found = 0;
-<a name="l01772"></a>01772         <span class="keywordflow">for</span> (j = 0; j < nvalid; j++) {
-<a name="l01773"></a>01773             <span class="keywordflow">if</span> (slit_id[i] == valid_id[j]) {
-<a name="l01774"></a>01774                 found = 1;
-<a name="l01775"></a>01775                 <span class="keywordflow">break</span>;
-<a name="l01776"></a>01776             }
-<a name="l01777"></a>01777         }
-<a name="l01778"></a>01778         <span class="keywordflow">if</span> (!found) {
-<a name="l01779"></a>01779             cpl_table_select_row(polytraces, 2*i);
-<a name="l01780"></a>01780             cpl_table_select_row(polytraces, 2*i + 1);
-<a name="l01781"></a>01781         }
-<a name="l01782"></a>01782     }
-<a name="l01783"></a>01783     cpl_table_erase_selected(polytraces);
-<a name="l01784"></a>01784  
-<a name="l01785"></a>01785     nslits = cpl_table_get_nrow(polytraces);
-<a name="l01786"></a>01786 
-<a name="l01787"></a>01787     <span class="keywordflow">if</span> (nslits == 0) {
-<a name="l01788"></a>01788         cpl_msg_warning(func, <span class="stringliteral">"No slits found on the CCD"</span>);
-<a name="l01789"></a>01789         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l01790"></a>01790         cpl_table_delete(polytraces);
-<a name="l01791"></a>01791         <span class="keywordflow">return</span> NULL;
-<a name="l01792"></a>01792     }
-<a name="l01793"></a>01793 
-<a name="l01794"></a>01794     <span class="keywordflow">if</span> (nslits > 2) 
-<a name="l01795"></a>01795         cpl_msg_info(func, <span class="stringliteral">"Curvature model: %d slits are entirely or "</span>
-<a name="l01796"></a>01796                      <span class="stringliteral">"partially contained in CCD"</span>, nslits / 2);
-<a name="l01797"></a>01797     <span class="keywordflow">else</span>
-<a name="l01798"></a>01798         cpl_msg_info(func, <span class="stringliteral">"Curvature model: %d slit is entirely or "</span>
-<a name="l01799"></a>01799                      <span class="stringliteral">"partially contained in CCD"</span>, nslits / 2);
-<a name="l01800"></a>01800 
-<a name="l01801"></a>01801     <span class="keywordflow">return</span> polytraces;
-<a name="l01802"></a>01802 }
-<a name="l01803"></a>01803 
-<a name="l01804"></a>01804 
-<a name="l01846"></a><a class="code" href="group__moses.html#gc4a3f1981baef15668137f04c04cf710">01846</a> cpl_table *<a class="code" href="group__moses.html#gc4a3f1981baef15668137f04c04cf710">mos_build_disp_coeff</a>(cpl_table *global, cpl_table *slits)
-<a name="l01847"></a>01847 {
-<a name="l01848"></a>01848     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_build_disp_coeff"</span>;
-<a name="l01849"></a>01849 
-<a name="l01850"></a>01850     <span class="keyword">const</span> <span class="keywordtype">char</span>     *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l01851"></a>01851 
-<a name="l01852"></a>01852     cpl_polynomial *ids[6];
-<a name="l01853"></a>01853     cpl_vector     *point;
-<a name="l01854"></a>01854     cpl_table      *idscoeff;
-<a name="l01855"></a>01855     <span class="keywordtype">double</span>         *dpoint;
-<a name="l01856"></a>01856     <span class="keywordtype">double</span>         *xtop;
-<a name="l01857"></a>01857     <span class="keywordtype">double</span>         *ytop;
-<a name="l01858"></a>01858     <span class="keywordtype">double</span>         *xbottom;
-<a name="l01859"></a>01859     <span class="keywordtype">double</span>         *ybottom;
-<a name="l01860"></a>01860     <span class="keywordtype">int</span>            *position;
-<a name="l01861"></a>01861     <span class="keywordtype">int</span>            *length;
-<a name="l01862"></a>01862     <span class="keywordtype">int</span>             nslits;
-<a name="l01863"></a>01863     <span class="keywordtype">int</span>             nrows;
-<a name="l01864"></a>01864     <span class="keywordtype">int</span>             order;
-<a name="l01865"></a>01865     <span class="keywordtype">int</span>             ylow, yhig;
-<a name="l01866"></a>01866     <span class="keywordtype">int</span>             i, j, k;
-<a name="l01867"></a>01867 
-<a name="l01868"></a>01868 
-<a name="l01869"></a>01869     <span class="keywordflow">if</span> (global == NULL || slits == NULL) {
-<a name="l01870"></a>01870         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l01871"></a>01871         <span class="keywordflow">return</span> NULL;
-<a name="l01872"></a>01872     }
-<a name="l01873"></a>01873     
-<a name="l01874"></a>01874     nslits   = cpl_table_get_nrow(slits);
-<a name="l01875"></a>01875     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);
-<a name="l01876"></a>01876     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l01877"></a>01877     xtop     = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);
-<a name="l01878"></a>01878     ytop     = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);
-<a name="l01879"></a>01879     xbottom  = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);
-<a name="l01880"></a>01880     ybottom  = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);
-<a name="l01881"></a>01881 
-<a name="l01882"></a>01882     <span class="keywordflow">for</span> (i = 0; i < 6; i++)
-<a name="l01883"></a>01883         ids[i] = <a class="code" href="group__moses.html#g61786d7677a2b8dfbde091ae4dfdb54f">read_global_distortion</a>(global, i);
-<a name="l01884"></a>01884 
-<a name="l01885"></a>01885     <span class="keywordflow">for</span> (i = 0; i < 6; i++)
-<a name="l01886"></a>01886         <span class="keywordflow">if</span> (ids[i] == NULL)
-<a name="l01887"></a>01887             <span class="keywordflow">break</span>;
-<a name="l01888"></a>01888 
-<a name="l01889"></a>01889     order = i - 1;
-<a name="l01890"></a>01890 
-<a name="l01891"></a>01891     <span class="keywordflow">if</span> (order < 1) {
-<a name="l01892"></a>01892         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l01893"></a>01893         <span class="keywordflow">return</span> NULL;
-<a name="l01894"></a>01894     }
-<a name="l01895"></a>01895 
-<a name="l01896"></a>01896     nrows = 0;
-<a name="l01897"></a>01897     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)
-<a name="l01898"></a>01898         nrows += length[i]; 
-<a name="l01899"></a>01899 
-<a name="l01900"></a>01900     idscoeff = cpl_table_new(nrows);
-<a name="l01901"></a>01901 
-<a name="l01902"></a>01902     <span class="keywordflow">for</span> (j = 0; j <= order; j++)
-<a name="l01903"></a>01903         cpl_table_new_column(idscoeff, clab[j], CPL_TYPE_DOUBLE);
-<a name="l01904"></a>01904 
-<a name="l01905"></a>01905     cpl_table_new_column(idscoeff, <span class="stringliteral">"error"</span>, CPL_TYPE_DOUBLE);
-<a name="l01906"></a>01906     cpl_table_fill_column_window_double(idscoeff, <span class="stringliteral">"error"</span>, 0, nrows, 0.0);
-<a name="l01907"></a>01907     cpl_table_new_column(idscoeff, <span class="stringliteral">"nlines"</span>, CPL_TYPE_INT);
-<a name="l01908"></a>01908     cpl_table_fill_column_window_int(idscoeff, <span class="stringliteral">"nlines"</span>, 0, nrows, 0);
-<a name="l01909"></a>01909 
-<a name="l01910"></a>01910     point = cpl_vector_new(2);
-<a name="l01911"></a>01911     dpoint = cpl_vector_get_data(point);
-<a name="l01912"></a>01912 
-<a name="l01913"></a>01913     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l01914"></a>01914 
-<a name="l01915"></a>01915         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l01916"></a>01916             <span class="keywordflow">continue</span>;
-<a name="l01917"></a>01917 
-<a name="l01918"></a>01918         ylow = position[i];
-<a name="l01919"></a>01919         yhig = ylow + length[i];
-<a name="l01920"></a>01920 
-<a name="l01921"></a>01921         <span class="keywordflow">for</span> (j = 0; j <= order; j++) {
-<a name="l01922"></a>01922             <span class="keywordflow">if</span> (j) {
-<a name="l01923"></a>01923                 <span class="keywordflow">for</span> (k = 0; k < length[i]; k++) {
-<a name="l01924"></a>01924                     dpoint[0] = xbottom[i] + k*(xtop[i]-xbottom[i])/length[i];
-<a name="l01925"></a>01925                     dpoint[1] = ybottom[i] + k*(ytop[i]-ybottom[i])/length[i];
-<a name="l01926"></a>01926                     cpl_table_set_double(idscoeff, clab[j], ylow + k,
-<a name="l01927"></a>01927                                          cpl_polynomial_eval(ids[j], point));
-<a name="l01928"></a>01928                 }
-<a name="l01929"></a>01929             }
-<a name="l01930"></a>01930             <span class="keywordflow">else</span> {
-<a name="l01931"></a>01931                 <span class="keywordflow">for</span> (k = 0; k < length[i]; k++) {
-<a name="l01932"></a>01932                     cpl_table_set_double(idscoeff, clab[0], ylow + k,
-<a name="l01933"></a>01933                                 xbottom[i] + k*(xtop[i]-xbottom[i])/length[i]);
-<a name="l01934"></a>01934                 }
-<a name="l01935"></a>01935             }
-<a name="l01936"></a>01936         }
-<a name="l01937"></a>01937     }
-<a name="l01938"></a>01938 
-<a name="l01939"></a>01939     cpl_vector_delete(point);
-<a name="l01940"></a>01940     <span class="keywordflow">for</span> (j = 0; j < 6; j++)
-<a name="l01941"></a>01941         cpl_polynomial_delete(ids[j]);
-<a name="l01942"></a>01942 
-<a name="l01943"></a>01943     <span class="keywordflow">return</span> idscoeff;
-<a name="l01944"></a>01944 
-<a name="l01945"></a>01945 }
-<a name="l01946"></a>01946 
-<a name="l01947"></a>01947 
-<a name="l01970"></a><a class="code" href="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f">01970</a> cpl_image *<a class="code" href="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f">mos_subtract_sky</a>(cpl_image *science, cpl_table *slits, 
-<a name="l01971"></a>01971                             cpl_table *polytraces, <span class="keywordtype">double</span> reference, 
-<a name="l01972"></a>01972                             <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion)
-<a name="l01973"></a>01973 {
-<a name="l01974"></a>01974     <span class="keyword">const</span> <span class="keywordtype">char</span>     *func = <span class="stringliteral">"mos_subtract_sky"</span>;
-<a name="l01975"></a>01975 
-<a name="l01976"></a>01976     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l01977"></a>01977                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l01978"></a>01978 
-<a name="l01979"></a>01979     cpl_image      *sky;
-<a name="l01980"></a>01980     cpl_bivector   *<a class="code" href="structlist.html">list</a>;
-<a name="l01981"></a>01981     cpl_vector     *listx;
-<a name="l01982"></a>01982     cpl_vector     *listy;
-<a name="l01983"></a>01983     cpl_polynomial *polytop;
-<a name="l01984"></a>01984     cpl_polynomial *polybot;
-<a name="l01985"></a>01985     cpl_polynomial *trend;
-<a name="l01986"></a>01986 
-<a name="l01987"></a>01987     <span class="keywordtype">int</span>            *slit_id;
-<a name="l01988"></a>01988     <span class="keywordtype">double</span>         *dlistx;
-<a name="l01989"></a>01989     <span class="keywordtype">double</span>         *dlisty;
-<a name="l01990"></a>01990     <span class="keywordtype">float</span>          *sdata;
-<a name="l01991"></a>01991     <span class="keywordtype">float</span>          *kdata;
-<a name="l01992"></a>01992     <span class="keywordtype">double</span>          top, bot;
-<a name="l01993"></a>01993     <span class="keywordtype">int</span>             itop, ibot;
-<a name="l01994"></a>01994     <span class="keywordtype">double</span>          coeff;
-<a name="l01995"></a>01995     <span class="keywordtype">double</span>          ytop, ybot;
-<a name="l01996"></a>01996     <span class="keywordtype">double</span>          m, q, err;
-<a name="l01997"></a>01997     <span class="keywordtype">int</span>             npix;
-<a name="l01998"></a>01998 
-<a name="l01999"></a>01999     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;
-<a name="l02000"></a>02000     <span class="keywordtype">int</span>             nx, ny;
-<a name="l02001"></a>02001     <span class="keywordtype">int</span>             nslits;
-<a name="l02002"></a>02002     <span class="keywordtype">int</span>            *length;
-<a name="l02003"></a>02003     <span class="keywordtype">int</span>             missing_top, missing_bot;
-<a name="l02004"></a>02004     <span class="keywordtype">int</span>             order;
-<a name="l02005"></a>02005     <span class="keywordtype">int</span>             null;
-<a name="l02006"></a>02006     <span class="keywordtype">int</span>             window = 50;  <span class="comment">/* Longer slits have polynomial sky model */</span>
-<a name="l02007"></a>02007     <span class="keywordtype">int</span>             count;
-<a name="l02008"></a>02008     <span class="keywordtype">int</span>             i, j;
-<a name="l02009"></a>02009     cpl_size        k;
-<a name="l02010"></a>02010 
-<a name="l02011"></a>02011 
-<a name="l02012"></a>02012     <span class="keywordflow">if</span> (science == NULL || slits == NULL || polytraces == NULL) {
-<a name="l02013"></a>02013         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l02014"></a>02014         <span class="keywordflow">return</span> NULL;
-<a name="l02015"></a>02015     }
-<a name="l02016"></a>02016  
-<a name="l02017"></a>02017     <span class="keywordflow">if</span> (dispersion <= 0.0) {
-<a name="l02018"></a>02018         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l02019"></a>02019         <span class="keywordflow">return</span> NULL;
-<a name="l02020"></a>02020     }
-<a name="l02021"></a>02021 
-<a name="l02022"></a>02022     <span class="keywordflow">if</span> (red - blue < dispersion) {
-<a name="l02023"></a>02023         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l02024"></a>02024         <span class="keywordflow">return</span> NULL;
-<a name="l02025"></a>02025     }
-<a name="l02026"></a>02026 
-<a name="l02027"></a>02027     nx = cpl_image_get_size_x(science);
-<a name="l02028"></a>02028     ny = cpl_image_get_size_y(science);
-<a name="l02029"></a>02029 
-<a name="l02030"></a>02030     sky = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l02031"></a>02031 
-<a name="l02032"></a>02032     sdata = cpl_image_get_data(science);
-<a name="l02033"></a>02033     kdata = cpl_image_get_data(sky);
-<a name="l02034"></a>02034 
-<a name="l02035"></a>02035     nslits   = cpl_table_get_nrow(slits);
-<a name="l02036"></a>02036     order    = cpl_table_get_ncol(polytraces) - 2;
-<a name="l02037"></a>02037     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l02038"></a>02038     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l02039"></a>02039 
-<a name="l02040"></a>02040     <span class="comment">/*</span>
-<a name="l02041"></a>02041 <span class="comment">     * The spatial resampling is performed for a certain number of</span>
-<a name="l02042"></a>02042 <span class="comment">     * pixels above and below the position of the reference wavelength:</span>
-<a name="l02043"></a>02043 <span class="comment">     */</span>
-<a name="l02044"></a>02044     
-<a name="l02045"></a>02045     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;
-<a name="l02046"></a>02046     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;
-<a name="l02047"></a>02047 
-<a name="l02048"></a>02048     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l02049"></a>02049 
-<a name="l02050"></a>02050         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l02051"></a>02051             <span class="keywordflow">continue</span>;
-<a name="l02052"></a>02052 
-<a name="l02053"></a>02053         
-<a name="l02054"></a>02054         <span class="comment">/*</span>
-<a name="l02055"></a>02055 <span class="comment">         * Recover from the table of spectral curvature coefficients</span>
-<a name="l02056"></a>02056 <span class="comment">         * the curvature polynomials.</span>
-<a name="l02057"></a>02057 <span class="comment">         */</span>
-<a name="l02058"></a>02058 
-<a name="l02059"></a>02059         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);
-<a name="l02060"></a>02060 
-<a name="l02061"></a>02061         start_pixel = refpixel - pixel_below;
-<a name="l02062"></a>02062         <span class="keywordflow">if</span> (start_pixel < 0)
-<a name="l02063"></a>02063             start_pixel = 0;
-<a name="l02064"></a>02064 
-<a name="l02065"></a>02065         end_pixel = refpixel + pixel_above;
-<a name="l02066"></a>02066         <span class="keywordflow">if</span> (end_pixel > nx)
-<a name="l02067"></a>02067             end_pixel = nx;
-<a name="l02068"></a>02068 
-<a name="l02069"></a>02069         missing_top = 0;
-<a name="l02070"></a>02070         polytop = cpl_polynomial_new(1);
-<a name="l02071"></a>02071         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l02072"></a>02072             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);
-<a name="l02073"></a>02073             <span class="keywordflow">if</span> (null) {
-<a name="l02074"></a>02074                 cpl_polynomial_delete(polytop);
-<a name="l02075"></a>02075                 missing_top = 1;
-<a name="l02076"></a>02076                 <span class="keywordflow">break</span>;
-<a name="l02077"></a>02077             }
-<a name="l02078"></a>02078             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l02079"></a>02079         }
-<a name="l02080"></a>02080 
-<a name="l02081"></a>02081         missing_bot = 0;
-<a name="l02082"></a>02082         polybot = cpl_polynomial_new(1);
-<a name="l02083"></a>02083         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l02084"></a>02084             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);
-<a name="l02085"></a>02085             <span class="keywordflow">if</span> (null) {
-<a name="l02086"></a>02086                 cpl_polynomial_delete(polybot);
-<a name="l02087"></a>02087                 missing_bot = 1;
-<a name="l02088"></a>02088                 <span class="keywordflow">break</span>;
-<a name="l02089"></a>02089             }
-<a name="l02090"></a>02090             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l02091"></a>02091         }
-<a name="l02092"></a>02092 
-<a name="l02093"></a>02093         <span class="keywordflow">if</span> (missing_top && missing_bot) {
-<a name="l02094"></a>02094             cpl_msg_debug(func, <span class="stringliteral">"Slit %d was not traced: no extraction!"</span>,
-<a name="l02095"></a>02095                           slit_id[i]);
-<a name="l02096"></a>02096             <span class="keywordflow">continue</span>;
-<a name="l02097"></a>02097         }
-<a name="l02098"></a>02098 
-<a name="l02099"></a>02099         <span class="comment">/*</span>
-<a name="l02100"></a>02100 <span class="comment">         * In case just one of the two edges was not traced, the other</span>
-<a name="l02101"></a>02101 <span class="comment">         * edge curvature model is duplicated and shifted to the other</span>
-<a name="l02102"></a>02102 <span class="comment">         * end of the slit: better than nothing!</span>
-<a name="l02103"></a>02103 <span class="comment">         */</span>
-<a name="l02104"></a>02104 
-<a name="l02105"></a>02105         <span class="keywordflow">if</span> (missing_top) {
-<a name="l02106"></a>02106             cpl_msg_debug(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span>
-<a name="l02107"></a>02107                           <span class="stringliteral">"the spectral curvature of the lower edge "</span>
-<a name="l02108"></a>02108                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l02109"></a>02109             polytop = cpl_polynomial_duplicate(polybot);
-<a name="l02110"></a>02110             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l02111"></a>02111             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l02112"></a>02112             k = 0;
-<a name="l02113"></a>02113             coeff = cpl_polynomial_get_coeff(polybot, &k);
-<a name="l02114"></a>02114             coeff += ytop - ybot;
-<a name="l02115"></a>02115             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l02116"></a>02116         }
-<a name="l02117"></a>02117 
-<a name="l02118"></a>02118         <span class="keywordflow">if</span> (missing_bot) {
-<a name="l02119"></a>02119             cpl_msg_debug(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span>
-<a name="l02120"></a>02120                           <span class="stringliteral">"the spectral curvature of the upper edge "</span>
-<a name="l02121"></a>02121                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l02122"></a>02122             polybot = cpl_polynomial_duplicate(polytop);
-<a name="l02123"></a>02123             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l02124"></a>02124             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l02125"></a>02125             k = 0;
-<a name="l02126"></a>02126             coeff = cpl_polynomial_get_coeff(polytop, &k);
-<a name="l02127"></a>02127             coeff -= ytop - ybot;
-<a name="l02128"></a>02128             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l02129"></a>02129         }
-<a name="l02130"></a>02130 
-<a name="l02131"></a>02131 
-<a name="l02132"></a>02132         <span class="comment">/*</span>
-<a name="l02133"></a>02133 <span class="comment">         * Now read pixel values along spatial direction, and fit them.</span>
-<a name="l02134"></a>02134 <span class="comment">         */</span>
-<a name="l02135"></a>02135 
-<a name="l02136"></a>02136         <span class="keywordflow">for</span> (j = start_pixel; j < end_pixel; j++) {
-<a name="l02137"></a>02137             top = cpl_polynomial_eval_1d(polytop, j, NULL);
-<a name="l02138"></a>02138             bot = cpl_polynomial_eval_1d(polybot, j, NULL);
-<a name="l02139"></a>02139             itop = floor(top + 0.5) + 1;
-<a name="l02140"></a>02140             ibot = floor(bot + 0.5);
-<a name="l02141"></a>02141             <span class="keywordflow">if</span> (itop > ny)
-<a name="l02142"></a>02142                 itop = ny;
-<a name="l02143"></a>02143             <span class="keywordflow">if</span> (ibot < 0)
-<a name="l02144"></a>02144                 ibot = 0;
-<a name="l02145"></a>02145             npix = itop - ibot;
-<a name="l02146"></a>02146             <span class="keywordflow">if</span> (npix < 5)
-<a name="l02147"></a>02147                 <span class="keywordflow">break</span>;
-<a name="l02148"></a>02148 
-<a name="l02149"></a>02149             list = cpl_bivector_new(npix);
-<a name="l02150"></a>02150             listx = cpl_bivector_get_x(list);
-<a name="l02151"></a>02151             listy = cpl_bivector_get_y(list);
-<a name="l02152"></a>02152             dlistx = cpl_vector_get_data(listx);
-<a name="l02153"></a>02153             dlisty = cpl_vector_get_data(listy);
-<a name="l02154"></a>02154 
-<a name="l02155"></a>02155             <span class="keywordflow">for</span> (k = 0; k < npix; k++) {
-<a name="l02156"></a>02156                 dlistx[k] = k;
-<a name="l02157"></a>02157                 dlisty[k] = sdata[j + (ibot + k)*nx];
-<a name="l02158"></a>02158             }
-<a name="l02159"></a>02159 
-<a name="l02160"></a>02160             <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g4b6606e2a44434b722cb25862567e4ff">robustLinearFit</a>(list, &q, &m, &err)) {
-<a name="l02161"></a>02161                 cpl_bivector_delete(list);
-<a name="l02162"></a>02162                 <span class="keywordflow">continue</span>;
-<a name="l02163"></a>02163             }
-<a name="l02164"></a>02164 
-<a name="l02165"></a>02165             cpl_bivector_delete(list);
-<a name="l02166"></a>02166 
-<a name="l02167"></a>02167             <span class="keywordflow">for</span> (k = 0; k < npix; k++) {
-<a name="l02168"></a>02168                 kdata[j + (ibot + k)*nx] = m*k + q;
-<a name="l02169"></a>02169             }
-<a name="l02170"></a>02170 
-<a name="l02171"></a>02171             <span class="keywordflow">if</span> (npix > window) {
-<a name="l02172"></a>02172 
-<a name="l02173"></a>02173                 <span class="comment">/*</span>
-<a name="l02174"></a>02174 <span class="comment">                 * Polynomial iteration</span>
-<a name="l02175"></a>02175 <span class="comment">                 */</span>
-<a name="l02176"></a>02176 
-<a name="l02177"></a>02177                 err = 3*sqrt(err);
-<a name="l02178"></a>02178 
-<a name="l02179"></a>02179                 count = 0;
-<a name="l02180"></a>02180                 <span class="keywordflow">for</span> (k = 0; k < npix; k++)
-<a name="l02181"></a>02181                     <span class="keywordflow">if</span> (fabs(sdata[j + (ibot + k)*nx] - m*k - q) < err)
-<a name="l02182"></a>02182                         count++;
-<a name="l02183"></a>02183 
-<a name="l02184"></a>02184                 <span class="keywordflow">if</span> (count < 10)
-<a name="l02185"></a>02185                     <span class="keywordflow">continue</span>;
-<a name="l02186"></a>02186 
-<a name="l02187"></a>02187                 list = cpl_bivector_new(count);
-<a name="l02188"></a>02188                 listx = cpl_bivector_get_x(list);
-<a name="l02189"></a>02189                 listy = cpl_bivector_get_y(list);
-<a name="l02190"></a>02190                 dlistx = cpl_vector_get_data(listx);
-<a name="l02191"></a>02191                 dlisty = cpl_vector_get_data(listy);
-<a name="l02192"></a>02192 
-<a name="l02193"></a>02193                 count = 0;
-<a name="l02194"></a>02194                 <span class="keywordflow">for</span> (k = 0; k < npix; k++) {
-<a name="l02195"></a>02195                     <span class="keywordflow">if</span> (fabs(sdata[j + (ibot + k)*nx] - m*k - q) < err) {
-<a name="l02196"></a>02196                         dlistx[count] = k;
-<a name="l02197"></a>02197                         dlisty[count] = sdata[j + (ibot + k)*nx];
-<a name="l02198"></a>02198                         count++;
-<a name="l02199"></a>02199                     }
-<a name="l02200"></a>02200                 }
-<a name="l02201"></a>02201 
-<a name="l02202"></a>02202                 trend = cpl_polynomial_fit_1d_create(listx, listy, 2, &err);
-<a name="l02203"></a>02203  
-<a name="l02204"></a>02204                 cpl_bivector_delete(list);
-<a name="l02205"></a>02205 
-<a name="l02206"></a>02206                 err = 3*sqrt(err);
-<a name="l02207"></a>02207 
-<a name="l02208"></a>02208                 count = 0;
-<a name="l02209"></a>02209                 <span class="keywordflow">for</span> (k = 0; k < npix; k++)
-<a name="l02210"></a>02210                     <span class="keywordflow">if</span> (fabs(sdata[j + (ibot + k)*nx] 
-<a name="l02211"></a>02211                              - cpl_polynomial_eval_1d(trend, k, NULL)) < err)
-<a name="l02212"></a>02212                         count++;
-<a name="l02213"></a>02213 
-<a name="l02214"></a>02214                 <span class="keywordflow">if</span> (count < 10) {
-<a name="l02215"></a>02215                     cpl_polynomial_delete(trend);
-<a name="l02216"></a>02216                     <span class="keywordflow">continue</span>;
-<a name="l02217"></a>02217                 }
-<a name="l02218"></a>02218 
-<a name="l02219"></a>02219                 list = cpl_bivector_new(count);
-<a name="l02220"></a>02220                 listx = cpl_bivector_get_x(list);
-<a name="l02221"></a>02221                 listy = cpl_bivector_get_y(list);
-<a name="l02222"></a>02222                 dlistx = cpl_vector_get_data(listx);
-<a name="l02223"></a>02223                 dlisty = cpl_vector_get_data(listy);
-<a name="l02224"></a>02224 
-<a name="l02225"></a>02225                 count = 0;
-<a name="l02226"></a>02226                 <span class="keywordflow">for</span> (k = 0; k < npix; k++) {
-<a name="l02227"></a>02227                     <span class="keywordflow">if</span> (fabs(sdata[j + (ibot + k)*nx] 
-<a name="l02228"></a>02228                              - cpl_polynomial_eval_1d(trend, k, NULL)) < err) {
-<a name="l02229"></a>02229                         dlistx[count] = k;
-<a name="l02230"></a>02230                         dlisty[count] = sdata[j + (ibot + k)*nx];
-<a name="l02231"></a>02231                         count++;
-<a name="l02232"></a>02232                     }
-<a name="l02233"></a>02233                 }
-<a name="l02234"></a>02234 
-<a name="l02235"></a>02235                 cpl_polynomial_delete(trend);
-<a name="l02236"></a>02236 
-<a name="l02237"></a>02237                 trend = cpl_polynomial_fit_1d_create(listx, listy, 3, &err);
-<a name="l02238"></a>02238 
-<a name="l02239"></a>02239                 cpl_bivector_delete(list);
-<a name="l02240"></a>02240  
-<a name="l02241"></a>02241                 <span class="keywordflow">for</span> (k = 0; k < npix; k++) {
-<a name="l02242"></a>02242                     kdata[j + (ibot + k)*nx] = cpl_polynomial_eval_1d(trend, 
-<a name="l02243"></a>02243                                                k, NULL);
-<a name="l02244"></a>02244                 }
-<a name="l02245"></a>02245 
-<a name="l02246"></a>02246                 cpl_polynomial_delete(trend);
-<a name="l02247"></a>02247             }
-<a name="l02248"></a>02248         }
-<a name="l02249"></a>02249         cpl_polynomial_delete(polytop);
-<a name="l02250"></a>02250         cpl_polynomial_delete(polybot);
-<a name="l02251"></a>02251     }
-<a name="l02252"></a>02252 
-<a name="l02253"></a>02253     cpl_image_subtract(science, sky);
-<a name="l02254"></a>02254 
-<a name="l02255"></a>02255     <span class="keywordflow">return</span> sky;
-<a name="l02256"></a>02256 }
-<a name="l02257"></a>02257 
-<a name="l02258"></a>02258 
-<a name="l02291"></a><a class="code" href="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff">02291</a> cpl_image *<a class="code" href="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff">mos_normalise_flat</a>(cpl_image *flat, cpl_image *spatial, 
-<a name="l02292"></a>02292                               cpl_table *slits, cpl_table *polytraces, 
-<a name="l02293"></a>02293                               <span class="keywordtype">double</span> reference, <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, 
-<a name="l02294"></a>02294                               <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> sradius, <span class="keywordtype">int</span> polyorder)
-<a name="l02295"></a>02295 {
-<a name="l02296"></a>02296     <span class="keyword">const</span> <span class="keywordtype">char</span>     *func = <span class="stringliteral">"mos_normalise_flat"</span>;
-<a name="l02297"></a>02297 
-<a name="l02298"></a>02298     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l02299"></a>02299                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l02300"></a>02300 
-<a name="l02301"></a>02301     cpl_image      *rectified;
-<a name="l02302"></a>02302     cpl_image      *smo_flat;
-<a name="l02303"></a>02303     cpl_image      *exslit;
-<a name="l02304"></a>02304     cpl_vector     *positions;
-<a name="l02305"></a>02305     cpl_vector     *flux;
-<a name="l02306"></a>02306     cpl_vector     *smo_flux;
-<a name="l02307"></a>02307     cpl_polynomial *trend;
-<a name="l02308"></a>02308     cpl_polynomial *polytop;
-<a name="l02309"></a>02309     cpl_polynomial *polybot;
-<a name="l02310"></a>02310 
-<a name="l02311"></a>02311     <span class="keywordtype">int</span>            *slit_id;
-<a name="l02312"></a>02312     <span class="keywordtype">float</span>          *p;
-<a name="l02313"></a>02313     <span class="keywordtype">float</span>          *data;
-<a name="l02314"></a>02314     <span class="keywordtype">double</span>         *fdata;
-<a name="l02315"></a>02315     <span class="keywordtype">double</span>         *pdata;
-<a name="l02316"></a>02316     <span class="keywordtype">float</span>          *sdata;
-<a name="l02317"></a>02317     <span class="keywordtype">float</span>          *xdata;
-<a name="l02318"></a>02318     <span class="keywordtype">float</span>          *wdata;
-<a name="l02319"></a>02319     <span class="keywordtype">double</span>          vtop, vbot, value;
-<a name="l02320"></a>02320     <span class="keywordtype">double</span>          top, bot;
-<a name="l02321"></a>02321     <span class="keywordtype">double</span>          coeff;
-<a name="l02322"></a>02322     <span class="keywordtype">double</span>          ytop, ybot;
-<a name="l02323"></a>02323     <span class="keywordtype">double</span>          ypos;
-<a name="l02324"></a>02324     <span class="keywordtype">double</span>          fvalue;
-<a name="l02325"></a>02325     <span class="keywordtype">int</span>             ivalue;
-<a name="l02326"></a>02326     <span class="keywordtype">int</span>             yint, yprev;
-<a name="l02327"></a>02327     <span class="keywordtype">int</span>             npseudo;
-<a name="l02328"></a>02328 
-<a name="l02329"></a>02329     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;
-<a name="l02330"></a>02330     <span class="keywordtype">int</span>             nx, ny, nsubx, nsuby;
-<a name="l02331"></a>02331     <span class="keywordtype">int</span>             xlow, ylow, xhig, yhig;
-<a name="l02332"></a>02332     <span class="keywordtype">int</span>             nslits;
-<a name="l02333"></a>02333     <span class="keywordtype">int</span>            *position;
-<a name="l02334"></a>02334     <span class="keywordtype">int</span>            *length;
-<a name="l02335"></a>02335     <span class="keywordtype">int</span>             missing_top, missing_bot;
-<a name="l02336"></a>02336     <span class="keywordtype">int</span>             order;
-<a name="l02337"></a>02337     <span class="keywordtype">int</span>             npoints;
-<a name="l02338"></a>02338     <span class="keywordtype">int</span>             uradius;
-<a name="l02339"></a>02339     <span class="keywordtype">int</span>             null;
-<a name="l02340"></a>02340     <span class="keywordtype">int</span>             i, j;
-<a name="l02341"></a>02341     cpl_size        k;
-<a name="l02342"></a>02342 
-<a name="l02343"></a>02343 <span class="comment">/*    int             exclude = 5;     Number of excluded pixels at edges */</span>
-<a name="l02344"></a>02344 
-<a name="l02345"></a>02345     <span class="comment">/* For debug puposes only: cpl_image      *smo_rectified; */</span>
-<a name="l02346"></a>02346 
-<a name="l02347"></a>02347 
-<a name="l02348"></a>02348     <span class="keywordflow">if</span> (flat == NULL || slits == NULL || polytraces == NULL) {
-<a name="l02349"></a>02349         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l02350"></a>02350         <span class="keywordflow">return</span> NULL;
-<a name="l02351"></a>02351     }
-<a name="l02352"></a>02352  
-<a name="l02353"></a>02353     <span class="keywordflow">if</span> (dispersion <= 0.0) {
-<a name="l02354"></a>02354         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l02355"></a>02355         <span class="keywordflow">return</span> NULL;
-<a name="l02356"></a>02356     }
-<a name="l02357"></a>02357 
-<a name="l02358"></a>02358     <span class="keywordflow">if</span> (red - blue < dispersion) {
-<a name="l02359"></a>02359         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l02360"></a>02360         <span class="keywordflow">return</span> NULL;
-<a name="l02361"></a>02361     }
-<a name="l02362"></a>02362 
-<a name="l02363"></a>02363     rectified = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(flat, slits, polytraces, reference,
-<a name="l02364"></a>02364                                         blue, red, dispersion, 0, NULL);
-<a name="l02365"></a>02365 
-<a name="l02366"></a>02366     nx = cpl_image_get_size_x(rectified);
-<a name="l02367"></a>02367     ny = cpl_image_get_size_y(rectified);
-<a name="l02368"></a>02368 
-<a name="l02369"></a>02369     smo_flat = cpl_image_new(cpl_image_get_size_x(spatial), 
-<a name="l02370"></a>02370                              cpl_image_get_size_y(spatial), CPL_TYPE_FLOAT);
-<a name="l02371"></a>02371     wdata = cpl_image_get_data(smo_flat);
-<a name="l02372"></a>02372 
-<a name="l02373"></a>02373     nslits   = cpl_table_get_nrow(slits);
-<a name="l02374"></a>02374     order    = cpl_table_get_ncol(polytraces) - 2;
-<a name="l02375"></a>02375     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);
-<a name="l02376"></a>02376     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l02377"></a>02377     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l02378"></a>02378 
-<a name="l02379"></a>02379     <span class="comment">/*</span>
-<a name="l02380"></a>02380 <span class="comment">     * The spatial resampling is performed for a certain number of</span>
-<a name="l02381"></a>02381 <span class="comment">     * pixels above and below the position of the reference wavelength:</span>
-<a name="l02382"></a>02382 <span class="comment">     */</span>
-<a name="l02383"></a>02383     
-<a name="l02384"></a>02384     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;
-<a name="l02385"></a>02385     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;
-<a name="l02386"></a>02386 
-<a name="l02387"></a>02387     xlow = 1;
-<a name="l02388"></a>02388     xhig = nx;
-<a name="l02389"></a>02389     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l02390"></a>02390 
-<a name="l02391"></a>02391         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l02392"></a>02392             <span class="keywordflow">continue</span>;
-<a name="l02393"></a>02393 
-<a name="l02394"></a>02394         <span class="comment">/*</span>
-<a name="l02395"></a>02395 <span class="comment">         * We DON'T write:</span>
-<a name="l02396"></a>02396 <span class="comment">         *</span>
-<a name="l02397"></a>02397 <span class="comment">         * ylow = position[i];</span>
-<a name="l02398"></a>02398 <span class="comment">         * yhig = ylow + length[i];</span>
-<a name="l02399"></a>02399 <span class="comment">         *</span>
-<a name="l02400"></a>02400 <span class="comment">         * because the cpl_image pixels are counted from 1, and because in </span>
-<a name="l02401"></a>02401 <span class="comment">         * cpl_image_extract() the coordinates of the last pixel are inclusive.</span>
-<a name="l02402"></a>02402 <span class="comment">         */</span>
-<a name="l02403"></a>02403 
-<a name="l02404"></a>02404         ylow = position[i] + 1;
-<a name="l02405"></a>02405         yhig = ylow + length[i] - 1;
-<a name="l02406"></a>02406 
-<a name="l02407"></a>02407         exslit = cpl_image_extract(rectified, xlow, ylow, xhig, yhig);
-<a name="l02408"></a>02408 
-<a name="l02409"></a>02409         <span class="keywordflow">if</span> (polyorder < 0) {
-<a name="l02410"></a>02410 
-<a name="l02411"></a>02411             cpl_image_turn(exslit, -1);   <span class="comment">/* For faster memory access */</span>
-<a name="l02412"></a>02412     
-<a name="l02413"></a>02413             nsubx = cpl_image_get_size_x(exslit);
-<a name="l02414"></a>02414             nsuby = cpl_image_get_size_y(exslit);
-<a name="l02415"></a>02415             data = cpl_image_get_data(exslit);
-<a name="l02416"></a>02416             flux = cpl_vector_new(nsubx);
-<a name="l02417"></a>02417 
-<a name="l02418"></a>02418             uradius = nsubx / 2;
-<a name="l02419"></a>02419             <span class="keywordflow">if</span> (uradius > sradius)
-<a name="l02420"></a>02420                 uradius = sradius;
-<a name="l02421"></a>02421 
-<a name="l02422"></a>02422             <span class="keywordflow">for</span> (j = 0; j < nsuby; j++) {
-<a name="l02423"></a>02423                 fdata = cpl_vector_get_data(flux);
-<a name="l02424"></a>02424                 p = data;
-<a name="l02425"></a>02425                 <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)
-<a name="l02426"></a>02426                     *fdata++ = *p++;
-<a name="l02427"></a>02427                 smo_flux = cpl_vector_filter_median_create(flux, uradius);
-<a name="l02428"></a>02428                 fdata = cpl_vector_get_data(smo_flux);
-<a name="l02429"></a>02429                 p = data;
-<a name="l02430"></a>02430                 <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)
-<a name="l02431"></a>02431                     *p++ = *fdata++;
-<a name="l02432"></a>02432                 cpl_vector_delete(smo_flux);
-<a name="l02433"></a>02433                 data += nsubx;
-<a name="l02434"></a>02434             }
-<a name="l02435"></a>02435 
-<a name="l02436"></a>02436             cpl_vector_delete(flux);
-<a name="l02437"></a>02437 
-<a name="l02438"></a>02438 
-<a name="l02439"></a>02439             <span class="comment">/*</span>
-<a name="l02440"></a>02440 <span class="comment">             * First fit fluxes along the spatial direction with a low-degree</span>
-<a name="l02441"></a>02441 <span class="comment">             * polynomial (excluding the first and the last pixels, close to</span>
-<a name="l02442"></a>02442 <span class="comment">             * the edges)</span>
-<a name="l02443"></a>02443 <span class="comment">             */</span>
-<a name="l02444"></a>02444 <span class="comment">/*</span>
-<a name="l02445"></a>02445 <span class="comment">            if (nsubx-2*exclude > 10) {</span>
-<a name="l02446"></a>02446 <span class="comment">                flux = cpl_vector_new(nsubx-2*exclude);</span>
-<a name="l02447"></a>02447 <span class="comment">                fdata = cpl_vector_get_data(flux);</span>
-<a name="l02448"></a>02448 <span class="comment">                positions = cpl_vector_new(nsubx-2*exclude);</span>
-<a name="l02449"></a>02449 <span class="comment">                for (j = 0; j < nsubx-2*exclude; j++)</span>
-<a name="l02450"></a>02450 <span class="comment">                    cpl_vector_set(positions, j, j+exclude);</span>
-<a name="l02451"></a>02451 <span class="comment">        </span>
-<a name="l02452"></a>02452 <span class="comment">                for (k = 0; k < nsuby; k++) {</span>
-<a name="l02453"></a>02453 <span class="comment">                    for (j = 0; j < nsubx-2*exclude; j++)</span>
-<a name="l02454"></a>02454 <span class="comment">                        fdata[j] = data[j+exclude];</span>
-<a name="l02455"></a>02455 <span class="comment">                    trend = cpl_polynomial_fit_1d_create(positions, flux, </span>
-<a name="l02456"></a>02456 <span class="comment">                                                         1, NULL);</span>
-<a name="l02457"></a>02457 <span class="comment">                    for (j = 0; j < nsubx; j++)</span>
-<a name="l02458"></a>02458 <span class="comment">                        data[j] = cpl_polynomial_eval_1d(trend, j, NULL);</span>
-<a name="l02459"></a>02459 <span class="comment">                    cpl_polynomial_delete(trend);</span>
-<a name="l02460"></a>02460 <span class="comment">                    data += nsubx;</span>
-<a name="l02461"></a>02461 <span class="comment">                }</span>
-<a name="l02462"></a>02462 <span class="comment"></span>
-<a name="l02463"></a>02463 <span class="comment">                cpl_vector_delete(flux);</span>
-<a name="l02464"></a>02464 <span class="comment">                cpl_vector_delete(positions);</span>
-<a name="l02465"></a>02465 <span class="comment">            }</span>
-<a name="l02466"></a>02466 <span class="comment">*/</span>
-<a name="l02467"></a>02467 
-<a name="l02468"></a>02468             <span class="comment">/*</span>
-<a name="l02469"></a>02469 <span class="comment">             * Now smooth along the dispersion direction </span>
-<a name="l02470"></a>02470 <span class="comment">             */</span>
-<a name="l02471"></a>02471 
-<a name="l02472"></a>02472             cpl_image_turn(exslit, 1);   <span class="comment">/* For faster memory access */</span>
-<a name="l02473"></a>02473             nsubx = cpl_image_get_size_x(exslit);
-<a name="l02474"></a>02474             nsuby = cpl_image_get_size_y(exslit);
-<a name="l02475"></a>02475             data = cpl_image_get_data(exslit);
-<a name="l02476"></a>02476 
-<a name="l02477"></a>02477             <span class="keywordflow">for</span> (j = 0; j < nsuby; j++) {
-<a name="l02478"></a>02478                 flux = cpl_vector_new(nsubx);
-<a name="l02479"></a>02479                 fdata = cpl_vector_get_data(flux);
-<a name="l02480"></a>02480                 p = data;
-<a name="l02481"></a>02481                 <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)
-<a name="l02482"></a>02482                     *fdata++ = *p++;
-<a name="l02483"></a>02483                 smo_flux = cpl_vector_filter_median_create(flux, sradius);
-<a name="l02484"></a>02484                 cpl_vector_delete(flux);
-<a name="l02485"></a>02485                 fdata = cpl_vector_get_data(smo_flux);
-<a name="l02486"></a>02486                 p = data;
-<a name="l02487"></a>02487                 <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)
-<a name="l02488"></a>02488                     *p++ = *fdata++;
-<a name="l02489"></a>02489                 cpl_vector_delete(smo_flux);
-<a name="l02490"></a>02490                 data += nsubx;
-<a name="l02491"></a>02491             }
-<a name="l02492"></a>02492         }
-<a name="l02493"></a>02493         <span class="keywordflow">else</span> {
-<a name="l02494"></a>02494 
-<a name="l02495"></a>02495             <span class="comment">/*</span>
-<a name="l02496"></a>02496 <span class="comment">             * Fit with a polynomial the flat field trend row by row.</span>
-<a name="l02497"></a>02497 <span class="comment">             */</span>
-<a name="l02498"></a>02498 
-<a name="l02499"></a>02499             nsubx = cpl_image_get_size_x(exslit);
-<a name="l02500"></a>02500             nsuby = cpl_image_get_size_y(exslit);
-<a name="l02501"></a>02501             data = cpl_image_get_data(exslit);
-<a name="l02502"></a>02502 
-<a name="l02503"></a>02503             <span class="keywordflow">for</span> (j = 0; j < nsuby; j++) {
-<a name="l02504"></a>02504 
-<a name="l02505"></a>02505                 <span class="comment">/*</span>
-<a name="l02506"></a>02506 <span class="comment">                 * First get the size of the vectors to allocate:</span>
-<a name="l02507"></a>02507 <span class="comment">                 */</span>
-<a name="l02508"></a>02508 
-<a name="l02509"></a>02509                 npoints = 0;
-<a name="l02510"></a>02510                 p = data + j*nsubx;
-<a name="l02511"></a>02511                 <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)
-<a name="l02512"></a>02512                     <span class="keywordflow">if</span> (p[k] > 1.0)
-<a name="l02513"></a>02513                         npoints++;
-<a name="l02514"></a>02514 
-<a name="l02515"></a>02515                 <span class="keywordflow">if</span> (npoints > polyorder + 1) {
-<a name="l02516"></a>02516 
-<a name="l02517"></a>02517                     <span class="comment">/*</span>
-<a name="l02518"></a>02518 <span class="comment">                     * Fill the vectors for the fitting</span>
-<a name="l02519"></a>02519 <span class="comment">                     */</span>
-<a name="l02520"></a>02520 
-<a name="l02521"></a>02521                     flux = cpl_vector_new(npoints);
-<a name="l02522"></a>02522                     fdata = cpl_vector_get_data(flux);
-<a name="l02523"></a>02523                     positions = cpl_vector_new(npoints);
-<a name="l02524"></a>02524                     pdata = cpl_vector_get_data(positions);
-<a name="l02525"></a>02525 
-<a name="l02526"></a>02526                     npoints = 0;
-<a name="l02527"></a>02527                     p = data + j*nsubx;
-<a name="l02528"></a>02528                     <span class="keywordflow">for</span> (k = 0; k < nsubx; k++) {
-<a name="l02529"></a>02529                         <span class="keywordflow">if</span> (p[k] > 1.0) {
-<a name="l02530"></a>02530                             fdata[npoints] = p[k];
-<a name="l02531"></a>02531                             pdata[npoints] = k;
-<a name="l02532"></a>02532                             npoints++;
-<a name="l02533"></a>02533                         }
-<a name="l02534"></a>02534                     }
-<a name="l02535"></a>02535     
-<a name="l02536"></a>02536                     trend = cpl_polynomial_fit_1d_create(positions, flux, 
-<a name="l02537"></a>02537                                                          polyorder, NULL);
-<a name="l02538"></a>02538 
-<a name="l02539"></a>02539                     cpl_vector_delete(flux);
-<a name="l02540"></a>02540                     cpl_vector_delete(positions);
-<a name="l02541"></a>02541 
-<a name="l02542"></a>02542                     <span class="keywordflow">if</span> (trend) {
-<a name="l02543"></a>02543                         p = data + j*nsubx;
-<a name="l02544"></a>02544                         <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)
-<a name="l02545"></a>02545                             <span class="keywordflow">if</span> (p[k] > 1.0)
-<a name="l02546"></a>02546                                 p[k] = cpl_polynomial_eval_1d(trend, k, NULL);
-<a name="l02547"></a>02547                         cpl_polynomial_delete(trend);
-<a name="l02548"></a>02548                     }
-<a name="l02549"></a>02549                     <span class="keywordflow">else</span> {
-<a name="l02550"></a>02550                         cpl_msg_warning(func, <span class="stringliteral">"Invalid flat field flux fit "</span>
-<a name="l02551"></a>02551                                         <span class="stringliteral">"(ignored)"</span>);
-<a name="l02552"></a>02552                     }
-<a name="l02553"></a>02553                 }
-<a name="l02554"></a>02554             }
-<a name="l02555"></a>02555         }
-<a name="l02556"></a>02556 
-<a name="l02557"></a>02557         
-<a name="l02558"></a>02558         <span class="comment">/*</span>
-<a name="l02559"></a>02559 <span class="comment">         * Recover from the table of spectral curvature coefficients</span>
-<a name="l02560"></a>02560 <span class="comment">         * the curvature polynomials.</span>
-<a name="l02561"></a>02561 <span class="comment">         */</span>
-<a name="l02562"></a>02562 
-<a name="l02563"></a>02563         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);
-<a name="l02564"></a>02564 
-<a name="l02565"></a>02565         start_pixel = refpixel - pixel_below;
-<a name="l02566"></a>02566         <span class="keywordflow">if</span> (start_pixel < 0)
-<a name="l02567"></a>02567             start_pixel = 0;
-<a name="l02568"></a>02568 
-<a name="l02569"></a>02569         end_pixel = refpixel + pixel_above;
-<a name="l02570"></a>02570         <span class="keywordflow">if</span> (end_pixel > nx)
-<a name="l02571"></a>02571             end_pixel = nx;
-<a name="l02572"></a>02572 
-<a name="l02573"></a>02573         missing_top = 0;
-<a name="l02574"></a>02574         polytop = cpl_polynomial_new(1);
-<a name="l02575"></a>02575         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l02576"></a>02576             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);
-<a name="l02577"></a>02577             <span class="keywordflow">if</span> (null) {
-<a name="l02578"></a>02578                 cpl_polynomial_delete(polytop);
-<a name="l02579"></a>02579                 missing_top = 1;
-<a name="l02580"></a>02580                 <span class="keywordflow">break</span>;
-<a name="l02581"></a>02581             }
-<a name="l02582"></a>02582             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l02583"></a>02583         }
-<a name="l02584"></a>02584 
-<a name="l02585"></a>02585         missing_bot = 0;
-<a name="l02586"></a>02586         polybot = cpl_polynomial_new(1);
-<a name="l02587"></a>02587         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l02588"></a>02588             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);
-<a name="l02589"></a>02589             <span class="keywordflow">if</span> (null) {
-<a name="l02590"></a>02590                 cpl_polynomial_delete(polybot);
-<a name="l02591"></a>02591                 missing_bot = 1;
-<a name="l02592"></a>02592                 <span class="keywordflow">break</span>;
-<a name="l02593"></a>02593             }
-<a name="l02594"></a>02594             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l02595"></a>02595         }
-<a name="l02596"></a>02596 
-<a name="l02597"></a>02597         <span class="keywordflow">if</span> (missing_top && missing_bot) {
-<a name="l02598"></a>02598             cpl_msg_debug(func, <span class="stringliteral">"Slit %d was not traced: no extraction!"</span>,
-<a name="l02599"></a>02599                           slit_id[i]);
-<a name="l02600"></a>02600             <span class="keywordflow">continue</span>;
-<a name="l02601"></a>02601         }
-<a name="l02602"></a>02602 
-<a name="l02603"></a>02603         <span class="comment">/*</span>
-<a name="l02604"></a>02604 <span class="comment">         * In case just one of the two edges was not traced, the other</span>
-<a name="l02605"></a>02605 <span class="comment">         * edge curvature model is duplicated and shifted to the other</span>
-<a name="l02606"></a>02606 <span class="comment">         * end of the slit: better than nothing!</span>
-<a name="l02607"></a>02607 <span class="comment">         */</span>
-<a name="l02608"></a>02608 
-<a name="l02609"></a>02609         <span class="keywordflow">if</span> (missing_top) {
-<a name="l02610"></a>02610             cpl_msg_debug(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span>
-<a name="l02611"></a>02611                           <span class="stringliteral">"the spectral curvature of the lower edge "</span>
-<a name="l02612"></a>02612                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l02613"></a>02613             polytop = cpl_polynomial_duplicate(polybot);
-<a name="l02614"></a>02614             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l02615"></a>02615             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l02616"></a>02616             k = 0;
-<a name="l02617"></a>02617             coeff = cpl_polynomial_get_coeff(polybot, &k);
-<a name="l02618"></a>02618             coeff += ytop - ybot;
-<a name="l02619"></a>02619             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l02620"></a>02620         }
-<a name="l02621"></a>02621 
-<a name="l02622"></a>02622         <span class="keywordflow">if</span> (missing_bot) {
-<a name="l02623"></a>02623             cpl_msg_debug(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span>
-<a name="l02624"></a>02624                           <span class="stringliteral">"the spectral curvature of the upper edge "</span>
-<a name="l02625"></a>02625                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l02626"></a>02626             polybot = cpl_polynomial_duplicate(polytop);
-<a name="l02627"></a>02627             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l02628"></a>02628             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l02629"></a>02629             k = 0;
-<a name="l02630"></a>02630             coeff = cpl_polynomial_get_coeff(polytop, &k);
-<a name="l02631"></a>02631             coeff -= ytop - ybot;
-<a name="l02632"></a>02632             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l02633"></a>02633         }
-<a name="l02634"></a>02634 
-<a name="l02635"></a>02635 
-<a name="l02636"></a>02636         <span class="comment">/*</span>
-<a name="l02637"></a>02637 <span class="comment">         * Now map smoothed image to CCD.</span>
-<a name="l02638"></a>02638 <span class="comment">         * Note that the npseudo value related to this slit is equal</span>
-<a name="l02639"></a>02639 <span class="comment">         * to the number of spatial pseudo-pixels decreased by 1</span>
-<a name="l02640"></a>02640 <span class="comment">         * (compare with function mos_spatial_calibration()).</span>
-<a name="l02641"></a>02641 <span class="comment">         */</span>
-<a name="l02642"></a>02642 
-<a name="l02643"></a>02643         nx = cpl_image_get_size_x(flat);
-<a name="l02644"></a>02644         ny = cpl_image_get_size_y(flat);
-<a name="l02645"></a>02645 
-<a name="l02646"></a>02646         sdata = cpl_image_get_data(spatial);
-<a name="l02647"></a>02647         xdata = cpl_image_get_data(exslit);
-<a name="l02648"></a>02648         npseudo = cpl_image_get_size_y(exslit) - 1;
-<a name="l02649"></a>02649 
-<a name="l02650"></a>02650         <span class="comment">/*</span>
-<a name="l02651"></a>02651 <span class="comment">         * Write interpolated smoothed values to CCD image</span>
-<a name="l02652"></a>02652 <span class="comment">         */</span>
-<a name="l02653"></a>02653 
-<a name="l02654"></a>02654         <span class="keywordflow">for</span> (j = start_pixel; j < end_pixel; j++) {
-<a name="l02655"></a>02655             top = cpl_polynomial_eval_1d(polytop, j, NULL);
-<a name="l02656"></a>02656             bot = cpl_polynomial_eval_1d(polybot, j, NULL);
-<a name="l02657"></a>02657             <span class="keywordflow">for</span> (k = 0; k <= npseudo; k++) {
-<a name="l02658"></a>02658                 ypos = top - k*(top-bot)/npseudo;
-<a name="l02659"></a>02659                 yint = ypos;
-<a name="l02660"></a>02660 
-<a name="l02661"></a>02661                 <span class="comment">/*</span>
-<a name="l02662"></a>02662 <span class="comment">                 * The line:</span>
-<a name="l02663"></a>02663 <span class="comment">                 *     value = sdata[j + nx*yint];</span>
-<a name="l02664"></a>02664 <span class="comment">                 * should be equivalent to:</span>
-<a name="l02665"></a>02665 <span class="comment">                 *     value = npseudo*(top-yint)/(top-bot);</span>
-<a name="l02666"></a>02666 <span class="comment">                 */</span>
-<a name="l02667"></a>02667 
-<a name="l02668"></a>02668                 <span class="keywordflow">if</span> (yint < 0 || yint >= ny-1) {
-<a name="l02669"></a>02669                     yprev = yint;
-<a name="l02670"></a>02670                     <span class="keywordflow">continue</span>;
-<a name="l02671"></a>02671                 }
-<a name="l02672"></a>02672 
-<a name="l02673"></a>02673                 value = sdata[j + nx*yint];   <span class="comment">/* Spatial coordinate on CCD */</span>
-<a name="l02674"></a>02674                 ivalue = value;               <span class="comment">/* Nearest spatial pixels:   */</span>
-<a name="l02675"></a>02675                 fvalue = value - ivalue;      <span class="comment">/* ivalue and ivalue+1       */</span>
-<a name="l02676"></a>02676                 <span class="keywordflow">if</span> (ivalue < npseudo && ivalue >= 0) {
-<a name="l02677"></a>02677                     vtop = xdata[j + nx*(npseudo-ivalue)];
-<a name="l02678"></a>02678                     vbot = xdata[j + nx*(npseudo-ivalue-1)];
-<a name="l02679"></a>02679                     wdata[j + nx*yint] = vtop*(1-fvalue) + vbot*fvalue;
-<a name="l02680"></a>02680 
-<a name="l02681"></a>02681                     <span class="keywordflow">if</span> (k) {
-<a name="l02682"></a>02682 
-<a name="l02683"></a>02683                         <span class="comment">/*</span>
-<a name="l02684"></a>02684 <span class="comment">                         * This is added to recover lost pixels on</span>
-<a name="l02685"></a>02685 <span class="comment">                         * the CCD image (pixels are lost because</span>
-<a name="l02686"></a>02686 <span class="comment">                         * the CCD pixels are less than npseudo+1).</span>
-<a name="l02687"></a>02687 <span class="comment">                         */</span>
-<a name="l02688"></a>02688 
-<a name="l02689"></a>02689                         <span class="keywordflow">if</span> (yprev - yint > 1) {
-<a name="l02690"></a>02690                             value = sdata[j + nx*(yint+1)];
-<a name="l02691"></a>02691                             ivalue = value;
-<a name="l02692"></a>02692                             fvalue = value - ivalue;
-<a name="l02693"></a>02693                             <span class="keywordflow">if</span> (ivalue < npseudo && ivalue >= 0) {
-<a name="l02694"></a>02694                                 vtop = xdata[j + nx*(npseudo-ivalue)];
-<a name="l02695"></a>02695                                 vbot = xdata[j + nx*(npseudo-ivalue-1)];
-<a name="l02696"></a>02696                                 wdata[j + nx*(yint+1)] = vtop*(1-fvalue) 
-<a name="l02697"></a>02697                                                        + vbot*fvalue;
-<a name="l02698"></a>02698                             }
-<a name="l02699"></a>02699                         }
-<a name="l02700"></a>02700                     }
-<a name="l02701"></a>02701                 }
-<a name="l02702"></a>02702                 yprev = yint;
-<a name="l02703"></a>02703             }
-<a name="l02704"></a>02704         }
-<a name="l02705"></a>02705         cpl_polynomial_delete(polytop);
-<a name="l02706"></a>02706         cpl_polynomial_delete(polybot);
-<a name="l02707"></a>02707         cpl_image_delete(exslit);
-<a name="l02708"></a>02708     }
-<a name="l02709"></a>02709 
-<a name="l02710"></a>02710     cpl_image_delete(rectified);
-<a name="l02711"></a>02711 
-<a name="l02712"></a>02712     cpl_image_divide(flat, smo_flat);
-<a name="l02713"></a>02713 
-<a name="l02714"></a>02714     <span class="keywordflow">return</span> smo_flat;
-<a name="l02715"></a>02715 }
-<a name="l02716"></a>02716 
-<a name="l02717"></a>02717 
-<a name="l02742"></a><a class="code" href="group__moses.html#g9c5947c76fc1246f203a1c6ebc6c9569">02742</a> cpl_image *<a class="code" href="group__moses.html#g9c5947c76fc1246f203a1c6ebc6c9569">mos_normalise_longflat</a>(cpl_image *flat, <span class="keywordtype">int</span> sradius, <span class="keywordtype">int</span> dradius, 
-<a name="l02743"></a>02743                                   <span class="keywordtype">int</span> polyorder)
-<a name="l02744"></a>02744 {
-<a name="l02745"></a>02745     <span class="keyword">const</span> <span class="keywordtype">char</span>     *func = <span class="stringliteral">"mos_normalise_longflat"</span>;
-<a name="l02746"></a>02746 
-<a name="l02747"></a>02747     cpl_image      *smo_flat;
-<a name="l02748"></a>02748     cpl_image      *profile;
-<a name="l02749"></a>02749     cpl_vector     *flux;
-<a name="l02750"></a>02750     cpl_vector     *smo_flux;
-<a name="l02751"></a>02751     cpl_vector     *positions;
-<a name="l02752"></a>02752     cpl_polynomial *trend;
-<a name="l02753"></a>02753 
-<a name="l02754"></a>02754     <span class="keywordtype">float</span>          *level;
-<a name="l02755"></a>02755     <span class="keywordtype">float</span>          *p;
-<a name="l02756"></a>02756     <span class="keywordtype">float</span>          *data;
-<a name="l02757"></a>02757     <span class="keywordtype">double</span>         *fdata;
-<a name="l02758"></a>02758     <span class="keywordtype">double</span>         *pdata;
-<a name="l02759"></a>02759 
-<a name="l02760"></a>02760     <span class="keywordtype">int</span>             nx, ny;
-<a name="l02761"></a>02761     <span class="keywordtype">int</span>             npoints;
-<a name="l02762"></a>02762     <span class="keywordtype">int</span>             i, j;
-<a name="l02763"></a>02763 
-<a name="l02764"></a>02764 
-<a name="l02765"></a>02765     <span class="keywordflow">if</span> (flat == NULL) {
-<a name="l02766"></a>02766         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l02767"></a>02767         <span class="keywordflow">return</span> NULL;
-<a name="l02768"></a>02768     }
-<a name="l02769"></a>02769  
-<a name="l02770"></a>02770     <span class="keywordflow">if</span> (sradius < 1 || dradius < 1) {
-<a name="l02771"></a>02771         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l02772"></a>02772         <span class="keywordflow">return</span> NULL;
-<a name="l02773"></a>02773     }
-<a name="l02774"></a>02774 
-<a name="l02775"></a>02775     smo_flat = cpl_image_duplicate(flat);
-<a name="l02776"></a>02776 
-<a name="l02777"></a>02777     <span class="keywordflow">if</span> (polyorder < 0) {
-<a name="l02778"></a>02778 
-<a name="l02779"></a>02779         <span class="comment">/*</span>
-<a name="l02780"></a>02780 <span class="comment">         * First smooth along the spatial direction</span>
-<a name="l02781"></a>02781 <span class="comment">         */</span>
-<a name="l02782"></a>02782 
-<a name="l02783"></a>02783         cpl_image_turn(smo_flat, -1);   <span class="comment">/* For faster memory access */</span>
-<a name="l02784"></a>02784 
-<a name="l02785"></a>02785         nx = cpl_image_get_size_x(smo_flat);
-<a name="l02786"></a>02786         ny = cpl_image_get_size_y(smo_flat);
-<a name="l02787"></a>02787         data = cpl_image_get_data(smo_flat);
-<a name="l02788"></a>02788     
-<a name="l02789"></a>02789         <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l02790"></a>02790             flux = cpl_vector_new(nx);
-<a name="l02791"></a>02791             fdata = cpl_vector_get_data(flux);
-<a name="l02792"></a>02792             p = data;
-<a name="l02793"></a>02793             <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l02794"></a>02794                 *fdata++ = *p++;
-<a name="l02795"></a>02795             smo_flux = cpl_vector_filter_median_create(flux, sradius);
-<a name="l02796"></a>02796             cpl_vector_delete(flux);
-<a name="l02797"></a>02797             fdata = cpl_vector_get_data(smo_flux);
-<a name="l02798"></a>02798             p = data;
-<a name="l02799"></a>02799             <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l02800"></a>02800                 *p++ = *fdata++;
-<a name="l02801"></a>02801             cpl_vector_delete(smo_flux);
-<a name="l02802"></a>02802             data += nx;
-<a name="l02803"></a>02803         }
-<a name="l02804"></a>02804 
-<a name="l02805"></a>02805         <span class="comment">/*</span>
-<a name="l02806"></a>02806 <span class="comment">         * Second smooth along the dispersion direction</span>
-<a name="l02807"></a>02807 <span class="comment">         */</span>
-<a name="l02808"></a>02808 
-<a name="l02809"></a>02809         cpl_image_turn(smo_flat, 1);   <span class="comment">/* For faster memory access */</span>
-<a name="l02810"></a>02810 
-<a name="l02811"></a>02811         nx = cpl_image_get_size_x(smo_flat);
-<a name="l02812"></a>02812         ny = cpl_image_get_size_y(smo_flat);
-<a name="l02813"></a>02813         data = cpl_image_get_data(smo_flat);
-<a name="l02814"></a>02814 
-<a name="l02815"></a>02815         <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l02816"></a>02816             flux = cpl_vector_new(nx);
-<a name="l02817"></a>02817             fdata = cpl_vector_get_data(flux);
-<a name="l02818"></a>02818             p = data;
-<a name="l02819"></a>02819             <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l02820"></a>02820                 *fdata++ = *p++;
-<a name="l02821"></a>02821             smo_flux = cpl_vector_filter_median_create(flux, sradius);
-<a name="l02822"></a>02822             cpl_vector_delete(flux);
-<a name="l02823"></a>02823             fdata = cpl_vector_get_data(smo_flux);
-<a name="l02824"></a>02824             p = data;
-<a name="l02825"></a>02825             <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l02826"></a>02826                 *p++ = *fdata++;
-<a name="l02827"></a>02827             cpl_vector_delete(smo_flux);
-<a name="l02828"></a>02828             data += nx;
-<a name="l02829"></a>02829         }
-<a name="l02830"></a>02830     }
-<a name="l02831"></a>02831     <span class="keywordflow">else</span> {
-<a name="l02832"></a>02832 
-<a name="l02833"></a>02833         <span class="comment">/*</span>
-<a name="l02834"></a>02834 <span class="comment">         * Fit with a polynomial the flat field trend column by column.</span>
-<a name="l02835"></a>02835 <span class="comment">         */</span>
-<a name="l02836"></a>02836 
-<a name="l02837"></a>02837         cpl_image_turn(smo_flat, -1);   <span class="comment">/* For faster memory access */</span>
-<a name="l02838"></a>02838 
-<a name="l02839"></a>02839         nx = cpl_image_get_size_x(smo_flat);
-<a name="l02840"></a>02840         ny = cpl_image_get_size_y(smo_flat);
-<a name="l02841"></a>02841         data = cpl_image_get_data(smo_flat);
-<a name="l02842"></a>02842 
-<a name="l02843"></a>02843         profile = cpl_image_collapse_median_create(smo_flat, 1, 0, 0);
-<a name="l02844"></a>02844         level = cpl_image_get_data(profile);
-<a name="l02845"></a>02845 
-<a name="l02846"></a>02846         <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l02847"></a>02847 
-<a name="l02848"></a>02848             <span class="comment">/*</span>
-<a name="l02849"></a>02849 <span class="comment">             * First get the size of the vectors to allocate:</span>
-<a name="l02850"></a>02850 <span class="comment">             * eliminate from fit any value more than 20% away</span>
-<a name="l02851"></a>02851 <span class="comment">             * from median level in current column.</span>
-<a name="l02852"></a>02852 <span class="comment">             */</span>
-<a name="l02853"></a>02853 
-<a name="l02854"></a>02854             npoints = 0;
-<a name="l02855"></a>02855             p = data + i*nx;
-<a name="l02856"></a>02856             <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l02857"></a>02857                 <span class="keywordflow">if</span> (fabs(p[j]/level[i] - 1) < 0.20)
-<a name="l02858"></a>02858                     npoints++;
-<a name="l02859"></a>02859 
-<a name="l02860"></a>02860             <span class="keywordflow">if</span> (npoints > polyorder + 1) {
-<a name="l02861"></a>02861 
-<a name="l02862"></a>02862                 <span class="comment">/*</span>
-<a name="l02863"></a>02863 <span class="comment">                 * Fill the vectors for the fitting</span>
-<a name="l02864"></a>02864 <span class="comment">                 */</span>
-<a name="l02865"></a>02865 
-<a name="l02866"></a>02866                 flux = cpl_vector_new(npoints);
-<a name="l02867"></a>02867                 fdata = cpl_vector_get_data(flux);
-<a name="l02868"></a>02868                 positions = cpl_vector_new(npoints);
-<a name="l02869"></a>02869                 pdata = cpl_vector_get_data(positions);
-<a name="l02870"></a>02870 
-<a name="l02871"></a>02871                 npoints = 0;
-<a name="l02872"></a>02872                 p = data + i*nx;
-<a name="l02873"></a>02873                 <span class="keywordflow">for</span> (j = 0; j < nx; j++) {
-<a name="l02874"></a>02874                     <span class="keywordflow">if</span> (fabs(p[j]/level[i] - 1) < 0.20) {
-<a name="l02875"></a>02875                         fdata[npoints] = p[j];
-<a name="l02876"></a>02876                         pdata[npoints] = j;
-<a name="l02877"></a>02877                         npoints++;
-<a name="l02878"></a>02878                     }
-<a name="l02879"></a>02879                 }
-<a name="l02880"></a>02880     
-<a name="l02881"></a>02881                 trend = cpl_polynomial_fit_1d_create(positions, flux, 
-<a name="l02882"></a>02882                                                      polyorder, NULL);
-<a name="l02883"></a>02883 
-<a name="l02884"></a>02884                 cpl_vector_delete(flux);
-<a name="l02885"></a>02885                 cpl_vector_delete(positions);
-<a name="l02886"></a>02886 
-<a name="l02887"></a>02887                 <span class="keywordflow">if</span> (trend) {
-<a name="l02888"></a>02888                     p = data + i*nx;
-<a name="l02889"></a>02889                     <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l02890"></a>02890                         p[j] = cpl_polynomial_eval_1d(trend, j, NULL);
-<a name="l02891"></a>02891                     cpl_polynomial_delete(trend);
-<a name="l02892"></a>02892                 }
-<a name="l02893"></a>02893                 <span class="keywordflow">else</span> {
-<a name="l02894"></a>02894                     cpl_msg_warning(func, 
-<a name="l02895"></a>02895                                     <span class="stringliteral">"Invalid flat field flux fit (ignored)"</span>);
-<a name="l02896"></a>02896                 }
-<a name="l02897"></a>02897             }
-<a name="l02898"></a>02898         }
-<a name="l02899"></a>02899 
-<a name="l02900"></a>02900         cpl_image_delete(profile);
-<a name="l02901"></a>02901         cpl_image_turn(smo_flat, 1);
-<a name="l02902"></a>02902 
-<a name="l02903"></a>02903     }
-<a name="l02904"></a>02904 
-<a name="l02905"></a>02905     cpl_image_divide(flat, smo_flat);
-<a name="l02906"></a>02906 
-<a name="l02907"></a>02907     <span class="keywordflow">return</span> smo_flat;
-<a name="l02908"></a>02908 }
-<a name="l02909"></a>02909 
-<a name="l02910"></a>02910 
-<a name="l02933"></a><a class="code" href="group__moses.html#ga06affb6c77aac402204d1065f1de8ea">02933</a> cpl_error_code <a class="code" href="group__moses.html#ga06affb6c77aac402204d1065f1de8ea">mos_interpolate_wavecalib_slit</a>(cpl_table *idscoeff,
-<a name="l02934"></a>02934                                               cpl_table *slits, 
-<a name="l02935"></a>02935                                               <span class="keywordtype">int</span> order, <span class="keywordtype">int</span> global)
-<a name="l02936"></a>02936 {
-<a name="l02937"></a>02937     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l02938"></a>02938                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l02939"></a>02939     <span class="keywordtype">int</span> nrow = cpl_table_get_nrow(slits);
-<a name="l02940"></a>02940     <span class="keywordtype">int</span> i, j;
-<a name="l02941"></a>02941 
-<a name="l02942"></a>02942     
-<a name="l02943"></a>02943     <span class="keywordflow">if</span> (order < 0)
-<a name="l02944"></a>02944         <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l02945"></a>02945 
-<a name="l02946"></a>02946     cpl_table_new_column(idscoeff, <span class="stringliteral">"x"</span>, CPL_TYPE_DOUBLE);
-<a name="l02947"></a>02947     cpl_table_new_column(idscoeff, <span class="stringliteral">"y"</span>, CPL_TYPE_DOUBLE);
-<a name="l02948"></a>02948 
-<a name="l02949"></a>02949     <span class="keywordflow">for</span> (i = 0; i < nrow; i++) {
-<a name="l02950"></a>02950         <span class="keywordtype">int</span>        position = cpl_table_get_int   (slits, <span class="stringliteral">"position"</span>, i, NULL);
-<a name="l02951"></a>02951         <span class="keywordtype">int</span>        length   = cpl_table_get_int   (slits, <span class="stringliteral">"length"</span>,   i, NULL);
-<a name="l02952"></a>02952         <span class="keywordtype">double</span>     xtop     = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>,     i, NULL);
-<a name="l02953"></a>02953         <span class="keywordtype">double</span>     xbot     = cpl_table_get_double(slits, <span class="stringliteral">"xbottom"</span>,  i, NULL);
-<a name="l02954"></a>02954         <span class="keywordtype">double</span>     ytop     = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>,     i, NULL);
-<a name="l02955"></a>02955         <span class="keywordtype">double</span>     ybot     = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>,  i, NULL);
-<a name="l02956"></a>02956         <span class="keywordtype">double</span>     dx       = xtop - xbot;
-<a name="l02957"></a>02957         <span class="keywordtype">double</span>     dy       = ytop - ybot;
-<a name="l02958"></a>02958         cpl_table *table    = cpl_table_extract(idscoeff, position, length);
-<a name="l02959"></a>02959 
-<a name="l02960"></a>02960         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">mos_interpolate_wavecalib</a>(table, NULL, 2, order))
-<a name="l02961"></a>02961             <span class="keywordflow">continue</span>;
-<a name="l02962"></a>02962 
-<a name="l02963"></a>02963         cpl_table_erase_window(idscoeff, position, length);
-<a name="l02964"></a>02964         cpl_table_insert(idscoeff, table, position);
-<a name="l02965"></a>02965 
-<a name="l02966"></a>02966         cpl_table_delete(table);
-<a name="l02967"></a>02967 
-<a name="l02968"></a>02968         <span class="keywordflow">for</span> (j = 0; j < length; j++) {
-<a name="l02969"></a>02969             cpl_table_set_double(idscoeff, <span class="stringliteral">"x"</span>, j + position,
-<a name="l02970"></a>02970                                  xbot + j*(dx/length));
-<a name="l02971"></a>02971             cpl_table_set_double(idscoeff, <span class="stringliteral">"y"</span>, j + position,
-<a name="l02972"></a>02972                                  ybot + j*(dy/length));
-<a name="l02973"></a>02973         }
-<a name="l02974"></a>02974     }
-<a name="l02975"></a>02975 
-<a name="l02976"></a>02976     <span class="keywordflow">if</span> (global) {
-<a name="l02977"></a>02977 
-<a name="l02978"></a>02978         <span class="comment">/*</span>
-<a name="l02979"></a>02979 <span class="comment">         * Now fit a global solution</span>
-<a name="l02980"></a>02980 <span class="comment">         */</span>
-<a name="l02981"></a>02981 
-<a name="l02982"></a>02982         nrow = cpl_table_get_nrow(idscoeff);
-<a name="l02983"></a>02983 
-<a name="l02984"></a>02984         <span class="keywordflow">for</span> (i = 0; i < 6; i++) {
-<a name="l02985"></a>02985             cpl_table      *dummy;
-<a name="l02986"></a>02986             cpl_vector     *x;
-<a name="l02987"></a>02987             cpl_vector     *y;
-<a name="l02988"></a>02988             cpl_bivector   *z;
-<a name="l02989"></a>02989             cpl_vector     *c;
-<a name="l02990"></a>02990             cpl_polynomial *p;
-<a name="l02991"></a>02991             cpl_vector     *point;
-<a name="l02992"></a>02992             <span class="keywordtype">double</span>         *dpoint;
-<a name="l02993"></a>02993             <span class="keywordtype">int</span>             npoints;
-<a name="l02994"></a>02994 
-<a name="l02995"></a>02995             <span class="keywordflow">if</span> (!cpl_table_has_column(idscoeff, clab[i]))
-<a name="l02996"></a>02996                 <span class="keywordflow">break</span>;
-<a name="l02997"></a>02997 
-<a name="l02998"></a>02998             npoints = nrow - cpl_table_count_invalid(idscoeff, clab[i]);
-<a name="l02999"></a>02999             <span class="keywordflow">if</span> (npoints < 18)
-<a name="l03000"></a>03000                 <span class="keywordflow">break</span>;
-<a name="l03001"></a>03001 
-<a name="l03002"></a>03002             dummy = cpl_table_new(nrow);
-<a name="l03003"></a>03003             cpl_table_duplicate_column(dummy, <span class="stringliteral">"x"</span>, idscoeff, <span class="stringliteral">"x"</span>);
-<a name="l03004"></a>03004             cpl_table_duplicate_column(dummy, <span class="stringliteral">"y"</span>, idscoeff, <span class="stringliteral">"y"</span>);
-<a name="l03005"></a>03005             cpl_table_duplicate_column(dummy, clab[i], idscoeff, clab[i]);
-<a name="l03006"></a>03006             cpl_table_erase_invalid(dummy);
-<a name="l03007"></a>03007 
-<a name="l03008"></a>03008             x = cpl_vector_wrap(npoints, cpl_table_get_data_double(dummy, <span class="stringliteral">"x"</span>));
-<a name="l03009"></a>03009             y = cpl_vector_wrap(npoints, cpl_table_get_data_double(dummy, <span class="stringliteral">"y"</span>));
-<a name="l03010"></a>03010             z = cpl_bivector_wrap_vectors(x, y);
-<a name="l03011"></a>03011             c = cpl_vector_wrap(npoints, cpl_table_get_data_double(dummy, 
-<a name="l03012"></a>03012                                                                    clab[i]));
-<a name="l03013"></a>03013             p = cpl_polynomial_fit_2d_create(z, c, 2, NULL);
-<a name="l03014"></a>03014             cpl_bivector_unwrap_vectors(z);
-<a name="l03015"></a>03015             cpl_vector_unwrap(x);
-<a name="l03016"></a>03016             cpl_vector_unwrap(y);
-<a name="l03017"></a>03017             cpl_vector_unwrap(c);
-<a name="l03018"></a>03018             cpl_table_delete(dummy);
-<a name="l03019"></a>03019 
-<a name="l03020"></a>03020             point  = cpl_vector_new(2);
-<a name="l03021"></a>03021             dpoint = cpl_vector_get_data(point);
-<a name="l03022"></a>03022             <span class="keywordflow">for</span> (j = 0; j < nrow; j++) {
-<a name="l03023"></a>03023                 dpoint[0] = cpl_table_get_double(idscoeff, <span class="stringliteral">"x"</span>, j, NULL);
-<a name="l03024"></a>03024                 dpoint[1] = cpl_table_get_double(idscoeff, <span class="stringliteral">"y"</span>, j, NULL);
-<a name="l03025"></a>03025                 cpl_table_set_double(idscoeff, clab[i], j,
-<a name="l03026"></a>03026                                      cpl_polynomial_eval(p, point));
-<a name="l03027"></a>03027             }
-<a name="l03028"></a>03028             cpl_vector_delete(point);
-<a name="l03029"></a>03029             cpl_polynomial_delete(p);
-<a name="l03030"></a>03030         }
-<a name="l03031"></a>03031     }
-<a name="l03032"></a>03032 
-<a name="l03033"></a>03033     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l03034"></a>03034 }
-<a name="l03035"></a>03035 
-<a name="l03036"></a>03036 
-<a name="l03062"></a><a class="code" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">03062</a> cpl_error_code <a class="code" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">mos_interpolate_wavecalib</a>(cpl_table *idscoeff, 
-<a name="l03063"></a>03063                                          cpl_image *wavemap, <span class="keywordtype">int</span> mode,
-<a name="l03064"></a>03064                                          <span class="keywordtype">int</span> degree)
-<a name="l03065"></a>03065 {
-<a name="l03066"></a>03066     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_interpolate_wavecalib"</span>;
-<a name="l03067"></a>03067 
-<a name="l03068"></a>03068     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l03069"></a>03069                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l03070"></a>03070 
-<a name="l03071"></a>03071     cpl_vector     *wave;
-<a name="l03072"></a>03072     cpl_vector     *positions;
-<a name="l03073"></a>03073     cpl_polynomial *trend;
-<a name="l03074"></a>03074 
-<a name="l03075"></a>03075     <span class="keywordtype">float</span>          *p;
-<a name="l03076"></a>03076     <span class="keywordtype">float</span>          *data;
-<a name="l03077"></a>03077     <span class="keywordtype">double</span>         *wdata;
-<a name="l03078"></a>03078     <span class="keywordtype">double</span>         *pdata;
-<a name="l03079"></a>03079 
-<a name="l03080"></a>03080     <span class="keywordtype">double</span>          c;
-<a name="l03081"></a>03081     <span class="keywordtype">double</span>          mse, ksigma;
-<a name="l03082"></a>03082 
-<a name="l03083"></a>03083     <span class="keywordtype">int</span>             order;
-<a name="l03084"></a>03084     <span class="keywordtype">int</span>             nrows, first_row, last_row;
-<a name="l03085"></a>03085     <span class="keywordtype">int</span>             nx, ny;
-<a name="l03086"></a>03086     <span class="keywordtype">int</span>             npoints, rpoints;
-<a name="l03087"></a>03087     <span class="keywordtype">int</span>             null;
-<a name="l03088"></a>03088     <span class="keywordtype">int</span>             i, j, k;
-<a name="l03089"></a>03089 
-<a name="l03090"></a>03090     <span class="keywordtype">int</span>             polyorder = 4;  <span class="comment">/* Candidate input argument */</span>
-<a name="l03091"></a>03091 
-<a name="l03092"></a>03092 
-<a name="l03093"></a>03093     <span class="keywordflow">if</span> (idscoeff == NULL)
-<a name="l03094"></a>03094         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l03095"></a>03095 
-<a name="l03096"></a>03096     <span class="keywordflow">if</span> (mode < 0 || mode > 2)
-<a name="l03097"></a>03097         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l03098"></a>03098 
-<a name="l03099"></a>03099     <span class="keywordflow">if</span> (mode == 0 || degree < 0)
-<a name="l03100"></a>03100         <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l03101"></a>03101 
-<a name="l03102"></a>03102     <span class="keywordflow">if</span> (wavemap) {
-<a name="l03103"></a>03103 
-<a name="l03104"></a>03104         <span class="comment">/*</span>
-<a name="l03105"></a>03105 <span class="comment">         * Fit with a polynomial the wavelength trend column by column.</span>
-<a name="l03106"></a>03106 <span class="comment">         */</span>
-<a name="l03107"></a>03107 
-<a name="l03108"></a>03108         cpl_image_turn(wavemap, -1);   <span class="comment">/* For faster memory access */</span>
-<a name="l03109"></a>03109 
-<a name="l03110"></a>03110         nx = cpl_image_get_size_x(wavemap);
-<a name="l03111"></a>03111         ny = cpl_image_get_size_y(wavemap);
-<a name="l03112"></a>03112         data = cpl_image_get_data(wavemap);
-<a name="l03113"></a>03113 
-<a name="l03114"></a>03114         <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l03115"></a>03115 
-<a name="l03116"></a>03116             <span class="comment">/*</span>
-<a name="l03117"></a>03117 <span class="comment">             * First get the size of the vectors to allocate:</span>
-<a name="l03118"></a>03118 <span class="comment">             * eliminate from fit any value with "impossible" wavelength.</span>
-<a name="l03119"></a>03119 <span class="comment">             */</span>
-<a name="l03120"></a>03120 
-<a name="l03121"></a>03121             npoints = 0;
-<a name="l03122"></a>03122             p = data + i*nx;
-<a name="l03123"></a>03123             <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l03124"></a>03124                 <span class="keywordflow">if</span> (p[j] > 1.0)
-<a name="l03125"></a>03125                     npoints++;
-<a name="l03126"></a>03126 
-<a name="l03127"></a>03127             <span class="keywordflow">if</span> (npoints > polyorder + 1) {
-<a name="l03128"></a>03128 
-<a name="l03129"></a>03129                 <span class="comment">/*</span>
-<a name="l03130"></a>03130 <span class="comment">                 * Fill the vectors for the fitting</span>
-<a name="l03131"></a>03131 <span class="comment">                 */</span>
-<a name="l03132"></a>03132 
-<a name="l03133"></a>03133                 wave = cpl_vector_new(npoints);
-<a name="l03134"></a>03134                 wdata = cpl_vector_get_data(wave);
-<a name="l03135"></a>03135                 positions = cpl_vector_new(npoints);
-<a name="l03136"></a>03136                 pdata = cpl_vector_get_data(positions);
-<a name="l03137"></a>03137 
-<a name="l03138"></a>03138                 npoints = 0;
-<a name="l03139"></a>03139                 p = data + i*nx;
-<a name="l03140"></a>03140                 <span class="keywordflow">for</span> (j = 0; j < nx; j++) {
-<a name="l03141"></a>03141                     <span class="keywordflow">if</span> (p[j] > 1.0) {
-<a name="l03142"></a>03142                         wdata[npoints] = p[j];
-<a name="l03143"></a>03143                         pdata[npoints] = j;
-<a name="l03144"></a>03144                         npoints++;
-<a name="l03145"></a>03145                     }
-<a name="l03146"></a>03146                 }
-<a name="l03147"></a>03147     
-<a name="l03148"></a>03148                 trend = cpl_polynomial_fit_1d_create(positions, wave, 
-<a name="l03149"></a>03149                                                      polyorder, &mse);
-<a name="l03150"></a>03150 
-<a name="l03151"></a>03151                 ksigma = 3*sqrt(mse);
-<a name="l03152"></a>03152 
-<a name="l03153"></a>03153                 cpl_vector_delete(wave);
-<a name="l03154"></a>03154                 cpl_vector_delete(positions);
-<a name="l03155"></a>03155 
-<a name="l03156"></a>03156                 <span class="keywordflow">if</span> (trend) {
-<a name="l03157"></a>03157 
-<a name="l03158"></a>03158                     <span class="comment">/*</span>
-<a name="l03159"></a>03159 <span class="comment">                     * Apply 3-sigma rejection</span>
-<a name="l03160"></a>03160 <span class="comment">                     */</span>
-<a name="l03161"></a>03161 
-<a name="l03162"></a>03162                     rpoints = 0;
-<a name="l03163"></a>03163                     p = data + i*nx;
-<a name="l03164"></a>03164                     <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l03165"></a>03165                         <span class="keywordflow">if</span> (p[j] > 1.0)
-<a name="l03166"></a>03166                             <span class="keywordflow">if</span> (fabs(cpl_polynomial_eval_1d(trend, j, NULL) 
-<a name="l03167"></a>03167                                                     - p[j]) < ksigma)
-<a name="l03168"></a>03168                                 rpoints++;
-<a name="l03169"></a>03169 
-<a name="l03170"></a>03170                     <span class="keywordflow">if</span> (rpoints < npoints && rpoints > polyorder + 1) {
-<a name="l03171"></a>03171 
-<a name="l03172"></a>03172                         wave = cpl_vector_new(rpoints);
-<a name="l03173"></a>03173                         wdata = cpl_vector_get_data(wave);
-<a name="l03174"></a>03174                         positions = cpl_vector_new(rpoints);
-<a name="l03175"></a>03175                         pdata = cpl_vector_get_data(positions);
-<a name="l03176"></a>03176 
-<a name="l03177"></a>03177                         npoints = 0;
-<a name="l03178"></a>03178                         p = data + i*nx;
-<a name="l03179"></a>03179                         <span class="keywordflow">for</span> (j = 0; j < nx; j++) {
-<a name="l03180"></a>03180                             <span class="keywordflow">if</span> (p[j] > 1.0) {
-<a name="l03181"></a>03181                                 <span class="keywordflow">if</span> (fabs(cpl_polynomial_eval_1d(trend, 
-<a name="l03182"></a>03182                                                                 j, NULL) - p[j])
-<a name="l03183"></a>03183                                                                 < ksigma) {
-<a name="l03184"></a>03184                                     wdata[npoints] = p[j];
-<a name="l03185"></a>03185                                     pdata[npoints] = j;
-<a name="l03186"></a>03186                                     npoints++;
-<a name="l03187"></a>03187                                 }
-<a name="l03188"></a>03188                             }
-<a name="l03189"></a>03189                         }
-<a name="l03190"></a>03190         
-<a name="l03191"></a>03191                         cpl_polynomial_delete(trend);
-<a name="l03192"></a>03192                         trend = cpl_polynomial_fit_1d_create(positions, wave,
-<a name="l03193"></a>03193                                                              polyorder, NULL);
-<a name="l03194"></a>03194 
-<a name="l03195"></a>03195                         cpl_vector_delete(wave);
-<a name="l03196"></a>03196                         cpl_vector_delete(positions);
-<a name="l03197"></a>03197                     }
-<a name="l03198"></a>03198                 }
-<a name="l03199"></a>03199 
-<a name="l03200"></a>03200                 <span class="keywordflow">if</span> (trend) {
-<a name="l03201"></a>03201                     p = data + i*nx;
-<a name="l03202"></a>03202                     <span class="keywordflow">if</span> (mode == 1) {
-<a name="l03203"></a>03203                         <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l03204"></a>03204                             <span class="keywordflow">if</span> (p[j] < 1.0)
-<a name="l03205"></a>03205                                 p[j] = cpl_polynomial_eval_1d(trend, j, NULL);
-<a name="l03206"></a>03206                     }
-<a name="l03207"></a>03207                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mode == 2) {
-<a name="l03208"></a>03208                         <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l03209"></a>03209                             p[j] = cpl_polynomial_eval_1d(trend, j, NULL);
-<a name="l03210"></a>03210                     }
-<a name="l03211"></a>03211                     cpl_polynomial_delete(trend);
-<a name="l03212"></a>03212                 }
-<a name="l03213"></a>03213                 <span class="keywordflow">else</span> {
-<a name="l03214"></a>03214                     cpl_msg_warning(func, 
-<a name="l03215"></a>03215                                     <span class="stringliteral">"Invalid wavelength field fit (ignored)"</span>);
-<a name="l03216"></a>03216                 }
-<a name="l03217"></a>03217             }
-<a name="l03218"></a>03218     
-<a name="l03219"></a>03219         }
-<a name="l03220"></a>03220 
-<a name="l03221"></a>03221         cpl_image_turn(wavemap, 1);
-<a name="l03222"></a>03222 
-<a name="l03223"></a>03223     }
-<a name="l03224"></a>03224 
-<a name="l03225"></a>03225 
-<a name="l03226"></a>03226     <span class="comment">/*</span>
-<a name="l03227"></a>03227 <span class="comment">     * Interpolating the IDS coefficients</span>
-<a name="l03228"></a>03228 <span class="comment">     */</span>
-<a name="l03229"></a>03229 
-<a name="l03230"></a>03230     nrows = cpl_table_get_nrow(idscoeff);
-<a name="l03231"></a>03231 
-<a name="l03232"></a>03232     order = 0;
-<a name="l03233"></a>03233     <span class="keywordflow">while</span> (order < 6 && cpl_table_has_column(idscoeff, clab[order]))
-<a name="l03234"></a>03234         ++order;
-<a name="l03235"></a>03235     --order;
-<a name="l03236"></a>03236 
-<a name="l03237"></a>03237     <span class="keywordflow">if</span> (degree == 0) {
-<a name="l03238"></a>03238         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l03239"></a>03239             <span class="keywordtype">double</span> m;
-<a name="l03240"></a>03240             <span class="keywordflow">if</span> (cpl_table_has_column(idscoeff, clab[k])) {
-<a name="l03241"></a>03241                 m = cpl_table_get_column_median(idscoeff, clab[k]);
-<a name="l03242"></a>03242                 cpl_table_fill_column_window_double(idscoeff, clab[k], 
-<a name="l03243"></a>03243                                                     0, nrows, m);
-<a name="l03244"></a>03244             }
-<a name="l03245"></a>03245         }
-<a name="l03246"></a>03246 
-<a name="l03247"></a>03247         <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l03248"></a>03248     }
-<a name="l03249"></a>03249 
-<a name="l03250"></a>03250     first_row = 0;
-<a name="l03251"></a>03251     <span class="keywordflow">while</span> (!cpl_table_is_valid(idscoeff, clab[0], first_row))
-<a name="l03252"></a>03252         first_row++;
-<a name="l03253"></a>03253 
-<a name="l03254"></a>03254     last_row = nrows - 1;
-<a name="l03255"></a>03255     <span class="keywordflow">while</span> (!cpl_table_is_valid(idscoeff, clab[0], last_row))
-<a name="l03256"></a>03256         last_row--;
-<a name="l03257"></a>03257 
-<a name="l03258"></a>03258     <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l03259"></a>03259 
-<a name="l03260"></a>03260         npoints = nrows - cpl_table_count_invalid(idscoeff, clab[k]);
-<a name="l03261"></a>03261         wave = cpl_vector_new(npoints);
-<a name="l03262"></a>03262         wdata = cpl_vector_get_data(wave);
-<a name="l03263"></a>03263         positions = cpl_vector_new(npoints);
-<a name="l03264"></a>03264         pdata = cpl_vector_get_data(positions);
-<a name="l03265"></a>03265 
-<a name="l03266"></a>03266         npoints = 0;
-<a name="l03267"></a>03267         <span class="keywordflow">for</span> (i = first_row; i <= last_row; i++) {
-<a name="l03268"></a>03268             c = cpl_table_get_double(idscoeff, clab[k], i, &null);
-<a name="l03269"></a>03269             <span class="keywordflow">if</span> (null == 0) {
-<a name="l03270"></a>03270                 wdata[npoints] = c;
-<a name="l03271"></a>03271                 pdata[npoints] = i;
-<a name="l03272"></a>03272                 npoints++;
-<a name="l03273"></a>03273             }
-<a name="l03274"></a>03274         }
-<a name="l03275"></a>03275 
-<a name="l03276"></a>03276 <span class="comment">// This doesn't seem to provide good results, I have not understood why.</span>
-<a name="l03277"></a>03277 <span class="comment">// Restore for robust linear fitting.</span>
-<a name="l03278"></a>03278 <span class="comment">//</span>
-<a name="l03279"></a>03279         <span class="keywordflow">if</span> (degree == 1) {
-<a name="l03280"></a>03280             cpl_vector   *p;
-<a name="l03281"></a>03281             cpl_vector   *w;
-<a name="l03282"></a>03282             cpl_bivector *<a class="code" href="structlist.html">list</a>;
-<a name="l03283"></a>03283             <span class="keywordtype">double</span>        q, m;
-<a name="l03284"></a>03284 
-<a name="l03285"></a>03285             <span class="keywordflow">if</span> (npoints > 4) {
-<a name="l03286"></a>03286                 p = cpl_vector_extract(positions, 2, npoints - 2, 1);
-<a name="l03287"></a>03287                 w = cpl_vector_extract(wave, 2, npoints - 2, 1);
-<a name="l03288"></a>03288             }
-<a name="l03289"></a>03289             <span class="keywordflow">else</span> {
-<a name="l03290"></a>03290                 p = positions;
-<a name="l03291"></a>03291                 w = wave;
-<a name="l03292"></a>03292             }
-<a name="l03293"></a>03293 
-<a name="l03294"></a>03294             list = cpl_bivector_wrap_vectors(p, w);
-<a name="l03295"></a>03295 
-<a name="l03296"></a>03296             <a class="code" href="group__moses.html#g4b6606e2a44434b722cb25862567e4ff">robustLinearFit</a>(list, &q, &m, &mse);
-<a name="l03297"></a>03297             cpl_bivector_unwrap_vectors(list);
-<a name="l03298"></a>03298             <span class="keywordflow">for</span> (i = first_row; i <= last_row; i++)
-<a name="l03299"></a>03299                  cpl_table_set_double(idscoeff, clab[k], i, q + m*i);
-<a name="l03300"></a>03300 
-<a name="l03301"></a>03301             <span class="keywordflow">if</span> (npoints > 4) {
-<a name="l03302"></a>03302                 cpl_vector_delete(p);
-<a name="l03303"></a>03303                 cpl_vector_delete(w);
-<a name="l03304"></a>03304             }
-<a name="l03305"></a>03305 
-<a name="l03306"></a>03306             <span class="keywordflow">continue</span>;
-<a name="l03307"></a>03307         }
-<a name="l03308"></a>03308 
-<a name="l03309"></a>03309 <span class="comment">// End robust linear fitting</span>
-<a name="l03310"></a>03310 
-<a name="l03311"></a>03311         trend = cpl_polynomial_fit_1d_create(positions, wave, degree, &mse);
-<a name="l03312"></a>03312 
-<a name="l03313"></a>03313         ksigma = 3*sqrt(mse);
-<a name="l03314"></a>03314 
-<a name="l03315"></a>03315         cpl_vector_delete(wave);
-<a name="l03316"></a>03316         cpl_vector_delete(positions);
-<a name="l03317"></a>03317 
-<a name="l03318"></a>03318         <span class="comment">/*</span>
-<a name="l03319"></a>03319 <span class="comment">         * Iteration</span>
-<a name="l03320"></a>03320 <span class="comment">         */</span>
-<a name="l03321"></a>03321 
-<a name="l03322"></a>03322         <span class="keywordflow">if</span> (trend) {
-<a name="l03323"></a>03323             rpoints = 0;
-<a name="l03324"></a>03324             <span class="keywordflow">for</span> (i = first_row; i <= last_row; i++) {
-<a name="l03325"></a>03325                 c = cpl_table_get_double(idscoeff, clab[k], i, &null);
-<a name="l03326"></a>03326                 <span class="keywordflow">if</span> (null == 0) {
-<a name="l03327"></a>03327                     <span class="keywordflow">if</span> (fabs(cpl_polynomial_eval_1d(trend, i, NULL) - c) 
-<a name="l03328"></a>03328                                                                  < ksigma) {
-<a name="l03329"></a>03329                         rpoints++;
-<a name="l03330"></a>03330                     }
-<a name="l03331"></a>03331                 }
-<a name="l03332"></a>03332             }
-<a name="l03333"></a>03333 
-<a name="l03334"></a>03334             <span class="keywordflow">if</span> (rpoints > 0 && rpoints < npoints) {
-<a name="l03335"></a>03335                 cpl_msg_debug(func, <span class="stringliteral">"%d points rejected from "</span>
-<a name="l03336"></a>03336                               <span class="stringliteral">"wavelength calibration fit"</span>, 
-<a name="l03337"></a>03337                               npoints - rpoints);
-<a name="l03338"></a>03338 
-<a name="l03339"></a>03339                 wave = cpl_vector_new(rpoints);
-<a name="l03340"></a>03340                 wdata = cpl_vector_get_data(wave);
-<a name="l03341"></a>03341                 positions = cpl_vector_new(rpoints);
-<a name="l03342"></a>03342                 pdata = cpl_vector_get_data(positions);
-<a name="l03343"></a>03343 
-<a name="l03344"></a>03344                 npoints = 0;
-<a name="l03345"></a>03345                 <span class="keywordflow">for</span> (i = first_row; i <= last_row; i++) {
-<a name="l03346"></a>03346                     c = cpl_table_get_double(idscoeff, clab[k], i, &null);
-<a name="l03347"></a>03347                     <span class="keywordflow">if</span> (null == 0) {
-<a name="l03348"></a>03348                         <span class="keywordflow">if</span> (fabs(cpl_polynomial_eval_1d(trend, i, NULL) - c)
-<a name="l03349"></a>03349                                                                  < ksigma) {
-<a name="l03350"></a>03350                             wdata[npoints] = c;
-<a name="l03351"></a>03351                             pdata[npoints] = i;
-<a name="l03352"></a>03352                             npoints++;
-<a name="l03353"></a>03353                         }
-<a name="l03354"></a>03354                     }
-<a name="l03355"></a>03355                 }
-<a name="l03356"></a>03356 
-<a name="l03357"></a>03357                 <span class="keywordflow">if</span> (npoints) {
-<a name="l03358"></a>03358                     cpl_polynomial_delete(trend);
-<a name="l03359"></a>03359                     trend = cpl_polynomial_fit_1d_create(positions, 
-<a name="l03360"></a>03360                                                          wave, degree, NULL);
-<a name="l03361"></a>03361                 }
-<a name="l03362"></a>03362 
-<a name="l03363"></a>03363                 cpl_vector_delete(wave);
-<a name="l03364"></a>03364                 cpl_vector_delete(positions);
-<a name="l03365"></a>03365 
-<a name="l03366"></a>03366             }
-<a name="l03367"></a>03367         }
-<a name="l03368"></a>03368 
-<a name="l03369"></a>03369         <span class="keywordflow">if</span> (trend) {
-<a name="l03370"></a>03370             <span class="keywordflow">for</span> (i = first_row; i <= last_row; i++) {
-<a name="l03371"></a>03371                 <span class="keywordflow">if</span> (mode == 1) {
-<a name="l03372"></a>03372                     <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, clab[k], i)) {
-<a name="l03373"></a>03373                         cpl_table_set_double(idscoeff, clab[k], i, 
-<a name="l03374"></a>03374                                              cpl_polynomial_eval_1d(trend, i,
-<a name="l03375"></a>03375                                                                     NULL));
-<a name="l03376"></a>03376                     }
-<a name="l03377"></a>03377                 }
-<a name="l03378"></a>03378                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mode == 2) {
-<a name="l03379"></a>03379                     cpl_table_set_double(idscoeff, clab[k], i, 
-<a name="l03380"></a>03380                                      cpl_polynomial_eval_1d(trend, i, NULL));
-<a name="l03381"></a>03381                 }
-<a name="l03382"></a>03382             }
-<a name="l03383"></a>03383             cpl_polynomial_delete(trend);
-<a name="l03384"></a>03384         }
-<a name="l03385"></a>03385         <span class="keywordflow">else</span> {
-<a name="l03386"></a>03386             cpl_msg_warning(func, <span class="stringliteral">"Invalid IDS coefficient fit (ignored)"</span>);
-<a name="l03387"></a>03387         }
-<a name="l03388"></a>03388 
-<a name="l03389"></a>03389     }
-<a name="l03390"></a>03390 
-<a name="l03391"></a>03391     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l03392"></a>03392 }
-<a name="l03393"></a>03393 
-<a name="l03394"></a>03394 
-<a name="l03395"></a>03395 
-<a name="l03421"></a><a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">03421</a> cpl_image *<a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(cpl_image *image, cpl_image *bias, 
-<a name="l03422"></a>03422                            cpl_table *overscans)
-<a name="l03423"></a>03423 {
-<a name="l03424"></a>03424     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_remove_bias"</span>;
-<a name="l03425"></a>03425 
-<a name="l03426"></a>03426     cpl_image *unbiased;
-<a name="l03427"></a>03427     cpl_image *overscan;
-<a name="l03428"></a>03428     <span class="keywordtype">double</span>     mean_bias_level;
-<a name="l03429"></a>03429     <span class="keywordtype">double</span>     mean_overscans_level;
-<a name="l03430"></a>03430     <span class="keywordtype">int</span>        count;
-<a name="l03431"></a>03431     <span class="keywordtype">int</span>        nrows;
-<a name="l03432"></a>03432     <span class="keywordtype">int</span>        xlow, ylow, xhig, yhig;
-<a name="l03433"></a>03433     <span class="keywordtype">int</span>        i;
-<a name="l03434"></a>03434 
-<a name="l03435"></a>03435 
-<a name="l03436"></a>03436     <span class="keywordflow">if</span> (image == NULL || overscans == NULL) {
-<a name="l03437"></a>03437         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l03438"></a>03438         <span class="keywordflow">return</span> NULL;
-<a name="l03439"></a>03439     }
-<a name="l03440"></a>03440 
-<a name="l03441"></a>03441     nrows = cpl_table_get_nrow(overscans);
-<a name="l03442"></a>03442 
-<a name="l03443"></a>03443     <span class="keywordflow">if</span> (nrows == 0) {
-<a name="l03444"></a>03444         cpl_msg_error(func, <span class="stringliteral">"Empty overscan table"</span>);
-<a name="l03445"></a>03445         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l03446"></a>03446         <span class="keywordflow">return</span> NULL;
-<a name="l03447"></a>03447     }
-<a name="l03448"></a>03448 
-<a name="l03449"></a>03449     <span class="keywordflow">if</span> (bias) {
-<a name="l03450"></a>03450         <span class="keywordflow">if</span> (nrows == 1) {
-<a name="l03451"></a>03451             unbiased = cpl_image_subtract_create(image, bias);
-<a name="l03452"></a>03452             <span class="keywordflow">if</span> (unbiased == NULL) {
-<a name="l03453"></a>03453                 cpl_msg_error(func, <span class="stringliteral">"Incompatible master bias"</span>);
-<a name="l03454"></a>03454                 cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l03455"></a>03455             }
-<a name="l03456"></a>03456             <span class="keywordflow">return</span> unbiased;
-<a name="l03457"></a>03457         }
-<a name="l03458"></a>03458         mean_bias_level = cpl_image_get_mean(bias);
-<a name="l03459"></a>03459     }
-<a name="l03460"></a>03460     <span class="keywordflow">else</span> {
-<a name="l03461"></a>03461         <span class="keywordflow">if</span> (nrows == 1) {
-<a name="l03462"></a>03462             cpl_msg_error(func, <span class="stringliteral">"No master bias in input, and no overscan "</span>
-<a name="l03463"></a>03463                           <span class="stringliteral">"regions in input image: bias subtraction "</span>
-<a name="l03464"></a>03464                           <span class="stringliteral">"cannot be performed!"</span>);
-<a name="l03465"></a>03465             cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l03466"></a>03466             <span class="keywordflow">return</span> NULL;
-<a name="l03467"></a>03467         }
-<a name="l03468"></a>03468         mean_bias_level = 0.0;
-<a name="l03469"></a>03469     }
-<a name="l03470"></a>03470 
-<a name="l03471"></a>03471     mean_overscans_level = 0.0;
-<a name="l03472"></a>03472     count = 0;
-<a name="l03473"></a>03473     <span class="keywordflow">for</span> (i = 0; i < nrows; i++) {
-<a name="l03474"></a>03474         xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, i, NULL);
-<a name="l03475"></a>03475         ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, i, NULL);
-<a name="l03476"></a>03476         xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, i, NULL);
-<a name="l03477"></a>03477         yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, i, NULL);
-<a name="l03478"></a>03478 
-<a name="l03479"></a>03479         <span class="keywordflow">if</span> (i == 0) {
-<a name="l03480"></a>03480             unbiased = cpl_image_extract(image, xlow+1, ylow+1, xhig, yhig);
-<a name="l03481"></a>03481             <span class="keywordflow">if</span> (unbiased == NULL) {
-<a name="l03482"></a>03482                 cpl_msg_error(func, <span class="stringliteral">"Incompatible overscan table"</span>);
-<a name="l03483"></a>03483                 cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l03484"></a>03484                 <span class="keywordflow">return</span> NULL;
-<a name="l03485"></a>03485             }
-<a name="l03486"></a>03486             <span class="keywordflow">if</span> (bias) {
-<a name="l03487"></a>03487                 <span class="keywordflow">if</span> (cpl_image_subtract(unbiased, bias)) {
-<a name="l03488"></a>03488                     cpl_msg_error(func, <span class="stringliteral">"Incompatible master bias"</span>);
-<a name="l03489"></a>03489                     cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l03490"></a>03490                     cpl_image_delete(unbiased);
-<a name="l03491"></a>03491                     <span class="keywordflow">return</span> NULL;
-<a name="l03492"></a>03492                 }
-<a name="l03493"></a>03493             }
-<a name="l03494"></a>03494         }
-<a name="l03495"></a>03495         <span class="keywordflow">else</span> {
-<a name="l03496"></a>03496             overscan = cpl_image_extract(image, xlow+1, ylow+1, xhig, yhig);
-<a name="l03497"></a>03497             <span class="keywordflow">if</span> (overscan == NULL) {
-<a name="l03498"></a>03498                 cpl_msg_error(func, <span class="stringliteral">"Incompatible overscan table"</span>);
-<a name="l03499"></a>03499                 cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l03500"></a>03500                 cpl_image_delete(unbiased);
-<a name="l03501"></a>03501                 <span class="keywordflow">return</span> NULL;
-<a name="l03502"></a>03502             }
-<a name="l03503"></a>03503 
-<a name="l03504"></a>03504             mean_overscans_level += cpl_image_get_median(overscan);
-<a name="l03505"></a>03505             count++;
-<a name="l03506"></a>03506 
-<a name="l03507"></a>03507 <span class="comment">/***</span>
-<a name="l03508"></a>03508 <span class="comment"> * Here the mean level was used: not very robust...</span>
-<a name="l03509"></a>03509 <span class="comment"></span>
-<a name="l03510"></a>03510 <span class="comment">            mean_overscans_level += cpl_image_get_flux(overscan);</span>
-<a name="l03511"></a>03511 <span class="comment">            count += cpl_image_get_size_x(overscan)</span>
-<a name="l03512"></a>03512 <span class="comment">                   * cpl_image_get_size_y(overscan);</span>
-<a name="l03513"></a>03513 <span class="comment">***/</span>
-<a name="l03514"></a>03514             cpl_image_delete(overscan);
-<a name="l03515"></a>03515         }
-<a name="l03516"></a>03516     }
-<a name="l03517"></a>03517 
-<a name="l03518"></a>03518     <span class="comment">/*</span>
-<a name="l03519"></a>03519 <span class="comment">     * Overscan correction</span>
-<a name="l03520"></a>03520 <span class="comment">     */</span>
-<a name="l03521"></a>03521 
-<a name="l03522"></a>03522     mean_overscans_level /= count;
-<a name="l03523"></a>03523 
-<a name="l03524"></a>03524     cpl_image_subtract_scalar(unbiased, mean_overscans_level - mean_bias_level);
-<a name="l03525"></a>03525 
-<a name="l03526"></a>03526     cpl_msg_info(cpl_func, 
-<a name="l03527"></a>03527                  <span class="stringliteral">"Ratio between mean overscans level and mean bias level: %.2f"</span>,
-<a name="l03528"></a>03528                   mean_overscans_level / mean_bias_level);
-<a name="l03529"></a>03529 
-<a name="l03530"></a>03530     <span class="keywordflow">return</span> unbiased;
-<a name="l03531"></a>03531 
-<a name="l03532"></a>03532 }
-<a name="l03533"></a>03533 
-<a name="l03534"></a>03534 
-<a name="l03593"></a><a class="code" href="group__moses.html#g8dd9103f12a5e6275cd03c3f2afee77a">03593</a> cpl_error_code <a class="code" href="group__moses.html#g8dd9103f12a5e6275cd03c3f2afee77a">mos_arc_background_1D</a>(<span class="keywordtype">float</span> *spectrum, <span class="keywordtype">float</span> *<a class="code" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a>, 
-<a name="l03594"></a>03594                                      <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> msize, <span class="keywordtype">int</span> fsize) 
-<a name="l03595"></a>03595 {
-<a name="l03596"></a>03596     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_arc_background_1D"</span>;
-<a name="l03597"></a>03597 
-<a name="l03598"></a>03598     <span class="keywordtype">float</span>  *minf;
-<a name="l03599"></a>03599     <span class="keywordtype">float</span>  *maxf;
-<a name="l03600"></a>03600     <span class="keywordtype">float</span>  *smof;
-<a name="l03601"></a>03601     <span class="keywordtype">int</span>     i;
-<a name="l03602"></a>03602 
-<a name="l03603"></a>03603 
-<a name="l03604"></a>03604     <span class="keywordflow">if</span> (spectrum == NULL || back == NULL)
-<a name="l03605"></a>03605         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l03606"></a>03606 
-<a name="l03607"></a>03607     <span class="keywordflow">if</span> (msize % 2 == 0)
-<a name="l03608"></a>03608         msize++;
-<a name="l03609"></a>03609 
-<a name="l03610"></a>03610     <span class="keywordflow">if</span> (fsize % 2 == 0)
-<a name="l03611"></a>03611         fsize++;
-<a name="l03612"></a>03612 
-<a name="l03613"></a>03613     <span class="keywordflow">if</span> (msize < 3 || fsize < msize || length < 2*fsize)
-<a name="l03614"></a>03614         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l03615"></a>03615 
-<a name="l03616"></a>03616 
-<a name="l03617"></a>03617     minf = <a class="code" href="group__moses.html#g37533cd641acd9d0c7430cb84928c7dd">min_filter</a>(spectrum, length, msize);
-<a name="l03618"></a>03618     smof = <a class="code" href="group__moses.html#g243ac41000f8b1965fadac747928ad05">smo_filter</a>(minf, length, fsize);
-<a name="l03619"></a>03619     cpl_free(minf);
-<a name="l03620"></a>03620     maxf = <a class="code" href="group__fors__image.html#g167f96e092eeb578086febe4b86d6df9">max_filter</a>(smof, length, 2*msize+1);
-<a name="l03621"></a>03621     cpl_free(smof);
-<a name="l03622"></a>03622     smof = <a class="code" href="group__moses.html#g243ac41000f8b1965fadac747928ad05">smo_filter</a>(maxf, length, 2*fsize+1);
-<a name="l03623"></a>03623     cpl_free(maxf);
-<a name="l03624"></a>03624     minf = <a class="code" href="group__moses.html#g37533cd641acd9d0c7430cb84928c7dd">min_filter</a>(smof, length, 2*msize+1);
-<a name="l03625"></a>03625     cpl_free(smof);
-<a name="l03626"></a>03626     smof = <a class="code" href="group__moses.html#g243ac41000f8b1965fadac747928ad05">smo_filter</a>(minf, length, 2*fsize+1);
-<a name="l03627"></a>03627     cpl_free(minf);
-<a name="l03628"></a>03628 
-<a name="l03629"></a>03629     <span class="keywordflow">for</span> (i = 0; i < length; i++)
-<a name="l03630"></a>03630         back[i] = smof[i];
-<a name="l03631"></a>03631 
-<a name="l03632"></a>03632     cpl_free(smof);
-<a name="l03633"></a>03633 
-<a name="l03634"></a>03634     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l03635"></a>03635 
-<a name="l03636"></a>03636 }
-<a name="l03637"></a>03637 
-<a name="l03638"></a>03638 
-<a name="l03695"></a><a class="code" href="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a">03695</a> cpl_image *<a class="code" href="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a">mos_arc_background</a>(cpl_image *image, <span class="keywordtype">int</span> msize, <span class="keywordtype">int</span> fsize) 
-<a name="l03696"></a>03696 {
-<a name="l03697"></a>03697     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_arc_background"</span>;
-<a name="l03698"></a>03698 
-<a name="l03699"></a>03699     cpl_image  *fimage;
-<a name="l03700"></a>03700     cpl_image  *bimage;
-<a name="l03701"></a>03701     cpl_matrix *kernel;
-<a name="l03702"></a>03702     <span class="keywordtype">float</span>      *data;
-<a name="l03703"></a>03703     <span class="keywordtype">float</span>      *bdata;
-<a name="l03704"></a>03704     <span class="keywordtype">float</span>      *row;
-<a name="l03705"></a>03705     <span class="keywordtype">float</span>      *brow;
-<a name="l03706"></a>03706     <span class="keywordtype">int</span>         nx, ny;
-<a name="l03707"></a>03707     <span class="keywordtype">int</span>         i;
-<a name="l03708"></a>03708 
-<a name="l03709"></a>03709 
-<a name="l03710"></a>03710     <span class="keywordflow">if</span> (image == NULL) {
-<a name="l03711"></a>03711         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l03712"></a>03712         <span class="keywordflow">return</span> NULL;
-<a name="l03713"></a>03713     }
-<a name="l03714"></a>03714 
-<a name="l03715"></a>03715     <span class="keywordflow">if</span> (msize % 2 == 0)
-<a name="l03716"></a>03716         msize++;
-<a name="l03717"></a>03717 
-<a name="l03718"></a>03718     <span class="keywordflow">if</span> (fsize % 2 == 0)
-<a name="l03719"></a>03719         fsize++;
-<a name="l03720"></a>03720 
-<a name="l03721"></a>03721     nx = cpl_image_get_size_x(image);
-<a name="l03722"></a>03722     ny = cpl_image_get_size_y(image);
-<a name="l03723"></a>03723 
-<a name="l03724"></a>03724     bimage = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l03725"></a>03725 
-<a name="l03726"></a>03726     fimage = <a class="code" href="group__moses.html#g4fe5f2fe3227522421783758228cdc39">mos_image_filter_median</a>(image, 3, 3);
-<a name="l03727"></a>03727 
-<a name="l03728"></a>03728     data = cpl_image_get_data_float(fimage);
-<a name="l03729"></a>03729     bdata = cpl_image_get_data_float(bimage);
-<a name="l03730"></a>03730 
-<a name="l03731"></a>03731     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l03732"></a>03732         row = data + i * nx;
-<a name="l03733"></a>03733         brow = bdata + i * nx;
-<a name="l03734"></a>03734         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g8dd9103f12a5e6275cd03c3f2afee77a">mos_arc_background_1D</a>(row, brow, nx, msize, fsize)) {
-<a name="l03735"></a>03735             cpl_error_set_where(func); 
-<a name="l03736"></a>03736             cpl_image_delete(fimage);
-<a name="l03737"></a>03737             cpl_image_delete(bimage);
-<a name="l03738"></a>03738             <span class="keywordflow">return</span> NULL;
-<a name="l03739"></a>03739         }
-<a name="l03740"></a>03740     }
-<a name="l03741"></a>03741 
-<a name="l03742"></a>03742     cpl_image_delete(fimage);
-<a name="l03743"></a>03743 
-<a name="l03744"></a>03744     <span class="keywordflow">return</span> bimage;
-<a name="l03745"></a>03745 }
-<a name="l03746"></a>03746 
-<a name="l03747"></a>03747 
-<a name="l03768"></a><a class="code" href="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533">03768</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533">mos_lines_width</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *spectrum, <span class="keywordtype">int</span> length)
-<a name="l03769"></a>03769 {
-<a name="l03770"></a>03770 
-<a name="l03771"></a>03771   <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_lines_width"</span>;
-<a name="l03772"></a>03772 
-<a name="l03773"></a>03773   <span class="keywordtype">double</span> *profile1 = cpl_calloc(length - 1, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l03774"></a>03774   <span class="keywordtype">double</span> *profile2 = cpl_calloc(length - 1, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l03775"></a>03775 
-<a name="l03776"></a>03776   <span class="keywordtype">double</span>  norm, value, max;
-<a name="l03777"></a>03777   <span class="keywordtype">int</span>     radius = 20;
-<a name="l03778"></a>03778   <span class="keywordtype">int</span>     short_length = length - 2*radius - 1;
-<a name="l03779"></a>03779   <span class="keywordtype">int</span>     width;
-<a name="l03780"></a>03780   <span class="keywordtype">int</span>     i, j, k;
-<a name="l03781"></a>03781 
-<a name="l03782"></a>03782 
-<a name="l03783"></a>03783   <span class="comment">/*</span>
-<a name="l03784"></a>03784 <span class="comment">   * Derivative, and separation of positive and negative derivatives</span>
-<a name="l03785"></a>03785 <span class="comment">   */</span>
-<a name="l03786"></a>03786 
-<a name="l03787"></a>03787   <span class="keywordflow">for</span> (j = 0, i = 1; i < length; j++, i++) {
-<a name="l03788"></a>03788       profile1[j] = profile2[j] = spectrum[i] - spectrum[j];
-<a name="l03789"></a>03789       <span class="keywordflow">if</span> (profile1[j] < 0)
-<a name="l03790"></a>03790           profile1[j] = 0;
-<a name="l03791"></a>03791       <span class="keywordflow">if</span> (profile2[j] > 0)
-<a name="l03792"></a>03792           profile2[j] = 0;
-<a name="l03793"></a>03793       <span class="keywordflow">else</span>
-<a name="l03794"></a>03794           profile2[j] = -profile2[j];
-<a name="l03795"></a>03795   }
-<a name="l03796"></a>03796 
-<a name="l03797"></a>03797 
-<a name="l03798"></a>03798   <span class="comment">/*</span>
-<a name="l03799"></a>03799 <span class="comment">   * Profiles normalisation</span>
-<a name="l03800"></a>03800 <span class="comment">   */</span>
-<a name="l03801"></a>03801 
-<a name="l03802"></a>03802   length--;
-<a name="l03803"></a>03803 
-<a name="l03804"></a>03804   norm = 0;
-<a name="l03805"></a>03805   <span class="keywordflow">for</span> (i = 0; i < length; i++)
-<a name="l03806"></a>03806       <span class="keywordflow">if</span> (norm < profile1[i])
-<a name="l03807"></a>03807           norm = profile1[i];
-<a name="l03808"></a>03808 
-<a name="l03809"></a>03809   <span class="keywordflow">for</span> (i = 0; i < length; i++) {
-<a name="l03810"></a>03810       profile1[i] /= norm;
-<a name="l03811"></a>03811       profile2[i] /= norm;
-<a name="l03812"></a>03812   }
-<a name="l03813"></a>03813 
-<a name="l03814"></a>03814 
-<a name="l03815"></a>03815   <span class="comment">/*</span>
-<a name="l03816"></a>03816 <span class="comment">   * Cross-correlation</span>
-<a name="l03817"></a>03817 <span class="comment">   */</span>
-<a name="l03818"></a>03818 
-<a name="l03819"></a>03819   max = -1;
-<a name="l03820"></a>03820   <span class="keywordflow">for</span> (i = 0; i <= radius; i++) {
-<a name="l03821"></a>03821       value = 0;
-<a name="l03822"></a>03822       <span class="keywordflow">for</span> (j = 0; j < short_length; j++) {
-<a name="l03823"></a>03823           k = radius+j;
-<a name="l03824"></a>03824           value += profile1[k] * profile2[k+i];
-<a name="l03825"></a>03825       }
-<a name="l03826"></a>03826       <span class="keywordflow">if</span> (max < value) {
-<a name="l03827"></a>03827           max = value;
-<a name="l03828"></a>03828           width = i;
-<a name="l03829"></a>03829       }
-<a name="l03830"></a>03830   }
-<a name="l03831"></a>03831 
-<a name="l03832"></a>03832   cpl_free(profile1);
-<a name="l03833"></a>03833   cpl_free(profile2);
-<a name="l03834"></a>03834 
-<a name="l03835"></a>03835   <span class="keywordflow">if</span> (max < 0.0) {
-<a name="l03836"></a>03836       cpl_msg_debug(func, <span class="stringliteral">"Cannot estimate line width"</span>);
-<a name="l03837"></a>03837       width = 1;
-<a name="l03838"></a>03838   }
-<a name="l03839"></a>03839 
-<a name="l03840"></a>03840   <span class="keywordflow">return</span> width;
-<a name="l03841"></a>03841 
-<a name="l03842"></a>03842 }
-<a name="l03843"></a>03843 
-<a name="l03844"></a>03844 
-<a name="l03871"></a><a class="code" href="group__moses.html#g417edefcade103f40ba21dd3f9c29af1">03871</a> cpl_vector *<a class="code" href="group__moses.html#g417edefcade103f40ba21dd3f9c29af1">mos_peak_candidates</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *spectrum, 
-<a name="l03872"></a>03872                                 <span class="keywordtype">int</span> length, <span class="keywordtype">float</span> level, 
-<a name="l03873"></a>03873                                 <span class="keywordtype">float</span> exp_width)
-<a name="l03874"></a>03874 { 
-<a name="l03875"></a>03875 
-<a name="l03876"></a>03876   <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_peak_candidates"</span>;
-<a name="l03877"></a>03877 
-<a name="l03878"></a>03878   <span class="keywordtype">int</span>     i, j;
-<a name="l03879"></a>03879   <span class="keywordtype">int</span>     nint   = length - 1;
-<a name="l03880"></a>03880   <span class="keywordtype">int</span>     n      = 0;
-<a name="l03881"></a>03881   <span class="keywordtype">int</span>     width  = 2 * ceil(exp_width / 2) + 1;
-<a name="l03882"></a>03882   <span class="keywordtype">int</span>     start  = width / 2;
-<a name="l03883"></a>03883   <span class="keywordtype">int</span>     end    = length - width / 2;
-<a name="l03884"></a>03884   <span class="keywordtype">int</span>     step;
-<a name="l03885"></a>03885   <span class="keywordtype">float</span>  *smo;
-<a name="l03886"></a>03886   <span class="keywordtype">double</span> *data   = cpl_calloc(length/2, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l03887"></a>03887 
-<a name="l03888"></a>03888 
-<a name="l03889"></a>03889   <span class="keywordflow">if</span> (spectrum == NULL) {
-<a name="l03890"></a>03890       cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l03891"></a>03891       <span class="keywordflow">return</span> NULL;
-<a name="l03892"></a>03892   }
-<a name="l03893"></a>03893 
-<a name="l03894"></a>03894 
-<a name="l03895"></a>03895   <span class="comment">/*</span>
-<a name="l03896"></a>03896 <span class="comment">   * If lines have a flat top (as in the case of broad slit), smooth</span>
-<a name="l03897"></a>03897 <span class="comment">   * before determining the max.</span>
-<a name="l03898"></a>03898 <span class="comment">   */</span>
-<a name="l03899"></a>03899 
-<a name="l03900"></a>03900   <span class="keywordflow">if</span> (width > 7) {
-<a name="l03901"></a>03901     smo = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));
-<a name="l03902"></a>03902     start = width / 2;
-<a name="l03903"></a>03903     end = length - width / 2;
-<a name="l03904"></a>03904     <span class="keywordflow">for</span> (i = 0; i < start; i++)
-<a name="l03905"></a>03905       smo[i] = spectrum[i];
-<a name="l03906"></a>03906     <span class="keywordflow">for</span> (i = start; i < end; i++) {
-<a name="l03907"></a>03907       <span class="keywordflow">for</span> (j = i - start; j <= i + start; j++)
-<a name="l03908"></a>03908         smo[i] += spectrum[j];
-<a name="l03909"></a>03909       smo[i] /= width;
-<a name="l03910"></a>03910     }
-<a name="l03911"></a>03911     <span class="keywordflow">for</span> (i = end; i < length; i++)
-<a name="l03912"></a>03912       smo[i] = spectrum[i];
-<a name="l03913"></a>03913   }
-<a name="l03914"></a>03914   <span class="keywordflow">else</span> {
-<a name="l03915"></a>03915       smo = (<span class="keywordtype">float</span> *)spectrum;
-<a name="l03916"></a>03916   }
-<a name="l03917"></a>03917 
-<a name="l03918"></a>03918   <span class="comment">/*</span>
-<a name="l03919"></a>03919 <span class="comment">   * Collect all relative maxima along spectrum, that are higher than the</span>
-<a name="l03920"></a>03920 <span class="comment">   * specified level.</span>
-<a name="l03921"></a>03921 <span class="comment">   */</span>
-<a name="l03922"></a>03922 
-<a name="l03923"></a>03923   <span class="keywordflow">if</span> (width > 20)
-<a name="l03924"></a>03924     step = width / 2;
-<a name="l03925"></a>03925   <span class="keywordflow">else</span>
-<a name="l03926"></a>03926     step = 1;
-<a name="l03927"></a>03927 
-<a name="l03928"></a>03928   <span class="keywordflow">for</span> (i = step; i < nint - step + 1; i += step) {
-<a name="l03929"></a>03929     <span class="keywordflow">if</span> (smo[i] > level) {
-<a name="l03930"></a>03930       <span class="keywordflow">if</span> (smo[i] >= smo[i-step] && smo[i] > smo[i+step]) {
-<a name="l03931"></a>03931         <span class="keywordflow">if</span> (smo[i-step] != 0.0 && smo[i+step] != 0.0) {
-<a name="l03932"></a>03932           data[n] = i + step * <a class="code" href="group__moses.html#g31da70ff15f996bd4022c26b534c88eb">values_to_dx</a>(smo[i-step], smo[i], smo[i+step]);
-<a name="l03933"></a>03933           ++n;
-<a name="l03934"></a>03934         }
-<a name="l03935"></a>03935       }
-<a name="l03936"></a>03936     }
-<a name="l03937"></a>03937   }
-<a name="l03938"></a>03938 
-<a name="l03939"></a>03939   <span class="keywordflow">if</span> (width > 7) {
-<a name="l03940"></a>03940     cpl_free(smo);
-<a name="l03941"></a>03941   }
-<a name="l03942"></a>03942 
-<a name="l03943"></a>03943   <span class="keywordflow">if</span> (n == 0) {
-<a name="l03944"></a>03944     cpl_free(data);
-<a name="l03945"></a>03945     <span class="keywordflow">return</span> NULL;
-<a name="l03946"></a>03946   }
-<a name="l03947"></a>03947 
-<a name="l03948"></a>03948   <span class="keywordflow">return</span> cpl_vector_wrap(n, data);
-<a name="l03949"></a>03949 
-<a name="l03950"></a>03950 }
-<a name="l03951"></a>03951 
-<a name="l03952"></a>03952 
-<a name="l03974"></a><a class="code" href="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0">03974</a> cpl_vector *<a class="code" href="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0">mos_refine_peaks</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *spectrum, <span class="keywordtype">int</span> length, 
-<a name="l03975"></a>03975                              cpl_vector *peaks, <span class="keywordtype">int</span> sradius)
-<a name="l03976"></a>03976 {
-<a name="l03977"></a>03977 
-<a name="l03978"></a>03978     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_refine_peaks"</span>;
-<a name="l03979"></a>03979 
-<a name="l03980"></a>03980     <span class="keywordtype">double</span> *data;
-<a name="l03981"></a>03981     <span class="keywordtype">float</span>   pos;
-<a name="l03982"></a>03982     <span class="keywordtype">int</span>     npeaks;
-<a name="l03983"></a>03983     <span class="keywordtype">int</span>     startPos, endPos;
-<a name="l03984"></a>03984     <span class="keywordtype">int</span>     window = 2*sradius+1;
-<a name="l03985"></a>03985     <span class="keywordtype">int</span>     i, j;
-<a name="l03986"></a>03986 
-<a name="l03987"></a>03987 
-<a name="l03988"></a>03988     <span class="keywordflow">if</span> (peaks == NULL || spectrum == NULL) {
-<a name="l03989"></a>03989         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l03990"></a>03990         <span class="keywordflow">return</span> NULL;
-<a name="l03991"></a>03991     }
-<a name="l03992"></a>03992 
-<a name="l03993"></a>03993     npeaks = cpl_vector_get_size(peaks);
-<a name="l03994"></a>03994     data = cpl_vector_unwrap(peaks);
-<a name="l03995"></a>03995 
-<a name="l03996"></a>03996     <span class="keywordflow">for</span> (i = 0; i < npeaks; i++) {
-<a name="l03997"></a>03997         startPos = data[i] - window/2;
-<a name="l03998"></a>03998         endPos   = startPos + window;
-<a name="l03999"></a>03999         <span class="keywordflow">if</span> (startPos < 0 || endPos >= length)
-<a name="l04000"></a>04000             <span class="keywordflow">continue</span>;
-<a name="l04001"></a>04001 
-<a name="l04002"></a>04002         <span class="keywordflow">if</span> (0 == <a class="code" href="group__moses.html#g56f03689ea7eaf37395dbb26a24e3fcf">peakPosition</a>(spectrum + startPos, window, &pos, 1)) {
-<a name="l04003"></a>04003             pos += startPos;
-<a name="l04004"></a>04004             data[i] = pos;
-<a name="l04005"></a>04005         }
-<a name="l04006"></a>04006     }
-<a name="l04007"></a>04007 
-<a name="l04008"></a>04008     <span class="keywordflow">for</span> (i = 1; i < npeaks; i++)
-<a name="l04009"></a>04009         <span class="keywordflow">if</span> (data[i] - data[i-1] < 0.5)
-<a name="l04010"></a>04010             data[i-1] = -1.0;
-<a name="l04011"></a>04011 
-<a name="l04012"></a>04012     <span class="keywordflow">for</span> (i = 0, j = 0; i < npeaks; i++) {
-<a name="l04013"></a>04013         <span class="keywordflow">if</span> (data[i] > 0.0) {
-<a name="l04014"></a>04014             <span class="keywordflow">if</span> (i != j)
-<a name="l04015"></a>04015                 data[j] = data[i];
-<a name="l04016"></a>04016             j++;
-<a name="l04017"></a>04017         }
-<a name="l04018"></a>04018     }
-<a name="l04019"></a>04019 
-<a name="l04020"></a>04020     <span class="keywordflow">return</span> cpl_vector_wrap(j, data);
-<a name="l04021"></a>04021 
-<a name="l04022"></a>04022 }
-<a name="l04023"></a>04023 
-<a name="l04024"></a>04024 
-<a name="l04025"></a><a class="code" href="group__moses.html#g9ea6e7d7f5eb091c72e010069673d080">04025</a> <span class="keywordtype">void</span> <a class="code" href="group__moses.html#g9ea6e7d7f5eb091c72e010069673d080">mos_set_multiplex</a>(<span class="keywordtype">int</span> multiplex)
-<a name="l04026"></a>04026 {
-<a name="l04027"></a>04027     mos_multiplex = multiplex;
-<a name="l04028"></a>04028 }
-<a name="l04029"></a>04029 
-<a name="l04083"></a><a class="code" href="group__moses.html#g43123c837803fd95b01ba2870522ebaf">04083</a> cpl_bivector *<a class="code" href="group__moses.html#g43123c837803fd95b01ba2870522ebaf">mos_identify_peaks</a>(cpl_vector *peaks, cpl_vector *lines,
-<a name="l04084"></a>04084                                  <span class="keywordtype">double</span> min_disp, <span class="keywordtype">double</span> max_disp,
-<a name="l04085"></a>04085                                  <span class="keywordtype">double</span> tolerance)
-<a name="l04086"></a>04086 {
-<a name="l04087"></a>04087 
-<a name="l04088"></a>04088   <span class="keywordtype">int</span>      i, j, k, l;
-<a name="l04089"></a>04089   <span class="keywordtype">int</span>      nlint, npint;
-<a name="l04090"></a>04090   <span class="keywordtype">int</span>      minpos;
-<a name="l04091"></a>04091   <span class="keywordtype">float</span>    min;
-<a name="l04092"></a>04092   <span class="keywordtype">double</span>   lratio, pratio;
-<a name="l04093"></a>04093   <span class="keywordtype">double</span>   lo_start, lo_end, hi_start, hi_end, denom;
-<a name="l04094"></a>04094   <span class="keywordtype">double</span>   disp, variation, prev_variation;
-<a name="l04095"></a>04095   <span class="keywordtype">int</span>      max, maxpos, minl, mink;
-<a name="l04096"></a>04096   <span class="keywordtype">int</span>      ambiguous;
-<a name="l04097"></a>04097   <span class="keywordtype">int</span>      npeaks_lo, npeaks_hi;
-<a name="l04098"></a>04098   <span class="keywordtype">int</span>     *peak_lo;
-<a name="l04099"></a>04099   <span class="keywordtype">int</span>     *peak_hi;
-<a name="l04100"></a>04100   <span class="keywordtype">int</span>    **ident;
-<a name="l04101"></a>04101   <span class="keywordtype">int</span>     *nident;
-<a name="l04102"></a>04102   <span class="keywordtype">int</span>     *lident;
-<a name="l04103"></a>04103 
-<a name="l04104"></a>04104   <span class="keywordtype">double</span>  *peak;
-<a name="l04105"></a>04105   <span class="keywordtype">double</span>  *line;
-<a name="l04106"></a>04106   <span class="keywordtype">int</span>      npeaks, nlines;
-<a name="l04107"></a>04107 
-<a name="l04108"></a>04108   <span class="keywordtype">double</span>  *xpos;
-<a name="l04109"></a>04109   <span class="keywordtype">double</span>  *lambda;
-<a name="l04110"></a>04110   <span class="keywordtype">int</span>     *ilambda;
-<a name="l04111"></a>04111   <span class="keywordtype">double</span>  *tmp_xpos;
-<a name="l04112"></a>04112   <span class="keywordtype">double</span>  *tmp_lambda;
-<a name="l04113"></a>04113   <span class="keywordtype">int</span>     *tmp_ilambda;
-<a name="l04114"></a>04114   <span class="keywordtype">int</span>     *flag;
-<a name="l04115"></a>04115   <span class="keywordtype">int</span>      n = 0;
-<a name="l04116"></a>04116   <span class="keywordtype">int</span>      nn;
-<a name="l04117"></a>04117   <span class="keywordtype">int</span>      nseq = 0;
-<a name="l04118"></a>04118   <span class="keywordtype">int</span>      gap;
-<a name="l04119"></a>04119   <span class="keywordtype">int</span>     *seq_length;
-<a name="l04120"></a>04120   <span class="keywordtype">int</span>      found;
-<a name="l04121"></a>04121 
-<a name="l04122"></a>04122   peak        = cpl_vector_get_data(peaks);
-<a name="l04123"></a>04123   npeaks      = cpl_vector_get_size(peaks);
-<a name="l04124"></a>04124   line        = cpl_vector_get_data(lines);
-<a name="l04125"></a>04125   nlines      = cpl_vector_get_size(lines);
-<a name="l04126"></a>04126 
-<a name="l04127"></a>04127   <span class="keywordflow">if</span> (npeaks < 4)
-<a name="l04128"></a>04128       <span class="keywordflow">return</span> NULL;
-<a name="l04129"></a>04129 
-<a name="l04130"></a>04130   peak_lo     = cpl_malloc(npeaks * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l04131"></a>04131   peak_hi     = cpl_malloc(npeaks * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l04132"></a>04132   nident      = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l04133"></a>04133   lident      = cpl_calloc(nlines, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l04134"></a>04134   xpos        = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l04135"></a>04135   lambda      = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l04136"></a>04136   ilambda     = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l04137"></a>04137   tmp_xpos    = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l04138"></a>04138   tmp_lambda  = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l04139"></a>04139   tmp_ilambda = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l04140"></a>04140   flag        = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l04141"></a>04141   seq_length  = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l04142"></a>04142   ident       = cpl_malloc(npeaks * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span> *));
-<a name="l04143"></a>04143   <span class="keywordflow">for</span> (i = 0; i < npeaks; i++)
-<a name="l04144"></a>04144     ident[i]  = cpl_malloc(3 * npeaks * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l04145"></a>04145 
-<a name="l04146"></a>04146   <span class="comment">/*</span>
-<a name="l04147"></a>04147 <span class="comment">   * This is just the number of intervals - one less than the number</span>
-<a name="l04148"></a>04148 <span class="comment">   * of points (catalog wavelengths, or detected peaks).</span>
-<a name="l04149"></a>04149 <span class="comment">   */</span>
-<a name="l04150"></a>04150 
-<a name="l04151"></a>04151   nlint = nlines - 1;
-<a name="l04152"></a>04152   npint = npeaks - 1;
-<a name="l04153"></a>04153 
-<a name="l04154"></a>04154 
-<a name="l04155"></a>04155   <span class="comment">/*</span>
-<a name="l04156"></a>04156 <span class="comment">   * Here the big loops on catalog lines begins.</span>
-<a name="l04157"></a>04157 <span class="comment">   */</span>
-<a name="l04158"></a>04158 
-<a name="l04159"></a>04159   <span class="keywordflow">for</span> (i = 1; i < nlint; i++) {
-<a name="l04160"></a>04160 
-<a name="l04161"></a>04161 
-<a name="l04162"></a>04162     <span class="comment">/*</span>
-<a name="l04163"></a>04163 <span class="comment">     * For each catalog wavelength I take the previous and the next one, </span>
-<a name="l04164"></a>04164 <span class="comment">     * and compute the ratio of the corresponding wavelength intervals.</span>
-<a name="l04165"></a>04165 <span class="comment">     * This ratio will be compared to all the ratios obtained doing the</span>
-<a name="l04166"></a>04166 <span class="comment">     * same with all the detected peaks positions.</span>
-<a name="l04167"></a>04167 <span class="comment">     */</span>
-<a name="l04168"></a>04168 
-<a name="l04169"></a>04169     lratio = (line[i+1] - line[i]) / (line[i] - line[i-1]);
-<a name="l04170"></a>04170 
-<a name="l04171"></a>04171 
-<a name="l04172"></a>04172     <span class="comment">/*</span>
-<a name="l04173"></a>04173 <span class="comment">     * Here the loop on detected peaks positions begins.</span>
-<a name="l04174"></a>04174 <span class="comment">     */</span>
-<a name="l04175"></a>04175 
-<a name="l04176"></a>04176     <span class="keywordflow">for</span> (j = 1; j < npint; j++) {
-<a name="l04177"></a>04177 
-<a name="l04178"></a>04178       <span class="comment">/*</span>
-<a name="l04179"></a>04179 <span class="comment">       * Not all peaks are used for computing ratios: just the ones</span>
-<a name="l04180"></a>04180 <span class="comment">       * that are compatible with the expected spectral dispersion</span>
-<a name="l04181"></a>04181 <span class="comment">       * are taken into consideration. Therefore, I define the pixel</span>
-<a name="l04182"></a>04182 <span class="comment">       * intervals before and after any peak that are compatible with</span>
-<a name="l04183"></a>04183 <span class="comment">       * the specified dispersion interval, and select just the peaks</span>
-<a name="l04184"></a>04184 <span class="comment">       * within such intervals. If either of the two intervals doesn't</span>
-<a name="l04185"></a>04185 <span class="comment">       * contain any peak, then I skip the current peak and continue</span>
-<a name="l04186"></a>04186 <span class="comment">       * with the next.</span>
-<a name="l04187"></a>04187 <span class="comment">       */</span>
-<a name="l04188"></a>04188 
-<a name="l04189"></a>04189       lo_start = peak[j] - (line[i] - line[i-1]) / min_disp;
-<a name="l04190"></a>04190       lo_end   = peak[j] - (line[i] - line[i-1]) / max_disp;
-<a name="l04191"></a>04191       hi_start = peak[j] + (line[i+1] - line[i]) / max_disp;
-<a name="l04192"></a>04192       hi_end   = peak[j] + (line[i+1] - line[i]) / min_disp;
-<a name="l04193"></a>04193 
-<a name="l04194"></a>04194       <span class="keywordflow">for</span> (npeaks_lo = 0, k = 0; k < npeaks; k++) {
-<a name="l04195"></a>04195         <span class="keywordflow">if</span> (peak[k] > lo_end)
-<a name="l04196"></a>04196           <span class="keywordflow">break</span>;
-<a name="l04197"></a>04197         <span class="keywordflow">if</span> (peak[k] > lo_start) {
-<a name="l04198"></a>04198           peak_lo[npeaks_lo] = k;
-<a name="l04199"></a>04199           ++npeaks_lo;
-<a name="l04200"></a>04200         }
-<a name="l04201"></a>04201       }
-<a name="l04202"></a>04202 
-<a name="l04203"></a>04203       <span class="keywordflow">if</span> (npeaks_lo == 0)
-<a name="l04204"></a>04204         <span class="keywordflow">continue</span>;
-<a name="l04205"></a>04205 
-<a name="l04206"></a>04206       <span class="keywordflow">for</span> (npeaks_hi = 0, k = 0; k < npeaks; k++) {
-<a name="l04207"></a>04207         <span class="keywordflow">if</span> (peak[k] > hi_end)
-<a name="l04208"></a>04208           <span class="keywordflow">break</span>;
-<a name="l04209"></a>04209         <span class="keywordflow">if</span> (peak[k] > hi_start) {
-<a name="l04210"></a>04210           peak_hi[npeaks_hi] = k;
-<a name="l04211"></a>04211           ++npeaks_hi;
-<a name="l04212"></a>04212         }
-<a name="l04213"></a>04213       }
-<a name="l04214"></a>04214 
-<a name="l04215"></a>04215       <span class="keywordflow">if</span> (npeaks_hi == 0)
-<a name="l04216"></a>04216         <span class="keywordflow">continue</span>;
-<a name="l04217"></a>04217 
-<a name="l04218"></a>04218 
-<a name="l04219"></a>04219       <span class="comment">/*</span>
-<a name="l04220"></a>04220 <span class="comment">       * Now I have all peaks that may help for a local identification.</span>
-<a name="l04221"></a>04221 <span class="comment">       * peak_lo[k] is the sequence number of the k-th peak of the lower</span>
-<a name="l04222"></a>04222 <span class="comment">       * interval; peak_hi[l] is the sequence number of the l-th peak of</span>
-<a name="l04223"></a>04223 <span class="comment">       * the higher interval. j is, of course, the sequence number of the</span>
-<a name="l04224"></a>04224 <span class="comment">       * current peak (second big loop).</span>
-<a name="l04225"></a>04225 <span class="comment">       */</span>
-<a name="l04226"></a>04226 
-<a name="l04227"></a>04227       prev_variation = 1000.0;
-<a name="l04228"></a>04228       minl = mink = 0;
-<a name="l04229"></a>04229 
-<a name="l04230"></a>04230       <span class="keywordflow">for</span> (k = 0; k < npeaks_lo; k++) {
-<a name="l04231"></a>04231         denom = peak[j] - peak[peak_lo[k]];
-<a name="l04232"></a>04232         <span class="keywordflow">for</span> (l = 0; l < npeaks_hi; l++) {
-<a name="l04233"></a>04233 
-<a name="l04234"></a>04234           <span class="comment">/*</span>
-<a name="l04235"></a>04235 <span class="comment">           * For any pair of peaks - one from the lower and the other</span>
-<a name="l04236"></a>04236 <span class="comment">           * from the higher interval - I compute the same ratio that</span>
-<a name="l04237"></a>04237 <span class="comment">           * was computed with the current line catalog wavelength.</span>
-<a name="l04238"></a>04238 <span class="comment">           */</span>
-<a name="l04239"></a>04239 
-<a name="l04240"></a>04240           pratio = (peak[peak_hi[l]] - peak[j]) / denom;
-<a name="l04241"></a>04241 
-<a name="l04242"></a>04242           <span class="comment">/*</span>
-<a name="l04243"></a>04243 <span class="comment">           * If the two ratios are compatible within the specified</span>
-<a name="l04244"></a>04244 <span class="comment">           * tolerance, we have a preliminary identification. This</span>
-<a name="l04245"></a>04245 <span class="comment">           * will be marked in the matrix ident[][], where the first</span>
-<a name="l04246"></a>04246 <span class="comment">           * index corresponds to a peak sequence number, and the second</span>
-<a name="l04247"></a>04247 <span class="comment">           * index is the counter of the identifications made during</span>
-<a name="l04248"></a>04248 <span class="comment">           * this whole process. The array of counters is nident[].</span>
-<a name="l04249"></a>04249 <span class="comment">           * If more than one interval pair fulfills the specified</span>
-<a name="l04250"></a>04250 <span class="comment">           * tolerance, the closest to the expected ratio is selected.</span>
-<a name="l04251"></a>04251 <span class="comment">           */</span>
-<a name="l04252"></a>04252 
-<a name="l04253"></a>04253           variation = fabs(lratio-pratio) / pratio;
-<a name="l04254"></a>04254 
-<a name="l04255"></a>04255           <span class="keywordflow">if</span> (variation < tolerance) {
-<a name="l04256"></a>04256             <span class="keywordflow">if</span> (variation < prev_variation) {
-<a name="l04257"></a>04257               prev_variation = variation;
-<a name="l04258"></a>04258               minl = l;
-<a name="l04259"></a>04259               mink = k;
-<a name="l04260"></a>04260             }
-<a name="l04261"></a>04261           }
-<a name="l04262"></a>04262         }
-<a name="l04263"></a>04263       }
-<a name="l04264"></a>04264       <span class="keywordflow">if</span> (prev_variation < tolerance) {
-<a name="l04265"></a>04265         ident[j][nident[j]]                         = i;
-<a name="l04266"></a>04266         ident[peak_hi[minl]][nident[peak_hi[minl]]] = i + 1;
-<a name="l04267"></a>04267         ident[peak_lo[mink]][nident[peak_lo[mink]]] = i - 1;
-<a name="l04268"></a>04268         ++nident[j];
-<a name="l04269"></a>04269         ++nident[peak_hi[minl]];
-<a name="l04270"></a>04270         ++nident[peak_lo[mink]];
-<a name="l04271"></a>04271       }
-<a name="l04272"></a>04272     }   <span class="comment">/* End loop on positions */</span>
-<a name="l04273"></a>04273   }    <span class="comment">/* End loop on lines     */</span>
-<a name="l04274"></a>04274 
-<a name="l04275"></a>04275 
-<a name="l04276"></a>04276   <span class="comment">/*</span>
-<a name="l04277"></a>04277 <span class="comment">   * At this point I have filled the ident matrix with all my preliminary</span>
-<a name="l04278"></a>04278 <span class="comment">   * identifications. Ambiguous identifications must be eliminated.</span>
-<a name="l04279"></a>04279 <span class="comment">   */</span>
-<a name="l04280"></a>04280 
-<a name="l04281"></a>04281 
-<a name="l04282"></a>04282   <span class="keywordflow">for</span> (i = 0; i < npeaks; i++) {
-<a name="l04283"></a>04283 
-<a name="l04284"></a>04284 
-<a name="l04285"></a>04285     <span class="comment">/*</span>
-<a name="l04286"></a>04286 <span class="comment">     * I don't take into consideration peaks that were never identified.</span>
-<a name="l04287"></a>04287 <span class="comment">     * They are likely contaminations, or emission lines that were not</span>
-<a name="l04288"></a>04288 <span class="comment">     * listed in the input wavelength catalog.</span>
-<a name="l04289"></a>04289 <span class="comment">     */</span>
-<a name="l04290"></a>04290 
-<a name="l04291"></a>04291     <span class="keywordflow">if</span> (nident[i] > 1) {
-<a name="l04292"></a>04292 
-<a name="l04293"></a>04293 
-<a name="l04294"></a>04294       <span class="comment">/*</span>
-<a name="l04295"></a>04295 <span class="comment">       * Initialise the histogram of wavelengths assigned to the i-th peak.</span>
-<a name="l04296"></a>04296 <span class="comment">       */</span>
-<a name="l04297"></a>04297 
-<a name="l04298"></a>04298       <span class="keywordflow">for</span> (j = 0; j < nlines; j++)
-<a name="l04299"></a>04299         lident[j] = 0;
-<a name="l04300"></a>04300 
-<a name="l04301"></a>04301 
-<a name="l04302"></a>04302       <span class="comment">/*</span>
-<a name="l04303"></a>04303 <span class="comment">       * Count how many times each catalog wavelength was assigned</span>
-<a name="l04304"></a>04304 <span class="comment">       * to the i-th peak.</span>
-<a name="l04305"></a>04305 <span class="comment">       */</span>
-<a name="l04306"></a>04306 
-<a name="l04307"></a>04307       <span class="keywordflow">for</span> (j = 0; j < nident[i]; j++)
-<a name="l04308"></a>04308         ++lident[ident[i][j]];
-<a name="l04309"></a>04309 
-<a name="l04310"></a>04310 
-<a name="l04311"></a>04311       <span class="comment">/*</span>
-<a name="l04312"></a>04312 <span class="comment">       * What wavelength was most frequently assigned to the i-th peak?</span>
-<a name="l04313"></a>04313 <span class="comment">       */</span>
-<a name="l04314"></a>04314 
-<a name="l04315"></a>04315       max = 0;
-<a name="l04316"></a>04316       maxpos = 0;
-<a name="l04317"></a>04317       <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {
-<a name="l04318"></a>04318         <span class="keywordflow">if</span> (max < lident[j]) {
-<a name="l04319"></a>04319           max = lident[j];
-<a name="l04320"></a>04320           maxpos = j;
-<a name="l04321"></a>04321         }
-<a name="l04322"></a>04322       }
-<a name="l04323"></a>04323 
-<a name="l04324"></a>04324 
-<a name="l04325"></a>04325       <span class="comment">/*</span>
-<a name="l04326"></a>04326 <span class="comment">       * Were there other wavelengths assigned with the same frequency?</span>
-<a name="l04327"></a>04327 <span class="comment">       * This would be the case of an ambiguous identification. It is</span>
-<a name="l04328"></a>04328 <span class="comment">       * safer to reject this peak...</span>
-<a name="l04329"></a>04329 <span class="comment">       */</span>
-<a name="l04330"></a>04330 
-<a name="l04331"></a>04331       ambiguous = 0;
-<a name="l04332"></a>04332 
-<a name="l04333"></a>04333       <span class="keywordflow">for</span> (k = maxpos + 1; k < nlines; k++) {
-<a name="l04334"></a>04334         <span class="keywordflow">if</span> (lident[k] == max) {
-<a name="l04335"></a>04335           ambiguous = 1;
-<a name="l04336"></a>04336           <span class="keywordflow">break</span>;
-<a name="l04337"></a>04337         }
-<a name="l04338"></a>04338       }
-<a name="l04339"></a>04339 
-<a name="l04340"></a>04340       <span class="keywordflow">if</span> (ambiguous)
-<a name="l04341"></a>04341         <span class="keywordflow">continue</span>;
-<a name="l04342"></a>04342 
-<a name="l04343"></a>04343 
-<a name="l04344"></a>04344       <span class="comment">/*</span>
-<a name="l04345"></a>04345 <span class="comment">       * Otherwise, I assign to the i-th peak the wavelength that was</span>
-<a name="l04346"></a>04346 <span class="comment">       * most often assigned to it.</span>
-<a name="l04347"></a>04347 <span class="comment">       */</span>
-<a name="l04348"></a>04348 
-<a name="l04349"></a>04349       tmp_xpos[n]   = peak[i];
-<a name="l04350"></a>04350       tmp_lambda[n] = line[maxpos];
-<a name="l04351"></a>04351       tmp_ilambda[n] = maxpos;
-<a name="l04352"></a>04352 
-<a name="l04353"></a>04353       ++n;
-<a name="l04354"></a>04354 
-<a name="l04355"></a>04355     }
-<a name="l04356"></a>04356 
-<a name="l04357"></a>04357   }
-<a name="l04358"></a>04358 
-<a name="l04359"></a>04359 
-<a name="l04360"></a>04360   <span class="comment">/*</span>
-<a name="l04361"></a>04361 <span class="comment">   * Check on identified peaks. Contaminations from other spectra might </span>
-<a name="l04362"></a>04362 <span class="comment">   * be present and should be excluded: this type of contamination </span>
-<a name="l04363"></a>04363 <span class="comment">   * consists of peaks that have been _correctly_ identified! The non-</span>
-<a name="l04364"></a>04364 <span class="comment">   * spectral type of light contamination should have been almost all </span>
-<a name="l04365"></a>04365 <span class="comment">   * removed already in the previous steps, but it may still be present.</span>
-<a name="l04366"></a>04366 <span class="comment">   * Here, the self-consistent sequences of identified peaks are</span>
-<a name="l04367"></a>04367 <span class="comment">   * separated one from the other. At the moment, just the longest of</span>
-<a name="l04368"></a>04368 <span class="comment">   * such sequences is selected (in other words, spectral multiplexing</span>
-<a name="l04369"></a>04369 <span class="comment">   * is ignored).</span>
-<a name="l04370"></a>04370 <span class="comment">   */</span>
-<a name="l04371"></a>04371 
-<a name="l04372"></a>04372   <span class="keywordflow">if</span> (n > 1) {
-<a name="l04373"></a>04373     nn = 0;                  <span class="comment">/* Number of peaks in the list of sequences */</span>
-<a name="l04374"></a>04374     nseq = 0;                <span class="comment">/* Current sequence */</span>
-<a name="l04375"></a>04375     <span class="keywordflow">for</span> (k = 0; k < n; k++) {
-<a name="l04376"></a>04376       <span class="keywordflow">if</span> (flag[k] == 0) {    <span class="comment">/* Was peak k already assigned to a sequence? */</span>
-<a name="l04377"></a>04377         flag[k] = 1;
-<a name="l04378"></a>04378         xpos[nn] = tmp_xpos[k];       <span class="comment">/* Begin the nseq-th sequence */</span>
-<a name="l04379"></a>04379         lambda[nn] = tmp_lambda[k];
-<a name="l04380"></a>04380         ilambda[nn] = tmp_ilambda[k];
-<a name="l04381"></a>04381         ++seq_length[nseq];
-<a name="l04382"></a>04382         ++nn;
-<a name="l04383"></a>04383 
-<a name="l04384"></a>04384         <span class="comment">/*</span>
-<a name="l04385"></a>04385 <span class="comment">         * Now look for all the following peaks that are compatible</span>
-<a name="l04386"></a>04386 <span class="comment">         * with the expected spectral dispersion, and add them in </span>
-<a name="l04387"></a>04387 <span class="comment">         * sequence to xpos. Note that missing peaks are not a problem...</span>
-<a name="l04388"></a>04388 <span class="comment">         */</span>
-<a name="l04389"></a>04389          
-<a name="l04390"></a>04390         i = k;
-<a name="l04391"></a>04391         <span class="keywordflow">while</span> (i < n - 1) {
-<a name="l04392"></a>04392           found = 0;
-<a name="l04393"></a>04393           <span class="keywordflow">for</span> (j = i + 1; j < n; j++) {
-<a name="l04394"></a>04394             <span class="keywordflow">if</span> (flag[j] == 0) {
-<a name="l04395"></a>04395               disp = (tmp_lambda[j] - tmp_lambda[i])
-<a name="l04396"></a>04396                    / (tmp_xpos[j] - tmp_xpos[i]);
-<a name="l04397"></a>04397               <span class="keywordflow">if</span> (disp >= min_disp && disp <= max_disp) {
-<a name="l04398"></a>04398                 flag[j] = 1;
-<a name="l04399"></a>04399                 xpos[nn] = tmp_xpos[j];
-<a name="l04400"></a>04400                 lambda[nn] = tmp_lambda[j];
-<a name="l04401"></a>04401                 ilambda[nn] = tmp_ilambda[j];
-<a name="l04402"></a>04402                 ++seq_length[nseq];
-<a name="l04403"></a>04403                 ++nn;
-<a name="l04404"></a>04404                 i = j;
-<a name="l04405"></a>04405                 found = 1;
-<a name="l04406"></a>04406                 <span class="keywordflow">break</span>;
-<a name="l04407"></a>04407               }
-<a name="l04408"></a>04408             }
-<a name="l04409"></a>04409           }
-<a name="l04410"></a>04410           <span class="keywordflow">if</span> (!found)
-<a name="l04411"></a>04411             <span class="keywordflow">break</span>;
-<a name="l04412"></a>04412         }
-<a name="l04413"></a>04413 
-<a name="l04414"></a>04414         <span class="comment">/*</span>
-<a name="l04415"></a>04415 <span class="comment">         * Current sequence is completed: begin new sequence on the</span>
-<a name="l04416"></a>04416 <span class="comment">         * excluded peaks, starting the loop on peaks again.</span>
-<a name="l04417"></a>04417 <span class="comment">         */</span>
-<a name="l04418"></a>04418 
-<a name="l04419"></a>04419         ++nseq;
-<a name="l04420"></a>04420         k = 0;
-<a name="l04421"></a>04421       }
-<a name="l04422"></a>04422     }
-<a name="l04423"></a>04423 
-<a name="l04424"></a>04424 
-<a name="l04425"></a>04425     <span class="comment">/*</span>
-<a name="l04426"></a>04426 <span class="comment">     * Find the longest sequence of self-consistent peaks.</span>
-<a name="l04427"></a>04427 <span class="comment">     */</span>
-<a name="l04428"></a>04428 
-<a name="l04429"></a>04429     maxpos = max = 0;
-<a name="l04430"></a>04430 
-<a name="l04431"></a>04431     <span class="keywordflow">if</span> (mos_multiplex < 0) {
-<a name="l04432"></a>04432       <span class="keywordflow">for</span> (i = 0; i < nseq; i++) {
-<a name="l04433"></a>04433         <span class="keywordflow">if</span> (seq_length[i] > max) {
-<a name="l04434"></a>04434           max = seq_length[i];
-<a name="l04435"></a>04435           maxpos = i;
-<a name="l04436"></a>04436         }
-<a name="l04437"></a>04437       }
-<a name="l04438"></a>04438     }
-<a name="l04439"></a>04439     <span class="keywordflow">else</span> {
-<a name="l04440"></a>04440 
-<a name="l04441"></a>04441       <span class="comment">/*</span>
-<a name="l04442"></a>04442 <span class="comment">       * Now consider the sequence which lays in the specified </span>
-<a name="l04443"></a>04443 <span class="comment">       * CCD region (indicated by mos_multiplex): that is, _most_ </span>
-<a name="l04444"></a>04444 <span class="comment">       * of its lines (more than half) must be in that region...</span>
-<a name="l04445"></a>04445 <span class="comment">       */</span>
-<a name="l04446"></a>04446 
-<a name="l04447"></a>04447       nn = 0;
-<a name="l04448"></a>04448       found = 0;
-<a name="l04449"></a>04449 
-<a name="l04450"></a>04450       <span class="keywordflow">for</span> (i = 0; i < nseq; i++) {
-<a name="l04451"></a>04451         n = seq_length[i];
-<a name="l04452"></a>04452         <span class="keywordflow">if</span> (n > 5) {
-<a name="l04453"></a>04453           cpl_array *regions = cpl_array_new(n, CPL_TYPE_INT);
-<a name="l04454"></a>04454           <span class="keywordtype">int</span>        region;
-<a name="l04455"></a>04455 
-<a name="l04456"></a>04456           <span class="keywordflow">for</span> (j = 0; j < n; j++)
-<a name="l04457"></a>04457             cpl_array_set_int(regions, j, 
-<a name="l04458"></a>04458                               ((<span class="keywordtype">int</span>)floor(xpos[nn + j])) / mos_region_size);
-<a name="l04459"></a>04459 
-<a name="l04460"></a>04460           region = (int)cpl_array_get_median(regions);
-<a name="l04461"></a>04461           cpl_array_delete(regions);
-<a name="l04462"></a>04462 
-<a name="l04463"></a>04463           <span class="keywordflow">if</span> (mos_multiplex == region) {
-<a name="l04464"></a>04464             <span class="keywordflow">if</span> (found) {
-<a name="l04465"></a>04465               cpl_msg_debug(cpl_func, <span class="stringliteral">"More than one spectrum found in "</span>
-<a name="l04466"></a>04466                             <span class="stringliteral">"region %d (only the first one is extracted)"</span>, 
-<a name="l04467"></a>04467                             mos_multiplex);
-<a name="l04468"></a>04468               <span class="keywordflow">break</span>;
-<a name="l04469"></a>04469             }
-<a name="l04470"></a>04470             found = 1;
-<a name="l04471"></a>04471             max = seq_length[i];
-<a name="l04472"></a>04472             maxpos = i;
-<a name="l04473"></a>04473           }
-<a name="l04474"></a>04474         }
-<a name="l04475"></a>04475         nn += seq_length[i];
-<a name="l04476"></a>04476       }
-<a name="l04477"></a>04477     }
-<a name="l04478"></a>04478 
-<a name="l04479"></a>04479     <span class="comment">/*</span>
-<a name="l04480"></a>04480 <span class="comment">     * Find where this sequence starts in the whole peak position</span>
-<a name="l04481"></a>04481 <span class="comment">     * storage.</span>
-<a name="l04482"></a>04482 <span class="comment">     */</span>
-<a name="l04483"></a>04483 
-<a name="l04484"></a>04484     nn = 0;
-<a name="l04485"></a>04485     <span class="keywordflow">for</span> (i = 0; i < maxpos; i++)
-<a name="l04486"></a>04486       nn += seq_length[i];
-<a name="l04487"></a>04487 
-<a name="l04488"></a>04488     <span class="comment">/*</span>
-<a name="l04489"></a>04489 <span class="comment">     * Move the longest sequence at the beginning of the returned lists</span>
-<a name="l04490"></a>04490 <span class="comment">     */</span>
-<a name="l04491"></a>04491 
-<a name="l04492"></a>04492     n = max;
-<a name="l04493"></a>04493     <span class="keywordflow">for</span> (i = 0; i < n; i++, nn++) {
-<a name="l04494"></a>04494       xpos[i] = xpos[nn];
-<a name="l04495"></a>04495       lambda[i] = lambda[nn];
-<a name="l04496"></a>04496       ilambda[i] = ilambda[nn];
-<a name="l04497"></a>04497     }
-<a name="l04498"></a>04498 
-<a name="l04499"></a>04499 
-<a name="l04500"></a>04500     <span class="comment">/*</span>
-<a name="l04501"></a>04501 <span class="comment">     * Are some wavelengths missing? Recover them.</span>
-<a name="l04502"></a>04502 <span class="comment">     */</span>
-<a name="l04503"></a>04503 
-<a name="l04504"></a>04504     <span class="keywordflow">for</span> (i = 1; i < n; i++) {
-<a name="l04505"></a>04505       gap = ilambda[i] - ilambda[i-1];
-<a name="l04506"></a>04506       <span class="keywordflow">for</span> (j = 1; j < gap; j++) {
-<a name="l04507"></a>04507 
-<a name="l04508"></a>04508         <span class="keywordflow">if</span> (j == 1) {
-<a name="l04509"></a>04509 
-<a name="l04510"></a>04510           <span class="comment">/*</span>
-<a name="l04511"></a>04511 <span class="comment">           * Determine the local dispersion from the current pair of peaks</span>
-<a name="l04512"></a>04512 <span class="comment">           */</span>
-<a name="l04513"></a>04513   
-<a name="l04514"></a>04514           disp = (lambda[i] - lambda[i-1]) / (xpos[i] - xpos[i-1]);
-<a name="l04515"></a>04515         }
-<a name="l04516"></a>04516 
-<a name="l04517"></a>04517         <span class="comment">/*</span>
-<a name="l04518"></a>04518 <span class="comment">         * With this, find the expected position of the missing</span>
-<a name="l04519"></a>04519 <span class="comment">         * peak by linear interpolation.</span>
-<a name="l04520"></a>04520 <span class="comment">         */</span>
-<a name="l04521"></a>04521 
-<a name="l04522"></a>04522         hi_start = xpos[i-1] + (line[ilambda[i-1] + j] - lambda[i-1]) / disp;
-<a name="l04523"></a>04523 
-<a name="l04524"></a>04524         <span class="comment">/*</span>
-<a name="l04525"></a>04525 <span class="comment">         * Is there a peak at that position? Here a peak from the</span>
-<a name="l04526"></a>04526 <span class="comment">         * original list is searched, that is closer than 2 pixels</span>
-<a name="l04527"></a>04527 <span class="comment">         * to the expected position. If it is found, insert it at</span>
-<a name="l04528"></a>04528 <span class="comment">         * the current position on the list of identified peaks,</span>
-<a name="l04529"></a>04529 <span class="comment">         * and leave immediately the loop (taking the new position</span>
-<a name="l04530"></a>04530 <span class="comment">         * for the following linear interpolation, in case more</span>
-<a name="l04531"></a>04531 <span class="comment">         * than one peak is missing in the current interval).</span>
-<a name="l04532"></a>04532 <span class="comment">         * If it is not found, stay in the loop, looking for </span>
-<a name="l04533"></a>04533 <span class="comment">         * the following missing peaks in this interval.</span>
-<a name="l04534"></a>04534 <span class="comment">         */</span>
-<a name="l04535"></a>04535 
-<a name="l04536"></a>04536         found = 0;
-<a name="l04537"></a>04537         <span class="keywordflow">for</span> (k = 0; k < npeaks; k++) {
-<a name="l04538"></a>04538           <span class="keywordflow">if</span> (fabs(peak[k] - hi_start) < 2) {
-<a name="l04539"></a>04539             <span class="keywordflow">for</span> (l = n; l > i; l--) {
-<a name="l04540"></a>04540               xpos[l] = xpos[l-1];
-<a name="l04541"></a>04541               lambda[l] = lambda[l-1];
-<a name="l04542"></a>04542               ilambda[l] = ilambda[l-1];
-<a name="l04543"></a>04543             }
-<a name="l04544"></a>04544             xpos[i] = peak[k];
-<a name="l04545"></a>04545             lambda[i] = line[ilambda[i-1] + j];
-<a name="l04546"></a>04546             ilambda[i] = ilambda[i-1] + j;
-<a name="l04547"></a>04547             ++n;
-<a name="l04548"></a>04548             found = 1;
-<a name="l04549"></a>04549             <span class="keywordflow">break</span>;
-<a name="l04550"></a>04550           }
-<a name="l04551"></a>04551         }
-<a name="l04552"></a>04552         <span class="keywordflow">if</span> (found)
-<a name="l04553"></a>04553           <span class="keywordflow">break</span>;
-<a name="l04554"></a>04554       }
-<a name="l04555"></a>04555     }
-<a name="l04556"></a>04556 
-<a name="l04557"></a>04557 
-<a name="l04558"></a>04558     <span class="comment">/*</span>
-<a name="l04559"></a>04559 <span class="comment">     * Try to extrapolate forward</span>
-<a name="l04560"></a>04560 <span class="comment">     */</span>
-<a name="l04561"></a>04561 
-<a name="l04562"></a>04562     found = 1;
-<a name="l04563"></a>04563     <span class="keywordflow">while</span> (ilambda[n-1] < nlines - 1 && found) {
-<a name="l04564"></a>04564 
-<a name="l04565"></a>04565       <span class="comment">/*</span>
-<a name="l04566"></a>04566 <span class="comment">       * Determine the local dispersion from the last pair of </span>
-<a name="l04567"></a>04567 <span class="comment">       * identified peaks</span>
-<a name="l04568"></a>04568 <span class="comment">       */</span>
-<a name="l04569"></a>04569 
-<a name="l04570"></a>04570       <span class="keywordflow">if</span> (n > 1)
-<a name="l04571"></a>04571           disp = (lambda[n-1] - lambda[n-2]) / (xpos[n-1] - xpos[n-2]);
-<a name="l04572"></a>04572       <span class="keywordflow">else</span>
-<a name="l04573"></a>04573           disp = 0.0;
-<a name="l04574"></a>04574 
-<a name="l04575"></a>04575       <span class="keywordflow">if</span> (disp > max_disp || disp < min_disp)
-<a name="l04576"></a>04576         <span class="keywordflow">break</span>;
-<a name="l04577"></a>04577 
-<a name="l04578"></a>04578 
-<a name="l04579"></a>04579       <span class="comment">/*</span>
-<a name="l04580"></a>04580 <span class="comment">       * With this, find the expected position of the missing</span>
-<a name="l04581"></a>04581 <span class="comment">       * peak by linear interpolation.</span>
-<a name="l04582"></a>04582 <span class="comment">       */</span>
-<a name="l04583"></a>04583 
-<a name="l04584"></a>04584       hi_start = xpos[n-1] + (line[ilambda[n-1] + 1] - lambda[n-1]) / disp;
-<a name="l04585"></a>04585 
-<a name="l04586"></a>04586       <span class="comment">/*</span>
-<a name="l04587"></a>04587 <span class="comment">       * Is there a peak at that position? Here a peak from the</span>
-<a name="l04588"></a>04588 <span class="comment">       * original list is searched, that is closer than 6 pixels</span>
-<a name="l04589"></a>04589 <span class="comment">       * to the expected position. If it is found, insert it at</span>
-<a name="l04590"></a>04590 <span class="comment">       * the end of the list of identified peaks. If it is not</span>
-<a name="l04591"></a>04591 <span class="comment">       * found, leave the loop.</span>
-<a name="l04592"></a>04592 <span class="comment">       */</span>
-<a name="l04593"></a>04593 
-<a name="l04594"></a>04594       found = 0;
-<a name="l04595"></a>04595       min = fabs(peak[0] - hi_start);
-<a name="l04596"></a>04596       minpos = 0;
-<a name="l04597"></a>04597       <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {
-<a name="l04598"></a>04598         <span class="keywordflow">if</span> (min > fabs(peak[k] - hi_start)) {
-<a name="l04599"></a>04599             min = fabs(peak[k] - hi_start);
-<a name="l04600"></a>04600             minpos = k;
-<a name="l04601"></a>04601         }
-<a name="l04602"></a>04602       }
-<a name="l04603"></a>04603       <span class="keywordflow">if</span> (min < 6 && fabs(peak[minpos] - xpos[n-1]) > 1.0) {
-<a name="l04604"></a>04604         xpos[n] = peak[minpos];
-<a name="l04605"></a>04605         lambda[n] = line[ilambda[n-1] + 1];
-<a name="l04606"></a>04606         ilambda[n] = ilambda[n-1] + 1;
-<a name="l04607"></a>04607         ++n;
-<a name="l04608"></a>04608         found = 1;
-<a name="l04609"></a>04609       }
-<a name="l04610"></a>04610     }
-<a name="l04611"></a>04611 
-<a name="l04612"></a>04612 
-<a name="l04613"></a>04613     <span class="comment">/*</span>
-<a name="l04614"></a>04614 <span class="comment">     * Try to extrapolate backward</span>
-<a name="l04615"></a>04615 <span class="comment">     */</span>
-<a name="l04616"></a>04616 
-<a name="l04617"></a>04617     found = 1;
-<a name="l04618"></a>04618     <span class="keywordflow">while</span> (ilambda[0] > 0 && found) {
-<a name="l04619"></a>04619 
-<a name="l04620"></a>04620       <span class="comment">/*</span>
-<a name="l04621"></a>04621 <span class="comment">       * Determine the local dispersion from the first pair of</span>
-<a name="l04622"></a>04622 <span class="comment">       * identified peaks</span>
-<a name="l04623"></a>04623 <span class="comment">       */</span>
-<a name="l04624"></a>04624 
-<a name="l04625"></a>04625       disp = (lambda[1] - lambda[0]) / (xpos[1] - xpos[0]);
-<a name="l04626"></a>04626 
-<a name="l04627"></a>04627       <span class="keywordflow">if</span> (disp > max_disp || disp < min_disp)
-<a name="l04628"></a>04628         <span class="keywordflow">break</span>;
-<a name="l04629"></a>04629 
-<a name="l04630"></a>04630 
-<a name="l04631"></a>04631       <span class="comment">/*</span>
-<a name="l04632"></a>04632 <span class="comment">       * With this, find the expected position of the missing</span>
-<a name="l04633"></a>04633 <span class="comment">       * peak by linear interpolation.</span>
-<a name="l04634"></a>04634 <span class="comment">       */</span>
-<a name="l04635"></a>04635 
-<a name="l04636"></a>04636       hi_start = xpos[0] - (lambda[0] - line[ilambda[0] - 1]) / disp;
-<a name="l04637"></a>04637 
-<a name="l04638"></a>04638 
-<a name="l04639"></a>04639       <span class="comment">/*</span>
-<a name="l04640"></a>04640 <span class="comment">       * Is there a peak at that position? Here a peak from the</span>
-<a name="l04641"></a>04641 <span class="comment">       * original list is searched, that is closer than 6 pixels</span>
-<a name="l04642"></a>04642 <span class="comment">       * to the expected position. If it is found, insert it at</span>
-<a name="l04643"></a>04643 <span class="comment">       * the beginning of the list of identified peaks. If it is not</span>
-<a name="l04644"></a>04644 <span class="comment">       * found, leave the loop.</span>
-<a name="l04645"></a>04645 <span class="comment">       */</span>
-<a name="l04646"></a>04646 
-<a name="l04647"></a>04647       found = 0;
-<a name="l04648"></a>04648       min = fabs(peak[0] - hi_start);
-<a name="l04649"></a>04649       minpos = 0;
-<a name="l04650"></a>04650       <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {
-<a name="l04651"></a>04651         <span class="keywordflow">if</span> (min > fabs(peak[k] - hi_start)) {
-<a name="l04652"></a>04652             min = fabs(peak[k] - hi_start);
-<a name="l04653"></a>04653             minpos = k;
-<a name="l04654"></a>04654         }
-<a name="l04655"></a>04655       }
-<a name="l04656"></a>04656       <span class="keywordflow">if</span> (min < 6 && fabs(peak[minpos] - xpos[0]) > 1.0) {
-<a name="l04657"></a>04657         <span class="keywordflow">for</span> (j = n; j > 0; j--) {
-<a name="l04658"></a>04658           xpos[j] = xpos[j-1];
-<a name="l04659"></a>04659           lambda[j] = lambda[j-1];
-<a name="l04660"></a>04660           ilambda[j] = ilambda[j-1];
-<a name="l04661"></a>04661         }
-<a name="l04662"></a>04662         xpos[0] = peak[minpos];
-<a name="l04663"></a>04663         lambda[0] = line[ilambda[0] - 1];
-<a name="l04664"></a>04664         ilambda[0] = ilambda[0] - 1;
-<a name="l04665"></a>04665         ++n;
-<a name="l04666"></a>04666         found = 1;
-<a name="l04667"></a>04667       }
-<a name="l04668"></a>04668     }
-<a name="l04669"></a>04669   }
-<a name="l04670"></a>04670 
-<a name="l04671"></a>04671 
-<a name="l04672"></a>04672   <span class="comment">/*</span>
-<a name="l04673"></a>04673 <span class="comment">   * At this point all peaks are processed. Free memory, and return</span>
-<a name="l04674"></a>04674 <span class="comment">   * the result.</span>
-<a name="l04675"></a>04675 <span class="comment">   */</span>
-<a name="l04676"></a>04676 
-<a name="l04677"></a>04677 <span class="comment">/************************************************+</span>
-<a name="l04678"></a>04678 <span class="comment">  for (i = 0; i < npeaks; i++) {</span>
-<a name="l04679"></a>04679 <span class="comment">    printf("Peak %d:\n   ", i);</span>
-<a name="l04680"></a>04680 <span class="comment">    for (j = 0; j < nident[i]; j++)</span>
-<a name="l04681"></a>04681 <span class="comment">      printf("%.2f, ", line[ident[i][j]]);</span>
-<a name="l04682"></a>04682 <span class="comment">    printf("\n");</span>
-<a name="l04683"></a>04683 <span class="comment">  }</span>
-<a name="l04684"></a>04684 <span class="comment"></span>
-<a name="l04685"></a>04685 <span class="comment">  printf("\n");</span>
-<a name="l04686"></a>04686 <span class="comment"></span>
-<a name="l04687"></a>04687 <span class="comment">  for (i = 0; i < n; i++)</span>
-<a name="l04688"></a>04688 <span class="comment">    printf("%.2f, %.2f\n", xpos[i], lambda[i]);</span>
-<a name="l04689"></a>04689 <span class="comment">+************************************************/</span>
-<a name="l04690"></a>04690   <span class="keywordflow">for</span> (i = 0; i < npeaks; i++)
-<a name="l04691"></a>04691     cpl_free(ident[i]);
-<a name="l04692"></a>04692   cpl_free(ident);
-<a name="l04693"></a>04693   cpl_free(nident);
-<a name="l04694"></a>04694   cpl_free(lident);
-<a name="l04695"></a>04695   cpl_free(ilambda);
-<a name="l04696"></a>04696   cpl_free(tmp_xpos);
-<a name="l04697"></a>04697   cpl_free(tmp_lambda);
-<a name="l04698"></a>04698   cpl_free(tmp_ilambda);
-<a name="l04699"></a>04699   cpl_free(peak_lo);
-<a name="l04700"></a>04700   cpl_free(flag);
-<a name="l04701"></a>04701   cpl_free(seq_length);
-<a name="l04702"></a>04702   cpl_free(peak_hi);
-<a name="l04703"></a>04703 
-<a name="l04704"></a>04704   <span class="keywordflow">if</span> (n == 0) {
-<a name="l04705"></a>04705     cpl_free(xpos);
-<a name="l04706"></a>04706     cpl_free(lambda);
-<a name="l04707"></a>04707     <span class="keywordflow">return</span> NULL;
-<a name="l04708"></a>04708   }
-<a name="l04709"></a>04709 
-<a name="l04710"></a>04710   <span class="keywordflow">return</span> cpl_bivector_wrap_vectors(cpl_vector_wrap(n, xpos), 
-<a name="l04711"></a>04711                                    cpl_vector_wrap(n, lambda));
-<a name="l04712"></a>04712 }
-<a name="l04713"></a>04713 
-<a name="l04714"></a>04714 
-<a name="l04732"></a>04732 <span class="comment">/*</span>
-<a name="l04733"></a>04733 <span class="comment">double mos_eval_dds(cpl_polynomial *ids, double blue, double red, </span>
-<a name="l04734"></a>04734 <span class="comment">                    double refwave, double pixel)</span>
-<a name="l04735"></a>04735 <span class="comment">{</span>
-<a name="l04736"></a>04736 <span class="comment">    double yellow;</span>
-<a name="l04737"></a>04737 <span class="comment">    double cpixel;</span>
-<a name="l04738"></a>04738 <span class="comment">    double tolerance = 0.02;</span>
-<a name="l04739"></a>04739 <span class="comment">    int    max_iter = 20;</span>
-<a name="l04740"></a>04740 <span class="comment">    int    iter = 0;</span>
-<a name="l04741"></a>04741 <span class="comment"></span>
-<a name="l04742"></a>04742 <span class="comment">    </span>
-<a name="l04743"></a>04743 <span class="comment">    if (cpl_polynomial_eval_1d(ids, blue-refwave, NULL) > pixel)</span>
-<a name="l04744"></a>04744 <span class="comment">        return 0.0;</span>
-<a name="l04745"></a>04745 <span class="comment">    </span>
-<a name="l04746"></a>04746 <span class="comment">    if (cpl_polynomial_eval_1d(ids, red-refwave, NULL) < pixel)</span>
-<a name="l04747"></a>04747 <span class="comment">        return 0.0;</span>
-<a name="l04748"></a>04748 <span class="comment"></span>
-<a name="l04749"></a>04749 <span class="comment">    yellow = (blue + red) / 2;</span>
-<a name="l04750"></a>04750 <span class="comment"></span>
-<a name="l04751"></a>04751 <span class="comment">    cpixel = cpl_polynomial_eval_1d(ids, yellow-refwave, NULL);</span>
-<a name="l04752"></a>04752 <span class="comment"></span>
-<a name="l04753"></a>04753 <span class="comment">    while (fabs(cpixel - pixel) > tolerance && iter < max_iter) {</span>
-<a name="l04754"></a>04754 <span class="comment"></span>
-<a name="l04755"></a>04755 <span class="comment">        if (cpixel > pixel)</span>
-<a name="l04756"></a>04756 <span class="comment">            red = yellow;</span>
-<a name="l04757"></a>04757 <span class="comment">        else</span>
-<a name="l04758"></a>04758 <span class="comment">            blue = yellow;</span>
-<a name="l04759"></a>04759 <span class="comment"></span>
-<a name="l04760"></a>04760 <span class="comment">        yellow = (blue + red) / 2;</span>
-<a name="l04761"></a>04761 <span class="comment">        cpixel = cpl_polynomial_eval_1d(ids, yellow-refwave, NULL);</span>
-<a name="l04762"></a>04762 <span class="comment"></span>
-<a name="l04763"></a>04763 <span class="comment">        iter++;</span>
-<a name="l04764"></a>04764 <span class="comment"></span>
-<a name="l04765"></a>04765 <span class="comment">    }</span>
-<a name="l04766"></a>04766 <span class="comment"></span>
-<a name="l04767"></a>04767 <span class="comment">    return yellow;</span>
-<a name="l04768"></a>04768 <span class="comment"></span>
-<a name="l04769"></a>04769 <span class="comment">}</span>
-<a name="l04770"></a>04770 <span class="comment">*/</span>
-<a name="l04771"></a>04771 
-<a name="l04772"></a><a class="code" href="group__moses.html#g99c7290af152957144e8c0413355e5dd">04772</a> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g99c7290af152957144e8c0413355e5dd">mos_eval_dds</a>(cpl_polynomial *ids, <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red,
-<a name="l04773"></a>04773                     <span class="keywordtype">double</span> refwave, <span class="keywordtype">double</span> pixel)
-<a name="l04774"></a>04774 {
-<a name="l04775"></a>04775     <span class="keywordtype">double</span>     yellow;
-<a name="l04776"></a>04776     <span class="keywordtype">double</span>     coeff;
-<a name="l04777"></a>04777     cpl_size   zero = 0;
-<a name="l04778"></a>04778 
-<a name="l04779"></a>04779     <span class="keywordflow">if</span> (cpl_polynomial_eval_1d(ids, blue-refwave, NULL) > pixel)
-<a name="l04780"></a>04780         <span class="keywordflow">return</span> 0.0;
-<a name="l04781"></a>04781 
-<a name="l04782"></a>04782     <span class="keywordflow">if</span> (cpl_polynomial_eval_1d(ids, red-refwave, NULL) < pixel)
-<a name="l04783"></a>04783         <span class="keywordflow">return</span> 0.0;
-<a name="l04784"></a>04784 
-<a name="l04785"></a>04785     yellow = (blue + red) / 2 - refwave;
-<a name="l04786"></a>04786 
-<a name="l04787"></a>04787     coeff = cpl_polynomial_get_coeff(ids, &zero);
-<a name="l04788"></a>04788     cpl_polynomial_set_coeff(ids, &zero, coeff - pixel);
-<a name="l04789"></a>04789 
-<a name="l04790"></a>04790     cpl_polynomial_solve_1d(ids, yellow, &yellow, 1);
-<a name="l04791"></a>04791     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l04792"></a>04792         cpl_error_reset();
-<a name="l04793"></a>04793         <span class="keywordflow">return</span> 0.0;
-<a name="l04794"></a>04794     }
-<a name="l04795"></a>04795 
-<a name="l04796"></a>04796     cpl_polynomial_set_coeff(ids, &zero, coeff);
-<a name="l04797"></a>04797 
-<a name="l04798"></a>04798     <span class="keywordflow">return</span> yellow + refwave;
-<a name="l04799"></a>04799 
-<a name="l04800"></a>04800 }
-<a name="l04801"></a>04801 
-<a name="l04827"></a><a class="code" href="group__moses.html#g0c895cc2e971156231313f7a16eb6212">04827</a> cpl_polynomial *<a class="code" href="group__moses.html#g0c895cc2e971156231313f7a16eb6212">mos_poly_wav2pix</a>(cpl_bivector *pixwav, <span class="keywordtype">int</span> order, 
-<a name="l04828"></a>04828                                  <span class="keywordtype">double</span> reject, <span class="keywordtype">int</span> minlines, 
-<a name="l04829"></a>04829                                  <span class="keywordtype">int</span> *nlines, <span class="keywordtype">double</span> *err)
-<a name="l04830"></a>04830 {
-<a name="l04831"></a>04831     <span class="keyword">const</span> <span class="keywordtype">char</span>   *func = <span class="stringliteral">"mos_poly_wav2pix"</span>;
-<a name="l04832"></a>04832 
-<a name="l04833"></a>04833     cpl_bivector *pixwav2;
-<a name="l04834"></a>04834     cpl_vector   *wavel;
-<a name="l04835"></a>04835     cpl_vector   *pixel;
-<a name="l04836"></a>04836     <span class="keywordtype">double</span>       *d_wavel;
-<a name="l04837"></a>04837     <span class="keywordtype">double</span>       *d_pixel;
-<a name="l04838"></a>04838     <span class="keywordtype">double</span>        pixpos;
-<a name="l04839"></a>04839     <span class="keywordtype">int</span>           fitlines;
-<a name="l04840"></a>04840     <span class="keywordtype">int</span>           rejection = 0;
-<a name="l04841"></a>04841     <span class="keywordtype">int</span>           i, j;
-<a name="l04842"></a>04842 
-<a name="l04843"></a>04843     cpl_polynomial *ids;
-<a name="l04844"></a>04844 
-<a name="l04845"></a>04845 
-<a name="l04846"></a>04846     *nlines = 0;
-<a name="l04847"></a>04847     *err = 0;
-<a name="l04848"></a>04848 
-<a name="l04849"></a>04849     <span class="keywordflow">if</span> (pixwav == NULL) {
-<a name="l04850"></a>04850         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l04851"></a>04851         <span class="keywordflow">return</span> NULL;
-<a name="l04852"></a>04852     }
-<a name="l04853"></a>04853 
-<a name="l04854"></a>04854     fitlines = cpl_bivector_get_size(pixwav);
-<a name="l04855"></a>04855 
-<a name="l04856"></a>04856     <span class="keywordflow">if</span> (fitlines < minlines) {
-<a name="l04857"></a>04857         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l04858"></a>04858         <span class="keywordflow">return</span> NULL;
-<a name="l04859"></a>04859     }
-<a name="l04860"></a>04860 
-<a name="l04861"></a>04861 
-<a name="l04862"></a>04862     <span class="comment">/*</span>
-<a name="l04863"></a>04863 <span class="comment">     * If outliers rejection was requested, allocate a working</span>
-<a name="l04864"></a>04864 <span class="comment">     * vector (that can be modified as soon as outliers are removed)</span>
-<a name="l04865"></a>04865 <span class="comment">     */</span>
-<a name="l04866"></a>04866 
-<a name="l04867"></a>04867     <span class="keywordflow">if</span> (reject > 0.0)
-<a name="l04868"></a>04868         rejection = 1;
-<a name="l04869"></a>04869 
-<a name="l04870"></a>04870     <span class="keywordflow">if</span> (rejection)
-<a name="l04871"></a>04871         pixwav2 = cpl_bivector_duplicate(pixwav);
-<a name="l04872"></a>04872     <span class="keywordflow">else</span>
-<a name="l04873"></a>04873         pixwav2 = pixwav;
-<a name="l04874"></a>04874 
-<a name="l04875"></a>04875 
-<a name="l04876"></a>04876     <span class="comment">/*</span>
-<a name="l04877"></a>04877 <span class="comment">     * The single vectors are extracted just because the fitting routine</span>
-<a name="l04878"></a>04878 <span class="comment">     * requires it</span>
-<a name="l04879"></a>04879 <span class="comment">     */</span>
-<a name="l04880"></a>04880 
-<a name="l04881"></a>04881     pixel = cpl_bivector_get_x(pixwav2);
-<a name="l04882"></a>04882     wavel = cpl_bivector_get_y(pixwav2);
-<a name="l04883"></a>04883 
-<a name="l04884"></a>04884 
-<a name="l04885"></a>04885     <span class="comment">/*</span>
-<a name="l04886"></a>04886 <span class="comment">     * Get rid of the wrapper, in case of duplication</span>
-<a name="l04887"></a>04887 <span class="comment">     */</span>
-<a name="l04888"></a>04888 
-<a name="l04889"></a>04889     <span class="keywordflow">if</span> (rejection)
-<a name="l04890"></a>04890         cpl_bivector_unwrap_vectors(pixwav2);
-<a name="l04891"></a>04891 
-<a name="l04892"></a>04892 
-<a name="l04893"></a>04893     <span class="comment">/*</span>
-<a name="l04894"></a>04894 <span class="comment">     * Here begins the iterative fit of identified lines</span>
-<a name="l04895"></a>04895 <span class="comment">     */</span>
-<a name="l04896"></a>04896 
-<a name="l04897"></a>04897     <span class="keywordflow">while</span> (fitlines >= minlines) {
-<a name="l04898"></a>04898 
-<a name="l04899"></a>04899         ids = cpl_polynomial_fit_1d_create(wavel, pixel, order, err);
-<a name="l04900"></a>04900         *err = sqrt(*err);
-<a name="l04901"></a>04901     
-<a name="l04902"></a>04902         <span class="keywordflow">if</span> (ids == NULL) {
-<a name="l04903"></a>04903             cpl_msg_debug(cpl_error_get_where(), cpl_error_get_message());
-<a name="l04904"></a>04904             cpl_msg_debug(func, <span class="stringliteral">"Fitting IDS"</span>);
-<a name="l04905"></a>04905             cpl_error_set_where(func);
-<a name="l04906"></a>04906             <span class="keywordflow">if</span> (rejection) {
-<a name="l04907"></a>04907                 cpl_vector_delete(wavel);
-<a name="l04908"></a>04908                 cpl_vector_delete(pixel);
-<a name="l04909"></a>04909             }
-<a name="l04910"></a>04910             <span class="keywordflow">return</span> NULL;
-<a name="l04911"></a>04911         }
-<a name="l04912"></a>04912 
-<a name="l04913"></a>04913         <span class="keywordflow">if</span> (rejection) {
-<a name="l04914"></a>04914 
-<a name="l04915"></a>04915 
-<a name="l04916"></a>04916             <span class="comment">/*</span>
-<a name="l04917"></a>04917 <span class="comment">             * Now work directly with the vector data buffers...</span>
-<a name="l04918"></a>04918 <span class="comment">             */</span>
-<a name="l04919"></a>04919 
-<a name="l04920"></a>04920             d_pixel = cpl_vector_unwrap(pixel);
-<a name="l04921"></a>04921             d_wavel = cpl_vector_unwrap(wavel);
-<a name="l04922"></a>04922 
-<a name="l04923"></a>04923             <span class="keywordflow">for</span> (i = 0, j = 0; i < fitlines; i++) {
-<a name="l04924"></a>04924                 pixpos = cpl_polynomial_eval_1d(ids, d_wavel[i], NULL);
-<a name="l04925"></a>04925                 <span class="keywordflow">if</span> (fabs(pixpos - d_pixel[i]) < reject) {
-<a name="l04926"></a>04926                     d_pixel[j] = d_pixel[i];
-<a name="l04927"></a>04927                     d_wavel[j] = d_wavel[i];
-<a name="l04928"></a>04928                     j++;
-<a name="l04929"></a>04929                 }
-<a name="l04930"></a>04930             }
-<a name="l04931"></a>04931     
-<a name="l04932"></a>04932             <span class="keywordflow">if</span> (j == fitlines) {       <span class="comment">/* No rejection in last iteration */</span>
-<a name="l04933"></a>04933                 cpl_free(d_wavel);
-<a name="l04934"></a>04934                 cpl_free(d_pixel);
-<a name="l04935"></a>04935                 *nlines = fitlines;
-<a name="l04936"></a>04936                 <span class="keywordflow">return</span> ids;
-<a name="l04937"></a>04937             }
-<a name="l04938"></a>04938             <span class="keywordflow">else</span> {                     <span class="comment">/* Some lines were rejected       */</span>
-<a name="l04939"></a>04939                 fitlines = j;
-<a name="l04940"></a>04940                 cpl_polynomial_delete(ids);
-<a name="l04941"></a>04941                 <span class="keywordflow">if</span> (fitlines >= minlines) {
-<a name="l04942"></a>04942                     pixel = cpl_vector_wrap(fitlines, d_pixel);
-<a name="l04943"></a>04943                     wavel = cpl_vector_wrap(fitlines, d_wavel);
-<a name="l04944"></a>04944                 }
-<a name="l04945"></a>04945                 <span class="keywordflow">else</span> {                 <span class="comment">/* Too few lines: failure         */</span>
-<a name="l04946"></a>04946                     cpl_free(d_wavel);
-<a name="l04947"></a>04947                     cpl_free(d_pixel);
-<a name="l04948"></a>04948                     cpl_error_set(func, CPL_ERROR_CONTINUE);
-<a name="l04949"></a>04949                     <span class="keywordflow">return</span> NULL;
-<a name="l04950"></a>04950                 }
-<a name="l04951"></a>04951             }
-<a name="l04952"></a>04952         }
-<a name="l04953"></a>04953         <span class="keywordflow">else</span> {
-<a name="l04954"></a>04954             *nlines = fitlines;
-<a name="l04955"></a>04955             <span class="keywordflow">return</span> ids;       <span class="comment">/* Exit at first iteration if no rejection */</span>
-<a name="l04956"></a>04956         }
-<a name="l04957"></a>04957     }
-<a name="l04958"></a>04958 
-<a name="l04959"></a>04959     <span class="keywordflow">return</span> ids;               <span class="comment">/* To avoid compiler warnings */</span>
-<a name="l04960"></a>04960 }
-<a name="l04961"></a>04961 
-<a name="l04962"></a>04962 
-<a name="l04987"></a><a class="code" href="group__moses.html#g2d49af6d6595dda815a2475dd6de449a">04987</a> cpl_polynomial *<a class="code" href="group__moses.html#g2d49af6d6595dda815a2475dd6de449a">mos_poly_pix2wav</a>(cpl_bivector *pixwav, <span class="keywordtype">int</span> order,
-<a name="l04988"></a>04988                                  <span class="keywordtype">double</span> reject, <span class="keywordtype">int</span> minlines, 
-<a name="l04989"></a>04989                                  <span class="keywordtype">int</span> *nlines, <span class="keywordtype">double</span> *err)
-<a name="l04990"></a>04990 {
-<a name="l04991"></a>04991 
-<a name="l04992"></a>04992     cpl_bivector *wavpix;
-<a name="l04993"></a>04993     cpl_vector   *wavel;
-<a name="l04994"></a>04994     cpl_vector   *pixel;
-<a name="l04995"></a>04995 
-<a name="l04996"></a>04996     cpl_polynomial *dds;
-<a name="l04997"></a>04997 
-<a name="l04998"></a>04998 
-<a name="l04999"></a>04999     <span class="comment">/*</span>
-<a name="l05000"></a>05000 <span class="comment">     * Swap vectors in bivector, in order to reuse mos_poly_wav2pix()</span>
-<a name="l05001"></a>05001 <span class="comment">     */</span>
-<a name="l05002"></a>05002 
-<a name="l05003"></a>05003     pixel = cpl_bivector_get_x(pixwav);
-<a name="l05004"></a>05004     wavel = cpl_bivector_get_y(pixwav);
-<a name="l05005"></a>05005 
-<a name="l05006"></a>05006     wavpix = cpl_bivector_wrap_vectors(wavel, pixel);
-<a name="l05007"></a>05007 
-<a name="l05008"></a>05008     dds = <a class="code" href="group__moses.html#g0c895cc2e971156231313f7a16eb6212">mos_poly_wav2pix</a>(wavpix, order, reject, minlines, nlines, err);
-<a name="l05009"></a>05009 
-<a name="l05010"></a>05010     cpl_bivector_unwrap_vectors(wavpix);
-<a name="l05011"></a>05011 
-<a name="l05012"></a>05012     <span class="keywordflow">return</span> dds;
-<a name="l05013"></a>05013 
-<a name="l05014"></a>05014 }
-<a name="l05015"></a>05015 
-<a name="l05016"></a>05016 
-<a name="l05039"></a><a class="code" href="group__moses.html#g84eceb2b87667085a8215974f0a52446">05039</a> cpl_bivector *<a class="code" href="group__moses.html#g84eceb2b87667085a8215974f0a52446">mos_find_peaks</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *spectrum, <span class="keywordtype">int</span> length, 
-<a name="l05040"></a>05040                              cpl_vector *lines, cpl_polynomial *ids, 
-<a name="l05041"></a>05041                              <span class="keywordtype">double</span> refwave, <span class="keywordtype">int</span> sradius)
-<a name="l05042"></a>05042 {
-<a name="l05043"></a>05043     <span class="keyword">const</span> <span class="keywordtype">char</span>   *func = <span class="stringliteral">"mos_find_peaks"</span>;
-<a name="l05044"></a>05044 
-<a name="l05045"></a>05045     <span class="keywordtype">double</span>       *data;
-<a name="l05046"></a>05046     <span class="keywordtype">double</span>       *d_pixel;
-<a name="l05047"></a>05047     <span class="keywordtype">double</span>       *d_wavel;
-<a name="l05048"></a>05048     <span class="keywordtype">float</span>         pos;
-<a name="l05049"></a>05049     <span class="keywordtype">int</span>           nlines;
-<a name="l05050"></a>05050     <span class="keywordtype">int</span>           pixel;
-<a name="l05051"></a>05051     <span class="keywordtype">int</span>           i, j;
-<a name="l05052"></a>05052 
-<a name="l05053"></a>05053 
-<a name="l05054"></a>05054     <span class="keywordflow">if</span> (spectrum == NULL || lines == NULL || ids == NULL) {
-<a name="l05055"></a>05055         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l05056"></a>05056         <span class="keywordflow">return</span> NULL;
-<a name="l05057"></a>05057     }
-<a name="l05058"></a>05058 
-<a name="l05059"></a>05059     nlines = cpl_vector_get_size(lines);
-<a name="l05060"></a>05060 
-<a name="l05061"></a>05061     <span class="keywordflow">if</span> (sradius < 1 || length < 2*sradius+1 || nlines < 1) {
-<a name="l05062"></a>05062         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l05063"></a>05063         <span class="keywordflow">return</span> NULL;
-<a name="l05064"></a>05064     }
-<a name="l05065"></a>05065 
-<a name="l05066"></a>05066     d_wavel = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l05067"></a>05067     d_pixel = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l05068"></a>05068 
-<a name="l05069"></a>05069     data = cpl_vector_get_data(lines);
-<a name="l05070"></a>05070 
-<a name="l05071"></a>05071     <span class="keywordflow">for</span> (i = 0, j = 0; i < nlines; i++) {
-<a name="l05072"></a>05072         pixel = cpl_polynomial_eval_1d(ids, data[i]-refwave, NULL) + 0.5;
-<a name="l05073"></a>05073         <span class="keywordflow">if</span> (pixel - sradius < 0 || pixel + sradius >= length)
-<a name="l05074"></a>05074             <span class="keywordflow">continue</span>;
-<a name="l05075"></a>05075         <span class="keywordflow">if</span> (0 == <a class="code" href="group__moses.html#g56f03689ea7eaf37395dbb26a24e3fcf">peakPosition</a>(spectrum+pixel-sradius, 2*sradius+1, &pos, 1)) {
-<a name="l05076"></a>05076             pos += pixel - sradius;
-<a name="l05077"></a>05077             d_pixel[j] = pos;
-<a name="l05078"></a>05078             d_wavel[j] = data[i];
-<a name="l05079"></a>05079             j++;
-<a name="l05080"></a>05080         }
-<a name="l05081"></a>05081     }
-<a name="l05082"></a>05082 
-<a name="l05083"></a>05083     <span class="keywordflow">if</span> (j > 0) {
-<a name="l05084"></a>05084         <span class="keywordflow">return</span> cpl_bivector_wrap_vectors(cpl_vector_wrap(j, d_pixel),
-<a name="l05085"></a>05085                                          cpl_vector_wrap(j, d_wavel));
-<a name="l05086"></a>05086     }
-<a name="l05087"></a>05087     <span class="keywordflow">else</span> {
-<a name="l05088"></a>05088         cpl_free(d_wavel);
-<a name="l05089"></a>05089         cpl_free(d_pixel);
-<a name="l05090"></a>05090         cpl_error_set(func, CPL_ERROR_ILLEGAL_OUTPUT);
-<a name="l05091"></a>05091         <span class="keywordflow">return</span> NULL;
-<a name="l05092"></a>05092     }
-<a name="l05093"></a>05093 }
-<a name="l05094"></a>05094 
-<a name="l05095"></a>05095 
-<a name="l05213"></a><a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">05213</a> cpl_image *<a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(<span class="keyword">const</span> cpl_image *image,
-<a name="l05214"></a>05214                                           cpl_vector *lines,
-<a name="l05215"></a>05215                                           <span class="keywordtype">double</span> dispersion, <span class="keywordtype">float</span> level,
-<a name="l05216"></a>05216                                           <span class="keywordtype">int</span> sradius, <span class="keywordtype">int</span> order,
-<a name="l05217"></a>05217                                           <span class="keywordtype">double</span> reject, <span class="keywordtype">double</span> refwave, 
-<a name="l05218"></a>05218                                           <span class="keywordtype">double</span> *wavestart, <span class="keywordtype">double</span> *waveend,
-<a name="l05219"></a>05219                                           <span class="keywordtype">int</span> *nlines, <span class="keywordtype">double</span> *error, 
-<a name="l05220"></a>05220                                           cpl_table *idscoeff,
-<a name="l05221"></a>05221                                           cpl_image *calibration,
-<a name="l05222"></a>05222                                           cpl_image *residuals, 
-<a name="l05223"></a>05223                                           cpl_table *restable,
-<a name="l05224"></a>05224                                           cpl_mask *refmask)
-<a name="l05225"></a>05225 {
-<a name="l05226"></a>05226 
-<a name="l05227"></a>05227     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_wavelength_calibration_raw"</span>;
-<a name="l05228"></a>05228 
-<a name="l05229"></a>05229     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l05230"></a>05230                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l05231"></a>05231 
-<a name="l05232"></a>05232     <span class="keywordtype">double</span>  tolerance = 20.0;     <span class="comment">/* Probably forever...                */</span>
-<a name="l05233"></a>05233     <span class="keywordtype">int</span>     step      = 10;       <span class="comment">/* Compute restable every "step" rows */</span>
-<a name="l05234"></a>05234 
-<a name="l05235"></a>05235     <span class="keywordtype">char</span>            name[MAX_COLNAME];
-<a name="l05236"></a>05236     cpl_image      *resampled;
-<a name="l05237"></a>05237     cpl_bivector   *output;
-<a name="l05238"></a>05238     cpl_bivector   *new_output;
-<a name="l05239"></a>05239     cpl_vector     *peaks;
-<a name="l05240"></a>05240     cpl_vector     *wavel;
-<a name="l05241"></a>05241     cpl_polynomial *ids;
-<a name="l05242"></a>05242     cpl_polynomial *lin;
-<a name="l05243"></a>05243     cpl_matrix     *kernel;
-<a name="l05244"></a>05244     <span class="keywordtype">double</span>          ids_err;
-<a name="l05245"></a>05245     <span class="keywordtype">double</span>          max_disp, min_disp;
-<a name="l05246"></a>05246     <span class="keywordtype">double</span>         *line;
-<a name="l05247"></a>05247     <span class="keywordtype">double</span>          firstLambda, lastLambda, lambda;
-<a name="l05248"></a>05248     <span class="keywordtype">double</span>          value, wave, pixe;
-<a name="l05249"></a>05249     cpl_binary     *mdata;
-<a name="l05250"></a>05250     <span class="keyword">const</span> <span class="keywordtype">float</span>    *sdata;
-<a name="l05251"></a>05251     <span class="keywordtype">float</span>          *rdata;
-<a name="l05252"></a>05252     <span class="keywordtype">float</span>          *idata;
-<a name="l05253"></a>05253     <span class="keywordtype">float</span>          *ddata;
-<a name="l05254"></a>05254     <span class="keywordtype">float</span>           v1, v2, vi;
-<a name="l05255"></a>05255     <span class="keywordtype">float</span>           fpixel;
-<a name="l05256"></a>05256     <span class="keywordtype">int</span>            *have_it;
-<a name="l05257"></a>05257     <span class="keywordtype">int</span>             pixstart, pixend;
-<a name="l05258"></a>05258     <span class="keywordtype">int</span>             extrapolation;
-<a name="l05259"></a>05259     <span class="keywordtype">int</span>             nref;
-<a name="l05260"></a>05260     <span class="keywordtype">int</span>             nl, nx, ny, pixel;
-<a name="l05261"></a>05261     <span class="keywordtype">int</span>             countLines, usedLines;
-<a name="l05262"></a>05262     <span class="keywordtype">int</span>             uorder;
-<a name="l05263"></a>05263     <span class="keywordtype">int</span>             in, first, last;
-<a name="l05264"></a>05264     <span class="keywordtype">int</span>             width, uradius;
-<a name="l05265"></a>05265     <span class="keywordtype">int</span>             i, j;
-<a name="l05266"></a>05266     cpl_size        k;
-<a name="l05267"></a>05267 
-<a name="l05268"></a>05268 
-<a name="l05269"></a>05269     <span class="keywordflow">if</span> (dispersion == 0.0) {
-<a name="l05270"></a>05270         cpl_msg_error(func, <span class="stringliteral">"The expected dispersion (A/pixel) must be given"</span>);
-<a name="l05271"></a>05271         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l05272"></a>05272         <span class="keywordflow">return</span> NULL;
-<a name="l05273"></a>05273     }
-<a name="l05274"></a>05274 
-<a name="l05275"></a>05275     <span class="keywordflow">if</span> (dispersion < 0.0) {
-<a name="l05276"></a>05276         cpl_msg_error(func, <span class="stringliteral">"The expected dispersion must be positive"</span>);
-<a name="l05277"></a>05277         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l05278"></a>05278         <span class="keywordflow">return</span> NULL;
-<a name="l05279"></a>05279     }
-<a name="l05280"></a>05280 
-<a name="l05281"></a>05281     max_disp = dispersion + dispersion * tolerance / 100;
-<a name="l05282"></a>05282     min_disp = dispersion - dispersion * tolerance / 100;
-<a name="l05283"></a>05283 
-<a name="l05284"></a>05284     <span class="keywordflow">if</span> (order < 1) {
-<a name="l05285"></a>05285         cpl_msg_error(func, <span class="stringliteral">"The order of the fitting polynomial "</span>
-<a name="l05286"></a>05286                       <span class="stringliteral">"must be at least 1"</span>);
-<a name="l05287"></a>05287         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l05288"></a>05288         <span class="keywordflow">return</span> NULL;
-<a name="l05289"></a>05289     }
-<a name="l05290"></a>05290 
-<a name="l05291"></a>05291     <span class="keywordflow">if</span> (image == NULL || lines == NULL) {
-<a name="l05292"></a>05292         cpl_msg_error(func, <span class="stringliteral">"Both spectral exposure and reference line "</span>
-<a name="l05293"></a>05293                       <span class="stringliteral">"catalog are required in input"</span>);
-<a name="l05294"></a>05294         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l05295"></a>05295         <span class="keywordflow">return</span> NULL;
-<a name="l05296"></a>05296     }
-<a name="l05297"></a>05297 
-<a name="l05298"></a>05298     nx = cpl_image_get_size_x(image);
-<a name="l05299"></a>05299     ny = cpl_image_get_size_y(image);
-<a name="l05300"></a>05300     sdata = cpl_image_get_data_float_const(image);
-<a name="l05301"></a>05301 
-<a name="l05302"></a>05302     nref = cpl_vector_get_size(lines);
-<a name="l05303"></a>05303     line = cpl_vector_get_data(lines);
-<a name="l05304"></a>05304 
-<a name="l05305"></a>05305     <span class="keywordflow">if</span> (*wavestart < 1.0 && *waveend < 1.0) {
-<a name="l05306"></a>05306         firstLambda = line[0];
-<a name="l05307"></a>05307         lastLambda = line[nref-1];
-<a name="l05308"></a>05308         extrapolation = (lastLambda - firstLambda) / 10;
-<a name="l05309"></a>05309         firstLambda -= extrapolation;
-<a name="l05310"></a>05310         lastLambda += extrapolation;
-<a name="l05311"></a>05311         *wavestart = firstLambda;
-<a name="l05312"></a>05312         *waveend = lastLambda;
-<a name="l05313"></a>05313     }
-<a name="l05314"></a>05314     <span class="keywordflow">else</span> {
-<a name="l05315"></a>05315         firstLambda = *wavestart;
-<a name="l05316"></a>05316         lastLambda = *waveend;
-<a name="l05317"></a>05317     }
-<a name="l05318"></a>05318 
-<a name="l05319"></a>05319     nl = (lastLambda - firstLambda) / dispersion;
-<a name="l05320"></a>05320     resampled = cpl_image_new(nl, ny, CPL_TYPE_FLOAT);
-<a name="l05321"></a>05321     rdata = cpl_image_get_data_float(resampled);
-<a name="l05322"></a>05322 
-<a name="l05323"></a>05323     <span class="keywordflow">if</span> (calibration)
-<a name="l05324"></a>05324         idata = cpl_image_get_data_float(calibration);
-<a name="l05325"></a>05325 
-<a name="l05326"></a>05326     <span class="keywordflow">if</span> (residuals)
-<a name="l05327"></a>05327         ddata = cpl_image_get_data_float(residuals);
-<a name="l05328"></a>05328 
-<a name="l05329"></a>05329     <span class="keywordflow">if</span> (idscoeff)
-<a name="l05330"></a>05330         <span class="keywordflow">for</span> (j = 0; j <= order; j++)
-<a name="l05331"></a>05331             cpl_table_new_column(idscoeff, clab[j], CPL_TYPE_DOUBLE);
-<a name="l05332"></a>05332 
-<a name="l05333"></a>05333     <span class="keywordflow">if</span> (restable) {
-<a name="l05334"></a>05334         cpl_table_set_size(restable, nref);
-<a name="l05335"></a>05335         cpl_table_new_column(restable, <span class="stringliteral">"wavelength"</span>, CPL_TYPE_DOUBLE);
-<a name="l05336"></a>05336         cpl_table_copy_data_double(restable, <span class="stringliteral">"wavelength"</span>, line);
-<a name="l05337"></a>05337         <span class="keywordflow">for</span> (i = 0; i < ny; i += step) {
-<a name="l05338"></a>05338              snprintf(name, MAX_COLNAME, <span class="stringliteral">"r%d"</span>, i);
-<a name="l05339"></a>05339              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);
-<a name="l05340"></a>05340              snprintf(name, MAX_COLNAME, <span class="stringliteral">"d%d"</span>, i);
-<a name="l05341"></a>05341              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);
-<a name="l05342"></a>05342              snprintf(name, MAX_COLNAME, <span class="stringliteral">"p%d"</span>, i);
-<a name="l05343"></a>05343              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);
-<a name="l05344"></a>05344         }
-<a name="l05345"></a>05345     }
-<a name="l05346"></a>05346 
-<a name="l05347"></a>05347     <span class="comment">/*</span>
-<a name="l05348"></a>05348 <span class="comment">     * Here is the real thing: detecting and identifying peaks,</span>
-<a name="l05349"></a>05349 <span class="comment">     * and then fit the transformation from wavelength to pixel</span>
-<a name="l05350"></a>05350 <span class="comment">     * and from pixel to wavelength.</span>
-<a name="l05351"></a>05351 <span class="comment">     */</span>
-<a name="l05352"></a>05352 
-<a name="l05353"></a>05353     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l05354"></a>05354         width = <a class="code" href="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533">mos_lines_width</a>(sdata + i*nx, nx);
-<a name="l05355"></a>05355         <span class="keywordflow">if</span> (sradius > 0) {
-<a name="l05356"></a>05356             <span class="keywordflow">if</span> (width > sradius) {
-<a name="l05357"></a>05357                 uradius = width;
-<a name="l05358"></a>05358             }
-<a name="l05359"></a>05359             <span class="keywordflow">else</span> {
-<a name="l05360"></a>05360                 uradius = sradius;
-<a name="l05361"></a>05361             }
-<a name="l05362"></a>05362         }
-<a name="l05363"></a>05363         <span class="keywordflow">if</span> (width < 5)
-<a name="l05364"></a>05364             width = 5;
-<a name="l05365"></a>05365         peaks = <a class="code" href="group__moses.html#g417edefcade103f40ba21dd3f9c29af1">mos_peak_candidates</a>(sdata + i*nx, nx, level, width);
-<a name="l05366"></a>05366         <span class="keywordflow">if</span> (peaks) {
-<a name="l05367"></a>05367             peaks = <a class="code" href="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0">mos_refine_peaks</a>(sdata + i*nx, nx, peaks, width);
-<a name="l05368"></a>05368         }
-<a name="l05369"></a>05369         <span class="keywordflow">if</span> (peaks) {
-<a name="l05370"></a>05370             output = <a class="code" href="group__moses.html#g43123c837803fd95b01ba2870522ebaf">mos_identify_peaks</a>(peaks, lines, min_disp, max_disp, 0.05);
-<a name="l05371"></a>05371             <span class="keywordflow">if</span> (output) {
-<a name="l05372"></a>05372                 countLines = cpl_bivector_get_size(output);
-<a name="l05373"></a>05373                 <span class="keywordflow">if</span> (countLines < 4) {
-<a name="l05374"></a>05374                     cpl_bivector_delete(output);
-<a name="l05375"></a>05375                     cpl_vector_delete(peaks);
-<a name="l05376"></a>05376                     <span class="keywordflow">if</span> (nlines)
-<a name="l05377"></a>05377                         nlines[i] = 0;
-<a name="l05378"></a>05378                     <span class="keywordflow">if</span> (error)
-<a name="l05379"></a>05379                         error[i] = 0.0;
-<a name="l05380"></a>05380                     <span class="keywordflow">continue</span>;
-<a name="l05381"></a>05381                 }
-<a name="l05382"></a>05382 
-<a name="l05383"></a>05383                 <span class="comment">/*</span>
-<a name="l05384"></a>05384 <span class="comment">                 * Set reference wavelength as zero point</span>
-<a name="l05385"></a>05385 <span class="comment">                 */</span>
-<a name="l05386"></a>05386 
-<a name="l05387"></a>05387                 wavel = cpl_bivector_get_y(output);
-<a name="l05388"></a>05388                 cpl_vector_subtract_scalar(wavel, refwave);
-<a name="l05389"></a>05389 
-<a name="l05390"></a>05390                 uorder = countLines / 2 - 1;
-<a name="l05391"></a>05391                 <span class="keywordflow">if</span> (uorder > order)
-<a name="l05392"></a>05392                     uorder = order;
-<a name="l05393"></a>05393 
-<a name="l05394"></a>05394 <span class="comment">/* This part is now commented out. In case the first-guess iteration</span>
-<a name="l05395"></a>05395 <span class="comment"> * was requested, the first fit was made with a lower polynomial degree:</span>
-<a name="l05396"></a>05396 <span class="comment"> * more robust, and still accurate enough to be used as a first-guess.</span>
-<a name="l05397"></a>05397 <span class="comment"></span>
-<a name="l05398"></a>05398 <span class="comment">                if (sradius > 0 && uorder > 2)</span>
-<a name="l05399"></a>05399 <span class="comment">                    --uorder;</span>
-<a name="l05400"></a>05400 <span class="comment"></span>
-<a name="l05401"></a>05401 <span class="comment"> * End of commented part */</span>
-<a name="l05402"></a>05402 
-<a name="l05403"></a>05403                 ids = <a class="code" href="group__moses.html#g0c895cc2e971156231313f7a16eb6212">mos_poly_wav2pix</a>(output, uorder, reject,
-<a name="l05404"></a>05404                                        2 * (uorder + 1), &usedLines,
-<a name="l05405"></a>05405                                        &ids_err);
-<a name="l05406"></a>05406 
-<a name="l05407"></a>05407                 <span class="keywordflow">if</span> (ids == NULL) {
-<a name="l05408"></a>05408                     cpl_bivector_delete(output);
-<a name="l05409"></a>05409                     cpl_vector_delete(peaks);
-<a name="l05410"></a>05410                     <span class="keywordflow">if</span> (nlines)
-<a name="l05411"></a>05411                         nlines[i] = 0;
-<a name="l05412"></a>05412                     <span class="keywordflow">if</span> (error)
-<a name="l05413"></a>05413                         error[i] = 0.0;
-<a name="l05414"></a>05414                     cpl_error_reset();
-<a name="l05415"></a>05415                     <span class="keywordflow">continue</span>;
-<a name="l05416"></a>05416                 }
-<a name="l05417"></a>05417 
-<a name="l05418"></a>05418                 <span class="keywordflow">if</span> (idscoeff) {
-<a name="l05419"></a>05419 
-<a name="l05420"></a>05420                     <span class="comment">/*</span>
-<a name="l05421"></a>05421 <span class="comment">                     * Write it anyway, even in case a first-guess based</span>
-<a name="l05422"></a>05422 <span class="comment">                     * solution will be searched afterwards: in case of</span>
-<a name="l05423"></a>05423 <span class="comment">                     * failure, the "blind" solution is kept.</span>
-<a name="l05424"></a>05424 <span class="comment">                     */</span>
-<a name="l05425"></a>05425 
-<a name="l05426"></a>05426                     <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l05427"></a>05427                         <span class="keywordflow">if</span> (k > uorder) {
-<a name="l05428"></a>05428                             cpl_table_set_double(idscoeff, clab[k], i, 0.0);
-<a name="l05429"></a>05429                         }
-<a name="l05430"></a>05430                         <span class="keywordflow">else</span> {
-<a name="l05431"></a>05431                             cpl_table_set_double(idscoeff, clab[k], i,
-<a name="l05432"></a>05432                                       cpl_polynomial_get_coeff(ids, &k));
-<a name="l05433"></a>05433                         }
-<a name="l05434"></a>05434                     }
-<a name="l05435"></a>05435                 }
-<a name="l05436"></a>05436 
-<a name="l05437"></a>05437                 <span class="keywordflow">if</span> (sradius > 0) {
-<a name="l05438"></a>05438 
-<a name="l05439"></a>05439                     <span class="comment">/*</span>
-<a name="l05440"></a>05440 <span class="comment">                     * Use ids as a first-guess</span>
-<a name="l05441"></a>05441 <span class="comment">                     */</span>
-<a name="l05442"></a>05442 
-<a name="l05443"></a>05443                     new_output = <a class="code" href="group__moses.html#g84eceb2b87667085a8215974f0a52446">mos_find_peaks</a>(sdata + i*nx, nx, lines, 
-<a name="l05444"></a>05444                                                 ids, refwave, uradius);
-<a name="l05445"></a>05445 
-<a name="l05446"></a>05446                     <span class="keywordflow">if</span> (new_output) {
-<a name="l05447"></a>05447                         cpl_bivector_delete(output);
-<a name="l05448"></a>05448                         output = new_output;
-<a name="l05449"></a>05449                     }
-<a name="l05450"></a>05450                     <span class="keywordflow">else</span>
-<a name="l05451"></a>05451                         cpl_error_reset();
-<a name="l05452"></a>05452 
-<a name="l05453"></a>05453 
-<a name="l05454"></a>05454                     cpl_polynomial_delete(ids);
-<a name="l05455"></a>05455 
-<a name="l05456"></a>05456                     countLines = cpl_bivector_get_size(output);
-<a name="l05457"></a>05457 
-<a name="l05458"></a>05458                     <span class="keywordflow">if</span> (countLines < 4) {
-<a name="l05459"></a>05459                         cpl_bivector_delete(output);
-<a name="l05460"></a>05460                         cpl_vector_delete(peaks);
-<a name="l05461"></a>05461 
-<a name="l05462"></a>05462                         <span class="comment">/* </span>
-<a name="l05463"></a>05463 <span class="comment">                         * With the following code a decision is taken:</span>
-<a name="l05464"></a>05464 <span class="comment">                         * if using the first-guess gives no results,</span>
-<a name="l05465"></a>05465 <span class="comment">                         * then also the "blind" solution is rejected.</span>
-<a name="l05466"></a>05466 <span class="comment">                         */</span>
-<a name="l05467"></a>05467 
-<a name="l05468"></a>05468                         <span class="keywordflow">if</span> (nlines)
-<a name="l05469"></a>05469                             nlines[i] = 0;
-<a name="l05470"></a>05470                         <span class="keywordflow">if</span> (error)
-<a name="l05471"></a>05471                             error[i] = 0.0;
-<a name="l05472"></a>05472                         <span class="keywordflow">if</span> (idscoeff)
-<a name="l05473"></a>05473                             <span class="keywordflow">for</span> (k = 0; k <= order; k++)
-<a name="l05474"></a>05474                                 cpl_table_set_invalid(idscoeff, clab[k], i);
-<a name="l05475"></a>05475                         <span class="keywordflow">continue</span>;
-<a name="l05476"></a>05476                     }
-<a name="l05477"></a>05477 
-<a name="l05478"></a>05478                     wavel = cpl_bivector_get_y(output);
-<a name="l05479"></a>05479                     cpl_vector_subtract_scalar(wavel, refwave);
-<a name="l05480"></a>05480 
-<a name="l05481"></a>05481                     uorder = countLines / 2 - 1;
-<a name="l05482"></a>05482                     <span class="keywordflow">if</span> (uorder > order)
-<a name="l05483"></a>05483                         uorder = order;
-<a name="l05484"></a>05484 
-<a name="l05485"></a>05485                     ids = <a class="code" href="group__moses.html#g0c895cc2e971156231313f7a16eb6212">mos_poly_wav2pix</a>(output, uorder, reject,
-<a name="l05486"></a>05486                                            2 * (uorder + 1), &usedLines,
-<a name="l05487"></a>05487                                            &ids_err);
-<a name="l05488"></a>05488 
-<a name="l05489"></a>05489                     <span class="keywordflow">if</span> (ids == NULL) {
-<a name="l05490"></a>05490                         cpl_bivector_delete(output);
-<a name="l05491"></a>05491                         cpl_vector_delete(peaks);
-<a name="l05492"></a>05492 
-<a name="l05493"></a>05493                         <span class="comment">/* </span>
-<a name="l05494"></a>05494 <span class="comment">                         * With the following code a decision is taken:</span>
-<a name="l05495"></a>05495 <span class="comment">                         * if using the first-guess gives no results,</span>
-<a name="l05496"></a>05496 <span class="comment">                         * then also the "blind" solution is rejected.</span>
-<a name="l05497"></a>05497 <span class="comment">                         */</span>
-<a name="l05498"></a>05498 
-<a name="l05499"></a>05499                         <span class="keywordflow">if</span> (nlines)
-<a name="l05500"></a>05500                             nlines[i] = 0;
-<a name="l05501"></a>05501                         <span class="keywordflow">if</span> (error)
-<a name="l05502"></a>05502                             error[i] = 0.0;
-<a name="l05503"></a>05503                         <span class="keywordflow">if</span> (idscoeff)
-<a name="l05504"></a>05504                             <span class="keywordflow">for</span> (k = 0; k <= order; k++)
-<a name="l05505"></a>05505                                 cpl_table_set_invalid(idscoeff, clab[k], i);
-<a name="l05506"></a>05506                         cpl_error_reset();
-<a name="l05507"></a>05507                         <span class="keywordflow">continue</span>;
-<a name="l05508"></a>05508                     }
-<a name="l05509"></a>05509 
-<a name="l05510"></a>05510                     <span class="keywordflow">if</span> (idscoeff) {
-<a name="l05511"></a>05511                         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l05512"></a>05512                             <span class="keywordflow">if</span> (k > uorder) {
-<a name="l05513"></a>05513                                 cpl_table_set_double(idscoeff, clab[k], i, 0.0);
-<a name="l05514"></a>05514                             }
-<a name="l05515"></a>05515                             <span class="keywordflow">else</span> {
-<a name="l05516"></a>05516                                 cpl_table_set_double(idscoeff, clab[k], i,
-<a name="l05517"></a>05517                                             cpl_polynomial_get_coeff(ids, &k));
-<a name="l05518"></a>05518                             }
-<a name="l05519"></a>05519                         }
-<a name="l05520"></a>05520                     }
-<a name="l05521"></a>05521 
-<a name="l05522"></a>05522                 } <span class="comment">/* End of "use ids as a first-guess" */</span>
-<a name="l05523"></a>05523 
-<a name="l05524"></a>05524                 <span class="keywordflow">if</span> (nlines)
-<a name="l05525"></a>05525                     nlines[i] = usedLines;
-<a name="l05526"></a>05526                 <span class="keywordflow">if</span> (error)
-<a name="l05527"></a>05527                     error[i] = ids_err / sqrt(usedLines/(uorder + 1));
-<a name="l05528"></a>05528 
-<a name="l05529"></a>05529                 pixstart = cpl_polynomial_eval_1d(ids, 
-<a name="l05530"></a>05530                     cpl_bivector_get_y_data(output)[0], NULL);
-<a name="l05531"></a>05531                 pixend = cpl_polynomial_eval_1d(ids,
-<a name="l05532"></a>05532                     cpl_bivector_get_y_data(output)[countLines-1], NULL);
-<a name="l05533"></a>05533                 extrapolation = (pixend - pixstart) / 5;
-<a name="l05534"></a>05534                 pixstart -= extrapolation;
-<a name="l05535"></a>05535                 pixend += extrapolation;
-<a name="l05536"></a>05536                 <span class="keywordflow">if</span> (pixstart < 0)
-<a name="l05537"></a>05537                     pixstart = 0;
-<a name="l05538"></a>05538                 <span class="keywordflow">if</span> (pixend > nx)
-<a name="l05539"></a>05539                     pixend = nx;
-<a name="l05540"></a>05540 
-<a name="l05541"></a>05541                 <span class="comment">/*</span>
-<a name="l05542"></a>05542 <span class="comment">                 * Wavelength calibrated image (if requested):</span>
-<a name="l05543"></a>05543 <span class="comment">                 */</span>
-<a name="l05544"></a>05544 
-<a name="l05545"></a>05545                 <span class="keywordflow">if</span> (calibration) {
-<a name="l05546"></a>05546                     <span class="keywordflow">for</span> (j = pixstart; j < pixend; j++) {
-<a name="l05547"></a>05547                         (idata + i*nx)[j] = <a class="code" href="group__moses.html#g99c7290af152957144e8c0413355e5dd">mos_eval_dds</a>(ids, firstLambda, 
-<a name="l05548"></a>05548                                                          lastLambda, refwave, 
-<a name="l05549"></a>05549                                                          j);
-<a name="l05550"></a>05550                     }
-<a name="l05551"></a>05551                 }
-<a name="l05552"></a>05552 
-<a name="l05553"></a>05553                 <span class="comment">/*</span>
-<a name="l05554"></a>05554 <span class="comment">                 * Resampled image:</span>
-<a name="l05555"></a>05555 <span class="comment">                 */</span>
-<a name="l05556"></a>05556 
-<a name="l05557"></a>05557                 <span class="keywordflow">for</span> (j = 0; j < nl; j++) {
-<a name="l05558"></a>05558                     lambda = firstLambda + j * dispersion;
-<a name="l05559"></a>05559                     fpixel = cpl_polynomial_eval_1d(ids, lambda - refwave, 
-<a name="l05560"></a>05560                                                     NULL);
-<a name="l05561"></a>05561                     pixel = fpixel;
-<a name="l05562"></a>05562                     <span class="keywordflow">if</span> (pixel >= 0 && pixel < nx-1) {
-<a name="l05563"></a>05563                         v1 = (sdata + i*nx)[pixel];
-<a name="l05564"></a>05564                         v2 = (sdata + i*nx)[pixel+1];
-<a name="l05565"></a>05565                         vi = v1 + (v2-v1)*(fpixel-pixel);
-<a name="l05566"></a>05566                         (rdata + i*nl)[j] = vi;
-<a name="l05567"></a>05567                     }
-<a name="l05568"></a>05568                 }
-<a name="l05569"></a>05569 
-<a name="l05570"></a>05570                 <span class="comment">/*</span>
-<a name="l05571"></a>05571 <span class="comment">                 * Residuals image</span>
-<a name="l05572"></a>05572 <span class="comment">                 */</span>
-<a name="l05573"></a>05573 
-<a name="l05574"></a>05574                 <span class="keywordflow">if</span> (residuals || (restable && !(i%step))) {
-<a name="l05575"></a>05575                     <span class="keywordflow">if</span> (restable && !(i%step)) {
-<a name="l05576"></a>05576                         lin = cpl_polynomial_new(1);
-<a name="l05577"></a>05577                         <span class="keywordflow">for</span> (k = 0; k < 2; k++)
-<a name="l05578"></a>05578                             cpl_polynomial_set_coeff(lin, &k, 
-<a name="l05579"></a>05579                                           cpl_polynomial_get_coeff(ids, &k));
-<a name="l05580"></a>05580                     }
-<a name="l05581"></a>05581                     <span class="keywordflow">for</span> (j = 0; j < countLines; j++) {
-<a name="l05582"></a>05582                         pixe = cpl_bivector_get_x_data(output)[j];
-<a name="l05583"></a>05583                         wave = cpl_bivector_get_y_data(output)[j];
-<a name="l05584"></a>05584                         value = pixe - cpl_polynomial_eval_1d(ids, wave, NULL);
-<a name="l05585"></a>05585                         <span class="keywordflow">if</span> (residuals) {
-<a name="l05586"></a>05586                             pixel = pixe + 0.5;
-<a name="l05587"></a>05587                             (ddata + i*nx)[pixel] = value;
-<a name="l05588"></a>05588                         }
-<a name="l05589"></a>05589                         <span class="keywordflow">if</span> (restable && !(i%step)) {
-<a name="l05590"></a>05590                             <span class="keywordflow">for</span> (k = 0; k < nref; k++) {
-<a name="l05591"></a>05591                                 <span class="keywordflow">if</span> (fabs(line[k] - refwave - wave) < 0.1) {
-<a name="l05592"></a>05592                                     snprintf(name, MAX_COLNAME, <span class="stringliteral">"r%d"</span>, i);
-<a name="l05593"></a>05593                                     cpl_table_set_double(restable, name, 
-<a name="l05594"></a>05594                                                          k, value);
-<a name="l05595"></a>05595                                     value = pixe
-<a name="l05596"></a>05596                                           - cpl_polynomial_eval_1d(lin, wave,
-<a name="l05597"></a>05597                                                                    NULL);
-<a name="l05598"></a>05598                                     snprintf(name, MAX_COLNAME, <span class="stringliteral">"d%d"</span>, i);
-<a name="l05599"></a>05599                                     cpl_table_set_double(restable, name, 
-<a name="l05600"></a>05600                                                          k, value);
-<a name="l05601"></a>05601                                     snprintf(name, MAX_COLNAME, <span class="stringliteral">"p%d"</span>, i);
-<a name="l05602"></a>05602                                     cpl_table_set_double(restable, name,
-<a name="l05603"></a>05603                                                          k, pixe);
-<a name="l05604"></a>05604                                     <span class="keywordflow">break</span>;
-<a name="l05605"></a>05605                                 }
-<a name="l05606"></a>05606                             }
-<a name="l05607"></a>05607                         }
-<a name="l05608"></a>05608                     }
-<a name="l05609"></a>05609                     <span class="keywordflow">if</span> (restable && !(i%step)) {
-<a name="l05610"></a>05610                         cpl_polynomial_delete(lin);
-<a name="l05611"></a>05611                     }
-<a name="l05612"></a>05612                 }
-<a name="l05613"></a>05613 
-<a name="l05614"></a>05614                 <span class="comment">/*</span>
-<a name="l05615"></a>05615 <span class="comment">                 * Mask at reference wavelength</span>
-<a name="l05616"></a>05616 <span class="comment">                 */</span>
-<a name="l05617"></a>05617 
-<a name="l05618"></a>05618                 <span class="keywordflow">if</span> (refmask) {
-<a name="l05619"></a>05619                     mdata = cpl_mask_get_data(refmask);
-<a name="l05620"></a>05620                     pixel = cpl_polynomial_eval_1d(ids, 0.0, NULL) + 0.5;
-<a name="l05621"></a>05621                     <span class="keywordflow">if</span> (pixel - 1 >= 0 && pixel + 1 < nx) {
-<a name="l05622"></a>05622                         mdata[pixel-1 + i*nx] = CPL_BINARY_1;
-<a name="l05623"></a>05623                         mdata[pixel + i*nx] = CPL_BINARY_1;
-<a name="l05624"></a>05624                         mdata[pixel+1 + i*nx] = CPL_BINARY_1;
-<a name="l05625"></a>05625                     }
-<a name="l05626"></a>05626                 }
-<a name="l05627"></a>05627 
-<a name="l05628"></a>05628                 cpl_polynomial_delete(ids);
-<a name="l05629"></a>05629                 cpl_bivector_delete(output);
-<a name="l05630"></a>05630             }
-<a name="l05631"></a>05631             cpl_vector_delete(peaks);
-<a name="l05632"></a>05632         }
-<a name="l05633"></a>05633     }
-<a name="l05634"></a>05634 
-<a name="l05635"></a>05635     <span class="keywordflow">if</span> (refmask) {
-<a name="l05636"></a>05636         kernel = cpl_matrix_new(3, 3);
-<a name="l05637"></a>05637         cpl_matrix_set(kernel, 0, 1, 1.0);
-<a name="l05638"></a>05638         cpl_matrix_set(kernel, 1, 1, 1.0);
-<a name="l05639"></a>05639         cpl_matrix_set(kernel, 2, 1, 1.0);
-<a name="l05640"></a>05640 
-<a name="l05641"></a>05641         cpl_mask_dilation(refmask, kernel);
-<a name="l05642"></a>05642         cpl_mask_erosion(refmask, kernel);
-<a name="l05643"></a>05643         cpl_mask_erosion(refmask, kernel);
-<a name="l05644"></a>05644         cpl_mask_dilation(refmask, kernel);
-<a name="l05645"></a>05645 
-<a name="l05646"></a>05646         cpl_matrix_delete(kernel);
-<a name="l05647"></a>05647 
-<a name="l05648"></a>05648         <span class="comment">/*</span>
-<a name="l05649"></a>05649 <span class="comment">         *  Fill possible gaps</span>
-<a name="l05650"></a>05650 <span class="comment">         */</span>
-<a name="l05651"></a>05651 
-<a name="l05652"></a>05652         mdata = cpl_mask_get_data(refmask);
-<a name="l05653"></a>05653         have_it = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l05654"></a>05654 
-<a name="l05655"></a>05655         <span class="keywordflow">for</span> (i = 0; i < ny; i++, mdata += nx) {
-<a name="l05656"></a>05656             <span class="keywordflow">for</span> (j = 0; j < nx; j++) {
-<a name="l05657"></a>05657                 <span class="keywordflow">if</span> (mdata[j] == CPL_BINARY_1) {
-<a name="l05658"></a>05658                     have_it[i] = j;
-<a name="l05659"></a>05659                     <span class="keywordflow">break</span>;
-<a name="l05660"></a>05660                 }
-<a name="l05661"></a>05661             }
-<a name="l05662"></a>05662         }
-<a name="l05663"></a>05663 
-<a name="l05664"></a>05664         mdata = cpl_mask_get_data(refmask);
-<a name="l05665"></a>05665         in = 0;
-<a name="l05666"></a>05666         first = last = 0;
-<a name="l05667"></a>05667 
-<a name="l05668"></a>05668         <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l05669"></a>05669             <span class="keywordflow">if</span> (have_it[i]) {
-<a name="l05670"></a>05670                 <span class="keywordflow">if</span> (!in) {
-<a name="l05671"></a>05671                     in = 1;
-<a name="l05672"></a>05672                     <span class="keywordflow">if</span> (first) {
-<a name="l05673"></a>05673                         last = i;
-<a name="l05674"></a>05674                         <span class="keywordflow">if</span> (abs(have_it[first] - have_it[last]) < 3) {
-<a name="l05675"></a>05675                             <span class="keywordflow">for</span> (j = first; j < last; j++) {
-<a name="l05676"></a>05676                                 mdata[have_it[first] + nx*j + 0] = CPL_BINARY_1;
-<a name="l05677"></a>05677                                 mdata[have_it[first] + nx*j + 1] = CPL_BINARY_1;
-<a name="l05678"></a>05678                                 mdata[have_it[first] + nx*j + 2] = CPL_BINARY_1;
-<a name="l05679"></a>05679                             }
-<a name="l05680"></a>05680                         }
-<a name="l05681"></a>05681                     }
-<a name="l05682"></a>05682                 }
-<a name="l05683"></a>05683             }
-<a name="l05684"></a>05684             <span class="keywordflow">else</span> {
-<a name="l05685"></a>05685                 <span class="keywordflow">if</span> (in) {
-<a name="l05686"></a>05686                     in = 0;
-<a name="l05687"></a>05687                     first = i - 1;
-<a name="l05688"></a>05688                 }
-<a name="l05689"></a>05689             }
-<a name="l05690"></a>05690         }
-<a name="l05691"></a>05691 
-<a name="l05692"></a>05692         cpl_free(have_it);
-<a name="l05693"></a>05693 
-<a name="l05694"></a>05694     }
-<a name="l05695"></a>05695 
-<a name="l05696"></a>05696 <span class="comment">/*</span>
-<a name="l05697"></a>05697 <span class="comment">    for (i = 0; i < ny; i++) {</span>
-<a name="l05698"></a>05698 <span class="comment">        if (nlines[i] == 0) {</span>
-<a name="l05699"></a>05699 <span class="comment">            for (k = 0; k <= order; k++) {</span>
-<a name="l05700"></a>05700 <span class="comment">                cpl_table_set_invalid(idscoeff, clab[k], i);</span>
-<a name="l05701"></a>05701 <span class="comment">            }</span>
-<a name="l05702"></a>05702 <span class="comment">        }</span>
-<a name="l05703"></a>05703 <span class="comment">    }</span>
-<a name="l05704"></a>05704 <span class="comment">*/</span>
-<a name="l05705"></a>05705 
-<a name="l05706"></a>05706     <span class="keywordflow">return</span> resampled;
-<a name="l05707"></a>05707 }
-<a name="l05708"></a>05708 
-<a name="l05709"></a>05709 
-<a name="l05731"></a>05731 <span class="comment">/*</span>
-<a name="l05732"></a>05732 <span class="comment">cpl_table *mos_locate_spectra_bis(cpl_mask *mask)</span>
-<a name="l05733"></a>05733 <span class="comment">{</span>
-<a name="l05734"></a>05734 <span class="comment">    const char *func = "mos_locate_spectra_bis";</span>
-<a name="l05735"></a>05735 <span class="comment"></span>
-<a name="l05736"></a>05736 <span class="comment">    cpl_apertures    *slits;</span>
-<a name="l05737"></a>05737 <span class="comment">    cpl_image        *labimage;</span>
-<a name="l05738"></a>05738 <span class="comment">    cpl_image        *refimage;</span>
-<a name="l05739"></a>05739 <span class="comment">    cpl_binary       *mdata;</span>
-<a name="l05740"></a>05740 <span class="comment">    cpl_table        *slitpos;</span>
-<a name="l05741"></a>05741 <span class="comment">    cpl_propertylist *sort_col;</span>
-<a name="l05742"></a>05742 <span class="comment">    int               nslits;</span>
-<a name="l05743"></a>05743 <span class="comment">    int              *have_it;</span>
-<a name="l05744"></a>05744 <span class="comment">    int               in, first, last;</span>
-<a name="l05745"></a>05745 <span class="comment">    int               i, j;</span>
-<a name="l05746"></a>05746 <span class="comment"></span>
-<a name="l05747"></a>05747 <span class="comment"></span>
-<a name="l05748"></a>05748 <span class="comment">    if (mask == NULL) {</span>
-<a name="l05749"></a>05749 <span class="comment">        cpl_error_set(func, CPL_ERROR_NULL_INPUT);</span>
-<a name="l05750"></a>05750 <span class="comment">        return NULL;</span>
-<a name="l05751"></a>05751 <span class="comment">    }</span>
-<a name="l05752"></a>05752 <span class="comment"></span>
-<a name="l05753"></a>05753 <span class="comment">    nx = cpl_mask_get_size_x(mask);</span>
-<a name="l05754"></a>05754 <span class="comment">    ny = cpl_mask_get_size_y(mask);</span>
-<a name="l05755"></a>05755 <span class="comment"></span>
-<a name="l05756"></a>05756 <span class="comment">    mdata = cpl_mask_get_data(refmask);</span>
-<a name="l05757"></a>05757 <span class="comment">    have_it = cpl_calloc(ny, sizeof(int));</span>
-<a name="l05758"></a>05758 <span class="comment"></span>
-<a name="l05759"></a>05759 <span class="comment">    for (i = 0; i < ny; i++, mdata += nx) {</span>
-<a name="l05760"></a>05760 <span class="comment">        for (j = 0; j < nx; j++) {</span>
-<a name="l05761"></a>05761 <span class="comment">            if (mdata[j] == CPL_BINARY_1) {</span>
-<a name="l05762"></a>05762 <span class="comment">                have_it[i] = j + 1;</span>
-<a name="l05763"></a>05763 <span class="comment">                break;</span>
-<a name="l05764"></a>05764 <span class="comment">            }</span>
-<a name="l05765"></a>05765 <span class="comment">        }</span>
-<a name="l05766"></a>05766 <span class="comment">    }</span>
-<a name="l05767"></a>05767 <span class="comment"></span>
-<a name="l05768"></a>05768 <span class="comment">    mdata = cpl_mask_get_data(refmask);</span>
-<a name="l05769"></a>05769 <span class="comment">    in = 0;</span>
-<a name="l05770"></a>05770 <span class="comment">    first = last = 0;</span>
-<a name="l05771"></a>05771 <span class="comment">    nslits = 0;</span>
-<a name="l05772"></a>05772 <span class="comment"></span>
-<a name="l05773"></a>05773 <span class="comment">    for (i = 0; i < ny; i++) {</span>
-<a name="l05774"></a>05774 <span class="comment">        if (have_it[i]) {</span>
-<a name="l05775"></a>05775 <span class="comment">            if (in) {</span>
-<a name="l05776"></a>05776 <span class="comment">                if (i) {</span>
-<a name="l05777"></a>05777 <span class="comment">                    if (abs(have_it[i] - have_it[i-1]) > 3) {</span>
-<a name="l05778"></a>05778 <span class="comment">                        nslits++;</span>
-<a name="l05779"></a>05779 <span class="comment">                    }</span>
-<a name="l05780"></a>05780 <span class="comment">                }</span>
-<a name="l05781"></a>05781 <span class="comment">            }</span>
-<a name="l05782"></a>05782 <span class="comment">            else {</span>
-<a name="l05783"></a>05783 <span class="comment">                in = 1;</span>
-<a name="l05784"></a>05784 <span class="comment">                nslits++;</span>
-<a name="l05785"></a>05785 <span class="comment">            }</span>
-<a name="l05786"></a>05786 <span class="comment">        }</span>
-<a name="l05787"></a>05787 <span class="comment">        else {</span>
-<a name="l05788"></a>05788 <span class="comment">            if (in) {</span>
-<a name="l05789"></a>05789 <span class="comment">                in = 0;</span>
-<a name="l05790"></a>05790 <span class="comment">            }</span>
-<a name="l05791"></a>05791 <span class="comment">        }</span>
-<a name="l05792"></a>05792 <span class="comment">    }</span>
-<a name="l05793"></a>05793 <span class="comment">}</span>
-<a name="l05794"></a>05794 <span class="comment">*/</span>
-<a name="l05795"></a>05795 
-<a name="l05796"></a>05796 
-<a name="l05818"></a><a class="code" href="group__moses.html#g884857a604857727d2fc0d293b678209">05818</a> cpl_table *<a class="code" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_spectra</a>(cpl_mask *mask)
-<a name="l05819"></a>05819 {
-<a name="l05820"></a>05820     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_locate_spectra"</span>;
-<a name="l05821"></a>05821 
-<a name="l05822"></a>05822     cpl_apertures    *slits;
-<a name="l05823"></a>05823     cpl_image        *labimage;
-<a name="l05824"></a>05824     cpl_image        *refimage;
-<a name="l05825"></a>05825     cpl_table        *slitpos;
-<a name="l05826"></a>05826     cpl_propertylist *sort_col;
-<a name="l05827"></a>05827     cpl_size          nslits;
-<a name="l05828"></a>05828     <span class="keywordtype">int</span>               i;
-<a name="l05829"></a>05829 
-<a name="l05830"></a>05830 
-<a name="l05831"></a>05831     <span class="keywordflow">if</span> (mask == NULL) {
-<a name="l05832"></a>05832         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l05833"></a>05833         <span class="keywordflow">return</span> NULL;
-<a name="l05834"></a>05834     }
-<a name="l05835"></a>05835 
-<a name="l05836"></a>05836     labimage = cpl_image_labelise_mask_create(mask, &nslits);
-<a name="l05837"></a>05837 
-<a name="l05838"></a>05838     <span class="keywordflow">if</span> (nslits < 1) {
-<a name="l05839"></a>05839         cpl_image_delete(labimage);
-<a name="l05840"></a>05840         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l05841"></a>05841         <span class="keywordflow">return</span> NULL;
-<a name="l05842"></a>05842     }
-<a name="l05843"></a>05843 
-<a name="l05844"></a>05844     refimage = cpl_image_new_from_mask(mask);
-<a name="l05845"></a>05845 
-<a name="l05846"></a>05846     slits = cpl_apertures_new_from_image(refimage, labimage);
-<a name="l05847"></a>05847 
-<a name="l05848"></a>05848     cpl_image_delete(labimage);
-<a name="l05849"></a>05849     cpl_image_delete(refimage);
-<a name="l05850"></a>05850 
-<a name="l05851"></a>05851     nslits = cpl_apertures_get_size(slits);  <span class="comment">/* Overwriting nslits - safer! */</span>
-<a name="l05852"></a>05852     <span class="keywordflow">if</span> (nslits < 1) {
-<a name="l05853"></a>05853         cpl_apertures_delete(slits);
-<a name="l05854"></a>05854         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l05855"></a>05855         <span class="keywordflow">return</span> NULL;
-<a name="l05856"></a>05856     }
-<a name="l05857"></a>05857 
-<a name="l05858"></a>05858     slitpos = cpl_table_new(nslits);
-<a name="l05859"></a>05859     cpl_table_new_column(slitpos, <span class="stringliteral">"xtop"</span>, CPL_TYPE_DOUBLE);
-<a name="l05860"></a>05860     cpl_table_new_column(slitpos, <span class="stringliteral">"ytop"</span>, CPL_TYPE_DOUBLE);
-<a name="l05861"></a>05861     cpl_table_new_column(slitpos, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l05862"></a>05862     cpl_table_new_column(slitpos, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l05863"></a>05863     cpl_table_set_column_unit(slitpos, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l05864"></a>05864     cpl_table_set_column_unit(slitpos, <span class="stringliteral">"ytop"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l05865"></a>05865     cpl_table_set_column_unit(slitpos, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l05866"></a>05866     cpl_table_set_column_unit(slitpos, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l05867"></a>05867 
-<a name="l05868"></a>05868     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l05869"></a>05869         cpl_table_set_double(slitpos, <span class="stringliteral">"xtop"</span>, i, 
-<a name="l05870"></a>05870                              cpl_apertures_get_top_x(slits, i+1) - 1);
-<a name="l05871"></a>05871         cpl_table_set_double(slitpos, <span class="stringliteral">"ytop"</span>, i, 
-<a name="l05872"></a>05872                              cpl_apertures_get_top(slits, i+1));
-<a name="l05873"></a>05873         cpl_table_set_double(slitpos, <span class="stringliteral">"xbottom"</span>, i, 
-<a name="l05874"></a>05874                              cpl_apertures_get_bottom_x(slits, i+1) - 1);
-<a name="l05875"></a>05875         cpl_table_set_double(slitpos, <span class="stringliteral">"ybottom"</span>, i, 
-<a name="l05876"></a>05876                              cpl_apertures_get_bottom(slits, i+1));
-<a name="l05877"></a>05877     }
-<a name="l05878"></a>05878 
-<a name="l05879"></a>05879     cpl_apertures_delete(slits);
-<a name="l05880"></a>05880 
-<a name="l05881"></a>05881     sort_col = cpl_propertylist_new();
-<a name="l05882"></a>05882     cpl_propertylist_append_bool(sort_col, <span class="stringliteral">"ytop"</span>, 1);
-<a name="l05883"></a>05883     cpl_table_sort(slitpos, sort_col);
-<a name="l05884"></a>05884     cpl_propertylist_delete(sort_col);
-<a name="l05885"></a>05885 
-<a name="l05886"></a>05886     <span class="keywordflow">return</span> slitpos;
-<a name="l05887"></a>05887 
-<a name="l05888"></a>05888 }
-<a name="l05889"></a>05889 
-<a name="l05890"></a>05890 
-<a name="l05906"></a><a class="code" href="group__moses.html#g0a1742caa67a002bee7a30f9d5289672">05906</a> cpl_error_code <a class="code" href="group__moses.html#g0a1742caa67a002bee7a30f9d5289672">mos_validate_slits</a>(cpl_table *slits) 
-<a name="l05907"></a>05907 {
-<a name="l05908"></a>05908     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_validate_slits"</span>;
-<a name="l05909"></a>05909 
-<a name="l05910"></a>05910 
-<a name="l05911"></a>05911     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l05912"></a>05912         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l05913"></a>05913 
-<a name="l05914"></a>05914     <span class="keywordflow">if</span> (1 != cpl_table_has_column(slits, <span class="stringliteral">"xtop"</span>))
-<a name="l05915"></a>05915         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l05916"></a>05916 
-<a name="l05917"></a>05917     <span class="keywordflow">if</span> (1 != cpl_table_has_column(slits, <span class="stringliteral">"ytop"</span>))
-<a name="l05918"></a>05918         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l05919"></a>05919 
-<a name="l05920"></a>05920     <span class="keywordflow">if</span> (1 != cpl_table_has_column(slits, <span class="stringliteral">"xbottom"</span>))
-<a name="l05921"></a>05921         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l05922"></a>05922 
-<a name="l05923"></a>05923     <span class="keywordflow">if</span> (1 != cpl_table_has_column(slits, <span class="stringliteral">"ybottom"</span>))
-<a name="l05924"></a>05924         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l05925"></a>05925 
-<a name="l05926"></a>05926     <span class="keywordflow">if</span> (CPL_TYPE_DOUBLE != cpl_table_get_column_type(slits, <span class="stringliteral">"xtop"</span>))
-<a name="l05927"></a>05927         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l05928"></a>05928 
-<a name="l05929"></a>05929     <span class="keywordflow">if</span> (CPL_TYPE_DOUBLE != cpl_table_get_column_type(slits, <span class="stringliteral">"ytop"</span>))
-<a name="l05930"></a>05930         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l05931"></a>05931 
-<a name="l05932"></a>05932     <span class="keywordflow">if</span> (CPL_TYPE_DOUBLE != cpl_table_get_column_type(slits, <span class="stringliteral">"xbottom"</span>))
-<a name="l05933"></a>05933         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l05934"></a>05934 
-<a name="l05935"></a>05935     <span class="keywordflow">if</span> (CPL_TYPE_DOUBLE != cpl_table_get_column_type(slits, <span class="stringliteral">"ybottom"</span>))
-<a name="l05936"></a>05936         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l05937"></a>05937 
-<a name="l05938"></a>05938     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l05939"></a>05939 }
-<a name="l05940"></a>05940 
-<a name="l05941"></a>05941 
-<a name="l05970"></a><a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">05970</a> cpl_error_code <a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a>(cpl_table *slits, <span class="keywordtype">int</span> rotation, <span class="keywordtype">int</span> nx, <span class="keywordtype">int</span> ny)
-<a name="l05971"></a>05971 {
-<a name="l05972"></a>05972     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_rotate_slits"</span>;
-<a name="l05973"></a>05973 
-<a name="l05974"></a>05974     cpl_error_code error;
-<a name="l05975"></a>05975     <span class="keywordtype">char</span> aux_name[] = <span class="stringliteral">"_0"</span>;
-<a name="l05976"></a>05976     <span class="keywordtype">int</span> i;
-<a name="l05977"></a>05977 
-<a name="l05978"></a>05978 
-<a name="l05979"></a>05979     rotation %= 4;
-<a name="l05980"></a>05980     <span class="keywordflow">if</span> (rotation < 0)
-<a name="l05981"></a>05981         rotation += 4;
-<a name="l05982"></a>05982 
-<a name="l05983"></a>05983     <span class="keywordflow">if</span> (rotation == 0)
-<a name="l05984"></a>05984         <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l05985"></a>05985 
-<a name="l05986"></a>05986     error = <a class="code" href="group__moses.html#g0a1742caa67a002bee7a30f9d5289672">mos_validate_slits</a>(slits);
-<a name="l05987"></a>05987     <span class="keywordflow">if</span> (error)
-<a name="l05988"></a>05988         <span class="keywordflow">return</span> cpl_error_set(func, error);
-<a name="l05989"></a>05989 
-<a name="l05990"></a>05990     <span class="keywordflow">if</span> (rotation == 1 || rotation == 3) {
-<a name="l05991"></a>05991 
-<a name="l05992"></a>05992         <span class="comment">/*</span>
-<a name="l05993"></a>05993 <span class="comment">         * Swap x and y column names</span>
-<a name="l05994"></a>05994 <span class="comment">         */</span>
-<a name="l05995"></a>05995 
-<a name="l05996"></a>05996         <span class="keywordflow">for</span> (i = 0; i < 77; i++)
-<a name="l05997"></a>05997             <span class="keywordflow">if</span> (1 == cpl_table_has_column(slits, aux_name))
-<a name="l05998"></a>05998                 aux_name[1]++;
-<a name="l05999"></a>05999         <span class="keywordflow">if</span> (1 == cpl_table_has_column(slits, aux_name))
-<a name="l06000"></a>06000             <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_CONTINUE);
-<a name="l06001"></a>06001         cpl_table_name_column(slits, <span class="stringliteral">"xtop"</span>, aux_name);
-<a name="l06002"></a>06002         cpl_table_name_column(slits, <span class="stringliteral">"ytop"</span>, <span class="stringliteral">"xtop"</span>);
-<a name="l06003"></a>06003         cpl_table_name_column(slits, aux_name, <span class="stringliteral">"ytop"</span>);
-<a name="l06004"></a>06004         cpl_table_name_column(slits, <span class="stringliteral">"xbottom"</span>, aux_name);
-<a name="l06005"></a>06005         cpl_table_name_column(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"xbottom"</span>);
-<a name="l06006"></a>06006         cpl_table_name_column(slits, aux_name, <span class="stringliteral">"ybottom"</span>);
-<a name="l06007"></a>06007     }
-<a name="l06008"></a>06008 
-<a name="l06009"></a>06009     <span class="keywordflow">if</span> (rotation == 1 || rotation == 2) {
-<a name="l06010"></a>06010         cpl_table_multiply_scalar(slits, <span class="stringliteral">"xtop"</span>, -1.0);
-<a name="l06011"></a>06011         cpl_table_multiply_scalar(slits, <span class="stringliteral">"xbottom"</span>, -1.0);
-<a name="l06012"></a>06012         cpl_table_add_scalar(slits, <span class="stringliteral">"xtop"</span>, nx);
-<a name="l06013"></a>06013         cpl_table_add_scalar(slits, <span class="stringliteral">"xbottom"</span>, nx);
-<a name="l06014"></a>06014     }
-<a name="l06015"></a>06015 
-<a name="l06016"></a>06016     <span class="keywordflow">if</span> (rotation == 3 || rotation == 2) {
-<a name="l06017"></a>06017         cpl_table_multiply_scalar(slits, <span class="stringliteral">"ytop"</span>, -1.0);
-<a name="l06018"></a>06018         cpl_table_multiply_scalar(slits, <span class="stringliteral">"ybottom"</span>, -1.0);
-<a name="l06019"></a>06019         cpl_table_add_scalar(slits, <span class="stringliteral">"ytop"</span>, ny);
-<a name="l06020"></a>06020         cpl_table_add_scalar(slits, <span class="stringliteral">"ybottom"</span>, ny);
-<a name="l06021"></a>06021     }
-<a name="l06022"></a>06022 
-<a name="l06023"></a>06023     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l06024"></a>06024 }
-<a name="l06025"></a>06025 
-<a name="l06026"></a>06026 
-<a name="l06084"></a><a class="code" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">06084</a> cpl_table *<a class="code" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits</a>(cpl_table *slits, cpl_table *maskslits,
-<a name="l06085"></a>06085                               cpl_table *global)
-<a name="l06086"></a>06086 {
-<a name="l06087"></a>06087     cpl_array        *top_ident = NULL;;
-<a name="l06088"></a>06088     cpl_array        *bot_ident = NULL;;
-<a name="l06089"></a>06089     cpl_matrix       *mdata;
-<a name="l06090"></a>06090     cpl_matrix       *mpattern;
-<a name="l06091"></a>06091     cpl_matrix       *top_data;
-<a name="l06092"></a>06092     cpl_matrix       *top_pattern;
-<a name="l06093"></a>06093     cpl_matrix       *top_mdata;
-<a name="l06094"></a>06094     cpl_matrix       *top_mpattern;
-<a name="l06095"></a>06095     cpl_matrix       *bot_data;
-<a name="l06096"></a>06096     cpl_matrix       *bot_pattern;
-<a name="l06097"></a>06097     cpl_matrix       *bot_mdata;
-<a name="l06098"></a>06098     cpl_matrix       *bot_mpattern;
-<a name="l06099"></a>06099     cpl_propertylist *sort_col;
-<a name="l06100"></a>06100     <span class="keywordtype">double</span>           *xtop;
-<a name="l06101"></a>06101     <span class="keywordtype">double</span>           *ytop;
-<a name="l06102"></a>06102     <span class="keywordtype">double</span>           *xmtop;
-<a name="l06103"></a>06103     <span class="keywordtype">double</span>           *ymtop;
-<a name="l06104"></a>06104     <span class="keywordtype">double</span>           *xbot;
-<a name="l06105"></a>06105     <span class="keywordtype">double</span>           *ybot;
-<a name="l06106"></a>06106     <span class="keywordtype">double</span>           *xmbot;
-<a name="l06107"></a>06107     <span class="keywordtype">double</span>           *ymbot;
-<a name="l06108"></a>06108     <span class="keywordtype">double</span>            top_scale, bot_scale;
-<a name="l06109"></a>06109     <span class="keywordtype">double</span>            angle, top_angle, bot_angle;
-<a name="l06110"></a>06110     <span class="keywordtype">double</span>            xmse, ymse;
-<a name="l06111"></a>06111     <span class="keywordtype">double</span>            xrms, top_xrms, bot_xrms;
-<a name="l06112"></a>06112     <span class="keywordtype">double</span>            yrms, top_yrms, bot_yrms;
-<a name="l06113"></a>06113     <span class="keywordtype">int</span>               nslits;
-<a name="l06114"></a>06114     <span class="keywordtype">int</span>               nmaskslits, use_pattern;
-<a name="l06115"></a>06115     <span class="keywordtype">int</span>               found_slits, found_slits_top, found_slits_bot;
-<a name="l06116"></a>06116     <span class="keywordtype">int</span>               degree;
-<a name="l06117"></a>06117     <span class="keywordtype">int</span>               i;
-<a name="l06118"></a>06118     cpl_table        *positions;
-<a name="l06119"></a>06119     cpl_error_code    error;
-<a name="l06120"></a>06120 
-<a name="l06121"></a>06121     cpl_vector       *point;
-<a name="l06122"></a>06122     <span class="keywordtype">double</span>           *dpoint;
-<a name="l06123"></a>06123     cpl_vector       *xpos;
-<a name="l06124"></a>06124     cpl_vector       *ypos;
-<a name="l06125"></a>06125     cpl_vector       *xmpos;
-<a name="l06126"></a>06126     cpl_vector       *ympos;
-<a name="l06127"></a>06127     cpl_bivector     *mpos;
-<a name="l06128"></a>06128     cpl_polynomial   *xpoly     = NULL;
-<a name="l06129"></a>06129     cpl_polynomial   *ypoly     = NULL;
-<a name="l06130"></a>06130     cpl_polynomial   *top_xpoly = NULL;
-<a name="l06131"></a>06131     cpl_polynomial   *top_ypoly = NULL;
-<a name="l06132"></a>06132     cpl_polynomial   *bot_xpoly = NULL;
-<a name="l06133"></a>06133     cpl_polynomial   *bot_ypoly = NULL;
-<a name="l06134"></a>06134 
-<a name="l06135"></a>06135     <span class="keywordtype">char</span> *msg_multiplex = <span class="stringliteral">" "</span>;
-<a name="l06136"></a>06136 
-<a name="l06137"></a>06137 
-<a name="l06138"></a>06138     error = <a class="code" href="group__moses.html#g0a1742caa67a002bee7a30f9d5289672">mos_validate_slits</a>(slits);
-<a name="l06139"></a>06139     <span class="keywordflow">if</span> (error) {
-<a name="l06140"></a>06140         cpl_msg_error(cpl_func, <span class="stringliteral">"CCD slits table validation: %s"</span>,
-<a name="l06141"></a>06141                       cpl_error_get_message());
-<a name="l06142"></a>06142         cpl_error_set(cpl_func, error);
-<a name="l06143"></a>06143         <span class="keywordflow">return</span> NULL;
-<a name="l06144"></a>06144     }
-<a name="l06145"></a>06145 
-<a name="l06146"></a>06146     error = <a class="code" href="group__moses.html#g0a1742caa67a002bee7a30f9d5289672">mos_validate_slits</a>(maskslits);
-<a name="l06147"></a>06147     <span class="keywordflow">if</span> (error) {
-<a name="l06148"></a>06148         cpl_msg_error(cpl_func, <span class="stringliteral">"Mask slits table validation: %s"</span>,
-<a name="l06149"></a>06149                       cpl_error_get_message());
-<a name="l06150"></a>06150         cpl_error_set(cpl_func, error);
-<a name="l06151"></a>06151         <span class="keywordflow">return</span> NULL;
-<a name="l06152"></a>06152     }
-<a name="l06153"></a>06153 
-<a name="l06154"></a>06154     <span class="keywordflow">if</span> (1 != cpl_table_has_column(maskslits, <span class="stringliteral">"slit_id"</span>)) {
-<a name="l06155"></a>06155         cpl_msg_error(cpl_func, <span class="stringliteral">"Missing slits identifiers"</span>);
-<a name="l06156"></a>06156         cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l06157"></a>06157         <span class="keywordflow">return</span> NULL;
-<a name="l06158"></a>06158     }
-<a name="l06159"></a>06159 
-<a name="l06160"></a>06160     <span class="keywordflow">if</span> (CPL_TYPE_INT != cpl_table_get_column_type(maskslits, <span class="stringliteral">"slit_id"</span>)) {
-<a name="l06161"></a>06161         cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong type used for slits identifiers"</span>);
-<a name="l06162"></a>06162         cpl_error_set(cpl_func, CPL_ERROR_INVALID_TYPE);
-<a name="l06163"></a>06163         <span class="keywordflow">return</span> NULL;
-<a name="l06164"></a>06164     }
-<a name="l06165"></a>06165 
-<a name="l06166"></a>06166     nslits = cpl_table_get_nrow(slits);
-<a name="l06167"></a>06167     nmaskslits = cpl_table_get_nrow(maskslits);
-<a name="l06168"></a>06168 
-<a name="l06169"></a>06169     <span class="keywordflow">if</span> (nslits == 0 || nmaskslits == 0) {
-<a name="l06170"></a>06170         cpl_msg_error(cpl_func, <span class="stringliteral">"Empty slits table"</span>);
-<a name="l06171"></a>06171         cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l06172"></a>06172         <span class="keywordflow">return</span> NULL;
-<a name="l06173"></a>06173     }
-<a name="l06174"></a>06174 
-<a name="l06175"></a>06175     <span class="keywordflow">if</span> (nslits > 25 && mos_multiplex < 0) {
-<a name="l06176"></a>06176         cpl_msg_info(cpl_func, <span class="stringliteral">"Many slits: using 'fast' pattern matching..."</span>);
-<a name="l06177"></a>06177         positions = <a class="code" href="group__moses.html#ge3e3fb9252ccdfacccd0e063d293dc1f">mos_identify_slits_fast</a>(slits, maskslits, global);
-<a name="l06178"></a>06178         <span class="keywordflow">if</span> (positions == NULL)
-<a name="l06179"></a>06179             cpl_error_set_where(cpl_func);
-<a name="l06180"></a>06180         <span class="keywordflow">return</span> positions;
-<a name="l06181"></a>06181     }
-<a name="l06182"></a>06182 
-<a name="l06183"></a>06183     <span class="comment">/*</span>
-<a name="l06184"></a>06184 <span class="comment">     * Guarantee that both input tables are sorted in the same way</span>
-<a name="l06185"></a>06185 <span class="comment">     */</span>
-<a name="l06186"></a>06186 
-<a name="l06187"></a>06187     sort_col = cpl_propertylist_new();
-<a name="l06188"></a>06188     cpl_propertylist_append_bool(sort_col, <span class="stringliteral">"ytop"</span>, 1);
-<a name="l06189"></a>06189     cpl_table_sort(slits, sort_col);
-<a name="l06190"></a>06190     cpl_table_sort(maskslits, sort_col);
-<a name="l06191"></a>06191     cpl_propertylist_delete(sort_col);
-<a name="l06192"></a>06192 
-<a name="l06193"></a>06193     <span class="comment">/*</span>
-<a name="l06194"></a>06194 <span class="comment">     * First we handle all the special cases (too few slits...)</span>
-<a name="l06195"></a>06195 <span class="comment">     */</span>
-<a name="l06196"></a>06196 
-<a name="l06197"></a>06197     <span class="keywordflow">if</span> (nslits < 3 && nmaskslits > nslits) {
-<a name="l06198"></a>06198 
-<a name="l06199"></a>06199         <span class="comment">/*</span>
-<a name="l06200"></a>06200 <span class="comment">         * If there are just 1 or 2 slits on the CCD, and more on the</span>
-<a name="l06201"></a>06201 <span class="comment">         * mask, the ambiguity cannot be solved, and an error is returned.</span>
-<a name="l06202"></a>06202 <span class="comment">         * This is a case that must be solved with a first-guess relation</span>
-<a name="l06203"></a>06203 <span class="comment">         * between mask and CCD.</span>
-<a name="l06204"></a>06204 <span class="comment">         */</span>
-<a name="l06205"></a>06205 
-<a name="l06206"></a>06206         <span class="keywordflow">if</span> (nslits > 1)
-<a name="l06207"></a>06207             cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot match the %d found CCD slits "</span>
-<a name="l06208"></a>06208                             <span class="stringliteral">"with the %d mask slits: process will continue "</span>
-<a name="l06209"></a>06209                             <span class="stringliteral">"using the detected CCD slits positions"</span>, nslits,
-<a name="l06210"></a>06210                             nmaskslits);
-<a name="l06211"></a>06211         <span class="keywordflow">else</span>
-<a name="l06212"></a>06212             cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot match the found CCD slit with "</span>
-<a name="l06213"></a>06213                             <span class="stringliteral">"the %d mask slits: process will continue using "</span>
-<a name="l06214"></a>06214                             <span class="stringliteral">"the detected CCD slit position"</span>, nmaskslits);
-<a name="l06215"></a>06215         <span class="keywordflow">return</span> NULL;
-<a name="l06216"></a>06216     }
-<a name="l06217"></a>06217 
-<a name="l06218"></a>06218     <span class="keywordflow">if</span> (nmaskslits < 3 && nslits > nmaskslits) {
-<a name="l06219"></a>06219 
-<a name="l06220"></a>06220         <span class="comment">/*</span>
-<a name="l06221"></a>06221 <span class="comment">         * If there are less than 3 slits on the mask the ambiguity cannot</span>
-<a name="l06222"></a>06222 <span class="comment">         * be solved, and an error is returned. This is a case that must</span>
-<a name="l06223"></a>06223 <span class="comment">         * be solved with a first-guess relation between mask and CCD.</span>
-<a name="l06224"></a>06224 <span class="comment">         */</span>
-<a name="l06225"></a>06225 
-<a name="l06226"></a>06226         cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot match the %d found CCD slits with "</span>
-<a name="l06227"></a>06227                         <span class="stringliteral">"the %d mask slits: process will continue using "</span>
-<a name="l06228"></a>06228                         <span class="stringliteral">"the detected CCD slits positions"</span>, nslits,
-<a name="l06229"></a>06229                         nmaskslits);
-<a name="l06230"></a>06230         <span class="keywordflow">return</span> NULL;
-<a name="l06231"></a>06231     }
-<a name="l06232"></a>06232 
-<a name="l06233"></a>06233     <span class="comment">/*</span>
-<a name="l06234"></a>06234 <span class="comment">     * Pattern matching related operations begin here. Two pattern</span>
-<a name="l06235"></a>06235 <span class="comment">     * matching will be run, one based on the "top" and another one</span>
-<a name="l06236"></a>06236 <span class="comment">     * based on the "bottom" slit coordinates. The one with the</span>
-<a name="l06237"></a>06237 <span class="comment">     * smallest rms in the Y coordinate will be chosen.</span>
-<a name="l06238"></a>06238 <span class="comment">     */</span>
-<a name="l06239"></a>06239 
-<a name="l06240"></a>06240     xtop  = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);
-<a name="l06241"></a>06241     ytop  = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);
-<a name="l06242"></a>06242     xmtop = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l06243"></a>06243     ymtop = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);
-<a name="l06244"></a>06244 
-<a name="l06245"></a>06245     xbot  = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);
-<a name="l06246"></a>06246     ybot  = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);
-<a name="l06247"></a>06247     xmbot = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xbottom"</span>);
-<a name="l06248"></a>06248     ymbot = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ybottom"</span>);
-<a name="l06249"></a>06249 
-<a name="l06250"></a>06250     top_data    = cpl_matrix_new(2, nslits);
-<a name="l06251"></a>06251     top_pattern = cpl_matrix_new(2, nmaskslits);
-<a name="l06252"></a>06252     bot_data    = cpl_matrix_new(2, nslits);
-<a name="l06253"></a>06253     bot_pattern = cpl_matrix_new(2, nmaskslits);
-<a name="l06254"></a>06254 
-<a name="l06255"></a>06255     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)
-<a name="l06256"></a>06256         cpl_matrix_set(top_data, 0, i, xtop[i]);
-<a name="l06257"></a>06257 
-<a name="l06258"></a>06258     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)
-<a name="l06259"></a>06259         cpl_matrix_set(top_data, 1, i, ytop[i]);
-<a name="l06260"></a>06260 
-<a name="l06261"></a>06261     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++)
-<a name="l06262"></a>06262         cpl_matrix_set(top_pattern, 0, i, xmtop[i]);
-<a name="l06263"></a>06263 
-<a name="l06264"></a>06264     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++)
-<a name="l06265"></a>06265         cpl_matrix_set(top_pattern, 1, i, ymtop[i]);
-<a name="l06266"></a>06266 
-<a name="l06267"></a>06267     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)
-<a name="l06268"></a>06268         cpl_matrix_set(bot_data, 0, i, xbot[i]);
-<a name="l06269"></a>06269 
-<a name="l06270"></a>06270     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)
-<a name="l06271"></a>06271         cpl_matrix_set(bot_data, 1, i, ybot[i]);
-<a name="l06272"></a>06272 
-<a name="l06273"></a>06273     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++)
-<a name="l06274"></a>06274         cpl_matrix_set(bot_pattern, 0, i, xmbot[i]);
-<a name="l06275"></a>06275 
-<a name="l06276"></a>06276     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++)
-<a name="l06277"></a>06277         cpl_matrix_set(bot_pattern, 1, i, ymbot[i]);
-<a name="l06278"></a>06278 
-<a name="l06279"></a>06279     <span class="keywordflow">if</span> (nmaskslits > nslits)
-<a name="l06280"></a>06280         use_pattern = nslits;
-<a name="l06281"></a>06281     <span class="keywordflow">else</span>
-<a name="l06282"></a>06282         use_pattern = nmaskslits;
-<a name="l06283"></a>06283 
-<a name="l06284"></a>06284     top_ident = cpl_ppm_match_points(top_data, nslits, 1.0, top_pattern,
-<a name="l06285"></a>06285                                      use_pattern, 0.0, 0.1, 5, &top_mdata,
-<a name="l06286"></a>06286                                      &top_mpattern, &top_scale, &top_angle);
-<a name="l06287"></a>06287 
-<a name="l06288"></a>06288     bot_ident = cpl_ppm_match_points(bot_data, nslits, 1.0, bot_pattern,
-<a name="l06289"></a>06289                                      use_pattern, 0.0, 0.1, 5, &bot_mdata,
-<a name="l06290"></a>06290                                      &bot_mpattern, &bot_scale, &bot_angle);
-<a name="l06291"></a>06291 
-<a name="l06292"></a>06292     <span class="keywordflow">if</span> (top_ident == NULL && bot_ident == NULL) {
-<a name="l06293"></a>06293         cpl_msg_warning(cpl_func, <span class="stringliteral">"Pattern matching failure: cannot match "</span>
-<a name="l06294"></a>06294                         <span class="stringliteral">"the %d found CCD slits with the %d mask slits: "</span>
-<a name="l06295"></a>06295                         <span class="stringliteral">"process will continue using the detected CCD "</span>
-<a name="l06296"></a>06296                         <span class="stringliteral">"slits positions"</span>, nslits, nmaskslits);
-<a name="l06297"></a>06297         <span class="keywordflow">return</span> NULL;
-<a name="l06298"></a>06298     }
-<a name="l06299"></a>06299 
-<a name="l06300"></a>06300     found_slits_top = 0;
-<a name="l06301"></a>06301     found_slits_bot = 0;
-<a name="l06302"></a>06302     <span class="keywordflow">if</span> (top_ident && bot_ident) {
-<a name="l06303"></a>06303         cpl_msg_info(cpl_func, <span class="stringliteral">"Median platescale: %f +/- %f pixel/mm"</span>,
-<a name="l06304"></a>06304                      (top_scale + bot_scale) / 2, fabs(top_scale - bot_scale));
-<a name="l06305"></a>06305         cpl_msg_info(cpl_func, <span class="stringliteral">"Median rotation: %f +/- %f degrees"</span>,
-<a name="l06306"></a>06306                      (top_angle + bot_angle) / 2, fabs(top_angle - bot_angle));
-<a name="l06307"></a>06307         <span class="keywordflow">if</span> (fabs(top_angle) < fabs(bot_angle))
-<a name="l06308"></a>06308             angle = fabs(top_angle);
-<a name="l06309"></a>06309         <span class="keywordflow">else</span>
-<a name="l06310"></a>06310             angle = fabs(bot_angle);
-<a name="l06311"></a>06311         found_slits_top = cpl_matrix_get_ncol(top_mdata);
-<a name="l06312"></a>06312         found_slits_bot = cpl_matrix_get_ncol(bot_mdata);
-<a name="l06313"></a>06313     }
-<a name="l06314"></a>06314     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (top_ident) {
-<a name="l06315"></a>06315         cpl_msg_info(cpl_func, <span class="stringliteral">"Median platescale: %f pixel/mm"</span>, top_scale);
-<a name="l06316"></a>06316         cpl_msg_info(cpl_func, <span class="stringliteral">"Median rotation: %f degrees"</span>, top_angle);
-<a name="l06317"></a>06317         angle = fabs(top_angle);
-<a name="l06318"></a>06318         found_slits_top = cpl_matrix_get_ncol(top_mdata);
-<a name="l06319"></a>06319     }
-<a name="l06320"></a>06320     <span class="keywordflow">else</span> {
-<a name="l06321"></a>06321         cpl_msg_info(cpl_func, <span class="stringliteral">"Median platescale: %f pixel/mm"</span>, bot_scale);
-<a name="l06322"></a>06322         cpl_msg_info(cpl_func, <span class="stringliteral">"Median rotation: %f degrees"</span>, bot_angle);
-<a name="l06323"></a>06323         angle = fabs(bot_angle);
-<a name="l06324"></a>06324         found_slits_bot = cpl_matrix_get_ncol(bot_mdata);
-<a name="l06325"></a>06325     }
-<a name="l06326"></a>06326 
-<a name="l06327"></a>06327     cpl_array_delete(top_ident);
-<a name="l06328"></a>06328     cpl_array_delete(bot_ident);
-<a name="l06329"></a>06329 
-<a name="l06330"></a>06330     <span class="keywordflow">if</span> (angle > 4.0) {
-<a name="l06331"></a>06331         cpl_msg_warning(cpl_func, <span class="stringliteral">"Uncertain pattern matching: the rotation "</span>
-<a name="l06332"></a>06332                         <span class="stringliteral">"angle is expected to be around zero. This match is "</span>
-<a name="l06333"></a>06333                         <span class="stringliteral">"rejected: the process will continue using the %d "</span>
-<a name="l06334"></a>06334                         <span class="stringliteral">"detected CCD slits positions"</span>, nslits);
-<a name="l06335"></a>06335         <span class="keywordflow">return</span> NULL;
-<a name="l06336"></a>06336     }
-<a name="l06337"></a>06337 
-<a name="l06338"></a>06338     found_slits = found_slits_top;
-<a name="l06339"></a>06339     <span class="keywordflow">if</span> (found_slits < found_slits_bot)
-<a name="l06340"></a>06340         found_slits = found_slits_bot;     <span class="comment">/* Max value */</span>
-<a name="l06341"></a>06341 
-<a name="l06342"></a>06342     <span class="keywordflow">if</span> (found_slits < 4) {
-<a name="l06343"></a>06343         cpl_msg_warning(cpl_func,
-<a name="l06344"></a>06344                         <span class="stringliteral">"Too few safely identified slits: %d out of %d "</span>
-<a name="l06345"></a>06345                         <span class="stringliteral">"candidates (%d expected). Process will continue "</span>
-<a name="l06346"></a>06346                         <span class="stringliteral">"using the detected CCD slits positions"</span>, found_slits,
-<a name="l06347"></a>06347                         nslits, nmaskslits);
-<a name="l06348"></a>06348         <span class="keywordflow">return</span> NULL;
-<a name="l06349"></a>06349     }
-<a name="l06350"></a>06350 
-<a name="l06351"></a>06351     cpl_msg_info(cpl_func, <span class="stringliteral">"Preliminary identified slits: %d out of %d "</span>
-<a name="l06352"></a>06352                  <span class="stringliteral">"candidates\n(%d expected)"</span>, found_slits, nslits,
-<a name="l06353"></a>06353                  nmaskslits);
-<a name="l06354"></a>06354 
-<a name="l06355"></a>06355     <span class="keywordflow">if</span> (found_slits_top < 4)
-<a name="l06356"></a>06356         found_slits_top = 0;
-<a name="l06357"></a>06357 
-<a name="l06358"></a>06358     <span class="keywordflow">if</span> (found_slits_bot < 4)
-<a name="l06359"></a>06359         found_slits_bot = 0;
-<a name="l06360"></a>06360 
-<a name="l06361"></a>06361     <span class="comment">/*</span>
-<a name="l06362"></a>06362 <span class="comment">     * Now for each set select the points of the identified slits, and fit</span>
-<a name="l06363"></a>06363 <span class="comment">     * two bivariate polynomials to determine a first approximate relation</span>
-<a name="l06364"></a>06364 <span class="comment">     * between positions on the mask and positions on the CCD.</span>
-<a name="l06365"></a>06365 <span class="comment">     */</span>
-<a name="l06366"></a>06366 
-<a name="l06367"></a>06367     <span class="keywordflow">for</span> (i = 0; i < 2; i++) {
-<a name="l06368"></a>06368         <span class="keywordflow">if</span> (i) {
-<a name="l06369"></a>06369             found_slits = found_slits_top;
-<a name="l06370"></a>06370             mdata = top_mdata;
-<a name="l06371"></a>06371             mpattern = top_mpattern;
-<a name="l06372"></a>06372         }
-<a name="l06373"></a>06373         <span class="keywordflow">else</span> {
-<a name="l06374"></a>06374             found_slits = found_slits_bot;
-<a name="l06375"></a>06375             mdata = bot_mdata;
-<a name="l06376"></a>06376             mpattern = bot_mpattern;
-<a name="l06377"></a>06377         }
-<a name="l06378"></a>06378 
-<a name="l06379"></a>06379         <span class="keywordflow">if</span> (found_slits == 0)
-<a name="l06380"></a>06380             <span class="keywordflow">continue</span>;
-<a name="l06381"></a>06381         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (found_slits < 10)
-<a name="l06382"></a>06382             degree = 1;
-<a name="l06383"></a>06383         <span class="keywordflow">else</span>
-<a name="l06384"></a>06384             degree = 2;
-<a name="l06385"></a>06385 
-<a name="l06386"></a>06386         xpos  = cpl_vector_wrap(found_slits,
-<a name="l06387"></a>06387                                 cpl_matrix_get_data(mdata)              );
-<a name="l06388"></a>06388         ypos  = cpl_vector_wrap(found_slits,
-<a name="l06389"></a>06389                                 cpl_matrix_get_data(mdata) + found_slits);
-<a name="l06390"></a>06390         xmpos = cpl_vector_wrap(found_slits,
-<a name="l06391"></a>06391                                 cpl_matrix_get_data(mpattern)              );
-<a name="l06392"></a>06392         ympos = cpl_vector_wrap(found_slits,
-<a name="l06393"></a>06393                                 cpl_matrix_get_data(mpattern) + found_slits);
-<a name="l06394"></a>06394         mpos  = cpl_bivector_wrap_vectors(xmpos, ympos);
-<a name="l06395"></a>06395         xpoly = cpl_polynomial_fit_2d_create(mpos, xpos, degree, &xmse);
-<a name="l06396"></a>06396         ypoly = cpl_polynomial_fit_2d_create(mpos, ypos, degree, &ymse);
-<a name="l06397"></a>06397 
-<a name="l06398"></a>06398         cpl_bivector_unwrap_vectors(mpos);
-<a name="l06399"></a>06399         cpl_vector_unwrap(xpos);
-<a name="l06400"></a>06400         cpl_vector_unwrap(ypos);
-<a name="l06401"></a>06401         cpl_vector_unwrap(xmpos);
-<a name="l06402"></a>06402         cpl_vector_unwrap(ympos);
-<a name="l06403"></a>06403         cpl_matrix_delete(mdata);
-<a name="l06404"></a>06404         cpl_matrix_delete(mpattern);
-<a name="l06405"></a>06405 
-<a name="l06406"></a>06406         <span class="keywordflow">if</span> (i) {
-<a name="l06407"></a>06407             top_xpoly = xpoly;
-<a name="l06408"></a>06408             top_ypoly = ypoly;
-<a name="l06409"></a>06409             top_xrms = sqrt(xmse*2*degree/(found_slits - 1));
-<a name="l06410"></a>06410             top_yrms = sqrt(ymse*2*degree/(found_slits - 1));
-<a name="l06411"></a>06411         }
-<a name="l06412"></a>06412         <span class="keywordflow">else</span> {
-<a name="l06413"></a>06413             bot_xpoly = xpoly;
-<a name="l06414"></a>06414             bot_ypoly = ypoly;
-<a name="l06415"></a>06415             bot_xrms = sqrt(xmse*2*degree/(found_slits - 1));
-<a name="l06416"></a>06416             bot_yrms = sqrt(ymse*2*degree/(found_slits - 1));
-<a name="l06417"></a>06417         }
-<a name="l06418"></a>06418     }
-<a name="l06419"></a>06419 
-<a name="l06420"></a>06420     <span class="keywordflow">if</span> (top_xpoly && bot_xpoly) {
-<a name="l06421"></a>06421         <span class="keywordflow">if</span> (top_xrms < bot_xrms) {  <span class="comment">/* top X solution wins... */</span>
-<a name="l06422"></a>06422             xrms = top_xrms;
-<a name="l06423"></a>06423             xpoly = top_xpoly;
-<a name="l06424"></a>06424             cpl_polynomial_delete(bot_xpoly);
-<a name="l06425"></a>06425         }
-<a name="l06426"></a>06426         <span class="keywordflow">else</span> {                      <span class="comment">/* bottom X solution wins... */</span>
-<a name="l06427"></a>06427             xrms = bot_xrms;
-<a name="l06428"></a>06428             xpoly = bot_xpoly;
-<a name="l06429"></a>06429             cpl_polynomial_delete(top_xpoly);
-<a name="l06430"></a>06430         }
-<a name="l06431"></a>06431     }
-<a name="l06432"></a>06432     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (top_xpoly) {
-<a name="l06433"></a>06433         xrms = top_xrms;
-<a name="l06434"></a>06434         xpoly = top_xpoly;
-<a name="l06435"></a>06435     }
-<a name="l06436"></a>06436     <span class="keywordflow">else</span> {
-<a name="l06437"></a>06437         xrms = bot_xrms;
-<a name="l06438"></a>06438         xpoly = bot_xpoly;
-<a name="l06439"></a>06439     }
-<a name="l06440"></a>06440 
-<a name="l06441"></a>06441     <span class="keywordflow">if</span> (top_ypoly && bot_ypoly) {
-<a name="l06442"></a>06442         <span class="keywordflow">if</span> (top_yrms < bot_yrms) {  <span class="comment">/* top Y solution wins... */</span>
-<a name="l06443"></a>06443             yrms = top_yrms;
-<a name="l06444"></a>06444             ypoly = top_ypoly;
-<a name="l06445"></a>06445             cpl_polynomial_delete(bot_ypoly);
-<a name="l06446"></a>06446         }
-<a name="l06447"></a>06447         <span class="keywordflow">else</span> {                      <span class="comment">/* bottom Y solution wins... */</span>
-<a name="l06448"></a>06448             yrms = bot_yrms;
-<a name="l06449"></a>06449             ypoly = bot_ypoly;
-<a name="l06450"></a>06450             cpl_polynomial_delete(top_ypoly);
-<a name="l06451"></a>06451         }
-<a name="l06452"></a>06452     }
-<a name="l06453"></a>06453     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (top_ypoly) {
-<a name="l06454"></a>06454         yrms = top_yrms;
-<a name="l06455"></a>06455         ypoly = top_ypoly;
-<a name="l06456"></a>06456     }
-<a name="l06457"></a>06457     <span class="keywordflow">else</span> {
-<a name="l06458"></a>06458         yrms = bot_yrms;
-<a name="l06459"></a>06459         ypoly = bot_ypoly;
-<a name="l06460"></a>06460     }
-<a name="l06461"></a>06461 
-<a name="l06462"></a>06462     <span class="keywordflow">if</span> (xpoly == NULL || ypoly == NULL) {
-<a name="l06463"></a>06463         cpl_msg_warning(cpl_func, <span class="stringliteral">"Fit failure: the accuracy of the "</span>
-<a name="l06464"></a>06464                         <span class="stringliteral">"identified slits positions cannot be improved."</span>);
-<a name="l06465"></a>06465         cpl_polynomial_delete(xpoly);
-<a name="l06466"></a>06466         cpl_polynomial_delete(ypoly);
-<a name="l06467"></a>06467         cpl_error_reset();
-<a name="l06468"></a>06468         <span class="keywordflow">return</span> NULL;
-<a name="l06469"></a>06469     }
-<a name="l06470"></a>06470 
-<a name="l06471"></a>06471     cpl_msg_info(cpl_func,
-<a name="l06472"></a>06472                  <span class="stringliteral">"Fit successful: X rms = %.3g, Y rms = %.3g (pixel)"</span>,
-<a name="l06473"></a>06473                  xrms, yrms);
-<a name="l06474"></a>06474 
-<a name="l06475"></a>06475     <span class="keywordflow">if</span> (global) {
-<a name="l06476"></a>06476         <a class="code" href="group__moses.html#g3ad10f4436b713a1e3e3296f3fc0e1a0">write_global_distortion</a>(global, 0, xpoly);
-<a name="l06477"></a>06477         <a class="code" href="group__moses.html#g3ad10f4436b713a1e3e3296f3fc0e1a0">write_global_distortion</a>(global, 7, ypoly);
-<a name="l06478"></a>06478     }
-<a name="l06479"></a>06479 
-<a name="l06480"></a>06480     <span class="comment">/*</span>
-<a name="l06481"></a>06481 <span class="comment">     * The fit was successful: use the polynomials to obtain a new</span>
-<a name="l06482"></a>06482 <span class="comment">     * position table with the improved positions of the slits</span>
-<a name="l06483"></a>06483 <span class="comment">     */</span>
-<a name="l06484"></a>06484 
-<a name="l06485"></a>06485     positions = cpl_table_duplicate(maskslits);
-<a name="l06486"></a>06486     cpl_table_duplicate_column(positions, <span class="stringliteral">"xmtop"</span>, positions, <span class="stringliteral">"xtop"</span>);
-<a name="l06487"></a>06487     cpl_table_duplicate_column(positions, <span class="stringliteral">"ymtop"</span>, positions, <span class="stringliteral">"ytop"</span>);
-<a name="l06488"></a>06488     cpl_table_duplicate_column(positions, <span class="stringliteral">"xmbottom"</span>, positions, <span class="stringliteral">"xbottom"</span>);
-<a name="l06489"></a>06489     cpl_table_duplicate_column(positions, <span class="stringliteral">"ymbottom"</span>, positions, <span class="stringliteral">"ybottom"</span>);
-<a name="l06490"></a>06490 
-<a name="l06491"></a>06491     point = cpl_vector_new(2);
-<a name="l06492"></a>06492     dpoint = cpl_vector_get_data(point);
-<a name="l06493"></a>06493 
-<a name="l06494"></a>06494     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++) {
-<a name="l06495"></a>06495         <span class="keywordtype">double</span> position;
-<a name="l06496"></a>06496 
-<a name="l06497"></a>06497         dpoint[0] = cpl_table_get_double(positions, <span class="stringliteral">"xmtop"</span>, i, NULL);
-<a name="l06498"></a>06498         dpoint[1] = cpl_table_get_double(positions, <span class="stringliteral">"ymtop"</span>, i, NULL);
-<a name="l06499"></a>06499         position  = cpl_polynomial_eval(xpoly, point);
-<a name="l06500"></a>06500 <span class="comment">//        if (mos_multiplex >= 0) {</span>
-<a name="l06501"></a>06501 <span class="comment">//            if (mos_multiplex != ((int)floor(position)) / mos_region_size) {</span>
-<a name="l06502"></a>06502 <span class="comment">//                cpl_table_unselect_row(positions, i);</span>
-<a name="l06503"></a>06503 <span class="comment">//                continue;</span>
-<a name="l06504"></a>06504 <span class="comment">//            }</span>
-<a name="l06505"></a>06505 <span class="comment">//        }</span>
-<a name="l06506"></a>06506         cpl_table_set_double(positions, <span class="stringliteral">"xtop"</span>, i, position);
-<a name="l06507"></a>06507         position  = cpl_polynomial_eval(ypoly, point);
-<a name="l06508"></a>06508         cpl_table_set_double(positions, <span class="stringliteral">"ytop"</span>, i, position);
-<a name="l06509"></a>06509         dpoint[0] = cpl_table_get_double(positions, <span class="stringliteral">"xmbottom"</span>, i, NULL);
-<a name="l06510"></a>06510         dpoint[1] = cpl_table_get_double(positions, <span class="stringliteral">"ymbottom"</span>, i, NULL);
-<a name="l06511"></a>06511         position  = cpl_polynomial_eval(xpoly, point);
-<a name="l06512"></a>06512         cpl_table_set_double(positions, <span class="stringliteral">"xbottom"</span>, i, position);
-<a name="l06513"></a>06513         position  = cpl_polynomial_eval(ypoly, point);
-<a name="l06514"></a>06514         cpl_table_set_double(positions, <span class="stringliteral">"ybottom"</span>, i, position);
-<a name="l06515"></a>06515     }
-<a name="l06516"></a>06516 
-<a name="l06517"></a>06517 <span class="comment">//    if (mos_multiplex >= 0) {</span>
-<a name="l06518"></a>06518 <span class="comment">//        cpl_table_not_selected(positions);</span>
-<a name="l06519"></a>06519 <span class="comment">//        cpl_table_erase_selected(positions);</span>
-<a name="l06520"></a>06520 <span class="comment">//        nmaskslits = cpl_table_get_nrow(positions);</span>
-<a name="l06521"></a>06521 <span class="comment">//    }</span>
-<a name="l06522"></a>06522 
-<a name="l06523"></a>06523     cpl_vector_delete(point);
-<a name="l06524"></a>06524     cpl_polynomial_delete(xpoly);
-<a name="l06525"></a>06525     cpl_polynomial_delete(ypoly);
-<a name="l06526"></a>06526 
-<a name="l06527"></a>06527     cpl_table_erase_column(positions, <span class="stringliteral">"xmtop"</span>);
-<a name="l06528"></a>06528     cpl_table_erase_column(positions, <span class="stringliteral">"ymtop"</span>);
-<a name="l06529"></a>06529     cpl_table_erase_column(positions, <span class="stringliteral">"xmbottom"</span>);
-<a name="l06530"></a>06530     cpl_table_erase_column(positions, <span class="stringliteral">"ymbottom"</span>);
-<a name="l06531"></a>06531 
-<a name="l06532"></a>06532     <span class="keywordflow">if</span> (mos_multiplex >= 0) {
-<a name="l06533"></a>06533         msg_multiplex = 
-<a name="l06534"></a>06534         cpl_sprintf(<span class="stringliteral">"in the CCD section between %d and %d pixel"</span>, 
-<a name="l06535"></a>06535                     mos_multiplex * mos_region_size, 
-<a name="l06536"></a>06536                     (mos_multiplex + 1) * mos_region_size);
-<a name="l06537"></a>06537     }
-<a name="l06538"></a>06538 
-<a name="l06539"></a>06539     <span class="keywordflow">if</span> (nmaskslits > nslits)
-<a name="l06540"></a>06540         cpl_msg_info(cpl_func,
-<a name="l06541"></a>06541                      <span class="stringliteral">"Finally identified slits: %d out of %d expected %s\n"</span>
-<a name="l06542"></a>06542                      <span class="stringliteral">"(%d recovered)"</span>, nmaskslits, nmaskslits, msg_multiplex,
-<a name="l06543"></a>06543                      nmaskslits - nslits);
-<a name="l06544"></a>06544     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nmaskslits < nslits)
-<a name="l06545"></a>06545         cpl_msg_info(cpl_func,
-<a name="l06546"></a>06546                      <span class="stringliteral">"Finally identified slits: %d out of %d expected %s\n"</span>
-<a name="l06547"></a>06547                      <span class="stringliteral">"(%d rejected)"</span>, nmaskslits, nmaskslits, msg_multiplex,
-<a name="l06548"></a>06548                      nslits - nmaskslits);
-<a name="l06549"></a>06549     <span class="keywordflow">else</span>
-<a name="l06550"></a>06550         cpl_msg_info(cpl_func,
-<a name="l06551"></a>06551                      <span class="stringliteral">"Finally identified slits: %d out of %d expected %s"</span>,
-<a name="l06552"></a>06552                      nmaskslits, nmaskslits, msg_multiplex);
-<a name="l06553"></a>06553 
-<a name="l06554"></a>06554     <span class="keywordflow">if</span> (mos_multiplex >= 0) {
-<a name="l06555"></a>06555         cpl_free(msg_multiplex);
-<a name="l06556"></a>06556     }
-<a name="l06557"></a>06557 
-<a name="l06558"></a>06558     <span class="keywordflow">return</span> positions;
-<a name="l06559"></a>06559 
-<a name="l06560"></a>06560 }
-<a name="l06561"></a>06561 
-<a name="l06562"></a>06562 
-<a name="l06563"></a><a class="code" href="group__moses.html#ge3e3fb9252ccdfacccd0e063d293dc1f">06563</a> cpl_table *<a class="code" href="group__moses.html#ge3e3fb9252ccdfacccd0e063d293dc1f">mos_identify_slits_fast</a>(cpl_table *slits, cpl_table *maskslits,
-<a name="l06564"></a>06564                                    cpl_table *global)
-<a name="l06565"></a>06565 {
-<a name="l06566"></a>06566     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_identify_slits_fast"</span>;
-<a name="l06567"></a>06567 
-<a name="l06568"></a>06568     cpl_propertylist *sort_col;
-<a name="l06569"></a>06569     cpl_table        *positions;
-<a name="l06570"></a>06570     cpl_vector       *scales;
-<a name="l06571"></a>06571     cpl_vector       *angles;
-<a name="l06572"></a>06572     cpl_vector       *point;
-<a name="l06573"></a>06573     cpl_vector       *xpos;
-<a name="l06574"></a>06574     cpl_vector       *ypos;
-<a name="l06575"></a>06575     cpl_vector       *xmpos;
-<a name="l06576"></a>06576     cpl_vector       *ympos;
-<a name="l06577"></a>06577     cpl_bivector     *mpos;
-<a name="l06578"></a>06578     cpl_polynomial   *xpoly = NULL;
-<a name="l06579"></a>06579     cpl_polynomial   *ypoly = NULL;
-<a name="l06580"></a>06580     cpl_error_code    error;
-<a name="l06581"></a>06581     <span class="keywordtype">int</span> nslits;
-<a name="l06582"></a>06582     <span class="keywordtype">int</span> nmaskslits;
-<a name="l06583"></a>06583     <span class="keywordtype">int</span> found_slits;
-<a name="l06584"></a>06584     <span class="keywordtype">int</span> i, j, k;
-<a name="l06585"></a>06585 
-<a name="l06586"></a>06586     <span class="keywordtype">double</span>  dist1, dist2, dist3, dist, mindist;
-<a name="l06587"></a>06587     <span class="keywordtype">double</span>  scale, minscale, maxscale;
-<a name="l06588"></a>06588     <span class="keywordtype">double</span>  angle, minangle, maxangle;
-<a name="l06589"></a>06589     <span class="keywordtype">double</span> *dscale;
-<a name="l06590"></a>06590     <span class="keywordtype">double</span> *dangle;
-<a name="l06591"></a>06591     <span class="keywordtype">double</span> *dpoint;
-<a name="l06592"></a>06592     <span class="keywordtype">double</span> *xtop;
-<a name="l06593"></a>06593     <span class="keywordtype">double</span> *ytop;
-<a name="l06594"></a>06594     <span class="keywordtype">double</span> *xbottom;
-<a name="l06595"></a>06595     <span class="keywordtype">double</span> *ybottom;
-<a name="l06596"></a>06596     <span class="keywordtype">double</span> *xcenter;
-<a name="l06597"></a>06597     <span class="keywordtype">double</span> *ycenter;
-<a name="l06598"></a>06598     <span class="keywordtype">double</span> *xpseudo;
-<a name="l06599"></a>06599     <span class="keywordtype">double</span> *ypseudo;
-<a name="l06600"></a>06600     <span class="keywordtype">int</span>    *slit_id;
-<a name="l06601"></a>06601     <span class="keywordtype">double</span> *xmtop;
-<a name="l06602"></a>06602     <span class="keywordtype">double</span> *ymtop;
-<a name="l06603"></a>06603     <span class="keywordtype">double</span> *xmbottom;
-<a name="l06604"></a>06604     <span class="keywordtype">double</span> *ymbottom;
-<a name="l06605"></a>06605     <span class="keywordtype">double</span> *xmcenter;
-<a name="l06606"></a>06606     <span class="keywordtype">double</span> *ymcenter;
-<a name="l06607"></a>06607     <span class="keywordtype">double</span> *xmpseudo;
-<a name="l06608"></a>06608     <span class="keywordtype">double</span> *ympseudo;
-<a name="l06609"></a>06609     <span class="keywordtype">double</span>  xmse, ymse;
-<a name="l06610"></a>06610     <span class="keywordtype">int</span>    *mslit_id;
-<a name="l06611"></a>06611     <span class="keywordtype">int</span>    *good;
-<a name="l06612"></a>06612     <span class="keywordtype">int</span>     minpos;
-<a name="l06613"></a>06613     <span class="keywordtype">int</span>     degree;
-<a name="l06614"></a>06614 
-<a name="l06615"></a>06615     <span class="keywordtype">double</span>  sradius = 0.01;   <span class="comment">/* Candidate input argument... */</span>
-<a name="l06616"></a>06616     <span class="keywordtype">int</span>     in_sradius;
-<a name="l06617"></a>06617 
-<a name="l06618"></a>06618     <span class="keywordtype">double</span> pi = 3.14159265358979323846;
-<a name="l06619"></a>06619 
-<a name="l06620"></a>06620 
-<a name="l06621"></a>06621     error = <a class="code" href="group__moses.html#g0a1742caa67a002bee7a30f9d5289672">mos_validate_slits</a>(slits);
-<a name="l06622"></a>06622     <span class="keywordflow">if</span> (error) {
-<a name="l06623"></a>06623         cpl_msg_error(func, <span class="stringliteral">"CCD slits table validation: %s"</span>, 
-<a name="l06624"></a>06624                       cpl_error_get_message());
-<a name="l06625"></a>06625         cpl_error_set(func, error);
-<a name="l06626"></a>06626         <span class="keywordflow">return</span> NULL;
-<a name="l06627"></a>06627     }
-<a name="l06628"></a>06628 
-<a name="l06629"></a>06629     error = <a class="code" href="group__moses.html#g0a1742caa67a002bee7a30f9d5289672">mos_validate_slits</a>(maskslits);
-<a name="l06630"></a>06630     <span class="keywordflow">if</span> (error) {
-<a name="l06631"></a>06631         cpl_msg_error(func, <span class="stringliteral">"Mask slits table validation: %s"</span>, 
-<a name="l06632"></a>06632                       cpl_error_get_message());
-<a name="l06633"></a>06633         cpl_error_set(func, error);
-<a name="l06634"></a>06634         <span class="keywordflow">return</span> NULL;
-<a name="l06635"></a>06635     }
-<a name="l06636"></a>06636 
-<a name="l06637"></a>06637     <span class="keywordflow">if</span> (1 != cpl_table_has_column(maskslits, <span class="stringliteral">"slit_id"</span>)) {
-<a name="l06638"></a>06638         cpl_msg_error(func, <span class="stringliteral">"Missing slits identifiers"</span>);
-<a name="l06639"></a>06639         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l06640"></a>06640         <span class="keywordflow">return</span> NULL;
-<a name="l06641"></a>06641     }
-<a name="l06642"></a>06642 
-<a name="l06643"></a>06643     <span class="keywordflow">if</span> (CPL_TYPE_INT != cpl_table_get_column_type(maskslits, <span class="stringliteral">"slit_id"</span>)) {
-<a name="l06644"></a>06644         cpl_msg_error(func, <span class="stringliteral">"Wrong type used for slits identifiers"</span>);
-<a name="l06645"></a>06645         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l06646"></a>06646         <span class="keywordflow">return</span> NULL;
-<a name="l06647"></a>06647     }
-<a name="l06648"></a>06648 
-<a name="l06649"></a>06649     nslits = cpl_table_get_nrow(slits);
-<a name="l06650"></a>06650     nmaskslits = cpl_table_get_nrow(maskslits);
-<a name="l06651"></a>06651 
-<a name="l06652"></a>06652     <span class="keywordflow">if</span> (nslits == 0 || nmaskslits == 0) {
-<a name="l06653"></a>06653         cpl_msg_error(func, <span class="stringliteral">"Empty slits table"</span>);
-<a name="l06654"></a>06654         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l06655"></a>06655         <span class="keywordflow">return</span> NULL;
-<a name="l06656"></a>06656     }
-<a name="l06657"></a>06657 
-<a name="l06658"></a>06658 
-<a name="l06659"></a>06659     <span class="comment">/*</span>
-<a name="l06660"></a>06660 <span class="comment">     * Compute middle point coordinates for each slit listed in both</span>
-<a name="l06661"></a>06661 <span class="comment">     * input tables.</span>
-<a name="l06662"></a>06662 <span class="comment">     */</span>
-<a name="l06663"></a>06663 
-<a name="l06664"></a>06664     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"xcenter"</span>))
-<a name="l06665"></a>06665         cpl_table_erase_column(slits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06666"></a>06666 
-<a name="l06667"></a>06667     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"ycenter"</span>))
-<a name="l06668"></a>06668         cpl_table_erase_column(slits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06669"></a>06669 
-<a name="l06670"></a>06670     <span class="keywordflow">if</span> (cpl_table_has_column(maskslits, <span class="stringliteral">"xcenter"</span>))
-<a name="l06671"></a>06671         cpl_table_erase_column(maskslits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06672"></a>06672 
-<a name="l06673"></a>06673     <span class="keywordflow">if</span> (cpl_table_has_column(maskslits, <span class="stringliteral">"ycenter"</span>))
-<a name="l06674"></a>06674         cpl_table_erase_column(maskslits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06675"></a>06675 
-<a name="l06676"></a>06676     cpl_table_duplicate_column(slits, <span class="stringliteral">"xcenter"</span>, slits, <span class="stringliteral">"xtop"</span>);
-<a name="l06677"></a>06677     cpl_table_add_columns(slits, <span class="stringliteral">"xcenter"</span>, <span class="stringliteral">"xbottom"</span>);
-<a name="l06678"></a>06678     cpl_table_divide_scalar(slits, <span class="stringliteral">"xcenter"</span>, 2.0);
-<a name="l06679"></a>06679     cpl_table_duplicate_column(slits, <span class="stringliteral">"ycenter"</span>, slits, <span class="stringliteral">"ytop"</span>);
-<a name="l06680"></a>06680     cpl_table_add_columns(slits, <span class="stringliteral">"ycenter"</span>, <span class="stringliteral">"ybottom"</span>);
-<a name="l06681"></a>06681     cpl_table_divide_scalar(slits, <span class="stringliteral">"ycenter"</span>, 2.0);
-<a name="l06682"></a>06682 
-<a name="l06683"></a>06683     cpl_table_duplicate_column(maskslits, <span class="stringliteral">"xcenter"</span>, maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l06684"></a>06684     cpl_table_add_columns(maskslits, <span class="stringliteral">"xcenter"</span>, <span class="stringliteral">"xbottom"</span>);
-<a name="l06685"></a>06685     cpl_table_divide_scalar(maskslits, <span class="stringliteral">"xcenter"</span>, 2.0);
-<a name="l06686"></a>06686     cpl_table_duplicate_column(maskslits, <span class="stringliteral">"ycenter"</span>, maskslits, <span class="stringliteral">"ytop"</span>);
-<a name="l06687"></a>06687     cpl_table_add_columns(maskslits, <span class="stringliteral">"ycenter"</span>, <span class="stringliteral">"ybottom"</span>);
-<a name="l06688"></a>06688     cpl_table_divide_scalar(maskslits, <span class="stringliteral">"ycenter"</span>, 2.0);
-<a name="l06689"></a>06689 
-<a name="l06690"></a>06690 
-<a name="l06691"></a>06691     <span class="comment">/*</span>
-<a name="l06692"></a>06692 <span class="comment">     * Guarantee that both input tables are sorted in the same way</span>
-<a name="l06693"></a>06693 <span class="comment">     */</span>
-<a name="l06694"></a>06694 
-<a name="l06695"></a>06695     sort_col = cpl_propertylist_new();
-<a name="l06696"></a>06696     cpl_propertylist_append_bool(sort_col, <span class="stringliteral">"ycenter"</span>, 1);
-<a name="l06697"></a>06697     cpl_table_sort(slits, sort_col);
-<a name="l06698"></a>06698     cpl_table_sort(maskslits, sort_col);
-<a name="l06699"></a>06699     cpl_propertylist_delete(sort_col);
-<a name="l06700"></a>06700 
-<a name="l06701"></a>06701 
-<a name="l06702"></a>06702     <span class="comment">/*</span>
-<a name="l06703"></a>06703 <span class="comment">     * First we handle all the special cases (too few slits...)</span>
-<a name="l06704"></a>06704 <span class="comment">     */</span>
-<a name="l06705"></a>06705 
-<a name="l06706"></a>06706     <span class="keywordflow">if</span> (nslits < 3 && nmaskslits > nslits) {
-<a name="l06707"></a>06707 
-<a name="l06708"></a>06708         <span class="comment">/*</span>
-<a name="l06709"></a>06709 <span class="comment">         * If there are just 1 or 2 slits on the CCD, and more on the</span>
-<a name="l06710"></a>06710 <span class="comment">         * mask, the ambiguity cannot be solved, and an error is returned.</span>
-<a name="l06711"></a>06711 <span class="comment">         * This is a case that must be solved with a first-guess relation</span>
-<a name="l06712"></a>06712 <span class="comment">         * between mask and CCD.</span>
-<a name="l06713"></a>06713 <span class="comment">         */</span>
-<a name="l06714"></a>06714 
-<a name="l06715"></a>06715         <span class="keywordflow">if</span> (nslits > 1)
-<a name="l06716"></a>06716             cpl_msg_warning(func, <span class="stringliteral">"Cannot match the found CCD slit with the "</span>
-<a name="l06717"></a>06717                             <span class="stringliteral">"%d mask slits: process will continue using the "</span>
-<a name="l06718"></a>06718                             <span class="stringliteral">"detected CCD slit position"</span>, nmaskslits);
-<a name="l06719"></a>06719         <span class="keywordflow">else</span>
-<a name="l06720"></a>06720             cpl_msg_warning(func, <span class="stringliteral">"Cannot match the %d found CCD slits with "</span>
-<a name="l06721"></a>06721                             <span class="stringliteral">"the %d mask slits: process will continue using "</span>
-<a name="l06722"></a>06722                             <span class="stringliteral">"the detected CCD slits positions"</span>, nslits, 
-<a name="l06723"></a>06723                             nmaskslits);
-<a name="l06724"></a>06724         <span class="keywordflow">return</span> NULL;
-<a name="l06725"></a>06725     }
-<a name="l06726"></a>06726 
-<a name="l06727"></a>06727     <span class="keywordflow">if</span> (nslits <= 3 && nslits == nmaskslits) {
-<a name="l06728"></a>06728 
-<a name="l06729"></a>06729         cpl_msg_warning(func, <span class="stringliteral">"Too few slits (%d) on mask and CCD"</span>, nslits);
-<a name="l06730"></a>06730         cpl_msg_warning(func, <span class="stringliteral">"Their detected positions are left unchanged"</span>);
-<a name="l06731"></a>06731 
-<a name="l06732"></a>06732         <span class="comment">/*</span>
-<a name="l06733"></a>06733 <span class="comment">         * If there are just up to 3 slits, both on the mask and on the CCD,</span>
-<a name="l06734"></a>06734 <span class="comment">         * we can reasonably hope that those slits were found, and accept </span>
-<a name="l06735"></a>06735 <span class="comment">         * that their positions on the CCD cannot be improved. We prepare</span>
-<a name="l06736"></a>06736 <span class="comment">         * therefore an output position table containing the slits with</span>
-<a name="l06737"></a>06737 <span class="comment">         * their original positions. We can however give an estimate of</span>
-<a name="l06738"></a>06738 <span class="comment">         * the platescale if there is more than one slit.</span>
-<a name="l06739"></a>06739 <span class="comment">         */</span>
-<a name="l06740"></a>06740 
-<a name="l06741"></a>06741         positions = cpl_table_duplicate(slits);
-<a name="l06742"></a>06742         cpl_table_erase_column(slits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06743"></a>06743         cpl_table_erase_column(slits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06744"></a>06744         cpl_table_duplicate_column(positions, <span class="stringliteral">"xmtop"</span>, maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l06745"></a>06745         cpl_table_duplicate_column(positions, <span class="stringliteral">"ymtop"</span>, maskslits, <span class="stringliteral">"ytop"</span>);
-<a name="l06746"></a>06746         cpl_table_duplicate_column(positions, <span class="stringliteral">"xmbottom"</span>, maskslits, <span class="stringliteral">"xbottom"</span>);
-<a name="l06747"></a>06747         cpl_table_duplicate_column(positions, <span class="stringliteral">"ymbottom"</span>, maskslits, <span class="stringliteral">"ybottom"</span>);
-<a name="l06748"></a>06748         cpl_table_duplicate_column(positions, <span class="stringliteral">"xmcenter"</span>, maskslits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06749"></a>06749         cpl_table_duplicate_column(positions, <span class="stringliteral">"ymcenter"</span>, maskslits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06750"></a>06750         cpl_table_duplicate_column(positions, <span class="stringliteral">"slit_id"</span>, maskslits, <span class="stringliteral">"slit_id"</span>);
-<a name="l06751"></a>06751         cpl_table_erase_column(maskslits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06752"></a>06752         cpl_table_erase_column(maskslits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06753"></a>06753 
-<a name="l06754"></a>06754         <span class="keywordflow">if</span> (nslits > 1) {
-<a name="l06755"></a>06755             xcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"xcenter"</span>);
-<a name="l06756"></a>06756             ycenter = cpl_table_get_data_double(positions, <span class="stringliteral">"ycenter"</span>);
-<a name="l06757"></a>06757             xmcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"xmcenter"</span>);
-<a name="l06758"></a>06758             ymcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"ymcenter"</span>);
-<a name="l06759"></a>06759 
-<a name="l06760"></a>06760             dist1 = (xcenter[0] - xcenter[1])*(xcenter[0] - xcenter[1])
-<a name="l06761"></a>06761                   + (ycenter[0] - ycenter[1])*(ycenter[0] - ycenter[1]);
-<a name="l06762"></a>06762             dist2 = (xmcenter[0] - xmcenter[1])*(xmcenter[0] - xmcenter[1])
-<a name="l06763"></a>06763                   + (ymcenter[0] - ymcenter[1])*(ymcenter[0] - ymcenter[1]);
-<a name="l06764"></a>06764             scale = sqrt(dist1/dist2);
-<a name="l06765"></a>06765 
-<a name="l06766"></a>06766             <span class="keywordflow">if</span> (nslits == 3) {
-<a name="l06767"></a>06767                 dist1 = (xcenter[1] - xcenter[2])*(xcenter[1] - xcenter[2])
-<a name="l06768"></a>06768                       + (ycenter[1] - ycenter[2])*(ycenter[1] - ycenter[2]);
-<a name="l06769"></a>06769                 dist2 = (xmcenter[1] - xmcenter[2])*(xmcenter[1] - xmcenter[2])
-<a name="l06770"></a>06770                       + (ymcenter[1] - ymcenter[2])*(ymcenter[1] - ymcenter[2]);
-<a name="l06771"></a>06771                 scale += sqrt(dist1/dist2);
-<a name="l06772"></a>06772                 scale /= 2;
-<a name="l06773"></a>06773             }
-<a name="l06774"></a>06774 
-<a name="l06775"></a>06775             cpl_msg_info(func, <span class="stringliteral">"Platescale: %f pixel/mm"</span>, scale);
-<a name="l06776"></a>06776         }
-<a name="l06777"></a>06777 
-<a name="l06778"></a>06778         <span class="keywordflow">return</span> positions;
-<a name="l06779"></a>06779     }
-<a name="l06780"></a>06780 
-<a name="l06781"></a>06781     <span class="keywordflow">if</span> (nmaskslits < 3 && nslits > nmaskslits) {
-<a name="l06782"></a>06782 
-<a name="l06783"></a>06783         <span class="comment">/*</span>
-<a name="l06784"></a>06784 <span class="comment">         * If there are less than 3 slits on the mask the ambiguity cannot </span>
-<a name="l06785"></a>06785 <span class="comment">         * be solved, and an error is returned. This is a case that must </span>
-<a name="l06786"></a>06786 <span class="comment">         * be solved with a first-guess relation between mask and CCD.</span>
-<a name="l06787"></a>06787 <span class="comment">         */</span>
-<a name="l06788"></a>06788 
-<a name="l06789"></a>06789         cpl_msg_warning(func, <span class="stringliteral">"Cannot match the %d found CCD slits with "</span>
-<a name="l06790"></a>06790                         <span class="stringliteral">"the %d mask slits: process will continue using "</span>
-<a name="l06791"></a>06791                         <span class="stringliteral">"the detected CCD slits positions"</span>, nslits, 
-<a name="l06792"></a>06792                         nmaskslits);
-<a name="l06793"></a>06793         <span class="keywordflow">return</span> NULL;
-<a name="l06794"></a>06794     }
-<a name="l06795"></a>06795 
-<a name="l06796"></a>06796 
-<a name="l06797"></a>06797     <span class="comment">/*</span>
-<a name="l06798"></a>06798 <span class="comment">     * At this point of the program all the region of the plane</span>
-<a name="l06799"></a>06799 <span class="comment">     * (nslits, nmaskslits) where either or both mask and CCD display</span>
-<a name="l06800"></a>06800 <span class="comment">     * less than 3 slits are handled in some way. It would be better</span>
-<a name="l06801"></a>06801 <span class="comment">     * to add in this place a special handling for identifying slits</span>
-<a name="l06802"></a>06802 <span class="comment">     * in case of a very reduced number of slits (say, below 6).</span>
-<a name="l06803"></a>06803 <span class="comment">     * It is also clear that if there are many more slits on the</span>
-<a name="l06804"></a>06804 <span class="comment">     * mask than on the CCD, or many more on the CCD than on the</span>
-<a name="l06805"></a>06805 <span class="comment">     * mask, something went deeply wrong with the preliminary </span>
-<a name="l06806"></a>06806 <span class="comment">     * wavelength calibration. Such cases should be handled with</span>
-<a name="l06807"></a>06807 <span class="comment">     * a _complete_ pattern-recognition algorithm based on the</span>
-<a name="l06808"></a>06808 <span class="comment">     * construction of all possible triangles. For the moment, </span>
-<a name="l06809"></a>06809 <span class="comment">     * we go directly to the limited pattern-recognition applied</span>
-<a name="l06810"></a>06810 <span class="comment">     * below, based on triangles build only for consecutive slits.</span>
-<a name="l06811"></a>06811 <span class="comment">     * This is reasonably safe, since the preliminary wavelength</span>
-<a name="l06812"></a>06812 <span class="comment">     * calibration performed by mos_identify_peaks() is generally</span>
-<a name="l06813"></a>06813 <span class="comment">     * robust.</span>
-<a name="l06814"></a>06814 <span class="comment">     */</span>
-<a name="l06815"></a>06815 
-<a name="l06816"></a>06816 
-<a name="l06817"></a>06817     <span class="comment">/*</span>
-<a name="l06818"></a>06818 <span class="comment">     * Compute (X, Y) coordinates on pseudo-plane describing the</span>
-<a name="l06819"></a>06819 <span class="comment">     * different position ratios of successive slits, in both</span>
-<a name="l06820"></a>06820 <span class="comment">     * input tables.</span>
-<a name="l06821"></a>06821 <span class="comment">     */</span>
-<a name="l06822"></a>06822 
-<a name="l06823"></a>06823     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"xpseudo"</span>))
-<a name="l06824"></a>06824         cpl_table_erase_column(slits, <span class="stringliteral">"xpseudo"</span>);
-<a name="l06825"></a>06825 
-<a name="l06826"></a>06826     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"ypseudo"</span>))
-<a name="l06827"></a>06827         cpl_table_erase_column(slits, <span class="stringliteral">"ypseudo"</span>);
-<a name="l06828"></a>06828 
-<a name="l06829"></a>06829     <span class="keywordflow">if</span> (cpl_table_has_column(maskslits, <span class="stringliteral">"xpseudo"</span>))
-<a name="l06830"></a>06830         cpl_table_erase_column(maskslits, <span class="stringliteral">"xpseudo"</span>);
-<a name="l06831"></a>06831 
-<a name="l06832"></a>06832     <span class="keywordflow">if</span> (cpl_table_has_column(maskslits, <span class="stringliteral">"ypseudo"</span>))
-<a name="l06833"></a>06833         cpl_table_erase_column(maskslits, <span class="stringliteral">"ypseudo"</span>);
-<a name="l06834"></a>06834 
-<a name="l06835"></a>06835     cpl_table_duplicate_column(slits, <span class="stringliteral">"xpseudo"</span>, slits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06836"></a>06836     cpl_table_duplicate_column(slits, <span class="stringliteral">"ypseudo"</span>, slits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06837"></a>06837 
-<a name="l06838"></a>06838     xcenter = cpl_table_get_data_double(slits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06839"></a>06839     ycenter = cpl_table_get_data_double(slits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06840"></a>06840     xpseudo = cpl_table_get_data_double(slits, <span class="stringliteral">"xpseudo"</span>);
-<a name="l06841"></a>06841     ypseudo = cpl_table_get_data_double(slits, <span class="stringliteral">"ypseudo"</span>);
-<a name="l06842"></a>06842 
-<a name="l06843"></a>06843     <span class="keywordflow">for</span> (i = 1; i < nslits - 1; i++) {
-<a name="l06844"></a>06844         dist1 = (xcenter[i-1] - xcenter[i]) * (xcenter[i-1] - xcenter[i])
-<a name="l06845"></a>06845               + (ycenter[i-1] - ycenter[i]) * (ycenter[i-1] - ycenter[i]);
-<a name="l06846"></a>06846         dist2 = (xcenter[i-1] - xcenter[i+1]) * (xcenter[i-1] - xcenter[i+1])
-<a name="l06847"></a>06847               + (ycenter[i-1] - ycenter[i+1]) * (ycenter[i-1] - ycenter[i+1]);
-<a name="l06848"></a>06848         dist3 = (xcenter[i] - xcenter[i+1]) * (xcenter[i] - xcenter[i+1])
-<a name="l06849"></a>06849               + (ycenter[i] - ycenter[i+1]) * (ycenter[i] - ycenter[i+1]);
-<a name="l06850"></a>06850         xpseudo[i] = sqrt(dist1/dist2);
-<a name="l06851"></a>06851         ypseudo[i] = sqrt(dist3/dist2);
-<a name="l06852"></a>06852     }
-<a name="l06853"></a>06853 
-<a name="l06854"></a>06854     cpl_table_set_invalid(slits, <span class="stringliteral">"xpseudo"</span>, 0);
-<a name="l06855"></a>06855     cpl_table_set_invalid(slits, <span class="stringliteral">"xpseudo"</span>, nslits-1);
-<a name="l06856"></a>06856     cpl_table_set_invalid(slits, <span class="stringliteral">"ypseudo"</span>, 0);
-<a name="l06857"></a>06857     cpl_table_set_invalid(slits, <span class="stringliteral">"ypseudo"</span>, nslits-1);
-<a name="l06858"></a>06858 
-<a name="l06859"></a>06859     cpl_table_duplicate_column(maskslits, <span class="stringliteral">"xpseudo"</span>, maskslits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06860"></a>06860     cpl_table_duplicate_column(maskslits, <span class="stringliteral">"ypseudo"</span>, maskslits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06861"></a>06861 
-<a name="l06862"></a>06862     xcenter = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06863"></a>06863     ycenter = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06864"></a>06864     xmpseudo = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xpseudo"</span>);
-<a name="l06865"></a>06865     ympseudo = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ypseudo"</span>);
-<a name="l06866"></a>06866 
-<a name="l06867"></a>06867     <span class="keywordflow">for</span> (i = 1; i < nmaskslits - 1; i++) {
-<a name="l06868"></a>06868         dist1 = (xcenter[i-1] - xcenter[i])*(xcenter[i-1] - xcenter[i])
-<a name="l06869"></a>06869               + (ycenter[i-1] - ycenter[i])*(ycenter[i-1] - ycenter[i]);
-<a name="l06870"></a>06870         dist2 = (xcenter[i-1] - xcenter[i+1])*(xcenter[i-1] - xcenter[i+1])
-<a name="l06871"></a>06871               + (ycenter[i-1] - ycenter[i+1])*(ycenter[i-1] - ycenter[i+1]);
-<a name="l06872"></a>06872         dist3 = (xcenter[i] - xcenter[i+1])*(xcenter[i] - xcenter[i+1])
-<a name="l06873"></a>06873               + (ycenter[i] - ycenter[i+1])*(ycenter[i] - ycenter[i+1]);
-<a name="l06874"></a>06874         xmpseudo[i] = sqrt(dist1/dist2);
-<a name="l06875"></a>06875         ympseudo[i] = sqrt(dist3/dist2);
-<a name="l06876"></a>06876     }
-<a name="l06877"></a>06877     
-<a name="l06878"></a>06878     cpl_table_set_invalid(maskslits, <span class="stringliteral">"xpseudo"</span>, 0);
-<a name="l06879"></a>06879     cpl_table_set_invalid(maskslits, <span class="stringliteral">"xpseudo"</span>, nmaskslits-1);
-<a name="l06880"></a>06880     cpl_table_set_invalid(maskslits, <span class="stringliteral">"ypseudo"</span>, 0);
-<a name="l06881"></a>06881     cpl_table_set_invalid(maskslits, <span class="stringliteral">"ypseudo"</span>, nmaskslits-1);
-<a name="l06882"></a>06882 
-<a name="l06883"></a>06883 
-<a name="l06884"></a>06884     <span class="comment">/*</span>
-<a name="l06885"></a>06885 <span class="comment">     * For each (X, Y) on the pseudo-plane related to the mask positions,</span>
-<a name="l06886"></a>06886 <span class="comment">     * find the closest (X, Y) on the pseudo-plane related to the CCD</span>
-<a name="l06887"></a>06887 <span class="comment">     * positions. If the closest point is closer than a given search</span>
-<a name="l06888"></a>06888 <span class="comment">     * radius, a triangle has been found, and 3 slits are identified.</span>
-<a name="l06889"></a>06889 <span class="comment">     * However, if more than one point is found within the search</span>
-<a name="l06890"></a>06890 <span class="comment">     * radius, we have an ambiguity and this is rejected.</span>
-<a name="l06891"></a>06891 <span class="comment">     */</span>
-<a name="l06892"></a>06892 
-<a name="l06893"></a>06893     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"slit_id"</span>))
-<a name="l06894"></a>06894         cpl_table_erase_column(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l06895"></a>06895     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l06896"></a>06896     slit_id = cpl_table_get_data_int(maskslits, <span class="stringliteral">"slit_id"</span>);
-<a name="l06897"></a>06897 
-<a name="l06898"></a>06898     <span class="keywordflow">for</span> (i = 1; i < nmaskslits - 1; i++) {
-<a name="l06899"></a>06899         in_sradius = 0;
-<a name="l06900"></a>06900         mindist = (xmpseudo[i] - xpseudo[1]) * (xmpseudo[i] - xpseudo[1])
-<a name="l06901"></a>06901                 + (ympseudo[i] - ypseudo[1]) * (ympseudo[i] - ypseudo[1]);
-<a name="l06902"></a>06902         minpos = 1;
-<a name="l06903"></a>06903         <span class="keywordflow">if</span> (mindist < sradius*sradius)
-<a name="l06904"></a>06904             in_sradius++;
-<a name="l06905"></a>06905         <span class="keywordflow">for</span> (j = 2; j < nslits - 1; j++) {
-<a name="l06906"></a>06906             dist = (xmpseudo[i] - xpseudo[j]) * (xmpseudo[i] - xpseudo[j])
-<a name="l06907"></a>06907                  + (ympseudo[i] - ypseudo[j]) * (ympseudo[i] - ypseudo[j]);
-<a name="l06908"></a>06908             <span class="keywordflow">if</span> (dist < sradius*sradius)
-<a name="l06909"></a>06909                 in_sradius++;
-<a name="l06910"></a>06910             <span class="keywordflow">if</span> (in_sradius > 1)    <span class="comment">/* More than one triangle within radius */</span>
-<a name="l06911"></a>06911                 <span class="keywordflow">break</span>;
-<a name="l06912"></a>06912             <span class="keywordflow">if</span> (mindist > dist) {
-<a name="l06913"></a>06913                 mindist = dist;
-<a name="l06914"></a>06914                 minpos = j;
-<a name="l06915"></a>06915             }
-<a name="l06916"></a>06916         }
-<a name="l06917"></a>06917 
-<a name="l06918"></a>06918         mindist = sqrt(mindist);
-<a name="l06919"></a>06919 
-<a name="l06920"></a>06920         <span class="keywordflow">if</span> (mindist < sradius && in_sradius == 1) {
-<a name="l06921"></a>06921             cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, minpos-1, slit_id[i-1]);
-<a name="l06922"></a>06922             cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, minpos, slit_id[i]);
-<a name="l06923"></a>06923             cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, minpos+1, slit_id[i+1]);
-<a name="l06924"></a>06924         }
-<a name="l06925"></a>06925     }
-<a name="l06926"></a>06926 
-<a name="l06927"></a>06927 
-<a name="l06928"></a>06928     <span class="comment">/*</span>
-<a name="l06929"></a>06929 <span class="comment">     * At this point, the slit_id column contains invalid elements </span>
-<a name="l06930"></a>06930 <span class="comment">     * corresponding to unidentified slits.</span>
-<a name="l06931"></a>06931 <span class="comment">     */</span>
-<a name="l06932"></a>06932 
-<a name="l06933"></a>06933     found_slits = nslits - cpl_table_count_invalid(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l06934"></a>06934 
-<a name="l06935"></a>06935     <span class="keywordflow">if</span> (found_slits < 3) {
-<a name="l06936"></a>06936         cpl_msg_warning(func, <span class="stringliteral">"Too few preliminarily identified slits: "</span>
-<a name="l06937"></a>06937                         <span class="stringliteral">"%d out of %d"</span>, found_slits, nslits);
-<a name="l06938"></a>06938         <span class="keywordflow">if</span> (nslits == nmaskslits) {
-<a name="l06939"></a>06939             cpl_msg_warning(func, <span class="stringliteral">"(this is not an error, it could be caused "</span>
-<a name="l06940"></a>06940                             <span class="stringliteral">"by a mask with regularly located slits)"</span>);
-<a name="l06941"></a>06941             cpl_msg_warning(func, <span class="stringliteral">"The detected slits positions are left "</span>
-<a name="l06942"></a>06942                             <span class="stringliteral">"unchanged"</span>);
-<a name="l06943"></a>06943 
-<a name="l06944"></a>06944             <span class="comment">/*</span>
-<a name="l06945"></a>06945 <span class="comment">             * If there are less than 3 identified slits, this is probably </span>
-<a name="l06946"></a>06946 <span class="comment">             * a mask with regularly spaced slits (leading to an ambiguous</span>
-<a name="l06947"></a>06947 <span class="comment">             * pattern). Only in the case all expected slits appear to have </span>
-<a name="l06948"></a>06948 <span class="comment">             * been found on the CCD we can proceed...</span>
-<a name="l06949"></a>06949 <span class="comment">             */</span>
-<a name="l06950"></a>06950 
-<a name="l06951"></a>06951             cpl_table_erase_column(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l06952"></a>06952             cpl_table_erase_column(slits, <span class="stringliteral">"xpseudo"</span>);
-<a name="l06953"></a>06953             cpl_table_erase_column(slits, <span class="stringliteral">"ypseudo"</span>);
-<a name="l06954"></a>06954             positions = cpl_table_duplicate(slits);
-<a name="l06955"></a>06955             cpl_table_erase_column(slits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06956"></a>06956             cpl_table_erase_column(slits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06957"></a>06957 
-<a name="l06958"></a>06958             cpl_table_erase_column(maskslits, <span class="stringliteral">"xpseudo"</span>);
-<a name="l06959"></a>06959             cpl_table_erase_column(maskslits, <span class="stringliteral">"ypseudo"</span>);
-<a name="l06960"></a>06960             cpl_table_duplicate_column(positions, <span class="stringliteral">"xmtop"</span>, 
-<a name="l06961"></a>06961                                        maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l06962"></a>06962             cpl_table_duplicate_column(positions, <span class="stringliteral">"ymtop"</span>, 
-<a name="l06963"></a>06963                                        maskslits, <span class="stringliteral">"ytop"</span>);
-<a name="l06964"></a>06964             cpl_table_duplicate_column(positions, <span class="stringliteral">"xmbottom"</span>, 
-<a name="l06965"></a>06965                                        maskslits, <span class="stringliteral">"xbottom"</span>);
-<a name="l06966"></a>06966             cpl_table_duplicate_column(positions, <span class="stringliteral">"ymbottom"</span>, 
-<a name="l06967"></a>06967                                        maskslits, <span class="stringliteral">"ybottom"</span>);
-<a name="l06968"></a>06968             cpl_table_duplicate_column(positions, <span class="stringliteral">"xmcenter"</span>, 
-<a name="l06969"></a>06969                                        maskslits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06970"></a>06970             cpl_table_duplicate_column(positions, <span class="stringliteral">"ymcenter"</span>, 
-<a name="l06971"></a>06971                                        maskslits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06972"></a>06972             cpl_table_duplicate_column(positions, <span class="stringliteral">"slit_id"</span>, 
-<a name="l06973"></a>06973                                        maskslits, <span class="stringliteral">"slit_id"</span>);
-<a name="l06974"></a>06974             cpl_table_erase_column(maskslits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06975"></a>06975             cpl_table_erase_column(maskslits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06976"></a>06976             <span class="keywordflow">return</span> positions;
-<a name="l06977"></a>06977         }
-<a name="l06978"></a>06978         <span class="keywordflow">else</span> {
-<a name="l06979"></a>06979             cpl_table_erase_column(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l06980"></a>06980             cpl_table_erase_column(slits, <span class="stringliteral">"xpseudo"</span>);
-<a name="l06981"></a>06981             cpl_table_erase_column(slits, <span class="stringliteral">"ypseudo"</span>);
-<a name="l06982"></a>06982             positions = cpl_table_duplicate(slits);
-<a name="l06983"></a>06983             cpl_table_erase_column(slits, <span class="stringliteral">"xcenter"</span>);
-<a name="l06984"></a>06984             cpl_table_erase_column(slits, <span class="stringliteral">"ycenter"</span>);
-<a name="l06985"></a>06985             cpl_msg_warning(func, <span class="stringliteral">"(the failure could be caused "</span>
-<a name="l06986"></a>06986                             <span class="stringliteral">"by a mask with regularly located slits)"</span>);
-<a name="l06987"></a>06987             <span class="keywordflow">return</span> NULL;
-<a name="l06988"></a>06988         }
-<a name="l06989"></a>06989     }
-<a name="l06990"></a>06990     <span class="keywordflow">else</span> {
-<a name="l06991"></a>06991         cpl_msg_info(func, <span class="stringliteral">"Preliminarily identified slits: %d out of %d "</span>
-<a name="l06992"></a>06992                      <span class="stringliteral">"candidates (%d expected)"</span>, found_slits, nslits, 
-<a name="l06993"></a>06993                      nmaskslits);
-<a name="l06994"></a>06994     }
-<a name="l06995"></a>06995 
-<a name="l06996"></a>06996 
-<a name="l06997"></a>06997     <span class="comment">/*</span>
-<a name="l06998"></a>06998 <span class="comment">     * Create a table with the coordinates of the preliminarily identified </span>
-<a name="l06999"></a>06999 <span class="comment">     * slits, both on CCD and mask. The original order of the slits positions </span>
-<a name="l07000"></a>07000 <span class="comment">     * is preserved.</span>
-<a name="l07001"></a>07001 <span class="comment">     */</span>
-<a name="l07002"></a>07002 
-<a name="l07003"></a>07003     positions = cpl_table_new(found_slits);
-<a name="l07004"></a>07004     cpl_table_new_column(positions, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l07005"></a>07005     cpl_table_new_column(positions, <span class="stringliteral">"xtop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l07006"></a>07006     cpl_table_new_column(positions, <span class="stringliteral">"ytop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l07007"></a>07007     cpl_table_new_column(positions, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l07008"></a>07008     cpl_table_new_column(positions, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l07009"></a>07009     cpl_table_new_column(positions, <span class="stringliteral">"xcenter"</span>, CPL_TYPE_DOUBLE);
-<a name="l07010"></a>07010     cpl_table_new_column(positions, <span class="stringliteral">"ycenter"</span>, CPL_TYPE_DOUBLE);
-<a name="l07011"></a>07011     cpl_table_new_column(positions, <span class="stringliteral">"xmtop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l07012"></a>07012     cpl_table_new_column(positions, <span class="stringliteral">"ymtop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l07013"></a>07013     cpl_table_new_column(positions, <span class="stringliteral">"xmbottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l07014"></a>07014     cpl_table_new_column(positions, <span class="stringliteral">"ymbottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l07015"></a>07015     cpl_table_new_column(positions, <span class="stringliteral">"xmcenter"</span>, CPL_TYPE_DOUBLE);
-<a name="l07016"></a>07016     cpl_table_new_column(positions, <span class="stringliteral">"ymcenter"</span>, CPL_TYPE_DOUBLE);
-<a name="l07017"></a>07017     cpl_table_new_column(positions, <span class="stringliteral">"good"</span>, CPL_TYPE_INT);
-<a name="l07018"></a>07018     cpl_table_fill_column_window_int(positions, <span class="stringliteral">"good"</span>, 0, found_slits, 0);
-<a name="l07019"></a>07019 
-<a name="l07020"></a>07020     slit_id = cpl_table_get_data_int   (slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l07021"></a>07021     xtop    = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);
-<a name="l07022"></a>07022     ytop    = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);
-<a name="l07023"></a>07023     xbottom = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);
-<a name="l07024"></a>07024     ybottom = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);
-<a name="l07025"></a>07025     xcenter = cpl_table_get_data_double(slits, <span class="stringliteral">"xcenter"</span>);
-<a name="l07026"></a>07026     ycenter = cpl_table_get_data_double(slits, <span class="stringliteral">"ycenter"</span>);
-<a name="l07027"></a>07027 
-<a name="l07028"></a>07028     mslit_id = cpl_table_get_data_int   (maskslits, <span class="stringliteral">"slit_id"</span>);
-<a name="l07029"></a>07029     xmtop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l07030"></a>07030     ymtop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);
-<a name="l07031"></a>07031     xmbottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xbottom"</span>);
-<a name="l07032"></a>07032     ymbottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ybottom"</span>);
-<a name="l07033"></a>07033     xmcenter = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xcenter"</span>);
-<a name="l07034"></a>07034     ymcenter = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ycenter"</span>);
-<a name="l07035"></a>07035 
-<a name="l07036"></a>07036 
-<a name="l07037"></a>07037     <span class="comment">/*</span>
-<a name="l07038"></a>07038 <span class="comment">     * Transferring the valid slits information to the new table.</span>
-<a name="l07039"></a>07039 <span class="comment">     * Note that invalid elements are coded as 0 in the internal</span>
-<a name="l07040"></a>07040 <span class="comment">     * buffer, and this is the way they are recognised and excluded.</span>
-<a name="l07041"></a>07041 <span class="comment">     */</span>
-<a name="l07042"></a>07042 
-<a name="l07043"></a>07043     k = 0;
-<a name="l07044"></a>07044     cpl_table_fill_invalid_int(slits, <span class="stringliteral">"slit_id"</span>, 0);
-<a name="l07045"></a>07045     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++) {
-<a name="l07046"></a>07046         <span class="keywordflow">for</span> (j = 0; j < nslits; j++) {
-<a name="l07047"></a>07047             <span class="keywordflow">if</span> (slit_id[j] == 0)
-<a name="l07048"></a>07048                 <span class="keywordflow">continue</span>; <span class="comment">/* Skip invalid slit */</span>
-<a name="l07049"></a>07049             <span class="keywordflow">if</span> (mslit_id[i] == slit_id[j]) {
-<a name="l07050"></a>07050                 cpl_table_set_int   (positions, <span class="stringliteral">"slit_id"</span>,  k, slit_id[j]);
-<a name="l07051"></a>07051 
-<a name="l07052"></a>07052                 cpl_table_set_double(positions, <span class="stringliteral">"xtop"</span>,     k, xtop[j]);
-<a name="l07053"></a>07053                 cpl_table_set_double(positions, <span class="stringliteral">"ytop"</span>,     k, ytop[j]);
-<a name="l07054"></a>07054                 cpl_table_set_double(positions, <span class="stringliteral">"xbottom"</span>,  k, xbottom[j]);
-<a name="l07055"></a>07055                 cpl_table_set_double(positions, <span class="stringliteral">"ybottom"</span>,  k, ybottom[j]);
-<a name="l07056"></a>07056                 cpl_table_set_double(positions, <span class="stringliteral">"xcenter"</span>,  k, xcenter[j]);
-<a name="l07057"></a>07057                 cpl_table_set_double(positions, <span class="stringliteral">"ycenter"</span>,  k, ycenter[j]);
-<a name="l07058"></a>07058 
-<a name="l07059"></a>07059                 cpl_table_set_double(positions, <span class="stringliteral">"xmtop"</span>,    k, xmtop[i]);
-<a name="l07060"></a>07060                 cpl_table_set_double(positions, <span class="stringliteral">"ymtop"</span>,    k, ymtop[i]);
-<a name="l07061"></a>07061                 cpl_table_set_double(positions, <span class="stringliteral">"xmbottom"</span>, k, xmbottom[i]);
-<a name="l07062"></a>07062                 cpl_table_set_double(positions, <span class="stringliteral">"ymbottom"</span>, k, ymbottom[i]);
-<a name="l07063"></a>07063                 cpl_table_set_double(positions, <span class="stringliteral">"xmcenter"</span>, k, xmcenter[i]);
-<a name="l07064"></a>07064                 cpl_table_set_double(positions, <span class="stringliteral">"ymcenter"</span>, k, ymcenter[i]);
-<a name="l07065"></a>07065 
-<a name="l07066"></a>07066                 k++;
-<a name="l07067"></a>07067 
-<a name="l07068"></a>07068                 <span class="keywordflow">break</span>;
-<a name="l07069"></a>07069             }
-<a name="l07070"></a>07070         }
-<a name="l07071"></a>07071     }
-<a name="l07072"></a>07072 
-<a name="l07073"></a>07073     found_slits = k;
-<a name="l07074"></a>07074 
-<a name="l07075"></a>07075     cpl_table_erase_column(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l07076"></a>07076     cpl_table_erase_column(slits, <span class="stringliteral">"xpseudo"</span>);
-<a name="l07077"></a>07077     cpl_table_erase_column(slits, <span class="stringliteral">"ypseudo"</span>);
-<a name="l07078"></a>07078     cpl_table_erase_column(slits, <span class="stringliteral">"xcenter"</span>);
-<a name="l07079"></a>07079     cpl_table_erase_column(slits, <span class="stringliteral">"ycenter"</span>);
-<a name="l07080"></a>07080     cpl_table_erase_column(maskslits, <span class="stringliteral">"xpseudo"</span>);
-<a name="l07081"></a>07081     cpl_table_erase_column(maskslits, <span class="stringliteral">"ypseudo"</span>);
-<a name="l07082"></a>07082     cpl_table_erase_column(maskslits, <span class="stringliteral">"xcenter"</span>);
-<a name="l07083"></a>07083     cpl_table_erase_column(maskslits, <span class="stringliteral">"ycenter"</span>);
-<a name="l07084"></a>07084 
-<a name="l07085"></a>07085 
-<a name="l07086"></a>07086     <span class="comment">/*</span>
-<a name="l07087"></a>07087 <span class="comment">     * Find the median platescale and rotation angle from the identified </span>
-<a name="l07088"></a>07088 <span class="comment">     * slits, and then exclude slits outlaying more than 10% from the </span>
-<a name="l07089"></a>07089 <span class="comment">     * median platescale, and more than 2 degrees from the median</span>
-<a name="l07090"></a>07090 <span class="comment">     * rotation angle.</span>
-<a name="l07091"></a>07091 <span class="comment">     */</span>
-<a name="l07092"></a>07092 
-<a name="l07093"></a>07093     ytop    = cpl_table_get_data_double(positions, <span class="stringliteral">"ytop"</span>);
-<a name="l07094"></a>07094     ybottom = cpl_table_get_data_double(positions, <span class="stringliteral">"ybottom"</span>);
-<a name="l07095"></a>07095     xcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"xcenter"</span>);
-<a name="l07096"></a>07096     ycenter = cpl_table_get_data_double(positions, <span class="stringliteral">"ycenter"</span>);
-<a name="l07097"></a>07097     xmcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"xmcenter"</span>);
-<a name="l07098"></a>07098     ymcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"ymcenter"</span>);
-<a name="l07099"></a>07099 
-<a name="l07100"></a>07100     scales = cpl_vector_new(found_slits - 1);
-<a name="l07101"></a>07101     dscale = cpl_vector_get_data(scales);
-<a name="l07102"></a>07102     angles = cpl_vector_new(found_slits - 1);
-<a name="l07103"></a>07103     dangle = cpl_vector_get_data(angles);
-<a name="l07104"></a>07104 
-<a name="l07105"></a>07105     <span class="keywordflow">for</span> (i = 1; i < found_slits; i++) {
-<a name="l07106"></a>07106         dist1 = (xcenter[i-1] - xcenter[i]) * (xcenter[i-1] - xcenter[i])
-<a name="l07107"></a>07107               + (ycenter[i-1] - ycenter[i]) * (ycenter[i-1] - ycenter[i]);
-<a name="l07108"></a>07108         dist2 = (xmcenter[i-1] - xmcenter[i]) * (xmcenter[i-1] - xmcenter[i])
-<a name="l07109"></a>07109               + (ymcenter[i-1] - ymcenter[i]) * (ymcenter[i-1] - ymcenter[i]);
-<a name="l07110"></a>07110         dscale[i-1] = sqrt(dist1/dist2);
-<a name="l07111"></a>07111         dangle[i-1] = atan2(ycenter[i-1] - ycenter[i], 
-<a name="l07112"></a>07112                             xcenter[i-1] - xcenter[i])
-<a name="l07113"></a>07113                     - atan2(ymcenter[i-1] - ymcenter[i], 
-<a name="l07114"></a>07114                             xmcenter[i-1] - xmcenter[i]);
-<a name="l07115"></a>07115         dangle[i-1] *= 180;
-<a name="l07116"></a>07116         dangle[i-1] /= pi;
-<a name="l07117"></a>07117     }
-<a name="l07118"></a>07118 
-<a name="l07119"></a>07119     minscale = cpl_vector_get_min(scales);
-<a name="l07120"></a>07120     scale = cpl_vector_get_median_const(scales);
-<a name="l07121"></a>07121     maxscale = cpl_vector_get_max(scales);
-<a name="l07122"></a>07122 
-<a name="l07123"></a>07123     minangle = cpl_vector_get_min(angles);
-<a name="l07124"></a>07124     angle = cpl_vector_get_median_const(angles);
-<a name="l07125"></a>07125     maxangle = cpl_vector_get_max(angles);
-<a name="l07126"></a>07126 
-<a name="l07127"></a>07127     cpl_msg_info(func, <span class="stringliteral">"Median platescale: %f pixel/mm"</span>, scale);
-<a name="l07128"></a>07128     cpl_msg_info(func, <span class="stringliteral">"Minmax platescale: %f, %f pixel/mm"</span>, 
-<a name="l07129"></a>07129                  minscale, maxscale);
-<a name="l07130"></a>07130 
-<a name="l07131"></a>07131     cpl_msg_info(func, <span class="stringliteral">"Median rotation: %f degrees"</span>, angle);
-<a name="l07132"></a>07132     cpl_msg_info(func, <span class="stringliteral">"Minmax rotation: %f, %f degrees"</span>, 
-<a name="l07133"></a>07133                  minangle, maxangle);
-<a name="l07134"></a>07134 
-<a name="l07135"></a>07135     good = cpl_table_get_data_int(positions, <span class="stringliteral">"good"</span>);
-<a name="l07136"></a>07136 
-<a name="l07137"></a>07137     good[0] = good[found_slits - 1] = 1;
-<a name="l07138"></a>07138     <span class="keywordflow">for</span> (i = 1; i < found_slits; i++) {
-<a name="l07139"></a>07139         <span class="keywordflow">if</span> (fabs((dscale[i-1] - scale)/scale) < 0.10
-<a name="l07140"></a>07140          && fabs(dangle[i-1] - angle) < 2) {
-<a name="l07141"></a>07141             good[i-1]++;
-<a name="l07142"></a>07142             good[i]++;
-<a name="l07143"></a>07143         }
-<a name="l07144"></a>07144     }
-<a name="l07145"></a>07145 
-<a name="l07146"></a>07146     <span class="keywordflow">for</span> (i = 0; i < found_slits; i++) {
-<a name="l07147"></a>07147         <span class="keywordflow">if</span> (good[i] < 2)
-<a name="l07148"></a>07148             good[i] = 0;
-<a name="l07149"></a>07149         <span class="keywordflow">else</span>
-<a name="l07150"></a>07150             good[i] = 1;
-<a name="l07151"></a>07151     }
-<a name="l07152"></a>07152 
-<a name="l07153"></a>07153 <span class="comment">/*</span>
-<a name="l07154"></a>07154 <span class="comment">    for (i = 1; i < found_slits; i++)</span>
-<a name="l07155"></a>07155 <span class="comment">        if (fabs((dscale[i-1] - scale)/scale) < 0.10)</span>
-<a name="l07156"></a>07156 <span class="comment">            good[i-1] = good[i] = 1;</span>
-<a name="l07157"></a>07157 <span class="comment">*/</span>
-<a name="l07158"></a>07158 
-<a name="l07159"></a>07159 <span class="comment">/* DEBUG ************+</span>
-<a name="l07160"></a>07160 <span class="comment">    for (i = 0; i < found_slits; i++) {</span>
-<a name="l07161"></a>07161 <span class="comment">        if (good[i]) {</span>
-<a name="l07162"></a>07162 <span class="comment">            if (i == found_slits - 1)</span>
-<a name="l07163"></a>07163 <span class="comment">                printf("include slit %d, prev = %f, %f\n", </span>
-<a name="l07164"></a>07164 <span class="comment">                       i, dscale[i-1], dangle[i-1]);</span>
-<a name="l07165"></a>07165 <span class="comment">            else if (i == 0)</span>
-<a name="l07166"></a>07166 <span class="comment">                printf("include slit %d, next %f, %f\n", </span>
-<a name="l07167"></a>07167 <span class="comment">                       i, dscale[i], dangle[i]);</span>
-<a name="l07168"></a>07168 <span class="comment">            else</span>
-<a name="l07169"></a>07169 <span class="comment">                printf("include slit %d, prev = %f, %f, next %f, %f\n", i, </span>
-<a name="l07170"></a>07170 <span class="comment">                       dscale[i-1], dangle[i-1], dscale[i], dangle[i]);</span>
-<a name="l07171"></a>07171 <span class="comment">        }</span>
-<a name="l07172"></a>07172 <span class="comment">        else {</span>
-<a name="l07173"></a>07173 <span class="comment">            if (i == found_slits - 1)</span>
-<a name="l07174"></a>07174 <span class="comment">                printf("EXclude slit %d, prev = %f, %f\n", </span>
-<a name="l07175"></a>07175 <span class="comment">                       i, dscale[i-1], dangle[i-1]);</span>
-<a name="l07176"></a>07176 <span class="comment">            else if (i == 0)</span>
-<a name="l07177"></a>07177 <span class="comment">                printf("EXclude slit %d, next %f, %f\n", </span>
-<a name="l07178"></a>07178 <span class="comment">                       i, dscale[i], dangle[i]);</span>
-<a name="l07179"></a>07179 <span class="comment">            else</span>
-<a name="l07180"></a>07180 <span class="comment">                printf("EXclude slit %d, prev = %f, %f, next %f, %f\n", i,    </span>
-<a name="l07181"></a>07181 <span class="comment">                       dscale[i-1], dangle[i-1], dscale[i], dangle[i]);</span>
-<a name="l07182"></a>07182 <span class="comment">        }</span>
-<a name="l07183"></a>07183 <span class="comment">    }</span>
-<a name="l07184"></a>07184 <span class="comment">+*********** DEBUG */</span>
-<a name="l07185"></a>07185 
-<a name="l07186"></a>07186     cpl_vector_delete(scales);
-<a name="l07187"></a>07187     cpl_vector_delete(angles);
-<a name="l07188"></a>07188 
-<a name="l07189"></a>07189     cpl_table_and_selected_int(positions, <span class="stringliteral">"good"</span>, CPL_EQUAL_TO, 0);
-<a name="l07190"></a>07190     cpl_table_erase_selected(positions);
-<a name="l07191"></a>07191     cpl_table_erase_column(positions, <span class="stringliteral">"good"</span>);
-<a name="l07192"></a>07192     found_slits = cpl_table_get_nrow(positions);
-<a name="l07193"></a>07193 
-<a name="l07194"></a>07194     <span class="keywordflow">if</span> (found_slits < 4) {
-<a name="l07195"></a>07195 
-<a name="l07196"></a>07196         <span class="comment">/*</span>
-<a name="l07197"></a>07197 <span class="comment">         * If the self-consistency check gives such a poor result,</span>
-<a name="l07198"></a>07198 <span class="comment">         * something must have gone really wrong in the preliminary</span>
-<a name="l07199"></a>07199 <span class="comment">         * wavelength calibration... Nothing can be done.</span>
-<a name="l07200"></a>07200 <span class="comment">         */</span>
-<a name="l07201"></a>07201 
-<a name="l07202"></a>07202         cpl_msg_warning(func, <span class="stringliteral">"Too few safely identified slits: %d out of %d "</span>
-<a name="l07203"></a>07203                         <span class="stringliteral">"candidates (%d expected). Process will continue "</span>
-<a name="l07204"></a>07204                         <span class="stringliteral">"using the detected CCD slits positions"</span>, found_slits, 
-<a name="l07205"></a>07205                         nslits, nmaskslits);
-<a name="l07206"></a>07206         cpl_table_delete(positions);
-<a name="l07207"></a>07207         <span class="keywordflow">return</span> NULL;
-<a name="l07208"></a>07208     }
-<a name="l07209"></a>07209     <span class="keywordflow">else</span> {
-<a name="l07210"></a>07210         cpl_msg_info(func, <span class="stringliteral">"Safely identified slits: %d out of %d "</span>
-<a name="l07211"></a>07211                      <span class="stringliteral">"candidates\n(%d expected)"</span>, found_slits, nslits,
-<a name="l07212"></a>07212                      nmaskslits);
-<a name="l07213"></a>07213     }
-<a name="l07214"></a>07214 
-<a name="l07215"></a>07215 
-<a name="l07216"></a>07216     <span class="comment">/*</span>
-<a name="l07217"></a>07217 <span class="comment">     * Now select the central points of the identified slits, and</span>
-<a name="l07218"></a>07218 <span class="comment">     * fit two bivariate polynomials to determine a first approximate</span>
-<a name="l07219"></a>07219 <span class="comment">     * relation between positions on the mask and positions on the CCD.</span>
-<a name="l07220"></a>07220 <span class="comment">     */</span>
-<a name="l07221"></a>07221 
-<a name="l07222"></a>07222     xpos = cpl_vector_wrap(found_slits, 
-<a name="l07223"></a>07223                            cpl_table_get_data_double(positions, <span class="stringliteral">"xcenter"</span>));
-<a name="l07224"></a>07224     ypos = cpl_vector_wrap(found_slits, 
-<a name="l07225"></a>07225                            cpl_table_get_data_double(positions, <span class="stringliteral">"ycenter"</span>));
-<a name="l07226"></a>07226     xmpos = cpl_vector_wrap(found_slits, 
-<a name="l07227"></a>07227                             cpl_table_get_data_double(positions, <span class="stringliteral">"xmcenter"</span>));
-<a name="l07228"></a>07228     ympos = cpl_vector_wrap(found_slits, 
-<a name="l07229"></a>07229                             cpl_table_get_data_double(positions, <span class="stringliteral">"ymcenter"</span>));
-<a name="l07230"></a>07230     mpos = cpl_bivector_wrap_vectors(xmpos, ympos);
-<a name="l07231"></a>07231 
-<a name="l07232"></a>07232     <span class="keywordflow">if</span> (found_slits < 10)
-<a name="l07233"></a>07233         degree = 1;
-<a name="l07234"></a>07234     <span class="keywordflow">else</span>
-<a name="l07235"></a>07235         degree = 2;
-<a name="l07236"></a>07236 
-<a name="l07237"></a>07237     xpoly = cpl_polynomial_fit_2d_create(mpos, xpos, degree, &xmse);
-<a name="l07238"></a>07238     <span class="keywordflow">if</span> (xpoly != NULL)
-<a name="l07239"></a>07239         ypoly = cpl_polynomial_fit_2d_create(mpos, ypos, degree, &ymse);
-<a name="l07240"></a>07240     cpl_bivector_unwrap_vectors(mpos);
-<a name="l07241"></a>07241     cpl_vector_unwrap(xpos);
-<a name="l07242"></a>07242     cpl_vector_unwrap(ypos);
-<a name="l07243"></a>07243     cpl_vector_unwrap(xmpos);
-<a name="l07244"></a>07244     cpl_vector_unwrap(ympos);
-<a name="l07245"></a>07245     <span class="keywordflow">if</span> (ypoly == NULL) {
-<a name="l07246"></a>07246         <span class="keywordflow">if</span> (found_slits == nmaskslits) {
-<a name="l07247"></a>07247             cpl_msg_warning(func, <span class="stringliteral">"Fit failure: the accuracy of the "</span>
-<a name="l07248"></a>07248                             <span class="stringliteral">"identified slits positions is not improved."</span>);
-<a name="l07249"></a>07249 
-<a name="l07250"></a>07250             <span class="comment">/*</span>
-<a name="l07251"></a>07251 <span class="comment">             * The determination of the transformation from mask to CCD</span>
-<a name="l07252"></a>07252 <span class="comment">             * failed, but since all slits have been already identified</span>
-<a name="l07253"></a>07253 <span class="comment">             * this is not a problem: data can be reduced also without</span>
-<a name="l07254"></a>07254 <span class="comment">             * such transformation. Simply the accuracy of the slits </span>
-<a name="l07255"></a>07255 <span class="comment">             * positions cannot be improved.</span>
-<a name="l07256"></a>07256 <span class="comment">             */</span> 
-<a name="l07257"></a>07257 
-<a name="l07258"></a>07258         } <span class="keywordflow">else</span> {
-<a name="l07259"></a>07259             cpl_msg_info(func, <span class="stringliteral">"Fit failure: not all slits have been "</span>
-<a name="l07260"></a>07260                          <span class="stringliteral">"identified. Process will continue using "</span>
-<a name="l07261"></a>07261                          <span class="stringliteral">"the detected CCD slits positions"</span>);
-<a name="l07262"></a>07262         }
-<a name="l07263"></a>07263 
-<a name="l07264"></a>07264         cpl_polynomial_delete(xpoly);
-<a name="l07265"></a>07265         <span class="keywordflow">return</span> positions;
-<a name="l07266"></a>07266     }
-<a name="l07267"></a>07267 
-<a name="l07268"></a>07268     cpl_msg_info(func, <span class="stringliteral">"Fit successful: X rms = %.3g, Y rms = %.3g (pixel)"</span>, 
-<a name="l07269"></a>07269                  sqrt(xmse), sqrt(ymse));
-<a name="l07270"></a>07270 
-<a name="l07271"></a>07271     <span class="keywordflow">if</span> (global) {
-<a name="l07272"></a>07272         <a class="code" href="group__moses.html#g3ad10f4436b713a1e3e3296f3fc0e1a0">write_global_distortion</a>(global, 0, xpoly);
-<a name="l07273"></a>07273         <a class="code" href="group__moses.html#g3ad10f4436b713a1e3e3296f3fc0e1a0">write_global_distortion</a>(global, 7, ypoly);
-<a name="l07274"></a>07274     }
-<a name="l07275"></a>07275 
-<a name="l07276"></a>07276     <span class="comment">/*</span>
-<a name="l07277"></a>07277 <span class="comment">     * The fit was successful: use the polynomials to obtain a new </span>
-<a name="l07278"></a>07278 <span class="comment">     * position table with the improved positions of the slits</span>
-<a name="l07279"></a>07279 <span class="comment">     */</span>
-<a name="l07280"></a>07280 
-<a name="l07281"></a>07281     cpl_table_delete(positions);
-<a name="l07282"></a>07282 
-<a name="l07283"></a>07283     positions = cpl_table_duplicate(maskslits);
-<a name="l07284"></a>07284     cpl_table_duplicate_column(positions, <span class="stringliteral">"xmtop"</span>, positions, <span class="stringliteral">"xtop"</span>);
-<a name="l07285"></a>07285     cpl_table_duplicate_column(positions, <span class="stringliteral">"ymtop"</span>, positions, <span class="stringliteral">"ytop"</span>);
-<a name="l07286"></a>07286     cpl_table_duplicate_column(positions, <span class="stringliteral">"xmbottom"</span>, positions, <span class="stringliteral">"xbottom"</span>);
-<a name="l07287"></a>07287     cpl_table_duplicate_column(positions, <span class="stringliteral">"ymbottom"</span>, positions, <span class="stringliteral">"ybottom"</span>);
-<a name="l07288"></a>07288 
-<a name="l07289"></a>07289     point = cpl_vector_new(2);
-<a name="l07290"></a>07290     dpoint = cpl_vector_get_data(point);
-<a name="l07291"></a>07291 
-<a name="l07292"></a>07292     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++) {
-<a name="l07293"></a>07293         dpoint[0] = cpl_table_get_double(positions, <span class="stringliteral">"xmtop"</span>, i, NULL);
-<a name="l07294"></a>07294         dpoint[1] = cpl_table_get_double(positions, <span class="stringliteral">"ymtop"</span>, i, NULL);
-<a name="l07295"></a>07295         cpl_table_set_double(positions, <span class="stringliteral">"xtop"</span>, i, 
-<a name="l07296"></a>07296                              cpl_polynomial_eval(xpoly, point));
-<a name="l07297"></a>07297         cpl_table_set_double(positions, <span class="stringliteral">"ytop"</span>, i, 
-<a name="l07298"></a>07298                              cpl_polynomial_eval(ypoly, point));
-<a name="l07299"></a>07299         dpoint[0] = cpl_table_get_double(positions, <span class="stringliteral">"xmbottom"</span>, i, NULL);
-<a name="l07300"></a>07300         dpoint[1] = cpl_table_get_double(positions, <span class="stringliteral">"ymbottom"</span>, i, NULL);
-<a name="l07301"></a>07301         cpl_table_set_double(positions, <span class="stringliteral">"xbottom"</span>, i, 
-<a name="l07302"></a>07302                              cpl_polynomial_eval(xpoly, point));
-<a name="l07303"></a>07303         cpl_table_set_double(positions, <span class="stringliteral">"ybottom"</span>, i, 
-<a name="l07304"></a>07304                              cpl_polynomial_eval(ypoly, point));
-<a name="l07305"></a>07305     }
-<a name="l07306"></a>07306 
-<a name="l07307"></a>07307     cpl_vector_delete(point);
-<a name="l07308"></a>07308     cpl_polynomial_delete(xpoly);
-<a name="l07309"></a>07309     cpl_polynomial_delete(ypoly);
-<a name="l07310"></a>07310 
-<a name="l07311"></a>07311     cpl_table_erase_column(positions, <span class="stringliteral">"xmtop"</span>);
-<a name="l07312"></a>07312     cpl_table_erase_column(positions, <span class="stringliteral">"ymtop"</span>);
-<a name="l07313"></a>07313     cpl_table_erase_column(positions, <span class="stringliteral">"xmbottom"</span>);
-<a name="l07314"></a>07314     cpl_table_erase_column(positions, <span class="stringliteral">"ymbottom"</span>);
-<a name="l07315"></a>07315 
-<a name="l07316"></a>07316     <span class="keywordflow">if</span> (nmaskslits > nslits)
-<a name="l07317"></a>07317         cpl_msg_info(func, <span class="stringliteral">"Finally identified slits: %d out of %d expected\n"</span>
-<a name="l07318"></a>07318                  <span class="stringliteral">"(%d recovered)"</span>, nmaskslits, nmaskslits, nmaskslits - nslits);
-<a name="l07319"></a>07319     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nmaskslits < nslits)
-<a name="l07320"></a>07320         cpl_msg_info(func, <span class="stringliteral">"Finally identified slits: %d out of %d expected\n"</span>
-<a name="l07321"></a>07321                  <span class="stringliteral">"(%d rejected)"</span>, nmaskslits, nmaskslits, nslits - nmaskslits);
-<a name="l07322"></a>07322     <span class="keywordflow">else</span>
-<a name="l07323"></a>07323         cpl_msg_info(func, <span class="stringliteral">"Finally identified slits: %d out of %d expected"</span>,
-<a name="l07324"></a>07324                  nmaskslits, nmaskslits);
-<a name="l07325"></a>07325 
-<a name="l07326"></a>07326     <span class="keywordflow">return</span> positions;
-<a name="l07327"></a>07327 }
-<a name="l07328"></a>07328 
-<a name="l07329"></a>07329 
-<a name="l07371"></a><a class="code" href="group__moses.html#g168f6aecd869c24634fa9f6690da0b02">07371</a> cpl_table *<a class="code" href="group__moses.html#g168f6aecd869c24634fa9f6690da0b02">mos_trace_flat</a>(cpl_image *flat, cpl_table *slits, <span class="keywordtype">double</span> reference,
-<a name="l07372"></a>07372                           <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion)
-<a name="l07373"></a>07373 {
-<a name="l07374"></a>07374 
-<a name="l07375"></a>07375     <span class="keyword">const</span> <span class="keywordtype">char</span>  *func = <span class="stringliteral">"mos_trace_flat"</span>;
-<a name="l07376"></a>07376 
-<a name="l07377"></a>07377     cpl_image   *gradient;
-<a name="l07378"></a>07378     cpl_image   *sgradient;
-<a name="l07379"></a>07379     <span class="keywordtype">float</span>       *dgradient;
-<a name="l07380"></a>07380     <span class="keywordtype">float</span>        level = 500;   <span class="comment">/* It was 250... */</span>
-<a name="l07381"></a>07381     cpl_vector  *row;
-<a name="l07382"></a>07382     cpl_vector  *srow;
-<a name="l07383"></a>07383     cpl_vector **peaks;
-<a name="l07384"></a>07384     <span class="keywordtype">double</span>      *peak;
-<a name="l07385"></a>07385     <span class="keywordtype">int</span>         *slit_id;
-<a name="l07386"></a>07386     <span class="keywordtype">float</span>       *g;
-<a name="l07387"></a>07387     <span class="keywordtype">double</span>      *r;
-<a name="l07388"></a>07388     <span class="keywordtype">double</span>      *xtop;
-<a name="l07389"></a>07389     <span class="keywordtype">double</span>      *ytop;
-<a name="l07390"></a>07390     <span class="keywordtype">double</span>      *xbottom;
-<a name="l07391"></a>07391     <span class="keywordtype">double</span>      *ybottom;
-<a name="l07392"></a>07392     <span class="keywordtype">double</span>       min, dist;
-<a name="l07393"></a>07393     <span class="keywordtype">double</span>       sradius;
-<a name="l07394"></a>07394     <span class="keywordtype">double</span>       tolerance;
-<a name="l07395"></a>07395     <span class="keywordtype">double</span>       start_y, prev_y;
-<a name="l07396"></a>07396     <span class="keywordtype">int</span>          minpos;
-<a name="l07397"></a>07397     <span class="keywordtype">int</span>          nslits;
-<a name="l07398"></a>07398     <span class="keywordtype">int</span>          nrows;
-<a name="l07399"></a>07399     <span class="keywordtype">int</span>          step = 10;
-<a name="l07400"></a>07400     <span class="keywordtype">int</span>          filtbox = 15;
-<a name="l07401"></a>07401     <span class="keywordtype">int</span>          nx, ny, npix;
-<a name="l07402"></a>07402     <span class="keywordtype">int</span>          pos, ypos;
-<a name="l07403"></a>07403     <span class="keywordtype">int</span>          npeaks;
-<a name="l07404"></a>07404     <span class="keywordtype">int</span>          pixel_above, pixel_below;
-<a name="l07405"></a>07405     <span class="keywordtype">int</span>          i, j, k, l;
-<a name="l07406"></a>07406     <span class="keywordtype">char</span>         trace_id[MAX_COLNAME];
-<a name="l07407"></a>07407 
-<a name="l07408"></a>07408     cpl_table   *traces;
-<a name="l07409"></a>07409 
-<a name="l07410"></a>07410 
-<a name="l07411"></a>07411     <span class="keywordflow">if</span> (flat == NULL || slits == NULL) {
-<a name="l07412"></a>07412         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l07413"></a>07413         <span class="keywordflow">return</span> NULL;
-<a name="l07414"></a>07414     }
-<a name="l07415"></a>07415 
-<a name="l07416"></a>07416     <span class="keywordflow">if</span> (dispersion <= 0.0) {
-<a name="l07417"></a>07417         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l07418"></a>07418         <span class="keywordflow">return</span> NULL;
-<a name="l07419"></a>07419     }
-<a name="l07420"></a>07420 
-<a name="l07421"></a>07421     <span class="keywordflow">if</span> (red - blue < dispersion) {
-<a name="l07422"></a>07422         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l07423"></a>07423         <span class="keywordflow">return</span> NULL;
-<a name="l07424"></a>07424     }
-<a name="l07425"></a>07425 
-<a name="l07426"></a>07426     <span class="comment">/*</span>
-<a name="l07427"></a>07427 <span class="comment">     * Create a dummy slit_id column if it is missing in the</span>
-<a name="l07428"></a>07428 <span class="comment">     * input slits table</span>
-<a name="l07429"></a>07429 <span class="comment">     */</span>
-<a name="l07430"></a>07430 
-<a name="l07431"></a>07431     nslits  = cpl_table_get_nrow(slits);
-<a name="l07432"></a>07432     <span class="keywordflow">if</span> (1 != cpl_table_has_column(slits, <span class="stringliteral">"slit_id"</span>)) {
-<a name="l07433"></a>07433         cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l07434"></a>07434         <span class="keywordflow">for</span> (i = 0; i < nslits; i++)
-<a name="l07435"></a>07435             cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, i, -(i+1));  <span class="comment">/* it was (i+1) */</span>
-<a name="l07436"></a>07436     }
-<a name="l07437"></a>07437 
-<a name="l07438"></a>07438     slit_id = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l07439"></a>07439 
-<a name="l07440"></a>07440     nx = cpl_image_get_size_x(flat);
-<a name="l07441"></a>07441     ny = cpl_image_get_size_y(flat);
-<a name="l07442"></a>07442     npix = nx * ny;
-<a name="l07443"></a>07443 
-<a name="l07444"></a>07444     gradient = cpl_image_duplicate(flat);
-<a name="l07445"></a>07445     dgradient = cpl_image_get_data_float(gradient);
-<a name="l07446"></a>07446 
-<a name="l07447"></a>07447     <span class="keywordflow">for</span> (i = 0; i < ny - 1; i++) {
-<a name="l07448"></a>07448         k = i * nx;
-<a name="l07449"></a>07449         <span class="keywordflow">for</span> (j = 0; j < nx; j++) {
-<a name="l07450"></a>07450             l = k + j;
-<a name="l07451"></a>07451             dgradient[l] = fabs(dgradient[l] - dgradient[l + nx]);
-<a name="l07452"></a>07452         }
-<a name="l07453"></a>07453     }
-<a name="l07454"></a>07454 
-<a name="l07455"></a>07455     npix--;
-<a name="l07456"></a>07456     <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l07457"></a>07457         dgradient[npix - j] = 0.0;
-<a name="l07458"></a>07458 
-<a name="l07459"></a>07459     cpl_image_turn(gradient, -1);
-<a name="l07460"></a>07460     nx = cpl_image_get_size_x(gradient);
-<a name="l07461"></a>07461     ny = cpl_image_get_size_y(gradient);
-<a name="l07462"></a>07462     sgradient = <a class="code" href="group__moses.html#gc69af4e18a5d0018e98bbea88dc4eaac">mos_image_vertical_median_filter</a>(gradient, 
-<a name="l07463"></a>07463                                                  filtbox, 0, ny, 0, step);
-<a name="l07464"></a>07464     cpl_image_delete(gradient);
-<a name="l07465"></a>07465 
-<a name="l07466"></a>07466 
-<a name="l07467"></a>07467     <span class="comment">/*</span>
-<a name="l07468"></a>07468 <span class="comment">     * Remove background from processed image rows</span>
-<a name="l07469"></a>07469 <span class="comment">     */</span>
-<a name="l07470"></a>07470 
-<a name="l07471"></a>07471     dgradient = cpl_image_get_data_float(sgradient);
-<a name="l07472"></a>07472 
-<a name="l07473"></a>07473     <span class="keywordflow">for</span> (i = 1; i <= ny; i += step) {
-<a name="l07474"></a>07474         row = cpl_vector_new_from_image_row(sgradient, i);
-<a name="l07475"></a>07475         srow = cpl_vector_filter_median_create(row, filtbox);
-<a name="l07476"></a>07476         cpl_vector_subtract(row, srow);
-<a name="l07477"></a>07477         cpl_vector_delete(srow);
-<a name="l07478"></a>07478         g = dgradient + (i-1)*nx;
-<a name="l07479"></a>07479         r = cpl_vector_get_data(row);
-<a name="l07480"></a>07480         <span class="keywordflow">for</span> (j = 0; j < nx; j++)
-<a name="l07481"></a>07481             g[j] = r[j];
-<a name="l07482"></a>07482         cpl_vector_delete(row);
-<a name="l07483"></a>07483     }
-<a name="l07484"></a>07484 
-<a name="l07485"></a>07485 
-<a name="l07486"></a>07486     <span class="comment">/*</span>
-<a name="l07487"></a>07487 <span class="comment">     * Rotate (temporarily) the input slits table, to get coordinates</span>
-<a name="l07488"></a>07488 <span class="comment">     * compatible with the rotated gradient image.</span>
-<a name="l07489"></a>07489 <span class="comment">     */</span>
-<a name="l07490"></a>07490 
-<a name="l07491"></a>07491     <a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a>(slits, 1, nx, ny);
-<a name="l07492"></a>07492     xtop    = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);
-<a name="l07493"></a>07493     ytop    = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);
-<a name="l07494"></a>07494     xbottom = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);
-<a name="l07495"></a>07495     ybottom = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);
-<a name="l07496"></a>07496 
-<a name="l07497"></a>07497 
-<a name="l07498"></a>07498     <span class="comment">/*</span>
-<a name="l07499"></a>07499 <span class="comment">     * Get positions of peaks candidates for each processed gradient</span>
-<a name="l07500"></a>07500 <span class="comment">     * image row</span>
-<a name="l07501"></a>07501 <span class="comment">     */</span>
-<a name="l07502"></a>07502 
-<a name="l07503"></a>07503     peaks = cpl_calloc(ny, <span class="keyword">sizeof</span>(cpl_vector *));
-<a name="l07504"></a>07504 
-<a name="l07505"></a>07505     <span class="keywordflow">for</span> (i = 0; i < ny; i += step) {
-<a name="l07506"></a>07506         g = dgradient + i*nx;
-<a name="l07507"></a>07507         peaks[i] = <a class="code" href="group__moses.html#g417edefcade103f40ba21dd3f9c29af1">mos_peak_candidates</a>(g, nx, level, 1.0);
-<a name="l07508"></a>07508 
-<a name="l07509"></a>07509         <span class="comment">/* I thought this would be required, but apparently I was wrong.</span>
-<a name="l07510"></a>07510 <span class="comment">         * Check twice... */</span>
-<a name="l07511"></a>07511         <span class="keywordflow">if</span> (peaks[i])
-<a name="l07512"></a>07512             cpl_vector_subtract_scalar(peaks[i], 0.5);
-<a name="l07513"></a>07513          
-<a name="l07514"></a>07514     }
-<a name="l07515"></a>07515 
-<a name="l07516"></a>07516     cpl_image_delete(sgradient);
-<a name="l07517"></a>07517 
-<a name="l07518"></a>07518 
-<a name="l07519"></a>07519     <span class="comment">/*</span>
-<a name="l07520"></a>07520 <span class="comment">     * Tracing the flat field spectra edges, starting from the</span>
-<a name="l07521"></a>07521 <span class="comment">     * slits positions obtained at reference wavelength. The </span>
-<a name="l07522"></a>07522 <span class="comment">     * gradient maximum closest to each slits ends is found and</span>
-<a name="l07523"></a>07523 <span class="comment">     * accepted only within a given search radius:</span>
-<a name="l07524"></a>07524 <span class="comment">     */</span>
-<a name="l07525"></a>07525 
-<a name="l07526"></a>07526     sradius = 5.0;  <span class="comment">/* Pixel */</span>
-<a name="l07527"></a>07527 
-<a name="l07528"></a>07528     <span class="comment">/*</span>
-<a name="l07529"></a>07529 <span class="comment">     * The tracing proceeds along the processed gradient image rows,</span>
-<a name="l07530"></a>07530 <span class="comment">     * above and below the start position, finding the closest peak</span>
-<a name="l07531"></a>07531 <span class="comment">     * to the previous obtained position, accepting the new position</span>
-<a name="l07532"></a>07532 <span class="comment">     * only if it is closer than a given tolerance:</span>
-<a name="l07533"></a>07533 <span class="comment">     */</span>
-<a name="l07534"></a>07534 
-<a name="l07535"></a>07535     tolerance = 0.9;  <span class="comment">/* Pixel */</span>
-<a name="l07536"></a>07536 
-<a name="l07537"></a>07537     <span class="comment">/*</span>
-<a name="l07538"></a>07538 <span class="comment">     * The trace is attempted for a certain number of pixels above</span>
-<a name="l07539"></a>07539 <span class="comment">     * and below the position of the reference wavelength:</span>
-<a name="l07540"></a>07540 <span class="comment">     */</span>
-<a name="l07541"></a>07541 
-<a name="l07542"></a>07542     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;
-<a name="l07543"></a>07543     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;
-<a name="l07544"></a>07544 
-<a name="l07545"></a>07545 
-<a name="l07546"></a>07546     <span class="comment">/*</span>
-<a name="l07547"></a>07547 <span class="comment">     * Prepare the structure of the output table:</span>
-<a name="l07548"></a>07548 <span class="comment">     */</span>
-<a name="l07549"></a>07549 
-<a name="l07550"></a>07550     nrows = (ny-1)/step + 1;
-<a name="l07551"></a>07551     traces = cpl_table_new(nrows);
-<a name="l07552"></a>07552     cpl_table_new_column(traces, <span class="stringliteral">"x"</span>, CPL_TYPE_DOUBLE);
-<a name="l07553"></a>07553     cpl_table_set_column_unit(traces, <span class="stringliteral">"x"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l07554"></a>07554     <span class="keywordflow">for</span> (i = 0, j = 0; i < ny; i += step, j++)
-<a name="l07555"></a>07555         cpl_table_set(traces, <span class="stringliteral">"x"</span>, j, i);
-<a name="l07556"></a>07556 
-<a name="l07557"></a>07557     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l07558"></a>07558 
-<a name="l07559"></a>07559         <span class="comment">/*</span>
-<a name="l07560"></a>07560 <span class="comment">         * Find the closest processed gradient image row</span>
-<a name="l07561"></a>07561 <span class="comment">         */</span>
-<a name="l07562"></a>07562 
-<a name="l07563"></a>07563         ypos = ytop[i];
-<a name="l07564"></a>07564 
-<a name="l07565"></a>07565         <span class="keywordflow">if</span> (ypos < 0)
-<a name="l07566"></a>07566             ypos = 0;
-<a name="l07567"></a>07567         <span class="keywordflow">if</span> (ypos >= ny)
-<a name="l07568"></a>07568             ypos = ny - 1;
-<a name="l07569"></a>07569 
-<a name="l07570"></a>07570         pos = ypos / step;
-<a name="l07571"></a>07571         pos *= step;
-<a name="l07572"></a>07572 
-<a name="l07573"></a>07573         <span class="comment">/*</span>
-<a name="l07574"></a>07574 <span class="comment">         * Find the peak in that row that is closest to xtop[i]</span>
-<a name="l07575"></a>07575 <span class="comment">         */</span>
-<a name="l07576"></a>07576 
-<a name="l07577"></a>07577         <span class="keywordflow">if</span> (peaks[pos]) {
-<a name="l07578"></a>07578             peak = cpl_vector_get_data(peaks[pos]);
-<a name="l07579"></a>07579             npeaks = cpl_vector_get_size(peaks[pos]);
-<a name="l07580"></a>07580 
-<a name="l07581"></a>07581             min = fabs(peak[0] - xtop[i]);
-<a name="l07582"></a>07582             minpos = 0;
-<a name="l07583"></a>07583             <span class="keywordflow">for</span> (j = 1; j < npeaks; j++) {
-<a name="l07584"></a>07584                 dist = fabs(peak[j] - xtop[i]);
-<a name="l07585"></a>07585                 <span class="keywordflow">if</span> (min > dist) {
-<a name="l07586"></a>07586                     min = dist;
-<a name="l07587"></a>07587                     minpos = j;
-<a name="l07588"></a>07588                 }
-<a name="l07589"></a>07589             }
-<a name="l07590"></a>07590         }
-<a name="l07591"></a>07591         <span class="keywordflow">else</span> {
-<a name="l07592"></a>07592             npeaks = 0;
-<a name="l07593"></a>07593         }
-<a name="l07594"></a>07594 
-<a name="l07595"></a>07595         snprintf(trace_id, MAX_COLNAME, <span class="stringliteral">"t%d"</span>, slit_id[i]);
-<a name="l07596"></a>07596         cpl_table_new_column(traces, trace_id, CPL_TYPE_DOUBLE);
-<a name="l07597"></a>07597 
-<a name="l07598"></a>07598         <span class="keywordflow">if</span> (min > sradius || npeaks == 0) {
-<a name="l07599"></a>07599             cpl_msg_warning(func, <span class="stringliteral">"Cannot find spectrum edge for "</span>
-<a name="l07600"></a>07600                             <span class="stringliteral">"top (or left) end of slit %d"</span>, slit_id[i]);
-<a name="l07601"></a>07601         }
-<a name="l07602"></a>07602         <span class="keywordflow">else</span> {
-<a name="l07603"></a>07603 
-<a name="l07604"></a>07604             <span class="comment">/*</span>
-<a name="l07605"></a>07605 <span class="comment">             * Add to output table the start y position. Note that</span>
-<a name="l07606"></a>07606 <span class="comment">             * y positions are written in coordinates of the unrotated</span>
-<a name="l07607"></a>07607 <span class="comment">             * image, i.e., with horizontal dispersion. Currently nx</span>
-<a name="l07608"></a>07608 <span class="comment">             * is the x size of the temporarily rotated image (for</span>
-<a name="l07609"></a>07609 <span class="comment">             * faster memory access), but it has the sense of a y size.</span>
-<a name="l07610"></a>07610 <span class="comment">             */</span>
-<a name="l07611"></a>07611 
-<a name="l07612"></a>07612             cpl_table_set(traces, trace_id, pos/step, nx - peak[minpos]);
-<a name="l07613"></a>07613             start_y = peak[minpos];
-<a name="l07614"></a>07614 
-<a name="l07615"></a>07615             <span class="comment">/*</span>
-<a name="l07616"></a>07616 <span class="comment">             * Perform the tracing of current edge. Above:</span>
-<a name="l07617"></a>07617 <span class="comment">             */</span>
-<a name="l07618"></a>07618 
-<a name="l07619"></a>07619             prev_y = start_y;
-<a name="l07620"></a>07620 
-<a name="l07621"></a>07621             <span class="keywordflow">for</span> (j = pos + step; j < ny; j += step) {
-<a name="l07622"></a>07622                 <span class="keywordflow">if</span> (j - pos > pixel_above)
-<a name="l07623"></a>07623                     <span class="keywordflow">break</span>;
-<a name="l07624"></a>07624                 <span class="keywordflow">if</span> (peaks[j]) {
-<a name="l07625"></a>07625                     peak = cpl_vector_get_data(peaks[j]);
-<a name="l07626"></a>07626                     npeaks = cpl_vector_get_size(peaks[j]);
-<a name="l07627"></a>07627                     min = fabs(peak[0] - prev_y);
-<a name="l07628"></a>07628                     minpos = 0;
-<a name="l07629"></a>07629                     <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {
-<a name="l07630"></a>07630                         dist = fabs(peak[k] - prev_y);
-<a name="l07631"></a>07631                         <span class="keywordflow">if</span> (min > dist) {
-<a name="l07632"></a>07632                             min = dist;
-<a name="l07633"></a>07633                             minpos = k;
-<a name="l07634"></a>07634                         }
-<a name="l07635"></a>07635                     }
-<a name="l07636"></a>07636                     <span class="keywordflow">if</span> (min < tolerance) {
-<a name="l07637"></a>07637                         cpl_table_set(traces, trace_id, j/step, 
-<a name="l07638"></a>07638                                       nx - peak[minpos]);
-<a name="l07639"></a>07639                         prev_y = peak[minpos];
-<a name="l07640"></a>07640                     }
-<a name="l07641"></a>07641                 }
-<a name="l07642"></a>07642             }
-<a name="l07643"></a>07643 
-<a name="l07644"></a>07644             <span class="comment">/*</span>
-<a name="l07645"></a>07645 <span class="comment">             * Perform the tracing of current edge. Below:</span>
-<a name="l07646"></a>07646 <span class="comment">             */</span>
-<a name="l07647"></a>07647 
-<a name="l07648"></a>07648             prev_y = start_y;
-<a name="l07649"></a>07649 
-<a name="l07650"></a>07650             <span class="keywordflow">for</span> (j = pos - step; j >= 0; j -= step) {
-<a name="l07651"></a>07651                 <span class="keywordflow">if</span> (pos - j > pixel_below)
-<a name="l07652"></a>07652                     <span class="keywordflow">break</span>;
-<a name="l07653"></a>07653                 <span class="keywordflow">if</span> (peaks[j]) {
-<a name="l07654"></a>07654                     peak = cpl_vector_get_data(peaks[j]);
-<a name="l07655"></a>07655                     npeaks = cpl_vector_get_size(peaks[j]);
-<a name="l07656"></a>07656                     min = fabs(peak[0] - prev_y);
-<a name="l07657"></a>07657                     minpos = 0;
-<a name="l07658"></a>07658                     <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {
-<a name="l07659"></a>07659                         dist = fabs(peak[k] - prev_y);
-<a name="l07660"></a>07660                         <span class="keywordflow">if</span> (min > dist) {
-<a name="l07661"></a>07661                             min = dist;
-<a name="l07662"></a>07662                             minpos = k;
-<a name="l07663"></a>07663                         }
-<a name="l07664"></a>07664                     }
-<a name="l07665"></a>07665                     <span class="keywordflow">if</span> (min < tolerance) {
-<a name="l07666"></a>07666                         cpl_table_set(traces, trace_id, j/step, 
-<a name="l07667"></a>07667                                       nx - peak[minpos]);
-<a name="l07668"></a>07668                         prev_y = peak[minpos];
-<a name="l07669"></a>07669                     }
-<a name="l07670"></a>07670                 }
-<a name="l07671"></a>07671             }
-<a name="l07672"></a>07672         }
-<a name="l07673"></a>07673 
-<a name="l07674"></a>07674 
-<a name="l07675"></a>07675         <span class="comment">/*</span>
-<a name="l07676"></a>07676 <span class="comment">         * Find the peak in that row that is closest to xbottom[i]</span>
-<a name="l07677"></a>07677 <span class="comment">         */</span>
-<a name="l07678"></a>07678 
-<a name="l07679"></a>07679         <span class="keywordflow">if</span> (peaks[pos]) {
-<a name="l07680"></a>07680             peak = cpl_vector_get_data(peaks[pos]);
-<a name="l07681"></a>07681             npeaks = cpl_vector_get_size(peaks[pos]);
-<a name="l07682"></a>07682     
-<a name="l07683"></a>07683             min = fabs(peak[0] - xbottom[i]);
-<a name="l07684"></a>07684             minpos = 0;
-<a name="l07685"></a>07685             <span class="keywordflow">for</span> (j = 1; j < npeaks; j++) {
-<a name="l07686"></a>07686                 dist = fabs(peak[j] - xbottom[i]);
-<a name="l07687"></a>07687                 <span class="keywordflow">if</span> (min > dist) {
-<a name="l07688"></a>07688                     min = dist;
-<a name="l07689"></a>07689                     minpos = j;
-<a name="l07690"></a>07690                 }
-<a name="l07691"></a>07691             }
-<a name="l07692"></a>07692         }
-<a name="l07693"></a>07693         <span class="keywordflow">else</span> {
-<a name="l07694"></a>07694             npeaks = 0;
-<a name="l07695"></a>07695         }
-<a name="l07696"></a>07696 
-<a name="l07697"></a>07697         snprintf(trace_id, MAX_COLNAME, <span class="stringliteral">"b%d"</span>, slit_id[i]);
-<a name="l07698"></a>07698         cpl_table_new_column(traces, trace_id, CPL_TYPE_DOUBLE);
-<a name="l07699"></a>07699 
-<a name="l07700"></a>07700         <span class="keywordflow">if</span> (min > sradius || npeaks == 0) {
-<a name="l07701"></a>07701             cpl_msg_warning(func, <span class="stringliteral">"Cannot find spectrum edge for "</span>
-<a name="l07702"></a>07702                             <span class="stringliteral">"bottom (or right) end of slit %d"</span>, slit_id[i]);
-<a name="l07703"></a>07703         }
-<a name="l07704"></a>07704         <span class="keywordflow">else</span> {
-<a name="l07705"></a>07705 
-<a name="l07706"></a>07706             cpl_table_set(traces, trace_id, pos/step, nx - peak[minpos]);
-<a name="l07707"></a>07707             start_y = peak[minpos]; 
-<a name="l07708"></a>07708 
-<a name="l07709"></a>07709             <span class="comment">/*</span>
-<a name="l07710"></a>07710 <span class="comment">             * Perform the tracing of current edge. Above:</span>
-<a name="l07711"></a>07711 <span class="comment">             */</span>
-<a name="l07712"></a>07712 
-<a name="l07713"></a>07713             prev_y = start_y;
-<a name="l07714"></a>07714 
-<a name="l07715"></a>07715             <span class="keywordflow">for</span> (j = pos + step; j < ny; j += step) {
-<a name="l07716"></a>07716                 <span class="keywordflow">if</span> (j - pos > pixel_above)
-<a name="l07717"></a>07717                     <span class="keywordflow">break</span>;
-<a name="l07718"></a>07718                 <span class="keywordflow">if</span> (peaks[j]) {
-<a name="l07719"></a>07719                     peak = cpl_vector_get_data(peaks[j]);
-<a name="l07720"></a>07720                     npeaks = cpl_vector_get_size(peaks[j]);
-<a name="l07721"></a>07721                     min = fabs(peak[0] - prev_y);
-<a name="l07722"></a>07722                     minpos = 0;
-<a name="l07723"></a>07723                     <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {
-<a name="l07724"></a>07724                         dist = fabs(peak[k] - prev_y);
-<a name="l07725"></a>07725                         <span class="keywordflow">if</span> (min > dist) {
-<a name="l07726"></a>07726                             min = dist;
-<a name="l07727"></a>07727                             minpos = k;
-<a name="l07728"></a>07728                         }
-<a name="l07729"></a>07729                     }
-<a name="l07730"></a>07730                     <span class="keywordflow">if</span> (min < tolerance) {
-<a name="l07731"></a>07731                         cpl_table_set(traces, trace_id, j/step, 
-<a name="l07732"></a>07732                                       nx - peak[minpos]);
-<a name="l07733"></a>07733                         prev_y = peak[minpos];
-<a name="l07734"></a>07734                     }
-<a name="l07735"></a>07735                 }
-<a name="l07736"></a>07736             }
-<a name="l07737"></a>07737 
-<a name="l07738"></a>07738             <span class="comment">/*</span>
-<a name="l07739"></a>07739 <span class="comment">             * Perform the tracing of current edge. Below:</span>
-<a name="l07740"></a>07740 <span class="comment">             */</span>
-<a name="l07741"></a>07741 
-<a name="l07742"></a>07742             prev_y = start_y;
-<a name="l07743"></a>07743 
-<a name="l07744"></a>07744             <span class="keywordflow">for</span> (j = pos - step; j >= 0; j -= step) {
-<a name="l07745"></a>07745                 <span class="keywordflow">if</span> (pos - j > pixel_below)
-<a name="l07746"></a>07746                     <span class="keywordflow">break</span>;
-<a name="l07747"></a>07747                 <span class="keywordflow">if</span> (peaks[j]) {
-<a name="l07748"></a>07748                     peak = cpl_vector_get_data(peaks[j]);
-<a name="l07749"></a>07749                     npeaks = cpl_vector_get_size(peaks[j]);
-<a name="l07750"></a>07750                     min = fabs(peak[0] - prev_y);
-<a name="l07751"></a>07751                     minpos = 0;
-<a name="l07752"></a>07752                     <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {
-<a name="l07753"></a>07753                         dist = fabs(peak[k] - prev_y);
-<a name="l07754"></a>07754                         <span class="keywordflow">if</span> (min > dist) {
-<a name="l07755"></a>07755                             min = dist;
-<a name="l07756"></a>07756                             minpos = k;
-<a name="l07757"></a>07757                         }
-<a name="l07758"></a>07758                     }
-<a name="l07759"></a>07759                     <span class="keywordflow">if</span> (min < tolerance) {
-<a name="l07760"></a>07760                         cpl_table_set(traces, trace_id, j/step, 
-<a name="l07761"></a>07761                                       nx - peak[minpos]);
-<a name="l07762"></a>07762                         prev_y = peak[minpos];
-<a name="l07763"></a>07763                     }
-<a name="l07764"></a>07764                 }
-<a name="l07765"></a>07765             }
-<a name="l07766"></a>07766         }
-<a name="l07767"></a>07767 
-<a name="l07768"></a>07768     }   <span class="comment">/* End of loop on slits */</span>
-<a name="l07769"></a>07769 
-<a name="l07770"></a>07770     <span class="keywordflow">for</span> (i = 0; i < ny; i += step)
-<a name="l07771"></a>07771         cpl_vector_delete(peaks[i]);
-<a name="l07772"></a>07772     cpl_free(peaks);
-<a name="l07773"></a>07773 
-<a name="l07774"></a>07774     <span class="comment">/*</span>
-<a name="l07775"></a>07775 <span class="comment">     * Restore original orientation of slits positions table</span>
-<a name="l07776"></a>07776 <span class="comment">     */</span>
-<a name="l07777"></a>07777 
-<a name="l07778"></a>07778     <a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a>(slits, -1, ny, nx);
-<a name="l07779"></a>07779 
-<a name="l07780"></a>07780     <span class="keywordflow">return</span> traces;
-<a name="l07781"></a>07781 
-<a name="l07782"></a>07782 }
-<a name="l07783"></a>07783 
-<a name="l07784"></a>07784 
-<a name="l07805"></a><a class="code" href="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414">07805</a> cpl_table *<a class="code" href="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414">mos_poly_trace</a>(cpl_table *slits, cpl_table *traces, <span class="keywordtype">int</span> order)
-<a name="l07806"></a>07806 {
-<a name="l07807"></a>07807     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_poly_trace"</span>;
-<a name="l07808"></a>07808 
-<a name="l07809"></a>07809     cpl_table      *polytraces;
-<a name="l07810"></a>07810     cpl_table      *dummy;
-<a name="l07811"></a>07811     cpl_vector     *x;
-<a name="l07812"></a>07812     cpl_vector     *trace;
-<a name="l07813"></a>07813     cpl_polynomial *polytrace;
-<a name="l07814"></a>07814     <span class="keywordtype">char</span>            trace_id[MAX_COLNAME];
-<a name="l07815"></a>07815     <span class="keywordtype">char</span>            trace_res[MAX_COLNAME];
-<a name="l07816"></a>07816     <span class="keywordtype">char</span>            trace_mod[MAX_COLNAME];
-<a name="l07817"></a>07817     <span class="keyword">const</span> <span class="keywordtype">char</span>     *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l07818"></a>07818                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l07819"></a>07819     <span class="keywordtype">double</span>         *xdata;
-<a name="l07820"></a>07820     <span class="keywordtype">int</span>            *slit_id;
-<a name="l07821"></a>07821     <span class="keywordtype">int</span>             nslits;
-<a name="l07822"></a>07822     <span class="keywordtype">int</span>             nrows;
-<a name="l07823"></a>07823     <span class="keywordtype">int</span>             npoints;
-<a name="l07824"></a>07824     <span class="keywordtype">int</span>             i, j;
-<a name="l07825"></a>07825     cpl_size        k;
-<a name="l07826"></a>07826 
-<a name="l07827"></a>07827 
-<a name="l07828"></a>07828     <span class="keywordflow">if</span> (traces == NULL || slits == NULL) {
-<a name="l07829"></a>07829         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l07830"></a>07830         <span class="keywordflow">return</span> NULL;
-<a name="l07831"></a>07831     }
-<a name="l07832"></a>07832 
-<a name="l07833"></a>07833     <span class="keywordflow">if</span> (order > 5) {
-<a name="l07834"></a>07834         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l07835"></a>07835         <span class="keywordflow">return</span> NULL;
-<a name="l07836"></a>07836     }
-<a name="l07837"></a>07837 
-<a name="l07838"></a>07838     nrows   = cpl_table_get_nrow(traces);
-<a name="l07839"></a>07839     xdata   = cpl_table_get_data_double(traces, <span class="stringliteral">"x"</span>);
-<a name="l07840"></a>07840     nslits  = cpl_table_get_nrow(slits);
-<a name="l07841"></a>07841     slit_id = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l07842"></a>07842 
-<a name="l07843"></a>07843     polytraces = cpl_table_new(2*nslits);
-<a name="l07844"></a>07844     cpl_table_new_column(polytraces, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l07845"></a>07845     <span class="keywordflow">for</span> (i = 0; i <= order; i++)
-<a name="l07846"></a>07846         cpl_table_new_column(polytraces, clab[i], CPL_TYPE_DOUBLE);
-<a name="l07847"></a>07847 
-<a name="l07848"></a>07848     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l07849"></a>07849         <span class="keywordflow">for</span> (j = 0; j < 2; j++) {  <span class="comment">/* For top and bottom trace of each slit */</span>
-<a name="l07850"></a>07850 
-<a name="l07851"></a>07851             <span class="keywordflow">if</span> (j) {
-<a name="l07852"></a>07852                 snprintf(trace_id, MAX_COLNAME, <span class="stringliteral">"b%d"</span>, slit_id[i]);
-<a name="l07853"></a>07853                 snprintf(trace_res, MAX_COLNAME, <span class="stringliteral">"b%d_res"</span>, slit_id[i]);
-<a name="l07854"></a>07854                 snprintf(trace_mod, MAX_COLNAME, <span class="stringliteral">"b%d_mod"</span>, slit_id[i]);
-<a name="l07855"></a>07855             }
-<a name="l07856"></a>07856             <span class="keywordflow">else</span> {
-<a name="l07857"></a>07857                 snprintf(trace_id, MAX_COLNAME, <span class="stringliteral">"t%d"</span>, slit_id[i]);
-<a name="l07858"></a>07858                 snprintf(trace_res, MAX_COLNAME, <span class="stringliteral">"t%d_res"</span>, slit_id[i]);
-<a name="l07859"></a>07859                 snprintf(trace_mod, MAX_COLNAME, <span class="stringliteral">"t%d_mod"</span>, slit_id[i]);
-<a name="l07860"></a>07860             }
-<a name="l07861"></a>07861 
-<a name="l07862"></a>07862             cpl_table_set_int(polytraces, <span class="stringliteral">"slit_id"</span>, 2*i+j, slit_id[i]);
-<a name="l07863"></a>07863 
-<a name="l07864"></a>07864             <span class="comment">/*</span>
-<a name="l07865"></a>07865 <span class="comment">             * The "dummy" table is just a tool for eliminating invalid</span>
-<a name="l07866"></a>07866 <span class="comment">             * points from the vectors to be fitted.</span>
-<a name="l07867"></a>07867 <span class="comment">             */</span>
-<a name="l07868"></a>07868 
-<a name="l07869"></a>07869             dummy = cpl_table_new(nrows);
-<a name="l07870"></a>07870             cpl_table_duplicate_column(dummy, <span class="stringliteral">"x"</span>, traces, <span class="stringliteral">"x"</span>);
-<a name="l07871"></a>07871             cpl_table_duplicate_column(dummy, trace_id, traces, trace_id);
-<a name="l07872"></a>07872             npoints = nrows - cpl_table_count_invalid(dummy, trace_id);
-<a name="l07873"></a>07873             <span class="keywordflow">if</span> (npoints < 2 * order) {
-<a name="l07874"></a>07874                 cpl_table_delete(dummy);
-<a name="l07875"></a>07875                 <span class="keywordflow">continue</span>;
-<a name="l07876"></a>07876             }
-<a name="l07877"></a>07877             cpl_table_erase_invalid(dummy);
-<a name="l07878"></a>07878             x     = cpl_vector_wrap(npoints, 
-<a name="l07879"></a>07879                                     cpl_table_get_data_double(dummy, <span class="stringliteral">"x"</span>));
-<a name="l07880"></a>07880             trace = cpl_vector_wrap(npoints, 
-<a name="l07881"></a>07881                                     cpl_table_get_data_double(dummy, trace_id));
-<a name="l07882"></a>07882             polytrace = cpl_polynomial_fit_1d_create(x, trace, order, NULL);
-<a name="l07883"></a>07883             cpl_vector_unwrap(x);
-<a name="l07884"></a>07884             cpl_vector_unwrap(trace);
-<a name="l07885"></a>07885             cpl_table_delete(dummy);
-<a name="l07886"></a>07886 
-<a name="l07887"></a>07887             <span class="comment">/*</span>
-<a name="l07888"></a>07888 <span class="comment">             * Screen bad solutions. At the moment, a primitive screening</span>
-<a name="l07889"></a>07889 <span class="comment">             * consists in excluding solutions displaying excessive</span>
-<a name="l07890"></a>07890 <span class="comment">             * curvature (larger than 1E-5 / pixel)</span>
-<a name="l07891"></a>07891 <span class="comment">             */</span>
-<a name="l07892"></a>07892 
-<a name="l07893"></a>07893             k = 2;
-<a name="l07894"></a>07894             <span class="keywordflow">if</span> (fabs(cpl_polynomial_get_coeff(polytrace, &k)) >  1.E-4) {
-<a name="l07895"></a>07895                 cpl_polynomial_delete(polytrace);
-<a name="l07896"></a>07896                 cpl_table_new_column(traces, trace_mod, CPL_TYPE_DOUBLE);
-<a name="l07897"></a>07897                 cpl_table_duplicate_column(traces, trace_res, traces, 
-<a name="l07898"></a>07898                                            trace_mod);
-<a name="l07899"></a>07899                 <span class="keywordflow">if</span> (j) 
-<a name="l07900"></a>07900                     cpl_msg_warning(func, <span class="stringliteral">"Exclude bad curvature solution "</span>
-<a name="l07901"></a>07901                            <span class="stringliteral">"for bottom (right) edge of slit %d"</span>, slit_id[i]);
-<a name="l07902"></a>07902                 <span class="keywordflow">else</span>
-<a name="l07903"></a>07903                     cpl_msg_warning(func, <span class="stringliteral">"Exclude bad curvature solution "</span>
-<a name="l07904"></a>07904                                 <span class="stringliteral">"for top (left) edge of slit %d"</span>, slit_id[i]);
-<a name="l07905"></a>07905                 <span class="keywordflow">continue</span>;
-<a name="l07906"></a>07906             }
-<a name="l07907"></a>07907 
-<a name="l07908"></a>07908             <span class="comment">/*</span>
-<a name="l07909"></a>07909 <span class="comment">             * Write polynomial coefficients to the output table,</span>
-<a name="l07910"></a>07910 <span class="comment">             * tagged with the appropriate slit_id</span>
-<a name="l07911"></a>07911 <span class="comment">             */</span>
-<a name="l07912"></a>07912 
-<a name="l07913"></a>07913             <span class="keywordflow">for</span> (k = 0; k <= order; k++)
-<a name="l07914"></a>07914                 cpl_table_set_double(polytraces, clab[k], 2*i+j, 
-<a name="l07915"></a>07915                                      cpl_polynomial_get_coeff(polytrace, &k));
-<a name="l07916"></a>07916 
-<a name="l07917"></a>07917             <span class="comment">/*</span>
-<a name="l07918"></a>07918 <span class="comment">             * Add column of residuals to input traces table</span>
-<a name="l07919"></a>07919 <span class="comment">             */</span>
-<a name="l07920"></a>07920 
-<a name="l07921"></a>07921             cpl_table_new_column(traces, trace_mod, CPL_TYPE_DOUBLE);
-<a name="l07922"></a>07922             cpl_table_set_column_unit(traces, trace_mod, <span class="stringliteral">"pixel"</span>);
-<a name="l07923"></a>07923 
-<a name="l07924"></a>07924             <span class="keywordflow">for</span> (k = 0; k < nrows; k++) {
-<a name="l07925"></a>07925                 cpl_table_set_double(traces, trace_mod, k,
-<a name="l07926"></a>07926                           cpl_polynomial_eval_1d(polytrace, xdata[k], NULL));
-<a name="l07927"></a>07927             }
-<a name="l07928"></a>07928 
-<a name="l07929"></a>07929             cpl_polynomial_delete(polytrace);
-<a name="l07930"></a>07930 
-<a name="l07931"></a>07931             cpl_table_duplicate_column(traces, trace_res, traces, trace_mod);
-<a name="l07932"></a>07932             cpl_table_subtract_columns(traces, trace_res, trace_id);
-<a name="l07933"></a>07933             cpl_table_multiply_scalar(traces, trace_res, -1.0);
-<a name="l07934"></a>07934 
-<a name="l07935"></a>07935         }
-<a name="l07936"></a>07936     }
-<a name="l07937"></a>07937 
-<a name="l07938"></a>07938     <span class="keywordflow">return</span> polytraces;
-<a name="l07939"></a>07939 
-<a name="l07940"></a>07940 }
-<a name="l07941"></a>07941 
-<a name="l07942"></a>07942 
-<a name="l07966"></a><a class="code" href="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5">07966</a> cpl_error_code <a class="code" href="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5">mos_global_trace</a>(cpl_table *slits, cpl_table *polytraces,
-<a name="l07967"></a>07967                                 <span class="keywordtype">int</span> mode)
-<a name="l07968"></a>07968 {
-<a name="l07969"></a>07969     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_global_trace"</span>;
-<a name="l07970"></a>07970 
-<a name="l07971"></a>07971     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l07972"></a>07972                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l07973"></a>07973     cpl_table      *table;
-<a name="l07974"></a>07974     cpl_vector     *c0;
-<a name="l07975"></a>07975     cpl_vector     *cn;
-<a name="l07976"></a>07976     cpl_bivector   *<a class="code" href="structlist.html">list</a>;
-<a name="l07977"></a>07977 <span class="comment">/* alternative (not robust)</span>
-<a name="l07978"></a>07978 <span class="comment">    cpl_polynomial *poly;</span>
-<a name="l07979"></a>07979 <span class="comment">*/</span>
-<a name="l07980"></a>07980 
-<a name="l07981"></a>07981     <span class="keywordtype">double</span> *offset;
-<a name="l07982"></a>07982     <span class="keywordtype">double</span>  rms, q, m;
-<a name="l07983"></a>07983 
-<a name="l07984"></a>07984     <span class="keywordtype">int</span> order, nrows, nslits;
-<a name="l07985"></a>07985     <span class="keywordtype">int</span> i, j;
-<a name="l07986"></a>07986 
-<a name="l07987"></a>07987 
-<a name="l07988"></a>07988     <span class="keywordflow">if</span> (polytraces == NULL) {
-<a name="l07989"></a>07989         cpl_msg_error(func, <span class="stringliteral">"Missing spectral curvature table"</span>);
-<a name="l07990"></a>07990         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l07991"></a>07991     }
-<a name="l07992"></a>07992 
-<a name="l07993"></a>07993     <span class="keywordflow">if</span> (slits == NULL) {
-<a name="l07994"></a>07994         cpl_msg_error(func, <span class="stringliteral">"Missing slits positions table"</span>);
-<a name="l07995"></a>07995         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l07996"></a>07996     }
-<a name="l07997"></a>07997 
-<a name="l07998"></a>07998     nslits = cpl_table_get_nrow(slits);
-<a name="l07999"></a>07999 
-<a name="l08000"></a>08000     table = cpl_table_duplicate(polytraces);
-<a name="l08001"></a>08001     cpl_table_erase_invalid(table);
-<a name="l08002"></a>08002 
-<a name="l08003"></a>08003     nrows = cpl_table_get_nrow(table);
-<a name="l08004"></a>08004 
-<a name="l08005"></a>08005     <span class="keywordflow">if</span> (nrows < 4) {
-<a name="l08006"></a>08006         cpl_msg_warning(func, <span class="stringliteral">"Too few successful spectral curvature tracings "</span>
-<a name="l08007"></a>08007                       <span class="stringliteral">"(%d): the determination of a global curvature model "</span>
-<a name="l08008"></a>08008                       <span class="stringliteral">"failed"</span>, nrows);
-<a name="l08009"></a>08009         <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l08010"></a>08010     }
-<a name="l08011"></a>08011     
-<a name="l08012"></a>08012     order = cpl_table_get_ncol(polytraces) - 2;
-<a name="l08013"></a>08013 
-<a name="l08014"></a>08014     <span class="keywordflow">for</span> (i = 0; i <= order; i++) {
-<a name="l08015"></a>08015         <span class="keywordflow">if</span> (!cpl_table_has_column(table, clab[i])) {
-<a name="l08016"></a>08016             cpl_msg_error(func, <span class="stringliteral">"Wrong spectral curvature table"</span>);
-<a name="l08017"></a>08017             <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l08018"></a>08018         }
-<a name="l08019"></a>08019     }
-<a name="l08020"></a>08020 
-<a name="l08021"></a>08021 
-<a name="l08022"></a>08022     <span class="comment">/*</span>
-<a name="l08023"></a>08023 <span class="comment">     * Fill in advance the missing offset terms</span>
-<a name="l08024"></a>08024 <span class="comment">     */</span>
-<a name="l08025"></a>08025 
-<a name="l08026"></a>08026     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l08027"></a>08027         <span class="keywordflow">if</span> (!cpl_table_is_valid(polytraces, clab[0], 2*i)) {
-<a name="l08028"></a>08028             cpl_table_set_double(polytraces, clab[0], 2*i, 
-<a name="l08029"></a>08029                                 cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL));
-<a name="l08030"></a>08030         }
-<a name="l08031"></a>08031         <span class="keywordflow">if</span> (!cpl_table_is_valid(polytraces, clab[0], 2*i+1)) {
-<a name="l08032"></a>08032             cpl_table_set_double(polytraces, clab[0], 2*i+1,
-<a name="l08033"></a>08033                              cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL));
-<a name="l08034"></a>08034         }
-<a name="l08035"></a>08035     }
-<a name="l08036"></a>08036 
-<a name="l08037"></a>08037     offset = cpl_table_get_data_double(polytraces, clab[0]);
-<a name="l08038"></a>08038 
-<a name="l08039"></a>08039 
-<a name="l08040"></a>08040     <span class="comment">/*</span>
-<a name="l08041"></a>08041 <span class="comment">     * Fit the global model and modify polytraces table accordingly</span>
-<a name="l08042"></a>08042 <span class="comment">     */</span>
-<a name="l08043"></a>08043 
-<a name="l08044"></a>08044     c0 = cpl_vector_wrap(nrows, cpl_table_get_data_double(table, clab[0]));
-<a name="l08045"></a>08045 
-<a name="l08046"></a>08046     <span class="keywordflow">for</span> (i = 1; i <= order; i++) {
-<a name="l08047"></a>08047         cn = cpl_vector_wrap(nrows, cpl_table_get_data_double(table, clab[i]));
-<a name="l08048"></a>08048         list = cpl_bivector_wrap_vectors(c0, cn);
-<a name="l08049"></a>08049         <a class="code" href="group__moses.html#g4b6606e2a44434b722cb25862567e4ff">robustLinearFit</a>(list, &q, &m, &rms);
-<a name="l08050"></a>08050 <span class="comment">/* alternative (not robust)</span>
-<a name="l08051"></a>08051 <span class="comment">        poly = cpl_polynomial_fit_1d_create(c0, cn, 1, NULL);</span>
-<a name="l08052"></a>08052 <span class="comment">*/</span>
-<a name="l08053"></a>08053         <span class="keywordflow">for</span> (j = 0; j < 2*nslits; j++) {
-<a name="l08054"></a>08054             <span class="keywordflow">if</span> (mode == 1)
-<a name="l08055"></a>08055                 <span class="keywordflow">if</span> (cpl_table_is_valid(polytraces, clab[i], j))
-<a name="l08056"></a>08056                     <span class="keywordflow">continue</span>;
-<a name="l08057"></a>08057             cpl_table_set_double(polytraces, clab[i], j, offset[j]*m + q);
-<a name="l08058"></a>08058 <span class="comment">/* alternative (not robust)</span>
-<a name="l08059"></a>08059 <span class="comment">            cpl_table_set_double(polytraces, clab[i], j, </span>
-<a name="l08060"></a>08060 <span class="comment">                                 cpl_polynomial_eval_1d(poly, offset[j], NULL));</span>
-<a name="l08061"></a>08061 <span class="comment">*/</span>
-<a name="l08062"></a>08062         }
-<a name="l08063"></a>08063         cpl_bivector_unwrap_vectors(list);
-<a name="l08064"></a>08064 <span class="comment">/* alternative (not robust)</span>
-<a name="l08065"></a>08065 <span class="comment">        cpl_polynomial_delete(poly);</span>
-<a name="l08066"></a>08066 <span class="comment">*/</span>
-<a name="l08067"></a>08067         cpl_vector_unwrap(cn);
-<a name="l08068"></a>08068     }
-<a name="l08069"></a>08069 
-<a name="l08070"></a>08070     cpl_vector_unwrap(c0);
-<a name="l08071"></a>08071     cpl_table_delete(table);
-<a name="l08072"></a>08072 
-<a name="l08073"></a>08073     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l08074"></a>08074 
-<a name="l08075"></a>08075 }
-<a name="l08076"></a>08076 
-<a name="l08077"></a>08077 
-<a name="l08147"></a><a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">08147</a> cpl_image *<a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(cpl_image *spectra, cpl_table *slits,
-<a name="l08148"></a>08148                                    cpl_table *polytraces, <span class="keywordtype">double</span> reference,
-<a name="l08149"></a>08149                                    <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion,
-<a name="l08150"></a>08150                                    <span class="keywordtype">int</span> flux, cpl_image *calibration)
-<a name="l08151"></a>08151 {
-<a name="l08152"></a>08152     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_spatial_calibration"</span>;
-<a name="l08153"></a>08153 
-<a name="l08154"></a>08154     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l08155"></a>08155                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l08156"></a>08156     cpl_polynomial *polytop;
-<a name="l08157"></a>08157     cpl_polynomial *polybot;
-<a name="l08158"></a>08158     cpl_image     **exslit;
-<a name="l08159"></a>08159     cpl_image      *resampled;
-<a name="l08160"></a>08160     <span class="keywordtype">float</span>          *data;
-<a name="l08161"></a>08161     <span class="keywordtype">float</span>          *sdata;
-<a name="l08162"></a>08162     <span class="keywordtype">float</span>          *xdata;
-<a name="l08163"></a>08163     <span class="keywordtype">double</span>          vtop, vbot, value;
-<a name="l08164"></a>08164     <span class="keywordtype">double</span>          top, bot;
-<a name="l08165"></a>08165     <span class="keywordtype">double</span>          coeff;
-<a name="l08166"></a>08166     <span class="keywordtype">double</span>          ytop, ybot;
-<a name="l08167"></a>08167     <span class="keywordtype">double</span>          ypos, yfra;
-<a name="l08168"></a>08168     <span class="keywordtype">double</span>          factor;
-<a name="l08169"></a>08169     <span class="keywordtype">int</span>             yint, ysize, yprev;
-<a name="l08170"></a>08170     <span class="keywordtype">int</span>             nslits;
-<a name="l08171"></a>08171     <span class="keywordtype">int</span>             npseudo;
-<a name="l08172"></a>08172     <span class="keywordtype">int</span>            *slit_id;
-<a name="l08173"></a>08173     <span class="keywordtype">int</span>            *length;
-<a name="l08174"></a>08174     <span class="keywordtype">int</span>             nx, ny;
-<a name="l08175"></a>08175     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;
-<a name="l08176"></a>08176     <span class="keywordtype">int</span>             missing_top, missing_bot;
-<a name="l08177"></a>08177     <span class="keywordtype">int</span>             null;
-<a name="l08178"></a>08178     <span class="keywordtype">int</span>             order;
-<a name="l08179"></a>08179     <span class="keywordtype">int</span>             i, j; 
-<a name="l08180"></a>08180     cpl_size        k;
-<a name="l08181"></a>08181 
-<a name="l08182"></a>08182     <span class="keywordtype">int</span>             create_position = 1;
-<a name="l08183"></a>08183 
-<a name="l08184"></a>08184 
-<a name="l08185"></a>08185     <span class="keywordflow">if</span> (spectra == NULL || slits == NULL || polytraces == NULL) {
-<a name="l08186"></a>08186         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l08187"></a>08187         <span class="keywordflow">return</span> NULL;
-<a name="l08188"></a>08188     }
-<a name="l08189"></a>08189 
-<a name="l08190"></a>08190     <span class="keywordflow">if</span> (dispersion <= 0.0) {
-<a name="l08191"></a>08191         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l08192"></a>08192         <span class="keywordflow">return</span> NULL;
-<a name="l08193"></a>08193     }
-<a name="l08194"></a>08194 
-<a name="l08195"></a>08195     <span class="keywordflow">if</span> (red - blue < dispersion) {
-<a name="l08196"></a>08196         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l08197"></a>08197         <span class="keywordflow">return</span> NULL;
-<a name="l08198"></a>08198     }
-<a name="l08199"></a>08199 
-<a name="l08200"></a>08200     nx = cpl_image_get_size_x(spectra);
-<a name="l08201"></a>08201     ny = cpl_image_get_size_y(spectra);
-<a name="l08202"></a>08202     sdata = cpl_image_get_data(spectra);
-<a name="l08203"></a>08203     <span class="keywordflow">if</span> (calibration)
-<a name="l08204"></a>08204         data = cpl_image_get_data(calibration);
-<a name="l08205"></a>08205 
-<a name="l08206"></a>08206     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"position"</span>))
-<a name="l08207"></a>08207         create_position = 0;
-<a name="l08208"></a>08208 
-<a name="l08209"></a>08209     <span class="keywordflow">if</span> (create_position) {
-<a name="l08210"></a>08210         cpl_table_new_column(slits, <span class="stringliteral">"position"</span>, CPL_TYPE_INT);
-<a name="l08211"></a>08211         cpl_table_new_column(slits, <span class="stringliteral">"length"</span>, CPL_TYPE_INT);
-<a name="l08212"></a>08212         cpl_table_set_column_unit(slits, <span class="stringliteral">"position"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l08213"></a>08213         cpl_table_set_column_unit(slits, <span class="stringliteral">"length"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l08214"></a>08214     }
-<a name="l08215"></a>08215     <span class="keywordflow">else</span>
-<a name="l08216"></a>08216         length = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l08217"></a>08217 
-<a name="l08218"></a>08218     nslits   = cpl_table_get_nrow(slits);
-<a name="l08219"></a>08219     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l08220"></a>08220     order    = cpl_table_get_ncol(polytraces) - 2;
-<a name="l08221"></a>08221 
-<a name="l08222"></a>08222     <span class="comment">/*</span>
-<a name="l08223"></a>08223 <span class="comment">     * The spatial resampling is performed for a certain number of </span>
-<a name="l08224"></a>08224 <span class="comment">     * pixels above and below the position of the reference wavelength:</span>
-<a name="l08225"></a>08225 <span class="comment">     */</span>
-<a name="l08226"></a>08226 
-<a name="l08227"></a>08227     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;
-<a name="l08228"></a>08228     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;
-<a name="l08229"></a>08229 
-<a name="l08230"></a>08230     exslit = cpl_calloc(nslits, <span class="keyword">sizeof</span>(cpl_image *));
-<a name="l08231"></a>08231 
-<a name="l08232"></a>08232     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l08233"></a>08233         
-<a name="l08234"></a>08234         <span class="keywordflow">if</span> (create_position == 0)
-<a name="l08235"></a>08235             <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l08236"></a>08236                 <span class="keywordflow">continue</span>;
-<a name="l08237"></a>08237 
-<a name="l08238"></a>08238         <span class="comment">/*</span>
-<a name="l08239"></a>08239 <span class="comment">         * Note that the x coordinate of the reference pixels on the CCD</span>
-<a name="l08240"></a>08240 <span class="comment">         * is taken arbitrarily at the top end of each slit. This wouldn't</span>
-<a name="l08241"></a>08241 <span class="comment">         * be entirely correct in case of curved slits, or in presence of</span>
-<a name="l08242"></a>08242 <span class="comment">         * heavy distortions: in such cases the spatial resampling is</span>
-<a name="l08243"></a>08243 <span class="comment">         * really performed across a wide range of wavelengths. But</span>
-<a name="l08244"></a>08244 <span class="comment">         * the lag between top and bottom spectral curvature models </span>
-<a name="l08245"></a>08245 <span class="comment">         * would introduce even in such cases negligible effects on</span>
-<a name="l08246"></a>08246 <span class="comment">         * the spectral spatial resampling.</span>
-<a name="l08247"></a>08247 <span class="comment">         */</span>
-<a name="l08248"></a>08248 
-<a name="l08249"></a>08249         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);
-<a name="l08250"></a>08250 
-<a name="l08251"></a>08251         start_pixel = refpixel - pixel_below;
-<a name="l08252"></a>08252         <span class="keywordflow">if</span> (start_pixel < 0)
-<a name="l08253"></a>08253             start_pixel = 0;
-<a name="l08254"></a>08254 
-<a name="l08255"></a>08255         end_pixel = refpixel + pixel_above;
-<a name="l08256"></a>08256         <span class="keywordflow">if</span> (end_pixel > nx)
-<a name="l08257"></a>08257             end_pixel = nx;
-<a name="l08258"></a>08258 
-<a name="l08259"></a>08259         <span class="comment">/*</span>
-<a name="l08260"></a>08260 <span class="comment">         * Recover from the table of spectral curvature coefficients</span>
-<a name="l08261"></a>08261 <span class="comment">         * the curvature polynomials.</span>
-<a name="l08262"></a>08262 <span class="comment">         */</span>
-<a name="l08263"></a>08263 
-<a name="l08264"></a>08264         missing_top = 0;
-<a name="l08265"></a>08265         polytop = cpl_polynomial_new(1);
-<a name="l08266"></a>08266         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l08267"></a>08267             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);
-<a name="l08268"></a>08268             <span class="keywordflow">if</span> (null) {
-<a name="l08269"></a>08269                 cpl_polynomial_delete(polytop);
-<a name="l08270"></a>08270                 missing_top = 1;
-<a name="l08271"></a>08271                 <span class="keywordflow">break</span>;
-<a name="l08272"></a>08272             }
-<a name="l08273"></a>08273             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l08274"></a>08274         }
-<a name="l08275"></a>08275 
-<a name="l08276"></a>08276         missing_bot = 0;
-<a name="l08277"></a>08277         polybot = cpl_polynomial_new(1);
-<a name="l08278"></a>08278         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l08279"></a>08279             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);
-<a name="l08280"></a>08280             <span class="keywordflow">if</span> (null) {
-<a name="l08281"></a>08281                 cpl_polynomial_delete(polybot);
-<a name="l08282"></a>08282                 missing_bot = 1;
-<a name="l08283"></a>08283                 <span class="keywordflow">break</span>;
-<a name="l08284"></a>08284             }
-<a name="l08285"></a>08285             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l08286"></a>08286         }
-<a name="l08287"></a>08287 
-<a name="l08288"></a>08288         <span class="keywordflow">if</span> (missing_top && missing_bot) {
-<a name="l08289"></a>08289             cpl_msg_warning(func, <span class="stringliteral">"Spatial calibration, slit %d was not "</span>
-<a name="l08290"></a>08290                             <span class="stringliteral">"traced: no extraction!"</span>, 
-<a name="l08291"></a>08291                             slit_id[i]);
-<a name="l08292"></a>08292             <span class="keywordflow">continue</span>;
-<a name="l08293"></a>08293         }
-<a name="l08294"></a>08294 
-<a name="l08295"></a>08295         <span class="comment">/*</span>
-<a name="l08296"></a>08296 <span class="comment">         * In case just one of the two edges was not traced, the other</span>
-<a name="l08297"></a>08297 <span class="comment">         * edge curvature model is duplicated and shifted to the other</span>
-<a name="l08298"></a>08298 <span class="comment">         * end of the slit: better than nothing!</span>
-<a name="l08299"></a>08299 <span class="comment">         */</span>
-<a name="l08300"></a>08300 
-<a name="l08301"></a>08301         <span class="keywordflow">if</span> (missing_top) {
-<a name="l08302"></a>08302             cpl_msg_warning(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span>
-<a name="l08303"></a>08303                             <span class="stringliteral">"the spectral curvature of the lower edge "</span>
-<a name="l08304"></a>08304                             <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l08305"></a>08305             polytop = cpl_polynomial_duplicate(polybot);
-<a name="l08306"></a>08306             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l08307"></a>08307             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l08308"></a>08308             k = 0;
-<a name="l08309"></a>08309             coeff = cpl_polynomial_get_coeff(polybot, &k);
-<a name="l08310"></a>08310             coeff += ytop - ybot;
-<a name="l08311"></a>08311             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l08312"></a>08312         }
-<a name="l08313"></a>08313 
-<a name="l08314"></a>08314         <span class="keywordflow">if</span> (missing_bot) {
-<a name="l08315"></a>08315             cpl_msg_warning(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span>
-<a name="l08316"></a>08316                             <span class="stringliteral">"the spectral curvature of the upper edge "</span>
-<a name="l08317"></a>08317                             <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l08318"></a>08318             polybot = cpl_polynomial_duplicate(polytop);
-<a name="l08319"></a>08319             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l08320"></a>08320             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l08321"></a>08321             k = 0;
-<a name="l08322"></a>08322             coeff = cpl_polynomial_get_coeff(polytop, &k);
-<a name="l08323"></a>08323             coeff -= ytop - ybot;
-<a name="l08324"></a>08324             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l08325"></a>08325         }
-<a name="l08326"></a>08326 
-<a name="l08327"></a>08327         <span class="comment">/*</span>
-<a name="l08328"></a>08328 <span class="comment">         * Allocate image for current extracted slit</span>
-<a name="l08329"></a>08329 <span class="comment">         */</span>
-<a name="l08330"></a>08330 
-<a name="l08331"></a>08331         top = cpl_polynomial_eval_1d(polytop, refpixel, NULL);
-<a name="l08332"></a>08332         bot = cpl_polynomial_eval_1d(polybot, refpixel, NULL);
-<a name="l08333"></a>08333         npseudo = ceil(top-bot) + 1;
-<a name="l08334"></a>08334 
-<a name="l08335"></a>08335         <span class="keywordflow">if</span> (npseudo < 1) {
-<a name="l08336"></a>08336             cpl_polynomial_delete(polytop);
-<a name="l08337"></a>08337             cpl_polynomial_delete(polybot);
-<a name="l08338"></a>08338             cpl_msg_warning(func, <span class="stringliteral">"Slit %d was badly traced: no extraction!"</span>,
-<a name="l08339"></a>08339                             slit_id[i]);
-<a name="l08340"></a>08340             <span class="keywordflow">continue</span>;
-<a name="l08341"></a>08341         }
-<a name="l08342"></a>08342 
-<a name="l08343"></a>08343         exslit[i] = cpl_image_new(nx, npseudo+1, CPL_TYPE_FLOAT);
-<a name="l08344"></a>08344         xdata = cpl_image_get_data(exslit[i]);
-<a name="l08345"></a>08345 
-<a name="l08346"></a>08346         <span class="comment">/*</span>
-<a name="l08347"></a>08347 <span class="comment">         * Write interpolated values to slit image.</span>
-<a name="l08348"></a>08348 <span class="comment">         */</span>
-<a name="l08349"></a>08349 
-<a name="l08350"></a>08350         <span class="keywordflow">for</span> (j = start_pixel; j < end_pixel; j++) {
-<a name="l08351"></a>08351             top = cpl_polynomial_eval_1d(polytop, j, NULL);
-<a name="l08352"></a>08352             bot = cpl_polynomial_eval_1d(polybot, j, NULL);
-<a name="l08353"></a>08353             factor = (top-bot)/npseudo;
-<a name="l08354"></a>08354             <span class="keywordflow">for</span> (k = 0; k <= npseudo; k++) {
-<a name="l08355"></a>08355                 ypos = top - k*factor;
-<a name="l08356"></a>08356                 yint = ypos;
-<a name="l08357"></a>08357                 yfra = ypos - yint;
-<a name="l08358"></a>08358                 <span class="keywordflow">if</span> (yint >= 0 && yint < ny-1) {
-<a name="l08359"></a>08359                     vtop = sdata[j + nx*yint];
-<a name="l08360"></a>08360                     vbot = sdata[j + nx*(yint+1)];
-<a name="l08361"></a>08361                     value = vtop*(1-yfra) + vbot*yfra;
-<a name="l08362"></a>08362                     <span class="keywordflow">if</span> (flux)
-<a name="l08363"></a>08363                         value *= factor;
-<a name="l08364"></a>08364                     xdata[j + nx*(npseudo-k)] = value;
-<a name="l08365"></a>08365                     <span class="keywordflow">if</span> (calibration) {
-<a name="l08366"></a>08366                         data[j + nx*yint] = (top-yint)/factor;
-<a name="l08367"></a>08367                         <span class="keywordflow">if</span> (k) {
-<a name="l08368"></a>08368 
-<a name="l08369"></a>08369                             <span class="comment">/*</span>
-<a name="l08370"></a>08370 <span class="comment">                             * This is added to recover lost pixels on</span>
-<a name="l08371"></a>08371 <span class="comment">                             * the CCD image (pixels are lost because</span>
-<a name="l08372"></a>08372 <span class="comment">                             * the CCD pixels are less than npseudo+1).</span>
-<a name="l08373"></a>08373 <span class="comment">                             */</span>
-<a name="l08374"></a>08374 
-<a name="l08375"></a>08375                             <span class="keywordflow">if</span> (yprev - yint > 1) {
-<a name="l08376"></a>08376                                 data[j + nx*(yint+1)] = (top-yint-1)/factor;
-<a name="l08377"></a>08377                             }
-<a name="l08378"></a>08378                         }
-<a name="l08379"></a>08379                     }
-<a name="l08380"></a>08380                 }
-<a name="l08381"></a>08381                 yprev = yint;
-<a name="l08382"></a>08382             }
-<a name="l08383"></a>08383         }
-<a name="l08384"></a>08384         cpl_polynomial_delete(polytop);
-<a name="l08385"></a>08385         cpl_polynomial_delete(polybot);
-<a name="l08386"></a>08386     }
-<a name="l08387"></a>08387 
-<a name="l08388"></a>08388     <span class="comment">/*</span>
-<a name="l08389"></a>08389 <span class="comment">     * Now all the slits images are copied to a single image</span>
-<a name="l08390"></a>08390 <span class="comment">     */</span>
-<a name="l08391"></a>08391 
-<a name="l08392"></a>08392     ysize = 0;
-<a name="l08393"></a>08393     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)
-<a name="l08394"></a>08394         <span class="keywordflow">if</span> (exslit[i])
-<a name="l08395"></a>08395             ysize += cpl_image_get_size_y(exslit[i]);
-<a name="l08396"></a>08396 
-<a name="l08397"></a>08397     resampled = cpl_image_new(nx, ysize, CPL_TYPE_FLOAT);
-<a name="l08398"></a>08398 
-<a name="l08399"></a>08399     yint = -1;
-<a name="l08400"></a>08400     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l08401"></a>08401         <span class="keywordflow">if</span> (exslit[i]) {
-<a name="l08402"></a>08402             yint += cpl_image_get_size_y(exslit[i]);
-<a name="l08403"></a>08403             cpl_image_copy(resampled, exslit[i], 1, ysize - yint);
-<a name="l08404"></a>08404             <span class="keywordflow">if</span> (create_position) {
-<a name="l08405"></a>08405                 cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, i, ysize - yint - 1);
-<a name="l08406"></a>08406                 cpl_table_set_int(slits, <span class="stringliteral">"length"</span>, i, 
-<a name="l08407"></a>08407                                   cpl_image_get_size_y(exslit[i]));
-<a name="l08408"></a>08408             }
-<a name="l08409"></a>08409             cpl_image_delete(exslit[i]);
-<a name="l08410"></a>08410         }
-<a name="l08411"></a>08411         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (create_position) {
-<a name="l08412"></a>08412             cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, i, -1);
-<a name="l08413"></a>08413             cpl_table_set_int(slits, <span class="stringliteral">"length"</span>, i, 0);
-<a name="l08414"></a>08414         }
-<a name="l08415"></a>08415     }
-<a name="l08416"></a>08416 
-<a name="l08417"></a>08417 
-<a name="l08418"></a>08418     <span class="comment">/*</span>
-<a name="l08419"></a>08419 <span class="comment">     * Elimination of non-traced slits from slit position table: we cannot do</span>
-<a name="l08420"></a>08420 <span class="comment">     * it because we would lose sync with polytraces and other slit-oriented</span>
-<a name="l08421"></a>08421 <span class="comment">     * tables. COMMENTED OUT.</span>
-<a name="l08422"></a>08422 <span class="comment">     * </span>
-<a name="l08423"></a>08423 <span class="comment"></span>
-<a name="l08424"></a>08424 <span class="comment">    if (create_position) {</span>
-<a name="l08425"></a>08425 <span class="comment"></span>
-<a name="l08426"></a>08426 <span class="comment">        if (cpl_table_and_selected_int(slits, "position", CPL_EQUAL_TO, -1))</span>
-<a name="l08427"></a>08427 <span class="comment">            cpl_table_erase_selected(slits);</span>
-<a name="l08428"></a>08428 <span class="comment"></span>
-<a name="l08429"></a>08429 <span class="comment">    }</span>
-<a name="l08430"></a>08430 <span class="comment"></span>
-<a name="l08431"></a>08431 <span class="comment">    */</span>
-<a name="l08432"></a>08432 
-<a name="l08433"></a>08433     cpl_free(exslit);
-<a name="l08434"></a>08434 
-<a name="l08435"></a>08435     <span class="keywordflow">return</span> resampled;
-<a name="l08436"></a>08436 
-<a name="l08437"></a>08437 }
-<a name="l08438"></a>08438 
-<a name="l08439"></a>08439 
-<a name="l08546"></a><a class="code" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">08546</a> cpl_image *<a class="code" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final</a>(cpl_image *image, cpl_table *slits,
-<a name="l08547"></a>08547                                             cpl_vector *lines,
-<a name="l08548"></a>08548                                             <span class="keywordtype">double</span> dispersion, <span class="keywordtype">float</span> level,
-<a name="l08549"></a>08549                                             <span class="keywordtype">int</span> sradius, <span class="keywordtype">int</span> order,
-<a name="l08550"></a>08550                                             <span class="keywordtype">double</span> reject, <span class="keywordtype">double</span> refwave,
-<a name="l08551"></a>08551                                             <span class="keywordtype">double</span> *wavestart, <span class="keywordtype">double</span> *waveend,
-<a name="l08552"></a>08552                                             <span class="keywordtype">int</span> *nlines, <span class="keywordtype">double</span> *error, 
-<a name="l08553"></a>08553                                             cpl_table *idscoeff,
-<a name="l08554"></a>08554                                             cpl_image *calibration,
-<a name="l08555"></a>08555                                             cpl_image *residuals,
-<a name="l08556"></a>08556                                             cpl_table *restable)
-<a name="l08557"></a>08557 {
-<a name="l08558"></a>08558 
-<a name="l08559"></a>08559     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_wavelength_calibration_final"</span>;
-<a name="l08560"></a>08560 
-<a name="l08561"></a>08561     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l08562"></a>08562                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l08563"></a>08563 
-<a name="l08564"></a>08564     <span class="keywordtype">double</span>  tolerance = 20.0;    <span class="comment">/* Probably forever...                */</span>
-<a name="l08565"></a>08565     <span class="keywordtype">int</span>     step = 10;           <span class="comment">/* Compute restable every "step" rows */</span>
-<a name="l08566"></a>08566 
-<a name="l08567"></a>08567     <span class="keywordtype">char</span>            name[MAX_COLNAME];
-<a name="l08568"></a>08568 
-<a name="l08569"></a>08569     cpl_image      *resampled;
-<a name="l08570"></a>08570     cpl_bivector   *output;
-<a name="l08571"></a>08571     cpl_vector     *wavel;
-<a name="l08572"></a>08572     cpl_vector     *peaks;
-<a name="l08573"></a>08573     cpl_polynomial *ids;
-<a name="l08574"></a>08574     cpl_polynomial *lin;
-<a name="l08575"></a>08575     cpl_polynomial *fguess;
-<a name="l08576"></a>08576     cpl_table      *coeff;
-<a name="l08577"></a>08577     <span class="keywordtype">double</span>          ids_err;
-<a name="l08578"></a>08578     <span class="keywordtype">double</span>          max_disp, min_disp;
-<a name="l08579"></a>08579     <span class="keywordtype">double</span>         *line;
-<a name="l08580"></a>08580     <span class="keywordtype">double</span>          firstLambda, lastLambda, lambda;
-<a name="l08581"></a>08581     <span class="keywordtype">double</span>          wave, pixe, value;
-<a name="l08582"></a>08582     <span class="keywordtype">double</span>          c;
-<a name="l08583"></a>08583     <span class="keywordtype">float</span>          *sdata;
-<a name="l08584"></a>08584     <span class="keywordtype">float</span>          *rdata;
-<a name="l08585"></a>08585     <span class="keywordtype">float</span>          *idata;
-<a name="l08586"></a>08586     <span class="keywordtype">float</span>          *ddata;
-<a name="l08587"></a>08587     <span class="keywordtype">float</span>           v1, v2, vi;
-<a name="l08588"></a>08588     <span class="keywordtype">float</span>           fpixel;
-<a name="l08589"></a>08589     <span class="keywordtype">int</span>            *length;
-<a name="l08590"></a>08590     <span class="keywordtype">int</span>             pixstart, pixend;
-<a name="l08591"></a>08591     <span class="keywordtype">int</span>             row_top, row_bot;
-<a name="l08592"></a>08592     <span class="keywordtype">int</span>             extrapolation;
-<a name="l08593"></a>08593     <span class="keywordtype">int</span>             nref;
-<a name="l08594"></a>08594     <span class="keywordtype">int</span>             nslits;
-<a name="l08595"></a>08595     <span class="keywordtype">int</span>             nfits;
-<a name="l08596"></a>08596     <span class="keywordtype">int</span>             nl, nx, ny, pixel;
-<a name="l08597"></a>08597     <span class="keywordtype">int</span>             countLines, usedLines;
-<a name="l08598"></a>08598     <span class="keywordtype">int</span>             uorder;
-<a name="l08599"></a>08599     <span class="keywordtype">int</span>             missing;
-<a name="l08600"></a>08600     <span class="keywordtype">int</span>             null;
-<a name="l08601"></a>08601     <span class="keywordtype">int</span>             width, uradius;
-<a name="l08602"></a>08602     <span class="keywordtype">int</span>             i, j, s;
-<a name="l08603"></a>08603     cpl_size        k;
-<a name="l08604"></a>08604 
-<a name="l08605"></a>08605 
-<a name="l08606"></a>08606     <span class="keywordflow">if</span> (dispersion == 0.0) {
-<a name="l08607"></a>08607         cpl_msg_error(func, <span class="stringliteral">"The expected dispersion (A/pixel) must be given"</span>);
-<a name="l08608"></a>08608         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l08609"></a>08609         <span class="keywordflow">return</span> NULL;
-<a name="l08610"></a>08610     }
-<a name="l08611"></a>08611 
-<a name="l08612"></a>08612     <span class="keywordflow">if</span> (dispersion < 0.0) {
-<a name="l08613"></a>08613         cpl_msg_error(func, <span class="stringliteral">"The expected dispersion must be positive"</span>);
-<a name="l08614"></a>08614         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l08615"></a>08615         <span class="keywordflow">return</span> NULL;
-<a name="l08616"></a>08616     }
-<a name="l08617"></a>08617 
-<a name="l08618"></a>08618     <span class="keywordflow">if</span> (idscoeff == NULL) {
-<a name="l08619"></a>08619         cpl_msg_error(func, <span class="stringliteral">"A preallocated IDS coeff table must be given"</span>);
-<a name="l08620"></a>08620         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l08621"></a>08621         <span class="keywordflow">return</span> NULL;
-<a name="l08622"></a>08622     }
-<a name="l08623"></a>08623 
-<a name="l08624"></a>08624     max_disp = dispersion + dispersion * tolerance / 100;
-<a name="l08625"></a>08625     min_disp = dispersion - dispersion * tolerance / 100;
-<a name="l08626"></a>08626 
-<a name="l08627"></a>08627     <span class="keywordflow">if</span> (order < 1) {
-<a name="l08628"></a>08628         cpl_msg_error(func, <span class="stringliteral">"The order of the fitting polynomial "</span>
-<a name="l08629"></a>08629                       <span class="stringliteral">"must be at least 1"</span>);
-<a name="l08630"></a>08630         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l08631"></a>08631         <span class="keywordflow">return</span> NULL;
-<a name="l08632"></a>08632     }
-<a name="l08633"></a>08633 
-<a name="l08634"></a>08634     <span class="keywordflow">if</span> (image == NULL || lines == NULL) {
-<a name="l08635"></a>08635         cpl_msg_error(func, <span class="stringliteral">"Both spectral exposure and reference line "</span>
-<a name="l08636"></a>08636                       <span class="stringliteral">"catalog are required in input"</span>);
-<a name="l08637"></a>08637         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l08638"></a>08638         <span class="keywordflow">return</span> NULL;
-<a name="l08639"></a>08639     }
-<a name="l08640"></a>08640 
-<a name="l08641"></a>08641     nx = cpl_image_get_size_x(image);
-<a name="l08642"></a>08642     ny = cpl_image_get_size_y(image);
-<a name="l08643"></a>08643     sdata = cpl_image_get_data_float(image);
-<a name="l08644"></a>08644 
-<a name="l08645"></a>08645     nref = cpl_vector_get_size(lines);
-<a name="l08646"></a>08646     line = cpl_vector_get_data(lines);
-<a name="l08647"></a>08647 
-<a name="l08648"></a>08648     <span class="keywordflow">if</span> (*wavestart < 1.0 && *waveend < 1.0) {
-<a name="l08649"></a>08649         firstLambda = line[0];
-<a name="l08650"></a>08650         lastLambda = line[nref-1];
-<a name="l08651"></a>08651         extrapolation = (lastLambda - firstLambda) / 10;
-<a name="l08652"></a>08652         firstLambda -= extrapolation;
-<a name="l08653"></a>08653         lastLambda += extrapolation;
-<a name="l08654"></a>08654         *wavestart = firstLambda;
-<a name="l08655"></a>08655         *waveend = lastLambda;
-<a name="l08656"></a>08656     }
-<a name="l08657"></a>08657     <span class="keywordflow">else</span> {
-<a name="l08658"></a>08658         firstLambda = *wavestart;
-<a name="l08659"></a>08659         lastLambda = *waveend;
-<a name="l08660"></a>08660     }
-<a name="l08661"></a>08661 
-<a name="l08662"></a>08662     nl = (lastLambda - firstLambda) / dispersion;
-<a name="l08663"></a>08663     resampled = cpl_image_new(nl, ny, CPL_TYPE_FLOAT);
-<a name="l08664"></a>08664     rdata = cpl_image_get_data_float(resampled);
-<a name="l08665"></a>08665 
-<a name="l08666"></a>08666     <span class="comment">/*</span>
-<a name="l08667"></a>08667 <span class="comment">     * Allocate total output table of IDS coefficients</span>
-<a name="l08668"></a>08668 <span class="comment">     */</span>
-<a name="l08669"></a>08669 
-<a name="l08670"></a>08670     <span class="keywordflow">for</span> (j = 0; j <= order; j++)
-<a name="l08671"></a>08671         cpl_table_new_column(idscoeff, clab[j], CPL_TYPE_DOUBLE);
-<a name="l08672"></a>08672 
-<a name="l08673"></a>08673     <span class="keywordflow">if</span> (calibration)
-<a name="l08674"></a>08674         idata = cpl_image_get_data_float(calibration);
-<a name="l08675"></a>08675 
-<a name="l08676"></a>08676     <span class="keywordflow">if</span> (residuals)
-<a name="l08677"></a>08677         ddata = cpl_image_get_data_float(residuals);
-<a name="l08678"></a>08678 
-<a name="l08679"></a>08679     <span class="keywordflow">if</span> (restable) {
-<a name="l08680"></a>08680         cpl_table_set_size(restable, nref);
-<a name="l08681"></a>08681         cpl_table_new_column(restable, <span class="stringliteral">"wavelength"</span>, CPL_TYPE_DOUBLE);
-<a name="l08682"></a>08682         cpl_table_copy_data_double(restable, <span class="stringliteral">"wavelength"</span>, line);
-<a name="l08683"></a>08683         <span class="keywordflow">for</span> (i = 0; i < ny; i += step) {
-<a name="l08684"></a>08684              snprintf(name, MAX_COLNAME, <span class="stringliteral">"r%d"</span>, i);
-<a name="l08685"></a>08685              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);
-<a name="l08686"></a>08686              snprintf(name, MAX_COLNAME, <span class="stringliteral">"d%d"</span>, i);
-<a name="l08687"></a>08687              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);
-<a name="l08688"></a>08688              snprintf(name, MAX_COLNAME, <span class="stringliteral">"p%d"</span>, i);
-<a name="l08689"></a>08689              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);
-<a name="l08690"></a>08690         }
-<a name="l08691"></a>08691     }
-<a name="l08692"></a>08692 
-<a name="l08693"></a>08693 
-<a name="l08694"></a>08694     <span class="comment">/*</span>
-<a name="l08695"></a>08695 <span class="comment">     * Process all slits separately.</span>
-<a name="l08696"></a>08696 <span class="comment">     */</span>
-<a name="l08697"></a>08697 
-<a name="l08698"></a>08698     nslits   = cpl_table_get_nrow(slits);
-<a name="l08699"></a>08699     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l08700"></a>08700 
-<a name="l08701"></a>08701     row_top = ny;
-<a name="l08702"></a>08702     <span class="keywordflow">for</span> (s = 0; s < nslits; s++) {
-<a name="l08703"></a>08703 
-<a name="l08704"></a>08704         <span class="keywordflow">if</span> (length[s] == 0)
-<a name="l08705"></a>08705             <span class="keywordflow">continue</span>;
-<a name="l08706"></a>08706 
-<a name="l08707"></a>08707         <span class="comment">/*</span>
-<a name="l08708"></a>08708 <span class="comment">         * row_top and row_bot define the boundaries of the current slit.</span>
-<a name="l08709"></a>08709 <span class="comment">         * Here we begin (arbitrarily...) from the top slit.</span>
-<a name="l08710"></a>08710 <span class="comment">         */</span>
-<a name="l08711"></a>08711 
-<a name="l08712"></a>08712         row_bot = cpl_table_get_int(slits, <span class="stringliteral">"position"</span>, s, NULL);
-<a name="l08713"></a>08713 
-<a name="l08714"></a>08714         <span class="keywordflow">if</span> (sradius > 0) {
-<a name="l08715"></a>08715 
-<a name="l08716"></a>08716             <span class="comment">/*</span>
-<a name="l08717"></a>08717 <span class="comment">             * If a search radius was defined, allocate the table of</span>
-<a name="l08718"></a>08718 <span class="comment">             * the fitting polynomials coefficients. This table is</span>
-<a name="l08719"></a>08719 <span class="comment">             * just used to generate the first-guess polynomial made</span>
-<a name="l08720"></a>08720 <span class="comment">             * of the median coefficients of all polynomials found</span>
-<a name="l08721"></a>08721 <span class="comment">             * for this slit.</span>
-<a name="l08722"></a>08722 <span class="comment">             */</span>
-<a name="l08723"></a>08723 
-<a name="l08724"></a>08724             coeff = cpl_table_new(row_top - row_bot);
-<a name="l08725"></a>08725             <span class="keywordflow">for</span> (j = 0; j <= order; j++)
-<a name="l08726"></a>08726                 cpl_table_new_column(coeff, clab[j], CPL_TYPE_DOUBLE);
-<a name="l08727"></a>08727         }
-<a name="l08728"></a>08728 
-<a name="l08729"></a>08729         <span class="comment">/*</span>
-<a name="l08730"></a>08730 <span class="comment">         * Here is the loop on all rows of the current slit. They are</span>
-<a name="l08731"></a>08731 <span class="comment">         * wavelength calibrated one by one.</span>
-<a name="l08732"></a>08732 <span class="comment">         */</span>
-<a name="l08733"></a>08733 
-<a name="l08734"></a>08734         <span class="keywordflow">for</span> (i = row_bot; i < row_top; i++) {
-<a name="l08735"></a>08735             width = <a class="code" href="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533">mos_lines_width</a>(sdata + i*nx, nx);
-<a name="l08736"></a>08736             <span class="keywordflow">if</span> (width < 5)
-<a name="l08737"></a>08737                 width = 5;
-<a name="l08738"></a>08738             peaks = <a class="code" href="group__moses.html#g417edefcade103f40ba21dd3f9c29af1">mos_peak_candidates</a>(sdata + i*nx, nx, level, width);
-<a name="l08739"></a>08739             <span class="keywordflow">if</span> (peaks) {
-<a name="l08740"></a>08740                 peaks = <a class="code" href="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0">mos_refine_peaks</a>(sdata + i*nx, nx, peaks, width);
-<a name="l08741"></a>08741             }
-<a name="l08742"></a>08742             <span class="keywordflow">if</span> (peaks) {
-<a name="l08743"></a>08743                 <span class="keywordtype">int</span> keep_multiplex = mos_multiplex;
-<a name="l08744"></a>08744                 mos_multiplex = -1;
-<a name="l08745"></a>08745                 output = <a class="code" href="group__moses.html#g43123c837803fd95b01ba2870522ebaf">mos_identify_peaks</a>(peaks, lines, 
-<a name="l08746"></a>08746                                             min_disp, max_disp, 0.05);
-<a name="l08747"></a>08747                 mos_multiplex = keep_multiplex;
-<a name="l08748"></a>08748                 <span class="keywordflow">if</span> (output) {
-<a name="l08749"></a>08749                     countLines = cpl_bivector_get_size(output);
-<a name="l08750"></a>08750                     <span class="keywordflow">if</span> (countLines < 4) {
-<a name="l08751"></a>08751                         cpl_bivector_delete(output);
-<a name="l08752"></a>08752                         cpl_vector_delete(peaks);
-<a name="l08753"></a>08753                         <span class="keywordflow">if</span> (nlines)
-<a name="l08754"></a>08754                             nlines[i] = 0;
-<a name="l08755"></a>08755                         <span class="keywordflow">if</span> (error)
-<a name="l08756"></a>08756                             error[i] = 0.0;
-<a name="l08757"></a>08757                         <span class="keywordflow">continue</span>;
-<a name="l08758"></a>08758                     }
-<a name="l08759"></a>08759 
-<a name="l08760"></a>08760                     <span class="comment">/*</span>
-<a name="l08761"></a>08761 <span class="comment">                     * Set reference wavelength as zero point</span>
-<a name="l08762"></a>08762 <span class="comment">                     */</span>
-<a name="l08763"></a>08763 
-<a name="l08764"></a>08764                     wavel = cpl_bivector_get_y(output);
-<a name="l08765"></a>08765                     cpl_vector_subtract_scalar(wavel, refwave);
-<a name="l08766"></a>08766 
-<a name="l08767"></a>08767                     uorder = countLines / 2 - 1;
-<a name="l08768"></a>08768                     <span class="keywordflow">if</span> (uorder > order)
-<a name="l08769"></a>08769                         uorder = order;
-<a name="l08770"></a>08770 
-<a name="l08771"></a>08771                     ids = <a class="code" href="group__moses.html#g0c895cc2e971156231313f7a16eb6212">mos_poly_wav2pix</a>(output, uorder, reject,
-<a name="l08772"></a>08772                                            2 * (uorder + 1), &usedLines,
-<a name="l08773"></a>08773                                            &ids_err);
-<a name="l08774"></a>08774 
-<a name="l08775"></a>08775                     <span class="keywordflow">if</span> (ids == NULL) {
-<a name="l08776"></a>08776                         cpl_bivector_delete(output);
-<a name="l08777"></a>08777                         cpl_vector_delete(peaks);
-<a name="l08778"></a>08778                         <span class="keywordflow">if</span> (nlines)
-<a name="l08779"></a>08779                             nlines[i] = 0;
-<a name="l08780"></a>08780                         <span class="keywordflow">if</span> (error)
-<a name="l08781"></a>08781                             error[i] = 0.0;
-<a name="l08782"></a>08782                         cpl_error_reset();
-<a name="l08783"></a>08783                         <span class="keywordflow">continue</span>;
-<a name="l08784"></a>08784                     }
-<a name="l08785"></a>08785 
-<a name="l08786"></a>08786                     <span class="keywordflow">if</span> (sradius > 0) {
-<a name="l08787"></a>08787                         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l08788"></a>08788                             <span class="keywordflow">if</span> (k > uorder) {
-<a name="l08789"></a>08789                                 cpl_table_set_double(coeff, clab[k], 
-<a name="l08790"></a>08790                                 i - row_bot, 0.0);
-<a name="l08791"></a>08791                             }
-<a name="l08792"></a>08792                             <span class="keywordflow">else</span> {
-<a name="l08793"></a>08793                                 cpl_table_set_double(coeff, clab[k], 
-<a name="l08794"></a>08794                                 i - row_bot, cpl_polynomial_get_coeff(ids, &k));
-<a name="l08795"></a>08795                             }
-<a name="l08796"></a>08796                         }
-<a name="l08797"></a>08797                     }
-<a name="l08798"></a>08798                <span class="comment">/*   else {   */</span>
-<a name="l08799"></a>08799                         <span class="keywordflow">if</span> (calibration) {
-<a name="l08800"></a>08800                             pixstart = cpl_polynomial_eval_1d(ids,
-<a name="l08801"></a>08801                               cpl_bivector_get_y_data(output)[0], 
-<a name="l08802"></a>08802                               NULL);
-<a name="l08803"></a>08803                             pixend = cpl_polynomial_eval_1d(ids,
-<a name="l08804"></a>08804                               cpl_bivector_get_y_data(output)[countLines-1],
-<a name="l08805"></a>08805                               NULL);
-<a name="l08806"></a>08806                             extrapolation = (pixend - pixstart) / 5;
-<a name="l08807"></a>08807                             pixstart -= extrapolation;
-<a name="l08808"></a>08808                             pixend += extrapolation;
-<a name="l08809"></a>08809                             <span class="keywordflow">if</span> (pixstart < 0)
-<a name="l08810"></a>08810                                 pixstart = 0;
-<a name="l08811"></a>08811                             <span class="keywordflow">if</span> (pixend > nx)
-<a name="l08812"></a>08812                                 pixend = nx;
-<a name="l08813"></a>08813    
-<a name="l08814"></a>08814                             <span class="keywordflow">for</span> (j = pixstart; j < pixend; j++) {
-<a name="l08815"></a>08815                                 (idata + i*nx)[j] = <a class="code" href="group__moses.html#g99c7290af152957144e8c0413355e5dd">mos_eval_dds</a>(ids, 
-<a name="l08816"></a>08816                                      firstLambda, lastLambda, refwave, j);
-<a name="l08817"></a>08817                             }
-<a name="l08818"></a>08818                         }
-<a name="l08819"></a>08819 
-<a name="l08820"></a>08820                         <span class="comment">/*</span>
-<a name="l08821"></a>08821 <span class="comment">                         * Residuals image</span>
-<a name="l08822"></a>08822 <span class="comment">                         */</span>
-<a name="l08823"></a>08823         
-<a name="l08824"></a>08824                         <span class="keywordflow">if</span> (residuals || (restable && !(i%step))) {
-<a name="l08825"></a>08825                             <span class="keywordflow">if</span> (restable && !(i%step)) {
-<a name="l08826"></a>08826                                 lin = cpl_polynomial_new(1);
-<a name="l08827"></a>08827                                 <span class="keywordflow">for</span> (k = 0; k < 2; k++)
-<a name="l08828"></a>08828                                     cpl_polynomial_set_coeff(lin, &k,
-<a name="l08829"></a>08829                                           cpl_polynomial_get_coeff(ids, &k));
-<a name="l08830"></a>08830                             }
-<a name="l08831"></a>08831                             <span class="keywordflow">for</span> (j = 0; j < countLines; j++) {
-<a name="l08832"></a>08832                                 pixe = cpl_bivector_get_x_data(output)[j];
-<a name="l08833"></a>08833                                 wave = cpl_bivector_get_y_data(output)[j];
-<a name="l08834"></a>08834                                 value = pixe 
-<a name="l08835"></a>08835                                       - cpl_polynomial_eval_1d(ids, wave, NULL);
-<a name="l08836"></a>08836                                 <span class="keywordflow">if</span> (residuals) {
-<a name="l08837"></a>08837                                     pixel = pixe + 0.5;
-<a name="l08838"></a>08838                                     (ddata + i*nx)[pixel] = value;
-<a name="l08839"></a>08839                                 }
-<a name="l08840"></a>08840                                 <span class="keywordflow">if</span> (restable && !(i%step)) {
-<a name="l08841"></a>08841                                     <span class="keywordflow">for</span> (k = 0; k < nref; k++) {
-<a name="l08842"></a>08842                                         <span class="keywordflow">if</span> (fabs(line[k]-refwave-wave) < 0.1) {
-<a name="l08843"></a>08843                                             snprintf(name, MAX_COLNAME, 
-<a name="l08844"></a>08844                                                      <span class="stringliteral">"r%d"</span>, i);
-<a name="l08845"></a>08845                                             cpl_table_set_double(restable, name,
-<a name="l08846"></a>08846                                                                  k, value);
-<a name="l08847"></a>08847                                             value = pixe
-<a name="l08848"></a>08848                                                   - cpl_polynomial_eval_1d(lin,
-<a name="l08849"></a>08849                                                               wave, NULL);
-<a name="l08850"></a>08850                                             snprintf(name, MAX_COLNAME, 
-<a name="l08851"></a>08851                                                      <span class="stringliteral">"d%d"</span>, i);
-<a name="l08852"></a>08852                                             cpl_table_set_double(restable, name,
-<a name="l08853"></a>08853                                                                  k, value);
-<a name="l08854"></a>08854                                             snprintf(name, MAX_COLNAME,
-<a name="l08855"></a>08855                                                      <span class="stringliteral">"p%d"</span>, i);
-<a name="l08856"></a>08856                                             cpl_table_set_double(restable, name,
-<a name="l08857"></a>08857                                                                  k, pixe);
-<a name="l08858"></a>08858                                             <span class="keywordflow">break</span>;
-<a name="l08859"></a>08859                                         }
-<a name="l08860"></a>08860                                     }
-<a name="l08861"></a>08861                                 }
-<a name="l08862"></a>08862                             }
-<a name="l08863"></a>08863                             <span class="keywordflow">if</span> (restable && !(i%step)) {
-<a name="l08864"></a>08864                                 cpl_polynomial_delete(lin);
-<a name="l08865"></a>08865                             }
-<a name="l08866"></a>08866 <span class="comment">/***</span>
-<a name="l08867"></a>08867 <span class="comment">                            for (j = 0; j < countLines; j++) {</span>
-<a name="l08868"></a>08868 <span class="comment">                                pixel = cpl_bivector_get_x_data(output)[j] </span>
-<a name="l08869"></a>08869 <span class="comment">                                      + 0.5;</span>
-<a name="l08870"></a>08870 <span class="comment">                                (ddata + i*nx)[pixel] =</span>
-<a name="l08871"></a>08871 <span class="comment">                                cpl_bivector_get_x_data(output)[j]</span>
-<a name="l08872"></a>08872 <span class="comment">                              - cpl_polynomial_eval_1d(ids,</span>
-<a name="l08873"></a>08873 <span class="comment">                                cpl_bivector_get_y_data(output)[j], </span>
-<a name="l08874"></a>08874 <span class="comment">                                NULL);</span>
-<a name="l08875"></a>08875 <span class="comment">                            }</span>
-<a name="l08876"></a>08876 <span class="comment">***/</span>
-<a name="l08877"></a>08877                         }
-<a name="l08878"></a>08878                 <span class="comment">/*  }   */</span>
-<a name="l08879"></a>08879 
-<a name="l08880"></a>08880                     <span class="comment">/*</span>
-<a name="l08881"></a>08881 <span class="comment">                     * Write it anyway, even in case a first-guess based</span>
-<a name="l08882"></a>08882 <span class="comment">                     * solution will be searched afterwards: in case of</span>
-<a name="l08883"></a>08883 <span class="comment">                     * failure, the "blind" solution is kept.</span>
-<a name="l08884"></a>08884 <span class="comment">                     */</span>
-<a name="l08885"></a>08885 
-<a name="l08886"></a>08886                     <span class="keywordflow">if</span> (nlines)
-<a name="l08887"></a>08887                         nlines[i] = usedLines;
-<a name="l08888"></a>08888                     <span class="keywordflow">if</span> (error)
-<a name="l08889"></a>08889                         error[i] = ids_err / sqrt(usedLines/(uorder + 1));
-<a name="l08890"></a>08890 
-<a name="l08891"></a>08891                     <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l08892"></a>08892                         <span class="keywordflow">if</span> (k > uorder) {
-<a name="l08893"></a>08893                             cpl_table_set_double(idscoeff, clab[k], i, 0.0);
-<a name="l08894"></a>08894                         }
-<a name="l08895"></a>08895                         <span class="keywordflow">else</span> {
-<a name="l08896"></a>08896                             cpl_table_set_double(idscoeff, clab[k], i,
-<a name="l08897"></a>08897                                       cpl_polynomial_get_coeff(ids, &k));
-<a name="l08898"></a>08898                         }
-<a name="l08899"></a>08899                     }
-<a name="l08900"></a>08900 
-<a name="l08901"></a>08901                     cpl_polynomial_delete(ids);
-<a name="l08902"></a>08902                     cpl_bivector_delete(output);
-<a name="l08903"></a>08903                 }
-<a name="l08904"></a>08904                 cpl_vector_delete(peaks);
-<a name="l08905"></a>08905             }
-<a name="l08906"></a>08906         }       <span class="comment">/* End of loop on current slit's rows */</span>
-<a name="l08907"></a>08907 
-<a name="l08908"></a>08908 
-<a name="l08909"></a>08909         <span class="keywordflow">if</span> (sradius > 0) {
-<a name="l08910"></a>08910 
-<a name="l08911"></a>08911             <span class="comment">/*</span>
-<a name="l08912"></a>08912 <span class="comment">             * See whether there are valid fits at all...</span>
-<a name="l08913"></a>08913 <span class="comment">             */</span>
-<a name="l08914"></a>08914     
-<a name="l08915"></a>08915             nfits = row_top - row_bot - cpl_table_count_invalid(coeff, clab[0]);
-<a name="l08916"></a>08916     
-<a name="l08917"></a>08917             <span class="keywordflow">if</span> (nfits) {
-<a name="l08918"></a>08918                 <span class="keywordtype">int</span> slope = 0;
-<a name="l08919"></a>08919 
-<a name="l08920"></a>08920                 fguess = cpl_polynomial_new(1);
-<a name="l08921"></a>08921 
-<a name="l08922"></a>08922                 <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">mos_interpolate_wavecalib</a>(coeff, NULL, 2, 1)) {
-<a name="l08923"></a>08923 
-<a name="l08924"></a>08924                     slope = 0;
-<a name="l08925"></a>08925 
-<a name="l08926"></a>08926                     <span class="comment">/*</span>
-<a name="l08927"></a>08927 <span class="comment">                     * Compute a median IDS polynomial for the current slit</span>
-<a name="l08928"></a>08928 <span class="comment">                     */</span>
-<a name="l08929"></a>08929 
-<a name="l08930"></a>08930                     <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l08931"></a>08931                         c = cpl_table_get_column_median(coeff, clab[k]);
-<a name="l08932"></a>08932                         cpl_polynomial_set_coeff(fguess, &k, c);
-<a name="l08933"></a>08933                     }
-<a name="l08934"></a>08934                 }
-<a name="l08935"></a>08935                 <span class="keywordflow">else</span> {
-<a name="l08936"></a>08936                     slope = 1;
-<a name="l08937"></a>08937                 }
-<a name="l08938"></a>08938 
-<a name="l08939"></a>08939                 <span class="keywordflow">for</span> (i = row_bot; i < row_top; i++) {
-<a name="l08940"></a>08940 
-<a name="l08941"></a>08941                     <span class="comment">/*</span>
-<a name="l08942"></a>08942 <span class="comment">                     * Use first-guess to find the reference lines again</span>
-<a name="l08943"></a>08943 <span class="comment">                     */</span>
-<a name="l08944"></a>08944 
-<a name="l08945"></a>08945                     width = <a class="code" href="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533">mos_lines_width</a>(sdata + i*nx, nx);
-<a name="l08946"></a>08946                     <span class="keywordflow">if</span> (width > sradius) {
-<a name="l08947"></a>08947                         uradius = width; 
-<a name="l08948"></a>08948                     }
-<a name="l08949"></a>08949                     <span class="keywordflow">else</span> {
-<a name="l08950"></a>08950                         uradius = sradius;
-<a name="l08951"></a>08951                     }
-<a name="l08952"></a>08952 
-<a name="l08953"></a>08953                     <span class="keywordflow">if</span> (slope) {
-<a name="l08954"></a>08954                         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l08955"></a>08955                             c = cpl_table_get_double(coeff, clab[k], 
-<a name="l08956"></a>08956                                                      i - row_bot, NULL);
-<a name="l08957"></a>08957                             cpl_polynomial_set_coeff(fguess, &k, c);
-<a name="l08958"></a>08958                         }
-<a name="l08959"></a>08959                     }
-<a name="l08960"></a>08960 
-<a name="l08961"></a>08961                     output = <a class="code" href="group__moses.html#g84eceb2b87667085a8215974f0a52446">mos_find_peaks</a>(sdata + i*nx, nx, lines, 
-<a name="l08962"></a>08962                                             fguess, refwave, uradius);
-<a name="l08963"></a>08963 
-<a name="l08964"></a>08964                     <span class="keywordflow">if</span> (output == NULL) {
-<a name="l08965"></a>08965                         cpl_error_reset();
-<a name="l08966"></a>08966                         <span class="keywordflow">continue</span>;
-<a name="l08967"></a>08967                     }
-<a name="l08968"></a>08968 
-<a name="l08969"></a>08969                     countLines = cpl_bivector_get_size(output);
-<a name="l08970"></a>08970 
-<a name="l08971"></a>08971                     <span class="keywordflow">if</span> (countLines < 4) {
-<a name="l08972"></a>08972                         cpl_bivector_delete(output);
-<a name="l08973"></a>08973                         <span class="keywordflow">continue</span>;
-<a name="l08974"></a>08974                     }
-<a name="l08975"></a>08975 
-<a name="l08976"></a>08976                     <span class="comment">/*</span>
-<a name="l08977"></a>08977 <span class="comment">                     * Set reference wavelength as zero point</span>
-<a name="l08978"></a>08978 <span class="comment">                     */</span>
-<a name="l08979"></a>08979 
-<a name="l08980"></a>08980                     wavel = cpl_bivector_get_y(output);
-<a name="l08981"></a>08981                     cpl_vector_subtract_scalar(wavel, refwave);
-<a name="l08982"></a>08982 
-<a name="l08983"></a>08983                     uorder = countLines / 2 - 1;
-<a name="l08984"></a>08984                     <span class="keywordflow">if</span> (uorder > order)
-<a name="l08985"></a>08985                         uorder = order;
-<a name="l08986"></a>08986 
-<a name="l08987"></a>08987                     ids = <a class="code" href="group__moses.html#g0c895cc2e971156231313f7a16eb6212">mos_poly_wav2pix</a>(output, uorder, reject,
-<a name="l08988"></a>08988                                            2 * (uorder + 1), &usedLines,
-<a name="l08989"></a>08989                                            &ids_err);
-<a name="l08990"></a>08990 
-<a name="l08991"></a>08991                     <span class="keywordflow">if</span> (ids == NULL) {
-<a name="l08992"></a>08992                         cpl_error_reset();
-<a name="l08993"></a>08993                         cpl_bivector_delete(output);
-<a name="l08994"></a>08994                         <span class="keywordflow">continue</span>;
-<a name="l08995"></a>08995                     }
-<a name="l08996"></a>08996 
-<a name="l08997"></a>08997                     <span class="keywordflow">if</span> (nlines)
-<a name="l08998"></a>08998                         nlines[i] = usedLines;
-<a name="l08999"></a>08999                     <span class="keywordflow">if</span> (error)
-<a name="l09000"></a>09000                         error[i] = ids_err / sqrt(usedLines/(uorder + 1));
-<a name="l09001"></a>09001 
-<a name="l09002"></a>09002                     <span class="keywordflow">if</span> (calibration) {
-<a name="l09003"></a>09003                         pixstart = cpl_polynomial_eval_1d(ids,
-<a name="l09004"></a>09004                            cpl_bivector_get_y_data(output)[0], 
-<a name="l09005"></a>09005                            NULL);
-<a name="l09006"></a>09006                         pixend = cpl_polynomial_eval_1d(ids,
-<a name="l09007"></a>09007                            cpl_bivector_get_y_data(output)[countLines-1], 
-<a name="l09008"></a>09008                            NULL);
-<a name="l09009"></a>09009                         extrapolation = (pixend - pixstart) / 5;
-<a name="l09010"></a>09010                         pixstart -= extrapolation;
-<a name="l09011"></a>09011                         pixend += extrapolation;
-<a name="l09012"></a>09012                         <span class="keywordflow">if</span> (pixstart < 0)
-<a name="l09013"></a>09013                             pixstart = 0;
-<a name="l09014"></a>09014                         <span class="keywordflow">if</span> (pixend > nx)
-<a name="l09015"></a>09015                             pixend = nx;
-<a name="l09016"></a>09016 
-<a name="l09017"></a>09017                         <span class="keywordflow">for</span> (j = pixstart; j < pixend; j++) {
-<a name="l09018"></a>09018                             (idata + i*nx)[j] = <a class="code" href="group__moses.html#g99c7290af152957144e8c0413355e5dd">mos_eval_dds</a>(ids,
-<a name="l09019"></a>09019                                      firstLambda, lastLambda, refwave, j);
-<a name="l09020"></a>09020                         }
-<a name="l09021"></a>09021                     }
-<a name="l09022"></a>09022 
-<a name="l09023"></a>09023                     <span class="comment">/*</span>
-<a name="l09024"></a>09024 <span class="comment">                     * Residuals image</span>
-<a name="l09025"></a>09025 <span class="comment">                     */</span>
-<a name="l09026"></a>09026 
-<a name="l09027"></a>09027                     <span class="keywordflow">if</span> (residuals || (restable && !(i%step))) {
-<a name="l09028"></a>09028                         <span class="keywordflow">if</span> (restable && !(i%step)) {
-<a name="l09029"></a>09029                             lin = cpl_polynomial_new(1);
-<a name="l09030"></a>09030                             <span class="keywordflow">for</span> (k = 0; k < 2; k++)
-<a name="l09031"></a>09031                                 cpl_polynomial_set_coeff(lin, &k,
-<a name="l09032"></a>09032                                       cpl_polynomial_get_coeff(ids, &k));
-<a name="l09033"></a>09033                         }
-<a name="l09034"></a>09034                         <span class="keywordflow">for</span> (j = 0; j < countLines; j++) {
-<a name="l09035"></a>09035                             pixe = cpl_bivector_get_x_data(output)[j];
-<a name="l09036"></a>09036                             wave = cpl_bivector_get_y_data(output)[j];
-<a name="l09037"></a>09037                             value = pixe
-<a name="l09038"></a>09038                                   - cpl_polynomial_eval_1d(ids, wave, NULL);
-<a name="l09039"></a>09039                             <span class="keywordflow">if</span> (residuals) {
-<a name="l09040"></a>09040                                 pixel = pixe + 0.5;
-<a name="l09041"></a>09041                                 (ddata + i*nx)[pixel] = value;
-<a name="l09042"></a>09042                             }
-<a name="l09043"></a>09043                             <span class="keywordflow">if</span> (restable && !(i%step)) {
-<a name="l09044"></a>09044                                 <span class="keywordflow">for</span> (k = 0; k < nref; k++) {
-<a name="l09045"></a>09045                                     <span class="keywordflow">if</span> (fabs(line[k]-refwave-wave) < 0.1) {
-<a name="l09046"></a>09046                                         snprintf(name, MAX_COLNAME,
-<a name="l09047"></a>09047                                                  <span class="stringliteral">"r%d"</span>, i);
-<a name="l09048"></a>09048                                         cpl_table_set_double(restable, name,
-<a name="l09049"></a>09049                                                              k, value);
-<a name="l09050"></a>09050                                         value = pixe
-<a name="l09051"></a>09051                                               - cpl_polynomial_eval_1d(lin,
-<a name="l09052"></a>09052                                                           wave, NULL);
-<a name="l09053"></a>09053                                         snprintf(name, MAX_COLNAME,
-<a name="l09054"></a>09054                                                  <span class="stringliteral">"d%d"</span>, i);
-<a name="l09055"></a>09055                                         cpl_table_set_double(restable, name,
-<a name="l09056"></a>09056                                                              k, value);
-<a name="l09057"></a>09057                                         snprintf(name, MAX_COLNAME,
-<a name="l09058"></a>09058                                                  <span class="stringliteral">"p%d"</span>, i);
-<a name="l09059"></a>09059                                         cpl_table_set_double(restable, name,
-<a name="l09060"></a>09060                                                              k, pixe);
-<a name="l09061"></a>09061                                         <span class="keywordflow">break</span>;
-<a name="l09062"></a>09062                                     }
-<a name="l09063"></a>09063                                 }
-<a name="l09064"></a>09064                             }
-<a name="l09065"></a>09065                         }
-<a name="l09066"></a>09066                         <span class="keywordflow">if</span> (restable && !(i%step)) {
-<a name="l09067"></a>09067                             cpl_polynomial_delete(lin);
-<a name="l09068"></a>09068                         }
-<a name="l09069"></a>09069 <span class="comment">/***</span>
-<a name="l09070"></a>09070 <span class="comment">                        for (j = 0; j < countLines; j++) {</span>
-<a name="l09071"></a>09071 <span class="comment">                            pixel = cpl_bivector_get_x_data(output)[j]</span>
-<a name="l09072"></a>09072 <span class="comment">                                  + 0.5; </span>
-<a name="l09073"></a>09073 <span class="comment">                            (ddata + i*nx)[pixel] =</span>
-<a name="l09074"></a>09074 <span class="comment">                            cpl_bivector_get_x_data(output)[j]</span>
-<a name="l09075"></a>09075 <span class="comment">                          - cpl_polynomial_eval_1d(ids,</span>
-<a name="l09076"></a>09076 <span class="comment">                            cpl_bivector_get_y_data(output)[j], </span>
-<a name="l09077"></a>09077 <span class="comment">                            NULL);</span>
-<a name="l09078"></a>09078 <span class="comment">                        }</span>
-<a name="l09079"></a>09079 <span class="comment">***/</span>
-<a name="l09080"></a>09080                     }
-<a name="l09081"></a>09081 
-<a name="l09082"></a>09082                     <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l09083"></a>09083                         <span class="keywordflow">if</span> (k > uorder) {
-<a name="l09084"></a>09084                             cpl_table_set_double(idscoeff, clab[k], i, 0.0);
-<a name="l09085"></a>09085                         }
-<a name="l09086"></a>09086                         <span class="keywordflow">else</span> {
-<a name="l09087"></a>09087                             cpl_table_set_double(idscoeff, clab[k], i,
-<a name="l09088"></a>09088                                         cpl_polynomial_get_coeff(ids, &k));
-<a name="l09089"></a>09089                         }
-<a name="l09090"></a>09090                     }
-<a name="l09091"></a>09091 
-<a name="l09092"></a>09092                     cpl_bivector_delete(output);
-<a name="l09093"></a>09093                     cpl_polynomial_delete(ids);
-<a name="l09094"></a>09094 
-<a name="l09095"></a>09095                 } <span class="comment">/* End of loop "use ids as a first-guess" */</span>
-<a name="l09096"></a>09096 
-<a name="l09097"></a>09097                 cpl_polynomial_delete(fguess);
-<a name="l09098"></a>09098             }
-<a name="l09099"></a>09099 
-<a name="l09100"></a>09100             cpl_table_delete(coeff);
-<a name="l09101"></a>09101 
-<a name="l09102"></a>09102         }
-<a name="l09103"></a>09103 
-<a name="l09104"></a>09104         row_top = row_bot;
-<a name="l09105"></a>09105 
-<a name="l09106"></a>09106     } <span class="comment">/* End of loop on slits */</span>
-<a name="l09107"></a>09107 
-<a name="l09108"></a>09108 
-<a name="l09109"></a>09109     <span class="comment">/*</span>
-<a name="l09110"></a>09110 <span class="comment">     * At this point the idscoeff table has been filled with all the </span>
-<a name="l09111"></a>09111 <span class="comment">     * fits coefficients obtained for all the rows of the input image.</span>
-<a name="l09112"></a>09112 <span class="comment">     * Now we apply these coefficients to resample the input image</span>
-<a name="l09113"></a>09113 <span class="comment">     * at constant wavelength step.</span>
-<a name="l09114"></a>09114 <span class="comment">     */</span>
-<a name="l09115"></a>09115 
-<a name="l09116"></a>09116     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l09117"></a>09117 
-<a name="l09118"></a>09118         missing = 0;
-<a name="l09119"></a>09119         ids = cpl_polynomial_new(1);
-<a name="l09120"></a>09120         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l09121"></a>09121             c = cpl_table_get_double(idscoeff, clab[k], i, &null);
-<a name="l09122"></a>09122             <span class="keywordflow">if</span> (null) {
-<a name="l09123"></a>09123                 cpl_polynomial_delete(ids);
-<a name="l09124"></a>09124                 missing = 1;
-<a name="l09125"></a>09125                 <span class="keywordflow">break</span>;
-<a name="l09126"></a>09126             }
-<a name="l09127"></a>09127             cpl_polynomial_set_coeff(ids, &k, c);
-<a name="l09128"></a>09128         }
-<a name="l09129"></a>09129         <span class="keywordflow">if</span> (missing)
-<a name="l09130"></a>09130             <span class="keywordflow">continue</span>;
-<a name="l09131"></a>09131 
-<a name="l09132"></a>09132         pixstart = cpl_polynomial_eval_1d(ids, firstLambda - refwave, NULL);
-<a name="l09133"></a>09133         pixend = cpl_polynomial_eval_1d(ids, lastLambda - refwave, NULL);
-<a name="l09134"></a>09134         <span class="keywordflow">if</span> (pixstart < 0)
-<a name="l09135"></a>09135             pixstart = 0;
-<a name="l09136"></a>09136         <span class="keywordflow">if</span> (pixend > nx)
-<a name="l09137"></a>09137             pixend = nx;
-<a name="l09138"></a>09138 
-<a name="l09139"></a>09139         <span class="comment">/*</span>
-<a name="l09140"></a>09140 <span class="comment">         * Resampled image:</span>
-<a name="l09141"></a>09141 <span class="comment">         */</span>
-<a name="l09142"></a>09142 
-<a name="l09143"></a>09143         <span class="keywordflow">for</span> (j = 0; j < nl; j++) {
-<a name="l09144"></a>09144             lambda = firstLambda + j * dispersion;
-<a name="l09145"></a>09145             fpixel = cpl_polynomial_eval_1d(ids, lambda - refwave, NULL);
-<a name="l09146"></a>09146             pixel = fpixel;
-<a name="l09147"></a>09147             <span class="keywordflow">if</span> (pixel >= 0 && pixel < nx-1) {
-<a name="l09148"></a>09148                 v1 = (sdata + i*nx)[pixel];
-<a name="l09149"></a>09149                 v2 = (sdata + i*nx)[pixel+1];
-<a name="l09150"></a>09150                 vi = v1 + (v2-v1)*(fpixel-pixel);
-<a name="l09151"></a>09151                 (rdata + i*nl)[j] = vi;
-<a name="l09152"></a>09152             }
-<a name="l09153"></a>09153         }
-<a name="l09154"></a>09154 
-<a name="l09155"></a>09155         cpl_polynomial_delete(ids);
-<a name="l09156"></a>09156     }
-<a name="l09157"></a>09157 
-<a name="l09158"></a>09158     <span class="keywordflow">return</span> resampled;
-<a name="l09159"></a>09159 }
-<a name="l09160"></a>09160 
-<a name="l09161"></a>09161 
-<a name="l09188"></a><a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">09188</a> cpl_image *<a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(cpl_image *image, <span class="keywordtype">double</span> refwave, 
-<a name="l09189"></a>09189                                       <span class="keywordtype">double</span> firstLambda, <span class="keywordtype">double</span> lastLambda, 
-<a name="l09190"></a>09190                                       <span class="keywordtype">double</span> dispersion, cpl_table *idscoeff, 
-<a name="l09191"></a>09191                                       <span class="keywordtype">int</span> flux)
-<a name="l09192"></a>09192 {
-<a name="l09193"></a>09193 
-<a name="l09194"></a>09194     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_wavelength_calibration"</span>;
-<a name="l09195"></a>09195 
-<a name="l09196"></a>09196     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l09197"></a>09197                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l09198"></a>09198 
-<a name="l09199"></a>09199     cpl_image      *resampled;
-<a name="l09200"></a>09200     cpl_polynomial *ids;
-<a name="l09201"></a>09201     <span class="keywordtype">double</span>          pixel_per_lambda;
-<a name="l09202"></a>09202     <span class="keywordtype">double</span>          lambda;
-<a name="l09203"></a>09203     <span class="keywordtype">double</span>          c;
-<a name="l09204"></a>09204     <span class="keywordtype">float</span>          *sdata;
-<a name="l09205"></a>09205     <span class="keywordtype">float</span>          *rdata;
-<a name="l09206"></a>09206     <span class="keywordtype">float</span>           v0, v1, v2, v3, vi;
-<a name="l09207"></a>09207     <span class="keywordtype">float</span>           fpixel;
-<a name="l09208"></a>09208     <span class="keywordtype">int</span>             order;
-<a name="l09209"></a>09209     <span class="keywordtype">int</span>             pixstart, pixend;
-<a name="l09210"></a>09210     <span class="keywordtype">int</span>             nl, nx, ny, pixel;
-<a name="l09211"></a>09211     <span class="keywordtype">int</span>             missing;
-<a name="l09212"></a>09212     <span class="keywordtype">int</span>             null;
-<a name="l09213"></a>09213     <span class="keywordtype">int</span>             i, j;
-<a name="l09214"></a>09214     cpl_size        k;
-<a name="l09215"></a>09215 
-<a name="l09216"></a>09216 
-<a name="l09217"></a>09217     <span class="keywordflow">if</span> (dispersion <= 0.0) {
-<a name="l09218"></a>09218         cpl_msg_error(func, <span class="stringliteral">"The resampling step must be positive"</span>);
-<a name="l09219"></a>09219         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l09220"></a>09220         <span class="keywordflow">return</span> NULL;
-<a name="l09221"></a>09221     }
-<a name="l09222"></a>09222 
-<a name="l09223"></a>09223     <span class="keywordflow">if</span> (lastLambda - firstLambda < dispersion) {
-<a name="l09224"></a>09224         cpl_msg_error(func, <span class="stringliteral">"Invalid spectral range: %.2f to %.2f"</span>, 
-<a name="l09225"></a>09225                       firstLambda, lastLambda);
-<a name="l09226"></a>09226         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l09227"></a>09227         <span class="keywordflow">return</span> NULL;
-<a name="l09228"></a>09228     }
-<a name="l09229"></a>09229 
-<a name="l09230"></a>09230     <span class="keywordflow">if</span> (idscoeff == NULL) {
-<a name="l09231"></a>09231         cpl_msg_error(func, <span class="stringliteral">"An IDS coeff table must be given"</span>);
-<a name="l09232"></a>09232         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l09233"></a>09233         <span class="keywordflow">return</span> NULL;
-<a name="l09234"></a>09234     }
-<a name="l09235"></a>09235 
-<a name="l09236"></a>09236     <span class="keywordflow">if</span> (image == NULL) {
-<a name="l09237"></a>09237         cpl_msg_error(func, <span class="stringliteral">"A scientific spectral image must be given"</span>);
-<a name="l09238"></a>09238         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l09239"></a>09239         <span class="keywordflow">return</span> NULL;
-<a name="l09240"></a>09240     }
-<a name="l09241"></a>09241 
-<a name="l09242"></a>09242     nx = cpl_image_get_size_x(image);
-<a name="l09243"></a>09243     ny = cpl_image_get_size_y(image);
-<a name="l09244"></a>09244     sdata = cpl_image_get_data_float(image);
-<a name="l09245"></a>09245 
-<a name="l09246"></a>09246     nl = (lastLambda - firstLambda) / dispersion;
-<a name="l09247"></a>09247     resampled = cpl_image_new(nl, ny, CPL_TYPE_FLOAT);
-<a name="l09248"></a>09248     rdata = cpl_image_get_data_float(resampled);
-<a name="l09249"></a>09249 
-<a name="l09250"></a>09250     order = 0;
-<a name="l09251"></a>09251     <span class="keywordflow">while</span> (order < 6 && cpl_table_has_column(idscoeff, clab[order]))
-<a name="l09252"></a>09252         ++order;
-<a name="l09253"></a>09253     --order;
-<a name="l09254"></a>09254 
-<a name="l09255"></a>09255     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l09256"></a>09256 
-<a name="l09257"></a>09257         missing = 0;
-<a name="l09258"></a>09258         ids = cpl_polynomial_new(1);
-<a name="l09259"></a>09259         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l09260"></a>09260             c = cpl_table_get_double(idscoeff, clab[k], i, &null);
-<a name="l09261"></a>09261             <span class="keywordflow">if</span> (null) {
-<a name="l09262"></a>09262                 cpl_polynomial_delete(ids);
-<a name="l09263"></a>09263                 missing = 1;
-<a name="l09264"></a>09264                 <span class="keywordflow">break</span>;
-<a name="l09265"></a>09265             }
-<a name="l09266"></a>09266             cpl_polynomial_set_coeff(ids, &k, c);
-<a name="l09267"></a>09267         }
-<a name="l09268"></a>09268         <span class="keywordflow">if</span> (missing)
-<a name="l09269"></a>09269             <span class="keywordflow">continue</span>;
-<a name="l09270"></a>09270 
-<a name="l09271"></a>09271         pixstart = cpl_polynomial_eval_1d(ids, firstLambda - refwave, NULL);
-<a name="l09272"></a>09272         pixend = cpl_polynomial_eval_1d(ids, lastLambda - refwave, NULL);
-<a name="l09273"></a>09273         <span class="keywordflow">if</span> (pixstart < 0)
-<a name="l09274"></a>09274             pixstart = 0;
-<a name="l09275"></a>09275         <span class="keywordflow">if</span> (pixend > nx)
-<a name="l09276"></a>09276             pixend = nx;
-<a name="l09277"></a>09277 
-<a name="l09278"></a>09278         <span class="comment">/*</span>
-<a name="l09279"></a>09279 <span class="comment">         * Resampled image:</span>
-<a name="l09280"></a>09280 <span class="comment">         */</span>
-<a name="l09281"></a>09281 
-<a name="l09282"></a>09282         <span class="keywordflow">for</span> (j = 0; j < nl; j++) {
-<a name="l09283"></a>09283             lambda = firstLambda + j * dispersion;
-<a name="l09284"></a>09284             fpixel = cpl_polynomial_eval_1d(ids, lambda - refwave, 
-<a name="l09285"></a>09285                                             &pixel_per_lambda);
-<a name="l09286"></a>09286 
-<a name="l09287"></a>09287             <span class="comment">/*</span>
-<a name="l09288"></a>09288 <span class="comment">             * The local dispersion is 1 / pixel_per_lambda</span>
-<a name="l09289"></a>09289 <span class="comment">             * and this factor is used for applying the flux</span>
-<a name="l09290"></a>09290 <span class="comment">             * conservation correction (if requested).</span>
-<a name="l09291"></a>09291 <span class="comment">             */</span>
-<a name="l09292"></a>09292 
-<a name="l09293"></a>09293             pixel = fpixel;
-<a name="l09294"></a>09294 
-<a name="l09295"></a>09295          <span class="comment">// if (dispersion * pixel_per_lambda < 2.0) {</span>
-<a name="l09296"></a>09296             <span class="keywordflow">if</span> (1) {  <span class="comment">/* Old behaviour: this is safe. */</span>
-<a name="l09297"></a>09297 
-<a name="l09298"></a>09298                 <span class="comment">/*</span>
-<a name="l09299"></a>09299 <span class="comment">                 * In this case we just sample interpolating the</span>
-<a name="l09300"></a>09300 <span class="comment">                 * signal of nearby pixels.</span>
-<a name="l09301"></a>09301 <span class="comment">                 */</span>
-<a name="l09302"></a>09302 
-<a name="l09303"></a>09303                <span class="keywordflow">if</span> (pixel >= 1 && pixel < nx-2) {
-<a name="l09304"></a>09304                    v0 = (sdata + i*nx)[pixel-1];
-<a name="l09305"></a>09305                    v1 = (sdata + i*nx)[pixel];
-<a name="l09306"></a>09306                    v2 = (sdata + i*nx)[pixel+1];
-<a name="l09307"></a>09307                    v3 = (sdata + i*nx)[pixel+2];
-<a name="l09308"></a>09308                    vi = (fpixel-pixel)*(fpixel-pixel)*(v3 - v2 - v1 + v0)
-<a name="l09309"></a>09309                       + (fpixel-pixel)*(3*v2 - v3 - v1 - v0)
-<a name="l09310"></a>09310                       + 2*v1;
-<a name="l09311"></a>09311                    vi /= 2;
-<a name="l09312"></a>09312                    <span class="keywordflow">if</span> (v1 > v2) {
-<a name="l09313"></a>09313                        <span class="keywordflow">if</span> (vi > v1) { 
-<a name="l09314"></a>09314                            vi = v1;
-<a name="l09315"></a>09315                        }
-<a name="l09316"></a>09316                        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (vi < v2) {
-<a name="l09317"></a>09317                            vi = v2;
-<a name="l09318"></a>09318                        }
-<a name="l09319"></a>09319                    }
-<a name="l09320"></a>09320                    <span class="keywordflow">else</span> {
-<a name="l09321"></a>09321                        <span class="keywordflow">if</span> (vi > v2) { 
-<a name="l09322"></a>09322                            vi = v2;
-<a name="l09323"></a>09323                        }
-<a name="l09324"></a>09324                        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (vi < v1) {
-<a name="l09325"></a>09325                            vi = v1;
-<a name="l09326"></a>09326                        }
-<a name="l09327"></a>09327                    }
-<a name="l09328"></a>09328                    <span class="keywordflow">if</span> (flux)
-<a name="l09329"></a>09329                        vi *= dispersion * pixel_per_lambda;
-<a name="l09330"></a>09330                    (rdata + i*nl)[j] = vi;
-<a name="l09331"></a>09331                }
-<a name="l09332"></a>09332                <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pixel >= 0 && pixel < nx-1) {
-<a name="l09333"></a>09333                    v1 = (sdata + i*nx)[pixel];
-<a name="l09334"></a>09334                    v2 = (sdata + i*nx)[pixel+1];
-<a name="l09335"></a>09335                    vi = v1 + (v2-v1)*(fpixel-pixel);
-<a name="l09336"></a>09336                    <span class="keywordflow">if</span> (flux)
-<a name="l09337"></a>09337                        vi *= dispersion * pixel_per_lambda;
-<a name="l09338"></a>09338                    (rdata + i*nl)[j] = vi;
-<a name="l09339"></a>09339                }
-<a name="l09340"></a>09340            }
-<a name="l09341"></a>09341            <span class="keywordflow">else</span> {
-<a name="l09342"></a>09342 
-<a name="l09343"></a>09343                <span class="comment">/*</span>
-<a name="l09344"></a>09344 <span class="comment">                * Here instead we integrate the pixel values in</span>
-<a name="l09345"></a>09345 <span class="comment">                * the interval centered at the interpolation point.</span>
-<a name="l09346"></a>09346 <span class="comment">                * This interval is long dispersion * pixel_per_lambda</span>
-<a name="l09347"></a>09347 <span class="comment">                * of the original pixels, and is centered at fpixel.</span>
-<a name="l09348"></a>09348 <span class="comment">                * So it starts at fpixel - dispersion * pixel_per_lambda / 2,</span>
-<a name="l09349"></a>09349 <span class="comment">                * and it ends at fpixel + dispersion * pixel_per_lambda / 2.</span>
-<a name="l09350"></a>09350 <span class="comment">                */</span>
-<a name="l09351"></a>09351 
-<a name="l09352"></a>09352                <span class="keywordtype">double</span> spos = fpixel - dispersion * pixel_per_lambda / 2;
-<a name="l09353"></a>09353                <span class="keywordtype">double</span> epos = fpixel + dispersion * pixel_per_lambda / 2;
-<a name="l09354"></a>09354 
-<a name="l09355"></a>09355                <span class="comment">/*</span>
-<a name="l09356"></a>09356 <span class="comment">                * Brutal sum over all involved pixels</span>
-<a name="l09357"></a>09357 <span class="comment">                */</span>
-<a name="l09358"></a>09358 
-<a name="l09359"></a>09359                <span class="keywordtype">int</span> spix = spos;
-<a name="l09360"></a>09360                <span class="keywordtype">int</span> epix = epos + 1;
-<a name="l09361"></a>09361 
-<a name="l09362"></a>09362                <span class="keywordflow">if</span> (spix < 0)
-<a name="l09363"></a>09363                    spix = 0;
-<a name="l09364"></a>09364 
-<a name="l09365"></a>09365                <span class="keywordflow">if</span> (epix > nx)
-<a name="l09366"></a>09366                    epix = nx;
-<a name="l09367"></a>09367 
-<a name="l09368"></a>09368                vi = 0.0;
-<a name="l09369"></a>09369                <span class="keywordflow">for</span> (k = spix; k < epix; k++) {
-<a name="l09370"></a>09370                    <span class="keywordflow">if</span> (pixel >= 0 && pixel < nx) {
-<a name="l09371"></a>09371                        vi += (sdata + i*nx)[k];
-<a name="l09372"></a>09372                    }
-<a name="l09373"></a>09373                }
-<a name="l09374"></a>09374 
-<a name="l09375"></a>09375                <span class="comment">/*</span>
-<a name="l09376"></a>09376 <span class="comment">                * Correct integrated flux by true length</span>
-<a name="l09377"></a>09377 <span class="comment">                * of interval. This is clearly an approximation,</span>
-<a name="l09378"></a>09378 <span class="comment">                * but it's good enough if the PSF is much larger</span>
-<a name="l09379"></a>09379 <span class="comment">                * than the original pix.</span>
-<a name="l09380"></a>09380 <span class="comment">                */</span>
-<a name="l09381"></a>09381 
-<a name="l09382"></a>09382                vi *= dispersion * pixel_per_lambda / (epix - spix);
-<a name="l09383"></a>09383 
-<a name="l09384"></a>09384                 <span class="comment">/*</span>
-<a name="l09385"></a>09385 <span class="comment">                 * Flux conservation is a geometric factor that is applied</span>
-<a name="l09386"></a>09386 <span class="comment">                 * always in the same way...</span>
-<a name="l09387"></a>09387 <span class="comment">                 */</span>
-<a name="l09388"></a>09388 
-<a name="l09389"></a>09389                <span class="keywordflow">if</span> (flux)
-<a name="l09390"></a>09390                    vi *= dispersion * pixel_per_lambda;
-<a name="l09391"></a>09391 
-<a name="l09392"></a>09392                (rdata + i*nl)[j] = vi;
-<a name="l09393"></a>09393             }
-<a name="l09394"></a>09394         }
-<a name="l09395"></a>09395 
-<a name="l09396"></a>09396         cpl_polynomial_delete(ids);
-<a name="l09397"></a>09397     }
-<a name="l09398"></a>09398 
-<a name="l09399"></a>09399     <span class="keywordflow">return</span> resampled;
-<a name="l09400"></a>09400 }
-<a name="l09401"></a>09401 
-<a name="l09402"></a>09402 
-<a name="l09469"></a><a class="code" href="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3">09469</a> cpl_table *<a class="code" href="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3">mos_wavelength_align</a>(cpl_image *image, cpl_table *slits, 
-<a name="l09470"></a>09470                                 <span class="keywordtype">double</span> refwave, <span class="keywordtype">double</span> firstLambda, 
-<a name="l09471"></a>09471                                 <span class="keywordtype">double</span> lastLambda, cpl_table *idscoeff,
-<a name="l09472"></a>09472                                 cpl_vector *skylines, <span class="keywordtype">int</span> highres, <span class="keywordtype">int</span> order,
-<a name="l09473"></a>09473                                 cpl_image *calibration, <span class="keywordtype">int</span> sradius)
-<a name="l09474"></a>09474 {
-<a name="l09475"></a>09475     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_wavelength_align"</span>;
-<a name="l09476"></a>09476 
-<a name="l09477"></a>09477     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l09478"></a>09478                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l09479"></a>09479     <span class="keywordtype">double</span>         *line;
-<a name="l09480"></a>09480     <span class="keywordtype">double</span>         *data;
-<a name="l09481"></a>09481     <span class="keywordtype">double</span>          expPos, offset;
-<a name="l09482"></a>09482     <span class="keywordtype">double</span>          c;
-<a name="l09483"></a>09483     <span class="keywordtype">double</span>          lambda1, lambda2;
-<a name="l09484"></a>09484     <span class="keywordtype">double</span>          rms;
-<a name="l09485"></a>09485     <span class="keywordtype">float</span>           pos;
-<a name="l09486"></a>09486     <span class="keywordtype">float</span>          *sdata;
-<a name="l09487"></a>09487     <span class="keywordtype">float</span>          *cdata;
-<a name="l09488"></a>09488     <span class="keywordtype">int</span>            *idata;
-<a name="l09489"></a>09489     <span class="keywordtype">int</span>             startPos, endPos;
-<a name="l09490"></a>09490     <span class="keywordtype">int</span>             window = 2*sradius + 1;
-<a name="l09491"></a>09491     <span class="keywordtype">int</span>             nlines;
-<a name="l09492"></a>09492     <span class="keywordtype">int</span>             nslits;
-<a name="l09493"></a>09493     <span class="keywordtype">int</span>             npoints;
-<a name="l09494"></a>09494     <span class="keywordtype">int</span>             nrows;
-<a name="l09495"></a>09495     <span class="keywordtype">int</span>             nx, ny;
-<a name="l09496"></a>09496     <span class="keywordtype">int</span>             xlow, ylow, xhig, yhig;
-<a name="l09497"></a>09497     <span class="keywordtype">int</span>             idsorder, uorder;
-<a name="l09498"></a>09498     <span class="keywordtype">int</span>            *slit_id;
-<a name="l09499"></a>09499     <span class="keywordtype">int</span>            *position;
-<a name="l09500"></a>09500     <span class="keywordtype">int</span>            *length;
-<a name="l09501"></a>09501     <span class="keywordtype">int</span>             missing;
-<a name="l09502"></a>09502     <span class="keywordtype">int</span>             null;
-<a name="l09503"></a>09503     <span class="keywordtype">int</span>             i;
-<a name="l09504"></a>09504     cpl_size        j, k;
-<a name="l09505"></a>09505 
-<a name="l09506"></a>09506     <span class="keywordtype">char</span>            offname[MAX_COLNAME];
-<a name="l09507"></a>09507     <span class="keywordtype">char</span>            name[MAX_COLNAME];
-<a name="l09508"></a>09508 
-<a name="l09509"></a>09509     cpl_polynomial *ids;
-<a name="l09510"></a>09510     cpl_polynomial *polycorr;
-<a name="l09511"></a>09511     cpl_image      *exslit;
-<a name="l09512"></a>09512     cpl_image      *sky;
-<a name="l09513"></a>09513     cpl_table      *offsets;
-<a name="l09514"></a>09514     cpl_table      *dummy;
-<a name="l09515"></a>09515     cpl_vector     *wave;
-<a name="l09516"></a>09516     cpl_vector     *offs;
-<a name="l09517"></a>09517     
-<a name="l09518"></a>09518 
-<a name="l09519"></a>09519     <span class="keywordflow">if</span> (idscoeff == NULL) {
-<a name="l09520"></a>09520         cpl_msg_error(func, <span class="stringliteral">"An IDS coeff table must be given"</span>);
-<a name="l09521"></a>09521         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l09522"></a>09522         <span class="keywordflow">return</span> NULL;
-<a name="l09523"></a>09523     }
-<a name="l09524"></a>09524 
-<a name="l09525"></a>09525     <span class="keywordflow">if</span> (image == NULL) {
-<a name="l09526"></a>09526         cpl_msg_error(func, <span class="stringliteral">"A scientific spectral image must be given"</span>);
-<a name="l09527"></a>09527         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l09528"></a>09528         <span class="keywordflow">return</span> NULL;
-<a name="l09529"></a>09529     }
-<a name="l09530"></a>09530 
-<a name="l09531"></a>09531     <span class="keywordflow">if</span> (slits == NULL) {
-<a name="l09532"></a>09532         cpl_msg_error(func, <span class="stringliteral">"A slit position table must be given"</span>);
-<a name="l09533"></a>09533         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l09534"></a>09534         <span class="keywordflow">return</span> NULL;
-<a name="l09535"></a>09535     }
-<a name="l09536"></a>09536 
-<a name="l09537"></a>09537     <span class="keywordflow">if</span> (skylines) {
-<a name="l09538"></a>09538         line = cpl_vector_get_data(skylines);
-<a name="l09539"></a>09539         nlines = cpl_vector_get_size(skylines);
-<a name="l09540"></a>09540     }
-<a name="l09541"></a>09541     <span class="keywordflow">else</span> {
-<a name="l09542"></a>09542         cpl_msg_warning(func, <span class="stringliteral">"A catalog of sky lines wavelengths was not "</span>
-<a name="l09543"></a>09543                         <span class="stringliteral">"given: using internal list of reference sky lines"</span>);
-<a name="l09544"></a>09544         <span class="keywordflow">if</span> (highres) {
-<a name="l09545"></a>09545            line = default_lines_hi;
-<a name="l09546"></a>09546            nlines = <span class="keyword">sizeof</span>(default_lines_hi) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);
-<a name="l09547"></a>09547         }
-<a name="l09548"></a>09548         <span class="keywordflow">else</span> {
-<a name="l09549"></a>09549            line = default_lines_lo;
-<a name="l09550"></a>09550            nlines = <span class="keyword">sizeof</span>(default_lines_lo) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);
-<a name="l09551"></a>09551         }
-<a name="l09552"></a>09552     }
-<a name="l09553"></a>09553 
-<a name="l09554"></a>09554     <span class="keywordflow">if</span> (calibration)
-<a name="l09555"></a>09555         cdata = cpl_image_get_data(calibration);
-<a name="l09556"></a>09556 
-<a name="l09557"></a>09557     nx = cpl_image_get_size_x(image);
-<a name="l09558"></a>09558     ny = cpl_image_get_size_y(image);
-<a name="l09559"></a>09559 
-<a name="l09560"></a>09560     nslits   = cpl_table_get_nrow(slits);
-<a name="l09561"></a>09561     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l09562"></a>09562     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);
-<a name="l09563"></a>09563     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l09564"></a>09564 
-<a name="l09565"></a>09565 
-<a name="l09566"></a>09566     <span class="comment">/*</span>
-<a name="l09567"></a>09567 <span class="comment">     * Define the output table of offsets</span>
-<a name="l09568"></a>09568 <span class="comment">     */</span>
-<a name="l09569"></a>09569 
-<a name="l09570"></a>09570     nrows = 0;
-<a name="l09571"></a>09571     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l09572"></a>09572         <span class="keywordflow">if</span> (line[i] > firstLambda && line[i] < lastLambda)
-<a name="l09573"></a>09573             nrows++;
-<a name="l09574"></a>09574 
-<a name="l09575"></a>09575     offsets = cpl_table_new(nrows);
-<a name="l09576"></a>09576     cpl_table_new_column(offsets, <span class="stringliteral">"wave"</span>, CPL_TYPE_DOUBLE);
-<a name="l09577"></a>09577     cpl_table_set_column_unit(offsets, <span class="stringliteral">"wave"</span>, <span class="stringliteral">"Angstrom"</span>);
-<a name="l09578"></a>09578 
-<a name="l09579"></a>09579     nrows = 0;
-<a name="l09580"></a>09580     <span class="keywordflow">for</span> (i = 0; i < nlines; i++) {
-<a name="l09581"></a>09581         <span class="keywordflow">if</span> (line[i] > firstLambda && line[i] < lastLambda) {
-<a name="l09582"></a>09582             cpl_table_set_double(offsets, <span class="stringliteral">"wave"</span>, nrows, line[i]);
-<a name="l09583"></a>09583             nrows++;
-<a name="l09584"></a>09584         }
-<a name="l09585"></a>09585     }
-<a name="l09586"></a>09586 
-<a name="l09587"></a>09587     <span class="comment">/*</span>
-<a name="l09588"></a>09588 <span class="comment">     * Here "line" is made to point to the new list of selected wavelengths</span>
-<a name="l09589"></a>09589 <span class="comment">     */</span>
-<a name="l09590"></a>09590 
-<a name="l09591"></a>09591     line = cpl_table_get_data_double(offsets, <span class="stringliteral">"wave"</span>);
-<a name="l09592"></a>09592     nlines = nrows;
-<a name="l09593"></a>09593 
-<a name="l09594"></a>09594     idsorder = 0;
-<a name="l09595"></a>09595     <span class="keywordflow">while</span> (idsorder < 6 && cpl_table_has_column(idscoeff, clab[idsorder]))
-<a name="l09596"></a>09596         ++idsorder;
-<a name="l09597"></a>09597     --idsorder;
-<a name="l09598"></a>09598 
-<a name="l09599"></a>09599     xlow = 1;
-<a name="l09600"></a>09600     xhig = nx;
-<a name="l09601"></a>09601     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l09602"></a>09602 
-<a name="l09603"></a>09603         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l09604"></a>09604             <span class="keywordflow">continue</span>;
-<a name="l09605"></a>09605 
-<a name="l09606"></a>09606         snprintf(offname, MAX_COLNAME, <span class="stringliteral">"offset%d"</span>, slit_id[i]);
-<a name="l09607"></a>09607         cpl_table_new_column(offsets, offname, CPL_TYPE_DOUBLE);
-<a name="l09608"></a>09608 
-<a name="l09609"></a>09609         <span class="comment">/* </span>
-<a name="l09610"></a>09610 <span class="comment">         * Define the extraction boundaries. We DON'T write:</span>
-<a name="l09611"></a>09611 <span class="comment">         *</span>
-<a name="l09612"></a>09612 <span class="comment">         * ylow = position[i];</span>
-<a name="l09613"></a>09613 <span class="comment">         * yhig = ylow + length[i];</span>
-<a name="l09614"></a>09614 <span class="comment">         *</span>
-<a name="l09615"></a>09615 <span class="comment">         * because the cpl_image pixels are counted from 1, and because in</span>
-<a name="l09616"></a>09616 <span class="comment">         * cpl_image_extract() the coordinates of the last pixel are inclusive.</span>
-<a name="l09617"></a>09617 <span class="comment">         */</span>
-<a name="l09618"></a>09618 
-<a name="l09619"></a>09619         ylow = position[i] + 1;
-<a name="l09620"></a>09620         yhig = ylow + length[i] - 1;
-<a name="l09621"></a>09621 
-<a name="l09622"></a>09622         exslit = cpl_image_extract(image, xlow, ylow, xhig, yhig);
-<a name="l09623"></a>09623         sky    = cpl_image_collapse_median_create(exslit, 0, 0, 1);
-<a name="l09624"></a>09624         sdata  = cpl_image_get_data(sky);
-<a name="l09625"></a>09625 
-<a name="l09626"></a>09626         cpl_image_delete(exslit);
-<a name="l09627"></a>09627 
-<a name="l09628"></a>09628         <span class="comment">/* </span>
-<a name="l09629"></a>09629 <span class="comment">         * Return here to a decent way of counting pixels (i.e., starting</span>
-<a name="l09630"></a>09630 <span class="comment">         * from 0)</span>
-<a name="l09631"></a>09631 <span class="comment">         */</span>
-<a name="l09632"></a>09632          
-<a name="l09633"></a>09633         ylow--;
-<a name="l09634"></a>09634 
-<a name="l09635"></a>09635         <span class="comment">/*</span>
-<a name="l09636"></a>09636 <span class="comment">         * Allocate a dummy table for collecting all the offsets</span>
-<a name="l09637"></a>09637 <span class="comment">         * for all the lines: this is only needed for the computation</span>
-<a name="l09638"></a>09638 <span class="comment">         * of the median offset for each sky line</span>
-<a name="l09639"></a>09639 <span class="comment">         */</span>
-<a name="l09640"></a>09640 
-<a name="l09641"></a>09641         dummy = cpl_table_new(yhig - ylow);
-<a name="l09642"></a>09642         <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {
-<a name="l09643"></a>09643             snprintf(name, MAX_COLNAME, <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT, j);
-<a name="l09644"></a>09644             cpl_table_new_column(dummy, name, CPL_TYPE_DOUBLE);
-<a name="l09645"></a>09645         }
-<a name="l09646"></a>09646 
-<a name="l09647"></a>09647         <span class="keywordflow">for</span> (j = ylow; j < yhig; j++) {
-<a name="l09648"></a>09648 
-<a name="l09649"></a>09649             <span class="comment">/*</span>
-<a name="l09650"></a>09650 <span class="comment">             * Get the IDS polynomial for the current slit row</span>
-<a name="l09651"></a>09651 <span class="comment">             */</span>
-<a name="l09652"></a>09652 
-<a name="l09653"></a>09653             missing = 0;
-<a name="l09654"></a>09654             ids = cpl_polynomial_new(1);
-<a name="l09655"></a>09655             <span class="keywordflow">for</span> (k = 0; k <= idsorder; k++) {
-<a name="l09656"></a>09656                 c = cpl_table_get_double(idscoeff, clab[k], j, &null);
-<a name="l09657"></a>09657                 <span class="keywordflow">if</span> (null) {
-<a name="l09658"></a>09658                     cpl_polynomial_delete(ids);
-<a name="l09659"></a>09659                     missing = 1;
-<a name="l09660"></a>09660                     <span class="keywordflow">break</span>;
-<a name="l09661"></a>09661                 }
-<a name="l09662"></a>09662                 cpl_polynomial_set_coeff(ids, &k, c);
-<a name="l09663"></a>09663             }
-<a name="l09664"></a>09664             <span class="keywordflow">if</span> (missing)
-<a name="l09665"></a>09665                 <span class="keywordflow">continue</span>;
-<a name="l09666"></a>09666 
-<a name="l09667"></a>09667             <span class="keywordflow">for</span> (k = 0; k < nlines; k++) {
-<a name="l09668"></a>09668                 expPos = cpl_polynomial_eval_1d(ids, line[k] - refwave, NULL);
-<a name="l09669"></a>09669                 startPos = expPos - sradius;
-<a name="l09670"></a>09670                 endPos   = startPos + window;
-<a name="l09671"></a>09671                 <span class="keywordflow">if</span> (startPos < 0 || endPos >= nx)
-<a name="l09672"></a>09672                     <span class="keywordflow">continue</span>;
-<a name="l09673"></a>09673            
-<a name="l09674"></a>09674                 <span class="keywordflow">if</span> (0 == <a class="code" href="group__moses.html#g56f03689ea7eaf37395dbb26a24e3fcf">peakPosition</a>(sdata + startPos, window, &pos, 1)) {
-<a name="l09675"></a>09675                     pos += startPos;
-<a name="l09676"></a>09676                     offset = pos - expPos;
-<a name="l09677"></a>09677                     snprintf(name, MAX_COLNAME, <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT, k);
-<a name="l09678"></a>09678                     cpl_table_set_double(dummy, name, j - ylow, offset);
-<a name="l09679"></a>09679                 }
-<a name="l09680"></a>09680             }
-<a name="l09681"></a>09681 
-<a name="l09682"></a>09682             cpl_polynomial_delete(ids);
-<a name="l09683"></a>09683         }
-<a name="l09684"></a>09684 
-<a name="l09685"></a>09685         cpl_image_delete(sky);
-<a name="l09686"></a>09686 
-<a name="l09687"></a>09687         <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {
-<a name="l09688"></a>09688             snprintf(name, MAX_COLNAME, <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT, j);
-<a name="l09689"></a>09689             <span class="keywordflow">if</span> (cpl_table_has_valid(dummy, name)) {
-<a name="l09690"></a>09690                 offset = cpl_table_get_column_median(dummy, name);
-<a name="l09691"></a>09691                 cpl_table_set_double(offsets, offname, j, offset);
-<a name="l09692"></a>09692             }
-<a name="l09693"></a>09693         }
-<a name="l09694"></a>09694 
-<a name="l09695"></a>09695         cpl_table_delete(dummy);
-<a name="l09696"></a>09696 
-<a name="l09697"></a>09697     }
-<a name="l09698"></a>09698 
-<a name="l09699"></a>09699 
-<a name="l09700"></a>09700     <span class="comment">/*</span>
-<a name="l09701"></a>09701 <span class="comment">     * In the following the input idscoeff table is modified by simply</span>
-<a name="l09702"></a>09702 <span class="comment">     * adding the coefficients of the polynomial used to fit the sky</span>
-<a name="l09703"></a>09703 <span class="comment">     * line residuals to the coefficients of the IDS polynomials.</span>
-<a name="l09704"></a>09704 <span class="comment">     */</span>
-<a name="l09705"></a>09705 
-<a name="l09706"></a>09706     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l09707"></a>09707 
-<a name="l09708"></a>09708         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l09709"></a>09709             <span class="keywordflow">continue</span>;
-<a name="l09710"></a>09710 
-<a name="l09711"></a>09711         snprintf(offname, MAX_COLNAME, <span class="stringliteral">"offset%d"</span>, slit_id[i]);
-<a name="l09712"></a>09712 
-<a name="l09713"></a>09713         <span class="comment">/*</span>
-<a name="l09714"></a>09714 <span class="comment">         * In the following, the "dummy" table is just a tool for</span>
-<a name="l09715"></a>09715 <span class="comment">         * eliminating invalid points from the vectors to be fitted.</span>
-<a name="l09716"></a>09716 <span class="comment">         */</span>
-<a name="l09717"></a>09717 
-<a name="l09718"></a>09718         dummy = cpl_table_new(nlines);
-<a name="l09719"></a>09719         cpl_table_duplicate_column(dummy, <span class="stringliteral">"wave"</span>, offsets, <span class="stringliteral">"wave"</span>);
-<a name="l09720"></a>09720         cpl_table_duplicate_column(dummy, <span class="stringliteral">"offset"</span>, offsets, offname);
-<a name="l09721"></a>09721 
-<a name="l09722"></a>09722         npoints = nlines - cpl_table_count_invalid(dummy, <span class="stringliteral">"offset"</span>);
-<a name="l09723"></a>09723         <span class="keywordflow">if</span> (npoints == 0) {
-<a name="l09724"></a>09724             cpl_msg_warning(func, <span class="stringliteral">"No sky lines alignment was possible "</span>
-<a name="l09725"></a>09725                             <span class="stringliteral">"for slit ID=%d: no sky line found"</span>, slit_id[i]);
-<a name="l09726"></a>09726             cpl_table_delete(dummy);
-<a name="l09727"></a>09727             <span class="keywordflow">continue</span>;
-<a name="l09728"></a>09728         }
-<a name="l09729"></a>09729 
-<a name="l09730"></a>09730         uorder = order;
-<a name="l09731"></a>09731         <span class="keywordflow">if</span> (npoints <= uorder) {
-<a name="l09732"></a>09732             uorder = npoints - 1;
-<a name="l09733"></a>09733             <span class="keywordflow">if</span> (uorder) {
-<a name="l09734"></a>09734                 cpl_msg_warning(func, <span class="stringliteral">"Just %d sky lines detected for slit "</span>
-<a name="l09735"></a>09735                                 <span class="stringliteral">"ID=%d, while a polynomial order %d was "</span>
-<a name="l09736"></a>09736                                 <span class="stringliteral">"requested. Using polynomial order %d for "</span>
-<a name="l09737"></a>09737                                 <span class="stringliteral">"this slit!"</span>, npoints, slit_id[i], order, 
-<a name="l09738"></a>09738                                 uorder);
-<a name="l09739"></a>09739             }
-<a name="l09740"></a>09740             <span class="keywordflow">else</span> {
-<a name="l09741"></a>09741                 cpl_msg_warning(func, <span class="stringliteral">"Just %d sky lines detected for slit "</span>
-<a name="l09742"></a>09742                                 <span class="stringliteral">"ID=%d, while a polynomial order %d was "</span>
-<a name="l09743"></a>09743                                 <span class="stringliteral">"requested. Computing a median offset for "</span>
-<a name="l09744"></a>09744                                 <span class="stringliteral">"this slit!"</span>, npoints, slit_id[i], order);
-<a name="l09745"></a>09745             }
-<a name="l09746"></a>09746         }
-<a name="l09747"></a>09747 
-<a name="l09748"></a>09748         cpl_table_erase_invalid(dummy);
-<a name="l09749"></a>09749 
-<a name="l09750"></a>09750         <span class="keywordflow">if</span> (uorder > 1) {
-<a name="l09751"></a>09751 
-<a name="l09752"></a>09752             <span class="comment">/*</span>
-<a name="l09753"></a>09753 <span class="comment">             * Model offsets with polynomial fitting</span>
-<a name="l09754"></a>09754 <span class="comment">             */</span>
-<a name="l09755"></a>09755 
-<a name="l09756"></a>09756             wave = cpl_vector_wrap(npoints,
-<a name="l09757"></a>09757                                    cpl_table_get_data_double(dummy, <span class="stringliteral">"wave"</span>));
-<a name="l09758"></a>09758             offs = cpl_vector_wrap(npoints,
-<a name="l09759"></a>09759                                    cpl_table_get_data_double(dummy, <span class="stringliteral">"offset"</span>));
-<a name="l09760"></a>09760 
-<a name="l09761"></a>09761             <span class="comment">/*</span>
-<a name="l09762"></a>09762 <span class="comment">             * Set reference wavelength as zero point</span>
-<a name="l09763"></a>09763 <span class="comment">             */</span>
-<a name="l09764"></a>09764 
-<a name="l09765"></a>09765             cpl_vector_subtract_scalar(wave, refwave);
-<a name="l09766"></a>09766 
-<a name="l09767"></a>09767             polycorr = cpl_polynomial_fit_1d_create(wave, offs, uorder, &rms);
-<a name="l09768"></a>09768 
-<a name="l09769"></a>09769             rms = sqrt(rms * (uorder + 1) / npoints);
-<a name="l09770"></a>09770 
-<a name="l09771"></a>09771             cpl_vector_unwrap(wave);
-<a name="l09772"></a>09772             cpl_vector_unwrap(offs);
-<a name="l09773"></a>09773             cpl_table_delete(dummy);
-<a name="l09774"></a>09774 
-<a name="l09775"></a>09775             <span class="comment">/*</span>
-<a name="l09776"></a>09776 <span class="comment">             * Now correct the coefficients of the corresponding IDS</span>
-<a name="l09777"></a>09777 <span class="comment">             * polynomials related to this slit:</span>
-<a name="l09778"></a>09778 <span class="comment">             */</span>
-<a name="l09779"></a>09779 
-<a name="l09780"></a>09780             ylow = position[i];
-<a name="l09781"></a>09781             yhig = ylow + length[i];
-<a name="l09782"></a>09782 
-<a name="l09783"></a>09783             <span class="keywordflow">for</span> (j = 0; j <= uorder; j++) {
-<a name="l09784"></a>09784                 data = cpl_table_get_data_double(idscoeff, clab[j]);
-<a name="l09785"></a>09785                 c = cpl_polynomial_get_coeff(polycorr, &j);
-<a name="l09786"></a>09786                 <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)
-<a name="l09787"></a>09787                     data[k] += c;
-<a name="l09788"></a>09788             }
-<a name="l09789"></a>09789 
-<a name="l09790"></a>09790             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l09791"></a>09791             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)
-<a name="l09792"></a>09792                  data[k] = sqrt(data[k]*data[k] + rms*rms);
-<a name="l09793"></a>09793 
-<a name="l09794"></a>09794             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);
-<a name="l09795"></a>09795             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)
-<a name="l09796"></a>09796                  idata[k] = npoints;
-<a name="l09797"></a>09797 
-<a name="l09798"></a>09798             <span class="comment">/*</span>
-<a name="l09799"></a>09799 <span class="comment">             * If a wavelengths map was provided, correct it to keep</span>
-<a name="l09800"></a>09800 <span class="comment">             * into account the alignment to skylines:</span>
-<a name="l09801"></a>09801 <span class="comment">             */</span>
-<a name="l09802"></a>09802 
-<a name="l09803"></a>09803             <span class="keywordflow">if</span> (calibration) {
-<a name="l09804"></a>09804                 <span class="keywordflow">for</span> (j = ylow; j < yhig; j++) {
-<a name="l09805"></a>09805                     <span class="keywordflow">for</span> (k = 1; k < nx; k++) {
-<a name="l09806"></a>09806                         lambda1 = cdata[k - 1 + j*nx];
-<a name="l09807"></a>09807                         lambda2 = cdata[k + j*nx];
-<a name="l09808"></a>09808                         <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)
-<a name="l09809"></a>09809                             <span class="keywordflow">continue</span>;
-<a name="l09810"></a>09810                         offset = cpl_polynomial_eval_1d(polycorr, 
-<a name="l09811"></a>09811                                                         lambda1-refwave, NULL);
-<a name="l09812"></a>09812                         cdata[k - 1 + j*nx] -= offset * (lambda2-lambda1);
-<a name="l09813"></a>09813                     }
-<a name="l09814"></a>09814                 }
-<a name="l09815"></a>09815             }
-<a name="l09816"></a>09816     
-<a name="l09817"></a>09817             cpl_polynomial_delete(polycorr);
-<a name="l09818"></a>09818         }
-<a name="l09819"></a>09819         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (uorder == 1) {
-<a name="l09820"></a>09820 
-<a name="l09821"></a>09821             <span class="comment">/*</span>
-<a name="l09822"></a>09822 <span class="comment">             * Model offsets with robust linear fitting</span>
-<a name="l09823"></a>09823 <span class="comment">             */</span>
-<a name="l09824"></a>09824 
-<a name="l09825"></a>09825             <span class="keywordtype">double</span>        q, m;
-<a name="l09826"></a>09826             cpl_bivector *<a class="code" href="structlist.html">list</a>;
-<a name="l09827"></a>09827 
-<a name="l09828"></a>09828 
-<a name="l09829"></a>09829             wave = cpl_vector_wrap(npoints,
-<a name="l09830"></a>09830                                    cpl_table_get_data_double(dummy, <span class="stringliteral">"wave"</span>));
-<a name="l09831"></a>09831             offs = cpl_vector_wrap(npoints,
-<a name="l09832"></a>09832                                    cpl_table_get_data_double(dummy, <span class="stringliteral">"offset"</span>));
-<a name="l09833"></a>09833 
-<a name="l09834"></a>09834             list = cpl_bivector_wrap_vectors(wave, offs);
-<a name="l09835"></a>09835 
-<a name="l09836"></a>09836             <span class="comment">/*</span>
-<a name="l09837"></a>09837 <span class="comment">             * Set reference wavelength as zero point</span>
-<a name="l09838"></a>09838 <span class="comment">             */</span>
-<a name="l09839"></a>09839 
-<a name="l09840"></a>09840             cpl_vector_subtract_scalar(wave, refwave);
-<a name="l09841"></a>09841 
-<a name="l09842"></a>09842             <a class="code" href="group__moses.html#g4b6606e2a44434b722cb25862567e4ff">robustLinearFit</a>(list, &q, &m, &rms);
-<a name="l09843"></a>09843 
-<a name="l09844"></a>09844             rms = sqrt(rms * (uorder + 1) / npoints);
-<a name="l09845"></a>09845 
-<a name="l09846"></a>09846             cpl_bivector_unwrap_vectors(list);
-<a name="l09847"></a>09847             cpl_vector_unwrap(wave);
-<a name="l09848"></a>09848             cpl_vector_unwrap(offs);
-<a name="l09849"></a>09849             cpl_table_delete(dummy);
-<a name="l09850"></a>09850 
-<a name="l09851"></a>09851             <span class="comment">/*</span>
-<a name="l09852"></a>09852 <span class="comment">             * Now correct the coefficients of the corresponding IDS</span>
-<a name="l09853"></a>09853 <span class="comment">             * polynomials related to this slit:</span>
-<a name="l09854"></a>09854 <span class="comment">             */</span>
-<a name="l09855"></a>09855 
-<a name="l09856"></a>09856             ylow = position[i];
-<a name="l09857"></a>09857             yhig = ylow + length[i];
-<a name="l09858"></a>09858 
-<a name="l09859"></a>09859             <span class="keywordflow">for</span> (j = 0; j <= uorder; j++) {
-<a name="l09860"></a>09860                 data = cpl_table_get_data_double(idscoeff, clab[j]);
-<a name="l09861"></a>09861                 <span class="keywordflow">if</span> (j)
-<a name="l09862"></a>09862                     c = m;
-<a name="l09863"></a>09863                 <span class="keywordflow">else</span>
-<a name="l09864"></a>09864                     c = q;
-<a name="l09865"></a>09865                 <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)
-<a name="l09866"></a>09866                     data[k] += c;
-<a name="l09867"></a>09867             }
-<a name="l09868"></a>09868 
-<a name="l09869"></a>09869             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l09870"></a>09870             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)
-<a name="l09871"></a>09871                  data[k] = sqrt(data[k]*data[k] + rms*rms);
-<a name="l09872"></a>09872 
-<a name="l09873"></a>09873             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);
-<a name="l09874"></a>09874             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)
-<a name="l09875"></a>09875                  idata[k] = npoints;
-<a name="l09876"></a>09876 
-<a name="l09877"></a>09877             <span class="comment">/*</span>
-<a name="l09878"></a>09878 <span class="comment">             * If a wavelengths map was provided, correct it to keep</span>
-<a name="l09879"></a>09879 <span class="comment">             * into account the alignment to skylines:</span>
-<a name="l09880"></a>09880 <span class="comment">             */</span>
-<a name="l09881"></a>09881 
-<a name="l09882"></a>09882             <span class="keywordflow">if</span> (calibration) {
-<a name="l09883"></a>09883                 <span class="keywordflow">for</span> (j = ylow; j < yhig; j++) {
-<a name="l09884"></a>09884                     <span class="keywordflow">for</span> (k = 1; k < nx; k++) {
-<a name="l09885"></a>09885                         lambda1 = cdata[k - 1 + j*nx];
-<a name="l09886"></a>09886                         lambda2 = cdata[k + j*nx];
-<a name="l09887"></a>09887                         <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)
-<a name="l09888"></a>09888                             <span class="keywordflow">continue</span>;
-<a name="l09889"></a>09889                         offset = q + m*(lambda1-refwave);
-<a name="l09890"></a>09890                         cdata[k - 1 + j*nx] -= offset * (lambda2-lambda1);
-<a name="l09891"></a>09891                     }
-<a name="l09892"></a>09892                 }
-<a name="l09893"></a>09893             }
-<a name="l09894"></a>09894         }
-<a name="l09895"></a>09895         <span class="keywordflow">else</span> {
-<a name="l09896"></a>09896 
-<a name="l09897"></a>09897             <span class="comment">/*</span>
-<a name="l09898"></a>09898 <span class="comment">             * Just compute median offset</span>
-<a name="l09899"></a>09899 <span class="comment">             */</span>
-<a name="l09900"></a>09900 
-<a name="l09901"></a>09901             offs = cpl_vector_wrap(npoints,
-<a name="l09902"></a>09902                                    cpl_table_get_data_double(dummy, <span class="stringliteral">"offset"</span>));
-<a name="l09903"></a>09903 
-<a name="l09904"></a>09904             offset = cpl_vector_get_median_const(offs);
-<a name="l09905"></a>09905 
-<a name="l09906"></a>09906             <span class="keywordflow">if</span> (npoints > 1)
-<a name="l09907"></a>09907                 rms = cpl_table_get_column_stdev(dummy, <span class="stringliteral">"offset"</span>);
-<a name="l09908"></a>09908             <span class="keywordflow">else</span>
-<a name="l09909"></a>09909                 rms = 0.0;
-<a name="l09910"></a>09910 
-<a name="l09911"></a>09911             rms /= sqrt(npoints);
-<a name="l09912"></a>09912 
-<a name="l09913"></a>09913             cpl_vector_unwrap(offs);
-<a name="l09914"></a>09914             cpl_table_delete(dummy);
-<a name="l09915"></a>09915 
-<a name="l09916"></a>09916             <span class="comment">/*</span>
-<a name="l09917"></a>09917 <span class="comment">             * Now correct the constant term of the corresponding IDS</span>
-<a name="l09918"></a>09918 <span class="comment">             * polynomials related to this slit:</span>
-<a name="l09919"></a>09919 <span class="comment">             */</span>
-<a name="l09920"></a>09920 
-<a name="l09921"></a>09921             ylow = position[i];
-<a name="l09922"></a>09922             yhig = ylow + length[i];
-<a name="l09923"></a>09923 
-<a name="l09924"></a>09924             data = cpl_table_get_data_double(idscoeff, clab[0]);
-<a name="l09925"></a>09925             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)
-<a name="l09926"></a>09926                 data[k] += offset;
-<a name="l09927"></a>09927 
-<a name="l09928"></a>09928             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l09929"></a>09929             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)
-<a name="l09930"></a>09930                  data[k] = sqrt(data[k]*data[k] + rms*rms);
-<a name="l09931"></a>09931 
-<a name="l09932"></a>09932             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);
-<a name="l09933"></a>09933             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)
-<a name="l09934"></a>09934                  idata[k] = npoints;
-<a name="l09935"></a>09935 
-<a name="l09936"></a>09936             <span class="comment">/*</span>
-<a name="l09937"></a>09937 <span class="comment">             * If a wavelengths map was provided, correct it to keep</span>
-<a name="l09938"></a>09938 <span class="comment">             * into account the alignment to skylines. Note that </span>
-<a name="l09939"></a>09939 <span class="comment">             * the offset must be converted from pixels to wavelengths.</span>
-<a name="l09940"></a>09940 <span class="comment">             */</span>
-<a name="l09941"></a>09941 
-<a name="l09942"></a>09942             <span class="keywordflow">if</span> (calibration) {
-<a name="l09943"></a>09943                 <span class="keywordflow">for</span> (j = ylow; j < yhig; j++) {
-<a name="l09944"></a>09944                     <span class="keywordflow">for</span> (k = 1; k < nx; k++) {
-<a name="l09945"></a>09945                         lambda1 = cdata[k - 1 + j*nx];
-<a name="l09946"></a>09946                         lambda2 = cdata[k + j*nx];
-<a name="l09947"></a>09947                         <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)
-<a name="l09948"></a>09948                             <span class="keywordflow">continue</span>; 
-<a name="l09949"></a>09949                         cdata[k - 1 + j*nx] -= offset * (lambda2-lambda1);
-<a name="l09950"></a>09950                     }
-<a name="l09951"></a>09951                 }
-<a name="l09952"></a>09952             }
-<a name="l09953"></a>09953         }
-<a name="l09954"></a>09954     }
-<a name="l09955"></a>09955 
-<a name="l09956"></a>09956     <span class="keywordflow">return</span> offsets;
-<a name="l09957"></a>09957 
-<a name="l09958"></a>09958 }
-<a name="l09959"></a>09959 
-<a name="l09960"></a>09960 
-<a name="l10022"></a><a class="code" href="group__moses.html#g2523d130beaf8538187729f767c38805">10022</a> cpl_table *<a class="code" href="group__moses.html#g2523d130beaf8538187729f767c38805">mos_wavelength_align_lss</a>(cpl_image *image, <span class="keywordtype">double</span> refwave, 
-<a name="l10023"></a>10023                                     <span class="keywordtype">double</span> firstLambda, <span class="keywordtype">double</span> lastLambda, 
-<a name="l10024"></a>10024                                     cpl_table *idscoeff, cpl_vector *skylines, 
-<a name="l10025"></a>10025                                     <span class="keywordtype">int</span> highres, <span class="keywordtype">int</span> order, 
-<a name="l10026"></a>10026                                     cpl_image *calibration, <span class="keywordtype">int</span> sradius)
-<a name="l10027"></a>10027 {
-<a name="l10028"></a>10028     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_wavelength_align_lss"</span>;
-<a name="l10029"></a>10029 
-<a name="l10030"></a>10030     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l10031"></a>10031                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l10032"></a>10032     <span class="keywordtype">double</span>         *line;
-<a name="l10033"></a>10033     <span class="keywordtype">double</span>         *data;
-<a name="l10034"></a>10034     <span class="keywordtype">double</span>         *wdata;
-<a name="l10035"></a>10035     <span class="keywordtype">double</span>         *odata;
-<a name="l10036"></a>10036     <span class="keywordtype">double</span>          expPos, offset;
-<a name="l10037"></a>10037     <span class="keywordtype">double</span>          c;
-<a name="l10038"></a>10038     <span class="keywordtype">double</span>          lambda1, lambda2;
-<a name="l10039"></a>10039     <span class="keywordtype">double</span>          rms;
-<a name="l10040"></a>10040     <span class="keywordtype">float</span>           pos;
-<a name="l10041"></a>10041     <span class="keywordtype">float</span>          *sdata;
-<a name="l10042"></a>10042     <span class="keywordtype">float</span>          *cdata;
-<a name="l10043"></a>10043     <span class="keywordtype">int</span>            *idata;
-<a name="l10044"></a>10044     <span class="keywordtype">int</span>             startPos, endPos;
-<a name="l10045"></a>10045     <span class="keywordtype">int</span>             window = 2*sradius + 1;
-<a name="l10046"></a>10046     <span class="keywordtype">int</span>             nlines;
-<a name="l10047"></a>10047     <span class="keywordtype">int</span>             npoints;
-<a name="l10048"></a>10048     <span class="keywordtype">int</span>             nrows;
-<a name="l10049"></a>10049     <span class="keywordtype">int</span>             nx, ny;
-<a name="l10050"></a>10050     <span class="keywordtype">int</span>             idsorder, uorder;
-<a name="l10051"></a>10051     <span class="keywordtype">int</span>             missing;
-<a name="l10052"></a>10052     <span class="keywordtype">int</span>             i;
-<a name="l10053"></a>10053     cpl_size        j, k;
-<a name="l10054"></a>10054 
-<a name="l10055"></a>10055     <span class="keywordtype">char</span>            name[MAX_COLNAME];
-<a name="l10056"></a>10056     <span class="keywordtype">char</span>            fname[MAX_COLNAME];
-<a name="l10057"></a>10057 
-<a name="l10058"></a>10058     cpl_polynomial *ids;
-<a name="l10059"></a>10059     cpl_polynomial *polycorr;
-<a name="l10060"></a>10060     cpl_table      *offsets;
-<a name="l10061"></a>10061     cpl_table      *fittable;
-<a name="l10062"></a>10062     cpl_table      *dummy;
-<a name="l10063"></a>10063     cpl_vector     *wave;
-<a name="l10064"></a>10064     cpl_vector     *offs;
-<a name="l10065"></a>10065     cpl_vector     *row;
-<a name="l10066"></a>10066     
-<a name="l10067"></a>10067 
-<a name="l10068"></a>10068     <span class="keywordflow">if</span> (idscoeff == NULL) {
-<a name="l10069"></a>10069         cpl_msg_error(func, <span class="stringliteral">"An IDS coeff table must be given"</span>);
-<a name="l10070"></a>10070         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l10071"></a>10071         <span class="keywordflow">return</span> NULL;
-<a name="l10072"></a>10072     }
-<a name="l10073"></a>10073 
-<a name="l10074"></a>10074     <span class="keywordflow">if</span> (image == NULL) {
-<a name="l10075"></a>10075         cpl_msg_error(func, <span class="stringliteral">"A scientific spectral image must be given"</span>);
-<a name="l10076"></a>10076         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l10077"></a>10077         <span class="keywordflow">return</span> NULL;
-<a name="l10078"></a>10078     }
-<a name="l10079"></a>10079 
-<a name="l10080"></a>10080     <span class="keywordflow">if</span> (skylines) {
-<a name="l10081"></a>10081         line = cpl_vector_get_data(skylines);
-<a name="l10082"></a>10082         nlines = cpl_vector_get_size(skylines);
-<a name="l10083"></a>10083     }
-<a name="l10084"></a>10084     <span class="keywordflow">else</span> {
-<a name="l10085"></a>10085         cpl_msg_warning(func, <span class="stringliteral">"A catalog of sky lines wavelengths was not "</span>
-<a name="l10086"></a>10086                         <span class="stringliteral">"given: using internal list of reference sky lines"</span>);
-<a name="l10087"></a>10087         <span class="keywordflow">if</span> (highres) {
-<a name="l10088"></a>10088            line = default_lines_hi;
-<a name="l10089"></a>10089            nlines = <span class="keyword">sizeof</span>(default_lines_hi) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);
-<a name="l10090"></a>10090         }
-<a name="l10091"></a>10091         <span class="keywordflow">else</span> {
-<a name="l10092"></a>10092            line = default_lines_lo;
-<a name="l10093"></a>10093            nlines = <span class="keyword">sizeof</span>(default_lines_lo) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);
-<a name="l10094"></a>10094         }
-<a name="l10095"></a>10095     }
-<a name="l10096"></a>10096 
-<a name="l10097"></a>10097     <span class="keywordflow">if</span> (calibration)
-<a name="l10098"></a>10098         cdata = cpl_image_get_data(calibration);
-<a name="l10099"></a>10099 
-<a name="l10100"></a>10100     nx = cpl_image_get_size_x(image);
-<a name="l10101"></a>10101     ny = cpl_image_get_size_y(image);
-<a name="l10102"></a>10102 
-<a name="l10103"></a>10103     sdata = cpl_image_get_data(image);
-<a name="l10104"></a>10104 
-<a name="l10105"></a>10105     <span class="keywordflow">if</span> (ny != cpl_table_get_nrow(idscoeff)) {
-<a name="l10106"></a>10106         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l10107"></a>10107         <span class="keywordflow">return</span> NULL;
-<a name="l10108"></a>10108     }
-<a name="l10109"></a>10109     
-<a name="l10110"></a>10110 
-<a name="l10111"></a>10111     <span class="comment">/*FIXME: This is a remnant of the adaptation of the function</span>
-<a name="l10112"></a>10112 <span class="comment">     * mos_wavelength_align(), where an offset table was created.</span>
-<a name="l10113"></a>10113 <span class="comment">     * I leave it here because I am in a hurry, it is just used to</span>
-<a name="l10114"></a>10114 <span class="comment">     * hold the list of selected sky lines.</span>
-<a name="l10115"></a>10115 <span class="comment">     *</span>
-<a name="l10116"></a>10116 <span class="comment">     * Define table of wavelengths</span>
-<a name="l10117"></a>10117 <span class="comment">     */</span>
-<a name="l10118"></a>10118 
-<a name="l10119"></a>10119     nrows = 0;
-<a name="l10120"></a>10120     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l10121"></a>10121         <span class="keywordflow">if</span> (line[i] > firstLambda && line[i] < lastLambda)
-<a name="l10122"></a>10122             nrows++;
-<a name="l10123"></a>10123 
-<a name="l10124"></a>10124     offsets = cpl_table_new(nrows);
-<a name="l10125"></a>10125     cpl_table_new_column(offsets, <span class="stringliteral">"wave"</span>, CPL_TYPE_DOUBLE);
-<a name="l10126"></a>10126     cpl_table_set_column_unit(offsets, <span class="stringliteral">"wave"</span>, <span class="stringliteral">"Angstrom"</span>);
-<a name="l10127"></a>10127 
-<a name="l10128"></a>10128     nrows = 0;
-<a name="l10129"></a>10129     <span class="keywordflow">for</span> (i = 0; i < nlines; i++) {
-<a name="l10130"></a>10130         <span class="keywordflow">if</span> (line[i] > firstLambda && line[i] < lastLambda) {
-<a name="l10131"></a>10131             cpl_table_set_double(offsets, <span class="stringliteral">"wave"</span>, nrows, line[i]);
-<a name="l10132"></a>10132             nrows++;
-<a name="l10133"></a>10133         }
-<a name="l10134"></a>10134     }
-<a name="l10135"></a>10135 
-<a name="l10136"></a>10136     <span class="comment">/*</span>
-<a name="l10137"></a>10137 <span class="comment">     * Here "line" is made to point to the new list of selected wavelengths</span>
-<a name="l10138"></a>10138 <span class="comment">     */</span>
-<a name="l10139"></a>10139 
-<a name="l10140"></a>10140     line = cpl_table_get_data_double(offsets, <span class="stringliteral">"wave"</span>);
-<a name="l10141"></a>10141     nlines = nrows;
-<a name="l10142"></a>10142 
-<a name="l10143"></a>10143     idsorder = 0;
-<a name="l10144"></a>10144     <span class="keywordflow">while</span> (idsorder < 6 && cpl_table_has_column(idscoeff, clab[idsorder]))
-<a name="l10145"></a>10145         ++idsorder;
-<a name="l10146"></a>10146     --idsorder;
-<a name="l10147"></a>10147 
-<a name="l10148"></a>10148 
-<a name="l10149"></a>10149     <span class="comment">/*</span>
-<a name="l10150"></a>10150 <span class="comment">     * Allocate a dummy table for collecting all the offsets</span>
-<a name="l10151"></a>10151 <span class="comment">     * for all the lines</span>
-<a name="l10152"></a>10152 <span class="comment">     */</span>
-<a name="l10153"></a>10153 
-<a name="l10154"></a>10154     dummy = cpl_table_new(ny);
-<a name="l10155"></a>10155     <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {
-<a name="l10156"></a>10156         snprintf(name, MAX_COLNAME, <span class="stringliteral">"off_%d"</span>, (<span class="keywordtype">int</span>)line[j]);
-<a name="l10157"></a>10157         snprintf(fname, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);
-<a name="l10158"></a>10158         cpl_table_new_column(dummy, name, CPL_TYPE_DOUBLE);
-<a name="l10159"></a>10159         cpl_table_new_column(dummy, fname, CPL_TYPE_DOUBLE);
-<a name="l10160"></a>10160     }
-<a name="l10161"></a>10161 
-<a name="l10162"></a>10162     <span class="keywordflow">for</span> (j = 0; j < ny; j++, sdata += nx) {
-<a name="l10163"></a>10163 
-<a name="l10164"></a>10164         <span class="comment">/*</span>
-<a name="l10165"></a>10165 <span class="comment">         * Get the IDS polynomial for the current slit row</span>
-<a name="l10166"></a>10166 <span class="comment">         */</span>
-<a name="l10167"></a>10167 
-<a name="l10168"></a>10168         missing = 0;
-<a name="l10169"></a>10169         ids = cpl_polynomial_new(1);
-<a name="l10170"></a>10170         <span class="keywordflow">for</span> (k = 0; k <= idsorder; k++) {
-<a name="l10171"></a>10171             c = cpl_table_get_double(idscoeff, clab[k], j, &missing);
-<a name="l10172"></a>10172             <span class="keywordflow">if</span> (missing) {
-<a name="l10173"></a>10173                 cpl_polynomial_delete(ids);
-<a name="l10174"></a>10174                 <span class="keywordflow">break</span>;
-<a name="l10175"></a>10175             }
-<a name="l10176"></a>10176             cpl_polynomial_set_coeff(ids, &k, c);
-<a name="l10177"></a>10177         }
-<a name="l10178"></a>10178         <span class="keywordflow">if</span> (missing)
-<a name="l10179"></a>10179             <span class="keywordflow">continue</span>;
-<a name="l10180"></a>10180 
-<a name="l10181"></a>10181         <span class="keywordflow">for</span> (k = 0; k < nlines; k++) {
-<a name="l10182"></a>10182             expPos = cpl_polynomial_eval_1d(ids, line[k] - refwave, NULL);
-<a name="l10183"></a>10183             startPos = expPos - sradius;
-<a name="l10184"></a>10184             endPos   = startPos + window;
-<a name="l10185"></a>10185             <span class="keywordflow">if</span> (startPos < 0 || endPos >= nx)
-<a name="l10186"></a>10186                 <span class="keywordflow">continue</span>;
-<a name="l10187"></a>10187            
-<a name="l10188"></a>10188             <span class="keywordflow">if</span> (0 == <a class="code" href="group__moses.html#g56f03689ea7eaf37395dbb26a24e3fcf">peakPosition</a>(sdata + startPos, window, &pos, 1)) {
-<a name="l10189"></a>10189                 pos += startPos;
-<a name="l10190"></a>10190                 offset = pos - expPos;
-<a name="l10191"></a>10191                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"off_%d"</span>, (<span class="keywordtype">int</span>)line[k]);
-<a name="l10192"></a>10192                 cpl_table_set_double(dummy, name, j, offset);
-<a name="l10193"></a>10193             }
-<a name="l10194"></a>10194         }
-<a name="l10195"></a>10195 
-<a name="l10196"></a>10196         cpl_polynomial_delete(ids);
-<a name="l10197"></a>10197     }
-<a name="l10198"></a>10198 
-<a name="l10199"></a>10199 
-<a name="l10200"></a>10200     <span class="comment">/*</span>
-<a name="l10201"></a>10201 <span class="comment">     * At this point for each sky line we model its offset along</span>
-<a name="l10202"></a>10202 <span class="comment">     * the image rows using a robust linear fitting</span>
-<a name="l10203"></a>10203 <span class="comment">     */</span>
-<a name="l10204"></a>10204 
-<a name="l10205"></a>10205     <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {
-<a name="l10206"></a>10206         snprintf(name, MAX_COLNAME, <span class="stringliteral">"off_%d"</span>, (<span class="keywordtype">int</span>)line[j]);
-<a name="l10207"></a>10207         snprintf(fname, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);
-<a name="l10208"></a>10208         <span class="keywordflow">if</span> (cpl_table_has_valid(dummy, name)) {
-<a name="l10209"></a>10209 
-<a name="l10210"></a>10210             <span class="comment">/*</span>
-<a name="l10211"></a>10211 <span class="comment">             * In the following, the "fittable" is just a tool for</span>
-<a name="l10212"></a>10212 <span class="comment">             * eliminating invalid points from the vectors to be fitted.</span>
-<a name="l10213"></a>10213 <span class="comment">             */</span>
-<a name="l10214"></a>10214 
-<a name="l10215"></a>10215             <span class="keywordtype">double</span>        q, m;
-<a name="l10216"></a>10216             cpl_bivector *<a class="code" href="structlist.html">list</a>;
-<a name="l10217"></a>10217 
-<a name="l10218"></a>10218             fittable = cpl_table_new(ny);
-<a name="l10219"></a>10219             cpl_table_new_column(fittable, <span class="stringliteral">"row"</span>, CPL_TYPE_DOUBLE);
-<a name="l10220"></a>10220             cpl_table_set_column_unit(fittable, <span class="stringliteral">"row"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l10221"></a>10221             <span class="keywordflow">for</span> (k = 0; k < ny; k++)
-<a name="l10222"></a>10222                  cpl_table_set_double(fittable, <span class="stringliteral">"row"</span>, k, k);
-<a name="l10223"></a>10223             cpl_table_duplicate_column(fittable, <span class="stringliteral">"offset"</span>, dummy, name);
-<a name="l10224"></a>10224             npoints = ny - cpl_table_count_invalid(fittable, <span class="stringliteral">"offset"</span>);
-<a name="l10225"></a>10225             cpl_table_erase_invalid(fittable);
-<a name="l10226"></a>10226             row = cpl_vector_wrap(npoints,
-<a name="l10227"></a>10227                                cpl_table_get_data_double(fittable, <span class="stringliteral">"row"</span>));
-<a name="l10228"></a>10228             offs = cpl_vector_wrap(npoints,
-<a name="l10229"></a>10229                                cpl_table_get_data_double(fittable, <span class="stringliteral">"offset"</span>));
-<a name="l10230"></a>10230             list = cpl_bivector_wrap_vectors(row, offs);
-<a name="l10231"></a>10231             <a class="code" href="group__moses.html#g4b6606e2a44434b722cb25862567e4ff">robustLinearFit</a>(list, &q, &m, &rms);
-<a name="l10232"></a>10232             cpl_bivector_unwrap_vectors(list);
-<a name="l10233"></a>10233             cpl_vector_unwrap(row);
-<a name="l10234"></a>10234             cpl_vector_unwrap(offs);
-<a name="l10235"></a>10235             cpl_table_delete(fittable);
-<a name="l10236"></a>10236             <span class="keywordflow">for</span> (k = 0; k < ny; k++)
-<a name="l10237"></a>10237                  cpl_table_set_double(dummy, fname, k, q + m*k);
-<a name="l10238"></a>10238         }
-<a name="l10239"></a>10239     }
-<a name="l10240"></a>10240 
-<a name="l10241"></a>10241 
-<a name="l10242"></a>10242     <span class="comment">/*</span>
-<a name="l10243"></a>10243 <span class="comment">     * Now each dummy table row consists of a sequence of offsets,</span>
-<a name="l10244"></a>10244 <span class="comment">     * one for each wavelength. A table row corresponds to an image row.</span>
-<a name="l10245"></a>10245 <span class="comment">     * We must fit a polynomial to each one of these rows, in order to</span>
-<a name="l10246"></a>10246 <span class="comment">     * express the offsets as a function of wavelength. The obtained </span>
-<a name="l10247"></a>10247 <span class="comment">     * polynomial coefficients are used to correct the IDS coefficients.</span>
-<a name="l10248"></a>10248 <span class="comment">     */</span>
-<a name="l10249"></a>10249 
-<a name="l10250"></a>10250     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {
-<a name="l10251"></a>10251 
-<a name="l10252"></a>10252         <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, clab[0], i))
-<a name="l10253"></a>10253             <span class="keywordflow">continue</span>;
-<a name="l10254"></a>10254 
-<a name="l10255"></a>10255         npoints = 0;
-<a name="l10256"></a>10256         <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {
-<a name="l10257"></a>10257             snprintf(name, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);
-<a name="l10258"></a>10258             <span class="keywordflow">if</span> (cpl_table_is_valid(dummy, name, i))
-<a name="l10259"></a>10259                 npoints++;
-<a name="l10260"></a>10260         }
-<a name="l10261"></a>10261 
-<a name="l10262"></a>10262         <span class="keywordflow">if</span> (npoints == 0)
-<a name="l10263"></a>10263             <span class="keywordflow">continue</span>;
-<a name="l10264"></a>10264 
-<a name="l10265"></a>10265         uorder = order;
-<a name="l10266"></a>10266         <span class="keywordflow">if</span> (npoints <= uorder)
-<a name="l10267"></a>10267             uorder = npoints - 1;
-<a name="l10268"></a>10268 
-<a name="l10269"></a>10269         <span class="keywordflow">if</span> (uorder > 1) {
-<a name="l10270"></a>10270 
-<a name="l10271"></a>10271             <span class="comment">/*</span>
-<a name="l10272"></a>10272 <span class="comment">             * Model offsets with polynomial fitting</span>
-<a name="l10273"></a>10273 <span class="comment">             */</span>
-<a name="l10274"></a>10274 
-<a name="l10275"></a>10275             wave = cpl_vector_new(npoints);
-<a name="l10276"></a>10276             wdata = cpl_vector_get_data(wave);
-<a name="l10277"></a>10277             offs = cpl_vector_new(npoints);
-<a name="l10278"></a>10278             odata = cpl_vector_get_data(offs);
-<a name="l10279"></a>10279 
-<a name="l10280"></a>10280             npoints = 0;
-<a name="l10281"></a>10281             <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {
-<a name="l10282"></a>10282                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);
-<a name="l10283"></a>10283                 <span class="keywordflow">if</span> (cpl_table_is_valid(dummy, name, i)) {
-<a name="l10284"></a>10284                     wdata[npoints] = line[j] - refwave;
-<a name="l10285"></a>10285                     odata[npoints] = cpl_table_get_double(dummy, name, i, NULL);
-<a name="l10286"></a>10286                     npoints++;
-<a name="l10287"></a>10287                 }
-<a name="l10288"></a>10288             }
-<a name="l10289"></a>10289 
-<a name="l10290"></a>10290             polycorr = cpl_polynomial_fit_1d_create(wave, offs, uorder, &rms);
-<a name="l10291"></a>10291 
-<a name="l10292"></a>10292             rms = sqrt(rms * (uorder + 1) / npoints);
-<a name="l10293"></a>10293 
-<a name="l10294"></a>10294             cpl_vector_delete(wave);
-<a name="l10295"></a>10295             cpl_vector_delete(offs);
-<a name="l10296"></a>10296 
-<a name="l10297"></a>10297             <span class="comment">/*</span>
-<a name="l10298"></a>10298 <span class="comment">             * Now correct the coefficients of the corresponding IDS</span>
-<a name="l10299"></a>10299 <span class="comment">             * polynomials related to this slit:</span>
-<a name="l10300"></a>10300 <span class="comment">             */</span>
-<a name="l10301"></a>10301 
-<a name="l10302"></a>10302             <span class="keywordflow">for</span> (j = 0; j <= uorder; j++) {
-<a name="l10303"></a>10303                 data = cpl_table_get_data_double(idscoeff, clab[j]);
-<a name="l10304"></a>10304                 c = cpl_polynomial_get_coeff(polycorr, &j);
-<a name="l10305"></a>10305                 data[i] += c;
-<a name="l10306"></a>10306             }
-<a name="l10307"></a>10307 
-<a name="l10308"></a>10308             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l10309"></a>10309             data[i] = sqrt(data[i]*data[i] + rms*rms);
-<a name="l10310"></a>10310 
-<a name="l10311"></a>10311             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);
-<a name="l10312"></a>10312             idata[i] = npoints;
-<a name="l10313"></a>10313 
-<a name="l10314"></a>10314             <span class="comment">/*</span>
-<a name="l10315"></a>10315 <span class="comment">             * If a wavelengths map was provided, correct it to keep</span>
-<a name="l10316"></a>10316 <span class="comment">             * into account the alignment to skylines:</span>
-<a name="l10317"></a>10317 <span class="comment">             */</span>
-<a name="l10318"></a>10318 
-<a name="l10319"></a>10319             <span class="keywordflow">if</span> (calibration) {
-<a name="l10320"></a>10320                 <span class="keywordflow">for</span> (k = 1; k < nx; k++) {
-<a name="l10321"></a>10321                     lambda1 = cdata[k - 1 + i*nx];
-<a name="l10322"></a>10322                     lambda2 = cdata[k + i*nx];
-<a name="l10323"></a>10323                     <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)
-<a name="l10324"></a>10324                         <span class="keywordflow">continue</span>;
-<a name="l10325"></a>10325                     offset = cpl_polynomial_eval_1d(polycorr,
-<a name="l10326"></a>10326                                                     lambda1-refwave, NULL);
-<a name="l10327"></a>10327                     cdata[k - 1 + i*nx] -= offset * (lambda2-lambda1);
-<a name="l10328"></a>10328                 }
-<a name="l10329"></a>10329             }
-<a name="l10330"></a>10330 
-<a name="l10331"></a>10331             cpl_polynomial_delete(polycorr);
-<a name="l10332"></a>10332 
-<a name="l10333"></a>10333         }
-<a name="l10334"></a>10334         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (uorder == 1) {
-<a name="l10335"></a>10335 
-<a name="l10336"></a>10336             <span class="comment">/*</span>
-<a name="l10337"></a>10337 <span class="comment">             * Model offsets with robust linear fitting</span>
-<a name="l10338"></a>10338 <span class="comment">             */</span>
-<a name="l10339"></a>10339 
-<a name="l10340"></a>10340             cpl_bivector *<a class="code" href="structlist.html">list</a>;
-<a name="l10341"></a>10341             <span class="keywordtype">double</span>        q, m;
-<a name="l10342"></a>10342 
-<a name="l10343"></a>10343             wave = cpl_vector_new(npoints);
-<a name="l10344"></a>10344             wdata = cpl_vector_get_data(wave);
-<a name="l10345"></a>10345             offs = cpl_vector_new(npoints);
-<a name="l10346"></a>10346             odata = cpl_vector_get_data(offs);
-<a name="l10347"></a>10347 
-<a name="l10348"></a>10348             npoints = 0;
-<a name="l10349"></a>10349             <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {
-<a name="l10350"></a>10350                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);
-<a name="l10351"></a>10351                 <span class="keywordflow">if</span> (cpl_table_is_valid(dummy, name, i)) {
-<a name="l10352"></a>10352                     wdata[npoints] = line[j] - refwave;
-<a name="l10353"></a>10353                     odata[npoints] = cpl_table_get_double(dummy, name, i, NULL);
-<a name="l10354"></a>10354                     npoints++;
-<a name="l10355"></a>10355                 }
-<a name="l10356"></a>10356             }
-<a name="l10357"></a>10357 
-<a name="l10358"></a>10358             list = cpl_bivector_wrap_vectors(wave, offs);
-<a name="l10359"></a>10359             <a class="code" href="group__moses.html#g4b6606e2a44434b722cb25862567e4ff">robustLinearFit</a>(list, &q, &m, &rms);
-<a name="l10360"></a>10360 
-<a name="l10361"></a>10361             rms = sqrt(rms * (uorder + 1) / npoints);
-<a name="l10362"></a>10362 
-<a name="l10363"></a>10363             cpl_bivector_unwrap_vectors(list);
-<a name="l10364"></a>10364             cpl_vector_delete(wave);
-<a name="l10365"></a>10365             cpl_vector_delete(offs);
-<a name="l10366"></a>10366 
-<a name="l10367"></a>10367             <span class="comment">/*</span>
-<a name="l10368"></a>10368 <span class="comment">             * Now correct the coefficients of the corresponding IDS</span>
-<a name="l10369"></a>10369 <span class="comment">             * polynomials related to this row:</span>
-<a name="l10370"></a>10370 <span class="comment">             */</span>
-<a name="l10371"></a>10371 
-<a name="l10372"></a>10372             <span class="keywordflow">for</span> (j = 0; j <= uorder; j++) {
-<a name="l10373"></a>10373                 data = cpl_table_get_data_double(idscoeff, clab[j]);
-<a name="l10374"></a>10374                 <span class="keywordflow">if</span> (j)
-<a name="l10375"></a>10375                     c = m;
-<a name="l10376"></a>10376                 <span class="keywordflow">else</span>
-<a name="l10377"></a>10377                     c = q;
-<a name="l10378"></a>10378                 data[i] += c;
-<a name="l10379"></a>10379             }
-<a name="l10380"></a>10380 
-<a name="l10381"></a>10381             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l10382"></a>10382             data[i] = sqrt(data[i]*data[i] + rms*rms);
-<a name="l10383"></a>10383 
-<a name="l10384"></a>10384             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);
-<a name="l10385"></a>10385             idata[i] = npoints;
-<a name="l10386"></a>10386 
-<a name="l10387"></a>10387             <span class="comment">/*</span>
-<a name="l10388"></a>10388 <span class="comment">             * If a wavelengths map was provided, correct it to keep</span>
-<a name="l10389"></a>10389 <span class="comment">             * into account the alignment to skylines:</span>
-<a name="l10390"></a>10390 <span class="comment">             */</span>
-<a name="l10391"></a>10391 
-<a name="l10392"></a>10392             <span class="keywordflow">if</span> (calibration) {
-<a name="l10393"></a>10393                 <span class="keywordflow">for</span> (k = 1; k < nx; k++) {
-<a name="l10394"></a>10394                     lambda1 = cdata[k - 1 + i*nx];
-<a name="l10395"></a>10395                     lambda2 = cdata[k + i*nx];
-<a name="l10396"></a>10396                     <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)
-<a name="l10397"></a>10397                         <span class="keywordflow">continue</span>;
-<a name="l10398"></a>10398                     offset = q + m*(lambda1-refwave);
-<a name="l10399"></a>10399                     cdata[k - 1 + i*nx] -= offset * (lambda2-lambda1);
-<a name="l10400"></a>10400                 }
-<a name="l10401"></a>10401             }
-<a name="l10402"></a>10402         }
-<a name="l10403"></a>10403         <span class="keywordflow">else</span> {
-<a name="l10404"></a>10404 
-<a name="l10405"></a>10405             <span class="comment">/*</span>
-<a name="l10406"></a>10406 <span class="comment">             * Just compute median offset</span>
-<a name="l10407"></a>10407 <span class="comment">             */</span>
-<a name="l10408"></a>10408 
-<a name="l10409"></a>10409             offs = cpl_vector_new(npoints);
-<a name="l10410"></a>10410             odata = cpl_vector_get_data(offs);
-<a name="l10411"></a>10411 
-<a name="l10412"></a>10412             npoints = 0;
-<a name="l10413"></a>10413             <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {
-<a name="l10414"></a>10414                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);
-<a name="l10415"></a>10415                 <span class="keywordflow">if</span> (cpl_table_is_valid(dummy, name, i)) {
-<a name="l10416"></a>10416                     odata[npoints] = cpl_table_get_double(dummy, name, i, NULL);
-<a name="l10417"></a>10417                     npoints++;
-<a name="l10418"></a>10418                 }
-<a name="l10419"></a>10419             }
-<a name="l10420"></a>10420 
-<a name="l10421"></a>10421             offset = cpl_vector_get_median_const(offs);
-<a name="l10422"></a>10422 
-<a name="l10423"></a>10423             <span class="keywordflow">if</span> (npoints > 1) {
-<a name="l10424"></a>10424                 rms = cpl_vector_get_stdev(offs);
-<a name="l10425"></a>10425             }
-<a name="l10426"></a>10426             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (npoints == 1) {
-<a name="l10427"></a>10427                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"off_%d"</span>, (<span class="keywordtype">int</span>)line[0]);
-<a name="l10428"></a>10428                 <span class="keywordflow">if</span> (cpl_table_has_valid(dummy, name)) {
-<a name="l10429"></a>10429                     rms = cpl_table_get_column_stdev(dummy, name);
-<a name="l10430"></a>10430                     rms /= sqrt(ny - cpl_table_count_invalid(dummy, name));
-<a name="l10431"></a>10431                 }
-<a name="l10432"></a>10432                 <span class="keywordflow">else</span> {
-<a name="l10433"></a>10433                     rms = 0.0;
-<a name="l10434"></a>10434                 }
-<a name="l10435"></a>10435             }
-<a name="l10436"></a>10436             <span class="keywordflow">else</span> {
-<a name="l10437"></a>10437                 rms = 0.0;
-<a name="l10438"></a>10438             }
-<a name="l10439"></a>10439 
-<a name="l10440"></a>10440             rms /= sqrt(npoints);
-<a name="l10441"></a>10441 
-<a name="l10442"></a>10442             cpl_vector_delete(offs);
-<a name="l10443"></a>10443 
-<a name="l10444"></a>10444             <span class="comment">/*</span>
-<a name="l10445"></a>10445 <span class="comment">             * Now correct the constant term of the corresponding IDS</span>
-<a name="l10446"></a>10446 <span class="comment">             * polynomials related to this slit:</span>
-<a name="l10447"></a>10447 <span class="comment">             */</span>
-<a name="l10448"></a>10448 
-<a name="l10449"></a>10449             data = cpl_table_get_data_double(idscoeff, clab[0]);
-<a name="l10450"></a>10450             data[i] += offset;
-<a name="l10451"></a>10451 
-<a name="l10452"></a>10452             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l10453"></a>10453             data[i] = sqrt(data[i]*data[i] + rms*rms);
-<a name="l10454"></a>10454 
-<a name="l10455"></a>10455             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);
-<a name="l10456"></a>10456             idata[i] = npoints;
-<a name="l10457"></a>10457 
-<a name="l10458"></a>10458             <span class="comment">/*</span>
-<a name="l10459"></a>10459 <span class="comment">             * If a wavelengths map was provided, correct it to keep</span>
-<a name="l10460"></a>10460 <span class="comment">             * into account the alignment to skylines. Note that</span>
-<a name="l10461"></a>10461 <span class="comment">             * the offset must be converted from pixels to wavelengths.</span>
-<a name="l10462"></a>10462 <span class="comment">             */</span>
-<a name="l10463"></a>10463 
-<a name="l10464"></a>10464             <span class="keywordflow">if</span> (calibration) {
-<a name="l10465"></a>10465                 <span class="keywordflow">for</span> (k = 1; k < nx; k++) {
-<a name="l10466"></a>10466                     lambda1 = cdata[k - 1 + i*nx];
-<a name="l10467"></a>10467                     lambda2 = cdata[k + i*nx];
-<a name="l10468"></a>10468                     <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)
-<a name="l10469"></a>10469                         <span class="keywordflow">continue</span>;
-<a name="l10470"></a>10470                     cdata[k - 1 + i*nx] -= offset * (lambda2-lambda1);
-<a name="l10471"></a>10471                 }
-<a name="l10472"></a>10472             }
-<a name="l10473"></a>10473         }
-<a name="l10474"></a>10474     }
-<a name="l10475"></a>10475 
-<a name="l10476"></a>10476     missing = 1;
-<a name="l10477"></a>10477     <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {
-<a name="l10478"></a>10478         snprintf(name, MAX_COLNAME, <span class="stringliteral">"off_%d"</span>, (<span class="keywordtype">int</span>)line[j]);
-<a name="l10479"></a>10479         <span class="keywordflow">if</span> (cpl_table_has_valid(dummy, name)) {
-<a name="l10480"></a>10480             missing = 0;
-<a name="l10481"></a>10481             offset = cpl_table_get_column_median(dummy, name);
-<a name="l10482"></a>10482             cpl_msg_info(func, <span class="stringliteral">"Median offset for %.3f: %.3f pixel"</span>,
-<a name="l10483"></a>10483                          line[j], offset);
-<a name="l10484"></a>10484         }
-<a name="l10485"></a>10485         <span class="keywordflow">else</span> {
-<a name="l10486"></a>10486             cpl_msg_info(func, 
-<a name="l10487"></a>10487                          <span class="stringliteral">"Median offset for %.2f: not available"</span>, line[j]);
-<a name="l10488"></a>10488         }
-<a name="l10489"></a>10489     }
-<a name="l10490"></a>10490 
-<a name="l10491"></a>10491     cpl_table_delete(offsets);
-<a name="l10492"></a>10492 
-<a name="l10493"></a>10493     <span class="keywordflow">if</span> (missing) {
-<a name="l10494"></a>10494         cpl_table_delete(dummy);
-<a name="l10495"></a>10495         dummy = NULL;
-<a name="l10496"></a>10496     }
-<a name="l10497"></a>10497 
-<a name="l10498"></a>10498     <span class="keywordflow">return</span> dummy;
-<a name="l10499"></a>10499 
-<a name="l10500"></a>10500 }
-<a name="l10501"></a>10501 
-<a name="l10502"></a>10502 
-<a name="l10530"></a><a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">10530</a> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(cpl_image *rectified, cpl_vector *lines, 
-<a name="l10531"></a>10531                            <span class="keywordtype">double</span> wavestart, <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> radius,
-<a name="l10532"></a>10532                            <span class="keywordtype">int</span> highres)
-<a name="l10533"></a>10533 {
-<a name="l10534"></a>10534 
-<a name="l10535"></a>10535     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_distortions_rms"</span>;
-<a name="l10536"></a>10536 
-<a name="l10537"></a>10537     <span class="keywordtype">int</span> xlen;
-<a name="l10538"></a>10538     <span class="keywordtype">int</span> ylen;
-<a name="l10539"></a>10539     <span class="keywordtype">int</span> numLines;
-<a name="l10540"></a>10540     <span class="keywordtype">int</span> cpix, npix, nzero;
-<a name="l10541"></a>10541     <span class="keywordtype">int</span> sp, ep;
-<a name="l10542"></a>10542     <span class="keywordtype">int</span> i, j, k;
-<a name="l10543"></a>10543     <span class="keywordtype">int</span> npeaks, allPeaks;
-<a name="l10544"></a>10544 
-<a name="l10545"></a>10545     <span class="keywordtype">float</span> *profile;
-<a name="l10546"></a>10546     <span class="keywordtype">float</span>  peak, expectPeak, offset;
-<a name="l10547"></a>10547     <span class="keywordtype">double</span> lambda;
-<a name="l10548"></a>10548 
-<a name="l10549"></a>10549     <span class="keywordtype">double</span>  average;
-<a name="l10550"></a>10550     <span class="keywordtype">double</span>  rms, oneRms;
-<a name="l10551"></a>10551 
-<a name="l10552"></a>10552     <span class="keywordtype">float</span>  *sdata;
-<a name="l10553"></a>10553     <span class="keywordtype">double</span> *wdata;
-<a name="l10554"></a>10554 
-<a name="l10555"></a>10555   
-<a name="l10556"></a>10556     xlen = cpl_image_get_size_x(rectified);
-<a name="l10557"></a>10557     ylen = cpl_image_get_size_y(rectified);
-<a name="l10558"></a>10558     sdata = cpl_image_get_data(rectified);
-<a name="l10559"></a>10559 
-<a name="l10560"></a>10560     <span class="keywordflow">if</span> (lines) {
-<a name="l10561"></a>10561         wdata = cpl_vector_get_data(lines);
-<a name="l10562"></a>10562         numLines = cpl_vector_get_size(lines);
-<a name="l10563"></a>10563     }
-<a name="l10564"></a>10564     <span class="keywordflow">else</span> {
-<a name="l10565"></a>10565         cpl_msg_warning(func, <span class="stringliteral">"A catalog of sky lines wavelengths was not "</span>
-<a name="l10566"></a>10566                         <span class="stringliteral">"given: using internal list of reference sky lines"</span>);
-<a name="l10567"></a>10567         <span class="keywordflow">if</span> (highres) {
-<a name="l10568"></a>10568            wdata = default_lines_hi;
-<a name="l10569"></a>10569            numLines = <span class="keyword">sizeof</span>(default_lines_hi) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);
-<a name="l10570"></a>10570         }
-<a name="l10571"></a>10571         <span class="keywordflow">else</span> {
-<a name="l10572"></a>10572            wdata = default_lines_lo;
-<a name="l10573"></a>10573            numLines = <span class="keyword">sizeof</span>(default_lines_lo) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);
-<a name="l10574"></a>10574         }
-<a name="l10575"></a>10575     }
-<a name="l10576"></a>10576 
-<a name="l10577"></a>10577     npix = 2 * radius + 1;
-<a name="l10578"></a>10578     profile = cpl_calloc(npix, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));
-<a name="l10579"></a>10579 
-<a name="l10580"></a>10580     rms = 0.0;
-<a name="l10581"></a>10581     allPeaks = 0;
-<a name="l10582"></a>10582 
-<a name="l10583"></a>10583     <span class="keywordflow">for</span> (i = 0; i < numLines; i++) {
-<a name="l10584"></a>10584 
-<a name="l10585"></a>10585         <span class="comment">/*</span>
-<a name="l10586"></a>10586 <span class="comment">         *  Expected peak and closest pixel to specified wavelength.</span>
-<a name="l10587"></a>10587 <span class="comment">         */</span>
-<a name="l10588"></a>10588 
-<a name="l10589"></a>10589         lambda = wdata[i];
-<a name="l10590"></a>10590         expectPeak = (lambda - wavestart) / dispersion;
-<a name="l10591"></a>10591         cpix = floor(expectPeak + 0.5);
-<a name="l10592"></a>10592 
-<a name="l10593"></a>10593         <span class="comment">/*</span>
-<a name="l10594"></a>10594 <span class="comment">         *  Search interval for peak. Abort if too close to image border.</span>
-<a name="l10595"></a>10595 <span class="comment">         */</span>
-<a name="l10596"></a>10596 
-<a name="l10597"></a>10597         sp = cpix - radius;
-<a name="l10598"></a>10598         ep = cpix + radius;
-<a name="l10599"></a>10599 
-<a name="l10600"></a>10600         <span class="keywordflow">if</span> (sp < 0 || ep > xlen)
-<a name="l10601"></a>10601             <span class="keywordflow">continue</span>;
-<a name="l10602"></a>10602 
-<a name="l10603"></a>10603         average = 0.0;
-<a name="l10604"></a>10604         npeaks = 0;
-<a name="l10605"></a>10605         oneRms = 0.0;
-<a name="l10606"></a>10606 
-<a name="l10607"></a>10607         <span class="keywordflow">for</span> (j = 0; j < ylen; j++) {    <span class="comment">/*  For each row of each slit  */</span>
-<a name="l10608"></a>10608             nzero = 0;
-<a name="l10609"></a>10609             <span class="keywordflow">for</span> (k = 0; k < npix; k++) {
-<a name="l10610"></a>10610                 profile[k] = sdata[sp + k + j * xlen];
-<a name="l10611"></a>10611                 <span class="keywordflow">if</span> (fabs(profile[k]) < 0.0001)
-<a name="l10612"></a>10612                     nzero++; <span class="comment">/* Count number of 0 pixels (spectrum truncated) */</span>
-<a name="l10613"></a>10613             }
-<a name="l10614"></a>10614             <span class="keywordflow">if</span> (nzero > 0)
-<a name="l10615"></a>10615                 <span class="keywordflow">continue</span>;
-<a name="l10616"></a>10616 
-<a name="l10617"></a>10617             <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g56f03689ea7eaf37395dbb26a24e3fcf">peakPosition</a>(profile, npix, &peak, 1) == 0) {
-<a name="l10618"></a>10618                 offset = (sp + peak) - expectPeak;
-<a name="l10619"></a>10619                 average += offset;
-<a name="l10620"></a>10620                 rms += fabs(offset);
-<a name="l10621"></a>10621                 oneRms += fabs(offset);
-<a name="l10622"></a>10622                 npeaks++;
-<a name="l10623"></a>10623                 allPeaks++;
-<a name="l10624"></a>10624             }
-<a name="l10625"></a>10625         }
-<a name="l10626"></a>10626 
-<a name="l10627"></a>10627         <span class="keywordflow">if</span> (npeaks)
-<a name="l10628"></a>10628             cpl_msg_info(func, <span class="stringliteral">"RMS for %.2f: %.3f pixel (%d points)"</span>,
-<a name="l10629"></a>10629                          lambda, oneRms / npeaks * 1.25, npeaks);
-<a name="l10630"></a>10630         <span class="keywordflow">else</span>
-<a name="l10631"></a>10631             cpl_msg_info(func, <span class="stringliteral">"RMS for %.2f: line not available"</span>, lambda);
-<a name="l10632"></a>10632     }
-<a name="l10633"></a>10633 
-<a name="l10634"></a>10634     cpl_free(profile);
-<a name="l10635"></a>10635 
-<a name="l10636"></a>10636     <span class="keywordflow">if</span> (allPeaks < 10)
-<a name="l10637"></a>10637         <span class="keywordflow">return</span> 0.0;
-<a name="l10638"></a>10638 
-<a name="l10639"></a>10639     rms /= allPeaks;
-<a name="l10640"></a>10640     rms *= 1.25;       <span class="comment">/* Factor to convert average deviation to sigma */</span>
-<a name="l10641"></a>10641 
-<a name="l10642"></a>10642     <span class="keywordflow">return</span> rms;
-<a name="l10643"></a>10643 
-<a name="l10644"></a>10644 }
-<a name="l10645"></a>10645 
-<a name="l10646"></a>10646 
-<a name="l10667"></a><a class="code" href="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1">10667</a> cpl_image *<a class="code" href="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1">mos_map_pixel</a>(cpl_table *idscoeff, <span class="keywordtype">double</span> reference,
-<a name="l10668"></a>10668                          <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> trend)
-<a name="l10669"></a>10669 {
-<a name="l10670"></a>10670     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_map_pixel"</span>;
-<a name="l10671"></a>10671 
-<a name="l10672"></a>10672     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l10673"></a>10673                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l10674"></a>10674 
-<a name="l10675"></a>10675     cpl_polynomial *ids;
-<a name="l10676"></a>10676     cpl_image      *map;
-<a name="l10677"></a>10677     <span class="keywordtype">float</span>          *mdata;
-<a name="l10678"></a>10678     <span class="keywordtype">double</span>          lambda;
-<a name="l10679"></a>10679     <span class="keywordtype">double</span>          c;
-<a name="l10680"></a>10680     <span class="keywordtype">int</span>             order;
-<a name="l10681"></a>10681     <span class="keywordtype">int</span>             xsize, ysize;
-<a name="l10682"></a>10682     <span class="keywordtype">int</span>             missing;
-<a name="l10683"></a>10683     <span class="keywordtype">int</span>             i, j;
-<a name="l10684"></a>10684     cpl_size        k;
-<a name="l10685"></a>10685 
-<a name="l10686"></a>10686 
-<a name="l10687"></a>10687     <span class="keywordflow">if</span> (idscoeff == NULL) {
-<a name="l10688"></a>10688         cpl_msg_error(func, <span class="stringliteral">"An IDS coeff table must be given"</span>);
-<a name="l10689"></a>10689         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l10690"></a>10690         <span class="keywordflow">return</span> NULL;
-<a name="l10691"></a>10691     }
-<a name="l10692"></a>10692 
-<a name="l10693"></a>10693     xsize = (red - blue) / dispersion;
-<a name="l10694"></a>10694     ysize = cpl_table_get_nrow(idscoeff);
-<a name="l10695"></a>10695     map = cpl_image_new(xsize, ysize, CPL_TYPE_FLOAT);
-<a name="l10696"></a>10696     mdata = cpl_image_get_data(map);
-<a name="l10697"></a>10697 
-<a name="l10698"></a>10698     order = 0;
-<a name="l10699"></a>10699     <span class="keywordflow">while</span> (order < 6 && cpl_table_has_column(idscoeff, clab[order]))
-<a name="l10700"></a>10700         ++order;
-<a name="l10701"></a>10701     --order;
-<a name="l10702"></a>10702 
-<a name="l10703"></a>10703     <span class="keywordflow">for</span> (i = 0; i < ysize; i++, mdata += xsize) {
-<a name="l10704"></a>10704 
-<a name="l10705"></a>10705         missing = 0;
-<a name="l10706"></a>10706         ids = cpl_polynomial_new(1);
-<a name="l10707"></a>10707         <span class="keywordflow">for</span> (k = trend; k <= order; k++) {
-<a name="l10708"></a>10708             c = cpl_table_get_double(idscoeff, clab[k], i, &missing);
-<a name="l10709"></a>10709             <span class="keywordflow">if</span> (missing) {
-<a name="l10710"></a>10710                 cpl_polynomial_delete(ids);
-<a name="l10711"></a>10711                 <span class="keywordflow">break</span>;
-<a name="l10712"></a>10712             }
-<a name="l10713"></a>10713             cpl_polynomial_set_coeff(ids, &k, c);
-<a name="l10714"></a>10714         }
-<a name="l10715"></a>10715         <span class="keywordflow">if</span> (missing)
-<a name="l10716"></a>10716             <span class="keywordflow">continue</span>;
-<a name="l10717"></a>10717 
-<a name="l10718"></a>10718         <span class="keywordflow">for</span> (j = 0; j < xsize; j++) {
-<a name="l10719"></a>10719             lambda = blue + j*dispersion;
-<a name="l10720"></a>10720             mdata[j] = cpl_polynomial_eval_1d(ids, lambda-reference, NULL);
-<a name="l10721"></a>10721         }
-<a name="l10722"></a>10722 
-<a name="l10723"></a>10723         cpl_polynomial_delete(ids);
-<a name="l10724"></a>10724     }
-<a name="l10725"></a>10725 
-<a name="l10726"></a>10726     <span class="keywordflow">return</span> map;
-<a name="l10727"></a>10727 
-<a name="l10728"></a>10728 }
-<a name="l10729"></a>10729 
-<a name="l10730"></a>10730 
-<a name="l10752"></a><a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">10752</a> cpl_image *<a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(cpl_table *idscoeff, <span class="keywordtype">int</span> xsize, <span class="keywordtype">double</span> reference,
-<a name="l10753"></a>10753                             <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red)
-<a name="l10754"></a>10754 {
-<a name="l10755"></a>10755     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_map_idscoeff"</span>;
-<a name="l10756"></a>10756 
-<a name="l10757"></a>10757     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l10758"></a>10758                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l10759"></a>10759 
-<a name="l10760"></a>10760     cpl_polynomial *ids;
-<a name="l10761"></a>10761     cpl_image      *map;
-<a name="l10762"></a>10762     <span class="keywordtype">float</span>          *mdata;
-<a name="l10763"></a>10763     <span class="keywordtype">double</span>          lambda;
-<a name="l10764"></a>10764     <span class="keywordtype">double</span>          c;
-<a name="l10765"></a>10765     <span class="keywordtype">int</span>             order;
-<a name="l10766"></a>10766     <span class="keywordtype">int</span>             ysize;
-<a name="l10767"></a>10767     <span class="keywordtype">int</span>             missing;
-<a name="l10768"></a>10768     <span class="keywordtype">int</span>             i, j;
-<a name="l10769"></a>10769     cpl_size        k;
-<a name="l10770"></a>10770 
-<a name="l10771"></a>10771 
-<a name="l10772"></a>10772     <span class="keywordflow">if</span> (idscoeff == NULL) {
-<a name="l10773"></a>10773         cpl_msg_error(func, <span class="stringliteral">"An IDS coeff table must be given"</span>);
-<a name="l10774"></a>10774         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l10775"></a>10775         <span class="keywordflow">return</span> NULL;
-<a name="l10776"></a>10776     }
-<a name="l10777"></a>10777 
-<a name="l10778"></a>10778     <span class="keywordflow">if</span> (xsize < 1) {
-<a name="l10779"></a>10779         cpl_msg_error(func, <span class="stringliteral">"Invalid image size"</span>);
-<a name="l10780"></a>10780         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l10781"></a>10781         <span class="keywordflow">return</span> NULL;
-<a name="l10782"></a>10782     }
-<a name="l10783"></a>10783 
-<a name="l10784"></a>10784     <span class="keywordflow">if</span> (xsize < 20 || xsize > 5000) {
-<a name="l10785"></a>10785         cpl_msg_warning(func, <span class="stringliteral">"Do you really have a detector %d pixels long?"</span>,
-<a name="l10786"></a>10786                         xsize);
-<a name="l10787"></a>10787     }
-<a name="l10788"></a>10788 
-<a name="l10789"></a>10789     ysize = cpl_table_get_nrow(idscoeff);
-<a name="l10790"></a>10790     map = cpl_image_new(xsize, ysize, CPL_TYPE_FLOAT);
-<a name="l10791"></a>10791     mdata = cpl_image_get_data(map);
-<a name="l10792"></a>10792 
-<a name="l10793"></a>10793     order = 0;
-<a name="l10794"></a>10794     <span class="keywordflow">while</span> (order < 6 && cpl_table_has_column(idscoeff, clab[order]))
-<a name="l10795"></a>10795         ++order;
-<a name="l10796"></a>10796     --order;
-<a name="l10797"></a>10797 
-<a name="l10798"></a>10798     <span class="keywordflow">for</span> (i = 0; i < ysize; i++, mdata += xsize) {
-<a name="l10799"></a>10799 
-<a name="l10800"></a>10800         missing = 0;
-<a name="l10801"></a>10801         ids = cpl_polynomial_new(1);
-<a name="l10802"></a>10802         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l10803"></a>10803             c = cpl_table_get_double(idscoeff, clab[k], i, &missing);
-<a name="l10804"></a>10804             <span class="keywordflow">if</span> (missing) {
-<a name="l10805"></a>10805                 cpl_polynomial_delete(ids);
-<a name="l10806"></a>10806                 <span class="keywordflow">break</span>;
-<a name="l10807"></a>10807             }
-<a name="l10808"></a>10808             cpl_polynomial_set_coeff(ids, &k, c);
-<a name="l10809"></a>10809         }
-<a name="l10810"></a>10810         <span class="keywordflow">if</span> (missing)
-<a name="l10811"></a>10811             <span class="keywordflow">continue</span>;
-<a name="l10812"></a>10812 
-<a name="l10813"></a>10813         <span class="keywordflow">for</span> (j = 0; j < xsize; j++) {
-<a name="l10814"></a>10814             lambda = <a class="code" href="group__moses.html#g99c7290af152957144e8c0413355e5dd">mos_eval_dds</a>(ids, blue, red, reference, j);
-<a name="l10815"></a>10815 
-<a name="l10816"></a>10816             <span class="keywordflow">if</span> (lambda >= blue && lambda <= red) {
-<a name="l10817"></a>10817                 mdata[j] = lambda;
-<a name="l10818"></a>10818             }
-<a name="l10819"></a>10819         }
-<a name="l10820"></a>10820 
-<a name="l10821"></a>10821         cpl_polynomial_delete(ids);
-<a name="l10822"></a>10822     }
-<a name="l10823"></a>10823 
-<a name="l10824"></a>10824     <span class="keywordflow">return</span> map;
-<a name="l10825"></a>10825 
-<a name="l10826"></a>10826 }
-<a name="l10827"></a>10827 
-<a name="l10828"></a>10828 
-<a name="l10863"></a><a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">10863</a> cpl_image *<a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(cpl_image *spatial, cpl_image *calibration,
-<a name="l10864"></a>10864                                cpl_table *slits, cpl_table *polytraces, 
-<a name="l10865"></a>10865                                <span class="keywordtype">double</span> reference, <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, 
-<a name="l10866"></a>10866                                <span class="keywordtype">double</span> dispersion)
-<a name="l10867"></a>10867 {
-<a name="l10868"></a>10868     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_map_wavelengths"</span>;
-<a name="l10869"></a>10869 
-<a name="l10870"></a>10870     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l10871"></a>10871                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l10872"></a>10872     cpl_polynomial *polytop;
-<a name="l10873"></a>10873     cpl_polynomial *polybot;
-<a name="l10874"></a>10874     cpl_image      *remapped;
-<a name="l10875"></a>10875     <span class="keywordtype">float</span>          *data;
-<a name="l10876"></a>10876     <span class="keywordtype">float</span>          *wdata;
-<a name="l10877"></a>10877     <span class="keywordtype">float</span>          *sdata;
-<a name="l10878"></a>10878     <span class="keywordtype">float</span>          *xdata;
-<a name="l10879"></a>10879     <span class="keywordtype">double</span>          vtop, vbot, value;
-<a name="l10880"></a>10880     <span class="keywordtype">double</span>          top, bot;
-<a name="l10881"></a>10881     <span class="keywordtype">double</span>          coeff;
-<a name="l10882"></a>10882     <span class="keywordtype">double</span>          ytop, ybot;
-<a name="l10883"></a>10883     <span class="keywordtype">double</span>          ypos;
-<a name="l10884"></a>10884     <span class="keywordtype">double</span>          fvalue;
-<a name="l10885"></a>10885     <span class="keywordtype">int</span>             ivalue;
-<a name="l10886"></a>10886     <span class="keywordtype">int</span>             yint, ysize, yprev;
-<a name="l10887"></a>10887     <span class="keywordtype">int</span>             nslits;
-<a name="l10888"></a>10888     <span class="keywordtype">int</span>             npseudo;
-<a name="l10889"></a>10889     <span class="keywordtype">int</span>            *slit_id;
-<a name="l10890"></a>10890     <span class="keywordtype">int</span>            *position;
-<a name="l10891"></a>10891     <span class="keywordtype">int</span>            *length;
-<a name="l10892"></a>10892     <span class="keywordtype">int</span>             nx, ny;
-<a name="l10893"></a>10893     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;
-<a name="l10894"></a>10894     <span class="keywordtype">int</span>             missing_top, missing_bot;
-<a name="l10895"></a>10895     <span class="keywordtype">int</span>             null;
-<a name="l10896"></a>10896     <span class="keywordtype">int</span>             order;
-<a name="l10897"></a>10897     <span class="keywordtype">int</span>             i, j;
-<a name="l10898"></a>10898     cpl_size        k;
-<a name="l10899"></a>10899 
-<a name="l10900"></a>10900 
-<a name="l10901"></a>10901     <span class="keywordflow">if</span> (spatial == NULL || calibration == NULL || 
-<a name="l10902"></a>10902         slits == NULL || polytraces == NULL) {
-<a name="l10903"></a>10903         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l10904"></a>10904         <span class="keywordflow">return</span> NULL;
-<a name="l10905"></a>10905     }
-<a name="l10906"></a>10906 
-<a name="l10907"></a>10907     <span class="keywordflow">if</span> (dispersion <= 0.0) {
-<a name="l10908"></a>10908         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l10909"></a>10909         <span class="keywordflow">return</span> NULL;
-<a name="l10910"></a>10910     }
-<a name="l10911"></a>10911 
-<a name="l10912"></a>10912     <span class="keywordflow">if</span> (red - blue < dispersion) {
-<a name="l10913"></a>10913         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l10914"></a>10914         <span class="keywordflow">return</span> NULL;
-<a name="l10915"></a>10915     }
-<a name="l10916"></a>10916 
-<a name="l10917"></a>10917     nx = cpl_image_get_size_x(spatial);
-<a name="l10918"></a>10918     ny = cpl_image_get_size_y(spatial);
-<a name="l10919"></a>10919     ysize = cpl_image_get_size_y(calibration);
-<a name="l10920"></a>10920     remapped = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l10921"></a>10921     data  = cpl_image_get_data(remapped);
-<a name="l10922"></a>10922     sdata = cpl_image_get_data(spatial);
-<a name="l10923"></a>10923     wdata = cpl_image_get_data(calibration);
-<a name="l10924"></a>10924 
-<a name="l10925"></a>10925     nslits   = cpl_table_get_nrow(slits);
-<a name="l10926"></a>10926     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l10927"></a>10927     order    = cpl_table_get_ncol(polytraces) - 2;
-<a name="l10928"></a>10928     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);
-<a name="l10929"></a>10929     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l10930"></a>10930 
-<a name="l10931"></a>10931     <span class="comment">/*</span>
-<a name="l10932"></a>10932 <span class="comment">     * The spatial resampling is performed for a certain number of </span>
-<a name="l10933"></a>10933 <span class="comment">     * pixels above and below the position of the reference wavelength:</span>
-<a name="l10934"></a>10934 <span class="comment">     */</span>
-<a name="l10935"></a>10935 
-<a name="l10936"></a>10936     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;
-<a name="l10937"></a>10937     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;
-<a name="l10938"></a>10938 
-<a name="l10939"></a>10939     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l10940"></a>10940 
-<a name="l10941"></a>10941         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l10942"></a>10942             <span class="keywordflow">continue</span>;
-<a name="l10943"></a>10943 
-<a name="l10944"></a>10944         <span class="comment">/*</span>
-<a name="l10945"></a>10945 <span class="comment">         * Note that the x coordinate of the reference pixels on the CCD</span>
-<a name="l10946"></a>10946 <span class="comment">         * is taken arbitrarily at the top end of each slit. This wouldn't</span>
-<a name="l10947"></a>10947 <span class="comment">         * be entirely correct in case of curved slits, or in presence of</span>
-<a name="l10948"></a>10948 <span class="comment">         * heavy distortions: in such cases the spatial resampling is</span>
-<a name="l10949"></a>10949 <span class="comment">         * really performed across a wide range of wavelengths. But</span>
-<a name="l10950"></a>10950 <span class="comment">         * the lag between top and bottom spectral curvature models </span>
-<a name="l10951"></a>10951 <span class="comment">         * would introduce even in such cases negligible effects on</span>
-<a name="l10952"></a>10952 <span class="comment">         * the spectral spatial resampling.</span>
-<a name="l10953"></a>10953 <span class="comment">         */</span>
-<a name="l10954"></a>10954 
-<a name="l10955"></a>10955         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);
-<a name="l10956"></a>10956 
-<a name="l10957"></a>10957         start_pixel = refpixel - pixel_below;
-<a name="l10958"></a>10958         <span class="keywordflow">if</span> (start_pixel < 0)
-<a name="l10959"></a>10959             start_pixel = 0;
-<a name="l10960"></a>10960 
-<a name="l10961"></a>10961         end_pixel = refpixel + pixel_above;
-<a name="l10962"></a>10962         <span class="keywordflow">if</span> (end_pixel > nx)
-<a name="l10963"></a>10963             end_pixel = nx;
-<a name="l10964"></a>10964 
-<a name="l10965"></a>10965         <span class="comment">/*</span>
-<a name="l10966"></a>10966 <span class="comment">         * Recover from the table of spectral curvature coefficients</span>
-<a name="l10967"></a>10967 <span class="comment">         * the curvature polynomials.</span>
-<a name="l10968"></a>10968 <span class="comment">         */</span>
-<a name="l10969"></a>10969 
-<a name="l10970"></a>10970         missing_top = 0;
-<a name="l10971"></a>10971         polytop = cpl_polynomial_new(1);
-<a name="l10972"></a>10972         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l10973"></a>10973             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);
-<a name="l10974"></a>10974             <span class="keywordflow">if</span> (null) {
-<a name="l10975"></a>10975                 cpl_polynomial_delete(polytop);
-<a name="l10976"></a>10976                 missing_top = 1;
-<a name="l10977"></a>10977                 <span class="keywordflow">break</span>;
-<a name="l10978"></a>10978             }
-<a name="l10979"></a>10979             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l10980"></a>10980         }
-<a name="l10981"></a>10981 
-<a name="l10982"></a>10982         missing_bot = 0;
-<a name="l10983"></a>10983         polybot = cpl_polynomial_new(1);
-<a name="l10984"></a>10984         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l10985"></a>10985             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);
-<a name="l10986"></a>10986             <span class="keywordflow">if</span> (null) {
-<a name="l10987"></a>10987                 cpl_polynomial_delete(polybot);
-<a name="l10988"></a>10988                 missing_bot = 1;
-<a name="l10989"></a>10989                 <span class="keywordflow">break</span>;
-<a name="l10990"></a>10990             }
-<a name="l10991"></a>10991             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l10992"></a>10992         }
-<a name="l10993"></a>10993 
-<a name="l10994"></a>10994         <span class="keywordflow">if</span> (missing_top && missing_bot) {
-<a name="l10995"></a>10995             cpl_msg_debug(func, <span class="stringliteral">"Slit %d was not traced: no extraction!"</span>, 
-<a name="l10996"></a>10996                           slit_id[i]);
-<a name="l10997"></a>10997             <span class="keywordflow">continue</span>;
-<a name="l10998"></a>10998         }
-<a name="l10999"></a>10999 
-<a name="l11000"></a>11000         <span class="comment">/*</span>
-<a name="l11001"></a>11001 <span class="comment">         * In case just one of the two edges was not traced, the other</span>
-<a name="l11002"></a>11002 <span class="comment">         * edge curvature model is duplicated and shifted to the other</span>
-<a name="l11003"></a>11003 <span class="comment">         * end of the slit: better than nothing!</span>
-<a name="l11004"></a>11004 <span class="comment">         */</span>
-<a name="l11005"></a>11005 
-<a name="l11006"></a>11006         <span class="keywordflow">if</span> (missing_top) {
-<a name="l11007"></a>11007             cpl_msg_debug(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span>
-<a name="l11008"></a>11008                           <span class="stringliteral">"the spectral curvature of the lower edge "</span>
-<a name="l11009"></a>11009                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l11010"></a>11010             polytop = cpl_polynomial_duplicate(polybot);
-<a name="l11011"></a>11011             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l11012"></a>11012             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l11013"></a>11013             k = 0;
-<a name="l11014"></a>11014             coeff = cpl_polynomial_get_coeff(polybot, &k);
-<a name="l11015"></a>11015             coeff += ytop - ybot;
-<a name="l11016"></a>11016             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l11017"></a>11017         }
-<a name="l11018"></a>11018 
-<a name="l11019"></a>11019         <span class="keywordflow">if</span> (missing_bot) {
-<a name="l11020"></a>11020             cpl_msg_debug(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span>
-<a name="l11021"></a>11021                           <span class="stringliteral">"the spectral curvature of the upper edge "</span>
-<a name="l11022"></a>11022                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l11023"></a>11023             polybot = cpl_polynomial_duplicate(polytop);
-<a name="l11024"></a>11024             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l11025"></a>11025             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l11026"></a>11026             k = 0;
-<a name="l11027"></a>11027             coeff = cpl_polynomial_get_coeff(polytop, &k);
-<a name="l11028"></a>11028             coeff -= ytop - ybot;
-<a name="l11029"></a>11029             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l11030"></a>11030         }
-<a name="l11031"></a>11031 
-<a name="l11032"></a>11032         <span class="comment">/*</span>
-<a name="l11033"></a>11033 <span class="comment">         * Point to current slit on wavelength calibration image.</span>
-<a name="l11034"></a>11034 <span class="comment">         * Note that the npseudo value related to this slit is equal </span>
-<a name="l11035"></a>11035 <span class="comment">         * to the number of spatial pseudo-pixels decreased by 1 </span>
-<a name="l11036"></a>11036 <span class="comment">         * (compare with function mos_spatial_calibration()).</span>
-<a name="l11037"></a>11037 <span class="comment">         */</span>
-<a name="l11038"></a>11038 
-<a name="l11039"></a>11039         xdata = wdata + nx*position[i];
-<a name="l11040"></a>11040         npseudo = length[i] - 1;
-<a name="l11041"></a>11041 
-<a name="l11042"></a>11042         <span class="comment">/*</span>
-<a name="l11043"></a>11043 <span class="comment">         * Write interpolated wavelengths to CCD image</span>
-<a name="l11044"></a>11044 <span class="comment">         */</span>
-<a name="l11045"></a>11045 
-<a name="l11046"></a>11046         <span class="keywordflow">for</span> (j = start_pixel; j < end_pixel; j++) {
-<a name="l11047"></a>11047             top = cpl_polynomial_eval_1d(polytop, j, NULL);
-<a name="l11048"></a>11048             bot = cpl_polynomial_eval_1d(polybot, j, NULL);
-<a name="l11049"></a>11049             <span class="keywordflow">for</span> (k = 0; k <= npseudo; k++) {
-<a name="l11050"></a>11050                 ypos = top - k*(top-bot)/npseudo;
-<a name="l11051"></a>11051                 yint = ypos;
-<a name="l11052"></a>11052 
-<a name="l11053"></a>11053                 <span class="comment">/* </span>
-<a name="l11054"></a>11054 <span class="comment">                 * The line:</span>
-<a name="l11055"></a>11055 <span class="comment">                 *     value = sdata[j + nx*yint];</span>
-<a name="l11056"></a>11056 <span class="comment">                 * should be equivalent to:</span>
-<a name="l11057"></a>11057 <span class="comment">                 *     value = npseudo*(top-yint)/(top-bot);</span>
-<a name="l11058"></a>11058 <span class="comment">                 */</span>
-<a name="l11059"></a>11059 
-<a name="l11060"></a>11060                 <span class="keywordflow">if</span> (yint < 0 || yint >= ny-1) {
-<a name="l11061"></a>11061                     yprev = yint;
-<a name="l11062"></a>11062                     <span class="keywordflow">continue</span>;
-<a name="l11063"></a>11063                 }
-<a name="l11064"></a>11064 
-<a name="l11065"></a>11065                 value = sdata[j + nx*yint];   <span class="comment">/* Spatial coordinate on CCD */</span>
-<a name="l11066"></a>11066                 ivalue = value;               <span class="comment">/* Nearest spatial pixels:   */</span>
-<a name="l11067"></a>11067                 fvalue = value - ivalue;      <span class="comment">/* ivalue and ivalue+1       */</span>
-<a name="l11068"></a>11068                 <span class="keywordflow">if</span> (ivalue < npseudo && ivalue >= 0) {
-<a name="l11069"></a>11069                     vtop = xdata[j + nx*(npseudo-ivalue)];
-<a name="l11070"></a>11070                     vbot = xdata[j + nx*(npseudo-ivalue-1)];
-<a name="l11071"></a>11071                     <span class="keywordflow">if</span> (vtop < 1.0) {  <span class="comment">/* Impossible wavelength */</span>
-<a name="l11072"></a>11072                         <span class="keywordflow">if</span> (vbot < 1.0) {
-<a name="l11073"></a>11073                             value = 0.0;
-<a name="l11074"></a>11074                         }
-<a name="l11075"></a>11075                         <span class="keywordflow">else</span> {
-<a name="l11076"></a>11076                             value = vbot;
-<a name="l11077"></a>11077                         }
-<a name="l11078"></a>11078                     }
-<a name="l11079"></a>11079                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (vbot < 1.0) {
-<a name="l11080"></a>11080                         <span class="keywordflow">if</span> (k)
-<a name="l11081"></a>11081                             value = vtop;
-<a name="l11082"></a>11082                         <span class="keywordflow">else</span>
-<a name="l11083"></a>11083                             value = 0.0;
-<a name="l11084"></a>11084                     }
-<a name="l11085"></a>11085                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fabs(vbot-vtop) > 10*dispersion) {
-<a name="l11086"></a>11086                         value = 0.0;
-<a name="l11087"></a>11087                     }
-<a name="l11088"></a>11088                     <span class="keywordflow">else</span> {
-<a name="l11089"></a>11089                         value = vtop*(1-fvalue) + vbot*fvalue;
-<a name="l11090"></a>11090                     }
-<a name="l11091"></a>11091                     data[j + nx*yint] = value;
-<a name="l11092"></a>11092 
-<a name="l11093"></a>11093                     <span class="keywordflow">if</span> (k) {
-<a name="l11094"></a>11094 
-<a name="l11095"></a>11095                         <span class="comment">/*</span>
-<a name="l11096"></a>11096 <span class="comment">                         * This is added to recover lost pixels on</span>
-<a name="l11097"></a>11097 <span class="comment">                         * the CCD image (pixels are lost because</span>
-<a name="l11098"></a>11098 <span class="comment">                         * the CCD pixels are less than npseudo+1).</span>
-<a name="l11099"></a>11099 <span class="comment">                         */</span>
-<a name="l11100"></a>11100 
-<a name="l11101"></a>11101                         <span class="keywordflow">if</span> (yprev - yint > 1) {
-<a name="l11102"></a>11102                             value = sdata[j + nx*(yint+1)];
-<a name="l11103"></a>11103                             ivalue = value;
-<a name="l11104"></a>11104                             fvalue = value - ivalue;
-<a name="l11105"></a>11105                             <span class="keywordflow">if</span> (ivalue < npseudo && ivalue >= 0) {
-<a name="l11106"></a>11106                                 vtop = xdata[j + nx*(npseudo-ivalue)];
-<a name="l11107"></a>11107                                 vbot = xdata[j + nx*(npseudo-ivalue-1)];
-<a name="l11108"></a>11108                                 <span class="keywordflow">if</span> (vtop < 1.0) {
-<a name="l11109"></a>11109                                     <span class="keywordflow">if</span> (vbot < 1.0) {
-<a name="l11110"></a>11110                                         value = data[j + nx*(yint+1)];
-<a name="l11111"></a>11111                                     }
-<a name="l11112"></a>11112                                     <span class="keywordflow">else</span> {
-<a name="l11113"></a>11113                                         value = vbot;
-<a name="l11114"></a>11114                                     }
-<a name="l11115"></a>11115                                 }
-<a name="l11116"></a>11116                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (vbot < 1.0) {
-<a name="l11117"></a>11117                                     value = vtop;
-<a name="l11118"></a>11118                                 }
-<a name="l11119"></a>11119                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fabs(vbot-vtop) > 2*dispersion) {
-<a name="l11120"></a>11120                                     value = vtop;
-<a name="l11121"></a>11121                                 }
-<a name="l11122"></a>11122                                 <span class="keywordflow">else</span> {
-<a name="l11123"></a>11123                                     value = vtop*(1-fvalue) + vbot*fvalue;
-<a name="l11124"></a>11124                                 }
-<a name="l11125"></a>11125                                 data[j + nx*(yint+1)] = value;
-<a name="l11126"></a>11126                             }
-<a name="l11127"></a>11127                         }
-<a name="l11128"></a>11128                     }
-<a name="l11129"></a>11129                 }
-<a name="l11130"></a>11130                 yprev = yint;
-<a name="l11131"></a>11131             }
-<a name="l11132"></a>11132         }
-<a name="l11133"></a>11133         cpl_polynomial_delete(polytop);
-<a name="l11134"></a>11134         cpl_polynomial_delete(polybot);
-<a name="l11135"></a>11135     }
-<a name="l11136"></a>11136 
-<a name="l11137"></a>11137     <span class="keywordflow">return</span> remapped;
-<a name="l11138"></a>11138 }
-<a name="l11139"></a>11139 
-<a name="l11213"></a><a class="code" href="group__moses.html#g2940e2350a3c050fc3bff7af0e621c37">11213</a> cpl_image *<a class="code" href="group__moses.html#g2940e2350a3c050fc3bff7af0e621c37">mos_map_spectrum</a>(cpl_image *spectra, cpl_image *wavecalib, 
-<a name="l11214"></a>11214                             cpl_image *spatial, cpl_table *slits,
-<a name="l11215"></a>11215                             cpl_table *polytraces, <span class="keywordtype">double</span> reference,
-<a name="l11216"></a>11216                             <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion,
-<a name="l11217"></a>11217                             <span class="keywordtype">int</span> flux)
-<a name="l11218"></a>11218 {
-<a name="l11219"></a>11219     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_map_spectrum"</span>;
-<a name="l11220"></a>11220     
-<a name="l11221"></a>11221     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l11222"></a>11222                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l11223"></a>11223     cpl_polynomial *polytop;
-<a name="l11224"></a>11224     cpl_polynomial *polybot;
-<a name="l11225"></a>11225     cpl_image      *remapped;
-<a name="l11226"></a>11226     cpl_image     **exslit;
-<a name="l11227"></a>11227     <span class="keywordtype">float</span>          *data;
-<a name="l11228"></a>11228     <span class="keywordtype">float</span>          *wdata;
-<a name="l11229"></a>11229     <span class="keywordtype">float</span>          *sdata;
-<a name="l11230"></a>11230     <span class="keywordtype">float</span>          *xdata;
-<a name="l11231"></a>11231     <span class="keywordtype">double</span>          lambda00, lambda01, lambda10, lambda11, lambda;
-<a name="l11232"></a>11232     <span class="keywordtype">double</span>          space00, space01, space10, space11, space;
-<a name="l11233"></a>11233     <span class="keywordtype">double</span>          value00, value01, value10, value11, value0, value1, value;
-<a name="l11234"></a>11234     <span class="keywordtype">double</span>          dL, dS;
-<a name="l11235"></a>11235     <span class="keywordtype">double</span>          top, bot;
-<a name="l11236"></a>11236     <span class="keywordtype">double</span>          coeff;
-<a name="l11237"></a>11237     <span class="keywordtype">double</span>          ytop, ybot;
-<a name="l11238"></a>11238     <span class="keywordtype">double</span>          xfrac, yfrac;
-<a name="l11239"></a>11239     <span class="keywordtype">int</span>             yint, ysize;
-<a name="l11240"></a>11240     <span class="keywordtype">int</span>             itop, ibot;
-<a name="l11241"></a>11241     <span class="keywordtype">int</span>             shift;
-<a name="l11242"></a>11242     <span class="keywordtype">int</span>             L, S;
-<a name="l11243"></a>11243     <span class="keywordtype">int</span>             nslits;
-<a name="l11244"></a>11244     <span class="keywordtype">int</span>             npseudo;
-<a name="l11245"></a>11245     <span class="keywordtype">int</span>            *slit_id;
-<a name="l11246"></a>11246     <span class="keywordtype">int</span>            *position;
-<a name="l11247"></a>11247     <span class="keywordtype">int</span>            *length;
-<a name="l11248"></a>11248     <span class="keywordtype">int</span>             nx, ny;
-<a name="l11249"></a>11249     <span class="keywordtype">int</span>             x, y;
-<a name="l11250"></a>11250     <span class="keywordtype">int</span>             nlambda;
-<a name="l11251"></a>11251     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;
-<a name="l11252"></a>11252     <span class="keywordtype">int</span>             missing_top, missing_bot; 
-<a name="l11253"></a>11253     <span class="keywordtype">int</span>             null;
-<a name="l11254"></a>11254     <span class="keywordtype">int</span>             order;
-<a name="l11255"></a>11255     <span class="keywordtype">int</span>             i; 
-<a name="l11256"></a>11256     cpl_size        k;
-<a name="l11257"></a>11257     
-<a name="l11258"></a>11258 
-<a name="l11259"></a>11259     flux += flux;
-<a name="l11260"></a>11260 
-<a name="l11261"></a>11261     <span class="keywordflow">if</span> (spectra == NULL || spatial == NULL || wavecalib == NULL ||
-<a name="l11262"></a>11262         slits == NULL || polytraces == NULL) { 
-<a name="l11263"></a>11263         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l11264"></a>11264         <span class="keywordflow">return</span> NULL;
-<a name="l11265"></a>11265     }
-<a name="l11266"></a>11266 
-<a name="l11267"></a>11267     <span class="keywordflow">if</span> (dispersion <= 0.0) {
-<a name="l11268"></a>11268         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l11269"></a>11269         <span class="keywordflow">return</span> NULL;
-<a name="l11270"></a>11270     }
-<a name="l11271"></a>11271 
-<a name="l11272"></a>11272     <span class="keywordflow">if</span> (red - blue < dispersion) {
-<a name="l11273"></a>11273         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l11274"></a>11274         <span class="keywordflow">return</span> NULL;
-<a name="l11275"></a>11275     }
-<a name="l11276"></a>11276     
-<a name="l11277"></a>11277     nx = cpl_image_get_size_x(spectra);
-<a name="l11278"></a>11278     ny = cpl_image_get_size_y(spectra);
-<a name="l11279"></a>11279 
-<a name="l11280"></a>11280     <span class="keywordflow">if</span> (nx != cpl_image_get_size_x(spatial) ||
-<a name="l11281"></a>11281         ny != cpl_image_get_size_y(spatial) ||
-<a name="l11282"></a>11282         nx != cpl_image_get_size_x(wavecalib) ||
-<a name="l11283"></a>11283         ny != cpl_image_get_size_y(wavecalib)) {
-<a name="l11284"></a>11284         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l11285"></a>11285         <span class="keywordflow">return</span> NULL;
-<a name="l11286"></a>11286     }
-<a name="l11287"></a>11287 
-<a name="l11288"></a>11288     nlambda     = STRETCH_FACTOR * (red - blue) / dispersion;
-<a name="l11289"></a>11289     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;
-<a name="l11290"></a>11290     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;
-<a name="l11291"></a>11291 
-<a name="l11292"></a>11292     data  = cpl_image_get_data(spectra);
-<a name="l11293"></a>11293     sdata = cpl_image_get_data(spatial);
-<a name="l11294"></a>11294     wdata = cpl_image_get_data(wavecalib);
-<a name="l11295"></a>11295     
-<a name="l11296"></a>11296     nslits   = cpl_table_get_nrow(slits);
-<a name="l11297"></a>11297     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l11298"></a>11298     order    = cpl_table_get_ncol(polytraces) - 2;
-<a name="l11299"></a>11299     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);
-<a name="l11300"></a>11300     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l11301"></a>11301     
-<a name="l11302"></a>11302     exslit = cpl_calloc(nslits, <span class="keyword">sizeof</span>(cpl_image *));
-<a name="l11303"></a>11303 
-<a name="l11304"></a>11304     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l11305"></a>11305 
-<a name="l11306"></a>11306          <span class="keywordflow">if</span> (length == 0)
-<a name="l11307"></a>11307              <span class="keywordflow">continue</span>;
-<a name="l11308"></a>11308 
-<a name="l11309"></a>11309         <span class="comment">/*</span>
-<a name="l11310"></a>11310 <span class="comment">         * Note that the x coordinate of the reference pixels on the CCD</span>
-<a name="l11311"></a>11311 <span class="comment">         * is taken arbitrarily at the top end of each slit. This wouldn't</span>
-<a name="l11312"></a>11312 <span class="comment">         * be entirely correct in case of curved slits, or in presence of</span>
-<a name="l11313"></a>11313 <span class="comment">         * heavy distortions: in such cases the spatial resampling is</span>
-<a name="l11314"></a>11314 <span class="comment">         * really performed across a wide range of wavelengths. But</span>
-<a name="l11315"></a>11315 <span class="comment">         * the lag between top and bottom spectral curvature models</span>
-<a name="l11316"></a>11316 <span class="comment">         * would introduce even in such cases negligible effects on</span>
-<a name="l11317"></a>11317 <span class="comment">         * the spectral spatial resampling.</span>
-<a name="l11318"></a>11318 <span class="comment">         */</span>
-<a name="l11319"></a>11319 
-<a name="l11320"></a>11320         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);
-<a name="l11321"></a>11321 
-<a name="l11322"></a>11322         start_pixel = refpixel - pixel_below;
-<a name="l11323"></a>11323         <span class="keywordflow">if</span> (start_pixel < 1)
-<a name="l11324"></a>11324             start_pixel = 1;
-<a name="l11325"></a>11325 
-<a name="l11326"></a>11326         end_pixel = refpixel + pixel_above;
-<a name="l11327"></a>11327         <span class="keywordflow">if</span> (end_pixel > nx)
-<a name="l11328"></a>11328             end_pixel = nx;
-<a name="l11329"></a>11329 
-<a name="l11330"></a>11330         <span class="comment">/*</span>
-<a name="l11331"></a>11331 <span class="comment">         * Recover from the table of spectral curvature coefficients</span>
-<a name="l11332"></a>11332 <span class="comment">         * the curvature polynomials.</span>
-<a name="l11333"></a>11333 <span class="comment">         */</span>
-<a name="l11334"></a>11334 
-<a name="l11335"></a>11335         missing_top = 0;
-<a name="l11336"></a>11336         polytop = cpl_polynomial_new(1);
-<a name="l11337"></a>11337         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l11338"></a>11338             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);
-<a name="l11339"></a>11339             <span class="keywordflow">if</span> (null) {
-<a name="l11340"></a>11340                 cpl_polynomial_delete(polytop);
-<a name="l11341"></a>11341                 missing_top = 1;
-<a name="l11342"></a>11342                 <span class="keywordflow">break</span>;
-<a name="l11343"></a>11343             }
-<a name="l11344"></a>11344             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l11345"></a>11345         }
-<a name="l11346"></a>11346 
-<a name="l11347"></a>11347         missing_bot = 0;
-<a name="l11348"></a>11348         polybot = cpl_polynomial_new(1);
-<a name="l11349"></a>11349         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l11350"></a>11350             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);
-<a name="l11351"></a>11351             <span class="keywordflow">if</span> (null) {
-<a name="l11352"></a>11352                 cpl_polynomial_delete(polybot);
-<a name="l11353"></a>11353                 missing_bot = 1;
-<a name="l11354"></a>11354                 <span class="keywordflow">break</span>;
-<a name="l11355"></a>11355             }
-<a name="l11356"></a>11356             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l11357"></a>11357         }
-<a name="l11358"></a>11358 
-<a name="l11359"></a>11359         <span class="keywordflow">if</span> (missing_top && missing_bot) {
-<a name="l11360"></a>11360             cpl_msg_debug(func, <span class="stringliteral">"Slit %d was not traced: no extraction!"</span>,
-<a name="l11361"></a>11361                           slit_id[i]);
-<a name="l11362"></a>11362             <span class="keywordflow">continue</span>;
-<a name="l11363"></a>11363         }
-<a name="l11364"></a>11364 
-<a name="l11365"></a>11365         <span class="comment">/*</span>
-<a name="l11366"></a>11366 <span class="comment">         * In case just one of the two edges was not traced, the other</span>
-<a name="l11367"></a>11367 <span class="comment">         * edge curvature model is duplicated and shifted to the other</span>
-<a name="l11368"></a>11368 <span class="comment">         * end of the slit: better than nothing!</span>
-<a name="l11369"></a>11369 <span class="comment">         */</span>
-<a name="l11370"></a>11370 
-<a name="l11371"></a>11371         <span class="keywordflow">if</span> (missing_top) {
-<a name="l11372"></a>11372             cpl_msg_debug(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span>
-<a name="l11373"></a>11373                           <span class="stringliteral">"the spectral curvature of the lower edge "</span>
-<a name="l11374"></a>11374                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l11375"></a>11375             polytop = cpl_polynomial_duplicate(polybot);
-<a name="l11376"></a>11376             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l11377"></a>11377             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l11378"></a>11378             k = 0;
-<a name="l11379"></a>11379             coeff = cpl_polynomial_get_coeff(polybot, &k);
-<a name="l11380"></a>11380             coeff += ytop - ybot;
-<a name="l11381"></a>11381             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l11382"></a>11382         }
-<a name="l11383"></a>11383 
-<a name="l11384"></a>11384         <span class="keywordflow">if</span> (missing_bot) {
-<a name="l11385"></a>11385             cpl_msg_debug(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span>
-<a name="l11386"></a>11386                           <span class="stringliteral">"the spectral curvature of the upper edge "</span>
-<a name="l11387"></a>11387                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l11388"></a>11388             polybot = cpl_polynomial_duplicate(polytop);
-<a name="l11389"></a>11389             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l11390"></a>11390             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l11391"></a>11391             k = 0;
-<a name="l11392"></a>11392             coeff = cpl_polynomial_get_coeff(polytop, &k);
-<a name="l11393"></a>11393             coeff -= ytop - ybot;
-<a name="l11394"></a>11394             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l11395"></a>11395         }
-<a name="l11396"></a>11396 
-<a name="l11397"></a>11397         <span class="comment">/*</span>
-<a name="l11398"></a>11398 <span class="comment">         * Allocate image for current extracted slit</span>
-<a name="l11399"></a>11399 <span class="comment">         */</span>
-<a name="l11400"></a>11400 
-<a name="l11401"></a>11401         top = cpl_polynomial_eval_1d(polytop, refpixel, NULL);
-<a name="l11402"></a>11402         bot = cpl_polynomial_eval_1d(polybot, refpixel, NULL);
-<a name="l11403"></a>11403         npseudo = ceil(top-bot) + 1;
-<a name="l11404"></a>11404 
-<a name="l11405"></a>11405         <span class="keywordflow">if</span> (npseudo < 1) {
-<a name="l11406"></a>11406             cpl_polynomial_delete(polytop);
-<a name="l11407"></a>11407             cpl_polynomial_delete(polybot);
-<a name="l11408"></a>11408             cpl_msg_debug(func, <span class="stringliteral">"Slit %d was badly traced: no extraction!"</span>,
-<a name="l11409"></a>11409                           slit_id[i]);
-<a name="l11410"></a>11410             <span class="keywordflow">continue</span>;
-<a name="l11411"></a>11411         }
-<a name="l11412"></a>11412 
-<a name="l11413"></a>11413         exslit[i] = cpl_image_new(nlambda, npseudo+1, CPL_TYPE_FLOAT);
-<a name="l11414"></a>11414         xdata = cpl_image_get_data(exslit[i]);
-<a name="l11415"></a>11415 
-<a name="l11416"></a>11416         <span class="comment">/*</span>
-<a name="l11417"></a>11417 <span class="comment">         * Write interpolated spectral values to remapped slit spectrum.</span>
-<a name="l11418"></a>11418 <span class="comment">         */</span>
-<a name="l11419"></a>11419 
-<a name="l11420"></a>11420         <span class="keywordflow">for</span> (x = start_pixel; x < end_pixel; x++) {
-<a name="l11421"></a>11421             top = cpl_polynomial_eval_1d(polytop, x, NULL);
-<a name="l11422"></a>11422             bot = cpl_polynomial_eval_1d(polybot, x, NULL);
-<a name="l11423"></a>11423             itop = top + 1;
-<a name="l11424"></a>11424             ibot = bot;
-<a name="l11425"></a>11425             <span class="keywordflow">if</span> (itop < 0)
-<a name="l11426"></a>11426                 itop = 0;
-<a name="l11427"></a>11427             <span class="keywordflow">if</span> (itop > ny - 1)
-<a name="l11428"></a>11428                 itop = ny - 1;
-<a name="l11429"></a>11429             <span class="keywordflow">if</span> (ibot < 0)
-<a name="l11430"></a>11430                 ibot = 0;
-<a name="l11431"></a>11431             <span class="keywordflow">if</span> (ibot > ny - 1)
-<a name="l11432"></a>11432                 ibot = ny - 1;
-<a name="l11433"></a>11433             <span class="keywordflow">for</span> (y = ibot; y < itop; y++) {
-<a name="l11434"></a>11434                  lambda11 = wdata[x + y*nx];
-<a name="l11435"></a>11435                  <span class="keywordflow">if</span> (lambda11 < 1.0)        <span class="comment">/* Impossible wavelength */</span>
-<a name="l11436"></a>11436                      <span class="keywordflow">continue</span>;
-<a name="l11437"></a>11437                  space11 = sdata[x + y*nx];
-<a name="l11438"></a>11438                  <span class="keywordflow">if</span> (space11 < 0.0)         <span class="comment">/* Impossible spatial coordinate */</span>
-<a name="l11439"></a>11439                      <span class="keywordflow">continue</span>;
-<a name="l11440"></a>11440                  lambda01 = wdata[x - 1 + y*nx];
-<a name="l11441"></a>11441                  <span class="keywordflow">if</span> (lambda01 < 1.0)        <span class="comment">/* Impossible wavelength */</span>
-<a name="l11442"></a>11442                      <span class="keywordflow">continue</span>;
-<a name="l11443"></a>11443                  space01 = sdata[x - 1 + y*nx];
-<a name="l11444"></a>11444                  <span class="keywordflow">if</span> (space01 < 0.0)         <span class="comment">/* Impossible spatial coordinate */</span>
-<a name="l11445"></a>11445                      <span class="keywordflow">continue</span>;
-<a name="l11446"></a>11446 
-<a name="l11447"></a>11447                  shift = 0;
-<a name="l11448"></a>11448 
-<a name="l11449"></a>11449 <span class="comment">/****+</span>
-<a name="l11450"></a>11450 <span class="comment">                 if (wdata[x + (y+1)*nx] > 1.0) {</span>
-<a name="l11451"></a>11451 <span class="comment">                     if (wdata[x + (y+1)*nx] - lambda11 > 0) {</span>
-<a name="l11452"></a>11452 <span class="comment">                         shift = -1;</span>
-<a name="l11453"></a>11453 <span class="comment">                         while (wdata[x + shift + (y+1)*nx] - lambda11 > 0)</span>
-<a name="l11454"></a>11454 <span class="comment">                             shift--;</span>
-<a name="l11455"></a>11455 <span class="comment">                         if (lambda11 - wdata[x + shift + (y+1)*nx] > </span>
-<a name="l11456"></a>11456 <span class="comment">                             wdata[x + shift + 1 + (y+1)*nx] - lambda11) {</span>
-<a name="l11457"></a>11457 <span class="comment">                             shift++;</span>
-<a name="l11458"></a>11458 <span class="comment">                         }</span>
-<a name="l11459"></a>11459 <span class="comment">                     }</span>
-<a name="l11460"></a>11460 <span class="comment">                     else {</span>
-<a name="l11461"></a>11461 <span class="comment">                         shift = 1;</span>
-<a name="l11462"></a>11462 <span class="comment">                         while (wdata[x + shift + (y+1)*nx] - lambda11 < 0)</span>
-<a name="l11463"></a>11463 <span class="comment">                             shift++;</span>
-<a name="l11464"></a>11464 <span class="comment">                         if (wdata[x + shift + (y+1)*nx] - lambda11 ></span>
-<a name="l11465"></a>11465 <span class="comment">                             lambda11 - wdata[x + shift + 1 + (y+1)*nx]) {</span>
-<a name="l11466"></a>11466 <span class="comment">                             shift--;</span>
-<a name="l11467"></a>11467 <span class="comment">                         }</span>
-<a name="l11468"></a>11468 <span class="comment">                     }</span>
-<a name="l11469"></a>11469 <span class="comment">                 }</span>
-<a name="l11470"></a>11470 <span class="comment">****/</span>
-<a name="l11471"></a>11471 
-<a name="l11472"></a>11472 <span class="comment">/****</span>
-<a name="l11473"></a>11473 <span class="comment">printf("y = %d, shift = %d\n", y, shift);</span>
-<a name="l11474"></a>11474 <span class="comment">****/</span>
-<a name="l11475"></a>11475 
-<a name="l11476"></a>11476                  lambda10 = wdata[x + shift + (y+1)*nx];
-<a name="l11477"></a>11477                  <span class="keywordflow">if</span> (lambda10 < 1.0)        <span class="comment">/* Impossible wavelength */</span>
-<a name="l11478"></a>11478                      <span class="keywordflow">continue</span>;
-<a name="l11479"></a>11479                  space10 = sdata[x + shift + (y+1)*nx];
-<a name="l11480"></a>11480                  <span class="keywordflow">if</span> (space10 < 0.0)         <span class="comment">/* Impossible spatial coordinate */</span>
-<a name="l11481"></a>11481                      <span class="keywordflow">continue</span>;
-<a name="l11482"></a>11482                  lambda00 = wdata[x - 1 + shift + (y+1)*nx];
-<a name="l11483"></a>11483                  <span class="keywordflow">if</span> (lambda00 < 1.0)        <span class="comment">/* Impossible wavelength */</span>
-<a name="l11484"></a>11484                      <span class="keywordflow">continue</span>;
-<a name="l11485"></a>11485                  space00 = sdata[x - 1 + shift + (y+1)*nx];
-<a name="l11486"></a>11486                  <span class="keywordflow">if</span> (space00 < 0.0)         <span class="comment">/* Impossible spatial coordinate */</span>
-<a name="l11487"></a>11487                      <span class="keywordflow">continue</span>;
-<a name="l11488"></a>11488                  
-<a name="l11489"></a>11489                  <span class="comment">/*</span>
-<a name="l11490"></a>11490 <span class="comment">                  * Find the variation in lambda and space in this</span>
-<a name="l11491"></a>11491 <span class="comment">                  * position for each CCD pixel (both quantities are </span>
-<a name="l11492"></a>11492 <span class="comment">                  * expected to be positive).</span>
-<a name="l11493"></a>11493 <span class="comment">                  */</span>
-<a name="l11494"></a>11494 
-<a name="l11495"></a>11495                  dL = lambda11 - lambda01;
-<a name="l11496"></a>11496                  dS = space11 - space10;
-<a name="l11497"></a>11497 
-<a name="l11498"></a>11498                  <span class="comment">/*</span>
-<a name="l11499"></a>11499 <span class="comment">                  * Find the position (L,S) of the output pixel </span>
-<a name="l11500"></a>11500 <span class="comment">                  * (by integer truncation).</span>
-<a name="l11501"></a>11501 <span class="comment">                  */</span>
-<a name="l11502"></a>11502 
-<a name="l11503"></a>11503                  L = (lambda11 - blue)/dispersion + 0.5;
-<a name="l11504"></a>11504                  S = space11 + 0.5;                   <span class="comment">/* Counted from top! */</span>
-<a name="l11505"></a>11505 
-<a name="l11506"></a>11506                  <span class="keywordflow">if</span> (L < 0 || L >= nlambda)
-<a name="l11507"></a>11507                      <span class="keywordflow">continue</span>;
-<a name="l11508"></a>11508                  <span class="keywordflow">if</span> (S < 0 || S > npseudo)
-<a name="l11509"></a>11509                      <span class="keywordflow">continue</span>;
-<a name="l11510"></a>11510 
-<a name="l11511"></a>11511                  <span class="comment">/*</span>
-<a name="l11512"></a>11512 <span class="comment">                  * Find the coordinate of pixel (L,S)</span>
-<a name="l11513"></a>11513 <span class="comment">                  */</span>
-<a name="l11514"></a>11514 
-<a name="l11515"></a>11515                  lambda = blue + L*dispersion;
-<a name="l11516"></a>11516                  space  = S;
-<a name="l11517"></a>11517 
-<a name="l11518"></a>11518                  <span class="comment">/*</span>
-<a name="l11519"></a>11519 <span class="comment">                  * Find the interpolation point on the CCD: it is</span>
-<a name="l11520"></a>11520 <span class="comment">                  * defined as the (positive) distance from current</span>
-<a name="l11521"></a>11521 <span class="comment">                  * CCD pixel (x,y) of the interpolation point (x',y'),</span>
-<a name="l11522"></a>11522 <span class="comment">                  * measured in CCD pixels. The interpolation point</span>
-<a name="l11523"></a>11523 <span class="comment">                  * is located between the four CCD pixels selected</span>
-<a name="l11524"></a>11524 <span class="comment">                  * above.</span>
-<a name="l11525"></a>11525 <span class="comment">                  */</span>
-<a name="l11526"></a>11526 
-<a name="l11527"></a>11527                  xfrac = (lambda11-lambda)/dL;
-<a name="l11528"></a>11528                  yfrac = (space11-space)/dS;
-<a name="l11529"></a>11529 
-<a name="l11530"></a>11530 <span class="comment">/*</span>
-<a name="l11531"></a>11531 <span class="comment">if (xfrac < 0.0 || xfrac > 1.0 || yfrac < 0.0 || yfrac > 1.0)</span>
-<a name="l11532"></a>11532 <span class="comment">printf("xyfrac = %f, %f\n", xfrac, yfrac);</span>
-<a name="l11533"></a>11533 <span class="comment">*/</span>
-<a name="l11534"></a>11534 
-<a name="l11535"></a>11535                  <span class="comment">/*</span>
-<a name="l11536"></a>11536 <span class="comment">                  * Get the four values to interpolate</span>
-<a name="l11537"></a>11537 <span class="comment">                  */</span>
-<a name="l11538"></a>11538 
-<a name="l11539"></a>11539                  value11 = data[x + y*nx];
-<a name="l11540"></a>11540                  value01 = data[x - 1 + y*nx];
-<a name="l11541"></a>11541                  value10 = data[x + shift + (y+1)*nx];
-<a name="l11542"></a>11542                  value00 = data[x + shift - 1 + (y+1)*nx];
-<a name="l11543"></a>11543 
-<a name="l11544"></a>11544                  <span class="comment">/*</span>
-<a name="l11545"></a>11545 <span class="comment">                  * Interpolation</span>
-<a name="l11546"></a>11546 <span class="comment">                  */</span>
-<a name="l11547"></a>11547 
-<a name="l11548"></a>11548                  value1 = (1-xfrac)*value11 + xfrac*value01;
-<a name="l11549"></a>11549                  value0 = (1-xfrac)*value10 + xfrac*value00;
-<a name="l11550"></a>11550                  value  = (1-yfrac)*value1  + yfrac*value0;
-<a name="l11551"></a>11551 
-<a name="l11552"></a>11552                  <span class="comment">/*</span>
-<a name="l11553"></a>11553 <span class="comment">                  * Write this value to the appropriate (L,S) coordinate</span>
-<a name="l11554"></a>11554 <span class="comment">                  * on output slit</span>
-<a name="l11555"></a>11555 <span class="comment">                  */</span>
-<a name="l11556"></a>11556 
-<a name="l11557"></a>11557                  xdata[L + nlambda*(npseudo-S)] = value;
-<a name="l11558"></a>11558                  
-<a name="l11559"></a>11559             }
-<a name="l11560"></a>11560         }
-<a name="l11561"></a>11561         cpl_polynomial_delete(polytop);
-<a name="l11562"></a>11562         cpl_polynomial_delete(polybot);
-<a name="l11563"></a>11563     }
-<a name="l11564"></a>11564 
-<a name="l11565"></a>11565     <span class="comment">/*</span>
-<a name="l11566"></a>11566 <span class="comment">     * Now all the slits images are copied to a single image</span>
-<a name="l11567"></a>11567 <span class="comment">     */</span>
-<a name="l11568"></a>11568 
-<a name="l11569"></a>11569     ysize = 0;
-<a name="l11570"></a>11570     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)
-<a name="l11571"></a>11571         <span class="keywordflow">if</span> (exslit[i])
-<a name="l11572"></a>11572             ysize += cpl_image_get_size_y(exslit[i]);
-<a name="l11573"></a>11573 
-<a name="l11574"></a>11574     remapped = cpl_image_new(nlambda, ysize, CPL_TYPE_FLOAT);
-<a name="l11575"></a>11575 
-<a name="l11576"></a>11576     yint = -1;
-<a name="l11577"></a>11577     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l11578"></a>11578         <span class="keywordflow">if</span> (exslit[i]) {
-<a name="l11579"></a>11579             yint += cpl_image_get_size_y(exslit[i]);
-<a name="l11580"></a>11580             cpl_image_copy(remapped, exslit[i], 1, ysize - yint);
-<a name="l11581"></a>11581             cpl_image_delete(exslit[i]);
-<a name="l11582"></a>11582             cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, i, ysize - yint - 1);
-<a name="l11583"></a>11583         }
-<a name="l11584"></a>11584     }
-<a name="l11585"></a>11585 
-<a name="l11586"></a>11586     cpl_free(exslit);
-<a name="l11587"></a>11587 
-<a name="l11588"></a>11588     <span class="keywordflow">return</span> remapped;
-<a name="l11589"></a>11589 
-<a name="l11590"></a>11590 }
-<a name="l11591"></a>11591 
-<a name="l11592"></a>11592 
-<a name="l11625"></a><a class="code" href="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1">11625</a> cpl_table *<a class="code" href="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1">mos_sky_map_super</a>(cpl_image *spectra, cpl_image *wavemap,
-<a name="l11626"></a>11626                              <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> factor, <span class="keywordtype">int</span> minpoints,
-<a name="l11627"></a>11627                              cpl_image *skymap)
-<a name="l11628"></a>11628 {
-<a name="l11629"></a>11629     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_sky_map_super"</span>;
-<a name="l11630"></a>11630 
-<a name="l11631"></a>11631     cpl_vector **vector;
-<a name="l11632"></a>11632     cpl_vector **wvector;
-<a name="l11633"></a>11633     <span class="keywordtype">double</span>       firstLambda, lastLambda;
-<a name="l11634"></a>11634     <span class="keywordtype">double</span>       lambda, lambda1, lambda2;
-<a name="l11635"></a>11635     <span class="keywordtype">double</span>       value, value1, value2;
-<a name="l11636"></a>11636     <span class="keywordtype">double</span>       frac;
-<a name="l11637"></a>11637     <span class="keywordtype">float</span>        min, max;
-<a name="l11638"></a>11638     <span class="keywordtype">int</span>         *count;
-<a name="l11639"></a>11639     <span class="keywordtype">int</span>          nbin, bin;
-<a name="l11640"></a>11640     <span class="keywordtype">int</span>          nx, ny, npix;
-<a name="l11641"></a>11641     <span class="keywordtype">int</span>          first_valid, valid_bins;
-<a name="l11642"></a>11642     <span class="keywordtype">int</span>          i, j;
-<a name="l11643"></a>11643 
-<a name="l11644"></a>11644     cpl_table   *sky;
-<a name="l11645"></a>11645     <span class="keywordtype">double</span>      *sky_spectrum;
-<a name="l11646"></a>11646     <span class="keywordtype">double</span>      *sky_wave;
-<a name="l11647"></a>11647     <span class="keywordtype">float</span>       *data;
-<a name="l11648"></a>11648     <span class="keywordtype">float</span>       *sdata;
-<a name="l11649"></a>11649     <span class="keywordtype">float</span>       *kdata;
-<a name="l11650"></a>11650 
-<a name="l11651"></a>11651 
-<a name="l11652"></a>11652     <span class="keywordflow">if</span> (spectra == NULL || wavemap == NULL || skymap == NULL) {
-<a name="l11653"></a>11653         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l11654"></a>11654         <span class="keywordflow">return</span> NULL;
-<a name="l11655"></a>11655     }
-<a name="l11656"></a>11656     
-<a name="l11657"></a>11657     <span class="keywordflow">if</span> (dispersion <= 0.0) {
-<a name="l11658"></a>11658         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l11659"></a>11659         cpl_msg_error(func, <span class="stringliteral">"Negative dispersion: %s"</span>, cpl_error_get_message());
-<a name="l11660"></a>11660         <span class="keywordflow">return</span> NULL;
-<a name="l11661"></a>11661     }
-<a name="l11662"></a>11662 
-<a name="l11663"></a>11663     nx = cpl_image_get_size_x(spectra);
-<a name="l11664"></a>11664     ny = cpl_image_get_size_y(spectra);
-<a name="l11665"></a>11665     npix = nx * ny;
-<a name="l11666"></a>11666 
-<a name="l11667"></a>11667     <span class="keywordflow">if</span> (nx != cpl_image_get_size_x(wavemap) ||
-<a name="l11668"></a>11668         ny != cpl_image_get_size_y(wavemap) ||
-<a name="l11669"></a>11669         nx != cpl_image_get_size_x(skymap) ||
-<a name="l11670"></a>11670         ny != cpl_image_get_size_y(skymap)) {
-<a name="l11671"></a>11671         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l11672"></a>11672         cpl_msg_error(func, <span class="stringliteral">"Image sizes: %s"</span>, cpl_error_get_message());
-<a name="l11673"></a>11673         <span class="keywordflow">return</span> NULL;
-<a name="l11674"></a>11674     }
-<a name="l11675"></a>11675 
-<a name="l11676"></a>11676     <span class="keywordflow">if</span> (factor < 1.0) {
-<a name="l11677"></a>11677         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l11678"></a>11678         cpl_msg_error(func, <span class="stringliteral">"Undersampling (%f): %s"</span>, factor, 
-<a name="l11679"></a>11679                       cpl_error_get_message());
-<a name="l11680"></a>11680         <span class="keywordflow">return</span> NULL;
-<a name="l11681"></a>11681     }
-<a name="l11682"></a>11682 
-<a name="l11683"></a>11683     <span class="keywordflow">if</span> (minpoints < 0) {
-<a name="l11684"></a>11684         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l11685"></a>11685         cpl_msg_error(func, <span class="stringliteral">"Negative threshold: %s"</span>, cpl_error_get_message());
-<a name="l11686"></a>11686         <span class="keywordflow">return</span> NULL;
-<a name="l11687"></a>11687     }
-<a name="l11688"></a>11688 
-<a name="l11689"></a>11689     dispersion /= factor;
-<a name="l11690"></a>11690 
-<a name="l11691"></a>11691 
-<a name="l11692"></a>11692     <span class="comment">/*</span>
-<a name="l11693"></a>11693 <span class="comment">     * Find bluest and reddest wavelengths in the whole image</span>
-<a name="l11694"></a>11694 <span class="comment">     */</span>
-<a name="l11695"></a>11695 
-<a name="l11696"></a>11696     data = cpl_image_get_data(wavemap);
-<a name="l11697"></a>11697 
-<a name="l11698"></a>11698     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l11699"></a>11699         <span class="keywordflow">if</span> (data[i] > 1.0) {
-<a name="l11700"></a>11700             min = max = data[i];
-<a name="l11701"></a>11701             j = i+1;
-<a name="l11702"></a>11702             <span class="keywordflow">break</span>;
-<a name="l11703"></a>11703         }
-<a name="l11704"></a>11704     }
-<a name="l11705"></a>11705 
-<a name="l11706"></a>11706     <span class="keywordflow">for</span> (i = j; i < npix; i++) {
-<a name="l11707"></a>11707         <span class="keywordflow">if</span> (data[i] < 1.0)      <span class="comment">/* Impossible wavelength */</span>
-<a name="l11708"></a>11708             <span class="keywordflow">continue</span>;
-<a name="l11709"></a>11709         <span class="keywordflow">if</span> (min > data[i])
-<a name="l11710"></a>11710             min = data[i];
-<a name="l11711"></a>11711         <span class="keywordflow">if</span> (max < data[i])
-<a name="l11712"></a>11712             max = data[i];
-<a name="l11713"></a>11713     }
-<a name="l11714"></a>11714 
-<a name="l11715"></a>11715     firstLambda = min;
-<a name="l11716"></a>11716     lastLambda = max;
-<a name="l11717"></a>11717 
-<a name="l11718"></a>11718 
-<a name="l11719"></a>11719     <span class="comment">/*</span>
-<a name="l11720"></a>11720 <span class="comment">     * Determine length of median spectrum</span>
-<a name="l11721"></a>11721 <span class="comment">     */</span>
-<a name="l11722"></a>11722 
-<a name="l11723"></a>11723     nbin = (lastLambda - firstLambda) / dispersion;
-<a name="l11724"></a>11724 
-<a name="l11725"></a>11725     <span class="comment">/*</span>
-<a name="l11726"></a>11726 <span class="comment">     * Count how many values will be found for each spectral bin.</span>
-<a name="l11727"></a>11727 <span class="comment">     * The ith bin has a wavelength range from firstLambda + i*dispersion</span>
-<a name="l11728"></a>11728 <span class="comment">     * (inclusive) to firstLambda + (i+1)*dispersion (exclusive), and</span>
-<a name="l11729"></a>11729 <span class="comment">     * it is assigned to its central wavelength.</span>
-<a name="l11730"></a>11730 <span class="comment">     */</span>
-<a name="l11731"></a>11731 
-<a name="l11732"></a>11732     count = cpl_calloc(nbin, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l11733"></a>11733 
-<a name="l11734"></a>11734     data = cpl_image_get_data(wavemap);
-<a name="l11735"></a>11735 
-<a name="l11736"></a>11736     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l11737"></a>11737         <span class="keywordflow">if</span> (data[i] < 1.0)
-<a name="l11738"></a>11738             <span class="keywordflow">continue</span>;
-<a name="l11739"></a>11739         bin = (data[i] - firstLambda) / dispersion;
-<a name="l11740"></a>11740         <span class="keywordflow">if</span> (bin < nbin)                               <span class="comment">/* Safer */</span>
-<a name="l11741"></a>11741             count[bin]++;
-<a name="l11742"></a>11742     }
-<a name="l11743"></a>11743 
-<a name="l11744"></a>11744     valid_bins = 0;
-<a name="l11745"></a>11745     <span class="keywordflow">for</span> (i = 0; i < nbin; i++)
-<a name="l11746"></a>11746         <span class="keywordflow">if</span> (count[i] >= minpoints)
-<a name="l11747"></a>11747             valid_bins++;
-<a name="l11748"></a>11748 
-<a name="l11749"></a>11749     <span class="keywordflow">if</span> (valid_bins < nbin/3) {
-<a name="l11750"></a>11750         cpl_msg_warning(func, <span class="stringliteral">"Cannot determine a good global sky "</span>
-<a name="l11751"></a>11751                         <span class="stringliteral">"spectrum from input data"</span>);
-<a name="l11752"></a>11752         <span class="keywordflow">return</span> NULL;
-<a name="l11753"></a>11753     }
-<a name="l11754"></a>11754 
-<a name="l11755"></a>11755 
-<a name="l11756"></a>11756     <span class="comment">/*</span>
-<a name="l11757"></a>11757 <span class="comment">     * Allocate an array of vectors with the appropriate size, to</span>
-<a name="l11758"></a>11758 <span class="comment">     * contain a list of all the spectral pixels values. At the same</span>
-<a name="l11759"></a>11759 <span class="comment">     * time, reset the array of counters (because we will have to</span>
-<a name="l11760"></a>11760 <span class="comment">     * count again...).</span>
-<a name="l11761"></a>11761 <span class="comment">     */</span>
-<a name="l11762"></a>11762 
-<a name="l11763"></a>11763     vector = cpl_calloc(nbin, <span class="keyword">sizeof</span>(cpl_vector *));
-<a name="l11764"></a>11764     wvector = cpl_calloc(nbin, <span class="keyword">sizeof</span>(cpl_vector *));
-<a name="l11765"></a>11765     <span class="keywordflow">for</span> (i = 0; i < nbin; i++) {
-<a name="l11766"></a>11766         <span class="keywordflow">if</span> (count[i] >= minpoints) {
-<a name="l11767"></a>11767             vector[i] = cpl_vector_new(count[i]);
-<a name="l11768"></a>11768             wvector[i] = cpl_vector_new(count[i]);
-<a name="l11769"></a>11769         }
-<a name="l11770"></a>11770         count[i] = 0;
-<a name="l11771"></a>11771     }
-<a name="l11772"></a>11772 
-<a name="l11773"></a>11773 
-<a name="l11774"></a>11774     <span class="comment">/*</span>
-<a name="l11775"></a>11775 <span class="comment">     * Read the wavemap and the spectral images, and add the data values</span>
-<a name="l11776"></a>11776 <span class="comment">     * to the appropriate wavelength bins</span>
-<a name="l11777"></a>11777 <span class="comment">     */</span>
-<a name="l11778"></a>11778 
-<a name="l11779"></a>11779     data  = cpl_image_get_data(wavemap);
-<a name="l11780"></a>11780     sdata = cpl_image_get_data(spectra);
-<a name="l11781"></a>11781 
-<a name="l11782"></a>11782     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l11783"></a>11783         <span class="keywordflow">if</span> (data[i] < 1.0)
-<a name="l11784"></a>11784             <span class="keywordflow">continue</span>;
-<a name="l11785"></a>11785         bin = (data[i] - firstLambda) / dispersion;
-<a name="l11786"></a>11786         <span class="keywordflow">if</span> (bin < nbin) {                             <span class="comment">/* Safer */</span>
-<a name="l11787"></a>11787             <span class="keywordflow">if</span> (vector[bin]) {
-<a name="l11788"></a>11788                 cpl_vector_set(vector[bin], count[bin], sdata[i]);
-<a name="l11789"></a>11789                 cpl_vector_set(wvector[bin], count[bin], data[i]);
-<a name="l11790"></a>11790             }
-<a name="l11791"></a>11791             count[bin]++;
-<a name="l11792"></a>11792         }
-<a name="l11793"></a>11793     }
-<a name="l11794"></a>11794 
-<a name="l11795"></a>11795 
-<a name="l11796"></a>11796     <span class="comment">/*</span>
-<a name="l11797"></a>11797 <span class="comment">     * Compute the median flux for each wavelength bin, and destroy</span>
-<a name="l11798"></a>11798 <span class="comment">     * at the same time the used vectors</span>
-<a name="l11799"></a>11799 <span class="comment">     */</span>
-<a name="l11800"></a>11800 
-<a name="l11801"></a>11801     sky_spectrum = cpl_calloc(nbin, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l11802"></a>11802     sky_wave = cpl_calloc(nbin, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l11803"></a>11803     <span class="keywordflow">for</span> (i = 0; i < nbin; i++) {
-<a name="l11804"></a>11804         <span class="keywordflow">if</span> (vector[i]) {
-<a name="l11805"></a>11805             sky_spectrum[i] = cpl_vector_get_median_const(vector[i]);
-<a name="l11806"></a>11806             sky_wave[i] = cpl_vector_get_median_const(wvector[i]);
-<a name="l11807"></a>11807             cpl_vector_delete(vector[i]);
-<a name="l11808"></a>11808             cpl_vector_delete(wvector[i]);
-<a name="l11809"></a>11809         }
-<a name="l11810"></a>11810     }
-<a name="l11811"></a>11811 
-<a name="l11812"></a>11812     cpl_free(vector);
-<a name="l11813"></a>11813     cpl_free(wvector);
-<a name="l11814"></a>11814 
-<a name="l11815"></a>11815 
-<a name="l11816"></a>11816     <span class="comment">/*</span>
-<a name="l11817"></a>11817 <span class="comment">     * Here possible gaps in the final spectrum are filled by interpolation</span>
-<a name="l11818"></a>11818 <span class="comment">     */</span>
-<a name="l11819"></a>11819 
-<a name="l11820"></a>11820     <span class="keywordflow">for</span> (i = 0; i < nbin; i++) {
-<a name="l11821"></a>11821         <span class="keywordflow">if</span> (count[i] >= minpoints) {
-<a name="l11822"></a>11822             first_valid = i;
-<a name="l11823"></a>11823             <span class="keywordflow">break</span>;
-<a name="l11824"></a>11824         }
-<a name="l11825"></a>11825     }
-<a name="l11826"></a>11826     
-<a name="l11827"></a>11827     <span class="keywordflow">for</span> (i = first_valid; i < nbin; i++) {
-<a name="l11828"></a>11828         <span class="keywordflow">if</span> (count[i] < minpoints) {
-<a name="l11829"></a>11829             sky_wave[i] = firstLambda + (i+0.5)*dispersion;
-<a name="l11830"></a>11830             <span class="keywordflow">for</span> (j = i+1; j < nbin; j++) {
-<a name="l11831"></a>11831                 <span class="keywordflow">if</span> (count[j] >= minpoints) {
-<a name="l11832"></a>11832                     <span class="keywordflow">if</span> (sky_wave[j] - sky_wave[i-1] < 0.1) {
-<a name="l11833"></a>11833                         sky_spectrum[i] = (sky_spectrum[j] + sky_spectrum[i-1])
-<a name="l11834"></a>11834                                         / 2;
-<a name="l11835"></a>11835                     }
-<a name="l11836"></a>11836                     <span class="keywordflow">else</span> {
-<a name="l11837"></a>11837                         frac = (sky_wave[i] - sky_wave[i-1]) 
-<a name="l11838"></a>11838                              / (sky_wave[j] - sky_wave[i-1]);
-<a name="l11839"></a>11839                         sky_spectrum[i] = frac * sky_spectrum[j]
-<a name="l11840"></a>11840                                         + (1 - frac) * sky_spectrum[i-1];
-<a name="l11841"></a>11841                     }
-<a name="l11842"></a>11842                 }
-<a name="l11843"></a>11843             }
-<a name="l11844"></a>11844         }
-<a name="l11845"></a>11845     }
-<a name="l11846"></a>11846 
-<a name="l11847"></a>11847 
-<a name="l11848"></a>11848     <span class="comment">/*</span>
-<a name="l11849"></a>11849 <span class="comment">     * Create the output table</span>
-<a name="l11850"></a>11850 <span class="comment">     */</span>
-<a name="l11851"></a>11851 
-<a name="l11852"></a>11852     sky = cpl_table_new(nbin);
-<a name="l11853"></a>11853     cpl_table_wrap_double(sky, sky_wave, <span class="stringliteral">"wavelength"</span>);
-<a name="l11854"></a>11854     cpl_table_wrap_double(sky, sky_spectrum, <span class="stringliteral">"sky"</span>);
-<a name="l11855"></a>11855     cpl_table_wrap_int(sky, count, <span class="stringliteral">"npoints"</span>);
-<a name="l11856"></a>11856 
-<a name="l11857"></a>11857 
-<a name="l11858"></a>11858     <span class="comment">/*</span>
-<a name="l11859"></a>11859 <span class="comment">     * Fill the sky map</span>
-<a name="l11860"></a>11860 <span class="comment">     */</span>
-<a name="l11861"></a>11861 
-<a name="l11862"></a>11862     data  = cpl_image_get_data(wavemap);
-<a name="l11863"></a>11863     sdata = cpl_image_get_data(spectra);
-<a name="l11864"></a>11864     kdata = cpl_image_get_data(skymap);
-<a name="l11865"></a>11865 
-<a name="l11866"></a>11866     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l11867"></a>11867 
-<a name="l11868"></a>11868         <span class="comment">/*</span>
-<a name="l11869"></a>11869 <span class="comment">         * Currently based on linear interpolation</span>
-<a name="l11870"></a>11870 <span class="comment">         */</span>
-<a name="l11871"></a>11871 
-<a name="l11872"></a>11872         lambda = data[i];
-<a name="l11873"></a>11873         <span class="keywordflow">if</span> (lambda < 1.0)
-<a name="l11874"></a>11874             <span class="keywordflow">continue</span>;
-<a name="l11875"></a>11875         bin = (lambda - firstLambda) / dispersion;
-<a name="l11876"></a>11876         lambda1 = sky_wave[bin];
-<a name="l11877"></a>11877         value1 = sky_spectrum[bin];
-<a name="l11878"></a>11878         <span class="keywordflow">if</span> (lambda1 < lambda) {
-<a name="l11879"></a>11879             bin++;
-<a name="l11880"></a>11880             <span class="keywordflow">if</span> (bin < nbin) {
-<a name="l11881"></a>11881                 lambda2 = sky_wave[bin];
-<a name="l11882"></a>11882                 value2  = sky_spectrum[bin];
-<a name="l11883"></a>11883                 <span class="keywordflow">if</span> (lambda2 - lambda1 < 0.1) {
-<a name="l11884"></a>11884                     value = (value1 + value2) / 2;
-<a name="l11885"></a>11885                 }
-<a name="l11886"></a>11886                 <span class="keywordflow">else</span> {
-<a name="l11887"></a>11887                     frac = (lambda - lambda1) / (lambda2 - lambda1);
-<a name="l11888"></a>11888                     value = frac * value2 + (1 - frac) * value1;
-<a name="l11889"></a>11889                 }
-<a name="l11890"></a>11890             }
-<a name="l11891"></a>11891             <span class="keywordflow">else</span> {
-<a name="l11892"></a>11892                 value = value1;
-<a name="l11893"></a>11893             }
-<a name="l11894"></a>11894         }
-<a name="l11895"></a>11895         <span class="keywordflow">else</span> {
-<a name="l11896"></a>11896             <span class="keywordflow">if</span> (bin > 0) {
-<a name="l11897"></a>11897                 bin--;
-<a name="l11898"></a>11898                 lambda2 = lambda1;
-<a name="l11899"></a>11899                 value2  = value1;
-<a name="l11900"></a>11900                 lambda1 = sky_wave[bin];
-<a name="l11901"></a>11901                 value1  = sky_spectrum[bin];
-<a name="l11902"></a>11902                 <span class="keywordflow">if</span> (lambda2 - lambda1 < 0.1) {
-<a name="l11903"></a>11903                     value = (value1 + value2) / 2;
-<a name="l11904"></a>11904                 }
-<a name="l11905"></a>11905                 <span class="keywordflow">else</span> {
-<a name="l11906"></a>11906                     frac = (lambda - lambda1) / (lambda2 - lambda1);
-<a name="l11907"></a>11907                     value = frac * value2 + (1 - frac) * value1;
-<a name="l11908"></a>11908                 }
-<a name="l11909"></a>11909             }
-<a name="l11910"></a>11910             <span class="keywordflow">else</span> {
-<a name="l11911"></a>11911                 value = value1;
-<a name="l11912"></a>11912             }
-<a name="l11913"></a>11913         }
-<a name="l11914"></a>11914         kdata[i] = value;
-<a name="l11915"></a>11915     }
-<a name="l11916"></a>11916 
-<a name="l11917"></a>11917     <span class="keywordflow">if</span> (first_valid)
-<a name="l11918"></a>11918         cpl_table_erase_window(sky, 0, first_valid);
-<a name="l11919"></a>11919 
-<a name="l11920"></a>11920     <span class="keywordflow">return</span> sky;
-<a name="l11921"></a>11921 
-<a name="l11922"></a>11922 }
-<a name="l11923"></a>11923 
-<a name="l11924"></a>11924 
-<a name="l11958"></a><a class="code" href="group__moses.html#g21b37cf8c1fd568441a55740d34e2371">11958</a> cpl_table *<a class="code" href="group__moses.html#g21b37cf8c1fd568441a55740d34e2371">mos_sky_map</a>(cpl_image *spectra, cpl_image *wavemap,
-<a name="l11959"></a>11959                        <span class="keywordtype">double</span> dispersion, cpl_image *skymap)
-<a name="l11960"></a>11960 {
-<a name="l11961"></a>11961     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_sky_map"</span>;
-<a name="l11962"></a>11962 
-<a name="l11963"></a>11963     cpl_vector **vector;
-<a name="l11964"></a>11964     <span class="keywordtype">double</span>       firstLambda, lastLambda;
-<a name="l11965"></a>11965     <span class="keywordtype">double</span>       lambda, lambda1, lambda2;
-<a name="l11966"></a>11966     <span class="keywordtype">double</span>       value, value1, value2;
-<a name="l11967"></a>11967     <span class="keywordtype">float</span>        min, max;
-<a name="l11968"></a>11968     <span class="keywordtype">int</span>         *count;
-<a name="l11969"></a>11969     <span class="keywordtype">int</span>          nbin, bin;
-<a name="l11970"></a>11970     <span class="keywordtype">int</span>          nx, ny, npix;
-<a name="l11971"></a>11971     <span class="keywordtype">int</span>          i, j;
-<a name="l11972"></a>11972 
-<a name="l11973"></a>11973     cpl_table   *sky;
-<a name="l11974"></a>11974     <span class="keywordtype">double</span>      *sky_spectrum;
-<a name="l11975"></a>11975     <span class="keywordtype">float</span>       *data;
-<a name="l11976"></a>11976     <span class="keywordtype">float</span>       *sdata;
-<a name="l11977"></a>11977     <span class="keywordtype">float</span>       *kdata;
-<a name="l11978"></a>11978     <span class="keywordtype">double</span>      *wdata;
-<a name="l11979"></a>11979 
-<a name="l11980"></a>11980 
-<a name="l11981"></a>11981     <span class="keywordflow">if</span> (spectra == NULL || wavemap == NULL || skymap == NULL) {
-<a name="l11982"></a>11982         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l11983"></a>11983         <span class="keywordflow">return</span> NULL;
-<a name="l11984"></a>11984     }
-<a name="l11985"></a>11985     
-<a name="l11986"></a>11986     <span class="keywordflow">if</span> (dispersion <= 0.0) {
-<a name="l11987"></a>11987         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l11988"></a>11988         <span class="keywordflow">return</span> NULL;
-<a name="l11989"></a>11989     }
-<a name="l11990"></a>11990 
-<a name="l11991"></a>11991     nx = cpl_image_get_size_x(spectra);
-<a name="l11992"></a>11992     ny = cpl_image_get_size_y(spectra);
-<a name="l11993"></a>11993     npix = nx * ny;
-<a name="l11994"></a>11994 
-<a name="l11995"></a>11995     <span class="keywordflow">if</span> (nx != cpl_image_get_size_x(wavemap) ||
-<a name="l11996"></a>11996         ny != cpl_image_get_size_y(wavemap) ||
-<a name="l11997"></a>11997         nx != cpl_image_get_size_x(skymap) ||
-<a name="l11998"></a>11998         ny != cpl_image_get_size_y(skymap)) {
-<a name="l11999"></a>11999         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l12000"></a>12000         <span class="keywordflow">return</span> NULL;
-<a name="l12001"></a>12001     }
-<a name="l12002"></a>12002 
-<a name="l12003"></a>12003 
-<a name="l12004"></a>12004     <span class="comment">/*</span>
-<a name="l12005"></a>12005 <span class="comment">     * Find bluest and reddest wavelengths in the whole image</span>
-<a name="l12006"></a>12006 <span class="comment">     */</span>
-<a name="l12007"></a>12007 
-<a name="l12008"></a>12008     data = cpl_image_get_data(wavemap);
-<a name="l12009"></a>12009 
-<a name="l12010"></a>12010     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l12011"></a>12011         <span class="keywordflow">if</span> (data[i] > 1.0) {
-<a name="l12012"></a>12012             min = max = data[i];
-<a name="l12013"></a>12013             j = i+1;
-<a name="l12014"></a>12014             <span class="keywordflow">break</span>;
-<a name="l12015"></a>12015         }
-<a name="l12016"></a>12016     }
-<a name="l12017"></a>12017 
-<a name="l12018"></a>12018     <span class="keywordflow">for</span> (i = j; i < npix; i++) {
-<a name="l12019"></a>12019         <span class="keywordflow">if</span> (data[i] < 1.0)      <span class="comment">/* Impossible wavelength */</span>
-<a name="l12020"></a>12020             <span class="keywordflow">continue</span>;
-<a name="l12021"></a>12021         <span class="keywordflow">if</span> (min > data[i])
-<a name="l12022"></a>12022             min = data[i];
-<a name="l12023"></a>12023         <span class="keywordflow">if</span> (max < data[i])
-<a name="l12024"></a>12024             max = data[i];
-<a name="l12025"></a>12025     }
-<a name="l12026"></a>12026 
-<a name="l12027"></a>12027     firstLambda = min;
-<a name="l12028"></a>12028     lastLambda = max;
-<a name="l12029"></a>12029 
-<a name="l12030"></a>12030 
-<a name="l12031"></a>12031     <span class="comment">/*</span>
-<a name="l12032"></a>12032 <span class="comment">     * Determine length of median spectrum</span>
-<a name="l12033"></a>12033 <span class="comment">     */</span>
-<a name="l12034"></a>12034 
-<a name="l12035"></a>12035     nbin = (lastLambda - firstLambda) / dispersion;
-<a name="l12036"></a>12036 
-<a name="l12037"></a>12037     <span class="comment">/*</span>
-<a name="l12038"></a>12038 <span class="comment">     * Count how many values will be found for each spectral bin.</span>
-<a name="l12039"></a>12039 <span class="comment">     * The ith bin has a wavelength range from firstLambda + i*dispersion</span>
-<a name="l12040"></a>12040 <span class="comment">     * (inclusive) to firstLambda + (i+1)*dispersion (exclusive), and</span>
-<a name="l12041"></a>12041 <span class="comment">     * it is assigned to its central wavelength.</span>
-<a name="l12042"></a>12042 <span class="comment">     */</span>
-<a name="l12043"></a>12043 
-<a name="l12044"></a>12044     count = cpl_calloc(nbin, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l12045"></a>12045 
-<a name="l12046"></a>12046     data = cpl_image_get_data(wavemap);
-<a name="l12047"></a>12047 
-<a name="l12048"></a>12048     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l12049"></a>12049         <span class="keywordflow">if</span> (data[i] < 1.0)
-<a name="l12050"></a>12050             <span class="keywordflow">continue</span>;
-<a name="l12051"></a>12051         bin = (data[i] - firstLambda) / dispersion;
-<a name="l12052"></a>12052         <span class="keywordflow">if</span> (bin < nbin)                               <span class="comment">/* Safer */</span>
-<a name="l12053"></a>12053             count[bin]++;
-<a name="l12054"></a>12054     }
-<a name="l12055"></a>12055 
-<a name="l12056"></a>12056 
-<a name="l12057"></a>12057     <span class="comment">/*</span>
-<a name="l12058"></a>12058 <span class="comment">     * Allocate an array of vectors with the appropriate size, to</span>
-<a name="l12059"></a>12059 <span class="comment">     * contain a list of all the spectral pixels values. At the same</span>
-<a name="l12060"></a>12060 <span class="comment">     * time, reset the array of counters (because we will have to</span>
-<a name="l12061"></a>12061 <span class="comment">     * count again...).</span>
-<a name="l12062"></a>12062 <span class="comment">     */</span>
-<a name="l12063"></a>12063 
-<a name="l12064"></a>12064     vector = cpl_calloc(nbin, <span class="keyword">sizeof</span>(cpl_vector *));
-<a name="l12065"></a>12065     <span class="keywordflow">for</span> (i = 0; i < nbin; i++) {
-<a name="l12066"></a>12066         <span class="keywordflow">if</span> (count[i])
-<a name="l12067"></a>12067             vector[i] = cpl_vector_new(count[i]);
-<a name="l12068"></a>12068         <span class="keywordflow">else</span>
-<a name="l12069"></a>12069             vector[i] = NULL;
-<a name="l12070"></a>12070         count[i] = 0;
-<a name="l12071"></a>12071     }
-<a name="l12072"></a>12072 
-<a name="l12073"></a>12073 
-<a name="l12074"></a>12074     <span class="comment">/*</span>
-<a name="l12075"></a>12075 <span class="comment">     * Read the wavemap and the spectral images, and add the data values</span>
-<a name="l12076"></a>12076 <span class="comment">     * to the appropriate wavelength bins</span>
-<a name="l12077"></a>12077 <span class="comment">     */</span>
-<a name="l12078"></a>12078 
-<a name="l12079"></a>12079     data  = cpl_image_get_data(wavemap);
-<a name="l12080"></a>12080     sdata = cpl_image_get_data(spectra);
-<a name="l12081"></a>12081 
-<a name="l12082"></a>12082     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l12083"></a>12083         <span class="keywordflow">if</span> (data[i] < 1.0)
-<a name="l12084"></a>12084             <span class="keywordflow">continue</span>;
-<a name="l12085"></a>12085         bin = (data[i] - firstLambda) / dispersion;
-<a name="l12086"></a>12086         <span class="keywordflow">if</span> (bin < nbin) {                             <span class="comment">/* Safer */</span>
-<a name="l12087"></a>12087             cpl_vector_set(vector[bin], count[bin], sdata[i]);
-<a name="l12088"></a>12088             count[bin]++;
-<a name="l12089"></a>12089         }
-<a name="l12090"></a>12090     }
-<a name="l12091"></a>12091 
-<a name="l12092"></a>12092 
-<a name="l12093"></a>12093     <span class="comment">/*</span>
-<a name="l12094"></a>12094 <span class="comment">     * Compute the median flux for each wavelength bin, and destroy</span>
-<a name="l12095"></a>12095 <span class="comment">     * at the same time the used vectors</span>
-<a name="l12096"></a>12096 <span class="comment">     */</span>
-<a name="l12097"></a>12097 
-<a name="l12098"></a>12098     sky_spectrum = cpl_calloc(nbin, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l12099"></a>12099     <span class="keywordflow">for</span> (i = 0; i < nbin; i++) {
-<a name="l12100"></a>12100         <span class="keywordflow">if</span> (vector[i]) {
-<a name="l12101"></a>12101             sky_spectrum[i] = cpl_vector_get_median_const(vector[i]);
-<a name="l12102"></a>12102             cpl_vector_delete(vector[i]);
-<a name="l12103"></a>12103         }
-<a name="l12104"></a>12104     }
-<a name="l12105"></a>12105 
-<a name="l12106"></a>12106     cpl_free(vector);
-<a name="l12107"></a>12107 
-<a name="l12108"></a>12108 
-<a name="l12109"></a>12109     <span class="comment">/*</span>
-<a name="l12110"></a>12110 <span class="comment">     * Here possible gaps in the final spectrum should be filled</span>
-<a name="l12111"></a>12111 <span class="comment">     * by interpolation</span>
-<a name="l12112"></a>12112 <span class="comment">     */</span>
-<a name="l12113"></a>12113 
-<a name="l12114"></a>12114     <span class="comment">/* ... */</span>
-<a name="l12115"></a>12115 
-<a name="l12116"></a>12116     <span class="comment">/*</span>
-<a name="l12117"></a>12117 <span class="comment">     * Create the output table</span>
-<a name="l12118"></a>12118 <span class="comment">     */</span>
-<a name="l12119"></a>12119 
-<a name="l12120"></a>12120     sky = cpl_table_new(nbin);
-<a name="l12121"></a>12121     cpl_table_new_column(sky, <span class="stringliteral">"wavelength"</span>, CPL_TYPE_DOUBLE);
-<a name="l12122"></a>12122     cpl_table_set_column_unit(sky, <span class="stringliteral">"wavelength"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l12123"></a>12123     cpl_table_wrap_double(sky, sky_spectrum, <span class="stringliteral">"sky"</span>);
-<a name="l12124"></a>12124     cpl_table_wrap_int(sky, count, <span class="stringliteral">"npoints"</span>);
-<a name="l12125"></a>12125     <span class="keywordflow">for</span> (i = 0; i < nbin; i++)
-<a name="l12126"></a>12126         cpl_table_set_double(sky, <span class="stringliteral">"wavelength"</span>, i, 
-<a name="l12127"></a>12127                              firstLambda + (i+0.5)*dispersion);
-<a name="l12128"></a>12128 
-<a name="l12129"></a>12129 
-<a name="l12130"></a>12130     <span class="comment">/*</span>
-<a name="l12131"></a>12131 <span class="comment">     * Fill the sky map</span>
-<a name="l12132"></a>12132 <span class="comment">     */</span>
-<a name="l12133"></a>12133 
-<a name="l12134"></a>12134     data  = cpl_image_get_data(wavemap);
-<a name="l12135"></a>12135     sdata = cpl_image_get_data(spectra);
-<a name="l12136"></a>12136     kdata = cpl_image_get_data(skymap);
-<a name="l12137"></a>12137     wdata = cpl_table_get_data_double(sky, <span class="stringliteral">"wavelength"</span>);
-<a name="l12138"></a>12138 
-<a name="l12139"></a>12139     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l12140"></a>12140 
-<a name="l12141"></a>12141         <span class="comment">/*</span>
-<a name="l12142"></a>12142 <span class="comment">         * Currently based on linear interpolation</span>
-<a name="l12143"></a>12143 <span class="comment">         */</span>
-<a name="l12144"></a>12144 
-<a name="l12145"></a>12145         lambda = data[i];
-<a name="l12146"></a>12146         <span class="keywordflow">if</span> (lambda < 1.0)
-<a name="l12147"></a>12147             <span class="keywordflow">continue</span>;
-<a name="l12148"></a>12148         bin = (lambda - firstLambda) / dispersion;
-<a name="l12149"></a>12149         lambda1 = wdata[bin];
-<a name="l12150"></a>12150         value1 = sky_spectrum[bin];
-<a name="l12151"></a>12151         <span class="keywordflow">if</span> (lambda1 < lambda) {
-<a name="l12152"></a>12152             bin++;
-<a name="l12153"></a>12153             <span class="keywordflow">if</span> (bin < nbin) {
-<a name="l12154"></a>12154                 lambda2 = wdata[bin];
-<a name="l12155"></a>12155                 value2  = sky_spectrum[bin];
-<a name="l12156"></a>12156                 value   = ((lambda2 - lambda)*value1 
-<a name="l12157"></a>12157                         +  (lambda - lambda1)*value2) / dispersion;
-<a name="l12158"></a>12158             }
-<a name="l12159"></a>12159             <span class="keywordflow">else</span> {
-<a name="l12160"></a>12160                 value = value1;
-<a name="l12161"></a>12161             }
-<a name="l12162"></a>12162         }
-<a name="l12163"></a>12163         <span class="keywordflow">else</span> {
-<a name="l12164"></a>12164             <span class="keywordflow">if</span> (bin > 0) {
-<a name="l12165"></a>12165                 bin--;
-<a name="l12166"></a>12166                 lambda2 = lambda1;
-<a name="l12167"></a>12167                 value2  = value1;
-<a name="l12168"></a>12168                 lambda1 = wdata[bin];
-<a name="l12169"></a>12169                 value1  = sky_spectrum[bin];
-<a name="l12170"></a>12170                 value   = ((lambda2 - lambda)*value1 
-<a name="l12171"></a>12171                         +  (lambda - lambda1)*value2)/dispersion;
-<a name="l12172"></a>12172             }
-<a name="l12173"></a>12173             <span class="keywordflow">else</span> {
-<a name="l12174"></a>12174                 value = value1;
-<a name="l12175"></a>12175             }
-<a name="l12176"></a>12176         }
-<a name="l12177"></a>12177         kdata[i] = value;
-<a name="l12178"></a>12178     }
-<a name="l12179"></a>12179 
-<a name="l12180"></a>12180     <span class="keywordflow">return</span> sky;
-<a name="l12181"></a>12181 
-<a name="l12182"></a>12182 }
-<a name="l12183"></a>12183 
-<a name="l12184"></a>12184 
-<a name="l12200"></a><a class="code" href="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a">12200</a> cpl_image *<a class="code" href="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a">mos_sky_local_old</a>(cpl_image *spectra, cpl_table *slits)
-<a name="l12201"></a>12201 {
-<a name="l12202"></a>12202     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_sky_local_old"</span>;
-<a name="l12203"></a>12203 
-<a name="l12204"></a>12204     cpl_image *exslit;
-<a name="l12205"></a>12205     cpl_image *sky;
-<a name="l12206"></a>12206     cpl_image *skymap;
-<a name="l12207"></a>12207     <span class="keywordtype">float</span>     *data;
-<a name="l12208"></a>12208     <span class="keywordtype">float</span>     *sdata;
-<a name="l12209"></a>12209     <span class="keywordtype">int</span>        nx, ny;
-<a name="l12210"></a>12210     <span class="keywordtype">int</span>        xlow, ylow, xhig, yhig;
-<a name="l12211"></a>12211     <span class="keywordtype">int</span>        nslits;
-<a name="l12212"></a>12212     <span class="keywordtype">int</span>       *slit_id;
-<a name="l12213"></a>12213     <span class="keywordtype">int</span>       *position;
-<a name="l12214"></a>12214     <span class="keywordtype">int</span>       *length;
-<a name="l12215"></a>12215     <span class="keywordtype">int</span>        i, j, k;
-<a name="l12216"></a>12216 
-<a name="l12217"></a>12217 
-<a name="l12218"></a>12218     <span class="keywordflow">if</span> (spectra == NULL) {
-<a name="l12219"></a>12219         cpl_msg_error(func, 
-<a name="l12220"></a>12220                       <span class="stringliteral">"A scientific rectified spectral image must be given"</span>);
-<a name="l12221"></a>12221         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l12222"></a>12222         <span class="keywordflow">return</span> NULL;
-<a name="l12223"></a>12223     }
-<a name="l12224"></a>12224 
-<a name="l12225"></a>12225     <span class="keywordflow">if</span> (slits == NULL) {
-<a name="l12226"></a>12226         cpl_msg_error(func, <span class="stringliteral">"A slits position table must be given"</span>);
-<a name="l12227"></a>12227         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l12228"></a>12228         <span class="keywordflow">return</span> NULL;
-<a name="l12229"></a>12229     }
-<a name="l12230"></a>12230 
-<a name="l12231"></a>12231     nslits   = cpl_table_get_nrow(slits);
-<a name="l12232"></a>12232     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l12233"></a>12233     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);
-<a name="l12234"></a>12234     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l12235"></a>12235 
-<a name="l12236"></a>12236     nx = cpl_image_get_size_x(spectra);
-<a name="l12237"></a>12237     ny = cpl_image_get_size_y(spectra);
-<a name="l12238"></a>12238 
-<a name="l12239"></a>12239     skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l12240"></a>12240 
-<a name="l12241"></a>12241     xlow = 1;
-<a name="l12242"></a>12242     xhig = nx;
-<a name="l12243"></a>12243     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l12244"></a>12244 
-<a name="l12245"></a>12245         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l12246"></a>12246             <span class="keywordflow">continue</span>;
-<a name="l12247"></a>12247 
-<a name="l12248"></a>12248         <span class="comment">/*</span>
-<a name="l12249"></a>12249 <span class="comment">         * Define the extraction boundaries. We DON'T write:</span>
-<a name="l12250"></a>12250 <span class="comment">         *</span>
-<a name="l12251"></a>12251 <span class="comment">         * ylow = position[i];</span>
-<a name="l12252"></a>12252 <span class="comment">         * yhig = ylow + length[i];</span>
-<a name="l12253"></a>12253 <span class="comment">         *</span>
-<a name="l12254"></a>12254 <span class="comment">         * because the cpl_image pixels are counted from 1, and because in</span>
-<a name="l12255"></a>12255 <span class="comment">         * cpl_image_extract() the coordinates of the last pixel are inclusive.</span>
-<a name="l12256"></a>12256 <span class="comment">         */</span>
-<a name="l12257"></a>12257 
-<a name="l12258"></a>12258         ylow = position[i] + 1;
-<a name="l12259"></a>12259         yhig = ylow + length[i] - 1;
-<a name="l12260"></a>12260 
-<a name="l12261"></a>12261         exslit = cpl_image_extract(spectra, xlow, ylow, xhig, yhig);
-<a name="l12262"></a>12262         sky    = cpl_image_collapse_median_create(exslit, 0, 0, 1);
-<a name="l12263"></a>12263         cpl_image_delete(exslit);
-<a name="l12264"></a>12264 
-<a name="l12265"></a>12265         data   = cpl_image_get_data(skymap);
-<a name="l12266"></a>12266         data  += nx * position[i];
-<a name="l12267"></a>12267 
-<a name="l12268"></a>12268         <span class="keywordflow">for</span> (j = 0; j < length[i]; j++) {
-<a name="l12269"></a>12269             sdata  = cpl_image_get_data(sky);
-<a name="l12270"></a>12270             <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l12271"></a>12271                 *data++ = *sdata++;
-<a name="l12272"></a>12272             }
-<a name="l12273"></a>12273         }
-<a name="l12274"></a>12274 
-<a name="l12275"></a>12275         cpl_image_delete(sky);
-<a name="l12276"></a>12276     }
-<a name="l12277"></a>12277 
-<a name="l12278"></a>12278     <span class="keywordflow">return</span> skymap;
-<a name="l12279"></a>12279 
-<a name="l12280"></a>12280 }
-<a name="l12281"></a>12281 
-<a name="l12282"></a>12282 
-<a name="l12302"></a><a class="code" href="group__moses.html#g7cb83f67ed6d349ade9e38e7ed62f6fb">12302</a> cpl_image *<a class="code" href="group__moses.html#g7cb83f67ed6d349ade9e38e7ed62f6fb">mos_sky_local</a>(cpl_image *spectra, cpl_table *slits, <span class="keywordtype">int</span> order)
-<a name="l12303"></a>12303 {
-<a name="l12304"></a>12304     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_sky_local"</span>;
-<a name="l12305"></a>12305 
-<a name="l12306"></a>12306     <span class="keywordtype">char</span>        name[MAX_COLNAME];
-<a name="l12307"></a>12307 
-<a name="l12308"></a>12308     cpl_polynomial *fit;
-<a name="l12309"></a>12309     cpl_vector     *points;
-<a name="l12310"></a>12310     cpl_vector     *values;
-<a name="l12311"></a>12311     cpl_vector     *keep_points;
-<a name="l12312"></a>12312     cpl_vector     *keep_values;
-<a name="l12313"></a>12313     cpl_image      *exslit;
-<a name="l12314"></a>12314     cpl_image      *sky;
-<a name="l12315"></a>12315     cpl_image      *subtracted;
-<a name="l12316"></a>12316     cpl_image      *profile;
-<a name="l12317"></a>12317     cpl_image      *skymap;
-<a name="l12318"></a>12318     cpl_table      *objects;
-<a name="l12319"></a>12319     <span class="keywordtype">float</span>          *data;
-<a name="l12320"></a>12320     <span class="keywordtype">float</span>          *sdata;
-<a name="l12321"></a>12321     <span class="keywordtype">float</span>          *xdata;
-<a name="l12322"></a>12322     <span class="keywordtype">double</span>         *vdata;
-<a name="l12323"></a>12323     <span class="keywordtype">double</span>         *pdata;
-<a name="l12324"></a>12324     <span class="keywordtype">double</span>          median;
-<a name="l12325"></a>12325     <span class="keywordtype">int</span>             nx, ny;
-<a name="l12326"></a>12326     <span class="keywordtype">int</span>             xlow, ylow, xhig, yhig;
-<a name="l12327"></a>12327     <span class="keywordtype">int</span>             nslits;
-<a name="l12328"></a>12328     <span class="keywordtype">int</span>            *slit_id;
-<a name="l12329"></a>12329     <span class="keywordtype">int</span>            *position;
-<a name="l12330"></a>12330     <span class="keywordtype">int</span>            *length;
-<a name="l12331"></a>12331     <span class="keywordtype">int</span>            *is_sky;
-<a name="l12332"></a>12332     <span class="keywordtype">int</span>             nsky, nbad;
-<a name="l12333"></a>12333     <span class="keywordtype">int</span>             maxobjects;
-<a name="l12334"></a>12334     <span class="keywordtype">int</span>             margin = 3;
-<a name="l12335"></a>12335     <span class="keywordtype">int</span>             radius = 6;
-<a name="l12336"></a>12336     <span class="keywordtype">int</span>             i, j, k;
-<a name="l12337"></a>12337 
-<a name="l12338"></a>12338 
-<a name="l12339"></a>12339     <span class="keywordflow">if</span> (spectra == NULL) {
-<a name="l12340"></a>12340         cpl_msg_error(func, 
-<a name="l12341"></a>12341                       <span class="stringliteral">"A scientific rectified spectral image must be given"</span>);
-<a name="l12342"></a>12342         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l12343"></a>12343         <span class="keywordflow">return</span> NULL;
-<a name="l12344"></a>12344     }
-<a name="l12345"></a>12345 
-<a name="l12346"></a>12346     <span class="keywordflow">if</span> (slits == NULL) {
-<a name="l12347"></a>12347         cpl_msg_error(func, <span class="stringliteral">"A slits position table must be given"</span>);
-<a name="l12348"></a>12348         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l12349"></a>12349         <span class="keywordflow">return</span> NULL;
-<a name="l12350"></a>12350     }
-<a name="l12351"></a>12351 
-<a name="l12352"></a>12352     <span class="keywordflow">if</span> (order < 0) {
-<a name="l12353"></a>12353         cpl_msg_error(func, <span class="stringliteral">"Invalid fit order"</span>);
-<a name="l12354"></a>12354         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l12355"></a>12355         <span class="keywordflow">return</span> NULL;
-<a name="l12356"></a>12356     }
-<a name="l12357"></a>12357 
-<a name="l12358"></a>12358     nslits   = cpl_table_get_nrow(slits);
-<a name="l12359"></a>12359     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l12360"></a>12360     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);
-<a name="l12361"></a>12361     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l12362"></a>12362 
-<a name="l12363"></a>12363     nx = cpl_image_get_size_x(spectra);
-<a name="l12364"></a>12364     ny = cpl_image_get_size_y(spectra);
-<a name="l12365"></a>12365 
-<a name="l12366"></a>12366     skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l12367"></a>12367 
-<a name="l12368"></a>12368     xlow = 1;
-<a name="l12369"></a>12369     xhig = nx;
-<a name="l12370"></a>12370     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l12371"></a>12371 
-<a name="l12372"></a>12372         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l12373"></a>12373             <span class="keywordflow">continue</span>;
-<a name="l12374"></a>12374 
-<a name="l12375"></a>12375         <span class="comment">/*</span>
-<a name="l12376"></a>12376 <span class="comment">         * Define the extraction boundaries. We DON'T write:</span>
-<a name="l12377"></a>12377 <span class="comment">         *</span>
-<a name="l12378"></a>12378 <span class="comment">         * ylow = position[i];</span>
-<a name="l12379"></a>12379 <span class="comment">         * yhig = ylow + length[i];</span>
-<a name="l12380"></a>12380 <span class="comment">         *</span>
-<a name="l12381"></a>12381 <span class="comment">         * because the cpl_image pixels are counted from 1, and because in</span>
-<a name="l12382"></a>12382 <span class="comment">         * cpl_image_extract() the coordinates of the last pixel are inclusive.</span>
-<a name="l12383"></a>12383 <span class="comment">         */</span>
-<a name="l12384"></a>12384 
-<a name="l12385"></a>12385         ylow = position[i] + 1;
-<a name="l12386"></a>12386         yhig = ylow + length[i] - 1;
-<a name="l12387"></a>12387 
-<a name="l12388"></a>12388         exslit = cpl_image_extract(spectra, xlow, ylow, xhig, yhig);
-<a name="l12389"></a>12389         sky    = cpl_image_collapse_median_create(exslit, 0, 0, 1);
-<a name="l12390"></a>12390         cpl_image_delete(exslit);
-<a name="l12391"></a>12391 
-<a name="l12392"></a>12392         data   = cpl_image_get_data(skymap);
-<a name="l12393"></a>12393         data  += nx * position[i];
-<a name="l12394"></a>12394 
-<a name="l12395"></a>12395         <span class="keywordflow">for</span> (j = 0; j < length[i]; j++) {
-<a name="l12396"></a>12396             sdata  = cpl_image_get_data(sky);
-<a name="l12397"></a>12397             <span class="keywordflow">for</span> (k = 0; k < nx; k++) {
-<a name="l12398"></a>12398                 *data++ = *sdata++;
-<a name="l12399"></a>12399             }
-<a name="l12400"></a>12400         }
-<a name="l12401"></a>12401 
-<a name="l12402"></a>12402         cpl_image_delete(sky);
-<a name="l12403"></a>12403     }
-<a name="l12404"></a>12404 
-<a name="l12405"></a>12405 
-<a name="l12406"></a>12406     <span class="comment">/*</span>
-<a name="l12407"></a>12407 <span class="comment">     * Preliminary sky-subtracted image</span>
-<a name="l12408"></a>12408 <span class="comment">     */</span>
-<a name="l12409"></a>12409 
-<a name="l12410"></a>12410     subtracted = cpl_image_duplicate(spectra);
-<a name="l12411"></a>12411     cpl_image_subtract(subtracted, skymap);
-<a name="l12412"></a>12412     cpl_image_delete(skymap);
-<a name="l12413"></a>12413 
-<a name="l12414"></a>12414 
-<a name="l12415"></a>12415     <span class="comment">/*</span>
-<a name="l12416"></a>12416 <span class="comment">     * Detect objects positions in all slits</span>
-<a name="l12417"></a>12417 <span class="comment">     */</span>
-<a name="l12418"></a>12418 
-<a name="l12419"></a>12419     objects = cpl_table_duplicate(slits);
-<a name="l12420"></a>12420     profile = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(subtracted, objects, margin, radius, 0);
-<a name="l12421"></a>12421     cpl_image_delete(profile);
-<a name="l12422"></a>12422     cpl_image_delete(subtracted);
-<a name="l12423"></a>12423 
-<a name="l12424"></a>12424 
-<a name="l12425"></a>12425     <span class="comment">/*</span>
-<a name="l12426"></a>12426 <span class="comment">     * Flag the sky pixels. Note that maxobjects is intentionally </span>
-<a name="l12427"></a>12427 <span class="comment">     * the max number of objects increased by one.</span>
-<a name="l12428"></a>12428 <span class="comment">     */</span>
-<a name="l12429"></a>12429 
-<a name="l12430"></a>12430     maxobjects = 1;
-<a name="l12431"></a>12431     snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, maxobjects);
-<a name="l12432"></a>12432     <span class="keywordflow">while</span> (cpl_table_has_column(objects, name)) {
-<a name="l12433"></a>12433         maxobjects++;
-<a name="l12434"></a>12434         snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, maxobjects);
-<a name="l12435"></a>12435     }
-<a name="l12436"></a>12436 
-<a name="l12437"></a>12437     is_sky = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l12438"></a>12438 
-<a name="l12439"></a>12439     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l12440"></a>12440 
-<a name="l12441"></a>12441         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l12442"></a>12442             <span class="keywordflow">continue</span>;
-<a name="l12443"></a>12443 
-<a name="l12444"></a>12444         ylow = position[i] + margin;
-<a name="l12445"></a>12445         yhig = position[i] + length[i] - margin;
-<a name="l12446"></a>12446 
-<a name="l12447"></a>12447         <span class="keywordflow">for</span> (j = ylow; j < yhig; j++)
-<a name="l12448"></a>12448             is_sky[j] = 1;
-<a name="l12449"></a>12449 
-<a name="l12450"></a>12450         <span class="keywordflow">for</span> (j = 1; j < maxobjects; j++) {
-<a name="l12451"></a>12451             snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, j);
-<a name="l12452"></a>12452             <span class="keywordflow">if</span> (cpl_table_is_valid(objects, name, i)) {
-<a name="l12453"></a>12453                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"start_%d"</span>, j);
-<a name="l12454"></a>12454                 ylow = cpl_table_get_int(objects, name, i, NULL);
-<a name="l12455"></a>12455                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"end_%d"</span>, j);
-<a name="l12456"></a>12456                 yhig = cpl_table_get_int(objects, name, i, NULL);
-<a name="l12457"></a>12457                 <span class="keywordflow">for</span> (k = ylow; k <= yhig; k++)
-<a name="l12458"></a>12458                     is_sky[k] = 0;
-<a name="l12459"></a>12459             }
-<a name="l12460"></a>12460         }
-<a name="l12461"></a>12461 
-<a name="l12462"></a>12462 
-<a name="l12463"></a>12463         <span class="comment">/*</span>
-<a name="l12464"></a>12464 <span class="comment">         * Eliminate isolated sky points</span>
-<a name="l12465"></a>12465 <span class="comment">         */</span>
-<a name="l12466"></a>12466 
-<a name="l12467"></a>12467         ylow = position[i] + margin + 1;
-<a name="l12468"></a>12468         yhig = position[i] + length[i] - margin - 1;
-<a name="l12469"></a>12469 
-<a name="l12470"></a>12470         <span class="keywordflow">for</span> (j = ylow; j < yhig; j++)
-<a name="l12471"></a>12471             <span class="keywordflow">if</span> (is_sky[j])
-<a name="l12472"></a>12472                 <span class="keywordflow">if</span> (is_sky[j-1] == 0 && is_sky[j+1] == 0)
-<a name="l12473"></a>12473                     is_sky[j] = 0;
-<a name="l12474"></a>12474 
-<a name="l12475"></a>12475     }
-<a name="l12476"></a>12476 
-<a name="l12477"></a>12477 
-<a name="l12478"></a>12478     <span class="comment">/*</span>
-<a name="l12479"></a>12479 <span class="comment">     * Determination of the sky map</span>
-<a name="l12480"></a>12480 <span class="comment">     */</span>
-<a name="l12481"></a>12481 
-<a name="l12482"></a>12482     skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l12483"></a>12483 
-<a name="l12484"></a>12484     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l12485"></a>12485 
-<a name="l12486"></a>12486         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l12487"></a>12487             <span class="keywordflow">continue</span>;
-<a name="l12488"></a>12488 
-<a name="l12489"></a>12489         ylow = position[i];
-<a name="l12490"></a>12490         yhig = ylow + length[i];
-<a name="l12491"></a>12491 
-<a name="l12492"></a>12492         nsky = 0;
-<a name="l12493"></a>12493         <span class="keywordflow">for</span> (j = ylow; j < yhig; j++)
-<a name="l12494"></a>12494             <span class="keywordflow">if</span> (is_sky[j])
-<a name="l12495"></a>12495                 nsky++;
-<a name="l12496"></a>12496 
-<a name="l12497"></a>12497         <span class="keywordflow">if</span> (nsky > order + 1) {
-<a name="l12498"></a>12498             <span class="keywordflow">if</span> (order) {
-<a name="l12499"></a>12499                 points = cpl_vector_new(nsky);
-<a name="l12500"></a>12500                 nsky = 0;
-<a name="l12501"></a>12501                 <span class="keywordflow">for</span> (j = ylow; j < yhig; j++) {
-<a name="l12502"></a>12502                     <span class="keywordflow">if</span> (is_sky[j]) {
-<a name="l12503"></a>12503                         cpl_vector_set(points, nsky, j);
-<a name="l12504"></a>12504                         nsky++;
-<a name="l12505"></a>12505                     }
-<a name="l12506"></a>12506                 }
-<a name="l12507"></a>12507 
-<a name="l12508"></a>12508                 exslit = cpl_image_extract(spectra, 1, ylow+1, nx, yhig);
-<a name="l12509"></a>12509                 xdata = cpl_image_get_data(exslit);
-<a name="l12510"></a>12510                 values = cpl_vector_new(nsky);
-<a name="l12511"></a>12511 
-<a name="l12512"></a>12512                 <span class="keywordflow">for</span> (j = 0; j < nx; j++) {
-<a name="l12513"></a>12513                     nsky = 0;
-<a name="l12514"></a>12514                     <span class="keywordflow">for</span> (k = ylow; k < yhig; k++) {
-<a name="l12515"></a>12515                         <span class="keywordflow">if</span> (is_sky[k]) {
-<a name="l12516"></a>12516                             cpl_vector_set(values, nsky, xdata[j+(k-ylow)*nx]);
-<a name="l12517"></a>12517                             nsky++;
-<a name="l12518"></a>12518                         }
-<a name="l12519"></a>12519                     }
-<a name="l12520"></a>12520 
-<a name="l12521"></a>12521                     <span class="comment">/*</span>
-<a name="l12522"></a>12522 <span class="comment">                     * Eliminate obvious outliers</span>
-<a name="l12523"></a>12523 <span class="comment">                     */</span>
-<a name="l12524"></a>12524 
-<a name="l12525"></a>12525                     median = cpl_vector_get_median_const(values);
-<a name="l12526"></a>12526                     vdata = cpl_vector_get_data(values);
-<a name="l12527"></a>12527                     pdata = cpl_vector_get_data(points);
-<a name="l12528"></a>12528                     nbad = 0;
-<a name="l12529"></a>12529                     <span class="keywordflow">for</span> (k = 0; k < nsky; k++) {
-<a name="l12530"></a>12530                         <span class="keywordflow">if</span> (fabs(vdata[k] - median) < 100) {
-<a name="l12531"></a>12531                             <span class="keywordflow">if</span> (nbad) {
-<a name="l12532"></a>12532                                 vdata[k-nbad] = vdata[k];
-<a name="l12533"></a>12533                                 pdata[k-nbad] = pdata[k];
-<a name="l12534"></a>12534                             }
-<a name="l12535"></a>12535                         }
-<a name="l12536"></a>12536                         <span class="keywordflow">else</span>
-<a name="l12537"></a>12537                             nbad++;
-<a name="l12538"></a>12538                     }
-<a name="l12539"></a>12539 
-<a name="l12540"></a>12540                     <span class="keywordflow">if</span> (nsky == nbad)
-<a name="l12541"></a>12541                         <span class="keywordflow">continue</span>;
-<a name="l12542"></a>12542 
-<a name="l12543"></a>12543                     <span class="keywordflow">if</span> (nbad && nsky - nbad > order + 1) {
-<a name="l12544"></a>12544                         keep_values = values;
-<a name="l12545"></a>12545                         keep_points = points;
-<a name="l12546"></a>12546                         values = cpl_vector_wrap(nsky-nbad, vdata);
-<a name="l12547"></a>12547                         points = cpl_vector_wrap(nsky-nbad, pdata);
-<a name="l12548"></a>12548                     }
-<a name="l12549"></a>12549 
-<a name="l12550"></a>12550                     <span class="keywordflow">if</span> (nsky - nbad > order + 1) {
-<a name="l12551"></a>12551 
-<a name="l12552"></a>12552                         fit = cpl_polynomial_fit_1d_create(points, values, 
-<a name="l12553"></a>12553                                                            order, NULL);
-<a name="l12554"></a>12554 
-<a name="l12555"></a>12555                         <span class="keywordflow">if</span> (fit) {
-<a name="l12556"></a>12556                             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++) {
-<a name="l12557"></a>12557                                 xdata[j+(k-ylow)*nx] = 
-<a name="l12558"></a>12558                                          cpl_polynomial_eval_1d(fit, k, NULL);
-<a name="l12559"></a>12559                             }
-<a name="l12560"></a>12560 
-<a name="l12561"></a>12561                             cpl_polynomial_delete(fit);
-<a name="l12562"></a>12562                         }
-<a name="l12563"></a>12563                         <span class="keywordflow">else</span>
-<a name="l12564"></a>12564                             cpl_error_reset();
-<a name="l12565"></a>12565                     }
-<a name="l12566"></a>12566                     <span class="keywordflow">else</span> {
-<a name="l12567"></a>12567                         <span class="keywordflow">for</span> (k = 0; k < nsky; k++) {
-<a name="l12568"></a>12568                             xdata[j+k*nx] = median;
-<a name="l12569"></a>12569                         }
-<a name="l12570"></a>12570                     }
-<a name="l12571"></a>12571 
-<a name="l12572"></a>12572                     <span class="keywordflow">if</span> (nbad && nsky - nbad > order + 1) {
-<a name="l12573"></a>12573                         cpl_vector_unwrap(values);
-<a name="l12574"></a>12574                         cpl_vector_unwrap(points);
-<a name="l12575"></a>12575                         values = keep_values;
-<a name="l12576"></a>12576                         points = keep_points;
-<a name="l12577"></a>12577                     }
-<a name="l12578"></a>12578 
-<a name="l12579"></a>12579                     <span class="keywordflow">if</span> (nbad) {
-<a name="l12580"></a>12580                         nsky = 0;
-<a name="l12581"></a>12581                         <span class="keywordflow">for</span> (k = ylow; k < yhig; k++) {
-<a name="l12582"></a>12582                             <span class="keywordflow">if</span> (is_sky[k]) {
-<a name="l12583"></a>12583                                 cpl_vector_set(points, nsky, k);
-<a name="l12584"></a>12584                                 nsky++;
-<a name="l12585"></a>12585                             }
-<a name="l12586"></a>12586                         }
-<a name="l12587"></a>12587                     }
-<a name="l12588"></a>12588 
-<a name="l12589"></a>12589                 }
-<a name="l12590"></a>12590 
-<a name="l12591"></a>12591                 cpl_vector_delete(values);
-<a name="l12592"></a>12592                 cpl_vector_delete(points);
-<a name="l12593"></a>12593 
-<a name="l12594"></a>12594                 cpl_image_copy(skymap, exslit, 1, ylow+1);
-<a name="l12595"></a>12595                 cpl_image_delete(exslit);
-<a name="l12596"></a>12596 
-<a name="l12597"></a>12597             }
-<a name="l12598"></a>12598             <span class="keywordflow">else</span> {
-<a name="l12599"></a>12599                 exslit = cpl_image_extract(spectra, 1, ylow+1, nx, yhig);
-<a name="l12600"></a>12600                 xdata = cpl_image_get_data(exslit);
-<a name="l12601"></a>12601                 values = cpl_vector_new(nsky);
-<a name="l12602"></a>12602 
-<a name="l12603"></a>12603                 <span class="keywordflow">for</span> (j = 0; j < nx; j++) {
-<a name="l12604"></a>12604                     nsky = 0;
-<a name="l12605"></a>12605                     <span class="keywordflow">for</span> (k = ylow; k < yhig; k++) {
-<a name="l12606"></a>12606                         <span class="keywordflow">if</span> (is_sky[k]) {
-<a name="l12607"></a>12607                             cpl_vector_set(values, nsky, xdata[j+(k-ylow)*nx]);
-<a name="l12608"></a>12608                             nsky++;
-<a name="l12609"></a>12609                         }
-<a name="l12610"></a>12610                     }
-<a name="l12611"></a>12611 
-<a name="l12612"></a>12612                     median = cpl_vector_get_median_const(values);
-<a name="l12613"></a>12613 
-<a name="l12614"></a>12614                     <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)
-<a name="l12615"></a>12615                         xdata[j+(k-ylow)*nx] = median;
-<a name="l12616"></a>12616 
-<a name="l12617"></a>12617                 }
-<a name="l12618"></a>12618 
-<a name="l12619"></a>12619                 cpl_vector_delete(values);
-<a name="l12620"></a>12620 
-<a name="l12621"></a>12621                 cpl_image_copy(skymap, exslit, 1, ylow+1);
-<a name="l12622"></a>12622                 cpl_image_delete(exslit);
-<a name="l12623"></a>12623             }
-<a name="l12624"></a>12624         }
-<a name="l12625"></a>12625         <span class="keywordflow">else</span>
-<a name="l12626"></a>12626             cpl_msg_warning(func, <span class="stringliteral">"Too few sky points in slit %d"</span>, i + 1);
-<a name="l12627"></a>12627     }
-<a name="l12628"></a>12628 
-<a name="l12629"></a>12629     cpl_free(is_sky);
-<a name="l12630"></a>12630 
-<a name="l12631"></a>12631     <span class="keywordflow">return</span> skymap;
-<a name="l12632"></a>12632 
-<a name="l12633"></a>12633 }
-<a name="l12634"></a>12634 
-<a name="l12635"></a>12635 
-<a name="l12657"></a><a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">12657</a> cpl_error_code <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(cpl_image *image, <span class="keywordtype">float</span> gain,
-<a name="l12658"></a>12658                                  <span class="keywordtype">float</span> threshold, <span class="keywordtype">float</span> ratio)
-<a name="l12659"></a>12659 {
-<a name="l12660"></a>12660     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_clean_cosmics"</span>;
-<a name="l12661"></a>12661 
-<a name="l12662"></a>12662     cpl_image  *smoothImage;
-<a name="l12663"></a>12663     cpl_table  *table;
-<a name="l12664"></a>12664     cpl_matrix *kernel;
-<a name="l12665"></a>12665     <span class="keywordtype">int</span>        *xdata;
-<a name="l12666"></a>12666     <span class="keywordtype">int</span>        *ydata;
-<a name="l12667"></a>12667     <span class="keywordtype">float</span>      *idata;
-<a name="l12668"></a>12668     <span class="keywordtype">float</span>      *sdata;
-<a name="l12669"></a>12669     <span class="keywordtype">float</span>       sigma, sum, value, smoothValue;
-<a name="l12670"></a>12670     <span class="keywordtype">double</span>      noise;
-<a name="l12671"></a>12671     <span class="keywordtype">int</span>         count;
-<a name="l12672"></a>12672     <span class="keywordtype">float</span>       fMax;
-<a name="l12673"></a>12673     <span class="keywordtype">int</span>         iMin, iMax, jMin, jMax, iPosMax, jPosMax;
-<a name="l12674"></a>12674     <span class="keywordtype">int</span>         xLen;
-<a name="l12675"></a>12675     <span class="keywordtype">int</span>         yLen;
-<a name="l12676"></a>12676     <span class="keywordtype">int</span>         nPix;
-<a name="l12677"></a>12677     <span class="keywordtype">int</span>         first = 1;  <span class="comment">/* position of first cosmic ray candidate</span>
-<a name="l12678"></a>12678 <span class="comment">                               encountered while scanning the image */</span>
-<a name="l12679"></a>12679     <span class="keywordtype">int</span>         pos, i, j, k, l, ii, jj, iii = 0, jjj = 0;
-<a name="l12680"></a>12680     <span class="keywordtype">int</span>         numCosmic = 0;
-<a name="l12681"></a>12681     <span class="keywordtype">int</span>         found, foundContiguousCandidate;
-<a name="l12682"></a>12682     <span class="keywordtype">int</span>        *cosmic;
-<a name="l12683"></a>12683   
-<a name="l12684"></a>12684 
-<a name="l12685"></a>12685     <span class="keywordflow">if</span> (image == NULL)
-<a name="l12686"></a>12686         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l12687"></a>12687 
-<a name="l12688"></a>12688 
-<a name="l12689"></a>12689     <span class="comment">/*</span>
-<a name="l12690"></a>12690 <span class="comment">     *  "cosmic" is a flags holder (initialized to zero):</span>
-<a name="l12691"></a>12691 <span class="comment">     *</span>
-<a name="l12692"></a>12692 <span class="comment">     *           -1 = candidate for cosmic ray</span>
-<a name="l12693"></a>12693 <span class="comment">     *            0 = not a cosmic</span>
-<a name="l12694"></a>12694 <span class="comment">     *            1 = a cosmic ray</span>
-<a name="l12695"></a>12695 <span class="comment">     *            2 = member of current group of contiguous candidates</span>
-<a name="l12696"></a>12696 <span class="comment">     *            3 = examined member of current group</span>
-<a name="l12697"></a>12697 <span class="comment">     */</span>
-<a name="l12698"></a>12698 
-<a name="l12699"></a>12699     xLen = cpl_image_get_size_x(image);
-<a name="l12700"></a>12700     yLen = cpl_image_get_size_y(image);
-<a name="l12701"></a>12701 
-<a name="l12702"></a>12702     <span class="keywordflow">if</span> (xLen < 4 || yLen < 4)
-<a name="l12703"></a>12703         <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l12704"></a>12704 
-<a name="l12705"></a>12705     nPix = xLen * yLen;
-<a name="l12706"></a>12706 
-<a name="l12707"></a>12707     <span class="comment">/*</span>
-<a name="l12708"></a>12708 <span class="comment">     * Noise estimation from negative offsets in image. Note that this</span>
-<a name="l12709"></a>12709 <span class="comment">     * assumes that the background level (skyLevel) has already been </span>
-<a name="l12710"></a>12710 <span class="comment">     * subtracted from the data. In this way we estimate the noise due </span>
-<a name="l12711"></a>12711 <span class="comment">     * to detector readout and to the background signal level (before </span>
-<a name="l12712"></a>12712 <span class="comment">     * it were removed). Theoretically this is given by </span>
-<a name="l12713"></a>12713 <span class="comment">     *</span>
-<a name="l12714"></a>12714 <span class="comment">     *        noise = sqrt(ron^2 + skyLevel/gain)</span>
-<a name="l12715"></a>12715 <span class="comment">     *</span>
-<a name="l12716"></a>12716 <span class="comment">     * where ron is the read-out-noise. To this we will sum the noise </span>
-<a name="l12717"></a>12717 <span class="comment">     * contribution due to any increase of the signal above the background</span>
-<a name="l12718"></a>12718 <span class="comment">     * by an amount scienceLevel. Theoretically the total noise is given by</span>
-<a name="l12719"></a>12719 <span class="comment">     *</span>
-<a name="l12720"></a>12720 <span class="comment">     *        totalNoise = sqrt(ron^2 + (skyLevel+scienceLevel)/gain)</span>
-<a name="l12721"></a>12721 <span class="comment">     *</span>
-<a name="l12722"></a>12722 <span class="comment">     * that is</span>
-<a name="l12723"></a>12723 <span class="comment">     *</span>
-<a name="l12724"></a>12724 <span class="comment">     *        totalNoise = sqrt(noise^2 + scienceLevel/gain)</span>
-<a name="l12725"></a>12725 <span class="comment">     *</span>
-<a name="l12726"></a>12726 <span class="comment">     */</span>
-<a name="l12727"></a>12727 
-<a name="l12728"></a>12728     idata = cpl_image_get_data(image);
-<a name="l12729"></a>12729     noise = 0.0;
-<a name="l12730"></a>12730     count = 0;
-<a name="l12731"></a>12731 
-<a name="l12732"></a>12732     <span class="keywordflow">for</span> (i = 0; i < nPix; i++) {
-<a name="l12733"></a>12733         <span class="keywordflow">if</span> (idata[i] < -0.00001) {
-<a name="l12734"></a>12734             noise -= idata[i];
-<a name="l12735"></a>12735             count++;
-<a name="l12736"></a>12736         }
-<a name="l12737"></a>12737     }
-<a name="l12738"></a>12738 
-<a name="l12739"></a>12739     noise /= count;
-<a name="l12740"></a>12740     noise *= 1.25;       <span class="comment">/* Factor to convert average deviation to sigma */</span>
-<a name="l12741"></a>12741 
-<a name="l12742"></a>12742     cosmic = cpl_calloc(nPix, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l12743"></a>12743 
-<a name="l12744"></a>12744     <span class="keywordflow">if</span> (threshold < 0.)
-<a name="l12745"></a>12745         threshold = 4.0;
-<a name="l12746"></a>12746     <span class="keywordflow">if</span> (ratio < 0.)
-<a name="l12747"></a>12747         ratio = 2.0;
-<a name="l12748"></a>12748 
-<a name="l12749"></a>12749     kernel = cpl_matrix_new(3, 3);
-<a name="l12750"></a>12750     cpl_matrix_fill(kernel, 1.0);
-<a name="l12751"></a>12751     cpl_matrix_set(kernel, 1, 1, 0.0);
-<a name="l12752"></a>12752     smoothImage = cpl_image_filter_median(image, kernel);
-<a name="l12753"></a>12753     cpl_matrix_delete(kernel);
-<a name="l12754"></a>12754     
-<a name="l12755"></a>12755     <span class="comment">/*</span>
-<a name="l12756"></a>12756 <span class="comment">     *  Loop on images pixels, searching for cosmic rays candidates.</span>
-<a name="l12757"></a>12757 <span class="comment">     *  Border pixels are currently excluded (they cannot contain</span>
-<a name="l12758"></a>12758 <span class="comment">     *  candidates), to avoid that the search for groups of contiguous</span>
-<a name="l12759"></a>12759 <span class="comment">     *  pixels would ever go out of image boundaries. In future we may</span>
-<a name="l12760"></a>12760 <span class="comment">     *  overcome this limit, adding an appropriate check when contiguous</span>
-<a name="l12761"></a>12761 <span class="comment">     *  pixels are searched.</span>
-<a name="l12762"></a>12762 <span class="comment">     */</span>
-<a name="l12763"></a>12763 
-<a name="l12764"></a>12764     sdata = cpl_image_get_data(smoothImage);
-<a name="l12765"></a>12765 
-<a name="l12766"></a>12766     <span class="keywordflow">for</span> (j = 1; j < yLen - 1; j++) {
-<a name="l12767"></a>12767         <span class="keywordflow">for</span> (i = 1; i < xLen - 1; i++) {
-<a name="l12768"></a>12768             value = idata[i + j * xLen];
-<a name="l12769"></a>12769             smoothValue = sdata[i + j * xLen];
-<a name="l12770"></a>12770             <span class="keywordflow">if</span> (smoothValue < 1.0)
-<a name="l12771"></a>12771                 smoothValue = 1.0;
-<a name="l12772"></a>12772             sigma = sqrt(noise * noise + smoothValue / gain);
-<a name="l12773"></a>12773             <span class="keywordflow">if</span> (value - smoothValue >= threshold * sigma) 
-<a name="l12774"></a>12774                 cosmic[i + j * xLen] = -1;
-<a name="l12775"></a>12775         }
-<a name="l12776"></a>12776     }
-<a name="l12777"></a>12777 
-<a name="l12778"></a>12778     cpl_image_delete(smoothImage);
-<a name="l12779"></a>12779 
-<a name="l12780"></a>12780 
-<a name="l12781"></a>12781     <span class="comment">/*</span>
-<a name="l12782"></a>12782 <span class="comment">     *  Search for groups of contiguous cosmic rays candidates.</span>
-<a name="l12783"></a>12783 <span class="comment">     */</span>
-<a name="l12784"></a>12784 
-<a name="l12785"></a>12785     <span class="keywordflow">do</span> {
-<a name="l12786"></a>12786         found = 0;
-<a name="l12787"></a>12787         <span class="keywordflow">for</span> (pos = first; pos < nPix; pos++) {
-<a name="l12788"></a>12788             <span class="keywordflow">if</span> (cosmic[pos] == -1) {
-<a name="l12789"></a>12789                 cosmic[pos] = 2;         <span class="comment">/*  Candidate found.  */</span>
-<a name="l12790"></a>12790                 i = pos % xLen;          <span class="comment">/*  Its coordinates.  */</span>
-<a name="l12791"></a>12791                 j = pos / xLen;
-<a name="l12792"></a>12792                 first = pos;
-<a name="l12793"></a>12793                 first++;      <span class="comment">/* ???  really necessary? */</span>
-<a name="l12794"></a>12794                 found = 1;
-<a name="l12795"></a>12795                 <span class="keywordflow">break</span>;
-<a name="l12796"></a>12796             }
-<a name="l12797"></a>12797         }
-<a name="l12798"></a>12798 
-<a name="l12799"></a>12799         <span class="keywordflow">if</span> (found) {
-<a name="l12800"></a>12800 
-<a name="l12801"></a>12801             <span class="comment">/*</span>
-<a name="l12802"></a>12802 <span class="comment">             *  Determine new group of contiguous cosmic rays candidates.</span>
-<a name="l12803"></a>12803 <span class="comment">             *  Initialize the working box boundaries, iMin, iMax, jMin, jMax, </span>
-<a name="l12804"></a>12804 <span class="comment">             *  and the value of the max pixel and its position, fMax, iPosMax,</span>
-<a name="l12805"></a>12805 <span class="comment">             *  jPosMax.</span>
-<a name="l12806"></a>12806 <span class="comment">             */</span>
-<a name="l12807"></a>12807 
-<a name="l12808"></a>12808             iMin = iMax = iPosMax = i;
-<a name="l12809"></a>12809             jMin = jMax = jPosMax = j;
-<a name="l12810"></a>12810             fMax = idata[i + j * xLen];
-<a name="l12811"></a>12811 
-<a name="l12812"></a>12812             <span class="keywordflow">do</span> {
-<a name="l12813"></a>12813                 foundContiguousCandidate = 0;
-<a name="l12814"></a>12814                 <span class="keywordflow">for</span> (l = 0; l <= 1; l++) {
-<a name="l12815"></a>12815                     <span class="keywordflow">for</span> (k = 0; k <= 1; k++) {
-<a name="l12816"></a>12816 
-<a name="l12817"></a>12817                         <span class="comment">/*</span>
-<a name="l12818"></a>12818 <span class="comment">                         *  Looping on 4 pixels to North, East, South and West</span>
-<a name="l12819"></a>12819 <span class="comment">                         */</span>
-<a name="l12820"></a>12820 
-<a name="l12821"></a>12821                         ii = i + k - l;
-<a name="l12822"></a>12822                         jj = j + k + l - 1;
-<a name="l12823"></a>12823                         <span class="keywordflow">if</span> (cosmic[ii + jj * xLen] == -1) {
-<a name="l12824"></a>12824                             foundContiguousCandidate = 1;
-<a name="l12825"></a>12825                             cosmic[ii + jj * xLen] = 2;
-<a name="l12826"></a>12826                                         <span class="comment">/* Candidate belongs to current group */</span>
-<a name="l12827"></a>12827                             iii = ii;   <span class="comment">/* Keep its position */</span>
-<a name="l12828"></a>12828                             jjj = jj;
-<a name="l12829"></a>12829 
-<a name="l12830"></a>12830                             <span class="comment">/*</span>
-<a name="l12831"></a>12831 <span class="comment">                             * Upgrade search box</span>
-<a name="l12832"></a>12832 <span class="comment">                             */</span>
-<a name="l12833"></a>12833 
-<a name="l12834"></a>12834                             <span class="keywordflow">if</span> (ii < iMin)
-<a name="l12835"></a>12835                                 iMin = ii;
-<a name="l12836"></a>12836                             <span class="keywordflow">if</span> (ii > iMax)
-<a name="l12837"></a>12837                                 iMax = ii;
-<a name="l12838"></a>12838                             <span class="keywordflow">if</span> (jj < jMin)
-<a name="l12839"></a>12839                                 jMin = jj;
-<a name="l12840"></a>12840                             <span class="keywordflow">if</span> (jj > jMax)
-<a name="l12841"></a>12841                                 jMax = jj;
-<a name="l12842"></a>12842 
-<a name="l12843"></a>12843                             <span class="keywordflow">if</span> (idata[ii + jj * xLen] > fMax) {
-<a name="l12844"></a>12844                                 fMax = idata[ii + jj * xLen];
-<a name="l12845"></a>12845                                 iPosMax = ii;
-<a name="l12846"></a>12846                                 jPosMax = jj;
-<a name="l12847"></a>12847                             }
-<a name="l12848"></a>12848                         }
-<a name="l12849"></a>12849                     }
-<a name="l12850"></a>12850                 }
-<a name="l12851"></a>12851 
-<a name="l12852"></a>12852                 <span class="comment">/*</span>
-<a name="l12853"></a>12853 <span class="comment">                 *  We are done exploring the "cross". Now mark as "examined"</span>
-<a name="l12854"></a>12854 <span class="comment">                 *  the current candidate (at the center of the cross):</span>
-<a name="l12855"></a>12855 <span class="comment">                 */</span>
-<a name="l12856"></a>12856 
-<a name="l12857"></a>12857                 cosmic[i + j * xLen] = 3; <span class="comment">/* It may probably be set to 1 now */</span>
-<a name="l12858"></a>12858 
-<a name="l12859"></a>12859                 <span class="keywordflow">if</span> (foundContiguousCandidate) {
-<a name="l12860"></a>12860 
-<a name="l12861"></a>12861                     <span class="comment">/*</span>
-<a name="l12862"></a>12862 <span class="comment">                     * Pass (arbitrarily) the coordinates of the LAST found </span>
-<a name="l12863"></a>12863 <span class="comment">                     * candidate</span>
-<a name="l12864"></a>12864 <span class="comment">                     */</span>
-<a name="l12865"></a>12865 
-<a name="l12866"></a>12866                     i = iii;
-<a name="l12867"></a>12867                     j = jjj;
-<a name="l12868"></a>12868 
-<a name="l12869"></a>12869                     <span class="comment">/* </span>
-<a name="l12870"></a>12870 <span class="comment">                     * Skip the rest, continue loop on new candidate </span>
-<a name="l12871"></a>12871 <span class="comment">                     */</span>
-<a name="l12872"></a>12872 
-<a name="l12873"></a>12873                     <span class="keywordflow">continue</span>; 
-<a name="l12874"></a>12874                 }
-<a name="l12875"></a>12875 
-<a name="l12876"></a>12876 
-<a name="l12877"></a>12877                 <span class="comment">/*</span>
-<a name="l12878"></a>12878 <span class="comment">                 *  Look for leftovers in the (growing!) search box</span>
-<a name="l12879"></a>12879 <span class="comment">                 */</span>
-<a name="l12880"></a>12880 
-<a name="l12881"></a>12881                 <span class="keywordflow">for</span> (l = jMin; l <= jMax; l++) {
-<a name="l12882"></a>12882                     <span class="keywordflow">for</span> (k = iMin; k <= iMax; k++) {
-<a name="l12883"></a>12883                         <span class="keywordflow">if</span> (cosmic[k + l * xLen] == 2) {
-<a name="l12884"></a>12884                             i = k;
-<a name="l12885"></a>12885                             j = l;
-<a name="l12886"></a>12886                             foundContiguousCandidate = 1;
-<a name="l12887"></a>12887                             <span class="keywordflow">break</span>;
-<a name="l12888"></a>12888                         }
-<a name="l12889"></a>12889                     }
-<a name="l12890"></a>12890                     <span class="keywordflow">if</span> (foundContiguousCandidate) 
-<a name="l12891"></a>12891                         <span class="keywordflow">break</span>;
-<a name="l12892"></a>12892                 }
-<a name="l12893"></a>12893             } <span class="keywordflow">while</span> (foundContiguousCandidate);
-<a name="l12894"></a>12894 
-<a name="l12895"></a>12895 
-<a name="l12896"></a>12896             <span class="comment">/*</span>
-<a name="l12897"></a>12897 <span class="comment">             *  No more contiguous candidates are found. Decide now</span>
-<a name="l12898"></a>12898 <span class="comment">             *  whether the current group is a cosmic ray or not.</span>
-<a name="l12899"></a>12899 <span class="comment">             */</span>
-<a name="l12900"></a>12900 
-<a name="l12901"></a>12901             sum = 0.;                <span class="comment">/* Sum of 8 pixels around max position */</span>
-<a name="l12902"></a>12902             <span class="keywordflow">for</span> (l = -1; l <= 1; l++) {
-<a name="l12903"></a>12903                 <span class="keywordflow">for</span> (k = -1; k <= 1; k++) {
-<a name="l12904"></a>12904                     <span class="keywordflow">if</span> (l != 0 || k != 0) {
-<a name="l12905"></a>12905                         sum += idata[iPosMax + k + (jPosMax + l) * xLen];
-<a name="l12906"></a>12906                     }
-<a name="l12907"></a>12907                 }
-<a name="l12908"></a>12908             }
-<a name="l12909"></a>12909 
-<a name="l12910"></a>12910             sum /= 8.;
-<a name="l12911"></a>12911             <span class="keywordflow">if</span> (fMax > ratio * sum) {
-<a name="l12912"></a>12912                 <span class="keywordflow">for</span> (l = jMin - 1; l <= jMax + 1; l++) {
-<a name="l12913"></a>12913                     <span class="keywordflow">for</span> (k = iMin - 1; k <= iMax + 1; k++) {
-<a name="l12914"></a>12914                         <span class="keywordflow">if</span> (cosmic[k + l * xLen] == 3) {
-<a name="l12915"></a>12915                             cosmic[k + l * xLen] = 1;
-<a name="l12916"></a>12916                             numCosmic++;
-<a name="l12917"></a>12917                         }
-<a name="l12918"></a>12918                     }
-<a name="l12919"></a>12919                 }
-<a name="l12920"></a>12920             }
-<a name="l12921"></a>12921             <span class="keywordflow">else</span> {
-<a name="l12922"></a>12922                 <span class="keywordflow">for</span> (l = jMin - 1; l <= jMax + 1; l++) {
-<a name="l12923"></a>12923                     <span class="keywordflow">for</span> (k = iMin - 1; k <= iMax + 1; k++) {
-<a name="l12924"></a>12924                         <span class="keywordflow">if</span> (cosmic[k + l * xLen] != -1) {
-<a name="l12925"></a>12925                             <span class="keywordflow">if</span> (cosmic[k + l * xLen] == 1) 
-<a name="l12926"></a>12926                                 numCosmic--;
-<a name="l12927"></a>12927                             cosmic[k + l * xLen] = 0;
-<a name="l12928"></a>12928                         }
-<a name="l12929"></a>12929                     }
-<a name="l12930"></a>12930                 }
-<a name="l12931"></a>12931             }
-<a name="l12932"></a>12932         }
-<a name="l12933"></a>12933     } <span class="keywordflow">while</span> (found);
-<a name="l12934"></a>12934 
-<a name="l12935"></a>12935 
-<a name="l12936"></a>12936     <span class="comment">/*</span>
-<a name="l12937"></a>12937 <span class="comment">     *  Prepare table containing cosmic rays coordinates. </span>
-<a name="l12938"></a>12938 <span class="comment">     */</span>
-<a name="l12939"></a>12939 
-<a name="l12940"></a>12940     table = cpl_table_new(numCosmic);
-<a name="l12941"></a>12941     cpl_table_new_column(table, <span class="stringliteral">"x"</span>, CPL_TYPE_INT);
-<a name="l12942"></a>12942     cpl_table_new_column(table, <span class="stringliteral">"y"</span>, CPL_TYPE_INT);
-<a name="l12943"></a>12943     cpl_table_set_column_unit(table, <span class="stringliteral">"x"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l12944"></a>12944     cpl_table_set_column_unit(table, <span class="stringliteral">"y"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l12945"></a>12945     xdata = cpl_table_get_data_int(table, <span class="stringliteral">"x"</span>);
-<a name="l12946"></a>12946     ydata = cpl_table_get_data_int(table, <span class="stringliteral">"y"</span>);
-<a name="l12947"></a>12947 
-<a name="l12948"></a>12948     <span class="keywordflow">for</span> (pos = 0, i = 0; pos < nPix; pos++) {
-<a name="l12949"></a>12949         <span class="keywordflow">if</span> (cosmic[pos] == 1) {
-<a name="l12950"></a>12950             xdata[i] = (pos % xLen);
-<a name="l12951"></a>12951             ydata[i] = (pos / xLen);
-<a name="l12952"></a>12952             i++;
-<a name="l12953"></a>12953         }
-<a name="l12954"></a>12954     }
-<a name="l12955"></a>12955 
-<a name="l12956"></a>12956     <a class="code" href="group__moses.html#g9be86f4e59f9ef4d604c0e4f24d41655">mos_clean_bad_pixels</a>(image, table, 1);
-<a name="l12957"></a>12957 
-<a name="l12958"></a>12958     cpl_free(cosmic);
-<a name="l12959"></a>12959     cpl_table_delete(table);
-<a name="l12960"></a>12960 
-<a name="l12961"></a>12961     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l12962"></a>12962 
-<a name="l12963"></a>12963 }
-<a name="l12964"></a>12964 
-<a name="l12965"></a>12965 
-<a name="l12966"></a><a class="code" href="group__moses.html#g9be86f4e59f9ef4d604c0e4f24d41655">12966</a> cpl_error_code <a class="code" href="group__moses.html#g9be86f4e59f9ef4d604c0e4f24d41655">mos_clean_bad_pixels</a>(cpl_image *image, cpl_table *table,
-<a name="l12967"></a>12967                                     <span class="keywordtype">int</span> spectral)
-<a name="l12968"></a>12968 {
-<a name="l12969"></a>12969     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_clean_cosmics"</span>;
-<a name="l12970"></a>12970  
-<a name="l12971"></a>12971     <span class="keywordtype">float</span>       *idata;
-<a name="l12972"></a>12972     <span class="keywordtype">int</span>         *isBadPix;
-<a name="l12973"></a>12973     <span class="keywordtype">int</span>          i, j, k, d;
-<a name="l12974"></a>12974     <span class="keywordtype">int</span>          xlen, ylen, totPix;
-<a name="l12975"></a>12975     <span class="keywordtype">int</span>          nBadPixels = 0;
-<a name="l12976"></a>12976     <span class="keywordtype">int</span>          sign, foundFirst;
-<a name="l12977"></a>12977     <span class="keywordtype">int</span>         *xValue = NULL;
-<a name="l12978"></a>12978     <span class="keywordtype">int</span>         *yValue = NULL;
-<a name="l12979"></a>12979     <span class="keywordtype">float</span>        save = 0.;
-<a name="l12980"></a>12980     <span class="keywordtype">double</span>       sumd;
-<a name="l12981"></a>12981     <span class="keywordtype">int</span>          cx, cy;
-<a name="l12982"></a>12982     <span class="keywordtype">int</span>          nPairs;
-<a name="l12983"></a>12983     <span class="keywordtype">float</span>        estimate[4];
-<a name="l12984"></a>12984     <span class="keywordtype">int</span>          sx[] = {0, 1, 1, 1};
-<a name="l12985"></a>12985     <span class="keywordtype">int</span>          sy[] = {1,-1, 0, 1};
-<a name="l12986"></a>12986     <span class="keywordtype">int</span>          searchHorizon = 100;
-<a name="l12987"></a>12987     <span class="keywordtype">int</span>          percent = 15;
-<a name="l12988"></a>12988 
-<a name="l12989"></a>12989 
-<a name="l12990"></a>12990     <span class="keywordflow">if</span> (image == NULL || table == NULL)
-<a name="l12991"></a>12991         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l12992"></a>12992 
-<a name="l12993"></a>12993     <span class="keywordflow">if</span> (1 != cpl_table_has_column(table, <span class="stringliteral">"x"</span>))
-<a name="l12994"></a>12994         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l12995"></a>12995 
-<a name="l12996"></a>12996     <span class="keywordflow">if</span> (1 != cpl_table_has_column(table, <span class="stringliteral">"y"</span>))
-<a name="l12997"></a>12997         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l12998"></a>12998 
-<a name="l12999"></a>12999     <span class="keywordflow">if</span> (CPL_TYPE_INT != cpl_table_get_column_type(table, <span class="stringliteral">"x"</span>))
-<a name="l13000"></a>13000         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l13001"></a>13001 
-<a name="l13002"></a>13002     <span class="keywordflow">if</span> (CPL_TYPE_INT != cpl_table_get_column_type(table, <span class="stringliteral">"y"</span>))
-<a name="l13003"></a>13003         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l13004"></a>13004 
-<a name="l13005"></a>13005     nBadPixels = cpl_table_get_nrow(table);
-<a name="l13006"></a>13006 
-<a name="l13007"></a>13007     <span class="keywordflow">if</span> (nBadPixels) {
-<a name="l13008"></a>13008         xlen = cpl_image_get_size_x(image);
-<a name="l13009"></a>13009         ylen = cpl_image_get_size_y(image);
-<a name="l13010"></a>13010         idata = cpl_image_get_data(image);
-<a name="l13011"></a>13011         totPix = xlen * ylen;
-<a name="l13012"></a>13012         <span class="keywordflow">if</span> (((<span class="keywordtype">float</span>) nBadPixels) / ((<span class="keywordtype">float</span>) totPix) < percent/100.) {
-<a name="l13013"></a>13013             isBadPix = cpl_calloc(totPix, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l13014"></a>13014         }
-<a name="l13015"></a>13015         <span class="keywordflow">else</span> {
-<a name="l13016"></a>13016             cpl_msg_warning(func, <span class="stringliteral">"Too many bad pixels (> %d%%): "</span>
-<a name="l13017"></a>13017                             <span class="stringliteral">"skip bad pixel correction"</span>, percent);
-<a name="l13018"></a>13018             <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l13019"></a>13019         }
-<a name="l13020"></a>13020     }
-<a name="l13021"></a>13021     <span class="keywordflow">else</span> {
-<a name="l13022"></a>13022         cpl_msg_debug(func, <span class="stringliteral">"No pixel values to interpolate"</span>);
-<a name="l13023"></a>13023         <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l13024"></a>13024     }
-<a name="l13025"></a>13025 
-<a name="l13026"></a>13026     xValue = cpl_table_get_data_int(table, <span class="stringliteral">"x"</span>);
-<a name="l13027"></a>13027     yValue = cpl_table_get_data_int(table, <span class="stringliteral">"y"</span>);
-<a name="l13028"></a>13028 
-<a name="l13029"></a>13029     <span class="keywordflow">for</span> (i = 0; i < nBadPixels; i++)
-<a name="l13030"></a>13030         isBadPix[xValue[i] + yValue[i] * xlen] = 1;
-<a name="l13031"></a>13031 
-<a name="l13032"></a>13032     <span class="keywordflow">for</span> (i = 0; i < nBadPixels; i++) {
-<a name="l13033"></a>13033 
-<a name="l13034"></a>13034         <span class="comment">/*</span>
-<a name="l13035"></a>13035 <span class="comment">         *  Search for the closest good pixel along the 4 fundamental </span>
-<a name="l13036"></a>13036 <span class="comment">         *  directions (in both senses):</span>
-<a name="l13037"></a>13037 <span class="comment">         *                            \ | /</span>
-<a name="l13038"></a>13038 <span class="comment">         *                             \|/</span>
-<a name="l13039"></a>13039 <span class="comment">         *                           --- ---</span>
-<a name="l13040"></a>13040 <span class="comment">         *                             /|\</span>
-<a name="l13041"></a>13041 <span class="comment">         *                            / | \</span>
-<a name="l13042"></a>13042 <span class="comment">         *</span>
-<a name="l13043"></a>13043 <span class="comment">         *  Then collect pairs of values to interpolate linearly.</span>
-<a name="l13044"></a>13044 <span class="comment">         */</span>
-<a name="l13045"></a>13045 
-<a name="l13046"></a>13046         nPairs = 0;
-<a name="l13047"></a>13047         <span class="keywordflow">for</span> (j = 0; j < 4; j++) {
-<a name="l13048"></a>13048 
-<a name="l13049"></a>13049             <span class="keywordflow">if</span> (spectral) <span class="comment">/* Just horizontal interpolation for spectral data */</span>
-<a name="l13050"></a>13050                 <span class="keywordflow">if</span> (j != 2)
-<a name="l13051"></a>13051                     <span class="keywordflow">continue</span>;
-<a name="l13052"></a>13052 
-<a name="l13053"></a>13053             estimate[nPairs] = 0.;  <span class="comment">/* Pairs interpolations are stored here */</span>
-<a name="l13054"></a>13054             sumd = 0.;
-<a name="l13055"></a>13055             foundFirst = 0;
-<a name="l13056"></a>13056             <span class="keywordflow">for</span> (k = 0; k < 2; k++) {
-<a name="l13057"></a>13057                 sign = 2 * k - 1;
-<a name="l13058"></a>13058                 d = 0;
-<a name="l13059"></a>13059                 cx = xValue[i];
-<a name="l13060"></a>13060                 cy = yValue[i];
-<a name="l13061"></a>13061                 <span class="keywordflow">do</span> {
-<a name="l13062"></a>13062                     cx += sign * sx[j];
-<a name="l13063"></a>13063                     cy += sign * sy[j];
-<a name="l13064"></a>13064                     <span class="keywordflow">if</span> (cx < 0 || cx >= xlen || cy < 0 || cy >= ylen) 
-<a name="l13065"></a>13065                         <span class="keywordflow">break</span>;
-<a name="l13066"></a>13066                     d++;
-<a name="l13067"></a>13067                 } <span class="keywordflow">while</span> (isBadPix[cx + cy * xlen] && d < searchHorizon);
-<a name="l13068"></a>13068 
-<a name="l13069"></a>13069                 <span class="keywordflow">if</span> (cx >= 0 && cx < xlen && 
-<a name="l13070"></a>13070                     cy >= 0 && cy < ylen && d < searchHorizon) {
-<a name="l13071"></a>13071 
-<a name="l13072"></a>13072                     <span class="comment">/*</span>
-<a name="l13073"></a>13073 <span class="comment">                     *  In this block is cripted the linear interpolation...</span>
-<a name="l13074"></a>13074 <span class="comment">                     */</span>
-<a name="l13075"></a>13075 
-<a name="l13076"></a>13076                     save = idata[cx + cy * xlen];
-<a name="l13077"></a>13077                     estimate[nPairs] += save / d;
-<a name="l13078"></a>13078                     sumd += 1. / (double) d;
-<a name="l13079"></a>13079                     <span class="keywordflow">if</span> (k) {
-<a name="l13080"></a>13080                         estimate[nPairs] /= sumd;
-<a name="l13081"></a>13081                         nPairs++;
-<a name="l13082"></a>13082                     }
-<a name="l13083"></a>13083                     <span class="keywordflow">else</span> {
-<a name="l13084"></a>13084                         foundFirst = 1;
-<a name="l13085"></a>13085                     }
-<a name="l13086"></a>13086                 }
-<a name="l13087"></a>13087                 <span class="keywordflow">else</span> {
-<a name="l13088"></a>13088 
-<a name="l13089"></a>13089                     <span class="comment">/*</span>
-<a name="l13090"></a>13090 <span class="comment">                     * Image borders were crossed, incomplete pair of values</span>
-<a name="l13091"></a>13091 <span class="comment">                     */</span>
-<a name="l13092"></a>13092 
-<a name="l13093"></a>13093                     <span class="keywordflow">if</span> (k) {
-<a name="l13094"></a>13094                         <span class="keywordflow">if</span> (foundFirst) {
-<a name="l13095"></a>13095                             estimate[nPairs] = save;
-<a name="l13096"></a>13096                             nPairs++;
-<a name="l13097"></a>13097                         }
-<a name="l13098"></a>13098                     }
-<a name="l13099"></a>13099                 }
-<a name="l13100"></a>13100             }
-<a name="l13101"></a>13101         }
-<a name="l13102"></a>13102 
-<a name="l13103"></a>13103         <span class="comment">/*</span>
-<a name="l13104"></a>13104 <span class="comment">         * Replace pixel value of the input image, corresponding to</span>
-<a name="l13105"></a>13105 <span class="comment">         * the current bad pixel, with the median of the estimates</span>
-<a name="l13106"></a>13106 <span class="comment">         * resulted from the 4 linear interpolations.</span>
-<a name="l13107"></a>13107 <span class="comment">         */</span>
-<a name="l13108"></a>13108 
-<a name="l13109"></a>13109         <span class="keywordflow">if</span> (nPairs > 2) {
-<a name="l13110"></a>13110             idata[xValue[i] + yValue[i] * xlen] = 
-<a name="l13111"></a>13111                                cpl_tools_get_median_float(estimate, nPairs);
-<a name="l13112"></a>13112         }
-<a name="l13113"></a>13113         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nPairs == 2) {
-<a name="l13114"></a>13114             idata[xValue[i] + yValue[i] * xlen] =
-<a name="l13115"></a>13115                                             (estimate[0] + estimate[1]) / 2.;
-<a name="l13116"></a>13116         }
-<a name="l13117"></a>13117         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nPairs == 1) {
-<a name="l13118"></a>13118             idata[xValue[i] + yValue[i] * xlen] = estimate[0];
-<a name="l13119"></a>13119         }
-<a name="l13120"></a>13120         <span class="keywordflow">else</span> {
-<a name="l13121"></a>13121             cpl_msg_debug(func, <span class="stringliteral">"Cannot correct bad pixel %d,%d\n"</span>,
-<a name="l13122"></a>13122                           xValue[i], yValue[i]);
-<a name="l13123"></a>13123         }
-<a name="l13124"></a>13124     }
-<a name="l13125"></a>13125 
-<a name="l13126"></a>13126     cpl_free(isBadPix);
-<a name="l13127"></a>13127 
-<a name="l13128"></a>13128     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l13129"></a>13129 }
-<a name="l13130"></a>13130 
-<a name="l13131"></a>13131 
-<a name="l13161"></a><a class="code" href="group__moses.html#ge8df117eba59d1599f3172975b6f7139">13161</a> cpl_image *<a class="code" href="group__moses.html#ge8df117eba59d1599f3172975b6f7139">mos_spatial_map</a>(cpl_image *spectra, cpl_table *slits,
-<a name="l13162"></a>13162                            cpl_table *polytraces, <span class="keywordtype">double</span> reference,
-<a name="l13163"></a>13163                            <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion)
-<a name="l13164"></a>13164 {
-<a name="l13165"></a>13165     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_spatial_map"</span>;
-<a name="l13166"></a>13166 
-<a name="l13167"></a>13167     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l13168"></a>13168                                                  <span class="comment">/* Max order is 5 */</span>
-<a name="l13169"></a>13169     cpl_polynomial *polytop;
-<a name="l13170"></a>13170     cpl_polynomial *polybot;
-<a name="l13171"></a>13171     cpl_image      *calibration;
-<a name="l13172"></a>13172     <span class="keywordtype">float</span>          *data;
-<a name="l13173"></a>13173     <span class="keywordtype">double</span>          top, bot;
-<a name="l13174"></a>13174     <span class="keywordtype">double</span>          coeff;
-<a name="l13175"></a>13175     <span class="keywordtype">double</span>          ytop, ybot;
-<a name="l13176"></a>13176     <span class="keywordtype">double</span>          ypos, yfra;
-<a name="l13177"></a>13177     <span class="keywordtype">double</span>          factor;
-<a name="l13178"></a>13178     <span class="keywordtype">int</span>             yint, yprev;
-<a name="l13179"></a>13179     <span class="keywordtype">int</span>             nslits;
-<a name="l13180"></a>13180     <span class="keywordtype">int</span>             npseudo;
-<a name="l13181"></a>13181     <span class="keywordtype">int</span>            *slit_id;
-<a name="l13182"></a>13182     <span class="keywordtype">int</span>            *length;
-<a name="l13183"></a>13183     <span class="keywordtype">int</span>             nx, ny;
-<a name="l13184"></a>13184     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;
-<a name="l13185"></a>13185     <span class="keywordtype">int</span>             missing_top, missing_bot;
-<a name="l13186"></a>13186     <span class="keywordtype">int</span>             null;
-<a name="l13187"></a>13187     <span class="keywordtype">int</span>             order;
-<a name="l13188"></a>13188     <span class="keywordtype">int</span>             i, j;
-<a name="l13189"></a>13189     cpl_size        k;
-<a name="l13190"></a>13190 
-<a name="l13191"></a>13191 
-<a name="l13192"></a>13192     <span class="keywordflow">if</span> (spectra == NULL || slits == NULL || polytraces == NULL) {
-<a name="l13193"></a>13193         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l13194"></a>13194         <span class="keywordflow">return</span> NULL;
-<a name="l13195"></a>13195     }
-<a name="l13196"></a>13196 
-<a name="l13197"></a>13197     <span class="keywordflow">if</span> (dispersion <= 0.0) {
-<a name="l13198"></a>13198         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l13199"></a>13199         <span class="keywordflow">return</span> NULL;
-<a name="l13200"></a>13200     }
-<a name="l13201"></a>13201 
-<a name="l13202"></a>13202     <span class="keywordflow">if</span> (red - blue < dispersion) {
-<a name="l13203"></a>13203         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l13204"></a>13204         <span class="keywordflow">return</span> NULL;
-<a name="l13205"></a>13205     }
-<a name="l13206"></a>13206 
-<a name="l13207"></a>13207     nx = cpl_image_get_size_x(spectra);
-<a name="l13208"></a>13208     ny = cpl_image_get_size_y(spectra);
-<a name="l13209"></a>13209 
-<a name="l13210"></a>13210     calibration = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l13211"></a>13211     data = cpl_image_get_data(calibration);
-<a name="l13212"></a>13212 
-<a name="l13213"></a>13213     length  = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l13214"></a>13214     nslits  = cpl_table_get_nrow(slits);
-<a name="l13215"></a>13215     slit_id = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);
-<a name="l13216"></a>13216     order   = cpl_table_get_ncol(polytraces) - 2;
-<a name="l13217"></a>13217 
-<a name="l13218"></a>13218     <span class="comment">/*</span>
-<a name="l13219"></a>13219 <span class="comment">     * The spatial resampling is performed for a certain number of </span>
-<a name="l13220"></a>13220 <span class="comment">     * pixels above and below the position of the reference wavelength:</span>
-<a name="l13221"></a>13221 <span class="comment">     */</span>
-<a name="l13222"></a>13222 
-<a name="l13223"></a>13223     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;
-<a name="l13224"></a>13224     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;
-<a name="l13225"></a>13225 
-<a name="l13226"></a>13226     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l13227"></a>13227         
-<a name="l13228"></a>13228         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l13229"></a>13229             <span class="keywordflow">continue</span>;
-<a name="l13230"></a>13230 
-<a name="l13231"></a>13231         <span class="comment">/*</span>
-<a name="l13232"></a>13232 <span class="comment">         * Note that the x coordinate of the reference pixels on the CCD</span>
-<a name="l13233"></a>13233 <span class="comment">         * is taken arbitrarily at the top end of each slit. This wouldn't</span>
-<a name="l13234"></a>13234 <span class="comment">         * be entirely correct in case of curved slits, or in presence of</span>
-<a name="l13235"></a>13235 <span class="comment">         * heavy distortions: in such cases the spatial resampling is</span>
-<a name="l13236"></a>13236 <span class="comment">         * really performed across a wide range of wavelengths. But</span>
-<a name="l13237"></a>13237 <span class="comment">         * the lag between top and bottom spectral curvature models </span>
-<a name="l13238"></a>13238 <span class="comment">         * would introduce even in such cases negligible effects on</span>
-<a name="l13239"></a>13239 <span class="comment">         * the spectral spatial resampling.</span>
-<a name="l13240"></a>13240 <span class="comment">         */</span>
-<a name="l13241"></a>13241 
-<a name="l13242"></a>13242         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);
-<a name="l13243"></a>13243 
-<a name="l13244"></a>13244         start_pixel = refpixel - pixel_below;
-<a name="l13245"></a>13245         <span class="keywordflow">if</span> (start_pixel < 0)
-<a name="l13246"></a>13246             start_pixel = 0;
-<a name="l13247"></a>13247 
-<a name="l13248"></a>13248         end_pixel = refpixel + pixel_above;
-<a name="l13249"></a>13249         <span class="keywordflow">if</span> (end_pixel > nx)
-<a name="l13250"></a>13250             end_pixel = nx;
-<a name="l13251"></a>13251 
-<a name="l13252"></a>13252         <span class="comment">/*</span>
-<a name="l13253"></a>13253 <span class="comment">         * Recover from the table of spectral curvature coefficients</span>
-<a name="l13254"></a>13254 <span class="comment">         * the curvature polynomials.</span>
-<a name="l13255"></a>13255 <span class="comment">         */</span>
-<a name="l13256"></a>13256 
-<a name="l13257"></a>13257         missing_top = 0;
-<a name="l13258"></a>13258         polytop = cpl_polynomial_new(1);
-<a name="l13259"></a>13259         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l13260"></a>13260             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);
-<a name="l13261"></a>13261             <span class="keywordflow">if</span> (null) {
-<a name="l13262"></a>13262                 cpl_polynomial_delete(polytop);
-<a name="l13263"></a>13263                 missing_top = 1;
-<a name="l13264"></a>13264                 <span class="keywordflow">break</span>;
-<a name="l13265"></a>13265             }
-<a name="l13266"></a>13266             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l13267"></a>13267         }
-<a name="l13268"></a>13268 
-<a name="l13269"></a>13269         missing_bot = 0;
-<a name="l13270"></a>13270         polybot = cpl_polynomial_new(1);
-<a name="l13271"></a>13271         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {
-<a name="l13272"></a>13272             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);
-<a name="l13273"></a>13273             <span class="keywordflow">if</span> (null) {
-<a name="l13274"></a>13274                 cpl_polynomial_delete(polybot);
-<a name="l13275"></a>13275                 missing_bot = 1;
-<a name="l13276"></a>13276                 <span class="keywordflow">break</span>;
-<a name="l13277"></a>13277             }
-<a name="l13278"></a>13278             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l13279"></a>13279         }
-<a name="l13280"></a>13280 
-<a name="l13281"></a>13281         <span class="keywordflow">if</span> (missing_top && missing_bot) {
-<a name="l13282"></a>13282             cpl_msg_warning(func, <span class="stringliteral">"Spatial map, slit %d was not traced!"</span>, 
-<a name="l13283"></a>13283                             slit_id[i]);
-<a name="l13284"></a>13284             <span class="keywordflow">continue</span>;
-<a name="l13285"></a>13285         }
-<a name="l13286"></a>13286 
-<a name="l13287"></a>13287         <span class="comment">/*</span>
-<a name="l13288"></a>13288 <span class="comment">         * In case just one of the two edges was not traced, the other</span>
-<a name="l13289"></a>13289 <span class="comment">         * edge curvature model is duplicated and shifted to the other</span>
-<a name="l13290"></a>13290 <span class="comment">         * end of the slit: better than nothing!</span>
-<a name="l13291"></a>13291 <span class="comment">         */</span>
-<a name="l13292"></a>13292 
-<a name="l13293"></a>13293         <span class="keywordflow">if</span> (missing_top) {
-<a name="l13294"></a>13294             cpl_msg_warning(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span>
-<a name="l13295"></a>13295                             <span class="stringliteral">"the spectral curvature of the lower edge "</span>
-<a name="l13296"></a>13296                             <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l13297"></a>13297             polytop = cpl_polynomial_duplicate(polybot);
-<a name="l13298"></a>13298             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l13299"></a>13299             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l13300"></a>13300             k = 0;
-<a name="l13301"></a>13301             coeff = cpl_polynomial_get_coeff(polybot, &k);
-<a name="l13302"></a>13302             coeff += ytop - ybot;
-<a name="l13303"></a>13303             cpl_polynomial_set_coeff(polytop, &k, coeff);
-<a name="l13304"></a>13304         }
-<a name="l13305"></a>13305 
-<a name="l13306"></a>13306         <span class="keywordflow">if</span> (missing_bot) {
-<a name="l13307"></a>13307             cpl_msg_warning(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span>
-<a name="l13308"></a>13308                             <span class="stringliteral">"the spectral curvature of the upper edge "</span>
-<a name="l13309"></a>13309                             <span class="stringliteral">"is used instead."</span>, slit_id[i]);
-<a name="l13310"></a>13310             polybot = cpl_polynomial_duplicate(polytop);
-<a name="l13311"></a>13311             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);
-<a name="l13312"></a>13312             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);
-<a name="l13313"></a>13313             k = 0;
-<a name="l13314"></a>13314             coeff = cpl_polynomial_get_coeff(polytop, &k);
-<a name="l13315"></a>13315             coeff -= ytop - ybot;
-<a name="l13316"></a>13316             cpl_polynomial_set_coeff(polybot, &k, coeff);
-<a name="l13317"></a>13317         }
-<a name="l13318"></a>13318 
-<a name="l13319"></a>13319         top = cpl_polynomial_eval_1d(polytop, refpixel, NULL);
-<a name="l13320"></a>13320         bot = cpl_polynomial_eval_1d(polybot, refpixel, NULL);
-<a name="l13321"></a>13321         npseudo = ceil(top-bot) + 1;
-<a name="l13322"></a>13322 
-<a name="l13323"></a>13323         <span class="keywordflow">if</span> (npseudo < 1) {
-<a name="l13324"></a>13324             cpl_polynomial_delete(polytop);
-<a name="l13325"></a>13325             cpl_polynomial_delete(polybot);
-<a name="l13326"></a>13326             cpl_msg_warning(func, <span class="stringliteral">"Slit %d was badly traced: no extraction!"</span>,
-<a name="l13327"></a>13327                             slit_id[i]);
-<a name="l13328"></a>13328             <span class="keywordflow">continue</span>;
-<a name="l13329"></a>13329         }
-<a name="l13330"></a>13330 
-<a name="l13331"></a>13331         <span class="keywordflow">for</span> (j = start_pixel; j < end_pixel; j++) {
-<a name="l13332"></a>13332             top = cpl_polynomial_eval_1d(polytop, j, NULL);
-<a name="l13333"></a>13333             bot = cpl_polynomial_eval_1d(polybot, j, NULL);
-<a name="l13334"></a>13334             factor = (top-bot)/npseudo;
-<a name="l13335"></a>13335             <span class="keywordflow">for</span> (k = 0; k <= npseudo; k++) {
-<a name="l13336"></a>13336                 ypos = top - k*factor;
-<a name="l13337"></a>13337                 yint = ypos;
-<a name="l13338"></a>13338                 yfra = ypos - yint;
-<a name="l13339"></a>13339                 <span class="keywordflow">if</span> (yint >= 0 && yint < ny-1) {
-<a name="l13340"></a>13340                     data[j + nx*yint] = (top-yint)/factor;
-<a name="l13341"></a>13341                     <span class="keywordflow">if</span> (k) {
-<a name="l13342"></a>13342 
-<a name="l13343"></a>13343                         <span class="comment">/*</span>
-<a name="l13344"></a>13344 <span class="comment">                         * This is added to recover lost pixels on</span>
-<a name="l13345"></a>13345 <span class="comment">                         * the CCD image (pixels are lost because</span>
-<a name="l13346"></a>13346 <span class="comment">                         * the CCD pixels are less than npseudo+1).</span>
-<a name="l13347"></a>13347 <span class="comment">                         */</span>
-<a name="l13348"></a>13348 
-<a name="l13349"></a>13349                         <span class="keywordflow">if</span> (yprev - yint > 1) {
-<a name="l13350"></a>13350                             data[j + nx*(yint+1)] = (top-yint-1)/factor;
-<a name="l13351"></a>13351                         }
-<a name="l13352"></a>13352                     }
-<a name="l13353"></a>13353                 }
-<a name="l13354"></a>13354                 yprev = yint;
-<a name="l13355"></a>13355             }
-<a name="l13356"></a>13356         }
-<a name="l13357"></a>13357         cpl_polynomial_delete(polytop);
-<a name="l13358"></a>13358         cpl_polynomial_delete(polybot);
-<a name="l13359"></a>13359     }
-<a name="l13360"></a>13360 
-<a name="l13361"></a>13361     <span class="keywordflow">return</span> calibration;
-<a name="l13362"></a>13362 }
-<a name="l13363"></a>13363 
-<a name="l13364"></a>13364 
-<a name="l13427"></a><a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">13427</a> cpl_image *<a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(cpl_image *image, cpl_table *slits, <span class="keywordtype">int</span> margin,
-<a name="l13428"></a>13428                               <span class="keywordtype">int</span> maxradius, <span class="keywordtype">int</span> conradius)
-<a name="l13429"></a>13429 {
-<a name="l13430"></a>13430     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_detect_objects"</span>;
-<a name="l13431"></a>13431 
-<a name="l13432"></a>13432     cpl_image  *profile;
-<a name="l13433"></a>13433     <span class="keywordtype">float</span>      *pdata;
-<a name="l13434"></a>13434     <span class="keywordtype">float</span>      *p;
-<a name="l13435"></a>13435 
-<a name="l13436"></a>13436     <span class="keywordtype">char</span>        name[MAX_COLNAME];
-<a name="l13437"></a>13437 
-<a name="l13438"></a>13438     <span class="keywordtype">int</span>         nslits;
-<a name="l13439"></a>13439     <span class="keywordtype">int</span>         npeaks;
-<a name="l13440"></a>13440     <span class="keywordtype">int</span>         nobjects, objpos, totobj;
-<a name="l13441"></a>13441     <span class="keywordtype">int</span>         maxobjects;
-<a name="l13442"></a>13442     <span class="keywordtype">int</span>        *position;
-<a name="l13443"></a>13443     <span class="keywordtype">int</span>        *length;
-<a name="l13444"></a>13444     <span class="keywordtype">int</span>        *reject;
-<a name="l13445"></a>13445     <span class="keywordtype">double</span>     *place;
-<a name="l13446"></a>13446     <span class="keywordtype">double</span>     *bright;
-<a name="l13447"></a>13447     <span class="keywordtype">double</span>      mindistance;
-<a name="l13448"></a>13448     <span class="keywordtype">int</span>         pos, count;
-<a name="l13449"></a>13449     <span class="keywordtype">int</span>         up;
-<a name="l13450"></a>13450     <span class="keywordtype">int</span>         low, hig;
-<a name="l13451"></a>13451     <span class="keywordtype">int</span>         row;
-<a name="l13452"></a>13452     <span class="keywordtype">int</span>         i, j, k;
-<a name="l13453"></a>13453 
-<a name="l13454"></a>13454     <span class="keyword">const</span> <span class="keywordtype">int</span>   min_pixels = 10;
-<a name="l13455"></a>13455 
-<a name="l13456"></a>13456     
-<a name="l13457"></a>13457     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l13458"></a>13458         <span class="keywordflow">return</span> NULL;
-<a name="l13459"></a>13459  
-<a name="l13460"></a>13460     <span class="keywordflow">if</span> (image == NULL || slits == NULL) { 
-<a name="l13461"></a>13461         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l13462"></a>13462         <span class="keywordflow">return</span> NULL;
-<a name="l13463"></a>13463     }
-<a name="l13464"></a>13464 
-<a name="l13465"></a>13465     <span class="keywordflow">if</span> (margin < 0)
-<a name="l13466"></a>13466         margin = 0;
-<a name="l13467"></a>13467 
-<a name="l13468"></a>13468     <span class="keywordflow">if</span> (maxradius < 0) {
-<a name="l13469"></a>13469         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l13470"></a>13470         <span class="keywordflow">return</span> NULL;
-<a name="l13471"></a>13471     }
-<a name="l13472"></a>13472 
-<a name="l13473"></a>13473     <span class="keywordflow">if</span> (conradius < 0) {
-<a name="l13474"></a>13474         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l13475"></a>13475         <span class="keywordflow">return</span> NULL;
-<a name="l13476"></a>13476     }
-<a name="l13477"></a>13477 
-<a name="l13478"></a>13478     nslits   = cpl_table_get_nrow(slits);
-<a name="l13479"></a>13479     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);
-<a name="l13480"></a>13480     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);
-<a name="l13481"></a>13481 
-<a name="l13482"></a>13482     profile = cpl_image_collapse_create(image, 1);
-<a name="l13483"></a>13483     cpl_image_divide_scalar(profile, cpl_image_get_size_x(image));
-<a name="l13484"></a>13484     pdata = cpl_image_get_data(profile);
-<a name="l13485"></a>13485 
-<a name="l13486"></a>13486     row = 1;
-<a name="l13487"></a>13487     maxobjects = 0;
-<a name="l13488"></a>13488     totobj = 0;
-<a name="l13489"></a>13489     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l13490"></a>13490 
-<a name="l13491"></a>13491         <span class="keywordflow">if</span> (length[i] == 0)
-<a name="l13492"></a>13492             <span class="keywordflow">continue</span>;
-<a name="l13493"></a>13493 
-<a name="l13494"></a>13494         pos = position[i] + margin;
-<a name="l13495"></a>13495         count = length[i] - 2*margin;
-<a name="l13496"></a>13496 
-<a name="l13497"></a>13497         <span class="keywordflow">if</span> (count < min_pixels)
-<a name="l13498"></a>13498             <span class="keywordflow">continue</span>;
-<a name="l13499"></a>13499 
-<a name="l13500"></a>13500         p = pdata + pos;
-<a name="l13501"></a>13501 
-<a name="l13502"></a>13502 
-<a name="l13503"></a>13503         <span class="comment">/*</span>
-<a name="l13504"></a>13504 <span class="comment">         * Count peaks candidates</span>
-<a name="l13505"></a>13505 <span class="comment">         */</span>
-<a name="l13506"></a>13506 
-<a name="l13507"></a>13507         npeaks = 0;
-<a name="l13508"></a>13508         <span class="keywordflow">if</span> (p[0] > p[1] && p[1] > p[2] && p[2] > p[3] && p[3] > 0) {
-<a name="l13509"></a>13509             npeaks++;
-<a name="l13510"></a>13510         }
-<a name="l13511"></a>13511 
-<a name="l13512"></a>13512         up = 0;
-<a name="l13513"></a>13513         <span class="keywordflow">for</span> (j = 0; j < count - 3; j++) {
-<a name="l13514"></a>13514             <span class="keywordflow">if</span> (p[j] > 0) {
-<a name="l13515"></a>13515                 <span class="keywordflow">if</span> (p[j+1] > p[j]) {
-<a name="l13516"></a>13516                     up++;
-<a name="l13517"></a>13517                 }
-<a name="l13518"></a>13518                 <span class="keywordflow">else</span> {
-<a name="l13519"></a>13519                     <span class="keywordflow">if</span> (up > 2) {
-<a name="l13520"></a>13520                         <span class="keywordflow">if</span> (p[j+1] > p[j+2] && p[j+2] > 0) {
-<a name="l13521"></a>13521                             <span class="keywordflow">if</span> (p[j] > 5)
-<a name="l13522"></a>13522                                 npeaks++;
-<a name="l13523"></a>13523                         }
-<a name="l13524"></a>13524                     }
-<a name="l13525"></a>13525                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (up > 1) {
-<a name="l13526"></a>13526                         <span class="keywordflow">if</span> (p[j+1] > p[j+2] && p[j+2] > p[j+3] && p[j+3] > 0) {
-<a name="l13527"></a>13527                             <span class="keywordflow">if</span> (p[j] > 5)
-<a name="l13528"></a>13528                                 npeaks++;
-<a name="l13529"></a>13529                         }
-<a name="l13530"></a>13530                     }
-<a name="l13531"></a>13531                     up = 0;
-<a name="l13532"></a>13532                 }
-<a name="l13533"></a>13533             }
-<a name="l13534"></a>13534             <span class="keywordflow">else</span> {
-<a name="l13535"></a>13535                 up = 0;
-<a name="l13536"></a>13536             }
-<a name="l13537"></a>13537         }
-<a name="l13538"></a>13538 
-<a name="l13539"></a>13539         <span class="keywordflow">if</span> (p[count-1] > p[count-2] && p[count-2] > p[count-3] 
-<a name="l13540"></a>13540             && p[count-3] > p[count-4] && p[count-4] > 0) {
-<a name="l13541"></a>13541             npeaks++;
-<a name="l13542"></a>13542         }
-<a name="l13543"></a>13543 
-<a name="l13544"></a>13544         <span class="keywordflow">if</span> (npeaks == 0)
-<a name="l13545"></a>13545             <span class="keywordflow">continue</span>;
-<a name="l13546"></a>13546 
-<a name="l13547"></a>13547 
-<a name="l13548"></a>13548         <span class="comment">/*</span>
-<a name="l13549"></a>13549 <span class="comment">         * Get candidates parameters</span>
-<a name="l13550"></a>13550 <span class="comment">         */</span>
-<a name="l13551"></a>13551 
-<a name="l13552"></a>13552         reject = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l13553"></a>13553         bright = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l13554"></a>13554         place  = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l13555"></a>13555 
-<a name="l13556"></a>13556         npeaks = 0;
-<a name="l13557"></a>13557         <span class="keywordflow">if</span> (p[0] > p[1] && p[1] > p[2] && p[2] > p[3] && p[3] > 0) {
-<a name="l13558"></a>13558             bright[0] = p[0];
-<a name="l13559"></a>13559             place[0] = position[i] + margin;
-<a name="l13560"></a>13560             npeaks++;
-<a name="l13561"></a>13561         }
-<a name="l13562"></a>13562 
-<a name="l13563"></a>13563         up = 0;
-<a name="l13564"></a>13564         <span class="keywordflow">for</span> (j = 0; j < count - 3; j++) {
-<a name="l13565"></a>13565             <span class="keywordflow">if</span> (p[j] > 0) {
-<a name="l13566"></a>13566                 <span class="keywordflow">if</span> (p[j+1] > p[j]) {
-<a name="l13567"></a>13567                     up++;
-<a name="l13568"></a>13568                 }
-<a name="l13569"></a>13569                 <span class="keywordflow">else</span> {
-<a name="l13570"></a>13570                     <span class="keywordflow">if</span> (up > 2) {
-<a name="l13571"></a>13571                         <span class="keywordflow">if</span> (p[j+1] > p[j+2] && p[j+2] > 0) {
-<a name="l13572"></a>13572                             <span class="keywordflow">if</span> (p[j] > 5) {
-<a name="l13573"></a>13573                                 bright[npeaks] = p[j];
-<a name="l13574"></a>13574                                 place[npeaks] = position[i] + margin + j + 1
-<a name="l13575"></a>13575                                        + <a class="code" href="group__moses.html#g31da70ff15f996bd4022c26b534c88eb">values_to_dx</a>(p[j-1], p[j], p[j+1]);
-<a name="l13576"></a>13576                                 npeaks++;
-<a name="l13577"></a>13577                             }
-<a name="l13578"></a>13578                         }
-<a name="l13579"></a>13579                     }
-<a name="l13580"></a>13580                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (up > 1) {
-<a name="l13581"></a>13581                         <span class="keywordflow">if</span> (p[j+1] > p[j+2] && p[j+2] > p[j+3] && p[j+3] > 0) {
-<a name="l13582"></a>13582                             <span class="keywordflow">if</span> (p[j] > 5) {
-<a name="l13583"></a>13583                                 bright[npeaks] = p[j];
-<a name="l13584"></a>13584                                 place[npeaks] = position[i] + margin + j + 1
-<a name="l13585"></a>13585                                        + <a class="code" href="group__moses.html#g31da70ff15f996bd4022c26b534c88eb">values_to_dx</a>(p[j-1], p[j], p[j+1]);
-<a name="l13586"></a>13586                                 npeaks++;
-<a name="l13587"></a>13587                             }
-<a name="l13588"></a>13588                         }
-<a name="l13589"></a>13589                     }
-<a name="l13590"></a>13590                     up = 0;
-<a name="l13591"></a>13591                 }
-<a name="l13592"></a>13592             }
-<a name="l13593"></a>13593             <span class="keywordflow">else</span> {
-<a name="l13594"></a>13594                 up = 0;
-<a name="l13595"></a>13595             }
-<a name="l13596"></a>13596         }
-<a name="l13597"></a>13597 
-<a name="l13598"></a>13598         <span class="keywordflow">if</span> (p[count-1] > p[count-2] && p[count-2] > p[count-3]
-<a name="l13599"></a>13599             && p[count-3] > p[count-4] && p[count-4] > 0) {
-<a name="l13600"></a>13600             bright[npeaks] = p[count-1];
-<a name="l13601"></a>13601             place[npeaks] = position[i] + count;
-<a name="l13602"></a>13602             npeaks++;
-<a name="l13603"></a>13603         }
-<a name="l13604"></a>13604 
-<a name="l13605"></a>13605 
-<a name="l13606"></a>13606         <span class="comment">/*</span>
-<a name="l13607"></a>13607 <span class="comment">         * Now select the uncontaminated peaks</span>
-<a name="l13608"></a>13608 <span class="comment">         */</span>
-<a name="l13609"></a>13609 
-<a name="l13610"></a>13610         <span class="keywordflow">if</span> (fabs(place[0] - pos) < 1.0)
-<a name="l13611"></a>13611             reject[0] = 1;
-<a name="l13612"></a>13612         <span class="keywordflow">if</span> (fabs(place[npeaks-1] - pos - count) < 1.0)
-<a name="l13613"></a>13613             reject[npeaks-1] = 1;
-<a name="l13614"></a>13614         <span class="keywordflow">for</span> (j = 0; j < npeaks; j++) {
-<a name="l13615"></a>13615             <span class="keywordflow">for</span> (k = 0; k < npeaks; k++) {
-<a name="l13616"></a>13616                 <span class="keywordflow">if</span> (k == j)
-<a name="l13617"></a>13617                     <span class="keywordflow">continue</span>;
-<a name="l13618"></a>13618                 mindistance = conradius * bright[k] / bright[j] 
-<a name="l13619"></a>13619                                         * bright[k] / bright[j];
-<a name="l13620"></a>13620                 <span class="keywordflow">if</span> (fabs(place[j] - place[k]) < mindistance)
-<a name="l13621"></a>13621                     reject[j] = 1;
-<a name="l13622"></a>13622             }
-<a name="l13623"></a>13623         }
-<a name="l13624"></a>13624 
-<a name="l13625"></a>13625 <span class="comment">/* new part */</span>
-<a name="l13626"></a>13626         <span class="keywordflow">for</span> (j = 0; j < npeaks; j++) {
-<a name="l13627"></a>13627             <span class="keywordflow">if</span> (reject[j])
-<a name="l13628"></a>13628                 <span class="keywordflow">continue</span>;
-<a name="l13629"></a>13629             <span class="keywordflow">if</span> (j) {
-<a name="l13630"></a>13630                 low = (place[j-1]*bright[j] + place[j]*bright[j-1])
-<a name="l13631"></a>13631                     / (bright[j-1] + bright[j]) + 1;
-<a name="l13632"></a>13632             }
-<a name="l13633"></a>13633             <span class="keywordflow">else</span> {
-<a name="l13634"></a>13634                 low = pos;
-<a name="l13635"></a>13635             }
-<a name="l13636"></a>13636             <span class="keywordflow">if</span> (j < npeaks - 1) {
-<a name="l13637"></a>13637                 hig = (place[j+1]*bright[j] + place[j]*bright[j+1])
-<a name="l13638"></a>13638                     / (bright[j+1] + bright[j]) + 1;
-<a name="l13639"></a>13639             }
-<a name="l13640"></a>13640             <span class="keywordflow">else</span> {
-<a name="l13641"></a>13641                 hig = pos + count;
-<a name="l13642"></a>13642             }
-<a name="l13643"></a>13643 
-<a name="l13644"></a>13644             <span class="keywordflow">if</span> (low < pos)
-<a name="l13645"></a>13645                 low = pos;
-<a name="l13646"></a>13646             <span class="keywordflow">if</span> (hig > pos + count)
-<a name="l13647"></a>13647                 hig = pos + count;
-<a name="l13648"></a>13648             <span class="keywordflow">if</span> (place[j] - low > maxradius)
-<a name="l13649"></a>13649                 low = place[j] - maxradius;
-<a name="l13650"></a>13650             <span class="keywordflow">if</span> (hig - place[j] > maxradius)
-<a name="l13651"></a>13651                 hig = place[j] + maxradius;
-<a name="l13652"></a>13652             <span class="keywordflow">if</span> (hig == low)
-<a name="l13653"></a>13653                 reject[j] = 1;
-<a name="l13654"></a>13654         }
-<a name="l13655"></a>13655 <span class="comment">/* end new part */</span>
-<a name="l13656"></a>13656 
-<a name="l13657"></a>13657         nobjects = npeaks;
-<a name="l13658"></a>13658         <span class="keywordflow">for</span> (j = 0; j < npeaks; j++)
-<a name="l13659"></a>13659             <span class="keywordflow">if</span> (reject[j])
-<a name="l13660"></a>13660                 nobjects--;
-<a name="l13661"></a>13661 
-<a name="l13662"></a>13662         <span class="keywordflow">for</span> (j = 0; j < nobjects; j++) {
-<a name="l13663"></a>13663             snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, j+1);
-<a name="l13664"></a>13664             <span class="keywordflow">if</span> (cpl_table_has_column(slits, name))
-<a name="l13665"></a>13665                 <span class="keywordflow">continue</span>;
-<a name="l13666"></a>13666             cpl_table_new_column(slits, name, CPL_TYPE_DOUBLE);
-<a name="l13667"></a>13667             snprintf(name, MAX_COLNAME, <span class="stringliteral">"start_%d"</span>, j+1);
-<a name="l13668"></a>13668             cpl_table_new_column(slits, name, CPL_TYPE_INT);
-<a name="l13669"></a>13669             cpl_table_set_column_unit(slits, name, <span class="stringliteral">"pixel"</span>);
-<a name="l13670"></a>13670             snprintf(name, MAX_COLNAME, <span class="stringliteral">"end_%d"</span>, j+1);
-<a name="l13671"></a>13671             cpl_table_new_column(slits, name, CPL_TYPE_INT);
-<a name="l13672"></a>13672             cpl_table_set_column_unit(slits, name, <span class="stringliteral">"pixel"</span>);
-<a name="l13673"></a>13673             snprintf(name, MAX_COLNAME, <span class="stringliteral">"row_%d"</span>, j+1);
-<a name="l13674"></a>13674             cpl_table_new_column(slits, name, CPL_TYPE_INT);
-<a name="l13675"></a>13675             cpl_table_set_column_unit(slits, name, <span class="stringliteral">"pixel"</span>);
-<a name="l13676"></a>13676         }
-<a name="l13677"></a>13677 
-<a name="l13678"></a>13678         objpos = nobjects;
-<a name="l13679"></a>13679         <span class="keywordflow">for</span> (j = 0; j < npeaks; j++) {
-<a name="l13680"></a>13680             <span class="keywordflow">if</span> (reject[j])
-<a name="l13681"></a>13681                 <span class="keywordflow">continue</span>;
-<a name="l13682"></a>13682             <span class="keywordflow">if</span> (j) {
-<a name="l13683"></a>13683                 low = (place[j-1]*bright[j] + place[j]*bright[j-1])
-<a name="l13684"></a>13684                     / (bright[j-1] + bright[j]) + 1;
-<a name="l13685"></a>13685             }
-<a name="l13686"></a>13686             <span class="keywordflow">else</span> {
-<a name="l13687"></a>13687                low = pos;
-<a name="l13688"></a>13688             }
-<a name="l13689"></a>13689             <span class="keywordflow">if</span> (j < npeaks - 1) {
-<a name="l13690"></a>13690                 hig = (place[j+1]*bright[j] + place[j]*bright[j+1])
-<a name="l13691"></a>13691                     / (bright[j+1] + bright[j]) + 1;
-<a name="l13692"></a>13692             }
-<a name="l13693"></a>13693             <span class="keywordflow">else</span> {
-<a name="l13694"></a>13694                 hig = pos + count;
-<a name="l13695"></a>13695             }
-<a name="l13696"></a>13696 
-<a name="l13697"></a>13697             <span class="keywordflow">if</span> (low < pos)
-<a name="l13698"></a>13698                 low = pos;
-<a name="l13699"></a>13699             <span class="keywordflow">if</span> (hig > pos + count)
-<a name="l13700"></a>13700                 hig = pos + count;
-<a name="l13701"></a>13701             <span class="keywordflow">if</span> (place[j] - low > maxradius)
-<a name="l13702"></a>13702                 low = place[j] - maxradius;
-<a name="l13703"></a>13703             <span class="keywordflow">if</span> (hig - place[j] > maxradius)
-<a name="l13704"></a>13704                 hig = place[j] + maxradius;
-<a name="l13705"></a>13705 
-<a name="l13706"></a>13706             snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, objpos);
-<a name="l13707"></a>13707             cpl_table_set_double(slits, name, i, place[j]);
-<a name="l13708"></a>13708             snprintf(name, MAX_COLNAME, <span class="stringliteral">"start_%d"</span>, objpos);
-<a name="l13709"></a>13709             cpl_table_set_int(slits, name, i, low);
-<a name="l13710"></a>13710             snprintf(name, MAX_COLNAME, <span class="stringliteral">"end_%d"</span>, objpos);
-<a name="l13711"></a>13711             cpl_table_set_int(slits, name, i, hig);
-<a name="l13712"></a>13712             snprintf(name, MAX_COLNAME, <span class="stringliteral">"row_%d"</span>, objpos);
-<a name="l13713"></a>13713             cpl_table_set_int(slits, name, i, row + objpos - 1);
-<a name="l13714"></a>13714             totobj++;
-<a name="l13715"></a>13715             objpos--;
-<a name="l13716"></a>13716         }
-<a name="l13717"></a>13717 
-<a name="l13718"></a>13718         row += nobjects;
-<a name="l13719"></a>13719 
-<a name="l13720"></a>13720         <span class="keywordflow">if</span> (maxobjects < nobjects)
-<a name="l13721"></a>13721             maxobjects = nobjects;
-<a name="l13722"></a>13722 
-<a name="l13723"></a>13723         cpl_free(reject);
-<a name="l13724"></a>13724         cpl_free(bright);
-<a name="l13725"></a>13725         cpl_free(place);
-<a name="l13726"></a>13726 
-<a name="l13727"></a>13727     }
-<a name="l13728"></a>13728 
-<a name="l13729"></a>13729 <span class="comment">/*    nobjects = row - nobjects;     A bug, I think... */</span>
-<a name="l13730"></a>13730     row = cpl_table_get_nrow(slits);
-<a name="l13731"></a>13731 
-<a name="l13732"></a>13732     <span class="keywordflow">for</span> (i = 0; i < row; i++) {
-<a name="l13733"></a>13733         <span class="keywordflow">for</span> (j = 0; j < maxobjects; j++) {
-<a name="l13734"></a>13734             snprintf(name, MAX_COLNAME, <span class="stringliteral">"row_%d"</span>, j+1);
-<a name="l13735"></a>13735             <span class="keywordflow">if</span> (cpl_table_is_valid(slits, name, i))
-<a name="l13736"></a>13736                 cpl_table_set_int(slits, name, i, totobj -
-<a name="l13737"></a>13737                                   cpl_table_get_int(slits, name, i, NULL));
-<a name="l13738"></a>13738         }
-<a name="l13739"></a>13739     }
-<a name="l13740"></a>13740 
-<a name="l13741"></a>13741     <span class="keywordflow">for</span> (i = 0; i < maxobjects; i++) {
-<a name="l13742"></a>13742         snprintf(name, MAX_COLNAME, <span class="stringliteral">"start_%d"</span>, i+1);
-<a name="l13743"></a>13743         cpl_table_fill_invalid_int(slits, name, -1);
-<a name="l13744"></a>13744         snprintf(name, MAX_COLNAME, <span class="stringliteral">"end_%d"</span>, i+1);
-<a name="l13745"></a>13745         cpl_table_fill_invalid_int(slits, name, -1);
-<a name="l13746"></a>13746         snprintf(name, MAX_COLNAME, <span class="stringliteral">"row_%d"</span>, i+1);
-<a name="l13747"></a>13747         cpl_table_fill_invalid_int(slits, name, -1);
-<a name="l13748"></a>13748     }
-<a name="l13749"></a>13749 
-<a name="l13750"></a>13750     <span class="keywordflow">return</span> profile;
-<a name="l13751"></a>13751 }
-<a name="l13752"></a>13752 
-<a name="l13753"></a>13753 
-<a name="l13778"></a><a class="code" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">13778</a> cpl_image **<a class="code" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">mos_extract_objects</a>(cpl_image *science, cpl_image *sky,
-<a name="l13779"></a>13779                                 cpl_table *objects, <span class="keywordtype">int</span> extraction, <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>,
-<a name="l13780"></a>13780                                 <span class="keywordtype">double</span> gain, <span class="keywordtype">int</span> ncombined)
-<a name="l13781"></a>13781 {
-<a name="l13782"></a>13782     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_extract_objects"</span>;
-<a name="l13783"></a>13783 
-<a name="l13784"></a>13784     <span class="keywordtype">char</span>        name[MAX_COLNAME];
-<a name="l13785"></a>13785 
-<a name="l13786"></a>13786     cpl_image **output;
-<a name="l13787"></a>13787     cpl_image  *extracted;
-<a name="l13788"></a>13788     cpl_image  *extr_sky;
-<a name="l13789"></a>13789     cpl_image  *error;
-<a name="l13790"></a>13790     cpl_image  *sciwin;
-<a name="l13791"></a>13791     cpl_image  *skywin;
-<a name="l13792"></a>13792     <span class="keywordtype">int</span>         nslits;
-<a name="l13793"></a>13793     <span class="keywordtype">int</span>         nobjects;
-<a name="l13794"></a>13794     <span class="keywordtype">int</span>         maxobjects;
-<a name="l13795"></a>13795     <span class="keywordtype">int</span>         nx, ny;
-<a name="l13796"></a>13796     <span class="keywordtype">int</span>         ylow, yhig;
-<a name="l13797"></a>13797     <span class="keywordtype">int</span>         i, j;
-<a name="l13798"></a>13798 
-<a name="l13799"></a>13799 
-<a name="l13800"></a>13800     <span class="keywordflow">if</span> (science == NULL || sky == NULL) {
-<a name="l13801"></a>13801         cpl_msg_error(func, <span class="stringliteral">"Both scientific exposures are required in input"</span>);
-<a name="l13802"></a>13802         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l13803"></a>13803         <span class="keywordflow">return</span> NULL;
-<a name="l13804"></a>13804     }
-<a name="l13805"></a>13805 
-<a name="l13806"></a>13806     <span class="keywordflow">if</span> (objects == NULL) {
-<a name="l13807"></a>13807         cpl_msg_error(func, <span class="stringliteral">"An object table is required in input"</span>);
-<a name="l13808"></a>13808         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l13809"></a>13809         <span class="keywordflow">return</span> NULL;
-<a name="l13810"></a>13810     }
-<a name="l13811"></a>13811 
-<a name="l13812"></a>13812     <span class="keywordflow">if</span> (extraction < 0 || extraction > 1) {
-<a name="l13813"></a>13813         cpl_msg_error(func, <span class="stringliteral">"Invalid extraction mode (%d): it should be "</span>
-<a name="l13814"></a>13814                       <span class="stringliteral">"either 0 or 1"</span>, extraction); 
-<a name="l13815"></a>13815         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l13816"></a>13816         <span class="keywordflow">return</span> NULL;
-<a name="l13817"></a>13817     }
-<a name="l13818"></a>13818 
-<a name="l13819"></a>13819     <span class="keywordflow">if</span> (ron < 0.0) {
-<a name="l13820"></a>13820         cpl_msg_error(func, <span class="stringliteral">"Invalid read-out-noise (%f ADU)"</span>, ron);
-<a name="l13821"></a>13821         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l13822"></a>13822         <span class="keywordflow">return</span> NULL;
-<a name="l13823"></a>13823     }
-<a name="l13824"></a>13824 
-<a name="l13825"></a>13825     <span class="keywordflow">if</span> (gain < 0.1) {
-<a name="l13826"></a>13826         cpl_msg_error(func, <span class="stringliteral">"Invalid gain factor (%f e-/ADU)"</span>, gain);
-<a name="l13827"></a>13827         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l13828"></a>13828         <span class="keywordflow">return</span> NULL;
-<a name="l13829"></a>13829     }
-<a name="l13830"></a>13830 
-<a name="l13831"></a>13831     <span class="keywordflow">if</span> (ncombined < 1) {
-<a name="l13832"></a>13832         cpl_msg_error(func, <span class="stringliteral">"Invalid number of combined frames (%d): "</span>
-<a name="l13833"></a>13833                       <span class="stringliteral">"it should be at least 1"</span>, ncombined);
-<a name="l13834"></a>13834         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l13835"></a>13835         <span class="keywordflow">return</span> NULL;
-<a name="l13836"></a>13836     }
-<a name="l13837"></a>13837 
-<a name="l13838"></a>13838 
-<a name="l13839"></a>13839     <span class="comment">/*</span>
-<a name="l13840"></a>13840 <span class="comment">     * Count the max number of objects per slit. Note that maxobjects </span>
-<a name="l13841"></a>13841 <span class="comment">     * is intentionally the max number of objects increased by one.</span>
-<a name="l13842"></a>13842 <span class="comment">     */</span>
-<a name="l13843"></a>13843 
-<a name="l13844"></a>13844     maxobjects = 1;
-<a name="l13845"></a>13845     snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, maxobjects);
-<a name="l13846"></a>13846     <span class="keywordflow">while</span> (cpl_table_has_column(objects, name)) {
-<a name="l13847"></a>13847         maxobjects++;
-<a name="l13848"></a>13848         snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, maxobjects);
-<a name="l13849"></a>13849     }
-<a name="l13850"></a>13850 
-<a name="l13851"></a>13851 
-<a name="l13852"></a>13852     <span class="comment">/*</span>
-<a name="l13853"></a>13853 <span class="comment">     * Count objects to extract</span>
-<a name="l13854"></a>13854 <span class="comment">     */</span>
-<a name="l13855"></a>13855 
-<a name="l13856"></a>13856     nobjects = 0;
-<a name="l13857"></a>13857     nslits = cpl_table_get_nrow(objects);
-<a name="l13858"></a>13858 
-<a name="l13859"></a>13859     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l13860"></a>13860         <span class="keywordflow">for</span> (j = 1; j < maxobjects; j++) {
-<a name="l13861"></a>13861             snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, j);
-<a name="l13862"></a>13862             <span class="keywordflow">if</span> (cpl_table_is_valid(objects, name, i))
-<a name="l13863"></a>13863                 nobjects++;
-<a name="l13864"></a>13864         }
-<a name="l13865"></a>13865     }
-<a name="l13866"></a>13866 
-<a name="l13867"></a>13867     <span class="keywordflow">if</span> (nobjects == 0)
-<a name="l13868"></a>13868         <span class="keywordflow">return</span> NULL;
-<a name="l13869"></a>13869 
-<a name="l13870"></a>13870     nx = cpl_image_get_size_x(science);
-<a name="l13871"></a>13871     ny = cpl_image_get_size_x(science);
-<a name="l13872"></a>13872 
-<a name="l13873"></a>13873     output = cpl_calloc(3, <span class="keyword">sizeof</span>(cpl_image *));
-<a name="l13874"></a>13874     extracted = output[0] = cpl_image_new(nx, nobjects, CPL_TYPE_FLOAT);
-<a name="l13875"></a>13875     extr_sky  = output[1] = cpl_image_new(nx, nobjects, CPL_TYPE_FLOAT);
-<a name="l13876"></a>13876     error     = output[2] = cpl_image_new(nx, nobjects, CPL_TYPE_FLOAT);
-<a name="l13877"></a>13877 
-<a name="l13878"></a>13878 
-<a name="l13879"></a>13879     <span class="comment">/*</span>
-<a name="l13880"></a>13880 <span class="comment">     * Extract objects</span>
-<a name="l13881"></a>13881 <span class="comment">     */</span>
-<a name="l13882"></a>13882 
-<a name="l13883"></a>13883     nobjects = 0;
-<a name="l13884"></a>13884     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l13885"></a>13885         <span class="keywordflow">for</span> (j = 1; j < maxobjects; j++) {
-<a name="l13886"></a>13886             snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, j);
-<a name="l13887"></a>13887             <span class="keywordflow">if</span> (cpl_table_is_valid(objects, name, i)) {
-<a name="l13888"></a>13888                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"start_%d"</span>, j);
-<a name="l13889"></a>13889                 ylow = cpl_table_get_int(objects, name, i, NULL);
-<a name="l13890"></a>13890                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"end_%d"</span>, j);
-<a name="l13891"></a>13891                 yhig = cpl_table_get_int(objects, name, i, NULL);
-<a name="l13892"></a>13892                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"row_%d"</span>, j);
-<a name="l13893"></a>13893                 nobjects = cpl_table_get_int(objects, name, i, NULL);
-<a name="l13894"></a>13894                 sciwin = cpl_image_extract(science, 1, ylow+1, nx, yhig);
-<a name="l13895"></a>13895                 skywin = cpl_image_extract(sky, 1, ylow+1, nx, yhig);
-<a name="l13896"></a>13896 <span class="comment">/*</span>
-<a name="l13897"></a>13897 <span class="comment"> * Cleaning the cosmics locally was really NOT a good idea...</span>
-<a name="l13898"></a>13898 <span class="comment"> * I leave it here, commented out, to never forget this mistake!</span>
-<a name="l13899"></a>13899 <span class="comment"></span>
-<a name="l13900"></a>13900 <span class="comment">                if (extraction) {</span>
-<a name="l13901"></a>13901 <span class="comment">                    mos_clean_cosmics(sciwin, gain, -1., -1.);</span>
-<a name="l13902"></a>13902 <span class="comment">                }</span>
-<a name="l13903"></a>13903 <span class="comment"> */</span>
-<a name="l13904"></a>13904                 <a class="code" href="group__moses.html#g4e645e1d3c927b1cec138cf857554485">mos_extraction</a>(sciwin, skywin, extracted, extr_sky, error, 
-<a name="l13905"></a>13905                                nobjects, extraction, ron, gain, ncombined);
-<a name="l13906"></a>13906 
-<a name="l13907"></a>13907                 <span class="comment">/*</span>
-<a name="l13908"></a>13908 <span class="comment">                 * Hidden check whether the spectrum was saturated or not</span>
-<a name="l13909"></a>13909 <span class="comment">                 */</span>
-<a name="l13910"></a>13910 
-<a name="l13911"></a>13911                 {
-<a name="l13912"></a>13912                     cpl_image *total = cpl_image_add_create(sciwin, skywin);
-<a name="l13913"></a>13913                     <span class="keywordtype">float</span>     *data  = cpl_image_get_data_float(total);
-<a name="l13914"></a>13914                     <span class="keywordtype">int</span>        <a class="code" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a>  = cpl_image_get_size_x(total)
-<a name="l13915"></a>13915                                      * cpl_image_get_size_y(total);
-<a name="l13916"></a>13916                     <span class="keywordtype">int</span>        k;
-<a name="l13917"></a>13917                     <span class="keywordtype">char</span>      *saturation_level = getenv(<span class="stringliteral">"SATURATION_LEVEL"</span>);
-<a name="l13918"></a>13918                     <span class="keywordtype">float</span>      saturation = 62000.0;
-<a name="l13919"></a>13919                     <span class="keywordtype">char</span>      *max_saturated = getenv(<span class="stringliteral">"MAX_SATURATED"</span>);
-<a name="l13920"></a>13920                     <span class="keywordtype">int</span>        max_satur = 10;
-<a name="l13921"></a>13921                     <span class="keywordtype">int</span>        saturated;
-<a name="l13922"></a>13922 
-<a name="l13923"></a>13923                     <span class="keywordflow">if</span> (saturation_level)
-<a name="l13924"></a>13924                         saturation = atof(saturation_level);
-<a name="l13925"></a>13925 
-<a name="l13926"></a>13926                     <span class="keywordflow">if</span> (max_saturated)
-<a name="l13927"></a>13927                         max_satur = atoi(max_saturated);
-<a name="l13928"></a>13928 
-<a name="l13929"></a>13929                     saturated = 0;
-<a name="l13930"></a>13930                     <span class="keywordflow">for</span> (k = 0; k < size; k++) {
-<a name="l13931"></a>13931                         <span class="keywordflow">if</span> (data[k] > saturation) {
-<a name="l13932"></a>13932                             saturated++;
-<a name="l13933"></a>13933                             <span class="keywordflow">if</span> (saturated > max_satur) {
-<a name="l13934"></a>13934                                 <span class="keywordflow">break</span>;
-<a name="l13935"></a>13935                             }
-<a name="l13936"></a>13936                         }
-<a name="l13937"></a>13937                     }
-<a name="l13938"></a>13938 
-<a name="l13939"></a>13939                     <span class="keywordflow">if</span> (saturated > max_satur)
-<a name="l13940"></a>13940                         saturated = 1;
-<a name="l13941"></a>13941                     <span class="keywordflow">else</span>
-<a name="l13942"></a>13942                         saturated = 0;
-<a name="l13943"></a>13943 
-<a name="l13944"></a>13944                     data = cpl_image_get_data(extracted);
-<a name="l13945"></a>13945                     data[nobjects * nx] = saturated;
-<a name="l13946"></a>13946                 }
-<a name="l13947"></a>13947 
-<a name="l13948"></a>13948                 cpl_image_delete(sciwin);
-<a name="l13949"></a>13949                 cpl_image_delete(skywin);
-<a name="l13950"></a>13950                 nobjects++;
-<a name="l13951"></a>13951             }
-<a name="l13952"></a>13952         }
-<a name="l13953"></a>13953     }
-<a name="l13954"></a>13954 
-<a name="l13955"></a>13955     <span class="keywordflow">return</span> output;
-<a name="l13956"></a>13956 
-<a name="l13957"></a>13957 }
-<a name="l13958"></a>13958 
-<a name="l13959"></a>13959 
-<a name="l13982"></a><a class="code" href="group__moses.html#g9dab2e2448ef188d7f8fddd02483d919">13982</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g9dab2e2448ef188d7f8fddd02483d919">mos_spectral_resolution</a>(cpl_image *image, <span class="keywordtype">double</span> lambda, <span class="keywordtype">double</span> startwave, 
-<a name="l13983"></a>13983                             <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> saturation, 
-<a name="l13984"></a>13984                             <span class="keywordtype">double</span> *mfwhm, <span class="keywordtype">double</span> *rmsfwhm,
-<a name="l13985"></a>13985                             <span class="keywordtype">double</span> *resolution, <span class="keywordtype">double</span> *rmsres, <span class="keywordtype">int</span> *nlines)
-<a name="l13986"></a>13986 {
-<a name="l13987"></a>13987     cpl_vector *vector;
-<a name="l13988"></a>13988 
-<a name="l13989"></a>13989     <span class="keywordtype">int</span>     i, j, n, m;
-<a name="l13990"></a>13990     <span class="keywordtype">int</span>     position, maxpos;
-<a name="l13991"></a>13991     <span class="keywordtype">int</span>     xlen, ylen;
-<a name="l13992"></a>13992     <span class="keywordtype">int</span>     sp, ep;
-<a name="l13993"></a>13993     <span class="keywordtype">int</span>     radius;
-<a name="l13994"></a>13994     <span class="keywordtype">int</span>     sradius = 40;
-<a name="l13995"></a>13995     <span class="keywordtype">int</span>     threshold = 250;    <span class="comment">/* Peak must be so many ADUs above min */</span>
-<a name="l13996"></a>13996 
-<a name="l13997"></a>13997     <span class="keywordtype">int</span>     ifwhm;
-<a name="l13998"></a>13998     <span class="keywordtype">double</span>  fwhm;
-<a name="l13999"></a>13999     <span class="keywordtype">double</span> *buffer;
-<a name="l14000"></a>14000     <span class="keywordtype">double</span>  min, max, halfmax;
-<a name="l14001"></a>14001     <span class="keywordtype">double</span>  cut = 1.5;         <span class="comment">/* To cut outliers from FWHM values (pixel) */</span>
-<a name="l14002"></a>14002     <span class="keywordtype">double</span>  value, rms;
-<a name="l14003"></a>14003 
-<a name="l14004"></a>14004     <span class="keywordtype">float</span>  *data;
-<a name="l14005"></a>14005 
-<a name="l14006"></a>14006 
-<a name="l14007"></a>14007     *resolution = 0.0;
-<a name="l14008"></a>14008     *rmsres = 0.0;
-<a name="l14009"></a>14009     *nlines = 0;
-<a name="l14010"></a>14010 
-<a name="l14011"></a>14011     xlen = cpl_image_get_size_x(image);
-<a name="l14012"></a>14012     ylen = cpl_image_get_size_y(image);
-<a name="l14013"></a>14013     data = cpl_image_get_data(image);
-<a name="l14014"></a>14014 
-<a name="l14015"></a>14015     buffer = cpl_malloc(ylen * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l14016"></a>14016 
-<a name="l14017"></a>14017     <span class="comment">/*</span>
-<a name="l14018"></a>14018 <span class="comment">     *  Closest pixel to specified wavelength.</span>
-<a name="l14019"></a>14019 <span class="comment">     */</span>
-<a name="l14020"></a>14020 
-<a name="l14021"></a>14021     position = floor((lambda - startwave) / dispersion + 0.5);
-<a name="l14022"></a>14022 
-<a name="l14023"></a>14023     sp = position - sradius;
-<a name="l14024"></a>14024     ep = position + sradius;
-<a name="l14025"></a>14025 
-<a name="l14026"></a>14026     <span class="keywordflow">if</span> (sp < 0 || ep > xlen) {
-<a name="l14027"></a>14027         cpl_free(buffer);
-<a name="l14028"></a>14028         <span class="keywordflow">return</span> 0;
-<a name="l14029"></a>14029     }
-<a name="l14030"></a>14030 
-<a name="l14031"></a>14031     <span class="keywordflow">for</span> (i = 0, n = 0; i < ylen; i++) {    <span class="comment">/*  For each row of each slit  */</span>
-<a name="l14032"></a>14032 
-<a name="l14033"></a>14033         <span class="comment">/*</span>
-<a name="l14034"></a>14034 <span class="comment">         *  Search interval for peak. Abort if too close to image border.</span>
-<a name="l14035"></a>14035 <span class="comment">         */</span>
-<a name="l14036"></a>14036 
-<a name="l14037"></a>14037         radius = <a class="code" href="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533">mos_lines_width</a>(data + i*xlen + position - sradius, 
-<a name="l14038"></a>14038                                  2*sradius + 1);
-<a name="l14039"></a>14039         <span class="keywordflow">if</span> (radius < 5)
-<a name="l14040"></a>14040             radius = 5;
-<a name="l14041"></a>14041 
-<a name="l14042"></a>14042         sp = position - radius;
-<a name="l14043"></a>14043         ep = position + radius;
-<a name="l14044"></a>14044 
-<a name="l14045"></a>14045         <span class="keywordflow">if</span> (sp < 0 || ep > xlen) {
-<a name="l14046"></a>14046             cpl_free(buffer);
-<a name="l14047"></a>14047             <span class="keywordflow">return</span> 0;
-<a name="l14048"></a>14048         }
-<a name="l14049"></a>14049 
-<a name="l14050"></a>14050 
-<a name="l14051"></a>14051         <span class="comment">/*</span>
-<a name="l14052"></a>14052 <span class="comment">         *  Determine min-max value and position.</span>
-<a name="l14053"></a>14053 <span class="comment">         */</span>
-<a name="l14054"></a>14054 
-<a name="l14055"></a>14055         maxpos = sp;
-<a name="l14056"></a>14056         min = max = data[sp + i * xlen];
-<a name="l14057"></a>14057         <span class="keywordflow">for</span> (j = sp; j < ep; j++) {
-<a name="l14058"></a>14058             <span class="keywordflow">if</span> (data[j + i * xlen] > max) {
-<a name="l14059"></a>14059                 max = data[j + i * xlen];
-<a name="l14060"></a>14060                 maxpos = j;
-<a name="l14061"></a>14061             }
-<a name="l14062"></a>14062             <span class="keywordflow">if</span> (data[j + i * xlen] < min) {
-<a name="l14063"></a>14063                 min = data[j + i * xlen];
-<a name="l14064"></a>14064             }
-<a name="l14065"></a>14065         }
-<a name="l14066"></a>14066 
-<a name="l14067"></a>14067         <span class="keywordflow">if</span> (fabs(min) < 0.0000001)        <span class="comment">/* Truncated spectrum */</span>
-<a name="l14068"></a>14068             <span class="keywordflow">continue</span>;
-<a name="l14069"></a>14069 
-<a name="l14070"></a>14070         <span class="keywordflow">if</span> (max - min < threshold)        <span class="comment">/* Low signal... */</span>
-<a name="l14071"></a>14071             <span class="keywordflow">continue</span>;
-<a name="l14072"></a>14072 
-<a name="l14073"></a>14073         <span class="keywordflow">if</span> (max > saturation)             <span class="comment">/* Saturation */</span>
-<a name="l14074"></a>14074             <span class="keywordflow">continue</span>;
-<a name="l14075"></a>14075 
-<a name="l14076"></a>14076         <span class="comment">/*</span>
-<a name="l14077"></a>14077 <span class="comment">         *  Determine FWHM counting pixels with value greater than</span>
-<a name="l14078"></a>14078 <span class="comment">         *  half of the max value, to the right and to the left of</span>
-<a name="l14079"></a>14079 <span class="comment">         *  the max. Linear interpolation between the pixels where</span>
-<a name="l14080"></a>14080 <span class="comment">         *  the transition happens.</span>
-<a name="l14081"></a>14081 <span class="comment">         */</span>
-<a name="l14082"></a>14082 
-<a name="l14083"></a>14083         halfmax = (max + min)/ 2.0;
-<a name="l14084"></a>14084 
-<a name="l14085"></a>14085         fwhm = 0.0;
-<a name="l14086"></a>14086         ifwhm = 0;
-<a name="l14087"></a>14087         <span class="keywordflow">for</span> (j = maxpos; j < maxpos + radius; j++) {
-<a name="l14088"></a>14088             <span class="keywordflow">if</span> (j < xlen) {
-<a name="l14089"></a>14089                 <span class="keywordflow">if</span> (data[j + i * xlen] < halfmax) {
-<a name="l14090"></a>14090                     fwhm = ifwhm + (data[j - 1 + i * xlen] - halfmax)
-<a name="l14091"></a>14091                          / (data[j - 1 + i * xlen] - data[j + i * xlen]);
-<a name="l14092"></a>14092                     <span class="keywordflow">break</span>;
-<a name="l14093"></a>14093                 }
-<a name="l14094"></a>14094                 ifwhm++;
-<a name="l14095"></a>14095             }
-<a name="l14096"></a>14096         }
-<a name="l14097"></a>14097 
-<a name="l14098"></a>14098         ifwhm = 0;
-<a name="l14099"></a>14099         <span class="keywordflow">for</span> (j = maxpos; j > maxpos - radius; j--) {
-<a name="l14100"></a>14100             <span class="keywordflow">if</span> (j >= 0) {
-<a name="l14101"></a>14101                 <span class="keywordflow">if</span> (data[j + i * xlen] < halfmax) {
-<a name="l14102"></a>14102                     fwhm += ifwhm + (data[j + 1 + i * xlen] - halfmax)
-<a name="l14103"></a>14103                           / (data[j + 1 + i * xlen] - data[j + i * xlen]);
-<a name="l14104"></a>14104                     <span class="keywordflow">break</span>;
-<a name="l14105"></a>14105                 }
-<a name="l14106"></a>14106                 ifwhm++;
-<a name="l14107"></a>14107             }
-<a name="l14108"></a>14108         }
-<a name="l14109"></a>14109 
-<a name="l14110"></a>14110         <span class="keywordflow">if</span> (fwhm > 3.0) {
-<a name="l14111"></a>14111             buffer[n] = fwhm - 2.0;
-<a name="l14112"></a>14112             n++;
-<a name="l14113"></a>14113         }
-<a name="l14114"></a>14114 
-<a name="l14115"></a>14115     }
-<a name="l14116"></a>14116 
-<a name="l14117"></a>14117     <span class="keywordflow">if</span> (n == 0) {
-<a name="l14118"></a>14118         cpl_free(buffer);
-<a name="l14119"></a>14119         <span class="keywordflow">return</span> 0;
-<a name="l14120"></a>14120     }
-<a name="l14121"></a>14121 
-<a name="l14122"></a>14122     vector = cpl_vector_wrap(n, buffer);
-<a name="l14123"></a>14123     value = cpl_vector_get_median_const(vector);
-<a name="l14124"></a>14124     cpl_vector_unwrap(vector);
-<a name="l14125"></a>14125 
-<a name="l14126"></a>14126     rms = 0.0;
-<a name="l14127"></a>14127     <span class="keywordflow">for</span> (i = 0, m = 0; i < n; i++) {
-<a name="l14128"></a>14128         <span class="keywordflow">if</span> (fabs(buffer[i] - value) < cut) {
-<a name="l14129"></a>14129             rms += fabs(buffer[i] - value);
-<a name="l14130"></a>14130             m++;
-<a name="l14131"></a>14131         }
-<a name="l14132"></a>14132     }
-<a name="l14133"></a>14133 
-<a name="l14134"></a>14134     cpl_free(buffer);
-<a name="l14135"></a>14135 
-<a name="l14136"></a>14136     <span class="keywordflow">if</span> (m < 3)
-<a name="l14137"></a>14137         <span class="keywordflow">return</span> 0;
-<a name="l14138"></a>14138 
-<a name="l14139"></a>14139     rms /= m;
-<a name="l14140"></a>14140     rms *= 1.25;       <span class="comment">/* Factor to convert average deviation to sigma */</span>
-<a name="l14141"></a>14141 
-<a name="l14142"></a>14142     value *= dispersion;
-<a name="l14143"></a>14143     rms *= dispersion;
-<a name="l14144"></a>14144 
-<a name="l14145"></a>14145     *mfwhm = value;
-<a name="l14146"></a>14146     *rmsfwhm = rms;
-<a name="l14147"></a>14147 
-<a name="l14148"></a>14148     *resolution = lambda / value;
-<a name="l14149"></a>14149     *rmsres = *resolution * rms / value;
-<a name="l14150"></a>14150 
-<a name="l14151"></a>14151     *nlines = m;
-<a name="l14152"></a>14152 
-<a name="l14153"></a>14153     <span class="keywordflow">return</span> 1;
-<a name="l14154"></a>14154 }
-<a name="l14155"></a>14155 
-<a name="l14156"></a>14156 
-<a name="l14178"></a><a class="code" href="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55">14178</a> cpl_table *<a class="code" href="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55">mos_resolution_table</a>(cpl_image *image, <span class="keywordtype">double</span> startwave, 
-<a name="l14179"></a>14179                                 <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> saturation, 
-<a name="l14180"></a>14180                                 cpl_vector *lines)
-<a name="l14181"></a>14181 {
-<a name="l14182"></a>14182 
-<a name="l14183"></a>14183     cpl_table *table;
-<a name="l14184"></a>14184     <span class="keywordtype">double</span>    *line;
-<a name="l14185"></a>14185     <span class="keywordtype">double</span>     fwhm;
-<a name="l14186"></a>14186     <span class="keywordtype">double</span>     rmsfwhm;
-<a name="l14187"></a>14187     <span class="keywordtype">double</span>     resolution;
-<a name="l14188"></a>14188     <span class="keywordtype">double</span>     rmsres;
-<a name="l14189"></a>14189     <span class="keywordtype">int</span>        nref;
-<a name="l14190"></a>14190     <span class="keywordtype">int</span>        nlines;
-<a name="l14191"></a>14191     <span class="keywordtype">int</span>        i;
-<a name="l14192"></a>14192 
-<a name="l14193"></a>14193 
-<a name="l14194"></a>14194     nref = cpl_vector_get_size(lines);
-<a name="l14195"></a>14195     line = cpl_vector_get_data(lines);
-<a name="l14196"></a>14196 
-<a name="l14197"></a>14197     table = cpl_table_new(nref);
-<a name="l14198"></a>14198     cpl_table_new_column(table, <span class="stringliteral">"wavelength"</span>, CPL_TYPE_DOUBLE);
-<a name="l14199"></a>14199     cpl_table_set_column_unit(table, <span class="stringliteral">"wavelength"</span>, <span class="stringliteral">"Angstrom"</span>);
-<a name="l14200"></a>14200     cpl_table_new_column(table, <span class="stringliteral">"fwhm"</span>, CPL_TYPE_DOUBLE);
-<a name="l14201"></a>14201     cpl_table_set_column_unit(table, <span class="stringliteral">"fwhm"</span>, <span class="stringliteral">"Angstrom"</span>);
-<a name="l14202"></a>14202     cpl_table_new_column(table, <span class="stringliteral">"fwhm_rms"</span>, CPL_TYPE_DOUBLE);
-<a name="l14203"></a>14203     cpl_table_set_column_unit(table, <span class="stringliteral">"fwhm_rms"</span>, <span class="stringliteral">"Angstrom"</span>);
-<a name="l14204"></a>14204     cpl_table_new_column(table, <span class="stringliteral">"resolution"</span>, CPL_TYPE_DOUBLE);
-<a name="l14205"></a>14205     cpl_table_new_column(table, <span class="stringliteral">"resolution_rms"</span>, CPL_TYPE_DOUBLE);
-<a name="l14206"></a>14206     cpl_table_new_column(table, <span class="stringliteral">"nlines"</span>, CPL_TYPE_INT);
-<a name="l14207"></a>14207 
-<a name="l14208"></a>14208     <span class="keywordflow">for</span> (i = 0; i < nref; i++) {
-<a name="l14209"></a>14209         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g9dab2e2448ef188d7f8fddd02483d919">mos_spectral_resolution</a>(image, line[i], startwave, dispersion, 
-<a name="l14210"></a>14210                                     saturation, &fwhm, &rmsfwhm, 
-<a name="l14211"></a>14211                                     &resolution, &rmsres, &nlines)) {
-<a name="l14212"></a>14212             cpl_table_set_double(table, <span class="stringliteral">"wavelength"</span>, i, line[i]);
-<a name="l14213"></a>14213             cpl_table_set_double(table, <span class="stringliteral">"fwhm"</span>, i, fwhm);
-<a name="l14214"></a>14214             cpl_table_set_double(table, <span class="stringliteral">"fwhm_rms"</span>, i, rmsfwhm);
-<a name="l14215"></a>14215             cpl_table_set_double(table, <span class="stringliteral">"resolution"</span>, i, resolution);
-<a name="l14216"></a>14216             cpl_table_set_double(table, <span class="stringliteral">"resolution_rms"</span>, i, rmsres);
-<a name="l14217"></a>14217             cpl_table_set_int(table, <span class="stringliteral">"nlines"</span>, i, nlines);
-<a name="l14218"></a>14218         }
-<a name="l14219"></a>14219         <span class="keywordflow">else</span>
-<a name="l14220"></a>14220             cpl_table_set_int(table, <span class="stringliteral">"nlines"</span>, i, 0);
-<a name="l14221"></a>14221     }
-<a name="l14222"></a>14222 
-<a name="l14223"></a>14223     <span class="keywordflow">if</span> (cpl_table_has_valid(table, <span class="stringliteral">"wavelength"</span>))
-<a name="l14224"></a>14224         <span class="keywordflow">return</span> table;
-<a name="l14225"></a>14225 
-<a name="l14226"></a>14226     cpl_table_delete(table);
-<a name="l14227"></a>14227 
-<a name="l14228"></a>14228     <span class="keywordflow">return</span> NULL;
-<a name="l14229"></a>14229     
-<a name="l14230"></a>14230 }
-<a name="l14231"></a>14231 
-<a name="l14232"></a>14232 
-<a name="l14250"></a><a class="code" href="group__moses.html#g51c4d941feada9601c3e391058f4e653">14250</a> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g51c4d941feada9601c3e391058f4e653">mos_integrate_signal</a>(cpl_image *image, cpl_image *wavemap,
-<a name="l14251"></a>14251                             <span class="keywordtype">int</span> ystart, <span class="keywordtype">int</span> yend, <span class="keywordtype">double</span> wstart, <span class="keywordtype">double</span> wend)
-<a name="l14252"></a>14252 {
-<a name="l14253"></a>14253     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_integrate_signal"</span>;
-<a name="l14254"></a>14254 
-<a name="l14255"></a>14255     <span class="keywordtype">double</span> sum;
-<a name="l14256"></a>14256     <span class="keywordtype">float</span> *sdata;
-<a name="l14257"></a>14257     <span class="keywordtype">float</span> *wdata;
-<a name="l14258"></a>14258     <span class="keywordtype">int</span>    nx, ny;
-<a name="l14259"></a>14259     <span class="keywordtype">int</span>    x, y;
-<a name="l14260"></a>14260     
-<a name="l14261"></a>14261 
-<a name="l14262"></a>14262     <span class="keywordflow">if</span> (image == NULL || wavemap == NULL) { 
-<a name="l14263"></a>14263         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l14264"></a>14264         <span class="keywordflow">return</span> 0.0;
-<a name="l14265"></a>14265     }
-<a name="l14266"></a>14266 
-<a name="l14267"></a>14267     <span class="keywordflow">if</span> (ystart > yend || wstart >= wend) {
-<a name="l14268"></a>14268         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14269"></a>14269         <span class="keywordflow">return</span> 0.0;
-<a name="l14270"></a>14270     }
-<a name="l14271"></a>14271 
-<a name="l14272"></a>14272     nx = cpl_image_get_size_x(image);
-<a name="l14273"></a>14273     ny = cpl_image_get_size_y(image);
-<a name="l14274"></a>14274 
-<a name="l14275"></a>14275     <span class="keywordflow">if</span> (!(nx == cpl_image_get_size_x(wavemap) 
-<a name="l14276"></a>14276         && ny == cpl_image_get_size_y(wavemap))) {
-<a name="l14277"></a>14277         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);
-<a name="l14278"></a>14278         <span class="keywordflow">return</span> 0.0;
-<a name="l14279"></a>14279     }
-<a name="l14280"></a>14280 
-<a name="l14281"></a>14281     <span class="keywordflow">if</span> (ystart < 0 || yend > ny) {
-<a name="l14282"></a>14282         cpl_error_set(func, CPL_ERROR_ACCESS_OUT_OF_RANGE);
-<a name="l14283"></a>14283         <span class="keywordflow">return</span> 0.0;
-<a name="l14284"></a>14284     }
-<a name="l14285"></a>14285 
-<a name="l14286"></a>14286     sdata = cpl_image_get_data(image);
-<a name="l14287"></a>14287     wdata = cpl_image_get_data(wavemap);
-<a name="l14288"></a>14288 
-<a name="l14289"></a>14289     sdata += ystart*nx;
-<a name="l14290"></a>14290     wdata += ystart*nx;
-<a name="l14291"></a>14291 
-<a name="l14292"></a>14292     sum = 0.0;
-<a name="l14293"></a>14293     <span class="keywordflow">for</span> (y = ystart; y < yend; y++) {
-<a name="l14294"></a>14294         <span class="keywordflow">for</span> (x = 0; x < nx; x++) {
-<a name="l14295"></a>14295             <span class="keywordflow">if</span> (wdata[x] < wstart || wdata[x] > wend)
-<a name="l14296"></a>14296                 <span class="keywordflow">continue</span>;
-<a name="l14297"></a>14297             sum += sdata[x];
-<a name="l14298"></a>14298         }
-<a name="l14299"></a>14299         sdata += nx;
-<a name="l14300"></a>14300         wdata += nx;
-<a name="l14301"></a>14301     }
-<a name="l14302"></a>14302 
-<a name="l14303"></a>14303     <span class="keywordflow">return</span> sum;
-<a name="l14304"></a>14304 
-<a name="l14305"></a>14305 }
-<a name="l14306"></a>14306 
-<a name="l14307"></a>14307 <span class="comment">/****************************************************************************</span>
-<a name="l14308"></a>14308 <span class="comment"> * From this point on, the instrument dependent functions are added:</span>
-<a name="l14309"></a>14309 <span class="comment"> * they are functions that retrieve information that is stored in</span>
-<a name="l14310"></a>14310 <span class="comment"> * the data headers in some instrument specific way, such as the</span>
-<a name="l14311"></a>14311 <span class="comment"> * location of overscans, the slits positions on the telescope</span>
-<a name="l14312"></a>14312 <span class="comment"> * focal plane, the gain factor, etc.</span>
-<a name="l14313"></a>14313 <span class="comment"> */</span>
-<a name="l14314"></a>14314 
-<a name="l14315"></a>14315 
-<a name="l14338"></a><a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">14338</a> cpl_table *<a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(cpl_propertylist *header)
-<a name="l14339"></a>14339 {
-<a name="l14340"></a>14340     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_slits_fors_mxu"</span>;
-<a name="l14341"></a>14341 
-<a name="l14342"></a>14342     cpl_table  *slits;
-<a name="l14343"></a>14343     <span class="keywordtype">char</span>        keyname[MAX_COLNAME];
-<a name="l14344"></a>14344     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a>;
-<a name="l14345"></a>14345     <span class="keyword">const</span> <span class="keywordtype">char</span> *target_name;
-<a name="l14346"></a>14346     <span class="keywordtype">float</span>       slit_x;
-<a name="l14347"></a>14347     <span class="keywordtype">float</span>       slit_y;
-<a name="l14348"></a>14348     <span class="keywordtype">float</span>       length;
-<a name="l14349"></a>14349 <span class="comment">/*    double      arc2mm = 0.53316;         */</span>
-<a name="l14350"></a>14350     <span class="keywordtype">double</span>      arc2mm = 0.528;
-<a name="l14351"></a>14351     <span class="keywordtype">int</span>         nslits;
-<a name="l14352"></a>14352     <span class="keywordtype">int</span>         slit_id;
-<a name="l14353"></a>14353     <span class="keywordtype">int</span>         fors;
-<a name="l14354"></a>14354     <span class="keywordtype">int</span>         chip;
-<a name="l14355"></a>14355     <span class="keywordtype">int</span>         found;
-<a name="l14356"></a>14356 
-<a name="l14357"></a>14357     <span class="comment">/*</span>
-<a name="l14358"></a>14358 <span class="comment">     * The limits below are used to exclude from the loaded slit list</span>
-<a name="l14359"></a>14359 <span class="comment">     * any slit that surely doesn't belong to the used chip. This is</span>
-<a name="l14360"></a>14360 <span class="comment">     * a way to reduce the chance of ambiguous slit identification.</span>
-<a name="l14361"></a>14361 <span class="comment">     */</span>
-<a name="l14362"></a>14362 
-<a name="l14363"></a>14363     <span class="keywordtype">float</span>      low_limit1 = 10.0;
-<a name="l14364"></a>14364     <span class="keywordtype">float</span>      hig_limit2 = 30.0;
-<a name="l14365"></a>14365 
-<a name="l14366"></a>14366 
-<a name="l14367"></a>14367     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l14368"></a>14368         <span class="keywordflow">return</span> NULL;
-<a name="l14369"></a>14369     }
-<a name="l14370"></a>14370 
-<a name="l14371"></a>14371     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l14372"></a>14372         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l14373"></a>14373         <span class="keywordflow">return</span> NULL;
-<a name="l14374"></a>14374     }
-<a name="l14375"></a>14375 
-<a name="l14376"></a>14376 
-<a name="l14377"></a>14377     <span class="comment">/*</span>
-<a name="l14378"></a>14378 <span class="comment">     * See if this is FORS1 or FORS2;</span>
-<a name="l14379"></a>14379 <span class="comment">     */</span>
-<a name="l14380"></a>14380 
-<a name="l14381"></a>14381     instrume = cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l14382"></a>14382 
-<a name="l14383"></a>14383     fors = 0;
-<a name="l14384"></a>14384     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l14385"></a>14385         fors = 1;
-<a name="l14386"></a>14386     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l14387"></a>14387         fors = 2;
-<a name="l14388"></a>14388 
-<a name="l14389"></a>14389     <span class="keywordflow">if</span> (fors != 2) {
-<a name="l14390"></a>14390         cpl_msg_error(func, <span class="stringliteral">"Wrong instrument: %s\n"</span>
-<a name="l14391"></a>14391                       <span class="stringliteral">"FORS2 is expected for MXU data"</span>, instrume);
-<a name="l14392"></a>14392         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14393"></a>14393         <span class="keywordflow">return</span> NULL;
-<a name="l14394"></a>14394     }
-<a name="l14395"></a>14395 
-<a name="l14396"></a>14396 
-<a name="l14397"></a>14397     <span class="comment">/*</span>
-<a name="l14398"></a>14398 <span class="comment">     * The master and slave chips can be identified by their positions</span>
-<a name="l14399"></a>14399 <span class="comment">     * in the chip array in the case of FORS2 data (with fors1 the chip</span>
-<a name="l14400"></a>14400 <span class="comment">     * is always 1). chip = 2 is the master, chip = 1 is the slave.</span>
-<a name="l14401"></a>14401 <span class="comment">     */</span>
-<a name="l14402"></a>14402 
-<a name="l14403"></a>14403     chip = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET CHIP1 Y"</span>);
-<a name="l14404"></a>14404 
-<a name="l14405"></a>14405     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l14406"></a>14406         cpl_msg_error(func, <span class="stringliteral">"Missing keyword ESO DET CHIP1 Y "</span>
-<a name="l14407"></a>14407                       <span class="stringliteral">"in FITS header"</span>);
-<a name="l14408"></a>14408         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14409"></a>14409         <span class="keywordflow">return</span> NULL;
-<a name="l14410"></a>14410     }
-<a name="l14411"></a>14411 
-<a name="l14412"></a>14412     <span class="keywordflow">if</span> (chip != 1 && chip != 2) {
-<a name="l14413"></a>14413         cpl_msg_error(func, <span class="stringliteral">"Unexpected chip position in keyword "</span>
-<a name="l14414"></a>14414                       <span class="stringliteral">"ESO DET CHIP1 Y: %d"</span>, chip);
-<a name="l14415"></a>14415         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14416"></a>14416         <span class="keywordflow">return</span> NULL;
-<a name="l14417"></a>14417     }
-<a name="l14418"></a>14418 
-<a name="l14419"></a>14419 
-<a name="l14420"></a>14420     <span class="comment">/*</span>
-<a name="l14421"></a>14421 <span class="comment">     * Count slits in header (excluding reference slits, and the slits</span>
-<a name="l14422"></a>14422 <span class="comment">     * that _surely_ belong to the other chip)</span>
-<a name="l14423"></a>14423 <span class="comment">     */</span>
-<a name="l14424"></a>14424 
-<a name="l14425"></a>14425     nslits = 0;
-<a name="l14426"></a>14426     slit_id = 0;
-<a name="l14427"></a>14427     found = 1;
-<a name="l14428"></a>14428 
-<a name="l14429"></a>14429     <span class="keywordflow">while</span> (found) {
-<a name="l14430"></a>14430         slit_id++;
-<a name="l14431"></a>14431         snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d YPOS"</span>, slit_id + 100);
-<a name="l14432"></a>14432         <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {
-<a name="l14433"></a>14433             slit_y = cpl_propertylist_get_double(header, keyname);
-<a name="l14434"></a>14434 
-<a name="l14435"></a>14435             <span class="keywordflow">if</span> (chip == 1)
-<a name="l14436"></a>14436                 <span class="keywordflow">if</span> (slit_y < low_limit1)
-<a name="l14437"></a>14437                     <span class="keywordflow">continue</span>;
-<a name="l14438"></a>14438             <span class="keywordflow">if</span> (chip == 2)
-<a name="l14439"></a>14439                 <span class="keywordflow">if</span> (slit_y > hig_limit2)
-<a name="l14440"></a>14440                     <span class="keywordflow">continue</span>;
-<a name="l14441"></a>14441                 
-<a name="l14442"></a>14442             snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS TARG%d NAME"</span>, 
-<a name="l14443"></a>14443                      slit_id + 100);
-<a name="l14444"></a>14444             <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {
-<a name="l14445"></a>14445                 target_name = cpl_propertylist_get_string(header, keyname);
-<a name="l14446"></a>14446                 <span class="keywordflow">if</span> (strncmp(target_name, <span class="stringliteral">"refslit"</span>, 7))
-<a name="l14447"></a>14447                     nslits++;
-<a name="l14448"></a>14448             }
-<a name="l14449"></a>14449             <span class="keywordflow">else</span>
-<a name="l14450"></a>14450                 nslits++;
-<a name="l14451"></a>14451         }
-<a name="l14452"></a>14452         <span class="keywordflow">else</span>
-<a name="l14453"></a>14453             found = 0;
-<a name="l14454"></a>14454     }
-<a name="l14455"></a>14455 
-<a name="l14456"></a>14456     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l14457"></a>14457         cpl_msg_error(func, <span class="stringliteral">"%s while loading slits coordinates from "</span>
-<a name="l14458"></a>14458                       <span class="stringliteral">"FITS header"</span>, cpl_error_get_message());
-<a name="l14459"></a>14459         cpl_error_set_where(func);
-<a name="l14460"></a>14460         <span class="keywordflow">return</span> NULL;
-<a name="l14461"></a>14461     }
-<a name="l14462"></a>14462 
-<a name="l14463"></a>14463     <span class="keywordflow">if</span> (nslits == 0)  {
-<a name="l14464"></a>14464         cpl_msg_error(func, <span class="stringliteral">"No slits coordinates found in header"</span>);
-<a name="l14465"></a>14465         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l14466"></a>14466         <span class="keywordflow">return</span> NULL;
-<a name="l14467"></a>14467     }
-<a name="l14468"></a>14468 
-<a name="l14469"></a>14469     slits = cpl_table_new(nslits);
-<a name="l14470"></a>14470     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l14471"></a>14471     cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l14472"></a>14472     cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l14473"></a>14473     cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l14474"></a>14474     cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l14475"></a>14475     cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>,    <span class="stringliteral">"pixel"</span>);
-<a name="l14476"></a>14476     cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>,    <span class="stringliteral">"pixel"</span>);
-<a name="l14477"></a>14477     cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l14478"></a>14478     cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l14479"></a>14479 
-<a name="l14480"></a>14480     nslits = 0;
-<a name="l14481"></a>14481     slit_id = 0; 
-<a name="l14482"></a>14482     found = 1;
-<a name="l14483"></a>14483     <span class="keywordflow">while</span> (found) {
-<a name="l14484"></a>14484         slit_id++;
-<a name="l14485"></a>14485         snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d YPOS"</span>, slit_id + 100);
-<a name="l14486"></a>14486         <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {
-<a name="l14487"></a>14487             slit_y = cpl_propertylist_get_double(header, keyname);
-<a name="l14488"></a>14488 
-<a name="l14489"></a>14489             <span class="keywordflow">if</span> (chip == 1) 
-<a name="l14490"></a>14490                 <span class="keywordflow">if</span> (slit_y < low_limit1)
-<a name="l14491"></a>14491                     <span class="keywordflow">continue</span>;
-<a name="l14492"></a>14492             <span class="keywordflow">if</span> (chip == 2)
-<a name="l14493"></a>14493                 <span class="keywordflow">if</span> (slit_y > hig_limit2)
-<a name="l14494"></a>14494                     <span class="keywordflow">continue</span>;
-<a name="l14495"></a>14495 
-<a name="l14496"></a>14496             <span class="comment">/*</span>
-<a name="l14497"></a>14497 <span class="comment">             * Y-flip the slit position, to match CCD pixel coordinate</span>
-<a name="l14498"></a>14498 <span class="comment">             * convention</span>
-<a name="l14499"></a>14499 <span class="comment">             */</span>
-<a name="l14500"></a>14500 
-<a name="l14501"></a>14501             slit_y = -slit_y;
-<a name="l14502"></a>14502 
-<a name="l14503"></a>14503             snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d XPOS"</span>, slit_id + 100);
-<a name="l14504"></a>14504             slit_x = cpl_propertylist_get_double(header, keyname);
-<a name="l14505"></a>14505             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l14506"></a>14506                 cpl_table_delete(slits);
-<a name="l14507"></a>14507                 cpl_msg_error(func, <span class="stringliteral">"Missing keyword %s in FITS header"</span>, 
-<a name="l14508"></a>14508                               keyname);
-<a name="l14509"></a>14509                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14510"></a>14510                 <span class="keywordflow">return</span> NULL;
-<a name="l14511"></a>14511             }
-<a name="l14512"></a>14512 
-<a name="l14513"></a>14513             snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d LEN"</span>, slit_id + 100);
-<a name="l14514"></a>14514             length = cpl_propertylist_get_double(header, keyname);
-<a name="l14515"></a>14515             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l14516"></a>14516                 cpl_table_delete(slits);
-<a name="l14517"></a>14517                 cpl_msg_error(func, <span class="stringliteral">"Missing keyword %s in FITS header"</span>, 
-<a name="l14518"></a>14518                               keyname);
-<a name="l14519"></a>14519                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14520"></a>14520                 <span class="keywordflow">return</span> NULL;
-<a name="l14521"></a>14521             }
-<a name="l14522"></a>14522 
-<a name="l14523"></a>14523             length *= arc2mm;
-<a name="l14524"></a>14524 
-<a name="l14525"></a>14525             snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS TARG%d NAME"</span>, 
-<a name="l14526"></a>14526                      slit_id + 100);
-<a name="l14527"></a>14527             <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {
-<a name="l14528"></a>14528                 target_name = cpl_propertylist_get_string(header, keyname);
-<a name="l14529"></a>14529                 <span class="keywordflow">if</span> (strncmp(target_name, <span class="stringliteral">"refslit"</span>, 7)) {
-<a name="l14530"></a>14530                     cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, nslits, slit_id);
-<a name="l14531"></a>14531                     cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, nslits, slit_x);
-<a name="l14532"></a>14532                     cpl_table_set(slits, <span class="stringliteral">"ytop"</span>, nslits, slit_y + length/2);
-<a name="l14533"></a>14533                     cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, nslits, slit_x);
-<a name="l14534"></a>14534                     cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, nslits, slit_y - length/2);
-<a name="l14535"></a>14535                     nslits++;
-<a name="l14536"></a>14536                 }
-<a name="l14537"></a>14537             }
-<a name="l14538"></a>14538             <span class="keywordflow">else</span> {
-<a name="l14539"></a>14539                 cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, nslits, slit_id);
-<a name="l14540"></a>14540                 cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, nslits, slit_x);
-<a name="l14541"></a>14541                 cpl_table_set(slits, <span class="stringliteral">"ytop"</span>, nslits, slit_y + length/2);
-<a name="l14542"></a>14542                 cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, nslits, slit_x);
-<a name="l14543"></a>14543                 cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, nslits, slit_y - length/2);
-<a name="l14544"></a>14544                 nslits++;
-<a name="l14545"></a>14545             }
-<a name="l14546"></a>14546         }
-<a name="l14547"></a>14547         <span class="keywordflow">else</span>
-<a name="l14548"></a>14548             found = 0;
-<a name="l14549"></a>14549     }
-<a name="l14550"></a>14550 
-<a name="l14551"></a>14551     <span class="keywordflow">return</span> slits;
-<a name="l14552"></a>14552 }
-<a name="l14553"></a>14553 
-<a name="l14554"></a>14554 
-<a name="l14578"></a><a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">14578</a> cpl_table *<a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(cpl_propertylist *header, 
-<a name="l14579"></a>14579                                    <span class="keywordtype">int</span> * nslits_out_det)
-<a name="l14580"></a>14580 {
-<a name="l14581"></a>14581     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_slits_fors_mos"</span>;
-<a name="l14582"></a>14582 
-<a name="l14583"></a>14583     cpl_table  *slits;
-<a name="l14584"></a>14584     <span class="keywordtype">char</span>        keyname[MAX_COLNAME];
-<a name="l14585"></a>14585     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a>;
-<a name="l14586"></a>14586     <span class="keyword">const</span> <span class="keywordtype">char</span> *chipname;
-<a name="l14587"></a>14587     <span class="keywordtype">float</span>       slit_x;
-<a name="l14588"></a>14588     <span class="keywordtype">int</span>         first_slit, last_slit;
-<a name="l14589"></a>14589     cpl_size    nslits;
-<a name="l14590"></a>14590     <span class="keywordtype">int</span>         slit_id;
-<a name="l14591"></a>14591     <span class="keywordtype">int</span>         fors;
-<a name="l14592"></a>14592     <span class="keywordtype">int</span>         chip;
-<a name="l14593"></a>14593     <span class="keywordtype">int</span>         fors_is_old;
-<a name="l14594"></a>14594 
-<a name="l14595"></a>14595     <span class="comment">/*</span>
-<a name="l14596"></a>14596 <span class="comment">     * The Y coordinates of the slits are fixed</span>
-<a name="l14597"></a>14597 <span class="comment">     */</span>
-<a name="l14598"></a>14598 
-<a name="l14599"></a>14599     <span class="keywordtype">float</span>       ytop[19]    = { 113.9, 101.3,  89.9,  77.3,  65.9,  53.3, 
-<a name="l14600"></a>14600                                  41.9,  29.3,  17.9,   5.3,  -6.1, -18.7, 
-<a name="l14601"></a>14601                                 -30.1, -42.7, -54.1, -66.7, -78.1, -90.7, 
-<a name="l14602"></a>14602                                -102.1 };
-<a name="l14603"></a>14603     <span class="keywordtype">float</span>       ybottom[19] = { 102.1,  90.7,  78.1,  66.7,  54.1,  42.7,
-<a name="l14604"></a>14604                                  30.1,  18.7,   6.1,  -5.3, -17.9, -29.3,
-<a name="l14605"></a>14605                                 -41.9, -53.3, -65.9, -77.3, -89.9, -101.3,
-<a name="l14606"></a>14606                                -113.9 };
-<a name="l14607"></a>14607 
-<a name="l14608"></a>14608 
-<a name="l14609"></a>14609     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l14610"></a>14610         <span class="keywordflow">return</span> NULL;
-<a name="l14611"></a>14611     }
-<a name="l14612"></a>14612 
-<a name="l14613"></a>14613     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l14614"></a>14614         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l14615"></a>14615         <span class="keywordflow">return</span> NULL;
-<a name="l14616"></a>14616     }
-<a name="l14617"></a>14617 
-<a name="l14618"></a>14618 
-<a name="l14619"></a>14619     <span class="comment">/*</span>
-<a name="l14620"></a>14620 <span class="comment">     * See if this is FORS1 or FORS2;</span>
-<a name="l14621"></a>14621 <span class="comment">     */</span>
-<a name="l14622"></a>14622 
-<a name="l14623"></a>14623     instrume = cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l14624"></a>14624 
-<a name="l14625"></a>14625     fors = 0;
-<a name="l14626"></a>14626     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l14627"></a>14627         fors = 1;
-<a name="l14628"></a>14628     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l14629"></a>14629         fors = 2;
-<a name="l14630"></a>14630 
-<a name="l14631"></a>14631     <span class="keywordflow">if</span> (fors == 0) {
-<a name="l14632"></a>14632         cpl_msg_error(func, <span class="stringliteral">"Wrong instrument found in FITS header: %s"</span>, 
-<a name="l14633"></a>14633                       instrume);
-<a name="l14634"></a>14634         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14635"></a>14635         <span class="keywordflow">return</span> NULL;
-<a name="l14636"></a>14636     }
-<a name="l14637"></a>14637 
-<a name="l14638"></a>14638     <span class="comment">/* FIXME:</span>
-<a name="l14639"></a>14639 <span class="comment">     * This is the way FORS1 data belong to the upgraded chips,</span>
-<a name="l14640"></a>14640 <span class="comment">     * named "Marlene" and "Norma III". It's a quick solution,</span>
-<a name="l14641"></a>14641 <span class="comment">     * there are hardcoded values here!!!</span>
-<a name="l14642"></a>14642 <span class="comment">     */</span>
-<a name="l14643"></a>14643 
-<a name="l14644"></a>14644     chipname = cpl_propertylist_get_string(header, <span class="stringliteral">"ESO DET CHIP1 ID"</span>);
-<a name="l14645"></a>14645 
-<a name="l14646"></a>14646     <span class="keywordflow">if</span> (chipname[0] == <span class="charliteral">'M'</span> || chipname[0] == <span class="charliteral">'N'</span>)
-<a name="l14647"></a>14647         fors_is_old = 0;
-<a name="l14648"></a>14648     <span class="keywordflow">else</span>
-<a name="l14649"></a>14649         fors_is_old = 1;
-<a name="l14650"></a>14650 
-<a name="l14651"></a>14651     <span class="keywordflow">if</span> (fors == 1 && fors_is_old) {
-<a name="l14652"></a>14652         first_slit = 1;
-<a name="l14653"></a>14653         last_slit = 19;
-<a name="l14654"></a>14654     }
-<a name="l14655"></a>14655     <span class="keywordflow">else</span> {
-<a name="l14656"></a>14656 
-<a name="l14657"></a>14657         <span class="comment">/*</span>
-<a name="l14658"></a>14658 <span class="comment">         * The master and slave chips can be identified by their positions</span>
-<a name="l14659"></a>14659 <span class="comment">         * in the chip array in the case of FORS2 data: chip = 2 is the </span>
-<a name="l14660"></a>14660 <span class="comment">         * master, chip = 1 is the slave.</span>
-<a name="l14661"></a>14661 <span class="comment">         */</span>
-<a name="l14662"></a>14662 
-<a name="l14663"></a>14663         chip = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET CHIP1 Y"</span>);
-<a name="l14664"></a>14664 
-<a name="l14665"></a>14665         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l14666"></a>14666             cpl_msg_error(func, <span class="stringliteral">"Missing keyword ESO DET CHIP1 Y "</span>
-<a name="l14667"></a>14667                           <span class="stringliteral">"in FITS header"</span>);
-<a name="l14668"></a>14668             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14669"></a>14669             <span class="keywordflow">return</span> NULL;
-<a name="l14670"></a>14670         }
-<a name="l14671"></a>14671 
-<a name="l14672"></a>14672         <span class="keywordflow">if</span> (chip != 1 && chip != 2) {
-<a name="l14673"></a>14673             cpl_msg_error(func, <span class="stringliteral">"Unexpected chip position in keyword "</span>
-<a name="l14674"></a>14674                           <span class="stringliteral">"ESO DET CHIP1 Y: %d"</span>, chip);
-<a name="l14675"></a>14675             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14676"></a>14676             <span class="keywordflow">return</span> NULL;
-<a name="l14677"></a>14677         }
-<a name="l14678"></a>14678 
-<a name="l14679"></a>14679         <span class="keywordflow">if</span> (chip == 1) {
-<a name="l14680"></a>14680             first_slit = 12;
-<a name="l14681"></a>14681             last_slit = 19;
-<a name="l14682"></a>14682         }
-<a name="l14683"></a>14683         <span class="keywordflow">else</span> {
-<a name="l14684"></a>14684             first_slit = 1;
-<a name="l14685"></a>14685             last_slit = 11;
-<a name="l14686"></a>14686         }
-<a name="l14687"></a>14687     }
-<a name="l14688"></a>14688 
-<a name="l14689"></a>14689 
-<a name="l14690"></a>14690     <span class="comment">/*</span>
-<a name="l14691"></a>14691 <span class="comment">     * Count slits in header (excluding closed slits - i.e. those with</span>
-<a name="l14692"></a>14692 <span class="comment">     * offsets greater than 115 mm - and the slits that do not belong </span>
-<a name="l14693"></a>14693 <span class="comment">     * to this chip)</span>
-<a name="l14694"></a>14694 <span class="comment">     */</span>
-<a name="l14695"></a>14695 
-<a name="l14696"></a>14696     nslits = 0;
-<a name="l14697"></a>14697     slit_id = 0;
-<a name="l14698"></a>14698     <span class="keywordflow">for</span> (slit_id = first_slit; slit_id <= last_slit; slit_id++) {
-<a name="l14699"></a>14699         snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d POS"</span>, slit_id);
-<a name="l14700"></a>14700         <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {
-<a name="l14701"></a>14701             slit_x = cpl_propertylist_get_double(header, keyname);
-<a name="l14702"></a>14702             <span class="keywordflow">if</span> (fabs(slit_x) < 115.0)
-<a name="l14703"></a>14703                 nslits++;
-<a name="l14704"></a>14704             <span class="keywordflow">else</span>
-<a name="l14705"></a>14705                 (*nslits_out_det)++;        
-<a name="l14706"></a>14706         }
-<a name="l14707"></a>14707         <span class="keywordflow">else</span> {
-<a name="l14708"></a>14708             cpl_msg_error(func, <span class="stringliteral">"Missing keyword %s in FITS header"</span>, keyname);
-<a name="l14709"></a>14709             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14710"></a>14710             <span class="keywordflow">return</span> NULL;
-<a name="l14711"></a>14711         }
-<a name="l14712"></a>14712     }
-<a name="l14713"></a>14713 
-<a name="l14714"></a>14714     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l14715"></a>14715         cpl_msg_error(func, <span class="stringliteral">"%s while loading slits coordinates from "</span>
-<a name="l14716"></a>14716                       <span class="stringliteral">"FITS header"</span>, cpl_error_get_message());
-<a name="l14717"></a>14717         cpl_error_set_where(func);
-<a name="l14718"></a>14718         <span class="keywordflow">return</span> NULL;
-<a name="l14719"></a>14719     }
-<a name="l14720"></a>14720 
-<a name="l14721"></a>14721     <span class="keywordflow">if</span> (nslits == 0)  {
-<a name="l14722"></a>14722         cpl_msg_error(func, <span class="stringliteral">"No slits coordinates found in header"</span>);
-<a name="l14723"></a>14723         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l14724"></a>14724         <span class="keywordflow">return</span> NULL;
-<a name="l14725"></a>14725     }
-<a name="l14726"></a>14726 
-<a name="l14727"></a>14727     slits = cpl_table_new(nslits);
-<a name="l14728"></a>14728     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l14729"></a>14729     cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l14730"></a>14730     cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l14731"></a>14731     cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l14732"></a>14732     cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l14733"></a>14733     cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>,    <span class="stringliteral">"pixel"</span>);
-<a name="l14734"></a>14734     cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>,    <span class="stringliteral">"pixel"</span>);
-<a name="l14735"></a>14735     cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l14736"></a>14736     cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l14737"></a>14737 
-<a name="l14738"></a>14738     nslits = 0;
-<a name="l14739"></a>14739     slit_id = 0;
-<a name="l14740"></a>14740     <span class="keywordflow">for</span> (slit_id = first_slit; slit_id <= last_slit; slit_id++) {
-<a name="l14741"></a>14741         snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d POS"</span>, slit_id);
-<a name="l14742"></a>14742         slit_x = cpl_propertylist_get_double(header, keyname);
-<a name="l14743"></a>14743         <span class="keywordflow">if</span> (fabs(slit_x) < 115.0) {
-<a name="l14744"></a>14744             cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, nslits, slit_id);
-<a name="l14745"></a>14745             cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, nslits, slit_x);
-<a name="l14746"></a>14746             cpl_table_set(slits, <span class="stringliteral">"ytop"</span>, nslits, ytop[slit_id-1]);
-<a name="l14747"></a>14747             cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, nslits, slit_x);
-<a name="l14748"></a>14748             cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, nslits, ybottom[slit_id-1]);
-<a name="l14749"></a>14749             nslits++;
-<a name="l14750"></a>14750         }
-<a name="l14751"></a>14751     }
-<a name="l14752"></a>14752 
-<a name="l14753"></a>14753     <span class="keywordflow">return</span> slits;
-<a name="l14754"></a>14754 }
-<a name="l14755"></a>14755 
-<a name="l14756"></a>14756 
-<a name="l14780"></a><a class="code" href="group__moses.html#g9ed25f68a53a8daa15d3c986e7bdfa48">14780</a> cpl_table *<a class="code" href="group__moses.html#g9ed25f68a53a8daa15d3c986e7bdfa48">mos_load_slits_fors_lss</a>(cpl_propertylist *header)
-<a name="l14781"></a>14781 {
-<a name="l14782"></a>14782     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_slits_fors_lss"</span>;
-<a name="l14783"></a>14783 
-<a name="l14784"></a>14784     cpl_table  *slits;
-<a name="l14785"></a>14785     <span class="keywordtype">char</span>       *slit_name;
-<a name="l14786"></a>14786     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a>;
-<a name="l14787"></a>14787     <span class="keywordtype">int</span>         fors;
-<a name="l14788"></a>14788     <span class="keywordtype">int</span>         chip;
-<a name="l14789"></a>14789     <span class="keywordtype">float</span>       ytop;
-<a name="l14790"></a>14790     <span class="keywordtype">float</span>       ybottom;
-<a name="l14791"></a>14791 
-<a name="l14792"></a>14792     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l14793"></a>14793         <span class="keywordflow">return</span> NULL;
-<a name="l14794"></a>14794     }
-<a name="l14795"></a>14795 
-<a name="l14796"></a>14796     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l14797"></a>14797         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l14798"></a>14798         <span class="keywordflow">return</span> NULL;
-<a name="l14799"></a>14799     }
-<a name="l14800"></a>14800 
-<a name="l14801"></a>14801 
-<a name="l14802"></a>14802     <span class="comment">/*</span>
-<a name="l14803"></a>14803 <span class="comment">     * See if this is FORS1 or FORS2;</span>
-<a name="l14804"></a>14804 <span class="comment">     */</span>
-<a name="l14805"></a>14805 
-<a name="l14806"></a>14806     instrume = cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l14807"></a>14807 
-<a name="l14808"></a>14808     fors = 0;
-<a name="l14809"></a>14809     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l14810"></a>14810         fors = 1;
-<a name="l14811"></a>14811     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l14812"></a>14812         fors = 2;
-<a name="l14813"></a>14813 
-<a name="l14814"></a>14814     <span class="keywordflow">if</span> (fors == 0) {
-<a name="l14815"></a>14815         cpl_msg_error(func, <span class="stringliteral">"Wrong instrument found in FITS header: %s"</span>, 
-<a name="l14816"></a>14816                       instrume);
-<a name="l14817"></a>14817         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14818"></a>14818         <span class="keywordflow">return</span> NULL;
-<a name="l14819"></a>14819     }
-<a name="l14820"></a>14820 
-<a name="l14821"></a>14821     <span class="keywordflow">if</span> (fors == 1) {
-<a name="l14822"></a>14822         ytop = 109.94;
-<a name="l14823"></a>14823         ybottom = -109.94;
-<a name="l14824"></a>14824     }
-<a name="l14825"></a>14825     <span class="keywordflow">else</span> {
-<a name="l14826"></a>14826 
-<a name="l14827"></a>14827         <span class="comment">/*</span>
-<a name="l14828"></a>14828 <span class="comment">         * The master and slave chips can be identified by their positions</span>
-<a name="l14829"></a>14829 <span class="comment">         * in the chip array in the case of FORS2 data: chip = 2 is the </span>
-<a name="l14830"></a>14830 <span class="comment">         * master, chip = 1 is the slave.</span>
-<a name="l14831"></a>14831 <span class="comment">         */</span>
-<a name="l14832"></a>14832 
-<a name="l14833"></a>14833         chip = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET CHIP1 Y"</span>);
-<a name="l14834"></a>14834 
-<a name="l14835"></a>14835         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l14836"></a>14836             cpl_msg_error(func, <span class="stringliteral">"Missing keyword ESO DET CHIP1 Y "</span>
-<a name="l14837"></a>14837                           <span class="stringliteral">"in FITS header"</span>);
-<a name="l14838"></a>14838             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14839"></a>14839             <span class="keywordflow">return</span> NULL;
-<a name="l14840"></a>14840         }
-<a name="l14841"></a>14841 
-<a name="l14842"></a>14842         <span class="keywordflow">if</span> (chip != 1 && chip != 2) {
-<a name="l14843"></a>14843             cpl_msg_error(func, <span class="stringliteral">"Unexpected chip position in keyword "</span>
-<a name="l14844"></a>14844                           <span class="stringliteral">"ESO DET CHIP1 Y: %d"</span>, chip);
-<a name="l14845"></a>14845             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l14846"></a>14846             <span class="keywordflow">return</span> NULL;
-<a name="l14847"></a>14847         }
-<a name="l14848"></a>14848 
-<a name="l14849"></a>14849         <span class="keywordflow">if</span> (chip == 1) {
-<a name="l14850"></a>14850             ytop = 30.0;
-<a name="l14851"></a>14851             ybottom = -109.94;
-<a name="l14852"></a>14852         }
-<a name="l14853"></a>14853         <span class="keywordflow">else</span> {
-<a name="l14854"></a>14854             ytop = 109.94;
-<a name="l14855"></a>14855             ybottom = -20.0;
-<a name="l14856"></a>14856         }
-<a name="l14857"></a>14857     }
-<a name="l14858"></a>14858 
-<a name="l14859"></a>14859 
-<a name="l14860"></a>14860     slits = cpl_table_new(1);
-<a name="l14861"></a>14861     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l14862"></a>14862     cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l14863"></a>14863     cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l14864"></a>14864     cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l14865"></a>14865     cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l14866"></a>14866     cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>,    <span class="stringliteral">"pixel"</span>);
-<a name="l14867"></a>14867     cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>,    <span class="stringliteral">"pixel"</span>);
-<a name="l14868"></a>14868     cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l14869"></a>14869     cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l14870"></a>14870 
-<a name="l14871"></a>14871     slit_name = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, 
-<a name="l14872"></a>14872                                                     <span class="stringliteral">"ESO INS SLIT NAME"</span>);
-<a name="l14873"></a>14873 
-<a name="l14874"></a>14874     cpl_table_set(slits, <span class="stringliteral">"ytop"</span>, 0, ytop);
-<a name="l14875"></a>14875     cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, 0, ybottom);
-<a name="l14876"></a>14876 
-<a name="l14877"></a>14877     <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit0_3arcsec"</span>, 14)) {
-<a name="l14878"></a>14878         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 1);
-<a name="l14879"></a>14879         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, -0.075);
-<a name="l14880"></a>14880         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, 0.075);
-<a name="l14881"></a>14881     }
-<a name="l14882"></a>14882     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit0_4arcsec"</span>, 14)) {
-<a name="l14883"></a>14883         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 2);
-<a name="l14884"></a>14884         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, 5.895);
-<a name="l14885"></a>14885         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, 6.105);
-<a name="l14886"></a>14886     }
-<a name="l14887"></a>14887     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit0_5arcsec"</span>, 14)) {
-<a name="l14888"></a>14888         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 3);
-<a name="l14889"></a>14889         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, -6.135);
-<a name="l14890"></a>14890         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, -5.865);
-<a name="l14891"></a>14891     }
-<a name="l14892"></a>14892     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit0_7arcsec"</span>, 14)) {
-<a name="l14893"></a>14893         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 4);
-<a name="l14894"></a>14894         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, 11.815);
-<a name="l14895"></a>14895         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, 12.185);
-<a name="l14896"></a>14896     }
-<a name="l14897"></a>14897     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit1_0arcsec"</span>, 14)) {
-<a name="l14898"></a>14898         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 5);
-<a name="l14899"></a>14899         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, -12.265);
-<a name="l14900"></a>14900         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, -11.735);
-<a name="l14901"></a>14901     }
-<a name="l14902"></a>14902     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit1_3arcsec"</span>, 14)) {
-<a name="l14903"></a>14903         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 6);
-<a name="l14904"></a>14904         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, 17.655);
-<a name="l14905"></a>14905         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, 18.345);
-<a name="l14906"></a>14906     }
-<a name="l14907"></a>14907     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit1_6arcsec"</span>, 14)) {
-<a name="l14908"></a>14908         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 7);
-<a name="l14909"></a>14909         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, -18.425);
-<a name="l14910"></a>14910         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, -17.575);
-<a name="l14911"></a>14911     }
-<a name="l14912"></a>14912     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit2_0arcsec"</span>, 14)) {
-<a name="l14913"></a>14913         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 8);
-<a name="l14914"></a>14914         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, 23.475);
-<a name="l14915"></a>14915         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, 24.525);
-<a name="l14916"></a>14916     }
-<a name="l14917"></a>14917     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit2_5arcsec"</span>, 14)) {
-<a name="l14918"></a>14918         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 9);
-<a name="l14919"></a>14919         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, -24.66);
-<a name="l14920"></a>14920         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, -23.34);
-<a name="l14921"></a>14921     }
-<a name="l14922"></a>14922     <span class="keywordflow">else</span> {
-<a name="l14923"></a>14923         cpl_msg_error(func, <span class="stringliteral">"Invalid slit %s in keyword ESO INS SLIT NAME"</span>,
-<a name="l14924"></a>14924                       slit_name);
-<a name="l14925"></a>14925         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l14926"></a>14926         cpl_table_delete(slits);
-<a name="l14927"></a>14927         <span class="keywordflow">return</span> NULL;
-<a name="l14928"></a>14928     }
-<a name="l14929"></a>14929 
-<a name="l14930"></a>14930     <span class="keywordflow">return</span> slits;
-<a name="l14931"></a>14931 }
-<a name="l14932"></a>14932 
-<a name="l14933"></a>14933 
-<a name="l14948"></a><a class="code" href="group__moses.html#g75c3cb900989bb07dad294dd545021a6">14948</a> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g75c3cb900989bb07dad294dd545021a6">mos_get_gain_vimos</a>(cpl_propertylist *header)
-<a name="l14949"></a>14949 {
-<a name="l14950"></a>14950     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_get_gain_vimos"</span>;
-<a name="l14951"></a>14951 
-<a name="l14952"></a>14952     <span class="keywordtype">double</span> gain = -1.0;
-<a name="l14953"></a>14953 
-<a name="l14954"></a>14954 
-<a name="l14955"></a>14955     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l14956"></a>14956         <span class="keywordflow">return</span> gain;
-<a name="l14957"></a>14957 
-<a name="l14958"></a>14958     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l14959"></a>14959         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l14960"></a>14960         <span class="keywordflow">return</span> gain;
-<a name="l14961"></a>14961     }
-<a name="l14962"></a>14962 
-<a name="l14963"></a>14963     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l14964"></a>14964     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l14965"></a>14965         cpl_error_set_where(func);
-<a name="l14966"></a>14966         gain = -1.0;
-<a name="l14967"></a>14967     }
-<a name="l14968"></a>14968 
-<a name="l14969"></a>14969     <span class="keywordflow">return</span> gain;
-<a name="l14970"></a>14970 
-<a name="l14971"></a>14971 }
-<a name="l14972"></a>14972 
-<a name="l14973"></a>14973 
-<a name="l14993"></a><a class="code" href="group__moses.html#g3431a4557418ee0f8cd9beefd7153a98">14993</a> cpl_table *<a class="code" href="group__moses.html#g3431a4557418ee0f8cd9beefd7153a98">mos_load_slits_vimos</a>(cpl_propertylist *header)
-<a name="l14994"></a>14994 {
-<a name="l14995"></a>14995     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_slits_vimos"</span>;
-<a name="l14996"></a>14996 
-<a name="l14997"></a>14997     cpl_table *slits;
-<a name="l14998"></a>14998     <span class="keywordtype">char</span>       keyname[MAX_COLNAME];
-<a name="l14999"></a>14999     <span class="keywordtype">float</span>      slit_x;
-<a name="l15000"></a>15000     <span class="keywordtype">float</span>      slit_y;
-<a name="l15001"></a>15001     <span class="keywordtype">float</span>      dim_x;
-<a name="l15002"></a>15002     <span class="keywordtype">float</span>      dim_y;
-<a name="l15003"></a>15003     <span class="keywordtype">int</span>        nslits;
-<a name="l15004"></a>15004     <span class="keywordtype">int</span>        slit_id;
-<a name="l15005"></a>15005     <span class="keywordtype">int</span>        curved;
-<a name="l15006"></a>15006     <span class="keywordtype">int</span>        i;
-<a name="l15007"></a>15007 
-<a name="l15008"></a>15008 
-<a name="l15009"></a>15009     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l15010"></a>15010         <span class="keywordflow">return</span> NULL;
-<a name="l15011"></a>15011     }
-<a name="l15012"></a>15012 
-<a name="l15013"></a>15013     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l15014"></a>15014         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l15015"></a>15015         <span class="keywordflow">return</span> NULL;
-<a name="l15016"></a>15016     }
-<a name="l15017"></a>15017 
-<a name="l15018"></a>15018     nslits = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO INS SLIT NO"</span>);
-<a name="l15019"></a>15019 
-<a name="l15020"></a>15020     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l15021"></a>15021         cpl_error_set_where(func);
-<a name="l15022"></a>15022         <span class="keywordflow">return</span> NULL;
-<a name="l15023"></a>15023     }
-<a name="l15024"></a>15024 
-<a name="l15025"></a>15025     slits = cpl_table_new(nslits);
-<a name="l15026"></a>15026     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l15027"></a>15027     cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l15028"></a>15028     cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>,    CPL_TYPE_DOUBLE);
-<a name="l15029"></a>15029     cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l15030"></a>15030     cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);
-<a name="l15031"></a>15031     cpl_table_new_column(slits, <span class="stringliteral">"xwidth"</span>, CPL_TYPE_DOUBLE);
-<a name="l15032"></a>15032     cpl_table_new_column(slits, <span class="stringliteral">"ywidth"</span>, CPL_TYPE_DOUBLE);
-<a name="l15033"></a>15033     cpl_table_new_column(slits, <span class="stringliteral">"curved"</span>, CPL_TYPE_INT);
-<a name="l15034"></a>15034     cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>,    <span class="stringliteral">"pixel"</span>);
-<a name="l15035"></a>15035     cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>,    <span class="stringliteral">"pixel"</span>);
-<a name="l15036"></a>15036     cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l15037"></a>15037     cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l15038"></a>15038     cpl_table_set_column_unit(slits, <span class="stringliteral">"xwidth"</span>, <span class="stringliteral">"mm"</span>);
-<a name="l15039"></a>15039     cpl_table_set_column_unit(slits, <span class="stringliteral">"ywidth"</span>, <span class="stringliteral">"mm"</span>);
-<a name="l15040"></a>15040 
-<a name="l15041"></a>15041     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l15042"></a>15042         sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d ID"</span>, i+1);
-<a name="l15043"></a>15043         slit_id = cpl_propertylist_get_int(header, keyname);
-<a name="l15044"></a>15044         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l15045"></a>15045             cpl_error_set_where(func);
-<a name="l15046"></a>15046             <span class="keywordflow">return</span> NULL;
-<a name="l15047"></a>15047         }
-<a name="l15048"></a>15048         sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d X"</span>, i+1);
-<a name="l15049"></a>15049         slit_x = cpl_propertylist_get_double(header, keyname);
-<a name="l15050"></a>15050         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l15051"></a>15051             cpl_error_set_where(func);
-<a name="l15052"></a>15052             <span class="keywordflow">return</span> NULL;
-<a name="l15053"></a>15053         }
-<a name="l15054"></a>15054         sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d Y"</span>, i+1);
-<a name="l15055"></a>15055         slit_y = cpl_propertylist_get_double(header, keyname);
-<a name="l15056"></a>15056         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l15057"></a>15057             cpl_error_set_where(func);
-<a name="l15058"></a>15058             <span class="keywordflow">return</span> NULL;
-<a name="l15059"></a>15059         }
-<a name="l15060"></a>15060         sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d DIMX"</span>, i+1);
-<a name="l15061"></a>15061         dim_x = cpl_propertylist_get_double(header, keyname);
-<a name="l15062"></a>15062         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l15063"></a>15063             cpl_error_set_where(func);
-<a name="l15064"></a>15064             <span class="keywordflow">return</span> NULL;
-<a name="l15065"></a>15065         }
-<a name="l15066"></a>15066 
-<a name="l15067"></a>15067         sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d BEZIER DY"</span>, i+1);
-<a name="l15068"></a>15068         <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {
-<a name="l15069"></a>15069             curved = 1;
-<a name="l15070"></a>15070         }
-<a name="l15071"></a>15071         <span class="keywordflow">else</span> {
-<a name="l15072"></a>15072             sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d DIMY"</span>, i+1);
-<a name="l15073"></a>15073             curved = 0;
-<a name="l15074"></a>15074         }
-<a name="l15075"></a>15075         dim_y = cpl_propertylist_get_double(header, keyname);
-<a name="l15076"></a>15076         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l15077"></a>15077             cpl_error_set_where(func);
-<a name="l15078"></a>15078             <span class="keywordflow">return</span> NULL;
-<a name="l15079"></a>15079         }
-<a name="l15080"></a>15080 
-<a name="l15081"></a>15081         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, i, slit_id);
-<a name="l15082"></a>15082         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, i, slit_x - dim_x/2);
-<a name="l15083"></a>15083         cpl_table_set(slits, <span class="stringliteral">"ytop"</span>, i, slit_y);
-<a name="l15084"></a>15084         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, i, slit_x + dim_x/2);
-<a name="l15085"></a>15085         cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, i, slit_y);
-<a name="l15086"></a>15086         cpl_table_set(slits, <span class="stringliteral">"xwidth"</span>, i, dim_x);
-<a name="l15087"></a>15087         cpl_table_set(slits, <span class="stringliteral">"ywidth"</span>, i, dim_y);
-<a name="l15088"></a>15088         cpl_table_set_int(slits, <span class="stringliteral">"curved"</span>, i, curved);
-<a name="l15089"></a>15089     }
-<a name="l15090"></a>15090 
-<a name="l15091"></a>15091     <span class="keywordflow">return</span> slits;
-<a name="l15092"></a>15092 }
-<a name="l15093"></a>15093 
-<a name="l15094"></a>15094 
-<a name="l15104"></a><a class="code" href="group__moses.html#gf2c5b165c7c2c4be802c03ae59d1b8a9">15104</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gf2c5b165c7c2c4be802c03ae59d1b8a9">mos_check_multiplex</a>(cpl_table *slits)
-<a name="l15105"></a>15105 {
-<a name="l15106"></a>15106     cpl_propertylist *sort;
-<a name="l15107"></a>15107     <span class="keywordtype">int</span>               nrow;
-<a name="l15108"></a>15108     <span class="keywordtype">int</span>               i, multiplex, xprev, xcur;
-<a name="l15109"></a>15109     <span class="keywordtype">double</span>            prev, cur;
-<a name="l15110"></a>15110     <span class="keywordtype">double</span>            tolerance = 1.0; <span class="comment">// About spatially aligned slits (mm)</span>
-<a name="l15111"></a>15111 
-<a name="l15112"></a>15112 
-<a name="l15113"></a>15113     <span class="comment">/*</span>
-<a name="l15114"></a>15114 <span class="comment">     * Create an auxiliary column containing a sort of integer</span>
-<a name="l15115"></a>15115 <span class="comment">     * x coordinate of the slit, to guarantee that slits at the</span>
-<a name="l15116"></a>15116 <span class="comment">     * same spatial offset are recognised immediately as in spectral </span>
-<a name="l15117"></a>15117 <span class="comment">     * multiplexing.</span>
-<a name="l15118"></a>15118 <span class="comment">     */</span>
-<a name="l15119"></a>15119 
-<a name="l15120"></a>15120     sort = cpl_propertylist_new();
-<a name="l15121"></a>15121     cpl_propertylist_append_bool(sort, <span class="stringliteral">"xtop"</span>, 0);
-<a name="l15122"></a>15122     cpl_table_sort(slits, sort);
-<a name="l15123"></a>15123     cpl_propertylist_delete(sort);
-<a name="l15124"></a>15124 
-<a name="l15125"></a>15125     prev = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, 0, NULL);
-<a name="l15126"></a>15126     cpl_table_new_column(slits, <span class="stringliteral">"xind"</span>, CPL_TYPE_INT);
-<a name="l15127"></a>15127     cpl_table_set_int(slits, <span class="stringliteral">"xind"</span>, 0, prev);   <span class="comment">// cast to int is intentional</span>
-<a name="l15128"></a>15128     nrow = cpl_table_get_nrow(slits);
-<a name="l15129"></a>15129     <span class="keywordflow">for</span> (i = 1; i < nrow; i++) {
-<a name="l15130"></a>15130         cur = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);
-<a name="l15131"></a>15131         <span class="keywordflow">if</span> (fabs(prev - cur) > tolerance)
-<a name="l15132"></a>15132             prev = cur;
-<a name="l15133"></a>15133         cpl_table_set_int(slits, <span class="stringliteral">"xind"</span>, i, prev);
-<a name="l15134"></a>15134     }
-<a name="l15135"></a>15135 
-<a name="l15136"></a>15136     <span class="comment">/*</span>
-<a name="l15137"></a>15137 <span class="comment">     * Now sort according to increasing (integer) x positions, and when</span>
-<a name="l15138"></a>15138 <span class="comment">     * those are equal (multiplexed) according to the increasing y position.</span>
-<a name="l15139"></a>15139 <span class="comment">     */</span>
-<a name="l15140"></a>15140 
-<a name="l15141"></a>15141     sort = cpl_propertylist_new();
-<a name="l15142"></a>15142     cpl_propertylist_append_bool(sort, <span class="stringliteral">"xind"</span>, 0);
-<a name="l15143"></a>15143     cpl_propertylist_append_bool(sort, <span class="stringliteral">"ytop"</span>, 0);
-<a name="l15144"></a>15144     cpl_table_sort(slits, sort);
-<a name="l15145"></a>15145     cpl_propertylist_delete(sort);
-<a name="l15146"></a>15146 
-<a name="l15147"></a>15147     <span class="comment">/*</span>
-<a name="l15148"></a>15148 <span class="comment">     * Now assign to each slit its multiplex order.</span>
-<a name="l15149"></a>15149 <span class="comment">     */</span>
-<a name="l15150"></a>15150 
-<a name="l15151"></a>15151     multiplex = 0;
-<a name="l15152"></a>15152     cpl_table_new_column(slits, <span class="stringliteral">"multiplex"</span>, CPL_TYPE_INT);
-<a name="l15153"></a>15153     xprev = cpl_table_get_int(slits, <span class="stringliteral">"xind"</span>, 0, NULL);
-<a name="l15154"></a>15154     cpl_table_set_int(slits, <span class="stringliteral">"multiplex"</span>, 0, multiplex);
-<a name="l15155"></a>15155     nrow = cpl_table_get_nrow(slits);
-<a name="l15156"></a>15156     <span class="keywordflow">for</span> (i = 1; i < nrow; i++) {
-<a name="l15157"></a>15157         xcur = cpl_table_get_int(slits, <span class="stringliteral">"xind"</span>, i, NULL);
-<a name="l15158"></a>15158         <span class="keywordflow">if</span> (xcur == xprev) {
-<a name="l15159"></a>15159             multiplex++;
-<a name="l15160"></a>15160         }
-<a name="l15161"></a>15161         <span class="keywordflow">else</span> {
-<a name="l15162"></a>15162             xprev = xcur;
-<a name="l15163"></a>15163             multiplex = 0;
-<a name="l15164"></a>15164         }
-<a name="l15165"></a>15165         cpl_table_set_int(slits, <span class="stringliteral">"multiplex"</span>, i, multiplex);
-<a name="l15166"></a>15166     }
-<a name="l15167"></a>15167 
-<a name="l15168"></a>15168     cpl_table_save(slits, NULL, NULL, <span class="stringliteral">"multiplex.fits"</span>, CPL_IO_DEFAULT);
-<a name="l15169"></a>15169 
-<a name="l15170"></a>15170     cpl_table_erase_column(slits, <span class="stringliteral">"xind"</span>);
-<a name="l15171"></a>15171 
-<a name="l15172"></a>15172     <span class="keywordflow">return</span> 1 + cpl_table_get_column_max(slits, <span class="stringliteral">"multiplex"</span>);
-<a name="l15173"></a>15173 
-<a name="l15174"></a>15174 }
-<a name="l15175"></a>15175 
-<a name="l15176"></a>15176 
-<a name="l15203"></a><a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">15203</a> cpl_table *<a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(<span class="keyword">const</span> cpl_propertylist *header, 
-<a name="l15204"></a>15204                                     <span class="keywordtype">int</span> check_consistency)
-<a name="l15205"></a>15205 {
-<a name="l15206"></a>15206     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_overscans_vimos"</span>;
-<a name="l15207"></a>15207 
-<a name="l15208"></a>15208     <span class="keywordtype">int</span>        nx = 0;
-<a name="l15209"></a>15209     <span class="keywordtype">int</span>        ny = 0;
-<a name="l15210"></a>15210     <span class="keywordtype">int</span>        px = 0;
-<a name="l15211"></a>15211     <span class="keywordtype">int</span>        py = 0;
-<a name="l15212"></a>15212     <span class="keywordtype">int</span>        ox = 0;
-<a name="l15213"></a>15213     <span class="keywordtype">int</span>        oy = 0;
-<a name="l15214"></a>15214     <span class="keywordtype">int</span>        vx = 0;
-<a name="l15215"></a>15215     <span class="keywordtype">int</span>        vy = 0;
-<a name="l15216"></a>15216     <span class="keywordtype">int</span>        nrows;
-<a name="l15217"></a>15217     cpl_table *overscans;
-<a name="l15218"></a>15218 
-<a name="l15219"></a>15219 
-<a name="l15220"></a>15220     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l15221"></a>15221         cpl_msg_error(func, <span class="stringliteral">"Reset your error: %s"</span>, cpl_error_get_message());
-<a name="l15222"></a>15222         <span class="keywordflow">return</span> NULL;
-<a name="l15223"></a>15223     }
-<a name="l15224"></a>15224 
-<a name="l15225"></a>15225     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l15226"></a>15226         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l15227"></a>15227         <span class="keywordflow">return</span> NULL;
-<a name="l15228"></a>15228     }
-<a name="l15229"></a>15229 
-<a name="l15230"></a>15230     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"NAXIS1"</span>))
-<a name="l15231"></a>15231         nx = cpl_propertylist_get_int(header, <span class="stringliteral">"NAXIS1"</span>);
-<a name="l15232"></a>15232     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"NAXIS2"</span>))
-<a name="l15233"></a>15233         ny = cpl_propertylist_get_int(header, <span class="stringliteral">"NAXIS2"</span>);
-<a name="l15234"></a>15234     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>))
-<a name="l15235"></a>15235         px = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>);
-<a name="l15236"></a>15236     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>))
-<a name="l15237"></a>15237         py = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>);
-<a name="l15238"></a>15238     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>))
-<a name="l15239"></a>15239         ox = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>);
-<a name="l15240"></a>15240     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>))
-<a name="l15241"></a>15241         oy = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>);
-<a name="l15242"></a>15242     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 NX"</span>))
-<a name="l15243"></a>15243         vx = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 NX"</span>);
-<a name="l15244"></a>15244     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 NY"</span>))
-<a name="l15245"></a>15245         vy = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 NY"</span>);
-<a name="l15246"></a>15246 
-<a name="l15247"></a>15247     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l15248"></a>15248         cpl_msg_error(func, <span class="stringliteral">"Missing overscan keywords in header"</span>);
-<a name="l15249"></a>15249         cpl_error_set_where(func);
-<a name="l15250"></a>15250         <span class="keywordflow">return</span> NULL;
-<a name="l15251"></a>15251     }
-<a name="l15252"></a>15252 
-<a name="l15253"></a>15253     <span class="keywordflow">if</span> (px < 0 || py < 0 || ox < 0 || oy < 0) {
-<a name="l15254"></a>15254         cpl_msg_error(func, <span class="stringliteral">"Missing overscan keywords in header"</span>);
-<a name="l15255"></a>15255         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l15256"></a>15256         <span class="keywordflow">return</span> NULL;
-<a name="l15257"></a>15257     }
-<a name="l15258"></a>15258 
-<a name="l15259"></a>15259     <span class="keywordflow">if</span> ((px + vx + ox != nx) || (py + vy + oy != ny)) {
-<a name="l15260"></a>15260         <span class="keywordflow">if</span> (check_consistency) {
-<a name="l15261"></a>15261             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l15262"></a>15262             <span class="keywordflow">return</span> NULL;
-<a name="l15263"></a>15263         }
-<a name="l15264"></a>15264         <span class="keywordflow">else</span> {
-<a name="l15265"></a>15265             cpl_msg_debug(func, <span class="stringliteral">"Overscans description conflicts with "</span>
-<a name="l15266"></a>15266                           <span class="stringliteral">"reported image sizes, "</span>
-<a name="l15267"></a>15267                           <span class="stringliteral">"%d + %d + %d != %d or "</span>
-<a name="l15268"></a>15268                           <span class="stringliteral">"%d + %d + %d != %d"</span>,
-<a name="l15269"></a>15269                           px, vx, ox, nx,
-<a name="l15270"></a>15270                           py, vy, oy, ny);
-<a name="l15271"></a>15271         }
-<a name="l15272"></a>15272     }
-<a name="l15273"></a>15273 
-<a name="l15274"></a>15274     nrows = 0;
-<a name="l15275"></a>15275     <span class="keywordflow">if</span> (px > 0)
-<a name="l15276"></a>15276         nrows++;
-<a name="l15277"></a>15277     <span class="keywordflow">if</span> (ox > 0)
-<a name="l15278"></a>15278         nrows++;
-<a name="l15279"></a>15279     <span class="keywordflow">if</span> (py > 0)
-<a name="l15280"></a>15280         nrows++;
-<a name="l15281"></a>15281     <span class="keywordflow">if</span> (oy > 0)
-<a name="l15282"></a>15282         nrows++;
-<a name="l15283"></a>15283 
-<a name="l15284"></a>15284     <span class="keywordflow">if</span> (nrows > 2) {
-<a name="l15285"></a>15285         cpl_msg_error(func, <span class="stringliteral">"Unexpected overscan regions "</span>
-<a name="l15286"></a>15286                       <span class="stringliteral">"(both in X and Y direction)"</span>);
-<a name="l15287"></a>15287         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l15288"></a>15288         <span class="keywordflow">return</span> NULL;
-<a name="l15289"></a>15289     }
-<a name="l15290"></a>15290 
-<a name="l15291"></a>15291 
-<a name="l15292"></a>15292     <span class="comment">/*</span>
-<a name="l15293"></a>15293 <span class="comment">     * A row is added for the description of the valid region of the</span>
-<a name="l15294"></a>15294 <span class="comment">     * exposure the input header belongs to.</span>
-<a name="l15295"></a>15295 <span class="comment">     */</span>
-<a name="l15296"></a>15296 
-<a name="l15297"></a>15297     nrows++;
-<a name="l15298"></a>15298 
-<a name="l15299"></a>15299     overscans = cpl_table_new(nrows);
-<a name="l15300"></a>15300     cpl_table_new_column(overscans, <span class="stringliteral">"xlow"</span>, CPL_TYPE_INT);
-<a name="l15301"></a>15301     cpl_table_new_column(overscans, <span class="stringliteral">"ylow"</span>, CPL_TYPE_INT);
-<a name="l15302"></a>15302     cpl_table_new_column(overscans, <span class="stringliteral">"xhig"</span>, CPL_TYPE_INT);
-<a name="l15303"></a>15303     cpl_table_new_column(overscans, <span class="stringliteral">"yhig"</span>, CPL_TYPE_INT);
-<a name="l15304"></a>15304 
-<a name="l15305"></a>15305     nrows = 0;
-<a name="l15306"></a>15306 
-<a name="l15307"></a>15307     cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, px);
-<a name="l15308"></a>15308     cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, py);
-<a name="l15309"></a>15309     cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx - ox);
-<a name="l15310"></a>15310     cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny - oy);
-<a name="l15311"></a>15311     nrows++;
-<a name="l15312"></a>15312 
-<a name="l15313"></a>15313     <span class="keywordflow">if</span> (px > 0) {
-<a name="l15314"></a>15314         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, 0);
-<a name="l15315"></a>15315         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, 0);
-<a name="l15316"></a>15316         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, px);
-<a name="l15317"></a>15317         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny);
-<a name="l15318"></a>15318         nrows++;
-<a name="l15319"></a>15319     }
-<a name="l15320"></a>15320 
-<a name="l15321"></a>15321     <span class="keywordflow">if</span> (ox > 0) {
-<a name="l15322"></a>15322         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, nx - ox);
-<a name="l15323"></a>15323         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, 0);
-<a name="l15324"></a>15324         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx);
-<a name="l15325"></a>15325         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny);
-<a name="l15326"></a>15326         nrows++;
-<a name="l15327"></a>15327     }
-<a name="l15328"></a>15328 
-<a name="l15329"></a>15329     <span class="keywordflow">if</span> (py > 0) {
-<a name="l15330"></a>15330         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, 0);
-<a name="l15331"></a>15331         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, 0);
-<a name="l15332"></a>15332         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx);
-<a name="l15333"></a>15333         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, py);
-<a name="l15334"></a>15334         nrows++;
-<a name="l15335"></a>15335     }
-<a name="l15336"></a>15336 
-<a name="l15337"></a>15337     <span class="keywordflow">if</span> (oy > 0) {
-<a name="l15338"></a>15338         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, 0);
-<a name="l15339"></a>15339         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, ny - oy);
-<a name="l15340"></a>15340         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx);
-<a name="l15341"></a>15341         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny);
-<a name="l15342"></a>15342         nrows++;
-<a name="l15343"></a>15343     }
-<a name="l15344"></a>15344 
-<a name="l15345"></a>15345     <span class="keywordflow">return</span> overscans;
-<a name="l15346"></a>15346 
-<a name="l15347"></a>15347 }
-<a name="l15348"></a>15348 
-<a name="l15349"></a>15349 
-<a name="l15350"></a><a class="code" href="group__moses.html#g83424b665852cb22061bea76a664a730">15350</a> cpl_table *<a class="code" href="group__moses.html#g83424b665852cb22061bea76a664a730">mos_load_overscans_fors</a>(<span class="keyword">const</span> cpl_propertylist *header)
-<a name="l15351"></a>15351 {
-<a name="l15352"></a>15352     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_overscans_fors"</span>;
-<a name="l15353"></a>15353 
-<a name="l15354"></a>15354     <span class="keywordtype">int</span>        nports;
-<a name="l15355"></a>15355     <span class="keywordtype">int</span>        nx = 0;
-<a name="l15356"></a>15356     <span class="keywordtype">int</span>        ny = 0;
-<a name="l15357"></a>15357     <span class="keywordtype">int</span>        px = 0;
-<a name="l15358"></a>15358     <span class="keywordtype">int</span>        py = 0;
-<a name="l15359"></a>15359     <span class="keywordtype">int</span>        ox = 0;
-<a name="l15360"></a>15360     <span class="keywordtype">int</span>        oy = 0;
-<a name="l15361"></a>15361     <span class="keywordtype">int</span>        rebin;
-<a name="l15362"></a>15362     <span class="keywordtype">int</span>        nrows;
-<a name="l15363"></a>15363     cpl_table *overscans;
-<a name="l15364"></a>15364 
-<a name="l15365"></a>15365 
-<a name="l15366"></a>15366     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l15367"></a>15367         cpl_msg_error(func, <span class="stringliteral">"Reset your error: %s"</span>, cpl_error_get_message());
-<a name="l15368"></a>15368         <span class="keywordflow">return</span> NULL;
-<a name="l15369"></a>15369     }
-<a name="l15370"></a>15370 
-<a name="l15371"></a>15371     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l15372"></a>15372         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l15373"></a>15373         <span class="keywordflow">return</span> NULL;
-<a name="l15374"></a>15374     }
-<a name="l15375"></a>15375 
-<a name="l15376"></a>15376     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUTPUTS"</span>))
-<a name="l15377"></a>15377         nports = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUTPUTS"</span>);
-<a name="l15378"></a>15378 
-<a name="l15379"></a>15379     <span class="keywordflow">if</span> (nports == 4                                        && 
-<a name="l15380"></a>15380         cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>) &&
-<a name="l15381"></a>15381         cpl_propertylist_has(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>)) {
-<a name="l15382"></a>15382 
-<a name="l15383"></a>15383         rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l15384"></a>15384 
-<a name="l15385"></a>15385         overscans = cpl_table_new(3);
-<a name="l15386"></a>15386         cpl_table_new_column(overscans, <span class="stringliteral">"xlow"</span>, CPL_TYPE_INT);
-<a name="l15387"></a>15387         cpl_table_new_column(overscans, <span class="stringliteral">"ylow"</span>, CPL_TYPE_INT);
-<a name="l15388"></a>15388         cpl_table_new_column(overscans, <span class="stringliteral">"xhig"</span>, CPL_TYPE_INT);
-<a name="l15389"></a>15389         cpl_table_new_column(overscans, <span class="stringliteral">"yhig"</span>, CPL_TYPE_INT);
-<a name="l15390"></a>15390 
-<a name="l15391"></a>15391         px = 16 / rebin;
-<a name="l15392"></a>15392         ox = 16 / rebin;
-<a name="l15393"></a>15393         nx = 2080 / rebin;
-<a name="l15394"></a>15394         ny = 2048 / rebin;
-<a name="l15395"></a>15395         nrows = 0;
-<a name="l15396"></a>15396 
-<a name="l15397"></a>15397         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, px);
-<a name="l15398"></a>15398         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, py);
-<a name="l15399"></a>15399         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx - ox);
-<a name="l15400"></a>15400         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny - oy);
-<a name="l15401"></a>15401         nrows++;
-<a name="l15402"></a>15402 
-<a name="l15403"></a>15403         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, 0);
-<a name="l15404"></a>15404         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, 0);
-<a name="l15405"></a>15405         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, px);
-<a name="l15406"></a>15406         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny);
-<a name="l15407"></a>15407         nrows++;
-<a name="l15408"></a>15408 
-<a name="l15409"></a>15409         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, nx - ox);
-<a name="l15410"></a>15410         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, 0);
-<a name="l15411"></a>15411         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx);
-<a name="l15412"></a>15412         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny);
-<a name="l15413"></a>15413         nrows++;
-<a name="l15414"></a>15414     }
-<a name="l15415"></a>15415     <span class="keywordflow">else</span> {
-<a name="l15416"></a>15416         overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 0);
-<a name="l15417"></a>15417     }
-<a name="l15418"></a>15418 
-<a name="l15419"></a>15419     <span class="keywordflow">return</span> overscans;
-<a name="l15420"></a>15420 
-<a name="l15421"></a>15421 }
-<a name="l15422"></a>15422 
-<a name="l15454"></a><a class="code" href="group__moses.html#gd6f52daf658d36dcfdd4bddf72153b57">15454</a> <span class="preprocessor">#define READY 1</span>
-<a name="l15455"></a>15455 <span class="preprocessor"></span><span class="preprocessor">#ifdef READY</span>
-<a name="l15456"></a>15456 <span class="preprocessor"></span>
-<a name="l15457"></a><a class="code" href="group__moses.html#gbdc12afa2f53713a4151907ed3054dd7">15457</a> cpl_polynomial *<a class="code" href="group__moses.html#gbdc12afa2f53713a4151907ed3054dd7">mos_montecarlo_polyfit</a>(cpl_table *points, cpl_table *evaluate, 
-<a name="l15458"></a>15458                                        <span class="keywordtype">int</span> samples, <span class="keywordtype">int</span> order)
-<a name="l15459"></a>15459 {
-<a name="l15460"></a>15460 
-<a name="l15461"></a>15461     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_montecarlo_polyfit"</span>;
-<a name="l15462"></a>15462 
-<a name="l15463"></a>15463     cpl_polynomial *p;
-<a name="l15464"></a>15464     cpl_polynomial *q;
-<a name="l15465"></a>15465     cpl_vector     *listx;
-<a name="l15466"></a>15466     cpl_vector     *listy;
-<a name="l15467"></a>15467     <span class="keywordtype">double</span>          err;
-<a name="l15468"></a>15468     <span class="keywordtype">double</span>         *x;
-<a name="l15469"></a>15469     <span class="keywordtype">double</span>         *px;
-<a name="l15470"></a>15470     <span class="keywordtype">double</span>         *x_eval;
-<a name="l15471"></a>15471     <span class="keywordtype">double</span>         *px_eval;
-<a name="l15472"></a>15472     <span class="keywordtype">double</span>         *sigma;
-<a name="l15473"></a>15473     <span class="keywordtype">double</span>         *vy;
-<a name="l15474"></a>15474     <span class="keywordtype">double</span>         *dy;
-<a name="l15475"></a>15475     <span class="keywordtype">int</span>             npoints, nevaluate;
-<a name="l15476"></a>15476     <span class="keywordtype">int</span>             i, j;
-<a name="l15477"></a>15477 
-<a name="l15478"></a>15478 
-<a name="l15479"></a>15479     <span class="keywordflow">if</span> (points == NULL || evaluate == NULL) {
-<a name="l15480"></a>15480         cpl_error_set(func, CPL_ERROR_NULL_INPUT);
-<a name="l15481"></a>15481         <span class="keywordflow">return</span> NULL;
-<a name="l15482"></a>15482     }
-<a name="l15483"></a>15483 
-<a name="l15484"></a>15484     <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"x"</span>)) {
-<a name="l15485"></a>15485         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l15486"></a>15486         <span class="keywordflow">return</span> NULL;
-<a name="l15487"></a>15487     }
-<a name="l15488"></a>15488 
-<a name="l15489"></a>15489     <span class="keywordflow">if</span> (cpl_table_get_column_type(points, <span class="stringliteral">"x"</span>) != CPL_TYPE_DOUBLE) {
-<a name="l15490"></a>15490         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l15491"></a>15491         <span class="keywordflow">return</span> NULL;
-<a name="l15492"></a>15492     }
-<a name="l15493"></a>15493 
-<a name="l15494"></a>15494     <span class="keywordflow">if</span> (cpl_table_has_invalid(points, <span class="stringliteral">"x"</span>)) {
-<a name="l15495"></a>15495         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l15496"></a>15496         <span class="keywordflow">return</span> NULL;
-<a name="l15497"></a>15497     }
-<a name="l15498"></a>15498 
-<a name="l15499"></a>15499     <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"y"</span>)) {
-<a name="l15500"></a>15500         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l15501"></a>15501         <span class="keywordflow">return</span> NULL;
-<a name="l15502"></a>15502     }
-<a name="l15503"></a>15503 
-<a name="l15504"></a>15504     <span class="keywordflow">if</span> (cpl_table_get_column_type(points, <span class="stringliteral">"y"</span>) != CPL_TYPE_DOUBLE) {
-<a name="l15505"></a>15505         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l15506"></a>15506         <span class="keywordflow">return</span> NULL;
-<a name="l15507"></a>15507     }
-<a name="l15508"></a>15508 
-<a name="l15509"></a>15509     <span class="keywordflow">if</span> (cpl_table_has_invalid(points, <span class="stringliteral">"y"</span>)) {
-<a name="l15510"></a>15510         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l15511"></a>15511         <span class="keywordflow">return</span> NULL;
-<a name="l15512"></a>15512     }
-<a name="l15513"></a>15513 
-<a name="l15514"></a>15514     <span class="keywordflow">if</span> (cpl_table_has_column(points, <span class="stringliteral">"y_err"</span>)) {
-<a name="l15515"></a>15515 
-<a name="l15516"></a>15516         <span class="keywordflow">if</span> (cpl_table_get_column_type(points, <span class="stringliteral">"y_err"</span>) != CPL_TYPE_DOUBLE) {
-<a name="l15517"></a>15517             cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l15518"></a>15518             <span class="keywordflow">return</span> NULL;
-<a name="l15519"></a>15519         }
-<a name="l15520"></a>15520     
-<a name="l15521"></a>15521         <span class="keywordflow">if</span> (cpl_table_has_invalid(points, <span class="stringliteral">"y_err"</span>)) {
-<a name="l15522"></a>15522             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l15523"></a>15523             <span class="keywordflow">return</span> NULL;
-<a name="l15524"></a>15524         }
-<a name="l15525"></a>15525     }
-<a name="l15526"></a>15526 
-<a name="l15527"></a>15527     <span class="keywordflow">if</span> (!cpl_table_has_column(evaluate, <span class="stringliteral">"x"</span>)) {
-<a name="l15528"></a>15528         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l15529"></a>15529         <span class="keywordflow">return</span> NULL;
-<a name="l15530"></a>15530     }
-<a name="l15531"></a>15531 
-<a name="l15532"></a>15532     <span class="keywordflow">if</span> (cpl_table_get_column_type(evaluate, <span class="stringliteral">"x"</span>) != CPL_TYPE_DOUBLE) {
-<a name="l15533"></a>15533         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);
-<a name="l15534"></a>15534         <span class="keywordflow">return</span> NULL;
-<a name="l15535"></a>15535     }
-<a name="l15536"></a>15536 
-<a name="l15537"></a>15537     <span class="keywordflow">if</span> (cpl_table_has_invalid(evaluate, <span class="stringliteral">"x"</span>)) {
-<a name="l15538"></a>15538         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l15539"></a>15539         <span class="keywordflow">return</span> NULL;
-<a name="l15540"></a>15540     }
-<a name="l15541"></a>15541 
-<a name="l15542"></a>15542     <span class="keywordflow">if</span> (samples < 2 || order < 0) {
-<a name="l15543"></a>15543         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l15544"></a>15544         <span class="keywordflow">return</span> NULL;
-<a name="l15545"></a>15545     }
-<a name="l15546"></a>15546 
-<a name="l15547"></a>15547     npoints = cpl_table_get_nrow(points);
-<a name="l15548"></a>15548     listx = cpl_vector_wrap(npoints, cpl_table_get_data_double(points, <span class="stringliteral">"x"</span>));
-<a name="l15549"></a>15549     listy = cpl_vector_wrap(npoints, cpl_table_get_data_double(points, <span class="stringliteral">"y"</span>));
-<a name="l15550"></a>15550 
-<a name="l15551"></a>15551     p = cpl_polynomial_fit_1d_create(listx, listy, order, &err);
-<a name="l15552"></a>15552 
-<a name="l15553"></a>15553     <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"y_err"</span>)) {
-<a name="l15554"></a>15554         err = sqrt(err);
-<a name="l15555"></a>15555         cpl_table_new_column(points, <span class="stringliteral">"y_err"</span>, CPL_TYPE_DOUBLE);
-<a name="l15556"></a>15556         cpl_table_fill_column_window_double(points, <span class="stringliteral">"y_err"</span>, 0, npoints, err);
-<a name="l15557"></a>15557         cpl_msg_info(func, <span class="stringliteral">"Error column not found - set to %f\n"</span>, err);
-<a name="l15558"></a>15558     }
-<a name="l15559"></a>15559 
-<a name="l15560"></a>15560     <span class="comment">/*</span>
-<a name="l15561"></a>15561 <span class="comment">     * Create columns containing modeled values at each x</span>
-<a name="l15562"></a>15562 <span class="comment">     */</span>
-<a name="l15563"></a>15563 
-<a name="l15564"></a>15564     <span class="keywordflow">if</span> (cpl_table_has_column(points, <span class="stringliteral">"px"</span>))
-<a name="l15565"></a>15565         cpl_table_erase_column(points, <span class="stringliteral">"px"</span>);
-<a name="l15566"></a>15566     cpl_table_new_column(points, <span class="stringliteral">"px"</span>, CPL_TYPE_DOUBLE);
-<a name="l15567"></a>15567     cpl_table_fill_column_window_double(points, <span class="stringliteral">"px"</span>, 0, npoints, 0);
-<a name="l15568"></a>15568     x = cpl_table_get_data_double(points, <span class="stringliteral">"x"</span>);
-<a name="l15569"></a>15569     px = cpl_table_get_data_double(points, <span class="stringliteral">"px"</span>);
-<a name="l15570"></a>15570     <span class="keywordflow">for</span> (i = 0; i < npoints; i++)
-<a name="l15571"></a>15571         px[i] = cpl_polynomial_eval_1d(p, x[i], NULL);
-<a name="l15572"></a>15572 
-<a name="l15573"></a>15573     nevaluate = cpl_table_get_nrow(evaluate);
-<a name="l15574"></a>15574 
-<a name="l15575"></a>15575     <span class="keywordflow">if</span> (cpl_table_has_column(evaluate, <span class="stringliteral">"px"</span>))
-<a name="l15576"></a>15576         cpl_table_erase_column(evaluate, <span class="stringliteral">"px"</span>);
-<a name="l15577"></a>15577     cpl_table_new_column(evaluate, <span class="stringliteral">"px"</span>, CPL_TYPE_DOUBLE);
-<a name="l15578"></a>15578     cpl_table_fill_column_window_double(evaluate, <span class="stringliteral">"px"</span>, 0, nevaluate, 0);
-<a name="l15579"></a>15579     x_eval = cpl_table_get_data_double(evaluate, <span class="stringliteral">"x"</span>);
-<a name="l15580"></a>15580     px_eval = cpl_table_get_data_double(evaluate, <span class="stringliteral">"px"</span>);
-<a name="l15581"></a>15581     <span class="keywordflow">for</span> (i = 0; i < nevaluate; i++)
-<a name="l15582"></a>15582         px_eval[i] = cpl_polynomial_eval_1d(p, x_eval[i], NULL);
-<a name="l15583"></a>15583 
-<a name="l15584"></a>15584     <span class="comment">/*</span>
-<a name="l15585"></a>15585 <span class="comment">     * Initialise column with sigma</span>
-<a name="l15586"></a>15586 <span class="comment">     */</span>
-<a name="l15587"></a>15587 
-<a name="l15588"></a>15588     <span class="keywordflow">if</span> (cpl_table_has_column(evaluate, <span class="stringliteral">"sigma"</span>))
-<a name="l15589"></a>15589         cpl_table_erase_column(evaluate, <span class="stringliteral">"sigma"</span>);
-<a name="l15590"></a>15590     cpl_table_new_column(evaluate, <span class="stringliteral">"sigma"</span>, CPL_TYPE_DOUBLE);
-<a name="l15591"></a>15591     cpl_table_fill_column_window_double(evaluate, <span class="stringliteral">"sigma"</span>, 0, nevaluate, 0);
-<a name="l15592"></a>15592     sigma = cpl_table_get_data_double(evaluate, <span class="stringliteral">"sigma"</span>);
-<a name="l15593"></a>15593 
-<a name="l15594"></a>15594     <span class="comment">/*</span>
-<a name="l15595"></a>15595 <span class="comment">     * Compute varied y cordinates to fit</span>
-<a name="l15596"></a>15596 <span class="comment">     */</span>
-<a name="l15597"></a>15597 
-<a name="l15598"></a>15598     <span class="keywordflow">if</span> (cpl_table_has_column(points, <span class="stringliteral">"vy"</span>))
-<a name="l15599"></a>15599         cpl_table_erase_column(points, <span class="stringliteral">"vy"</span>);
-<a name="l15600"></a>15600     cpl_table_new_column(points, <span class="stringliteral">"vy"</span>, CPL_TYPE_DOUBLE);
-<a name="l15601"></a>15601     cpl_table_fill_column_window_double(points, <span class="stringliteral">"vy"</span>, 0, npoints, 0);
-<a name="l15602"></a>15602     vy = cpl_table_get_data_double(points, <span class="stringliteral">"vy"</span>);
-<a name="l15603"></a>15603     dy = cpl_table_get_data_double(points, <span class="stringliteral">"y_err"</span>);
-<a name="l15604"></a>15604     cpl_vector_unwrap(listy);
-<a name="l15605"></a>15605     listy = cpl_vector_wrap(npoints, vy);
-<a name="l15606"></a>15606 
-<a name="l15607"></a>15607     <span class="keywordflow">for</span> (i = 0; i < samples; i++) {
-<a name="l15608"></a>15608         <span class="keywordflow">for</span> (j = 0; j < npoints; j++)
-<a name="l15609"></a>15609             vy[j] = px[j] + dy[j] * <a class="code" href="group__moses.html#g88ec5d9d020d274b54bdce340eef46c6">mos_randg</a>(1);
-<a name="l15610"></a>15610         q = cpl_polynomial_fit_1d_create(listx, listy, order, NULL);
-<a name="l15611"></a>15611         <span class="keywordflow">for</span> (j = 0; j < nevaluate; j++)
-<a name="l15612"></a>15612             sigma[j] += fabs(px_eval[j] 
-<a name="l15613"></a>15613                       - cpl_polynomial_eval_1d(q, x_eval[j], NULL));
-<a name="l15614"></a>15614         cpl_polynomial_delete(q);
-<a name="l15615"></a>15615     }
-<a name="l15616"></a>15616 
-<a name="l15617"></a>15617     <span class="comment">/* </span>
-<a name="l15618"></a>15618 <span class="comment">     * Factor 1.25 to convert average deviation to sigma </span>
-<a name="l15619"></a>15619 <span class="comment">     */</span>
-<a name="l15620"></a>15620 
-<a name="l15621"></a>15621     cpl_table_multiply_scalar(evaluate, <span class="stringliteral">"sigma"</span>, 1.25);
-<a name="l15622"></a>15622     cpl_table_divide_scalar(evaluate, <span class="stringliteral">"sigma"</span>, samples);
-<a name="l15623"></a>15623 
-<a name="l15624"></a>15624     cpl_vector_unwrap(listx);
-<a name="l15625"></a>15625     cpl_vector_unwrap(listy);
-<a name="l15626"></a>15626 
-<a name="l15627"></a>15627     <span class="keywordflow">return</span> p;
-<a name="l15628"></a>15628 }
-<a name="l15629"></a>15629 
-<a name="l15630"></a>15630 <span class="preprocessor">#endif</span>
-<a name="l15631"></a>15631 <span class="preprocessor"></span>
-<a name="l15654"></a><a class="code" href="group__moses.html#g7557973371ca804e0fab92c40b833f3c">15654</a> cpl_error_code <a class="code" href="group__moses.html#g7557973371ca804e0fab92c40b833f3c">mos_randomise_image</a>(cpl_image *image, <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>, 
-<a name="l15655"></a>15655                                    <span class="keywordtype">double</span> gain, <span class="keywordtype">double</span> bias)
-<a name="l15656"></a>15656 {
-<a name="l15657"></a>15657     <span class="keywordtype">float</span> *data;
-<a name="l15658"></a>15658     <span class="keywordtype">int</span>    npix, i;
-<a name="l15659"></a>15659 
-<a name="l15660"></a>15660 
-<a name="l15661"></a>15661     <span class="keywordflow">if</span> (image == NULL)
-<a name="l15662"></a>15662         <span class="keywordflow">return</span> cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
-<a name="l15663"></a>15663 
-<a name="l15664"></a>15664     <span class="keywordflow">if</span> (ron < 0.0 || gain <= FLT_EPSILON)
-<a name="l15665"></a>15665         <span class="keywordflow">return</span> cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
-<a name="l15666"></a>15666 
-<a name="l15667"></a>15667     data = cpl_image_get_data_float(image);
-<a name="l15668"></a>15668     npix = cpl_image_get_size_x(image) * cpl_image_get_size_y(image);
-<a name="l15669"></a>15669     ron *= ron;
-<a name="l15670"></a>15670 
-<a name="l15671"></a>15671     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l15672"></a>15672         <span class="keywordflow">if</span> (data[i] < bias) {
-<a name="l15673"></a>15673             data[i] += sqrt(ron) * <a class="code" href="group__moses.html#g88ec5d9d020d274b54bdce340eef46c6">mos_randg</a>(1);
-<a name="l15674"></a>15674         }
-<a name="l15675"></a>15675         <span class="keywordflow">else</span> {
-<a name="l15676"></a>15676             data[i] += sqrt(ron + (data[i] - bias) / gain) * <a class="code" href="group__moses.html#g88ec5d9d020d274b54bdce340eef46c6">mos_randg</a>(1);
-<a name="l15677"></a>15677         }
-<a name="l15678"></a>15678     }
-<a name="l15679"></a>15679 
-<a name="l15680"></a>15680     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l15681"></a>15681 }
-<a name="l15682"></a>15682 
-<a name="l15683"></a>15683 
-<a name="l15698"></a><a class="code" href="group__moses.html#gaabac93f2fab16b6c268e5ab494a7238">15698</a> cpl_error_code <a class="code" href="group__moses.html#gaabac93f2fab16b6c268e5ab494a7238">mos_refmask_find_gaps</a>(cpl_mask  *refmask,
-<a name="l15699"></a>15699                                      cpl_image *master_flat,
-<a name="l15700"></a>15700                                      <span class="keywordtype">double</span>     level)
-<a name="l15701"></a>15701 {
-<a name="l15702"></a>15702     <span class="keywordtype">int</span>          nx     = cpl_mask_get_size_x(refmask);
-<a name="l15703"></a>15703     <span class="keywordtype">int</span>          ny     = cpl_mask_get_size_y(refmask);
-<a name="l15704"></a>15704 
-<a name="l15705"></a>15705     <span class="keywordtype">int</span>        * xpos   = cpl_calloc(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>), ny);
-<a name="l15706"></a>15706 
-<a name="l15707"></a>15707     cpl_image  * filtered = cpl_image_duplicate(master_flat);
-<a name="l15708"></a>15708     cpl_mask   * kernel = cpl_mask_new(9, 9);
-<a name="l15709"></a>15709     cpl_vector * v      = cpl_vector_new(ny);
-<a name="l15710"></a>15710     cpl_vector * truev;
-<a name="l15711"></a>15711     <span class="keywordtype">int</span>          nvalid = 0;
-<a name="l15712"></a>15712     <span class="keywordtype">double</span>     * flats  = cpl_vector_get_data(v);
-<a name="l15713"></a>15713 
-<a name="l15714"></a>15714     <span class="keywordtype">double</span>       median, stdev, delta;
-<a name="l15715"></a>15715 
-<a name="l15716"></a>15716     <span class="keywordtype">int</span>          i, kill;
-<a name="l15717"></a>15717 
-<a name="l15718"></a>15718 
-<a name="l15719"></a>15719     cpl_mask_not(kernel);
-<a name="l15720"></a>15720     cpl_image_filter_mask(filtered, master_flat, kernel, 
-<a name="l15721"></a>15721                           CPL_FILTER_MEDIAN, CPL_BORDER_COPY);
-<a name="l15722"></a>15722     cpl_mask_delete(kernel);
-<a name="l15723"></a>15723 
-<a name="l15724"></a>15724     <span class="keywordflow">for</span> (i = 1; i <= ny; i++) {
-<a name="l15725"></a>15725         <span class="keywordtype">int</span> j = 0;
-<a name="l15726"></a>15726 
-<a name="l15727"></a>15727         <span class="keywordflow">do</span> j++;
-<a name="l15728"></a>15728         <span class="keywordflow">while</span> (!cpl_mask_get(refmask, j, i) && j < nx);
-<a name="l15729"></a>15729 
-<a name="l15730"></a>15730         <span class="keywordflow">if</span> (j < nx) {
-<a name="l15731"></a>15731             <span class="keywordtype">int</span> rejected;
-<a name="l15732"></a>15732 
-<a name="l15733"></a>15733             xpos[i - 1] = j;
-<a name="l15734"></a>15734             flats[nvalid] = cpl_image_get(filtered, j, i, &rejected);
-<a name="l15735"></a>15735             nvalid++;
-<a name="l15736"></a>15736         }
-<a name="l15737"></a>15737         <span class="keywordflow">else</span> {
-<a name="l15738"></a>15738             xpos[i - 1] = -1;
-<a name="l15739"></a>15739         }
-<a name="l15740"></a>15740     }
-<a name="l15741"></a>15741 
-<a name="l15742"></a>15742     <span class="keywordflow">if</span> (nvalid == 0)
-<a name="l15743"></a>15743         <span class="keywordflow">return</span> cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l15744"></a>15744 
-<a name="l15745"></a>15745     truev = cpl_vector_wrap(nvalid, flats);
-<a name="l15746"></a>15746 
-<a name="l15747"></a>15747     median = cpl_vector_get_median(truev);
-<a name="l15748"></a>15748 
-<a name="l15749"></a>15749     <span class="keywordflow">if</span> (level < 0.0)
-<a name="l15750"></a>15750        stdev = cpl_vector_get_stdev(truev);
-<a name="l15751"></a>15751 
-<a name="l15752"></a>15752     cpl_vector_unwrap(truev);
-<a name="l15753"></a>15753     cpl_vector_delete(v);
-<a name="l15754"></a>15754 
-<a name="l15755"></a>15755     <span class="keywordflow">for</span> (i = 1; i <= ny; i++) {
-<a name="l15756"></a>15756         <span class="keywordflow">if</span> (xpos[i - 1] > 0) {
-<a name="l15757"></a>15757             <span class="keywordtype">int</span>    rejected;
-<a name="l15758"></a>15758             <span class="keywordtype">double</span> kappa = 1.5;
-<a name="l15759"></a>15759 
-<a name="l15760"></a>15760             delta = cpl_image_get(filtered, xpos[i - 1], i, &rejected) - median;
-<a name="l15761"></a>15761 
-<a name="l15762"></a>15762             <span class="keywordflow">if</span> (level < 0.0)
-<a name="l15763"></a>15763                 kill = fabs(delta) > stdev * kappa;
-<a name="l15764"></a>15764             <span class="keywordflow">else</span>
-<a name="l15765"></a>15765                 kill = delta < level;
-<a name="l15766"></a>15766 
-<a name="l15767"></a>15767             <span class="keywordflow">if</span> (kill) {
-<a name="l15768"></a>15768                 <span class="keywordtype">int</span> j = 0;
-<a name="l15769"></a>15769             
-<a name="l15770"></a>15770                 <span class="keywordflow">while</span> (cpl_mask_get(refmask, xpos[i - 1] + j, i)) {
-<a name="l15771"></a>15771                     cpl_mask_set(refmask, xpos[i - 1] + j, i, CPL_BINARY_0);
-<a name="l15772"></a>15772                     j++;
-<a name="l15773"></a>15773                 }
-<a name="l15774"></a>15774             }
-<a name="l15775"></a>15775         }
-<a name="l15776"></a>15776     }
-<a name="l15777"></a>15777 
-<a name="l15778"></a>15778     cpl_image_delete(filtered);
-<a name="l15779"></a>15779     cpl_free(xpos);
-<a name="l15780"></a>15780 
-<a name="l15781"></a>15781     <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l15782"></a>15782 }
-<a name="l15783"></a>15783 
-<a name="l15791"></a><a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">15791</a> cpl_error_code <a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(cpl_image * image)
-<a name="l15792"></a>15792 {
-<a name="l15793"></a>15793     <span class="keywordtype">int</span>     nx    = cpl_image_get_size_x(image);
-<a name="l15794"></a>15794     <span class="keywordtype">int</span>     ny    = cpl_image_get_size_y(image);
-<a name="l15795"></a>15795     <span class="keywordtype">int</span>     npix  = nx * ny;
-<a name="l15796"></a>15796     <span class="keywordtype">float</span> * sdata = cpl_image_get_data_float(image);
-<a name="l15797"></a>15797 
-<a name="l15798"></a>15798     <span class="keywordtype">int</span> count, i, j, k;
-<a name="l15799"></a>15799 
-<a name="l15800"></a>15800     <span class="comment">/*</span>
-<a name="l15801"></a>15801 <span class="comment">     * This is used to avoid saturation level coded with pixel value zero</span>
-<a name="l15802"></a>15802 <span class="comment">     * To make it more robust against random 0.0 values, check that also</span>
-<a name="l15803"></a>15803 <span class="comment">     * next pixel along the spatial direction is 0.0.</span>
-<a name="l15804"></a>15804 <span class="comment">     */</span>
-<a name="l15805"></a>15805 
-<a name="l15806"></a>15806     <span class="keywordflow">for</span> (i = 0; i < npix - nx; i++)
-<a name="l15807"></a>15807         <span class="keywordflow">if</span> (sdata[i] == 0.0 && sdata[i + nx] == 0.0)
-<a name="l15808"></a>15808             sdata[i] = 65535.0;
-<a name="l15809"></a>15809 
-<a name="l15810"></a>15810     <span class="keywordflow">for</span> (i = npix - nx; i < npix; i++)
-<a name="l15811"></a>15811         <span class="keywordflow">if</span> (sdata[i] == 0.0) 
-<a name="l15812"></a>15812             sdata[i] = 65535.0;
-<a name="l15813"></a>15813 
-<a name="l15814"></a>15814     <span class="comment">/*</span>
-<a name="l15815"></a>15815 <span class="comment">     * This is a dirty trick to overcome saturations (making up a false</span>
-<a name="l15816"></a>15816 <span class="comment">     * tip on their flat tops). This should be useless with a better</span>
-<a name="l15817"></a>15817 <span class="comment">     * peak detection algorithm.</span>
-<a name="l15818"></a>15818 <span class="comment">     */</span>
-<a name="l15819"></a>15819 
-<a name="l15820"></a>15820     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l15821"></a>15821         <span class="keywordflow">if</span> (sdata[i] >= 65535.0) {
-<a name="l15822"></a>15822             count = 0;
-<a name="l15823"></a>15823             <span class="keywordflow">for</span> (j = i; j < npix; j++) {
-<a name="l15824"></a>15824                 <span class="keywordflow">if</span> (sdata[j] < 65535.0) {
-<a name="l15825"></a>15825                     <span class="keywordflow">break</span>;
-<a name="l15826"></a>15826                 }
-<a name="l15827"></a>15827                 <span class="keywordflow">else</span> {
-<a name="l15828"></a>15828                     count++;
-<a name="l15829"></a>15829                 }
-<a name="l15830"></a>15830             }
-<a name="l15831"></a>15831             <span class="keywordflow">if</span> (count < 30 && count > 2) {
-<a name="l15832"></a>15832                 <span class="keywordflow">for</span> (j = i; j < i + count/2; j++)
-<a name="l15833"></a>15833                     sdata[j] = sdata[i] + 1000.0 * (j - i);
-<a name="l15834"></a>15834                 <span class="keywordflow">if</span> (count % 2 != 0) {
-<a name="l15835"></a>15835                     sdata[j] = sdata[j-1] + 1000.0;
-<a name="l15836"></a>15836                     j++;
-<a name="l15837"></a>15837                 }
-<a name="l15838"></a>15838                 <span class="keywordflow">for</span> (k = j; k <= i + count; k++)
-<a name="l15839"></a>15839                     sdata[k] = sdata[i] - 1000.0 * (k - i - count);
-<a name="l15840"></a>15840                 i = k;
-<a name="l15841"></a>15841             }
-<a name="l15842"></a>15842         }
-<a name="l15843"></a>15843     }
-<a name="l15844"></a>15844 
-<a name="l15845"></a>15845     <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l15846"></a>15846 }
-<a name="l15847"></a>15847 
-<a name="l15848"></a>15848 
-<a name="l15857"></a><a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">15857</a> cpl_error_code <a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(cpl_image * image)
-<a name="l15858"></a>15858 {
-<a name="l15859"></a>15859     <span class="comment">/*</span>
-<a name="l15860"></a>15860 <span class="comment">     * Create and subtract background</span>
-<a name="l15861"></a>15861 <span class="comment">     */</span>
-<a name="l15862"></a>15862 
-<a name="l15863"></a>15863     cpl_image * bimage = <a class="code" href="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a">mos_arc_background</a>(image, 15, 15);
-<a name="l15864"></a>15864     cpl_image_subtract(image, bimage);
-<a name="l15865"></a>15865     cpl_image_delete(bimage);
-<a name="l15866"></a>15866 
-<a name="l15867"></a>15867     <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l15868"></a>15868 }
-<a name="l15869"></a>15869 
-<a name="l15870"></a>15870 
-<a name="l15887"></a><a class="code" href="group__moses.html#g621083edda685c07a318aa94f53bce6f">15887</a> cpl_error_code <a class="code" href="group__moses.html#g621083edda685c07a318aa94f53bce6f">mos_object_intersect</a>(cpl_table **slitss, cpl_table *origslits, 
-<a name="l15888"></a>15888                                     <span class="keywordtype">int</span> nscience, <span class="keywordtype">float</span> tolerance)
-<a name="l15889"></a>15889 {
-<a name="l15890"></a>15890     <span class="keywordtype">int</span> i, j;
-<a name="l15891"></a>15891 
-<a name="l15892"></a>15892     cpl_table *summary;
-<a name="l15893"></a>15893     <span class="keywordtype">int</span> summary_nobjs = 0;
-<a name="l15894"></a>15894  
-<a name="l15895"></a>15895     <span class="keywordtype">int</span> nobjs;
-<a name="l15896"></a>15896 
-<a name="l15897"></a>15897     <span class="keywordtype">int</span> nmatches;
-<a name="l15898"></a>15898     <span class="keywordtype">int</span> nslits = cpl_table_get_nrow(slitss[0]);
-<a name="l15899"></a>15899 
-<a name="l15900"></a>15900     <span class="keywordtype">int</span> maxobjs;
-<a name="l15901"></a>15901     <span class="keywordtype">int</span> k, m;
-<a name="l15902"></a>15902     <span class="keywordtype">int</span> nstokes, sstokes;
-<a name="l15903"></a>15903 
-<a name="l15904"></a>15904     cpl_table **work;
-<a name="l15905"></a>15905 
-<a name="l15906"></a>15906     work = (cpl_table **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_table *) * nscience);
-<a name="l15907"></a>15907 
-<a name="l15908"></a>15908 
-<a name="l15909"></a>15909     <span class="comment">/* </span>
-<a name="l15910"></a>15910 <span class="comment">     * First we build a table listing the offset of each detected</span>
-<a name="l15911"></a>15911 <span class="comment">     * object at each angle and each beam, from the bottom of each </span>
-<a name="l15912"></a>15912 <span class="comment">     * slit spectrum, and the pair that slit spectrum belongs to.</span>
-<a name="l15913"></a>15913 <span class="comment">     * This summary table will have as many rows as objects found </span>
-<a name="l15914"></a>15914 <span class="comment">     * in total at all angles.</span>
-<a name="l15915"></a>15915 <span class="comment">     */</span>
-<a name="l15916"></a>15916 
-<a name="l15917"></a>15917     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {
-<a name="l15918"></a>15918         <span class="keywordtype">int</span> c_nobjs = <a class="code" href="group__moses.html#g7a41fa707f51ab0d55150ed8c4b19657">mos_get_nobjects</a>(slitss[j]);
-<a name="l15919"></a>15919         <span class="keywordflow">if</span> (!c_nobjs) 
-<a name="l15920"></a>15920             <span class="keywordflow">return</span> cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l15921"></a>15921         summary_nobjs += c_nobjs;
-<a name="l15922"></a>15922     }
-<a name="l15923"></a>15923 
-<a name="l15924"></a>15924     summary = cpl_table_new(summary_nobjs);
-<a name="l15925"></a>15925 
-<a name="l15926"></a>15926     cpl_table_new_column(summary, <span class="stringliteral">"offset"</span>, CPL_TYPE_DOUBLE);
-<a name="l15927"></a>15927     cpl_table_new_column(summary, <span class="stringliteral">"pair"</span>,   CPL_TYPE_INT);
-<a name="l15928"></a>15928     cpl_table_new_column(summary, <span class="stringliteral">"absolute"</span>, CPL_TYPE_DOUBLE);
-<a name="l15929"></a>15929     cpl_table_new_column(summary, <span class="stringliteral">"pos"</span>, CPL_TYPE_DOUBLE);
-<a name="l15930"></a>15930 
-<a name="l15931"></a>15931     <span class="comment">/*</span>
-<a name="l15932"></a>15932 <span class="comment">     * Fill the summary table with data from all objects:</span>
-<a name="l15933"></a>15933 <span class="comment">     */</span>
-<a name="l15934"></a>15934 
-<a name="l15935"></a>15935     nobjs = 0;
-<a name="l15936"></a>15936 
-<a name="l15937"></a>15937     <span class="comment">/* Loop on all object tables (one for each angle) */</span>
-<a name="l15938"></a>15938     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {
-<a name="l15939"></a>15939         <span class="keywordtype">int</span> c_maxobjs = <a class="code" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">mos_get_maxobjs_per_slit</a>(slitss[j]);
-<a name="l15940"></a>15940 
-<a name="l15941"></a>15941         <span class="comment">/* Loop on all slits found on first - i.e., ALL - object table */</span>
-<a name="l15942"></a>15942         <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {
-<a name="l15943"></a>15943 
-<a name="l15944"></a>15944             <span class="comment">/* Loop on all objects found on each object table */</span>
-<a name="l15945"></a>15945             <span class="keywordflow">for</span> (m = 0; m < c_maxobjs; m++) {
-<a name="l15946"></a>15946                 <span class="keywordtype">int</span> null;
-<a name="l15947"></a>15947                 <span class="keywordtype">char</span> *name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);
-<a name="l15948"></a>15948                 <span class="keywordtype">double</span> obj = cpl_table_get_double(slitss[j], name, k, &null);
-<a name="l15949"></a>15949                 <span class="keywordtype">int</span> pos;
-<a name="l15950"></a>15950                 <span class="keywordtype">int</span> pair;
-<a name="l15951"></a>15951 
-<a name="l15952"></a>15952                 cpl_free(name);
-<a name="l15953"></a>15953 
-<a name="l15954"></a>15954                 <span class="keywordflow">if</span> (null) 
-<a name="l15955"></a>15955                     <span class="keywordflow">break</span>;  <span class="comment">/* No object #m+1 in this slit - go to next slit */</span>
-<a name="l15956"></a>15956 
-<a name="l15957"></a>15957                 <span class="comment">/*</span>
-<a name="l15958"></a>15958 <span class="comment">                 * Copy necessary object data to summary table. Note </span>
-<a name="l15959"></a>15959 <span class="comment">                 * that the absolute object position (row) in the</span>
-<a name="l15960"></a>15960 <span class="comment">                 * rectified image is made relative to the bottom</span>
-<a name="l15961"></a>15961 <span class="comment">                 * position (row) of the current slit.</span>
-<a name="l15962"></a>15962 <span class="comment">                 */</span> 
-<a name="l15963"></a>15963         
-<a name="l15964"></a>15964                 pos  = cpl_table_get_int(slitss[j], <span class="stringliteral">"position"</span>, k, &null);
-<a name="l15965"></a>15965                 pair = cpl_table_get_int(slitss[j], <span class="stringliteral">"pair_id"</span>, k, &null);
-<a name="l15966"></a>15966                 cpl_table_set(summary, <span class="stringliteral">"absolute"</span>, nobjs, obj);
-<a name="l15967"></a>15967                 cpl_table_set(summary, <span class="stringliteral">"pos"</span>, nobjs, pos);
-<a name="l15968"></a>15968                 cpl_table_set(summary, <span class="stringliteral">"offset"</span>, nobjs, obj - pos);
-<a name="l15969"></a>15969                 cpl_table_set(summary, <span class="stringliteral">"pair"</span>, nobjs, pair);
-<a name="l15970"></a>15970 
-<a name="l15971"></a>15971                 nobjs++;
-<a name="l15972"></a>15972             }
-<a name="l15973"></a>15973         }
-<a name="l15974"></a>15974     }
-<a name="l15975"></a>15975 
-<a name="l15976"></a>15976 <span class="comment">//    cpl_table_save(summary, NULL, NULL, "susu.fits", CPL_IO_DEFAULT);</span>
-<a name="l15977"></a>15977 
-<a name="l15978"></a>15978     <span class="comment">/* </span>
-<a name="l15979"></a>15979 <span class="comment">     * Perform the intersection: what are the objects belonging</span>
-<a name="l15980"></a>15980 <span class="comment">     * to the same slit (same pair ordinary + extraordinary) which </span>
-<a name="l15981"></a>15981 <span class="comment">     * are observed at the same offset at all angles? Those are</span>
-<a name="l15982"></a>15982 <span class="comment">     * the polarimetric objects.</span>
-<a name="l15983"></a>15983 <span class="comment">     */</span>
-<a name="l15984"></a>15984 
-<a name="l15985"></a>15985     nmatches = 0;
-<a name="l15986"></a>15986     maxobjs = <a class="code" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">mos_get_maxobjs_per_slit</a>(slitss[0]);
-<a name="l15987"></a>15987 
-<a name="l15988"></a>15988     <span class="comment">/*</span>
-<a name="l15989"></a>15989 <span class="comment">     * We loop on the objects of the first-angle object table as </span>
-<a name="l15990"></a>15990 <span class="comment">     * reference, and check whether those objects are present also</span>
-<a name="l15991"></a>15991 <span class="comment">     * at *all* other angles. Note that the loop advances by pairs.</span>
-<a name="l15992"></a>15992 <span class="comment">     * If the top (k = 0) slit spectrum is not an ordinary beam,</span>
-<a name="l15993"></a>15993 <span class="comment">     * it is ignored. The loop advances by pairs, starting at the</span>
-<a name="l15994"></a>15994 <span class="comment">     * first complete pair. It is implicitely assumed that the </span>
-<a name="l15995"></a>15995 <span class="comment">     * slit spectrum on top is always from the ordinary beam, and </span>
-<a name="l15996"></a>15996 <span class="comment">     * the spectrum below (k+1) its extraordinary match.</span>
-<a name="l15997"></a>15997 <span class="comment">     */</span>
-<a name="l15998"></a>15998 
-<a name="l15999"></a>15999     <span class="keywordflow">for</span> (k = 0; k < nslits; k+=2) {
-<a name="l16000"></a>16000         <span class="keywordtype">int</span> slitmatches = 0;
-<a name="l16001"></a>16001 
-<a name="l16002"></a>16002         <span class="keywordflow">if</span> (k == 0) {
-<a name="l16003"></a>16003             <span class="keywordflow">if</span> (cpl_table_get_int(slitss[0], <span class="stringliteral">"pair_id"</span>,  0, NULL) !=
-<a name="l16004"></a>16004                 cpl_table_get_int(slitss[0], <span class="stringliteral">"pair_id"</span>,  1, NULL)) {
-<a name="l16005"></a>16005 
-<a name="l16006"></a>16006                 <span class="comment">/*</span>
-<a name="l16007"></a>16007 <span class="comment">                 * This is not an ordinary beam - advance to next slit.</span>
-<a name="l16008"></a>16008 <span class="comment">                 */</span>
-<a name="l16009"></a>16009 
-<a name="l16010"></a>16010                 k++;
-<a name="l16011"></a>16011                 <span class="keywordflow">continue</span>;
-<a name="l16012"></a>16012             }
-<a name="l16013"></a>16013         }
-<a name="l16014"></a>16014 
-<a name="l16015"></a>16015         <span class="keywordflow">for</span> (m = 0; m < maxobjs; m++) {
-<a name="l16016"></a>16016             <span class="keywordtype">int</span> null;
-<a name="l16017"></a>16017             <span class="keywordtype">char</span> *name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);
-<a name="l16018"></a>16018             <span class="keywordtype">double</span> obj = cpl_table_get_double(slitss[0], name, k, &null);
-<a name="l16019"></a>16019             <span class="keywordtype">double</span> pos;
-<a name="l16020"></a>16020             <span class="keywordtype">int</span> pair;
-<a name="l16021"></a>16021 
-<a name="l16022"></a>16022             <span class="keywordtype">char</span> *name_obj = NULL;
-<a name="l16023"></a>16023             <span class="keywordtype">char</span> *name_start = NULL;
-<a name="l16024"></a>16024             <span class="keywordtype">char</span> *name_end = NULL;
-<a name="l16025"></a>16025             <span class="keywordtype">char</span> *name_row = NULL;
-<a name="l16026"></a>16026             <span class="keywordtype">char</span> *name_row_s = NULL;
-<a name="l16027"></a>16027 
-<a name="l16028"></a>16028             <span class="keywordtype">char</span> *name_start_o = NULL;
-<a name="l16029"></a>16029             <span class="keywordtype">char</span> *name_end_o = NULL;
-<a name="l16030"></a>16030             <span class="keywordtype">char</span> *name_row_o = NULL;
-<a name="l16031"></a>16031             <span class="keywordtype">char</span> *name_start_v = NULL;
-<a name="l16032"></a>16032             <span class="keywordtype">char</span> *name_end_v = NULL;
-<a name="l16033"></a>16033             <span class="keywordtype">char</span> *name_obj_v = NULL;
-<a name="l16034"></a>16034 
-<a name="l16035"></a>16035             <span class="keywordtype">int</span> start, end;
-<a name="l16036"></a>16036             <span class="keywordtype">int</span> length;
-<a name="l16037"></a>16037  
-<a name="l16038"></a>16038             <span class="keywordtype">int</span> selected;
-<a name="l16039"></a>16039             <span class="keywordtype">int</span> v, start_v, end_v;
-<a name="l16040"></a>16040             <span class="keywordtype">double</span> min_v, obj_v;
-<a name="l16041"></a>16041 
-<a name="l16042"></a>16042 
-<a name="l16043"></a>16043             cpl_free(name);
-<a name="l16044"></a>16044 
-<a name="l16045"></a>16045             <span class="keywordflow">if</span> (null) 
-<a name="l16046"></a>16046                 <span class="keywordflow">break</span>;
-<a name="l16047"></a>16047 
-<a name="l16048"></a>16048             <span class="comment">/*</span>
-<a name="l16049"></a>16049 <span class="comment">             * Each object of the first object table belongs to a</span>
-<a name="l16050"></a>16050 <span class="comment">             * slit spectrum (k). This slit spectrum has a position</span>
-<a name="l16051"></a>16051 <span class="comment">             * in the rectified image, and it belongs to a given </span>
-<a name="l16052"></a>16052 <span class="comment">             * ordinary + extraordinary pair.</span>
-<a name="l16053"></a>16053 <span class="comment">             */</span>
-<a name="l16054"></a>16054      
-<a name="l16055"></a>16055             pos  = cpl_table_get_int(slitss[0], <span class="stringliteral">"position"</span>, k, &null);
-<a name="l16056"></a>16056             pair = cpl_table_get_int(slitss[0], <span class="stringliteral">"pair_id"</span>,  k, &null);
-<a name="l16057"></a>16057 
-<a name="l16058"></a>16058             <span class="comment">/*</span>
-<a name="l16059"></a>16059 <span class="comment">             * Now from the summary table we can select all objects</span>
-<a name="l16060"></a>16060 <span class="comment">             * which have the same offset (obj - pos) within all slit</span>
-<a name="l16061"></a>16061 <span class="comment">             * spectra belonging to the same ordinary + extraordinary </span>
-<a name="l16062"></a>16062 <span class="comment">             * pair (at all angles).</span>
-<a name="l16063"></a>16063 <span class="comment">             */</span>
-<a name="l16064"></a>16064 
-<a name="l16065"></a>16065             cpl_table_select_all(summary);  <span class="comment">/* Reset selection */</span>
-<a name="l16066"></a>16066 
-<a name="l16067"></a>16067             cpl_table_and_selected_int(summary, <span class="stringliteral">"pair"</span>, CPL_EQUAL_TO, pair);
-<a name="l16068"></a>16068             cpl_table_and_selected_double(summary, <span class="stringliteral">"offset"</span>, CPL_LESS_THAN,
-<a name="l16069"></a>16069                                           obj - pos + tolerance);
-<a name="l16070"></a>16070             selected = 
-<a name="l16071"></a>16071             cpl_table_and_selected_double(summary, <span class="stringliteral">"offset"</span>, CPL_GREATER_THAN,
-<a name="l16072"></a>16072                                           obj - pos - tolerance);
-<a name="l16073"></a>16073 
-<a name="l16074"></a>16074 
-<a name="l16075"></a>16075             <span class="comment">/*</span>
-<a name="l16076"></a>16076 <span class="comment">             * If this object were observed at all angles (nscience) and </span>
-<a name="l16077"></a>16077 <span class="comment">             * at all beams (2), we should have selected exactly 2*nscience</span>
-<a name="l16078"></a>16078 <span class="comment">             * objects. If not, this is not a polarimetric object, and it</span>
-<a name="l16079"></a>16079 <span class="comment">             * is discarded from the intersection.</span>
-<a name="l16080"></a>16080 <span class="comment">             */</span>
-<a name="l16081"></a>16081             
-<a name="l16082"></a>16082             <span class="keywordflow">if</span> (selected != nscience * 2) 
-<a name="l16083"></a>16083                 <span class="keywordflow">continue</span>;
-<a name="l16084"></a>16084 
-<a name="l16085"></a>16085             <span class="comment">/*</span>
-<a name="l16086"></a>16086 <span class="comment">             * If we reach this point we have found one valid polarimetric</span>
-<a name="l16087"></a>16087 <span class="comment">             * object, that must be inserted in the intersection object</span>
-<a name="l16088"></a>16088 <span class="comment">             * table.</span>
-<a name="l16089"></a>16089 <span class="comment">             */</span>
-<a name="l16090"></a>16090  
-<a name="l16091"></a>16091             slitmatches++;
-<a name="l16092"></a>16092 
-<a name="l16093"></a>16093             <span class="comment">/*</span>
-<a name="l16094"></a>16094 <span class="comment">             * Names of the columns of the output table where the</span>
-<a name="l16095"></a>16095 <span class="comment">             * object information needs to be copied. Note that a</span>
-<a name="l16096"></a>16096 <span class="comment">             * new column is created, the "row_stokes_#", where the</span>
-<a name="l16097"></a>16097 <span class="comment">             * row number of the extracted polarimetric signal is</span>
-<a name="l16098"></a>16098 <span class="comment">             * also computed. For the moment this column will be </span>
-<a name="l16099"></a>16099 <span class="comment">             * left empty - it will be filled only when all matches </span>
-<a name="l16100"></a>16100 <span class="comment">             * are collected.</span>
-<a name="l16101"></a>16101 <span class="comment">             */</span>
-<a name="l16102"></a>16102 
-<a name="l16103"></a>16103             name_obj   = cpl_sprintf(<span class="stringliteral">"object_%d"</span>,     slitmatches);
-<a name="l16104"></a>16104             name_start = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,      slitmatches);
-<a name="l16105"></a>16105             name_end   = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,        slitmatches);
-<a name="l16106"></a>16106             name_row   = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,        slitmatches);
-<a name="l16107"></a>16107             name_row_s = cpl_sprintf(<span class="stringliteral">"row_stokes_%d"</span>, slitmatches);
-<a name="l16108"></a>16108 
-<a name="l16109"></a>16109             <span class="comment">/*</span>
-<a name="l16110"></a>16110 <span class="comment">             * Names of the columns of the input table where the</span>
-<a name="l16111"></a>16111 <span class="comment">             * object information is available.</span>
-<a name="l16112"></a>16112 <span class="comment">             */</span>
-<a name="l16113"></a>16113 
-<a name="l16114"></a>16114             name_start_o = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,  m + 1);
-<a name="l16115"></a>16115             name_end_o   = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,    m + 1);
-<a name="l16116"></a>16116             name_row_o   = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,    m + 1);
-<a name="l16117"></a>16117 
-<a name="l16118"></a>16118             <span class="comment">/*</span>
-<a name="l16119"></a>16119 <span class="comment">             * If the output columns do not exist yet, create them.</span>
-<a name="l16120"></a>16120 <span class="comment">             */</span>
-<a name="l16121"></a>16121  
-<a name="l16122"></a>16122             <span class="keywordflow">if</span> (!cpl_table_has_column(origslits, name_obj)) {
-<a name="l16123"></a>16123                 cpl_table_new_column(origslits, name_obj, CPL_TYPE_DOUBLE);
-<a name="l16124"></a>16124                 cpl_table_new_column(origslits, name_start, CPL_TYPE_INT);
-<a name="l16125"></a>16125                 cpl_table_new_column(origslits, name_end,   CPL_TYPE_INT);
-<a name="l16126"></a>16126                 cpl_table_new_column(origslits, name_row,   CPL_TYPE_INT);
-<a name="l16127"></a>16127                 cpl_table_new_column(origslits, name_row_s, CPL_TYPE_INT);
-<a name="l16128"></a>16128             }
-<a name="l16129"></a>16129 
-<a name="l16130"></a>16130             <span class="comment">/*</span>
-<a name="l16131"></a>16131 <span class="comment">             * The current slit spectrum is k. The slit spectrum immediately</span>
-<a name="l16132"></a>16132 <span class="comment">             * below (in the rectified image) is k+1. We need the length of</span>
-<a name="l16133"></a>16133 <span class="comment">             * the spectrum below for computing the _absolute_ coordinates</span>
-<a name="l16134"></a>16134 <span class="comment">             * of the objects in the rectified image in both beams.</span>
-<a name="l16135"></a>16135 <span class="comment">             */</span>
-<a name="l16136"></a>16136  
-<a name="l16137"></a>16137             length = cpl_table_get_int(origslits, <span class="stringliteral">"length"</span>, k + 1, &null);
-<a name="l16138"></a>16138 
-<a name="l16139"></a>16139             <span class="comment">/* NEW:</span>
-<a name="l16140"></a>16140 <span class="comment">             * Names of the columns of the input table where</span>
-<a name="l16141"></a>16141 <span class="comment">             * the information of the corresponding object of </span>
-<a name="l16142"></a>16142 <span class="comment">             * the next beam is available.</span>
-<a name="l16143"></a>16143 <span class="comment">             */</span>
-<a name="l16144"></a>16144 
-<a name="l16145"></a>16145             <span class="keywordflow">for</span> (v = 0; v < maxobjs; v++) {
-<a name="l16146"></a>16146                 <span class="keywordtype">char</span> *name_v = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, v + 1);
-<a name="l16147"></a>16147                 <span class="keywordtype">double</span> obj_v = cpl_table_get_double(slitss[0], name_v, 
-<a name="l16148"></a>16148                                                     k + 1, &null);
-<a name="l16149"></a>16149 
-<a name="l16150"></a>16150                 cpl_free(name_v);
-<a name="l16151"></a>16151 
-<a name="l16152"></a>16152                 <span class="keywordflow">if</span> (null) 
-<a name="l16153"></a>16153                     <span class="keywordflow">break</span>;
-<a name="l16154"></a>16154 
-<a name="l16155"></a>16155                 <span class="keywordflow">if</span> (v) {
-<a name="l16156"></a>16156                     <span class="keywordflow">if</span> (fabs(obj - length - obj_v) < min_v) {
-<a name="l16157"></a>16157                         min_v = fabs(obj - length - obj_v);
-<a name="l16158"></a>16158                         cpl_free(name_start_v);
-<a name="l16159"></a>16159                         cpl_free(name_end_v);
-<a name="l16160"></a>16160                         cpl_free(name_obj_v);
-<a name="l16161"></a>16161                         name_start_v = cpl_sprintf(<span class="stringliteral">"start_%d"</span>, v + 1);
-<a name="l16162"></a>16162                         name_end_v   = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,   v + 1);
-<a name="l16163"></a>16163                         name_obj_v   = cpl_sprintf(<span class="stringliteral">"object_%d"</span>,   v + 1);
-<a name="l16164"></a>16164                     }
-<a name="l16165"></a>16165                 }
-<a name="l16166"></a>16166                 <span class="keywordflow">else</span> {
-<a name="l16167"></a>16167                     min_v = fabs(obj - length - obj_v);
-<a name="l16168"></a>16168                     name_start_v = cpl_sprintf(<span class="stringliteral">"start_%d"</span>, v + 1);
-<a name="l16169"></a>16169                     name_end_v   = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,   v + 1);
-<a name="l16170"></a>16170                     name_obj_v   = cpl_sprintf(<span class="stringliteral">"object_%d"</span>,   v + 1);
-<a name="l16171"></a>16171                 }
-<a name="l16172"></a>16172             }
-<a name="l16173"></a>16173 
-<a name="l16174"></a>16174             <span class="comment">/*</span>
-<a name="l16175"></a>16175 <span class="comment">             * Read from the first input object table (first angle)</span>
-<a name="l16176"></a>16176 <span class="comment">             * the spatial window enclosing the object.</span>
-<a name="l16177"></a>16177 <span class="comment">             */</span>
-<a name="l16178"></a>16178 
-<a name="l16179"></a>16179             start = cpl_table_get_int(slitss[0], name_start_o, k, &null);
-<a name="l16180"></a>16180             end   = cpl_table_get_int(slitss[0], name_end_o,   k, &null);
-<a name="l16181"></a>16181 
-<a name="l16182"></a>16182             <span class="comment">/* NEW:</span>
-<a name="l16183"></a>16183 <span class="comment">             * Spatial window of the matching object in the next beam.</span>
-<a name="l16184"></a>16184 <span class="comment">             */</span>
-<a name="l16185"></a>16185 
-<a name="l16186"></a>16186             start_v = cpl_table_get_int(slitss[0], name_start_v,  k + 1, &null);
-<a name="l16187"></a>16187             end_v   = cpl_table_get_int(slitss[0], name_end_v,    k + 1, &null);
-<a name="l16188"></a>16188             obj_v   = cpl_table_get_double(slitss[0], name_obj_v, k + 1, &null);
-<a name="l16189"></a>16189 
-<a name="l16190"></a>16190             <span class="comment">/*</span>
-<a name="l16191"></a>16191 <span class="comment">             * Write the object coordinates in the same slit, and in the</span>
-<a name="l16192"></a>16192 <span class="comment">             * slit below. Note that here we assume that all slits were</span>
-<a name="l16193"></a>16193 <span class="comment">             * traced perfectly, and we compute the theoretical coords</span>
-<a name="l16194"></a>16194 <span class="comment">             * (obj - length) within the next slit spectrum (k + 1). In</span>
-<a name="l16195"></a>16195 <span class="comment">             * principle we should read them as well from the input</span>
-<a name="l16196"></a>16196 <span class="comment">             * table!</span>
-<a name="l16197"></a>16197 <span class="comment">             */</span>
-<a name="l16198"></a>16198 
-<a name="l16199"></a>16199             cpl_table_set_double(origslits, name_obj,   k,     obj);
-<a name="l16200"></a>16200             cpl_table_set_double(origslits, name_obj,   k + 1, obj_v);
-<a name="l16201"></a>16201          <span class="comment">// cpl_table_set_double(origslits, name_obj,   k + 1, obj - length);</span>
-<a name="l16202"></a>16202 
-<a name="l16203"></a>16203             cpl_table_set_int(origslits,    name_start, k,     start);
-<a name="l16204"></a>16204             cpl_table_set_int(origslits,    name_start, k + 1, start_v);
-<a name="l16205"></a>16205          <span class="comment">// cpl_table_set_int(origslits,    name_start, k + 1, start - length);</span>
-<a name="l16206"></a>16206 
-<a name="l16207"></a>16207             cpl_table_set_int(origslits,    name_end,   k,     end);
-<a name="l16208"></a>16208             cpl_table_set_int(origslits,    name_end,   k + 1, end_v);
-<a name="l16209"></a>16209          <span class="comment">// cpl_table_set_int(origslits,    name_end,   k + 1, end - length);</span>
-<a name="l16210"></a>16210 
-<a name="l16211"></a>16211             <span class="comment">/*</span>
-<a name="l16212"></a>16212 <span class="comment">             * "nmatches" is counting at what "reduced" image row the</span>
-<a name="l16213"></a>16213 <span class="comment">             * extracted spectra are. Note that this is s preliminary</span>
-<a name="l16214"></a>16214 <span class="comment">             * numbering - which is wrong: other objects may be found</span>
-<a name="l16215"></a>16215 <span class="comment">             * in the same slit, and then the indeces would not be in</span>
-<a name="l16216"></a>16216 <span class="comment">             * sequence. What is important is that at the end of this</span>
-<a name="l16217"></a>16217 <span class="comment">             * loop "nmatches" would be the total number of matching </span>
-<a name="l16218"></a>16218 <span class="comment">             * objects. The two cpl_table_set_int() calls made here</span>
-<a name="l16219"></a>16219 <span class="comment">             * cannot be removed - they "validate" those table elements</span>
-<a name="l16220"></a>16220 <span class="comment">             * (see ahead). </span>
-<a name="l16221"></a>16221 <span class="comment">             */</span>
-<a name="l16222"></a>16222 
-<a name="l16223"></a>16223             cpl_table_set_int(origslits,    name_row,   k,     nmatches);
-<a name="l16224"></a>16224             nmatches++;
-<a name="l16225"></a>16225             cpl_table_set_int(origslits,    name_row,   k + 1, nmatches);
-<a name="l16226"></a>16226             nmatches++;
-<a name="l16227"></a>16227 
-<a name="l16228"></a>16228             cpl_free(name_obj);
-<a name="l16229"></a>16229             cpl_free(name_start);
-<a name="l16230"></a>16230             cpl_free(name_end);
-<a name="l16231"></a>16231             cpl_free(name_row);
-<a name="l16232"></a>16232             cpl_free(name_row_s);
-<a name="l16233"></a>16233 
-<a name="l16234"></a>16234             cpl_free(name_start_o);
-<a name="l16235"></a>16235             cpl_free(name_end_o);
-<a name="l16236"></a>16236             cpl_free(name_row_o);
-<a name="l16237"></a>16237 
-<a name="l16238"></a>16238             cpl_free(name_start_v); name_start_v = NULL;
-<a name="l16239"></a>16239             cpl_free(name_end_v); name_end_v = NULL;
-<a name="l16240"></a>16240             cpl_free(name_obj_v); name_obj_v = NULL;
-<a name="l16241"></a>16241         }
-<a name="l16242"></a>16242     }
-<a name="l16243"></a>16243 
-<a name="l16244"></a>16244     <span class="comment">/*</span>
-<a name="l16245"></a>16245 <span class="comment">     * The summary table has fulfilled its function. If no matching </span>
-<a name="l16246"></a>16246 <span class="comment">     * objects are found, the function returns with an error.</span>
-<a name="l16247"></a>16247 <span class="comment">     */</span>
-<a name="l16248"></a>16248 
-<a name="l16249"></a>16249     cpl_table_delete(summary);
-<a name="l16250"></a>16250 
-<a name="l16251"></a>16251     <span class="keywordflow">if</span> (!nmatches)
-<a name="l16252"></a>16252         <span class="keywordflow">return</span> cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND); 
-<a name="l16253"></a>16253 
-<a name="l16254"></a>16254     <span class="comment">/*</span>
-<a name="l16255"></a>16255 <span class="comment">     * Now we consider the resulting intersection object table,</span>
-<a name="l16256"></a>16256 <span class="comment">     * listing all matches. As seen, the image row number reported</span>
-<a name="l16257"></a>16257 <span class="comment">     * in the columns "row_#" was not really performed sequentially.</span>
-<a name="l16258"></a>16258 <span class="comment">     * We need to renumber sequentially...</span>
-<a name="l16259"></a>16259 <span class="comment">     * We need also to fill the "row_stokes_#" column the way the</span>
-<a name="l16260"></a>16260 <span class="comment">     * extracted polarimetric signal will be stored in the </span>
-<a name="l16261"></a>16261 <span class="comment">     * reduced_pol_images...</span>
-<a name="l16262"></a>16262 <span class="comment">     */</span>
-<a name="l16263"></a>16263  
-<a name="l16264"></a>16264     maxobjs = <a class="code" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">mos_get_maxobjs_per_slit</a>(origslits);
-<a name="l16265"></a>16265     nstokes = nmatches / 2;         <span class="comment">/* nmatches is always an even number     */</span>
-<a name="l16266"></a>16266 
-<a name="l16267"></a>16267     <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {
-<a name="l16268"></a>16268         <span class="keywordflow">if</span> (k % 2) { <span class="comment">/* Extraordinary beam */</span>
-<a name="l16269"></a>16269             nstokes = sstokes;      <span class="comment">/* Use same start value as for ordinary  */</span>
-<a name="l16270"></a>16270         }
-<a name="l16271"></a>16271         <span class="keywordflow">else</span> {       <span class="comment">/* Ordinary beam      */</span>
-<a name="l16272"></a>16272             sstokes = nstokes;      <span class="comment">/* Memorise start value at ordinary beam */</span>
-<a name="l16273"></a>16273         }
-<a name="l16274"></a>16274 
-<a name="l16275"></a>16275         <span class="keywordflow">for</span> (m = 0; m < maxobjs; m++) {
-<a name="l16276"></a>16276             <span class="keywordtype">char</span> *name       = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,        m + 1);
-<a name="l16277"></a>16277             <span class="keywordtype">char</span> *namestokes = cpl_sprintf(<span class="stringliteral">"row_stokes_%d"</span>, m + 1);
-<a name="l16278"></a>16278 
-<a name="l16279"></a>16279             <span class="keywordflow">if</span> (!cpl_table_is_valid(origslits, name, k)) {
-<a name="l16280"></a>16280                 cpl_free(name);
-<a name="l16281"></a>16281                 cpl_free(namestokes);
-<a name="l16282"></a>16282                 <span class="keywordflow">break</span>;
-<a name="l16283"></a>16283             }
-<a name="l16284"></a>16284             <span class="keywordflow">else</span> { 
-<a name="l16285"></a>16285                 nmatches--;
-<a name="l16286"></a>16286                 nstokes--;
-<a name="l16287"></a>16287                 cpl_table_set_int(origslits, name, k, nmatches);
-<a name="l16288"></a>16288                 cpl_table_set_int(origslits, namestokes, k, nstokes);
-<a name="l16289"></a>16289             }
-<a name="l16290"></a>16290 
-<a name="l16291"></a>16291             cpl_free(name);
-<a name="l16292"></a>16292             cpl_free(namestokes);
-<a name="l16293"></a>16293         }
-<a name="l16294"></a>16294     }
-<a name="l16295"></a>16295 
-<a name="l16296"></a>16296 
-<a name="l16297"></a>16297     <span class="comment">/*</span>
-<a name="l16298"></a>16298 <span class="comment">     * This is done to avoid the NULL value is zero (it would invalidate</span>
-<a name="l16299"></a>16299 <span class="comment">     * also the row_# = 0 or start_# = 0 for an object), and to enable </span>
-<a name="l16300"></a>16300 <span class="comment">     * working directly with the column data buffers, when using this </span>
-<a name="l16301"></a>16301 <span class="comment">     * table afterwards.</span>
-<a name="l16302"></a>16302 <span class="comment">     */</span>
-<a name="l16303"></a>16303 
-<a name="l16304"></a>16304     <span class="keywordflow">for</span> (j = 0; j < maxobjs; j++) {
-<a name="l16305"></a>16305         <span class="keywordtype">char</span> *name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, j + 1);
-<a name="l16306"></a>16306         cpl_table_fill_invalid_double(origslits, name, -1);
-<a name="l16307"></a>16307         cpl_free(name);
-<a name="l16308"></a>16308 
-<a name="l16309"></a>16309         name       = cpl_sprintf(<span class="stringliteral">"start_%d"</span>, j + 1);
-<a name="l16310"></a>16310         cpl_table_fill_invalid_int(origslits, name, -1);
-<a name="l16311"></a>16311         cpl_free(name);
-<a name="l16312"></a>16312 
-<a name="l16313"></a>16313         name       = cpl_sprintf(<span class="stringliteral">"end_%d"</span>, j + 1);
-<a name="l16314"></a>16314         cpl_table_fill_invalid_int(origslits, name, -1);
-<a name="l16315"></a>16315         cpl_free(name);
-<a name="l16316"></a>16316 
-<a name="l16317"></a>16317         name       = cpl_sprintf(<span class="stringliteral">"row_%d"</span>, j + 1);
-<a name="l16318"></a>16318         cpl_table_fill_invalid_int(origslits, name, -1);
-<a name="l16319"></a>16319         cpl_free(name);
-<a name="l16320"></a>16320 
-<a name="l16321"></a>16321         name       = cpl_sprintf(<span class="stringliteral">"row_stokes_%d"</span>, j + 1);
-<a name="l16322"></a>16322         cpl_table_fill_invalid_int(origslits, name, -1);
-<a name="l16323"></a>16323         cpl_free(name);
-<a name="l16324"></a>16324     }
-<a name="l16325"></a>16325 
-<a name="l16326"></a>16326     <span class="comment">/*********************************************************************</span>
-<a name="l16327"></a>16327 <span class="comment">     * This tail has been added to propagate the selection of valid</span>
-<a name="l16328"></a>16328 <span class="comment">     * objects also to the input slitss[] tables. Just eliminate all</span>
-<a name="l16329"></a>16329 <span class="comment">     * this final part to suppress this behaviour.</span>
-<a name="l16330"></a>16330 <span class="comment">     */</span>
-<a name="l16331"></a>16331 
-<a name="l16332"></a>16332     <span class="comment">/*</span>
-<a name="l16333"></a>16333 <span class="comment">     * First of all, make a working copy and remove all columns related </span>
-<a name="l16334"></a>16334 <span class="comment">     * to objects from the input object tables. </span>
-<a name="l16335"></a>16335 <span class="comment">     */</span>
-<a name="l16336"></a>16336 
-<a name="l16337"></a>16337     <span class="keywordflow">for</span> (i = 0; i < nscience; i++) {
-<a name="l16338"></a>16338         <span class="keywordtype">int</span> c_maxobjs = <a class="code" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">mos_get_maxobjs_per_slit</a>(slitss[i]);
-<a name="l16339"></a>16339 
-<a name="l16340"></a>16340         work[i] = cpl_table_duplicate(slitss[i]);
-<a name="l16341"></a>16341 
-<a name="l16342"></a>16342         <span class="keywordflow">for</span> (m = 0; m < c_maxobjs; m++) {
-<a name="l16343"></a>16343             <span class="keywordtype">char</span> *object_o = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);
-<a name="l16344"></a>16344             <span class="keywordtype">char</span> *start_o  = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,  m + 1);
-<a name="l16345"></a>16345             <span class="keywordtype">char</span> *end_o    = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,    m + 1);
-<a name="l16346"></a>16346             <span class="keywordtype">char</span> *row_o    = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,    m + 1);
-<a name="l16347"></a>16347 
-<a name="l16348"></a>16348             cpl_table_erase_column(slitss[i], object_o);
-<a name="l16349"></a>16349             cpl_table_erase_column(slitss[i], start_o);
-<a name="l16350"></a>16350             cpl_table_erase_column(slitss[i], end_o);
-<a name="l16351"></a>16351             cpl_table_erase_column(slitss[i], row_o);
-<a name="l16352"></a>16352         }
-<a name="l16353"></a>16353     }
-<a name="l16354"></a>16354 
-<a name="l16355"></a>16355     <span class="comment">/* </span>
-<a name="l16356"></a>16356 <span class="comment">     * Now just consider all the objects in the intersection table.</span>
-<a name="l16357"></a>16357 <span class="comment">     */</span>
-<a name="l16358"></a>16358 
-<a name="l16359"></a>16359     <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {
-<a name="l16360"></a>16360         <span class="keywordflow">for</span> (j = 0; j < maxobjs; j++) {
-<a name="l16361"></a>16361             <span class="keywordtype">double</span> object_w, object_r;
-<a name="l16362"></a>16362             <span class="keywordtype">int</span>    start_w, start_r;
-<a name="l16363"></a>16363             <span class="keywordtype">int</span>    end_w, end_r;
-<a name="l16364"></a>16364             <span class="keywordtype">int</span>    row_w, row_r;
-<a name="l16365"></a>16365 
-<a name="l16366"></a>16366             <span class="keywordtype">char</span>  *object_i = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, j + 1);
-<a name="l16367"></a>16367             <span class="keywordtype">char</span>  *start_i  = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,  j + 1);
-<a name="l16368"></a>16368             <span class="keywordtype">char</span>  *end_i    = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,    j + 1);
-<a name="l16369"></a>16369             <span class="keywordtype">char</span>  *row_i    = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,    j + 1);
-<a name="l16370"></a>16370 
-<a name="l16371"></a>16371 
-<a name="l16372"></a>16372             <span class="keywordflow">if</span> (!cpl_table_is_valid(origslits, object_i, k))
-<a name="l16373"></a>16373                 <span class="keywordflow">break</span>;
-<a name="l16374"></a>16374 
-<a name="l16375"></a>16375             <span class="comment">/* </span>
-<a name="l16376"></a>16376 <span class="comment">             * We have found a valid object (valid because it belongs</span>
-<a name="l16377"></a>16377 <span class="comment">             * to the intersection). Now we look for this object in each</span>
-<a name="l16378"></a>16378 <span class="comment">             * one of the original tables, we get its parameters, and</span>
-<a name="l16379"></a>16379 <span class="comment">             * copy them at the right position (i.e., same position as</span>
-<a name="l16380"></a>16380 <span class="comment">             * in intersection table). The object will be the one closest</span>
-<a name="l16381"></a>16381 <span class="comment">             * to the object position (column object_i) in the intersection</span>
-<a name="l16382"></a>16382 <span class="comment">             * table. Note that we examine the same row, k, in all tables.</span>
-<a name="l16383"></a>16383 <span class="comment">             */</span>
-<a name="l16384"></a>16384 
-<a name="l16385"></a>16385             object_w = cpl_table_get_double(origslits, object_i, k, NULL);
-<a name="l16386"></a>16386             start_w  = cpl_table_get_int   (origslits, start_i,  k, NULL);
-<a name="l16387"></a>16387             end_w    = cpl_table_get_int   (origslits, end_i,    k, NULL);
-<a name="l16388"></a>16388             row_w    = cpl_table_get_int   (origslits, row_i,    k, NULL);
-<a name="l16389"></a>16389 
-<a name="l16390"></a>16390             <span class="keywordflow">for</span> (i = 0; i < nscience; i++) {
-<a name="l16391"></a>16391                 <span class="keywordtype">int</span>        c_maxobjs = <a class="code" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">mos_get_maxobjs_per_slit</a>(work[i]);
-<a name="l16392"></a>16392                 <span class="keywordtype">int</span>        minpos;
-<a name="l16393"></a>16393                 <span class="keywordtype">double</span>     mindiff, diff;
-<a name="l16394"></a>16394                 <span class="keywordtype">char</span>      *object_o;
-<a name="l16395"></a>16395                 <span class="keywordtype">char</span>      *start_o;
-<a name="l16396"></a>16396                 <span class="keywordtype">char</span>      *end_o;
-<a name="l16397"></a>16397                 <span class="keywordtype">char</span>      *row_o;
-<a name="l16398"></a>16398 
-<a name="l16399"></a>16399                 <span class="keywordflow">for</span> (m = 0; m < c_maxobjs; m++) {
-<a name="l16400"></a>16400                     object_o = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);
-<a name="l16401"></a>16401                     start_o  = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,  m + 1);
-<a name="l16402"></a>16402                     end_o    = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,    m + 1);
-<a name="l16403"></a>16403                     row_o    = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,    m + 1);
-<a name="l16404"></a>16404 
-<a name="l16405"></a>16405                     <span class="keywordflow">if</span> (!cpl_table_is_valid(work[i], object_o, k))
-<a name="l16406"></a>16406                         <span class="keywordflow">break</span>;
-<a name="l16407"></a>16407 
-<a name="l16408"></a>16408                     object_r = cpl_table_get_double(work[i], object_o, k, NULL);
-<a name="l16409"></a>16409                     start_r  = cpl_table_get_int   (work[i], start_o,  k, NULL);
-<a name="l16410"></a>16410                     end_r    = cpl_table_get_int   (work[i], end_o,    k, NULL);
-<a name="l16411"></a>16411                     row_r    = cpl_table_get_int   (work[i], row_o,    k, NULL);
-<a name="l16412"></a>16412 
-<a name="l16413"></a>16413                     diff = fabs(object_w - object_r);
-<a name="l16414"></a>16414                     <span class="keywordflow">if</span> (m) {
-<a name="l16415"></a>16415                         <span class="keywordflow">if</span> (mindiff > diff) {
-<a name="l16416"></a>16416                             mindiff = diff;
-<a name="l16417"></a>16417                             minpos = m;
-<a name="l16418"></a>16418                         }
-<a name="l16419"></a>16419                     }
-<a name="l16420"></a>16420                     <span class="keywordflow">else</span> {
-<a name="l16421"></a>16421                         mindiff = diff;
-<a name="l16422"></a>16422                         minpos = 0;
-<a name="l16423"></a>16423                     }
-<a name="l16424"></a>16424 
-<a name="l16425"></a>16425                     cpl_free(object_o);
-<a name="l16426"></a>16426                     cpl_free(start_o);
-<a name="l16427"></a>16427                     cpl_free(end_o);
-<a name="l16428"></a>16428                     cpl_free(row_o);
-<a name="l16429"></a>16429                 }
-<a name="l16430"></a>16430 
-<a name="l16431"></a>16431                 object_o = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, minpos + 1);
-<a name="l16432"></a>16432                 start_o  = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,  minpos + 1);
-<a name="l16433"></a>16433                 end_o    = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,    minpos + 1);
-<a name="l16434"></a>16434                 row_o    = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,    minpos + 1);
-<a name="l16435"></a>16435 
-<a name="l16436"></a>16436                 <span class="keywordflow">if</span> (!cpl_table_has_column(slitss[i], object_i)) {
-<a name="l16437"></a>16437                     cpl_table_new_column(slitss[i], object_i, CPL_TYPE_DOUBLE);
-<a name="l16438"></a>16438                     cpl_table_new_column(slitss[i], start_i,  CPL_TYPE_INT);
-<a name="l16439"></a>16439                     cpl_table_new_column(slitss[i], end_i,    CPL_TYPE_INT);
-<a name="l16440"></a>16440                     cpl_table_new_column(slitss[i], row_i,    CPL_TYPE_INT);
-<a name="l16441"></a>16441                     cpl_table_fill_invalid_double(slitss[i], object_i, -1);
-<a name="l16442"></a>16442                     cpl_table_fill_invalid_int   (slitss[i], start_i,  -1);
-<a name="l16443"></a>16443                     cpl_table_fill_invalid_int   (slitss[i], end_i,    -1);
-<a name="l16444"></a>16444                     cpl_table_fill_invalid_int   (slitss[i], row_i,    -1);
-<a name="l16445"></a>16445                 }
-<a name="l16446"></a>16446 
-<a name="l16447"></a>16447                 cpl_table_set_double(slitss[i], object_i, k,
-<a name="l16448"></a>16448                                      cpl_table_get_double(work[i], object_o, 
-<a name="l16449"></a>16449                                                           k, NULL));
-<a name="l16450"></a>16450                 cpl_table_set_int(slitss[i], start_i , k,
-<a name="l16451"></a>16451                                   cpl_table_get_int(work[i], start_o, k, NULL));
-<a name="l16452"></a>16452                 cpl_table_set_int(slitss[i], end_i , k,
-<a name="l16453"></a>16453                                   cpl_table_get_int(work[i], end_o, k, NULL));
-<a name="l16454"></a>16454                 cpl_table_set_int(slitss[i], row_i , k, row_w);
-<a name="l16455"></a>16455 
-<a name="l16456"></a>16456                 cpl_free(object_o);
-<a name="l16457"></a>16457                 cpl_free(start_o);
-<a name="l16458"></a>16458                 cpl_free(end_o);
-<a name="l16459"></a>16459                 cpl_free(row_o);
-<a name="l16460"></a>16460             }
-<a name="l16461"></a>16461 
-<a name="l16462"></a>16462             cpl_free(object_i);
-<a name="l16463"></a>16463             cpl_free(start_i);
-<a name="l16464"></a>16464             cpl_free(end_i);
-<a name="l16465"></a>16465             cpl_free(row_i);
-<a name="l16466"></a>16466         }
-<a name="l16467"></a>16467     }
-<a name="l16468"></a>16468 
-<a name="l16469"></a>16469     <span class="keywordflow">for</span> (i = 0; i < nscience; i++)
-<a name="l16470"></a>16470         cpl_table_delete(work[i]);
-<a name="l16471"></a>16471 
-<a name="l16472"></a>16472     cpl_free(work);
-<a name="l16473"></a>16473 
-<a name="l16474"></a>16474 
-<a name="l16475"></a>16475     <span class="keywordflow">return</span> cpl_error_get_code();
-<a name="l16476"></a>16476 }
-<a name="l16477"></a>16477 
-<a name="l16478"></a>16478 
-<a name="l16486"></a><a class="code" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">16486</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">mos_get_maxobjs_per_slit</a>(cpl_table * slits)
-<a name="l16487"></a>16487 {
-<a name="l16488"></a>16488     <span class="keywordtype">int</span> maxobjs = 1;
-<a name="l16489"></a>16489 
-<a name="l16490"></a>16490     <span class="keywordtype">char</span> * colname = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, maxobjs);
-<a name="l16491"></a>16491     
-<a name="l16492"></a>16492     <span class="keywordflow">while</span> (cpl_table_has_column(slits, colname)) {
-<a name="l16493"></a>16493         maxobjs++;
-<a name="l16494"></a>16494         cpl_free(colname);
-<a name="l16495"></a>16495         colname = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, maxobjs);
-<a name="l16496"></a>16496     }
-<a name="l16497"></a>16497     
-<a name="l16498"></a>16498     cpl_free(colname);
-<a name="l16499"></a>16499 
-<a name="l16500"></a>16500     maxobjs--;
-<a name="l16501"></a>16501 
-<a name="l16502"></a>16502     <span class="keywordflow">return</span> maxobjs;
-<a name="l16503"></a>16503 }
-<a name="l16504"></a>16504 
-<a name="l16512"></a><a class="code" href="group__moses.html#g7a41fa707f51ab0d55150ed8c4b19657">16512</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g7a41fa707f51ab0d55150ed8c4b19657">mos_get_nobjects</a>(cpl_table * slits)
-<a name="l16513"></a>16513 {
-<a name="l16514"></a>16514     <span class="keywordtype">int</span> nobjs = 0;
-<a name="l16515"></a>16515 
-<a name="l16516"></a>16516     <span class="keywordtype">int</span> nslits  = cpl_table_get_nrow(slits);
-<a name="l16517"></a>16517     <span class="keywordtype">int</span> maxobjs = <a class="code" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">mos_get_maxobjs_per_slit</a>(slits);
-<a name="l16518"></a>16518 
-<a name="l16519"></a>16519     <span class="keywordtype">int</span> k, m;
-<a name="l16520"></a>16520 
-<a name="l16521"></a>16521     <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {
-<a name="l16522"></a>16522         <span class="keywordflow">for</span> (m = 0; m < maxobjs; m++) {
-<a name="l16523"></a>16523             <span class="keywordtype">char</span> * name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);
-<a name="l16524"></a>16524             <span class="keywordtype">int</span>    null = !cpl_table_is_valid(slits, name, k);
-<a name="l16525"></a>16525 
-<a name="l16526"></a>16526             cpl_free(name);
-<a name="l16527"></a>16527 
-<a name="l16528"></a>16528             <span class="keywordflow">if</span> (null)  <span class="keywordflow">break</span>;
-<a name="l16529"></a>16529             <span class="keywordflow">else</span> nobjs++;
-<a name="l16530"></a>16530         }
-<a name="l16531"></a>16531     }
-<a name="l16532"></a>16532 
-<a name="l16533"></a>16533     <span class="keywordflow">return</span> nobjs;
-<a name="l16534"></a>16534 }
-<a name="l16535"></a>16535 
-<a name="l16543"></a><a class="code" href="group__moses.html#g5ec455544df7dfc83da8fefc91a9afc7">16543</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g5ec455544df7dfc83da8fefc91a9afc7">mos_check_slits</a>(cpl_table *slits, <span class="keywordtype">float</span> rescale)
-<a name="l16544"></a>16544 {
-<a name="l16545"></a>16545 
-<a name="l16546"></a>16546     cpl_propertylist *sort;
-<a name="l16547"></a>16547 
-<a name="l16548"></a>16548     <span class="keywordtype">int</span> nslits  = cpl_table_get_nrow(slits);
-<a name="l16549"></a>16549 
-<a name="l16550"></a>16550     <span class="keywordtype">int</span> k, null;
-<a name="l16551"></a>16551 
-<a name="l16552"></a>16552     <span class="keyword">const</span> <span class="keywordtype">float</span> interval = 90.0 * rescale;
-<a name="l16553"></a>16553     <span class="keyword">const</span> <span class="keywordtype">float</span> offset   = (90.0 - 5) * rescale;
-<a name="l16554"></a>16554 
-<a name="l16555"></a>16555 
-<a name="l16556"></a>16556     <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {
-<a name="l16557"></a>16557         <span class="keywordtype">double</span> ytop    = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>,    k, &null);
-<a name="l16558"></a>16558         <span class="keywordtype">double</span> ybottom = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, k, &null);
-<a name="l16559"></a>16559 
-<a name="l16560"></a>16560         <span class="keywordtype">double</span> xtop    = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>,    k, &null);
-<a name="l16561"></a>16561         <span class="keywordtype">double</span> xbottom = cpl_table_get_double(slits, <span class="stringliteral">"xbottom"</span>, k, &null);
-<a name="l16562"></a>16562 
-<a name="l16563"></a>16563         <span class="keywordtype">int</span> nmiss = (int)((ytop - ybottom) / interval + 0.5);
-<a name="l16564"></a>16564 
-<a name="l16565"></a>16565         <span class="keywordflow">if</span> (nmiss > 1) {
-<a name="l16566"></a>16566             cpl_msg_warning(cpl_func, 
-<a name="l16567"></a>16567                             <span class="stringliteral">"Some slits could not be properly detected. "</span>
-<a name="l16568"></a>16568                             <span class="stringliteral">"There might be accountable inaccuracies."</span>);
-<a name="l16569"></a>16569             <span class="keywordflow">while</span> (nmiss > 1) {
-<a name="l16570"></a>16570                 cpl_table_set_size(slits, nslits + 1);
-<a name="l16571"></a>16571 
-<a name="l16572"></a>16572                 <span class="comment">/* Fill in new slit 'cut' */</span>
-<a name="l16573"></a>16573 
-<a name="l16574"></a>16574                 <span class="comment">/* x coordinates be the same (acceptable approximation) */</span>
-<a name="l16575"></a>16575                 cpl_table_set_double(slits, <span class="stringliteral">"xtop"</span>,    nslits, xtop);
-<a name="l16576"></a>16576                 cpl_table_set_double(slits, <span class="stringliteral">"xbottom"</span>, nslits, xbottom);
-<a name="l16577"></a>16577 
-<a name="l16578"></a>16578                 <span class="comment">/* Cut */</span>
-<a name="l16579"></a>16579                 <span class="keywordflow">if</span> (k == 0) {
-<a name="l16580"></a>16580                     cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, nslits, ybottom); 
-<a name="l16581"></a>16581                     cpl_table_set_double(slits, <span class="stringliteral">"ytop"</span>,    nslits, ybottom
-<a name="l16582"></a>16582                                                                    + offset);
-<a name="l16583"></a>16583                     ybottom += interval;
-<a name="l16584"></a>16584                     cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, k,      ybottom);
-<a name="l16585"></a>16585                 } <span class="keywordflow">else</span> {
-<a name="l16586"></a>16586                     cpl_table_set_double(slits, <span class="stringliteral">"ytop"</span>,    nslits, ytop);
-<a name="l16587"></a>16587                     cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, nslits, ytop 
-<a name="l16588"></a>16588                                                                    - offset);
-<a name="l16589"></a>16589                     ytop -= interval;
-<a name="l16590"></a>16590                     cpl_table_set_double(slits, <span class="stringliteral">"ytop"</span>,     k,     ytop);
-<a name="l16591"></a>16591                 }
-<a name="l16592"></a>16592 
-<a name="l16593"></a>16593                 nslits++; nmiss--;
-<a name="l16594"></a>16594             }
-<a name="l16595"></a>16595         }
-<a name="l16596"></a>16596     }
-<a name="l16597"></a>16597 
-<a name="l16598"></a>16598     sort = cpl_propertylist_new();
-<a name="l16599"></a>16599     cpl_propertylist_append_bool(sort, <span class="stringliteral">"ytop"</span>, 1);
-<a name="l16600"></a>16600     cpl_table_sort(slits, sort);
-<a name="l16601"></a>16601     cpl_propertylist_delete(sort);
-<a name="l16602"></a>16602 
-<a name="l16603"></a>16603     <span class="comment">/*</span>
-<a name="l16604"></a>16604 <span class="comment">     * Add here an ad hoc check on the last slit: is it too long </span>
-<a name="l16605"></a>16605 <span class="comment">     * (by more than 10%)? Then shorten it...</span>
-<a name="l16606"></a>16606 <span class="comment">     */</span>
-<a name="l16607"></a>16607 
-<a name="l16608"></a>16608     k = cpl_table_get_nrow(slits) - 1;
-<a name="l16609"></a>16609 
-<a name="l16610"></a>16610     {
-<a name="l16611"></a>16611         <span class="keywordtype">double</span> ytop    = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>,    k, &null);
-<a name="l16612"></a>16612         <span class="keywordtype">double</span> ybottom = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, k, &null);
-<a name="l16613"></a>16613         <span class="keywordtype">double</span> length  = (ytop - ybottom) / interval;
-<a name="l16614"></a>16614 
-<a name="l16615"></a>16615         <span class="keywordflow">if</span> (length > 1.1) {
-<a name="l16616"></a>16616             cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, k, ytop - offset);
-<a name="l16617"></a>16617         }
-<a name="l16618"></a>16618   
-<a name="l16619"></a>16619     }
-<a name="l16620"></a>16620 
-<a name="l16621"></a>16621     <span class="keywordflow">return</span> 0;
-<a name="l16622"></a>16622 }
-<a name="l16623"></a>16623 
-<a name="l16646"></a><a class="code" href="group__moses.html#g5bc87e2a7c15dd1686e02e2d65e057f5">16646</a> cpl_table *<a class="code" href="group__moses.html#g5bc87e2a7c15dd1686e02e2d65e057f5">mos_load_slits_fors_pmos</a>(cpl_propertylist *header, 
-<a name="l16647"></a>16647                                     <span class="keywordtype">int</span> * nslits_out_det)
-<a name="l16648"></a>16648 {
-<a name="l16649"></a>16649     <span class="keywordtype">int</span> m, null;
-<a name="l16650"></a>16650     <span class="keywordtype">int</span> halfsize;
-<a name="l16651"></a>16651 
-<a name="l16652"></a>16652     cpl_propertylist * sort;
-<a name="l16653"></a>16653     cpl_table        * slits; 
-<a name="l16654"></a>16654 
-<a name="l16655"></a>16655     slits    = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, nslits_out_det);
-<a name="l16656"></a>16656     halfsize = cpl_table_get_nrow(slits);
-<a name="l16657"></a>16657 
-<a name="l16658"></a>16658     cpl_table_set_size(slits, 2 * halfsize);
-<a name="l16659"></a>16659 
-<a name="l16660"></a>16660     <span class="keywordflow">for</span> (m = 0; m < halfsize; m++) {
-<a name="l16661"></a>16661 
-<a name="l16662"></a>16662         <span class="keywordtype">double</span> gap = 1.4;
-<a name="l16663"></a>16663 
-<a name="l16664"></a>16664         <span class="keywordtype">double</span> length = 
-<a name="l16665"></a>16665             cpl_table_get(slits, <span class="stringliteral">"ytop"</span>,    m, &null) -
-<a name="l16666"></a>16666             cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, m, &null);
-<a name="l16667"></a>16667 
-<a name="l16668"></a>16668         <span class="keywordflow">if</span> (m) {
-<a name="l16669"></a>16669             <span class="keywordtype">double</span> interval = 
-<a name="l16670"></a>16670                 cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, m - 1, &null) -
-<a name="l16671"></a>16671                 cpl_table_get(slits, <span class="stringliteral">"ytop"</span>,    m,     &null);
-<a name="l16672"></a>16672 
-<a name="l16673"></a>16673             gap = (interval - length) / 2;
-<a name="l16674"></a>16674         }
-<a name="l16675"></a>16675 
-<a name="l16676"></a>16676         cpl_table_set(slits, <span class="stringliteral">"slit_id"</span>, m + halfsize,
-<a name="l16677"></a>16677                       cpl_table_get(slits, <span class="stringliteral">"slit_id"</span>, m, &null) - 1);
-<a name="l16678"></a>16678 
-<a name="l16679"></a>16679         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>,    m + halfsize,
-<a name="l16680"></a>16680                       cpl_table_get(slits, <span class="stringliteral">"xtop"</span>,    m, &null));
-<a name="l16681"></a>16681 
-<a name="l16682"></a>16682         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, m + halfsize,
-<a name="l16683"></a>16683                       cpl_table_get(slits, <span class="stringliteral">"xbottom"</span>, m, &null));
-<a name="l16684"></a>16684 
-<a name="l16685"></a>16685         cpl_table_set(slits, <span class="stringliteral">"ytop"</span>,    m + halfsize, 
-<a name="l16686"></a>16686                       cpl_table_get(slits, <span class="stringliteral">"ytop"</span>, m, &null) + gap + length);
-<a name="l16687"></a>16687 
-<a name="l16688"></a>16688         cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, m + halfsize,
-<a name="l16689"></a>16689                       cpl_table_get(slits, <span class="stringliteral">"ytop"</span>, m, &null) + gap);
-<a name="l16690"></a>16690     }
-<a name="l16691"></a>16691 
-<a name="l16692"></a>16692     <span class="keywordflow">for</span> (m = 0; m < 2 * halfsize; m++) {
-<a name="l16693"></a>16693         cpl_table_set(slits, <span class="stringliteral">"ytop"</span>,    m, 
-<a name="l16694"></a>16694                       cpl_table_get(slits, <span class="stringliteral">"ytop"</span>,    m, &null) - 5.3);
-<a name="l16695"></a>16695 
-<a name="l16696"></a>16696         cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, m,
-<a name="l16697"></a>16697                       cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, m, &null) - 5.3);
-<a name="l16698"></a>16698 
-<a name="l16699"></a>16699     }
-<a name="l16700"></a>16700 
-<a name="l16701"></a>16701     sort = cpl_propertylist_new();
-<a name="l16702"></a>16702     cpl_propertylist_append_bool(sort, <span class="stringliteral">"ytop"</span>, 1);
-<a name="l16703"></a>16703     cpl_table_sort(slits, sort);
-<a name="l16704"></a>16704 
-<a name="l16705"></a>16705     cpl_propertylist_delete(sort);
-<a name="l16706"></a>16706 
-<a name="l16707"></a>16707     <span class="keywordflow">return</span> slits;
-<a name="l16708"></a>16708 }
-<a name="l16709"></a>16709 
-<a name="l16710"></a><a class="code" href="group__moses.html#ge887675f0978f93eb562934c909590e7">16710</a> <span class="keywordtype">int</span> * <a class="code" href="group__moses.html#ge887675f0978f93eb562934c909590e7">fors_get_nobjs_perslit</a>(cpl_table * slits)
-<a name="l16711"></a>16711 {
-<a name="l16712"></a>16712     <span class="keywordtype">int</span> nslits  = cpl_table_get_nrow(slits);
-<a name="l16713"></a>16713     <span class="keywordtype">int</span> maxobjs = <a class="code" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">mos_get_maxobjs_per_slit</a>(slits);
-<a name="l16714"></a>16714 
-<a name="l16715"></a>16715     <span class="keywordtype">int</span> * nobjs_per_slit = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>) * nslits);
-<a name="l16716"></a>16716 
-<a name="l16717"></a>16717     <span class="keywordtype">int</span> k, m;
-<a name="l16718"></a>16718 
-<a name="l16719"></a>16719     <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {
-<a name="l16720"></a>16720         <span class="keywordtype">int</span> nobjs = 0;
-<a name="l16721"></a>16721         <span class="keywordflow">for</span> (m = 0; m < maxobjs; m++) {
-<a name="l16722"></a>16722             <span class="keywordtype">char</span> * name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);
-<a name="l16723"></a>16723             <span class="keywordtype">int</span>    null = !cpl_table_is_valid(slits, name, k);
-<a name="l16724"></a>16724 
-<a name="l16725"></a>16725             cpl_free(name);
-<a name="l16726"></a>16726 
-<a name="l16727"></a>16727             <span class="keywordflow">if</span> (null)  <span class="keywordflow">break</span>;
-<a name="l16728"></a>16728             <span class="keywordflow">else</span> nobjs++;
-<a name="l16729"></a>16729         }
-<a name="l16730"></a>16730         
-<a name="l16731"></a>16731         nobjs_per_slit[k] = nobjs;
-<a name="l16732"></a>16732     }
-<a name="l16733"></a>16733 
-<a name="l16734"></a>16734     <span class="keywordflow">return</span> nobjs_per_slit;
-<a name="l16735"></a>16735 }
-<a name="l16736"></a>16736 
-<a name="l16737"></a><a class="code" href="group__moses.html#gf9aaa80a6918561872a29c545aba5f5d">16737</a> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#gf9aaa80a6918561872a29c545aba5f5d">fors_get_object_position</a>(cpl_table *slits, <span class="keywordtype">int</span> slit, <span class="keywordtype">int</span> object)
-<a name="l16738"></a>16738 {
-<a name="l16739"></a>16739     <span class="keywordtype">char</span>   *name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, object);
-<a name="l16740"></a>16740     <span class="keywordtype">double</span>  position;
-<a name="l16741"></a>16741 
-<a name="l16742"></a>16742     position = cpl_table_get_double(slits, name, slit, NULL)
-<a name="l16743"></a>16743              - cpl_table_get_int(slits, <span class="stringliteral">"position"</span>, slit, NULL);
-<a name="l16744"></a>16744 
-<a name="l16745"></a>16745     cpl_free(name);
-<a name="l16746"></a>16746 
-<a name="l16747"></a>16747     <span class="keywordflow">return</span> position;
-<a name="l16748"></a>16748 }
-<a name="l16749"></a>16749 
-<a name="l16750"></a><a class="code" href="group__moses.html#gc189c00acf90455029854a0517e89549">16750</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gc189c00acf90455029854a0517e89549">mos_rebin_signal</a>(cpl_image **image, <span class="keywordtype">int</span> rebin)
-<a name="l16751"></a>16751 {
-<a name="l16752"></a>16752     cpl_image *rebinned;
-<a name="l16753"></a>16753 
-<a name="l16754"></a>16754 
-<a name="l16755"></a>16755     <span class="keywordflow">if</span> (*image == NULL)
-<a name="l16756"></a>16756         <span class="keywordflow">return</span> 1;
-<a name="l16757"></a>16757 
-<a name="l16758"></a>16758     <span class="keywordflow">if</span> (rebin == 1)
-<a name="l16759"></a>16759         <span class="keywordflow">return</span> 0;
-<a name="l16760"></a>16760 
-<a name="l16761"></a>16761     rebinned = cpl_image_rebin(*image, 1, 1, rebin, 1);
-<a name="l16762"></a>16762 
-<a name="l16763"></a>16763     cpl_image_delete(*image);
-<a name="l16764"></a>16764 
-<a name="l16765"></a>16765     *image = rebinned;
-<a name="l16766"></a>16766 
-<a name="l16767"></a>16767     <span class="keywordflow">return</span> 0;
-<a name="l16768"></a>16768 }
-<a name="l16769"></a>16769 
-<a name="l16770"></a><a class="code" href="group__moses.html#gc88e237fcb474d9b3fe7d7caed75f0e3">16770</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gc88e237fcb474d9b3fe7d7caed75f0e3">mos_rebin_error</a>(cpl_image **image, <span class="keywordtype">int</span> rebin)
-<a name="l16771"></a>16771 {
-<a name="l16772"></a>16772     <span class="keywordflow">if</span> (*image == NULL)
-<a name="l16773"></a>16773         <span class="keywordflow">return</span> 1;
-<a name="l16774"></a>16774 
-<a name="l16775"></a>16775     <span class="keywordflow">if</span> (rebin == 1)
-<a name="l16776"></a>16776         <span class="keywordflow">return</span> 0;
-<a name="l16777"></a>16777 
-<a name="l16778"></a>16778     cpl_image_power(*image, 2);
-<a name="l16779"></a>16779     <a class="code" href="group__moses.html#gc189c00acf90455029854a0517e89549">mos_rebin_signal</a>(image, rebin);
-<a name="l16780"></a>16780     cpl_image_power(*image, 0.5);
-<a name="l16781"></a>16781 
-<a name="l16782"></a>16782     <span class="keywordflow">return</span> 0;
-<a name="l16783"></a>16783 }
-<a name="l16784"></a>16784 
-<a name="l16785"></a>16785 <span class="comment">/*</span>
-<a name="l16786"></a>16786 <span class="comment"> * @brief</span>
-<a name="l16787"></a>16787 <span class="comment"> *   Map table values into a 1D image</span>
-<a name="l16788"></a>16788 <span class="comment"> *  </span>
-<a name="l16789"></a>16789 <span class="comment"> * @param image       Target image</span>
-<a name="l16790"></a>16790 <span class="comment"> * @param start       Coordinate of first pixel in image</span>
-<a name="l16791"></a>16791 <span class="comment"> * @param step        Coordinate step for one pixel in image</span>
-<a name="l16792"></a>16792 <span class="comment"> * @param table       Source table</span>
-<a name="l16793"></a>16793 <span class="comment"> * @param xname       Name of coordinate column</span>
-<a name="l16794"></a>16794 <span class="comment"> * @param yname       Name of values column</span>
-<a name="l16795"></a>16795 <span class="comment"> *</span>
-<a name="l16796"></a>16796 <span class="comment"> * @return 0 on success</span>
-<a name="l16797"></a>16797 <span class="comment"> *</span>
-<a name="l16798"></a>16798 <span class="comment"> * The values in @em yname are linearly interpolated at the @em image </span>
-<a name="l16799"></a>16799 <span class="comment"> * pixel coordinates. The @em image must have Nx1 size.</span>
-<a name="l16800"></a>16800 <span class="comment"> */</span>
-<a name="l16801"></a>16801 
-<a name="l16802"></a><a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">16802</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(cpl_image *image, <span class="keywordtype">double</span> start, <span class="keywordtype">double</span> step,
-<a name="l16803"></a>16803               cpl_table *table, <span class="keywordtype">char</span> *xname, <span class="keywordtype">char</span> *yname)
-<a name="l16804"></a>16804 {
-<a name="l16805"></a>16805     <span class="keywordtype">int</span>      length = cpl_image_get_size_x(image);
-<a name="l16806"></a>16806     <span class="keywordtype">int</span>      nrows  = cpl_table_get_nrow(table);
-<a name="l16807"></a>16807     <span class="keywordtype">float</span>   *data   = cpl_image_get_data_float(image);
-<a name="l16808"></a>16808     <span class="keywordtype">float</span>   *fdata  = NULL;
-<a name="l16809"></a>16809     <span class="keywordtype">double</span>  *xdata  = NULL;
-<a name="l16810"></a>16810     <span class="keywordtype">double</span>  *ydata  = NULL;
-<a name="l16811"></a>16811     cpl_type xtype  = cpl_table_get_column_type(table, xname);
-<a name="l16812"></a>16812     cpl_type ytype  = cpl_table_get_column_type(table, yname);
-<a name="l16813"></a>16813     <span class="keywordtype">double</span>   xzero, pos;
-<a name="l16814"></a>16814     <span class="keywordtype">int</span>      i, j, n;
-<a name="l16815"></a>16815 
-<a name="l16816"></a>16816 
-<a name="l16817"></a>16817     <span class="comment">/*</span>
-<a name="l16818"></a>16818 <span class="comment">     * Initialization of output image at 0.0 - this value is left </span>
-<a name="l16819"></a>16819 <span class="comment">     * on non-overlapping portions.</span>
-<a name="l16820"></a>16820 <span class="comment">     */</span>
-<a name="l16821"></a>16821 
-<a name="l16822"></a>16822     <span class="keywordflow">for</span> (i = 0; i < length; i++)
-<a name="l16823"></a>16823         data[i] = 0.0;
-<a name="l16824"></a>16824 
-<a name="l16825"></a>16825 
-<a name="l16826"></a>16826     <span class="comment">/*</span>
-<a name="l16827"></a>16827 <span class="comment">     * Do everything in double precision</span>
-<a name="l16828"></a>16828 <span class="comment">     */</span>
-<a name="l16829"></a>16829 
-<a name="l16830"></a>16830     <span class="keywordflow">if</span> (xtype == CPL_TYPE_FLOAT) {
-<a name="l16831"></a>16831         fdata = cpl_table_get_data_float(table, xname);
-<a name="l16832"></a>16832         xdata = cpl_malloc(nrows * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l16833"></a>16833         <span class="keywordflow">for</span> (i = 0; i < nrows; i++) {
-<a name="l16834"></a>16834            xdata[i] = fdata[i];
-<a name="l16835"></a>16835         }
-<a name="l16836"></a>16836     }
-<a name="l16837"></a>16837     <span class="keywordflow">else</span> {
-<a name="l16838"></a>16838         xdata = cpl_table_get_data_double(table, xname);
-<a name="l16839"></a>16839     }
-<a name="l16840"></a>16840 
-<a name="l16841"></a>16841     <span class="keywordflow">if</span> (ytype == CPL_TYPE_FLOAT) {
-<a name="l16842"></a>16842         fdata = cpl_table_get_data_float(table, yname);
-<a name="l16843"></a>16843         ydata = cpl_malloc(nrows * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l16844"></a>16844         <span class="keywordflow">for</span> (i = 0; i < nrows; i++) {
-<a name="l16845"></a>16845            ydata[i] = fdata[i];
-<a name="l16846"></a>16846         }
-<a name="l16847"></a>16847     }
-<a name="l16848"></a>16848     <span class="keywordflow">else</span> {
-<a name="l16849"></a>16849         ydata = cpl_table_get_data_double(table, yname);
-<a name="l16850"></a>16850     }
-<a name="l16851"></a>16851 
-<a name="l16852"></a>16852     <span class="comment">/*</span>
-<a name="l16853"></a>16853 <span class="comment">     * Mapping</span>
-<a name="l16854"></a>16854 <span class="comment">     */</span>
-<a name="l16855"></a>16855 
-<a name="l16856"></a>16856     n = 0;
-<a name="l16857"></a>16857     xzero = xdata[n];
-<a name="l16858"></a>16858 
-<a name="l16859"></a>16859     <span class="keywordflow">for</span> (i = 0; i < length; i++) {
-<a name="l16860"></a>16860         pos = start + step * i;
-<a name="l16861"></a>16861         <span class="keywordflow">if</span> (pos < xzero)
-<a name="l16862"></a>16862             <span class="keywordflow">continue</span>;
-<a name="l16863"></a>16863         <span class="keywordflow">for</span> (j = n; j < nrows; j++) {
-<a name="l16864"></a>16864             <span class="keywordflow">if</span> (xdata[j] > pos) {
-<a name="l16865"></a>16865                 n = j;
-<a name="l16866"></a>16866                 data[i] = ydata[j-1]
-<a name="l16867"></a>16867                         + (ydata[j] - ydata[j-1])
-<a name="l16868"></a>16868                         * (pos - xdata[j-1]) / (xdata[j] - xdata[j-1]);
-<a name="l16869"></a>16869                 <span class="keywordflow">break</span>;
-<a name="l16870"></a>16870             }
-<a name="l16871"></a>16871         }
-<a name="l16872"></a>16872     }
-<a name="l16873"></a>16873 
-<a name="l16874"></a>16874     <span class="keywordflow">if</span> (xtype == CPL_TYPE_FLOAT)
-<a name="l16875"></a>16875         cpl_free(xdata);
-<a name="l16876"></a>16876 
-<a name="l16877"></a>16877     <span class="keywordflow">if</span> (ytype == CPL_TYPE_FLOAT)
-<a name="l16878"></a>16878         cpl_free(ydata);
-<a name="l16879"></a>16879 
-<a name="l16880"></a>16880     <span class="keywordflow">return</span> 0;
-<a name="l16881"></a>16881 }
-<a name="l16882"></a>16882 
-<a name="l16883"></a>16883 
-<a name="l16884"></a>16884 <span class="comment">/*</span>
-<a name="l16885"></a>16885 <span class="comment"> * @brief</span>
-<a name="l16886"></a>16886 <span class="comment"> *   Fit overall trend of a Nx1 image</span>
-<a name="l16887"></a>16887 <span class="comment"> *  </span>
-<a name="l16888"></a>16888 <span class="comment"> * @param image       Values to smooth</span>
-<a name="l16889"></a>16889 <span class="comment"> * @param order       Order of fitting polynomial</span>
-<a name="l16890"></a>16890 <span class="comment"> * @param hw          Half width of smoothing window</span>
-<a name="l16891"></a>16891 <span class="comment"> *</span>
-<a name="l16892"></a>16892 <span class="comment"> * @return Smoothed image, or NULL on failure.</span>
-<a name="l16893"></a>16893 <span class="comment"> *</span>
-<a name="l16894"></a>16894 <span class="comment"> * Heavily smooth and fit data in the input Nx1 size @em image.</span>
-<a name="l16895"></a>16895 <span class="comment"> */</span>
-<a name="l16896"></a>16896 
-<a name="l16897"></a><a class="code" href="group__moses.html#g031cdfdaafd4ce3f2374478103a3214a">16897</a> <span class="keyword">static</span> cpl_image *<a class="code" href="group__moses.html#g031cdfdaafd4ce3f2374478103a3214a">polysmooth</a>(cpl_image *image, <span class="keywordtype">int</span> order, <span class="keywordtype">int</span> hw)
-<a name="l16898"></a>16898 {
-<a name="l16899"></a>16899     <span class="keywordtype">int</span>             npoints;
-<a name="l16900"></a>16900     cpl_vector     *x;
-<a name="l16901"></a>16901     cpl_vector     *y;
-<a name="l16902"></a>16902     <span class="keywordtype">double</span>         *xdata;
-<a name="l16903"></a>16903     <span class="keywordtype">double</span>         *ydata;
-<a name="l16904"></a>16904     cpl_polynomial *poly;
-<a name="l16905"></a>16905     cpl_vector     *ysmooth;
-<a name="l16906"></a>16906     cpl_image      *smoothed;
-<a name="l16907"></a>16907     <span class="keywordtype">float</span>          *sdata;
-<a name="l16908"></a>16908     <span class="keywordtype">int</span>             i;
-<a name="l16909"></a>16909 
-<a name="l16910"></a>16910 
-<a name="l16911"></a>16911     npoints = cpl_image_get_size_x(image);
-<a name="l16912"></a>16912 
-<a name="l16913"></a>16913     <span class="keywordflow">if</span> (2 * hw + 1 > npoints)
-<a name="l16914"></a>16914         <span class="keywordflow">return</span> NULL;
-<a name="l16915"></a>16915 
-<a name="l16916"></a>16916     x       = cpl_vector_new(npoints);
-<a name="l16917"></a>16917     y       = cpl_vector_new(npoints);
-<a name="l16918"></a>16918     xdata   = cpl_vector_get_data(x);
-<a name="l16919"></a>16919     ydata   = cpl_vector_get_data(y);
-<a name="l16920"></a>16920 
-<a name="l16921"></a>16921     smoothed = cpl_image_duplicate(image);
-<a name="l16922"></a>16922     sdata = cpl_image_get_data_float(smoothed);
-<a name="l16923"></a>16923 
-<a name="l16924"></a>16924     <span class="keywordflow">for</span> (i = 0; i < npoints; i++) {
-<a name="l16925"></a>16925         xdata[i] = i;
-<a name="l16926"></a>16926         ydata[i] = sdata[i];
-<a name="l16927"></a>16927     }
-<a name="l16928"></a>16928 
-<a name="l16929"></a>16929     ysmooth = cpl_vector_filter_median_create(y, hw);
-<a name="l16930"></a>16930     cpl_vector_delete(y);
-<a name="l16931"></a>16931 
-<a name="l16932"></a>16932     poly = cpl_polynomial_fit_1d_create(x, ysmooth, order, NULL);
-<a name="l16933"></a>16933     cpl_vector_delete(x);
-<a name="l16934"></a>16934     cpl_vector_delete(ysmooth);
-<a name="l16935"></a>16935 
-<a name="l16936"></a>16936     <span class="keywordflow">if</span> (poly) {
-<a name="l16937"></a>16937         <span class="keywordflow">for</span> (i = 0; i < npoints; i++)
-<a name="l16938"></a>16938             sdata[i] = cpl_polynomial_eval_1d(poly, i, NULL);
-<a name="l16939"></a>16939     
-<a name="l16940"></a>16940         cpl_polynomial_delete(poly);
-<a name="l16941"></a>16941     }
-<a name="l16942"></a>16942     <span class="keywordflow">else</span> {
-<a name="l16943"></a>16943         cpl_image_delete(smoothed);
-<a name="l16944"></a>16944         <span class="keywordflow">return</span> NULL;
-<a name="l16945"></a>16945     }
-<a name="l16946"></a>16946 
-<a name="l16947"></a>16947     <span class="keywordflow">return</span> smoothed;
-<a name="l16948"></a>16948 }
-<a name="l16949"></a>16949 
-<a name="l16950"></a>16950 <span class="preprocessor">#undef cleanup</span>
-<a name="l16951"></a><a class="code" href="group__moses.html#g57cf6e6e2826eb178fd2d9c3e5695343">16951</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup                       \</span>
-<a name="l16952"></a>16952 <span class="preprocessor">do {                                  \</span>
-<a name="l16953"></a>16953 <span class="preprocessor">    cpl_image_delete(spectrum);       \</span>
-<a name="l16954"></a>16954 <span class="preprocessor">    cpl_image_delete(flux);           \</span>
-<a name="l16955"></a>16955 <span class="preprocessor">    cpl_image_delete(efficiency);     \</span>
-<a name="l16956"></a>16956 <span class="preprocessor">    cpl_image_delete(smo_efficiency); \</span>
-<a name="l16957"></a>16957 <span class="preprocessor">    cpl_image_delete(extinction);     \</span>
-<a name="l16958"></a>16958 <span class="preprocessor">    cpl_image_delete(response);       \</span>
-<a name="l16959"></a>16959 <span class="preprocessor">    cpl_image_delete(smo_response);   \</span>
-<a name="l16960"></a>16960 <span class="preprocessor">    cpl_image_delete(physical);       \</span>
-<a name="l16961"></a>16961 <span class="preprocessor">} while (0)</span>
-<a name="l16962"></a>16962 <span class="preprocessor"></span>
-<a name="l16986"></a><a class="code" href="group__moses.html#gf3dd5a20a5f31b853c53ca419a8171e3">16986</a> cpl_table *<a class="code" href="group__moses.html#gf3dd5a20a5f31b853c53ca419a8171e3">mos_photometric_calibration</a>(cpl_image *spectra, <span class="keywordtype">double</span> startwave, 
-<a name="l16987"></a>16987                                  <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> gain,
-<a name="l16988"></a>16988                                  <span class="keywordtype">double</span> exptime, cpl_table *ext_table,
-<a name="l16989"></a>16989                                  <span class="keywordtype">double</span> airmass, cpl_table *flux_table,
-<a name="l16990"></a>16990                                  <span class="keywordtype">int</span> order)
-<a name="l16991"></a>16991 {
-<a name="l16992"></a>16992 
-<a name="l16993"></a>16993     cpl_image *spectrum       = NULL; <span class="comment">// Extracted standard star spectrum</span>
-<a name="l16994"></a>16994     <span class="keywordtype">float</span>     *data;
-<a name="l16995"></a>16995     cpl_image *extinction     = NULL; <span class="comment">// Extinction binned as "spectrum"</span>
-<a name="l16996"></a>16996     <span class="keywordtype">float</span>     *ext_data;
-<a name="l16997"></a>16997     cpl_image *flux           = NULL; <span class="comment">// Standard star flux binned as "spectrum"</span>
-<a name="l16998"></a>16998     <span class="keywordtype">float</span>     *flux_data;
-<a name="l16999"></a>16999     cpl_image *physical       = NULL; <span class="comment">// Physical units of above</span>
-<a name="l17000"></a>17000     <span class="keywordtype">float</span>     *phys_data;
-<a name="l17001"></a>17001     cpl_image *efficiency     = NULL; <span class="comment">// Raw efficiency curve</span>
-<a name="l17002"></a>17002     <span class="keywordtype">float</span>     *eff_data;
-<a name="l17003"></a>17003     cpl_image *smo_efficiency = NULL; <span class="comment">// Smoothed efficiency curve</span>
-<a name="l17004"></a>17004     <span class="keywordtype">float</span>     *smo_eff_data;
-<a name="l17005"></a>17005     cpl_image *response       = NULL; <span class="comment">// Raw response curve</span>
-<a name="l17006"></a>17006     <span class="keywordtype">float</span>     *res_data;
-<a name="l17007"></a>17007     cpl_image *smo_response   = NULL; <span class="comment">// Smoothed response curve</span>
-<a name="l17008"></a>17008     <span class="keywordtype">float</span>     *smo_res_data;
-<a name="l17009"></a>17009     cpl_image *image;
-<a name="l17010"></a>17010     cpl_image *smo_image;
-<a name="l17011"></a>17011     cpl_table *table;
-<a name="l17012"></a>17012     <span class="keywordtype">float</span>      lambda;
-<a name="l17013"></a>17013     <span class="keywordtype">int</span>        nx, ny;
-<a name="l17014"></a>17014     <span class="keywordtype">int</span>        ext_count, ext_pos;
-<a name="l17015"></a>17015     <span class="keywordtype">int</span>        eff_count, eff_pos;
-<a name="l17016"></a>17016     <span class="keywordtype">int</span>        flux_count, flux_pos;
-<a name="l17017"></a>17017     <span class="keywordtype">int</span>        start, end;
-<a name="l17018"></a>17018     <span class="keywordtype">int</span>        i;
-<a name="l17019"></a>17019 
-<a name="l17020"></a>17020 
-<a name="l17021"></a>17021     <span class="keywordflow">if</span> (spectra == NULL || ext_table == NULL || flux_table == NULL) {
-<a name="l17022"></a>17022         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
-<a name="l17023"></a>17023         <span class="keywordflow">return</span> NULL;
-<a name="l17024"></a>17024     }
-<a name="l17025"></a>17025 
-<a name="l17026"></a>17026     <span class="keywordflow">if</span> (!cpl_table_has_column(ext_table, <span class="stringliteral">"WAVE"</span>)) {
-<a name="l17027"></a>17027         cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND,
-<a name="l17028"></a>17028                               <span class="stringliteral">"Column WAVE in atmospheric extinction table"</span>);
-<a name="l17029"></a>17029         <span class="keywordflow">return</span> NULL;
-<a name="l17030"></a>17030     }
-<a name="l17031"></a>17031 
-<a name="l17032"></a>17032     <span class="keywordflow">if</span> (!cpl_table_has_column(ext_table, <span class="stringliteral">"EXTINCTION"</span>)) {
-<a name="l17033"></a>17033         cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND,
-<a name="l17034"></a>17034                         <span class="stringliteral">"Column EXTINCTION in atmospheric extinction table"</span>);
-<a name="l17035"></a>17035         <span class="keywordflow">return</span> NULL;
-<a name="l17036"></a>17036     }
-<a name="l17037"></a>17037 
-<a name="l17038"></a>17038     <span class="keywordflow">if</span> (!cpl_table_has_column(flux_table, <span class="stringliteral">"WAVE"</span>)) {
-<a name="l17039"></a>17039         cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND,
-<a name="l17040"></a>17040                               <span class="stringliteral">"Column WAVE in standard star flux table"</span>);
-<a name="l17041"></a>17041         <span class="keywordflow">return</span> NULL;
-<a name="l17042"></a>17042     }
-<a name="l17043"></a>17043 
-<a name="l17044"></a>17044     <span class="keywordflow">if</span> (!cpl_table_has_column(flux_table, <span class="stringliteral">"FLUX"</span>)) {
-<a name="l17045"></a>17045         cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND,
-<a name="l17046"></a>17046                               <span class="stringliteral">"Column FLUX in standard star flux table"</span>);
-<a name="l17047"></a>17047         <span class="keywordflow">return</span> NULL;
-<a name="l17048"></a>17048     }
-<a name="l17049"></a>17049 
-<a name="l17050"></a>17050     <span class="keywordflow">if</span> (gain < 0.1) {
-<a name="l17051"></a>17051         cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
-<a name="l17052"></a>17052                               <span class="stringliteral">"Invalid gain factor (%.2f)"</span>, gain);
-<a name="l17053"></a>17053         <span class="keywordflow">return</span> NULL;
-<a name="l17054"></a>17054     }
-<a name="l17055"></a>17055 
-<a name="l17056"></a>17056     <span class="keywordflow">if</span> (exptime < 0.001) {
-<a name="l17057"></a>17057         cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
-<a name="l17058"></a>17058                               <span class="stringliteral">"Invalid exposure time (%.2f)"</span>, exptime);
-<a name="l17059"></a>17059         <span class="keywordflow">return</span> NULL;
-<a name="l17060"></a>17060     }
-<a name="l17061"></a>17061 
-<a name="l17062"></a>17062     <span class="keywordflow">if</span> (dispersion < 0.001) {
-<a name="l17063"></a>17063         cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
-<a name="l17064"></a>17064                               <span class="stringliteral">"Invalid dispersion (%.2f)"</span>, dispersion);
-<a name="l17065"></a>17065         <span class="keywordflow">return</span> NULL;
-<a name="l17066"></a>17066     }
-<a name="l17067"></a>17067 
-<a name="l17068"></a>17068     <span class="keywordflow">if</span> (order < 2) {
-<a name="l17069"></a>17069         cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
-<a name="l17070"></a>17070                               <span class="stringliteral">"Order of the polynomial fitting the "</span>
-<a name="l17071"></a>17071                               <span class="stringliteral">"instrument response must be at least 2"</span>);
-<a name="l17072"></a>17072         <span class="keywordflow">return</span> NULL;
-<a name="l17073"></a>17073     }
-<a name="l17074"></a>17074 
-<a name="l17075"></a>17075     nx = cpl_image_get_size_x(spectra);
-<a name="l17076"></a>17076     ny = cpl_image_get_size_y(spectra);
-<a name="l17077"></a>17077 
-<a name="l17078"></a>17078 
-<a name="l17079"></a>17079     <span class="comment">/*</span>
-<a name="l17080"></a>17080 <span class="comment">     * Find brightest spectrum and duplicate it.</span>
-<a name="l17081"></a>17081 <span class="comment">     */</span>
-<a name="l17082"></a>17082 
-<a name="l17083"></a>17083     <span class="keywordflow">if</span> (ny == 1) {
-<a name="l17084"></a>17084         spectrum = cpl_image_duplicate(spectra);
-<a name="l17085"></a>17085     }
-<a name="l17086"></a>17086     <span class="keywordflow">else</span> {
-<a name="l17087"></a>17087         cpl_size        x, y;
-<a name="l17088"></a>17088         cpl_image *brights = cpl_image_collapse_create(spectra, 1);
-<a name="l17089"></a>17089 
-<a name="l17090"></a>17090         cpl_image_get_maxpos(brights, &x, &y);
-<a name="l17091"></a>17091         cpl_image_delete(brights);
-<a name="l17092"></a>17092         spectrum = cpl_image_extract(spectra, 1, y, nx, y);
-<a name="l17093"></a>17093     }
-<a name="l17094"></a>17094 
-<a name="l17095"></a>17095 
-<a name="l17096"></a>17096     <span class="comment">/*</span>
-<a name="l17097"></a>17097 <span class="comment">     * Convert standard star spectrum in electrons per second per Angstrom.</span>
-<a name="l17098"></a>17098 <span class="comment">     */</span>
-<a name="l17099"></a>17099 
-<a name="l17100"></a>17100     cpl_image_multiply_scalar(spectrum, gain / exptime / dispersion);
-<a name="l17101"></a>17101 
-<a name="l17102"></a>17102 
-<a name="l17103"></a>17103     <span class="comment">/*</span>
-<a name="l17104"></a>17104 <span class="comment">     * Map the atmospheric extinction factors to the same lambda sampling</span>
-<a name="l17105"></a>17105 <span class="comment">     * of the extracted spectrum.</span>
-<a name="l17106"></a>17106 <span class="comment">     */</span>
-<a name="l17107"></a>17107 
-<a name="l17108"></a>17108     extinction = cpl_image_duplicate(spectrum);
-<a name="l17109"></a>17109     <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(extinction, startwave + dispersion/2, dispersion, 
-<a name="l17110"></a>17110               ext_table, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"EXTINCTION"</span>);
-<a name="l17111"></a>17111 
-<a name="l17112"></a>17112 
-<a name="l17113"></a>17113     <span class="comment">/*</span>
-<a name="l17114"></a>17114 <span class="comment">     * Convert from magnitudes to actual flux loss.</span>
-<a name="l17115"></a>17115 <span class="comment">     */</span>
-<a name="l17116"></a>17116 
-<a name="l17117"></a>17117     cpl_image_multiply_scalar(extinction, 0.4 * airmass);
-<a name="l17118"></a>17118     cpl_image_exponential(extinction, 10.);
-<a name="l17119"></a>17119 
-<a name="l17120"></a>17120 
-<a name="l17121"></a>17121     <span class="comment">/*</span>
-<a name="l17122"></a>17122 <span class="comment">     * Correct the scientific spectrum to airmass 0</span>
-<a name="l17123"></a>17123 <span class="comment">     */</span>
-<a name="l17124"></a>17124 
-<a name="l17125"></a>17125     cpl_image_multiply(spectrum, extinction);
-<a name="l17126"></a>17126 
-<a name="l17127"></a>17127 
-<a name="l17128"></a>17128     <span class="comment">/*</span>
-<a name="l17129"></a>17129 <span class="comment">     * Find in what pixel interval (start at "ext_pos", for "ext_count" </span>
-<a name="l17130"></a>17130 <span class="comment">     * pixels) the atmospheric extinction is available.</span>
-<a name="l17131"></a>17131 <span class="comment">     */</span>
-<a name="l17132"></a>17132     
-<a name="l17133"></a>17133     ext_data = cpl_image_get_data_float(extinction);
-<a name="l17134"></a>17134 
-<a name="l17135"></a>17135     ext_count = 0;
-<a name="l17136"></a>17136     ext_pos = 0;
-<a name="l17137"></a>17137     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {
-<a name="l17138"></a>17138         <span class="keywordflow">if</span> (ext_data[i] > 0.0) {
-<a name="l17139"></a>17139             <span class="keywordflow">if</span> (ext_count == 0) {
-<a name="l17140"></a>17140                 ext_pos = i;
-<a name="l17141"></a>17141             }
-<a name="l17142"></a>17142             ext_count++;
-<a name="l17143"></a>17143         }
-<a name="l17144"></a>17144         <span class="keywordflow">else</span> {
-<a name="l17145"></a>17145             <span class="keywordflow">if</span> (ext_count) {
-<a name="l17146"></a>17146                 <span class="keywordflow">break</span>;
-<a name="l17147"></a>17147             }
-<a name="l17148"></a>17148         }
-<a name="l17149"></a>17149     }
-<a name="l17150"></a>17150 
-<a name="l17151"></a>17151     cpl_image_delete(extinction); extinction = NULL;
-<a name="l17152"></a>17152 
-<a name="l17153"></a>17153 
-<a name="l17154"></a>17154     <span class="comment">/*</span>
-<a name="l17155"></a>17155 <span class="comment">     * Map the standard star catalog flux to the same lambda sampling</span>
-<a name="l17156"></a>17156 <span class="comment">     * of the extracted spectrum.</span>
-<a name="l17157"></a>17157 <span class="comment">     */</span>
-<a name="l17158"></a>17158 
-<a name="l17159"></a>17159     flux = cpl_image_duplicate(spectrum);
-<a name="l17160"></a>17160     <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(flux, startwave + dispersion/2, dispersion, 
-<a name="l17161"></a>17161               flux_table, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"FLUX"</span>);
-<a name="l17162"></a>17162 
-<a name="l17163"></a>17163 
-<a name="l17164"></a>17164     <span class="comment">/*</span>
-<a name="l17165"></a>17165 <span class="comment">     * Find in what pixel interval (start at "flux_pos", for "flux_count" </span>
-<a name="l17166"></a>17166 <span class="comment">     * pixels) the standard star flux is available.</span>
-<a name="l17167"></a>17167 <span class="comment">     */</span>
-<a name="l17168"></a>17168     
-<a name="l17169"></a>17169     flux_data = cpl_image_get_data_float(flux);
-<a name="l17170"></a>17170 
-<a name="l17171"></a>17171     flux_count = 0;
-<a name="l17172"></a>17172     flux_pos = 0;
-<a name="l17173"></a>17173     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {
-<a name="l17174"></a>17174         <span class="keywordflow">if</span> (flux_data[i] > 0.0) {
-<a name="l17175"></a>17175             <span class="keywordflow">if</span> (flux_count == 0) {
-<a name="l17176"></a>17176                 flux_pos = i;
-<a name="l17177"></a>17177             }
-<a name="l17178"></a>17178             flux_count++;
-<a name="l17179"></a>17179         }
-<a name="l17180"></a>17180         <span class="keywordflow">else</span> {
-<a name="l17181"></a>17181             <span class="keywordflow">if</span> (flux_count) {
-<a name="l17182"></a>17182                 <span class="keywordflow">break</span>;
-<a name="l17183"></a>17183             }
-<a name="l17184"></a>17184         }
-<a name="l17185"></a>17185     }
-<a name="l17186"></a>17186 
-<a name="l17187"></a>17187 
-<a name="l17188"></a>17188     <span class="comment">/*</span>
-<a name="l17189"></a>17189 <span class="comment">     * Intersection with previous selection</span>
-<a name="l17190"></a>17190 <span class="comment">     */</span>
-<a name="l17191"></a>17191 
-<a name="l17192"></a>17192     start      = ext_pos > flux_pos ? ext_pos : flux_pos;
-<a name="l17193"></a>17193     end        = (ext_pos + ext_count) < (flux_pos + flux_count) ?
-<a name="l17194"></a>17194                  (ext_pos + ext_count) : (flux_pos + flux_count);
-<a name="l17195"></a>17195     flux_pos   = start;
-<a name="l17196"></a>17196     flux_count = end - start;
-<a name="l17197"></a>17197 
-<a name="l17198"></a>17198 
-<a name="l17199"></a>17199     <span class="comment">/*</span>
-<a name="l17200"></a>17200 <span class="comment">     * Convert the flux to photons (per second per Angstrom).</span>
-<a name="l17201"></a>17201 <span class="comment">     * std_flux is in units of erg / cm^2 / s / Angstrom. This</span>
-<a name="l17202"></a>17202 <span class="comment">     * must be multiplied by the efficient area of the telescope,</span>
-<a name="l17203"></a>17203 <span class="comment">     * 5.18E+5 cm^2, and divided by hv (v = frequency). With </span>
-<a name="l17204"></a>17204 <span class="comment">     * hc = 1.98E-8 erg*Angstrom one obtains the following:</span>
-<a name="l17205"></a>17205 <span class="comment">     */</span>
-<a name="l17206"></a>17206 
-<a name="l17207"></a>17207     physical = cpl_image_duplicate(spectrum);
-<a name="l17208"></a>17208     phys_data = cpl_image_get_data_float(physical);
-<a name="l17209"></a>17209 
-<a name="l17210"></a>17210     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {
-<a name="l17211"></a>17211         lambda = startwave + dispersion * (i + 0.5);
-<a name="l17212"></a>17212         phys_data[i] = 0.0026 * lambda * flux_data[i];
-<a name="l17213"></a>17213     }
-<a name="l17214"></a>17214 
-<a name="l17215"></a>17215     efficiency = cpl_image_duplicate(spectrum);
-<a name="l17216"></a>17216     eff_data = cpl_image_get_data_float(efficiency);
-<a name="l17217"></a>17217     data = cpl_image_get_data_float(spectrum);
-<a name="l17218"></a>17218 
-<a name="l17219"></a>17219     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {
-<a name="l17220"></a>17220         <span class="keywordflow">if</span> (phys_data[i] > 0.0)
-<a name="l17221"></a>17221             eff_data[i] = data[i] / phys_data[i];
-<a name="l17222"></a>17222         <span class="keywordflow">else</span>
-<a name="l17223"></a>17223             eff_data[i] = 0.0;
-<a name="l17224"></a>17224     }
-<a name="l17225"></a>17225 
-<a name="l17226"></a>17226     cpl_image_delete(physical); physical = NULL;
-<a name="l17227"></a>17227 
-<a name="l17228"></a>17228 
-<a name="l17229"></a>17229     <span class="comment">/*</span>
-<a name="l17230"></a>17230 <span class="comment">     * Find interval (longer than 300 pixels) where efficiency is </span>
-<a name="l17231"></a>17231 <span class="comment">     * greater than 1%</span>
-<a name="l17232"></a>17232 <span class="comment">     */</span>
-<a name="l17233"></a>17233 
-<a name="l17234"></a>17234     eff_count = 0;
-<a name="l17235"></a>17235     eff_pos = 0;
-<a name="l17236"></a>17236     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {
-<a name="l17237"></a>17237         <span class="keywordflow">if</span> (eff_data[i] > 0.01) {
-<a name="l17238"></a>17238             <span class="keywordflow">if</span> (eff_count == 0) {
-<a name="l17239"></a>17239                 eff_pos = i; 
-<a name="l17240"></a>17240             }
-<a name="l17241"></a>17241             eff_count++;
-<a name="l17242"></a>17242         }
-<a name="l17243"></a>17243         <span class="keywordflow">else</span> {
-<a name="l17244"></a>17244             <span class="keywordflow">if</span> (eff_count > 300) {
-<a name="l17245"></a>17245                 <span class="keywordflow">break</span>;
-<a name="l17246"></a>17246             }
-<a name="l17247"></a>17247         }
-<a name="l17248"></a>17248     }
-<a name="l17249"></a>17249 
-<a name="l17250"></a>17250 
-<a name="l17251"></a>17251     <span class="comment">/*</span>
-<a name="l17252"></a>17252 <span class="comment">     * Intersection with previous selection</span>
-<a name="l17253"></a>17253 <span class="comment">     */</span>
-<a name="l17254"></a>17254 
-<a name="l17255"></a>17255     start      = eff_pos > flux_pos ? eff_pos : flux_pos;
-<a name="l17256"></a>17256     end        = (eff_pos + eff_count) < (flux_pos + flux_count) ?
-<a name="l17257"></a>17257                  (eff_pos + eff_count) : (flux_pos + flux_count);
-<a name="l17258"></a>17258     eff_pos    = start;
-<a name="l17259"></a>17259     eff_count  = end - start;
-<a name="l17260"></a>17260 
-<a name="l17261"></a>17261     <span class="keywordflow">if</span> (eff_count < 1) {
-<a name="l17262"></a>17262         cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,
-<a name="l17263"></a>17263                               <span class="stringliteral">"No overlap between catalog and spectrum"</span>);
-<a name="l17264"></a>17264         <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l17265"></a>17265         <span class="keywordflow">return</span> NULL;
-<a name="l17266"></a>17266     }
-<a name="l17267"></a>17267 
-<a name="l17268"></a>17268 
-<a name="l17269"></a>17269     <span class="comment">/*</span>
-<a name="l17270"></a>17270 <span class="comment">     * Extract only data to fit, i.e., where the efficiency is available.</span>
-<a name="l17271"></a>17271 <span class="comment">     */</span>
-<a name="l17272"></a>17272 
-<a name="l17273"></a>17273     image = cpl_image_extract(efficiency, eff_pos + 1, 1, 
-<a name="l17274"></a>17274                               eff_pos + eff_count, 1);
-<a name="l17275"></a>17275 
-<a name="l17276"></a>17276     smo_image = <a class="code" href="group__moses.html#g031cdfdaafd4ce3f2374478103a3214a">polysmooth</a>(image, order, 50);
-<a name="l17277"></a>17277     cpl_image_delete(image);
-<a name="l17278"></a>17278 
-<a name="l17279"></a>17279     smo_efficiency = cpl_image_duplicate(efficiency);
-<a name="l17280"></a>17280     smo_eff_data = cpl_image_get_data_float(smo_efficiency);
-<a name="l17281"></a>17281     cpl_image_copy(smo_efficiency, smo_image, eff_pos + 1, 1);
-<a name="l17282"></a>17282 
-<a name="l17283"></a>17283     cpl_image_delete(smo_image);
-<a name="l17284"></a>17284 
-<a name="l17285"></a>17285 
-<a name="l17286"></a>17286     <span class="comment">/*</span>
-<a name="l17287"></a>17287 <span class="comment">     * Compute instrument response as the ratio between the catalog</span>
-<a name="l17288"></a>17288 <span class="comment">     * spectrum and the observed spectrum (converted in physical units).</span>
-<a name="l17289"></a>17289 <span class="comment">     * The polynomial smoothing, however, is performed on the inverse</span>
-<a name="l17290"></a>17290 <span class="comment">     * of this ration, for obvious reasons (i.e., no divergence at zero</span>
-<a name="l17291"></a>17291 <span class="comment">     * efficiency).</span>
-<a name="l17292"></a>17292 <span class="comment">     */</span>
-<a name="l17293"></a>17293 
-<a name="l17294"></a>17294     response = cpl_image_duplicate(spectrum);
-<a name="l17295"></a>17295     res_data = cpl_image_get_data_float(response);
-<a name="l17296"></a>17296 
-<a name="l17297"></a>17297     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {
-<a name="l17298"></a>17298         <span class="keywordflow">if</span> (eff_data[i] > 0.01 && flux_data[i] > 0.0)
-<a name="l17299"></a>17299             res_data[i] = data[i] / flux_data[i];
-<a name="l17300"></a>17300         <span class="keywordflow">else</span>
-<a name="l17301"></a>17301             res_data[i] = 0.0;
-<a name="l17302"></a>17302     }
-<a name="l17303"></a>17303 
-<a name="l17304"></a>17304 
-<a name="l17305"></a>17305     <span class="comment">/*</span>
-<a name="l17306"></a>17306 <span class="comment">     * Extract only data to fit, i.e., where the response is available.</span>
-<a name="l17307"></a>17307 <span class="comment">     */</span>
-<a name="l17308"></a>17308 
-<a name="l17309"></a>17309     image = cpl_image_extract(response, eff_pos + 1, 1, eff_pos + eff_count, 1);
-<a name="l17310"></a>17310 
-<a name="l17311"></a>17311     smo_image = <a class="code" href="group__moses.html#g031cdfdaafd4ce3f2374478103a3214a">polysmooth</a>(image, order, 50);
-<a name="l17312"></a>17312     cpl_image_delete(image);
-<a name="l17313"></a>17313 
-<a name="l17314"></a>17314     smo_response = cpl_image_duplicate(response);
-<a name="l17315"></a>17315     smo_res_data = cpl_image_get_data_float(smo_response);
-<a name="l17316"></a>17316     cpl_image_copy(smo_response, smo_image, eff_pos + 1, 1);
-<a name="l17317"></a>17317 
-<a name="l17318"></a>17318     cpl_image_delete(smo_image);
-<a name="l17319"></a>17319 
-<a name="l17320"></a>17320     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {
-<a name="l17321"></a>17321         <span class="keywordflow">if</span> (eff_data[i] > 0.01) {
-<a name="l17322"></a>17322             res_data[i] = 1 / res_data[i];
-<a name="l17323"></a>17323             smo_res_data[i] = 1 / smo_res_data[i];
-<a name="l17324"></a>17324         }
-<a name="l17325"></a>17325         <span class="keywordflow">else</span> {
-<a name="l17326"></a>17326             res_data[i] = 0.0;
-<a name="l17327"></a>17327             smo_res_data[i] = 0.0;
-<a name="l17328"></a>17328         }
-<a name="l17329"></a>17329     }
-<a name="l17330"></a>17330 
-<a name="l17331"></a>17331 
-<a name="l17332"></a>17332     <span class="comment">/*</span>
-<a name="l17333"></a>17333 <span class="comment">     * Assemble the product spectrophotometric table.</span>
-<a name="l17334"></a>17334 <span class="comment">     */</span>
-<a name="l17335"></a>17335 
-<a name="l17336"></a>17336     table = cpl_table_new(nx);
-<a name="l17337"></a>17337 
-<a name="l17338"></a>17338     cpl_table_new_column(table, <span class="stringliteral">"WAVE"</span>, CPL_TYPE_FLOAT);
-<a name="l17339"></a>17339     cpl_table_set_column_unit(table, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"Angstrom"</span>);
-<a name="l17340"></a>17340 
-<a name="l17341"></a>17341     <span class="keywordflow">for</span> (i = 0; i < nx; i++)
-<a name="l17342"></a>17342         cpl_table_set_float(table, <span class="stringliteral">"WAVE"</span>, i, startwave + dispersion*(i+0.5));
-<a name="l17343"></a>17343 
-<a name="l17344"></a>17344     cpl_table_new_column(table, <span class="stringliteral">"STD_FLUX"</span>, CPL_TYPE_FLOAT);
-<a name="l17345"></a>17345     cpl_table_set_column_unit(table, <span class="stringliteral">"STD_FLUX"</span>, 
-<a name="l17346"></a>17346                               <span class="stringliteral">"10^(-16) erg/(cm^2 s Angstrom)"</span>);
-<a name="l17347"></a>17347     cpl_table_copy_data_float(table, <span class="stringliteral">"STD_FLUX"</span>, flux_data);
-<a name="l17348"></a>17348     cpl_image_delete(flux); flux = NULL;
-<a name="l17349"></a>17349 
-<a name="l17350"></a>17350     cpl_table_new_column(table, <span class="stringliteral">"OBS_FLUX"</span>, CPL_TYPE_FLOAT);
-<a name="l17351"></a>17351     cpl_table_set_column_unit(table, <span class="stringliteral">"OBS_FLUX"</span>, <span class="stringliteral">"electron/(s Angstrom)"</span>);
-<a name="l17352"></a>17352     cpl_table_copy_data_float(table, <span class="stringliteral">"OBS_FLUX"</span>, data);
-<a name="l17353"></a>17353     cpl_image_delete(spectrum); spectrum = NULL;
-<a name="l17354"></a>17354 
-<a name="l17355"></a>17355     cpl_table_new_column(table, <span class="stringliteral">"RAW_EFFICIENCY"</span>, CPL_TYPE_FLOAT);
-<a name="l17356"></a>17356     cpl_table_set_column_unit(table, <span class="stringliteral">"RAW_EFFICIENCY"</span>, <span class="stringliteral">"electron/photon"</span>);
-<a name="l17357"></a>17357     cpl_table_copy_data_float(table, <span class="stringliteral">"RAW_EFFICIENCY"</span>, eff_data);
-<a name="l17358"></a>17358     cpl_image_delete(efficiency); efficiency = NULL;
-<a name="l17359"></a>17359 
-<a name="l17360"></a>17360     cpl_table_new_column(table, <span class="stringliteral">"EFFICIENCY"</span>, CPL_TYPE_FLOAT);
-<a name="l17361"></a>17361     cpl_table_set_column_unit(table, <span class="stringliteral">"EFFICIENCY"</span>, <span class="stringliteral">"electron/photon"</span>);
-<a name="l17362"></a>17362     cpl_table_copy_data_float(table, <span class="stringliteral">"EFFICIENCY"</span>, smo_eff_data);
-<a name="l17363"></a>17363     cpl_image_delete(smo_efficiency); smo_efficiency = NULL;
-<a name="l17364"></a>17364 
-<a name="l17365"></a>17365     cpl_table_new_column(table, <span class="stringliteral">"RAW_RESPONSE"</span>, CPL_TYPE_FLOAT);
-<a name="l17366"></a>17366     cpl_table_set_column_unit(table, <span class="stringliteral">"RAW_RESPONSE"</span>, 
-<a name="l17367"></a>17367                               <span class="stringliteral">"10^(-16) erg/(cm^2 electron)"</span>);
-<a name="l17368"></a>17368     cpl_table_copy_data_float(table, <span class="stringliteral">"RAW_RESPONSE"</span>, res_data);
-<a name="l17369"></a>17369     cpl_image_delete(response); response = NULL;
-<a name="l17370"></a>17370 
-<a name="l17371"></a>17371     cpl_table_new_column(table, <span class="stringliteral">"RESPONSE"</span>, CPL_TYPE_FLOAT);
-<a name="l17372"></a>17372     cpl_table_set_column_unit(table, 
-<a name="l17373"></a>17373                               <span class="stringliteral">"RESPONSE"</span>, <span class="stringliteral">"10^(-16) erg/(cm^2 electron)"</span>);
-<a name="l17374"></a>17374     cpl_table_copy_data_float(table, <span class="stringliteral">"RESPONSE"</span>, smo_res_data);
-<a name="l17375"></a>17375     cpl_image_delete(smo_response); smo_response = NULL;
-<a name="l17376"></a>17376 
-<a name="l17377"></a>17377     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l17378"></a>17378 
-<a name="l17379"></a>17379     <span class="keywordflow">return</span> table;
-<a name="l17380"></a>17380 }
-<a name="l17381"></a>17381 
-<a name="l17382"></a><a class="code" href="group__moses.html#g7bb4d25db0fac83f3d5dfb5e741aaf98">17382</a> <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g7bb4d25db0fac83f3d5dfb5e741aaf98">ksigma_vector</a>(cpl_vector *values, 
-<a name="l17383"></a>17383                             <span class="keywordtype">double</span> klow, <span class="keywordtype">double</span> khigh, <span class="keywordtype">int</span> kiter, <span class="keywordtype">int</span> *good)
-<a name="l17384"></a>17384 {
-<a name="l17385"></a>17385     cpl_vector *accepted;
-<a name="l17386"></a>17386     <span class="keywordtype">double</span>  mean  = 0.0;
-<a name="l17387"></a>17387     <span class="keywordtype">double</span>  sigma = 0.0;
-<a name="l17388"></a>17388     <span class="keywordtype">double</span> *data  = cpl_vector_get_data(values);
-<a name="l17389"></a>17389     <span class="keywordtype">int</span>     n     = cpl_vector_get_size(values);
-<a name="l17390"></a>17390     <span class="keywordtype">int</span>     ngood = n;
-<a name="l17391"></a>17391     <span class="keywordtype">int</span>     count = 0;
-<a name="l17392"></a>17392     <span class="keywordtype">int</span>     i;
-<a name="l17393"></a>17393 
-<a name="l17394"></a>17394 
-<a name="l17395"></a>17395     <span class="comment">/*</span>
-<a name="l17396"></a>17396 <span class="comment">     * At first iteration the mean is taken as the median, and the</span>
-<a name="l17397"></a>17397 <span class="comment">     * standard deviation relative to this value is computed.</span>
-<a name="l17398"></a>17398 <span class="comment">     */</span>
-<a name="l17399"></a>17399 
-<a name="l17400"></a>17400     mean = cpl_vector_get_median(values);
-<a name="l17401"></a>17401 
-<a name="l17402"></a>17402     <span class="keywordflow">for</span> (i = 0; i < n; i++) 
-<a name="l17403"></a>17403         sigma += (mean - data[i]) * (mean - data[i]);
-<a name="l17404"></a>17404 
-<a name="l17405"></a>17405     sigma = sqrt(sigma / (n - 1));
-<a name="l17406"></a>17406 
-<a name="l17407"></a>17407     <span class="keywordflow">while</span> (kiter) {
-<a name="l17408"></a>17408         count = 0;
-<a name="l17409"></a>17409         <span class="keywordflow">for</span> (i = 0; i < ngood; i++) {
-<a name="l17410"></a>17410             <span class="keywordflow">if</span> (data[i]-mean < khigh*sigma && mean-data[i] < klow*sigma) {
-<a name="l17411"></a>17411                 data[count] = data[i];
-<a name="l17412"></a>17412                 ++count;
-<a name="l17413"></a>17413             }
-<a name="l17414"></a>17414         }
-<a name="l17415"></a>17415 
-<a name="l17416"></a>17416         <span class="keywordflow">if</span> (count == 0) <span class="comment">// This cannot happen at first iteration.</span>
-<a name="l17417"></a>17417             <span class="keywordflow">break</span>;      <span class="comment">// So we can break: we have already computed a mean.</span>
-<a name="l17418"></a>17418 
-<a name="l17419"></a>17419         <span class="comment">/*</span>
-<a name="l17420"></a>17420 <span class="comment">         * The mean must be computed even if no element was rejected</span>
-<a name="l17421"></a>17421 <span class="comment">         * (count == ngood), because at first iteration median instead </span>
-<a name="l17422"></a>17422 <span class="comment">         * of mean was computed.</span>
-<a name="l17423"></a>17423 <span class="comment">         */</span>
-<a name="l17424"></a>17424 
-<a name="l17425"></a>17425         accepted = cpl_vector_wrap(count, data);
-<a name="l17426"></a>17426         mean = cpl_vector_get_mean(accepted);
-<a name="l17427"></a>17427         <span class="keywordflow">if</span> (count > 1)
-<a name="l17428"></a>17428             sigma = cpl_vector_get_stdev(accepted);
-<a name="l17429"></a>17429         cpl_vector_unwrap(accepted);
-<a name="l17430"></a>17430 
-<a name="l17431"></a>17431         <span class="keywordflow">if</span> (count == ngood || count == 1)
-<a name="l17432"></a>17432             <span class="keywordflow">break</span>;
-<a name="l17433"></a>17433 
-<a name="l17434"></a>17434         ngood = count;
-<a name="l17435"></a>17435         --kiter;
-<a name="l17436"></a>17436     }
-<a name="l17437"></a>17437 
-<a name="l17438"></a>17438     <span class="keywordflow">if</span> (good)
-<a name="l17439"></a>17439         *good = ngood;
-<a name="l17440"></a>17440 
-<a name="l17441"></a>17441     <span class="keywordflow">return</span> mean;
-<a name="l17442"></a>17442 }
-<a name="l17443"></a>17443 
-<a name="l17444"></a>17444 
-<a name="l17463"></a><a class="code" href="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660">17463</a> cpl_image *<a class="code" href="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660">mos_ksigma_stack</a>(cpl_imagelist *imlist, 
-<a name="l17464"></a>17464                             <span class="keywordtype">double</span> klow, <span class="keywordtype">double</span> khigh, <span class="keywordtype">int</span> kiter,
-<a name="l17465"></a>17465                             cpl_image **good)
-<a name="l17466"></a>17466 {
-<a name="l17467"></a>17467     <span class="keywordtype">int</span>         ni, nx, ny, npix;
-<a name="l17468"></a>17468     cpl_image  *out_ima;
-<a name="l17469"></a>17469     <span class="keywordtype">float</span>      *pout_ima;
-<a name="l17470"></a>17470     <span class="keywordtype">float</span>      *good_ima;
-<a name="l17471"></a>17471     cpl_image  *image;
-<a name="l17472"></a>17472     <span class="keywordtype">float</span>     **data;
-<a name="l17473"></a>17473     cpl_vector *time_line;
-<a name="l17474"></a>17474     <span class="keywordtype">double</span>     *ptime_line;
-<a name="l17475"></a>17475     <span class="keywordtype">int</span>         ngood;
-<a name="l17476"></a>17476     <span class="keywordtype">int</span>         i, j;
-<a name="l17477"></a>17477 
-<a name="l17478"></a>17478 
-<a name="l17479"></a>17479     ni         = cpl_imagelist_get_size(imlist);
-<a name="l17480"></a>17480 
-<a name="l17481"></a>17481     image      = cpl_imagelist_get(imlist, 0);
-<a name="l17482"></a>17482     nx         = cpl_image_get_size_x(image);
-<a name="l17483"></a>17483     ny         = cpl_image_get_size_y(image);
-<a name="l17484"></a>17484     npix       = nx * ny;
-<a name="l17485"></a>17485     
-<a name="l17486"></a>17486     out_ima    = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l17487"></a>17487     pout_ima   = cpl_image_get_data_float(out_ima);
-<a name="l17488"></a>17488 
-<a name="l17489"></a>17489     <span class="keywordflow">if</span> (good) {
-<a name="l17490"></a>17490         *good = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l17491"></a>17491         good_ima = cpl_image_get_data_float(*good);
-<a name="l17492"></a>17492     }
-<a name="l17493"></a>17493 
-<a name="l17494"></a>17494     time_line  = cpl_vector_new(ni);
-<a name="l17495"></a>17495     ptime_line = cpl_vector_get_data(time_line);
-<a name="l17496"></a>17496 
-<a name="l17497"></a>17497     data = cpl_calloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span> *), ni);
-<a name="l17498"></a>17498     
-<a name="l17499"></a>17499     <span class="keywordflow">for</span> (i = 0; i < ni; i++) {
-<a name="l17500"></a>17500         image = cpl_imagelist_get(imlist, i);
-<a name="l17501"></a>17501         data[i] = cpl_image_get_data_float(image);
-<a name="l17502"></a>17502     }
-<a name="l17503"></a>17503 
-<a name="l17504"></a>17504     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {
-<a name="l17505"></a>17505         <span class="keywordflow">for</span> (j = 0; j < ni; j++) {
-<a name="l17506"></a>17506             ptime_line[j] = data[j][i];
-<a name="l17507"></a>17507         }
-<a name="l17508"></a>17508         pout_ima[i] = <a class="code" href="group__moses.html#g7bb4d25db0fac83f3d5dfb5e741aaf98">ksigma_vector</a>(time_line, klow, khigh, kiter, &ngood);
-<a name="l17509"></a>17509         <span class="keywordflow">if</span> (good) {
-<a name="l17510"></a>17510             good_ima[i] = ngood;
-<a name="l17511"></a>17511         }
-<a name="l17512"></a>17512     }
-<a name="l17513"></a>17513 
-<a name="l17514"></a>17514     cpl_free(data);
-<a name="l17515"></a>17515     cpl_vector_delete(time_line);
-<a name="l17516"></a>17516 
-<a name="l17517"></a>17517     <span class="keywordflow">return</span> out_ima;
-<a name="l17518"></a>17518 
-<a name="l17519"></a>17519 }
-<a name="l17520"></a>17520 
-<a name="l17521"></a>17521 
-<a name="l17538"></a><a class="code" href="group__moses.html#gd97e4b6ea81acb77e5ef8567a376482b">17538</a> cpl_image *<a class="code" href="group__moses.html#gd97e4b6ea81acb77e5ef8567a376482b">mos_apply_photometry</a>(cpl_image *spectra, cpl_table *response,
-<a name="l17539"></a>17539                                 cpl_table *ext_table, <span class="keywordtype">double</span> startwave,
-<a name="l17540"></a>17540                                 <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> gain,
-<a name="l17541"></a>17541                                 <span class="keywordtype">double</span> exptime, <span class="keywordtype">double</span> airmass)
-<a name="l17542"></a>17542 {
-<a name="l17543"></a>17543     cpl_image *extinction;
-<a name="l17544"></a>17544     cpl_image *outspectra;
-<a name="l17545"></a>17545     cpl_image *mapresponse;
-<a name="l17546"></a>17546     <span class="keywordtype">float</span>     *res_data;
-<a name="l17547"></a>17547     <span class="keywordtype">float</span>     *out_data;
-<a name="l17548"></a>17548     <span class="keywordtype">float</span>     *ext_data;
-<a name="l17549"></a>17549     <span class="keywordtype">int</span>        tlength, xlength, ylength;
-<a name="l17550"></a>17550     <span class="keywordtype">int</span>        i, j, k;
-<a name="l17551"></a>17551 
-<a name="l17552"></a>17552 
-<a name="l17553"></a>17553     <span class="keywordflow">if</span> (spectra == NULL || ext_table == NULL || response == NULL) {
-<a name="l17554"></a>17554         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
-<a name="l17555"></a>17555         <span class="keywordflow">return</span> NULL;
-<a name="l17556"></a>17556     }
-<a name="l17557"></a>17557 
-<a name="l17558"></a>17558     res_data = cpl_table_get_data_float(response, <span class="stringliteral">"RESPONSE"</span>);
-<a name="l17559"></a>17559 
-<a name="l17560"></a>17560     <span class="keywordflow">if</span> (res_data == NULL) {
-<a name="l17561"></a>17561         cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l17562"></a>17562         <span class="keywordflow">return</span> NULL;
-<a name="l17563"></a>17563     }
-<a name="l17564"></a>17564 
-<a name="l17565"></a>17565     tlength = cpl_table_get_nrow(response);
-<a name="l17566"></a>17566     xlength = cpl_image_get_size_x(spectra);
-<a name="l17567"></a>17567     ylength = cpl_image_get_size_y(spectra);
-<a name="l17568"></a>17568 
-<a name="l17569"></a>17569     <span class="keywordflow">if</span> (xlength != tlength) {
-<a name="l17570"></a>17570         mapresponse = cpl_image_new(xlength, 1, CPL_TYPE_FLOAT);
-<a name="l17571"></a>17571         <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(mapresponse, startwave + dispersion/2, dispersion,
-<a name="l17572"></a>17572                   response, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"RESPONSE"</span>);
-<a name="l17573"></a>17573         res_data = cpl_image_get_data_float(mapresponse);
-<a name="l17574"></a>17574     }
-<a name="l17575"></a>17575 
-<a name="l17576"></a>17576     <span class="comment">/*</span>
-<a name="l17577"></a>17577 <span class="comment">     * Map the atmospheric extinction factors to the same lambda sampling</span>
-<a name="l17578"></a>17578 <span class="comment">     * of the extracted spectrum.</span>
-<a name="l17579"></a>17579 <span class="comment">     */</span>
-<a name="l17580"></a>17580 
-<a name="l17581"></a>17581     extinction = cpl_image_new(xlength, 1, CPL_TYPE_FLOAT);
-<a name="l17582"></a>17582     <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(extinction, startwave + dispersion/2, dispersion,
-<a name="l17583"></a>17583               ext_table, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"EXTINCTION"</span>);
-<a name="l17584"></a>17584 
-<a name="l17585"></a>17585 
-<a name="l17586"></a>17586     <span class="comment">/*</span>
-<a name="l17587"></a>17587 <span class="comment">     * Convert from magnitudes to actual flux loss.</span>
-<a name="l17588"></a>17588 <span class="comment">     */</span>
-<a name="l17589"></a>17589 
-<a name="l17590"></a>17590     cpl_image_multiply_scalar(extinction, 0.4 * airmass);
-<a name="l17591"></a>17591     cpl_image_exponential(extinction, 10.);
-<a name="l17592"></a>17592 
-<a name="l17593"></a>17593     outspectra = cpl_image_duplicate(spectra);
-<a name="l17594"></a>17594 
-<a name="l17595"></a>17595     ext_data = cpl_image_get_data_float(extinction);
-<a name="l17596"></a>17596     out_data = cpl_image_get_data_float(outspectra);
-<a name="l17597"></a>17597 
-<a name="l17598"></a>17598     <span class="keywordflow">for</span> (k = 0, i = 0; i < ylength; i++) {
-<a name="l17599"></a>17599         <span class="keywordflow">for</span> (j = 0; j < xlength; j++, k++) {
-<a name="l17600"></a>17600             out_data[k] *= ext_data[j] * res_data[j];
-<a name="l17601"></a>17601         }
-<a name="l17602"></a>17602     }
-<a name="l17603"></a>17603 
-<a name="l17604"></a>17604     cpl_image_delete(extinction);
-<a name="l17605"></a>17605     <span class="keywordflow">if</span> (xlength != tlength) {
-<a name="l17606"></a>17606         cpl_image_delete(mapresponse);
-<a name="l17607"></a>17607     }
-<a name="l17608"></a>17608 
-<a name="l17609"></a>17609     cpl_image_multiply_scalar(outspectra, gain / exptime / dispersion);
-<a name="l17610"></a>17610 
-<a name="l17611"></a>17611     <span class="keywordflow">return</span> outspectra;
-<a name="l17612"></a>17612 }
-<a name="l17613"></a>17613 
-<a name="l17614"></a>17614 
-<a name="l17631"></a><a class="code" href="group__moses.html#ge20fadc56d3b4506d4ffd3015f394695">17631</a> cpl_image *<a class="code" href="group__moses.html#ge20fadc56d3b4506d4ffd3015f394695">mos_propagate_photometry_error</a>(cpl_image *spectra, 
-<a name="l17632"></a>17632                                           cpl_image *errors, 
-<a name="l17633"></a>17633                                           cpl_table *response,
-<a name="l17634"></a>17634                                           cpl_table *ext_table, 
-<a name="l17635"></a>17635                                           <span class="keywordtype">double</span> startwave,
-<a name="l17636"></a>17636                                           <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> gain,
-<a name="l17637"></a>17637                                           <span class="keywordtype">double</span> exptime, <span class="keywordtype">double</span> airmass)
-<a name="l17638"></a>17638 {
-<a name="l17639"></a>17639     cpl_image *extinction;
-<a name="l17640"></a>17640     cpl_image *outerrors;
-<a name="l17641"></a>17641     cpl_image *mapresponse;
-<a name="l17642"></a>17642     cpl_image *maperror;
-<a name="l17643"></a>17643     <span class="keywordtype">float</span>     *err_data;
-<a name="l17644"></a>17644     <span class="keywordtype">float</span>     *out_data;
-<a name="l17645"></a>17645     <span class="keywordtype">float</span>     *ext_data;
-<a name="l17646"></a>17646     <span class="keywordtype">float</span>     *res_data;
-<a name="l17647"></a>17647     <span class="keywordtype">float</span>     *spe_data;
-<a name="l17648"></a>17648     <span class="keywordtype">int</span>        tlength, xlength, ylength;
-<a name="l17649"></a>17649     <span class="keywordtype">int</span>        i, j, k;
-<a name="l17650"></a>17650 
-<a name="l17651"></a>17651 
-<a name="l17652"></a>17652     <span class="keywordflow">if</span> (errors == NULL || ext_table == NULL || response == NULL) {
-<a name="l17653"></a>17653         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
-<a name="l17654"></a>17654         <span class="keywordflow">return</span> NULL;
-<a name="l17655"></a>17655     }
-<a name="l17656"></a>17656 
-<a name="l17657"></a>17657     <span class="keywordflow">if</span> (!cpl_table_has_column(response, <span class="stringliteral">"ERROR"</span>)) {
-<a name="l17658"></a>17658         <span class="keywordflow">return</span> <a class="code" href="group__moses.html#gd97e4b6ea81acb77e5ef8567a376482b">mos_apply_photometry</a>(errors, response, ext_table, startwave,
-<a name="l17659"></a>17659                                     dispersion, gain, exptime, airmass);
-<a name="l17660"></a>17660     }
-<a name="l17661"></a>17661 
-<a name="l17662"></a>17662     res_data = cpl_table_get_data_float(response, <span class="stringliteral">"RESPONSE"</span>);
-<a name="l17663"></a>17663 
-<a name="l17664"></a>17664     <span class="keywordflow">if</span> (res_data == NULL) {
-<a name="l17665"></a>17665         cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l17666"></a>17666         <span class="keywordflow">return</span> NULL;
-<a name="l17667"></a>17667     }
-<a name="l17668"></a>17668 
-<a name="l17669"></a>17669     err_data = cpl_table_get_data_float(response, <span class="stringliteral">"ERROR"</span>);
-<a name="l17670"></a>17670 
-<a name="l17671"></a>17671     <span class="keywordflow">if</span> (err_data == NULL) {
-<a name="l17672"></a>17672         cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);
-<a name="l17673"></a>17673         <span class="keywordflow">return</span> NULL;
-<a name="l17674"></a>17674     }
-<a name="l17675"></a>17675 
-<a name="l17676"></a>17676     tlength = cpl_table_get_nrow(response);
-<a name="l17677"></a>17677     xlength = cpl_image_get_size_x(errors);
-<a name="l17678"></a>17678     ylength = cpl_image_get_size_y(errors);
-<a name="l17679"></a>17679 
-<a name="l17680"></a>17680     <span class="keywordflow">if</span> (xlength != tlength) {
-<a name="l17681"></a>17681         mapresponse = cpl_image_new(xlength, 1, CPL_TYPE_FLOAT);
-<a name="l17682"></a>17682         <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(mapresponse, startwave + dispersion/2, dispersion,
-<a name="l17683"></a>17683                   response, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"RESPONSE"</span>);
-<a name="l17684"></a>17684         res_data = cpl_image_get_data_float(mapresponse);
-<a name="l17685"></a>17685 
-<a name="l17686"></a>17686         maperror = cpl_image_new(xlength, 1, CPL_TYPE_FLOAT);
-<a name="l17687"></a>17687         <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(maperror, startwave + dispersion/2, dispersion,
-<a name="l17688"></a>17688                   response, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"ERROR"</span>);
-<a name="l17689"></a>17689         err_data = cpl_image_get_data_float(maperror);
-<a name="l17690"></a>17690     }
-<a name="l17691"></a>17691 
-<a name="l17692"></a>17692     <span class="comment">/*</span>
-<a name="l17693"></a>17693 <span class="comment">     * Map the atmospheric extinction factors to the same lambda sampling</span>
-<a name="l17694"></a>17694 <span class="comment">     * of the extracted spectrum.</span>
-<a name="l17695"></a>17695 <span class="comment">     */</span>
-<a name="l17696"></a>17696 
-<a name="l17697"></a>17697     extinction = cpl_image_new(xlength, 1, CPL_TYPE_FLOAT);
-<a name="l17698"></a>17698     <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(extinction, startwave + dispersion/2, dispersion,
-<a name="l17699"></a>17699               ext_table, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"EXTINCTION"</span>);
-<a name="l17700"></a>17700 
-<a name="l17701"></a>17701 
-<a name="l17702"></a>17702     <span class="comment">/*</span>
-<a name="l17703"></a>17703 <span class="comment">     * Convert from magnitudes to actual flux loss.</span>
-<a name="l17704"></a>17704 <span class="comment">     */</span>
-<a name="l17705"></a>17705 
-<a name="l17706"></a>17706     cpl_image_multiply_scalar(extinction, 0.4 * airmass);
-<a name="l17707"></a>17707     cpl_image_exponential(extinction, 10.);
-<a name="l17708"></a>17708 
-<a name="l17709"></a>17709     outerrors = cpl_image_duplicate(errors);
-<a name="l17710"></a>17710 
-<a name="l17711"></a>17711     ext_data = cpl_image_get_data_float(extinction);
-<a name="l17712"></a>17712     out_data = cpl_image_get_data_float(outerrors);
-<a name="l17713"></a>17713     spe_data = cpl_image_get_data_float(spectra);
-<a name="l17714"></a>17714 
-<a name="l17715"></a>17715     <span class="keywordflow">for</span> (k = 0, i = 0; i < ylength; i++) {
-<a name="l17716"></a>17716         <span class="keywordflow">for</span> (j = 0; j < xlength; j++, k++) {
-<a name="l17717"></a>17717             out_data[k] = ext_data[j] * 
-<a name="l17718"></a>17718               sqrt(err_data[j] * err_data[j] * spe_data[k] * spe_data[k] +
-<a name="l17719"></a>17719                    res_data[j] * res_data[j] * out_data[k] * out_data[k]);
-<a name="l17720"></a>17720         }
-<a name="l17721"></a>17721     }
-<a name="l17722"></a>17722 
-<a name="l17723"></a>17723     cpl_image_delete(extinction);
-<a name="l17724"></a>17724     <span class="keywordflow">if</span> (xlength != tlength) {
-<a name="l17725"></a>17725         cpl_image_delete(maperror);
-<a name="l17726"></a>17726     }
-<a name="l17727"></a>17727 
-<a name="l17728"></a>17728     cpl_image_multiply_scalar(outerrors, gain / exptime / dispersion);
-<a name="l17729"></a>17729 
-<a name="l17730"></a>17730     <span class="keywordflow">return</span> outerrors;
-<a name="l17731"></a>17731 }
-<a name="l17732"></a>17732 
-<a name="l17733"></a>17733 
-<a name="l17809"></a><a class="code" href="group__moses.html#gd170543de1ad9f6f2e4f1167e3f4ef4e">17809</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gd170543de1ad9f6f2e4f1167e3f4ef4e">mos_check_polarisation</a>(cpl_image *q_image, cpl_image *q_error,
-<a name="l17810"></a>17810                            cpl_image *u_image, cpl_image *u_error,
-<a name="l17811"></a>17811                            <span class="keywordtype">double</span> startwave, <span class="keywordtype">double</span> dispersion,
-<a name="l17812"></a>17812                            <span class="keywordtype">double</span> band, cpl_table *pol_sta,
-<a name="l17813"></a>17813                            <span class="keywordtype">double</span> ra, <span class="keywordtype">double</span> dec, <span class="keywordtype">char</span> *filter, 
-<a name="l17814"></a>17814                            <span class="keywordtype">int</span> *polarisation,
-<a name="l17815"></a>17815                            <span class="keywordtype">double</span> *p_offset, <span class="keywordtype">double</span> *p_error,
-<a name="l17816"></a>17816                            <span class="keywordtype">double</span> *a_offset, <span class="keywordtype">double</span> *a_error)
-<a name="l17817"></a>17817 {
-<a name="l17818"></a>17818     cpl_table *standard;
-<a name="l17819"></a>17819     cpl_image *q_noise;
-<a name="l17820"></a>17820     cpl_image *q_signal;
-<a name="l17821"></a>17821     cpl_image *u_noise;
-<a name="l17822"></a>17822     cpl_image *u_signal;
-<a name="l17823"></a>17823     cpl_image *noise;
-<a name="l17824"></a>17824     <span class="keywordtype">double</span>    *q_ndata;
-<a name="l17825"></a>17825     <span class="keywordtype">double</span>    *q_sdata;
-<a name="l17826"></a>17826     <span class="keywordtype">double</span>    *u_ndata;
-<a name="l17827"></a>17827     <span class="keywordtype">double</span>    *u_sdata;
-<a name="l17828"></a>17828     <span class="keywordtype">double</span>     arctol = 0.5;  <span class="comment">/* Arc tolerance in degrees */</span>
-<a name="l17829"></a>17829     <span class="keywordtype">double</span>     mindist;
-<a name="l17830"></a>17830     <span class="keywordtype">double</span>     cwave;
-<a name="l17831"></a>17831     <span class="keywordtype">double</span>     bwave[] = {3650., 4450., 5510., 6580., 8060};
-<a name="l17832"></a>17832     <span class="keywordtype">char</span>      *bands = <span class="stringliteral">"UBVRI"</span>;
-<a name="l17833"></a>17833     <span class="keywordtype">char</span>       p_label[] = {<span class="charliteral">' '</span>, <span class="charliteral">'p'</span>, <span class="charliteral">'\0'</span>};
-<a name="l17834"></a>17834     <span class="keywordtype">char</span>       dp_label[] = {<span class="charliteral">' '</span>, <span class="charliteral">'d'</span>, <span class="charliteral">'p'</span>, <span class="charliteral">'\0'</span>};
-<a name="l17835"></a>17835     <span class="keywordtype">char</span>       a_label[] = {<span class="charliteral">' '</span>, <span class="charliteral">'a'</span>, <span class="charliteral">'\0'</span>};
-<a name="l17836"></a>17836     <span class="keywordtype">char</span>       da_label[] = {<span class="charliteral">' '</span>, <span class="charliteral">'d'</span>, <span class="charliteral">'a'</span>, <span class="charliteral">'\0'</span>};
-<a name="l17837"></a>17837     <span class="keywordtype">int</span>        nbands = strlen(bands);
-<a name="l17838"></a>17838     <span class="keywordtype">int</span>        selected;
-<a name="l17839"></a>17839     <span class="keywordtype">int</span>        first, last, count, center;
-<a name="l17840"></a>17840     <span class="keywordtype">int</span>        nx;
-<a name="l17841"></a>17841     cpl_size   col, row;
-<a name="l17842"></a>17842     <span class="keywordtype">int</span>        i, found, closest;
-<a name="l17843"></a>17843     <span class="keywordtype">int</span>        pband;
-<a name="l17844"></a>17844     <span class="keywordtype">int</span>        polarised;
-<a name="l17845"></a>17845     <span class="keywordtype">double</span>     q_obs;
-<a name="l17846"></a>17846     <span class="keywordtype">double</span>     q_err;
-<a name="l17847"></a>17847     <span class="keywordtype">double</span>     u_obs;
-<a name="l17848"></a>17848     <span class="keywordtype">double</span>     u_err;
-<a name="l17849"></a>17849     <span class="keywordtype">double</span>     p_obs;
-<a name="l17850"></a>17850     <span class="keywordtype">double</span>     p_err;
-<a name="l17851"></a>17851     <span class="keywordtype">double</span>     p_ref;
-<a name="l17852"></a>17852     <span class="keywordtype">double</span>     dp_ref;
-<a name="l17853"></a>17853     <span class="keywordtype">double</span>     a_obs;
-<a name="l17854"></a>17854     <span class="keywordtype">double</span>     a_err;
-<a name="l17855"></a>17855     <span class="keywordtype">double</span>     a_ref;
-<a name="l17856"></a>17856     <span class="keywordtype">double</span>     da_ref;
-<a name="l17857"></a>17857 
-<a name="l17858"></a>17858 
-<a name="l17859"></a>17859     *filter       = <span class="charliteral">'\0'</span>;
-<a name="l17860"></a>17860     *polarisation = 0;
-<a name="l17861"></a>17861     *p_offset     = 0.0;
-<a name="l17862"></a>17862     *p_error      = 0.0;
-<a name="l17863"></a>17863     *a_offset     = 0.0;
-<a name="l17864"></a>17864     *a_error      = 0.0;
-<a name="l17865"></a>17865 
-<a name="l17866"></a>17866     <span class="comment">/*</span>
-<a name="l17867"></a>17867 <span class="comment">     * Select reference standard star</span>
-<a name="l17868"></a>17868 <span class="comment">     */</span>
-<a name="l17869"></a>17869 
-<a name="l17870"></a>17870     cpl_table_select_all(pol_sta);
-<a name="l17871"></a>17871     cpl_table_and_selected_double(pol_sta, <span class="stringliteral">"RA"</span>,  CPL_GREATER_THAN, ra-arctol);
-<a name="l17872"></a>17872     cpl_table_and_selected_double(pol_sta, <span class="stringliteral">"RA"</span>,  CPL_LESS_THAN,    ra+arctol);
-<a name="l17873"></a>17873     cpl_table_and_selected_double(pol_sta, <span class="stringliteral">"DEC"</span>, CPL_GREATER_THAN, dec-arctol);
-<a name="l17874"></a>17874     selected =
-<a name="l17875"></a>17875     cpl_table_and_selected_double(pol_sta, <span class="stringliteral">"DEC"</span>, CPL_LESS_THAN,    dec+arctol);
-<a name="l17876"></a>17876 
-<a name="l17877"></a>17877     <span class="keywordflow">if</span> (selected == 0) {
-<a name="l17878"></a>17878         cpl_msg_warning(cpl_func, <span class="stringliteral">"No standard star found in FOV"</span>);
-<a name="l17879"></a>17879         <span class="keywordflow">return</span> 1;
-<a name="l17880"></a>17880     }
-<a name="l17881"></a>17881 
-<a name="l17882"></a>17882     <span class="keywordflow">if</span> (selected > 1) {
-<a name="l17883"></a>17883         cpl_msg_warning(cpl_func, 
-<a name="l17884"></a>17884                         <span class="stringliteral">"Ambiguity: %d standard stars found in FOV"</span>, selected);
-<a name="l17885"></a>17885         <span class="keywordflow">return</span> 1;
-<a name="l17886"></a>17886     }
-<a name="l17887"></a>17887 
-<a name="l17888"></a>17888     standard = cpl_table_extract_selected(pol_sta);
-<a name="l17889"></a>17889 
-<a name="l17890"></a>17890     cpl_msg_info(cpl_func, <span class="stringliteral">"Standard star: %s"</span>, 
-<a name="l17891"></a>17891                  cpl_table_get_string(standard, <span class="stringliteral">"name"</span>, 0));
-<a name="l17892"></a>17892 
-<a name="l17893"></a>17893     <span class="comment">/*</span>
-<a name="l17894"></a>17894 <span class="comment">     * Check whether the star is polarised or not</span>
-<a name="l17895"></a>17895 <span class="comment">     */</span>
-<a name="l17896"></a>17896 
-<a name="l17897"></a>17897     polarised = cpl_table_get_int(standard,  <span class="stringliteral">"polarised"</span>, 0, NULL);
-<a name="l17898"></a>17898 
-<a name="l17899"></a>17899     cpl_msg_info(cpl_func, <span class="stringliteral">"This star is%sexpected to be polarised"</span>,
-<a name="l17900"></a>17900                  polarised ? <span class="stringliteral">" "</span> : <span class="stringliteral">" not "</span>);
-<a name="l17901"></a>17901 
-<a name="l17902"></a>17902 
-<a name="l17903"></a>17903     <span class="comment">/*</span>
-<a name="l17904"></a>17904 <span class="comment">     * Determine the image row with the smallest median noise: this </span>
-<a name="l17905"></a>17905 <span class="comment">     * row is assumed to refer to the standard star.</span>
-<a name="l17906"></a>17906 <span class="comment">     * (note: the higher the S/N ratio of the original spectra, the </span>
-<a name="l17907"></a>17907 <span class="comment">     * smaller the noise of the Stokes parameters Q and U).</span>
-<a name="l17908"></a>17908 <span class="comment">     */</span>
-<a name="l17909"></a>17909 
-<a name="l17910"></a>17910     nx = cpl_image_get_size_x(q_error);
-<a name="l17911"></a>17911 
-<a name="l17912"></a>17912     noise = cpl_image_collapse_median_create(q_error, 1, 0, 0);
-<a name="l17913"></a>17913     cpl_image_get_minpos(noise, &col, &row);
-<a name="l17914"></a>17914 
-<a name="l17915"></a>17915     cpl_image_delete(noise);
-<a name="l17916"></a>17916 
-<a name="l17917"></a>17917     <span class="keywordflow">if</span> (col != 1) {
-<a name="l17918"></a>17918         cpl_table_delete(standard);
-<a name="l17919"></a>17919         cpl_msg_error(cpl_func, 
-<a name="l17920"></a>17920                       <span class="stringliteral">"Assertion failure!!! col = %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" (it should be 1)"</span>, col);
-<a name="l17921"></a>17921         <span class="keywordflow">return</span> 1;
-<a name="l17922"></a>17922     }
-<a name="l17923"></a>17923 
-<a name="l17924"></a>17924     q_signal = cpl_image_extract(q_image, 1, row, nx, row);
-<a name="l17925"></a>17925     q_noise  = cpl_image_extract(q_error, 1, row, nx, row);
-<a name="l17926"></a>17926     u_signal = cpl_image_extract(u_image, 1, row, nx, row);
-<a name="l17927"></a>17927     u_noise  = cpl_image_extract(u_error, 1, row, nx, row);
-<a name="l17928"></a>17928 
-<a name="l17929"></a>17929     q_sdata = cpl_image_get_data_double(q_signal);
-<a name="l17930"></a>17930     q_ndata = cpl_image_get_data_double(q_noise);
-<a name="l17931"></a>17931     u_sdata = cpl_image_get_data_double(u_signal);
-<a name="l17932"></a>17932     u_ndata = cpl_image_get_data_double(u_noise);
-<a name="l17933"></a>17933 
-<a name="l17934"></a>17934 
-<a name="l17935"></a>17935     <span class="comment">/*</span>
-<a name="l17936"></a>17936 <span class="comment">     * Determine valid interval in input images (where error is positive).</span>
-<a name="l17937"></a>17937 <span class="comment">     */</span>
-<a name="l17938"></a>17938 
-<a name="l17939"></a>17939     first = -1;
-<a name="l17940"></a>17940     last = nx = cpl_image_get_size_x(q_signal);
-<a name="l17941"></a>17941     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {
-<a name="l17942"></a>17942         <span class="keywordflow">if</span> (first < 0) {
-<a name="l17943"></a>17943             <span class="keywordflow">if</span> (q_ndata[i] > 0.0) {
-<a name="l17944"></a>17944                 first = i;
-<a name="l17945"></a>17945             }
-<a name="l17946"></a>17946         }
-<a name="l17947"></a>17947         <span class="keywordflow">else</span> {
-<a name="l17948"></a>17948             <span class="keywordflow">if</span> (q_ndata[i] <= 0.0) {
-<a name="l17949"></a>17949                 last = i - 1;
-<a name="l17950"></a>17950                 <span class="keywordflow">break</span>;
-<a name="l17951"></a>17951             }
-<a name="l17952"></a>17952         }
-<a name="l17953"></a>17953     }
-<a name="l17954"></a>17954 
-<a name="l17955"></a>17955     count = last - first + 1;
-<a name="l17956"></a>17956 
-<a name="l17957"></a>17957     <span class="keywordflow">if</span> (first < 0 || count < band) {
-<a name="l17958"></a>17958         cpl_table_delete(standard);
-<a name="l17959"></a>17959         cpl_image_delete(q_signal);
-<a name="l17960"></a>17960         cpl_image_delete(q_noise);
-<a name="l17961"></a>17961         cpl_image_delete(u_signal);
-<a name="l17962"></a>17962         cpl_image_delete(u_noise);
-<a name="l17963"></a>17963         cpl_msg_warning(cpl_func, <span class="stringliteral">"Too short spectrum (%d pixels)"</span>, count);
-<a name="l17964"></a>17964         <span class="keywordflow">return</span> 1;
-<a name="l17965"></a>17965     }
-<a name="l17966"></a>17966 
-<a name="l17967"></a>17967     center = (first + last) / 2;              <span class="comment">// Center of valid spectrum</span>
-<a name="l17968"></a>17968     cwave = startwave + dispersion * center;  <span class="comment">// Corresponding wavelength</span>
-<a name="l17969"></a>17969 
-<a name="l17970"></a>17970 
-<a name="l17971"></a>17971     <span class="comment">/*</span>
-<a name="l17972"></a>17972 <span class="comment">     * Find the band UBVRI closest to the central wavelength.</span>
-<a name="l17973"></a>17973 <span class="comment">     */</span>
-<a name="l17974"></a>17974 
-<a name="l17975"></a>17975     found = 0;
-<a name="l17976"></a>17976     <span class="keywordflow">for</span> (i = 0; i < nbands; i++) {
-<a name="l17977"></a>17977         p_label[0] = bands[i];
-<a name="l17978"></a>17978         <span class="keywordflow">if</span> (cpl_table_is_valid(standard, p_label, 0)) {
-<a name="l17979"></a>17979             <span class="keywordflow">if</span> (found == 0) {
-<a name="l17980"></a>17980                 found = 1;
-<a name="l17981"></a>17981                 mindist = fabs(bwave[i] - cwave);
-<a name="l17982"></a>17982                 closest = i;
-<a name="l17983"></a>17983             }
-<a name="l17984"></a>17984             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mindist > fabs(bwave[i] - cwave)) {
-<a name="l17985"></a>17985                 mindist = fabs(bwave[i] - cwave);
-<a name="l17986"></a>17986                 closest = i;
-<a name="l17987"></a>17987             }
-<a name="l17988"></a>17988         }
-<a name="l17989"></a>17989     }
-<a name="l17990"></a>17990 
-<a name="l17991"></a>17991     <span class="keywordflow">if</span> (!found) {
-<a name="l17992"></a>17992         cpl_table_delete(standard);
-<a name="l17993"></a>17993         cpl_image_delete(q_signal);
-<a name="l17994"></a>17994         cpl_image_delete(q_noise);
-<a name="l17995"></a>17995         cpl_image_delete(u_signal);
-<a name="l17996"></a>17996         cpl_image_delete(u_noise);
-<a name="l17997"></a>17997         cpl_msg_warning(cpl_func, <span class="stringliteral">"No reference value available"</span>);
-<a name="l17998"></a>17998         <span class="keywordflow">return</span> 1;
-<a name="l17999"></a>17999     }
-<a name="l18000"></a>18000 
-<a name="l18001"></a>18001     center = (bwave[closest] - startwave) / dispersion; <span class="comment">// Center of band (pix)</span>
-<a name="l18002"></a>18002     cwave  =  bwave[closest];                           <span class="comment">// Wavelength of band</span>
-<a name="l18003"></a>18003 
-<a name="l18004"></a>18004 
-<a name="l18005"></a>18005     <span class="comment">/*</span>
-<a name="l18006"></a>18006 <span class="comment">     * Check that the integration interval is entirely contained</span>
-<a name="l18007"></a>18007 <span class="comment">     * in the valid interval, or give it up.</span>
-<a name="l18008"></a>18008 <span class="comment">     */</span>
-<a name="l18009"></a>18009 
-<a name="l18010"></a>18010     pband = floor(band / dispersion);  <span class="comment">// Band width in pixels</span>
-<a name="l18011"></a>18011 
-<a name="l18012"></a>18012     <span class="keywordflow">if</span> (center - pband/2 < first || center + pband/2 > last) {
-<a name="l18013"></a>18013         cpl_table_delete(standard);
-<a name="l18014"></a>18014         cpl_image_delete(q_signal);
-<a name="l18015"></a>18015         cpl_image_delete(q_noise);
-<a name="l18016"></a>18016         cpl_image_delete(u_signal);
-<a name="l18017"></a>18017         cpl_image_delete(u_noise);
-<a name="l18018"></a>18018         cpl_msg_warning(cpl_func, <span class="stringliteral">"No reference value available"</span>);
-<a name="l18019"></a>18019         <span class="keywordflow">return</span> 1;
-<a name="l18020"></a>18020     }
-<a name="l18021"></a>18021 
-<a name="l18022"></a>18022     first = center - pband/2;
-<a name="l18023"></a>18023     last  = center + pband/2;
-<a name="l18024"></a>18024 
-<a name="l18025"></a>18025     <span class="comment">/*</span>
-<a name="l18026"></a>18026 <span class="comment">     * Collect reference values. Note that if angle info is not available,</span>
-<a name="l18027"></a>18027 <span class="comment">     * angle stuff is set automaticaly to zero.</span>
-<a name="l18028"></a>18028 <span class="comment">     */</span>
-<a name="l18029"></a>18029 
-<a name="l18030"></a>18030      p_label[0] = bands[closest];
-<a name="l18031"></a>18031     dp_label[0] = bands[closest];
-<a name="l18032"></a>18032      a_label[0] = bands[closest];
-<a name="l18033"></a>18033     da_label[0] = bands[closest];
-<a name="l18034"></a>18034 
-<a name="l18035"></a>18035      p_ref = cpl_table_get(standard,  p_label, 0, NULL);
-<a name="l18036"></a>18036     dp_ref = cpl_table_get(standard, dp_label, 0, NULL);
-<a name="l18037"></a>18037      a_ref = cpl_table_get(standard,  a_label, 0, NULL);
-<a name="l18038"></a>18038     da_ref = cpl_table_get(standard, da_label, 0, NULL);
-<a name="l18039"></a>18039 
-<a name="l18040"></a>18040     cpl_msg_info(cpl_func, 
-<a name="l18041"></a>18041                  <span class="stringliteral">"The expected polarisation is %.2f +- %.2f %%"</span>, 
-<a name="l18042"></a>18042                  p_ref, dp_ref);
-<a name="l18043"></a>18043 
-<a name="l18044"></a>18044     <span class="keywordflow">if</span> (polarised) {
-<a name="l18045"></a>18045         cpl_msg_info(cpl_func, 
-<a name="l18046"></a>18046                      <span class="stringliteral">"The expected polarisation angle is %.2f +- %.2f degrees"</span>, 
-<a name="l18047"></a>18047                      a_ref, da_ref);
-<a name="l18048"></a>18048     }
-<a name="l18049"></a>18049 
-<a name="l18050"></a>18050     <span class="comment">/*</span>
-<a name="l18051"></a>18051 <span class="comment">     * Find median signal and median error.</span>
-<a name="l18052"></a>18052 <span class="comment">     */</span>
-<a name="l18053"></a>18053 
-<a name="l18054"></a>18054     q_obs = cpl_image_get_median_window(q_image, first, 1, last, 1);
-<a name="l18055"></a>18055     q_err = cpl_image_get_median_window(q_error, first, 1, last, 1);
-<a name="l18056"></a>18056     u_obs = cpl_image_get_median_window(u_image, first, 1, last, 1);
-<a name="l18057"></a>18057     u_err = cpl_image_get_median_window(u_error, first, 1, last, 1);
-<a name="l18058"></a>18058 
-<a name="l18059"></a>18059     <span class="comment">/*</span>
-<a name="l18060"></a>18060 <span class="comment">     * Measured linear polarisation and its error</span>
-<a name="l18061"></a>18061 <span class="comment">     */</span>
-<a name="l18062"></a>18062 
-<a name="l18063"></a>18063     p_obs = sqrt(q_obs * q_obs + u_obs * u_obs);
-<a name="l18064"></a>18064     p_err = CPL_MATH_SQRT1_2 * 0.5 * (q_err + u_err);
-<a name="l18065"></a>18065 
-<a name="l18066"></a>18066     <span class="comment">/*</span>
-<a name="l18067"></a>18067 <span class="comment">     * Measured polarisation angle</span>
-<a name="l18068"></a>18068 <span class="comment">     */</span>
-<a name="l18069"></a>18069 
-<a name="l18070"></a>18070     a_obs = 0.0;
-<a name="l18071"></a>18071     <span class="keywordflow">if</span> (polarised) {
-<a name="l18072"></a>18072         <span class="keywordflow">if</span> (fabs(q_obs) < 0.00001) {
-<a name="l18073"></a>18073             <span class="keywordflow">if</span> (u_obs > 0.0) {
-<a name="l18074"></a>18074                 a_obs = 45.0;
-<a name="l18075"></a>18075             }
-<a name="l18076"></a>18076             <span class="keywordflow">else</span> {
-<a name="l18077"></a>18077                 a_obs = 135.0;
-<a name="l18078"></a>18078             }
-<a name="l18079"></a>18079         }
-<a name="l18080"></a>18080         <span class="keywordflow">else</span> {
-<a name="l18081"></a>18081             a_obs = 0.5 * atan(u_obs / q_obs) * 180 / CPL_MATH_PI;
-<a name="l18082"></a>18082             <span class="keywordflow">if</span> (q_obs > 0.0) {
-<a name="l18083"></a>18083                 <span class="keywordflow">if</span> (u_obs < 0.0) {
-<a name="l18084"></a>18084                     a_obs += 180.;
-<a name="l18085"></a>18085                 }
-<a name="l18086"></a>18086             }
-<a name="l18087"></a>18087             <span class="keywordflow">else</span> {
-<a name="l18088"></a>18088                 a_obs += 90.;
-<a name="l18089"></a>18089             }
-<a name="l18090"></a>18090         }
-<a name="l18091"></a>18091     }
-<a name="l18092"></a>18092 
-<a name="l18093"></a>18093     <span class="comment">/*</span>
-<a name="l18094"></a>18094 <span class="comment">     * Error on polarisation angle</span>
-<a name="l18095"></a>18095 <span class="comment">     */</span>
-<a name="l18096"></a>18096 
-<a name="l18097"></a>18097     a_err = 0.0;
-<a name="l18098"></a>18098     <span class="keywordflow">if</span> (polarised) {
-<a name="l18099"></a>18099         a_err = sqrt(q_obs*q_obs*u_err*u_err + u_obs*u_obs*q_err*q_err)
-<a name="l18100"></a>18100               / (p_obs * p_obs) 
-<a name="l18101"></a>18101               * 90 / CPL_MATH_PI;
-<a name="l18102"></a>18102     }
-<a name="l18103"></a>18103 
-<a name="l18104"></a>18104     p_obs *= 100;
-<a name="l18105"></a>18105     p_err *= 100;
-<a name="l18106"></a>18106     cpl_msg_info(cpl_func, 
-<a name="l18107"></a>18107                  <span class="stringliteral">"The measured polarisation is %.2f +- %.2f %%"</span>, 
-<a name="l18108"></a>18108                  p_obs, p_err);
-<a name="l18109"></a>18109 
-<a name="l18110"></a>18110     <span class="keywordflow">if</span> (polarised) {
-<a name="l18111"></a>18111         cpl_msg_info(cpl_func, 
-<a name="l18112"></a>18112                      <span class="stringliteral">"The measured polarisation angle is %.2f +- %.2f degrees"</span>, 
-<a name="l18113"></a>18113                      a_obs, a_err);
-<a name="l18114"></a>18114     }
-<a name="l18115"></a>18115 
-<a name="l18116"></a>18116     *filter       = bands[closest];
-<a name="l18117"></a>18117     *polarisation = polarised;
-<a name="l18118"></a>18118 
-<a name="l18119"></a>18119     <span class="keywordflow">if</span> (polarised) {
-<a name="l18120"></a>18120         *p_offset = (p_obs - p_ref) / p_ref;
-<a name="l18121"></a>18121         *p_error  = sqrt(p_err * p_err + dp_ref * dp_ref) / p_ref;
-<a name="l18122"></a>18122     }
-<a name="l18123"></a>18123     <span class="keywordflow">else</span> {
-<a name="l18124"></a>18124         *p_offset = p_obs - p_ref;
-<a name="l18125"></a>18125         *p_error  = sqrt(p_err * p_err + dp_ref * dp_ref);
-<a name="l18126"></a>18126     }
-<a name="l18127"></a>18127 
-<a name="l18128"></a>18128     *a_offset     = a_obs - a_ref;
-<a name="l18129"></a>18129     *a_error      = sqrt(a_err*a_err + da_ref*da_ref);
-<a name="l18130"></a>18130 
-<a name="l18131"></a>18131     <span class="keywordflow">return</span> 0;
-<a name="l18132"></a>18132 
-<a name="l18133"></a>18133 }
-<a name="l18134"></a>18134 
-<a name="l18135"></a>18135 
-<a name="l18167"></a><a class="code" href="group__moses.html#ge59e20e2bea761316fa1395d5d406965">18167</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#ge59e20e2bea761316fa1395d5d406965">mos_compute_offset</a>(cpl_table *reference, cpl_table *objects, <span class="keywordtype">double</span> *offset)
-<a name="l18168"></a>18168 {
-<a name="l18169"></a>18169     cpl_array *offsets;
-<a name="l18170"></a>18170     <span class="keywordtype">int</span>        noffset;
-<a name="l18171"></a>18171     <span class="keywordtype">int</span>        nslits = cpl_table_get_nrow(reference);
-<a name="l18172"></a>18172     <span class="keywordtype">int</span>       *nref;
-<a name="l18173"></a>18173     <span class="keywordtype">int</span>       *nobj;
-<a name="l18174"></a>18174     <span class="keywordtype">int</span>        corr, maxcorr;
-<a name="l18175"></a>18175     <span class="keywordtype">int</span>        shift, best_shift;
-<a name="l18176"></a>18176     <span class="keywordtype">int</span>        i, j, k;
-<a name="l18177"></a>18177 
-<a name="l18178"></a>18178     cpl_error_code status = CPL_ERROR_NONE;
-<a name="l18179"></a>18179 
-<a name="l18180"></a>18180 
-<a name="l18181"></a>18181     *offset = 0.0;
-<a name="l18182"></a>18182 
-<a name="l18183"></a>18183     <span class="keywordflow">if</span> (nslits != cpl_table_get_nrow(objects))
-<a name="l18184"></a>18184         <span class="keywordflow">return</span> CPL_ERROR_INCOMPATIBLE_INPUT;
-<a name="l18185"></a>18185 
-<a name="l18186"></a>18186     nref = <a class="code" href="group__moses.html#ge887675f0978f93eb562934c909590e7">fors_get_nobjs_perslit</a>(reference);
-<a name="l18187"></a>18187     nobj = <a class="code" href="group__moses.html#ge887675f0978f93eb562934c909590e7">fors_get_nobjs_perslit</a>(objects);
-<a name="l18188"></a>18188 
-<a name="l18189"></a>18189     noffset = 0;
-<a name="l18190"></a>18190     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)
-<a name="l18191"></a>18191         noffset += nobj[i];
-<a name="l18192"></a>18192 
-<a name="l18193"></a>18193     <span class="keywordflow">if</span> (noffset == 0) {
-<a name="l18194"></a>18194         cpl_free(nref);
-<a name="l18195"></a>18195         cpl_free(nobj);
-<a name="l18196"></a>18196         <span class="keywordflow">return</span> CPL_ERROR_DATA_NOT_FOUND;
-<a name="l18197"></a>18197     }
-<a name="l18198"></a>18198 
-<a name="l18199"></a>18199     noffset = 0;
-<a name="l18200"></a>18200     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)
-<a name="l18201"></a>18201         noffset += nref[i];
-<a name="l18202"></a>18202 
-<a name="l18203"></a>18203     <span class="keywordflow">if</span> (noffset == 0) {
-<a name="l18204"></a>18204         cpl_free(nref);
-<a name="l18205"></a>18205         cpl_free(nobj);
-<a name="l18206"></a>18206         <span class="keywordflow">return</span> CPL_ERROR_DATA_NOT_FOUND;
-<a name="l18207"></a>18207     }
-<a name="l18208"></a>18208 
-<a name="l18209"></a>18209     offsets = cpl_array_new(noffset, CPL_TYPE_DOUBLE);
-<a name="l18210"></a>18210 
-<a name="l18211"></a>18211     noffset = 0;    <span class="comment">// The real number of offsets found will be counted.</span>
-<a name="l18212"></a>18212 
-<a name="l18213"></a>18213     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l18214"></a>18214         <span class="keywordflow">if</span> (nref[i] > 0 && nobj[i] > 0) {
-<a name="l18215"></a>18215             <span class="keywordtype">double</span> shift;
-<a name="l18216"></a>18216             <span class="keywordtype">int</span>    length  = cpl_table_get_int(objects, <span class="stringliteral">"length"</span>, i, NULL);
-<a name="l18217"></a>18217             <span class="keywordtype">double</span> ytop    = cpl_table_get_double(objects, <span class="stringliteral">"xtop"</span>, i, NULL);
-<a name="l18218"></a>18218             <span class="keywordtype">double</span> ybottom = cpl_table_get_double(objects, <span class="stringliteral">"xbottom"</span>, i, NULL);
-<a name="l18219"></a>18219             <span class="keywordtype">int</span>   *aref    = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l18220"></a>18220             <span class="keywordtype">int</span>   *aobj    = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l18221"></a>18221             <span class="keywordtype">float</span> *pref    = cpl_calloc(nref[i], <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));
-<a name="l18222"></a>18222             <span class="keywordtype">float</span> *pobj    = cpl_calloc(nobj[i], <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));
-<a name="l18223"></a>18223             
-<a name="l18224"></a>18224             <span class="keywordflow">for</span> (j = 0; j < nref[i]; j++) {
-<a name="l18225"></a>18225                 pref[j] = <a class="code" href="group__moses.html#gf9aaa80a6918561872a29c545aba5f5d">fors_get_object_position</a>(reference, i, j + 1);
-<a name="l18226"></a>18226                 aref[(int)pref[j]] = 1;
-<a name="l18227"></a>18227             }
-<a name="l18228"></a>18228 
-<a name="l18229"></a>18229             <span class="keywordflow">for</span> (j = 0; j < nobj[i]; j++) {
-<a name="l18230"></a>18230                 pobj[j] = <a class="code" href="group__moses.html#gf9aaa80a6918561872a29c545aba5f5d">fors_get_object_position</a>(objects, i, j + 1);
-<a name="l18231"></a>18231                 aobj[(int)pobj[j]] = 1;
-<a name="l18232"></a>18232             }
-<a name="l18233"></a>18233 
-<a name="l18234"></a>18234             <span class="comment">/*</span>
-<a name="l18235"></a>18235 <span class="comment">             * Do not consider objects at border</span>
-<a name="l18236"></a>18236 <span class="comment">             */</span>
-<a name="l18237"></a>18237 
-<a name="l18238"></a>18238             aref[0] = 0;
-<a name="l18239"></a>18239             aref[length - 1] = 0;
-<a name="l18240"></a>18240             aobj[0] = 0;
-<a name="l18241"></a>18241             aobj[length - 1] = 0;
-<a name="l18242"></a>18242 
-<a name="l18243"></a>18243 <span class="comment">//for (j = 0; j < nref[i]; j++)</span>
-<a name="l18244"></a>18244 <span class="comment">//printf("references: %f, ", pref[j]);</span>
-<a name="l18245"></a>18245 <span class="comment">//printf("\n");</span>
-<a name="l18246"></a>18246 <span class="comment">//for (j = 0; j < nref[i]; j++)</span>
-<a name="l18247"></a>18247 <span class="comment">//printf("objects   : %f, ", pobj[j]);</span>
-<a name="l18248"></a>18248 <span class="comment">//printf("\n");</span>
-<a name="l18249"></a>18249 <span class="comment">//for (j = 0; j < length; j++)</span>
-<a name="l18250"></a>18250 <span class="comment">//printf("%d", aref[j]);</span>
-<a name="l18251"></a>18251 <span class="comment">//printf("\n");</span>
-<a name="l18252"></a>18252 <span class="comment">//for (j = 0; j < length; j++)</span>
-<a name="l18253"></a>18253 <span class="comment">//printf("%d", aobj[j]);</span>
-<a name="l18254"></a>18254 <span class="comment">//printf("\n");</span>
-<a name="l18255"></a>18255 
-<a name="l18256"></a>18256             <span class="comment">/*</span>
-<a name="l18257"></a>18257 <span class="comment">             * Object matching by correlation</span>
-<a name="l18258"></a>18258 <span class="comment">             */</span>
-<a name="l18259"></a>18259 
-<a name="l18260"></a>18260             maxcorr = 0;
-<a name="l18261"></a>18261             best_shift = length;
-<a name="l18262"></a>18262 
-<a name="l18263"></a>18263             <span class="keywordflow">for</span> (shift = length/2, j = 0; j <= length; shift--, j++) {
-<a name="l18264"></a>18264                 <span class="keywordtype">int</span> rstart, ostart, count;
-<a name="l18265"></a>18265 
-<a name="l18266"></a>18266                 <span class="keywordflow">if</span> (shift > 0) {
-<a name="l18267"></a>18267                    rstart = shift;
-<a name="l18268"></a>18268                    ostart = 0;
-<a name="l18269"></a>18269                    count  = length - shift;
-<a name="l18270"></a>18270                 }
-<a name="l18271"></a>18271                 <span class="keywordflow">else</span> {
-<a name="l18272"></a>18272                    rstart = 0;
-<a name="l18273"></a>18273                    ostart = -shift;
-<a name="l18274"></a>18274                    count  = length + shift;
-<a name="l18275"></a>18275                 }
-<a name="l18276"></a>18276 
-<a name="l18277"></a>18277                 corr = 0;
-<a name="l18278"></a>18278                 <span class="keywordflow">for</span> (k = 0; k < count; k++) {
-<a name="l18279"></a>18279                     corr += aref[rstart + k] * aobj[ostart + k];
-<a name="l18280"></a>18280                 }
-<a name="l18281"></a>18281 
-<a name="l18282"></a>18282                 <span class="keywordflow">if</span> (maxcorr < corr) {
-<a name="l18283"></a>18283                     maxcorr = corr;
-<a name="l18284"></a>18284                     best_shift = shift;
-<a name="l18285"></a>18285                 }
-<a name="l18286"></a>18286             }
-<a name="l18287"></a>18287 
-<a name="l18288"></a>18288             <span class="keywordflow">if</span> (best_shift == length) { <span class="comment">// No shift found</span>
-<a name="l18289"></a>18289 <span class="comment">//printf("%d: No shift found\n", i);</span>
-<a name="l18290"></a>18290                 cpl_free(aref);
-<a name="l18291"></a>18291                 cpl_free(aobj);
-<a name="l18292"></a>18292                 cpl_free(pref);
-<a name="l18293"></a>18293                 cpl_free(pobj);
-<a name="l18294"></a>18294                 <span class="keywordflow">continue</span>;
-<a name="l18295"></a>18295             }
-<a name="l18296"></a>18296 <span class="comment">//printf("%d: Integer shift found = %d\n", i, best_shift);</span>
-<a name="l18297"></a>18297 
-<a name="l18298"></a>18298             <span class="keywordflow">for</span> (j = 0; j < nref[i]; j++) {
-<a name="l18299"></a>18299                 <span class="keywordflow">for</span> (k = 0; k < nobj[i]; k++) {
-<a name="l18300"></a>18300                     <span class="keywordflow">if</span> (fabs(pref[j] - pobj[k] - best_shift) < 2) {
-<a name="l18301"></a>18301                        <span class="keywordtype">double</span> ccd_offset = (pref[j] - pobj[k]) 
-<a name="l18302"></a>18302                                          * (ytop - ybottom)
-<a name="l18303"></a>18303                                          / length;
-<a name="l18304"></a>18304 
-<a name="l18305"></a>18305 <span class="comment">//printf("%d: Match found: %f\n", i, ccd_offset);</span>
-<a name="l18306"></a>18306                        <span class="comment">/* </span>
-<a name="l18307"></a>18307 <span class="comment">                        * The matching object is found, store the</span>
-<a name="l18308"></a>18308 <span class="comment">                        * corresponding offset</span>
-<a name="l18309"></a>18309 <span class="comment">                        */</span>
-<a name="l18310"></a>18310 
-<a name="l18311"></a>18311                        cpl_array_set(offsets, noffset, ccd_offset);
-<a name="l18312"></a>18312                        noffset++;
-<a name="l18313"></a>18313                        <span class="keywordflow">break</span>;
-<a name="l18314"></a>18314                     }
-<a name="l18315"></a>18315                 }
-<a name="l18316"></a>18316             }
-<a name="l18317"></a>18317 
-<a name="l18318"></a>18318             cpl_free(aref);
-<a name="l18319"></a>18319             cpl_free(aobj);
-<a name="l18320"></a>18320             cpl_free(pref);
-<a name="l18321"></a>18321             cpl_free(pobj);
-<a name="l18322"></a>18322         }
-<a name="l18323"></a>18323 <span class="comment">//else</span>
-<a name="l18324"></a>18324 <span class="comment">//printf("%d: No object found\n", i);</span>
-<a name="l18325"></a>18325     }
-<a name="l18326"></a>18326 
-<a name="l18327"></a>18327     cpl_free(nref);
-<a name="l18328"></a>18328     cpl_free(nobj);
-<a name="l18329"></a>18329 
-<a name="l18330"></a>18330 <span class="comment">//printf("%d offsets found in total\n", noffset);</span>
-<a name="l18331"></a>18331     <span class="keywordflow">if</span> (noffset > 0) {
-<a name="l18332"></a>18332         <span class="keywordflow">if</span> (noffset % 2) {
-<a name="l18333"></a>18333             *offset = cpl_array_get_median(offsets);
-<a name="l18334"></a>18334         }
-<a name="l18335"></a>18335         <span class="keywordflow">else</span> {
-<a name="l18336"></a>18336             <span class="keywordtype">double</span> *a = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>) * noffset);
-<a name="l18337"></a>18337             <span class="keywordflow">for</span> (i = 0; i < noffset; i++) {
-<a name="l18338"></a>18338                 a[i] = cpl_array_get_double(offsets, i, NULL);
-<a name="l18339"></a>18339             }
-<a name="l18340"></a>18340             *offset = (<a class="code" href="group__fors__utils.html#g4acaddb1c4b5fbc829b3a58434a08458">fors_tools_get_kth_double</a>(a, noffset, (noffset-1)/2) +
-<a name="l18341"></a>18341                        <a class="code" href="group__fors__utils.html#g4acaddb1c4b5fbc829b3a58434a08458">fors_tools_get_kth_double</a>(a, noffset, (noffset/2))) / 2.0;
-<a name="l18342"></a>18342             cpl_free(a);
-<a name="l18343"></a>18343         }
-<a name="l18344"></a>18344     }
-<a name="l18345"></a>18345     <span class="keywordflow">else</span>
-<a name="l18346"></a>18346         status = CPL_ERROR_DATA_NOT_FOUND;
-<a name="l18347"></a>18347 <span class="comment">//printf("Median offset: %f\n", *offset);</span>
-<a name="l18348"></a>18348 
-<a name="l18349"></a>18349     cpl_array_delete(offsets);
-<a name="l18350"></a>18350 
-<a name="l18351"></a>18351     <span class="keywordflow">return</span> status;
-<a name="l18352"></a>18352 
-<a name="l18353"></a>18353 }
-<a name="l18354"></a>18354 
-<a name="l18355"></a>18355 
-<a name="l18367"></a><a class="code" href="group__moses.html#gf708c4804f0aa98415025f2f7ed31f11">18367</a> cpl_error_code <a class="code" href="group__moses.html#gf708c4804f0aa98415025f2f7ed31f11">mos_image_shift</a>(cpl_image *image, <span class="keywordtype">double</span> dx, <span class="keywordtype">double</span> dy)
-<a name="l18368"></a>18368 {
-<a name="l18369"></a>18369     cpl_image *source;
-<a name="l18370"></a>18370     <span class="keywordtype">int</span>        nx = cpl_image_get_size_x(image);
-<a name="l18371"></a>18371     <span class="keywordtype">int</span>        ny = cpl_image_get_size_y(image);
-<a name="l18372"></a>18372     <span class="keywordtype">float</span>     *idata;
-<a name="l18373"></a>18373     <span class="keywordtype">float</span>     *sdata;
-<a name="l18374"></a>18374     <span class="keywordtype">int</span>        i, j, pos;
-<a name="l18375"></a>18375     <span class="keywordtype">double</span>     xpos, ypos, xfrac, yfrac;
-<a name="l18376"></a>18376     <span class="keywordtype">int</span>        xint, yint;
-<a name="l18377"></a>18377 
-<a name="l18378"></a>18378 
-<a name="l18379"></a>18379     <span class="keywordflow">if</span> (fabs(dx) >= nx || fabs(dy) >= ny)
-<a name="l18380"></a>18380         <span class="keywordflow">return</span> CPL_ERROR_ACCESS_OUT_OF_RANGE;
-<a name="l18381"></a>18381 
-<a name="l18382"></a>18382     source = cpl_image_duplicate(image);
-<a name="l18383"></a>18383     idata = cpl_image_get_data_float(image);
-<a name="l18384"></a>18384     sdata = cpl_image_get_data_float(source);
-<a name="l18385"></a>18385 
-<a name="l18386"></a>18386     <span class="comment">/*</span>
-<a name="l18387"></a>18387 <span class="comment">     * Shift in y</span>
-<a name="l18388"></a>18388 <span class="comment">     */</span>
-<a name="l18389"></a>18389 
-<a name="l18390"></a>18390     yfrac = - dy - floor(- dy);
-<a name="l18391"></a>18391     xfrac = - dx - floor(- dx);
-<a name="l18392"></a>18392 
-<a name="l18393"></a>18393     <span class="keywordflow">for</span> (pos = 0, j = 0; j < ny; j++) {
-<a name="l18394"></a>18394         ypos = j - dy;
-<a name="l18395"></a>18395         yint = floor(ypos);
-<a name="l18396"></a>18396         <span class="keywordflow">for</span> (i = 0; i < nx; i++) {
-<a name="l18397"></a>18397             xpos = i - dx;
-<a name="l18398"></a>18398             xint = floor(xpos);
-<a name="l18399"></a>18399             <span class="keywordflow">if</span> (xint < 0 || yint < 0 || xint > nx - 2 || yint > ny - 2) {
-<a name="l18400"></a>18400                 idata[pos] = 0.0;
-<a name="l18401"></a>18401             }
-<a name="l18402"></a>18402             <span class="keywordflow">else</span> {
-<a name="l18403"></a>18403                 idata[pos] = sdata[xint + nx*yint] * (1 - xfrac) * (1 - yfrac)
-<a name="l18404"></a>18404                            + sdata[xint + 1 + nx*yint] * xfrac * (1 - yfrac)
-<a name="l18405"></a>18405                            + sdata[xint + nx*(yint + 1)] * (1 - xfrac) * yfrac
-<a name="l18406"></a>18406                            + sdata[xint + 1 + nx*(yint + 1)] * xfrac * yfrac;
-<a name="l18407"></a>18407             }
-<a name="l18408"></a>18408             pos++;
-<a name="l18409"></a>18409         }
-<a name="l18410"></a>18410     }
-<a name="l18411"></a>18411 
-<a name="l18412"></a>18412     cpl_image_delete(source);
-<a name="l18413"></a>18413 
-<a name="l18414"></a>18414     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l18415"></a>18415 }
-<a name="l18416"></a>18416 
-<a name="l18428"></a><a class="code" href="group__moses.html#gc32b3fba956da20bd20530372b1b28d1">18428</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gc32b3fba956da20bd20530372b1b28d1">mos_slit_closest_to_center</a>(cpl_table *slits, <span class="keywordtype">int</span> nx, <span class="keywordtype">int</span> ny)
-<a name="l18429"></a>18429 {
-<a name="l18430"></a>18430 <span class="preprocessor">#ifdef CPL_SIZE_FORMAT</span>
-<a name="l18431"></a>18431 <span class="preprocessor"></span>    cpl_size row;
-<a name="l18432"></a>18432 <span class="preprocessor">#else</span>
-<a name="l18433"></a>18433 <span class="preprocessor"></span>    <span class="keywordtype">int</span> row;
-<a name="l18434"></a>18434 <span class="preprocessor">#endif</span>
-<a name="l18435"></a>18435 <span class="preprocessor"></span>
-<a name="l18436"></a>18436     cpl_table_duplicate_column(slits, <span class="stringliteral">"x"</span>, slits, <span class="stringliteral">"xtop"</span>);
-<a name="l18437"></a>18437     cpl_table_add_columns(slits, <span class="stringliteral">"x"</span>, <span class="stringliteral">"xbottom"</span>);
-<a name="l18438"></a>18438     cpl_table_divide_scalar(slits, <span class="stringliteral">"x"</span>, 2);         <span class="comment">// Mean x position</span>
-<a name="l18439"></a>18439     cpl_table_subtract_scalar(slits, <span class="stringliteral">"x"</span>, nx/2);    <span class="comment">// Relative to CCD center</span>
-<a name="l18440"></a>18440     cpl_table_multiply_columns(slits, <span class="stringliteral">"x"</span>, <span class="stringliteral">"x"</span>);    <span class="comment">// Squared</span>
-<a name="l18441"></a>18441 
-<a name="l18442"></a>18442     cpl_table_duplicate_column(slits, <span class="stringliteral">"y"</span>, slits, <span class="stringliteral">"ytop"</span>);
-<a name="l18443"></a>18443     cpl_table_add_columns(slits, <span class="stringliteral">"y"</span>, <span class="stringliteral">"ybottom"</span>);
-<a name="l18444"></a>18444     cpl_table_divide_scalar(slits, <span class="stringliteral">"y"</span>, 2);         <span class="comment">// Mean y position</span>
-<a name="l18445"></a>18445     cpl_table_subtract_scalar(slits, <span class="stringliteral">"y"</span>, ny/2);    <span class="comment">// Relative to CCD center</span>
-<a name="l18446"></a>18446     cpl_table_multiply_columns(slits, <span class="stringliteral">"y"</span>, <span class="stringliteral">"y"</span>);    <span class="comment">// Squared</span>
-<a name="l18447"></a>18447 
-<a name="l18448"></a>18448     cpl_table_add_columns(slits, <span class="stringliteral">"x"</span>, <span class="stringliteral">"y"</span>);         <span class="comment">// Distance from center</span>
-<a name="l18449"></a>18449     cpl_table_get_column_minpos(slits, <span class="stringliteral">"x"</span>, &row);  <span class="comment">// Min distance from center</span>
-<a name="l18450"></a>18450 
-<a name="l18451"></a>18451     cpl_table_erase_column(slits, <span class="stringliteral">"x"</span>);
-<a name="l18452"></a>18452     cpl_table_erase_column(slits, <span class="stringliteral">"y"</span>);
-<a name="l18453"></a>18453 
-<a name="l18454"></a>18454     <span class="keywordflow">return</span> row;
-<a name="l18455"></a>18455 }
-<a name="l18456"></a>18456 
-<a name="l18476"></a><a class="code" href="group__moses.html#gbff2b46bad7584f819ae28fdd8c85343">18476</a> cpl_error_code <a class="code" href="group__moses.html#gbff2b46bad7584f819ae28fdd8c85343">mos_extract_flux</a>(cpl_image *image, cpl_table *slits, 
-<a name="l18477"></a>18477                      <span class="keywordtype">double</span> xwidth, <span class="keywordtype">double</span> ywidth,
-<a name="l18478"></a>18478                      <span class="keywordtype">int</span> dx, <span class="keywordtype">double</span> gain, <span class="keywordtype">double</span> *o_flux, <span class="keywordtype">double</span> *o_err)
-<a name="l18479"></a>18479 {
-<a name="l18480"></a>18480     <span class="keywordtype">int</span>    nx      = cpl_image_get_size_x(image);
-<a name="l18481"></a>18481     <span class="keywordtype">int</span>    ny      = cpl_image_get_size_y(image);
-<a name="l18482"></a>18482     <span class="keywordtype">int</span>    slit    = <a class="code" href="group__moses.html#gc32b3fba956da20bd20530372b1b28d1">mos_slit_closest_to_center</a>(slits, nx, ny);
-<a name="l18483"></a>18483     <span class="keywordtype">int</span>    ytop    = (int)cpl_table_get(slits, <span class="stringliteral">"ytop"</span>, slit, NULL);
-<a name="l18484"></a>18484     <span class="keywordtype">int</span>    ybottom = (int)cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, slit, NULL);
-<a name="l18485"></a>18485     <span class="keywordtype">int</span>    dy      = ytop - ybottom;
-<a name="l18486"></a>18486     <span class="keywordtype">int</span>    xcenter = (int)((cpl_table_get(slits, <span class="stringliteral">"xtop"</span>, slit, NULL) +
-<a name="l18487"></a>18487                             cpl_table_get(slits, <span class="stringliteral">"xbottom"</span>, slit, NULL)) / 2);
-<a name="l18488"></a>18488     <span class="keywordtype">int</span>    xleft   = xcenter - dx;
-<a name="l18489"></a>18489     <span class="keywordtype">int</span>    xright  = xcenter + dx + 1;
-<a name="l18490"></a>18490     <span class="keywordtype">double</span> area    = xwidth * ywidth; <span class="comment">// squared mm</span>
-<a name="l18491"></a>18491     <span class="keywordtype">int</span>    npix    = (2*dx + 1) * dy;
-<a name="l18492"></a>18492     <span class="keywordtype">int</span>    count   = 0;
-<a name="l18493"></a>18493     <span class="keywordtype">float</span> *data    = cpl_image_get_data_float(image);
-<a name="l18494"></a>18494     <span class="keywordtype">double</span> flux    = 0.0;
-<a name="l18495"></a>18495     <span class="keywordtype">double</span> error   = 0.0;
-<a name="l18496"></a>18496     <span class="keywordtype">int</span>    satur   = 60000;
-<a name="l18497"></a>18497     <span class="keywordtype">int</span>    x, y;
-<a name="l18498"></a>18498 
-<a name="l18499"></a>18499 
-<a name="l18500"></a>18500     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"ywidth"</span>)) {
-<a name="l18501"></a>18501         area    = cpl_table_get(slits, <span class="stringliteral">"xwidth"</span>, slit, NULL)
-<a name="l18502"></a>18502                 * cpl_table_get(slits, <span class="stringliteral">"ywidth"</span>, slit, NULL);
-<a name="l18503"></a>18503     }
-<a name="l18504"></a>18504 
-<a name="l18505"></a>18505     *o_flux = 0.0;
-<a name="l18506"></a>18506     *o_err = 0.0;
-<a name="l18507"></a>18507 
-<a name="l18508"></a>18508     <span class="keywordflow">if</span> (xleft < 0)
-<a name="l18509"></a>18509         xleft = 0;
-<a name="l18510"></a>18510 
-<a name="l18511"></a>18511     <span class="keywordflow">if</span> (xleft > nx)
-<a name="l18512"></a>18512         xleft = nx;
-<a name="l18513"></a>18513 
-<a name="l18514"></a>18514     <span class="keywordflow">if</span> (xright < 0)
-<a name="l18515"></a>18515         xright = 0;
-<a name="l18516"></a>18516 
-<a name="l18517"></a>18517     <span class="keywordflow">if</span> (xright > nx)
-<a name="l18518"></a>18518         xright = nx;
-<a name="l18519"></a>18519 
-<a name="l18520"></a>18520     <span class="keywordflow">if</span> (ytop < 0)
-<a name="l18521"></a>18521         ytop = 0;
-<a name="l18522"></a>18522 
-<a name="l18523"></a>18523     <span class="keywordflow">if</span> (ytop > ny)
-<a name="l18524"></a>18524         ytop = ny;
-<a name="l18525"></a>18525 
-<a name="l18526"></a>18526     <span class="keywordflow">if</span> (ybottom < 0)
-<a name="l18527"></a>18527         ybottom = 0;
-<a name="l18528"></a>18528 
-<a name="l18529"></a>18529     <span class="keywordflow">if</span> (ybottom > ny)
-<a name="l18530"></a>18530         ybottom = ny;
-<a name="l18531"></a>18531 
-<a name="l18532"></a>18532     count = (xright - xleft) * (ytop - ybottom);
-<a name="l18533"></a>18533 
-<a name="l18534"></a>18534     <span class="keywordflow">if</span> (count == 0)
-<a name="l18535"></a>18535         <span class="keywordflow">return</span> CPL_ERROR_ACCESS_OUT_OF_RANGE;
-<a name="l18536"></a>18536 
-<a name="l18537"></a>18537     count = 0;
-<a name="l18538"></a>18538 
-<a name="l18539"></a>18539     <span class="keywordflow">for</span> (y = ybottom; y < ytop; y++) {
-<a name="l18540"></a>18540         <span class="keywordflow">for</span> (x = xleft; x < xright; x++) {
-<a name="l18541"></a>18541             <span class="keywordtype">double</span> value = data[x + y * nx];
-<a name="l18542"></a>18542             <span class="keywordflow">if</span> (value < satur) {
-<a name="l18543"></a>18543                 flux += value;
-<a name="l18544"></a>18544                 count++;
-<a name="l18545"></a>18545             }
-<a name="l18546"></a>18546         }
-<a name="l18547"></a>18547     }
-<a name="l18548"></a>18548 
-<a name="l18549"></a>18549     <span class="keywordflow">if</span> (count == 0)
-<a name="l18550"></a>18550         <span class="keywordflow">return</span> CPL_ERROR_DIVISION_BY_ZERO;
-<a name="l18551"></a>18551 
-<a name="l18552"></a>18552     error = sqrt(flux/gain);
-<a name="l18553"></a>18553 
-<a name="l18554"></a>18554     <span class="comment">/*</span>
-<a name="l18555"></a>18555 <span class="comment">     * Flux correction for lost pixels</span>
-<a name="l18556"></a>18556 <span class="comment">     */</span>
-<a name="l18557"></a>18557 
-<a name="l18558"></a>18558     flux *= (float)npix / count;
-<a name="l18559"></a>18559     error *= (float)npix / count;
-<a name="l18560"></a>18560 
-<a name="l18561"></a>18561     flux /= area;
-<a name="l18562"></a>18562     error /= area;
-<a name="l18563"></a>18563 
-<a name="l18564"></a>18564     *o_flux = flux;
-<a name="l18565"></a>18565     *o_err = error;
-<a name="l18566"></a>18566 
-<a name="l18567"></a>18567     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l18568"></a>18568 }
-<a name="l18569"></a>18569 
-<a name="l18570"></a>18570 
-<a name="l18593"></a><a class="code" href="group__moses.html#ga8abda7d8ad43a4c3287b7b9071f5094">18593</a> cpl_error_code <a class="code" href="group__moses.html#ga8abda7d8ad43a4c3287b7b9071f5094">mos_extract_flux_mapped</a>(cpl_image *image, cpl_table *slits,
-<a name="l18594"></a>18594                                        <span class="keywordtype">double</span> xwidth, <span class="keywordtype">double</span> ywidth,
-<a name="l18595"></a>18595                                        <span class="keywordtype">double</span> lambda, <span class="keywordtype">double</span> startwave, 
-<a name="l18596"></a>18596                                        <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> dx, <span class="keywordtype">double</span> gain, 
-<a name="l18597"></a>18597                                        <span class="keywordtype">double</span> *o_flux, <span class="keywordtype">double</span> *o_err)
-<a name="l18598"></a>18598 {
-<a name="l18599"></a>18599     <span class="keywordtype">int</span>    nx      = cpl_image_get_size_x(image);
-<a name="l18600"></a>18600     <span class="keywordtype">int</span>    ny      = cpl_image_get_size_y(image);
-<a name="l18601"></a>18601     <span class="keywordtype">int</span>    slit    = <a class="code" href="group__moses.html#gc32b3fba956da20bd20530372b1b28d1">mos_slit_closest_to_center</a>(slits, nx, ny);
-<a name="l18602"></a>18602     <span class="keywordtype">int</span>    dy      = (int)cpl_table_get(slits, <span class="stringliteral">"length"</span>, slit, NULL);
-<a name="l18603"></a>18603     <span class="keywordtype">int</span>    ybottom = (int)cpl_table_get(slits, <span class="stringliteral">"position"</span>, slit, NULL);
-<a name="l18604"></a>18604     <span class="keywordtype">int</span>    ytop    = ybottom + dy;
-<a name="l18605"></a>18605     <span class="keywordtype">int</span>    xcenter = (int)floor((lambda - startwave) / dispersion + 0.5);
-<a name="l18606"></a>18606     <span class="keywordtype">int</span>    xleft   = xcenter - dx;
-<a name="l18607"></a>18607     <span class="keywordtype">int</span>    xright  = xcenter + dx + 1;
-<a name="l18608"></a>18608     <span class="keywordtype">double</span> area    = xwidth * ywidth;
-<a name="l18609"></a>18609     <span class="keywordtype">int</span>    npix    = (2*dx + 1) * dy;
-<a name="l18610"></a>18610     <span class="keywordtype">int</span>    count   = 0;
-<a name="l18611"></a>18611     <span class="keywordtype">float</span> *data    = cpl_image_get_data_float(image);
-<a name="l18612"></a>18612     <span class="keywordtype">double</span> flux    = 0.0;
-<a name="l18613"></a>18613     <span class="keywordtype">double</span> error   = 0.0;
-<a name="l18614"></a>18614     <span class="keywordtype">int</span>    satur   = 60000;
-<a name="l18615"></a>18615     <span class="keywordtype">int</span>    x, y;
-<a name="l18616"></a>18616 
-<a name="l18617"></a>18617 
-<a name="l18618"></a>18618     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"ywidth"</span>)) {
-<a name="l18619"></a>18619         area    = cpl_table_get(slits, <span class="stringliteral">"xwidth"</span>, slit, NULL)
-<a name="l18620"></a>18620                 * cpl_table_get(slits, <span class="stringliteral">"ywidth"</span>, slit, NULL);
-<a name="l18621"></a>18621     }
-<a name="l18622"></a>18622 
-<a name="l18623"></a>18623     *o_flux = 0.0;
-<a name="l18624"></a>18624     *o_err = 0.0;
-<a name="l18625"></a>18625 
-<a name="l18626"></a>18626     <span class="keywordflow">if</span> (xleft < 0)
-<a name="l18627"></a>18627         xleft = 0;
-<a name="l18628"></a>18628 
-<a name="l18629"></a>18629     <span class="keywordflow">if</span> (xleft > nx)
-<a name="l18630"></a>18630         xleft = nx;
-<a name="l18631"></a>18631 
-<a name="l18632"></a>18632     <span class="keywordflow">if</span> (xright < 0)
-<a name="l18633"></a>18633         xright = 0;
-<a name="l18634"></a>18634 
-<a name="l18635"></a>18635     <span class="keywordflow">if</span> (xright > nx)
-<a name="l18636"></a>18636         xright = nx;
-<a name="l18637"></a>18637 
-<a name="l18638"></a>18638     <span class="keywordflow">if</span> (ytop < 0)
-<a name="l18639"></a>18639         ytop = 0;
-<a name="l18640"></a>18640 
-<a name="l18641"></a>18641     <span class="keywordflow">if</span> (ytop > ny)
-<a name="l18642"></a>18642         ytop = ny;
-<a name="l18643"></a>18643 
-<a name="l18644"></a>18644     <span class="keywordflow">if</span> (ybottom < 0)
-<a name="l18645"></a>18645         ybottom = 0;
-<a name="l18646"></a>18646 
-<a name="l18647"></a>18647     <span class="keywordflow">if</span> (ybottom > ny)
-<a name="l18648"></a>18648         ybottom = ny;
-<a name="l18649"></a>18649 
-<a name="l18650"></a>18650     count = (xright - xleft) * (ytop - ybottom);
-<a name="l18651"></a>18651 
-<a name="l18652"></a>18652     <span class="keywordflow">if</span> (count == 0)
-<a name="l18653"></a>18653         <span class="keywordflow">return</span> CPL_ERROR_ACCESS_OUT_OF_RANGE;
-<a name="l18654"></a>18654 
-<a name="l18655"></a>18655     count = 0;
-<a name="l18656"></a>18656 
-<a name="l18657"></a>18657     <span class="keywordflow">for</span> (y = ybottom; y < ytop; y++) {
-<a name="l18658"></a>18658         <span class="keywordflow">for</span> (x = xleft; x < xright; x++) {
-<a name="l18659"></a>18659             <span class="keywordtype">double</span> value = data[x + y * nx];
-<a name="l18660"></a>18660             <span class="keywordflow">if</span> (value < satur) {
-<a name="l18661"></a>18661                 flux += value;
-<a name="l18662"></a>18662                 count++;
-<a name="l18663"></a>18663             }
-<a name="l18664"></a>18664         }
-<a name="l18665"></a>18665     }
-<a name="l18666"></a>18666 
-<a name="l18667"></a>18667     <span class="keywordflow">if</span> (count == 0)
-<a name="l18668"></a>18668         <span class="keywordflow">return</span> CPL_ERROR_DIVISION_BY_ZERO;
-<a name="l18669"></a>18669 
-<a name="l18670"></a>18670     error = sqrt(flux/gain);
-<a name="l18671"></a>18671 
-<a name="l18672"></a>18672     <span class="comment">/*</span>
-<a name="l18673"></a>18673 <span class="comment">     * Flux correction for lost pixels</span>
-<a name="l18674"></a>18674 <span class="comment">     */</span>
-<a name="l18675"></a>18675 
-<a name="l18676"></a>18676     flux *= (float)npix / count;
-<a name="l18677"></a>18677     error *= (float)npix / count;
-<a name="l18678"></a>18678     
-<a name="l18679"></a>18679     flux /= area;  
-<a name="l18680"></a>18680     error /= area; 
-<a name="l18681"></a>18681     
-<a name="l18682"></a>18682     *o_flux = flux;
-<a name="l18683"></a>18683     *o_err = error;
-<a name="l18684"></a>18684 
-<a name="l18685"></a>18685     <span class="keywordflow">return</span> CPL_ERROR_NONE;
-<a name="l18686"></a>18686 
-<a name="l18687"></a>18687 }
-<a name="l18688"></a>18688 
-<a name="l18689"></a>18689 
-<a name="l18703"></a><a class="code" href="group__moses.html#g8395eca2d64406c969f48220024e999b">18703</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g8395eca2d64406c969f48220024e999b">mos_median_in_slit</a>(cpl_table *table, cpl_table *slits, <span class="keywordtype">int</span> slit, 
-<a name="l18704"></a>18704                        <span class="keywordtype">char</span> *label, <span class="keywordtype">double</span> *mvalue)
-<a name="l18705"></a>18705 {
-<a name="l18706"></a>18706     <span class="keywordtype">int</span>        position   = cpl_table_get_int(slits, <span class="stringliteral">"position"</span>, slit, NULL);
-<a name="l18707"></a>18707     <span class="keywordtype">int</span>        length     = cpl_table_get_int(slits, <span class="stringliteral">"length"</span>, slit, NULL);
-<a name="l18708"></a>18708     cpl_table *tmp        = cpl_table_extract(table, position, length);
-<a name="l18709"></a>18709 
-<a name="l18710"></a>18710     *mvalue = cpl_table_get_column_median(tmp, label);
-<a name="l18711"></a>18711     cpl_table_delete(tmp);
-<a name="l18712"></a>18712 
-<a name="l18713"></a>18713     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l18714"></a>18714         <span class="keywordflow">return</span> 1;
-<a name="l18715"></a>18715 
-<a name="l18716"></a>18716     <span class="keywordflow">return</span> 0;
-<a name="l18717"></a>18717 }
-<a name="l18718"></a>18718 
-<a name="l18719"></a>18719 
-<a name="l18731"></a><a class="code" href="group__moses.html#g4fe5f2fe3227522421783758228cdc39">18731</a> cpl_image *<a class="code" href="group__moses.html#g4fe5f2fe3227522421783758228cdc39">mos_image_filter_median</a>(cpl_image *image, <span class="keywordtype">int</span> nx, <span class="keywordtype">int</span> ny)
-<a name="l18732"></a>18732 {
-<a name="l18733"></a>18733       cpl_mask  *kernel   = cpl_mask_new(nx, ny);
-<a name="l18734"></a>18734       cpl_image *filtered = cpl_image_new(cpl_image_get_size_x(image),
-<a name="l18735"></a>18735                                           cpl_image_get_size_y(image),
-<a name="l18736"></a>18736                                           cpl_image_get_type(image));
-<a name="l18737"></a>18737 
-<a name="l18738"></a>18738       cpl_mask_not(kernel);
-<a name="l18739"></a>18739       cpl_image_filter_mask(filtered, image, kernel,
-<a name="l18740"></a>18740                             CPL_FILTER_MEDIAN, CPL_BORDER_FILTER);
-<a name="l18741"></a>18741       cpl_mask_delete(kernel);
-<a name="l18742"></a>18742 
-<a name="l18743"></a>18743       <span class="keywordflow">return</span> filtered;
-<a name="l18744"></a>18744 }
-<a name="l18745"></a>18745 
-<a name="l18746"></a><a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">18746</a> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(cpl_table *maskslits, <span class="keywordtype">int</span> nslits_out_det)
-<a name="l18747"></a>18747 {
-<a name="l18748"></a>18748     <span class="keywordtype">int</span> treat_as_lss = 1;
-<a name="l18749"></a>18749     <span class="keywordtype">double</span> mxpos = cpl_table_get_column_median(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l18750"></a>18750     <span class="keywordtype">double</span> * slit_xpos = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);
-<a name="l18751"></a>18751     cpl_size nslits = cpl_table_get_nrow(maskslits);
-<a name="l18752"></a>18752 
-<a name="l18753"></a>18753     <span class="comment">//If not all the slits are illuminated, then we cannot say that</span>
-<a name="l18754"></a>18754     <span class="comment">//it is lss-like (PIPE-4380)</span>
-<a name="l18755"></a>18755     <span class="keywordflow">if</span>(nslits_out_det != 0)
-<a name="l18756"></a>18756         <span class="keywordflow">return</span> 0;
-<a name="l18757"></a>18757 
-<a name="l18758"></a>18758     cpl_msg_warning(cpl_func, <span class="stringliteral">"Number of slits %"</span>CPL_SIZE_FORMAT, nslits);
-<a name="l18759"></a>18759     <span class="keywordflow">for</span> (cpl_size i = 0; i < nslits; i++) {
-<a name="l18760"></a>18760         <span class="keywordflow">if</span> (fabs(mxpos-slit_xpos[i]) > 0.01) {
-<a name="l18761"></a>18761             treat_as_lss = 0;
-<a name="l18762"></a>18762             <span class="keywordflow">break</span>;
-<a name="l18763"></a>18763         }
-<a name="l18764"></a>18764     }
-<a name="l18765"></a>18765     <span class="keywordflow">return</span> treat_as_lss;
-<a name="l18766"></a>18766 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/moses_8c_source.html b/html/moses_8c_source.html
new file mode 100644
index 0000000..720b2e0
--- /dev/null
+++ b/html/moses_8c_source.html
@@ -0,0 +1,16717 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: moses.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">moses.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: moses.c,v 1.116 2013-10-15 09:27:38 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the MOSES library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-15 09:27:38 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.116 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <stdio.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <unistd.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <time.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="comment">/* Prototypes */</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">static</span> cpl_polynomial *read_global_distortion(cpl_table *global, cpl_size row);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="comment">/* Cheating: moving here the cpl_tools_get_median_float() prototype,</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="comment"> * even if cpl_tool.h is not public. It should be removed as soon as </span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="comment"> * an image median filtering with generic kernel will be implemented</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="comment"> * in the CPL, or as soon as this module will be moved into the CPL. */</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="comment">/* FIXME: This has to be removed!! */</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keywordtype">float</span> cpl_tools_get_median_float(<span class="keywordtype">float</span> *, cpl_size);</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">#define MAX_COLNAME      (80)</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor"></span><span class="preprocessor">#define STRETCH_FACTOR   (1.20)</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="comment">// Related to mos_identify_peaks(), used in multiplex mode</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="keyword">static</span> <span class="keywordtype">int</span> mos_multiplex   = -1;</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="keyword">static</span> <span class="keywordtype">int</span> mos_region_size = 800;</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">static</span> <span class="keywordtype">double</span> default_lines_hi[] = {   <span class="comment">/* Default sky line catalog */</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>                     5577.338,          <span class="comment">/* for high res data        */</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>                     5889.953,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>                     5895.923,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>                     5915.301,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                     5932.862,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                     5953.420,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                     6257.961,</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>                     6287.434,</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                     6300.304,</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>                     6306.869,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                     6363.780,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                     6498.729,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                     6533.044,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>                     6553.617,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>                     6841.945,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>                     6863.955,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                     6870.994,</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>                     6889.288,</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>                     6900.833,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                     6912.623,</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                     6923.220,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                     6939.521,</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>                     6969.930,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                     7003.858,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                     7244.907,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     7276.405,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     7284.439,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     7316.282,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     7329.148,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                     7340.885,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                     7358.659,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                     7571.746,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                     7750.640,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                     7759.996,</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>                     7794.112,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>                     7808.467,</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>                     7821.503,</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>                     7841.266,</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>                     7913.708,</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>                     7949.204,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                     7964.650,</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                     7993.332,</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>                     8014.059,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                     8310.719,</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                     8344.602,</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>                     8382.392,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                     8399.170,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     8415.231,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                     8430.174,</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>                     8452.250,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                     8493.389,</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>                     8791.186,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                     8827.096,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                     8885.850,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                     8903.114,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                     8943.395,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                     8988.366</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                     };</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="keyword">static</span> <span class="keywordtype">double</span> default_lines_lo[] = {   <span class="comment">/* Default sky line catalog */</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>                     5577.338,          <span class="comment">/* for low res data         */</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>                     6300.304,</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>                     6863.955,</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>                     7571.746,</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>                     7964.650,</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>                     7993.332</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>                     };</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="comment"> * The following macros and function for finding the k-th smallest</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="comment"> * value on a float array will be accessible from cpl_tools once</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="comment"> * this module will be moved into the CPL.</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="comment">/****</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="comment"></span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="comment">#define PIX_SWAP(a,b) { register float t=(a);(a)=(b);(b)=t; }</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="comment"></span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="comment">static float kthSmallest(float a[], int n, int k)</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="comment">{</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="comment">  register int i,j,l,m;</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="comment">  register float x;</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="comment"></span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="comment">  l = 0;</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="comment">  m = n-1;</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="comment">  while (l < m) {</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="comment">    x = a[k];</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="comment">    i = l;</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="comment">    j = m;</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="comment">    do {</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="comment">      while (a[i] < x) {</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="comment">        i++;</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="comment">      }</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="comment">      while (x < a[j]) {</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="comment">        j--;</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="comment">      }</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="comment">      if (i <= j) {</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="comment">        PIX_SWAP(a[i],a[j]);</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="comment">        i++;</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="comment">        j--;</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="comment">      }</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="comment">    } while (i <= j);</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="comment"></span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="comment">    if (j < k) {</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="comment">      l = i;</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="comment">    }</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="comment">    if (k < i) {</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="comment">      m = j;</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="comment">    }</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="comment"></span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="comment">  }</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="comment">  return(a[k]);</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="comment">}</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="comment"></span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="comment">#define medianWirth(a, n) kthSmallest(a, n, (((n)&1) ? ((n)/2) : (((n)/2)-1)))</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="comment"></span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="comment">****/</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="comment">/* </span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="comment"> * Return random number with gaussian distribution (mean = 0, variance = 1)</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="comment"> * (Box-Mueller method). The mos_randg() argument is either true or false, </span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="comment"> * indicating whether to "seed" or not the sequence of generated random </span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="comment"> * numbers. The "seeding" is performed just at the first mos_randg(1) call, </span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="comment"> * and at further calls the input argument is ignored. This function</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="comment"> * generates two random numbers at each call, returning the first one</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="comment"> * at odd calls, and the second one at even calls.</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="keyword">static</span> <span class="keywordtype">void</span> mos_seed(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> {</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     srand((<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)time((time_t *)0));</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> }</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="keyword">static</span> <span class="keywordtype">double</span> mos_randg(<span class="keywordtype">int</span> seme)</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> {</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     <span class="keyword">static</span> <span class="keywordtype">int</span> doit = 1;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     <span class="keyword">static</span> <span class="keywordtype">int</span> gotit = 1;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     <span class="keywordtype">double</span> x1, x2, w, y1;</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="keyword">static</span> <span class="keywordtype">double</span> y2;</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="keywordflow">if</span> (gotit && seme) {</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>         mos_seed();</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         gotit = 0;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     }</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     <span class="keywordflow">if</span> (doit) {</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>         doit = 0;</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>         <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>             x1 = 2.0 * (double)rand() / RAND_MAX - 1.0;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>             x2 = 2.0 * (double)rand() / RAND_MAX - 1.0;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>             w = x1 * x1 + x2 * x2;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>         } <span class="keywordflow">while</span> (w >= 1.0 || w == 0.0);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>         w = sqrt( (-2.0 * log(w)) / w);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     </div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>         y1 = x1 * w;</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>         y2 = x2 * w;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>         <span class="keywordflow">return</span> y1;</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     }</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> </div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     doit = 1;</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     <span class="keywordflow">return</span> y2;</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> }</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> <span class="comment">/* </span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> <span class="comment"> * This function contained a dependency on the VIMOS library</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> <span class="comment"> * (function medianPixelvalue()): it should be removed as soon as an </span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span> <span class="comment"> * image median filtering with generic kernel will be implemented</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="comment"> * in the CPL. Currently it has been solved by a direct call to</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="comment"> * a cpl_tool function.</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> <span class="keyword">static</span> cpl_image *mos_image_vertical_median_filter(cpl_image *ima_in,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                                             <span class="keywordtype">int</span> filtsizey, <span class="keywordtype">int</span> refrow,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                                             <span class="keywordtype">int</span> above, <span class="keywordtype">int</span> below, <span class="keywordtype">int</span> step)</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> {</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> </div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>   <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_image_general_median_filter"</span>;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>   cpl_image  *filt_img = NULL;</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>   <span class="keywordtype">int</span>         col, row;</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>   <span class="keywordtype">float</span>      *buf = NULL;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>   <span class="keywordtype">float</span>      *data;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>   <span class="keywordtype">float</span>      *fdata;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>   <span class="keywordtype">int</span>         upright_y, loleft_y;</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>   <span class="keywordtype">int</span>         j;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>   <span class="keywordtype">int</span>         yIsEven = !(filtsizey - (filtsizey/2)*2);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>   <span class="keywordtype">int</span>         f2y;</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>   <span class="keywordtype">int</span>         nx = cpl_image_get_size_x(ima_in);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>   <span class="keywordtype">int</span>         ny = cpl_image_get_size_y(ima_in);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>   <span class="keywordtype">int</span>         firstRow;</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>   <span class="keywordflow">if</span> (yIsEven) filtsizey++;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>   <span class="keywordflow">if</span> (ny <= filtsizey) {</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     cpl_msg_error(func, </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                   <span class="stringliteral">"Median filter size: %d, image size: %d"</span>, filtsizey, ny);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>   }</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span> </div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>   f2y = filtsizey / 2;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>   filt_img = cpl_image_duplicate(ima_in);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>   buf = cpl_malloc(filtsizey * <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>   data = cpl_image_get_data(ima_in);</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>   fdata = cpl_image_get_data(filt_img);</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>   firstRow = refrow - step * (below / step);</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>   <span class="keywordflow">if</span> (firstRow < f2y)</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     firstRow += step;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span> </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>   <span class="keywordflow">for</span> (col = 0; col < nx; col++) {</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="keywordflow">for</span> (row = firstRow; row < refrow + above; row += step) {</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>       <span class="keywordflow">if</span> (row >= ny - f2y)</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>       loleft_y = row - f2y;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>       upright_y = row + f2y + 1;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>       <span class="keywordflow">for</span> (j = loleft_y; j < upright_y; j++)</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>         buf[j - loleft_y] = data[col + j * nx];</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> </div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>       fdata[col + row * nx] = cpl_tools_get_median_float(buf, filtsizey);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     }</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>   }</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>   cpl_free(buf);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>   <span class="keywordflow">return</span> filt_img;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> }</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> <span class="comment"> * The following static function is used to find an accurate position</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> <span class="comment"> * of a peak within a short interval (however at least 5 pixels long). </span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> <span class="comment"> * The basic idea is to find the baricenter of all the pixel values </span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> <span class="comment"> * that pass a threshold level between the median value and the maximum</span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> <span class="comment"> * value within the examined interval (in case such levels are equal,</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="comment"> * the input is considered flat and no position is returned). At least</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> <span class="comment"> * minPoints must pass this threshold, or no position is computed. To</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> <span class="comment"> * evaluate the significance of the computed baricenter, the variance </span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> <span class="comment"> * of the contributing positions (relative to the found baricenter) is </span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="comment"> * also evaluated, and compared with the expected variance for a uniform </span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="comment"> * distribution of positions. If the observed variance is greater than </span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="comment"> * 80% of the variance of the uniform distribution, the found position </span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="comment"> * is rejected.</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> <span class="keyword">static</span> <span class="keywordtype">int</span> peakPosition(<span class="keyword">const</span> <span class="keywordtype">float</span> *data, <span class="keywordtype">int</span> size, <span class="keywordtype">float</span> *position,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                         <span class="keywordtype">int</span> minPoints)</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> {</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>   <span class="keywordtype">int</span>    i;</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>   <span class="keywordtype">int</span>    count = 0;</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>   <span class="keywordtype">float</span> *copy;</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>   <span class="keywordtype">float</span>  max, median, level, pos, variance, uniformVariance;</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>   <span class="keywordtype">double</span> sum, weights;</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> </div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>   <span class="keywordflow">if</span> (data == NULL)</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>       <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>   <span class="keywordflow">if</span> (size < 5)         <span class="comment">/* Hardcoded, I know... */</span></div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>       <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> <span class="comment">   *  Find median level</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> </div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>   copy = (<span class="keywordtype">float</span> *) cpl_malloc(size*<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>   <span class="keywordflow">for</span> (i = 0; i < size; i++)</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>       copy[i] = data[i];</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>   median = cpl_tools_get_median_float(copy, size);</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>   cpl_free(copy);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> <span class="comment">   *  Find max</span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> </div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>   max = data[0];</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>   <span class="keywordflow">for</span> (i = 1; i < size; i++)</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>       <span class="keywordflow">if</span> (data[i] > max)</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>           max = data[i];</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> <span class="comment">   *  If the max equals the median we have a flat input, therefore</span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> <span class="comment">   *  no peak is found.</span></div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>   <span class="keywordflow">if</span> (max-median < 0.00001)</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>       <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> </div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> </div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> <span class="comment">   *  Discrimination level: only pixels with values above this</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> <span class="comment">   *  level are considered in baricenter calculation.</span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> </div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>   level = (max + median) / 2;</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> </div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span> <span class="comment">   *  Of the values above this level compute the baricenter and</span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> <span class="comment">   *  then the variance of the positions used. Note that the weights</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> <span class="comment">   *  are taken as the difference between the pixels values and</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> <span class="comment">   *  the median level (supposedly the background).</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>   count = 0;</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>   <span class="keywordflow">for</span> (i = 0, sum = 0., weights = 0.; i < size; i++) {</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>       <span class="keywordflow">if</span> (data[i] > level) {</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>           count++;</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>           weights += (data[i] - median);</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>           sum     += i * (data[i] - median);</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>       }</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>   }</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> <span class="comment">   *  If too few values are above threshold, refuse the position</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment">   *  as insignificant</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>   <span class="keywordflow">if</span> (count < minPoints)</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>       <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>   pos = sum / weights;</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>   <span class="keywordflow">for</span> (i = 0, sum = 0., weights = 0.; i < size; i++) {</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>       <span class="keywordflow">if</span> (data[i] > level) {</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>           weights++;</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>           sum += (i - pos) * (i - pos);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>       }</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>   }</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>   variance = sqrt(sum / weights);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> </div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> </div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>  <span class="comment">/*</span></div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> <span class="comment">  *  The "uniform variance" is the variance that should be obtained</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> <span class="comment">  *  in the case of uniform distribution of the points positions in</span></div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> <span class="comment">  *  the selected interval. If the real variance is comparable with</span></div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> <span class="comment">  *  this value, the peak is considered not found.</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> <span class="comment">  */</span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> </div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>   uniformVariance = sqrt(size*size/3 - pos*size + pos*pos);</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>   <span class="keywordflow">if</span> (variance > 0.8 * uniformVariance)</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>       <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> </div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>   *position = pos + 0.5;</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span> </div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>   <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> }</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> </div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> <span class="comment"> *  The following static function determines the quantity dx to be</span></div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> <span class="comment"> *  added to the position of the highest pixel of a fiber profile,</span></div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> <span class="comment"> *  to get the true position of the profile maximum. All is needed</span></div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> <span class="comment"> *  is the maximum observed value v2 in the profile, and the observed</span></div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> <span class="comment"> *  values v1 and v3 of the previous and the next pixels in the profile.</span></div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> <span class="comment"> *  </span></div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span> <span class="comment"> *  The following ratio is defined:</span></div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span> <span class="comment"> *  </span></div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> <span class="comment"> *      R = 0.5 (v3 - v1) / (2*v2 - v3 - v1)</span></div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> <span class="comment"> *      </span></div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> <span class="comment"> *  This is a conventional ratio that wouldn't diverge for any set of</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> <span class="comment"> *  pixel values, and that would not depend on the presence of background</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> <span class="comment"> *  (with the assumption that the background level is the same for the </span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> <span class="comment"> *  three pixels). R has also been chosen in such a way that its value</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="comment"> *  is already quite close to the real dx. It should be noted that the</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> <span class="comment"> *  following condition should be fulfilled:</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span> <span class="comment"> *           v1  <= v2   and   v3  <  v2</span></div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span> <span class="comment"> *  or</span></div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> <span class="comment"> *           v1  <  v2   and   v3  <=  v2</span></div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span> <span class="comment"> *  This implies that dx varies between -0.5 and 0.5 pixels. In such</span></div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> <span class="comment"> *  boundary cases, one has:</span></div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span> <span class="comment"> *           v2 = v1   and   R = dx = -0.5</span></div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> <span class="comment"> *           v2 = v3   and   R = dx =  0.5</span></div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> <span class="comment"> *  Another special case is when the observed pixel values are perfectly</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> <span class="comment"> *  symmetrical:</span></div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span> <span class="comment"> *           v1 = v3   and   R = dx =  0.0</span></div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span> <span class="comment"> *  In all the intermediate cases the relation between R and dx depends</span></div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> <span class="comment"> *  on the shape of the fiber profile, that has been determined elsewhere.</span></div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span> <span class="comment"> *  Using the accurate reconstruction of the fiber profile obtained by </span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> <span class="comment"> *  the *  functions ifuProfile() and rebinProfile(), it can be shown </span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> <span class="comment"> *  that R differs from dx always less than 0.01 pixels. If the condition</span></div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span> <span class="comment"> *           v1  <= v2   and   v3  <  v2</span></div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> <span class="comment"> *  or</span></div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> <span class="comment"> *           v1  <  v2   and   v3  <=  v2</span></div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> <span class="comment"> *  is not fulfilled, then this function returns the value 2.0.</span></div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> <span class="keyword">static</span> <span class="keywordtype">double</span> values_to_dx(<span class="keywordtype">double</span> v1, <span class="keywordtype">double</span> v2, <span class="keywordtype">double</span> v3)</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> {</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>   <span class="keyword">static</span> <span class="keywordtype">double</span> epsilon = 0.00000001;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>   <span class="keywordtype">double</span>        r       = 2.0;</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span> </div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>   <span class="keywordflow">if</span> (v1 > v2 || v3 > v2)</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     <span class="keywordflow">return</span> r;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> </div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>   <span class="keywordflow">if</span> (2 * v2 - v1 - v3 < epsilon)</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     <span class="keywordflow">return</span> r;</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span> </div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>   r = 0.5 * (v3 - v1) / (2 * v2 - v3 - v1);</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> </div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>   <span class="keywordflow">return</span> r;</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span> }</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> </div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> </div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span> <span class="comment"> * The following static function passes a min filter of given box</span></div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span> <span class="comment"> * size on the data buffer. The box size must be a positive odd integer.</span></div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> </div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span> <span class="keyword">static</span> <span class="keywordtype">float</span> *min_filter(<span class="keywordtype">float</span> *buffer, <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> size)</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span> {</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     <span class="keywordtype">float</span> *minf  = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     <span class="keywordtype">float</span>  min;</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     <span class="keywordtype">int</span>    start = size / 2;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>     <span class="keywordtype">int</span>    end   = length - size / 2;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     <span class="keywordtype">int</span>    i, j;</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> </div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> </div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     <span class="keywordflow">for</span> (i = start; i < end; i++) {</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>         min = buffer[i-start];</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>         <span class="keywordflow">for</span> (j = i - start + 1; j <= i + start; j++)</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>             <span class="keywordflow">if</span> (min > buffer[j])</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                 min = buffer[j];</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         minf[i] = min;</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>     }</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> </div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     <span class="keywordflow">for</span> (i = 0; i < start; i++)</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>         minf[i] = minf[start];</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span> </div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     <span class="keywordflow">for</span> (i = end; i < length; i++)</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>         minf[i] = minf[end-1];</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span> </div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>     <span class="keywordflow">return</span> minf;</div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span> }</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span> </div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span> <span class="comment"> * The following static function passes a max filter of given box</span></div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span> <span class="comment"> * size on the data buffer. The box size must be a positive odd integer.</span></div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>  </div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span> <span class="keyword">static</span> <span class="keywordtype">float</span> *max_filter(<span class="keywordtype">float</span> *buffer, <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> size)</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> {</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="keywordtype">float</span> *maxf  = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="keywordtype">float</span>  max;</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>     <span class="keywordtype">int</span>    start = size / 2;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>     <span class="keywordtype">int</span>    end   = length - size / 2;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     <span class="keywordtype">int</span>    i, j;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span> </div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> </div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     <span class="keywordflow">for</span> (i = start; i < end; i++) {</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         max = buffer[i-start];</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>         <span class="keywordflow">for</span> (j = i - start + 1; j <= i + start; j++)</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>             <span class="keywordflow">if</span> (max < buffer[j])</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>                 max = buffer[j];</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>         maxf[i] = max;</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     }</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span> </div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     <span class="keywordflow">for</span> (i = 0; i < start; i++)</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         maxf[i] = maxf[start];</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span> </div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     <span class="keywordflow">for</span> (i = end; i < length; i++)</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>         maxf[i] = maxf[end-1];</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> </div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     <span class="keywordflow">return</span> maxf;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> }</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> </div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span> </div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> <span class="comment"> * The following static function passes a running average of given box</span></div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> <span class="comment"> * size on the data buffer. The box size must be a positive odd integer.</span></div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>  </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span> <span class="keyword">static</span> <span class="keywordtype">float</span> *smo_filter(<span class="keywordtype">float</span> *buffer, <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> size)</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span> {</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>     <span class="keywordtype">float</span> *smof  = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>     <span class="keywordtype">double</span> sum;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     <span class="keywordtype">int</span>    start = size / 2;</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>     <span class="keywordtype">int</span>    end   = length - size / 2;</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>     <span class="keywordtype">int</span>    i, j;</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> </div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> </div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     <span class="keywordflow">for</span> (i = start; i < end; i++) {</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         sum = 0.0;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         <span class="keywordflow">for</span> (j = i - start; j <= i + start; j++)</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>             sum += buffer[j];</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         smof[i] = sum / size;</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>     }</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     <span class="keywordflow">for</span> (i = 0; i < start; i++)</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>         smof[i] = smof[start];</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> </div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     <span class="keywordflow">for</span> (i = end; i < length; i++)</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>         smof[i] = smof[end-1];</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span> </div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     <span class="keywordflow">return</span> smof;</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span> }</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span> </div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span> <span class="comment"> * The following two static functions are used to read and write from the </span></div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> <span class="comment"> * global distortion table the different model components. Conventionally</span></div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span> <span class="comment"> * the table consists of 6 columns and 10 rows. Each row is just ordered </span></div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span> <span class="comment"> * storage for model coefficients, and these functions guarantee that the</span></div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> <span class="comment"> * coefficients are read in and written out correctly, independent on their</span></div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> <span class="comment"> * physical meaning. The first 6 table rows are a description of the IDS</span></div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span> <span class="comment"> * coefficients, followed by a row containing only the used reference </span></div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span> <span class="comment"> * wavelength. The remaining 3 are a description of the spectral curvature.</span></div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span> <span class="comment"> * The first row is a description of coefficient c0, the second of coefficient</span></div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> <span class="comment"> * c1, etc., of the IDS. The 8th row is a description of coefficient c0,</span></div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span> <span class="comment"> * the 9th of coefficient c1, etc., of the spectral curvature. All are</span></div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> <span class="comment"> * bivariate polynomialx on x,y mask coordinates. If the input table</span></div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span> <span class="comment"> * to the write routine is NULL, it is allocated and initialised. Also</span></div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span> <span class="comment"> * the input polynomial could be NULL, and nothing would be written to </span></div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span> <span class="comment"> * the table. If both pointers are NULL the function is basically a</span></div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> <span class="comment"> * constructor of the global distortion table.</span></div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span> </div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span> <span class="keyword">static</span> cpl_polynomial *read_global_distortion(cpl_table *global, cpl_size row)</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> {</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     cpl_polynomial *poly = NULL;</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     cpl_size        p[2];</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     cpl_size        degree = 2;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     <span class="keywordtype">double</span>          coeff;</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> </div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     <span class="keywordtype">char</span>   name[MAX_COLNAME];</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span> </div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span> </div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     <span class="keywordflow">for</span> (p[0] = 0; p[0] <= degree; p[0]++) {</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>         <span class="keywordflow">for</span> (p[1] = 0; p[1] <= degree - p[0]; p[1]++) {</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"a%"</span>CPL_SIZE_FORMAT<span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">""</span>, p[0], p[1]);</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>             coeff = cpl_table_get_double(global, name, row, &null);</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>             <span class="keywordflow">if</span> (null)</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>             <span class="keywordflow">if</span> (poly == NULL)</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>                 poly = cpl_polynomial_new(2);</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>             cpl_polynomial_set_coeff(poly, p, coeff);</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         }</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     }</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> </div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     <span class="keywordflow">return</span> poly;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> }</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span> </div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span> <span class="keyword">static</span> cpl_table *write_global_distortion(cpl_table *global, <span class="keywordtype">int</span> row, </div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>                                           cpl_polynomial *poly)</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span> {</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>     cpl_table *table;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     cpl_size   p[2];</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>     cpl_size   degree = 2;</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     <span class="keywordtype">int</span>        nrow = 10;</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> </div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     <span class="keywordtype">char</span>       name[MAX_COLNAME];</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> </div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> </div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     <span class="keywordflow">if</span> (global) {</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>         table = global;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     }</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>         table = cpl_table_new(nrow);</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>         <span class="keywordflow">for</span> (p[0] = 0; p[0] <= degree; p[0]++) {</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>             <span class="keywordflow">for</span> (p[1] = 0; p[1] <= degree - p[0]; p[1]++) {</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"a%"</span>CPL_SIZE_FORMAT<span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">""</span>, p[0], p[1]);</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>                 cpl_table_new_column(table, name, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>             }</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>         }</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     }</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span> </div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>     <span class="keywordflow">if</span> (poly) {</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>         <span class="keywordflow">for</span> (p[0] = 0; p[0] <= degree; p[0]++) {</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>             <span class="keywordflow">for</span> (p[1] = 0; p[1] <= degree - p[0]; p[1]++) {</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"a%"</span>CPL_SIZE_FORMAT<span class="stringliteral">"%"</span>CPL_SIZE_FORMAT<span class="stringliteral">""</span>, p[0], p[1]);</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>                 cpl_table_set_double(table, name, row, </div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>                                      cpl_polynomial_get_coeff(poly, p));</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>             }</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>         }</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     }</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span> </div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     <span class="keywordflow">return</span> table;</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span> }</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span> </div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span> </div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span> <span class="comment"> * The following static function is performing a robust linear fit</span></div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span> <span class="comment"> * (drawn from the VIMOS library, and originally from ESO-Eclipse).</span></div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> <span class="comment"> *  ----> y = a + b * x</span></div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span> <span class="comment"> * This function return 0 on success.</span></div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span> </div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> <span class="preprocessor">#define SEGNO(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))</span></div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">int</span> robustLinearFit(cpl_bivector *<a class="code" href="structlist.html">list</a>, <span class="keywordtype">double</span> *a, <span class="keywordtype">double</span> *b, </div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>                            <span class="keywordtype">double</span> *abdev)</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span> {</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     cpl_vector *vx;</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     cpl_vector *vy;</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>     cpl_vector *va;</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span> </div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     <span class="keywordtype">double</span>  aa, bb, bcomp, b1, b2, del, abdevt, f, f1, f2, sigb, temp, d, sum;</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     <span class="keywordtype">double</span>  sx, sy, sxy, sxx, chisq;</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>     <span class="keywordtype">double</span> *arr;</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     <span class="keywordtype">double</span>  aa_ls, bb_ls;</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>     <span class="keywordtype">double</span> *x;</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     <span class="keywordtype">double</span> *y;</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     <span class="keywordtype">int</span>     np;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>     <span class="keywordtype">int</span>     iter;</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     <span class="keywordtype">int</span>     max_iterate = 30;</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     <span class="keywordtype">int</span>     i;</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span> </div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>     np = cpl_bivector_get_size(list);</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     vx = cpl_bivector_get_x(list);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>     vy = cpl_bivector_get_y(list);</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>     x = cpl_vector_get_data(vx);</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     y = cpl_vector_get_data(vy);</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>     sx = sy = sxx = sxy = 0.00;</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     <span class="keywordflow">for</span> (i = 0; i < np; i++) {</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>         sx  += x[i];</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>         sy  += y[i];</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>         sxy += x[i] * y[i];</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>         sxx += x[i] * x[i];</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>     }</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> </div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     del = np * sxx - sx * sx;</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     aa_ls = aa = (sxx * sy - sx * sxy) / del;</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     bb_ls = bb = (np * sxy - sx * sy) / del;</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span> </div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     chisq = 0.00;</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>     <span class="keywordflow">for</span> (i = 0; i < np; i++) {</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>         temp = y[i] - (aa+bb*x[i]);</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>         temp *= temp;</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>         chisq += temp;</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     }</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span> </div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     va = cpl_vector_new(np);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     arr = cpl_vector_get_data(va);</div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     sigb = sqrt(chisq/del);</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     b1 = bb;</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span> </div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     bcomp = b1;</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>     sum = 0.00;</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     <span class="keywordflow">for</span> (i = 0; i < np; i++) {</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>         arr[i] = y[i] - bcomp * x[i];</div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     }</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     aa = cpl_vector_get_median_const(va);</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     abdevt = 0.0;</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     <span class="keywordflow">for</span> (i = 0; i < np; i++) {</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>         d = y[i] - (bcomp * x[i] + aa);</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>         abdevt += fabs(d);</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>         <span class="keywordflow">if</span> (y[i] != 0.0) </div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>             d /= fabs(y[i]);</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>         <span class="keywordflow">if</span> (fabs(d) > 1e-7) </div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>             sum += (d >= 0.0 ? x[i] : -x[i]);</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     }</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     f1 = sum;</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     b2 = bb + SEGNO(3.0 * sigb, f1);</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span> </div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>     bcomp = b2;</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>     sum = 0.00;</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>     <span class="keywordflow">for</span> (i = 0; i < np; i++) {</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>         arr[i] = y[i] - bcomp * x[i];</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>     }</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>     aa = cpl_vector_get_median_const(va);</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     abdevt = 0.0;</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     <span class="keywordflow">for</span> (i = 0; i < np; i++) {</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>         d = y[i] - (bcomp * x[i] + aa);</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>         abdevt += fabs(d);</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>         <span class="keywordflow">if</span> (y[i] != 0.0) </div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>             d /= fabs(y[i]);</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>         <span class="keywordflow">if</span> (fabs(d) > 1e-7) </div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>             sum += (d >= 0.0 ? x[i] : -x[i]);</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>     }</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>     f2 = sum;</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span> </div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     <span class="keywordflow">if</span> (fabs(b2-b1)<1e-7) {</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>         *a = aa;</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>         *b = bb;</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>         *abdev = abdevt / (double)np;</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>         cpl_vector_delete(va);</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     }</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     iter = 0;</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     <span class="keywordflow">while</span> (f1*f2 > 0.0) {</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>         bb = 2.0*b2-b1;</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>         b1 = b2;</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>         f1 = f2;</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>         b2 = bb;</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> </div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>         bcomp = b2;</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>         sum = 0.00;</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>         <span class="keywordflow">for</span> (i = 0; i < np; i++) {</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>             arr[i] = y[i] - bcomp * x[i];</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>         }</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>         aa = cpl_vector_get_median_const(va);</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>         abdevt = 0.0;</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>         <span class="keywordflow">for</span> (i = 0; i < np; i++) {</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>             d = y[i] - (bcomp * x[i] + aa);</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>             abdevt += fabs(d);</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>             <span class="keywordflow">if</span> (y[i] != 0.0) </div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>                 d /= fabs(y[i]);</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>             <span class="keywordflow">if</span> (fabs(d) > 1e-7) </div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>                 sum += (d >= 0.0 ? x[i] : -x[i]);</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>         }</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>         f2 = sum;</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>         iter++;</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>         <span class="keywordflow">if</span> (iter >= max_iterate) </div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>     }</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     <span class="keywordflow">if</span> (iter >= max_iterate) {</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>         *a = aa_ls;</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>         *b = bb_ls;</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>         *abdev = -1.0;</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         cpl_vector_delete(va);</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>     }</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span> </div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>     sigb = 0.01 * sigb;</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>     <span class="keywordflow">while</span> (fabs(b2-b1) > sigb) {</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>         bb = 0.5 * (b1 + b2);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>         <span class="keywordflow">if</span> ((fabs(bb-b1) < 1e-7) || (fabs(bb-b2) < 1e-7)) </div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>         bcomp = bb;</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>         sum = 0.0;</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>         <span class="keywordflow">for</span> (i = 0; i < np; i++) {</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>             arr[i] = y[i] - bcomp * x[i];</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>         }</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>         aa = cpl_vector_get_median_const(va);</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>         abdevt = 0.0;</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>         <span class="keywordflow">for</span> (i = 0; i < np; i++) {</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>             d = y[i] - (bcomp * x[i] + aa);</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>             abdevt += fabs(d);</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>             <span class="keywordflow">if</span> (y[i] != 0.0) </div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>                 d /= fabs(y[i]);</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>             <span class="keywordflow">if</span> (fabs(d) > 1e-7) </div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>                 sum += (d >= 0.0 ? x[i] : -x[i]);</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>         }</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>         f = sum;</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span> </div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>         <span class="keywordflow">if</span> (f*f1 >= 0.0) {</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>             f1=f;</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>             b1=bb;</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>         } </div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>             f2=f;</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>             b2=bb;</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>         }</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>     }</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>     cpl_vector_delete(va);</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>     *a = aa;</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>     *b = bb;</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>     *abdev = abdevt / np;</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span> }</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span> <span class="preprocessor">#undef SEGNO</span></div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span> <span class="comment">/*      </span></div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> <span class="comment"> * The following static function applies the Hough transform from a table</span></div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span> <span class="comment"> * of points to another table of points. Given the points p_i = (x_i,y_i)</span></div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span> <span class="comment"> * and p_j = (x_j,y_j), the point (X,Y) with X = (y_i - y_j)/(x_i - x_j)</span></div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span> <span class="comment"> * and Y = y_i - X*x_i is computed and added to the output table for each</span></div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span> <span class="comment"> * p_i, p_j pair. This means that if the input table has N points, the</span></div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span> <span class="comment"> * output table has N*(N-1)/2 points.</span></div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>     </div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span> <span class="comment">/* static */</span></div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span> cpl_table *mos_hough_table(cpl_table *table, <span class="keyword">const</span> <span class="keywordtype">char</span> *x, <span class="keyword">const</span> <span class="keywordtype">char</span> *y)</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span> {</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>     cpl_table *output;</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>     <span class="keywordtype">double</span>    *xdata;</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>     <span class="keywordtype">double</span>    *ydata;</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>     <span class="keywordtype">double</span>    *xodata;</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>     <span class="keywordtype">double</span>    *yodata;</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>     <span class="keywordtype">int</span>        npoints;</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>     <span class="keywordtype">int</span>        opoints;</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>     <span class="keywordtype">int</span>        i, j, k;</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span> </div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span> </div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>     npoints = cpl_table_get_nrow(table);</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>     opoints = npoints*(npoints-1)/2;</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span> </div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>     output = cpl_table_new(opoints);</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>     cpl_table_new_column(output, <span class="stringliteral">"m"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>     cpl_table_new_column(output, <span class="stringliteral">"q"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>     cpl_table_fill_column_window_double(output, <span class="stringliteral">"m"</span>, 0, opoints, 0.0);</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>     cpl_table_fill_column_window_double(output, <span class="stringliteral">"q"</span>, 0, opoints, 0.0);</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span> </div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>     xodata = cpl_table_get_data_double(output, <span class="stringliteral">"m"</span>);</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>     yodata = cpl_table_get_data_double(output, <span class="stringliteral">"q"</span>);</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>     </div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>     cpl_table_cast_column(table, x, <span class="stringliteral">"x"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>     cpl_table_cast_column(table, y, <span class="stringliteral">"y"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span> </div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>     xdata = cpl_table_get_data_double(table, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>     ydata = cpl_table_get_data_double(table, <span class="stringliteral">"y"</span>);</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span> </div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>     k = 0;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>     <span class="keywordflow">for</span> (i = 0; i < npoints; i++) {</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>         <span class="keywordflow">for</span> (j = i+1; j < npoints; j++) {</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>             xodata[k] = (ydata[i]-ydata[j])/(xdata[i]-xdata[j]);</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>             yodata[k] = ydata[i] - xodata[k] * xdata[i];</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>             k++;</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>         }</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>     }</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span> </div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>     <span class="keywordflow">if</span> (k != opoints)</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>         printf(<span class="stringliteral">"Assert k = %d, expected %d\n"</span>, k, opoints);</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span> </div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>     cpl_table_erase_column(table, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>     cpl_table_erase_column(table, <span class="stringliteral">"y"</span>);</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span> </div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>     <span class="keywordflow">return</span> output;</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span> }</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span> </div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span> </div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span> <span class="comment"> * The following static function is performing the spectral</span></div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span> <span class="comment"> * extraction for the function mos_extract_objects()</span></div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span> </div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span> <span class="keyword">static</span> <span class="keywordtype">void</span> mos_extraction(cpl_image *sciwin, cpl_image *skywin, </div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>                            cpl_image *extracted, cpl_image *sky, </div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>                            cpl_image *error, <span class="keywordtype">int</span> nobjects, <span class="keywordtype">int</span> extraction, </div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>                            <span class="keywordtype">double</span> ron, <span class="keywordtype">double</span> conad, <span class="keywordtype">int</span> ncomb)</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span> {</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span> </div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>   cpl_vector *vprofile;</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>   cpl_image  *smowin;</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span> </div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>   <span class="keywordtype">int</span> i, j;</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>   <span class="keywordtype">int</span> specLen;</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>   <span class="keywordtype">int</span> numRows;</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>   <span class="keywordtype">int</span> index;</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>   <span class="keywordtype">int</span> iter;</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>   <span class="keywordtype">int</span> maxIter   = 2;         <span class="comment">/* Not less than 2 !!! */</span></div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>   <span class="keywordtype">int</span> smoothBox = 31;        <span class="comment">/* Not less than 5 !!! */</span></div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>   <span class="keywordtype">double</span> nsigma = 5.0;</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span> </div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>   <span class="keywordtype">double</span> sumWeight, sum, sumSky, sumProf, variance, weight;</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>   <span class="keywordtype">double</span> *profile;</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>   <span class="keywordtype">double</span> *buffer;</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>   <span class="keywordtype">float</span>  *edata;</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>   <span class="keywordtype">float</span>  *ekdata;</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>   <span class="keywordtype">float</span>  *endata;</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>   <span class="keywordtype">float</span>  *sdata;</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>   <span class="keywordtype">float</span>  *kdata;</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>   <span class="keywordtype">float</span>  *fdata;</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span> </div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>   <span class="keywordtype">double</span> value;</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span> </div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span> </div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>   specLen = cpl_image_get_size_x(sciwin);</div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>   numRows = cpl_image_get_size_y(sciwin);</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span> </div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>   edata = cpl_image_get_data(extracted);</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span>   edata += nobjects * specLen;</div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span> </div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>   ekdata = cpl_image_get_data(sky);</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>   ekdata += nobjects * specLen;</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span> </div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>   endata = cpl_image_get_data(error);</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>   endata += nobjects * specLen;</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span> </div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>   sdata = cpl_image_get_data(sciwin);</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>   kdata = cpl_image_get_data(skywin);</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span> </div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span> </div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span> <span class="comment">   * Initial spectrum estimate</span></div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span> <span class="comment">      if (sdata[i + j * specLen] > 0.0)</span></div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span> </div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>   <span class="keywordflow">if</span> (extraction && numRows > 5) {</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>       smowin = <a class="code" href="group__moses.html#ga1f574f5f45840ea69fa03eb26055a1b1" title="Convenience function for standard median filtering.">mos_image_filter_median</a>(sciwin, 3, 3);</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>       fdata = cpl_image_get_data(smowin);</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>       <span class="keywordflow">for</span> (i = 0; i < specLen; i++)</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>         <span class="keywordflow">for</span> (j = 0, edata[i] = 0.0; j < numRows; j++)</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>             edata[i] += fdata[i + j * specLen];</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>       cpl_image_delete(smowin);</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>   }</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>   <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>       <span class="keywordflow">for</span> (i = 0; i < specLen; i++)</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>         <span class="keywordflow">for</span> (j = 0, edata[i] = 0.0; j < numRows; j++)</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>             edata[i] += sdata[i + j * specLen];</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>   }</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span> </div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>   <span class="keywordflow">if</span> (extraction) {</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span> </div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>     profile = cpl_calloc(specLen * numRows, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>     buffer  = cpl_calloc(specLen, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span> </div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>     <span class="keywordflow">for</span> (iter = 0; iter < maxIter; iter++) {</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span> </div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span> <span class="comment">       * Normalised spatial profile</span></div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span> </div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>       <span class="keywordflow">for</span> (i = 0; i < specLen; i++) {</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>         <span class="keywordflow">for</span> (j = 0; j < numRows; j++) {</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>           index = i + j * specLen;</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span> <span class="comment">/*          if (sdata[index] > 0.0 && edata[i] > 0.00001)     */</span></div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>           <span class="keywordflow">if</span> (fabs(edata[i]) > 0.00001)</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>             profile[index] = sdata[index] / edata[i];</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>           <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>             profile[index] = 0.0;</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>         }</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>       }</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span> </div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>       <span class="keywordflow">for</span> (j = 0; j < numRows; j++) {</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span> </div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span> <span class="comment">         * Smooth each row in the dispersion direction, and enforce positivity</span></div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span> </div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>         <span class="keywordflow">for</span> (i = 0; i < specLen - smoothBox; i++) {</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>           vprofile = cpl_vector_wrap(smoothBox, profile + i + j*specLen);</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>           value = cpl_vector_get_median_const(vprofile);</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>           cpl_vector_unwrap(vprofile);</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>           <span class="keywordflow">if</span> (value < 0)</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>             value = 0.0;</div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>           buffer[i + smoothBox / 2] = value;</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>         }</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span> </div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span> <span class="comment">         * Replace the end portions (i.e., not median filtered) with a mean</span></div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span> </div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>         vprofile = cpl_vector_wrap(smoothBox / 2, profile + j*specLen);</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>         value = cpl_vector_get_mean(vprofile);</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>         cpl_vector_unwrap(vprofile);</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span> </div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>         <span class="keywordflow">if</span> (value < 0)</div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>             value = 0.0;</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span> </div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>         <span class="keywordflow">for</span> (i = 0; i < smoothBox / 2; i++)</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>           buffer[i] = value;</div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span> </div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>         vprofile = cpl_vector_wrap(smoothBox / 2, </div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>                                    profile + specLen - smoothBox/2 + j*specLen);</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>         value = cpl_vector_get_mean(vprofile);</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>         cpl_vector_unwrap(vprofile);</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span> </div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>         <span class="keywordflow">if</span> (value < 0)</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>             value = 0.0;</div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span> </div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>         <span class="keywordflow">for</span> (i = 0; i < smoothBox / 2; i++)</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>           buffer[i + specLen - smoothBox / 2] = value;</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span> </div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>         <span class="keywordflow">for</span> (i = 0; i < specLen; i++)</div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>           profile[i + j * specLen] = buffer[i];</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span> </div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>       }</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span> </div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span> <span class="comment">       * Enforce normalization of spatial profile after smoothing</span></div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span> </div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>       <span class="keywordflow">for</span> (i = 0; i < specLen; i++) {</div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>         <span class="keywordflow">for</span> (j = 0, value = 0.0; j < numRows; j++)</div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>           value += profile[i + j * specLen];</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>         <span class="keywordflow">if</span> (value > 0.00001)</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>           <span class="keywordflow">for</span> (j = 0; j < numRows; j++)</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>             profile[i + j * specLen] /= value;</div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>           <span class="keywordflow">for</span> (j = 0; j < numRows; j++)</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>             profile[i + j * specLen] = 0.0;</div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>       }</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span> </div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span> </div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span> <span class="comment">       * Optimal extraction</span></div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span> </div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>       <span class="keywordflow">for</span> (i = 0; i < specLen; i++) {</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>         sum = 0.0;</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>         sumSky = 0.0;</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>         sumWeight = 0.0;</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>         sumProf = 0.0;</div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>         <span class="keywordflow">for</span> (j = 0; j < numRows; j++) {</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>           index = i + j * specLen;</div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span> <span class="comment">/*        </span></div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span> <span class="comment">if (sdata[index] > 0.0) {</span></div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>             variance = ron*ron + fabs(edata[i] * profile[index] + kdata[index])</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>                      / conad;</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>             variance /= ncomb;  <span class="comment">/* If input dataset is sum of ncomb images */</span></div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>             value = sdata[index] - edata[i] * profile[index];</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>             <span class="keywordflow">if</span> (fabs(value) / sqrt(variance) < nsigma) {</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>               weight = 1000000 * profile[index] / variance;</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>               sum += weight * sdata[index];</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>               sumSky += weight * kdata[index];</div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>               sumWeight += weight * profile[index];</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>               sumProf += profile[index];</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>             }</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span> <span class="comment">}      </span></div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>         }</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span> </div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>         <span class="keywordflow">if</span> (sumWeight > 0.00001) {</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>           edata[i] = sum / sumWeight;</div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>           ekdata[i] = sumSky / sumWeight;</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>           endata[i] = 1000 * sqrt(sumProf / sumWeight);</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>         }</div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span> <span class="comment">          edata[i] = 0.0;</span></div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span> <span class="comment">          ekdata[i] = 0.0;</span></div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span> <span class="comment">          endata[i] = 0.0;</span></div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>           endata[i] = sqrt(ron*ron + fabs(edata[i] + ekdata[i]) / conad);</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>         }</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>       }</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>     }</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>     cpl_free(profile);</div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>     cpl_free(buffer);</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>   }</div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>   <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span> </div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span> <span class="comment">     * Add sky estimation for the simple aperture extraction.</span></div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span> <span class="comment">        if (kdata[i + j * specLen] > 0.0)</span></div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span> </div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>     <span class="keywordflow">for</span> (i = 0; i < specLen; i++)</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>       <span class="keywordflow">for</span> (j = 0, ekdata[i] = 0.0; j < numRows; j++)</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>           ekdata[i] += kdata[i + j * specLen];</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span> </div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span> <span class="comment">     * Add error estimation for the simple aperture extraction.</span></div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span> </div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>     <span class="keywordflow">for</span> (i = 0; i < specLen; i++)</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>       endata[i] = sqrt(ron*ron + fabs(edata[i] + ekdata[i]) / conad);</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span> </div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>   }</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span> </div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span> }</div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span> </div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span> </div>
+<div class="line"><a name="l01179"></a><span class="lineno"><a class="code" href="group__moses.html#gab847fe615b7510fc2d189e80cf5029b5"> 1179</a></span> cpl_table *<a class="code" href="group__moses.html#gab847fe615b7510fc2d189e80cf5029b5" title="Determine all global distortions models.">mos_global_distortion</a>(cpl_table *slits, cpl_table *maskslits,</div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>                                  cpl_table *ids, cpl_table *crv, </div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>                                  <span class="keywordtype">double</span> reference)</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span> {</div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_global_distortion"</span>;</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span> </div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span> </div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>     cpl_table      *global = NULL;</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>     cpl_table      *coeff;</div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>     cpl_table      *dummy;</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>     cpl_vector     *ci;</div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>     cpl_vector     *xmask;</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>     cpl_vector     *ymask;</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>     cpl_bivector   *mask;</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>     cpl_vector     *xccd;</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>     cpl_vector     *yccd;</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>     cpl_bivector   *ccd;</div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>     cpl_polynomial *poly;</div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>     <span class="keywordtype">double</span>         *xtop;</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>     <span class="keywordtype">double</span>         *ytop;</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>     <span class="keywordtype">double</span>         *xbottom;</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>     <span class="keywordtype">double</span>         *ybottom;</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>     <span class="keywordtype">double</span>         *mxtop;</div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>     <span class="keywordtype">double</span>         *mytop;</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>     <span class="keywordtype">double</span>         *mxbottom;</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>     <span class="keywordtype">double</span>         *mybottom;</div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>     <span class="keywordtype">int</span>            *position;</div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>     <span class="keywordtype">int</span>            *mslit_id;</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>     <span class="keywordtype">int</span>             nslits, nmaskslits, npoints;</div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>     <span class="keywordtype">int</span>             minslit = 6;    <span class="comment">// 12;</span></div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span> </div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span> </div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span> <span class="comment">printf("error1: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>     <span class="keywordflow">if</span> (slits == NULL || maskslits == NULL || ids == NULL || crv == NULL) {</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>     }</div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span> <span class="comment">printf("error1a: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span> </div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>     nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span> <span class="comment">printf("error1b: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span> </div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>     <span class="keywordflow">if</span> (nslits < minslit) {</div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>         cpl_msg_warning(func, <span class="stringliteral">"Too few slits (%d < %d) for global "</span></div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>                         <span class="stringliteral">"distortion model determination"</span>, nslits, minslit);</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>     }</div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span> <span class="comment">printf("error1c: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span> </div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>     nmaskslits = cpl_table_get_nrow(maskslits);</div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span> </div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);</div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>     mslit_id = cpl_table_get_data_int(maskslits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>     xtop     = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>     ytop     = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>     xbottom  = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>     ybottom  = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>     mxtop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>     mytop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>     mxbottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>     mybottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span> </div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span> </div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span> <span class="comment">     * Global IDS</span></div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span> </div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>     coeff = cpl_table_new(nslits);</div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>     cpl_table_copy_structure(coeff, ids);</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>     cpl_table_new_column(coeff, <span class="stringliteral">"xccd"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>     cpl_table_new_column(coeff, <span class="stringliteral">"yccd"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>     cpl_table_new_column(coeff, <span class="stringliteral">"xmask"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>     cpl_table_new_column(coeff, <span class="stringliteral">"ymask"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span> </div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span> <span class="comment">printf("error2: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>         <span class="keywordflow">for</span> (j = 0; j < nmaskslits; j++) {</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>             <span class="keywordflow">if</span> (slit_id[i] == mslit_id[j]) {</div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>                 cpl_table_set_double(coeff, <span class="stringliteral">"xmask"</span>, i,</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>                                      (mxtop[j] + mxbottom[j]) / 2);</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>                 cpl_table_set_double(coeff, <span class="stringliteral">"ymask"</span>, i,</div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>                                      (mytop[j] + mybottom[j]) / 2);</div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>             }</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>         }</div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>     }</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span> </div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>     <span class="keywordflow">if</span> (cpl_table_has_invalid(coeff, <span class="stringliteral">"xmask"</span>)) {</div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>         cpl_table_delete(coeff);</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>     }</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span> </div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>         cpl_table_set_double(coeff, <span class="stringliteral">"xccd"</span>, i, (xtop[i] + xbottom[i]) / 2);</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>         cpl_table_set_double(coeff, <span class="stringliteral">"yccd"</span>, i, (ytop[i] + ybottom[i]) / 2);</div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>     }</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span> </div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span> <span class="comment">printf("error3: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span> </div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span> </div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>         cpl_table_and_selected_window(ids, position[i], length[i]);</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>         dummy = cpl_table_extract_selected(ids);</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>         <span class="keywordflow">for</span> (j = 0; j < 6; j++) {</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>             <span class="keywordflow">if</span> (cpl_table_has_column(dummy, clab[j])) {</div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>                 <span class="keywordflow">if</span> (length[i] - cpl_table_count_invalid(dummy, clab[j]) > 10) {</div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>                     cpl_table_set_double(coeff, clab[j], i, </div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>                          cpl_table_get_column_median(dummy, clab[j]));</div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>                 }</div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>             }</div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>         }</div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span> </div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>         cpl_table_delete(dummy);</div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>         cpl_table_select_all(ids);</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>             </div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>     }</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span> </div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span> <span class="comment">printf("error4: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>     <span class="keywordflow">for</span> (j = 0; j < 6; j++) {</div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>         <span class="keywordflow">if</span> (cpl_table_has_column(coeff, clab[j])) {</div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>             cpl_table_and_selected_invalid(coeff, clab[j]);</div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span> </div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>             <span class="keywordflow">if</span> (cpl_table_not_selected(coeff))</div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>                 dummy = cpl_table_extract_selected(coeff);</div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span> </div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>             npoints = cpl_table_get_nrow(dummy);</div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span> </div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>             <span class="keywordflow">if</span> (npoints >= 6) {</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span> </div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>                 <span class="keywordflow">if</span> (npoints >= 12)</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>                     order = 2;</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>                     order = 1;</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>                    </div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>                 ci = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>                                      cpl_table_get_data_double(dummy, clab[j]));</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>                 <span class="keywordflow">if</span> (j) {</div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>                     xccd = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"xccd"</span>));</div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>                     yccd = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"yccd"</span>));</div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>                     ccd = cpl_bivector_wrap_vectors(xccd, yccd);</div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span> </div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span> <span class="comment">/* %%% */</span></div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>                     poly = cpl_polynomial_fit_2d_create(ccd, ci, order, NULL);</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span> </div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>                     cpl_bivector_unwrap_vectors(ccd);</div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>                     cpl_vector_unwrap(xccd);</div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>                     cpl_vector_unwrap(yccd);</div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>                     cpl_vector_unwrap(ci);</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>                 }</div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>                     xmask = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"xmask"</span>));</div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>                     ymask = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"ymask"</span>));</div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>                     mask = cpl_bivector_wrap_vectors(xmask, ymask);</div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span> </div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span> <span class="comment">/* %%% */</span></div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>                     poly = cpl_polynomial_fit_2d_create(mask, ci, order, NULL);</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span> </div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>                     cpl_bivector_unwrap_vectors(mask);</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>                     cpl_vector_unwrap(xmask);</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>                     cpl_vector_unwrap(ymask);</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>                     cpl_vector_unwrap(ci);</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>                 }</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>             }</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>                 cpl_size p[2] = {0, 0};</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>                 poly = cpl_polynomial_new(2);</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>                 cpl_polynomial_set_coeff(poly, p, </div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>                                cpl_table_get_column_median(dummy, clab[j]));</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>             }</div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span> </div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>             cpl_table_delete(dummy);</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span> </div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>             global = write_global_distortion(global, j, poly);</div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span> </div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>             cpl_polynomial_delete(poly);</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span> </div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>             cpl_table_select_all(coeff);</div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>         }</div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>     }</div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span> </div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span> <span class="comment">printf("error5: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>     cpl_table_delete(coeff);</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span> <span class="comment">printf("error6: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span> </div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span> </div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span> <span class="comment">     * Add model's reference wavelength</span></div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span> </div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>     cpl_table_set_double(global, <span class="stringliteral">"a00"</span>, 6, reference);</div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span> </div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span> </div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span> <span class="comment">     * Global curvature model</span></div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span> </div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>     coeff = cpl_table_duplicate(crv);</div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>     cpl_table_new_column(coeff, <span class="stringliteral">"xmask"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>     cpl_table_new_column(coeff, <span class="stringliteral">"ymask"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>     slit_id = cpl_table_get_data_int(coeff, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>     npoints = cpl_table_get_nrow(coeff);</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span> </div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span> <span class="comment">printf("error7: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>     <span class="keywordflow">for</span> (i = 0; i < npoints; i++) {</div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>         <span class="keywordflow">for</span> (j = 0; j < nmaskslits; j++) {</div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>             <span class="keywordflow">if</span> (slit_id[i] == mslit_id[j]) {</div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>                 <span class="keywordflow">if</span> (i%2) {</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>                     cpl_table_set_double(coeff, <span class="stringliteral">"xmask"</span>, i, mxbottom[j]);</div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>                     cpl_table_set_double(coeff, <span class="stringliteral">"ymask"</span>, i, mybottom[j]);</div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>                 }</div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>                     cpl_table_set_double(coeff, <span class="stringliteral">"xmask"</span>, i, mxtop[j]);</div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>                     cpl_table_set_double(coeff, <span class="stringliteral">"ymask"</span>, i, mytop[j]);</div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>                 }</div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>             }</div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>         }</div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>     }</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span> </div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span> <span class="comment">printf("error8: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>     <span class="keywordflow">if</span> (cpl_table_has_invalid(coeff, <span class="stringliteral">"xmask"</span>)) {</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>         cpl_table_delete(coeff);</div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>     }</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span> </div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span> <span class="comment">printf("error9: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>     <span class="keywordflow">for</span> (j = 0; j < 3; j++) {</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>         <span class="keywordflow">if</span> (cpl_table_has_column(coeff, clab[j])) {</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>             cpl_table_and_selected_invalid(coeff, clab[j]);</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span> </div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>             <span class="keywordflow">if</span> (cpl_table_not_selected(coeff))</div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>                 dummy = cpl_table_extract_selected(coeff);</div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span> </div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>             npoints = cpl_table_get_nrow(dummy);</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span> </div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>             <span class="keywordflow">if</span> (npoints >= 6) {</div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span> </div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>                 <span class="keywordflow">if</span> (npoints >= 12)</div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>                     order = 2;</div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>                     order = 1;</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span> </div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>                 ci = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>                                      cpl_table_get_data_double(dummy, clab[j]));</div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>                 xmask = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"xmask"</span>));</div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>                 ymask = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>                                      cpl_table_get_data_double(dummy, <span class="stringliteral">"ymask"</span>));</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>                 mask = cpl_bivector_wrap_vectors(xmask, ymask);</div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span> </div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>                 poly = cpl_polynomial_fit_2d_create(mask, ci, order, NULL);</div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span> </div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>                 cpl_bivector_unwrap_vectors(mask);</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>                 cpl_vector_unwrap(ci);</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>                 cpl_vector_unwrap(xmask);</div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>                 cpl_vector_unwrap(ymask);</div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>             }</div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>                 cpl_size p[2] = {0, 0};</div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>                 poly = cpl_polynomial_new(2);</div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>                 cpl_polynomial_set_coeff(poly, p,</div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>                                cpl_table_get_column_median(dummy, clab[j]));</div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>             }</div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span> </div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>             cpl_table_delete(dummy);</div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span> </div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>             global = write_global_distortion(global, j + 7, poly);</div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span> </div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>             cpl_polynomial_delete(poly);</div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>             cpl_table_select_all(coeff);</div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>         }</div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>     }</div>
+<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span> </div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span> <span class="comment">printf("error10: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>     cpl_table_delete(coeff);</div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span> <span class="comment">/* *+</span></div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span> <span class="comment">printf("error11: %s\n", cpl_error_get_message());</span></div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span> <span class="comment">+* */</span></div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span> </div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>     <span class="keywordflow">return</span> global;</div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span> </div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span> }</div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span> </div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span> </div>
+<div class="line"><a name="l01543"></a><span class="lineno"><a class="code" href="group__moses.html#gad9b2789388ba6564011d832d276b2ae6"> 1543</a></span> cpl_table *<a class="code" href="group__moses.html#gad9b2789388ba6564011d832d276b2ae6" title="Build the slit location table from a global distortions table.">mos_build_slit_location</a>(cpl_table *global, cpl_table *maskslits,</div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>                                    <span class="keywordtype">int</span> ysize)</div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span> {</div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_build_slit_location"</span>;</div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span> </div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>     cpl_propertylist *sort_col;</div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>     cpl_polynomial   *ids0;</div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>     cpl_polynomial   *crv[3];</div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>     cpl_polynomial   *loc_crv;</div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>     cpl_vector       *point;</div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>     cpl_table        *slits;</div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>     cpl_size         nslits;</div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>     <span class="keywordtype">int</span>              *slit_id;</div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>     <span class="keywordtype">double</span>           *dpoint;</div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>     <span class="keywordtype">double</span>           *xtop;</div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>     <span class="keywordtype">double</span>           *ytop;</div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>     <span class="keywordtype">double</span>           *xbottom;</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>     <span class="keywordtype">double</span>           *ybottom;</div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>     <span class="keywordtype">double</span>           *mxtop;</div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>     <span class="keywordtype">double</span>           *mytop;</div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>     <span class="keywordtype">double</span>           *mxbottom;</div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>     <span class="keywordtype">double</span>           *mybottom;</div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>     cpl_size          i;</div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>     cpl_size          j;</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span> </div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span> </div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>     <span class="keywordflow">if</span> (global == NULL || maskslits == NULL) {</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>     }</div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span> </div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>     nslits   = cpl_table_get_nrow(maskslits);</div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>     slit_id  = cpl_table_get_data_int(maskslits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>     mxtop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>     mytop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>     mxbottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>     mybottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span> </div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>     slits = cpl_table_duplicate(maskslits);</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span> </div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>     xtop    = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>     ytop    = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>     xbottom = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>     ybottom = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span> </div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>     ids0 = read_global_distortion(global, 0);</div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>     crv[0] = read_global_distortion(global, 7);</div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>     crv[1] = read_global_distortion(global, 8);</div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>     crv[2] = read_global_distortion(global, 9);</div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span> </div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>     loc_crv = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span> </div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>     point = cpl_vector_new(2);</div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>     dpoint = cpl_vector_get_data(point);</div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span> </div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>         dpoint[0] = mxtop[i];</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>         dpoint[1] = mytop[i];</div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span> </div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>         xtop[i] = cpl_polynomial_eval(ids0, point);</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span> </div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>         <span class="keywordflow">for</span> (j = 0; j < 3; j++)</div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>             <span class="keywordflow">if</span> (crv[j])</div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>                 cpl_polynomial_set_coeff(loc_crv, &j, </div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>                                          cpl_polynomial_eval(crv[j], point));</div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span> </div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>         ytop[i] = cpl_polynomial_eval_1d(loc_crv, xtop[i], NULL);</div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span> </div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>         dpoint[0] = mxbottom[i];</div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>         dpoint[1] = mybottom[i];</div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>         xbottom[i] = cpl_polynomial_eval(ids0, point);</div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span> </div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>         <span class="keywordflow">for</span> (j = 0; j < 3; j++)</div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>             <span class="keywordflow">if</span> (crv[j])</div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>                 cpl_polynomial_set_coeff(loc_crv, &j,</div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>                                          cpl_polynomial_eval(crv[j], point));</div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span> </div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>         ybottom[i] = cpl_polynomial_eval_1d(loc_crv, xbottom[i], NULL);</div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>     }</div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span> </div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>     cpl_vector_delete(point);</div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>     cpl_polynomial_delete(ids0);</div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>     cpl_polynomial_delete(loc_crv);</div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>     <span class="keywordflow">for</span> (j = 0; j < 3; j++)</div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>         cpl_polynomial_delete(crv[j]);</div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span> </div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>     sort_col = cpl_propertylist_new();</div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>     cpl_propertylist_append_bool(sort_col, <span class="stringliteral">"ytop"</span>, 1);</div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>     cpl_table_sort(slits, sort_col);</div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>     cpl_table_sort(maskslits, sort_col);</div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>     cpl_propertylist_delete(sort_col);</div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span> </div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span> <span class="comment">     * Eliminate slits which are _entirely_ outside the CCD</span></div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span> </div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>     cpl_table_and_selected_double(slits, <span class="stringliteral">"ybottom"</span>, CPL_GREATER_THAN, ysize-1);</div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>     cpl_table_or_selected_double(slits, <span class="stringliteral">"ytop"</span>, CPL_LESS_THAN, 0);</div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>     cpl_table_erase_selected(slits);</div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span> </div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>     nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span> </div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>     <span class="keywordflow">if</span> (nslits == 0) {</div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>         cpl_msg_warning(func, <span class="stringliteral">"No slits found on the CCD"</span>);</div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>         cpl_table_delete(slits);</div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>     }</div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span> </div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>     <span class="keywordflow">if</span> (nslits > 1)</div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>         cpl_msg_info(func, <span class="stringliteral">"Slit location: %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" slits are entirely or partially "</span></div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>                      <span class="stringliteral">"contained in CCD"</span>, nslits);</div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>         cpl_msg_info(func, <span class="stringliteral">"Slit location: %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" slit is entirely or partially "</span></div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>                      <span class="stringliteral">"contained in CCD"</span>, nslits);</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span> </div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>     <span class="keywordflow">return</span> slits;</div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span> </div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span> }</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span> </div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span> </div>
+<div class="line"><a name="l01690"></a><span class="lineno"><a class="code" href="group__moses.html#gacff89218baba1abf3641c083a1125861"> 1690</a></span> cpl_table *<a class="code" href="group__moses.html#gacff89218baba1abf3641c083a1125861" title="Build the curvature coefficients table from a global distortions table.">mos_build_curv_coeff</a>(cpl_table *global, cpl_table *maskslits,</div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>                                 cpl_table *slits)</div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span> {</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_build_curv_coeff"</span>;</div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span> </div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>     *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span> </div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>     cpl_polynomial *crv[3];</div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>     cpl_vector     *point;</div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>     cpl_table      *polytraces;</div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>     <span class="keywordtype">double</span>         *dpoint;</div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>     <span class="keywordtype">double</span>         *xtop;</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>     <span class="keywordtype">double</span>         *ytop;</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>     <span class="keywordtype">double</span>         *xbottom;</div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>     <span class="keywordtype">double</span>         *ybottom;</div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>     <span class="keywordtype">int</span>            *valid_id;</div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>     <span class="keywordtype">int</span>             nslits, nvalid;</div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>     <span class="keywordtype">int</span>             found;</div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>     <span class="keywordtype">int</span>             i, j, k;</div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span> </div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span> </div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>     <span class="keywordflow">if</span> (global == NULL || slits == NULL || maskslits == NULL) {</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>     }</div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span> </div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>     nslits  = cpl_table_get_nrow(maskslits);</div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>     slit_id = cpl_table_get_data_int(maskslits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>     xtop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>     ytop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>     xbottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>     ybottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span> </div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>     polytraces = cpl_table_new(2*nslits);</div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>     cpl_table_new_column(polytraces, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>     <span class="keywordflow">for</span> (i = 0; i < 3; i++)</div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>         cpl_table_new_column(polytraces, clab[i], CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span> </div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>     crv[0] = read_global_distortion(global, 7);</div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>     crv[1] = read_global_distortion(global, 8);</div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>     crv[2] = read_global_distortion(global, 9);</div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span> </div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>     point = cpl_vector_new(2);</div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>     dpoint = cpl_vector_get_data(point);</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span> </div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>         <span class="keywordflow">for</span> (j = 0; j < 2; j++) {  <span class="comment">/* For top and bottom trace of each slit */</span></div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span> </div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>             cpl_table_set_int(polytraces, <span class="stringliteral">"slit_id"</span>, 2*i+j, slit_id[i]);</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span> </div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>             <span class="keywordflow">if</span> (j) {</div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>                 dpoint[0] = xbottom[i];</div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>                 dpoint[1] = ybottom[i];                </div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>             }</div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>                 dpoint[0] = xtop[i];</div>
+<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>                 dpoint[1] = ytop[i];                </div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>             }</div>
+<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span> </div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>             <span class="keywordflow">for</span> (k = 0; k < 3; k++)</div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>                 <span class="keywordflow">if</span> (crv[j])</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>                     cpl_table_set_double(polytraces, clab[k], 2*i+j,</div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>                                          cpl_polynomial_eval(crv[k], point));</div>
+<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>         }</div>
+<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>     }</div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span> </div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>     cpl_vector_delete(point);</div>
+<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>     <span class="keywordflow">for</span> (j = 0; j < 3; j++)</div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>         cpl_polynomial_delete(crv[j]);</div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span> </div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span> <span class="comment">     * Eliminate slits which are _entirely_ outside the CCD</span></div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>  </div>
+<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>     nvalid  = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>     valid_id = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>     cpl_table_unselect_all(polytraces);</div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>         found = 0;</div>
+<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>         <span class="keywordflow">for</span> (j = 0; j < nvalid; j++) {</div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>             <span class="keywordflow">if</span> (slit_id[i] == valid_id[j]) {</div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>                 found = 1;</div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>             }</div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>         }</div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>         <span class="keywordflow">if</span> (!found) {</div>
+<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span>             cpl_table_select_row(polytraces, 2*i);</div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>             cpl_table_select_row(polytraces, 2*i + 1);</div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>         }</div>
+<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>     }</div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>     cpl_table_erase_selected(polytraces);</div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>  </div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>     nslits = cpl_table_get_nrow(polytraces);</div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span> </div>
+<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>     <span class="keywordflow">if</span> (nslits == 0) {</div>
+<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>         cpl_msg_warning(func, <span class="stringliteral">"No slits found on the CCD"</span>);</div>
+<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>         cpl_table_delete(polytraces);</div>
+<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>     }</div>
+<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span> </div>
+<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span>     <span class="keywordflow">if</span> (nslits > 2) </div>
+<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>         cpl_msg_info(func, <span class="stringliteral">"Curvature model: %d slits are entirely or "</span></div>
+<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span>                      <span class="stringliteral">"partially contained in CCD"</span>, nslits / 2);</div>
+<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>         cpl_msg_info(func, <span class="stringliteral">"Curvature model: %d slit is entirely or "</span></div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>                      <span class="stringliteral">"partially contained in CCD"</span>, nslits / 2);</div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span> </div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>     <span class="keywordflow">return</span> polytraces;</div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span> }</div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span> </div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span> </div>
+<div class="line"><a name="l01845"></a><span class="lineno"><a class="code" href="group__moses.html#ga4e4da9890ad8d0229f187b4d7eda17be"> 1845</a></span> cpl_table *<a class="code" href="group__moses.html#ga4e4da9890ad8d0229f187b4d7eda17be" title="Build the IDS coefficients table from a global distortions table.">mos_build_disp_coeff</a>(cpl_table *global, cpl_table *slits)</div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span> {</div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_build_disp_coeff"</span>;</div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span> </div>
+<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>     *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span> </div>
+<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>     cpl_polynomial *ids[6];</div>
+<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>     cpl_vector     *point;</div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>     cpl_table      *idscoeff;</div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>     <span class="keywordtype">double</span>         *dpoint;</div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>     <span class="keywordtype">double</span>         *xtop;</div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>     <span class="keywordtype">double</span>         *ytop;</div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>     <span class="keywordtype">double</span>         *xbottom;</div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>     <span class="keywordtype">double</span>         *ybottom;</div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>     <span class="keywordtype">int</span>            *position;</div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>     <span class="keywordtype">int</span>             nrows;</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>     <span class="keywordtype">int</span>             ylow, yhig;</div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>     <span class="keywordtype">int</span>             i, j, k;</div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span> </div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span> </div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>     <span class="keywordflow">if</span> (global == NULL || slits == NULL) {</div>
+<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>     }</div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>     </div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);</div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>     xtop     = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>     ytop     = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>     xbottom  = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>     ybottom  = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span> </div>
+<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>     <span class="keywordflow">for</span> (i = 0; i < 6; i++)</div>
+<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>         ids[i] = read_global_distortion(global, i);</div>
+<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span> </div>
+<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>     <span class="keywordflow">for</span> (i = 0; i < 6; i++)</div>
+<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>         <span class="keywordflow">if</span> (ids[i] == NULL)</div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span> </div>
+<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>     order = i - 1;</div>
+<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span> </div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>     <span class="keywordflow">if</span> (order < 1) {</div>
+<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>     }</div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span> </div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>     nrows = 0;</div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)</div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>         nrows += length[i]; </div>
+<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span> </div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>     idscoeff = cpl_table_new(nrows);</div>
+<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span> </div>
+<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>     <span class="keywordflow">for</span> (j = 0; j <= order; j++)</div>
+<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>         cpl_table_new_column(idscoeff, clab[j], CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span> </div>
+<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>     cpl_table_new_column(idscoeff, <span class="stringliteral">"error"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>     cpl_table_fill_column_window_double(idscoeff, <span class="stringliteral">"error"</span>, 0, nrows, 0.0);</div>
+<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>     cpl_table_new_column(idscoeff, <span class="stringliteral">"nlines"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>     cpl_table_fill_column_window_int(idscoeff, <span class="stringliteral">"nlines"</span>, 0, nrows, 0);</div>
+<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span> </div>
+<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>     point = cpl_vector_new(2);</div>
+<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>     dpoint = cpl_vector_get_data(point);</div>
+<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span> </div>
+<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span> </div>
+<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span> </div>
+<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>         ylow = position[i];</div>
+<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>         yhig = ylow + length[i];</div>
+<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span> </div>
+<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>         <span class="keywordflow">for</span> (j = 0; j <= order; j++) {</div>
+<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>             <span class="keywordflow">if</span> (j) {</div>
+<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>                 <span class="keywordflow">for</span> (k = 0; k < length[i]; k++) {</div>
+<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>                     dpoint[0] = xbottom[i] + k*(xtop[i]-xbottom[i])/length[i];</div>
+<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>                     dpoint[1] = ybottom[i] + k*(ytop[i]-ybottom[i])/length[i];</div>
+<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>                     cpl_table_set_double(idscoeff, clab[j], ylow + k,</div>
+<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>                                          cpl_polynomial_eval(ids[j], point));</div>
+<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>                 }</div>
+<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>             }</div>
+<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>                 <span class="keywordflow">for</span> (k = 0; k < length[i]; k++) {</div>
+<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>                     cpl_table_set_double(idscoeff, clab[0], ylow + k,</div>
+<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>                                 xbottom[i] + k*(xtop[i]-xbottom[i])/length[i]);</div>
+<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>                 }</div>
+<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>             }</div>
+<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>         }</div>
+<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>     }</div>
+<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span> </div>
+<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>     cpl_vector_delete(point);</div>
+<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>     <span class="keywordflow">for</span> (j = 0; j < 6; j++)</div>
+<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>         cpl_polynomial_delete(ids[j]);</div>
+<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span> </div>
+<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>     <span class="keywordflow">return</span> idscoeff;</div>
+<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span> </div>
+<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span> }</div>
+<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span> </div>
+<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span> </div>
+<div class="line"><a name="l01969"></a><span class="lineno"><a class="code" href="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2"> 1969</a></span> cpl_image *<a class="code" href="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2" title="Subtract the sky from the scientific CCD exposure.">mos_subtract_sky</a>(cpl_image *science, cpl_table *slits, </div>
+<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>                             cpl_table *polytraces, <span class="keywordtype">double</span> reference, </div>
+<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>                             <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion)</div>
+<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span> {</div>
+<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>     *func = <span class="stringliteral">"mos_subtract_sky"</span>;</div>
+<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span> </div>
+<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span> </div>
+<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>     cpl_image      *sky;</div>
+<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>     cpl_bivector   *list;</div>
+<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>     cpl_vector     *listx;</div>
+<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>     cpl_vector     *listy;</div>
+<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>     cpl_polynomial *polytop;</div>
+<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>     cpl_polynomial *polybot;</div>
+<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>     cpl_polynomial *trend;</div>
+<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span> </div>
+<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>     <span class="keywordtype">double</span>         *dlistx;</div>
+<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>     <span class="keywordtype">double</span>         *dlisty;</div>
+<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>     <span class="keywordtype">float</span>          *kdata;</div>
+<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>     <span class="keywordtype">double</span>          top, bot;</div>
+<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>     <span class="keywordtype">int</span>             itop, ibot;</div>
+<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>     <span class="keywordtype">double</span>          coeff;</div>
+<div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>     <span class="keywordtype">double</span>          ytop, ybot;</div>
+<div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>     <span class="keywordtype">double</span>          m, q, err;</div>
+<div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>     <span class="keywordtype">int</span>             npix;</div>
+<div class="line"><a name="l01997"></a><span class="lineno"> 1997</span> </div>
+<div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;</div>
+<div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>     <span class="keywordtype">int</span>             nx, ny;</div>
+<div class="line"><a name="l02000"></a><span class="lineno"> 2000</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l02002"></a><span class="lineno"> 2002</span>     <span class="keywordtype">int</span>             missing_top, missing_bot;</div>
+<div class="line"><a name="l02003"></a><span class="lineno"> 2003</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l02005"></a><span class="lineno"> 2005</span>     <span class="keywordtype">int</span>             window = 50;  <span class="comment">/* Longer slits have polynomial sky model */</span></div>
+<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>     <span class="keywordtype">int</span>             count;</div>
+<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>     cpl_size        k;</div>
+<div class="line"><a name="l02009"></a><span class="lineno"> 2009</span> </div>
+<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span> </div>
+<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>     <span class="keywordflow">if</span> (science == NULL || slits == NULL || polytraces == NULL) {</div>
+<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>     }</div>
+<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>  </div>
+<div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>     <span class="keywordflow">if</span> (dispersion <= 0.0) {</div>
+<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>     }</div>
+<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span> </div>
+<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>     <span class="keywordflow">if</span> (red - blue < dispersion) {</div>
+<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>     }</div>
+<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span> </div>
+<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>     nx = cpl_image_get_size_x(science);</div>
+<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>     ny = cpl_image_get_size_y(science);</div>
+<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span> </div>
+<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>     sky = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span> </div>
+<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>     sdata = cpl_image_get_data(science);</div>
+<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>     kdata = cpl_image_get_data(sky);</div>
+<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span> </div>
+<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span>     order    = cpl_table_get_ncol(polytraces) - 2;</div>
+<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span> </div>
+<div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span> <span class="comment">     * The spatial resampling is performed for a certain number of</span></div>
+<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span> <span class="comment">     * pixels above and below the position of the reference wavelength:</span></div>
+<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>     </div>
+<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;</div>
+<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;</div>
+<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span> </div>
+<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span> </div>
+<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span> </div>
+<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>         </div>
+<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span> <span class="comment">         * Recover from the table of spectral curvature coefficients</span></div>
+<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span> <span class="comment">         * the curvature polynomials.</span></div>
+<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span> </div>
+<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);</div>
+<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span> </div>
+<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>         start_pixel = refpixel - pixel_below;</div>
+<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>         <span class="keywordflow">if</span> (start_pixel < 0)</div>
+<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span>             start_pixel = 0;</div>
+<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span> </div>
+<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span>         end_pixel = refpixel + pixel_above;</div>
+<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>         <span class="keywordflow">if</span> (end_pixel > nx)</div>
+<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>             end_pixel = nx;</div>
+<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span> </div>
+<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>         missing_top = 0;</div>
+<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>         polytop = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);</div>
+<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>                 cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span>                 missing_top = 1;</div>
+<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>             }</div>
+<div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>         }</div>
+<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span> </div>
+<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>         missing_bot = 0;</div>
+<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>         polybot = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);</div>
+<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>                 cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>                 missing_bot = 1;</div>
+<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>             }</div>
+<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>         }</div>
+<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span> </div>
+<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>         <span class="keywordflow">if</span> (missing_top && missing_bot) {</div>
+<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>             cpl_msg_debug(func, <span class="stringliteral">"Slit %d was not traced: no extraction!"</span>,</div>
+<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>                           slit_id[i]);</div>
+<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>         }</div>
+<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span> </div>
+<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span> <span class="comment">         * In case just one of the two edges was not traced, the other</span></div>
+<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span> <span class="comment">         * edge curvature model is duplicated and shifted to the other</span></div>
+<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span> <span class="comment">         * end of the slit: better than nothing!</span></div>
+<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span> </div>
+<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>         <span class="keywordflow">if</span> (missing_top) {</div>
+<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>             cpl_msg_debug(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>                           <span class="stringliteral">"the spectral curvature of the lower edge "</span></div>
+<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>             polytop = cpl_polynomial_duplicate(polybot);</div>
+<div class="line"><a name="l02109"></a><span class="lineno"> 2109</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l02110"></a><span class="lineno"> 2110</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>             k = 0;</div>
+<div class="line"><a name="l02112"></a><span class="lineno"> 2112</span>             coeff = cpl_polynomial_get_coeff(polybot, &k);</div>
+<div class="line"><a name="l02113"></a><span class="lineno"> 2113</span>             coeff += ytop - ybot;</div>
+<div class="line"><a name="l02114"></a><span class="lineno"> 2114</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>         }</div>
+<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span> </div>
+<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span>         <span class="keywordflow">if</span> (missing_bot) {</div>
+<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>             cpl_msg_debug(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>                           <span class="stringliteral">"the spectral curvature of the upper edge "</span></div>
+<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>             polybot = cpl_polynomial_duplicate(polytop);</div>
+<div class="line"><a name="l02122"></a><span class="lineno"> 2122</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l02123"></a><span class="lineno"> 2123</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>             k = 0;</div>
+<div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>             coeff = cpl_polynomial_get_coeff(polytop, &k);</div>
+<div class="line"><a name="l02126"></a><span class="lineno"> 2126</span>             coeff -= ytop - ybot;</div>
+<div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>         }</div>
+<div class="line"><a name="l02129"></a><span class="lineno"> 2129</span> </div>
+<div class="line"><a name="l02130"></a><span class="lineno"> 2130</span> </div>
+<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span> <span class="comment">         * Now read pixel values along spatial direction, and fit them.</span></div>
+<div class="line"><a name="l02133"></a><span class="lineno"> 2133</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02134"></a><span class="lineno"> 2134</span> </div>
+<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>         <span class="keywordflow">for</span> (j = start_pixel; j < end_pixel; j++) {</div>
+<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>             top = cpl_polynomial_eval_1d(polytop, j, NULL);</div>
+<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>             bot = cpl_polynomial_eval_1d(polybot, j, NULL);</div>
+<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>             itop = floor(top + 0.5) + 1;</div>
+<div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>             ibot = floor(bot + 0.5);</div>
+<div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>             <span class="keywordflow">if</span> (itop > ny)</div>
+<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>                 itop = ny;</div>
+<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>             <span class="keywordflow">if</span> (ibot < 0)</div>
+<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>                 ibot = 0;</div>
+<div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>             npix = itop - ibot;</div>
+<div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>             <span class="keywordflow">if</span> (npix < 5)</div>
+<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02147"></a><span class="lineno"> 2147</span> </div>
+<div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>             list = cpl_bivector_new(npix);</div>
+<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>             listx = cpl_bivector_get_x(list);</div>
+<div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>             listy = cpl_bivector_get_y(list);</div>
+<div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>             dlistx = cpl_vector_get_data(listx);</div>
+<div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>             dlisty = cpl_vector_get_data(listy);</div>
+<div class="line"><a name="l02153"></a><span class="lineno"> 2153</span> </div>
+<div class="line"><a name="l02154"></a><span class="lineno"> 2154</span>             <span class="keywordflow">for</span> (k = 0; k < npix; k++) {</div>
+<div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>                 dlistx[k] = k;</div>
+<div class="line"><a name="l02156"></a><span class="lineno"> 2156</span>                 dlisty[k] = sdata[j + (ibot + k)*nx];</div>
+<div class="line"><a name="l02157"></a><span class="lineno"> 2157</span>             }</div>
+<div class="line"><a name="l02158"></a><span class="lineno"> 2158</span> </div>
+<div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>             <span class="keywordflow">if</span> (robustLinearFit(list, &q, &m, &err)) {</div>
+<div class="line"><a name="l02160"></a><span class="lineno"> 2160</span>                 cpl_bivector_delete(list);</div>
+<div class="line"><a name="l02161"></a><span class="lineno"> 2161</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l02162"></a><span class="lineno"> 2162</span>             }</div>
+<div class="line"><a name="l02163"></a><span class="lineno"> 2163</span> </div>
+<div class="line"><a name="l02164"></a><span class="lineno"> 2164</span>             cpl_bivector_delete(list);</div>
+<div class="line"><a name="l02165"></a><span class="lineno"> 2165</span> </div>
+<div class="line"><a name="l02166"></a><span class="lineno"> 2166</span>             <span class="keywordflow">for</span> (k = 0; k < npix; k++) {</div>
+<div class="line"><a name="l02167"></a><span class="lineno"> 2167</span>                 kdata[j + (ibot + k)*nx] = m*k + q;</div>
+<div class="line"><a name="l02168"></a><span class="lineno"> 2168</span>             }</div>
+<div class="line"><a name="l02169"></a><span class="lineno"> 2169</span> </div>
+<div class="line"><a name="l02170"></a><span class="lineno"> 2170</span>             <span class="keywordflow">if</span> (npix > window) {</div>
+<div class="line"><a name="l02171"></a><span class="lineno"> 2171</span> </div>
+<div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l02173"></a><span class="lineno"> 2173</span> <span class="comment">                 * Polynomial iteration</span></div>
+<div class="line"><a name="l02174"></a><span class="lineno"> 2174</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l02175"></a><span class="lineno"> 2175</span> </div>
+<div class="line"><a name="l02176"></a><span class="lineno"> 2176</span>                 err = 3*sqrt(err);</div>
+<div class="line"><a name="l02177"></a><span class="lineno"> 2177</span> </div>
+<div class="line"><a name="l02178"></a><span class="lineno"> 2178</span>                 count = 0;</div>
+<div class="line"><a name="l02179"></a><span class="lineno"> 2179</span>                 <span class="keywordflow">for</span> (k = 0; k < npix; k++)</div>
+<div class="line"><a name="l02180"></a><span class="lineno"> 2180</span>                     <span class="keywordflow">if</span> (fabs(sdata[j + (ibot + k)*nx] - m*k - q) < err)</div>
+<div class="line"><a name="l02181"></a><span class="lineno"> 2181</span>                         count++;</div>
+<div class="line"><a name="l02182"></a><span class="lineno"> 2182</span> </div>
+<div class="line"><a name="l02183"></a><span class="lineno"> 2183</span>                 <span class="keywordflow">if</span> (count < 10)</div>
+<div class="line"><a name="l02184"></a><span class="lineno"> 2184</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l02185"></a><span class="lineno"> 2185</span> </div>
+<div class="line"><a name="l02186"></a><span class="lineno"> 2186</span>                 list = cpl_bivector_new(count);</div>
+<div class="line"><a name="l02187"></a><span class="lineno"> 2187</span>                 listx = cpl_bivector_get_x(list);</div>
+<div class="line"><a name="l02188"></a><span class="lineno"> 2188</span>                 listy = cpl_bivector_get_y(list);</div>
+<div class="line"><a name="l02189"></a><span class="lineno"> 2189</span>                 dlistx = cpl_vector_get_data(listx);</div>
+<div class="line"><a name="l02190"></a><span class="lineno"> 2190</span>                 dlisty = cpl_vector_get_data(listy);</div>
+<div class="line"><a name="l02191"></a><span class="lineno"> 2191</span> </div>
+<div class="line"><a name="l02192"></a><span class="lineno"> 2192</span>                 count = 0;</div>
+<div class="line"><a name="l02193"></a><span class="lineno"> 2193</span>                 <span class="keywordflow">for</span> (k = 0; k < npix; k++) {</div>
+<div class="line"><a name="l02194"></a><span class="lineno"> 2194</span>                     <span class="keywordflow">if</span> (fabs(sdata[j + (ibot + k)*nx] - m*k - q) < err) {</div>
+<div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>                         dlistx[count] = k;</div>
+<div class="line"><a name="l02196"></a><span class="lineno"> 2196</span>                         dlisty[count] = sdata[j + (ibot + k)*nx];</div>
+<div class="line"><a name="l02197"></a><span class="lineno"> 2197</span>                         count++;</div>
+<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>                     }</div>
+<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>                 }</div>
+<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span> </div>
+<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>                 trend = cpl_polynomial_fit_1d_create(listx, listy, 2, &err);</div>
+<div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>  </div>
+<div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>                 cpl_bivector_delete(list);</div>
+<div class="line"><a name="l02204"></a><span class="lineno"> 2204</span> </div>
+<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>                 err = 3*sqrt(err);</div>
+<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span> </div>
+<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>                 count = 0;</div>
+<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>                 <span class="keywordflow">for</span> (k = 0; k < npix; k++)</div>
+<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>                     <span class="keywordflow">if</span> (fabs(sdata[j + (ibot + k)*nx] </div>
+<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span>                              - cpl_polynomial_eval_1d(trend, k, NULL)) < err)</div>
+<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>                         count++;</div>
+<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span> </div>
+<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>                 <span class="keywordflow">if</span> (count < 10) {</div>
+<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>                     cpl_polynomial_delete(trend);</div>
+<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>                 }</div>
+<div class="line"><a name="l02217"></a><span class="lineno"> 2217</span> </div>
+<div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>                 list = cpl_bivector_new(count);</div>
+<div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>                 listx = cpl_bivector_get_x(list);</div>
+<div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>                 listy = cpl_bivector_get_y(list);</div>
+<div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>                 dlistx = cpl_vector_get_data(listx);</div>
+<div class="line"><a name="l02222"></a><span class="lineno"> 2222</span>                 dlisty = cpl_vector_get_data(listy);</div>
+<div class="line"><a name="l02223"></a><span class="lineno"> 2223</span> </div>
+<div class="line"><a name="l02224"></a><span class="lineno"> 2224</span>                 count = 0;</div>
+<div class="line"><a name="l02225"></a><span class="lineno"> 2225</span>                 <span class="keywordflow">for</span> (k = 0; k < npix; k++) {</div>
+<div class="line"><a name="l02226"></a><span class="lineno"> 2226</span>                     <span class="keywordflow">if</span> (fabs(sdata[j + (ibot + k)*nx] </div>
+<div class="line"><a name="l02227"></a><span class="lineno"> 2227</span>                              - cpl_polynomial_eval_1d(trend, k, NULL)) < err) {</div>
+<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>                         dlistx[count] = k;</div>
+<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>                         dlisty[count] = sdata[j + (ibot + k)*nx];</div>
+<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>                         count++;</div>
+<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>                     }</div>
+<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>                 }</div>
+<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span> </div>
+<div class="line"><a name="l02234"></a><span class="lineno"> 2234</span>                 cpl_polynomial_delete(trend);</div>
+<div class="line"><a name="l02235"></a><span class="lineno"> 2235</span> </div>
+<div class="line"><a name="l02236"></a><span class="lineno"> 2236</span>                 trend = cpl_polynomial_fit_1d_create(listx, listy, 3, &err);</div>
+<div class="line"><a name="l02237"></a><span class="lineno"> 2237</span> </div>
+<div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>                 cpl_bivector_delete(list);</div>
+<div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>  </div>
+<div class="line"><a name="l02240"></a><span class="lineno"> 2240</span>                 <span class="keywordflow">for</span> (k = 0; k < npix; k++) {</div>
+<div class="line"><a name="l02241"></a><span class="lineno"> 2241</span>                     kdata[j + (ibot + k)*nx] = cpl_polynomial_eval_1d(trend, </div>
+<div class="line"><a name="l02242"></a><span class="lineno"> 2242</span>                                                k, NULL);</div>
+<div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>                 }</div>
+<div class="line"><a name="l02244"></a><span class="lineno"> 2244</span> </div>
+<div class="line"><a name="l02245"></a><span class="lineno"> 2245</span>                 cpl_polynomial_delete(trend);</div>
+<div class="line"><a name="l02246"></a><span class="lineno"> 2246</span>             }</div>
+<div class="line"><a name="l02247"></a><span class="lineno"> 2247</span>         }</div>
+<div class="line"><a name="l02248"></a><span class="lineno"> 2248</span>         cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l02249"></a><span class="lineno"> 2249</span>         cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l02250"></a><span class="lineno"> 2250</span>     }</div>
+<div class="line"><a name="l02251"></a><span class="lineno"> 2251</span> </div>
+<div class="line"><a name="l02252"></a><span class="lineno"> 2252</span>     cpl_image_subtract(science, sky);</div>
+<div class="line"><a name="l02253"></a><span class="lineno"> 2253</span> </div>
+<div class="line"><a name="l02254"></a><span class="lineno"> 2254</span>     <span class="keywordflow">return</span> sky;</div>
+<div class="line"><a name="l02255"></a><span class="lineno"> 2255</span> }</div>
+<div class="line"><a name="l02256"></a><span class="lineno"> 2256</span> </div>
+<div class="line"><a name="l02257"></a><span class="lineno"> 2257</span> </div>
+<div class="line"><a name="l02290"></a><span class="lineno"><a class="code" href="group__moses.html#ga6b94ed200f4b1b8e281417a80b9aa4b5"> 2290</a></span> cpl_image *<a class="code" href="group__moses.html#ga6b94ed200f4b1b8e281417a80b9aa4b5" title="Normalise a flat field exposure.">mos_normalise_flat</a>(cpl_image *flat, cpl_image *spatial, </div>
+<div class="line"><a name="l02291"></a><span class="lineno"> 2291</span>                               cpl_table *slits, cpl_table *polytraces, </div>
+<div class="line"><a name="l02292"></a><span class="lineno"> 2292</span>                               <span class="keywordtype">double</span> reference, <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, </div>
+<div class="line"><a name="l02293"></a><span class="lineno"> 2293</span>                               <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> sradius, <span class="keywordtype">int</span> polyorder)</div>
+<div class="line"><a name="l02294"></a><span class="lineno"> 2294</span> {</div>
+<div class="line"><a name="l02295"></a><span class="lineno"> 2295</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>     *func = <span class="stringliteral">"mos_normalise_flat"</span>;</div>
+<div class="line"><a name="l02296"></a><span class="lineno"> 2296</span> </div>
+<div class="line"><a name="l02297"></a><span class="lineno"> 2297</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l02298"></a><span class="lineno"> 2298</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l02299"></a><span class="lineno"> 2299</span> </div>
+<div class="line"><a name="l02300"></a><span class="lineno"> 2300</span>     cpl_image      *rectified;</div>
+<div class="line"><a name="l02301"></a><span class="lineno"> 2301</span>     cpl_image      *smo_flat;</div>
+<div class="line"><a name="l02302"></a><span class="lineno"> 2302</span>     cpl_image      *exslit;</div>
+<div class="line"><a name="l02303"></a><span class="lineno"> 2303</span>     cpl_vector     *positions;</div>
+<div class="line"><a name="l02304"></a><span class="lineno"> 2304</span>     cpl_vector     *flux;</div>
+<div class="line"><a name="l02305"></a><span class="lineno"> 2305</span>     cpl_vector     *smo_flux;</div>
+<div class="line"><a name="l02306"></a><span class="lineno"> 2306</span>     cpl_polynomial *trend;</div>
+<div class="line"><a name="l02307"></a><span class="lineno"> 2307</span>     cpl_polynomial *polytop;</div>
+<div class="line"><a name="l02308"></a><span class="lineno"> 2308</span>     cpl_polynomial *polybot;</div>
+<div class="line"><a name="l02309"></a><span class="lineno"> 2309</span> </div>
+<div class="line"><a name="l02310"></a><span class="lineno"> 2310</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l02311"></a><span class="lineno"> 2311</span>     <span class="keywordtype">float</span>          *p;</div>
+<div class="line"><a name="l02312"></a><span class="lineno"> 2312</span>     <span class="keywordtype">float</span>          *data;</div>
+<div class="line"><a name="l02313"></a><span class="lineno"> 2313</span>     <span class="keywordtype">double</span>         *fdata;</div>
+<div class="line"><a name="l02314"></a><span class="lineno"> 2314</span>     <span class="keywordtype">double</span>         *pdata;</div>
+<div class="line"><a name="l02315"></a><span class="lineno"> 2315</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l02316"></a><span class="lineno"> 2316</span>     <span class="keywordtype">float</span>          *xdata;</div>
+<div class="line"><a name="l02317"></a><span class="lineno"> 2317</span>     <span class="keywordtype">float</span>          *wdata;</div>
+<div class="line"><a name="l02318"></a><span class="lineno"> 2318</span>     <span class="keywordtype">double</span>          vtop, vbot, value;</div>
+<div class="line"><a name="l02319"></a><span class="lineno"> 2319</span>     <span class="keywordtype">double</span>          top, bot;</div>
+<div class="line"><a name="l02320"></a><span class="lineno"> 2320</span>     <span class="keywordtype">double</span>          coeff;</div>
+<div class="line"><a name="l02321"></a><span class="lineno"> 2321</span>     <span class="keywordtype">double</span>          ytop, ybot;</div>
+<div class="line"><a name="l02322"></a><span class="lineno"> 2322</span>     <span class="keywordtype">double</span>          ypos;</div>
+<div class="line"><a name="l02323"></a><span class="lineno"> 2323</span>     <span class="keywordtype">double</span>          fvalue;</div>
+<div class="line"><a name="l02324"></a><span class="lineno"> 2324</span>     <span class="keywordtype">int</span>             ivalue;</div>
+<div class="line"><a name="l02325"></a><span class="lineno"> 2325</span>     <span class="keywordtype">int</span>             yint, yprev;</div>
+<div class="line"><a name="l02326"></a><span class="lineno"> 2326</span>     <span class="keywordtype">int</span>             npseudo;</div>
+<div class="line"><a name="l02327"></a><span class="lineno"> 2327</span> </div>
+<div class="line"><a name="l02328"></a><span class="lineno"> 2328</span>     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;</div>
+<div class="line"><a name="l02329"></a><span class="lineno"> 2329</span>     <span class="keywordtype">int</span>             nx, ny, nsubx, nsuby;</div>
+<div class="line"><a name="l02330"></a><span class="lineno"> 2330</span>     <span class="keywordtype">int</span>             xlow, ylow, xhig, yhig;</div>
+<div class="line"><a name="l02331"></a><span class="lineno"> 2331</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l02332"></a><span class="lineno"> 2332</span>     <span class="keywordtype">int</span>            *position;</div>
+<div class="line"><a name="l02333"></a><span class="lineno"> 2333</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l02334"></a><span class="lineno"> 2334</span>     <span class="keywordtype">int</span>             missing_top, missing_bot;</div>
+<div class="line"><a name="l02335"></a><span class="lineno"> 2335</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l02336"></a><span class="lineno"> 2336</span>     <span class="keywordtype">int</span>             npoints;</div>
+<div class="line"><a name="l02337"></a><span class="lineno"> 2337</span>     <span class="keywordtype">int</span>             uradius;</div>
+<div class="line"><a name="l02338"></a><span class="lineno"> 2338</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l02339"></a><span class="lineno"> 2339</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l02340"></a><span class="lineno"> 2340</span>     cpl_size        k;</div>
+<div class="line"><a name="l02341"></a><span class="lineno"> 2341</span> </div>
+<div class="line"><a name="l02342"></a><span class="lineno"> 2342</span> <span class="comment">/*    int             exclude = 5;     Number of excluded pixels at edges */</span></div>
+<div class="line"><a name="l02343"></a><span class="lineno"> 2343</span> </div>
+<div class="line"><a name="l02344"></a><span class="lineno"> 2344</span>     <span class="comment">/* For debug puposes only: cpl_image      *smo_rectified; */</span></div>
+<div class="line"><a name="l02345"></a><span class="lineno"> 2345</span> </div>
+<div class="line"><a name="l02346"></a><span class="lineno"> 2346</span> </div>
+<div class="line"><a name="l02347"></a><span class="lineno"> 2347</span>     <span class="keywordflow">if</span> (flat == NULL || slits == NULL || polytraces == NULL) {</div>
+<div class="line"><a name="l02348"></a><span class="lineno"> 2348</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l02349"></a><span class="lineno"> 2349</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02350"></a><span class="lineno"> 2350</span>     }</div>
+<div class="line"><a name="l02351"></a><span class="lineno"> 2351</span>  </div>
+<div class="line"><a name="l02352"></a><span class="lineno"> 2352</span>     <span class="keywordflow">if</span> (dispersion <= 0.0) {</div>
+<div class="line"><a name="l02353"></a><span class="lineno"> 2353</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l02354"></a><span class="lineno"> 2354</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02355"></a><span class="lineno"> 2355</span>     }</div>
+<div class="line"><a name="l02356"></a><span class="lineno"> 2356</span> </div>
+<div class="line"><a name="l02357"></a><span class="lineno"> 2357</span>     <span class="keywordflow">if</span> (red - blue < dispersion) {</div>
+<div class="line"><a name="l02358"></a><span class="lineno"> 2358</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l02359"></a><span class="lineno"> 2359</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02360"></a><span class="lineno"> 2360</span>     }</div>
+<div class="line"><a name="l02361"></a><span class="lineno"> 2361</span> </div>
+<div class="line"><a name="l02362"></a><span class="lineno"> 2362</span>     rectified = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(flat, slits, polytraces, reference,</div>
+<div class="line"><a name="l02363"></a><span class="lineno"> 2363</span>                                         blue, red, dispersion, 0, NULL);</div>
+<div class="line"><a name="l02364"></a><span class="lineno"> 2364</span> </div>
+<div class="line"><a name="l02365"></a><span class="lineno"> 2365</span>     nx = cpl_image_get_size_x(rectified);</div>
+<div class="line"><a name="l02366"></a><span class="lineno"> 2366</span>     ny = cpl_image_get_size_y(rectified);</div>
+<div class="line"><a name="l02367"></a><span class="lineno"> 2367</span> </div>
+<div class="line"><a name="l02368"></a><span class="lineno"> 2368</span>     smo_flat = cpl_image_new(cpl_image_get_size_x(spatial), </div>
+<div class="line"><a name="l02369"></a><span class="lineno"> 2369</span>                              cpl_image_get_size_y(spatial), CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l02370"></a><span class="lineno"> 2370</span>     wdata = cpl_image_get_data(smo_flat);</div>
+<div class="line"><a name="l02371"></a><span class="lineno"> 2371</span> </div>
+<div class="line"><a name="l02372"></a><span class="lineno"> 2372</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l02373"></a><span class="lineno"> 2373</span>     order    = cpl_table_get_ncol(polytraces) - 2;</div>
+<div class="line"><a name="l02374"></a><span class="lineno"> 2374</span>     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);</div>
+<div class="line"><a name="l02375"></a><span class="lineno"> 2375</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l02376"></a><span class="lineno"> 2376</span>     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l02377"></a><span class="lineno"> 2377</span> </div>
+<div class="line"><a name="l02378"></a><span class="lineno"> 2378</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l02379"></a><span class="lineno"> 2379</span> <span class="comment">     * The spatial resampling is performed for a certain number of</span></div>
+<div class="line"><a name="l02380"></a><span class="lineno"> 2380</span> <span class="comment">     * pixels above and below the position of the reference wavelength:</span></div>
+<div class="line"><a name="l02381"></a><span class="lineno"> 2381</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l02382"></a><span class="lineno"> 2382</span>     </div>
+<div class="line"><a name="l02383"></a><span class="lineno"> 2383</span>     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;</div>
+<div class="line"><a name="l02384"></a><span class="lineno"> 2384</span>     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;</div>
+<div class="line"><a name="l02385"></a><span class="lineno"> 2385</span> </div>
+<div class="line"><a name="l02386"></a><span class="lineno"> 2386</span>     xlow = 1;</div>
+<div class="line"><a name="l02387"></a><span class="lineno"> 2387</span>     xhig = nx;</div>
+<div class="line"><a name="l02388"></a><span class="lineno"> 2388</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l02389"></a><span class="lineno"> 2389</span> </div>
+<div class="line"><a name="l02390"></a><span class="lineno"> 2390</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l02391"></a><span class="lineno"> 2391</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l02392"></a><span class="lineno"> 2392</span> </div>
+<div class="line"><a name="l02393"></a><span class="lineno"> 2393</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02394"></a><span class="lineno"> 2394</span> <span class="comment">         * We DON'T write:</span></div>
+<div class="line"><a name="l02395"></a><span class="lineno"> 2395</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l02396"></a><span class="lineno"> 2396</span> <span class="comment">         * ylow = position[i];</span></div>
+<div class="line"><a name="l02397"></a><span class="lineno"> 2397</span> <span class="comment">         * yhig = ylow + length[i];</span></div>
+<div class="line"><a name="l02398"></a><span class="lineno"> 2398</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l02399"></a><span class="lineno"> 2399</span> <span class="comment">         * because the cpl_image pixels are counted from 1, and because in </span></div>
+<div class="line"><a name="l02400"></a><span class="lineno"> 2400</span> <span class="comment">         * cpl_image_extract() the coordinates of the last pixel are inclusive.</span></div>
+<div class="line"><a name="l02401"></a><span class="lineno"> 2401</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02402"></a><span class="lineno"> 2402</span> </div>
+<div class="line"><a name="l02403"></a><span class="lineno"> 2403</span>         ylow = position[i] + 1;</div>
+<div class="line"><a name="l02404"></a><span class="lineno"> 2404</span>         yhig = ylow + length[i] - 1;</div>
+<div class="line"><a name="l02405"></a><span class="lineno"> 2405</span> </div>
+<div class="line"><a name="l02406"></a><span class="lineno"> 2406</span>         exslit = cpl_image_extract(rectified, xlow, ylow, xhig, yhig);</div>
+<div class="line"><a name="l02407"></a><span class="lineno"> 2407</span> </div>
+<div class="line"><a name="l02408"></a><span class="lineno"> 2408</span>         <span class="keywordflow">if</span> (polyorder < 0) {</div>
+<div class="line"><a name="l02409"></a><span class="lineno"> 2409</span> </div>
+<div class="line"><a name="l02410"></a><span class="lineno"> 2410</span>             cpl_image_turn(exslit, -1);   <span class="comment">/* For faster memory access */</span></div>
+<div class="line"><a name="l02411"></a><span class="lineno"> 2411</span>     </div>
+<div class="line"><a name="l02412"></a><span class="lineno"> 2412</span>             nsubx = cpl_image_get_size_x(exslit);</div>
+<div class="line"><a name="l02413"></a><span class="lineno"> 2413</span>             nsuby = cpl_image_get_size_y(exslit);</div>
+<div class="line"><a name="l02414"></a><span class="lineno"> 2414</span>             data = cpl_image_get_data(exslit);</div>
+<div class="line"><a name="l02415"></a><span class="lineno"> 2415</span>             flux = cpl_vector_new(nsubx);</div>
+<div class="line"><a name="l02416"></a><span class="lineno"> 2416</span> </div>
+<div class="line"><a name="l02417"></a><span class="lineno"> 2417</span>             uradius = nsubx / 2;</div>
+<div class="line"><a name="l02418"></a><span class="lineno"> 2418</span>             <span class="keywordflow">if</span> (uradius > sradius)</div>
+<div class="line"><a name="l02419"></a><span class="lineno"> 2419</span>                 uradius = sradius;</div>
+<div class="line"><a name="l02420"></a><span class="lineno"> 2420</span> </div>
+<div class="line"><a name="l02421"></a><span class="lineno"> 2421</span>             <span class="keywordflow">for</span> (j = 0; j < nsuby; j++) {</div>
+<div class="line"><a name="l02422"></a><span class="lineno"> 2422</span>                 fdata = cpl_vector_get_data(flux);</div>
+<div class="line"><a name="l02423"></a><span class="lineno"> 2423</span>                 p = data;</div>
+<div class="line"><a name="l02424"></a><span class="lineno"> 2424</span>                 <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)</div>
+<div class="line"><a name="l02425"></a><span class="lineno"> 2425</span>                     *fdata++ = *p++;</div>
+<div class="line"><a name="l02426"></a><span class="lineno"> 2426</span>                 smo_flux = cpl_vector_filter_median_create(flux, uradius);</div>
+<div class="line"><a name="l02427"></a><span class="lineno"> 2427</span>                 fdata = cpl_vector_get_data(smo_flux);</div>
+<div class="line"><a name="l02428"></a><span class="lineno"> 2428</span>                 p = data;</div>
+<div class="line"><a name="l02429"></a><span class="lineno"> 2429</span>                 <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)</div>
+<div class="line"><a name="l02430"></a><span class="lineno"> 2430</span>                     *p++ = *fdata++;</div>
+<div class="line"><a name="l02431"></a><span class="lineno"> 2431</span>                 cpl_vector_delete(smo_flux);</div>
+<div class="line"><a name="l02432"></a><span class="lineno"> 2432</span>                 data += nsubx;</div>
+<div class="line"><a name="l02433"></a><span class="lineno"> 2433</span>             }</div>
+<div class="line"><a name="l02434"></a><span class="lineno"> 2434</span> </div>
+<div class="line"><a name="l02435"></a><span class="lineno"> 2435</span>             cpl_vector_delete(flux);</div>
+<div class="line"><a name="l02436"></a><span class="lineno"> 2436</span> </div>
+<div class="line"><a name="l02437"></a><span class="lineno"> 2437</span> </div>
+<div class="line"><a name="l02438"></a><span class="lineno"> 2438</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l02439"></a><span class="lineno"> 2439</span> <span class="comment">             * First fit fluxes along the spatial direction with a low-degree</span></div>
+<div class="line"><a name="l02440"></a><span class="lineno"> 2440</span> <span class="comment">             * polynomial (excluding the first and the last pixels, close to</span></div>
+<div class="line"><a name="l02441"></a><span class="lineno"> 2441</span> <span class="comment">             * the edges)</span></div>
+<div class="line"><a name="l02442"></a><span class="lineno"> 2442</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l02443"></a><span class="lineno"> 2443</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l02444"></a><span class="lineno"> 2444</span> <span class="comment">            if (nsubx-2*exclude > 10) {</span></div>
+<div class="line"><a name="l02445"></a><span class="lineno"> 2445</span> <span class="comment">                flux = cpl_vector_new(nsubx-2*exclude);</span></div>
+<div class="line"><a name="l02446"></a><span class="lineno"> 2446</span> <span class="comment">                fdata = cpl_vector_get_data(flux);</span></div>
+<div class="line"><a name="l02447"></a><span class="lineno"> 2447</span> <span class="comment">                positions = cpl_vector_new(nsubx-2*exclude);</span></div>
+<div class="line"><a name="l02448"></a><span class="lineno"> 2448</span> <span class="comment">                for (j = 0; j < nsubx-2*exclude; j++)</span></div>
+<div class="line"><a name="l02449"></a><span class="lineno"> 2449</span> <span class="comment">                    cpl_vector_set(positions, j, j+exclude);</span></div>
+<div class="line"><a name="l02450"></a><span class="lineno"> 2450</span> <span class="comment">        </span></div>
+<div class="line"><a name="l02451"></a><span class="lineno"> 2451</span> <span class="comment">                for (k = 0; k < nsuby; k++) {</span></div>
+<div class="line"><a name="l02452"></a><span class="lineno"> 2452</span> <span class="comment">                    for (j = 0; j < nsubx-2*exclude; j++)</span></div>
+<div class="line"><a name="l02453"></a><span class="lineno"> 2453</span> <span class="comment">                        fdata[j] = data[j+exclude];</span></div>
+<div class="line"><a name="l02454"></a><span class="lineno"> 2454</span> <span class="comment">                    trend = cpl_polynomial_fit_1d_create(positions, flux, </span></div>
+<div class="line"><a name="l02455"></a><span class="lineno"> 2455</span> <span class="comment">                                                         1, NULL);</span></div>
+<div class="line"><a name="l02456"></a><span class="lineno"> 2456</span> <span class="comment">                    for (j = 0; j < nsubx; j++)</span></div>
+<div class="line"><a name="l02457"></a><span class="lineno"> 2457</span> <span class="comment">                        data[j] = cpl_polynomial_eval_1d(trend, j, NULL);</span></div>
+<div class="line"><a name="l02458"></a><span class="lineno"> 2458</span> <span class="comment">                    cpl_polynomial_delete(trend);</span></div>
+<div class="line"><a name="l02459"></a><span class="lineno"> 2459</span> <span class="comment">                    data += nsubx;</span></div>
+<div class="line"><a name="l02460"></a><span class="lineno"> 2460</span> <span class="comment">                }</span></div>
+<div class="line"><a name="l02461"></a><span class="lineno"> 2461</span> <span class="comment"></span></div>
+<div class="line"><a name="l02462"></a><span class="lineno"> 2462</span> <span class="comment">                cpl_vector_delete(flux);</span></div>
+<div class="line"><a name="l02463"></a><span class="lineno"> 2463</span> <span class="comment">                cpl_vector_delete(positions);</span></div>
+<div class="line"><a name="l02464"></a><span class="lineno"> 2464</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l02465"></a><span class="lineno"> 2465</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l02466"></a><span class="lineno"> 2466</span> </div>
+<div class="line"><a name="l02467"></a><span class="lineno"> 2467</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l02468"></a><span class="lineno"> 2468</span> <span class="comment">             * Now smooth along the dispersion direction </span></div>
+<div class="line"><a name="l02469"></a><span class="lineno"> 2469</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l02470"></a><span class="lineno"> 2470</span> </div>
+<div class="line"><a name="l02471"></a><span class="lineno"> 2471</span>             cpl_image_turn(exslit, 1);   <span class="comment">/* For faster memory access */</span></div>
+<div class="line"><a name="l02472"></a><span class="lineno"> 2472</span>             nsubx = cpl_image_get_size_x(exslit);</div>
+<div class="line"><a name="l02473"></a><span class="lineno"> 2473</span>             nsuby = cpl_image_get_size_y(exslit);</div>
+<div class="line"><a name="l02474"></a><span class="lineno"> 2474</span>             data = cpl_image_get_data(exslit);</div>
+<div class="line"><a name="l02475"></a><span class="lineno"> 2475</span> </div>
+<div class="line"><a name="l02476"></a><span class="lineno"> 2476</span>             <span class="keywordflow">for</span> (j = 0; j < nsuby; j++) {</div>
+<div class="line"><a name="l02477"></a><span class="lineno"> 2477</span>                 flux = cpl_vector_new(nsubx);</div>
+<div class="line"><a name="l02478"></a><span class="lineno"> 2478</span>                 fdata = cpl_vector_get_data(flux);</div>
+<div class="line"><a name="l02479"></a><span class="lineno"> 2479</span>                 p = data;</div>
+<div class="line"><a name="l02480"></a><span class="lineno"> 2480</span>                 <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)</div>
+<div class="line"><a name="l02481"></a><span class="lineno"> 2481</span>                     *fdata++ = *p++;</div>
+<div class="line"><a name="l02482"></a><span class="lineno"> 2482</span>                 smo_flux = cpl_vector_filter_median_create(flux, sradius);</div>
+<div class="line"><a name="l02483"></a><span class="lineno"> 2483</span>                 cpl_vector_delete(flux);</div>
+<div class="line"><a name="l02484"></a><span class="lineno"> 2484</span>                 fdata = cpl_vector_get_data(smo_flux);</div>
+<div class="line"><a name="l02485"></a><span class="lineno"> 2485</span>                 p = data;</div>
+<div class="line"><a name="l02486"></a><span class="lineno"> 2486</span>                 <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)</div>
+<div class="line"><a name="l02487"></a><span class="lineno"> 2487</span>                     *p++ = *fdata++;</div>
+<div class="line"><a name="l02488"></a><span class="lineno"> 2488</span>                 cpl_vector_delete(smo_flux);</div>
+<div class="line"><a name="l02489"></a><span class="lineno"> 2489</span>                 data += nsubx;</div>
+<div class="line"><a name="l02490"></a><span class="lineno"> 2490</span>             }</div>
+<div class="line"><a name="l02491"></a><span class="lineno"> 2491</span>         }</div>
+<div class="line"><a name="l02492"></a><span class="lineno"> 2492</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02493"></a><span class="lineno"> 2493</span> </div>
+<div class="line"><a name="l02494"></a><span class="lineno"> 2494</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l02495"></a><span class="lineno"> 2495</span> <span class="comment">             * Fit with a polynomial the flat field trend row by row.</span></div>
+<div class="line"><a name="l02496"></a><span class="lineno"> 2496</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l02497"></a><span class="lineno"> 2497</span> </div>
+<div class="line"><a name="l02498"></a><span class="lineno"> 2498</span>             nsubx = cpl_image_get_size_x(exslit);</div>
+<div class="line"><a name="l02499"></a><span class="lineno"> 2499</span>             nsuby = cpl_image_get_size_y(exslit);</div>
+<div class="line"><a name="l02500"></a><span class="lineno"> 2500</span>             data = cpl_image_get_data(exslit);</div>
+<div class="line"><a name="l02501"></a><span class="lineno"> 2501</span> </div>
+<div class="line"><a name="l02502"></a><span class="lineno"> 2502</span>             <span class="keywordflow">for</span> (j = 0; j < nsuby; j++) {</div>
+<div class="line"><a name="l02503"></a><span class="lineno"> 2503</span> </div>
+<div class="line"><a name="l02504"></a><span class="lineno"> 2504</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l02505"></a><span class="lineno"> 2505</span> <span class="comment">                 * First get the size of the vectors to allocate:</span></div>
+<div class="line"><a name="l02506"></a><span class="lineno"> 2506</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l02507"></a><span class="lineno"> 2507</span> </div>
+<div class="line"><a name="l02508"></a><span class="lineno"> 2508</span>                 npoints = 0;</div>
+<div class="line"><a name="l02509"></a><span class="lineno"> 2509</span>                 p = data + j*nsubx;</div>
+<div class="line"><a name="l02510"></a><span class="lineno"> 2510</span>                 <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)</div>
+<div class="line"><a name="l02511"></a><span class="lineno"> 2511</span>                     <span class="keywordflow">if</span> (p[k] > 1.0)</div>
+<div class="line"><a name="l02512"></a><span class="lineno"> 2512</span>                         npoints++;</div>
+<div class="line"><a name="l02513"></a><span class="lineno"> 2513</span> </div>
+<div class="line"><a name="l02514"></a><span class="lineno"> 2514</span>                 <span class="keywordflow">if</span> (npoints > polyorder + 1) {</div>
+<div class="line"><a name="l02515"></a><span class="lineno"> 2515</span> </div>
+<div class="line"><a name="l02516"></a><span class="lineno"> 2516</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l02517"></a><span class="lineno"> 2517</span> <span class="comment">                     * Fill the vectors for the fitting</span></div>
+<div class="line"><a name="l02518"></a><span class="lineno"> 2518</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l02519"></a><span class="lineno"> 2519</span> </div>
+<div class="line"><a name="l02520"></a><span class="lineno"> 2520</span>                     flux = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l02521"></a><span class="lineno"> 2521</span>                     fdata = cpl_vector_get_data(flux);</div>
+<div class="line"><a name="l02522"></a><span class="lineno"> 2522</span>                     positions = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l02523"></a><span class="lineno"> 2523</span>                     pdata = cpl_vector_get_data(positions);</div>
+<div class="line"><a name="l02524"></a><span class="lineno"> 2524</span> </div>
+<div class="line"><a name="l02525"></a><span class="lineno"> 2525</span>                     npoints = 0;</div>
+<div class="line"><a name="l02526"></a><span class="lineno"> 2526</span>                     p = data + j*nsubx;</div>
+<div class="line"><a name="l02527"></a><span class="lineno"> 2527</span>                     <span class="keywordflow">for</span> (k = 0; k < nsubx; k++) {</div>
+<div class="line"><a name="l02528"></a><span class="lineno"> 2528</span>                         <span class="keywordflow">if</span> (p[k] > 1.0) {</div>
+<div class="line"><a name="l02529"></a><span class="lineno"> 2529</span>                             fdata[npoints] = p[k];</div>
+<div class="line"><a name="l02530"></a><span class="lineno"> 2530</span>                             pdata[npoints] = k;</div>
+<div class="line"><a name="l02531"></a><span class="lineno"> 2531</span>                             npoints++;</div>
+<div class="line"><a name="l02532"></a><span class="lineno"> 2532</span>                         }</div>
+<div class="line"><a name="l02533"></a><span class="lineno"> 2533</span>                     }</div>
+<div class="line"><a name="l02534"></a><span class="lineno"> 2534</span>     </div>
+<div class="line"><a name="l02535"></a><span class="lineno"> 2535</span>                     trend = cpl_polynomial_fit_1d_create(positions, flux, </div>
+<div class="line"><a name="l02536"></a><span class="lineno"> 2536</span>                                                          polyorder, NULL);</div>
+<div class="line"><a name="l02537"></a><span class="lineno"> 2537</span> </div>
+<div class="line"><a name="l02538"></a><span class="lineno"> 2538</span>                     cpl_vector_delete(flux);</div>
+<div class="line"><a name="l02539"></a><span class="lineno"> 2539</span>                     cpl_vector_delete(positions);</div>
+<div class="line"><a name="l02540"></a><span class="lineno"> 2540</span> </div>
+<div class="line"><a name="l02541"></a><span class="lineno"> 2541</span>                     <span class="keywordflow">if</span> (trend) {</div>
+<div class="line"><a name="l02542"></a><span class="lineno"> 2542</span>                         p = data + j*nsubx;</div>
+<div class="line"><a name="l02543"></a><span class="lineno"> 2543</span>                         <span class="keywordflow">for</span> (k = 0; k < nsubx; k++)</div>
+<div class="line"><a name="l02544"></a><span class="lineno"> 2544</span>                             <span class="keywordflow">if</span> (p[k] > 1.0)</div>
+<div class="line"><a name="l02545"></a><span class="lineno"> 2545</span>                                 p[k] = cpl_polynomial_eval_1d(trend, k, NULL);</div>
+<div class="line"><a name="l02546"></a><span class="lineno"> 2546</span>                         cpl_polynomial_delete(trend);</div>
+<div class="line"><a name="l02547"></a><span class="lineno"> 2547</span>                     }</div>
+<div class="line"><a name="l02548"></a><span class="lineno"> 2548</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02549"></a><span class="lineno"> 2549</span>                         cpl_msg_warning(func, <span class="stringliteral">"Invalid flat field flux fit "</span></div>
+<div class="line"><a name="l02550"></a><span class="lineno"> 2550</span>                                         <span class="stringliteral">"(ignored)"</span>);</div>
+<div class="line"><a name="l02551"></a><span class="lineno"> 2551</span>                     }</div>
+<div class="line"><a name="l02552"></a><span class="lineno"> 2552</span>                 }</div>
+<div class="line"><a name="l02553"></a><span class="lineno"> 2553</span>             }</div>
+<div class="line"><a name="l02554"></a><span class="lineno"> 2554</span>         }</div>
+<div class="line"><a name="l02555"></a><span class="lineno"> 2555</span> </div>
+<div class="line"><a name="l02556"></a><span class="lineno"> 2556</span>         </div>
+<div class="line"><a name="l02557"></a><span class="lineno"> 2557</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02558"></a><span class="lineno"> 2558</span> <span class="comment">         * Recover from the table of spectral curvature coefficients</span></div>
+<div class="line"><a name="l02559"></a><span class="lineno"> 2559</span> <span class="comment">         * the curvature polynomials.</span></div>
+<div class="line"><a name="l02560"></a><span class="lineno"> 2560</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02561"></a><span class="lineno"> 2561</span> </div>
+<div class="line"><a name="l02562"></a><span class="lineno"> 2562</span>         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);</div>
+<div class="line"><a name="l02563"></a><span class="lineno"> 2563</span> </div>
+<div class="line"><a name="l02564"></a><span class="lineno"> 2564</span>         start_pixel = refpixel - pixel_below;</div>
+<div class="line"><a name="l02565"></a><span class="lineno"> 2565</span>         <span class="keywordflow">if</span> (start_pixel < 0)</div>
+<div class="line"><a name="l02566"></a><span class="lineno"> 2566</span>             start_pixel = 0;</div>
+<div class="line"><a name="l02567"></a><span class="lineno"> 2567</span> </div>
+<div class="line"><a name="l02568"></a><span class="lineno"> 2568</span>         end_pixel = refpixel + pixel_above;</div>
+<div class="line"><a name="l02569"></a><span class="lineno"> 2569</span>         <span class="keywordflow">if</span> (end_pixel > nx)</div>
+<div class="line"><a name="l02570"></a><span class="lineno"> 2570</span>             end_pixel = nx;</div>
+<div class="line"><a name="l02571"></a><span class="lineno"> 2571</span> </div>
+<div class="line"><a name="l02572"></a><span class="lineno"> 2572</span>         missing_top = 0;</div>
+<div class="line"><a name="l02573"></a><span class="lineno"> 2573</span>         polytop = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l02574"></a><span class="lineno"> 2574</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l02575"></a><span class="lineno"> 2575</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);</div>
+<div class="line"><a name="l02576"></a><span class="lineno"> 2576</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l02577"></a><span class="lineno"> 2577</span>                 cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l02578"></a><span class="lineno"> 2578</span>                 missing_top = 1;</div>
+<div class="line"><a name="l02579"></a><span class="lineno"> 2579</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02580"></a><span class="lineno"> 2580</span>             }</div>
+<div class="line"><a name="l02581"></a><span class="lineno"> 2581</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l02582"></a><span class="lineno"> 2582</span>         }</div>
+<div class="line"><a name="l02583"></a><span class="lineno"> 2583</span> </div>
+<div class="line"><a name="l02584"></a><span class="lineno"> 2584</span>         missing_bot = 0;</div>
+<div class="line"><a name="l02585"></a><span class="lineno"> 2585</span>         polybot = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l02586"></a><span class="lineno"> 2586</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l02587"></a><span class="lineno"> 2587</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);</div>
+<div class="line"><a name="l02588"></a><span class="lineno"> 2588</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l02589"></a><span class="lineno"> 2589</span>                 cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l02590"></a><span class="lineno"> 2590</span>                 missing_bot = 1;</div>
+<div class="line"><a name="l02591"></a><span class="lineno"> 2591</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02592"></a><span class="lineno"> 2592</span>             }</div>
+<div class="line"><a name="l02593"></a><span class="lineno"> 2593</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l02594"></a><span class="lineno"> 2594</span>         }</div>
+<div class="line"><a name="l02595"></a><span class="lineno"> 2595</span> </div>
+<div class="line"><a name="l02596"></a><span class="lineno"> 2596</span>         <span class="keywordflow">if</span> (missing_top && missing_bot) {</div>
+<div class="line"><a name="l02597"></a><span class="lineno"> 2597</span>             cpl_msg_debug(func, <span class="stringliteral">"Slit %d was not traced: no extraction!"</span>,</div>
+<div class="line"><a name="l02598"></a><span class="lineno"> 2598</span>                           slit_id[i]);</div>
+<div class="line"><a name="l02599"></a><span class="lineno"> 2599</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l02600"></a><span class="lineno"> 2600</span>         }</div>
+<div class="line"><a name="l02601"></a><span class="lineno"> 2601</span> </div>
+<div class="line"><a name="l02602"></a><span class="lineno"> 2602</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02603"></a><span class="lineno"> 2603</span> <span class="comment">         * In case just one of the two edges was not traced, the other</span></div>
+<div class="line"><a name="l02604"></a><span class="lineno"> 2604</span> <span class="comment">         * edge curvature model is duplicated and shifted to the other</span></div>
+<div class="line"><a name="l02605"></a><span class="lineno"> 2605</span> <span class="comment">         * end of the slit: better than nothing!</span></div>
+<div class="line"><a name="l02606"></a><span class="lineno"> 2606</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02607"></a><span class="lineno"> 2607</span> </div>
+<div class="line"><a name="l02608"></a><span class="lineno"> 2608</span>         <span class="keywordflow">if</span> (missing_top) {</div>
+<div class="line"><a name="l02609"></a><span class="lineno"> 2609</span>             cpl_msg_debug(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l02610"></a><span class="lineno"> 2610</span>                           <span class="stringliteral">"the spectral curvature of the lower edge "</span></div>
+<div class="line"><a name="l02611"></a><span class="lineno"> 2611</span>                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l02612"></a><span class="lineno"> 2612</span>             polytop = cpl_polynomial_duplicate(polybot);</div>
+<div class="line"><a name="l02613"></a><span class="lineno"> 2613</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l02614"></a><span class="lineno"> 2614</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l02615"></a><span class="lineno"> 2615</span>             k = 0;</div>
+<div class="line"><a name="l02616"></a><span class="lineno"> 2616</span>             coeff = cpl_polynomial_get_coeff(polybot, &k);</div>
+<div class="line"><a name="l02617"></a><span class="lineno"> 2617</span>             coeff += ytop - ybot;</div>
+<div class="line"><a name="l02618"></a><span class="lineno"> 2618</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l02619"></a><span class="lineno"> 2619</span>         }</div>
+<div class="line"><a name="l02620"></a><span class="lineno"> 2620</span> </div>
+<div class="line"><a name="l02621"></a><span class="lineno"> 2621</span>         <span class="keywordflow">if</span> (missing_bot) {</div>
+<div class="line"><a name="l02622"></a><span class="lineno"> 2622</span>             cpl_msg_debug(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l02623"></a><span class="lineno"> 2623</span>                           <span class="stringliteral">"the spectral curvature of the upper edge "</span></div>
+<div class="line"><a name="l02624"></a><span class="lineno"> 2624</span>                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l02625"></a><span class="lineno"> 2625</span>             polybot = cpl_polynomial_duplicate(polytop);</div>
+<div class="line"><a name="l02626"></a><span class="lineno"> 2626</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l02627"></a><span class="lineno"> 2627</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l02628"></a><span class="lineno"> 2628</span>             k = 0;</div>
+<div class="line"><a name="l02629"></a><span class="lineno"> 2629</span>             coeff = cpl_polynomial_get_coeff(polytop, &k);</div>
+<div class="line"><a name="l02630"></a><span class="lineno"> 2630</span>             coeff -= ytop - ybot;</div>
+<div class="line"><a name="l02631"></a><span class="lineno"> 2631</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l02632"></a><span class="lineno"> 2632</span>         }</div>
+<div class="line"><a name="l02633"></a><span class="lineno"> 2633</span> </div>
+<div class="line"><a name="l02634"></a><span class="lineno"> 2634</span> </div>
+<div class="line"><a name="l02635"></a><span class="lineno"> 2635</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02636"></a><span class="lineno"> 2636</span> <span class="comment">         * Now map smoothed image to CCD.</span></div>
+<div class="line"><a name="l02637"></a><span class="lineno"> 2637</span> <span class="comment">         * Note that the npseudo value related to this slit is equal</span></div>
+<div class="line"><a name="l02638"></a><span class="lineno"> 2638</span> <span class="comment">         * to the number of spatial pseudo-pixels decreased by 1</span></div>
+<div class="line"><a name="l02639"></a><span class="lineno"> 2639</span> <span class="comment">         * (compare with function mos_spatial_calibration()).</span></div>
+<div class="line"><a name="l02640"></a><span class="lineno"> 2640</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02641"></a><span class="lineno"> 2641</span> </div>
+<div class="line"><a name="l02642"></a><span class="lineno"> 2642</span>         nx = cpl_image_get_size_x(flat);</div>
+<div class="line"><a name="l02643"></a><span class="lineno"> 2643</span>         ny = cpl_image_get_size_y(flat);</div>
+<div class="line"><a name="l02644"></a><span class="lineno"> 2644</span> </div>
+<div class="line"><a name="l02645"></a><span class="lineno"> 2645</span>         sdata = cpl_image_get_data(spatial);</div>
+<div class="line"><a name="l02646"></a><span class="lineno"> 2646</span>         xdata = cpl_image_get_data(exslit);</div>
+<div class="line"><a name="l02647"></a><span class="lineno"> 2647</span>         npseudo = cpl_image_get_size_y(exslit) - 1;</div>
+<div class="line"><a name="l02648"></a><span class="lineno"> 2648</span> </div>
+<div class="line"><a name="l02649"></a><span class="lineno"> 2649</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02650"></a><span class="lineno"> 2650</span> <span class="comment">         * Write interpolated smoothed values to CCD image</span></div>
+<div class="line"><a name="l02651"></a><span class="lineno"> 2651</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02652"></a><span class="lineno"> 2652</span> </div>
+<div class="line"><a name="l02653"></a><span class="lineno"> 2653</span>         <span class="keywordflow">for</span> (j = start_pixel; j < end_pixel; j++) {</div>
+<div class="line"><a name="l02654"></a><span class="lineno"> 2654</span>             top = cpl_polynomial_eval_1d(polytop, j, NULL);</div>
+<div class="line"><a name="l02655"></a><span class="lineno"> 2655</span>             bot = cpl_polynomial_eval_1d(polybot, j, NULL);</div>
+<div class="line"><a name="l02656"></a><span class="lineno"> 2656</span>             <span class="keywordflow">for</span> (k = 0; k <= npseudo; k++) {</div>
+<div class="line"><a name="l02657"></a><span class="lineno"> 2657</span>                 ypos = top - k*(top-bot)/npseudo;</div>
+<div class="line"><a name="l02658"></a><span class="lineno"> 2658</span>                 yint = ypos;</div>
+<div class="line"><a name="l02659"></a><span class="lineno"> 2659</span> </div>
+<div class="line"><a name="l02660"></a><span class="lineno"> 2660</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l02661"></a><span class="lineno"> 2661</span> <span class="comment">                 * The line:</span></div>
+<div class="line"><a name="l02662"></a><span class="lineno"> 2662</span> <span class="comment">                 *     value = sdata[j + nx*yint];</span></div>
+<div class="line"><a name="l02663"></a><span class="lineno"> 2663</span> <span class="comment">                 * should be equivalent to:</span></div>
+<div class="line"><a name="l02664"></a><span class="lineno"> 2664</span> <span class="comment">                 *     value = npseudo*(top-yint)/(top-bot);</span></div>
+<div class="line"><a name="l02665"></a><span class="lineno"> 2665</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l02666"></a><span class="lineno"> 2666</span> </div>
+<div class="line"><a name="l02667"></a><span class="lineno"> 2667</span>                 <span class="keywordflow">if</span> (yint < 0 || yint >= ny-1) {</div>
+<div class="line"><a name="l02668"></a><span class="lineno"> 2668</span>                     yprev = yint;</div>
+<div class="line"><a name="l02669"></a><span class="lineno"> 2669</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l02670"></a><span class="lineno"> 2670</span>                 }</div>
+<div class="line"><a name="l02671"></a><span class="lineno"> 2671</span> </div>
+<div class="line"><a name="l02672"></a><span class="lineno"> 2672</span>                 value = sdata[j + nx*yint];   <span class="comment">/* Spatial coordinate on CCD */</span></div>
+<div class="line"><a name="l02673"></a><span class="lineno"> 2673</span>                 ivalue = value;               <span class="comment">/* Nearest spatial pixels:   */</span></div>
+<div class="line"><a name="l02674"></a><span class="lineno"> 2674</span>                 fvalue = value - ivalue;      <span class="comment">/* ivalue and ivalue+1       */</span></div>
+<div class="line"><a name="l02675"></a><span class="lineno"> 2675</span>                 <span class="keywordflow">if</span> (ivalue < npseudo && ivalue >= 0) {</div>
+<div class="line"><a name="l02676"></a><span class="lineno"> 2676</span>                     vtop = xdata[j + nx*(npseudo-ivalue)];</div>
+<div class="line"><a name="l02677"></a><span class="lineno"> 2677</span>                     vbot = xdata[j + nx*(npseudo-ivalue-1)];</div>
+<div class="line"><a name="l02678"></a><span class="lineno"> 2678</span>                     wdata[j + nx*yint] = vtop*(1-fvalue) + vbot*fvalue;</div>
+<div class="line"><a name="l02679"></a><span class="lineno"> 2679</span> </div>
+<div class="line"><a name="l02680"></a><span class="lineno"> 2680</span>                     <span class="keywordflow">if</span> (k) {</div>
+<div class="line"><a name="l02681"></a><span class="lineno"> 2681</span> </div>
+<div class="line"><a name="l02682"></a><span class="lineno"> 2682</span>                         <span class="comment">/*</span></div>
+<div class="line"><a name="l02683"></a><span class="lineno"> 2683</span> <span class="comment">                         * This is added to recover lost pixels on</span></div>
+<div class="line"><a name="l02684"></a><span class="lineno"> 2684</span> <span class="comment">                         * the CCD image (pixels are lost because</span></div>
+<div class="line"><a name="l02685"></a><span class="lineno"> 2685</span> <span class="comment">                         * the CCD pixels are less than npseudo+1).</span></div>
+<div class="line"><a name="l02686"></a><span class="lineno"> 2686</span> <span class="comment">                         */</span></div>
+<div class="line"><a name="l02687"></a><span class="lineno"> 2687</span> </div>
+<div class="line"><a name="l02688"></a><span class="lineno"> 2688</span>                         <span class="keywordflow">if</span> (yprev - yint > 1) {</div>
+<div class="line"><a name="l02689"></a><span class="lineno"> 2689</span>                             value = sdata[j + nx*(yint+1)];</div>
+<div class="line"><a name="l02690"></a><span class="lineno"> 2690</span>                             ivalue = value;</div>
+<div class="line"><a name="l02691"></a><span class="lineno"> 2691</span>                             fvalue = value - ivalue;</div>
+<div class="line"><a name="l02692"></a><span class="lineno"> 2692</span>                             <span class="keywordflow">if</span> (ivalue < npseudo && ivalue >= 0) {</div>
+<div class="line"><a name="l02693"></a><span class="lineno"> 2693</span>                                 vtop = xdata[j + nx*(npseudo-ivalue)];</div>
+<div class="line"><a name="l02694"></a><span class="lineno"> 2694</span>                                 vbot = xdata[j + nx*(npseudo-ivalue-1)];</div>
+<div class="line"><a name="l02695"></a><span class="lineno"> 2695</span>                                 wdata[j + nx*(yint+1)] = vtop*(1-fvalue) </div>
+<div class="line"><a name="l02696"></a><span class="lineno"> 2696</span>                                                        + vbot*fvalue;</div>
+<div class="line"><a name="l02697"></a><span class="lineno"> 2697</span>                             }</div>
+<div class="line"><a name="l02698"></a><span class="lineno"> 2698</span>                         }</div>
+<div class="line"><a name="l02699"></a><span class="lineno"> 2699</span>                     }</div>
+<div class="line"><a name="l02700"></a><span class="lineno"> 2700</span>                 }</div>
+<div class="line"><a name="l02701"></a><span class="lineno"> 2701</span>                 yprev = yint;</div>
+<div class="line"><a name="l02702"></a><span class="lineno"> 2702</span>             }</div>
+<div class="line"><a name="l02703"></a><span class="lineno"> 2703</span>         }</div>
+<div class="line"><a name="l02704"></a><span class="lineno"> 2704</span>         cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l02705"></a><span class="lineno"> 2705</span>         cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l02706"></a><span class="lineno"> 2706</span>         cpl_image_delete(exslit);</div>
+<div class="line"><a name="l02707"></a><span class="lineno"> 2707</span>     }</div>
+<div class="line"><a name="l02708"></a><span class="lineno"> 2708</span> </div>
+<div class="line"><a name="l02709"></a><span class="lineno"> 2709</span>     cpl_image_delete(rectified);</div>
+<div class="line"><a name="l02710"></a><span class="lineno"> 2710</span> </div>
+<div class="line"><a name="l02711"></a><span class="lineno"> 2711</span>     cpl_image_divide(flat, smo_flat);</div>
+<div class="line"><a name="l02712"></a><span class="lineno"> 2712</span> </div>
+<div class="line"><a name="l02713"></a><span class="lineno"> 2713</span>     <span class="keywordflow">return</span> smo_flat;</div>
+<div class="line"><a name="l02714"></a><span class="lineno"> 2714</span> }</div>
+<div class="line"><a name="l02715"></a><span class="lineno"> 2715</span> </div>
+<div class="line"><a name="l02716"></a><span class="lineno"> 2716</span> </div>
+<div class="line"><a name="l02741"></a><span class="lineno"><a class="code" href="group__moses.html#ga2efbe02c8b5535d746bc9dd9ece30296"> 2741</a></span> cpl_image *<a class="code" href="group__moses.html#ga2efbe02c8b5535d746bc9dd9ece30296" title="Normalise a long slit flat field exposure.">mos_normalise_longflat</a>(cpl_image *flat, <span class="keywordtype">int</span> sradius, <span class="keywordtype">int</span> dradius, </div>
+<div class="line"><a name="l02742"></a><span class="lineno"> 2742</span>                                   <span class="keywordtype">int</span> polyorder)</div>
+<div class="line"><a name="l02743"></a><span class="lineno"> 2743</span> {</div>
+<div class="line"><a name="l02744"></a><span class="lineno"> 2744</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>     *func = <span class="stringliteral">"mos_normalise_longflat"</span>;</div>
+<div class="line"><a name="l02745"></a><span class="lineno"> 2745</span> </div>
+<div class="line"><a name="l02746"></a><span class="lineno"> 2746</span>     cpl_image      *smo_flat;</div>
+<div class="line"><a name="l02747"></a><span class="lineno"> 2747</span>     cpl_image      *profile;</div>
+<div class="line"><a name="l02748"></a><span class="lineno"> 2748</span>     cpl_vector     *flux;</div>
+<div class="line"><a name="l02749"></a><span class="lineno"> 2749</span>     cpl_vector     *smo_flux;</div>
+<div class="line"><a name="l02750"></a><span class="lineno"> 2750</span>     cpl_vector     *positions;</div>
+<div class="line"><a name="l02751"></a><span class="lineno"> 2751</span>     cpl_polynomial *trend;</div>
+<div class="line"><a name="l02752"></a><span class="lineno"> 2752</span> </div>
+<div class="line"><a name="l02753"></a><span class="lineno"> 2753</span>     <span class="keywordtype">float</span>          *level;</div>
+<div class="line"><a name="l02754"></a><span class="lineno"> 2754</span>     <span class="keywordtype">float</span>          *p;</div>
+<div class="line"><a name="l02755"></a><span class="lineno"> 2755</span>     <span class="keywordtype">float</span>          *data;</div>
+<div class="line"><a name="l02756"></a><span class="lineno"> 2756</span>     <span class="keywordtype">double</span>         *fdata;</div>
+<div class="line"><a name="l02757"></a><span class="lineno"> 2757</span>     <span class="keywordtype">double</span>         *pdata;</div>
+<div class="line"><a name="l02758"></a><span class="lineno"> 2758</span> </div>
+<div class="line"><a name="l02759"></a><span class="lineno"> 2759</span>     <span class="keywordtype">int</span>             nx, ny;</div>
+<div class="line"><a name="l02760"></a><span class="lineno"> 2760</span>     <span class="keywordtype">int</span>             npoints;</div>
+<div class="line"><a name="l02761"></a><span class="lineno"> 2761</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l02762"></a><span class="lineno"> 2762</span> </div>
+<div class="line"><a name="l02763"></a><span class="lineno"> 2763</span> </div>
+<div class="line"><a name="l02764"></a><span class="lineno"> 2764</span>     <span class="keywordflow">if</span> (flat == NULL) {</div>
+<div class="line"><a name="l02765"></a><span class="lineno"> 2765</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l02766"></a><span class="lineno"> 2766</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02767"></a><span class="lineno"> 2767</span>     }</div>
+<div class="line"><a name="l02768"></a><span class="lineno"> 2768</span>  </div>
+<div class="line"><a name="l02769"></a><span class="lineno"> 2769</span>     <span class="keywordflow">if</span> (sradius < 1 || dradius < 1) {</div>
+<div class="line"><a name="l02770"></a><span class="lineno"> 2770</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l02771"></a><span class="lineno"> 2771</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l02772"></a><span class="lineno"> 2772</span>     }</div>
+<div class="line"><a name="l02773"></a><span class="lineno"> 2773</span> </div>
+<div class="line"><a name="l02774"></a><span class="lineno"> 2774</span>     smo_flat = cpl_image_duplicate(flat);</div>
+<div class="line"><a name="l02775"></a><span class="lineno"> 2775</span> </div>
+<div class="line"><a name="l02776"></a><span class="lineno"> 2776</span>     <span class="keywordflow">if</span> (polyorder < 0) {</div>
+<div class="line"><a name="l02777"></a><span class="lineno"> 2777</span> </div>
+<div class="line"><a name="l02778"></a><span class="lineno"> 2778</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02779"></a><span class="lineno"> 2779</span> <span class="comment">         * First smooth along the spatial direction</span></div>
+<div class="line"><a name="l02780"></a><span class="lineno"> 2780</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02781"></a><span class="lineno"> 2781</span> </div>
+<div class="line"><a name="l02782"></a><span class="lineno"> 2782</span>         cpl_image_turn(smo_flat, -1);   <span class="comment">/* For faster memory access */</span></div>
+<div class="line"><a name="l02783"></a><span class="lineno"> 2783</span> </div>
+<div class="line"><a name="l02784"></a><span class="lineno"> 2784</span>         nx = cpl_image_get_size_x(smo_flat);</div>
+<div class="line"><a name="l02785"></a><span class="lineno"> 2785</span>         ny = cpl_image_get_size_y(smo_flat);</div>
+<div class="line"><a name="l02786"></a><span class="lineno"> 2786</span>         data = cpl_image_get_data(smo_flat);</div>
+<div class="line"><a name="l02787"></a><span class="lineno"> 2787</span>     </div>
+<div class="line"><a name="l02788"></a><span class="lineno"> 2788</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l02789"></a><span class="lineno"> 2789</span>             flux = cpl_vector_new(nx);</div>
+<div class="line"><a name="l02790"></a><span class="lineno"> 2790</span>             fdata = cpl_vector_get_data(flux);</div>
+<div class="line"><a name="l02791"></a><span class="lineno"> 2791</span>             p = data;</div>
+<div class="line"><a name="l02792"></a><span class="lineno"> 2792</span>             <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l02793"></a><span class="lineno"> 2793</span>                 *fdata++ = *p++;</div>
+<div class="line"><a name="l02794"></a><span class="lineno"> 2794</span>             smo_flux = cpl_vector_filter_median_create(flux, sradius);</div>
+<div class="line"><a name="l02795"></a><span class="lineno"> 2795</span>             cpl_vector_delete(flux);</div>
+<div class="line"><a name="l02796"></a><span class="lineno"> 2796</span>             fdata = cpl_vector_get_data(smo_flux);</div>
+<div class="line"><a name="l02797"></a><span class="lineno"> 2797</span>             p = data;</div>
+<div class="line"><a name="l02798"></a><span class="lineno"> 2798</span>             <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l02799"></a><span class="lineno"> 2799</span>                 *p++ = *fdata++;</div>
+<div class="line"><a name="l02800"></a><span class="lineno"> 2800</span>             cpl_vector_delete(smo_flux);</div>
+<div class="line"><a name="l02801"></a><span class="lineno"> 2801</span>             data += nx;</div>
+<div class="line"><a name="l02802"></a><span class="lineno"> 2802</span>         }</div>
+<div class="line"><a name="l02803"></a><span class="lineno"> 2803</span> </div>
+<div class="line"><a name="l02804"></a><span class="lineno"> 2804</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02805"></a><span class="lineno"> 2805</span> <span class="comment">         * Second smooth along the dispersion direction</span></div>
+<div class="line"><a name="l02806"></a><span class="lineno"> 2806</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02807"></a><span class="lineno"> 2807</span> </div>
+<div class="line"><a name="l02808"></a><span class="lineno"> 2808</span>         cpl_image_turn(smo_flat, 1);   <span class="comment">/* For faster memory access */</span></div>
+<div class="line"><a name="l02809"></a><span class="lineno"> 2809</span> </div>
+<div class="line"><a name="l02810"></a><span class="lineno"> 2810</span>         nx = cpl_image_get_size_x(smo_flat);</div>
+<div class="line"><a name="l02811"></a><span class="lineno"> 2811</span>         ny = cpl_image_get_size_y(smo_flat);</div>
+<div class="line"><a name="l02812"></a><span class="lineno"> 2812</span>         data = cpl_image_get_data(smo_flat);</div>
+<div class="line"><a name="l02813"></a><span class="lineno"> 2813</span> </div>
+<div class="line"><a name="l02814"></a><span class="lineno"> 2814</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l02815"></a><span class="lineno"> 2815</span>             flux = cpl_vector_new(nx);</div>
+<div class="line"><a name="l02816"></a><span class="lineno"> 2816</span>             fdata = cpl_vector_get_data(flux);</div>
+<div class="line"><a name="l02817"></a><span class="lineno"> 2817</span>             p = data;</div>
+<div class="line"><a name="l02818"></a><span class="lineno"> 2818</span>             <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l02819"></a><span class="lineno"> 2819</span>                 *fdata++ = *p++;</div>
+<div class="line"><a name="l02820"></a><span class="lineno"> 2820</span>             smo_flux = cpl_vector_filter_median_create(flux, sradius);</div>
+<div class="line"><a name="l02821"></a><span class="lineno"> 2821</span>             cpl_vector_delete(flux);</div>
+<div class="line"><a name="l02822"></a><span class="lineno"> 2822</span>             fdata = cpl_vector_get_data(smo_flux);</div>
+<div class="line"><a name="l02823"></a><span class="lineno"> 2823</span>             p = data;</div>
+<div class="line"><a name="l02824"></a><span class="lineno"> 2824</span>             <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l02825"></a><span class="lineno"> 2825</span>                 *p++ = *fdata++;</div>
+<div class="line"><a name="l02826"></a><span class="lineno"> 2826</span>             cpl_vector_delete(smo_flux);</div>
+<div class="line"><a name="l02827"></a><span class="lineno"> 2827</span>             data += nx;</div>
+<div class="line"><a name="l02828"></a><span class="lineno"> 2828</span>         }</div>
+<div class="line"><a name="l02829"></a><span class="lineno"> 2829</span>     }</div>
+<div class="line"><a name="l02830"></a><span class="lineno"> 2830</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02831"></a><span class="lineno"> 2831</span> </div>
+<div class="line"><a name="l02832"></a><span class="lineno"> 2832</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02833"></a><span class="lineno"> 2833</span> <span class="comment">         * Fit with a polynomial the flat field trend column by column.</span></div>
+<div class="line"><a name="l02834"></a><span class="lineno"> 2834</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02835"></a><span class="lineno"> 2835</span> </div>
+<div class="line"><a name="l02836"></a><span class="lineno"> 2836</span>         cpl_image_turn(smo_flat, -1);   <span class="comment">/* For faster memory access */</span></div>
+<div class="line"><a name="l02837"></a><span class="lineno"> 2837</span> </div>
+<div class="line"><a name="l02838"></a><span class="lineno"> 2838</span>         nx = cpl_image_get_size_x(smo_flat);</div>
+<div class="line"><a name="l02839"></a><span class="lineno"> 2839</span>         ny = cpl_image_get_size_y(smo_flat);</div>
+<div class="line"><a name="l02840"></a><span class="lineno"> 2840</span>         data = cpl_image_get_data(smo_flat);</div>
+<div class="line"><a name="l02841"></a><span class="lineno"> 2841</span> </div>
+<div class="line"><a name="l02842"></a><span class="lineno"> 2842</span>         profile = cpl_image_collapse_median_create(smo_flat, 1, 0, 0);</div>
+<div class="line"><a name="l02843"></a><span class="lineno"> 2843</span>         level = cpl_image_get_data(profile);</div>
+<div class="line"><a name="l02844"></a><span class="lineno"> 2844</span> </div>
+<div class="line"><a name="l02845"></a><span class="lineno"> 2845</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l02846"></a><span class="lineno"> 2846</span> </div>
+<div class="line"><a name="l02847"></a><span class="lineno"> 2847</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l02848"></a><span class="lineno"> 2848</span> <span class="comment">             * First get the size of the vectors to allocate:</span></div>
+<div class="line"><a name="l02849"></a><span class="lineno"> 2849</span> <span class="comment">             * eliminate from fit any value more than 20% away</span></div>
+<div class="line"><a name="l02850"></a><span class="lineno"> 2850</span> <span class="comment">             * from median level in current column.</span></div>
+<div class="line"><a name="l02851"></a><span class="lineno"> 2851</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l02852"></a><span class="lineno"> 2852</span> </div>
+<div class="line"><a name="l02853"></a><span class="lineno"> 2853</span>             npoints = 0;</div>
+<div class="line"><a name="l02854"></a><span class="lineno"> 2854</span>             p = data + i*nx;</div>
+<div class="line"><a name="l02855"></a><span class="lineno"> 2855</span>             <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l02856"></a><span class="lineno"> 2856</span>                 <span class="keywordflow">if</span> (fabs(p[j]/level[i] - 1) < 0.20)</div>
+<div class="line"><a name="l02857"></a><span class="lineno"> 2857</span>                     npoints++;</div>
+<div class="line"><a name="l02858"></a><span class="lineno"> 2858</span> </div>
+<div class="line"><a name="l02859"></a><span class="lineno"> 2859</span>             <span class="keywordflow">if</span> (npoints > polyorder + 1) {</div>
+<div class="line"><a name="l02860"></a><span class="lineno"> 2860</span> </div>
+<div class="line"><a name="l02861"></a><span class="lineno"> 2861</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l02862"></a><span class="lineno"> 2862</span> <span class="comment">                 * Fill the vectors for the fitting</span></div>
+<div class="line"><a name="l02863"></a><span class="lineno"> 2863</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l02864"></a><span class="lineno"> 2864</span> </div>
+<div class="line"><a name="l02865"></a><span class="lineno"> 2865</span>                 flux = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l02866"></a><span class="lineno"> 2866</span>                 fdata = cpl_vector_get_data(flux);</div>
+<div class="line"><a name="l02867"></a><span class="lineno"> 2867</span>                 positions = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l02868"></a><span class="lineno"> 2868</span>                 pdata = cpl_vector_get_data(positions);</div>
+<div class="line"><a name="l02869"></a><span class="lineno"> 2869</span> </div>
+<div class="line"><a name="l02870"></a><span class="lineno"> 2870</span>                 npoints = 0;</div>
+<div class="line"><a name="l02871"></a><span class="lineno"> 2871</span>                 p = data + i*nx;</div>
+<div class="line"><a name="l02872"></a><span class="lineno"> 2872</span>                 <span class="keywordflow">for</span> (j = 0; j < nx; j++) {</div>
+<div class="line"><a name="l02873"></a><span class="lineno"> 2873</span>                     <span class="keywordflow">if</span> (fabs(p[j]/level[i] - 1) < 0.20) {</div>
+<div class="line"><a name="l02874"></a><span class="lineno"> 2874</span>                         fdata[npoints] = p[j];</div>
+<div class="line"><a name="l02875"></a><span class="lineno"> 2875</span>                         pdata[npoints] = j;</div>
+<div class="line"><a name="l02876"></a><span class="lineno"> 2876</span>                         npoints++;</div>
+<div class="line"><a name="l02877"></a><span class="lineno"> 2877</span>                     }</div>
+<div class="line"><a name="l02878"></a><span class="lineno"> 2878</span>                 }</div>
+<div class="line"><a name="l02879"></a><span class="lineno"> 2879</span>     </div>
+<div class="line"><a name="l02880"></a><span class="lineno"> 2880</span>                 trend = cpl_polynomial_fit_1d_create(positions, flux, </div>
+<div class="line"><a name="l02881"></a><span class="lineno"> 2881</span>                                                      polyorder, NULL);</div>
+<div class="line"><a name="l02882"></a><span class="lineno"> 2882</span> </div>
+<div class="line"><a name="l02883"></a><span class="lineno"> 2883</span>                 cpl_vector_delete(flux);</div>
+<div class="line"><a name="l02884"></a><span class="lineno"> 2884</span>                 cpl_vector_delete(positions);</div>
+<div class="line"><a name="l02885"></a><span class="lineno"> 2885</span> </div>
+<div class="line"><a name="l02886"></a><span class="lineno"> 2886</span>                 <span class="keywordflow">if</span> (trend) {</div>
+<div class="line"><a name="l02887"></a><span class="lineno"> 2887</span>                     p = data + i*nx;</div>
+<div class="line"><a name="l02888"></a><span class="lineno"> 2888</span>                     <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l02889"></a><span class="lineno"> 2889</span>                         p[j] = cpl_polynomial_eval_1d(trend, j, NULL);</div>
+<div class="line"><a name="l02890"></a><span class="lineno"> 2890</span>                     cpl_polynomial_delete(trend);</div>
+<div class="line"><a name="l02891"></a><span class="lineno"> 2891</span>                 }</div>
+<div class="line"><a name="l02892"></a><span class="lineno"> 2892</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02893"></a><span class="lineno"> 2893</span>                     cpl_msg_warning(func, </div>
+<div class="line"><a name="l02894"></a><span class="lineno"> 2894</span>                                     <span class="stringliteral">"Invalid flat field flux fit (ignored)"</span>);</div>
+<div class="line"><a name="l02895"></a><span class="lineno"> 2895</span>                 }</div>
+<div class="line"><a name="l02896"></a><span class="lineno"> 2896</span>             }</div>
+<div class="line"><a name="l02897"></a><span class="lineno"> 2897</span>         }</div>
+<div class="line"><a name="l02898"></a><span class="lineno"> 2898</span> </div>
+<div class="line"><a name="l02899"></a><span class="lineno"> 2899</span>         cpl_image_delete(profile);</div>
+<div class="line"><a name="l02900"></a><span class="lineno"> 2900</span>         cpl_image_turn(smo_flat, 1);</div>
+<div class="line"><a name="l02901"></a><span class="lineno"> 2901</span> </div>
+<div class="line"><a name="l02902"></a><span class="lineno"> 2902</span>     }</div>
+<div class="line"><a name="l02903"></a><span class="lineno"> 2903</span> </div>
+<div class="line"><a name="l02904"></a><span class="lineno"> 2904</span>     cpl_image_divide(flat, smo_flat);</div>
+<div class="line"><a name="l02905"></a><span class="lineno"> 2905</span> </div>
+<div class="line"><a name="l02906"></a><span class="lineno"> 2906</span>     <span class="keywordflow">return</span> smo_flat;</div>
+<div class="line"><a name="l02907"></a><span class="lineno"> 2907</span> }</div>
+<div class="line"><a name="l02908"></a><span class="lineno"> 2908</span> </div>
+<div class="line"><a name="l02909"></a><span class="lineno"> 2909</span> </div>
+<div class="line"><a name="l02932"></a><span class="lineno"><a class="code" href="group__moses.html#gae5258889aa86b437e2531cdad02f4159"> 2932</a></span> cpl_error_code <a class="code" href="group__moses.html#gae5258889aa86b437e2531cdad02f4159" title="Interpolate MOS wavelength calibration.">mos_interpolate_wavecalib_slit</a>(cpl_table *idscoeff,</div>
+<div class="line"><a name="l02933"></a><span class="lineno"> 2933</span>                                               cpl_table *slits, </div>
+<div class="line"><a name="l02934"></a><span class="lineno"> 2934</span>                                               <span class="keywordtype">int</span> order, <span class="keywordtype">int</span> global)</div>
+<div class="line"><a name="l02935"></a><span class="lineno"> 2935</span> {</div>
+<div class="line"><a name="l02936"></a><span class="lineno"> 2936</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l02937"></a><span class="lineno"> 2937</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l02938"></a><span class="lineno"> 2938</span>     <span class="keywordtype">int</span> nrow = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l02939"></a><span class="lineno"> 2939</span>     <span class="keywordtype">int</span> i, j;</div>
+<div class="line"><a name="l02940"></a><span class="lineno"> 2940</span> </div>
+<div class="line"><a name="l02941"></a><span class="lineno"> 2941</span>     </div>
+<div class="line"><a name="l02942"></a><span class="lineno"> 2942</span>     <span class="keywordflow">if</span> (order < 0)</div>
+<div class="line"><a name="l02943"></a><span class="lineno"> 2943</span>         <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l02944"></a><span class="lineno"> 2944</span> </div>
+<div class="line"><a name="l02945"></a><span class="lineno"> 2945</span>     cpl_table_new_column(idscoeff, <span class="stringliteral">"x"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02946"></a><span class="lineno"> 2946</span>     cpl_table_new_column(idscoeff, <span class="stringliteral">"y"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l02947"></a><span class="lineno"> 2947</span> </div>
+<div class="line"><a name="l02948"></a><span class="lineno"> 2948</span>     <span class="keywordflow">for</span> (i = 0; i < nrow; i++) {</div>
+<div class="line"><a name="l02949"></a><span class="lineno"> 2949</span>         <span class="keywordtype">int</span>        position = cpl_table_get_int   (slits, <span class="stringliteral">"position"</span>, i, NULL);</div>
+<div class="line"><a name="l02950"></a><span class="lineno"> 2950</span>         <span class="keywordtype">int</span>        length   = cpl_table_get_int   (slits, <span class="stringliteral">"length"</span>,   i, NULL);</div>
+<div class="line"><a name="l02951"></a><span class="lineno"> 2951</span>         <span class="keywordtype">double</span>     xtop     = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>,     i, NULL);</div>
+<div class="line"><a name="l02952"></a><span class="lineno"> 2952</span>         <span class="keywordtype">double</span>     xbot     = cpl_table_get_double(slits, <span class="stringliteral">"xbottom"</span>,  i, NULL);</div>
+<div class="line"><a name="l02953"></a><span class="lineno"> 2953</span>         <span class="keywordtype">double</span>     ytop     = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>,     i, NULL);</div>
+<div class="line"><a name="l02954"></a><span class="lineno"> 2954</span>         <span class="keywordtype">double</span>     ybot     = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>,  i, NULL);</div>
+<div class="line"><a name="l02955"></a><span class="lineno"> 2955</span>         <span class="keywordtype">double</span>     dx       = xtop - xbot;</div>
+<div class="line"><a name="l02956"></a><span class="lineno"> 2956</span>         <span class="keywordtype">double</span>     dy       = ytop - ybot;</div>
+<div class="line"><a name="l02957"></a><span class="lineno"> 2957</span>         cpl_table *table    = cpl_table_extract(idscoeff, position, length);</div>
+<div class="line"><a name="l02958"></a><span class="lineno"> 2958</span> </div>
+<div class="line"><a name="l02959"></a><span class="lineno"> 2959</span>         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4" title="Interpolate LSS wavelength calibration.">mos_interpolate_wavecalib</a>(table, NULL, 2, order))</div>
+<div class="line"><a name="l02960"></a><span class="lineno"> 2960</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l02961"></a><span class="lineno"> 2961</span> </div>
+<div class="line"><a name="l02962"></a><span class="lineno"> 2962</span>         cpl_table_erase_window(idscoeff, position, length);</div>
+<div class="line"><a name="l02963"></a><span class="lineno"> 2963</span>         cpl_table_insert(idscoeff, table, position);</div>
+<div class="line"><a name="l02964"></a><span class="lineno"> 2964</span> </div>
+<div class="line"><a name="l02965"></a><span class="lineno"> 2965</span>         cpl_table_delete(table);</div>
+<div class="line"><a name="l02966"></a><span class="lineno"> 2966</span> </div>
+<div class="line"><a name="l02967"></a><span class="lineno"> 2967</span>         <span class="keywordflow">for</span> (j = 0; j < length; j++) {</div>
+<div class="line"><a name="l02968"></a><span class="lineno"> 2968</span>             cpl_table_set_double(idscoeff, <span class="stringliteral">"x"</span>, j + position,</div>
+<div class="line"><a name="l02969"></a><span class="lineno"> 2969</span>                                  xbot + j*(dx/length));</div>
+<div class="line"><a name="l02970"></a><span class="lineno"> 2970</span>             cpl_table_set_double(idscoeff, <span class="stringliteral">"y"</span>, j + position,</div>
+<div class="line"><a name="l02971"></a><span class="lineno"> 2971</span>                                  ybot + j*(dy/length));</div>
+<div class="line"><a name="l02972"></a><span class="lineno"> 2972</span>         }</div>
+<div class="line"><a name="l02973"></a><span class="lineno"> 2973</span>     }</div>
+<div class="line"><a name="l02974"></a><span class="lineno"> 2974</span> </div>
+<div class="line"><a name="l02975"></a><span class="lineno"> 2975</span>     <span class="keywordflow">if</span> (global) {</div>
+<div class="line"><a name="l02976"></a><span class="lineno"> 2976</span> </div>
+<div class="line"><a name="l02977"></a><span class="lineno"> 2977</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02978"></a><span class="lineno"> 2978</span> <span class="comment">         * Now fit a global solution</span></div>
+<div class="line"><a name="l02979"></a><span class="lineno"> 2979</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02980"></a><span class="lineno"> 2980</span> </div>
+<div class="line"><a name="l02981"></a><span class="lineno"> 2981</span>         nrow = cpl_table_get_nrow(idscoeff);</div>
+<div class="line"><a name="l02982"></a><span class="lineno"> 2982</span> </div>
+<div class="line"><a name="l02983"></a><span class="lineno"> 2983</span>         <span class="keywordflow">for</span> (i = 0; i < 6; i++) {</div>
+<div class="line"><a name="l02984"></a><span class="lineno"> 2984</span>             cpl_table      *dummy;</div>
+<div class="line"><a name="l02985"></a><span class="lineno"> 2985</span>             cpl_vector     *x;</div>
+<div class="line"><a name="l02986"></a><span class="lineno"> 2986</span>             cpl_vector     *y;</div>
+<div class="line"><a name="l02987"></a><span class="lineno"> 2987</span>             cpl_bivector   *z;</div>
+<div class="line"><a name="l02988"></a><span class="lineno"> 2988</span>             cpl_vector     *c;</div>
+<div class="line"><a name="l02989"></a><span class="lineno"> 2989</span>             cpl_polynomial *p;</div>
+<div class="line"><a name="l02990"></a><span class="lineno"> 2990</span>             cpl_vector     *point;</div>
+<div class="line"><a name="l02991"></a><span class="lineno"> 2991</span>             <span class="keywordtype">double</span>         *dpoint;</div>
+<div class="line"><a name="l02992"></a><span class="lineno"> 2992</span>             <span class="keywordtype">int</span>             npoints;</div>
+<div class="line"><a name="l02993"></a><span class="lineno"> 2993</span> </div>
+<div class="line"><a name="l02994"></a><span class="lineno"> 2994</span>             <span class="keywordflow">if</span> (!cpl_table_has_column(idscoeff, clab[i]))</div>
+<div class="line"><a name="l02995"></a><span class="lineno"> 2995</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l02996"></a><span class="lineno"> 2996</span> </div>
+<div class="line"><a name="l02997"></a><span class="lineno"> 2997</span>             npoints = nrow - cpl_table_count_invalid(idscoeff, clab[i]);</div>
+<div class="line"><a name="l02998"></a><span class="lineno"> 2998</span>             <span class="keywordflow">if</span> (npoints < 18)</div>
+<div class="line"><a name="l02999"></a><span class="lineno"> 2999</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l03000"></a><span class="lineno"> 3000</span> </div>
+<div class="line"><a name="l03001"></a><span class="lineno"> 3001</span>             dummy = cpl_table_new(nrow);</div>
+<div class="line"><a name="l03002"></a><span class="lineno"> 3002</span>             cpl_table_duplicate_column(dummy, <span class="stringliteral">"x"</span>, idscoeff, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l03003"></a><span class="lineno"> 3003</span>             cpl_table_duplicate_column(dummy, <span class="stringliteral">"y"</span>, idscoeff, <span class="stringliteral">"y"</span>);</div>
+<div class="line"><a name="l03004"></a><span class="lineno"> 3004</span>             cpl_table_duplicate_column(dummy, clab[i], idscoeff, clab[i]);</div>
+<div class="line"><a name="l03005"></a><span class="lineno"> 3005</span>             cpl_table_erase_invalid(dummy);</div>
+<div class="line"><a name="l03006"></a><span class="lineno"> 3006</span> </div>
+<div class="line"><a name="l03007"></a><span class="lineno"> 3007</span>             x = cpl_vector_wrap(npoints, cpl_table_get_data_double(dummy, <span class="stringliteral">"x"</span>));</div>
+<div class="line"><a name="l03008"></a><span class="lineno"> 3008</span>             y = cpl_vector_wrap(npoints, cpl_table_get_data_double(dummy, <span class="stringliteral">"y"</span>));</div>
+<div class="line"><a name="l03009"></a><span class="lineno"> 3009</span>             z = cpl_bivector_wrap_vectors(x, y);</div>
+<div class="line"><a name="l03010"></a><span class="lineno"> 3010</span>             c = cpl_vector_wrap(npoints, cpl_table_get_data_double(dummy, </div>
+<div class="line"><a name="l03011"></a><span class="lineno"> 3011</span>                                                                    clab[i]));</div>
+<div class="line"><a name="l03012"></a><span class="lineno"> 3012</span>             p = cpl_polynomial_fit_2d_create(z, c, 2, NULL);</div>
+<div class="line"><a name="l03013"></a><span class="lineno"> 3013</span>             cpl_bivector_unwrap_vectors(z);</div>
+<div class="line"><a name="l03014"></a><span class="lineno"> 3014</span>             cpl_vector_unwrap(x);</div>
+<div class="line"><a name="l03015"></a><span class="lineno"> 3015</span>             cpl_vector_unwrap(y);</div>
+<div class="line"><a name="l03016"></a><span class="lineno"> 3016</span>             cpl_vector_unwrap(c);</div>
+<div class="line"><a name="l03017"></a><span class="lineno"> 3017</span>             cpl_table_delete(dummy);</div>
+<div class="line"><a name="l03018"></a><span class="lineno"> 3018</span> </div>
+<div class="line"><a name="l03019"></a><span class="lineno"> 3019</span>             point  = cpl_vector_new(2);</div>
+<div class="line"><a name="l03020"></a><span class="lineno"> 3020</span>             dpoint = cpl_vector_get_data(point);</div>
+<div class="line"><a name="l03021"></a><span class="lineno"> 3021</span>             <span class="keywordflow">for</span> (j = 0; j < nrow; j++) {</div>
+<div class="line"><a name="l03022"></a><span class="lineno"> 3022</span>                 dpoint[0] = cpl_table_get_double(idscoeff, <span class="stringliteral">"x"</span>, j, NULL);</div>
+<div class="line"><a name="l03023"></a><span class="lineno"> 3023</span>                 dpoint[1] = cpl_table_get_double(idscoeff, <span class="stringliteral">"y"</span>, j, NULL);</div>
+<div class="line"><a name="l03024"></a><span class="lineno"> 3024</span>                 cpl_table_set_double(idscoeff, clab[i], j,</div>
+<div class="line"><a name="l03025"></a><span class="lineno"> 3025</span>                                      cpl_polynomial_eval(p, point));</div>
+<div class="line"><a name="l03026"></a><span class="lineno"> 3026</span>             }</div>
+<div class="line"><a name="l03027"></a><span class="lineno"> 3027</span>             cpl_vector_delete(point);</div>
+<div class="line"><a name="l03028"></a><span class="lineno"> 3028</span>             cpl_polynomial_delete(p);</div>
+<div class="line"><a name="l03029"></a><span class="lineno"> 3029</span>         }</div>
+<div class="line"><a name="l03030"></a><span class="lineno"> 3030</span>     }</div>
+<div class="line"><a name="l03031"></a><span class="lineno"> 3031</span> </div>
+<div class="line"><a name="l03032"></a><span class="lineno"> 3032</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l03033"></a><span class="lineno"> 3033</span> }</div>
+<div class="line"><a name="l03034"></a><span class="lineno"> 3034</span> </div>
+<div class="line"><a name="l03035"></a><span class="lineno"> 3035</span> </div>
+<div class="line"><a name="l03061"></a><span class="lineno"><a class="code" href="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4"> 3061</a></span> cpl_error_code <a class="code" href="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4" title="Interpolate LSS wavelength calibration.">mos_interpolate_wavecalib</a>(cpl_table *idscoeff, </div>
+<div class="line"><a name="l03062"></a><span class="lineno"> 3062</span>                                          cpl_image *wavemap, <span class="keywordtype">int</span> mode,</div>
+<div class="line"><a name="l03063"></a><span class="lineno"> 3063</span>                                          <span class="keywordtype">int</span> degree)</div>
+<div class="line"><a name="l03064"></a><span class="lineno"> 3064</span> {</div>
+<div class="line"><a name="l03065"></a><span class="lineno"> 3065</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_interpolate_wavecalib"</span>;</div>
+<div class="line"><a name="l03066"></a><span class="lineno"> 3066</span> </div>
+<div class="line"><a name="l03067"></a><span class="lineno"> 3067</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l03068"></a><span class="lineno"> 3068</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l03069"></a><span class="lineno"> 3069</span> </div>
+<div class="line"><a name="l03070"></a><span class="lineno"> 3070</span>     cpl_vector     *wave;</div>
+<div class="line"><a name="l03071"></a><span class="lineno"> 3071</span>     cpl_vector     *positions;</div>
+<div class="line"><a name="l03072"></a><span class="lineno"> 3072</span>     cpl_polynomial *trend;</div>
+<div class="line"><a name="l03073"></a><span class="lineno"> 3073</span> </div>
+<div class="line"><a name="l03074"></a><span class="lineno"> 3074</span>     <span class="keywordtype">float</span>          *p;</div>
+<div class="line"><a name="l03075"></a><span class="lineno"> 3075</span>     <span class="keywordtype">float</span>          *data;</div>
+<div class="line"><a name="l03076"></a><span class="lineno"> 3076</span>     <span class="keywordtype">double</span>         *wdata;</div>
+<div class="line"><a name="l03077"></a><span class="lineno"> 3077</span>     <span class="keywordtype">double</span>         *pdata;</div>
+<div class="line"><a name="l03078"></a><span class="lineno"> 3078</span> </div>
+<div class="line"><a name="l03079"></a><span class="lineno"> 3079</span>     <span class="keywordtype">double</span>          c;</div>
+<div class="line"><a name="l03080"></a><span class="lineno"> 3080</span>     <span class="keywordtype">double</span>          mse, ksigma;</div>
+<div class="line"><a name="l03081"></a><span class="lineno"> 3081</span> </div>
+<div class="line"><a name="l03082"></a><span class="lineno"> 3082</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l03083"></a><span class="lineno"> 3083</span>     <span class="keywordtype">int</span>             nrows, first_row, last_row;</div>
+<div class="line"><a name="l03084"></a><span class="lineno"> 3084</span>     <span class="keywordtype">int</span>             nx, ny;</div>
+<div class="line"><a name="l03085"></a><span class="lineno"> 3085</span>     <span class="keywordtype">int</span>             npoints, rpoints;</div>
+<div class="line"><a name="l03086"></a><span class="lineno"> 3086</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l03087"></a><span class="lineno"> 3087</span>     <span class="keywordtype">int</span>             i, j, k;</div>
+<div class="line"><a name="l03088"></a><span class="lineno"> 3088</span> </div>
+<div class="line"><a name="l03089"></a><span class="lineno"> 3089</span>     <span class="keywordtype">int</span>             polyorder = 4;  <span class="comment">/* Candidate input argument */</span></div>
+<div class="line"><a name="l03090"></a><span class="lineno"> 3090</span> </div>
+<div class="line"><a name="l03091"></a><span class="lineno"> 3091</span> </div>
+<div class="line"><a name="l03092"></a><span class="lineno"> 3092</span>     <span class="keywordflow">if</span> (idscoeff == NULL)</div>
+<div class="line"><a name="l03093"></a><span class="lineno"> 3093</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l03094"></a><span class="lineno"> 3094</span> </div>
+<div class="line"><a name="l03095"></a><span class="lineno"> 3095</span>     <span class="keywordflow">if</span> (mode < 0 || mode > 2)</div>
+<div class="line"><a name="l03096"></a><span class="lineno"> 3096</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l03097"></a><span class="lineno"> 3097</span> </div>
+<div class="line"><a name="l03098"></a><span class="lineno"> 3098</span>     <span class="keywordflow">if</span> (mode == 0 || degree < 0)</div>
+<div class="line"><a name="l03099"></a><span class="lineno"> 3099</span>         <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l03100"></a><span class="lineno"> 3100</span> </div>
+<div class="line"><a name="l03101"></a><span class="lineno"> 3101</span>     <span class="keywordflow">if</span> (wavemap) {</div>
+<div class="line"><a name="l03102"></a><span class="lineno"> 3102</span> </div>
+<div class="line"><a name="l03103"></a><span class="lineno"> 3103</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l03104"></a><span class="lineno"> 3104</span> <span class="comment">         * Fit with a polynomial the wavelength trend column by column.</span></div>
+<div class="line"><a name="l03105"></a><span class="lineno"> 3105</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l03106"></a><span class="lineno"> 3106</span> </div>
+<div class="line"><a name="l03107"></a><span class="lineno"> 3107</span>         cpl_image_turn(wavemap, -1);   <span class="comment">/* For faster memory access */</span></div>
+<div class="line"><a name="l03108"></a><span class="lineno"> 3108</span> </div>
+<div class="line"><a name="l03109"></a><span class="lineno"> 3109</span>         nx = cpl_image_get_size_x(wavemap);</div>
+<div class="line"><a name="l03110"></a><span class="lineno"> 3110</span>         ny = cpl_image_get_size_y(wavemap);</div>
+<div class="line"><a name="l03111"></a><span class="lineno"> 3111</span>         data = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l03112"></a><span class="lineno"> 3112</span> </div>
+<div class="line"><a name="l03113"></a><span class="lineno"> 3113</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l03114"></a><span class="lineno"> 3114</span> </div>
+<div class="line"><a name="l03115"></a><span class="lineno"> 3115</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l03116"></a><span class="lineno"> 3116</span> <span class="comment">             * First get the size of the vectors to allocate:</span></div>
+<div class="line"><a name="l03117"></a><span class="lineno"> 3117</span> <span class="comment">             * eliminate from fit any value with "impossible" wavelength.</span></div>
+<div class="line"><a name="l03118"></a><span class="lineno"> 3118</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l03119"></a><span class="lineno"> 3119</span> </div>
+<div class="line"><a name="l03120"></a><span class="lineno"> 3120</span>             npoints = 0;</div>
+<div class="line"><a name="l03121"></a><span class="lineno"> 3121</span>             p = data + i*nx;</div>
+<div class="line"><a name="l03122"></a><span class="lineno"> 3122</span>             <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l03123"></a><span class="lineno"> 3123</span>                 <span class="keywordflow">if</span> (p[j] > 1.0)</div>
+<div class="line"><a name="l03124"></a><span class="lineno"> 3124</span>                     npoints++;</div>
+<div class="line"><a name="l03125"></a><span class="lineno"> 3125</span> </div>
+<div class="line"><a name="l03126"></a><span class="lineno"> 3126</span>             <span class="keywordflow">if</span> (npoints > polyorder + 1) {</div>
+<div class="line"><a name="l03127"></a><span class="lineno"> 3127</span> </div>
+<div class="line"><a name="l03128"></a><span class="lineno"> 3128</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l03129"></a><span class="lineno"> 3129</span> <span class="comment">                 * Fill the vectors for the fitting</span></div>
+<div class="line"><a name="l03130"></a><span class="lineno"> 3130</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l03131"></a><span class="lineno"> 3131</span> </div>
+<div class="line"><a name="l03132"></a><span class="lineno"> 3132</span>                 wave = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l03133"></a><span class="lineno"> 3133</span>                 wdata = cpl_vector_get_data(wave);</div>
+<div class="line"><a name="l03134"></a><span class="lineno"> 3134</span>                 positions = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l03135"></a><span class="lineno"> 3135</span>                 pdata = cpl_vector_get_data(positions);</div>
+<div class="line"><a name="l03136"></a><span class="lineno"> 3136</span> </div>
+<div class="line"><a name="l03137"></a><span class="lineno"> 3137</span>                 npoints = 0;</div>
+<div class="line"><a name="l03138"></a><span class="lineno"> 3138</span>                 p = data + i*nx;</div>
+<div class="line"><a name="l03139"></a><span class="lineno"> 3139</span>                 <span class="keywordflow">for</span> (j = 0; j < nx; j++) {</div>
+<div class="line"><a name="l03140"></a><span class="lineno"> 3140</span>                     <span class="keywordflow">if</span> (p[j] > 1.0) {</div>
+<div class="line"><a name="l03141"></a><span class="lineno"> 3141</span>                         wdata[npoints] = p[j];</div>
+<div class="line"><a name="l03142"></a><span class="lineno"> 3142</span>                         pdata[npoints] = j;</div>
+<div class="line"><a name="l03143"></a><span class="lineno"> 3143</span>                         npoints++;</div>
+<div class="line"><a name="l03144"></a><span class="lineno"> 3144</span>                     }</div>
+<div class="line"><a name="l03145"></a><span class="lineno"> 3145</span>                 }</div>
+<div class="line"><a name="l03146"></a><span class="lineno"> 3146</span>     </div>
+<div class="line"><a name="l03147"></a><span class="lineno"> 3147</span>                 trend = cpl_polynomial_fit_1d_create(positions, wave, </div>
+<div class="line"><a name="l03148"></a><span class="lineno"> 3148</span>                                                      polyorder, &mse);</div>
+<div class="line"><a name="l03149"></a><span class="lineno"> 3149</span> </div>
+<div class="line"><a name="l03150"></a><span class="lineno"> 3150</span>                 ksigma = 3*sqrt(mse);</div>
+<div class="line"><a name="l03151"></a><span class="lineno"> 3151</span> </div>
+<div class="line"><a name="l03152"></a><span class="lineno"> 3152</span>                 cpl_vector_delete(wave);</div>
+<div class="line"><a name="l03153"></a><span class="lineno"> 3153</span>                 cpl_vector_delete(positions);</div>
+<div class="line"><a name="l03154"></a><span class="lineno"> 3154</span> </div>
+<div class="line"><a name="l03155"></a><span class="lineno"> 3155</span>                 <span class="keywordflow">if</span> (trend) {</div>
+<div class="line"><a name="l03156"></a><span class="lineno"> 3156</span> </div>
+<div class="line"><a name="l03157"></a><span class="lineno"> 3157</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l03158"></a><span class="lineno"> 3158</span> <span class="comment">                     * Apply 3-sigma rejection</span></div>
+<div class="line"><a name="l03159"></a><span class="lineno"> 3159</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l03160"></a><span class="lineno"> 3160</span> </div>
+<div class="line"><a name="l03161"></a><span class="lineno"> 3161</span>                     rpoints = 0;</div>
+<div class="line"><a name="l03162"></a><span class="lineno"> 3162</span>                     p = data + i*nx;</div>
+<div class="line"><a name="l03163"></a><span class="lineno"> 3163</span>                     <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l03164"></a><span class="lineno"> 3164</span>                         <span class="keywordflow">if</span> (p[j] > 1.0)</div>
+<div class="line"><a name="l03165"></a><span class="lineno"> 3165</span>                             <span class="keywordflow">if</span> (fabs(cpl_polynomial_eval_1d(trend, j, NULL) </div>
+<div class="line"><a name="l03166"></a><span class="lineno"> 3166</span>                                                     - p[j]) < ksigma)</div>
+<div class="line"><a name="l03167"></a><span class="lineno"> 3167</span>                                 rpoints++;</div>
+<div class="line"><a name="l03168"></a><span class="lineno"> 3168</span> </div>
+<div class="line"><a name="l03169"></a><span class="lineno"> 3169</span>                     <span class="keywordflow">if</span> (rpoints < npoints && rpoints > polyorder + 1) {</div>
+<div class="line"><a name="l03170"></a><span class="lineno"> 3170</span> </div>
+<div class="line"><a name="l03171"></a><span class="lineno"> 3171</span>                         wave = cpl_vector_new(rpoints);</div>
+<div class="line"><a name="l03172"></a><span class="lineno"> 3172</span>                         wdata = cpl_vector_get_data(wave);</div>
+<div class="line"><a name="l03173"></a><span class="lineno"> 3173</span>                         positions = cpl_vector_new(rpoints);</div>
+<div class="line"><a name="l03174"></a><span class="lineno"> 3174</span>                         pdata = cpl_vector_get_data(positions);</div>
+<div class="line"><a name="l03175"></a><span class="lineno"> 3175</span> </div>
+<div class="line"><a name="l03176"></a><span class="lineno"> 3176</span>                         npoints = 0;</div>
+<div class="line"><a name="l03177"></a><span class="lineno"> 3177</span>                         p = data + i*nx;</div>
+<div class="line"><a name="l03178"></a><span class="lineno"> 3178</span>                         <span class="keywordflow">for</span> (j = 0; j < nx; j++) {</div>
+<div class="line"><a name="l03179"></a><span class="lineno"> 3179</span>                             <span class="keywordflow">if</span> (p[j] > 1.0) {</div>
+<div class="line"><a name="l03180"></a><span class="lineno"> 3180</span>                                 <span class="keywordflow">if</span> (fabs(cpl_polynomial_eval_1d(trend, </div>
+<div class="line"><a name="l03181"></a><span class="lineno"> 3181</span>                                                                 j, NULL) - p[j])</div>
+<div class="line"><a name="l03182"></a><span class="lineno"> 3182</span>                                                                 < ksigma) {</div>
+<div class="line"><a name="l03183"></a><span class="lineno"> 3183</span>                                     wdata[npoints] = p[j];</div>
+<div class="line"><a name="l03184"></a><span class="lineno"> 3184</span>                                     pdata[npoints] = j;</div>
+<div class="line"><a name="l03185"></a><span class="lineno"> 3185</span>                                     npoints++;</div>
+<div class="line"><a name="l03186"></a><span class="lineno"> 3186</span>                                 }</div>
+<div class="line"><a name="l03187"></a><span class="lineno"> 3187</span>                             }</div>
+<div class="line"><a name="l03188"></a><span class="lineno"> 3188</span>                         }</div>
+<div class="line"><a name="l03189"></a><span class="lineno"> 3189</span>         </div>
+<div class="line"><a name="l03190"></a><span class="lineno"> 3190</span>                         cpl_polynomial_delete(trend);</div>
+<div class="line"><a name="l03191"></a><span class="lineno"> 3191</span>                         trend = cpl_polynomial_fit_1d_create(positions, wave,</div>
+<div class="line"><a name="l03192"></a><span class="lineno"> 3192</span>                                                              polyorder, NULL);</div>
+<div class="line"><a name="l03193"></a><span class="lineno"> 3193</span> </div>
+<div class="line"><a name="l03194"></a><span class="lineno"> 3194</span>                         cpl_vector_delete(wave);</div>
+<div class="line"><a name="l03195"></a><span class="lineno"> 3195</span>                         cpl_vector_delete(positions);</div>
+<div class="line"><a name="l03196"></a><span class="lineno"> 3196</span>                     }</div>
+<div class="line"><a name="l03197"></a><span class="lineno"> 3197</span>                 }</div>
+<div class="line"><a name="l03198"></a><span class="lineno"> 3198</span> </div>
+<div class="line"><a name="l03199"></a><span class="lineno"> 3199</span>                 <span class="keywordflow">if</span> (trend) {</div>
+<div class="line"><a name="l03200"></a><span class="lineno"> 3200</span>                     p = data + i*nx;</div>
+<div class="line"><a name="l03201"></a><span class="lineno"> 3201</span>                     <span class="keywordflow">if</span> (mode == 1) {</div>
+<div class="line"><a name="l03202"></a><span class="lineno"> 3202</span>                         <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l03203"></a><span class="lineno"> 3203</span>                             <span class="keywordflow">if</span> (p[j] < 1.0)</div>
+<div class="line"><a name="l03204"></a><span class="lineno"> 3204</span>                                 p[j] = cpl_polynomial_eval_1d(trend, j, NULL);</div>
+<div class="line"><a name="l03205"></a><span class="lineno"> 3205</span>                     }</div>
+<div class="line"><a name="l03206"></a><span class="lineno"> 3206</span>                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mode == 2) {</div>
+<div class="line"><a name="l03207"></a><span class="lineno"> 3207</span>                         <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l03208"></a><span class="lineno"> 3208</span>                             p[j] = cpl_polynomial_eval_1d(trend, j, NULL);</div>
+<div class="line"><a name="l03209"></a><span class="lineno"> 3209</span>                     }</div>
+<div class="line"><a name="l03210"></a><span class="lineno"> 3210</span>                     cpl_polynomial_delete(trend);</div>
+<div class="line"><a name="l03211"></a><span class="lineno"> 3211</span>                 }</div>
+<div class="line"><a name="l03212"></a><span class="lineno"> 3212</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03213"></a><span class="lineno"> 3213</span>                     cpl_msg_warning(func, </div>
+<div class="line"><a name="l03214"></a><span class="lineno"> 3214</span>                                     <span class="stringliteral">"Invalid wavelength field fit (ignored)"</span>);</div>
+<div class="line"><a name="l03215"></a><span class="lineno"> 3215</span>                 }</div>
+<div class="line"><a name="l03216"></a><span class="lineno"> 3216</span>             }</div>
+<div class="line"><a name="l03217"></a><span class="lineno"> 3217</span>     </div>
+<div class="line"><a name="l03218"></a><span class="lineno"> 3218</span>         }</div>
+<div class="line"><a name="l03219"></a><span class="lineno"> 3219</span> </div>
+<div class="line"><a name="l03220"></a><span class="lineno"> 3220</span>         cpl_image_turn(wavemap, 1);</div>
+<div class="line"><a name="l03221"></a><span class="lineno"> 3221</span> </div>
+<div class="line"><a name="l03222"></a><span class="lineno"> 3222</span>     }</div>
+<div class="line"><a name="l03223"></a><span class="lineno"> 3223</span> </div>
+<div class="line"><a name="l03224"></a><span class="lineno"> 3224</span> </div>
+<div class="line"><a name="l03225"></a><span class="lineno"> 3225</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l03226"></a><span class="lineno"> 3226</span> <span class="comment">     * Interpolating the IDS coefficients</span></div>
+<div class="line"><a name="l03227"></a><span class="lineno"> 3227</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l03228"></a><span class="lineno"> 3228</span> </div>
+<div class="line"><a name="l03229"></a><span class="lineno"> 3229</span>     nrows = cpl_table_get_nrow(idscoeff);</div>
+<div class="line"><a name="l03230"></a><span class="lineno"> 3230</span> </div>
+<div class="line"><a name="l03231"></a><span class="lineno"> 3231</span>     order = 0;</div>
+<div class="line"><a name="l03232"></a><span class="lineno"> 3232</span>     <span class="keywordflow">while</span> (order < 6 && cpl_table_has_column(idscoeff, clab[order]))</div>
+<div class="line"><a name="l03233"></a><span class="lineno"> 3233</span>         ++order;</div>
+<div class="line"><a name="l03234"></a><span class="lineno"> 3234</span>     --order;</div>
+<div class="line"><a name="l03235"></a><span class="lineno"> 3235</span> </div>
+<div class="line"><a name="l03236"></a><span class="lineno"> 3236</span>     <span class="keywordflow">if</span> (degree == 0) {</div>
+<div class="line"><a name="l03237"></a><span class="lineno"> 3237</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l03238"></a><span class="lineno"> 3238</span>             <span class="keywordtype">double</span> m;</div>
+<div class="line"><a name="l03239"></a><span class="lineno"> 3239</span>             <span class="keywordflow">if</span> (cpl_table_has_column(idscoeff, clab[k])) {</div>
+<div class="line"><a name="l03240"></a><span class="lineno"> 3240</span>                 m = cpl_table_get_column_median(idscoeff, clab[k]);</div>
+<div class="line"><a name="l03241"></a><span class="lineno"> 3241</span>                 cpl_table_fill_column_window_double(idscoeff, clab[k], </div>
+<div class="line"><a name="l03242"></a><span class="lineno"> 3242</span>                                                     0, nrows, m);</div>
+<div class="line"><a name="l03243"></a><span class="lineno"> 3243</span>             }</div>
+<div class="line"><a name="l03244"></a><span class="lineno"> 3244</span>         }</div>
+<div class="line"><a name="l03245"></a><span class="lineno"> 3245</span> </div>
+<div class="line"><a name="l03246"></a><span class="lineno"> 3246</span>         <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l03247"></a><span class="lineno"> 3247</span>     }</div>
+<div class="line"><a name="l03248"></a><span class="lineno"> 3248</span> </div>
+<div class="line"><a name="l03249"></a><span class="lineno"> 3249</span>     first_row = 0;</div>
+<div class="line"><a name="l03250"></a><span class="lineno"> 3250</span>     <span class="keywordflow">while</span> (!cpl_table_is_valid(idscoeff, clab[0], first_row))</div>
+<div class="line"><a name="l03251"></a><span class="lineno"> 3251</span>         first_row++;</div>
+<div class="line"><a name="l03252"></a><span class="lineno"> 3252</span> </div>
+<div class="line"><a name="l03253"></a><span class="lineno"> 3253</span>     last_row = nrows - 1;</div>
+<div class="line"><a name="l03254"></a><span class="lineno"> 3254</span>     <span class="keywordflow">while</span> (!cpl_table_is_valid(idscoeff, clab[0], last_row))</div>
+<div class="line"><a name="l03255"></a><span class="lineno"> 3255</span>         last_row--;</div>
+<div class="line"><a name="l03256"></a><span class="lineno"> 3256</span> </div>
+<div class="line"><a name="l03257"></a><span class="lineno"> 3257</span>     <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l03258"></a><span class="lineno"> 3258</span> </div>
+<div class="line"><a name="l03259"></a><span class="lineno"> 3259</span>         npoints = nrows - cpl_table_count_invalid(idscoeff, clab[k]);</div>
+<div class="line"><a name="l03260"></a><span class="lineno"> 3260</span>         wave = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l03261"></a><span class="lineno"> 3261</span>         wdata = cpl_vector_get_data(wave);</div>
+<div class="line"><a name="l03262"></a><span class="lineno"> 3262</span>         positions = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l03263"></a><span class="lineno"> 3263</span>         pdata = cpl_vector_get_data(positions);</div>
+<div class="line"><a name="l03264"></a><span class="lineno"> 3264</span> </div>
+<div class="line"><a name="l03265"></a><span class="lineno"> 3265</span>         npoints = 0;</div>
+<div class="line"><a name="l03266"></a><span class="lineno"> 3266</span>         <span class="keywordflow">for</span> (i = first_row; i <= last_row; i++) {</div>
+<div class="line"><a name="l03267"></a><span class="lineno"> 3267</span>             c = cpl_table_get_double(idscoeff, clab[k], i, &null);</div>
+<div class="line"><a name="l03268"></a><span class="lineno"> 3268</span>             <span class="keywordflow">if</span> (null == 0) {</div>
+<div class="line"><a name="l03269"></a><span class="lineno"> 3269</span>                 wdata[npoints] = c;</div>
+<div class="line"><a name="l03270"></a><span class="lineno"> 3270</span>                 pdata[npoints] = i;</div>
+<div class="line"><a name="l03271"></a><span class="lineno"> 3271</span>                 npoints++;</div>
+<div class="line"><a name="l03272"></a><span class="lineno"> 3272</span>             }</div>
+<div class="line"><a name="l03273"></a><span class="lineno"> 3273</span>         }</div>
+<div class="line"><a name="l03274"></a><span class="lineno"> 3274</span> </div>
+<div class="line"><a name="l03275"></a><span class="lineno"> 3275</span> <span class="comment">// This doesn't seem to provide good results, I have not understood why.</span></div>
+<div class="line"><a name="l03276"></a><span class="lineno"> 3276</span> <span class="comment">// Restore for robust linear fitting.</span></div>
+<div class="line"><a name="l03277"></a><span class="lineno"> 3277</span> <span class="comment">//</span></div>
+<div class="line"><a name="l03278"></a><span class="lineno"> 3278</span>         <span class="keywordflow">if</span> (degree == 1) {</div>
+<div class="line"><a name="l03279"></a><span class="lineno"> 3279</span>             cpl_vector   *p;</div>
+<div class="line"><a name="l03280"></a><span class="lineno"> 3280</span>             cpl_vector   *w;</div>
+<div class="line"><a name="l03281"></a><span class="lineno"> 3281</span>             cpl_bivector *list;</div>
+<div class="line"><a name="l03282"></a><span class="lineno"> 3282</span>             <span class="keywordtype">double</span>        q, m;</div>
+<div class="line"><a name="l03283"></a><span class="lineno"> 3283</span> </div>
+<div class="line"><a name="l03284"></a><span class="lineno"> 3284</span>             <span class="keywordflow">if</span> (npoints > 4) {</div>
+<div class="line"><a name="l03285"></a><span class="lineno"> 3285</span>                 p = cpl_vector_extract(positions, 2, npoints - 2, 1);</div>
+<div class="line"><a name="l03286"></a><span class="lineno"> 3286</span>                 w = cpl_vector_extract(wave, 2, npoints - 2, 1);</div>
+<div class="line"><a name="l03287"></a><span class="lineno"> 3287</span>             }</div>
+<div class="line"><a name="l03288"></a><span class="lineno"> 3288</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03289"></a><span class="lineno"> 3289</span>                 p = positions;</div>
+<div class="line"><a name="l03290"></a><span class="lineno"> 3290</span>                 w = wave;</div>
+<div class="line"><a name="l03291"></a><span class="lineno"> 3291</span>             }</div>
+<div class="line"><a name="l03292"></a><span class="lineno"> 3292</span> </div>
+<div class="line"><a name="l03293"></a><span class="lineno"> 3293</span>             list = cpl_bivector_wrap_vectors(p, w);</div>
+<div class="line"><a name="l03294"></a><span class="lineno"> 3294</span> </div>
+<div class="line"><a name="l03295"></a><span class="lineno"> 3295</span>             robustLinearFit(list, &q, &m, &mse);</div>
+<div class="line"><a name="l03296"></a><span class="lineno"> 3296</span>             cpl_bivector_unwrap_vectors(list);</div>
+<div class="line"><a name="l03297"></a><span class="lineno"> 3297</span>             <span class="keywordflow">for</span> (i = first_row; i <= last_row; i++)</div>
+<div class="line"><a name="l03298"></a><span class="lineno"> 3298</span>                  cpl_table_set_double(idscoeff, clab[k], i, q + m*i);</div>
+<div class="line"><a name="l03299"></a><span class="lineno"> 3299</span> </div>
+<div class="line"><a name="l03300"></a><span class="lineno"> 3300</span>             <span class="keywordflow">if</span> (npoints > 4) {</div>
+<div class="line"><a name="l03301"></a><span class="lineno"> 3301</span>                 cpl_vector_delete(p);</div>
+<div class="line"><a name="l03302"></a><span class="lineno"> 3302</span>                 cpl_vector_delete(w);</div>
+<div class="line"><a name="l03303"></a><span class="lineno"> 3303</span>             }</div>
+<div class="line"><a name="l03304"></a><span class="lineno"> 3304</span> </div>
+<div class="line"><a name="l03305"></a><span class="lineno"> 3305</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l03306"></a><span class="lineno"> 3306</span>         }</div>
+<div class="line"><a name="l03307"></a><span class="lineno"> 3307</span> </div>
+<div class="line"><a name="l03308"></a><span class="lineno"> 3308</span> <span class="comment">// End robust linear fitting</span></div>
+<div class="line"><a name="l03309"></a><span class="lineno"> 3309</span> </div>
+<div class="line"><a name="l03310"></a><span class="lineno"> 3310</span>         trend = cpl_polynomial_fit_1d_create(positions, wave, degree, &mse);</div>
+<div class="line"><a name="l03311"></a><span class="lineno"> 3311</span> </div>
+<div class="line"><a name="l03312"></a><span class="lineno"> 3312</span>         ksigma = 3*sqrt(mse);</div>
+<div class="line"><a name="l03313"></a><span class="lineno"> 3313</span> </div>
+<div class="line"><a name="l03314"></a><span class="lineno"> 3314</span>         cpl_vector_delete(wave);</div>
+<div class="line"><a name="l03315"></a><span class="lineno"> 3315</span>         cpl_vector_delete(positions);</div>
+<div class="line"><a name="l03316"></a><span class="lineno"> 3316</span> </div>
+<div class="line"><a name="l03317"></a><span class="lineno"> 3317</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l03318"></a><span class="lineno"> 3318</span> <span class="comment">         * Iteration</span></div>
+<div class="line"><a name="l03319"></a><span class="lineno"> 3319</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l03320"></a><span class="lineno"> 3320</span> </div>
+<div class="line"><a name="l03321"></a><span class="lineno"> 3321</span>         <span class="keywordflow">if</span> (trend) {</div>
+<div class="line"><a name="l03322"></a><span class="lineno"> 3322</span>             rpoints = 0;</div>
+<div class="line"><a name="l03323"></a><span class="lineno"> 3323</span>             <span class="keywordflow">for</span> (i = first_row; i <= last_row; i++) {</div>
+<div class="line"><a name="l03324"></a><span class="lineno"> 3324</span>                 c = cpl_table_get_double(idscoeff, clab[k], i, &null);</div>
+<div class="line"><a name="l03325"></a><span class="lineno"> 3325</span>                 <span class="keywordflow">if</span> (null == 0) {</div>
+<div class="line"><a name="l03326"></a><span class="lineno"> 3326</span>                     <span class="keywordflow">if</span> (fabs(cpl_polynomial_eval_1d(trend, i, NULL) - c) </div>
+<div class="line"><a name="l03327"></a><span class="lineno"> 3327</span>                                                                  < ksigma) {</div>
+<div class="line"><a name="l03328"></a><span class="lineno"> 3328</span>                         rpoints++;</div>
+<div class="line"><a name="l03329"></a><span class="lineno"> 3329</span>                     }</div>
+<div class="line"><a name="l03330"></a><span class="lineno"> 3330</span>                 }</div>
+<div class="line"><a name="l03331"></a><span class="lineno"> 3331</span>             }</div>
+<div class="line"><a name="l03332"></a><span class="lineno"> 3332</span> </div>
+<div class="line"><a name="l03333"></a><span class="lineno"> 3333</span>             <span class="keywordflow">if</span> (rpoints > 0 && rpoints < npoints) {</div>
+<div class="line"><a name="l03334"></a><span class="lineno"> 3334</span>                 cpl_msg_debug(func, <span class="stringliteral">"%d points rejected from "</span></div>
+<div class="line"><a name="l03335"></a><span class="lineno"> 3335</span>                               <span class="stringliteral">"wavelength calibration fit"</span>, </div>
+<div class="line"><a name="l03336"></a><span class="lineno"> 3336</span>                               npoints - rpoints);</div>
+<div class="line"><a name="l03337"></a><span class="lineno"> 3337</span> </div>
+<div class="line"><a name="l03338"></a><span class="lineno"> 3338</span>                 wave = cpl_vector_new(rpoints);</div>
+<div class="line"><a name="l03339"></a><span class="lineno"> 3339</span>                 wdata = cpl_vector_get_data(wave);</div>
+<div class="line"><a name="l03340"></a><span class="lineno"> 3340</span>                 positions = cpl_vector_new(rpoints);</div>
+<div class="line"><a name="l03341"></a><span class="lineno"> 3341</span>                 pdata = cpl_vector_get_data(positions);</div>
+<div class="line"><a name="l03342"></a><span class="lineno"> 3342</span> </div>
+<div class="line"><a name="l03343"></a><span class="lineno"> 3343</span>                 npoints = 0;</div>
+<div class="line"><a name="l03344"></a><span class="lineno"> 3344</span>                 <span class="keywordflow">for</span> (i = first_row; i <= last_row; i++) {</div>
+<div class="line"><a name="l03345"></a><span class="lineno"> 3345</span>                     c = cpl_table_get_double(idscoeff, clab[k], i, &null);</div>
+<div class="line"><a name="l03346"></a><span class="lineno"> 3346</span>                     <span class="keywordflow">if</span> (null == 0) {</div>
+<div class="line"><a name="l03347"></a><span class="lineno"> 3347</span>                         <span class="keywordflow">if</span> (fabs(cpl_polynomial_eval_1d(trend, i, NULL) - c)</div>
+<div class="line"><a name="l03348"></a><span class="lineno"> 3348</span>                                                                  < ksigma) {</div>
+<div class="line"><a name="l03349"></a><span class="lineno"> 3349</span>                             wdata[npoints] = c;</div>
+<div class="line"><a name="l03350"></a><span class="lineno"> 3350</span>                             pdata[npoints] = i;</div>
+<div class="line"><a name="l03351"></a><span class="lineno"> 3351</span>                             npoints++;</div>
+<div class="line"><a name="l03352"></a><span class="lineno"> 3352</span>                         }</div>
+<div class="line"><a name="l03353"></a><span class="lineno"> 3353</span>                     }</div>
+<div class="line"><a name="l03354"></a><span class="lineno"> 3354</span>                 }</div>
+<div class="line"><a name="l03355"></a><span class="lineno"> 3355</span> </div>
+<div class="line"><a name="l03356"></a><span class="lineno"> 3356</span>                 <span class="keywordflow">if</span> (npoints) {</div>
+<div class="line"><a name="l03357"></a><span class="lineno"> 3357</span>                     cpl_polynomial_delete(trend);</div>
+<div class="line"><a name="l03358"></a><span class="lineno"> 3358</span>                     trend = cpl_polynomial_fit_1d_create(positions, </div>
+<div class="line"><a name="l03359"></a><span class="lineno"> 3359</span>                                                          wave, degree, NULL);</div>
+<div class="line"><a name="l03360"></a><span class="lineno"> 3360</span>                 }</div>
+<div class="line"><a name="l03361"></a><span class="lineno"> 3361</span> </div>
+<div class="line"><a name="l03362"></a><span class="lineno"> 3362</span>                 cpl_vector_delete(wave);</div>
+<div class="line"><a name="l03363"></a><span class="lineno"> 3363</span>                 cpl_vector_delete(positions);</div>
+<div class="line"><a name="l03364"></a><span class="lineno"> 3364</span> </div>
+<div class="line"><a name="l03365"></a><span class="lineno"> 3365</span>             }</div>
+<div class="line"><a name="l03366"></a><span class="lineno"> 3366</span>         }</div>
+<div class="line"><a name="l03367"></a><span class="lineno"> 3367</span> </div>
+<div class="line"><a name="l03368"></a><span class="lineno"> 3368</span>         <span class="keywordflow">if</span> (trend) {</div>
+<div class="line"><a name="l03369"></a><span class="lineno"> 3369</span>             <span class="keywordflow">for</span> (i = first_row; i <= last_row; i++) {</div>
+<div class="line"><a name="l03370"></a><span class="lineno"> 3370</span>                 <span class="keywordflow">if</span> (mode == 1) {</div>
+<div class="line"><a name="l03371"></a><span class="lineno"> 3371</span>                     <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, clab[k], i)) {</div>
+<div class="line"><a name="l03372"></a><span class="lineno"> 3372</span>                         cpl_table_set_double(idscoeff, clab[k], i, </div>
+<div class="line"><a name="l03373"></a><span class="lineno"> 3373</span>                                              cpl_polynomial_eval_1d(trend, i,</div>
+<div class="line"><a name="l03374"></a><span class="lineno"> 3374</span>                                                                     NULL));</div>
+<div class="line"><a name="l03375"></a><span class="lineno"> 3375</span>                     }</div>
+<div class="line"><a name="l03376"></a><span class="lineno"> 3376</span>                 }</div>
+<div class="line"><a name="l03377"></a><span class="lineno"> 3377</span>                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mode == 2) {</div>
+<div class="line"><a name="l03378"></a><span class="lineno"> 3378</span>                     cpl_table_set_double(idscoeff, clab[k], i, </div>
+<div class="line"><a name="l03379"></a><span class="lineno"> 3379</span>                                      cpl_polynomial_eval_1d(trend, i, NULL));</div>
+<div class="line"><a name="l03380"></a><span class="lineno"> 3380</span>                 }</div>
+<div class="line"><a name="l03381"></a><span class="lineno"> 3381</span>             }</div>
+<div class="line"><a name="l03382"></a><span class="lineno"> 3382</span>             cpl_polynomial_delete(trend);</div>
+<div class="line"><a name="l03383"></a><span class="lineno"> 3383</span>         }</div>
+<div class="line"><a name="l03384"></a><span class="lineno"> 3384</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03385"></a><span class="lineno"> 3385</span>             cpl_msg_warning(func, <span class="stringliteral">"Invalid IDS coefficient fit (ignored)"</span>);</div>
+<div class="line"><a name="l03386"></a><span class="lineno"> 3386</span>         }</div>
+<div class="line"><a name="l03387"></a><span class="lineno"> 3387</span> </div>
+<div class="line"><a name="l03388"></a><span class="lineno"> 3388</span>     }</div>
+<div class="line"><a name="l03389"></a><span class="lineno"> 3389</span> </div>
+<div class="line"><a name="l03390"></a><span class="lineno"> 3390</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l03391"></a><span class="lineno"> 3391</span> }</div>
+<div class="line"><a name="l03392"></a><span class="lineno"> 3392</span> </div>
+<div class="line"><a name="l03393"></a><span class="lineno"> 3393</span> </div>
+<div class="line"><a name="l03394"></a><span class="lineno"> 3394</span> </div>
+<div class="line"><a name="l03420"></a><span class="lineno"><a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36"> 3420</a></span> cpl_image *<a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(cpl_image *image, cpl_image *bias, </div>
+<div class="line"><a name="l03421"></a><span class="lineno"> 3421</span>                            cpl_table *overscans)</div>
+<div class="line"><a name="l03422"></a><span class="lineno"> 3422</span> {</div>
+<div class="line"><a name="l03423"></a><span class="lineno"> 3423</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_remove_bias"</span>;</div>
+<div class="line"><a name="l03424"></a><span class="lineno"> 3424</span> </div>
+<div class="line"><a name="l03425"></a><span class="lineno"> 3425</span>     cpl_image *unbiased;</div>
+<div class="line"><a name="l03426"></a><span class="lineno"> 3426</span>     cpl_image *overscan;</div>
+<div class="line"><a name="l03427"></a><span class="lineno"> 3427</span>     <span class="keywordtype">double</span>     mean_bias_level;</div>
+<div class="line"><a name="l03428"></a><span class="lineno"> 3428</span>     <span class="keywordtype">double</span>     mean_overscans_level;</div>
+<div class="line"><a name="l03429"></a><span class="lineno"> 3429</span>     <span class="keywordtype">int</span>        count;</div>
+<div class="line"><a name="l03430"></a><span class="lineno"> 3430</span>     <span class="keywordtype">int</span>        nrows;</div>
+<div class="line"><a name="l03431"></a><span class="lineno"> 3431</span>     <span class="keywordtype">int</span>        xlow, ylow, xhig, yhig;</div>
+<div class="line"><a name="l03432"></a><span class="lineno"> 3432</span>     <span class="keywordtype">int</span>        i;</div>
+<div class="line"><a name="l03433"></a><span class="lineno"> 3433</span> </div>
+<div class="line"><a name="l03434"></a><span class="lineno"> 3434</span> </div>
+<div class="line"><a name="l03435"></a><span class="lineno"> 3435</span>     <span class="keywordflow">if</span> (image == NULL || overscans == NULL) {</div>
+<div class="line"><a name="l03436"></a><span class="lineno"> 3436</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l03437"></a><span class="lineno"> 3437</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03438"></a><span class="lineno"> 3438</span>     }</div>
+<div class="line"><a name="l03439"></a><span class="lineno"> 3439</span> </div>
+<div class="line"><a name="l03440"></a><span class="lineno"> 3440</span>     nrows = cpl_table_get_nrow(overscans);</div>
+<div class="line"><a name="l03441"></a><span class="lineno"> 3441</span> </div>
+<div class="line"><a name="l03442"></a><span class="lineno"> 3442</span>     <span class="keywordflow">if</span> (nrows == 0) {</div>
+<div class="line"><a name="l03443"></a><span class="lineno"> 3443</span>         cpl_msg_error(func, <span class="stringliteral">"Empty overscan table"</span>);</div>
+<div class="line"><a name="l03444"></a><span class="lineno"> 3444</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l03445"></a><span class="lineno"> 3445</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03446"></a><span class="lineno"> 3446</span>     }</div>
+<div class="line"><a name="l03447"></a><span class="lineno"> 3447</span> </div>
+<div class="line"><a name="l03448"></a><span class="lineno"> 3448</span>     <span class="keywordflow">if</span> (bias) {</div>
+<div class="line"><a name="l03449"></a><span class="lineno"> 3449</span>         <span class="keywordflow">if</span> (nrows == 1) {</div>
+<div class="line"><a name="l03450"></a><span class="lineno"> 3450</span>             unbiased = cpl_image_subtract_create(image, bias);</div>
+<div class="line"><a name="l03451"></a><span class="lineno"> 3451</span>             <span class="keywordflow">if</span> (unbiased == NULL) {</div>
+<div class="line"><a name="l03452"></a><span class="lineno"> 3452</span>                 cpl_msg_error(func, <span class="stringliteral">"Incompatible master bias"</span>);</div>
+<div class="line"><a name="l03453"></a><span class="lineno"> 3453</span>                 cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l03454"></a><span class="lineno"> 3454</span>             }</div>
+<div class="line"><a name="l03455"></a><span class="lineno"> 3455</span>             <span class="keywordflow">return</span> unbiased;</div>
+<div class="line"><a name="l03456"></a><span class="lineno"> 3456</span>         }</div>
+<div class="line"><a name="l03457"></a><span class="lineno"> 3457</span>         mean_bias_level = cpl_image_get_mean(bias);</div>
+<div class="line"><a name="l03458"></a><span class="lineno"> 3458</span>     }</div>
+<div class="line"><a name="l03459"></a><span class="lineno"> 3459</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03460"></a><span class="lineno"> 3460</span>         <span class="keywordflow">if</span> (nrows == 1) {</div>
+<div class="line"><a name="l03461"></a><span class="lineno"> 3461</span>             cpl_msg_error(func, <span class="stringliteral">"No master bias in input, and no overscan "</span></div>
+<div class="line"><a name="l03462"></a><span class="lineno"> 3462</span>                           <span class="stringliteral">"regions in input image: bias subtraction "</span></div>
+<div class="line"><a name="l03463"></a><span class="lineno"> 3463</span>                           <span class="stringliteral">"cannot be performed!"</span>);</div>
+<div class="line"><a name="l03464"></a><span class="lineno"> 3464</span>             cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l03465"></a><span class="lineno"> 3465</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03466"></a><span class="lineno"> 3466</span>         }</div>
+<div class="line"><a name="l03467"></a><span class="lineno"> 3467</span>         mean_bias_level = 0.0;</div>
+<div class="line"><a name="l03468"></a><span class="lineno"> 3468</span>     }</div>
+<div class="line"><a name="l03469"></a><span class="lineno"> 3469</span> </div>
+<div class="line"><a name="l03470"></a><span class="lineno"> 3470</span>     mean_overscans_level = 0.0;</div>
+<div class="line"><a name="l03471"></a><span class="lineno"> 3471</span>     count = 0;</div>
+<div class="line"><a name="l03472"></a><span class="lineno"> 3472</span>     <span class="keywordflow">for</span> (i = 0; i < nrows; i++) {</div>
+<div class="line"><a name="l03473"></a><span class="lineno"> 3473</span>         xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, i, NULL);</div>
+<div class="line"><a name="l03474"></a><span class="lineno"> 3474</span>         ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, i, NULL);</div>
+<div class="line"><a name="l03475"></a><span class="lineno"> 3475</span>         xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, i, NULL);</div>
+<div class="line"><a name="l03476"></a><span class="lineno"> 3476</span>         yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, i, NULL);</div>
+<div class="line"><a name="l03477"></a><span class="lineno"> 3477</span> </div>
+<div class="line"><a name="l03478"></a><span class="lineno"> 3478</span>         <span class="keywordflow">if</span> (i == 0) {</div>
+<div class="line"><a name="l03479"></a><span class="lineno"> 3479</span>             unbiased = cpl_image_extract(image, xlow+1, ylow+1, xhig, yhig);</div>
+<div class="line"><a name="l03480"></a><span class="lineno"> 3480</span>             <span class="keywordflow">if</span> (unbiased == NULL) {</div>
+<div class="line"><a name="l03481"></a><span class="lineno"> 3481</span>                 cpl_msg_error(func, <span class="stringliteral">"Incompatible overscan table"</span>);</div>
+<div class="line"><a name="l03482"></a><span class="lineno"> 3482</span>                 cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l03483"></a><span class="lineno"> 3483</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03484"></a><span class="lineno"> 3484</span>             }</div>
+<div class="line"><a name="l03485"></a><span class="lineno"> 3485</span>             <span class="keywordflow">if</span> (bias) {</div>
+<div class="line"><a name="l03486"></a><span class="lineno"> 3486</span>                 <span class="keywordflow">if</span> (cpl_image_subtract(unbiased, bias)) {</div>
+<div class="line"><a name="l03487"></a><span class="lineno"> 3487</span>                     cpl_msg_error(func, <span class="stringliteral">"Incompatible master bias"</span>);</div>
+<div class="line"><a name="l03488"></a><span class="lineno"> 3488</span>                     cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l03489"></a><span class="lineno"> 3489</span>                     cpl_image_delete(unbiased);</div>
+<div class="line"><a name="l03490"></a><span class="lineno"> 3490</span>                     <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03491"></a><span class="lineno"> 3491</span>                 }</div>
+<div class="line"><a name="l03492"></a><span class="lineno"> 3492</span>             }</div>
+<div class="line"><a name="l03493"></a><span class="lineno"> 3493</span>         }</div>
+<div class="line"><a name="l03494"></a><span class="lineno"> 3494</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03495"></a><span class="lineno"> 3495</span>             overscan = cpl_image_extract(image, xlow+1, ylow+1, xhig, yhig);</div>
+<div class="line"><a name="l03496"></a><span class="lineno"> 3496</span>             <span class="keywordflow">if</span> (overscan == NULL) {</div>
+<div class="line"><a name="l03497"></a><span class="lineno"> 3497</span>                 cpl_msg_error(func, <span class="stringliteral">"Incompatible overscan table"</span>);</div>
+<div class="line"><a name="l03498"></a><span class="lineno"> 3498</span>                 cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l03499"></a><span class="lineno"> 3499</span>                 cpl_image_delete(unbiased);</div>
+<div class="line"><a name="l03500"></a><span class="lineno"> 3500</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03501"></a><span class="lineno"> 3501</span>             }</div>
+<div class="line"><a name="l03502"></a><span class="lineno"> 3502</span> </div>
+<div class="line"><a name="l03503"></a><span class="lineno"> 3503</span>             mean_overscans_level += cpl_image_get_median(overscan);</div>
+<div class="line"><a name="l03504"></a><span class="lineno"> 3504</span>             count++;</div>
+<div class="line"><a name="l03505"></a><span class="lineno"> 3505</span> </div>
+<div class="line"><a name="l03506"></a><span class="lineno"> 3506</span> <span class="comment">/***</span></div>
+<div class="line"><a name="l03507"></a><span class="lineno"> 3507</span> <span class="comment"> * Here the mean level was used: not very robust...</span></div>
+<div class="line"><a name="l03508"></a><span class="lineno"> 3508</span> <span class="comment"></span></div>
+<div class="line"><a name="l03509"></a><span class="lineno"> 3509</span> <span class="comment">            mean_overscans_level += cpl_image_get_flux(overscan);</span></div>
+<div class="line"><a name="l03510"></a><span class="lineno"> 3510</span> <span class="comment">            count += cpl_image_get_size_x(overscan)</span></div>
+<div class="line"><a name="l03511"></a><span class="lineno"> 3511</span> <span class="comment">                   * cpl_image_get_size_y(overscan);</span></div>
+<div class="line"><a name="l03512"></a><span class="lineno"> 3512</span> <span class="comment">***/</span></div>
+<div class="line"><a name="l03513"></a><span class="lineno"> 3513</span>             cpl_image_delete(overscan);</div>
+<div class="line"><a name="l03514"></a><span class="lineno"> 3514</span>         }</div>
+<div class="line"><a name="l03515"></a><span class="lineno"> 3515</span>     }</div>
+<div class="line"><a name="l03516"></a><span class="lineno"> 3516</span> </div>
+<div class="line"><a name="l03517"></a><span class="lineno"> 3517</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l03518"></a><span class="lineno"> 3518</span> <span class="comment">     * Overscan correction</span></div>
+<div class="line"><a name="l03519"></a><span class="lineno"> 3519</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l03520"></a><span class="lineno"> 3520</span> </div>
+<div class="line"><a name="l03521"></a><span class="lineno"> 3521</span>     mean_overscans_level /= count;</div>
+<div class="line"><a name="l03522"></a><span class="lineno"> 3522</span> </div>
+<div class="line"><a name="l03523"></a><span class="lineno"> 3523</span>     cpl_image_subtract_scalar(unbiased, mean_overscans_level - mean_bias_level);</div>
+<div class="line"><a name="l03524"></a><span class="lineno"> 3524</span> </div>
+<div class="line"><a name="l03525"></a><span class="lineno"> 3525</span>     cpl_msg_info(cpl_func, </div>
+<div class="line"><a name="l03526"></a><span class="lineno"> 3526</span>                  <span class="stringliteral">"Difference between mean overscans level "</span></div>
+<div class="line"><a name="l03527"></a><span class="lineno"> 3527</span>                  <span class="stringliteral">"and mean bias level: %.2f"</span>,</div>
+<div class="line"><a name="l03528"></a><span class="lineno"> 3528</span>                  mean_overscans_level - mean_bias_level);</div>
+<div class="line"><a name="l03529"></a><span class="lineno"> 3529</span> </div>
+<div class="line"><a name="l03530"></a><span class="lineno"> 3530</span>     <span class="keywordflow">return</span> unbiased;</div>
+<div class="line"><a name="l03531"></a><span class="lineno"> 3531</span> </div>
+<div class="line"><a name="l03532"></a><span class="lineno"> 3532</span> }</div>
+<div class="line"><a name="l03533"></a><span class="lineno"> 3533</span> </div>
+<div class="line"><a name="l03534"></a><span class="lineno"> 3534</span> </div>
+<div class="line"><a name="l03593"></a><span class="lineno"><a class="code" href="group__moses.html#gafeaa9b762d7da8437fef7f5f579c04ba"> 3593</a></span> cpl_error_code <a class="code" href="group__moses.html#gafeaa9b762d7da8437fef7f5f579c04ba" title="Background determination on 1D emission line spectrum (arc)">mos_arc_background_1D</a>(<span class="keywordtype">float</span> *spectrum, <span class="keywordtype">float</span> *back, </div>
+<div class="line"><a name="l03594"></a><span class="lineno"> 3594</span>                                      <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> msize, <span class="keywordtype">int</span> fsize) </div>
+<div class="line"><a name="l03595"></a><span class="lineno"> 3595</span> {</div>
+<div class="line"><a name="l03596"></a><span class="lineno"> 3596</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_arc_background_1D"</span>;</div>
+<div class="line"><a name="l03597"></a><span class="lineno"> 3597</span> </div>
+<div class="line"><a name="l03598"></a><span class="lineno"> 3598</span>     <span class="keywordtype">float</span>  *minf;</div>
+<div class="line"><a name="l03599"></a><span class="lineno"> 3599</span>     <span class="keywordtype">float</span>  *maxf;</div>
+<div class="line"><a name="l03600"></a><span class="lineno"> 3600</span>     <span class="keywordtype">float</span>  *smof;</div>
+<div class="line"><a name="l03601"></a><span class="lineno"> 3601</span>     <span class="keywordtype">int</span>     i;</div>
+<div class="line"><a name="l03602"></a><span class="lineno"> 3602</span> </div>
+<div class="line"><a name="l03603"></a><span class="lineno"> 3603</span> </div>
+<div class="line"><a name="l03604"></a><span class="lineno"> 3604</span>     <span class="keywordflow">if</span> (spectrum == NULL || back == NULL)</div>
+<div class="line"><a name="l03605"></a><span class="lineno"> 3605</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l03606"></a><span class="lineno"> 3606</span> </div>
+<div class="line"><a name="l03607"></a><span class="lineno"> 3607</span>     <span class="keywordflow">if</span> (msize % 2 == 0)</div>
+<div class="line"><a name="l03608"></a><span class="lineno"> 3608</span>         msize++;</div>
+<div class="line"><a name="l03609"></a><span class="lineno"> 3609</span> </div>
+<div class="line"><a name="l03610"></a><span class="lineno"> 3610</span>     <span class="keywordflow">if</span> (fsize % 2 == 0)</div>
+<div class="line"><a name="l03611"></a><span class="lineno"> 3611</span>         fsize++;</div>
+<div class="line"><a name="l03612"></a><span class="lineno"> 3612</span> </div>
+<div class="line"><a name="l03613"></a><span class="lineno"> 3613</span>     <span class="keywordflow">if</span> (msize < 3 || fsize < msize || length < 2*fsize)</div>
+<div class="line"><a name="l03614"></a><span class="lineno"> 3614</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l03615"></a><span class="lineno"> 3615</span> </div>
+<div class="line"><a name="l03616"></a><span class="lineno"> 3616</span> </div>
+<div class="line"><a name="l03617"></a><span class="lineno"> 3617</span>     minf = min_filter(spectrum, length, msize);</div>
+<div class="line"><a name="l03618"></a><span class="lineno"> 3618</span>     smof = smo_filter(minf, length, fsize);</div>
+<div class="line"><a name="l03619"></a><span class="lineno"> 3619</span>     cpl_free(minf);</div>
+<div class="line"><a name="l03620"></a><span class="lineno"> 3620</span>     maxf = max_filter(smof, length, 2*msize+1);</div>
+<div class="line"><a name="l03621"></a><span class="lineno"> 3621</span>     cpl_free(smof);</div>
+<div class="line"><a name="l03622"></a><span class="lineno"> 3622</span>     smof = smo_filter(maxf, length, 2*fsize+1);</div>
+<div class="line"><a name="l03623"></a><span class="lineno"> 3623</span>     cpl_free(maxf);</div>
+<div class="line"><a name="l03624"></a><span class="lineno"> 3624</span>     minf = min_filter(smof, length, 2*msize+1);</div>
+<div class="line"><a name="l03625"></a><span class="lineno"> 3625</span>     cpl_free(smof);</div>
+<div class="line"><a name="l03626"></a><span class="lineno"> 3626</span>     smof = smo_filter(minf, length, 2*fsize+1);</div>
+<div class="line"><a name="l03627"></a><span class="lineno"> 3627</span>     cpl_free(minf);</div>
+<div class="line"><a name="l03628"></a><span class="lineno"> 3628</span> </div>
+<div class="line"><a name="l03629"></a><span class="lineno"> 3629</span>     <span class="keywordflow">for</span> (i = 0; i < length; i++)</div>
+<div class="line"><a name="l03630"></a><span class="lineno"> 3630</span>         back[i] = smof[i];</div>
+<div class="line"><a name="l03631"></a><span class="lineno"> 3631</span> </div>
+<div class="line"><a name="l03632"></a><span class="lineno"> 3632</span>     cpl_free(smof);</div>
+<div class="line"><a name="l03633"></a><span class="lineno"> 3633</span> </div>
+<div class="line"><a name="l03634"></a><span class="lineno"> 3634</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l03635"></a><span class="lineno"> 3635</span> </div>
+<div class="line"><a name="l03636"></a><span class="lineno"> 3636</span> }</div>
+<div class="line"><a name="l03637"></a><span class="lineno"> 3637</span> </div>
+<div class="line"><a name="l03638"></a><span class="lineno"> 3638</span> </div>
+<div class="line"><a name="l03695"></a><span class="lineno"><a class="code" href="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b"> 3695</a></span> cpl_image *<a class="code" href="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b" title="Background determination on emission line spectrum (arc)">mos_arc_background</a>(cpl_image *image, <span class="keywordtype">int</span> msize, <span class="keywordtype">int</span> fsize) </div>
+<div class="line"><a name="l03696"></a><span class="lineno"> 3696</span> {</div>
+<div class="line"><a name="l03697"></a><span class="lineno"> 3697</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_arc_background"</span>;</div>
+<div class="line"><a name="l03698"></a><span class="lineno"> 3698</span> </div>
+<div class="line"><a name="l03699"></a><span class="lineno"> 3699</span>     cpl_image  *fimage;</div>
+<div class="line"><a name="l03700"></a><span class="lineno"> 3700</span>     cpl_image  *bimage;</div>
+<div class="line"><a name="l03701"></a><span class="lineno"> 3701</span>     cpl_matrix *kernel;</div>
+<div class="line"><a name="l03702"></a><span class="lineno"> 3702</span>     <span class="keywordtype">float</span>      *data;</div>
+<div class="line"><a name="l03703"></a><span class="lineno"> 3703</span>     <span class="keywordtype">float</span>      *bdata;</div>
+<div class="line"><a name="l03704"></a><span class="lineno"> 3704</span>     <span class="keywordtype">float</span>      *row;</div>
+<div class="line"><a name="l03705"></a><span class="lineno"> 3705</span>     <span class="keywordtype">float</span>      *brow;</div>
+<div class="line"><a name="l03706"></a><span class="lineno"> 3706</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l03707"></a><span class="lineno"> 3707</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l03708"></a><span class="lineno"> 3708</span> </div>
+<div class="line"><a name="l03709"></a><span class="lineno"> 3709</span> </div>
+<div class="line"><a name="l03710"></a><span class="lineno"> 3710</span>     <span class="keywordflow">if</span> (image == NULL) {</div>
+<div class="line"><a name="l03711"></a><span class="lineno"> 3711</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l03712"></a><span class="lineno"> 3712</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03713"></a><span class="lineno"> 3713</span>     }</div>
+<div class="line"><a name="l03714"></a><span class="lineno"> 3714</span> </div>
+<div class="line"><a name="l03715"></a><span class="lineno"> 3715</span>     <span class="keywordflow">if</span> (msize % 2 == 0)</div>
+<div class="line"><a name="l03716"></a><span class="lineno"> 3716</span>         msize++;</div>
+<div class="line"><a name="l03717"></a><span class="lineno"> 3717</span> </div>
+<div class="line"><a name="l03718"></a><span class="lineno"> 3718</span>     <span class="keywordflow">if</span> (fsize % 2 == 0)</div>
+<div class="line"><a name="l03719"></a><span class="lineno"> 3719</span>         fsize++;</div>
+<div class="line"><a name="l03720"></a><span class="lineno"> 3720</span> </div>
+<div class="line"><a name="l03721"></a><span class="lineno"> 3721</span>     nx = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l03722"></a><span class="lineno"> 3722</span>     ny = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l03723"></a><span class="lineno"> 3723</span> </div>
+<div class="line"><a name="l03724"></a><span class="lineno"> 3724</span>     bimage = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l03725"></a><span class="lineno"> 3725</span> </div>
+<div class="line"><a name="l03726"></a><span class="lineno"> 3726</span>     fimage = <a class="code" href="group__moses.html#ga1f574f5f45840ea69fa03eb26055a1b1" title="Convenience function for standard median filtering.">mos_image_filter_median</a>(image, 3, 3);</div>
+<div class="line"><a name="l03727"></a><span class="lineno"> 3727</span> </div>
+<div class="line"><a name="l03728"></a><span class="lineno"> 3728</span>     data = cpl_image_get_data_float(fimage);</div>
+<div class="line"><a name="l03729"></a><span class="lineno"> 3729</span>     bdata = cpl_image_get_data_float(bimage);</div>
+<div class="line"><a name="l03730"></a><span class="lineno"> 3730</span> </div>
+<div class="line"><a name="l03731"></a><span class="lineno"> 3731</span>     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l03732"></a><span class="lineno"> 3732</span>         row = data + i * nx;</div>
+<div class="line"><a name="l03733"></a><span class="lineno"> 3733</span>         brow = bdata + i * nx;</div>
+<div class="line"><a name="l03734"></a><span class="lineno"> 3734</span>         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gafeaa9b762d7da8437fef7f5f579c04ba" title="Background determination on 1D emission line spectrum (arc)">mos_arc_background_1D</a>(row, brow, nx, msize, fsize)) {</div>
+<div class="line"><a name="l03735"></a><span class="lineno"> 3735</span>             cpl_error_set_where(func); </div>
+<div class="line"><a name="l03736"></a><span class="lineno"> 3736</span>             cpl_image_delete(fimage);</div>
+<div class="line"><a name="l03737"></a><span class="lineno"> 3737</span>             cpl_image_delete(bimage);</div>
+<div class="line"><a name="l03738"></a><span class="lineno"> 3738</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03739"></a><span class="lineno"> 3739</span>         }</div>
+<div class="line"><a name="l03740"></a><span class="lineno"> 3740</span>     }</div>
+<div class="line"><a name="l03741"></a><span class="lineno"> 3741</span> </div>
+<div class="line"><a name="l03742"></a><span class="lineno"> 3742</span>     cpl_image_delete(fimage);</div>
+<div class="line"><a name="l03743"></a><span class="lineno"> 3743</span> </div>
+<div class="line"><a name="l03744"></a><span class="lineno"> 3744</span>     <span class="keywordflow">return</span> bimage;</div>
+<div class="line"><a name="l03745"></a><span class="lineno"> 3745</span> }</div>
+<div class="line"><a name="l03746"></a><span class="lineno"> 3746</span> </div>
+<div class="line"><a name="l03747"></a><span class="lineno"> 3747</span> </div>
+<div class="line"><a name="l03768"></a><span class="lineno"><a class="code" href="group__moses.html#ga28871a4ecc1e2779022f06d4da892360"> 3768</a></span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#ga28871a4ecc1e2779022f06d4da892360" title="Estimate lines widths (in pixel) in arc lamp spectrum.">mos_lines_width</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *spectrum, <span class="keywordtype">int</span> length)</div>
+<div class="line"><a name="l03769"></a><span class="lineno"> 3769</span> {</div>
+<div class="line"><a name="l03770"></a><span class="lineno"> 3770</span> </div>
+<div class="line"><a name="l03771"></a><span class="lineno"> 3771</span>   <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_lines_width"</span>;</div>
+<div class="line"><a name="l03772"></a><span class="lineno"> 3772</span> </div>
+<div class="line"><a name="l03773"></a><span class="lineno"> 3773</span>   <span class="keywordtype">double</span> *profile1 = cpl_calloc(length - 1, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l03774"></a><span class="lineno"> 3774</span>   <span class="keywordtype">double</span> *profile2 = cpl_calloc(length - 1, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l03775"></a><span class="lineno"> 3775</span> </div>
+<div class="line"><a name="l03776"></a><span class="lineno"> 3776</span>   <span class="keywordtype">double</span>  norm, value, max;</div>
+<div class="line"><a name="l03777"></a><span class="lineno"> 3777</span>   <span class="keywordtype">int</span>     radius = 20;</div>
+<div class="line"><a name="l03778"></a><span class="lineno"> 3778</span>   <span class="keywordtype">int</span>     short_length = length - 2*radius - 1;</div>
+<div class="line"><a name="l03779"></a><span class="lineno"> 3779</span>   <span class="keywordtype">int</span>     width;</div>
+<div class="line"><a name="l03780"></a><span class="lineno"> 3780</span>   <span class="keywordtype">int</span>     i, j, k;</div>
+<div class="line"><a name="l03781"></a><span class="lineno"> 3781</span> </div>
+<div class="line"><a name="l03782"></a><span class="lineno"> 3782</span> </div>
+<div class="line"><a name="l03783"></a><span class="lineno"> 3783</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l03784"></a><span class="lineno"> 3784</span> <span class="comment">   * Derivative, and separation of positive and negative derivatives</span></div>
+<div class="line"><a name="l03785"></a><span class="lineno"> 3785</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l03786"></a><span class="lineno"> 3786</span> </div>
+<div class="line"><a name="l03787"></a><span class="lineno"> 3787</span>   <span class="keywordflow">for</span> (j = 0, i = 1; i < length; j++, i++) {</div>
+<div class="line"><a name="l03788"></a><span class="lineno"> 3788</span>       profile1[j] = profile2[j] = spectrum[i] - spectrum[j];</div>
+<div class="line"><a name="l03789"></a><span class="lineno"> 3789</span>       <span class="keywordflow">if</span> (profile1[j] < 0)</div>
+<div class="line"><a name="l03790"></a><span class="lineno"> 3790</span>           profile1[j] = 0;</div>
+<div class="line"><a name="l03791"></a><span class="lineno"> 3791</span>       <span class="keywordflow">if</span> (profile2[j] > 0)</div>
+<div class="line"><a name="l03792"></a><span class="lineno"> 3792</span>           profile2[j] = 0;</div>
+<div class="line"><a name="l03793"></a><span class="lineno"> 3793</span>       <span class="keywordflow">else</span></div>
+<div class="line"><a name="l03794"></a><span class="lineno"> 3794</span>           profile2[j] = -profile2[j];</div>
+<div class="line"><a name="l03795"></a><span class="lineno"> 3795</span>   }</div>
+<div class="line"><a name="l03796"></a><span class="lineno"> 3796</span> </div>
+<div class="line"><a name="l03797"></a><span class="lineno"> 3797</span> </div>
+<div class="line"><a name="l03798"></a><span class="lineno"> 3798</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l03799"></a><span class="lineno"> 3799</span> <span class="comment">   * Profiles normalisation</span></div>
+<div class="line"><a name="l03800"></a><span class="lineno"> 3800</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l03801"></a><span class="lineno"> 3801</span> </div>
+<div class="line"><a name="l03802"></a><span class="lineno"> 3802</span>   length--;</div>
+<div class="line"><a name="l03803"></a><span class="lineno"> 3803</span> </div>
+<div class="line"><a name="l03804"></a><span class="lineno"> 3804</span>   norm = 0;</div>
+<div class="line"><a name="l03805"></a><span class="lineno"> 3805</span>   <span class="keywordflow">for</span> (i = 0; i < length; i++)</div>
+<div class="line"><a name="l03806"></a><span class="lineno"> 3806</span>       <span class="keywordflow">if</span> (norm < profile1[i])</div>
+<div class="line"><a name="l03807"></a><span class="lineno"> 3807</span>           norm = profile1[i];</div>
+<div class="line"><a name="l03808"></a><span class="lineno"> 3808</span> </div>
+<div class="line"><a name="l03809"></a><span class="lineno"> 3809</span>   <span class="keywordflow">for</span> (i = 0; i < length; i++) {</div>
+<div class="line"><a name="l03810"></a><span class="lineno"> 3810</span>       profile1[i] /= norm;</div>
+<div class="line"><a name="l03811"></a><span class="lineno"> 3811</span>       profile2[i] /= norm;</div>
+<div class="line"><a name="l03812"></a><span class="lineno"> 3812</span>   }</div>
+<div class="line"><a name="l03813"></a><span class="lineno"> 3813</span> </div>
+<div class="line"><a name="l03814"></a><span class="lineno"> 3814</span> </div>
+<div class="line"><a name="l03815"></a><span class="lineno"> 3815</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l03816"></a><span class="lineno"> 3816</span> <span class="comment">   * Cross-correlation</span></div>
+<div class="line"><a name="l03817"></a><span class="lineno"> 3817</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l03818"></a><span class="lineno"> 3818</span> </div>
+<div class="line"><a name="l03819"></a><span class="lineno"> 3819</span>   max = -1;</div>
+<div class="line"><a name="l03820"></a><span class="lineno"> 3820</span>   <span class="keywordflow">for</span> (i = 0; i <= radius; i++) {</div>
+<div class="line"><a name="l03821"></a><span class="lineno"> 3821</span>       value = 0;</div>
+<div class="line"><a name="l03822"></a><span class="lineno"> 3822</span>       <span class="keywordflow">for</span> (j = 0; j < short_length; j++) {</div>
+<div class="line"><a name="l03823"></a><span class="lineno"> 3823</span>           k = radius+j;</div>
+<div class="line"><a name="l03824"></a><span class="lineno"> 3824</span>           value += profile1[k] * profile2[k+i];</div>
+<div class="line"><a name="l03825"></a><span class="lineno"> 3825</span>       }</div>
+<div class="line"><a name="l03826"></a><span class="lineno"> 3826</span>       <span class="keywordflow">if</span> (max < value) {</div>
+<div class="line"><a name="l03827"></a><span class="lineno"> 3827</span>           max = value;</div>
+<div class="line"><a name="l03828"></a><span class="lineno"> 3828</span>           width = i;</div>
+<div class="line"><a name="l03829"></a><span class="lineno"> 3829</span>       }</div>
+<div class="line"><a name="l03830"></a><span class="lineno"> 3830</span>   }</div>
+<div class="line"><a name="l03831"></a><span class="lineno"> 3831</span> </div>
+<div class="line"><a name="l03832"></a><span class="lineno"> 3832</span>   cpl_free(profile1);</div>
+<div class="line"><a name="l03833"></a><span class="lineno"> 3833</span>   cpl_free(profile2);</div>
+<div class="line"><a name="l03834"></a><span class="lineno"> 3834</span> </div>
+<div class="line"><a name="l03835"></a><span class="lineno"> 3835</span>   <span class="keywordflow">if</span> (max < 0.0) {</div>
+<div class="line"><a name="l03836"></a><span class="lineno"> 3836</span>       cpl_msg_debug(func, <span class="stringliteral">"Cannot estimate line width"</span>);</div>
+<div class="line"><a name="l03837"></a><span class="lineno"> 3837</span>       width = 1;</div>
+<div class="line"><a name="l03838"></a><span class="lineno"> 3838</span>   }</div>
+<div class="line"><a name="l03839"></a><span class="lineno"> 3839</span> </div>
+<div class="line"><a name="l03840"></a><span class="lineno"> 3840</span>   <span class="keywordflow">return</span> width;</div>
+<div class="line"><a name="l03841"></a><span class="lineno"> 3841</span> </div>
+<div class="line"><a name="l03842"></a><span class="lineno"> 3842</span> }</div>
+<div class="line"><a name="l03843"></a><span class="lineno"> 3843</span> </div>
+<div class="line"><a name="l03844"></a><span class="lineno"> 3844</span> </div>
+<div class="line"><a name="l03871"></a><span class="lineno"><a class="code" href="group__moses.html#gad80729870e3acf9f61c820f488eb83b2"> 3871</a></span> cpl_vector *<a class="code" href="group__moses.html#gad80729870e3acf9f61c820f488eb83b2" title="Find positions of peaks candidates.">mos_peak_candidates</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *spectrum, </div>
+<div class="line"><a name="l03872"></a><span class="lineno"> 3872</span>                                 <span class="keywordtype">int</span> length, <span class="keywordtype">float</span> level, </div>
+<div class="line"><a name="l03873"></a><span class="lineno"> 3873</span>                                 <span class="keywordtype">float</span> exp_width)</div>
+<div class="line"><a name="l03874"></a><span class="lineno"> 3874</span> { </div>
+<div class="line"><a name="l03875"></a><span class="lineno"> 3875</span> </div>
+<div class="line"><a name="l03876"></a><span class="lineno"> 3876</span>   <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_peak_candidates"</span>;</div>
+<div class="line"><a name="l03877"></a><span class="lineno"> 3877</span> </div>
+<div class="line"><a name="l03878"></a><span class="lineno"> 3878</span>   <span class="keywordtype">int</span>     i, j;</div>
+<div class="line"><a name="l03879"></a><span class="lineno"> 3879</span>   <span class="keywordtype">int</span>     nint   = length - 1;</div>
+<div class="line"><a name="l03880"></a><span class="lineno"> 3880</span>   <span class="keywordtype">int</span>     n      = 0;</div>
+<div class="line"><a name="l03881"></a><span class="lineno"> 3881</span>   <span class="keywordtype">int</span>     width  = 2 * ceil(exp_width / 2) + 1;</div>
+<div class="line"><a name="l03882"></a><span class="lineno"> 3882</span>   <span class="keywordtype">int</span>     start  = width / 2;</div>
+<div class="line"><a name="l03883"></a><span class="lineno"> 3883</span>   <span class="keywordtype">int</span>     end    = length - width / 2;</div>
+<div class="line"><a name="l03884"></a><span class="lineno"> 3884</span>   <span class="keywordtype">int</span>     step;</div>
+<div class="line"><a name="l03885"></a><span class="lineno"> 3885</span>   <span class="keywordtype">float</span>  *smo;</div>
+<div class="line"><a name="l03886"></a><span class="lineno"> 3886</span>   <span class="keywordtype">double</span> *data   = cpl_calloc(length/2, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l03887"></a><span class="lineno"> 3887</span> </div>
+<div class="line"><a name="l03888"></a><span class="lineno"> 3888</span> </div>
+<div class="line"><a name="l03889"></a><span class="lineno"> 3889</span>   <span class="keywordflow">if</span> (spectrum == NULL) {</div>
+<div class="line"><a name="l03890"></a><span class="lineno"> 3890</span>       cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l03891"></a><span class="lineno"> 3891</span>       <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03892"></a><span class="lineno"> 3892</span>   }</div>
+<div class="line"><a name="l03893"></a><span class="lineno"> 3893</span> </div>
+<div class="line"><a name="l03894"></a><span class="lineno"> 3894</span> </div>
+<div class="line"><a name="l03895"></a><span class="lineno"> 3895</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l03896"></a><span class="lineno"> 3896</span> <span class="comment">   * If lines have a flat top (as in the case of broad slit), smooth</span></div>
+<div class="line"><a name="l03897"></a><span class="lineno"> 3897</span> <span class="comment">   * before determining the max.</span></div>
+<div class="line"><a name="l03898"></a><span class="lineno"> 3898</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l03899"></a><span class="lineno"> 3899</span> </div>
+<div class="line"><a name="l03900"></a><span class="lineno"> 3900</span>   <span class="keywordflow">if</span> (width > 7) {</div>
+<div class="line"><a name="l03901"></a><span class="lineno"> 3901</span>     smo = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));</div>
+<div class="line"><a name="l03902"></a><span class="lineno"> 3902</span>     start = width / 2;</div>
+<div class="line"><a name="l03903"></a><span class="lineno"> 3903</span>     end = length - width / 2;</div>
+<div class="line"><a name="l03904"></a><span class="lineno"> 3904</span>     <span class="keywordflow">for</span> (i = 0; i < start; i++)</div>
+<div class="line"><a name="l03905"></a><span class="lineno"> 3905</span>       smo[i] = spectrum[i];</div>
+<div class="line"><a name="l03906"></a><span class="lineno"> 3906</span>     <span class="keywordflow">for</span> (i = start; i < end; i++) {</div>
+<div class="line"><a name="l03907"></a><span class="lineno"> 3907</span>       <span class="keywordflow">for</span> (j = i - start; j <= i + start; j++)</div>
+<div class="line"><a name="l03908"></a><span class="lineno"> 3908</span>         smo[i] += spectrum[j];</div>
+<div class="line"><a name="l03909"></a><span class="lineno"> 3909</span>       smo[i] /= width;</div>
+<div class="line"><a name="l03910"></a><span class="lineno"> 3910</span>     }</div>
+<div class="line"><a name="l03911"></a><span class="lineno"> 3911</span>     <span class="keywordflow">for</span> (i = end; i < length; i++)</div>
+<div class="line"><a name="l03912"></a><span class="lineno"> 3912</span>       smo[i] = spectrum[i];</div>
+<div class="line"><a name="l03913"></a><span class="lineno"> 3913</span>   }</div>
+<div class="line"><a name="l03914"></a><span class="lineno"> 3914</span>   <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l03915"></a><span class="lineno"> 3915</span>       smo = (<span class="keywordtype">float</span> *)spectrum;</div>
+<div class="line"><a name="l03916"></a><span class="lineno"> 3916</span>   }</div>
+<div class="line"><a name="l03917"></a><span class="lineno"> 3917</span> </div>
+<div class="line"><a name="l03918"></a><span class="lineno"> 3918</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l03919"></a><span class="lineno"> 3919</span> <span class="comment">   * Collect all relative maxima along spectrum, that are higher than the</span></div>
+<div class="line"><a name="l03920"></a><span class="lineno"> 3920</span> <span class="comment">   * specified level.</span></div>
+<div class="line"><a name="l03921"></a><span class="lineno"> 3921</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l03922"></a><span class="lineno"> 3922</span> </div>
+<div class="line"><a name="l03923"></a><span class="lineno"> 3923</span>   <span class="keywordflow">if</span> (width > 20)</div>
+<div class="line"><a name="l03924"></a><span class="lineno"> 3924</span>     step = width / 2;</div>
+<div class="line"><a name="l03925"></a><span class="lineno"> 3925</span>   <span class="keywordflow">else</span></div>
+<div class="line"><a name="l03926"></a><span class="lineno"> 3926</span>     step = 1;</div>
+<div class="line"><a name="l03927"></a><span class="lineno"> 3927</span> </div>
+<div class="line"><a name="l03928"></a><span class="lineno"> 3928</span>   <span class="keywordflow">for</span> (i = step; i < nint - step + 1; i += step) {</div>
+<div class="line"><a name="l03929"></a><span class="lineno"> 3929</span>     <span class="keywordflow">if</span> (smo[i] > level) {</div>
+<div class="line"><a name="l03930"></a><span class="lineno"> 3930</span>       <span class="keywordflow">if</span> (smo[i] >= smo[i-step] && smo[i] > smo[i+step]) {</div>
+<div class="line"><a name="l03931"></a><span class="lineno"> 3931</span>         <span class="keywordflow">if</span> (smo[i-step] != 0.0 && smo[i+step] != 0.0) {</div>
+<div class="line"><a name="l03932"></a><span class="lineno"> 3932</span>           data[n] = i + step * values_to_dx(smo[i-step], smo[i], smo[i+step]);</div>
+<div class="line"><a name="l03933"></a><span class="lineno"> 3933</span>           ++n;</div>
+<div class="line"><a name="l03934"></a><span class="lineno"> 3934</span>         }</div>
+<div class="line"><a name="l03935"></a><span class="lineno"> 3935</span>       }</div>
+<div class="line"><a name="l03936"></a><span class="lineno"> 3936</span>     }</div>
+<div class="line"><a name="l03937"></a><span class="lineno"> 3937</span>   }</div>
+<div class="line"><a name="l03938"></a><span class="lineno"> 3938</span> </div>
+<div class="line"><a name="l03939"></a><span class="lineno"> 3939</span>   <span class="keywordflow">if</span> (width > 7) {</div>
+<div class="line"><a name="l03940"></a><span class="lineno"> 3940</span>     cpl_free(smo);</div>
+<div class="line"><a name="l03941"></a><span class="lineno"> 3941</span>   }</div>
+<div class="line"><a name="l03942"></a><span class="lineno"> 3942</span> </div>
+<div class="line"><a name="l03943"></a><span class="lineno"> 3943</span>   <span class="keywordflow">if</span> (n == 0) {</div>
+<div class="line"><a name="l03944"></a><span class="lineno"> 3944</span>     cpl_free(data);</div>
+<div class="line"><a name="l03945"></a><span class="lineno"> 3945</span>     <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03946"></a><span class="lineno"> 3946</span>   }</div>
+<div class="line"><a name="l03947"></a><span class="lineno"> 3947</span> </div>
+<div class="line"><a name="l03948"></a><span class="lineno"> 3948</span>   <span class="keywordflow">return</span> cpl_vector_wrap(n, data);</div>
+<div class="line"><a name="l03949"></a><span class="lineno"> 3949</span> </div>
+<div class="line"><a name="l03950"></a><span class="lineno"> 3950</span> }</div>
+<div class="line"><a name="l03951"></a><span class="lineno"> 3951</span> </div>
+<div class="line"><a name="l03952"></a><span class="lineno"> 3952</span> </div>
+<div class="line"><a name="l03974"></a><span class="lineno"><a class="code" href="group__moses.html#gacfa971d995aac0c8f05c37499861d191"> 3974</a></span> cpl_vector *<a class="code" href="group__moses.html#gacfa971d995aac0c8f05c37499861d191" title="Improve (when possible) accuracy of peaks candidates positions.">mos_refine_peaks</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *spectrum, <span class="keywordtype">int</span> length, </div>
+<div class="line"><a name="l03975"></a><span class="lineno"> 3975</span>                              cpl_vector *peaks, <span class="keywordtype">int</span> sradius)</div>
+<div class="line"><a name="l03976"></a><span class="lineno"> 3976</span> {</div>
+<div class="line"><a name="l03977"></a><span class="lineno"> 3977</span> </div>
+<div class="line"><a name="l03978"></a><span class="lineno"> 3978</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_refine_peaks"</span>;</div>
+<div class="line"><a name="l03979"></a><span class="lineno"> 3979</span> </div>
+<div class="line"><a name="l03980"></a><span class="lineno"> 3980</span>     <span class="keywordtype">double</span> *data;</div>
+<div class="line"><a name="l03981"></a><span class="lineno"> 3981</span>     <span class="keywordtype">float</span>   pos;</div>
+<div class="line"><a name="l03982"></a><span class="lineno"> 3982</span>     <span class="keywordtype">int</span>     npeaks;</div>
+<div class="line"><a name="l03983"></a><span class="lineno"> 3983</span>     <span class="keywordtype">int</span>     startPos, endPos;</div>
+<div class="line"><a name="l03984"></a><span class="lineno"> 3984</span>     <span class="keywordtype">int</span>     window = 2*sradius+1;</div>
+<div class="line"><a name="l03985"></a><span class="lineno"> 3985</span>     <span class="keywordtype">int</span>     i, j;</div>
+<div class="line"><a name="l03986"></a><span class="lineno"> 3986</span> </div>
+<div class="line"><a name="l03987"></a><span class="lineno"> 3987</span> </div>
+<div class="line"><a name="l03988"></a><span class="lineno"> 3988</span>     <span class="keywordflow">if</span> (peaks == NULL || spectrum == NULL) {</div>
+<div class="line"><a name="l03989"></a><span class="lineno"> 3989</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l03990"></a><span class="lineno"> 3990</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l03991"></a><span class="lineno"> 3991</span>     }</div>
+<div class="line"><a name="l03992"></a><span class="lineno"> 3992</span> </div>
+<div class="line"><a name="l03993"></a><span class="lineno"> 3993</span>     npeaks = cpl_vector_get_size(peaks);</div>
+<div class="line"><a name="l03994"></a><span class="lineno"> 3994</span>     data = cpl_vector_unwrap(peaks);</div>
+<div class="line"><a name="l03995"></a><span class="lineno"> 3995</span> </div>
+<div class="line"><a name="l03996"></a><span class="lineno"> 3996</span>     <span class="keywordflow">for</span> (i = 0; i < npeaks; i++) {</div>
+<div class="line"><a name="l03997"></a><span class="lineno"> 3997</span>         startPos = data[i] - window/2;</div>
+<div class="line"><a name="l03998"></a><span class="lineno"> 3998</span>         endPos   = startPos + window;</div>
+<div class="line"><a name="l03999"></a><span class="lineno"> 3999</span>         <span class="keywordflow">if</span> (startPos < 0 || endPos >= length)</div>
+<div class="line"><a name="l04000"></a><span class="lineno"> 4000</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l04001"></a><span class="lineno"> 4001</span> </div>
+<div class="line"><a name="l04002"></a><span class="lineno"> 4002</span>         <span class="keywordflow">if</span> (0 == peakPosition(spectrum + startPos, window, &pos, 1)) {</div>
+<div class="line"><a name="l04003"></a><span class="lineno"> 4003</span>             pos += startPos;</div>
+<div class="line"><a name="l04004"></a><span class="lineno"> 4004</span>             data[i] = pos;</div>
+<div class="line"><a name="l04005"></a><span class="lineno"> 4005</span>         }</div>
+<div class="line"><a name="l04006"></a><span class="lineno"> 4006</span>     }</div>
+<div class="line"><a name="l04007"></a><span class="lineno"> 4007</span> </div>
+<div class="line"><a name="l04008"></a><span class="lineno"> 4008</span>     <span class="keywordflow">for</span> (i = 1; i < npeaks; i++)</div>
+<div class="line"><a name="l04009"></a><span class="lineno"> 4009</span>         <span class="keywordflow">if</span> (data[i] - data[i-1] < 0.5)</div>
+<div class="line"><a name="l04010"></a><span class="lineno"> 4010</span>             data[i-1] = -1.0;</div>
+<div class="line"><a name="l04011"></a><span class="lineno"> 4011</span> </div>
+<div class="line"><a name="l04012"></a><span class="lineno"> 4012</span>     <span class="keywordflow">for</span> (i = 0, j = 0; i < npeaks; i++) {</div>
+<div class="line"><a name="l04013"></a><span class="lineno"> 4013</span>         <span class="keywordflow">if</span> (data[i] > 0.0) {</div>
+<div class="line"><a name="l04014"></a><span class="lineno"> 4014</span>             <span class="keywordflow">if</span> (i != j)</div>
+<div class="line"><a name="l04015"></a><span class="lineno"> 4015</span>                 data[j] = data[i];</div>
+<div class="line"><a name="l04016"></a><span class="lineno"> 4016</span>             j++;</div>
+<div class="line"><a name="l04017"></a><span class="lineno"> 4017</span>         }</div>
+<div class="line"><a name="l04018"></a><span class="lineno"> 4018</span>     }</div>
+<div class="line"><a name="l04019"></a><span class="lineno"> 4019</span> </div>
+<div class="line"><a name="l04020"></a><span class="lineno"> 4020</span>     <span class="keywordflow">return</span> cpl_vector_wrap(j, data);</div>
+<div class="line"><a name="l04021"></a><span class="lineno"> 4021</span> </div>
+<div class="line"><a name="l04022"></a><span class="lineno"> 4022</span> }</div>
+<div class="line"><a name="l04023"></a><span class="lineno"> 4023</span> </div>
+<div class="line"><a name="l04024"></a><span class="lineno"> 4024</span> </div>
+<div class="line"><a name="l04025"></a><span class="lineno"> 4025</span> <span class="keywordtype">void</span> mos_set_multiplex(<span class="keywordtype">int</span> multiplex)</div>
+<div class="line"><a name="l04026"></a><span class="lineno"> 4026</span> {</div>
+<div class="line"><a name="l04027"></a><span class="lineno"> 4027</span>     mos_multiplex = multiplex;</div>
+<div class="line"><a name="l04028"></a><span class="lineno"> 4028</span> }</div>
+<div class="line"><a name="l04029"></a><span class="lineno"> 4029</span> </div>
+<div class="line"><a name="l04083"></a><span class="lineno"><a class="code" href="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97"> 4083</a></span> cpl_bivector *<a class="code" href="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97" title="Identify peak candidates.">mos_identify_peaks</a>(cpl_vector *peaks, cpl_vector *lines,</div>
+<div class="line"><a name="l04084"></a><span class="lineno"> 4084</span>                                  <span class="keywordtype">double</span> min_disp, <span class="keywordtype">double</span> max_disp,</div>
+<div class="line"><a name="l04085"></a><span class="lineno"> 4085</span>                                  <span class="keywordtype">double</span> tolerance)</div>
+<div class="line"><a name="l04086"></a><span class="lineno"> 4086</span> {</div>
+<div class="line"><a name="l04087"></a><span class="lineno"> 4087</span> </div>
+<div class="line"><a name="l04088"></a><span class="lineno"> 4088</span>   <span class="keywordtype">int</span>      i, j, k, l;</div>
+<div class="line"><a name="l04089"></a><span class="lineno"> 4089</span>   <span class="keywordtype">int</span>      nlint, npint;</div>
+<div class="line"><a name="l04090"></a><span class="lineno"> 4090</span>   <span class="keywordtype">int</span>      minpos;</div>
+<div class="line"><a name="l04091"></a><span class="lineno"> 4091</span>   <span class="keywordtype">float</span>    min;</div>
+<div class="line"><a name="l04092"></a><span class="lineno"> 4092</span>   <span class="keywordtype">double</span>   lratio, pratio;</div>
+<div class="line"><a name="l04093"></a><span class="lineno"> 4093</span>   <span class="keywordtype">double</span>   lo_start, lo_end, hi_start, hi_end, denom;</div>
+<div class="line"><a name="l04094"></a><span class="lineno"> 4094</span>   <span class="keywordtype">double</span>   disp, variation, prev_variation;</div>
+<div class="line"><a name="l04095"></a><span class="lineno"> 4095</span>   <span class="keywordtype">int</span>      max, maxpos, minl, mink;</div>
+<div class="line"><a name="l04096"></a><span class="lineno"> 4096</span>   <span class="keywordtype">int</span>      ambiguous;</div>
+<div class="line"><a name="l04097"></a><span class="lineno"> 4097</span>   <span class="keywordtype">int</span>      npeaks_lo, npeaks_hi;</div>
+<div class="line"><a name="l04098"></a><span class="lineno"> 4098</span>   <span class="keywordtype">int</span>     *peak_lo;</div>
+<div class="line"><a name="l04099"></a><span class="lineno"> 4099</span>   <span class="keywordtype">int</span>     *peak_hi;</div>
+<div class="line"><a name="l04100"></a><span class="lineno"> 4100</span>   <span class="keywordtype">int</span>    **ident;</div>
+<div class="line"><a name="l04101"></a><span class="lineno"> 4101</span>   <span class="keywordtype">int</span>     *nident;</div>
+<div class="line"><a name="l04102"></a><span class="lineno"> 4102</span>   <span class="keywordtype">int</span>     *lident;</div>
+<div class="line"><a name="l04103"></a><span class="lineno"> 4103</span> </div>
+<div class="line"><a name="l04104"></a><span class="lineno"> 4104</span>   <span class="keywordtype">double</span>  *peak;</div>
+<div class="line"><a name="l04105"></a><span class="lineno"> 4105</span>   <span class="keywordtype">double</span>  *line;</div>
+<div class="line"><a name="l04106"></a><span class="lineno"> 4106</span>   <span class="keywordtype">int</span>      npeaks, nlines;</div>
+<div class="line"><a name="l04107"></a><span class="lineno"> 4107</span> </div>
+<div class="line"><a name="l04108"></a><span class="lineno"> 4108</span>   <span class="keywordtype">double</span>  *xpos;</div>
+<div class="line"><a name="l04109"></a><span class="lineno"> 4109</span>   <span class="keywordtype">double</span>  *lambda;</div>
+<div class="line"><a name="l04110"></a><span class="lineno"> 4110</span>   <span class="keywordtype">int</span>     *ilambda;</div>
+<div class="line"><a name="l04111"></a><span class="lineno"> 4111</span>   <span class="keywordtype">double</span>  *tmp_xpos;</div>
+<div class="line"><a name="l04112"></a><span class="lineno"> 4112</span>   <span class="keywordtype">double</span>  *tmp_lambda;</div>
+<div class="line"><a name="l04113"></a><span class="lineno"> 4113</span>   <span class="keywordtype">int</span>     *tmp_ilambda;</div>
+<div class="line"><a name="l04114"></a><span class="lineno"> 4114</span>   <span class="keywordtype">int</span>     *flag;</div>
+<div class="line"><a name="l04115"></a><span class="lineno"> 4115</span>   <span class="keywordtype">int</span>      n = 0;</div>
+<div class="line"><a name="l04116"></a><span class="lineno"> 4116</span>   <span class="keywordtype">int</span>      nn;</div>
+<div class="line"><a name="l04117"></a><span class="lineno"> 4117</span>   <span class="keywordtype">int</span>      nseq = 0;</div>
+<div class="line"><a name="l04118"></a><span class="lineno"> 4118</span>   <span class="keywordtype">int</span>      gap;</div>
+<div class="line"><a name="l04119"></a><span class="lineno"> 4119</span>   <span class="keywordtype">int</span>     *seq_length;</div>
+<div class="line"><a name="l04120"></a><span class="lineno"> 4120</span>   <span class="keywordtype">int</span>      found;</div>
+<div class="line"><a name="l04121"></a><span class="lineno"> 4121</span> </div>
+<div class="line"><a name="l04122"></a><span class="lineno"> 4122</span>   peak        = cpl_vector_get_data(peaks);</div>
+<div class="line"><a name="l04123"></a><span class="lineno"> 4123</span>   npeaks      = cpl_vector_get_size(peaks);</div>
+<div class="line"><a name="l04124"></a><span class="lineno"> 4124</span>   line        = cpl_vector_get_data(lines);</div>
+<div class="line"><a name="l04125"></a><span class="lineno"> 4125</span>   nlines      = cpl_vector_get_size(lines);</div>
+<div class="line"><a name="l04126"></a><span class="lineno"> 4126</span> </div>
+<div class="line"><a name="l04127"></a><span class="lineno"> 4127</span>   <span class="keywordflow">if</span> (npeaks < 4)</div>
+<div class="line"><a name="l04128"></a><span class="lineno"> 4128</span>       <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l04129"></a><span class="lineno"> 4129</span> </div>
+<div class="line"><a name="l04130"></a><span class="lineno"> 4130</span>   peak_lo     = cpl_malloc(npeaks * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l04131"></a><span class="lineno"> 4131</span>   peak_hi     = cpl_malloc(npeaks * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l04132"></a><span class="lineno"> 4132</span>   nident      = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l04133"></a><span class="lineno"> 4133</span>   lident      = cpl_calloc(nlines, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l04134"></a><span class="lineno"> 4134</span>   xpos        = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l04135"></a><span class="lineno"> 4135</span>   lambda      = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l04136"></a><span class="lineno"> 4136</span>   ilambda     = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l04137"></a><span class="lineno"> 4137</span>   tmp_xpos    = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l04138"></a><span class="lineno"> 4138</span>   tmp_lambda  = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l04139"></a><span class="lineno"> 4139</span>   tmp_ilambda = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l04140"></a><span class="lineno"> 4140</span>   flag        = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l04141"></a><span class="lineno"> 4141</span>   seq_length  = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l04142"></a><span class="lineno"> 4142</span>   ident       = cpl_malloc(npeaks * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span> *));</div>
+<div class="line"><a name="l04143"></a><span class="lineno"> 4143</span>   <span class="keywordflow">for</span> (i = 0; i < npeaks; i++)</div>
+<div class="line"><a name="l04144"></a><span class="lineno"> 4144</span>     ident[i]  = cpl_malloc(3 * npeaks * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l04145"></a><span class="lineno"> 4145</span> </div>
+<div class="line"><a name="l04146"></a><span class="lineno"> 4146</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l04147"></a><span class="lineno"> 4147</span> <span class="comment">   * This is just the number of intervals - one less than the number</span></div>
+<div class="line"><a name="l04148"></a><span class="lineno"> 4148</span> <span class="comment">   * of points (catalog wavelengths, or detected peaks).</span></div>
+<div class="line"><a name="l04149"></a><span class="lineno"> 4149</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l04150"></a><span class="lineno"> 4150</span> </div>
+<div class="line"><a name="l04151"></a><span class="lineno"> 4151</span>   nlint = nlines - 1;</div>
+<div class="line"><a name="l04152"></a><span class="lineno"> 4152</span>   npint = npeaks - 1;</div>
+<div class="line"><a name="l04153"></a><span class="lineno"> 4153</span> </div>
+<div class="line"><a name="l04154"></a><span class="lineno"> 4154</span> </div>
+<div class="line"><a name="l04155"></a><span class="lineno"> 4155</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l04156"></a><span class="lineno"> 4156</span> <span class="comment">   * Here the big loops on catalog lines begins.</span></div>
+<div class="line"><a name="l04157"></a><span class="lineno"> 4157</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l04158"></a><span class="lineno"> 4158</span> </div>
+<div class="line"><a name="l04159"></a><span class="lineno"> 4159</span>   <span class="keywordflow">for</span> (i = 1; i < nlint; i++) {</div>
+<div class="line"><a name="l04160"></a><span class="lineno"> 4160</span> </div>
+<div class="line"><a name="l04161"></a><span class="lineno"> 4161</span> </div>
+<div class="line"><a name="l04162"></a><span class="lineno"> 4162</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04163"></a><span class="lineno"> 4163</span> <span class="comment">     * For each catalog wavelength I take the previous and the next one, </span></div>
+<div class="line"><a name="l04164"></a><span class="lineno"> 4164</span> <span class="comment">     * and compute the ratio of the corresponding wavelength intervals.</span></div>
+<div class="line"><a name="l04165"></a><span class="lineno"> 4165</span> <span class="comment">     * This ratio will be compared to all the ratios obtained doing the</span></div>
+<div class="line"><a name="l04166"></a><span class="lineno"> 4166</span> <span class="comment">     * same with all the detected peaks positions.</span></div>
+<div class="line"><a name="l04167"></a><span class="lineno"> 4167</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04168"></a><span class="lineno"> 4168</span> </div>
+<div class="line"><a name="l04169"></a><span class="lineno"> 4169</span>     lratio = (line[i+1] - line[i]) / (line[i] - line[i-1]);</div>
+<div class="line"><a name="l04170"></a><span class="lineno"> 4170</span> </div>
+<div class="line"><a name="l04171"></a><span class="lineno"> 4171</span> </div>
+<div class="line"><a name="l04172"></a><span class="lineno"> 4172</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04173"></a><span class="lineno"> 4173</span> <span class="comment">     * Here the loop on detected peaks positions begins.</span></div>
+<div class="line"><a name="l04174"></a><span class="lineno"> 4174</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04175"></a><span class="lineno"> 4175</span> </div>
+<div class="line"><a name="l04176"></a><span class="lineno"> 4176</span>     <span class="keywordflow">for</span> (j = 1; j < npint; j++) {</div>
+<div class="line"><a name="l04177"></a><span class="lineno"> 4177</span> </div>
+<div class="line"><a name="l04178"></a><span class="lineno"> 4178</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04179"></a><span class="lineno"> 4179</span> <span class="comment">       * Not all peaks are used for computing ratios: just the ones</span></div>
+<div class="line"><a name="l04180"></a><span class="lineno"> 4180</span> <span class="comment">       * that are compatible with the expected spectral dispersion</span></div>
+<div class="line"><a name="l04181"></a><span class="lineno"> 4181</span> <span class="comment">       * are taken into consideration. Therefore, I define the pixel</span></div>
+<div class="line"><a name="l04182"></a><span class="lineno"> 4182</span> <span class="comment">       * intervals before and after any peak that are compatible with</span></div>
+<div class="line"><a name="l04183"></a><span class="lineno"> 4183</span> <span class="comment">       * the specified dispersion interval, and select just the peaks</span></div>
+<div class="line"><a name="l04184"></a><span class="lineno"> 4184</span> <span class="comment">       * within such intervals. If either of the two intervals doesn't</span></div>
+<div class="line"><a name="l04185"></a><span class="lineno"> 4185</span> <span class="comment">       * contain any peak, then I skip the current peak and continue</span></div>
+<div class="line"><a name="l04186"></a><span class="lineno"> 4186</span> <span class="comment">       * with the next.</span></div>
+<div class="line"><a name="l04187"></a><span class="lineno"> 4187</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04188"></a><span class="lineno"> 4188</span> </div>
+<div class="line"><a name="l04189"></a><span class="lineno"> 4189</span>       lo_start = peak[j] - (line[i] - line[i-1]) / min_disp;</div>
+<div class="line"><a name="l04190"></a><span class="lineno"> 4190</span>       lo_end   = peak[j] - (line[i] - line[i-1]) / max_disp;</div>
+<div class="line"><a name="l04191"></a><span class="lineno"> 4191</span>       hi_start = peak[j] + (line[i+1] - line[i]) / max_disp;</div>
+<div class="line"><a name="l04192"></a><span class="lineno"> 4192</span>       hi_end   = peak[j] + (line[i+1] - line[i]) / min_disp;</div>
+<div class="line"><a name="l04193"></a><span class="lineno"> 4193</span> </div>
+<div class="line"><a name="l04194"></a><span class="lineno"> 4194</span>       <span class="keywordflow">for</span> (npeaks_lo = 0, k = 0; k < npeaks; k++) {</div>
+<div class="line"><a name="l04195"></a><span class="lineno"> 4195</span>         <span class="keywordflow">if</span> (peak[k] > lo_end)</div>
+<div class="line"><a name="l04196"></a><span class="lineno"> 4196</span>           <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l04197"></a><span class="lineno"> 4197</span>         <span class="keywordflow">if</span> (peak[k] > lo_start) {</div>
+<div class="line"><a name="l04198"></a><span class="lineno"> 4198</span>           peak_lo[npeaks_lo] = k;</div>
+<div class="line"><a name="l04199"></a><span class="lineno"> 4199</span>           ++npeaks_lo;</div>
+<div class="line"><a name="l04200"></a><span class="lineno"> 4200</span>         }</div>
+<div class="line"><a name="l04201"></a><span class="lineno"> 4201</span>       }</div>
+<div class="line"><a name="l04202"></a><span class="lineno"> 4202</span> </div>
+<div class="line"><a name="l04203"></a><span class="lineno"> 4203</span>       <span class="keywordflow">if</span> (npeaks_lo == 0)</div>
+<div class="line"><a name="l04204"></a><span class="lineno"> 4204</span>         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l04205"></a><span class="lineno"> 4205</span> </div>
+<div class="line"><a name="l04206"></a><span class="lineno"> 4206</span>       <span class="keywordflow">for</span> (npeaks_hi = 0, k = 0; k < npeaks; k++) {</div>
+<div class="line"><a name="l04207"></a><span class="lineno"> 4207</span>         <span class="keywordflow">if</span> (peak[k] > hi_end)</div>
+<div class="line"><a name="l04208"></a><span class="lineno"> 4208</span>           <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l04209"></a><span class="lineno"> 4209</span>         <span class="keywordflow">if</span> (peak[k] > hi_start) {</div>
+<div class="line"><a name="l04210"></a><span class="lineno"> 4210</span>           peak_hi[npeaks_hi] = k;</div>
+<div class="line"><a name="l04211"></a><span class="lineno"> 4211</span>           ++npeaks_hi;</div>
+<div class="line"><a name="l04212"></a><span class="lineno"> 4212</span>         }</div>
+<div class="line"><a name="l04213"></a><span class="lineno"> 4213</span>       }</div>
+<div class="line"><a name="l04214"></a><span class="lineno"> 4214</span> </div>
+<div class="line"><a name="l04215"></a><span class="lineno"> 4215</span>       <span class="keywordflow">if</span> (npeaks_hi == 0)</div>
+<div class="line"><a name="l04216"></a><span class="lineno"> 4216</span>         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l04217"></a><span class="lineno"> 4217</span> </div>
+<div class="line"><a name="l04218"></a><span class="lineno"> 4218</span> </div>
+<div class="line"><a name="l04219"></a><span class="lineno"> 4219</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04220"></a><span class="lineno"> 4220</span> <span class="comment">       * Now I have all peaks that may help for a local identification.</span></div>
+<div class="line"><a name="l04221"></a><span class="lineno"> 4221</span> <span class="comment">       * peak_lo[k] is the sequence number of the k-th peak of the lower</span></div>
+<div class="line"><a name="l04222"></a><span class="lineno"> 4222</span> <span class="comment">       * interval; peak_hi[l] is the sequence number of the l-th peak of</span></div>
+<div class="line"><a name="l04223"></a><span class="lineno"> 4223</span> <span class="comment">       * the higher interval. j is, of course, the sequence number of the</span></div>
+<div class="line"><a name="l04224"></a><span class="lineno"> 4224</span> <span class="comment">       * current peak (second big loop).</span></div>
+<div class="line"><a name="l04225"></a><span class="lineno"> 4225</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04226"></a><span class="lineno"> 4226</span> </div>
+<div class="line"><a name="l04227"></a><span class="lineno"> 4227</span>       prev_variation = 1000.0;</div>
+<div class="line"><a name="l04228"></a><span class="lineno"> 4228</span>       minl = mink = 0;</div>
+<div class="line"><a name="l04229"></a><span class="lineno"> 4229</span> </div>
+<div class="line"><a name="l04230"></a><span class="lineno"> 4230</span>       <span class="keywordflow">for</span> (k = 0; k < npeaks_lo; k++) {</div>
+<div class="line"><a name="l04231"></a><span class="lineno"> 4231</span>         denom = peak[j] - peak[peak_lo[k]];</div>
+<div class="line"><a name="l04232"></a><span class="lineno"> 4232</span>         <span class="keywordflow">for</span> (l = 0; l < npeaks_hi; l++) {</div>
+<div class="line"><a name="l04233"></a><span class="lineno"> 4233</span> </div>
+<div class="line"><a name="l04234"></a><span class="lineno"> 4234</span>           <span class="comment">/*</span></div>
+<div class="line"><a name="l04235"></a><span class="lineno"> 4235</span> <span class="comment">           * For any pair of peaks - one from the lower and the other</span></div>
+<div class="line"><a name="l04236"></a><span class="lineno"> 4236</span> <span class="comment">           * from the higher interval - I compute the same ratio that</span></div>
+<div class="line"><a name="l04237"></a><span class="lineno"> 4237</span> <span class="comment">           * was computed with the current line catalog wavelength.</span></div>
+<div class="line"><a name="l04238"></a><span class="lineno"> 4238</span> <span class="comment">           */</span></div>
+<div class="line"><a name="l04239"></a><span class="lineno"> 4239</span> </div>
+<div class="line"><a name="l04240"></a><span class="lineno"> 4240</span>           pratio = (peak[peak_hi[l]] - peak[j]) / denom;</div>
+<div class="line"><a name="l04241"></a><span class="lineno"> 4241</span> </div>
+<div class="line"><a name="l04242"></a><span class="lineno"> 4242</span>           <span class="comment">/*</span></div>
+<div class="line"><a name="l04243"></a><span class="lineno"> 4243</span> <span class="comment">           * If the two ratios are compatible within the specified</span></div>
+<div class="line"><a name="l04244"></a><span class="lineno"> 4244</span> <span class="comment">           * tolerance, we have a preliminary identification. This</span></div>
+<div class="line"><a name="l04245"></a><span class="lineno"> 4245</span> <span class="comment">           * will be marked in the matrix ident[][], where the first</span></div>
+<div class="line"><a name="l04246"></a><span class="lineno"> 4246</span> <span class="comment">           * index corresponds to a peak sequence number, and the second</span></div>
+<div class="line"><a name="l04247"></a><span class="lineno"> 4247</span> <span class="comment">           * index is the counter of the identifications made during</span></div>
+<div class="line"><a name="l04248"></a><span class="lineno"> 4248</span> <span class="comment">           * this whole process. The array of counters is nident[].</span></div>
+<div class="line"><a name="l04249"></a><span class="lineno"> 4249</span> <span class="comment">           * If more than one interval pair fulfills the specified</span></div>
+<div class="line"><a name="l04250"></a><span class="lineno"> 4250</span> <span class="comment">           * tolerance, the closest to the expected ratio is selected.</span></div>
+<div class="line"><a name="l04251"></a><span class="lineno"> 4251</span> <span class="comment">           */</span></div>
+<div class="line"><a name="l04252"></a><span class="lineno"> 4252</span> </div>
+<div class="line"><a name="l04253"></a><span class="lineno"> 4253</span>           variation = fabs(lratio-pratio) / pratio;</div>
+<div class="line"><a name="l04254"></a><span class="lineno"> 4254</span> </div>
+<div class="line"><a name="l04255"></a><span class="lineno"> 4255</span>           <span class="keywordflow">if</span> (variation < tolerance) {</div>
+<div class="line"><a name="l04256"></a><span class="lineno"> 4256</span>             <span class="keywordflow">if</span> (variation < prev_variation) {</div>
+<div class="line"><a name="l04257"></a><span class="lineno"> 4257</span>               prev_variation = variation;</div>
+<div class="line"><a name="l04258"></a><span class="lineno"> 4258</span>               minl = l;</div>
+<div class="line"><a name="l04259"></a><span class="lineno"> 4259</span>               mink = k;</div>
+<div class="line"><a name="l04260"></a><span class="lineno"> 4260</span>             }</div>
+<div class="line"><a name="l04261"></a><span class="lineno"> 4261</span>           }</div>
+<div class="line"><a name="l04262"></a><span class="lineno"> 4262</span>         }</div>
+<div class="line"><a name="l04263"></a><span class="lineno"> 4263</span>       }</div>
+<div class="line"><a name="l04264"></a><span class="lineno"> 4264</span>       <span class="keywordflow">if</span> (prev_variation < tolerance) {</div>
+<div class="line"><a name="l04265"></a><span class="lineno"> 4265</span>         ident[j][nident[j]]                         = i;</div>
+<div class="line"><a name="l04266"></a><span class="lineno"> 4266</span>         ident[peak_hi[minl]][nident[peak_hi[minl]]] = i + 1;</div>
+<div class="line"><a name="l04267"></a><span class="lineno"> 4267</span>         ident[peak_lo[mink]][nident[peak_lo[mink]]] = i - 1;</div>
+<div class="line"><a name="l04268"></a><span class="lineno"> 4268</span>         ++nident[j];</div>
+<div class="line"><a name="l04269"></a><span class="lineno"> 4269</span>         ++nident[peak_hi[minl]];</div>
+<div class="line"><a name="l04270"></a><span class="lineno"> 4270</span>         ++nident[peak_lo[mink]];</div>
+<div class="line"><a name="l04271"></a><span class="lineno"> 4271</span>       }</div>
+<div class="line"><a name="l04272"></a><span class="lineno"> 4272</span>     }   <span class="comment">/* End loop on positions */</span></div>
+<div class="line"><a name="l04273"></a><span class="lineno"> 4273</span>   }    <span class="comment">/* End loop on lines     */</span></div>
+<div class="line"><a name="l04274"></a><span class="lineno"> 4274</span> </div>
+<div class="line"><a name="l04275"></a><span class="lineno"> 4275</span> </div>
+<div class="line"><a name="l04276"></a><span class="lineno"> 4276</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l04277"></a><span class="lineno"> 4277</span> <span class="comment">   * At this point I have filled the ident matrix with all my preliminary</span></div>
+<div class="line"><a name="l04278"></a><span class="lineno"> 4278</span> <span class="comment">   * identifications. Ambiguous identifications must be eliminated.</span></div>
+<div class="line"><a name="l04279"></a><span class="lineno"> 4279</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l04280"></a><span class="lineno"> 4280</span> </div>
+<div class="line"><a name="l04281"></a><span class="lineno"> 4281</span> </div>
+<div class="line"><a name="l04282"></a><span class="lineno"> 4282</span>   <span class="keywordflow">for</span> (i = 0; i < npeaks; i++) {</div>
+<div class="line"><a name="l04283"></a><span class="lineno"> 4283</span> </div>
+<div class="line"><a name="l04284"></a><span class="lineno"> 4284</span> </div>
+<div class="line"><a name="l04285"></a><span class="lineno"> 4285</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04286"></a><span class="lineno"> 4286</span> <span class="comment">     * I don't take into consideration peaks that were never identified.</span></div>
+<div class="line"><a name="l04287"></a><span class="lineno"> 4287</span> <span class="comment">     * They are likely contaminations, or emission lines that were not</span></div>
+<div class="line"><a name="l04288"></a><span class="lineno"> 4288</span> <span class="comment">     * listed in the input wavelength catalog.</span></div>
+<div class="line"><a name="l04289"></a><span class="lineno"> 4289</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04290"></a><span class="lineno"> 4290</span> </div>
+<div class="line"><a name="l04291"></a><span class="lineno"> 4291</span>     <span class="keywordflow">if</span> (nident[i] > 1) {</div>
+<div class="line"><a name="l04292"></a><span class="lineno"> 4292</span> </div>
+<div class="line"><a name="l04293"></a><span class="lineno"> 4293</span> </div>
+<div class="line"><a name="l04294"></a><span class="lineno"> 4294</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04295"></a><span class="lineno"> 4295</span> <span class="comment">       * Initialise the histogram of wavelengths assigned to the i-th peak.</span></div>
+<div class="line"><a name="l04296"></a><span class="lineno"> 4296</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04297"></a><span class="lineno"> 4297</span> </div>
+<div class="line"><a name="l04298"></a><span class="lineno"> 4298</span>       <span class="keywordflow">for</span> (j = 0; j < nlines; j++)</div>
+<div class="line"><a name="l04299"></a><span class="lineno"> 4299</span>         lident[j] = 0;</div>
+<div class="line"><a name="l04300"></a><span class="lineno"> 4300</span> </div>
+<div class="line"><a name="l04301"></a><span class="lineno"> 4301</span> </div>
+<div class="line"><a name="l04302"></a><span class="lineno"> 4302</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04303"></a><span class="lineno"> 4303</span> <span class="comment">       * Count how many times each catalog wavelength was assigned</span></div>
+<div class="line"><a name="l04304"></a><span class="lineno"> 4304</span> <span class="comment">       * to the i-th peak.</span></div>
+<div class="line"><a name="l04305"></a><span class="lineno"> 4305</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04306"></a><span class="lineno"> 4306</span> </div>
+<div class="line"><a name="l04307"></a><span class="lineno"> 4307</span>       <span class="keywordflow">for</span> (j = 0; j < nident[i]; j++)</div>
+<div class="line"><a name="l04308"></a><span class="lineno"> 4308</span>         ++lident[ident[i][j]];</div>
+<div class="line"><a name="l04309"></a><span class="lineno"> 4309</span> </div>
+<div class="line"><a name="l04310"></a><span class="lineno"> 4310</span> </div>
+<div class="line"><a name="l04311"></a><span class="lineno"> 4311</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04312"></a><span class="lineno"> 4312</span> <span class="comment">       * What wavelength was most frequently assigned to the i-th peak?</span></div>
+<div class="line"><a name="l04313"></a><span class="lineno"> 4313</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04314"></a><span class="lineno"> 4314</span> </div>
+<div class="line"><a name="l04315"></a><span class="lineno"> 4315</span>       max = 0;</div>
+<div class="line"><a name="l04316"></a><span class="lineno"> 4316</span>       maxpos = 0;</div>
+<div class="line"><a name="l04317"></a><span class="lineno"> 4317</span>       <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {</div>
+<div class="line"><a name="l04318"></a><span class="lineno"> 4318</span>         <span class="keywordflow">if</span> (max < lident[j]) {</div>
+<div class="line"><a name="l04319"></a><span class="lineno"> 4319</span>           max = lident[j];</div>
+<div class="line"><a name="l04320"></a><span class="lineno"> 4320</span>           maxpos = j;</div>
+<div class="line"><a name="l04321"></a><span class="lineno"> 4321</span>         }</div>
+<div class="line"><a name="l04322"></a><span class="lineno"> 4322</span>       }</div>
+<div class="line"><a name="l04323"></a><span class="lineno"> 4323</span> </div>
+<div class="line"><a name="l04324"></a><span class="lineno"> 4324</span> </div>
+<div class="line"><a name="l04325"></a><span class="lineno"> 4325</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04326"></a><span class="lineno"> 4326</span> <span class="comment">       * Were there other wavelengths assigned with the same frequency?</span></div>
+<div class="line"><a name="l04327"></a><span class="lineno"> 4327</span> <span class="comment">       * This would be the case of an ambiguous identification. It is</span></div>
+<div class="line"><a name="l04328"></a><span class="lineno"> 4328</span> <span class="comment">       * safer to reject this peak...</span></div>
+<div class="line"><a name="l04329"></a><span class="lineno"> 4329</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04330"></a><span class="lineno"> 4330</span> </div>
+<div class="line"><a name="l04331"></a><span class="lineno"> 4331</span>       ambiguous = 0;</div>
+<div class="line"><a name="l04332"></a><span class="lineno"> 4332</span> </div>
+<div class="line"><a name="l04333"></a><span class="lineno"> 4333</span>       <span class="keywordflow">for</span> (k = maxpos + 1; k < nlines; k++) {</div>
+<div class="line"><a name="l04334"></a><span class="lineno"> 4334</span>         <span class="keywordflow">if</span> (lident[k] == max) {</div>
+<div class="line"><a name="l04335"></a><span class="lineno"> 4335</span>           ambiguous = 1;</div>
+<div class="line"><a name="l04336"></a><span class="lineno"> 4336</span>           <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l04337"></a><span class="lineno"> 4337</span>         }</div>
+<div class="line"><a name="l04338"></a><span class="lineno"> 4338</span>       }</div>
+<div class="line"><a name="l04339"></a><span class="lineno"> 4339</span> </div>
+<div class="line"><a name="l04340"></a><span class="lineno"> 4340</span>       <span class="keywordflow">if</span> (ambiguous)</div>
+<div class="line"><a name="l04341"></a><span class="lineno"> 4341</span>         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l04342"></a><span class="lineno"> 4342</span> </div>
+<div class="line"><a name="l04343"></a><span class="lineno"> 4343</span> </div>
+<div class="line"><a name="l04344"></a><span class="lineno"> 4344</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04345"></a><span class="lineno"> 4345</span> <span class="comment">       * Otherwise, I assign to the i-th peak the wavelength that was</span></div>
+<div class="line"><a name="l04346"></a><span class="lineno"> 4346</span> <span class="comment">       * most often assigned to it.</span></div>
+<div class="line"><a name="l04347"></a><span class="lineno"> 4347</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04348"></a><span class="lineno"> 4348</span> </div>
+<div class="line"><a name="l04349"></a><span class="lineno"> 4349</span>       tmp_xpos[n]   = peak[i];</div>
+<div class="line"><a name="l04350"></a><span class="lineno"> 4350</span>       tmp_lambda[n] = line[maxpos];</div>
+<div class="line"><a name="l04351"></a><span class="lineno"> 4351</span>       tmp_ilambda[n] = maxpos;</div>
+<div class="line"><a name="l04352"></a><span class="lineno"> 4352</span> </div>
+<div class="line"><a name="l04353"></a><span class="lineno"> 4353</span>       ++n;</div>
+<div class="line"><a name="l04354"></a><span class="lineno"> 4354</span> </div>
+<div class="line"><a name="l04355"></a><span class="lineno"> 4355</span>     }</div>
+<div class="line"><a name="l04356"></a><span class="lineno"> 4356</span> </div>
+<div class="line"><a name="l04357"></a><span class="lineno"> 4357</span>   }</div>
+<div class="line"><a name="l04358"></a><span class="lineno"> 4358</span> </div>
+<div class="line"><a name="l04359"></a><span class="lineno"> 4359</span> </div>
+<div class="line"><a name="l04360"></a><span class="lineno"> 4360</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l04361"></a><span class="lineno"> 4361</span> <span class="comment">   * Check on identified peaks. Contaminations from other spectra might </span></div>
+<div class="line"><a name="l04362"></a><span class="lineno"> 4362</span> <span class="comment">   * be present and should be excluded: this type of contamination </span></div>
+<div class="line"><a name="l04363"></a><span class="lineno"> 4363</span> <span class="comment">   * consists of peaks that have been _correctly_ identified! The non-</span></div>
+<div class="line"><a name="l04364"></a><span class="lineno"> 4364</span> <span class="comment">   * spectral type of light contamination should have been almost all </span></div>
+<div class="line"><a name="l04365"></a><span class="lineno"> 4365</span> <span class="comment">   * removed already in the previous steps, but it may still be present.</span></div>
+<div class="line"><a name="l04366"></a><span class="lineno"> 4366</span> <span class="comment">   * Here, the self-consistent sequences of identified peaks are</span></div>
+<div class="line"><a name="l04367"></a><span class="lineno"> 4367</span> <span class="comment">   * separated one from the other. At the moment, just the longest of</span></div>
+<div class="line"><a name="l04368"></a><span class="lineno"> 4368</span> <span class="comment">   * such sequences is selected (in other words, spectral multiplexing</span></div>
+<div class="line"><a name="l04369"></a><span class="lineno"> 4369</span> <span class="comment">   * is ignored).</span></div>
+<div class="line"><a name="l04370"></a><span class="lineno"> 4370</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l04371"></a><span class="lineno"> 4371</span> </div>
+<div class="line"><a name="l04372"></a><span class="lineno"> 4372</span>   <span class="keywordflow">if</span> (n > 1) {</div>
+<div class="line"><a name="l04373"></a><span class="lineno"> 4373</span>     nn = 0;                  <span class="comment">/* Number of peaks in the list of sequences */</span></div>
+<div class="line"><a name="l04374"></a><span class="lineno"> 4374</span>     nseq = 0;                <span class="comment">/* Current sequence */</span></div>
+<div class="line"><a name="l04375"></a><span class="lineno"> 4375</span>     <span class="keywordflow">for</span> (k = 0; k < n; k++) {</div>
+<div class="line"><a name="l04376"></a><span class="lineno"> 4376</span>       <span class="keywordflow">if</span> (flag[k] == 0) {    <span class="comment">/* Was peak k already assigned to a sequence? */</span></div>
+<div class="line"><a name="l04377"></a><span class="lineno"> 4377</span>         flag[k] = 1;</div>
+<div class="line"><a name="l04378"></a><span class="lineno"> 4378</span>         xpos[nn] = tmp_xpos[k];       <span class="comment">/* Begin the nseq-th sequence */</span></div>
+<div class="line"><a name="l04379"></a><span class="lineno"> 4379</span>         lambda[nn] = tmp_lambda[k];</div>
+<div class="line"><a name="l04380"></a><span class="lineno"> 4380</span>         ilambda[nn] = tmp_ilambda[k];</div>
+<div class="line"><a name="l04381"></a><span class="lineno"> 4381</span>         ++seq_length[nseq];</div>
+<div class="line"><a name="l04382"></a><span class="lineno"> 4382</span>         ++nn;</div>
+<div class="line"><a name="l04383"></a><span class="lineno"> 4383</span> </div>
+<div class="line"><a name="l04384"></a><span class="lineno"> 4384</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l04385"></a><span class="lineno"> 4385</span> <span class="comment">         * Now look for all the following peaks that are compatible</span></div>
+<div class="line"><a name="l04386"></a><span class="lineno"> 4386</span> <span class="comment">         * with the expected spectral dispersion, and add them in </span></div>
+<div class="line"><a name="l04387"></a><span class="lineno"> 4387</span> <span class="comment">         * sequence to xpos. Note that missing peaks are not a problem...</span></div>
+<div class="line"><a name="l04388"></a><span class="lineno"> 4388</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l04389"></a><span class="lineno"> 4389</span>          </div>
+<div class="line"><a name="l04390"></a><span class="lineno"> 4390</span>         i = k;</div>
+<div class="line"><a name="l04391"></a><span class="lineno"> 4391</span>         <span class="keywordflow">while</span> (i < n - 1) {</div>
+<div class="line"><a name="l04392"></a><span class="lineno"> 4392</span>           found = 0;</div>
+<div class="line"><a name="l04393"></a><span class="lineno"> 4393</span>           <span class="keywordflow">for</span> (j = i + 1; j < n; j++) {</div>
+<div class="line"><a name="l04394"></a><span class="lineno"> 4394</span>             <span class="keywordflow">if</span> (flag[j] == 0) {</div>
+<div class="line"><a name="l04395"></a><span class="lineno"> 4395</span>               disp = (tmp_lambda[j] - tmp_lambda[i])</div>
+<div class="line"><a name="l04396"></a><span class="lineno"> 4396</span>                    / (tmp_xpos[j] - tmp_xpos[i]);</div>
+<div class="line"><a name="l04397"></a><span class="lineno"> 4397</span>               <span class="keywordflow">if</span> (disp >= min_disp && disp <= max_disp) {</div>
+<div class="line"><a name="l04398"></a><span class="lineno"> 4398</span>                 flag[j] = 1;</div>
+<div class="line"><a name="l04399"></a><span class="lineno"> 4399</span>                 xpos[nn] = tmp_xpos[j];</div>
+<div class="line"><a name="l04400"></a><span class="lineno"> 4400</span>                 lambda[nn] = tmp_lambda[j];</div>
+<div class="line"><a name="l04401"></a><span class="lineno"> 4401</span>                 ilambda[nn] = tmp_ilambda[j];</div>
+<div class="line"><a name="l04402"></a><span class="lineno"> 4402</span>                 ++seq_length[nseq];</div>
+<div class="line"><a name="l04403"></a><span class="lineno"> 4403</span>                 ++nn;</div>
+<div class="line"><a name="l04404"></a><span class="lineno"> 4404</span>                 i = j;</div>
+<div class="line"><a name="l04405"></a><span class="lineno"> 4405</span>                 found = 1;</div>
+<div class="line"><a name="l04406"></a><span class="lineno"> 4406</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l04407"></a><span class="lineno"> 4407</span>               }</div>
+<div class="line"><a name="l04408"></a><span class="lineno"> 4408</span>             }</div>
+<div class="line"><a name="l04409"></a><span class="lineno"> 4409</span>           }</div>
+<div class="line"><a name="l04410"></a><span class="lineno"> 4410</span>           <span class="keywordflow">if</span> (!found)</div>
+<div class="line"><a name="l04411"></a><span class="lineno"> 4411</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l04412"></a><span class="lineno"> 4412</span>         }</div>
+<div class="line"><a name="l04413"></a><span class="lineno"> 4413</span> </div>
+<div class="line"><a name="l04414"></a><span class="lineno"> 4414</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l04415"></a><span class="lineno"> 4415</span> <span class="comment">         * Current sequence is completed: begin new sequence on the</span></div>
+<div class="line"><a name="l04416"></a><span class="lineno"> 4416</span> <span class="comment">         * excluded peaks, starting the loop on peaks again.</span></div>
+<div class="line"><a name="l04417"></a><span class="lineno"> 4417</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l04418"></a><span class="lineno"> 4418</span> </div>
+<div class="line"><a name="l04419"></a><span class="lineno"> 4419</span>         ++nseq;</div>
+<div class="line"><a name="l04420"></a><span class="lineno"> 4420</span>         k = 0;</div>
+<div class="line"><a name="l04421"></a><span class="lineno"> 4421</span>       }</div>
+<div class="line"><a name="l04422"></a><span class="lineno"> 4422</span>     }</div>
+<div class="line"><a name="l04423"></a><span class="lineno"> 4423</span> </div>
+<div class="line"><a name="l04424"></a><span class="lineno"> 4424</span> </div>
+<div class="line"><a name="l04425"></a><span class="lineno"> 4425</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04426"></a><span class="lineno"> 4426</span> <span class="comment">     * Find the longest sequence of self-consistent peaks.</span></div>
+<div class="line"><a name="l04427"></a><span class="lineno"> 4427</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04428"></a><span class="lineno"> 4428</span> </div>
+<div class="line"><a name="l04429"></a><span class="lineno"> 4429</span>     maxpos = max = 0;</div>
+<div class="line"><a name="l04430"></a><span class="lineno"> 4430</span> </div>
+<div class="line"><a name="l04431"></a><span class="lineno"> 4431</span>     <span class="keywordflow">if</span> (mos_multiplex < 0) {</div>
+<div class="line"><a name="l04432"></a><span class="lineno"> 4432</span>       <span class="keywordflow">for</span> (i = 0; i < nseq; i++) {</div>
+<div class="line"><a name="l04433"></a><span class="lineno"> 4433</span>         <span class="keywordflow">if</span> (seq_length[i] > max) {</div>
+<div class="line"><a name="l04434"></a><span class="lineno"> 4434</span>           max = seq_length[i];</div>
+<div class="line"><a name="l04435"></a><span class="lineno"> 4435</span>           maxpos = i;</div>
+<div class="line"><a name="l04436"></a><span class="lineno"> 4436</span>         }</div>
+<div class="line"><a name="l04437"></a><span class="lineno"> 4437</span>       }</div>
+<div class="line"><a name="l04438"></a><span class="lineno"> 4438</span>     }</div>
+<div class="line"><a name="l04439"></a><span class="lineno"> 4439</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l04440"></a><span class="lineno"> 4440</span> </div>
+<div class="line"><a name="l04441"></a><span class="lineno"> 4441</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04442"></a><span class="lineno"> 4442</span> <span class="comment">       * Now consider the sequence which lays in the specified </span></div>
+<div class="line"><a name="l04443"></a><span class="lineno"> 4443</span> <span class="comment">       * CCD region (indicated by mos_multiplex): that is, _most_ </span></div>
+<div class="line"><a name="l04444"></a><span class="lineno"> 4444</span> <span class="comment">       * of its lines (more than half) must be in that region...</span></div>
+<div class="line"><a name="l04445"></a><span class="lineno"> 4445</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04446"></a><span class="lineno"> 4446</span> </div>
+<div class="line"><a name="l04447"></a><span class="lineno"> 4447</span>       nn = 0;</div>
+<div class="line"><a name="l04448"></a><span class="lineno"> 4448</span>       found = 0;</div>
+<div class="line"><a name="l04449"></a><span class="lineno"> 4449</span> </div>
+<div class="line"><a name="l04450"></a><span class="lineno"> 4450</span>       <span class="keywordflow">for</span> (i = 0; i < nseq; i++) {</div>
+<div class="line"><a name="l04451"></a><span class="lineno"> 4451</span>         n = seq_length[i];</div>
+<div class="line"><a name="l04452"></a><span class="lineno"> 4452</span>         <span class="keywordflow">if</span> (n > 5) {</div>
+<div class="line"><a name="l04453"></a><span class="lineno"> 4453</span>           cpl_array *regions = cpl_array_new(n, CPL_TYPE_INT);</div>
+<div class="line"><a name="l04454"></a><span class="lineno"> 4454</span>           <span class="keywordtype">int</span>        region;</div>
+<div class="line"><a name="l04455"></a><span class="lineno"> 4455</span> </div>
+<div class="line"><a name="l04456"></a><span class="lineno"> 4456</span>           <span class="keywordflow">for</span> (j = 0; j < n; j++)</div>
+<div class="line"><a name="l04457"></a><span class="lineno"> 4457</span>             cpl_array_set_int(regions, j, </div>
+<div class="line"><a name="l04458"></a><span class="lineno"> 4458</span>                               ((<span class="keywordtype">int</span>)floor(xpos[nn + j])) / mos_region_size);</div>
+<div class="line"><a name="l04459"></a><span class="lineno"> 4459</span> </div>
+<div class="line"><a name="l04460"></a><span class="lineno"> 4460</span>           region = (int)cpl_array_get_median(regions);</div>
+<div class="line"><a name="l04461"></a><span class="lineno"> 4461</span>           cpl_array_delete(regions);</div>
+<div class="line"><a name="l04462"></a><span class="lineno"> 4462</span> </div>
+<div class="line"><a name="l04463"></a><span class="lineno"> 4463</span>           <span class="keywordflow">if</span> (mos_multiplex == region) {</div>
+<div class="line"><a name="l04464"></a><span class="lineno"> 4464</span>             <span class="keywordflow">if</span> (found) {</div>
+<div class="line"><a name="l04465"></a><span class="lineno"> 4465</span>               cpl_msg_debug(cpl_func, <span class="stringliteral">"More than one spectrum found in "</span></div>
+<div class="line"><a name="l04466"></a><span class="lineno"> 4466</span>                             <span class="stringliteral">"region %d (only the first one is extracted)"</span>, </div>
+<div class="line"><a name="l04467"></a><span class="lineno"> 4467</span>                             mos_multiplex);</div>
+<div class="line"><a name="l04468"></a><span class="lineno"> 4468</span>               <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l04469"></a><span class="lineno"> 4469</span>             }</div>
+<div class="line"><a name="l04470"></a><span class="lineno"> 4470</span>             found = 1;</div>
+<div class="line"><a name="l04471"></a><span class="lineno"> 4471</span>             max = seq_length[i];</div>
+<div class="line"><a name="l04472"></a><span class="lineno"> 4472</span>             maxpos = i;</div>
+<div class="line"><a name="l04473"></a><span class="lineno"> 4473</span>           }</div>
+<div class="line"><a name="l04474"></a><span class="lineno"> 4474</span>         }</div>
+<div class="line"><a name="l04475"></a><span class="lineno"> 4475</span>         nn += seq_length[i];</div>
+<div class="line"><a name="l04476"></a><span class="lineno"> 4476</span>       }</div>
+<div class="line"><a name="l04477"></a><span class="lineno"> 4477</span>     }</div>
+<div class="line"><a name="l04478"></a><span class="lineno"> 4478</span> </div>
+<div class="line"><a name="l04479"></a><span class="lineno"> 4479</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04480"></a><span class="lineno"> 4480</span> <span class="comment">     * Find where this sequence starts in the whole peak position</span></div>
+<div class="line"><a name="l04481"></a><span class="lineno"> 4481</span> <span class="comment">     * storage.</span></div>
+<div class="line"><a name="l04482"></a><span class="lineno"> 4482</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04483"></a><span class="lineno"> 4483</span> </div>
+<div class="line"><a name="l04484"></a><span class="lineno"> 4484</span>     nn = 0;</div>
+<div class="line"><a name="l04485"></a><span class="lineno"> 4485</span>     <span class="keywordflow">for</span> (i = 0; i < maxpos; i++)</div>
+<div class="line"><a name="l04486"></a><span class="lineno"> 4486</span>       nn += seq_length[i];</div>
+<div class="line"><a name="l04487"></a><span class="lineno"> 4487</span> </div>
+<div class="line"><a name="l04488"></a><span class="lineno"> 4488</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04489"></a><span class="lineno"> 4489</span> <span class="comment">     * Move the longest sequence at the beginning of the returned lists</span></div>
+<div class="line"><a name="l04490"></a><span class="lineno"> 4490</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04491"></a><span class="lineno"> 4491</span> </div>
+<div class="line"><a name="l04492"></a><span class="lineno"> 4492</span>     n = max;</div>
+<div class="line"><a name="l04493"></a><span class="lineno"> 4493</span>     <span class="keywordflow">for</span> (i = 0; i < n; i++, nn++) {</div>
+<div class="line"><a name="l04494"></a><span class="lineno"> 4494</span>       xpos[i] = xpos[nn];</div>
+<div class="line"><a name="l04495"></a><span class="lineno"> 4495</span>       lambda[i] = lambda[nn];</div>
+<div class="line"><a name="l04496"></a><span class="lineno"> 4496</span>       ilambda[i] = ilambda[nn];</div>
+<div class="line"><a name="l04497"></a><span class="lineno"> 4497</span>     }</div>
+<div class="line"><a name="l04498"></a><span class="lineno"> 4498</span> </div>
+<div class="line"><a name="l04499"></a><span class="lineno"> 4499</span> </div>
+<div class="line"><a name="l04500"></a><span class="lineno"> 4500</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04501"></a><span class="lineno"> 4501</span> <span class="comment">     * Are some wavelengths missing? Recover them.</span></div>
+<div class="line"><a name="l04502"></a><span class="lineno"> 4502</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04503"></a><span class="lineno"> 4503</span> </div>
+<div class="line"><a name="l04504"></a><span class="lineno"> 4504</span>     <span class="keywordflow">for</span> (i = 1; i < n; i++) {</div>
+<div class="line"><a name="l04505"></a><span class="lineno"> 4505</span>       gap = ilambda[i] - ilambda[i-1];</div>
+<div class="line"><a name="l04506"></a><span class="lineno"> 4506</span>       <span class="keywordflow">for</span> (j = 1; j < gap; j++) {</div>
+<div class="line"><a name="l04507"></a><span class="lineno"> 4507</span> </div>
+<div class="line"><a name="l04508"></a><span class="lineno"> 4508</span>         <span class="keywordflow">if</span> (j == 1) {</div>
+<div class="line"><a name="l04509"></a><span class="lineno"> 4509</span> </div>
+<div class="line"><a name="l04510"></a><span class="lineno"> 4510</span>           <span class="comment">/*</span></div>
+<div class="line"><a name="l04511"></a><span class="lineno"> 4511</span> <span class="comment">           * Determine the local dispersion from the current pair of peaks</span></div>
+<div class="line"><a name="l04512"></a><span class="lineno"> 4512</span> <span class="comment">           */</span></div>
+<div class="line"><a name="l04513"></a><span class="lineno"> 4513</span>   </div>
+<div class="line"><a name="l04514"></a><span class="lineno"> 4514</span>           disp = (lambda[i] - lambda[i-1]) / (xpos[i] - xpos[i-1]);</div>
+<div class="line"><a name="l04515"></a><span class="lineno"> 4515</span>         }</div>
+<div class="line"><a name="l04516"></a><span class="lineno"> 4516</span> </div>
+<div class="line"><a name="l04517"></a><span class="lineno"> 4517</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l04518"></a><span class="lineno"> 4518</span> <span class="comment">         * With this, find the expected position of the missing</span></div>
+<div class="line"><a name="l04519"></a><span class="lineno"> 4519</span> <span class="comment">         * peak by linear interpolation.</span></div>
+<div class="line"><a name="l04520"></a><span class="lineno"> 4520</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l04521"></a><span class="lineno"> 4521</span> </div>
+<div class="line"><a name="l04522"></a><span class="lineno"> 4522</span>         hi_start = xpos[i-1] + (line[ilambda[i-1] + j] - lambda[i-1]) / disp;</div>
+<div class="line"><a name="l04523"></a><span class="lineno"> 4523</span> </div>
+<div class="line"><a name="l04524"></a><span class="lineno"> 4524</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l04525"></a><span class="lineno"> 4525</span> <span class="comment">         * Is there a peak at that position? Here a peak from the</span></div>
+<div class="line"><a name="l04526"></a><span class="lineno"> 4526</span> <span class="comment">         * original list is searched, that is closer than 2 pixels</span></div>
+<div class="line"><a name="l04527"></a><span class="lineno"> 4527</span> <span class="comment">         * to the expected position. If it is found, insert it at</span></div>
+<div class="line"><a name="l04528"></a><span class="lineno"> 4528</span> <span class="comment">         * the current position on the list of identified peaks,</span></div>
+<div class="line"><a name="l04529"></a><span class="lineno"> 4529</span> <span class="comment">         * and leave immediately the loop (taking the new position</span></div>
+<div class="line"><a name="l04530"></a><span class="lineno"> 4530</span> <span class="comment">         * for the following linear interpolation, in case more</span></div>
+<div class="line"><a name="l04531"></a><span class="lineno"> 4531</span> <span class="comment">         * than one peak is missing in the current interval).</span></div>
+<div class="line"><a name="l04532"></a><span class="lineno"> 4532</span> <span class="comment">         * If it is not found, stay in the loop, looking for </span></div>
+<div class="line"><a name="l04533"></a><span class="lineno"> 4533</span> <span class="comment">         * the following missing peaks in this interval.</span></div>
+<div class="line"><a name="l04534"></a><span class="lineno"> 4534</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l04535"></a><span class="lineno"> 4535</span> </div>
+<div class="line"><a name="l04536"></a><span class="lineno"> 4536</span>         found = 0;</div>
+<div class="line"><a name="l04537"></a><span class="lineno"> 4537</span>         <span class="keywordflow">for</span> (k = 0; k < npeaks; k++) {</div>
+<div class="line"><a name="l04538"></a><span class="lineno"> 4538</span>           <span class="keywordflow">if</span> (fabs(peak[k] - hi_start) < 2) {</div>
+<div class="line"><a name="l04539"></a><span class="lineno"> 4539</span>             <span class="keywordflow">for</span> (l = n; l > i; l--) {</div>
+<div class="line"><a name="l04540"></a><span class="lineno"> 4540</span>               xpos[l] = xpos[l-1];</div>
+<div class="line"><a name="l04541"></a><span class="lineno"> 4541</span>               lambda[l] = lambda[l-1];</div>
+<div class="line"><a name="l04542"></a><span class="lineno"> 4542</span>               ilambda[l] = ilambda[l-1];</div>
+<div class="line"><a name="l04543"></a><span class="lineno"> 4543</span>             }</div>
+<div class="line"><a name="l04544"></a><span class="lineno"> 4544</span>             xpos[i] = peak[k];</div>
+<div class="line"><a name="l04545"></a><span class="lineno"> 4545</span>             lambda[i] = line[ilambda[i-1] + j];</div>
+<div class="line"><a name="l04546"></a><span class="lineno"> 4546</span>             ilambda[i] = ilambda[i-1] + j;</div>
+<div class="line"><a name="l04547"></a><span class="lineno"> 4547</span>             ++n;</div>
+<div class="line"><a name="l04548"></a><span class="lineno"> 4548</span>             found = 1;</div>
+<div class="line"><a name="l04549"></a><span class="lineno"> 4549</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l04550"></a><span class="lineno"> 4550</span>           }</div>
+<div class="line"><a name="l04551"></a><span class="lineno"> 4551</span>         }</div>
+<div class="line"><a name="l04552"></a><span class="lineno"> 4552</span>         <span class="keywordflow">if</span> (found)</div>
+<div class="line"><a name="l04553"></a><span class="lineno"> 4553</span>           <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l04554"></a><span class="lineno"> 4554</span>       }</div>
+<div class="line"><a name="l04555"></a><span class="lineno"> 4555</span>     }</div>
+<div class="line"><a name="l04556"></a><span class="lineno"> 4556</span> </div>
+<div class="line"><a name="l04557"></a><span class="lineno"> 4557</span> </div>
+<div class="line"><a name="l04558"></a><span class="lineno"> 4558</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04559"></a><span class="lineno"> 4559</span> <span class="comment">     * Try to extrapolate forward</span></div>
+<div class="line"><a name="l04560"></a><span class="lineno"> 4560</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04561"></a><span class="lineno"> 4561</span> </div>
+<div class="line"><a name="l04562"></a><span class="lineno"> 4562</span>     found = 1;</div>
+<div class="line"><a name="l04563"></a><span class="lineno"> 4563</span>     <span class="keywordflow">while</span> (ilambda[n-1] < nlines - 1 && found) {</div>
+<div class="line"><a name="l04564"></a><span class="lineno"> 4564</span> </div>
+<div class="line"><a name="l04565"></a><span class="lineno"> 4565</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04566"></a><span class="lineno"> 4566</span> <span class="comment">       * Determine the local dispersion from the last pair of </span></div>
+<div class="line"><a name="l04567"></a><span class="lineno"> 4567</span> <span class="comment">       * identified peaks</span></div>
+<div class="line"><a name="l04568"></a><span class="lineno"> 4568</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04569"></a><span class="lineno"> 4569</span> </div>
+<div class="line"><a name="l04570"></a><span class="lineno"> 4570</span>       <span class="keywordflow">if</span> (n > 1)</div>
+<div class="line"><a name="l04571"></a><span class="lineno"> 4571</span>           disp = (lambda[n-1] - lambda[n-2]) / (xpos[n-1] - xpos[n-2]);</div>
+<div class="line"><a name="l04572"></a><span class="lineno"> 4572</span>       <span class="keywordflow">else</span></div>
+<div class="line"><a name="l04573"></a><span class="lineno"> 4573</span>           disp = 0.0;</div>
+<div class="line"><a name="l04574"></a><span class="lineno"> 4574</span> </div>
+<div class="line"><a name="l04575"></a><span class="lineno"> 4575</span>       <span class="keywordflow">if</span> (disp > max_disp || disp < min_disp)</div>
+<div class="line"><a name="l04576"></a><span class="lineno"> 4576</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l04577"></a><span class="lineno"> 4577</span> </div>
+<div class="line"><a name="l04578"></a><span class="lineno"> 4578</span> </div>
+<div class="line"><a name="l04579"></a><span class="lineno"> 4579</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04580"></a><span class="lineno"> 4580</span> <span class="comment">       * With this, find the expected position of the missing</span></div>
+<div class="line"><a name="l04581"></a><span class="lineno"> 4581</span> <span class="comment">       * peak by linear interpolation.</span></div>
+<div class="line"><a name="l04582"></a><span class="lineno"> 4582</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04583"></a><span class="lineno"> 4583</span> </div>
+<div class="line"><a name="l04584"></a><span class="lineno"> 4584</span>       hi_start = xpos[n-1] + (line[ilambda[n-1] + 1] - lambda[n-1]) / disp;</div>
+<div class="line"><a name="l04585"></a><span class="lineno"> 4585</span> </div>
+<div class="line"><a name="l04586"></a><span class="lineno"> 4586</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04587"></a><span class="lineno"> 4587</span> <span class="comment">       * Is there a peak at that position? Here a peak from the</span></div>
+<div class="line"><a name="l04588"></a><span class="lineno"> 4588</span> <span class="comment">       * original list is searched, that is closer than 6 pixels</span></div>
+<div class="line"><a name="l04589"></a><span class="lineno"> 4589</span> <span class="comment">       * to the expected position. If it is found, insert it at</span></div>
+<div class="line"><a name="l04590"></a><span class="lineno"> 4590</span> <span class="comment">       * the end of the list of identified peaks. If it is not</span></div>
+<div class="line"><a name="l04591"></a><span class="lineno"> 4591</span> <span class="comment">       * found, leave the loop.</span></div>
+<div class="line"><a name="l04592"></a><span class="lineno"> 4592</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04593"></a><span class="lineno"> 4593</span> </div>
+<div class="line"><a name="l04594"></a><span class="lineno"> 4594</span>       found = 0;</div>
+<div class="line"><a name="l04595"></a><span class="lineno"> 4595</span>       min = fabs(peak[0] - hi_start);</div>
+<div class="line"><a name="l04596"></a><span class="lineno"> 4596</span>       minpos = 0;</div>
+<div class="line"><a name="l04597"></a><span class="lineno"> 4597</span>       <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {</div>
+<div class="line"><a name="l04598"></a><span class="lineno"> 4598</span>         <span class="keywordflow">if</span> (min > fabs(peak[k] - hi_start)) {</div>
+<div class="line"><a name="l04599"></a><span class="lineno"> 4599</span>             min = fabs(peak[k] - hi_start);</div>
+<div class="line"><a name="l04600"></a><span class="lineno"> 4600</span>             minpos = k;</div>
+<div class="line"><a name="l04601"></a><span class="lineno"> 4601</span>         }</div>
+<div class="line"><a name="l04602"></a><span class="lineno"> 4602</span>       }</div>
+<div class="line"><a name="l04603"></a><span class="lineno"> 4603</span>       <span class="keywordflow">if</span> (min < 6 && fabs(peak[minpos] - xpos[n-1]) > 1.0) {</div>
+<div class="line"><a name="l04604"></a><span class="lineno"> 4604</span>         xpos[n] = peak[minpos];</div>
+<div class="line"><a name="l04605"></a><span class="lineno"> 4605</span>         lambda[n] = line[ilambda[n-1] + 1];</div>
+<div class="line"><a name="l04606"></a><span class="lineno"> 4606</span>         ilambda[n] = ilambda[n-1] + 1;</div>
+<div class="line"><a name="l04607"></a><span class="lineno"> 4607</span>         ++n;</div>
+<div class="line"><a name="l04608"></a><span class="lineno"> 4608</span>         found = 1;</div>
+<div class="line"><a name="l04609"></a><span class="lineno"> 4609</span>       }</div>
+<div class="line"><a name="l04610"></a><span class="lineno"> 4610</span>     }</div>
+<div class="line"><a name="l04611"></a><span class="lineno"> 4611</span> </div>
+<div class="line"><a name="l04612"></a><span class="lineno"> 4612</span> </div>
+<div class="line"><a name="l04613"></a><span class="lineno"> 4613</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04614"></a><span class="lineno"> 4614</span> <span class="comment">     * Try to extrapolate backward</span></div>
+<div class="line"><a name="l04615"></a><span class="lineno"> 4615</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04616"></a><span class="lineno"> 4616</span> </div>
+<div class="line"><a name="l04617"></a><span class="lineno"> 4617</span>     found = 1;</div>
+<div class="line"><a name="l04618"></a><span class="lineno"> 4618</span>     <span class="keywordflow">while</span> (ilambda[0] > 0 && found) {</div>
+<div class="line"><a name="l04619"></a><span class="lineno"> 4619</span> </div>
+<div class="line"><a name="l04620"></a><span class="lineno"> 4620</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04621"></a><span class="lineno"> 4621</span> <span class="comment">       * Determine the local dispersion from the first pair of</span></div>
+<div class="line"><a name="l04622"></a><span class="lineno"> 4622</span> <span class="comment">       * identified peaks</span></div>
+<div class="line"><a name="l04623"></a><span class="lineno"> 4623</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04624"></a><span class="lineno"> 4624</span> </div>
+<div class="line"><a name="l04625"></a><span class="lineno"> 4625</span>       disp = (lambda[1] - lambda[0]) / (xpos[1] - xpos[0]);</div>
+<div class="line"><a name="l04626"></a><span class="lineno"> 4626</span> </div>
+<div class="line"><a name="l04627"></a><span class="lineno"> 4627</span>       <span class="keywordflow">if</span> (disp > max_disp || disp < min_disp)</div>
+<div class="line"><a name="l04628"></a><span class="lineno"> 4628</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l04629"></a><span class="lineno"> 4629</span> </div>
+<div class="line"><a name="l04630"></a><span class="lineno"> 4630</span> </div>
+<div class="line"><a name="l04631"></a><span class="lineno"> 4631</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04632"></a><span class="lineno"> 4632</span> <span class="comment">       * With this, find the expected position of the missing</span></div>
+<div class="line"><a name="l04633"></a><span class="lineno"> 4633</span> <span class="comment">       * peak by linear interpolation.</span></div>
+<div class="line"><a name="l04634"></a><span class="lineno"> 4634</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04635"></a><span class="lineno"> 4635</span> </div>
+<div class="line"><a name="l04636"></a><span class="lineno"> 4636</span>       hi_start = xpos[0] - (lambda[0] - line[ilambda[0] - 1]) / disp;</div>
+<div class="line"><a name="l04637"></a><span class="lineno"> 4637</span> </div>
+<div class="line"><a name="l04638"></a><span class="lineno"> 4638</span> </div>
+<div class="line"><a name="l04639"></a><span class="lineno"> 4639</span>       <span class="comment">/*</span></div>
+<div class="line"><a name="l04640"></a><span class="lineno"> 4640</span> <span class="comment">       * Is there a peak at that position? Here a peak from the</span></div>
+<div class="line"><a name="l04641"></a><span class="lineno"> 4641</span> <span class="comment">       * original list is searched, that is closer than 6 pixels</span></div>
+<div class="line"><a name="l04642"></a><span class="lineno"> 4642</span> <span class="comment">       * to the expected position. If it is found, insert it at</span></div>
+<div class="line"><a name="l04643"></a><span class="lineno"> 4643</span> <span class="comment">       * the beginning of the list of identified peaks. If it is not</span></div>
+<div class="line"><a name="l04644"></a><span class="lineno"> 4644</span> <span class="comment">       * found, leave the loop.</span></div>
+<div class="line"><a name="l04645"></a><span class="lineno"> 4645</span> <span class="comment">       */</span></div>
+<div class="line"><a name="l04646"></a><span class="lineno"> 4646</span> </div>
+<div class="line"><a name="l04647"></a><span class="lineno"> 4647</span>       found = 0;</div>
+<div class="line"><a name="l04648"></a><span class="lineno"> 4648</span>       min = fabs(peak[0] - hi_start);</div>
+<div class="line"><a name="l04649"></a><span class="lineno"> 4649</span>       minpos = 0;</div>
+<div class="line"><a name="l04650"></a><span class="lineno"> 4650</span>       <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {</div>
+<div class="line"><a name="l04651"></a><span class="lineno"> 4651</span>         <span class="keywordflow">if</span> (min > fabs(peak[k] - hi_start)) {</div>
+<div class="line"><a name="l04652"></a><span class="lineno"> 4652</span>             min = fabs(peak[k] - hi_start);</div>
+<div class="line"><a name="l04653"></a><span class="lineno"> 4653</span>             minpos = k;</div>
+<div class="line"><a name="l04654"></a><span class="lineno"> 4654</span>         }</div>
+<div class="line"><a name="l04655"></a><span class="lineno"> 4655</span>       }</div>
+<div class="line"><a name="l04656"></a><span class="lineno"> 4656</span>       <span class="keywordflow">if</span> (min < 6 && fabs(peak[minpos] - xpos[0]) > 1.0) {</div>
+<div class="line"><a name="l04657"></a><span class="lineno"> 4657</span>         <span class="keywordflow">for</span> (j = n; j > 0; j--) {</div>
+<div class="line"><a name="l04658"></a><span class="lineno"> 4658</span>           xpos[j] = xpos[j-1];</div>
+<div class="line"><a name="l04659"></a><span class="lineno"> 4659</span>           lambda[j] = lambda[j-1];</div>
+<div class="line"><a name="l04660"></a><span class="lineno"> 4660</span>           ilambda[j] = ilambda[j-1];</div>
+<div class="line"><a name="l04661"></a><span class="lineno"> 4661</span>         }</div>
+<div class="line"><a name="l04662"></a><span class="lineno"> 4662</span>         xpos[0] = peak[minpos];</div>
+<div class="line"><a name="l04663"></a><span class="lineno"> 4663</span>         lambda[0] = line[ilambda[0] - 1];</div>
+<div class="line"><a name="l04664"></a><span class="lineno"> 4664</span>         ilambda[0] = ilambda[0] - 1;</div>
+<div class="line"><a name="l04665"></a><span class="lineno"> 4665</span>         ++n;</div>
+<div class="line"><a name="l04666"></a><span class="lineno"> 4666</span>         found = 1;</div>
+<div class="line"><a name="l04667"></a><span class="lineno"> 4667</span>       }</div>
+<div class="line"><a name="l04668"></a><span class="lineno"> 4668</span>     }</div>
+<div class="line"><a name="l04669"></a><span class="lineno"> 4669</span>   }</div>
+<div class="line"><a name="l04670"></a><span class="lineno"> 4670</span> </div>
+<div class="line"><a name="l04671"></a><span class="lineno"> 4671</span> </div>
+<div class="line"><a name="l04672"></a><span class="lineno"> 4672</span>   <span class="comment">/*</span></div>
+<div class="line"><a name="l04673"></a><span class="lineno"> 4673</span> <span class="comment">   * At this point all peaks are processed. Free memory, and return</span></div>
+<div class="line"><a name="l04674"></a><span class="lineno"> 4674</span> <span class="comment">   * the result.</span></div>
+<div class="line"><a name="l04675"></a><span class="lineno"> 4675</span> <span class="comment">   */</span></div>
+<div class="line"><a name="l04676"></a><span class="lineno"> 4676</span> </div>
+<div class="line"><a name="l04677"></a><span class="lineno"> 4677</span> <span class="comment">/************************************************+</span></div>
+<div class="line"><a name="l04678"></a><span class="lineno"> 4678</span> <span class="comment">  for (i = 0; i < npeaks; i++) {</span></div>
+<div class="line"><a name="l04679"></a><span class="lineno"> 4679</span> <span class="comment">    printf("Peak %d:\n   ", i);</span></div>
+<div class="line"><a name="l04680"></a><span class="lineno"> 4680</span> <span class="comment">    for (j = 0; j < nident[i]; j++)</span></div>
+<div class="line"><a name="l04681"></a><span class="lineno"> 4681</span> <span class="comment">      printf("%.2f, ", line[ident[i][j]]);</span></div>
+<div class="line"><a name="l04682"></a><span class="lineno"> 4682</span> <span class="comment">    printf("\n");</span></div>
+<div class="line"><a name="l04683"></a><span class="lineno"> 4683</span> <span class="comment">  }</span></div>
+<div class="line"><a name="l04684"></a><span class="lineno"> 4684</span> <span class="comment"></span></div>
+<div class="line"><a name="l04685"></a><span class="lineno"> 4685</span> <span class="comment">  printf("\n");</span></div>
+<div class="line"><a name="l04686"></a><span class="lineno"> 4686</span> <span class="comment"></span></div>
+<div class="line"><a name="l04687"></a><span class="lineno"> 4687</span> <span class="comment">  for (i = 0; i < n; i++)</span></div>
+<div class="line"><a name="l04688"></a><span class="lineno"> 4688</span> <span class="comment">    printf("%.2f, %.2f\n", xpos[i], lambda[i]);</span></div>
+<div class="line"><a name="l04689"></a><span class="lineno"> 4689</span> <span class="comment">+************************************************/</span></div>
+<div class="line"><a name="l04690"></a><span class="lineno"> 4690</span>   <span class="keywordflow">for</span> (i = 0; i < npeaks; i++)</div>
+<div class="line"><a name="l04691"></a><span class="lineno"> 4691</span>     cpl_free(ident[i]);</div>
+<div class="line"><a name="l04692"></a><span class="lineno"> 4692</span>   cpl_free(ident);</div>
+<div class="line"><a name="l04693"></a><span class="lineno"> 4693</span>   cpl_free(nident);</div>
+<div class="line"><a name="l04694"></a><span class="lineno"> 4694</span>   cpl_free(lident);</div>
+<div class="line"><a name="l04695"></a><span class="lineno"> 4695</span>   cpl_free(ilambda);</div>
+<div class="line"><a name="l04696"></a><span class="lineno"> 4696</span>   cpl_free(tmp_xpos);</div>
+<div class="line"><a name="l04697"></a><span class="lineno"> 4697</span>   cpl_free(tmp_lambda);</div>
+<div class="line"><a name="l04698"></a><span class="lineno"> 4698</span>   cpl_free(tmp_ilambda);</div>
+<div class="line"><a name="l04699"></a><span class="lineno"> 4699</span>   cpl_free(peak_lo);</div>
+<div class="line"><a name="l04700"></a><span class="lineno"> 4700</span>   cpl_free(flag);</div>
+<div class="line"><a name="l04701"></a><span class="lineno"> 4701</span>   cpl_free(seq_length);</div>
+<div class="line"><a name="l04702"></a><span class="lineno"> 4702</span>   cpl_free(peak_hi);</div>
+<div class="line"><a name="l04703"></a><span class="lineno"> 4703</span> </div>
+<div class="line"><a name="l04704"></a><span class="lineno"> 4704</span>   <span class="keywordflow">if</span> (n == 0) {</div>
+<div class="line"><a name="l04705"></a><span class="lineno"> 4705</span>     cpl_free(xpos);</div>
+<div class="line"><a name="l04706"></a><span class="lineno"> 4706</span>     cpl_free(lambda);</div>
+<div class="line"><a name="l04707"></a><span class="lineno"> 4707</span>     <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l04708"></a><span class="lineno"> 4708</span>   }</div>
+<div class="line"><a name="l04709"></a><span class="lineno"> 4709</span> </div>
+<div class="line"><a name="l04710"></a><span class="lineno"> 4710</span>   <span class="keywordflow">return</span> cpl_bivector_wrap_vectors(cpl_vector_wrap(n, xpos), </div>
+<div class="line"><a name="l04711"></a><span class="lineno"> 4711</span>                                    cpl_vector_wrap(n, lambda));</div>
+<div class="line"><a name="l04712"></a><span class="lineno"> 4712</span> }</div>
+<div class="line"><a name="l04713"></a><span class="lineno"> 4713</span> </div>
+<div class="line"><a name="l04714"></a><span class="lineno"> 4714</span> </div>
+<div class="line"><a name="l04732"></a><span class="lineno"> 4732</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l04733"></a><span class="lineno"> 4733</span> <span class="comment">double mos_eval_dds(cpl_polynomial *ids, double blue, double red, </span></div>
+<div class="line"><a name="l04734"></a><span class="lineno"> 4734</span> <span class="comment">                    double refwave, double pixel)</span></div>
+<div class="line"><a name="l04735"></a><span class="lineno"> 4735</span> <span class="comment">{</span></div>
+<div class="line"><a name="l04736"></a><span class="lineno"> 4736</span> <span class="comment">    double yellow;</span></div>
+<div class="line"><a name="l04737"></a><span class="lineno"> 4737</span> <span class="comment">    double cpixel;</span></div>
+<div class="line"><a name="l04738"></a><span class="lineno"> 4738</span> <span class="comment">    double tolerance = 0.02;</span></div>
+<div class="line"><a name="l04739"></a><span class="lineno"> 4739</span> <span class="comment">    int    max_iter = 20;</span></div>
+<div class="line"><a name="l04740"></a><span class="lineno"> 4740</span> <span class="comment">    int    iter = 0;</span></div>
+<div class="line"><a name="l04741"></a><span class="lineno"> 4741</span> <span class="comment"></span></div>
+<div class="line"><a name="l04742"></a><span class="lineno"> 4742</span> <span class="comment">    </span></div>
+<div class="line"><a name="l04743"></a><span class="lineno"> 4743</span> <span class="comment">    if (cpl_polynomial_eval_1d(ids, blue-refwave, NULL) > pixel)</span></div>
+<div class="line"><a name="l04744"></a><span class="lineno"> 4744</span> <span class="comment">        return 0.0;</span></div>
+<div class="line"><a name="l04745"></a><span class="lineno"> 4745</span> <span class="comment">    </span></div>
+<div class="line"><a name="l04746"></a><span class="lineno"> 4746</span> <span class="comment">    if (cpl_polynomial_eval_1d(ids, red-refwave, NULL) < pixel)</span></div>
+<div class="line"><a name="l04747"></a><span class="lineno"> 4747</span> <span class="comment">        return 0.0;</span></div>
+<div class="line"><a name="l04748"></a><span class="lineno"> 4748</span> <span class="comment"></span></div>
+<div class="line"><a name="l04749"></a><span class="lineno"> 4749</span> <span class="comment">    yellow = (blue + red) / 2;</span></div>
+<div class="line"><a name="l04750"></a><span class="lineno"> 4750</span> <span class="comment"></span></div>
+<div class="line"><a name="l04751"></a><span class="lineno"> 4751</span> <span class="comment">    cpixel = cpl_polynomial_eval_1d(ids, yellow-refwave, NULL);</span></div>
+<div class="line"><a name="l04752"></a><span class="lineno"> 4752</span> <span class="comment"></span></div>
+<div class="line"><a name="l04753"></a><span class="lineno"> 4753</span> <span class="comment">    while (fabs(cpixel - pixel) > tolerance && iter < max_iter) {</span></div>
+<div class="line"><a name="l04754"></a><span class="lineno"> 4754</span> <span class="comment"></span></div>
+<div class="line"><a name="l04755"></a><span class="lineno"> 4755</span> <span class="comment">        if (cpixel > pixel)</span></div>
+<div class="line"><a name="l04756"></a><span class="lineno"> 4756</span> <span class="comment">            red = yellow;</span></div>
+<div class="line"><a name="l04757"></a><span class="lineno"> 4757</span> <span class="comment">        else</span></div>
+<div class="line"><a name="l04758"></a><span class="lineno"> 4758</span> <span class="comment">            blue = yellow;</span></div>
+<div class="line"><a name="l04759"></a><span class="lineno"> 4759</span> <span class="comment"></span></div>
+<div class="line"><a name="l04760"></a><span class="lineno"> 4760</span> <span class="comment">        yellow = (blue + red) / 2;</span></div>
+<div class="line"><a name="l04761"></a><span class="lineno"> 4761</span> <span class="comment">        cpixel = cpl_polynomial_eval_1d(ids, yellow-refwave, NULL);</span></div>
+<div class="line"><a name="l04762"></a><span class="lineno"> 4762</span> <span class="comment"></span></div>
+<div class="line"><a name="l04763"></a><span class="lineno"> 4763</span> <span class="comment">        iter++;</span></div>
+<div class="line"><a name="l04764"></a><span class="lineno"> 4764</span> <span class="comment"></span></div>
+<div class="line"><a name="l04765"></a><span class="lineno"> 4765</span> <span class="comment">    }</span></div>
+<div class="line"><a name="l04766"></a><span class="lineno"> 4766</span> <span class="comment"></span></div>
+<div class="line"><a name="l04767"></a><span class="lineno"> 4767</span> <span class="comment">    return yellow;</span></div>
+<div class="line"><a name="l04768"></a><span class="lineno"> 4768</span> <span class="comment"></span></div>
+<div class="line"><a name="l04769"></a><span class="lineno"> 4769</span> <span class="comment">}</span></div>
+<div class="line"><a name="l04770"></a><span class="lineno"> 4770</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l04771"></a><span class="lineno"> 4771</span> </div>
+<div class="line"><a name="l04772"></a><span class="lineno"><a class="code" href="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a"> 4772</a></span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a" title="Evaluate the wavelength of a pixel position.">mos_eval_dds</a>(cpl_polynomial *ids, <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red,</div>
+<div class="line"><a name="l04773"></a><span class="lineno"> 4773</span>                     <span class="keywordtype">double</span> refwave, <span class="keywordtype">double</span> pixel)</div>
+<div class="line"><a name="l04774"></a><span class="lineno"> 4774</span> {</div>
+<div class="line"><a name="l04775"></a><span class="lineno"> 4775</span>     <span class="keywordtype">double</span>     yellow;</div>
+<div class="line"><a name="l04776"></a><span class="lineno"> 4776</span>     <span class="keywordtype">double</span>     coeff;</div>
+<div class="line"><a name="l04777"></a><span class="lineno"> 4777</span>     cpl_size   zero = 0;</div>
+<div class="line"><a name="l04778"></a><span class="lineno"> 4778</span> </div>
+<div class="line"><a name="l04779"></a><span class="lineno"> 4779</span>     <span class="keywordflow">if</span> (cpl_polynomial_eval_1d(ids, blue-refwave, NULL) > pixel)</div>
+<div class="line"><a name="l04780"></a><span class="lineno"> 4780</span>         <span class="keywordflow">return</span> 0.0;</div>
+<div class="line"><a name="l04781"></a><span class="lineno"> 4781</span> </div>
+<div class="line"><a name="l04782"></a><span class="lineno"> 4782</span>     <span class="keywordflow">if</span> (cpl_polynomial_eval_1d(ids, red-refwave, NULL) < pixel)</div>
+<div class="line"><a name="l04783"></a><span class="lineno"> 4783</span>         <span class="keywordflow">return</span> 0.0;</div>
+<div class="line"><a name="l04784"></a><span class="lineno"> 4784</span> </div>
+<div class="line"><a name="l04785"></a><span class="lineno"> 4785</span>     yellow = (blue + red) / 2 - refwave;</div>
+<div class="line"><a name="l04786"></a><span class="lineno"> 4786</span> </div>
+<div class="line"><a name="l04787"></a><span class="lineno"> 4787</span>     coeff = cpl_polynomial_get_coeff(ids, &zero);</div>
+<div class="line"><a name="l04788"></a><span class="lineno"> 4788</span>     cpl_polynomial_set_coeff(ids, &zero, coeff - pixel);</div>
+<div class="line"><a name="l04789"></a><span class="lineno"> 4789</span> </div>
+<div class="line"><a name="l04790"></a><span class="lineno"> 4790</span>     cpl_polynomial_solve_1d(ids, yellow, &yellow, 1);</div>
+<div class="line"><a name="l04791"></a><span class="lineno"> 4791</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l04792"></a><span class="lineno"> 4792</span>         cpl_error_reset();</div>
+<div class="line"><a name="l04793"></a><span class="lineno"> 4793</span>         <span class="keywordflow">return</span> 0.0;</div>
+<div class="line"><a name="l04794"></a><span class="lineno"> 4794</span>     }</div>
+<div class="line"><a name="l04795"></a><span class="lineno"> 4795</span> </div>
+<div class="line"><a name="l04796"></a><span class="lineno"> 4796</span>     cpl_polynomial_set_coeff(ids, &zero, coeff);</div>
+<div class="line"><a name="l04797"></a><span class="lineno"> 4797</span> </div>
+<div class="line"><a name="l04798"></a><span class="lineno"> 4798</span>     <span class="keywordflow">return</span> yellow + refwave;</div>
+<div class="line"><a name="l04799"></a><span class="lineno"> 4799</span> </div>
+<div class="line"><a name="l04800"></a><span class="lineno"> 4800</span> }</div>
+<div class="line"><a name="l04801"></a><span class="lineno"> 4801</span> </div>
+<div class="line"><a name="l04827"></a><span class="lineno"><a class="code" href="group__moses.html#ga4d584e69389518aab8d6932e5841d399"> 4827</a></span> cpl_polynomial *<a class="code" href="group__moses.html#ga4d584e69389518aab8d6932e5841d399" title="Fit polynomial relation from wavelengths to pixels.">mos_poly_wav2pix</a>(cpl_bivector *pixwav, <span class="keywordtype">int</span> order, </div>
+<div class="line"><a name="l04828"></a><span class="lineno"> 4828</span>                                  <span class="keywordtype">double</span> reject, <span class="keywordtype">int</span> minlines, </div>
+<div class="line"><a name="l04829"></a><span class="lineno"> 4829</span>                                  <span class="keywordtype">int</span> *nlines, <span class="keywordtype">double</span> *err)</div>
+<div class="line"><a name="l04830"></a><span class="lineno"> 4830</span> {</div>
+<div class="line"><a name="l04831"></a><span class="lineno"> 4831</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *func = <span class="stringliteral">"mos_poly_wav2pix"</span>;</div>
+<div class="line"><a name="l04832"></a><span class="lineno"> 4832</span> </div>
+<div class="line"><a name="l04833"></a><span class="lineno"> 4833</span>     cpl_bivector *pixwav2;</div>
+<div class="line"><a name="l04834"></a><span class="lineno"> 4834</span>     cpl_vector   *wavel;</div>
+<div class="line"><a name="l04835"></a><span class="lineno"> 4835</span>     cpl_vector   *pixel;</div>
+<div class="line"><a name="l04836"></a><span class="lineno"> 4836</span>     <span class="keywordtype">double</span>       *d_wavel;</div>
+<div class="line"><a name="l04837"></a><span class="lineno"> 4837</span>     <span class="keywordtype">double</span>       *d_pixel;</div>
+<div class="line"><a name="l04838"></a><span class="lineno"> 4838</span>     <span class="keywordtype">double</span>        pixpos;</div>
+<div class="line"><a name="l04839"></a><span class="lineno"> 4839</span>     <span class="keywordtype">int</span>           fitlines;</div>
+<div class="line"><a name="l04840"></a><span class="lineno"> 4840</span>     <span class="keywordtype">int</span>           rejection = 0;</div>
+<div class="line"><a name="l04841"></a><span class="lineno"> 4841</span>     <span class="keywordtype">int</span>           i, j;</div>
+<div class="line"><a name="l04842"></a><span class="lineno"> 4842</span> </div>
+<div class="line"><a name="l04843"></a><span class="lineno"> 4843</span>     cpl_polynomial *ids;</div>
+<div class="line"><a name="l04844"></a><span class="lineno"> 4844</span> </div>
+<div class="line"><a name="l04845"></a><span class="lineno"> 4845</span> </div>
+<div class="line"><a name="l04846"></a><span class="lineno"> 4846</span>     *nlines = 0;</div>
+<div class="line"><a name="l04847"></a><span class="lineno"> 4847</span>     *err = 0;</div>
+<div class="line"><a name="l04848"></a><span class="lineno"> 4848</span> </div>
+<div class="line"><a name="l04849"></a><span class="lineno"> 4849</span>     <span class="keywordflow">if</span> (pixwav == NULL) {</div>
+<div class="line"><a name="l04850"></a><span class="lineno"> 4850</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l04851"></a><span class="lineno"> 4851</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l04852"></a><span class="lineno"> 4852</span>     }</div>
+<div class="line"><a name="l04853"></a><span class="lineno"> 4853</span> </div>
+<div class="line"><a name="l04854"></a><span class="lineno"> 4854</span>     fitlines = cpl_bivector_get_size(pixwav);</div>
+<div class="line"><a name="l04855"></a><span class="lineno"> 4855</span> </div>
+<div class="line"><a name="l04856"></a><span class="lineno"> 4856</span>     <span class="keywordflow">if</span> (fitlines < minlines) {</div>
+<div class="line"><a name="l04857"></a><span class="lineno"> 4857</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l04858"></a><span class="lineno"> 4858</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l04859"></a><span class="lineno"> 4859</span>     }</div>
+<div class="line"><a name="l04860"></a><span class="lineno"> 4860</span> </div>
+<div class="line"><a name="l04861"></a><span class="lineno"> 4861</span> </div>
+<div class="line"><a name="l04862"></a><span class="lineno"> 4862</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04863"></a><span class="lineno"> 4863</span> <span class="comment">     * If outliers rejection was requested, allocate a working</span></div>
+<div class="line"><a name="l04864"></a><span class="lineno"> 4864</span> <span class="comment">     * vector (that can be modified as soon as outliers are removed)</span></div>
+<div class="line"><a name="l04865"></a><span class="lineno"> 4865</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04866"></a><span class="lineno"> 4866</span> </div>
+<div class="line"><a name="l04867"></a><span class="lineno"> 4867</span>     <span class="keywordflow">if</span> (reject > 0.0)</div>
+<div class="line"><a name="l04868"></a><span class="lineno"> 4868</span>         rejection = 1;</div>
+<div class="line"><a name="l04869"></a><span class="lineno"> 4869</span> </div>
+<div class="line"><a name="l04870"></a><span class="lineno"> 4870</span>     <span class="keywordflow">if</span> (rejection)</div>
+<div class="line"><a name="l04871"></a><span class="lineno"> 4871</span>         pixwav2 = cpl_bivector_duplicate(pixwav);</div>
+<div class="line"><a name="l04872"></a><span class="lineno"> 4872</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l04873"></a><span class="lineno"> 4873</span>         pixwav2 = pixwav;</div>
+<div class="line"><a name="l04874"></a><span class="lineno"> 4874</span> </div>
+<div class="line"><a name="l04875"></a><span class="lineno"> 4875</span> </div>
+<div class="line"><a name="l04876"></a><span class="lineno"> 4876</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04877"></a><span class="lineno"> 4877</span> <span class="comment">     * The single vectors are extracted just because the fitting routine</span></div>
+<div class="line"><a name="l04878"></a><span class="lineno"> 4878</span> <span class="comment">     * requires it</span></div>
+<div class="line"><a name="l04879"></a><span class="lineno"> 4879</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04880"></a><span class="lineno"> 4880</span> </div>
+<div class="line"><a name="l04881"></a><span class="lineno"> 4881</span>     pixel = cpl_bivector_get_x(pixwav2);</div>
+<div class="line"><a name="l04882"></a><span class="lineno"> 4882</span>     wavel = cpl_bivector_get_y(pixwav2);</div>
+<div class="line"><a name="l04883"></a><span class="lineno"> 4883</span> </div>
+<div class="line"><a name="l04884"></a><span class="lineno"> 4884</span> </div>
+<div class="line"><a name="l04885"></a><span class="lineno"> 4885</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04886"></a><span class="lineno"> 4886</span> <span class="comment">     * Get rid of the wrapper, in case of duplication</span></div>
+<div class="line"><a name="l04887"></a><span class="lineno"> 4887</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04888"></a><span class="lineno"> 4888</span> </div>
+<div class="line"><a name="l04889"></a><span class="lineno"> 4889</span>     <span class="keywordflow">if</span> (rejection)</div>
+<div class="line"><a name="l04890"></a><span class="lineno"> 4890</span>         cpl_bivector_unwrap_vectors(pixwav2);</div>
+<div class="line"><a name="l04891"></a><span class="lineno"> 4891</span> </div>
+<div class="line"><a name="l04892"></a><span class="lineno"> 4892</span> </div>
+<div class="line"><a name="l04893"></a><span class="lineno"> 4893</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l04894"></a><span class="lineno"> 4894</span> <span class="comment">     * Here begins the iterative fit of identified lines</span></div>
+<div class="line"><a name="l04895"></a><span class="lineno"> 4895</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l04896"></a><span class="lineno"> 4896</span> </div>
+<div class="line"><a name="l04897"></a><span class="lineno"> 4897</span>     <span class="keywordflow">while</span> (fitlines >= minlines) {</div>
+<div class="line"><a name="l04898"></a><span class="lineno"> 4898</span> </div>
+<div class="line"><a name="l04899"></a><span class="lineno"> 4899</span>         ids = cpl_polynomial_fit_1d_create(wavel, pixel, order, err);</div>
+<div class="line"><a name="l04900"></a><span class="lineno"> 4900</span>         *err = sqrt(*err);</div>
+<div class="line"><a name="l04901"></a><span class="lineno"> 4901</span>     </div>
+<div class="line"><a name="l04902"></a><span class="lineno"> 4902</span>         <span class="keywordflow">if</span> (ids == NULL) {</div>
+<div class="line"><a name="l04903"></a><span class="lineno"> 4903</span>             cpl_msg_debug(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l04904"></a><span class="lineno"> 4904</span>             cpl_msg_debug(func, <span class="stringliteral">"Fitting IDS"</span>);</div>
+<div class="line"><a name="l04905"></a><span class="lineno"> 4905</span>             cpl_error_set_where(func);</div>
+<div class="line"><a name="l04906"></a><span class="lineno"> 4906</span>             <span class="keywordflow">if</span> (rejection) {</div>
+<div class="line"><a name="l04907"></a><span class="lineno"> 4907</span>                 cpl_vector_delete(wavel);</div>
+<div class="line"><a name="l04908"></a><span class="lineno"> 4908</span>                 cpl_vector_delete(pixel);</div>
+<div class="line"><a name="l04909"></a><span class="lineno"> 4909</span>             }</div>
+<div class="line"><a name="l04910"></a><span class="lineno"> 4910</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l04911"></a><span class="lineno"> 4911</span>         }</div>
+<div class="line"><a name="l04912"></a><span class="lineno"> 4912</span> </div>
+<div class="line"><a name="l04913"></a><span class="lineno"> 4913</span>         <span class="keywordflow">if</span> (rejection) {</div>
+<div class="line"><a name="l04914"></a><span class="lineno"> 4914</span> </div>
+<div class="line"><a name="l04915"></a><span class="lineno"> 4915</span> </div>
+<div class="line"><a name="l04916"></a><span class="lineno"> 4916</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l04917"></a><span class="lineno"> 4917</span> <span class="comment">             * Now work directly with the vector data buffers...</span></div>
+<div class="line"><a name="l04918"></a><span class="lineno"> 4918</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l04919"></a><span class="lineno"> 4919</span> </div>
+<div class="line"><a name="l04920"></a><span class="lineno"> 4920</span>             d_pixel = cpl_vector_unwrap(pixel);</div>
+<div class="line"><a name="l04921"></a><span class="lineno"> 4921</span>             d_wavel = cpl_vector_unwrap(wavel);</div>
+<div class="line"><a name="l04922"></a><span class="lineno"> 4922</span> </div>
+<div class="line"><a name="l04923"></a><span class="lineno"> 4923</span>             <span class="keywordflow">for</span> (i = 0, j = 0; i < fitlines; i++) {</div>
+<div class="line"><a name="l04924"></a><span class="lineno"> 4924</span>                 pixpos = cpl_polynomial_eval_1d(ids, d_wavel[i], NULL);</div>
+<div class="line"><a name="l04925"></a><span class="lineno"> 4925</span>                 <span class="keywordflow">if</span> (fabs(pixpos - d_pixel[i]) < reject) {</div>
+<div class="line"><a name="l04926"></a><span class="lineno"> 4926</span>                     d_pixel[j] = d_pixel[i];</div>
+<div class="line"><a name="l04927"></a><span class="lineno"> 4927</span>                     d_wavel[j] = d_wavel[i];</div>
+<div class="line"><a name="l04928"></a><span class="lineno"> 4928</span>                     j++;</div>
+<div class="line"><a name="l04929"></a><span class="lineno"> 4929</span>                 }</div>
+<div class="line"><a name="l04930"></a><span class="lineno"> 4930</span>             }</div>
+<div class="line"><a name="l04931"></a><span class="lineno"> 4931</span>     </div>
+<div class="line"><a name="l04932"></a><span class="lineno"> 4932</span>             <span class="keywordflow">if</span> (j == fitlines) {       <span class="comment">/* No rejection in last iteration */</span></div>
+<div class="line"><a name="l04933"></a><span class="lineno"> 4933</span>                 cpl_free(d_wavel);</div>
+<div class="line"><a name="l04934"></a><span class="lineno"> 4934</span>                 cpl_free(d_pixel);</div>
+<div class="line"><a name="l04935"></a><span class="lineno"> 4935</span>                 *nlines = fitlines;</div>
+<div class="line"><a name="l04936"></a><span class="lineno"> 4936</span>                 <span class="keywordflow">return</span> ids;</div>
+<div class="line"><a name="l04937"></a><span class="lineno"> 4937</span>             }</div>
+<div class="line"><a name="l04938"></a><span class="lineno"> 4938</span>             <span class="keywordflow">else</span> {                     <span class="comment">/* Some lines were rejected       */</span></div>
+<div class="line"><a name="l04939"></a><span class="lineno"> 4939</span>                 fitlines = j;</div>
+<div class="line"><a name="l04940"></a><span class="lineno"> 4940</span>                 cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l04941"></a><span class="lineno"> 4941</span>                 <span class="keywordflow">if</span> (fitlines >= minlines) {</div>
+<div class="line"><a name="l04942"></a><span class="lineno"> 4942</span>                     pixel = cpl_vector_wrap(fitlines, d_pixel);</div>
+<div class="line"><a name="l04943"></a><span class="lineno"> 4943</span>                     wavel = cpl_vector_wrap(fitlines, d_wavel);</div>
+<div class="line"><a name="l04944"></a><span class="lineno"> 4944</span>                 }</div>
+<div class="line"><a name="l04945"></a><span class="lineno"> 4945</span>                 <span class="keywordflow">else</span> {                 <span class="comment">/* Too few lines: failure         */</span></div>
+<div class="line"><a name="l04946"></a><span class="lineno"> 4946</span>                     cpl_free(d_wavel);</div>
+<div class="line"><a name="l04947"></a><span class="lineno"> 4947</span>                     cpl_free(d_pixel);</div>
+<div class="line"><a name="l04948"></a><span class="lineno"> 4948</span>                     cpl_error_set(func, CPL_ERROR_CONTINUE);</div>
+<div class="line"><a name="l04949"></a><span class="lineno"> 4949</span>                     <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l04950"></a><span class="lineno"> 4950</span>                 }</div>
+<div class="line"><a name="l04951"></a><span class="lineno"> 4951</span>             }</div>
+<div class="line"><a name="l04952"></a><span class="lineno"> 4952</span>         }</div>
+<div class="line"><a name="l04953"></a><span class="lineno"> 4953</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l04954"></a><span class="lineno"> 4954</span>             *nlines = fitlines;</div>
+<div class="line"><a name="l04955"></a><span class="lineno"> 4955</span>             <span class="keywordflow">return</span> ids;       <span class="comment">/* Exit at first iteration if no rejection */</span></div>
+<div class="line"><a name="l04956"></a><span class="lineno"> 4956</span>         }</div>
+<div class="line"><a name="l04957"></a><span class="lineno"> 4957</span>     }</div>
+<div class="line"><a name="l04958"></a><span class="lineno"> 4958</span> </div>
+<div class="line"><a name="l04959"></a><span class="lineno"> 4959</span>     <span class="keywordflow">return</span> ids;               <span class="comment">/* To avoid compiler warnings */</span></div>
+<div class="line"><a name="l04960"></a><span class="lineno"> 4960</span> }</div>
+<div class="line"><a name="l04961"></a><span class="lineno"> 4961</span> </div>
+<div class="line"><a name="l04962"></a><span class="lineno"> 4962</span> </div>
+<div class="line"><a name="l04987"></a><span class="lineno"><a class="code" href="group__moses.html#ga8d5305df3cb184677081fb285cba6eb5"> 4987</a></span> cpl_polynomial *<a class="code" href="group__moses.html#ga8d5305df3cb184677081fb285cba6eb5" title="Fit polynomial relation from pixels to wavelengths.">mos_poly_pix2wav</a>(cpl_bivector *pixwav, <span class="keywordtype">int</span> order,</div>
+<div class="line"><a name="l04988"></a><span class="lineno"> 4988</span>                                  <span class="keywordtype">double</span> reject, <span class="keywordtype">int</span> minlines, </div>
+<div class="line"><a name="l04989"></a><span class="lineno"> 4989</span>                                  <span class="keywordtype">int</span> *nlines, <span class="keywordtype">double</span> *err)</div>
+<div class="line"><a name="l04990"></a><span class="lineno"> 4990</span> {</div>
+<div class="line"><a name="l04991"></a><span class="lineno"> 4991</span> </div>
+<div class="line"><a name="l04992"></a><span class="lineno"> 4992</span>     cpl_bivector *wavpix;</div>
+<div class="line"><a name="l04993"></a><span class="lineno"> 4993</span>     cpl_vector   *wavel;</div>
+<div class="line"><a name="l04994"></a><span class="lineno"> 4994</span>     cpl_vector   *pixel;</div>
+<div class="line"><a name="l04995"></a><span class="lineno"> 4995</span> </div>
+<div class="line"><a name="l04996"></a><span class="lineno"> 4996</span>     cpl_polynomial *dds;</div>
+<div class="line"><a name="l04997"></a><span class="lineno"> 4997</span> </div>
+<div class="line"><a name="l04998"></a><span class="lineno"> 4998</span> </div>
+<div class="line"><a name="l04999"></a><span class="lineno"> 4999</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l05000"></a><span class="lineno"> 5000</span> <span class="comment">     * Swap vectors in bivector, in order to reuse mos_poly_wav2pix()</span></div>
+<div class="line"><a name="l05001"></a><span class="lineno"> 5001</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l05002"></a><span class="lineno"> 5002</span> </div>
+<div class="line"><a name="l05003"></a><span class="lineno"> 5003</span>     pixel = cpl_bivector_get_x(pixwav);</div>
+<div class="line"><a name="l05004"></a><span class="lineno"> 5004</span>     wavel = cpl_bivector_get_y(pixwav);</div>
+<div class="line"><a name="l05005"></a><span class="lineno"> 5005</span> </div>
+<div class="line"><a name="l05006"></a><span class="lineno"> 5006</span>     wavpix = cpl_bivector_wrap_vectors(wavel, pixel);</div>
+<div class="line"><a name="l05007"></a><span class="lineno"> 5007</span> </div>
+<div class="line"><a name="l05008"></a><span class="lineno"> 5008</span>     dds = <a class="code" href="group__moses.html#ga4d584e69389518aab8d6932e5841d399" title="Fit polynomial relation from wavelengths to pixels.">mos_poly_wav2pix</a>(wavpix, order, reject, minlines, nlines, err);</div>
+<div class="line"><a name="l05009"></a><span class="lineno"> 5009</span> </div>
+<div class="line"><a name="l05010"></a><span class="lineno"> 5010</span>     cpl_bivector_unwrap_vectors(wavpix);</div>
+<div class="line"><a name="l05011"></a><span class="lineno"> 5011</span> </div>
+<div class="line"><a name="l05012"></a><span class="lineno"> 5012</span>     <span class="keywordflow">return</span> dds;</div>
+<div class="line"><a name="l05013"></a><span class="lineno"> 5013</span> </div>
+<div class="line"><a name="l05014"></a><span class="lineno"> 5014</span> }</div>
+<div class="line"><a name="l05015"></a><span class="lineno"> 5015</span> </div>
+<div class="line"><a name="l05016"></a><span class="lineno"> 5016</span> </div>
+<div class="line"><a name="l05039"></a><span class="lineno"><a class="code" href="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe"> 5039</a></span> cpl_bivector *<a class="code" href="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe" title="Find the reference lines peaks using a polynomial first-guess.">mos_find_peaks</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *spectrum, <span class="keywordtype">int</span> length, </div>
+<div class="line"><a name="l05040"></a><span class="lineno"> 5040</span>                              cpl_vector *lines, cpl_polynomial *ids, </div>
+<div class="line"><a name="l05041"></a><span class="lineno"> 5041</span>                              <span class="keywordtype">double</span> refwave, <span class="keywordtype">int</span> sradius)</div>
+<div class="line"><a name="l05042"></a><span class="lineno"> 5042</span> {</div>
+<div class="line"><a name="l05043"></a><span class="lineno"> 5043</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>   *func = <span class="stringliteral">"mos_find_peaks"</span>;</div>
+<div class="line"><a name="l05044"></a><span class="lineno"> 5044</span> </div>
+<div class="line"><a name="l05045"></a><span class="lineno"> 5045</span>     <span class="keywordtype">double</span>       *data;</div>
+<div class="line"><a name="l05046"></a><span class="lineno"> 5046</span>     <span class="keywordtype">double</span>       *d_pixel;</div>
+<div class="line"><a name="l05047"></a><span class="lineno"> 5047</span>     <span class="keywordtype">double</span>       *d_wavel;</div>
+<div class="line"><a name="l05048"></a><span class="lineno"> 5048</span>     <span class="keywordtype">float</span>         pos;</div>
+<div class="line"><a name="l05049"></a><span class="lineno"> 5049</span>     <span class="keywordtype">int</span>           nlines;</div>
+<div class="line"><a name="l05050"></a><span class="lineno"> 5050</span>     <span class="keywordtype">int</span>           pixel;</div>
+<div class="line"><a name="l05051"></a><span class="lineno"> 5051</span>     <span class="keywordtype">int</span>           i, j;</div>
+<div class="line"><a name="l05052"></a><span class="lineno"> 5052</span> </div>
+<div class="line"><a name="l05053"></a><span class="lineno"> 5053</span> </div>
+<div class="line"><a name="l05054"></a><span class="lineno"> 5054</span>     <span class="keywordflow">if</span> (spectrum == NULL || lines == NULL || ids == NULL) {</div>
+<div class="line"><a name="l05055"></a><span class="lineno"> 5055</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l05056"></a><span class="lineno"> 5056</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l05057"></a><span class="lineno"> 5057</span>     }</div>
+<div class="line"><a name="l05058"></a><span class="lineno"> 5058</span> </div>
+<div class="line"><a name="l05059"></a><span class="lineno"> 5059</span>     nlines = cpl_vector_get_size(lines);</div>
+<div class="line"><a name="l05060"></a><span class="lineno"> 5060</span> </div>
+<div class="line"><a name="l05061"></a><span class="lineno"> 5061</span>     <span class="keywordflow">if</span> (sradius < 1 || length < 2*sradius+1 || nlines < 1) {</div>
+<div class="line"><a name="l05062"></a><span class="lineno"> 5062</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l05063"></a><span class="lineno"> 5063</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l05064"></a><span class="lineno"> 5064</span>     }</div>
+<div class="line"><a name="l05065"></a><span class="lineno"> 5065</span> </div>
+<div class="line"><a name="l05066"></a><span class="lineno"> 5066</span>     d_wavel = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l05067"></a><span class="lineno"> 5067</span>     d_pixel = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l05068"></a><span class="lineno"> 5068</span> </div>
+<div class="line"><a name="l05069"></a><span class="lineno"> 5069</span>     data = cpl_vector_get_data(lines);</div>
+<div class="line"><a name="l05070"></a><span class="lineno"> 5070</span> </div>
+<div class="line"><a name="l05071"></a><span class="lineno"> 5071</span>     <span class="keywordflow">for</span> (i = 0, j = 0; i < nlines; i++) {</div>
+<div class="line"><a name="l05072"></a><span class="lineno"> 5072</span>         pixel = cpl_polynomial_eval_1d(ids, data[i]-refwave, NULL) + 0.5;</div>
+<div class="line"><a name="l05073"></a><span class="lineno"> 5073</span>         <span class="keywordflow">if</span> (pixel < 0 || pixel - sradius < 0 || pixel + sradius >= length)</div>
+<div class="line"><a name="l05074"></a><span class="lineno"> 5074</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l05075"></a><span class="lineno"> 5075</span>         <span class="keywordflow">if</span> (peakPosition(spectrum+pixel-sradius, 2*sradius+1, &pos, 1) == 0) {</div>
+<div class="line"><a name="l05076"></a><span class="lineno"> 5076</span>             pos += pixel - sradius;</div>
+<div class="line"><a name="l05077"></a><span class="lineno"> 5077</span>             d_pixel[j] = pos;</div>
+<div class="line"><a name="l05078"></a><span class="lineno"> 5078</span>             d_wavel[j] = data[i];</div>
+<div class="line"><a name="l05079"></a><span class="lineno"> 5079</span>             j++;</div>
+<div class="line"><a name="l05080"></a><span class="lineno"> 5080</span>         }</div>
+<div class="line"><a name="l05081"></a><span class="lineno"> 5081</span>     }</div>
+<div class="line"><a name="l05082"></a><span class="lineno"> 5082</span> </div>
+<div class="line"><a name="l05083"></a><span class="lineno"> 5083</span>     <span class="keywordflow">if</span> (j > 0) {</div>
+<div class="line"><a name="l05084"></a><span class="lineno"> 5084</span>         <span class="keywordflow">return</span> cpl_bivector_wrap_vectors(cpl_vector_wrap(j, d_pixel),</div>
+<div class="line"><a name="l05085"></a><span class="lineno"> 5085</span>                                          cpl_vector_wrap(j, d_wavel));</div>
+<div class="line"><a name="l05086"></a><span class="lineno"> 5086</span>     }</div>
+<div class="line"><a name="l05087"></a><span class="lineno"> 5087</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l05088"></a><span class="lineno"> 5088</span>         cpl_free(d_wavel);</div>
+<div class="line"><a name="l05089"></a><span class="lineno"> 5089</span>         cpl_free(d_pixel);</div>
+<div class="line"><a name="l05090"></a><span class="lineno"> 5090</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_OUTPUT);</div>
+<div class="line"><a name="l05091"></a><span class="lineno"> 5091</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l05092"></a><span class="lineno"> 5092</span>     }</div>
+<div class="line"><a name="l05093"></a><span class="lineno"> 5093</span> }</div>
+<div class="line"><a name="l05094"></a><span class="lineno"> 5094</span> </div>
+<div class="line"><a name="l05095"></a><span class="lineno"> 5095</span> </div>
+<div class="line"><a name="l05219"></a><span class="lineno"><a class="code" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d"> 5219</a></span> cpl_image *<a class="code" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw</a>(<span class="keyword">const</span> cpl_image *image,</div>
+<div class="line"><a name="l05220"></a><span class="lineno"> 5220</span>                                           cpl_vector *lines,</div>
+<div class="line"><a name="l05221"></a><span class="lineno"> 5221</span>                                           <span class="keywordtype">double</span> dispersion, <span class="keywordtype">float</span> level,</div>
+<div class="line"><a name="l05222"></a><span class="lineno"> 5222</span>                                           <span class="keywordtype">int</span> sradius, <span class="keywordtype">int</span> order,</div>
+<div class="line"><a name="l05223"></a><span class="lineno"> 5223</span>                                           <span class="keywordtype">double</span> reject, <span class="keywordtype">double</span> refwave, </div>
+<div class="line"><a name="l05224"></a><span class="lineno"> 5224</span>                                           <span class="keywordtype">double</span> *wavestart, <span class="keywordtype">double</span> *waveend,</div>
+<div class="line"><a name="l05225"></a><span class="lineno"> 5225</span>                                           <span class="keywordtype">int</span> *nlines, <span class="keywordtype">double</span> *error, </div>
+<div class="line"><a name="l05226"></a><span class="lineno"> 5226</span>                                           cpl_table *idscoeff,</div>
+<div class="line"><a name="l05227"></a><span class="lineno"> 5227</span>                                           cpl_image *calibration,</div>
+<div class="line"><a name="l05228"></a><span class="lineno"> 5228</span>                                           cpl_image *residuals, </div>
+<div class="line"><a name="l05229"></a><span class="lineno"> 5229</span>                                           cpl_table *restable,</div>
+<div class="line"><a name="l05230"></a><span class="lineno"> 5230</span>                                           cpl_mask *refmask,</div>
+<div class="line"><a name="l05231"></a><span class="lineno"> 5231</span>                                           cpl_table *detected_lines)</div>
+<div class="line"><a name="l05232"></a><span class="lineno"> 5232</span> {</div>
+<div class="line"><a name="l05233"></a><span class="lineno"> 5233</span> </div>
+<div class="line"><a name="l05234"></a><span class="lineno"> 5234</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_wavelength_calibration_raw"</span>;</div>
+<div class="line"><a name="l05235"></a><span class="lineno"> 5235</span> </div>
+<div class="line"><a name="l05236"></a><span class="lineno"> 5236</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l05237"></a><span class="lineno"> 5237</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l05238"></a><span class="lineno"> 5238</span> </div>
+<div class="line"><a name="l05239"></a><span class="lineno"> 5239</span>     <span class="keywordtype">double</span>  tolerance = 20.0;     <span class="comment">/* Probably forever...                */</span></div>
+<div class="line"><a name="l05240"></a><span class="lineno"> 5240</span>     <span class="keywordtype">int</span>     step      = 10;       <span class="comment">/* Compute restable every "step" rows */</span></div>
+<div class="line"><a name="l05241"></a><span class="lineno"> 5241</span> </div>
+<div class="line"><a name="l05242"></a><span class="lineno"> 5242</span>     <span class="keywordtype">char</span>            name[MAX_COLNAME];</div>
+<div class="line"><a name="l05243"></a><span class="lineno"> 5243</span>     cpl_image      *resampled;</div>
+<div class="line"><a name="l05244"></a><span class="lineno"> 5244</span>     cpl_bivector   *output;</div>
+<div class="line"><a name="l05245"></a><span class="lineno"> 5245</span>     cpl_bivector   *new_output;</div>
+<div class="line"><a name="l05246"></a><span class="lineno"> 5246</span>     cpl_vector     *peaks;</div>
+<div class="line"><a name="l05247"></a><span class="lineno"> 5247</span>     cpl_vector     *wavel;</div>
+<div class="line"><a name="l05248"></a><span class="lineno"> 5248</span>     cpl_polynomial *ids;</div>
+<div class="line"><a name="l05249"></a><span class="lineno"> 5249</span>     cpl_polynomial *lin;</div>
+<div class="line"><a name="l05250"></a><span class="lineno"> 5250</span>     cpl_matrix     *kernel;</div>
+<div class="line"><a name="l05251"></a><span class="lineno"> 5251</span>     <span class="keywordtype">double</span>          ids_err;</div>
+<div class="line"><a name="l05252"></a><span class="lineno"> 5252</span>     <span class="keywordtype">double</span>          max_disp, min_disp;</div>
+<div class="line"><a name="l05253"></a><span class="lineno"> 5253</span>     <span class="keywordtype">double</span>         *line;</div>
+<div class="line"><a name="l05254"></a><span class="lineno"> 5254</span>     <span class="keywordtype">double</span>          firstLambda, lastLambda, lambda;</div>
+<div class="line"><a name="l05255"></a><span class="lineno"> 5255</span>     <span class="keywordtype">double</span>          value, wave, pixe;</div>
+<div class="line"><a name="l05256"></a><span class="lineno"> 5256</span>     cpl_binary     *mdata;</div>
+<div class="line"><a name="l05257"></a><span class="lineno"> 5257</span>     <span class="keyword">const</span> <span class="keywordtype">float</span>    *sdata;</div>
+<div class="line"><a name="l05258"></a><span class="lineno"> 5258</span>     <span class="keywordtype">float</span>          *rdata;</div>
+<div class="line"><a name="l05259"></a><span class="lineno"> 5259</span>     <span class="keywordtype">float</span>          *idata;</div>
+<div class="line"><a name="l05260"></a><span class="lineno"> 5260</span>     <span class="keywordtype">float</span>          *ddata;</div>
+<div class="line"><a name="l05261"></a><span class="lineno"> 5261</span>     <span class="keywordtype">float</span>           v1, v2, vi;</div>
+<div class="line"><a name="l05262"></a><span class="lineno"> 5262</span>     <span class="keywordtype">float</span>           fpixel;</div>
+<div class="line"><a name="l05263"></a><span class="lineno"> 5263</span>     <span class="keywordtype">int</span>            *have_it;</div>
+<div class="line"><a name="l05264"></a><span class="lineno"> 5264</span>     <span class="keywordtype">int</span>             pixstart, pixend;</div>
+<div class="line"><a name="l05265"></a><span class="lineno"> 5265</span>     <span class="keywordtype">int</span>             extrapolation;</div>
+<div class="line"><a name="l05266"></a><span class="lineno"> 5266</span>     <span class="keywordtype">int</span>             nref;</div>
+<div class="line"><a name="l05267"></a><span class="lineno"> 5267</span>     <span class="keywordtype">int</span>             nl, nx, ny, pixel;</div>
+<div class="line"><a name="l05268"></a><span class="lineno"> 5268</span>     <span class="keywordtype">int</span>             countLines, usedLines;</div>
+<div class="line"><a name="l05269"></a><span class="lineno"> 5269</span>     <span class="keywordtype">int</span>             uorder;</div>
+<div class="line"><a name="l05270"></a><span class="lineno"> 5270</span>     <span class="keywordtype">int</span>             in, first, last;</div>
+<div class="line"><a name="l05271"></a><span class="lineno"> 5271</span>     <span class="keywordtype">int</span>             width, uradius;</div>
+<div class="line"><a name="l05272"></a><span class="lineno"> 5272</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l05273"></a><span class="lineno"> 5273</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l05274"></a><span class="lineno"> 5274</span>     cpl_size        k;</div>
+<div class="line"><a name="l05275"></a><span class="lineno"> 5275</span> </div>
+<div class="line"><a name="l05276"></a><span class="lineno"> 5276</span> </div>
+<div class="line"><a name="l05277"></a><span class="lineno"> 5277</span>     <span class="keywordflow">if</span> (dispersion == 0.0) {</div>
+<div class="line"><a name="l05278"></a><span class="lineno"> 5278</span>         cpl_msg_error(func, <span class="stringliteral">"The expected dispersion (A/pixel) must be given"</span>);</div>
+<div class="line"><a name="l05279"></a><span class="lineno"> 5279</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l05280"></a><span class="lineno"> 5280</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l05281"></a><span class="lineno"> 5281</span>     }</div>
+<div class="line"><a name="l05282"></a><span class="lineno"> 5282</span> </div>
+<div class="line"><a name="l05283"></a><span class="lineno"> 5283</span>     <span class="keywordflow">if</span> (dispersion < 0.0) {</div>
+<div class="line"><a name="l05284"></a><span class="lineno"> 5284</span>         cpl_msg_error(func, <span class="stringliteral">"The expected dispersion must be positive"</span>);</div>
+<div class="line"><a name="l05285"></a><span class="lineno"> 5285</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l05286"></a><span class="lineno"> 5286</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l05287"></a><span class="lineno"> 5287</span>     }</div>
+<div class="line"><a name="l05288"></a><span class="lineno"> 5288</span> </div>
+<div class="line"><a name="l05289"></a><span class="lineno"> 5289</span>     max_disp = dispersion + dispersion * tolerance / 100;</div>
+<div class="line"><a name="l05290"></a><span class="lineno"> 5290</span>     min_disp = dispersion - dispersion * tolerance / 100;</div>
+<div class="line"><a name="l05291"></a><span class="lineno"> 5291</span> </div>
+<div class="line"><a name="l05292"></a><span class="lineno"> 5292</span>     <span class="keywordflow">if</span> (order < 1) {</div>
+<div class="line"><a name="l05293"></a><span class="lineno"> 5293</span>         cpl_msg_error(func, <span class="stringliteral">"The order of the fitting polynomial "</span></div>
+<div class="line"><a name="l05294"></a><span class="lineno"> 5294</span>                       <span class="stringliteral">"must be at least 1"</span>);</div>
+<div class="line"><a name="l05295"></a><span class="lineno"> 5295</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l05296"></a><span class="lineno"> 5296</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l05297"></a><span class="lineno"> 5297</span>     }</div>
+<div class="line"><a name="l05298"></a><span class="lineno"> 5298</span> </div>
+<div class="line"><a name="l05299"></a><span class="lineno"> 5299</span>     <span class="keywordflow">if</span> (image == NULL || lines == NULL) {</div>
+<div class="line"><a name="l05300"></a><span class="lineno"> 5300</span>         cpl_msg_error(func, <span class="stringliteral">"Both spectral exposure and reference line "</span></div>
+<div class="line"><a name="l05301"></a><span class="lineno"> 5301</span>                       <span class="stringliteral">"catalog are required in input"</span>);</div>
+<div class="line"><a name="l05302"></a><span class="lineno"> 5302</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l05303"></a><span class="lineno"> 5303</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l05304"></a><span class="lineno"> 5304</span>     }</div>
+<div class="line"><a name="l05305"></a><span class="lineno"> 5305</span> </div>
+<div class="line"><a name="l05306"></a><span class="lineno"> 5306</span>     nx = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l05307"></a><span class="lineno"> 5307</span>     ny = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l05308"></a><span class="lineno"> 5308</span>     sdata = cpl_image_get_data_float_const(image);</div>
+<div class="line"><a name="l05309"></a><span class="lineno"> 5309</span> </div>
+<div class="line"><a name="l05310"></a><span class="lineno"> 5310</span>     nref = cpl_vector_get_size(lines);</div>
+<div class="line"><a name="l05311"></a><span class="lineno"> 5311</span>     line = cpl_vector_get_data(lines);</div>
+<div class="line"><a name="l05312"></a><span class="lineno"> 5312</span> </div>
+<div class="line"><a name="l05313"></a><span class="lineno"> 5313</span>     <span class="keywordflow">if</span> (*wavestart < 1.0 && *waveend < 1.0) {</div>
+<div class="line"><a name="l05314"></a><span class="lineno"> 5314</span>         firstLambda = line[0];</div>
+<div class="line"><a name="l05315"></a><span class="lineno"> 5315</span>         lastLambda = line[nref-1];</div>
+<div class="line"><a name="l05316"></a><span class="lineno"> 5316</span>         extrapolation = (lastLambda - firstLambda) / 10;</div>
+<div class="line"><a name="l05317"></a><span class="lineno"> 5317</span>         firstLambda -= extrapolation;</div>
+<div class="line"><a name="l05318"></a><span class="lineno"> 5318</span>         lastLambda += extrapolation;</div>
+<div class="line"><a name="l05319"></a><span class="lineno"> 5319</span>         *wavestart = firstLambda;</div>
+<div class="line"><a name="l05320"></a><span class="lineno"> 5320</span>         *waveend = lastLambda;</div>
+<div class="line"><a name="l05321"></a><span class="lineno"> 5321</span>     }</div>
+<div class="line"><a name="l05322"></a><span class="lineno"> 5322</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l05323"></a><span class="lineno"> 5323</span>         firstLambda = *wavestart;</div>
+<div class="line"><a name="l05324"></a><span class="lineno"> 5324</span>         lastLambda = *waveend;</div>
+<div class="line"><a name="l05325"></a><span class="lineno"> 5325</span>     }</div>
+<div class="line"><a name="l05326"></a><span class="lineno"> 5326</span> </div>
+<div class="line"><a name="l05327"></a><span class="lineno"> 5327</span>     nl = (lastLambda - firstLambda) / dispersion;</div>
+<div class="line"><a name="l05328"></a><span class="lineno"> 5328</span>     resampled = cpl_image_new(nl, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l05329"></a><span class="lineno"> 5329</span>     rdata = cpl_image_get_data_float(resampled);</div>
+<div class="line"><a name="l05330"></a><span class="lineno"> 5330</span> </div>
+<div class="line"><a name="l05331"></a><span class="lineno"> 5331</span>     <span class="keywordflow">if</span> (calibration)</div>
+<div class="line"><a name="l05332"></a><span class="lineno"> 5332</span>         idata = cpl_image_get_data_float(calibration);</div>
+<div class="line"><a name="l05333"></a><span class="lineno"> 5333</span> </div>
+<div class="line"><a name="l05334"></a><span class="lineno"> 5334</span>     <span class="keywordflow">if</span> (residuals)</div>
+<div class="line"><a name="l05335"></a><span class="lineno"> 5335</span>         ddata = cpl_image_get_data_float(residuals);</div>
+<div class="line"><a name="l05336"></a><span class="lineno"> 5336</span> </div>
+<div class="line"><a name="l05337"></a><span class="lineno"> 5337</span>     <span class="keywordflow">if</span> (idscoeff)</div>
+<div class="line"><a name="l05338"></a><span class="lineno"> 5338</span>         <span class="keywordflow">for</span> (j = 0; j <= order; j++)</div>
+<div class="line"><a name="l05339"></a><span class="lineno"> 5339</span>             cpl_table_new_column(idscoeff, clab[j], CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05340"></a><span class="lineno"> 5340</span> </div>
+<div class="line"><a name="l05341"></a><span class="lineno"> 5341</span>     <span class="keywordflow">if</span> (restable) {</div>
+<div class="line"><a name="l05342"></a><span class="lineno"> 5342</span>         cpl_table_set_size(restable, nref);</div>
+<div class="line"><a name="l05343"></a><span class="lineno"> 5343</span>         cpl_table_new_column(restable, <span class="stringliteral">"wavelength"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05344"></a><span class="lineno"> 5344</span>         cpl_table_copy_data_double(restable, <span class="stringliteral">"wavelength"</span>, line);</div>
+<div class="line"><a name="l05345"></a><span class="lineno"> 5345</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i += step) {</div>
+<div class="line"><a name="l05346"></a><span class="lineno"> 5346</span>              snprintf(name, MAX_COLNAME, <span class="stringliteral">"r%d"</span>, i);</div>
+<div class="line"><a name="l05347"></a><span class="lineno"> 5347</span>              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05348"></a><span class="lineno"> 5348</span>              snprintf(name, MAX_COLNAME, <span class="stringliteral">"d%d"</span>, i);</div>
+<div class="line"><a name="l05349"></a><span class="lineno"> 5349</span>              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05350"></a><span class="lineno"> 5350</span>              snprintf(name, MAX_COLNAME, <span class="stringliteral">"p%d"</span>, i);</div>
+<div class="line"><a name="l05351"></a><span class="lineno"> 5351</span>              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05352"></a><span class="lineno"> 5352</span>         }</div>
+<div class="line"><a name="l05353"></a><span class="lineno"> 5353</span>     }</div>
+<div class="line"><a name="l05354"></a><span class="lineno"> 5354</span> </div>
+<div class="line"><a name="l05355"></a><span class="lineno"> 5355</span>     <span class="keywordflow">if</span> (detected_lines) {</div>
+<div class="line"><a name="l05356"></a><span class="lineno"> 5356</span>         cpl_table_set_size(detected_lines, 0);</div>
+<div class="line"><a name="l05357"></a><span class="lineno"> 5357</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"xpos"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05358"></a><span class="lineno"> 5358</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"ypos"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05359"></a><span class="lineno"> 5359</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"xpos_iter"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05360"></a><span class="lineno"> 5360</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"ypos_iter"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05361"></a><span class="lineno"> 5361</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"peak_flux"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05362"></a><span class="lineno"> 5362</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"wave_ident"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05363"></a><span class="lineno"> 5363</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"wave_ident_iter"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05364"></a><span class="lineno"> 5364</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"xpos_fit_rect_wavecal"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05365"></a><span class="lineno"> 5365</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"res_xpos"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05366"></a><span class="lineno"> 5366</span>     }</div>
+<div class="line"><a name="l05367"></a><span class="lineno"> 5367</span> </div>
+<div class="line"><a name="l05368"></a><span class="lineno"> 5368</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l05369"></a><span class="lineno"> 5369</span> <span class="comment">     * Here is the real thing: detecting and identifying peaks,</span></div>
+<div class="line"><a name="l05370"></a><span class="lineno"> 5370</span> <span class="comment">     * and then fit the transformation from wavelength to pixel</span></div>
+<div class="line"><a name="l05371"></a><span class="lineno"> 5371</span> <span class="comment">     * and from pixel to wavelength.</span></div>
+<div class="line"><a name="l05372"></a><span class="lineno"> 5372</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l05373"></a><span class="lineno"> 5373</span> </div>
+<div class="line"><a name="l05374"></a><span class="lineno"> 5374</span>     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l05375"></a><span class="lineno"> 5375</span>         width = <a class="code" href="group__moses.html#ga28871a4ecc1e2779022f06d4da892360" title="Estimate lines widths (in pixel) in arc lamp spectrum.">mos_lines_width</a>(sdata + i*nx, nx);</div>
+<div class="line"><a name="l05376"></a><span class="lineno"> 5376</span>         <span class="keywordflow">if</span> (sradius > 0) {</div>
+<div class="line"><a name="l05377"></a><span class="lineno"> 5377</span>             <span class="keywordflow">if</span> (width > sradius) {</div>
+<div class="line"><a name="l05378"></a><span class="lineno"> 5378</span>                 uradius = width;</div>
+<div class="line"><a name="l05379"></a><span class="lineno"> 5379</span>             }</div>
+<div class="line"><a name="l05380"></a><span class="lineno"> 5380</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l05381"></a><span class="lineno"> 5381</span>                 uradius = sradius;</div>
+<div class="line"><a name="l05382"></a><span class="lineno"> 5382</span>             }</div>
+<div class="line"><a name="l05383"></a><span class="lineno"> 5383</span>         }</div>
+<div class="line"><a name="l05384"></a><span class="lineno"> 5384</span>         <span class="keywordflow">if</span> (width < 5)</div>
+<div class="line"><a name="l05385"></a><span class="lineno"> 5385</span>             width = 5;</div>
+<div class="line"><a name="l05386"></a><span class="lineno"> 5386</span>         peaks = <a class="code" href="group__moses.html#gad80729870e3acf9f61c820f488eb83b2" title="Find positions of peaks candidates.">mos_peak_candidates</a>(sdata + i*nx, nx, level, width);</div>
+<div class="line"><a name="l05387"></a><span class="lineno"> 5387</span>         <span class="keywordflow">if</span> (peaks) {</div>
+<div class="line"><a name="l05388"></a><span class="lineno"> 5388</span>             peaks = <a class="code" href="group__moses.html#gacfa971d995aac0c8f05c37499861d191" title="Improve (when possible) accuracy of peaks candidates positions.">mos_refine_peaks</a>(sdata + i*nx, nx, peaks, width);</div>
+<div class="line"><a name="l05389"></a><span class="lineno"> 5389</span>         }</div>
+<div class="line"><a name="l05390"></a><span class="lineno"> 5390</span>         <span class="keywordflow">if</span> (peaks) {</div>
+<div class="line"><a name="l05391"></a><span class="lineno"> 5391</span>             output = <a class="code" href="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97" title="Identify peak candidates.">mos_identify_peaks</a>(peaks, lines, min_disp, max_disp, 0.05);</div>
+<div class="line"><a name="l05392"></a><span class="lineno"> 5392</span>             <span class="keywordflow">if</span> (output) {</div>
+<div class="line"><a name="l05393"></a><span class="lineno"> 5393</span>                 countLines = cpl_bivector_get_size(output);</div>
+<div class="line"><a name="l05394"></a><span class="lineno"> 5394</span>                 <span class="keywordflow">if</span> (countLines < 4) {</div>
+<div class="line"><a name="l05395"></a><span class="lineno"> 5395</span>                     cpl_bivector_delete(output);</div>
+<div class="line"><a name="l05396"></a><span class="lineno"> 5396</span>                     cpl_vector_delete(peaks);</div>
+<div class="line"><a name="l05397"></a><span class="lineno"> 5397</span>                     <span class="keywordflow">if</span> (nlines)</div>
+<div class="line"><a name="l05398"></a><span class="lineno"> 5398</span>                         nlines[i] = 0;</div>
+<div class="line"><a name="l05399"></a><span class="lineno"> 5399</span>                     <span class="keywordflow">if</span> (error)</div>
+<div class="line"><a name="l05400"></a><span class="lineno"> 5400</span>                         error[i] = 0.0;</div>
+<div class="line"><a name="l05401"></a><span class="lineno"> 5401</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l05402"></a><span class="lineno"> 5402</span>                 }</div>
+<div class="line"><a name="l05403"></a><span class="lineno"> 5403</span> </div>
+<div class="line"><a name="l05404"></a><span class="lineno"> 5404</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l05405"></a><span class="lineno"> 5405</span> <span class="comment">                 * Set reference wavelength as zero point</span></div>
+<div class="line"><a name="l05406"></a><span class="lineno"> 5406</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l05407"></a><span class="lineno"> 5407</span> </div>
+<div class="line"><a name="l05408"></a><span class="lineno"> 5408</span>                 wavel = cpl_bivector_get_y(output);</div>
+<div class="line"><a name="l05409"></a><span class="lineno"> 5409</span>                 cpl_vector_subtract_scalar(wavel, refwave);</div>
+<div class="line"><a name="l05410"></a><span class="lineno"> 5410</span> </div>
+<div class="line"><a name="l05411"></a><span class="lineno"> 5411</span>                 uorder = countLines / 2 - 1;</div>
+<div class="line"><a name="l05412"></a><span class="lineno"> 5412</span>                 <span class="keywordflow">if</span> (uorder > order)</div>
+<div class="line"><a name="l05413"></a><span class="lineno"> 5413</span>                     uorder = order;</div>
+<div class="line"><a name="l05414"></a><span class="lineno"> 5414</span> </div>
+<div class="line"><a name="l05415"></a><span class="lineno"> 5415</span> <span class="comment">/* This part is now commented out. In case the first-guess iteration</span></div>
+<div class="line"><a name="l05416"></a><span class="lineno"> 5416</span> <span class="comment"> * was requested, the first fit was made with a lower polynomial degree:</span></div>
+<div class="line"><a name="l05417"></a><span class="lineno"> 5417</span> <span class="comment"> * more robust, and still accurate enough to be used as a first-guess.</span></div>
+<div class="line"><a name="l05418"></a><span class="lineno"> 5418</span> <span class="comment"></span></div>
+<div class="line"><a name="l05419"></a><span class="lineno"> 5419</span> <span class="comment">                if (sradius > 0 && uorder > 2)</span></div>
+<div class="line"><a name="l05420"></a><span class="lineno"> 5420</span> <span class="comment">                    --uorder;</span></div>
+<div class="line"><a name="l05421"></a><span class="lineno"> 5421</span> <span class="comment"></span></div>
+<div class="line"><a name="l05422"></a><span class="lineno"> 5422</span> <span class="comment"> * End of commented part */</span></div>
+<div class="line"><a name="l05423"></a><span class="lineno"> 5423</span> </div>
+<div class="line"><a name="l05424"></a><span class="lineno"> 5424</span>                 ids = <a class="code" href="group__moses.html#ga4d584e69389518aab8d6932e5841d399" title="Fit polynomial relation from wavelengths to pixels.">mos_poly_wav2pix</a>(output, uorder, reject,</div>
+<div class="line"><a name="l05425"></a><span class="lineno"> 5425</span>                                        2 * (uorder + 1), &usedLines,</div>
+<div class="line"><a name="l05426"></a><span class="lineno"> 5426</span>                                        &ids_err);</div>
+<div class="line"><a name="l05427"></a><span class="lineno"> 5427</span> </div>
+<div class="line"><a name="l05428"></a><span class="lineno"> 5428</span>                 <span class="keywordflow">if</span> (ids == NULL) {</div>
+<div class="line"><a name="l05429"></a><span class="lineno"> 5429</span>                     cpl_bivector_delete(output);</div>
+<div class="line"><a name="l05430"></a><span class="lineno"> 5430</span>                     cpl_vector_delete(peaks);</div>
+<div class="line"><a name="l05431"></a><span class="lineno"> 5431</span>                     <span class="keywordflow">if</span> (nlines)</div>
+<div class="line"><a name="l05432"></a><span class="lineno"> 5432</span>                         nlines[i] = 0;</div>
+<div class="line"><a name="l05433"></a><span class="lineno"> 5433</span>                     <span class="keywordflow">if</span> (error)</div>
+<div class="line"><a name="l05434"></a><span class="lineno"> 5434</span>                         error[i] = 0.0;</div>
+<div class="line"><a name="l05435"></a><span class="lineno"> 5435</span>                     cpl_error_reset();</div>
+<div class="line"><a name="l05436"></a><span class="lineno"> 5436</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l05437"></a><span class="lineno"> 5437</span>                 }</div>
+<div class="line"><a name="l05438"></a><span class="lineno"> 5438</span> </div>
+<div class="line"><a name="l05439"></a><span class="lineno"> 5439</span>                 <span class="keywordflow">if</span> (idscoeff) {</div>
+<div class="line"><a name="l05440"></a><span class="lineno"> 5440</span> </div>
+<div class="line"><a name="l05441"></a><span class="lineno"> 5441</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l05442"></a><span class="lineno"> 5442</span> <span class="comment">                     * Write it anyway, even in case a first-guess based</span></div>
+<div class="line"><a name="l05443"></a><span class="lineno"> 5443</span> <span class="comment">                     * solution will be searched afterwards: in case of</span></div>
+<div class="line"><a name="l05444"></a><span class="lineno"> 5444</span> <span class="comment">                     * failure, the "blind" solution is kept.</span></div>
+<div class="line"><a name="l05445"></a><span class="lineno"> 5445</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l05446"></a><span class="lineno"> 5446</span> </div>
+<div class="line"><a name="l05447"></a><span class="lineno"> 5447</span>                     <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l05448"></a><span class="lineno"> 5448</span>                         <span class="keywordflow">if</span> (k > uorder) {</div>
+<div class="line"><a name="l05449"></a><span class="lineno"> 5449</span>                             cpl_table_set_double(idscoeff, clab[k], i, 0.0);</div>
+<div class="line"><a name="l05450"></a><span class="lineno"> 5450</span>                         }</div>
+<div class="line"><a name="l05451"></a><span class="lineno"> 5451</span>                         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l05452"></a><span class="lineno"> 5452</span>                             cpl_table_set_double(idscoeff, clab[k], i,</div>
+<div class="line"><a name="l05453"></a><span class="lineno"> 5453</span>                                       cpl_polynomial_get_coeff(ids, &k));</div>
+<div class="line"><a name="l05454"></a><span class="lineno"> 5454</span>                         }</div>
+<div class="line"><a name="l05455"></a><span class="lineno"> 5455</span>                     }</div>
+<div class="line"><a name="l05456"></a><span class="lineno"> 5456</span>                 }</div>
+<div class="line"><a name="l05457"></a><span class="lineno"> 5457</span> </div>
+<div class="line"><a name="l05458"></a><span class="lineno"> 5458</span>                 <span class="keywordflow">if</span>(detected_lines)</div>
+<div class="line"><a name="l05459"></a><span class="lineno"> 5459</span>                 {</div>
+<div class="line"><a name="l05460"></a><span class="lineno"> 5460</span>                     cpl_size newlines = cpl_vector_get_size(peaks); </div>
+<div class="line"><a name="l05461"></a><span class="lineno"> 5461</span>                     cpl_size oldsize = cpl_table_get_nrow(detected_lines); </div>
+<div class="line"><a name="l05462"></a><span class="lineno"> 5462</span>                     cpl_table_set_size(detected_lines, oldsize + newlines);</div>
+<div class="line"><a name="l05463"></a><span class="lineno"> 5463</span>                     <span class="keywordflow">for</span>(cpl_size iline = 0; iline < newlines; ++iline)</div>
+<div class="line"><a name="l05464"></a><span class="lineno"> 5464</span>                     {</div>
+<div class="line"><a name="l05465"></a><span class="lineno"> 5465</span>                         cpl_table_set_double(detected_lines, <span class="stringliteral">"xpos"</span>,</div>
+<div class="line"><a name="l05466"></a><span class="lineno"> 5466</span>                              oldsize + iline, cpl_vector_get(peaks, iline) + 1);</div>
+<div class="line"><a name="l05467"></a><span class="lineno"> 5467</span>                         cpl_table_set_double(detected_lines, <span class="stringliteral">"ypos"</span>,</div>
+<div class="line"><a name="l05468"></a><span class="lineno"> 5468</span>                              oldsize + iline, (<span class="keywordtype">double</span>)i + 1);</div>
+<div class="line"><a name="l05469"></a><span class="lineno"> 5469</span>                         cpl_table_set_double(detected_lines, <span class="stringliteral">"peak_flux"</span>,</div>
+<div class="line"><a name="l05470"></a><span class="lineno"> 5470</span>                              oldsize + iline, </div>
+<div class="line"><a name="l05471"></a><span class="lineno"> 5471</span>                              sdata[i*nx+(<span class="keywordtype">int</span>)(cpl_vector_get(peaks, iline)+0.5)]);</div>
+<div class="line"><a name="l05472"></a><span class="lineno"> 5472</span>                     }</div>
+<div class="line"><a name="l05473"></a><span class="lineno"> 5473</span>                 }</div>
+<div class="line"><a name="l05474"></a><span class="lineno"> 5474</span> </div>
+<div class="line"><a name="l05475"></a><span class="lineno"> 5475</span>                 <span class="comment">//Fill the line identification information in </span></div>
+<div class="line"><a name="l05476"></a><span class="lineno"> 5476</span>                 <span class="comment">//the detected_lines table</span></div>
+<div class="line"><a name="l05477"></a><span class="lineno"> 5477</span>                 <span class="keywordflow">if</span>(detected_lines)</div>
+<div class="line"><a name="l05478"></a><span class="lineno"> 5478</span>                 {</div>
+<div class="line"><a name="l05479"></a><span class="lineno"> 5479</span>                     cpl_size nidentlines = cpl_bivector_get_size(output); </div>
+<div class="line"><a name="l05480"></a><span class="lineno"> 5480</span>                     cpl_size ndetectlines = cpl_vector_get_size(peaks); </div>
+<div class="line"><a name="l05481"></a><span class="lineno"> 5481</span>                     cpl_size totalsize = cpl_table_get_nrow(detected_lines);</div>
+<div class="line"><a name="l05482"></a><span class="lineno"> 5482</span>                     <span class="keywordflow">for</span>(cpl_size idline = 0; idline < nidentlines; ++idline)</div>
+<div class="line"><a name="l05483"></a><span class="lineno"> 5483</span>                     {</div>
+<div class="line"><a name="l05484"></a><span class="lineno"> 5484</span>                         <span class="keywordflow">for</span>(cpl_size detline = 0; detline < ndetectlines; ++detline)</div>
+<div class="line"><a name="l05485"></a><span class="lineno"> 5485</span>                         {</div>
+<div class="line"><a name="l05486"></a><span class="lineno"> 5486</span>                             <span class="keywordflow">if</span>(cpl_vector_get(peaks, detline) == </div>
+<div class="line"><a name="l05487"></a><span class="lineno"> 5487</span>                                cpl_bivector_get_x_data(output)[idline])</div>
+<div class="line"><a name="l05488"></a><span class="lineno"> 5488</span>                             {</div>
+<div class="line"><a name="l05489"></a><span class="lineno"> 5489</span>                                 cpl_size table_pos = totalsize - ndetectlines + detline;</div>
+<div class="line"><a name="l05490"></a><span class="lineno"> 5490</span>                                 <span class="keywordtype">double</span> wave_ident = cpl_bivector_get_y_data(output)[idline] + refwave;</div>
+<div class="line"><a name="l05491"></a><span class="lineno"> 5491</span>                                 <span class="keywordtype">double</span> xpix_fit = cpl_polynomial_eval_1d(ids,</div>
+<div class="line"><a name="l05492"></a><span class="lineno"> 5492</span>                                         wave_ident - refwave, NULL);</div>
+<div class="line"><a name="l05493"></a><span class="lineno"> 5493</span>                                 <span class="keywordtype">double</span> xpos_det = cpl_table_get_double(detected_lines,</div>
+<div class="line"><a name="l05494"></a><span class="lineno"> 5494</span>                                         <span class="stringliteral">"xpos"</span>,</div>
+<div class="line"><a name="l05495"></a><span class="lineno"> 5495</span>                                         table_pos, &null);</div>
+<div class="line"><a name="l05496"></a><span class="lineno"> 5496</span>                                 cpl_table_set_double(detected_lines,</div>
+<div class="line"><a name="l05497"></a><span class="lineno"> 5497</span>                                                      <span class="stringliteral">"wave_ident"</span>,</div>
+<div class="line"><a name="l05498"></a><span class="lineno"> 5498</span>                                                      table_pos,</div>
+<div class="line"><a name="l05499"></a><span class="lineno"> 5499</span>                                                      wave_ident);</div>
+<div class="line"><a name="l05500"></a><span class="lineno"> 5500</span>                                 cpl_table_set_double(detected_lines,</div>
+<div class="line"><a name="l05501"></a><span class="lineno"> 5501</span>                                                      <span class="stringliteral">"xpos_fit_rect_wavecal"</span>,</div>
+<div class="line"><a name="l05502"></a><span class="lineno"> 5502</span>                                                      table_pos,</div>
+<div class="line"><a name="l05503"></a><span class="lineno"> 5503</span>                                                      xpix_fit + 1);</div>
+<div class="line"><a name="l05504"></a><span class="lineno"> 5504</span>                                 cpl_table_set_double(detected_lines,</div>
+<div class="line"><a name="l05505"></a><span class="lineno"> 5505</span>                                                      <span class="stringliteral">"res_xpos"</span>,</div>
+<div class="line"><a name="l05506"></a><span class="lineno"> 5506</span>                                                      table_pos,</div>
+<div class="line"><a name="l05507"></a><span class="lineno"> 5507</span>                                                      xpos_det - xpix_fit - 1);</div>
+<div class="line"><a name="l05508"></a><span class="lineno"> 5508</span>                                </div>
+<div class="line"><a name="l05509"></a><span class="lineno"> 5509</span>                             }</div>
+<div class="line"><a name="l05510"></a><span class="lineno"> 5510</span>                         }</div>
+<div class="line"><a name="l05511"></a><span class="lineno"> 5511</span>                     }</div>
+<div class="line"><a name="l05512"></a><span class="lineno"> 5512</span>                 }</div>
+<div class="line"><a name="l05513"></a><span class="lineno"> 5513</span> </div>
+<div class="line"><a name="l05514"></a><span class="lineno"> 5514</span>                 <span class="keywordflow">if</span> (sradius > 0) {</div>
+<div class="line"><a name="l05515"></a><span class="lineno"> 5515</span> </div>
+<div class="line"><a name="l05516"></a><span class="lineno"> 5516</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l05517"></a><span class="lineno"> 5517</span> <span class="comment">                     * Use ids as a first-guess</span></div>
+<div class="line"><a name="l05518"></a><span class="lineno"> 5518</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l05519"></a><span class="lineno"> 5519</span> </div>
+<div class="line"><a name="l05520"></a><span class="lineno"> 5520</span>                     new_output = <a class="code" href="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe" title="Find the reference lines peaks using a polynomial first-guess.">mos_find_peaks</a>(sdata + i*nx, nx, lines, </div>
+<div class="line"><a name="l05521"></a><span class="lineno"> 5521</span>                                                 ids, refwave, uradius);</div>
+<div class="line"><a name="l05522"></a><span class="lineno"> 5522</span> </div>
+<div class="line"><a name="l05523"></a><span class="lineno"> 5523</span>                     <span class="keywordflow">if</span> (new_output) {</div>
+<div class="line"><a name="l05524"></a><span class="lineno"> 5524</span>                         cpl_bivector_delete(output);</div>
+<div class="line"><a name="l05525"></a><span class="lineno"> 5525</span>                         output = new_output;</div>
+<div class="line"><a name="l05526"></a><span class="lineno"> 5526</span>                     }</div>
+<div class="line"><a name="l05527"></a><span class="lineno"> 5527</span>                     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l05528"></a><span class="lineno"> 5528</span>                         cpl_error_reset();</div>
+<div class="line"><a name="l05529"></a><span class="lineno"> 5529</span> </div>
+<div class="line"><a name="l05530"></a><span class="lineno"> 5530</span> </div>
+<div class="line"><a name="l05531"></a><span class="lineno"> 5531</span>                     cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l05532"></a><span class="lineno"> 5532</span> </div>
+<div class="line"><a name="l05533"></a><span class="lineno"> 5533</span>                     countLines = cpl_bivector_get_size(output);</div>
+<div class="line"><a name="l05534"></a><span class="lineno"> 5534</span> </div>
+<div class="line"><a name="l05535"></a><span class="lineno"> 5535</span>                     <span class="keywordflow">if</span> (countLines < 4) {</div>
+<div class="line"><a name="l05536"></a><span class="lineno"> 5536</span>                         cpl_bivector_delete(output);</div>
+<div class="line"><a name="l05537"></a><span class="lineno"> 5537</span>                         cpl_vector_delete(peaks);</div>
+<div class="line"><a name="l05538"></a><span class="lineno"> 5538</span> </div>
+<div class="line"><a name="l05539"></a><span class="lineno"> 5539</span>                         <span class="comment">/* </span></div>
+<div class="line"><a name="l05540"></a><span class="lineno"> 5540</span> <span class="comment">                         * With the following code a decision is taken:</span></div>
+<div class="line"><a name="l05541"></a><span class="lineno"> 5541</span> <span class="comment">                         * if using the first-guess gives no results,</span></div>
+<div class="line"><a name="l05542"></a><span class="lineno"> 5542</span> <span class="comment">                         * then also the "blind" solution is rejected.</span></div>
+<div class="line"><a name="l05543"></a><span class="lineno"> 5543</span> <span class="comment">                         */</span></div>
+<div class="line"><a name="l05544"></a><span class="lineno"> 5544</span> </div>
+<div class="line"><a name="l05545"></a><span class="lineno"> 5545</span>                         <span class="keywordflow">if</span> (nlines)</div>
+<div class="line"><a name="l05546"></a><span class="lineno"> 5546</span>                             nlines[i] = 0;</div>
+<div class="line"><a name="l05547"></a><span class="lineno"> 5547</span>                         <span class="keywordflow">if</span> (error)</div>
+<div class="line"><a name="l05548"></a><span class="lineno"> 5548</span>                             error[i] = 0.0;</div>
+<div class="line"><a name="l05549"></a><span class="lineno"> 5549</span>                         <span class="keywordflow">if</span> (idscoeff)</div>
+<div class="line"><a name="l05550"></a><span class="lineno"> 5550</span>                             <span class="keywordflow">for</span> (k = 0; k <= order; k++)</div>
+<div class="line"><a name="l05551"></a><span class="lineno"> 5551</span>                                 cpl_table_set_invalid(idscoeff, clab[k], i);</div>
+<div class="line"><a name="l05552"></a><span class="lineno"> 5552</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l05553"></a><span class="lineno"> 5553</span>                     }</div>
+<div class="line"><a name="l05554"></a><span class="lineno"> 5554</span> </div>
+<div class="line"><a name="l05555"></a><span class="lineno"> 5555</span>                     wavel = cpl_bivector_get_y(output);</div>
+<div class="line"><a name="l05556"></a><span class="lineno"> 5556</span>                     cpl_vector_subtract_scalar(wavel, refwave);</div>
+<div class="line"><a name="l05557"></a><span class="lineno"> 5557</span> </div>
+<div class="line"><a name="l05558"></a><span class="lineno"> 5558</span>                     uorder = countLines / 2 - 1;</div>
+<div class="line"><a name="l05559"></a><span class="lineno"> 5559</span>                     <span class="keywordflow">if</span> (uorder > order)</div>
+<div class="line"><a name="l05560"></a><span class="lineno"> 5560</span>                         uorder = order;</div>
+<div class="line"><a name="l05561"></a><span class="lineno"> 5561</span> </div>
+<div class="line"><a name="l05562"></a><span class="lineno"> 5562</span>                     ids = <a class="code" href="group__moses.html#ga4d584e69389518aab8d6932e5841d399" title="Fit polynomial relation from wavelengths to pixels.">mos_poly_wav2pix</a>(output, uorder, reject,</div>
+<div class="line"><a name="l05563"></a><span class="lineno"> 5563</span>                                            2 * (uorder + 1), &usedLines,</div>
+<div class="line"><a name="l05564"></a><span class="lineno"> 5564</span>                                            &ids_err);</div>
+<div class="line"><a name="l05565"></a><span class="lineno"> 5565</span> </div>
+<div class="line"><a name="l05566"></a><span class="lineno"> 5566</span>                     <span class="keywordflow">if</span> (ids == NULL) {</div>
+<div class="line"><a name="l05567"></a><span class="lineno"> 5567</span>                         cpl_bivector_delete(output);</div>
+<div class="line"><a name="l05568"></a><span class="lineno"> 5568</span>                         cpl_vector_delete(peaks);</div>
+<div class="line"><a name="l05569"></a><span class="lineno"> 5569</span> </div>
+<div class="line"><a name="l05570"></a><span class="lineno"> 5570</span>                         <span class="comment">/* </span></div>
+<div class="line"><a name="l05571"></a><span class="lineno"> 5571</span> <span class="comment">                         * With the following code a decision is taken:</span></div>
+<div class="line"><a name="l05572"></a><span class="lineno"> 5572</span> <span class="comment">                         * if using the first-guess gives no results,</span></div>
+<div class="line"><a name="l05573"></a><span class="lineno"> 5573</span> <span class="comment">                         * then also the "blind" solution is rejected.</span></div>
+<div class="line"><a name="l05574"></a><span class="lineno"> 5574</span> <span class="comment">                         */</span></div>
+<div class="line"><a name="l05575"></a><span class="lineno"> 5575</span> </div>
+<div class="line"><a name="l05576"></a><span class="lineno"> 5576</span>                         <span class="keywordflow">if</span> (nlines)</div>
+<div class="line"><a name="l05577"></a><span class="lineno"> 5577</span>                             nlines[i] = 0;</div>
+<div class="line"><a name="l05578"></a><span class="lineno"> 5578</span>                         <span class="keywordflow">if</span> (error)</div>
+<div class="line"><a name="l05579"></a><span class="lineno"> 5579</span>                             error[i] = 0.0;</div>
+<div class="line"><a name="l05580"></a><span class="lineno"> 5580</span>                         <span class="keywordflow">if</span> (idscoeff)</div>
+<div class="line"><a name="l05581"></a><span class="lineno"> 5581</span>                             <span class="keywordflow">for</span> (k = 0; k <= order; k++)</div>
+<div class="line"><a name="l05582"></a><span class="lineno"> 5582</span>                                 cpl_table_set_invalid(idscoeff, clab[k], i);</div>
+<div class="line"><a name="l05583"></a><span class="lineno"> 5583</span>                         cpl_error_reset();</div>
+<div class="line"><a name="l05584"></a><span class="lineno"> 5584</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l05585"></a><span class="lineno"> 5585</span>                     }</div>
+<div class="line"><a name="l05586"></a><span class="lineno"> 5586</span> </div>
+<div class="line"><a name="l05587"></a><span class="lineno"> 5587</span>                     <span class="keywordflow">if</span> (idscoeff) {</div>
+<div class="line"><a name="l05588"></a><span class="lineno"> 5588</span>                         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l05589"></a><span class="lineno"> 5589</span>                             <span class="keywordflow">if</span> (k > uorder) {</div>
+<div class="line"><a name="l05590"></a><span class="lineno"> 5590</span>                                 cpl_table_set_double(idscoeff, clab[k], i, 0.0);</div>
+<div class="line"><a name="l05591"></a><span class="lineno"> 5591</span>                             }</div>
+<div class="line"><a name="l05592"></a><span class="lineno"> 5592</span>                             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l05593"></a><span class="lineno"> 5593</span>                                 cpl_table_set_double(idscoeff, clab[k], i,</div>
+<div class="line"><a name="l05594"></a><span class="lineno"> 5594</span>                                             cpl_polynomial_get_coeff(ids, &k));</div>
+<div class="line"><a name="l05595"></a><span class="lineno"> 5595</span>                             }</div>
+<div class="line"><a name="l05596"></a><span class="lineno"> 5596</span>                         }</div>
+<div class="line"><a name="l05597"></a><span class="lineno"> 5597</span>                     }</div>
+<div class="line"><a name="l05598"></a><span class="lineno"> 5598</span>                     </div>
+<div class="line"><a name="l05599"></a><span class="lineno"> 5599</span>                     </div>
+<div class="line"><a name="l05600"></a><span class="lineno"> 5600</span>                     <span class="keywordflow">if</span>(detected_lines)</div>
+<div class="line"><a name="l05601"></a><span class="lineno"> 5601</span>                     {</div>
+<div class="line"><a name="l05602"></a><span class="lineno"> 5602</span>                         cpl_size oldsize = cpl_table_get_nrow(detected_lines); </div>
+<div class="line"><a name="l05603"></a><span class="lineno"> 5603</span>                         cpl_size nidentlines = cpl_bivector_get_size(output); </div>
+<div class="line"><a name="l05604"></a><span class="lineno"> 5604</span>                         cpl_table_set_size(detected_lines, oldsize + nidentlines);</div>
+<div class="line"><a name="l05605"></a><span class="lineno"> 5605</span>                         <span class="keywordflow">for</span>(cpl_size idline = 0; idline < nidentlines ; ++idline)</div>
+<div class="line"><a name="l05606"></a><span class="lineno"> 5606</span>                         {</div>
+<div class="line"><a name="l05607"></a><span class="lineno"> 5607</span>                             <span class="keywordtype">double</span> wave_ident = cpl_bivector_get_y_data(output)[idline] + refwave;</div>
+<div class="line"><a name="l05608"></a><span class="lineno"> 5608</span>                             <span class="keywordtype">double</span> xpix_fit = cpl_polynomial_eval_1d(ids,</div>
+<div class="line"><a name="l05609"></a><span class="lineno"> 5609</span>                                     wave_ident - refwave, NULL);</div>
+<div class="line"><a name="l05610"></a><span class="lineno"> 5610</span>                             cpl_table_set_double(detected_lines, <span class="stringliteral">"xpos_iter"</span>,</div>
+<div class="line"><a name="l05611"></a><span class="lineno"> 5611</span>                                  oldsize + idline, cpl_bivector_get_x_data(output)[idline] + 1);</div>
+<div class="line"><a name="l05612"></a><span class="lineno"> 5612</span>                             cpl_table_set_double(detected_lines, <span class="stringliteral">"ypos_iter"</span>,</div>
+<div class="line"><a name="l05613"></a><span class="lineno"> 5613</span>                                  oldsize + idline, (<span class="keywordtype">double</span>)i + 1);</div>
+<div class="line"><a name="l05614"></a><span class="lineno"> 5614</span>                             cpl_table_set_double(detected_lines, <span class="stringliteral">"peak_flux"</span>,</div>
+<div class="line"><a name="l05615"></a><span class="lineno"> 5615</span>                                  oldsize + idline, </div>
+<div class="line"><a name="l05616"></a><span class="lineno"> 5616</span>                                  sdata[i*nx+(<span class="keywordtype">int</span>)(cpl_bivector_get_x_data(output)[idline]+0.5)]);</div>
+<div class="line"><a name="l05617"></a><span class="lineno"> 5617</span>                             cpl_table_set_double(detected_lines, <span class="stringliteral">"wave_ident_iter"</span>,</div>
+<div class="line"><a name="l05618"></a><span class="lineno"> 5618</span>                                  oldsize + idline, wave_ident);</div>
+<div class="line"><a name="l05619"></a><span class="lineno"> 5619</span>                             cpl_table_set_double(detected_lines, <span class="stringliteral">"xpos_fit_rect_wavecal"</span>,</div>
+<div class="line"><a name="l05620"></a><span class="lineno"> 5620</span>                                  oldsize + idline, xpix_fit + 1);</div>
+<div class="line"><a name="l05621"></a><span class="lineno"> 5621</span>                         }</div>
+<div class="line"><a name="l05622"></a><span class="lineno"> 5622</span>                     }</div>
+<div class="line"><a name="l05623"></a><span class="lineno"> 5623</span>                     </div>
+<div class="line"><a name="l05624"></a><span class="lineno"> 5624</span>                 } <span class="comment">/* End of "use ids as a first-guess" */</span></div>
+<div class="line"><a name="l05625"></a><span class="lineno"> 5625</span> </div>
+<div class="line"><a name="l05626"></a><span class="lineno"> 5626</span>                 <span class="keywordflow">if</span> (nlines)</div>
+<div class="line"><a name="l05627"></a><span class="lineno"> 5627</span>                     nlines[i] = usedLines;</div>
+<div class="line"><a name="l05628"></a><span class="lineno"> 5628</span>                 <span class="keywordflow">if</span> (error)</div>
+<div class="line"><a name="l05629"></a><span class="lineno"> 5629</span>                     error[i] = ids_err / sqrt(usedLines/(uorder + 1));</div>
+<div class="line"><a name="l05630"></a><span class="lineno"> 5630</span> </div>
+<div class="line"><a name="l05631"></a><span class="lineno"> 5631</span>                 pixstart = cpl_polynomial_eval_1d(ids, </div>
+<div class="line"><a name="l05632"></a><span class="lineno"> 5632</span>                     cpl_bivector_get_y_data(output)[0], NULL);</div>
+<div class="line"><a name="l05633"></a><span class="lineno"> 5633</span>                 pixend = cpl_polynomial_eval_1d(ids,</div>
+<div class="line"><a name="l05634"></a><span class="lineno"> 5634</span>                     cpl_bivector_get_y_data(output)[countLines-1], NULL);</div>
+<div class="line"><a name="l05635"></a><span class="lineno"> 5635</span>                 extrapolation = (pixend - pixstart) / 5;</div>
+<div class="line"><a name="l05636"></a><span class="lineno"> 5636</span>                 pixstart -= extrapolation;</div>
+<div class="line"><a name="l05637"></a><span class="lineno"> 5637</span>                 pixend += extrapolation;</div>
+<div class="line"><a name="l05638"></a><span class="lineno"> 5638</span>                 <span class="keywordflow">if</span> (pixstart < 0)</div>
+<div class="line"><a name="l05639"></a><span class="lineno"> 5639</span>                     pixstart = 0;</div>
+<div class="line"><a name="l05640"></a><span class="lineno"> 5640</span>                 <span class="keywordflow">if</span> (pixend > nx)</div>
+<div class="line"><a name="l05641"></a><span class="lineno"> 5641</span>                     pixend = nx;</div>
+<div class="line"><a name="l05642"></a><span class="lineno"> 5642</span> </div>
+<div class="line"><a name="l05643"></a><span class="lineno"> 5643</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l05644"></a><span class="lineno"> 5644</span> <span class="comment">                 * Wavelength calibrated image (if requested):</span></div>
+<div class="line"><a name="l05645"></a><span class="lineno"> 5645</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l05646"></a><span class="lineno"> 5646</span> </div>
+<div class="line"><a name="l05647"></a><span class="lineno"> 5647</span>                 <span class="keywordflow">if</span> (calibration) {</div>
+<div class="line"><a name="l05648"></a><span class="lineno"> 5648</span>                     <span class="keywordflow">for</span> (j = pixstart; j < pixend; j++) {</div>
+<div class="line"><a name="l05649"></a><span class="lineno"> 5649</span>                         (idata + i*nx)[j] = <a class="code" href="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a" title="Evaluate the wavelength of a pixel position.">mos_eval_dds</a>(ids, firstLambda, </div>
+<div class="line"><a name="l05650"></a><span class="lineno"> 5650</span>                                                          lastLambda, refwave, </div>
+<div class="line"><a name="l05651"></a><span class="lineno"> 5651</span>                                                          j);</div>
+<div class="line"><a name="l05652"></a><span class="lineno"> 5652</span>                     }</div>
+<div class="line"><a name="l05653"></a><span class="lineno"> 5653</span>                 }</div>
+<div class="line"><a name="l05654"></a><span class="lineno"> 5654</span> </div>
+<div class="line"><a name="l05655"></a><span class="lineno"> 5655</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l05656"></a><span class="lineno"> 5656</span> <span class="comment">                 * Resampled image:</span></div>
+<div class="line"><a name="l05657"></a><span class="lineno"> 5657</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l05658"></a><span class="lineno"> 5658</span> </div>
+<div class="line"><a name="l05659"></a><span class="lineno"> 5659</span>                 <span class="keywordflow">for</span> (j = 0; j < nl; j++) {</div>
+<div class="line"><a name="l05660"></a><span class="lineno"> 5660</span>                     lambda = firstLambda + j * dispersion;</div>
+<div class="line"><a name="l05661"></a><span class="lineno"> 5661</span>                     fpixel = cpl_polynomial_eval_1d(ids, lambda - refwave, </div>
+<div class="line"><a name="l05662"></a><span class="lineno"> 5662</span>                                                     NULL);</div>
+<div class="line"><a name="l05663"></a><span class="lineno"> 5663</span>                     pixel = fpixel;</div>
+<div class="line"><a name="l05664"></a><span class="lineno"> 5664</span>                     <span class="keywordflow">if</span> (pixel >= 0 && pixel < nx-1) {</div>
+<div class="line"><a name="l05665"></a><span class="lineno"> 5665</span>                         v1 = (sdata + i*nx)[pixel];</div>
+<div class="line"><a name="l05666"></a><span class="lineno"> 5666</span>                         v2 = (sdata + i*nx)[pixel+1];</div>
+<div class="line"><a name="l05667"></a><span class="lineno"> 5667</span>                         vi = v1 + (v2-v1)*(fpixel-pixel);</div>
+<div class="line"><a name="l05668"></a><span class="lineno"> 5668</span>                         (rdata + i*nl)[j] = vi;</div>
+<div class="line"><a name="l05669"></a><span class="lineno"> 5669</span>                     }</div>
+<div class="line"><a name="l05670"></a><span class="lineno"> 5670</span>                 }</div>
+<div class="line"><a name="l05671"></a><span class="lineno"> 5671</span> </div>
+<div class="line"><a name="l05672"></a><span class="lineno"> 5672</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l05673"></a><span class="lineno"> 5673</span> <span class="comment">                 * Residuals image</span></div>
+<div class="line"><a name="l05674"></a><span class="lineno"> 5674</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l05675"></a><span class="lineno"> 5675</span> </div>
+<div class="line"><a name="l05676"></a><span class="lineno"> 5676</span>                 <span class="keywordflow">if</span> (residuals || (restable && !(i%step))) {</div>
+<div class="line"><a name="l05677"></a><span class="lineno"> 5677</span>                     <span class="keywordflow">if</span> (restable && !(i%step)) {</div>
+<div class="line"><a name="l05678"></a><span class="lineno"> 5678</span>                         lin = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l05679"></a><span class="lineno"> 5679</span>                         <span class="keywordflow">for</span> (k = 0; k < 2; k++)</div>
+<div class="line"><a name="l05680"></a><span class="lineno"> 5680</span>                             cpl_polynomial_set_coeff(lin, &k, </div>
+<div class="line"><a name="l05681"></a><span class="lineno"> 5681</span>                                           cpl_polynomial_get_coeff(ids, &k));</div>
+<div class="line"><a name="l05682"></a><span class="lineno"> 5682</span>                     }</div>
+<div class="line"><a name="l05683"></a><span class="lineno"> 5683</span>                     <span class="keywordflow">for</span> (j = 0; j < countLines; j++) {</div>
+<div class="line"><a name="l05684"></a><span class="lineno"> 5684</span>                         pixe = cpl_bivector_get_x_data(output)[j];</div>
+<div class="line"><a name="l05685"></a><span class="lineno"> 5685</span>                         wave = cpl_bivector_get_y_data(output)[j];</div>
+<div class="line"><a name="l05686"></a><span class="lineno"> 5686</span>                         value = pixe - cpl_polynomial_eval_1d(ids, wave, NULL);</div>
+<div class="line"><a name="l05687"></a><span class="lineno"> 5687</span>                         <span class="keywordflow">if</span> (residuals) {</div>
+<div class="line"><a name="l05688"></a><span class="lineno"> 5688</span>                             pixel = pixe + 0.5;</div>
+<div class="line"><a name="l05689"></a><span class="lineno"> 5689</span>                             (ddata + i*nx)[pixel] = value;</div>
+<div class="line"><a name="l05690"></a><span class="lineno"> 5690</span>                         }</div>
+<div class="line"><a name="l05691"></a><span class="lineno"> 5691</span>                         <span class="keywordflow">if</span> (restable && !(i%step)) {</div>
+<div class="line"><a name="l05692"></a><span class="lineno"> 5692</span>                             <span class="keywordflow">for</span> (k = 0; k < nref; k++) {</div>
+<div class="line"><a name="l05693"></a><span class="lineno"> 5693</span>                                 <span class="keywordflow">if</span> (fabs(line[k] - refwave - wave) < 0.1) {</div>
+<div class="line"><a name="l05694"></a><span class="lineno"> 5694</span>                                     snprintf(name, MAX_COLNAME, <span class="stringliteral">"r%d"</span>, i);</div>
+<div class="line"><a name="l05695"></a><span class="lineno"> 5695</span>                                     cpl_table_set_double(restable, name, </div>
+<div class="line"><a name="l05696"></a><span class="lineno"> 5696</span>                                                          k, value);</div>
+<div class="line"><a name="l05697"></a><span class="lineno"> 5697</span>                                     value = pixe</div>
+<div class="line"><a name="l05698"></a><span class="lineno"> 5698</span>                                           - cpl_polynomial_eval_1d(lin, wave,</div>
+<div class="line"><a name="l05699"></a><span class="lineno"> 5699</span>                                                                    NULL);</div>
+<div class="line"><a name="l05700"></a><span class="lineno"> 5700</span>                                     snprintf(name, MAX_COLNAME, <span class="stringliteral">"d%d"</span>, i);</div>
+<div class="line"><a name="l05701"></a><span class="lineno"> 5701</span>                                     cpl_table_set_double(restable, name, </div>
+<div class="line"><a name="l05702"></a><span class="lineno"> 5702</span>                                                          k, value);</div>
+<div class="line"><a name="l05703"></a><span class="lineno"> 5703</span>                                     snprintf(name, MAX_COLNAME, <span class="stringliteral">"p%d"</span>, i);</div>
+<div class="line"><a name="l05704"></a><span class="lineno"> 5704</span>                                     cpl_table_set_double(restable, name,</div>
+<div class="line"><a name="l05705"></a><span class="lineno"> 5705</span>                                                          k, pixe);</div>
+<div class="line"><a name="l05706"></a><span class="lineno"> 5706</span>                                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l05707"></a><span class="lineno"> 5707</span>                                 }</div>
+<div class="line"><a name="l05708"></a><span class="lineno"> 5708</span>                             }</div>
+<div class="line"><a name="l05709"></a><span class="lineno"> 5709</span>                         }</div>
+<div class="line"><a name="l05710"></a><span class="lineno"> 5710</span>                     }</div>
+<div class="line"><a name="l05711"></a><span class="lineno"> 5711</span>                     <span class="keywordflow">if</span> (restable && !(i%step)) {</div>
+<div class="line"><a name="l05712"></a><span class="lineno"> 5712</span>                         cpl_polynomial_delete(lin);</div>
+<div class="line"><a name="l05713"></a><span class="lineno"> 5713</span>                     }</div>
+<div class="line"><a name="l05714"></a><span class="lineno"> 5714</span>                 }</div>
+<div class="line"><a name="l05715"></a><span class="lineno"> 5715</span> </div>
+<div class="line"><a name="l05716"></a><span class="lineno"> 5716</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l05717"></a><span class="lineno"> 5717</span> <span class="comment">                 * Mask at reference wavelength</span></div>
+<div class="line"><a name="l05718"></a><span class="lineno"> 5718</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l05719"></a><span class="lineno"> 5719</span> </div>
+<div class="line"><a name="l05720"></a><span class="lineno"> 5720</span>                 <span class="keywordflow">if</span> (refmask) {</div>
+<div class="line"><a name="l05721"></a><span class="lineno"> 5721</span>                     mdata = cpl_mask_get_data(refmask);</div>
+<div class="line"><a name="l05722"></a><span class="lineno"> 5722</span>                     pixel = cpl_polynomial_eval_1d(ids, 0.0, NULL) + 0.5;</div>
+<div class="line"><a name="l05723"></a><span class="lineno"> 5723</span>                     <span class="keywordflow">if</span> (pixel - 1 >= 0 && pixel + 1 < nx) {</div>
+<div class="line"><a name="l05724"></a><span class="lineno"> 5724</span>                         mdata[pixel-1 + i*nx] = CPL_BINARY_1;</div>
+<div class="line"><a name="l05725"></a><span class="lineno"> 5725</span>                         mdata[pixel + i*nx] = CPL_BINARY_1;</div>
+<div class="line"><a name="l05726"></a><span class="lineno"> 5726</span>                         mdata[pixel+1 + i*nx] = CPL_BINARY_1;</div>
+<div class="line"><a name="l05727"></a><span class="lineno"> 5727</span>                     }</div>
+<div class="line"><a name="l05728"></a><span class="lineno"> 5728</span>                 }</div>
+<div class="line"><a name="l05729"></a><span class="lineno"> 5729</span> </div>
+<div class="line"><a name="l05730"></a><span class="lineno"> 5730</span>                 cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l05731"></a><span class="lineno"> 5731</span>                 cpl_bivector_delete(output);</div>
+<div class="line"><a name="l05732"></a><span class="lineno"> 5732</span>             }</div>
+<div class="line"><a name="l05733"></a><span class="lineno"> 5733</span>             cpl_vector_delete(peaks);</div>
+<div class="line"><a name="l05734"></a><span class="lineno"> 5734</span>         }</div>
+<div class="line"><a name="l05735"></a><span class="lineno"> 5735</span>     }</div>
+<div class="line"><a name="l05736"></a><span class="lineno"> 5736</span> </div>
+<div class="line"><a name="l05737"></a><span class="lineno"> 5737</span>     <span class="keywordflow">if</span> (refmask) {</div>
+<div class="line"><a name="l05738"></a><span class="lineno"> 5738</span>         kernel = cpl_matrix_new(3, 3);</div>
+<div class="line"><a name="l05739"></a><span class="lineno"> 5739</span>         cpl_matrix_set(kernel, 0, 1, 1.0);</div>
+<div class="line"><a name="l05740"></a><span class="lineno"> 5740</span>         cpl_matrix_set(kernel, 1, 1, 1.0);</div>
+<div class="line"><a name="l05741"></a><span class="lineno"> 5741</span>         cpl_matrix_set(kernel, 2, 1, 1.0);</div>
+<div class="line"><a name="l05742"></a><span class="lineno"> 5742</span> </div>
+<div class="line"><a name="l05743"></a><span class="lineno"> 5743</span>         cpl_mask_dilation(refmask, kernel);</div>
+<div class="line"><a name="l05744"></a><span class="lineno"> 5744</span>         cpl_mask_erosion(refmask, kernel);</div>
+<div class="line"><a name="l05745"></a><span class="lineno"> 5745</span>         cpl_mask_erosion(refmask, kernel);</div>
+<div class="line"><a name="l05746"></a><span class="lineno"> 5746</span>         cpl_mask_dilation(refmask, kernel);</div>
+<div class="line"><a name="l05747"></a><span class="lineno"> 5747</span> </div>
+<div class="line"><a name="l05748"></a><span class="lineno"> 5748</span>         cpl_matrix_delete(kernel);</div>
+<div class="line"><a name="l05749"></a><span class="lineno"> 5749</span> </div>
+<div class="line"><a name="l05750"></a><span class="lineno"> 5750</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l05751"></a><span class="lineno"> 5751</span> <span class="comment">         *  Fill possible gaps</span></div>
+<div class="line"><a name="l05752"></a><span class="lineno"> 5752</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l05753"></a><span class="lineno"> 5753</span> </div>
+<div class="line"><a name="l05754"></a><span class="lineno"> 5754</span>         mdata = cpl_mask_get_data(refmask);</div>
+<div class="line"><a name="l05755"></a><span class="lineno"> 5755</span>         have_it = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l05756"></a><span class="lineno"> 5756</span> </div>
+<div class="line"><a name="l05757"></a><span class="lineno"> 5757</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i++, mdata += nx) {</div>
+<div class="line"><a name="l05758"></a><span class="lineno"> 5758</span>             <span class="keywordflow">for</span> (j = 0; j < nx; j++) {</div>
+<div class="line"><a name="l05759"></a><span class="lineno"> 5759</span>                 <span class="keywordflow">if</span> (mdata[j] == CPL_BINARY_1) {</div>
+<div class="line"><a name="l05760"></a><span class="lineno"> 5760</span>                     have_it[i] = j;</div>
+<div class="line"><a name="l05761"></a><span class="lineno"> 5761</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l05762"></a><span class="lineno"> 5762</span>                 }</div>
+<div class="line"><a name="l05763"></a><span class="lineno"> 5763</span>             }</div>
+<div class="line"><a name="l05764"></a><span class="lineno"> 5764</span>         }</div>
+<div class="line"><a name="l05765"></a><span class="lineno"> 5765</span> </div>
+<div class="line"><a name="l05766"></a><span class="lineno"> 5766</span>         mdata = cpl_mask_get_data(refmask);</div>
+<div class="line"><a name="l05767"></a><span class="lineno"> 5767</span>         in = 0;</div>
+<div class="line"><a name="l05768"></a><span class="lineno"> 5768</span>         first = last = 0;</div>
+<div class="line"><a name="l05769"></a><span class="lineno"> 5769</span> </div>
+<div class="line"><a name="l05770"></a><span class="lineno"> 5770</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l05771"></a><span class="lineno"> 5771</span>             <span class="keywordflow">if</span> (have_it[i]) {</div>
+<div class="line"><a name="l05772"></a><span class="lineno"> 5772</span>                 <span class="keywordflow">if</span> (!in) {</div>
+<div class="line"><a name="l05773"></a><span class="lineno"> 5773</span>                     in = 1;</div>
+<div class="line"><a name="l05774"></a><span class="lineno"> 5774</span>                     <span class="keywordflow">if</span> (first) {</div>
+<div class="line"><a name="l05775"></a><span class="lineno"> 5775</span>                         last = i;</div>
+<div class="line"><a name="l05776"></a><span class="lineno"> 5776</span>                         <span class="keywordflow">if</span> (abs(have_it[first] - have_it[last]) < 3) {</div>
+<div class="line"><a name="l05777"></a><span class="lineno"> 5777</span>                             <span class="keywordflow">for</span> (j = first; j < last; j++) {</div>
+<div class="line"><a name="l05778"></a><span class="lineno"> 5778</span>                                 mdata[have_it[first] + nx*j + 0] = CPL_BINARY_1;</div>
+<div class="line"><a name="l05779"></a><span class="lineno"> 5779</span>                                 mdata[have_it[first] + nx*j + 1] = CPL_BINARY_1;</div>
+<div class="line"><a name="l05780"></a><span class="lineno"> 5780</span>                                 mdata[have_it[first] + nx*j + 2] = CPL_BINARY_1;</div>
+<div class="line"><a name="l05781"></a><span class="lineno"> 5781</span>                             }</div>
+<div class="line"><a name="l05782"></a><span class="lineno"> 5782</span>                         }</div>
+<div class="line"><a name="l05783"></a><span class="lineno"> 5783</span>                     }</div>
+<div class="line"><a name="l05784"></a><span class="lineno"> 5784</span>                 }</div>
+<div class="line"><a name="l05785"></a><span class="lineno"> 5785</span>             }</div>
+<div class="line"><a name="l05786"></a><span class="lineno"> 5786</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l05787"></a><span class="lineno"> 5787</span>                 <span class="keywordflow">if</span> (in) {</div>
+<div class="line"><a name="l05788"></a><span class="lineno"> 5788</span>                     in = 0;</div>
+<div class="line"><a name="l05789"></a><span class="lineno"> 5789</span>                     first = i - 1;</div>
+<div class="line"><a name="l05790"></a><span class="lineno"> 5790</span>                 }</div>
+<div class="line"><a name="l05791"></a><span class="lineno"> 5791</span>             }</div>
+<div class="line"><a name="l05792"></a><span class="lineno"> 5792</span>         }</div>
+<div class="line"><a name="l05793"></a><span class="lineno"> 5793</span> </div>
+<div class="line"><a name="l05794"></a><span class="lineno"> 5794</span>         cpl_free(have_it);</div>
+<div class="line"><a name="l05795"></a><span class="lineno"> 5795</span> </div>
+<div class="line"><a name="l05796"></a><span class="lineno"> 5796</span>     }</div>
+<div class="line"><a name="l05797"></a><span class="lineno"> 5797</span> </div>
+<div class="line"><a name="l05798"></a><span class="lineno"> 5798</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l05799"></a><span class="lineno"> 5799</span> <span class="comment">    for (i = 0; i < ny; i++) {</span></div>
+<div class="line"><a name="l05800"></a><span class="lineno"> 5800</span> <span class="comment">        if (nlines[i] == 0) {</span></div>
+<div class="line"><a name="l05801"></a><span class="lineno"> 5801</span> <span class="comment">            for (k = 0; k <= order; k++) {</span></div>
+<div class="line"><a name="l05802"></a><span class="lineno"> 5802</span> <span class="comment">                cpl_table_set_invalid(idscoeff, clab[k], i);</span></div>
+<div class="line"><a name="l05803"></a><span class="lineno"> 5803</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l05804"></a><span class="lineno"> 5804</span> <span class="comment">        }</span></div>
+<div class="line"><a name="l05805"></a><span class="lineno"> 5805</span> <span class="comment">    }</span></div>
+<div class="line"><a name="l05806"></a><span class="lineno"> 5806</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l05807"></a><span class="lineno"> 5807</span> </div>
+<div class="line"><a name="l05808"></a><span class="lineno"> 5808</span>     <span class="keywordflow">return</span> resampled;</div>
+<div class="line"><a name="l05809"></a><span class="lineno"> 5809</span> }</div>
+<div class="line"><a name="l05810"></a><span class="lineno"> 5810</span> </div>
+<div class="line"><a name="l05811"></a><span class="lineno"> 5811</span> </div>
+<div class="line"><a name="l05833"></a><span class="lineno"> 5833</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l05834"></a><span class="lineno"> 5834</span> <span class="comment">cpl_table *mos_locate_spectra_bis(cpl_mask *mask)</span></div>
+<div class="line"><a name="l05835"></a><span class="lineno"> 5835</span> <span class="comment">{</span></div>
+<div class="line"><a name="l05836"></a><span class="lineno"> 5836</span> <span class="comment">    const char *func = "mos_locate_spectra_bis";</span></div>
+<div class="line"><a name="l05837"></a><span class="lineno"> 5837</span> <span class="comment"></span></div>
+<div class="line"><a name="l05838"></a><span class="lineno"> 5838</span> <span class="comment">    cpl_apertures    *slits;</span></div>
+<div class="line"><a name="l05839"></a><span class="lineno"> 5839</span> <span class="comment">    cpl_image        *labimage;</span></div>
+<div class="line"><a name="l05840"></a><span class="lineno"> 5840</span> <span class="comment">    cpl_image        *refimage;</span></div>
+<div class="line"><a name="l05841"></a><span class="lineno"> 5841</span> <span class="comment">    cpl_binary       *mdata;</span></div>
+<div class="line"><a name="l05842"></a><span class="lineno"> 5842</span> <span class="comment">    cpl_table        *slitpos;</span></div>
+<div class="line"><a name="l05843"></a><span class="lineno"> 5843</span> <span class="comment">    cpl_propertylist *sort_col;</span></div>
+<div class="line"><a name="l05844"></a><span class="lineno"> 5844</span> <span class="comment">    int               nslits;</span></div>
+<div class="line"><a name="l05845"></a><span class="lineno"> 5845</span> <span class="comment">    int              *have_it;</span></div>
+<div class="line"><a name="l05846"></a><span class="lineno"> 5846</span> <span class="comment">    int               in, first, last;</span></div>
+<div class="line"><a name="l05847"></a><span class="lineno"> 5847</span> <span class="comment">    int               i, j;</span></div>
+<div class="line"><a name="l05848"></a><span class="lineno"> 5848</span> <span class="comment"></span></div>
+<div class="line"><a name="l05849"></a><span class="lineno"> 5849</span> <span class="comment"></span></div>
+<div class="line"><a name="l05850"></a><span class="lineno"> 5850</span> <span class="comment">    if (mask == NULL) {</span></div>
+<div class="line"><a name="l05851"></a><span class="lineno"> 5851</span> <span class="comment">        cpl_error_set(func, CPL_ERROR_NULL_INPUT);</span></div>
+<div class="line"><a name="l05852"></a><span class="lineno"> 5852</span> <span class="comment">        return NULL;</span></div>
+<div class="line"><a name="l05853"></a><span class="lineno"> 5853</span> <span class="comment">    }</span></div>
+<div class="line"><a name="l05854"></a><span class="lineno"> 5854</span> <span class="comment"></span></div>
+<div class="line"><a name="l05855"></a><span class="lineno"> 5855</span> <span class="comment">    nx = cpl_mask_get_size_x(mask);</span></div>
+<div class="line"><a name="l05856"></a><span class="lineno"> 5856</span> <span class="comment">    ny = cpl_mask_get_size_y(mask);</span></div>
+<div class="line"><a name="l05857"></a><span class="lineno"> 5857</span> <span class="comment"></span></div>
+<div class="line"><a name="l05858"></a><span class="lineno"> 5858</span> <span class="comment">    mdata = cpl_mask_get_data(refmask);</span></div>
+<div class="line"><a name="l05859"></a><span class="lineno"> 5859</span> <span class="comment">    have_it = cpl_calloc(ny, sizeof(int));</span></div>
+<div class="line"><a name="l05860"></a><span class="lineno"> 5860</span> <span class="comment"></span></div>
+<div class="line"><a name="l05861"></a><span class="lineno"> 5861</span> <span class="comment">    for (i = 0; i < ny; i++, mdata += nx) {</span></div>
+<div class="line"><a name="l05862"></a><span class="lineno"> 5862</span> <span class="comment">        for (j = 0; j < nx; j++) {</span></div>
+<div class="line"><a name="l05863"></a><span class="lineno"> 5863</span> <span class="comment">            if (mdata[j] == CPL_BINARY_1) {</span></div>
+<div class="line"><a name="l05864"></a><span class="lineno"> 5864</span> <span class="comment">                have_it[i] = j + 1;</span></div>
+<div class="line"><a name="l05865"></a><span class="lineno"> 5865</span> <span class="comment">                break;</span></div>
+<div class="line"><a name="l05866"></a><span class="lineno"> 5866</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l05867"></a><span class="lineno"> 5867</span> <span class="comment">        }</span></div>
+<div class="line"><a name="l05868"></a><span class="lineno"> 5868</span> <span class="comment">    }</span></div>
+<div class="line"><a name="l05869"></a><span class="lineno"> 5869</span> <span class="comment"></span></div>
+<div class="line"><a name="l05870"></a><span class="lineno"> 5870</span> <span class="comment">    mdata = cpl_mask_get_data(refmask);</span></div>
+<div class="line"><a name="l05871"></a><span class="lineno"> 5871</span> <span class="comment">    in = 0;</span></div>
+<div class="line"><a name="l05872"></a><span class="lineno"> 5872</span> <span class="comment">    first = last = 0;</span></div>
+<div class="line"><a name="l05873"></a><span class="lineno"> 5873</span> <span class="comment">    nslits = 0;</span></div>
+<div class="line"><a name="l05874"></a><span class="lineno"> 5874</span> <span class="comment"></span></div>
+<div class="line"><a name="l05875"></a><span class="lineno"> 5875</span> <span class="comment">    for (i = 0; i < ny; i++) {</span></div>
+<div class="line"><a name="l05876"></a><span class="lineno"> 5876</span> <span class="comment">        if (have_it[i]) {</span></div>
+<div class="line"><a name="l05877"></a><span class="lineno"> 5877</span> <span class="comment">            if (in) {</span></div>
+<div class="line"><a name="l05878"></a><span class="lineno"> 5878</span> <span class="comment">                if (i) {</span></div>
+<div class="line"><a name="l05879"></a><span class="lineno"> 5879</span> <span class="comment">                    if (abs(have_it[i] - have_it[i-1]) > 3) {</span></div>
+<div class="line"><a name="l05880"></a><span class="lineno"> 5880</span> <span class="comment">                        nslits++;</span></div>
+<div class="line"><a name="l05881"></a><span class="lineno"> 5881</span> <span class="comment">                    }</span></div>
+<div class="line"><a name="l05882"></a><span class="lineno"> 5882</span> <span class="comment">                }</span></div>
+<div class="line"><a name="l05883"></a><span class="lineno"> 5883</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l05884"></a><span class="lineno"> 5884</span> <span class="comment">            else {</span></div>
+<div class="line"><a name="l05885"></a><span class="lineno"> 5885</span> <span class="comment">                in = 1;</span></div>
+<div class="line"><a name="l05886"></a><span class="lineno"> 5886</span> <span class="comment">                nslits++;</span></div>
+<div class="line"><a name="l05887"></a><span class="lineno"> 5887</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l05888"></a><span class="lineno"> 5888</span> <span class="comment">        }</span></div>
+<div class="line"><a name="l05889"></a><span class="lineno"> 5889</span> <span class="comment">        else {</span></div>
+<div class="line"><a name="l05890"></a><span class="lineno"> 5890</span> <span class="comment">            if (in) {</span></div>
+<div class="line"><a name="l05891"></a><span class="lineno"> 5891</span> <span class="comment">                in = 0;</span></div>
+<div class="line"><a name="l05892"></a><span class="lineno"> 5892</span> <span class="comment">            }</span></div>
+<div class="line"><a name="l05893"></a><span class="lineno"> 5893</span> <span class="comment">        }</span></div>
+<div class="line"><a name="l05894"></a><span class="lineno"> 5894</span> <span class="comment">    }</span></div>
+<div class="line"><a name="l05895"></a><span class="lineno"> 5895</span> <span class="comment">}</span></div>
+<div class="line"><a name="l05896"></a><span class="lineno"> 5896</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l05897"></a><span class="lineno"> 5897</span> </div>
+<div class="line"><a name="l05898"></a><span class="lineno"> 5898</span> </div>
+<div class="line"><a name="l05920"></a><span class="lineno"><a class="code" href="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900"> 5920</a></span> cpl_table *<a class="code" href="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900" title="Find the location of detected spectra on the CCD.">mos_locate_spectra</a>(cpl_mask *mask)</div>
+<div class="line"><a name="l05921"></a><span class="lineno"> 5921</span> {</div>
+<div class="line"><a name="l05922"></a><span class="lineno"> 5922</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_locate_spectra"</span>;</div>
+<div class="line"><a name="l05923"></a><span class="lineno"> 5923</span> </div>
+<div class="line"><a name="l05924"></a><span class="lineno"> 5924</span>     cpl_apertures    *slits;</div>
+<div class="line"><a name="l05925"></a><span class="lineno"> 5925</span>     cpl_image        *labimage;</div>
+<div class="line"><a name="l05926"></a><span class="lineno"> 5926</span>     cpl_image        *refimage;</div>
+<div class="line"><a name="l05927"></a><span class="lineno"> 5927</span>     cpl_table        *slitpos;</div>
+<div class="line"><a name="l05928"></a><span class="lineno"> 5928</span>     cpl_propertylist *sort_col;</div>
+<div class="line"><a name="l05929"></a><span class="lineno"> 5929</span>     cpl_size          nslits;</div>
+<div class="line"><a name="l05930"></a><span class="lineno"> 5930</span>     <span class="keywordtype">int</span>               i;</div>
+<div class="line"><a name="l05931"></a><span class="lineno"> 5931</span> </div>
+<div class="line"><a name="l05932"></a><span class="lineno"> 5932</span> </div>
+<div class="line"><a name="l05933"></a><span class="lineno"> 5933</span>     <span class="keywordflow">if</span> (mask == NULL) {</div>
+<div class="line"><a name="l05934"></a><span class="lineno"> 5934</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l05935"></a><span class="lineno"> 5935</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l05936"></a><span class="lineno"> 5936</span>     }</div>
+<div class="line"><a name="l05937"></a><span class="lineno"> 5937</span> </div>
+<div class="line"><a name="l05938"></a><span class="lineno"> 5938</span>     labimage = cpl_image_labelise_mask_create(mask, &nslits);</div>
+<div class="line"><a name="l05939"></a><span class="lineno"> 5939</span> </div>
+<div class="line"><a name="l05940"></a><span class="lineno"> 5940</span>     <span class="keywordflow">if</span> (nslits < 1) {</div>
+<div class="line"><a name="l05941"></a><span class="lineno"> 5941</span>         cpl_image_delete(labimage);</div>
+<div class="line"><a name="l05942"></a><span class="lineno"> 5942</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l05943"></a><span class="lineno"> 5943</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l05944"></a><span class="lineno"> 5944</span>     }</div>
+<div class="line"><a name="l05945"></a><span class="lineno"> 5945</span> </div>
+<div class="line"><a name="l05946"></a><span class="lineno"> 5946</span>     refimage = cpl_image_new_from_mask(mask);</div>
+<div class="line"><a name="l05947"></a><span class="lineno"> 5947</span> </div>
+<div class="line"><a name="l05948"></a><span class="lineno"> 5948</span>     slits = cpl_apertures_new_from_image(refimage, labimage);</div>
+<div class="line"><a name="l05949"></a><span class="lineno"> 5949</span> </div>
+<div class="line"><a name="l05950"></a><span class="lineno"> 5950</span>     cpl_image_delete(labimage);</div>
+<div class="line"><a name="l05951"></a><span class="lineno"> 5951</span>     cpl_image_delete(refimage);</div>
+<div class="line"><a name="l05952"></a><span class="lineno"> 5952</span> </div>
+<div class="line"><a name="l05953"></a><span class="lineno"> 5953</span>     nslits = cpl_apertures_get_size(slits);  <span class="comment">/* Overwriting nslits - safer! */</span></div>
+<div class="line"><a name="l05954"></a><span class="lineno"> 5954</span>     <span class="keywordflow">if</span> (nslits < 1) {</div>
+<div class="line"><a name="l05955"></a><span class="lineno"> 5955</span>         cpl_apertures_delete(slits);</div>
+<div class="line"><a name="l05956"></a><span class="lineno"> 5956</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l05957"></a><span class="lineno"> 5957</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l05958"></a><span class="lineno"> 5958</span>     }</div>
+<div class="line"><a name="l05959"></a><span class="lineno"> 5959</span> </div>
+<div class="line"><a name="l05960"></a><span class="lineno"> 5960</span>     slitpos = cpl_table_new(nslits);</div>
+<div class="line"><a name="l05961"></a><span class="lineno"> 5961</span>     cpl_table_new_column(slitpos, <span class="stringliteral">"xtop"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05962"></a><span class="lineno"> 5962</span>     cpl_table_new_column(slitpos, <span class="stringliteral">"ytop"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05963"></a><span class="lineno"> 5963</span>     cpl_table_new_column(slitpos, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05964"></a><span class="lineno"> 5964</span>     cpl_table_new_column(slitpos, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l05965"></a><span class="lineno"> 5965</span>     cpl_table_set_column_unit(slitpos, <span class="stringliteral">"xtop"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l05966"></a><span class="lineno"> 5966</span>     cpl_table_set_column_unit(slitpos, <span class="stringliteral">"ytop"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l05967"></a><span class="lineno"> 5967</span>     cpl_table_set_column_unit(slitpos, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l05968"></a><span class="lineno"> 5968</span>     cpl_table_set_column_unit(slitpos, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l05969"></a><span class="lineno"> 5969</span> </div>
+<div class="line"><a name="l05970"></a><span class="lineno"> 5970</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l05971"></a><span class="lineno"> 5971</span>         cpl_table_set_double(slitpos, <span class="stringliteral">"xtop"</span>, i, </div>
+<div class="line"><a name="l05972"></a><span class="lineno"> 5972</span>                              cpl_apertures_get_top_x(slits, i+1) - 1);</div>
+<div class="line"><a name="l05973"></a><span class="lineno"> 5973</span>         cpl_table_set_double(slitpos, <span class="stringliteral">"ytop"</span>, i, </div>
+<div class="line"><a name="l05974"></a><span class="lineno"> 5974</span>                              cpl_apertures_get_top(slits, i+1));</div>
+<div class="line"><a name="l05975"></a><span class="lineno"> 5975</span>         cpl_table_set_double(slitpos, <span class="stringliteral">"xbottom"</span>, i, </div>
+<div class="line"><a name="l05976"></a><span class="lineno"> 5976</span>                              cpl_apertures_get_bottom_x(slits, i+1) - 1);</div>
+<div class="line"><a name="l05977"></a><span class="lineno"> 5977</span>         cpl_table_set_double(slitpos, <span class="stringliteral">"ybottom"</span>, i, </div>
+<div class="line"><a name="l05978"></a><span class="lineno"> 5978</span>                              cpl_apertures_get_bottom(slits, i+1));</div>
+<div class="line"><a name="l05979"></a><span class="lineno"> 5979</span>     }</div>
+<div class="line"><a name="l05980"></a><span class="lineno"> 5980</span> </div>
+<div class="line"><a name="l05981"></a><span class="lineno"> 5981</span>     cpl_apertures_delete(slits);</div>
+<div class="line"><a name="l05982"></a><span class="lineno"> 5982</span> </div>
+<div class="line"><a name="l05983"></a><span class="lineno"> 5983</span>     sort_col = cpl_propertylist_new();</div>
+<div class="line"><a name="l05984"></a><span class="lineno"> 5984</span>     cpl_propertylist_append_bool(sort_col, <span class="stringliteral">"ytop"</span>, 1);</div>
+<div class="line"><a name="l05985"></a><span class="lineno"> 5985</span>     cpl_table_sort(slitpos, sort_col);</div>
+<div class="line"><a name="l05986"></a><span class="lineno"> 5986</span>     cpl_propertylist_delete(sort_col);</div>
+<div class="line"><a name="l05987"></a><span class="lineno"> 5987</span> </div>
+<div class="line"><a name="l05988"></a><span class="lineno"> 5988</span>     <span class="keywordflow">return</span> slitpos;</div>
+<div class="line"><a name="l05989"></a><span class="lineno"> 5989</span> </div>
+<div class="line"><a name="l05990"></a><span class="lineno"> 5990</span> }</div>
+<div class="line"><a name="l05991"></a><span class="lineno"> 5991</span> </div>
+<div class="line"><a name="l05992"></a><span class="lineno"> 5992</span> </div>
+<div class="line"><a name="l06008"></a><span class="lineno"><a class="code" href="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d"> 6008</a></span> cpl_error_code <a class="code" href="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d" title="Check validity of a slit location table.">mos_validate_slits</a>(cpl_table *slits) </div>
+<div class="line"><a name="l06009"></a><span class="lineno"> 6009</span> {</div>
+<div class="line"><a name="l06010"></a><span class="lineno"> 6010</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_validate_slits"</span>;</div>
+<div class="line"><a name="l06011"></a><span class="lineno"> 6011</span> </div>
+<div class="line"><a name="l06012"></a><span class="lineno"> 6012</span> </div>
+<div class="line"><a name="l06013"></a><span class="lineno"> 6013</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l06014"></a><span class="lineno"> 6014</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l06015"></a><span class="lineno"> 6015</span> </div>
+<div class="line"><a name="l06016"></a><span class="lineno"> 6016</span>     <span class="keywordflow">if</span> (1 != cpl_table_has_column(slits, <span class="stringliteral">"xtop"</span>))</div>
+<div class="line"><a name="l06017"></a><span class="lineno"> 6017</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l06018"></a><span class="lineno"> 6018</span> </div>
+<div class="line"><a name="l06019"></a><span class="lineno"> 6019</span>     <span class="keywordflow">if</span> (1 != cpl_table_has_column(slits, <span class="stringliteral">"ytop"</span>))</div>
+<div class="line"><a name="l06020"></a><span class="lineno"> 6020</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l06021"></a><span class="lineno"> 6021</span> </div>
+<div class="line"><a name="l06022"></a><span class="lineno"> 6022</span>     <span class="keywordflow">if</span> (1 != cpl_table_has_column(slits, <span class="stringliteral">"xbottom"</span>))</div>
+<div class="line"><a name="l06023"></a><span class="lineno"> 6023</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l06024"></a><span class="lineno"> 6024</span> </div>
+<div class="line"><a name="l06025"></a><span class="lineno"> 6025</span>     <span class="keywordflow">if</span> (1 != cpl_table_has_column(slits, <span class="stringliteral">"ybottom"</span>))</div>
+<div class="line"><a name="l06026"></a><span class="lineno"> 6026</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l06027"></a><span class="lineno"> 6027</span> </div>
+<div class="line"><a name="l06028"></a><span class="lineno"> 6028</span>     <span class="keywordflow">if</span> (CPL_TYPE_DOUBLE != cpl_table_get_column_type(slits, <span class="stringliteral">"xtop"</span>))</div>
+<div class="line"><a name="l06029"></a><span class="lineno"> 6029</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l06030"></a><span class="lineno"> 6030</span> </div>
+<div class="line"><a name="l06031"></a><span class="lineno"> 6031</span>     <span class="keywordflow">if</span> (CPL_TYPE_DOUBLE != cpl_table_get_column_type(slits, <span class="stringliteral">"ytop"</span>))</div>
+<div class="line"><a name="l06032"></a><span class="lineno"> 6032</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l06033"></a><span class="lineno"> 6033</span> </div>
+<div class="line"><a name="l06034"></a><span class="lineno"> 6034</span>     <span class="keywordflow">if</span> (CPL_TYPE_DOUBLE != cpl_table_get_column_type(slits, <span class="stringliteral">"xbottom"</span>))</div>
+<div class="line"><a name="l06035"></a><span class="lineno"> 6035</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l06036"></a><span class="lineno"> 6036</span> </div>
+<div class="line"><a name="l06037"></a><span class="lineno"> 6037</span>     <span class="keywordflow">if</span> (CPL_TYPE_DOUBLE != cpl_table_get_column_type(slits, <span class="stringliteral">"ybottom"</span>))</div>
+<div class="line"><a name="l06038"></a><span class="lineno"> 6038</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l06039"></a><span class="lineno"> 6039</span> </div>
+<div class="line"><a name="l06040"></a><span class="lineno"> 6040</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l06041"></a><span class="lineno"> 6041</span> }</div>
+<div class="line"><a name="l06042"></a><span class="lineno"> 6042</span> </div>
+<div class="line"><a name="l06043"></a><span class="lineno"> 6043</span> </div>
+<div class="line"><a name="l06072"></a><span class="lineno"><a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f"> 6072</a></span> cpl_error_code <a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f" title="Rotate a slit location table.">mos_rotate_slits</a>(cpl_table *slits, <span class="keywordtype">int</span> rotation, <span class="keywordtype">int</span> nx, <span class="keywordtype">int</span> ny)</div>
+<div class="line"><a name="l06073"></a><span class="lineno"> 6073</span> {</div>
+<div class="line"><a name="l06074"></a><span class="lineno"> 6074</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_rotate_slits"</span>;</div>
+<div class="line"><a name="l06075"></a><span class="lineno"> 6075</span> </div>
+<div class="line"><a name="l06076"></a><span class="lineno"> 6076</span>     cpl_error_code error;</div>
+<div class="line"><a name="l06077"></a><span class="lineno"> 6077</span>     <span class="keywordtype">char</span> aux_name[] = <span class="stringliteral">"_0"</span>;</div>
+<div class="line"><a name="l06078"></a><span class="lineno"> 6078</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l06079"></a><span class="lineno"> 6079</span> </div>
+<div class="line"><a name="l06080"></a><span class="lineno"> 6080</span> </div>
+<div class="line"><a name="l06081"></a><span class="lineno"> 6081</span>     rotation %= 4;</div>
+<div class="line"><a name="l06082"></a><span class="lineno"> 6082</span>     <span class="keywordflow">if</span> (rotation < 0)</div>
+<div class="line"><a name="l06083"></a><span class="lineno"> 6083</span>         rotation += 4;</div>
+<div class="line"><a name="l06084"></a><span class="lineno"> 6084</span> </div>
+<div class="line"><a name="l06085"></a><span class="lineno"> 6085</span>     <span class="keywordflow">if</span> (rotation == 0)</div>
+<div class="line"><a name="l06086"></a><span class="lineno"> 6086</span>         <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l06087"></a><span class="lineno"> 6087</span> </div>
+<div class="line"><a name="l06088"></a><span class="lineno"> 6088</span>     error = <a class="code" href="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d" title="Check validity of a slit location table.">mos_validate_slits</a>(slits);</div>
+<div class="line"><a name="l06089"></a><span class="lineno"> 6089</span>     <span class="keywordflow">if</span> (error)</div>
+<div class="line"><a name="l06090"></a><span class="lineno"> 6090</span>         <span class="keywordflow">return</span> cpl_error_set(func, error);</div>
+<div class="line"><a name="l06091"></a><span class="lineno"> 6091</span> </div>
+<div class="line"><a name="l06092"></a><span class="lineno"> 6092</span>     <span class="keywordflow">if</span> (rotation == 1 || rotation == 3) {</div>
+<div class="line"><a name="l06093"></a><span class="lineno"> 6093</span> </div>
+<div class="line"><a name="l06094"></a><span class="lineno"> 6094</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l06095"></a><span class="lineno"> 6095</span> <span class="comment">         * Swap x and y column names</span></div>
+<div class="line"><a name="l06096"></a><span class="lineno"> 6096</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l06097"></a><span class="lineno"> 6097</span> </div>
+<div class="line"><a name="l06098"></a><span class="lineno"> 6098</span>         <span class="keywordflow">for</span> (i = 0; i < 77; i++)</div>
+<div class="line"><a name="l06099"></a><span class="lineno"> 6099</span>             <span class="keywordflow">if</span> (1 == cpl_table_has_column(slits, aux_name))</div>
+<div class="line"><a name="l06100"></a><span class="lineno"> 6100</span>                 aux_name[1]++;</div>
+<div class="line"><a name="l06101"></a><span class="lineno"> 6101</span>         <span class="keywordflow">if</span> (1 == cpl_table_has_column(slits, aux_name))</div>
+<div class="line"><a name="l06102"></a><span class="lineno"> 6102</span>             <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_CONTINUE);</div>
+<div class="line"><a name="l06103"></a><span class="lineno"> 6103</span>         cpl_table_name_column(slits, <span class="stringliteral">"xtop"</span>, aux_name);</div>
+<div class="line"><a name="l06104"></a><span class="lineno"> 6104</span>         cpl_table_name_column(slits, <span class="stringliteral">"ytop"</span>, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l06105"></a><span class="lineno"> 6105</span>         cpl_table_name_column(slits, aux_name, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l06106"></a><span class="lineno"> 6106</span>         cpl_table_name_column(slits, <span class="stringliteral">"xbottom"</span>, aux_name);</div>
+<div class="line"><a name="l06107"></a><span class="lineno"> 6107</span>         cpl_table_name_column(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l06108"></a><span class="lineno"> 6108</span>         cpl_table_name_column(slits, aux_name, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l06109"></a><span class="lineno"> 6109</span>     }</div>
+<div class="line"><a name="l06110"></a><span class="lineno"> 6110</span> </div>
+<div class="line"><a name="l06111"></a><span class="lineno"> 6111</span>     <span class="keywordflow">if</span> (rotation == 1 || rotation == 2) {</div>
+<div class="line"><a name="l06112"></a><span class="lineno"> 6112</span>         cpl_table_multiply_scalar(slits, <span class="stringliteral">"xtop"</span>, -1.0);</div>
+<div class="line"><a name="l06113"></a><span class="lineno"> 6113</span>         cpl_table_multiply_scalar(slits, <span class="stringliteral">"xbottom"</span>, -1.0);</div>
+<div class="line"><a name="l06114"></a><span class="lineno"> 6114</span>         cpl_table_add_scalar(slits, <span class="stringliteral">"xtop"</span>, nx);</div>
+<div class="line"><a name="l06115"></a><span class="lineno"> 6115</span>         cpl_table_add_scalar(slits, <span class="stringliteral">"xbottom"</span>, nx);</div>
+<div class="line"><a name="l06116"></a><span class="lineno"> 6116</span>     }</div>
+<div class="line"><a name="l06117"></a><span class="lineno"> 6117</span> </div>
+<div class="line"><a name="l06118"></a><span class="lineno"> 6118</span>     <span class="keywordflow">if</span> (rotation == 3 || rotation == 2) {</div>
+<div class="line"><a name="l06119"></a><span class="lineno"> 6119</span>         cpl_table_multiply_scalar(slits, <span class="stringliteral">"ytop"</span>, -1.0);</div>
+<div class="line"><a name="l06120"></a><span class="lineno"> 6120</span>         cpl_table_multiply_scalar(slits, <span class="stringliteral">"ybottom"</span>, -1.0);</div>
+<div class="line"><a name="l06121"></a><span class="lineno"> 6121</span>         cpl_table_add_scalar(slits, <span class="stringliteral">"ytop"</span>, ny);</div>
+<div class="line"><a name="l06122"></a><span class="lineno"> 6122</span>         cpl_table_add_scalar(slits, <span class="stringliteral">"ybottom"</span>, ny);</div>
+<div class="line"><a name="l06123"></a><span class="lineno"> 6123</span>     }</div>
+<div class="line"><a name="l06124"></a><span class="lineno"> 6124</span> </div>
+<div class="line"><a name="l06125"></a><span class="lineno"> 6125</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l06126"></a><span class="lineno"> 6126</span> }</div>
+<div class="line"><a name="l06127"></a><span class="lineno"> 6127</span> </div>
+<div class="line"><a name="l06128"></a><span class="lineno"> 6128</span> </div>
+<div class="line"><a name="l06186"></a><span class="lineno"><a class="code" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364"> 6186</a></span> cpl_table *<a class="code" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits</a>(cpl_table *slits, cpl_table *maskslits,</div>
+<div class="line"><a name="l06187"></a><span class="lineno"> 6187</span>                               cpl_table *global)</div>
+<div class="line"><a name="l06188"></a><span class="lineno"> 6188</span> {</div>
+<div class="line"><a name="l06189"></a><span class="lineno"> 6189</span>     cpl_array        *top_ident = NULL;;</div>
+<div class="line"><a name="l06190"></a><span class="lineno"> 6190</span>     cpl_array        *bot_ident = NULL;;</div>
+<div class="line"><a name="l06191"></a><span class="lineno"> 6191</span>     cpl_matrix       *mdata;</div>
+<div class="line"><a name="l06192"></a><span class="lineno"> 6192</span>     cpl_matrix       *mpattern;</div>
+<div class="line"><a name="l06193"></a><span class="lineno"> 6193</span>     cpl_matrix       *top_data;</div>
+<div class="line"><a name="l06194"></a><span class="lineno"> 6194</span>     cpl_matrix       *top_pattern;</div>
+<div class="line"><a name="l06195"></a><span class="lineno"> 6195</span>     cpl_matrix       *top_mdata;</div>
+<div class="line"><a name="l06196"></a><span class="lineno"> 6196</span>     cpl_matrix       *top_mpattern;</div>
+<div class="line"><a name="l06197"></a><span class="lineno"> 6197</span>     cpl_matrix       *bot_data;</div>
+<div class="line"><a name="l06198"></a><span class="lineno"> 6198</span>     cpl_matrix       *bot_pattern;</div>
+<div class="line"><a name="l06199"></a><span class="lineno"> 6199</span>     cpl_matrix       *bot_mdata;</div>
+<div class="line"><a name="l06200"></a><span class="lineno"> 6200</span>     cpl_matrix       *bot_mpattern;</div>
+<div class="line"><a name="l06201"></a><span class="lineno"> 6201</span>     cpl_propertylist *sort_col;</div>
+<div class="line"><a name="l06202"></a><span class="lineno"> 6202</span>     <span class="keywordtype">double</span>           *xtop;</div>
+<div class="line"><a name="l06203"></a><span class="lineno"> 6203</span>     <span class="keywordtype">double</span>           *ytop;</div>
+<div class="line"><a name="l06204"></a><span class="lineno"> 6204</span>     <span class="keywordtype">double</span>           *xmtop;</div>
+<div class="line"><a name="l06205"></a><span class="lineno"> 6205</span>     <span class="keywordtype">double</span>           *ymtop;</div>
+<div class="line"><a name="l06206"></a><span class="lineno"> 6206</span>     <span class="keywordtype">double</span>           *xbot;</div>
+<div class="line"><a name="l06207"></a><span class="lineno"> 6207</span>     <span class="keywordtype">double</span>           *ybot;</div>
+<div class="line"><a name="l06208"></a><span class="lineno"> 6208</span>     <span class="keywordtype">double</span>           *xmbot;</div>
+<div class="line"><a name="l06209"></a><span class="lineno"> 6209</span>     <span class="keywordtype">double</span>           *ymbot;</div>
+<div class="line"><a name="l06210"></a><span class="lineno"> 6210</span>     <span class="keywordtype">double</span>            top_scale, bot_scale;</div>
+<div class="line"><a name="l06211"></a><span class="lineno"> 6211</span>     <span class="keywordtype">double</span>            angle, top_angle, bot_angle;</div>
+<div class="line"><a name="l06212"></a><span class="lineno"> 6212</span>     <span class="keywordtype">double</span>            xmse, ymse;</div>
+<div class="line"><a name="l06213"></a><span class="lineno"> 6213</span>     <span class="keywordtype">double</span>            xrms, top_xrms, bot_xrms;</div>
+<div class="line"><a name="l06214"></a><span class="lineno"> 6214</span>     <span class="keywordtype">double</span>            yrms, top_yrms, bot_yrms;</div>
+<div class="line"><a name="l06215"></a><span class="lineno"> 6215</span>     <span class="keywordtype">int</span>               nslits;</div>
+<div class="line"><a name="l06216"></a><span class="lineno"> 6216</span>     <span class="keywordtype">int</span>               nmaskslits, use_pattern;</div>
+<div class="line"><a name="l06217"></a><span class="lineno"> 6217</span>     <span class="keywordtype">int</span>               found_slits, found_slits_top, found_slits_bot;</div>
+<div class="line"><a name="l06218"></a><span class="lineno"> 6218</span>     <span class="keywordtype">int</span>               degree;</div>
+<div class="line"><a name="l06219"></a><span class="lineno"> 6219</span>     <span class="keywordtype">int</span>               i;</div>
+<div class="line"><a name="l06220"></a><span class="lineno"> 6220</span>     cpl_table        *positions;</div>
+<div class="line"><a name="l06221"></a><span class="lineno"> 6221</span>     cpl_error_code    error;</div>
+<div class="line"><a name="l06222"></a><span class="lineno"> 6222</span> </div>
+<div class="line"><a name="l06223"></a><span class="lineno"> 6223</span>     cpl_vector       *point;</div>
+<div class="line"><a name="l06224"></a><span class="lineno"> 6224</span>     <span class="keywordtype">double</span>           *dpoint;</div>
+<div class="line"><a name="l06225"></a><span class="lineno"> 6225</span>     cpl_vector       *xpos;</div>
+<div class="line"><a name="l06226"></a><span class="lineno"> 6226</span>     cpl_vector       *ypos;</div>
+<div class="line"><a name="l06227"></a><span class="lineno"> 6227</span>     cpl_vector       *xmpos;</div>
+<div class="line"><a name="l06228"></a><span class="lineno"> 6228</span>     cpl_vector       *ympos;</div>
+<div class="line"><a name="l06229"></a><span class="lineno"> 6229</span>     cpl_bivector     *mpos;</div>
+<div class="line"><a name="l06230"></a><span class="lineno"> 6230</span>     cpl_polynomial   *xpoly     = NULL;</div>
+<div class="line"><a name="l06231"></a><span class="lineno"> 6231</span>     cpl_polynomial   *ypoly     = NULL;</div>
+<div class="line"><a name="l06232"></a><span class="lineno"> 6232</span>     cpl_polynomial   *top_xpoly = NULL;</div>
+<div class="line"><a name="l06233"></a><span class="lineno"> 6233</span>     cpl_polynomial   *top_ypoly = NULL;</div>
+<div class="line"><a name="l06234"></a><span class="lineno"> 6234</span>     cpl_polynomial   *bot_xpoly = NULL;</div>
+<div class="line"><a name="l06235"></a><span class="lineno"> 6235</span>     cpl_polynomial   *bot_ypoly = NULL;</div>
+<div class="line"><a name="l06236"></a><span class="lineno"> 6236</span> </div>
+<div class="line"><a name="l06237"></a><span class="lineno"> 6237</span>     <span class="keywordtype">char</span> *msg_multiplex = <span class="stringliteral">" "</span>;</div>
+<div class="line"><a name="l06238"></a><span class="lineno"> 6238</span> </div>
+<div class="line"><a name="l06239"></a><span class="lineno"> 6239</span> </div>
+<div class="line"><a name="l06240"></a><span class="lineno"> 6240</span>     error = <a class="code" href="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d" title="Check validity of a slit location table.">mos_validate_slits</a>(slits);</div>
+<div class="line"><a name="l06241"></a><span class="lineno"> 6241</span>     <span class="keywordflow">if</span> (error) {</div>
+<div class="line"><a name="l06242"></a><span class="lineno"> 6242</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"CCD slits table validation: %s"</span>,</div>
+<div class="line"><a name="l06243"></a><span class="lineno"> 6243</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l06244"></a><span class="lineno"> 6244</span>         cpl_error_set(cpl_func, error);</div>
+<div class="line"><a name="l06245"></a><span class="lineno"> 6245</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06246"></a><span class="lineno"> 6246</span>     }</div>
+<div class="line"><a name="l06247"></a><span class="lineno"> 6247</span> </div>
+<div class="line"><a name="l06248"></a><span class="lineno"> 6248</span>     error = <a class="code" href="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d" title="Check validity of a slit location table.">mos_validate_slits</a>(maskslits);</div>
+<div class="line"><a name="l06249"></a><span class="lineno"> 6249</span>     <span class="keywordflow">if</span> (error) {</div>
+<div class="line"><a name="l06250"></a><span class="lineno"> 6250</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Mask slits table validation: %s"</span>,</div>
+<div class="line"><a name="l06251"></a><span class="lineno"> 6251</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l06252"></a><span class="lineno"> 6252</span>         cpl_error_set(cpl_func, error);</div>
+<div class="line"><a name="l06253"></a><span class="lineno"> 6253</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06254"></a><span class="lineno"> 6254</span>     }</div>
+<div class="line"><a name="l06255"></a><span class="lineno"> 6255</span> </div>
+<div class="line"><a name="l06256"></a><span class="lineno"> 6256</span>     <span class="keywordflow">if</span> (1 != cpl_table_has_column(maskslits, <span class="stringliteral">"slit_id"</span>)) {</div>
+<div class="line"><a name="l06257"></a><span class="lineno"> 6257</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Missing slits identifiers"</span>);</div>
+<div class="line"><a name="l06258"></a><span class="lineno"> 6258</span>         cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l06259"></a><span class="lineno"> 6259</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06260"></a><span class="lineno"> 6260</span>     }</div>
+<div class="line"><a name="l06261"></a><span class="lineno"> 6261</span> </div>
+<div class="line"><a name="l06262"></a><span class="lineno"> 6262</span>     <span class="keywordflow">if</span> (CPL_TYPE_INT != cpl_table_get_column_type(maskslits, <span class="stringliteral">"slit_id"</span>)) {</div>
+<div class="line"><a name="l06263"></a><span class="lineno"> 6263</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Wrong type used for slits identifiers"</span>);</div>
+<div class="line"><a name="l06264"></a><span class="lineno"> 6264</span>         cpl_error_set(cpl_func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l06265"></a><span class="lineno"> 6265</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06266"></a><span class="lineno"> 6266</span>     }</div>
+<div class="line"><a name="l06267"></a><span class="lineno"> 6267</span> </div>
+<div class="line"><a name="l06268"></a><span class="lineno"> 6268</span>     nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l06269"></a><span class="lineno"> 6269</span>     nmaskslits = cpl_table_get_nrow(maskslits);</div>
+<div class="line"><a name="l06270"></a><span class="lineno"> 6270</span> </div>
+<div class="line"><a name="l06271"></a><span class="lineno"> 6271</span>     <span class="keywordflow">if</span> (nslits == 0 || nmaskslits == 0) {</div>
+<div class="line"><a name="l06272"></a><span class="lineno"> 6272</span>         cpl_msg_error(cpl_func, <span class="stringliteral">"Empty slits table"</span>);</div>
+<div class="line"><a name="l06273"></a><span class="lineno"> 6273</span>         cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l06274"></a><span class="lineno"> 6274</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06275"></a><span class="lineno"> 6275</span>     }</div>
+<div class="line"><a name="l06276"></a><span class="lineno"> 6276</span> </div>
+<div class="line"><a name="l06277"></a><span class="lineno"> 6277</span>     <span class="keywordflow">if</span> (nslits > 25 && mos_multiplex < 0) {</div>
+<div class="line"><a name="l06278"></a><span class="lineno"> 6278</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Many slits: using 'fast' pattern matching..."</span>);</div>
+<div class="line"><a name="l06279"></a><span class="lineno"> 6279</span>         positions = mos_identify_slits_fast(slits, maskslits, global);</div>
+<div class="line"><a name="l06280"></a><span class="lineno"> 6280</span>         <span class="keywordflow">if</span> (positions == NULL)</div>
+<div class="line"><a name="l06281"></a><span class="lineno"> 6281</span>             cpl_error_set_where(cpl_func);</div>
+<div class="line"><a name="l06282"></a><span class="lineno"> 6282</span>         <span class="keywordflow">return</span> positions;</div>
+<div class="line"><a name="l06283"></a><span class="lineno"> 6283</span>     }</div>
+<div class="line"><a name="l06284"></a><span class="lineno"> 6284</span> </div>
+<div class="line"><a name="l06285"></a><span class="lineno"> 6285</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l06286"></a><span class="lineno"> 6286</span> <span class="comment">     * Guarantee that both input tables are sorted in the same way</span></div>
+<div class="line"><a name="l06287"></a><span class="lineno"> 6287</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l06288"></a><span class="lineno"> 6288</span> </div>
+<div class="line"><a name="l06289"></a><span class="lineno"> 6289</span>     sort_col = cpl_propertylist_new();</div>
+<div class="line"><a name="l06290"></a><span class="lineno"> 6290</span>     cpl_propertylist_append_bool(sort_col, <span class="stringliteral">"ytop"</span>, 1);</div>
+<div class="line"><a name="l06291"></a><span class="lineno"> 6291</span>     cpl_table_sort(slits, sort_col);</div>
+<div class="line"><a name="l06292"></a><span class="lineno"> 6292</span>     cpl_table_sort(maskslits, sort_col);</div>
+<div class="line"><a name="l06293"></a><span class="lineno"> 6293</span>     cpl_propertylist_delete(sort_col);</div>
+<div class="line"><a name="l06294"></a><span class="lineno"> 6294</span> </div>
+<div class="line"><a name="l06295"></a><span class="lineno"> 6295</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l06296"></a><span class="lineno"> 6296</span> <span class="comment">     * First we handle all the special cases (too few slits...)</span></div>
+<div class="line"><a name="l06297"></a><span class="lineno"> 6297</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l06298"></a><span class="lineno"> 6298</span> </div>
+<div class="line"><a name="l06299"></a><span class="lineno"> 6299</span>     <span class="keywordflow">if</span> (nslits < 3 && nmaskslits > nslits) {</div>
+<div class="line"><a name="l06300"></a><span class="lineno"> 6300</span> </div>
+<div class="line"><a name="l06301"></a><span class="lineno"> 6301</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l06302"></a><span class="lineno"> 6302</span> <span class="comment">         * If there are just 1 or 2 slits on the CCD, and more on the</span></div>
+<div class="line"><a name="l06303"></a><span class="lineno"> 6303</span> <span class="comment">         * mask, the ambiguity cannot be solved, and an error is returned.</span></div>
+<div class="line"><a name="l06304"></a><span class="lineno"> 6304</span> <span class="comment">         * This is a case that must be solved with a first-guess relation</span></div>
+<div class="line"><a name="l06305"></a><span class="lineno"> 6305</span> <span class="comment">         * between mask and CCD.</span></div>
+<div class="line"><a name="l06306"></a><span class="lineno"> 6306</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l06307"></a><span class="lineno"> 6307</span> </div>
+<div class="line"><a name="l06308"></a><span class="lineno"> 6308</span>         <span class="keywordflow">if</span> (nslits > 1)</div>
+<div class="line"><a name="l06309"></a><span class="lineno"> 6309</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot match the %d found CCD slits "</span></div>
+<div class="line"><a name="l06310"></a><span class="lineno"> 6310</span>                             <span class="stringliteral">"with the %d mask slits: process will continue "</span></div>
+<div class="line"><a name="l06311"></a><span class="lineno"> 6311</span>                             <span class="stringliteral">"using the detected CCD slits positions"</span>, nslits,</div>
+<div class="line"><a name="l06312"></a><span class="lineno"> 6312</span>                             nmaskslits);</div>
+<div class="line"><a name="l06313"></a><span class="lineno"> 6313</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l06314"></a><span class="lineno"> 6314</span>             cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot match the found CCD slit with "</span></div>
+<div class="line"><a name="l06315"></a><span class="lineno"> 6315</span>                             <span class="stringliteral">"the %d mask slits: process will continue using "</span></div>
+<div class="line"><a name="l06316"></a><span class="lineno"> 6316</span>                             <span class="stringliteral">"the detected CCD slit position"</span>, nmaskslits);</div>
+<div class="line"><a name="l06317"></a><span class="lineno"> 6317</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06318"></a><span class="lineno"> 6318</span>     }</div>
+<div class="line"><a name="l06319"></a><span class="lineno"> 6319</span> </div>
+<div class="line"><a name="l06320"></a><span class="lineno"> 6320</span>     <span class="keywordflow">if</span> (nmaskslits < 3 && nslits > nmaskslits) {</div>
+<div class="line"><a name="l06321"></a><span class="lineno"> 6321</span> </div>
+<div class="line"><a name="l06322"></a><span class="lineno"> 6322</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l06323"></a><span class="lineno"> 6323</span> <span class="comment">         * If there are less than 3 slits on the mask the ambiguity cannot</span></div>
+<div class="line"><a name="l06324"></a><span class="lineno"> 6324</span> <span class="comment">         * be solved, and an error is returned. This is a case that must</span></div>
+<div class="line"><a name="l06325"></a><span class="lineno"> 6325</span> <span class="comment">         * be solved with a first-guess relation between mask and CCD.</span></div>
+<div class="line"><a name="l06326"></a><span class="lineno"> 6326</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l06327"></a><span class="lineno"> 6327</span> </div>
+<div class="line"><a name="l06328"></a><span class="lineno"> 6328</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Cannot match the %d found CCD slits with "</span></div>
+<div class="line"><a name="l06329"></a><span class="lineno"> 6329</span>                         <span class="stringliteral">"the %d mask slits: process will continue using "</span></div>
+<div class="line"><a name="l06330"></a><span class="lineno"> 6330</span>                         <span class="stringliteral">"the detected CCD slits positions"</span>, nslits,</div>
+<div class="line"><a name="l06331"></a><span class="lineno"> 6331</span>                         nmaskslits);</div>
+<div class="line"><a name="l06332"></a><span class="lineno"> 6332</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06333"></a><span class="lineno"> 6333</span>     }</div>
+<div class="line"><a name="l06334"></a><span class="lineno"> 6334</span> </div>
+<div class="line"><a name="l06335"></a><span class="lineno"> 6335</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l06336"></a><span class="lineno"> 6336</span> <span class="comment">     * Pattern matching related operations begin here. Two pattern</span></div>
+<div class="line"><a name="l06337"></a><span class="lineno"> 6337</span> <span class="comment">     * matching will be run, one based on the "top" and another one</span></div>
+<div class="line"><a name="l06338"></a><span class="lineno"> 6338</span> <span class="comment">     * based on the "bottom" slit coordinates. The one with the</span></div>
+<div class="line"><a name="l06339"></a><span class="lineno"> 6339</span> <span class="comment">     * smallest rms in the Y coordinate will be chosen.</span></div>
+<div class="line"><a name="l06340"></a><span class="lineno"> 6340</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l06341"></a><span class="lineno"> 6341</span> </div>
+<div class="line"><a name="l06342"></a><span class="lineno"> 6342</span>     xtop  = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l06343"></a><span class="lineno"> 6343</span>     ytop  = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l06344"></a><span class="lineno"> 6344</span>     xmtop = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l06345"></a><span class="lineno"> 6345</span>     ymtop = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l06346"></a><span class="lineno"> 6346</span> </div>
+<div class="line"><a name="l06347"></a><span class="lineno"> 6347</span>     xbot  = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l06348"></a><span class="lineno"> 6348</span>     ybot  = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l06349"></a><span class="lineno"> 6349</span>     xmbot = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l06350"></a><span class="lineno"> 6350</span>     ymbot = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l06351"></a><span class="lineno"> 6351</span> </div>
+<div class="line"><a name="l06352"></a><span class="lineno"> 6352</span>     top_data    = cpl_matrix_new(2, nslits);</div>
+<div class="line"><a name="l06353"></a><span class="lineno"> 6353</span>     top_pattern = cpl_matrix_new(2, nmaskslits);</div>
+<div class="line"><a name="l06354"></a><span class="lineno"> 6354</span>     bot_data    = cpl_matrix_new(2, nslits);</div>
+<div class="line"><a name="l06355"></a><span class="lineno"> 6355</span>     bot_pattern = cpl_matrix_new(2, nmaskslits);</div>
+<div class="line"><a name="l06356"></a><span class="lineno"> 6356</span> </div>
+<div class="line"><a name="l06357"></a><span class="lineno"> 6357</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)</div>
+<div class="line"><a name="l06358"></a><span class="lineno"> 6358</span>         cpl_matrix_set(top_data, 0, i, xtop[i]);</div>
+<div class="line"><a name="l06359"></a><span class="lineno"> 6359</span> </div>
+<div class="line"><a name="l06360"></a><span class="lineno"> 6360</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)</div>
+<div class="line"><a name="l06361"></a><span class="lineno"> 6361</span>         cpl_matrix_set(top_data, 1, i, ytop[i]);</div>
+<div class="line"><a name="l06362"></a><span class="lineno"> 6362</span> </div>
+<div class="line"><a name="l06363"></a><span class="lineno"> 6363</span>     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++)</div>
+<div class="line"><a name="l06364"></a><span class="lineno"> 6364</span>         cpl_matrix_set(top_pattern, 0, i, xmtop[i]);</div>
+<div class="line"><a name="l06365"></a><span class="lineno"> 6365</span> </div>
+<div class="line"><a name="l06366"></a><span class="lineno"> 6366</span>     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++)</div>
+<div class="line"><a name="l06367"></a><span class="lineno"> 6367</span>         cpl_matrix_set(top_pattern, 1, i, ymtop[i]);</div>
+<div class="line"><a name="l06368"></a><span class="lineno"> 6368</span> </div>
+<div class="line"><a name="l06369"></a><span class="lineno"> 6369</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)</div>
+<div class="line"><a name="l06370"></a><span class="lineno"> 6370</span>         cpl_matrix_set(bot_data, 0, i, xbot[i]);</div>
+<div class="line"><a name="l06371"></a><span class="lineno"> 6371</span> </div>
+<div class="line"><a name="l06372"></a><span class="lineno"> 6372</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)</div>
+<div class="line"><a name="l06373"></a><span class="lineno"> 6373</span>         cpl_matrix_set(bot_data, 1, i, ybot[i]);</div>
+<div class="line"><a name="l06374"></a><span class="lineno"> 6374</span> </div>
+<div class="line"><a name="l06375"></a><span class="lineno"> 6375</span>     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++)</div>
+<div class="line"><a name="l06376"></a><span class="lineno"> 6376</span>         cpl_matrix_set(bot_pattern, 0, i, xmbot[i]);</div>
+<div class="line"><a name="l06377"></a><span class="lineno"> 6377</span> </div>
+<div class="line"><a name="l06378"></a><span class="lineno"> 6378</span>     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++)</div>
+<div class="line"><a name="l06379"></a><span class="lineno"> 6379</span>         cpl_matrix_set(bot_pattern, 1, i, ymbot[i]);</div>
+<div class="line"><a name="l06380"></a><span class="lineno"> 6380</span> </div>
+<div class="line"><a name="l06381"></a><span class="lineno"> 6381</span>     <span class="keywordflow">if</span> (nmaskslits > nslits)</div>
+<div class="line"><a name="l06382"></a><span class="lineno"> 6382</span>         use_pattern = nslits;</div>
+<div class="line"><a name="l06383"></a><span class="lineno"> 6383</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l06384"></a><span class="lineno"> 6384</span>         use_pattern = nmaskslits;</div>
+<div class="line"><a name="l06385"></a><span class="lineno"> 6385</span> </div>
+<div class="line"><a name="l06386"></a><span class="lineno"> 6386</span>     top_ident = cpl_ppm_match_points(top_data, nslits, 1.0, top_pattern,</div>
+<div class="line"><a name="l06387"></a><span class="lineno"> 6387</span>                                      use_pattern, 0.0, 0.1, 5, &top_mdata,</div>
+<div class="line"><a name="l06388"></a><span class="lineno"> 6388</span>                                      &top_mpattern, &top_scale, &top_angle);</div>
+<div class="line"><a name="l06389"></a><span class="lineno"> 6389</span> </div>
+<div class="line"><a name="l06390"></a><span class="lineno"> 6390</span>     bot_ident = cpl_ppm_match_points(bot_data, nslits, 1.0, bot_pattern,</div>
+<div class="line"><a name="l06391"></a><span class="lineno"> 6391</span>                                      use_pattern, 0.0, 0.1, 5, &bot_mdata,</div>
+<div class="line"><a name="l06392"></a><span class="lineno"> 6392</span>                                      &bot_mpattern, &bot_scale, &bot_angle);</div>
+<div class="line"><a name="l06393"></a><span class="lineno"> 6393</span> </div>
+<div class="line"><a name="l06394"></a><span class="lineno"> 6394</span>     <span class="keywordflow">if</span> (top_ident == NULL && bot_ident == NULL) {</div>
+<div class="line"><a name="l06395"></a><span class="lineno"> 6395</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Pattern matching failure: cannot match "</span></div>
+<div class="line"><a name="l06396"></a><span class="lineno"> 6396</span>                         <span class="stringliteral">"the %d found CCD slits with the %d mask slits: "</span></div>
+<div class="line"><a name="l06397"></a><span class="lineno"> 6397</span>                         <span class="stringliteral">"process will continue using the detected CCD "</span></div>
+<div class="line"><a name="l06398"></a><span class="lineno"> 6398</span>                         <span class="stringliteral">"slits positions"</span>, nslits, nmaskslits);</div>
+<div class="line"><a name="l06399"></a><span class="lineno"> 6399</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06400"></a><span class="lineno"> 6400</span>     }</div>
+<div class="line"><a name="l06401"></a><span class="lineno"> 6401</span> </div>
+<div class="line"><a name="l06402"></a><span class="lineno"> 6402</span>     found_slits_top = 0;</div>
+<div class="line"><a name="l06403"></a><span class="lineno"> 6403</span>     found_slits_bot = 0;</div>
+<div class="line"><a name="l06404"></a><span class="lineno"> 6404</span>     <span class="keywordflow">if</span> (top_ident && bot_ident) {</div>
+<div class="line"><a name="l06405"></a><span class="lineno"> 6405</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Median platescale: %f +/- %f pixel/mm"</span>,</div>
+<div class="line"><a name="l06406"></a><span class="lineno"> 6406</span>                      (top_scale + bot_scale) / 2, fabs(top_scale - bot_scale));</div>
+<div class="line"><a name="l06407"></a><span class="lineno"> 6407</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Median rotation: %f +/- %f degrees"</span>,</div>
+<div class="line"><a name="l06408"></a><span class="lineno"> 6408</span>                      (top_angle + bot_angle) / 2, fabs(top_angle - bot_angle));</div>
+<div class="line"><a name="l06409"></a><span class="lineno"> 6409</span>         <span class="keywordflow">if</span> (fabs(top_angle) < fabs(bot_angle))</div>
+<div class="line"><a name="l06410"></a><span class="lineno"> 6410</span>             angle = fabs(top_angle);</div>
+<div class="line"><a name="l06411"></a><span class="lineno"> 6411</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l06412"></a><span class="lineno"> 6412</span>             angle = fabs(bot_angle);</div>
+<div class="line"><a name="l06413"></a><span class="lineno"> 6413</span>         found_slits_top = cpl_matrix_get_ncol(top_mdata);</div>
+<div class="line"><a name="l06414"></a><span class="lineno"> 6414</span>         found_slits_bot = cpl_matrix_get_ncol(bot_mdata);</div>
+<div class="line"><a name="l06415"></a><span class="lineno"> 6415</span>     }</div>
+<div class="line"><a name="l06416"></a><span class="lineno"> 6416</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (top_ident) {</div>
+<div class="line"><a name="l06417"></a><span class="lineno"> 6417</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Median platescale: %f pixel/mm"</span>, top_scale);</div>
+<div class="line"><a name="l06418"></a><span class="lineno"> 6418</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Median rotation: %f degrees"</span>, top_angle);</div>
+<div class="line"><a name="l06419"></a><span class="lineno"> 6419</span>         angle = fabs(top_angle);</div>
+<div class="line"><a name="l06420"></a><span class="lineno"> 6420</span>         found_slits_top = cpl_matrix_get_ncol(top_mdata);</div>
+<div class="line"><a name="l06421"></a><span class="lineno"> 6421</span>     }</div>
+<div class="line"><a name="l06422"></a><span class="lineno"> 6422</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l06423"></a><span class="lineno"> 6423</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Median platescale: %f pixel/mm"</span>, bot_scale);</div>
+<div class="line"><a name="l06424"></a><span class="lineno"> 6424</span>         cpl_msg_info(cpl_func, <span class="stringliteral">"Median rotation: %f degrees"</span>, bot_angle);</div>
+<div class="line"><a name="l06425"></a><span class="lineno"> 6425</span>         angle = fabs(bot_angle);</div>
+<div class="line"><a name="l06426"></a><span class="lineno"> 6426</span>         found_slits_bot = cpl_matrix_get_ncol(bot_mdata);</div>
+<div class="line"><a name="l06427"></a><span class="lineno"> 6427</span>     }</div>
+<div class="line"><a name="l06428"></a><span class="lineno"> 6428</span> </div>
+<div class="line"><a name="l06429"></a><span class="lineno"> 6429</span>     cpl_array_delete(top_ident);</div>
+<div class="line"><a name="l06430"></a><span class="lineno"> 6430</span>     cpl_array_delete(bot_ident);</div>
+<div class="line"><a name="l06431"></a><span class="lineno"> 6431</span> </div>
+<div class="line"><a name="l06432"></a><span class="lineno"> 6432</span>     <span class="keywordflow">if</span> (angle > 4.0) {</div>
+<div class="line"><a name="l06433"></a><span class="lineno"> 6433</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Uncertain pattern matching: the rotation "</span></div>
+<div class="line"><a name="l06434"></a><span class="lineno"> 6434</span>                         <span class="stringliteral">"angle is expected to be around zero. This match is "</span></div>
+<div class="line"><a name="l06435"></a><span class="lineno"> 6435</span>                         <span class="stringliteral">"rejected: the process will continue using the %d "</span></div>
+<div class="line"><a name="l06436"></a><span class="lineno"> 6436</span>                         <span class="stringliteral">"detected CCD slits positions"</span>, nslits);</div>
+<div class="line"><a name="l06437"></a><span class="lineno"> 6437</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06438"></a><span class="lineno"> 6438</span>     }</div>
+<div class="line"><a name="l06439"></a><span class="lineno"> 6439</span> </div>
+<div class="line"><a name="l06440"></a><span class="lineno"> 6440</span>     found_slits = found_slits_top;</div>
+<div class="line"><a name="l06441"></a><span class="lineno"> 6441</span>     <span class="keywordflow">if</span> (found_slits < found_slits_bot)</div>
+<div class="line"><a name="l06442"></a><span class="lineno"> 6442</span>         found_slits = found_slits_bot;     <span class="comment">/* Max value */</span></div>
+<div class="line"><a name="l06443"></a><span class="lineno"> 6443</span> </div>
+<div class="line"><a name="l06444"></a><span class="lineno"> 6444</span>     <span class="keywordflow">if</span> (found_slits < 4) {</div>
+<div class="line"><a name="l06445"></a><span class="lineno"> 6445</span>         cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l06446"></a><span class="lineno"> 6446</span>                         <span class="stringliteral">"Too few safely identified slits: %d out of %d "</span></div>
+<div class="line"><a name="l06447"></a><span class="lineno"> 6447</span>                         <span class="stringliteral">"candidates (%d expected). Process will continue "</span></div>
+<div class="line"><a name="l06448"></a><span class="lineno"> 6448</span>                         <span class="stringliteral">"using the detected CCD slits positions"</span>, found_slits,</div>
+<div class="line"><a name="l06449"></a><span class="lineno"> 6449</span>                         nslits, nmaskslits);</div>
+<div class="line"><a name="l06450"></a><span class="lineno"> 6450</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06451"></a><span class="lineno"> 6451</span>     }</div>
+<div class="line"><a name="l06452"></a><span class="lineno"> 6452</span> </div>
+<div class="line"><a name="l06453"></a><span class="lineno"> 6453</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Preliminary identified slits: %d out of %d "</span></div>
+<div class="line"><a name="l06454"></a><span class="lineno"> 6454</span>                  <span class="stringliteral">"candidates\n(%d expected)"</span>, found_slits, nslits,</div>
+<div class="line"><a name="l06455"></a><span class="lineno"> 6455</span>                  nmaskslits);</div>
+<div class="line"><a name="l06456"></a><span class="lineno"> 6456</span> </div>
+<div class="line"><a name="l06457"></a><span class="lineno"> 6457</span>     <span class="keywordflow">if</span> (found_slits_top < 4)</div>
+<div class="line"><a name="l06458"></a><span class="lineno"> 6458</span>         found_slits_top = 0;</div>
+<div class="line"><a name="l06459"></a><span class="lineno"> 6459</span> </div>
+<div class="line"><a name="l06460"></a><span class="lineno"> 6460</span>     <span class="keywordflow">if</span> (found_slits_bot < 4)</div>
+<div class="line"><a name="l06461"></a><span class="lineno"> 6461</span>         found_slits_bot = 0;</div>
+<div class="line"><a name="l06462"></a><span class="lineno"> 6462</span> </div>
+<div class="line"><a name="l06463"></a><span class="lineno"> 6463</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l06464"></a><span class="lineno"> 6464</span> <span class="comment">     * Now for each set select the points of the identified slits, and fit</span></div>
+<div class="line"><a name="l06465"></a><span class="lineno"> 6465</span> <span class="comment">     * two bivariate polynomials to determine a first approximate relation</span></div>
+<div class="line"><a name="l06466"></a><span class="lineno"> 6466</span> <span class="comment">     * between positions on the mask and positions on the CCD.</span></div>
+<div class="line"><a name="l06467"></a><span class="lineno"> 6467</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l06468"></a><span class="lineno"> 6468</span> </div>
+<div class="line"><a name="l06469"></a><span class="lineno"> 6469</span>     <span class="keywordflow">for</span> (i = 0; i < 2; i++) {</div>
+<div class="line"><a name="l06470"></a><span class="lineno"> 6470</span>         cpl_size    mindeg2d[] = {0, 0};</div>
+<div class="line"><a name="l06471"></a><span class="lineno"> 6471</span>         cpl_size    maxdeg2d[2];</div>
+<div class="line"><a name="l06472"></a><span class="lineno"> 6472</span>         cpl_vector  * fitresidual;</div>
+<div class="line"><a name="l06473"></a><span class="lineno"> 6473</span>         <span class="keywordflow">if</span> (i) {</div>
+<div class="line"><a name="l06474"></a><span class="lineno"> 6474</span>             found_slits = found_slits_top;</div>
+<div class="line"><a name="l06475"></a><span class="lineno"> 6475</span>             mdata = top_mdata;</div>
+<div class="line"><a name="l06476"></a><span class="lineno"> 6476</span>             mpattern = top_mpattern;</div>
+<div class="line"><a name="l06477"></a><span class="lineno"> 6477</span>         }</div>
+<div class="line"><a name="l06478"></a><span class="lineno"> 6478</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l06479"></a><span class="lineno"> 6479</span>             found_slits = found_slits_bot;</div>
+<div class="line"><a name="l06480"></a><span class="lineno"> 6480</span>             mdata = bot_mdata;</div>
+<div class="line"><a name="l06481"></a><span class="lineno"> 6481</span>             mpattern = bot_mpattern;</div>
+<div class="line"><a name="l06482"></a><span class="lineno"> 6482</span>         }</div>
+<div class="line"><a name="l06483"></a><span class="lineno"> 6483</span> </div>
+<div class="line"><a name="l06484"></a><span class="lineno"> 6484</span>         <span class="keywordflow">if</span> (found_slits == 0)</div>
+<div class="line"><a name="l06485"></a><span class="lineno"> 6485</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l06486"></a><span class="lineno"> 6486</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (found_slits < 10)</div>
+<div class="line"><a name="l06487"></a><span class="lineno"> 6487</span>             maxdeg2d[0] = maxdeg2d[1] = 1;</div>
+<div class="line"><a name="l06488"></a><span class="lineno"> 6488</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l06489"></a><span class="lineno"> 6489</span>             maxdeg2d[0] = maxdeg2d[1] = 2;</div>
+<div class="line"><a name="l06490"></a><span class="lineno"> 6490</span> </div>
+<div class="line"><a name="l06491"></a><span class="lineno"> 6491</span>         xpos  = cpl_vector_wrap(found_slits,</div>
+<div class="line"><a name="l06492"></a><span class="lineno"> 6492</span>                                 cpl_matrix_get_data(mdata)              );</div>
+<div class="line"><a name="l06493"></a><span class="lineno"> 6493</span>         ypos  = cpl_vector_wrap(found_slits,</div>
+<div class="line"><a name="l06494"></a><span class="lineno"> 6494</span>                                 cpl_matrix_get_data(mdata) + found_slits);</div>
+<div class="line"><a name="l06495"></a><span class="lineno"> 6495</span>         xmpos = cpl_vector_wrap(found_slits,</div>
+<div class="line"><a name="l06496"></a><span class="lineno"> 6496</span>                                 cpl_matrix_get_data(mpattern)              );</div>
+<div class="line"><a name="l06497"></a><span class="lineno"> 6497</span>         ympos = cpl_vector_wrap(found_slits,</div>
+<div class="line"><a name="l06498"></a><span class="lineno"> 6498</span>                                 cpl_matrix_get_data(mpattern) + found_slits);</div>
+<div class="line"><a name="l06499"></a><span class="lineno"> 6499</span>         mpos  = cpl_bivector_wrap_vectors(xmpos, ympos);</div>
+<div class="line"><a name="l06500"></a><span class="lineno"> 6500</span>         fitresidual = cpl_vector_new(cpl_vector_get_size(xpos));</div>
+<div class="line"><a name="l06501"></a><span class="lineno"> 6501</span>         xpoly = cpl_polynomial_new(2);</div>
+<div class="line"><a name="l06502"></a><span class="lineno"> 6502</span>         cpl_polynomial_fit(xpoly, mpattern, NULL, xpos, NULL, CPL_FALSE, mindeg2d, maxdeg2d);</div>
+<div class="line"><a name="l06503"></a><span class="lineno"> 6503</span>         cpl_vector_fill_polynomial_fit_residual(fitresidual, xpos, NULL, xpoly, mpattern, NULL);</div>
+<div class="line"><a name="l06504"></a><span class="lineno"> 6504</span>         xmse = cpl_vector_product(fitresidual, fitresidual)</div>
+<div class="line"><a name="l06505"></a><span class="lineno"> 6505</span>                          / cpl_vector_get_size(fitresidual);</div>
+<div class="line"><a name="l06506"></a><span class="lineno"> 6506</span>         ypoly = cpl_polynomial_new(2);</div>
+<div class="line"><a name="l06507"></a><span class="lineno"> 6507</span>         cpl_polynomial_fit(ypoly, mpattern, NULL, ypos, NULL, CPL_FALSE, mindeg2d, maxdeg2d);</div>
+<div class="line"><a name="l06508"></a><span class="lineno"> 6508</span>         cpl_vector_fill_polynomial_fit_residual(fitresidual, ypos, NULL, ypoly, mpattern, NULL);</div>
+<div class="line"><a name="l06509"></a><span class="lineno"> 6509</span>         ymse = cpl_vector_product(fitresidual, fitresidual)</div>
+<div class="line"><a name="l06510"></a><span class="lineno"> 6510</span>                          / cpl_vector_get_size(fitresidual);</div>
+<div class="line"><a name="l06511"></a><span class="lineno"> 6511</span> </div>
+<div class="line"><a name="l06512"></a><span class="lineno"> 6512</span>         cpl_bivector_unwrap_vectors(mpos);</div>
+<div class="line"><a name="l06513"></a><span class="lineno"> 6513</span>         cpl_vector_unwrap(xpos);</div>
+<div class="line"><a name="l06514"></a><span class="lineno"> 6514</span>         cpl_vector_unwrap(ypos);</div>
+<div class="line"><a name="l06515"></a><span class="lineno"> 6515</span>         cpl_vector_unwrap(xmpos);</div>
+<div class="line"><a name="l06516"></a><span class="lineno"> 6516</span>         cpl_vector_unwrap(ympos);</div>
+<div class="line"><a name="l06517"></a><span class="lineno"> 6517</span>         cpl_matrix_delete(mdata);</div>
+<div class="line"><a name="l06518"></a><span class="lineno"> 6518</span>         cpl_matrix_delete(mpattern);</div>
+<div class="line"><a name="l06519"></a><span class="lineno"> 6519</span>         cpl_vector_delete(fitresidual);</div>
+<div class="line"><a name="l06520"></a><span class="lineno"> 6520</span> </div>
+<div class="line"><a name="l06521"></a><span class="lineno"> 6521</span>         <span class="keywordflow">if</span> (i) {</div>
+<div class="line"><a name="l06522"></a><span class="lineno"> 6522</span>             top_xpoly = xpoly;</div>
+<div class="line"><a name="l06523"></a><span class="lineno"> 6523</span>             top_ypoly = ypoly;</div>
+<div class="line"><a name="l06524"></a><span class="lineno"> 6524</span>             top_xrms = sqrt(xmse*2*degree/(found_slits - 1));</div>
+<div class="line"><a name="l06525"></a><span class="lineno"> 6525</span>             top_yrms = sqrt(ymse*2*degree/(found_slits - 1));</div>
+<div class="line"><a name="l06526"></a><span class="lineno"> 6526</span>         }</div>
+<div class="line"><a name="l06527"></a><span class="lineno"> 6527</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l06528"></a><span class="lineno"> 6528</span>             bot_xpoly = xpoly;</div>
+<div class="line"><a name="l06529"></a><span class="lineno"> 6529</span>             bot_ypoly = ypoly;</div>
+<div class="line"><a name="l06530"></a><span class="lineno"> 6530</span>             bot_xrms = sqrt(xmse*2*degree/(found_slits - 1));</div>
+<div class="line"><a name="l06531"></a><span class="lineno"> 6531</span>             bot_yrms = sqrt(ymse*2*degree/(found_slits - 1));</div>
+<div class="line"><a name="l06532"></a><span class="lineno"> 6532</span>         }</div>
+<div class="line"><a name="l06533"></a><span class="lineno"> 6533</span>     }</div>
+<div class="line"><a name="l06534"></a><span class="lineno"> 6534</span> </div>
+<div class="line"><a name="l06535"></a><span class="lineno"> 6535</span>     <span class="keywordflow">if</span> (top_xpoly && bot_xpoly) {</div>
+<div class="line"><a name="l06536"></a><span class="lineno"> 6536</span>         <span class="keywordflow">if</span> (top_xrms < bot_xrms) {  <span class="comment">/* top X solution wins... */</span></div>
+<div class="line"><a name="l06537"></a><span class="lineno"> 6537</span>             xrms = top_xrms;</div>
+<div class="line"><a name="l06538"></a><span class="lineno"> 6538</span>             xpoly = top_xpoly;</div>
+<div class="line"><a name="l06539"></a><span class="lineno"> 6539</span>             cpl_polynomial_delete(bot_xpoly);</div>
+<div class="line"><a name="l06540"></a><span class="lineno"> 6540</span>         }</div>
+<div class="line"><a name="l06541"></a><span class="lineno"> 6541</span>         <span class="keywordflow">else</span> {                      <span class="comment">/* bottom X solution wins... */</span></div>
+<div class="line"><a name="l06542"></a><span class="lineno"> 6542</span>             xrms = bot_xrms;</div>
+<div class="line"><a name="l06543"></a><span class="lineno"> 6543</span>             xpoly = bot_xpoly;</div>
+<div class="line"><a name="l06544"></a><span class="lineno"> 6544</span>             cpl_polynomial_delete(top_xpoly);</div>
+<div class="line"><a name="l06545"></a><span class="lineno"> 6545</span>         }</div>
+<div class="line"><a name="l06546"></a><span class="lineno"> 6546</span>     }</div>
+<div class="line"><a name="l06547"></a><span class="lineno"> 6547</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (top_xpoly) {</div>
+<div class="line"><a name="l06548"></a><span class="lineno"> 6548</span>         xrms = top_xrms;</div>
+<div class="line"><a name="l06549"></a><span class="lineno"> 6549</span>         xpoly = top_xpoly;</div>
+<div class="line"><a name="l06550"></a><span class="lineno"> 6550</span>     }</div>
+<div class="line"><a name="l06551"></a><span class="lineno"> 6551</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l06552"></a><span class="lineno"> 6552</span>         xrms = bot_xrms;</div>
+<div class="line"><a name="l06553"></a><span class="lineno"> 6553</span>         xpoly = bot_xpoly;</div>
+<div class="line"><a name="l06554"></a><span class="lineno"> 6554</span>     }</div>
+<div class="line"><a name="l06555"></a><span class="lineno"> 6555</span> </div>
+<div class="line"><a name="l06556"></a><span class="lineno"> 6556</span>     <span class="keywordflow">if</span> (top_ypoly && bot_ypoly) {</div>
+<div class="line"><a name="l06557"></a><span class="lineno"> 6557</span>         <span class="keywordflow">if</span> (top_yrms < bot_yrms) {  <span class="comment">/* top Y solution wins... */</span></div>
+<div class="line"><a name="l06558"></a><span class="lineno"> 6558</span>             yrms = top_yrms;</div>
+<div class="line"><a name="l06559"></a><span class="lineno"> 6559</span>             ypoly = top_ypoly;</div>
+<div class="line"><a name="l06560"></a><span class="lineno"> 6560</span>             cpl_polynomial_delete(bot_ypoly);</div>
+<div class="line"><a name="l06561"></a><span class="lineno"> 6561</span>         }</div>
+<div class="line"><a name="l06562"></a><span class="lineno"> 6562</span>         <span class="keywordflow">else</span> {                      <span class="comment">/* bottom Y solution wins... */</span></div>
+<div class="line"><a name="l06563"></a><span class="lineno"> 6563</span>             yrms = bot_yrms;</div>
+<div class="line"><a name="l06564"></a><span class="lineno"> 6564</span>             ypoly = bot_ypoly;</div>
+<div class="line"><a name="l06565"></a><span class="lineno"> 6565</span>             cpl_polynomial_delete(top_ypoly);</div>
+<div class="line"><a name="l06566"></a><span class="lineno"> 6566</span>         }</div>
+<div class="line"><a name="l06567"></a><span class="lineno"> 6567</span>     }</div>
+<div class="line"><a name="l06568"></a><span class="lineno"> 6568</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (top_ypoly) {</div>
+<div class="line"><a name="l06569"></a><span class="lineno"> 6569</span>         yrms = top_yrms;</div>
+<div class="line"><a name="l06570"></a><span class="lineno"> 6570</span>         ypoly = top_ypoly;</div>
+<div class="line"><a name="l06571"></a><span class="lineno"> 6571</span>     }</div>
+<div class="line"><a name="l06572"></a><span class="lineno"> 6572</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l06573"></a><span class="lineno"> 6573</span>         yrms = bot_yrms;</div>
+<div class="line"><a name="l06574"></a><span class="lineno"> 6574</span>         ypoly = bot_ypoly;</div>
+<div class="line"><a name="l06575"></a><span class="lineno"> 6575</span>     }</div>
+<div class="line"><a name="l06576"></a><span class="lineno"> 6576</span> </div>
+<div class="line"><a name="l06577"></a><span class="lineno"> 6577</span>     <span class="keywordflow">if</span> (xpoly == NULL || ypoly == NULL) {</div>
+<div class="line"><a name="l06578"></a><span class="lineno"> 6578</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Fit failure: the accuracy of the "</span></div>
+<div class="line"><a name="l06579"></a><span class="lineno"> 6579</span>                         <span class="stringliteral">"identified slits positions cannot be improved."</span>);</div>
+<div class="line"><a name="l06580"></a><span class="lineno"> 6580</span>         cpl_polynomial_delete(xpoly);</div>
+<div class="line"><a name="l06581"></a><span class="lineno"> 6581</span>         cpl_polynomial_delete(ypoly);</div>
+<div class="line"><a name="l06582"></a><span class="lineno"> 6582</span>         cpl_error_reset();</div>
+<div class="line"><a name="l06583"></a><span class="lineno"> 6583</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06584"></a><span class="lineno"> 6584</span>     }</div>
+<div class="line"><a name="l06585"></a><span class="lineno"> 6585</span> </div>
+<div class="line"><a name="l06586"></a><span class="lineno"> 6586</span>     cpl_msg_info(cpl_func,</div>
+<div class="line"><a name="l06587"></a><span class="lineno"> 6587</span>                  <span class="stringliteral">"Fit successful: X rms = %.3g, Y rms = %.3g (pixel)"</span>,</div>
+<div class="line"><a name="l06588"></a><span class="lineno"> 6588</span>                  xrms, yrms);</div>
+<div class="line"><a name="l06589"></a><span class="lineno"> 6589</span> </div>
+<div class="line"><a name="l06590"></a><span class="lineno"> 6590</span>     <span class="keywordflow">if</span> (global) {</div>
+<div class="line"><a name="l06591"></a><span class="lineno"> 6591</span>         write_global_distortion(global, 0, xpoly);</div>
+<div class="line"><a name="l06592"></a><span class="lineno"> 6592</span>         write_global_distortion(global, 7, ypoly);</div>
+<div class="line"><a name="l06593"></a><span class="lineno"> 6593</span>     }</div>
+<div class="line"><a name="l06594"></a><span class="lineno"> 6594</span> </div>
+<div class="line"><a name="l06595"></a><span class="lineno"> 6595</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l06596"></a><span class="lineno"> 6596</span> <span class="comment">     * The fit was successful: use the polynomials to obtain a new</span></div>
+<div class="line"><a name="l06597"></a><span class="lineno"> 6597</span> <span class="comment">     * position table with the improved positions of the slits</span></div>
+<div class="line"><a name="l06598"></a><span class="lineno"> 6598</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l06599"></a><span class="lineno"> 6599</span> </div>
+<div class="line"><a name="l06600"></a><span class="lineno"> 6600</span>     positions = cpl_table_duplicate(maskslits);</div>
+<div class="line"><a name="l06601"></a><span class="lineno"> 6601</span>     cpl_table_duplicate_column(positions, <span class="stringliteral">"xmtop"</span>, positions, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l06602"></a><span class="lineno"> 6602</span>     cpl_table_duplicate_column(positions, <span class="stringliteral">"ymtop"</span>, positions, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l06603"></a><span class="lineno"> 6603</span>     cpl_table_duplicate_column(positions, <span class="stringliteral">"xmbottom"</span>, positions, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l06604"></a><span class="lineno"> 6604</span>     cpl_table_duplicate_column(positions, <span class="stringliteral">"ymbottom"</span>, positions, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l06605"></a><span class="lineno"> 6605</span> </div>
+<div class="line"><a name="l06606"></a><span class="lineno"> 6606</span>     point = cpl_vector_new(2);</div>
+<div class="line"><a name="l06607"></a><span class="lineno"> 6607</span>     dpoint = cpl_vector_get_data(point);</div>
+<div class="line"><a name="l06608"></a><span class="lineno"> 6608</span> </div>
+<div class="line"><a name="l06609"></a><span class="lineno"> 6609</span>     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++) {</div>
+<div class="line"><a name="l06610"></a><span class="lineno"> 6610</span>         <span class="keywordtype">double</span> position_x;</div>
+<div class="line"><a name="l06611"></a><span class="lineno"> 6611</span>         <span class="keywordtype">double</span> position_y;</div>
+<div class="line"><a name="l06612"></a><span class="lineno"> 6612</span> </div>
+<div class="line"><a name="l06613"></a><span class="lineno"> 6613</span>         dpoint[0] = cpl_table_get_double(positions, <span class="stringliteral">"xmtop"</span>, i, NULL);</div>
+<div class="line"><a name="l06614"></a><span class="lineno"> 6614</span>         dpoint[1] = cpl_table_get_double(positions, <span class="stringliteral">"ymtop"</span>, i, NULL);</div>
+<div class="line"><a name="l06615"></a><span class="lineno"> 6615</span>         position_x  = cpl_polynomial_eval(xpoly, point);</div>
+<div class="line"><a name="l06616"></a><span class="lineno"> 6616</span> <span class="comment">//        if (mos_multiplex >= 0) {</span></div>
+<div class="line"><a name="l06617"></a><span class="lineno"> 6617</span> <span class="comment">//            if (mos_multiplex != ((int)floor(position)) / mos_region_size) {</span></div>
+<div class="line"><a name="l06618"></a><span class="lineno"> 6618</span> <span class="comment">//                cpl_table_unselect_row(positions, i);</span></div>
+<div class="line"><a name="l06619"></a><span class="lineno"> 6619</span> <span class="comment">//                continue;</span></div>
+<div class="line"><a name="l06620"></a><span class="lineno"> 6620</span> <span class="comment">//            }</span></div>
+<div class="line"><a name="l06621"></a><span class="lineno"> 6621</span> <span class="comment">//        }</span></div>
+<div class="line"><a name="l06622"></a><span class="lineno"> 6622</span>         cpl_table_set_double(positions, <span class="stringliteral">"xtop"</span>, i, position_x);</div>
+<div class="line"><a name="l06623"></a><span class="lineno"> 6623</span>         position_y  = cpl_polynomial_eval(ypoly, point);</div>
+<div class="line"><a name="l06624"></a><span class="lineno"> 6624</span>         cpl_table_set_double(positions, <span class="stringliteral">"ytop"</span>, i, position_y);</div>
+<div class="line"><a name="l06625"></a><span class="lineno"> 6625</span>         dpoint[0] = cpl_table_get_double(positions, <span class="stringliteral">"xmbottom"</span>, i, NULL);</div>
+<div class="line"><a name="l06626"></a><span class="lineno"> 6626</span>         dpoint[1] = cpl_table_get_double(positions, <span class="stringliteral">"ymbottom"</span>, i, NULL);</div>
+<div class="line"><a name="l06627"></a><span class="lineno"> 6627</span>         position_x  = cpl_polynomial_eval(xpoly, point);</div>
+<div class="line"><a name="l06628"></a><span class="lineno"> 6628</span>         cpl_table_set_double(positions, <span class="stringliteral">"xbottom"</span>, i, position_x);</div>
+<div class="line"><a name="l06629"></a><span class="lineno"> 6629</span>         position_y  = cpl_polynomial_eval(ypoly, point);</div>
+<div class="line"><a name="l06630"></a><span class="lineno"> 6630</span>         cpl_table_set_double(positions, <span class="stringliteral">"ybottom"</span>, i, position_y);</div>
+<div class="line"><a name="l06631"></a><span class="lineno"> 6631</span>     }</div>
+<div class="line"><a name="l06632"></a><span class="lineno"> 6632</span> </div>
+<div class="line"><a name="l06633"></a><span class="lineno"> 6633</span> <span class="comment">//    if (mos_multiplex >= 0) {</span></div>
+<div class="line"><a name="l06634"></a><span class="lineno"> 6634</span> <span class="comment">//        cpl_table_not_selected(positions);</span></div>
+<div class="line"><a name="l06635"></a><span class="lineno"> 6635</span> <span class="comment">//        cpl_table_erase_selected(positions);</span></div>
+<div class="line"><a name="l06636"></a><span class="lineno"> 6636</span> <span class="comment">//        nmaskslits = cpl_table_get_nrow(positions);</span></div>
+<div class="line"><a name="l06637"></a><span class="lineno"> 6637</span> <span class="comment">//    }</span></div>
+<div class="line"><a name="l06638"></a><span class="lineno"> 6638</span> </div>
+<div class="line"><a name="l06639"></a><span class="lineno"> 6639</span>     cpl_vector_delete(point);</div>
+<div class="line"><a name="l06640"></a><span class="lineno"> 6640</span>     cpl_polynomial_delete(xpoly);</div>
+<div class="line"><a name="l06641"></a><span class="lineno"> 6641</span>     cpl_polynomial_delete(ypoly);</div>
+<div class="line"><a name="l06642"></a><span class="lineno"> 6642</span> </div>
+<div class="line"><a name="l06643"></a><span class="lineno"> 6643</span>     cpl_table_erase_column(positions, <span class="stringliteral">"xmtop"</span>);</div>
+<div class="line"><a name="l06644"></a><span class="lineno"> 6644</span>     cpl_table_erase_column(positions, <span class="stringliteral">"ymtop"</span>);</div>
+<div class="line"><a name="l06645"></a><span class="lineno"> 6645</span>     cpl_table_erase_column(positions, <span class="stringliteral">"xmbottom"</span>);</div>
+<div class="line"><a name="l06646"></a><span class="lineno"> 6646</span>     cpl_table_erase_column(positions, <span class="stringliteral">"ymbottom"</span>);</div>
+<div class="line"><a name="l06647"></a><span class="lineno"> 6647</span> </div>
+<div class="line"><a name="l06648"></a><span class="lineno"> 6648</span>     <span class="keywordflow">if</span> (mos_multiplex >= 0) {</div>
+<div class="line"><a name="l06649"></a><span class="lineno"> 6649</span>         msg_multiplex = </div>
+<div class="line"><a name="l06650"></a><span class="lineno"> 6650</span>         cpl_sprintf(<span class="stringliteral">"in the CCD section between %d and %d pixel"</span>, </div>
+<div class="line"><a name="l06651"></a><span class="lineno"> 6651</span>                     mos_multiplex * mos_region_size, </div>
+<div class="line"><a name="l06652"></a><span class="lineno"> 6652</span>                     (mos_multiplex + 1) * mos_region_size);</div>
+<div class="line"><a name="l06653"></a><span class="lineno"> 6653</span>     }</div>
+<div class="line"><a name="l06654"></a><span class="lineno"> 6654</span> </div>
+<div class="line"><a name="l06655"></a><span class="lineno"> 6655</span>     <span class="keywordflow">if</span> (nmaskslits > nslits)</div>
+<div class="line"><a name="l06656"></a><span class="lineno"> 6656</span>         cpl_msg_info(cpl_func,</div>
+<div class="line"><a name="l06657"></a><span class="lineno"> 6657</span>                      <span class="stringliteral">"Finally identified slits: %d out of %d expected %s\n"</span></div>
+<div class="line"><a name="l06658"></a><span class="lineno"> 6658</span>                      <span class="stringliteral">"(%d recovered)"</span>, nmaskslits, nmaskslits, msg_multiplex,</div>
+<div class="line"><a name="l06659"></a><span class="lineno"> 6659</span>                      nmaskslits - nslits);</div>
+<div class="line"><a name="l06660"></a><span class="lineno"> 6660</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nmaskslits < nslits)</div>
+<div class="line"><a name="l06661"></a><span class="lineno"> 6661</span>         cpl_msg_info(cpl_func,</div>
+<div class="line"><a name="l06662"></a><span class="lineno"> 6662</span>                      <span class="stringliteral">"Finally identified slits: %d out of %d expected %s\n"</span></div>
+<div class="line"><a name="l06663"></a><span class="lineno"> 6663</span>                      <span class="stringliteral">"(%d rejected)"</span>, nmaskslits, nmaskslits, msg_multiplex,</div>
+<div class="line"><a name="l06664"></a><span class="lineno"> 6664</span>                      nslits - nmaskslits);</div>
+<div class="line"><a name="l06665"></a><span class="lineno"> 6665</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l06666"></a><span class="lineno"> 6666</span>         cpl_msg_info(cpl_func,</div>
+<div class="line"><a name="l06667"></a><span class="lineno"> 6667</span>                      <span class="stringliteral">"Finally identified slits: %d out of %d expected %s"</span>,</div>
+<div class="line"><a name="l06668"></a><span class="lineno"> 6668</span>                      nmaskslits, nmaskslits, msg_multiplex);</div>
+<div class="line"><a name="l06669"></a><span class="lineno"> 6669</span> </div>
+<div class="line"><a name="l06670"></a><span class="lineno"> 6670</span>     <span class="keywordflow">if</span> (mos_multiplex >= 0) {</div>
+<div class="line"><a name="l06671"></a><span class="lineno"> 6671</span>         cpl_free(msg_multiplex);</div>
+<div class="line"><a name="l06672"></a><span class="lineno"> 6672</span>     }</div>
+<div class="line"><a name="l06673"></a><span class="lineno"> 6673</span> </div>
+<div class="line"><a name="l06674"></a><span class="lineno"> 6674</span>     <span class="keywordflow">return</span> positions;</div>
+<div class="line"><a name="l06675"></a><span class="lineno"> 6675</span> </div>
+<div class="line"><a name="l06676"></a><span class="lineno"> 6676</span> }</div>
+<div class="line"><a name="l06677"></a><span class="lineno"> 6677</span> </div>
+<div class="line"><a name="l06678"></a><span class="lineno"> 6678</span> </div>
+<div class="line"><a name="l06679"></a><span class="lineno"> 6679</span> cpl_table *mos_identify_slits_fast(cpl_table *slits, cpl_table *maskslits,</div>
+<div class="line"><a name="l06680"></a><span class="lineno"> 6680</span>                                    cpl_table *global)</div>
+<div class="line"><a name="l06681"></a><span class="lineno"> 6681</span> {</div>
+<div class="line"><a name="l06682"></a><span class="lineno"> 6682</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_identify_slits_fast"</span>;</div>
+<div class="line"><a name="l06683"></a><span class="lineno"> 6683</span> </div>
+<div class="line"><a name="l06684"></a><span class="lineno"> 6684</span>     cpl_propertylist *sort_col;</div>
+<div class="line"><a name="l06685"></a><span class="lineno"> 6685</span>     cpl_table        *positions;</div>
+<div class="line"><a name="l06686"></a><span class="lineno"> 6686</span>     cpl_vector       *scales;</div>
+<div class="line"><a name="l06687"></a><span class="lineno"> 6687</span>     cpl_vector       *angles;</div>
+<div class="line"><a name="l06688"></a><span class="lineno"> 6688</span>     cpl_vector       *point;</div>
+<div class="line"><a name="l06689"></a><span class="lineno"> 6689</span>     cpl_vector       *xpos;</div>
+<div class="line"><a name="l06690"></a><span class="lineno"> 6690</span>     cpl_vector       *ypos;</div>
+<div class="line"><a name="l06691"></a><span class="lineno"> 6691</span>     cpl_vector       *xmpos;</div>
+<div class="line"><a name="l06692"></a><span class="lineno"> 6692</span>     cpl_vector       *ympos;</div>
+<div class="line"><a name="l06693"></a><span class="lineno"> 6693</span>     cpl_bivector     *mpos;</div>
+<div class="line"><a name="l06694"></a><span class="lineno"> 6694</span>     cpl_polynomial   *xpoly = NULL;</div>
+<div class="line"><a name="l06695"></a><span class="lineno"> 6695</span>     cpl_polynomial   *ypoly = NULL;</div>
+<div class="line"><a name="l06696"></a><span class="lineno"> 6696</span>     cpl_error_code    error;</div>
+<div class="line"><a name="l06697"></a><span class="lineno"> 6697</span>     <span class="keywordtype">int</span> nslits;</div>
+<div class="line"><a name="l06698"></a><span class="lineno"> 6698</span>     <span class="keywordtype">int</span> nmaskslits;</div>
+<div class="line"><a name="l06699"></a><span class="lineno"> 6699</span>     <span class="keywordtype">int</span> found_slits;</div>
+<div class="line"><a name="l06700"></a><span class="lineno"> 6700</span>     <span class="keywordtype">int</span> i, j, k;</div>
+<div class="line"><a name="l06701"></a><span class="lineno"> 6701</span> </div>
+<div class="line"><a name="l06702"></a><span class="lineno"> 6702</span>     <span class="keywordtype">double</span>  dist1, dist2, dist3, dist, mindist;</div>
+<div class="line"><a name="l06703"></a><span class="lineno"> 6703</span>     <span class="keywordtype">double</span>  scale, minscale, maxscale;</div>
+<div class="line"><a name="l06704"></a><span class="lineno"> 6704</span>     <span class="keywordtype">double</span>  angle, minangle, maxangle;</div>
+<div class="line"><a name="l06705"></a><span class="lineno"> 6705</span>     <span class="keywordtype">double</span> *dscale;</div>
+<div class="line"><a name="l06706"></a><span class="lineno"> 6706</span>     <span class="keywordtype">double</span> *dangle;</div>
+<div class="line"><a name="l06707"></a><span class="lineno"> 6707</span>     <span class="keywordtype">double</span> *dpoint;</div>
+<div class="line"><a name="l06708"></a><span class="lineno"> 6708</span>     <span class="keywordtype">double</span> *xtop;</div>
+<div class="line"><a name="l06709"></a><span class="lineno"> 6709</span>     <span class="keywordtype">double</span> *ytop;</div>
+<div class="line"><a name="l06710"></a><span class="lineno"> 6710</span>     <span class="keywordtype">double</span> *xbottom;</div>
+<div class="line"><a name="l06711"></a><span class="lineno"> 6711</span>     <span class="keywordtype">double</span> *ybottom;</div>
+<div class="line"><a name="l06712"></a><span class="lineno"> 6712</span>     <span class="keywordtype">double</span> *xcenter;</div>
+<div class="line"><a name="l06713"></a><span class="lineno"> 6713</span>     <span class="keywordtype">double</span> *ycenter;</div>
+<div class="line"><a name="l06714"></a><span class="lineno"> 6714</span>     <span class="keywordtype">double</span> *xpseudo;</div>
+<div class="line"><a name="l06715"></a><span class="lineno"> 6715</span>     <span class="keywordtype">double</span> *ypseudo;</div>
+<div class="line"><a name="l06716"></a><span class="lineno"> 6716</span>     <span class="keywordtype">int</span>    *slit_id;</div>
+<div class="line"><a name="l06717"></a><span class="lineno"> 6717</span>     <span class="keywordtype">double</span> *xmtop;</div>
+<div class="line"><a name="l06718"></a><span class="lineno"> 6718</span>     <span class="keywordtype">double</span> *ymtop;</div>
+<div class="line"><a name="l06719"></a><span class="lineno"> 6719</span>     <span class="keywordtype">double</span> *xmbottom;</div>
+<div class="line"><a name="l06720"></a><span class="lineno"> 6720</span>     <span class="keywordtype">double</span> *ymbottom;</div>
+<div class="line"><a name="l06721"></a><span class="lineno"> 6721</span>     <span class="keywordtype">double</span> *xmcenter;</div>
+<div class="line"><a name="l06722"></a><span class="lineno"> 6722</span>     <span class="keywordtype">double</span> *ymcenter;</div>
+<div class="line"><a name="l06723"></a><span class="lineno"> 6723</span>     <span class="keywordtype">double</span> *xmpseudo;</div>
+<div class="line"><a name="l06724"></a><span class="lineno"> 6724</span>     <span class="keywordtype">double</span> *ympseudo;</div>
+<div class="line"><a name="l06725"></a><span class="lineno"> 6725</span>     <span class="keywordtype">double</span>  xmse, ymse;</div>
+<div class="line"><a name="l06726"></a><span class="lineno"> 6726</span>     <span class="keywordtype">int</span>    *mslit_id;</div>
+<div class="line"><a name="l06727"></a><span class="lineno"> 6727</span>     <span class="keywordtype">int</span>    *good;</div>
+<div class="line"><a name="l06728"></a><span class="lineno"> 6728</span>     <span class="keywordtype">int</span>     minpos;</div>
+<div class="line"><a name="l06729"></a><span class="lineno"> 6729</span>     <span class="keywordtype">int</span>     degree;</div>
+<div class="line"><a name="l06730"></a><span class="lineno"> 6730</span> </div>
+<div class="line"><a name="l06731"></a><span class="lineno"> 6731</span>     <span class="keywordtype">double</span>  sradius = 0.01;   <span class="comment">/* Candidate input argument... */</span></div>
+<div class="line"><a name="l06732"></a><span class="lineno"> 6732</span>     <span class="keywordtype">int</span>     in_sradius;</div>
+<div class="line"><a name="l06733"></a><span class="lineno"> 6733</span> </div>
+<div class="line"><a name="l06734"></a><span class="lineno"> 6734</span>     <span class="keywordtype">double</span> pi = 3.14159265358979323846;</div>
+<div class="line"><a name="l06735"></a><span class="lineno"> 6735</span> </div>
+<div class="line"><a name="l06736"></a><span class="lineno"> 6736</span> </div>
+<div class="line"><a name="l06737"></a><span class="lineno"> 6737</span>     error = <a class="code" href="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d" title="Check validity of a slit location table.">mos_validate_slits</a>(slits);</div>
+<div class="line"><a name="l06738"></a><span class="lineno"> 6738</span>     <span class="keywordflow">if</span> (error) {</div>
+<div class="line"><a name="l06739"></a><span class="lineno"> 6739</span>         cpl_msg_error(func, <span class="stringliteral">"CCD slits table validation: %s"</span>, </div>
+<div class="line"><a name="l06740"></a><span class="lineno"> 6740</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l06741"></a><span class="lineno"> 6741</span>         cpl_error_set(func, error);</div>
+<div class="line"><a name="l06742"></a><span class="lineno"> 6742</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06743"></a><span class="lineno"> 6743</span>     }</div>
+<div class="line"><a name="l06744"></a><span class="lineno"> 6744</span> </div>
+<div class="line"><a name="l06745"></a><span class="lineno"> 6745</span>     error = <a class="code" href="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d" title="Check validity of a slit location table.">mos_validate_slits</a>(maskslits);</div>
+<div class="line"><a name="l06746"></a><span class="lineno"> 6746</span>     <span class="keywordflow">if</span> (error) {</div>
+<div class="line"><a name="l06747"></a><span class="lineno"> 6747</span>         cpl_msg_error(func, <span class="stringliteral">"Mask slits table validation: %s"</span>, </div>
+<div class="line"><a name="l06748"></a><span class="lineno"> 6748</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l06749"></a><span class="lineno"> 6749</span>         cpl_error_set(func, error);</div>
+<div class="line"><a name="l06750"></a><span class="lineno"> 6750</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06751"></a><span class="lineno"> 6751</span>     }</div>
+<div class="line"><a name="l06752"></a><span class="lineno"> 6752</span> </div>
+<div class="line"><a name="l06753"></a><span class="lineno"> 6753</span>     <span class="keywordflow">if</span> (1 != cpl_table_has_column(maskslits, <span class="stringliteral">"slit_id"</span>)) {</div>
+<div class="line"><a name="l06754"></a><span class="lineno"> 6754</span>         cpl_msg_error(func, <span class="stringliteral">"Missing slits identifiers"</span>);</div>
+<div class="line"><a name="l06755"></a><span class="lineno"> 6755</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l06756"></a><span class="lineno"> 6756</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06757"></a><span class="lineno"> 6757</span>     }</div>
+<div class="line"><a name="l06758"></a><span class="lineno"> 6758</span> </div>
+<div class="line"><a name="l06759"></a><span class="lineno"> 6759</span>     <span class="keywordflow">if</span> (CPL_TYPE_INT != cpl_table_get_column_type(maskslits, <span class="stringliteral">"slit_id"</span>)) {</div>
+<div class="line"><a name="l06760"></a><span class="lineno"> 6760</span>         cpl_msg_error(func, <span class="stringliteral">"Wrong type used for slits identifiers"</span>);</div>
+<div class="line"><a name="l06761"></a><span class="lineno"> 6761</span>         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l06762"></a><span class="lineno"> 6762</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06763"></a><span class="lineno"> 6763</span>     }</div>
+<div class="line"><a name="l06764"></a><span class="lineno"> 6764</span> </div>
+<div class="line"><a name="l06765"></a><span class="lineno"> 6765</span>     nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l06766"></a><span class="lineno"> 6766</span>     nmaskslits = cpl_table_get_nrow(maskslits);</div>
+<div class="line"><a name="l06767"></a><span class="lineno"> 6767</span> </div>
+<div class="line"><a name="l06768"></a><span class="lineno"> 6768</span>     <span class="keywordflow">if</span> (nslits == 0 || nmaskslits == 0) {</div>
+<div class="line"><a name="l06769"></a><span class="lineno"> 6769</span>         cpl_msg_error(func, <span class="stringliteral">"Empty slits table"</span>);</div>
+<div class="line"><a name="l06770"></a><span class="lineno"> 6770</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l06771"></a><span class="lineno"> 6771</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06772"></a><span class="lineno"> 6772</span>     }</div>
+<div class="line"><a name="l06773"></a><span class="lineno"> 6773</span> </div>
+<div class="line"><a name="l06774"></a><span class="lineno"> 6774</span> </div>
+<div class="line"><a name="l06775"></a><span class="lineno"> 6775</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l06776"></a><span class="lineno"> 6776</span> <span class="comment">     * Compute middle point coordinates for each slit listed in both</span></div>
+<div class="line"><a name="l06777"></a><span class="lineno"> 6777</span> <span class="comment">     * input tables.</span></div>
+<div class="line"><a name="l06778"></a><span class="lineno"> 6778</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l06779"></a><span class="lineno"> 6779</span> </div>
+<div class="line"><a name="l06780"></a><span class="lineno"> 6780</span>     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"xcenter"</span>))</div>
+<div class="line"><a name="l06781"></a><span class="lineno"> 6781</span>         cpl_table_erase_column(slits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l06782"></a><span class="lineno"> 6782</span> </div>
+<div class="line"><a name="l06783"></a><span class="lineno"> 6783</span>     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"ycenter"</span>))</div>
+<div class="line"><a name="l06784"></a><span class="lineno"> 6784</span>         cpl_table_erase_column(slits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l06785"></a><span class="lineno"> 6785</span> </div>
+<div class="line"><a name="l06786"></a><span class="lineno"> 6786</span>     <span class="keywordflow">if</span> (cpl_table_has_column(maskslits, <span class="stringliteral">"xcenter"</span>))</div>
+<div class="line"><a name="l06787"></a><span class="lineno"> 6787</span>         cpl_table_erase_column(maskslits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l06788"></a><span class="lineno"> 6788</span> </div>
+<div class="line"><a name="l06789"></a><span class="lineno"> 6789</span>     <span class="keywordflow">if</span> (cpl_table_has_column(maskslits, <span class="stringliteral">"ycenter"</span>))</div>
+<div class="line"><a name="l06790"></a><span class="lineno"> 6790</span>         cpl_table_erase_column(maskslits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l06791"></a><span class="lineno"> 6791</span> </div>
+<div class="line"><a name="l06792"></a><span class="lineno"> 6792</span>     cpl_table_duplicate_column(slits, <span class="stringliteral">"xcenter"</span>, slits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l06793"></a><span class="lineno"> 6793</span>     cpl_table_add_columns(slits, <span class="stringliteral">"xcenter"</span>, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l06794"></a><span class="lineno"> 6794</span>     cpl_table_divide_scalar(slits, <span class="stringliteral">"xcenter"</span>, 2.0);</div>
+<div class="line"><a name="l06795"></a><span class="lineno"> 6795</span>     cpl_table_duplicate_column(slits, <span class="stringliteral">"ycenter"</span>, slits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l06796"></a><span class="lineno"> 6796</span>     cpl_table_add_columns(slits, <span class="stringliteral">"ycenter"</span>, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l06797"></a><span class="lineno"> 6797</span>     cpl_table_divide_scalar(slits, <span class="stringliteral">"ycenter"</span>, 2.0);</div>
+<div class="line"><a name="l06798"></a><span class="lineno"> 6798</span> </div>
+<div class="line"><a name="l06799"></a><span class="lineno"> 6799</span>     cpl_table_duplicate_column(maskslits, <span class="stringliteral">"xcenter"</span>, maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l06800"></a><span class="lineno"> 6800</span>     cpl_table_add_columns(maskslits, <span class="stringliteral">"xcenter"</span>, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l06801"></a><span class="lineno"> 6801</span>     cpl_table_divide_scalar(maskslits, <span class="stringliteral">"xcenter"</span>, 2.0);</div>
+<div class="line"><a name="l06802"></a><span class="lineno"> 6802</span>     cpl_table_duplicate_column(maskslits, <span class="stringliteral">"ycenter"</span>, maskslits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l06803"></a><span class="lineno"> 6803</span>     cpl_table_add_columns(maskslits, <span class="stringliteral">"ycenter"</span>, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l06804"></a><span class="lineno"> 6804</span>     cpl_table_divide_scalar(maskslits, <span class="stringliteral">"ycenter"</span>, 2.0);</div>
+<div class="line"><a name="l06805"></a><span class="lineno"> 6805</span> </div>
+<div class="line"><a name="l06806"></a><span class="lineno"> 6806</span> </div>
+<div class="line"><a name="l06807"></a><span class="lineno"> 6807</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l06808"></a><span class="lineno"> 6808</span> <span class="comment">     * Guarantee that both input tables are sorted in the same way</span></div>
+<div class="line"><a name="l06809"></a><span class="lineno"> 6809</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l06810"></a><span class="lineno"> 6810</span> </div>
+<div class="line"><a name="l06811"></a><span class="lineno"> 6811</span>     sort_col = cpl_propertylist_new();</div>
+<div class="line"><a name="l06812"></a><span class="lineno"> 6812</span>     cpl_propertylist_append_bool(sort_col, <span class="stringliteral">"ycenter"</span>, 1);</div>
+<div class="line"><a name="l06813"></a><span class="lineno"> 6813</span>     cpl_table_sort(slits, sort_col);</div>
+<div class="line"><a name="l06814"></a><span class="lineno"> 6814</span>     cpl_table_sort(maskslits, sort_col);</div>
+<div class="line"><a name="l06815"></a><span class="lineno"> 6815</span>     cpl_propertylist_delete(sort_col);</div>
+<div class="line"><a name="l06816"></a><span class="lineno"> 6816</span> </div>
+<div class="line"><a name="l06817"></a><span class="lineno"> 6817</span> </div>
+<div class="line"><a name="l06818"></a><span class="lineno"> 6818</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l06819"></a><span class="lineno"> 6819</span> <span class="comment">     * First we handle all the special cases (too few slits...)</span></div>
+<div class="line"><a name="l06820"></a><span class="lineno"> 6820</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l06821"></a><span class="lineno"> 6821</span> </div>
+<div class="line"><a name="l06822"></a><span class="lineno"> 6822</span>     <span class="keywordflow">if</span> (nslits < 3 && nmaskslits > nslits) {</div>
+<div class="line"><a name="l06823"></a><span class="lineno"> 6823</span> </div>
+<div class="line"><a name="l06824"></a><span class="lineno"> 6824</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l06825"></a><span class="lineno"> 6825</span> <span class="comment">         * If there are just 1 or 2 slits on the CCD, and more on the</span></div>
+<div class="line"><a name="l06826"></a><span class="lineno"> 6826</span> <span class="comment">         * mask, the ambiguity cannot be solved, and an error is returned.</span></div>
+<div class="line"><a name="l06827"></a><span class="lineno"> 6827</span> <span class="comment">         * This is a case that must be solved with a first-guess relation</span></div>
+<div class="line"><a name="l06828"></a><span class="lineno"> 6828</span> <span class="comment">         * between mask and CCD.</span></div>
+<div class="line"><a name="l06829"></a><span class="lineno"> 6829</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l06830"></a><span class="lineno"> 6830</span> </div>
+<div class="line"><a name="l06831"></a><span class="lineno"> 6831</span>         <span class="keywordflow">if</span> (nslits > 1)</div>
+<div class="line"><a name="l06832"></a><span class="lineno"> 6832</span>             cpl_msg_warning(func, <span class="stringliteral">"Cannot match the found CCD slit with the "</span></div>
+<div class="line"><a name="l06833"></a><span class="lineno"> 6833</span>                             <span class="stringliteral">"%d mask slits: process will continue using the "</span></div>
+<div class="line"><a name="l06834"></a><span class="lineno"> 6834</span>                             <span class="stringliteral">"detected CCD slit position"</span>, nmaskslits);</div>
+<div class="line"><a name="l06835"></a><span class="lineno"> 6835</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l06836"></a><span class="lineno"> 6836</span>             cpl_msg_warning(func, <span class="stringliteral">"Cannot match the %d found CCD slits with "</span></div>
+<div class="line"><a name="l06837"></a><span class="lineno"> 6837</span>                             <span class="stringliteral">"the %d mask slits: process will continue using "</span></div>
+<div class="line"><a name="l06838"></a><span class="lineno"> 6838</span>                             <span class="stringliteral">"the detected CCD slits positions"</span>, nslits, </div>
+<div class="line"><a name="l06839"></a><span class="lineno"> 6839</span>                             nmaskslits);</div>
+<div class="line"><a name="l06840"></a><span class="lineno"> 6840</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06841"></a><span class="lineno"> 6841</span>     }</div>
+<div class="line"><a name="l06842"></a><span class="lineno"> 6842</span> </div>
+<div class="line"><a name="l06843"></a><span class="lineno"> 6843</span>     <span class="keywordflow">if</span> (nslits <= 3 && nslits == nmaskslits) {</div>
+<div class="line"><a name="l06844"></a><span class="lineno"> 6844</span> </div>
+<div class="line"><a name="l06845"></a><span class="lineno"> 6845</span>         cpl_msg_warning(func, <span class="stringliteral">"Too few slits (%d) on mask and CCD"</span>, nslits);</div>
+<div class="line"><a name="l06846"></a><span class="lineno"> 6846</span>         cpl_msg_warning(func, <span class="stringliteral">"Their detected positions are left unchanged"</span>);</div>
+<div class="line"><a name="l06847"></a><span class="lineno"> 6847</span> </div>
+<div class="line"><a name="l06848"></a><span class="lineno"> 6848</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l06849"></a><span class="lineno"> 6849</span> <span class="comment">         * If there are just up to 3 slits, both on the mask and on the CCD,</span></div>
+<div class="line"><a name="l06850"></a><span class="lineno"> 6850</span> <span class="comment">         * we can reasonably hope that those slits were found, and accept </span></div>
+<div class="line"><a name="l06851"></a><span class="lineno"> 6851</span> <span class="comment">         * that their positions on the CCD cannot be improved. We prepare</span></div>
+<div class="line"><a name="l06852"></a><span class="lineno"> 6852</span> <span class="comment">         * therefore an output position table containing the slits with</span></div>
+<div class="line"><a name="l06853"></a><span class="lineno"> 6853</span> <span class="comment">         * their original positions. We can however give an estimate of</span></div>
+<div class="line"><a name="l06854"></a><span class="lineno"> 6854</span> <span class="comment">         * the platescale if there is more than one slit.</span></div>
+<div class="line"><a name="l06855"></a><span class="lineno"> 6855</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l06856"></a><span class="lineno"> 6856</span> </div>
+<div class="line"><a name="l06857"></a><span class="lineno"> 6857</span>         positions = cpl_table_duplicate(slits);</div>
+<div class="line"><a name="l06858"></a><span class="lineno"> 6858</span>         cpl_table_erase_column(slits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l06859"></a><span class="lineno"> 6859</span>         cpl_table_erase_column(slits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l06860"></a><span class="lineno"> 6860</span>         cpl_table_duplicate_column(positions, <span class="stringliteral">"xmtop"</span>, maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l06861"></a><span class="lineno"> 6861</span>         cpl_table_duplicate_column(positions, <span class="stringliteral">"ymtop"</span>, maskslits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l06862"></a><span class="lineno"> 6862</span>         cpl_table_duplicate_column(positions, <span class="stringliteral">"xmbottom"</span>, maskslits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l06863"></a><span class="lineno"> 6863</span>         cpl_table_duplicate_column(positions, <span class="stringliteral">"ymbottom"</span>, maskslits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l06864"></a><span class="lineno"> 6864</span>         cpl_table_duplicate_column(positions, <span class="stringliteral">"xmcenter"</span>, maskslits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l06865"></a><span class="lineno"> 6865</span>         cpl_table_duplicate_column(positions, <span class="stringliteral">"ymcenter"</span>, maskslits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l06866"></a><span class="lineno"> 6866</span>         cpl_table_duplicate_column(positions, <span class="stringliteral">"slit_id"</span>, maskslits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l06867"></a><span class="lineno"> 6867</span>         cpl_table_erase_column(maskslits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l06868"></a><span class="lineno"> 6868</span>         cpl_table_erase_column(maskslits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l06869"></a><span class="lineno"> 6869</span> </div>
+<div class="line"><a name="l06870"></a><span class="lineno"> 6870</span>         <span class="keywordflow">if</span> (nslits > 1) {</div>
+<div class="line"><a name="l06871"></a><span class="lineno"> 6871</span>             xcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l06872"></a><span class="lineno"> 6872</span>             ycenter = cpl_table_get_data_double(positions, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l06873"></a><span class="lineno"> 6873</span>             xmcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"xmcenter"</span>);</div>
+<div class="line"><a name="l06874"></a><span class="lineno"> 6874</span>             ymcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"ymcenter"</span>);</div>
+<div class="line"><a name="l06875"></a><span class="lineno"> 6875</span> </div>
+<div class="line"><a name="l06876"></a><span class="lineno"> 6876</span>             dist1 = (xcenter[0] - xcenter[1])*(xcenter[0] - xcenter[1])</div>
+<div class="line"><a name="l06877"></a><span class="lineno"> 6877</span>                   + (ycenter[0] - ycenter[1])*(ycenter[0] - ycenter[1]);</div>
+<div class="line"><a name="l06878"></a><span class="lineno"> 6878</span>             dist2 = (xmcenter[0] - xmcenter[1])*(xmcenter[0] - xmcenter[1])</div>
+<div class="line"><a name="l06879"></a><span class="lineno"> 6879</span>                   + (ymcenter[0] - ymcenter[1])*(ymcenter[0] - ymcenter[1]);</div>
+<div class="line"><a name="l06880"></a><span class="lineno"> 6880</span>             scale = sqrt(dist1/dist2);</div>
+<div class="line"><a name="l06881"></a><span class="lineno"> 6881</span> </div>
+<div class="line"><a name="l06882"></a><span class="lineno"> 6882</span>             <span class="keywordflow">if</span> (nslits == 3) {</div>
+<div class="line"><a name="l06883"></a><span class="lineno"> 6883</span>                 dist1 = (xcenter[1] - xcenter[2])*(xcenter[1] - xcenter[2])</div>
+<div class="line"><a name="l06884"></a><span class="lineno"> 6884</span>                       + (ycenter[1] - ycenter[2])*(ycenter[1] - ycenter[2]);</div>
+<div class="line"><a name="l06885"></a><span class="lineno"> 6885</span>                 dist2 = (xmcenter[1] - xmcenter[2])*(xmcenter[1] - xmcenter[2])</div>
+<div class="line"><a name="l06886"></a><span class="lineno"> 6886</span>                       + (ymcenter[1] - ymcenter[2])*(ymcenter[1] - ymcenter[2]);</div>
+<div class="line"><a name="l06887"></a><span class="lineno"> 6887</span>                 scale += sqrt(dist1/dist2);</div>
+<div class="line"><a name="l06888"></a><span class="lineno"> 6888</span>                 scale /= 2;</div>
+<div class="line"><a name="l06889"></a><span class="lineno"> 6889</span>             }</div>
+<div class="line"><a name="l06890"></a><span class="lineno"> 6890</span> </div>
+<div class="line"><a name="l06891"></a><span class="lineno"> 6891</span>             cpl_msg_info(func, <span class="stringliteral">"Platescale: %f pixel/mm"</span>, scale);</div>
+<div class="line"><a name="l06892"></a><span class="lineno"> 6892</span>         }</div>
+<div class="line"><a name="l06893"></a><span class="lineno"> 6893</span> </div>
+<div class="line"><a name="l06894"></a><span class="lineno"> 6894</span>         <span class="keywordflow">return</span> positions;</div>
+<div class="line"><a name="l06895"></a><span class="lineno"> 6895</span>     }</div>
+<div class="line"><a name="l06896"></a><span class="lineno"> 6896</span> </div>
+<div class="line"><a name="l06897"></a><span class="lineno"> 6897</span>     <span class="keywordflow">if</span> (nmaskslits < 3 && nslits > nmaskslits) {</div>
+<div class="line"><a name="l06898"></a><span class="lineno"> 6898</span> </div>
+<div class="line"><a name="l06899"></a><span class="lineno"> 6899</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l06900"></a><span class="lineno"> 6900</span> <span class="comment">         * If there are less than 3 slits on the mask the ambiguity cannot </span></div>
+<div class="line"><a name="l06901"></a><span class="lineno"> 6901</span> <span class="comment">         * be solved, and an error is returned. This is a case that must </span></div>
+<div class="line"><a name="l06902"></a><span class="lineno"> 6902</span> <span class="comment">         * be solved with a first-guess relation between mask and CCD.</span></div>
+<div class="line"><a name="l06903"></a><span class="lineno"> 6903</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l06904"></a><span class="lineno"> 6904</span> </div>
+<div class="line"><a name="l06905"></a><span class="lineno"> 6905</span>         cpl_msg_warning(func, <span class="stringliteral">"Cannot match the %d found CCD slits with "</span></div>
+<div class="line"><a name="l06906"></a><span class="lineno"> 6906</span>                         <span class="stringliteral">"the %d mask slits: process will continue using "</span></div>
+<div class="line"><a name="l06907"></a><span class="lineno"> 6907</span>                         <span class="stringliteral">"the detected CCD slits positions"</span>, nslits, </div>
+<div class="line"><a name="l06908"></a><span class="lineno"> 6908</span>                         nmaskslits);</div>
+<div class="line"><a name="l06909"></a><span class="lineno"> 6909</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l06910"></a><span class="lineno"> 6910</span>     }</div>
+<div class="line"><a name="l06911"></a><span class="lineno"> 6911</span> </div>
+<div class="line"><a name="l06912"></a><span class="lineno"> 6912</span> </div>
+<div class="line"><a name="l06913"></a><span class="lineno"> 6913</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l06914"></a><span class="lineno"> 6914</span> <span class="comment">     * At this point of the program all the region of the plane</span></div>
+<div class="line"><a name="l06915"></a><span class="lineno"> 6915</span> <span class="comment">     * (nslits, nmaskslits) where either or both mask and CCD display</span></div>
+<div class="line"><a name="l06916"></a><span class="lineno"> 6916</span> <span class="comment">     * less than 3 slits are handled in some way. It would be better</span></div>
+<div class="line"><a name="l06917"></a><span class="lineno"> 6917</span> <span class="comment">     * to add in this place a special handling for identifying slits</span></div>
+<div class="line"><a name="l06918"></a><span class="lineno"> 6918</span> <span class="comment">     * in case of a very reduced number of slits (say, below 6).</span></div>
+<div class="line"><a name="l06919"></a><span class="lineno"> 6919</span> <span class="comment">     * It is also clear that if there are many more slits on the</span></div>
+<div class="line"><a name="l06920"></a><span class="lineno"> 6920</span> <span class="comment">     * mask than on the CCD, or many more on the CCD than on the</span></div>
+<div class="line"><a name="l06921"></a><span class="lineno"> 6921</span> <span class="comment">     * mask, something went deeply wrong with the preliminary </span></div>
+<div class="line"><a name="l06922"></a><span class="lineno"> 6922</span> <span class="comment">     * wavelength calibration. Such cases should be handled with</span></div>
+<div class="line"><a name="l06923"></a><span class="lineno"> 6923</span> <span class="comment">     * a _complete_ pattern-recognition algorithm based on the</span></div>
+<div class="line"><a name="l06924"></a><span class="lineno"> 6924</span> <span class="comment">     * construction of all possible triangles. For the moment, </span></div>
+<div class="line"><a name="l06925"></a><span class="lineno"> 6925</span> <span class="comment">     * we go directly to the limited pattern-recognition applied</span></div>
+<div class="line"><a name="l06926"></a><span class="lineno"> 6926</span> <span class="comment">     * below, based on triangles build only for consecutive slits.</span></div>
+<div class="line"><a name="l06927"></a><span class="lineno"> 6927</span> <span class="comment">     * This is reasonably safe, since the preliminary wavelength</span></div>
+<div class="line"><a name="l06928"></a><span class="lineno"> 6928</span> <span class="comment">     * calibration performed by mos_identify_peaks() is generally</span></div>
+<div class="line"><a name="l06929"></a><span class="lineno"> 6929</span> <span class="comment">     * robust.</span></div>
+<div class="line"><a name="l06930"></a><span class="lineno"> 6930</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l06931"></a><span class="lineno"> 6931</span> </div>
+<div class="line"><a name="l06932"></a><span class="lineno"> 6932</span> </div>
+<div class="line"><a name="l06933"></a><span class="lineno"> 6933</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l06934"></a><span class="lineno"> 6934</span> <span class="comment">     * Compute (X, Y) coordinates on pseudo-plane describing the</span></div>
+<div class="line"><a name="l06935"></a><span class="lineno"> 6935</span> <span class="comment">     * different position ratios of successive slits, in both</span></div>
+<div class="line"><a name="l06936"></a><span class="lineno"> 6936</span> <span class="comment">     * input tables.</span></div>
+<div class="line"><a name="l06937"></a><span class="lineno"> 6937</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l06938"></a><span class="lineno"> 6938</span> </div>
+<div class="line"><a name="l06939"></a><span class="lineno"> 6939</span>     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"xpseudo"</span>))</div>
+<div class="line"><a name="l06940"></a><span class="lineno"> 6940</span>         cpl_table_erase_column(slits, <span class="stringliteral">"xpseudo"</span>);</div>
+<div class="line"><a name="l06941"></a><span class="lineno"> 6941</span> </div>
+<div class="line"><a name="l06942"></a><span class="lineno"> 6942</span>     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"ypseudo"</span>))</div>
+<div class="line"><a name="l06943"></a><span class="lineno"> 6943</span>         cpl_table_erase_column(slits, <span class="stringliteral">"ypseudo"</span>);</div>
+<div class="line"><a name="l06944"></a><span class="lineno"> 6944</span> </div>
+<div class="line"><a name="l06945"></a><span class="lineno"> 6945</span>     <span class="keywordflow">if</span> (cpl_table_has_column(maskslits, <span class="stringliteral">"xpseudo"</span>))</div>
+<div class="line"><a name="l06946"></a><span class="lineno"> 6946</span>         cpl_table_erase_column(maskslits, <span class="stringliteral">"xpseudo"</span>);</div>
+<div class="line"><a name="l06947"></a><span class="lineno"> 6947</span> </div>
+<div class="line"><a name="l06948"></a><span class="lineno"> 6948</span>     <span class="keywordflow">if</span> (cpl_table_has_column(maskslits, <span class="stringliteral">"ypseudo"</span>))</div>
+<div class="line"><a name="l06949"></a><span class="lineno"> 6949</span>         cpl_table_erase_column(maskslits, <span class="stringliteral">"ypseudo"</span>);</div>
+<div class="line"><a name="l06950"></a><span class="lineno"> 6950</span> </div>
+<div class="line"><a name="l06951"></a><span class="lineno"> 6951</span>     cpl_table_duplicate_column(slits, <span class="stringliteral">"xpseudo"</span>, slits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l06952"></a><span class="lineno"> 6952</span>     cpl_table_duplicate_column(slits, <span class="stringliteral">"ypseudo"</span>, slits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l06953"></a><span class="lineno"> 6953</span> </div>
+<div class="line"><a name="l06954"></a><span class="lineno"> 6954</span>     xcenter = cpl_table_get_data_double(slits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l06955"></a><span class="lineno"> 6955</span>     ycenter = cpl_table_get_data_double(slits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l06956"></a><span class="lineno"> 6956</span>     xpseudo = cpl_table_get_data_double(slits, <span class="stringliteral">"xpseudo"</span>);</div>
+<div class="line"><a name="l06957"></a><span class="lineno"> 6957</span>     ypseudo = cpl_table_get_data_double(slits, <span class="stringliteral">"ypseudo"</span>);</div>
+<div class="line"><a name="l06958"></a><span class="lineno"> 6958</span> </div>
+<div class="line"><a name="l06959"></a><span class="lineno"> 6959</span>     <span class="keywordflow">for</span> (i = 1; i < nslits - 1; i++) {</div>
+<div class="line"><a name="l06960"></a><span class="lineno"> 6960</span>         dist1 = (xcenter[i-1] - xcenter[i]) * (xcenter[i-1] - xcenter[i])</div>
+<div class="line"><a name="l06961"></a><span class="lineno"> 6961</span>               + (ycenter[i-1] - ycenter[i]) * (ycenter[i-1] - ycenter[i]);</div>
+<div class="line"><a name="l06962"></a><span class="lineno"> 6962</span>         dist2 = (xcenter[i-1] - xcenter[i+1]) * (xcenter[i-1] - xcenter[i+1])</div>
+<div class="line"><a name="l06963"></a><span class="lineno"> 6963</span>               + (ycenter[i-1] - ycenter[i+1]) * (ycenter[i-1] - ycenter[i+1]);</div>
+<div class="line"><a name="l06964"></a><span class="lineno"> 6964</span>         dist3 = (xcenter[i] - xcenter[i+1]) * (xcenter[i] - xcenter[i+1])</div>
+<div class="line"><a name="l06965"></a><span class="lineno"> 6965</span>               + (ycenter[i] - ycenter[i+1]) * (ycenter[i] - ycenter[i+1]);</div>
+<div class="line"><a name="l06966"></a><span class="lineno"> 6966</span>         xpseudo[i] = sqrt(dist1/dist2);</div>
+<div class="line"><a name="l06967"></a><span class="lineno"> 6967</span>         ypseudo[i] = sqrt(dist3/dist2);</div>
+<div class="line"><a name="l06968"></a><span class="lineno"> 6968</span>     }</div>
+<div class="line"><a name="l06969"></a><span class="lineno"> 6969</span> </div>
+<div class="line"><a name="l06970"></a><span class="lineno"> 6970</span>     cpl_table_set_invalid(slits, <span class="stringliteral">"xpseudo"</span>, 0);</div>
+<div class="line"><a name="l06971"></a><span class="lineno"> 6971</span>     cpl_table_set_invalid(slits, <span class="stringliteral">"xpseudo"</span>, nslits-1);</div>
+<div class="line"><a name="l06972"></a><span class="lineno"> 6972</span>     cpl_table_set_invalid(slits, <span class="stringliteral">"ypseudo"</span>, 0);</div>
+<div class="line"><a name="l06973"></a><span class="lineno"> 6973</span>     cpl_table_set_invalid(slits, <span class="stringliteral">"ypseudo"</span>, nslits-1);</div>
+<div class="line"><a name="l06974"></a><span class="lineno"> 6974</span> </div>
+<div class="line"><a name="l06975"></a><span class="lineno"> 6975</span>     cpl_table_duplicate_column(maskslits, <span class="stringliteral">"xpseudo"</span>, maskslits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l06976"></a><span class="lineno"> 6976</span>     cpl_table_duplicate_column(maskslits, <span class="stringliteral">"ypseudo"</span>, maskslits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l06977"></a><span class="lineno"> 6977</span> </div>
+<div class="line"><a name="l06978"></a><span class="lineno"> 6978</span>     xcenter = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l06979"></a><span class="lineno"> 6979</span>     ycenter = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l06980"></a><span class="lineno"> 6980</span>     xmpseudo = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xpseudo"</span>);</div>
+<div class="line"><a name="l06981"></a><span class="lineno"> 6981</span>     ympseudo = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ypseudo"</span>);</div>
+<div class="line"><a name="l06982"></a><span class="lineno"> 6982</span> </div>
+<div class="line"><a name="l06983"></a><span class="lineno"> 6983</span>     <span class="keywordflow">for</span> (i = 1; i < nmaskslits - 1; i++) {</div>
+<div class="line"><a name="l06984"></a><span class="lineno"> 6984</span>         dist1 = (xcenter[i-1] - xcenter[i])*(xcenter[i-1] - xcenter[i])</div>
+<div class="line"><a name="l06985"></a><span class="lineno"> 6985</span>               + (ycenter[i-1] - ycenter[i])*(ycenter[i-1] - ycenter[i]);</div>
+<div class="line"><a name="l06986"></a><span class="lineno"> 6986</span>         dist2 = (xcenter[i-1] - xcenter[i+1])*(xcenter[i-1] - xcenter[i+1])</div>
+<div class="line"><a name="l06987"></a><span class="lineno"> 6987</span>               + (ycenter[i-1] - ycenter[i+1])*(ycenter[i-1] - ycenter[i+1]);</div>
+<div class="line"><a name="l06988"></a><span class="lineno"> 6988</span>         dist3 = (xcenter[i] - xcenter[i+1])*(xcenter[i] - xcenter[i+1])</div>
+<div class="line"><a name="l06989"></a><span class="lineno"> 6989</span>               + (ycenter[i] - ycenter[i+1])*(ycenter[i] - ycenter[i+1]);</div>
+<div class="line"><a name="l06990"></a><span class="lineno"> 6990</span>         xmpseudo[i] = sqrt(dist1/dist2);</div>
+<div class="line"><a name="l06991"></a><span class="lineno"> 6991</span>         ympseudo[i] = sqrt(dist3/dist2);</div>
+<div class="line"><a name="l06992"></a><span class="lineno"> 6992</span>     }</div>
+<div class="line"><a name="l06993"></a><span class="lineno"> 6993</span>     </div>
+<div class="line"><a name="l06994"></a><span class="lineno"> 6994</span>     cpl_table_set_invalid(maskslits, <span class="stringliteral">"xpseudo"</span>, 0);</div>
+<div class="line"><a name="l06995"></a><span class="lineno"> 6995</span>     cpl_table_set_invalid(maskslits, <span class="stringliteral">"xpseudo"</span>, nmaskslits-1);</div>
+<div class="line"><a name="l06996"></a><span class="lineno"> 6996</span>     cpl_table_set_invalid(maskslits, <span class="stringliteral">"ypseudo"</span>, 0);</div>
+<div class="line"><a name="l06997"></a><span class="lineno"> 6997</span>     cpl_table_set_invalid(maskslits, <span class="stringliteral">"ypseudo"</span>, nmaskslits-1);</div>
+<div class="line"><a name="l06998"></a><span class="lineno"> 6998</span> </div>
+<div class="line"><a name="l06999"></a><span class="lineno"> 6999</span> </div>
+<div class="line"><a name="l07000"></a><span class="lineno"> 7000</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07001"></a><span class="lineno"> 7001</span> <span class="comment">     * For each (X, Y) on the pseudo-plane related to the mask positions,</span></div>
+<div class="line"><a name="l07002"></a><span class="lineno"> 7002</span> <span class="comment">     * find the closest (X, Y) on the pseudo-plane related to the CCD</span></div>
+<div class="line"><a name="l07003"></a><span class="lineno"> 7003</span> <span class="comment">     * positions. If the closest point is closer than a given search</span></div>
+<div class="line"><a name="l07004"></a><span class="lineno"> 7004</span> <span class="comment">     * radius, a triangle has been found, and 3 slits are identified.</span></div>
+<div class="line"><a name="l07005"></a><span class="lineno"> 7005</span> <span class="comment">     * However, if more than one point is found within the search</span></div>
+<div class="line"><a name="l07006"></a><span class="lineno"> 7006</span> <span class="comment">     * radius, we have an ambiguity and this is rejected.</span></div>
+<div class="line"><a name="l07007"></a><span class="lineno"> 7007</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07008"></a><span class="lineno"> 7008</span> </div>
+<div class="line"><a name="l07009"></a><span class="lineno"> 7009</span>     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"slit_id"</span>))</div>
+<div class="line"><a name="l07010"></a><span class="lineno"> 7010</span>         cpl_table_erase_column(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07011"></a><span class="lineno"> 7011</span>     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l07012"></a><span class="lineno"> 7012</span>     slit_id = cpl_table_get_data_int(maskslits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07013"></a><span class="lineno"> 7013</span> </div>
+<div class="line"><a name="l07014"></a><span class="lineno"> 7014</span>     <span class="keywordflow">for</span> (i = 1; i < nmaskslits - 1; i++) {</div>
+<div class="line"><a name="l07015"></a><span class="lineno"> 7015</span>         in_sradius = 0;</div>
+<div class="line"><a name="l07016"></a><span class="lineno"> 7016</span>         mindist = (xmpseudo[i] - xpseudo[1]) * (xmpseudo[i] - xpseudo[1])</div>
+<div class="line"><a name="l07017"></a><span class="lineno"> 7017</span>                 + (ympseudo[i] - ypseudo[1]) * (ympseudo[i] - ypseudo[1]);</div>
+<div class="line"><a name="l07018"></a><span class="lineno"> 7018</span>         minpos = 1;</div>
+<div class="line"><a name="l07019"></a><span class="lineno"> 7019</span>         <span class="keywordflow">if</span> (mindist < sradius*sradius)</div>
+<div class="line"><a name="l07020"></a><span class="lineno"> 7020</span>             in_sradius++;</div>
+<div class="line"><a name="l07021"></a><span class="lineno"> 7021</span>         <span class="keywordflow">for</span> (j = 2; j < nslits - 1; j++) {</div>
+<div class="line"><a name="l07022"></a><span class="lineno"> 7022</span>             dist = (xmpseudo[i] - xpseudo[j]) * (xmpseudo[i] - xpseudo[j])</div>
+<div class="line"><a name="l07023"></a><span class="lineno"> 7023</span>                  + (ympseudo[i] - ypseudo[j]) * (ympseudo[i] - ypseudo[j]);</div>
+<div class="line"><a name="l07024"></a><span class="lineno"> 7024</span>             <span class="keywordflow">if</span> (dist < sradius*sradius)</div>
+<div class="line"><a name="l07025"></a><span class="lineno"> 7025</span>                 in_sradius++;</div>
+<div class="line"><a name="l07026"></a><span class="lineno"> 7026</span>             <span class="keywordflow">if</span> (in_sradius > 1)    <span class="comment">/* More than one triangle within radius */</span></div>
+<div class="line"><a name="l07027"></a><span class="lineno"> 7027</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l07028"></a><span class="lineno"> 7028</span>             <span class="keywordflow">if</span> (mindist > dist) {</div>
+<div class="line"><a name="l07029"></a><span class="lineno"> 7029</span>                 mindist = dist;</div>
+<div class="line"><a name="l07030"></a><span class="lineno"> 7030</span>                 minpos = j;</div>
+<div class="line"><a name="l07031"></a><span class="lineno"> 7031</span>             }</div>
+<div class="line"><a name="l07032"></a><span class="lineno"> 7032</span>         }</div>
+<div class="line"><a name="l07033"></a><span class="lineno"> 7033</span> </div>
+<div class="line"><a name="l07034"></a><span class="lineno"> 7034</span>         mindist = sqrt(mindist);</div>
+<div class="line"><a name="l07035"></a><span class="lineno"> 7035</span> </div>
+<div class="line"><a name="l07036"></a><span class="lineno"> 7036</span>         <span class="keywordflow">if</span> (mindist < sradius && in_sradius == 1) {</div>
+<div class="line"><a name="l07037"></a><span class="lineno"> 7037</span>             cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, minpos-1, slit_id[i-1]);</div>
+<div class="line"><a name="l07038"></a><span class="lineno"> 7038</span>             cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, minpos, slit_id[i]);</div>
+<div class="line"><a name="l07039"></a><span class="lineno"> 7039</span>             cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, minpos+1, slit_id[i+1]);</div>
+<div class="line"><a name="l07040"></a><span class="lineno"> 7040</span>         }</div>
+<div class="line"><a name="l07041"></a><span class="lineno"> 7041</span>     }</div>
+<div class="line"><a name="l07042"></a><span class="lineno"> 7042</span> </div>
+<div class="line"><a name="l07043"></a><span class="lineno"> 7043</span> </div>
+<div class="line"><a name="l07044"></a><span class="lineno"> 7044</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07045"></a><span class="lineno"> 7045</span> <span class="comment">     * At this point, the slit_id column contains invalid elements </span></div>
+<div class="line"><a name="l07046"></a><span class="lineno"> 7046</span> <span class="comment">     * corresponding to unidentified slits.</span></div>
+<div class="line"><a name="l07047"></a><span class="lineno"> 7047</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07048"></a><span class="lineno"> 7048</span> </div>
+<div class="line"><a name="l07049"></a><span class="lineno"> 7049</span>     found_slits = nslits - cpl_table_count_invalid(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07050"></a><span class="lineno"> 7050</span> </div>
+<div class="line"><a name="l07051"></a><span class="lineno"> 7051</span>     <span class="keywordflow">if</span> (found_slits < 3) {</div>
+<div class="line"><a name="l07052"></a><span class="lineno"> 7052</span>         cpl_msg_warning(func, <span class="stringliteral">"Too few preliminarily identified slits: "</span></div>
+<div class="line"><a name="l07053"></a><span class="lineno"> 7053</span>                         <span class="stringliteral">"%d out of %d"</span>, found_slits, nslits);</div>
+<div class="line"><a name="l07054"></a><span class="lineno"> 7054</span>         <span class="keywordflow">if</span> (nslits == nmaskslits) {</div>
+<div class="line"><a name="l07055"></a><span class="lineno"> 7055</span>             cpl_msg_warning(func, <span class="stringliteral">"(this is not an error, it could be caused "</span></div>
+<div class="line"><a name="l07056"></a><span class="lineno"> 7056</span>                             <span class="stringliteral">"by a mask with regularly located slits)"</span>);</div>
+<div class="line"><a name="l07057"></a><span class="lineno"> 7057</span>             cpl_msg_warning(func, <span class="stringliteral">"The detected slits positions are left "</span></div>
+<div class="line"><a name="l07058"></a><span class="lineno"> 7058</span>                             <span class="stringliteral">"unchanged"</span>);</div>
+<div class="line"><a name="l07059"></a><span class="lineno"> 7059</span> </div>
+<div class="line"><a name="l07060"></a><span class="lineno"> 7060</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l07061"></a><span class="lineno"> 7061</span> <span class="comment">             * If there are less than 3 identified slits, this is probably </span></div>
+<div class="line"><a name="l07062"></a><span class="lineno"> 7062</span> <span class="comment">             * a mask with regularly spaced slits (leading to an ambiguous</span></div>
+<div class="line"><a name="l07063"></a><span class="lineno"> 7063</span> <span class="comment">             * pattern). Only in the case all expected slits appear to have </span></div>
+<div class="line"><a name="l07064"></a><span class="lineno"> 7064</span> <span class="comment">             * been found on the CCD we can proceed...</span></div>
+<div class="line"><a name="l07065"></a><span class="lineno"> 7065</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l07066"></a><span class="lineno"> 7066</span> </div>
+<div class="line"><a name="l07067"></a><span class="lineno"> 7067</span>             cpl_table_erase_column(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07068"></a><span class="lineno"> 7068</span>             cpl_table_erase_column(slits, <span class="stringliteral">"xpseudo"</span>);</div>
+<div class="line"><a name="l07069"></a><span class="lineno"> 7069</span>             cpl_table_erase_column(slits, <span class="stringliteral">"ypseudo"</span>);</div>
+<div class="line"><a name="l07070"></a><span class="lineno"> 7070</span>             positions = cpl_table_duplicate(slits);</div>
+<div class="line"><a name="l07071"></a><span class="lineno"> 7071</span>             cpl_table_erase_column(slits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l07072"></a><span class="lineno"> 7072</span>             cpl_table_erase_column(slits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l07073"></a><span class="lineno"> 7073</span> </div>
+<div class="line"><a name="l07074"></a><span class="lineno"> 7074</span>             cpl_table_erase_column(maskslits, <span class="stringliteral">"xpseudo"</span>);</div>
+<div class="line"><a name="l07075"></a><span class="lineno"> 7075</span>             cpl_table_erase_column(maskslits, <span class="stringliteral">"ypseudo"</span>);</div>
+<div class="line"><a name="l07076"></a><span class="lineno"> 7076</span>             cpl_table_duplicate_column(positions, <span class="stringliteral">"xmtop"</span>, </div>
+<div class="line"><a name="l07077"></a><span class="lineno"> 7077</span>                                        maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l07078"></a><span class="lineno"> 7078</span>             cpl_table_duplicate_column(positions, <span class="stringliteral">"ymtop"</span>, </div>
+<div class="line"><a name="l07079"></a><span class="lineno"> 7079</span>                                        maskslits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l07080"></a><span class="lineno"> 7080</span>             cpl_table_duplicate_column(positions, <span class="stringliteral">"xmbottom"</span>, </div>
+<div class="line"><a name="l07081"></a><span class="lineno"> 7081</span>                                        maskslits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l07082"></a><span class="lineno"> 7082</span>             cpl_table_duplicate_column(positions, <span class="stringliteral">"ymbottom"</span>, </div>
+<div class="line"><a name="l07083"></a><span class="lineno"> 7083</span>                                        maskslits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l07084"></a><span class="lineno"> 7084</span>             cpl_table_duplicate_column(positions, <span class="stringliteral">"xmcenter"</span>, </div>
+<div class="line"><a name="l07085"></a><span class="lineno"> 7085</span>                                        maskslits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l07086"></a><span class="lineno"> 7086</span>             cpl_table_duplicate_column(positions, <span class="stringliteral">"ymcenter"</span>, </div>
+<div class="line"><a name="l07087"></a><span class="lineno"> 7087</span>                                        maskslits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l07088"></a><span class="lineno"> 7088</span>             cpl_table_duplicate_column(positions, <span class="stringliteral">"slit_id"</span>, </div>
+<div class="line"><a name="l07089"></a><span class="lineno"> 7089</span>                                        maskslits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07090"></a><span class="lineno"> 7090</span>             cpl_table_erase_column(maskslits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l07091"></a><span class="lineno"> 7091</span>             cpl_table_erase_column(maskslits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l07092"></a><span class="lineno"> 7092</span>             <span class="keywordflow">return</span> positions;</div>
+<div class="line"><a name="l07093"></a><span class="lineno"> 7093</span>         }</div>
+<div class="line"><a name="l07094"></a><span class="lineno"> 7094</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l07095"></a><span class="lineno"> 7095</span>             cpl_table_erase_column(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07096"></a><span class="lineno"> 7096</span>             cpl_table_erase_column(slits, <span class="stringliteral">"xpseudo"</span>);</div>
+<div class="line"><a name="l07097"></a><span class="lineno"> 7097</span>             cpl_table_erase_column(slits, <span class="stringliteral">"ypseudo"</span>);</div>
+<div class="line"><a name="l07098"></a><span class="lineno"> 7098</span>             positions = cpl_table_duplicate(slits);</div>
+<div class="line"><a name="l07099"></a><span class="lineno"> 7099</span>             cpl_table_erase_column(slits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l07100"></a><span class="lineno"> 7100</span>             cpl_table_erase_column(slits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l07101"></a><span class="lineno"> 7101</span>             cpl_msg_warning(func, <span class="stringliteral">"(the failure could be caused "</span></div>
+<div class="line"><a name="l07102"></a><span class="lineno"> 7102</span>                             <span class="stringliteral">"by a mask with regularly located slits)"</span>);</div>
+<div class="line"><a name="l07103"></a><span class="lineno"> 7103</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l07104"></a><span class="lineno"> 7104</span>         }</div>
+<div class="line"><a name="l07105"></a><span class="lineno"> 7105</span>     }</div>
+<div class="line"><a name="l07106"></a><span class="lineno"> 7106</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l07107"></a><span class="lineno"> 7107</span>         cpl_msg_info(func, <span class="stringliteral">"Preliminarily identified slits: %d out of %d "</span></div>
+<div class="line"><a name="l07108"></a><span class="lineno"> 7108</span>                      <span class="stringliteral">"candidates (%d expected)"</span>, found_slits, nslits, </div>
+<div class="line"><a name="l07109"></a><span class="lineno"> 7109</span>                      nmaskslits);</div>
+<div class="line"><a name="l07110"></a><span class="lineno"> 7110</span>     }</div>
+<div class="line"><a name="l07111"></a><span class="lineno"> 7111</span> </div>
+<div class="line"><a name="l07112"></a><span class="lineno"> 7112</span> </div>
+<div class="line"><a name="l07113"></a><span class="lineno"> 7113</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07114"></a><span class="lineno"> 7114</span> <span class="comment">     * Create a table with the coordinates of the preliminarily identified </span></div>
+<div class="line"><a name="l07115"></a><span class="lineno"> 7115</span> <span class="comment">     * slits, both on CCD and mask. The original order of the slits positions </span></div>
+<div class="line"><a name="l07116"></a><span class="lineno"> 7116</span> <span class="comment">     * is preserved.</span></div>
+<div class="line"><a name="l07117"></a><span class="lineno"> 7117</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07118"></a><span class="lineno"> 7118</span> </div>
+<div class="line"><a name="l07119"></a><span class="lineno"> 7119</span>     positions = cpl_table_new(found_slits);</div>
+<div class="line"><a name="l07120"></a><span class="lineno"> 7120</span>     cpl_table_new_column(positions, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l07121"></a><span class="lineno"> 7121</span>     cpl_table_new_column(positions, <span class="stringliteral">"xtop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07122"></a><span class="lineno"> 7122</span>     cpl_table_new_column(positions, <span class="stringliteral">"ytop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07123"></a><span class="lineno"> 7123</span>     cpl_table_new_column(positions, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07124"></a><span class="lineno"> 7124</span>     cpl_table_new_column(positions, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07125"></a><span class="lineno"> 7125</span>     cpl_table_new_column(positions, <span class="stringliteral">"xcenter"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07126"></a><span class="lineno"> 7126</span>     cpl_table_new_column(positions, <span class="stringliteral">"ycenter"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07127"></a><span class="lineno"> 7127</span>     cpl_table_new_column(positions, <span class="stringliteral">"xmtop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07128"></a><span class="lineno"> 7128</span>     cpl_table_new_column(positions, <span class="stringliteral">"ymtop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07129"></a><span class="lineno"> 7129</span>     cpl_table_new_column(positions, <span class="stringliteral">"xmbottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07130"></a><span class="lineno"> 7130</span>     cpl_table_new_column(positions, <span class="stringliteral">"ymbottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07131"></a><span class="lineno"> 7131</span>     cpl_table_new_column(positions, <span class="stringliteral">"xmcenter"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07132"></a><span class="lineno"> 7132</span>     cpl_table_new_column(positions, <span class="stringliteral">"ymcenter"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07133"></a><span class="lineno"> 7133</span>     cpl_table_new_column(positions, <span class="stringliteral">"good"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l07134"></a><span class="lineno"> 7134</span>     cpl_table_fill_column_window_int(positions, <span class="stringliteral">"good"</span>, 0, found_slits, 0);</div>
+<div class="line"><a name="l07135"></a><span class="lineno"> 7135</span> </div>
+<div class="line"><a name="l07136"></a><span class="lineno"> 7136</span>     slit_id = cpl_table_get_data_int   (slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07137"></a><span class="lineno"> 7137</span>     xtop    = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l07138"></a><span class="lineno"> 7138</span>     ytop    = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l07139"></a><span class="lineno"> 7139</span>     xbottom = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l07140"></a><span class="lineno"> 7140</span>     ybottom = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l07141"></a><span class="lineno"> 7141</span>     xcenter = cpl_table_get_data_double(slits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l07142"></a><span class="lineno"> 7142</span>     ycenter = cpl_table_get_data_double(slits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l07143"></a><span class="lineno"> 7143</span> </div>
+<div class="line"><a name="l07144"></a><span class="lineno"> 7144</span>     mslit_id = cpl_table_get_data_int   (maskslits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07145"></a><span class="lineno"> 7145</span>     xmtop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l07146"></a><span class="lineno"> 7146</span>     ymtop    = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l07147"></a><span class="lineno"> 7147</span>     xmbottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l07148"></a><span class="lineno"> 7148</span>     ymbottom = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l07149"></a><span class="lineno"> 7149</span>     xmcenter = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l07150"></a><span class="lineno"> 7150</span>     ymcenter = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l07151"></a><span class="lineno"> 7151</span> </div>
+<div class="line"><a name="l07152"></a><span class="lineno"> 7152</span> </div>
+<div class="line"><a name="l07153"></a><span class="lineno"> 7153</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07154"></a><span class="lineno"> 7154</span> <span class="comment">     * Transferring the valid slits information to the new table.</span></div>
+<div class="line"><a name="l07155"></a><span class="lineno"> 7155</span> <span class="comment">     * Note that invalid elements are coded as 0 in the internal</span></div>
+<div class="line"><a name="l07156"></a><span class="lineno"> 7156</span> <span class="comment">     * buffer, and this is the way they are recognised and excluded.</span></div>
+<div class="line"><a name="l07157"></a><span class="lineno"> 7157</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07158"></a><span class="lineno"> 7158</span> </div>
+<div class="line"><a name="l07159"></a><span class="lineno"> 7159</span>     k = 0;</div>
+<div class="line"><a name="l07160"></a><span class="lineno"> 7160</span>     cpl_table_fill_invalid_int(slits, <span class="stringliteral">"slit_id"</span>, 0);</div>
+<div class="line"><a name="l07161"></a><span class="lineno"> 7161</span>     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++) {</div>
+<div class="line"><a name="l07162"></a><span class="lineno"> 7162</span>         <span class="keywordflow">for</span> (j = 0; j < nslits; j++) {</div>
+<div class="line"><a name="l07163"></a><span class="lineno"> 7163</span>             <span class="keywordflow">if</span> (slit_id[j] == 0)</div>
+<div class="line"><a name="l07164"></a><span class="lineno"> 7164</span>                 <span class="keywordflow">continue</span>; <span class="comment">/* Skip invalid slit */</span></div>
+<div class="line"><a name="l07165"></a><span class="lineno"> 7165</span>             <span class="keywordflow">if</span> (mslit_id[i] == slit_id[j]) {</div>
+<div class="line"><a name="l07166"></a><span class="lineno"> 7166</span>                 cpl_table_set_int   (positions, <span class="stringliteral">"slit_id"</span>,  k, slit_id[j]);</div>
+<div class="line"><a name="l07167"></a><span class="lineno"> 7167</span> </div>
+<div class="line"><a name="l07168"></a><span class="lineno"> 7168</span>                 cpl_table_set_double(positions, <span class="stringliteral">"xtop"</span>,     k, xtop[j]);</div>
+<div class="line"><a name="l07169"></a><span class="lineno"> 7169</span>                 cpl_table_set_double(positions, <span class="stringliteral">"ytop"</span>,     k, ytop[j]);</div>
+<div class="line"><a name="l07170"></a><span class="lineno"> 7170</span>                 cpl_table_set_double(positions, <span class="stringliteral">"xbottom"</span>,  k, xbottom[j]);</div>
+<div class="line"><a name="l07171"></a><span class="lineno"> 7171</span>                 cpl_table_set_double(positions, <span class="stringliteral">"ybottom"</span>,  k, ybottom[j]);</div>
+<div class="line"><a name="l07172"></a><span class="lineno"> 7172</span>                 cpl_table_set_double(positions, <span class="stringliteral">"xcenter"</span>,  k, xcenter[j]);</div>
+<div class="line"><a name="l07173"></a><span class="lineno"> 7173</span>                 cpl_table_set_double(positions, <span class="stringliteral">"ycenter"</span>,  k, ycenter[j]);</div>
+<div class="line"><a name="l07174"></a><span class="lineno"> 7174</span> </div>
+<div class="line"><a name="l07175"></a><span class="lineno"> 7175</span>                 cpl_table_set_double(positions, <span class="stringliteral">"xmtop"</span>,    k, xmtop[i]);</div>
+<div class="line"><a name="l07176"></a><span class="lineno"> 7176</span>                 cpl_table_set_double(positions, <span class="stringliteral">"ymtop"</span>,    k, ymtop[i]);</div>
+<div class="line"><a name="l07177"></a><span class="lineno"> 7177</span>                 cpl_table_set_double(positions, <span class="stringliteral">"xmbottom"</span>, k, xmbottom[i]);</div>
+<div class="line"><a name="l07178"></a><span class="lineno"> 7178</span>                 cpl_table_set_double(positions, <span class="stringliteral">"ymbottom"</span>, k, ymbottom[i]);</div>
+<div class="line"><a name="l07179"></a><span class="lineno"> 7179</span>                 cpl_table_set_double(positions, <span class="stringliteral">"xmcenter"</span>, k, xmcenter[i]);</div>
+<div class="line"><a name="l07180"></a><span class="lineno"> 7180</span>                 cpl_table_set_double(positions, <span class="stringliteral">"ymcenter"</span>, k, ymcenter[i]);</div>
+<div class="line"><a name="l07181"></a><span class="lineno"> 7181</span> </div>
+<div class="line"><a name="l07182"></a><span class="lineno"> 7182</span>                 k++;</div>
+<div class="line"><a name="l07183"></a><span class="lineno"> 7183</span> </div>
+<div class="line"><a name="l07184"></a><span class="lineno"> 7184</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l07185"></a><span class="lineno"> 7185</span>             }</div>
+<div class="line"><a name="l07186"></a><span class="lineno"> 7186</span>         }</div>
+<div class="line"><a name="l07187"></a><span class="lineno"> 7187</span>     }</div>
+<div class="line"><a name="l07188"></a><span class="lineno"> 7188</span> </div>
+<div class="line"><a name="l07189"></a><span class="lineno"> 7189</span>     found_slits = k;</div>
+<div class="line"><a name="l07190"></a><span class="lineno"> 7190</span> </div>
+<div class="line"><a name="l07191"></a><span class="lineno"> 7191</span>     cpl_table_erase_column(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07192"></a><span class="lineno"> 7192</span>     cpl_table_erase_column(slits, <span class="stringliteral">"xpseudo"</span>);</div>
+<div class="line"><a name="l07193"></a><span class="lineno"> 7193</span>     cpl_table_erase_column(slits, <span class="stringliteral">"ypseudo"</span>);</div>
+<div class="line"><a name="l07194"></a><span class="lineno"> 7194</span>     cpl_table_erase_column(slits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l07195"></a><span class="lineno"> 7195</span>     cpl_table_erase_column(slits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l07196"></a><span class="lineno"> 7196</span>     cpl_table_erase_column(maskslits, <span class="stringliteral">"xpseudo"</span>);</div>
+<div class="line"><a name="l07197"></a><span class="lineno"> 7197</span>     cpl_table_erase_column(maskslits, <span class="stringliteral">"ypseudo"</span>);</div>
+<div class="line"><a name="l07198"></a><span class="lineno"> 7198</span>     cpl_table_erase_column(maskslits, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l07199"></a><span class="lineno"> 7199</span>     cpl_table_erase_column(maskslits, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l07200"></a><span class="lineno"> 7200</span> </div>
+<div class="line"><a name="l07201"></a><span class="lineno"> 7201</span> </div>
+<div class="line"><a name="l07202"></a><span class="lineno"> 7202</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07203"></a><span class="lineno"> 7203</span> <span class="comment">     * Find the median platescale and rotation angle from the identified </span></div>
+<div class="line"><a name="l07204"></a><span class="lineno"> 7204</span> <span class="comment">     * slits, and then exclude slits outlaying more than 10% from the </span></div>
+<div class="line"><a name="l07205"></a><span class="lineno"> 7205</span> <span class="comment">     * median platescale, and more than 2 degrees from the median</span></div>
+<div class="line"><a name="l07206"></a><span class="lineno"> 7206</span> <span class="comment">     * rotation angle.</span></div>
+<div class="line"><a name="l07207"></a><span class="lineno"> 7207</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07208"></a><span class="lineno"> 7208</span> </div>
+<div class="line"><a name="l07209"></a><span class="lineno"> 7209</span>     ytop    = cpl_table_get_data_double(positions, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l07210"></a><span class="lineno"> 7210</span>     ybottom = cpl_table_get_data_double(positions, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l07211"></a><span class="lineno"> 7211</span>     xcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"xcenter"</span>);</div>
+<div class="line"><a name="l07212"></a><span class="lineno"> 7212</span>     ycenter = cpl_table_get_data_double(positions, <span class="stringliteral">"ycenter"</span>);</div>
+<div class="line"><a name="l07213"></a><span class="lineno"> 7213</span>     xmcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"xmcenter"</span>);</div>
+<div class="line"><a name="l07214"></a><span class="lineno"> 7214</span>     ymcenter = cpl_table_get_data_double(positions, <span class="stringliteral">"ymcenter"</span>);</div>
+<div class="line"><a name="l07215"></a><span class="lineno"> 7215</span> </div>
+<div class="line"><a name="l07216"></a><span class="lineno"> 7216</span>     scales = cpl_vector_new(found_slits - 1);</div>
+<div class="line"><a name="l07217"></a><span class="lineno"> 7217</span>     dscale = cpl_vector_get_data(scales);</div>
+<div class="line"><a name="l07218"></a><span class="lineno"> 7218</span>     angles = cpl_vector_new(found_slits - 1);</div>
+<div class="line"><a name="l07219"></a><span class="lineno"> 7219</span>     dangle = cpl_vector_get_data(angles);</div>
+<div class="line"><a name="l07220"></a><span class="lineno"> 7220</span> </div>
+<div class="line"><a name="l07221"></a><span class="lineno"> 7221</span>     <span class="keywordflow">for</span> (i = 1; i < found_slits; i++) {</div>
+<div class="line"><a name="l07222"></a><span class="lineno"> 7222</span>         dist1 = (xcenter[i-1] - xcenter[i]) * (xcenter[i-1] - xcenter[i])</div>
+<div class="line"><a name="l07223"></a><span class="lineno"> 7223</span>               + (ycenter[i-1] - ycenter[i]) * (ycenter[i-1] - ycenter[i]);</div>
+<div class="line"><a name="l07224"></a><span class="lineno"> 7224</span>         dist2 = (xmcenter[i-1] - xmcenter[i]) * (xmcenter[i-1] - xmcenter[i])</div>
+<div class="line"><a name="l07225"></a><span class="lineno"> 7225</span>               + (ymcenter[i-1] - ymcenter[i]) * (ymcenter[i-1] - ymcenter[i]);</div>
+<div class="line"><a name="l07226"></a><span class="lineno"> 7226</span>         dscale[i-1] = sqrt(dist1/dist2);</div>
+<div class="line"><a name="l07227"></a><span class="lineno"> 7227</span>         dangle[i-1] = atan2(ycenter[i-1] - ycenter[i], </div>
+<div class="line"><a name="l07228"></a><span class="lineno"> 7228</span>                             xcenter[i-1] - xcenter[i])</div>
+<div class="line"><a name="l07229"></a><span class="lineno"> 7229</span>                     - atan2(ymcenter[i-1] - ymcenter[i], </div>
+<div class="line"><a name="l07230"></a><span class="lineno"> 7230</span>                             xmcenter[i-1] - xmcenter[i]);</div>
+<div class="line"><a name="l07231"></a><span class="lineno"> 7231</span>         dangle[i-1] *= 180;</div>
+<div class="line"><a name="l07232"></a><span class="lineno"> 7232</span>         dangle[i-1] /= pi;</div>
+<div class="line"><a name="l07233"></a><span class="lineno"> 7233</span>     }</div>
+<div class="line"><a name="l07234"></a><span class="lineno"> 7234</span> </div>
+<div class="line"><a name="l07235"></a><span class="lineno"> 7235</span>     minscale = cpl_vector_get_min(scales);</div>
+<div class="line"><a name="l07236"></a><span class="lineno"> 7236</span>     scale = cpl_vector_get_median_const(scales);</div>
+<div class="line"><a name="l07237"></a><span class="lineno"> 7237</span>     maxscale = cpl_vector_get_max(scales);</div>
+<div class="line"><a name="l07238"></a><span class="lineno"> 7238</span> </div>
+<div class="line"><a name="l07239"></a><span class="lineno"> 7239</span>     minangle = cpl_vector_get_min(angles);</div>
+<div class="line"><a name="l07240"></a><span class="lineno"> 7240</span>     angle = cpl_vector_get_median_const(angles);</div>
+<div class="line"><a name="l07241"></a><span class="lineno"> 7241</span>     maxangle = cpl_vector_get_max(angles);</div>
+<div class="line"><a name="l07242"></a><span class="lineno"> 7242</span> </div>
+<div class="line"><a name="l07243"></a><span class="lineno"> 7243</span>     cpl_msg_info(func, <span class="stringliteral">"Median platescale: %f pixel/mm"</span>, scale);</div>
+<div class="line"><a name="l07244"></a><span class="lineno"> 7244</span>     cpl_msg_info(func, <span class="stringliteral">"Minmax platescale: %f, %f pixel/mm"</span>, </div>
+<div class="line"><a name="l07245"></a><span class="lineno"> 7245</span>                  minscale, maxscale);</div>
+<div class="line"><a name="l07246"></a><span class="lineno"> 7246</span> </div>
+<div class="line"><a name="l07247"></a><span class="lineno"> 7247</span>     cpl_msg_info(func, <span class="stringliteral">"Median rotation: %f degrees"</span>, angle);</div>
+<div class="line"><a name="l07248"></a><span class="lineno"> 7248</span>     cpl_msg_info(func, <span class="stringliteral">"Minmax rotation: %f, %f degrees"</span>, </div>
+<div class="line"><a name="l07249"></a><span class="lineno"> 7249</span>                  minangle, maxangle);</div>
+<div class="line"><a name="l07250"></a><span class="lineno"> 7250</span> </div>
+<div class="line"><a name="l07251"></a><span class="lineno"> 7251</span>     good = cpl_table_get_data_int(positions, <span class="stringliteral">"good"</span>);</div>
+<div class="line"><a name="l07252"></a><span class="lineno"> 7252</span> </div>
+<div class="line"><a name="l07253"></a><span class="lineno"> 7253</span>     good[0] = good[found_slits - 1] = 1;</div>
+<div class="line"><a name="l07254"></a><span class="lineno"> 7254</span>     <span class="keywordflow">for</span> (i = 1; i < found_slits; i++) {</div>
+<div class="line"><a name="l07255"></a><span class="lineno"> 7255</span>         <span class="keywordflow">if</span> (fabs((dscale[i-1] - scale)/scale) < 0.10</div>
+<div class="line"><a name="l07256"></a><span class="lineno"> 7256</span>          && fabs(dangle[i-1] - angle) < 2) {</div>
+<div class="line"><a name="l07257"></a><span class="lineno"> 7257</span>             good[i-1]++;</div>
+<div class="line"><a name="l07258"></a><span class="lineno"> 7258</span>             good[i]++;</div>
+<div class="line"><a name="l07259"></a><span class="lineno"> 7259</span>         }</div>
+<div class="line"><a name="l07260"></a><span class="lineno"> 7260</span>     }</div>
+<div class="line"><a name="l07261"></a><span class="lineno"> 7261</span> </div>
+<div class="line"><a name="l07262"></a><span class="lineno"> 7262</span>     <span class="keywordflow">for</span> (i = 0; i < found_slits; i++) {</div>
+<div class="line"><a name="l07263"></a><span class="lineno"> 7263</span>         <span class="keywordflow">if</span> (good[i] < 2)</div>
+<div class="line"><a name="l07264"></a><span class="lineno"> 7264</span>             good[i] = 0;</div>
+<div class="line"><a name="l07265"></a><span class="lineno"> 7265</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l07266"></a><span class="lineno"> 7266</span>             good[i] = 1;</div>
+<div class="line"><a name="l07267"></a><span class="lineno"> 7267</span>     }</div>
+<div class="line"><a name="l07268"></a><span class="lineno"> 7268</span> </div>
+<div class="line"><a name="l07269"></a><span class="lineno"> 7269</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l07270"></a><span class="lineno"> 7270</span> <span class="comment">    for (i = 1; i < found_slits; i++)</span></div>
+<div class="line"><a name="l07271"></a><span class="lineno"> 7271</span> <span class="comment">        if (fabs((dscale[i-1] - scale)/scale) < 0.10)</span></div>
+<div class="line"><a name="l07272"></a><span class="lineno"> 7272</span> <span class="comment">            good[i-1] = good[i] = 1;</span></div>
+<div class="line"><a name="l07273"></a><span class="lineno"> 7273</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l07274"></a><span class="lineno"> 7274</span> </div>
+<div class="line"><a name="l07275"></a><span class="lineno"> 7275</span> <span class="comment">/* DEBUG ************+</span></div>
+<div class="line"><a name="l07276"></a><span class="lineno"> 7276</span> <span class="comment">    for (i = 0; i < found_slits; i++) {</span></div>
+<div class="line"><a name="l07277"></a><span class="lineno"> 7277</span> <span class="comment">        if (good[i]) {</span></div>
+<div class="line"><a name="l07278"></a><span class="lineno"> 7278</span> <span class="comment">            if (i == found_slits - 1)</span></div>
+<div class="line"><a name="l07279"></a><span class="lineno"> 7279</span> <span class="comment">                printf("include slit %d, prev = %f, %f\n", </span></div>
+<div class="line"><a name="l07280"></a><span class="lineno"> 7280</span> <span class="comment">                       i, dscale[i-1], dangle[i-1]);</span></div>
+<div class="line"><a name="l07281"></a><span class="lineno"> 7281</span> <span class="comment">            else if (i == 0)</span></div>
+<div class="line"><a name="l07282"></a><span class="lineno"> 7282</span> <span class="comment">                printf("include slit %d, next %f, %f\n", </span></div>
+<div class="line"><a name="l07283"></a><span class="lineno"> 7283</span> <span class="comment">                       i, dscale[i], dangle[i]);</span></div>
+<div class="line"><a name="l07284"></a><span class="lineno"> 7284</span> <span class="comment">            else</span></div>
+<div class="line"><a name="l07285"></a><span class="lineno"> 7285</span> <span class="comment">                printf("include slit %d, prev = %f, %f, next %f, %f\n", i, </span></div>
+<div class="line"><a name="l07286"></a><span class="lineno"> 7286</span> <span class="comment">                       dscale[i-1], dangle[i-1], dscale[i], dangle[i]);</span></div>
+<div class="line"><a name="l07287"></a><span class="lineno"> 7287</span> <span class="comment">        }</span></div>
+<div class="line"><a name="l07288"></a><span class="lineno"> 7288</span> <span class="comment">        else {</span></div>
+<div class="line"><a name="l07289"></a><span class="lineno"> 7289</span> <span class="comment">            if (i == found_slits - 1)</span></div>
+<div class="line"><a name="l07290"></a><span class="lineno"> 7290</span> <span class="comment">                printf("EXclude slit %d, prev = %f, %f\n", </span></div>
+<div class="line"><a name="l07291"></a><span class="lineno"> 7291</span> <span class="comment">                       i, dscale[i-1], dangle[i-1]);</span></div>
+<div class="line"><a name="l07292"></a><span class="lineno"> 7292</span> <span class="comment">            else if (i == 0)</span></div>
+<div class="line"><a name="l07293"></a><span class="lineno"> 7293</span> <span class="comment">                printf("EXclude slit %d, next %f, %f\n", </span></div>
+<div class="line"><a name="l07294"></a><span class="lineno"> 7294</span> <span class="comment">                       i, dscale[i], dangle[i]);</span></div>
+<div class="line"><a name="l07295"></a><span class="lineno"> 7295</span> <span class="comment">            else</span></div>
+<div class="line"><a name="l07296"></a><span class="lineno"> 7296</span> <span class="comment">                printf("EXclude slit %d, prev = %f, %f, next %f, %f\n", i,    </span></div>
+<div class="line"><a name="l07297"></a><span class="lineno"> 7297</span> <span class="comment">                       dscale[i-1], dangle[i-1], dscale[i], dangle[i]);</span></div>
+<div class="line"><a name="l07298"></a><span class="lineno"> 7298</span> <span class="comment">        }</span></div>
+<div class="line"><a name="l07299"></a><span class="lineno"> 7299</span> <span class="comment">    }</span></div>
+<div class="line"><a name="l07300"></a><span class="lineno"> 7300</span> <span class="comment">+*********** DEBUG */</span></div>
+<div class="line"><a name="l07301"></a><span class="lineno"> 7301</span> </div>
+<div class="line"><a name="l07302"></a><span class="lineno"> 7302</span>     cpl_vector_delete(scales);</div>
+<div class="line"><a name="l07303"></a><span class="lineno"> 7303</span>     cpl_vector_delete(angles);</div>
+<div class="line"><a name="l07304"></a><span class="lineno"> 7304</span> </div>
+<div class="line"><a name="l07305"></a><span class="lineno"> 7305</span>     cpl_table_and_selected_int(positions, <span class="stringliteral">"good"</span>, CPL_EQUAL_TO, 0);</div>
+<div class="line"><a name="l07306"></a><span class="lineno"> 7306</span>     cpl_table_erase_selected(positions);</div>
+<div class="line"><a name="l07307"></a><span class="lineno"> 7307</span>     cpl_table_erase_column(positions, <span class="stringliteral">"good"</span>);</div>
+<div class="line"><a name="l07308"></a><span class="lineno"> 7308</span>     found_slits = cpl_table_get_nrow(positions);</div>
+<div class="line"><a name="l07309"></a><span class="lineno"> 7309</span> </div>
+<div class="line"><a name="l07310"></a><span class="lineno"> 7310</span>     <span class="keywordflow">if</span> (found_slits < 4) {</div>
+<div class="line"><a name="l07311"></a><span class="lineno"> 7311</span> </div>
+<div class="line"><a name="l07312"></a><span class="lineno"> 7312</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l07313"></a><span class="lineno"> 7313</span> <span class="comment">         * If the self-consistency check gives such a poor result,</span></div>
+<div class="line"><a name="l07314"></a><span class="lineno"> 7314</span> <span class="comment">         * something must have gone really wrong in the preliminary</span></div>
+<div class="line"><a name="l07315"></a><span class="lineno"> 7315</span> <span class="comment">         * wavelength calibration... Nothing can be done.</span></div>
+<div class="line"><a name="l07316"></a><span class="lineno"> 7316</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l07317"></a><span class="lineno"> 7317</span> </div>
+<div class="line"><a name="l07318"></a><span class="lineno"> 7318</span>         cpl_msg_warning(func, <span class="stringliteral">"Too few safely identified slits: %d out of %d "</span></div>
+<div class="line"><a name="l07319"></a><span class="lineno"> 7319</span>                         <span class="stringliteral">"candidates (%d expected). Process will continue "</span></div>
+<div class="line"><a name="l07320"></a><span class="lineno"> 7320</span>                         <span class="stringliteral">"using the detected CCD slits positions"</span>, found_slits, </div>
+<div class="line"><a name="l07321"></a><span class="lineno"> 7321</span>                         nslits, nmaskslits);</div>
+<div class="line"><a name="l07322"></a><span class="lineno"> 7322</span>         cpl_table_delete(positions);</div>
+<div class="line"><a name="l07323"></a><span class="lineno"> 7323</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l07324"></a><span class="lineno"> 7324</span>     }</div>
+<div class="line"><a name="l07325"></a><span class="lineno"> 7325</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l07326"></a><span class="lineno"> 7326</span>         cpl_msg_info(func, <span class="stringliteral">"Safely identified slits: %d out of %d "</span></div>
+<div class="line"><a name="l07327"></a><span class="lineno"> 7327</span>                      <span class="stringliteral">"candidates\n(%d expected)"</span>, found_slits, nslits,</div>
+<div class="line"><a name="l07328"></a><span class="lineno"> 7328</span>                      nmaskslits);</div>
+<div class="line"><a name="l07329"></a><span class="lineno"> 7329</span>     }</div>
+<div class="line"><a name="l07330"></a><span class="lineno"> 7330</span> </div>
+<div class="line"><a name="l07331"></a><span class="lineno"> 7331</span> </div>
+<div class="line"><a name="l07332"></a><span class="lineno"> 7332</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07333"></a><span class="lineno"> 7333</span> <span class="comment">     * Now select the central points of the identified slits, and</span></div>
+<div class="line"><a name="l07334"></a><span class="lineno"> 7334</span> <span class="comment">     * fit two bivariate polynomials to determine a first approximate</span></div>
+<div class="line"><a name="l07335"></a><span class="lineno"> 7335</span> <span class="comment">     * relation between positions on the mask and positions on the CCD.</span></div>
+<div class="line"><a name="l07336"></a><span class="lineno"> 7336</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07337"></a><span class="lineno"> 7337</span> </div>
+<div class="line"><a name="l07338"></a><span class="lineno"> 7338</span>     xpos = cpl_vector_wrap(found_slits, </div>
+<div class="line"><a name="l07339"></a><span class="lineno"> 7339</span>                            cpl_table_get_data_double(positions, <span class="stringliteral">"xcenter"</span>));</div>
+<div class="line"><a name="l07340"></a><span class="lineno"> 7340</span>     ypos = cpl_vector_wrap(found_slits, </div>
+<div class="line"><a name="l07341"></a><span class="lineno"> 7341</span>                            cpl_table_get_data_double(positions, <span class="stringliteral">"ycenter"</span>));</div>
+<div class="line"><a name="l07342"></a><span class="lineno"> 7342</span>     xmpos = cpl_vector_wrap(found_slits, </div>
+<div class="line"><a name="l07343"></a><span class="lineno"> 7343</span>                             cpl_table_get_data_double(positions, <span class="stringliteral">"xmcenter"</span>));</div>
+<div class="line"><a name="l07344"></a><span class="lineno"> 7344</span>     ympos = cpl_vector_wrap(found_slits, </div>
+<div class="line"><a name="l07345"></a><span class="lineno"> 7345</span>                             cpl_table_get_data_double(positions, <span class="stringliteral">"ymcenter"</span>));</div>
+<div class="line"><a name="l07346"></a><span class="lineno"> 7346</span>     mpos = cpl_bivector_wrap_vectors(xmpos, ympos);</div>
+<div class="line"><a name="l07347"></a><span class="lineno"> 7347</span> </div>
+<div class="line"><a name="l07348"></a><span class="lineno"> 7348</span>     <span class="keywordflow">if</span> (found_slits < 10)</div>
+<div class="line"><a name="l07349"></a><span class="lineno"> 7349</span>         degree = 1;</div>
+<div class="line"><a name="l07350"></a><span class="lineno"> 7350</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l07351"></a><span class="lineno"> 7351</span>         degree = 2;</div>
+<div class="line"><a name="l07352"></a><span class="lineno"> 7352</span> </div>
+<div class="line"><a name="l07353"></a><span class="lineno"> 7353</span>     xpoly = cpl_polynomial_fit_2d_create(mpos, xpos, degree, &xmse);</div>
+<div class="line"><a name="l07354"></a><span class="lineno"> 7354</span>     <span class="keywordflow">if</span> (xpoly != NULL)</div>
+<div class="line"><a name="l07355"></a><span class="lineno"> 7355</span>         ypoly = cpl_polynomial_fit_2d_create(mpos, ypos, degree, &ymse);</div>
+<div class="line"><a name="l07356"></a><span class="lineno"> 7356</span>     cpl_bivector_unwrap_vectors(mpos);</div>
+<div class="line"><a name="l07357"></a><span class="lineno"> 7357</span>     cpl_vector_unwrap(xpos);</div>
+<div class="line"><a name="l07358"></a><span class="lineno"> 7358</span>     cpl_vector_unwrap(ypos);</div>
+<div class="line"><a name="l07359"></a><span class="lineno"> 7359</span>     cpl_vector_unwrap(xmpos);</div>
+<div class="line"><a name="l07360"></a><span class="lineno"> 7360</span>     cpl_vector_unwrap(ympos);</div>
+<div class="line"><a name="l07361"></a><span class="lineno"> 7361</span>     <span class="keywordflow">if</span> (ypoly == NULL) {</div>
+<div class="line"><a name="l07362"></a><span class="lineno"> 7362</span>         <span class="keywordflow">if</span> (found_slits == nmaskslits) {</div>
+<div class="line"><a name="l07363"></a><span class="lineno"> 7363</span>             cpl_msg_warning(func, <span class="stringliteral">"Fit failure: the accuracy of the "</span></div>
+<div class="line"><a name="l07364"></a><span class="lineno"> 7364</span>                             <span class="stringliteral">"identified slits positions is not improved."</span>);</div>
+<div class="line"><a name="l07365"></a><span class="lineno"> 7365</span> </div>
+<div class="line"><a name="l07366"></a><span class="lineno"> 7366</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l07367"></a><span class="lineno"> 7367</span> <span class="comment">             * The determination of the transformation from mask to CCD</span></div>
+<div class="line"><a name="l07368"></a><span class="lineno"> 7368</span> <span class="comment">             * failed, but since all slits have been already identified</span></div>
+<div class="line"><a name="l07369"></a><span class="lineno"> 7369</span> <span class="comment">             * this is not a problem: data can be reduced also without</span></div>
+<div class="line"><a name="l07370"></a><span class="lineno"> 7370</span> <span class="comment">             * such transformation. Simply the accuracy of the slits </span></div>
+<div class="line"><a name="l07371"></a><span class="lineno"> 7371</span> <span class="comment">             * positions cannot be improved.</span></div>
+<div class="line"><a name="l07372"></a><span class="lineno"> 7372</span> <span class="comment">             */</span> </div>
+<div class="line"><a name="l07373"></a><span class="lineno"> 7373</span> </div>
+<div class="line"><a name="l07374"></a><span class="lineno"> 7374</span>         } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l07375"></a><span class="lineno"> 7375</span>             cpl_msg_info(func, <span class="stringliteral">"Fit failure: not all slits have been "</span></div>
+<div class="line"><a name="l07376"></a><span class="lineno"> 7376</span>                          <span class="stringliteral">"identified. Process will continue using "</span></div>
+<div class="line"><a name="l07377"></a><span class="lineno"> 7377</span>                          <span class="stringliteral">"the detected CCD slits positions"</span>);</div>
+<div class="line"><a name="l07378"></a><span class="lineno"> 7378</span>         }</div>
+<div class="line"><a name="l07379"></a><span class="lineno"> 7379</span> </div>
+<div class="line"><a name="l07380"></a><span class="lineno"> 7380</span>         cpl_polynomial_delete(xpoly);</div>
+<div class="line"><a name="l07381"></a><span class="lineno"> 7381</span>         <span class="keywordflow">return</span> positions;</div>
+<div class="line"><a name="l07382"></a><span class="lineno"> 7382</span>     }</div>
+<div class="line"><a name="l07383"></a><span class="lineno"> 7383</span> </div>
+<div class="line"><a name="l07384"></a><span class="lineno"> 7384</span>     cpl_msg_info(func, <span class="stringliteral">"Fit successful: X rms = %.3g, Y rms = %.3g (pixel)"</span>, </div>
+<div class="line"><a name="l07385"></a><span class="lineno"> 7385</span>                  sqrt(xmse), sqrt(ymse));</div>
+<div class="line"><a name="l07386"></a><span class="lineno"> 7386</span> </div>
+<div class="line"><a name="l07387"></a><span class="lineno"> 7387</span>     <span class="keywordflow">if</span> (global) {</div>
+<div class="line"><a name="l07388"></a><span class="lineno"> 7388</span>         write_global_distortion(global, 0, xpoly);</div>
+<div class="line"><a name="l07389"></a><span class="lineno"> 7389</span>         write_global_distortion(global, 7, ypoly);</div>
+<div class="line"><a name="l07390"></a><span class="lineno"> 7390</span>     }</div>
+<div class="line"><a name="l07391"></a><span class="lineno"> 7391</span> </div>
+<div class="line"><a name="l07392"></a><span class="lineno"> 7392</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07393"></a><span class="lineno"> 7393</span> <span class="comment">     * The fit was successful: use the polynomials to obtain a new </span></div>
+<div class="line"><a name="l07394"></a><span class="lineno"> 7394</span> <span class="comment">     * position table with the improved positions of the slits</span></div>
+<div class="line"><a name="l07395"></a><span class="lineno"> 7395</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07396"></a><span class="lineno"> 7396</span> </div>
+<div class="line"><a name="l07397"></a><span class="lineno"> 7397</span>     cpl_table_delete(positions);</div>
+<div class="line"><a name="l07398"></a><span class="lineno"> 7398</span> </div>
+<div class="line"><a name="l07399"></a><span class="lineno"> 7399</span>     positions = cpl_table_duplicate(maskslits);</div>
+<div class="line"><a name="l07400"></a><span class="lineno"> 7400</span>     cpl_table_duplicate_column(positions, <span class="stringliteral">"xmtop"</span>, positions, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l07401"></a><span class="lineno"> 7401</span>     cpl_table_duplicate_column(positions, <span class="stringliteral">"ymtop"</span>, positions, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l07402"></a><span class="lineno"> 7402</span>     cpl_table_duplicate_column(positions, <span class="stringliteral">"xmbottom"</span>, positions, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l07403"></a><span class="lineno"> 7403</span>     cpl_table_duplicate_column(positions, <span class="stringliteral">"ymbottom"</span>, positions, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l07404"></a><span class="lineno"> 7404</span> </div>
+<div class="line"><a name="l07405"></a><span class="lineno"> 7405</span>     point = cpl_vector_new(2);</div>
+<div class="line"><a name="l07406"></a><span class="lineno"> 7406</span>     dpoint = cpl_vector_get_data(point);</div>
+<div class="line"><a name="l07407"></a><span class="lineno"> 7407</span> </div>
+<div class="line"><a name="l07408"></a><span class="lineno"> 7408</span>     <span class="keywordflow">for</span> (i = 0; i < nmaskslits; i++) {</div>
+<div class="line"><a name="l07409"></a><span class="lineno"> 7409</span>         dpoint[0] = cpl_table_get_double(positions, <span class="stringliteral">"xmtop"</span>, i, NULL);</div>
+<div class="line"><a name="l07410"></a><span class="lineno"> 7410</span>         dpoint[1] = cpl_table_get_double(positions, <span class="stringliteral">"ymtop"</span>, i, NULL);</div>
+<div class="line"><a name="l07411"></a><span class="lineno"> 7411</span>         cpl_table_set_double(positions, <span class="stringliteral">"xtop"</span>, i, </div>
+<div class="line"><a name="l07412"></a><span class="lineno"> 7412</span>                              cpl_polynomial_eval(xpoly, point));</div>
+<div class="line"><a name="l07413"></a><span class="lineno"> 7413</span>         cpl_table_set_double(positions, <span class="stringliteral">"ytop"</span>, i, </div>
+<div class="line"><a name="l07414"></a><span class="lineno"> 7414</span>                              cpl_polynomial_eval(ypoly, point));</div>
+<div class="line"><a name="l07415"></a><span class="lineno"> 7415</span>         dpoint[0] = cpl_table_get_double(positions, <span class="stringliteral">"xmbottom"</span>, i, NULL);</div>
+<div class="line"><a name="l07416"></a><span class="lineno"> 7416</span>         dpoint[1] = cpl_table_get_double(positions, <span class="stringliteral">"ymbottom"</span>, i, NULL);</div>
+<div class="line"><a name="l07417"></a><span class="lineno"> 7417</span>         cpl_table_set_double(positions, <span class="stringliteral">"xbottom"</span>, i, </div>
+<div class="line"><a name="l07418"></a><span class="lineno"> 7418</span>                              cpl_polynomial_eval(xpoly, point));</div>
+<div class="line"><a name="l07419"></a><span class="lineno"> 7419</span>         cpl_table_set_double(positions, <span class="stringliteral">"ybottom"</span>, i, </div>
+<div class="line"><a name="l07420"></a><span class="lineno"> 7420</span>                              cpl_polynomial_eval(ypoly, point));</div>
+<div class="line"><a name="l07421"></a><span class="lineno"> 7421</span>     }</div>
+<div class="line"><a name="l07422"></a><span class="lineno"> 7422</span> </div>
+<div class="line"><a name="l07423"></a><span class="lineno"> 7423</span>     cpl_vector_delete(point);</div>
+<div class="line"><a name="l07424"></a><span class="lineno"> 7424</span>     cpl_polynomial_delete(xpoly);</div>
+<div class="line"><a name="l07425"></a><span class="lineno"> 7425</span>     cpl_polynomial_delete(ypoly);</div>
+<div class="line"><a name="l07426"></a><span class="lineno"> 7426</span> </div>
+<div class="line"><a name="l07427"></a><span class="lineno"> 7427</span>     cpl_table_erase_column(positions, <span class="stringliteral">"xmtop"</span>);</div>
+<div class="line"><a name="l07428"></a><span class="lineno"> 7428</span>     cpl_table_erase_column(positions, <span class="stringliteral">"ymtop"</span>);</div>
+<div class="line"><a name="l07429"></a><span class="lineno"> 7429</span>     cpl_table_erase_column(positions, <span class="stringliteral">"xmbottom"</span>);</div>
+<div class="line"><a name="l07430"></a><span class="lineno"> 7430</span>     cpl_table_erase_column(positions, <span class="stringliteral">"ymbottom"</span>);</div>
+<div class="line"><a name="l07431"></a><span class="lineno"> 7431</span> </div>
+<div class="line"><a name="l07432"></a><span class="lineno"> 7432</span>     <span class="keywordflow">if</span> (nmaskslits > nslits)</div>
+<div class="line"><a name="l07433"></a><span class="lineno"> 7433</span>         cpl_msg_info(func, <span class="stringliteral">"Finally identified slits: %d out of %d expected\n"</span></div>
+<div class="line"><a name="l07434"></a><span class="lineno"> 7434</span>                  <span class="stringliteral">"(%d recovered)"</span>, nmaskslits, nmaskslits, nmaskslits - nslits);</div>
+<div class="line"><a name="l07435"></a><span class="lineno"> 7435</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nmaskslits < nslits)</div>
+<div class="line"><a name="l07436"></a><span class="lineno"> 7436</span>         cpl_msg_info(func, <span class="stringliteral">"Finally identified slits: %d out of %d expected\n"</span></div>
+<div class="line"><a name="l07437"></a><span class="lineno"> 7437</span>                  <span class="stringliteral">"(%d rejected)"</span>, nmaskslits, nmaskslits, nslits - nmaskslits);</div>
+<div class="line"><a name="l07438"></a><span class="lineno"> 7438</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l07439"></a><span class="lineno"> 7439</span>         cpl_msg_info(func, <span class="stringliteral">"Finally identified slits: %d out of %d expected"</span>,</div>
+<div class="line"><a name="l07440"></a><span class="lineno"> 7440</span>                  nmaskslits, nmaskslits);</div>
+<div class="line"><a name="l07441"></a><span class="lineno"> 7441</span> </div>
+<div class="line"><a name="l07442"></a><span class="lineno"> 7442</span>     <span class="keywordflow">return</span> positions;</div>
+<div class="line"><a name="l07443"></a><span class="lineno"> 7443</span> }</div>
+<div class="line"><a name="l07444"></a><span class="lineno"> 7444</span> </div>
+<div class="line"><a name="l07445"></a><span class="lineno"> 7445</span> </div>
+<div class="line"><a name="l07487"></a><span class="lineno"><a class="code" href="group__moses.html#gaad02c30291fd30d07156ac8f397f439f"> 7487</a></span> cpl_table *<a class="code" href="group__moses.html#gaad02c30291fd30d07156ac8f397f439f" title="Trace flat field spectra.">mos_trace_flat</a>(cpl_image *flat, cpl_table *slits, <span class="keywordtype">double</span> reference,</div>
+<div class="line"><a name="l07488"></a><span class="lineno"> 7488</span>                           <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion)</div>
+<div class="line"><a name="l07489"></a><span class="lineno"> 7489</span> {</div>
+<div class="line"><a name="l07490"></a><span class="lineno"> 7490</span> </div>
+<div class="line"><a name="l07491"></a><span class="lineno"> 7491</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *func = <span class="stringliteral">"mos_trace_flat"</span>;</div>
+<div class="line"><a name="l07492"></a><span class="lineno"> 7492</span> </div>
+<div class="line"><a name="l07493"></a><span class="lineno"> 7493</span>     cpl_image   *gradient;</div>
+<div class="line"><a name="l07494"></a><span class="lineno"> 7494</span>     cpl_image   *sgradient;</div>
+<div class="line"><a name="l07495"></a><span class="lineno"> 7495</span>     <span class="keywordtype">float</span>       *dgradient;</div>
+<div class="line"><a name="l07496"></a><span class="lineno"> 7496</span>     <span class="keywordtype">float</span>        level = 500;   <span class="comment">/* It was 250... */</span></div>
+<div class="line"><a name="l07497"></a><span class="lineno"> 7497</span>     cpl_vector  *row;</div>
+<div class="line"><a name="l07498"></a><span class="lineno"> 7498</span>     cpl_vector  *srow;</div>
+<div class="line"><a name="l07499"></a><span class="lineno"> 7499</span>     cpl_vector **peaks;</div>
+<div class="line"><a name="l07500"></a><span class="lineno"> 7500</span>     <span class="keywordtype">double</span>      *peak;</div>
+<div class="line"><a name="l07501"></a><span class="lineno"> 7501</span>     <span class="keywordtype">int</span>         *slit_id;</div>
+<div class="line"><a name="l07502"></a><span class="lineno"> 7502</span>     <span class="keywordtype">float</span>       *g;</div>
+<div class="line"><a name="l07503"></a><span class="lineno"> 7503</span>     <span class="keywordtype">double</span>      *r;</div>
+<div class="line"><a name="l07504"></a><span class="lineno"> 7504</span>     <span class="keywordtype">double</span>      *xtop;</div>
+<div class="line"><a name="l07505"></a><span class="lineno"> 7505</span>     <span class="keywordtype">double</span>      *ytop;</div>
+<div class="line"><a name="l07506"></a><span class="lineno"> 7506</span>     <span class="keywordtype">double</span>      *xbottom;</div>
+<div class="line"><a name="l07507"></a><span class="lineno"> 7507</span>     <span class="keywordtype">double</span>      *ybottom;</div>
+<div class="line"><a name="l07508"></a><span class="lineno"> 7508</span>     <span class="keywordtype">double</span>       min, dist;</div>
+<div class="line"><a name="l07509"></a><span class="lineno"> 7509</span>     <span class="keywordtype">double</span>       sradius;</div>
+<div class="line"><a name="l07510"></a><span class="lineno"> 7510</span>     <span class="keywordtype">double</span>       tolerance;</div>
+<div class="line"><a name="l07511"></a><span class="lineno"> 7511</span>     <span class="keywordtype">double</span>       start_y, prev_y;</div>
+<div class="line"><a name="l07512"></a><span class="lineno"> 7512</span>     <span class="keywordtype">int</span>          minpos;</div>
+<div class="line"><a name="l07513"></a><span class="lineno"> 7513</span>     <span class="keywordtype">int</span>          nslits;</div>
+<div class="line"><a name="l07514"></a><span class="lineno"> 7514</span>     <span class="keywordtype">int</span>          nrows;</div>
+<div class="line"><a name="l07515"></a><span class="lineno"> 7515</span>     <span class="keywordtype">int</span>          step = 10;</div>
+<div class="line"><a name="l07516"></a><span class="lineno"> 7516</span>     <span class="keywordtype">int</span>          filtbox = 15;</div>
+<div class="line"><a name="l07517"></a><span class="lineno"> 7517</span>     <span class="keywordtype">int</span>          nx, ny, npix;</div>
+<div class="line"><a name="l07518"></a><span class="lineno"> 7518</span>     <span class="keywordtype">int</span>          pos, ypos;</div>
+<div class="line"><a name="l07519"></a><span class="lineno"> 7519</span>     <span class="keywordtype">int</span>          npeaks;</div>
+<div class="line"><a name="l07520"></a><span class="lineno"> 7520</span>     <span class="keywordtype">int</span>          pixel_above, pixel_below;</div>
+<div class="line"><a name="l07521"></a><span class="lineno"> 7521</span>     <span class="keywordtype">int</span>          i, j, k, l;</div>
+<div class="line"><a name="l07522"></a><span class="lineno"> 7522</span>     <span class="keywordtype">char</span>         trace_id[MAX_COLNAME];</div>
+<div class="line"><a name="l07523"></a><span class="lineno"> 7523</span> </div>
+<div class="line"><a name="l07524"></a><span class="lineno"> 7524</span>     cpl_table   *traces;</div>
+<div class="line"><a name="l07525"></a><span class="lineno"> 7525</span> </div>
+<div class="line"><a name="l07526"></a><span class="lineno"> 7526</span> </div>
+<div class="line"><a name="l07527"></a><span class="lineno"> 7527</span>     <span class="keywordflow">if</span> (flat == NULL || slits == NULL) {</div>
+<div class="line"><a name="l07528"></a><span class="lineno"> 7528</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l07529"></a><span class="lineno"> 7529</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l07530"></a><span class="lineno"> 7530</span>     }</div>
+<div class="line"><a name="l07531"></a><span class="lineno"> 7531</span> </div>
+<div class="line"><a name="l07532"></a><span class="lineno"> 7532</span>     <span class="keywordflow">if</span> (dispersion <= 0.0) {</div>
+<div class="line"><a name="l07533"></a><span class="lineno"> 7533</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l07534"></a><span class="lineno"> 7534</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l07535"></a><span class="lineno"> 7535</span>     }</div>
+<div class="line"><a name="l07536"></a><span class="lineno"> 7536</span> </div>
+<div class="line"><a name="l07537"></a><span class="lineno"> 7537</span>     <span class="keywordflow">if</span> (red - blue < dispersion) {</div>
+<div class="line"><a name="l07538"></a><span class="lineno"> 7538</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l07539"></a><span class="lineno"> 7539</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l07540"></a><span class="lineno"> 7540</span>     }</div>
+<div class="line"><a name="l07541"></a><span class="lineno"> 7541</span> </div>
+<div class="line"><a name="l07542"></a><span class="lineno"> 7542</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07543"></a><span class="lineno"> 7543</span> <span class="comment">     * Create a dummy slit_id column if it is missing in the</span></div>
+<div class="line"><a name="l07544"></a><span class="lineno"> 7544</span> <span class="comment">     * input slits table</span></div>
+<div class="line"><a name="l07545"></a><span class="lineno"> 7545</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07546"></a><span class="lineno"> 7546</span> </div>
+<div class="line"><a name="l07547"></a><span class="lineno"> 7547</span>     nslits  = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l07548"></a><span class="lineno"> 7548</span>     <span class="keywordflow">if</span> (1 != cpl_table_has_column(slits, <span class="stringliteral">"slit_id"</span>)) {</div>
+<div class="line"><a name="l07549"></a><span class="lineno"> 7549</span>         cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l07550"></a><span class="lineno"> 7550</span>         <span class="keywordflow">for</span> (i = 0; i < nslits; i++)</div>
+<div class="line"><a name="l07551"></a><span class="lineno"> 7551</span>             cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, i, -(i+1));  <span class="comment">/* it was (i+1) */</span></div>
+<div class="line"><a name="l07552"></a><span class="lineno"> 7552</span>     }</div>
+<div class="line"><a name="l07553"></a><span class="lineno"> 7553</span> </div>
+<div class="line"><a name="l07554"></a><span class="lineno"> 7554</span>     slit_id = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07555"></a><span class="lineno"> 7555</span> </div>
+<div class="line"><a name="l07556"></a><span class="lineno"> 7556</span>     nx = cpl_image_get_size_x(flat);</div>
+<div class="line"><a name="l07557"></a><span class="lineno"> 7557</span>     ny = cpl_image_get_size_y(flat);</div>
+<div class="line"><a name="l07558"></a><span class="lineno"> 7558</span>     npix = nx * ny;</div>
+<div class="line"><a name="l07559"></a><span class="lineno"> 7559</span> </div>
+<div class="line"><a name="l07560"></a><span class="lineno"> 7560</span>     gradient = cpl_image_duplicate(flat);</div>
+<div class="line"><a name="l07561"></a><span class="lineno"> 7561</span>     dgradient = cpl_image_get_data_float(gradient);</div>
+<div class="line"><a name="l07562"></a><span class="lineno"> 7562</span> </div>
+<div class="line"><a name="l07563"></a><span class="lineno"> 7563</span>     <span class="keywordflow">for</span> (i = 0; i < ny - 1; i++) {</div>
+<div class="line"><a name="l07564"></a><span class="lineno"> 7564</span>         k = i * nx;</div>
+<div class="line"><a name="l07565"></a><span class="lineno"> 7565</span>         <span class="keywordflow">for</span> (j = 0; j < nx; j++) {</div>
+<div class="line"><a name="l07566"></a><span class="lineno"> 7566</span>             l = k + j;</div>
+<div class="line"><a name="l07567"></a><span class="lineno"> 7567</span>             dgradient[l] = fabs(dgradient[l] - dgradient[l + nx]);</div>
+<div class="line"><a name="l07568"></a><span class="lineno"> 7568</span>         }</div>
+<div class="line"><a name="l07569"></a><span class="lineno"> 7569</span>     }</div>
+<div class="line"><a name="l07570"></a><span class="lineno"> 7570</span> </div>
+<div class="line"><a name="l07571"></a><span class="lineno"> 7571</span>     npix--;</div>
+<div class="line"><a name="l07572"></a><span class="lineno"> 7572</span>     <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l07573"></a><span class="lineno"> 7573</span>         dgradient[npix - j] = 0.0;</div>
+<div class="line"><a name="l07574"></a><span class="lineno"> 7574</span> </div>
+<div class="line"><a name="l07575"></a><span class="lineno"> 7575</span>     cpl_image_turn(gradient, -1);</div>
+<div class="line"><a name="l07576"></a><span class="lineno"> 7576</span>     nx = cpl_image_get_size_x(gradient);</div>
+<div class="line"><a name="l07577"></a><span class="lineno"> 7577</span>     ny = cpl_image_get_size_y(gradient);</div>
+<div class="line"><a name="l07578"></a><span class="lineno"> 7578</span>     sgradient = mos_image_vertical_median_filter(gradient, </div>
+<div class="line"><a name="l07579"></a><span class="lineno"> 7579</span>                                                  filtbox, 0, ny, 0, step);</div>
+<div class="line"><a name="l07580"></a><span class="lineno"> 7580</span>     cpl_image_delete(gradient);</div>
+<div class="line"><a name="l07581"></a><span class="lineno"> 7581</span> </div>
+<div class="line"><a name="l07582"></a><span class="lineno"> 7582</span> </div>
+<div class="line"><a name="l07583"></a><span class="lineno"> 7583</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07584"></a><span class="lineno"> 7584</span> <span class="comment">     * Remove background from processed image rows</span></div>
+<div class="line"><a name="l07585"></a><span class="lineno"> 7585</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07586"></a><span class="lineno"> 7586</span> </div>
+<div class="line"><a name="l07587"></a><span class="lineno"> 7587</span>     dgradient = cpl_image_get_data_float(sgradient);</div>
+<div class="line"><a name="l07588"></a><span class="lineno"> 7588</span> </div>
+<div class="line"><a name="l07589"></a><span class="lineno"> 7589</span>     <span class="keywordflow">for</span> (i = 1; i <= ny; i += step) {</div>
+<div class="line"><a name="l07590"></a><span class="lineno"> 7590</span>         row = cpl_vector_new_from_image_row(sgradient, i);</div>
+<div class="line"><a name="l07591"></a><span class="lineno"> 7591</span>         srow = cpl_vector_filter_median_create(row, filtbox);</div>
+<div class="line"><a name="l07592"></a><span class="lineno"> 7592</span>         cpl_vector_subtract(row, srow);</div>
+<div class="line"><a name="l07593"></a><span class="lineno"> 7593</span>         cpl_vector_delete(srow);</div>
+<div class="line"><a name="l07594"></a><span class="lineno"> 7594</span>         g = dgradient + (i-1)*nx;</div>
+<div class="line"><a name="l07595"></a><span class="lineno"> 7595</span>         r = cpl_vector_get_data(row);</div>
+<div class="line"><a name="l07596"></a><span class="lineno"> 7596</span>         <span class="keywordflow">for</span> (j = 0; j < nx; j++)</div>
+<div class="line"><a name="l07597"></a><span class="lineno"> 7597</span>             g[j] = r[j];</div>
+<div class="line"><a name="l07598"></a><span class="lineno"> 7598</span>         cpl_vector_delete(row);</div>
+<div class="line"><a name="l07599"></a><span class="lineno"> 7599</span>     }</div>
+<div class="line"><a name="l07600"></a><span class="lineno"> 7600</span> </div>
+<div class="line"><a name="l07601"></a><span class="lineno"> 7601</span> </div>
+<div class="line"><a name="l07602"></a><span class="lineno"> 7602</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07603"></a><span class="lineno"> 7603</span> <span class="comment">     * Rotate (temporarily) the input slits table, to get coordinates</span></div>
+<div class="line"><a name="l07604"></a><span class="lineno"> 7604</span> <span class="comment">     * compatible with the rotated gradient image.</span></div>
+<div class="line"><a name="l07605"></a><span class="lineno"> 7605</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07606"></a><span class="lineno"> 7606</span> </div>
+<div class="line"><a name="l07607"></a><span class="lineno"> 7607</span>     <a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f" title="Rotate a slit location table.">mos_rotate_slits</a>(slits, 1, nx, ny);</div>
+<div class="line"><a name="l07608"></a><span class="lineno"> 7608</span>     xtop    = cpl_table_get_data_double(slits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l07609"></a><span class="lineno"> 7609</span>     ytop    = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l07610"></a><span class="lineno"> 7610</span>     xbottom = cpl_table_get_data_double(slits, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l07611"></a><span class="lineno"> 7611</span>     ybottom = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l07612"></a><span class="lineno"> 7612</span> </div>
+<div class="line"><a name="l07613"></a><span class="lineno"> 7613</span> </div>
+<div class="line"><a name="l07614"></a><span class="lineno"> 7614</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07615"></a><span class="lineno"> 7615</span> <span class="comment">     * Get positions of peaks candidates for each processed gradient</span></div>
+<div class="line"><a name="l07616"></a><span class="lineno"> 7616</span> <span class="comment">     * image row</span></div>
+<div class="line"><a name="l07617"></a><span class="lineno"> 7617</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07618"></a><span class="lineno"> 7618</span> </div>
+<div class="line"><a name="l07619"></a><span class="lineno"> 7619</span>     peaks = cpl_calloc(ny, <span class="keyword">sizeof</span>(cpl_vector *));</div>
+<div class="line"><a name="l07620"></a><span class="lineno"> 7620</span> </div>
+<div class="line"><a name="l07621"></a><span class="lineno"> 7621</span>     <span class="keywordflow">for</span> (i = 0; i < ny; i += step) {</div>
+<div class="line"><a name="l07622"></a><span class="lineno"> 7622</span>         g = dgradient + i*nx;</div>
+<div class="line"><a name="l07623"></a><span class="lineno"> 7623</span>         peaks[i] = <a class="code" href="group__moses.html#gad80729870e3acf9f61c820f488eb83b2" title="Find positions of peaks candidates.">mos_peak_candidates</a>(g, nx, level, 1.0);</div>
+<div class="line"><a name="l07624"></a><span class="lineno"> 7624</span> </div>
+<div class="line"><a name="l07625"></a><span class="lineno"> 7625</span>         <span class="comment">/* I thought this would be required, but apparently I was wrong.</span></div>
+<div class="line"><a name="l07626"></a><span class="lineno"> 7626</span> <span class="comment">         * Check twice... */</span></div>
+<div class="line"><a name="l07627"></a><span class="lineno"> 7627</span>         <span class="keywordflow">if</span> (peaks[i])</div>
+<div class="line"><a name="l07628"></a><span class="lineno"> 7628</span>             cpl_vector_subtract_scalar(peaks[i], 0.5);</div>
+<div class="line"><a name="l07629"></a><span class="lineno"> 7629</span>          </div>
+<div class="line"><a name="l07630"></a><span class="lineno"> 7630</span>     }</div>
+<div class="line"><a name="l07631"></a><span class="lineno"> 7631</span> </div>
+<div class="line"><a name="l07632"></a><span class="lineno"> 7632</span>     cpl_image_delete(sgradient);</div>
+<div class="line"><a name="l07633"></a><span class="lineno"> 7633</span> </div>
+<div class="line"><a name="l07634"></a><span class="lineno"> 7634</span> </div>
+<div class="line"><a name="l07635"></a><span class="lineno"> 7635</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07636"></a><span class="lineno"> 7636</span> <span class="comment">     * Tracing the flat field spectra edges, starting from the</span></div>
+<div class="line"><a name="l07637"></a><span class="lineno"> 7637</span> <span class="comment">     * slits positions obtained at reference wavelength. The </span></div>
+<div class="line"><a name="l07638"></a><span class="lineno"> 7638</span> <span class="comment">     * gradient maximum closest to each slits ends is found and</span></div>
+<div class="line"><a name="l07639"></a><span class="lineno"> 7639</span> <span class="comment">     * accepted only within a given search radius:</span></div>
+<div class="line"><a name="l07640"></a><span class="lineno"> 7640</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07641"></a><span class="lineno"> 7641</span> </div>
+<div class="line"><a name="l07642"></a><span class="lineno"> 7642</span>     sradius = 5.0;  <span class="comment">/* Pixel */</span></div>
+<div class="line"><a name="l07643"></a><span class="lineno"> 7643</span> </div>
+<div class="line"><a name="l07644"></a><span class="lineno"> 7644</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07645"></a><span class="lineno"> 7645</span> <span class="comment">     * The tracing proceeds along the processed gradient image rows,</span></div>
+<div class="line"><a name="l07646"></a><span class="lineno"> 7646</span> <span class="comment">     * above and below the start position, finding the closest peak</span></div>
+<div class="line"><a name="l07647"></a><span class="lineno"> 7647</span> <span class="comment">     * to the previous obtained position, accepting the new position</span></div>
+<div class="line"><a name="l07648"></a><span class="lineno"> 7648</span> <span class="comment">     * only if it is closer than a given tolerance:</span></div>
+<div class="line"><a name="l07649"></a><span class="lineno"> 7649</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07650"></a><span class="lineno"> 7650</span> </div>
+<div class="line"><a name="l07651"></a><span class="lineno"> 7651</span>     tolerance = 0.9;  <span class="comment">/* Pixel */</span></div>
+<div class="line"><a name="l07652"></a><span class="lineno"> 7652</span> </div>
+<div class="line"><a name="l07653"></a><span class="lineno"> 7653</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07654"></a><span class="lineno"> 7654</span> <span class="comment">     * The trace is attempted for a certain number of pixels above</span></div>
+<div class="line"><a name="l07655"></a><span class="lineno"> 7655</span> <span class="comment">     * and below the position of the reference wavelength:</span></div>
+<div class="line"><a name="l07656"></a><span class="lineno"> 7656</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07657"></a><span class="lineno"> 7657</span> </div>
+<div class="line"><a name="l07658"></a><span class="lineno"> 7658</span>     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;</div>
+<div class="line"><a name="l07659"></a><span class="lineno"> 7659</span>     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;</div>
+<div class="line"><a name="l07660"></a><span class="lineno"> 7660</span> </div>
+<div class="line"><a name="l07661"></a><span class="lineno"> 7661</span> </div>
+<div class="line"><a name="l07662"></a><span class="lineno"> 7662</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07663"></a><span class="lineno"> 7663</span> <span class="comment">     * Prepare the structure of the output table:</span></div>
+<div class="line"><a name="l07664"></a><span class="lineno"> 7664</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07665"></a><span class="lineno"> 7665</span> </div>
+<div class="line"><a name="l07666"></a><span class="lineno"> 7666</span>     nrows = (ny-1)/step + 1;</div>
+<div class="line"><a name="l07667"></a><span class="lineno"> 7667</span>     traces = cpl_table_new(nrows);</div>
+<div class="line"><a name="l07668"></a><span class="lineno"> 7668</span>     cpl_table_new_column(traces, <span class="stringliteral">"x"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07669"></a><span class="lineno"> 7669</span>     cpl_table_set_column_unit(traces, <span class="stringliteral">"x"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l07670"></a><span class="lineno"> 7670</span>     <span class="keywordflow">for</span> (i = 0, j = 0; i < ny; i += step, j++)</div>
+<div class="line"><a name="l07671"></a><span class="lineno"> 7671</span>         cpl_table_set(traces, <span class="stringliteral">"x"</span>, j, i);</div>
+<div class="line"><a name="l07672"></a><span class="lineno"> 7672</span> </div>
+<div class="line"><a name="l07673"></a><span class="lineno"> 7673</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l07674"></a><span class="lineno"> 7674</span> </div>
+<div class="line"><a name="l07675"></a><span class="lineno"> 7675</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l07676"></a><span class="lineno"> 7676</span> <span class="comment">         * Find the closest processed gradient image row</span></div>
+<div class="line"><a name="l07677"></a><span class="lineno"> 7677</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l07678"></a><span class="lineno"> 7678</span> </div>
+<div class="line"><a name="l07679"></a><span class="lineno"> 7679</span>         ypos = ytop[i];</div>
+<div class="line"><a name="l07680"></a><span class="lineno"> 7680</span> </div>
+<div class="line"><a name="l07681"></a><span class="lineno"> 7681</span>         <span class="keywordflow">if</span> (ypos < 0)</div>
+<div class="line"><a name="l07682"></a><span class="lineno"> 7682</span>             ypos = 0;</div>
+<div class="line"><a name="l07683"></a><span class="lineno"> 7683</span>         <span class="keywordflow">if</span> (ypos >= ny)</div>
+<div class="line"><a name="l07684"></a><span class="lineno"> 7684</span>             ypos = ny - 1;</div>
+<div class="line"><a name="l07685"></a><span class="lineno"> 7685</span> </div>
+<div class="line"><a name="l07686"></a><span class="lineno"> 7686</span>         pos = ypos / step;</div>
+<div class="line"><a name="l07687"></a><span class="lineno"> 7687</span>         pos *= step;</div>
+<div class="line"><a name="l07688"></a><span class="lineno"> 7688</span> </div>
+<div class="line"><a name="l07689"></a><span class="lineno"> 7689</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l07690"></a><span class="lineno"> 7690</span> <span class="comment">         * Find the peak in that row that is closest to xtop[i]</span></div>
+<div class="line"><a name="l07691"></a><span class="lineno"> 7691</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l07692"></a><span class="lineno"> 7692</span> </div>
+<div class="line"><a name="l07693"></a><span class="lineno"> 7693</span>         <span class="keywordflow">if</span> (peaks[pos]) {</div>
+<div class="line"><a name="l07694"></a><span class="lineno"> 7694</span>             peak = cpl_vector_get_data(peaks[pos]);</div>
+<div class="line"><a name="l07695"></a><span class="lineno"> 7695</span>             npeaks = cpl_vector_get_size(peaks[pos]);</div>
+<div class="line"><a name="l07696"></a><span class="lineno"> 7696</span> </div>
+<div class="line"><a name="l07697"></a><span class="lineno"> 7697</span>             min = fabs(peak[0] - xtop[i]);</div>
+<div class="line"><a name="l07698"></a><span class="lineno"> 7698</span>             minpos = 0;</div>
+<div class="line"><a name="l07699"></a><span class="lineno"> 7699</span>             <span class="keywordflow">for</span> (j = 1; j < npeaks; j++) {</div>
+<div class="line"><a name="l07700"></a><span class="lineno"> 7700</span>                 dist = fabs(peak[j] - xtop[i]);</div>
+<div class="line"><a name="l07701"></a><span class="lineno"> 7701</span>                 <span class="keywordflow">if</span> (min > dist) {</div>
+<div class="line"><a name="l07702"></a><span class="lineno"> 7702</span>                     min = dist;</div>
+<div class="line"><a name="l07703"></a><span class="lineno"> 7703</span>                     minpos = j;</div>
+<div class="line"><a name="l07704"></a><span class="lineno"> 7704</span>                 }</div>
+<div class="line"><a name="l07705"></a><span class="lineno"> 7705</span>             }</div>
+<div class="line"><a name="l07706"></a><span class="lineno"> 7706</span>         }</div>
+<div class="line"><a name="l07707"></a><span class="lineno"> 7707</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l07708"></a><span class="lineno"> 7708</span>             npeaks = 0;</div>
+<div class="line"><a name="l07709"></a><span class="lineno"> 7709</span>         }</div>
+<div class="line"><a name="l07710"></a><span class="lineno"> 7710</span> </div>
+<div class="line"><a name="l07711"></a><span class="lineno"> 7711</span>         snprintf(trace_id, MAX_COLNAME, <span class="stringliteral">"t%d"</span>, slit_id[i]);</div>
+<div class="line"><a name="l07712"></a><span class="lineno"> 7712</span>         cpl_table_new_column(traces, trace_id, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07713"></a><span class="lineno"> 7713</span> </div>
+<div class="line"><a name="l07714"></a><span class="lineno"> 7714</span>         <span class="keywordflow">if</span> (min > sradius || npeaks == 0) {</div>
+<div class="line"><a name="l07715"></a><span class="lineno"> 7715</span>             cpl_msg_warning(func, <span class="stringliteral">"Cannot find spectrum edge for "</span></div>
+<div class="line"><a name="l07716"></a><span class="lineno"> 7716</span>                             <span class="stringliteral">"top (or left) end of slit %d"</span>, slit_id[i]);</div>
+<div class="line"><a name="l07717"></a><span class="lineno"> 7717</span>         }</div>
+<div class="line"><a name="l07718"></a><span class="lineno"> 7718</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l07719"></a><span class="lineno"> 7719</span> </div>
+<div class="line"><a name="l07720"></a><span class="lineno"> 7720</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l07721"></a><span class="lineno"> 7721</span> <span class="comment">             * Add to output table the start y position. Note that</span></div>
+<div class="line"><a name="l07722"></a><span class="lineno"> 7722</span> <span class="comment">             * y positions are written in coordinates of the unrotated</span></div>
+<div class="line"><a name="l07723"></a><span class="lineno"> 7723</span> <span class="comment">             * image, i.e., with horizontal dispersion. Currently nx</span></div>
+<div class="line"><a name="l07724"></a><span class="lineno"> 7724</span> <span class="comment">             * is the x size of the temporarily rotated image (for</span></div>
+<div class="line"><a name="l07725"></a><span class="lineno"> 7725</span> <span class="comment">             * faster memory access), but it has the sense of a y size.</span></div>
+<div class="line"><a name="l07726"></a><span class="lineno"> 7726</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l07727"></a><span class="lineno"> 7727</span> </div>
+<div class="line"><a name="l07728"></a><span class="lineno"> 7728</span>             cpl_table_set(traces, trace_id, pos/step, nx - peak[minpos]);</div>
+<div class="line"><a name="l07729"></a><span class="lineno"> 7729</span>             start_y = peak[minpos];</div>
+<div class="line"><a name="l07730"></a><span class="lineno"> 7730</span> </div>
+<div class="line"><a name="l07731"></a><span class="lineno"> 7731</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l07732"></a><span class="lineno"> 7732</span> <span class="comment">             * Perform the tracing of current edge. Above:</span></div>
+<div class="line"><a name="l07733"></a><span class="lineno"> 7733</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l07734"></a><span class="lineno"> 7734</span> </div>
+<div class="line"><a name="l07735"></a><span class="lineno"> 7735</span>             prev_y = start_y;</div>
+<div class="line"><a name="l07736"></a><span class="lineno"> 7736</span> </div>
+<div class="line"><a name="l07737"></a><span class="lineno"> 7737</span>             <span class="keywordflow">for</span> (j = pos + step; j < ny; j += step) {</div>
+<div class="line"><a name="l07738"></a><span class="lineno"> 7738</span>                 <span class="keywordflow">if</span> (j - pos > pixel_above)</div>
+<div class="line"><a name="l07739"></a><span class="lineno"> 7739</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l07740"></a><span class="lineno"> 7740</span>                 <span class="keywordflow">if</span> (peaks[j]) {</div>
+<div class="line"><a name="l07741"></a><span class="lineno"> 7741</span>                     peak = cpl_vector_get_data(peaks[j]);</div>
+<div class="line"><a name="l07742"></a><span class="lineno"> 7742</span>                     npeaks = cpl_vector_get_size(peaks[j]);</div>
+<div class="line"><a name="l07743"></a><span class="lineno"> 7743</span>                     min = fabs(peak[0] - prev_y);</div>
+<div class="line"><a name="l07744"></a><span class="lineno"> 7744</span>                     minpos = 0;</div>
+<div class="line"><a name="l07745"></a><span class="lineno"> 7745</span>                     <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {</div>
+<div class="line"><a name="l07746"></a><span class="lineno"> 7746</span>                         dist = fabs(peak[k] - prev_y);</div>
+<div class="line"><a name="l07747"></a><span class="lineno"> 7747</span>                         <span class="keywordflow">if</span> (min > dist) {</div>
+<div class="line"><a name="l07748"></a><span class="lineno"> 7748</span>                             min = dist;</div>
+<div class="line"><a name="l07749"></a><span class="lineno"> 7749</span>                             minpos = k;</div>
+<div class="line"><a name="l07750"></a><span class="lineno"> 7750</span>                         }</div>
+<div class="line"><a name="l07751"></a><span class="lineno"> 7751</span>                     }</div>
+<div class="line"><a name="l07752"></a><span class="lineno"> 7752</span>                     <span class="keywordflow">if</span> (min < tolerance) {</div>
+<div class="line"><a name="l07753"></a><span class="lineno"> 7753</span>                         cpl_table_set(traces, trace_id, j/step, </div>
+<div class="line"><a name="l07754"></a><span class="lineno"> 7754</span>                                       nx - peak[minpos]);</div>
+<div class="line"><a name="l07755"></a><span class="lineno"> 7755</span>                         prev_y = peak[minpos];</div>
+<div class="line"><a name="l07756"></a><span class="lineno"> 7756</span>                     }</div>
+<div class="line"><a name="l07757"></a><span class="lineno"> 7757</span>                 }</div>
+<div class="line"><a name="l07758"></a><span class="lineno"> 7758</span>             }</div>
+<div class="line"><a name="l07759"></a><span class="lineno"> 7759</span> </div>
+<div class="line"><a name="l07760"></a><span class="lineno"> 7760</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l07761"></a><span class="lineno"> 7761</span> <span class="comment">             * Perform the tracing of current edge. Below:</span></div>
+<div class="line"><a name="l07762"></a><span class="lineno"> 7762</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l07763"></a><span class="lineno"> 7763</span> </div>
+<div class="line"><a name="l07764"></a><span class="lineno"> 7764</span>             prev_y = start_y;</div>
+<div class="line"><a name="l07765"></a><span class="lineno"> 7765</span> </div>
+<div class="line"><a name="l07766"></a><span class="lineno"> 7766</span>             <span class="keywordflow">for</span> (j = pos - step; j >= 0; j -= step) {</div>
+<div class="line"><a name="l07767"></a><span class="lineno"> 7767</span>                 <span class="keywordflow">if</span> (pos - j > pixel_below)</div>
+<div class="line"><a name="l07768"></a><span class="lineno"> 7768</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l07769"></a><span class="lineno"> 7769</span>                 <span class="keywordflow">if</span> (peaks[j]) {</div>
+<div class="line"><a name="l07770"></a><span class="lineno"> 7770</span>                     peak = cpl_vector_get_data(peaks[j]);</div>
+<div class="line"><a name="l07771"></a><span class="lineno"> 7771</span>                     npeaks = cpl_vector_get_size(peaks[j]);</div>
+<div class="line"><a name="l07772"></a><span class="lineno"> 7772</span>                     min = fabs(peak[0] - prev_y);</div>
+<div class="line"><a name="l07773"></a><span class="lineno"> 7773</span>                     minpos = 0;</div>
+<div class="line"><a name="l07774"></a><span class="lineno"> 7774</span>                     <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {</div>
+<div class="line"><a name="l07775"></a><span class="lineno"> 7775</span>                         dist = fabs(peak[k] - prev_y);</div>
+<div class="line"><a name="l07776"></a><span class="lineno"> 7776</span>                         <span class="keywordflow">if</span> (min > dist) {</div>
+<div class="line"><a name="l07777"></a><span class="lineno"> 7777</span>                             min = dist;</div>
+<div class="line"><a name="l07778"></a><span class="lineno"> 7778</span>                             minpos = k;</div>
+<div class="line"><a name="l07779"></a><span class="lineno"> 7779</span>                         }</div>
+<div class="line"><a name="l07780"></a><span class="lineno"> 7780</span>                     }</div>
+<div class="line"><a name="l07781"></a><span class="lineno"> 7781</span>                     <span class="keywordflow">if</span> (min < tolerance) {</div>
+<div class="line"><a name="l07782"></a><span class="lineno"> 7782</span>                         cpl_table_set(traces, trace_id, j/step, </div>
+<div class="line"><a name="l07783"></a><span class="lineno"> 7783</span>                                       nx - peak[minpos]);</div>
+<div class="line"><a name="l07784"></a><span class="lineno"> 7784</span>                         prev_y = peak[minpos];</div>
+<div class="line"><a name="l07785"></a><span class="lineno"> 7785</span>                     }</div>
+<div class="line"><a name="l07786"></a><span class="lineno"> 7786</span>                 }</div>
+<div class="line"><a name="l07787"></a><span class="lineno"> 7787</span>             }</div>
+<div class="line"><a name="l07788"></a><span class="lineno"> 7788</span>         }</div>
+<div class="line"><a name="l07789"></a><span class="lineno"> 7789</span> </div>
+<div class="line"><a name="l07790"></a><span class="lineno"> 7790</span> </div>
+<div class="line"><a name="l07791"></a><span class="lineno"> 7791</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l07792"></a><span class="lineno"> 7792</span> <span class="comment">         * Find the peak in that row that is closest to xbottom[i]</span></div>
+<div class="line"><a name="l07793"></a><span class="lineno"> 7793</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l07794"></a><span class="lineno"> 7794</span> </div>
+<div class="line"><a name="l07795"></a><span class="lineno"> 7795</span>         <span class="keywordflow">if</span> (peaks[pos]) {</div>
+<div class="line"><a name="l07796"></a><span class="lineno"> 7796</span>             peak = cpl_vector_get_data(peaks[pos]);</div>
+<div class="line"><a name="l07797"></a><span class="lineno"> 7797</span>             npeaks = cpl_vector_get_size(peaks[pos]);</div>
+<div class="line"><a name="l07798"></a><span class="lineno"> 7798</span>     </div>
+<div class="line"><a name="l07799"></a><span class="lineno"> 7799</span>             min = fabs(peak[0] - xbottom[i]);</div>
+<div class="line"><a name="l07800"></a><span class="lineno"> 7800</span>             minpos = 0;</div>
+<div class="line"><a name="l07801"></a><span class="lineno"> 7801</span>             <span class="keywordflow">for</span> (j = 1; j < npeaks; j++) {</div>
+<div class="line"><a name="l07802"></a><span class="lineno"> 7802</span>                 dist = fabs(peak[j] - xbottom[i]);</div>
+<div class="line"><a name="l07803"></a><span class="lineno"> 7803</span>                 <span class="keywordflow">if</span> (min > dist) {</div>
+<div class="line"><a name="l07804"></a><span class="lineno"> 7804</span>                     min = dist;</div>
+<div class="line"><a name="l07805"></a><span class="lineno"> 7805</span>                     minpos = j;</div>
+<div class="line"><a name="l07806"></a><span class="lineno"> 7806</span>                 }</div>
+<div class="line"><a name="l07807"></a><span class="lineno"> 7807</span>             }</div>
+<div class="line"><a name="l07808"></a><span class="lineno"> 7808</span>         }</div>
+<div class="line"><a name="l07809"></a><span class="lineno"> 7809</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l07810"></a><span class="lineno"> 7810</span>             npeaks = 0;</div>
+<div class="line"><a name="l07811"></a><span class="lineno"> 7811</span>         }</div>
+<div class="line"><a name="l07812"></a><span class="lineno"> 7812</span> </div>
+<div class="line"><a name="l07813"></a><span class="lineno"> 7813</span>         snprintf(trace_id, MAX_COLNAME, <span class="stringliteral">"b%d"</span>, slit_id[i]);</div>
+<div class="line"><a name="l07814"></a><span class="lineno"> 7814</span>         cpl_table_new_column(traces, trace_id, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07815"></a><span class="lineno"> 7815</span> </div>
+<div class="line"><a name="l07816"></a><span class="lineno"> 7816</span>         <span class="keywordflow">if</span> (min > sradius || npeaks == 0) {</div>
+<div class="line"><a name="l07817"></a><span class="lineno"> 7817</span>             cpl_msg_warning(func, <span class="stringliteral">"Cannot find spectrum edge for "</span></div>
+<div class="line"><a name="l07818"></a><span class="lineno"> 7818</span>                             <span class="stringliteral">"bottom (or right) end of slit %d"</span>, slit_id[i]);</div>
+<div class="line"><a name="l07819"></a><span class="lineno"> 7819</span>         }</div>
+<div class="line"><a name="l07820"></a><span class="lineno"> 7820</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l07821"></a><span class="lineno"> 7821</span> </div>
+<div class="line"><a name="l07822"></a><span class="lineno"> 7822</span>             cpl_table_set(traces, trace_id, pos/step, nx - peak[minpos]);</div>
+<div class="line"><a name="l07823"></a><span class="lineno"> 7823</span>             start_y = peak[minpos]; </div>
+<div class="line"><a name="l07824"></a><span class="lineno"> 7824</span> </div>
+<div class="line"><a name="l07825"></a><span class="lineno"> 7825</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l07826"></a><span class="lineno"> 7826</span> <span class="comment">             * Perform the tracing of current edge. Above:</span></div>
+<div class="line"><a name="l07827"></a><span class="lineno"> 7827</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l07828"></a><span class="lineno"> 7828</span> </div>
+<div class="line"><a name="l07829"></a><span class="lineno"> 7829</span>             prev_y = start_y;</div>
+<div class="line"><a name="l07830"></a><span class="lineno"> 7830</span> </div>
+<div class="line"><a name="l07831"></a><span class="lineno"> 7831</span>             <span class="keywordflow">for</span> (j = pos + step; j < ny; j += step) {</div>
+<div class="line"><a name="l07832"></a><span class="lineno"> 7832</span>                 <span class="keywordflow">if</span> (j - pos > pixel_above)</div>
+<div class="line"><a name="l07833"></a><span class="lineno"> 7833</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l07834"></a><span class="lineno"> 7834</span>                 <span class="keywordflow">if</span> (peaks[j]) {</div>
+<div class="line"><a name="l07835"></a><span class="lineno"> 7835</span>                     peak = cpl_vector_get_data(peaks[j]);</div>
+<div class="line"><a name="l07836"></a><span class="lineno"> 7836</span>                     npeaks = cpl_vector_get_size(peaks[j]);</div>
+<div class="line"><a name="l07837"></a><span class="lineno"> 7837</span>                     min = fabs(peak[0] - prev_y);</div>
+<div class="line"><a name="l07838"></a><span class="lineno"> 7838</span>                     minpos = 0;</div>
+<div class="line"><a name="l07839"></a><span class="lineno"> 7839</span>                     <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {</div>
+<div class="line"><a name="l07840"></a><span class="lineno"> 7840</span>                         dist = fabs(peak[k] - prev_y);</div>
+<div class="line"><a name="l07841"></a><span class="lineno"> 7841</span>                         <span class="keywordflow">if</span> (min > dist) {</div>
+<div class="line"><a name="l07842"></a><span class="lineno"> 7842</span>                             min = dist;</div>
+<div class="line"><a name="l07843"></a><span class="lineno"> 7843</span>                             minpos = k;</div>
+<div class="line"><a name="l07844"></a><span class="lineno"> 7844</span>                         }</div>
+<div class="line"><a name="l07845"></a><span class="lineno"> 7845</span>                     }</div>
+<div class="line"><a name="l07846"></a><span class="lineno"> 7846</span>                     <span class="keywordflow">if</span> (min < tolerance) {</div>
+<div class="line"><a name="l07847"></a><span class="lineno"> 7847</span>                         cpl_table_set(traces, trace_id, j/step, </div>
+<div class="line"><a name="l07848"></a><span class="lineno"> 7848</span>                                       nx - peak[minpos]);</div>
+<div class="line"><a name="l07849"></a><span class="lineno"> 7849</span>                         prev_y = peak[minpos];</div>
+<div class="line"><a name="l07850"></a><span class="lineno"> 7850</span>                     }</div>
+<div class="line"><a name="l07851"></a><span class="lineno"> 7851</span>                 }</div>
+<div class="line"><a name="l07852"></a><span class="lineno"> 7852</span>             }</div>
+<div class="line"><a name="l07853"></a><span class="lineno"> 7853</span> </div>
+<div class="line"><a name="l07854"></a><span class="lineno"> 7854</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l07855"></a><span class="lineno"> 7855</span> <span class="comment">             * Perform the tracing of current edge. Below:</span></div>
+<div class="line"><a name="l07856"></a><span class="lineno"> 7856</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l07857"></a><span class="lineno"> 7857</span> </div>
+<div class="line"><a name="l07858"></a><span class="lineno"> 7858</span>             prev_y = start_y;</div>
+<div class="line"><a name="l07859"></a><span class="lineno"> 7859</span> </div>
+<div class="line"><a name="l07860"></a><span class="lineno"> 7860</span>             <span class="keywordflow">for</span> (j = pos - step; j >= 0; j -= step) {</div>
+<div class="line"><a name="l07861"></a><span class="lineno"> 7861</span>                 <span class="keywordflow">if</span> (pos - j > pixel_below)</div>
+<div class="line"><a name="l07862"></a><span class="lineno"> 7862</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l07863"></a><span class="lineno"> 7863</span>                 <span class="keywordflow">if</span> (peaks[j]) {</div>
+<div class="line"><a name="l07864"></a><span class="lineno"> 7864</span>                     peak = cpl_vector_get_data(peaks[j]);</div>
+<div class="line"><a name="l07865"></a><span class="lineno"> 7865</span>                     npeaks = cpl_vector_get_size(peaks[j]);</div>
+<div class="line"><a name="l07866"></a><span class="lineno"> 7866</span>                     min = fabs(peak[0] - prev_y);</div>
+<div class="line"><a name="l07867"></a><span class="lineno"> 7867</span>                     minpos = 0;</div>
+<div class="line"><a name="l07868"></a><span class="lineno"> 7868</span>                     <span class="keywordflow">for</span> (k = 1; k < npeaks; k++) {</div>
+<div class="line"><a name="l07869"></a><span class="lineno"> 7869</span>                         dist = fabs(peak[k] - prev_y);</div>
+<div class="line"><a name="l07870"></a><span class="lineno"> 7870</span>                         <span class="keywordflow">if</span> (min > dist) {</div>
+<div class="line"><a name="l07871"></a><span class="lineno"> 7871</span>                             min = dist;</div>
+<div class="line"><a name="l07872"></a><span class="lineno"> 7872</span>                             minpos = k;</div>
+<div class="line"><a name="l07873"></a><span class="lineno"> 7873</span>                         }</div>
+<div class="line"><a name="l07874"></a><span class="lineno"> 7874</span>                     }</div>
+<div class="line"><a name="l07875"></a><span class="lineno"> 7875</span>                     <span class="keywordflow">if</span> (min < tolerance) {</div>
+<div class="line"><a name="l07876"></a><span class="lineno"> 7876</span>                         cpl_table_set(traces, trace_id, j/step, </div>
+<div class="line"><a name="l07877"></a><span class="lineno"> 7877</span>                                       nx - peak[minpos]);</div>
+<div class="line"><a name="l07878"></a><span class="lineno"> 7878</span>                         prev_y = peak[minpos];</div>
+<div class="line"><a name="l07879"></a><span class="lineno"> 7879</span>                     }</div>
+<div class="line"><a name="l07880"></a><span class="lineno"> 7880</span>                 }</div>
+<div class="line"><a name="l07881"></a><span class="lineno"> 7881</span>             }</div>
+<div class="line"><a name="l07882"></a><span class="lineno"> 7882</span>         }</div>
+<div class="line"><a name="l07883"></a><span class="lineno"> 7883</span> </div>
+<div class="line"><a name="l07884"></a><span class="lineno"> 7884</span>     }   <span class="comment">/* End of loop on slits */</span></div>
+<div class="line"><a name="l07885"></a><span class="lineno"> 7885</span> </div>
+<div class="line"><a name="l07886"></a><span class="lineno"> 7886</span>     <span class="keywordflow">for</span> (i = 0; i < ny; i += step)</div>
+<div class="line"><a name="l07887"></a><span class="lineno"> 7887</span>         cpl_vector_delete(peaks[i]);</div>
+<div class="line"><a name="l07888"></a><span class="lineno"> 7888</span>     cpl_free(peaks);</div>
+<div class="line"><a name="l07889"></a><span class="lineno"> 7889</span> </div>
+<div class="line"><a name="l07890"></a><span class="lineno"> 7890</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l07891"></a><span class="lineno"> 7891</span> <span class="comment">     * Restore original orientation of slits positions table</span></div>
+<div class="line"><a name="l07892"></a><span class="lineno"> 7892</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l07893"></a><span class="lineno"> 7893</span> </div>
+<div class="line"><a name="l07894"></a><span class="lineno"> 7894</span>     <a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f" title="Rotate a slit location table.">mos_rotate_slits</a>(slits, -1, ny, nx);</div>
+<div class="line"><a name="l07895"></a><span class="lineno"> 7895</span> </div>
+<div class="line"><a name="l07896"></a><span class="lineno"> 7896</span>     <span class="keywordflow">return</span> traces;</div>
+<div class="line"><a name="l07897"></a><span class="lineno"> 7897</span> </div>
+<div class="line"><a name="l07898"></a><span class="lineno"> 7898</span> }</div>
+<div class="line"><a name="l07899"></a><span class="lineno"> 7899</span> </div>
+<div class="line"><a name="l07900"></a><span class="lineno"> 7900</span> </div>
+<div class="line"><a name="l07921"></a><span class="lineno"><a class="code" href="group__moses.html#ga7518d66581d93ab64704fcf90996296b"> 7921</a></span> cpl_table *<a class="code" href="group__moses.html#ga7518d66581d93ab64704fcf90996296b" title="Fit spectral traces.">mos_poly_trace</a>(cpl_table *slits, cpl_table *traces, <span class="keywordtype">int</span> order)</div>
+<div class="line"><a name="l07922"></a><span class="lineno"> 7922</span> {</div>
+<div class="line"><a name="l07923"></a><span class="lineno"> 7923</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_poly_trace"</span>;</div>
+<div class="line"><a name="l07924"></a><span class="lineno"> 7924</span> </div>
+<div class="line"><a name="l07925"></a><span class="lineno"> 7925</span>     cpl_table      *polytraces;</div>
+<div class="line"><a name="l07926"></a><span class="lineno"> 7926</span>     cpl_table      *dummy;</div>
+<div class="line"><a name="l07927"></a><span class="lineno"> 7927</span>     cpl_vector     *x;</div>
+<div class="line"><a name="l07928"></a><span class="lineno"> 7928</span>     cpl_vector     *trace;</div>
+<div class="line"><a name="l07929"></a><span class="lineno"> 7929</span>     cpl_polynomial *polytrace;</div>
+<div class="line"><a name="l07930"></a><span class="lineno"> 7930</span>     <span class="keywordtype">char</span>            trace_id[MAX_COLNAME];</div>
+<div class="line"><a name="l07931"></a><span class="lineno"> 7931</span>     <span class="keywordtype">char</span>            trace_res[MAX_COLNAME];</div>
+<div class="line"><a name="l07932"></a><span class="lineno"> 7932</span>     <span class="keywordtype">char</span>            trace_mod[MAX_COLNAME];</div>
+<div class="line"><a name="l07933"></a><span class="lineno"> 7933</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>     *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l07934"></a><span class="lineno"> 7934</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l07935"></a><span class="lineno"> 7935</span>     <span class="keywordtype">double</span>         *xdata;</div>
+<div class="line"><a name="l07936"></a><span class="lineno"> 7936</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l07937"></a><span class="lineno"> 7937</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l07938"></a><span class="lineno"> 7938</span>     <span class="keywordtype">int</span>             nrows;</div>
+<div class="line"><a name="l07939"></a><span class="lineno"> 7939</span>     <span class="keywordtype">int</span>             npoints;</div>
+<div class="line"><a name="l07940"></a><span class="lineno"> 7940</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l07941"></a><span class="lineno"> 7941</span>     cpl_size        k;</div>
+<div class="line"><a name="l07942"></a><span class="lineno"> 7942</span> </div>
+<div class="line"><a name="l07943"></a><span class="lineno"> 7943</span> </div>
+<div class="line"><a name="l07944"></a><span class="lineno"> 7944</span>     <span class="keywordflow">if</span> (traces == NULL || slits == NULL) {</div>
+<div class="line"><a name="l07945"></a><span class="lineno"> 7945</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l07946"></a><span class="lineno"> 7946</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l07947"></a><span class="lineno"> 7947</span>     }</div>
+<div class="line"><a name="l07948"></a><span class="lineno"> 7948</span> </div>
+<div class="line"><a name="l07949"></a><span class="lineno"> 7949</span>     <span class="keywordflow">if</span> (order > 5) {</div>
+<div class="line"><a name="l07950"></a><span class="lineno"> 7950</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l07951"></a><span class="lineno"> 7951</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l07952"></a><span class="lineno"> 7952</span>     }</div>
+<div class="line"><a name="l07953"></a><span class="lineno"> 7953</span> </div>
+<div class="line"><a name="l07954"></a><span class="lineno"> 7954</span>     nrows   = cpl_table_get_nrow(traces);</div>
+<div class="line"><a name="l07955"></a><span class="lineno"> 7955</span>     xdata   = cpl_table_get_data_double(traces, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l07956"></a><span class="lineno"> 7956</span>     nslits  = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l07957"></a><span class="lineno"> 7957</span>     slit_id = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l07958"></a><span class="lineno"> 7958</span> </div>
+<div class="line"><a name="l07959"></a><span class="lineno"> 7959</span>     polytraces = cpl_table_new(2*nslits);</div>
+<div class="line"><a name="l07960"></a><span class="lineno"> 7960</span>     cpl_table_new_column(polytraces, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l07961"></a><span class="lineno"> 7961</span>     <span class="keywordflow">for</span> (i = 0; i <= order; i++)</div>
+<div class="line"><a name="l07962"></a><span class="lineno"> 7962</span>         cpl_table_new_column(polytraces, clab[i], CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l07963"></a><span class="lineno"> 7963</span> </div>
+<div class="line"><a name="l07964"></a><span class="lineno"> 7964</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l07965"></a><span class="lineno"> 7965</span>         <span class="keywordflow">for</span> (j = 0; j < 2; j++) {  <span class="comment">/* For top and bottom trace of each slit */</span></div>
+<div class="line"><a name="l07966"></a><span class="lineno"> 7966</span> </div>
+<div class="line"><a name="l07967"></a><span class="lineno"> 7967</span>             <span class="keywordflow">if</span> (j) {</div>
+<div class="line"><a name="l07968"></a><span class="lineno"> 7968</span>                 snprintf(trace_id, MAX_COLNAME, <span class="stringliteral">"b%d"</span>, slit_id[i]);</div>
+<div class="line"><a name="l07969"></a><span class="lineno"> 7969</span>                 snprintf(trace_res, MAX_COLNAME, <span class="stringliteral">"b%d_res"</span>, slit_id[i]);</div>
+<div class="line"><a name="l07970"></a><span class="lineno"> 7970</span>                 snprintf(trace_mod, MAX_COLNAME, <span class="stringliteral">"b%d_mod"</span>, slit_id[i]);</div>
+<div class="line"><a name="l07971"></a><span class="lineno"> 7971</span>             }</div>
+<div class="line"><a name="l07972"></a><span class="lineno"> 7972</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l07973"></a><span class="lineno"> 7973</span>                 snprintf(trace_id, MAX_COLNAME, <span class="stringliteral">"t%d"</span>, slit_id[i]);</div>
+<div class="line"><a name="l07974"></a><span class="lineno"> 7974</span>                 snprintf(trace_res, MAX_COLNAME, <span class="stringliteral">"t%d_res"</span>, slit_id[i]);</div>
+<div class="line"><a name="l07975"></a><span class="lineno"> 7975</span>                 snprintf(trace_mod, MAX_COLNAME, <span class="stringliteral">"t%d_mod"</span>, slit_id[i]);</div>
+<div class="line"><a name="l07976"></a><span class="lineno"> 7976</span>             }</div>
+<div class="line"><a name="l07977"></a><span class="lineno"> 7977</span> </div>
+<div class="line"><a name="l07978"></a><span class="lineno"> 7978</span>             cpl_table_set_int(polytraces, <span class="stringliteral">"slit_id"</span>, 2*i+j, slit_id[i]);</div>
+<div class="line"><a name="l07979"></a><span class="lineno"> 7979</span> </div>
+<div class="line"><a name="l07980"></a><span class="lineno"> 7980</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l07981"></a><span class="lineno"> 7981</span> <span class="comment">             * The "dummy" table is just a tool for eliminating invalid</span></div>
+<div class="line"><a name="l07982"></a><span class="lineno"> 7982</span> <span class="comment">             * points from the vectors to be fitted.</span></div>
+<div class="line"><a name="l07983"></a><span class="lineno"> 7983</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l07984"></a><span class="lineno"> 7984</span> </div>
+<div class="line"><a name="l07985"></a><span class="lineno"> 7985</span>             dummy = cpl_table_new(nrows);</div>
+<div class="line"><a name="l07986"></a><span class="lineno"> 7986</span>             cpl_table_duplicate_column(dummy, <span class="stringliteral">"x"</span>, traces, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l07987"></a><span class="lineno"> 7987</span>             cpl_table_duplicate_column(dummy, trace_id, traces, trace_id);</div>
+<div class="line"><a name="l07988"></a><span class="lineno"> 7988</span>             npoints = nrows - cpl_table_count_invalid(dummy, trace_id);</div>
+<div class="line"><a name="l07989"></a><span class="lineno"> 7989</span>             <span class="keywordflow">if</span> (npoints < 2 * order) {</div>
+<div class="line"><a name="l07990"></a><span class="lineno"> 7990</span>                 cpl_table_delete(dummy);</div>
+<div class="line"><a name="l07991"></a><span class="lineno"> 7991</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l07992"></a><span class="lineno"> 7992</span>             }</div>
+<div class="line"><a name="l07993"></a><span class="lineno"> 7993</span>             cpl_table_erase_invalid(dummy);</div>
+<div class="line"><a name="l07994"></a><span class="lineno"> 7994</span>             x     = cpl_vector_wrap(npoints, </div>
+<div class="line"><a name="l07995"></a><span class="lineno"> 7995</span>                                     cpl_table_get_data_double(dummy, <span class="stringliteral">"x"</span>));</div>
+<div class="line"><a name="l07996"></a><span class="lineno"> 7996</span>             trace = cpl_vector_wrap(npoints, </div>
+<div class="line"><a name="l07997"></a><span class="lineno"> 7997</span>                                     cpl_table_get_data_double(dummy, trace_id));</div>
+<div class="line"><a name="l07998"></a><span class="lineno"> 7998</span>             polytrace = cpl_polynomial_fit_1d_create(x, trace, order, NULL);</div>
+<div class="line"><a name="l07999"></a><span class="lineno"> 7999</span>             cpl_vector_unwrap(x);</div>
+<div class="line"><a name="l08000"></a><span class="lineno"> 8000</span>             cpl_vector_unwrap(trace);</div>
+<div class="line"><a name="l08001"></a><span class="lineno"> 8001</span>             cpl_table_delete(dummy);</div>
+<div class="line"><a name="l08002"></a><span class="lineno"> 8002</span> </div>
+<div class="line"><a name="l08003"></a><span class="lineno"> 8003</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l08004"></a><span class="lineno"> 8004</span> <span class="comment">             * Screen bad solutions. At the moment, a primitive screening</span></div>
+<div class="line"><a name="l08005"></a><span class="lineno"> 8005</span> <span class="comment">             * consists in excluding solutions displaying excessive</span></div>
+<div class="line"><a name="l08006"></a><span class="lineno"> 8006</span> <span class="comment">             * curvature (larger than 1E-5 / pixel)</span></div>
+<div class="line"><a name="l08007"></a><span class="lineno"> 8007</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l08008"></a><span class="lineno"> 8008</span> </div>
+<div class="line"><a name="l08009"></a><span class="lineno"> 8009</span>             k = 2;</div>
+<div class="line"><a name="l08010"></a><span class="lineno"> 8010</span>             <span class="keywordflow">if</span> (fabs(cpl_polynomial_get_coeff(polytrace, &k)) >  1.E-4) {</div>
+<div class="line"><a name="l08011"></a><span class="lineno"> 8011</span>                 cpl_polynomial_delete(polytrace);</div>
+<div class="line"><a name="l08012"></a><span class="lineno"> 8012</span>                 cpl_table_new_column(traces, trace_mod, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08013"></a><span class="lineno"> 8013</span>                 cpl_table_duplicate_column(traces, trace_res, traces, </div>
+<div class="line"><a name="l08014"></a><span class="lineno"> 8014</span>                                            trace_mod);</div>
+<div class="line"><a name="l08015"></a><span class="lineno"> 8015</span>                 <span class="keywordflow">if</span> (j) </div>
+<div class="line"><a name="l08016"></a><span class="lineno"> 8016</span>                     cpl_msg_warning(func, <span class="stringliteral">"Exclude bad curvature solution "</span></div>
+<div class="line"><a name="l08017"></a><span class="lineno"> 8017</span>                            <span class="stringliteral">"for bottom (right) edge of slit %d"</span>, slit_id[i]);</div>
+<div class="line"><a name="l08018"></a><span class="lineno"> 8018</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l08019"></a><span class="lineno"> 8019</span>                     cpl_msg_warning(func, <span class="stringliteral">"Exclude bad curvature solution "</span></div>
+<div class="line"><a name="l08020"></a><span class="lineno"> 8020</span>                                 <span class="stringliteral">"for top (left) edge of slit %d"</span>, slit_id[i]);</div>
+<div class="line"><a name="l08021"></a><span class="lineno"> 8021</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l08022"></a><span class="lineno"> 8022</span>             }</div>
+<div class="line"><a name="l08023"></a><span class="lineno"> 8023</span> </div>
+<div class="line"><a name="l08024"></a><span class="lineno"> 8024</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l08025"></a><span class="lineno"> 8025</span> <span class="comment">             * Write polynomial coefficients to the output table,</span></div>
+<div class="line"><a name="l08026"></a><span class="lineno"> 8026</span> <span class="comment">             * tagged with the appropriate slit_id</span></div>
+<div class="line"><a name="l08027"></a><span class="lineno"> 8027</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l08028"></a><span class="lineno"> 8028</span> </div>
+<div class="line"><a name="l08029"></a><span class="lineno"> 8029</span>             <span class="keywordflow">for</span> (k = 0; k <= order; k++)</div>
+<div class="line"><a name="l08030"></a><span class="lineno"> 8030</span>                 cpl_table_set_double(polytraces, clab[k], 2*i+j, </div>
+<div class="line"><a name="l08031"></a><span class="lineno"> 8031</span>                                      cpl_polynomial_get_coeff(polytrace, &k));</div>
+<div class="line"><a name="l08032"></a><span class="lineno"> 8032</span> </div>
+<div class="line"><a name="l08033"></a><span class="lineno"> 8033</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l08034"></a><span class="lineno"> 8034</span> <span class="comment">             * Add column of residuals to input traces table</span></div>
+<div class="line"><a name="l08035"></a><span class="lineno"> 8035</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l08036"></a><span class="lineno"> 8036</span> </div>
+<div class="line"><a name="l08037"></a><span class="lineno"> 8037</span>             cpl_table_new_column(traces, trace_mod, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08038"></a><span class="lineno"> 8038</span>             cpl_table_set_column_unit(traces, trace_mod, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l08039"></a><span class="lineno"> 8039</span> </div>
+<div class="line"><a name="l08040"></a><span class="lineno"> 8040</span>             <span class="keywordflow">for</span> (k = 0; k < nrows; k++) {</div>
+<div class="line"><a name="l08041"></a><span class="lineno"> 8041</span>                 cpl_table_set_double(traces, trace_mod, k,</div>
+<div class="line"><a name="l08042"></a><span class="lineno"> 8042</span>                           cpl_polynomial_eval_1d(polytrace, xdata[k], NULL));</div>
+<div class="line"><a name="l08043"></a><span class="lineno"> 8043</span>             }</div>
+<div class="line"><a name="l08044"></a><span class="lineno"> 8044</span> </div>
+<div class="line"><a name="l08045"></a><span class="lineno"> 8045</span>             cpl_polynomial_delete(polytrace);</div>
+<div class="line"><a name="l08046"></a><span class="lineno"> 8046</span> </div>
+<div class="line"><a name="l08047"></a><span class="lineno"> 8047</span>             cpl_table_duplicate_column(traces, trace_res, traces, trace_mod);</div>
+<div class="line"><a name="l08048"></a><span class="lineno"> 8048</span>             cpl_table_subtract_columns(traces, trace_res, trace_id);</div>
+<div class="line"><a name="l08049"></a><span class="lineno"> 8049</span>             cpl_table_multiply_scalar(traces, trace_res, -1.0);</div>
+<div class="line"><a name="l08050"></a><span class="lineno"> 8050</span> </div>
+<div class="line"><a name="l08051"></a><span class="lineno"> 8051</span>         }</div>
+<div class="line"><a name="l08052"></a><span class="lineno"> 8052</span>     }</div>
+<div class="line"><a name="l08053"></a><span class="lineno"> 8053</span> </div>
+<div class="line"><a name="l08054"></a><span class="lineno"> 8054</span>     <span class="keywordflow">return</span> polytraces;</div>
+<div class="line"><a name="l08055"></a><span class="lineno"> 8055</span> </div>
+<div class="line"><a name="l08056"></a><span class="lineno"> 8056</span> }</div>
+<div class="line"><a name="l08057"></a><span class="lineno"> 8057</span> </div>
+<div class="line"><a name="l08058"></a><span class="lineno"> 8058</span> </div>
+<div class="line"><a name="l08082"></a><span class="lineno"><a class="code" href="group__moses.html#ga0eda8a5abf396113ffbe66607fd72fe6"> 8082</a></span> cpl_error_code <a class="code" href="group__moses.html#ga0eda8a5abf396113ffbe66607fd72fe6" title="Recompute tracing coefficients globally.">mos_global_trace</a>(cpl_table *slits, cpl_table *polytraces,</div>
+<div class="line"><a name="l08083"></a><span class="lineno"> 8083</span>                                 <span class="keywordtype">int</span> mode)</div>
+<div class="line"><a name="l08084"></a><span class="lineno"> 8084</span> {</div>
+<div class="line"><a name="l08085"></a><span class="lineno"> 8085</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_global_trace"</span>;</div>
+<div class="line"><a name="l08086"></a><span class="lineno"> 8086</span> </div>
+<div class="line"><a name="l08087"></a><span class="lineno"> 8087</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l08088"></a><span class="lineno"> 8088</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l08089"></a><span class="lineno"> 8089</span>     cpl_table      *table;</div>
+<div class="line"><a name="l08090"></a><span class="lineno"> 8090</span>     cpl_vector     *c0;</div>
+<div class="line"><a name="l08091"></a><span class="lineno"> 8091</span>     cpl_vector     *cn;</div>
+<div class="line"><a name="l08092"></a><span class="lineno"> 8092</span>     cpl_bivector   *list;</div>
+<div class="line"><a name="l08093"></a><span class="lineno"> 8093</span> <span class="comment">/* alternative (not robust)</span></div>
+<div class="line"><a name="l08094"></a><span class="lineno"> 8094</span> <span class="comment">    cpl_polynomial *poly;</span></div>
+<div class="line"><a name="l08095"></a><span class="lineno"> 8095</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l08096"></a><span class="lineno"> 8096</span> </div>
+<div class="line"><a name="l08097"></a><span class="lineno"> 8097</span>     <span class="keywordtype">double</span> *offset;</div>
+<div class="line"><a name="l08098"></a><span class="lineno"> 8098</span>     <span class="keywordtype">double</span>  rms, q, m;</div>
+<div class="line"><a name="l08099"></a><span class="lineno"> 8099</span> </div>
+<div class="line"><a name="l08100"></a><span class="lineno"> 8100</span>     <span class="keywordtype">int</span> order, nrows, nslits;</div>
+<div class="line"><a name="l08101"></a><span class="lineno"> 8101</span>     <span class="keywordtype">int</span> i, j;</div>
+<div class="line"><a name="l08102"></a><span class="lineno"> 8102</span> </div>
+<div class="line"><a name="l08103"></a><span class="lineno"> 8103</span> </div>
+<div class="line"><a name="l08104"></a><span class="lineno"> 8104</span>     <span class="keywordflow">if</span> (polytraces == NULL) {</div>
+<div class="line"><a name="l08105"></a><span class="lineno"> 8105</span>         cpl_msg_error(func, <span class="stringliteral">"Missing spectral curvature table"</span>);</div>
+<div class="line"><a name="l08106"></a><span class="lineno"> 8106</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l08107"></a><span class="lineno"> 8107</span>     }</div>
+<div class="line"><a name="l08108"></a><span class="lineno"> 8108</span> </div>
+<div class="line"><a name="l08109"></a><span class="lineno"> 8109</span>     <span class="keywordflow">if</span> (slits == NULL) {</div>
+<div class="line"><a name="l08110"></a><span class="lineno"> 8110</span>         cpl_msg_error(func, <span class="stringliteral">"Missing slits positions table"</span>);</div>
+<div class="line"><a name="l08111"></a><span class="lineno"> 8111</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l08112"></a><span class="lineno"> 8112</span>     }</div>
+<div class="line"><a name="l08113"></a><span class="lineno"> 8113</span> </div>
+<div class="line"><a name="l08114"></a><span class="lineno"> 8114</span>     nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l08115"></a><span class="lineno"> 8115</span> </div>
+<div class="line"><a name="l08116"></a><span class="lineno"> 8116</span>     table = cpl_table_duplicate(polytraces);</div>
+<div class="line"><a name="l08117"></a><span class="lineno"> 8117</span>     cpl_table_erase_invalid(table);</div>
+<div class="line"><a name="l08118"></a><span class="lineno"> 8118</span> </div>
+<div class="line"><a name="l08119"></a><span class="lineno"> 8119</span>     nrows = cpl_table_get_nrow(table);</div>
+<div class="line"><a name="l08120"></a><span class="lineno"> 8120</span> </div>
+<div class="line"><a name="l08121"></a><span class="lineno"> 8121</span>     <span class="keywordflow">if</span> (nrows < 4) {</div>
+<div class="line"><a name="l08122"></a><span class="lineno"> 8122</span>         cpl_msg_warning(func, <span class="stringliteral">"Too few successful spectral curvature tracings "</span></div>
+<div class="line"><a name="l08123"></a><span class="lineno"> 8123</span>                       <span class="stringliteral">"(%d): the determination of a global curvature model "</span></div>
+<div class="line"><a name="l08124"></a><span class="lineno"> 8124</span>                       <span class="stringliteral">"failed"</span>, nrows);</div>
+<div class="line"><a name="l08125"></a><span class="lineno"> 8125</span>         <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l08126"></a><span class="lineno"> 8126</span>     }</div>
+<div class="line"><a name="l08127"></a><span class="lineno"> 8127</span>     </div>
+<div class="line"><a name="l08128"></a><span class="lineno"> 8128</span>     order = cpl_table_get_ncol(polytraces) - 2;</div>
+<div class="line"><a name="l08129"></a><span class="lineno"> 8129</span> </div>
+<div class="line"><a name="l08130"></a><span class="lineno"> 8130</span>     <span class="keywordflow">for</span> (i = 0; i <= order; i++) {</div>
+<div class="line"><a name="l08131"></a><span class="lineno"> 8131</span>         <span class="keywordflow">if</span> (!cpl_table_has_column(table, clab[i])) {</div>
+<div class="line"><a name="l08132"></a><span class="lineno"> 8132</span>             cpl_msg_error(func, <span class="stringliteral">"Wrong spectral curvature table"</span>);</div>
+<div class="line"><a name="l08133"></a><span class="lineno"> 8133</span>             <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l08134"></a><span class="lineno"> 8134</span>         }</div>
+<div class="line"><a name="l08135"></a><span class="lineno"> 8135</span>     }</div>
+<div class="line"><a name="l08136"></a><span class="lineno"> 8136</span> </div>
+<div class="line"><a name="l08137"></a><span class="lineno"> 8137</span> </div>
+<div class="line"><a name="l08138"></a><span class="lineno"> 8138</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l08139"></a><span class="lineno"> 8139</span> <span class="comment">     * Fill in advance the missing offset terms</span></div>
+<div class="line"><a name="l08140"></a><span class="lineno"> 8140</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l08141"></a><span class="lineno"> 8141</span> </div>
+<div class="line"><a name="l08142"></a><span class="lineno"> 8142</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l08143"></a><span class="lineno"> 8143</span>         <span class="keywordflow">if</span> (!cpl_table_is_valid(polytraces, clab[0], 2*i)) {</div>
+<div class="line"><a name="l08144"></a><span class="lineno"> 8144</span>             cpl_table_set_double(polytraces, clab[0], 2*i, </div>
+<div class="line"><a name="l08145"></a><span class="lineno"> 8145</span>                                 cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL));</div>
+<div class="line"><a name="l08146"></a><span class="lineno"> 8146</span>         }</div>
+<div class="line"><a name="l08147"></a><span class="lineno"> 8147</span>         <span class="keywordflow">if</span> (!cpl_table_is_valid(polytraces, clab[0], 2*i+1)) {</div>
+<div class="line"><a name="l08148"></a><span class="lineno"> 8148</span>             cpl_table_set_double(polytraces, clab[0], 2*i+1,</div>
+<div class="line"><a name="l08149"></a><span class="lineno"> 8149</span>                              cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL));</div>
+<div class="line"><a name="l08150"></a><span class="lineno"> 8150</span>         }</div>
+<div class="line"><a name="l08151"></a><span class="lineno"> 8151</span>     }</div>
+<div class="line"><a name="l08152"></a><span class="lineno"> 8152</span> </div>
+<div class="line"><a name="l08153"></a><span class="lineno"> 8153</span>     offset = cpl_table_get_data_double(polytraces, clab[0]);</div>
+<div class="line"><a name="l08154"></a><span class="lineno"> 8154</span> </div>
+<div class="line"><a name="l08155"></a><span class="lineno"> 8155</span> </div>
+<div class="line"><a name="l08156"></a><span class="lineno"> 8156</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l08157"></a><span class="lineno"> 8157</span> <span class="comment">     * Fit the global model and modify polytraces table accordingly</span></div>
+<div class="line"><a name="l08158"></a><span class="lineno"> 8158</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l08159"></a><span class="lineno"> 8159</span> </div>
+<div class="line"><a name="l08160"></a><span class="lineno"> 8160</span>     c0 = cpl_vector_wrap(nrows, cpl_table_get_data_double(table, clab[0]));</div>
+<div class="line"><a name="l08161"></a><span class="lineno"> 8161</span> </div>
+<div class="line"><a name="l08162"></a><span class="lineno"> 8162</span>     <span class="keywordflow">for</span> (i = 1; i <= order; i++) {</div>
+<div class="line"><a name="l08163"></a><span class="lineno"> 8163</span>         cn = cpl_vector_wrap(nrows, cpl_table_get_data_double(table, clab[i]));</div>
+<div class="line"><a name="l08164"></a><span class="lineno"> 8164</span>         list = cpl_bivector_wrap_vectors(c0, cn);</div>
+<div class="line"><a name="l08165"></a><span class="lineno"> 8165</span>         robustLinearFit(list, &q, &m, &rms);</div>
+<div class="line"><a name="l08166"></a><span class="lineno"> 8166</span> <span class="comment">/* alternative (not robust)</span></div>
+<div class="line"><a name="l08167"></a><span class="lineno"> 8167</span> <span class="comment">        poly = cpl_polynomial_fit_1d_create(c0, cn, 1, NULL);</span></div>
+<div class="line"><a name="l08168"></a><span class="lineno"> 8168</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l08169"></a><span class="lineno"> 8169</span>         <span class="keywordflow">for</span> (j = 0; j < 2*nslits; j++) {</div>
+<div class="line"><a name="l08170"></a><span class="lineno"> 8170</span>             <span class="keywordflow">if</span> (mode == 1)</div>
+<div class="line"><a name="l08171"></a><span class="lineno"> 8171</span>                 <span class="keywordflow">if</span> (cpl_table_is_valid(polytraces, clab[i], j))</div>
+<div class="line"><a name="l08172"></a><span class="lineno"> 8172</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l08173"></a><span class="lineno"> 8173</span>             cpl_table_set_double(polytraces, clab[i], j, offset[j]*m + q);</div>
+<div class="line"><a name="l08174"></a><span class="lineno"> 8174</span> <span class="comment">/* alternative (not robust)</span></div>
+<div class="line"><a name="l08175"></a><span class="lineno"> 8175</span> <span class="comment">            cpl_table_set_double(polytraces, clab[i], j, </span></div>
+<div class="line"><a name="l08176"></a><span class="lineno"> 8176</span> <span class="comment">                                 cpl_polynomial_eval_1d(poly, offset[j], NULL));</span></div>
+<div class="line"><a name="l08177"></a><span class="lineno"> 8177</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l08178"></a><span class="lineno"> 8178</span>         }</div>
+<div class="line"><a name="l08179"></a><span class="lineno"> 8179</span>         cpl_bivector_unwrap_vectors(list);</div>
+<div class="line"><a name="l08180"></a><span class="lineno"> 8180</span> <span class="comment">/* alternative (not robust)</span></div>
+<div class="line"><a name="l08181"></a><span class="lineno"> 8181</span> <span class="comment">        cpl_polynomial_delete(poly);</span></div>
+<div class="line"><a name="l08182"></a><span class="lineno"> 8182</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l08183"></a><span class="lineno"> 8183</span>         cpl_vector_unwrap(cn);</div>
+<div class="line"><a name="l08184"></a><span class="lineno"> 8184</span>     }</div>
+<div class="line"><a name="l08185"></a><span class="lineno"> 8185</span> </div>
+<div class="line"><a name="l08186"></a><span class="lineno"> 8186</span>     cpl_vector_unwrap(c0);</div>
+<div class="line"><a name="l08187"></a><span class="lineno"> 8187</span>     cpl_table_delete(table);</div>
+<div class="line"><a name="l08188"></a><span class="lineno"> 8188</span> </div>
+<div class="line"><a name="l08189"></a><span class="lineno"> 8189</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l08190"></a><span class="lineno"> 8190</span> </div>
+<div class="line"><a name="l08191"></a><span class="lineno"> 8191</span> }</div>
+<div class="line"><a name="l08192"></a><span class="lineno"> 8192</span> </div>
+<div class="line"><a name="l08193"></a><span class="lineno"> 8193</span> </div>
+<div class="line"><a name="l08263"></a><span class="lineno"><a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13"> 8263</a></span> cpl_image *<a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(cpl_image *spectra, cpl_table *slits,</div>
+<div class="line"><a name="l08264"></a><span class="lineno"> 8264</span>                                    cpl_table *polytraces, <span class="keywordtype">double</span> reference,</div>
+<div class="line"><a name="l08265"></a><span class="lineno"> 8265</span>                                    <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion,</div>
+<div class="line"><a name="l08266"></a><span class="lineno"> 8266</span>                                    <span class="keywordtype">int</span> flux, cpl_image *calibration)</div>
+<div class="line"><a name="l08267"></a><span class="lineno"> 8267</span> {</div>
+<div class="line"><a name="l08268"></a><span class="lineno"> 8268</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_spatial_calibration"</span>;</div>
+<div class="line"><a name="l08269"></a><span class="lineno"> 8269</span> </div>
+<div class="line"><a name="l08270"></a><span class="lineno"> 8270</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l08271"></a><span class="lineno"> 8271</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l08272"></a><span class="lineno"> 8272</span>     cpl_polynomial *polytop;</div>
+<div class="line"><a name="l08273"></a><span class="lineno"> 8273</span>     cpl_polynomial *polybot;</div>
+<div class="line"><a name="l08274"></a><span class="lineno"> 8274</span>     cpl_image     **exslit;</div>
+<div class="line"><a name="l08275"></a><span class="lineno"> 8275</span>     cpl_image      *resampled;</div>
+<div class="line"><a name="l08276"></a><span class="lineno"> 8276</span>     <span class="keywordtype">float</span>          *data;</div>
+<div class="line"><a name="l08277"></a><span class="lineno"> 8277</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l08278"></a><span class="lineno"> 8278</span>     <span class="keywordtype">float</span>          *xdata;</div>
+<div class="line"><a name="l08279"></a><span class="lineno"> 8279</span>     <span class="keywordtype">double</span>          vtop, vbot, value;</div>
+<div class="line"><a name="l08280"></a><span class="lineno"> 8280</span>     <span class="keywordtype">double</span>          top, bot;</div>
+<div class="line"><a name="l08281"></a><span class="lineno"> 8281</span>     <span class="keywordtype">double</span>          coeff;</div>
+<div class="line"><a name="l08282"></a><span class="lineno"> 8282</span>     <span class="keywordtype">double</span>          ytop, ybot;</div>
+<div class="line"><a name="l08283"></a><span class="lineno"> 8283</span>     <span class="keywordtype">double</span>          ypos, yfra;</div>
+<div class="line"><a name="l08284"></a><span class="lineno"> 8284</span>     <span class="keywordtype">double</span>          factor;</div>
+<div class="line"><a name="l08285"></a><span class="lineno"> 8285</span>     <span class="keywordtype">int</span>             yint, ysize, yprev;</div>
+<div class="line"><a name="l08286"></a><span class="lineno"> 8286</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l08287"></a><span class="lineno"> 8287</span>     <span class="keywordtype">int</span>             npseudo;</div>
+<div class="line"><a name="l08288"></a><span class="lineno"> 8288</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l08289"></a><span class="lineno"> 8289</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l08290"></a><span class="lineno"> 8290</span>     <span class="keywordtype">int</span>             nx, ny;</div>
+<div class="line"><a name="l08291"></a><span class="lineno"> 8291</span>     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;</div>
+<div class="line"><a name="l08292"></a><span class="lineno"> 8292</span>     <span class="keywordtype">int</span>             missing_top, missing_bot;</div>
+<div class="line"><a name="l08293"></a><span class="lineno"> 8293</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l08294"></a><span class="lineno"> 8294</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l08295"></a><span class="lineno"> 8295</span>     <span class="keywordtype">int</span>             i, j; </div>
+<div class="line"><a name="l08296"></a><span class="lineno"> 8296</span>     cpl_size        k;</div>
+<div class="line"><a name="l08297"></a><span class="lineno"> 8297</span> </div>
+<div class="line"><a name="l08298"></a><span class="lineno"> 8298</span>     <span class="keywordtype">int</span>             create_position = 1;</div>
+<div class="line"><a name="l08299"></a><span class="lineno"> 8299</span> </div>
+<div class="line"><a name="l08300"></a><span class="lineno"> 8300</span> </div>
+<div class="line"><a name="l08301"></a><span class="lineno"> 8301</span>     <span class="keywordflow">if</span> (spectra == NULL || slits == NULL || polytraces == NULL) {</div>
+<div class="line"><a name="l08302"></a><span class="lineno"> 8302</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l08303"></a><span class="lineno"> 8303</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l08304"></a><span class="lineno"> 8304</span>     }</div>
+<div class="line"><a name="l08305"></a><span class="lineno"> 8305</span> </div>
+<div class="line"><a name="l08306"></a><span class="lineno"> 8306</span>     <span class="keywordflow">if</span> (dispersion <= 0.0) {</div>
+<div class="line"><a name="l08307"></a><span class="lineno"> 8307</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l08308"></a><span class="lineno"> 8308</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l08309"></a><span class="lineno"> 8309</span>     }</div>
+<div class="line"><a name="l08310"></a><span class="lineno"> 8310</span> </div>
+<div class="line"><a name="l08311"></a><span class="lineno"> 8311</span>     <span class="keywordflow">if</span> (red - blue < dispersion) {</div>
+<div class="line"><a name="l08312"></a><span class="lineno"> 8312</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l08313"></a><span class="lineno"> 8313</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l08314"></a><span class="lineno"> 8314</span>     }</div>
+<div class="line"><a name="l08315"></a><span class="lineno"> 8315</span> </div>
+<div class="line"><a name="l08316"></a><span class="lineno"> 8316</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l08317"></a><span class="lineno"> 8317</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l08318"></a><span class="lineno"> 8318</span>     sdata = cpl_image_get_data(spectra);</div>
+<div class="line"><a name="l08319"></a><span class="lineno"> 8319</span>     <span class="keywordflow">if</span> (calibration)</div>
+<div class="line"><a name="l08320"></a><span class="lineno"> 8320</span>         data = cpl_image_get_data(calibration);</div>
+<div class="line"><a name="l08321"></a><span class="lineno"> 8321</span> </div>
+<div class="line"><a name="l08322"></a><span class="lineno"> 8322</span>     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"position"</span>))</div>
+<div class="line"><a name="l08323"></a><span class="lineno"> 8323</span>         create_position = 0;</div>
+<div class="line"><a name="l08324"></a><span class="lineno"> 8324</span> </div>
+<div class="line"><a name="l08325"></a><span class="lineno"> 8325</span>     <span class="keywordflow">if</span> (create_position) {</div>
+<div class="line"><a name="l08326"></a><span class="lineno"> 8326</span>         cpl_table_new_column(slits, <span class="stringliteral">"position"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l08327"></a><span class="lineno"> 8327</span>         cpl_table_new_column(slits, <span class="stringliteral">"length"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l08328"></a><span class="lineno"> 8328</span>         cpl_table_set_column_unit(slits, <span class="stringliteral">"position"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l08329"></a><span class="lineno"> 8329</span>         cpl_table_set_column_unit(slits, <span class="stringliteral">"length"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l08330"></a><span class="lineno"> 8330</span>     }</div>
+<div class="line"><a name="l08331"></a><span class="lineno"> 8331</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l08332"></a><span class="lineno"> 8332</span>         length = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l08333"></a><span class="lineno"> 8333</span> </div>
+<div class="line"><a name="l08334"></a><span class="lineno"> 8334</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l08335"></a><span class="lineno"> 8335</span>     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l08336"></a><span class="lineno"> 8336</span>     order    = cpl_table_get_ncol(polytraces) - 2;</div>
+<div class="line"><a name="l08337"></a><span class="lineno"> 8337</span> </div>
+<div class="line"><a name="l08338"></a><span class="lineno"> 8338</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l08339"></a><span class="lineno"> 8339</span> <span class="comment">     * The spatial resampling is performed for a certain number of </span></div>
+<div class="line"><a name="l08340"></a><span class="lineno"> 8340</span> <span class="comment">     * pixels above and below the position of the reference wavelength:</span></div>
+<div class="line"><a name="l08341"></a><span class="lineno"> 8341</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l08342"></a><span class="lineno"> 8342</span> </div>
+<div class="line"><a name="l08343"></a><span class="lineno"> 8343</span>     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;</div>
+<div class="line"><a name="l08344"></a><span class="lineno"> 8344</span>     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;</div>
+<div class="line"><a name="l08345"></a><span class="lineno"> 8345</span> </div>
+<div class="line"><a name="l08346"></a><span class="lineno"> 8346</span>     exslit = cpl_calloc(nslits, <span class="keyword">sizeof</span>(cpl_image *));</div>
+<div class="line"><a name="l08347"></a><span class="lineno"> 8347</span> </div>
+<div class="line"><a name="l08348"></a><span class="lineno"> 8348</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l08349"></a><span class="lineno"> 8349</span>         </div>
+<div class="line"><a name="l08350"></a><span class="lineno"> 8350</span>         <span class="keywordflow">if</span> (create_position == 0)</div>
+<div class="line"><a name="l08351"></a><span class="lineno"> 8351</span>             <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l08352"></a><span class="lineno"> 8352</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l08353"></a><span class="lineno"> 8353</span> </div>
+<div class="line"><a name="l08354"></a><span class="lineno"> 8354</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l08355"></a><span class="lineno"> 8355</span> <span class="comment">         * Note that the x coordinate of the reference pixels on the CCD</span></div>
+<div class="line"><a name="l08356"></a><span class="lineno"> 8356</span> <span class="comment">         * is taken arbitrarily at the top end of each slit. This wouldn't</span></div>
+<div class="line"><a name="l08357"></a><span class="lineno"> 8357</span> <span class="comment">         * be entirely correct in case of curved slits, or in presence of</span></div>
+<div class="line"><a name="l08358"></a><span class="lineno"> 8358</span> <span class="comment">         * heavy distortions: in such cases the spatial resampling is</span></div>
+<div class="line"><a name="l08359"></a><span class="lineno"> 8359</span> <span class="comment">         * really performed across a wide range of wavelengths. But</span></div>
+<div class="line"><a name="l08360"></a><span class="lineno"> 8360</span> <span class="comment">         * the lag between top and bottom spectral curvature models </span></div>
+<div class="line"><a name="l08361"></a><span class="lineno"> 8361</span> <span class="comment">         * would introduce even in such cases negligible effects on</span></div>
+<div class="line"><a name="l08362"></a><span class="lineno"> 8362</span> <span class="comment">         * the spectral spatial resampling.</span></div>
+<div class="line"><a name="l08363"></a><span class="lineno"> 8363</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l08364"></a><span class="lineno"> 8364</span> </div>
+<div class="line"><a name="l08365"></a><span class="lineno"> 8365</span>         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);</div>
+<div class="line"><a name="l08366"></a><span class="lineno"> 8366</span> </div>
+<div class="line"><a name="l08367"></a><span class="lineno"> 8367</span>         start_pixel = refpixel - pixel_below;</div>
+<div class="line"><a name="l08368"></a><span class="lineno"> 8368</span>         <span class="keywordflow">if</span> (start_pixel < 0)</div>
+<div class="line"><a name="l08369"></a><span class="lineno"> 8369</span>             start_pixel = 0;</div>
+<div class="line"><a name="l08370"></a><span class="lineno"> 8370</span> </div>
+<div class="line"><a name="l08371"></a><span class="lineno"> 8371</span>         end_pixel = refpixel + pixel_above;</div>
+<div class="line"><a name="l08372"></a><span class="lineno"> 8372</span>         <span class="keywordflow">if</span> (end_pixel > nx)</div>
+<div class="line"><a name="l08373"></a><span class="lineno"> 8373</span>             end_pixel = nx;</div>
+<div class="line"><a name="l08374"></a><span class="lineno"> 8374</span> </div>
+<div class="line"><a name="l08375"></a><span class="lineno"> 8375</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l08376"></a><span class="lineno"> 8376</span> <span class="comment">         * Recover from the table of spectral curvature coefficients</span></div>
+<div class="line"><a name="l08377"></a><span class="lineno"> 8377</span> <span class="comment">         * the curvature polynomials.</span></div>
+<div class="line"><a name="l08378"></a><span class="lineno"> 8378</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l08379"></a><span class="lineno"> 8379</span> </div>
+<div class="line"><a name="l08380"></a><span class="lineno"> 8380</span>         missing_top = 0;</div>
+<div class="line"><a name="l08381"></a><span class="lineno"> 8381</span>         polytop = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l08382"></a><span class="lineno"> 8382</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l08383"></a><span class="lineno"> 8383</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);</div>
+<div class="line"><a name="l08384"></a><span class="lineno"> 8384</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l08385"></a><span class="lineno"> 8385</span>                 cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l08386"></a><span class="lineno"> 8386</span>                 missing_top = 1;</div>
+<div class="line"><a name="l08387"></a><span class="lineno"> 8387</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l08388"></a><span class="lineno"> 8388</span>             }</div>
+<div class="line"><a name="l08389"></a><span class="lineno"> 8389</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l08390"></a><span class="lineno"> 8390</span>         }</div>
+<div class="line"><a name="l08391"></a><span class="lineno"> 8391</span> </div>
+<div class="line"><a name="l08392"></a><span class="lineno"> 8392</span>         missing_bot = 0;</div>
+<div class="line"><a name="l08393"></a><span class="lineno"> 8393</span>         polybot = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l08394"></a><span class="lineno"> 8394</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l08395"></a><span class="lineno"> 8395</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);</div>
+<div class="line"><a name="l08396"></a><span class="lineno"> 8396</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l08397"></a><span class="lineno"> 8397</span>                 cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l08398"></a><span class="lineno"> 8398</span>                 missing_bot = 1;</div>
+<div class="line"><a name="l08399"></a><span class="lineno"> 8399</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l08400"></a><span class="lineno"> 8400</span>             }</div>
+<div class="line"><a name="l08401"></a><span class="lineno"> 8401</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l08402"></a><span class="lineno"> 8402</span>         }</div>
+<div class="line"><a name="l08403"></a><span class="lineno"> 8403</span> </div>
+<div class="line"><a name="l08404"></a><span class="lineno"> 8404</span>         <span class="keywordflow">if</span> (missing_top && missing_bot) {</div>
+<div class="line"><a name="l08405"></a><span class="lineno"> 8405</span>             cpl_msg_warning(func, <span class="stringliteral">"Spatial calibration, slit %d was not "</span></div>
+<div class="line"><a name="l08406"></a><span class="lineno"> 8406</span>                             <span class="stringliteral">"traced: no extraction!"</span>, </div>
+<div class="line"><a name="l08407"></a><span class="lineno"> 8407</span>                             slit_id[i]);</div>
+<div class="line"><a name="l08408"></a><span class="lineno"> 8408</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l08409"></a><span class="lineno"> 8409</span>         }</div>
+<div class="line"><a name="l08410"></a><span class="lineno"> 8410</span> </div>
+<div class="line"><a name="l08411"></a><span class="lineno"> 8411</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l08412"></a><span class="lineno"> 8412</span> <span class="comment">         * In case just one of the two edges was not traced, the other</span></div>
+<div class="line"><a name="l08413"></a><span class="lineno"> 8413</span> <span class="comment">         * edge curvature model is duplicated and shifted to the other</span></div>
+<div class="line"><a name="l08414"></a><span class="lineno"> 8414</span> <span class="comment">         * end of the slit: better than nothing!</span></div>
+<div class="line"><a name="l08415"></a><span class="lineno"> 8415</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l08416"></a><span class="lineno"> 8416</span> </div>
+<div class="line"><a name="l08417"></a><span class="lineno"> 8417</span>         <span class="keywordflow">if</span> (missing_top) {</div>
+<div class="line"><a name="l08418"></a><span class="lineno"> 8418</span>             cpl_msg_warning(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l08419"></a><span class="lineno"> 8419</span>                             <span class="stringliteral">"the spectral curvature of the lower edge "</span></div>
+<div class="line"><a name="l08420"></a><span class="lineno"> 8420</span>                             <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l08421"></a><span class="lineno"> 8421</span>             polytop = cpl_polynomial_duplicate(polybot);</div>
+<div class="line"><a name="l08422"></a><span class="lineno"> 8422</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l08423"></a><span class="lineno"> 8423</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l08424"></a><span class="lineno"> 8424</span>             k = 0;</div>
+<div class="line"><a name="l08425"></a><span class="lineno"> 8425</span>             coeff = cpl_polynomial_get_coeff(polybot, &k);</div>
+<div class="line"><a name="l08426"></a><span class="lineno"> 8426</span>             coeff += ytop - ybot;</div>
+<div class="line"><a name="l08427"></a><span class="lineno"> 8427</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l08428"></a><span class="lineno"> 8428</span>         }</div>
+<div class="line"><a name="l08429"></a><span class="lineno"> 8429</span> </div>
+<div class="line"><a name="l08430"></a><span class="lineno"> 8430</span>         <span class="keywordflow">if</span> (missing_bot) {</div>
+<div class="line"><a name="l08431"></a><span class="lineno"> 8431</span>             cpl_msg_warning(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l08432"></a><span class="lineno"> 8432</span>                             <span class="stringliteral">"the spectral curvature of the upper edge "</span></div>
+<div class="line"><a name="l08433"></a><span class="lineno"> 8433</span>                             <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l08434"></a><span class="lineno"> 8434</span>             polybot = cpl_polynomial_duplicate(polytop);</div>
+<div class="line"><a name="l08435"></a><span class="lineno"> 8435</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l08436"></a><span class="lineno"> 8436</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l08437"></a><span class="lineno"> 8437</span>             k = 0;</div>
+<div class="line"><a name="l08438"></a><span class="lineno"> 8438</span>             coeff = cpl_polynomial_get_coeff(polytop, &k);</div>
+<div class="line"><a name="l08439"></a><span class="lineno"> 8439</span>             coeff -= ytop - ybot;</div>
+<div class="line"><a name="l08440"></a><span class="lineno"> 8440</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l08441"></a><span class="lineno"> 8441</span>         }</div>
+<div class="line"><a name="l08442"></a><span class="lineno"> 8442</span> </div>
+<div class="line"><a name="l08443"></a><span class="lineno"> 8443</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l08444"></a><span class="lineno"> 8444</span> <span class="comment">         * Allocate image for current extracted slit</span></div>
+<div class="line"><a name="l08445"></a><span class="lineno"> 8445</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l08446"></a><span class="lineno"> 8446</span> </div>
+<div class="line"><a name="l08447"></a><span class="lineno"> 8447</span>         top = cpl_polynomial_eval_1d(polytop, refpixel, NULL);</div>
+<div class="line"><a name="l08448"></a><span class="lineno"> 8448</span>         bot = cpl_polynomial_eval_1d(polybot, refpixel, NULL);</div>
+<div class="line"><a name="l08449"></a><span class="lineno"> 8449</span>         npseudo = ceil(top-bot) + 1;</div>
+<div class="line"><a name="l08450"></a><span class="lineno"> 8450</span> </div>
+<div class="line"><a name="l08451"></a><span class="lineno"> 8451</span>         <span class="keywordflow">if</span> (npseudo < 1) {</div>
+<div class="line"><a name="l08452"></a><span class="lineno"> 8452</span>             cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l08453"></a><span class="lineno"> 8453</span>             cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l08454"></a><span class="lineno"> 8454</span>             cpl_msg_warning(func, <span class="stringliteral">"Slit %d was badly traced: no extraction!"</span>,</div>
+<div class="line"><a name="l08455"></a><span class="lineno"> 8455</span>                             slit_id[i]);</div>
+<div class="line"><a name="l08456"></a><span class="lineno"> 8456</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l08457"></a><span class="lineno"> 8457</span>         }</div>
+<div class="line"><a name="l08458"></a><span class="lineno"> 8458</span> </div>
+<div class="line"><a name="l08459"></a><span class="lineno"> 8459</span>         exslit[i] = cpl_image_new(nx, npseudo+1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l08460"></a><span class="lineno"> 8460</span>         xdata = cpl_image_get_data(exslit[i]);</div>
+<div class="line"><a name="l08461"></a><span class="lineno"> 8461</span> </div>
+<div class="line"><a name="l08462"></a><span class="lineno"> 8462</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l08463"></a><span class="lineno"> 8463</span> <span class="comment">         * Write interpolated values to slit image.</span></div>
+<div class="line"><a name="l08464"></a><span class="lineno"> 8464</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l08465"></a><span class="lineno"> 8465</span> </div>
+<div class="line"><a name="l08466"></a><span class="lineno"> 8466</span>         <span class="keywordflow">for</span> (j = start_pixel; j < end_pixel; j++) {</div>
+<div class="line"><a name="l08467"></a><span class="lineno"> 8467</span>             top = cpl_polynomial_eval_1d(polytop, j, NULL);</div>
+<div class="line"><a name="l08468"></a><span class="lineno"> 8468</span>             bot = cpl_polynomial_eval_1d(polybot, j, NULL);</div>
+<div class="line"><a name="l08469"></a><span class="lineno"> 8469</span>             factor = (top-bot)/npseudo;</div>
+<div class="line"><a name="l08470"></a><span class="lineno"> 8470</span>             <span class="keywordflow">for</span> (k = 0; k <= npseudo; k++) {</div>
+<div class="line"><a name="l08471"></a><span class="lineno"> 8471</span>                 ypos = top - k*factor;</div>
+<div class="line"><a name="l08472"></a><span class="lineno"> 8472</span>                 yint = ypos;</div>
+<div class="line"><a name="l08473"></a><span class="lineno"> 8473</span>                 yfra = ypos - yint;</div>
+<div class="line"><a name="l08474"></a><span class="lineno"> 8474</span>                 <span class="keywordflow">if</span> (yint >= 0 && yint < ny-1) {</div>
+<div class="line"><a name="l08475"></a><span class="lineno"> 8475</span>                     vtop = sdata[j + nx*yint];</div>
+<div class="line"><a name="l08476"></a><span class="lineno"> 8476</span>                     vbot = sdata[j + nx*(yint+1)];</div>
+<div class="line"><a name="l08477"></a><span class="lineno"> 8477</span>                     value = vtop*(1-yfra) + vbot*yfra;</div>
+<div class="line"><a name="l08478"></a><span class="lineno"> 8478</span>                     <span class="keywordflow">if</span> (flux)</div>
+<div class="line"><a name="l08479"></a><span class="lineno"> 8479</span>                         value *= factor;</div>
+<div class="line"><a name="l08480"></a><span class="lineno"> 8480</span>                     xdata[j + nx*(npseudo-k)] = value;</div>
+<div class="line"><a name="l08481"></a><span class="lineno"> 8481</span>                     <span class="keywordflow">if</span> (calibration) {</div>
+<div class="line"><a name="l08482"></a><span class="lineno"> 8482</span>                         data[j + nx*yint] = (top-yint)/factor;</div>
+<div class="line"><a name="l08483"></a><span class="lineno"> 8483</span>                         <span class="keywordflow">if</span> (k) {</div>
+<div class="line"><a name="l08484"></a><span class="lineno"> 8484</span> </div>
+<div class="line"><a name="l08485"></a><span class="lineno"> 8485</span>                             <span class="comment">/*</span></div>
+<div class="line"><a name="l08486"></a><span class="lineno"> 8486</span> <span class="comment">                             * This is added to recover lost pixels on</span></div>
+<div class="line"><a name="l08487"></a><span class="lineno"> 8487</span> <span class="comment">                             * the CCD image (pixels are lost because</span></div>
+<div class="line"><a name="l08488"></a><span class="lineno"> 8488</span> <span class="comment">                             * the CCD pixels are less than npseudo+1).</span></div>
+<div class="line"><a name="l08489"></a><span class="lineno"> 8489</span> <span class="comment">                             */</span></div>
+<div class="line"><a name="l08490"></a><span class="lineno"> 8490</span> </div>
+<div class="line"><a name="l08491"></a><span class="lineno"> 8491</span>                             <span class="keywordflow">if</span> (yprev - yint > 1) {</div>
+<div class="line"><a name="l08492"></a><span class="lineno"> 8492</span>                                 data[j + nx*(yint+1)] = (top-yint-1)/factor;</div>
+<div class="line"><a name="l08493"></a><span class="lineno"> 8493</span>                             }</div>
+<div class="line"><a name="l08494"></a><span class="lineno"> 8494</span>                         }</div>
+<div class="line"><a name="l08495"></a><span class="lineno"> 8495</span>                     }</div>
+<div class="line"><a name="l08496"></a><span class="lineno"> 8496</span>                 }</div>
+<div class="line"><a name="l08497"></a><span class="lineno"> 8497</span>                 yprev = yint;</div>
+<div class="line"><a name="l08498"></a><span class="lineno"> 8498</span>             }</div>
+<div class="line"><a name="l08499"></a><span class="lineno"> 8499</span>         }</div>
+<div class="line"><a name="l08500"></a><span class="lineno"> 8500</span>         cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l08501"></a><span class="lineno"> 8501</span>         cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l08502"></a><span class="lineno"> 8502</span>     }</div>
+<div class="line"><a name="l08503"></a><span class="lineno"> 8503</span> </div>
+<div class="line"><a name="l08504"></a><span class="lineno"> 8504</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l08505"></a><span class="lineno"> 8505</span> <span class="comment">     * Now all the slits images are copied to a single image</span></div>
+<div class="line"><a name="l08506"></a><span class="lineno"> 8506</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l08507"></a><span class="lineno"> 8507</span> </div>
+<div class="line"><a name="l08508"></a><span class="lineno"> 8508</span>     ysize = 0;</div>
+<div class="line"><a name="l08509"></a><span class="lineno"> 8509</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)</div>
+<div class="line"><a name="l08510"></a><span class="lineno"> 8510</span>         <span class="keywordflow">if</span> (exslit[i])</div>
+<div class="line"><a name="l08511"></a><span class="lineno"> 8511</span>             ysize += cpl_image_get_size_y(exslit[i]);</div>
+<div class="line"><a name="l08512"></a><span class="lineno"> 8512</span> </div>
+<div class="line"><a name="l08513"></a><span class="lineno"> 8513</span>     resampled = cpl_image_new(nx, ysize, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l08514"></a><span class="lineno"> 8514</span> </div>
+<div class="line"><a name="l08515"></a><span class="lineno"> 8515</span>     yint = -1;</div>
+<div class="line"><a name="l08516"></a><span class="lineno"> 8516</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l08517"></a><span class="lineno"> 8517</span>         <span class="keywordflow">if</span> (exslit[i]) {</div>
+<div class="line"><a name="l08518"></a><span class="lineno"> 8518</span>             yint += cpl_image_get_size_y(exslit[i]);</div>
+<div class="line"><a name="l08519"></a><span class="lineno"> 8519</span>             cpl_image_copy(resampled, exslit[i], 1, ysize - yint);</div>
+<div class="line"><a name="l08520"></a><span class="lineno"> 8520</span>             <span class="keywordflow">if</span> (create_position) {</div>
+<div class="line"><a name="l08521"></a><span class="lineno"> 8521</span>                 cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, i, ysize - yint - 1);</div>
+<div class="line"><a name="l08522"></a><span class="lineno"> 8522</span>                 cpl_table_set_int(slits, <span class="stringliteral">"length"</span>, i, </div>
+<div class="line"><a name="l08523"></a><span class="lineno"> 8523</span>                                   cpl_image_get_size_y(exslit[i]));</div>
+<div class="line"><a name="l08524"></a><span class="lineno"> 8524</span>             }</div>
+<div class="line"><a name="l08525"></a><span class="lineno"> 8525</span>             cpl_image_delete(exslit[i]);</div>
+<div class="line"><a name="l08526"></a><span class="lineno"> 8526</span>         }</div>
+<div class="line"><a name="l08527"></a><span class="lineno"> 8527</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (create_position) {</div>
+<div class="line"><a name="l08528"></a><span class="lineno"> 8528</span>             cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, i, -1);</div>
+<div class="line"><a name="l08529"></a><span class="lineno"> 8529</span>             cpl_table_set_int(slits, <span class="stringliteral">"length"</span>, i, 0);</div>
+<div class="line"><a name="l08530"></a><span class="lineno"> 8530</span>         }</div>
+<div class="line"><a name="l08531"></a><span class="lineno"> 8531</span>     }</div>
+<div class="line"><a name="l08532"></a><span class="lineno"> 8532</span> </div>
+<div class="line"><a name="l08533"></a><span class="lineno"> 8533</span> </div>
+<div class="line"><a name="l08534"></a><span class="lineno"> 8534</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l08535"></a><span class="lineno"> 8535</span> <span class="comment">     * Elimination of non-traced slits from slit position table: we cannot do</span></div>
+<div class="line"><a name="l08536"></a><span class="lineno"> 8536</span> <span class="comment">     * it because we would lose sync with polytraces and other slit-oriented</span></div>
+<div class="line"><a name="l08537"></a><span class="lineno"> 8537</span> <span class="comment">     * tables. COMMENTED OUT.</span></div>
+<div class="line"><a name="l08538"></a><span class="lineno"> 8538</span> <span class="comment">     * </span></div>
+<div class="line"><a name="l08539"></a><span class="lineno"> 8539</span> <span class="comment"></span></div>
+<div class="line"><a name="l08540"></a><span class="lineno"> 8540</span> <span class="comment">    if (create_position) {</span></div>
+<div class="line"><a name="l08541"></a><span class="lineno"> 8541</span> <span class="comment"></span></div>
+<div class="line"><a name="l08542"></a><span class="lineno"> 8542</span> <span class="comment">        if (cpl_table_and_selected_int(slits, "position", CPL_EQUAL_TO, -1))</span></div>
+<div class="line"><a name="l08543"></a><span class="lineno"> 8543</span> <span class="comment">            cpl_table_erase_selected(slits);</span></div>
+<div class="line"><a name="l08544"></a><span class="lineno"> 8544</span> <span class="comment"></span></div>
+<div class="line"><a name="l08545"></a><span class="lineno"> 8545</span> <span class="comment">    }</span></div>
+<div class="line"><a name="l08546"></a><span class="lineno"> 8546</span> <span class="comment"></span></div>
+<div class="line"><a name="l08547"></a><span class="lineno"> 8547</span> <span class="comment">    */</span></div>
+<div class="line"><a name="l08548"></a><span class="lineno"> 8548</span> </div>
+<div class="line"><a name="l08549"></a><span class="lineno"> 8549</span>     cpl_free(exslit);</div>
+<div class="line"><a name="l08550"></a><span class="lineno"> 8550</span> </div>
+<div class="line"><a name="l08551"></a><span class="lineno"> 8551</span>     <span class="keywordflow">return</span> resampled;</div>
+<div class="line"><a name="l08552"></a><span class="lineno"> 8552</span> </div>
+<div class="line"><a name="l08553"></a><span class="lineno"> 8553</span> }</div>
+<div class="line"><a name="l08554"></a><span class="lineno"> 8554</span> </div>
+<div class="line"><a name="l08555"></a><span class="lineno"> 8555</span> </div>
+<div class="line"><a name="l08668"></a><span class="lineno"><a class="code" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb"> 8668</a></span> cpl_image *<a class="code" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb" title="Derive wavelength calibration from a rectified arc lamp or sky exposure.">mos_wavelength_calibration_final</a>(cpl_image *image, cpl_table *slits,</div>
+<div class="line"><a name="l08669"></a><span class="lineno"> 8669</span>                                             cpl_vector *lines,</div>
+<div class="line"><a name="l08670"></a><span class="lineno"> 8670</span>                                             <span class="keywordtype">double</span> dispersion, <span class="keywordtype">float</span> level,</div>
+<div class="line"><a name="l08671"></a><span class="lineno"> 8671</span>                                             <span class="keywordtype">int</span> sradius, <span class="keywordtype">int</span> order,</div>
+<div class="line"><a name="l08672"></a><span class="lineno"> 8672</span>                                             <span class="keywordtype">double</span> reject, <span class="keywordtype">double</span> refwave,</div>
+<div class="line"><a name="l08673"></a><span class="lineno"> 8673</span>                                             <span class="keywordtype">double</span> *wavestart, <span class="keywordtype">double</span> *waveend,</div>
+<div class="line"><a name="l08674"></a><span class="lineno"> 8674</span>                                             <span class="keywordtype">int</span> *nlines, <span class="keywordtype">double</span> *error, </div>
+<div class="line"><a name="l08675"></a><span class="lineno"> 8675</span>                                             cpl_table *idscoeff,</div>
+<div class="line"><a name="l08676"></a><span class="lineno"> 8676</span>                                             cpl_image *calibration,</div>
+<div class="line"><a name="l08677"></a><span class="lineno"> 8677</span>                                             cpl_image *residuals,</div>
+<div class="line"><a name="l08678"></a><span class="lineno"> 8678</span>                                             cpl_table *restable,</div>
+<div class="line"><a name="l08679"></a><span class="lineno"> 8679</span>                                             cpl_table *detected_lines)</div>
+<div class="line"><a name="l08680"></a><span class="lineno"> 8680</span> {</div>
+<div class="line"><a name="l08681"></a><span class="lineno"> 8681</span> </div>
+<div class="line"><a name="l08682"></a><span class="lineno"> 8682</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_wavelength_calibration_final"</span>;</div>
+<div class="line"><a name="l08683"></a><span class="lineno"> 8683</span> </div>
+<div class="line"><a name="l08684"></a><span class="lineno"> 8684</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l08685"></a><span class="lineno"> 8685</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l08686"></a><span class="lineno"> 8686</span> </div>
+<div class="line"><a name="l08687"></a><span class="lineno"> 8687</span>     <span class="keywordtype">double</span>  tolerance = 20.0;    <span class="comment">/* Probably forever...                */</span></div>
+<div class="line"><a name="l08688"></a><span class="lineno"> 8688</span>     <span class="keywordtype">int</span>     step = 10;           <span class="comment">/* Compute restable every "step" rows */</span></div>
+<div class="line"><a name="l08689"></a><span class="lineno"> 8689</span> </div>
+<div class="line"><a name="l08690"></a><span class="lineno"> 8690</span>     <span class="keywordtype">char</span>            name[MAX_COLNAME];</div>
+<div class="line"><a name="l08691"></a><span class="lineno"> 8691</span> </div>
+<div class="line"><a name="l08692"></a><span class="lineno"> 8692</span>     cpl_image      *resampled;</div>
+<div class="line"><a name="l08693"></a><span class="lineno"> 8693</span>     cpl_bivector   *peaks_ident;</div>
+<div class="line"><a name="l08694"></a><span class="lineno"> 8694</span>     cpl_vector     *wavel;</div>
+<div class="line"><a name="l08695"></a><span class="lineno"> 8695</span>     cpl_vector     *peaks;</div>
+<div class="line"><a name="l08696"></a><span class="lineno"> 8696</span>     cpl_polynomial *ids;</div>
+<div class="line"><a name="l08697"></a><span class="lineno"> 8697</span>     cpl_polynomial *lin;</div>
+<div class="line"><a name="l08698"></a><span class="lineno"> 8698</span>     cpl_polynomial *fguess;</div>
+<div class="line"><a name="l08699"></a><span class="lineno"> 8699</span>     cpl_table      *coeff;</div>
+<div class="line"><a name="l08700"></a><span class="lineno"> 8700</span>     <span class="keywordtype">double</span>          ids_err;</div>
+<div class="line"><a name="l08701"></a><span class="lineno"> 8701</span>     <span class="keywordtype">double</span>          max_disp, min_disp;</div>
+<div class="line"><a name="l08702"></a><span class="lineno"> 8702</span>     <span class="keywordtype">double</span>         *line;</div>
+<div class="line"><a name="l08703"></a><span class="lineno"> 8703</span>     <span class="keywordtype">double</span>          firstLambda, lastLambda, lambda;</div>
+<div class="line"><a name="l08704"></a><span class="lineno"> 8704</span>     <span class="keywordtype">double</span>          wave, pixe, value;</div>
+<div class="line"><a name="l08705"></a><span class="lineno"> 8705</span>     <span class="keywordtype">double</span>          c;</div>
+<div class="line"><a name="l08706"></a><span class="lineno"> 8706</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l08707"></a><span class="lineno"> 8707</span>     <span class="keywordtype">float</span>          *rdata;</div>
+<div class="line"><a name="l08708"></a><span class="lineno"> 8708</span>     <span class="keywordtype">float</span>          *idata;</div>
+<div class="line"><a name="l08709"></a><span class="lineno"> 8709</span>     <span class="keywordtype">float</span>          *ddata;</div>
+<div class="line"><a name="l08710"></a><span class="lineno"> 8710</span>     <span class="keywordtype">float</span>           v1, v2, vi;</div>
+<div class="line"><a name="l08711"></a><span class="lineno"> 8711</span>     <span class="keywordtype">float</span>           fpixel;</div>
+<div class="line"><a name="l08712"></a><span class="lineno"> 8712</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l08713"></a><span class="lineno"> 8713</span>     <span class="keywordtype">int</span>             pixstart, pixend;</div>
+<div class="line"><a name="l08714"></a><span class="lineno"> 8714</span>     <span class="keywordtype">int</span>             row_top, row_bot;</div>
+<div class="line"><a name="l08715"></a><span class="lineno"> 8715</span>     <span class="keywordtype">int</span>             extrapolation;</div>
+<div class="line"><a name="l08716"></a><span class="lineno"> 8716</span>     <span class="keywordtype">int</span>             nref;</div>
+<div class="line"><a name="l08717"></a><span class="lineno"> 8717</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l08718"></a><span class="lineno"> 8718</span>     <span class="keywordtype">int</span>             nfits;</div>
+<div class="line"><a name="l08719"></a><span class="lineno"> 8719</span>     <span class="keywordtype">int</span>             nl, nx, ny, pixel;</div>
+<div class="line"><a name="l08720"></a><span class="lineno"> 8720</span>     <span class="keywordtype">int</span>             countLines, usedLines;</div>
+<div class="line"><a name="l08721"></a><span class="lineno"> 8721</span>     <span class="keywordtype">int</span>             uorder;</div>
+<div class="line"><a name="l08722"></a><span class="lineno"> 8722</span>     <span class="keywordtype">int</span>             missing;</div>
+<div class="line"><a name="l08723"></a><span class="lineno"> 8723</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l08724"></a><span class="lineno"> 8724</span>     <span class="keywordtype">int</span>             width, uradius;</div>
+<div class="line"><a name="l08725"></a><span class="lineno"> 8725</span>     <span class="keywordtype">int</span>             i, j, s;</div>
+<div class="line"><a name="l08726"></a><span class="lineno"> 8726</span>     cpl_size        k;</div>
+<div class="line"><a name="l08727"></a><span class="lineno"> 8727</span> </div>
+<div class="line"><a name="l08728"></a><span class="lineno"> 8728</span> </div>
+<div class="line"><a name="l08729"></a><span class="lineno"> 8729</span>     <span class="keywordflow">if</span> (dispersion == 0.0) {</div>
+<div class="line"><a name="l08730"></a><span class="lineno"> 8730</span>         cpl_msg_error(func, <span class="stringliteral">"The expected dispersion (A/pixel) must be given"</span>);</div>
+<div class="line"><a name="l08731"></a><span class="lineno"> 8731</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l08732"></a><span class="lineno"> 8732</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l08733"></a><span class="lineno"> 8733</span>     }</div>
+<div class="line"><a name="l08734"></a><span class="lineno"> 8734</span> </div>
+<div class="line"><a name="l08735"></a><span class="lineno"> 8735</span>     <span class="keywordflow">if</span> (dispersion < 0.0) {</div>
+<div class="line"><a name="l08736"></a><span class="lineno"> 8736</span>         cpl_msg_error(func, <span class="stringliteral">"The expected dispersion must be positive"</span>);</div>
+<div class="line"><a name="l08737"></a><span class="lineno"> 8737</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l08738"></a><span class="lineno"> 8738</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l08739"></a><span class="lineno"> 8739</span>     }</div>
+<div class="line"><a name="l08740"></a><span class="lineno"> 8740</span> </div>
+<div class="line"><a name="l08741"></a><span class="lineno"> 8741</span>     <span class="keywordflow">if</span> (idscoeff == NULL) {</div>
+<div class="line"><a name="l08742"></a><span class="lineno"> 8742</span>         cpl_msg_error(func, <span class="stringliteral">"A preallocated IDS coeff table must be given"</span>);</div>
+<div class="line"><a name="l08743"></a><span class="lineno"> 8743</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l08744"></a><span class="lineno"> 8744</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l08745"></a><span class="lineno"> 8745</span>     }</div>
+<div class="line"><a name="l08746"></a><span class="lineno"> 8746</span> </div>
+<div class="line"><a name="l08747"></a><span class="lineno"> 8747</span>     max_disp = dispersion + dispersion * tolerance / 100;</div>
+<div class="line"><a name="l08748"></a><span class="lineno"> 8748</span>     min_disp = dispersion - dispersion * tolerance / 100;</div>
+<div class="line"><a name="l08749"></a><span class="lineno"> 8749</span> </div>
+<div class="line"><a name="l08750"></a><span class="lineno"> 8750</span>     <span class="keywordflow">if</span> (order < 1) {</div>
+<div class="line"><a name="l08751"></a><span class="lineno"> 8751</span>         cpl_msg_error(func, <span class="stringliteral">"The order of the fitting polynomial "</span></div>
+<div class="line"><a name="l08752"></a><span class="lineno"> 8752</span>                       <span class="stringliteral">"must be at least 1"</span>);</div>
+<div class="line"><a name="l08753"></a><span class="lineno"> 8753</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l08754"></a><span class="lineno"> 8754</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l08755"></a><span class="lineno"> 8755</span>     }</div>
+<div class="line"><a name="l08756"></a><span class="lineno"> 8756</span> </div>
+<div class="line"><a name="l08757"></a><span class="lineno"> 8757</span>     <span class="keywordflow">if</span> (image == NULL || lines == NULL) {</div>
+<div class="line"><a name="l08758"></a><span class="lineno"> 8758</span>         cpl_msg_error(func, <span class="stringliteral">"Both spectral exposure and reference line "</span></div>
+<div class="line"><a name="l08759"></a><span class="lineno"> 8759</span>                       <span class="stringliteral">"catalog are required in input"</span>);</div>
+<div class="line"><a name="l08760"></a><span class="lineno"> 8760</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l08761"></a><span class="lineno"> 8761</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l08762"></a><span class="lineno"> 8762</span>     }</div>
+<div class="line"><a name="l08763"></a><span class="lineno"> 8763</span> </div>
+<div class="line"><a name="l08764"></a><span class="lineno"> 8764</span>     nx = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l08765"></a><span class="lineno"> 8765</span>     ny = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l08766"></a><span class="lineno"> 8766</span>     sdata = cpl_image_get_data_float(image);</div>
+<div class="line"><a name="l08767"></a><span class="lineno"> 8767</span> </div>
+<div class="line"><a name="l08768"></a><span class="lineno"> 8768</span>     nref = cpl_vector_get_size(lines);</div>
+<div class="line"><a name="l08769"></a><span class="lineno"> 8769</span>     line = cpl_vector_get_data(lines);</div>
+<div class="line"><a name="l08770"></a><span class="lineno"> 8770</span> </div>
+<div class="line"><a name="l08771"></a><span class="lineno"> 8771</span>     <span class="keywordflow">if</span> (*wavestart < 1.0 && *waveend < 1.0) {</div>
+<div class="line"><a name="l08772"></a><span class="lineno"> 8772</span>         firstLambda = line[0];</div>
+<div class="line"><a name="l08773"></a><span class="lineno"> 8773</span>         lastLambda = line[nref-1];</div>
+<div class="line"><a name="l08774"></a><span class="lineno"> 8774</span>         extrapolation = (lastLambda - firstLambda) / 10;</div>
+<div class="line"><a name="l08775"></a><span class="lineno"> 8775</span>         firstLambda -= extrapolation;</div>
+<div class="line"><a name="l08776"></a><span class="lineno"> 8776</span>         lastLambda += extrapolation;</div>
+<div class="line"><a name="l08777"></a><span class="lineno"> 8777</span>         *wavestart = firstLambda;</div>
+<div class="line"><a name="l08778"></a><span class="lineno"> 8778</span>         *waveend = lastLambda;</div>
+<div class="line"><a name="l08779"></a><span class="lineno"> 8779</span>     }</div>
+<div class="line"><a name="l08780"></a><span class="lineno"> 8780</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l08781"></a><span class="lineno"> 8781</span>         firstLambda = *wavestart;</div>
+<div class="line"><a name="l08782"></a><span class="lineno"> 8782</span>         lastLambda = *waveend;</div>
+<div class="line"><a name="l08783"></a><span class="lineno"> 8783</span>     }</div>
+<div class="line"><a name="l08784"></a><span class="lineno"> 8784</span> </div>
+<div class="line"><a name="l08785"></a><span class="lineno"> 8785</span>     nl = (lastLambda - firstLambda) / dispersion;</div>
+<div class="line"><a name="l08786"></a><span class="lineno"> 8786</span>     resampled = cpl_image_new(nl, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l08787"></a><span class="lineno"> 8787</span>     rdata = cpl_image_get_data_float(resampled);</div>
+<div class="line"><a name="l08788"></a><span class="lineno"> 8788</span> </div>
+<div class="line"><a name="l08789"></a><span class="lineno"> 8789</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l08790"></a><span class="lineno"> 8790</span> <span class="comment">     * Allocate total output table of IDS coefficients</span></div>
+<div class="line"><a name="l08791"></a><span class="lineno"> 8791</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l08792"></a><span class="lineno"> 8792</span> </div>
+<div class="line"><a name="l08793"></a><span class="lineno"> 8793</span>     <span class="keywordflow">for</span> (j = 0; j <= order; j++)</div>
+<div class="line"><a name="l08794"></a><span class="lineno"> 8794</span>         cpl_table_new_column(idscoeff, clab[j], CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08795"></a><span class="lineno"> 8795</span> </div>
+<div class="line"><a name="l08796"></a><span class="lineno"> 8796</span>     <span class="keywordflow">if</span> (calibration)</div>
+<div class="line"><a name="l08797"></a><span class="lineno"> 8797</span>         idata = cpl_image_get_data_float(calibration);</div>
+<div class="line"><a name="l08798"></a><span class="lineno"> 8798</span> </div>
+<div class="line"><a name="l08799"></a><span class="lineno"> 8799</span>     <span class="keywordflow">if</span> (residuals)</div>
+<div class="line"><a name="l08800"></a><span class="lineno"> 8800</span>         ddata = cpl_image_get_data_float(residuals);</div>
+<div class="line"><a name="l08801"></a><span class="lineno"> 8801</span> </div>
+<div class="line"><a name="l08802"></a><span class="lineno"> 8802</span>     <span class="keywordflow">if</span> (restable) {</div>
+<div class="line"><a name="l08803"></a><span class="lineno"> 8803</span>         cpl_table_set_size(restable, nref);</div>
+<div class="line"><a name="l08804"></a><span class="lineno"> 8804</span>         cpl_table_new_column(restable, <span class="stringliteral">"wavelength"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08805"></a><span class="lineno"> 8805</span>         cpl_table_copy_data_double(restable, <span class="stringliteral">"wavelength"</span>, line);</div>
+<div class="line"><a name="l08806"></a><span class="lineno"> 8806</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i += step) {</div>
+<div class="line"><a name="l08807"></a><span class="lineno"> 8807</span>              snprintf(name, MAX_COLNAME, <span class="stringliteral">"r%d"</span>, i);</div>
+<div class="line"><a name="l08808"></a><span class="lineno"> 8808</span>              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08809"></a><span class="lineno"> 8809</span>              snprintf(name, MAX_COLNAME, <span class="stringliteral">"d%d"</span>, i);</div>
+<div class="line"><a name="l08810"></a><span class="lineno"> 8810</span>              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08811"></a><span class="lineno"> 8811</span>              snprintf(name, MAX_COLNAME, <span class="stringliteral">"p%d"</span>, i);</div>
+<div class="line"><a name="l08812"></a><span class="lineno"> 8812</span>              cpl_table_new_column(restable, name, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08813"></a><span class="lineno"> 8813</span>         }</div>
+<div class="line"><a name="l08814"></a><span class="lineno"> 8814</span>     }</div>
+<div class="line"><a name="l08815"></a><span class="lineno"> 8815</span> </div>
+<div class="line"><a name="l08816"></a><span class="lineno"> 8816</span>     <span class="keywordflow">if</span> (detected_lines) {</div>
+<div class="line"><a name="l08817"></a><span class="lineno"> 8817</span>         cpl_table_set_size(detected_lines, 0);</div>
+<div class="line"><a name="l08818"></a><span class="lineno"> 8818</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l08819"></a><span class="lineno"> 8819</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"xpos_rectified"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08820"></a><span class="lineno"> 8820</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"ypos_rectified"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08821"></a><span class="lineno"> 8821</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"xpos_rectified_iter"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08822"></a><span class="lineno"> 8822</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"ypos_rectified_iter"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08823"></a><span class="lineno"> 8823</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"peak_flux"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08824"></a><span class="lineno"> 8824</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"wave_ident"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08825"></a><span class="lineno"> 8825</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"wave_ident_iter"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08826"></a><span class="lineno"> 8826</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"xpos_fit_rect_wavecal"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08827"></a><span class="lineno"> 8827</span>         cpl_table_new_column(detected_lines, <span class="stringliteral">"res_xpos"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08828"></a><span class="lineno"> 8828</span>     }</div>
+<div class="line"><a name="l08829"></a><span class="lineno"> 8829</span> </div>
+<div class="line"><a name="l08830"></a><span class="lineno"> 8830</span> </div>
+<div class="line"><a name="l08831"></a><span class="lineno"> 8831</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l08832"></a><span class="lineno"> 8832</span> <span class="comment">     * Process all slits separately.</span></div>
+<div class="line"><a name="l08833"></a><span class="lineno"> 8833</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l08834"></a><span class="lineno"> 8834</span> </div>
+<div class="line"><a name="l08835"></a><span class="lineno"> 8835</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l08836"></a><span class="lineno"> 8836</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l08837"></a><span class="lineno"> 8837</span> </div>
+<div class="line"><a name="l08838"></a><span class="lineno"> 8838</span>     row_top = ny;</div>
+<div class="line"><a name="l08839"></a><span class="lineno"> 8839</span>     <span class="keywordflow">for</span> (s = 0; s < nslits; s++) {</div>
+<div class="line"><a name="l08840"></a><span class="lineno"> 8840</span> </div>
+<div class="line"><a name="l08841"></a><span class="lineno"> 8841</span>         <span class="keywordtype">int</span> slit_id;</div>
+<div class="line"><a name="l08842"></a><span class="lineno"> 8842</span>         slit_id = cpl_table_get_int(slits, <span class="stringliteral">"slit_id"</span>, s, NULL);</div>
+<div class="line"><a name="l08843"></a><span class="lineno"> 8843</span>         </div>
+<div class="line"><a name="l08844"></a><span class="lineno"> 8844</span>         <span class="keywordflow">if</span> (length[s] == 0)</div>
+<div class="line"><a name="l08845"></a><span class="lineno"> 8845</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l08846"></a><span class="lineno"> 8846</span> </div>
+<div class="line"><a name="l08847"></a><span class="lineno"> 8847</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l08848"></a><span class="lineno"> 8848</span> <span class="comment">         * row_top and row_bot define the boundaries of the current slit.</span></div>
+<div class="line"><a name="l08849"></a><span class="lineno"> 8849</span> <span class="comment">         * Here we begin (arbitrarily...) from the top slit.</span></div>
+<div class="line"><a name="l08850"></a><span class="lineno"> 8850</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l08851"></a><span class="lineno"> 8851</span> </div>
+<div class="line"><a name="l08852"></a><span class="lineno"> 8852</span>         row_bot = cpl_table_get_int(slits, <span class="stringliteral">"position"</span>, s, NULL);</div>
+<div class="line"><a name="l08853"></a><span class="lineno"> 8853</span> </div>
+<div class="line"><a name="l08854"></a><span class="lineno"> 8854</span>         <span class="keywordflow">if</span> (sradius > 0) {</div>
+<div class="line"><a name="l08855"></a><span class="lineno"> 8855</span> </div>
+<div class="line"><a name="l08856"></a><span class="lineno"> 8856</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l08857"></a><span class="lineno"> 8857</span> <span class="comment">             * If a search radius was defined, allocate the table of</span></div>
+<div class="line"><a name="l08858"></a><span class="lineno"> 8858</span> <span class="comment">             * the fitting polynomials coefficients. This table is</span></div>
+<div class="line"><a name="l08859"></a><span class="lineno"> 8859</span> <span class="comment">             * just used to generate the first-guess polynomial made</span></div>
+<div class="line"><a name="l08860"></a><span class="lineno"> 8860</span> <span class="comment">             * of the median coefficients of all polynomials found</span></div>
+<div class="line"><a name="l08861"></a><span class="lineno"> 8861</span> <span class="comment">             * for this slit.</span></div>
+<div class="line"><a name="l08862"></a><span class="lineno"> 8862</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l08863"></a><span class="lineno"> 8863</span> </div>
+<div class="line"><a name="l08864"></a><span class="lineno"> 8864</span>             coeff = cpl_table_new(row_top - row_bot);</div>
+<div class="line"><a name="l08865"></a><span class="lineno"> 8865</span>             <span class="keywordflow">for</span> (j = 0; j <= order; j++)</div>
+<div class="line"><a name="l08866"></a><span class="lineno"> 8866</span>                 cpl_table_new_column(coeff, clab[j], CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l08867"></a><span class="lineno"> 8867</span>         }</div>
+<div class="line"><a name="l08868"></a><span class="lineno"> 8868</span> </div>
+<div class="line"><a name="l08869"></a><span class="lineno"> 8869</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l08870"></a><span class="lineno"> 8870</span> <span class="comment">         * Here is the loop on all rows of the current slit. They are</span></div>
+<div class="line"><a name="l08871"></a><span class="lineno"> 8871</span> <span class="comment">         * wavelength calibrated one by one.</span></div>
+<div class="line"><a name="l08872"></a><span class="lineno"> 8872</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l08873"></a><span class="lineno"> 8873</span> </div>
+<div class="line"><a name="l08874"></a><span class="lineno"> 8874</span>         <span class="keywordflow">for</span> (i = row_bot; i < row_top; i++) {</div>
+<div class="line"><a name="l08875"></a><span class="lineno"> 8875</span>             width = <a class="code" href="group__moses.html#ga28871a4ecc1e2779022f06d4da892360" title="Estimate lines widths (in pixel) in arc lamp spectrum.">mos_lines_width</a>(sdata + i*nx, nx);</div>
+<div class="line"><a name="l08876"></a><span class="lineno"> 8876</span>             <span class="keywordflow">if</span> (width < 5)</div>
+<div class="line"><a name="l08877"></a><span class="lineno"> 8877</span>                 width = 5;</div>
+<div class="line"><a name="l08878"></a><span class="lineno"> 8878</span>             peaks = <a class="code" href="group__moses.html#gad80729870e3acf9f61c820f488eb83b2" title="Find positions of peaks candidates.">mos_peak_candidates</a>(sdata + i*nx, nx, level, width);</div>
+<div class="line"><a name="l08879"></a><span class="lineno"> 8879</span>             <span class="keywordflow">if</span> (peaks) {</div>
+<div class="line"><a name="l08880"></a><span class="lineno"> 8880</span>                 peaks = <a class="code" href="group__moses.html#gacfa971d995aac0c8f05c37499861d191" title="Improve (when possible) accuracy of peaks candidates positions.">mos_refine_peaks</a>(sdata + i*nx, nx, peaks, width);</div>
+<div class="line"><a name="l08881"></a><span class="lineno"> 8881</span>             }</div>
+<div class="line"><a name="l08882"></a><span class="lineno"> 8882</span>             <span class="keywordflow">if</span> (peaks) {</div>
+<div class="line"><a name="l08883"></a><span class="lineno"> 8883</span>                 <span class="keywordtype">int</span> keep_multiplex = mos_multiplex;</div>
+<div class="line"><a name="l08884"></a><span class="lineno"> 8884</span>                 mos_multiplex = -1;</div>
+<div class="line"><a name="l08885"></a><span class="lineno"> 8885</span>                 <span class="keywordflow">if</span>(detected_lines)</div>
+<div class="line"><a name="l08886"></a><span class="lineno"> 8886</span>                 {</div>
+<div class="line"><a name="l08887"></a><span class="lineno"> 8887</span>                     cpl_size newlines = cpl_vector_get_size(peaks); </div>
+<div class="line"><a name="l08888"></a><span class="lineno"> 8888</span>                     cpl_size oldsize = cpl_table_get_nrow(detected_lines); </div>
+<div class="line"><a name="l08889"></a><span class="lineno"> 8889</span>                     cpl_table_set_size(detected_lines, oldsize + newlines);</div>
+<div class="line"><a name="l08890"></a><span class="lineno"> 8890</span>                     <span class="keywordflow">for</span>(cpl_size iline = 0; iline < newlines; ++iline)</div>
+<div class="line"><a name="l08891"></a><span class="lineno"> 8891</span>                     {</div>
+<div class="line"><a name="l08892"></a><span class="lineno"> 8892</span>                         cpl_table_set_int(detected_lines, <span class="stringliteral">"slit_id"</span>,</div>
+<div class="line"><a name="l08893"></a><span class="lineno"> 8893</span>                              oldsize + iline, slit_id);</div>
+<div class="line"><a name="l08894"></a><span class="lineno"> 8894</span>                         cpl_table_set_double(detected_lines, <span class="stringliteral">"xpos_rectified"</span>,</div>
+<div class="line"><a name="l08895"></a><span class="lineno"> 8895</span>                              oldsize + iline, cpl_vector_get(peaks, iline) + 1);</div>
+<div class="line"><a name="l08896"></a><span class="lineno"> 8896</span>                         cpl_table_set_double(detected_lines, <span class="stringliteral">"ypos_rectified"</span>,</div>
+<div class="line"><a name="l08897"></a><span class="lineno"> 8897</span>                              oldsize + iline, (<span class="keywordtype">double</span>)i + 1);</div>
+<div class="line"><a name="l08898"></a><span class="lineno"> 8898</span>                         cpl_table_set_double(detected_lines, <span class="stringliteral">"peak_flux"</span>,</div>
+<div class="line"><a name="l08899"></a><span class="lineno"> 8899</span>                              oldsize + iline, </div>
+<div class="line"><a name="l08900"></a><span class="lineno"> 8900</span>                              sdata[i*nx+(<span class="keywordtype">int</span>)(cpl_vector_get(peaks, iline)+0.5)]);</div>
+<div class="line"><a name="l08901"></a><span class="lineno"> 8901</span>                     }</div>
+<div class="line"><a name="l08902"></a><span class="lineno"> 8902</span>                 }</div>
+<div class="line"><a name="l08903"></a><span class="lineno"> 8903</span>                 peaks_ident = <a class="code" href="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97" title="Identify peak candidates.">mos_identify_peaks</a>(peaks, lines, </div>
+<div class="line"><a name="l08904"></a><span class="lineno"> 8904</span>                                             min_disp, max_disp, 0.05);</div>
+<div class="line"><a name="l08905"></a><span class="lineno"> 8905</span>                 mos_multiplex = keep_multiplex;</div>
+<div class="line"><a name="l08906"></a><span class="lineno"> 8906</span>                 <span class="keywordflow">if</span> (peaks_ident) {</div>
+<div class="line"><a name="l08907"></a><span class="lineno"> 8907</span>                     countLines = cpl_bivector_get_size(peaks_ident);</div>
+<div class="line"><a name="l08908"></a><span class="lineno"> 8908</span>                     <span class="keywordflow">if</span> (countLines < 4) {</div>
+<div class="line"><a name="l08909"></a><span class="lineno"> 8909</span>                         cpl_bivector_delete(peaks_ident);</div>
+<div class="line"><a name="l08910"></a><span class="lineno"> 8910</span>                         cpl_vector_delete(peaks);</div>
+<div class="line"><a name="l08911"></a><span class="lineno"> 8911</span>                         <span class="keywordflow">if</span> (nlines)</div>
+<div class="line"><a name="l08912"></a><span class="lineno"> 8912</span>                             nlines[i] = 0;</div>
+<div class="line"><a name="l08913"></a><span class="lineno"> 8913</span>                         <span class="keywordflow">if</span> (error)</div>
+<div class="line"><a name="l08914"></a><span class="lineno"> 8914</span>                             error[i] = 0.0;</div>
+<div class="line"><a name="l08915"></a><span class="lineno"> 8915</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l08916"></a><span class="lineno"> 8916</span>                     }</div>
+<div class="line"><a name="l08917"></a><span class="lineno"> 8917</span> </div>
+<div class="line"><a name="l08918"></a><span class="lineno"> 8918</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l08919"></a><span class="lineno"> 8919</span> <span class="comment">                     * Set reference wavelength as zero point</span></div>
+<div class="line"><a name="l08920"></a><span class="lineno"> 8920</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l08921"></a><span class="lineno"> 8921</span> </div>
+<div class="line"><a name="l08922"></a><span class="lineno"> 8922</span>                     wavel = cpl_bivector_get_y(peaks_ident);</div>
+<div class="line"><a name="l08923"></a><span class="lineno"> 8923</span>                     cpl_vector_subtract_scalar(wavel, refwave);</div>
+<div class="line"><a name="l08924"></a><span class="lineno"> 8924</span> </div>
+<div class="line"><a name="l08925"></a><span class="lineno"> 8925</span>                     uorder = countLines / 2 - 1;</div>
+<div class="line"><a name="l08926"></a><span class="lineno"> 8926</span>                     <span class="keywordflow">if</span> (uorder > order)</div>
+<div class="line"><a name="l08927"></a><span class="lineno"> 8927</span>                         uorder = order;</div>
+<div class="line"><a name="l08928"></a><span class="lineno"> 8928</span> </div>
+<div class="line"><a name="l08929"></a><span class="lineno"> 8929</span>                     ids = <a class="code" href="group__moses.html#ga4d584e69389518aab8d6932e5841d399" title="Fit polynomial relation from wavelengths to pixels.">mos_poly_wav2pix</a>(peaks_ident, uorder, reject,</div>
+<div class="line"><a name="l08930"></a><span class="lineno"> 8930</span>                                            2 * (uorder + 1), &usedLines,</div>
+<div class="line"><a name="l08931"></a><span class="lineno"> 8931</span>                                            &ids_err);</div>
+<div class="line"><a name="l08932"></a><span class="lineno"> 8932</span> </div>
+<div class="line"><a name="l08933"></a><span class="lineno"> 8933</span>                     <span class="keywordflow">if</span> (ids == NULL) {</div>
+<div class="line"><a name="l08934"></a><span class="lineno"> 8934</span>                         cpl_bivector_delete(peaks_ident);</div>
+<div class="line"><a name="l08935"></a><span class="lineno"> 8935</span>                         cpl_vector_delete(peaks);</div>
+<div class="line"><a name="l08936"></a><span class="lineno"> 8936</span>                         <span class="keywordflow">if</span> (nlines)</div>
+<div class="line"><a name="l08937"></a><span class="lineno"> 8937</span>                             nlines[i] = 0;</div>
+<div class="line"><a name="l08938"></a><span class="lineno"> 8938</span>                         <span class="keywordflow">if</span> (error)</div>
+<div class="line"><a name="l08939"></a><span class="lineno"> 8939</span>                             error[i] = 0.0;</div>
+<div class="line"><a name="l08940"></a><span class="lineno"> 8940</span>                         cpl_error_reset();</div>
+<div class="line"><a name="l08941"></a><span class="lineno"> 8941</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l08942"></a><span class="lineno"> 8942</span>                     }</div>
+<div class="line"><a name="l08943"></a><span class="lineno"> 8943</span> </div>
+<div class="line"><a name="l08944"></a><span class="lineno"> 8944</span>                     <span class="keywordflow">if</span> (sradius > 0) {</div>
+<div class="line"><a name="l08945"></a><span class="lineno"> 8945</span>                         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l08946"></a><span class="lineno"> 8946</span>                             <span class="keywordflow">if</span> (k > uorder) {</div>
+<div class="line"><a name="l08947"></a><span class="lineno"> 8947</span>                                 cpl_table_set_double(coeff, clab[k], </div>
+<div class="line"><a name="l08948"></a><span class="lineno"> 8948</span>                                 i - row_bot, 0.0);</div>
+<div class="line"><a name="l08949"></a><span class="lineno"> 8949</span>                             }</div>
+<div class="line"><a name="l08950"></a><span class="lineno"> 8950</span>                             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l08951"></a><span class="lineno"> 8951</span>                                 cpl_table_set_double(coeff, clab[k], </div>
+<div class="line"><a name="l08952"></a><span class="lineno"> 8952</span>                                 i - row_bot, cpl_polynomial_get_coeff(ids, &k));</div>
+<div class="line"><a name="l08953"></a><span class="lineno"> 8953</span>                             }</div>
+<div class="line"><a name="l08954"></a><span class="lineno"> 8954</span>                         }</div>
+<div class="line"><a name="l08955"></a><span class="lineno"> 8955</span>                     }</div>
+<div class="line"><a name="l08956"></a><span class="lineno"> 8956</span>                <span class="comment">/*   else {   */</span></div>
+<div class="line"><a name="l08957"></a><span class="lineno"> 8957</span>                         <span class="keywordflow">if</span> (calibration) {</div>
+<div class="line"><a name="l08958"></a><span class="lineno"> 8958</span>                             pixstart = cpl_polynomial_eval_1d(ids,</div>
+<div class="line"><a name="l08959"></a><span class="lineno"> 8959</span>                               cpl_bivector_get_y_data(peaks_ident)[0], </div>
+<div class="line"><a name="l08960"></a><span class="lineno"> 8960</span>                               NULL);</div>
+<div class="line"><a name="l08961"></a><span class="lineno"> 8961</span>                             pixend = cpl_polynomial_eval_1d(ids,</div>
+<div class="line"><a name="l08962"></a><span class="lineno"> 8962</span>                               cpl_bivector_get_y_data(peaks_ident)[countLines-1],</div>
+<div class="line"><a name="l08963"></a><span class="lineno"> 8963</span>                               NULL);</div>
+<div class="line"><a name="l08964"></a><span class="lineno"> 8964</span>                             extrapolation = (pixend - pixstart) / 5;</div>
+<div class="line"><a name="l08965"></a><span class="lineno"> 8965</span>                             pixstart -= extrapolation;</div>
+<div class="line"><a name="l08966"></a><span class="lineno"> 8966</span>                             pixend += extrapolation;</div>
+<div class="line"><a name="l08967"></a><span class="lineno"> 8967</span>                             <span class="keywordflow">if</span> (pixstart < 0)</div>
+<div class="line"><a name="l08968"></a><span class="lineno"> 8968</span>                                 pixstart = 0;</div>
+<div class="line"><a name="l08969"></a><span class="lineno"> 8969</span>                             <span class="keywordflow">if</span> (pixend > nx)</div>
+<div class="line"><a name="l08970"></a><span class="lineno"> 8970</span>                                 pixend = nx;</div>
+<div class="line"><a name="l08971"></a><span class="lineno"> 8971</span>    </div>
+<div class="line"><a name="l08972"></a><span class="lineno"> 8972</span>                             <span class="keywordflow">for</span> (j = pixstart; j < pixend; j++) {</div>
+<div class="line"><a name="l08973"></a><span class="lineno"> 8973</span>                                 (idata + i*nx)[j] = <a class="code" href="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a" title="Evaluate the wavelength of a pixel position.">mos_eval_dds</a>(ids, </div>
+<div class="line"><a name="l08974"></a><span class="lineno"> 8974</span>                                      firstLambda, lastLambda, refwave, j);</div>
+<div class="line"><a name="l08975"></a><span class="lineno"> 8975</span>                             }</div>
+<div class="line"><a name="l08976"></a><span class="lineno"> 8976</span>                         }</div>
+<div class="line"><a name="l08977"></a><span class="lineno"> 8977</span> </div>
+<div class="line"><a name="l08978"></a><span class="lineno"> 8978</span>                         <span class="comment">/*</span></div>
+<div class="line"><a name="l08979"></a><span class="lineno"> 8979</span> <span class="comment">                         * Residuals image</span></div>
+<div class="line"><a name="l08980"></a><span class="lineno"> 8980</span> <span class="comment">                         */</span></div>
+<div class="line"><a name="l08981"></a><span class="lineno"> 8981</span>         </div>
+<div class="line"><a name="l08982"></a><span class="lineno"> 8982</span>                         <span class="keywordflow">if</span> (residuals || (restable && !(i%step))) {</div>
+<div class="line"><a name="l08983"></a><span class="lineno"> 8983</span>                             <span class="keywordflow">if</span> (restable && !(i%step)) {</div>
+<div class="line"><a name="l08984"></a><span class="lineno"> 8984</span>                                 lin = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l08985"></a><span class="lineno"> 8985</span>                                 <span class="keywordflow">for</span> (k = 0; k < 2; k++)</div>
+<div class="line"><a name="l08986"></a><span class="lineno"> 8986</span>                                     cpl_polynomial_set_coeff(lin, &k,</div>
+<div class="line"><a name="l08987"></a><span class="lineno"> 8987</span>                                           cpl_polynomial_get_coeff(ids, &k));</div>
+<div class="line"><a name="l08988"></a><span class="lineno"> 8988</span>                             }</div>
+<div class="line"><a name="l08989"></a><span class="lineno"> 8989</span>                             <span class="keywordflow">for</span> (j = 0; j < countLines; j++) {</div>
+<div class="line"><a name="l08990"></a><span class="lineno"> 8990</span>                                 pixe = cpl_bivector_get_x_data(peaks_ident)[j];</div>
+<div class="line"><a name="l08991"></a><span class="lineno"> 8991</span>                                 wave = cpl_bivector_get_y_data(peaks_ident)[j];</div>
+<div class="line"><a name="l08992"></a><span class="lineno"> 8992</span>                                 value = pixe </div>
+<div class="line"><a name="l08993"></a><span class="lineno"> 8993</span>                                       - cpl_polynomial_eval_1d(ids, wave, NULL);</div>
+<div class="line"><a name="l08994"></a><span class="lineno"> 8994</span>                                 <span class="keywordflow">if</span> (residuals) {</div>
+<div class="line"><a name="l08995"></a><span class="lineno"> 8995</span>                                     pixel = pixe + 0.5;</div>
+<div class="line"><a name="l08996"></a><span class="lineno"> 8996</span>                                     (ddata + i*nx)[pixel] = value;</div>
+<div class="line"><a name="l08997"></a><span class="lineno"> 8997</span>                                 }</div>
+<div class="line"><a name="l08998"></a><span class="lineno"> 8998</span>                                 <span class="keywordflow">if</span> (restable && !(i%step)) {</div>
+<div class="line"><a name="l08999"></a><span class="lineno"> 8999</span>                                     <span class="keywordflow">for</span> (k = 0; k < nref; k++) {</div>
+<div class="line"><a name="l09000"></a><span class="lineno"> 9000</span>                                         <span class="keywordflow">if</span> (fabs(line[k]-refwave-wave) < 0.1) {</div>
+<div class="line"><a name="l09001"></a><span class="lineno"> 9001</span>                                             snprintf(name, MAX_COLNAME, </div>
+<div class="line"><a name="l09002"></a><span class="lineno"> 9002</span>                                                      <span class="stringliteral">"r%d"</span>, i);</div>
+<div class="line"><a name="l09003"></a><span class="lineno"> 9003</span>                                             cpl_table_set_double(restable, name,</div>
+<div class="line"><a name="l09004"></a><span class="lineno"> 9004</span>                                                                  k, value);</div>
+<div class="line"><a name="l09005"></a><span class="lineno"> 9005</span>                                             value = pixe</div>
+<div class="line"><a name="l09006"></a><span class="lineno"> 9006</span>                                                   - cpl_polynomial_eval_1d(lin,</div>
+<div class="line"><a name="l09007"></a><span class="lineno"> 9007</span>                                                               wave, NULL);</div>
+<div class="line"><a name="l09008"></a><span class="lineno"> 9008</span>                                             snprintf(name, MAX_COLNAME, </div>
+<div class="line"><a name="l09009"></a><span class="lineno"> 9009</span>                                                      <span class="stringliteral">"d%d"</span>, i);</div>
+<div class="line"><a name="l09010"></a><span class="lineno"> 9010</span>                                             cpl_table_set_double(restable, name,</div>
+<div class="line"><a name="l09011"></a><span class="lineno"> 9011</span>                                                                  k, value);</div>
+<div class="line"><a name="l09012"></a><span class="lineno"> 9012</span>                                             snprintf(name, MAX_COLNAME,</div>
+<div class="line"><a name="l09013"></a><span class="lineno"> 9013</span>                                                      <span class="stringliteral">"p%d"</span>, i);</div>
+<div class="line"><a name="l09014"></a><span class="lineno"> 9014</span>                                             cpl_table_set_double(restable, name,</div>
+<div class="line"><a name="l09015"></a><span class="lineno"> 9015</span>                                                                  k, pixe);</div>
+<div class="line"><a name="l09016"></a><span class="lineno"> 9016</span>                                             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l09017"></a><span class="lineno"> 9017</span>                                         }</div>
+<div class="line"><a name="l09018"></a><span class="lineno"> 9018</span>                                     }</div>
+<div class="line"><a name="l09019"></a><span class="lineno"> 9019</span>                                 }</div>
+<div class="line"><a name="l09020"></a><span class="lineno"> 9020</span>                             }</div>
+<div class="line"><a name="l09021"></a><span class="lineno"> 9021</span>                             <span class="keywordflow">if</span> (restable && !(i%step)) {</div>
+<div class="line"><a name="l09022"></a><span class="lineno"> 9022</span>                                 cpl_polynomial_delete(lin);</div>
+<div class="line"><a name="l09023"></a><span class="lineno"> 9023</span>                             }</div>
+<div class="line"><a name="l09024"></a><span class="lineno"> 9024</span> <span class="comment">/***</span></div>
+<div class="line"><a name="l09025"></a><span class="lineno"> 9025</span> <span class="comment">                            for (j = 0; j < countLines; j++) {</span></div>
+<div class="line"><a name="l09026"></a><span class="lineno"> 9026</span> <span class="comment">                                pixel = cpl_bivector_get_x_data(output)[j] </span></div>
+<div class="line"><a name="l09027"></a><span class="lineno"> 9027</span> <span class="comment">                                      + 0.5;</span></div>
+<div class="line"><a name="l09028"></a><span class="lineno"> 9028</span> <span class="comment">                                (ddata + i*nx)[pixel] =</span></div>
+<div class="line"><a name="l09029"></a><span class="lineno"> 9029</span> <span class="comment">                                cpl_bivector_get_x_data(output)[j]</span></div>
+<div class="line"><a name="l09030"></a><span class="lineno"> 9030</span> <span class="comment">                              - cpl_polynomial_eval_1d(ids,</span></div>
+<div class="line"><a name="l09031"></a><span class="lineno"> 9031</span> <span class="comment">                                cpl_bivector_get_y_data(output)[j], </span></div>
+<div class="line"><a name="l09032"></a><span class="lineno"> 9032</span> <span class="comment">                                NULL);</span></div>
+<div class="line"><a name="l09033"></a><span class="lineno"> 9033</span> <span class="comment">                            }</span></div>
+<div class="line"><a name="l09034"></a><span class="lineno"> 9034</span> <span class="comment">***/</span></div>
+<div class="line"><a name="l09035"></a><span class="lineno"> 9035</span>                             <span class="comment">//Fill the line identification information in </span></div>
+<div class="line"><a name="l09036"></a><span class="lineno"> 9036</span>                             <span class="comment">//the detected_lines table</span></div>
+<div class="line"><a name="l09037"></a><span class="lineno"> 9037</span>                             <span class="keywordflow">if</span>(detected_lines)</div>
+<div class="line"><a name="l09038"></a><span class="lineno"> 9038</span>                             {</div>
+<div class="line"><a name="l09039"></a><span class="lineno"> 9039</span>                                 cpl_size nidentlines = cpl_bivector_get_size(peaks_ident); </div>
+<div class="line"><a name="l09040"></a><span class="lineno"> 9040</span>                                 cpl_size ndetectlines = cpl_vector_get_size(peaks); </div>
+<div class="line"><a name="l09041"></a><span class="lineno"> 9041</span>                                 cpl_size totalsize = cpl_table_get_nrow(detected_lines);</div>
+<div class="line"><a name="l09042"></a><span class="lineno"> 9042</span>                                 <span class="keywordflow">for</span>(cpl_size idline = 0; idline < nidentlines; ++idline)</div>
+<div class="line"><a name="l09043"></a><span class="lineno"> 9043</span>                                 {</div>
+<div class="line"><a name="l09044"></a><span class="lineno"> 9044</span>                                     <span class="keywordflow">for</span>(cpl_size detline = 0; detline < ndetectlines; ++detline)</div>
+<div class="line"><a name="l09045"></a><span class="lineno"> 9045</span>                                     {</div>
+<div class="line"><a name="l09046"></a><span class="lineno"> 9046</span>                                         <span class="keywordflow">if</span>(cpl_vector_get(peaks, detline) == </div>
+<div class="line"><a name="l09047"></a><span class="lineno"> 9047</span>                                            cpl_bivector_get_x_data(peaks_ident)[idline])</div>
+<div class="line"><a name="l09048"></a><span class="lineno"> 9048</span>                                         {</div>
+<div class="line"><a name="l09049"></a><span class="lineno"> 9049</span>                                             cpl_size table_pos = totalsize - ndetectlines + detline;</div>
+<div class="line"><a name="l09050"></a><span class="lineno"> 9050</span>                                             <span class="keywordtype">double</span> wave_ident = cpl_bivector_get_y_data(peaks_ident)[idline] + refwave;</div>
+<div class="line"><a name="l09051"></a><span class="lineno"> 9051</span>                                             <span class="keywordtype">double</span> xpix_fit = cpl_polynomial_eval_1d(ids,</div>
+<div class="line"><a name="l09052"></a><span class="lineno"> 9052</span>                                                     wave_ident - refwave, NULL);</div>
+<div class="line"><a name="l09053"></a><span class="lineno"> 9053</span>                                             <span class="keywordtype">double</span> xpos_det = cpl_table_get_double(detected_lines,</div>
+<div class="line"><a name="l09054"></a><span class="lineno"> 9054</span>                                                     <span class="stringliteral">"xpos_rectified"</span>,</div>
+<div class="line"><a name="l09055"></a><span class="lineno"> 9055</span>                                                     table_pos, &null);</div>
+<div class="line"><a name="l09056"></a><span class="lineno"> 9056</span>                                             cpl_table_set_double(detected_lines,</div>
+<div class="line"><a name="l09057"></a><span class="lineno"> 9057</span>                                                                  <span class="stringliteral">"wave_ident"</span>,</div>
+<div class="line"><a name="l09058"></a><span class="lineno"> 9058</span>                                                                  table_pos,</div>
+<div class="line"><a name="l09059"></a><span class="lineno"> 9059</span>                                                                  wave_ident);</div>
+<div class="line"><a name="l09060"></a><span class="lineno"> 9060</span>                                             cpl_table_set_double(detected_lines,</div>
+<div class="line"><a name="l09061"></a><span class="lineno"> 9061</span>                                                                  <span class="stringliteral">"xpos_fit_rect_wavecal"</span>,</div>
+<div class="line"><a name="l09062"></a><span class="lineno"> 9062</span>                                                                  table_pos,</div>
+<div class="line"><a name="l09063"></a><span class="lineno"> 9063</span>                                                                  xpix_fit + 1);</div>
+<div class="line"><a name="l09064"></a><span class="lineno"> 9064</span>                                             cpl_table_set_double(detected_lines,</div>
+<div class="line"><a name="l09065"></a><span class="lineno"> 9065</span>                                                                  <span class="stringliteral">"res_xpos"</span>,</div>
+<div class="line"><a name="l09066"></a><span class="lineno"> 9066</span>                                                                  table_pos,</div>
+<div class="line"><a name="l09067"></a><span class="lineno"> 9067</span>                                                                   xpos_det - xpix_fit - 1);</div>
+<div class="line"><a name="l09068"></a><span class="lineno"> 9068</span>                                         }</div>
+<div class="line"><a name="l09069"></a><span class="lineno"> 9069</span>                                     }</div>
+<div class="line"><a name="l09070"></a><span class="lineno"> 9070</span>                                 }</div>
+<div class="line"><a name="l09071"></a><span class="lineno"> 9071</span>                             }</div>
+<div class="line"><a name="l09072"></a><span class="lineno"> 9072</span> </div>
+<div class="line"><a name="l09073"></a><span class="lineno"> 9073</span>                         }</div>
+<div class="line"><a name="l09074"></a><span class="lineno"> 9074</span>                 <span class="comment">/*  }   */</span></div>
+<div class="line"><a name="l09075"></a><span class="lineno"> 9075</span> </div>
+<div class="line"><a name="l09076"></a><span class="lineno"> 9076</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l09077"></a><span class="lineno"> 9077</span> <span class="comment">                     * Write it anyway, even in case a first-guess based</span></div>
+<div class="line"><a name="l09078"></a><span class="lineno"> 9078</span> <span class="comment">                     * solution will be searched afterwards: in case of</span></div>
+<div class="line"><a name="l09079"></a><span class="lineno"> 9079</span> <span class="comment">                     * failure, the "blind" solution is kept.</span></div>
+<div class="line"><a name="l09080"></a><span class="lineno"> 9080</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l09081"></a><span class="lineno"> 9081</span> </div>
+<div class="line"><a name="l09082"></a><span class="lineno"> 9082</span>                     <span class="keywordflow">if</span> (nlines)</div>
+<div class="line"><a name="l09083"></a><span class="lineno"> 9083</span>                         nlines[i] = usedLines;</div>
+<div class="line"><a name="l09084"></a><span class="lineno"> 9084</span>                     <span class="keywordflow">if</span> (error)</div>
+<div class="line"><a name="l09085"></a><span class="lineno"> 9085</span>                         error[i] = ids_err / sqrt(usedLines/(uorder + 1));</div>
+<div class="line"><a name="l09086"></a><span class="lineno"> 9086</span> </div>
+<div class="line"><a name="l09087"></a><span class="lineno"> 9087</span>                     <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l09088"></a><span class="lineno"> 9088</span>                         <span class="keywordflow">if</span> (k > uorder) {</div>
+<div class="line"><a name="l09089"></a><span class="lineno"> 9089</span>                             cpl_table_set_double(idscoeff, clab[k], i, 0.0);</div>
+<div class="line"><a name="l09090"></a><span class="lineno"> 9090</span>                         }</div>
+<div class="line"><a name="l09091"></a><span class="lineno"> 9091</span>                         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l09092"></a><span class="lineno"> 9092</span>                             cpl_table_set_double(idscoeff, clab[k], i,</div>
+<div class="line"><a name="l09093"></a><span class="lineno"> 9093</span>                                       cpl_polynomial_get_coeff(ids, &k));</div>
+<div class="line"><a name="l09094"></a><span class="lineno"> 9094</span>                         }</div>
+<div class="line"><a name="l09095"></a><span class="lineno"> 9095</span>                     }</div>
+<div class="line"><a name="l09096"></a><span class="lineno"> 9096</span> </div>
+<div class="line"><a name="l09097"></a><span class="lineno"> 9097</span>                     cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l09098"></a><span class="lineno"> 9098</span>                     cpl_bivector_delete(peaks_ident);</div>
+<div class="line"><a name="l09099"></a><span class="lineno"> 9099</span>                 }</div>
+<div class="line"><a name="l09100"></a><span class="lineno"> 9100</span>                 cpl_vector_delete(peaks);</div>
+<div class="line"><a name="l09101"></a><span class="lineno"> 9101</span>             }</div>
+<div class="line"><a name="l09102"></a><span class="lineno"> 9102</span>         }       <span class="comment">/* End of loop on current slit's rows */</span></div>
+<div class="line"><a name="l09103"></a><span class="lineno"> 9103</span> </div>
+<div class="line"><a name="l09104"></a><span class="lineno"> 9104</span> </div>
+<div class="line"><a name="l09105"></a><span class="lineno"> 9105</span>         <span class="keywordflow">if</span> (sradius > 0) {</div>
+<div class="line"><a name="l09106"></a><span class="lineno"> 9106</span> </div>
+<div class="line"><a name="l09107"></a><span class="lineno"> 9107</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l09108"></a><span class="lineno"> 9108</span> <span class="comment">             * See whether there are valid fits at all...</span></div>
+<div class="line"><a name="l09109"></a><span class="lineno"> 9109</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l09110"></a><span class="lineno"> 9110</span>     </div>
+<div class="line"><a name="l09111"></a><span class="lineno"> 9111</span>             nfits = row_top - row_bot - cpl_table_count_invalid(coeff, clab[0]);</div>
+<div class="line"><a name="l09112"></a><span class="lineno"> 9112</span>     </div>
+<div class="line"><a name="l09113"></a><span class="lineno"> 9113</span>             <span class="keywordflow">if</span> (nfits) {</div>
+<div class="line"><a name="l09114"></a><span class="lineno"> 9114</span>                 <span class="keywordtype">int</span> slope = 0;</div>
+<div class="line"><a name="l09115"></a><span class="lineno"> 9115</span> </div>
+<div class="line"><a name="l09116"></a><span class="lineno"> 9116</span>                 fguess = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l09117"></a><span class="lineno"> 9117</span> </div>
+<div class="line"><a name="l09118"></a><span class="lineno"> 9118</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4" title="Interpolate LSS wavelength calibration.">mos_interpolate_wavecalib</a>(coeff, NULL, 2, 1)) {</div>
+<div class="line"><a name="l09119"></a><span class="lineno"> 9119</span> </div>
+<div class="line"><a name="l09120"></a><span class="lineno"> 9120</span>                     slope = 0;</div>
+<div class="line"><a name="l09121"></a><span class="lineno"> 9121</span> </div>
+<div class="line"><a name="l09122"></a><span class="lineno"> 9122</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l09123"></a><span class="lineno"> 9123</span> <span class="comment">                     * Compute a median IDS polynomial for the current slit</span></div>
+<div class="line"><a name="l09124"></a><span class="lineno"> 9124</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l09125"></a><span class="lineno"> 9125</span> </div>
+<div class="line"><a name="l09126"></a><span class="lineno"> 9126</span>                     <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l09127"></a><span class="lineno"> 9127</span>                         c = cpl_table_get_column_median(coeff, clab[k]);</div>
+<div class="line"><a name="l09128"></a><span class="lineno"> 9128</span>                         cpl_polynomial_set_coeff(fguess, &k, c);</div>
+<div class="line"><a name="l09129"></a><span class="lineno"> 9129</span>                     }</div>
+<div class="line"><a name="l09130"></a><span class="lineno"> 9130</span>                 }</div>
+<div class="line"><a name="l09131"></a><span class="lineno"> 9131</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l09132"></a><span class="lineno"> 9132</span>                     slope = 1;</div>
+<div class="line"><a name="l09133"></a><span class="lineno"> 9133</span>                 }</div>
+<div class="line"><a name="l09134"></a><span class="lineno"> 9134</span> </div>
+<div class="line"><a name="l09135"></a><span class="lineno"> 9135</span>                 <span class="keywordflow">for</span> (i = row_bot; i < row_top; i++) {</div>
+<div class="line"><a name="l09136"></a><span class="lineno"> 9136</span> </div>
+<div class="line"><a name="l09137"></a><span class="lineno"> 9137</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l09138"></a><span class="lineno"> 9138</span> <span class="comment">                     * Use first-guess to find the reference lines again</span></div>
+<div class="line"><a name="l09139"></a><span class="lineno"> 9139</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l09140"></a><span class="lineno"> 9140</span> </div>
+<div class="line"><a name="l09141"></a><span class="lineno"> 9141</span>                     width = <a class="code" href="group__moses.html#ga28871a4ecc1e2779022f06d4da892360" title="Estimate lines widths (in pixel) in arc lamp spectrum.">mos_lines_width</a>(sdata + i*nx, nx);</div>
+<div class="line"><a name="l09142"></a><span class="lineno"> 9142</span>                     <span class="keywordflow">if</span> (width > sradius) {</div>
+<div class="line"><a name="l09143"></a><span class="lineno"> 9143</span>                         uradius = width; </div>
+<div class="line"><a name="l09144"></a><span class="lineno"> 9144</span>                     }</div>
+<div class="line"><a name="l09145"></a><span class="lineno"> 9145</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l09146"></a><span class="lineno"> 9146</span>                         uradius = sradius;</div>
+<div class="line"><a name="l09147"></a><span class="lineno"> 9147</span>                     }</div>
+<div class="line"><a name="l09148"></a><span class="lineno"> 9148</span> </div>
+<div class="line"><a name="l09149"></a><span class="lineno"> 9149</span>                     <span class="keywordflow">if</span> (slope) {</div>
+<div class="line"><a name="l09150"></a><span class="lineno"> 9150</span>                         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l09151"></a><span class="lineno"> 9151</span>                             c = cpl_table_get_double(coeff, clab[k], </div>
+<div class="line"><a name="l09152"></a><span class="lineno"> 9152</span>                                                      i - row_bot, NULL);</div>
+<div class="line"><a name="l09153"></a><span class="lineno"> 9153</span>                             cpl_polynomial_set_coeff(fguess, &k, c);</div>
+<div class="line"><a name="l09154"></a><span class="lineno"> 9154</span>                         }</div>
+<div class="line"><a name="l09155"></a><span class="lineno"> 9155</span>                     }</div>
+<div class="line"><a name="l09156"></a><span class="lineno"> 9156</span> </div>
+<div class="line"><a name="l09157"></a><span class="lineno"> 9157</span>                     peaks_ident = <a class="code" href="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe" title="Find the reference lines peaks using a polynomial first-guess.">mos_find_peaks</a>(sdata + i*nx, nx, lines, </div>
+<div class="line"><a name="l09158"></a><span class="lineno"> 9158</span>                                             fguess, refwave, uradius);</div>
+<div class="line"><a name="l09159"></a><span class="lineno"> 9159</span> </div>
+<div class="line"><a name="l09160"></a><span class="lineno"> 9160</span>                     <span class="keywordflow">if</span> (peaks_ident == NULL) {</div>
+<div class="line"><a name="l09161"></a><span class="lineno"> 9161</span>                         cpl_error_reset();</div>
+<div class="line"><a name="l09162"></a><span class="lineno"> 9162</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l09163"></a><span class="lineno"> 9163</span>                     }</div>
+<div class="line"><a name="l09164"></a><span class="lineno"> 9164</span> </div>
+<div class="line"><a name="l09165"></a><span class="lineno"> 9165</span>                     countLines = cpl_bivector_get_size(peaks_ident);</div>
+<div class="line"><a name="l09166"></a><span class="lineno"> 9166</span> </div>
+<div class="line"><a name="l09167"></a><span class="lineno"> 9167</span>                     <span class="keywordflow">if</span> (countLines < 4) {</div>
+<div class="line"><a name="l09168"></a><span class="lineno"> 9168</span>                         cpl_bivector_delete(peaks_ident);</div>
+<div class="line"><a name="l09169"></a><span class="lineno"> 9169</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l09170"></a><span class="lineno"> 9170</span>                     }</div>
+<div class="line"><a name="l09171"></a><span class="lineno"> 9171</span> </div>
+<div class="line"><a name="l09172"></a><span class="lineno"> 9172</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l09173"></a><span class="lineno"> 9173</span> <span class="comment">                     * Set reference wavelength as zero point</span></div>
+<div class="line"><a name="l09174"></a><span class="lineno"> 9174</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l09175"></a><span class="lineno"> 9175</span> </div>
+<div class="line"><a name="l09176"></a><span class="lineno"> 9176</span>                     wavel = cpl_bivector_get_y(peaks_ident);</div>
+<div class="line"><a name="l09177"></a><span class="lineno"> 9177</span>                     cpl_vector_subtract_scalar(wavel, refwave);</div>
+<div class="line"><a name="l09178"></a><span class="lineno"> 9178</span> </div>
+<div class="line"><a name="l09179"></a><span class="lineno"> 9179</span>                     uorder = countLines / 2 - 1;</div>
+<div class="line"><a name="l09180"></a><span class="lineno"> 9180</span>                     <span class="keywordflow">if</span> (uorder > order)</div>
+<div class="line"><a name="l09181"></a><span class="lineno"> 9181</span>                         uorder = order;</div>
+<div class="line"><a name="l09182"></a><span class="lineno"> 9182</span> </div>
+<div class="line"><a name="l09183"></a><span class="lineno"> 9183</span>                     ids = <a class="code" href="group__moses.html#ga4d584e69389518aab8d6932e5841d399" title="Fit polynomial relation from wavelengths to pixels.">mos_poly_wav2pix</a>(peaks_ident, uorder, reject,</div>
+<div class="line"><a name="l09184"></a><span class="lineno"> 9184</span>                                            2 * (uorder + 1), &usedLines,</div>
+<div class="line"><a name="l09185"></a><span class="lineno"> 9185</span>                                            &ids_err);</div>
+<div class="line"><a name="l09186"></a><span class="lineno"> 9186</span> </div>
+<div class="line"><a name="l09187"></a><span class="lineno"> 9187</span>                     <span class="keywordflow">if</span> (ids == NULL) {</div>
+<div class="line"><a name="l09188"></a><span class="lineno"> 9188</span>                         cpl_error_reset();</div>
+<div class="line"><a name="l09189"></a><span class="lineno"> 9189</span>                         cpl_bivector_delete(peaks_ident);</div>
+<div class="line"><a name="l09190"></a><span class="lineno"> 9190</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l09191"></a><span class="lineno"> 9191</span>                     }</div>
+<div class="line"><a name="l09192"></a><span class="lineno"> 9192</span> </div>
+<div class="line"><a name="l09193"></a><span class="lineno"> 9193</span>                     <span class="keywordflow">if</span> (nlines)</div>
+<div class="line"><a name="l09194"></a><span class="lineno"> 9194</span>                         nlines[i] = usedLines;</div>
+<div class="line"><a name="l09195"></a><span class="lineno"> 9195</span>                     <span class="keywordflow">if</span> (error)</div>
+<div class="line"><a name="l09196"></a><span class="lineno"> 9196</span>                         error[i] = ids_err / sqrt(usedLines/(uorder + 1));</div>
+<div class="line"><a name="l09197"></a><span class="lineno"> 9197</span> </div>
+<div class="line"><a name="l09198"></a><span class="lineno"> 9198</span>                     <span class="keywordflow">if</span> (calibration) {</div>
+<div class="line"><a name="l09199"></a><span class="lineno"> 9199</span>                         pixstart = cpl_polynomial_eval_1d(ids,</div>
+<div class="line"><a name="l09200"></a><span class="lineno"> 9200</span>                            cpl_bivector_get_y_data(peaks_ident)[0], </div>
+<div class="line"><a name="l09201"></a><span class="lineno"> 9201</span>                            NULL);</div>
+<div class="line"><a name="l09202"></a><span class="lineno"> 9202</span>                         pixend = cpl_polynomial_eval_1d(ids,</div>
+<div class="line"><a name="l09203"></a><span class="lineno"> 9203</span>                            cpl_bivector_get_y_data(peaks_ident)[countLines-1], </div>
+<div class="line"><a name="l09204"></a><span class="lineno"> 9204</span>                            NULL);</div>
+<div class="line"><a name="l09205"></a><span class="lineno"> 9205</span>                         extrapolation = (pixend - pixstart) / 5;</div>
+<div class="line"><a name="l09206"></a><span class="lineno"> 9206</span>                         pixstart -= extrapolation;</div>
+<div class="line"><a name="l09207"></a><span class="lineno"> 9207</span>                         pixend += extrapolation;</div>
+<div class="line"><a name="l09208"></a><span class="lineno"> 9208</span>                         <span class="keywordflow">if</span> (pixstart < 0)</div>
+<div class="line"><a name="l09209"></a><span class="lineno"> 9209</span>                             pixstart = 0;</div>
+<div class="line"><a name="l09210"></a><span class="lineno"> 9210</span>                         <span class="keywordflow">if</span> (pixend > nx)</div>
+<div class="line"><a name="l09211"></a><span class="lineno"> 9211</span>                             pixend = nx;</div>
+<div class="line"><a name="l09212"></a><span class="lineno"> 9212</span> </div>
+<div class="line"><a name="l09213"></a><span class="lineno"> 9213</span>                         <span class="keywordflow">for</span> (j = pixstart; j < pixend; j++) {</div>
+<div class="line"><a name="l09214"></a><span class="lineno"> 9214</span>                             (idata + i*nx)[j] = <a class="code" href="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a" title="Evaluate the wavelength of a pixel position.">mos_eval_dds</a>(ids,</div>
+<div class="line"><a name="l09215"></a><span class="lineno"> 9215</span>                                      firstLambda, lastLambda, refwave, j);</div>
+<div class="line"><a name="l09216"></a><span class="lineno"> 9216</span>                         }</div>
+<div class="line"><a name="l09217"></a><span class="lineno"> 9217</span>                     }</div>
+<div class="line"><a name="l09218"></a><span class="lineno"> 9218</span> </div>
+<div class="line"><a name="l09219"></a><span class="lineno"> 9219</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l09220"></a><span class="lineno"> 9220</span> <span class="comment">                     * Residuals image</span></div>
+<div class="line"><a name="l09221"></a><span class="lineno"> 9221</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l09222"></a><span class="lineno"> 9222</span> </div>
+<div class="line"><a name="l09223"></a><span class="lineno"> 9223</span>                     <span class="keywordflow">if</span> (residuals || (restable && !(i%step))) {</div>
+<div class="line"><a name="l09224"></a><span class="lineno"> 9224</span>                         <span class="keywordflow">if</span> (restable && !(i%step)) {</div>
+<div class="line"><a name="l09225"></a><span class="lineno"> 9225</span>                             lin = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l09226"></a><span class="lineno"> 9226</span>                             <span class="keywordflow">for</span> (k = 0; k < 2; k++)</div>
+<div class="line"><a name="l09227"></a><span class="lineno"> 9227</span>                                 cpl_polynomial_set_coeff(lin, &k,</div>
+<div class="line"><a name="l09228"></a><span class="lineno"> 9228</span>                                       cpl_polynomial_get_coeff(ids, &k));</div>
+<div class="line"><a name="l09229"></a><span class="lineno"> 9229</span>                         }</div>
+<div class="line"><a name="l09230"></a><span class="lineno"> 9230</span>                         <span class="keywordflow">for</span> (j = 0; j < countLines; j++) {</div>
+<div class="line"><a name="l09231"></a><span class="lineno"> 9231</span>                             pixe = cpl_bivector_get_x_data(peaks_ident)[j];</div>
+<div class="line"><a name="l09232"></a><span class="lineno"> 9232</span>                             wave = cpl_bivector_get_y_data(peaks_ident)[j];</div>
+<div class="line"><a name="l09233"></a><span class="lineno"> 9233</span>                             value = pixe</div>
+<div class="line"><a name="l09234"></a><span class="lineno"> 9234</span>                                   - cpl_polynomial_eval_1d(ids, wave, NULL);</div>
+<div class="line"><a name="l09235"></a><span class="lineno"> 9235</span>                             <span class="keywordflow">if</span> (residuals) {</div>
+<div class="line"><a name="l09236"></a><span class="lineno"> 9236</span>                                 pixel = pixe + 0.5;</div>
+<div class="line"><a name="l09237"></a><span class="lineno"> 9237</span>                                 (ddata + i*nx)[pixel] = value;</div>
+<div class="line"><a name="l09238"></a><span class="lineno"> 9238</span>                             }</div>
+<div class="line"><a name="l09239"></a><span class="lineno"> 9239</span>                             <span class="keywordflow">if</span> (restable && !(i%step)) {</div>
+<div class="line"><a name="l09240"></a><span class="lineno"> 9240</span>                                 <span class="keywordflow">for</span> (k = 0; k < nref; k++) {</div>
+<div class="line"><a name="l09241"></a><span class="lineno"> 9241</span>                                     <span class="keywordflow">if</span> (fabs(line[k]-refwave-wave) < 0.1) {</div>
+<div class="line"><a name="l09242"></a><span class="lineno"> 9242</span>                                         snprintf(name, MAX_COLNAME,</div>
+<div class="line"><a name="l09243"></a><span class="lineno"> 9243</span>                                                  <span class="stringliteral">"r%d"</span>, i);</div>
+<div class="line"><a name="l09244"></a><span class="lineno"> 9244</span>                                         cpl_table_set_double(restable, name,</div>
+<div class="line"><a name="l09245"></a><span class="lineno"> 9245</span>                                                              k, value);</div>
+<div class="line"><a name="l09246"></a><span class="lineno"> 9246</span>                                         value = pixe</div>
+<div class="line"><a name="l09247"></a><span class="lineno"> 9247</span>                                               - cpl_polynomial_eval_1d(lin,</div>
+<div class="line"><a name="l09248"></a><span class="lineno"> 9248</span>                                                           wave, NULL);</div>
+<div class="line"><a name="l09249"></a><span class="lineno"> 9249</span>                                         snprintf(name, MAX_COLNAME,</div>
+<div class="line"><a name="l09250"></a><span class="lineno"> 9250</span>                                                  <span class="stringliteral">"d%d"</span>, i);</div>
+<div class="line"><a name="l09251"></a><span class="lineno"> 9251</span>                                         cpl_table_set_double(restable, name,</div>
+<div class="line"><a name="l09252"></a><span class="lineno"> 9252</span>                                                              k, value);</div>
+<div class="line"><a name="l09253"></a><span class="lineno"> 9253</span>                                         snprintf(name, MAX_COLNAME,</div>
+<div class="line"><a name="l09254"></a><span class="lineno"> 9254</span>                                                  <span class="stringliteral">"p%d"</span>, i);</div>
+<div class="line"><a name="l09255"></a><span class="lineno"> 9255</span>                                         cpl_table_set_double(restable, name,</div>
+<div class="line"><a name="l09256"></a><span class="lineno"> 9256</span>                                                              k, pixe);</div>
+<div class="line"><a name="l09257"></a><span class="lineno"> 9257</span>                                         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l09258"></a><span class="lineno"> 9258</span>                                     }</div>
+<div class="line"><a name="l09259"></a><span class="lineno"> 9259</span>                                 }</div>
+<div class="line"><a name="l09260"></a><span class="lineno"> 9260</span>                             }</div>
+<div class="line"><a name="l09261"></a><span class="lineno"> 9261</span>                         }</div>
+<div class="line"><a name="l09262"></a><span class="lineno"> 9262</span>                         <span class="keywordflow">if</span> (restable && !(i%step)) {</div>
+<div class="line"><a name="l09263"></a><span class="lineno"> 9263</span>                             cpl_polynomial_delete(lin);</div>
+<div class="line"><a name="l09264"></a><span class="lineno"> 9264</span>                         }</div>
+<div class="line"><a name="l09265"></a><span class="lineno"> 9265</span> <span class="comment">/***</span></div>
+<div class="line"><a name="l09266"></a><span class="lineno"> 9266</span> <span class="comment">                        for (j = 0; j < countLines; j++) {</span></div>
+<div class="line"><a name="l09267"></a><span class="lineno"> 9267</span> <span class="comment">                            pixel = cpl_bivector_get_x_data(output)[j]</span></div>
+<div class="line"><a name="l09268"></a><span class="lineno"> 9268</span> <span class="comment">                                  + 0.5; </span></div>
+<div class="line"><a name="l09269"></a><span class="lineno"> 9269</span> <span class="comment">                            (ddata + i*nx)[pixel] =</span></div>
+<div class="line"><a name="l09270"></a><span class="lineno"> 9270</span> <span class="comment">                            cpl_bivector_get_x_data(output)[j]</span></div>
+<div class="line"><a name="l09271"></a><span class="lineno"> 9271</span> <span class="comment">                          - cpl_polynomial_eval_1d(ids,</span></div>
+<div class="line"><a name="l09272"></a><span class="lineno"> 9272</span> <span class="comment">                            cpl_bivector_get_y_data(output)[j], </span></div>
+<div class="line"><a name="l09273"></a><span class="lineno"> 9273</span> <span class="comment">                            NULL);</span></div>
+<div class="line"><a name="l09274"></a><span class="lineno"> 9274</span> <span class="comment">                        }</span></div>
+<div class="line"><a name="l09275"></a><span class="lineno"> 9275</span> <span class="comment">***/</span></div>
+<div class="line"><a name="l09276"></a><span class="lineno"> 9276</span>                     }</div>
+<div class="line"><a name="l09277"></a><span class="lineno"> 9277</span>                     </div>
+<div class="line"><a name="l09278"></a><span class="lineno"> 9278</span>                     <span class="keywordflow">if</span>(detected_lines)</div>
+<div class="line"><a name="l09279"></a><span class="lineno"> 9279</span>                     {</div>
+<div class="line"><a name="l09280"></a><span class="lineno"> 9280</span>                         cpl_size oldsize = cpl_table_get_nrow(detected_lines); </div>
+<div class="line"><a name="l09281"></a><span class="lineno"> 9281</span>                         cpl_size nidentlines = cpl_bivector_get_size(peaks_ident); </div>
+<div class="line"><a name="l09282"></a><span class="lineno"> 9282</span>                         cpl_table_set_size(detected_lines, oldsize + nidentlines);</div>
+<div class="line"><a name="l09283"></a><span class="lineno"> 9283</span>                         <span class="keywordflow">for</span>(cpl_size idline = 0; idline < nidentlines ; ++idline)</div>
+<div class="line"><a name="l09284"></a><span class="lineno"> 9284</span>                         {</div>
+<div class="line"><a name="l09285"></a><span class="lineno"> 9285</span>                             <span class="keywordtype">double</span> wave_ident = cpl_bivector_get_y_data(peaks_ident)[idline] + refwave;</div>
+<div class="line"><a name="l09286"></a><span class="lineno"> 9286</span>                             <span class="keywordtype">double</span> xpix_fit = cpl_polynomial_eval_1d(ids,</div>
+<div class="line"><a name="l09287"></a><span class="lineno"> 9287</span>                                     wave_ident - refwave, NULL);</div>
+<div class="line"><a name="l09288"></a><span class="lineno"> 9288</span>                             cpl_table_set_int(detected_lines, <span class="stringliteral">"slit_id"</span>,</div>
+<div class="line"><a name="l09289"></a><span class="lineno"> 9289</span>                                  oldsize + idline, slit_id);</div>
+<div class="line"><a name="l09290"></a><span class="lineno"> 9290</span>                             cpl_table_set_double(detected_lines, <span class="stringliteral">"xpos_rectified_iter"</span>,</div>
+<div class="line"><a name="l09291"></a><span class="lineno"> 9291</span>                                  oldsize + idline, cpl_bivector_get_x_data(peaks_ident)[idline] + 1);</div>
+<div class="line"><a name="l09292"></a><span class="lineno"> 9292</span>                             cpl_table_set_double(detected_lines, <span class="stringliteral">"ypos_rectified_iter"</span>,</div>
+<div class="line"><a name="l09293"></a><span class="lineno"> 9293</span>                                  oldsize + idline, (<span class="keywordtype">double</span>)i + 1);</div>
+<div class="line"><a name="l09294"></a><span class="lineno"> 9294</span>                             cpl_table_set_double(detected_lines, <span class="stringliteral">"peak_flux"</span>,</div>
+<div class="line"><a name="l09295"></a><span class="lineno"> 9295</span>                                  oldsize + idline, </div>
+<div class="line"><a name="l09296"></a><span class="lineno"> 9296</span>                                  sdata[i*nx+(<span class="keywordtype">int</span>)(cpl_bivector_get_x_data(peaks_ident)[idline]+0.5)]);</div>
+<div class="line"><a name="l09297"></a><span class="lineno"> 9297</span>                             cpl_table_set_double(detected_lines, <span class="stringliteral">"wave_ident_iter"</span>,</div>
+<div class="line"><a name="l09298"></a><span class="lineno"> 9298</span>                                  oldsize + idline, wave_ident);</div>
+<div class="line"><a name="l09299"></a><span class="lineno"> 9299</span>                             cpl_table_set_double(detected_lines, <span class="stringliteral">"xpos_fit_rect_wavecal"</span>,</div>
+<div class="line"><a name="l09300"></a><span class="lineno"> 9300</span>                                  oldsize + idline, xpix_fit + 1);</div>
+<div class="line"><a name="l09301"></a><span class="lineno"> 9301</span>                         }</div>
+<div class="line"><a name="l09302"></a><span class="lineno"> 9302</span>                     }</div>
+<div class="line"><a name="l09303"></a><span class="lineno"> 9303</span> </div>
+<div class="line"><a name="l09304"></a><span class="lineno"> 9304</span> </div>
+<div class="line"><a name="l09305"></a><span class="lineno"> 9305</span>                     <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l09306"></a><span class="lineno"> 9306</span>                         <span class="keywordflow">if</span> (k > uorder) {</div>
+<div class="line"><a name="l09307"></a><span class="lineno"> 9307</span>                             cpl_table_set_double(idscoeff, clab[k], i, 0.0);</div>
+<div class="line"><a name="l09308"></a><span class="lineno"> 9308</span>                         }</div>
+<div class="line"><a name="l09309"></a><span class="lineno"> 9309</span>                         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l09310"></a><span class="lineno"> 9310</span>                             cpl_table_set_double(idscoeff, clab[k], i,</div>
+<div class="line"><a name="l09311"></a><span class="lineno"> 9311</span>                                         cpl_polynomial_get_coeff(ids, &k));</div>
+<div class="line"><a name="l09312"></a><span class="lineno"> 9312</span>                         }</div>
+<div class="line"><a name="l09313"></a><span class="lineno"> 9313</span>                     }</div>
+<div class="line"><a name="l09314"></a><span class="lineno"> 9314</span> </div>
+<div class="line"><a name="l09315"></a><span class="lineno"> 9315</span>                     cpl_bivector_delete(peaks_ident);</div>
+<div class="line"><a name="l09316"></a><span class="lineno"> 9316</span>                     cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l09317"></a><span class="lineno"> 9317</span> </div>
+<div class="line"><a name="l09318"></a><span class="lineno"> 9318</span>                 } <span class="comment">/* End of loop "use ids as a first-guess" */</span></div>
+<div class="line"><a name="l09319"></a><span class="lineno"> 9319</span> </div>
+<div class="line"><a name="l09320"></a><span class="lineno"> 9320</span>                 cpl_polynomial_delete(fguess);</div>
+<div class="line"><a name="l09321"></a><span class="lineno"> 9321</span>             }</div>
+<div class="line"><a name="l09322"></a><span class="lineno"> 9322</span> </div>
+<div class="line"><a name="l09323"></a><span class="lineno"> 9323</span>             cpl_table_delete(coeff);</div>
+<div class="line"><a name="l09324"></a><span class="lineno"> 9324</span> </div>
+<div class="line"><a name="l09325"></a><span class="lineno"> 9325</span>         }</div>
+<div class="line"><a name="l09326"></a><span class="lineno"> 9326</span> </div>
+<div class="line"><a name="l09327"></a><span class="lineno"> 9327</span>         row_top = row_bot;</div>
+<div class="line"><a name="l09328"></a><span class="lineno"> 9328</span> </div>
+<div class="line"><a name="l09329"></a><span class="lineno"> 9329</span>     } <span class="comment">/* End of loop on slits */</span></div>
+<div class="line"><a name="l09330"></a><span class="lineno"> 9330</span> </div>
+<div class="line"><a name="l09331"></a><span class="lineno"> 9331</span> </div>
+<div class="line"><a name="l09332"></a><span class="lineno"> 9332</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l09333"></a><span class="lineno"> 9333</span> <span class="comment">     * At this point the idscoeff table has been filled with all the </span></div>
+<div class="line"><a name="l09334"></a><span class="lineno"> 9334</span> <span class="comment">     * fits coefficients obtained for all the rows of the input image.</span></div>
+<div class="line"><a name="l09335"></a><span class="lineno"> 9335</span> <span class="comment">     * Now we apply these coefficients to resample the input image</span></div>
+<div class="line"><a name="l09336"></a><span class="lineno"> 9336</span> <span class="comment">     * at constant wavelength step.</span></div>
+<div class="line"><a name="l09337"></a><span class="lineno"> 9337</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l09338"></a><span class="lineno"> 9338</span> </div>
+<div class="line"><a name="l09339"></a><span class="lineno"> 9339</span>     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l09340"></a><span class="lineno"> 9340</span> </div>
+<div class="line"><a name="l09341"></a><span class="lineno"> 9341</span>         missing = 0;</div>
+<div class="line"><a name="l09342"></a><span class="lineno"> 9342</span>         ids = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l09343"></a><span class="lineno"> 9343</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l09344"></a><span class="lineno"> 9344</span>             c = cpl_table_get_double(idscoeff, clab[k], i, &null);</div>
+<div class="line"><a name="l09345"></a><span class="lineno"> 9345</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l09346"></a><span class="lineno"> 9346</span>                 cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l09347"></a><span class="lineno"> 9347</span>                 missing = 1;</div>
+<div class="line"><a name="l09348"></a><span class="lineno"> 9348</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l09349"></a><span class="lineno"> 9349</span>             }</div>
+<div class="line"><a name="l09350"></a><span class="lineno"> 9350</span>             cpl_polynomial_set_coeff(ids, &k, c);</div>
+<div class="line"><a name="l09351"></a><span class="lineno"> 9351</span>         }</div>
+<div class="line"><a name="l09352"></a><span class="lineno"> 9352</span>         <span class="keywordflow">if</span> (missing)</div>
+<div class="line"><a name="l09353"></a><span class="lineno"> 9353</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l09354"></a><span class="lineno"> 9354</span> </div>
+<div class="line"><a name="l09355"></a><span class="lineno"> 9355</span>         pixstart = cpl_polynomial_eval_1d(ids, firstLambda - refwave, NULL);</div>
+<div class="line"><a name="l09356"></a><span class="lineno"> 9356</span>         pixend = cpl_polynomial_eval_1d(ids, lastLambda - refwave, NULL);</div>
+<div class="line"><a name="l09357"></a><span class="lineno"> 9357</span>         <span class="keywordflow">if</span> (pixstart < 0)</div>
+<div class="line"><a name="l09358"></a><span class="lineno"> 9358</span>             pixstart = 0;</div>
+<div class="line"><a name="l09359"></a><span class="lineno"> 9359</span>         <span class="keywordflow">if</span> (pixend > nx)</div>
+<div class="line"><a name="l09360"></a><span class="lineno"> 9360</span>             pixend = nx;</div>
+<div class="line"><a name="l09361"></a><span class="lineno"> 9361</span> </div>
+<div class="line"><a name="l09362"></a><span class="lineno"> 9362</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l09363"></a><span class="lineno"> 9363</span> <span class="comment">         * Resampled image:</span></div>
+<div class="line"><a name="l09364"></a><span class="lineno"> 9364</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l09365"></a><span class="lineno"> 9365</span> </div>
+<div class="line"><a name="l09366"></a><span class="lineno"> 9366</span>         <span class="keywordflow">for</span> (j = 0; j < nl; j++) {</div>
+<div class="line"><a name="l09367"></a><span class="lineno"> 9367</span>             lambda = firstLambda + j * dispersion;</div>
+<div class="line"><a name="l09368"></a><span class="lineno"> 9368</span>             fpixel = cpl_polynomial_eval_1d(ids, lambda - refwave, NULL);</div>
+<div class="line"><a name="l09369"></a><span class="lineno"> 9369</span>             pixel = fpixel;</div>
+<div class="line"><a name="l09370"></a><span class="lineno"> 9370</span>             <span class="keywordflow">if</span> (pixel >= 0 && pixel < nx-1) {</div>
+<div class="line"><a name="l09371"></a><span class="lineno"> 9371</span>                 v1 = (sdata + i*nx)[pixel];</div>
+<div class="line"><a name="l09372"></a><span class="lineno"> 9372</span>                 v2 = (sdata + i*nx)[pixel+1];</div>
+<div class="line"><a name="l09373"></a><span class="lineno"> 9373</span>                 vi = v1 + (v2-v1)*(fpixel-pixel);</div>
+<div class="line"><a name="l09374"></a><span class="lineno"> 9374</span>                 (rdata + i*nl)[j] = vi;</div>
+<div class="line"><a name="l09375"></a><span class="lineno"> 9375</span>             }</div>
+<div class="line"><a name="l09376"></a><span class="lineno"> 9376</span>         }</div>
+<div class="line"><a name="l09377"></a><span class="lineno"> 9377</span> </div>
+<div class="line"><a name="l09378"></a><span class="lineno"> 9378</span>         cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l09379"></a><span class="lineno"> 9379</span>     }</div>
+<div class="line"><a name="l09380"></a><span class="lineno"> 9380</span> </div>
+<div class="line"><a name="l09381"></a><span class="lineno"> 9381</span>     <span class="keywordflow">return</span> resampled;</div>
+<div class="line"><a name="l09382"></a><span class="lineno"> 9382</span> }</div>
+<div class="line"><a name="l09383"></a><span class="lineno"> 9383</span> </div>
+<div class="line"><a name="l09384"></a><span class="lineno"> 9384</span> </div>
+<div class="line"><a name="l09411"></a><span class="lineno"><a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b"> 9411</a></span> cpl_image *<a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(cpl_image *image, <span class="keywordtype">double</span> refwave, </div>
+<div class="line"><a name="l09412"></a><span class="lineno"> 9412</span>                                       <span class="keywordtype">double</span> firstLambda, <span class="keywordtype">double</span> lastLambda, </div>
+<div class="line"><a name="l09413"></a><span class="lineno"> 9413</span>                                       <span class="keywordtype">double</span> dispersion, cpl_table *idscoeff, </div>
+<div class="line"><a name="l09414"></a><span class="lineno"> 9414</span>                                       <span class="keywordtype">int</span> flux)</div>
+<div class="line"><a name="l09415"></a><span class="lineno"> 9415</span> {</div>
+<div class="line"><a name="l09416"></a><span class="lineno"> 9416</span> </div>
+<div class="line"><a name="l09417"></a><span class="lineno"> 9417</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_wavelength_calibration"</span>;</div>
+<div class="line"><a name="l09418"></a><span class="lineno"> 9418</span> </div>
+<div class="line"><a name="l09419"></a><span class="lineno"> 9419</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l09420"></a><span class="lineno"> 9420</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l09421"></a><span class="lineno"> 9421</span> </div>
+<div class="line"><a name="l09422"></a><span class="lineno"> 9422</span>     cpl_image      *resampled;</div>
+<div class="line"><a name="l09423"></a><span class="lineno"> 9423</span>     cpl_polynomial *ids;</div>
+<div class="line"><a name="l09424"></a><span class="lineno"> 9424</span>     <span class="keywordtype">double</span>          pixel_per_lambda;</div>
+<div class="line"><a name="l09425"></a><span class="lineno"> 9425</span>     <span class="keywordtype">double</span>          lambda;</div>
+<div class="line"><a name="l09426"></a><span class="lineno"> 9426</span>     <span class="keywordtype">double</span>          c;</div>
+<div class="line"><a name="l09427"></a><span class="lineno"> 9427</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l09428"></a><span class="lineno"> 9428</span>     <span class="keywordtype">float</span>          *rdata;</div>
+<div class="line"><a name="l09429"></a><span class="lineno"> 9429</span>     <span class="keywordtype">float</span>           v0, v1, v2, v3, vi;</div>
+<div class="line"><a name="l09430"></a><span class="lineno"> 9430</span>     <span class="keywordtype">float</span>           fpixel;</div>
+<div class="line"><a name="l09431"></a><span class="lineno"> 9431</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l09432"></a><span class="lineno"> 9432</span>     <span class="keywordtype">int</span>             pixstart, pixend;</div>
+<div class="line"><a name="l09433"></a><span class="lineno"> 9433</span>     <span class="keywordtype">int</span>             nl, nx, ny, pixel;</div>
+<div class="line"><a name="l09434"></a><span class="lineno"> 9434</span>     <span class="keywordtype">int</span>             missing;</div>
+<div class="line"><a name="l09435"></a><span class="lineno"> 9435</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l09436"></a><span class="lineno"> 9436</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l09437"></a><span class="lineno"> 9437</span>     cpl_size        k;</div>
+<div class="line"><a name="l09438"></a><span class="lineno"> 9438</span> </div>
+<div class="line"><a name="l09439"></a><span class="lineno"> 9439</span> </div>
+<div class="line"><a name="l09440"></a><span class="lineno"> 9440</span>     <span class="keywordflow">if</span> (dispersion <= 0.0) {</div>
+<div class="line"><a name="l09441"></a><span class="lineno"> 9441</span>         cpl_msg_error(func, <span class="stringliteral">"The resampling step must be positive"</span>);</div>
+<div class="line"><a name="l09442"></a><span class="lineno"> 9442</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l09443"></a><span class="lineno"> 9443</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l09444"></a><span class="lineno"> 9444</span>     }</div>
+<div class="line"><a name="l09445"></a><span class="lineno"> 9445</span> </div>
+<div class="line"><a name="l09446"></a><span class="lineno"> 9446</span>     <span class="keywordflow">if</span> (lastLambda - firstLambda < dispersion) {</div>
+<div class="line"><a name="l09447"></a><span class="lineno"> 9447</span>         cpl_msg_error(func, <span class="stringliteral">"Invalid spectral range: %.2f to %.2f"</span>, </div>
+<div class="line"><a name="l09448"></a><span class="lineno"> 9448</span>                       firstLambda, lastLambda);</div>
+<div class="line"><a name="l09449"></a><span class="lineno"> 9449</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l09450"></a><span class="lineno"> 9450</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l09451"></a><span class="lineno"> 9451</span>     }</div>
+<div class="line"><a name="l09452"></a><span class="lineno"> 9452</span> </div>
+<div class="line"><a name="l09453"></a><span class="lineno"> 9453</span>     <span class="keywordflow">if</span> (idscoeff == NULL) {</div>
+<div class="line"><a name="l09454"></a><span class="lineno"> 9454</span>         cpl_msg_error(func, <span class="stringliteral">"An IDS coeff table must be given"</span>);</div>
+<div class="line"><a name="l09455"></a><span class="lineno"> 9455</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l09456"></a><span class="lineno"> 9456</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l09457"></a><span class="lineno"> 9457</span>     }</div>
+<div class="line"><a name="l09458"></a><span class="lineno"> 9458</span> </div>
+<div class="line"><a name="l09459"></a><span class="lineno"> 9459</span>     <span class="keywordflow">if</span> (image == NULL) {</div>
+<div class="line"><a name="l09460"></a><span class="lineno"> 9460</span>         cpl_msg_error(func, <span class="stringliteral">"A scientific spectral image must be given"</span>);</div>
+<div class="line"><a name="l09461"></a><span class="lineno"> 9461</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l09462"></a><span class="lineno"> 9462</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l09463"></a><span class="lineno"> 9463</span>     }</div>
+<div class="line"><a name="l09464"></a><span class="lineno"> 9464</span> </div>
+<div class="line"><a name="l09465"></a><span class="lineno"> 9465</span>     nx = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l09466"></a><span class="lineno"> 9466</span>     ny = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l09467"></a><span class="lineno"> 9467</span>     sdata = cpl_image_get_data_float(image);</div>
+<div class="line"><a name="l09468"></a><span class="lineno"> 9468</span> </div>
+<div class="line"><a name="l09469"></a><span class="lineno"> 9469</span>     nl = (lastLambda - firstLambda) / dispersion;</div>
+<div class="line"><a name="l09470"></a><span class="lineno"> 9470</span>     resampled = cpl_image_new(nl, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l09471"></a><span class="lineno"> 9471</span>     rdata = cpl_image_get_data_float(resampled);</div>
+<div class="line"><a name="l09472"></a><span class="lineno"> 9472</span> </div>
+<div class="line"><a name="l09473"></a><span class="lineno"> 9473</span>     order = 0;</div>
+<div class="line"><a name="l09474"></a><span class="lineno"> 9474</span>     <span class="keywordflow">while</span> (order < 6 && cpl_table_has_column(idscoeff, clab[order]))</div>
+<div class="line"><a name="l09475"></a><span class="lineno"> 9475</span>         ++order;</div>
+<div class="line"><a name="l09476"></a><span class="lineno"> 9476</span>     --order;</div>
+<div class="line"><a name="l09477"></a><span class="lineno"> 9477</span> </div>
+<div class="line"><a name="l09478"></a><span class="lineno"> 9478</span>     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l09479"></a><span class="lineno"> 9479</span> </div>
+<div class="line"><a name="l09480"></a><span class="lineno"> 9480</span>         missing = 0;</div>
+<div class="line"><a name="l09481"></a><span class="lineno"> 9481</span>         ids = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l09482"></a><span class="lineno"> 9482</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l09483"></a><span class="lineno"> 9483</span>             c = cpl_table_get_double(idscoeff, clab[k], i, &null);</div>
+<div class="line"><a name="l09484"></a><span class="lineno"> 9484</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l09485"></a><span class="lineno"> 9485</span>                 cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l09486"></a><span class="lineno"> 9486</span>                 missing = 1;</div>
+<div class="line"><a name="l09487"></a><span class="lineno"> 9487</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l09488"></a><span class="lineno"> 9488</span>             }</div>
+<div class="line"><a name="l09489"></a><span class="lineno"> 9489</span>             cpl_polynomial_set_coeff(ids, &k, c);</div>
+<div class="line"><a name="l09490"></a><span class="lineno"> 9490</span>         }</div>
+<div class="line"><a name="l09491"></a><span class="lineno"> 9491</span>         <span class="keywordflow">if</span> (missing)</div>
+<div class="line"><a name="l09492"></a><span class="lineno"> 9492</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l09493"></a><span class="lineno"> 9493</span> </div>
+<div class="line"><a name="l09494"></a><span class="lineno"> 9494</span>         pixstart = cpl_polynomial_eval_1d(ids, firstLambda - refwave, NULL);</div>
+<div class="line"><a name="l09495"></a><span class="lineno"> 9495</span>         pixend = cpl_polynomial_eval_1d(ids, lastLambda - refwave, NULL);</div>
+<div class="line"><a name="l09496"></a><span class="lineno"> 9496</span>         <span class="keywordflow">if</span> (pixstart < 0)</div>
+<div class="line"><a name="l09497"></a><span class="lineno"> 9497</span>             pixstart = 0;</div>
+<div class="line"><a name="l09498"></a><span class="lineno"> 9498</span>         <span class="keywordflow">if</span> (pixend > nx)</div>
+<div class="line"><a name="l09499"></a><span class="lineno"> 9499</span>             pixend = nx;</div>
+<div class="line"><a name="l09500"></a><span class="lineno"> 9500</span> </div>
+<div class="line"><a name="l09501"></a><span class="lineno"> 9501</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l09502"></a><span class="lineno"> 9502</span> <span class="comment">         * Resampled image:</span></div>
+<div class="line"><a name="l09503"></a><span class="lineno"> 9503</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l09504"></a><span class="lineno"> 9504</span> </div>
+<div class="line"><a name="l09505"></a><span class="lineno"> 9505</span>         <span class="keywordflow">for</span> (j = 0; j < nl; j++) {</div>
+<div class="line"><a name="l09506"></a><span class="lineno"> 9506</span>             lambda = firstLambda + j * dispersion;</div>
+<div class="line"><a name="l09507"></a><span class="lineno"> 9507</span>             fpixel = cpl_polynomial_eval_1d(ids, lambda - refwave, </div>
+<div class="line"><a name="l09508"></a><span class="lineno"> 9508</span>                                             &pixel_per_lambda);</div>
+<div class="line"><a name="l09509"></a><span class="lineno"> 9509</span> </div>
+<div class="line"><a name="l09510"></a><span class="lineno"> 9510</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l09511"></a><span class="lineno"> 9511</span> <span class="comment">             * The local dispersion is 1 / pixel_per_lambda</span></div>
+<div class="line"><a name="l09512"></a><span class="lineno"> 9512</span> <span class="comment">             * and this factor is used for applying the flux</span></div>
+<div class="line"><a name="l09513"></a><span class="lineno"> 9513</span> <span class="comment">             * conservation correction (if requested).</span></div>
+<div class="line"><a name="l09514"></a><span class="lineno"> 9514</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l09515"></a><span class="lineno"> 9515</span> </div>
+<div class="line"><a name="l09516"></a><span class="lineno"> 9516</span>             pixel = fpixel;</div>
+<div class="line"><a name="l09517"></a><span class="lineno"> 9517</span> </div>
+<div class="line"><a name="l09518"></a><span class="lineno"> 9518</span>          <span class="comment">// if (dispersion * pixel_per_lambda < 2.0) {</span></div>
+<div class="line"><a name="l09519"></a><span class="lineno"> 9519</span>             <span class="keywordflow">if</span> (1) {  <span class="comment">/* Old behaviour: this is safe. */</span></div>
+<div class="line"><a name="l09520"></a><span class="lineno"> 9520</span> </div>
+<div class="line"><a name="l09521"></a><span class="lineno"> 9521</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l09522"></a><span class="lineno"> 9522</span> <span class="comment">                 * In this case we just sample interpolating the</span></div>
+<div class="line"><a name="l09523"></a><span class="lineno"> 9523</span> <span class="comment">                 * signal of nearby pixels.</span></div>
+<div class="line"><a name="l09524"></a><span class="lineno"> 9524</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l09525"></a><span class="lineno"> 9525</span> </div>
+<div class="line"><a name="l09526"></a><span class="lineno"> 9526</span>                <span class="keywordflow">if</span> (pixel >= 1 && pixel < nx-2) {</div>
+<div class="line"><a name="l09527"></a><span class="lineno"> 9527</span>                    v0 = (sdata + i*nx)[pixel-1];</div>
+<div class="line"><a name="l09528"></a><span class="lineno"> 9528</span>                    v1 = (sdata + i*nx)[pixel];</div>
+<div class="line"><a name="l09529"></a><span class="lineno"> 9529</span>                    v2 = (sdata + i*nx)[pixel+1];</div>
+<div class="line"><a name="l09530"></a><span class="lineno"> 9530</span>                    v3 = (sdata + i*nx)[pixel+2];</div>
+<div class="line"><a name="l09531"></a><span class="lineno"> 9531</span>                    vi = (fpixel-pixel)*(fpixel-pixel)*(v3 - v2 - v1 + v0)</div>
+<div class="line"><a name="l09532"></a><span class="lineno"> 9532</span>                       + (fpixel-pixel)*(3*v2 - v3 - v1 - v0)</div>
+<div class="line"><a name="l09533"></a><span class="lineno"> 9533</span>                       + 2*v1;</div>
+<div class="line"><a name="l09534"></a><span class="lineno"> 9534</span>                    vi /= 2;</div>
+<div class="line"><a name="l09535"></a><span class="lineno"> 9535</span>                    <span class="keywordflow">if</span> (v1 > v2) {</div>
+<div class="line"><a name="l09536"></a><span class="lineno"> 9536</span>                        <span class="keywordflow">if</span> (vi > v1) { </div>
+<div class="line"><a name="l09537"></a><span class="lineno"> 9537</span>                            vi = v1;</div>
+<div class="line"><a name="l09538"></a><span class="lineno"> 9538</span>                        }</div>
+<div class="line"><a name="l09539"></a><span class="lineno"> 9539</span>                        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (vi < v2) {</div>
+<div class="line"><a name="l09540"></a><span class="lineno"> 9540</span>                            vi = v2;</div>
+<div class="line"><a name="l09541"></a><span class="lineno"> 9541</span>                        }</div>
+<div class="line"><a name="l09542"></a><span class="lineno"> 9542</span>                    }</div>
+<div class="line"><a name="l09543"></a><span class="lineno"> 9543</span>                    <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l09544"></a><span class="lineno"> 9544</span>                        <span class="keywordflow">if</span> (vi > v2) { </div>
+<div class="line"><a name="l09545"></a><span class="lineno"> 9545</span>                            vi = v2;</div>
+<div class="line"><a name="l09546"></a><span class="lineno"> 9546</span>                        }</div>
+<div class="line"><a name="l09547"></a><span class="lineno"> 9547</span>                        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (vi < v1) {</div>
+<div class="line"><a name="l09548"></a><span class="lineno"> 9548</span>                            vi = v1;</div>
+<div class="line"><a name="l09549"></a><span class="lineno"> 9549</span>                        }</div>
+<div class="line"><a name="l09550"></a><span class="lineno"> 9550</span>                    }</div>
+<div class="line"><a name="l09551"></a><span class="lineno"> 9551</span>                    <span class="keywordflow">if</span> (flux)</div>
+<div class="line"><a name="l09552"></a><span class="lineno"> 9552</span>                        vi *= dispersion * pixel_per_lambda;</div>
+<div class="line"><a name="l09553"></a><span class="lineno"> 9553</span>                    (rdata + i*nl)[j] = vi;</div>
+<div class="line"><a name="l09554"></a><span class="lineno"> 9554</span>                }</div>
+<div class="line"><a name="l09555"></a><span class="lineno"> 9555</span>                <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pixel >= 0 && pixel < nx-1) {</div>
+<div class="line"><a name="l09556"></a><span class="lineno"> 9556</span>                    v1 = (sdata + i*nx)[pixel];</div>
+<div class="line"><a name="l09557"></a><span class="lineno"> 9557</span>                    v2 = (sdata + i*nx)[pixel+1];</div>
+<div class="line"><a name="l09558"></a><span class="lineno"> 9558</span>                    vi = v1 + (v2-v1)*(fpixel-pixel);</div>
+<div class="line"><a name="l09559"></a><span class="lineno"> 9559</span>                    <span class="keywordflow">if</span> (flux)</div>
+<div class="line"><a name="l09560"></a><span class="lineno"> 9560</span>                        vi *= dispersion * pixel_per_lambda;</div>
+<div class="line"><a name="l09561"></a><span class="lineno"> 9561</span>                    (rdata + i*nl)[j] = vi;</div>
+<div class="line"><a name="l09562"></a><span class="lineno"> 9562</span>                }</div>
+<div class="line"><a name="l09563"></a><span class="lineno"> 9563</span>            }</div>
+<div class="line"><a name="l09564"></a><span class="lineno"> 9564</span>            <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l09565"></a><span class="lineno"> 9565</span> </div>
+<div class="line"><a name="l09566"></a><span class="lineno"> 9566</span>                <span class="comment">/*</span></div>
+<div class="line"><a name="l09567"></a><span class="lineno"> 9567</span> <span class="comment">                * Here instead we integrate the pixel values in</span></div>
+<div class="line"><a name="l09568"></a><span class="lineno"> 9568</span> <span class="comment">                * the interval centered at the interpolation point.</span></div>
+<div class="line"><a name="l09569"></a><span class="lineno"> 9569</span> <span class="comment">                * This interval is long dispersion * pixel_per_lambda</span></div>
+<div class="line"><a name="l09570"></a><span class="lineno"> 9570</span> <span class="comment">                * of the original pixels, and is centered at fpixel.</span></div>
+<div class="line"><a name="l09571"></a><span class="lineno"> 9571</span> <span class="comment">                * So it starts at fpixel - dispersion * pixel_per_lambda / 2,</span></div>
+<div class="line"><a name="l09572"></a><span class="lineno"> 9572</span> <span class="comment">                * and it ends at fpixel + dispersion * pixel_per_lambda / 2.</span></div>
+<div class="line"><a name="l09573"></a><span class="lineno"> 9573</span> <span class="comment">                */</span></div>
+<div class="line"><a name="l09574"></a><span class="lineno"> 9574</span> </div>
+<div class="line"><a name="l09575"></a><span class="lineno"> 9575</span>                <span class="keywordtype">double</span> spos = fpixel - dispersion * pixel_per_lambda / 2;</div>
+<div class="line"><a name="l09576"></a><span class="lineno"> 9576</span>                <span class="keywordtype">double</span> epos = fpixel + dispersion * pixel_per_lambda / 2;</div>
+<div class="line"><a name="l09577"></a><span class="lineno"> 9577</span> </div>
+<div class="line"><a name="l09578"></a><span class="lineno"> 9578</span>                <span class="comment">/*</span></div>
+<div class="line"><a name="l09579"></a><span class="lineno"> 9579</span> <span class="comment">                * Brutal sum over all involved pixels</span></div>
+<div class="line"><a name="l09580"></a><span class="lineno"> 9580</span> <span class="comment">                */</span></div>
+<div class="line"><a name="l09581"></a><span class="lineno"> 9581</span> </div>
+<div class="line"><a name="l09582"></a><span class="lineno"> 9582</span>                <span class="keywordtype">int</span> spix = spos;</div>
+<div class="line"><a name="l09583"></a><span class="lineno"> 9583</span>                <span class="keywordtype">int</span> epix = epos + 1;</div>
+<div class="line"><a name="l09584"></a><span class="lineno"> 9584</span> </div>
+<div class="line"><a name="l09585"></a><span class="lineno"> 9585</span>                <span class="keywordflow">if</span> (spix < 0)</div>
+<div class="line"><a name="l09586"></a><span class="lineno"> 9586</span>                    spix = 0;</div>
+<div class="line"><a name="l09587"></a><span class="lineno"> 9587</span> </div>
+<div class="line"><a name="l09588"></a><span class="lineno"> 9588</span>                <span class="keywordflow">if</span> (epix > nx)</div>
+<div class="line"><a name="l09589"></a><span class="lineno"> 9589</span>                    epix = nx;</div>
+<div class="line"><a name="l09590"></a><span class="lineno"> 9590</span> </div>
+<div class="line"><a name="l09591"></a><span class="lineno"> 9591</span>                vi = 0.0;</div>
+<div class="line"><a name="l09592"></a><span class="lineno"> 9592</span>                <span class="keywordflow">for</span> (k = spix; k < epix; k++) {</div>
+<div class="line"><a name="l09593"></a><span class="lineno"> 9593</span>                    <span class="keywordflow">if</span> (pixel >= 0 && pixel < nx) {</div>
+<div class="line"><a name="l09594"></a><span class="lineno"> 9594</span>                        vi += (sdata + i*nx)[k];</div>
+<div class="line"><a name="l09595"></a><span class="lineno"> 9595</span>                    }</div>
+<div class="line"><a name="l09596"></a><span class="lineno"> 9596</span>                }</div>
+<div class="line"><a name="l09597"></a><span class="lineno"> 9597</span> </div>
+<div class="line"><a name="l09598"></a><span class="lineno"> 9598</span>                <span class="comment">/*</span></div>
+<div class="line"><a name="l09599"></a><span class="lineno"> 9599</span> <span class="comment">                * Correct integrated flux by true length</span></div>
+<div class="line"><a name="l09600"></a><span class="lineno"> 9600</span> <span class="comment">                * of interval. This is clearly an approximation,</span></div>
+<div class="line"><a name="l09601"></a><span class="lineno"> 9601</span> <span class="comment">                * but it's good enough if the PSF is much larger</span></div>
+<div class="line"><a name="l09602"></a><span class="lineno"> 9602</span> <span class="comment">                * than the original pix.</span></div>
+<div class="line"><a name="l09603"></a><span class="lineno"> 9603</span> <span class="comment">                */</span></div>
+<div class="line"><a name="l09604"></a><span class="lineno"> 9604</span> </div>
+<div class="line"><a name="l09605"></a><span class="lineno"> 9605</span>                vi *= dispersion * pixel_per_lambda / (epix - spix);</div>
+<div class="line"><a name="l09606"></a><span class="lineno"> 9606</span> </div>
+<div class="line"><a name="l09607"></a><span class="lineno"> 9607</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l09608"></a><span class="lineno"> 9608</span> <span class="comment">                 * Flux conservation is a geometric factor that is applied</span></div>
+<div class="line"><a name="l09609"></a><span class="lineno"> 9609</span> <span class="comment">                 * always in the same way...</span></div>
+<div class="line"><a name="l09610"></a><span class="lineno"> 9610</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l09611"></a><span class="lineno"> 9611</span> </div>
+<div class="line"><a name="l09612"></a><span class="lineno"> 9612</span>                <span class="keywordflow">if</span> (flux)</div>
+<div class="line"><a name="l09613"></a><span class="lineno"> 9613</span>                    vi *= dispersion * pixel_per_lambda;</div>
+<div class="line"><a name="l09614"></a><span class="lineno"> 9614</span> </div>
+<div class="line"><a name="l09615"></a><span class="lineno"> 9615</span>                (rdata + i*nl)[j] = vi;</div>
+<div class="line"><a name="l09616"></a><span class="lineno"> 9616</span>             }</div>
+<div class="line"><a name="l09617"></a><span class="lineno"> 9617</span>         }</div>
+<div class="line"><a name="l09618"></a><span class="lineno"> 9618</span> </div>
+<div class="line"><a name="l09619"></a><span class="lineno"> 9619</span>         cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l09620"></a><span class="lineno"> 9620</span>     }</div>
+<div class="line"><a name="l09621"></a><span class="lineno"> 9621</span> </div>
+<div class="line"><a name="l09622"></a><span class="lineno"> 9622</span>     <span class="keywordflow">return</span> resampled;</div>
+<div class="line"><a name="l09623"></a><span class="lineno"> 9623</span> }</div>
+<div class="line"><a name="l09624"></a><span class="lineno"> 9624</span> </div>
+<div class="line"><a name="l09625"></a><span class="lineno"> 9625</span> </div>
+<div class="line"><a name="l09692"></a><span class="lineno"><a class="code" href="group__moses.html#ga634eb7408671a139e7015185776f4513"> 9692</a></span> cpl_table *<a class="code" href="group__moses.html#ga634eb7408671a139e7015185776f4513" title="Modify the input wavelength solution to match reference sky lines.">mos_wavelength_align</a>(cpl_image *image, cpl_table *slits, </div>
+<div class="line"><a name="l09693"></a><span class="lineno"> 9693</span>                                 <span class="keywordtype">double</span> refwave, <span class="keywordtype">double</span> firstLambda, </div>
+<div class="line"><a name="l09694"></a><span class="lineno"> 9694</span>                                 <span class="keywordtype">double</span> lastLambda, cpl_table *idscoeff,</div>
+<div class="line"><a name="l09695"></a><span class="lineno"> 9695</span>                                 cpl_vector *skylines, <span class="keywordtype">int</span> highres, <span class="keywordtype">int</span> order,</div>
+<div class="line"><a name="l09696"></a><span class="lineno"> 9696</span>                                 cpl_image *calibration, <span class="keywordtype">int</span> sradius)</div>
+<div class="line"><a name="l09697"></a><span class="lineno"> 9697</span> {</div>
+<div class="line"><a name="l09698"></a><span class="lineno"> 9698</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_wavelength_align"</span>;</div>
+<div class="line"><a name="l09699"></a><span class="lineno"> 9699</span> </div>
+<div class="line"><a name="l09700"></a><span class="lineno"> 9700</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l09701"></a><span class="lineno"> 9701</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l09702"></a><span class="lineno"> 9702</span>     <span class="keywordtype">double</span>         *line;</div>
+<div class="line"><a name="l09703"></a><span class="lineno"> 9703</span>     <span class="keywordtype">double</span>         *data;</div>
+<div class="line"><a name="l09704"></a><span class="lineno"> 9704</span>     <span class="keywordtype">double</span>          expPos, offset;</div>
+<div class="line"><a name="l09705"></a><span class="lineno"> 9705</span>     <span class="keywordtype">double</span>          c;</div>
+<div class="line"><a name="l09706"></a><span class="lineno"> 9706</span>     <span class="keywordtype">double</span>          lambda1, lambda2;</div>
+<div class="line"><a name="l09707"></a><span class="lineno"> 9707</span>     <span class="keywordtype">double</span>          rms;</div>
+<div class="line"><a name="l09708"></a><span class="lineno"> 9708</span>     <span class="keywordtype">float</span>           pos;</div>
+<div class="line"><a name="l09709"></a><span class="lineno"> 9709</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l09710"></a><span class="lineno"> 9710</span>     <span class="keywordtype">float</span>          *cdata;</div>
+<div class="line"><a name="l09711"></a><span class="lineno"> 9711</span>     <span class="keywordtype">int</span>            *idata;</div>
+<div class="line"><a name="l09712"></a><span class="lineno"> 9712</span>     <span class="keywordtype">int</span>             startPos, endPos;</div>
+<div class="line"><a name="l09713"></a><span class="lineno"> 9713</span>     <span class="keywordtype">int</span>             window = 2*sradius + 1;</div>
+<div class="line"><a name="l09714"></a><span class="lineno"> 9714</span>     <span class="keywordtype">int</span>             nlines;</div>
+<div class="line"><a name="l09715"></a><span class="lineno"> 9715</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l09716"></a><span class="lineno"> 9716</span>     <span class="keywordtype">int</span>             npoints;</div>
+<div class="line"><a name="l09717"></a><span class="lineno"> 9717</span>     <span class="keywordtype">int</span>             nrows;</div>
+<div class="line"><a name="l09718"></a><span class="lineno"> 9718</span>     <span class="keywordtype">int</span>             nx, ny;</div>
+<div class="line"><a name="l09719"></a><span class="lineno"> 9719</span>     <span class="keywordtype">int</span>             xlow, ylow, xhig, yhig;</div>
+<div class="line"><a name="l09720"></a><span class="lineno"> 9720</span>     <span class="keywordtype">int</span>             idsorder, uorder;</div>
+<div class="line"><a name="l09721"></a><span class="lineno"> 9721</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l09722"></a><span class="lineno"> 9722</span>     <span class="keywordtype">int</span>            *position;</div>
+<div class="line"><a name="l09723"></a><span class="lineno"> 9723</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l09724"></a><span class="lineno"> 9724</span>     <span class="keywordtype">int</span>             missing;</div>
+<div class="line"><a name="l09725"></a><span class="lineno"> 9725</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l09726"></a><span class="lineno"> 9726</span>     <span class="keywordtype">int</span>             i;</div>
+<div class="line"><a name="l09727"></a><span class="lineno"> 9727</span>     cpl_size        j, k;</div>
+<div class="line"><a name="l09728"></a><span class="lineno"> 9728</span> </div>
+<div class="line"><a name="l09729"></a><span class="lineno"> 9729</span>     <span class="keywordtype">char</span>            offname[MAX_COLNAME];</div>
+<div class="line"><a name="l09730"></a><span class="lineno"> 9730</span>     <span class="keywordtype">char</span>            name[MAX_COLNAME];</div>
+<div class="line"><a name="l09731"></a><span class="lineno"> 9731</span> </div>
+<div class="line"><a name="l09732"></a><span class="lineno"> 9732</span>     cpl_polynomial *ids;</div>
+<div class="line"><a name="l09733"></a><span class="lineno"> 9733</span>     cpl_polynomial *polycorr;</div>
+<div class="line"><a name="l09734"></a><span class="lineno"> 9734</span>     cpl_image      *exslit;</div>
+<div class="line"><a name="l09735"></a><span class="lineno"> 9735</span>     cpl_image      *sky;</div>
+<div class="line"><a name="l09736"></a><span class="lineno"> 9736</span>     cpl_table      *offsets;</div>
+<div class="line"><a name="l09737"></a><span class="lineno"> 9737</span>     cpl_table      *dummy;</div>
+<div class="line"><a name="l09738"></a><span class="lineno"> 9738</span>     cpl_vector     *wave;</div>
+<div class="line"><a name="l09739"></a><span class="lineno"> 9739</span>     cpl_vector     *offs;</div>
+<div class="line"><a name="l09740"></a><span class="lineno"> 9740</span>     </div>
+<div class="line"><a name="l09741"></a><span class="lineno"> 9741</span> </div>
+<div class="line"><a name="l09742"></a><span class="lineno"> 9742</span>     <span class="keywordflow">if</span> (idscoeff == NULL) {</div>
+<div class="line"><a name="l09743"></a><span class="lineno"> 9743</span>         cpl_msg_error(func, <span class="stringliteral">"An IDS coeff table must be given"</span>);</div>
+<div class="line"><a name="l09744"></a><span class="lineno"> 9744</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l09745"></a><span class="lineno"> 9745</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l09746"></a><span class="lineno"> 9746</span>     }</div>
+<div class="line"><a name="l09747"></a><span class="lineno"> 9747</span> </div>
+<div class="line"><a name="l09748"></a><span class="lineno"> 9748</span>     <span class="keywordflow">if</span> (image == NULL) {</div>
+<div class="line"><a name="l09749"></a><span class="lineno"> 9749</span>         cpl_msg_error(func, <span class="stringliteral">"A scientific spectral image must be given"</span>);</div>
+<div class="line"><a name="l09750"></a><span class="lineno"> 9750</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l09751"></a><span class="lineno"> 9751</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l09752"></a><span class="lineno"> 9752</span>     }</div>
+<div class="line"><a name="l09753"></a><span class="lineno"> 9753</span> </div>
+<div class="line"><a name="l09754"></a><span class="lineno"> 9754</span>     <span class="keywordflow">if</span> (slits == NULL) {</div>
+<div class="line"><a name="l09755"></a><span class="lineno"> 9755</span>         cpl_msg_error(func, <span class="stringliteral">"A slit position table must be given"</span>);</div>
+<div class="line"><a name="l09756"></a><span class="lineno"> 9756</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l09757"></a><span class="lineno"> 9757</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l09758"></a><span class="lineno"> 9758</span>     }</div>
+<div class="line"><a name="l09759"></a><span class="lineno"> 9759</span> </div>
+<div class="line"><a name="l09760"></a><span class="lineno"> 9760</span>     <span class="keywordflow">if</span> (skylines) {</div>
+<div class="line"><a name="l09761"></a><span class="lineno"> 9761</span>         line = cpl_vector_get_data(skylines);</div>
+<div class="line"><a name="l09762"></a><span class="lineno"> 9762</span>         nlines = cpl_vector_get_size(skylines);</div>
+<div class="line"><a name="l09763"></a><span class="lineno"> 9763</span>     }</div>
+<div class="line"><a name="l09764"></a><span class="lineno"> 9764</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l09765"></a><span class="lineno"> 9765</span>         cpl_msg_warning(func, <span class="stringliteral">"A catalog of sky lines wavelengths was not "</span></div>
+<div class="line"><a name="l09766"></a><span class="lineno"> 9766</span>                         <span class="stringliteral">"given: using internal list of reference sky lines"</span>);</div>
+<div class="line"><a name="l09767"></a><span class="lineno"> 9767</span>         <span class="keywordflow">if</span> (highres) {</div>
+<div class="line"><a name="l09768"></a><span class="lineno"> 9768</span>            line = default_lines_hi;</div>
+<div class="line"><a name="l09769"></a><span class="lineno"> 9769</span>            nlines = <span class="keyword">sizeof</span>(default_lines_hi) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l09770"></a><span class="lineno"> 9770</span>         }</div>
+<div class="line"><a name="l09771"></a><span class="lineno"> 9771</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l09772"></a><span class="lineno"> 9772</span>            line = default_lines_lo;</div>
+<div class="line"><a name="l09773"></a><span class="lineno"> 9773</span>            nlines = <span class="keyword">sizeof</span>(default_lines_lo) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l09774"></a><span class="lineno"> 9774</span>         }</div>
+<div class="line"><a name="l09775"></a><span class="lineno"> 9775</span>     }</div>
+<div class="line"><a name="l09776"></a><span class="lineno"> 9776</span> </div>
+<div class="line"><a name="l09777"></a><span class="lineno"> 9777</span>     <span class="keywordflow">if</span> (calibration)</div>
+<div class="line"><a name="l09778"></a><span class="lineno"> 9778</span>         cdata = cpl_image_get_data(calibration);</div>
+<div class="line"><a name="l09779"></a><span class="lineno"> 9779</span> </div>
+<div class="line"><a name="l09780"></a><span class="lineno"> 9780</span>     nx = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l09781"></a><span class="lineno"> 9781</span>     ny = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l09782"></a><span class="lineno"> 9782</span> </div>
+<div class="line"><a name="l09783"></a><span class="lineno"> 9783</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l09784"></a><span class="lineno"> 9784</span>     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l09785"></a><span class="lineno"> 9785</span>     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);</div>
+<div class="line"><a name="l09786"></a><span class="lineno"> 9786</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l09787"></a><span class="lineno"> 9787</span> </div>
+<div class="line"><a name="l09788"></a><span class="lineno"> 9788</span> </div>
+<div class="line"><a name="l09789"></a><span class="lineno"> 9789</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l09790"></a><span class="lineno"> 9790</span> <span class="comment">     * Define the output table of offsets</span></div>
+<div class="line"><a name="l09791"></a><span class="lineno"> 9791</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l09792"></a><span class="lineno"> 9792</span> </div>
+<div class="line"><a name="l09793"></a><span class="lineno"> 9793</span>     nrows = 0;</div>
+<div class="line"><a name="l09794"></a><span class="lineno"> 9794</span>     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l09795"></a><span class="lineno"> 9795</span>         <span class="keywordflow">if</span> (line[i] > firstLambda && line[i] < lastLambda)</div>
+<div class="line"><a name="l09796"></a><span class="lineno"> 9796</span>             nrows++;</div>
+<div class="line"><a name="l09797"></a><span class="lineno"> 9797</span> </div>
+<div class="line"><a name="l09798"></a><span class="lineno"> 9798</span>     offsets = cpl_table_new(nrows);</div>
+<div class="line"><a name="l09799"></a><span class="lineno"> 9799</span>     cpl_table_new_column(offsets, <span class="stringliteral">"wave"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l09800"></a><span class="lineno"> 9800</span>     cpl_table_set_column_unit(offsets, <span class="stringliteral">"wave"</span>, <span class="stringliteral">"Angstrom"</span>);</div>
+<div class="line"><a name="l09801"></a><span class="lineno"> 9801</span> </div>
+<div class="line"><a name="l09802"></a><span class="lineno"> 9802</span>     nrows = 0;</div>
+<div class="line"><a name="l09803"></a><span class="lineno"> 9803</span>     <span class="keywordflow">for</span> (i = 0; i < nlines; i++) {</div>
+<div class="line"><a name="l09804"></a><span class="lineno"> 9804</span>         <span class="keywordflow">if</span> (line[i] > firstLambda && line[i] < lastLambda) {</div>
+<div class="line"><a name="l09805"></a><span class="lineno"> 9805</span>             cpl_table_set_double(offsets, <span class="stringliteral">"wave"</span>, nrows, line[i]);</div>
+<div class="line"><a name="l09806"></a><span class="lineno"> 9806</span>             nrows++;</div>
+<div class="line"><a name="l09807"></a><span class="lineno"> 9807</span>         }</div>
+<div class="line"><a name="l09808"></a><span class="lineno"> 9808</span>     }</div>
+<div class="line"><a name="l09809"></a><span class="lineno"> 9809</span> </div>
+<div class="line"><a name="l09810"></a><span class="lineno"> 9810</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l09811"></a><span class="lineno"> 9811</span> <span class="comment">     * Here "line" is made to point to the new list of selected wavelengths</span></div>
+<div class="line"><a name="l09812"></a><span class="lineno"> 9812</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l09813"></a><span class="lineno"> 9813</span> </div>
+<div class="line"><a name="l09814"></a><span class="lineno"> 9814</span>     line = cpl_table_get_data_double(offsets, <span class="stringliteral">"wave"</span>);</div>
+<div class="line"><a name="l09815"></a><span class="lineno"> 9815</span>     nlines = nrows;</div>
+<div class="line"><a name="l09816"></a><span class="lineno"> 9816</span> </div>
+<div class="line"><a name="l09817"></a><span class="lineno"> 9817</span>     idsorder = 0;</div>
+<div class="line"><a name="l09818"></a><span class="lineno"> 9818</span>     <span class="keywordflow">while</span> (idsorder < 6 && cpl_table_has_column(idscoeff, clab[idsorder]))</div>
+<div class="line"><a name="l09819"></a><span class="lineno"> 9819</span>         ++idsorder;</div>
+<div class="line"><a name="l09820"></a><span class="lineno"> 9820</span>     --idsorder;</div>
+<div class="line"><a name="l09821"></a><span class="lineno"> 9821</span> </div>
+<div class="line"><a name="l09822"></a><span class="lineno"> 9822</span>     xlow = 1;</div>
+<div class="line"><a name="l09823"></a><span class="lineno"> 9823</span>     xhig = nx;</div>
+<div class="line"><a name="l09824"></a><span class="lineno"> 9824</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l09825"></a><span class="lineno"> 9825</span> </div>
+<div class="line"><a name="l09826"></a><span class="lineno"> 9826</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l09827"></a><span class="lineno"> 9827</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l09828"></a><span class="lineno"> 9828</span> </div>
+<div class="line"><a name="l09829"></a><span class="lineno"> 9829</span>         snprintf(offname, MAX_COLNAME, <span class="stringliteral">"offset%d"</span>, slit_id[i]);</div>
+<div class="line"><a name="l09830"></a><span class="lineno"> 9830</span>         cpl_table_new_column(offsets, offname, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l09831"></a><span class="lineno"> 9831</span> </div>
+<div class="line"><a name="l09832"></a><span class="lineno"> 9832</span>         <span class="comment">/* </span></div>
+<div class="line"><a name="l09833"></a><span class="lineno"> 9833</span> <span class="comment">         * Define the extraction boundaries. We DON'T write:</span></div>
+<div class="line"><a name="l09834"></a><span class="lineno"> 9834</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l09835"></a><span class="lineno"> 9835</span> <span class="comment">         * ylow = position[i];</span></div>
+<div class="line"><a name="l09836"></a><span class="lineno"> 9836</span> <span class="comment">         * yhig = ylow + length[i];</span></div>
+<div class="line"><a name="l09837"></a><span class="lineno"> 9837</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l09838"></a><span class="lineno"> 9838</span> <span class="comment">         * because the cpl_image pixels are counted from 1, and because in</span></div>
+<div class="line"><a name="l09839"></a><span class="lineno"> 9839</span> <span class="comment">         * cpl_image_extract() the coordinates of the last pixel are inclusive.</span></div>
+<div class="line"><a name="l09840"></a><span class="lineno"> 9840</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l09841"></a><span class="lineno"> 9841</span> </div>
+<div class="line"><a name="l09842"></a><span class="lineno"> 9842</span>         ylow = position[i] + 1;</div>
+<div class="line"><a name="l09843"></a><span class="lineno"> 9843</span>         yhig = ylow + length[i] - 1;</div>
+<div class="line"><a name="l09844"></a><span class="lineno"> 9844</span> </div>
+<div class="line"><a name="l09845"></a><span class="lineno"> 9845</span>         exslit = cpl_image_extract(image, xlow, ylow, xhig, yhig);</div>
+<div class="line"><a name="l09846"></a><span class="lineno"> 9846</span>         sky    = cpl_image_collapse_median_create(exslit, 0, 0, 1);</div>
+<div class="line"><a name="l09847"></a><span class="lineno"> 9847</span>         sdata  = cpl_image_get_data(sky);</div>
+<div class="line"><a name="l09848"></a><span class="lineno"> 9848</span> </div>
+<div class="line"><a name="l09849"></a><span class="lineno"> 9849</span>         cpl_image_delete(exslit);</div>
+<div class="line"><a name="l09850"></a><span class="lineno"> 9850</span> </div>
+<div class="line"><a name="l09851"></a><span class="lineno"> 9851</span>         <span class="comment">/* </span></div>
+<div class="line"><a name="l09852"></a><span class="lineno"> 9852</span> <span class="comment">         * Return here to a decent way of counting pixels (i.e., starting</span></div>
+<div class="line"><a name="l09853"></a><span class="lineno"> 9853</span> <span class="comment">         * from 0)</span></div>
+<div class="line"><a name="l09854"></a><span class="lineno"> 9854</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l09855"></a><span class="lineno"> 9855</span>          </div>
+<div class="line"><a name="l09856"></a><span class="lineno"> 9856</span>         ylow--;</div>
+<div class="line"><a name="l09857"></a><span class="lineno"> 9857</span> </div>
+<div class="line"><a name="l09858"></a><span class="lineno"> 9858</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l09859"></a><span class="lineno"> 9859</span> <span class="comment">         * Allocate a dummy table for collecting all the offsets</span></div>
+<div class="line"><a name="l09860"></a><span class="lineno"> 9860</span> <span class="comment">         * for all the lines: this is only needed for the computation</span></div>
+<div class="line"><a name="l09861"></a><span class="lineno"> 9861</span> <span class="comment">         * of the median offset for each sky line</span></div>
+<div class="line"><a name="l09862"></a><span class="lineno"> 9862</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l09863"></a><span class="lineno"> 9863</span> </div>
+<div class="line"><a name="l09864"></a><span class="lineno"> 9864</span>         dummy = cpl_table_new(yhig - ylow);</div>
+<div class="line"><a name="l09865"></a><span class="lineno"> 9865</span>         <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {</div>
+<div class="line"><a name="l09866"></a><span class="lineno"> 9866</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT, j);</div>
+<div class="line"><a name="l09867"></a><span class="lineno"> 9867</span>             cpl_table_new_column(dummy, name, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l09868"></a><span class="lineno"> 9868</span>         }</div>
+<div class="line"><a name="l09869"></a><span class="lineno"> 9869</span> </div>
+<div class="line"><a name="l09870"></a><span class="lineno"> 9870</span>         <span class="keywordflow">for</span> (j = ylow; j < yhig; j++) {</div>
+<div class="line"><a name="l09871"></a><span class="lineno"> 9871</span> </div>
+<div class="line"><a name="l09872"></a><span class="lineno"> 9872</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l09873"></a><span class="lineno"> 9873</span> <span class="comment">             * Get the IDS polynomial for the current slit row</span></div>
+<div class="line"><a name="l09874"></a><span class="lineno"> 9874</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l09875"></a><span class="lineno"> 9875</span> </div>
+<div class="line"><a name="l09876"></a><span class="lineno"> 9876</span>             missing = 0;</div>
+<div class="line"><a name="l09877"></a><span class="lineno"> 9877</span>             ids = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l09878"></a><span class="lineno"> 9878</span>             <span class="keywordflow">for</span> (k = 0; k <= idsorder; k++) {</div>
+<div class="line"><a name="l09879"></a><span class="lineno"> 9879</span>                 c = cpl_table_get_double(idscoeff, clab[k], j, &null);</div>
+<div class="line"><a name="l09880"></a><span class="lineno"> 9880</span>                 <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l09881"></a><span class="lineno"> 9881</span>                     cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l09882"></a><span class="lineno"> 9882</span>                     missing = 1;</div>
+<div class="line"><a name="l09883"></a><span class="lineno"> 9883</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l09884"></a><span class="lineno"> 9884</span>                 }</div>
+<div class="line"><a name="l09885"></a><span class="lineno"> 9885</span>                 cpl_polynomial_set_coeff(ids, &k, c);</div>
+<div class="line"><a name="l09886"></a><span class="lineno"> 9886</span>             }</div>
+<div class="line"><a name="l09887"></a><span class="lineno"> 9887</span>             <span class="keywordflow">if</span> (missing)</div>
+<div class="line"><a name="l09888"></a><span class="lineno"> 9888</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l09889"></a><span class="lineno"> 9889</span> </div>
+<div class="line"><a name="l09890"></a><span class="lineno"> 9890</span>             <span class="keywordflow">for</span> (k = 0; k < nlines; k++) {</div>
+<div class="line"><a name="l09891"></a><span class="lineno"> 9891</span>                 expPos = cpl_polynomial_eval_1d(ids, line[k] - refwave, NULL);</div>
+<div class="line"><a name="l09892"></a><span class="lineno"> 9892</span>                 startPos = expPos - sradius;</div>
+<div class="line"><a name="l09893"></a><span class="lineno"> 9893</span>                 endPos   = startPos + window;</div>
+<div class="line"><a name="l09894"></a><span class="lineno"> 9894</span>                 <span class="keywordflow">if</span> (startPos < 0 || endPos >= nx)</div>
+<div class="line"><a name="l09895"></a><span class="lineno"> 9895</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l09896"></a><span class="lineno"> 9896</span>            </div>
+<div class="line"><a name="l09897"></a><span class="lineno"> 9897</span>                 <span class="keywordflow">if</span> (0 == peakPosition(sdata + startPos, window, &pos, 1)) {</div>
+<div class="line"><a name="l09898"></a><span class="lineno"> 9898</span>                     pos += startPos;</div>
+<div class="line"><a name="l09899"></a><span class="lineno"> 9899</span>                     offset = pos - expPos;</div>
+<div class="line"><a name="l09900"></a><span class="lineno"> 9900</span>                     snprintf(name, MAX_COLNAME, <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT, k);</div>
+<div class="line"><a name="l09901"></a><span class="lineno"> 9901</span>                     cpl_table_set_double(dummy, name, j - ylow, offset);</div>
+<div class="line"><a name="l09902"></a><span class="lineno"> 9902</span>                 }</div>
+<div class="line"><a name="l09903"></a><span class="lineno"> 9903</span>             }</div>
+<div class="line"><a name="l09904"></a><span class="lineno"> 9904</span> </div>
+<div class="line"><a name="l09905"></a><span class="lineno"> 9905</span>             cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l09906"></a><span class="lineno"> 9906</span>         }</div>
+<div class="line"><a name="l09907"></a><span class="lineno"> 9907</span> </div>
+<div class="line"><a name="l09908"></a><span class="lineno"> 9908</span>         cpl_image_delete(sky);</div>
+<div class="line"><a name="l09909"></a><span class="lineno"> 9909</span> </div>
+<div class="line"><a name="l09910"></a><span class="lineno"> 9910</span>         <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {</div>
+<div class="line"><a name="l09911"></a><span class="lineno"> 9911</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"%"</span>CPL_SIZE_FORMAT, j);</div>
+<div class="line"><a name="l09912"></a><span class="lineno"> 9912</span>             <span class="keywordflow">if</span> (cpl_table_has_valid(dummy, name)) {</div>
+<div class="line"><a name="l09913"></a><span class="lineno"> 9913</span>                 offset = cpl_table_get_column_median(dummy, name);</div>
+<div class="line"><a name="l09914"></a><span class="lineno"> 9914</span>                 cpl_table_set_double(offsets, offname, j, offset);</div>
+<div class="line"><a name="l09915"></a><span class="lineno"> 9915</span>             }</div>
+<div class="line"><a name="l09916"></a><span class="lineno"> 9916</span>         }</div>
+<div class="line"><a name="l09917"></a><span class="lineno"> 9917</span> </div>
+<div class="line"><a name="l09918"></a><span class="lineno"> 9918</span>         cpl_table_delete(dummy);</div>
+<div class="line"><a name="l09919"></a><span class="lineno"> 9919</span> </div>
+<div class="line"><a name="l09920"></a><span class="lineno"> 9920</span>     }</div>
+<div class="line"><a name="l09921"></a><span class="lineno"> 9921</span> </div>
+<div class="line"><a name="l09922"></a><span class="lineno"> 9922</span> </div>
+<div class="line"><a name="l09923"></a><span class="lineno"> 9923</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l09924"></a><span class="lineno"> 9924</span> <span class="comment">     * In the following the input idscoeff table is modified by simply</span></div>
+<div class="line"><a name="l09925"></a><span class="lineno"> 9925</span> <span class="comment">     * adding the coefficients of the polynomial used to fit the sky</span></div>
+<div class="line"><a name="l09926"></a><span class="lineno"> 9926</span> <span class="comment">     * line residuals to the coefficients of the IDS polynomials.</span></div>
+<div class="line"><a name="l09927"></a><span class="lineno"> 9927</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l09928"></a><span class="lineno"> 9928</span> </div>
+<div class="line"><a name="l09929"></a><span class="lineno"> 9929</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l09930"></a><span class="lineno"> 9930</span> </div>
+<div class="line"><a name="l09931"></a><span class="lineno"> 9931</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l09932"></a><span class="lineno"> 9932</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l09933"></a><span class="lineno"> 9933</span> </div>
+<div class="line"><a name="l09934"></a><span class="lineno"> 9934</span>         snprintf(offname, MAX_COLNAME, <span class="stringliteral">"offset%d"</span>, slit_id[i]);</div>
+<div class="line"><a name="l09935"></a><span class="lineno"> 9935</span> </div>
+<div class="line"><a name="l09936"></a><span class="lineno"> 9936</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l09937"></a><span class="lineno"> 9937</span> <span class="comment">         * In the following, the "dummy" table is just a tool for</span></div>
+<div class="line"><a name="l09938"></a><span class="lineno"> 9938</span> <span class="comment">         * eliminating invalid points from the vectors to be fitted.</span></div>
+<div class="line"><a name="l09939"></a><span class="lineno"> 9939</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l09940"></a><span class="lineno"> 9940</span> </div>
+<div class="line"><a name="l09941"></a><span class="lineno"> 9941</span>         dummy = cpl_table_new(nlines);</div>
+<div class="line"><a name="l09942"></a><span class="lineno"> 9942</span>         cpl_table_duplicate_column(dummy, <span class="stringliteral">"wave"</span>, offsets, <span class="stringliteral">"wave"</span>);</div>
+<div class="line"><a name="l09943"></a><span class="lineno"> 9943</span>         cpl_table_duplicate_column(dummy, <span class="stringliteral">"offset"</span>, offsets, offname);</div>
+<div class="line"><a name="l09944"></a><span class="lineno"> 9944</span> </div>
+<div class="line"><a name="l09945"></a><span class="lineno"> 9945</span>         npoints = nlines - cpl_table_count_invalid(dummy, <span class="stringliteral">"offset"</span>);</div>
+<div class="line"><a name="l09946"></a><span class="lineno"> 9946</span>         <span class="keywordflow">if</span> (npoints == 0) {</div>
+<div class="line"><a name="l09947"></a><span class="lineno"> 9947</span>             cpl_msg_warning(func, <span class="stringliteral">"No sky lines alignment was possible "</span></div>
+<div class="line"><a name="l09948"></a><span class="lineno"> 9948</span>                             <span class="stringliteral">"for slit ID=%d: no sky line found"</span>, slit_id[i]);</div>
+<div class="line"><a name="l09949"></a><span class="lineno"> 9949</span>             cpl_table_delete(dummy);</div>
+<div class="line"><a name="l09950"></a><span class="lineno"> 9950</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l09951"></a><span class="lineno"> 9951</span>         }</div>
+<div class="line"><a name="l09952"></a><span class="lineno"> 9952</span> </div>
+<div class="line"><a name="l09953"></a><span class="lineno"> 9953</span>         uorder = order;</div>
+<div class="line"><a name="l09954"></a><span class="lineno"> 9954</span>         <span class="keywordflow">if</span> (npoints <= uorder) {</div>
+<div class="line"><a name="l09955"></a><span class="lineno"> 9955</span>             uorder = npoints - 1;</div>
+<div class="line"><a name="l09956"></a><span class="lineno"> 9956</span>             <span class="keywordflow">if</span> (uorder) {</div>
+<div class="line"><a name="l09957"></a><span class="lineno"> 9957</span>                 cpl_msg_warning(func, <span class="stringliteral">"Just %d sky lines detected for slit "</span></div>
+<div class="line"><a name="l09958"></a><span class="lineno"> 9958</span>                                 <span class="stringliteral">"ID=%d, while a polynomial order %d was "</span></div>
+<div class="line"><a name="l09959"></a><span class="lineno"> 9959</span>                                 <span class="stringliteral">"requested. Using polynomial order %d for "</span></div>
+<div class="line"><a name="l09960"></a><span class="lineno"> 9960</span>                                 <span class="stringliteral">"this slit!"</span>, npoints, slit_id[i], order, </div>
+<div class="line"><a name="l09961"></a><span class="lineno"> 9961</span>                                 uorder);</div>
+<div class="line"><a name="l09962"></a><span class="lineno"> 9962</span>             }</div>
+<div class="line"><a name="l09963"></a><span class="lineno"> 9963</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l09964"></a><span class="lineno"> 9964</span>                 cpl_msg_warning(func, <span class="stringliteral">"Just %d sky lines detected for slit "</span></div>
+<div class="line"><a name="l09965"></a><span class="lineno"> 9965</span>                                 <span class="stringliteral">"ID=%d, while a polynomial order %d was "</span></div>
+<div class="line"><a name="l09966"></a><span class="lineno"> 9966</span>                                 <span class="stringliteral">"requested. Computing a median offset for "</span></div>
+<div class="line"><a name="l09967"></a><span class="lineno"> 9967</span>                                 <span class="stringliteral">"this slit!"</span>, npoints, slit_id[i], order);</div>
+<div class="line"><a name="l09968"></a><span class="lineno"> 9968</span>             }</div>
+<div class="line"><a name="l09969"></a><span class="lineno"> 9969</span>         }</div>
+<div class="line"><a name="l09970"></a><span class="lineno"> 9970</span> </div>
+<div class="line"><a name="l09971"></a><span class="lineno"> 9971</span>         cpl_table_erase_invalid(dummy);</div>
+<div class="line"><a name="l09972"></a><span class="lineno"> 9972</span> </div>
+<div class="line"><a name="l09973"></a><span class="lineno"> 9973</span>         <span class="keywordflow">if</span> (uorder > 1) {</div>
+<div class="line"><a name="l09974"></a><span class="lineno"> 9974</span> </div>
+<div class="line"><a name="l09975"></a><span class="lineno"> 9975</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l09976"></a><span class="lineno"> 9976</span> <span class="comment">             * Model offsets with polynomial fitting</span></div>
+<div class="line"><a name="l09977"></a><span class="lineno"> 9977</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l09978"></a><span class="lineno"> 9978</span> </div>
+<div class="line"><a name="l09979"></a><span class="lineno"> 9979</span>             wave = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l09980"></a><span class="lineno"> 9980</span>                                    cpl_table_get_data_double(dummy, <span class="stringliteral">"wave"</span>));</div>
+<div class="line"><a name="l09981"></a><span class="lineno"> 9981</span>             offs = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l09982"></a><span class="lineno"> 9982</span>                                    cpl_table_get_data_double(dummy, <span class="stringliteral">"offset"</span>));</div>
+<div class="line"><a name="l09983"></a><span class="lineno"> 9983</span> </div>
+<div class="line"><a name="l09984"></a><span class="lineno"> 9984</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l09985"></a><span class="lineno"> 9985</span> <span class="comment">             * Set reference wavelength as zero point</span></div>
+<div class="line"><a name="l09986"></a><span class="lineno"> 9986</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l09987"></a><span class="lineno"> 9987</span> </div>
+<div class="line"><a name="l09988"></a><span class="lineno"> 9988</span>             cpl_vector_subtract_scalar(wave, refwave);</div>
+<div class="line"><a name="l09989"></a><span class="lineno"> 9989</span> </div>
+<div class="line"><a name="l09990"></a><span class="lineno"> 9990</span>             polycorr = cpl_polynomial_fit_1d_create(wave, offs, uorder, &rms);</div>
+<div class="line"><a name="l09991"></a><span class="lineno"> 9991</span> </div>
+<div class="line"><a name="l09992"></a><span class="lineno"> 9992</span>             rms = sqrt(rms * (uorder + 1) / npoints);</div>
+<div class="line"><a name="l09993"></a><span class="lineno"> 9993</span> </div>
+<div class="line"><a name="l09994"></a><span class="lineno"> 9994</span>             cpl_vector_unwrap(wave);</div>
+<div class="line"><a name="l09995"></a><span class="lineno"> 9995</span>             cpl_vector_unwrap(offs);</div>
+<div class="line"><a name="l09996"></a><span class="lineno"> 9996</span>             cpl_table_delete(dummy);</div>
+<div class="line"><a name="l09997"></a><span class="lineno"> 9997</span> </div>
+<div class="line"><a name="l09998"></a><span class="lineno"> 9998</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l09999"></a><span class="lineno"> 9999</span> <span class="comment">             * Now correct the coefficients of the corresponding IDS</span></div>
+<div class="line"><a name="l10000"></a><span class="lineno">10000</span> <span class="comment">             * polynomials related to this slit:</span></div>
+<div class="line"><a name="l10001"></a><span class="lineno">10001</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10002"></a><span class="lineno">10002</span> </div>
+<div class="line"><a name="l10003"></a><span class="lineno">10003</span>             ylow = position[i];</div>
+<div class="line"><a name="l10004"></a><span class="lineno">10004</span>             yhig = ylow + length[i];</div>
+<div class="line"><a name="l10005"></a><span class="lineno">10005</span> </div>
+<div class="line"><a name="l10006"></a><span class="lineno">10006</span>             <span class="keywordflow">for</span> (j = 0; j <= uorder; j++) {</div>
+<div class="line"><a name="l10007"></a><span class="lineno">10007</span>                 data = cpl_table_get_data_double(idscoeff, clab[j]);</div>
+<div class="line"><a name="l10008"></a><span class="lineno">10008</span>                 c = cpl_polynomial_get_coeff(polycorr, &j);</div>
+<div class="line"><a name="l10009"></a><span class="lineno">10009</span>                 <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)</div>
+<div class="line"><a name="l10010"></a><span class="lineno">10010</span>                     data[k] += c;</div>
+<div class="line"><a name="l10011"></a><span class="lineno">10011</span>             }</div>
+<div class="line"><a name="l10012"></a><span class="lineno">10012</span> </div>
+<div class="line"><a name="l10013"></a><span class="lineno">10013</span>             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l10014"></a><span class="lineno">10014</span>             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)</div>
+<div class="line"><a name="l10015"></a><span class="lineno">10015</span>                  data[k] = sqrt(data[k]*data[k] + rms*rms);</div>
+<div class="line"><a name="l10016"></a><span class="lineno">10016</span> </div>
+<div class="line"><a name="l10017"></a><span class="lineno">10017</span>             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);</div>
+<div class="line"><a name="l10018"></a><span class="lineno">10018</span>             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)</div>
+<div class="line"><a name="l10019"></a><span class="lineno">10019</span>                  idata[k] = npoints;</div>
+<div class="line"><a name="l10020"></a><span class="lineno">10020</span> </div>
+<div class="line"><a name="l10021"></a><span class="lineno">10021</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10022"></a><span class="lineno">10022</span> <span class="comment">             * If a wavelengths map was provided, correct it to keep</span></div>
+<div class="line"><a name="l10023"></a><span class="lineno">10023</span> <span class="comment">             * into account the alignment to skylines:</span></div>
+<div class="line"><a name="l10024"></a><span class="lineno">10024</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10025"></a><span class="lineno">10025</span> </div>
+<div class="line"><a name="l10026"></a><span class="lineno">10026</span>             <span class="keywordflow">if</span> (calibration) {</div>
+<div class="line"><a name="l10027"></a><span class="lineno">10027</span>                 <span class="keywordflow">for</span> (j = ylow; j < yhig; j++) {</div>
+<div class="line"><a name="l10028"></a><span class="lineno">10028</span>                     <span class="keywordflow">for</span> (k = 1; k < nx; k++) {</div>
+<div class="line"><a name="l10029"></a><span class="lineno">10029</span>                         lambda1 = cdata[k - 1 + j*nx];</div>
+<div class="line"><a name="l10030"></a><span class="lineno">10030</span>                         lambda2 = cdata[k + j*nx];</div>
+<div class="line"><a name="l10031"></a><span class="lineno">10031</span>                         <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)</div>
+<div class="line"><a name="l10032"></a><span class="lineno">10032</span>                             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10033"></a><span class="lineno">10033</span>                         offset = cpl_polynomial_eval_1d(polycorr, </div>
+<div class="line"><a name="l10034"></a><span class="lineno">10034</span>                                                         lambda1-refwave, NULL);</div>
+<div class="line"><a name="l10035"></a><span class="lineno">10035</span>                         cdata[k - 1 + j*nx] -= offset * (lambda2-lambda1);</div>
+<div class="line"><a name="l10036"></a><span class="lineno">10036</span>                     }</div>
+<div class="line"><a name="l10037"></a><span class="lineno">10037</span>                 }</div>
+<div class="line"><a name="l10038"></a><span class="lineno">10038</span>             }</div>
+<div class="line"><a name="l10039"></a><span class="lineno">10039</span>     </div>
+<div class="line"><a name="l10040"></a><span class="lineno">10040</span>             cpl_polynomial_delete(polycorr);</div>
+<div class="line"><a name="l10041"></a><span class="lineno">10041</span>         }</div>
+<div class="line"><a name="l10042"></a><span class="lineno">10042</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (uorder == 1) {</div>
+<div class="line"><a name="l10043"></a><span class="lineno">10043</span> </div>
+<div class="line"><a name="l10044"></a><span class="lineno">10044</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10045"></a><span class="lineno">10045</span> <span class="comment">             * Model offsets with robust linear fitting</span></div>
+<div class="line"><a name="l10046"></a><span class="lineno">10046</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10047"></a><span class="lineno">10047</span> </div>
+<div class="line"><a name="l10048"></a><span class="lineno">10048</span>             <span class="keywordtype">double</span>        q, m;</div>
+<div class="line"><a name="l10049"></a><span class="lineno">10049</span>             cpl_bivector *list;</div>
+<div class="line"><a name="l10050"></a><span class="lineno">10050</span> </div>
+<div class="line"><a name="l10051"></a><span class="lineno">10051</span> </div>
+<div class="line"><a name="l10052"></a><span class="lineno">10052</span>             wave = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l10053"></a><span class="lineno">10053</span>                                    cpl_table_get_data_double(dummy, <span class="stringliteral">"wave"</span>));</div>
+<div class="line"><a name="l10054"></a><span class="lineno">10054</span>             offs = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l10055"></a><span class="lineno">10055</span>                                    cpl_table_get_data_double(dummy, <span class="stringliteral">"offset"</span>));</div>
+<div class="line"><a name="l10056"></a><span class="lineno">10056</span> </div>
+<div class="line"><a name="l10057"></a><span class="lineno">10057</span>             list = cpl_bivector_wrap_vectors(wave, offs);</div>
+<div class="line"><a name="l10058"></a><span class="lineno">10058</span> </div>
+<div class="line"><a name="l10059"></a><span class="lineno">10059</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10060"></a><span class="lineno">10060</span> <span class="comment">             * Set reference wavelength as zero point</span></div>
+<div class="line"><a name="l10061"></a><span class="lineno">10061</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10062"></a><span class="lineno">10062</span> </div>
+<div class="line"><a name="l10063"></a><span class="lineno">10063</span>             cpl_vector_subtract_scalar(wave, refwave);</div>
+<div class="line"><a name="l10064"></a><span class="lineno">10064</span> </div>
+<div class="line"><a name="l10065"></a><span class="lineno">10065</span>             robustLinearFit(list, &q, &m, &rms);</div>
+<div class="line"><a name="l10066"></a><span class="lineno">10066</span> </div>
+<div class="line"><a name="l10067"></a><span class="lineno">10067</span>             rms = sqrt(rms * (uorder + 1) / npoints);</div>
+<div class="line"><a name="l10068"></a><span class="lineno">10068</span> </div>
+<div class="line"><a name="l10069"></a><span class="lineno">10069</span>             cpl_bivector_unwrap_vectors(list);</div>
+<div class="line"><a name="l10070"></a><span class="lineno">10070</span>             cpl_vector_unwrap(wave);</div>
+<div class="line"><a name="l10071"></a><span class="lineno">10071</span>             cpl_vector_unwrap(offs);</div>
+<div class="line"><a name="l10072"></a><span class="lineno">10072</span>             cpl_table_delete(dummy);</div>
+<div class="line"><a name="l10073"></a><span class="lineno">10073</span> </div>
+<div class="line"><a name="l10074"></a><span class="lineno">10074</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10075"></a><span class="lineno">10075</span> <span class="comment">             * Now correct the coefficients of the corresponding IDS</span></div>
+<div class="line"><a name="l10076"></a><span class="lineno">10076</span> <span class="comment">             * polynomials related to this slit:</span></div>
+<div class="line"><a name="l10077"></a><span class="lineno">10077</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10078"></a><span class="lineno">10078</span> </div>
+<div class="line"><a name="l10079"></a><span class="lineno">10079</span>             ylow = position[i];</div>
+<div class="line"><a name="l10080"></a><span class="lineno">10080</span>             yhig = ylow + length[i];</div>
+<div class="line"><a name="l10081"></a><span class="lineno">10081</span> </div>
+<div class="line"><a name="l10082"></a><span class="lineno">10082</span>             <span class="keywordflow">for</span> (j = 0; j <= uorder; j++) {</div>
+<div class="line"><a name="l10083"></a><span class="lineno">10083</span>                 data = cpl_table_get_data_double(idscoeff, clab[j]);</div>
+<div class="line"><a name="l10084"></a><span class="lineno">10084</span>                 <span class="keywordflow">if</span> (j)</div>
+<div class="line"><a name="l10085"></a><span class="lineno">10085</span>                     c = m;</div>
+<div class="line"><a name="l10086"></a><span class="lineno">10086</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l10087"></a><span class="lineno">10087</span>                     c = q;</div>
+<div class="line"><a name="l10088"></a><span class="lineno">10088</span>                 <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)</div>
+<div class="line"><a name="l10089"></a><span class="lineno">10089</span>                     data[k] += c;</div>
+<div class="line"><a name="l10090"></a><span class="lineno">10090</span>             }</div>
+<div class="line"><a name="l10091"></a><span class="lineno">10091</span> </div>
+<div class="line"><a name="l10092"></a><span class="lineno">10092</span>             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l10093"></a><span class="lineno">10093</span>             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)</div>
+<div class="line"><a name="l10094"></a><span class="lineno">10094</span>                  data[k] = sqrt(data[k]*data[k] + rms*rms);</div>
+<div class="line"><a name="l10095"></a><span class="lineno">10095</span> </div>
+<div class="line"><a name="l10096"></a><span class="lineno">10096</span>             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);</div>
+<div class="line"><a name="l10097"></a><span class="lineno">10097</span>             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)</div>
+<div class="line"><a name="l10098"></a><span class="lineno">10098</span>                  idata[k] = npoints;</div>
+<div class="line"><a name="l10099"></a><span class="lineno">10099</span> </div>
+<div class="line"><a name="l10100"></a><span class="lineno">10100</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10101"></a><span class="lineno">10101</span> <span class="comment">             * If a wavelengths map was provided, correct it to keep</span></div>
+<div class="line"><a name="l10102"></a><span class="lineno">10102</span> <span class="comment">             * into account the alignment to skylines:</span></div>
+<div class="line"><a name="l10103"></a><span class="lineno">10103</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10104"></a><span class="lineno">10104</span> </div>
+<div class="line"><a name="l10105"></a><span class="lineno">10105</span>             <span class="keywordflow">if</span> (calibration) {</div>
+<div class="line"><a name="l10106"></a><span class="lineno">10106</span>                 <span class="keywordflow">for</span> (j = ylow; j < yhig; j++) {</div>
+<div class="line"><a name="l10107"></a><span class="lineno">10107</span>                     <span class="keywordflow">for</span> (k = 1; k < nx; k++) {</div>
+<div class="line"><a name="l10108"></a><span class="lineno">10108</span>                         lambda1 = cdata[k - 1 + j*nx];</div>
+<div class="line"><a name="l10109"></a><span class="lineno">10109</span>                         lambda2 = cdata[k + j*nx];</div>
+<div class="line"><a name="l10110"></a><span class="lineno">10110</span>                         <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)</div>
+<div class="line"><a name="l10111"></a><span class="lineno">10111</span>                             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10112"></a><span class="lineno">10112</span>                         offset = q + m*(lambda1-refwave);</div>
+<div class="line"><a name="l10113"></a><span class="lineno">10113</span>                         cdata[k - 1 + j*nx] -= offset * (lambda2-lambda1);</div>
+<div class="line"><a name="l10114"></a><span class="lineno">10114</span>                     }</div>
+<div class="line"><a name="l10115"></a><span class="lineno">10115</span>                 }</div>
+<div class="line"><a name="l10116"></a><span class="lineno">10116</span>             }</div>
+<div class="line"><a name="l10117"></a><span class="lineno">10117</span>         }</div>
+<div class="line"><a name="l10118"></a><span class="lineno">10118</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l10119"></a><span class="lineno">10119</span> </div>
+<div class="line"><a name="l10120"></a><span class="lineno">10120</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10121"></a><span class="lineno">10121</span> <span class="comment">             * Just compute median offset</span></div>
+<div class="line"><a name="l10122"></a><span class="lineno">10122</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10123"></a><span class="lineno">10123</span> </div>
+<div class="line"><a name="l10124"></a><span class="lineno">10124</span>             offs = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l10125"></a><span class="lineno">10125</span>                                    cpl_table_get_data_double(dummy, <span class="stringliteral">"offset"</span>));</div>
+<div class="line"><a name="l10126"></a><span class="lineno">10126</span> </div>
+<div class="line"><a name="l10127"></a><span class="lineno">10127</span>             offset = cpl_vector_get_median_const(offs);</div>
+<div class="line"><a name="l10128"></a><span class="lineno">10128</span> </div>
+<div class="line"><a name="l10129"></a><span class="lineno">10129</span>             <span class="keywordflow">if</span> (npoints > 1)</div>
+<div class="line"><a name="l10130"></a><span class="lineno">10130</span>                 rms = cpl_table_get_column_stdev(dummy, <span class="stringliteral">"offset"</span>);</div>
+<div class="line"><a name="l10131"></a><span class="lineno">10131</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l10132"></a><span class="lineno">10132</span>                 rms = 0.0;</div>
+<div class="line"><a name="l10133"></a><span class="lineno">10133</span> </div>
+<div class="line"><a name="l10134"></a><span class="lineno">10134</span>             rms /= sqrt(npoints);</div>
+<div class="line"><a name="l10135"></a><span class="lineno">10135</span> </div>
+<div class="line"><a name="l10136"></a><span class="lineno">10136</span>             cpl_vector_unwrap(offs);</div>
+<div class="line"><a name="l10137"></a><span class="lineno">10137</span>             cpl_table_delete(dummy);</div>
+<div class="line"><a name="l10138"></a><span class="lineno">10138</span> </div>
+<div class="line"><a name="l10139"></a><span class="lineno">10139</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10140"></a><span class="lineno">10140</span> <span class="comment">             * Now correct the constant term of the corresponding IDS</span></div>
+<div class="line"><a name="l10141"></a><span class="lineno">10141</span> <span class="comment">             * polynomials related to this slit:</span></div>
+<div class="line"><a name="l10142"></a><span class="lineno">10142</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10143"></a><span class="lineno">10143</span> </div>
+<div class="line"><a name="l10144"></a><span class="lineno">10144</span>             ylow = position[i];</div>
+<div class="line"><a name="l10145"></a><span class="lineno">10145</span>             yhig = ylow + length[i];</div>
+<div class="line"><a name="l10146"></a><span class="lineno">10146</span> </div>
+<div class="line"><a name="l10147"></a><span class="lineno">10147</span>             data = cpl_table_get_data_double(idscoeff, clab[0]);</div>
+<div class="line"><a name="l10148"></a><span class="lineno">10148</span>             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)</div>
+<div class="line"><a name="l10149"></a><span class="lineno">10149</span>                 data[k] += offset;</div>
+<div class="line"><a name="l10150"></a><span class="lineno">10150</span> </div>
+<div class="line"><a name="l10151"></a><span class="lineno">10151</span>             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l10152"></a><span class="lineno">10152</span>             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)</div>
+<div class="line"><a name="l10153"></a><span class="lineno">10153</span>                  data[k] = sqrt(data[k]*data[k] + rms*rms);</div>
+<div class="line"><a name="l10154"></a><span class="lineno">10154</span> </div>
+<div class="line"><a name="l10155"></a><span class="lineno">10155</span>             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);</div>
+<div class="line"><a name="l10156"></a><span class="lineno">10156</span>             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)</div>
+<div class="line"><a name="l10157"></a><span class="lineno">10157</span>                  idata[k] = npoints;</div>
+<div class="line"><a name="l10158"></a><span class="lineno">10158</span> </div>
+<div class="line"><a name="l10159"></a><span class="lineno">10159</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10160"></a><span class="lineno">10160</span> <span class="comment">             * If a wavelengths map was provided, correct it to keep</span></div>
+<div class="line"><a name="l10161"></a><span class="lineno">10161</span> <span class="comment">             * into account the alignment to skylines. Note that </span></div>
+<div class="line"><a name="l10162"></a><span class="lineno">10162</span> <span class="comment">             * the offset must be converted from pixels to wavelengths.</span></div>
+<div class="line"><a name="l10163"></a><span class="lineno">10163</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10164"></a><span class="lineno">10164</span> </div>
+<div class="line"><a name="l10165"></a><span class="lineno">10165</span>             <span class="keywordflow">if</span> (calibration) {</div>
+<div class="line"><a name="l10166"></a><span class="lineno">10166</span>                 <span class="keywordflow">for</span> (j = ylow; j < yhig; j++) {</div>
+<div class="line"><a name="l10167"></a><span class="lineno">10167</span>                     <span class="keywordflow">for</span> (k = 1; k < nx; k++) {</div>
+<div class="line"><a name="l10168"></a><span class="lineno">10168</span>                         lambda1 = cdata[k - 1 + j*nx];</div>
+<div class="line"><a name="l10169"></a><span class="lineno">10169</span>                         lambda2 = cdata[k + j*nx];</div>
+<div class="line"><a name="l10170"></a><span class="lineno">10170</span>                         <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)</div>
+<div class="line"><a name="l10171"></a><span class="lineno">10171</span>                             <span class="keywordflow">continue</span>; </div>
+<div class="line"><a name="l10172"></a><span class="lineno">10172</span>                         cdata[k - 1 + j*nx] -= offset * (lambda2-lambda1);</div>
+<div class="line"><a name="l10173"></a><span class="lineno">10173</span>                     }</div>
+<div class="line"><a name="l10174"></a><span class="lineno">10174</span>                 }</div>
+<div class="line"><a name="l10175"></a><span class="lineno">10175</span>             }</div>
+<div class="line"><a name="l10176"></a><span class="lineno">10176</span>         }</div>
+<div class="line"><a name="l10177"></a><span class="lineno">10177</span>     }</div>
+<div class="line"><a name="l10178"></a><span class="lineno">10178</span> </div>
+<div class="line"><a name="l10179"></a><span class="lineno">10179</span>     <span class="keywordflow">return</span> offsets;</div>
+<div class="line"><a name="l10180"></a><span class="lineno">10180</span> </div>
+<div class="line"><a name="l10181"></a><span class="lineno">10181</span> }</div>
+<div class="line"><a name="l10182"></a><span class="lineno">10182</span> </div>
+<div class="line"><a name="l10183"></a><span class="lineno">10183</span> </div>
+<div class="line"><a name="l10245"></a><span class="lineno"><a class="code" href="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1">10245</a></span> cpl_table *<a class="code" href="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1" title="Modify the input wavelength solution to match reference sky lines (LSS).">mos_wavelength_align_lss</a>(cpl_image *image, <span class="keywordtype">double</span> refwave, </div>
+<div class="line"><a name="l10246"></a><span class="lineno">10246</span>                                     <span class="keywordtype">double</span> firstLambda, <span class="keywordtype">double</span> lastLambda, </div>
+<div class="line"><a name="l10247"></a><span class="lineno">10247</span>                                     cpl_table *idscoeff, cpl_vector *skylines, </div>
+<div class="line"><a name="l10248"></a><span class="lineno">10248</span>                                     <span class="keywordtype">int</span> highres, <span class="keywordtype">int</span> order, </div>
+<div class="line"><a name="l10249"></a><span class="lineno">10249</span>                                     cpl_image *calibration, <span class="keywordtype">int</span> sradius)</div>
+<div class="line"><a name="l10250"></a><span class="lineno">10250</span> {</div>
+<div class="line"><a name="l10251"></a><span class="lineno">10251</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_wavelength_align_lss"</span>;</div>
+<div class="line"><a name="l10252"></a><span class="lineno">10252</span> </div>
+<div class="line"><a name="l10253"></a><span class="lineno">10253</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l10254"></a><span class="lineno">10254</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l10255"></a><span class="lineno">10255</span>     <span class="keywordtype">double</span>         *line;</div>
+<div class="line"><a name="l10256"></a><span class="lineno">10256</span>     <span class="keywordtype">double</span>         *data;</div>
+<div class="line"><a name="l10257"></a><span class="lineno">10257</span>     <span class="keywordtype">double</span>         *wdata;</div>
+<div class="line"><a name="l10258"></a><span class="lineno">10258</span>     <span class="keywordtype">double</span>         *odata;</div>
+<div class="line"><a name="l10259"></a><span class="lineno">10259</span>     <span class="keywordtype">double</span>          expPos, offset;</div>
+<div class="line"><a name="l10260"></a><span class="lineno">10260</span>     <span class="keywordtype">double</span>          c;</div>
+<div class="line"><a name="l10261"></a><span class="lineno">10261</span>     <span class="keywordtype">double</span>          lambda1, lambda2;</div>
+<div class="line"><a name="l10262"></a><span class="lineno">10262</span>     <span class="keywordtype">double</span>          rms;</div>
+<div class="line"><a name="l10263"></a><span class="lineno">10263</span>     <span class="keywordtype">float</span>           pos;</div>
+<div class="line"><a name="l10264"></a><span class="lineno">10264</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l10265"></a><span class="lineno">10265</span>     <span class="keywordtype">float</span>          *cdata;</div>
+<div class="line"><a name="l10266"></a><span class="lineno">10266</span>     <span class="keywordtype">int</span>            *idata;</div>
+<div class="line"><a name="l10267"></a><span class="lineno">10267</span>     <span class="keywordtype">int</span>             startPos, endPos;</div>
+<div class="line"><a name="l10268"></a><span class="lineno">10268</span>     <span class="keywordtype">int</span>             window = 2*sradius + 1;</div>
+<div class="line"><a name="l10269"></a><span class="lineno">10269</span>     <span class="keywordtype">int</span>             nlines;</div>
+<div class="line"><a name="l10270"></a><span class="lineno">10270</span>     <span class="keywordtype">int</span>             npoints;</div>
+<div class="line"><a name="l10271"></a><span class="lineno">10271</span>     <span class="keywordtype">int</span>             nrows;</div>
+<div class="line"><a name="l10272"></a><span class="lineno">10272</span>     <span class="keywordtype">int</span>             nx, ny;</div>
+<div class="line"><a name="l10273"></a><span class="lineno">10273</span>     <span class="keywordtype">int</span>             idsorder, uorder;</div>
+<div class="line"><a name="l10274"></a><span class="lineno">10274</span>     <span class="keywordtype">int</span>             missing;</div>
+<div class="line"><a name="l10275"></a><span class="lineno">10275</span>     <span class="keywordtype">int</span>             i;</div>
+<div class="line"><a name="l10276"></a><span class="lineno">10276</span>     cpl_size        j, k;</div>
+<div class="line"><a name="l10277"></a><span class="lineno">10277</span> </div>
+<div class="line"><a name="l10278"></a><span class="lineno">10278</span>     <span class="keywordtype">char</span>            name[MAX_COLNAME];</div>
+<div class="line"><a name="l10279"></a><span class="lineno">10279</span>     <span class="keywordtype">char</span>            fname[MAX_COLNAME];</div>
+<div class="line"><a name="l10280"></a><span class="lineno">10280</span> </div>
+<div class="line"><a name="l10281"></a><span class="lineno">10281</span>     cpl_polynomial *ids;</div>
+<div class="line"><a name="l10282"></a><span class="lineno">10282</span>     cpl_polynomial *polycorr;</div>
+<div class="line"><a name="l10283"></a><span class="lineno">10283</span>     cpl_table      *offsets;</div>
+<div class="line"><a name="l10284"></a><span class="lineno">10284</span>     cpl_table      *fittable;</div>
+<div class="line"><a name="l10285"></a><span class="lineno">10285</span>     cpl_table      *dummy;</div>
+<div class="line"><a name="l10286"></a><span class="lineno">10286</span>     cpl_vector     *wave;</div>
+<div class="line"><a name="l10287"></a><span class="lineno">10287</span>     cpl_vector     *offs;</div>
+<div class="line"><a name="l10288"></a><span class="lineno">10288</span>     cpl_vector     *row;</div>
+<div class="line"><a name="l10289"></a><span class="lineno">10289</span>     </div>
+<div class="line"><a name="l10290"></a><span class="lineno">10290</span> </div>
+<div class="line"><a name="l10291"></a><span class="lineno">10291</span>     <span class="keywordflow">if</span> (idscoeff == NULL) {</div>
+<div class="line"><a name="l10292"></a><span class="lineno">10292</span>         cpl_msg_error(func, <span class="stringliteral">"An IDS coeff table must be given"</span>);</div>
+<div class="line"><a name="l10293"></a><span class="lineno">10293</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l10294"></a><span class="lineno">10294</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l10295"></a><span class="lineno">10295</span>     }</div>
+<div class="line"><a name="l10296"></a><span class="lineno">10296</span> </div>
+<div class="line"><a name="l10297"></a><span class="lineno">10297</span>     <span class="keywordflow">if</span> (image == NULL) {</div>
+<div class="line"><a name="l10298"></a><span class="lineno">10298</span>         cpl_msg_error(func, <span class="stringliteral">"A scientific spectral image must be given"</span>);</div>
+<div class="line"><a name="l10299"></a><span class="lineno">10299</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l10300"></a><span class="lineno">10300</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l10301"></a><span class="lineno">10301</span>     }</div>
+<div class="line"><a name="l10302"></a><span class="lineno">10302</span> </div>
+<div class="line"><a name="l10303"></a><span class="lineno">10303</span>     <span class="keywordflow">if</span> (skylines) {</div>
+<div class="line"><a name="l10304"></a><span class="lineno">10304</span>         line = cpl_vector_get_data(skylines);</div>
+<div class="line"><a name="l10305"></a><span class="lineno">10305</span>         nlines = cpl_vector_get_size(skylines);</div>
+<div class="line"><a name="l10306"></a><span class="lineno">10306</span>     }</div>
+<div class="line"><a name="l10307"></a><span class="lineno">10307</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l10308"></a><span class="lineno">10308</span>         cpl_msg_warning(func, <span class="stringliteral">"A catalog of sky lines wavelengths was not "</span></div>
+<div class="line"><a name="l10309"></a><span class="lineno">10309</span>                         <span class="stringliteral">"given: using internal list of reference sky lines"</span>);</div>
+<div class="line"><a name="l10310"></a><span class="lineno">10310</span>         <span class="keywordflow">if</span> (highres) {</div>
+<div class="line"><a name="l10311"></a><span class="lineno">10311</span>            line = default_lines_hi;</div>
+<div class="line"><a name="l10312"></a><span class="lineno">10312</span>            nlines = <span class="keyword">sizeof</span>(default_lines_hi) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l10313"></a><span class="lineno">10313</span>         }</div>
+<div class="line"><a name="l10314"></a><span class="lineno">10314</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l10315"></a><span class="lineno">10315</span>            line = default_lines_lo;</div>
+<div class="line"><a name="l10316"></a><span class="lineno">10316</span>            nlines = <span class="keyword">sizeof</span>(default_lines_lo) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l10317"></a><span class="lineno">10317</span>         }</div>
+<div class="line"><a name="l10318"></a><span class="lineno">10318</span>     }</div>
+<div class="line"><a name="l10319"></a><span class="lineno">10319</span> </div>
+<div class="line"><a name="l10320"></a><span class="lineno">10320</span>     <span class="keywordflow">if</span> (calibration)</div>
+<div class="line"><a name="l10321"></a><span class="lineno">10321</span>         cdata = cpl_image_get_data(calibration);</div>
+<div class="line"><a name="l10322"></a><span class="lineno">10322</span> </div>
+<div class="line"><a name="l10323"></a><span class="lineno">10323</span>     nx = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l10324"></a><span class="lineno">10324</span>     ny = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l10325"></a><span class="lineno">10325</span> </div>
+<div class="line"><a name="l10326"></a><span class="lineno">10326</span>     sdata = cpl_image_get_data(image);</div>
+<div class="line"><a name="l10327"></a><span class="lineno">10327</span> </div>
+<div class="line"><a name="l10328"></a><span class="lineno">10328</span>     <span class="keywordflow">if</span> (ny != cpl_table_get_nrow(idscoeff)) {</div>
+<div class="line"><a name="l10329"></a><span class="lineno">10329</span>         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l10330"></a><span class="lineno">10330</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l10331"></a><span class="lineno">10331</span>     }</div>
+<div class="line"><a name="l10332"></a><span class="lineno">10332</span>     </div>
+<div class="line"><a name="l10333"></a><span class="lineno">10333</span> </div>
+<div class="line"><a name="l10334"></a><span class="lineno">10334</span>     <span class="comment">/*FIXME: This is a remnant of the adaptation of the function</span></div>
+<div class="line"><a name="l10335"></a><span class="lineno">10335</span> <span class="comment">     * mos_wavelength_align(), where an offset table was created.</span></div>
+<div class="line"><a name="l10336"></a><span class="lineno">10336</span> <span class="comment">     * I leave it here because I am in a hurry, it is just used to</span></div>
+<div class="line"><a name="l10337"></a><span class="lineno">10337</span> <span class="comment">     * hold the list of selected sky lines.</span></div>
+<div class="line"><a name="l10338"></a><span class="lineno">10338</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l10339"></a><span class="lineno">10339</span> <span class="comment">     * Define table of wavelengths</span></div>
+<div class="line"><a name="l10340"></a><span class="lineno">10340</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l10341"></a><span class="lineno">10341</span> </div>
+<div class="line"><a name="l10342"></a><span class="lineno">10342</span>     nrows = 0;</div>
+<div class="line"><a name="l10343"></a><span class="lineno">10343</span>     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l10344"></a><span class="lineno">10344</span>         <span class="keywordflow">if</span> (line[i] > firstLambda && line[i] < lastLambda)</div>
+<div class="line"><a name="l10345"></a><span class="lineno">10345</span>             nrows++;</div>
+<div class="line"><a name="l10346"></a><span class="lineno">10346</span> </div>
+<div class="line"><a name="l10347"></a><span class="lineno">10347</span>     offsets = cpl_table_new(nrows);</div>
+<div class="line"><a name="l10348"></a><span class="lineno">10348</span>     cpl_table_new_column(offsets, <span class="stringliteral">"wave"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l10349"></a><span class="lineno">10349</span>     cpl_table_set_column_unit(offsets, <span class="stringliteral">"wave"</span>, <span class="stringliteral">"Angstrom"</span>);</div>
+<div class="line"><a name="l10350"></a><span class="lineno">10350</span> </div>
+<div class="line"><a name="l10351"></a><span class="lineno">10351</span>     nrows = 0;</div>
+<div class="line"><a name="l10352"></a><span class="lineno">10352</span>     <span class="keywordflow">for</span> (i = 0; i < nlines; i++) {</div>
+<div class="line"><a name="l10353"></a><span class="lineno">10353</span>         <span class="keywordflow">if</span> (line[i] > firstLambda && line[i] < lastLambda) {</div>
+<div class="line"><a name="l10354"></a><span class="lineno">10354</span>             cpl_table_set_double(offsets, <span class="stringliteral">"wave"</span>, nrows, line[i]);</div>
+<div class="line"><a name="l10355"></a><span class="lineno">10355</span>             nrows++;</div>
+<div class="line"><a name="l10356"></a><span class="lineno">10356</span>         }</div>
+<div class="line"><a name="l10357"></a><span class="lineno">10357</span>     }</div>
+<div class="line"><a name="l10358"></a><span class="lineno">10358</span> </div>
+<div class="line"><a name="l10359"></a><span class="lineno">10359</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l10360"></a><span class="lineno">10360</span> <span class="comment">     * Here "line" is made to point to the new list of selected wavelengths</span></div>
+<div class="line"><a name="l10361"></a><span class="lineno">10361</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l10362"></a><span class="lineno">10362</span> </div>
+<div class="line"><a name="l10363"></a><span class="lineno">10363</span>     line = cpl_table_get_data_double(offsets, <span class="stringliteral">"wave"</span>);</div>
+<div class="line"><a name="l10364"></a><span class="lineno">10364</span>     nlines = nrows;</div>
+<div class="line"><a name="l10365"></a><span class="lineno">10365</span> </div>
+<div class="line"><a name="l10366"></a><span class="lineno">10366</span>     idsorder = 0;</div>
+<div class="line"><a name="l10367"></a><span class="lineno">10367</span>     <span class="keywordflow">while</span> (idsorder < 6 && cpl_table_has_column(idscoeff, clab[idsorder]))</div>
+<div class="line"><a name="l10368"></a><span class="lineno">10368</span>         ++idsorder;</div>
+<div class="line"><a name="l10369"></a><span class="lineno">10369</span>     --idsorder;</div>
+<div class="line"><a name="l10370"></a><span class="lineno">10370</span> </div>
+<div class="line"><a name="l10371"></a><span class="lineno">10371</span> </div>
+<div class="line"><a name="l10372"></a><span class="lineno">10372</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l10373"></a><span class="lineno">10373</span> <span class="comment">     * Allocate a dummy table for collecting all the offsets</span></div>
+<div class="line"><a name="l10374"></a><span class="lineno">10374</span> <span class="comment">     * for all the lines</span></div>
+<div class="line"><a name="l10375"></a><span class="lineno">10375</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l10376"></a><span class="lineno">10376</span> </div>
+<div class="line"><a name="l10377"></a><span class="lineno">10377</span>     dummy = cpl_table_new(ny);</div>
+<div class="line"><a name="l10378"></a><span class="lineno">10378</span>     <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {</div>
+<div class="line"><a name="l10379"></a><span class="lineno">10379</span>         snprintf(name, MAX_COLNAME, <span class="stringliteral">"off_%d"</span>, (<span class="keywordtype">int</span>)line[j]);</div>
+<div class="line"><a name="l10380"></a><span class="lineno">10380</span>         snprintf(fname, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);</div>
+<div class="line"><a name="l10381"></a><span class="lineno">10381</span>         cpl_table_new_column(dummy, name, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l10382"></a><span class="lineno">10382</span>         cpl_table_new_column(dummy, fname, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l10383"></a><span class="lineno">10383</span>     }</div>
+<div class="line"><a name="l10384"></a><span class="lineno">10384</span> </div>
+<div class="line"><a name="l10385"></a><span class="lineno">10385</span>     <span class="keywordflow">for</span> (j = 0; j < ny; j++, sdata += nx) {</div>
+<div class="line"><a name="l10386"></a><span class="lineno">10386</span> </div>
+<div class="line"><a name="l10387"></a><span class="lineno">10387</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l10388"></a><span class="lineno">10388</span> <span class="comment">         * Get the IDS polynomial for the current slit row</span></div>
+<div class="line"><a name="l10389"></a><span class="lineno">10389</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l10390"></a><span class="lineno">10390</span> </div>
+<div class="line"><a name="l10391"></a><span class="lineno">10391</span>         missing = 0;</div>
+<div class="line"><a name="l10392"></a><span class="lineno">10392</span>         ids = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l10393"></a><span class="lineno">10393</span>         <span class="keywordflow">for</span> (k = 0; k <= idsorder; k++) {</div>
+<div class="line"><a name="l10394"></a><span class="lineno">10394</span>             c = cpl_table_get_double(idscoeff, clab[k], j, &missing);</div>
+<div class="line"><a name="l10395"></a><span class="lineno">10395</span>             <span class="keywordflow">if</span> (missing) {</div>
+<div class="line"><a name="l10396"></a><span class="lineno">10396</span>                 cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l10397"></a><span class="lineno">10397</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l10398"></a><span class="lineno">10398</span>             }</div>
+<div class="line"><a name="l10399"></a><span class="lineno">10399</span>             cpl_polynomial_set_coeff(ids, &k, c);</div>
+<div class="line"><a name="l10400"></a><span class="lineno">10400</span>         }</div>
+<div class="line"><a name="l10401"></a><span class="lineno">10401</span>         <span class="keywordflow">if</span> (missing)</div>
+<div class="line"><a name="l10402"></a><span class="lineno">10402</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10403"></a><span class="lineno">10403</span> </div>
+<div class="line"><a name="l10404"></a><span class="lineno">10404</span>         <span class="keywordflow">for</span> (k = 0; k < nlines; k++) {</div>
+<div class="line"><a name="l10405"></a><span class="lineno">10405</span>             expPos = cpl_polynomial_eval_1d(ids, line[k] - refwave, NULL);</div>
+<div class="line"><a name="l10406"></a><span class="lineno">10406</span>             startPos = expPos - sradius;</div>
+<div class="line"><a name="l10407"></a><span class="lineno">10407</span>             endPos   = startPos + window;</div>
+<div class="line"><a name="l10408"></a><span class="lineno">10408</span>             <span class="keywordflow">if</span> (startPos < 0 || endPos >= nx)</div>
+<div class="line"><a name="l10409"></a><span class="lineno">10409</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10410"></a><span class="lineno">10410</span>            </div>
+<div class="line"><a name="l10411"></a><span class="lineno">10411</span>             <span class="keywordflow">if</span> (0 == peakPosition(sdata + startPos, window, &pos, 1)) {</div>
+<div class="line"><a name="l10412"></a><span class="lineno">10412</span>                 pos += startPos;</div>
+<div class="line"><a name="l10413"></a><span class="lineno">10413</span>                 offset = pos - expPos;</div>
+<div class="line"><a name="l10414"></a><span class="lineno">10414</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"off_%d"</span>, (<span class="keywordtype">int</span>)line[k]);</div>
+<div class="line"><a name="l10415"></a><span class="lineno">10415</span>                 cpl_table_set_double(dummy, name, j, offset);</div>
+<div class="line"><a name="l10416"></a><span class="lineno">10416</span>             }</div>
+<div class="line"><a name="l10417"></a><span class="lineno">10417</span>         }</div>
+<div class="line"><a name="l10418"></a><span class="lineno">10418</span> </div>
+<div class="line"><a name="l10419"></a><span class="lineno">10419</span>         cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l10420"></a><span class="lineno">10420</span>     }</div>
+<div class="line"><a name="l10421"></a><span class="lineno">10421</span> </div>
+<div class="line"><a name="l10422"></a><span class="lineno">10422</span> </div>
+<div class="line"><a name="l10423"></a><span class="lineno">10423</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l10424"></a><span class="lineno">10424</span> <span class="comment">     * At this point for each sky line we model its offset along</span></div>
+<div class="line"><a name="l10425"></a><span class="lineno">10425</span> <span class="comment">     * the image rows using a robust linear fitting</span></div>
+<div class="line"><a name="l10426"></a><span class="lineno">10426</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l10427"></a><span class="lineno">10427</span> </div>
+<div class="line"><a name="l10428"></a><span class="lineno">10428</span>     <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {</div>
+<div class="line"><a name="l10429"></a><span class="lineno">10429</span>         snprintf(name, MAX_COLNAME, <span class="stringliteral">"off_%d"</span>, (<span class="keywordtype">int</span>)line[j]);</div>
+<div class="line"><a name="l10430"></a><span class="lineno">10430</span>         snprintf(fname, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);</div>
+<div class="line"><a name="l10431"></a><span class="lineno">10431</span>         <span class="keywordflow">if</span> (cpl_table_has_valid(dummy, name)) {</div>
+<div class="line"><a name="l10432"></a><span class="lineno">10432</span> </div>
+<div class="line"><a name="l10433"></a><span class="lineno">10433</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10434"></a><span class="lineno">10434</span> <span class="comment">             * In the following, the "fittable" is just a tool for</span></div>
+<div class="line"><a name="l10435"></a><span class="lineno">10435</span> <span class="comment">             * eliminating invalid points from the vectors to be fitted.</span></div>
+<div class="line"><a name="l10436"></a><span class="lineno">10436</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10437"></a><span class="lineno">10437</span> </div>
+<div class="line"><a name="l10438"></a><span class="lineno">10438</span>             <span class="keywordtype">double</span>        q, m;</div>
+<div class="line"><a name="l10439"></a><span class="lineno">10439</span>             cpl_bivector *list;</div>
+<div class="line"><a name="l10440"></a><span class="lineno">10440</span> </div>
+<div class="line"><a name="l10441"></a><span class="lineno">10441</span>             fittable = cpl_table_new(ny);</div>
+<div class="line"><a name="l10442"></a><span class="lineno">10442</span>             cpl_table_new_column(fittable, <span class="stringliteral">"row"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l10443"></a><span class="lineno">10443</span>             cpl_table_set_column_unit(fittable, <span class="stringliteral">"row"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l10444"></a><span class="lineno">10444</span>             <span class="keywordflow">for</span> (k = 0; k < ny; k++)</div>
+<div class="line"><a name="l10445"></a><span class="lineno">10445</span>                  cpl_table_set_double(fittable, <span class="stringliteral">"row"</span>, k, k);</div>
+<div class="line"><a name="l10446"></a><span class="lineno">10446</span>             cpl_table_duplicate_column(fittable, <span class="stringliteral">"offset"</span>, dummy, name);</div>
+<div class="line"><a name="l10447"></a><span class="lineno">10447</span>             npoints = ny - cpl_table_count_invalid(fittable, <span class="stringliteral">"offset"</span>);</div>
+<div class="line"><a name="l10448"></a><span class="lineno">10448</span>             cpl_table_erase_invalid(fittable);</div>
+<div class="line"><a name="l10449"></a><span class="lineno">10449</span>             row = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l10450"></a><span class="lineno">10450</span>                                cpl_table_get_data_double(fittable, <span class="stringliteral">"row"</span>));</div>
+<div class="line"><a name="l10451"></a><span class="lineno">10451</span>             offs = cpl_vector_wrap(npoints,</div>
+<div class="line"><a name="l10452"></a><span class="lineno">10452</span>                                cpl_table_get_data_double(fittable, <span class="stringliteral">"offset"</span>));</div>
+<div class="line"><a name="l10453"></a><span class="lineno">10453</span>             list = cpl_bivector_wrap_vectors(row, offs);</div>
+<div class="line"><a name="l10454"></a><span class="lineno">10454</span>             robustLinearFit(list, &q, &m, &rms);</div>
+<div class="line"><a name="l10455"></a><span class="lineno">10455</span>             cpl_bivector_unwrap_vectors(list);</div>
+<div class="line"><a name="l10456"></a><span class="lineno">10456</span>             cpl_vector_unwrap(row);</div>
+<div class="line"><a name="l10457"></a><span class="lineno">10457</span>             cpl_vector_unwrap(offs);</div>
+<div class="line"><a name="l10458"></a><span class="lineno">10458</span>             cpl_table_delete(fittable);</div>
+<div class="line"><a name="l10459"></a><span class="lineno">10459</span>             <span class="keywordflow">for</span> (k = 0; k < ny; k++)</div>
+<div class="line"><a name="l10460"></a><span class="lineno">10460</span>                  cpl_table_set_double(dummy, fname, k, q + m*k);</div>
+<div class="line"><a name="l10461"></a><span class="lineno">10461</span>         }</div>
+<div class="line"><a name="l10462"></a><span class="lineno">10462</span>     }</div>
+<div class="line"><a name="l10463"></a><span class="lineno">10463</span> </div>
+<div class="line"><a name="l10464"></a><span class="lineno">10464</span> </div>
+<div class="line"><a name="l10465"></a><span class="lineno">10465</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l10466"></a><span class="lineno">10466</span> <span class="comment">     * Now each dummy table row consists of a sequence of offsets,</span></div>
+<div class="line"><a name="l10467"></a><span class="lineno">10467</span> <span class="comment">     * one for each wavelength. A table row corresponds to an image row.</span></div>
+<div class="line"><a name="l10468"></a><span class="lineno">10468</span> <span class="comment">     * We must fit a polynomial to each one of these rows, in order to</span></div>
+<div class="line"><a name="l10469"></a><span class="lineno">10469</span> <span class="comment">     * express the offsets as a function of wavelength. The obtained </span></div>
+<div class="line"><a name="l10470"></a><span class="lineno">10470</span> <span class="comment">     * polynomial coefficients are used to correct the IDS coefficients.</span></div>
+<div class="line"><a name="l10471"></a><span class="lineno">10471</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l10472"></a><span class="lineno">10472</span> </div>
+<div class="line"><a name="l10473"></a><span class="lineno">10473</span>     <span class="keywordflow">for</span> (i = 0; i < ny; i++) {</div>
+<div class="line"><a name="l10474"></a><span class="lineno">10474</span> </div>
+<div class="line"><a name="l10475"></a><span class="lineno">10475</span>         <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, clab[0], i))</div>
+<div class="line"><a name="l10476"></a><span class="lineno">10476</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10477"></a><span class="lineno">10477</span> </div>
+<div class="line"><a name="l10478"></a><span class="lineno">10478</span>         npoints = 0;</div>
+<div class="line"><a name="l10479"></a><span class="lineno">10479</span>         <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {</div>
+<div class="line"><a name="l10480"></a><span class="lineno">10480</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);</div>
+<div class="line"><a name="l10481"></a><span class="lineno">10481</span>             <span class="keywordflow">if</span> (cpl_table_is_valid(dummy, name, i))</div>
+<div class="line"><a name="l10482"></a><span class="lineno">10482</span>                 npoints++;</div>
+<div class="line"><a name="l10483"></a><span class="lineno">10483</span>         }</div>
+<div class="line"><a name="l10484"></a><span class="lineno">10484</span> </div>
+<div class="line"><a name="l10485"></a><span class="lineno">10485</span>         <span class="keywordflow">if</span> (npoints == 0)</div>
+<div class="line"><a name="l10486"></a><span class="lineno">10486</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10487"></a><span class="lineno">10487</span> </div>
+<div class="line"><a name="l10488"></a><span class="lineno">10488</span>         uorder = order;</div>
+<div class="line"><a name="l10489"></a><span class="lineno">10489</span>         <span class="keywordflow">if</span> (npoints <= uorder)</div>
+<div class="line"><a name="l10490"></a><span class="lineno">10490</span>             uorder = npoints - 1;</div>
+<div class="line"><a name="l10491"></a><span class="lineno">10491</span> </div>
+<div class="line"><a name="l10492"></a><span class="lineno">10492</span>         <span class="keywordflow">if</span> (uorder > 1) {</div>
+<div class="line"><a name="l10493"></a><span class="lineno">10493</span> </div>
+<div class="line"><a name="l10494"></a><span class="lineno">10494</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10495"></a><span class="lineno">10495</span> <span class="comment">             * Model offsets with polynomial fitting</span></div>
+<div class="line"><a name="l10496"></a><span class="lineno">10496</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10497"></a><span class="lineno">10497</span> </div>
+<div class="line"><a name="l10498"></a><span class="lineno">10498</span>             wave = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l10499"></a><span class="lineno">10499</span>             wdata = cpl_vector_get_data(wave);</div>
+<div class="line"><a name="l10500"></a><span class="lineno">10500</span>             offs = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l10501"></a><span class="lineno">10501</span>             odata = cpl_vector_get_data(offs);</div>
+<div class="line"><a name="l10502"></a><span class="lineno">10502</span> </div>
+<div class="line"><a name="l10503"></a><span class="lineno">10503</span>             npoints = 0;</div>
+<div class="line"><a name="l10504"></a><span class="lineno">10504</span>             <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {</div>
+<div class="line"><a name="l10505"></a><span class="lineno">10505</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);</div>
+<div class="line"><a name="l10506"></a><span class="lineno">10506</span>                 <span class="keywordflow">if</span> (cpl_table_is_valid(dummy, name, i)) {</div>
+<div class="line"><a name="l10507"></a><span class="lineno">10507</span>                     wdata[npoints] = line[j] - refwave;</div>
+<div class="line"><a name="l10508"></a><span class="lineno">10508</span>                     odata[npoints] = cpl_table_get_double(dummy, name, i, NULL);</div>
+<div class="line"><a name="l10509"></a><span class="lineno">10509</span>                     npoints++;</div>
+<div class="line"><a name="l10510"></a><span class="lineno">10510</span>                 }</div>
+<div class="line"><a name="l10511"></a><span class="lineno">10511</span>             }</div>
+<div class="line"><a name="l10512"></a><span class="lineno">10512</span> </div>
+<div class="line"><a name="l10513"></a><span class="lineno">10513</span>             polycorr = cpl_polynomial_fit_1d_create(wave, offs, uorder, &rms);</div>
+<div class="line"><a name="l10514"></a><span class="lineno">10514</span> </div>
+<div class="line"><a name="l10515"></a><span class="lineno">10515</span>             rms = sqrt(rms * (uorder + 1) / npoints);</div>
+<div class="line"><a name="l10516"></a><span class="lineno">10516</span> </div>
+<div class="line"><a name="l10517"></a><span class="lineno">10517</span>             cpl_vector_delete(wave);</div>
+<div class="line"><a name="l10518"></a><span class="lineno">10518</span>             cpl_vector_delete(offs);</div>
+<div class="line"><a name="l10519"></a><span class="lineno">10519</span> </div>
+<div class="line"><a name="l10520"></a><span class="lineno">10520</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10521"></a><span class="lineno">10521</span> <span class="comment">             * Now correct the coefficients of the corresponding IDS</span></div>
+<div class="line"><a name="l10522"></a><span class="lineno">10522</span> <span class="comment">             * polynomials related to this slit:</span></div>
+<div class="line"><a name="l10523"></a><span class="lineno">10523</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10524"></a><span class="lineno">10524</span> </div>
+<div class="line"><a name="l10525"></a><span class="lineno">10525</span>             <span class="keywordflow">for</span> (j = 0; j <= uorder; j++) {</div>
+<div class="line"><a name="l10526"></a><span class="lineno">10526</span>                 data = cpl_table_get_data_double(idscoeff, clab[j]);</div>
+<div class="line"><a name="l10527"></a><span class="lineno">10527</span>                 c = cpl_polynomial_get_coeff(polycorr, &j);</div>
+<div class="line"><a name="l10528"></a><span class="lineno">10528</span>                 data[i] += c;</div>
+<div class="line"><a name="l10529"></a><span class="lineno">10529</span>             }</div>
+<div class="line"><a name="l10530"></a><span class="lineno">10530</span> </div>
+<div class="line"><a name="l10531"></a><span class="lineno">10531</span>             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l10532"></a><span class="lineno">10532</span>             data[i] = sqrt(data[i]*data[i] + rms*rms);</div>
+<div class="line"><a name="l10533"></a><span class="lineno">10533</span> </div>
+<div class="line"><a name="l10534"></a><span class="lineno">10534</span>             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);</div>
+<div class="line"><a name="l10535"></a><span class="lineno">10535</span>             idata[i] = npoints;</div>
+<div class="line"><a name="l10536"></a><span class="lineno">10536</span> </div>
+<div class="line"><a name="l10537"></a><span class="lineno">10537</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10538"></a><span class="lineno">10538</span> <span class="comment">             * If a wavelengths map was provided, correct it to keep</span></div>
+<div class="line"><a name="l10539"></a><span class="lineno">10539</span> <span class="comment">             * into account the alignment to skylines:</span></div>
+<div class="line"><a name="l10540"></a><span class="lineno">10540</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10541"></a><span class="lineno">10541</span> </div>
+<div class="line"><a name="l10542"></a><span class="lineno">10542</span>             <span class="keywordflow">if</span> (calibration) {</div>
+<div class="line"><a name="l10543"></a><span class="lineno">10543</span>                 <span class="keywordflow">for</span> (k = 1; k < nx; k++) {</div>
+<div class="line"><a name="l10544"></a><span class="lineno">10544</span>                     lambda1 = cdata[k - 1 + i*nx];</div>
+<div class="line"><a name="l10545"></a><span class="lineno">10545</span>                     lambda2 = cdata[k + i*nx];</div>
+<div class="line"><a name="l10546"></a><span class="lineno">10546</span>                     <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)</div>
+<div class="line"><a name="l10547"></a><span class="lineno">10547</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10548"></a><span class="lineno">10548</span>                     offset = cpl_polynomial_eval_1d(polycorr,</div>
+<div class="line"><a name="l10549"></a><span class="lineno">10549</span>                                                     lambda1-refwave, NULL);</div>
+<div class="line"><a name="l10550"></a><span class="lineno">10550</span>                     cdata[k - 1 + i*nx] -= offset * (lambda2-lambda1);</div>
+<div class="line"><a name="l10551"></a><span class="lineno">10551</span>                 }</div>
+<div class="line"><a name="l10552"></a><span class="lineno">10552</span>             }</div>
+<div class="line"><a name="l10553"></a><span class="lineno">10553</span> </div>
+<div class="line"><a name="l10554"></a><span class="lineno">10554</span>             cpl_polynomial_delete(polycorr);</div>
+<div class="line"><a name="l10555"></a><span class="lineno">10555</span> </div>
+<div class="line"><a name="l10556"></a><span class="lineno">10556</span>         }</div>
+<div class="line"><a name="l10557"></a><span class="lineno">10557</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (uorder == 1) {</div>
+<div class="line"><a name="l10558"></a><span class="lineno">10558</span> </div>
+<div class="line"><a name="l10559"></a><span class="lineno">10559</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10560"></a><span class="lineno">10560</span> <span class="comment">             * Model offsets with robust linear fitting</span></div>
+<div class="line"><a name="l10561"></a><span class="lineno">10561</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10562"></a><span class="lineno">10562</span> </div>
+<div class="line"><a name="l10563"></a><span class="lineno">10563</span>             cpl_bivector *list;</div>
+<div class="line"><a name="l10564"></a><span class="lineno">10564</span>             <span class="keywordtype">double</span>        q, m;</div>
+<div class="line"><a name="l10565"></a><span class="lineno">10565</span> </div>
+<div class="line"><a name="l10566"></a><span class="lineno">10566</span>             wave = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l10567"></a><span class="lineno">10567</span>             wdata = cpl_vector_get_data(wave);</div>
+<div class="line"><a name="l10568"></a><span class="lineno">10568</span>             offs = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l10569"></a><span class="lineno">10569</span>             odata = cpl_vector_get_data(offs);</div>
+<div class="line"><a name="l10570"></a><span class="lineno">10570</span> </div>
+<div class="line"><a name="l10571"></a><span class="lineno">10571</span>             npoints = 0;</div>
+<div class="line"><a name="l10572"></a><span class="lineno">10572</span>             <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {</div>
+<div class="line"><a name="l10573"></a><span class="lineno">10573</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);</div>
+<div class="line"><a name="l10574"></a><span class="lineno">10574</span>                 <span class="keywordflow">if</span> (cpl_table_is_valid(dummy, name, i)) {</div>
+<div class="line"><a name="l10575"></a><span class="lineno">10575</span>                     wdata[npoints] = line[j] - refwave;</div>
+<div class="line"><a name="l10576"></a><span class="lineno">10576</span>                     odata[npoints] = cpl_table_get_double(dummy, name, i, NULL);</div>
+<div class="line"><a name="l10577"></a><span class="lineno">10577</span>                     npoints++;</div>
+<div class="line"><a name="l10578"></a><span class="lineno">10578</span>                 }</div>
+<div class="line"><a name="l10579"></a><span class="lineno">10579</span>             }</div>
+<div class="line"><a name="l10580"></a><span class="lineno">10580</span> </div>
+<div class="line"><a name="l10581"></a><span class="lineno">10581</span>             list = cpl_bivector_wrap_vectors(wave, offs);</div>
+<div class="line"><a name="l10582"></a><span class="lineno">10582</span>             robustLinearFit(list, &q, &m, &rms);</div>
+<div class="line"><a name="l10583"></a><span class="lineno">10583</span> </div>
+<div class="line"><a name="l10584"></a><span class="lineno">10584</span>             rms = sqrt(rms * (uorder + 1) / npoints);</div>
+<div class="line"><a name="l10585"></a><span class="lineno">10585</span> </div>
+<div class="line"><a name="l10586"></a><span class="lineno">10586</span>             cpl_bivector_unwrap_vectors(list);</div>
+<div class="line"><a name="l10587"></a><span class="lineno">10587</span>             cpl_vector_delete(wave);</div>
+<div class="line"><a name="l10588"></a><span class="lineno">10588</span>             cpl_vector_delete(offs);</div>
+<div class="line"><a name="l10589"></a><span class="lineno">10589</span> </div>
+<div class="line"><a name="l10590"></a><span class="lineno">10590</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10591"></a><span class="lineno">10591</span> <span class="comment">             * Now correct the coefficients of the corresponding IDS</span></div>
+<div class="line"><a name="l10592"></a><span class="lineno">10592</span> <span class="comment">             * polynomials related to this row:</span></div>
+<div class="line"><a name="l10593"></a><span class="lineno">10593</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10594"></a><span class="lineno">10594</span> </div>
+<div class="line"><a name="l10595"></a><span class="lineno">10595</span>             <span class="keywordflow">for</span> (j = 0; j <= uorder; j++) {</div>
+<div class="line"><a name="l10596"></a><span class="lineno">10596</span>                 data = cpl_table_get_data_double(idscoeff, clab[j]);</div>
+<div class="line"><a name="l10597"></a><span class="lineno">10597</span>                 <span class="keywordflow">if</span> (j)</div>
+<div class="line"><a name="l10598"></a><span class="lineno">10598</span>                     c = m;</div>
+<div class="line"><a name="l10599"></a><span class="lineno">10599</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l10600"></a><span class="lineno">10600</span>                     c = q;</div>
+<div class="line"><a name="l10601"></a><span class="lineno">10601</span>                 data[i] += c;</div>
+<div class="line"><a name="l10602"></a><span class="lineno">10602</span>             }</div>
+<div class="line"><a name="l10603"></a><span class="lineno">10603</span> </div>
+<div class="line"><a name="l10604"></a><span class="lineno">10604</span>             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l10605"></a><span class="lineno">10605</span>             data[i] = sqrt(data[i]*data[i] + rms*rms);</div>
+<div class="line"><a name="l10606"></a><span class="lineno">10606</span> </div>
+<div class="line"><a name="l10607"></a><span class="lineno">10607</span>             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);</div>
+<div class="line"><a name="l10608"></a><span class="lineno">10608</span>             idata[i] = npoints;</div>
+<div class="line"><a name="l10609"></a><span class="lineno">10609</span> </div>
+<div class="line"><a name="l10610"></a><span class="lineno">10610</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10611"></a><span class="lineno">10611</span> <span class="comment">             * If a wavelengths map was provided, correct it to keep</span></div>
+<div class="line"><a name="l10612"></a><span class="lineno">10612</span> <span class="comment">             * into account the alignment to skylines:</span></div>
+<div class="line"><a name="l10613"></a><span class="lineno">10613</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10614"></a><span class="lineno">10614</span> </div>
+<div class="line"><a name="l10615"></a><span class="lineno">10615</span>             <span class="keywordflow">if</span> (calibration) {</div>
+<div class="line"><a name="l10616"></a><span class="lineno">10616</span>                 <span class="keywordflow">for</span> (k = 1; k < nx; k++) {</div>
+<div class="line"><a name="l10617"></a><span class="lineno">10617</span>                     lambda1 = cdata[k - 1 + i*nx];</div>
+<div class="line"><a name="l10618"></a><span class="lineno">10618</span>                     lambda2 = cdata[k + i*nx];</div>
+<div class="line"><a name="l10619"></a><span class="lineno">10619</span>                     <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)</div>
+<div class="line"><a name="l10620"></a><span class="lineno">10620</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10621"></a><span class="lineno">10621</span>                     offset = q + m*(lambda1-refwave);</div>
+<div class="line"><a name="l10622"></a><span class="lineno">10622</span>                     cdata[k - 1 + i*nx] -= offset * (lambda2-lambda1);</div>
+<div class="line"><a name="l10623"></a><span class="lineno">10623</span>                 }</div>
+<div class="line"><a name="l10624"></a><span class="lineno">10624</span>             }</div>
+<div class="line"><a name="l10625"></a><span class="lineno">10625</span>         }</div>
+<div class="line"><a name="l10626"></a><span class="lineno">10626</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l10627"></a><span class="lineno">10627</span> </div>
+<div class="line"><a name="l10628"></a><span class="lineno">10628</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10629"></a><span class="lineno">10629</span> <span class="comment">             * Just compute median offset</span></div>
+<div class="line"><a name="l10630"></a><span class="lineno">10630</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10631"></a><span class="lineno">10631</span> </div>
+<div class="line"><a name="l10632"></a><span class="lineno">10632</span>             offs = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l10633"></a><span class="lineno">10633</span>             odata = cpl_vector_get_data(offs);</div>
+<div class="line"><a name="l10634"></a><span class="lineno">10634</span> </div>
+<div class="line"><a name="l10635"></a><span class="lineno">10635</span>             npoints = 0;</div>
+<div class="line"><a name="l10636"></a><span class="lineno">10636</span>             <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {</div>
+<div class="line"><a name="l10637"></a><span class="lineno">10637</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"fit_%d"</span>, (<span class="keywordtype">int</span>)line[j]);</div>
+<div class="line"><a name="l10638"></a><span class="lineno">10638</span>                 <span class="keywordflow">if</span> (cpl_table_is_valid(dummy, name, i)) {</div>
+<div class="line"><a name="l10639"></a><span class="lineno">10639</span>                     odata[npoints] = cpl_table_get_double(dummy, name, i, NULL);</div>
+<div class="line"><a name="l10640"></a><span class="lineno">10640</span>                     npoints++;</div>
+<div class="line"><a name="l10641"></a><span class="lineno">10641</span>                 }</div>
+<div class="line"><a name="l10642"></a><span class="lineno">10642</span>             }</div>
+<div class="line"><a name="l10643"></a><span class="lineno">10643</span> </div>
+<div class="line"><a name="l10644"></a><span class="lineno">10644</span>             offset = cpl_vector_get_median_const(offs);</div>
+<div class="line"><a name="l10645"></a><span class="lineno">10645</span> </div>
+<div class="line"><a name="l10646"></a><span class="lineno">10646</span>             <span class="keywordflow">if</span> (npoints > 1) {</div>
+<div class="line"><a name="l10647"></a><span class="lineno">10647</span>                 rms = cpl_vector_get_stdev(offs);</div>
+<div class="line"><a name="l10648"></a><span class="lineno">10648</span>             }</div>
+<div class="line"><a name="l10649"></a><span class="lineno">10649</span>             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (npoints == 1) {</div>
+<div class="line"><a name="l10650"></a><span class="lineno">10650</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"off_%d"</span>, (<span class="keywordtype">int</span>)line[0]);</div>
+<div class="line"><a name="l10651"></a><span class="lineno">10651</span>                 <span class="keywordflow">if</span> (cpl_table_has_valid(dummy, name)) {</div>
+<div class="line"><a name="l10652"></a><span class="lineno">10652</span>                     rms = cpl_table_get_column_stdev(dummy, name);</div>
+<div class="line"><a name="l10653"></a><span class="lineno">10653</span>                     rms /= sqrt(ny - cpl_table_count_invalid(dummy, name));</div>
+<div class="line"><a name="l10654"></a><span class="lineno">10654</span>                 }</div>
+<div class="line"><a name="l10655"></a><span class="lineno">10655</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l10656"></a><span class="lineno">10656</span>                     rms = 0.0;</div>
+<div class="line"><a name="l10657"></a><span class="lineno">10657</span>                 }</div>
+<div class="line"><a name="l10658"></a><span class="lineno">10658</span>             }</div>
+<div class="line"><a name="l10659"></a><span class="lineno">10659</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l10660"></a><span class="lineno">10660</span>                 rms = 0.0;</div>
+<div class="line"><a name="l10661"></a><span class="lineno">10661</span>             }</div>
+<div class="line"><a name="l10662"></a><span class="lineno">10662</span> </div>
+<div class="line"><a name="l10663"></a><span class="lineno">10663</span>             rms /= sqrt(npoints);</div>
+<div class="line"><a name="l10664"></a><span class="lineno">10664</span> </div>
+<div class="line"><a name="l10665"></a><span class="lineno">10665</span>             cpl_vector_delete(offs);</div>
+<div class="line"><a name="l10666"></a><span class="lineno">10666</span> </div>
+<div class="line"><a name="l10667"></a><span class="lineno">10667</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10668"></a><span class="lineno">10668</span> <span class="comment">             * Now correct the constant term of the corresponding IDS</span></div>
+<div class="line"><a name="l10669"></a><span class="lineno">10669</span> <span class="comment">             * polynomials related to this slit:</span></div>
+<div class="line"><a name="l10670"></a><span class="lineno">10670</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10671"></a><span class="lineno">10671</span> </div>
+<div class="line"><a name="l10672"></a><span class="lineno">10672</span>             data = cpl_table_get_data_double(idscoeff, clab[0]);</div>
+<div class="line"><a name="l10673"></a><span class="lineno">10673</span>             data[i] += offset;</div>
+<div class="line"><a name="l10674"></a><span class="lineno">10674</span> </div>
+<div class="line"><a name="l10675"></a><span class="lineno">10675</span>             data = cpl_table_get_data_double(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l10676"></a><span class="lineno">10676</span>             data[i] = sqrt(data[i]*data[i] + rms*rms);</div>
+<div class="line"><a name="l10677"></a><span class="lineno">10677</span> </div>
+<div class="line"><a name="l10678"></a><span class="lineno">10678</span>             idata = cpl_table_get_data_int(idscoeff, <span class="stringliteral">"nlines"</span>);</div>
+<div class="line"><a name="l10679"></a><span class="lineno">10679</span>             idata[i] = npoints;</div>
+<div class="line"><a name="l10680"></a><span class="lineno">10680</span> </div>
+<div class="line"><a name="l10681"></a><span class="lineno">10681</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l10682"></a><span class="lineno">10682</span> <span class="comment">             * If a wavelengths map was provided, correct it to keep</span></div>
+<div class="line"><a name="l10683"></a><span class="lineno">10683</span> <span class="comment">             * into account the alignment to skylines. Note that</span></div>
+<div class="line"><a name="l10684"></a><span class="lineno">10684</span> <span class="comment">             * the offset must be converted from pixels to wavelengths.</span></div>
+<div class="line"><a name="l10685"></a><span class="lineno">10685</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l10686"></a><span class="lineno">10686</span> </div>
+<div class="line"><a name="l10687"></a><span class="lineno">10687</span>             <span class="keywordflow">if</span> (calibration) {</div>
+<div class="line"><a name="l10688"></a><span class="lineno">10688</span>                 <span class="keywordflow">for</span> (k = 1; k < nx; k++) {</div>
+<div class="line"><a name="l10689"></a><span class="lineno">10689</span>                     lambda1 = cdata[k - 1 + i*nx];</div>
+<div class="line"><a name="l10690"></a><span class="lineno">10690</span>                     lambda2 = cdata[k + i*nx];</div>
+<div class="line"><a name="l10691"></a><span class="lineno">10691</span>                     <span class="keywordflow">if</span> (lambda1 < 1.0 || lambda2 < 1.0)</div>
+<div class="line"><a name="l10692"></a><span class="lineno">10692</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10693"></a><span class="lineno">10693</span>                     cdata[k - 1 + i*nx] -= offset * (lambda2-lambda1);</div>
+<div class="line"><a name="l10694"></a><span class="lineno">10694</span>                 }</div>
+<div class="line"><a name="l10695"></a><span class="lineno">10695</span>             }</div>
+<div class="line"><a name="l10696"></a><span class="lineno">10696</span>         }</div>
+<div class="line"><a name="l10697"></a><span class="lineno">10697</span>     }</div>
+<div class="line"><a name="l10698"></a><span class="lineno">10698</span> </div>
+<div class="line"><a name="l10699"></a><span class="lineno">10699</span>     missing = 1;</div>
+<div class="line"><a name="l10700"></a><span class="lineno">10700</span>     <span class="keywordflow">for</span> (j = 0; j < nlines; j++) {</div>
+<div class="line"><a name="l10701"></a><span class="lineno">10701</span>         snprintf(name, MAX_COLNAME, <span class="stringliteral">"off_%d"</span>, (<span class="keywordtype">int</span>)line[j]);</div>
+<div class="line"><a name="l10702"></a><span class="lineno">10702</span>         <span class="keywordflow">if</span> (cpl_table_has_valid(dummy, name)) {</div>
+<div class="line"><a name="l10703"></a><span class="lineno">10703</span>             missing = 0;</div>
+<div class="line"><a name="l10704"></a><span class="lineno">10704</span>             offset = cpl_table_get_column_median(dummy, name);</div>
+<div class="line"><a name="l10705"></a><span class="lineno">10705</span>             cpl_msg_info(func, <span class="stringliteral">"Median offset for %.3f: %.3f pixel"</span>,</div>
+<div class="line"><a name="l10706"></a><span class="lineno">10706</span>                          line[j], offset);</div>
+<div class="line"><a name="l10707"></a><span class="lineno">10707</span>         }</div>
+<div class="line"><a name="l10708"></a><span class="lineno">10708</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l10709"></a><span class="lineno">10709</span>             cpl_msg_info(func, </div>
+<div class="line"><a name="l10710"></a><span class="lineno">10710</span>                          <span class="stringliteral">"Median offset for %.2f: not available"</span>, line[j]);</div>
+<div class="line"><a name="l10711"></a><span class="lineno">10711</span>         }</div>
+<div class="line"><a name="l10712"></a><span class="lineno">10712</span>     }</div>
+<div class="line"><a name="l10713"></a><span class="lineno">10713</span> </div>
+<div class="line"><a name="l10714"></a><span class="lineno">10714</span>     cpl_table_delete(offsets);</div>
+<div class="line"><a name="l10715"></a><span class="lineno">10715</span> </div>
+<div class="line"><a name="l10716"></a><span class="lineno">10716</span>     <span class="keywordflow">if</span> (missing) {</div>
+<div class="line"><a name="l10717"></a><span class="lineno">10717</span>         cpl_table_delete(dummy);</div>
+<div class="line"><a name="l10718"></a><span class="lineno">10718</span>         dummy = NULL;</div>
+<div class="line"><a name="l10719"></a><span class="lineno">10719</span>     }</div>
+<div class="line"><a name="l10720"></a><span class="lineno">10720</span> </div>
+<div class="line"><a name="l10721"></a><span class="lineno">10721</span>     <span class="keywordflow">return</span> dummy;</div>
+<div class="line"><a name="l10722"></a><span class="lineno">10722</span> </div>
+<div class="line"><a name="l10723"></a><span class="lineno">10723</span> }</div>
+<div class="line"><a name="l10724"></a><span class="lineno">10724</span> </div>
+<div class="line"><a name="l10725"></a><span class="lineno">10725</span> </div>
+<div class="line"><a name="l10753"></a><span class="lineno"><a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2">10753</a></span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(cpl_image *rectified, cpl_vector *lines, </div>
+<div class="line"><a name="l10754"></a><span class="lineno">10754</span>                            <span class="keywordtype">double</span> wavestart, <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> radius,</div>
+<div class="line"><a name="l10755"></a><span class="lineno">10755</span>                            <span class="keywordtype">int</span> highres)</div>
+<div class="line"><a name="l10756"></a><span class="lineno">10756</span> {</div>
+<div class="line"><a name="l10757"></a><span class="lineno">10757</span> </div>
+<div class="line"><a name="l10758"></a><span class="lineno">10758</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_distortions_rms"</span>;</div>
+<div class="line"><a name="l10759"></a><span class="lineno">10759</span> </div>
+<div class="line"><a name="l10760"></a><span class="lineno">10760</span>     <span class="keywordtype">int</span> xlen;</div>
+<div class="line"><a name="l10761"></a><span class="lineno">10761</span>     <span class="keywordtype">int</span> ylen;</div>
+<div class="line"><a name="l10762"></a><span class="lineno">10762</span>     <span class="keywordtype">int</span> numLines;</div>
+<div class="line"><a name="l10763"></a><span class="lineno">10763</span>     <span class="keywordtype">int</span> cpix, npix, nzero;</div>
+<div class="line"><a name="l10764"></a><span class="lineno">10764</span>     <span class="keywordtype">int</span> sp, ep;</div>
+<div class="line"><a name="l10765"></a><span class="lineno">10765</span>     <span class="keywordtype">int</span> i, j, k;</div>
+<div class="line"><a name="l10766"></a><span class="lineno">10766</span>     <span class="keywordtype">int</span> npeaks, allPeaks;</div>
+<div class="line"><a name="l10767"></a><span class="lineno">10767</span> </div>
+<div class="line"><a name="l10768"></a><span class="lineno">10768</span>     <span class="keywordtype">float</span> *profile;</div>
+<div class="line"><a name="l10769"></a><span class="lineno">10769</span>     <span class="keywordtype">float</span>  peak, expectPeak, offset;</div>
+<div class="line"><a name="l10770"></a><span class="lineno">10770</span>     <span class="keywordtype">double</span> lambda;</div>
+<div class="line"><a name="l10771"></a><span class="lineno">10771</span> </div>
+<div class="line"><a name="l10772"></a><span class="lineno">10772</span>     <span class="keywordtype">double</span>  average;</div>
+<div class="line"><a name="l10773"></a><span class="lineno">10773</span>     <span class="keywordtype">double</span>  rms, oneRms;</div>
+<div class="line"><a name="l10774"></a><span class="lineno">10774</span> </div>
+<div class="line"><a name="l10775"></a><span class="lineno">10775</span>     <span class="keywordtype">float</span>  *sdata;</div>
+<div class="line"><a name="l10776"></a><span class="lineno">10776</span>     <span class="keywordtype">double</span> *wdata;</div>
+<div class="line"><a name="l10777"></a><span class="lineno">10777</span> </div>
+<div class="line"><a name="l10778"></a><span class="lineno">10778</span>   </div>
+<div class="line"><a name="l10779"></a><span class="lineno">10779</span>     xlen = cpl_image_get_size_x(rectified);</div>
+<div class="line"><a name="l10780"></a><span class="lineno">10780</span>     ylen = cpl_image_get_size_y(rectified);</div>
+<div class="line"><a name="l10781"></a><span class="lineno">10781</span>     sdata = cpl_image_get_data(rectified);</div>
+<div class="line"><a name="l10782"></a><span class="lineno">10782</span> </div>
+<div class="line"><a name="l10783"></a><span class="lineno">10783</span>     <span class="keywordflow">if</span> (lines) {</div>
+<div class="line"><a name="l10784"></a><span class="lineno">10784</span>         wdata = cpl_vector_get_data(lines);</div>
+<div class="line"><a name="l10785"></a><span class="lineno">10785</span>         numLines = cpl_vector_get_size(lines);</div>
+<div class="line"><a name="l10786"></a><span class="lineno">10786</span>     }</div>
+<div class="line"><a name="l10787"></a><span class="lineno">10787</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l10788"></a><span class="lineno">10788</span>         cpl_msg_warning(func, <span class="stringliteral">"A catalog of sky lines wavelengths was not "</span></div>
+<div class="line"><a name="l10789"></a><span class="lineno">10789</span>                         <span class="stringliteral">"given: using internal list of reference sky lines"</span>);</div>
+<div class="line"><a name="l10790"></a><span class="lineno">10790</span>         <span class="keywordflow">if</span> (highres) {</div>
+<div class="line"><a name="l10791"></a><span class="lineno">10791</span>            wdata = default_lines_hi;</div>
+<div class="line"><a name="l10792"></a><span class="lineno">10792</span>            numLines = <span class="keyword">sizeof</span>(default_lines_hi) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l10793"></a><span class="lineno">10793</span>         }</div>
+<div class="line"><a name="l10794"></a><span class="lineno">10794</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l10795"></a><span class="lineno">10795</span>            wdata = default_lines_lo;</div>
+<div class="line"><a name="l10796"></a><span class="lineno">10796</span>            numLines = <span class="keyword">sizeof</span>(default_lines_lo) / <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l10797"></a><span class="lineno">10797</span>         }</div>
+<div class="line"><a name="l10798"></a><span class="lineno">10798</span>     }</div>
+<div class="line"><a name="l10799"></a><span class="lineno">10799</span> </div>
+<div class="line"><a name="l10800"></a><span class="lineno">10800</span>     npix = 2 * radius + 1;</div>
+<div class="line"><a name="l10801"></a><span class="lineno">10801</span>     profile = cpl_calloc(npix, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));</div>
+<div class="line"><a name="l10802"></a><span class="lineno">10802</span> </div>
+<div class="line"><a name="l10803"></a><span class="lineno">10803</span>     rms = 0.0;</div>
+<div class="line"><a name="l10804"></a><span class="lineno">10804</span>     allPeaks = 0;</div>
+<div class="line"><a name="l10805"></a><span class="lineno">10805</span> </div>
+<div class="line"><a name="l10806"></a><span class="lineno">10806</span>     <span class="keywordflow">for</span> (i = 0; i < numLines; i++) {</div>
+<div class="line"><a name="l10807"></a><span class="lineno">10807</span> </div>
+<div class="line"><a name="l10808"></a><span class="lineno">10808</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l10809"></a><span class="lineno">10809</span> <span class="comment">         *  Expected peak and closest pixel to specified wavelength.</span></div>
+<div class="line"><a name="l10810"></a><span class="lineno">10810</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l10811"></a><span class="lineno">10811</span> </div>
+<div class="line"><a name="l10812"></a><span class="lineno">10812</span>         lambda = wdata[i];</div>
+<div class="line"><a name="l10813"></a><span class="lineno">10813</span>         expectPeak = (lambda - wavestart) / dispersion;</div>
+<div class="line"><a name="l10814"></a><span class="lineno">10814</span>         cpix = floor(expectPeak + 0.5);</div>
+<div class="line"><a name="l10815"></a><span class="lineno">10815</span> </div>
+<div class="line"><a name="l10816"></a><span class="lineno">10816</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l10817"></a><span class="lineno">10817</span> <span class="comment">         *  Search interval for peak. Abort if too close to image border.</span></div>
+<div class="line"><a name="l10818"></a><span class="lineno">10818</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l10819"></a><span class="lineno">10819</span> </div>
+<div class="line"><a name="l10820"></a><span class="lineno">10820</span>         sp = cpix - radius;</div>
+<div class="line"><a name="l10821"></a><span class="lineno">10821</span>         ep = cpix + radius;</div>
+<div class="line"><a name="l10822"></a><span class="lineno">10822</span> </div>
+<div class="line"><a name="l10823"></a><span class="lineno">10823</span>         <span class="keywordflow">if</span> (sp < 0 || ep > xlen)</div>
+<div class="line"><a name="l10824"></a><span class="lineno">10824</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10825"></a><span class="lineno">10825</span> </div>
+<div class="line"><a name="l10826"></a><span class="lineno">10826</span>         average = 0.0;</div>
+<div class="line"><a name="l10827"></a><span class="lineno">10827</span>         npeaks = 0;</div>
+<div class="line"><a name="l10828"></a><span class="lineno">10828</span>         oneRms = 0.0;</div>
+<div class="line"><a name="l10829"></a><span class="lineno">10829</span> </div>
+<div class="line"><a name="l10830"></a><span class="lineno">10830</span>         <span class="keywordflow">for</span> (j = 0; j < ylen; j++) {    <span class="comment">/*  For each row of each slit  */</span></div>
+<div class="line"><a name="l10831"></a><span class="lineno">10831</span>             nzero = 0;</div>
+<div class="line"><a name="l10832"></a><span class="lineno">10832</span>             <span class="keywordflow">for</span> (k = 0; k < npix; k++) {</div>
+<div class="line"><a name="l10833"></a><span class="lineno">10833</span>                 profile[k] = sdata[sp + k + j * xlen];</div>
+<div class="line"><a name="l10834"></a><span class="lineno">10834</span>                 <span class="keywordflow">if</span> (fabs(profile[k]) < 0.0001)</div>
+<div class="line"><a name="l10835"></a><span class="lineno">10835</span>                     nzero++; <span class="comment">/* Count number of 0 pixels (spectrum truncated) */</span></div>
+<div class="line"><a name="l10836"></a><span class="lineno">10836</span>             }</div>
+<div class="line"><a name="l10837"></a><span class="lineno">10837</span>             <span class="keywordflow">if</span> (nzero > 0)</div>
+<div class="line"><a name="l10838"></a><span class="lineno">10838</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10839"></a><span class="lineno">10839</span> </div>
+<div class="line"><a name="l10840"></a><span class="lineno">10840</span>             <span class="keywordflow">if</span> (peakPosition(profile, npix, &peak, 1) == 0) {</div>
+<div class="line"><a name="l10841"></a><span class="lineno">10841</span>                 offset = (sp + peak) - expectPeak;</div>
+<div class="line"><a name="l10842"></a><span class="lineno">10842</span>                 average += offset;</div>
+<div class="line"><a name="l10843"></a><span class="lineno">10843</span>                 rms += fabs(offset);</div>
+<div class="line"><a name="l10844"></a><span class="lineno">10844</span>                 oneRms += fabs(offset);</div>
+<div class="line"><a name="l10845"></a><span class="lineno">10845</span>                 npeaks++;</div>
+<div class="line"><a name="l10846"></a><span class="lineno">10846</span>                 allPeaks++;</div>
+<div class="line"><a name="l10847"></a><span class="lineno">10847</span>             }</div>
+<div class="line"><a name="l10848"></a><span class="lineno">10848</span>         }</div>
+<div class="line"><a name="l10849"></a><span class="lineno">10849</span> </div>
+<div class="line"><a name="l10850"></a><span class="lineno">10850</span>         <span class="keywordflow">if</span> (npeaks)</div>
+<div class="line"><a name="l10851"></a><span class="lineno">10851</span>             cpl_msg_info(func, <span class="stringliteral">"RMS for %.2f: %.3f pixel (%d points)"</span>,</div>
+<div class="line"><a name="l10852"></a><span class="lineno">10852</span>                          lambda, oneRms / npeaks * 1.25, npeaks);</div>
+<div class="line"><a name="l10853"></a><span class="lineno">10853</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l10854"></a><span class="lineno">10854</span>             cpl_msg_info(func, <span class="stringliteral">"RMS for %.2f: line not available"</span>, lambda);</div>
+<div class="line"><a name="l10855"></a><span class="lineno">10855</span>     }</div>
+<div class="line"><a name="l10856"></a><span class="lineno">10856</span> </div>
+<div class="line"><a name="l10857"></a><span class="lineno">10857</span>     cpl_free(profile);</div>
+<div class="line"><a name="l10858"></a><span class="lineno">10858</span> </div>
+<div class="line"><a name="l10859"></a><span class="lineno">10859</span>     <span class="keywordflow">if</span> (allPeaks < 10)</div>
+<div class="line"><a name="l10860"></a><span class="lineno">10860</span>         <span class="keywordflow">return</span> 0.0;</div>
+<div class="line"><a name="l10861"></a><span class="lineno">10861</span> </div>
+<div class="line"><a name="l10862"></a><span class="lineno">10862</span>     rms /= allPeaks;</div>
+<div class="line"><a name="l10863"></a><span class="lineno">10863</span>     rms *= 1.25;       <span class="comment">/* Factor to convert average deviation to sigma */</span></div>
+<div class="line"><a name="l10864"></a><span class="lineno">10864</span> </div>
+<div class="line"><a name="l10865"></a><span class="lineno">10865</span>     <span class="keywordflow">return</span> rms;</div>
+<div class="line"><a name="l10866"></a><span class="lineno">10866</span> </div>
+<div class="line"><a name="l10867"></a><span class="lineno">10867</span> }</div>
+<div class="line"><a name="l10868"></a><span class="lineno">10868</span> </div>
+<div class="line"><a name="l10869"></a><span class="lineno">10869</span> </div>
+<div class="line"><a name="l10890"></a><span class="lineno"><a class="code" href="group__moses.html#ga6187454ef3812203ba2d50d1e2d01326">10890</a></span> cpl_image *<a class="code" href="group__moses.html#ga6187454ef3812203ba2d50d1e2d01326" title="Create a pixel map from an IDS coefficients table.">mos_map_pixel</a>(cpl_table *idscoeff, <span class="keywordtype">double</span> reference,</div>
+<div class="line"><a name="l10891"></a><span class="lineno">10891</span>                          <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> trend)</div>
+<div class="line"><a name="l10892"></a><span class="lineno">10892</span> {</div>
+<div class="line"><a name="l10893"></a><span class="lineno">10893</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_map_pixel"</span>;</div>
+<div class="line"><a name="l10894"></a><span class="lineno">10894</span> </div>
+<div class="line"><a name="l10895"></a><span class="lineno">10895</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l10896"></a><span class="lineno">10896</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l10897"></a><span class="lineno">10897</span> </div>
+<div class="line"><a name="l10898"></a><span class="lineno">10898</span>     cpl_polynomial *ids;</div>
+<div class="line"><a name="l10899"></a><span class="lineno">10899</span>     cpl_image      *map;</div>
+<div class="line"><a name="l10900"></a><span class="lineno">10900</span>     <span class="keywordtype">float</span>          *mdata;</div>
+<div class="line"><a name="l10901"></a><span class="lineno">10901</span>     <span class="keywordtype">double</span>          lambda;</div>
+<div class="line"><a name="l10902"></a><span class="lineno">10902</span>     <span class="keywordtype">double</span>          c;</div>
+<div class="line"><a name="l10903"></a><span class="lineno">10903</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l10904"></a><span class="lineno">10904</span>     <span class="keywordtype">int</span>             xsize, ysize;</div>
+<div class="line"><a name="l10905"></a><span class="lineno">10905</span>     <span class="keywordtype">int</span>             missing;</div>
+<div class="line"><a name="l10906"></a><span class="lineno">10906</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l10907"></a><span class="lineno">10907</span>     cpl_size        k;</div>
+<div class="line"><a name="l10908"></a><span class="lineno">10908</span> </div>
+<div class="line"><a name="l10909"></a><span class="lineno">10909</span> </div>
+<div class="line"><a name="l10910"></a><span class="lineno">10910</span>     <span class="keywordflow">if</span> (idscoeff == NULL) {</div>
+<div class="line"><a name="l10911"></a><span class="lineno">10911</span>         cpl_msg_error(func, <span class="stringliteral">"An IDS coeff table must be given"</span>);</div>
+<div class="line"><a name="l10912"></a><span class="lineno">10912</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l10913"></a><span class="lineno">10913</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l10914"></a><span class="lineno">10914</span>     }</div>
+<div class="line"><a name="l10915"></a><span class="lineno">10915</span> </div>
+<div class="line"><a name="l10916"></a><span class="lineno">10916</span>     xsize = (red - blue) / dispersion;</div>
+<div class="line"><a name="l10917"></a><span class="lineno">10917</span>     ysize = cpl_table_get_nrow(idscoeff);</div>
+<div class="line"><a name="l10918"></a><span class="lineno">10918</span>     map = cpl_image_new(xsize, ysize, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l10919"></a><span class="lineno">10919</span>     mdata = cpl_image_get_data(map);</div>
+<div class="line"><a name="l10920"></a><span class="lineno">10920</span> </div>
+<div class="line"><a name="l10921"></a><span class="lineno">10921</span>     order = 0;</div>
+<div class="line"><a name="l10922"></a><span class="lineno">10922</span>     <span class="keywordflow">while</span> (order < 6 && cpl_table_has_column(idscoeff, clab[order]))</div>
+<div class="line"><a name="l10923"></a><span class="lineno">10923</span>         ++order;</div>
+<div class="line"><a name="l10924"></a><span class="lineno">10924</span>     --order;</div>
+<div class="line"><a name="l10925"></a><span class="lineno">10925</span> </div>
+<div class="line"><a name="l10926"></a><span class="lineno">10926</span>     <span class="keywordflow">for</span> (i = 0; i < ysize; i++, mdata += xsize) {</div>
+<div class="line"><a name="l10927"></a><span class="lineno">10927</span> </div>
+<div class="line"><a name="l10928"></a><span class="lineno">10928</span>         missing = 0;</div>
+<div class="line"><a name="l10929"></a><span class="lineno">10929</span>         ids = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l10930"></a><span class="lineno">10930</span>         <span class="keywordflow">for</span> (k = trend; k <= order; k++) {</div>
+<div class="line"><a name="l10931"></a><span class="lineno">10931</span>             c = cpl_table_get_double(idscoeff, clab[k], i, &missing);</div>
+<div class="line"><a name="l10932"></a><span class="lineno">10932</span>             <span class="keywordflow">if</span> (missing) {</div>
+<div class="line"><a name="l10933"></a><span class="lineno">10933</span>                 cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l10934"></a><span class="lineno">10934</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l10935"></a><span class="lineno">10935</span>             }</div>
+<div class="line"><a name="l10936"></a><span class="lineno">10936</span>             cpl_polynomial_set_coeff(ids, &k, c);</div>
+<div class="line"><a name="l10937"></a><span class="lineno">10937</span>         }</div>
+<div class="line"><a name="l10938"></a><span class="lineno">10938</span>         <span class="keywordflow">if</span> (missing)</div>
+<div class="line"><a name="l10939"></a><span class="lineno">10939</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l10940"></a><span class="lineno">10940</span> </div>
+<div class="line"><a name="l10941"></a><span class="lineno">10941</span>         <span class="keywordflow">for</span> (j = 0; j < xsize; j++) {</div>
+<div class="line"><a name="l10942"></a><span class="lineno">10942</span>             lambda = blue + j*dispersion;</div>
+<div class="line"><a name="l10943"></a><span class="lineno">10943</span>             mdata[j] = cpl_polynomial_eval_1d(ids, lambda-reference, NULL);</div>
+<div class="line"><a name="l10944"></a><span class="lineno">10944</span>         }</div>
+<div class="line"><a name="l10945"></a><span class="lineno">10945</span> </div>
+<div class="line"><a name="l10946"></a><span class="lineno">10946</span>         cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l10947"></a><span class="lineno">10947</span>     }</div>
+<div class="line"><a name="l10948"></a><span class="lineno">10948</span> </div>
+<div class="line"><a name="l10949"></a><span class="lineno">10949</span>     <span class="keywordflow">return</span> map;</div>
+<div class="line"><a name="l10950"></a><span class="lineno">10950</span> </div>
+<div class="line"><a name="l10951"></a><span class="lineno">10951</span> }</div>
+<div class="line"><a name="l10952"></a><span class="lineno">10952</span> </div>
+<div class="line"><a name="l10953"></a><span class="lineno">10953</span> </div>
+<div class="line"><a name="l10975"></a><span class="lineno"><a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5">10975</a></span> cpl_image *<a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(cpl_table *idscoeff, <span class="keywordtype">int</span> xsize, <span class="keywordtype">double</span> reference,</div>
+<div class="line"><a name="l10976"></a><span class="lineno">10976</span>                             <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red)</div>
+<div class="line"><a name="l10977"></a><span class="lineno">10977</span> {</div>
+<div class="line"><a name="l10978"></a><span class="lineno">10978</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_map_idscoeff"</span>;</div>
+<div class="line"><a name="l10979"></a><span class="lineno">10979</span> </div>
+<div class="line"><a name="l10980"></a><span class="lineno">10980</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l10981"></a><span class="lineno">10981</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l10982"></a><span class="lineno">10982</span> </div>
+<div class="line"><a name="l10983"></a><span class="lineno">10983</span>     cpl_polynomial *ids;</div>
+<div class="line"><a name="l10984"></a><span class="lineno">10984</span>     cpl_image      *map;</div>
+<div class="line"><a name="l10985"></a><span class="lineno">10985</span>     <span class="keywordtype">float</span>          *mdata;</div>
+<div class="line"><a name="l10986"></a><span class="lineno">10986</span>     <span class="keywordtype">double</span>          lambda;</div>
+<div class="line"><a name="l10987"></a><span class="lineno">10987</span>     <span class="keywordtype">double</span>          c;</div>
+<div class="line"><a name="l10988"></a><span class="lineno">10988</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l10989"></a><span class="lineno">10989</span>     <span class="keywordtype">int</span>             ysize;</div>
+<div class="line"><a name="l10990"></a><span class="lineno">10990</span>     <span class="keywordtype">int</span>             missing;</div>
+<div class="line"><a name="l10991"></a><span class="lineno">10991</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l10992"></a><span class="lineno">10992</span>     cpl_size        k;</div>
+<div class="line"><a name="l10993"></a><span class="lineno">10993</span> </div>
+<div class="line"><a name="l10994"></a><span class="lineno">10994</span> </div>
+<div class="line"><a name="l10995"></a><span class="lineno">10995</span>     <span class="keywordflow">if</span> (idscoeff == NULL) {</div>
+<div class="line"><a name="l10996"></a><span class="lineno">10996</span>         cpl_msg_error(func, <span class="stringliteral">"An IDS coeff table must be given"</span>);</div>
+<div class="line"><a name="l10997"></a><span class="lineno">10997</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l10998"></a><span class="lineno">10998</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l10999"></a><span class="lineno">10999</span>     }</div>
+<div class="line"><a name="l11000"></a><span class="lineno">11000</span> </div>
+<div class="line"><a name="l11001"></a><span class="lineno">11001</span>     <span class="keywordflow">if</span> (xsize < 1) {</div>
+<div class="line"><a name="l11002"></a><span class="lineno">11002</span>         cpl_msg_error(func, <span class="stringliteral">"Invalid image size"</span>);</div>
+<div class="line"><a name="l11003"></a><span class="lineno">11003</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l11004"></a><span class="lineno">11004</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11005"></a><span class="lineno">11005</span>     }</div>
+<div class="line"><a name="l11006"></a><span class="lineno">11006</span> </div>
+<div class="line"><a name="l11007"></a><span class="lineno">11007</span>     <span class="keywordflow">if</span> (xsize < 20 || xsize > 5000) {</div>
+<div class="line"><a name="l11008"></a><span class="lineno">11008</span>         cpl_msg_warning(func, <span class="stringliteral">"Do you really have a detector %d pixels long?"</span>,</div>
+<div class="line"><a name="l11009"></a><span class="lineno">11009</span>                         xsize);</div>
+<div class="line"><a name="l11010"></a><span class="lineno">11010</span>     }</div>
+<div class="line"><a name="l11011"></a><span class="lineno">11011</span> </div>
+<div class="line"><a name="l11012"></a><span class="lineno">11012</span>     ysize = cpl_table_get_nrow(idscoeff);</div>
+<div class="line"><a name="l11013"></a><span class="lineno">11013</span>     map = cpl_image_new(xsize, ysize, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l11014"></a><span class="lineno">11014</span>     mdata = cpl_image_get_data(map);</div>
+<div class="line"><a name="l11015"></a><span class="lineno">11015</span> </div>
+<div class="line"><a name="l11016"></a><span class="lineno">11016</span>     order = 0;</div>
+<div class="line"><a name="l11017"></a><span class="lineno">11017</span>     <span class="keywordflow">while</span> (order < 6 && cpl_table_has_column(idscoeff, clab[order]))</div>
+<div class="line"><a name="l11018"></a><span class="lineno">11018</span>         ++order;</div>
+<div class="line"><a name="l11019"></a><span class="lineno">11019</span>     --order;</div>
+<div class="line"><a name="l11020"></a><span class="lineno">11020</span> </div>
+<div class="line"><a name="l11021"></a><span class="lineno">11021</span>     <span class="keywordflow">for</span> (i = 0; i < ysize; i++, mdata += xsize) {</div>
+<div class="line"><a name="l11022"></a><span class="lineno">11022</span> </div>
+<div class="line"><a name="l11023"></a><span class="lineno">11023</span>         missing = 0;</div>
+<div class="line"><a name="l11024"></a><span class="lineno">11024</span>         ids = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l11025"></a><span class="lineno">11025</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l11026"></a><span class="lineno">11026</span>             c = cpl_table_get_double(idscoeff, clab[k], i, &missing);</div>
+<div class="line"><a name="l11027"></a><span class="lineno">11027</span>             <span class="keywordflow">if</span> (missing) {</div>
+<div class="line"><a name="l11028"></a><span class="lineno">11028</span>                 cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l11029"></a><span class="lineno">11029</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l11030"></a><span class="lineno">11030</span>             }</div>
+<div class="line"><a name="l11031"></a><span class="lineno">11031</span>             cpl_polynomial_set_coeff(ids, &k, c);</div>
+<div class="line"><a name="l11032"></a><span class="lineno">11032</span>         }</div>
+<div class="line"><a name="l11033"></a><span class="lineno">11033</span>         <span class="keywordflow">if</span> (missing)</div>
+<div class="line"><a name="l11034"></a><span class="lineno">11034</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11035"></a><span class="lineno">11035</span> </div>
+<div class="line"><a name="l11036"></a><span class="lineno">11036</span>         <span class="keywordflow">for</span> (j = 0; j < xsize; j++) {</div>
+<div class="line"><a name="l11037"></a><span class="lineno">11037</span>             lambda = <a class="code" href="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a" title="Evaluate the wavelength of a pixel position.">mos_eval_dds</a>(ids, blue, red, reference, j);</div>
+<div class="line"><a name="l11038"></a><span class="lineno">11038</span> </div>
+<div class="line"><a name="l11039"></a><span class="lineno">11039</span>             <span class="keywordflow">if</span> (lambda >= blue && lambda <= red) {</div>
+<div class="line"><a name="l11040"></a><span class="lineno">11040</span>                 mdata[j] = lambda;</div>
+<div class="line"><a name="l11041"></a><span class="lineno">11041</span>             }</div>
+<div class="line"><a name="l11042"></a><span class="lineno">11042</span>         }</div>
+<div class="line"><a name="l11043"></a><span class="lineno">11043</span> </div>
+<div class="line"><a name="l11044"></a><span class="lineno">11044</span>         cpl_polynomial_delete(ids);</div>
+<div class="line"><a name="l11045"></a><span class="lineno">11045</span>     }</div>
+<div class="line"><a name="l11046"></a><span class="lineno">11046</span> </div>
+<div class="line"><a name="l11047"></a><span class="lineno">11047</span>     <span class="keywordflow">return</span> map;</div>
+<div class="line"><a name="l11048"></a><span class="lineno">11048</span> </div>
+<div class="line"><a name="l11049"></a><span class="lineno">11049</span> }</div>
+<div class="line"><a name="l11050"></a><span class="lineno">11050</span> </div>
+<div class="line"><a name="l11051"></a><span class="lineno">11051</span> </div>
+<div class="line"><a name="l11086"></a><span class="lineno"><a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7">11086</a></span> cpl_image *<a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(cpl_image *spatial, cpl_image *calibration,</div>
+<div class="line"><a name="l11087"></a><span class="lineno">11087</span>                                cpl_table *slits, cpl_table *polytraces, </div>
+<div class="line"><a name="l11088"></a><span class="lineno">11088</span>                                <span class="keywordtype">double</span> reference, <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, </div>
+<div class="line"><a name="l11089"></a><span class="lineno">11089</span>                                <span class="keywordtype">double</span> dispersion)</div>
+<div class="line"><a name="l11090"></a><span class="lineno">11090</span> {</div>
+<div class="line"><a name="l11091"></a><span class="lineno">11091</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_map_wavelengths"</span>;</div>
+<div class="line"><a name="l11092"></a><span class="lineno">11092</span> </div>
+<div class="line"><a name="l11093"></a><span class="lineno">11093</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l11094"></a><span class="lineno">11094</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l11095"></a><span class="lineno">11095</span>     cpl_polynomial *polytop;</div>
+<div class="line"><a name="l11096"></a><span class="lineno">11096</span>     cpl_polynomial *polybot;</div>
+<div class="line"><a name="l11097"></a><span class="lineno">11097</span>     cpl_image      *remapped;</div>
+<div class="line"><a name="l11098"></a><span class="lineno">11098</span>     <span class="keywordtype">float</span>          *data;</div>
+<div class="line"><a name="l11099"></a><span class="lineno">11099</span>     <span class="keywordtype">float</span>          *wdata;</div>
+<div class="line"><a name="l11100"></a><span class="lineno">11100</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l11101"></a><span class="lineno">11101</span>     <span class="keywordtype">float</span>          *xdata;</div>
+<div class="line"><a name="l11102"></a><span class="lineno">11102</span>     <span class="keywordtype">double</span>          vtop, vbot, value;</div>
+<div class="line"><a name="l11103"></a><span class="lineno">11103</span>     <span class="keywordtype">double</span>          top, bot;</div>
+<div class="line"><a name="l11104"></a><span class="lineno">11104</span>     <span class="keywordtype">double</span>          coeff;</div>
+<div class="line"><a name="l11105"></a><span class="lineno">11105</span>     <span class="keywordtype">double</span>          ytop, ybot;</div>
+<div class="line"><a name="l11106"></a><span class="lineno">11106</span>     <span class="keywordtype">double</span>          ypos;</div>
+<div class="line"><a name="l11107"></a><span class="lineno">11107</span>     <span class="keywordtype">double</span>          fvalue;</div>
+<div class="line"><a name="l11108"></a><span class="lineno">11108</span>     <span class="keywordtype">int</span>             ivalue;</div>
+<div class="line"><a name="l11109"></a><span class="lineno">11109</span>     <span class="keywordtype">int</span>             yint, ysize, yprev;</div>
+<div class="line"><a name="l11110"></a><span class="lineno">11110</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l11111"></a><span class="lineno">11111</span>     <span class="keywordtype">int</span>             npseudo;</div>
+<div class="line"><a name="l11112"></a><span class="lineno">11112</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l11113"></a><span class="lineno">11113</span>     <span class="keywordtype">int</span>            *position;</div>
+<div class="line"><a name="l11114"></a><span class="lineno">11114</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l11115"></a><span class="lineno">11115</span>     <span class="keywordtype">int</span>             nx, ny;</div>
+<div class="line"><a name="l11116"></a><span class="lineno">11116</span>     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;</div>
+<div class="line"><a name="l11117"></a><span class="lineno">11117</span>     <span class="keywordtype">int</span>             missing_top, missing_bot;</div>
+<div class="line"><a name="l11118"></a><span class="lineno">11118</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l11119"></a><span class="lineno">11119</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l11120"></a><span class="lineno">11120</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l11121"></a><span class="lineno">11121</span>     cpl_size        k;</div>
+<div class="line"><a name="l11122"></a><span class="lineno">11122</span> </div>
+<div class="line"><a name="l11123"></a><span class="lineno">11123</span> </div>
+<div class="line"><a name="l11124"></a><span class="lineno">11124</span>     <span class="keywordflow">if</span> (spatial == NULL || calibration == NULL || </div>
+<div class="line"><a name="l11125"></a><span class="lineno">11125</span>         slits == NULL || polytraces == NULL) {</div>
+<div class="line"><a name="l11126"></a><span class="lineno">11126</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l11127"></a><span class="lineno">11127</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11128"></a><span class="lineno">11128</span>     }</div>
+<div class="line"><a name="l11129"></a><span class="lineno">11129</span> </div>
+<div class="line"><a name="l11130"></a><span class="lineno">11130</span>     <span class="keywordflow">if</span> (dispersion <= 0.0) {</div>
+<div class="line"><a name="l11131"></a><span class="lineno">11131</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l11132"></a><span class="lineno">11132</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11133"></a><span class="lineno">11133</span>     }</div>
+<div class="line"><a name="l11134"></a><span class="lineno">11134</span> </div>
+<div class="line"><a name="l11135"></a><span class="lineno">11135</span>     <span class="keywordflow">if</span> (red - blue < dispersion) {</div>
+<div class="line"><a name="l11136"></a><span class="lineno">11136</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l11137"></a><span class="lineno">11137</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11138"></a><span class="lineno">11138</span>     }</div>
+<div class="line"><a name="l11139"></a><span class="lineno">11139</span> </div>
+<div class="line"><a name="l11140"></a><span class="lineno">11140</span>     nx = cpl_image_get_size_x(spatial);</div>
+<div class="line"><a name="l11141"></a><span class="lineno">11141</span>     ny = cpl_image_get_size_y(spatial);</div>
+<div class="line"><a name="l11142"></a><span class="lineno">11142</span>     ysize = cpl_image_get_size_y(calibration);</div>
+<div class="line"><a name="l11143"></a><span class="lineno">11143</span>     remapped = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l11144"></a><span class="lineno">11144</span>     data  = cpl_image_get_data(remapped);</div>
+<div class="line"><a name="l11145"></a><span class="lineno">11145</span>     sdata = cpl_image_get_data(spatial);</div>
+<div class="line"><a name="l11146"></a><span class="lineno">11146</span>     wdata = cpl_image_get_data(calibration);</div>
+<div class="line"><a name="l11147"></a><span class="lineno">11147</span> </div>
+<div class="line"><a name="l11148"></a><span class="lineno">11148</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l11149"></a><span class="lineno">11149</span>     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l11150"></a><span class="lineno">11150</span>     order    = cpl_table_get_ncol(polytraces) - 2;</div>
+<div class="line"><a name="l11151"></a><span class="lineno">11151</span>     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);</div>
+<div class="line"><a name="l11152"></a><span class="lineno">11152</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l11153"></a><span class="lineno">11153</span> </div>
+<div class="line"><a name="l11154"></a><span class="lineno">11154</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l11155"></a><span class="lineno">11155</span> <span class="comment">     * The spatial resampling is performed for a certain number of </span></div>
+<div class="line"><a name="l11156"></a><span class="lineno">11156</span> <span class="comment">     * pixels above and below the position of the reference wavelength:</span></div>
+<div class="line"><a name="l11157"></a><span class="lineno">11157</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l11158"></a><span class="lineno">11158</span> </div>
+<div class="line"><a name="l11159"></a><span class="lineno">11159</span>     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;</div>
+<div class="line"><a name="l11160"></a><span class="lineno">11160</span>     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;</div>
+<div class="line"><a name="l11161"></a><span class="lineno">11161</span> </div>
+<div class="line"><a name="l11162"></a><span class="lineno">11162</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l11163"></a><span class="lineno">11163</span> </div>
+<div class="line"><a name="l11164"></a><span class="lineno">11164</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l11165"></a><span class="lineno">11165</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11166"></a><span class="lineno">11166</span> </div>
+<div class="line"><a name="l11167"></a><span class="lineno">11167</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l11168"></a><span class="lineno">11168</span> <span class="comment">         * Note that the x coordinate of the reference pixels on the CCD</span></div>
+<div class="line"><a name="l11169"></a><span class="lineno">11169</span> <span class="comment">         * is taken arbitrarily at the top end of each slit. This wouldn't</span></div>
+<div class="line"><a name="l11170"></a><span class="lineno">11170</span> <span class="comment">         * be entirely correct in case of curved slits, or in presence of</span></div>
+<div class="line"><a name="l11171"></a><span class="lineno">11171</span> <span class="comment">         * heavy distortions: in such cases the spatial resampling is</span></div>
+<div class="line"><a name="l11172"></a><span class="lineno">11172</span> <span class="comment">         * really performed across a wide range of wavelengths. But</span></div>
+<div class="line"><a name="l11173"></a><span class="lineno">11173</span> <span class="comment">         * the lag between top and bottom spectral curvature models </span></div>
+<div class="line"><a name="l11174"></a><span class="lineno">11174</span> <span class="comment">         * would introduce even in such cases negligible effects on</span></div>
+<div class="line"><a name="l11175"></a><span class="lineno">11175</span> <span class="comment">         * the spectral spatial resampling.</span></div>
+<div class="line"><a name="l11176"></a><span class="lineno">11176</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l11177"></a><span class="lineno">11177</span> </div>
+<div class="line"><a name="l11178"></a><span class="lineno">11178</span>         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);</div>
+<div class="line"><a name="l11179"></a><span class="lineno">11179</span> </div>
+<div class="line"><a name="l11180"></a><span class="lineno">11180</span>         start_pixel = refpixel - pixel_below;</div>
+<div class="line"><a name="l11181"></a><span class="lineno">11181</span>         <span class="keywordflow">if</span> (start_pixel < 0)</div>
+<div class="line"><a name="l11182"></a><span class="lineno">11182</span>             start_pixel = 0;</div>
+<div class="line"><a name="l11183"></a><span class="lineno">11183</span> </div>
+<div class="line"><a name="l11184"></a><span class="lineno">11184</span>         end_pixel = refpixel + pixel_above;</div>
+<div class="line"><a name="l11185"></a><span class="lineno">11185</span>         <span class="keywordflow">if</span> (end_pixel > nx)</div>
+<div class="line"><a name="l11186"></a><span class="lineno">11186</span>             end_pixel = nx;</div>
+<div class="line"><a name="l11187"></a><span class="lineno">11187</span> </div>
+<div class="line"><a name="l11188"></a><span class="lineno">11188</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l11189"></a><span class="lineno">11189</span> <span class="comment">         * Recover from the table of spectral curvature coefficients</span></div>
+<div class="line"><a name="l11190"></a><span class="lineno">11190</span> <span class="comment">         * the curvature polynomials.</span></div>
+<div class="line"><a name="l11191"></a><span class="lineno">11191</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l11192"></a><span class="lineno">11192</span> </div>
+<div class="line"><a name="l11193"></a><span class="lineno">11193</span>         missing_top = 0;</div>
+<div class="line"><a name="l11194"></a><span class="lineno">11194</span>         polytop = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l11195"></a><span class="lineno">11195</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l11196"></a><span class="lineno">11196</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);</div>
+<div class="line"><a name="l11197"></a><span class="lineno">11197</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l11198"></a><span class="lineno">11198</span>                 cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l11199"></a><span class="lineno">11199</span>                 missing_top = 1;</div>
+<div class="line"><a name="l11200"></a><span class="lineno">11200</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l11201"></a><span class="lineno">11201</span>             }</div>
+<div class="line"><a name="l11202"></a><span class="lineno">11202</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l11203"></a><span class="lineno">11203</span>         }</div>
+<div class="line"><a name="l11204"></a><span class="lineno">11204</span> </div>
+<div class="line"><a name="l11205"></a><span class="lineno">11205</span>         missing_bot = 0;</div>
+<div class="line"><a name="l11206"></a><span class="lineno">11206</span>         polybot = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l11207"></a><span class="lineno">11207</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l11208"></a><span class="lineno">11208</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);</div>
+<div class="line"><a name="l11209"></a><span class="lineno">11209</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l11210"></a><span class="lineno">11210</span>                 cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l11211"></a><span class="lineno">11211</span>                 missing_bot = 1;</div>
+<div class="line"><a name="l11212"></a><span class="lineno">11212</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l11213"></a><span class="lineno">11213</span>             }</div>
+<div class="line"><a name="l11214"></a><span class="lineno">11214</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l11215"></a><span class="lineno">11215</span>         }</div>
+<div class="line"><a name="l11216"></a><span class="lineno">11216</span> </div>
+<div class="line"><a name="l11217"></a><span class="lineno">11217</span>         <span class="keywordflow">if</span> (missing_top && missing_bot) {</div>
+<div class="line"><a name="l11218"></a><span class="lineno">11218</span>             cpl_msg_debug(func, <span class="stringliteral">"Slit %d was not traced: no extraction!"</span>, </div>
+<div class="line"><a name="l11219"></a><span class="lineno">11219</span>                           slit_id[i]);</div>
+<div class="line"><a name="l11220"></a><span class="lineno">11220</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11221"></a><span class="lineno">11221</span>         }</div>
+<div class="line"><a name="l11222"></a><span class="lineno">11222</span> </div>
+<div class="line"><a name="l11223"></a><span class="lineno">11223</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l11224"></a><span class="lineno">11224</span> <span class="comment">         * In case just one of the two edges was not traced, the other</span></div>
+<div class="line"><a name="l11225"></a><span class="lineno">11225</span> <span class="comment">         * edge curvature model is duplicated and shifted to the other</span></div>
+<div class="line"><a name="l11226"></a><span class="lineno">11226</span> <span class="comment">         * end of the slit: better than nothing!</span></div>
+<div class="line"><a name="l11227"></a><span class="lineno">11227</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l11228"></a><span class="lineno">11228</span> </div>
+<div class="line"><a name="l11229"></a><span class="lineno">11229</span>         <span class="keywordflow">if</span> (missing_top) {</div>
+<div class="line"><a name="l11230"></a><span class="lineno">11230</span>             cpl_msg_debug(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l11231"></a><span class="lineno">11231</span>                           <span class="stringliteral">"the spectral curvature of the lower edge "</span></div>
+<div class="line"><a name="l11232"></a><span class="lineno">11232</span>                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l11233"></a><span class="lineno">11233</span>             polytop = cpl_polynomial_duplicate(polybot);</div>
+<div class="line"><a name="l11234"></a><span class="lineno">11234</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l11235"></a><span class="lineno">11235</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l11236"></a><span class="lineno">11236</span>             k = 0;</div>
+<div class="line"><a name="l11237"></a><span class="lineno">11237</span>             coeff = cpl_polynomial_get_coeff(polybot, &k);</div>
+<div class="line"><a name="l11238"></a><span class="lineno">11238</span>             coeff += ytop - ybot;</div>
+<div class="line"><a name="l11239"></a><span class="lineno">11239</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l11240"></a><span class="lineno">11240</span>         }</div>
+<div class="line"><a name="l11241"></a><span class="lineno">11241</span> </div>
+<div class="line"><a name="l11242"></a><span class="lineno">11242</span>         <span class="keywordflow">if</span> (missing_bot) {</div>
+<div class="line"><a name="l11243"></a><span class="lineno">11243</span>             cpl_msg_debug(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l11244"></a><span class="lineno">11244</span>                           <span class="stringliteral">"the spectral curvature of the upper edge "</span></div>
+<div class="line"><a name="l11245"></a><span class="lineno">11245</span>                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l11246"></a><span class="lineno">11246</span>             polybot = cpl_polynomial_duplicate(polytop);</div>
+<div class="line"><a name="l11247"></a><span class="lineno">11247</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l11248"></a><span class="lineno">11248</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l11249"></a><span class="lineno">11249</span>             k = 0;</div>
+<div class="line"><a name="l11250"></a><span class="lineno">11250</span>             coeff = cpl_polynomial_get_coeff(polytop, &k);</div>
+<div class="line"><a name="l11251"></a><span class="lineno">11251</span>             coeff -= ytop - ybot;</div>
+<div class="line"><a name="l11252"></a><span class="lineno">11252</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l11253"></a><span class="lineno">11253</span>         }</div>
+<div class="line"><a name="l11254"></a><span class="lineno">11254</span> </div>
+<div class="line"><a name="l11255"></a><span class="lineno">11255</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l11256"></a><span class="lineno">11256</span> <span class="comment">         * Point to current slit on wavelength calibration image.</span></div>
+<div class="line"><a name="l11257"></a><span class="lineno">11257</span> <span class="comment">         * Note that the npseudo value related to this slit is equal </span></div>
+<div class="line"><a name="l11258"></a><span class="lineno">11258</span> <span class="comment">         * to the number of spatial pseudo-pixels decreased by 1 </span></div>
+<div class="line"><a name="l11259"></a><span class="lineno">11259</span> <span class="comment">         * (compare with function mos_spatial_calibration()).</span></div>
+<div class="line"><a name="l11260"></a><span class="lineno">11260</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l11261"></a><span class="lineno">11261</span> </div>
+<div class="line"><a name="l11262"></a><span class="lineno">11262</span>         xdata = wdata + nx*position[i];</div>
+<div class="line"><a name="l11263"></a><span class="lineno">11263</span>         npseudo = length[i] - 1;</div>
+<div class="line"><a name="l11264"></a><span class="lineno">11264</span> </div>
+<div class="line"><a name="l11265"></a><span class="lineno">11265</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l11266"></a><span class="lineno">11266</span> <span class="comment">         * Write interpolated wavelengths to CCD image</span></div>
+<div class="line"><a name="l11267"></a><span class="lineno">11267</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l11268"></a><span class="lineno">11268</span> </div>
+<div class="line"><a name="l11269"></a><span class="lineno">11269</span>         <span class="keywordflow">for</span> (j = start_pixel; j < end_pixel; j++) {</div>
+<div class="line"><a name="l11270"></a><span class="lineno">11270</span>             top = cpl_polynomial_eval_1d(polytop, j, NULL);</div>
+<div class="line"><a name="l11271"></a><span class="lineno">11271</span>             bot = cpl_polynomial_eval_1d(polybot, j, NULL);</div>
+<div class="line"><a name="l11272"></a><span class="lineno">11272</span>             <span class="keywordflow">for</span> (k = 0; k <= npseudo; k++) {</div>
+<div class="line"><a name="l11273"></a><span class="lineno">11273</span>                 ypos = top - k*(top-bot)/npseudo;</div>
+<div class="line"><a name="l11274"></a><span class="lineno">11274</span>                 yint = ypos;</div>
+<div class="line"><a name="l11275"></a><span class="lineno">11275</span> </div>
+<div class="line"><a name="l11276"></a><span class="lineno">11276</span>                 <span class="comment">/* </span></div>
+<div class="line"><a name="l11277"></a><span class="lineno">11277</span> <span class="comment">                 * The line:</span></div>
+<div class="line"><a name="l11278"></a><span class="lineno">11278</span> <span class="comment">                 *     value = sdata[j + nx*yint];</span></div>
+<div class="line"><a name="l11279"></a><span class="lineno">11279</span> <span class="comment">                 * should be equivalent to:</span></div>
+<div class="line"><a name="l11280"></a><span class="lineno">11280</span> <span class="comment">                 *     value = npseudo*(top-yint)/(top-bot);</span></div>
+<div class="line"><a name="l11281"></a><span class="lineno">11281</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l11282"></a><span class="lineno">11282</span> </div>
+<div class="line"><a name="l11283"></a><span class="lineno">11283</span>                 <span class="keywordflow">if</span> (yint < 0 || yint >= ny-1) {</div>
+<div class="line"><a name="l11284"></a><span class="lineno">11284</span>                     yprev = yint;</div>
+<div class="line"><a name="l11285"></a><span class="lineno">11285</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11286"></a><span class="lineno">11286</span>                 }</div>
+<div class="line"><a name="l11287"></a><span class="lineno">11287</span> </div>
+<div class="line"><a name="l11288"></a><span class="lineno">11288</span>                 value = sdata[j + nx*yint];   <span class="comment">/* Spatial coordinate on CCD */</span></div>
+<div class="line"><a name="l11289"></a><span class="lineno">11289</span>                 ivalue = value;               <span class="comment">/* Nearest spatial pixels:   */</span></div>
+<div class="line"><a name="l11290"></a><span class="lineno">11290</span>                 fvalue = value - ivalue;      <span class="comment">/* ivalue and ivalue+1       */</span></div>
+<div class="line"><a name="l11291"></a><span class="lineno">11291</span>                 <span class="keywordflow">if</span> (ivalue < npseudo && ivalue >= 0) {</div>
+<div class="line"><a name="l11292"></a><span class="lineno">11292</span>                     vtop = xdata[j + nx*(npseudo-ivalue)];</div>
+<div class="line"><a name="l11293"></a><span class="lineno">11293</span>                     vbot = xdata[j + nx*(npseudo-ivalue-1)];</div>
+<div class="line"><a name="l11294"></a><span class="lineno">11294</span>                     <span class="keywordflow">if</span> (vtop < 1.0) {  <span class="comment">/* Impossible wavelength */</span></div>
+<div class="line"><a name="l11295"></a><span class="lineno">11295</span>                         <span class="keywordflow">if</span> (vbot < 1.0) {</div>
+<div class="line"><a name="l11296"></a><span class="lineno">11296</span>                             value = 0.0;</div>
+<div class="line"><a name="l11297"></a><span class="lineno">11297</span>                         }</div>
+<div class="line"><a name="l11298"></a><span class="lineno">11298</span>                         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l11299"></a><span class="lineno">11299</span>                             value = vbot;</div>
+<div class="line"><a name="l11300"></a><span class="lineno">11300</span>                         }</div>
+<div class="line"><a name="l11301"></a><span class="lineno">11301</span>                     }</div>
+<div class="line"><a name="l11302"></a><span class="lineno">11302</span>                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (vbot < 1.0) {</div>
+<div class="line"><a name="l11303"></a><span class="lineno">11303</span>                         <span class="keywordflow">if</span> (k)</div>
+<div class="line"><a name="l11304"></a><span class="lineno">11304</span>                             value = vtop;</div>
+<div class="line"><a name="l11305"></a><span class="lineno">11305</span>                         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l11306"></a><span class="lineno">11306</span>                             value = 0.0;</div>
+<div class="line"><a name="l11307"></a><span class="lineno">11307</span>                     }</div>
+<div class="line"><a name="l11308"></a><span class="lineno">11308</span>                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fabs(vbot-vtop) > 10*dispersion) {</div>
+<div class="line"><a name="l11309"></a><span class="lineno">11309</span>                         value = 0.0;</div>
+<div class="line"><a name="l11310"></a><span class="lineno">11310</span>                     }</div>
+<div class="line"><a name="l11311"></a><span class="lineno">11311</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l11312"></a><span class="lineno">11312</span>                         value = vtop*(1-fvalue) + vbot*fvalue;</div>
+<div class="line"><a name="l11313"></a><span class="lineno">11313</span>                     }</div>
+<div class="line"><a name="l11314"></a><span class="lineno">11314</span>                     data[j + nx*yint] = value;</div>
+<div class="line"><a name="l11315"></a><span class="lineno">11315</span> </div>
+<div class="line"><a name="l11316"></a><span class="lineno">11316</span>                     <span class="keywordflow">if</span> (k) {</div>
+<div class="line"><a name="l11317"></a><span class="lineno">11317</span> </div>
+<div class="line"><a name="l11318"></a><span class="lineno">11318</span>                         <span class="comment">/*</span></div>
+<div class="line"><a name="l11319"></a><span class="lineno">11319</span> <span class="comment">                         * This is added to recover lost pixels on</span></div>
+<div class="line"><a name="l11320"></a><span class="lineno">11320</span> <span class="comment">                         * the CCD image (pixels are lost because</span></div>
+<div class="line"><a name="l11321"></a><span class="lineno">11321</span> <span class="comment">                         * the CCD pixels are less than npseudo+1).</span></div>
+<div class="line"><a name="l11322"></a><span class="lineno">11322</span> <span class="comment">                         */</span></div>
+<div class="line"><a name="l11323"></a><span class="lineno">11323</span> </div>
+<div class="line"><a name="l11324"></a><span class="lineno">11324</span>                         <span class="keywordflow">if</span> (yprev - yint > 1) {</div>
+<div class="line"><a name="l11325"></a><span class="lineno">11325</span>                             value = sdata[j + nx*(yint+1)];</div>
+<div class="line"><a name="l11326"></a><span class="lineno">11326</span>                             ivalue = value;</div>
+<div class="line"><a name="l11327"></a><span class="lineno">11327</span>                             fvalue = value - ivalue;</div>
+<div class="line"><a name="l11328"></a><span class="lineno">11328</span>                             <span class="keywordflow">if</span> (ivalue < npseudo && ivalue >= 0) {</div>
+<div class="line"><a name="l11329"></a><span class="lineno">11329</span>                                 vtop = xdata[j + nx*(npseudo-ivalue)];</div>
+<div class="line"><a name="l11330"></a><span class="lineno">11330</span>                                 vbot = xdata[j + nx*(npseudo-ivalue-1)];</div>
+<div class="line"><a name="l11331"></a><span class="lineno">11331</span>                                 <span class="keywordflow">if</span> (vtop < 1.0) {</div>
+<div class="line"><a name="l11332"></a><span class="lineno">11332</span>                                     <span class="keywordflow">if</span> (vbot < 1.0) {</div>
+<div class="line"><a name="l11333"></a><span class="lineno">11333</span>                                         value = data[j + nx*(yint+1)];</div>
+<div class="line"><a name="l11334"></a><span class="lineno">11334</span>                                     }</div>
+<div class="line"><a name="l11335"></a><span class="lineno">11335</span>                                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l11336"></a><span class="lineno">11336</span>                                         value = vbot;</div>
+<div class="line"><a name="l11337"></a><span class="lineno">11337</span>                                     }</div>
+<div class="line"><a name="l11338"></a><span class="lineno">11338</span>                                 }</div>
+<div class="line"><a name="l11339"></a><span class="lineno">11339</span>                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (vbot < 1.0) {</div>
+<div class="line"><a name="l11340"></a><span class="lineno">11340</span>                                     value = vtop;</div>
+<div class="line"><a name="l11341"></a><span class="lineno">11341</span>                                 }</div>
+<div class="line"><a name="l11342"></a><span class="lineno">11342</span>                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fabs(vbot-vtop) > 2*dispersion) {</div>
+<div class="line"><a name="l11343"></a><span class="lineno">11343</span>                                     value = vtop;</div>
+<div class="line"><a name="l11344"></a><span class="lineno">11344</span>                                 }</div>
+<div class="line"><a name="l11345"></a><span class="lineno">11345</span>                                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l11346"></a><span class="lineno">11346</span>                                     value = vtop*(1-fvalue) + vbot*fvalue;</div>
+<div class="line"><a name="l11347"></a><span class="lineno">11347</span>                                 }</div>
+<div class="line"><a name="l11348"></a><span class="lineno">11348</span>                                 data[j + nx*(yint+1)] = value;</div>
+<div class="line"><a name="l11349"></a><span class="lineno">11349</span>                             }</div>
+<div class="line"><a name="l11350"></a><span class="lineno">11350</span>                         }</div>
+<div class="line"><a name="l11351"></a><span class="lineno">11351</span>                     }</div>
+<div class="line"><a name="l11352"></a><span class="lineno">11352</span>                 }</div>
+<div class="line"><a name="l11353"></a><span class="lineno">11353</span>                 yprev = yint;</div>
+<div class="line"><a name="l11354"></a><span class="lineno">11354</span>             }</div>
+<div class="line"><a name="l11355"></a><span class="lineno">11355</span>         }</div>
+<div class="line"><a name="l11356"></a><span class="lineno">11356</span>         cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l11357"></a><span class="lineno">11357</span>         cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l11358"></a><span class="lineno">11358</span>     }</div>
+<div class="line"><a name="l11359"></a><span class="lineno">11359</span> </div>
+<div class="line"><a name="l11360"></a><span class="lineno">11360</span>     <span class="keywordflow">return</span> remapped;</div>
+<div class="line"><a name="l11361"></a><span class="lineno">11361</span> }</div>
+<div class="line"><a name="l11362"></a><span class="lineno">11362</span> </div>
+<div class="line"><a name="l11436"></a><span class="lineno"><a class="code" href="group__moses.html#ga8525f2b52eb7ba887858420f36c53471">11436</a></span> cpl_image *<a class="code" href="group__moses.html#ga8525f2b52eb7ba887858420f36c53471" title="Remapping of slit spectra into a grid of lambda-space coordinates.">mos_map_spectrum</a>(cpl_image *spectra, cpl_image *wavecalib, </div>
+<div class="line"><a name="l11437"></a><span class="lineno">11437</span>                             cpl_image *spatial, cpl_table *slits,</div>
+<div class="line"><a name="l11438"></a><span class="lineno">11438</span>                             cpl_table *polytraces, <span class="keywordtype">double</span> reference,</div>
+<div class="line"><a name="l11439"></a><span class="lineno">11439</span>                             <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion,</div>
+<div class="line"><a name="l11440"></a><span class="lineno">11440</span>                             <span class="keywordtype">int</span> flux)</div>
+<div class="line"><a name="l11441"></a><span class="lineno">11441</span> {</div>
+<div class="line"><a name="l11442"></a><span class="lineno">11442</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_map_spectrum"</span>;</div>
+<div class="line"><a name="l11443"></a><span class="lineno">11443</span>     </div>
+<div class="line"><a name="l11444"></a><span class="lineno">11444</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l11445"></a><span class="lineno">11445</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l11446"></a><span class="lineno">11446</span>     cpl_polynomial *polytop;</div>
+<div class="line"><a name="l11447"></a><span class="lineno">11447</span>     cpl_polynomial *polybot;</div>
+<div class="line"><a name="l11448"></a><span class="lineno">11448</span>     cpl_image      *remapped;</div>
+<div class="line"><a name="l11449"></a><span class="lineno">11449</span>     cpl_image     **exslit;</div>
+<div class="line"><a name="l11450"></a><span class="lineno">11450</span>     <span class="keywordtype">float</span>          *data;</div>
+<div class="line"><a name="l11451"></a><span class="lineno">11451</span>     <span class="keywordtype">float</span>          *wdata;</div>
+<div class="line"><a name="l11452"></a><span class="lineno">11452</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l11453"></a><span class="lineno">11453</span>     <span class="keywordtype">float</span>          *xdata;</div>
+<div class="line"><a name="l11454"></a><span class="lineno">11454</span>     <span class="keywordtype">double</span>          lambda00, lambda01, lambda10, lambda11, lambda;</div>
+<div class="line"><a name="l11455"></a><span class="lineno">11455</span>     <span class="keywordtype">double</span>          space00, space01, space10, space11, space;</div>
+<div class="line"><a name="l11456"></a><span class="lineno">11456</span>     <span class="keywordtype">double</span>          value00, value01, value10, value11, value0, value1, value;</div>
+<div class="line"><a name="l11457"></a><span class="lineno">11457</span>     <span class="keywordtype">double</span>          dL, dS;</div>
+<div class="line"><a name="l11458"></a><span class="lineno">11458</span>     <span class="keywordtype">double</span>          top, bot;</div>
+<div class="line"><a name="l11459"></a><span class="lineno">11459</span>     <span class="keywordtype">double</span>          coeff;</div>
+<div class="line"><a name="l11460"></a><span class="lineno">11460</span>     <span class="keywordtype">double</span>          ytop, ybot;</div>
+<div class="line"><a name="l11461"></a><span class="lineno">11461</span>     <span class="keywordtype">double</span>          xfrac, yfrac;</div>
+<div class="line"><a name="l11462"></a><span class="lineno">11462</span>     <span class="keywordtype">int</span>             yint, ysize;</div>
+<div class="line"><a name="l11463"></a><span class="lineno">11463</span>     <span class="keywordtype">int</span>             itop, ibot;</div>
+<div class="line"><a name="l11464"></a><span class="lineno">11464</span>     <span class="keywordtype">int</span>             shift;</div>
+<div class="line"><a name="l11465"></a><span class="lineno">11465</span>     <span class="keywordtype">int</span>             L, S;</div>
+<div class="line"><a name="l11466"></a><span class="lineno">11466</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l11467"></a><span class="lineno">11467</span>     <span class="keywordtype">int</span>             npseudo;</div>
+<div class="line"><a name="l11468"></a><span class="lineno">11468</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l11469"></a><span class="lineno">11469</span>     <span class="keywordtype">int</span>            *position;</div>
+<div class="line"><a name="l11470"></a><span class="lineno">11470</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l11471"></a><span class="lineno">11471</span>     <span class="keywordtype">int</span>             nx, ny;</div>
+<div class="line"><a name="l11472"></a><span class="lineno">11472</span>     <span class="keywordtype">int</span>             x, y;</div>
+<div class="line"><a name="l11473"></a><span class="lineno">11473</span>     <span class="keywordtype">int</span>             nlambda;</div>
+<div class="line"><a name="l11474"></a><span class="lineno">11474</span>     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;</div>
+<div class="line"><a name="l11475"></a><span class="lineno">11475</span>     <span class="keywordtype">int</span>             missing_top, missing_bot; </div>
+<div class="line"><a name="l11476"></a><span class="lineno">11476</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l11477"></a><span class="lineno">11477</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l11478"></a><span class="lineno">11478</span>     <span class="keywordtype">int</span>             i; </div>
+<div class="line"><a name="l11479"></a><span class="lineno">11479</span>     cpl_size        k;</div>
+<div class="line"><a name="l11480"></a><span class="lineno">11480</span>     </div>
+<div class="line"><a name="l11481"></a><span class="lineno">11481</span> </div>
+<div class="line"><a name="l11482"></a><span class="lineno">11482</span>     flux += flux;</div>
+<div class="line"><a name="l11483"></a><span class="lineno">11483</span> </div>
+<div class="line"><a name="l11484"></a><span class="lineno">11484</span>     <span class="keywordflow">if</span> (spectra == NULL || spatial == NULL || wavecalib == NULL ||</div>
+<div class="line"><a name="l11485"></a><span class="lineno">11485</span>         slits == NULL || polytraces == NULL) { </div>
+<div class="line"><a name="l11486"></a><span class="lineno">11486</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l11487"></a><span class="lineno">11487</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11488"></a><span class="lineno">11488</span>     }</div>
+<div class="line"><a name="l11489"></a><span class="lineno">11489</span> </div>
+<div class="line"><a name="l11490"></a><span class="lineno">11490</span>     <span class="keywordflow">if</span> (dispersion <= 0.0) {</div>
+<div class="line"><a name="l11491"></a><span class="lineno">11491</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l11492"></a><span class="lineno">11492</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11493"></a><span class="lineno">11493</span>     }</div>
+<div class="line"><a name="l11494"></a><span class="lineno">11494</span> </div>
+<div class="line"><a name="l11495"></a><span class="lineno">11495</span>     <span class="keywordflow">if</span> (red - blue < dispersion) {</div>
+<div class="line"><a name="l11496"></a><span class="lineno">11496</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l11497"></a><span class="lineno">11497</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11498"></a><span class="lineno">11498</span>     }</div>
+<div class="line"><a name="l11499"></a><span class="lineno">11499</span>     </div>
+<div class="line"><a name="l11500"></a><span class="lineno">11500</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l11501"></a><span class="lineno">11501</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l11502"></a><span class="lineno">11502</span> </div>
+<div class="line"><a name="l11503"></a><span class="lineno">11503</span>     <span class="keywordflow">if</span> (nx != cpl_image_get_size_x(spatial) ||</div>
+<div class="line"><a name="l11504"></a><span class="lineno">11504</span>         ny != cpl_image_get_size_y(spatial) ||</div>
+<div class="line"><a name="l11505"></a><span class="lineno">11505</span>         nx != cpl_image_get_size_x(wavecalib) ||</div>
+<div class="line"><a name="l11506"></a><span class="lineno">11506</span>         ny != cpl_image_get_size_y(wavecalib)) {</div>
+<div class="line"><a name="l11507"></a><span class="lineno">11507</span>         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l11508"></a><span class="lineno">11508</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11509"></a><span class="lineno">11509</span>     }</div>
+<div class="line"><a name="l11510"></a><span class="lineno">11510</span> </div>
+<div class="line"><a name="l11511"></a><span class="lineno">11511</span>     nlambda     = STRETCH_FACTOR * (red - blue) / dispersion;</div>
+<div class="line"><a name="l11512"></a><span class="lineno">11512</span>     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;</div>
+<div class="line"><a name="l11513"></a><span class="lineno">11513</span>     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;</div>
+<div class="line"><a name="l11514"></a><span class="lineno">11514</span> </div>
+<div class="line"><a name="l11515"></a><span class="lineno">11515</span>     data  = cpl_image_get_data(spectra);</div>
+<div class="line"><a name="l11516"></a><span class="lineno">11516</span>     sdata = cpl_image_get_data(spatial);</div>
+<div class="line"><a name="l11517"></a><span class="lineno">11517</span>     wdata = cpl_image_get_data(wavecalib);</div>
+<div class="line"><a name="l11518"></a><span class="lineno">11518</span>     </div>
+<div class="line"><a name="l11519"></a><span class="lineno">11519</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l11520"></a><span class="lineno">11520</span>     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l11521"></a><span class="lineno">11521</span>     order    = cpl_table_get_ncol(polytraces) - 2;</div>
+<div class="line"><a name="l11522"></a><span class="lineno">11522</span>     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);</div>
+<div class="line"><a name="l11523"></a><span class="lineno">11523</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l11524"></a><span class="lineno">11524</span>     </div>
+<div class="line"><a name="l11525"></a><span class="lineno">11525</span>     exslit = cpl_calloc(nslits, <span class="keyword">sizeof</span>(cpl_image *));</div>
+<div class="line"><a name="l11526"></a><span class="lineno">11526</span> </div>
+<div class="line"><a name="l11527"></a><span class="lineno">11527</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l11528"></a><span class="lineno">11528</span> </div>
+<div class="line"><a name="l11529"></a><span class="lineno">11529</span>          <span class="keywordflow">if</span> (length == 0)</div>
+<div class="line"><a name="l11530"></a><span class="lineno">11530</span>              <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11531"></a><span class="lineno">11531</span> </div>
+<div class="line"><a name="l11532"></a><span class="lineno">11532</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l11533"></a><span class="lineno">11533</span> <span class="comment">         * Note that the x coordinate of the reference pixels on the CCD</span></div>
+<div class="line"><a name="l11534"></a><span class="lineno">11534</span> <span class="comment">         * is taken arbitrarily at the top end of each slit. This wouldn't</span></div>
+<div class="line"><a name="l11535"></a><span class="lineno">11535</span> <span class="comment">         * be entirely correct in case of curved slits, or in presence of</span></div>
+<div class="line"><a name="l11536"></a><span class="lineno">11536</span> <span class="comment">         * heavy distortions: in such cases the spatial resampling is</span></div>
+<div class="line"><a name="l11537"></a><span class="lineno">11537</span> <span class="comment">         * really performed across a wide range of wavelengths. But</span></div>
+<div class="line"><a name="l11538"></a><span class="lineno">11538</span> <span class="comment">         * the lag between top and bottom spectral curvature models</span></div>
+<div class="line"><a name="l11539"></a><span class="lineno">11539</span> <span class="comment">         * would introduce even in such cases negligible effects on</span></div>
+<div class="line"><a name="l11540"></a><span class="lineno">11540</span> <span class="comment">         * the spectral spatial resampling.</span></div>
+<div class="line"><a name="l11541"></a><span class="lineno">11541</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l11542"></a><span class="lineno">11542</span> </div>
+<div class="line"><a name="l11543"></a><span class="lineno">11543</span>         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);</div>
+<div class="line"><a name="l11544"></a><span class="lineno">11544</span> </div>
+<div class="line"><a name="l11545"></a><span class="lineno">11545</span>         start_pixel = refpixel - pixel_below;</div>
+<div class="line"><a name="l11546"></a><span class="lineno">11546</span>         <span class="keywordflow">if</span> (start_pixel < 1)</div>
+<div class="line"><a name="l11547"></a><span class="lineno">11547</span>             start_pixel = 1;</div>
+<div class="line"><a name="l11548"></a><span class="lineno">11548</span> </div>
+<div class="line"><a name="l11549"></a><span class="lineno">11549</span>         end_pixel = refpixel + pixel_above;</div>
+<div class="line"><a name="l11550"></a><span class="lineno">11550</span>         <span class="keywordflow">if</span> (end_pixel > nx)</div>
+<div class="line"><a name="l11551"></a><span class="lineno">11551</span>             end_pixel = nx;</div>
+<div class="line"><a name="l11552"></a><span class="lineno">11552</span> </div>
+<div class="line"><a name="l11553"></a><span class="lineno">11553</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l11554"></a><span class="lineno">11554</span> <span class="comment">         * Recover from the table of spectral curvature coefficients</span></div>
+<div class="line"><a name="l11555"></a><span class="lineno">11555</span> <span class="comment">         * the curvature polynomials.</span></div>
+<div class="line"><a name="l11556"></a><span class="lineno">11556</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l11557"></a><span class="lineno">11557</span> </div>
+<div class="line"><a name="l11558"></a><span class="lineno">11558</span>         missing_top = 0;</div>
+<div class="line"><a name="l11559"></a><span class="lineno">11559</span>         polytop = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l11560"></a><span class="lineno">11560</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l11561"></a><span class="lineno">11561</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);</div>
+<div class="line"><a name="l11562"></a><span class="lineno">11562</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l11563"></a><span class="lineno">11563</span>                 cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l11564"></a><span class="lineno">11564</span>                 missing_top = 1;</div>
+<div class="line"><a name="l11565"></a><span class="lineno">11565</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l11566"></a><span class="lineno">11566</span>             }</div>
+<div class="line"><a name="l11567"></a><span class="lineno">11567</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l11568"></a><span class="lineno">11568</span>         }</div>
+<div class="line"><a name="l11569"></a><span class="lineno">11569</span> </div>
+<div class="line"><a name="l11570"></a><span class="lineno">11570</span>         missing_bot = 0;</div>
+<div class="line"><a name="l11571"></a><span class="lineno">11571</span>         polybot = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l11572"></a><span class="lineno">11572</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l11573"></a><span class="lineno">11573</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);</div>
+<div class="line"><a name="l11574"></a><span class="lineno">11574</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l11575"></a><span class="lineno">11575</span>                 cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l11576"></a><span class="lineno">11576</span>                 missing_bot = 1;</div>
+<div class="line"><a name="l11577"></a><span class="lineno">11577</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l11578"></a><span class="lineno">11578</span>             }</div>
+<div class="line"><a name="l11579"></a><span class="lineno">11579</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l11580"></a><span class="lineno">11580</span>         }</div>
+<div class="line"><a name="l11581"></a><span class="lineno">11581</span> </div>
+<div class="line"><a name="l11582"></a><span class="lineno">11582</span>         <span class="keywordflow">if</span> (missing_top && missing_bot) {</div>
+<div class="line"><a name="l11583"></a><span class="lineno">11583</span>             cpl_msg_debug(func, <span class="stringliteral">"Slit %d was not traced: no extraction!"</span>,</div>
+<div class="line"><a name="l11584"></a><span class="lineno">11584</span>                           slit_id[i]);</div>
+<div class="line"><a name="l11585"></a><span class="lineno">11585</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11586"></a><span class="lineno">11586</span>         }</div>
+<div class="line"><a name="l11587"></a><span class="lineno">11587</span> </div>
+<div class="line"><a name="l11588"></a><span class="lineno">11588</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l11589"></a><span class="lineno">11589</span> <span class="comment">         * In case just one of the two edges was not traced, the other</span></div>
+<div class="line"><a name="l11590"></a><span class="lineno">11590</span> <span class="comment">         * edge curvature model is duplicated and shifted to the other</span></div>
+<div class="line"><a name="l11591"></a><span class="lineno">11591</span> <span class="comment">         * end of the slit: better than nothing!</span></div>
+<div class="line"><a name="l11592"></a><span class="lineno">11592</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l11593"></a><span class="lineno">11593</span> </div>
+<div class="line"><a name="l11594"></a><span class="lineno">11594</span>         <span class="keywordflow">if</span> (missing_top) {</div>
+<div class="line"><a name="l11595"></a><span class="lineno">11595</span>             cpl_msg_debug(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l11596"></a><span class="lineno">11596</span>                           <span class="stringliteral">"the spectral curvature of the lower edge "</span></div>
+<div class="line"><a name="l11597"></a><span class="lineno">11597</span>                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l11598"></a><span class="lineno">11598</span>             polytop = cpl_polynomial_duplicate(polybot);</div>
+<div class="line"><a name="l11599"></a><span class="lineno">11599</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l11600"></a><span class="lineno">11600</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l11601"></a><span class="lineno">11601</span>             k = 0;</div>
+<div class="line"><a name="l11602"></a><span class="lineno">11602</span>             coeff = cpl_polynomial_get_coeff(polybot, &k);</div>
+<div class="line"><a name="l11603"></a><span class="lineno">11603</span>             coeff += ytop - ybot;</div>
+<div class="line"><a name="l11604"></a><span class="lineno">11604</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l11605"></a><span class="lineno">11605</span>         }</div>
+<div class="line"><a name="l11606"></a><span class="lineno">11606</span> </div>
+<div class="line"><a name="l11607"></a><span class="lineno">11607</span>         <span class="keywordflow">if</span> (missing_bot) {</div>
+<div class="line"><a name="l11608"></a><span class="lineno">11608</span>             cpl_msg_debug(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l11609"></a><span class="lineno">11609</span>                           <span class="stringliteral">"the spectral curvature of the upper edge "</span></div>
+<div class="line"><a name="l11610"></a><span class="lineno">11610</span>                           <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l11611"></a><span class="lineno">11611</span>             polybot = cpl_polynomial_duplicate(polytop);</div>
+<div class="line"><a name="l11612"></a><span class="lineno">11612</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l11613"></a><span class="lineno">11613</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l11614"></a><span class="lineno">11614</span>             k = 0;</div>
+<div class="line"><a name="l11615"></a><span class="lineno">11615</span>             coeff = cpl_polynomial_get_coeff(polytop, &k);</div>
+<div class="line"><a name="l11616"></a><span class="lineno">11616</span>             coeff -= ytop - ybot;</div>
+<div class="line"><a name="l11617"></a><span class="lineno">11617</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l11618"></a><span class="lineno">11618</span>         }</div>
+<div class="line"><a name="l11619"></a><span class="lineno">11619</span> </div>
+<div class="line"><a name="l11620"></a><span class="lineno">11620</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l11621"></a><span class="lineno">11621</span> <span class="comment">         * Allocate image for current extracted slit</span></div>
+<div class="line"><a name="l11622"></a><span class="lineno">11622</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l11623"></a><span class="lineno">11623</span> </div>
+<div class="line"><a name="l11624"></a><span class="lineno">11624</span>         top = cpl_polynomial_eval_1d(polytop, refpixel, NULL);</div>
+<div class="line"><a name="l11625"></a><span class="lineno">11625</span>         bot = cpl_polynomial_eval_1d(polybot, refpixel, NULL);</div>
+<div class="line"><a name="l11626"></a><span class="lineno">11626</span>         npseudo = ceil(top-bot) + 1;</div>
+<div class="line"><a name="l11627"></a><span class="lineno">11627</span> </div>
+<div class="line"><a name="l11628"></a><span class="lineno">11628</span>         <span class="keywordflow">if</span> (npseudo < 1) {</div>
+<div class="line"><a name="l11629"></a><span class="lineno">11629</span>             cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l11630"></a><span class="lineno">11630</span>             cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l11631"></a><span class="lineno">11631</span>             cpl_msg_debug(func, <span class="stringliteral">"Slit %d was badly traced: no extraction!"</span>,</div>
+<div class="line"><a name="l11632"></a><span class="lineno">11632</span>                           slit_id[i]);</div>
+<div class="line"><a name="l11633"></a><span class="lineno">11633</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11634"></a><span class="lineno">11634</span>         }</div>
+<div class="line"><a name="l11635"></a><span class="lineno">11635</span> </div>
+<div class="line"><a name="l11636"></a><span class="lineno">11636</span>         exslit[i] = cpl_image_new(nlambda, npseudo+1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l11637"></a><span class="lineno">11637</span>         xdata = cpl_image_get_data(exslit[i]);</div>
+<div class="line"><a name="l11638"></a><span class="lineno">11638</span> </div>
+<div class="line"><a name="l11639"></a><span class="lineno">11639</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l11640"></a><span class="lineno">11640</span> <span class="comment">         * Write interpolated spectral values to remapped slit spectrum.</span></div>
+<div class="line"><a name="l11641"></a><span class="lineno">11641</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l11642"></a><span class="lineno">11642</span> </div>
+<div class="line"><a name="l11643"></a><span class="lineno">11643</span>         <span class="keywordflow">for</span> (x = start_pixel; x < end_pixel; x++) {</div>
+<div class="line"><a name="l11644"></a><span class="lineno">11644</span>             top = cpl_polynomial_eval_1d(polytop, x, NULL);</div>
+<div class="line"><a name="l11645"></a><span class="lineno">11645</span>             bot = cpl_polynomial_eval_1d(polybot, x, NULL);</div>
+<div class="line"><a name="l11646"></a><span class="lineno">11646</span>             itop = top + 1;</div>
+<div class="line"><a name="l11647"></a><span class="lineno">11647</span>             ibot = bot;</div>
+<div class="line"><a name="l11648"></a><span class="lineno">11648</span>             <span class="keywordflow">if</span> (itop < 0)</div>
+<div class="line"><a name="l11649"></a><span class="lineno">11649</span>                 itop = 0;</div>
+<div class="line"><a name="l11650"></a><span class="lineno">11650</span>             <span class="keywordflow">if</span> (itop > ny - 1)</div>
+<div class="line"><a name="l11651"></a><span class="lineno">11651</span>                 itop = ny - 1;</div>
+<div class="line"><a name="l11652"></a><span class="lineno">11652</span>             <span class="keywordflow">if</span> (ibot < 0)</div>
+<div class="line"><a name="l11653"></a><span class="lineno">11653</span>                 ibot = 0;</div>
+<div class="line"><a name="l11654"></a><span class="lineno">11654</span>             <span class="keywordflow">if</span> (ibot > ny - 1)</div>
+<div class="line"><a name="l11655"></a><span class="lineno">11655</span>                 ibot = ny - 1;</div>
+<div class="line"><a name="l11656"></a><span class="lineno">11656</span>             <span class="keywordflow">for</span> (y = ibot; y < itop; y++) {</div>
+<div class="line"><a name="l11657"></a><span class="lineno">11657</span>                  lambda11 = wdata[x + y*nx];</div>
+<div class="line"><a name="l11658"></a><span class="lineno">11658</span>                  <span class="keywordflow">if</span> (lambda11 < 1.0)        <span class="comment">/* Impossible wavelength */</span></div>
+<div class="line"><a name="l11659"></a><span class="lineno">11659</span>                      <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11660"></a><span class="lineno">11660</span>                  space11 = sdata[x + y*nx];</div>
+<div class="line"><a name="l11661"></a><span class="lineno">11661</span>                  <span class="keywordflow">if</span> (space11 < 0.0)         <span class="comment">/* Impossible spatial coordinate */</span></div>
+<div class="line"><a name="l11662"></a><span class="lineno">11662</span>                      <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11663"></a><span class="lineno">11663</span>                  lambda01 = wdata[x - 1 + y*nx];</div>
+<div class="line"><a name="l11664"></a><span class="lineno">11664</span>                  <span class="keywordflow">if</span> (lambda01 < 1.0)        <span class="comment">/* Impossible wavelength */</span></div>
+<div class="line"><a name="l11665"></a><span class="lineno">11665</span>                      <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11666"></a><span class="lineno">11666</span>                  space01 = sdata[x - 1 + y*nx];</div>
+<div class="line"><a name="l11667"></a><span class="lineno">11667</span>                  <span class="keywordflow">if</span> (space01 < 0.0)         <span class="comment">/* Impossible spatial coordinate */</span></div>
+<div class="line"><a name="l11668"></a><span class="lineno">11668</span>                      <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11669"></a><span class="lineno">11669</span> </div>
+<div class="line"><a name="l11670"></a><span class="lineno">11670</span>                  shift = 0;</div>
+<div class="line"><a name="l11671"></a><span class="lineno">11671</span> </div>
+<div class="line"><a name="l11672"></a><span class="lineno">11672</span> <span class="comment">/****+</span></div>
+<div class="line"><a name="l11673"></a><span class="lineno">11673</span> <span class="comment">                 if (wdata[x + (y+1)*nx] > 1.0) {</span></div>
+<div class="line"><a name="l11674"></a><span class="lineno">11674</span> <span class="comment">                     if (wdata[x + (y+1)*nx] - lambda11 > 0) {</span></div>
+<div class="line"><a name="l11675"></a><span class="lineno">11675</span> <span class="comment">                         shift = -1;</span></div>
+<div class="line"><a name="l11676"></a><span class="lineno">11676</span> <span class="comment">                         while (wdata[x + shift + (y+1)*nx] - lambda11 > 0)</span></div>
+<div class="line"><a name="l11677"></a><span class="lineno">11677</span> <span class="comment">                             shift--;</span></div>
+<div class="line"><a name="l11678"></a><span class="lineno">11678</span> <span class="comment">                         if (lambda11 - wdata[x + shift + (y+1)*nx] > </span></div>
+<div class="line"><a name="l11679"></a><span class="lineno">11679</span> <span class="comment">                             wdata[x + shift + 1 + (y+1)*nx] - lambda11) {</span></div>
+<div class="line"><a name="l11680"></a><span class="lineno">11680</span> <span class="comment">                             shift++;</span></div>
+<div class="line"><a name="l11681"></a><span class="lineno">11681</span> <span class="comment">                         }</span></div>
+<div class="line"><a name="l11682"></a><span class="lineno">11682</span> <span class="comment">                     }</span></div>
+<div class="line"><a name="l11683"></a><span class="lineno">11683</span> <span class="comment">                     else {</span></div>
+<div class="line"><a name="l11684"></a><span class="lineno">11684</span> <span class="comment">                         shift = 1;</span></div>
+<div class="line"><a name="l11685"></a><span class="lineno">11685</span> <span class="comment">                         while (wdata[x + shift + (y+1)*nx] - lambda11 < 0)</span></div>
+<div class="line"><a name="l11686"></a><span class="lineno">11686</span> <span class="comment">                             shift++;</span></div>
+<div class="line"><a name="l11687"></a><span class="lineno">11687</span> <span class="comment">                         if (wdata[x + shift + (y+1)*nx] - lambda11 ></span></div>
+<div class="line"><a name="l11688"></a><span class="lineno">11688</span> <span class="comment">                             lambda11 - wdata[x + shift + 1 + (y+1)*nx]) {</span></div>
+<div class="line"><a name="l11689"></a><span class="lineno">11689</span> <span class="comment">                             shift--;</span></div>
+<div class="line"><a name="l11690"></a><span class="lineno">11690</span> <span class="comment">                         }</span></div>
+<div class="line"><a name="l11691"></a><span class="lineno">11691</span> <span class="comment">                     }</span></div>
+<div class="line"><a name="l11692"></a><span class="lineno">11692</span> <span class="comment">                 }</span></div>
+<div class="line"><a name="l11693"></a><span class="lineno">11693</span> <span class="comment">****/</span></div>
+<div class="line"><a name="l11694"></a><span class="lineno">11694</span> </div>
+<div class="line"><a name="l11695"></a><span class="lineno">11695</span> <span class="comment">/****</span></div>
+<div class="line"><a name="l11696"></a><span class="lineno">11696</span> <span class="comment">printf("y = %d, shift = %d\n", y, shift);</span></div>
+<div class="line"><a name="l11697"></a><span class="lineno">11697</span> <span class="comment">****/</span></div>
+<div class="line"><a name="l11698"></a><span class="lineno">11698</span> </div>
+<div class="line"><a name="l11699"></a><span class="lineno">11699</span>                  lambda10 = wdata[x + shift + (y+1)*nx];</div>
+<div class="line"><a name="l11700"></a><span class="lineno">11700</span>                  <span class="keywordflow">if</span> (lambda10 < 1.0)        <span class="comment">/* Impossible wavelength */</span></div>
+<div class="line"><a name="l11701"></a><span class="lineno">11701</span>                      <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11702"></a><span class="lineno">11702</span>                  space10 = sdata[x + shift + (y+1)*nx];</div>
+<div class="line"><a name="l11703"></a><span class="lineno">11703</span>                  <span class="keywordflow">if</span> (space10 < 0.0)         <span class="comment">/* Impossible spatial coordinate */</span></div>
+<div class="line"><a name="l11704"></a><span class="lineno">11704</span>                      <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11705"></a><span class="lineno">11705</span>                  lambda00 = wdata[x - 1 + shift + (y+1)*nx];</div>
+<div class="line"><a name="l11706"></a><span class="lineno">11706</span>                  <span class="keywordflow">if</span> (lambda00 < 1.0)        <span class="comment">/* Impossible wavelength */</span></div>
+<div class="line"><a name="l11707"></a><span class="lineno">11707</span>                      <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11708"></a><span class="lineno">11708</span>                  space00 = sdata[x - 1 + shift + (y+1)*nx];</div>
+<div class="line"><a name="l11709"></a><span class="lineno">11709</span>                  <span class="keywordflow">if</span> (space00 < 0.0)         <span class="comment">/* Impossible spatial coordinate */</span></div>
+<div class="line"><a name="l11710"></a><span class="lineno">11710</span>                      <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11711"></a><span class="lineno">11711</span>                  </div>
+<div class="line"><a name="l11712"></a><span class="lineno">11712</span>                  <span class="comment">/*</span></div>
+<div class="line"><a name="l11713"></a><span class="lineno">11713</span> <span class="comment">                  * Find the variation in lambda and space in this</span></div>
+<div class="line"><a name="l11714"></a><span class="lineno">11714</span> <span class="comment">                  * position for each CCD pixel (both quantities are </span></div>
+<div class="line"><a name="l11715"></a><span class="lineno">11715</span> <span class="comment">                  * expected to be positive).</span></div>
+<div class="line"><a name="l11716"></a><span class="lineno">11716</span> <span class="comment">                  */</span></div>
+<div class="line"><a name="l11717"></a><span class="lineno">11717</span> </div>
+<div class="line"><a name="l11718"></a><span class="lineno">11718</span>                  dL = lambda11 - lambda01;</div>
+<div class="line"><a name="l11719"></a><span class="lineno">11719</span>                  dS = space11 - space10;</div>
+<div class="line"><a name="l11720"></a><span class="lineno">11720</span> </div>
+<div class="line"><a name="l11721"></a><span class="lineno">11721</span>                  <span class="comment">/*</span></div>
+<div class="line"><a name="l11722"></a><span class="lineno">11722</span> <span class="comment">                  * Find the position (L,S) of the output pixel </span></div>
+<div class="line"><a name="l11723"></a><span class="lineno">11723</span> <span class="comment">                  * (by integer truncation).</span></div>
+<div class="line"><a name="l11724"></a><span class="lineno">11724</span> <span class="comment">                  */</span></div>
+<div class="line"><a name="l11725"></a><span class="lineno">11725</span> </div>
+<div class="line"><a name="l11726"></a><span class="lineno">11726</span>                  L = (lambda11 - blue)/dispersion + 0.5;</div>
+<div class="line"><a name="l11727"></a><span class="lineno">11727</span>                  S = space11 + 0.5;                   <span class="comment">/* Counted from top! */</span></div>
+<div class="line"><a name="l11728"></a><span class="lineno">11728</span> </div>
+<div class="line"><a name="l11729"></a><span class="lineno">11729</span>                  <span class="keywordflow">if</span> (L < 0 || L >= nlambda)</div>
+<div class="line"><a name="l11730"></a><span class="lineno">11730</span>                      <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11731"></a><span class="lineno">11731</span>                  <span class="keywordflow">if</span> (S < 0 || S > npseudo)</div>
+<div class="line"><a name="l11732"></a><span class="lineno">11732</span>                      <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11733"></a><span class="lineno">11733</span> </div>
+<div class="line"><a name="l11734"></a><span class="lineno">11734</span>                  <span class="comment">/*</span></div>
+<div class="line"><a name="l11735"></a><span class="lineno">11735</span> <span class="comment">                  * Find the coordinate of pixel (L,S)</span></div>
+<div class="line"><a name="l11736"></a><span class="lineno">11736</span> <span class="comment">                  */</span></div>
+<div class="line"><a name="l11737"></a><span class="lineno">11737</span> </div>
+<div class="line"><a name="l11738"></a><span class="lineno">11738</span>                  lambda = blue + L*dispersion;</div>
+<div class="line"><a name="l11739"></a><span class="lineno">11739</span>                  space  = S;</div>
+<div class="line"><a name="l11740"></a><span class="lineno">11740</span> </div>
+<div class="line"><a name="l11741"></a><span class="lineno">11741</span>                  <span class="comment">/*</span></div>
+<div class="line"><a name="l11742"></a><span class="lineno">11742</span> <span class="comment">                  * Find the interpolation point on the CCD: it is</span></div>
+<div class="line"><a name="l11743"></a><span class="lineno">11743</span> <span class="comment">                  * defined as the (positive) distance from current</span></div>
+<div class="line"><a name="l11744"></a><span class="lineno">11744</span> <span class="comment">                  * CCD pixel (x,y) of the interpolation point (x',y'),</span></div>
+<div class="line"><a name="l11745"></a><span class="lineno">11745</span> <span class="comment">                  * measured in CCD pixels. The interpolation point</span></div>
+<div class="line"><a name="l11746"></a><span class="lineno">11746</span> <span class="comment">                  * is located between the four CCD pixels selected</span></div>
+<div class="line"><a name="l11747"></a><span class="lineno">11747</span> <span class="comment">                  * above.</span></div>
+<div class="line"><a name="l11748"></a><span class="lineno">11748</span> <span class="comment">                  */</span></div>
+<div class="line"><a name="l11749"></a><span class="lineno">11749</span> </div>
+<div class="line"><a name="l11750"></a><span class="lineno">11750</span>                  xfrac = (lambda11-lambda)/dL;</div>
+<div class="line"><a name="l11751"></a><span class="lineno">11751</span>                  yfrac = (space11-space)/dS;</div>
+<div class="line"><a name="l11752"></a><span class="lineno">11752</span> </div>
+<div class="line"><a name="l11753"></a><span class="lineno">11753</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l11754"></a><span class="lineno">11754</span> <span class="comment">if (xfrac < 0.0 || xfrac > 1.0 || yfrac < 0.0 || yfrac > 1.0)</span></div>
+<div class="line"><a name="l11755"></a><span class="lineno">11755</span> <span class="comment">printf("xyfrac = %f, %f\n", xfrac, yfrac);</span></div>
+<div class="line"><a name="l11756"></a><span class="lineno">11756</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l11757"></a><span class="lineno">11757</span> </div>
+<div class="line"><a name="l11758"></a><span class="lineno">11758</span>                  <span class="comment">/*</span></div>
+<div class="line"><a name="l11759"></a><span class="lineno">11759</span> <span class="comment">                  * Get the four values to interpolate</span></div>
+<div class="line"><a name="l11760"></a><span class="lineno">11760</span> <span class="comment">                  */</span></div>
+<div class="line"><a name="l11761"></a><span class="lineno">11761</span> </div>
+<div class="line"><a name="l11762"></a><span class="lineno">11762</span>                  value11 = data[x + y*nx];</div>
+<div class="line"><a name="l11763"></a><span class="lineno">11763</span>                  value01 = data[x - 1 + y*nx];</div>
+<div class="line"><a name="l11764"></a><span class="lineno">11764</span>                  value10 = data[x + shift + (y+1)*nx];</div>
+<div class="line"><a name="l11765"></a><span class="lineno">11765</span>                  value00 = data[x + shift - 1 + (y+1)*nx];</div>
+<div class="line"><a name="l11766"></a><span class="lineno">11766</span> </div>
+<div class="line"><a name="l11767"></a><span class="lineno">11767</span>                  <span class="comment">/*</span></div>
+<div class="line"><a name="l11768"></a><span class="lineno">11768</span> <span class="comment">                  * Interpolation</span></div>
+<div class="line"><a name="l11769"></a><span class="lineno">11769</span> <span class="comment">                  */</span></div>
+<div class="line"><a name="l11770"></a><span class="lineno">11770</span> </div>
+<div class="line"><a name="l11771"></a><span class="lineno">11771</span>                  value1 = (1-xfrac)*value11 + xfrac*value01;</div>
+<div class="line"><a name="l11772"></a><span class="lineno">11772</span>                  value0 = (1-xfrac)*value10 + xfrac*value00;</div>
+<div class="line"><a name="l11773"></a><span class="lineno">11773</span>                  value  = (1-yfrac)*value1  + yfrac*value0;</div>
+<div class="line"><a name="l11774"></a><span class="lineno">11774</span> </div>
+<div class="line"><a name="l11775"></a><span class="lineno">11775</span>                  <span class="comment">/*</span></div>
+<div class="line"><a name="l11776"></a><span class="lineno">11776</span> <span class="comment">                  * Write this value to the appropriate (L,S) coordinate</span></div>
+<div class="line"><a name="l11777"></a><span class="lineno">11777</span> <span class="comment">                  * on output slit</span></div>
+<div class="line"><a name="l11778"></a><span class="lineno">11778</span> <span class="comment">                  */</span></div>
+<div class="line"><a name="l11779"></a><span class="lineno">11779</span> </div>
+<div class="line"><a name="l11780"></a><span class="lineno">11780</span>                  xdata[L + nlambda*(npseudo-S)] = value;</div>
+<div class="line"><a name="l11781"></a><span class="lineno">11781</span>                  </div>
+<div class="line"><a name="l11782"></a><span class="lineno">11782</span>             }</div>
+<div class="line"><a name="l11783"></a><span class="lineno">11783</span>         }</div>
+<div class="line"><a name="l11784"></a><span class="lineno">11784</span>         cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l11785"></a><span class="lineno">11785</span>         cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l11786"></a><span class="lineno">11786</span>     }</div>
+<div class="line"><a name="l11787"></a><span class="lineno">11787</span> </div>
+<div class="line"><a name="l11788"></a><span class="lineno">11788</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l11789"></a><span class="lineno">11789</span> <span class="comment">     * Now all the slits images are copied to a single image</span></div>
+<div class="line"><a name="l11790"></a><span class="lineno">11790</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l11791"></a><span class="lineno">11791</span> </div>
+<div class="line"><a name="l11792"></a><span class="lineno">11792</span>     ysize = 0;</div>
+<div class="line"><a name="l11793"></a><span class="lineno">11793</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)</div>
+<div class="line"><a name="l11794"></a><span class="lineno">11794</span>         <span class="keywordflow">if</span> (exslit[i])</div>
+<div class="line"><a name="l11795"></a><span class="lineno">11795</span>             ysize += cpl_image_get_size_y(exslit[i]);</div>
+<div class="line"><a name="l11796"></a><span class="lineno">11796</span> </div>
+<div class="line"><a name="l11797"></a><span class="lineno">11797</span>     remapped = cpl_image_new(nlambda, ysize, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l11798"></a><span class="lineno">11798</span> </div>
+<div class="line"><a name="l11799"></a><span class="lineno">11799</span>     yint = -1;</div>
+<div class="line"><a name="l11800"></a><span class="lineno">11800</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l11801"></a><span class="lineno">11801</span>         <span class="keywordflow">if</span> (exslit[i]) {</div>
+<div class="line"><a name="l11802"></a><span class="lineno">11802</span>             yint += cpl_image_get_size_y(exslit[i]);</div>
+<div class="line"><a name="l11803"></a><span class="lineno">11803</span>             cpl_image_copy(remapped, exslit[i], 1, ysize - yint);</div>
+<div class="line"><a name="l11804"></a><span class="lineno">11804</span>             cpl_image_delete(exslit[i]);</div>
+<div class="line"><a name="l11805"></a><span class="lineno">11805</span>             cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, i, ysize - yint - 1);</div>
+<div class="line"><a name="l11806"></a><span class="lineno">11806</span>         }</div>
+<div class="line"><a name="l11807"></a><span class="lineno">11807</span>     }</div>
+<div class="line"><a name="l11808"></a><span class="lineno">11808</span> </div>
+<div class="line"><a name="l11809"></a><span class="lineno">11809</span>     cpl_free(exslit);</div>
+<div class="line"><a name="l11810"></a><span class="lineno">11810</span> </div>
+<div class="line"><a name="l11811"></a><span class="lineno">11811</span>     <span class="keywordflow">return</span> remapped;</div>
+<div class="line"><a name="l11812"></a><span class="lineno">11812</span> </div>
+<div class="line"><a name="l11813"></a><span class="lineno">11813</span> }</div>
+<div class="line"><a name="l11814"></a><span class="lineno">11814</span> </div>
+<div class="line"><a name="l11815"></a><span class="lineno">11815</span> </div>
+<div class="line"><a name="l11848"></a><span class="lineno"><a class="code" href="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d">11848</a></span> cpl_table *<a class="code" href="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d" title="Create a CCD median sky map.">mos_sky_map_super</a>(cpl_image *spectra, cpl_image *wavemap,</div>
+<div class="line"><a name="l11849"></a><span class="lineno">11849</span>                              <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> factor, <span class="keywordtype">int</span> minpoints,</div>
+<div class="line"><a name="l11850"></a><span class="lineno">11850</span>                              cpl_image *skymap)</div>
+<div class="line"><a name="l11851"></a><span class="lineno">11851</span> {</div>
+<div class="line"><a name="l11852"></a><span class="lineno">11852</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_sky_map_super"</span>;</div>
+<div class="line"><a name="l11853"></a><span class="lineno">11853</span> </div>
+<div class="line"><a name="l11854"></a><span class="lineno">11854</span>     cpl_vector **vector;</div>
+<div class="line"><a name="l11855"></a><span class="lineno">11855</span>     cpl_vector **wvector;</div>
+<div class="line"><a name="l11856"></a><span class="lineno">11856</span>     <span class="keywordtype">double</span>       firstLambda, lastLambda;</div>
+<div class="line"><a name="l11857"></a><span class="lineno">11857</span>     <span class="keywordtype">double</span>       lambda, lambda1, lambda2;</div>
+<div class="line"><a name="l11858"></a><span class="lineno">11858</span>     <span class="keywordtype">double</span>       value, value1, value2;</div>
+<div class="line"><a name="l11859"></a><span class="lineno">11859</span>     <span class="keywordtype">double</span>       frac;</div>
+<div class="line"><a name="l11860"></a><span class="lineno">11860</span>     <span class="keywordtype">float</span>        min, max;</div>
+<div class="line"><a name="l11861"></a><span class="lineno">11861</span>     <span class="keywordtype">int</span>         *count;</div>
+<div class="line"><a name="l11862"></a><span class="lineno">11862</span>     <span class="keywordtype">int</span>          nbin, bin;</div>
+<div class="line"><a name="l11863"></a><span class="lineno">11863</span>     <span class="keywordtype">int</span>          nx, ny, npix;</div>
+<div class="line"><a name="l11864"></a><span class="lineno">11864</span>     <span class="keywordtype">int</span>          first_valid, valid_bins;</div>
+<div class="line"><a name="l11865"></a><span class="lineno">11865</span>     <span class="keywordtype">int</span>          i, j;</div>
+<div class="line"><a name="l11866"></a><span class="lineno">11866</span> </div>
+<div class="line"><a name="l11867"></a><span class="lineno">11867</span>     cpl_table   *sky;</div>
+<div class="line"><a name="l11868"></a><span class="lineno">11868</span>     <span class="keywordtype">double</span>      *sky_spectrum;</div>
+<div class="line"><a name="l11869"></a><span class="lineno">11869</span>     <span class="keywordtype">double</span>      *sky_wave;</div>
+<div class="line"><a name="l11870"></a><span class="lineno">11870</span>     <span class="keywordtype">float</span>       *data;</div>
+<div class="line"><a name="l11871"></a><span class="lineno">11871</span>     <span class="keywordtype">float</span>       *sdata;</div>
+<div class="line"><a name="l11872"></a><span class="lineno">11872</span>     <span class="keywordtype">float</span>       *kdata;</div>
+<div class="line"><a name="l11873"></a><span class="lineno">11873</span> </div>
+<div class="line"><a name="l11874"></a><span class="lineno">11874</span> </div>
+<div class="line"><a name="l11875"></a><span class="lineno">11875</span>     <span class="keywordflow">if</span> (spectra == NULL || wavemap == NULL || skymap == NULL) {</div>
+<div class="line"><a name="l11876"></a><span class="lineno">11876</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l11877"></a><span class="lineno">11877</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11878"></a><span class="lineno">11878</span>     }</div>
+<div class="line"><a name="l11879"></a><span class="lineno">11879</span>     </div>
+<div class="line"><a name="l11880"></a><span class="lineno">11880</span>     <span class="keywordflow">if</span> (dispersion <= 0.0) {</div>
+<div class="line"><a name="l11881"></a><span class="lineno">11881</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l11882"></a><span class="lineno">11882</span>         cpl_msg_error(func, <span class="stringliteral">"Negative dispersion: %s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l11883"></a><span class="lineno">11883</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11884"></a><span class="lineno">11884</span>     }</div>
+<div class="line"><a name="l11885"></a><span class="lineno">11885</span> </div>
+<div class="line"><a name="l11886"></a><span class="lineno">11886</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l11887"></a><span class="lineno">11887</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l11888"></a><span class="lineno">11888</span>     npix = nx * ny;</div>
+<div class="line"><a name="l11889"></a><span class="lineno">11889</span> </div>
+<div class="line"><a name="l11890"></a><span class="lineno">11890</span>     <span class="keywordflow">if</span> (nx != cpl_image_get_size_x(wavemap) ||</div>
+<div class="line"><a name="l11891"></a><span class="lineno">11891</span>         ny != cpl_image_get_size_y(wavemap) ||</div>
+<div class="line"><a name="l11892"></a><span class="lineno">11892</span>         nx != cpl_image_get_size_x(skymap) ||</div>
+<div class="line"><a name="l11893"></a><span class="lineno">11893</span>         ny != cpl_image_get_size_y(skymap)) {</div>
+<div class="line"><a name="l11894"></a><span class="lineno">11894</span>         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l11895"></a><span class="lineno">11895</span>         cpl_msg_error(func, <span class="stringliteral">"Image sizes: %s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l11896"></a><span class="lineno">11896</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11897"></a><span class="lineno">11897</span>     }</div>
+<div class="line"><a name="l11898"></a><span class="lineno">11898</span> </div>
+<div class="line"><a name="l11899"></a><span class="lineno">11899</span>     <span class="keywordflow">if</span> (factor < 1.0) {</div>
+<div class="line"><a name="l11900"></a><span class="lineno">11900</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l11901"></a><span class="lineno">11901</span>         cpl_msg_error(func, <span class="stringliteral">"Undersampling (%f): %s"</span>, factor, </div>
+<div class="line"><a name="l11902"></a><span class="lineno">11902</span>                       cpl_error_get_message());</div>
+<div class="line"><a name="l11903"></a><span class="lineno">11903</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11904"></a><span class="lineno">11904</span>     }</div>
+<div class="line"><a name="l11905"></a><span class="lineno">11905</span> </div>
+<div class="line"><a name="l11906"></a><span class="lineno">11906</span>     <span class="keywordflow">if</span> (minpoints < 0) {</div>
+<div class="line"><a name="l11907"></a><span class="lineno">11907</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l11908"></a><span class="lineno">11908</span>         cpl_msg_error(func, <span class="stringliteral">"Negative threshold: %s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l11909"></a><span class="lineno">11909</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11910"></a><span class="lineno">11910</span>     }</div>
+<div class="line"><a name="l11911"></a><span class="lineno">11911</span> </div>
+<div class="line"><a name="l11912"></a><span class="lineno">11912</span>     dispersion /= factor;</div>
+<div class="line"><a name="l11913"></a><span class="lineno">11913</span> </div>
+<div class="line"><a name="l11914"></a><span class="lineno">11914</span> </div>
+<div class="line"><a name="l11915"></a><span class="lineno">11915</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l11916"></a><span class="lineno">11916</span> <span class="comment">     * Find bluest and reddest wavelengths in the whole image</span></div>
+<div class="line"><a name="l11917"></a><span class="lineno">11917</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l11918"></a><span class="lineno">11918</span> </div>
+<div class="line"><a name="l11919"></a><span class="lineno">11919</span>     data = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l11920"></a><span class="lineno">11920</span> </div>
+<div class="line"><a name="l11921"></a><span class="lineno">11921</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l11922"></a><span class="lineno">11922</span>         <span class="keywordflow">if</span> (data[i] > 1.0) {</div>
+<div class="line"><a name="l11923"></a><span class="lineno">11923</span>             min = max = data[i];</div>
+<div class="line"><a name="l11924"></a><span class="lineno">11924</span>             j = i+1;</div>
+<div class="line"><a name="l11925"></a><span class="lineno">11925</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l11926"></a><span class="lineno">11926</span>         }</div>
+<div class="line"><a name="l11927"></a><span class="lineno">11927</span>     }</div>
+<div class="line"><a name="l11928"></a><span class="lineno">11928</span> </div>
+<div class="line"><a name="l11929"></a><span class="lineno">11929</span>     <span class="keywordflow">for</span> (i = j; i < npix; i++) {</div>
+<div class="line"><a name="l11930"></a><span class="lineno">11930</span>         <span class="keywordflow">if</span> (data[i] < 1.0)      <span class="comment">/* Impossible wavelength */</span></div>
+<div class="line"><a name="l11931"></a><span class="lineno">11931</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11932"></a><span class="lineno">11932</span>         <span class="keywordflow">if</span> (min > data[i])</div>
+<div class="line"><a name="l11933"></a><span class="lineno">11933</span>             min = data[i];</div>
+<div class="line"><a name="l11934"></a><span class="lineno">11934</span>         <span class="keywordflow">if</span> (max < data[i])</div>
+<div class="line"><a name="l11935"></a><span class="lineno">11935</span>             max = data[i];</div>
+<div class="line"><a name="l11936"></a><span class="lineno">11936</span>     }</div>
+<div class="line"><a name="l11937"></a><span class="lineno">11937</span> </div>
+<div class="line"><a name="l11938"></a><span class="lineno">11938</span>     firstLambda = min;</div>
+<div class="line"><a name="l11939"></a><span class="lineno">11939</span>     lastLambda = max;</div>
+<div class="line"><a name="l11940"></a><span class="lineno">11940</span> </div>
+<div class="line"><a name="l11941"></a><span class="lineno">11941</span> </div>
+<div class="line"><a name="l11942"></a><span class="lineno">11942</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l11943"></a><span class="lineno">11943</span> <span class="comment">     * Determine length of median spectrum</span></div>
+<div class="line"><a name="l11944"></a><span class="lineno">11944</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l11945"></a><span class="lineno">11945</span> </div>
+<div class="line"><a name="l11946"></a><span class="lineno">11946</span>     nbin = (lastLambda - firstLambda) / dispersion;</div>
+<div class="line"><a name="l11947"></a><span class="lineno">11947</span> </div>
+<div class="line"><a name="l11948"></a><span class="lineno">11948</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l11949"></a><span class="lineno">11949</span> <span class="comment">     * Count how many values will be found for each spectral bin.</span></div>
+<div class="line"><a name="l11950"></a><span class="lineno">11950</span> <span class="comment">     * The ith bin has a wavelength range from firstLambda + i*dispersion</span></div>
+<div class="line"><a name="l11951"></a><span class="lineno">11951</span> <span class="comment">     * (inclusive) to firstLambda + (i+1)*dispersion (exclusive), and</span></div>
+<div class="line"><a name="l11952"></a><span class="lineno">11952</span> <span class="comment">     * it is assigned to its central wavelength.</span></div>
+<div class="line"><a name="l11953"></a><span class="lineno">11953</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l11954"></a><span class="lineno">11954</span> </div>
+<div class="line"><a name="l11955"></a><span class="lineno">11955</span>     count = cpl_calloc(nbin, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l11956"></a><span class="lineno">11956</span> </div>
+<div class="line"><a name="l11957"></a><span class="lineno">11957</span>     data = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l11958"></a><span class="lineno">11958</span> </div>
+<div class="line"><a name="l11959"></a><span class="lineno">11959</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l11960"></a><span class="lineno">11960</span>         <span class="keywordflow">if</span> (data[i] < 1.0)</div>
+<div class="line"><a name="l11961"></a><span class="lineno">11961</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l11962"></a><span class="lineno">11962</span>         bin = (data[i] - firstLambda) / dispersion;</div>
+<div class="line"><a name="l11963"></a><span class="lineno">11963</span>         <span class="keywordflow">if</span> (bin < nbin)                               <span class="comment">/* Safer */</span></div>
+<div class="line"><a name="l11964"></a><span class="lineno">11964</span>             count[bin]++;</div>
+<div class="line"><a name="l11965"></a><span class="lineno">11965</span>     }</div>
+<div class="line"><a name="l11966"></a><span class="lineno">11966</span> </div>
+<div class="line"><a name="l11967"></a><span class="lineno">11967</span>     valid_bins = 0;</div>
+<div class="line"><a name="l11968"></a><span class="lineno">11968</span>     <span class="keywordflow">for</span> (i = 0; i < nbin; i++)</div>
+<div class="line"><a name="l11969"></a><span class="lineno">11969</span>         <span class="keywordflow">if</span> (count[i] >= minpoints)</div>
+<div class="line"><a name="l11970"></a><span class="lineno">11970</span>             valid_bins++;</div>
+<div class="line"><a name="l11971"></a><span class="lineno">11971</span> </div>
+<div class="line"><a name="l11972"></a><span class="lineno">11972</span>     <span class="keywordflow">if</span> (valid_bins < nbin/3) {</div>
+<div class="line"><a name="l11973"></a><span class="lineno">11973</span>         cpl_msg_warning(func, <span class="stringliteral">"Cannot determine a good global sky "</span></div>
+<div class="line"><a name="l11974"></a><span class="lineno">11974</span>                         <span class="stringliteral">"spectrum from input data"</span>);</div>
+<div class="line"><a name="l11975"></a><span class="lineno">11975</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l11976"></a><span class="lineno">11976</span>     }</div>
+<div class="line"><a name="l11977"></a><span class="lineno">11977</span> </div>
+<div class="line"><a name="l11978"></a><span class="lineno">11978</span> </div>
+<div class="line"><a name="l11979"></a><span class="lineno">11979</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l11980"></a><span class="lineno">11980</span> <span class="comment">     * Allocate an array of vectors with the appropriate size, to</span></div>
+<div class="line"><a name="l11981"></a><span class="lineno">11981</span> <span class="comment">     * contain a list of all the spectral pixels values. At the same</span></div>
+<div class="line"><a name="l11982"></a><span class="lineno">11982</span> <span class="comment">     * time, reset the array of counters (because we will have to</span></div>
+<div class="line"><a name="l11983"></a><span class="lineno">11983</span> <span class="comment">     * count again...).</span></div>
+<div class="line"><a name="l11984"></a><span class="lineno">11984</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l11985"></a><span class="lineno">11985</span> </div>
+<div class="line"><a name="l11986"></a><span class="lineno">11986</span>     vector = cpl_calloc(nbin, <span class="keyword">sizeof</span>(cpl_vector *));</div>
+<div class="line"><a name="l11987"></a><span class="lineno">11987</span>     wvector = cpl_calloc(nbin, <span class="keyword">sizeof</span>(cpl_vector *));</div>
+<div class="line"><a name="l11988"></a><span class="lineno">11988</span>     <span class="keywordflow">for</span> (i = 0; i < nbin; i++) {</div>
+<div class="line"><a name="l11989"></a><span class="lineno">11989</span>         <span class="keywordflow">if</span> (count[i] >= minpoints) {</div>
+<div class="line"><a name="l11990"></a><span class="lineno">11990</span>             vector[i] = cpl_vector_new(count[i]);</div>
+<div class="line"><a name="l11991"></a><span class="lineno">11991</span>             wvector[i] = cpl_vector_new(count[i]);</div>
+<div class="line"><a name="l11992"></a><span class="lineno">11992</span>         }</div>
+<div class="line"><a name="l11993"></a><span class="lineno">11993</span>         count[i] = 0;</div>
+<div class="line"><a name="l11994"></a><span class="lineno">11994</span>     }</div>
+<div class="line"><a name="l11995"></a><span class="lineno">11995</span> </div>
+<div class="line"><a name="l11996"></a><span class="lineno">11996</span> </div>
+<div class="line"><a name="l11997"></a><span class="lineno">11997</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l11998"></a><span class="lineno">11998</span> <span class="comment">     * Read the wavemap and the spectral images, and add the data values</span></div>
+<div class="line"><a name="l11999"></a><span class="lineno">11999</span> <span class="comment">     * to the appropriate wavelength bins</span></div>
+<div class="line"><a name="l12000"></a><span class="lineno">12000</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12001"></a><span class="lineno">12001</span> </div>
+<div class="line"><a name="l12002"></a><span class="lineno">12002</span>     data  = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l12003"></a><span class="lineno">12003</span>     sdata = cpl_image_get_data(spectra);</div>
+<div class="line"><a name="l12004"></a><span class="lineno">12004</span> </div>
+<div class="line"><a name="l12005"></a><span class="lineno">12005</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l12006"></a><span class="lineno">12006</span>         <span class="keywordflow">if</span> (data[i] < 1.0)</div>
+<div class="line"><a name="l12007"></a><span class="lineno">12007</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12008"></a><span class="lineno">12008</span>         bin = (data[i] - firstLambda) / dispersion;</div>
+<div class="line"><a name="l12009"></a><span class="lineno">12009</span>         <span class="keywordflow">if</span> (bin < nbin) {                             <span class="comment">/* Safer */</span></div>
+<div class="line"><a name="l12010"></a><span class="lineno">12010</span>             <span class="keywordflow">if</span> (vector[bin]) {</div>
+<div class="line"><a name="l12011"></a><span class="lineno">12011</span>                 cpl_vector_set(vector[bin], count[bin], sdata[i]);</div>
+<div class="line"><a name="l12012"></a><span class="lineno">12012</span>                 cpl_vector_set(wvector[bin], count[bin], data[i]);</div>
+<div class="line"><a name="l12013"></a><span class="lineno">12013</span>             }</div>
+<div class="line"><a name="l12014"></a><span class="lineno">12014</span>             count[bin]++;</div>
+<div class="line"><a name="l12015"></a><span class="lineno">12015</span>         }</div>
+<div class="line"><a name="l12016"></a><span class="lineno">12016</span>     }</div>
+<div class="line"><a name="l12017"></a><span class="lineno">12017</span> </div>
+<div class="line"><a name="l12018"></a><span class="lineno">12018</span> </div>
+<div class="line"><a name="l12019"></a><span class="lineno">12019</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12020"></a><span class="lineno">12020</span> <span class="comment">     * Compute the median flux for each wavelength bin, and destroy</span></div>
+<div class="line"><a name="l12021"></a><span class="lineno">12021</span> <span class="comment">     * at the same time the used vectors</span></div>
+<div class="line"><a name="l12022"></a><span class="lineno">12022</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12023"></a><span class="lineno">12023</span> </div>
+<div class="line"><a name="l12024"></a><span class="lineno">12024</span>     sky_spectrum = cpl_calloc(nbin, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l12025"></a><span class="lineno">12025</span>     sky_wave = cpl_calloc(nbin, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l12026"></a><span class="lineno">12026</span>     <span class="keywordflow">for</span> (i = 0; i < nbin; i++) {</div>
+<div class="line"><a name="l12027"></a><span class="lineno">12027</span>         <span class="keywordflow">if</span> (vector[i]) {</div>
+<div class="line"><a name="l12028"></a><span class="lineno">12028</span>             sky_spectrum[i] = cpl_vector_get_median_const(vector[i]);</div>
+<div class="line"><a name="l12029"></a><span class="lineno">12029</span>             sky_wave[i] = cpl_vector_get_median_const(wvector[i]);</div>
+<div class="line"><a name="l12030"></a><span class="lineno">12030</span>             cpl_vector_delete(vector[i]);</div>
+<div class="line"><a name="l12031"></a><span class="lineno">12031</span>             cpl_vector_delete(wvector[i]);</div>
+<div class="line"><a name="l12032"></a><span class="lineno">12032</span>         }</div>
+<div class="line"><a name="l12033"></a><span class="lineno">12033</span>     }</div>
+<div class="line"><a name="l12034"></a><span class="lineno">12034</span> </div>
+<div class="line"><a name="l12035"></a><span class="lineno">12035</span>     cpl_free(vector);</div>
+<div class="line"><a name="l12036"></a><span class="lineno">12036</span>     cpl_free(wvector);</div>
+<div class="line"><a name="l12037"></a><span class="lineno">12037</span> </div>
+<div class="line"><a name="l12038"></a><span class="lineno">12038</span> </div>
+<div class="line"><a name="l12039"></a><span class="lineno">12039</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12040"></a><span class="lineno">12040</span> <span class="comment">     * Here possible gaps in the final spectrum are filled by interpolation</span></div>
+<div class="line"><a name="l12041"></a><span class="lineno">12041</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12042"></a><span class="lineno">12042</span> </div>
+<div class="line"><a name="l12043"></a><span class="lineno">12043</span>     <span class="keywordflow">for</span> (i = 0; i < nbin; i++) {</div>
+<div class="line"><a name="l12044"></a><span class="lineno">12044</span>         <span class="keywordflow">if</span> (count[i] >= minpoints) {</div>
+<div class="line"><a name="l12045"></a><span class="lineno">12045</span>             first_valid = i;</div>
+<div class="line"><a name="l12046"></a><span class="lineno">12046</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l12047"></a><span class="lineno">12047</span>         }</div>
+<div class="line"><a name="l12048"></a><span class="lineno">12048</span>     }</div>
+<div class="line"><a name="l12049"></a><span class="lineno">12049</span>     </div>
+<div class="line"><a name="l12050"></a><span class="lineno">12050</span>     <span class="keywordflow">for</span> (i = first_valid; i < nbin; i++) {</div>
+<div class="line"><a name="l12051"></a><span class="lineno">12051</span>         <span class="keywordflow">if</span> (count[i] < minpoints) {</div>
+<div class="line"><a name="l12052"></a><span class="lineno">12052</span>             sky_wave[i] = firstLambda + (i+0.5)*dispersion;</div>
+<div class="line"><a name="l12053"></a><span class="lineno">12053</span>             <span class="keywordflow">for</span> (j = i+1; j < nbin; j++) {</div>
+<div class="line"><a name="l12054"></a><span class="lineno">12054</span>                 <span class="keywordflow">if</span> (count[j] >= minpoints) {</div>
+<div class="line"><a name="l12055"></a><span class="lineno">12055</span>                     <span class="keywordflow">if</span> (sky_wave[j] - sky_wave[i-1] < 0.1) {</div>
+<div class="line"><a name="l12056"></a><span class="lineno">12056</span>                         sky_spectrum[i] = (sky_spectrum[j] + sky_spectrum[i-1])</div>
+<div class="line"><a name="l12057"></a><span class="lineno">12057</span>                                         / 2;</div>
+<div class="line"><a name="l12058"></a><span class="lineno">12058</span>                     }</div>
+<div class="line"><a name="l12059"></a><span class="lineno">12059</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12060"></a><span class="lineno">12060</span>                         frac = (sky_wave[i] - sky_wave[i-1]) </div>
+<div class="line"><a name="l12061"></a><span class="lineno">12061</span>                              / (sky_wave[j] - sky_wave[i-1]);</div>
+<div class="line"><a name="l12062"></a><span class="lineno">12062</span>                         sky_spectrum[i] = frac * sky_spectrum[j]</div>
+<div class="line"><a name="l12063"></a><span class="lineno">12063</span>                                         + (1 - frac) * sky_spectrum[i-1];</div>
+<div class="line"><a name="l12064"></a><span class="lineno">12064</span>                     }</div>
+<div class="line"><a name="l12065"></a><span class="lineno">12065</span>                 }</div>
+<div class="line"><a name="l12066"></a><span class="lineno">12066</span>             }</div>
+<div class="line"><a name="l12067"></a><span class="lineno">12067</span>         }</div>
+<div class="line"><a name="l12068"></a><span class="lineno">12068</span>     }</div>
+<div class="line"><a name="l12069"></a><span class="lineno">12069</span> </div>
+<div class="line"><a name="l12070"></a><span class="lineno">12070</span> </div>
+<div class="line"><a name="l12071"></a><span class="lineno">12071</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12072"></a><span class="lineno">12072</span> <span class="comment">     * Create the output table</span></div>
+<div class="line"><a name="l12073"></a><span class="lineno">12073</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12074"></a><span class="lineno">12074</span> </div>
+<div class="line"><a name="l12075"></a><span class="lineno">12075</span>     sky = cpl_table_new(nbin);</div>
+<div class="line"><a name="l12076"></a><span class="lineno">12076</span>     cpl_table_wrap_double(sky, sky_wave, <span class="stringliteral">"wavelength"</span>);</div>
+<div class="line"><a name="l12077"></a><span class="lineno">12077</span>     cpl_table_wrap_double(sky, sky_spectrum, <span class="stringliteral">"sky"</span>);</div>
+<div class="line"><a name="l12078"></a><span class="lineno">12078</span>     cpl_table_wrap_int(sky, count, <span class="stringliteral">"npoints"</span>);</div>
+<div class="line"><a name="l12079"></a><span class="lineno">12079</span> </div>
+<div class="line"><a name="l12080"></a><span class="lineno">12080</span> </div>
+<div class="line"><a name="l12081"></a><span class="lineno">12081</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12082"></a><span class="lineno">12082</span> <span class="comment">     * Fill the sky map</span></div>
+<div class="line"><a name="l12083"></a><span class="lineno">12083</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12084"></a><span class="lineno">12084</span> </div>
+<div class="line"><a name="l12085"></a><span class="lineno">12085</span>     data  = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l12086"></a><span class="lineno">12086</span>     sdata = cpl_image_get_data(spectra);</div>
+<div class="line"><a name="l12087"></a><span class="lineno">12087</span>     kdata = cpl_image_get_data(skymap);</div>
+<div class="line"><a name="l12088"></a><span class="lineno">12088</span> </div>
+<div class="line"><a name="l12089"></a><span class="lineno">12089</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l12090"></a><span class="lineno">12090</span> </div>
+<div class="line"><a name="l12091"></a><span class="lineno">12091</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l12092"></a><span class="lineno">12092</span> <span class="comment">         * Currently based on linear interpolation</span></div>
+<div class="line"><a name="l12093"></a><span class="lineno">12093</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l12094"></a><span class="lineno">12094</span> </div>
+<div class="line"><a name="l12095"></a><span class="lineno">12095</span>         lambda = data[i];</div>
+<div class="line"><a name="l12096"></a><span class="lineno">12096</span>         <span class="keywordflow">if</span> (lambda < 1.0)</div>
+<div class="line"><a name="l12097"></a><span class="lineno">12097</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12098"></a><span class="lineno">12098</span>         bin = (lambda - firstLambda) / dispersion;</div>
+<div class="line"><a name="l12099"></a><span class="lineno">12099</span>         lambda1 = sky_wave[bin];</div>
+<div class="line"><a name="l12100"></a><span class="lineno">12100</span>         value1 = sky_spectrum[bin];</div>
+<div class="line"><a name="l12101"></a><span class="lineno">12101</span>         <span class="keywordflow">if</span> (lambda1 < lambda) {</div>
+<div class="line"><a name="l12102"></a><span class="lineno">12102</span>             bin++;</div>
+<div class="line"><a name="l12103"></a><span class="lineno">12103</span>             <span class="keywordflow">if</span> (bin < nbin) {</div>
+<div class="line"><a name="l12104"></a><span class="lineno">12104</span>                 lambda2 = sky_wave[bin];</div>
+<div class="line"><a name="l12105"></a><span class="lineno">12105</span>                 value2  = sky_spectrum[bin];</div>
+<div class="line"><a name="l12106"></a><span class="lineno">12106</span>                 <span class="keywordflow">if</span> (lambda2 - lambda1 < 0.1) {</div>
+<div class="line"><a name="l12107"></a><span class="lineno">12107</span>                     value = (value1 + value2) / 2;</div>
+<div class="line"><a name="l12108"></a><span class="lineno">12108</span>                 }</div>
+<div class="line"><a name="l12109"></a><span class="lineno">12109</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12110"></a><span class="lineno">12110</span>                     frac = (lambda - lambda1) / (lambda2 - lambda1);</div>
+<div class="line"><a name="l12111"></a><span class="lineno">12111</span>                     value = frac * value2 + (1 - frac) * value1;</div>
+<div class="line"><a name="l12112"></a><span class="lineno">12112</span>                 }</div>
+<div class="line"><a name="l12113"></a><span class="lineno">12113</span>             }</div>
+<div class="line"><a name="l12114"></a><span class="lineno">12114</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12115"></a><span class="lineno">12115</span>                 value = value1;</div>
+<div class="line"><a name="l12116"></a><span class="lineno">12116</span>             }</div>
+<div class="line"><a name="l12117"></a><span class="lineno">12117</span>         }</div>
+<div class="line"><a name="l12118"></a><span class="lineno">12118</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12119"></a><span class="lineno">12119</span>             <span class="keywordflow">if</span> (bin > 0) {</div>
+<div class="line"><a name="l12120"></a><span class="lineno">12120</span>                 bin--;</div>
+<div class="line"><a name="l12121"></a><span class="lineno">12121</span>                 lambda2 = lambda1;</div>
+<div class="line"><a name="l12122"></a><span class="lineno">12122</span>                 value2  = value1;</div>
+<div class="line"><a name="l12123"></a><span class="lineno">12123</span>                 lambda1 = sky_wave[bin];</div>
+<div class="line"><a name="l12124"></a><span class="lineno">12124</span>                 value1  = sky_spectrum[bin];</div>
+<div class="line"><a name="l12125"></a><span class="lineno">12125</span>                 <span class="keywordflow">if</span> (lambda2 - lambda1 < 0.1) {</div>
+<div class="line"><a name="l12126"></a><span class="lineno">12126</span>                     value = (value1 + value2) / 2;</div>
+<div class="line"><a name="l12127"></a><span class="lineno">12127</span>                 }</div>
+<div class="line"><a name="l12128"></a><span class="lineno">12128</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12129"></a><span class="lineno">12129</span>                     frac = (lambda - lambda1) / (lambda2 - lambda1);</div>
+<div class="line"><a name="l12130"></a><span class="lineno">12130</span>                     value = frac * value2 + (1 - frac) * value1;</div>
+<div class="line"><a name="l12131"></a><span class="lineno">12131</span>                 }</div>
+<div class="line"><a name="l12132"></a><span class="lineno">12132</span>             }</div>
+<div class="line"><a name="l12133"></a><span class="lineno">12133</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12134"></a><span class="lineno">12134</span>                 value = value1;</div>
+<div class="line"><a name="l12135"></a><span class="lineno">12135</span>             }</div>
+<div class="line"><a name="l12136"></a><span class="lineno">12136</span>         }</div>
+<div class="line"><a name="l12137"></a><span class="lineno">12137</span>         kdata[i] = value;</div>
+<div class="line"><a name="l12138"></a><span class="lineno">12138</span>     }</div>
+<div class="line"><a name="l12139"></a><span class="lineno">12139</span> </div>
+<div class="line"><a name="l12140"></a><span class="lineno">12140</span>     <span class="keywordflow">if</span> (first_valid)</div>
+<div class="line"><a name="l12141"></a><span class="lineno">12141</span>         cpl_table_erase_window(sky, 0, first_valid);</div>
+<div class="line"><a name="l12142"></a><span class="lineno">12142</span> </div>
+<div class="line"><a name="l12143"></a><span class="lineno">12143</span>     <span class="keywordflow">return</span> sky;</div>
+<div class="line"><a name="l12144"></a><span class="lineno">12144</span> </div>
+<div class="line"><a name="l12145"></a><span class="lineno">12145</span> }</div>
+<div class="line"><a name="l12146"></a><span class="lineno">12146</span> </div>
+<div class="line"><a name="l12147"></a><span class="lineno">12147</span> </div>
+<div class="line"><a name="l12181"></a><span class="lineno"><a class="code" href="group__moses.html#gab724daebffef27587b8183a6d765dc02">12181</a></span> cpl_table *<a class="code" href="group__moses.html#gab724daebffef27587b8183a6d765dc02" title="Create a CCD median sky map.">mos_sky_map</a>(cpl_image *spectra, cpl_image *wavemap,</div>
+<div class="line"><a name="l12182"></a><span class="lineno">12182</span>                        <span class="keywordtype">double</span> dispersion, cpl_image *skymap)</div>
+<div class="line"><a name="l12183"></a><span class="lineno">12183</span> {</div>
+<div class="line"><a name="l12184"></a><span class="lineno">12184</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_sky_map"</span>;</div>
+<div class="line"><a name="l12185"></a><span class="lineno">12185</span> </div>
+<div class="line"><a name="l12186"></a><span class="lineno">12186</span>     cpl_vector **vector;</div>
+<div class="line"><a name="l12187"></a><span class="lineno">12187</span>     <span class="keywordtype">double</span>       firstLambda, lastLambda;</div>
+<div class="line"><a name="l12188"></a><span class="lineno">12188</span>     <span class="keywordtype">double</span>       lambda, lambda1, lambda2;</div>
+<div class="line"><a name="l12189"></a><span class="lineno">12189</span>     <span class="keywordtype">double</span>       value, value1, value2;</div>
+<div class="line"><a name="l12190"></a><span class="lineno">12190</span>     <span class="keywordtype">float</span>        min, max;</div>
+<div class="line"><a name="l12191"></a><span class="lineno">12191</span>     <span class="keywordtype">int</span>         *count;</div>
+<div class="line"><a name="l12192"></a><span class="lineno">12192</span>     <span class="keywordtype">int</span>          nbin, bin;</div>
+<div class="line"><a name="l12193"></a><span class="lineno">12193</span>     <span class="keywordtype">int</span>          nx, ny, npix;</div>
+<div class="line"><a name="l12194"></a><span class="lineno">12194</span>     <span class="keywordtype">int</span>          i, j;</div>
+<div class="line"><a name="l12195"></a><span class="lineno">12195</span> </div>
+<div class="line"><a name="l12196"></a><span class="lineno">12196</span>     cpl_table   *sky;</div>
+<div class="line"><a name="l12197"></a><span class="lineno">12197</span>     <span class="keywordtype">double</span>      *sky_spectrum;</div>
+<div class="line"><a name="l12198"></a><span class="lineno">12198</span>     <span class="keywordtype">float</span>       *data;</div>
+<div class="line"><a name="l12199"></a><span class="lineno">12199</span>     <span class="keywordtype">float</span>       *sdata;</div>
+<div class="line"><a name="l12200"></a><span class="lineno">12200</span>     <span class="keywordtype">float</span>       *kdata;</div>
+<div class="line"><a name="l12201"></a><span class="lineno">12201</span>     <span class="keywordtype">double</span>      *wdata;</div>
+<div class="line"><a name="l12202"></a><span class="lineno">12202</span> </div>
+<div class="line"><a name="l12203"></a><span class="lineno">12203</span> </div>
+<div class="line"><a name="l12204"></a><span class="lineno">12204</span>     <span class="keywordflow">if</span> (spectra == NULL || wavemap == NULL || skymap == NULL) {</div>
+<div class="line"><a name="l12205"></a><span class="lineno">12205</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l12206"></a><span class="lineno">12206</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l12207"></a><span class="lineno">12207</span>     }</div>
+<div class="line"><a name="l12208"></a><span class="lineno">12208</span>     </div>
+<div class="line"><a name="l12209"></a><span class="lineno">12209</span>     <span class="keywordflow">if</span> (dispersion <= 0.0) {</div>
+<div class="line"><a name="l12210"></a><span class="lineno">12210</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l12211"></a><span class="lineno">12211</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l12212"></a><span class="lineno">12212</span>     }</div>
+<div class="line"><a name="l12213"></a><span class="lineno">12213</span> </div>
+<div class="line"><a name="l12214"></a><span class="lineno">12214</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l12215"></a><span class="lineno">12215</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l12216"></a><span class="lineno">12216</span>     npix = nx * ny;</div>
+<div class="line"><a name="l12217"></a><span class="lineno">12217</span> </div>
+<div class="line"><a name="l12218"></a><span class="lineno">12218</span>     <span class="keywordflow">if</span> (nx != cpl_image_get_size_x(wavemap) ||</div>
+<div class="line"><a name="l12219"></a><span class="lineno">12219</span>         ny != cpl_image_get_size_y(wavemap) ||</div>
+<div class="line"><a name="l12220"></a><span class="lineno">12220</span>         nx != cpl_image_get_size_x(skymap) ||</div>
+<div class="line"><a name="l12221"></a><span class="lineno">12221</span>         ny != cpl_image_get_size_y(skymap)) {</div>
+<div class="line"><a name="l12222"></a><span class="lineno">12222</span>         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l12223"></a><span class="lineno">12223</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l12224"></a><span class="lineno">12224</span>     }</div>
+<div class="line"><a name="l12225"></a><span class="lineno">12225</span> </div>
+<div class="line"><a name="l12226"></a><span class="lineno">12226</span> </div>
+<div class="line"><a name="l12227"></a><span class="lineno">12227</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12228"></a><span class="lineno">12228</span> <span class="comment">     * Find bluest and reddest wavelengths in the whole image</span></div>
+<div class="line"><a name="l12229"></a><span class="lineno">12229</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12230"></a><span class="lineno">12230</span> </div>
+<div class="line"><a name="l12231"></a><span class="lineno">12231</span>     data = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l12232"></a><span class="lineno">12232</span> </div>
+<div class="line"><a name="l12233"></a><span class="lineno">12233</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l12234"></a><span class="lineno">12234</span>         <span class="keywordflow">if</span> (data[i] > 1.0) {</div>
+<div class="line"><a name="l12235"></a><span class="lineno">12235</span>             min = max = data[i];</div>
+<div class="line"><a name="l12236"></a><span class="lineno">12236</span>             j = i+1;</div>
+<div class="line"><a name="l12237"></a><span class="lineno">12237</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l12238"></a><span class="lineno">12238</span>         }</div>
+<div class="line"><a name="l12239"></a><span class="lineno">12239</span>     }</div>
+<div class="line"><a name="l12240"></a><span class="lineno">12240</span> </div>
+<div class="line"><a name="l12241"></a><span class="lineno">12241</span>     <span class="keywordflow">for</span> (i = j; i < npix; i++) {</div>
+<div class="line"><a name="l12242"></a><span class="lineno">12242</span>         <span class="keywordflow">if</span> (data[i] < 1.0)      <span class="comment">/* Impossible wavelength */</span></div>
+<div class="line"><a name="l12243"></a><span class="lineno">12243</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12244"></a><span class="lineno">12244</span>         <span class="keywordflow">if</span> (min > data[i])</div>
+<div class="line"><a name="l12245"></a><span class="lineno">12245</span>             min = data[i];</div>
+<div class="line"><a name="l12246"></a><span class="lineno">12246</span>         <span class="keywordflow">if</span> (max < data[i])</div>
+<div class="line"><a name="l12247"></a><span class="lineno">12247</span>             max = data[i];</div>
+<div class="line"><a name="l12248"></a><span class="lineno">12248</span>     }</div>
+<div class="line"><a name="l12249"></a><span class="lineno">12249</span> </div>
+<div class="line"><a name="l12250"></a><span class="lineno">12250</span>     firstLambda = min;</div>
+<div class="line"><a name="l12251"></a><span class="lineno">12251</span>     lastLambda = max;</div>
+<div class="line"><a name="l12252"></a><span class="lineno">12252</span> </div>
+<div class="line"><a name="l12253"></a><span class="lineno">12253</span> </div>
+<div class="line"><a name="l12254"></a><span class="lineno">12254</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12255"></a><span class="lineno">12255</span> <span class="comment">     * Determine length of median spectrum</span></div>
+<div class="line"><a name="l12256"></a><span class="lineno">12256</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12257"></a><span class="lineno">12257</span> </div>
+<div class="line"><a name="l12258"></a><span class="lineno">12258</span>     nbin = (lastLambda - firstLambda) / dispersion;</div>
+<div class="line"><a name="l12259"></a><span class="lineno">12259</span> </div>
+<div class="line"><a name="l12260"></a><span class="lineno">12260</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12261"></a><span class="lineno">12261</span> <span class="comment">     * Count how many values will be found for each spectral bin.</span></div>
+<div class="line"><a name="l12262"></a><span class="lineno">12262</span> <span class="comment">     * The ith bin has a wavelength range from firstLambda + i*dispersion</span></div>
+<div class="line"><a name="l12263"></a><span class="lineno">12263</span> <span class="comment">     * (inclusive) to firstLambda + (i+1)*dispersion (exclusive), and</span></div>
+<div class="line"><a name="l12264"></a><span class="lineno">12264</span> <span class="comment">     * it is assigned to its central wavelength.</span></div>
+<div class="line"><a name="l12265"></a><span class="lineno">12265</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12266"></a><span class="lineno">12266</span> </div>
+<div class="line"><a name="l12267"></a><span class="lineno">12267</span>     count = cpl_calloc(nbin, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l12268"></a><span class="lineno">12268</span> </div>
+<div class="line"><a name="l12269"></a><span class="lineno">12269</span>     data = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l12270"></a><span class="lineno">12270</span> </div>
+<div class="line"><a name="l12271"></a><span class="lineno">12271</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l12272"></a><span class="lineno">12272</span>         <span class="keywordflow">if</span> (data[i] < 1.0)</div>
+<div class="line"><a name="l12273"></a><span class="lineno">12273</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12274"></a><span class="lineno">12274</span>         bin = (data[i] - firstLambda) / dispersion;</div>
+<div class="line"><a name="l12275"></a><span class="lineno">12275</span>         <span class="keywordflow">if</span> (bin < nbin)                               <span class="comment">/* Safer */</span></div>
+<div class="line"><a name="l12276"></a><span class="lineno">12276</span>             count[bin]++;</div>
+<div class="line"><a name="l12277"></a><span class="lineno">12277</span>     }</div>
+<div class="line"><a name="l12278"></a><span class="lineno">12278</span> </div>
+<div class="line"><a name="l12279"></a><span class="lineno">12279</span> </div>
+<div class="line"><a name="l12280"></a><span class="lineno">12280</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12281"></a><span class="lineno">12281</span> <span class="comment">     * Allocate an array of vectors with the appropriate size, to</span></div>
+<div class="line"><a name="l12282"></a><span class="lineno">12282</span> <span class="comment">     * contain a list of all the spectral pixels values. At the same</span></div>
+<div class="line"><a name="l12283"></a><span class="lineno">12283</span> <span class="comment">     * time, reset the array of counters (because we will have to</span></div>
+<div class="line"><a name="l12284"></a><span class="lineno">12284</span> <span class="comment">     * count again...).</span></div>
+<div class="line"><a name="l12285"></a><span class="lineno">12285</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12286"></a><span class="lineno">12286</span> </div>
+<div class="line"><a name="l12287"></a><span class="lineno">12287</span>     vector = cpl_calloc(nbin, <span class="keyword">sizeof</span>(cpl_vector *));</div>
+<div class="line"><a name="l12288"></a><span class="lineno">12288</span>     <span class="keywordflow">for</span> (i = 0; i < nbin; i++) {</div>
+<div class="line"><a name="l12289"></a><span class="lineno">12289</span>         <span class="keywordflow">if</span> (count[i])</div>
+<div class="line"><a name="l12290"></a><span class="lineno">12290</span>             vector[i] = cpl_vector_new(count[i]);</div>
+<div class="line"><a name="l12291"></a><span class="lineno">12291</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l12292"></a><span class="lineno">12292</span>             vector[i] = NULL;</div>
+<div class="line"><a name="l12293"></a><span class="lineno">12293</span>         count[i] = 0;</div>
+<div class="line"><a name="l12294"></a><span class="lineno">12294</span>     }</div>
+<div class="line"><a name="l12295"></a><span class="lineno">12295</span> </div>
+<div class="line"><a name="l12296"></a><span class="lineno">12296</span> </div>
+<div class="line"><a name="l12297"></a><span class="lineno">12297</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12298"></a><span class="lineno">12298</span> <span class="comment">     * Read the wavemap and the spectral images, and add the data values</span></div>
+<div class="line"><a name="l12299"></a><span class="lineno">12299</span> <span class="comment">     * to the appropriate wavelength bins</span></div>
+<div class="line"><a name="l12300"></a><span class="lineno">12300</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12301"></a><span class="lineno">12301</span> </div>
+<div class="line"><a name="l12302"></a><span class="lineno">12302</span>     data  = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l12303"></a><span class="lineno">12303</span>     sdata = cpl_image_get_data(spectra);</div>
+<div class="line"><a name="l12304"></a><span class="lineno">12304</span> </div>
+<div class="line"><a name="l12305"></a><span class="lineno">12305</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l12306"></a><span class="lineno">12306</span>         <span class="keywordflow">if</span> (data[i] < 1.0)</div>
+<div class="line"><a name="l12307"></a><span class="lineno">12307</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12308"></a><span class="lineno">12308</span>         bin = (data[i] - firstLambda) / dispersion;</div>
+<div class="line"><a name="l12309"></a><span class="lineno">12309</span>         <span class="keywordflow">if</span> (bin < nbin) {                             <span class="comment">/* Safer */</span></div>
+<div class="line"><a name="l12310"></a><span class="lineno">12310</span>             cpl_vector_set(vector[bin], count[bin], sdata[i]);</div>
+<div class="line"><a name="l12311"></a><span class="lineno">12311</span>             count[bin]++;</div>
+<div class="line"><a name="l12312"></a><span class="lineno">12312</span>         }</div>
+<div class="line"><a name="l12313"></a><span class="lineno">12313</span>     }</div>
+<div class="line"><a name="l12314"></a><span class="lineno">12314</span> </div>
+<div class="line"><a name="l12315"></a><span class="lineno">12315</span> </div>
+<div class="line"><a name="l12316"></a><span class="lineno">12316</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12317"></a><span class="lineno">12317</span> <span class="comment">     * Compute the median flux for each wavelength bin, and destroy</span></div>
+<div class="line"><a name="l12318"></a><span class="lineno">12318</span> <span class="comment">     * at the same time the used vectors</span></div>
+<div class="line"><a name="l12319"></a><span class="lineno">12319</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12320"></a><span class="lineno">12320</span> </div>
+<div class="line"><a name="l12321"></a><span class="lineno">12321</span>     sky_spectrum = cpl_calloc(nbin, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l12322"></a><span class="lineno">12322</span>     <span class="keywordflow">for</span> (i = 0; i < nbin; i++) {</div>
+<div class="line"><a name="l12323"></a><span class="lineno">12323</span>         <span class="keywordflow">if</span> (vector[i]) {</div>
+<div class="line"><a name="l12324"></a><span class="lineno">12324</span>             sky_spectrum[i] = cpl_vector_get_median_const(vector[i]);</div>
+<div class="line"><a name="l12325"></a><span class="lineno">12325</span>             cpl_vector_delete(vector[i]);</div>
+<div class="line"><a name="l12326"></a><span class="lineno">12326</span>         }</div>
+<div class="line"><a name="l12327"></a><span class="lineno">12327</span>     }</div>
+<div class="line"><a name="l12328"></a><span class="lineno">12328</span> </div>
+<div class="line"><a name="l12329"></a><span class="lineno">12329</span>     cpl_free(vector);</div>
+<div class="line"><a name="l12330"></a><span class="lineno">12330</span> </div>
+<div class="line"><a name="l12331"></a><span class="lineno">12331</span> </div>
+<div class="line"><a name="l12332"></a><span class="lineno">12332</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12333"></a><span class="lineno">12333</span> <span class="comment">     * Here possible gaps in the final spectrum should be filled</span></div>
+<div class="line"><a name="l12334"></a><span class="lineno">12334</span> <span class="comment">     * by interpolation</span></div>
+<div class="line"><a name="l12335"></a><span class="lineno">12335</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12336"></a><span class="lineno">12336</span> </div>
+<div class="line"><a name="l12337"></a><span class="lineno">12337</span>     <span class="comment">/* ... */</span></div>
+<div class="line"><a name="l12338"></a><span class="lineno">12338</span> </div>
+<div class="line"><a name="l12339"></a><span class="lineno">12339</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12340"></a><span class="lineno">12340</span> <span class="comment">     * Create the output table</span></div>
+<div class="line"><a name="l12341"></a><span class="lineno">12341</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12342"></a><span class="lineno">12342</span> </div>
+<div class="line"><a name="l12343"></a><span class="lineno">12343</span>     sky = cpl_table_new(nbin);</div>
+<div class="line"><a name="l12344"></a><span class="lineno">12344</span>     cpl_table_new_column(sky, <span class="stringliteral">"wavelength"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l12345"></a><span class="lineno">12345</span>     cpl_table_set_column_unit(sky, <span class="stringliteral">"wavelength"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l12346"></a><span class="lineno">12346</span>     cpl_table_wrap_double(sky, sky_spectrum, <span class="stringliteral">"sky"</span>);</div>
+<div class="line"><a name="l12347"></a><span class="lineno">12347</span>     cpl_table_wrap_int(sky, count, <span class="stringliteral">"npoints"</span>);</div>
+<div class="line"><a name="l12348"></a><span class="lineno">12348</span>     <span class="keywordflow">for</span> (i = 0; i < nbin; i++)</div>
+<div class="line"><a name="l12349"></a><span class="lineno">12349</span>         cpl_table_set_double(sky, <span class="stringliteral">"wavelength"</span>, i, </div>
+<div class="line"><a name="l12350"></a><span class="lineno">12350</span>                              firstLambda + (i+0.5)*dispersion);</div>
+<div class="line"><a name="l12351"></a><span class="lineno">12351</span> </div>
+<div class="line"><a name="l12352"></a><span class="lineno">12352</span> </div>
+<div class="line"><a name="l12353"></a><span class="lineno">12353</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12354"></a><span class="lineno">12354</span> <span class="comment">     * Fill the sky map</span></div>
+<div class="line"><a name="l12355"></a><span class="lineno">12355</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12356"></a><span class="lineno">12356</span> </div>
+<div class="line"><a name="l12357"></a><span class="lineno">12357</span>     data  = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l12358"></a><span class="lineno">12358</span>     sdata = cpl_image_get_data(spectra);</div>
+<div class="line"><a name="l12359"></a><span class="lineno">12359</span>     kdata = cpl_image_get_data(skymap);</div>
+<div class="line"><a name="l12360"></a><span class="lineno">12360</span>     wdata = cpl_table_get_data_double(sky, <span class="stringliteral">"wavelength"</span>);</div>
+<div class="line"><a name="l12361"></a><span class="lineno">12361</span> </div>
+<div class="line"><a name="l12362"></a><span class="lineno">12362</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l12363"></a><span class="lineno">12363</span> </div>
+<div class="line"><a name="l12364"></a><span class="lineno">12364</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l12365"></a><span class="lineno">12365</span> <span class="comment">         * Currently based on linear interpolation</span></div>
+<div class="line"><a name="l12366"></a><span class="lineno">12366</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l12367"></a><span class="lineno">12367</span> </div>
+<div class="line"><a name="l12368"></a><span class="lineno">12368</span>         lambda = data[i];</div>
+<div class="line"><a name="l12369"></a><span class="lineno">12369</span>         <span class="keywordflow">if</span> (lambda < 1.0)</div>
+<div class="line"><a name="l12370"></a><span class="lineno">12370</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12371"></a><span class="lineno">12371</span>         bin = (lambda - firstLambda) / dispersion;</div>
+<div class="line"><a name="l12372"></a><span class="lineno">12372</span>         lambda1 = wdata[bin];</div>
+<div class="line"><a name="l12373"></a><span class="lineno">12373</span>         value1 = sky_spectrum[bin];</div>
+<div class="line"><a name="l12374"></a><span class="lineno">12374</span>         <span class="keywordflow">if</span> (lambda1 < lambda) {</div>
+<div class="line"><a name="l12375"></a><span class="lineno">12375</span>             bin++;</div>
+<div class="line"><a name="l12376"></a><span class="lineno">12376</span>             <span class="keywordflow">if</span> (bin < nbin) {</div>
+<div class="line"><a name="l12377"></a><span class="lineno">12377</span>                 lambda2 = wdata[bin];</div>
+<div class="line"><a name="l12378"></a><span class="lineno">12378</span>                 value2  = sky_spectrum[bin];</div>
+<div class="line"><a name="l12379"></a><span class="lineno">12379</span>                 value   = ((lambda2 - lambda)*value1 </div>
+<div class="line"><a name="l12380"></a><span class="lineno">12380</span>                         +  (lambda - lambda1)*value2) / dispersion;</div>
+<div class="line"><a name="l12381"></a><span class="lineno">12381</span>             }</div>
+<div class="line"><a name="l12382"></a><span class="lineno">12382</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12383"></a><span class="lineno">12383</span>                 value = value1;</div>
+<div class="line"><a name="l12384"></a><span class="lineno">12384</span>             }</div>
+<div class="line"><a name="l12385"></a><span class="lineno">12385</span>         }</div>
+<div class="line"><a name="l12386"></a><span class="lineno">12386</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12387"></a><span class="lineno">12387</span>             <span class="keywordflow">if</span> (bin > 0) {</div>
+<div class="line"><a name="l12388"></a><span class="lineno">12388</span>                 bin--;</div>
+<div class="line"><a name="l12389"></a><span class="lineno">12389</span>                 lambda2 = lambda1;</div>
+<div class="line"><a name="l12390"></a><span class="lineno">12390</span>                 value2  = value1;</div>
+<div class="line"><a name="l12391"></a><span class="lineno">12391</span>                 lambda1 = wdata[bin];</div>
+<div class="line"><a name="l12392"></a><span class="lineno">12392</span>                 value1  = sky_spectrum[bin];</div>
+<div class="line"><a name="l12393"></a><span class="lineno">12393</span>                 value   = ((lambda2 - lambda)*value1 </div>
+<div class="line"><a name="l12394"></a><span class="lineno">12394</span>                         +  (lambda - lambda1)*value2)/dispersion;</div>
+<div class="line"><a name="l12395"></a><span class="lineno">12395</span>             }</div>
+<div class="line"><a name="l12396"></a><span class="lineno">12396</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12397"></a><span class="lineno">12397</span>                 value = value1;</div>
+<div class="line"><a name="l12398"></a><span class="lineno">12398</span>             }</div>
+<div class="line"><a name="l12399"></a><span class="lineno">12399</span>         }</div>
+<div class="line"><a name="l12400"></a><span class="lineno">12400</span>         kdata[i] = value;</div>
+<div class="line"><a name="l12401"></a><span class="lineno">12401</span>     }</div>
+<div class="line"><a name="l12402"></a><span class="lineno">12402</span> </div>
+<div class="line"><a name="l12403"></a><span class="lineno">12403</span>     <span class="keywordflow">return</span> sky;</div>
+<div class="line"><a name="l12404"></a><span class="lineno">12404</span> </div>
+<div class="line"><a name="l12405"></a><span class="lineno">12405</span> }</div>
+<div class="line"><a name="l12406"></a><span class="lineno">12406</span> </div>
+<div class="line"><a name="l12407"></a><span class="lineno">12407</span> </div>
+<div class="line"><a name="l12423"></a><span class="lineno"><a class="code" href="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8">12423</a></span> cpl_image *<a class="code" href="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8" title="Local determination of sky.">mos_sky_local_old</a>(cpl_image *spectra, cpl_table *slits)</div>
+<div class="line"><a name="l12424"></a><span class="lineno">12424</span> {</div>
+<div class="line"><a name="l12425"></a><span class="lineno">12425</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_sky_local_old"</span>;</div>
+<div class="line"><a name="l12426"></a><span class="lineno">12426</span> </div>
+<div class="line"><a name="l12427"></a><span class="lineno">12427</span>     cpl_image *exslit;</div>
+<div class="line"><a name="l12428"></a><span class="lineno">12428</span>     cpl_image *sky;</div>
+<div class="line"><a name="l12429"></a><span class="lineno">12429</span>     cpl_image *skymap;</div>
+<div class="line"><a name="l12430"></a><span class="lineno">12430</span>     <span class="keywordtype">float</span>     *data;</div>
+<div class="line"><a name="l12431"></a><span class="lineno">12431</span>     <span class="keywordtype">float</span>     *sdata;</div>
+<div class="line"><a name="l12432"></a><span class="lineno">12432</span>     <span class="keywordtype">int</span>        nx, ny;</div>
+<div class="line"><a name="l12433"></a><span class="lineno">12433</span>     <span class="keywordtype">int</span>        xlow, ylow, xhig, yhig;</div>
+<div class="line"><a name="l12434"></a><span class="lineno">12434</span>     <span class="keywordtype">int</span>        nslits;</div>
+<div class="line"><a name="l12435"></a><span class="lineno">12435</span>     <span class="keywordtype">int</span>       *slit_id;</div>
+<div class="line"><a name="l12436"></a><span class="lineno">12436</span>     <span class="keywordtype">int</span>       *position;</div>
+<div class="line"><a name="l12437"></a><span class="lineno">12437</span>     <span class="keywordtype">int</span>       *length;</div>
+<div class="line"><a name="l12438"></a><span class="lineno">12438</span>     <span class="keywordtype">int</span>        i, j, k;</div>
+<div class="line"><a name="l12439"></a><span class="lineno">12439</span> </div>
+<div class="line"><a name="l12440"></a><span class="lineno">12440</span> </div>
+<div class="line"><a name="l12441"></a><span class="lineno">12441</span>     <span class="keywordflow">if</span> (spectra == NULL) {</div>
+<div class="line"><a name="l12442"></a><span class="lineno">12442</span>         cpl_msg_error(func, </div>
+<div class="line"><a name="l12443"></a><span class="lineno">12443</span>                       <span class="stringliteral">"A scientific rectified spectral image must be given"</span>);</div>
+<div class="line"><a name="l12444"></a><span class="lineno">12444</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l12445"></a><span class="lineno">12445</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l12446"></a><span class="lineno">12446</span>     }</div>
+<div class="line"><a name="l12447"></a><span class="lineno">12447</span> </div>
+<div class="line"><a name="l12448"></a><span class="lineno">12448</span>     <span class="keywordflow">if</span> (slits == NULL) {</div>
+<div class="line"><a name="l12449"></a><span class="lineno">12449</span>         cpl_msg_error(func, <span class="stringliteral">"A slits position table must be given"</span>);</div>
+<div class="line"><a name="l12450"></a><span class="lineno">12450</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l12451"></a><span class="lineno">12451</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l12452"></a><span class="lineno">12452</span>     }</div>
+<div class="line"><a name="l12453"></a><span class="lineno">12453</span> </div>
+<div class="line"><a name="l12454"></a><span class="lineno">12454</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l12455"></a><span class="lineno">12455</span>     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l12456"></a><span class="lineno">12456</span>     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);</div>
+<div class="line"><a name="l12457"></a><span class="lineno">12457</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l12458"></a><span class="lineno">12458</span> </div>
+<div class="line"><a name="l12459"></a><span class="lineno">12459</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l12460"></a><span class="lineno">12460</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l12461"></a><span class="lineno">12461</span> </div>
+<div class="line"><a name="l12462"></a><span class="lineno">12462</span>     skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l12463"></a><span class="lineno">12463</span> </div>
+<div class="line"><a name="l12464"></a><span class="lineno">12464</span>     xlow = 1;</div>
+<div class="line"><a name="l12465"></a><span class="lineno">12465</span>     xhig = nx;</div>
+<div class="line"><a name="l12466"></a><span class="lineno">12466</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l12467"></a><span class="lineno">12467</span> </div>
+<div class="line"><a name="l12468"></a><span class="lineno">12468</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l12469"></a><span class="lineno">12469</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12470"></a><span class="lineno">12470</span> </div>
+<div class="line"><a name="l12471"></a><span class="lineno">12471</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l12472"></a><span class="lineno">12472</span> <span class="comment">         * Define the extraction boundaries. We DON'T write:</span></div>
+<div class="line"><a name="l12473"></a><span class="lineno">12473</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l12474"></a><span class="lineno">12474</span> <span class="comment">         * ylow = position[i];</span></div>
+<div class="line"><a name="l12475"></a><span class="lineno">12475</span> <span class="comment">         * yhig = ylow + length[i];</span></div>
+<div class="line"><a name="l12476"></a><span class="lineno">12476</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l12477"></a><span class="lineno">12477</span> <span class="comment">         * because the cpl_image pixels are counted from 1, and because in</span></div>
+<div class="line"><a name="l12478"></a><span class="lineno">12478</span> <span class="comment">         * cpl_image_extract() the coordinates of the last pixel are inclusive.</span></div>
+<div class="line"><a name="l12479"></a><span class="lineno">12479</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l12480"></a><span class="lineno">12480</span> </div>
+<div class="line"><a name="l12481"></a><span class="lineno">12481</span>         ylow = position[i] + 1;</div>
+<div class="line"><a name="l12482"></a><span class="lineno">12482</span>         yhig = ylow + length[i] - 1;</div>
+<div class="line"><a name="l12483"></a><span class="lineno">12483</span> </div>
+<div class="line"><a name="l12484"></a><span class="lineno">12484</span>         exslit = cpl_image_extract(spectra, xlow, ylow, xhig, yhig);</div>
+<div class="line"><a name="l12485"></a><span class="lineno">12485</span>         sky    = cpl_image_collapse_median_create(exslit, 0, 0, 1);</div>
+<div class="line"><a name="l12486"></a><span class="lineno">12486</span>         cpl_image_delete(exslit);</div>
+<div class="line"><a name="l12487"></a><span class="lineno">12487</span> </div>
+<div class="line"><a name="l12488"></a><span class="lineno">12488</span>         data   = cpl_image_get_data(skymap);</div>
+<div class="line"><a name="l12489"></a><span class="lineno">12489</span>         data  += nx * position[i];</div>
+<div class="line"><a name="l12490"></a><span class="lineno">12490</span> </div>
+<div class="line"><a name="l12491"></a><span class="lineno">12491</span>         <span class="keywordflow">for</span> (j = 0; j < length[i]; j++) {</div>
+<div class="line"><a name="l12492"></a><span class="lineno">12492</span>             sdata  = cpl_image_get_data(sky);</div>
+<div class="line"><a name="l12493"></a><span class="lineno">12493</span>             <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l12494"></a><span class="lineno">12494</span>                 *data++ = *sdata++;</div>
+<div class="line"><a name="l12495"></a><span class="lineno">12495</span>             }</div>
+<div class="line"><a name="l12496"></a><span class="lineno">12496</span>         }</div>
+<div class="line"><a name="l12497"></a><span class="lineno">12497</span> </div>
+<div class="line"><a name="l12498"></a><span class="lineno">12498</span>         cpl_image_delete(sky);</div>
+<div class="line"><a name="l12499"></a><span class="lineno">12499</span>     }</div>
+<div class="line"><a name="l12500"></a><span class="lineno">12500</span> </div>
+<div class="line"><a name="l12501"></a><span class="lineno">12501</span>     <span class="keywordflow">return</span> skymap;</div>
+<div class="line"><a name="l12502"></a><span class="lineno">12502</span> </div>
+<div class="line"><a name="l12503"></a><span class="lineno">12503</span> }</div>
+<div class="line"><a name="l12504"></a><span class="lineno">12504</span> </div>
+<div class="line"><a name="l12505"></a><span class="lineno">12505</span> </div>
+<div class="line"><a name="l12525"></a><span class="lineno"><a class="code" href="group__moses.html#ga40e43aa1516aac5fc7e2ccc41381677d">12525</a></span> cpl_image *<a class="code" href="group__moses.html#ga40e43aa1516aac5fc7e2ccc41381677d" title="Local determination of sky.">mos_sky_local</a>(cpl_image *spectra, cpl_table *slits, <span class="keywordtype">int</span> order)</div>
+<div class="line"><a name="l12526"></a><span class="lineno">12526</span> {</div>
+<div class="line"><a name="l12527"></a><span class="lineno">12527</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_sky_local"</span>;</div>
+<div class="line"><a name="l12528"></a><span class="lineno">12528</span> </div>
+<div class="line"><a name="l12529"></a><span class="lineno">12529</span>     <span class="keywordtype">char</span>        name[MAX_COLNAME];</div>
+<div class="line"><a name="l12530"></a><span class="lineno">12530</span> </div>
+<div class="line"><a name="l12531"></a><span class="lineno">12531</span>     cpl_polynomial *fit;</div>
+<div class="line"><a name="l12532"></a><span class="lineno">12532</span>     cpl_vector     *points;</div>
+<div class="line"><a name="l12533"></a><span class="lineno">12533</span>     cpl_vector     *values;</div>
+<div class="line"><a name="l12534"></a><span class="lineno">12534</span>     cpl_vector     *keep_points;</div>
+<div class="line"><a name="l12535"></a><span class="lineno">12535</span>     cpl_vector     *keep_values;</div>
+<div class="line"><a name="l12536"></a><span class="lineno">12536</span>     cpl_image      *exslit;</div>
+<div class="line"><a name="l12537"></a><span class="lineno">12537</span>     cpl_image      *sky;</div>
+<div class="line"><a name="l12538"></a><span class="lineno">12538</span>     cpl_image      *subtracted;</div>
+<div class="line"><a name="l12539"></a><span class="lineno">12539</span>     cpl_image      *profile;</div>
+<div class="line"><a name="l12540"></a><span class="lineno">12540</span>     cpl_image      *skymap;</div>
+<div class="line"><a name="l12541"></a><span class="lineno">12541</span>     cpl_table      *objects;</div>
+<div class="line"><a name="l12542"></a><span class="lineno">12542</span>     <span class="keywordtype">float</span>          *data;</div>
+<div class="line"><a name="l12543"></a><span class="lineno">12543</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l12544"></a><span class="lineno">12544</span>     <span class="keywordtype">float</span>          *xdata;</div>
+<div class="line"><a name="l12545"></a><span class="lineno">12545</span>     <span class="keywordtype">double</span>         *vdata;</div>
+<div class="line"><a name="l12546"></a><span class="lineno">12546</span>     <span class="keywordtype">double</span>         *pdata;</div>
+<div class="line"><a name="l12547"></a><span class="lineno">12547</span>     <span class="keywordtype">double</span>          median;</div>
+<div class="line"><a name="l12548"></a><span class="lineno">12548</span>     <span class="keywordtype">int</span>             nx, ny;</div>
+<div class="line"><a name="l12549"></a><span class="lineno">12549</span>     <span class="keywordtype">int</span>             xlow, ylow, xhig, yhig;</div>
+<div class="line"><a name="l12550"></a><span class="lineno">12550</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l12551"></a><span class="lineno">12551</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l12552"></a><span class="lineno">12552</span>     <span class="keywordtype">int</span>            *position;</div>
+<div class="line"><a name="l12553"></a><span class="lineno">12553</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l12554"></a><span class="lineno">12554</span>     <span class="keywordtype">int</span>            *is_sky;</div>
+<div class="line"><a name="l12555"></a><span class="lineno">12555</span>     <span class="keywordtype">int</span>             nsky, nbad;</div>
+<div class="line"><a name="l12556"></a><span class="lineno">12556</span>     <span class="keywordtype">int</span>             maxobjects;</div>
+<div class="line"><a name="l12557"></a><span class="lineno">12557</span>     <span class="keywordtype">int</span>             margin = 3;</div>
+<div class="line"><a name="l12558"></a><span class="lineno">12558</span>     <span class="keywordtype">int</span>             radius = 6;</div>
+<div class="line"><a name="l12559"></a><span class="lineno">12559</span>     <span class="keywordtype">int</span>             i, j, k;</div>
+<div class="line"><a name="l12560"></a><span class="lineno">12560</span> </div>
+<div class="line"><a name="l12561"></a><span class="lineno">12561</span> </div>
+<div class="line"><a name="l12562"></a><span class="lineno">12562</span>     <span class="keywordflow">if</span> (spectra == NULL) {</div>
+<div class="line"><a name="l12563"></a><span class="lineno">12563</span>         cpl_msg_error(func, </div>
+<div class="line"><a name="l12564"></a><span class="lineno">12564</span>                       <span class="stringliteral">"A scientific rectified spectral image must be given"</span>);</div>
+<div class="line"><a name="l12565"></a><span class="lineno">12565</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l12566"></a><span class="lineno">12566</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l12567"></a><span class="lineno">12567</span>     }</div>
+<div class="line"><a name="l12568"></a><span class="lineno">12568</span> </div>
+<div class="line"><a name="l12569"></a><span class="lineno">12569</span>     <span class="keywordflow">if</span> (slits == NULL) {</div>
+<div class="line"><a name="l12570"></a><span class="lineno">12570</span>         cpl_msg_error(func, <span class="stringliteral">"A slits position table must be given"</span>);</div>
+<div class="line"><a name="l12571"></a><span class="lineno">12571</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l12572"></a><span class="lineno">12572</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l12573"></a><span class="lineno">12573</span>     }</div>
+<div class="line"><a name="l12574"></a><span class="lineno">12574</span> </div>
+<div class="line"><a name="l12575"></a><span class="lineno">12575</span>     <span class="keywordflow">if</span> (order < 0) {</div>
+<div class="line"><a name="l12576"></a><span class="lineno">12576</span>         cpl_msg_error(func, <span class="stringliteral">"Invalid fit order"</span>);</div>
+<div class="line"><a name="l12577"></a><span class="lineno">12577</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l12578"></a><span class="lineno">12578</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l12579"></a><span class="lineno">12579</span>     }</div>
+<div class="line"><a name="l12580"></a><span class="lineno">12580</span> </div>
+<div class="line"><a name="l12581"></a><span class="lineno">12581</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l12582"></a><span class="lineno">12582</span>     slit_id  = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l12583"></a><span class="lineno">12583</span>     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);</div>
+<div class="line"><a name="l12584"></a><span class="lineno">12584</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l12585"></a><span class="lineno">12585</span> </div>
+<div class="line"><a name="l12586"></a><span class="lineno">12586</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l12587"></a><span class="lineno">12587</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l12588"></a><span class="lineno">12588</span> </div>
+<div class="line"><a name="l12589"></a><span class="lineno">12589</span>     skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l12590"></a><span class="lineno">12590</span> </div>
+<div class="line"><a name="l12591"></a><span class="lineno">12591</span>     xlow = 1;</div>
+<div class="line"><a name="l12592"></a><span class="lineno">12592</span>     xhig = nx;</div>
+<div class="line"><a name="l12593"></a><span class="lineno">12593</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l12594"></a><span class="lineno">12594</span> </div>
+<div class="line"><a name="l12595"></a><span class="lineno">12595</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l12596"></a><span class="lineno">12596</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12597"></a><span class="lineno">12597</span> </div>
+<div class="line"><a name="l12598"></a><span class="lineno">12598</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l12599"></a><span class="lineno">12599</span> <span class="comment">         * Define the extraction boundaries. We DON'T write:</span></div>
+<div class="line"><a name="l12600"></a><span class="lineno">12600</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l12601"></a><span class="lineno">12601</span> <span class="comment">         * ylow = position[i];</span></div>
+<div class="line"><a name="l12602"></a><span class="lineno">12602</span> <span class="comment">         * yhig = ylow + length[i];</span></div>
+<div class="line"><a name="l12603"></a><span class="lineno">12603</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l12604"></a><span class="lineno">12604</span> <span class="comment">         * because the cpl_image pixels are counted from 1, and because in</span></div>
+<div class="line"><a name="l12605"></a><span class="lineno">12605</span> <span class="comment">         * cpl_image_extract() the coordinates of the last pixel are inclusive.</span></div>
+<div class="line"><a name="l12606"></a><span class="lineno">12606</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l12607"></a><span class="lineno">12607</span> </div>
+<div class="line"><a name="l12608"></a><span class="lineno">12608</span>         ylow = position[i] + 1;</div>
+<div class="line"><a name="l12609"></a><span class="lineno">12609</span>         yhig = ylow + length[i] - 1;</div>
+<div class="line"><a name="l12610"></a><span class="lineno">12610</span> </div>
+<div class="line"><a name="l12611"></a><span class="lineno">12611</span>         exslit = cpl_image_extract(spectra, xlow, ylow, xhig, yhig);</div>
+<div class="line"><a name="l12612"></a><span class="lineno">12612</span>         sky    = cpl_image_collapse_median_create(exslit, 0, 0, 1);</div>
+<div class="line"><a name="l12613"></a><span class="lineno">12613</span>         cpl_image_delete(exslit);</div>
+<div class="line"><a name="l12614"></a><span class="lineno">12614</span> </div>
+<div class="line"><a name="l12615"></a><span class="lineno">12615</span>         data   = cpl_image_get_data(skymap);</div>
+<div class="line"><a name="l12616"></a><span class="lineno">12616</span>         data  += nx * position[i];</div>
+<div class="line"><a name="l12617"></a><span class="lineno">12617</span> </div>
+<div class="line"><a name="l12618"></a><span class="lineno">12618</span>         <span class="keywordflow">for</span> (j = 0; j < length[i]; j++) {</div>
+<div class="line"><a name="l12619"></a><span class="lineno">12619</span>             sdata  = cpl_image_get_data(sky);</div>
+<div class="line"><a name="l12620"></a><span class="lineno">12620</span>             <span class="keywordflow">for</span> (k = 0; k < nx; k++) {</div>
+<div class="line"><a name="l12621"></a><span class="lineno">12621</span>                 *data++ = *sdata++;</div>
+<div class="line"><a name="l12622"></a><span class="lineno">12622</span>             }</div>
+<div class="line"><a name="l12623"></a><span class="lineno">12623</span>         }</div>
+<div class="line"><a name="l12624"></a><span class="lineno">12624</span> </div>
+<div class="line"><a name="l12625"></a><span class="lineno">12625</span>         cpl_image_delete(sky);</div>
+<div class="line"><a name="l12626"></a><span class="lineno">12626</span>     }</div>
+<div class="line"><a name="l12627"></a><span class="lineno">12627</span> </div>
+<div class="line"><a name="l12628"></a><span class="lineno">12628</span> </div>
+<div class="line"><a name="l12629"></a><span class="lineno">12629</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12630"></a><span class="lineno">12630</span> <span class="comment">     * Preliminary sky-subtracted image</span></div>
+<div class="line"><a name="l12631"></a><span class="lineno">12631</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12632"></a><span class="lineno">12632</span> </div>
+<div class="line"><a name="l12633"></a><span class="lineno">12633</span>     subtracted = cpl_image_duplicate(spectra);</div>
+<div class="line"><a name="l12634"></a><span class="lineno">12634</span>     cpl_image_subtract(subtracted, skymap);</div>
+<div class="line"><a name="l12635"></a><span class="lineno">12635</span>     cpl_image_delete(skymap);</div>
+<div class="line"><a name="l12636"></a><span class="lineno">12636</span> </div>
+<div class="line"><a name="l12637"></a><span class="lineno">12637</span> </div>
+<div class="line"><a name="l12638"></a><span class="lineno">12638</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12639"></a><span class="lineno">12639</span> <span class="comment">     * Detect objects positions in all slits</span></div>
+<div class="line"><a name="l12640"></a><span class="lineno">12640</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12641"></a><span class="lineno">12641</span> </div>
+<div class="line"><a name="l12642"></a><span class="lineno">12642</span>     objects = cpl_table_duplicate(slits);</div>
+<div class="line"><a name="l12643"></a><span class="lineno">12643</span>     profile = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(subtracted, objects, margin, radius, 0);</div>
+<div class="line"><a name="l12644"></a><span class="lineno">12644</span>     cpl_image_delete(profile);</div>
+<div class="line"><a name="l12645"></a><span class="lineno">12645</span>     cpl_image_delete(subtracted);</div>
+<div class="line"><a name="l12646"></a><span class="lineno">12646</span> </div>
+<div class="line"><a name="l12647"></a><span class="lineno">12647</span> </div>
+<div class="line"><a name="l12648"></a><span class="lineno">12648</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12649"></a><span class="lineno">12649</span> <span class="comment">     * Flag the sky pixels. Note that maxobjects is intentionally </span></div>
+<div class="line"><a name="l12650"></a><span class="lineno">12650</span> <span class="comment">     * the max number of objects increased by one.</span></div>
+<div class="line"><a name="l12651"></a><span class="lineno">12651</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12652"></a><span class="lineno">12652</span> </div>
+<div class="line"><a name="l12653"></a><span class="lineno">12653</span>     maxobjects = 1;</div>
+<div class="line"><a name="l12654"></a><span class="lineno">12654</span>     snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, maxobjects);</div>
+<div class="line"><a name="l12655"></a><span class="lineno">12655</span>     <span class="keywordflow">while</span> (cpl_table_has_column(objects, name)) {</div>
+<div class="line"><a name="l12656"></a><span class="lineno">12656</span>         maxobjects++;</div>
+<div class="line"><a name="l12657"></a><span class="lineno">12657</span>         snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, maxobjects);</div>
+<div class="line"><a name="l12658"></a><span class="lineno">12658</span>     }</div>
+<div class="line"><a name="l12659"></a><span class="lineno">12659</span> </div>
+<div class="line"><a name="l12660"></a><span class="lineno">12660</span>     is_sky = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l12661"></a><span class="lineno">12661</span> </div>
+<div class="line"><a name="l12662"></a><span class="lineno">12662</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l12663"></a><span class="lineno">12663</span> </div>
+<div class="line"><a name="l12664"></a><span class="lineno">12664</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l12665"></a><span class="lineno">12665</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12666"></a><span class="lineno">12666</span> </div>
+<div class="line"><a name="l12667"></a><span class="lineno">12667</span>         ylow = position[i] + margin;</div>
+<div class="line"><a name="l12668"></a><span class="lineno">12668</span>         yhig = position[i] + length[i] - margin;</div>
+<div class="line"><a name="l12669"></a><span class="lineno">12669</span> </div>
+<div class="line"><a name="l12670"></a><span class="lineno">12670</span>         <span class="keywordflow">for</span> (j = ylow; j < yhig; j++)</div>
+<div class="line"><a name="l12671"></a><span class="lineno">12671</span>             is_sky[j] = 1;</div>
+<div class="line"><a name="l12672"></a><span class="lineno">12672</span> </div>
+<div class="line"><a name="l12673"></a><span class="lineno">12673</span>         <span class="keywordflow">for</span> (j = 1; j < maxobjects; j++) {</div>
+<div class="line"><a name="l12674"></a><span class="lineno">12674</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, j);</div>
+<div class="line"><a name="l12675"></a><span class="lineno">12675</span>             <span class="keywordflow">if</span> (cpl_table_is_valid(objects, name, i)) {</div>
+<div class="line"><a name="l12676"></a><span class="lineno">12676</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"start_%d"</span>, j);</div>
+<div class="line"><a name="l12677"></a><span class="lineno">12677</span>                 ylow = cpl_table_get_int(objects, name, i, NULL);</div>
+<div class="line"><a name="l12678"></a><span class="lineno">12678</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"end_%d"</span>, j);</div>
+<div class="line"><a name="l12679"></a><span class="lineno">12679</span>                 yhig = cpl_table_get_int(objects, name, i, NULL);</div>
+<div class="line"><a name="l12680"></a><span class="lineno">12680</span>                 <span class="keywordflow">for</span> (k = ylow; k <= yhig; k++)</div>
+<div class="line"><a name="l12681"></a><span class="lineno">12681</span>                     is_sky[k] = 0;</div>
+<div class="line"><a name="l12682"></a><span class="lineno">12682</span>             }</div>
+<div class="line"><a name="l12683"></a><span class="lineno">12683</span>         }</div>
+<div class="line"><a name="l12684"></a><span class="lineno">12684</span> </div>
+<div class="line"><a name="l12685"></a><span class="lineno">12685</span> </div>
+<div class="line"><a name="l12686"></a><span class="lineno">12686</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l12687"></a><span class="lineno">12687</span> <span class="comment">         * Eliminate isolated sky points</span></div>
+<div class="line"><a name="l12688"></a><span class="lineno">12688</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l12689"></a><span class="lineno">12689</span> </div>
+<div class="line"><a name="l12690"></a><span class="lineno">12690</span>         ylow = position[i] + margin + 1;</div>
+<div class="line"><a name="l12691"></a><span class="lineno">12691</span>         yhig = position[i] + length[i] - margin - 1;</div>
+<div class="line"><a name="l12692"></a><span class="lineno">12692</span> </div>
+<div class="line"><a name="l12693"></a><span class="lineno">12693</span>         <span class="keywordflow">for</span> (j = ylow; j < yhig; j++)</div>
+<div class="line"><a name="l12694"></a><span class="lineno">12694</span>             <span class="keywordflow">if</span> (is_sky[j])</div>
+<div class="line"><a name="l12695"></a><span class="lineno">12695</span>                 <span class="keywordflow">if</span> (is_sky[j-1] == 0 && is_sky[j+1] == 0)</div>
+<div class="line"><a name="l12696"></a><span class="lineno">12696</span>                     is_sky[j] = 0;</div>
+<div class="line"><a name="l12697"></a><span class="lineno">12697</span> </div>
+<div class="line"><a name="l12698"></a><span class="lineno">12698</span>     }</div>
+<div class="line"><a name="l12699"></a><span class="lineno">12699</span> </div>
+<div class="line"><a name="l12700"></a><span class="lineno">12700</span> </div>
+<div class="line"><a name="l12701"></a><span class="lineno">12701</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12702"></a><span class="lineno">12702</span> <span class="comment">     * Determination of the sky map</span></div>
+<div class="line"><a name="l12703"></a><span class="lineno">12703</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12704"></a><span class="lineno">12704</span> </div>
+<div class="line"><a name="l12705"></a><span class="lineno">12705</span>     skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l12706"></a><span class="lineno">12706</span> </div>
+<div class="line"><a name="l12707"></a><span class="lineno">12707</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l12708"></a><span class="lineno">12708</span> </div>
+<div class="line"><a name="l12709"></a><span class="lineno">12709</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l12710"></a><span class="lineno">12710</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12711"></a><span class="lineno">12711</span> </div>
+<div class="line"><a name="l12712"></a><span class="lineno">12712</span>         ylow = position[i];</div>
+<div class="line"><a name="l12713"></a><span class="lineno">12713</span>         yhig = ylow + length[i];</div>
+<div class="line"><a name="l12714"></a><span class="lineno">12714</span> </div>
+<div class="line"><a name="l12715"></a><span class="lineno">12715</span>         nsky = 0;</div>
+<div class="line"><a name="l12716"></a><span class="lineno">12716</span>         <span class="keywordflow">for</span> (j = ylow; j < yhig; j++)</div>
+<div class="line"><a name="l12717"></a><span class="lineno">12717</span>             <span class="keywordflow">if</span> (is_sky[j])</div>
+<div class="line"><a name="l12718"></a><span class="lineno">12718</span>                 nsky++;</div>
+<div class="line"><a name="l12719"></a><span class="lineno">12719</span> </div>
+<div class="line"><a name="l12720"></a><span class="lineno">12720</span>         <span class="keywordflow">if</span> (nsky > order + 1) {</div>
+<div class="line"><a name="l12721"></a><span class="lineno">12721</span>             <span class="keywordflow">if</span> (order) {</div>
+<div class="line"><a name="l12722"></a><span class="lineno">12722</span>                 points = cpl_vector_new(nsky);</div>
+<div class="line"><a name="l12723"></a><span class="lineno">12723</span>                 nsky = 0;</div>
+<div class="line"><a name="l12724"></a><span class="lineno">12724</span>                 <span class="keywordflow">for</span> (j = ylow; j < yhig; j++) {</div>
+<div class="line"><a name="l12725"></a><span class="lineno">12725</span>                     <span class="keywordflow">if</span> (is_sky[j]) {</div>
+<div class="line"><a name="l12726"></a><span class="lineno">12726</span>                         cpl_vector_set(points, nsky, j);</div>
+<div class="line"><a name="l12727"></a><span class="lineno">12727</span>                         nsky++;</div>
+<div class="line"><a name="l12728"></a><span class="lineno">12728</span>                     }</div>
+<div class="line"><a name="l12729"></a><span class="lineno">12729</span>                 }</div>
+<div class="line"><a name="l12730"></a><span class="lineno">12730</span> </div>
+<div class="line"><a name="l12731"></a><span class="lineno">12731</span>                 exslit = cpl_image_extract(spectra, 1, ylow+1, nx, yhig);</div>
+<div class="line"><a name="l12732"></a><span class="lineno">12732</span>                 xdata = cpl_image_get_data(exslit);</div>
+<div class="line"><a name="l12733"></a><span class="lineno">12733</span>                 values = cpl_vector_new(nsky);</div>
+<div class="line"><a name="l12734"></a><span class="lineno">12734</span> </div>
+<div class="line"><a name="l12735"></a><span class="lineno">12735</span>                 <span class="keywordflow">for</span> (j = 0; j < nx; j++) {</div>
+<div class="line"><a name="l12736"></a><span class="lineno">12736</span>                     nsky = 0;</div>
+<div class="line"><a name="l12737"></a><span class="lineno">12737</span>                     <span class="keywordflow">for</span> (k = ylow; k < yhig; k++) {</div>
+<div class="line"><a name="l12738"></a><span class="lineno">12738</span>                         <span class="keywordflow">if</span> (is_sky[k]) {</div>
+<div class="line"><a name="l12739"></a><span class="lineno">12739</span>                             cpl_vector_set(values, nsky, xdata[j+(k-ylow)*nx]);</div>
+<div class="line"><a name="l12740"></a><span class="lineno">12740</span>                             nsky++;</div>
+<div class="line"><a name="l12741"></a><span class="lineno">12741</span>                         }</div>
+<div class="line"><a name="l12742"></a><span class="lineno">12742</span>                     }</div>
+<div class="line"><a name="l12743"></a><span class="lineno">12743</span> </div>
+<div class="line"><a name="l12744"></a><span class="lineno">12744</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l12745"></a><span class="lineno">12745</span> <span class="comment">                     * Eliminate obvious outliers</span></div>
+<div class="line"><a name="l12746"></a><span class="lineno">12746</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l12747"></a><span class="lineno">12747</span> </div>
+<div class="line"><a name="l12748"></a><span class="lineno">12748</span>                     median = cpl_vector_get_median_const(values);</div>
+<div class="line"><a name="l12749"></a><span class="lineno">12749</span>                     vdata = cpl_vector_get_data(values);</div>
+<div class="line"><a name="l12750"></a><span class="lineno">12750</span>                     pdata = cpl_vector_get_data(points);</div>
+<div class="line"><a name="l12751"></a><span class="lineno">12751</span>                     nbad = 0;</div>
+<div class="line"><a name="l12752"></a><span class="lineno">12752</span>                     <span class="keywordflow">for</span> (k = 0; k < nsky; k++) {</div>
+<div class="line"><a name="l12753"></a><span class="lineno">12753</span>                         <span class="keywordflow">if</span> (fabs(vdata[k] - median) < 100) {</div>
+<div class="line"><a name="l12754"></a><span class="lineno">12754</span>                             <span class="keywordflow">if</span> (nbad) {</div>
+<div class="line"><a name="l12755"></a><span class="lineno">12755</span>                                 vdata[k-nbad] = vdata[k];</div>
+<div class="line"><a name="l12756"></a><span class="lineno">12756</span>                                 pdata[k-nbad] = pdata[k];</div>
+<div class="line"><a name="l12757"></a><span class="lineno">12757</span>                             }</div>
+<div class="line"><a name="l12758"></a><span class="lineno">12758</span>                         }</div>
+<div class="line"><a name="l12759"></a><span class="lineno">12759</span>                         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l12760"></a><span class="lineno">12760</span>                             nbad++;</div>
+<div class="line"><a name="l12761"></a><span class="lineno">12761</span>                     }</div>
+<div class="line"><a name="l12762"></a><span class="lineno">12762</span> </div>
+<div class="line"><a name="l12763"></a><span class="lineno">12763</span>                     <span class="keywordflow">if</span> (nsky == nbad)</div>
+<div class="line"><a name="l12764"></a><span class="lineno">12764</span>                         <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l12765"></a><span class="lineno">12765</span> </div>
+<div class="line"><a name="l12766"></a><span class="lineno">12766</span>                     <span class="keywordflow">if</span> (nbad && nsky - nbad > order + 1) {</div>
+<div class="line"><a name="l12767"></a><span class="lineno">12767</span>                         keep_values = values;</div>
+<div class="line"><a name="l12768"></a><span class="lineno">12768</span>                         keep_points = points;</div>
+<div class="line"><a name="l12769"></a><span class="lineno">12769</span>                         values = cpl_vector_wrap(nsky-nbad, vdata);</div>
+<div class="line"><a name="l12770"></a><span class="lineno">12770</span>                         points = cpl_vector_wrap(nsky-nbad, pdata);</div>
+<div class="line"><a name="l12771"></a><span class="lineno">12771</span>                     }</div>
+<div class="line"><a name="l12772"></a><span class="lineno">12772</span> </div>
+<div class="line"><a name="l12773"></a><span class="lineno">12773</span>                     <span class="keywordflow">if</span> (nsky - nbad > order + 1) {</div>
+<div class="line"><a name="l12774"></a><span class="lineno">12774</span> </div>
+<div class="line"><a name="l12775"></a><span class="lineno">12775</span>                         fit = cpl_polynomial_fit_1d_create(points, values, </div>
+<div class="line"><a name="l12776"></a><span class="lineno">12776</span>                                                            order, NULL);</div>
+<div class="line"><a name="l12777"></a><span class="lineno">12777</span> </div>
+<div class="line"><a name="l12778"></a><span class="lineno">12778</span>                         <span class="keywordflow">if</span> (fit) {</div>
+<div class="line"><a name="l12779"></a><span class="lineno">12779</span>                             <span class="keywordflow">for</span> (k = ylow; k < yhig; k++) {</div>
+<div class="line"><a name="l12780"></a><span class="lineno">12780</span>                                 xdata[j+(k-ylow)*nx] = </div>
+<div class="line"><a name="l12781"></a><span class="lineno">12781</span>                                          cpl_polynomial_eval_1d(fit, k, NULL);</div>
+<div class="line"><a name="l12782"></a><span class="lineno">12782</span>                             }</div>
+<div class="line"><a name="l12783"></a><span class="lineno">12783</span> </div>
+<div class="line"><a name="l12784"></a><span class="lineno">12784</span>                             cpl_polynomial_delete(fit);</div>
+<div class="line"><a name="l12785"></a><span class="lineno">12785</span>                         }</div>
+<div class="line"><a name="l12786"></a><span class="lineno">12786</span>                         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l12787"></a><span class="lineno">12787</span>                             cpl_error_reset();</div>
+<div class="line"><a name="l12788"></a><span class="lineno">12788</span>                     }</div>
+<div class="line"><a name="l12789"></a><span class="lineno">12789</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12790"></a><span class="lineno">12790</span>                         <span class="keywordflow">for</span> (k = 0; k < nsky; k++) {</div>
+<div class="line"><a name="l12791"></a><span class="lineno">12791</span>                             xdata[j+k*nx] = median;</div>
+<div class="line"><a name="l12792"></a><span class="lineno">12792</span>                         }</div>
+<div class="line"><a name="l12793"></a><span class="lineno">12793</span>                     }</div>
+<div class="line"><a name="l12794"></a><span class="lineno">12794</span> </div>
+<div class="line"><a name="l12795"></a><span class="lineno">12795</span>                     <span class="keywordflow">if</span> (nbad && nsky - nbad > order + 1) {</div>
+<div class="line"><a name="l12796"></a><span class="lineno">12796</span>                         cpl_vector_unwrap(values);</div>
+<div class="line"><a name="l12797"></a><span class="lineno">12797</span>                         cpl_vector_unwrap(points);</div>
+<div class="line"><a name="l12798"></a><span class="lineno">12798</span>                         values = keep_values;</div>
+<div class="line"><a name="l12799"></a><span class="lineno">12799</span>                         points = keep_points;</div>
+<div class="line"><a name="l12800"></a><span class="lineno">12800</span>                     }</div>
+<div class="line"><a name="l12801"></a><span class="lineno">12801</span> </div>
+<div class="line"><a name="l12802"></a><span class="lineno">12802</span>                     <span class="keywordflow">if</span> (nbad) {</div>
+<div class="line"><a name="l12803"></a><span class="lineno">12803</span>                         nsky = 0;</div>
+<div class="line"><a name="l12804"></a><span class="lineno">12804</span>                         <span class="keywordflow">for</span> (k = ylow; k < yhig; k++) {</div>
+<div class="line"><a name="l12805"></a><span class="lineno">12805</span>                             <span class="keywordflow">if</span> (is_sky[k]) {</div>
+<div class="line"><a name="l12806"></a><span class="lineno">12806</span>                                 cpl_vector_set(points, nsky, k);</div>
+<div class="line"><a name="l12807"></a><span class="lineno">12807</span>                                 nsky++;</div>
+<div class="line"><a name="l12808"></a><span class="lineno">12808</span>                             }</div>
+<div class="line"><a name="l12809"></a><span class="lineno">12809</span>                         }</div>
+<div class="line"><a name="l12810"></a><span class="lineno">12810</span>                     }</div>
+<div class="line"><a name="l12811"></a><span class="lineno">12811</span> </div>
+<div class="line"><a name="l12812"></a><span class="lineno">12812</span>                 }</div>
+<div class="line"><a name="l12813"></a><span class="lineno">12813</span> </div>
+<div class="line"><a name="l12814"></a><span class="lineno">12814</span>                 cpl_vector_delete(values);</div>
+<div class="line"><a name="l12815"></a><span class="lineno">12815</span>                 cpl_vector_delete(points);</div>
+<div class="line"><a name="l12816"></a><span class="lineno">12816</span> </div>
+<div class="line"><a name="l12817"></a><span class="lineno">12817</span>                 cpl_image_copy(skymap, exslit, 1, ylow+1);</div>
+<div class="line"><a name="l12818"></a><span class="lineno">12818</span>                 cpl_image_delete(exslit);</div>
+<div class="line"><a name="l12819"></a><span class="lineno">12819</span> </div>
+<div class="line"><a name="l12820"></a><span class="lineno">12820</span>             }</div>
+<div class="line"><a name="l12821"></a><span class="lineno">12821</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l12822"></a><span class="lineno">12822</span>                 exslit = cpl_image_extract(spectra, 1, ylow+1, nx, yhig);</div>
+<div class="line"><a name="l12823"></a><span class="lineno">12823</span>                 xdata = cpl_image_get_data(exslit);</div>
+<div class="line"><a name="l12824"></a><span class="lineno">12824</span>                 values = cpl_vector_new(nsky);</div>
+<div class="line"><a name="l12825"></a><span class="lineno">12825</span> </div>
+<div class="line"><a name="l12826"></a><span class="lineno">12826</span>                 <span class="keywordflow">for</span> (j = 0; j < nx; j++) {</div>
+<div class="line"><a name="l12827"></a><span class="lineno">12827</span>                     nsky = 0;</div>
+<div class="line"><a name="l12828"></a><span class="lineno">12828</span>                     <span class="keywordflow">for</span> (k = ylow; k < yhig; k++) {</div>
+<div class="line"><a name="l12829"></a><span class="lineno">12829</span>                         <span class="keywordflow">if</span> (is_sky[k]) {</div>
+<div class="line"><a name="l12830"></a><span class="lineno">12830</span>                             cpl_vector_set(values, nsky, xdata[j+(k-ylow)*nx]);</div>
+<div class="line"><a name="l12831"></a><span class="lineno">12831</span>                             nsky++;</div>
+<div class="line"><a name="l12832"></a><span class="lineno">12832</span>                         }</div>
+<div class="line"><a name="l12833"></a><span class="lineno">12833</span>                     }</div>
+<div class="line"><a name="l12834"></a><span class="lineno">12834</span> </div>
+<div class="line"><a name="l12835"></a><span class="lineno">12835</span>                     median = cpl_vector_get_median_const(values);</div>
+<div class="line"><a name="l12836"></a><span class="lineno">12836</span> </div>
+<div class="line"><a name="l12837"></a><span class="lineno">12837</span>                     <span class="keywordflow">for</span> (k = ylow; k < yhig; k++)</div>
+<div class="line"><a name="l12838"></a><span class="lineno">12838</span>                         xdata[j+(k-ylow)*nx] = median;</div>
+<div class="line"><a name="l12839"></a><span class="lineno">12839</span> </div>
+<div class="line"><a name="l12840"></a><span class="lineno">12840</span>                 }</div>
+<div class="line"><a name="l12841"></a><span class="lineno">12841</span> </div>
+<div class="line"><a name="l12842"></a><span class="lineno">12842</span>                 cpl_vector_delete(values);</div>
+<div class="line"><a name="l12843"></a><span class="lineno">12843</span> </div>
+<div class="line"><a name="l12844"></a><span class="lineno">12844</span>                 cpl_image_copy(skymap, exslit, 1, ylow+1);</div>
+<div class="line"><a name="l12845"></a><span class="lineno">12845</span>                 cpl_image_delete(exslit);</div>
+<div class="line"><a name="l12846"></a><span class="lineno">12846</span>             }</div>
+<div class="line"><a name="l12847"></a><span class="lineno">12847</span>         }</div>
+<div class="line"><a name="l12848"></a><span class="lineno">12848</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l12849"></a><span class="lineno">12849</span>             cpl_msg_warning(func, <span class="stringliteral">"Too few sky points in slit %d"</span>, i + 1);</div>
+<div class="line"><a name="l12850"></a><span class="lineno">12850</span>     }</div>
+<div class="line"><a name="l12851"></a><span class="lineno">12851</span> </div>
+<div class="line"><a name="l12852"></a><span class="lineno">12852</span>     cpl_free(is_sky);</div>
+<div class="line"><a name="l12853"></a><span class="lineno">12853</span> </div>
+<div class="line"><a name="l12854"></a><span class="lineno">12854</span>     <span class="keywordflow">return</span> skymap;</div>
+<div class="line"><a name="l12855"></a><span class="lineno">12855</span> </div>
+<div class="line"><a name="l12856"></a><span class="lineno">12856</span> }</div>
+<div class="line"><a name="l12857"></a><span class="lineno">12857</span> </div>
+<div class="line"><a name="l12858"></a><span class="lineno">12858</span> </div>
+<div class="line"><a name="l12880"></a><span class="lineno"><a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a">12880</a></span> cpl_error_code <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(cpl_image *image, <span class="keywordtype">float</span> gain,</div>
+<div class="line"><a name="l12881"></a><span class="lineno">12881</span>                                  <span class="keywordtype">float</span> threshold, <span class="keywordtype">float</span> ratio)</div>
+<div class="line"><a name="l12882"></a><span class="lineno">12882</span> {</div>
+<div class="line"><a name="l12883"></a><span class="lineno">12883</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_clean_cosmics"</span>;</div>
+<div class="line"><a name="l12884"></a><span class="lineno">12884</span> </div>
+<div class="line"><a name="l12885"></a><span class="lineno">12885</span>     cpl_image  *smoothImage;</div>
+<div class="line"><a name="l12886"></a><span class="lineno">12886</span>     cpl_table  *table;</div>
+<div class="line"><a name="l12887"></a><span class="lineno">12887</span>     cpl_matrix *kernel;</div>
+<div class="line"><a name="l12888"></a><span class="lineno">12888</span>     <span class="keywordtype">int</span>        *xdata;</div>
+<div class="line"><a name="l12889"></a><span class="lineno">12889</span>     <span class="keywordtype">int</span>        *ydata;</div>
+<div class="line"><a name="l12890"></a><span class="lineno">12890</span>     <span class="keywordtype">float</span>      *idata;</div>
+<div class="line"><a name="l12891"></a><span class="lineno">12891</span>     <span class="keywordtype">float</span>      *sdata;</div>
+<div class="line"><a name="l12892"></a><span class="lineno">12892</span>     <span class="keywordtype">float</span>       sigma, sum, value, smoothValue;</div>
+<div class="line"><a name="l12893"></a><span class="lineno">12893</span>     <span class="keywordtype">double</span>      noise;</div>
+<div class="line"><a name="l12894"></a><span class="lineno">12894</span>     <span class="keywordtype">int</span>         count;</div>
+<div class="line"><a name="l12895"></a><span class="lineno">12895</span>     <span class="keywordtype">float</span>       fMax;</div>
+<div class="line"><a name="l12896"></a><span class="lineno">12896</span>     <span class="keywordtype">int</span>         iMin, iMax, jMin, jMax, iPosMax, jPosMax;</div>
+<div class="line"><a name="l12897"></a><span class="lineno">12897</span>     <span class="keywordtype">int</span>         xLen;</div>
+<div class="line"><a name="l12898"></a><span class="lineno">12898</span>     <span class="keywordtype">int</span>         yLen;</div>
+<div class="line"><a name="l12899"></a><span class="lineno">12899</span>     <span class="keywordtype">int</span>         nPix;</div>
+<div class="line"><a name="l12900"></a><span class="lineno">12900</span>     <span class="keywordtype">int</span>         first = 1;  <span class="comment">/* position of first cosmic ray candidate</span></div>
+<div class="line"><a name="l12901"></a><span class="lineno">12901</span> <span class="comment">                               encountered while scanning the image */</span></div>
+<div class="line"><a name="l12902"></a><span class="lineno">12902</span>     <span class="keywordtype">int</span>         pos, i, j, k, l, ii, jj, iii = 0, jjj = 0;</div>
+<div class="line"><a name="l12903"></a><span class="lineno">12903</span>     <span class="keywordtype">int</span>         numCosmic = 0;</div>
+<div class="line"><a name="l12904"></a><span class="lineno">12904</span>     <span class="keywordtype">int</span>         found, foundContiguousCandidate;</div>
+<div class="line"><a name="l12905"></a><span class="lineno">12905</span>     <span class="keywordtype">int</span>        *cosmic;</div>
+<div class="line"><a name="l12906"></a><span class="lineno">12906</span>   </div>
+<div class="line"><a name="l12907"></a><span class="lineno">12907</span> </div>
+<div class="line"><a name="l12908"></a><span class="lineno">12908</span>     <span class="keywordflow">if</span> (image == NULL)</div>
+<div class="line"><a name="l12909"></a><span class="lineno">12909</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l12910"></a><span class="lineno">12910</span> </div>
+<div class="line"><a name="l12911"></a><span class="lineno">12911</span> </div>
+<div class="line"><a name="l12912"></a><span class="lineno">12912</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12913"></a><span class="lineno">12913</span> <span class="comment">     *  "cosmic" is a flags holder (initialized to zero):</span></div>
+<div class="line"><a name="l12914"></a><span class="lineno">12914</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l12915"></a><span class="lineno">12915</span> <span class="comment">     *           -1 = candidate for cosmic ray</span></div>
+<div class="line"><a name="l12916"></a><span class="lineno">12916</span> <span class="comment">     *            0 = not a cosmic</span></div>
+<div class="line"><a name="l12917"></a><span class="lineno">12917</span> <span class="comment">     *            1 = a cosmic ray</span></div>
+<div class="line"><a name="l12918"></a><span class="lineno">12918</span> <span class="comment">     *            2 = member of current group of contiguous candidates</span></div>
+<div class="line"><a name="l12919"></a><span class="lineno">12919</span> <span class="comment">     *            3 = examined member of current group</span></div>
+<div class="line"><a name="l12920"></a><span class="lineno">12920</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12921"></a><span class="lineno">12921</span> </div>
+<div class="line"><a name="l12922"></a><span class="lineno">12922</span>     xLen = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l12923"></a><span class="lineno">12923</span>     yLen = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l12924"></a><span class="lineno">12924</span> </div>
+<div class="line"><a name="l12925"></a><span class="lineno">12925</span>     <span class="keywordflow">if</span> (xLen < 4 || yLen < 4)</div>
+<div class="line"><a name="l12926"></a><span class="lineno">12926</span>         <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l12927"></a><span class="lineno">12927</span> </div>
+<div class="line"><a name="l12928"></a><span class="lineno">12928</span>     nPix = xLen * yLen;</div>
+<div class="line"><a name="l12929"></a><span class="lineno">12929</span> </div>
+<div class="line"><a name="l12930"></a><span class="lineno">12930</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12931"></a><span class="lineno">12931</span> <span class="comment">     * Noise estimation from negative offsets in image. Note that this</span></div>
+<div class="line"><a name="l12932"></a><span class="lineno">12932</span> <span class="comment">     * assumes that the background level (skyLevel) has already been </span></div>
+<div class="line"><a name="l12933"></a><span class="lineno">12933</span> <span class="comment">     * subtracted from the data. In this way we estimate the noise due </span></div>
+<div class="line"><a name="l12934"></a><span class="lineno">12934</span> <span class="comment">     * to detector readout and to the background signal level (before </span></div>
+<div class="line"><a name="l12935"></a><span class="lineno">12935</span> <span class="comment">     * it were removed). Theoretically this is given by </span></div>
+<div class="line"><a name="l12936"></a><span class="lineno">12936</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l12937"></a><span class="lineno">12937</span> <span class="comment">     *        noise = sqrt(ron^2 + skyLevel/gain)</span></div>
+<div class="line"><a name="l12938"></a><span class="lineno">12938</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l12939"></a><span class="lineno">12939</span> <span class="comment">     * where ron is the read-out-noise. To this we will sum the noise </span></div>
+<div class="line"><a name="l12940"></a><span class="lineno">12940</span> <span class="comment">     * contribution due to any increase of the signal above the background</span></div>
+<div class="line"><a name="l12941"></a><span class="lineno">12941</span> <span class="comment">     * by an amount scienceLevel. Theoretically the total noise is given by</span></div>
+<div class="line"><a name="l12942"></a><span class="lineno">12942</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l12943"></a><span class="lineno">12943</span> <span class="comment">     *        totalNoise = sqrt(ron^2 + (skyLevel+scienceLevel)/gain)</span></div>
+<div class="line"><a name="l12944"></a><span class="lineno">12944</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l12945"></a><span class="lineno">12945</span> <span class="comment">     * that is</span></div>
+<div class="line"><a name="l12946"></a><span class="lineno">12946</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l12947"></a><span class="lineno">12947</span> <span class="comment">     *        totalNoise = sqrt(noise^2 + scienceLevel/gain)</span></div>
+<div class="line"><a name="l12948"></a><span class="lineno">12948</span> <span class="comment">     *</span></div>
+<div class="line"><a name="l12949"></a><span class="lineno">12949</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12950"></a><span class="lineno">12950</span> </div>
+<div class="line"><a name="l12951"></a><span class="lineno">12951</span>     idata = cpl_image_get_data(image);</div>
+<div class="line"><a name="l12952"></a><span class="lineno">12952</span>     noise = 0.0;</div>
+<div class="line"><a name="l12953"></a><span class="lineno">12953</span>     count = 0;</div>
+<div class="line"><a name="l12954"></a><span class="lineno">12954</span> </div>
+<div class="line"><a name="l12955"></a><span class="lineno">12955</span>     <span class="keywordflow">for</span> (i = 0; i < nPix; i++) {</div>
+<div class="line"><a name="l12956"></a><span class="lineno">12956</span>         <span class="keywordflow">if</span> (idata[i] < -0.00001) {</div>
+<div class="line"><a name="l12957"></a><span class="lineno">12957</span>             noise -= idata[i];</div>
+<div class="line"><a name="l12958"></a><span class="lineno">12958</span>             count++;</div>
+<div class="line"><a name="l12959"></a><span class="lineno">12959</span>         }</div>
+<div class="line"><a name="l12960"></a><span class="lineno">12960</span>     }</div>
+<div class="line"><a name="l12961"></a><span class="lineno">12961</span> </div>
+<div class="line"><a name="l12962"></a><span class="lineno">12962</span>     noise /= count;</div>
+<div class="line"><a name="l12963"></a><span class="lineno">12963</span>     noise *= 1.25;       <span class="comment">/* Factor to convert average deviation to sigma */</span></div>
+<div class="line"><a name="l12964"></a><span class="lineno">12964</span> </div>
+<div class="line"><a name="l12965"></a><span class="lineno">12965</span>     cosmic = cpl_calloc(nPix, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l12966"></a><span class="lineno">12966</span> </div>
+<div class="line"><a name="l12967"></a><span class="lineno">12967</span>     <span class="keywordflow">if</span> (threshold < 0.)</div>
+<div class="line"><a name="l12968"></a><span class="lineno">12968</span>         threshold = 4.0;</div>
+<div class="line"><a name="l12969"></a><span class="lineno">12969</span>     <span class="keywordflow">if</span> (ratio < 0.)</div>
+<div class="line"><a name="l12970"></a><span class="lineno">12970</span>         ratio = 2.0;</div>
+<div class="line"><a name="l12971"></a><span class="lineno">12971</span> </div>
+<div class="line"><a name="l12972"></a><span class="lineno">12972</span>     kernel = cpl_matrix_new(3, 3);</div>
+<div class="line"><a name="l12973"></a><span class="lineno">12973</span>     cpl_matrix_fill(kernel, 1.0);</div>
+<div class="line"><a name="l12974"></a><span class="lineno">12974</span>     cpl_matrix_set(kernel, 1, 1, 0.0);</div>
+<div class="line"><a name="l12975"></a><span class="lineno">12975</span>     smoothImage = cpl_image_filter_median(image, kernel);</div>
+<div class="line"><a name="l12976"></a><span class="lineno">12976</span>     cpl_matrix_delete(kernel);</div>
+<div class="line"><a name="l12977"></a><span class="lineno">12977</span>     </div>
+<div class="line"><a name="l12978"></a><span class="lineno">12978</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l12979"></a><span class="lineno">12979</span> <span class="comment">     *  Loop on images pixels, searching for cosmic rays candidates.</span></div>
+<div class="line"><a name="l12980"></a><span class="lineno">12980</span> <span class="comment">     *  Border pixels are currently excluded (they cannot contain</span></div>
+<div class="line"><a name="l12981"></a><span class="lineno">12981</span> <span class="comment">     *  candidates), to avoid that the search for groups of contiguous</span></div>
+<div class="line"><a name="l12982"></a><span class="lineno">12982</span> <span class="comment">     *  pixels would ever go out of image boundaries. In future we may</span></div>
+<div class="line"><a name="l12983"></a><span class="lineno">12983</span> <span class="comment">     *  overcome this limit, adding an appropriate check when contiguous</span></div>
+<div class="line"><a name="l12984"></a><span class="lineno">12984</span> <span class="comment">     *  pixels are searched.</span></div>
+<div class="line"><a name="l12985"></a><span class="lineno">12985</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l12986"></a><span class="lineno">12986</span> </div>
+<div class="line"><a name="l12987"></a><span class="lineno">12987</span>     sdata = cpl_image_get_data(smoothImage);</div>
+<div class="line"><a name="l12988"></a><span class="lineno">12988</span> </div>
+<div class="line"><a name="l12989"></a><span class="lineno">12989</span>     <span class="keywordflow">for</span> (j = 1; j < yLen - 1; j++) {</div>
+<div class="line"><a name="l12990"></a><span class="lineno">12990</span>         <span class="keywordflow">for</span> (i = 1; i < xLen - 1; i++) {</div>
+<div class="line"><a name="l12991"></a><span class="lineno">12991</span>             value = idata[i + j * xLen];</div>
+<div class="line"><a name="l12992"></a><span class="lineno">12992</span>             smoothValue = sdata[i + j * xLen];</div>
+<div class="line"><a name="l12993"></a><span class="lineno">12993</span>             <span class="keywordflow">if</span> (smoothValue < 1.0)</div>
+<div class="line"><a name="l12994"></a><span class="lineno">12994</span>                 smoothValue = 1.0;</div>
+<div class="line"><a name="l12995"></a><span class="lineno">12995</span>             sigma = sqrt(noise * noise + smoothValue / gain);</div>
+<div class="line"><a name="l12996"></a><span class="lineno">12996</span>             <span class="keywordflow">if</span> (value - smoothValue >= threshold * sigma) </div>
+<div class="line"><a name="l12997"></a><span class="lineno">12997</span>                 cosmic[i + j * xLen] = -1;</div>
+<div class="line"><a name="l12998"></a><span class="lineno">12998</span>         }</div>
+<div class="line"><a name="l12999"></a><span class="lineno">12999</span>     }</div>
+<div class="line"><a name="l13000"></a><span class="lineno">13000</span> </div>
+<div class="line"><a name="l13001"></a><span class="lineno">13001</span>     cpl_image_delete(smoothImage);</div>
+<div class="line"><a name="l13002"></a><span class="lineno">13002</span> </div>
+<div class="line"><a name="l13003"></a><span class="lineno">13003</span> </div>
+<div class="line"><a name="l13004"></a><span class="lineno">13004</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l13005"></a><span class="lineno">13005</span> <span class="comment">     *  Search for groups of contiguous cosmic rays candidates.</span></div>
+<div class="line"><a name="l13006"></a><span class="lineno">13006</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l13007"></a><span class="lineno">13007</span> </div>
+<div class="line"><a name="l13008"></a><span class="lineno">13008</span>     <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l13009"></a><span class="lineno">13009</span>         found = 0;</div>
+<div class="line"><a name="l13010"></a><span class="lineno">13010</span>         <span class="keywordflow">for</span> (pos = first; pos < nPix; pos++) {</div>
+<div class="line"><a name="l13011"></a><span class="lineno">13011</span>             <span class="keywordflow">if</span> (cosmic[pos] == -1) {</div>
+<div class="line"><a name="l13012"></a><span class="lineno">13012</span>                 cosmic[pos] = 2;         <span class="comment">/*  Candidate found.  */</span></div>
+<div class="line"><a name="l13013"></a><span class="lineno">13013</span>                 i = pos % xLen;          <span class="comment">/*  Its coordinates.  */</span></div>
+<div class="line"><a name="l13014"></a><span class="lineno">13014</span>                 j = pos / xLen;</div>
+<div class="line"><a name="l13015"></a><span class="lineno">13015</span>                 first = pos;</div>
+<div class="line"><a name="l13016"></a><span class="lineno">13016</span>                 first++;      <span class="comment">/* ???  really necessary? */</span></div>
+<div class="line"><a name="l13017"></a><span class="lineno">13017</span>                 found = 1;</div>
+<div class="line"><a name="l13018"></a><span class="lineno">13018</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l13019"></a><span class="lineno">13019</span>             }</div>
+<div class="line"><a name="l13020"></a><span class="lineno">13020</span>         }</div>
+<div class="line"><a name="l13021"></a><span class="lineno">13021</span> </div>
+<div class="line"><a name="l13022"></a><span class="lineno">13022</span>         <span class="keywordflow">if</span> (found) {</div>
+<div class="line"><a name="l13023"></a><span class="lineno">13023</span> </div>
+<div class="line"><a name="l13024"></a><span class="lineno">13024</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l13025"></a><span class="lineno">13025</span> <span class="comment">             *  Determine new group of contiguous cosmic rays candidates.</span></div>
+<div class="line"><a name="l13026"></a><span class="lineno">13026</span> <span class="comment">             *  Initialize the working box boundaries, iMin, iMax, jMin, jMax, </span></div>
+<div class="line"><a name="l13027"></a><span class="lineno">13027</span> <span class="comment">             *  and the value of the max pixel and its position, fMax, iPosMax,</span></div>
+<div class="line"><a name="l13028"></a><span class="lineno">13028</span> <span class="comment">             *  jPosMax.</span></div>
+<div class="line"><a name="l13029"></a><span class="lineno">13029</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l13030"></a><span class="lineno">13030</span> </div>
+<div class="line"><a name="l13031"></a><span class="lineno">13031</span>             iMin = iMax = iPosMax = i;</div>
+<div class="line"><a name="l13032"></a><span class="lineno">13032</span>             jMin = jMax = jPosMax = j;</div>
+<div class="line"><a name="l13033"></a><span class="lineno">13033</span>             fMax = idata[i + j * xLen];</div>
+<div class="line"><a name="l13034"></a><span class="lineno">13034</span> </div>
+<div class="line"><a name="l13035"></a><span class="lineno">13035</span>             <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l13036"></a><span class="lineno">13036</span>                 foundContiguousCandidate = 0;</div>
+<div class="line"><a name="l13037"></a><span class="lineno">13037</span>                 <span class="keywordflow">for</span> (l = 0; l <= 1; l++) {</div>
+<div class="line"><a name="l13038"></a><span class="lineno">13038</span>                     <span class="keywordflow">for</span> (k = 0; k <= 1; k++) {</div>
+<div class="line"><a name="l13039"></a><span class="lineno">13039</span> </div>
+<div class="line"><a name="l13040"></a><span class="lineno">13040</span>                         <span class="comment">/*</span></div>
+<div class="line"><a name="l13041"></a><span class="lineno">13041</span> <span class="comment">                         *  Looping on 4 pixels to North, East, South and West</span></div>
+<div class="line"><a name="l13042"></a><span class="lineno">13042</span> <span class="comment">                         */</span></div>
+<div class="line"><a name="l13043"></a><span class="lineno">13043</span> </div>
+<div class="line"><a name="l13044"></a><span class="lineno">13044</span>                         ii = i + k - l;</div>
+<div class="line"><a name="l13045"></a><span class="lineno">13045</span>                         jj = j + k + l - 1;</div>
+<div class="line"><a name="l13046"></a><span class="lineno">13046</span>                         <span class="keywordflow">if</span> (cosmic[ii + jj * xLen] == -1) {</div>
+<div class="line"><a name="l13047"></a><span class="lineno">13047</span>                             foundContiguousCandidate = 1;</div>
+<div class="line"><a name="l13048"></a><span class="lineno">13048</span>                             cosmic[ii + jj * xLen] = 2;</div>
+<div class="line"><a name="l13049"></a><span class="lineno">13049</span>                                         <span class="comment">/* Candidate belongs to current group */</span></div>
+<div class="line"><a name="l13050"></a><span class="lineno">13050</span>                             iii = ii;   <span class="comment">/* Keep its position */</span></div>
+<div class="line"><a name="l13051"></a><span class="lineno">13051</span>                             jjj = jj;</div>
+<div class="line"><a name="l13052"></a><span class="lineno">13052</span> </div>
+<div class="line"><a name="l13053"></a><span class="lineno">13053</span>                             <span class="comment">/*</span></div>
+<div class="line"><a name="l13054"></a><span class="lineno">13054</span> <span class="comment">                             * Upgrade search box</span></div>
+<div class="line"><a name="l13055"></a><span class="lineno">13055</span> <span class="comment">                             */</span></div>
+<div class="line"><a name="l13056"></a><span class="lineno">13056</span> </div>
+<div class="line"><a name="l13057"></a><span class="lineno">13057</span>                             <span class="keywordflow">if</span> (ii < iMin)</div>
+<div class="line"><a name="l13058"></a><span class="lineno">13058</span>                                 iMin = ii;</div>
+<div class="line"><a name="l13059"></a><span class="lineno">13059</span>                             <span class="keywordflow">if</span> (ii > iMax)</div>
+<div class="line"><a name="l13060"></a><span class="lineno">13060</span>                                 iMax = ii;</div>
+<div class="line"><a name="l13061"></a><span class="lineno">13061</span>                             <span class="keywordflow">if</span> (jj < jMin)</div>
+<div class="line"><a name="l13062"></a><span class="lineno">13062</span>                                 jMin = jj;</div>
+<div class="line"><a name="l13063"></a><span class="lineno">13063</span>                             <span class="keywordflow">if</span> (jj > jMax)</div>
+<div class="line"><a name="l13064"></a><span class="lineno">13064</span>                                 jMax = jj;</div>
+<div class="line"><a name="l13065"></a><span class="lineno">13065</span> </div>
+<div class="line"><a name="l13066"></a><span class="lineno">13066</span>                             <span class="keywordflow">if</span> (idata[ii + jj * xLen] > fMax) {</div>
+<div class="line"><a name="l13067"></a><span class="lineno">13067</span>                                 fMax = idata[ii + jj * xLen];</div>
+<div class="line"><a name="l13068"></a><span class="lineno">13068</span>                                 iPosMax = ii;</div>
+<div class="line"><a name="l13069"></a><span class="lineno">13069</span>                                 jPosMax = jj;</div>
+<div class="line"><a name="l13070"></a><span class="lineno">13070</span>                             }</div>
+<div class="line"><a name="l13071"></a><span class="lineno">13071</span>                         }</div>
+<div class="line"><a name="l13072"></a><span class="lineno">13072</span>                     }</div>
+<div class="line"><a name="l13073"></a><span class="lineno">13073</span>                 }</div>
+<div class="line"><a name="l13074"></a><span class="lineno">13074</span> </div>
+<div class="line"><a name="l13075"></a><span class="lineno">13075</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l13076"></a><span class="lineno">13076</span> <span class="comment">                 *  We are done exploring the "cross". Now mark as "examined"</span></div>
+<div class="line"><a name="l13077"></a><span class="lineno">13077</span> <span class="comment">                 *  the current candidate (at the center of the cross):</span></div>
+<div class="line"><a name="l13078"></a><span class="lineno">13078</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l13079"></a><span class="lineno">13079</span> </div>
+<div class="line"><a name="l13080"></a><span class="lineno">13080</span>                 cosmic[i + j * xLen] = 3; <span class="comment">/* It may probably be set to 1 now */</span></div>
+<div class="line"><a name="l13081"></a><span class="lineno">13081</span> </div>
+<div class="line"><a name="l13082"></a><span class="lineno">13082</span>                 <span class="keywordflow">if</span> (foundContiguousCandidate) {</div>
+<div class="line"><a name="l13083"></a><span class="lineno">13083</span> </div>
+<div class="line"><a name="l13084"></a><span class="lineno">13084</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l13085"></a><span class="lineno">13085</span> <span class="comment">                     * Pass (arbitrarily) the coordinates of the LAST found </span></div>
+<div class="line"><a name="l13086"></a><span class="lineno">13086</span> <span class="comment">                     * candidate</span></div>
+<div class="line"><a name="l13087"></a><span class="lineno">13087</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l13088"></a><span class="lineno">13088</span> </div>
+<div class="line"><a name="l13089"></a><span class="lineno">13089</span>                     i = iii;</div>
+<div class="line"><a name="l13090"></a><span class="lineno">13090</span>                     j = jjj;</div>
+<div class="line"><a name="l13091"></a><span class="lineno">13091</span> </div>
+<div class="line"><a name="l13092"></a><span class="lineno">13092</span>                     <span class="comment">/* </span></div>
+<div class="line"><a name="l13093"></a><span class="lineno">13093</span> <span class="comment">                     * Skip the rest, continue loop on new candidate </span></div>
+<div class="line"><a name="l13094"></a><span class="lineno">13094</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l13095"></a><span class="lineno">13095</span> </div>
+<div class="line"><a name="l13096"></a><span class="lineno">13096</span>                     <span class="keywordflow">continue</span>; </div>
+<div class="line"><a name="l13097"></a><span class="lineno">13097</span>                 }</div>
+<div class="line"><a name="l13098"></a><span class="lineno">13098</span> </div>
+<div class="line"><a name="l13099"></a><span class="lineno">13099</span> </div>
+<div class="line"><a name="l13100"></a><span class="lineno">13100</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l13101"></a><span class="lineno">13101</span> <span class="comment">                 *  Look for leftovers in the (growing!) search box</span></div>
+<div class="line"><a name="l13102"></a><span class="lineno">13102</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l13103"></a><span class="lineno">13103</span> </div>
+<div class="line"><a name="l13104"></a><span class="lineno">13104</span>                 <span class="keywordflow">for</span> (l = jMin; l <= jMax; l++) {</div>
+<div class="line"><a name="l13105"></a><span class="lineno">13105</span>                     <span class="keywordflow">for</span> (k = iMin; k <= iMax; k++) {</div>
+<div class="line"><a name="l13106"></a><span class="lineno">13106</span>                         <span class="keywordflow">if</span> (cosmic[k + l * xLen] == 2) {</div>
+<div class="line"><a name="l13107"></a><span class="lineno">13107</span>                             i = k;</div>
+<div class="line"><a name="l13108"></a><span class="lineno">13108</span>                             j = l;</div>
+<div class="line"><a name="l13109"></a><span class="lineno">13109</span>                             foundContiguousCandidate = 1;</div>
+<div class="line"><a name="l13110"></a><span class="lineno">13110</span>                             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l13111"></a><span class="lineno">13111</span>                         }</div>
+<div class="line"><a name="l13112"></a><span class="lineno">13112</span>                     }</div>
+<div class="line"><a name="l13113"></a><span class="lineno">13113</span>                     <span class="keywordflow">if</span> (foundContiguousCandidate) </div>
+<div class="line"><a name="l13114"></a><span class="lineno">13114</span>                         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l13115"></a><span class="lineno">13115</span>                 }</div>
+<div class="line"><a name="l13116"></a><span class="lineno">13116</span>             } <span class="keywordflow">while</span> (foundContiguousCandidate);</div>
+<div class="line"><a name="l13117"></a><span class="lineno">13117</span> </div>
+<div class="line"><a name="l13118"></a><span class="lineno">13118</span> </div>
+<div class="line"><a name="l13119"></a><span class="lineno">13119</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l13120"></a><span class="lineno">13120</span> <span class="comment">             *  No more contiguous candidates are found. Decide now</span></div>
+<div class="line"><a name="l13121"></a><span class="lineno">13121</span> <span class="comment">             *  whether the current group is a cosmic ray or not.</span></div>
+<div class="line"><a name="l13122"></a><span class="lineno">13122</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l13123"></a><span class="lineno">13123</span> </div>
+<div class="line"><a name="l13124"></a><span class="lineno">13124</span>             sum = 0.;                <span class="comment">/* Sum of 8 pixels around max position */</span></div>
+<div class="line"><a name="l13125"></a><span class="lineno">13125</span>             <span class="keywordflow">for</span> (l = -1; l <= 1; l++) {</div>
+<div class="line"><a name="l13126"></a><span class="lineno">13126</span>                 <span class="keywordflow">for</span> (k = -1; k <= 1; k++) {</div>
+<div class="line"><a name="l13127"></a><span class="lineno">13127</span>                     <span class="keywordflow">if</span> (l != 0 || k != 0) {</div>
+<div class="line"><a name="l13128"></a><span class="lineno">13128</span>                         sum += idata[iPosMax + k + (jPosMax + l) * xLen];</div>
+<div class="line"><a name="l13129"></a><span class="lineno">13129</span>                     }</div>
+<div class="line"><a name="l13130"></a><span class="lineno">13130</span>                 }</div>
+<div class="line"><a name="l13131"></a><span class="lineno">13131</span>             }</div>
+<div class="line"><a name="l13132"></a><span class="lineno">13132</span> </div>
+<div class="line"><a name="l13133"></a><span class="lineno">13133</span>             sum /= 8.;</div>
+<div class="line"><a name="l13134"></a><span class="lineno">13134</span>             <span class="keywordflow">if</span> (fMax > ratio * sum) {</div>
+<div class="line"><a name="l13135"></a><span class="lineno">13135</span>                 <span class="keywordflow">for</span> (l = jMin - 1; l <= jMax + 1; l++) {</div>
+<div class="line"><a name="l13136"></a><span class="lineno">13136</span>                     <span class="keywordflow">for</span> (k = iMin - 1; k <= iMax + 1; k++) {</div>
+<div class="line"><a name="l13137"></a><span class="lineno">13137</span>                         <span class="keywordflow">if</span> (cosmic[k + l * xLen] == 3) {</div>
+<div class="line"><a name="l13138"></a><span class="lineno">13138</span>                             cosmic[k + l * xLen] = 1;</div>
+<div class="line"><a name="l13139"></a><span class="lineno">13139</span>                             numCosmic++;</div>
+<div class="line"><a name="l13140"></a><span class="lineno">13140</span>                         }</div>
+<div class="line"><a name="l13141"></a><span class="lineno">13141</span>                     }</div>
+<div class="line"><a name="l13142"></a><span class="lineno">13142</span>                 }</div>
+<div class="line"><a name="l13143"></a><span class="lineno">13143</span>             }</div>
+<div class="line"><a name="l13144"></a><span class="lineno">13144</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13145"></a><span class="lineno">13145</span>                 <span class="keywordflow">for</span> (l = jMin - 1; l <= jMax + 1; l++) {</div>
+<div class="line"><a name="l13146"></a><span class="lineno">13146</span>                     <span class="keywordflow">for</span> (k = iMin - 1; k <= iMax + 1; k++) {</div>
+<div class="line"><a name="l13147"></a><span class="lineno">13147</span>                         <span class="keywordflow">if</span> (cosmic[k + l * xLen] != -1) {</div>
+<div class="line"><a name="l13148"></a><span class="lineno">13148</span>                             <span class="keywordflow">if</span> (cosmic[k + l * xLen] == 1) </div>
+<div class="line"><a name="l13149"></a><span class="lineno">13149</span>                                 numCosmic--;</div>
+<div class="line"><a name="l13150"></a><span class="lineno">13150</span>                             cosmic[k + l * xLen] = 0;</div>
+<div class="line"><a name="l13151"></a><span class="lineno">13151</span>                         }</div>
+<div class="line"><a name="l13152"></a><span class="lineno">13152</span>                     }</div>
+<div class="line"><a name="l13153"></a><span class="lineno">13153</span>                 }</div>
+<div class="line"><a name="l13154"></a><span class="lineno">13154</span>             }</div>
+<div class="line"><a name="l13155"></a><span class="lineno">13155</span>         }</div>
+<div class="line"><a name="l13156"></a><span class="lineno">13156</span>     } <span class="keywordflow">while</span> (found);</div>
+<div class="line"><a name="l13157"></a><span class="lineno">13157</span> </div>
+<div class="line"><a name="l13158"></a><span class="lineno">13158</span> </div>
+<div class="line"><a name="l13159"></a><span class="lineno">13159</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l13160"></a><span class="lineno">13160</span> <span class="comment">     *  Prepare table containing cosmic rays coordinates. </span></div>
+<div class="line"><a name="l13161"></a><span class="lineno">13161</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l13162"></a><span class="lineno">13162</span> </div>
+<div class="line"><a name="l13163"></a><span class="lineno">13163</span>     table = cpl_table_new(numCosmic);</div>
+<div class="line"><a name="l13164"></a><span class="lineno">13164</span>     cpl_table_new_column(table, <span class="stringliteral">"x"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l13165"></a><span class="lineno">13165</span>     cpl_table_new_column(table, <span class="stringliteral">"y"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l13166"></a><span class="lineno">13166</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"x"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l13167"></a><span class="lineno">13167</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"y"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l13168"></a><span class="lineno">13168</span>     xdata = cpl_table_get_data_int(table, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l13169"></a><span class="lineno">13169</span>     ydata = cpl_table_get_data_int(table, <span class="stringliteral">"y"</span>);</div>
+<div class="line"><a name="l13170"></a><span class="lineno">13170</span> </div>
+<div class="line"><a name="l13171"></a><span class="lineno">13171</span>     <span class="keywordflow">for</span> (pos = 0, i = 0; pos < nPix; pos++) {</div>
+<div class="line"><a name="l13172"></a><span class="lineno">13172</span>         <span class="keywordflow">if</span> (cosmic[pos] == 1) {</div>
+<div class="line"><a name="l13173"></a><span class="lineno">13173</span>             xdata[i] = (pos % xLen);</div>
+<div class="line"><a name="l13174"></a><span class="lineno">13174</span>             ydata[i] = (pos / xLen);</div>
+<div class="line"><a name="l13175"></a><span class="lineno">13175</span>             i++;</div>
+<div class="line"><a name="l13176"></a><span class="lineno">13176</span>         }</div>
+<div class="line"><a name="l13177"></a><span class="lineno">13177</span>     }</div>
+<div class="line"><a name="l13178"></a><span class="lineno">13178</span> </div>
+<div class="line"><a name="l13179"></a><span class="lineno">13179</span>     mos_clean_bad_pixels(image, table, 1);</div>
+<div class="line"><a name="l13180"></a><span class="lineno">13180</span> </div>
+<div class="line"><a name="l13181"></a><span class="lineno">13181</span>     cpl_free(cosmic);</div>
+<div class="line"><a name="l13182"></a><span class="lineno">13182</span>     cpl_table_delete(table);</div>
+<div class="line"><a name="l13183"></a><span class="lineno">13183</span> </div>
+<div class="line"><a name="l13184"></a><span class="lineno">13184</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l13185"></a><span class="lineno">13185</span> </div>
+<div class="line"><a name="l13186"></a><span class="lineno">13186</span> }</div>
+<div class="line"><a name="l13187"></a><span class="lineno">13187</span> </div>
+<div class="line"><a name="l13188"></a><span class="lineno">13188</span> </div>
+<div class="line"><a name="l13189"></a><span class="lineno">13189</span> cpl_error_code mos_clean_bad_pixels(cpl_image *image, cpl_table *table,</div>
+<div class="line"><a name="l13190"></a><span class="lineno">13190</span>                                     <span class="keywordtype">int</span> spectral)</div>
+<div class="line"><a name="l13191"></a><span class="lineno">13191</span> {</div>
+<div class="line"><a name="l13192"></a><span class="lineno">13192</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_clean_cosmics"</span>;</div>
+<div class="line"><a name="l13193"></a><span class="lineno">13193</span>  </div>
+<div class="line"><a name="l13194"></a><span class="lineno">13194</span>     <span class="keywordtype">float</span>       *idata;</div>
+<div class="line"><a name="l13195"></a><span class="lineno">13195</span>     <span class="keywordtype">int</span>         *isBadPix;</div>
+<div class="line"><a name="l13196"></a><span class="lineno">13196</span>     <span class="keywordtype">int</span>          i, j, k, d;</div>
+<div class="line"><a name="l13197"></a><span class="lineno">13197</span>     <span class="keywordtype">int</span>          xlen, ylen, totPix;</div>
+<div class="line"><a name="l13198"></a><span class="lineno">13198</span>     <span class="keywordtype">int</span>          nBadPixels = 0;</div>
+<div class="line"><a name="l13199"></a><span class="lineno">13199</span>     <span class="keywordtype">int</span>          sign, foundFirst;</div>
+<div class="line"><a name="l13200"></a><span class="lineno">13200</span>     <span class="keywordtype">int</span>         *xValue = NULL;</div>
+<div class="line"><a name="l13201"></a><span class="lineno">13201</span>     <span class="keywordtype">int</span>         *yValue = NULL;</div>
+<div class="line"><a name="l13202"></a><span class="lineno">13202</span>     <span class="keywordtype">float</span>        save = 0.;</div>
+<div class="line"><a name="l13203"></a><span class="lineno">13203</span>     <span class="keywordtype">double</span>       sumd;</div>
+<div class="line"><a name="l13204"></a><span class="lineno">13204</span>     <span class="keywordtype">int</span>          cx, cy;</div>
+<div class="line"><a name="l13205"></a><span class="lineno">13205</span>     <span class="keywordtype">int</span>          nPairs;</div>
+<div class="line"><a name="l13206"></a><span class="lineno">13206</span>     <span class="keywordtype">float</span>        estimate[4];</div>
+<div class="line"><a name="l13207"></a><span class="lineno">13207</span>     <span class="keywordtype">int</span>          sx[] = {0, 1, 1, 1};</div>
+<div class="line"><a name="l13208"></a><span class="lineno">13208</span>     <span class="keywordtype">int</span>          sy[] = {1,-1, 0, 1};</div>
+<div class="line"><a name="l13209"></a><span class="lineno">13209</span>     <span class="keywordtype">int</span>          searchHorizon = 100;</div>
+<div class="line"><a name="l13210"></a><span class="lineno">13210</span>     <span class="keywordtype">int</span>          percent = 15;</div>
+<div class="line"><a name="l13211"></a><span class="lineno">13211</span> </div>
+<div class="line"><a name="l13212"></a><span class="lineno">13212</span> </div>
+<div class="line"><a name="l13213"></a><span class="lineno">13213</span>     <span class="keywordflow">if</span> (image == NULL || table == NULL)</div>
+<div class="line"><a name="l13214"></a><span class="lineno">13214</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l13215"></a><span class="lineno">13215</span> </div>
+<div class="line"><a name="l13216"></a><span class="lineno">13216</span>     <span class="keywordflow">if</span> (1 != cpl_table_has_column(table, <span class="stringliteral">"x"</span>))</div>
+<div class="line"><a name="l13217"></a><span class="lineno">13217</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l13218"></a><span class="lineno">13218</span> </div>
+<div class="line"><a name="l13219"></a><span class="lineno">13219</span>     <span class="keywordflow">if</span> (1 != cpl_table_has_column(table, <span class="stringliteral">"y"</span>))</div>
+<div class="line"><a name="l13220"></a><span class="lineno">13220</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l13221"></a><span class="lineno">13221</span> </div>
+<div class="line"><a name="l13222"></a><span class="lineno">13222</span>     <span class="keywordflow">if</span> (CPL_TYPE_INT != cpl_table_get_column_type(table, <span class="stringliteral">"x"</span>))</div>
+<div class="line"><a name="l13223"></a><span class="lineno">13223</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l13224"></a><span class="lineno">13224</span> </div>
+<div class="line"><a name="l13225"></a><span class="lineno">13225</span>     <span class="keywordflow">if</span> (CPL_TYPE_INT != cpl_table_get_column_type(table, <span class="stringliteral">"y"</span>))</div>
+<div class="line"><a name="l13226"></a><span class="lineno">13226</span>         <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l13227"></a><span class="lineno">13227</span> </div>
+<div class="line"><a name="l13228"></a><span class="lineno">13228</span>     nBadPixels = cpl_table_get_nrow(table);</div>
+<div class="line"><a name="l13229"></a><span class="lineno">13229</span> </div>
+<div class="line"><a name="l13230"></a><span class="lineno">13230</span>     <span class="keywordflow">if</span> (nBadPixels) {</div>
+<div class="line"><a name="l13231"></a><span class="lineno">13231</span>         xlen = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l13232"></a><span class="lineno">13232</span>         ylen = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l13233"></a><span class="lineno">13233</span>         idata = cpl_image_get_data(image);</div>
+<div class="line"><a name="l13234"></a><span class="lineno">13234</span>         totPix = xlen * ylen;</div>
+<div class="line"><a name="l13235"></a><span class="lineno">13235</span>         <span class="keywordflow">if</span> (((<span class="keywordtype">float</span>) nBadPixels) / ((<span class="keywordtype">float</span>) totPix) < percent/100.) {</div>
+<div class="line"><a name="l13236"></a><span class="lineno">13236</span>             isBadPix = cpl_calloc(totPix, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l13237"></a><span class="lineno">13237</span>         }</div>
+<div class="line"><a name="l13238"></a><span class="lineno">13238</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13239"></a><span class="lineno">13239</span>             cpl_msg_warning(func, <span class="stringliteral">"Too many bad pixels (> %d%%): "</span></div>
+<div class="line"><a name="l13240"></a><span class="lineno">13240</span>                             <span class="stringliteral">"skip bad pixel correction"</span>, percent);</div>
+<div class="line"><a name="l13241"></a><span class="lineno">13241</span>             <span class="keywordflow">return</span> cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l13242"></a><span class="lineno">13242</span>         }</div>
+<div class="line"><a name="l13243"></a><span class="lineno">13243</span>     }</div>
+<div class="line"><a name="l13244"></a><span class="lineno">13244</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13245"></a><span class="lineno">13245</span>         cpl_msg_debug(func, <span class="stringliteral">"No pixel values to interpolate"</span>);</div>
+<div class="line"><a name="l13246"></a><span class="lineno">13246</span>         <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l13247"></a><span class="lineno">13247</span>     }</div>
+<div class="line"><a name="l13248"></a><span class="lineno">13248</span> </div>
+<div class="line"><a name="l13249"></a><span class="lineno">13249</span>     xValue = cpl_table_get_data_int(table, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l13250"></a><span class="lineno">13250</span>     yValue = cpl_table_get_data_int(table, <span class="stringliteral">"y"</span>);</div>
+<div class="line"><a name="l13251"></a><span class="lineno">13251</span> </div>
+<div class="line"><a name="l13252"></a><span class="lineno">13252</span>     <span class="keywordflow">for</span> (i = 0; i < nBadPixels; i++)</div>
+<div class="line"><a name="l13253"></a><span class="lineno">13253</span>         isBadPix[xValue[i] + yValue[i] * xlen] = 1;</div>
+<div class="line"><a name="l13254"></a><span class="lineno">13254</span> </div>
+<div class="line"><a name="l13255"></a><span class="lineno">13255</span>     <span class="keywordflow">for</span> (i = 0; i < nBadPixels; i++) {</div>
+<div class="line"><a name="l13256"></a><span class="lineno">13256</span> </div>
+<div class="line"><a name="l13257"></a><span class="lineno">13257</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l13258"></a><span class="lineno">13258</span> <span class="comment">         *  Search for the closest good pixel along the 4 fundamental </span></div>
+<div class="line"><a name="l13259"></a><span class="lineno">13259</span> <span class="comment">         *  directions (in both senses):</span></div>
+<div class="line"><a name="l13260"></a><span class="lineno">13260</span> <span class="comment">         *                            \ | /</span></div>
+<div class="line"><a name="l13261"></a><span class="lineno">13261</span> <span class="comment">         *                             \|/</span></div>
+<div class="line"><a name="l13262"></a><span class="lineno">13262</span> <span class="comment">         *                           --- ---</span></div>
+<div class="line"><a name="l13263"></a><span class="lineno">13263</span> <span class="comment">         *                             /|\</span></div>
+<div class="line"><a name="l13264"></a><span class="lineno">13264</span> <span class="comment">         *                            / | \</span></div>
+<div class="line"><a name="l13265"></a><span class="lineno">13265</span> <span class="comment">         *</span></div>
+<div class="line"><a name="l13266"></a><span class="lineno">13266</span> <span class="comment">         *  Then collect pairs of values to interpolate linearly.</span></div>
+<div class="line"><a name="l13267"></a><span class="lineno">13267</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l13268"></a><span class="lineno">13268</span> </div>
+<div class="line"><a name="l13269"></a><span class="lineno">13269</span>         nPairs = 0;</div>
+<div class="line"><a name="l13270"></a><span class="lineno">13270</span>         <span class="keywordflow">for</span> (j = 0; j < 4; j++) {</div>
+<div class="line"><a name="l13271"></a><span class="lineno">13271</span> </div>
+<div class="line"><a name="l13272"></a><span class="lineno">13272</span>             <span class="keywordflow">if</span> (spectral) <span class="comment">/* Just horizontal interpolation for spectral data */</span></div>
+<div class="line"><a name="l13273"></a><span class="lineno">13273</span>                 <span class="keywordflow">if</span> (j != 2)</div>
+<div class="line"><a name="l13274"></a><span class="lineno">13274</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13275"></a><span class="lineno">13275</span> </div>
+<div class="line"><a name="l13276"></a><span class="lineno">13276</span>             estimate[nPairs] = 0.;  <span class="comment">/* Pairs interpolations are stored here */</span></div>
+<div class="line"><a name="l13277"></a><span class="lineno">13277</span>             sumd = 0.;</div>
+<div class="line"><a name="l13278"></a><span class="lineno">13278</span>             foundFirst = 0;</div>
+<div class="line"><a name="l13279"></a><span class="lineno">13279</span>             <span class="keywordflow">for</span> (k = 0; k < 2; k++) {</div>
+<div class="line"><a name="l13280"></a><span class="lineno">13280</span>                 sign = 2 * k - 1;</div>
+<div class="line"><a name="l13281"></a><span class="lineno">13281</span>                 d = 0;</div>
+<div class="line"><a name="l13282"></a><span class="lineno">13282</span>                 cx = xValue[i];</div>
+<div class="line"><a name="l13283"></a><span class="lineno">13283</span>                 cy = yValue[i];</div>
+<div class="line"><a name="l13284"></a><span class="lineno">13284</span>                 <span class="keywordflow">do</span> {</div>
+<div class="line"><a name="l13285"></a><span class="lineno">13285</span>                     cx += sign * sx[j];</div>
+<div class="line"><a name="l13286"></a><span class="lineno">13286</span>                     cy += sign * sy[j];</div>
+<div class="line"><a name="l13287"></a><span class="lineno">13287</span>                     <span class="keywordflow">if</span> (cx < 0 || cx >= xlen || cy < 0 || cy >= ylen) </div>
+<div class="line"><a name="l13288"></a><span class="lineno">13288</span>                         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l13289"></a><span class="lineno">13289</span>                     d++;</div>
+<div class="line"><a name="l13290"></a><span class="lineno">13290</span>                 } <span class="keywordflow">while</span> (isBadPix[cx + cy * xlen] && d < searchHorizon);</div>
+<div class="line"><a name="l13291"></a><span class="lineno">13291</span> </div>
+<div class="line"><a name="l13292"></a><span class="lineno">13292</span>                 <span class="keywordflow">if</span> (cx >= 0 && cx < xlen && </div>
+<div class="line"><a name="l13293"></a><span class="lineno">13293</span>                     cy >= 0 && cy < ylen && d < searchHorizon) {</div>
+<div class="line"><a name="l13294"></a><span class="lineno">13294</span> </div>
+<div class="line"><a name="l13295"></a><span class="lineno">13295</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l13296"></a><span class="lineno">13296</span> <span class="comment">                     *  In this block is cripted the linear interpolation...</span></div>
+<div class="line"><a name="l13297"></a><span class="lineno">13297</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l13298"></a><span class="lineno">13298</span> </div>
+<div class="line"><a name="l13299"></a><span class="lineno">13299</span>                     save = idata[cx + cy * xlen];</div>
+<div class="line"><a name="l13300"></a><span class="lineno">13300</span>                     estimate[nPairs] += save / d;</div>
+<div class="line"><a name="l13301"></a><span class="lineno">13301</span>                     sumd += 1. / (double) d;</div>
+<div class="line"><a name="l13302"></a><span class="lineno">13302</span>                     <span class="keywordflow">if</span> (k) {</div>
+<div class="line"><a name="l13303"></a><span class="lineno">13303</span>                         estimate[nPairs] /= sumd;</div>
+<div class="line"><a name="l13304"></a><span class="lineno">13304</span>                         nPairs++;</div>
+<div class="line"><a name="l13305"></a><span class="lineno">13305</span>                     }</div>
+<div class="line"><a name="l13306"></a><span class="lineno">13306</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13307"></a><span class="lineno">13307</span>                         foundFirst = 1;</div>
+<div class="line"><a name="l13308"></a><span class="lineno">13308</span>                     }</div>
+<div class="line"><a name="l13309"></a><span class="lineno">13309</span>                 }</div>
+<div class="line"><a name="l13310"></a><span class="lineno">13310</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13311"></a><span class="lineno">13311</span> </div>
+<div class="line"><a name="l13312"></a><span class="lineno">13312</span>                     <span class="comment">/*</span></div>
+<div class="line"><a name="l13313"></a><span class="lineno">13313</span> <span class="comment">                     * Image borders were crossed, incomplete pair of values</span></div>
+<div class="line"><a name="l13314"></a><span class="lineno">13314</span> <span class="comment">                     */</span></div>
+<div class="line"><a name="l13315"></a><span class="lineno">13315</span> </div>
+<div class="line"><a name="l13316"></a><span class="lineno">13316</span>                     <span class="keywordflow">if</span> (k) {</div>
+<div class="line"><a name="l13317"></a><span class="lineno">13317</span>                         <span class="keywordflow">if</span> (foundFirst) {</div>
+<div class="line"><a name="l13318"></a><span class="lineno">13318</span>                             estimate[nPairs] = save;</div>
+<div class="line"><a name="l13319"></a><span class="lineno">13319</span>                             nPairs++;</div>
+<div class="line"><a name="l13320"></a><span class="lineno">13320</span>                         }</div>
+<div class="line"><a name="l13321"></a><span class="lineno">13321</span>                     }</div>
+<div class="line"><a name="l13322"></a><span class="lineno">13322</span>                 }</div>
+<div class="line"><a name="l13323"></a><span class="lineno">13323</span>             }</div>
+<div class="line"><a name="l13324"></a><span class="lineno">13324</span>         }</div>
+<div class="line"><a name="l13325"></a><span class="lineno">13325</span> </div>
+<div class="line"><a name="l13326"></a><span class="lineno">13326</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l13327"></a><span class="lineno">13327</span> <span class="comment">         * Replace pixel value of the input image, corresponding to</span></div>
+<div class="line"><a name="l13328"></a><span class="lineno">13328</span> <span class="comment">         * the current bad pixel, with the median of the estimates</span></div>
+<div class="line"><a name="l13329"></a><span class="lineno">13329</span> <span class="comment">         * resulted from the 4 linear interpolations.</span></div>
+<div class="line"><a name="l13330"></a><span class="lineno">13330</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l13331"></a><span class="lineno">13331</span> </div>
+<div class="line"><a name="l13332"></a><span class="lineno">13332</span>         <span class="keywordflow">if</span> (nPairs > 2) {</div>
+<div class="line"><a name="l13333"></a><span class="lineno">13333</span>             idata[xValue[i] + yValue[i] * xlen] = </div>
+<div class="line"><a name="l13334"></a><span class="lineno">13334</span>                                cpl_tools_get_median_float(estimate, nPairs);</div>
+<div class="line"><a name="l13335"></a><span class="lineno">13335</span>         }</div>
+<div class="line"><a name="l13336"></a><span class="lineno">13336</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nPairs == 2) {</div>
+<div class="line"><a name="l13337"></a><span class="lineno">13337</span>             idata[xValue[i] + yValue[i] * xlen] =</div>
+<div class="line"><a name="l13338"></a><span class="lineno">13338</span>                                             (estimate[0] + estimate[1]) / 2.;</div>
+<div class="line"><a name="l13339"></a><span class="lineno">13339</span>         }</div>
+<div class="line"><a name="l13340"></a><span class="lineno">13340</span>         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nPairs == 1) {</div>
+<div class="line"><a name="l13341"></a><span class="lineno">13341</span>             idata[xValue[i] + yValue[i] * xlen] = estimate[0];</div>
+<div class="line"><a name="l13342"></a><span class="lineno">13342</span>         }</div>
+<div class="line"><a name="l13343"></a><span class="lineno">13343</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13344"></a><span class="lineno">13344</span>             cpl_msg_debug(func, <span class="stringliteral">"Cannot correct bad pixel %d,%d\n"</span>,</div>
+<div class="line"><a name="l13345"></a><span class="lineno">13345</span>                           xValue[i], yValue[i]);</div>
+<div class="line"><a name="l13346"></a><span class="lineno">13346</span>         }</div>
+<div class="line"><a name="l13347"></a><span class="lineno">13347</span>     }</div>
+<div class="line"><a name="l13348"></a><span class="lineno">13348</span> </div>
+<div class="line"><a name="l13349"></a><span class="lineno">13349</span>     cpl_free(isBadPix);</div>
+<div class="line"><a name="l13350"></a><span class="lineno">13350</span> </div>
+<div class="line"><a name="l13351"></a><span class="lineno">13351</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l13352"></a><span class="lineno">13352</span> }</div>
+<div class="line"><a name="l13353"></a><span class="lineno">13353</span> </div>
+<div class="line"><a name="l13354"></a><span class="lineno">13354</span> </div>
+<div class="line"><a name="l13384"></a><span class="lineno"><a class="code" href="group__moses.html#ga4592493a392e23ebc56259ed3bfc0719">13384</a></span> cpl_image *<a class="code" href="group__moses.html#ga4592493a392e23ebc56259ed3bfc0719" title="Create coordinate map from spectral curvature table.">mos_spatial_map</a>(cpl_image *spectra, cpl_table *slits,</div>
+<div class="line"><a name="l13385"></a><span class="lineno">13385</span>                            cpl_table *polytraces, <span class="keywordtype">double</span> reference,</div>
+<div class="line"><a name="l13386"></a><span class="lineno">13386</span>                            <span class="keywordtype">double</span> blue, <span class="keywordtype">double</span> red, <span class="keywordtype">double</span> dispersion)</div>
+<div class="line"><a name="l13387"></a><span class="lineno">13387</span> {</div>
+<div class="line"><a name="l13388"></a><span class="lineno">13388</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_spatial_map"</span>;</div>
+<div class="line"><a name="l13389"></a><span class="lineno">13389</span> </div>
+<div class="line"><a name="l13390"></a><span class="lineno">13390</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l13391"></a><span class="lineno">13391</span>                                                  <span class="comment">/* Max order is 5 */</span></div>
+<div class="line"><a name="l13392"></a><span class="lineno">13392</span>     cpl_polynomial *polytop;</div>
+<div class="line"><a name="l13393"></a><span class="lineno">13393</span>     cpl_polynomial *polybot;</div>
+<div class="line"><a name="l13394"></a><span class="lineno">13394</span>     cpl_image      *calibration;</div>
+<div class="line"><a name="l13395"></a><span class="lineno">13395</span>     <span class="keywordtype">float</span>          *data;</div>
+<div class="line"><a name="l13396"></a><span class="lineno">13396</span>     <span class="keywordtype">double</span>          top, bot;</div>
+<div class="line"><a name="l13397"></a><span class="lineno">13397</span>     <span class="keywordtype">double</span>          coeff;</div>
+<div class="line"><a name="l13398"></a><span class="lineno">13398</span>     <span class="keywordtype">double</span>          ytop, ybot;</div>
+<div class="line"><a name="l13399"></a><span class="lineno">13399</span>     <span class="keywordtype">double</span>          ypos, yfra;</div>
+<div class="line"><a name="l13400"></a><span class="lineno">13400</span>     <span class="keywordtype">double</span>          factor;</div>
+<div class="line"><a name="l13401"></a><span class="lineno">13401</span>     <span class="keywordtype">int</span>             yint, yprev;</div>
+<div class="line"><a name="l13402"></a><span class="lineno">13402</span>     <span class="keywordtype">int</span>             nslits;</div>
+<div class="line"><a name="l13403"></a><span class="lineno">13403</span>     <span class="keywordtype">int</span>             npseudo;</div>
+<div class="line"><a name="l13404"></a><span class="lineno">13404</span>     <span class="keywordtype">int</span>            *slit_id;</div>
+<div class="line"><a name="l13405"></a><span class="lineno">13405</span>     <span class="keywordtype">int</span>            *length;</div>
+<div class="line"><a name="l13406"></a><span class="lineno">13406</span>     <span class="keywordtype">int</span>             nx, ny;</div>
+<div class="line"><a name="l13407"></a><span class="lineno">13407</span>     <span class="keywordtype">int</span>             pixel_above, pixel_below, refpixel, start_pixel, end_pixel;</div>
+<div class="line"><a name="l13408"></a><span class="lineno">13408</span>     <span class="keywordtype">int</span>             missing_top, missing_bot;</div>
+<div class="line"><a name="l13409"></a><span class="lineno">13409</span>     <span class="keywordtype">int</span>             null;</div>
+<div class="line"><a name="l13410"></a><span class="lineno">13410</span>     <span class="keywordtype">int</span>             order;</div>
+<div class="line"><a name="l13411"></a><span class="lineno">13411</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l13412"></a><span class="lineno">13412</span>     cpl_size        k;</div>
+<div class="line"><a name="l13413"></a><span class="lineno">13413</span> </div>
+<div class="line"><a name="l13414"></a><span class="lineno">13414</span> </div>
+<div class="line"><a name="l13415"></a><span class="lineno">13415</span>     <span class="keywordflow">if</span> (spectra == NULL || slits == NULL || polytraces == NULL) {</div>
+<div class="line"><a name="l13416"></a><span class="lineno">13416</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l13417"></a><span class="lineno">13417</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l13418"></a><span class="lineno">13418</span>     }</div>
+<div class="line"><a name="l13419"></a><span class="lineno">13419</span> </div>
+<div class="line"><a name="l13420"></a><span class="lineno">13420</span>     <span class="keywordflow">if</span> (dispersion <= 0.0) {</div>
+<div class="line"><a name="l13421"></a><span class="lineno">13421</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l13422"></a><span class="lineno">13422</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l13423"></a><span class="lineno">13423</span>     }</div>
+<div class="line"><a name="l13424"></a><span class="lineno">13424</span> </div>
+<div class="line"><a name="l13425"></a><span class="lineno">13425</span>     <span class="keywordflow">if</span> (red - blue < dispersion) {</div>
+<div class="line"><a name="l13426"></a><span class="lineno">13426</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l13427"></a><span class="lineno">13427</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l13428"></a><span class="lineno">13428</span>     }</div>
+<div class="line"><a name="l13429"></a><span class="lineno">13429</span> </div>
+<div class="line"><a name="l13430"></a><span class="lineno">13430</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l13431"></a><span class="lineno">13431</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l13432"></a><span class="lineno">13432</span> </div>
+<div class="line"><a name="l13433"></a><span class="lineno">13433</span>     calibration = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l13434"></a><span class="lineno">13434</span>     data = cpl_image_get_data(calibration);</div>
+<div class="line"><a name="l13435"></a><span class="lineno">13435</span> </div>
+<div class="line"><a name="l13436"></a><span class="lineno">13436</span>     length  = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l13437"></a><span class="lineno">13437</span>     nslits  = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l13438"></a><span class="lineno">13438</span>     slit_id = cpl_table_get_data_int(slits, <span class="stringliteral">"slit_id"</span>);</div>
+<div class="line"><a name="l13439"></a><span class="lineno">13439</span>     order   = cpl_table_get_ncol(polytraces) - 2;</div>
+<div class="line"><a name="l13440"></a><span class="lineno">13440</span> </div>
+<div class="line"><a name="l13441"></a><span class="lineno">13441</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l13442"></a><span class="lineno">13442</span> <span class="comment">     * The spatial resampling is performed for a certain number of </span></div>
+<div class="line"><a name="l13443"></a><span class="lineno">13443</span> <span class="comment">     * pixels above and below the position of the reference wavelength:</span></div>
+<div class="line"><a name="l13444"></a><span class="lineno">13444</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l13445"></a><span class="lineno">13445</span> </div>
+<div class="line"><a name="l13446"></a><span class="lineno">13446</span>     pixel_above = STRETCH_FACTOR * (red - reference) / dispersion;</div>
+<div class="line"><a name="l13447"></a><span class="lineno">13447</span>     pixel_below = STRETCH_FACTOR * (reference - blue) / dispersion;</div>
+<div class="line"><a name="l13448"></a><span class="lineno">13448</span> </div>
+<div class="line"><a name="l13449"></a><span class="lineno">13449</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l13450"></a><span class="lineno">13450</span>         </div>
+<div class="line"><a name="l13451"></a><span class="lineno">13451</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l13452"></a><span class="lineno">13452</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13453"></a><span class="lineno">13453</span> </div>
+<div class="line"><a name="l13454"></a><span class="lineno">13454</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l13455"></a><span class="lineno">13455</span> <span class="comment">         * Note that the x coordinate of the reference pixels on the CCD</span></div>
+<div class="line"><a name="l13456"></a><span class="lineno">13456</span> <span class="comment">         * is taken arbitrarily at the top end of each slit. This wouldn't</span></div>
+<div class="line"><a name="l13457"></a><span class="lineno">13457</span> <span class="comment">         * be entirely correct in case of curved slits, or in presence of</span></div>
+<div class="line"><a name="l13458"></a><span class="lineno">13458</span> <span class="comment">         * heavy distortions: in such cases the spatial resampling is</span></div>
+<div class="line"><a name="l13459"></a><span class="lineno">13459</span> <span class="comment">         * really performed across a wide range of wavelengths. But</span></div>
+<div class="line"><a name="l13460"></a><span class="lineno">13460</span> <span class="comment">         * the lag between top and bottom spectral curvature models </span></div>
+<div class="line"><a name="l13461"></a><span class="lineno">13461</span> <span class="comment">         * would introduce even in such cases negligible effects on</span></div>
+<div class="line"><a name="l13462"></a><span class="lineno">13462</span> <span class="comment">         * the spectral spatial resampling.</span></div>
+<div class="line"><a name="l13463"></a><span class="lineno">13463</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l13464"></a><span class="lineno">13464</span> </div>
+<div class="line"><a name="l13465"></a><span class="lineno">13465</span>         refpixel = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);</div>
+<div class="line"><a name="l13466"></a><span class="lineno">13466</span> </div>
+<div class="line"><a name="l13467"></a><span class="lineno">13467</span>         start_pixel = refpixel - pixel_below;</div>
+<div class="line"><a name="l13468"></a><span class="lineno">13468</span>         <span class="keywordflow">if</span> (start_pixel < 0)</div>
+<div class="line"><a name="l13469"></a><span class="lineno">13469</span>             start_pixel = 0;</div>
+<div class="line"><a name="l13470"></a><span class="lineno">13470</span> </div>
+<div class="line"><a name="l13471"></a><span class="lineno">13471</span>         end_pixel = refpixel + pixel_above;</div>
+<div class="line"><a name="l13472"></a><span class="lineno">13472</span>         <span class="keywordflow">if</span> (end_pixel > nx)</div>
+<div class="line"><a name="l13473"></a><span class="lineno">13473</span>             end_pixel = nx;</div>
+<div class="line"><a name="l13474"></a><span class="lineno">13474</span> </div>
+<div class="line"><a name="l13475"></a><span class="lineno">13475</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l13476"></a><span class="lineno">13476</span> <span class="comment">         * Recover from the table of spectral curvature coefficients</span></div>
+<div class="line"><a name="l13477"></a><span class="lineno">13477</span> <span class="comment">         * the curvature polynomials.</span></div>
+<div class="line"><a name="l13478"></a><span class="lineno">13478</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l13479"></a><span class="lineno">13479</span> </div>
+<div class="line"><a name="l13480"></a><span class="lineno">13480</span>         missing_top = 0;</div>
+<div class="line"><a name="l13481"></a><span class="lineno">13481</span>         polytop = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l13482"></a><span class="lineno">13482</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l13483"></a><span class="lineno">13483</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i, &null);</div>
+<div class="line"><a name="l13484"></a><span class="lineno">13484</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l13485"></a><span class="lineno">13485</span>                 cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l13486"></a><span class="lineno">13486</span>                 missing_top = 1;</div>
+<div class="line"><a name="l13487"></a><span class="lineno">13487</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l13488"></a><span class="lineno">13488</span>             }</div>
+<div class="line"><a name="l13489"></a><span class="lineno">13489</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l13490"></a><span class="lineno">13490</span>         }</div>
+<div class="line"><a name="l13491"></a><span class="lineno">13491</span> </div>
+<div class="line"><a name="l13492"></a><span class="lineno">13492</span>         missing_bot = 0;</div>
+<div class="line"><a name="l13493"></a><span class="lineno">13493</span>         polybot = cpl_polynomial_new(1);</div>
+<div class="line"><a name="l13494"></a><span class="lineno">13494</span>         <span class="keywordflow">for</span> (k = 0; k <= order; k++) {</div>
+<div class="line"><a name="l13495"></a><span class="lineno">13495</span>             coeff = cpl_table_get_double(polytraces, clab[k], 2*i+1, &null);</div>
+<div class="line"><a name="l13496"></a><span class="lineno">13496</span>             <span class="keywordflow">if</span> (null) {</div>
+<div class="line"><a name="l13497"></a><span class="lineno">13497</span>                 cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l13498"></a><span class="lineno">13498</span>                 missing_bot = 1;</div>
+<div class="line"><a name="l13499"></a><span class="lineno">13499</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l13500"></a><span class="lineno">13500</span>             }</div>
+<div class="line"><a name="l13501"></a><span class="lineno">13501</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l13502"></a><span class="lineno">13502</span>         }</div>
+<div class="line"><a name="l13503"></a><span class="lineno">13503</span> </div>
+<div class="line"><a name="l13504"></a><span class="lineno">13504</span>         <span class="keywordflow">if</span> (missing_top && missing_bot) {</div>
+<div class="line"><a name="l13505"></a><span class="lineno">13505</span>             cpl_msg_warning(func, <span class="stringliteral">"Spatial map, slit %d was not traced!"</span>, </div>
+<div class="line"><a name="l13506"></a><span class="lineno">13506</span>                             slit_id[i]);</div>
+<div class="line"><a name="l13507"></a><span class="lineno">13507</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13508"></a><span class="lineno">13508</span>         }</div>
+<div class="line"><a name="l13509"></a><span class="lineno">13509</span> </div>
+<div class="line"><a name="l13510"></a><span class="lineno">13510</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l13511"></a><span class="lineno">13511</span> <span class="comment">         * In case just one of the two edges was not traced, the other</span></div>
+<div class="line"><a name="l13512"></a><span class="lineno">13512</span> <span class="comment">         * edge curvature model is duplicated and shifted to the other</span></div>
+<div class="line"><a name="l13513"></a><span class="lineno">13513</span> <span class="comment">         * end of the slit: better than nothing!</span></div>
+<div class="line"><a name="l13514"></a><span class="lineno">13514</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l13515"></a><span class="lineno">13515</span> </div>
+<div class="line"><a name="l13516"></a><span class="lineno">13516</span>         <span class="keywordflow">if</span> (missing_top) {</div>
+<div class="line"><a name="l13517"></a><span class="lineno">13517</span>             cpl_msg_warning(func, <span class="stringliteral">"Upper edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l13518"></a><span class="lineno">13518</span>                             <span class="stringliteral">"the spectral curvature of the lower edge "</span></div>
+<div class="line"><a name="l13519"></a><span class="lineno">13519</span>                             <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l13520"></a><span class="lineno">13520</span>             polytop = cpl_polynomial_duplicate(polybot);</div>
+<div class="line"><a name="l13521"></a><span class="lineno">13521</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l13522"></a><span class="lineno">13522</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l13523"></a><span class="lineno">13523</span>             k = 0;</div>
+<div class="line"><a name="l13524"></a><span class="lineno">13524</span>             coeff = cpl_polynomial_get_coeff(polybot, &k);</div>
+<div class="line"><a name="l13525"></a><span class="lineno">13525</span>             coeff += ytop - ybot;</div>
+<div class="line"><a name="l13526"></a><span class="lineno">13526</span>             cpl_polynomial_set_coeff(polytop, &k, coeff);</div>
+<div class="line"><a name="l13527"></a><span class="lineno">13527</span>         }</div>
+<div class="line"><a name="l13528"></a><span class="lineno">13528</span> </div>
+<div class="line"><a name="l13529"></a><span class="lineno">13529</span>         <span class="keywordflow">if</span> (missing_bot) {</div>
+<div class="line"><a name="l13530"></a><span class="lineno">13530</span>             cpl_msg_warning(func, <span class="stringliteral">"Lower edge of slit %d was not traced: "</span></div>
+<div class="line"><a name="l13531"></a><span class="lineno">13531</span>                             <span class="stringliteral">"the spectral curvature of the upper edge "</span></div>
+<div class="line"><a name="l13532"></a><span class="lineno">13532</span>                             <span class="stringliteral">"is used instead."</span>, slit_id[i]);</div>
+<div class="line"><a name="l13533"></a><span class="lineno">13533</span>             polybot = cpl_polynomial_duplicate(polytop);</div>
+<div class="line"><a name="l13534"></a><span class="lineno">13534</span>             ytop = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>, i, NULL);</div>
+<div class="line"><a name="l13535"></a><span class="lineno">13535</span>             ybot = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, i, NULL);</div>
+<div class="line"><a name="l13536"></a><span class="lineno">13536</span>             k = 0;</div>
+<div class="line"><a name="l13537"></a><span class="lineno">13537</span>             coeff = cpl_polynomial_get_coeff(polytop, &k);</div>
+<div class="line"><a name="l13538"></a><span class="lineno">13538</span>             coeff -= ytop - ybot;</div>
+<div class="line"><a name="l13539"></a><span class="lineno">13539</span>             cpl_polynomial_set_coeff(polybot, &k, coeff);</div>
+<div class="line"><a name="l13540"></a><span class="lineno">13540</span>         }</div>
+<div class="line"><a name="l13541"></a><span class="lineno">13541</span> </div>
+<div class="line"><a name="l13542"></a><span class="lineno">13542</span>         top = cpl_polynomial_eval_1d(polytop, refpixel, NULL);</div>
+<div class="line"><a name="l13543"></a><span class="lineno">13543</span>         bot = cpl_polynomial_eval_1d(polybot, refpixel, NULL);</div>
+<div class="line"><a name="l13544"></a><span class="lineno">13544</span>         npseudo = ceil(top-bot) + 1;</div>
+<div class="line"><a name="l13545"></a><span class="lineno">13545</span> </div>
+<div class="line"><a name="l13546"></a><span class="lineno">13546</span>         <span class="keywordflow">if</span> (npseudo < 1) {</div>
+<div class="line"><a name="l13547"></a><span class="lineno">13547</span>             cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l13548"></a><span class="lineno">13548</span>             cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l13549"></a><span class="lineno">13549</span>             cpl_msg_warning(func, <span class="stringliteral">"Slit %d was badly traced: no extraction!"</span>,</div>
+<div class="line"><a name="l13550"></a><span class="lineno">13550</span>                             slit_id[i]);</div>
+<div class="line"><a name="l13551"></a><span class="lineno">13551</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13552"></a><span class="lineno">13552</span>         }</div>
+<div class="line"><a name="l13553"></a><span class="lineno">13553</span> </div>
+<div class="line"><a name="l13554"></a><span class="lineno">13554</span>         <span class="keywordflow">for</span> (j = start_pixel; j < end_pixel; j++) {</div>
+<div class="line"><a name="l13555"></a><span class="lineno">13555</span>             top = cpl_polynomial_eval_1d(polytop, j, NULL);</div>
+<div class="line"><a name="l13556"></a><span class="lineno">13556</span>             bot = cpl_polynomial_eval_1d(polybot, j, NULL);</div>
+<div class="line"><a name="l13557"></a><span class="lineno">13557</span>             factor = (top-bot)/npseudo;</div>
+<div class="line"><a name="l13558"></a><span class="lineno">13558</span>             <span class="keywordflow">for</span> (k = 0; k <= npseudo; k++) {</div>
+<div class="line"><a name="l13559"></a><span class="lineno">13559</span>                 ypos = top - k*factor;</div>
+<div class="line"><a name="l13560"></a><span class="lineno">13560</span>                 yint = ypos;</div>
+<div class="line"><a name="l13561"></a><span class="lineno">13561</span>                 yfra = ypos - yint;</div>
+<div class="line"><a name="l13562"></a><span class="lineno">13562</span>                 <span class="keywordflow">if</span> (yint >= 0 && yint < ny-1) {</div>
+<div class="line"><a name="l13563"></a><span class="lineno">13563</span>                     data[j + nx*yint] = (top-yint)/factor;</div>
+<div class="line"><a name="l13564"></a><span class="lineno">13564</span>                     <span class="keywordflow">if</span> (k) {</div>
+<div class="line"><a name="l13565"></a><span class="lineno">13565</span> </div>
+<div class="line"><a name="l13566"></a><span class="lineno">13566</span>                         <span class="comment">/*</span></div>
+<div class="line"><a name="l13567"></a><span class="lineno">13567</span> <span class="comment">                         * This is added to recover lost pixels on</span></div>
+<div class="line"><a name="l13568"></a><span class="lineno">13568</span> <span class="comment">                         * the CCD image (pixels are lost because</span></div>
+<div class="line"><a name="l13569"></a><span class="lineno">13569</span> <span class="comment">                         * the CCD pixels are less than npseudo+1).</span></div>
+<div class="line"><a name="l13570"></a><span class="lineno">13570</span> <span class="comment">                         */</span></div>
+<div class="line"><a name="l13571"></a><span class="lineno">13571</span> </div>
+<div class="line"><a name="l13572"></a><span class="lineno">13572</span>                         <span class="keywordflow">if</span> (yprev - yint > 1) {</div>
+<div class="line"><a name="l13573"></a><span class="lineno">13573</span>                             data[j + nx*(yint+1)] = (top-yint-1)/factor;</div>
+<div class="line"><a name="l13574"></a><span class="lineno">13574</span>                         }</div>
+<div class="line"><a name="l13575"></a><span class="lineno">13575</span>                     }</div>
+<div class="line"><a name="l13576"></a><span class="lineno">13576</span>                 }</div>
+<div class="line"><a name="l13577"></a><span class="lineno">13577</span>                 yprev = yint;</div>
+<div class="line"><a name="l13578"></a><span class="lineno">13578</span>             }</div>
+<div class="line"><a name="l13579"></a><span class="lineno">13579</span>         }</div>
+<div class="line"><a name="l13580"></a><span class="lineno">13580</span>         cpl_polynomial_delete(polytop);</div>
+<div class="line"><a name="l13581"></a><span class="lineno">13581</span>         cpl_polynomial_delete(polybot);</div>
+<div class="line"><a name="l13582"></a><span class="lineno">13582</span>     }</div>
+<div class="line"><a name="l13583"></a><span class="lineno">13583</span> </div>
+<div class="line"><a name="l13584"></a><span class="lineno">13584</span>     <span class="keywordflow">return</span> calibration;</div>
+<div class="line"><a name="l13585"></a><span class="lineno">13585</span> }</div>
+<div class="line"><a name="l13586"></a><span class="lineno">13586</span> </div>
+<div class="line"><a name="l13587"></a><span class="lineno">13587</span> </div>
+<div class="line"><a name="l13650"></a><span class="lineno"><a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7">13650</a></span> cpl_image *<a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(cpl_image *image, cpl_table *slits, <span class="keywordtype">int</span> margin,</div>
+<div class="line"><a name="l13651"></a><span class="lineno">13651</span>                               <span class="keywordtype">int</span> maxradius, <span class="keywordtype">int</span> conradius)</div>
+<div class="line"><a name="l13652"></a><span class="lineno">13652</span> {</div>
+<div class="line"><a name="l13653"></a><span class="lineno">13653</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_detect_objects"</span>;</div>
+<div class="line"><a name="l13654"></a><span class="lineno">13654</span> </div>
+<div class="line"><a name="l13655"></a><span class="lineno">13655</span>     cpl_image  *profile;</div>
+<div class="line"><a name="l13656"></a><span class="lineno">13656</span>     <span class="keywordtype">float</span>      *pdata;</div>
+<div class="line"><a name="l13657"></a><span class="lineno">13657</span>     <span class="keywordtype">float</span>      *p;</div>
+<div class="line"><a name="l13658"></a><span class="lineno">13658</span> </div>
+<div class="line"><a name="l13659"></a><span class="lineno">13659</span>     <span class="keywordtype">char</span>        name[MAX_COLNAME];</div>
+<div class="line"><a name="l13660"></a><span class="lineno">13660</span> </div>
+<div class="line"><a name="l13661"></a><span class="lineno">13661</span>     <span class="keywordtype">int</span>         nslits;</div>
+<div class="line"><a name="l13662"></a><span class="lineno">13662</span>     <span class="keywordtype">int</span>         npeaks;</div>
+<div class="line"><a name="l13663"></a><span class="lineno">13663</span>     <span class="keywordtype">int</span>         nobjects, objpos, totobj;</div>
+<div class="line"><a name="l13664"></a><span class="lineno">13664</span>     <span class="keywordtype">int</span>         maxobjects;</div>
+<div class="line"><a name="l13665"></a><span class="lineno">13665</span>     <span class="keywordtype">int</span>        *position;</div>
+<div class="line"><a name="l13666"></a><span class="lineno">13666</span>     <span class="keywordtype">int</span>        *length;</div>
+<div class="line"><a name="l13667"></a><span class="lineno">13667</span>     <span class="keywordtype">int</span>        *reject;</div>
+<div class="line"><a name="l13668"></a><span class="lineno">13668</span>     <span class="keywordtype">double</span>     *place;</div>
+<div class="line"><a name="l13669"></a><span class="lineno">13669</span>     <span class="keywordtype">double</span>     *bright;</div>
+<div class="line"><a name="l13670"></a><span class="lineno">13670</span>     <span class="keywordtype">double</span>      mindistance;</div>
+<div class="line"><a name="l13671"></a><span class="lineno">13671</span>     <span class="keywordtype">int</span>         pos, count;</div>
+<div class="line"><a name="l13672"></a><span class="lineno">13672</span>     <span class="keywordtype">int</span>         up;</div>
+<div class="line"><a name="l13673"></a><span class="lineno">13673</span>     <span class="keywordtype">int</span>         low, hig;</div>
+<div class="line"><a name="l13674"></a><span class="lineno">13674</span>     <span class="keywordtype">int</span>         row;</div>
+<div class="line"><a name="l13675"></a><span class="lineno">13675</span>     <span class="keywordtype">int</span>         i, j, k;</div>
+<div class="line"><a name="l13676"></a><span class="lineno">13676</span> </div>
+<div class="line"><a name="l13677"></a><span class="lineno">13677</span>     <span class="keyword">const</span> <span class="keywordtype">int</span>   min_pixels = 10;</div>
+<div class="line"><a name="l13678"></a><span class="lineno">13678</span> </div>
+<div class="line"><a name="l13679"></a><span class="lineno">13679</span>     </div>
+<div class="line"><a name="l13680"></a><span class="lineno">13680</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l13681"></a><span class="lineno">13681</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l13682"></a><span class="lineno">13682</span>  </div>
+<div class="line"><a name="l13683"></a><span class="lineno">13683</span>     <span class="keywordflow">if</span> (image == NULL || slits == NULL) { </div>
+<div class="line"><a name="l13684"></a><span class="lineno">13684</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l13685"></a><span class="lineno">13685</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l13686"></a><span class="lineno">13686</span>     }</div>
+<div class="line"><a name="l13687"></a><span class="lineno">13687</span> </div>
+<div class="line"><a name="l13688"></a><span class="lineno">13688</span>     <span class="keywordflow">if</span> (margin < 0)</div>
+<div class="line"><a name="l13689"></a><span class="lineno">13689</span>         margin = 0;</div>
+<div class="line"><a name="l13690"></a><span class="lineno">13690</span> </div>
+<div class="line"><a name="l13691"></a><span class="lineno">13691</span>     <span class="keywordflow">if</span> (maxradius < 0) {</div>
+<div class="line"><a name="l13692"></a><span class="lineno">13692</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l13693"></a><span class="lineno">13693</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l13694"></a><span class="lineno">13694</span>     }</div>
+<div class="line"><a name="l13695"></a><span class="lineno">13695</span> </div>
+<div class="line"><a name="l13696"></a><span class="lineno">13696</span>     <span class="keywordflow">if</span> (conradius < 0) {</div>
+<div class="line"><a name="l13697"></a><span class="lineno">13697</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l13698"></a><span class="lineno">13698</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l13699"></a><span class="lineno">13699</span>     }</div>
+<div class="line"><a name="l13700"></a><span class="lineno">13700</span> </div>
+<div class="line"><a name="l13701"></a><span class="lineno">13701</span>     nslits   = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l13702"></a><span class="lineno">13702</span>     position = cpl_table_get_data_int(slits, <span class="stringliteral">"position"</span>);</div>
+<div class="line"><a name="l13703"></a><span class="lineno">13703</span>     length   = cpl_table_get_data_int(slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l13704"></a><span class="lineno">13704</span> </div>
+<div class="line"><a name="l13705"></a><span class="lineno">13705</span>     profile = cpl_image_collapse_create(image, 1);</div>
+<div class="line"><a name="l13706"></a><span class="lineno">13706</span>     cpl_image_divide_scalar(profile, cpl_image_get_size_x(image));</div>
+<div class="line"><a name="l13707"></a><span class="lineno">13707</span>     pdata = cpl_image_get_data(profile);</div>
+<div class="line"><a name="l13708"></a><span class="lineno">13708</span> </div>
+<div class="line"><a name="l13709"></a><span class="lineno">13709</span>     row = 1;</div>
+<div class="line"><a name="l13710"></a><span class="lineno">13710</span>     maxobjects = 0;</div>
+<div class="line"><a name="l13711"></a><span class="lineno">13711</span>     totobj = 0;</div>
+<div class="line"><a name="l13712"></a><span class="lineno">13712</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l13713"></a><span class="lineno">13713</span> </div>
+<div class="line"><a name="l13714"></a><span class="lineno">13714</span>         <span class="keywordflow">if</span> (length[i] == 0)</div>
+<div class="line"><a name="l13715"></a><span class="lineno">13715</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13716"></a><span class="lineno">13716</span> </div>
+<div class="line"><a name="l13717"></a><span class="lineno">13717</span>         pos = position[i] + margin;</div>
+<div class="line"><a name="l13718"></a><span class="lineno">13718</span>         count = length[i] - 2*margin;</div>
+<div class="line"><a name="l13719"></a><span class="lineno">13719</span> </div>
+<div class="line"><a name="l13720"></a><span class="lineno">13720</span>         <span class="keywordflow">if</span> (count < min_pixels)</div>
+<div class="line"><a name="l13721"></a><span class="lineno">13721</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13722"></a><span class="lineno">13722</span> </div>
+<div class="line"><a name="l13723"></a><span class="lineno">13723</span>         p = pdata + pos;</div>
+<div class="line"><a name="l13724"></a><span class="lineno">13724</span> </div>
+<div class="line"><a name="l13725"></a><span class="lineno">13725</span> </div>
+<div class="line"><a name="l13726"></a><span class="lineno">13726</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l13727"></a><span class="lineno">13727</span> <span class="comment">         * Count peaks candidates</span></div>
+<div class="line"><a name="l13728"></a><span class="lineno">13728</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l13729"></a><span class="lineno">13729</span> </div>
+<div class="line"><a name="l13730"></a><span class="lineno">13730</span>         npeaks = 0;</div>
+<div class="line"><a name="l13731"></a><span class="lineno">13731</span>         <span class="keywordflow">if</span> (p[0] > p[1] && p[1] > p[2] && p[2] > p[3] && p[3] > 0) {</div>
+<div class="line"><a name="l13732"></a><span class="lineno">13732</span>             npeaks++;</div>
+<div class="line"><a name="l13733"></a><span class="lineno">13733</span>         }</div>
+<div class="line"><a name="l13734"></a><span class="lineno">13734</span> </div>
+<div class="line"><a name="l13735"></a><span class="lineno">13735</span>         up = 0;</div>
+<div class="line"><a name="l13736"></a><span class="lineno">13736</span>         <span class="keywordflow">for</span> (j = 0; j < count - 3; j++) {</div>
+<div class="line"><a name="l13737"></a><span class="lineno">13737</span>             <span class="keywordflow">if</span> (p[j] > 0) {</div>
+<div class="line"><a name="l13738"></a><span class="lineno">13738</span>                 <span class="keywordflow">if</span> (p[j+1] > p[j]) {</div>
+<div class="line"><a name="l13739"></a><span class="lineno">13739</span>                     up++;</div>
+<div class="line"><a name="l13740"></a><span class="lineno">13740</span>                 }</div>
+<div class="line"><a name="l13741"></a><span class="lineno">13741</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13742"></a><span class="lineno">13742</span>                     <span class="keywordflow">if</span> (up > 2) {</div>
+<div class="line"><a name="l13743"></a><span class="lineno">13743</span>                         <span class="keywordflow">if</span> (p[j+1] > p[j+2] && p[j+2] > 0) {</div>
+<div class="line"><a name="l13744"></a><span class="lineno">13744</span>                             <span class="keywordflow">if</span> (p[j] > 5)</div>
+<div class="line"><a name="l13745"></a><span class="lineno">13745</span>                                 npeaks++;</div>
+<div class="line"><a name="l13746"></a><span class="lineno">13746</span>                         }</div>
+<div class="line"><a name="l13747"></a><span class="lineno">13747</span>                     }</div>
+<div class="line"><a name="l13748"></a><span class="lineno">13748</span>                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (up > 1) {</div>
+<div class="line"><a name="l13749"></a><span class="lineno">13749</span>                         <span class="keywordflow">if</span> (p[j+1] > p[j+2] && p[j+2] > p[j+3] && p[j+3] > 0) {</div>
+<div class="line"><a name="l13750"></a><span class="lineno">13750</span>                             <span class="keywordflow">if</span> (p[j] > 5)</div>
+<div class="line"><a name="l13751"></a><span class="lineno">13751</span>                                 npeaks++;</div>
+<div class="line"><a name="l13752"></a><span class="lineno">13752</span>                         }</div>
+<div class="line"><a name="l13753"></a><span class="lineno">13753</span>                     }</div>
+<div class="line"><a name="l13754"></a><span class="lineno">13754</span>                     up = 0;</div>
+<div class="line"><a name="l13755"></a><span class="lineno">13755</span>                 }</div>
+<div class="line"><a name="l13756"></a><span class="lineno">13756</span>             }</div>
+<div class="line"><a name="l13757"></a><span class="lineno">13757</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13758"></a><span class="lineno">13758</span>                 up = 0;</div>
+<div class="line"><a name="l13759"></a><span class="lineno">13759</span>             }</div>
+<div class="line"><a name="l13760"></a><span class="lineno">13760</span>         }</div>
+<div class="line"><a name="l13761"></a><span class="lineno">13761</span> </div>
+<div class="line"><a name="l13762"></a><span class="lineno">13762</span>         <span class="keywordflow">if</span> (p[count-1] > p[count-2] && p[count-2] > p[count-3] </div>
+<div class="line"><a name="l13763"></a><span class="lineno">13763</span>             && p[count-3] > p[count-4] && p[count-4] > 0) {</div>
+<div class="line"><a name="l13764"></a><span class="lineno">13764</span>             npeaks++;</div>
+<div class="line"><a name="l13765"></a><span class="lineno">13765</span>         }</div>
+<div class="line"><a name="l13766"></a><span class="lineno">13766</span> </div>
+<div class="line"><a name="l13767"></a><span class="lineno">13767</span>         <span class="keywordflow">if</span> (npeaks == 0)</div>
+<div class="line"><a name="l13768"></a><span class="lineno">13768</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13769"></a><span class="lineno">13769</span> </div>
+<div class="line"><a name="l13770"></a><span class="lineno">13770</span> </div>
+<div class="line"><a name="l13771"></a><span class="lineno">13771</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l13772"></a><span class="lineno">13772</span> <span class="comment">         * Get candidates parameters</span></div>
+<div class="line"><a name="l13773"></a><span class="lineno">13773</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l13774"></a><span class="lineno">13774</span> </div>
+<div class="line"><a name="l13775"></a><span class="lineno">13775</span>         reject = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l13776"></a><span class="lineno">13776</span>         bright = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l13777"></a><span class="lineno">13777</span>         place  = cpl_calloc(npeaks, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l13778"></a><span class="lineno">13778</span> </div>
+<div class="line"><a name="l13779"></a><span class="lineno">13779</span>         npeaks = 0;</div>
+<div class="line"><a name="l13780"></a><span class="lineno">13780</span>         <span class="keywordflow">if</span> (p[0] > p[1] && p[1] > p[2] && p[2] > p[3] && p[3] > 0) {</div>
+<div class="line"><a name="l13781"></a><span class="lineno">13781</span>             bright[0] = p[0];</div>
+<div class="line"><a name="l13782"></a><span class="lineno">13782</span>             place[0] = position[i] + margin;</div>
+<div class="line"><a name="l13783"></a><span class="lineno">13783</span>             npeaks++;</div>
+<div class="line"><a name="l13784"></a><span class="lineno">13784</span>         }</div>
+<div class="line"><a name="l13785"></a><span class="lineno">13785</span> </div>
+<div class="line"><a name="l13786"></a><span class="lineno">13786</span>         up = 0;</div>
+<div class="line"><a name="l13787"></a><span class="lineno">13787</span>         <span class="keywordflow">for</span> (j = 0; j < count - 3; j++) {</div>
+<div class="line"><a name="l13788"></a><span class="lineno">13788</span>             <span class="keywordflow">if</span> (p[j] > 0) {</div>
+<div class="line"><a name="l13789"></a><span class="lineno">13789</span>                 <span class="keywordflow">if</span> (p[j+1] > p[j]) {</div>
+<div class="line"><a name="l13790"></a><span class="lineno">13790</span>                     up++;</div>
+<div class="line"><a name="l13791"></a><span class="lineno">13791</span>                 }</div>
+<div class="line"><a name="l13792"></a><span class="lineno">13792</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13793"></a><span class="lineno">13793</span>                     <span class="keywordflow">if</span> (up > 2) {</div>
+<div class="line"><a name="l13794"></a><span class="lineno">13794</span>                         <span class="keywordflow">if</span> (p[j+1] > p[j+2] && p[j+2] > 0) {</div>
+<div class="line"><a name="l13795"></a><span class="lineno">13795</span>                             <span class="keywordflow">if</span> (p[j] > 5) {</div>
+<div class="line"><a name="l13796"></a><span class="lineno">13796</span>                                 bright[npeaks] = p[j];</div>
+<div class="line"><a name="l13797"></a><span class="lineno">13797</span>                                 place[npeaks] = position[i] + margin + j + 1</div>
+<div class="line"><a name="l13798"></a><span class="lineno">13798</span>                                        + values_to_dx(p[j-1], p[j], p[j+1]);</div>
+<div class="line"><a name="l13799"></a><span class="lineno">13799</span>                                 npeaks++;</div>
+<div class="line"><a name="l13800"></a><span class="lineno">13800</span>                             }</div>
+<div class="line"><a name="l13801"></a><span class="lineno">13801</span>                         }</div>
+<div class="line"><a name="l13802"></a><span class="lineno">13802</span>                     }</div>
+<div class="line"><a name="l13803"></a><span class="lineno">13803</span>                     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (up > 1) {</div>
+<div class="line"><a name="l13804"></a><span class="lineno">13804</span>                         <span class="keywordflow">if</span> (p[j+1] > p[j+2] && p[j+2] > p[j+3] && p[j+3] > 0) {</div>
+<div class="line"><a name="l13805"></a><span class="lineno">13805</span>                             <span class="keywordflow">if</span> (p[j] > 5) {</div>
+<div class="line"><a name="l13806"></a><span class="lineno">13806</span>                                 bright[npeaks] = p[j];</div>
+<div class="line"><a name="l13807"></a><span class="lineno">13807</span>                                 place[npeaks] = position[i] + margin + j + 1</div>
+<div class="line"><a name="l13808"></a><span class="lineno">13808</span>                                        + values_to_dx(p[j-1], p[j], p[j+1]);</div>
+<div class="line"><a name="l13809"></a><span class="lineno">13809</span>                                 npeaks++;</div>
+<div class="line"><a name="l13810"></a><span class="lineno">13810</span>                             }</div>
+<div class="line"><a name="l13811"></a><span class="lineno">13811</span>                         }</div>
+<div class="line"><a name="l13812"></a><span class="lineno">13812</span>                     }</div>
+<div class="line"><a name="l13813"></a><span class="lineno">13813</span>                     up = 0;</div>
+<div class="line"><a name="l13814"></a><span class="lineno">13814</span>                 }</div>
+<div class="line"><a name="l13815"></a><span class="lineno">13815</span>             }</div>
+<div class="line"><a name="l13816"></a><span class="lineno">13816</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13817"></a><span class="lineno">13817</span>                 up = 0;</div>
+<div class="line"><a name="l13818"></a><span class="lineno">13818</span>             }</div>
+<div class="line"><a name="l13819"></a><span class="lineno">13819</span>         }</div>
+<div class="line"><a name="l13820"></a><span class="lineno">13820</span> </div>
+<div class="line"><a name="l13821"></a><span class="lineno">13821</span>         <span class="keywordflow">if</span> (p[count-1] > p[count-2] && p[count-2] > p[count-3]</div>
+<div class="line"><a name="l13822"></a><span class="lineno">13822</span>             && p[count-3] > p[count-4] && p[count-4] > 0) {</div>
+<div class="line"><a name="l13823"></a><span class="lineno">13823</span>             bright[npeaks] = p[count-1];</div>
+<div class="line"><a name="l13824"></a><span class="lineno">13824</span>             place[npeaks] = position[i] + count;</div>
+<div class="line"><a name="l13825"></a><span class="lineno">13825</span>             npeaks++;</div>
+<div class="line"><a name="l13826"></a><span class="lineno">13826</span>         }</div>
+<div class="line"><a name="l13827"></a><span class="lineno">13827</span> </div>
+<div class="line"><a name="l13828"></a><span class="lineno">13828</span> </div>
+<div class="line"><a name="l13829"></a><span class="lineno">13829</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l13830"></a><span class="lineno">13830</span> <span class="comment">         * Now select the uncontaminated peaks</span></div>
+<div class="line"><a name="l13831"></a><span class="lineno">13831</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l13832"></a><span class="lineno">13832</span> </div>
+<div class="line"><a name="l13833"></a><span class="lineno">13833</span>         <span class="keywordflow">if</span> (fabs(place[0] - pos) < 1.0)</div>
+<div class="line"><a name="l13834"></a><span class="lineno">13834</span>             reject[0] = 1;</div>
+<div class="line"><a name="l13835"></a><span class="lineno">13835</span>         <span class="keywordflow">if</span> (fabs(place[npeaks-1] - pos - count) < 1.0)</div>
+<div class="line"><a name="l13836"></a><span class="lineno">13836</span>             reject[npeaks-1] = 1;</div>
+<div class="line"><a name="l13837"></a><span class="lineno">13837</span>         <span class="keywordflow">for</span> (j = 0; j < npeaks; j++) {</div>
+<div class="line"><a name="l13838"></a><span class="lineno">13838</span>             <span class="keywordflow">for</span> (k = 0; k < npeaks; k++) {</div>
+<div class="line"><a name="l13839"></a><span class="lineno">13839</span>                 <span class="keywordflow">if</span> (k == j)</div>
+<div class="line"><a name="l13840"></a><span class="lineno">13840</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13841"></a><span class="lineno">13841</span>                 mindistance = conradius * bright[k] / bright[j] </div>
+<div class="line"><a name="l13842"></a><span class="lineno">13842</span>                                         * bright[k] / bright[j];</div>
+<div class="line"><a name="l13843"></a><span class="lineno">13843</span>                 <span class="keywordflow">if</span> (fabs(place[j] - place[k]) < mindistance)</div>
+<div class="line"><a name="l13844"></a><span class="lineno">13844</span>                     reject[j] = 1;</div>
+<div class="line"><a name="l13845"></a><span class="lineno">13845</span>             }</div>
+<div class="line"><a name="l13846"></a><span class="lineno">13846</span>         }</div>
+<div class="line"><a name="l13847"></a><span class="lineno">13847</span> </div>
+<div class="line"><a name="l13848"></a><span class="lineno">13848</span> <span class="comment">/* new part */</span></div>
+<div class="line"><a name="l13849"></a><span class="lineno">13849</span>         <span class="keywordflow">for</span> (j = 0; j < npeaks; j++) {</div>
+<div class="line"><a name="l13850"></a><span class="lineno">13850</span>             <span class="keywordflow">if</span> (reject[j])</div>
+<div class="line"><a name="l13851"></a><span class="lineno">13851</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13852"></a><span class="lineno">13852</span>             <span class="keywordflow">if</span> (j) {</div>
+<div class="line"><a name="l13853"></a><span class="lineno">13853</span>                 low = (place[j-1]*bright[j] + place[j]*bright[j-1])</div>
+<div class="line"><a name="l13854"></a><span class="lineno">13854</span>                     / (bright[j-1] + bright[j]) + 1;</div>
+<div class="line"><a name="l13855"></a><span class="lineno">13855</span>             }</div>
+<div class="line"><a name="l13856"></a><span class="lineno">13856</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13857"></a><span class="lineno">13857</span>                 low = pos;</div>
+<div class="line"><a name="l13858"></a><span class="lineno">13858</span>             }</div>
+<div class="line"><a name="l13859"></a><span class="lineno">13859</span>             <span class="keywordflow">if</span> (j < npeaks - 1) {</div>
+<div class="line"><a name="l13860"></a><span class="lineno">13860</span>                 hig = (place[j+1]*bright[j] + place[j]*bright[j+1])</div>
+<div class="line"><a name="l13861"></a><span class="lineno">13861</span>                     / (bright[j+1] + bright[j]) + 1;</div>
+<div class="line"><a name="l13862"></a><span class="lineno">13862</span>             }</div>
+<div class="line"><a name="l13863"></a><span class="lineno">13863</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13864"></a><span class="lineno">13864</span>                 hig = pos + count;</div>
+<div class="line"><a name="l13865"></a><span class="lineno">13865</span>             }</div>
+<div class="line"><a name="l13866"></a><span class="lineno">13866</span> </div>
+<div class="line"><a name="l13867"></a><span class="lineno">13867</span>             <span class="keywordflow">if</span> (low < pos)</div>
+<div class="line"><a name="l13868"></a><span class="lineno">13868</span>                 low = pos;</div>
+<div class="line"><a name="l13869"></a><span class="lineno">13869</span>             <span class="keywordflow">if</span> (hig > pos + count)</div>
+<div class="line"><a name="l13870"></a><span class="lineno">13870</span>                 hig = pos + count;</div>
+<div class="line"><a name="l13871"></a><span class="lineno">13871</span>             <span class="keywordflow">if</span> (place[j] - low > maxradius)</div>
+<div class="line"><a name="l13872"></a><span class="lineno">13872</span>                 low = place[j] - maxradius;</div>
+<div class="line"><a name="l13873"></a><span class="lineno">13873</span>             <span class="keywordflow">if</span> (hig - place[j] > maxradius)</div>
+<div class="line"><a name="l13874"></a><span class="lineno">13874</span>                 hig = place[j] + maxradius;</div>
+<div class="line"><a name="l13875"></a><span class="lineno">13875</span>             <span class="keywordflow">if</span> (hig == low)</div>
+<div class="line"><a name="l13876"></a><span class="lineno">13876</span>                 reject[j] = 1;</div>
+<div class="line"><a name="l13877"></a><span class="lineno">13877</span>         }</div>
+<div class="line"><a name="l13878"></a><span class="lineno">13878</span> <span class="comment">/* end new part */</span></div>
+<div class="line"><a name="l13879"></a><span class="lineno">13879</span> </div>
+<div class="line"><a name="l13880"></a><span class="lineno">13880</span>         nobjects = npeaks;</div>
+<div class="line"><a name="l13881"></a><span class="lineno">13881</span>         <span class="keywordflow">for</span> (j = 0; j < npeaks; j++)</div>
+<div class="line"><a name="l13882"></a><span class="lineno">13882</span>             <span class="keywordflow">if</span> (reject[j])</div>
+<div class="line"><a name="l13883"></a><span class="lineno">13883</span>                 nobjects--;</div>
+<div class="line"><a name="l13884"></a><span class="lineno">13884</span> </div>
+<div class="line"><a name="l13885"></a><span class="lineno">13885</span>         <span class="keywordflow">for</span> (j = 0; j < nobjects; j++) {</div>
+<div class="line"><a name="l13886"></a><span class="lineno">13886</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, j+1);</div>
+<div class="line"><a name="l13887"></a><span class="lineno">13887</span>             <span class="keywordflow">if</span> (cpl_table_has_column(slits, name))</div>
+<div class="line"><a name="l13888"></a><span class="lineno">13888</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13889"></a><span class="lineno">13889</span>             cpl_table_new_column(slits, name, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l13890"></a><span class="lineno">13890</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"start_%d"</span>, j+1);</div>
+<div class="line"><a name="l13891"></a><span class="lineno">13891</span>             cpl_table_new_column(slits, name, CPL_TYPE_INT);</div>
+<div class="line"><a name="l13892"></a><span class="lineno">13892</span>             cpl_table_set_column_unit(slits, name, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l13893"></a><span class="lineno">13893</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"end_%d"</span>, j+1);</div>
+<div class="line"><a name="l13894"></a><span class="lineno">13894</span>             cpl_table_new_column(slits, name, CPL_TYPE_INT);</div>
+<div class="line"><a name="l13895"></a><span class="lineno">13895</span>             cpl_table_set_column_unit(slits, name, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l13896"></a><span class="lineno">13896</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"row_%d"</span>, j+1);</div>
+<div class="line"><a name="l13897"></a><span class="lineno">13897</span>             cpl_table_new_column(slits, name, CPL_TYPE_INT);</div>
+<div class="line"><a name="l13898"></a><span class="lineno">13898</span>             cpl_table_set_column_unit(slits, name, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l13899"></a><span class="lineno">13899</span>         }</div>
+<div class="line"><a name="l13900"></a><span class="lineno">13900</span> </div>
+<div class="line"><a name="l13901"></a><span class="lineno">13901</span>         objpos = nobjects;</div>
+<div class="line"><a name="l13902"></a><span class="lineno">13902</span>         <span class="keywordflow">for</span> (j = 0; j < npeaks; j++) {</div>
+<div class="line"><a name="l13903"></a><span class="lineno">13903</span>             <span class="keywordflow">if</span> (reject[j])</div>
+<div class="line"><a name="l13904"></a><span class="lineno">13904</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l13905"></a><span class="lineno">13905</span>             <span class="keywordflow">if</span> (j) {</div>
+<div class="line"><a name="l13906"></a><span class="lineno">13906</span>                 low = (place[j-1]*bright[j] + place[j]*bright[j-1])</div>
+<div class="line"><a name="l13907"></a><span class="lineno">13907</span>                     / (bright[j-1] + bright[j]) + 1;</div>
+<div class="line"><a name="l13908"></a><span class="lineno">13908</span>             }</div>
+<div class="line"><a name="l13909"></a><span class="lineno">13909</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13910"></a><span class="lineno">13910</span>                low = pos;</div>
+<div class="line"><a name="l13911"></a><span class="lineno">13911</span>             }</div>
+<div class="line"><a name="l13912"></a><span class="lineno">13912</span>             <span class="keywordflow">if</span> (j < npeaks - 1) {</div>
+<div class="line"><a name="l13913"></a><span class="lineno">13913</span>                 hig = (place[j+1]*bright[j] + place[j]*bright[j+1])</div>
+<div class="line"><a name="l13914"></a><span class="lineno">13914</span>                     / (bright[j+1] + bright[j]) + 1;</div>
+<div class="line"><a name="l13915"></a><span class="lineno">13915</span>             }</div>
+<div class="line"><a name="l13916"></a><span class="lineno">13916</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l13917"></a><span class="lineno">13917</span>                 hig = pos + count;</div>
+<div class="line"><a name="l13918"></a><span class="lineno">13918</span>             }</div>
+<div class="line"><a name="l13919"></a><span class="lineno">13919</span> </div>
+<div class="line"><a name="l13920"></a><span class="lineno">13920</span>             <span class="keywordflow">if</span> (low < pos)</div>
+<div class="line"><a name="l13921"></a><span class="lineno">13921</span>                 low = pos;</div>
+<div class="line"><a name="l13922"></a><span class="lineno">13922</span>             <span class="keywordflow">if</span> (hig > pos + count)</div>
+<div class="line"><a name="l13923"></a><span class="lineno">13923</span>                 hig = pos + count;</div>
+<div class="line"><a name="l13924"></a><span class="lineno">13924</span>             <span class="keywordflow">if</span> (place[j] - low > maxradius)</div>
+<div class="line"><a name="l13925"></a><span class="lineno">13925</span>                 low = place[j] - maxradius;</div>
+<div class="line"><a name="l13926"></a><span class="lineno">13926</span>             <span class="keywordflow">if</span> (hig - place[j] > maxradius)</div>
+<div class="line"><a name="l13927"></a><span class="lineno">13927</span>                 hig = place[j] + maxradius;</div>
+<div class="line"><a name="l13928"></a><span class="lineno">13928</span> </div>
+<div class="line"><a name="l13929"></a><span class="lineno">13929</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, objpos);</div>
+<div class="line"><a name="l13930"></a><span class="lineno">13930</span>             cpl_table_set_double(slits, name, i, place[j]);</div>
+<div class="line"><a name="l13931"></a><span class="lineno">13931</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"start_%d"</span>, objpos);</div>
+<div class="line"><a name="l13932"></a><span class="lineno">13932</span>             cpl_table_set_int(slits, name, i, low);</div>
+<div class="line"><a name="l13933"></a><span class="lineno">13933</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"end_%d"</span>, objpos);</div>
+<div class="line"><a name="l13934"></a><span class="lineno">13934</span>             cpl_table_set_int(slits, name, i, hig);</div>
+<div class="line"><a name="l13935"></a><span class="lineno">13935</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"row_%d"</span>, objpos);</div>
+<div class="line"><a name="l13936"></a><span class="lineno">13936</span>             cpl_table_set_int(slits, name, i, row + objpos - 1);</div>
+<div class="line"><a name="l13937"></a><span class="lineno">13937</span>             totobj++;</div>
+<div class="line"><a name="l13938"></a><span class="lineno">13938</span>             objpos--;</div>
+<div class="line"><a name="l13939"></a><span class="lineno">13939</span>         }</div>
+<div class="line"><a name="l13940"></a><span class="lineno">13940</span> </div>
+<div class="line"><a name="l13941"></a><span class="lineno">13941</span>         row += nobjects;</div>
+<div class="line"><a name="l13942"></a><span class="lineno">13942</span> </div>
+<div class="line"><a name="l13943"></a><span class="lineno">13943</span>         <span class="keywordflow">if</span> (maxobjects < nobjects)</div>
+<div class="line"><a name="l13944"></a><span class="lineno">13944</span>             maxobjects = nobjects;</div>
+<div class="line"><a name="l13945"></a><span class="lineno">13945</span> </div>
+<div class="line"><a name="l13946"></a><span class="lineno">13946</span>         cpl_free(reject);</div>
+<div class="line"><a name="l13947"></a><span class="lineno">13947</span>         cpl_free(bright);</div>
+<div class="line"><a name="l13948"></a><span class="lineno">13948</span>         cpl_free(place);</div>
+<div class="line"><a name="l13949"></a><span class="lineno">13949</span> </div>
+<div class="line"><a name="l13950"></a><span class="lineno">13950</span>     }</div>
+<div class="line"><a name="l13951"></a><span class="lineno">13951</span> </div>
+<div class="line"><a name="l13952"></a><span class="lineno">13952</span> <span class="comment">/*    nobjects = row - nobjects;     A bug, I think... */</span></div>
+<div class="line"><a name="l13953"></a><span class="lineno">13953</span>     row = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l13954"></a><span class="lineno">13954</span> </div>
+<div class="line"><a name="l13955"></a><span class="lineno">13955</span>     <span class="keywordflow">for</span> (i = 0; i < row; i++) {</div>
+<div class="line"><a name="l13956"></a><span class="lineno">13956</span>         <span class="keywordflow">for</span> (j = 0; j < maxobjects; j++) {</div>
+<div class="line"><a name="l13957"></a><span class="lineno">13957</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"row_%d"</span>, j+1);</div>
+<div class="line"><a name="l13958"></a><span class="lineno">13958</span>             <span class="keywordflow">if</span> (cpl_table_is_valid(slits, name, i))</div>
+<div class="line"><a name="l13959"></a><span class="lineno">13959</span>                 cpl_table_set_int(slits, name, i, totobj -</div>
+<div class="line"><a name="l13960"></a><span class="lineno">13960</span>                                   cpl_table_get_int(slits, name, i, NULL));</div>
+<div class="line"><a name="l13961"></a><span class="lineno">13961</span>         }</div>
+<div class="line"><a name="l13962"></a><span class="lineno">13962</span>     }</div>
+<div class="line"><a name="l13963"></a><span class="lineno">13963</span> </div>
+<div class="line"><a name="l13964"></a><span class="lineno">13964</span>     <span class="keywordflow">for</span> (i = 0; i < maxobjects; i++) {</div>
+<div class="line"><a name="l13965"></a><span class="lineno">13965</span>         snprintf(name, MAX_COLNAME, <span class="stringliteral">"start_%d"</span>, i+1);</div>
+<div class="line"><a name="l13966"></a><span class="lineno">13966</span>         cpl_table_fill_invalid_int(slits, name, -1);</div>
+<div class="line"><a name="l13967"></a><span class="lineno">13967</span>         snprintf(name, MAX_COLNAME, <span class="stringliteral">"end_%d"</span>, i+1);</div>
+<div class="line"><a name="l13968"></a><span class="lineno">13968</span>         cpl_table_fill_invalid_int(slits, name, -1);</div>
+<div class="line"><a name="l13969"></a><span class="lineno">13969</span>         snprintf(name, MAX_COLNAME, <span class="stringliteral">"row_%d"</span>, i+1);</div>
+<div class="line"><a name="l13970"></a><span class="lineno">13970</span>         cpl_table_fill_invalid_int(slits, name, -1);</div>
+<div class="line"><a name="l13971"></a><span class="lineno">13971</span>     }</div>
+<div class="line"><a name="l13972"></a><span class="lineno">13972</span> </div>
+<div class="line"><a name="l13973"></a><span class="lineno">13973</span>     <span class="keywordflow">return</span> profile;</div>
+<div class="line"><a name="l13974"></a><span class="lineno">13974</span> }</div>
+<div class="line"><a name="l13975"></a><span class="lineno">13975</span> </div>
+<div class="line"><a name="l13976"></a><span class="lineno">13976</span> </div>
+<div class="line"><a name="l14001"></a><span class="lineno"><a class="code" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522">14001</a></span> cpl_image **<a class="code" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522" title="Extract detected objects from rectified scientific frame.">mos_extract_objects</a>(cpl_image *science, cpl_image *sky,</div>
+<div class="line"><a name="l14002"></a><span class="lineno">14002</span>                                 cpl_table *objects, <span class="keywordtype">int</span> extraction, <span class="keywordtype">double</span> ron,</div>
+<div class="line"><a name="l14003"></a><span class="lineno">14003</span>                                 <span class="keywordtype">double</span> gain, <span class="keywordtype">int</span> ncombined)</div>
+<div class="line"><a name="l14004"></a><span class="lineno">14004</span> {</div>
+<div class="line"><a name="l14005"></a><span class="lineno">14005</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_extract_objects"</span>;</div>
+<div class="line"><a name="l14006"></a><span class="lineno">14006</span> </div>
+<div class="line"><a name="l14007"></a><span class="lineno">14007</span>     <span class="keywordtype">char</span>        name[MAX_COLNAME];</div>
+<div class="line"><a name="l14008"></a><span class="lineno">14008</span> </div>
+<div class="line"><a name="l14009"></a><span class="lineno">14009</span>     cpl_image **output;</div>
+<div class="line"><a name="l14010"></a><span class="lineno">14010</span>     cpl_image  *extracted;</div>
+<div class="line"><a name="l14011"></a><span class="lineno">14011</span>     cpl_image  *extr_sky;</div>
+<div class="line"><a name="l14012"></a><span class="lineno">14012</span>     cpl_image  *error;</div>
+<div class="line"><a name="l14013"></a><span class="lineno">14013</span>     cpl_image  *sciwin;</div>
+<div class="line"><a name="l14014"></a><span class="lineno">14014</span>     cpl_image  *skywin;</div>
+<div class="line"><a name="l14015"></a><span class="lineno">14015</span>     <span class="keywordtype">int</span>         nslits;</div>
+<div class="line"><a name="l14016"></a><span class="lineno">14016</span>     <span class="keywordtype">int</span>         nobjects;</div>
+<div class="line"><a name="l14017"></a><span class="lineno">14017</span>     <span class="keywordtype">int</span>         maxobjects;</div>
+<div class="line"><a name="l14018"></a><span class="lineno">14018</span>     <span class="keywordtype">int</span>         nx;</div>
+<div class="line"><a name="l14019"></a><span class="lineno">14019</span>     <span class="keywordtype">int</span>         ylow, yhig;</div>
+<div class="line"><a name="l14020"></a><span class="lineno">14020</span>     <span class="keywordtype">int</span>         i, j;</div>
+<div class="line"><a name="l14021"></a><span class="lineno">14021</span> </div>
+<div class="line"><a name="l14022"></a><span class="lineno">14022</span> </div>
+<div class="line"><a name="l14023"></a><span class="lineno">14023</span>     <span class="keywordflow">if</span> (science == NULL || sky == NULL) {</div>
+<div class="line"><a name="l14024"></a><span class="lineno">14024</span>         cpl_msg_error(func, <span class="stringliteral">"Both scientific exposures are required in input"</span>);</div>
+<div class="line"><a name="l14025"></a><span class="lineno">14025</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l14026"></a><span class="lineno">14026</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14027"></a><span class="lineno">14027</span>     }</div>
+<div class="line"><a name="l14028"></a><span class="lineno">14028</span> </div>
+<div class="line"><a name="l14029"></a><span class="lineno">14029</span>     <span class="keywordflow">if</span> (objects == NULL) {</div>
+<div class="line"><a name="l14030"></a><span class="lineno">14030</span>         cpl_msg_error(func, <span class="stringliteral">"An object table is required in input"</span>);</div>
+<div class="line"><a name="l14031"></a><span class="lineno">14031</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l14032"></a><span class="lineno">14032</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14033"></a><span class="lineno">14033</span>     }</div>
+<div class="line"><a name="l14034"></a><span class="lineno">14034</span> </div>
+<div class="line"><a name="l14035"></a><span class="lineno">14035</span>     <span class="keywordflow">if</span> (extraction < 0 || extraction > 1) {</div>
+<div class="line"><a name="l14036"></a><span class="lineno">14036</span>         cpl_msg_error(func, <span class="stringliteral">"Invalid extraction mode (%d): it should be "</span></div>
+<div class="line"><a name="l14037"></a><span class="lineno">14037</span>                       <span class="stringliteral">"either 0 or 1"</span>, extraction); </div>
+<div class="line"><a name="l14038"></a><span class="lineno">14038</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14039"></a><span class="lineno">14039</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14040"></a><span class="lineno">14040</span>     }</div>
+<div class="line"><a name="l14041"></a><span class="lineno">14041</span> </div>
+<div class="line"><a name="l14042"></a><span class="lineno">14042</span>     <span class="keywordflow">if</span> (ron < 0.0) {</div>
+<div class="line"><a name="l14043"></a><span class="lineno">14043</span>         cpl_msg_error(func, <span class="stringliteral">"Invalid read-out-noise (%f ADU)"</span>, ron);</div>
+<div class="line"><a name="l14044"></a><span class="lineno">14044</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14045"></a><span class="lineno">14045</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14046"></a><span class="lineno">14046</span>     }</div>
+<div class="line"><a name="l14047"></a><span class="lineno">14047</span> </div>
+<div class="line"><a name="l14048"></a><span class="lineno">14048</span>     <span class="keywordflow">if</span> (gain < 0.1) {</div>
+<div class="line"><a name="l14049"></a><span class="lineno">14049</span>         cpl_msg_error(func, <span class="stringliteral">"Invalid gain factor (%f e-/ADU)"</span>, gain);</div>
+<div class="line"><a name="l14050"></a><span class="lineno">14050</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14051"></a><span class="lineno">14051</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14052"></a><span class="lineno">14052</span>     }</div>
+<div class="line"><a name="l14053"></a><span class="lineno">14053</span> </div>
+<div class="line"><a name="l14054"></a><span class="lineno">14054</span>     <span class="keywordflow">if</span> (ncombined < 1) {</div>
+<div class="line"><a name="l14055"></a><span class="lineno">14055</span>         cpl_msg_error(func, <span class="stringliteral">"Invalid number of combined frames (%d): "</span></div>
+<div class="line"><a name="l14056"></a><span class="lineno">14056</span>                       <span class="stringliteral">"it should be at least 1"</span>, ncombined);</div>
+<div class="line"><a name="l14057"></a><span class="lineno">14057</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14058"></a><span class="lineno">14058</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14059"></a><span class="lineno">14059</span>     }</div>
+<div class="line"><a name="l14060"></a><span class="lineno">14060</span> </div>
+<div class="line"><a name="l14061"></a><span class="lineno">14061</span> </div>
+<div class="line"><a name="l14062"></a><span class="lineno">14062</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14063"></a><span class="lineno">14063</span> <span class="comment">     * Count the max number of objects per slit. Note that maxobjects </span></div>
+<div class="line"><a name="l14064"></a><span class="lineno">14064</span> <span class="comment">     * is intentionally the max number of objects increased by one.</span></div>
+<div class="line"><a name="l14065"></a><span class="lineno">14065</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14066"></a><span class="lineno">14066</span> </div>
+<div class="line"><a name="l14067"></a><span class="lineno">14067</span>     maxobjects = 1;</div>
+<div class="line"><a name="l14068"></a><span class="lineno">14068</span>     snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, maxobjects);</div>
+<div class="line"><a name="l14069"></a><span class="lineno">14069</span>     <span class="keywordflow">while</span> (cpl_table_has_column(objects, name)) {</div>
+<div class="line"><a name="l14070"></a><span class="lineno">14070</span>         maxobjects++;</div>
+<div class="line"><a name="l14071"></a><span class="lineno">14071</span>         snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, maxobjects);</div>
+<div class="line"><a name="l14072"></a><span class="lineno">14072</span>     }</div>
+<div class="line"><a name="l14073"></a><span class="lineno">14073</span> </div>
+<div class="line"><a name="l14074"></a><span class="lineno">14074</span> </div>
+<div class="line"><a name="l14075"></a><span class="lineno">14075</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14076"></a><span class="lineno">14076</span> <span class="comment">     * Count objects to extract</span></div>
+<div class="line"><a name="l14077"></a><span class="lineno">14077</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14078"></a><span class="lineno">14078</span> </div>
+<div class="line"><a name="l14079"></a><span class="lineno">14079</span>     nobjects = 0;</div>
+<div class="line"><a name="l14080"></a><span class="lineno">14080</span>     nslits = cpl_table_get_nrow(objects);</div>
+<div class="line"><a name="l14081"></a><span class="lineno">14081</span> </div>
+<div class="line"><a name="l14082"></a><span class="lineno">14082</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l14083"></a><span class="lineno">14083</span>         <span class="keywordflow">for</span> (j = 1; j < maxobjects; j++) {</div>
+<div class="line"><a name="l14084"></a><span class="lineno">14084</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, j);</div>
+<div class="line"><a name="l14085"></a><span class="lineno">14085</span>             <span class="keywordflow">if</span> (cpl_table_is_valid(objects, name, i))</div>
+<div class="line"><a name="l14086"></a><span class="lineno">14086</span>                 nobjects++;</div>
+<div class="line"><a name="l14087"></a><span class="lineno">14087</span>         }</div>
+<div class="line"><a name="l14088"></a><span class="lineno">14088</span>     }</div>
+<div class="line"><a name="l14089"></a><span class="lineno">14089</span> </div>
+<div class="line"><a name="l14090"></a><span class="lineno">14090</span>     <span class="keywordflow">if</span> (nobjects == 0)</div>
+<div class="line"><a name="l14091"></a><span class="lineno">14091</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14092"></a><span class="lineno">14092</span> </div>
+<div class="line"><a name="l14093"></a><span class="lineno">14093</span>     nx = cpl_image_get_size_x(science);</div>
+<div class="line"><a name="l14094"></a><span class="lineno">14094</span> </div>
+<div class="line"><a name="l14095"></a><span class="lineno">14095</span>     output = cpl_calloc(3, <span class="keyword">sizeof</span>(cpl_image *));</div>
+<div class="line"><a name="l14096"></a><span class="lineno">14096</span>     extracted = output[0] = cpl_image_new(nx, nobjects, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l14097"></a><span class="lineno">14097</span>     extr_sky  = output[1] = cpl_image_new(nx, nobjects, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l14098"></a><span class="lineno">14098</span>     error     = output[2] = cpl_image_new(nx, nobjects, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l14099"></a><span class="lineno">14099</span> </div>
+<div class="line"><a name="l14100"></a><span class="lineno">14100</span> </div>
+<div class="line"><a name="l14101"></a><span class="lineno">14101</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14102"></a><span class="lineno">14102</span> <span class="comment">     * Extract objects</span></div>
+<div class="line"><a name="l14103"></a><span class="lineno">14103</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14104"></a><span class="lineno">14104</span> </div>
+<div class="line"><a name="l14105"></a><span class="lineno">14105</span>     nobjects = 0;</div>
+<div class="line"><a name="l14106"></a><span class="lineno">14106</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l14107"></a><span class="lineno">14107</span>         <span class="keywordflow">for</span> (j = 1; j < maxobjects; j++) {</div>
+<div class="line"><a name="l14108"></a><span class="lineno">14108</span>             snprintf(name, MAX_COLNAME, <span class="stringliteral">"object_%d"</span>, j);</div>
+<div class="line"><a name="l14109"></a><span class="lineno">14109</span>             <span class="keywordflow">if</span> (cpl_table_is_valid(objects, name, i)) {</div>
+<div class="line"><a name="l14110"></a><span class="lineno">14110</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"start_%d"</span>, j);</div>
+<div class="line"><a name="l14111"></a><span class="lineno">14111</span>                 ylow = cpl_table_get_int(objects, name, i, NULL);</div>
+<div class="line"><a name="l14112"></a><span class="lineno">14112</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"end_%d"</span>, j);</div>
+<div class="line"><a name="l14113"></a><span class="lineno">14113</span>                 yhig = cpl_table_get_int(objects, name, i, NULL);</div>
+<div class="line"><a name="l14114"></a><span class="lineno">14114</span>                 snprintf(name, MAX_COLNAME, <span class="stringliteral">"row_%d"</span>, j);</div>
+<div class="line"><a name="l14115"></a><span class="lineno">14115</span>                 nobjects = cpl_table_get_int(objects, name, i, NULL);</div>
+<div class="line"><a name="l14116"></a><span class="lineno">14116</span>                 sciwin = cpl_image_extract(science, 1, ylow+1, nx, yhig);</div>
+<div class="line"><a name="l14117"></a><span class="lineno">14117</span>                 skywin = cpl_image_extract(sky, 1, ylow+1, nx, yhig);</div>
+<div class="line"><a name="l14118"></a><span class="lineno">14118</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l14119"></a><span class="lineno">14119</span> <span class="comment"> * Cleaning the cosmics locally was really NOT a good idea...</span></div>
+<div class="line"><a name="l14120"></a><span class="lineno">14120</span> <span class="comment"> * I leave it here, commented out, to never forget this mistake!</span></div>
+<div class="line"><a name="l14121"></a><span class="lineno">14121</span> <span class="comment"></span></div>
+<div class="line"><a name="l14122"></a><span class="lineno">14122</span> <span class="comment">                if (extraction) {</span></div>
+<div class="line"><a name="l14123"></a><span class="lineno">14123</span> <span class="comment">                    mos_clean_cosmics(sciwin, gain, -1., -1.);</span></div>
+<div class="line"><a name="l14124"></a><span class="lineno">14124</span> <span class="comment">                }</span></div>
+<div class="line"><a name="l14125"></a><span class="lineno">14125</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l14126"></a><span class="lineno">14126</span>                 mos_extraction(sciwin, skywin, extracted, extr_sky, error, </div>
+<div class="line"><a name="l14127"></a><span class="lineno">14127</span>                                nobjects, extraction, ron, gain, ncombined);</div>
+<div class="line"><a name="l14128"></a><span class="lineno">14128</span> </div>
+<div class="line"><a name="l14129"></a><span class="lineno">14129</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l14130"></a><span class="lineno">14130</span> <span class="comment">                 * Hidden check whether the spectrum was saturated or not</span></div>
+<div class="line"><a name="l14131"></a><span class="lineno">14131</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l14132"></a><span class="lineno">14132</span> </div>
+<div class="line"><a name="l14133"></a><span class="lineno">14133</span>                 {</div>
+<div class="line"><a name="l14134"></a><span class="lineno">14134</span>                     cpl_image *total = cpl_image_add_create(sciwin, skywin);</div>
+<div class="line"><a name="l14135"></a><span class="lineno">14135</span>                     <span class="keywordtype">float</span>     *data  = cpl_image_get_data_float(total);</div>
+<div class="line"><a name="l14136"></a><span class="lineno">14136</span>                     <span class="keywordtype">int</span>        size  = cpl_image_get_size_x(total)</div>
+<div class="line"><a name="l14137"></a><span class="lineno">14137</span>                                      * cpl_image_get_size_y(total);</div>
+<div class="line"><a name="l14138"></a><span class="lineno">14138</span>                     <span class="keywordtype">int</span>        k;</div>
+<div class="line"><a name="l14139"></a><span class="lineno">14139</span>                     <span class="keywordtype">char</span>      *saturation_level = getenv(<span class="stringliteral">"SATURATION_LEVEL"</span>);</div>
+<div class="line"><a name="l14140"></a><span class="lineno">14140</span>                     <span class="keywordtype">float</span>      saturation = 62000.0;</div>
+<div class="line"><a name="l14141"></a><span class="lineno">14141</span>                     <span class="keywordtype">char</span>      *max_saturated = getenv(<span class="stringliteral">"MAX_SATURATED"</span>);</div>
+<div class="line"><a name="l14142"></a><span class="lineno">14142</span>                     <span class="keywordtype">int</span>        max_satur = 10;</div>
+<div class="line"><a name="l14143"></a><span class="lineno">14143</span>                     <span class="keywordtype">int</span>        saturated;</div>
+<div class="line"><a name="l14144"></a><span class="lineno">14144</span> </div>
+<div class="line"><a name="l14145"></a><span class="lineno">14145</span>                     <span class="keywordflow">if</span> (saturation_level)</div>
+<div class="line"><a name="l14146"></a><span class="lineno">14146</span>                         saturation = atof(saturation_level);</div>
+<div class="line"><a name="l14147"></a><span class="lineno">14147</span> </div>
+<div class="line"><a name="l14148"></a><span class="lineno">14148</span>                     <span class="keywordflow">if</span> (max_saturated)</div>
+<div class="line"><a name="l14149"></a><span class="lineno">14149</span>                         max_satur = atoi(max_saturated);</div>
+<div class="line"><a name="l14150"></a><span class="lineno">14150</span> </div>
+<div class="line"><a name="l14151"></a><span class="lineno">14151</span>                     saturated = 0;</div>
+<div class="line"><a name="l14152"></a><span class="lineno">14152</span>                     <span class="keywordflow">for</span> (k = 0; k < size; k++) {</div>
+<div class="line"><a name="l14153"></a><span class="lineno">14153</span>                         <span class="keywordflow">if</span> (data[k] > saturation) {</div>
+<div class="line"><a name="l14154"></a><span class="lineno">14154</span>                             saturated++;</div>
+<div class="line"><a name="l14155"></a><span class="lineno">14155</span>                             <span class="keywordflow">if</span> (saturated > max_satur) {</div>
+<div class="line"><a name="l14156"></a><span class="lineno">14156</span>                                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l14157"></a><span class="lineno">14157</span>                             }</div>
+<div class="line"><a name="l14158"></a><span class="lineno">14158</span>                         }</div>
+<div class="line"><a name="l14159"></a><span class="lineno">14159</span>                     }</div>
+<div class="line"><a name="l14160"></a><span class="lineno">14160</span> </div>
+<div class="line"><a name="l14161"></a><span class="lineno">14161</span>                     <span class="keywordflow">if</span> (saturated > max_satur)</div>
+<div class="line"><a name="l14162"></a><span class="lineno">14162</span>                         saturated = 1;</div>
+<div class="line"><a name="l14163"></a><span class="lineno">14163</span>                     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l14164"></a><span class="lineno">14164</span>                         saturated = 0;</div>
+<div class="line"><a name="l14165"></a><span class="lineno">14165</span> </div>
+<div class="line"><a name="l14166"></a><span class="lineno">14166</span>                     data = cpl_image_get_data(extracted);</div>
+<div class="line"><a name="l14167"></a><span class="lineno">14167</span>                     data[nobjects * nx] = saturated;</div>
+<div class="line"><a name="l14168"></a><span class="lineno">14168</span>                 }</div>
+<div class="line"><a name="l14169"></a><span class="lineno">14169</span> </div>
+<div class="line"><a name="l14170"></a><span class="lineno">14170</span>                 cpl_image_delete(sciwin);</div>
+<div class="line"><a name="l14171"></a><span class="lineno">14171</span>                 cpl_image_delete(skywin);</div>
+<div class="line"><a name="l14172"></a><span class="lineno">14172</span>                 nobjects++;</div>
+<div class="line"><a name="l14173"></a><span class="lineno">14173</span>             }</div>
+<div class="line"><a name="l14174"></a><span class="lineno">14174</span>         }</div>
+<div class="line"><a name="l14175"></a><span class="lineno">14175</span>     }</div>
+<div class="line"><a name="l14176"></a><span class="lineno">14176</span> </div>
+<div class="line"><a name="l14177"></a><span class="lineno">14177</span>     <span class="keywordflow">return</span> output;</div>
+<div class="line"><a name="l14178"></a><span class="lineno">14178</span> </div>
+<div class="line"><a name="l14179"></a><span class="lineno">14179</span> }</div>
+<div class="line"><a name="l14180"></a><span class="lineno">14180</span> </div>
+<div class="line"><a name="l14181"></a><span class="lineno">14181</span> </div>
+<div class="line"><a name="l14204"></a><span class="lineno"><a class="code" href="group__moses.html#ga58039ea48fa183baf1701567781ad128">14204</a></span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#ga58039ea48fa183baf1701567781ad128" title="Compute mean spectral resolution at a given arc lamp line.">mos_spectral_resolution</a>(cpl_image *image, <span class="keywordtype">double</span> lambda, <span class="keywordtype">double</span> startwave, </div>
+<div class="line"><a name="l14205"></a><span class="lineno">14205</span>                             <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> saturation, </div>
+<div class="line"><a name="l14206"></a><span class="lineno">14206</span>                             <span class="keywordtype">double</span> *mfwhm, <span class="keywordtype">double</span> *rmsfwhm,</div>
+<div class="line"><a name="l14207"></a><span class="lineno">14207</span>                             <span class="keywordtype">double</span> *resolution, <span class="keywordtype">double</span> *rmsres, <span class="keywordtype">int</span> *nlines)</div>
+<div class="line"><a name="l14208"></a><span class="lineno">14208</span> {</div>
+<div class="line"><a name="l14209"></a><span class="lineno">14209</span>     cpl_vector *vector;</div>
+<div class="line"><a name="l14210"></a><span class="lineno">14210</span> </div>
+<div class="line"><a name="l14211"></a><span class="lineno">14211</span>     <span class="keywordtype">int</span>     i, j, n, m;</div>
+<div class="line"><a name="l14212"></a><span class="lineno">14212</span>     <span class="keywordtype">int</span>     position, maxpos;</div>
+<div class="line"><a name="l14213"></a><span class="lineno">14213</span>     <span class="keywordtype">int</span>     xlen, ylen;</div>
+<div class="line"><a name="l14214"></a><span class="lineno">14214</span>     <span class="keywordtype">int</span>     sp, ep;</div>
+<div class="line"><a name="l14215"></a><span class="lineno">14215</span>     <span class="keywordtype">int</span>     radius;</div>
+<div class="line"><a name="l14216"></a><span class="lineno">14216</span>     <span class="keywordtype">int</span>     sradius = 40;</div>
+<div class="line"><a name="l14217"></a><span class="lineno">14217</span>     <span class="keywordtype">int</span>     threshold = 250;    <span class="comment">/* Peak must be so many ADUs above min */</span></div>
+<div class="line"><a name="l14218"></a><span class="lineno">14218</span> </div>
+<div class="line"><a name="l14219"></a><span class="lineno">14219</span>     <span class="keywordtype">int</span>     ifwhm;</div>
+<div class="line"><a name="l14220"></a><span class="lineno">14220</span>     <span class="keywordtype">double</span>  fwhm;</div>
+<div class="line"><a name="l14221"></a><span class="lineno">14221</span>     <span class="keywordtype">double</span> *buffer;</div>
+<div class="line"><a name="l14222"></a><span class="lineno">14222</span>     <span class="keywordtype">double</span>  min, max, halfmax;</div>
+<div class="line"><a name="l14223"></a><span class="lineno">14223</span>     <span class="keywordtype">double</span>  cut = 1.5;         <span class="comment">/* To cut outliers from FWHM values (pixel) */</span></div>
+<div class="line"><a name="l14224"></a><span class="lineno">14224</span>     <span class="keywordtype">double</span>  value, rms;</div>
+<div class="line"><a name="l14225"></a><span class="lineno">14225</span> </div>
+<div class="line"><a name="l14226"></a><span class="lineno">14226</span>     <span class="keywordtype">float</span>  *data;</div>
+<div class="line"><a name="l14227"></a><span class="lineno">14227</span> </div>
+<div class="line"><a name="l14228"></a><span class="lineno">14228</span> </div>
+<div class="line"><a name="l14229"></a><span class="lineno">14229</span>     *resolution = 0.0;</div>
+<div class="line"><a name="l14230"></a><span class="lineno">14230</span>     *rmsres = 0.0;</div>
+<div class="line"><a name="l14231"></a><span class="lineno">14231</span>     *nlines = 0;</div>
+<div class="line"><a name="l14232"></a><span class="lineno">14232</span> </div>
+<div class="line"><a name="l14233"></a><span class="lineno">14233</span>     xlen = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l14234"></a><span class="lineno">14234</span>     ylen = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l14235"></a><span class="lineno">14235</span>     data = cpl_image_get_data(image);</div>
+<div class="line"><a name="l14236"></a><span class="lineno">14236</span> </div>
+<div class="line"><a name="l14237"></a><span class="lineno">14237</span>     buffer = cpl_malloc(ylen * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l14238"></a><span class="lineno">14238</span> </div>
+<div class="line"><a name="l14239"></a><span class="lineno">14239</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14240"></a><span class="lineno">14240</span> <span class="comment">     *  Closest pixel to specified wavelength.</span></div>
+<div class="line"><a name="l14241"></a><span class="lineno">14241</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14242"></a><span class="lineno">14242</span> </div>
+<div class="line"><a name="l14243"></a><span class="lineno">14243</span>     position = floor((lambda - startwave) / dispersion + 0.5);</div>
+<div class="line"><a name="l14244"></a><span class="lineno">14244</span> </div>
+<div class="line"><a name="l14245"></a><span class="lineno">14245</span>     sp = position - sradius;</div>
+<div class="line"><a name="l14246"></a><span class="lineno">14246</span>     ep = position + sradius;</div>
+<div class="line"><a name="l14247"></a><span class="lineno">14247</span> </div>
+<div class="line"><a name="l14248"></a><span class="lineno">14248</span>     <span class="keywordflow">if</span> (sp < 0 || ep > xlen) {</div>
+<div class="line"><a name="l14249"></a><span class="lineno">14249</span>         cpl_free(buffer);</div>
+<div class="line"><a name="l14250"></a><span class="lineno">14250</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l14251"></a><span class="lineno">14251</span>     }</div>
+<div class="line"><a name="l14252"></a><span class="lineno">14252</span> </div>
+<div class="line"><a name="l14253"></a><span class="lineno">14253</span>     <span class="keywordflow">for</span> (i = 0, n = 0; i < ylen; i++) {    <span class="comment">/*  For each row of each slit  */</span></div>
+<div class="line"><a name="l14254"></a><span class="lineno">14254</span> </div>
+<div class="line"><a name="l14255"></a><span class="lineno">14255</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l14256"></a><span class="lineno">14256</span> <span class="comment">         *  Search interval for peak. Abort if too close to image border.</span></div>
+<div class="line"><a name="l14257"></a><span class="lineno">14257</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l14258"></a><span class="lineno">14258</span> </div>
+<div class="line"><a name="l14259"></a><span class="lineno">14259</span>         radius = <a class="code" href="group__moses.html#ga28871a4ecc1e2779022f06d4da892360" title="Estimate lines widths (in pixel) in arc lamp spectrum.">mos_lines_width</a>(data + i*xlen + position - sradius, </div>
+<div class="line"><a name="l14260"></a><span class="lineno">14260</span>                                  2*sradius + 1);</div>
+<div class="line"><a name="l14261"></a><span class="lineno">14261</span>         <span class="keywordflow">if</span> (radius < 5)</div>
+<div class="line"><a name="l14262"></a><span class="lineno">14262</span>             radius = 5;</div>
+<div class="line"><a name="l14263"></a><span class="lineno">14263</span> </div>
+<div class="line"><a name="l14264"></a><span class="lineno">14264</span>         sp = position - radius;</div>
+<div class="line"><a name="l14265"></a><span class="lineno">14265</span>         ep = position + radius;</div>
+<div class="line"><a name="l14266"></a><span class="lineno">14266</span> </div>
+<div class="line"><a name="l14267"></a><span class="lineno">14267</span>         <span class="keywordflow">if</span> (sp < 0 || ep > xlen) {</div>
+<div class="line"><a name="l14268"></a><span class="lineno">14268</span>             cpl_free(buffer);</div>
+<div class="line"><a name="l14269"></a><span class="lineno">14269</span>             <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l14270"></a><span class="lineno">14270</span>         }</div>
+<div class="line"><a name="l14271"></a><span class="lineno">14271</span> </div>
+<div class="line"><a name="l14272"></a><span class="lineno">14272</span> </div>
+<div class="line"><a name="l14273"></a><span class="lineno">14273</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l14274"></a><span class="lineno">14274</span> <span class="comment">         *  Determine min-max value and position.</span></div>
+<div class="line"><a name="l14275"></a><span class="lineno">14275</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l14276"></a><span class="lineno">14276</span> </div>
+<div class="line"><a name="l14277"></a><span class="lineno">14277</span>         maxpos = sp;</div>
+<div class="line"><a name="l14278"></a><span class="lineno">14278</span>         min = max = data[sp + i * xlen];</div>
+<div class="line"><a name="l14279"></a><span class="lineno">14279</span>         <span class="keywordflow">for</span> (j = sp; j < ep; j++) {</div>
+<div class="line"><a name="l14280"></a><span class="lineno">14280</span>             <span class="keywordflow">if</span> (data[j + i * xlen] > max) {</div>
+<div class="line"><a name="l14281"></a><span class="lineno">14281</span>                 max = data[j + i * xlen];</div>
+<div class="line"><a name="l14282"></a><span class="lineno">14282</span>                 maxpos = j;</div>
+<div class="line"><a name="l14283"></a><span class="lineno">14283</span>             }</div>
+<div class="line"><a name="l14284"></a><span class="lineno">14284</span>             <span class="keywordflow">if</span> (data[j + i * xlen] < min) {</div>
+<div class="line"><a name="l14285"></a><span class="lineno">14285</span>                 min = data[j + i * xlen];</div>
+<div class="line"><a name="l14286"></a><span class="lineno">14286</span>             }</div>
+<div class="line"><a name="l14287"></a><span class="lineno">14287</span>         }</div>
+<div class="line"><a name="l14288"></a><span class="lineno">14288</span> </div>
+<div class="line"><a name="l14289"></a><span class="lineno">14289</span>         <span class="keywordflow">if</span> (fabs(min) < 0.0000001)        <span class="comment">/* Truncated spectrum */</span></div>
+<div class="line"><a name="l14290"></a><span class="lineno">14290</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l14291"></a><span class="lineno">14291</span> </div>
+<div class="line"><a name="l14292"></a><span class="lineno">14292</span>         <span class="keywordflow">if</span> (max - min < threshold)        <span class="comment">/* Low signal... */</span></div>
+<div class="line"><a name="l14293"></a><span class="lineno">14293</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l14294"></a><span class="lineno">14294</span> </div>
+<div class="line"><a name="l14295"></a><span class="lineno">14295</span>         <span class="keywordflow">if</span> (max > saturation)             <span class="comment">/* Saturation */</span></div>
+<div class="line"><a name="l14296"></a><span class="lineno">14296</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l14297"></a><span class="lineno">14297</span> </div>
+<div class="line"><a name="l14298"></a><span class="lineno">14298</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l14299"></a><span class="lineno">14299</span> <span class="comment">         *  Determine FWHM counting pixels with value greater than</span></div>
+<div class="line"><a name="l14300"></a><span class="lineno">14300</span> <span class="comment">         *  half of the max value, to the right and to the left of</span></div>
+<div class="line"><a name="l14301"></a><span class="lineno">14301</span> <span class="comment">         *  the max. Linear interpolation between the pixels where</span></div>
+<div class="line"><a name="l14302"></a><span class="lineno">14302</span> <span class="comment">         *  the transition happens.</span></div>
+<div class="line"><a name="l14303"></a><span class="lineno">14303</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l14304"></a><span class="lineno">14304</span> </div>
+<div class="line"><a name="l14305"></a><span class="lineno">14305</span>         halfmax = (max + min)/ 2.0;</div>
+<div class="line"><a name="l14306"></a><span class="lineno">14306</span> </div>
+<div class="line"><a name="l14307"></a><span class="lineno">14307</span>         fwhm = 0.0;</div>
+<div class="line"><a name="l14308"></a><span class="lineno">14308</span>         ifwhm = 0;</div>
+<div class="line"><a name="l14309"></a><span class="lineno">14309</span>         <span class="keywordflow">for</span> (j = maxpos; j < maxpos + radius; j++) {</div>
+<div class="line"><a name="l14310"></a><span class="lineno">14310</span>             <span class="keywordflow">if</span> (j < xlen) {</div>
+<div class="line"><a name="l14311"></a><span class="lineno">14311</span>                 <span class="keywordflow">if</span> (data[j + i * xlen] < halfmax) {</div>
+<div class="line"><a name="l14312"></a><span class="lineno">14312</span>                     fwhm = ifwhm + (data[j - 1 + i * xlen] - halfmax)</div>
+<div class="line"><a name="l14313"></a><span class="lineno">14313</span>                          / (data[j - 1 + i * xlen] - data[j + i * xlen]);</div>
+<div class="line"><a name="l14314"></a><span class="lineno">14314</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l14315"></a><span class="lineno">14315</span>                 }</div>
+<div class="line"><a name="l14316"></a><span class="lineno">14316</span>                 ifwhm++;</div>
+<div class="line"><a name="l14317"></a><span class="lineno">14317</span>             }</div>
+<div class="line"><a name="l14318"></a><span class="lineno">14318</span>         }</div>
+<div class="line"><a name="l14319"></a><span class="lineno">14319</span> </div>
+<div class="line"><a name="l14320"></a><span class="lineno">14320</span>         ifwhm = 0;</div>
+<div class="line"><a name="l14321"></a><span class="lineno">14321</span>         <span class="keywordflow">for</span> (j = maxpos; j > maxpos - radius; j--) {</div>
+<div class="line"><a name="l14322"></a><span class="lineno">14322</span>             <span class="keywordflow">if</span> (j >= 0) {</div>
+<div class="line"><a name="l14323"></a><span class="lineno">14323</span>                 <span class="keywordflow">if</span> (data[j + i * xlen] < halfmax) {</div>
+<div class="line"><a name="l14324"></a><span class="lineno">14324</span>                     fwhm += ifwhm + (data[j + 1 + i * xlen] - halfmax)</div>
+<div class="line"><a name="l14325"></a><span class="lineno">14325</span>                           / (data[j + 1 + i * xlen] - data[j + i * xlen]);</div>
+<div class="line"><a name="l14326"></a><span class="lineno">14326</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l14327"></a><span class="lineno">14327</span>                 }</div>
+<div class="line"><a name="l14328"></a><span class="lineno">14328</span>                 ifwhm++;</div>
+<div class="line"><a name="l14329"></a><span class="lineno">14329</span>             }</div>
+<div class="line"><a name="l14330"></a><span class="lineno">14330</span>         }</div>
+<div class="line"><a name="l14331"></a><span class="lineno">14331</span> </div>
+<div class="line"><a name="l14332"></a><span class="lineno">14332</span>         <span class="keywordflow">if</span> (fwhm > 3.0) {</div>
+<div class="line"><a name="l14333"></a><span class="lineno">14333</span>             buffer[n] = fwhm - 2.0;</div>
+<div class="line"><a name="l14334"></a><span class="lineno">14334</span>             n++;</div>
+<div class="line"><a name="l14335"></a><span class="lineno">14335</span>         }</div>
+<div class="line"><a name="l14336"></a><span class="lineno">14336</span> </div>
+<div class="line"><a name="l14337"></a><span class="lineno">14337</span>     }</div>
+<div class="line"><a name="l14338"></a><span class="lineno">14338</span> </div>
+<div class="line"><a name="l14339"></a><span class="lineno">14339</span>     <span class="keywordflow">if</span> (n == 0) {</div>
+<div class="line"><a name="l14340"></a><span class="lineno">14340</span>         cpl_free(buffer);</div>
+<div class="line"><a name="l14341"></a><span class="lineno">14341</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l14342"></a><span class="lineno">14342</span>     }</div>
+<div class="line"><a name="l14343"></a><span class="lineno">14343</span> </div>
+<div class="line"><a name="l14344"></a><span class="lineno">14344</span>     vector = cpl_vector_wrap(n, buffer);</div>
+<div class="line"><a name="l14345"></a><span class="lineno">14345</span>     value = cpl_vector_get_median_const(vector);</div>
+<div class="line"><a name="l14346"></a><span class="lineno">14346</span>     cpl_vector_unwrap(vector);</div>
+<div class="line"><a name="l14347"></a><span class="lineno">14347</span> </div>
+<div class="line"><a name="l14348"></a><span class="lineno">14348</span>     rms = 0.0;</div>
+<div class="line"><a name="l14349"></a><span class="lineno">14349</span>     <span class="keywordflow">for</span> (i = 0, m = 0; i < n; i++) {</div>
+<div class="line"><a name="l14350"></a><span class="lineno">14350</span>         <span class="keywordflow">if</span> (fabs(buffer[i] - value) < cut) {</div>
+<div class="line"><a name="l14351"></a><span class="lineno">14351</span>             rms += fabs(buffer[i] - value);</div>
+<div class="line"><a name="l14352"></a><span class="lineno">14352</span>             m++;</div>
+<div class="line"><a name="l14353"></a><span class="lineno">14353</span>         }</div>
+<div class="line"><a name="l14354"></a><span class="lineno">14354</span>     }</div>
+<div class="line"><a name="l14355"></a><span class="lineno">14355</span> </div>
+<div class="line"><a name="l14356"></a><span class="lineno">14356</span>     cpl_free(buffer);</div>
+<div class="line"><a name="l14357"></a><span class="lineno">14357</span> </div>
+<div class="line"><a name="l14358"></a><span class="lineno">14358</span>     <span class="keywordflow">if</span> (m < 3)</div>
+<div class="line"><a name="l14359"></a><span class="lineno">14359</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l14360"></a><span class="lineno">14360</span> </div>
+<div class="line"><a name="l14361"></a><span class="lineno">14361</span>     rms /= m;</div>
+<div class="line"><a name="l14362"></a><span class="lineno">14362</span>     rms *= 1.25;       <span class="comment">/* Factor to convert average deviation to sigma */</span></div>
+<div class="line"><a name="l14363"></a><span class="lineno">14363</span> </div>
+<div class="line"><a name="l14364"></a><span class="lineno">14364</span>     value *= dispersion;</div>
+<div class="line"><a name="l14365"></a><span class="lineno">14365</span>     rms *= dispersion;</div>
+<div class="line"><a name="l14366"></a><span class="lineno">14366</span> </div>
+<div class="line"><a name="l14367"></a><span class="lineno">14367</span>     *mfwhm = value;</div>
+<div class="line"><a name="l14368"></a><span class="lineno">14368</span>     *rmsfwhm = rms;</div>
+<div class="line"><a name="l14369"></a><span class="lineno">14369</span> </div>
+<div class="line"><a name="l14370"></a><span class="lineno">14370</span>     *resolution = lambda / value;</div>
+<div class="line"><a name="l14371"></a><span class="lineno">14371</span>     *rmsres = *resolution * rms / value;</div>
+<div class="line"><a name="l14372"></a><span class="lineno">14372</span> </div>
+<div class="line"><a name="l14373"></a><span class="lineno">14373</span>     *nlines = m;</div>
+<div class="line"><a name="l14374"></a><span class="lineno">14374</span> </div>
+<div class="line"><a name="l14375"></a><span class="lineno">14375</span>     <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l14376"></a><span class="lineno">14376</span> }</div>
+<div class="line"><a name="l14377"></a><span class="lineno">14377</span> </div>
+<div class="line"><a name="l14378"></a><span class="lineno">14378</span> </div>
+<div class="line"><a name="l14400"></a><span class="lineno"><a class="code" href="group__moses.html#gae9f633b64e1880984c084a19f53047fc">14400</a></span> cpl_table *<a class="code" href="group__moses.html#gae9f633b64e1880984c084a19f53047fc" title="Compute mean spectral resolution at a given arc lamp line.">mos_resolution_table</a>(cpl_image *image, <span class="keywordtype">double</span> startwave, </div>
+<div class="line"><a name="l14401"></a><span class="lineno">14401</span>                                 <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> saturation, </div>
+<div class="line"><a name="l14402"></a><span class="lineno">14402</span>                                 cpl_vector *lines)</div>
+<div class="line"><a name="l14403"></a><span class="lineno">14403</span> {</div>
+<div class="line"><a name="l14404"></a><span class="lineno">14404</span> </div>
+<div class="line"><a name="l14405"></a><span class="lineno">14405</span>     cpl_table *table;</div>
+<div class="line"><a name="l14406"></a><span class="lineno">14406</span>     <span class="keywordtype">double</span>    *line;</div>
+<div class="line"><a name="l14407"></a><span class="lineno">14407</span>     <span class="keywordtype">double</span>     fwhm;</div>
+<div class="line"><a name="l14408"></a><span class="lineno">14408</span>     <span class="keywordtype">double</span>     rmsfwhm;</div>
+<div class="line"><a name="l14409"></a><span class="lineno">14409</span>     <span class="keywordtype">double</span>     resolution;</div>
+<div class="line"><a name="l14410"></a><span class="lineno">14410</span>     <span class="keywordtype">double</span>     rmsres;</div>
+<div class="line"><a name="l14411"></a><span class="lineno">14411</span>     <span class="keywordtype">int</span>        nref;</div>
+<div class="line"><a name="l14412"></a><span class="lineno">14412</span>     <span class="keywordtype">int</span>        nlines;</div>
+<div class="line"><a name="l14413"></a><span class="lineno">14413</span>     <span class="keywordtype">int</span>        i;</div>
+<div class="line"><a name="l14414"></a><span class="lineno">14414</span> </div>
+<div class="line"><a name="l14415"></a><span class="lineno">14415</span> </div>
+<div class="line"><a name="l14416"></a><span class="lineno">14416</span>     nref = cpl_vector_get_size(lines);</div>
+<div class="line"><a name="l14417"></a><span class="lineno">14417</span>     line = cpl_vector_get_data(lines);</div>
+<div class="line"><a name="l14418"></a><span class="lineno">14418</span> </div>
+<div class="line"><a name="l14419"></a><span class="lineno">14419</span>     table = cpl_table_new(nref);</div>
+<div class="line"><a name="l14420"></a><span class="lineno">14420</span>     cpl_table_new_column(table, <span class="stringliteral">"wavelength"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14421"></a><span class="lineno">14421</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"wavelength"</span>, <span class="stringliteral">"Angstrom"</span>);</div>
+<div class="line"><a name="l14422"></a><span class="lineno">14422</span>     cpl_table_new_column(table, <span class="stringliteral">"fwhm"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14423"></a><span class="lineno">14423</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"fwhm"</span>, <span class="stringliteral">"Angstrom"</span>);</div>
+<div class="line"><a name="l14424"></a><span class="lineno">14424</span>     cpl_table_new_column(table, <span class="stringliteral">"fwhm_rms"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14425"></a><span class="lineno">14425</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"fwhm_rms"</span>, <span class="stringliteral">"Angstrom"</span>);</div>
+<div class="line"><a name="l14426"></a><span class="lineno">14426</span>     cpl_table_new_column(table, <span class="stringliteral">"resolution"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14427"></a><span class="lineno">14427</span>     cpl_table_new_column(table, <span class="stringliteral">"resolution_rms"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14428"></a><span class="lineno">14428</span>     cpl_table_new_column(table, <span class="stringliteral">"nlines"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l14429"></a><span class="lineno">14429</span> </div>
+<div class="line"><a name="l14430"></a><span class="lineno">14430</span>     <span class="keywordflow">for</span> (i = 0; i < nref; i++) {</div>
+<div class="line"><a name="l14431"></a><span class="lineno">14431</span>         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#ga58039ea48fa183baf1701567781ad128" title="Compute mean spectral resolution at a given arc lamp line.">mos_spectral_resolution</a>(image, line[i], startwave, dispersion, </div>
+<div class="line"><a name="l14432"></a><span class="lineno">14432</span>                                     saturation, &fwhm, &rmsfwhm, </div>
+<div class="line"><a name="l14433"></a><span class="lineno">14433</span>                                     &resolution, &rmsres, &nlines)) {</div>
+<div class="line"><a name="l14434"></a><span class="lineno">14434</span>             cpl_table_set_double(table, <span class="stringliteral">"wavelength"</span>, i, line[i]);</div>
+<div class="line"><a name="l14435"></a><span class="lineno">14435</span>             cpl_table_set_double(table, <span class="stringliteral">"fwhm"</span>, i, fwhm);</div>
+<div class="line"><a name="l14436"></a><span class="lineno">14436</span>             cpl_table_set_double(table, <span class="stringliteral">"fwhm_rms"</span>, i, rmsfwhm);</div>
+<div class="line"><a name="l14437"></a><span class="lineno">14437</span>             cpl_table_set_double(table, <span class="stringliteral">"resolution"</span>, i, resolution);</div>
+<div class="line"><a name="l14438"></a><span class="lineno">14438</span>             cpl_table_set_double(table, <span class="stringliteral">"resolution_rms"</span>, i, rmsres);</div>
+<div class="line"><a name="l14439"></a><span class="lineno">14439</span>             cpl_table_set_int(table, <span class="stringliteral">"nlines"</span>, i, nlines);</div>
+<div class="line"><a name="l14440"></a><span class="lineno">14440</span>         }</div>
+<div class="line"><a name="l14441"></a><span class="lineno">14441</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l14442"></a><span class="lineno">14442</span>             cpl_table_set_int(table, <span class="stringliteral">"nlines"</span>, i, 0);</div>
+<div class="line"><a name="l14443"></a><span class="lineno">14443</span>     }</div>
+<div class="line"><a name="l14444"></a><span class="lineno">14444</span> </div>
+<div class="line"><a name="l14445"></a><span class="lineno">14445</span>     <span class="keywordflow">if</span> (cpl_table_has_valid(table, <span class="stringliteral">"wavelength"</span>))</div>
+<div class="line"><a name="l14446"></a><span class="lineno">14446</span>         <span class="keywordflow">return</span> table;</div>
+<div class="line"><a name="l14447"></a><span class="lineno">14447</span> </div>
+<div class="line"><a name="l14448"></a><span class="lineno">14448</span>     cpl_table_delete(table);</div>
+<div class="line"><a name="l14449"></a><span class="lineno">14449</span> </div>
+<div class="line"><a name="l14450"></a><span class="lineno">14450</span>     <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14451"></a><span class="lineno">14451</span>     </div>
+<div class="line"><a name="l14452"></a><span class="lineno">14452</span> }</div>
+<div class="line"><a name="l14453"></a><span class="lineno">14453</span> </div>
+<div class="line"><a name="l14454"></a><span class="lineno">14454</span> </div>
+<div class="line"><a name="l14472"></a><span class="lineno"><a class="code" href="group__moses.html#gaba740d24473d57d687f75787e4ecc835">14472</a></span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#gaba740d24473d57d687f75787e4ecc835" title="Integrate signal from wavelength and spatial interval.">mos_integrate_signal</a>(cpl_image *image, cpl_image *wavemap,</div>
+<div class="line"><a name="l14473"></a><span class="lineno">14473</span>                             <span class="keywordtype">int</span> ystart, <span class="keywordtype">int</span> yend, <span class="keywordtype">double</span> wstart, <span class="keywordtype">double</span> wend)</div>
+<div class="line"><a name="l14474"></a><span class="lineno">14474</span> {</div>
+<div class="line"><a name="l14475"></a><span class="lineno">14475</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_integrate_signal"</span>;</div>
+<div class="line"><a name="l14476"></a><span class="lineno">14476</span> </div>
+<div class="line"><a name="l14477"></a><span class="lineno">14477</span>     <span class="keywordtype">double</span> sum;</div>
+<div class="line"><a name="l14478"></a><span class="lineno">14478</span>     <span class="keywordtype">float</span> *sdata;</div>
+<div class="line"><a name="l14479"></a><span class="lineno">14479</span>     <span class="keywordtype">float</span> *wdata;</div>
+<div class="line"><a name="l14480"></a><span class="lineno">14480</span>     <span class="keywordtype">int</span>    nx, ny;</div>
+<div class="line"><a name="l14481"></a><span class="lineno">14481</span>     <span class="keywordtype">int</span>    x, y;</div>
+<div class="line"><a name="l14482"></a><span class="lineno">14482</span>     </div>
+<div class="line"><a name="l14483"></a><span class="lineno">14483</span> </div>
+<div class="line"><a name="l14484"></a><span class="lineno">14484</span>     <span class="keywordflow">if</span> (image == NULL || wavemap == NULL) { </div>
+<div class="line"><a name="l14485"></a><span class="lineno">14485</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l14486"></a><span class="lineno">14486</span>         <span class="keywordflow">return</span> 0.0;</div>
+<div class="line"><a name="l14487"></a><span class="lineno">14487</span>     }</div>
+<div class="line"><a name="l14488"></a><span class="lineno">14488</span> </div>
+<div class="line"><a name="l14489"></a><span class="lineno">14489</span>     <span class="keywordflow">if</span> (ystart > yend || wstart >= wend) {</div>
+<div class="line"><a name="l14490"></a><span class="lineno">14490</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14491"></a><span class="lineno">14491</span>         <span class="keywordflow">return</span> 0.0;</div>
+<div class="line"><a name="l14492"></a><span class="lineno">14492</span>     }</div>
+<div class="line"><a name="l14493"></a><span class="lineno">14493</span> </div>
+<div class="line"><a name="l14494"></a><span class="lineno">14494</span>     nx = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l14495"></a><span class="lineno">14495</span>     ny = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l14496"></a><span class="lineno">14496</span> </div>
+<div class="line"><a name="l14497"></a><span class="lineno">14497</span>     <span class="keywordflow">if</span> (!(nx == cpl_image_get_size_x(wavemap) </div>
+<div class="line"><a name="l14498"></a><span class="lineno">14498</span>         && ny == cpl_image_get_size_y(wavemap))) {</div>
+<div class="line"><a name="l14499"></a><span class="lineno">14499</span>         cpl_error_set(func, CPL_ERROR_INCOMPATIBLE_INPUT);</div>
+<div class="line"><a name="l14500"></a><span class="lineno">14500</span>         <span class="keywordflow">return</span> 0.0;</div>
+<div class="line"><a name="l14501"></a><span class="lineno">14501</span>     }</div>
+<div class="line"><a name="l14502"></a><span class="lineno">14502</span> </div>
+<div class="line"><a name="l14503"></a><span class="lineno">14503</span>     <span class="keywordflow">if</span> (ystart < 0 || yend > ny) {</div>
+<div class="line"><a name="l14504"></a><span class="lineno">14504</span>         cpl_error_set(func, CPL_ERROR_ACCESS_OUT_OF_RANGE);</div>
+<div class="line"><a name="l14505"></a><span class="lineno">14505</span>         <span class="keywordflow">return</span> 0.0;</div>
+<div class="line"><a name="l14506"></a><span class="lineno">14506</span>     }</div>
+<div class="line"><a name="l14507"></a><span class="lineno">14507</span> </div>
+<div class="line"><a name="l14508"></a><span class="lineno">14508</span>     sdata = cpl_image_get_data(image);</div>
+<div class="line"><a name="l14509"></a><span class="lineno">14509</span>     wdata = cpl_image_get_data(wavemap);</div>
+<div class="line"><a name="l14510"></a><span class="lineno">14510</span> </div>
+<div class="line"><a name="l14511"></a><span class="lineno">14511</span>     sdata += ystart*nx;</div>
+<div class="line"><a name="l14512"></a><span class="lineno">14512</span>     wdata += ystart*nx;</div>
+<div class="line"><a name="l14513"></a><span class="lineno">14513</span> </div>
+<div class="line"><a name="l14514"></a><span class="lineno">14514</span>     sum = 0.0;</div>
+<div class="line"><a name="l14515"></a><span class="lineno">14515</span>     <span class="keywordflow">for</span> (y = ystart; y < yend; y++) {</div>
+<div class="line"><a name="l14516"></a><span class="lineno">14516</span>         <span class="keywordflow">for</span> (x = 0; x < nx; x++) {</div>
+<div class="line"><a name="l14517"></a><span class="lineno">14517</span>             <span class="keywordflow">if</span> (wdata[x] < wstart || wdata[x] > wend)</div>
+<div class="line"><a name="l14518"></a><span class="lineno">14518</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l14519"></a><span class="lineno">14519</span>             sum += sdata[x];</div>
+<div class="line"><a name="l14520"></a><span class="lineno">14520</span>         }</div>
+<div class="line"><a name="l14521"></a><span class="lineno">14521</span>         sdata += nx;</div>
+<div class="line"><a name="l14522"></a><span class="lineno">14522</span>         wdata += nx;</div>
+<div class="line"><a name="l14523"></a><span class="lineno">14523</span>     }</div>
+<div class="line"><a name="l14524"></a><span class="lineno">14524</span> </div>
+<div class="line"><a name="l14525"></a><span class="lineno">14525</span>     <span class="keywordflow">return</span> sum;</div>
+<div class="line"><a name="l14526"></a><span class="lineno">14526</span> </div>
+<div class="line"><a name="l14527"></a><span class="lineno">14527</span> }</div>
+<div class="line"><a name="l14528"></a><span class="lineno">14528</span> </div>
+<div class="line"><a name="l14529"></a><span class="lineno">14529</span> <span class="comment">/****************************************************************************</span></div>
+<div class="line"><a name="l14530"></a><span class="lineno">14530</span> <span class="comment"> * From this point on, the instrument dependent functions are added:</span></div>
+<div class="line"><a name="l14531"></a><span class="lineno">14531</span> <span class="comment"> * they are functions that retrieve information that is stored in</span></div>
+<div class="line"><a name="l14532"></a><span class="lineno">14532</span> <span class="comment"> * the data headers in some instrument specific way, such as the</span></div>
+<div class="line"><a name="l14533"></a><span class="lineno">14533</span> <span class="comment"> * location of overscans, the slits positions on the telescope</span></div>
+<div class="line"><a name="l14534"></a><span class="lineno">14534</span> <span class="comment"> * focal plane, the gain factor, etc.</span></div>
+<div class="line"><a name="l14535"></a><span class="lineno">14535</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l14536"></a><span class="lineno">14536</span> </div>
+<div class="line"><a name="l14537"></a><span class="lineno">14537</span> </div>
+<div class="line"><a name="l14560"></a><span class="lineno"><a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c">14560</a></span> cpl_table *<a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(cpl_propertylist *header)</div>
+<div class="line"><a name="l14561"></a><span class="lineno">14561</span> {</div>
+<div class="line"><a name="l14562"></a><span class="lineno">14562</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_slits_fors_mxu"</span>;</div>
+<div class="line"><a name="l14563"></a><span class="lineno">14563</span> </div>
+<div class="line"><a name="l14564"></a><span class="lineno">14564</span>     cpl_table  *slits;</div>
+<div class="line"><a name="l14565"></a><span class="lineno">14565</span>     <span class="keywordtype">char</span>        keyname[MAX_COLNAME];</div>
+<div class="line"><a name="l14566"></a><span class="lineno">14566</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *instrume;</div>
+<div class="line"><a name="l14567"></a><span class="lineno">14567</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *target_name;</div>
+<div class="line"><a name="l14568"></a><span class="lineno">14568</span>     <span class="keywordtype">float</span>       slit_x;</div>
+<div class="line"><a name="l14569"></a><span class="lineno">14569</span>     <span class="keywordtype">float</span>       slit_y;</div>
+<div class="line"><a name="l14570"></a><span class="lineno">14570</span>     <span class="keywordtype">float</span>       length;</div>
+<div class="line"><a name="l14571"></a><span class="lineno">14571</span> <span class="comment">/*    double      arc2mm = 0.53316;         */</span></div>
+<div class="line"><a name="l14572"></a><span class="lineno">14572</span>     <span class="keywordtype">double</span>      arc2mm = 0.528;</div>
+<div class="line"><a name="l14573"></a><span class="lineno">14573</span>     <span class="keywordtype">int</span>         nslits;</div>
+<div class="line"><a name="l14574"></a><span class="lineno">14574</span>     <span class="keywordtype">int</span>         slit_id;</div>
+<div class="line"><a name="l14575"></a><span class="lineno">14575</span>     <span class="keywordtype">int</span>         fors;</div>
+<div class="line"><a name="l14576"></a><span class="lineno">14576</span>     <span class="keywordtype">int</span>         chip;</div>
+<div class="line"><a name="l14577"></a><span class="lineno">14577</span>     <span class="keywordtype">int</span>         found;</div>
+<div class="line"><a name="l14578"></a><span class="lineno">14578</span> </div>
+<div class="line"><a name="l14579"></a><span class="lineno">14579</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14580"></a><span class="lineno">14580</span> <span class="comment">     * The limits below are used to exclude from the loaded slit list</span></div>
+<div class="line"><a name="l14581"></a><span class="lineno">14581</span> <span class="comment">     * any slit that surely doesn't belong to the used chip. This is</span></div>
+<div class="line"><a name="l14582"></a><span class="lineno">14582</span> <span class="comment">     * a way to reduce the chance of ambiguous slit identification.</span></div>
+<div class="line"><a name="l14583"></a><span class="lineno">14583</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14584"></a><span class="lineno">14584</span> </div>
+<div class="line"><a name="l14585"></a><span class="lineno">14585</span>     <span class="keywordtype">float</span>      low_limit1 = 10.0;</div>
+<div class="line"><a name="l14586"></a><span class="lineno">14586</span>     <span class="keywordtype">float</span>      hig_limit2 = 30.0;</div>
+<div class="line"><a name="l14587"></a><span class="lineno">14587</span> </div>
+<div class="line"><a name="l14588"></a><span class="lineno">14588</span> </div>
+<div class="line"><a name="l14589"></a><span class="lineno">14589</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l14590"></a><span class="lineno">14590</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14591"></a><span class="lineno">14591</span>     }</div>
+<div class="line"><a name="l14592"></a><span class="lineno">14592</span> </div>
+<div class="line"><a name="l14593"></a><span class="lineno">14593</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l14594"></a><span class="lineno">14594</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l14595"></a><span class="lineno">14595</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14596"></a><span class="lineno">14596</span>     }</div>
+<div class="line"><a name="l14597"></a><span class="lineno">14597</span> </div>
+<div class="line"><a name="l14598"></a><span class="lineno">14598</span> </div>
+<div class="line"><a name="l14599"></a><span class="lineno">14599</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14600"></a><span class="lineno">14600</span> <span class="comment">     * See if this is FORS1 or FORS2;</span></div>
+<div class="line"><a name="l14601"></a><span class="lineno">14601</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14602"></a><span class="lineno">14602</span> </div>
+<div class="line"><a name="l14603"></a><span class="lineno">14603</span>     instrume = cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l14604"></a><span class="lineno">14604</span> </div>
+<div class="line"><a name="l14605"></a><span class="lineno">14605</span>     fors = 0;</div>
+<div class="line"><a name="l14606"></a><span class="lineno">14606</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l14607"></a><span class="lineno">14607</span>         fors = 1;</div>
+<div class="line"><a name="l14608"></a><span class="lineno">14608</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l14609"></a><span class="lineno">14609</span>         fors = 2;</div>
+<div class="line"><a name="l14610"></a><span class="lineno">14610</span> </div>
+<div class="line"><a name="l14611"></a><span class="lineno">14611</span>     <span class="keywordflow">if</span> (fors != 2) {</div>
+<div class="line"><a name="l14612"></a><span class="lineno">14612</span>         cpl_msg_error(func, <span class="stringliteral">"Wrong instrument: %s\n"</span></div>
+<div class="line"><a name="l14613"></a><span class="lineno">14613</span>                       <span class="stringliteral">"FORS2 is expected for MXU data"</span>, instrume);</div>
+<div class="line"><a name="l14614"></a><span class="lineno">14614</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14615"></a><span class="lineno">14615</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14616"></a><span class="lineno">14616</span>     }</div>
+<div class="line"><a name="l14617"></a><span class="lineno">14617</span> </div>
+<div class="line"><a name="l14618"></a><span class="lineno">14618</span> </div>
+<div class="line"><a name="l14619"></a><span class="lineno">14619</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14620"></a><span class="lineno">14620</span> <span class="comment">     * The master and slave chips can be identified by their positions</span></div>
+<div class="line"><a name="l14621"></a><span class="lineno">14621</span> <span class="comment">     * in the chip array in the case of FORS2 data (with fors1 the chip</span></div>
+<div class="line"><a name="l14622"></a><span class="lineno">14622</span> <span class="comment">     * is always 1). chip = 2 is the master, chip = 1 is the slave.</span></div>
+<div class="line"><a name="l14623"></a><span class="lineno">14623</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14624"></a><span class="lineno">14624</span> </div>
+<div class="line"><a name="l14625"></a><span class="lineno">14625</span>     chip = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET CHIP1 Y"</span>);</div>
+<div class="line"><a name="l14626"></a><span class="lineno">14626</span> </div>
+<div class="line"><a name="l14627"></a><span class="lineno">14627</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l14628"></a><span class="lineno">14628</span>         cpl_msg_error(func, <span class="stringliteral">"Missing keyword ESO DET CHIP1 Y "</span></div>
+<div class="line"><a name="l14629"></a><span class="lineno">14629</span>                       <span class="stringliteral">"in FITS header"</span>);</div>
+<div class="line"><a name="l14630"></a><span class="lineno">14630</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14631"></a><span class="lineno">14631</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14632"></a><span class="lineno">14632</span>     }</div>
+<div class="line"><a name="l14633"></a><span class="lineno">14633</span> </div>
+<div class="line"><a name="l14634"></a><span class="lineno">14634</span>     <span class="keywordflow">if</span> (chip != 1 && chip != 2) {</div>
+<div class="line"><a name="l14635"></a><span class="lineno">14635</span>         cpl_msg_error(func, <span class="stringliteral">"Unexpected chip position in keyword "</span></div>
+<div class="line"><a name="l14636"></a><span class="lineno">14636</span>                       <span class="stringliteral">"ESO DET CHIP1 Y: %d"</span>, chip);</div>
+<div class="line"><a name="l14637"></a><span class="lineno">14637</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14638"></a><span class="lineno">14638</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14639"></a><span class="lineno">14639</span>     }</div>
+<div class="line"><a name="l14640"></a><span class="lineno">14640</span> </div>
+<div class="line"><a name="l14641"></a><span class="lineno">14641</span> </div>
+<div class="line"><a name="l14642"></a><span class="lineno">14642</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14643"></a><span class="lineno">14643</span> <span class="comment">     * Count slits in header (excluding reference slits, and the slits</span></div>
+<div class="line"><a name="l14644"></a><span class="lineno">14644</span> <span class="comment">     * that _surely_ belong to the other chip)</span></div>
+<div class="line"><a name="l14645"></a><span class="lineno">14645</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14646"></a><span class="lineno">14646</span> </div>
+<div class="line"><a name="l14647"></a><span class="lineno">14647</span>     nslits = 0;</div>
+<div class="line"><a name="l14648"></a><span class="lineno">14648</span>     slit_id = 0;</div>
+<div class="line"><a name="l14649"></a><span class="lineno">14649</span>     found = 1;</div>
+<div class="line"><a name="l14650"></a><span class="lineno">14650</span> </div>
+<div class="line"><a name="l14651"></a><span class="lineno">14651</span>     <span class="keywordflow">while</span> (found) {</div>
+<div class="line"><a name="l14652"></a><span class="lineno">14652</span>         slit_id++;</div>
+<div class="line"><a name="l14653"></a><span class="lineno">14653</span>         snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d YPOS"</span>, slit_id + 100);</div>
+<div class="line"><a name="l14654"></a><span class="lineno">14654</span>         <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {</div>
+<div class="line"><a name="l14655"></a><span class="lineno">14655</span>             slit_y = cpl_propertylist_get_double(header, keyname);</div>
+<div class="line"><a name="l14656"></a><span class="lineno">14656</span> </div>
+<div class="line"><a name="l14657"></a><span class="lineno">14657</span>             <span class="keywordflow">if</span> (chip == 1)</div>
+<div class="line"><a name="l14658"></a><span class="lineno">14658</span>                 <span class="keywordflow">if</span> (slit_y < low_limit1)</div>
+<div class="line"><a name="l14659"></a><span class="lineno">14659</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l14660"></a><span class="lineno">14660</span>             <span class="keywordflow">if</span> (chip == 2)</div>
+<div class="line"><a name="l14661"></a><span class="lineno">14661</span>                 <span class="keywordflow">if</span> (slit_y > hig_limit2)</div>
+<div class="line"><a name="l14662"></a><span class="lineno">14662</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l14663"></a><span class="lineno">14663</span>                 </div>
+<div class="line"><a name="l14664"></a><span class="lineno">14664</span>             snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS TARG%d NAME"</span>, </div>
+<div class="line"><a name="l14665"></a><span class="lineno">14665</span>                      slit_id + 100);</div>
+<div class="line"><a name="l14666"></a><span class="lineno">14666</span>             <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {</div>
+<div class="line"><a name="l14667"></a><span class="lineno">14667</span>                 target_name = cpl_propertylist_get_string(header, keyname);</div>
+<div class="line"><a name="l14668"></a><span class="lineno">14668</span>                 <span class="keywordflow">if</span> (strncmp(target_name, <span class="stringliteral">"refslit"</span>, 7))</div>
+<div class="line"><a name="l14669"></a><span class="lineno">14669</span>                     nslits++;</div>
+<div class="line"><a name="l14670"></a><span class="lineno">14670</span>             }</div>
+<div class="line"><a name="l14671"></a><span class="lineno">14671</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l14672"></a><span class="lineno">14672</span>                 nslits++;</div>
+<div class="line"><a name="l14673"></a><span class="lineno">14673</span>         }</div>
+<div class="line"><a name="l14674"></a><span class="lineno">14674</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l14675"></a><span class="lineno">14675</span>             found = 0;</div>
+<div class="line"><a name="l14676"></a><span class="lineno">14676</span>     }</div>
+<div class="line"><a name="l14677"></a><span class="lineno">14677</span> </div>
+<div class="line"><a name="l14678"></a><span class="lineno">14678</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l14679"></a><span class="lineno">14679</span>         cpl_msg_error(func, <span class="stringliteral">"%s while loading slits coordinates from "</span></div>
+<div class="line"><a name="l14680"></a><span class="lineno">14680</span>                       <span class="stringliteral">"FITS header"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l14681"></a><span class="lineno">14681</span>         cpl_error_set_where(func);</div>
+<div class="line"><a name="l14682"></a><span class="lineno">14682</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14683"></a><span class="lineno">14683</span>     }</div>
+<div class="line"><a name="l14684"></a><span class="lineno">14684</span> </div>
+<div class="line"><a name="l14685"></a><span class="lineno">14685</span>     <span class="keywordflow">if</span> (nslits == 0)  {</div>
+<div class="line"><a name="l14686"></a><span class="lineno">14686</span>         cpl_msg_error(func, <span class="stringliteral">"No slits coordinates found in header"</span>);</div>
+<div class="line"><a name="l14687"></a><span class="lineno">14687</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l14688"></a><span class="lineno">14688</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14689"></a><span class="lineno">14689</span>     }</div>
+<div class="line"><a name="l14690"></a><span class="lineno">14690</span> </div>
+<div class="line"><a name="l14691"></a><span class="lineno">14691</span>     slits = cpl_table_new(nslits);</div>
+<div class="line"><a name="l14692"></a><span class="lineno">14692</span>     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l14693"></a><span class="lineno">14693</span>     cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14694"></a><span class="lineno">14694</span>     cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14695"></a><span class="lineno">14695</span>     cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14696"></a><span class="lineno">14696</span>     cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14697"></a><span class="lineno">14697</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>,    <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l14698"></a><span class="lineno">14698</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>,    <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l14699"></a><span class="lineno">14699</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l14700"></a><span class="lineno">14700</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l14701"></a><span class="lineno">14701</span> </div>
+<div class="line"><a name="l14702"></a><span class="lineno">14702</span>     nslits = 0;</div>
+<div class="line"><a name="l14703"></a><span class="lineno">14703</span>     slit_id = 0; </div>
+<div class="line"><a name="l14704"></a><span class="lineno">14704</span>     found = 1;</div>
+<div class="line"><a name="l14705"></a><span class="lineno">14705</span>     <span class="keywordflow">while</span> (found) {</div>
+<div class="line"><a name="l14706"></a><span class="lineno">14706</span>         slit_id++;</div>
+<div class="line"><a name="l14707"></a><span class="lineno">14707</span>         snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d YPOS"</span>, slit_id + 100);</div>
+<div class="line"><a name="l14708"></a><span class="lineno">14708</span>         <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {</div>
+<div class="line"><a name="l14709"></a><span class="lineno">14709</span>             slit_y = cpl_propertylist_get_double(header, keyname);</div>
+<div class="line"><a name="l14710"></a><span class="lineno">14710</span> </div>
+<div class="line"><a name="l14711"></a><span class="lineno">14711</span>             <span class="keywordflow">if</span> (chip == 1) </div>
+<div class="line"><a name="l14712"></a><span class="lineno">14712</span>                 <span class="keywordflow">if</span> (slit_y < low_limit1)</div>
+<div class="line"><a name="l14713"></a><span class="lineno">14713</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l14714"></a><span class="lineno">14714</span>             <span class="keywordflow">if</span> (chip == 2)</div>
+<div class="line"><a name="l14715"></a><span class="lineno">14715</span>                 <span class="keywordflow">if</span> (slit_y > hig_limit2)</div>
+<div class="line"><a name="l14716"></a><span class="lineno">14716</span>                     <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l14717"></a><span class="lineno">14717</span> </div>
+<div class="line"><a name="l14718"></a><span class="lineno">14718</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l14719"></a><span class="lineno">14719</span> <span class="comment">             * Y-flip the slit position, to match CCD pixel coordinate</span></div>
+<div class="line"><a name="l14720"></a><span class="lineno">14720</span> <span class="comment">             * convention</span></div>
+<div class="line"><a name="l14721"></a><span class="lineno">14721</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l14722"></a><span class="lineno">14722</span> </div>
+<div class="line"><a name="l14723"></a><span class="lineno">14723</span>             slit_y = -slit_y;</div>
+<div class="line"><a name="l14724"></a><span class="lineno">14724</span> </div>
+<div class="line"><a name="l14725"></a><span class="lineno">14725</span>             snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d XPOS"</span>, slit_id + 100);</div>
+<div class="line"><a name="l14726"></a><span class="lineno">14726</span>             slit_x = cpl_propertylist_get_double(header, keyname);</div>
+<div class="line"><a name="l14727"></a><span class="lineno">14727</span>             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l14728"></a><span class="lineno">14728</span>                 cpl_table_delete(slits);</div>
+<div class="line"><a name="l14729"></a><span class="lineno">14729</span>                 cpl_msg_error(func, <span class="stringliteral">"Missing keyword %s in FITS header"</span>, </div>
+<div class="line"><a name="l14730"></a><span class="lineno">14730</span>                               keyname);</div>
+<div class="line"><a name="l14731"></a><span class="lineno">14731</span>                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14732"></a><span class="lineno">14732</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14733"></a><span class="lineno">14733</span>             }</div>
+<div class="line"><a name="l14734"></a><span class="lineno">14734</span> </div>
+<div class="line"><a name="l14735"></a><span class="lineno">14735</span>             snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d LEN"</span>, slit_id + 100);</div>
+<div class="line"><a name="l14736"></a><span class="lineno">14736</span>             length = cpl_propertylist_get_double(header, keyname);</div>
+<div class="line"><a name="l14737"></a><span class="lineno">14737</span>             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l14738"></a><span class="lineno">14738</span>                 cpl_table_delete(slits);</div>
+<div class="line"><a name="l14739"></a><span class="lineno">14739</span>                 cpl_msg_error(func, <span class="stringliteral">"Missing keyword %s in FITS header"</span>, </div>
+<div class="line"><a name="l14740"></a><span class="lineno">14740</span>                               keyname);</div>
+<div class="line"><a name="l14741"></a><span class="lineno">14741</span>                 cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14742"></a><span class="lineno">14742</span>                 <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14743"></a><span class="lineno">14743</span>             }</div>
+<div class="line"><a name="l14744"></a><span class="lineno">14744</span> </div>
+<div class="line"><a name="l14745"></a><span class="lineno">14745</span>             length *= arc2mm;</div>
+<div class="line"><a name="l14746"></a><span class="lineno">14746</span> </div>
+<div class="line"><a name="l14747"></a><span class="lineno">14747</span>             snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS TARG%d NAME"</span>, </div>
+<div class="line"><a name="l14748"></a><span class="lineno">14748</span>                      slit_id + 100);</div>
+<div class="line"><a name="l14749"></a><span class="lineno">14749</span>             <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {</div>
+<div class="line"><a name="l14750"></a><span class="lineno">14750</span>                 target_name = cpl_propertylist_get_string(header, keyname);</div>
+<div class="line"><a name="l14751"></a><span class="lineno">14751</span>                 <span class="keywordflow">if</span> (strncmp(target_name, <span class="stringliteral">"refslit"</span>, 7)) {</div>
+<div class="line"><a name="l14752"></a><span class="lineno">14752</span>                     cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, nslits, slit_id);</div>
+<div class="line"><a name="l14753"></a><span class="lineno">14753</span>                     cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, nslits, slit_x);</div>
+<div class="line"><a name="l14754"></a><span class="lineno">14754</span>                     cpl_table_set(slits, <span class="stringliteral">"ytop"</span>, nslits, slit_y + length/2);</div>
+<div class="line"><a name="l14755"></a><span class="lineno">14755</span>                     cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, nslits, slit_x);</div>
+<div class="line"><a name="l14756"></a><span class="lineno">14756</span>                     cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, nslits, slit_y - length/2);</div>
+<div class="line"><a name="l14757"></a><span class="lineno">14757</span>                     nslits++;</div>
+<div class="line"><a name="l14758"></a><span class="lineno">14758</span>                 }</div>
+<div class="line"><a name="l14759"></a><span class="lineno">14759</span>             }</div>
+<div class="line"><a name="l14760"></a><span class="lineno">14760</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l14761"></a><span class="lineno">14761</span>                 cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, nslits, slit_id);</div>
+<div class="line"><a name="l14762"></a><span class="lineno">14762</span>                 cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, nslits, slit_x);</div>
+<div class="line"><a name="l14763"></a><span class="lineno">14763</span>                 cpl_table_set(slits, <span class="stringliteral">"ytop"</span>, nslits, slit_y + length/2);</div>
+<div class="line"><a name="l14764"></a><span class="lineno">14764</span>                 cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, nslits, slit_x);</div>
+<div class="line"><a name="l14765"></a><span class="lineno">14765</span>                 cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, nslits, slit_y - length/2);</div>
+<div class="line"><a name="l14766"></a><span class="lineno">14766</span>                 nslits++;</div>
+<div class="line"><a name="l14767"></a><span class="lineno">14767</span>             }</div>
+<div class="line"><a name="l14768"></a><span class="lineno">14768</span>         }</div>
+<div class="line"><a name="l14769"></a><span class="lineno">14769</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l14770"></a><span class="lineno">14770</span>             found = 0;</div>
+<div class="line"><a name="l14771"></a><span class="lineno">14771</span>     }</div>
+<div class="line"><a name="l14772"></a><span class="lineno">14772</span> </div>
+<div class="line"><a name="l14773"></a><span class="lineno">14773</span>     <span class="keywordflow">return</span> slits;</div>
+<div class="line"><a name="l14774"></a><span class="lineno">14774</span> }</div>
+<div class="line"><a name="l14775"></a><span class="lineno">14775</span> </div>
+<div class="line"><a name="l14776"></a><span class="lineno">14776</span> </div>
+<div class="line"><a name="l14800"></a><span class="lineno"><a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8">14800</a></span> cpl_table *<a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(cpl_propertylist *header, </div>
+<div class="line"><a name="l14801"></a><span class="lineno">14801</span>                                    <span class="keywordtype">int</span> * nslits_out_det)</div>
+<div class="line"><a name="l14802"></a><span class="lineno">14802</span> {</div>
+<div class="line"><a name="l14803"></a><span class="lineno">14803</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_slits_fors_mos"</span>;</div>
+<div class="line"><a name="l14804"></a><span class="lineno">14804</span> </div>
+<div class="line"><a name="l14805"></a><span class="lineno">14805</span>     cpl_table  *slits;</div>
+<div class="line"><a name="l14806"></a><span class="lineno">14806</span>     <span class="keywordtype">char</span>        keyname[MAX_COLNAME];</div>
+<div class="line"><a name="l14807"></a><span class="lineno">14807</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *instrume;</div>
+<div class="line"><a name="l14808"></a><span class="lineno">14808</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *chipname;</div>
+<div class="line"><a name="l14809"></a><span class="lineno">14809</span>     <span class="keywordtype">float</span>       slit_x;</div>
+<div class="line"><a name="l14810"></a><span class="lineno">14810</span>     <span class="keywordtype">int</span>         first_slit, last_slit;</div>
+<div class="line"><a name="l14811"></a><span class="lineno">14811</span>     cpl_size    nslits;</div>
+<div class="line"><a name="l14812"></a><span class="lineno">14812</span>     <span class="keywordtype">int</span>         slit_id;</div>
+<div class="line"><a name="l14813"></a><span class="lineno">14813</span>     <span class="keywordtype">int</span>         fors;</div>
+<div class="line"><a name="l14814"></a><span class="lineno">14814</span>     <span class="keywordtype">int</span>         chip;</div>
+<div class="line"><a name="l14815"></a><span class="lineno">14815</span>     <span class="keywordtype">int</span>         fors_is_old;</div>
+<div class="line"><a name="l14816"></a><span class="lineno">14816</span> </div>
+<div class="line"><a name="l14817"></a><span class="lineno">14817</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14818"></a><span class="lineno">14818</span> <span class="comment">     * The Y coordinates of the slits are fixed</span></div>
+<div class="line"><a name="l14819"></a><span class="lineno">14819</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14820"></a><span class="lineno">14820</span> </div>
+<div class="line"><a name="l14821"></a><span class="lineno">14821</span>     <span class="keywordtype">float</span>       ytop[19]    = { 113.9, 101.3,  89.9,  77.3,  65.9,  53.3, </div>
+<div class="line"><a name="l14822"></a><span class="lineno">14822</span>                                  41.9,  29.3,  17.9,   5.3,  -6.1, -18.7, </div>
+<div class="line"><a name="l14823"></a><span class="lineno">14823</span>                                 -30.1, -42.7, -54.1, -66.7, -78.1, -90.7, </div>
+<div class="line"><a name="l14824"></a><span class="lineno">14824</span>                                -102.1 };</div>
+<div class="line"><a name="l14825"></a><span class="lineno">14825</span>     <span class="keywordtype">float</span>       ybottom[19] = { 102.1,  90.7,  78.1,  66.7,  54.1,  42.7,</div>
+<div class="line"><a name="l14826"></a><span class="lineno">14826</span>                                  30.1,  18.7,   6.1,  -5.3, -17.9, -29.3,</div>
+<div class="line"><a name="l14827"></a><span class="lineno">14827</span>                                 -41.9, -53.3, -65.9, -77.3, -89.9, -101.3,</div>
+<div class="line"><a name="l14828"></a><span class="lineno">14828</span>                                -113.9 };</div>
+<div class="line"><a name="l14829"></a><span class="lineno">14829</span> </div>
+<div class="line"><a name="l14830"></a><span class="lineno">14830</span> </div>
+<div class="line"><a name="l14831"></a><span class="lineno">14831</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l14832"></a><span class="lineno">14832</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14833"></a><span class="lineno">14833</span>     }</div>
+<div class="line"><a name="l14834"></a><span class="lineno">14834</span> </div>
+<div class="line"><a name="l14835"></a><span class="lineno">14835</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l14836"></a><span class="lineno">14836</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l14837"></a><span class="lineno">14837</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14838"></a><span class="lineno">14838</span>     }</div>
+<div class="line"><a name="l14839"></a><span class="lineno">14839</span> </div>
+<div class="line"><a name="l14840"></a><span class="lineno">14840</span> </div>
+<div class="line"><a name="l14841"></a><span class="lineno">14841</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14842"></a><span class="lineno">14842</span> <span class="comment">     * See if this is FORS1 or FORS2;</span></div>
+<div class="line"><a name="l14843"></a><span class="lineno">14843</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14844"></a><span class="lineno">14844</span> </div>
+<div class="line"><a name="l14845"></a><span class="lineno">14845</span>     instrume = cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l14846"></a><span class="lineno">14846</span> </div>
+<div class="line"><a name="l14847"></a><span class="lineno">14847</span>     fors = 0;</div>
+<div class="line"><a name="l14848"></a><span class="lineno">14848</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l14849"></a><span class="lineno">14849</span>         fors = 1;</div>
+<div class="line"><a name="l14850"></a><span class="lineno">14850</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l14851"></a><span class="lineno">14851</span>         fors = 2;</div>
+<div class="line"><a name="l14852"></a><span class="lineno">14852</span> </div>
+<div class="line"><a name="l14853"></a><span class="lineno">14853</span>     <span class="keywordflow">if</span> (fors == 0) {</div>
+<div class="line"><a name="l14854"></a><span class="lineno">14854</span>         cpl_msg_error(func, <span class="stringliteral">"Wrong instrument found in FITS header: %s"</span>, </div>
+<div class="line"><a name="l14855"></a><span class="lineno">14855</span>                       instrume);</div>
+<div class="line"><a name="l14856"></a><span class="lineno">14856</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14857"></a><span class="lineno">14857</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14858"></a><span class="lineno">14858</span>     }</div>
+<div class="line"><a name="l14859"></a><span class="lineno">14859</span> </div>
+<div class="line"><a name="l14860"></a><span class="lineno">14860</span>     <span class="comment">/* FIXME:</span></div>
+<div class="line"><a name="l14861"></a><span class="lineno">14861</span> <span class="comment">     * This is the way FORS1 data belong to the upgraded chips,</span></div>
+<div class="line"><a name="l14862"></a><span class="lineno">14862</span> <span class="comment">     * named "Marlene" and "Norma III". It's a quick solution,</span></div>
+<div class="line"><a name="l14863"></a><span class="lineno">14863</span> <span class="comment">     * there are hardcoded values here!!!</span></div>
+<div class="line"><a name="l14864"></a><span class="lineno">14864</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14865"></a><span class="lineno">14865</span> </div>
+<div class="line"><a name="l14866"></a><span class="lineno">14866</span>     chipname = cpl_propertylist_get_string(header, <span class="stringliteral">"ESO DET CHIP1 ID"</span>);</div>
+<div class="line"><a name="l14867"></a><span class="lineno">14867</span> </div>
+<div class="line"><a name="l14868"></a><span class="lineno">14868</span>     <span class="keywordflow">if</span> (chipname[0] == <span class="charliteral">'M'</span> || chipname[0] == <span class="charliteral">'N'</span>)</div>
+<div class="line"><a name="l14869"></a><span class="lineno">14869</span>         fors_is_old = 0;</div>
+<div class="line"><a name="l14870"></a><span class="lineno">14870</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l14871"></a><span class="lineno">14871</span>         fors_is_old = 1;</div>
+<div class="line"><a name="l14872"></a><span class="lineno">14872</span> </div>
+<div class="line"><a name="l14873"></a><span class="lineno">14873</span>     <span class="keywordflow">if</span> (fors == 1 && fors_is_old) {</div>
+<div class="line"><a name="l14874"></a><span class="lineno">14874</span>         first_slit = 1;</div>
+<div class="line"><a name="l14875"></a><span class="lineno">14875</span>         last_slit = 19;</div>
+<div class="line"><a name="l14876"></a><span class="lineno">14876</span>     }</div>
+<div class="line"><a name="l14877"></a><span class="lineno">14877</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l14878"></a><span class="lineno">14878</span> </div>
+<div class="line"><a name="l14879"></a><span class="lineno">14879</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l14880"></a><span class="lineno">14880</span> <span class="comment">         * The master and slave chips can be identified by their positions</span></div>
+<div class="line"><a name="l14881"></a><span class="lineno">14881</span> <span class="comment">         * in the chip array in the case of FORS2 data: chip = 2 is the </span></div>
+<div class="line"><a name="l14882"></a><span class="lineno">14882</span> <span class="comment">         * master, chip = 1 is the slave.</span></div>
+<div class="line"><a name="l14883"></a><span class="lineno">14883</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l14884"></a><span class="lineno">14884</span> </div>
+<div class="line"><a name="l14885"></a><span class="lineno">14885</span>         chip = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET CHIP1 Y"</span>);</div>
+<div class="line"><a name="l14886"></a><span class="lineno">14886</span> </div>
+<div class="line"><a name="l14887"></a><span class="lineno">14887</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l14888"></a><span class="lineno">14888</span>             cpl_msg_error(func, <span class="stringliteral">"Missing keyword ESO DET CHIP1 Y "</span></div>
+<div class="line"><a name="l14889"></a><span class="lineno">14889</span>                           <span class="stringliteral">"in FITS header"</span>);</div>
+<div class="line"><a name="l14890"></a><span class="lineno">14890</span>             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14891"></a><span class="lineno">14891</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14892"></a><span class="lineno">14892</span>         }</div>
+<div class="line"><a name="l14893"></a><span class="lineno">14893</span> </div>
+<div class="line"><a name="l14894"></a><span class="lineno">14894</span>         <span class="keywordflow">if</span> (chip != 1 && chip != 2) {</div>
+<div class="line"><a name="l14895"></a><span class="lineno">14895</span>             cpl_msg_error(func, <span class="stringliteral">"Unexpected chip position in keyword "</span></div>
+<div class="line"><a name="l14896"></a><span class="lineno">14896</span>                           <span class="stringliteral">"ESO DET CHIP1 Y: %d"</span>, chip);</div>
+<div class="line"><a name="l14897"></a><span class="lineno">14897</span>             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14898"></a><span class="lineno">14898</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14899"></a><span class="lineno">14899</span>         }</div>
+<div class="line"><a name="l14900"></a><span class="lineno">14900</span> </div>
+<div class="line"><a name="l14901"></a><span class="lineno">14901</span>         <span class="keywordflow">if</span> (chip == 1) {</div>
+<div class="line"><a name="l14902"></a><span class="lineno">14902</span>             first_slit = 12;</div>
+<div class="line"><a name="l14903"></a><span class="lineno">14903</span>             last_slit = 19;</div>
+<div class="line"><a name="l14904"></a><span class="lineno">14904</span>         }</div>
+<div class="line"><a name="l14905"></a><span class="lineno">14905</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l14906"></a><span class="lineno">14906</span>             first_slit = 1;</div>
+<div class="line"><a name="l14907"></a><span class="lineno">14907</span>             last_slit = 11;</div>
+<div class="line"><a name="l14908"></a><span class="lineno">14908</span>         }</div>
+<div class="line"><a name="l14909"></a><span class="lineno">14909</span>     }</div>
+<div class="line"><a name="l14910"></a><span class="lineno">14910</span> </div>
+<div class="line"><a name="l14911"></a><span class="lineno">14911</span> </div>
+<div class="line"><a name="l14912"></a><span class="lineno">14912</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l14913"></a><span class="lineno">14913</span> <span class="comment">     * Count slits in header (excluding closed slits - i.e. those with</span></div>
+<div class="line"><a name="l14914"></a><span class="lineno">14914</span> <span class="comment">     * offsets greater than 115 mm - and the slits that do not belong </span></div>
+<div class="line"><a name="l14915"></a><span class="lineno">14915</span> <span class="comment">     * to this chip)</span></div>
+<div class="line"><a name="l14916"></a><span class="lineno">14916</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l14917"></a><span class="lineno">14917</span> </div>
+<div class="line"><a name="l14918"></a><span class="lineno">14918</span>     nslits = 0;</div>
+<div class="line"><a name="l14919"></a><span class="lineno">14919</span>     slit_id = 0;</div>
+<div class="line"><a name="l14920"></a><span class="lineno">14920</span>     <span class="keywordflow">for</span> (slit_id = first_slit; slit_id <= last_slit; slit_id++) {</div>
+<div class="line"><a name="l14921"></a><span class="lineno">14921</span>         snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d POS"</span>, slit_id);</div>
+<div class="line"><a name="l14922"></a><span class="lineno">14922</span>         <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {</div>
+<div class="line"><a name="l14923"></a><span class="lineno">14923</span>             slit_x = cpl_propertylist_get_double(header, keyname);</div>
+<div class="line"><a name="l14924"></a><span class="lineno">14924</span>             <span class="keywordflow">if</span> (fabs(slit_x) < 115.0)</div>
+<div class="line"><a name="l14925"></a><span class="lineno">14925</span>                 nslits++;</div>
+<div class="line"><a name="l14926"></a><span class="lineno">14926</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l14927"></a><span class="lineno">14927</span>                 (*nslits_out_det)++;        </div>
+<div class="line"><a name="l14928"></a><span class="lineno">14928</span>         }</div>
+<div class="line"><a name="l14929"></a><span class="lineno">14929</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l14930"></a><span class="lineno">14930</span>             cpl_msg_error(func, <span class="stringliteral">"Missing keyword %s in FITS header"</span>, keyname);</div>
+<div class="line"><a name="l14931"></a><span class="lineno">14931</span>             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l14932"></a><span class="lineno">14932</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14933"></a><span class="lineno">14933</span>         }</div>
+<div class="line"><a name="l14934"></a><span class="lineno">14934</span>     }</div>
+<div class="line"><a name="l14935"></a><span class="lineno">14935</span> </div>
+<div class="line"><a name="l14936"></a><span class="lineno">14936</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l14937"></a><span class="lineno">14937</span>         cpl_msg_error(func, <span class="stringliteral">"%s while loading slits coordinates from "</span></div>
+<div class="line"><a name="l14938"></a><span class="lineno">14938</span>                       <span class="stringliteral">"FITS header"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l14939"></a><span class="lineno">14939</span>         cpl_error_set_where(func);</div>
+<div class="line"><a name="l14940"></a><span class="lineno">14940</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14941"></a><span class="lineno">14941</span>     }</div>
+<div class="line"><a name="l14942"></a><span class="lineno">14942</span> </div>
+<div class="line"><a name="l14943"></a><span class="lineno">14943</span>     <span class="keywordflow">if</span> (nslits == 0)  {</div>
+<div class="line"><a name="l14944"></a><span class="lineno">14944</span>         cpl_msg_error(func, <span class="stringliteral">"No slits coordinates found in header"</span>);</div>
+<div class="line"><a name="l14945"></a><span class="lineno">14945</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l14946"></a><span class="lineno">14946</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l14947"></a><span class="lineno">14947</span>     }</div>
+<div class="line"><a name="l14948"></a><span class="lineno">14948</span> </div>
+<div class="line"><a name="l14949"></a><span class="lineno">14949</span>     slits = cpl_table_new(nslits);</div>
+<div class="line"><a name="l14950"></a><span class="lineno">14950</span>     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l14951"></a><span class="lineno">14951</span>     cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14952"></a><span class="lineno">14952</span>     cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14953"></a><span class="lineno">14953</span>     cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14954"></a><span class="lineno">14954</span>     cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l14955"></a><span class="lineno">14955</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>,    <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l14956"></a><span class="lineno">14956</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>,    <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l14957"></a><span class="lineno">14957</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l14958"></a><span class="lineno">14958</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l14959"></a><span class="lineno">14959</span> </div>
+<div class="line"><a name="l14960"></a><span class="lineno">14960</span>     nslits = 0;</div>
+<div class="line"><a name="l14961"></a><span class="lineno">14961</span>     slit_id = 0;</div>
+<div class="line"><a name="l14962"></a><span class="lineno">14962</span>     <span class="keywordflow">for</span> (slit_id = first_slit; slit_id <= last_slit; slit_id++) {</div>
+<div class="line"><a name="l14963"></a><span class="lineno">14963</span>         snprintf(keyname, MAX_COLNAME, <span class="stringliteral">"ESO INS MOS%d POS"</span>, slit_id);</div>
+<div class="line"><a name="l14964"></a><span class="lineno">14964</span>         slit_x = cpl_propertylist_get_double(header, keyname);</div>
+<div class="line"><a name="l14965"></a><span class="lineno">14965</span>         <span class="keywordflow">if</span> (fabs(slit_x) < 115.0) {</div>
+<div class="line"><a name="l14966"></a><span class="lineno">14966</span>             cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, nslits, slit_id);</div>
+<div class="line"><a name="l14967"></a><span class="lineno">14967</span>             cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, nslits, slit_x);</div>
+<div class="line"><a name="l14968"></a><span class="lineno">14968</span>             cpl_table_set(slits, <span class="stringliteral">"ytop"</span>, nslits, ytop[slit_id-1]);</div>
+<div class="line"><a name="l14969"></a><span class="lineno">14969</span>             cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, nslits, slit_x);</div>
+<div class="line"><a name="l14970"></a><span class="lineno">14970</span>             cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, nslits, ybottom[slit_id-1]);</div>
+<div class="line"><a name="l14971"></a><span class="lineno">14971</span>             nslits++;</div>
+<div class="line"><a name="l14972"></a><span class="lineno">14972</span>         }</div>
+<div class="line"><a name="l14973"></a><span class="lineno">14973</span>     }</div>
+<div class="line"><a name="l14974"></a><span class="lineno">14974</span> </div>
+<div class="line"><a name="l14975"></a><span class="lineno">14975</span>     <span class="keywordflow">return</span> slits;</div>
+<div class="line"><a name="l14976"></a><span class="lineno">14976</span> }</div>
+<div class="line"><a name="l14977"></a><span class="lineno">14977</span> </div>
+<div class="line"><a name="l14978"></a><span class="lineno">14978</span> </div>
+<div class="line"><a name="l15002"></a><span class="lineno"><a class="code" href="group__moses.html#ga43072c6a57d094a5d7d341934a096e80">15002</a></span> cpl_table *<a class="code" href="group__moses.html#ga43072c6a57d094a5d7d341934a096e80" title="Create slit location table from FITS header of FORS1/2 LSS data.">mos_load_slits_fors_lss</a>(cpl_propertylist *header)</div>
+<div class="line"><a name="l15003"></a><span class="lineno">15003</span> {</div>
+<div class="line"><a name="l15004"></a><span class="lineno">15004</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_slits_fors_lss"</span>;</div>
+<div class="line"><a name="l15005"></a><span class="lineno">15005</span> </div>
+<div class="line"><a name="l15006"></a><span class="lineno">15006</span>     cpl_table  *slits;</div>
+<div class="line"><a name="l15007"></a><span class="lineno">15007</span>     <span class="keywordtype">char</span>       *slit_name;</div>
+<div class="line"><a name="l15008"></a><span class="lineno">15008</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *instrume;</div>
+<div class="line"><a name="l15009"></a><span class="lineno">15009</span>     <span class="keywordtype">int</span>         fors;</div>
+<div class="line"><a name="l15010"></a><span class="lineno">15010</span>     <span class="keywordtype">int</span>         chip;</div>
+<div class="line"><a name="l15011"></a><span class="lineno">15011</span>     <span class="keywordtype">float</span>       ytop;</div>
+<div class="line"><a name="l15012"></a><span class="lineno">15012</span>     <span class="keywordtype">float</span>       ybottom;</div>
+<div class="line"><a name="l15013"></a><span class="lineno">15013</span> </div>
+<div class="line"><a name="l15014"></a><span class="lineno">15014</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15015"></a><span class="lineno">15015</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15016"></a><span class="lineno">15016</span>     }</div>
+<div class="line"><a name="l15017"></a><span class="lineno">15017</span> </div>
+<div class="line"><a name="l15018"></a><span class="lineno">15018</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l15019"></a><span class="lineno">15019</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l15020"></a><span class="lineno">15020</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15021"></a><span class="lineno">15021</span>     }</div>
+<div class="line"><a name="l15022"></a><span class="lineno">15022</span> </div>
+<div class="line"><a name="l15023"></a><span class="lineno">15023</span> </div>
+<div class="line"><a name="l15024"></a><span class="lineno">15024</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l15025"></a><span class="lineno">15025</span> <span class="comment">     * See if this is FORS1 or FORS2;</span></div>
+<div class="line"><a name="l15026"></a><span class="lineno">15026</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l15027"></a><span class="lineno">15027</span> </div>
+<div class="line"><a name="l15028"></a><span class="lineno">15028</span>     instrume = cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l15029"></a><span class="lineno">15029</span> </div>
+<div class="line"><a name="l15030"></a><span class="lineno">15030</span>     fors = 0;</div>
+<div class="line"><a name="l15031"></a><span class="lineno">15031</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l15032"></a><span class="lineno">15032</span>         fors = 1;</div>
+<div class="line"><a name="l15033"></a><span class="lineno">15033</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l15034"></a><span class="lineno">15034</span>         fors = 2;</div>
+<div class="line"><a name="l15035"></a><span class="lineno">15035</span> </div>
+<div class="line"><a name="l15036"></a><span class="lineno">15036</span>     <span class="keywordflow">if</span> (fors == 0) {</div>
+<div class="line"><a name="l15037"></a><span class="lineno">15037</span>         cpl_msg_error(func, <span class="stringliteral">"Wrong instrument found in FITS header: %s"</span>, </div>
+<div class="line"><a name="l15038"></a><span class="lineno">15038</span>                       instrume);</div>
+<div class="line"><a name="l15039"></a><span class="lineno">15039</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15040"></a><span class="lineno">15040</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15041"></a><span class="lineno">15041</span>     }</div>
+<div class="line"><a name="l15042"></a><span class="lineno">15042</span> </div>
+<div class="line"><a name="l15043"></a><span class="lineno">15043</span>     <span class="keywordflow">if</span> (fors == 1) {</div>
+<div class="line"><a name="l15044"></a><span class="lineno">15044</span>         ytop = 109.94;</div>
+<div class="line"><a name="l15045"></a><span class="lineno">15045</span>         ybottom = -109.94;</div>
+<div class="line"><a name="l15046"></a><span class="lineno">15046</span>     }</div>
+<div class="line"><a name="l15047"></a><span class="lineno">15047</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l15048"></a><span class="lineno">15048</span> </div>
+<div class="line"><a name="l15049"></a><span class="lineno">15049</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l15050"></a><span class="lineno">15050</span> <span class="comment">         * The master and slave chips can be identified by their positions</span></div>
+<div class="line"><a name="l15051"></a><span class="lineno">15051</span> <span class="comment">         * in the chip array in the case of FORS2 data: chip = 2 is the </span></div>
+<div class="line"><a name="l15052"></a><span class="lineno">15052</span> <span class="comment">         * master, chip = 1 is the slave.</span></div>
+<div class="line"><a name="l15053"></a><span class="lineno">15053</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l15054"></a><span class="lineno">15054</span> </div>
+<div class="line"><a name="l15055"></a><span class="lineno">15055</span>         chip = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET CHIP1 Y"</span>);</div>
+<div class="line"><a name="l15056"></a><span class="lineno">15056</span> </div>
+<div class="line"><a name="l15057"></a><span class="lineno">15057</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15058"></a><span class="lineno">15058</span>             cpl_msg_error(func, <span class="stringliteral">"Missing keyword ESO DET CHIP1 Y "</span></div>
+<div class="line"><a name="l15059"></a><span class="lineno">15059</span>                           <span class="stringliteral">"in FITS header"</span>);</div>
+<div class="line"><a name="l15060"></a><span class="lineno">15060</span>             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15061"></a><span class="lineno">15061</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15062"></a><span class="lineno">15062</span>         }</div>
+<div class="line"><a name="l15063"></a><span class="lineno">15063</span> </div>
+<div class="line"><a name="l15064"></a><span class="lineno">15064</span>         <span class="keywordflow">if</span> (chip != 1 && chip != 2) {</div>
+<div class="line"><a name="l15065"></a><span class="lineno">15065</span>             cpl_msg_error(func, <span class="stringliteral">"Unexpected chip position in keyword "</span></div>
+<div class="line"><a name="l15066"></a><span class="lineno">15066</span>                           <span class="stringliteral">"ESO DET CHIP1 Y: %d"</span>, chip);</div>
+<div class="line"><a name="l15067"></a><span class="lineno">15067</span>             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15068"></a><span class="lineno">15068</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15069"></a><span class="lineno">15069</span>         }</div>
+<div class="line"><a name="l15070"></a><span class="lineno">15070</span> </div>
+<div class="line"><a name="l15071"></a><span class="lineno">15071</span>         <span class="keywordflow">if</span> (chip == 1) {</div>
+<div class="line"><a name="l15072"></a><span class="lineno">15072</span>             ytop = 30.0;</div>
+<div class="line"><a name="l15073"></a><span class="lineno">15073</span>             ybottom = -109.94;</div>
+<div class="line"><a name="l15074"></a><span class="lineno">15074</span>         }</div>
+<div class="line"><a name="l15075"></a><span class="lineno">15075</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l15076"></a><span class="lineno">15076</span>             ytop = 109.94;</div>
+<div class="line"><a name="l15077"></a><span class="lineno">15077</span>             ybottom = -20.0;</div>
+<div class="line"><a name="l15078"></a><span class="lineno">15078</span>         }</div>
+<div class="line"><a name="l15079"></a><span class="lineno">15079</span>     }</div>
+<div class="line"><a name="l15080"></a><span class="lineno">15080</span> </div>
+<div class="line"><a name="l15081"></a><span class="lineno">15081</span> </div>
+<div class="line"><a name="l15082"></a><span class="lineno">15082</span>     slits = cpl_table_new(1);</div>
+<div class="line"><a name="l15083"></a><span class="lineno">15083</span>     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15084"></a><span class="lineno">15084</span>     cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15085"></a><span class="lineno">15085</span>     cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15086"></a><span class="lineno">15086</span>     cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15087"></a><span class="lineno">15087</span>     cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15088"></a><span class="lineno">15088</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>,    <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l15089"></a><span class="lineno">15089</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>,    <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l15090"></a><span class="lineno">15090</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l15091"></a><span class="lineno">15091</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l15092"></a><span class="lineno">15092</span> </div>
+<div class="line"><a name="l15093"></a><span class="lineno">15093</span>     slit_name = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, </div>
+<div class="line"><a name="l15094"></a><span class="lineno">15094</span>                                                     <span class="stringliteral">"ESO INS SLIT NAME"</span>);</div>
+<div class="line"><a name="l15095"></a><span class="lineno">15095</span> </div>
+<div class="line"><a name="l15096"></a><span class="lineno">15096</span>     cpl_table_set(slits, <span class="stringliteral">"ytop"</span>, 0, ytop);</div>
+<div class="line"><a name="l15097"></a><span class="lineno">15097</span>     cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, 0, ybottom);</div>
+<div class="line"><a name="l15098"></a><span class="lineno">15098</span> </div>
+<div class="line"><a name="l15099"></a><span class="lineno">15099</span>     <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit0_3arcsec"</span>, 14)) {</div>
+<div class="line"><a name="l15100"></a><span class="lineno">15100</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 1);</div>
+<div class="line"><a name="l15101"></a><span class="lineno">15101</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, -0.075);</div>
+<div class="line"><a name="l15102"></a><span class="lineno">15102</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, 0.075);</div>
+<div class="line"><a name="l15103"></a><span class="lineno">15103</span>     }</div>
+<div class="line"><a name="l15104"></a><span class="lineno">15104</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit0_4arcsec"</span>, 14)) {</div>
+<div class="line"><a name="l15105"></a><span class="lineno">15105</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 2);</div>
+<div class="line"><a name="l15106"></a><span class="lineno">15106</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, 5.895);</div>
+<div class="line"><a name="l15107"></a><span class="lineno">15107</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, 6.105);</div>
+<div class="line"><a name="l15108"></a><span class="lineno">15108</span>     }</div>
+<div class="line"><a name="l15109"></a><span class="lineno">15109</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit0_5arcsec"</span>, 14)) {</div>
+<div class="line"><a name="l15110"></a><span class="lineno">15110</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 3);</div>
+<div class="line"><a name="l15111"></a><span class="lineno">15111</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, -6.135);</div>
+<div class="line"><a name="l15112"></a><span class="lineno">15112</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, -5.865);</div>
+<div class="line"><a name="l15113"></a><span class="lineno">15113</span>     }</div>
+<div class="line"><a name="l15114"></a><span class="lineno">15114</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit0_7arcsec"</span>, 14)) {</div>
+<div class="line"><a name="l15115"></a><span class="lineno">15115</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 4);</div>
+<div class="line"><a name="l15116"></a><span class="lineno">15116</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, 11.815);</div>
+<div class="line"><a name="l15117"></a><span class="lineno">15117</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, 12.185);</div>
+<div class="line"><a name="l15118"></a><span class="lineno">15118</span>     }</div>
+<div class="line"><a name="l15119"></a><span class="lineno">15119</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit1_0arcsec"</span>, 14)) {</div>
+<div class="line"><a name="l15120"></a><span class="lineno">15120</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 5);</div>
+<div class="line"><a name="l15121"></a><span class="lineno">15121</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, -12.265);</div>
+<div class="line"><a name="l15122"></a><span class="lineno">15122</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, -11.735);</div>
+<div class="line"><a name="l15123"></a><span class="lineno">15123</span>     }</div>
+<div class="line"><a name="l15124"></a><span class="lineno">15124</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit1_3arcsec"</span>, 14)) {</div>
+<div class="line"><a name="l15125"></a><span class="lineno">15125</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 6);</div>
+<div class="line"><a name="l15126"></a><span class="lineno">15126</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, 17.655);</div>
+<div class="line"><a name="l15127"></a><span class="lineno">15127</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, 18.345);</div>
+<div class="line"><a name="l15128"></a><span class="lineno">15128</span>     }</div>
+<div class="line"><a name="l15129"></a><span class="lineno">15129</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit1_6arcsec"</span>, 14)) {</div>
+<div class="line"><a name="l15130"></a><span class="lineno">15130</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 7);</div>
+<div class="line"><a name="l15131"></a><span class="lineno">15131</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, -18.425);</div>
+<div class="line"><a name="l15132"></a><span class="lineno">15132</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, -17.575);</div>
+<div class="line"><a name="l15133"></a><span class="lineno">15133</span>     }</div>
+<div class="line"><a name="l15134"></a><span class="lineno">15134</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit2_0arcsec"</span>, 14)) {</div>
+<div class="line"><a name="l15135"></a><span class="lineno">15135</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 8);</div>
+<div class="line"><a name="l15136"></a><span class="lineno">15136</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, 23.475);</div>
+<div class="line"><a name="l15137"></a><span class="lineno">15137</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, 24.525);</div>
+<div class="line"><a name="l15138"></a><span class="lineno">15138</span>     }</div>
+<div class="line"><a name="l15139"></a><span class="lineno">15139</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strncmp(slit_name, <span class="stringliteral">"lSlit2_5arcsec"</span>, 14)) {</div>
+<div class="line"><a name="l15140"></a><span class="lineno">15140</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 9);</div>
+<div class="line"><a name="l15141"></a><span class="lineno">15141</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, 0, -24.66);</div>
+<div class="line"><a name="l15142"></a><span class="lineno">15142</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, 0, -23.34);</div>
+<div class="line"><a name="l15143"></a><span class="lineno">15143</span>     }</div>
+<div class="line"><a name="l15144"></a><span class="lineno">15144</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l15145"></a><span class="lineno">15145</span>         cpl_msg_error(func, <span class="stringliteral">"Invalid slit %s in keyword ESO INS SLIT NAME"</span>,</div>
+<div class="line"><a name="l15146"></a><span class="lineno">15146</span>                       slit_name);</div>
+<div class="line"><a name="l15147"></a><span class="lineno">15147</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l15148"></a><span class="lineno">15148</span>         cpl_table_delete(slits);</div>
+<div class="line"><a name="l15149"></a><span class="lineno">15149</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15150"></a><span class="lineno">15150</span>     }</div>
+<div class="line"><a name="l15151"></a><span class="lineno">15151</span> </div>
+<div class="line"><a name="l15152"></a><span class="lineno">15152</span>     <span class="keywordflow">return</span> slits;</div>
+<div class="line"><a name="l15153"></a><span class="lineno">15153</span> }</div>
+<div class="line"><a name="l15154"></a><span class="lineno">15154</span> </div>
+<div class="line"><a name="l15155"></a><span class="lineno">15155</span> </div>
+<div class="line"><a name="l15170"></a><span class="lineno"><a class="code" href="group__moses.html#ga74be15e9eea7e1a4f025be22ccb12c54">15170</a></span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#ga74be15e9eea7e1a4f025be22ccb12c54" title="Return gain factor for a VIMOS exposure.">mos_get_gain_vimos</a>(cpl_propertylist *header)</div>
+<div class="line"><a name="l15171"></a><span class="lineno">15171</span> {</div>
+<div class="line"><a name="l15172"></a><span class="lineno">15172</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_get_gain_vimos"</span>;</div>
+<div class="line"><a name="l15173"></a><span class="lineno">15173</span> </div>
+<div class="line"><a name="l15174"></a><span class="lineno">15174</span>     <span class="keywordtype">double</span> gain = -1.0;</div>
+<div class="line"><a name="l15175"></a><span class="lineno">15175</span> </div>
+<div class="line"><a name="l15176"></a><span class="lineno">15176</span> </div>
+<div class="line"><a name="l15177"></a><span class="lineno">15177</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l15178"></a><span class="lineno">15178</span>         <span class="keywordflow">return</span> gain;</div>
+<div class="line"><a name="l15179"></a><span class="lineno">15179</span> </div>
+<div class="line"><a name="l15180"></a><span class="lineno">15180</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l15181"></a><span class="lineno">15181</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l15182"></a><span class="lineno">15182</span>         <span class="keywordflow">return</span> gain;</div>
+<div class="line"><a name="l15183"></a><span class="lineno">15183</span>     }</div>
+<div class="line"><a name="l15184"></a><span class="lineno">15184</span> </div>
+<div class="line"><a name="l15185"></a><span class="lineno">15185</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l15186"></a><span class="lineno">15186</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l15187"></a><span class="lineno">15187</span>         cpl_error_set_where(func);</div>
+<div class="line"><a name="l15188"></a><span class="lineno">15188</span>         gain = -1.0;</div>
+<div class="line"><a name="l15189"></a><span class="lineno">15189</span>     }</div>
+<div class="line"><a name="l15190"></a><span class="lineno">15190</span> </div>
+<div class="line"><a name="l15191"></a><span class="lineno">15191</span>     <span class="keywordflow">return</span> gain;</div>
+<div class="line"><a name="l15192"></a><span class="lineno">15192</span> </div>
+<div class="line"><a name="l15193"></a><span class="lineno">15193</span> }</div>
+<div class="line"><a name="l15194"></a><span class="lineno">15194</span> </div>
+<div class="line"><a name="l15195"></a><span class="lineno">15195</span> </div>
+<div class="line"><a name="l15215"></a><span class="lineno"><a class="code" href="group__moses.html#ga3946bc30280b3b041a20ae9c9326f827">15215</a></span> cpl_table *<a class="code" href="group__moses.html#ga3946bc30280b3b041a20ae9c9326f827" title="Create slit location table from FITS header of VIMOS data.">mos_load_slits_vimos</a>(cpl_propertylist *header)</div>
+<div class="line"><a name="l15216"></a><span class="lineno">15216</span> {</div>
+<div class="line"><a name="l15217"></a><span class="lineno">15217</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_slits_vimos"</span>;</div>
+<div class="line"><a name="l15218"></a><span class="lineno">15218</span> </div>
+<div class="line"><a name="l15219"></a><span class="lineno">15219</span>     cpl_table *slits;</div>
+<div class="line"><a name="l15220"></a><span class="lineno">15220</span>     <span class="keywordtype">char</span>       keyname[MAX_COLNAME];</div>
+<div class="line"><a name="l15221"></a><span class="lineno">15221</span>     <span class="keywordtype">float</span>      slit_x;</div>
+<div class="line"><a name="l15222"></a><span class="lineno">15222</span>     <span class="keywordtype">float</span>      slit_y;</div>
+<div class="line"><a name="l15223"></a><span class="lineno">15223</span>     <span class="keywordtype">float</span>      dim_x;</div>
+<div class="line"><a name="l15224"></a><span class="lineno">15224</span>     <span class="keywordtype">float</span>      dim_y;</div>
+<div class="line"><a name="l15225"></a><span class="lineno">15225</span>     <span class="keywordtype">int</span>        nslits;</div>
+<div class="line"><a name="l15226"></a><span class="lineno">15226</span>     <span class="keywordtype">int</span>        slit_id;</div>
+<div class="line"><a name="l15227"></a><span class="lineno">15227</span>     <span class="keywordtype">int</span>        curved;</div>
+<div class="line"><a name="l15228"></a><span class="lineno">15228</span>     <span class="keywordtype">int</span>        i;</div>
+<div class="line"><a name="l15229"></a><span class="lineno">15229</span> </div>
+<div class="line"><a name="l15230"></a><span class="lineno">15230</span> </div>
+<div class="line"><a name="l15231"></a><span class="lineno">15231</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15232"></a><span class="lineno">15232</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15233"></a><span class="lineno">15233</span>     }</div>
+<div class="line"><a name="l15234"></a><span class="lineno">15234</span> </div>
+<div class="line"><a name="l15235"></a><span class="lineno">15235</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l15236"></a><span class="lineno">15236</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l15237"></a><span class="lineno">15237</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15238"></a><span class="lineno">15238</span>     }</div>
+<div class="line"><a name="l15239"></a><span class="lineno">15239</span> </div>
+<div class="line"><a name="l15240"></a><span class="lineno">15240</span>     nslits = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO INS SLIT NO"</span>);</div>
+<div class="line"><a name="l15241"></a><span class="lineno">15241</span> </div>
+<div class="line"><a name="l15242"></a><span class="lineno">15242</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15243"></a><span class="lineno">15243</span>         cpl_error_set_where(func);</div>
+<div class="line"><a name="l15244"></a><span class="lineno">15244</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15245"></a><span class="lineno">15245</span>     }</div>
+<div class="line"><a name="l15246"></a><span class="lineno">15246</span> </div>
+<div class="line"><a name="l15247"></a><span class="lineno">15247</span>     slits = cpl_table_new(nslits);</div>
+<div class="line"><a name="l15248"></a><span class="lineno">15248</span>     cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15249"></a><span class="lineno">15249</span>     cpl_table_new_column(slits, <span class="stringliteral">"xtop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15250"></a><span class="lineno">15250</span>     cpl_table_new_column(slits, <span class="stringliteral">"ytop"</span>,    CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15251"></a><span class="lineno">15251</span>     cpl_table_new_column(slits, <span class="stringliteral">"xbottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15252"></a><span class="lineno">15252</span>     cpl_table_new_column(slits, <span class="stringliteral">"ybottom"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15253"></a><span class="lineno">15253</span>     cpl_table_new_column(slits, <span class="stringliteral">"xwidth"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15254"></a><span class="lineno">15254</span>     cpl_table_new_column(slits, <span class="stringliteral">"ywidth"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15255"></a><span class="lineno">15255</span>     cpl_table_new_column(slits, <span class="stringliteral">"curved"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15256"></a><span class="lineno">15256</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xtop"</span>,    <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l15257"></a><span class="lineno">15257</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ytop"</span>,    <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l15258"></a><span class="lineno">15258</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xbottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l15259"></a><span class="lineno">15259</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ybottom"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l15260"></a><span class="lineno">15260</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"xwidth"</span>, <span class="stringliteral">"mm"</span>);</div>
+<div class="line"><a name="l15261"></a><span class="lineno">15261</span>     cpl_table_set_column_unit(slits, <span class="stringliteral">"ywidth"</span>, <span class="stringliteral">"mm"</span>);</div>
+<div class="line"><a name="l15262"></a><span class="lineno">15262</span> </div>
+<div class="line"><a name="l15263"></a><span class="lineno">15263</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l15264"></a><span class="lineno">15264</span>         sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d ID"</span>, i+1);</div>
+<div class="line"><a name="l15265"></a><span class="lineno">15265</span>         slit_id = cpl_propertylist_get_int(header, keyname);</div>
+<div class="line"><a name="l15266"></a><span class="lineno">15266</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15267"></a><span class="lineno">15267</span>             cpl_error_set_where(func);</div>
+<div class="line"><a name="l15268"></a><span class="lineno">15268</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15269"></a><span class="lineno">15269</span>         }</div>
+<div class="line"><a name="l15270"></a><span class="lineno">15270</span>         sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d X"</span>, i+1);</div>
+<div class="line"><a name="l15271"></a><span class="lineno">15271</span>         slit_x = cpl_propertylist_get_double(header, keyname);</div>
+<div class="line"><a name="l15272"></a><span class="lineno">15272</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15273"></a><span class="lineno">15273</span>             cpl_error_set_where(func);</div>
+<div class="line"><a name="l15274"></a><span class="lineno">15274</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15275"></a><span class="lineno">15275</span>         }</div>
+<div class="line"><a name="l15276"></a><span class="lineno">15276</span>         sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d Y"</span>, i+1);</div>
+<div class="line"><a name="l15277"></a><span class="lineno">15277</span>         slit_y = cpl_propertylist_get_double(header, keyname);</div>
+<div class="line"><a name="l15278"></a><span class="lineno">15278</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15279"></a><span class="lineno">15279</span>             cpl_error_set_where(func);</div>
+<div class="line"><a name="l15280"></a><span class="lineno">15280</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15281"></a><span class="lineno">15281</span>         }</div>
+<div class="line"><a name="l15282"></a><span class="lineno">15282</span>         sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d DIMX"</span>, i+1);</div>
+<div class="line"><a name="l15283"></a><span class="lineno">15283</span>         dim_x = cpl_propertylist_get_double(header, keyname);</div>
+<div class="line"><a name="l15284"></a><span class="lineno">15284</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15285"></a><span class="lineno">15285</span>             cpl_error_set_where(func);</div>
+<div class="line"><a name="l15286"></a><span class="lineno">15286</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15287"></a><span class="lineno">15287</span>         }</div>
+<div class="line"><a name="l15288"></a><span class="lineno">15288</span> </div>
+<div class="line"><a name="l15289"></a><span class="lineno">15289</span>         sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d BEZIER DY"</span>, i+1);</div>
+<div class="line"><a name="l15290"></a><span class="lineno">15290</span>         <span class="keywordflow">if</span> (cpl_propertylist_has(header, keyname)) {</div>
+<div class="line"><a name="l15291"></a><span class="lineno">15291</span>             curved = 1;</div>
+<div class="line"><a name="l15292"></a><span class="lineno">15292</span>         }</div>
+<div class="line"><a name="l15293"></a><span class="lineno">15293</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l15294"></a><span class="lineno">15294</span>             sprintf(keyname, <span class="stringliteral">"ESO INS SLIT%d DIMY"</span>, i+1);</div>
+<div class="line"><a name="l15295"></a><span class="lineno">15295</span>             curved = 0;</div>
+<div class="line"><a name="l15296"></a><span class="lineno">15296</span>         }</div>
+<div class="line"><a name="l15297"></a><span class="lineno">15297</span>         dim_y = cpl_propertylist_get_double(header, keyname);</div>
+<div class="line"><a name="l15298"></a><span class="lineno">15298</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15299"></a><span class="lineno">15299</span>             cpl_error_set_where(func);</div>
+<div class="line"><a name="l15300"></a><span class="lineno">15300</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15301"></a><span class="lineno">15301</span>         }</div>
+<div class="line"><a name="l15302"></a><span class="lineno">15302</span> </div>
+<div class="line"><a name="l15303"></a><span class="lineno">15303</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, i, slit_id);</div>
+<div class="line"><a name="l15304"></a><span class="lineno">15304</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>, i, slit_x - dim_x/2);</div>
+<div class="line"><a name="l15305"></a><span class="lineno">15305</span>         cpl_table_set(slits, <span class="stringliteral">"ytop"</span>, i, slit_y);</div>
+<div class="line"><a name="l15306"></a><span class="lineno">15306</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, i, slit_x + dim_x/2);</div>
+<div class="line"><a name="l15307"></a><span class="lineno">15307</span>         cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, i, slit_y);</div>
+<div class="line"><a name="l15308"></a><span class="lineno">15308</span>         cpl_table_set(slits, <span class="stringliteral">"xwidth"</span>, i, dim_x);</div>
+<div class="line"><a name="l15309"></a><span class="lineno">15309</span>         cpl_table_set(slits, <span class="stringliteral">"ywidth"</span>, i, dim_y);</div>
+<div class="line"><a name="l15310"></a><span class="lineno">15310</span>         cpl_table_set_int(slits, <span class="stringliteral">"curved"</span>, i, curved);</div>
+<div class="line"><a name="l15311"></a><span class="lineno">15311</span>     }</div>
+<div class="line"><a name="l15312"></a><span class="lineno">15312</span> </div>
+<div class="line"><a name="l15313"></a><span class="lineno">15313</span>     <span class="keywordflow">return</span> slits;</div>
+<div class="line"><a name="l15314"></a><span class="lineno">15314</span> }</div>
+<div class="line"><a name="l15315"></a><span class="lineno">15315</span> </div>
+<div class="line"><a name="l15316"></a><span class="lineno">15316</span> </div>
+<div class="line"><a name="l15326"></a><span class="lineno"><a class="code" href="group__moses.html#ga332b9bfd8e704446ad24d9fa448f9df2">15326</a></span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#ga332b9bfd8e704446ad24d9fa448f9df2" title="Determining whether a VIMOS mask has spectral multplexing or not.">mos_check_multiplex</a>(cpl_table *slits)</div>
+<div class="line"><a name="l15327"></a><span class="lineno">15327</span> {</div>
+<div class="line"><a name="l15328"></a><span class="lineno">15328</span>     cpl_propertylist *sort;</div>
+<div class="line"><a name="l15329"></a><span class="lineno">15329</span>     <span class="keywordtype">int</span>               nrow;</div>
+<div class="line"><a name="l15330"></a><span class="lineno">15330</span>     <span class="keywordtype">int</span>               i, multiplex, xprev, xcur;</div>
+<div class="line"><a name="l15331"></a><span class="lineno">15331</span>     <span class="keywordtype">double</span>            prev, cur;</div>
+<div class="line"><a name="l15332"></a><span class="lineno">15332</span>     <span class="keywordtype">double</span>            tolerance = 1.0; <span class="comment">// About spatially aligned slits (mm)</span></div>
+<div class="line"><a name="l15333"></a><span class="lineno">15333</span> </div>
+<div class="line"><a name="l15334"></a><span class="lineno">15334</span> </div>
+<div class="line"><a name="l15335"></a><span class="lineno">15335</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l15336"></a><span class="lineno">15336</span> <span class="comment">     * Create an auxiliary column containing a sort of integer</span></div>
+<div class="line"><a name="l15337"></a><span class="lineno">15337</span> <span class="comment">     * x coordinate of the slit, to guarantee that slits at the</span></div>
+<div class="line"><a name="l15338"></a><span class="lineno">15338</span> <span class="comment">     * same spatial offset are recognised immediately as in spectral </span></div>
+<div class="line"><a name="l15339"></a><span class="lineno">15339</span> <span class="comment">     * multiplexing.</span></div>
+<div class="line"><a name="l15340"></a><span class="lineno">15340</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l15341"></a><span class="lineno">15341</span> </div>
+<div class="line"><a name="l15342"></a><span class="lineno">15342</span>     sort = cpl_propertylist_new();</div>
+<div class="line"><a name="l15343"></a><span class="lineno">15343</span>     cpl_propertylist_append_bool(sort, <span class="stringliteral">"xtop"</span>, 0);</div>
+<div class="line"><a name="l15344"></a><span class="lineno">15344</span>     cpl_table_sort(slits, sort);</div>
+<div class="line"><a name="l15345"></a><span class="lineno">15345</span>     cpl_propertylist_delete(sort);</div>
+<div class="line"><a name="l15346"></a><span class="lineno">15346</span> </div>
+<div class="line"><a name="l15347"></a><span class="lineno">15347</span>     prev = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, 0, NULL);</div>
+<div class="line"><a name="l15348"></a><span class="lineno">15348</span>     cpl_table_new_column(slits, <span class="stringliteral">"xind"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15349"></a><span class="lineno">15349</span>     cpl_table_set_int(slits, <span class="stringliteral">"xind"</span>, 0, prev);   <span class="comment">// cast to int is intentional</span></div>
+<div class="line"><a name="l15350"></a><span class="lineno">15350</span>     nrow = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l15351"></a><span class="lineno">15351</span>     <span class="keywordflow">for</span> (i = 1; i < nrow; i++) {</div>
+<div class="line"><a name="l15352"></a><span class="lineno">15352</span>         cur = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>, i, NULL);</div>
+<div class="line"><a name="l15353"></a><span class="lineno">15353</span>         <span class="keywordflow">if</span> (fabs(prev - cur) > tolerance)</div>
+<div class="line"><a name="l15354"></a><span class="lineno">15354</span>             prev = cur;</div>
+<div class="line"><a name="l15355"></a><span class="lineno">15355</span>         cpl_table_set_int(slits, <span class="stringliteral">"xind"</span>, i, prev);</div>
+<div class="line"><a name="l15356"></a><span class="lineno">15356</span>     }</div>
+<div class="line"><a name="l15357"></a><span class="lineno">15357</span> </div>
+<div class="line"><a name="l15358"></a><span class="lineno">15358</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l15359"></a><span class="lineno">15359</span> <span class="comment">     * Now sort according to increasing (integer) x positions, and when</span></div>
+<div class="line"><a name="l15360"></a><span class="lineno">15360</span> <span class="comment">     * those are equal (multiplexed) according to the increasing y position.</span></div>
+<div class="line"><a name="l15361"></a><span class="lineno">15361</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l15362"></a><span class="lineno">15362</span> </div>
+<div class="line"><a name="l15363"></a><span class="lineno">15363</span>     sort = cpl_propertylist_new();</div>
+<div class="line"><a name="l15364"></a><span class="lineno">15364</span>     cpl_propertylist_append_bool(sort, <span class="stringliteral">"xind"</span>, 0);</div>
+<div class="line"><a name="l15365"></a><span class="lineno">15365</span>     cpl_propertylist_append_bool(sort, <span class="stringliteral">"ytop"</span>, 0);</div>
+<div class="line"><a name="l15366"></a><span class="lineno">15366</span>     cpl_table_sort(slits, sort);</div>
+<div class="line"><a name="l15367"></a><span class="lineno">15367</span>     cpl_propertylist_delete(sort);</div>
+<div class="line"><a name="l15368"></a><span class="lineno">15368</span> </div>
+<div class="line"><a name="l15369"></a><span class="lineno">15369</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l15370"></a><span class="lineno">15370</span> <span class="comment">     * Now assign to each slit its multiplex order.</span></div>
+<div class="line"><a name="l15371"></a><span class="lineno">15371</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l15372"></a><span class="lineno">15372</span> </div>
+<div class="line"><a name="l15373"></a><span class="lineno">15373</span>     multiplex = 0;</div>
+<div class="line"><a name="l15374"></a><span class="lineno">15374</span>     cpl_table_new_column(slits, <span class="stringliteral">"multiplex"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15375"></a><span class="lineno">15375</span>     xprev = cpl_table_get_int(slits, <span class="stringliteral">"xind"</span>, 0, NULL);</div>
+<div class="line"><a name="l15376"></a><span class="lineno">15376</span>     cpl_table_set_int(slits, <span class="stringliteral">"multiplex"</span>, 0, multiplex);</div>
+<div class="line"><a name="l15377"></a><span class="lineno">15377</span>     nrow = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l15378"></a><span class="lineno">15378</span>     <span class="keywordflow">for</span> (i = 1; i < nrow; i++) {</div>
+<div class="line"><a name="l15379"></a><span class="lineno">15379</span>         xcur = cpl_table_get_int(slits, <span class="stringliteral">"xind"</span>, i, NULL);</div>
+<div class="line"><a name="l15380"></a><span class="lineno">15380</span>         <span class="keywordflow">if</span> (xcur == xprev) {</div>
+<div class="line"><a name="l15381"></a><span class="lineno">15381</span>             multiplex++;</div>
+<div class="line"><a name="l15382"></a><span class="lineno">15382</span>         }</div>
+<div class="line"><a name="l15383"></a><span class="lineno">15383</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l15384"></a><span class="lineno">15384</span>             xprev = xcur;</div>
+<div class="line"><a name="l15385"></a><span class="lineno">15385</span>             multiplex = 0;</div>
+<div class="line"><a name="l15386"></a><span class="lineno">15386</span>         }</div>
+<div class="line"><a name="l15387"></a><span class="lineno">15387</span>         cpl_table_set_int(slits, <span class="stringliteral">"multiplex"</span>, i, multiplex);</div>
+<div class="line"><a name="l15388"></a><span class="lineno">15388</span>     }</div>
+<div class="line"><a name="l15389"></a><span class="lineno">15389</span> </div>
+<div class="line"><a name="l15390"></a><span class="lineno">15390</span>     cpl_table_save(slits, NULL, NULL, <span class="stringliteral">"multiplex.fits"</span>, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l15391"></a><span class="lineno">15391</span> </div>
+<div class="line"><a name="l15392"></a><span class="lineno">15392</span>     cpl_table_erase_column(slits, <span class="stringliteral">"xind"</span>);</div>
+<div class="line"><a name="l15393"></a><span class="lineno">15393</span> </div>
+<div class="line"><a name="l15394"></a><span class="lineno">15394</span>     <span class="keywordflow">return</span> 1 + cpl_table_get_column_max(slits, <span class="stringliteral">"multiplex"</span>);</div>
+<div class="line"><a name="l15395"></a><span class="lineno">15395</span> </div>
+<div class="line"><a name="l15396"></a><span class="lineno">15396</span> }</div>
+<div class="line"><a name="l15397"></a><span class="lineno">15397</span> </div>
+<div class="line"><a name="l15398"></a><span class="lineno">15398</span> </div>
+<div class="line"><a name="l15425"></a><span class="lineno"><a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464">15425</a></span> cpl_table *<a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(<span class="keyword">const</span> cpl_propertylist *header, </div>
+<div class="line"><a name="l15426"></a><span class="lineno">15426</span>                                     <span class="keywordtype">int</span> check_consistency)</div>
+<div class="line"><a name="l15427"></a><span class="lineno">15427</span> {</div>
+<div class="line"><a name="l15428"></a><span class="lineno">15428</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_overscans_vimos"</span>;</div>
+<div class="line"><a name="l15429"></a><span class="lineno">15429</span> </div>
+<div class="line"><a name="l15430"></a><span class="lineno">15430</span>     <span class="keywordtype">int</span>        nx = 0;</div>
+<div class="line"><a name="l15431"></a><span class="lineno">15431</span>     <span class="keywordtype">int</span>        ny = 0;</div>
+<div class="line"><a name="l15432"></a><span class="lineno">15432</span>     <span class="keywordtype">int</span>        px = 0;</div>
+<div class="line"><a name="l15433"></a><span class="lineno">15433</span>     <span class="keywordtype">int</span>        py = 0;</div>
+<div class="line"><a name="l15434"></a><span class="lineno">15434</span>     <span class="keywordtype">int</span>        ox = 0;</div>
+<div class="line"><a name="l15435"></a><span class="lineno">15435</span>     <span class="keywordtype">int</span>        oy = 0;</div>
+<div class="line"><a name="l15436"></a><span class="lineno">15436</span>     <span class="keywordtype">int</span>        vx = 0;</div>
+<div class="line"><a name="l15437"></a><span class="lineno">15437</span>     <span class="keywordtype">int</span>        vy = 0;</div>
+<div class="line"><a name="l15438"></a><span class="lineno">15438</span>     <span class="keywordtype">int</span>        nrows;</div>
+<div class="line"><a name="l15439"></a><span class="lineno">15439</span>     cpl_table *overscans;</div>
+<div class="line"><a name="l15440"></a><span class="lineno">15440</span> </div>
+<div class="line"><a name="l15441"></a><span class="lineno">15441</span> </div>
+<div class="line"><a name="l15442"></a><span class="lineno">15442</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15443"></a><span class="lineno">15443</span>         cpl_msg_error(func, <span class="stringliteral">"Reset your error: %s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l15444"></a><span class="lineno">15444</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15445"></a><span class="lineno">15445</span>     }</div>
+<div class="line"><a name="l15446"></a><span class="lineno">15446</span> </div>
+<div class="line"><a name="l15447"></a><span class="lineno">15447</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l15448"></a><span class="lineno">15448</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l15449"></a><span class="lineno">15449</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15450"></a><span class="lineno">15450</span>     }</div>
+<div class="line"><a name="l15451"></a><span class="lineno">15451</span> </div>
+<div class="line"><a name="l15452"></a><span class="lineno">15452</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"NAXIS1"</span>))</div>
+<div class="line"><a name="l15453"></a><span class="lineno">15453</span>         nx = cpl_propertylist_get_int(header, <span class="stringliteral">"NAXIS1"</span>);</div>
+<div class="line"><a name="l15454"></a><span class="lineno">15454</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"NAXIS2"</span>))</div>
+<div class="line"><a name="l15455"></a><span class="lineno">15455</span>         ny = cpl_propertylist_get_int(header, <span class="stringliteral">"NAXIS2"</span>);</div>
+<div class="line"><a name="l15456"></a><span class="lineno">15456</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>))</div>
+<div class="line"><a name="l15457"></a><span class="lineno">15457</span>         px = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>);</div>
+<div class="line"><a name="l15458"></a><span class="lineno">15458</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>))</div>
+<div class="line"><a name="l15459"></a><span class="lineno">15459</span>         py = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 PRSCY"</span>);</div>
+<div class="line"><a name="l15460"></a><span class="lineno">15460</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>))</div>
+<div class="line"><a name="l15461"></a><span class="lineno">15461</span>         ox = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 OVSCX"</span>);</div>
+<div class="line"><a name="l15462"></a><span class="lineno">15462</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>))</div>
+<div class="line"><a name="l15463"></a><span class="lineno">15463</span>         oy = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 OVSCY"</span>);</div>
+<div class="line"><a name="l15464"></a><span class="lineno">15464</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 NX"</span>))</div>
+<div class="line"><a name="l15465"></a><span class="lineno">15465</span>         vx = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 NX"</span>);</div>
+<div class="line"><a name="l15466"></a><span class="lineno">15466</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 NY"</span>))</div>
+<div class="line"><a name="l15467"></a><span class="lineno">15467</span>         vy = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUT1 NY"</span>);</div>
+<div class="line"><a name="l15468"></a><span class="lineno">15468</span> </div>
+<div class="line"><a name="l15469"></a><span class="lineno">15469</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15470"></a><span class="lineno">15470</span>         cpl_msg_error(func, <span class="stringliteral">"Missing overscan keywords in header"</span>);</div>
+<div class="line"><a name="l15471"></a><span class="lineno">15471</span>         cpl_error_set_where(func);</div>
+<div class="line"><a name="l15472"></a><span class="lineno">15472</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15473"></a><span class="lineno">15473</span>     }</div>
+<div class="line"><a name="l15474"></a><span class="lineno">15474</span> </div>
+<div class="line"><a name="l15475"></a><span class="lineno">15475</span>     <span class="keywordflow">if</span> (px < 0 || py < 0 || ox < 0 || oy < 0) {</div>
+<div class="line"><a name="l15476"></a><span class="lineno">15476</span>         cpl_msg_error(func, <span class="stringliteral">"Missing overscan keywords in header"</span>);</div>
+<div class="line"><a name="l15477"></a><span class="lineno">15477</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15478"></a><span class="lineno">15478</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15479"></a><span class="lineno">15479</span>     }</div>
+<div class="line"><a name="l15480"></a><span class="lineno">15480</span> </div>
+<div class="line"><a name="l15481"></a><span class="lineno">15481</span>     <span class="keywordflow">if</span> ((px + vx + ox != nx) || (py + vy + oy != ny)) {</div>
+<div class="line"><a name="l15482"></a><span class="lineno">15482</span>         <span class="keywordflow">if</span> (check_consistency) {</div>
+<div class="line"><a name="l15483"></a><span class="lineno">15483</span>             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15484"></a><span class="lineno">15484</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15485"></a><span class="lineno">15485</span>         }</div>
+<div class="line"><a name="l15486"></a><span class="lineno">15486</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l15487"></a><span class="lineno">15487</span>             cpl_msg_debug(func, <span class="stringliteral">"Overscans description conflicts with "</span></div>
+<div class="line"><a name="l15488"></a><span class="lineno">15488</span>                           <span class="stringliteral">"reported image sizes, "</span></div>
+<div class="line"><a name="l15489"></a><span class="lineno">15489</span>                           <span class="stringliteral">"%d + %d + %d != %d or "</span></div>
+<div class="line"><a name="l15490"></a><span class="lineno">15490</span>                           <span class="stringliteral">"%d + %d + %d != %d"</span>,</div>
+<div class="line"><a name="l15491"></a><span class="lineno">15491</span>                           px, vx, ox, nx,</div>
+<div class="line"><a name="l15492"></a><span class="lineno">15492</span>                           py, vy, oy, ny);</div>
+<div class="line"><a name="l15493"></a><span class="lineno">15493</span>         }</div>
+<div class="line"><a name="l15494"></a><span class="lineno">15494</span>     }</div>
+<div class="line"><a name="l15495"></a><span class="lineno">15495</span> </div>
+<div class="line"><a name="l15496"></a><span class="lineno">15496</span>     nrows = 0;</div>
+<div class="line"><a name="l15497"></a><span class="lineno">15497</span>     <span class="keywordflow">if</span> (px > 0)</div>
+<div class="line"><a name="l15498"></a><span class="lineno">15498</span>         nrows++;</div>
+<div class="line"><a name="l15499"></a><span class="lineno">15499</span>     <span class="keywordflow">if</span> (ox > 0)</div>
+<div class="line"><a name="l15500"></a><span class="lineno">15500</span>         nrows++;</div>
+<div class="line"><a name="l15501"></a><span class="lineno">15501</span>     <span class="keywordflow">if</span> (py > 0)</div>
+<div class="line"><a name="l15502"></a><span class="lineno">15502</span>         nrows++;</div>
+<div class="line"><a name="l15503"></a><span class="lineno">15503</span>     <span class="keywordflow">if</span> (oy > 0)</div>
+<div class="line"><a name="l15504"></a><span class="lineno">15504</span>         nrows++;</div>
+<div class="line"><a name="l15505"></a><span class="lineno">15505</span> </div>
+<div class="line"><a name="l15506"></a><span class="lineno">15506</span>     <span class="keywordflow">if</span> (nrows > 2) {</div>
+<div class="line"><a name="l15507"></a><span class="lineno">15507</span>         cpl_msg_error(func, <span class="stringliteral">"Unexpected overscan regions "</span></div>
+<div class="line"><a name="l15508"></a><span class="lineno">15508</span>                       <span class="stringliteral">"(both in X and Y direction)"</span>);</div>
+<div class="line"><a name="l15509"></a><span class="lineno">15509</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15510"></a><span class="lineno">15510</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15511"></a><span class="lineno">15511</span>     }</div>
+<div class="line"><a name="l15512"></a><span class="lineno">15512</span> </div>
+<div class="line"><a name="l15513"></a><span class="lineno">15513</span> </div>
+<div class="line"><a name="l15514"></a><span class="lineno">15514</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l15515"></a><span class="lineno">15515</span> <span class="comment">     * A row is added for the description of the valid region of the</span></div>
+<div class="line"><a name="l15516"></a><span class="lineno">15516</span> <span class="comment">     * exposure the input header belongs to.</span></div>
+<div class="line"><a name="l15517"></a><span class="lineno">15517</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l15518"></a><span class="lineno">15518</span> </div>
+<div class="line"><a name="l15519"></a><span class="lineno">15519</span>     nrows++;</div>
+<div class="line"><a name="l15520"></a><span class="lineno">15520</span> </div>
+<div class="line"><a name="l15521"></a><span class="lineno">15521</span>     overscans = cpl_table_new(nrows);</div>
+<div class="line"><a name="l15522"></a><span class="lineno">15522</span>     cpl_table_new_column(overscans, <span class="stringliteral">"xlow"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15523"></a><span class="lineno">15523</span>     cpl_table_new_column(overscans, <span class="stringliteral">"ylow"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15524"></a><span class="lineno">15524</span>     cpl_table_new_column(overscans, <span class="stringliteral">"xhig"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15525"></a><span class="lineno">15525</span>     cpl_table_new_column(overscans, <span class="stringliteral">"yhig"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15526"></a><span class="lineno">15526</span> </div>
+<div class="line"><a name="l15527"></a><span class="lineno">15527</span>     nrows = 0;</div>
+<div class="line"><a name="l15528"></a><span class="lineno">15528</span> </div>
+<div class="line"><a name="l15529"></a><span class="lineno">15529</span>     cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, px);</div>
+<div class="line"><a name="l15530"></a><span class="lineno">15530</span>     cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, py);</div>
+<div class="line"><a name="l15531"></a><span class="lineno">15531</span>     cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx - ox);</div>
+<div class="line"><a name="l15532"></a><span class="lineno">15532</span>     cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny - oy);</div>
+<div class="line"><a name="l15533"></a><span class="lineno">15533</span>     nrows++;</div>
+<div class="line"><a name="l15534"></a><span class="lineno">15534</span> </div>
+<div class="line"><a name="l15535"></a><span class="lineno">15535</span>     <span class="keywordflow">if</span> (px > 0) {</div>
+<div class="line"><a name="l15536"></a><span class="lineno">15536</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, 0);</div>
+<div class="line"><a name="l15537"></a><span class="lineno">15537</span>         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, 0);</div>
+<div class="line"><a name="l15538"></a><span class="lineno">15538</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, px);</div>
+<div class="line"><a name="l15539"></a><span class="lineno">15539</span>         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny);</div>
+<div class="line"><a name="l15540"></a><span class="lineno">15540</span>         nrows++;</div>
+<div class="line"><a name="l15541"></a><span class="lineno">15541</span>     }</div>
+<div class="line"><a name="l15542"></a><span class="lineno">15542</span> </div>
+<div class="line"><a name="l15543"></a><span class="lineno">15543</span>     <span class="keywordflow">if</span> (ox > 0) {</div>
+<div class="line"><a name="l15544"></a><span class="lineno">15544</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, nx - ox);</div>
+<div class="line"><a name="l15545"></a><span class="lineno">15545</span>         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, 0);</div>
+<div class="line"><a name="l15546"></a><span class="lineno">15546</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx);</div>
+<div class="line"><a name="l15547"></a><span class="lineno">15547</span>         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny);</div>
+<div class="line"><a name="l15548"></a><span class="lineno">15548</span>         nrows++;</div>
+<div class="line"><a name="l15549"></a><span class="lineno">15549</span>     }</div>
+<div class="line"><a name="l15550"></a><span class="lineno">15550</span> </div>
+<div class="line"><a name="l15551"></a><span class="lineno">15551</span>     <span class="keywordflow">if</span> (py > 0) {</div>
+<div class="line"><a name="l15552"></a><span class="lineno">15552</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, 0);</div>
+<div class="line"><a name="l15553"></a><span class="lineno">15553</span>         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, 0);</div>
+<div class="line"><a name="l15554"></a><span class="lineno">15554</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx);</div>
+<div class="line"><a name="l15555"></a><span class="lineno">15555</span>         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, py);</div>
+<div class="line"><a name="l15556"></a><span class="lineno">15556</span>         nrows++;</div>
+<div class="line"><a name="l15557"></a><span class="lineno">15557</span>     }</div>
+<div class="line"><a name="l15558"></a><span class="lineno">15558</span> </div>
+<div class="line"><a name="l15559"></a><span class="lineno">15559</span>     <span class="keywordflow">if</span> (oy > 0) {</div>
+<div class="line"><a name="l15560"></a><span class="lineno">15560</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, 0);</div>
+<div class="line"><a name="l15561"></a><span class="lineno">15561</span>         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, ny - oy);</div>
+<div class="line"><a name="l15562"></a><span class="lineno">15562</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx);</div>
+<div class="line"><a name="l15563"></a><span class="lineno">15563</span>         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny);</div>
+<div class="line"><a name="l15564"></a><span class="lineno">15564</span>         nrows++;</div>
+<div class="line"><a name="l15565"></a><span class="lineno">15565</span>     }</div>
+<div class="line"><a name="l15566"></a><span class="lineno">15566</span> </div>
+<div class="line"><a name="l15567"></a><span class="lineno">15567</span>     <span class="keywordflow">return</span> overscans;</div>
+<div class="line"><a name="l15568"></a><span class="lineno">15568</span> </div>
+<div class="line"><a name="l15569"></a><span class="lineno">15569</span> }</div>
+<div class="line"><a name="l15570"></a><span class="lineno">15570</span> </div>
+<div class="line"><a name="l15571"></a><span class="lineno">15571</span> </div>
+<div class="line"><a name="l15572"></a><span class="lineno">15572</span> cpl_table *mos_load_overscans_fors(<span class="keyword">const</span> cpl_propertylist *header)</div>
+<div class="line"><a name="l15573"></a><span class="lineno">15573</span> {</div>
+<div class="line"><a name="l15574"></a><span class="lineno">15574</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_load_overscans_fors"</span>;</div>
+<div class="line"><a name="l15575"></a><span class="lineno">15575</span> </div>
+<div class="line"><a name="l15576"></a><span class="lineno">15576</span>     <span class="keywordtype">int</span>        nports;</div>
+<div class="line"><a name="l15577"></a><span class="lineno">15577</span>     <span class="keywordtype">int</span>        nx = 0;</div>
+<div class="line"><a name="l15578"></a><span class="lineno">15578</span>     <span class="keywordtype">int</span>        ny = 0;</div>
+<div class="line"><a name="l15579"></a><span class="lineno">15579</span>     <span class="keywordtype">int</span>        px = 0;</div>
+<div class="line"><a name="l15580"></a><span class="lineno">15580</span>     <span class="keywordtype">int</span>        py = 0;</div>
+<div class="line"><a name="l15581"></a><span class="lineno">15581</span>     <span class="keywordtype">int</span>        ox = 0;</div>
+<div class="line"><a name="l15582"></a><span class="lineno">15582</span>     <span class="keywordtype">int</span>        oy = 0;</div>
+<div class="line"><a name="l15583"></a><span class="lineno">15583</span>     <span class="keywordtype">int</span>        rebin;</div>
+<div class="line"><a name="l15584"></a><span class="lineno">15584</span>     <span class="keywordtype">int</span>        nrows;</div>
+<div class="line"><a name="l15585"></a><span class="lineno">15585</span>     cpl_table *overscans;</div>
+<div class="line"><a name="l15586"></a><span class="lineno">15586</span> </div>
+<div class="line"><a name="l15587"></a><span class="lineno">15587</span> </div>
+<div class="line"><a name="l15588"></a><span class="lineno">15588</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l15589"></a><span class="lineno">15589</span>         cpl_msg_error(func, <span class="stringliteral">"Reset your error: %s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l15590"></a><span class="lineno">15590</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15591"></a><span class="lineno">15591</span>     }</div>
+<div class="line"><a name="l15592"></a><span class="lineno">15592</span> </div>
+<div class="line"><a name="l15593"></a><span class="lineno">15593</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l15594"></a><span class="lineno">15594</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l15595"></a><span class="lineno">15595</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15596"></a><span class="lineno">15596</span>     }</div>
+<div class="line"><a name="l15597"></a><span class="lineno">15597</span> </div>
+<div class="line"><a name="l15598"></a><span class="lineno">15598</span>     <span class="keywordflow">if</span> (cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUTPUTS"</span>))</div>
+<div class="line"><a name="l15599"></a><span class="lineno">15599</span>         nports = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET OUTPUTS"</span>);</div>
+<div class="line"><a name="l15600"></a><span class="lineno">15600</span> </div>
+<div class="line"><a name="l15601"></a><span class="lineno">15601</span>     <span class="keywordflow">if</span> (nports == 4                                        && </div>
+<div class="line"><a name="l15602"></a><span class="lineno">15602</span>         cpl_propertylist_has(header, <span class="stringliteral">"ESO DET OUT1 PRSCX"</span>) &&</div>
+<div class="line"><a name="l15603"></a><span class="lineno">15603</span>         cpl_propertylist_has(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>)) {</div>
+<div class="line"><a name="l15604"></a><span class="lineno">15604</span> </div>
+<div class="line"><a name="l15605"></a><span class="lineno">15605</span>         rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l15606"></a><span class="lineno">15606</span> </div>
+<div class="line"><a name="l15607"></a><span class="lineno">15607</span>         overscans = cpl_table_new(3);</div>
+<div class="line"><a name="l15608"></a><span class="lineno">15608</span>         cpl_table_new_column(overscans, <span class="stringliteral">"xlow"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15609"></a><span class="lineno">15609</span>         cpl_table_new_column(overscans, <span class="stringliteral">"ylow"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15610"></a><span class="lineno">15610</span>         cpl_table_new_column(overscans, <span class="stringliteral">"xhig"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15611"></a><span class="lineno">15611</span>         cpl_table_new_column(overscans, <span class="stringliteral">"yhig"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l15612"></a><span class="lineno">15612</span> </div>
+<div class="line"><a name="l15613"></a><span class="lineno">15613</span>         px = 16 / rebin;</div>
+<div class="line"><a name="l15614"></a><span class="lineno">15614</span>         ox = 16 / rebin;</div>
+<div class="line"><a name="l15615"></a><span class="lineno">15615</span>         nx = 2080 / rebin;</div>
+<div class="line"><a name="l15616"></a><span class="lineno">15616</span>         ny = 2048 / rebin;</div>
+<div class="line"><a name="l15617"></a><span class="lineno">15617</span>         nrows = 0;</div>
+<div class="line"><a name="l15618"></a><span class="lineno">15618</span> </div>
+<div class="line"><a name="l15619"></a><span class="lineno">15619</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, px);</div>
+<div class="line"><a name="l15620"></a><span class="lineno">15620</span>         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, py);</div>
+<div class="line"><a name="l15621"></a><span class="lineno">15621</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx - ox);</div>
+<div class="line"><a name="l15622"></a><span class="lineno">15622</span>         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny - oy);</div>
+<div class="line"><a name="l15623"></a><span class="lineno">15623</span>         nrows++;</div>
+<div class="line"><a name="l15624"></a><span class="lineno">15624</span> </div>
+<div class="line"><a name="l15625"></a><span class="lineno">15625</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, 0);</div>
+<div class="line"><a name="l15626"></a><span class="lineno">15626</span>         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, 0);</div>
+<div class="line"><a name="l15627"></a><span class="lineno">15627</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, px);</div>
+<div class="line"><a name="l15628"></a><span class="lineno">15628</span>         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny);</div>
+<div class="line"><a name="l15629"></a><span class="lineno">15629</span>         nrows++;</div>
+<div class="line"><a name="l15630"></a><span class="lineno">15630</span> </div>
+<div class="line"><a name="l15631"></a><span class="lineno">15631</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xlow"</span>, nrows, nx - ox);</div>
+<div class="line"><a name="l15632"></a><span class="lineno">15632</span>         cpl_table_set_int(overscans, <span class="stringliteral">"ylow"</span>, nrows, 0);</div>
+<div class="line"><a name="l15633"></a><span class="lineno">15633</span>         cpl_table_set_int(overscans, <span class="stringliteral">"xhig"</span>, nrows, nx);</div>
+<div class="line"><a name="l15634"></a><span class="lineno">15634</span>         cpl_table_set_int(overscans, <span class="stringliteral">"yhig"</span>, nrows, ny);</div>
+<div class="line"><a name="l15635"></a><span class="lineno">15635</span>         nrows++;</div>
+<div class="line"><a name="l15636"></a><span class="lineno">15636</span>     }</div>
+<div class="line"><a name="l15637"></a><span class="lineno">15637</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l15638"></a><span class="lineno">15638</span>         overscans = <a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(header, 0);</div>
+<div class="line"><a name="l15639"></a><span class="lineno">15639</span>     }</div>
+<div class="line"><a name="l15640"></a><span class="lineno">15640</span> </div>
+<div class="line"><a name="l15641"></a><span class="lineno">15641</span>     <span class="keywordflow">return</span> overscans;</div>
+<div class="line"><a name="l15642"></a><span class="lineno">15642</span> </div>
+<div class="line"><a name="l15643"></a><span class="lineno">15643</span> }</div>
+<div class="line"><a name="l15644"></a><span class="lineno">15644</span> </div>
+<div class="line"><a name="l15676"></a><span class="lineno"><a class="code" href="group__moses.html#gad1235d5ce36f7267285e82dccd428aa6">15676</a></span> <span class="preprocessor">#define READY 1</span></div>
+<div class="line"><a name="l15677"></a><span class="lineno">15677</span> <span class="preprocessor"></span><span class="preprocessor">#ifdef READY</span></div>
+<div class="line"><a name="l15678"></a><span class="lineno">15678</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l15679"></a><span class="lineno">15679</span> cpl_polynomial *mos_montecarlo_polyfit(cpl_table *points, cpl_table *evaluate, </div>
+<div class="line"><a name="l15680"></a><span class="lineno">15680</span>                                        <span class="keywordtype">int</span> samples, <span class="keywordtype">int</span> order)</div>
+<div class="line"><a name="l15681"></a><span class="lineno">15681</span> {</div>
+<div class="line"><a name="l15682"></a><span class="lineno">15682</span> </div>
+<div class="line"><a name="l15683"></a><span class="lineno">15683</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *func = <span class="stringliteral">"mos_montecarlo_polyfit"</span>;</div>
+<div class="line"><a name="l15684"></a><span class="lineno">15684</span> </div>
+<div class="line"><a name="l15685"></a><span class="lineno">15685</span>     cpl_polynomial *p;</div>
+<div class="line"><a name="l15686"></a><span class="lineno">15686</span>     cpl_polynomial *q;</div>
+<div class="line"><a name="l15687"></a><span class="lineno">15687</span>     cpl_vector     *listx;</div>
+<div class="line"><a name="l15688"></a><span class="lineno">15688</span>     cpl_vector     *listy;</div>
+<div class="line"><a name="l15689"></a><span class="lineno">15689</span>     <span class="keywordtype">double</span>          err;</div>
+<div class="line"><a name="l15690"></a><span class="lineno">15690</span>     <span class="keywordtype">double</span>         *x;</div>
+<div class="line"><a name="l15691"></a><span class="lineno">15691</span>     <span class="keywordtype">double</span>         *px;</div>
+<div class="line"><a name="l15692"></a><span class="lineno">15692</span>     <span class="keywordtype">double</span>         *x_eval;</div>
+<div class="line"><a name="l15693"></a><span class="lineno">15693</span>     <span class="keywordtype">double</span>         *px_eval;</div>
+<div class="line"><a name="l15694"></a><span class="lineno">15694</span>     <span class="keywordtype">double</span>         *sigma;</div>
+<div class="line"><a name="l15695"></a><span class="lineno">15695</span>     <span class="keywordtype">double</span>         *vy;</div>
+<div class="line"><a name="l15696"></a><span class="lineno">15696</span>     <span class="keywordtype">double</span>         *dy;</div>
+<div class="line"><a name="l15697"></a><span class="lineno">15697</span>     <span class="keywordtype">int</span>             npoints, nevaluate;</div>
+<div class="line"><a name="l15698"></a><span class="lineno">15698</span>     <span class="keywordtype">int</span>             i, j;</div>
+<div class="line"><a name="l15699"></a><span class="lineno">15699</span> </div>
+<div class="line"><a name="l15700"></a><span class="lineno">15700</span> </div>
+<div class="line"><a name="l15701"></a><span class="lineno">15701</span>     <span class="keywordflow">if</span> (points == NULL || evaluate == NULL) {</div>
+<div class="line"><a name="l15702"></a><span class="lineno">15702</span>         cpl_error_set(func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l15703"></a><span class="lineno">15703</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15704"></a><span class="lineno">15704</span>     }</div>
+<div class="line"><a name="l15705"></a><span class="lineno">15705</span> </div>
+<div class="line"><a name="l15706"></a><span class="lineno">15706</span>     <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"x"</span>)) {</div>
+<div class="line"><a name="l15707"></a><span class="lineno">15707</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l15708"></a><span class="lineno">15708</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15709"></a><span class="lineno">15709</span>     }</div>
+<div class="line"><a name="l15710"></a><span class="lineno">15710</span> </div>
+<div class="line"><a name="l15711"></a><span class="lineno">15711</span>     <span class="keywordflow">if</span> (cpl_table_get_column_type(points, <span class="stringliteral">"x"</span>) != CPL_TYPE_DOUBLE) {</div>
+<div class="line"><a name="l15712"></a><span class="lineno">15712</span>         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l15713"></a><span class="lineno">15713</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15714"></a><span class="lineno">15714</span>     }</div>
+<div class="line"><a name="l15715"></a><span class="lineno">15715</span> </div>
+<div class="line"><a name="l15716"></a><span class="lineno">15716</span>     <span class="keywordflow">if</span> (cpl_table_has_invalid(points, <span class="stringliteral">"x"</span>)) {</div>
+<div class="line"><a name="l15717"></a><span class="lineno">15717</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15718"></a><span class="lineno">15718</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15719"></a><span class="lineno">15719</span>     }</div>
+<div class="line"><a name="l15720"></a><span class="lineno">15720</span> </div>
+<div class="line"><a name="l15721"></a><span class="lineno">15721</span>     <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"y"</span>)) {</div>
+<div class="line"><a name="l15722"></a><span class="lineno">15722</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l15723"></a><span class="lineno">15723</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15724"></a><span class="lineno">15724</span>     }</div>
+<div class="line"><a name="l15725"></a><span class="lineno">15725</span> </div>
+<div class="line"><a name="l15726"></a><span class="lineno">15726</span>     <span class="keywordflow">if</span> (cpl_table_get_column_type(points, <span class="stringliteral">"y"</span>) != CPL_TYPE_DOUBLE) {</div>
+<div class="line"><a name="l15727"></a><span class="lineno">15727</span>         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l15728"></a><span class="lineno">15728</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15729"></a><span class="lineno">15729</span>     }</div>
+<div class="line"><a name="l15730"></a><span class="lineno">15730</span> </div>
+<div class="line"><a name="l15731"></a><span class="lineno">15731</span>     <span class="keywordflow">if</span> (cpl_table_has_invalid(points, <span class="stringliteral">"y"</span>)) {</div>
+<div class="line"><a name="l15732"></a><span class="lineno">15732</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15733"></a><span class="lineno">15733</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15734"></a><span class="lineno">15734</span>     }</div>
+<div class="line"><a name="l15735"></a><span class="lineno">15735</span> </div>
+<div class="line"><a name="l15736"></a><span class="lineno">15736</span>     <span class="keywordflow">if</span> (cpl_table_has_column(points, <span class="stringliteral">"y_err"</span>)) {</div>
+<div class="line"><a name="l15737"></a><span class="lineno">15737</span> </div>
+<div class="line"><a name="l15738"></a><span class="lineno">15738</span>         <span class="keywordflow">if</span> (cpl_table_get_column_type(points, <span class="stringliteral">"y_err"</span>) != CPL_TYPE_DOUBLE) {</div>
+<div class="line"><a name="l15739"></a><span class="lineno">15739</span>             cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l15740"></a><span class="lineno">15740</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15741"></a><span class="lineno">15741</span>         }</div>
+<div class="line"><a name="l15742"></a><span class="lineno">15742</span>     </div>
+<div class="line"><a name="l15743"></a><span class="lineno">15743</span>         <span class="keywordflow">if</span> (cpl_table_has_invalid(points, <span class="stringliteral">"y_err"</span>)) {</div>
+<div class="line"><a name="l15744"></a><span class="lineno">15744</span>             cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15745"></a><span class="lineno">15745</span>             <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15746"></a><span class="lineno">15746</span>         }</div>
+<div class="line"><a name="l15747"></a><span class="lineno">15747</span>     }</div>
+<div class="line"><a name="l15748"></a><span class="lineno">15748</span> </div>
+<div class="line"><a name="l15749"></a><span class="lineno">15749</span>     <span class="keywordflow">if</span> (!cpl_table_has_column(evaluate, <span class="stringliteral">"x"</span>)) {</div>
+<div class="line"><a name="l15750"></a><span class="lineno">15750</span>         cpl_error_set(func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l15751"></a><span class="lineno">15751</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15752"></a><span class="lineno">15752</span>     }</div>
+<div class="line"><a name="l15753"></a><span class="lineno">15753</span> </div>
+<div class="line"><a name="l15754"></a><span class="lineno">15754</span>     <span class="keywordflow">if</span> (cpl_table_get_column_type(evaluate, <span class="stringliteral">"x"</span>) != CPL_TYPE_DOUBLE) {</div>
+<div class="line"><a name="l15755"></a><span class="lineno">15755</span>         cpl_error_set(func, CPL_ERROR_INVALID_TYPE);</div>
+<div class="line"><a name="l15756"></a><span class="lineno">15756</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15757"></a><span class="lineno">15757</span>     }</div>
+<div class="line"><a name="l15758"></a><span class="lineno">15758</span> </div>
+<div class="line"><a name="l15759"></a><span class="lineno">15759</span>     <span class="keywordflow">if</span> (cpl_table_has_invalid(evaluate, <span class="stringliteral">"x"</span>)) {</div>
+<div class="line"><a name="l15760"></a><span class="lineno">15760</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15761"></a><span class="lineno">15761</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15762"></a><span class="lineno">15762</span>     }</div>
+<div class="line"><a name="l15763"></a><span class="lineno">15763</span> </div>
+<div class="line"><a name="l15764"></a><span class="lineno">15764</span>     <span class="keywordflow">if</span> (samples < 2 || order < 0) {</div>
+<div class="line"><a name="l15765"></a><span class="lineno">15765</span>         cpl_error_set(func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15766"></a><span class="lineno">15766</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l15767"></a><span class="lineno">15767</span>     }</div>
+<div class="line"><a name="l15768"></a><span class="lineno">15768</span> </div>
+<div class="line"><a name="l15769"></a><span class="lineno">15769</span>     npoints = cpl_table_get_nrow(points);</div>
+<div class="line"><a name="l15770"></a><span class="lineno">15770</span>     listx = cpl_vector_wrap(npoints, cpl_table_get_data_double(points, <span class="stringliteral">"x"</span>));</div>
+<div class="line"><a name="l15771"></a><span class="lineno">15771</span>     listy = cpl_vector_wrap(npoints, cpl_table_get_data_double(points, <span class="stringliteral">"y"</span>));</div>
+<div class="line"><a name="l15772"></a><span class="lineno">15772</span> </div>
+<div class="line"><a name="l15773"></a><span class="lineno">15773</span>     p = cpl_polynomial_fit_1d_create(listx, listy, order, &err);</div>
+<div class="line"><a name="l15774"></a><span class="lineno">15774</span> </div>
+<div class="line"><a name="l15775"></a><span class="lineno">15775</span>     <span class="keywordflow">if</span> (!cpl_table_has_column(points, <span class="stringliteral">"y_err"</span>)) {</div>
+<div class="line"><a name="l15776"></a><span class="lineno">15776</span>         err = sqrt(err);</div>
+<div class="line"><a name="l15777"></a><span class="lineno">15777</span>         cpl_table_new_column(points, <span class="stringliteral">"y_err"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15778"></a><span class="lineno">15778</span>         cpl_table_fill_column_window_double(points, <span class="stringliteral">"y_err"</span>, 0, npoints, err);</div>
+<div class="line"><a name="l15779"></a><span class="lineno">15779</span>         cpl_msg_info(func, <span class="stringliteral">"Error column not found - set to %f\n"</span>, err);</div>
+<div class="line"><a name="l15780"></a><span class="lineno">15780</span>     }</div>
+<div class="line"><a name="l15781"></a><span class="lineno">15781</span> </div>
+<div class="line"><a name="l15782"></a><span class="lineno">15782</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l15783"></a><span class="lineno">15783</span> <span class="comment">     * Create columns containing modeled values at each x</span></div>
+<div class="line"><a name="l15784"></a><span class="lineno">15784</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l15785"></a><span class="lineno">15785</span> </div>
+<div class="line"><a name="l15786"></a><span class="lineno">15786</span>     <span class="keywordflow">if</span> (cpl_table_has_column(points, <span class="stringliteral">"px"</span>))</div>
+<div class="line"><a name="l15787"></a><span class="lineno">15787</span>         cpl_table_erase_column(points, <span class="stringliteral">"px"</span>);</div>
+<div class="line"><a name="l15788"></a><span class="lineno">15788</span>     cpl_table_new_column(points, <span class="stringliteral">"px"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15789"></a><span class="lineno">15789</span>     cpl_table_fill_column_window_double(points, <span class="stringliteral">"px"</span>, 0, npoints, 0);</div>
+<div class="line"><a name="l15790"></a><span class="lineno">15790</span>     x = cpl_table_get_data_double(points, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l15791"></a><span class="lineno">15791</span>     px = cpl_table_get_data_double(points, <span class="stringliteral">"px"</span>);</div>
+<div class="line"><a name="l15792"></a><span class="lineno">15792</span>     <span class="keywordflow">for</span> (i = 0; i < npoints; i++)</div>
+<div class="line"><a name="l15793"></a><span class="lineno">15793</span>         px[i] = cpl_polynomial_eval_1d(p, x[i], NULL);</div>
+<div class="line"><a name="l15794"></a><span class="lineno">15794</span> </div>
+<div class="line"><a name="l15795"></a><span class="lineno">15795</span>     nevaluate = cpl_table_get_nrow(evaluate);</div>
+<div class="line"><a name="l15796"></a><span class="lineno">15796</span> </div>
+<div class="line"><a name="l15797"></a><span class="lineno">15797</span>     <span class="keywordflow">if</span> (cpl_table_has_column(evaluate, <span class="stringliteral">"px"</span>))</div>
+<div class="line"><a name="l15798"></a><span class="lineno">15798</span>         cpl_table_erase_column(evaluate, <span class="stringliteral">"px"</span>);</div>
+<div class="line"><a name="l15799"></a><span class="lineno">15799</span>     cpl_table_new_column(evaluate, <span class="stringliteral">"px"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15800"></a><span class="lineno">15800</span>     cpl_table_fill_column_window_double(evaluate, <span class="stringliteral">"px"</span>, 0, nevaluate, 0);</div>
+<div class="line"><a name="l15801"></a><span class="lineno">15801</span>     x_eval = cpl_table_get_data_double(evaluate, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l15802"></a><span class="lineno">15802</span>     px_eval = cpl_table_get_data_double(evaluate, <span class="stringliteral">"px"</span>);</div>
+<div class="line"><a name="l15803"></a><span class="lineno">15803</span>     <span class="keywordflow">for</span> (i = 0; i < nevaluate; i++)</div>
+<div class="line"><a name="l15804"></a><span class="lineno">15804</span>         px_eval[i] = cpl_polynomial_eval_1d(p, x_eval[i], NULL);</div>
+<div class="line"><a name="l15805"></a><span class="lineno">15805</span> </div>
+<div class="line"><a name="l15806"></a><span class="lineno">15806</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l15807"></a><span class="lineno">15807</span> <span class="comment">     * Initialise column with sigma</span></div>
+<div class="line"><a name="l15808"></a><span class="lineno">15808</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l15809"></a><span class="lineno">15809</span> </div>
+<div class="line"><a name="l15810"></a><span class="lineno">15810</span>     <span class="keywordflow">if</span> (cpl_table_has_column(evaluate, <span class="stringliteral">"sigma"</span>))</div>
+<div class="line"><a name="l15811"></a><span class="lineno">15811</span>         cpl_table_erase_column(evaluate, <span class="stringliteral">"sigma"</span>);</div>
+<div class="line"><a name="l15812"></a><span class="lineno">15812</span>     cpl_table_new_column(evaluate, <span class="stringliteral">"sigma"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15813"></a><span class="lineno">15813</span>     cpl_table_fill_column_window_double(evaluate, <span class="stringliteral">"sigma"</span>, 0, nevaluate, 0);</div>
+<div class="line"><a name="l15814"></a><span class="lineno">15814</span>     sigma = cpl_table_get_data_double(evaluate, <span class="stringliteral">"sigma"</span>);</div>
+<div class="line"><a name="l15815"></a><span class="lineno">15815</span> </div>
+<div class="line"><a name="l15816"></a><span class="lineno">15816</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l15817"></a><span class="lineno">15817</span> <span class="comment">     * Compute varied y cordinates to fit</span></div>
+<div class="line"><a name="l15818"></a><span class="lineno">15818</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l15819"></a><span class="lineno">15819</span> </div>
+<div class="line"><a name="l15820"></a><span class="lineno">15820</span>     <span class="keywordflow">if</span> (cpl_table_has_column(points, <span class="stringliteral">"vy"</span>))</div>
+<div class="line"><a name="l15821"></a><span class="lineno">15821</span>         cpl_table_erase_column(points, <span class="stringliteral">"vy"</span>);</div>
+<div class="line"><a name="l15822"></a><span class="lineno">15822</span>     cpl_table_new_column(points, <span class="stringliteral">"vy"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l15823"></a><span class="lineno">15823</span>     cpl_table_fill_column_window_double(points, <span class="stringliteral">"vy"</span>, 0, npoints, 0);</div>
+<div class="line"><a name="l15824"></a><span class="lineno">15824</span>     vy = cpl_table_get_data_double(points, <span class="stringliteral">"vy"</span>);</div>
+<div class="line"><a name="l15825"></a><span class="lineno">15825</span>     dy = cpl_table_get_data_double(points, <span class="stringliteral">"y_err"</span>);</div>
+<div class="line"><a name="l15826"></a><span class="lineno">15826</span>     cpl_vector_unwrap(listy);</div>
+<div class="line"><a name="l15827"></a><span class="lineno">15827</span>     listy = cpl_vector_wrap(npoints, vy);</div>
+<div class="line"><a name="l15828"></a><span class="lineno">15828</span> </div>
+<div class="line"><a name="l15829"></a><span class="lineno">15829</span>     <span class="keywordflow">for</span> (i = 0; i < samples; i++) {</div>
+<div class="line"><a name="l15830"></a><span class="lineno">15830</span>         <span class="keywordflow">for</span> (j = 0; j < npoints; j++)</div>
+<div class="line"><a name="l15831"></a><span class="lineno">15831</span>             vy[j] = px[j] + dy[j] * mos_randg(1);</div>
+<div class="line"><a name="l15832"></a><span class="lineno">15832</span>         q = cpl_polynomial_fit_1d_create(listx, listy, order, NULL);</div>
+<div class="line"><a name="l15833"></a><span class="lineno">15833</span>         <span class="keywordflow">for</span> (j = 0; j < nevaluate; j++)</div>
+<div class="line"><a name="l15834"></a><span class="lineno">15834</span>             sigma[j] += fabs(px_eval[j] </div>
+<div class="line"><a name="l15835"></a><span class="lineno">15835</span>                       - cpl_polynomial_eval_1d(q, x_eval[j], NULL));</div>
+<div class="line"><a name="l15836"></a><span class="lineno">15836</span>         cpl_polynomial_delete(q);</div>
+<div class="line"><a name="l15837"></a><span class="lineno">15837</span>     }</div>
+<div class="line"><a name="l15838"></a><span class="lineno">15838</span> </div>
+<div class="line"><a name="l15839"></a><span class="lineno">15839</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l15840"></a><span class="lineno">15840</span> <span class="comment">     * Factor 1.25 to convert average deviation to sigma </span></div>
+<div class="line"><a name="l15841"></a><span class="lineno">15841</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l15842"></a><span class="lineno">15842</span> </div>
+<div class="line"><a name="l15843"></a><span class="lineno">15843</span>     cpl_table_multiply_scalar(evaluate, <span class="stringliteral">"sigma"</span>, 1.25);</div>
+<div class="line"><a name="l15844"></a><span class="lineno">15844</span>     cpl_table_divide_scalar(evaluate, <span class="stringliteral">"sigma"</span>, samples);</div>
+<div class="line"><a name="l15845"></a><span class="lineno">15845</span> </div>
+<div class="line"><a name="l15846"></a><span class="lineno">15846</span>     cpl_vector_unwrap(listx);</div>
+<div class="line"><a name="l15847"></a><span class="lineno">15847</span>     cpl_vector_unwrap(listy);</div>
+<div class="line"><a name="l15848"></a><span class="lineno">15848</span> </div>
+<div class="line"><a name="l15849"></a><span class="lineno">15849</span>     <span class="keywordflow">return</span> p;</div>
+<div class="line"><a name="l15850"></a><span class="lineno">15850</span> }</div>
+<div class="line"><a name="l15851"></a><span class="lineno">15851</span> </div>
+<div class="line"><a name="l15852"></a><span class="lineno">15852</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l15853"></a><span class="lineno">15853</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l15876"></a><span class="lineno"><a class="code" href="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2">15876</a></span> cpl_error_code <a class="code" href="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2" title="Randomise image.">mos_randomise_image</a>(cpl_image *image, <span class="keywordtype">double</span> ron, </div>
+<div class="line"><a name="l15877"></a><span class="lineno">15877</span>                                    <span class="keywordtype">double</span> gain, <span class="keywordtype">double</span> bias)</div>
+<div class="line"><a name="l15878"></a><span class="lineno">15878</span> {</div>
+<div class="line"><a name="l15879"></a><span class="lineno">15879</span>     <span class="keywordtype">float</span> *data;</div>
+<div class="line"><a name="l15880"></a><span class="lineno">15880</span>     <span class="keywordtype">int</span>    npix, i;</div>
+<div class="line"><a name="l15881"></a><span class="lineno">15881</span> </div>
+<div class="line"><a name="l15882"></a><span class="lineno">15882</span> </div>
+<div class="line"><a name="l15883"></a><span class="lineno">15883</span>     <span class="keywordflow">if</span> (image == NULL)</div>
+<div class="line"><a name="l15884"></a><span class="lineno">15884</span>         <span class="keywordflow">return</span> cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l15885"></a><span class="lineno">15885</span> </div>
+<div class="line"><a name="l15886"></a><span class="lineno">15886</span>     <span class="keywordflow">if</span> (ron < 0.0 || gain <= FLT_EPSILON)</div>
+<div class="line"><a name="l15887"></a><span class="lineno">15887</span>         <span class="keywordflow">return</span> cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);</div>
+<div class="line"><a name="l15888"></a><span class="lineno">15888</span> </div>
+<div class="line"><a name="l15889"></a><span class="lineno">15889</span>     data = cpl_image_get_data_float(image);</div>
+<div class="line"><a name="l15890"></a><span class="lineno">15890</span>     npix = cpl_image_get_size_x(image) * cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l15891"></a><span class="lineno">15891</span>     ron *= ron;</div>
+<div class="line"><a name="l15892"></a><span class="lineno">15892</span> </div>
+<div class="line"><a name="l15893"></a><span class="lineno">15893</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l15894"></a><span class="lineno">15894</span>         <span class="keywordflow">if</span> (data[i] < bias) {</div>
+<div class="line"><a name="l15895"></a><span class="lineno">15895</span>             data[i] += sqrt(ron) * mos_randg(1);</div>
+<div class="line"><a name="l15896"></a><span class="lineno">15896</span>         }</div>
+<div class="line"><a name="l15897"></a><span class="lineno">15897</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l15898"></a><span class="lineno">15898</span>             data[i] += sqrt(ron + (data[i] - bias) / gain) * mos_randg(1);</div>
+<div class="line"><a name="l15899"></a><span class="lineno">15899</span>         }</div>
+<div class="line"><a name="l15900"></a><span class="lineno">15900</span>     }</div>
+<div class="line"><a name="l15901"></a><span class="lineno">15901</span> </div>
+<div class="line"><a name="l15902"></a><span class="lineno">15902</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l15903"></a><span class="lineno">15903</span> }</div>
+<div class="line"><a name="l15904"></a><span class="lineno">15904</span> </div>
+<div class="line"><a name="l15905"></a><span class="lineno">15905</span> </div>
+<div class="line"><a name="l15920"></a><span class="lineno"><a class="code" href="group__moses.html#gae623b8129e3fd33516f32d866c5106a8">15920</a></span> cpl_error_code <a class="code" href="group__moses.html#gae623b8129e3fd33516f32d866c5106a8" title="Reconstruct the gaps required for slit location.">mos_refmask_find_gaps</a>(cpl_mask  *refmask,</div>
+<div class="line"><a name="l15921"></a><span class="lineno">15921</span>                                      cpl_image *master_flat,</div>
+<div class="line"><a name="l15922"></a><span class="lineno">15922</span>                                      <span class="keywordtype">double</span>     level)</div>
+<div class="line"><a name="l15923"></a><span class="lineno">15923</span> {</div>
+<div class="line"><a name="l15924"></a><span class="lineno">15924</span>     <span class="keywordtype">int</span>          nx     = cpl_mask_get_size_x(refmask);</div>
+<div class="line"><a name="l15925"></a><span class="lineno">15925</span>     <span class="keywordtype">int</span>          ny     = cpl_mask_get_size_y(refmask);</div>
+<div class="line"><a name="l15926"></a><span class="lineno">15926</span> </div>
+<div class="line"><a name="l15927"></a><span class="lineno">15927</span>     <span class="keywordtype">int</span>        * xpos   = cpl_calloc(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>), ny);</div>
+<div class="line"><a name="l15928"></a><span class="lineno">15928</span> </div>
+<div class="line"><a name="l15929"></a><span class="lineno">15929</span>     cpl_image  * filtered = cpl_image_duplicate(master_flat);</div>
+<div class="line"><a name="l15930"></a><span class="lineno">15930</span>     cpl_mask   * kernel = cpl_mask_new(9, 3);</div>
+<div class="line"><a name="l15931"></a><span class="lineno">15931</span>     cpl_vector * v      = cpl_vector_new(ny);</div>
+<div class="line"><a name="l15932"></a><span class="lineno">15932</span>     cpl_vector * truev;</div>
+<div class="line"><a name="l15933"></a><span class="lineno">15933</span>     <span class="keywordtype">int</span>          nvalid = 0;</div>
+<div class="line"><a name="l15934"></a><span class="lineno">15934</span>     <span class="keywordtype">double</span>     * flats  = cpl_vector_get_data(v);</div>
+<div class="line"><a name="l15935"></a><span class="lineno">15935</span> </div>
+<div class="line"><a name="l15936"></a><span class="lineno">15936</span>     <span class="keywordtype">double</span>       median, stdev, delta;</div>
+<div class="line"><a name="l15937"></a><span class="lineno">15937</span> </div>
+<div class="line"><a name="l15938"></a><span class="lineno">15938</span>     <span class="keywordtype">int</span>          i, kill;</div>
+<div class="line"><a name="l15939"></a><span class="lineno">15939</span> </div>
+<div class="line"><a name="l15940"></a><span class="lineno">15940</span>     cpl_mask_not(kernel);</div>
+<div class="line"><a name="l15941"></a><span class="lineno">15941</span>     cpl_image_filter_mask(filtered, master_flat, kernel, </div>
+<div class="line"><a name="l15942"></a><span class="lineno">15942</span>                           CPL_FILTER_MEDIAN, CPL_BORDER_COPY);</div>
+<div class="line"><a name="l15943"></a><span class="lineno">15943</span>     cpl_mask_delete(kernel);</div>
+<div class="line"><a name="l15944"></a><span class="lineno">15944</span> </div>
+<div class="line"><a name="l15945"></a><span class="lineno">15945</span>     <span class="keywordflow">for</span> (i = 1; i <= ny; i++) {</div>
+<div class="line"><a name="l15946"></a><span class="lineno">15946</span>         <span class="keywordtype">int</span> j = 0;</div>
+<div class="line"><a name="l15947"></a><span class="lineno">15947</span> </div>
+<div class="line"><a name="l15948"></a><span class="lineno">15948</span>         <span class="keywordflow">do</span> j++;</div>
+<div class="line"><a name="l15949"></a><span class="lineno">15949</span>         <span class="keywordflow">while</span> (!cpl_mask_get(refmask, j, i) && j < nx);</div>
+<div class="line"><a name="l15950"></a><span class="lineno">15950</span> </div>
+<div class="line"><a name="l15951"></a><span class="lineno">15951</span>         <span class="keywordflow">if</span> (j < nx) {</div>
+<div class="line"><a name="l15952"></a><span class="lineno">15952</span>             <span class="keywordtype">int</span> rejected;</div>
+<div class="line"><a name="l15953"></a><span class="lineno">15953</span> </div>
+<div class="line"><a name="l15954"></a><span class="lineno">15954</span>             xpos[i - 1] = j;</div>
+<div class="line"><a name="l15955"></a><span class="lineno">15955</span>             flats[nvalid] = cpl_image_get(filtered, j, i, &rejected);</div>
+<div class="line"><a name="l15956"></a><span class="lineno">15956</span>             nvalid++;</div>
+<div class="line"><a name="l15957"></a><span class="lineno">15957</span>         }</div>
+<div class="line"><a name="l15958"></a><span class="lineno">15958</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l15959"></a><span class="lineno">15959</span>             xpos[i - 1] = -1;</div>
+<div class="line"><a name="l15960"></a><span class="lineno">15960</span>         }</div>
+<div class="line"><a name="l15961"></a><span class="lineno">15961</span>     }</div>
+<div class="line"><a name="l15962"></a><span class="lineno">15962</span> </div>
+<div class="line"><a name="l15963"></a><span class="lineno">15963</span>     <span class="keywordflow">if</span> (nvalid == 0)</div>
+<div class="line"><a name="l15964"></a><span class="lineno">15964</span>         <span class="keywordflow">return</span> cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l15965"></a><span class="lineno">15965</span> </div>
+<div class="line"><a name="l15966"></a><span class="lineno">15966</span>     truev = cpl_vector_wrap(nvalid, flats);</div>
+<div class="line"><a name="l15967"></a><span class="lineno">15967</span> </div>
+<div class="line"><a name="l15968"></a><span class="lineno">15968</span>     median = cpl_vector_get_median(truev);</div>
+<div class="line"><a name="l15969"></a><span class="lineno">15969</span> </div>
+<div class="line"><a name="l15970"></a><span class="lineno">15970</span>     <span class="keywordflow">if</span> (level < 0.0)</div>
+<div class="line"><a name="l15971"></a><span class="lineno">15971</span>        stdev = cpl_vector_get_stdev(truev);</div>
+<div class="line"><a name="l15972"></a><span class="lineno">15972</span> </div>
+<div class="line"><a name="l15973"></a><span class="lineno">15973</span>     cpl_vector_unwrap(truev);</div>
+<div class="line"><a name="l15974"></a><span class="lineno">15974</span>     cpl_vector_delete(v);</div>
+<div class="line"><a name="l15975"></a><span class="lineno">15975</span> </div>
+<div class="line"><a name="l15976"></a><span class="lineno">15976</span>     <span class="keywordflow">for</span> (i = 1; i <= ny; i++) {</div>
+<div class="line"><a name="l15977"></a><span class="lineno">15977</span>         <span class="keywordflow">if</span> (xpos[i - 1] > 0) {</div>
+<div class="line"><a name="l15978"></a><span class="lineno">15978</span>             <span class="keywordtype">int</span>    rejected;</div>
+<div class="line"><a name="l15979"></a><span class="lineno">15979</span>             <span class="keywordtype">double</span> kappa = 1.5;</div>
+<div class="line"><a name="l15980"></a><span class="lineno">15980</span> </div>
+<div class="line"><a name="l15981"></a><span class="lineno">15981</span>             delta = cpl_image_get(filtered, xpos[i - 1], i, &rejected) - median;</div>
+<div class="line"><a name="l15982"></a><span class="lineno">15982</span> </div>
+<div class="line"><a name="l15983"></a><span class="lineno">15983</span>             <span class="keywordflow">if</span> (level < 0.0)</div>
+<div class="line"><a name="l15984"></a><span class="lineno">15984</span>                 kill = fabs(delta) > stdev * kappa;</div>
+<div class="line"><a name="l15985"></a><span class="lineno">15985</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l15986"></a><span class="lineno">15986</span>                 kill = delta < level;</div>
+<div class="line"><a name="l15987"></a><span class="lineno">15987</span> </div>
+<div class="line"><a name="l15988"></a><span class="lineno">15988</span>             <span class="keywordflow">if</span> (kill) {</div>
+<div class="line"><a name="l15989"></a><span class="lineno">15989</span>                 <span class="keywordtype">int</span> j = 0;</div>
+<div class="line"><a name="l15990"></a><span class="lineno">15990</span>             </div>
+<div class="line"><a name="l15991"></a><span class="lineno">15991</span>                 <span class="keywordflow">while</span> (cpl_mask_get(refmask, xpos[i - 1] + j, i)) {</div>
+<div class="line"><a name="l15992"></a><span class="lineno">15992</span>                     cpl_mask_set(refmask, xpos[i - 1] + j, i, CPL_BINARY_0);</div>
+<div class="line"><a name="l15993"></a><span class="lineno">15993</span>                     j++;</div>
+<div class="line"><a name="l15994"></a><span class="lineno">15994</span>                 }</div>
+<div class="line"><a name="l15995"></a><span class="lineno">15995</span>             }</div>
+<div class="line"><a name="l15996"></a><span class="lineno">15996</span>         }</div>
+<div class="line"><a name="l15997"></a><span class="lineno">15997</span>     }</div>
+<div class="line"><a name="l15998"></a><span class="lineno">15998</span> </div>
+<div class="line"><a name="l15999"></a><span class="lineno">15999</span>     cpl_image_delete(filtered);</div>
+<div class="line"><a name="l16000"></a><span class="lineno">16000</span>     cpl_free(xpos);</div>
+<div class="line"><a name="l16001"></a><span class="lineno">16001</span> </div>
+<div class="line"><a name="l16002"></a><span class="lineno">16002</span>     <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l16003"></a><span class="lineno">16003</span> }</div>
+<div class="line"><a name="l16004"></a><span class="lineno">16004</span> </div>
+<div class="line"><a name="l16012"></a><span class="lineno"><a class="code" href="group__moses.html#ga854ead782f62a6929aade44b267353e0">16012</a></span> cpl_error_code <a class="code" href="group__moses.html#ga854ead782f62a6929aade44b267353e0" title="Process saturation.">mos_saturation_process</a>(cpl_image * image)</div>
+<div class="line"><a name="l16013"></a><span class="lineno">16013</span> {</div>
+<div class="line"><a name="l16014"></a><span class="lineno">16014</span>     <span class="keywordtype">int</span>     nx    = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l16015"></a><span class="lineno">16015</span>     <span class="keywordtype">int</span>     ny    = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l16016"></a><span class="lineno">16016</span>     <span class="keywordtype">int</span>     npix  = nx * ny;</div>
+<div class="line"><a name="l16017"></a><span class="lineno">16017</span>     <span class="keywordtype">float</span> * sdata = cpl_image_get_data_float(image);</div>
+<div class="line"><a name="l16018"></a><span class="lineno">16018</span> </div>
+<div class="line"><a name="l16019"></a><span class="lineno">16019</span>     <span class="keywordtype">int</span> count, i, j, k;</div>
+<div class="line"><a name="l16020"></a><span class="lineno">16020</span> </div>
+<div class="line"><a name="l16021"></a><span class="lineno">16021</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l16022"></a><span class="lineno">16022</span> <span class="comment">     * This is used to avoid saturation level coded with pixel value zero</span></div>
+<div class="line"><a name="l16023"></a><span class="lineno">16023</span> <span class="comment">     * To make it more robust against random 0.0 values, check that also</span></div>
+<div class="line"><a name="l16024"></a><span class="lineno">16024</span> <span class="comment">     * next pixel along the spatial direction is 0.0.</span></div>
+<div class="line"><a name="l16025"></a><span class="lineno">16025</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16026"></a><span class="lineno">16026</span> </div>
+<div class="line"><a name="l16027"></a><span class="lineno">16027</span>     <span class="keywordflow">for</span> (i = 0; i < npix - nx; i++)</div>
+<div class="line"><a name="l16028"></a><span class="lineno">16028</span>         <span class="keywordflow">if</span> (sdata[i] == 0.0 && sdata[i + nx] == 0.0)</div>
+<div class="line"><a name="l16029"></a><span class="lineno">16029</span>             sdata[i] = 65535.0;</div>
+<div class="line"><a name="l16030"></a><span class="lineno">16030</span> </div>
+<div class="line"><a name="l16031"></a><span class="lineno">16031</span>     <span class="keywordflow">for</span> (i = npix - nx; i < npix; i++)</div>
+<div class="line"><a name="l16032"></a><span class="lineno">16032</span>         <span class="keywordflow">if</span> (sdata[i] == 0.0) </div>
+<div class="line"><a name="l16033"></a><span class="lineno">16033</span>             sdata[i] = 65535.0;</div>
+<div class="line"><a name="l16034"></a><span class="lineno">16034</span> </div>
+<div class="line"><a name="l16035"></a><span class="lineno">16035</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l16036"></a><span class="lineno">16036</span> <span class="comment">     * This is a dirty trick to overcome saturations (making up a false</span></div>
+<div class="line"><a name="l16037"></a><span class="lineno">16037</span> <span class="comment">     * tip on their flat tops). This should be useless with a better</span></div>
+<div class="line"><a name="l16038"></a><span class="lineno">16038</span> <span class="comment">     * peak detection algorithm.</span></div>
+<div class="line"><a name="l16039"></a><span class="lineno">16039</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16040"></a><span class="lineno">16040</span> </div>
+<div class="line"><a name="l16041"></a><span class="lineno">16041</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l16042"></a><span class="lineno">16042</span>         <span class="keywordflow">if</span> (sdata[i] >= 65535.0) {</div>
+<div class="line"><a name="l16043"></a><span class="lineno">16043</span>             count = 0;</div>
+<div class="line"><a name="l16044"></a><span class="lineno">16044</span>             <span class="keywordflow">for</span> (j = i; j < npix; j++) {</div>
+<div class="line"><a name="l16045"></a><span class="lineno">16045</span>                 <span class="keywordflow">if</span> (sdata[j] < 65535.0) {</div>
+<div class="line"><a name="l16046"></a><span class="lineno">16046</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l16047"></a><span class="lineno">16047</span>                 }</div>
+<div class="line"><a name="l16048"></a><span class="lineno">16048</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l16049"></a><span class="lineno">16049</span>                     count++;</div>
+<div class="line"><a name="l16050"></a><span class="lineno">16050</span>                 }</div>
+<div class="line"><a name="l16051"></a><span class="lineno">16051</span>             }</div>
+<div class="line"><a name="l16052"></a><span class="lineno">16052</span>             <span class="keywordflow">if</span> (count < 30 && count > 2) {</div>
+<div class="line"><a name="l16053"></a><span class="lineno">16053</span>                 <span class="keywordflow">for</span> (j = i; j < i + count/2; j++)</div>
+<div class="line"><a name="l16054"></a><span class="lineno">16054</span>                     sdata[j] = sdata[i] + 1000.0 * (j - i);</div>
+<div class="line"><a name="l16055"></a><span class="lineno">16055</span>                 <span class="keywordflow">if</span> (count % 2 != 0) {</div>
+<div class="line"><a name="l16056"></a><span class="lineno">16056</span>                     sdata[j] = sdata[j-1] + 1000.0;</div>
+<div class="line"><a name="l16057"></a><span class="lineno">16057</span>                     j++;</div>
+<div class="line"><a name="l16058"></a><span class="lineno">16058</span>                 }</div>
+<div class="line"><a name="l16059"></a><span class="lineno">16059</span>                 <span class="keywordflow">for</span> (k = j; k <= i + count; k++)</div>
+<div class="line"><a name="l16060"></a><span class="lineno">16060</span>                     sdata[k] = sdata[i] - 1000.0 * (k - i - count);</div>
+<div class="line"><a name="l16061"></a><span class="lineno">16061</span>                 i = k;</div>
+<div class="line"><a name="l16062"></a><span class="lineno">16062</span>             }</div>
+<div class="line"><a name="l16063"></a><span class="lineno">16063</span>         }</div>
+<div class="line"><a name="l16064"></a><span class="lineno">16064</span>     }</div>
+<div class="line"><a name="l16065"></a><span class="lineno">16065</span> </div>
+<div class="line"><a name="l16066"></a><span class="lineno">16066</span>     <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l16067"></a><span class="lineno">16067</span> }</div>
+<div class="line"><a name="l16068"></a><span class="lineno">16068</span> </div>
+<div class="line"><a name="l16069"></a><span class="lineno">16069</span> </div>
+<div class="line"><a name="l16078"></a><span class="lineno"><a class="code" href="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0">16078</a></span> cpl_error_code <a class="code" href="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0" title="Subtract the background.">mos_subtract_background</a>(cpl_image * image)</div>
+<div class="line"><a name="l16079"></a><span class="lineno">16079</span> {</div>
+<div class="line"><a name="l16080"></a><span class="lineno">16080</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l16081"></a><span class="lineno">16081</span> <span class="comment">     * Create and subtract background</span></div>
+<div class="line"><a name="l16082"></a><span class="lineno">16082</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16083"></a><span class="lineno">16083</span> </div>
+<div class="line"><a name="l16084"></a><span class="lineno">16084</span>     cpl_image * bimage = <a class="code" href="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b" title="Background determination on emission line spectrum (arc)">mos_arc_background</a>(image, 15, 15);</div>
+<div class="line"><a name="l16085"></a><span class="lineno">16085</span>     cpl_image_subtract(image, bimage);</div>
+<div class="line"><a name="l16086"></a><span class="lineno">16086</span>     cpl_image_delete(bimage);</div>
+<div class="line"><a name="l16087"></a><span class="lineno">16087</span> </div>
+<div class="line"><a name="l16088"></a><span class="lineno">16088</span>     <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l16089"></a><span class="lineno">16089</span> }</div>
+<div class="line"><a name="l16090"></a><span class="lineno">16090</span> </div>
+<div class="line"><a name="l16091"></a><span class="lineno">16091</span> </div>
+<div class="line"><a name="l16108"></a><span class="lineno"><a class="code" href="group__moses.html#ga5f9947ec541f1291f7c9fb20bd081280">16108</a></span> cpl_error_code <a class="code" href="group__moses.html#ga5f9947ec541f1291f7c9fb20bd081280" title="Intersect a number of slit tables.">mos_object_intersect</a>(cpl_table **slitss, cpl_table *origslits, </div>
+<div class="line"><a name="l16109"></a><span class="lineno">16109</span>                                     <span class="keywordtype">int</span> nscience, <span class="keywordtype">float</span> tolerance)</div>
+<div class="line"><a name="l16110"></a><span class="lineno">16110</span> {</div>
+<div class="line"><a name="l16111"></a><span class="lineno">16111</span>     <span class="keywordtype">int</span> i, j;</div>
+<div class="line"><a name="l16112"></a><span class="lineno">16112</span> </div>
+<div class="line"><a name="l16113"></a><span class="lineno">16113</span>     cpl_table *summary;</div>
+<div class="line"><a name="l16114"></a><span class="lineno">16114</span>     <span class="keywordtype">int</span> summary_nobjs = 0;</div>
+<div class="line"><a name="l16115"></a><span class="lineno">16115</span>  </div>
+<div class="line"><a name="l16116"></a><span class="lineno">16116</span>     <span class="keywordtype">int</span> nobjs;</div>
+<div class="line"><a name="l16117"></a><span class="lineno">16117</span> </div>
+<div class="line"><a name="l16118"></a><span class="lineno">16118</span>     <span class="keywordtype">int</span> nmatches;</div>
+<div class="line"><a name="l16119"></a><span class="lineno">16119</span>     <span class="keywordtype">int</span> nslits = cpl_table_get_nrow(slitss[0]);</div>
+<div class="line"><a name="l16120"></a><span class="lineno">16120</span> </div>
+<div class="line"><a name="l16121"></a><span class="lineno">16121</span>     <span class="keywordtype">int</span> maxobjs;</div>
+<div class="line"><a name="l16122"></a><span class="lineno">16122</span>     <span class="keywordtype">int</span> k, m;</div>
+<div class="line"><a name="l16123"></a><span class="lineno">16123</span>     <span class="keywordtype">int</span> nstokes, sstokes;</div>
+<div class="line"><a name="l16124"></a><span class="lineno">16124</span> </div>
+<div class="line"><a name="l16125"></a><span class="lineno">16125</span>     cpl_table **work;</div>
+<div class="line"><a name="l16126"></a><span class="lineno">16126</span> </div>
+<div class="line"><a name="l16127"></a><span class="lineno">16127</span>     work = (cpl_table **)cpl_malloc(<span class="keyword">sizeof</span>(cpl_table *) * nscience);</div>
+<div class="line"><a name="l16128"></a><span class="lineno">16128</span> </div>
+<div class="line"><a name="l16129"></a><span class="lineno">16129</span> </div>
+<div class="line"><a name="l16130"></a><span class="lineno">16130</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l16131"></a><span class="lineno">16131</span> <span class="comment">     * First we build a table listing the offset of each detected</span></div>
+<div class="line"><a name="l16132"></a><span class="lineno">16132</span> <span class="comment">     * object at each angle and each beam, from the bottom of each </span></div>
+<div class="line"><a name="l16133"></a><span class="lineno">16133</span> <span class="comment">     * slit spectrum, and the pair that slit spectrum belongs to.</span></div>
+<div class="line"><a name="l16134"></a><span class="lineno">16134</span> <span class="comment">     * This summary table will have as many rows as objects found </span></div>
+<div class="line"><a name="l16135"></a><span class="lineno">16135</span> <span class="comment">     * in total at all angles.</span></div>
+<div class="line"><a name="l16136"></a><span class="lineno">16136</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16137"></a><span class="lineno">16137</span> </div>
+<div class="line"><a name="l16138"></a><span class="lineno">16138</span>     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {</div>
+<div class="line"><a name="l16139"></a><span class="lineno">16139</span>         <span class="keywordtype">int</span> c_nobjs = <a class="code" href="group__moses.html#gaf4d5e8a0d6cd0356ab38f0b7be241352" title="Get the total number of objects detected in a slits table.">mos_get_nobjects</a>(slitss[j]);</div>
+<div class="line"><a name="l16140"></a><span class="lineno">16140</span>         <span class="keywordflow">if</span> (!c_nobjs) </div>
+<div class="line"><a name="l16141"></a><span class="lineno">16141</span>             <span class="keywordflow">return</span> cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l16142"></a><span class="lineno">16142</span>         summary_nobjs += c_nobjs;</div>
+<div class="line"><a name="l16143"></a><span class="lineno">16143</span>     }</div>
+<div class="line"><a name="l16144"></a><span class="lineno">16144</span> </div>
+<div class="line"><a name="l16145"></a><span class="lineno">16145</span>     summary = cpl_table_new(summary_nobjs);</div>
+<div class="line"><a name="l16146"></a><span class="lineno">16146</span> </div>
+<div class="line"><a name="l16147"></a><span class="lineno">16147</span>     cpl_table_new_column(summary, <span class="stringliteral">"offset"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l16148"></a><span class="lineno">16148</span>     cpl_table_new_column(summary, <span class="stringliteral">"pair"</span>,   CPL_TYPE_INT);</div>
+<div class="line"><a name="l16149"></a><span class="lineno">16149</span>     cpl_table_new_column(summary, <span class="stringliteral">"absolute"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l16150"></a><span class="lineno">16150</span>     cpl_table_new_column(summary, <span class="stringliteral">"pos"</span>, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l16151"></a><span class="lineno">16151</span> </div>
+<div class="line"><a name="l16152"></a><span class="lineno">16152</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l16153"></a><span class="lineno">16153</span> <span class="comment">     * Fill the summary table with data from all objects:</span></div>
+<div class="line"><a name="l16154"></a><span class="lineno">16154</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16155"></a><span class="lineno">16155</span> </div>
+<div class="line"><a name="l16156"></a><span class="lineno">16156</span>     nobjs = 0;</div>
+<div class="line"><a name="l16157"></a><span class="lineno">16157</span> </div>
+<div class="line"><a name="l16158"></a><span class="lineno">16158</span>     <span class="comment">/* Loop on all object tables (one for each angle) */</span></div>
+<div class="line"><a name="l16159"></a><span class="lineno">16159</span>     <span class="keywordflow">for</span> (j = 0; j < nscience; j++) {</div>
+<div class="line"><a name="l16160"></a><span class="lineno">16160</span>         <span class="keywordtype">int</span> c_maxobjs = <a class="code" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac" title="Get the maximum possible number of objects in a slit.">mos_get_maxobjs_per_slit</a>(slitss[j]);</div>
+<div class="line"><a name="l16161"></a><span class="lineno">16161</span> </div>
+<div class="line"><a name="l16162"></a><span class="lineno">16162</span>         <span class="comment">/* Loop on all slits found on first - i.e., ALL - object table */</span></div>
+<div class="line"><a name="l16163"></a><span class="lineno">16163</span>         <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {</div>
+<div class="line"><a name="l16164"></a><span class="lineno">16164</span> </div>
+<div class="line"><a name="l16165"></a><span class="lineno">16165</span>             <span class="comment">/* Loop on all objects found on each object table */</span></div>
+<div class="line"><a name="l16166"></a><span class="lineno">16166</span>             <span class="keywordflow">for</span> (m = 0; m < c_maxobjs; m++) {</div>
+<div class="line"><a name="l16167"></a><span class="lineno">16167</span>                 <span class="keywordtype">int</span> null;</div>
+<div class="line"><a name="l16168"></a><span class="lineno">16168</span>                 <span class="keywordtype">char</span> *name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);</div>
+<div class="line"><a name="l16169"></a><span class="lineno">16169</span>                 <span class="keywordtype">double</span> obj = cpl_table_get_double(slitss[j], name, k, &null);</div>
+<div class="line"><a name="l16170"></a><span class="lineno">16170</span>                 <span class="keywordtype">int</span> pos;</div>
+<div class="line"><a name="l16171"></a><span class="lineno">16171</span>                 <span class="keywordtype">int</span> pair;</div>
+<div class="line"><a name="l16172"></a><span class="lineno">16172</span> </div>
+<div class="line"><a name="l16173"></a><span class="lineno">16173</span>                 cpl_free(name);</div>
+<div class="line"><a name="l16174"></a><span class="lineno">16174</span> </div>
+<div class="line"><a name="l16175"></a><span class="lineno">16175</span>                 <span class="keywordflow">if</span> (null) </div>
+<div class="line"><a name="l16176"></a><span class="lineno">16176</span>                     <span class="keywordflow">break</span>;  <span class="comment">/* No object #m+1 in this slit - go to next slit */</span></div>
+<div class="line"><a name="l16177"></a><span class="lineno">16177</span> </div>
+<div class="line"><a name="l16178"></a><span class="lineno">16178</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l16179"></a><span class="lineno">16179</span> <span class="comment">                 * Copy necessary object data to summary table. Note </span></div>
+<div class="line"><a name="l16180"></a><span class="lineno">16180</span> <span class="comment">                 * that the absolute object position (row) in the</span></div>
+<div class="line"><a name="l16181"></a><span class="lineno">16181</span> <span class="comment">                 * rectified image is made relative to the bottom</span></div>
+<div class="line"><a name="l16182"></a><span class="lineno">16182</span> <span class="comment">                 * position (row) of the current slit.</span></div>
+<div class="line"><a name="l16183"></a><span class="lineno">16183</span> <span class="comment">                 */</span> </div>
+<div class="line"><a name="l16184"></a><span class="lineno">16184</span>         </div>
+<div class="line"><a name="l16185"></a><span class="lineno">16185</span>                 pos  = cpl_table_get_int(slitss[j], <span class="stringliteral">"position"</span>, k, &null);</div>
+<div class="line"><a name="l16186"></a><span class="lineno">16186</span>                 pair = cpl_table_get_int(slitss[j], <span class="stringliteral">"pair_id"</span>, k, &null);</div>
+<div class="line"><a name="l16187"></a><span class="lineno">16187</span>                 cpl_table_set(summary, <span class="stringliteral">"absolute"</span>, nobjs, obj);</div>
+<div class="line"><a name="l16188"></a><span class="lineno">16188</span>                 cpl_table_set(summary, <span class="stringliteral">"pos"</span>, nobjs, pos);</div>
+<div class="line"><a name="l16189"></a><span class="lineno">16189</span>                 cpl_table_set(summary, <span class="stringliteral">"offset"</span>, nobjs, obj - pos);</div>
+<div class="line"><a name="l16190"></a><span class="lineno">16190</span>                 cpl_table_set(summary, <span class="stringliteral">"pair"</span>, nobjs, pair);</div>
+<div class="line"><a name="l16191"></a><span class="lineno">16191</span> </div>
+<div class="line"><a name="l16192"></a><span class="lineno">16192</span>                 nobjs++;</div>
+<div class="line"><a name="l16193"></a><span class="lineno">16193</span>             }</div>
+<div class="line"><a name="l16194"></a><span class="lineno">16194</span>         }</div>
+<div class="line"><a name="l16195"></a><span class="lineno">16195</span>     }</div>
+<div class="line"><a name="l16196"></a><span class="lineno">16196</span> </div>
+<div class="line"><a name="l16197"></a><span class="lineno">16197</span> <span class="comment">//    cpl_table_save(summary, NULL, NULL, "susu.fits", CPL_IO_DEFAULT);</span></div>
+<div class="line"><a name="l16198"></a><span class="lineno">16198</span> </div>
+<div class="line"><a name="l16199"></a><span class="lineno">16199</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l16200"></a><span class="lineno">16200</span> <span class="comment">     * Perform the intersection: what are the objects belonging</span></div>
+<div class="line"><a name="l16201"></a><span class="lineno">16201</span> <span class="comment">     * to the same slit (same pair ordinary + extraordinary) which </span></div>
+<div class="line"><a name="l16202"></a><span class="lineno">16202</span> <span class="comment">     * are observed at the same offset at all angles? Those are</span></div>
+<div class="line"><a name="l16203"></a><span class="lineno">16203</span> <span class="comment">     * the polarimetric objects.</span></div>
+<div class="line"><a name="l16204"></a><span class="lineno">16204</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16205"></a><span class="lineno">16205</span> </div>
+<div class="line"><a name="l16206"></a><span class="lineno">16206</span>     nmatches = 0;</div>
+<div class="line"><a name="l16207"></a><span class="lineno">16207</span>     maxobjs = <a class="code" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac" title="Get the maximum possible number of objects in a slit.">mos_get_maxobjs_per_slit</a>(slitss[0]);</div>
+<div class="line"><a name="l16208"></a><span class="lineno">16208</span> </div>
+<div class="line"><a name="l16209"></a><span class="lineno">16209</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l16210"></a><span class="lineno">16210</span> <span class="comment">     * We loop on the objects of the first-angle object table as </span></div>
+<div class="line"><a name="l16211"></a><span class="lineno">16211</span> <span class="comment">     * reference, and check whether those objects are present also</span></div>
+<div class="line"><a name="l16212"></a><span class="lineno">16212</span> <span class="comment">     * at *all* other angles. Note that the loop advances by pairs.</span></div>
+<div class="line"><a name="l16213"></a><span class="lineno">16213</span> <span class="comment">     * If the top (k = 0) slit spectrum is not an ordinary beam,</span></div>
+<div class="line"><a name="l16214"></a><span class="lineno">16214</span> <span class="comment">     * it is ignored. The loop advances by pairs, starting at the</span></div>
+<div class="line"><a name="l16215"></a><span class="lineno">16215</span> <span class="comment">     * first complete pair. It is implicitely assumed that the </span></div>
+<div class="line"><a name="l16216"></a><span class="lineno">16216</span> <span class="comment">     * slit spectrum on top is always from the ordinary beam, and </span></div>
+<div class="line"><a name="l16217"></a><span class="lineno">16217</span> <span class="comment">     * the spectrum below (k+1) its extraordinary match.</span></div>
+<div class="line"><a name="l16218"></a><span class="lineno">16218</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16219"></a><span class="lineno">16219</span> </div>
+<div class="line"><a name="l16220"></a><span class="lineno">16220</span>     <span class="keywordflow">for</span> (k = 0; k < nslits; k+=2) {</div>
+<div class="line"><a name="l16221"></a><span class="lineno">16221</span>         <span class="keywordtype">int</span> slitmatches = 0;</div>
+<div class="line"><a name="l16222"></a><span class="lineno">16222</span> </div>
+<div class="line"><a name="l16223"></a><span class="lineno">16223</span>         <span class="keywordflow">if</span> (k + 1 < nslits ) {</div>
+<div class="line"><a name="l16224"></a><span class="lineno">16224</span>             <span class="keywordflow">if</span> (cpl_table_get_int(slitss[0], <span class="stringliteral">"pair_id"</span>,  k, NULL) !=</div>
+<div class="line"><a name="l16225"></a><span class="lineno">16225</span>                 cpl_table_get_int(slitss[0], <span class="stringliteral">"pair_id"</span>,  k + 1, NULL)) {</div>
+<div class="line"><a name="l16226"></a><span class="lineno">16226</span> </div>
+<div class="line"><a name="l16227"></a><span class="lineno">16227</span>                 <span class="comment">/*</span></div>
+<div class="line"><a name="l16228"></a><span class="lineno">16228</span> <span class="comment">                 * This is not an ordinary beam - advance to next slit.</span></div>
+<div class="line"><a name="l16229"></a><span class="lineno">16229</span> <span class="comment">                 */</span></div>
+<div class="line"><a name="l16230"></a><span class="lineno">16230</span> </div>
+<div class="line"><a name="l16231"></a><span class="lineno">16231</span>                 <span class="comment">/* It will be incremented by two, so the effect is like k++ */</span></div>
+<div class="line"><a name="l16232"></a><span class="lineno">16232</span>                 k--;</div>
+<div class="line"><a name="l16233"></a><span class="lineno">16233</span> </div>
+<div class="line"><a name="l16234"></a><span class="lineno">16234</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l16235"></a><span class="lineno">16235</span>             }</div>
+<div class="line"><a name="l16236"></a><span class="lineno">16236</span>         }</div>
+<div class="line"><a name="l16237"></a><span class="lineno">16237</span> </div>
+<div class="line"><a name="l16238"></a><span class="lineno">16238</span>         <span class="keywordflow">for</span> (m = 0; m < maxobjs; m++) {</div>
+<div class="line"><a name="l16239"></a><span class="lineno">16239</span>             <span class="keywordtype">int</span> null;</div>
+<div class="line"><a name="l16240"></a><span class="lineno">16240</span>             <span class="keywordtype">char</span> *name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);</div>
+<div class="line"><a name="l16241"></a><span class="lineno">16241</span>             <span class="keywordtype">double</span> obj = cpl_table_get_double(slitss[0], name, k, &null);</div>
+<div class="line"><a name="l16242"></a><span class="lineno">16242</span>             <span class="keywordtype">double</span> pos;</div>
+<div class="line"><a name="l16243"></a><span class="lineno">16243</span>             <span class="keywordtype">int</span> pair;</div>
+<div class="line"><a name="l16244"></a><span class="lineno">16244</span> </div>
+<div class="line"><a name="l16245"></a><span class="lineno">16245</span>             <span class="keywordtype">char</span> *name_obj = NULL;</div>
+<div class="line"><a name="l16246"></a><span class="lineno">16246</span>             <span class="keywordtype">char</span> *name_start = NULL;</div>
+<div class="line"><a name="l16247"></a><span class="lineno">16247</span>             <span class="keywordtype">char</span> *name_end = NULL;</div>
+<div class="line"><a name="l16248"></a><span class="lineno">16248</span>             <span class="keywordtype">char</span> *name_row = NULL;</div>
+<div class="line"><a name="l16249"></a><span class="lineno">16249</span>             <span class="keywordtype">char</span> *name_row_s = NULL;</div>
+<div class="line"><a name="l16250"></a><span class="lineno">16250</span> </div>
+<div class="line"><a name="l16251"></a><span class="lineno">16251</span>             <span class="keywordtype">char</span> *name_start_o = NULL;</div>
+<div class="line"><a name="l16252"></a><span class="lineno">16252</span>             <span class="keywordtype">char</span> *name_end_o = NULL;</div>
+<div class="line"><a name="l16253"></a><span class="lineno">16253</span>             <span class="keywordtype">char</span> *name_row_o = NULL;</div>
+<div class="line"><a name="l16254"></a><span class="lineno">16254</span>             <span class="keywordtype">char</span> *name_start_v = NULL;</div>
+<div class="line"><a name="l16255"></a><span class="lineno">16255</span>             <span class="keywordtype">char</span> *name_end_v = NULL;</div>
+<div class="line"><a name="l16256"></a><span class="lineno">16256</span>             <span class="keywordtype">char</span> *name_obj_v = NULL;</div>
+<div class="line"><a name="l16257"></a><span class="lineno">16257</span> </div>
+<div class="line"><a name="l16258"></a><span class="lineno">16258</span>             <span class="keywordtype">int</span> start, end;</div>
+<div class="line"><a name="l16259"></a><span class="lineno">16259</span>             <span class="keywordtype">int</span> length;</div>
+<div class="line"><a name="l16260"></a><span class="lineno">16260</span>  </div>
+<div class="line"><a name="l16261"></a><span class="lineno">16261</span>             <span class="keywordtype">int</span> selected;</div>
+<div class="line"><a name="l16262"></a><span class="lineno">16262</span>             <span class="keywordtype">int</span> v, start_v, end_v;</div>
+<div class="line"><a name="l16263"></a><span class="lineno">16263</span>             <span class="keywordtype">double</span> min_v, obj_v;</div>
+<div class="line"><a name="l16264"></a><span class="lineno">16264</span> </div>
+<div class="line"><a name="l16265"></a><span class="lineno">16265</span> </div>
+<div class="line"><a name="l16266"></a><span class="lineno">16266</span>             cpl_free(name);</div>
+<div class="line"><a name="l16267"></a><span class="lineno">16267</span> </div>
+<div class="line"><a name="l16268"></a><span class="lineno">16268</span>             <span class="keywordflow">if</span> (null) </div>
+<div class="line"><a name="l16269"></a><span class="lineno">16269</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l16270"></a><span class="lineno">16270</span> </div>
+<div class="line"><a name="l16271"></a><span class="lineno">16271</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16272"></a><span class="lineno">16272</span> <span class="comment">             * Each object of the first object table belongs to a</span></div>
+<div class="line"><a name="l16273"></a><span class="lineno">16273</span> <span class="comment">             * slit spectrum (k). This slit spectrum has a position</span></div>
+<div class="line"><a name="l16274"></a><span class="lineno">16274</span> <span class="comment">             * in the rectified image, and it belongs to a given </span></div>
+<div class="line"><a name="l16275"></a><span class="lineno">16275</span> <span class="comment">             * ordinary + extraordinary pair.</span></div>
+<div class="line"><a name="l16276"></a><span class="lineno">16276</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16277"></a><span class="lineno">16277</span>      </div>
+<div class="line"><a name="l16278"></a><span class="lineno">16278</span>             pos  = cpl_table_get_int(slitss[0], <span class="stringliteral">"position"</span>, k, &null);</div>
+<div class="line"><a name="l16279"></a><span class="lineno">16279</span>             pair = cpl_table_get_int(slitss[0], <span class="stringliteral">"pair_id"</span>,  k, &null);</div>
+<div class="line"><a name="l16280"></a><span class="lineno">16280</span> </div>
+<div class="line"><a name="l16281"></a><span class="lineno">16281</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16282"></a><span class="lineno">16282</span> <span class="comment">             * Now from the summary table we can select all objects</span></div>
+<div class="line"><a name="l16283"></a><span class="lineno">16283</span> <span class="comment">             * which have the same offset (obj - pos) within all slit</span></div>
+<div class="line"><a name="l16284"></a><span class="lineno">16284</span> <span class="comment">             * spectra belonging to the same ordinary + extraordinary </span></div>
+<div class="line"><a name="l16285"></a><span class="lineno">16285</span> <span class="comment">             * pair (at all angles).</span></div>
+<div class="line"><a name="l16286"></a><span class="lineno">16286</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16287"></a><span class="lineno">16287</span> </div>
+<div class="line"><a name="l16288"></a><span class="lineno">16288</span>             cpl_table_select_all(summary);  <span class="comment">/* Reset selection */</span></div>
+<div class="line"><a name="l16289"></a><span class="lineno">16289</span> </div>
+<div class="line"><a name="l16290"></a><span class="lineno">16290</span>             cpl_table_and_selected_int(summary, <span class="stringliteral">"pair"</span>, CPL_EQUAL_TO, pair);</div>
+<div class="line"><a name="l16291"></a><span class="lineno">16291</span>             cpl_table_and_selected_double(summary, <span class="stringliteral">"offset"</span>, CPL_LESS_THAN,</div>
+<div class="line"><a name="l16292"></a><span class="lineno">16292</span>                                           obj - pos + tolerance);</div>
+<div class="line"><a name="l16293"></a><span class="lineno">16293</span>             selected = </div>
+<div class="line"><a name="l16294"></a><span class="lineno">16294</span>             cpl_table_and_selected_double(summary, <span class="stringliteral">"offset"</span>, CPL_GREATER_THAN,</div>
+<div class="line"><a name="l16295"></a><span class="lineno">16295</span>                                           obj - pos - tolerance);</div>
+<div class="line"><a name="l16296"></a><span class="lineno">16296</span> </div>
+<div class="line"><a name="l16297"></a><span class="lineno">16297</span> </div>
+<div class="line"><a name="l16298"></a><span class="lineno">16298</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16299"></a><span class="lineno">16299</span> <span class="comment">             * If this object were observed at all angles (nscience) and </span></div>
+<div class="line"><a name="l16300"></a><span class="lineno">16300</span> <span class="comment">             * at all beams (2), we should have selected exactly 2*nscience</span></div>
+<div class="line"><a name="l16301"></a><span class="lineno">16301</span> <span class="comment">             * objects. If not, this is not a polarimetric object, and it</span></div>
+<div class="line"><a name="l16302"></a><span class="lineno">16302</span> <span class="comment">             * is discarded from the intersection.</span></div>
+<div class="line"><a name="l16303"></a><span class="lineno">16303</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16304"></a><span class="lineno">16304</span>             </div>
+<div class="line"><a name="l16305"></a><span class="lineno">16305</span>             <span class="keywordflow">if</span> (selected != nscience * 2) </div>
+<div class="line"><a name="l16306"></a><span class="lineno">16306</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l16307"></a><span class="lineno">16307</span> </div>
+<div class="line"><a name="l16308"></a><span class="lineno">16308</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16309"></a><span class="lineno">16309</span> <span class="comment">             * If we reach this point we have found one valid polarimetric</span></div>
+<div class="line"><a name="l16310"></a><span class="lineno">16310</span> <span class="comment">             * object, that must be inserted in the intersection object</span></div>
+<div class="line"><a name="l16311"></a><span class="lineno">16311</span> <span class="comment">             * table.</span></div>
+<div class="line"><a name="l16312"></a><span class="lineno">16312</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16313"></a><span class="lineno">16313</span>  </div>
+<div class="line"><a name="l16314"></a><span class="lineno">16314</span>             slitmatches++;</div>
+<div class="line"><a name="l16315"></a><span class="lineno">16315</span> </div>
+<div class="line"><a name="l16316"></a><span class="lineno">16316</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16317"></a><span class="lineno">16317</span> <span class="comment">             * Names of the columns of the output table where the</span></div>
+<div class="line"><a name="l16318"></a><span class="lineno">16318</span> <span class="comment">             * object information needs to be copied. Note that a</span></div>
+<div class="line"><a name="l16319"></a><span class="lineno">16319</span> <span class="comment">             * new column is created, the "row_stokes_#", where the</span></div>
+<div class="line"><a name="l16320"></a><span class="lineno">16320</span> <span class="comment">             * row number of the extracted polarimetric signal is</span></div>
+<div class="line"><a name="l16321"></a><span class="lineno">16321</span> <span class="comment">             * also computed. For the moment this column will be </span></div>
+<div class="line"><a name="l16322"></a><span class="lineno">16322</span> <span class="comment">             * left empty - it will be filled only when all matches </span></div>
+<div class="line"><a name="l16323"></a><span class="lineno">16323</span> <span class="comment">             * are collected.</span></div>
+<div class="line"><a name="l16324"></a><span class="lineno">16324</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16325"></a><span class="lineno">16325</span> </div>
+<div class="line"><a name="l16326"></a><span class="lineno">16326</span>             name_obj   = cpl_sprintf(<span class="stringliteral">"object_%d"</span>,     slitmatches);</div>
+<div class="line"><a name="l16327"></a><span class="lineno">16327</span>             name_start = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,      slitmatches);</div>
+<div class="line"><a name="l16328"></a><span class="lineno">16328</span>             name_end   = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,        slitmatches);</div>
+<div class="line"><a name="l16329"></a><span class="lineno">16329</span>             name_row   = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,        slitmatches);</div>
+<div class="line"><a name="l16330"></a><span class="lineno">16330</span>             name_row_s = cpl_sprintf(<span class="stringliteral">"row_stokes_%d"</span>, slitmatches);</div>
+<div class="line"><a name="l16331"></a><span class="lineno">16331</span> </div>
+<div class="line"><a name="l16332"></a><span class="lineno">16332</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16333"></a><span class="lineno">16333</span> <span class="comment">             * Names of the columns of the input table where the</span></div>
+<div class="line"><a name="l16334"></a><span class="lineno">16334</span> <span class="comment">             * object information is available.</span></div>
+<div class="line"><a name="l16335"></a><span class="lineno">16335</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16336"></a><span class="lineno">16336</span> </div>
+<div class="line"><a name="l16337"></a><span class="lineno">16337</span>             name_start_o = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,  m + 1);</div>
+<div class="line"><a name="l16338"></a><span class="lineno">16338</span>             name_end_o   = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,    m + 1);</div>
+<div class="line"><a name="l16339"></a><span class="lineno">16339</span>             name_row_o   = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,    m + 1);</div>
+<div class="line"><a name="l16340"></a><span class="lineno">16340</span> </div>
+<div class="line"><a name="l16341"></a><span class="lineno">16341</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16342"></a><span class="lineno">16342</span> <span class="comment">             * If the output columns do not exist yet, create them.</span></div>
+<div class="line"><a name="l16343"></a><span class="lineno">16343</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16344"></a><span class="lineno">16344</span>  </div>
+<div class="line"><a name="l16345"></a><span class="lineno">16345</span>             <span class="keywordflow">if</span> (!cpl_table_has_column(origslits, name_obj)) {</div>
+<div class="line"><a name="l16346"></a><span class="lineno">16346</span>                 cpl_table_new_column(origslits, name_obj, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l16347"></a><span class="lineno">16347</span>                 cpl_table_new_column(origslits, name_start, CPL_TYPE_INT);</div>
+<div class="line"><a name="l16348"></a><span class="lineno">16348</span>                 cpl_table_new_column(origslits, name_end,   CPL_TYPE_INT);</div>
+<div class="line"><a name="l16349"></a><span class="lineno">16349</span>                 cpl_table_new_column(origslits, name_row,   CPL_TYPE_INT);</div>
+<div class="line"><a name="l16350"></a><span class="lineno">16350</span>                 cpl_table_new_column(origslits, name_row_s, CPL_TYPE_INT);</div>
+<div class="line"><a name="l16351"></a><span class="lineno">16351</span>             }</div>
+<div class="line"><a name="l16352"></a><span class="lineno">16352</span> </div>
+<div class="line"><a name="l16353"></a><span class="lineno">16353</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16354"></a><span class="lineno">16354</span> <span class="comment">             * The current slit spectrum is k. The slit spectrum immediately</span></div>
+<div class="line"><a name="l16355"></a><span class="lineno">16355</span> <span class="comment">             * below (in the rectified image) is k+1. We need the length of</span></div>
+<div class="line"><a name="l16356"></a><span class="lineno">16356</span> <span class="comment">             * the spectrum below for computing the _absolute_ coordinates</span></div>
+<div class="line"><a name="l16357"></a><span class="lineno">16357</span> <span class="comment">             * of the objects in the rectified image in both beams.</span></div>
+<div class="line"><a name="l16358"></a><span class="lineno">16358</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16359"></a><span class="lineno">16359</span>  </div>
+<div class="line"><a name="l16360"></a><span class="lineno">16360</span>             length = cpl_table_get_int(origslits, <span class="stringliteral">"length"</span>, k + 1, &null);</div>
+<div class="line"><a name="l16361"></a><span class="lineno">16361</span> </div>
+<div class="line"><a name="l16362"></a><span class="lineno">16362</span>             <span class="comment">/* NEW:</span></div>
+<div class="line"><a name="l16363"></a><span class="lineno">16363</span> <span class="comment">             * Names of the columns of the input table where</span></div>
+<div class="line"><a name="l16364"></a><span class="lineno">16364</span> <span class="comment">             * the information of the corresponding object of </span></div>
+<div class="line"><a name="l16365"></a><span class="lineno">16365</span> <span class="comment">             * the next beam is available.</span></div>
+<div class="line"><a name="l16366"></a><span class="lineno">16366</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16367"></a><span class="lineno">16367</span> </div>
+<div class="line"><a name="l16368"></a><span class="lineno">16368</span>             <span class="keywordflow">for</span> (v = 0; v < maxobjs; v++) {</div>
+<div class="line"><a name="l16369"></a><span class="lineno">16369</span>                 <span class="keywordtype">char</span> *name_v = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, v + 1);</div>
+<div class="line"><a name="l16370"></a><span class="lineno">16370</span>                 <span class="keywordtype">double</span> obj_v = cpl_table_get_double(slitss[0], name_v, </div>
+<div class="line"><a name="l16371"></a><span class="lineno">16371</span>                                                     k + 1, &null);</div>
+<div class="line"><a name="l16372"></a><span class="lineno">16372</span> </div>
+<div class="line"><a name="l16373"></a><span class="lineno">16373</span>                 cpl_free(name_v);</div>
+<div class="line"><a name="l16374"></a><span class="lineno">16374</span> </div>
+<div class="line"><a name="l16375"></a><span class="lineno">16375</span>                 <span class="keywordflow">if</span> (null) </div>
+<div class="line"><a name="l16376"></a><span class="lineno">16376</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l16377"></a><span class="lineno">16377</span> </div>
+<div class="line"><a name="l16378"></a><span class="lineno">16378</span>                 <span class="keywordflow">if</span> (v) {</div>
+<div class="line"><a name="l16379"></a><span class="lineno">16379</span>                     <span class="keywordflow">if</span> (fabs(obj - length - obj_v) < min_v) {</div>
+<div class="line"><a name="l16380"></a><span class="lineno">16380</span>                         min_v = fabs(obj - length - obj_v);</div>
+<div class="line"><a name="l16381"></a><span class="lineno">16381</span>                         cpl_free(name_start_v);</div>
+<div class="line"><a name="l16382"></a><span class="lineno">16382</span>                         cpl_free(name_end_v);</div>
+<div class="line"><a name="l16383"></a><span class="lineno">16383</span>                         cpl_free(name_obj_v);</div>
+<div class="line"><a name="l16384"></a><span class="lineno">16384</span>                         name_start_v = cpl_sprintf(<span class="stringliteral">"start_%d"</span>, v + 1);</div>
+<div class="line"><a name="l16385"></a><span class="lineno">16385</span>                         name_end_v   = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,   v + 1);</div>
+<div class="line"><a name="l16386"></a><span class="lineno">16386</span>                         name_obj_v   = cpl_sprintf(<span class="stringliteral">"object_%d"</span>,   v + 1);</div>
+<div class="line"><a name="l16387"></a><span class="lineno">16387</span>                     }</div>
+<div class="line"><a name="l16388"></a><span class="lineno">16388</span>                 }</div>
+<div class="line"><a name="l16389"></a><span class="lineno">16389</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l16390"></a><span class="lineno">16390</span>                     min_v = fabs(obj - length - obj_v);</div>
+<div class="line"><a name="l16391"></a><span class="lineno">16391</span>                     name_start_v = cpl_sprintf(<span class="stringliteral">"start_%d"</span>, v + 1);</div>
+<div class="line"><a name="l16392"></a><span class="lineno">16392</span>                     name_end_v   = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,   v + 1);</div>
+<div class="line"><a name="l16393"></a><span class="lineno">16393</span>                     name_obj_v   = cpl_sprintf(<span class="stringliteral">"object_%d"</span>,   v + 1);</div>
+<div class="line"><a name="l16394"></a><span class="lineno">16394</span>                 }</div>
+<div class="line"><a name="l16395"></a><span class="lineno">16395</span>             }</div>
+<div class="line"><a name="l16396"></a><span class="lineno">16396</span> </div>
+<div class="line"><a name="l16397"></a><span class="lineno">16397</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16398"></a><span class="lineno">16398</span> <span class="comment">             * Read from the first input object table (first angle)</span></div>
+<div class="line"><a name="l16399"></a><span class="lineno">16399</span> <span class="comment">             * the spatial window enclosing the object.</span></div>
+<div class="line"><a name="l16400"></a><span class="lineno">16400</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16401"></a><span class="lineno">16401</span> </div>
+<div class="line"><a name="l16402"></a><span class="lineno">16402</span>             start = cpl_table_get_int(slitss[0], name_start_o, k, &null);</div>
+<div class="line"><a name="l16403"></a><span class="lineno">16403</span>             end   = cpl_table_get_int(slitss[0], name_end_o,   k, &null);</div>
+<div class="line"><a name="l16404"></a><span class="lineno">16404</span> </div>
+<div class="line"><a name="l16405"></a><span class="lineno">16405</span>             <span class="comment">/* NEW:</span></div>
+<div class="line"><a name="l16406"></a><span class="lineno">16406</span> <span class="comment">             * Spatial window of the matching object in the next beam.</span></div>
+<div class="line"><a name="l16407"></a><span class="lineno">16407</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16408"></a><span class="lineno">16408</span> </div>
+<div class="line"><a name="l16409"></a><span class="lineno">16409</span>             start_v = cpl_table_get_int(slitss[0], name_start_v,  k + 1, &null);</div>
+<div class="line"><a name="l16410"></a><span class="lineno">16410</span>             end_v   = cpl_table_get_int(slitss[0], name_end_v,    k + 1, &null);</div>
+<div class="line"><a name="l16411"></a><span class="lineno">16411</span>             obj_v   = cpl_table_get_double(slitss[0], name_obj_v, k + 1, &null);</div>
+<div class="line"><a name="l16412"></a><span class="lineno">16412</span> </div>
+<div class="line"><a name="l16413"></a><span class="lineno">16413</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16414"></a><span class="lineno">16414</span> <span class="comment">             * Write the object coordinates in the same slit, and in the</span></div>
+<div class="line"><a name="l16415"></a><span class="lineno">16415</span> <span class="comment">             * slit below. Note that here we assume that all slits were</span></div>
+<div class="line"><a name="l16416"></a><span class="lineno">16416</span> <span class="comment">             * traced perfectly, and we compute the theoretical coords</span></div>
+<div class="line"><a name="l16417"></a><span class="lineno">16417</span> <span class="comment">             * (obj - length) within the next slit spectrum (k + 1). In</span></div>
+<div class="line"><a name="l16418"></a><span class="lineno">16418</span> <span class="comment">             * principle we should read them as well from the input</span></div>
+<div class="line"><a name="l16419"></a><span class="lineno">16419</span> <span class="comment">             * table!</span></div>
+<div class="line"><a name="l16420"></a><span class="lineno">16420</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16421"></a><span class="lineno">16421</span> </div>
+<div class="line"><a name="l16422"></a><span class="lineno">16422</span>             cpl_table_set_double(origslits, name_obj,   k,     obj);</div>
+<div class="line"><a name="l16423"></a><span class="lineno">16423</span>             cpl_table_set_double(origslits, name_obj,   k + 1, obj_v);</div>
+<div class="line"><a name="l16424"></a><span class="lineno">16424</span>          <span class="comment">// cpl_table_set_double(origslits, name_obj,   k + 1, obj - length);</span></div>
+<div class="line"><a name="l16425"></a><span class="lineno">16425</span> </div>
+<div class="line"><a name="l16426"></a><span class="lineno">16426</span>             cpl_table_set_int(origslits,    name_start, k,     start);</div>
+<div class="line"><a name="l16427"></a><span class="lineno">16427</span>             cpl_table_set_int(origslits,    name_start, k + 1, start_v);</div>
+<div class="line"><a name="l16428"></a><span class="lineno">16428</span>          <span class="comment">// cpl_table_set_int(origslits,    name_start, k + 1, start - length);</span></div>
+<div class="line"><a name="l16429"></a><span class="lineno">16429</span> </div>
+<div class="line"><a name="l16430"></a><span class="lineno">16430</span>             cpl_table_set_int(origslits,    name_end,   k,     end);</div>
+<div class="line"><a name="l16431"></a><span class="lineno">16431</span>             cpl_table_set_int(origslits,    name_end,   k + 1, end_v);</div>
+<div class="line"><a name="l16432"></a><span class="lineno">16432</span>          <span class="comment">// cpl_table_set_int(origslits,    name_end,   k + 1, end - length);</span></div>
+<div class="line"><a name="l16433"></a><span class="lineno">16433</span> </div>
+<div class="line"><a name="l16434"></a><span class="lineno">16434</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l16435"></a><span class="lineno">16435</span> <span class="comment">             * "nmatches" is counting at what "reduced" image row the</span></div>
+<div class="line"><a name="l16436"></a><span class="lineno">16436</span> <span class="comment">             * extracted spectra are. Note that this is s preliminary</span></div>
+<div class="line"><a name="l16437"></a><span class="lineno">16437</span> <span class="comment">             * numbering - which is wrong: other objects may be found</span></div>
+<div class="line"><a name="l16438"></a><span class="lineno">16438</span> <span class="comment">             * in the same slit, and then the indeces would not be in</span></div>
+<div class="line"><a name="l16439"></a><span class="lineno">16439</span> <span class="comment">             * sequence. What is important is that at the end of this</span></div>
+<div class="line"><a name="l16440"></a><span class="lineno">16440</span> <span class="comment">             * loop "nmatches" would be the total number of matching </span></div>
+<div class="line"><a name="l16441"></a><span class="lineno">16441</span> <span class="comment">             * objects. The two cpl_table_set_int() calls made here</span></div>
+<div class="line"><a name="l16442"></a><span class="lineno">16442</span> <span class="comment">             * cannot be removed - they "validate" those table elements</span></div>
+<div class="line"><a name="l16443"></a><span class="lineno">16443</span> <span class="comment">             * (see ahead). </span></div>
+<div class="line"><a name="l16444"></a><span class="lineno">16444</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16445"></a><span class="lineno">16445</span> </div>
+<div class="line"><a name="l16446"></a><span class="lineno">16446</span>             cpl_table_set_int(origslits,    name_row,   k,     nmatches);</div>
+<div class="line"><a name="l16447"></a><span class="lineno">16447</span>             nmatches++;</div>
+<div class="line"><a name="l16448"></a><span class="lineno">16448</span>             cpl_table_set_int(origslits,    name_row,   k + 1, nmatches);</div>
+<div class="line"><a name="l16449"></a><span class="lineno">16449</span>             nmatches++;</div>
+<div class="line"><a name="l16450"></a><span class="lineno">16450</span> </div>
+<div class="line"><a name="l16451"></a><span class="lineno">16451</span>             cpl_free(name_obj);</div>
+<div class="line"><a name="l16452"></a><span class="lineno">16452</span>             cpl_free(name_start);</div>
+<div class="line"><a name="l16453"></a><span class="lineno">16453</span>             cpl_free(name_end);</div>
+<div class="line"><a name="l16454"></a><span class="lineno">16454</span>             cpl_free(name_row);</div>
+<div class="line"><a name="l16455"></a><span class="lineno">16455</span>             cpl_free(name_row_s);</div>
+<div class="line"><a name="l16456"></a><span class="lineno">16456</span> </div>
+<div class="line"><a name="l16457"></a><span class="lineno">16457</span>             cpl_free(name_start_o);</div>
+<div class="line"><a name="l16458"></a><span class="lineno">16458</span>             cpl_free(name_end_o);</div>
+<div class="line"><a name="l16459"></a><span class="lineno">16459</span>             cpl_free(name_row_o);</div>
+<div class="line"><a name="l16460"></a><span class="lineno">16460</span> </div>
+<div class="line"><a name="l16461"></a><span class="lineno">16461</span>             cpl_free(name_start_v); name_start_v = NULL;</div>
+<div class="line"><a name="l16462"></a><span class="lineno">16462</span>             cpl_free(name_end_v); name_end_v = NULL;</div>
+<div class="line"><a name="l16463"></a><span class="lineno">16463</span>             cpl_free(name_obj_v); name_obj_v = NULL;</div>
+<div class="line"><a name="l16464"></a><span class="lineno">16464</span>         }</div>
+<div class="line"><a name="l16465"></a><span class="lineno">16465</span>     }</div>
+<div class="line"><a name="l16466"></a><span class="lineno">16466</span> </div>
+<div class="line"><a name="l16467"></a><span class="lineno">16467</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l16468"></a><span class="lineno">16468</span> <span class="comment">     * The summary table has fulfilled its function. If no matching </span></div>
+<div class="line"><a name="l16469"></a><span class="lineno">16469</span> <span class="comment">     * objects are found, the function returns with an error.</span></div>
+<div class="line"><a name="l16470"></a><span class="lineno">16470</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16471"></a><span class="lineno">16471</span> </div>
+<div class="line"><a name="l16472"></a><span class="lineno">16472</span>     cpl_table_delete(summary);</div>
+<div class="line"><a name="l16473"></a><span class="lineno">16473</span> </div>
+<div class="line"><a name="l16474"></a><span class="lineno">16474</span>     <span class="keywordflow">if</span> (!nmatches)</div>
+<div class="line"><a name="l16475"></a><span class="lineno">16475</span>         <span class="keywordflow">return</span> cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND); </div>
+<div class="line"><a name="l16476"></a><span class="lineno">16476</span> </div>
+<div class="line"><a name="l16477"></a><span class="lineno">16477</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l16478"></a><span class="lineno">16478</span> <span class="comment">     * Now we consider the resulting intersection object table,</span></div>
+<div class="line"><a name="l16479"></a><span class="lineno">16479</span> <span class="comment">     * listing all matches. As seen, the image row number reported</span></div>
+<div class="line"><a name="l16480"></a><span class="lineno">16480</span> <span class="comment">     * in the columns "row_#" was not really performed sequentially.</span></div>
+<div class="line"><a name="l16481"></a><span class="lineno">16481</span> <span class="comment">     * We need to renumber sequentially...</span></div>
+<div class="line"><a name="l16482"></a><span class="lineno">16482</span> <span class="comment">     * We need also to fill the "row_stokes_#" column the way the</span></div>
+<div class="line"><a name="l16483"></a><span class="lineno">16483</span> <span class="comment">     * extracted polarimetric signal will be stored in the </span></div>
+<div class="line"><a name="l16484"></a><span class="lineno">16484</span> <span class="comment">     * reduced_pol_images...</span></div>
+<div class="line"><a name="l16485"></a><span class="lineno">16485</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16486"></a><span class="lineno">16486</span>  </div>
+<div class="line"><a name="l16487"></a><span class="lineno">16487</span>     maxobjs = <a class="code" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac" title="Get the maximum possible number of objects in a slit.">mos_get_maxobjs_per_slit</a>(origslits);</div>
+<div class="line"><a name="l16488"></a><span class="lineno">16488</span>     nstokes = nmatches / 2;         <span class="comment">/* nmatches is always an even number     */</span></div>
+<div class="line"><a name="l16489"></a><span class="lineno">16489</span> </div>
+<div class="line"><a name="l16490"></a><span class="lineno">16490</span>     <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {</div>
+<div class="line"><a name="l16491"></a><span class="lineno">16491</span>         <span class="keywordflow">if</span> (k % 2) { <span class="comment">/* Extraordinary beam */</span></div>
+<div class="line"><a name="l16492"></a><span class="lineno">16492</span>             nstokes = sstokes;      <span class="comment">/* Use same start value as for ordinary  */</span></div>
+<div class="line"><a name="l16493"></a><span class="lineno">16493</span>         }</div>
+<div class="line"><a name="l16494"></a><span class="lineno">16494</span>         <span class="keywordflow">else</span> {       <span class="comment">/* Ordinary beam      */</span></div>
+<div class="line"><a name="l16495"></a><span class="lineno">16495</span>             sstokes = nstokes;      <span class="comment">/* Memorise start value at ordinary beam */</span></div>
+<div class="line"><a name="l16496"></a><span class="lineno">16496</span>         }</div>
+<div class="line"><a name="l16497"></a><span class="lineno">16497</span> </div>
+<div class="line"><a name="l16498"></a><span class="lineno">16498</span>         <span class="keywordflow">for</span> (m = 0; m < maxobjs; m++) {</div>
+<div class="line"><a name="l16499"></a><span class="lineno">16499</span>             <span class="keywordtype">char</span> *name       = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,        m + 1);</div>
+<div class="line"><a name="l16500"></a><span class="lineno">16500</span>             <span class="keywordtype">char</span> *namestokes = cpl_sprintf(<span class="stringliteral">"row_stokes_%d"</span>, m + 1);</div>
+<div class="line"><a name="l16501"></a><span class="lineno">16501</span> </div>
+<div class="line"><a name="l16502"></a><span class="lineno">16502</span>             <span class="keywordflow">if</span> (!cpl_table_is_valid(origslits, name, k)) {</div>
+<div class="line"><a name="l16503"></a><span class="lineno">16503</span>                 cpl_free(name);</div>
+<div class="line"><a name="l16504"></a><span class="lineno">16504</span>                 cpl_free(namestokes);</div>
+<div class="line"><a name="l16505"></a><span class="lineno">16505</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l16506"></a><span class="lineno">16506</span>             }</div>
+<div class="line"><a name="l16507"></a><span class="lineno">16507</span>             <span class="keywordflow">else</span> { </div>
+<div class="line"><a name="l16508"></a><span class="lineno">16508</span>                 nmatches--;</div>
+<div class="line"><a name="l16509"></a><span class="lineno">16509</span>                 nstokes--;</div>
+<div class="line"><a name="l16510"></a><span class="lineno">16510</span>                 cpl_table_set_int(origslits, name, k, nmatches);</div>
+<div class="line"><a name="l16511"></a><span class="lineno">16511</span>                 cpl_table_set_int(origslits, namestokes, k, nstokes);</div>
+<div class="line"><a name="l16512"></a><span class="lineno">16512</span>             }</div>
+<div class="line"><a name="l16513"></a><span class="lineno">16513</span> </div>
+<div class="line"><a name="l16514"></a><span class="lineno">16514</span>             cpl_free(name);</div>
+<div class="line"><a name="l16515"></a><span class="lineno">16515</span>             cpl_free(namestokes);</div>
+<div class="line"><a name="l16516"></a><span class="lineno">16516</span>         }</div>
+<div class="line"><a name="l16517"></a><span class="lineno">16517</span>     }</div>
+<div class="line"><a name="l16518"></a><span class="lineno">16518</span> </div>
+<div class="line"><a name="l16519"></a><span class="lineno">16519</span> </div>
+<div class="line"><a name="l16520"></a><span class="lineno">16520</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l16521"></a><span class="lineno">16521</span> <span class="comment">     * This is done to avoid the NULL value is zero (it would invalidate</span></div>
+<div class="line"><a name="l16522"></a><span class="lineno">16522</span> <span class="comment">     * also the row_# = 0 or start_# = 0 for an object), and to enable </span></div>
+<div class="line"><a name="l16523"></a><span class="lineno">16523</span> <span class="comment">     * working directly with the column data buffers, when using this </span></div>
+<div class="line"><a name="l16524"></a><span class="lineno">16524</span> <span class="comment">     * table afterwards.</span></div>
+<div class="line"><a name="l16525"></a><span class="lineno">16525</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16526"></a><span class="lineno">16526</span> </div>
+<div class="line"><a name="l16527"></a><span class="lineno">16527</span>     <span class="keywordflow">for</span> (j = 0; j < maxobjs; j++) {</div>
+<div class="line"><a name="l16528"></a><span class="lineno">16528</span>         <span class="keywordtype">char</span> *name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, j + 1);</div>
+<div class="line"><a name="l16529"></a><span class="lineno">16529</span>         cpl_table_fill_invalid_double(origslits, name, -1);</div>
+<div class="line"><a name="l16530"></a><span class="lineno">16530</span>         cpl_free(name);</div>
+<div class="line"><a name="l16531"></a><span class="lineno">16531</span> </div>
+<div class="line"><a name="l16532"></a><span class="lineno">16532</span>         name       = cpl_sprintf(<span class="stringliteral">"start_%d"</span>, j + 1);</div>
+<div class="line"><a name="l16533"></a><span class="lineno">16533</span>         cpl_table_fill_invalid_int(origslits, name, -1);</div>
+<div class="line"><a name="l16534"></a><span class="lineno">16534</span>         cpl_free(name);</div>
+<div class="line"><a name="l16535"></a><span class="lineno">16535</span> </div>
+<div class="line"><a name="l16536"></a><span class="lineno">16536</span>         name       = cpl_sprintf(<span class="stringliteral">"end_%d"</span>, j + 1);</div>
+<div class="line"><a name="l16537"></a><span class="lineno">16537</span>         cpl_table_fill_invalid_int(origslits, name, -1);</div>
+<div class="line"><a name="l16538"></a><span class="lineno">16538</span>         cpl_free(name);</div>
+<div class="line"><a name="l16539"></a><span class="lineno">16539</span> </div>
+<div class="line"><a name="l16540"></a><span class="lineno">16540</span>         name       = cpl_sprintf(<span class="stringliteral">"row_%d"</span>, j + 1);</div>
+<div class="line"><a name="l16541"></a><span class="lineno">16541</span>         cpl_table_fill_invalid_int(origslits, name, -1);</div>
+<div class="line"><a name="l16542"></a><span class="lineno">16542</span>         cpl_free(name);</div>
+<div class="line"><a name="l16543"></a><span class="lineno">16543</span> </div>
+<div class="line"><a name="l16544"></a><span class="lineno">16544</span>         name       = cpl_sprintf(<span class="stringliteral">"row_stokes_%d"</span>, j + 1);</div>
+<div class="line"><a name="l16545"></a><span class="lineno">16545</span>         cpl_table_fill_invalid_int(origslits, name, -1);</div>
+<div class="line"><a name="l16546"></a><span class="lineno">16546</span>         cpl_free(name);</div>
+<div class="line"><a name="l16547"></a><span class="lineno">16547</span>     }</div>
+<div class="line"><a name="l16548"></a><span class="lineno">16548</span> </div>
+<div class="line"><a name="l16549"></a><span class="lineno">16549</span>     <span class="comment">/*********************************************************************</span></div>
+<div class="line"><a name="l16550"></a><span class="lineno">16550</span> <span class="comment">     * This tail has been added to propagate the selection of valid</span></div>
+<div class="line"><a name="l16551"></a><span class="lineno">16551</span> <span class="comment">     * objects also to the input slitss[] tables. Just eliminate all</span></div>
+<div class="line"><a name="l16552"></a><span class="lineno">16552</span> <span class="comment">     * this final part to suppress this behaviour.</span></div>
+<div class="line"><a name="l16553"></a><span class="lineno">16553</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16554"></a><span class="lineno">16554</span> </div>
+<div class="line"><a name="l16555"></a><span class="lineno">16555</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l16556"></a><span class="lineno">16556</span> <span class="comment">     * First of all, make a working copy and remove all columns related </span></div>
+<div class="line"><a name="l16557"></a><span class="lineno">16557</span> <span class="comment">     * to objects from the input object tables. </span></div>
+<div class="line"><a name="l16558"></a><span class="lineno">16558</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16559"></a><span class="lineno">16559</span> </div>
+<div class="line"><a name="l16560"></a><span class="lineno">16560</span>     <span class="keywordflow">for</span> (i = 0; i < nscience; i++) {</div>
+<div class="line"><a name="l16561"></a><span class="lineno">16561</span>         <span class="keywordtype">int</span> c_maxobjs = <a class="code" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac" title="Get the maximum possible number of objects in a slit.">mos_get_maxobjs_per_slit</a>(slitss[i]);</div>
+<div class="line"><a name="l16562"></a><span class="lineno">16562</span> </div>
+<div class="line"><a name="l16563"></a><span class="lineno">16563</span>         work[i] = cpl_table_duplicate(slitss[i]);</div>
+<div class="line"><a name="l16564"></a><span class="lineno">16564</span> </div>
+<div class="line"><a name="l16565"></a><span class="lineno">16565</span>         <span class="keywordflow">for</span> (m = 0; m < c_maxobjs; m++) {</div>
+<div class="line"><a name="l16566"></a><span class="lineno">16566</span>             <span class="keywordtype">char</span> *object_o = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);</div>
+<div class="line"><a name="l16567"></a><span class="lineno">16567</span>             <span class="keywordtype">char</span> *start_o  = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,  m + 1);</div>
+<div class="line"><a name="l16568"></a><span class="lineno">16568</span>             <span class="keywordtype">char</span> *end_o    = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,    m + 1);</div>
+<div class="line"><a name="l16569"></a><span class="lineno">16569</span>             <span class="keywordtype">char</span> *row_o    = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,    m + 1);</div>
+<div class="line"><a name="l16570"></a><span class="lineno">16570</span> </div>
+<div class="line"><a name="l16571"></a><span class="lineno">16571</span>             cpl_table_erase_column(slitss[i], object_o);</div>
+<div class="line"><a name="l16572"></a><span class="lineno">16572</span>             cpl_table_erase_column(slitss[i], start_o);</div>
+<div class="line"><a name="l16573"></a><span class="lineno">16573</span>             cpl_table_erase_column(slitss[i], end_o);</div>
+<div class="line"><a name="l16574"></a><span class="lineno">16574</span>             cpl_table_erase_column(slitss[i], row_o);</div>
+<div class="line"><a name="l16575"></a><span class="lineno">16575</span>         }</div>
+<div class="line"><a name="l16576"></a><span class="lineno">16576</span>     }</div>
+<div class="line"><a name="l16577"></a><span class="lineno">16577</span> </div>
+<div class="line"><a name="l16578"></a><span class="lineno">16578</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l16579"></a><span class="lineno">16579</span> <span class="comment">     * Now just consider all the objects in the intersection table.</span></div>
+<div class="line"><a name="l16580"></a><span class="lineno">16580</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16581"></a><span class="lineno">16581</span> </div>
+<div class="line"><a name="l16582"></a><span class="lineno">16582</span>     <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {</div>
+<div class="line"><a name="l16583"></a><span class="lineno">16583</span>         <span class="keywordflow">for</span> (j = 0; j < maxobjs; j++) {</div>
+<div class="line"><a name="l16584"></a><span class="lineno">16584</span>             <span class="keywordtype">double</span> object_w, object_r;</div>
+<div class="line"><a name="l16585"></a><span class="lineno">16585</span>             <span class="keywordtype">int</span>    row_w;</div>
+<div class="line"><a name="l16586"></a><span class="lineno">16586</span> </div>
+<div class="line"><a name="l16587"></a><span class="lineno">16587</span>             <span class="keywordtype">char</span>  *object_i = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, j + 1);</div>
+<div class="line"><a name="l16588"></a><span class="lineno">16588</span>             <span class="keywordtype">char</span>  *start_i  = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,  j + 1);</div>
+<div class="line"><a name="l16589"></a><span class="lineno">16589</span>             <span class="keywordtype">char</span>  *end_i    = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,    j + 1);</div>
+<div class="line"><a name="l16590"></a><span class="lineno">16590</span>             <span class="keywordtype">char</span>  *row_i    = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,    j + 1);</div>
+<div class="line"><a name="l16591"></a><span class="lineno">16591</span> </div>
+<div class="line"><a name="l16592"></a><span class="lineno">16592</span> </div>
+<div class="line"><a name="l16593"></a><span class="lineno">16593</span>             <span class="keywordflow">if</span> (!cpl_table_is_valid(origslits, object_i, k))</div>
+<div class="line"><a name="l16594"></a><span class="lineno">16594</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l16595"></a><span class="lineno">16595</span> </div>
+<div class="line"><a name="l16596"></a><span class="lineno">16596</span>             <span class="comment">/* </span></div>
+<div class="line"><a name="l16597"></a><span class="lineno">16597</span> <span class="comment">             * We have found a valid object (valid because it belongs</span></div>
+<div class="line"><a name="l16598"></a><span class="lineno">16598</span> <span class="comment">             * to the intersection). Now we look for this object in each</span></div>
+<div class="line"><a name="l16599"></a><span class="lineno">16599</span> <span class="comment">             * one of the original tables, we get its parameters, and</span></div>
+<div class="line"><a name="l16600"></a><span class="lineno">16600</span> <span class="comment">             * copy them at the right position (i.e., same position as</span></div>
+<div class="line"><a name="l16601"></a><span class="lineno">16601</span> <span class="comment">             * in intersection table). The object will be the one closest</span></div>
+<div class="line"><a name="l16602"></a><span class="lineno">16602</span> <span class="comment">             * to the object position (column object_i) in the intersection</span></div>
+<div class="line"><a name="l16603"></a><span class="lineno">16603</span> <span class="comment">             * table. Note that we examine the same row, k, in all tables.</span></div>
+<div class="line"><a name="l16604"></a><span class="lineno">16604</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l16605"></a><span class="lineno">16605</span> </div>
+<div class="line"><a name="l16606"></a><span class="lineno">16606</span>             object_w = cpl_table_get_double(origslits, object_i, k, NULL);</div>
+<div class="line"><a name="l16607"></a><span class="lineno">16607</span>             row_w    = cpl_table_get_int   (origslits, row_i,    k, NULL);</div>
+<div class="line"><a name="l16608"></a><span class="lineno">16608</span> </div>
+<div class="line"><a name="l16609"></a><span class="lineno">16609</span>             <span class="keywordflow">for</span> (i = 0; i < nscience; i++) {</div>
+<div class="line"><a name="l16610"></a><span class="lineno">16610</span>                 <span class="keywordtype">int</span>        c_maxobjs = <a class="code" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac" title="Get the maximum possible number of objects in a slit.">mos_get_maxobjs_per_slit</a>(work[i]);</div>
+<div class="line"><a name="l16611"></a><span class="lineno">16611</span>                 <span class="keywordtype">int</span>        minpos;</div>
+<div class="line"><a name="l16612"></a><span class="lineno">16612</span>                 <span class="keywordtype">double</span>     mindiff, diff;</div>
+<div class="line"><a name="l16613"></a><span class="lineno">16613</span>                 <span class="keywordtype">char</span>      *object_o;</div>
+<div class="line"><a name="l16614"></a><span class="lineno">16614</span>                 <span class="keywordtype">char</span>      *start_o;</div>
+<div class="line"><a name="l16615"></a><span class="lineno">16615</span>                 <span class="keywordtype">char</span>      *end_o;</div>
+<div class="line"><a name="l16616"></a><span class="lineno">16616</span>                 <span class="keywordtype">char</span>      *row_o;</div>
+<div class="line"><a name="l16617"></a><span class="lineno">16617</span> </div>
+<div class="line"><a name="l16618"></a><span class="lineno">16618</span>                 <span class="keywordflow">for</span> (m = 0; m < c_maxobjs; m++) {</div>
+<div class="line"><a name="l16619"></a><span class="lineno">16619</span>                     object_o = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);</div>
+<div class="line"><a name="l16620"></a><span class="lineno">16620</span>                     start_o  = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,  m + 1);</div>
+<div class="line"><a name="l16621"></a><span class="lineno">16621</span>                     end_o    = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,    m + 1);</div>
+<div class="line"><a name="l16622"></a><span class="lineno">16622</span>                     row_o    = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,    m + 1);</div>
+<div class="line"><a name="l16623"></a><span class="lineno">16623</span> </div>
+<div class="line"><a name="l16624"></a><span class="lineno">16624</span>                     <span class="keywordflow">if</span> (!cpl_table_is_valid(work[i], object_o, k))</div>
+<div class="line"><a name="l16625"></a><span class="lineno">16625</span>                         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l16626"></a><span class="lineno">16626</span> </div>
+<div class="line"><a name="l16627"></a><span class="lineno">16627</span>                     object_r = cpl_table_get_double(work[i], object_o, k, NULL);</div>
+<div class="line"><a name="l16628"></a><span class="lineno">16628</span>                     <span class="comment">//row_r    = cpl_table_get_int   (work[i], row_o,    k, NULL);</span></div>
+<div class="line"><a name="l16629"></a><span class="lineno">16629</span> </div>
+<div class="line"><a name="l16630"></a><span class="lineno">16630</span>                     diff = fabs(object_w - object_r);</div>
+<div class="line"><a name="l16631"></a><span class="lineno">16631</span>                     <span class="keywordflow">if</span> (m) {</div>
+<div class="line"><a name="l16632"></a><span class="lineno">16632</span>                         <span class="keywordflow">if</span> (mindiff > diff) {</div>
+<div class="line"><a name="l16633"></a><span class="lineno">16633</span>                             mindiff = diff;</div>
+<div class="line"><a name="l16634"></a><span class="lineno">16634</span>                             minpos = m;</div>
+<div class="line"><a name="l16635"></a><span class="lineno">16635</span>                         }</div>
+<div class="line"><a name="l16636"></a><span class="lineno">16636</span>                     }</div>
+<div class="line"><a name="l16637"></a><span class="lineno">16637</span>                     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l16638"></a><span class="lineno">16638</span>                         mindiff = diff;</div>
+<div class="line"><a name="l16639"></a><span class="lineno">16639</span>                         minpos = 0;</div>
+<div class="line"><a name="l16640"></a><span class="lineno">16640</span>                     }</div>
+<div class="line"><a name="l16641"></a><span class="lineno">16641</span> </div>
+<div class="line"><a name="l16642"></a><span class="lineno">16642</span>                     cpl_free(object_o);</div>
+<div class="line"><a name="l16643"></a><span class="lineno">16643</span>                     cpl_free(start_o);</div>
+<div class="line"><a name="l16644"></a><span class="lineno">16644</span>                     cpl_free(end_o);</div>
+<div class="line"><a name="l16645"></a><span class="lineno">16645</span>                     cpl_free(row_o);</div>
+<div class="line"><a name="l16646"></a><span class="lineno">16646</span>                 }</div>
+<div class="line"><a name="l16647"></a><span class="lineno">16647</span> </div>
+<div class="line"><a name="l16648"></a><span class="lineno">16648</span>                 object_o = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, minpos + 1);</div>
+<div class="line"><a name="l16649"></a><span class="lineno">16649</span>                 start_o  = cpl_sprintf(<span class="stringliteral">"start_%d"</span>,  minpos + 1);</div>
+<div class="line"><a name="l16650"></a><span class="lineno">16650</span>                 end_o    = cpl_sprintf(<span class="stringliteral">"end_%d"</span>,    minpos + 1);</div>
+<div class="line"><a name="l16651"></a><span class="lineno">16651</span>                 row_o    = cpl_sprintf(<span class="stringliteral">"row_%d"</span>,    minpos + 1);</div>
+<div class="line"><a name="l16652"></a><span class="lineno">16652</span> </div>
+<div class="line"><a name="l16653"></a><span class="lineno">16653</span>                 <span class="keywordflow">if</span> (!cpl_table_has_column(slitss[i], object_i)) {</div>
+<div class="line"><a name="l16654"></a><span class="lineno">16654</span>                     cpl_table_new_column(slitss[i], object_i, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l16655"></a><span class="lineno">16655</span>                     cpl_table_new_column(slitss[i], start_i,  CPL_TYPE_INT);</div>
+<div class="line"><a name="l16656"></a><span class="lineno">16656</span>                     cpl_table_new_column(slitss[i], end_i,    CPL_TYPE_INT);</div>
+<div class="line"><a name="l16657"></a><span class="lineno">16657</span>                     cpl_table_new_column(slitss[i], row_i,    CPL_TYPE_INT);</div>
+<div class="line"><a name="l16658"></a><span class="lineno">16658</span>                     cpl_table_fill_invalid_double(slitss[i], object_i, -1);</div>
+<div class="line"><a name="l16659"></a><span class="lineno">16659</span>                     cpl_table_fill_invalid_int   (slitss[i], start_i,  -1);</div>
+<div class="line"><a name="l16660"></a><span class="lineno">16660</span>                     cpl_table_fill_invalid_int   (slitss[i], end_i,    -1);</div>
+<div class="line"><a name="l16661"></a><span class="lineno">16661</span>                     cpl_table_fill_invalid_int   (slitss[i], row_i,    -1);</div>
+<div class="line"><a name="l16662"></a><span class="lineno">16662</span>                 }</div>
+<div class="line"><a name="l16663"></a><span class="lineno">16663</span> </div>
+<div class="line"><a name="l16664"></a><span class="lineno">16664</span>                 cpl_table_set_double(slitss[i], object_i, k,</div>
+<div class="line"><a name="l16665"></a><span class="lineno">16665</span>                                      cpl_table_get_double(work[i], object_o, </div>
+<div class="line"><a name="l16666"></a><span class="lineno">16666</span>                                                           k, NULL));</div>
+<div class="line"><a name="l16667"></a><span class="lineno">16667</span>                 cpl_table_set_int(slitss[i], start_i , k,</div>
+<div class="line"><a name="l16668"></a><span class="lineno">16668</span>                                   cpl_table_get_int(work[i], start_o, k, NULL));</div>
+<div class="line"><a name="l16669"></a><span class="lineno">16669</span>                 cpl_table_set_int(slitss[i], end_i , k,</div>
+<div class="line"><a name="l16670"></a><span class="lineno">16670</span>                                   cpl_table_get_int(work[i], end_o, k, NULL));</div>
+<div class="line"><a name="l16671"></a><span class="lineno">16671</span>                 cpl_table_set_int(slitss[i], row_i , k, row_w);</div>
+<div class="line"><a name="l16672"></a><span class="lineno">16672</span> </div>
+<div class="line"><a name="l16673"></a><span class="lineno">16673</span>                 cpl_free(object_o);</div>
+<div class="line"><a name="l16674"></a><span class="lineno">16674</span>                 cpl_free(start_o);</div>
+<div class="line"><a name="l16675"></a><span class="lineno">16675</span>                 cpl_free(end_o);</div>
+<div class="line"><a name="l16676"></a><span class="lineno">16676</span>                 cpl_free(row_o);</div>
+<div class="line"><a name="l16677"></a><span class="lineno">16677</span>             }</div>
+<div class="line"><a name="l16678"></a><span class="lineno">16678</span> </div>
+<div class="line"><a name="l16679"></a><span class="lineno">16679</span>             cpl_free(object_i);</div>
+<div class="line"><a name="l16680"></a><span class="lineno">16680</span>             cpl_free(start_i);</div>
+<div class="line"><a name="l16681"></a><span class="lineno">16681</span>             cpl_free(end_i);</div>
+<div class="line"><a name="l16682"></a><span class="lineno">16682</span>             cpl_free(row_i);</div>
+<div class="line"><a name="l16683"></a><span class="lineno">16683</span>         }</div>
+<div class="line"><a name="l16684"></a><span class="lineno">16684</span>     }</div>
+<div class="line"><a name="l16685"></a><span class="lineno">16685</span> </div>
+<div class="line"><a name="l16686"></a><span class="lineno">16686</span>     <span class="keywordflow">for</span> (i = 0; i < nscience; i++)</div>
+<div class="line"><a name="l16687"></a><span class="lineno">16687</span>         cpl_table_delete(work[i]);</div>
+<div class="line"><a name="l16688"></a><span class="lineno">16688</span> </div>
+<div class="line"><a name="l16689"></a><span class="lineno">16689</span>     cpl_free(work);</div>
+<div class="line"><a name="l16690"></a><span class="lineno">16690</span> </div>
+<div class="line"><a name="l16691"></a><span class="lineno">16691</span> </div>
+<div class="line"><a name="l16692"></a><span class="lineno">16692</span>     <span class="keywordflow">return</span> cpl_error_get_code();</div>
+<div class="line"><a name="l16693"></a><span class="lineno">16693</span> }</div>
+<div class="line"><a name="l16694"></a><span class="lineno">16694</span> </div>
+<div class="line"><a name="l16695"></a><span class="lineno">16695</span> </div>
+<div class="line"><a name="l16703"></a><span class="lineno"><a class="code" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac">16703</a></span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac" title="Get the maximum possible number of objects in a slit.">mos_get_maxobjs_per_slit</a>(cpl_table * slits)</div>
+<div class="line"><a name="l16704"></a><span class="lineno">16704</span> {</div>
+<div class="line"><a name="l16705"></a><span class="lineno">16705</span>     <span class="keywordtype">int</span> maxobjs = 1;</div>
+<div class="line"><a name="l16706"></a><span class="lineno">16706</span> </div>
+<div class="line"><a name="l16707"></a><span class="lineno">16707</span>     <span class="keywordtype">char</span> * colname = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, maxobjs);</div>
+<div class="line"><a name="l16708"></a><span class="lineno">16708</span>     </div>
+<div class="line"><a name="l16709"></a><span class="lineno">16709</span>     <span class="keywordflow">while</span> (cpl_table_has_column(slits, colname)) {</div>
+<div class="line"><a name="l16710"></a><span class="lineno">16710</span>         maxobjs++;</div>
+<div class="line"><a name="l16711"></a><span class="lineno">16711</span>         cpl_free(colname);</div>
+<div class="line"><a name="l16712"></a><span class="lineno">16712</span>         colname = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, maxobjs);</div>
+<div class="line"><a name="l16713"></a><span class="lineno">16713</span>     }</div>
+<div class="line"><a name="l16714"></a><span class="lineno">16714</span>     </div>
+<div class="line"><a name="l16715"></a><span class="lineno">16715</span>     cpl_free(colname);</div>
+<div class="line"><a name="l16716"></a><span class="lineno">16716</span> </div>
+<div class="line"><a name="l16717"></a><span class="lineno">16717</span>     maxobjs--;</div>
+<div class="line"><a name="l16718"></a><span class="lineno">16718</span> </div>
+<div class="line"><a name="l16719"></a><span class="lineno">16719</span>     <span class="keywordflow">return</span> maxobjs;</div>
+<div class="line"><a name="l16720"></a><span class="lineno">16720</span> }</div>
+<div class="line"><a name="l16721"></a><span class="lineno">16721</span> </div>
+<div class="line"><a name="l16729"></a><span class="lineno"><a class="code" href="group__moses.html#gaf4d5e8a0d6cd0356ab38f0b7be241352">16729</a></span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gaf4d5e8a0d6cd0356ab38f0b7be241352" title="Get the total number of objects detected in a slits table.">mos_get_nobjects</a>(cpl_table * slits)</div>
+<div class="line"><a name="l16730"></a><span class="lineno">16730</span> {</div>
+<div class="line"><a name="l16731"></a><span class="lineno">16731</span>     <span class="keywordtype">int</span> nobjs = 0;</div>
+<div class="line"><a name="l16732"></a><span class="lineno">16732</span> </div>
+<div class="line"><a name="l16733"></a><span class="lineno">16733</span>     <span class="keywordtype">int</span> nslits  = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l16734"></a><span class="lineno">16734</span>     <span class="keywordtype">int</span> maxobjs = <a class="code" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac" title="Get the maximum possible number of objects in a slit.">mos_get_maxobjs_per_slit</a>(slits);</div>
+<div class="line"><a name="l16735"></a><span class="lineno">16735</span> </div>
+<div class="line"><a name="l16736"></a><span class="lineno">16736</span>     <span class="keywordtype">int</span> k, m;</div>
+<div class="line"><a name="l16737"></a><span class="lineno">16737</span> </div>
+<div class="line"><a name="l16738"></a><span class="lineno">16738</span>     <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {</div>
+<div class="line"><a name="l16739"></a><span class="lineno">16739</span>         <span class="keywordflow">for</span> (m = 0; m < maxobjs; m++) {</div>
+<div class="line"><a name="l16740"></a><span class="lineno">16740</span>             <span class="keywordtype">char</span> * name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);</div>
+<div class="line"><a name="l16741"></a><span class="lineno">16741</span>             <span class="keywordtype">int</span>    null = !cpl_table_is_valid(slits, name, k);</div>
+<div class="line"><a name="l16742"></a><span class="lineno">16742</span> </div>
+<div class="line"><a name="l16743"></a><span class="lineno">16743</span>             cpl_free(name);</div>
+<div class="line"><a name="l16744"></a><span class="lineno">16744</span> </div>
+<div class="line"><a name="l16745"></a><span class="lineno">16745</span>             <span class="keywordflow">if</span> (null)  <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l16746"></a><span class="lineno">16746</span>             <span class="keywordflow">else</span> nobjs++;</div>
+<div class="line"><a name="l16747"></a><span class="lineno">16747</span>         }</div>
+<div class="line"><a name="l16748"></a><span class="lineno">16748</span>     }</div>
+<div class="line"><a name="l16749"></a><span class="lineno">16749</span> </div>
+<div class="line"><a name="l16750"></a><span class="lineno">16750</span>     <span class="keywordflow">return</span> nobjs;</div>
+<div class="line"><a name="l16751"></a><span class="lineno">16751</span> }</div>
+<div class="line"><a name="l16752"></a><span class="lineno">16752</span> </div>
+<div class="line"><a name="l16760"></a><span class="lineno"><a class="code" href="group__moses.html#ga71e13921907ec2f25478957d35318e7f">16760</a></span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#ga71e13921907ec2f25478957d35318e7f" title="Check that all slit have been detected, insert them if not.">mos_check_slits</a>(cpl_table *slits, <span class="keywordtype">float</span> rescale)</div>
+<div class="line"><a name="l16761"></a><span class="lineno">16761</span> {</div>
+<div class="line"><a name="l16762"></a><span class="lineno">16762</span> </div>
+<div class="line"><a name="l16763"></a><span class="lineno">16763</span>     cpl_propertylist *sort;</div>
+<div class="line"><a name="l16764"></a><span class="lineno">16764</span> </div>
+<div class="line"><a name="l16765"></a><span class="lineno">16765</span>     <span class="keywordtype">int</span> nslits  = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l16766"></a><span class="lineno">16766</span> </div>
+<div class="line"><a name="l16767"></a><span class="lineno">16767</span>     <span class="keywordtype">int</span> k, null;</div>
+<div class="line"><a name="l16768"></a><span class="lineno">16768</span> </div>
+<div class="line"><a name="l16769"></a><span class="lineno">16769</span>     <span class="keyword">const</span> <span class="keywordtype">float</span> interval = 90.0 * rescale;</div>
+<div class="line"><a name="l16770"></a><span class="lineno">16770</span>     <span class="keyword">const</span> <span class="keywordtype">float</span> offset   = (90.0 - 5) * rescale;</div>
+<div class="line"><a name="l16771"></a><span class="lineno">16771</span> </div>
+<div class="line"><a name="l16772"></a><span class="lineno">16772</span> </div>
+<div class="line"><a name="l16773"></a><span class="lineno">16773</span>     <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {</div>
+<div class="line"><a name="l16774"></a><span class="lineno">16774</span>         <span class="keywordtype">double</span> ytop    = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>,    k, &null);</div>
+<div class="line"><a name="l16775"></a><span class="lineno">16775</span>         <span class="keywordtype">double</span> ybottom = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, k, &null);</div>
+<div class="line"><a name="l16776"></a><span class="lineno">16776</span> </div>
+<div class="line"><a name="l16777"></a><span class="lineno">16777</span>         <span class="keywordtype">double</span> xtop    = cpl_table_get_double(slits, <span class="stringliteral">"xtop"</span>,    k, &null);</div>
+<div class="line"><a name="l16778"></a><span class="lineno">16778</span>         <span class="keywordtype">double</span> xbottom = cpl_table_get_double(slits, <span class="stringliteral">"xbottom"</span>, k, &null);</div>
+<div class="line"><a name="l16779"></a><span class="lineno">16779</span> </div>
+<div class="line"><a name="l16780"></a><span class="lineno">16780</span>         <span class="keywordtype">int</span> nmiss = (int)((ytop - ybottom) / interval + 0.5);</div>
+<div class="line"><a name="l16781"></a><span class="lineno">16781</span> </div>
+<div class="line"><a name="l16782"></a><span class="lineno">16782</span>         <span class="keywordflow">if</span> (nmiss > 1) {</div>
+<div class="line"><a name="l16783"></a><span class="lineno">16783</span>             cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l16784"></a><span class="lineno">16784</span>                             <span class="stringliteral">"Some slits could not be properly detected. "</span></div>
+<div class="line"><a name="l16785"></a><span class="lineno">16785</span>                             <span class="stringliteral">"There might be accountable inaccuracies."</span>);</div>
+<div class="line"><a name="l16786"></a><span class="lineno">16786</span>             <span class="keywordflow">while</span> (nmiss > 1) {</div>
+<div class="line"><a name="l16787"></a><span class="lineno">16787</span>                 cpl_table_set_size(slits, nslits + 1);</div>
+<div class="line"><a name="l16788"></a><span class="lineno">16788</span> </div>
+<div class="line"><a name="l16789"></a><span class="lineno">16789</span>                 <span class="comment">/* Fill in new slit 'cut' */</span></div>
+<div class="line"><a name="l16790"></a><span class="lineno">16790</span> </div>
+<div class="line"><a name="l16791"></a><span class="lineno">16791</span>                 <span class="comment">/* x coordinates be the same (acceptable approximation) */</span></div>
+<div class="line"><a name="l16792"></a><span class="lineno">16792</span>                 cpl_table_set_double(slits, <span class="stringliteral">"xtop"</span>,    nslits, xtop);</div>
+<div class="line"><a name="l16793"></a><span class="lineno">16793</span>                 cpl_table_set_double(slits, <span class="stringliteral">"xbottom"</span>, nslits, xbottom);</div>
+<div class="line"><a name="l16794"></a><span class="lineno">16794</span> </div>
+<div class="line"><a name="l16795"></a><span class="lineno">16795</span>                 <span class="comment">/* Cut */</span></div>
+<div class="line"><a name="l16796"></a><span class="lineno">16796</span>                 <span class="keywordflow">if</span> (k == 0) {</div>
+<div class="line"><a name="l16797"></a><span class="lineno">16797</span>                     cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, nslits, ybottom); </div>
+<div class="line"><a name="l16798"></a><span class="lineno">16798</span>                     cpl_table_set_double(slits, <span class="stringliteral">"ytop"</span>,    nslits, ybottom</div>
+<div class="line"><a name="l16799"></a><span class="lineno">16799</span>                                                                    + offset);</div>
+<div class="line"><a name="l16800"></a><span class="lineno">16800</span>                     ybottom += interval;</div>
+<div class="line"><a name="l16801"></a><span class="lineno">16801</span>                     cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, k,      ybottom);</div>
+<div class="line"><a name="l16802"></a><span class="lineno">16802</span>                 } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l16803"></a><span class="lineno">16803</span>                     cpl_table_set_double(slits, <span class="stringliteral">"ytop"</span>,    nslits, ytop);</div>
+<div class="line"><a name="l16804"></a><span class="lineno">16804</span>                     cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, nslits, ytop </div>
+<div class="line"><a name="l16805"></a><span class="lineno">16805</span>                                                                    - offset);</div>
+<div class="line"><a name="l16806"></a><span class="lineno">16806</span>                     ytop -= interval;</div>
+<div class="line"><a name="l16807"></a><span class="lineno">16807</span>                     cpl_table_set_double(slits, <span class="stringliteral">"ytop"</span>,     k,     ytop);</div>
+<div class="line"><a name="l16808"></a><span class="lineno">16808</span>                 }</div>
+<div class="line"><a name="l16809"></a><span class="lineno">16809</span> </div>
+<div class="line"><a name="l16810"></a><span class="lineno">16810</span>                 nslits++; nmiss--;</div>
+<div class="line"><a name="l16811"></a><span class="lineno">16811</span>             }</div>
+<div class="line"><a name="l16812"></a><span class="lineno">16812</span>         }</div>
+<div class="line"><a name="l16813"></a><span class="lineno">16813</span>     }</div>
+<div class="line"><a name="l16814"></a><span class="lineno">16814</span> </div>
+<div class="line"><a name="l16815"></a><span class="lineno">16815</span>     sort = cpl_propertylist_new();</div>
+<div class="line"><a name="l16816"></a><span class="lineno">16816</span>     cpl_propertylist_append_bool(sort, <span class="stringliteral">"ytop"</span>, 1);</div>
+<div class="line"><a name="l16817"></a><span class="lineno">16817</span>     cpl_table_sort(slits, sort);</div>
+<div class="line"><a name="l16818"></a><span class="lineno">16818</span>     cpl_propertylist_delete(sort);</div>
+<div class="line"><a name="l16819"></a><span class="lineno">16819</span> </div>
+<div class="line"><a name="l16820"></a><span class="lineno">16820</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l16821"></a><span class="lineno">16821</span> <span class="comment">     * Add here an ad hoc check on the last slit: is it too long </span></div>
+<div class="line"><a name="l16822"></a><span class="lineno">16822</span> <span class="comment">     * (by more than 10%)? Then shorten it...</span></div>
+<div class="line"><a name="l16823"></a><span class="lineno">16823</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l16824"></a><span class="lineno">16824</span> </div>
+<div class="line"><a name="l16825"></a><span class="lineno">16825</span>     k = cpl_table_get_nrow(slits) - 1;</div>
+<div class="line"><a name="l16826"></a><span class="lineno">16826</span> </div>
+<div class="line"><a name="l16827"></a><span class="lineno">16827</span>     {</div>
+<div class="line"><a name="l16828"></a><span class="lineno">16828</span>         <span class="keywordtype">double</span> ytop    = cpl_table_get_double(slits, <span class="stringliteral">"ytop"</span>,    k, &null);</div>
+<div class="line"><a name="l16829"></a><span class="lineno">16829</span>         <span class="keywordtype">double</span> ybottom = cpl_table_get_double(slits, <span class="stringliteral">"ybottom"</span>, k, &null);</div>
+<div class="line"><a name="l16830"></a><span class="lineno">16830</span>         <span class="keywordtype">double</span> length  = (ytop - ybottom) / interval;</div>
+<div class="line"><a name="l16831"></a><span class="lineno">16831</span> </div>
+<div class="line"><a name="l16832"></a><span class="lineno">16832</span>         <span class="keywordflow">if</span> (length > 1.1) {</div>
+<div class="line"><a name="l16833"></a><span class="lineno">16833</span>             cpl_table_set_double(slits, <span class="stringliteral">"ybottom"</span>, k, ytop - offset);</div>
+<div class="line"><a name="l16834"></a><span class="lineno">16834</span>         }</div>
+<div class="line"><a name="l16835"></a><span class="lineno">16835</span>   </div>
+<div class="line"><a name="l16836"></a><span class="lineno">16836</span>     }</div>
+<div class="line"><a name="l16837"></a><span class="lineno">16837</span> </div>
+<div class="line"><a name="l16838"></a><span class="lineno">16838</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l16839"></a><span class="lineno">16839</span> }</div>
+<div class="line"><a name="l16840"></a><span class="lineno">16840</span> </div>
+<div class="line"><a name="l16863"></a><span class="lineno"><a class="code" href="group__moses.html#ga78aebb1592ccefba83f9b7cbb80a9676">16863</a></span> cpl_table *<a class="code" href="group__moses.html#ga78aebb1592ccefba83f9b7cbb80a9676" title="Create PMOS slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_pmos</a>(cpl_propertylist *header, </div>
+<div class="line"><a name="l16864"></a><span class="lineno">16864</span>                                     <span class="keywordtype">int</span> * nslits_out_det)</div>
+<div class="line"><a name="l16865"></a><span class="lineno">16865</span> {</div>
+<div class="line"><a name="l16866"></a><span class="lineno">16866</span>     <span class="keywordtype">int</span> m, null;</div>
+<div class="line"><a name="l16867"></a><span class="lineno">16867</span>     <span class="keywordtype">int</span> halfsize;</div>
+<div class="line"><a name="l16868"></a><span class="lineno">16868</span> </div>
+<div class="line"><a name="l16869"></a><span class="lineno">16869</span>     cpl_propertylist * sort;</div>
+<div class="line"><a name="l16870"></a><span class="lineno">16870</span>     cpl_table        * slits; </div>
+<div class="line"><a name="l16871"></a><span class="lineno">16871</span> </div>
+<div class="line"><a name="l16872"></a><span class="lineno">16872</span>     slits    = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, nslits_out_det);</div>
+<div class="line"><a name="l16873"></a><span class="lineno">16873</span>     halfsize = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l16874"></a><span class="lineno">16874</span> </div>
+<div class="line"><a name="l16875"></a><span class="lineno">16875</span>     cpl_table_set_size(slits, 2 * halfsize);</div>
+<div class="line"><a name="l16876"></a><span class="lineno">16876</span> </div>
+<div class="line"><a name="l16877"></a><span class="lineno">16877</span>     <span class="keywordflow">for</span> (m = 0; m < halfsize; m++) {</div>
+<div class="line"><a name="l16878"></a><span class="lineno">16878</span> </div>
+<div class="line"><a name="l16879"></a><span class="lineno">16879</span>         <span class="keywordtype">double</span> gap = 1.4;</div>
+<div class="line"><a name="l16880"></a><span class="lineno">16880</span> </div>
+<div class="line"><a name="l16881"></a><span class="lineno">16881</span>         <span class="keywordtype">double</span> length = </div>
+<div class="line"><a name="l16882"></a><span class="lineno">16882</span>             cpl_table_get(slits, <span class="stringliteral">"ytop"</span>,    m, &null) -</div>
+<div class="line"><a name="l16883"></a><span class="lineno">16883</span>             cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, m, &null);</div>
+<div class="line"><a name="l16884"></a><span class="lineno">16884</span> </div>
+<div class="line"><a name="l16885"></a><span class="lineno">16885</span>         <span class="keywordflow">if</span> (m) {</div>
+<div class="line"><a name="l16886"></a><span class="lineno">16886</span>             <span class="keywordtype">double</span> interval = </div>
+<div class="line"><a name="l16887"></a><span class="lineno">16887</span>                 cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, m - 1, &null) -</div>
+<div class="line"><a name="l16888"></a><span class="lineno">16888</span>                 cpl_table_get(slits, <span class="stringliteral">"ytop"</span>,    m,     &null);</div>
+<div class="line"><a name="l16889"></a><span class="lineno">16889</span> </div>
+<div class="line"><a name="l16890"></a><span class="lineno">16890</span>             gap = (interval - length) / 2;</div>
+<div class="line"><a name="l16891"></a><span class="lineno">16891</span>         }</div>
+<div class="line"><a name="l16892"></a><span class="lineno">16892</span> </div>
+<div class="line"><a name="l16893"></a><span class="lineno">16893</span>         cpl_table_set(slits, <span class="stringliteral">"slit_id"</span>, m + halfsize,</div>
+<div class="line"><a name="l16894"></a><span class="lineno">16894</span>                       cpl_table_get(slits, <span class="stringliteral">"slit_id"</span>, m, &null) - 1);</div>
+<div class="line"><a name="l16895"></a><span class="lineno">16895</span> </div>
+<div class="line"><a name="l16896"></a><span class="lineno">16896</span>         cpl_table_set(slits, <span class="stringliteral">"xtop"</span>,    m + halfsize,</div>
+<div class="line"><a name="l16897"></a><span class="lineno">16897</span>                       cpl_table_get(slits, <span class="stringliteral">"xtop"</span>,    m, &null));</div>
+<div class="line"><a name="l16898"></a><span class="lineno">16898</span> </div>
+<div class="line"><a name="l16899"></a><span class="lineno">16899</span>         cpl_table_set(slits, <span class="stringliteral">"xbottom"</span>, m + halfsize,</div>
+<div class="line"><a name="l16900"></a><span class="lineno">16900</span>                       cpl_table_get(slits, <span class="stringliteral">"xbottom"</span>, m, &null));</div>
+<div class="line"><a name="l16901"></a><span class="lineno">16901</span> </div>
+<div class="line"><a name="l16902"></a><span class="lineno">16902</span>         cpl_table_set(slits, <span class="stringliteral">"ytop"</span>,    m + halfsize, </div>
+<div class="line"><a name="l16903"></a><span class="lineno">16903</span>                       cpl_table_get(slits, <span class="stringliteral">"ytop"</span>, m, &null) + gap + length);</div>
+<div class="line"><a name="l16904"></a><span class="lineno">16904</span> </div>
+<div class="line"><a name="l16905"></a><span class="lineno">16905</span>         cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, m + halfsize,</div>
+<div class="line"><a name="l16906"></a><span class="lineno">16906</span>                       cpl_table_get(slits, <span class="stringliteral">"ytop"</span>, m, &null) + gap);</div>
+<div class="line"><a name="l16907"></a><span class="lineno">16907</span>     }</div>
+<div class="line"><a name="l16908"></a><span class="lineno">16908</span> </div>
+<div class="line"><a name="l16909"></a><span class="lineno">16909</span>     <span class="keywordflow">for</span> (m = 0; m < 2 * halfsize; m++) {</div>
+<div class="line"><a name="l16910"></a><span class="lineno">16910</span>         cpl_table_set(slits, <span class="stringliteral">"ytop"</span>,    m, </div>
+<div class="line"><a name="l16911"></a><span class="lineno">16911</span>                       cpl_table_get(slits, <span class="stringliteral">"ytop"</span>,    m, &null) - 5.3);</div>
+<div class="line"><a name="l16912"></a><span class="lineno">16912</span> </div>
+<div class="line"><a name="l16913"></a><span class="lineno">16913</span>         cpl_table_set(slits, <span class="stringliteral">"ybottom"</span>, m,</div>
+<div class="line"><a name="l16914"></a><span class="lineno">16914</span>                       cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, m, &null) - 5.3);</div>
+<div class="line"><a name="l16915"></a><span class="lineno">16915</span> </div>
+<div class="line"><a name="l16916"></a><span class="lineno">16916</span>     }</div>
+<div class="line"><a name="l16917"></a><span class="lineno">16917</span> </div>
+<div class="line"><a name="l16918"></a><span class="lineno">16918</span>     sort = cpl_propertylist_new();</div>
+<div class="line"><a name="l16919"></a><span class="lineno">16919</span>     cpl_propertylist_append_bool(sort, <span class="stringliteral">"ytop"</span>, 1);</div>
+<div class="line"><a name="l16920"></a><span class="lineno">16920</span>     cpl_table_sort(slits, sort);</div>
+<div class="line"><a name="l16921"></a><span class="lineno">16921</span> </div>
+<div class="line"><a name="l16922"></a><span class="lineno">16922</span>     cpl_propertylist_delete(sort);</div>
+<div class="line"><a name="l16923"></a><span class="lineno">16923</span> </div>
+<div class="line"><a name="l16924"></a><span class="lineno">16924</span>     <span class="keywordflow">return</span> slits;</div>
+<div class="line"><a name="l16925"></a><span class="lineno">16925</span> }</div>
+<div class="line"><a name="l16926"></a><span class="lineno">16926</span> </div>
+<div class="line"><a name="l16927"></a><span class="lineno">16927</span> <span class="keywordtype">int</span> * fors_get_nobjs_perslit(cpl_table * slits)</div>
+<div class="line"><a name="l16928"></a><span class="lineno">16928</span> {</div>
+<div class="line"><a name="l16929"></a><span class="lineno">16929</span>     <span class="keywordtype">int</span> nslits  = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l16930"></a><span class="lineno">16930</span>     <span class="keywordtype">int</span> maxobjs = <a class="code" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac" title="Get the maximum possible number of objects in a slit.">mos_get_maxobjs_per_slit</a>(slits);</div>
+<div class="line"><a name="l16931"></a><span class="lineno">16931</span> </div>
+<div class="line"><a name="l16932"></a><span class="lineno">16932</span>     <span class="keywordtype">int</span> * nobjs_per_slit = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">int</span>) * nslits);</div>
+<div class="line"><a name="l16933"></a><span class="lineno">16933</span> </div>
+<div class="line"><a name="l16934"></a><span class="lineno">16934</span>     <span class="keywordtype">int</span> k, m;</div>
+<div class="line"><a name="l16935"></a><span class="lineno">16935</span> </div>
+<div class="line"><a name="l16936"></a><span class="lineno">16936</span>     <span class="keywordflow">for</span> (k = 0; k < nslits; k++) {</div>
+<div class="line"><a name="l16937"></a><span class="lineno">16937</span>         <span class="keywordtype">int</span> nobjs = 0;</div>
+<div class="line"><a name="l16938"></a><span class="lineno">16938</span>         <span class="keywordflow">for</span> (m = 0; m < maxobjs; m++) {</div>
+<div class="line"><a name="l16939"></a><span class="lineno">16939</span>             <span class="keywordtype">char</span> * name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, m + 1);</div>
+<div class="line"><a name="l16940"></a><span class="lineno">16940</span>             <span class="keywordtype">int</span>    null = !cpl_table_is_valid(slits, name, k);</div>
+<div class="line"><a name="l16941"></a><span class="lineno">16941</span> </div>
+<div class="line"><a name="l16942"></a><span class="lineno">16942</span>             cpl_free(name);</div>
+<div class="line"><a name="l16943"></a><span class="lineno">16943</span> </div>
+<div class="line"><a name="l16944"></a><span class="lineno">16944</span>             <span class="keywordflow">if</span> (null)  <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l16945"></a><span class="lineno">16945</span>             <span class="keywordflow">else</span> nobjs++;</div>
+<div class="line"><a name="l16946"></a><span class="lineno">16946</span>         }</div>
+<div class="line"><a name="l16947"></a><span class="lineno">16947</span>         </div>
+<div class="line"><a name="l16948"></a><span class="lineno">16948</span>         nobjs_per_slit[k] = nobjs;</div>
+<div class="line"><a name="l16949"></a><span class="lineno">16949</span>     }</div>
+<div class="line"><a name="l16950"></a><span class="lineno">16950</span> </div>
+<div class="line"><a name="l16951"></a><span class="lineno">16951</span>     <span class="keywordflow">return</span> nobjs_per_slit;</div>
+<div class="line"><a name="l16952"></a><span class="lineno">16952</span> }</div>
+<div class="line"><a name="l16953"></a><span class="lineno">16953</span> </div>
+<div class="line"><a name="l16954"></a><span class="lineno">16954</span> <span class="keywordtype">double</span> fors_get_object_position(cpl_table *slits, <span class="keywordtype">int</span> slit, <span class="keywordtype">int</span> <span class="keywordtype">object</span>)</div>
+<div class="line"><a name="l16955"></a><span class="lineno">16955</span> {</div>
+<div class="line"><a name="l16956"></a><span class="lineno">16956</span>     <span class="keywordtype">char</span>   *name = cpl_sprintf(<span class="stringliteral">"object_%d"</span>, <span class="keywordtype">object</span>);</div>
+<div class="line"><a name="l16957"></a><span class="lineno">16957</span>     <span class="keywordtype">double</span>  position;</div>
+<div class="line"><a name="l16958"></a><span class="lineno">16958</span> </div>
+<div class="line"><a name="l16959"></a><span class="lineno">16959</span>     position = cpl_table_get_double(slits, name, slit, NULL)</div>
+<div class="line"><a name="l16960"></a><span class="lineno">16960</span>              - cpl_table_get_int(slits, <span class="stringliteral">"position"</span>, slit, NULL);</div>
+<div class="line"><a name="l16961"></a><span class="lineno">16961</span> </div>
+<div class="line"><a name="l16962"></a><span class="lineno">16962</span>     cpl_free(name);</div>
+<div class="line"><a name="l16963"></a><span class="lineno">16963</span> </div>
+<div class="line"><a name="l16964"></a><span class="lineno">16964</span>     <span class="keywordflow">return</span> position;</div>
+<div class="line"><a name="l16965"></a><span class="lineno">16965</span> }</div>
+<div class="line"><a name="l16966"></a><span class="lineno">16966</span> </div>
+<div class="line"><a name="l16967"></a><span class="lineno">16967</span> <span class="keywordtype">int</span> mos_rebin_signal(cpl_image **image, <span class="keywordtype">int</span> rebin)</div>
+<div class="line"><a name="l16968"></a><span class="lineno">16968</span> {</div>
+<div class="line"><a name="l16969"></a><span class="lineno">16969</span>     cpl_image *rebinned;</div>
+<div class="line"><a name="l16970"></a><span class="lineno">16970</span> </div>
+<div class="line"><a name="l16971"></a><span class="lineno">16971</span> </div>
+<div class="line"><a name="l16972"></a><span class="lineno">16972</span>     <span class="keywordflow">if</span> (*image == NULL)</div>
+<div class="line"><a name="l16973"></a><span class="lineno">16973</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l16974"></a><span class="lineno">16974</span> </div>
+<div class="line"><a name="l16975"></a><span class="lineno">16975</span>     <span class="keywordflow">if</span> (rebin == 1)</div>
+<div class="line"><a name="l16976"></a><span class="lineno">16976</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l16977"></a><span class="lineno">16977</span> </div>
+<div class="line"><a name="l16978"></a><span class="lineno">16978</span>     rebinned = cpl_image_rebin(*image, 1, 1, rebin, 1);</div>
+<div class="line"><a name="l16979"></a><span class="lineno">16979</span> </div>
+<div class="line"><a name="l16980"></a><span class="lineno">16980</span>     cpl_image_delete(*image);</div>
+<div class="line"><a name="l16981"></a><span class="lineno">16981</span> </div>
+<div class="line"><a name="l16982"></a><span class="lineno">16982</span>     *image = rebinned;</div>
+<div class="line"><a name="l16983"></a><span class="lineno">16983</span> </div>
+<div class="line"><a name="l16984"></a><span class="lineno">16984</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l16985"></a><span class="lineno">16985</span> }</div>
+<div class="line"><a name="l16986"></a><span class="lineno">16986</span> </div>
+<div class="line"><a name="l16987"></a><span class="lineno">16987</span> <span class="keywordtype">int</span> mos_rebin_error(cpl_image **image, <span class="keywordtype">int</span> rebin)</div>
+<div class="line"><a name="l16988"></a><span class="lineno">16988</span> {</div>
+<div class="line"><a name="l16989"></a><span class="lineno">16989</span>     <span class="keywordflow">if</span> (*image == NULL)</div>
+<div class="line"><a name="l16990"></a><span class="lineno">16990</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l16991"></a><span class="lineno">16991</span> </div>
+<div class="line"><a name="l16992"></a><span class="lineno">16992</span>     <span class="keywordflow">if</span> (rebin == 1)</div>
+<div class="line"><a name="l16993"></a><span class="lineno">16993</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l16994"></a><span class="lineno">16994</span> </div>
+<div class="line"><a name="l16995"></a><span class="lineno">16995</span>     cpl_image_power(*image, 2);</div>
+<div class="line"><a name="l16996"></a><span class="lineno">16996</span>     mos_rebin_signal(image, rebin);</div>
+<div class="line"><a name="l16997"></a><span class="lineno">16997</span>     cpl_image_power(*image, 0.5);</div>
+<div class="line"><a name="l16998"></a><span class="lineno">16998</span> </div>
+<div class="line"><a name="l16999"></a><span class="lineno">16999</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l17000"></a><span class="lineno">17000</span> }</div>
+<div class="line"><a name="l17001"></a><span class="lineno">17001</span> </div>
+<div class="line"><a name="l17002"></a><span class="lineno">17002</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l17003"></a><span class="lineno">17003</span> <span class="comment"> * @brief</span></div>
+<div class="line"><a name="l17004"></a><span class="lineno">17004</span> <span class="comment"> *   Map table values into a 1D image</span></div>
+<div class="line"><a name="l17005"></a><span class="lineno">17005</span> <span class="comment"> *  </span></div>
+<div class="line"><a name="l17006"></a><span class="lineno">17006</span> <span class="comment"> * @param image       Target image</span></div>
+<div class="line"><a name="l17007"></a><span class="lineno">17007</span> <span class="comment"> * @param start       Coordinate of first pixel in image</span></div>
+<div class="line"><a name="l17008"></a><span class="lineno">17008</span> <span class="comment"> * @param step        Coordinate step for one pixel in image</span></div>
+<div class="line"><a name="l17009"></a><span class="lineno">17009</span> <span class="comment"> * @param table       Source table</span></div>
+<div class="line"><a name="l17010"></a><span class="lineno">17010</span> <span class="comment"> * @param xname       Name of coordinate column</span></div>
+<div class="line"><a name="l17011"></a><span class="lineno">17011</span> <span class="comment"> * @param yname       Name of values column</span></div>
+<div class="line"><a name="l17012"></a><span class="lineno">17012</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l17013"></a><span class="lineno">17013</span> <span class="comment"> * @return 0 on success</span></div>
+<div class="line"><a name="l17014"></a><span class="lineno">17014</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l17015"></a><span class="lineno">17015</span> <span class="comment"> * The values in @em yname are linearly interpolated at the @em image </span></div>
+<div class="line"><a name="l17016"></a><span class="lineno">17016</span> <span class="comment"> * pixel coordinates. The @em image must have Nx1 size.</span></div>
+<div class="line"><a name="l17017"></a><span class="lineno">17017</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l17018"></a><span class="lineno">17018</span> </div>
+<div class="line"><a name="l17019"></a><span class="lineno">17019</span> <span class="keywordtype">int</span> map_table(cpl_image *image, <span class="keywordtype">double</span> start, <span class="keywordtype">double</span> step,</div>
+<div class="line"><a name="l17020"></a><span class="lineno">17020</span>               cpl_table *table, <span class="keywordtype">char</span> *xname, <span class="keywordtype">char</span> *yname)</div>
+<div class="line"><a name="l17021"></a><span class="lineno">17021</span> {</div>
+<div class="line"><a name="l17022"></a><span class="lineno">17022</span>     <span class="keywordtype">int</span>      length = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l17023"></a><span class="lineno">17023</span>     <span class="keywordtype">int</span>      nrows  = cpl_table_get_nrow(table);</div>
+<div class="line"><a name="l17024"></a><span class="lineno">17024</span>     <span class="keywordtype">float</span>   *data   = cpl_image_get_data_float(image);</div>
+<div class="line"><a name="l17025"></a><span class="lineno">17025</span>     <span class="keywordtype">float</span>   *fdata  = NULL;</div>
+<div class="line"><a name="l17026"></a><span class="lineno">17026</span>     <span class="keywordtype">double</span>  *xdata  = NULL;</div>
+<div class="line"><a name="l17027"></a><span class="lineno">17027</span>     <span class="keywordtype">double</span>  *ydata  = NULL;</div>
+<div class="line"><a name="l17028"></a><span class="lineno">17028</span>     cpl_type xtype  = cpl_table_get_column_type(table, xname);</div>
+<div class="line"><a name="l17029"></a><span class="lineno">17029</span>     cpl_type ytype  = cpl_table_get_column_type(table, yname);</div>
+<div class="line"><a name="l17030"></a><span class="lineno">17030</span>     <span class="keywordtype">double</span>   xzero, pos;</div>
+<div class="line"><a name="l17031"></a><span class="lineno">17031</span>     <span class="keywordtype">int</span>      i, j, n;</div>
+<div class="line"><a name="l17032"></a><span class="lineno">17032</span> </div>
+<div class="line"><a name="l17033"></a><span class="lineno">17033</span> </div>
+<div class="line"><a name="l17034"></a><span class="lineno">17034</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17035"></a><span class="lineno">17035</span> <span class="comment">     * Initialization of output image at 0.0 - this value is left </span></div>
+<div class="line"><a name="l17036"></a><span class="lineno">17036</span> <span class="comment">     * on non-overlapping portions.</span></div>
+<div class="line"><a name="l17037"></a><span class="lineno">17037</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17038"></a><span class="lineno">17038</span> </div>
+<div class="line"><a name="l17039"></a><span class="lineno">17039</span>     <span class="keywordflow">for</span> (i = 0; i < length; i++)</div>
+<div class="line"><a name="l17040"></a><span class="lineno">17040</span>         data[i] = 0.0;</div>
+<div class="line"><a name="l17041"></a><span class="lineno">17041</span> </div>
+<div class="line"><a name="l17042"></a><span class="lineno">17042</span> </div>
+<div class="line"><a name="l17043"></a><span class="lineno">17043</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17044"></a><span class="lineno">17044</span> <span class="comment">     * Do everything in double precision</span></div>
+<div class="line"><a name="l17045"></a><span class="lineno">17045</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17046"></a><span class="lineno">17046</span> </div>
+<div class="line"><a name="l17047"></a><span class="lineno">17047</span>     <span class="keywordflow">if</span> (xtype == CPL_TYPE_FLOAT) {</div>
+<div class="line"><a name="l17048"></a><span class="lineno">17048</span>         fdata = cpl_table_get_data_float(table, xname);</div>
+<div class="line"><a name="l17049"></a><span class="lineno">17049</span>         xdata = cpl_malloc(nrows * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l17050"></a><span class="lineno">17050</span>         <span class="keywordflow">for</span> (i = 0; i < nrows; i++) {</div>
+<div class="line"><a name="l17051"></a><span class="lineno">17051</span>            xdata[i] = fdata[i];</div>
+<div class="line"><a name="l17052"></a><span class="lineno">17052</span>         }</div>
+<div class="line"><a name="l17053"></a><span class="lineno">17053</span>     }</div>
+<div class="line"><a name="l17054"></a><span class="lineno">17054</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l17055"></a><span class="lineno">17055</span>         xdata = cpl_table_get_data_double(table, xname);</div>
+<div class="line"><a name="l17056"></a><span class="lineno">17056</span>     }</div>
+<div class="line"><a name="l17057"></a><span class="lineno">17057</span> </div>
+<div class="line"><a name="l17058"></a><span class="lineno">17058</span>     <span class="keywordflow">if</span> (ytype == CPL_TYPE_FLOAT) {</div>
+<div class="line"><a name="l17059"></a><span class="lineno">17059</span>         fdata = cpl_table_get_data_float(table, yname);</div>
+<div class="line"><a name="l17060"></a><span class="lineno">17060</span>         ydata = cpl_malloc(nrows * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l17061"></a><span class="lineno">17061</span>         <span class="keywordflow">for</span> (i = 0; i < nrows; i++) {</div>
+<div class="line"><a name="l17062"></a><span class="lineno">17062</span>            ydata[i] = fdata[i];</div>
+<div class="line"><a name="l17063"></a><span class="lineno">17063</span>         }</div>
+<div class="line"><a name="l17064"></a><span class="lineno">17064</span>     }</div>
+<div class="line"><a name="l17065"></a><span class="lineno">17065</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l17066"></a><span class="lineno">17066</span>         ydata = cpl_table_get_data_double(table, yname);</div>
+<div class="line"><a name="l17067"></a><span class="lineno">17067</span>     }</div>
+<div class="line"><a name="l17068"></a><span class="lineno">17068</span> </div>
+<div class="line"><a name="l17069"></a><span class="lineno">17069</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17070"></a><span class="lineno">17070</span> <span class="comment">     * Mapping</span></div>
+<div class="line"><a name="l17071"></a><span class="lineno">17071</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17072"></a><span class="lineno">17072</span> </div>
+<div class="line"><a name="l17073"></a><span class="lineno">17073</span>     n = 0;</div>
+<div class="line"><a name="l17074"></a><span class="lineno">17074</span>     xzero = xdata[n];</div>
+<div class="line"><a name="l17075"></a><span class="lineno">17075</span> </div>
+<div class="line"><a name="l17076"></a><span class="lineno">17076</span>     <span class="keywordflow">for</span> (i = 0; i < length; i++) {</div>
+<div class="line"><a name="l17077"></a><span class="lineno">17077</span>         pos = start + step * i;</div>
+<div class="line"><a name="l17078"></a><span class="lineno">17078</span>         <span class="keywordflow">if</span> (pos < xzero)</div>
+<div class="line"><a name="l17079"></a><span class="lineno">17079</span>             <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l17080"></a><span class="lineno">17080</span>         <span class="keywordflow">for</span> (j = n; j < nrows; j++) {</div>
+<div class="line"><a name="l17081"></a><span class="lineno">17081</span>             <span class="keywordflow">if</span> (xdata[j] > pos) {</div>
+<div class="line"><a name="l17082"></a><span class="lineno">17082</span>                 n = j;</div>
+<div class="line"><a name="l17083"></a><span class="lineno">17083</span>                 data[i] = ydata[j-1]</div>
+<div class="line"><a name="l17084"></a><span class="lineno">17084</span>                         + (ydata[j] - ydata[j-1])</div>
+<div class="line"><a name="l17085"></a><span class="lineno">17085</span>                         * (pos - xdata[j-1]) / (xdata[j] - xdata[j-1]);</div>
+<div class="line"><a name="l17086"></a><span class="lineno">17086</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l17087"></a><span class="lineno">17087</span>             }</div>
+<div class="line"><a name="l17088"></a><span class="lineno">17088</span>         }</div>
+<div class="line"><a name="l17089"></a><span class="lineno">17089</span>     }</div>
+<div class="line"><a name="l17090"></a><span class="lineno">17090</span> </div>
+<div class="line"><a name="l17091"></a><span class="lineno">17091</span>     <span class="keywordflow">if</span> (xtype == CPL_TYPE_FLOAT)</div>
+<div class="line"><a name="l17092"></a><span class="lineno">17092</span>         cpl_free(xdata);</div>
+<div class="line"><a name="l17093"></a><span class="lineno">17093</span> </div>
+<div class="line"><a name="l17094"></a><span class="lineno">17094</span>     <span class="keywordflow">if</span> (ytype == CPL_TYPE_FLOAT)</div>
+<div class="line"><a name="l17095"></a><span class="lineno">17095</span>         cpl_free(ydata);</div>
+<div class="line"><a name="l17096"></a><span class="lineno">17096</span> </div>
+<div class="line"><a name="l17097"></a><span class="lineno">17097</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l17098"></a><span class="lineno">17098</span> }</div>
+<div class="line"><a name="l17099"></a><span class="lineno">17099</span> </div>
+<div class="line"><a name="l17100"></a><span class="lineno">17100</span> </div>
+<div class="line"><a name="l17101"></a><span class="lineno">17101</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l17102"></a><span class="lineno">17102</span> <span class="comment"> * @brief</span></div>
+<div class="line"><a name="l17103"></a><span class="lineno">17103</span> <span class="comment"> *   Fit overall trend of a Nx1 image</span></div>
+<div class="line"><a name="l17104"></a><span class="lineno">17104</span> <span class="comment"> *  </span></div>
+<div class="line"><a name="l17105"></a><span class="lineno">17105</span> <span class="comment"> * @param image       Values to smooth</span></div>
+<div class="line"><a name="l17106"></a><span class="lineno">17106</span> <span class="comment"> * @param order       Order of fitting polynomial</span></div>
+<div class="line"><a name="l17107"></a><span class="lineno">17107</span> <span class="comment"> * @param hw          Half width of smoothing window</span></div>
+<div class="line"><a name="l17108"></a><span class="lineno">17108</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l17109"></a><span class="lineno">17109</span> <span class="comment"> * @return Smoothed image, or NULL on failure.</span></div>
+<div class="line"><a name="l17110"></a><span class="lineno">17110</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l17111"></a><span class="lineno">17111</span> <span class="comment"> * Heavily smooth and fit data in the input Nx1 size @em image.</span></div>
+<div class="line"><a name="l17112"></a><span class="lineno">17112</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l17113"></a><span class="lineno">17113</span> </div>
+<div class="line"><a name="l17114"></a><span class="lineno">17114</span> <span class="keyword">static</span> cpl_image *polysmooth(cpl_image *image, <span class="keywordtype">int</span> order, <span class="keywordtype">int</span> hw)</div>
+<div class="line"><a name="l17115"></a><span class="lineno">17115</span> {</div>
+<div class="line"><a name="l17116"></a><span class="lineno">17116</span>     <span class="keywordtype">int</span>             npoints;</div>
+<div class="line"><a name="l17117"></a><span class="lineno">17117</span>     cpl_vector     *x;</div>
+<div class="line"><a name="l17118"></a><span class="lineno">17118</span>     cpl_vector     *y;</div>
+<div class="line"><a name="l17119"></a><span class="lineno">17119</span>     <span class="keywordtype">double</span>         *xdata;</div>
+<div class="line"><a name="l17120"></a><span class="lineno">17120</span>     <span class="keywordtype">double</span>         *ydata;</div>
+<div class="line"><a name="l17121"></a><span class="lineno">17121</span>     cpl_polynomial *poly;</div>
+<div class="line"><a name="l17122"></a><span class="lineno">17122</span>     cpl_vector     *ysmooth;</div>
+<div class="line"><a name="l17123"></a><span class="lineno">17123</span>     cpl_image      *smoothed;</div>
+<div class="line"><a name="l17124"></a><span class="lineno">17124</span>     <span class="keywordtype">float</span>          *sdata;</div>
+<div class="line"><a name="l17125"></a><span class="lineno">17125</span>     <span class="keywordtype">int</span>             i;</div>
+<div class="line"><a name="l17126"></a><span class="lineno">17126</span> </div>
+<div class="line"><a name="l17127"></a><span class="lineno">17127</span> </div>
+<div class="line"><a name="l17128"></a><span class="lineno">17128</span>     npoints = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l17129"></a><span class="lineno">17129</span> </div>
+<div class="line"><a name="l17130"></a><span class="lineno">17130</span>     <span class="keywordflow">if</span> (2 * hw + 1 > npoints)</div>
+<div class="line"><a name="l17131"></a><span class="lineno">17131</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17132"></a><span class="lineno">17132</span> </div>
+<div class="line"><a name="l17133"></a><span class="lineno">17133</span>     x       = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l17134"></a><span class="lineno">17134</span>     y       = cpl_vector_new(npoints);</div>
+<div class="line"><a name="l17135"></a><span class="lineno">17135</span>     xdata   = cpl_vector_get_data(x);</div>
+<div class="line"><a name="l17136"></a><span class="lineno">17136</span>     ydata   = cpl_vector_get_data(y);</div>
+<div class="line"><a name="l17137"></a><span class="lineno">17137</span> </div>
+<div class="line"><a name="l17138"></a><span class="lineno">17138</span>     smoothed = cpl_image_duplicate(image);</div>
+<div class="line"><a name="l17139"></a><span class="lineno">17139</span>     sdata = cpl_image_get_data_float(smoothed);</div>
+<div class="line"><a name="l17140"></a><span class="lineno">17140</span> </div>
+<div class="line"><a name="l17141"></a><span class="lineno">17141</span>     <span class="keywordflow">for</span> (i = 0; i < npoints; i++) {</div>
+<div class="line"><a name="l17142"></a><span class="lineno">17142</span>         xdata[i] = i;</div>
+<div class="line"><a name="l17143"></a><span class="lineno">17143</span>         ydata[i] = sdata[i];</div>
+<div class="line"><a name="l17144"></a><span class="lineno">17144</span>     }</div>
+<div class="line"><a name="l17145"></a><span class="lineno">17145</span> </div>
+<div class="line"><a name="l17146"></a><span class="lineno">17146</span>     ysmooth = cpl_vector_filter_median_create(y, hw);</div>
+<div class="line"><a name="l17147"></a><span class="lineno">17147</span>     cpl_vector_delete(y);</div>
+<div class="line"><a name="l17148"></a><span class="lineno">17148</span> </div>
+<div class="line"><a name="l17149"></a><span class="lineno">17149</span>     poly = cpl_polynomial_fit_1d_create(x, ysmooth, order, NULL);</div>
+<div class="line"><a name="l17150"></a><span class="lineno">17150</span>     cpl_vector_delete(x);</div>
+<div class="line"><a name="l17151"></a><span class="lineno">17151</span>     cpl_vector_delete(ysmooth);</div>
+<div class="line"><a name="l17152"></a><span class="lineno">17152</span> </div>
+<div class="line"><a name="l17153"></a><span class="lineno">17153</span>     <span class="keywordflow">if</span> (poly) {</div>
+<div class="line"><a name="l17154"></a><span class="lineno">17154</span>         <span class="keywordflow">for</span> (i = 0; i < npoints; i++)</div>
+<div class="line"><a name="l17155"></a><span class="lineno">17155</span>             sdata[i] = cpl_polynomial_eval_1d(poly, i, NULL);</div>
+<div class="line"><a name="l17156"></a><span class="lineno">17156</span>     </div>
+<div class="line"><a name="l17157"></a><span class="lineno">17157</span>         cpl_polynomial_delete(poly);</div>
+<div class="line"><a name="l17158"></a><span class="lineno">17158</span>     }</div>
+<div class="line"><a name="l17159"></a><span class="lineno">17159</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l17160"></a><span class="lineno">17160</span>         cpl_image_delete(smoothed);</div>
+<div class="line"><a name="l17161"></a><span class="lineno">17161</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17162"></a><span class="lineno">17162</span>     }</div>
+<div class="line"><a name="l17163"></a><span class="lineno">17163</span> </div>
+<div class="line"><a name="l17164"></a><span class="lineno">17164</span>     <span class="keywordflow">return</span> smoothed;</div>
+<div class="line"><a name="l17165"></a><span class="lineno">17165</span> }</div>
+<div class="line"><a name="l17166"></a><span class="lineno">17166</span> </div>
+<div class="line"><a name="l17167"></a><span class="lineno">17167</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l17168"></a><span class="lineno">17168</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup                       \</span></div>
+<div class="line"><a name="l17169"></a><span class="lineno">17169</span> <span class="preprocessor">do {                                  \</span></div>
+<div class="line"><a name="l17170"></a><span class="lineno">17170</span> <span class="preprocessor">    cpl_image_delete(spectrum);       \</span></div>
+<div class="line"><a name="l17171"></a><span class="lineno">17171</span> <span class="preprocessor">    cpl_image_delete(flux);           \</span></div>
+<div class="line"><a name="l17172"></a><span class="lineno">17172</span> <span class="preprocessor">    cpl_image_delete(efficiency);     \</span></div>
+<div class="line"><a name="l17173"></a><span class="lineno">17173</span> <span class="preprocessor">    cpl_image_delete(smo_efficiency); \</span></div>
+<div class="line"><a name="l17174"></a><span class="lineno">17174</span> <span class="preprocessor">    cpl_image_delete(extinction);     \</span></div>
+<div class="line"><a name="l17175"></a><span class="lineno">17175</span> <span class="preprocessor">    cpl_image_delete(response);       \</span></div>
+<div class="line"><a name="l17176"></a><span class="lineno">17176</span> <span class="preprocessor">    cpl_image_delete(smo_response);   \</span></div>
+<div class="line"><a name="l17177"></a><span class="lineno">17177</span> <span class="preprocessor">    cpl_image_delete(physical);       \</span></div>
+<div class="line"><a name="l17178"></a><span class="lineno">17178</span> <span class="preprocessor">} while (0)</span></div>
+<div class="line"><a name="l17179"></a><span class="lineno">17179</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l17203"></a><span class="lineno"><a class="code" href="group__moses.html#gaad62d9ba866b8abafb2da02053584bf2">17203</a></span> cpl_table *<a class="code" href="group__moses.html#gaad62d9ba866b8abafb2da02053584bf2" title="Produce instrument response curve, with some ancillary information.">mos_photometric_calibration</a>(cpl_image *spectra, <span class="keywordtype">double</span> startwave, </div>
+<div class="line"><a name="l17204"></a><span class="lineno">17204</span>                                  <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> gain,</div>
+<div class="line"><a name="l17205"></a><span class="lineno">17205</span>                                  <span class="keywordtype">double</span> exptime, cpl_table *ext_table,</div>
+<div class="line"><a name="l17206"></a><span class="lineno">17206</span>                                  <span class="keywordtype">double</span> airmass, cpl_table *flux_table,</div>
+<div class="line"><a name="l17207"></a><span class="lineno">17207</span>                                  <span class="keywordtype">int</span> order)</div>
+<div class="line"><a name="l17208"></a><span class="lineno">17208</span> {</div>
+<div class="line"><a name="l17209"></a><span class="lineno">17209</span> </div>
+<div class="line"><a name="l17210"></a><span class="lineno">17210</span>     cpl_image *spectrum       = NULL; <span class="comment">// Extracted standard star spectrum</span></div>
+<div class="line"><a name="l17211"></a><span class="lineno">17211</span>     <span class="keywordtype">float</span>     *data;</div>
+<div class="line"><a name="l17212"></a><span class="lineno">17212</span>     cpl_image *extinction     = NULL; <span class="comment">// Extinction binned as "spectrum"</span></div>
+<div class="line"><a name="l17213"></a><span class="lineno">17213</span>     <span class="keywordtype">float</span>     *ext_data;</div>
+<div class="line"><a name="l17214"></a><span class="lineno">17214</span>     cpl_image *flux           = NULL; <span class="comment">// Standard star flux binned as "spectrum"</span></div>
+<div class="line"><a name="l17215"></a><span class="lineno">17215</span>     <span class="keywordtype">float</span>     *flux_data;</div>
+<div class="line"><a name="l17216"></a><span class="lineno">17216</span>     cpl_image *physical       = NULL; <span class="comment">// Physical units of above</span></div>
+<div class="line"><a name="l17217"></a><span class="lineno">17217</span>     <span class="keywordtype">float</span>     *phys_data;</div>
+<div class="line"><a name="l17218"></a><span class="lineno">17218</span>     cpl_image *efficiency     = NULL; <span class="comment">// Raw efficiency curve</span></div>
+<div class="line"><a name="l17219"></a><span class="lineno">17219</span>     <span class="keywordtype">float</span>     *eff_data;</div>
+<div class="line"><a name="l17220"></a><span class="lineno">17220</span>     cpl_image *smo_efficiency = NULL; <span class="comment">// Smoothed efficiency curve</span></div>
+<div class="line"><a name="l17221"></a><span class="lineno">17221</span>     <span class="keywordtype">float</span>     *smo_eff_data;</div>
+<div class="line"><a name="l17222"></a><span class="lineno">17222</span>     cpl_image *response       = NULL; <span class="comment">// Raw response curve</span></div>
+<div class="line"><a name="l17223"></a><span class="lineno">17223</span>     <span class="keywordtype">float</span>     *res_data;</div>
+<div class="line"><a name="l17224"></a><span class="lineno">17224</span>     cpl_image *smo_response   = NULL; <span class="comment">// Smoothed response curve</span></div>
+<div class="line"><a name="l17225"></a><span class="lineno">17225</span>     <span class="keywordtype">float</span>     *smo_res_data;</div>
+<div class="line"><a name="l17226"></a><span class="lineno">17226</span>     cpl_image *image;</div>
+<div class="line"><a name="l17227"></a><span class="lineno">17227</span>     cpl_image *smo_image;</div>
+<div class="line"><a name="l17228"></a><span class="lineno">17228</span>     cpl_table *table;</div>
+<div class="line"><a name="l17229"></a><span class="lineno">17229</span>     <span class="keywordtype">float</span>      lambda;</div>
+<div class="line"><a name="l17230"></a><span class="lineno">17230</span>     <span class="keywordtype">int</span>        nx, ny;</div>
+<div class="line"><a name="l17231"></a><span class="lineno">17231</span>     <span class="keywordtype">int</span>        ext_count, ext_pos;</div>
+<div class="line"><a name="l17232"></a><span class="lineno">17232</span>     <span class="keywordtype">int</span>        eff_count, eff_pos;</div>
+<div class="line"><a name="l17233"></a><span class="lineno">17233</span>     <span class="keywordtype">int</span>        flux_count, flux_pos;</div>
+<div class="line"><a name="l17234"></a><span class="lineno">17234</span>     <span class="keywordtype">int</span>        start, end;</div>
+<div class="line"><a name="l17235"></a><span class="lineno">17235</span>     <span class="keywordtype">int</span>        i;</div>
+<div class="line"><a name="l17236"></a><span class="lineno">17236</span> </div>
+<div class="line"><a name="l17237"></a><span class="lineno">17237</span> </div>
+<div class="line"><a name="l17238"></a><span class="lineno">17238</span>     <span class="keywordflow">if</span> (spectra == NULL || ext_table == NULL || flux_table == NULL) {</div>
+<div class="line"><a name="l17239"></a><span class="lineno">17239</span>         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l17240"></a><span class="lineno">17240</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17241"></a><span class="lineno">17241</span>     }</div>
+<div class="line"><a name="l17242"></a><span class="lineno">17242</span> </div>
+<div class="line"><a name="l17243"></a><span class="lineno">17243</span>     <span class="keywordflow">if</span> (!cpl_table_has_column(ext_table, <span class="stringliteral">"WAVE"</span>)) {</div>
+<div class="line"><a name="l17244"></a><span class="lineno">17244</span>         cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l17245"></a><span class="lineno">17245</span>                               <span class="stringliteral">"Column WAVE in atmospheric extinction table"</span>);</div>
+<div class="line"><a name="l17246"></a><span class="lineno">17246</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17247"></a><span class="lineno">17247</span>     }</div>
+<div class="line"><a name="l17248"></a><span class="lineno">17248</span> </div>
+<div class="line"><a name="l17249"></a><span class="lineno">17249</span>     <span class="keywordflow">if</span> (!cpl_table_has_column(ext_table, <span class="stringliteral">"EXTINCTION"</span>)) {</div>
+<div class="line"><a name="l17250"></a><span class="lineno">17250</span>         cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l17251"></a><span class="lineno">17251</span>                         <span class="stringliteral">"Column EXTINCTION in atmospheric extinction table"</span>);</div>
+<div class="line"><a name="l17252"></a><span class="lineno">17252</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17253"></a><span class="lineno">17253</span>     }</div>
+<div class="line"><a name="l17254"></a><span class="lineno">17254</span> </div>
+<div class="line"><a name="l17255"></a><span class="lineno">17255</span>     <span class="keywordflow">if</span> (!cpl_table_has_column(flux_table, <span class="stringliteral">"WAVE"</span>)) {</div>
+<div class="line"><a name="l17256"></a><span class="lineno">17256</span>         cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l17257"></a><span class="lineno">17257</span>                               <span class="stringliteral">"Column WAVE in standard star flux table"</span>);</div>
+<div class="line"><a name="l17258"></a><span class="lineno">17258</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17259"></a><span class="lineno">17259</span>     }</div>
+<div class="line"><a name="l17260"></a><span class="lineno">17260</span> </div>
+<div class="line"><a name="l17261"></a><span class="lineno">17261</span>     <span class="keywordflow">if</span> (!cpl_table_has_column(flux_table, <span class="stringliteral">"FLUX"</span>)) {</div>
+<div class="line"><a name="l17262"></a><span class="lineno">17262</span>         cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND,</div>
+<div class="line"><a name="l17263"></a><span class="lineno">17263</span>                               <span class="stringliteral">"Column FLUX in standard star flux table"</span>);</div>
+<div class="line"><a name="l17264"></a><span class="lineno">17264</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17265"></a><span class="lineno">17265</span>     }</div>
+<div class="line"><a name="l17266"></a><span class="lineno">17266</span> </div>
+<div class="line"><a name="l17267"></a><span class="lineno">17267</span>     <span class="keywordflow">if</span> (gain < 0.1) {</div>
+<div class="line"><a name="l17268"></a><span class="lineno">17268</span>         cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l17269"></a><span class="lineno">17269</span>                               <span class="stringliteral">"Invalid gain factor (%.2f)"</span>, gain);</div>
+<div class="line"><a name="l17270"></a><span class="lineno">17270</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17271"></a><span class="lineno">17271</span>     }</div>
+<div class="line"><a name="l17272"></a><span class="lineno">17272</span> </div>
+<div class="line"><a name="l17273"></a><span class="lineno">17273</span>     <span class="keywordflow">if</span> (exptime < 0.001) {</div>
+<div class="line"><a name="l17274"></a><span class="lineno">17274</span>         cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l17275"></a><span class="lineno">17275</span>                               <span class="stringliteral">"Invalid exposure time (%.2f)"</span>, exptime);</div>
+<div class="line"><a name="l17276"></a><span class="lineno">17276</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17277"></a><span class="lineno">17277</span>     }</div>
+<div class="line"><a name="l17278"></a><span class="lineno">17278</span> </div>
+<div class="line"><a name="l17279"></a><span class="lineno">17279</span>     <span class="keywordflow">if</span> (dispersion < 0.001) {</div>
+<div class="line"><a name="l17280"></a><span class="lineno">17280</span>         cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l17281"></a><span class="lineno">17281</span>                               <span class="stringliteral">"Invalid dispersion (%.2f)"</span>, dispersion);</div>
+<div class="line"><a name="l17282"></a><span class="lineno">17282</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17283"></a><span class="lineno">17283</span>     }</div>
+<div class="line"><a name="l17284"></a><span class="lineno">17284</span> </div>
+<div class="line"><a name="l17285"></a><span class="lineno">17285</span>     <span class="keywordflow">if</span> (order < 2) {</div>
+<div class="line"><a name="l17286"></a><span class="lineno">17286</span>         cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,</div>
+<div class="line"><a name="l17287"></a><span class="lineno">17287</span>                               <span class="stringliteral">"Order of the polynomial fitting the "</span></div>
+<div class="line"><a name="l17288"></a><span class="lineno">17288</span>                               <span class="stringliteral">"instrument response must be at least 2"</span>);</div>
+<div class="line"><a name="l17289"></a><span class="lineno">17289</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17290"></a><span class="lineno">17290</span>     }</div>
+<div class="line"><a name="l17291"></a><span class="lineno">17291</span> </div>
+<div class="line"><a name="l17292"></a><span class="lineno">17292</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l17293"></a><span class="lineno">17293</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l17294"></a><span class="lineno">17294</span> </div>
+<div class="line"><a name="l17295"></a><span class="lineno">17295</span> </div>
+<div class="line"><a name="l17296"></a><span class="lineno">17296</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17297"></a><span class="lineno">17297</span> <span class="comment">     * Find brightest spectrum and duplicate it.</span></div>
+<div class="line"><a name="l17298"></a><span class="lineno">17298</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17299"></a><span class="lineno">17299</span> </div>
+<div class="line"><a name="l17300"></a><span class="lineno">17300</span>     <span class="keywordflow">if</span> (ny == 1) {</div>
+<div class="line"><a name="l17301"></a><span class="lineno">17301</span>         spectrum = cpl_image_duplicate(spectra);</div>
+<div class="line"><a name="l17302"></a><span class="lineno">17302</span>     }</div>
+<div class="line"><a name="l17303"></a><span class="lineno">17303</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l17304"></a><span class="lineno">17304</span>         cpl_size        x, y;</div>
+<div class="line"><a name="l17305"></a><span class="lineno">17305</span>         cpl_image *brights = cpl_image_collapse_create(spectra, 1);</div>
+<div class="line"><a name="l17306"></a><span class="lineno">17306</span> </div>
+<div class="line"><a name="l17307"></a><span class="lineno">17307</span>         cpl_image_get_maxpos(brights, &x, &y);</div>
+<div class="line"><a name="l17308"></a><span class="lineno">17308</span>         cpl_image_delete(brights);</div>
+<div class="line"><a name="l17309"></a><span class="lineno">17309</span>         spectrum = cpl_image_extract(spectra, 1, y, nx, y);</div>
+<div class="line"><a name="l17310"></a><span class="lineno">17310</span>     }</div>
+<div class="line"><a name="l17311"></a><span class="lineno">17311</span> </div>
+<div class="line"><a name="l17312"></a><span class="lineno">17312</span> </div>
+<div class="line"><a name="l17313"></a><span class="lineno">17313</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17314"></a><span class="lineno">17314</span> <span class="comment">     * Convert standard star spectrum in electrons per second per Angstrom.</span></div>
+<div class="line"><a name="l17315"></a><span class="lineno">17315</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17316"></a><span class="lineno">17316</span> </div>
+<div class="line"><a name="l17317"></a><span class="lineno">17317</span>     cpl_image_multiply_scalar(spectrum, gain / exptime / dispersion);</div>
+<div class="line"><a name="l17318"></a><span class="lineno">17318</span> </div>
+<div class="line"><a name="l17319"></a><span class="lineno">17319</span> </div>
+<div class="line"><a name="l17320"></a><span class="lineno">17320</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17321"></a><span class="lineno">17321</span> <span class="comment">     * Map the atmospheric extinction factors to the same lambda sampling</span></div>
+<div class="line"><a name="l17322"></a><span class="lineno">17322</span> <span class="comment">     * of the extracted spectrum.</span></div>
+<div class="line"><a name="l17323"></a><span class="lineno">17323</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17324"></a><span class="lineno">17324</span> </div>
+<div class="line"><a name="l17325"></a><span class="lineno">17325</span>     extinction = cpl_image_duplicate(spectrum);</div>
+<div class="line"><a name="l17326"></a><span class="lineno">17326</span>     map_table(extinction, startwave + dispersion/2, dispersion, </div>
+<div class="line"><a name="l17327"></a><span class="lineno">17327</span>               ext_table, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"EXTINCTION"</span>);</div>
+<div class="line"><a name="l17328"></a><span class="lineno">17328</span> </div>
+<div class="line"><a name="l17329"></a><span class="lineno">17329</span> </div>
+<div class="line"><a name="l17330"></a><span class="lineno">17330</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17331"></a><span class="lineno">17331</span> <span class="comment">     * Convert from magnitudes to actual flux loss.</span></div>
+<div class="line"><a name="l17332"></a><span class="lineno">17332</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17333"></a><span class="lineno">17333</span> </div>
+<div class="line"><a name="l17334"></a><span class="lineno">17334</span>     cpl_image_multiply_scalar(extinction, 0.4 * airmass);</div>
+<div class="line"><a name="l17335"></a><span class="lineno">17335</span>     cpl_image_exponential(extinction, 10.);</div>
+<div class="line"><a name="l17336"></a><span class="lineno">17336</span> </div>
+<div class="line"><a name="l17337"></a><span class="lineno">17337</span> </div>
+<div class="line"><a name="l17338"></a><span class="lineno">17338</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17339"></a><span class="lineno">17339</span> <span class="comment">     * Correct the scientific spectrum to airmass 0</span></div>
+<div class="line"><a name="l17340"></a><span class="lineno">17340</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17341"></a><span class="lineno">17341</span> </div>
+<div class="line"><a name="l17342"></a><span class="lineno">17342</span>     cpl_image_multiply(spectrum, extinction);</div>
+<div class="line"><a name="l17343"></a><span class="lineno">17343</span> </div>
+<div class="line"><a name="l17344"></a><span class="lineno">17344</span> </div>
+<div class="line"><a name="l17345"></a><span class="lineno">17345</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17346"></a><span class="lineno">17346</span> <span class="comment">     * Find in what pixel interval (start at "ext_pos", for "ext_count" </span></div>
+<div class="line"><a name="l17347"></a><span class="lineno">17347</span> <span class="comment">     * pixels) the atmospheric extinction is available.</span></div>
+<div class="line"><a name="l17348"></a><span class="lineno">17348</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17349"></a><span class="lineno">17349</span>     </div>
+<div class="line"><a name="l17350"></a><span class="lineno">17350</span>     ext_data = cpl_image_get_data_float(extinction);</div>
+<div class="line"><a name="l17351"></a><span class="lineno">17351</span> </div>
+<div class="line"><a name="l17352"></a><span class="lineno">17352</span>     ext_count = 0;</div>
+<div class="line"><a name="l17353"></a><span class="lineno">17353</span>     ext_pos = 0;</div>
+<div class="line"><a name="l17354"></a><span class="lineno">17354</span>     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {</div>
+<div class="line"><a name="l17355"></a><span class="lineno">17355</span>         <span class="keywordflow">if</span> (ext_data[i] > 0.0) {</div>
+<div class="line"><a name="l17356"></a><span class="lineno">17356</span>             <span class="keywordflow">if</span> (ext_count == 0) {</div>
+<div class="line"><a name="l17357"></a><span class="lineno">17357</span>                 ext_pos = i;</div>
+<div class="line"><a name="l17358"></a><span class="lineno">17358</span>             }</div>
+<div class="line"><a name="l17359"></a><span class="lineno">17359</span>             ext_count++;</div>
+<div class="line"><a name="l17360"></a><span class="lineno">17360</span>         }</div>
+<div class="line"><a name="l17361"></a><span class="lineno">17361</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l17362"></a><span class="lineno">17362</span>             <span class="keywordflow">if</span> (ext_count) {</div>
+<div class="line"><a name="l17363"></a><span class="lineno">17363</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l17364"></a><span class="lineno">17364</span>             }</div>
+<div class="line"><a name="l17365"></a><span class="lineno">17365</span>         }</div>
+<div class="line"><a name="l17366"></a><span class="lineno">17366</span>     }</div>
+<div class="line"><a name="l17367"></a><span class="lineno">17367</span> </div>
+<div class="line"><a name="l17368"></a><span class="lineno">17368</span>     cpl_image_delete(extinction); extinction = NULL;</div>
+<div class="line"><a name="l17369"></a><span class="lineno">17369</span> </div>
+<div class="line"><a name="l17370"></a><span class="lineno">17370</span> </div>
+<div class="line"><a name="l17371"></a><span class="lineno">17371</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17372"></a><span class="lineno">17372</span> <span class="comment">     * Map the standard star catalog flux to the same lambda sampling</span></div>
+<div class="line"><a name="l17373"></a><span class="lineno">17373</span> <span class="comment">     * of the extracted spectrum.</span></div>
+<div class="line"><a name="l17374"></a><span class="lineno">17374</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17375"></a><span class="lineno">17375</span> </div>
+<div class="line"><a name="l17376"></a><span class="lineno">17376</span>     flux = cpl_image_duplicate(spectrum);</div>
+<div class="line"><a name="l17377"></a><span class="lineno">17377</span>     map_table(flux, startwave + dispersion/2, dispersion, </div>
+<div class="line"><a name="l17378"></a><span class="lineno">17378</span>               flux_table, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"FLUX"</span>);</div>
+<div class="line"><a name="l17379"></a><span class="lineno">17379</span> </div>
+<div class="line"><a name="l17380"></a><span class="lineno">17380</span> </div>
+<div class="line"><a name="l17381"></a><span class="lineno">17381</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17382"></a><span class="lineno">17382</span> <span class="comment">     * Find in what pixel interval (start at "flux_pos", for "flux_count" </span></div>
+<div class="line"><a name="l17383"></a><span class="lineno">17383</span> <span class="comment">     * pixels) the standard star flux is available.</span></div>
+<div class="line"><a name="l17384"></a><span class="lineno">17384</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17385"></a><span class="lineno">17385</span>     </div>
+<div class="line"><a name="l17386"></a><span class="lineno">17386</span>     flux_data = cpl_image_get_data_float(flux);</div>
+<div class="line"><a name="l17387"></a><span class="lineno">17387</span> </div>
+<div class="line"><a name="l17388"></a><span class="lineno">17388</span>     flux_count = 0;</div>
+<div class="line"><a name="l17389"></a><span class="lineno">17389</span>     flux_pos = 0;</div>
+<div class="line"><a name="l17390"></a><span class="lineno">17390</span>     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {</div>
+<div class="line"><a name="l17391"></a><span class="lineno">17391</span>         <span class="keywordflow">if</span> (flux_data[i] > 0.0) {</div>
+<div class="line"><a name="l17392"></a><span class="lineno">17392</span>             <span class="keywordflow">if</span> (flux_count == 0) {</div>
+<div class="line"><a name="l17393"></a><span class="lineno">17393</span>                 flux_pos = i;</div>
+<div class="line"><a name="l17394"></a><span class="lineno">17394</span>             }</div>
+<div class="line"><a name="l17395"></a><span class="lineno">17395</span>             flux_count++;</div>
+<div class="line"><a name="l17396"></a><span class="lineno">17396</span>         }</div>
+<div class="line"><a name="l17397"></a><span class="lineno">17397</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l17398"></a><span class="lineno">17398</span>             <span class="keywordflow">if</span> (flux_count) {</div>
+<div class="line"><a name="l17399"></a><span class="lineno">17399</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l17400"></a><span class="lineno">17400</span>             }</div>
+<div class="line"><a name="l17401"></a><span class="lineno">17401</span>         }</div>
+<div class="line"><a name="l17402"></a><span class="lineno">17402</span>     }</div>
+<div class="line"><a name="l17403"></a><span class="lineno">17403</span> </div>
+<div class="line"><a name="l17404"></a><span class="lineno">17404</span> </div>
+<div class="line"><a name="l17405"></a><span class="lineno">17405</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17406"></a><span class="lineno">17406</span> <span class="comment">     * Intersection with previous selection</span></div>
+<div class="line"><a name="l17407"></a><span class="lineno">17407</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17408"></a><span class="lineno">17408</span> </div>
+<div class="line"><a name="l17409"></a><span class="lineno">17409</span>     start      = ext_pos > flux_pos ? ext_pos : flux_pos;</div>
+<div class="line"><a name="l17410"></a><span class="lineno">17410</span>     end        = (ext_pos + ext_count) < (flux_pos + flux_count) ?</div>
+<div class="line"><a name="l17411"></a><span class="lineno">17411</span>                  (ext_pos + ext_count) : (flux_pos + flux_count);</div>
+<div class="line"><a name="l17412"></a><span class="lineno">17412</span>     flux_pos   = start;</div>
+<div class="line"><a name="l17413"></a><span class="lineno">17413</span>     flux_count = end - start;</div>
+<div class="line"><a name="l17414"></a><span class="lineno">17414</span> </div>
+<div class="line"><a name="l17415"></a><span class="lineno">17415</span> </div>
+<div class="line"><a name="l17416"></a><span class="lineno">17416</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17417"></a><span class="lineno">17417</span> <span class="comment">     * Convert the flux to photons (per second per Angstrom).</span></div>
+<div class="line"><a name="l17418"></a><span class="lineno">17418</span> <span class="comment">     * std_flux is in units of erg / cm^2 / s / Angstrom. This</span></div>
+<div class="line"><a name="l17419"></a><span class="lineno">17419</span> <span class="comment">     * must be multiplied by the efficient area of the telescope,</span></div>
+<div class="line"><a name="l17420"></a><span class="lineno">17420</span> <span class="comment">     * 5.18E+5 cm^2, and divided by hv (v = frequency). With </span></div>
+<div class="line"><a name="l17421"></a><span class="lineno">17421</span> <span class="comment">     * hc = 1.98E-8 erg*Angstrom one obtains the following:</span></div>
+<div class="line"><a name="l17422"></a><span class="lineno">17422</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17423"></a><span class="lineno">17423</span> </div>
+<div class="line"><a name="l17424"></a><span class="lineno">17424</span>     physical = cpl_image_duplicate(spectrum);</div>
+<div class="line"><a name="l17425"></a><span class="lineno">17425</span>     phys_data = cpl_image_get_data_float(physical);</div>
+<div class="line"><a name="l17426"></a><span class="lineno">17426</span> </div>
+<div class="line"><a name="l17427"></a><span class="lineno">17427</span>     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {</div>
+<div class="line"><a name="l17428"></a><span class="lineno">17428</span>         lambda = startwave + dispersion * (i + 0.5);</div>
+<div class="line"><a name="l17429"></a><span class="lineno">17429</span>         phys_data[i] = 0.0026 * lambda * flux_data[i];</div>
+<div class="line"><a name="l17430"></a><span class="lineno">17430</span>     }</div>
+<div class="line"><a name="l17431"></a><span class="lineno">17431</span> </div>
+<div class="line"><a name="l17432"></a><span class="lineno">17432</span>     efficiency = cpl_image_duplicate(spectrum);</div>
+<div class="line"><a name="l17433"></a><span class="lineno">17433</span>     eff_data = cpl_image_get_data_float(efficiency);</div>
+<div class="line"><a name="l17434"></a><span class="lineno">17434</span>     data = cpl_image_get_data_float(spectrum);</div>
+<div class="line"><a name="l17435"></a><span class="lineno">17435</span> </div>
+<div class="line"><a name="l17436"></a><span class="lineno">17436</span>     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {</div>
+<div class="line"><a name="l17437"></a><span class="lineno">17437</span>         <span class="keywordflow">if</span> (phys_data[i] > 0.0)</div>
+<div class="line"><a name="l17438"></a><span class="lineno">17438</span>             eff_data[i] = data[i] / phys_data[i];</div>
+<div class="line"><a name="l17439"></a><span class="lineno">17439</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l17440"></a><span class="lineno">17440</span>             eff_data[i] = 0.0;</div>
+<div class="line"><a name="l17441"></a><span class="lineno">17441</span>     }</div>
+<div class="line"><a name="l17442"></a><span class="lineno">17442</span> </div>
+<div class="line"><a name="l17443"></a><span class="lineno">17443</span>     cpl_image_delete(physical); physical = NULL;</div>
+<div class="line"><a name="l17444"></a><span class="lineno">17444</span> </div>
+<div class="line"><a name="l17445"></a><span class="lineno">17445</span> </div>
+<div class="line"><a name="l17446"></a><span class="lineno">17446</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17447"></a><span class="lineno">17447</span> <span class="comment">     * Find interval (longer than 300 pixels) where efficiency is </span></div>
+<div class="line"><a name="l17448"></a><span class="lineno">17448</span> <span class="comment">     * greater than 1%</span></div>
+<div class="line"><a name="l17449"></a><span class="lineno">17449</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17450"></a><span class="lineno">17450</span> </div>
+<div class="line"><a name="l17451"></a><span class="lineno">17451</span>     eff_count = 0;</div>
+<div class="line"><a name="l17452"></a><span class="lineno">17452</span>     eff_pos = 0;</div>
+<div class="line"><a name="l17453"></a><span class="lineno">17453</span>     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {</div>
+<div class="line"><a name="l17454"></a><span class="lineno">17454</span>         <span class="keywordflow">if</span> (eff_data[i] > 0.01) {</div>
+<div class="line"><a name="l17455"></a><span class="lineno">17455</span>             <span class="keywordflow">if</span> (eff_count == 0) {</div>
+<div class="line"><a name="l17456"></a><span class="lineno">17456</span>                 eff_pos = i; </div>
+<div class="line"><a name="l17457"></a><span class="lineno">17457</span>             }</div>
+<div class="line"><a name="l17458"></a><span class="lineno">17458</span>             eff_count++;</div>
+<div class="line"><a name="l17459"></a><span class="lineno">17459</span>         }</div>
+<div class="line"><a name="l17460"></a><span class="lineno">17460</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l17461"></a><span class="lineno">17461</span>             <span class="keywordflow">if</span> (eff_count > 300) {</div>
+<div class="line"><a name="l17462"></a><span class="lineno">17462</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l17463"></a><span class="lineno">17463</span>             }</div>
+<div class="line"><a name="l17464"></a><span class="lineno">17464</span>         }</div>
+<div class="line"><a name="l17465"></a><span class="lineno">17465</span>     }</div>
+<div class="line"><a name="l17466"></a><span class="lineno">17466</span> </div>
+<div class="line"><a name="l17467"></a><span class="lineno">17467</span> </div>
+<div class="line"><a name="l17468"></a><span class="lineno">17468</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17469"></a><span class="lineno">17469</span> <span class="comment">     * Intersection with previous selection</span></div>
+<div class="line"><a name="l17470"></a><span class="lineno">17470</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17471"></a><span class="lineno">17471</span> </div>
+<div class="line"><a name="l17472"></a><span class="lineno">17472</span>     start      = eff_pos > flux_pos ? eff_pos : flux_pos;</div>
+<div class="line"><a name="l17473"></a><span class="lineno">17473</span>     end        = (eff_pos + eff_count) < (flux_pos + flux_count) ?</div>
+<div class="line"><a name="l17474"></a><span class="lineno">17474</span>                  (eff_pos + eff_count) : (flux_pos + flux_count);</div>
+<div class="line"><a name="l17475"></a><span class="lineno">17475</span>     eff_pos    = start;</div>
+<div class="line"><a name="l17476"></a><span class="lineno">17476</span>     eff_count  = end - start;</div>
+<div class="line"><a name="l17477"></a><span class="lineno">17477</span> </div>
+<div class="line"><a name="l17478"></a><span class="lineno">17478</span>     <span class="keywordflow">if</span> (eff_count < 1) {</div>
+<div class="line"><a name="l17479"></a><span class="lineno">17479</span>         cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,</div>
+<div class="line"><a name="l17480"></a><span class="lineno">17480</span>                               <span class="stringliteral">"No overlap between catalog and spectrum"</span>);</div>
+<div class="line"><a name="l17481"></a><span class="lineno">17481</span>         cleanup;</div>
+<div class="line"><a name="l17482"></a><span class="lineno">17482</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17483"></a><span class="lineno">17483</span>     }</div>
+<div class="line"><a name="l17484"></a><span class="lineno">17484</span> </div>
+<div class="line"><a name="l17485"></a><span class="lineno">17485</span> </div>
+<div class="line"><a name="l17486"></a><span class="lineno">17486</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17487"></a><span class="lineno">17487</span> <span class="comment">     * Extract only data to fit, i.e., where the efficiency is available.</span></div>
+<div class="line"><a name="l17488"></a><span class="lineno">17488</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17489"></a><span class="lineno">17489</span> </div>
+<div class="line"><a name="l17490"></a><span class="lineno">17490</span>     image = cpl_image_extract(efficiency, eff_pos + 1, 1, </div>
+<div class="line"><a name="l17491"></a><span class="lineno">17491</span>                               eff_pos + eff_count, 1);</div>
+<div class="line"><a name="l17492"></a><span class="lineno">17492</span> </div>
+<div class="line"><a name="l17493"></a><span class="lineno">17493</span>     smo_image = polysmooth(image, order, 50);</div>
+<div class="line"><a name="l17494"></a><span class="lineno">17494</span>     cpl_image_delete(image);</div>
+<div class="line"><a name="l17495"></a><span class="lineno">17495</span> </div>
+<div class="line"><a name="l17496"></a><span class="lineno">17496</span>     smo_efficiency = cpl_image_duplicate(efficiency);</div>
+<div class="line"><a name="l17497"></a><span class="lineno">17497</span>     smo_eff_data = cpl_image_get_data_float(smo_efficiency);</div>
+<div class="line"><a name="l17498"></a><span class="lineno">17498</span>     cpl_image_copy(smo_efficiency, smo_image, eff_pos + 1, 1);</div>
+<div class="line"><a name="l17499"></a><span class="lineno">17499</span> </div>
+<div class="line"><a name="l17500"></a><span class="lineno">17500</span>     cpl_image_delete(smo_image);</div>
+<div class="line"><a name="l17501"></a><span class="lineno">17501</span> </div>
+<div class="line"><a name="l17502"></a><span class="lineno">17502</span> </div>
+<div class="line"><a name="l17503"></a><span class="lineno">17503</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17504"></a><span class="lineno">17504</span> <span class="comment">     * Compute instrument response as the ratio between the catalog</span></div>
+<div class="line"><a name="l17505"></a><span class="lineno">17505</span> <span class="comment">     * spectrum and the observed spectrum (converted in physical units).</span></div>
+<div class="line"><a name="l17506"></a><span class="lineno">17506</span> <span class="comment">     * The polynomial smoothing, however, is performed on the inverse</span></div>
+<div class="line"><a name="l17507"></a><span class="lineno">17507</span> <span class="comment">     * of this ration, for obvious reasons (i.e., no divergence at zero</span></div>
+<div class="line"><a name="l17508"></a><span class="lineno">17508</span> <span class="comment">     * efficiency).</span></div>
+<div class="line"><a name="l17509"></a><span class="lineno">17509</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17510"></a><span class="lineno">17510</span> </div>
+<div class="line"><a name="l17511"></a><span class="lineno">17511</span>     response = cpl_image_duplicate(spectrum);</div>
+<div class="line"><a name="l17512"></a><span class="lineno">17512</span>     res_data = cpl_image_get_data_float(response);</div>
+<div class="line"><a name="l17513"></a><span class="lineno">17513</span> </div>
+<div class="line"><a name="l17514"></a><span class="lineno">17514</span>     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {</div>
+<div class="line"><a name="l17515"></a><span class="lineno">17515</span>         <span class="keywordflow">if</span> (eff_data[i] > 0.01 && flux_data[i] > 0.0)</div>
+<div class="line"><a name="l17516"></a><span class="lineno">17516</span>             res_data[i] = data[i] / flux_data[i];</div>
+<div class="line"><a name="l17517"></a><span class="lineno">17517</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l17518"></a><span class="lineno">17518</span>             res_data[i] = 0.0;</div>
+<div class="line"><a name="l17519"></a><span class="lineno">17519</span>     }</div>
+<div class="line"><a name="l17520"></a><span class="lineno">17520</span> </div>
+<div class="line"><a name="l17521"></a><span class="lineno">17521</span> </div>
+<div class="line"><a name="l17522"></a><span class="lineno">17522</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17523"></a><span class="lineno">17523</span> <span class="comment">     * Extract only data to fit, i.e., where the response is available.</span></div>
+<div class="line"><a name="l17524"></a><span class="lineno">17524</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17525"></a><span class="lineno">17525</span> </div>
+<div class="line"><a name="l17526"></a><span class="lineno">17526</span>     image = cpl_image_extract(response, eff_pos + 1, 1, eff_pos + eff_count, 1);</div>
+<div class="line"><a name="l17527"></a><span class="lineno">17527</span> </div>
+<div class="line"><a name="l17528"></a><span class="lineno">17528</span>     smo_image = polysmooth(image, order, 50);</div>
+<div class="line"><a name="l17529"></a><span class="lineno">17529</span>     cpl_image_delete(image);</div>
+<div class="line"><a name="l17530"></a><span class="lineno">17530</span> </div>
+<div class="line"><a name="l17531"></a><span class="lineno">17531</span>     smo_response = cpl_image_duplicate(response);</div>
+<div class="line"><a name="l17532"></a><span class="lineno">17532</span>     smo_res_data = cpl_image_get_data_float(smo_response);</div>
+<div class="line"><a name="l17533"></a><span class="lineno">17533</span>     cpl_image_copy(smo_response, smo_image, eff_pos + 1, 1);</div>
+<div class="line"><a name="l17534"></a><span class="lineno">17534</span> </div>
+<div class="line"><a name="l17535"></a><span class="lineno">17535</span>     cpl_image_delete(smo_image);</div>
+<div class="line"><a name="l17536"></a><span class="lineno">17536</span> </div>
+<div class="line"><a name="l17537"></a><span class="lineno">17537</span>     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {</div>
+<div class="line"><a name="l17538"></a><span class="lineno">17538</span>         <span class="keywordflow">if</span> (eff_data[i] > 0.01) {</div>
+<div class="line"><a name="l17539"></a><span class="lineno">17539</span>             res_data[i] = 1 / res_data[i];</div>
+<div class="line"><a name="l17540"></a><span class="lineno">17540</span>             smo_res_data[i] = 1 / smo_res_data[i];</div>
+<div class="line"><a name="l17541"></a><span class="lineno">17541</span>         }</div>
+<div class="line"><a name="l17542"></a><span class="lineno">17542</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l17543"></a><span class="lineno">17543</span>             res_data[i] = 0.0;</div>
+<div class="line"><a name="l17544"></a><span class="lineno">17544</span>             smo_res_data[i] = 0.0;</div>
+<div class="line"><a name="l17545"></a><span class="lineno">17545</span>         }</div>
+<div class="line"><a name="l17546"></a><span class="lineno">17546</span>     }</div>
+<div class="line"><a name="l17547"></a><span class="lineno">17547</span> </div>
+<div class="line"><a name="l17548"></a><span class="lineno">17548</span> </div>
+<div class="line"><a name="l17549"></a><span class="lineno">17549</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17550"></a><span class="lineno">17550</span> <span class="comment">     * Assemble the product spectrophotometric table.</span></div>
+<div class="line"><a name="l17551"></a><span class="lineno">17551</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17552"></a><span class="lineno">17552</span> </div>
+<div class="line"><a name="l17553"></a><span class="lineno">17553</span>     table = cpl_table_new(nx);</div>
+<div class="line"><a name="l17554"></a><span class="lineno">17554</span> </div>
+<div class="line"><a name="l17555"></a><span class="lineno">17555</span>     cpl_table_new_column(table, <span class="stringliteral">"WAVE"</span>, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17556"></a><span class="lineno">17556</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"Angstrom"</span>);</div>
+<div class="line"><a name="l17557"></a><span class="lineno">17557</span> </div>
+<div class="line"><a name="l17558"></a><span class="lineno">17558</span>     <span class="keywordflow">for</span> (i = 0; i < nx; i++)</div>
+<div class="line"><a name="l17559"></a><span class="lineno">17559</span>         cpl_table_set_float(table, <span class="stringliteral">"WAVE"</span>, i, startwave + dispersion*(i+0.5));</div>
+<div class="line"><a name="l17560"></a><span class="lineno">17560</span> </div>
+<div class="line"><a name="l17561"></a><span class="lineno">17561</span>     cpl_table_new_column(table, <span class="stringliteral">"STD_FLUX"</span>, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17562"></a><span class="lineno">17562</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"STD_FLUX"</span>, </div>
+<div class="line"><a name="l17563"></a><span class="lineno">17563</span>                               <span class="stringliteral">"10^(-16) erg/(cm^2 s Angstrom)"</span>);</div>
+<div class="line"><a name="l17564"></a><span class="lineno">17564</span>     cpl_table_copy_data_float(table, <span class="stringliteral">"STD_FLUX"</span>, flux_data);</div>
+<div class="line"><a name="l17565"></a><span class="lineno">17565</span>     cpl_image_delete(flux); flux = NULL;</div>
+<div class="line"><a name="l17566"></a><span class="lineno">17566</span> </div>
+<div class="line"><a name="l17567"></a><span class="lineno">17567</span>     cpl_table_new_column(table, <span class="stringliteral">"OBS_FLUX"</span>, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17568"></a><span class="lineno">17568</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"OBS_FLUX"</span>, <span class="stringliteral">"electron/(s Angstrom)"</span>);</div>
+<div class="line"><a name="l17569"></a><span class="lineno">17569</span>     cpl_table_copy_data_float(table, <span class="stringliteral">"OBS_FLUX"</span>, data);</div>
+<div class="line"><a name="l17570"></a><span class="lineno">17570</span>     cpl_image_delete(spectrum); spectrum = NULL;</div>
+<div class="line"><a name="l17571"></a><span class="lineno">17571</span> </div>
+<div class="line"><a name="l17572"></a><span class="lineno">17572</span>     cpl_table_new_column(table, <span class="stringliteral">"RAW_EFFICIENCY"</span>, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17573"></a><span class="lineno">17573</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"RAW_EFFICIENCY"</span>, <span class="stringliteral">"electron/photon"</span>);</div>
+<div class="line"><a name="l17574"></a><span class="lineno">17574</span>     cpl_table_copy_data_float(table, <span class="stringliteral">"RAW_EFFICIENCY"</span>, eff_data);</div>
+<div class="line"><a name="l17575"></a><span class="lineno">17575</span>     cpl_image_delete(efficiency); efficiency = NULL;</div>
+<div class="line"><a name="l17576"></a><span class="lineno">17576</span> </div>
+<div class="line"><a name="l17577"></a><span class="lineno">17577</span>     cpl_table_new_column(table, <span class="stringliteral">"EFFICIENCY"</span>, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17578"></a><span class="lineno">17578</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"EFFICIENCY"</span>, <span class="stringliteral">"electron/photon"</span>);</div>
+<div class="line"><a name="l17579"></a><span class="lineno">17579</span>     cpl_table_copy_data_float(table, <span class="stringliteral">"EFFICIENCY"</span>, smo_eff_data);</div>
+<div class="line"><a name="l17580"></a><span class="lineno">17580</span>     cpl_image_delete(smo_efficiency); smo_efficiency = NULL;</div>
+<div class="line"><a name="l17581"></a><span class="lineno">17581</span> </div>
+<div class="line"><a name="l17582"></a><span class="lineno">17582</span>     cpl_table_new_column(table, <span class="stringliteral">"RAW_RESPONSE"</span>, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17583"></a><span class="lineno">17583</span>     cpl_table_set_column_unit(table, <span class="stringliteral">"RAW_RESPONSE"</span>, </div>
+<div class="line"><a name="l17584"></a><span class="lineno">17584</span>                               <span class="stringliteral">"10^(-16) erg/(cm^2 electron)"</span>);</div>
+<div class="line"><a name="l17585"></a><span class="lineno">17585</span>     cpl_table_copy_data_float(table, <span class="stringliteral">"RAW_RESPONSE"</span>, res_data);</div>
+<div class="line"><a name="l17586"></a><span class="lineno">17586</span>     cpl_image_delete(response); response = NULL;</div>
+<div class="line"><a name="l17587"></a><span class="lineno">17587</span> </div>
+<div class="line"><a name="l17588"></a><span class="lineno">17588</span>     cpl_table_new_column(table, <span class="stringliteral">"RESPONSE"</span>, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17589"></a><span class="lineno">17589</span>     cpl_table_set_column_unit(table, </div>
+<div class="line"><a name="l17590"></a><span class="lineno">17590</span>                               <span class="stringliteral">"RESPONSE"</span>, <span class="stringliteral">"10^(-16) erg/(cm^2 electron)"</span>);</div>
+<div class="line"><a name="l17591"></a><span class="lineno">17591</span>     cpl_table_copy_data_float(table, <span class="stringliteral">"RESPONSE"</span>, smo_res_data);</div>
+<div class="line"><a name="l17592"></a><span class="lineno">17592</span>     cpl_image_delete(smo_response); smo_response = NULL;</div>
+<div class="line"><a name="l17593"></a><span class="lineno">17593</span> </div>
+<div class="line"><a name="l17594"></a><span class="lineno">17594</span>     cleanup;</div>
+<div class="line"><a name="l17595"></a><span class="lineno">17595</span> </div>
+<div class="line"><a name="l17596"></a><span class="lineno">17596</span>     <span class="keywordflow">return</span> table;</div>
+<div class="line"><a name="l17597"></a><span class="lineno">17597</span> }</div>
+<div class="line"><a name="l17598"></a><span class="lineno">17598</span> </div>
+<div class="line"><a name="l17599"></a><span class="lineno">17599</span> <span class="keyword">static</span> <span class="keywordtype">double</span> ksigma_vector(cpl_vector *values, </div>
+<div class="line"><a name="l17600"></a><span class="lineno">17600</span>                             <span class="keywordtype">double</span> klow, <span class="keywordtype">double</span> khigh, <span class="keywordtype">int</span> kiter, <span class="keywordtype">int</span> *good)</div>
+<div class="line"><a name="l17601"></a><span class="lineno">17601</span> {</div>
+<div class="line"><a name="l17602"></a><span class="lineno">17602</span>     cpl_vector *accepted;</div>
+<div class="line"><a name="l17603"></a><span class="lineno">17603</span>     <span class="keywordtype">double</span>  mean  = 0.0;</div>
+<div class="line"><a name="l17604"></a><span class="lineno">17604</span>     <span class="keywordtype">double</span>  sigma = 0.0;</div>
+<div class="line"><a name="l17605"></a><span class="lineno">17605</span>     <span class="keywordtype">double</span> *data  = cpl_vector_get_data(values);</div>
+<div class="line"><a name="l17606"></a><span class="lineno">17606</span>     <span class="keywordtype">int</span>     n     = cpl_vector_get_size(values);</div>
+<div class="line"><a name="l17607"></a><span class="lineno">17607</span>     <span class="keywordtype">int</span>     ngood = n;</div>
+<div class="line"><a name="l17608"></a><span class="lineno">17608</span>     <span class="keywordtype">int</span>     count = 0;</div>
+<div class="line"><a name="l17609"></a><span class="lineno">17609</span>     <span class="keywordtype">int</span>     i;</div>
+<div class="line"><a name="l17610"></a><span class="lineno">17610</span> </div>
+<div class="line"><a name="l17611"></a><span class="lineno">17611</span> </div>
+<div class="line"><a name="l17612"></a><span class="lineno">17612</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17613"></a><span class="lineno">17613</span> <span class="comment">     * At first iteration the mean is taken as the median, and the</span></div>
+<div class="line"><a name="l17614"></a><span class="lineno">17614</span> <span class="comment">     * standard deviation relative to this value is computed.</span></div>
+<div class="line"><a name="l17615"></a><span class="lineno">17615</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17616"></a><span class="lineno">17616</span> </div>
+<div class="line"><a name="l17617"></a><span class="lineno">17617</span>     mean = cpl_vector_get_median(values);</div>
+<div class="line"><a name="l17618"></a><span class="lineno">17618</span> </div>
+<div class="line"><a name="l17619"></a><span class="lineno">17619</span>     <span class="keywordflow">for</span> (i = 0; i < n; i++) </div>
+<div class="line"><a name="l17620"></a><span class="lineno">17620</span>         sigma += (mean - data[i]) * (mean - data[i]);</div>
+<div class="line"><a name="l17621"></a><span class="lineno">17621</span> </div>
+<div class="line"><a name="l17622"></a><span class="lineno">17622</span>     sigma = sqrt(sigma / (n - 1));</div>
+<div class="line"><a name="l17623"></a><span class="lineno">17623</span> </div>
+<div class="line"><a name="l17624"></a><span class="lineno">17624</span>     <span class="keywordflow">while</span> (kiter) {</div>
+<div class="line"><a name="l17625"></a><span class="lineno">17625</span>         count = 0;</div>
+<div class="line"><a name="l17626"></a><span class="lineno">17626</span>         <span class="keywordflow">for</span> (i = 0; i < ngood; i++) {</div>
+<div class="line"><a name="l17627"></a><span class="lineno">17627</span>             <span class="keywordflow">if</span> (data[i]-mean < khigh*sigma && mean-data[i] < klow*sigma) {</div>
+<div class="line"><a name="l17628"></a><span class="lineno">17628</span>                 data[count] = data[i];</div>
+<div class="line"><a name="l17629"></a><span class="lineno">17629</span>                 ++count;</div>
+<div class="line"><a name="l17630"></a><span class="lineno">17630</span>             }</div>
+<div class="line"><a name="l17631"></a><span class="lineno">17631</span>         }</div>
+<div class="line"><a name="l17632"></a><span class="lineno">17632</span> </div>
+<div class="line"><a name="l17633"></a><span class="lineno">17633</span>         <span class="keywordflow">if</span> (count == 0) <span class="comment">// This cannot happen at first iteration.</span></div>
+<div class="line"><a name="l17634"></a><span class="lineno">17634</span>             <span class="keywordflow">break</span>;      <span class="comment">// So we can break: we have already computed a mean.</span></div>
+<div class="line"><a name="l17635"></a><span class="lineno">17635</span> </div>
+<div class="line"><a name="l17636"></a><span class="lineno">17636</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l17637"></a><span class="lineno">17637</span> <span class="comment">         * The mean must be computed even if no element was rejected</span></div>
+<div class="line"><a name="l17638"></a><span class="lineno">17638</span> <span class="comment">         * (count == ngood), because at first iteration median instead </span></div>
+<div class="line"><a name="l17639"></a><span class="lineno">17639</span> <span class="comment">         * of mean was computed.</span></div>
+<div class="line"><a name="l17640"></a><span class="lineno">17640</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l17641"></a><span class="lineno">17641</span> </div>
+<div class="line"><a name="l17642"></a><span class="lineno">17642</span>         accepted = cpl_vector_wrap(count, data);</div>
+<div class="line"><a name="l17643"></a><span class="lineno">17643</span>         mean = cpl_vector_get_mean(accepted);</div>
+<div class="line"><a name="l17644"></a><span class="lineno">17644</span>         <span class="keywordflow">if</span> (count > 1)</div>
+<div class="line"><a name="l17645"></a><span class="lineno">17645</span>             sigma = cpl_vector_get_stdev(accepted);</div>
+<div class="line"><a name="l17646"></a><span class="lineno">17646</span>         cpl_vector_unwrap(accepted);</div>
+<div class="line"><a name="l17647"></a><span class="lineno">17647</span> </div>
+<div class="line"><a name="l17648"></a><span class="lineno">17648</span>         <span class="keywordflow">if</span> (count == ngood || count == 1)</div>
+<div class="line"><a name="l17649"></a><span class="lineno">17649</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l17650"></a><span class="lineno">17650</span> </div>
+<div class="line"><a name="l17651"></a><span class="lineno">17651</span>         ngood = count;</div>
+<div class="line"><a name="l17652"></a><span class="lineno">17652</span>         --kiter;</div>
+<div class="line"><a name="l17653"></a><span class="lineno">17653</span>     }</div>
+<div class="line"><a name="l17654"></a><span class="lineno">17654</span> </div>
+<div class="line"><a name="l17655"></a><span class="lineno">17655</span>     <span class="keywordflow">if</span> (good)</div>
+<div class="line"><a name="l17656"></a><span class="lineno">17656</span>         *good = ngood;</div>
+<div class="line"><a name="l17657"></a><span class="lineno">17657</span> </div>
+<div class="line"><a name="l17658"></a><span class="lineno">17658</span>     <span class="keywordflow">return</span> mean;</div>
+<div class="line"><a name="l17659"></a><span class="lineno">17659</span> }</div>
+<div class="line"><a name="l17660"></a><span class="lineno">17660</span> </div>
+<div class="line"><a name="l17661"></a><span class="lineno">17661</span> </div>
+<div class="line"><a name="l17680"></a><span class="lineno"><a class="code" href="group__moses.html#ga663cfcd4584b6a3e63e7593cba926688">17680</a></span> cpl_image *<a class="code" href="group__moses.html#ga663cfcd4584b6a3e63e7593cba926688" title="Stack images using k-sigma clipping.">mos_ksigma_stack</a>(cpl_imagelist *imlist, </div>
+<div class="line"><a name="l17681"></a><span class="lineno">17681</span>                             <span class="keywordtype">double</span> klow, <span class="keywordtype">double</span> khigh, <span class="keywordtype">int</span> kiter,</div>
+<div class="line"><a name="l17682"></a><span class="lineno">17682</span>                             cpl_image **good)</div>
+<div class="line"><a name="l17683"></a><span class="lineno">17683</span> {</div>
+<div class="line"><a name="l17684"></a><span class="lineno">17684</span>     <span class="keywordtype">int</span>         ni, nx, ny, npix;</div>
+<div class="line"><a name="l17685"></a><span class="lineno">17685</span>     cpl_image  *out_ima;</div>
+<div class="line"><a name="l17686"></a><span class="lineno">17686</span>     <span class="keywordtype">float</span>      *pout_ima;</div>
+<div class="line"><a name="l17687"></a><span class="lineno">17687</span>     <span class="keywordtype">float</span>      *good_ima;</div>
+<div class="line"><a name="l17688"></a><span class="lineno">17688</span>     cpl_image  *image;</div>
+<div class="line"><a name="l17689"></a><span class="lineno">17689</span>     <span class="keywordtype">float</span>     **data;</div>
+<div class="line"><a name="l17690"></a><span class="lineno">17690</span>     cpl_vector *time_line;</div>
+<div class="line"><a name="l17691"></a><span class="lineno">17691</span>     <span class="keywordtype">double</span>     *ptime_line;</div>
+<div class="line"><a name="l17692"></a><span class="lineno">17692</span>     <span class="keywordtype">int</span>         ngood;</div>
+<div class="line"><a name="l17693"></a><span class="lineno">17693</span>     <span class="keywordtype">int</span>         i, j;</div>
+<div class="line"><a name="l17694"></a><span class="lineno">17694</span> </div>
+<div class="line"><a name="l17695"></a><span class="lineno">17695</span> </div>
+<div class="line"><a name="l17696"></a><span class="lineno">17696</span>     ni         = cpl_imagelist_get_size(imlist);</div>
+<div class="line"><a name="l17697"></a><span class="lineno">17697</span> </div>
+<div class="line"><a name="l17698"></a><span class="lineno">17698</span>     image      = cpl_imagelist_get(imlist, 0);</div>
+<div class="line"><a name="l17699"></a><span class="lineno">17699</span>     nx         = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l17700"></a><span class="lineno">17700</span>     ny         = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l17701"></a><span class="lineno">17701</span>     npix       = nx * ny;</div>
+<div class="line"><a name="l17702"></a><span class="lineno">17702</span>     </div>
+<div class="line"><a name="l17703"></a><span class="lineno">17703</span>     out_ima    = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17704"></a><span class="lineno">17704</span>     pout_ima   = cpl_image_get_data_float(out_ima);</div>
+<div class="line"><a name="l17705"></a><span class="lineno">17705</span> </div>
+<div class="line"><a name="l17706"></a><span class="lineno">17706</span>     <span class="keywordflow">if</span> (good) {</div>
+<div class="line"><a name="l17707"></a><span class="lineno">17707</span>         *good = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17708"></a><span class="lineno">17708</span>         good_ima = cpl_image_get_data_float(*good);</div>
+<div class="line"><a name="l17709"></a><span class="lineno">17709</span>     }</div>
+<div class="line"><a name="l17710"></a><span class="lineno">17710</span> </div>
+<div class="line"><a name="l17711"></a><span class="lineno">17711</span>     time_line  = cpl_vector_new(ni);</div>
+<div class="line"><a name="l17712"></a><span class="lineno">17712</span>     ptime_line = cpl_vector_get_data(time_line);</div>
+<div class="line"><a name="l17713"></a><span class="lineno">17713</span> </div>
+<div class="line"><a name="l17714"></a><span class="lineno">17714</span>     data = cpl_calloc(<span class="keyword">sizeof</span>(<span class="keywordtype">float</span> *), ni);</div>
+<div class="line"><a name="l17715"></a><span class="lineno">17715</span>     </div>
+<div class="line"><a name="l17716"></a><span class="lineno">17716</span>     <span class="keywordflow">for</span> (i = 0; i < ni; i++) {</div>
+<div class="line"><a name="l17717"></a><span class="lineno">17717</span>         image = cpl_imagelist_get(imlist, i);</div>
+<div class="line"><a name="l17718"></a><span class="lineno">17718</span>         data[i] = cpl_image_get_data_float(image);</div>
+<div class="line"><a name="l17719"></a><span class="lineno">17719</span>     }</div>
+<div class="line"><a name="l17720"></a><span class="lineno">17720</span> </div>
+<div class="line"><a name="l17721"></a><span class="lineno">17721</span>     <span class="keywordflow">for</span> (i = 0; i < npix; i++) {</div>
+<div class="line"><a name="l17722"></a><span class="lineno">17722</span>         <span class="keywordflow">for</span> (j = 0; j < ni; j++) {</div>
+<div class="line"><a name="l17723"></a><span class="lineno">17723</span>             ptime_line[j] = data[j][i];</div>
+<div class="line"><a name="l17724"></a><span class="lineno">17724</span>         }</div>
+<div class="line"><a name="l17725"></a><span class="lineno">17725</span>         pout_ima[i] = ksigma_vector(time_line, klow, khigh, kiter, &ngood);</div>
+<div class="line"><a name="l17726"></a><span class="lineno">17726</span>         <span class="keywordflow">if</span> (good) {</div>
+<div class="line"><a name="l17727"></a><span class="lineno">17727</span>             good_ima[i] = ngood;</div>
+<div class="line"><a name="l17728"></a><span class="lineno">17728</span>         }</div>
+<div class="line"><a name="l17729"></a><span class="lineno">17729</span>     }</div>
+<div class="line"><a name="l17730"></a><span class="lineno">17730</span> </div>
+<div class="line"><a name="l17731"></a><span class="lineno">17731</span>     cpl_free(data);</div>
+<div class="line"><a name="l17732"></a><span class="lineno">17732</span>     cpl_vector_delete(time_line);</div>
+<div class="line"><a name="l17733"></a><span class="lineno">17733</span> </div>
+<div class="line"><a name="l17734"></a><span class="lineno">17734</span>     <span class="keywordflow">return</span> out_ima;</div>
+<div class="line"><a name="l17735"></a><span class="lineno">17735</span> </div>
+<div class="line"><a name="l17736"></a><span class="lineno">17736</span> }</div>
+<div class="line"><a name="l17737"></a><span class="lineno">17737</span> </div>
+<div class="line"><a name="l17738"></a><span class="lineno">17738</span> </div>
+<div class="line"><a name="l17755"></a><span class="lineno"><a class="code" href="group__moses.html#ga2244278b632992a44067afcc42530954">17755</a></span> cpl_image *<a class="code" href="group__moses.html#ga2244278b632992a44067afcc42530954" title="Apply response curve to extracted spectra.">mos_apply_photometry</a>(cpl_image *spectra, cpl_table *response,</div>
+<div class="line"><a name="l17756"></a><span class="lineno">17756</span>                                 cpl_table *ext_table, <span class="keywordtype">double</span> startwave,</div>
+<div class="line"><a name="l17757"></a><span class="lineno">17757</span>                                 <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> gain,</div>
+<div class="line"><a name="l17758"></a><span class="lineno">17758</span>                                 <span class="keywordtype">double</span> exptime, <span class="keywordtype">double</span> airmass)</div>
+<div class="line"><a name="l17759"></a><span class="lineno">17759</span> {</div>
+<div class="line"><a name="l17760"></a><span class="lineno">17760</span>     cpl_image *extinction;</div>
+<div class="line"><a name="l17761"></a><span class="lineno">17761</span>     cpl_image *outspectra;</div>
+<div class="line"><a name="l17762"></a><span class="lineno">17762</span>     cpl_image *mapresponse;</div>
+<div class="line"><a name="l17763"></a><span class="lineno">17763</span>     <span class="keywordtype">float</span>     *res_data;</div>
+<div class="line"><a name="l17764"></a><span class="lineno">17764</span>     <span class="keywordtype">float</span>     *out_data;</div>
+<div class="line"><a name="l17765"></a><span class="lineno">17765</span>     <span class="keywordtype">float</span>     *ext_data;</div>
+<div class="line"><a name="l17766"></a><span class="lineno">17766</span>     <span class="keywordtype">int</span>        tlength, xlength, ylength;</div>
+<div class="line"><a name="l17767"></a><span class="lineno">17767</span>     <span class="keywordtype">int</span>        i, j, k;</div>
+<div class="line"><a name="l17768"></a><span class="lineno">17768</span> </div>
+<div class="line"><a name="l17769"></a><span class="lineno">17769</span> </div>
+<div class="line"><a name="l17770"></a><span class="lineno">17770</span>     <span class="keywordflow">if</span> (spectra == NULL || ext_table == NULL || response == NULL) {</div>
+<div class="line"><a name="l17771"></a><span class="lineno">17771</span>         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l17772"></a><span class="lineno">17772</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17773"></a><span class="lineno">17773</span>     }</div>
+<div class="line"><a name="l17774"></a><span class="lineno">17774</span> </div>
+<div class="line"><a name="l17775"></a><span class="lineno">17775</span>     res_data = cpl_table_get_data_float(response, <span class="stringliteral">"RESPONSE"</span>);</div>
+<div class="line"><a name="l17776"></a><span class="lineno">17776</span> </div>
+<div class="line"><a name="l17777"></a><span class="lineno">17777</span>     <span class="keywordflow">if</span> (res_data == NULL) {</div>
+<div class="line"><a name="l17778"></a><span class="lineno">17778</span>         cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l17779"></a><span class="lineno">17779</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17780"></a><span class="lineno">17780</span>     }</div>
+<div class="line"><a name="l17781"></a><span class="lineno">17781</span> </div>
+<div class="line"><a name="l17782"></a><span class="lineno">17782</span>     tlength = cpl_table_get_nrow(response);</div>
+<div class="line"><a name="l17783"></a><span class="lineno">17783</span>     xlength = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l17784"></a><span class="lineno">17784</span>     ylength = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l17785"></a><span class="lineno">17785</span> </div>
+<div class="line"><a name="l17786"></a><span class="lineno">17786</span>     <span class="keywordflow">if</span> (xlength != tlength) {</div>
+<div class="line"><a name="l17787"></a><span class="lineno">17787</span>         mapresponse = cpl_image_new(xlength, 1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17788"></a><span class="lineno">17788</span>         map_table(mapresponse, startwave + dispersion/2, dispersion,</div>
+<div class="line"><a name="l17789"></a><span class="lineno">17789</span>                   response, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"RESPONSE"</span>);</div>
+<div class="line"><a name="l17790"></a><span class="lineno">17790</span>         res_data = cpl_image_get_data_float(mapresponse);</div>
+<div class="line"><a name="l17791"></a><span class="lineno">17791</span>     }</div>
+<div class="line"><a name="l17792"></a><span class="lineno">17792</span> </div>
+<div class="line"><a name="l17793"></a><span class="lineno">17793</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17794"></a><span class="lineno">17794</span> <span class="comment">     * Map the atmospheric extinction factors to the same lambda sampling</span></div>
+<div class="line"><a name="l17795"></a><span class="lineno">17795</span> <span class="comment">     * of the extracted spectrum.</span></div>
+<div class="line"><a name="l17796"></a><span class="lineno">17796</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17797"></a><span class="lineno">17797</span> </div>
+<div class="line"><a name="l17798"></a><span class="lineno">17798</span>     extinction = cpl_image_new(xlength, 1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17799"></a><span class="lineno">17799</span>     map_table(extinction, startwave + dispersion/2, dispersion,</div>
+<div class="line"><a name="l17800"></a><span class="lineno">17800</span>               ext_table, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"EXTINCTION"</span>);</div>
+<div class="line"><a name="l17801"></a><span class="lineno">17801</span> </div>
+<div class="line"><a name="l17802"></a><span class="lineno">17802</span> </div>
+<div class="line"><a name="l17803"></a><span class="lineno">17803</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17804"></a><span class="lineno">17804</span> <span class="comment">     * Convert from magnitudes to actual flux loss.</span></div>
+<div class="line"><a name="l17805"></a><span class="lineno">17805</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17806"></a><span class="lineno">17806</span> </div>
+<div class="line"><a name="l17807"></a><span class="lineno">17807</span>     cpl_image_multiply_scalar(extinction, 0.4 * airmass);</div>
+<div class="line"><a name="l17808"></a><span class="lineno">17808</span>     cpl_image_exponential(extinction, 10.);</div>
+<div class="line"><a name="l17809"></a><span class="lineno">17809</span> </div>
+<div class="line"><a name="l17810"></a><span class="lineno">17810</span>     outspectra = cpl_image_duplicate(spectra);</div>
+<div class="line"><a name="l17811"></a><span class="lineno">17811</span> </div>
+<div class="line"><a name="l17812"></a><span class="lineno">17812</span>     ext_data = cpl_image_get_data_float(extinction);</div>
+<div class="line"><a name="l17813"></a><span class="lineno">17813</span>     out_data = cpl_image_get_data_float(outspectra);</div>
+<div class="line"><a name="l17814"></a><span class="lineno">17814</span> </div>
+<div class="line"><a name="l17815"></a><span class="lineno">17815</span>     <span class="keywordflow">for</span> (k = 0, i = 0; i < ylength; i++) {</div>
+<div class="line"><a name="l17816"></a><span class="lineno">17816</span>         <span class="keywordflow">for</span> (j = 0; j < xlength; j++, k++) {</div>
+<div class="line"><a name="l17817"></a><span class="lineno">17817</span>             out_data[k] *= ext_data[j] * res_data[j];</div>
+<div class="line"><a name="l17818"></a><span class="lineno">17818</span>         }</div>
+<div class="line"><a name="l17819"></a><span class="lineno">17819</span>     }</div>
+<div class="line"><a name="l17820"></a><span class="lineno">17820</span> </div>
+<div class="line"><a name="l17821"></a><span class="lineno">17821</span>     cpl_image_delete(extinction);</div>
+<div class="line"><a name="l17822"></a><span class="lineno">17822</span>     <span class="keywordflow">if</span> (xlength != tlength) {</div>
+<div class="line"><a name="l17823"></a><span class="lineno">17823</span>         cpl_image_delete(mapresponse);</div>
+<div class="line"><a name="l17824"></a><span class="lineno">17824</span>     }</div>
+<div class="line"><a name="l17825"></a><span class="lineno">17825</span> </div>
+<div class="line"><a name="l17826"></a><span class="lineno">17826</span>     cpl_image_multiply_scalar(outspectra, gain / exptime / dispersion);</div>
+<div class="line"><a name="l17827"></a><span class="lineno">17827</span> </div>
+<div class="line"><a name="l17828"></a><span class="lineno">17828</span>     <span class="keywordflow">return</span> outspectra;</div>
+<div class="line"><a name="l17829"></a><span class="lineno">17829</span> }</div>
+<div class="line"><a name="l17830"></a><span class="lineno">17830</span> </div>
+<div class="line"><a name="l17831"></a><span class="lineno">17831</span> </div>
+<div class="line"><a name="l17848"></a><span class="lineno"><a class="code" href="group__moses.html#gae8e4a9d1a1146de7ba72dd148848342d">17848</a></span> cpl_image *<a class="code" href="group__moses.html#gae8e4a9d1a1146de7ba72dd148848342d" title="Propagate errors from response curve and extracted spectra.">mos_propagate_photometry_error</a>(cpl_image *spectra, </div>
+<div class="line"><a name="l17849"></a><span class="lineno">17849</span>                                           cpl_image *errors, </div>
+<div class="line"><a name="l17850"></a><span class="lineno">17850</span>                                           cpl_table *response,</div>
+<div class="line"><a name="l17851"></a><span class="lineno">17851</span>                                           cpl_table *ext_table, </div>
+<div class="line"><a name="l17852"></a><span class="lineno">17852</span>                                           <span class="keywordtype">double</span> startwave,</div>
+<div class="line"><a name="l17853"></a><span class="lineno">17853</span>                                           <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> gain,</div>
+<div class="line"><a name="l17854"></a><span class="lineno">17854</span>                                           <span class="keywordtype">double</span> exptime, <span class="keywordtype">double</span> airmass)</div>
+<div class="line"><a name="l17855"></a><span class="lineno">17855</span> {</div>
+<div class="line"><a name="l17856"></a><span class="lineno">17856</span>     cpl_image *extinction;</div>
+<div class="line"><a name="l17857"></a><span class="lineno">17857</span>     cpl_image *outerrors;</div>
+<div class="line"><a name="l17858"></a><span class="lineno">17858</span>     cpl_image *mapresponse;</div>
+<div class="line"><a name="l17859"></a><span class="lineno">17859</span>     cpl_image *maperror;</div>
+<div class="line"><a name="l17860"></a><span class="lineno">17860</span>     <span class="keywordtype">float</span>     *err_data;</div>
+<div class="line"><a name="l17861"></a><span class="lineno">17861</span>     <span class="keywordtype">float</span>     *out_data;</div>
+<div class="line"><a name="l17862"></a><span class="lineno">17862</span>     <span class="keywordtype">float</span>     *ext_data;</div>
+<div class="line"><a name="l17863"></a><span class="lineno">17863</span>     <span class="keywordtype">float</span>     *res_data;</div>
+<div class="line"><a name="l17864"></a><span class="lineno">17864</span>     <span class="keywordtype">float</span>     *spe_data;</div>
+<div class="line"><a name="l17865"></a><span class="lineno">17865</span>     <span class="keywordtype">int</span>        tlength, xlength, ylength;</div>
+<div class="line"><a name="l17866"></a><span class="lineno">17866</span>     <span class="keywordtype">int</span>        i, j, k;</div>
+<div class="line"><a name="l17867"></a><span class="lineno">17867</span> </div>
+<div class="line"><a name="l17868"></a><span class="lineno">17868</span> </div>
+<div class="line"><a name="l17869"></a><span class="lineno">17869</span>     <span class="keywordflow">if</span> (errors == NULL || ext_table == NULL || response == NULL) {</div>
+<div class="line"><a name="l17870"></a><span class="lineno">17870</span>         cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);</div>
+<div class="line"><a name="l17871"></a><span class="lineno">17871</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17872"></a><span class="lineno">17872</span>     }</div>
+<div class="line"><a name="l17873"></a><span class="lineno">17873</span> </div>
+<div class="line"><a name="l17874"></a><span class="lineno">17874</span>     <span class="keywordflow">if</span> (!cpl_table_has_column(response, <span class="stringliteral">"ERROR"</span>)) {</div>
+<div class="line"><a name="l17875"></a><span class="lineno">17875</span>         <span class="keywordflow">return</span> <a class="code" href="group__moses.html#ga2244278b632992a44067afcc42530954" title="Apply response curve to extracted spectra.">mos_apply_photometry</a>(errors, response, ext_table, startwave,</div>
+<div class="line"><a name="l17876"></a><span class="lineno">17876</span>                                     dispersion, gain, exptime, airmass);</div>
+<div class="line"><a name="l17877"></a><span class="lineno">17877</span>     }</div>
+<div class="line"><a name="l17878"></a><span class="lineno">17878</span> </div>
+<div class="line"><a name="l17879"></a><span class="lineno">17879</span>     res_data = cpl_table_get_data_float(response, <span class="stringliteral">"RESPONSE"</span>);</div>
+<div class="line"><a name="l17880"></a><span class="lineno">17880</span> </div>
+<div class="line"><a name="l17881"></a><span class="lineno">17881</span>     <span class="keywordflow">if</span> (res_data == NULL) {</div>
+<div class="line"><a name="l17882"></a><span class="lineno">17882</span>         cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l17883"></a><span class="lineno">17883</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17884"></a><span class="lineno">17884</span>     }</div>
+<div class="line"><a name="l17885"></a><span class="lineno">17885</span> </div>
+<div class="line"><a name="l17886"></a><span class="lineno">17886</span>     err_data = cpl_table_get_data_float(response, <span class="stringliteral">"ERROR"</span>);</div>
+<div class="line"><a name="l17887"></a><span class="lineno">17887</span> </div>
+<div class="line"><a name="l17888"></a><span class="lineno">17888</span>     <span class="keywordflow">if</span> (err_data == NULL) {</div>
+<div class="line"><a name="l17889"></a><span class="lineno">17889</span>         cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);</div>
+<div class="line"><a name="l17890"></a><span class="lineno">17890</span>         <span class="keywordflow">return</span> NULL;</div>
+<div class="line"><a name="l17891"></a><span class="lineno">17891</span>     }</div>
+<div class="line"><a name="l17892"></a><span class="lineno">17892</span> </div>
+<div class="line"><a name="l17893"></a><span class="lineno">17893</span>     tlength = cpl_table_get_nrow(response);</div>
+<div class="line"><a name="l17894"></a><span class="lineno">17894</span>     xlength = cpl_image_get_size_x(errors);</div>
+<div class="line"><a name="l17895"></a><span class="lineno">17895</span>     ylength = cpl_image_get_size_y(errors);</div>
+<div class="line"><a name="l17896"></a><span class="lineno">17896</span> </div>
+<div class="line"><a name="l17897"></a><span class="lineno">17897</span>     <span class="keywordflow">if</span> (xlength != tlength) {</div>
+<div class="line"><a name="l17898"></a><span class="lineno">17898</span>         mapresponse = cpl_image_new(xlength, 1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17899"></a><span class="lineno">17899</span>         map_table(mapresponse, startwave + dispersion/2, dispersion,</div>
+<div class="line"><a name="l17900"></a><span class="lineno">17900</span>                   response, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"RESPONSE"</span>);</div>
+<div class="line"><a name="l17901"></a><span class="lineno">17901</span>         res_data = cpl_image_get_data_float(mapresponse);</div>
+<div class="line"><a name="l17902"></a><span class="lineno">17902</span> </div>
+<div class="line"><a name="l17903"></a><span class="lineno">17903</span>         maperror = cpl_image_new(xlength, 1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17904"></a><span class="lineno">17904</span>         map_table(maperror, startwave + dispersion/2, dispersion,</div>
+<div class="line"><a name="l17905"></a><span class="lineno">17905</span>                   response, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"ERROR"</span>);</div>
+<div class="line"><a name="l17906"></a><span class="lineno">17906</span>         err_data = cpl_image_get_data_float(maperror);</div>
+<div class="line"><a name="l17907"></a><span class="lineno">17907</span>     }</div>
+<div class="line"><a name="l17908"></a><span class="lineno">17908</span> </div>
+<div class="line"><a name="l17909"></a><span class="lineno">17909</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17910"></a><span class="lineno">17910</span> <span class="comment">     * Map the atmospheric extinction factors to the same lambda sampling</span></div>
+<div class="line"><a name="l17911"></a><span class="lineno">17911</span> <span class="comment">     * of the extracted spectrum.</span></div>
+<div class="line"><a name="l17912"></a><span class="lineno">17912</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17913"></a><span class="lineno">17913</span> </div>
+<div class="line"><a name="l17914"></a><span class="lineno">17914</span>     extinction = cpl_image_new(xlength, 1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l17915"></a><span class="lineno">17915</span>     map_table(extinction, startwave + dispersion/2, dispersion,</div>
+<div class="line"><a name="l17916"></a><span class="lineno">17916</span>               ext_table, <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"EXTINCTION"</span>);</div>
+<div class="line"><a name="l17917"></a><span class="lineno">17917</span> </div>
+<div class="line"><a name="l17918"></a><span class="lineno">17918</span> </div>
+<div class="line"><a name="l17919"></a><span class="lineno">17919</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l17920"></a><span class="lineno">17920</span> <span class="comment">     * Convert from magnitudes to actual flux loss.</span></div>
+<div class="line"><a name="l17921"></a><span class="lineno">17921</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l17922"></a><span class="lineno">17922</span> </div>
+<div class="line"><a name="l17923"></a><span class="lineno">17923</span>     cpl_image_multiply_scalar(extinction, 0.4 * airmass);</div>
+<div class="line"><a name="l17924"></a><span class="lineno">17924</span>     cpl_image_exponential(extinction, 10.);</div>
+<div class="line"><a name="l17925"></a><span class="lineno">17925</span> </div>
+<div class="line"><a name="l17926"></a><span class="lineno">17926</span>     outerrors = cpl_image_duplicate(errors);</div>
+<div class="line"><a name="l17927"></a><span class="lineno">17927</span> </div>
+<div class="line"><a name="l17928"></a><span class="lineno">17928</span>     ext_data = cpl_image_get_data_float(extinction);</div>
+<div class="line"><a name="l17929"></a><span class="lineno">17929</span>     out_data = cpl_image_get_data_float(outerrors);</div>
+<div class="line"><a name="l17930"></a><span class="lineno">17930</span>     spe_data = cpl_image_get_data_float(spectra);</div>
+<div class="line"><a name="l17931"></a><span class="lineno">17931</span> </div>
+<div class="line"><a name="l17932"></a><span class="lineno">17932</span>     <span class="keywordflow">for</span> (k = 0, i = 0; i < ylength; i++) {</div>
+<div class="line"><a name="l17933"></a><span class="lineno">17933</span>         <span class="keywordflow">for</span> (j = 0; j < xlength; j++, k++) {</div>
+<div class="line"><a name="l17934"></a><span class="lineno">17934</span>             out_data[k] = ext_data[j] * </div>
+<div class="line"><a name="l17935"></a><span class="lineno">17935</span>               sqrt(err_data[j] * err_data[j] * spe_data[k] * spe_data[k] +</div>
+<div class="line"><a name="l17936"></a><span class="lineno">17936</span>                    res_data[j] * res_data[j] * out_data[k] * out_data[k]);</div>
+<div class="line"><a name="l17937"></a><span class="lineno">17937</span>         }</div>
+<div class="line"><a name="l17938"></a><span class="lineno">17938</span>     }</div>
+<div class="line"><a name="l17939"></a><span class="lineno">17939</span> </div>
+<div class="line"><a name="l17940"></a><span class="lineno">17940</span>     cpl_image_delete(extinction);</div>
+<div class="line"><a name="l17941"></a><span class="lineno">17941</span>     <span class="keywordflow">if</span> (xlength != tlength) {</div>
+<div class="line"><a name="l17942"></a><span class="lineno">17942</span>         cpl_image_delete(maperror);</div>
+<div class="line"><a name="l17943"></a><span class="lineno">17943</span>     }</div>
+<div class="line"><a name="l17944"></a><span class="lineno">17944</span> </div>
+<div class="line"><a name="l17945"></a><span class="lineno">17945</span>     cpl_image_multiply_scalar(outerrors, gain / exptime / dispersion);</div>
+<div class="line"><a name="l17946"></a><span class="lineno">17946</span> </div>
+<div class="line"><a name="l17947"></a><span class="lineno">17947</span>     <span class="keywordflow">return</span> outerrors;</div>
+<div class="line"><a name="l17948"></a><span class="lineno">17948</span> }</div>
+<div class="line"><a name="l17949"></a><span class="lineno">17949</span> </div>
+<div class="line"><a name="l17950"></a><span class="lineno">17950</span> </div>
+<div class="line"><a name="l18026"></a><span class="lineno"><a class="code" href="group__moses.html#gae97d35cc8cb29cbb0b43d4fc84e4d34b">18026</a></span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gae97d35cc8cb29cbb0b43d4fc84e4d34b" title="Estimate linear polarisation parameters on spectral interval.">mos_check_polarisation</a>(cpl_image *q_image, cpl_image *q_error,</div>
+<div class="line"><a name="l18027"></a><span class="lineno">18027</span>                            cpl_image *u_image, cpl_image *u_error,</div>
+<div class="line"><a name="l18028"></a><span class="lineno">18028</span>                            <span class="keywordtype">double</span> startwave, <span class="keywordtype">double</span> dispersion,</div>
+<div class="line"><a name="l18029"></a><span class="lineno">18029</span>                            <span class="keywordtype">double</span> band, cpl_table *pol_sta,</div>
+<div class="line"><a name="l18030"></a><span class="lineno">18030</span>                            <span class="keywordtype">double</span> ra, <span class="keywordtype">double</span> dec, <span class="keywordtype">char</span> *filter, </div>
+<div class="line"><a name="l18031"></a><span class="lineno">18031</span>                            <span class="keywordtype">int</span> *polarisation,</div>
+<div class="line"><a name="l18032"></a><span class="lineno">18032</span>                            <span class="keywordtype">double</span> *p_offset, <span class="keywordtype">double</span> *p_error,</div>
+<div class="line"><a name="l18033"></a><span class="lineno">18033</span>                            <span class="keywordtype">double</span> *a_offset, <span class="keywordtype">double</span> *a_error)</div>
+<div class="line"><a name="l18034"></a><span class="lineno">18034</span> {</div>
+<div class="line"><a name="l18035"></a><span class="lineno">18035</span>     cpl_table *standard;</div>
+<div class="line"><a name="l18036"></a><span class="lineno">18036</span>     cpl_image *q_noise;</div>
+<div class="line"><a name="l18037"></a><span class="lineno">18037</span>     cpl_image *q_signal;</div>
+<div class="line"><a name="l18038"></a><span class="lineno">18038</span>     cpl_image *u_noise;</div>
+<div class="line"><a name="l18039"></a><span class="lineno">18039</span>     cpl_image *u_signal;</div>
+<div class="line"><a name="l18040"></a><span class="lineno">18040</span>     cpl_image *noise;</div>
+<div class="line"><a name="l18041"></a><span class="lineno">18041</span>     <span class="keywordtype">double</span>    *q_ndata;</div>
+<div class="line"><a name="l18042"></a><span class="lineno">18042</span>     <span class="keywordtype">double</span>    *q_sdata;</div>
+<div class="line"><a name="l18043"></a><span class="lineno">18043</span>     <span class="keywordtype">double</span>    *u_ndata;</div>
+<div class="line"><a name="l18044"></a><span class="lineno">18044</span>     <span class="keywordtype">double</span>    *u_sdata;</div>
+<div class="line"><a name="l18045"></a><span class="lineno">18045</span>     <span class="keywordtype">double</span>     arctol = 0.5;  <span class="comment">/* Arc tolerance in degrees */</span></div>
+<div class="line"><a name="l18046"></a><span class="lineno">18046</span>     <span class="keywordtype">double</span>     mindist;</div>
+<div class="line"><a name="l18047"></a><span class="lineno">18047</span>     <span class="keywordtype">double</span>     cwave;</div>
+<div class="line"><a name="l18048"></a><span class="lineno">18048</span>     <span class="keywordtype">double</span>     bwave[] = {3650., 4450., 5510., 6580., 8060};</div>
+<div class="line"><a name="l18049"></a><span class="lineno">18049</span>     <span class="keywordtype">char</span>      *bands = <span class="stringliteral">"UBVRI"</span>;</div>
+<div class="line"><a name="l18050"></a><span class="lineno">18050</span>     <span class="keywordtype">char</span>       p_label[] = {<span class="charliteral">' '</span>, <span class="charliteral">'p'</span>, <span class="charliteral">'\0'</span>};</div>
+<div class="line"><a name="l18051"></a><span class="lineno">18051</span>     <span class="keywordtype">char</span>       dp_label[] = {<span class="charliteral">' '</span>, <span class="charliteral">'d'</span>, <span class="charliteral">'p'</span>, <span class="charliteral">'\0'</span>};</div>
+<div class="line"><a name="l18052"></a><span class="lineno">18052</span>     <span class="keywordtype">char</span>       a_label[] = {<span class="charliteral">' '</span>, <span class="charliteral">'a'</span>, <span class="charliteral">'\0'</span>};</div>
+<div class="line"><a name="l18053"></a><span class="lineno">18053</span>     <span class="keywordtype">char</span>       da_label[] = {<span class="charliteral">' '</span>, <span class="charliteral">'d'</span>, <span class="charliteral">'a'</span>, <span class="charliteral">'\0'</span>};</div>
+<div class="line"><a name="l18054"></a><span class="lineno">18054</span>     <span class="keywordtype">int</span>        nbands = strlen(bands);</div>
+<div class="line"><a name="l18055"></a><span class="lineno">18055</span>     <span class="keywordtype">int</span>        selected;</div>
+<div class="line"><a name="l18056"></a><span class="lineno">18056</span>     <span class="keywordtype">int</span>        first, last, count, center;</div>
+<div class="line"><a name="l18057"></a><span class="lineno">18057</span>     <span class="keywordtype">int</span>        nx;</div>
+<div class="line"><a name="l18058"></a><span class="lineno">18058</span>     cpl_size   col, row;</div>
+<div class="line"><a name="l18059"></a><span class="lineno">18059</span>     <span class="keywordtype">int</span>        i, found, closest;</div>
+<div class="line"><a name="l18060"></a><span class="lineno">18060</span>     <span class="keywordtype">int</span>        pband;</div>
+<div class="line"><a name="l18061"></a><span class="lineno">18061</span>     <span class="keywordtype">int</span>        polarised;</div>
+<div class="line"><a name="l18062"></a><span class="lineno">18062</span>     <span class="keywordtype">double</span>     q_obs;</div>
+<div class="line"><a name="l18063"></a><span class="lineno">18063</span>     <span class="keywordtype">double</span>     q_err;</div>
+<div class="line"><a name="l18064"></a><span class="lineno">18064</span>     <span class="keywordtype">double</span>     u_obs;</div>
+<div class="line"><a name="l18065"></a><span class="lineno">18065</span>     <span class="keywordtype">double</span>     u_err;</div>
+<div class="line"><a name="l18066"></a><span class="lineno">18066</span>     <span class="keywordtype">double</span>     p_obs;</div>
+<div class="line"><a name="l18067"></a><span class="lineno">18067</span>     <span class="keywordtype">double</span>     p_err;</div>
+<div class="line"><a name="l18068"></a><span class="lineno">18068</span>     <span class="keywordtype">double</span>     p_ref;</div>
+<div class="line"><a name="l18069"></a><span class="lineno">18069</span>     <span class="keywordtype">double</span>     dp_ref;</div>
+<div class="line"><a name="l18070"></a><span class="lineno">18070</span>     <span class="keywordtype">double</span>     a_obs;</div>
+<div class="line"><a name="l18071"></a><span class="lineno">18071</span>     <span class="keywordtype">double</span>     a_err;</div>
+<div class="line"><a name="l18072"></a><span class="lineno">18072</span>     <span class="keywordtype">double</span>     a_ref;</div>
+<div class="line"><a name="l18073"></a><span class="lineno">18073</span>     <span class="keywordtype">double</span>     da_ref;</div>
+<div class="line"><a name="l18074"></a><span class="lineno">18074</span> </div>
+<div class="line"><a name="l18075"></a><span class="lineno">18075</span> </div>
+<div class="line"><a name="l18076"></a><span class="lineno">18076</span>     *filter       = <span class="charliteral">'\0'</span>;</div>
+<div class="line"><a name="l18077"></a><span class="lineno">18077</span>     *polarisation = 0;</div>
+<div class="line"><a name="l18078"></a><span class="lineno">18078</span>     *p_offset     = 0.0;</div>
+<div class="line"><a name="l18079"></a><span class="lineno">18079</span>     *p_error      = 0.0;</div>
+<div class="line"><a name="l18080"></a><span class="lineno">18080</span>     *a_offset     = 0.0;</div>
+<div class="line"><a name="l18081"></a><span class="lineno">18081</span>     *a_error      = 0.0;</div>
+<div class="line"><a name="l18082"></a><span class="lineno">18082</span> </div>
+<div class="line"><a name="l18083"></a><span class="lineno">18083</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18084"></a><span class="lineno">18084</span> <span class="comment">     * Select reference standard star</span></div>
+<div class="line"><a name="l18085"></a><span class="lineno">18085</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18086"></a><span class="lineno">18086</span> </div>
+<div class="line"><a name="l18087"></a><span class="lineno">18087</span>     cpl_table_select_all(pol_sta);</div>
+<div class="line"><a name="l18088"></a><span class="lineno">18088</span>     cpl_table_and_selected_double(pol_sta, <span class="stringliteral">"RA"</span>,  CPL_GREATER_THAN, ra-arctol);</div>
+<div class="line"><a name="l18089"></a><span class="lineno">18089</span>     cpl_table_and_selected_double(pol_sta, <span class="stringliteral">"RA"</span>,  CPL_LESS_THAN,    ra+arctol);</div>
+<div class="line"><a name="l18090"></a><span class="lineno">18090</span>     cpl_table_and_selected_double(pol_sta, <span class="stringliteral">"DEC"</span>, CPL_GREATER_THAN, dec-arctol);</div>
+<div class="line"><a name="l18091"></a><span class="lineno">18091</span>     selected =</div>
+<div class="line"><a name="l18092"></a><span class="lineno">18092</span>     cpl_table_and_selected_double(pol_sta, <span class="stringliteral">"DEC"</span>, CPL_LESS_THAN,    dec+arctol);</div>
+<div class="line"><a name="l18093"></a><span class="lineno">18093</span> </div>
+<div class="line"><a name="l18094"></a><span class="lineno">18094</span>     <span class="keywordflow">if</span> (selected == 0) {</div>
+<div class="line"><a name="l18095"></a><span class="lineno">18095</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"No standard star found in FOV"</span>);</div>
+<div class="line"><a name="l18096"></a><span class="lineno">18096</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l18097"></a><span class="lineno">18097</span>     }</div>
+<div class="line"><a name="l18098"></a><span class="lineno">18098</span> </div>
+<div class="line"><a name="l18099"></a><span class="lineno">18099</span>     <span class="keywordflow">if</span> (selected > 1) {</div>
+<div class="line"><a name="l18100"></a><span class="lineno">18100</span>         cpl_msg_warning(cpl_func, </div>
+<div class="line"><a name="l18101"></a><span class="lineno">18101</span>                         <span class="stringliteral">"Ambiguity: %d standard stars found in FOV"</span>, selected);</div>
+<div class="line"><a name="l18102"></a><span class="lineno">18102</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l18103"></a><span class="lineno">18103</span>     }</div>
+<div class="line"><a name="l18104"></a><span class="lineno">18104</span> </div>
+<div class="line"><a name="l18105"></a><span class="lineno">18105</span>     standard = cpl_table_extract_selected(pol_sta);</div>
+<div class="line"><a name="l18106"></a><span class="lineno">18106</span> </div>
+<div class="line"><a name="l18107"></a><span class="lineno">18107</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"Standard star: %s"</span>, </div>
+<div class="line"><a name="l18108"></a><span class="lineno">18108</span>                  cpl_table_get_string(standard, <span class="stringliteral">"name"</span>, 0));</div>
+<div class="line"><a name="l18109"></a><span class="lineno">18109</span> </div>
+<div class="line"><a name="l18110"></a><span class="lineno">18110</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18111"></a><span class="lineno">18111</span> <span class="comment">     * Check whether the star is polarised or not</span></div>
+<div class="line"><a name="l18112"></a><span class="lineno">18112</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18113"></a><span class="lineno">18113</span> </div>
+<div class="line"><a name="l18114"></a><span class="lineno">18114</span>     polarised = cpl_table_get_int(standard,  <span class="stringliteral">"polarised"</span>, 0, NULL);</div>
+<div class="line"><a name="l18115"></a><span class="lineno">18115</span> </div>
+<div class="line"><a name="l18116"></a><span class="lineno">18116</span>     cpl_msg_info(cpl_func, <span class="stringliteral">"This star is%sexpected to be polarised"</span>,</div>
+<div class="line"><a name="l18117"></a><span class="lineno">18117</span>                  polarised ? <span class="stringliteral">" "</span> : <span class="stringliteral">" not "</span>);</div>
+<div class="line"><a name="l18118"></a><span class="lineno">18118</span> </div>
+<div class="line"><a name="l18119"></a><span class="lineno">18119</span> </div>
+<div class="line"><a name="l18120"></a><span class="lineno">18120</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18121"></a><span class="lineno">18121</span> <span class="comment">     * Determine the image row with the smallest median noise: this </span></div>
+<div class="line"><a name="l18122"></a><span class="lineno">18122</span> <span class="comment">     * row is assumed to refer to the standard star.</span></div>
+<div class="line"><a name="l18123"></a><span class="lineno">18123</span> <span class="comment">     * (note: the higher the S/N ratio of the original spectra, the </span></div>
+<div class="line"><a name="l18124"></a><span class="lineno">18124</span> <span class="comment">     * smaller the noise of the Stokes parameters Q and U).</span></div>
+<div class="line"><a name="l18125"></a><span class="lineno">18125</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18126"></a><span class="lineno">18126</span> </div>
+<div class="line"><a name="l18127"></a><span class="lineno">18127</span>     nx = cpl_image_get_size_x(q_error);</div>
+<div class="line"><a name="l18128"></a><span class="lineno">18128</span> </div>
+<div class="line"><a name="l18129"></a><span class="lineno">18129</span>     noise = cpl_image_collapse_median_create(q_error, 1, 0, 0);</div>
+<div class="line"><a name="l18130"></a><span class="lineno">18130</span>     cpl_image_get_minpos(noise, &col, &row);</div>
+<div class="line"><a name="l18131"></a><span class="lineno">18131</span> </div>
+<div class="line"><a name="l18132"></a><span class="lineno">18132</span>     cpl_image_delete(noise);</div>
+<div class="line"><a name="l18133"></a><span class="lineno">18133</span> </div>
+<div class="line"><a name="l18134"></a><span class="lineno">18134</span>     <span class="keywordflow">if</span> (col != 1) {</div>
+<div class="line"><a name="l18135"></a><span class="lineno">18135</span>         cpl_table_delete(standard);</div>
+<div class="line"><a name="l18136"></a><span class="lineno">18136</span>         cpl_msg_error(cpl_func, </div>
+<div class="line"><a name="l18137"></a><span class="lineno">18137</span>                       <span class="stringliteral">"Assertion failure!!! col = %"</span>CPL_SIZE_FORMAT<span class="stringliteral">" (it should be 1)"</span>, col);</div>
+<div class="line"><a name="l18138"></a><span class="lineno">18138</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l18139"></a><span class="lineno">18139</span>     }</div>
+<div class="line"><a name="l18140"></a><span class="lineno">18140</span> </div>
+<div class="line"><a name="l18141"></a><span class="lineno">18141</span>     q_signal = cpl_image_extract(q_image, 1, row, nx, row);</div>
+<div class="line"><a name="l18142"></a><span class="lineno">18142</span>     q_noise  = cpl_image_extract(q_error, 1, row, nx, row);</div>
+<div class="line"><a name="l18143"></a><span class="lineno">18143</span>     u_signal = cpl_image_extract(u_image, 1, row, nx, row);</div>
+<div class="line"><a name="l18144"></a><span class="lineno">18144</span>     u_noise  = cpl_image_extract(u_error, 1, row, nx, row);</div>
+<div class="line"><a name="l18145"></a><span class="lineno">18145</span> </div>
+<div class="line"><a name="l18146"></a><span class="lineno">18146</span>     q_sdata = cpl_image_get_data_double(q_signal);</div>
+<div class="line"><a name="l18147"></a><span class="lineno">18147</span>     q_ndata = cpl_image_get_data_double(q_noise);</div>
+<div class="line"><a name="l18148"></a><span class="lineno">18148</span>     u_sdata = cpl_image_get_data_double(u_signal);</div>
+<div class="line"><a name="l18149"></a><span class="lineno">18149</span>     u_ndata = cpl_image_get_data_double(u_noise);</div>
+<div class="line"><a name="l18150"></a><span class="lineno">18150</span> </div>
+<div class="line"><a name="l18151"></a><span class="lineno">18151</span> </div>
+<div class="line"><a name="l18152"></a><span class="lineno">18152</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18153"></a><span class="lineno">18153</span> <span class="comment">     * Determine valid interval in input images (where error is positive).</span></div>
+<div class="line"><a name="l18154"></a><span class="lineno">18154</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18155"></a><span class="lineno">18155</span> </div>
+<div class="line"><a name="l18156"></a><span class="lineno">18156</span>     first = -1;</div>
+<div class="line"><a name="l18157"></a><span class="lineno">18157</span>     last = nx = cpl_image_get_size_x(q_signal);</div>
+<div class="line"><a name="l18158"></a><span class="lineno">18158</span>     <span class="keywordflow">for</span> (i = 0; i < nx; i++) {</div>
+<div class="line"><a name="l18159"></a><span class="lineno">18159</span>         <span class="keywordflow">if</span> (first < 0) {</div>
+<div class="line"><a name="l18160"></a><span class="lineno">18160</span>             <span class="keywordflow">if</span> (q_ndata[i] > 0.0) {</div>
+<div class="line"><a name="l18161"></a><span class="lineno">18161</span>                 first = i;</div>
+<div class="line"><a name="l18162"></a><span class="lineno">18162</span>             }</div>
+<div class="line"><a name="l18163"></a><span class="lineno">18163</span>         }</div>
+<div class="line"><a name="l18164"></a><span class="lineno">18164</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l18165"></a><span class="lineno">18165</span>             <span class="keywordflow">if</span> (q_ndata[i] <= 0.0) {</div>
+<div class="line"><a name="l18166"></a><span class="lineno">18166</span>                 last = i - 1;</div>
+<div class="line"><a name="l18167"></a><span class="lineno">18167</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l18168"></a><span class="lineno">18168</span>             }</div>
+<div class="line"><a name="l18169"></a><span class="lineno">18169</span>         }</div>
+<div class="line"><a name="l18170"></a><span class="lineno">18170</span>     }</div>
+<div class="line"><a name="l18171"></a><span class="lineno">18171</span> </div>
+<div class="line"><a name="l18172"></a><span class="lineno">18172</span>     count = last - first + 1;</div>
+<div class="line"><a name="l18173"></a><span class="lineno">18173</span> </div>
+<div class="line"><a name="l18174"></a><span class="lineno">18174</span>     <span class="keywordflow">if</span> (first < 0 || count < band) {</div>
+<div class="line"><a name="l18175"></a><span class="lineno">18175</span>         cpl_table_delete(standard);</div>
+<div class="line"><a name="l18176"></a><span class="lineno">18176</span>         cpl_image_delete(q_signal);</div>
+<div class="line"><a name="l18177"></a><span class="lineno">18177</span>         cpl_image_delete(q_noise);</div>
+<div class="line"><a name="l18178"></a><span class="lineno">18178</span>         cpl_image_delete(u_signal);</div>
+<div class="line"><a name="l18179"></a><span class="lineno">18179</span>         cpl_image_delete(u_noise);</div>
+<div class="line"><a name="l18180"></a><span class="lineno">18180</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"Too short spectrum (%d pixels)"</span>, count);</div>
+<div class="line"><a name="l18181"></a><span class="lineno">18181</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l18182"></a><span class="lineno">18182</span>     }</div>
+<div class="line"><a name="l18183"></a><span class="lineno">18183</span> </div>
+<div class="line"><a name="l18184"></a><span class="lineno">18184</span>     center = (first + last) / 2;              <span class="comment">// Center of valid spectrum</span></div>
+<div class="line"><a name="l18185"></a><span class="lineno">18185</span>     cwave = startwave + dispersion * center;  <span class="comment">// Corresponding wavelength</span></div>
+<div class="line"><a name="l18186"></a><span class="lineno">18186</span> </div>
+<div class="line"><a name="l18187"></a><span class="lineno">18187</span> </div>
+<div class="line"><a name="l18188"></a><span class="lineno">18188</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18189"></a><span class="lineno">18189</span> <span class="comment">     * Find the band UBVRI closest to the central wavelength.</span></div>
+<div class="line"><a name="l18190"></a><span class="lineno">18190</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18191"></a><span class="lineno">18191</span> </div>
+<div class="line"><a name="l18192"></a><span class="lineno">18192</span>     found = 0;</div>
+<div class="line"><a name="l18193"></a><span class="lineno">18193</span>     <span class="keywordflow">for</span> (i = 0; i < nbands; i++) {</div>
+<div class="line"><a name="l18194"></a><span class="lineno">18194</span>         p_label[0] = bands[i];</div>
+<div class="line"><a name="l18195"></a><span class="lineno">18195</span>         <span class="keywordflow">if</span> (cpl_table_is_valid(standard, p_label, 0)) {</div>
+<div class="line"><a name="l18196"></a><span class="lineno">18196</span>             <span class="keywordflow">if</span> (found == 0) {</div>
+<div class="line"><a name="l18197"></a><span class="lineno">18197</span>                 found = 1;</div>
+<div class="line"><a name="l18198"></a><span class="lineno">18198</span>                 mindist = fabs(bwave[i] - cwave);</div>
+<div class="line"><a name="l18199"></a><span class="lineno">18199</span>                 closest = i;</div>
+<div class="line"><a name="l18200"></a><span class="lineno">18200</span>             }</div>
+<div class="line"><a name="l18201"></a><span class="lineno">18201</span>             <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mindist > fabs(bwave[i] - cwave)) {</div>
+<div class="line"><a name="l18202"></a><span class="lineno">18202</span>                 mindist = fabs(bwave[i] - cwave);</div>
+<div class="line"><a name="l18203"></a><span class="lineno">18203</span>                 closest = i;</div>
+<div class="line"><a name="l18204"></a><span class="lineno">18204</span>             }</div>
+<div class="line"><a name="l18205"></a><span class="lineno">18205</span>         }</div>
+<div class="line"><a name="l18206"></a><span class="lineno">18206</span>     }</div>
+<div class="line"><a name="l18207"></a><span class="lineno">18207</span> </div>
+<div class="line"><a name="l18208"></a><span class="lineno">18208</span>     <span class="keywordflow">if</span> (!found) {</div>
+<div class="line"><a name="l18209"></a><span class="lineno">18209</span>         cpl_table_delete(standard);</div>
+<div class="line"><a name="l18210"></a><span class="lineno">18210</span>         cpl_image_delete(q_signal);</div>
+<div class="line"><a name="l18211"></a><span class="lineno">18211</span>         cpl_image_delete(q_noise);</div>
+<div class="line"><a name="l18212"></a><span class="lineno">18212</span>         cpl_image_delete(u_signal);</div>
+<div class="line"><a name="l18213"></a><span class="lineno">18213</span>         cpl_image_delete(u_noise);</div>
+<div class="line"><a name="l18214"></a><span class="lineno">18214</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"No reference value available"</span>);</div>
+<div class="line"><a name="l18215"></a><span class="lineno">18215</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l18216"></a><span class="lineno">18216</span>     }</div>
+<div class="line"><a name="l18217"></a><span class="lineno">18217</span> </div>
+<div class="line"><a name="l18218"></a><span class="lineno">18218</span>     center = (bwave[closest] - startwave) / dispersion; <span class="comment">// Center of band (pix)</span></div>
+<div class="line"><a name="l18219"></a><span class="lineno">18219</span>     cwave  =  bwave[closest];                           <span class="comment">// Wavelength of band</span></div>
+<div class="line"><a name="l18220"></a><span class="lineno">18220</span> </div>
+<div class="line"><a name="l18221"></a><span class="lineno">18221</span> </div>
+<div class="line"><a name="l18222"></a><span class="lineno">18222</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18223"></a><span class="lineno">18223</span> <span class="comment">     * Check that the integration interval is entirely contained</span></div>
+<div class="line"><a name="l18224"></a><span class="lineno">18224</span> <span class="comment">     * in the valid interval, or give it up.</span></div>
+<div class="line"><a name="l18225"></a><span class="lineno">18225</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18226"></a><span class="lineno">18226</span> </div>
+<div class="line"><a name="l18227"></a><span class="lineno">18227</span>     pband = floor(band / dispersion);  <span class="comment">// Band width in pixels</span></div>
+<div class="line"><a name="l18228"></a><span class="lineno">18228</span> </div>
+<div class="line"><a name="l18229"></a><span class="lineno">18229</span>     <span class="keywordflow">if</span> (center - pband/2 < first || center + pband/2 > last) {</div>
+<div class="line"><a name="l18230"></a><span class="lineno">18230</span>         cpl_table_delete(standard);</div>
+<div class="line"><a name="l18231"></a><span class="lineno">18231</span>         cpl_image_delete(q_signal);</div>
+<div class="line"><a name="l18232"></a><span class="lineno">18232</span>         cpl_image_delete(q_noise);</div>
+<div class="line"><a name="l18233"></a><span class="lineno">18233</span>         cpl_image_delete(u_signal);</div>
+<div class="line"><a name="l18234"></a><span class="lineno">18234</span>         cpl_image_delete(u_noise);</div>
+<div class="line"><a name="l18235"></a><span class="lineno">18235</span>         cpl_msg_warning(cpl_func, <span class="stringliteral">"No reference value available"</span>);</div>
+<div class="line"><a name="l18236"></a><span class="lineno">18236</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l18237"></a><span class="lineno">18237</span>     }</div>
+<div class="line"><a name="l18238"></a><span class="lineno">18238</span> </div>
+<div class="line"><a name="l18239"></a><span class="lineno">18239</span>     first = center - pband/2;</div>
+<div class="line"><a name="l18240"></a><span class="lineno">18240</span>     last  = center + pband/2;</div>
+<div class="line"><a name="l18241"></a><span class="lineno">18241</span> </div>
+<div class="line"><a name="l18242"></a><span class="lineno">18242</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18243"></a><span class="lineno">18243</span> <span class="comment">     * Collect reference values. Note that if angle info is not available,</span></div>
+<div class="line"><a name="l18244"></a><span class="lineno">18244</span> <span class="comment">     * angle stuff is set automaticaly to zero.</span></div>
+<div class="line"><a name="l18245"></a><span class="lineno">18245</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18246"></a><span class="lineno">18246</span> </div>
+<div class="line"><a name="l18247"></a><span class="lineno">18247</span>      p_label[0] = bands[closest];</div>
+<div class="line"><a name="l18248"></a><span class="lineno">18248</span>     dp_label[0] = bands[closest];</div>
+<div class="line"><a name="l18249"></a><span class="lineno">18249</span>      a_label[0] = bands[closest];</div>
+<div class="line"><a name="l18250"></a><span class="lineno">18250</span>     da_label[0] = bands[closest];</div>
+<div class="line"><a name="l18251"></a><span class="lineno">18251</span> </div>
+<div class="line"><a name="l18252"></a><span class="lineno">18252</span>      p_ref = cpl_table_get(standard,  p_label, 0, NULL);</div>
+<div class="line"><a name="l18253"></a><span class="lineno">18253</span>     dp_ref = cpl_table_get(standard, dp_label, 0, NULL);</div>
+<div class="line"><a name="l18254"></a><span class="lineno">18254</span>      a_ref = cpl_table_get(standard,  a_label, 0, NULL);</div>
+<div class="line"><a name="l18255"></a><span class="lineno">18255</span>     da_ref = cpl_table_get(standard, da_label, 0, NULL);</div>
+<div class="line"><a name="l18256"></a><span class="lineno">18256</span> </div>
+<div class="line"><a name="l18257"></a><span class="lineno">18257</span>     cpl_msg_info(cpl_func, </div>
+<div class="line"><a name="l18258"></a><span class="lineno">18258</span>                  <span class="stringliteral">"The expected polarisation is %.2f +- %.2f %%"</span>, </div>
+<div class="line"><a name="l18259"></a><span class="lineno">18259</span>                  p_ref, dp_ref);</div>
+<div class="line"><a name="l18260"></a><span class="lineno">18260</span> </div>
+<div class="line"><a name="l18261"></a><span class="lineno">18261</span>     <span class="keywordflow">if</span> (polarised) {</div>
+<div class="line"><a name="l18262"></a><span class="lineno">18262</span>         cpl_msg_info(cpl_func, </div>
+<div class="line"><a name="l18263"></a><span class="lineno">18263</span>                      <span class="stringliteral">"The expected polarisation angle is %.2f +- %.2f degrees"</span>, </div>
+<div class="line"><a name="l18264"></a><span class="lineno">18264</span>                      a_ref, da_ref);</div>
+<div class="line"><a name="l18265"></a><span class="lineno">18265</span>     }</div>
+<div class="line"><a name="l18266"></a><span class="lineno">18266</span> </div>
+<div class="line"><a name="l18267"></a><span class="lineno">18267</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18268"></a><span class="lineno">18268</span> <span class="comment">     * Find median signal and median error.</span></div>
+<div class="line"><a name="l18269"></a><span class="lineno">18269</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18270"></a><span class="lineno">18270</span> </div>
+<div class="line"><a name="l18271"></a><span class="lineno">18271</span>     q_obs = cpl_image_get_median_window(q_image, first, 1, last, 1);</div>
+<div class="line"><a name="l18272"></a><span class="lineno">18272</span>     q_err = cpl_image_get_median_window(q_error, first, 1, last, 1);</div>
+<div class="line"><a name="l18273"></a><span class="lineno">18273</span>     u_obs = cpl_image_get_median_window(u_image, first, 1, last, 1);</div>
+<div class="line"><a name="l18274"></a><span class="lineno">18274</span>     u_err = cpl_image_get_median_window(u_error, first, 1, last, 1);</div>
+<div class="line"><a name="l18275"></a><span class="lineno">18275</span> </div>
+<div class="line"><a name="l18276"></a><span class="lineno">18276</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18277"></a><span class="lineno">18277</span> <span class="comment">     * Measured linear polarisation and its error</span></div>
+<div class="line"><a name="l18278"></a><span class="lineno">18278</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18279"></a><span class="lineno">18279</span> </div>
+<div class="line"><a name="l18280"></a><span class="lineno">18280</span>     p_obs = sqrt(q_obs * q_obs + u_obs * u_obs);</div>
+<div class="line"><a name="l18281"></a><span class="lineno">18281</span>     p_err = CPL_MATH_SQRT1_2 * 0.5 * (q_err + u_err);</div>
+<div class="line"><a name="l18282"></a><span class="lineno">18282</span> </div>
+<div class="line"><a name="l18283"></a><span class="lineno">18283</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18284"></a><span class="lineno">18284</span> <span class="comment">     * Measured polarisation angle</span></div>
+<div class="line"><a name="l18285"></a><span class="lineno">18285</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18286"></a><span class="lineno">18286</span> </div>
+<div class="line"><a name="l18287"></a><span class="lineno">18287</span>     a_obs = 0.0;</div>
+<div class="line"><a name="l18288"></a><span class="lineno">18288</span>     <span class="keywordflow">if</span> (polarised) {</div>
+<div class="line"><a name="l18289"></a><span class="lineno">18289</span>         <span class="keywordflow">if</span> (fabs(q_obs) < 0.00001) {</div>
+<div class="line"><a name="l18290"></a><span class="lineno">18290</span>             <span class="keywordflow">if</span> (u_obs > 0.0) {</div>
+<div class="line"><a name="l18291"></a><span class="lineno">18291</span>                 a_obs = 45.0;</div>
+<div class="line"><a name="l18292"></a><span class="lineno">18292</span>             }</div>
+<div class="line"><a name="l18293"></a><span class="lineno">18293</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l18294"></a><span class="lineno">18294</span>                 a_obs = 135.0;</div>
+<div class="line"><a name="l18295"></a><span class="lineno">18295</span>             }</div>
+<div class="line"><a name="l18296"></a><span class="lineno">18296</span>         }</div>
+<div class="line"><a name="l18297"></a><span class="lineno">18297</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l18298"></a><span class="lineno">18298</span>             a_obs = 0.5 * atan(u_obs / q_obs) * 180 / CPL_MATH_PI;</div>
+<div class="line"><a name="l18299"></a><span class="lineno">18299</span>             <span class="keywordflow">if</span> (q_obs > 0.0) {</div>
+<div class="line"><a name="l18300"></a><span class="lineno">18300</span>                 <span class="keywordflow">if</span> (u_obs < 0.0) {</div>
+<div class="line"><a name="l18301"></a><span class="lineno">18301</span>                     a_obs += 180.;</div>
+<div class="line"><a name="l18302"></a><span class="lineno">18302</span>                 }</div>
+<div class="line"><a name="l18303"></a><span class="lineno">18303</span>             }</div>
+<div class="line"><a name="l18304"></a><span class="lineno">18304</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l18305"></a><span class="lineno">18305</span>                 a_obs += 90.;</div>
+<div class="line"><a name="l18306"></a><span class="lineno">18306</span>             }</div>
+<div class="line"><a name="l18307"></a><span class="lineno">18307</span>         }</div>
+<div class="line"><a name="l18308"></a><span class="lineno">18308</span>     }</div>
+<div class="line"><a name="l18309"></a><span class="lineno">18309</span> </div>
+<div class="line"><a name="l18310"></a><span class="lineno">18310</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18311"></a><span class="lineno">18311</span> <span class="comment">     * Error on polarisation angle</span></div>
+<div class="line"><a name="l18312"></a><span class="lineno">18312</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18313"></a><span class="lineno">18313</span> </div>
+<div class="line"><a name="l18314"></a><span class="lineno">18314</span>     a_err = 0.0;</div>
+<div class="line"><a name="l18315"></a><span class="lineno">18315</span>     <span class="keywordflow">if</span> (polarised) {</div>
+<div class="line"><a name="l18316"></a><span class="lineno">18316</span>         a_err = sqrt(q_obs*q_obs*u_err*u_err + u_obs*u_obs*q_err*q_err)</div>
+<div class="line"><a name="l18317"></a><span class="lineno">18317</span>               / (p_obs * p_obs) </div>
+<div class="line"><a name="l18318"></a><span class="lineno">18318</span>               * 90 / CPL_MATH_PI;</div>
+<div class="line"><a name="l18319"></a><span class="lineno">18319</span>     }</div>
+<div class="line"><a name="l18320"></a><span class="lineno">18320</span> </div>
+<div class="line"><a name="l18321"></a><span class="lineno">18321</span>     p_obs *= 100;</div>
+<div class="line"><a name="l18322"></a><span class="lineno">18322</span>     p_err *= 100;</div>
+<div class="line"><a name="l18323"></a><span class="lineno">18323</span>     cpl_msg_info(cpl_func, </div>
+<div class="line"><a name="l18324"></a><span class="lineno">18324</span>                  <span class="stringliteral">"The measured polarisation is %.2f +- %.2f %%"</span>, </div>
+<div class="line"><a name="l18325"></a><span class="lineno">18325</span>                  p_obs, p_err);</div>
+<div class="line"><a name="l18326"></a><span class="lineno">18326</span> </div>
+<div class="line"><a name="l18327"></a><span class="lineno">18327</span>     <span class="keywordflow">if</span> (polarised) {</div>
+<div class="line"><a name="l18328"></a><span class="lineno">18328</span>         cpl_msg_info(cpl_func, </div>
+<div class="line"><a name="l18329"></a><span class="lineno">18329</span>                      <span class="stringliteral">"The measured polarisation angle is %.2f +- %.2f degrees"</span>, </div>
+<div class="line"><a name="l18330"></a><span class="lineno">18330</span>                      a_obs, a_err);</div>
+<div class="line"><a name="l18331"></a><span class="lineno">18331</span>     }</div>
+<div class="line"><a name="l18332"></a><span class="lineno">18332</span> </div>
+<div class="line"><a name="l18333"></a><span class="lineno">18333</span>     *filter       = bands[closest];</div>
+<div class="line"><a name="l18334"></a><span class="lineno">18334</span>     *polarisation = polarised;</div>
+<div class="line"><a name="l18335"></a><span class="lineno">18335</span> </div>
+<div class="line"><a name="l18336"></a><span class="lineno">18336</span>     <span class="keywordflow">if</span> (polarised) {</div>
+<div class="line"><a name="l18337"></a><span class="lineno">18337</span>         *p_offset = (p_obs - p_ref) / p_ref;</div>
+<div class="line"><a name="l18338"></a><span class="lineno">18338</span>         *p_error  = sqrt(p_err * p_err + dp_ref * dp_ref) / p_ref;</div>
+<div class="line"><a name="l18339"></a><span class="lineno">18339</span>     }</div>
+<div class="line"><a name="l18340"></a><span class="lineno">18340</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l18341"></a><span class="lineno">18341</span>         *p_offset = p_obs - p_ref;</div>
+<div class="line"><a name="l18342"></a><span class="lineno">18342</span>         *p_error  = sqrt(p_err * p_err + dp_ref * dp_ref);</div>
+<div class="line"><a name="l18343"></a><span class="lineno">18343</span>     }</div>
+<div class="line"><a name="l18344"></a><span class="lineno">18344</span> </div>
+<div class="line"><a name="l18345"></a><span class="lineno">18345</span>     *a_offset     = a_obs - a_ref;</div>
+<div class="line"><a name="l18346"></a><span class="lineno">18346</span>     *a_error      = sqrt(a_err*a_err + da_ref*da_ref);</div>
+<div class="line"><a name="l18347"></a><span class="lineno">18347</span> </div>
+<div class="line"><a name="l18348"></a><span class="lineno">18348</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l18349"></a><span class="lineno">18349</span> </div>
+<div class="line"><a name="l18350"></a><span class="lineno">18350</span> }</div>
+<div class="line"><a name="l18351"></a><span class="lineno">18351</span> </div>
+<div class="line"><a name="l18352"></a><span class="lineno">18352</span> </div>
+<div class="line"><a name="l18384"></a><span class="lineno"><a class="code" href="group__moses.html#gac442710556a5013dedd29befac482c9d">18384</a></span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gac442710556a5013dedd29befac482c9d" title="Estimate offset between two object tables.">mos_compute_offset</a>(cpl_table *reference, cpl_table *objects, <span class="keywordtype">double</span> *offset)</div>
+<div class="line"><a name="l18385"></a><span class="lineno">18385</span> {</div>
+<div class="line"><a name="l18386"></a><span class="lineno">18386</span>     cpl_array *offsets;</div>
+<div class="line"><a name="l18387"></a><span class="lineno">18387</span>     <span class="keywordtype">int</span>        noffset;</div>
+<div class="line"><a name="l18388"></a><span class="lineno">18388</span>     <span class="keywordtype">int</span>        nslits = cpl_table_get_nrow(reference);</div>
+<div class="line"><a name="l18389"></a><span class="lineno">18389</span>     <span class="keywordtype">int</span>       *nref;</div>
+<div class="line"><a name="l18390"></a><span class="lineno">18390</span>     <span class="keywordtype">int</span>       *nobj;</div>
+<div class="line"><a name="l18391"></a><span class="lineno">18391</span>     <span class="keywordtype">int</span>        corr, maxcorr;</div>
+<div class="line"><a name="l18392"></a><span class="lineno">18392</span>     <span class="keywordtype">int</span>        best_shift;</div>
+<div class="line"><a name="l18393"></a><span class="lineno">18393</span>     <span class="keywordtype">int</span>        i, j, k;</div>
+<div class="line"><a name="l18394"></a><span class="lineno">18394</span> </div>
+<div class="line"><a name="l18395"></a><span class="lineno">18395</span>     cpl_error_code status = CPL_ERROR_NONE;</div>
+<div class="line"><a name="l18396"></a><span class="lineno">18396</span> </div>
+<div class="line"><a name="l18397"></a><span class="lineno">18397</span> </div>
+<div class="line"><a name="l18398"></a><span class="lineno">18398</span>     *offset = 0.0;</div>
+<div class="line"><a name="l18399"></a><span class="lineno">18399</span> </div>
+<div class="line"><a name="l18400"></a><span class="lineno">18400</span>     <span class="keywordflow">if</span> (nslits != cpl_table_get_nrow(objects))</div>
+<div class="line"><a name="l18401"></a><span class="lineno">18401</span>         <span class="keywordflow">return</span> CPL_ERROR_INCOMPATIBLE_INPUT;</div>
+<div class="line"><a name="l18402"></a><span class="lineno">18402</span> </div>
+<div class="line"><a name="l18403"></a><span class="lineno">18403</span>     nref = fors_get_nobjs_perslit(reference);</div>
+<div class="line"><a name="l18404"></a><span class="lineno">18404</span>     nobj = fors_get_nobjs_perslit(objects);</div>
+<div class="line"><a name="l18405"></a><span class="lineno">18405</span> </div>
+<div class="line"><a name="l18406"></a><span class="lineno">18406</span>     noffset = 0;</div>
+<div class="line"><a name="l18407"></a><span class="lineno">18407</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)</div>
+<div class="line"><a name="l18408"></a><span class="lineno">18408</span>         noffset += nobj[i];</div>
+<div class="line"><a name="l18409"></a><span class="lineno">18409</span> </div>
+<div class="line"><a name="l18410"></a><span class="lineno">18410</span>     <span class="keywordflow">if</span> (noffset == 0) {</div>
+<div class="line"><a name="l18411"></a><span class="lineno">18411</span>         cpl_free(nref);</div>
+<div class="line"><a name="l18412"></a><span class="lineno">18412</span>         cpl_free(nobj);</div>
+<div class="line"><a name="l18413"></a><span class="lineno">18413</span>         <span class="keywordflow">return</span> CPL_ERROR_DATA_NOT_FOUND;</div>
+<div class="line"><a name="l18414"></a><span class="lineno">18414</span>     }</div>
+<div class="line"><a name="l18415"></a><span class="lineno">18415</span> </div>
+<div class="line"><a name="l18416"></a><span class="lineno">18416</span>     noffset = 0;</div>
+<div class="line"><a name="l18417"></a><span class="lineno">18417</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++)</div>
+<div class="line"><a name="l18418"></a><span class="lineno">18418</span>         noffset += nref[i];</div>
+<div class="line"><a name="l18419"></a><span class="lineno">18419</span> </div>
+<div class="line"><a name="l18420"></a><span class="lineno">18420</span>     <span class="keywordflow">if</span> (noffset == 0) {</div>
+<div class="line"><a name="l18421"></a><span class="lineno">18421</span>         cpl_free(nref);</div>
+<div class="line"><a name="l18422"></a><span class="lineno">18422</span>         cpl_free(nobj);</div>
+<div class="line"><a name="l18423"></a><span class="lineno">18423</span>         <span class="keywordflow">return</span> CPL_ERROR_DATA_NOT_FOUND;</div>
+<div class="line"><a name="l18424"></a><span class="lineno">18424</span>     }</div>
+<div class="line"><a name="l18425"></a><span class="lineno">18425</span> </div>
+<div class="line"><a name="l18426"></a><span class="lineno">18426</span>     offsets = cpl_array_new(noffset, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l18427"></a><span class="lineno">18427</span> </div>
+<div class="line"><a name="l18428"></a><span class="lineno">18428</span>     noffset = 0;    <span class="comment">// The real number of offsets found will be counted.</span></div>
+<div class="line"><a name="l18429"></a><span class="lineno">18429</span> </div>
+<div class="line"><a name="l18430"></a><span class="lineno">18430</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l18431"></a><span class="lineno">18431</span>         <span class="keywordflow">if</span> (nref[i] > 0 && nobj[i] > 0) {</div>
+<div class="line"><a name="l18432"></a><span class="lineno">18432</span>             <span class="keywordtype">double</span> shift;</div>
+<div class="line"><a name="l18433"></a><span class="lineno">18433</span>             <span class="keywordtype">int</span>    length  = cpl_table_get_int(objects, <span class="stringliteral">"length"</span>, i, NULL);</div>
+<div class="line"><a name="l18434"></a><span class="lineno">18434</span>             <span class="keywordtype">double</span> ytop    = cpl_table_get_double(objects, <span class="stringliteral">"xtop"</span>, i, NULL);</div>
+<div class="line"><a name="l18435"></a><span class="lineno">18435</span>             <span class="keywordtype">double</span> ybottom = cpl_table_get_double(objects, <span class="stringliteral">"xbottom"</span>, i, NULL);</div>
+<div class="line"><a name="l18436"></a><span class="lineno">18436</span>             <span class="keywordtype">int</span>   *aref    = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l18437"></a><span class="lineno">18437</span>             <span class="keywordtype">int</span>   *aobj    = cpl_calloc(length, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l18438"></a><span class="lineno">18438</span>             <span class="keywordtype">float</span> *pref    = cpl_calloc(nref[i], <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));</div>
+<div class="line"><a name="l18439"></a><span class="lineno">18439</span>             <span class="keywordtype">float</span> *pobj    = cpl_calloc(nobj[i], <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));</div>
+<div class="line"><a name="l18440"></a><span class="lineno">18440</span>             </div>
+<div class="line"><a name="l18441"></a><span class="lineno">18441</span>             <span class="keywordflow">for</span> (j = 0; j < nref[i]; j++) {</div>
+<div class="line"><a name="l18442"></a><span class="lineno">18442</span>                 pref[j] = fors_get_object_position(reference, i, j + 1);</div>
+<div class="line"><a name="l18443"></a><span class="lineno">18443</span>                 aref[(int)pref[j]] = 1;</div>
+<div class="line"><a name="l18444"></a><span class="lineno">18444</span>             }</div>
+<div class="line"><a name="l18445"></a><span class="lineno">18445</span> </div>
+<div class="line"><a name="l18446"></a><span class="lineno">18446</span>             <span class="keywordflow">for</span> (j = 0; j < nobj[i]; j++) {</div>
+<div class="line"><a name="l18447"></a><span class="lineno">18447</span>                 pobj[j] = fors_get_object_position(objects, i, j + 1);</div>
+<div class="line"><a name="l18448"></a><span class="lineno">18448</span>                 aobj[(int)pobj[j]] = 1;</div>
+<div class="line"><a name="l18449"></a><span class="lineno">18449</span>             }</div>
+<div class="line"><a name="l18450"></a><span class="lineno">18450</span> </div>
+<div class="line"><a name="l18451"></a><span class="lineno">18451</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l18452"></a><span class="lineno">18452</span> <span class="comment">             * Do not consider objects at border</span></div>
+<div class="line"><a name="l18453"></a><span class="lineno">18453</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l18454"></a><span class="lineno">18454</span> </div>
+<div class="line"><a name="l18455"></a><span class="lineno">18455</span>             aref[0] = 0;</div>
+<div class="line"><a name="l18456"></a><span class="lineno">18456</span>             aref[length - 1] = 0;</div>
+<div class="line"><a name="l18457"></a><span class="lineno">18457</span>             aobj[0] = 0;</div>
+<div class="line"><a name="l18458"></a><span class="lineno">18458</span>             aobj[length - 1] = 0;</div>
+<div class="line"><a name="l18459"></a><span class="lineno">18459</span> </div>
+<div class="line"><a name="l18460"></a><span class="lineno">18460</span> <span class="comment">//for (j = 0; j < nref[i]; j++)</span></div>
+<div class="line"><a name="l18461"></a><span class="lineno">18461</span> <span class="comment">//printf("references: %f, ", pref[j]);</span></div>
+<div class="line"><a name="l18462"></a><span class="lineno">18462</span> <span class="comment">//printf("\n");</span></div>
+<div class="line"><a name="l18463"></a><span class="lineno">18463</span> <span class="comment">//for (j = 0; j < nref[i]; j++)</span></div>
+<div class="line"><a name="l18464"></a><span class="lineno">18464</span> <span class="comment">//printf("objects   : %f, ", pobj[j]);</span></div>
+<div class="line"><a name="l18465"></a><span class="lineno">18465</span> <span class="comment">//printf("\n");</span></div>
+<div class="line"><a name="l18466"></a><span class="lineno">18466</span> <span class="comment">//for (j = 0; j < length; j++)</span></div>
+<div class="line"><a name="l18467"></a><span class="lineno">18467</span> <span class="comment">//printf("%d", aref[j]);</span></div>
+<div class="line"><a name="l18468"></a><span class="lineno">18468</span> <span class="comment">//printf("\n");</span></div>
+<div class="line"><a name="l18469"></a><span class="lineno">18469</span> <span class="comment">//for (j = 0; j < length; j++)</span></div>
+<div class="line"><a name="l18470"></a><span class="lineno">18470</span> <span class="comment">//printf("%d", aobj[j]);</span></div>
+<div class="line"><a name="l18471"></a><span class="lineno">18471</span> <span class="comment">//printf("\n");</span></div>
+<div class="line"><a name="l18472"></a><span class="lineno">18472</span> </div>
+<div class="line"><a name="l18473"></a><span class="lineno">18473</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l18474"></a><span class="lineno">18474</span> <span class="comment">             * Object matching by correlation</span></div>
+<div class="line"><a name="l18475"></a><span class="lineno">18475</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l18476"></a><span class="lineno">18476</span> </div>
+<div class="line"><a name="l18477"></a><span class="lineno">18477</span>             maxcorr = 0;</div>
+<div class="line"><a name="l18478"></a><span class="lineno">18478</span>             best_shift = length;</div>
+<div class="line"><a name="l18479"></a><span class="lineno">18479</span> </div>
+<div class="line"><a name="l18480"></a><span class="lineno">18480</span>             <span class="keywordflow">for</span> (shift = length/2, j = 0; j <= length; shift--, j++) {</div>
+<div class="line"><a name="l18481"></a><span class="lineno">18481</span>                 <span class="keywordtype">int</span> rstart, ostart, count;</div>
+<div class="line"><a name="l18482"></a><span class="lineno">18482</span> </div>
+<div class="line"><a name="l18483"></a><span class="lineno">18483</span>                 <span class="keywordflow">if</span> (shift > 0) {</div>
+<div class="line"><a name="l18484"></a><span class="lineno">18484</span>                    rstart = shift;</div>
+<div class="line"><a name="l18485"></a><span class="lineno">18485</span>                    ostart = 0;</div>
+<div class="line"><a name="l18486"></a><span class="lineno">18486</span>                    count  = length - shift;</div>
+<div class="line"><a name="l18487"></a><span class="lineno">18487</span>                 }</div>
+<div class="line"><a name="l18488"></a><span class="lineno">18488</span>                 <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l18489"></a><span class="lineno">18489</span>                    rstart = 0;</div>
+<div class="line"><a name="l18490"></a><span class="lineno">18490</span>                    ostart = -shift;</div>
+<div class="line"><a name="l18491"></a><span class="lineno">18491</span>                    count  = length + shift;</div>
+<div class="line"><a name="l18492"></a><span class="lineno">18492</span>                 }</div>
+<div class="line"><a name="l18493"></a><span class="lineno">18493</span> </div>
+<div class="line"><a name="l18494"></a><span class="lineno">18494</span>                 corr = 0;</div>
+<div class="line"><a name="l18495"></a><span class="lineno">18495</span>                 <span class="keywordflow">for</span> (k = 0; k < count; k++) {</div>
+<div class="line"><a name="l18496"></a><span class="lineno">18496</span>                     corr += aref[rstart + k] * aobj[ostart + k];</div>
+<div class="line"><a name="l18497"></a><span class="lineno">18497</span>                 }</div>
+<div class="line"><a name="l18498"></a><span class="lineno">18498</span> </div>
+<div class="line"><a name="l18499"></a><span class="lineno">18499</span>                 <span class="keywordflow">if</span> (maxcorr < corr) {</div>
+<div class="line"><a name="l18500"></a><span class="lineno">18500</span>                     maxcorr = corr;</div>
+<div class="line"><a name="l18501"></a><span class="lineno">18501</span>                     best_shift = shift;</div>
+<div class="line"><a name="l18502"></a><span class="lineno">18502</span>                 }</div>
+<div class="line"><a name="l18503"></a><span class="lineno">18503</span>             }</div>
+<div class="line"><a name="l18504"></a><span class="lineno">18504</span> </div>
+<div class="line"><a name="l18505"></a><span class="lineno">18505</span>             <span class="keywordflow">if</span> (best_shift == length) { <span class="comment">// No shift found</span></div>
+<div class="line"><a name="l18506"></a><span class="lineno">18506</span> <span class="comment">//printf("%d: No shift found\n", i);</span></div>
+<div class="line"><a name="l18507"></a><span class="lineno">18507</span>                 cpl_free(aref);</div>
+<div class="line"><a name="l18508"></a><span class="lineno">18508</span>                 cpl_free(aobj);</div>
+<div class="line"><a name="l18509"></a><span class="lineno">18509</span>                 cpl_free(pref);</div>
+<div class="line"><a name="l18510"></a><span class="lineno">18510</span>                 cpl_free(pobj);</div>
+<div class="line"><a name="l18511"></a><span class="lineno">18511</span>                 <span class="keywordflow">continue</span>;</div>
+<div class="line"><a name="l18512"></a><span class="lineno">18512</span>             }</div>
+<div class="line"><a name="l18513"></a><span class="lineno">18513</span> <span class="comment">//printf("%d: Integer shift found = %d\n", i, best_shift);</span></div>
+<div class="line"><a name="l18514"></a><span class="lineno">18514</span> </div>
+<div class="line"><a name="l18515"></a><span class="lineno">18515</span>             <span class="keywordflow">for</span> (j = 0; j < nref[i]; j++) {</div>
+<div class="line"><a name="l18516"></a><span class="lineno">18516</span>                 <span class="keywordflow">for</span> (k = 0; k < nobj[i]; k++) {</div>
+<div class="line"><a name="l18517"></a><span class="lineno">18517</span>                     <span class="keywordflow">if</span> (fabs(pref[j] - pobj[k] - best_shift) < 2) {</div>
+<div class="line"><a name="l18518"></a><span class="lineno">18518</span>                        <span class="keywordtype">double</span> ccd_offset = (pref[j] - pobj[k]) </div>
+<div class="line"><a name="l18519"></a><span class="lineno">18519</span>                                          * (ytop - ybottom)</div>
+<div class="line"><a name="l18520"></a><span class="lineno">18520</span>                                          / length;</div>
+<div class="line"><a name="l18521"></a><span class="lineno">18521</span> </div>
+<div class="line"><a name="l18522"></a><span class="lineno">18522</span> <span class="comment">//printf("%d: Match found: %f\n", i, ccd_offset);</span></div>
+<div class="line"><a name="l18523"></a><span class="lineno">18523</span>                        <span class="comment">/* </span></div>
+<div class="line"><a name="l18524"></a><span class="lineno">18524</span> <span class="comment">                        * The matching object is found, store the</span></div>
+<div class="line"><a name="l18525"></a><span class="lineno">18525</span> <span class="comment">                        * corresponding offset</span></div>
+<div class="line"><a name="l18526"></a><span class="lineno">18526</span> <span class="comment">                        */</span></div>
+<div class="line"><a name="l18527"></a><span class="lineno">18527</span> </div>
+<div class="line"><a name="l18528"></a><span class="lineno">18528</span>                        cpl_array_set(offsets, noffset, ccd_offset);</div>
+<div class="line"><a name="l18529"></a><span class="lineno">18529</span>                        noffset++;</div>
+<div class="line"><a name="l18530"></a><span class="lineno">18530</span>                        <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l18531"></a><span class="lineno">18531</span>                     }</div>
+<div class="line"><a name="l18532"></a><span class="lineno">18532</span>                 }</div>
+<div class="line"><a name="l18533"></a><span class="lineno">18533</span>             }</div>
+<div class="line"><a name="l18534"></a><span class="lineno">18534</span> </div>
+<div class="line"><a name="l18535"></a><span class="lineno">18535</span>             cpl_free(aref);</div>
+<div class="line"><a name="l18536"></a><span class="lineno">18536</span>             cpl_free(aobj);</div>
+<div class="line"><a name="l18537"></a><span class="lineno">18537</span>             cpl_free(pref);</div>
+<div class="line"><a name="l18538"></a><span class="lineno">18538</span>             cpl_free(pobj);</div>
+<div class="line"><a name="l18539"></a><span class="lineno">18539</span>         }</div>
+<div class="line"><a name="l18540"></a><span class="lineno">18540</span> <span class="comment">//else</span></div>
+<div class="line"><a name="l18541"></a><span class="lineno">18541</span> <span class="comment">//printf("%d: No object found\n", i);</span></div>
+<div class="line"><a name="l18542"></a><span class="lineno">18542</span>     }</div>
+<div class="line"><a name="l18543"></a><span class="lineno">18543</span> </div>
+<div class="line"><a name="l18544"></a><span class="lineno">18544</span>     cpl_free(nref);</div>
+<div class="line"><a name="l18545"></a><span class="lineno">18545</span>     cpl_free(nobj);</div>
+<div class="line"><a name="l18546"></a><span class="lineno">18546</span> </div>
+<div class="line"><a name="l18547"></a><span class="lineno">18547</span> <span class="comment">//printf("%d offsets found in total\n", noffset);</span></div>
+<div class="line"><a name="l18548"></a><span class="lineno">18548</span>     <span class="keywordflow">if</span> (noffset > 0) {</div>
+<div class="line"><a name="l18549"></a><span class="lineno">18549</span>         <span class="keywordflow">if</span> (noffset % 2) {</div>
+<div class="line"><a name="l18550"></a><span class="lineno">18550</span>             *offset = cpl_array_get_median(offsets);</div>
+<div class="line"><a name="l18551"></a><span class="lineno">18551</span>         }</div>
+<div class="line"><a name="l18552"></a><span class="lineno">18552</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l18553"></a><span class="lineno">18553</span>             <span class="keywordtype">double</span> *a = cpl_malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">double</span>) * noffset);</div>
+<div class="line"><a name="l18554"></a><span class="lineno">18554</span>             <span class="keywordflow">for</span> (i = 0; i < noffset; i++) {</div>
+<div class="line"><a name="l18555"></a><span class="lineno">18555</span>                 a[i] = cpl_array_get_double(offsets, i, NULL);</div>
+<div class="line"><a name="l18556"></a><span class="lineno">18556</span>             }</div>
+<div class="line"><a name="l18557"></a><span class="lineno">18557</span>             *offset = (<a class="code" href="group__fors__utils.html#gac3759b058af73511a69998299a11a40f" title="Same as cpl_tools_get_kth_double.">fors_tools_get_kth_double</a>(a, noffset, (noffset-1)/2) +</div>
+<div class="line"><a name="l18558"></a><span class="lineno">18558</span>                        <a class="code" href="group__fors__utils.html#gac3759b058af73511a69998299a11a40f" title="Same as cpl_tools_get_kth_double.">fors_tools_get_kth_double</a>(a, noffset, (noffset/2))) / 2.0;</div>
+<div class="line"><a name="l18559"></a><span class="lineno">18559</span>             cpl_free(a);</div>
+<div class="line"><a name="l18560"></a><span class="lineno">18560</span>         }</div>
+<div class="line"><a name="l18561"></a><span class="lineno">18561</span>     }</div>
+<div class="line"><a name="l18562"></a><span class="lineno">18562</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l18563"></a><span class="lineno">18563</span>         status = CPL_ERROR_DATA_NOT_FOUND;</div>
+<div class="line"><a name="l18564"></a><span class="lineno">18564</span> <span class="comment">//printf("Median offset: %f\n", *offset);</span></div>
+<div class="line"><a name="l18565"></a><span class="lineno">18565</span> </div>
+<div class="line"><a name="l18566"></a><span class="lineno">18566</span>     cpl_array_delete(offsets);</div>
+<div class="line"><a name="l18567"></a><span class="lineno">18567</span> </div>
+<div class="line"><a name="l18568"></a><span class="lineno">18568</span>     <span class="keywordflow">return</span> status;</div>
+<div class="line"><a name="l18569"></a><span class="lineno">18569</span> </div>
+<div class="line"><a name="l18570"></a><span class="lineno">18570</span> }</div>
+<div class="line"><a name="l18571"></a><span class="lineno">18571</span> </div>
+<div class="line"><a name="l18572"></a><span class="lineno">18572</span> </div>
+<div class="line"><a name="l18584"></a><span class="lineno"><a class="code" href="group__moses.html#ga82c7c158316d8aba35ffa271b44510c6">18584</a></span> cpl_error_code <a class="code" href="group__moses.html#ga82c7c158316d8aba35ffa271b44510c6" title="Shift values in an image.">mos_image_shift</a>(cpl_image *image, <span class="keywordtype">double</span> dx, <span class="keywordtype">double</span> dy)</div>
+<div class="line"><a name="l18585"></a><span class="lineno">18585</span> {</div>
+<div class="line"><a name="l18586"></a><span class="lineno">18586</span>     cpl_image *source;</div>
+<div class="line"><a name="l18587"></a><span class="lineno">18587</span>     <span class="keywordtype">int</span>        nx = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l18588"></a><span class="lineno">18588</span>     <span class="keywordtype">int</span>        ny = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l18589"></a><span class="lineno">18589</span>     <span class="keywordtype">float</span>     *idata;</div>
+<div class="line"><a name="l18590"></a><span class="lineno">18590</span>     <span class="keywordtype">float</span>     *sdata;</div>
+<div class="line"><a name="l18591"></a><span class="lineno">18591</span>     <span class="keywordtype">int</span>        i, j, pos;</div>
+<div class="line"><a name="l18592"></a><span class="lineno">18592</span>     <span class="keywordtype">double</span>     xpos, ypos, xfrac, yfrac;</div>
+<div class="line"><a name="l18593"></a><span class="lineno">18593</span>     <span class="keywordtype">int</span>        xint, yint;</div>
+<div class="line"><a name="l18594"></a><span class="lineno">18594</span> </div>
+<div class="line"><a name="l18595"></a><span class="lineno">18595</span> </div>
+<div class="line"><a name="l18596"></a><span class="lineno">18596</span>     <span class="keywordflow">if</span> (fabs(dx) >= nx || fabs(dy) >= ny)</div>
+<div class="line"><a name="l18597"></a><span class="lineno">18597</span>         <span class="keywordflow">return</span> CPL_ERROR_ACCESS_OUT_OF_RANGE;</div>
+<div class="line"><a name="l18598"></a><span class="lineno">18598</span> </div>
+<div class="line"><a name="l18599"></a><span class="lineno">18599</span>     source = cpl_image_duplicate(image);</div>
+<div class="line"><a name="l18600"></a><span class="lineno">18600</span>     idata = cpl_image_get_data_float(image);</div>
+<div class="line"><a name="l18601"></a><span class="lineno">18601</span>     sdata = cpl_image_get_data_float(source);</div>
+<div class="line"><a name="l18602"></a><span class="lineno">18602</span> </div>
+<div class="line"><a name="l18603"></a><span class="lineno">18603</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18604"></a><span class="lineno">18604</span> <span class="comment">     * Shift in y</span></div>
+<div class="line"><a name="l18605"></a><span class="lineno">18605</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18606"></a><span class="lineno">18606</span> </div>
+<div class="line"><a name="l18607"></a><span class="lineno">18607</span>     yfrac = - dy - floor(- dy);</div>
+<div class="line"><a name="l18608"></a><span class="lineno">18608</span>     xfrac = - dx - floor(- dx);</div>
+<div class="line"><a name="l18609"></a><span class="lineno">18609</span> </div>
+<div class="line"><a name="l18610"></a><span class="lineno">18610</span>     <span class="keywordflow">for</span> (pos = 0, j = 0; j < ny; j++) {</div>
+<div class="line"><a name="l18611"></a><span class="lineno">18611</span>         ypos = j - dy;</div>
+<div class="line"><a name="l18612"></a><span class="lineno">18612</span>         yint = floor(ypos);</div>
+<div class="line"><a name="l18613"></a><span class="lineno">18613</span>         <span class="keywordflow">for</span> (i = 0; i < nx; i++) {</div>
+<div class="line"><a name="l18614"></a><span class="lineno">18614</span>             xpos = i - dx;</div>
+<div class="line"><a name="l18615"></a><span class="lineno">18615</span>             xint = floor(xpos);</div>
+<div class="line"><a name="l18616"></a><span class="lineno">18616</span>             <span class="keywordflow">if</span> (xint < 0 || yint < 0 || xint > nx - 2 || yint > ny - 2) {</div>
+<div class="line"><a name="l18617"></a><span class="lineno">18617</span>                 idata[pos] = 0.0;</div>
+<div class="line"><a name="l18618"></a><span class="lineno">18618</span>             }</div>
+<div class="line"><a name="l18619"></a><span class="lineno">18619</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l18620"></a><span class="lineno">18620</span>                 idata[pos] = sdata[xint + nx*yint] * (1 - xfrac) * (1 - yfrac)</div>
+<div class="line"><a name="l18621"></a><span class="lineno">18621</span>                            + sdata[xint + 1 + nx*yint] * xfrac * (1 - yfrac)</div>
+<div class="line"><a name="l18622"></a><span class="lineno">18622</span>                            + sdata[xint + nx*(yint + 1)] * (1 - xfrac) * yfrac</div>
+<div class="line"><a name="l18623"></a><span class="lineno">18623</span>                            + sdata[xint + 1 + nx*(yint + 1)] * xfrac * yfrac;</div>
+<div class="line"><a name="l18624"></a><span class="lineno">18624</span>             }</div>
+<div class="line"><a name="l18625"></a><span class="lineno">18625</span>             pos++;</div>
+<div class="line"><a name="l18626"></a><span class="lineno">18626</span>         }</div>
+<div class="line"><a name="l18627"></a><span class="lineno">18627</span>     }</div>
+<div class="line"><a name="l18628"></a><span class="lineno">18628</span> </div>
+<div class="line"><a name="l18629"></a><span class="lineno">18629</span>     cpl_image_delete(source);</div>
+<div class="line"><a name="l18630"></a><span class="lineno">18630</span> </div>
+<div class="line"><a name="l18631"></a><span class="lineno">18631</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l18632"></a><span class="lineno">18632</span> }</div>
+<div class="line"><a name="l18633"></a><span class="lineno">18633</span> </div>
+<div class="line"><a name="l18645"></a><span class="lineno"><a class="code" href="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31">18645</a></span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31" title="Return slit closest to CCD center.">mos_slit_closest_to_center</a>(cpl_table *slits, <span class="keywordtype">int</span> nx, <span class="keywordtype">int</span> ny)</div>
+<div class="line"><a name="l18646"></a><span class="lineno">18646</span> {</div>
+<div class="line"><a name="l18647"></a><span class="lineno">18647</span> <span class="preprocessor">#ifdef CPL_SIZE_FORMAT</span></div>
+<div class="line"><a name="l18648"></a><span class="lineno">18648</span> <span class="preprocessor"></span>    cpl_size row;</div>
+<div class="line"><a name="l18649"></a><span class="lineno">18649</span> <span class="preprocessor">#else</span></div>
+<div class="line"><a name="l18650"></a><span class="lineno">18650</span> <span class="preprocessor"></span>    <span class="keywordtype">int</span> row;</div>
+<div class="line"><a name="l18651"></a><span class="lineno">18651</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l18652"></a><span class="lineno">18652</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l18653"></a><span class="lineno">18653</span>     cpl_table_duplicate_column(slits, <span class="stringliteral">"x"</span>, slits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l18654"></a><span class="lineno">18654</span>     cpl_table_add_columns(slits, <span class="stringliteral">"x"</span>, <span class="stringliteral">"xbottom"</span>);</div>
+<div class="line"><a name="l18655"></a><span class="lineno">18655</span>     cpl_table_divide_scalar(slits, <span class="stringliteral">"x"</span>, 2);         <span class="comment">// Mean x position</span></div>
+<div class="line"><a name="l18656"></a><span class="lineno">18656</span>     cpl_table_subtract_scalar(slits, <span class="stringliteral">"x"</span>, nx/2);    <span class="comment">// Relative to CCD center</span></div>
+<div class="line"><a name="l18657"></a><span class="lineno">18657</span>     cpl_table_multiply_columns(slits, <span class="stringliteral">"x"</span>, <span class="stringliteral">"x"</span>);    <span class="comment">// Squared</span></div>
+<div class="line"><a name="l18658"></a><span class="lineno">18658</span> </div>
+<div class="line"><a name="l18659"></a><span class="lineno">18659</span>     cpl_table_duplicate_column(slits, <span class="stringliteral">"y"</span>, slits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l18660"></a><span class="lineno">18660</span>     cpl_table_add_columns(slits, <span class="stringliteral">"y"</span>, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l18661"></a><span class="lineno">18661</span>     cpl_table_divide_scalar(slits, <span class="stringliteral">"y"</span>, 2);         <span class="comment">// Mean y position</span></div>
+<div class="line"><a name="l18662"></a><span class="lineno">18662</span>     cpl_table_subtract_scalar(slits, <span class="stringliteral">"y"</span>, ny/2);    <span class="comment">// Relative to CCD center</span></div>
+<div class="line"><a name="l18663"></a><span class="lineno">18663</span>     cpl_table_multiply_columns(slits, <span class="stringliteral">"y"</span>, <span class="stringliteral">"y"</span>);    <span class="comment">// Squared</span></div>
+<div class="line"><a name="l18664"></a><span class="lineno">18664</span> </div>
+<div class="line"><a name="l18665"></a><span class="lineno">18665</span>     cpl_table_add_columns(slits, <span class="stringliteral">"x"</span>, <span class="stringliteral">"y"</span>);         <span class="comment">// Distance from center</span></div>
+<div class="line"><a name="l18666"></a><span class="lineno">18666</span>     cpl_table_get_column_minpos(slits, <span class="stringliteral">"x"</span>, &row);  <span class="comment">// Min distance from center</span></div>
+<div class="line"><a name="l18667"></a><span class="lineno">18667</span> </div>
+<div class="line"><a name="l18668"></a><span class="lineno">18668</span>     cpl_table_erase_column(slits, <span class="stringliteral">"x"</span>);</div>
+<div class="line"><a name="l18669"></a><span class="lineno">18669</span>     cpl_table_erase_column(slits, <span class="stringliteral">"y"</span>);</div>
+<div class="line"><a name="l18670"></a><span class="lineno">18670</span> </div>
+<div class="line"><a name="l18671"></a><span class="lineno">18671</span>     <span class="keywordflow">return</span> row;</div>
+<div class="line"><a name="l18672"></a><span class="lineno">18672</span> }</div>
+<div class="line"><a name="l18673"></a><span class="lineno">18673</span> </div>
+<div class="line"><a name="l18693"></a><span class="lineno"><a class="code" href="group__moses.html#ga5291b43599e8dec884137f867fe72bfd">18693</a></span> cpl_error_code <a class="code" href="group__moses.html#ga5291b43599e8dec884137f867fe72bfd" title="Measure flux from spectral interval on CCD.">mos_extract_flux</a>(cpl_image *image, cpl_table *slits, </div>
+<div class="line"><a name="l18694"></a><span class="lineno">18694</span>                      <span class="keywordtype">double</span> xwidth, <span class="keywordtype">double</span> ywidth,</div>
+<div class="line"><a name="l18695"></a><span class="lineno">18695</span>                      <span class="keywordtype">int</span> dx, <span class="keywordtype">double</span> gain, <span class="keywordtype">double</span> *o_flux, <span class="keywordtype">double</span> *o_err)</div>
+<div class="line"><a name="l18696"></a><span class="lineno">18696</span> {</div>
+<div class="line"><a name="l18697"></a><span class="lineno">18697</span>     <span class="keywordtype">int</span>    nx      = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l18698"></a><span class="lineno">18698</span>     <span class="keywordtype">int</span>    ny      = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l18699"></a><span class="lineno">18699</span>     <span class="keywordtype">int</span>    slit    = <a class="code" href="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31" title="Return slit closest to CCD center.">mos_slit_closest_to_center</a>(slits, nx, ny);</div>
+<div class="line"><a name="l18700"></a><span class="lineno">18700</span>     <span class="keywordtype">int</span>    ytop    = (int)cpl_table_get(slits, <span class="stringliteral">"ytop"</span>, slit, NULL);</div>
+<div class="line"><a name="l18701"></a><span class="lineno">18701</span>     <span class="keywordtype">int</span>    ybottom = (int)cpl_table_get(slits, <span class="stringliteral">"ybottom"</span>, slit, NULL);</div>
+<div class="line"><a name="l18702"></a><span class="lineno">18702</span>     <span class="keywordtype">int</span>    dy      = ytop - ybottom;</div>
+<div class="line"><a name="l18703"></a><span class="lineno">18703</span>     <span class="keywordtype">int</span>    xcenter = (int)((cpl_table_get(slits, <span class="stringliteral">"xtop"</span>, slit, NULL) +</div>
+<div class="line"><a name="l18704"></a><span class="lineno">18704</span>                             cpl_table_get(slits, <span class="stringliteral">"xbottom"</span>, slit, NULL)) / 2);</div>
+<div class="line"><a name="l18705"></a><span class="lineno">18705</span>     <span class="keywordtype">int</span>    xleft   = xcenter - dx;</div>
+<div class="line"><a name="l18706"></a><span class="lineno">18706</span>     <span class="keywordtype">int</span>    xright  = xcenter + dx + 1;</div>
+<div class="line"><a name="l18707"></a><span class="lineno">18707</span>     <span class="keywordtype">double</span> area    = xwidth * ywidth; <span class="comment">// squared mm</span></div>
+<div class="line"><a name="l18708"></a><span class="lineno">18708</span>     <span class="keywordtype">int</span>    npix    = (2*dx + 1) * dy;</div>
+<div class="line"><a name="l18709"></a><span class="lineno">18709</span>     <span class="keywordtype">int</span>    count   = 0;</div>
+<div class="line"><a name="l18710"></a><span class="lineno">18710</span>     <span class="keywordtype">float</span> *data    = cpl_image_get_data_float(image);</div>
+<div class="line"><a name="l18711"></a><span class="lineno">18711</span>     <span class="keywordtype">double</span> flux    = 0.0;</div>
+<div class="line"><a name="l18712"></a><span class="lineno">18712</span>     <span class="keywordtype">double</span> error   = 0.0;</div>
+<div class="line"><a name="l18713"></a><span class="lineno">18713</span>     <span class="keywordtype">int</span>    satur   = 60000;</div>
+<div class="line"><a name="l18714"></a><span class="lineno">18714</span>     <span class="keywordtype">int</span>    x, y;</div>
+<div class="line"><a name="l18715"></a><span class="lineno">18715</span> </div>
+<div class="line"><a name="l18716"></a><span class="lineno">18716</span> </div>
+<div class="line"><a name="l18717"></a><span class="lineno">18717</span>     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"ywidth"</span>)) {</div>
+<div class="line"><a name="l18718"></a><span class="lineno">18718</span>         area    = cpl_table_get(slits, <span class="stringliteral">"xwidth"</span>, slit, NULL)</div>
+<div class="line"><a name="l18719"></a><span class="lineno">18719</span>                 * cpl_table_get(slits, <span class="stringliteral">"ywidth"</span>, slit, NULL);</div>
+<div class="line"><a name="l18720"></a><span class="lineno">18720</span>     }</div>
+<div class="line"><a name="l18721"></a><span class="lineno">18721</span> </div>
+<div class="line"><a name="l18722"></a><span class="lineno">18722</span>     *o_flux = 0.0;</div>
+<div class="line"><a name="l18723"></a><span class="lineno">18723</span>     *o_err = 0.0;</div>
+<div class="line"><a name="l18724"></a><span class="lineno">18724</span> </div>
+<div class="line"><a name="l18725"></a><span class="lineno">18725</span>     <span class="keywordflow">if</span> (xleft < 0)</div>
+<div class="line"><a name="l18726"></a><span class="lineno">18726</span>         xleft = 0;</div>
+<div class="line"><a name="l18727"></a><span class="lineno">18727</span> </div>
+<div class="line"><a name="l18728"></a><span class="lineno">18728</span>     <span class="keywordflow">if</span> (xleft > nx)</div>
+<div class="line"><a name="l18729"></a><span class="lineno">18729</span>         xleft = nx;</div>
+<div class="line"><a name="l18730"></a><span class="lineno">18730</span> </div>
+<div class="line"><a name="l18731"></a><span class="lineno">18731</span>     <span class="keywordflow">if</span> (xright < 0)</div>
+<div class="line"><a name="l18732"></a><span class="lineno">18732</span>         xright = 0;</div>
+<div class="line"><a name="l18733"></a><span class="lineno">18733</span> </div>
+<div class="line"><a name="l18734"></a><span class="lineno">18734</span>     <span class="keywordflow">if</span> (xright > nx)</div>
+<div class="line"><a name="l18735"></a><span class="lineno">18735</span>         xright = nx;</div>
+<div class="line"><a name="l18736"></a><span class="lineno">18736</span> </div>
+<div class="line"><a name="l18737"></a><span class="lineno">18737</span>     <span class="keywordflow">if</span> (ytop < 0)</div>
+<div class="line"><a name="l18738"></a><span class="lineno">18738</span>         ytop = 0;</div>
+<div class="line"><a name="l18739"></a><span class="lineno">18739</span> </div>
+<div class="line"><a name="l18740"></a><span class="lineno">18740</span>     <span class="keywordflow">if</span> (ytop > ny)</div>
+<div class="line"><a name="l18741"></a><span class="lineno">18741</span>         ytop = ny;</div>
+<div class="line"><a name="l18742"></a><span class="lineno">18742</span> </div>
+<div class="line"><a name="l18743"></a><span class="lineno">18743</span>     <span class="keywordflow">if</span> (ybottom < 0)</div>
+<div class="line"><a name="l18744"></a><span class="lineno">18744</span>         ybottom = 0;</div>
+<div class="line"><a name="l18745"></a><span class="lineno">18745</span> </div>
+<div class="line"><a name="l18746"></a><span class="lineno">18746</span>     <span class="keywordflow">if</span> (ybottom > ny)</div>
+<div class="line"><a name="l18747"></a><span class="lineno">18747</span>         ybottom = ny;</div>
+<div class="line"><a name="l18748"></a><span class="lineno">18748</span> </div>
+<div class="line"><a name="l18749"></a><span class="lineno">18749</span>     count = (xright - xleft) * (ytop - ybottom);</div>
+<div class="line"><a name="l18750"></a><span class="lineno">18750</span> </div>
+<div class="line"><a name="l18751"></a><span class="lineno">18751</span>     <span class="keywordflow">if</span> (count == 0)</div>
+<div class="line"><a name="l18752"></a><span class="lineno">18752</span>         <span class="keywordflow">return</span> CPL_ERROR_ACCESS_OUT_OF_RANGE;</div>
+<div class="line"><a name="l18753"></a><span class="lineno">18753</span> </div>
+<div class="line"><a name="l18754"></a><span class="lineno">18754</span>     count = 0;</div>
+<div class="line"><a name="l18755"></a><span class="lineno">18755</span> </div>
+<div class="line"><a name="l18756"></a><span class="lineno">18756</span>     <span class="keywordflow">for</span> (y = ybottom; y < ytop; y++) {</div>
+<div class="line"><a name="l18757"></a><span class="lineno">18757</span>         <span class="keywordflow">for</span> (x = xleft; x < xright; x++) {</div>
+<div class="line"><a name="l18758"></a><span class="lineno">18758</span>             <span class="keywordtype">double</span> value = data[x + y * nx];</div>
+<div class="line"><a name="l18759"></a><span class="lineno">18759</span>             <span class="keywordflow">if</span> (value < satur) {</div>
+<div class="line"><a name="l18760"></a><span class="lineno">18760</span>                 flux += value;</div>
+<div class="line"><a name="l18761"></a><span class="lineno">18761</span>                 count++;</div>
+<div class="line"><a name="l18762"></a><span class="lineno">18762</span>             }</div>
+<div class="line"><a name="l18763"></a><span class="lineno">18763</span>         }</div>
+<div class="line"><a name="l18764"></a><span class="lineno">18764</span>     }</div>
+<div class="line"><a name="l18765"></a><span class="lineno">18765</span> </div>
+<div class="line"><a name="l18766"></a><span class="lineno">18766</span>     <span class="keywordflow">if</span> (count == 0)</div>
+<div class="line"><a name="l18767"></a><span class="lineno">18767</span>         <span class="keywordflow">return</span> CPL_ERROR_DIVISION_BY_ZERO;</div>
+<div class="line"><a name="l18768"></a><span class="lineno">18768</span> </div>
+<div class="line"><a name="l18769"></a><span class="lineno">18769</span>     error = sqrt(flux/gain);</div>
+<div class="line"><a name="l18770"></a><span class="lineno">18770</span> </div>
+<div class="line"><a name="l18771"></a><span class="lineno">18771</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18772"></a><span class="lineno">18772</span> <span class="comment">     * Flux correction for lost pixels</span></div>
+<div class="line"><a name="l18773"></a><span class="lineno">18773</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18774"></a><span class="lineno">18774</span> </div>
+<div class="line"><a name="l18775"></a><span class="lineno">18775</span>     flux *= (float)npix / count;</div>
+<div class="line"><a name="l18776"></a><span class="lineno">18776</span>     error *= (float)npix / count;</div>
+<div class="line"><a name="l18777"></a><span class="lineno">18777</span> </div>
+<div class="line"><a name="l18778"></a><span class="lineno">18778</span>     flux /= area;</div>
+<div class="line"><a name="l18779"></a><span class="lineno">18779</span>     error /= area;</div>
+<div class="line"><a name="l18780"></a><span class="lineno">18780</span> </div>
+<div class="line"><a name="l18781"></a><span class="lineno">18781</span>     *o_flux = flux;</div>
+<div class="line"><a name="l18782"></a><span class="lineno">18782</span>     *o_err = error;</div>
+<div class="line"><a name="l18783"></a><span class="lineno">18783</span> </div>
+<div class="line"><a name="l18784"></a><span class="lineno">18784</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l18785"></a><span class="lineno">18785</span> }</div>
+<div class="line"><a name="l18786"></a><span class="lineno">18786</span> </div>
+<div class="line"><a name="l18787"></a><span class="lineno">18787</span> </div>
+<div class="line"><a name="l18810"></a><span class="lineno"><a class="code" href="group__moses.html#gaf91a99846ae06aa780b59deced1fa215">18810</a></span> cpl_error_code <a class="code" href="group__moses.html#gaf91a99846ae06aa780b59deced1fa215" title="Measure flux from spectral interval on remapped frame.">mos_extract_flux_mapped</a>(cpl_image *image, cpl_table *slits,</div>
+<div class="line"><a name="l18811"></a><span class="lineno">18811</span>                                        <span class="keywordtype">double</span> xwidth, <span class="keywordtype">double</span> ywidth,</div>
+<div class="line"><a name="l18812"></a><span class="lineno">18812</span>                                        <span class="keywordtype">double</span> lambda, <span class="keywordtype">double</span> startwave, </div>
+<div class="line"><a name="l18813"></a><span class="lineno">18813</span>                                        <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> dx, <span class="keywordtype">double</span> gain, </div>
+<div class="line"><a name="l18814"></a><span class="lineno">18814</span>                                        <span class="keywordtype">double</span> *o_flux, <span class="keywordtype">double</span> *o_err)</div>
+<div class="line"><a name="l18815"></a><span class="lineno">18815</span> {</div>
+<div class="line"><a name="l18816"></a><span class="lineno">18816</span>     <span class="keywordtype">int</span>    nx      = cpl_image_get_size_x(image);</div>
+<div class="line"><a name="l18817"></a><span class="lineno">18817</span>     <span class="keywordtype">int</span>    ny      = cpl_image_get_size_y(image);</div>
+<div class="line"><a name="l18818"></a><span class="lineno">18818</span>     <span class="keywordtype">int</span>    slit    = <a class="code" href="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31" title="Return slit closest to CCD center.">mos_slit_closest_to_center</a>(slits, nx, ny);</div>
+<div class="line"><a name="l18819"></a><span class="lineno">18819</span>     <span class="keywordtype">int</span>    dy      = (int)cpl_table_get(slits, <span class="stringliteral">"length"</span>, slit, NULL);</div>
+<div class="line"><a name="l18820"></a><span class="lineno">18820</span>     <span class="keywordtype">int</span>    ybottom = (int)cpl_table_get(slits, <span class="stringliteral">"position"</span>, slit, NULL);</div>
+<div class="line"><a name="l18821"></a><span class="lineno">18821</span>     <span class="keywordtype">int</span>    ytop    = ybottom + dy;</div>
+<div class="line"><a name="l18822"></a><span class="lineno">18822</span>     <span class="keywordtype">int</span>    xcenter = (int)floor((lambda - startwave) / dispersion + 0.5);</div>
+<div class="line"><a name="l18823"></a><span class="lineno">18823</span>     <span class="keywordtype">int</span>    xleft   = xcenter - dx;</div>
+<div class="line"><a name="l18824"></a><span class="lineno">18824</span>     <span class="keywordtype">int</span>    xright  = xcenter + dx + 1;</div>
+<div class="line"><a name="l18825"></a><span class="lineno">18825</span>     <span class="keywordtype">double</span> area    = xwidth * ywidth;</div>
+<div class="line"><a name="l18826"></a><span class="lineno">18826</span>     <span class="keywordtype">int</span>    npix    = (2*dx + 1) * dy;</div>
+<div class="line"><a name="l18827"></a><span class="lineno">18827</span>     <span class="keywordtype">int</span>    count   = 0;</div>
+<div class="line"><a name="l18828"></a><span class="lineno">18828</span>     <span class="keywordtype">float</span> *data    = cpl_image_get_data_float(image);</div>
+<div class="line"><a name="l18829"></a><span class="lineno">18829</span>     <span class="keywordtype">double</span> flux    = 0.0;</div>
+<div class="line"><a name="l18830"></a><span class="lineno">18830</span>     <span class="keywordtype">double</span> error   = 0.0;</div>
+<div class="line"><a name="l18831"></a><span class="lineno">18831</span>     <span class="keywordtype">int</span>    satur   = 60000;</div>
+<div class="line"><a name="l18832"></a><span class="lineno">18832</span>     <span class="keywordtype">int</span>    x, y;</div>
+<div class="line"><a name="l18833"></a><span class="lineno">18833</span> </div>
+<div class="line"><a name="l18834"></a><span class="lineno">18834</span> </div>
+<div class="line"><a name="l18835"></a><span class="lineno">18835</span>     <span class="keywordflow">if</span> (cpl_table_has_column(slits, <span class="stringliteral">"ywidth"</span>)) {</div>
+<div class="line"><a name="l18836"></a><span class="lineno">18836</span>         area    = cpl_table_get(slits, <span class="stringliteral">"xwidth"</span>, slit, NULL)</div>
+<div class="line"><a name="l18837"></a><span class="lineno">18837</span>                 * cpl_table_get(slits, <span class="stringliteral">"ywidth"</span>, slit, NULL);</div>
+<div class="line"><a name="l18838"></a><span class="lineno">18838</span>     }</div>
+<div class="line"><a name="l18839"></a><span class="lineno">18839</span> </div>
+<div class="line"><a name="l18840"></a><span class="lineno">18840</span>     *o_flux = 0.0;</div>
+<div class="line"><a name="l18841"></a><span class="lineno">18841</span>     *o_err = 0.0;</div>
+<div class="line"><a name="l18842"></a><span class="lineno">18842</span> </div>
+<div class="line"><a name="l18843"></a><span class="lineno">18843</span>     <span class="keywordflow">if</span> (xleft < 0)</div>
+<div class="line"><a name="l18844"></a><span class="lineno">18844</span>         xleft = 0;</div>
+<div class="line"><a name="l18845"></a><span class="lineno">18845</span> </div>
+<div class="line"><a name="l18846"></a><span class="lineno">18846</span>     <span class="keywordflow">if</span> (xleft > nx)</div>
+<div class="line"><a name="l18847"></a><span class="lineno">18847</span>         xleft = nx;</div>
+<div class="line"><a name="l18848"></a><span class="lineno">18848</span> </div>
+<div class="line"><a name="l18849"></a><span class="lineno">18849</span>     <span class="keywordflow">if</span> (xright < 0)</div>
+<div class="line"><a name="l18850"></a><span class="lineno">18850</span>         xright = 0;</div>
+<div class="line"><a name="l18851"></a><span class="lineno">18851</span> </div>
+<div class="line"><a name="l18852"></a><span class="lineno">18852</span>     <span class="keywordflow">if</span> (xright > nx)</div>
+<div class="line"><a name="l18853"></a><span class="lineno">18853</span>         xright = nx;</div>
+<div class="line"><a name="l18854"></a><span class="lineno">18854</span> </div>
+<div class="line"><a name="l18855"></a><span class="lineno">18855</span>     <span class="keywordflow">if</span> (ytop < 0)</div>
+<div class="line"><a name="l18856"></a><span class="lineno">18856</span>         ytop = 0;</div>
+<div class="line"><a name="l18857"></a><span class="lineno">18857</span> </div>
+<div class="line"><a name="l18858"></a><span class="lineno">18858</span>     <span class="keywordflow">if</span> (ytop > ny)</div>
+<div class="line"><a name="l18859"></a><span class="lineno">18859</span>         ytop = ny;</div>
+<div class="line"><a name="l18860"></a><span class="lineno">18860</span> </div>
+<div class="line"><a name="l18861"></a><span class="lineno">18861</span>     <span class="keywordflow">if</span> (ybottom < 0)</div>
+<div class="line"><a name="l18862"></a><span class="lineno">18862</span>         ybottom = 0;</div>
+<div class="line"><a name="l18863"></a><span class="lineno">18863</span> </div>
+<div class="line"><a name="l18864"></a><span class="lineno">18864</span>     <span class="keywordflow">if</span> (ybottom > ny)</div>
+<div class="line"><a name="l18865"></a><span class="lineno">18865</span>         ybottom = ny;</div>
+<div class="line"><a name="l18866"></a><span class="lineno">18866</span> </div>
+<div class="line"><a name="l18867"></a><span class="lineno">18867</span>     count = (xright - xleft) * (ytop - ybottom);</div>
+<div class="line"><a name="l18868"></a><span class="lineno">18868</span> </div>
+<div class="line"><a name="l18869"></a><span class="lineno">18869</span>     <span class="keywordflow">if</span> (count == 0)</div>
+<div class="line"><a name="l18870"></a><span class="lineno">18870</span>         <span class="keywordflow">return</span> CPL_ERROR_ACCESS_OUT_OF_RANGE;</div>
+<div class="line"><a name="l18871"></a><span class="lineno">18871</span> </div>
+<div class="line"><a name="l18872"></a><span class="lineno">18872</span>     count = 0;</div>
+<div class="line"><a name="l18873"></a><span class="lineno">18873</span> </div>
+<div class="line"><a name="l18874"></a><span class="lineno">18874</span>     <span class="keywordflow">for</span> (y = ybottom; y < ytop; y++) {</div>
+<div class="line"><a name="l18875"></a><span class="lineno">18875</span>         <span class="keywordflow">for</span> (x = xleft; x < xright; x++) {</div>
+<div class="line"><a name="l18876"></a><span class="lineno">18876</span>             <span class="keywordtype">double</span> value = data[x + y * nx];</div>
+<div class="line"><a name="l18877"></a><span class="lineno">18877</span>             <span class="keywordflow">if</span> (value < satur) {</div>
+<div class="line"><a name="l18878"></a><span class="lineno">18878</span>                 flux += value;</div>
+<div class="line"><a name="l18879"></a><span class="lineno">18879</span>                 count++;</div>
+<div class="line"><a name="l18880"></a><span class="lineno">18880</span>             }</div>
+<div class="line"><a name="l18881"></a><span class="lineno">18881</span>         }</div>
+<div class="line"><a name="l18882"></a><span class="lineno">18882</span>     }</div>
+<div class="line"><a name="l18883"></a><span class="lineno">18883</span> </div>
+<div class="line"><a name="l18884"></a><span class="lineno">18884</span>     <span class="keywordflow">if</span> (count == 0)</div>
+<div class="line"><a name="l18885"></a><span class="lineno">18885</span>         <span class="keywordflow">return</span> CPL_ERROR_DIVISION_BY_ZERO;</div>
+<div class="line"><a name="l18886"></a><span class="lineno">18886</span> </div>
+<div class="line"><a name="l18887"></a><span class="lineno">18887</span>     error = sqrt(flux/gain);</div>
+<div class="line"><a name="l18888"></a><span class="lineno">18888</span> </div>
+<div class="line"><a name="l18889"></a><span class="lineno">18889</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l18890"></a><span class="lineno">18890</span> <span class="comment">     * Flux correction for lost pixels</span></div>
+<div class="line"><a name="l18891"></a><span class="lineno">18891</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l18892"></a><span class="lineno">18892</span> </div>
+<div class="line"><a name="l18893"></a><span class="lineno">18893</span>     flux *= (float)npix / count;</div>
+<div class="line"><a name="l18894"></a><span class="lineno">18894</span>     error *= (float)npix / count;</div>
+<div class="line"><a name="l18895"></a><span class="lineno">18895</span>     </div>
+<div class="line"><a name="l18896"></a><span class="lineno">18896</span>     flux /= area;  </div>
+<div class="line"><a name="l18897"></a><span class="lineno">18897</span>     error /= area; </div>
+<div class="line"><a name="l18898"></a><span class="lineno">18898</span>     </div>
+<div class="line"><a name="l18899"></a><span class="lineno">18899</span>     *o_flux = flux;</div>
+<div class="line"><a name="l18900"></a><span class="lineno">18900</span>     *o_err = error;</div>
+<div class="line"><a name="l18901"></a><span class="lineno">18901</span> </div>
+<div class="line"><a name="l18902"></a><span class="lineno">18902</span>     <span class="keywordflow">return</span> CPL_ERROR_NONE;</div>
+<div class="line"><a name="l18903"></a><span class="lineno">18903</span> </div>
+<div class="line"><a name="l18904"></a><span class="lineno">18904</span> }</div>
+<div class="line"><a name="l18905"></a><span class="lineno">18905</span> </div>
+<div class="line"><a name="l18906"></a><span class="lineno">18906</span> </div>
+<div class="line"><a name="l18920"></a><span class="lineno"><a class="code" href="group__moses.html#gac6224c743943d88920b1e93f7394d009">18920</a></span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gac6224c743943d88920b1e93f7394d009" title="Compute median from a table column section corresponding to a slit.">mos_median_in_slit</a>(cpl_table *table, cpl_table *slits, <span class="keywordtype">int</span> slit, </div>
+<div class="line"><a name="l18921"></a><span class="lineno">18921</span>                        <span class="keywordtype">char</span> *label, <span class="keywordtype">double</span> *mvalue)</div>
+<div class="line"><a name="l18922"></a><span class="lineno">18922</span> {</div>
+<div class="line"><a name="l18923"></a><span class="lineno">18923</span>     <span class="keywordtype">int</span>        position   = cpl_table_get_int(slits, <span class="stringliteral">"position"</span>, slit, NULL);</div>
+<div class="line"><a name="l18924"></a><span class="lineno">18924</span>     <span class="keywordtype">int</span>        length     = cpl_table_get_int(slits, <span class="stringliteral">"length"</span>, slit, NULL);</div>
+<div class="line"><a name="l18925"></a><span class="lineno">18925</span>     cpl_table *tmp        = cpl_table_extract(table, position, length);</div>
+<div class="line"><a name="l18926"></a><span class="lineno">18926</span> </div>
+<div class="line"><a name="l18927"></a><span class="lineno">18927</span>     *mvalue = cpl_table_get_column_median(tmp, label);</div>
+<div class="line"><a name="l18928"></a><span class="lineno">18928</span>     cpl_table_delete(tmp);</div>
+<div class="line"><a name="l18929"></a><span class="lineno">18929</span> </div>
+<div class="line"><a name="l18930"></a><span class="lineno">18930</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l18931"></a><span class="lineno">18931</span>         <span class="keywordflow">return</span> 1;</div>
+<div class="line"><a name="l18932"></a><span class="lineno">18932</span> </div>
+<div class="line"><a name="l18933"></a><span class="lineno">18933</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l18934"></a><span class="lineno">18934</span> }</div>
+<div class="line"><a name="l18935"></a><span class="lineno">18935</span> </div>
+<div class="line"><a name="l18936"></a><span class="lineno">18936</span> </div>
+<div class="line"><a name="l18948"></a><span class="lineno"><a class="code" href="group__moses.html#ga1f574f5f45840ea69fa03eb26055a1b1">18948</a></span> cpl_image *<a class="code" href="group__moses.html#ga1f574f5f45840ea69fa03eb26055a1b1" title="Convenience function for standard median filtering.">mos_image_filter_median</a>(cpl_image *image, <span class="keywordtype">int</span> nx, <span class="keywordtype">int</span> ny)</div>
+<div class="line"><a name="l18949"></a><span class="lineno">18949</span> {</div>
+<div class="line"><a name="l18950"></a><span class="lineno">18950</span>       cpl_mask  *kernel   = cpl_mask_new(nx, ny);</div>
+<div class="line"><a name="l18951"></a><span class="lineno">18951</span>       cpl_image *filtered = cpl_image_new(cpl_image_get_size_x(image),</div>
+<div class="line"><a name="l18952"></a><span class="lineno">18952</span>                                           cpl_image_get_size_y(image),</div>
+<div class="line"><a name="l18953"></a><span class="lineno">18953</span>                                           cpl_image_get_type(image));</div>
+<div class="line"><a name="l18954"></a><span class="lineno">18954</span> </div>
+<div class="line"><a name="l18955"></a><span class="lineno">18955</span>       cpl_mask_not(kernel);</div>
+<div class="line"><a name="l18956"></a><span class="lineno">18956</span>       cpl_image_filter_mask(filtered, image, kernel,</div>
+<div class="line"><a name="l18957"></a><span class="lineno">18957</span>                             CPL_FILTER_MEDIAN, CPL_BORDER_FILTER);</div>
+<div class="line"><a name="l18958"></a><span class="lineno">18958</span>       cpl_mask_delete(kernel);</div>
+<div class="line"><a name="l18959"></a><span class="lineno">18959</span> </div>
+<div class="line"><a name="l18960"></a><span class="lineno">18960</span>       <span class="keywordflow">return</span> filtered;</div>
+<div class="line"><a name="l18961"></a><span class="lineno">18961</span> }</div>
+<div class="line"><a name="l18962"></a><span class="lineno">18962</span> </div>
+<div class="line"><a name="l18963"></a><span class="lineno">18963</span> <span class="keywordtype">int</span> fors_mos_is_lss_like(cpl_table *maskslits, <span class="keywordtype">int</span> nslits_out_det)</div>
+<div class="line"><a name="l18964"></a><span class="lineno">18964</span> {</div>
+<div class="line"><a name="l18965"></a><span class="lineno">18965</span>     <span class="keywordtype">int</span> treat_as_lss = 1;</div>
+<div class="line"><a name="l18966"></a><span class="lineno">18966</span>     <span class="keywordtype">double</span> mxpos = cpl_table_get_column_median(maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l18967"></a><span class="lineno">18967</span>     <span class="keywordtype">double</span> * slit_xpos = cpl_table_get_data_double(maskslits, <span class="stringliteral">"xtop"</span>);</div>
+<div class="line"><a name="l18968"></a><span class="lineno">18968</span>     cpl_size nslits = cpl_table_get_nrow(maskslits);</div>
+<div class="line"><a name="l18969"></a><span class="lineno">18969</span> </div>
+<div class="line"><a name="l18970"></a><span class="lineno">18970</span>     <span class="comment">//If not all the slits are illuminated, then we cannot say that</span></div>
+<div class="line"><a name="l18971"></a><span class="lineno">18971</span>     <span class="comment">//it is lss-like (PIPE-4380)</span></div>
+<div class="line"><a name="l18972"></a><span class="lineno">18972</span>     <span class="keywordflow">if</span>(nslits_out_det != 0)</div>
+<div class="line"><a name="l18973"></a><span class="lineno">18973</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l18974"></a><span class="lineno">18974</span> </div>
+<div class="line"><a name="l18975"></a><span class="lineno">18975</span>     cpl_msg_warning(cpl_func, <span class="stringliteral">"Number of slits %"</span>CPL_SIZE_FORMAT, nslits);</div>
+<div class="line"><a name="l18976"></a><span class="lineno">18976</span>     <span class="keywordflow">for</span> (cpl_size i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l18977"></a><span class="lineno">18977</span>         <span class="keywordflow">if</span> (fabs(mxpos-slit_xpos[i]) > 0.01) {</div>
+<div class="line"><a name="l18978"></a><span class="lineno">18978</span>             treat_as_lss = 0;</div>
+<div class="line"><a name="l18979"></a><span class="lineno">18979</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l18980"></a><span class="lineno">18980</span>         }</div>
+<div class="line"><a name="l18981"></a><span class="lineno">18981</span>     }</div>
+<div class="line"><a name="l18982"></a><span class="lineno">18982</span>     <span class="keywordflow">return</span> treat_as_lss;</div>
+<div class="line"><a name="l18983"></a><span class="lineno">18983</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/moses_8h-source.html b/html/moses_8h-source.html
deleted file mode 100644
index 56fb84b..0000000
--- a/html/moses_8h-source.html
+++ /dev/null
@@ -1,223 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: moses.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>moses.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: moses.h,v 1.39 2013/02/28 15:10:43 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the VIMOS Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/02/28 15:10:43 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.39 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef MOSES_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define MOSES_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 cpl_table *<a class="code" href="group__moses.html#g68b5196b98878f3f3b702d58f1477150">mos_hough_table</a>(cpl_table *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
-<a name="l00036"></a>00036 cpl_image *<a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(cpl_image *, cpl_image *, cpl_table *);
-<a name="l00037"></a>00037 cpl_image *<a class="code" href="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff">mos_normalise_flat</a>(cpl_image *, cpl_image *, cpl_table *, 
-<a name="l00038"></a>00038                               cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, 
-<a name="l00039"></a>00039                               <span class="keywordtype">int</span>, <span class="keywordtype">int</span>) CPL_ATTR_DEPRECATED;
-<a name="l00040"></a>00040 cpl_image *<a class="code" href="group__moses.html#g9c5947c76fc1246f203a1c6ebc6c9569">mos_normalise_longflat</a>(cpl_image *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>) 
-<a name="l00041"></a>00041     CPL_ATTR_DEPRECATED;
-<a name="l00042"></a>00042 cpl_error_code <a class="code" href="group__moses.html#g8dd9103f12a5e6275cd03c3f2afee77a">mos_arc_background_1D</a>(<span class="keywordtype">float</span> *, <span class="keywordtype">float</span> *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
-<a name="l00043"></a>00043 cpl_image *<a class="code" href="group__moses.html#g9695f36efcf36d2ae6d57efaca7c5a7a">mos_arc_background</a>(cpl_image *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
-<a name="l00044"></a>00044 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gb1c72eeff22a3f3df027f76aa50e9533">mos_lines_width</a>(const <span class="keywordtype">float</span> *, <span class="keywordtype">int</span>);
-<a name="l00045"></a>00045 cpl_vector *<a class="code" href="group__moses.html#g417edefcade103f40ba21dd3f9c29af1">mos_peak_candidates</a>(const <span class="keywordtype">float</span> *, <span class="keywordtype">int</span>, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>);
-<a name="l00046"></a>00046 cpl_vector *<a class="code" href="group__moses.html#g08d1d066f5fd31a11b6a3e8b3f21fba0">mos_refine_peaks</a>(const <span class="keywordtype">float</span> *, <span class="keywordtype">int</span>, cpl_vector *, <span class="keywordtype">int</span>);
-<a name="l00047"></a>00047 <span class="keywordtype">void</span> <a class="code" href="group__moses.html#g9ea6e7d7f5eb091c72e010069673d080">mos_set_multiplex</a>(<span class="keywordtype">int</span>);
-<a name="l00048"></a>00048 cpl_bivector *<a class="code" href="group__moses.html#g43123c837803fd95b01ba2870522ebaf">mos_identify_peaks</a>(cpl_vector *, cpl_vector *,
-<a name="l00049"></a>00049                                  <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);
-<a name="l00050"></a>00050 cpl_bivector *<a class="code" href="group__moses.html#g84eceb2b87667085a8215974f0a52446">mos_find_peaks</a>(const <span class="keywordtype">float</span> *, <span class="keywordtype">int</span>, cpl_vector *,
-<a name="l00051"></a>00051                              cpl_polynomial *, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>);
-<a name="l00052"></a>00052 <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g99c7290af152957144e8c0413355e5dd">mos_eval_dds</a>(cpl_polynomial *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);
-<a name="l00053"></a>00053 cpl_polynomial *<a class="code" href="group__moses.html#g0c895cc2e971156231313f7a16eb6212">mos_poly_wav2pix</a>(cpl_bivector *, <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>,
-<a name="l00054"></a>00054                                  <span class="keywordtype">int</span> *, <span class="keywordtype">double</span> *);
-<a name="l00055"></a>00055 cpl_polynomial *<a class="code" href="group__moses.html#g2d49af6d6595dda815a2475dd6de449a">mos_poly_pix2wav</a>(cpl_bivector *, <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>,
-<a name="l00056"></a>00056                                  <span class="keywordtype">int</span> *, <span class="keywordtype">double</span> *);
-<a name="l00057"></a>00057 cpl_image *<a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(const cpl_image *, cpl_vector *,
-<a name="l00058"></a>00058                                           <span class="keywordtype">double</span>, <span class="keywordtype">float</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, 
-<a name="l00059"></a>00059                                           <span class="keywordtype">double</span>, <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *, <span class="keywordtype">int</span> *, 
-<a name="l00060"></a>00060                                           <span class="keywordtype">double</span> *, cpl_table *, cpl_image *, 
-<a name="l00061"></a>00061                                           cpl_image *, cpl_table *, cpl_mask *);
-<a name="l00062"></a>00062 cpl_error_code <a class="code" href="group__moses.html#ga06affb6c77aac402204d1065f1de8ea">mos_interpolate_wavecalib_slit</a>(cpl_table *, cpl_table *, 
-<a name="l00063"></a>00063                                               <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
-<a name="l00064"></a>00064 cpl_error_code <a class="code" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">mos_interpolate_wavecalib</a>(cpl_table *, cpl_image *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
-<a name="l00065"></a>00065 cpl_table *<a class="code" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_spectra</a>(cpl_mask *);
-<a name="l00066"></a>00066 cpl_error_code <a class="code" href="group__moses.html#g0a1742caa67a002bee7a30f9d5289672">mos_validate_slits</a>(cpl_table *);
-<a name="l00067"></a>00067 cpl_error_code <a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a>(cpl_table *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
-<a name="l00068"></a>00068 cpl_table *<a class="code" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits</a>(cpl_table *, cpl_table *, cpl_table *);
-<a name="l00069"></a>00069 cpl_table *<a class="code" href="group__moses.html#ge3e3fb9252ccdfacccd0e063d293dc1f">mos_identify_slits_fast</a>(cpl_table *, cpl_table *, cpl_table *);
-<a name="l00070"></a>00070 cpl_table *<a class="code" href="group__moses.html#g168f6aecd869c24634fa9f6690da0b02">mos_trace_flat</a>(cpl_image *, cpl_table *, <span class="keywordtype">double</span>,
-<a name="l00071"></a>00071                           <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);
-<a name="l00072"></a>00072 cpl_table *<a class="code" href="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414">mos_poly_trace</a>(cpl_table *, cpl_table *, <span class="keywordtype">int</span>);
-<a name="l00073"></a>00073 cpl_error_code <a class="code" href="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5">mos_global_trace</a>(cpl_table *, cpl_table *, <span class="keywordtype">int</span>);
-<a name="l00074"></a>00074 cpl_image *<a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(cpl_image *, cpl_table *, cpl_table *, 
-<a name="l00075"></a>00075                                    <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>,
-<a name="l00076"></a>00076                                    cpl_image *);
-<a name="l00077"></a>00077 cpl_image *<a class="code" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final</a>(cpl_image *, cpl_table *,
-<a name="l00078"></a>00078                                             cpl_vector *, <span class="keywordtype">double</span>, <span class="keywordtype">float</span>, <span class="keywordtype">int</span>, 
-<a name="l00079"></a>00079                                             <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span> *, 
-<a name="l00080"></a>00080                                             <span class="keywordtype">double</span> *, <span class="keywordtype">int</span> *, <span class="keywordtype">double</span> *, 
-<a name="l00081"></a>00081                                             cpl_table *, cpl_image *, 
-<a name="l00082"></a>00082                                             cpl_image *, cpl_table *);
-<a name="l00083"></a>00083 cpl_table *<a class="code" href="group__moses.html#gdf9210c07ebddae07a3e5e99d88d2f5c">mos_global_distortion</a>(cpl_table *, cpl_table *,
-<a name="l00084"></a>00084                                  cpl_table *, cpl_table *, <span class="keywordtype">double</span>);
-<a name="l00085"></a>00085 cpl_table *<a class="code" href="group__moses.html#g39dd696d6572e52031e12b1a53e505c2">mos_build_slit_location</a>(cpl_table *, cpl_table *, <span class="keywordtype">int</span>);
-<a name="l00086"></a>00086 cpl_table *<a class="code" href="group__moses.html#ga010593249434f0bb667af2f2c950951">mos_build_curv_coeff</a>(cpl_table *, cpl_table *, cpl_table *);
-<a name="l00087"></a>00087 cpl_table *<a class="code" href="group__moses.html#gc4a3f1981baef15668137f04c04cf710">mos_build_disp_coeff</a>(cpl_table *, cpl_table *);
-<a name="l00088"></a>00088 cpl_table *<a class="code" href="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3">mos_wavelength_align</a>(cpl_image *, cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>,
-<a name="l00089"></a>00089                                 <span class="keywordtype">double</span>, cpl_table *, cpl_vector *, <span class="keywordtype">int</span>, 
-<a name="l00090"></a>00090                                 <span class="keywordtype">int</span>, cpl_image *, <span class="keywordtype">int</span>);
-<a name="l00091"></a>00091 cpl_table *<a class="code" href="group__moses.html#g2523d130beaf8538187729f767c38805">mos_wavelength_align_lss</a>(cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>,
-<a name="l00092"></a>00092                               cpl_table *, cpl_vector *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, 
-<a name="l00093"></a>00093                               cpl_image *, <span class="keywordtype">int</span>);
-<a name="l00094"></a>00094 cpl_image *<a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, 
-<a name="l00095"></a>00095                                       <span class="keywordtype">double</span>, cpl_table *, <span class="keywordtype">int</span>);
-<a name="l00096"></a>00096 cpl_image *<a class="code" href="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1">mos_map_pixel</a>(cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>);
-<a name="l00097"></a>00097 cpl_image *<a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(cpl_table *, <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);
-<a name="l00098"></a>00098 cpl_image *<a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(cpl_image *, cpl_image *, cpl_table *, 
-<a name="l00099"></a>00099                                cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);
-<a name="l00100"></a>00100 cpl_image *<a class="code" href="group__moses.html#g2940e2350a3c050fc3bff7af0e621c37">mos_map_spectrum</a>(cpl_image *, cpl_image *, cpl_image *, cpl_table *,
-<a name="l00101"></a>00101                             cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>);
-<a name="l00102"></a>00102 cpl_image *<a class="code" href="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f">mos_subtract_sky</a>(cpl_image *, cpl_table *, cpl_table *, <span class="keywordtype">double</span>,
-<a name="l00103"></a>00103                             <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);
-<a name="l00104"></a>00104 cpl_table *<a class="code" href="group__moses.html#g21b37cf8c1fd568441a55740d34e2371">mos_sky_map</a>(cpl_image *, cpl_image *, <span class="keywordtype">double</span>, cpl_image *);
-<a name="l00105"></a>00105 cpl_table *<a class="code" href="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1">mos_sky_map_super</a>(cpl_image *, cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>,
-<a name="l00106"></a>00106                              cpl_image *);
-<a name="l00107"></a>00107 cpl_image *<a class="code" href="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a">mos_sky_local_old</a>(cpl_image *spectra, cpl_table *slits);
-<a name="l00108"></a>00108 cpl_image *<a class="code" href="group__moses.html#g7cb83f67ed6d349ade9e38e7ed62f6fb">mos_sky_local</a>(cpl_image *, cpl_table *, <span class="keywordtype">int</span>);
-<a name="l00109"></a>00109 
-<a name="l00110"></a>00110 cpl_error_code <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(cpl_image *, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>);
-<a name="l00111"></a>00111 cpl_error_code <a class="code" href="group__moses.html#g9be86f4e59f9ef4d604c0e4f24d41655">mos_clean_bad_pixels</a>(cpl_image *, cpl_table *, <span class="keywordtype">int</span>);
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113 <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(cpl_image *, cpl_vector *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115 cpl_image *<a class="code" href="group__moses.html#ge8df117eba59d1599f3172975b6f7139">mos_spatial_map</a>(cpl_image *, cpl_table *, cpl_table *, <span class="keywordtype">double</span>,
-<a name="l00116"></a>00116                            <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);
-<a name="l00117"></a>00117 cpl_image *<a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(cpl_image *, cpl_table *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
-<a name="l00118"></a>00118 cpl_image **<a class="code" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">mos_extract_objects</a>(cpl_image *, cpl_image *, cpl_table *, 
-<a name="l00119"></a>00119                                 <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>);
-<a name="l00120"></a>00120 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g9dab2e2448ef188d7f8fddd02483d919">mos_spectral_resolution</a>(cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>,
-<a name="l00121"></a>00121                             <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *, <span class="keywordtype">int</span> *);
-<a name="l00122"></a>00122 cpl_table *<a class="code" href="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55">mos_resolution_table</a>(cpl_image *image, <span class="keywordtype">double</span> startwave,
-<a name="l00123"></a>00123                                 <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> saturation,
-<a name="l00124"></a>00124                                 cpl_vector *lines);
-<a name="l00125"></a>00125 <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g51c4d941feada9601c3e391058f4e653">mos_integrate_signal</a>(cpl_image *, cpl_image *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);
-<a name="l00126"></a>00126 
-<a name="l00127"></a>00127 cpl_polynomial *<a class="code" href="group__moses.html#gbdc12afa2f53713a4151907ed3054dd7">mos_montecarlo_polyfit</a>(cpl_table *points, cpl_table *evaluate,
-<a name="l00128"></a>00128                                        <span class="keywordtype">int</span> samples, <span class="keywordtype">int</span> order);
-<a name="l00129"></a>00129 
-<a name="l00130"></a>00130 cpl_error_code <a class="code" href="group__moses.html#g7557973371ca804e0fab92c40b833f3c">mos_randomise_image</a>(cpl_image *, <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>,
-<a name="l00131"></a>00131                                    <span class="keywordtype">double</span> gain, <span class="keywordtype">double</span> bias);
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133 <span class="comment">/* Instrument dependent!  */</span>
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135 <span class="keywordtype">double</span> <a class="code" href="group__moses.html#g75c3cb900989bb07dad294dd545021a6">mos_get_gain_vimos</a>(cpl_propertylist *);
-<a name="l00136"></a>00136 cpl_table *<a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(const cpl_propertylist *, <span class="keywordtype">int</span>);
-<a name="l00137"></a>00137 cpl_table *<a class="code" href="group__moses.html#g83424b665852cb22061bea76a664a730">mos_load_overscans_fors</a>(const cpl_propertylist *);
-<a name="l00138"></a>00138 cpl_table *<a class="code" href="group__moses.html#g3431a4557418ee0f8cd9beefd7153a98">mos_load_slits_vimos</a>(cpl_propertylist *);
-<a name="l00139"></a>00139 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gf2c5b165c7c2c4be802c03ae59d1b8a9">mos_check_multiplex</a>(cpl_table *);
-<a name="l00140"></a>00140 cpl_table *<a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(cpl_propertylist *);
-<a name="l00141"></a>00141 cpl_table *<a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(cpl_propertylist *, <span class="keywordtype">int</span> * nslits_out_det);
-<a name="l00142"></a>00142 cpl_table *<a class="code" href="group__moses.html#g9ed25f68a53a8daa15d3c986e7bdfa48">mos_load_slits_fors_lss</a>(cpl_propertylist *);
-<a name="l00143"></a>00143 cpl_table *<a class="code" href="group__moses.html#g5bc87e2a7c15dd1686e02e2d65e057f5">mos_load_slits_fors_pmos</a>(cpl_propertylist *, <span class="keywordtype">int</span> * nslits_out_det);
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145 cpl_error_code <a class="code" href="group__moses.html#gaabac93f2fab16b6c268e5ab494a7238">mos_refmask_find_gaps</a>(cpl_mask  *, cpl_image *, <span class="keywordtype">double</span>);
-<a name="l00146"></a>00146 cpl_error_code <a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(cpl_image *);
-<a name="l00147"></a>00147 cpl_error_code <a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(cpl_image *);
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149 cpl_error_code <a class="code" href="group__moses.html#g621083edda685c07a318aa94f53bce6f">mos_object_intersect</a>(cpl_table **, cpl_table *, <span class="keywordtype">int</span>, <span class="keywordtype">float</span>);
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g5a6b95084aacc3fbd59249b53912f048">mos_get_maxobjs_per_slit</a>(cpl_table *);
-<a name="l00152"></a>00152 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g7a41fa707f51ab0d55150ed8c4b19657">mos_get_nobjects</a>(cpl_table *);
-<a name="l00153"></a>00153 
-<a name="l00154"></a>00154 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g5ec455544df7dfc83da8fefc91a9afc7">mos_check_slits</a>(cpl_table *, <span class="keywordtype">float</span>);
-<a name="l00155"></a>00155 <span class="keywordtype">int</span> *<a class="code" href="group__moses.html#ge887675f0978f93eb562934c909590e7">fors_get_nobjs_perslit</a>(cpl_table *);
-<a name="l00156"></a>00156 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gc189c00acf90455029854a0517e89549">mos_rebin_signal</a>(cpl_image **, <span class="keywordtype">int</span>);
-<a name="l00157"></a>00157 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gc88e237fcb474d9b3fe7d7caed75f0e3">mos_rebin_error</a>(cpl_image **, <span class="keywordtype">int</span>);
-<a name="l00158"></a>00158 cpl_table *<a class="code" href="group__moses.html#gf3dd5a20a5f31b853c53ca419a8171e3">mos_photometric_calibration</a>(cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>,
-<a name="l00159"></a>00159                                  <span class="keywordtype">double</span>, cpl_table *, <span class="keywordtype">double</span>, cpl_table *,
-<a name="l00160"></a>00160                                  <span class="keywordtype">int</span>);
-<a name="l00161"></a>00161 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, cpl_table *, <span class="keywordtype">char</span> *, <span class="keywordtype">char</span> *);
-<a name="l00162"></a>00162 cpl_image *<a class="code" href="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660">mos_ksigma_stack</a>(cpl_imagelist *imlist,
-<a name="l00163"></a>00163                             <span class="keywordtype">double</span> klow, <span class="keywordtype">double</span> khigh, <span class="keywordtype">int</span> kiter,
-<a name="l00164"></a>00164                             cpl_image **);
-<a name="l00165"></a>00165 cpl_image *<a class="code" href="group__moses.html#gd97e4b6ea81acb77e5ef8567a376482b">mos_apply_photometry</a>(cpl_image *, cpl_table *response,
-<a name="l00166"></a>00166                                 cpl_table *ext_table, <span class="keywordtype">double</span> startwave,
-<a name="l00167"></a>00167                                 <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> gain,
-<a name="l00168"></a>00168                                 <span class="keywordtype">double</span> exptime, <span class="keywordtype">double</span> airmass);
-<a name="l00169"></a>00169 cpl_image *<a class="code" href="group__moses.html#ge20fadc56d3b4506d4ffd3015f394695">mos_propagate_photometry_error</a>(cpl_image *, cpl_image *,
-<a name="l00170"></a>00170                                 cpl_table *response,
-<a name="l00171"></a>00171                                 cpl_table *ext_table, <span class="keywordtype">double</span> startwave,
-<a name="l00172"></a>00172                                 <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> gain,
-<a name="l00173"></a>00173                                 <span class="keywordtype">double</span> exptime, <span class="keywordtype">double</span> airmass);
-<a name="l00174"></a>00174 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gd170543de1ad9f6f2e4f1167e3f4ef4e">mos_check_polarisation</a>(cpl_image *q_image, cpl_image *q_error,
-<a name="l00175"></a>00175                            cpl_image *u_image, cpl_image *u_error,
-<a name="l00176"></a>00176                            <span class="keywordtype">double</span> startwave, <span class="keywordtype">double</span> dispersion,
-<a name="l00177"></a>00177                            <span class="keywordtype">double</span> band, cpl_table *pol_sta,
-<a name="l00178"></a>00178                            <span class="keywordtype">double</span> ra, <span class="keywordtype">double</span> dec, <span class="keywordtype">char</span> *filter,
-<a name="l00179"></a>00179                            <span class="keywordtype">int</span> *polarisation,
-<a name="l00180"></a>00180                            <span class="keywordtype">double</span> *p_offset, <span class="keywordtype">double</span> *p_error,
-<a name="l00181"></a>00181                            <span class="keywordtype">double</span> *a_offset, <span class="keywordtype">double</span> *a_error);
-<a name="l00182"></a>00182 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#ge59e20e2bea761316fa1395d5d406965">mos_compute_offset</a>(cpl_table *, cpl_table *, <span class="keywordtype">double</span> *);
-<a name="l00183"></a>00183 cpl_error_code <a class="code" href="group__moses.html#gf708c4804f0aa98415025f2f7ed31f11">mos_image_shift</a>(cpl_image *, <span class="keywordtype">double</span> dx, <span class="keywordtype">double</span> dy);
-<a name="l00184"></a>00184 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gc32b3fba956da20bd20530372b1b28d1">mos_slit_closest_to_center</a>(cpl_table *slits, <span class="keywordtype">int</span> nx, <span class="keywordtype">int</span> ny);
-<a name="l00185"></a>00185 cpl_error_code <a class="code" href="group__moses.html#gbff2b46bad7584f819ae28fdd8c85343">mos_extract_flux</a>(cpl_image *, cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>,
-<a name="l00186"></a>00186                                 <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *);
-<a name="l00187"></a>00187 cpl_error_code <a class="code" href="group__moses.html#ga8abda7d8ad43a4c3287b7b9071f5094">mos_extract_flux_mapped</a>(cpl_image *, cpl_table *,
-<a name="l00188"></a>00188                                        <span class="keywordtype">double</span>, <span class="keywordtype">double</span>,
-<a name="l00189"></a>00189                                        <span class="keywordtype">double</span> lambda, <span class="keywordtype">double</span> startwave,
-<a name="l00190"></a>00190                                        <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> dx, <span class="keywordtype">double</span> gain,
-<a name="l00191"></a>00191                                        <span class="keywordtype">double</span> *o_flux, <span class="keywordtype">double</span> *o_err);
-<a name="l00192"></a>00192 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g8395eca2d64406c969f48220024e999b">mos_median_in_slit</a>(cpl_table *, cpl_table *, <span class="keywordtype">int</span> slit,
-<a name="l00193"></a>00193                        <span class="keywordtype">char</span> *label, <span class="keywordtype">double</span> *mvalue);
-<a name="l00194"></a>00194 cpl_image *<a class="code" href="group__moses.html#g4fe5f2fe3227522421783758228cdc39">mos_image_filter_median</a>(cpl_image *image, <span class="keywordtype">int</span> nx, <span class="keywordtype">int</span> ny);
-<a name="l00195"></a>00195 
-<a name="l00196"></a>00196 <span class="keywordtype">int</span> <a class="code" href="group__moses.html#g109d8f4044617368e21a9ffe41816497">fors_mos_is_lss_like</a>(cpl_table *maskslits, <span class="keywordtype">int</span> nslits_out_det);
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 
-<a name="l00199"></a>00199 CPL_END_DECLS
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201 <span class="preprocessor">#endif   </span><span class="comment">/* MOSES_H */</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/moses_8h_source.html b/html/moses_8h_source.html
new file mode 100644
index 0000000..9db0d99
--- /dev/null
+++ b/html/moses_8h_source.html
@@ -0,0 +1,276 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: moses.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">moses.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: moses.h,v 1.41 2013-09-09 12:19:20 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the VIMOS Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-09-09 12:19:20 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.41 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef MOSES_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define MOSES_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> cpl_table *mos_hough_table(cpl_table *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> cpl_image *<a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(cpl_image *, cpl_image *, cpl_table *);</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> cpl_image *<a class="code" href="group__moses.html#ga6b94ed200f4b1b8e281417a80b9aa4b5" title="Normalise a flat field exposure.">mos_normalise_flat</a>(cpl_image *, cpl_image *, cpl_table *, </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span>                               cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>                               <span class="keywordtype">int</span>, <span class="keywordtype">int</span>) CPL_ATTR_DEPRECATED;</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> cpl_image *<a class="code" href="group__moses.html#ga2efbe02c8b5535d746bc9dd9ece30296" title="Normalise a long slit flat field exposure.">mos_normalise_longflat</a>(cpl_image *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>) </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>     CPL_ATTR_DEPRECATED;</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> cpl_error_code <a class="code" href="group__moses.html#gafeaa9b762d7da8437fef7f5f579c04ba" title="Background determination on 1D emission line spectrum (arc)">mos_arc_background_1D</a>(<span class="keywordtype">float</span> *, <span class="keywordtype">float</span> *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> cpl_image *<a class="code" href="group__moses.html#ga063b7ef9e5f4fe46ecbcb1b170bc254b" title="Background determination on emission line spectrum (arc)">mos_arc_background</a>(cpl_image *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#ga28871a4ecc1e2779022f06d4da892360" title="Estimate lines widths (in pixel) in arc lamp spectrum.">mos_lines_width</a>(const <span class="keywordtype">float</span> *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> cpl_vector *<a class="code" href="group__moses.html#gad80729870e3acf9f61c820f488eb83b2" title="Find positions of peaks candidates.">mos_peak_candidates</a>(const <span class="keywordtype">float</span> *, <span class="keywordtype">int</span>, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>);</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> cpl_vector *<a class="code" href="group__moses.html#gacfa971d995aac0c8f05c37499861d191" title="Improve (when possible) accuracy of peaks candidates positions.">mos_refine_peaks</a>(const <span class="keywordtype">float</span> *, <span class="keywordtype">int</span>, cpl_vector *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keywordtype">void</span> mos_set_multiplex(<span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> cpl_bivector *<a class="code" href="group__moses.html#ga68dc8cea89fe90cd1990d82a6945ca97" title="Identify peak candidates.">mos_identify_peaks</a>(cpl_vector *, cpl_vector *,</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>                                  <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> cpl_bivector *<a class="code" href="group__moses.html#ga4ae590c72dce616bcbb426a3c2ec6ffe" title="Find the reference lines peaks using a polynomial first-guess.">mos_find_peaks</a>(const <span class="keywordtype">float</span> *, <span class="keywordtype">int</span>, cpl_vector *,</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>                              cpl_polynomial *, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#ga29da0280a1b9f08c181c491f6df0743a" title="Evaluate the wavelength of a pixel position.">mos_eval_dds</a>(cpl_polynomial *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> cpl_polynomial *<a class="code" href="group__moses.html#ga4d584e69389518aab8d6932e5841d399" title="Fit polynomial relation from wavelengths to pixels.">mos_poly_wav2pix</a>(cpl_bivector *, <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>,</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>                                  <span class="keywordtype">int</span> *, <span class="keywordtype">double</span> *);</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> cpl_polynomial *<a class="code" href="group__moses.html#ga8d5305df3cb184677081fb285cba6eb5" title="Fit polynomial relation from pixels to wavelengths.">mos_poly_pix2wav</a>(cpl_bivector *, <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>,</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>                                  <span class="keywordtype">int</span> *, <span class="keywordtype">double</span> *);</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> cpl_image *<a class="code" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw</a>(const cpl_image *image,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>                                           cpl_vector *lines,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>                                           <span class="keywordtype">double</span> dispersion, <span class="keywordtype">float</span> level,</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>                                           <span class="keywordtype">int</span> sradius, <span class="keywordtype">int</span> order,</div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>                                           <span class="keywordtype">double</span> reject, <span class="keywordtype">double</span> refwave, </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span>                                           <span class="keywordtype">double</span> *wavestart, <span class="keywordtype">double</span> *waveend,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>                                           <span class="keywordtype">int</span> *nlines, <span class="keywordtype">double</span> *error, </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>                                           cpl_table *idscoeff,</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>                                           cpl_image *calibration,</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>                                           cpl_image *residuals, </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>                                           cpl_table *restable,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                                           cpl_mask *refmask,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>                                           cpl_table *detected_lines);</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> cpl_error_code <a class="code" href="group__moses.html#gae5258889aa86b437e2531cdad02f4159" title="Interpolate MOS wavelength calibration.">mos_interpolate_wavecalib_slit</a>(cpl_table *, cpl_table *, </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>                                               <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> cpl_error_code <a class="code" href="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4" title="Interpolate LSS wavelength calibration.">mos_interpolate_wavecalib</a>(cpl_table *, cpl_image *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> cpl_table *<a class="code" href="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900" title="Find the location of detected spectra on the CCD.">mos_locate_spectra</a>(cpl_mask *);</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> cpl_error_code <a class="code" href="group__moses.html#ga9133e9d4bebf351c1ef75c903efa3e4d" title="Check validity of a slit location table.">mos_validate_slits</a>(cpl_table *);</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> cpl_error_code <a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f" title="Rotate a slit location table.">mos_rotate_slits</a>(cpl_table *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> cpl_table *<a class="code" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits</a>(cpl_table *, cpl_table *, cpl_table *);</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> cpl_table *mos_identify_slits_fast(cpl_table *, cpl_table *, cpl_table *);</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> cpl_table *<a class="code" href="group__moses.html#gaad02c30291fd30d07156ac8f397f439f" title="Trace flat field spectra.">mos_trace_flat</a>(cpl_image *, cpl_table *, <span class="keywordtype">double</span>,</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>                           <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> cpl_table *<a class="code" href="group__moses.html#ga7518d66581d93ab64704fcf90996296b" title="Fit spectral traces.">mos_poly_trace</a>(cpl_table *, cpl_table *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> cpl_error_code <a class="code" href="group__moses.html#ga0eda8a5abf396113ffbe66607fd72fe6" title="Recompute tracing coefficients globally.">mos_global_trace</a>(cpl_table *, cpl_table *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> cpl_image *<a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(cpl_image *, cpl_table *, cpl_table *, </div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>                                    <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>,</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>                                    cpl_image *);</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> cpl_image *<a class="code" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb" title="Derive wavelength calibration from a rectified arc lamp or sky exposure.">mos_wavelength_calibration_final</a>(cpl_image *image, cpl_table *slits,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                                             cpl_vector *lines,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                                             <span class="keywordtype">double</span> dispersion, <span class="keywordtype">float</span> level,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                                             <span class="keywordtype">int</span> sradius, <span class="keywordtype">int</span> order,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                                             <span class="keywordtype">double</span> reject, <span class="keywordtype">double</span> refwave,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                                             <span class="keywordtype">double</span> *wavestart, <span class="keywordtype">double</span> *waveend,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                                             <span class="keywordtype">int</span> *nlines, <span class="keywordtype">double</span> *error, </div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                                             cpl_table *idscoeff,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                                             cpl_image *calibration,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                                             cpl_image *residuals,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                                             cpl_table *restable,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>                                             cpl_table *detected_lines);</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> cpl_table *<a class="code" href="group__moses.html#gab847fe615b7510fc2d189e80cf5029b5" title="Determine all global distortions models.">mos_global_distortion</a>(cpl_table *, cpl_table *,</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>                                  cpl_table *, cpl_table *, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> cpl_table *<a class="code" href="group__moses.html#gad9b2789388ba6564011d832d276b2ae6" title="Build the slit location table from a global distortions table.">mos_build_slit_location</a>(cpl_table *, cpl_table *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> cpl_table *<a class="code" href="group__moses.html#gacff89218baba1abf3641c083a1125861" title="Build the curvature coefficients table from a global distortions table.">mos_build_curv_coeff</a>(cpl_table *, cpl_table *, cpl_table *);</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> cpl_table *<a class="code" href="group__moses.html#ga4e4da9890ad8d0229f187b4d7eda17be" title="Build the IDS coefficients table from a global distortions table.">mos_build_disp_coeff</a>(cpl_table *, cpl_table *);</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> cpl_table *<a class="code" href="group__moses.html#ga634eb7408671a139e7015185776f4513" title="Modify the input wavelength solution to match reference sky lines.">mos_wavelength_align</a>(cpl_image *, cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>,</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>                                 <span class="keywordtype">double</span>, cpl_table *, cpl_vector *, <span class="keywordtype">int</span>, </div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>                                 <span class="keywordtype">int</span>, cpl_image *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> cpl_table *<a class="code" href="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1" title="Modify the input wavelength solution to match reference sky lines (LSS).">mos_wavelength_align_lss</a>(cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>,</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>                               cpl_table *, cpl_vector *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, </div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>                               cpl_image *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> cpl_image *<a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                                       <span class="keywordtype">double</span>, cpl_table *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> cpl_image *<a class="code" href="group__moses.html#ga6187454ef3812203ba2d50d1e2d01326" title="Create a pixel map from an IDS coefficients table.">mos_map_pixel</a>(cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> cpl_image *<a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(cpl_table *, <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> cpl_image *<a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(cpl_image *, cpl_image *, cpl_table *, </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                                cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> cpl_image *<a class="code" href="group__moses.html#ga8525f2b52eb7ba887858420f36c53471" title="Remapping of slit spectra into a grid of lambda-space coordinates.">mos_map_spectrum</a>(cpl_image *, cpl_image *, cpl_image *, cpl_table *,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                             cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> cpl_image *<a class="code" href="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2" title="Subtract the sky from the scientific CCD exposure.">mos_subtract_sky</a>(cpl_image *, cpl_table *, cpl_table *, <span class="keywordtype">double</span>,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                             <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> cpl_table *<a class="code" href="group__moses.html#gab724daebffef27587b8183a6d765dc02" title="Create a CCD median sky map.">mos_sky_map</a>(cpl_image *, cpl_image *, <span class="keywordtype">double</span>, cpl_image *);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> cpl_table *<a class="code" href="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d" title="Create a CCD median sky map.">mos_sky_map_super</a>(cpl_image *, cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                              cpl_image *);</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> cpl_image *<a class="code" href="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8" title="Local determination of sky.">mos_sky_local_old</a>(cpl_image *spectra, cpl_table *slits);</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> cpl_image *<a class="code" href="group__moses.html#ga40e43aa1516aac5fc7e2ccc41381677d" title="Local determination of sky.">mos_sky_local</a>(cpl_image *, cpl_table *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> </div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> cpl_error_code <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(cpl_image *, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>, <span class="keywordtype">float</span>);</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> cpl_error_code mos_clean_bad_pixels(cpl_image *, cpl_table *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> </div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(cpl_image *, cpl_vector *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> cpl_image *<a class="code" href="group__moses.html#ga4592493a392e23ebc56259ed3bfc0719" title="Create coordinate map from spectral curvature table.">mos_spatial_map</a>(cpl_image *, cpl_table *, cpl_table *, <span class="keywordtype">double</span>,</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>                            <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> cpl_image *<a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(cpl_image *, cpl_table *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> cpl_image **<a class="code" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522" title="Extract detected objects from rectified scientific frame.">mos_extract_objects</a>(cpl_image *, cpl_image *, cpl_table *, </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>                                 <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#ga58039ea48fa183baf1701567781ad128" title="Compute mean spectral resolution at a given arc lamp line.">mos_spectral_resolution</a>(cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">int</span>,</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>                             <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *, <span class="keywordtype">int</span> *);</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> cpl_table *<a class="code" href="group__moses.html#gae9f633b64e1880984c084a19f53047fc" title="Compute mean spectral resolution at a given arc lamp line.">mos_resolution_table</a>(cpl_image *image, <span class="keywordtype">double</span> startwave,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                                 <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> saturation,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                                 cpl_vector *lines);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#gaba740d24473d57d687f75787e4ecc835" title="Integrate signal from wavelength and spatial interval.">mos_integrate_signal</a>(cpl_image *, cpl_image *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> </div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> cpl_polynomial *mos_montecarlo_polyfit(cpl_table *points, cpl_table *evaluate,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                                        <span class="keywordtype">int</span> samples, <span class="keywordtype">int</span> order);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> cpl_error_code <a class="code" href="group__moses.html#gab09208f34d27855a6db2d933ff3d02e2" title="Randomise image.">mos_randomise_image</a>(cpl_image *, <span class="keywordtype">double</span> ron,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                                    <span class="keywordtype">double</span> gain, <span class="keywordtype">double</span> bias);</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="comment">/* Instrument dependent!  */</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="keywordtype">double</span> <a class="code" href="group__moses.html#ga74be15e9eea7e1a4f025be22ccb12c54" title="Return gain factor for a VIMOS exposure.">mos_get_gain_vimos</a>(cpl_propertylist *);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> cpl_table *<a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(const cpl_propertylist *, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> cpl_table *mos_load_overscans_fors(const cpl_propertylist *);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> cpl_table *<a class="code" href="group__moses.html#ga3946bc30280b3b041a20ae9c9326f827" title="Create slit location table from FITS header of VIMOS data.">mos_load_slits_vimos</a>(cpl_propertylist *);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#ga332b9bfd8e704446ad24d9fa448f9df2" title="Determining whether a VIMOS mask has spectral multplexing or not.">mos_check_multiplex</a>(cpl_table *);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> cpl_table *<a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(cpl_propertylist *);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> cpl_table *<a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(cpl_propertylist *, <span class="keywordtype">int</span> * nslits_out_det);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> cpl_table *<a class="code" href="group__moses.html#ga43072c6a57d094a5d7d341934a096e80" title="Create slit location table from FITS header of FORS1/2 LSS data.">mos_load_slits_fors_lss</a>(cpl_propertylist *);</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> cpl_table *<a class="code" href="group__moses.html#ga78aebb1592ccefba83f9b7cbb80a9676" title="Create PMOS slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_pmos</a>(cpl_propertylist *, <span class="keywordtype">int</span> * nslits_out_det);</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> cpl_error_code <a class="code" href="group__moses.html#gae623b8129e3fd33516f32d866c5106a8" title="Reconstruct the gaps required for slit location.">mos_refmask_find_gaps</a>(cpl_mask  *, cpl_image *, <span class="keywordtype">double</span>);</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> cpl_error_code <a class="code" href="group__moses.html#ga854ead782f62a6929aade44b267353e0" title="Process saturation.">mos_saturation_process</a>(cpl_image *);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> cpl_error_code <a class="code" href="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0" title="Subtract the background.">mos_subtract_background</a>(cpl_image *);</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> cpl_error_code <a class="code" href="group__moses.html#ga5f9947ec541f1291f7c9fb20bd081280" title="Intersect a number of slit tables.">mos_object_intersect</a>(cpl_table **, cpl_table *, <span class="keywordtype">int</span>, <span class="keywordtype">float</span>);</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> </div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gae5fb2a72c41bab0464ad35c161e50cac" title="Get the maximum possible number of objects in a slit.">mos_get_maxobjs_per_slit</a>(cpl_table *);</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gaf4d5e8a0d6cd0356ab38f0b7be241352" title="Get the total number of objects detected in a slits table.">mos_get_nobjects</a>(cpl_table *);</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> </div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#ga71e13921907ec2f25478957d35318e7f" title="Check that all slit have been detected, insert them if not.">mos_check_slits</a>(cpl_table *, <span class="keywordtype">float</span>);</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="keywordtype">int</span> *fors_get_nobjs_perslit(cpl_table *);</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="keywordtype">int</span> mos_rebin_signal(cpl_image **, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="keywordtype">int</span> mos_rebin_error(cpl_image **, <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> cpl_table *<a class="code" href="group__moses.html#gaad62d9ba866b8abafb2da02053584bf2" title="Produce instrument response curve, with some ancillary information.">mos_photometric_calibration</a>(cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>,</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>                                  <span class="keywordtype">double</span>, cpl_table *, <span class="keywordtype">double</span>, cpl_table *,</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>                                  <span class="keywordtype">int</span>);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="keywordtype">int</span> map_table(cpl_image *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>, cpl_table *, <span class="keywordtype">char</span> *, <span class="keywordtype">char</span> *);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> cpl_image *<a class="code" href="group__moses.html#ga663cfcd4584b6a3e63e7593cba926688" title="Stack images using k-sigma clipping.">mos_ksigma_stack</a>(cpl_imagelist *imlist,</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>                             <span class="keywordtype">double</span> klow, <span class="keywordtype">double</span> khigh, <span class="keywordtype">int</span> kiter,</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>                             cpl_image **);</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> cpl_image *<a class="code" href="group__moses.html#ga2244278b632992a44067afcc42530954" title="Apply response curve to extracted spectra.">mos_apply_photometry</a>(cpl_image *, cpl_table *response,</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>                                 cpl_table *ext_table, <span class="keywordtype">double</span> startwave,</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>                                 <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> gain,</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>                                 <span class="keywordtype">double</span> exptime, <span class="keywordtype">double</span> airmass);</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> cpl_image *<a class="code" href="group__moses.html#gae8e4a9d1a1146de7ba72dd148848342d" title="Propagate errors from response curve and extracted spectra.">mos_propagate_photometry_error</a>(cpl_image *, cpl_image *,</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>                                 cpl_table *response,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                                 cpl_table *ext_table, <span class="keywordtype">double</span> startwave,</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                                 <span class="keywordtype">double</span> dispersion, <span class="keywordtype">double</span> gain,</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>                                 <span class="keywordtype">double</span> exptime, <span class="keywordtype">double</span> airmass);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gae97d35cc8cb29cbb0b43d4fc84e4d34b" title="Estimate linear polarisation parameters on spectral interval.">mos_check_polarisation</a>(cpl_image *q_image, cpl_image *q_error,</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>                            cpl_image *u_image, cpl_image *u_error,</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>                            <span class="keywordtype">double</span> startwave, <span class="keywordtype">double</span> dispersion,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                            <span class="keywordtype">double</span> band, cpl_table *pol_sta,</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>                            <span class="keywordtype">double</span> ra, <span class="keywordtype">double</span> dec, <span class="keywordtype">char</span> *filter,</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>                            <span class="keywordtype">int</span> *polarisation,</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>                            <span class="keywordtype">double</span> *p_offset, <span class="keywordtype">double</span> *p_error,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                            <span class="keywordtype">double</span> *a_offset, <span class="keywordtype">double</span> *a_error);</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gac442710556a5013dedd29befac482c9d" title="Estimate offset between two object tables.">mos_compute_offset</a>(cpl_table *, cpl_table *, <span class="keywordtype">double</span> *);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> cpl_error_code <a class="code" href="group__moses.html#ga82c7c158316d8aba35ffa271b44510c6" title="Shift values in an image.">mos_image_shift</a>(cpl_image *, <span class="keywordtype">double</span> dx, <span class="keywordtype">double</span> dy);</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31" title="Return slit closest to CCD center.">mos_slit_closest_to_center</a>(cpl_table *slits, <span class="keywordtype">int</span> nx, <span class="keywordtype">int</span> ny);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> cpl_error_code <a class="code" href="group__moses.html#ga5291b43599e8dec884137f867fe72bfd" title="Measure flux from spectral interval on CCD.">mos_extract_flux</a>(cpl_image *, cpl_table *, <span class="keywordtype">double</span>, <span class="keywordtype">double</span>,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                                 <span class="keywordtype">int</span>, <span class="keywordtype">double</span>, <span class="keywordtype">double</span> *, <span class="keywordtype">double</span> *);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> cpl_error_code <a class="code" href="group__moses.html#gaf91a99846ae06aa780b59deced1fa215" title="Measure flux from spectral interval on remapped frame.">mos_extract_flux_mapped</a>(cpl_image *, cpl_table *,</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>                                        <span class="keywordtype">double</span>, <span class="keywordtype">double</span>,</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>                                        <span class="keywordtype">double</span> lambda, <span class="keywordtype">double</span> startwave,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                                        <span class="keywordtype">double</span> dispersion, <span class="keywordtype">int</span> dx, <span class="keywordtype">double</span> gain,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                        <span class="keywordtype">double</span> *o_flux, <span class="keywordtype">double</span> *o_err);</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="keywordtype">int</span> <a class="code" href="group__moses.html#gac6224c743943d88920b1e93f7394d009" title="Compute median from a table column section corresponding to a slit.">mos_median_in_slit</a>(cpl_table *, cpl_table *, <span class="keywordtype">int</span> slit,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                        <span class="keywordtype">char</span> *label, <span class="keywordtype">double</span> *mvalue);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> cpl_image *<a class="code" href="group__moses.html#ga1f574f5f45840ea69fa03eb26055a1b1" title="Convenience function for standard median filtering.">mos_image_filter_median</a>(cpl_image *image, <span class="keywordtype">int</span> nx, <span class="keywordtype">int</span> ny);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="keywordtype">int</span> fors_mos_is_lss_like(cpl_table *maskslits, <span class="keywordtype">int</span> nslits_out_det);</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> </div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> </div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="preprocessor">#endif   </span><span class="comment">/* MOSES_H */</span><span class="preprocessor"></span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/nav_f.png b/html/nav_f.png
new file mode 100644
index 0000000..72a58a5
Binary files /dev/null and b/html/nav_f.png differ
diff --git a/html/nav_g.png b/html/nav_g.png
new file mode 100644
index 0000000..9681f15
Binary files /dev/null and b/html/nav_g.png differ
diff --git a/html/nav_h.png b/html/nav_h.png
new file mode 100644
index 0000000..33389b1
Binary files /dev/null and b/html/nav_h.png differ
diff --git a/html/open.png b/html/open.png
new file mode 100644
index 0000000..30f75c7
Binary files /dev/null and b/html/open.png differ
diff --git a/html/recipes-test_8c-source.html b/html/recipes-test_8c-source.html
deleted file mode 100644
index a096d02..0000000
--- a/html/recipes-test_8c-source.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: recipes-test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a> &raquo <a class="el" href="dir_f9b8c94f8f09c10447edf4ed11ceb4e6.html">tests</a></div>
-<h1>recipes-test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: recipes-test.c,v 1.6 2007/10/26 14:02:15 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/10/26 14:02:15 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.6 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <stdlib.h></span>
-<a name="l00033"></a>00033 
-<a name="l00043"></a><a class="code" href="group__recipes__test.html#g5ad1c26f00c2399d3a5c7850100212d0">00043</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#g5ad1c26f00c2399d3a5c7850100212d0">main</a>(<span class="keywordtype">void</span>)
-<a name="l00044"></a>00044 {
-<a name="l00045"></a>00045     exit(EXIT_SUCCESS);
-<a name="l00046"></a>00046 }
-<a name="l00047"></a>00047 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/recipes-test_8c_source.html b/html/recipes-test_8c_source.html
new file mode 100644
index 0000000..1a10f81
--- /dev/null
+++ b/html/recipes-test_8c_source.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: recipes-test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li><li class="navelem"><a class="el" href="dir_29caecd79ba0d8cf1bf29f8555ca3deb.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">recipes-test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: recipes-test.c,v 1.6 2007-10-26 14:02:15 jmlarsen Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: jmlarsen $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007-10-26 14:02:15 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.6 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <stdlib.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="group__recipes__test.html#ga840291bc02cba5474a4cb46a9b9566fe">   43</a></span> <span class="keywordtype">int</span> <a class="code" href="group__fors__test.html#ga840291bc02cba5474a4cb46a9b9566fe" title="Generic library tests.">main</a>(<span class="keywordtype">void</span>)</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> {</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>     exit(EXIT_SUCCESS);</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> }</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/recipes_2fors__extract_8c-source.html b/html/recipes_2fors__extract_8c-source.html
deleted file mode 100644
index f1ee8ac..0000000
--- a/html/recipes_2fors__extract_8c-source.html
+++ /dev/null
@@ -1,1720 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: fors_extract.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>recipes/fors_extract.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: fors_extract.c,v 1.11 2013/04/24 14:15:36 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:15:36 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.11 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <string.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <math.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <moses.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_create(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_exec(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_destroy(cpl_plugin *);
-<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1">fors_extract</a>(cpl_parameterlist *, cpl_frameset *);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">char</span> fors_extract_description[] =
-<a name="l00044"></a>00044 <span class="stringliteral">"This recipe is used to reduce scientific spectra using the global\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"distortion table created by the recipe fors_calib. The spectra are\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"bias subtracted, flat fielded (if a normalised flat field is specified)\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"and remapped eliminating the optical distortions. The wavelength calibration\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"can be optionally upgraded using a number of sky lines: if no sky lines\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"catalog of wavelengths is specified, an internal one is used instead.\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"If the alignment to the sky lines is performed, the applied dispersion\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"coefficient table is upgraded and saved to disk, and a new CCD wavelengths\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"map is created.\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. A grism table (typically\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"depending on the instrument mode, and in particular on the grism used)\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"may also be specified: this table contains a default recipe parameter\n"</span> 
-<a name="l00056"></a>00056 <span class="stringliteral">"setting to control the way spectra are extracted for a specific instrument\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"mode, as it is used for automatic run of the pipeline on Paranal and in\n"</span> 
-<a name="l00058"></a>00058 <span class="stringliteral">"Garching. If this table is specified, it will modify the default recipe\n"</span> 
-<a name="l00059"></a>00059 <span class="stringliteral">"parameter setting, with the exception of those parameters which have been\n"</span> 
-<a name="l00060"></a>00060 <span class="stringliteral">"explicitly modifyed on the command line. If a grism table is not specified,\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"the input recipe parameters values will always be read from the command\n"</span> 
-<a name="l00062"></a>00062 <span class="stringliteral">"line, or from an esorex configuration file if present, or from their\n"</span> 
-<a name="l00063"></a>00063 <span class="stringliteral">"generic default values (that are rarely meaningful).\n"</span> 
-<a name="l00064"></a>00064 <span class="stringliteral">"In the table below the MXU acronym can be read alternatively as MOS\n"</span>
-<a name="l00065"></a>00065 <span class="stringliteral">"and LSS, depending on the instrument mode of the input data. Either a\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"scientific or a standard star exposure can be specified in input (not\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"both).\n\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"  SCIENCE_MXU                Raw         Scientific exposure     Y\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"  or STANDARD_MXU            Raw         Standard star exposure  Y\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"  MASTER_BIAS                Calib       Master bias             Y\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"  MASTER_SKYLINECAT          Calib       Sky lines catalog       .\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"  MASTER_NORM_FLAT_MXU       Calib       Normalised flat field   .\n"</span>
-<a name="l00077"></a>00077 <span class="stringliteral">"  MASTER_DISTORTION_TABLE    Calib       Global distortion model .\n"</span>
-<a name="l00078"></a>00078 <span class="stringliteral">"\n"</span>
-<a name="l00079"></a>00079 <span class="stringliteral">"  or, in case of LSS-like MOS/MXU data,\n"</span>
-<a name="l00080"></a>00080 <span class="stringliteral">"\n"</span>
-<a name="l00081"></a>00081 <span class="stringliteral">"  MASTER_NORM_FLAT_LONG_MXU  Calib       Normalised flat field   .\n"</span>
-<a name="l00082"></a>00082 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"  REDUCED_SCI_MXU            FITS image  Extracted scientific spectra\n"</span>
-<a name="l00085"></a>00085 <span class="stringliteral">"  REDUCED_SKY_SCI_MXU        FITS image  Extracted sky spectra\n"</span>
-<a name="l00086"></a>00086 <span class="stringliteral">"  REDUCED_ERROR_SCI_MXU      FITS image  Errors on extracted spectra\n"</span>
-<a name="l00087"></a>00087 <span class="stringliteral">"  UNMAPPED_SCI_MXU           FITS image  Sky subtracted scientific spectra\n"</span>
-<a name="l00088"></a>00088 <span class="stringliteral">"  MAPPED_SCI_MXU             FITS image  Rectified scientific spectra\n"</span>
-<a name="l00089"></a>00089 <span class="stringliteral">"  MAPPED_ALL_SCI_MXU         FITS image  Rectified science spectra with sky\n"</span>
-<a name="l00090"></a>00090 <span class="stringliteral">"  MAPPED_SKY_SCI_MXU         FITS image  Rectified sky spectra\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"  UNMAPPED_SKY_SCI_MXU           FITS image  Sky on CCD\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"  GLOBAL_SKY_SPECTRUM_MXU    FITS table  Global sky spectrum\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"  OBJECT_TABLE_SCI_MXU       FITS table  Positions of detected objects\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"  Only if the sky-alignment of the wavelength solution is requested:\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"  SKY_SHIFTS_LONG_SCI_MXU    FITS table  Sky lines offsets (LSS-like data)\n"</span>
-<a name="l00097"></a>00097 <span class="stringliteral">"  or SKY_SHIFTS_SLIT_SCI_MXU FITS table  Sky lines offsets (MOS-like data)\n"</span>
-<a name="l00098"></a>00098 <span class="stringliteral">"  DISP_COEFF_SCI_MXU         FITS table  Upgraded dispersion coefficients\n"</span>
-<a name="l00099"></a>00099 <span class="stringliteral">"  WAVELENGTH_MAP_SCI_MXU     FITS image  Upgraded wavelength map\n\n"</span>;
-<a name="l00100"></a>00100 
-<a name="l00101"></a>00101 <span class="preprocessor">#define fors_extract_exit(message)            \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">{                                             \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">cpl_free(exptime);                            \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">cpl_free(instrume);                           \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">cpl_image_delete(dummy);                      \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">cpl_image_delete(mapped);                     \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">cpl_image_delete(skylocalmap);                \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">cpl_image_delete(smapped);                    \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">cpl_table_delete(offsets);                    \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">cpl_table_delete(global);                     \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">cpl_table_delete(sky);                        \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">cpl_image_delete(bias);                       \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00121"></a>00121 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00123"></a>00123 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00124"></a>00124 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00125"></a>00125 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00126"></a>00126 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00127"></a>00127 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00128"></a>00128 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00129"></a>00129 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00130"></a>00130 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00131"></a>00131 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00132"></a>00132 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00133"></a>00133 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00134"></a>00134 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00135"></a>00135 <span class="preprocessor">}</span>
-<a name="l00136"></a>00136 <span class="preprocessor"></span>
-<a name="l00137"></a>00137 
-<a name="l00138"></a>00138 <span class="preprocessor">#define fors_extract_exit_memcheck(message)            \</span>
-<a name="l00139"></a>00139 <span class="preprocessor">{                                                      \</span>
-<a name="l00140"></a>00140 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);            \</span>
-<a name="l00141"></a>00141 <span class="preprocessor">printf("free exptime (%p)\n", exptime);                \</span>
-<a name="l00142"></a>00142 <span class="preprocessor">cpl_free(exptime);                                     \</span>
-<a name="l00143"></a>00143 <span class="preprocessor">printf("free instrume (%p)\n", instrume);              \</span>
-<a name="l00144"></a>00144 <span class="preprocessor">cpl_free(instrume);                                    \</span>
-<a name="l00145"></a>00145 <span class="preprocessor">printf("free dummy (%p)\n", dummy);                    \</span>
-<a name="l00146"></a>00146 <span class="preprocessor">cpl_image_delete(dummy);                               \</span>
-<a name="l00147"></a>00147 <span class="preprocessor">printf("free mapped (%p)\n", mapped);                  \</span>
-<a name="l00148"></a>00148 <span class="preprocessor">cpl_image_delete(mapped);                              \</span>
-<a name="l00149"></a>00149 <span class="preprocessor">printf("free mapped_cleaned (%p)\n", mapped_cleaned);  \</span>
-<a name="l00150"></a>00150 <span class="preprocessor">cpl_image_delete(mapped_cleaned);                      \</span>
-<a name="l00151"></a>00151 <span class="preprocessor">printf("free mapped_sky (%p)\n", mapped_sky);          \</span>
-<a name="l00152"></a>00152 <span class="preprocessor">cpl_image_delete(mapped_sky);                          \</span>
-<a name="l00153"></a>00153 <span class="preprocessor">printf("free skylocalmap (%p)\n", skylocalmap);        \</span>
-<a name="l00154"></a>00154 <span class="preprocessor">cpl_image_delete(skylocalmap);                         \</span>
-<a name="l00155"></a>00155 <span class="preprocessor">printf("free skymap (%p)\n", skymap);                  \</span>
-<a name="l00156"></a>00156 <span class="preprocessor">cpl_image_delete(skymap);                              \</span>
-<a name="l00157"></a>00157 <span class="preprocessor">printf("free smapped (%p)\n", smapped);                \</span>
-<a name="l00158"></a>00158 <span class="preprocessor">cpl_image_delete(smapped);                             \</span>
-<a name="l00159"></a>00159 <span class="preprocessor">printf("free offsets (%p)\n", offsets);                \</span>
-<a name="l00160"></a>00160 <span class="preprocessor">cpl_table_delete(offsets);                             \</span>
-<a name="l00161"></a>00161 <span class="preprocessor">printf("free global (%p)\n", global);                  \</span>
-<a name="l00162"></a>00162 <span class="preprocessor">cpl_table_delete(global);                              \</span>
-<a name="l00163"></a>00163 <span class="preprocessor">printf("free sky (%p)\n", sky);                        \</span>
-<a name="l00164"></a>00164 <span class="preprocessor">cpl_table_delete(sky);                                 \</span>
-<a name="l00165"></a>00165 <span class="preprocessor">printf("free bias (%p)\n", bias);                      \</span>
-<a name="l00166"></a>00166 <span class="preprocessor">cpl_image_delete(bias);                                \</span>
-<a name="l00167"></a>00167 <span class="preprocessor">printf("free spectra (%p)\n", spectra);                \</span>
-<a name="l00168"></a>00168 <span class="preprocessor">cpl_image_delete(spectra);                             \</span>
-<a name="l00169"></a>00169 <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);          \</span>
-<a name="l00170"></a>00170 <span class="preprocessor">cpl_image_delete(coordinate);                          \</span>
-<a name="l00171"></a>00171 <span class="preprocessor">printf("free norm_flat (%p)\n", norm_flat);            \</span>
-<a name="l00172"></a>00172 <span class="preprocessor">cpl_image_delete(norm_flat);                           \</span>
-<a name="l00173"></a>00173 <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);                \</span>
-<a name="l00174"></a>00174 <span class="preprocessor">cpl_image_delete(rainbow);                             \</span>
-<a name="l00175"></a>00175 <span class="preprocessor">printf("free rectified (%p)\n", rectified);            \</span>
-<a name="l00176"></a>00176 <span class="preprocessor">cpl_image_delete(rectified);                           \</span>
-<a name="l00177"></a>00177 <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);                \</span>
-<a name="l00178"></a>00178 <span class="preprocessor">cpl_image_delete(wavemap);                             \</span>
-<a name="l00179"></a>00179 <span class="preprocessor">printf("free header (%p)\n", header);                  \</span>
-<a name="l00180"></a>00180 <span class="preprocessor">cpl_propertylist_delete(header);                       \</span>
-<a name="l00181"></a>00181 <span class="preprocessor">printf("free save_header (%p)\n", save_header);        \</span>
-<a name="l00182"></a>00182 <span class="preprocessor">cpl_propertylist_delete(save_header);                  \</span>
-<a name="l00183"></a>00183 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table);        \</span>
-<a name="l00184"></a>00184 <span class="preprocessor">cpl_table_delete(grism_table);                         \</span>
-<a name="l00185"></a>00185 <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);              \</span>
-<a name="l00186"></a>00186 <span class="preprocessor">cpl_table_delete(idscoeff);                            \</span>
-<a name="l00187"></a>00187 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);            \</span>
-<a name="l00188"></a>00188 <span class="preprocessor">cpl_table_delete(maskslits);                           \</span>
-<a name="l00189"></a>00189 <span class="preprocessor">printf("free overscans (%p)\n", overscans);            \</span>
-<a name="l00190"></a>00190 <span class="preprocessor">cpl_table_delete(overscans);                           \</span>
-<a name="l00191"></a>00191 <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);          \</span>
-<a name="l00192"></a>00192 <span class="preprocessor">cpl_table_delete(polytraces);                          \</span>
-<a name="l00193"></a>00193 <span class="preprocessor">printf("free slits (%p)\n", slits);                    \</span>
-<a name="l00194"></a>00194 <span class="preprocessor">cpl_table_delete(slits);                               \</span>
-<a name="l00195"></a>00195 <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths);        \</span>
-<a name="l00196"></a>00196 <span class="preprocessor">cpl_table_delete(wavelengths);                         \</span>
-<a name="l00197"></a>00197 <span class="preprocessor">printf("free lines (%p)\n", lines);                    \</span>
-<a name="l00198"></a>00198 <span class="preprocessor">cpl_vector_delete(lines);                              \</span>
-<a name="l00199"></a>00199 <span class="preprocessor">cpl_msg_indent_less();                                 \</span>
-<a name="l00200"></a>00200 <span class="preprocessor">return 0;                                              \</span>
-<a name="l00201"></a>00201 <span class="preprocessor">}</span>
-<a name="l00202"></a>00202 <span class="preprocessor"></span>
-<a name="l00203"></a>00203 
-<a name="l00215"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00215</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00216"></a>00216 {
-<a name="l00217"></a>00217     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00218"></a>00218     cpl_plugin *plugin = &recipe->interface;
-<a name="l00219"></a>00219 
-<a name="l00220"></a>00220     cpl_plugin_init(plugin,
-<a name="l00221"></a>00221                     CPL_PLUGIN_API,
-<a name="l00222"></a>00222                     FORS_BINARY_VERSION,
-<a name="l00223"></a>00223                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00224"></a>00224                     <span class="stringliteral">"fors_extract"</span>,
-<a name="l00225"></a>00225                     <span class="stringliteral">"Extraction of scientific spectra"</span>,
-<a name="l00226"></a>00226                     fors_extract_description,
-<a name="l00227"></a>00227                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00228"></a>00228                     PACKAGE_BUGREPORT,
-<a name="l00229"></a>00229     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00230"></a>00230     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00231"></a>00231     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00232"></a>00232     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00233"></a>00233     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00234"></a>00234     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00235"></a>00235     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00236"></a>00236     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00237"></a>00237     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00238"></a>00238     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00239"></a>00239     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00240"></a>00240     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00241"></a>00241     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00242"></a>00242                     fors_extract_create,
-<a name="l00243"></a>00243                     fors_extract_exec,
-<a name="l00244"></a>00244                     fors_extract_destroy);
-<a name="l00245"></a>00245 
-<a name="l00246"></a>00246     cpl_pluginlist_append(list, plugin);
-<a name="l00247"></a>00247     
-<a name="l00248"></a>00248     <span class="keywordflow">return</span> 0;
-<a name="l00249"></a>00249 }
-<a name="l00250"></a>00250 
-<a name="l00251"></a>00251 
-<a name="l00262"></a>00262 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_create(cpl_plugin *plugin)
-<a name="l00263"></a>00263 {
-<a name="l00264"></a>00264     cpl_recipe    *recipe;
-<a name="l00265"></a>00265     cpl_parameter *p;
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267 
-<a name="l00268"></a>00268     <span class="comment">/* </span>
-<a name="l00269"></a>00269 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00270"></a>00270 <span class="comment">     */</span>
-<a name="l00271"></a>00271 
-<a name="l00272"></a>00272     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00273"></a>00273         recipe = (cpl_recipe *)plugin;
-<a name="l00274"></a>00274     <span class="keywordflow">else</span> 
-<a name="l00275"></a>00275         <span class="keywordflow">return</span> -1;
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277     <span class="comment">/* </span>
-<a name="l00278"></a>00278 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00279"></a>00279 <span class="comment">     */</span>
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     <span class="comment">/*</span>
-<a name="l00285"></a>00285 <span class="comment">     * Dispersion</span>
-<a name="l00286"></a>00286 <span class="comment">     */</span>
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.dispersion"</span>,
-<a name="l00289"></a>00289                                 CPL_TYPE_DOUBLE,
-<a name="l00290"></a>00290                                 <span class="stringliteral">"Resampling step (Angstrom/pixel)"</span>,
-<a name="l00291"></a>00291                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00292"></a>00292                                 0.0);
-<a name="l00293"></a>00293     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00294"></a>00294     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00295"></a>00295     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297     <span class="comment">/*</span>
-<a name="l00298"></a>00298 <span class="comment">     * Sky lines alignment</span>
-<a name="l00299"></a>00299 <span class="comment">     */</span>
-<a name="l00300"></a>00300 
-<a name="l00301"></a>00301     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.skyalign"</span>,
-<a name="l00302"></a>00302                                 CPL_TYPE_INT,
-<a name="l00303"></a>00303                                 <span class="stringliteral">"Polynomial order for sky lines alignment, "</span>
-<a name="l00304"></a>00304                                 <span class="stringliteral">"or -1 to avoid alignment"</span>,
-<a name="l00305"></a>00305                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00306"></a>00306                                 0);
-<a name="l00307"></a>00307     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);
-<a name="l00308"></a>00308     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00309"></a>00309     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311     <span class="comment">/*</span>
-<a name="l00312"></a>00312 <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span>
-<a name="l00313"></a>00313 <span class="comment">     */</span>
-<a name="l00314"></a>00314 
-<a name="l00315"></a>00315     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.wcolumn"</span>,
-<a name="l00316"></a>00316                                 CPL_TYPE_STRING,
-<a name="l00317"></a>00317                                 <span class="stringliteral">"Name of sky line catalog table column "</span>
-<a name="l00318"></a>00318                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00319"></a>00319                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00320"></a>00320                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00321"></a>00321     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00322"></a>00322     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00323"></a>00323     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00324"></a>00324 
-<a name="l00325"></a>00325     <span class="comment">/*</span>
-<a name="l00326"></a>00326 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00327"></a>00327 <span class="comment">     */</span>
-<a name="l00328"></a>00328 
-<a name="l00329"></a>00329     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.startwavelength"</span>,
-<a name="l00330"></a>00330                                 CPL_TYPE_DOUBLE,
-<a name="l00331"></a>00331                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00332"></a>00332                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00333"></a>00333                                 0.0);
-<a name="l00334"></a>00334     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00335"></a>00335     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00336"></a>00336     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338     <span class="comment">/*</span>
-<a name="l00339"></a>00339 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00340"></a>00340 <span class="comment">     */</span>
-<a name="l00341"></a>00341 
-<a name="l00342"></a>00342     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.endwavelength"</span>,
-<a name="l00343"></a>00343                                 CPL_TYPE_DOUBLE,
-<a name="l00344"></a>00344                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00345"></a>00345                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00346"></a>00346                                 0.0);
-<a name="l00347"></a>00347     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00348"></a>00348     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00349"></a>00349     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00350"></a>00350 
-<a name="l00351"></a>00351     <span class="comment">/*</span>
-<a name="l00352"></a>00352 <span class="comment">     * Flux conservation</span>
-<a name="l00353"></a>00353 <span class="comment">     */</span>
-<a name="l00354"></a>00354 
-<a name="l00355"></a>00355     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.flux"</span>,
-<a name="l00356"></a>00356                                 CPL_TYPE_BOOL,
-<a name="l00357"></a>00357                                 <span class="stringliteral">"Apply flux conservation"</span>,
-<a name="l00358"></a>00358                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00359"></a>00359                                 TRUE);
-<a name="l00360"></a>00360     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);
-<a name="l00361"></a>00361     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00362"></a>00362     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00363"></a>00363 
-<a name="l00364"></a>00364     <span class="comment">/*</span>
-<a name="l00365"></a>00365 <span class="comment">     * Apply flat field</span>
-<a name="l00366"></a>00366 <span class="comment">     */</span>
-<a name="l00367"></a>00367 
-<a name="l00368"></a>00368     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.flatfield"</span>,
-<a name="l00369"></a>00369                                 CPL_TYPE_BOOL,
-<a name="l00370"></a>00370                                 <span class="stringliteral">"Apply flat field"</span>,
-<a name="l00371"></a>00371                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00372"></a>00372                                 FALSE);
-<a name="l00373"></a>00373     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flatfield"</span>);
-<a name="l00374"></a>00374     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00375"></a>00375     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00376"></a>00376 
-<a name="l00377"></a>00377     <span class="comment">/*</span>
-<a name="l00378"></a>00378 <span class="comment">     * Global sky subtraction</span>
-<a name="l00379"></a>00379 <span class="comment">     */</span>
-<a name="l00380"></a>00380 
-<a name="l00381"></a>00381     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.skyglobal"</span>,
-<a name="l00382"></a>00382                                 CPL_TYPE_BOOL,
-<a name="l00383"></a>00383                                 <span class="stringliteral">"Subtract global sky spectrum from CCD"</span>,
-<a name="l00384"></a>00384                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00385"></a>00385                                 FALSE);
-<a name="l00386"></a>00386     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyglobal"</span>);
-<a name="l00387"></a>00387     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00388"></a>00388     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390     <span class="comment">/*</span>
-<a name="l00391"></a>00391 <span class="comment">     * Local sky subtraction on extracted spectra</span>
-<a name="l00392"></a>00392 <span class="comment">     */</span>
-<a name="l00393"></a>00393 
-<a name="l00394"></a>00394 <span class="comment">/*** New sky subtraction (search NSS)</span>
-<a name="l00395"></a>00395 <span class="comment">    p = cpl_parameter_new_value("fors.fors_extract.skymedian",</span>
-<a name="l00396"></a>00396 <span class="comment">                                CPL_TYPE_INT,</span>
-<a name="l00397"></a>00397 <span class="comment">                                "Degree of sky fitting polynomial for "</span>
-<a name="l00398"></a>00398 <span class="comment">                                "sky subtraction from extracted "</span>
-<a name="l00399"></a>00399 <span class="comment">                                "slit spectra (MOS/MXU only, -1 to disable it)",</span>
-<a name="l00400"></a>00400 <span class="comment">                                "fors.fors_extract",</span>
-<a name="l00401"></a>00401 <span class="comment">                                0);</span>
-<a name="l00402"></a>00402 <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "skymedian");</span>
-<a name="l00403"></a>00403 <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span>
-<a name="l00404"></a>00404 <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span>
-<a name="l00405"></a>00405 <span class="comment">***/</span>
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.skymedian"</span>,
-<a name="l00408"></a>00408                                 CPL_TYPE_BOOL,
-<a name="l00409"></a>00409                                 <span class="stringliteral">"Sky subtraction from extracted slit spectra"</span>,
-<a name="l00410"></a>00410                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00411"></a>00411                                 FALSE);
-<a name="l00412"></a>00412     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skymedian"</span>);
-<a name="l00413"></a>00413     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00414"></a>00414     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00415"></a>00415 
-<a name="l00416"></a>00416     <span class="comment">/*</span>
-<a name="l00417"></a>00417 <span class="comment">     * Local sky subtraction on CCD spectra</span>
-<a name="l00418"></a>00418 <span class="comment">     */</span>
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.skylocal"</span>,
-<a name="l00421"></a>00421                                 CPL_TYPE_BOOL,
-<a name="l00422"></a>00422                                 <span class="stringliteral">"Sky subtraction from CCD slit spectra"</span>,
-<a name="l00423"></a>00423                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00424"></a>00424                                 TRUE);
-<a name="l00425"></a>00425     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skylocal"</span>);
-<a name="l00426"></a>00426     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00427"></a>00427     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00428"></a>00428 
-<a name="l00429"></a>00429     <span class="comment">/*</span>
-<a name="l00430"></a>00430 <span class="comment">     * Cosmic rays removal</span>
-<a name="l00431"></a>00431 <span class="comment">     */</span>
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.cosmics"</span>,
-<a name="l00434"></a>00434                                 CPL_TYPE_BOOL,
-<a name="l00435"></a>00435                                 <span class="stringliteral">"Eliminate cosmic rays hits (only if global "</span>
-<a name="l00436"></a>00436                                 <span class="stringliteral">"sky subtraction is also requested)"</span>,
-<a name="l00437"></a>00437                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00438"></a>00438                                 FALSE);
-<a name="l00439"></a>00439     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);
-<a name="l00440"></a>00440     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00441"></a>00441     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443     <span class="comment">/*</span>
-<a name="l00444"></a>00444 <span class="comment">     * Slit margin</span>
-<a name="l00445"></a>00445 <span class="comment">     */</span>
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.slit_margin"</span>,
-<a name="l00448"></a>00448                                 CPL_TYPE_INT,
-<a name="l00449"></a>00449                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span>
-<a name="l00450"></a>00450                                 <span class="stringliteral">"in object detection and extraction"</span>,
-<a name="l00451"></a>00451                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00452"></a>00452                                 3);
-<a name="l00453"></a>00453     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);
-<a name="l00454"></a>00454     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00455"></a>00455     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457     <span class="comment">/*</span>
-<a name="l00458"></a>00458 <span class="comment">     * Extraction radius</span>
-<a name="l00459"></a>00459 <span class="comment">     */</span>
-<a name="l00460"></a>00460 
-<a name="l00461"></a>00461     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.ext_radius"</span>,
-<a name="l00462"></a>00462                                 CPL_TYPE_INT,
-<a name="l00463"></a>00463                                 <span class="stringliteral">"Maximum extraction radius for detected "</span>
-<a name="l00464"></a>00464                                 <span class="stringliteral">"objects (pixel)"</span>,
-<a name="l00465"></a>00465                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00466"></a>00466                                 6);
-<a name="l00467"></a>00467     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);
-<a name="l00468"></a>00468     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00469"></a>00469     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00470"></a>00470 
-<a name="l00471"></a>00471     <span class="comment">/*</span>
-<a name="l00472"></a>00472 <span class="comment">     * Contamination radius</span>
-<a name="l00473"></a>00473 <span class="comment">     */</span>
-<a name="l00474"></a>00474 
-<a name="l00475"></a>00475     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.cont_radius"</span>,
-<a name="l00476"></a>00476                                 CPL_TYPE_INT,
-<a name="l00477"></a>00477                                 <span class="stringliteral">"Minimum distance at which two objects "</span>
-<a name="l00478"></a>00478                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span>
-<a name="l00479"></a>00479                                 <span class="stringliteral">"each other (pixel)"</span>,
-<a name="l00480"></a>00480                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00481"></a>00481                                 0);
-<a name="l00482"></a>00482     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);
-<a name="l00483"></a>00483     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00484"></a>00484     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00485"></a>00485 
-<a name="l00486"></a>00486     <span class="comment">/*</span>
-<a name="l00487"></a>00487 <span class="comment">     * Object extraction method</span>
-<a name="l00488"></a>00488 <span class="comment">     */</span>
-<a name="l00489"></a>00489 
-<a name="l00490"></a>00490     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.ext_mode"</span>,
-<a name="l00491"></a>00491                                 CPL_TYPE_INT,
-<a name="l00492"></a>00492                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span>
-<a name="l00493"></a>00493                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,
-<a name="l00494"></a>00494                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00495"></a>00495                                 1);
-<a name="l00496"></a>00496     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);
-<a name="l00497"></a>00497     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00498"></a>00498     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500     <span class="comment">/*</span>
-<a name="l00501"></a>00501 <span class="comment">     * Normalise output by exposure time</span>
-<a name="l00502"></a>00502 <span class="comment">     */</span>
-<a name="l00503"></a>00503 
-<a name="l00504"></a>00504     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.time_normalise"</span>,
-<a name="l00505"></a>00505                                 CPL_TYPE_BOOL,
-<a name="l00506"></a>00506                                 <span class="stringliteral">"Normalise output spectra by the exposure time"</span>,
-<a name="l00507"></a>00507                                 <span class="stringliteral">"fors.fors_extract"</span>,
-<a name="l00508"></a>00508                                 TRUE);
-<a name="l00509"></a>00509     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"time_normalise"</span>);
-<a name="l00510"></a>00510     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00511"></a>00511     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00512"></a>00512 
-<a name="l00513"></a>00513     <span class="keywordflow">return</span> 0;
-<a name="l00514"></a>00514 }
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516 
-<a name="l00525"></a>00525 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_exec(cpl_plugin *plugin)
-<a name="l00526"></a>00526 {
-<a name="l00527"></a>00527     cpl_recipe *recipe;
-<a name="l00528"></a>00528     
-<a name="l00529"></a>00529     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00530"></a>00530         recipe = (cpl_recipe *)plugin;
-<a name="l00531"></a>00531     <span class="keywordflow">else</span> 
-<a name="l00532"></a>00532         <span class="keywordflow">return</span> -1;
-<a name="l00533"></a>00533 
-<a name="l00534"></a>00534     <span class="keywordflow">return</span> <a class="code" href="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1">fors_extract</a>(recipe->parameters, recipe->frames);
-<a name="l00535"></a>00535 }
-<a name="l00536"></a>00536 
-<a name="l00537"></a>00537 
-<a name="l00546"></a>00546 <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_destroy(cpl_plugin *plugin)
-<a name="l00547"></a>00547 {
-<a name="l00548"></a>00548     cpl_recipe *recipe;
-<a name="l00549"></a>00549     
-<a name="l00550"></a>00550     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00551"></a>00551         recipe = (cpl_recipe *)plugin;
-<a name="l00552"></a>00552     <span class="keywordflow">else</span> 
-<a name="l00553"></a>00553         <span class="keywordflow">return</span> -1;
-<a name="l00554"></a>00554 
-<a name="l00555"></a>00555     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00556"></a>00556 
-<a name="l00557"></a>00557     <span class="keywordflow">return</span> 0;
-<a name="l00558"></a>00558 }
-<a name="l00559"></a>00559 
-<a name="l00560"></a>00560 
-<a name="l00570"></a>00570 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__extract.html#g885eea7c483f6fb87cb1751f62ef11c1">fors_extract</a>(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00571"></a>00571 {
-<a name="l00572"></a>00572 
-<a name="l00573"></a>00573     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_extract"</span>;
-<a name="l00574"></a>00574 
-<a name="l00575"></a>00575 
-<a name="l00576"></a>00576     <span class="comment">/*</span>
-<a name="l00577"></a>00577 <span class="comment">     * Input parameters</span>
-<a name="l00578"></a>00578 <span class="comment">     */</span>
-<a name="l00579"></a>00579 
-<a name="l00580"></a>00580     <span class="keywordtype">double</span>      dispersion;
-<a name="l00581"></a>00581     <span class="keywordtype">int</span>         skyalign;
-<a name="l00582"></a>00582     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00583"></a>00583     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00584"></a>00584     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00585"></a>00585     <span class="keywordtype">int</span>         flux;
-<a name="l00586"></a>00586     <span class="keywordtype">int</span>         flatfield;
-<a name="l00587"></a>00587     <span class="keywordtype">int</span>         skyglobal;
-<a name="l00588"></a>00588     <span class="keywordtype">int</span>         skylocal;
-<a name="l00589"></a>00589     <span class="keywordtype">int</span>         skymedian;
-<a name="l00590"></a>00590     <span class="keywordtype">int</span>         cosmics;
-<a name="l00591"></a>00591     <span class="keywordtype">int</span>         slit_margin;
-<a name="l00592"></a>00592     <span class="keywordtype">int</span>         ext_radius;
-<a name="l00593"></a>00593     <span class="keywordtype">int</span>         cont_radius;
-<a name="l00594"></a>00594     <span class="keywordtype">int</span>         ext_mode;
-<a name="l00595"></a>00595     <span class="keywordtype">int</span>         time_normalise;
-<a name="l00596"></a>00596 
-<a name="l00597"></a>00597 
-<a name="l00598"></a>00598     <span class="comment">/*</span>
-<a name="l00599"></a>00599 <span class="comment">     * CPL objects</span>
-<a name="l00600"></a>00600 <span class="comment">     */</span>
-<a name="l00601"></a>00601 
-<a name="l00602"></a>00602     cpl_imagelist    *all_science;
-<a name="l00603"></a>00603     cpl_image       **images;
-<a name="l00604"></a>00604 
-<a name="l00605"></a>00605     cpl_image        *bias           = NULL;
-<a name="l00606"></a>00606     cpl_image        *norm_flat      = NULL;
-<a name="l00607"></a>00607     cpl_image        *spectra        = NULL;
-<a name="l00608"></a>00608     cpl_image        *rectified      = NULL;
-<a name="l00609"></a>00609     cpl_image        *coordinate     = NULL;
-<a name="l00610"></a>00610     cpl_image        *rainbow        = NULL;
-<a name="l00611"></a>00611     cpl_image        *mapped         = NULL;
-<a name="l00612"></a>00612     cpl_image        *mapped_sky     = NULL;
-<a name="l00613"></a>00613     cpl_image        *mapped_cleaned = NULL;
-<a name="l00614"></a>00614     cpl_image        *smapped        = NULL;
-<a name="l00615"></a>00615     cpl_image        *wavemap        = NULL;
-<a name="l00616"></a>00616     cpl_image        *skymap         = NULL;
-<a name="l00617"></a>00617     cpl_image        *skylocalmap    = NULL;
-<a name="l00618"></a>00618     cpl_image        *dummy          = NULL;
-<a name="l00619"></a>00619 
-<a name="l00620"></a>00620     cpl_table        *grism_table    = NULL;
-<a name="l00621"></a>00621     cpl_table        *overscans      = NULL;
-<a name="l00622"></a>00622     cpl_table        *wavelengths    = NULL;
-<a name="l00623"></a>00623     cpl_table        *idscoeff       = NULL;
-<a name="l00624"></a>00624     cpl_table        *slits          = NULL;
-<a name="l00625"></a>00625     cpl_table        *maskslits      = NULL;
-<a name="l00626"></a>00626     cpl_table        *polytraces     = NULL;
-<a name="l00627"></a>00627     cpl_table        *offsets        = NULL;
-<a name="l00628"></a>00628     cpl_table        *sky            = NULL;
-<a name="l00629"></a>00629     cpl_table        *global         = NULL;
-<a name="l00630"></a>00630 
-<a name="l00631"></a>00631     cpl_vector       *lines          = NULL;
-<a name="l00632"></a>00632 
-<a name="l00633"></a>00633     cpl_propertylist *header         = NULL;
-<a name="l00634"></a>00634     cpl_propertylist *save_header    = NULL;
-<a name="l00635"></a>00635 
-<a name="l00636"></a>00636     <span class="comment">/*</span>
-<a name="l00637"></a>00637 <span class="comment">     * Auxiliary variables</span>
-<a name="l00638"></a>00638 <span class="comment">     */</span>
-<a name="l00639"></a>00639 
-<a name="l00640"></a>00640     <span class="keywordtype">char</span>         version[80];
-<a name="l00641"></a>00641     <span class="keywordtype">char</span>        *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00642"></a>00642     <span class="keywordtype">char</span>        *wheel4 = NULL;
-<a name="l00643"></a>00643     <span class="keyword">const</span> <span class="keywordtype">char</span>  *science_tag;
-<a name="l00644"></a>00644     <span class="keyword">const</span> <span class="keywordtype">char</span>  *master_norm_flat_tag;
-<a name="l00645"></a>00645     <span class="keyword">const</span> <span class="keywordtype">char</span>  *disp_coeff_sky_tag;
-<a name="l00646"></a>00646     <span class="keyword">const</span> <span class="keywordtype">char</span>  *wavelength_map_sky_tag;
-<a name="l00647"></a>00647     <span class="keyword">const</span> <span class="keywordtype">char</span>  *reduced_science_tag;
-<a name="l00648"></a>00648     <span class="keyword">const</span> <span class="keywordtype">char</span>  *reduced_sky_tag;
-<a name="l00649"></a>00649     <span class="keyword">const</span> <span class="keywordtype">char</span>  *reduced_error_tag;
-<a name="l00650"></a>00650     <span class="keyword">const</span> <span class="keywordtype">char</span>  *mapped_science_tag;
-<a name="l00651"></a>00651     <span class="keyword">const</span> <span class="keywordtype">char</span>  *unmapped_science_tag;
-<a name="l00652"></a>00652     <span class="keyword">const</span> <span class="keywordtype">char</span>  *mapped_science_sky_tag;
-<a name="l00653"></a>00653     <span class="keyword">const</span> <span class="keywordtype">char</span>  *mapped_sky_tag;
-<a name="l00654"></a>00654     <span class="keyword">const</span> <span class="keywordtype">char</span>  *unmapped_sky_tag;
-<a name="l00655"></a>00655     <span class="keyword">const</span> <span class="keywordtype">char</span>  *global_sky_spectrum_tag;
-<a name="l00656"></a>00656     <span class="keyword">const</span> <span class="keywordtype">char</span>  *object_table_tag;
-<a name="l00657"></a>00657     <span class="keyword">const</span> <span class="keywordtype">char</span>  *skylines_offsets_tag;
-<a name="l00658"></a>00658     <span class="keyword">const</span> <span class="keywordtype">char</span>  *global_distortion_tag = <span class="stringliteral">"MASTER_DISTORTION_TABLE"</span>;
-<a name="l00659"></a>00659     <span class="keywordtype">char</span>        *coll;
-<a name="l00660"></a>00660     <span class="keywordtype">int</span>         mxu, mos, lss;
-<a name="l00661"></a>00661     <span class="keywordtype">int</span>         nscience;
-<a name="l00662"></a>00662     <span class="keywordtype">double</span>     *exptime = NULL;
-<a name="l00663"></a>00663     <span class="keywordtype">double</span>      alltime;
-<a name="l00664"></a>00664     <span class="keywordtype">double</span>      mean_rms;
-<a name="l00665"></a>00665     <span class="keywordtype">int</span>         nlines;
-<a name="l00666"></a>00666     <span class="keywordtype">int</span>         rebin;
-<a name="l00667"></a>00667     <span class="keywordtype">double</span>     *line;
-<a name="l00668"></a>00668     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00669"></a>00669     <span class="keywordtype">double</span>      reference;
-<a name="l00670"></a>00670     <span class="keywordtype">double</span>      gain;
-<a name="l00671"></a>00671     <span class="keywordtype">double</span>      <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>;
-<a name="l00672"></a>00672     <span class="keywordtype">int</span>         standard;
-<a name="l00673"></a>00673     <span class="keywordtype">int</span>         highres;
-<a name="l00674"></a>00674     <span class="keywordtype">int</span>         narrow = 0;
-<a name="l00675"></a>00675     <span class="keywordtype">int</span>         i;
-<a name="l00676"></a>00676 
-<a name="l00677"></a>00677 
-<a name="l00678"></a>00678     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00679"></a>00679 
-<a name="l00680"></a>00680     cpl_msg_set_indentation(2);
-<a name="l00681"></a>00681 
-<a name="l00682"></a>00682     <span class="comment">/* </span>
-<a name="l00683"></a>00683 <span class="comment">     * Get configuration parameters</span>
-<a name="l00684"></a>00684 <span class="comment">     */</span>
-<a name="l00685"></a>00685 
-<a name="l00686"></a>00686     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00687"></a>00687     cpl_msg_indent_more();
-<a name="l00688"></a>00688 
-<a name="l00689"></a>00689     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00690"></a>00690         fors_extract_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);
-<a name="l00691"></a>00691 
-<a name="l00692"></a>00692     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00693"></a>00693 
-<a name="l00694"></a>00694     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00695"></a>00695                     <span class="stringliteral">"fors.fors_extract.dispersion"</span>, grism_table);
-<a name="l00696"></a>00696 
-<a name="l00697"></a>00697     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00698"></a>00698         fors_extract_exit(<span class="stringliteral">"Invalid resampling step"</span>);
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700     skyalign = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00701"></a>00701                     <span class="stringliteral">"fors.fors_extract.skyalign"</span>, NULL);
-<a name="l00702"></a>00702 
-<a name="l00703"></a>00703     <span class="keywordflow">if</span> (skyalign > 2)
-<a name="l00704"></a>00704         fors_extract_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);
-<a name="l00705"></a>00705 
-<a name="l00706"></a>00706     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00707"></a>00707                     <span class="stringliteral">"fors.fors_extract.wcolumn"</span>, NULL);
-<a name="l00708"></a>00708 
-<a name="l00709"></a>00709     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00710"></a>00710                     <span class="stringliteral">"fors.fors_extract.startwavelength"</span>, grism_table);
-<a name="l00711"></a>00711     <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00712"></a>00712         fors_extract_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00713"></a>00713 
-<a name="l00714"></a>00714     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00715"></a>00715                     <span class="stringliteral">"fors.fors_extract.endwavelength"</span>, grism_table);
-<a name="l00716"></a>00716     <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00717"></a>00717         fors_extract_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00718"></a>00718 
-<a name="l00719"></a>00719     <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00720"></a>00720         fors_extract_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00721"></a>00721 
-<a name="l00722"></a>00722     flux = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_extract.flux"</span>, NULL);
-<a name="l00723"></a>00723 
-<a name="l00724"></a>00724     flatfield = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_extract.flatfield"</span>, 
-<a name="l00725"></a>00725                                        NULL);
-<a name="l00726"></a>00726 
-<a name="l00727"></a>00727     skyglobal = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_extract.skyglobal"</span>, 
-<a name="l00728"></a>00728                                        NULL);
-<a name="l00729"></a>00729     skylocal  = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_extract.skylocal"</span>, 
-<a name="l00730"></a>00730                                        NULL);
-<a name="l00731"></a>00731     skymedian = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_extract.skymedian"</span>, 
-<a name="l00732"></a>00732                                        NULL);
-<a name="l00733"></a>00733 <span class="comment">/* NSS</span>
-<a name="l00734"></a>00734 <span class="comment">    skymedian = dfs_get_parameter_int(parlist, "fors.fors_extract.skymedian", </span>
-<a name="l00735"></a>00735 <span class="comment">                                       NULL);</span>
-<a name="l00736"></a>00736 <span class="comment">*/</span>
-<a name="l00737"></a>00737 
-<a name="l00738"></a>00738     <span class="keywordflow">if</span> (skylocal && skyglobal)
-<a name="l00739"></a>00739         fors_extract_exit(<span class="stringliteral">"Cannot apply both local and global sky subtraction"</span>);
-<a name="l00740"></a>00740 
-<a name="l00741"></a>00741     <span class="keywordflow">if</span> (skylocal && skymedian)
-<a name="l00742"></a>00742         fors_extract_exit(<span class="stringliteral">"Cannot apply sky subtraction both on extracted "</span>
-<a name="l00743"></a>00743                           <span class="stringliteral">"and non-extracted spectra"</span>);
-<a name="l00744"></a>00744 
-<a name="l00745"></a>00745     cosmics = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00746"></a>00746                                      <span class="stringliteral">"fors.fors_extract.cosmics"</span>, NULL);
-<a name="l00747"></a>00747 
-<a name="l00748"></a>00748     <span class="keywordflow">if</span> (cosmics)
-<a name="l00749"></a>00749         <span class="keywordflow">if</span> (!(skyglobal || skylocal))
-<a name="l00750"></a>00750             fors_extract_exit(<span class="stringliteral">"Cosmic rays correction requires "</span>
-<a name="l00751"></a>00751                               <span class="stringliteral">"either skylocal=true or skyglobal=true"</span>);
-<a name="l00752"></a>00752 
-<a name="l00753"></a>00753     slit_margin = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00754"></a>00754                                         <span class="stringliteral">"fors.fors_extract.slit_margin"</span>,
-<a name="l00755"></a>00755                                         NULL);
-<a name="l00756"></a>00756     <span class="keywordflow">if</span> (slit_margin < 0)
-<a name="l00757"></a>00757         fors_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00758"></a>00758 
-<a name="l00759"></a>00759     ext_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00760"></a>00760                                        <span class="stringliteral">"fors.fors_extract.ext_radius"</span>,
-<a name="l00761"></a>00761                                        NULL);
-<a name="l00762"></a>00762     <span class="keywordflow">if</span> (ext_radius < 0)
-<a name="l00763"></a>00763         fors_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00764"></a>00764 
-<a name="l00765"></a>00765     cont_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00766"></a>00766                                         <span class="stringliteral">"fors.fors_extract.cont_radius"</span>,
-<a name="l00767"></a>00767                                        NULL);
-<a name="l00768"></a>00768     <span class="keywordflow">if</span> (cont_radius < 0)
-<a name="l00769"></a>00769         fors_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00770"></a>00770 
-<a name="l00771"></a>00771     ext_mode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_extract.ext_mode"</span>,
-<a name="l00772"></a>00772                                        NULL);
-<a name="l00773"></a>00773     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)
-<a name="l00774"></a>00774         fors_extract_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);
-<a name="l00775"></a>00775 
-<a name="l00776"></a>00776     time_normalise = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00777"></a>00777                              <span class="stringliteral">"fors.fors_extract.time_normalise"</span>, NULL);
-<a name="l00778"></a>00778 
-<a name="l00779"></a>00779     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00780"></a>00780 
-<a name="l00781"></a>00781     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00782"></a>00782         fors_extract_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00783"></a>00783 
-<a name="l00784"></a>00784     
-<a name="l00785"></a>00785     <span class="comment">/* </span>
-<a name="l00786"></a>00786 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00787"></a>00787 <span class="comment">     */</span>
-<a name="l00788"></a>00788 
-<a name="l00789"></a>00789     cpl_msg_indent_less();
-<a name="l00790"></a>00790     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00791"></a>00791     cpl_msg_indent_more();
-<a name="l00792"></a>00792 
-<a name="l00793"></a>00793     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))
-<a name="l00794"></a>00794         fors_extract_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);
-<a name="l00795"></a>00795 
-<a name="l00796"></a>00796     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))
-<a name="l00797"></a>00797         fors_extract_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);
-<a name="l00798"></a>00798 
-<a name="l00799"></a>00799     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))
-<a name="l00800"></a>00800         fors_extract_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);
-<a name="l00801"></a>00801 
-<a name="l00802"></a>00802     mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MXU"</span>);
-<a name="l00803"></a>00803     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MOS"</span>);
-<a name="l00804"></a>00804     lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_LSS"</span>);
-<a name="l00805"></a>00805     standard = 0;
-<a name="l00806"></a>00806 
-<a name="l00807"></a>00807     <span class="keywordflow">if</span> (mxu + mos + lss == 0) {
-<a name="l00808"></a>00808         mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MXU"</span>);
-<a name="l00809"></a>00809         mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MOS"</span>);
-<a name="l00810"></a>00810         lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_LSS"</span>);
-<a name="l00811"></a>00811         standard = 1;
-<a name="l00812"></a>00812     }
-<a name="l00813"></a>00813 
-<a name="l00814"></a>00814     <span class="keywordflow">if</span> (mxu + mos + lss == 0)
-<a name="l00815"></a>00815         fors_extract_exit(<span class="stringliteral">"Missing input scientific frame"</span>);
-<a name="l00816"></a>00816 
-<a name="l00817"></a>00817     nscience = mxu + mos + lss;
-<a name="l00818"></a>00818 
-<a name="l00819"></a>00819     <span class="keywordflow">if</span> (mxu && mxu < nscience)
-<a name="l00820"></a>00820         fors_extract_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); 
-<a name="l00821"></a>00821 
-<a name="l00822"></a>00822     <span class="keywordflow">if</span> (mos && mos < nscience)
-<a name="l00823"></a>00823         fors_extract_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); 
-<a name="l00824"></a>00824 
-<a name="l00825"></a>00825     <span class="keywordflow">if</span> (lss && lss < nscience)
-<a name="l00826"></a>00826         fors_extract_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); 
-<a name="l00827"></a>00827 
-<a name="l00828"></a>00828     <span class="keywordflow">if</span> (mxu) {
-<a name="l00829"></a>00829         <span class="keywordflow">if</span> (standard) {
-<a name="l00830"></a>00830             cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);
-<a name="l00831"></a>00831             science_tag            = <span class="stringliteral">"STANDARD_MXU"</span>;
-<a name="l00832"></a>00832             reduced_science_tag    = <span class="stringliteral">"REDUCED_STD_MXU"</span>;
-<a name="l00833"></a>00833             unmapped_science_tag   = <span class="stringliteral">"UNMAPPED_STD_MXU"</span>;
-<a name="l00834"></a>00834             mapped_science_tag     = <span class="stringliteral">"MAPPED_STD_MXU"</span>;
-<a name="l00835"></a>00835             mapped_science_sky_tag = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;
-<a name="l00836"></a>00836             skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MXU"</span>;
-<a name="l00837"></a>00837             wavelength_map_sky_tag = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;
-<a name="l00838"></a>00838             disp_coeff_sky_tag     = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;
-<a name="l00839"></a>00839             mapped_sky_tag         = <span class="stringliteral">"MAPPED_SKY_STD_MXU"</span>;
-<a name="l00840"></a>00840             unmapped_sky_tag       = <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>;
-<a name="l00841"></a>00841             object_table_tag       = <span class="stringliteral">"OBJECT_TABLE_STD_MXU"</span>;
-<a name="l00842"></a>00842             reduced_sky_tag        = <span class="stringliteral">"REDUCED_SKY_STD_MXU"</span>;
-<a name="l00843"></a>00843             reduced_error_tag      = <span class="stringliteral">"REDUCED_ERROR_STD_MXU"</span>;
-<a name="l00844"></a>00844         }
-<a name="l00845"></a>00845         <span class="keywordflow">else</span> {
-<a name="l00846"></a>00846             cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);
-<a name="l00847"></a>00847             science_tag            = <span class="stringliteral">"SCIENCE_MXU"</span>;
-<a name="l00848"></a>00848             reduced_science_tag    = <span class="stringliteral">"REDUCED_SCI_MXU"</span>;
-<a name="l00849"></a>00849             unmapped_science_tag   = <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>;
-<a name="l00850"></a>00850             mapped_science_tag     = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;
-<a name="l00851"></a>00851             mapped_science_sky_tag = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;
-<a name="l00852"></a>00852             skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MXU"</span>;
-<a name="l00853"></a>00853             wavelength_map_sky_tag = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;
-<a name="l00854"></a>00854             disp_coeff_sky_tag     = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;
-<a name="l00855"></a>00855             mapped_sky_tag         = <span class="stringliteral">"MAPPED_SKY_SCI_MXU"</span>;
-<a name="l00856"></a>00856             unmapped_sky_tag       = <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>;
-<a name="l00857"></a>00857             object_table_tag       = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;
-<a name="l00858"></a>00858             reduced_sky_tag        = <span class="stringliteral">"REDUCED_SKY_SCI_MXU"</span>;
-<a name="l00859"></a>00859             reduced_error_tag      = <span class="stringliteral">"REDUCED_ERROR_SCI_MXU"</span>;
-<a name="l00860"></a>00860         }
-<a name="l00861"></a>00861 
-<a name="l00862"></a>00862         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;
-<a name="l00863"></a>00863         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_MXU"</span>;
-<a name="l00864"></a>00864 
-<a name="l00865"></a>00865         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {
-<a name="l00866"></a>00866             master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_MXU"</span>;
-<a name="l00867"></a>00867         }
-<a name="l00868"></a>00868     }
-<a name="l00869"></a>00869 
-<a name="l00870"></a>00870     <span class="keywordflow">if</span> (lss) {
-<a name="l00871"></a>00871 
-<a name="l00872"></a>00872         <span class="keywordflow">if</span> (cosmics && !skyglobal)
-<a name="l00873"></a>00873             fors_extract_exit(<span class="stringliteral">"Cosmic rays correction for LSS "</span>
-<a name="l00874"></a>00874                               <span class="stringliteral">"data requires --skyglobal=true"</span>);
-<a name="l00875"></a>00875 
-<a name="l00876"></a>00876         cpl_msg_info(recipe, <span class="stringliteral">"LSS data found"</span>);
-<a name="l00877"></a>00877 
-<a name="l00878"></a>00878         <span class="keywordflow">if</span> (standard) {
-<a name="l00879"></a>00879             science_tag             = <span class="stringliteral">"STANDARD_LSS"</span>;
-<a name="l00880"></a>00880             reduced_science_tag     = <span class="stringliteral">"REDUCED_STD_LSS"</span>;
-<a name="l00881"></a>00881             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_STD_LSS"</span>;
-<a name="l00882"></a>00882             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_LSS"</span>;
-<a name="l00883"></a>00883             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>;
-<a name="l00884"></a>00884             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_LSS"</span>;
-<a name="l00885"></a>00885             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_STD_LSS"</span>;
-<a name="l00886"></a>00886             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>;
-<a name="l00887"></a>00887             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_LSS"</span>;
-<a name="l00888"></a>00888             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_STD_LSS"</span>;
-<a name="l00889"></a>00889             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_STD_LSS"</span>;
-<a name="l00890"></a>00890             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_STD_LSS"</span>;
-<a name="l00891"></a>00891             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_STD_LSS"</span>;
-<a name="l00892"></a>00892         }
-<a name="l00893"></a>00893         <span class="keywordflow">else</span> {
-<a name="l00894"></a>00894             science_tag             = <span class="stringliteral">"SCIENCE_LSS"</span>;
-<a name="l00895"></a>00895             reduced_science_tag     = <span class="stringliteral">"REDUCED_SCI_LSS"</span>;
-<a name="l00896"></a>00896             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_SCI_LSS"</span>;
-<a name="l00897"></a>00897             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_LSS"</span>;
-<a name="l00898"></a>00898             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>;
-<a name="l00899"></a>00899             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_LSS"</span>;
-<a name="l00900"></a>00900             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_SCI_LSS"</span>;
-<a name="l00901"></a>00901             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>;
-<a name="l00902"></a>00902             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_LSS"</span>;
-<a name="l00903"></a>00903             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_SCI_LSS"</span>;
-<a name="l00904"></a>00904             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;
-<a name="l00905"></a>00905             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_SCI_LSS"</span>;
-<a name="l00906"></a>00906             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_SCI_LSS"</span>;
-<a name="l00907"></a>00907         }
-<a name="l00908"></a>00908 
-<a name="l00909"></a>00909         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;
-<a name="l00910"></a>00910         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_LSS"</span>;
-<a name="l00911"></a>00911     }
-<a name="l00912"></a>00912 
-<a name="l00913"></a>00913     <span class="keywordflow">if</span> (mos) {
-<a name="l00914"></a>00914         cpl_msg_info(recipe, <span class="stringliteral">"MOS data found"</span>);
-<a name="l00915"></a>00915         <span class="keywordflow">if</span> (standard) {
-<a name="l00916"></a>00916             science_tag             = <span class="stringliteral">"STANDARD_MOS"</span>;
-<a name="l00917"></a>00917             reduced_science_tag     = <span class="stringliteral">"REDUCED_STD_MOS"</span>;
-<a name="l00918"></a>00918             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_STD_MOS"</span>;
-<a name="l00919"></a>00919             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_MOS"</span>;
-<a name="l00920"></a>00920             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;
-<a name="l00921"></a>00921             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MOS"</span>;
-<a name="l00922"></a>00922             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;
-<a name="l00923"></a>00923             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;
-<a name="l00924"></a>00924             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_MOS"</span>;
-<a name="l00925"></a>00925             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>;
-<a name="l00926"></a>00926             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_STD_MOS"</span>;
-<a name="l00927"></a>00927             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_STD_MOS"</span>;
-<a name="l00928"></a>00928             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_STD_MOS"</span>;
-<a name="l00929"></a>00929         }
-<a name="l00930"></a>00930         <span class="keywordflow">else</span> {
-<a name="l00931"></a>00931             science_tag             = <span class="stringliteral">"SCIENCE_MOS"</span>;
-<a name="l00932"></a>00932             reduced_science_tag     = <span class="stringliteral">"REDUCED_SCI_MOS"</span>;
-<a name="l00933"></a>00933             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>;
-<a name="l00934"></a>00934             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;
-<a name="l00935"></a>00935             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;
-<a name="l00936"></a>00936             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MOS"</span>;
-<a name="l00937"></a>00937             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;
-<a name="l00938"></a>00938             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;
-<a name="l00939"></a>00939             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_MOS"</span>;
-<a name="l00940"></a>00940             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>;
-<a name="l00941"></a>00941             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;
-<a name="l00942"></a>00942             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_SCI_MOS"</span>;
-<a name="l00943"></a>00943             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_SCI_MOS"</span>;
-<a name="l00944"></a>00944         }
-<a name="l00945"></a>00945 
-<a name="l00946"></a>00946         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;
-<a name="l00947"></a>00947         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_MOS"</span>;
-<a name="l00948"></a>00948 
-<a name="l00949"></a>00949         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {
-<a name="l00950"></a>00950             master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_MOS"</span>;
-<a name="l00951"></a>00951         }
-<a name="l00952"></a>00952     }
-<a name="l00953"></a>00953 
-<a name="l00954"></a>00954     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0)
-<a name="l00955"></a>00955         fors_extract_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS"</span>);
-<a name="l00956"></a>00956 
-<a name="l00957"></a>00957     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)
-<a name="l00958"></a>00958         fors_extract_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);
-<a name="l00959"></a>00959 
-<a name="l00960"></a>00960     <span class="keywordflow">if</span> (skyalign >= 0)
-<a name="l00961"></a>00961         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)
-<a name="l00962"></a>00962             fors_extract_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);
-<a name="l00963"></a>00963 
-<a name="l00964"></a>00964     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, global_distortion_tag) == 0)
-<a name="l00965"></a>00965         fors_extract_exit(<span class="stringliteral">"Missing required input: MASTER_DISTORTION_TABLE"</span>);
-<a name="l00966"></a>00966 
-<a name="l00967"></a>00967     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, global_distortion_tag) > 1)
-<a name="l00968"></a>00968         fors_extract_exit(<span class="stringliteral">"Too many in input: MASTER_DISTORTION_TABLE"</span>);
-<a name="l00969"></a>00969 
-<a name="l00970"></a>00970     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) > 1) {
-<a name="l00971"></a>00971         <span class="keywordflow">if</span> (flatfield) {
-<a name="l00972"></a>00972             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, 
-<a name="l00973"></a>00973                           master_norm_flat_tag);
-<a name="l00974"></a>00974             fors_extract_exit(NULL);
-<a name="l00975"></a>00975         }
-<a name="l00976"></a>00976         <span class="keywordflow">else</span> {
-<a name="l00977"></a>00977             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input are ignored, "</span>
-<a name="l00978"></a>00978                             <span class="stringliteral">"since flat field correction was not requested"</span>, 
-<a name="l00979"></a>00979                             master_norm_flat_tag);
-<a name="l00980"></a>00980         }
-<a name="l00981"></a>00981     }
-<a name="l00982"></a>00982 
-<a name="l00983"></a>00983     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 1) {
-<a name="l00984"></a>00984         <span class="keywordflow">if</span> (!flatfield) {
-<a name="l00985"></a>00985             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input is ignored, "</span>
-<a name="l00986"></a>00986                             <span class="stringliteral">"since flat field correction was not requested"</span>, 
-<a name="l00987"></a>00987                             master_norm_flat_tag);
-<a name="l00988"></a>00988         }
-<a name="l00989"></a>00989     }
-<a name="l00990"></a>00990 
-<a name="l00991"></a>00991     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 0) {
-<a name="l00992"></a>00992         <span class="keywordflow">if</span> (flatfield) {
-<a name="l00993"></a>00993             cpl_msg_error(recipe, <span class="stringliteral">"Flat field correction was requested, "</span>
-<a name="l00994"></a>00994                           <span class="stringliteral">"but no %s are found in input"</span>,
-<a name="l00995"></a>00995                           master_norm_flat_tag);
-<a name="l00996"></a>00996             fors_extract_exit(NULL);
-<a name="l00997"></a>00997         }
-<a name="l00998"></a>00998     }
-<a name="l00999"></a>00999 
-<a name="l01000"></a>01000     cpl_msg_indent_less();
-<a name="l01001"></a>01001 
-<a name="l01002"></a>01002 
-<a name="l01003"></a>01003     <span class="comment">/*</span>
-<a name="l01004"></a>01004 <span class="comment">     * Loading input data</span>
-<a name="l01005"></a>01005 <span class="comment">     */</span>
-<a name="l01006"></a>01006 
-<a name="l01007"></a>01007     exptime = cpl_calloc(nscience, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01008"></a>01008 
-<a name="l01009"></a>01009     <span class="keywordflow">if</span> (nscience > 1) {
-<a name="l01010"></a>01010 
-<a name="l01011"></a>01011         cpl_msg_info(recipe, <span class="stringliteral">"Load %d scientific frames and median them..."</span>,
-<a name="l01012"></a>01012                      nscience);
-<a name="l01013"></a>01013         cpl_msg_indent_more();
-<a name="l01014"></a>01014 
-<a name="l01015"></a>01015         all_science = cpl_imagelist_new();
-<a name="l01016"></a>01016 
-<a name="l01017"></a>01017         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01018"></a>01018 
-<a name="l01019"></a>01019         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01020"></a>01020             fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01021"></a>01021 
-<a name="l01022"></a>01022         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l01023"></a>01023 
-<a name="l01024"></a>01024         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01025"></a>01025             fors_extract_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l01026"></a>01026                               <span class="stringliteral">"frame header"</span>);
-<a name="l01027"></a>01027 
-<a name="l01028"></a>01028         cpl_propertylist_delete(header); header = NULL;
-<a name="l01029"></a>01029 
-<a name="l01030"></a>01030         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame 1 exposure time: %.2f s"</span>, 
-<a name="l01031"></a>01031                      exptime[0]);
-<a name="l01032"></a>01032 
-<a name="l01033"></a>01033         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {
-<a name="l01034"></a>01034 
-<a name="l01035"></a>01035             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l01036"></a>01036 
-<a name="l01037"></a>01037             <span class="keywordflow">if</span> (header == NULL)
-<a name="l01038"></a>01038                 fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01039"></a>01039     
-<a name="l01040"></a>01040             exptime[i] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l01041"></a>01041 
-<a name="l01042"></a>01042             alltime += exptime[i];
-<a name="l01043"></a>01043     
-<a name="l01044"></a>01044             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01045"></a>01045                 fors_extract_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l01046"></a>01046                                   <span class="stringliteral">"frame header"</span>);
-<a name="l01047"></a>01047     
-<a name="l01048"></a>01048             cpl_propertylist_delete(header); header = NULL;
-<a name="l01049"></a>01049 
-<a name="l01050"></a>01050             cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame %d exposure time: %.2f s"</span>, 
-<a name="l01051"></a>01051                          i+1, exptime[i]);
-<a name="l01052"></a>01052         }
-<a name="l01053"></a>01053 
-<a name="l01054"></a>01054         spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01055"></a>01055 
-<a name="l01056"></a>01056         <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01057"></a>01057             fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l01058"></a>01058 
-<a name="l01059"></a>01059         cpl_image_divide_scalar(spectra, exptime[0]);
-<a name="l01060"></a>01060         cpl_imagelist_set(all_science, spectra, 0); spectra = NULL;
-<a name="l01061"></a>01061 
-<a name="l01062"></a>01062         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {
-<a name="l01063"></a>01063 
-<a name="l01064"></a>01064             spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01065"></a>01065 
-<a name="l01066"></a>01066             <span class="keywordflow">if</span> (spectra) {
-<a name="l01067"></a>01067                 cpl_image_divide_scalar(spectra, exptime[i]);
-<a name="l01068"></a>01068                 cpl_imagelist_set(all_science, spectra, i); spectra = NULL;
-<a name="l01069"></a>01069             }
-<a name="l01070"></a>01070             <span class="keywordflow">else</span>
-<a name="l01071"></a>01071                 fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l01072"></a>01072 
-<a name="l01073"></a>01073         }
-<a name="l01074"></a>01074 
-<a name="l01075"></a>01075         spectra = cpl_imagelist_collapse_median_create(all_science);
-<a name="l01076"></a>01076         cpl_image_multiply_scalar(spectra, alltime);
-<a name="l01077"></a>01077 
-<a name="l01078"></a>01078         cpl_imagelist_delete(all_science);
-<a name="l01079"></a>01079     }
-<a name="l01080"></a>01080     <span class="keywordflow">else</span> {
-<a name="l01081"></a>01081         cpl_msg_info(recipe, <span class="stringliteral">"Load scientific exposure..."</span>);
-<a name="l01082"></a>01082         cpl_msg_indent_more();
-<a name="l01083"></a>01083 
-<a name="l01084"></a>01084         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01085"></a>01085 
-<a name="l01086"></a>01086         <span class="keywordflow">if</span> (header == NULL)
-<a name="l01087"></a>01087             fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01088"></a>01088 
-<a name="l01089"></a>01089 
-<a name="l01090"></a>01090         <span class="comment">/*</span>
-<a name="l01091"></a>01091 <span class="comment">         * Insert here a check on supported filters:</span>
-<a name="l01092"></a>01092 <span class="comment">         */</span>
-<a name="l01093"></a>01093 
-<a name="l01094"></a>01094         wheel4 = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header,
-<a name="l01095"></a>01095                                                      <span class="stringliteral">"ESO INS OPTI9 TYPE"</span>);
-<a name="l01096"></a>01096         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l01097"></a>01097             fors_extract_exit(<span class="stringliteral">"Missing ESO INS OPTI9 TYPE in flat header"</span>);
-<a name="l01098"></a>01098         }
-<a name="l01099"></a>01099 
-<a name="l01100"></a>01100         <span class="keywordflow">if</span> (strcmp(<span class="stringliteral">"FILT"</span>, wheel4) == 0) {
-<a name="l01101"></a>01101             wheel4 = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header,
-<a name="l01102"></a>01102                                                          <span class="stringliteral">"ESO INS OPTI9 NAME"</span>);
-<a name="l01103"></a>01103             cpl_msg_error(recipe, <span class="stringliteral">"Unsupported filter: %s"</span>, wheel4);
-<a name="l01104"></a>01104             fors_extract_exit(NULL);
-<a name="l01105"></a>01105         }
-<a name="l01106"></a>01106 
-<a name="l01107"></a>01107 
-<a name="l01108"></a>01108         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l01109"></a>01109 
-<a name="l01110"></a>01110         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01111"></a>01111             fors_extract_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l01112"></a>01112                               <span class="stringliteral">"frame header"</span>);
-<a name="l01113"></a>01113 
-<a name="l01114"></a>01114         cpl_propertylist_delete(header); header = NULL;
-<a name="l01115"></a>01115 
-<a name="l01116"></a>01116         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame exposure time: %.2f s"</span>, 
-<a name="l01117"></a>01117                      exptime[0]);
-<a name="l01118"></a>01118 
-<a name="l01119"></a>01119         spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l01120"></a>01120     }
-<a name="l01121"></a>01121 
-<a name="l01122"></a>01122     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01123"></a>01123         fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l01124"></a>01124 
-<a name="l01125"></a>01125     cpl_free(exptime); exptime = NULL;
-<a name="l01126"></a>01126 
-<a name="l01127"></a>01127     cpl_msg_indent_less();
-<a name="l01128"></a>01128 
-<a name="l01129"></a>01129 
-<a name="l01130"></a>01130     <span class="comment">/*</span>
-<a name="l01131"></a>01131 <span class="comment">     * Get the reference wavelength and the rebin factor along the</span>
-<a name="l01132"></a>01132 <span class="comment">     * dispersion direction from a scientific exposure</span>
-<a name="l01133"></a>01133 <span class="comment">     */</span>
-<a name="l01134"></a>01134 
-<a name="l01135"></a>01135     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01136"></a>01136 
-<a name="l01137"></a>01137     <span class="keywordflow">if</span> (header == NULL)
-<a name="l01138"></a>01138         fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l01139"></a>01139 
-<a name="l01140"></a>01140     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l01141"></a>01141     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l01142"></a>01142         fors_extract_exit(<span class="stringliteral">"Missing keyword INSTRUME in sientific header"</span>);
-<a name="l01143"></a>01143     instrume = cpl_strdup(instrume);
-<a name="l01144"></a>01144 
-<a name="l01145"></a>01145     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)
-<a name="l01146"></a>01146         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);
-<a name="l01147"></a>01147     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)
-<a name="l01148"></a>01148         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);
-<a name="l01149"></a>01149 
-<a name="l01150"></a>01150     cpl_free(instrume); instrume = NULL;
-<a name="l01151"></a>01151 
-<a name="l01152"></a>01152     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);
-<a name="l01153"></a>01153 
-<a name="l01154"></a>01154     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01155"></a>01155         fors_extract_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in scientific "</span>
-<a name="l01156"></a>01156                         <span class="stringliteral">"frame header"</span>);
-<a name="l01157"></a>01157 
-<a name="l01158"></a>01158     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span>
-<a name="l01159"></a>01159         reference *= 10;
-<a name="l01160"></a>01160 
-<a name="l01161"></a>01161     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {
-<a name="l01162"></a>01162         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span>
-<a name="l01163"></a>01163                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in scientific frame header"</span>,
-<a name="l01164"></a>01164                       reference);
-<a name="l01165"></a>01165         fors_extract_exit(NULL);
-<a name="l01166"></a>01166     }
-<a name="l01167"></a>01167 
-<a name="l01168"></a>01168     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);
-<a name="l01169"></a>01169 
-<a name="l01170"></a>01170     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);
-<a name="l01171"></a>01171 
-<a name="l01172"></a>01172     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01173"></a>01173         fors_extract_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in scientific "</span>
-<a name="l01174"></a>01174                         <span class="stringliteral">"frame header"</span>);
-<a name="l01175"></a>01175 
-<a name="l01176"></a>01176     <span class="keywordflow">if</span> (rebin != 1) {
-<a name="l01177"></a>01177         dispersion *= rebin;
-<a name="l01178"></a>01178         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span>
-<a name="l01179"></a>01179                         <span class="stringliteral">"resampling step used is %f A/pixel"</span>, rebin, 
-<a name="l01180"></a>01180                         dispersion);
-<a name="l01181"></a>01181     }
-<a name="l01182"></a>01182 
-<a name="l01183"></a>01183     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l01184"></a>01184 
-<a name="l01185"></a>01185     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01186"></a>01186         fors_extract_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in scientific "</span>
-<a name="l01187"></a>01187                           <span class="stringliteral">"frame header"</span>);
-<a name="l01188"></a>01188 
-<a name="l01189"></a>01189     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l01190"></a>01190 
-<a name="l01191"></a>01191     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);
-<a name="l01192"></a>01192 
-<a name="l01193"></a>01193     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01194"></a>01194         fors_extract_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in scientific "</span>
-<a name="l01195"></a>01195                           <span class="stringliteral">"frame header"</span>);
-<a name="l01196"></a>01196 
-<a name="l01197"></a>01197     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span>
-<a name="l01198"></a>01198 
-<a name="l01199"></a>01199     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);
-<a name="l01200"></a>01200 
-<a name="l01201"></a>01201     coll = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"ESO INS COLL NAME"</span>);
-<a name="l01202"></a>01202 
-<a name="l01203"></a>01203     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l01204"></a>01204         fors_extract_exit(<span class="stringliteral">"Missing keyword ESO INS COLL NAME in scientific "</span>
-<a name="l01205"></a>01205                           <span class="stringliteral">"frame header"</span>);
-<a name="l01206"></a>01206 
-<a name="l01207"></a>01207     cpl_msg_info(recipe, <span class="stringliteral">"The collimator is : %s"</span>, coll);
-<a name="l01208"></a>01208 
-<a name="l01209"></a>01209     <span class="keywordflow">if</span> (strcmp(coll, <span class="stringliteral">"COLL_HR"</span>) == 0)
-<a name="l01210"></a>01210         fors_extract_exit(<span class="stringliteral">"HR collimator is not yet supported by this recipe"</span>);
-<a name="l01211"></a>01211     
-<a name="l01212"></a>01212 
-<a name="l01213"></a>01213     <span class="keywordflow">if</span> (mos)
-<a name="l01214"></a>01214     {   
-<a name="l01215"></a>01215         <span class="keywordtype">int</span> nslits_out_det;
-<a name="l01216"></a>01216         maskslits = <a class="code" href="group__moses.html#g1786e7d23b46b135a98deb03986916a4">mos_load_slits_fors_mos</a>(header, &nslits_out_det);
-<a name="l01217"></a>01217     }
-<a name="l01218"></a>01218     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lss)
-<a name="l01219"></a>01219         maskslits = <a class="code" href="group__moses.html#g9ed25f68a53a8daa15d3c986e7bdfa48">mos_load_slits_fors_lss</a>(header);
-<a name="l01220"></a>01220     <span class="keywordflow">else</span>
-<a name="l01221"></a>01221         maskslits = <a class="code" href="group__moses.html#gc6b743c5c9a5e989abe61ab698df148f">mos_load_slits_fors_mxu</a>(header);
-<a name="l01222"></a>01222 
-<a name="l01223"></a>01223     <span class="keywordflow">if</span> (lss) {
-<a name="l01224"></a>01224         <span class="keywordflow">if</span> (skylocal) {
-<a name="l01225"></a>01225             <span class="keywordflow">if</span> (cosmics)
-<a name="l01226"></a>01226                 fors_extract_exit(<span class="stringliteral">"Cosmic rays correction for LSS "</span>
-<a name="l01227"></a>01227                                   <span class="stringliteral">"data requires --skyglobal=true"</span>);
-<a name="l01228"></a>01228             skymedian = skylocal;
-<a name="l01229"></a>01229             skylocal = 0;
-<a name="l01230"></a>01230         }
-<a name="l01231"></a>01231     }
-<a name="l01232"></a>01232 
-<a name="l01233"></a>01233     global = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, global_distortion_tag, 1);
-<a name="l01234"></a>01234     <span class="keywordflow">if</span> (global == NULL)
-<a name="l01235"></a>01235         fors_extract_exit(<span class="stringliteral">"Cannot load global distortion table"</span>);
-<a name="l01236"></a>01236 
-<a name="l01237"></a>01237     <span class="comment">/* Leave the header on for the next step... */</span>
-<a name="l01238"></a>01238 
-<a name="l01239"></a>01239 
-<a name="l01240"></a>01240     <span class="comment">/*</span>
-<a name="l01241"></a>01241 <span class="comment">     * Remove the master bias</span>
-<a name="l01242"></a>01242 <span class="comment">     */</span>
-<a name="l01243"></a>01243 
-<a name="l01244"></a>01244     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l01245"></a>01245 
-<a name="l01246"></a>01246     bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, CPL_TYPE_FLOAT, 0, 1);
-<a name="l01247"></a>01247 
-<a name="l01248"></a>01248     <span class="keywordflow">if</span> (bias == NULL)
-<a name="l01249"></a>01249         fors_extract_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l01250"></a>01250 
-<a name="l01251"></a>01251     overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 1);
-<a name="l01252"></a>01252     cpl_propertylist_delete(header); header = NULL;
-<a name="l01253"></a>01253     dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(spectra, bias, overscans);
-<a name="l01254"></a>01254     cpl_image_delete(spectra); spectra = dummy; dummy = NULL;
-<a name="l01255"></a>01255     cpl_image_delete(bias); bias = NULL;
-<a name="l01256"></a>01256     cpl_table_delete(overscans); overscans = NULL;
-<a name="l01257"></a>01257 
-<a name="l01258"></a>01258     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l01259"></a>01259         fors_extract_exit(<span class="stringliteral">"Cannot remove bias from scientific frame"</span>);
-<a name="l01260"></a>01260 
-<a name="l01261"></a>01261     nx = cpl_image_get_size_x(spectra);
-<a name="l01262"></a>01262     ny = cpl_image_get_size_y(spectra);
-<a name="l01263"></a>01263 
-<a name="l01264"></a>01264     <span class="keywordflow">if</span> (ny == 400 && nx == 2048)
-<a name="l01265"></a>01265         narrow = 1;
-<a name="l01266"></a>01266 
-<a name="l01267"></a>01267     <span class="keywordflow">if</span> (narrow) {
-<a name="l01268"></a>01268         ny = 2048;
-<a name="l01269"></a>01269         dummy = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01270"></a>01270         cpl_image_copy(dummy, spectra, 1, 825);     <span class="comment">/* (2048 - 400)/2 + 1 */</span>
-<a name="l01271"></a>01271         <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l01272"></a>01272             fors_extract_exit(<span class="stringliteral">"Problems expanding scientific image"</span>);
-<a name="l01273"></a>01273         cpl_image_delete(spectra); spectra = dummy; dummy = NULL;
-<a name="l01274"></a>01274     }
-<a name="l01275"></a>01275 
-<a name="l01276"></a>01276     cpl_msg_indent_less();
-<a name="l01277"></a>01277     cpl_msg_info(recipe, <span class="stringliteral">"Load normalised flat field (if present)..."</span>);
-<a name="l01278"></a>01278     cpl_msg_indent_more();
-<a name="l01279"></a>01279 
-<a name="l01280"></a>01280     <span class="keywordflow">if</span> (flatfield) {
-<a name="l01281"></a>01281 
-<a name="l01282"></a>01282         norm_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, master_norm_flat_tag, 
-<a name="l01283"></a>01283                                    CPL_TYPE_FLOAT, 0, 1);
-<a name="l01284"></a>01284 
-<a name="l01285"></a>01285         <span class="keywordflow">if</span> (norm_flat) {
-<a name="l01286"></a>01286             <span class="keywordflow">if</span> (narrow) {
-<a name="l01287"></a>01287                 dummy = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01288"></a>01288                 cpl_image_copy(dummy, norm_flat, 1, 825);
-<a name="l01289"></a>01289                 <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l01290"></a>01290                     fors_extract_exit(<span class="stringliteral">"Problems expanding flat image"</span>);
-<a name="l01291"></a>01291                 cpl_image_delete(norm_flat); norm_flat = dummy; dummy = NULL;
-<a name="l01292"></a>01292             }
-<a name="l01293"></a>01293             cpl_msg_info(recipe, <span class="stringliteral">"Apply flat field correction..."</span>);
-<a name="l01294"></a>01294             <span class="keywordflow">if</span> (cpl_image_divide(spectra, norm_flat) != CPL_ERROR_NONE) {
-<a name="l01295"></a>01295                 cpl_msg_error(recipe, <span class="stringliteral">"Failure of flat field correction: %s"</span>,
-<a name="l01296"></a>01296                               cpl_error_get_message());
-<a name="l01297"></a>01297                 fors_extract_exit(NULL);
-<a name="l01298"></a>01298             }
-<a name="l01299"></a>01299             cpl_image_delete(norm_flat); norm_flat = NULL;
-<a name="l01300"></a>01300         }
-<a name="l01301"></a>01301         <span class="keywordflow">else</span> {
-<a name="l01302"></a>01302             cpl_msg_error(recipe, <span class="stringliteral">"Cannot load input %s for flat field "</span>
-<a name="l01303"></a>01303                           <span class="stringliteral">"correction"</span>, master_norm_flat_tag);
-<a name="l01304"></a>01304             fors_extract_exit(NULL);
-<a name="l01305"></a>01305         }
-<a name="l01306"></a>01306 
-<a name="l01307"></a>01307     }
-<a name="l01308"></a>01308 
-<a name="l01309"></a>01309 
-<a name="l01310"></a>01310     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01311"></a>01311         cpl_msg_indent_less();
-<a name="l01312"></a>01312         cpl_msg_info(recipe, <span class="stringliteral">"Load input sky line catalog..."</span>);
-<a name="l01313"></a>01313         cpl_msg_indent_more();
-<a name="l01314"></a>01314 
-<a name="l01315"></a>01315         wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);
-<a name="l01316"></a>01316 
-<a name="l01317"></a>01317         <span class="keywordflow">if</span> (wavelengths) {
-<a name="l01318"></a>01318 
-<a name="l01319"></a>01319             <span class="comment">/*</span>
-<a name="l01320"></a>01320 <span class="comment">             * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l01321"></a>01321 <span class="comment">             */</span>
-<a name="l01322"></a>01322 
-<a name="l01323"></a>01323             nlines = cpl_table_get_nrow(wavelengths);
-<a name="l01324"></a>01324 
-<a name="l01325"></a>01325             <span class="keywordflow">if</span> (nlines == 0)
-<a name="l01326"></a>01326                 fors_extract_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);
-<a name="l01327"></a>01327 
-<a name="l01328"></a>01328             <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l01329"></a>01329                 cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span>
-<a name="l01330"></a>01330                               <span class="stringliteral">"catalog table"</span>, wcolumn);
-<a name="l01331"></a>01331                 fors_extract_exit(NULL);
-<a name="l01332"></a>01332             }
-<a name="l01333"></a>01333 
-<a name="l01334"></a>01334             line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01335"></a>01335     
-<a name="l01336"></a>01336             <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l01337"></a>01337                 line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l01338"></a>01338 
-<a name="l01339"></a>01339             cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l01340"></a>01340 
-<a name="l01341"></a>01341             lines = cpl_vector_wrap(nlines, line);
-<a name="l01342"></a>01342         }
-<a name="l01343"></a>01343         <span class="keywordflow">else</span> {
-<a name="l01344"></a>01344             cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);
-<a name="l01345"></a>01345         }
-<a name="l01346"></a>01346     }
-<a name="l01347"></a>01347 
-<a name="l01348"></a>01348 
-<a name="l01349"></a>01349     <span class="comment">/*</span>
-<a name="l01350"></a>01350 <span class="comment">     * Load the slit location table, or provide a dummy one in case</span>
-<a name="l01351"></a>01351 <span class="comment">     * of LSS data (single slit spanning whole image)</span>
-<a name="l01352"></a>01352 <span class="comment">     */</span>
-<a name="l01353"></a>01353 
-<a name="l01354"></a>01354     slits = <a class="code" href="group__moses.html#g39dd696d6572e52031e12b1a53e505c2">mos_build_slit_location</a>(global, maskslits, ny);
-<a name="l01355"></a>01355     <span class="keywordflow">if</span> (slits == NULL)
-<a name="l01356"></a>01356         fors_extract_exit(<span class="stringliteral">"Cannot create slits location table"</span>);
-<a name="l01357"></a>01357 
-<a name="l01358"></a>01358 
-<a name="l01359"></a>01359     <span class="comment">/*</span>
-<a name="l01360"></a>01360 <span class="comment">     * Load the spectral curvature table in case of MOS or MXU data</span>
-<a name="l01361"></a>01361 <span class="comment">     */</span>
-<a name="l01362"></a>01362 
-<a name="l01363"></a>01363     polytraces = <a class="code" href="group__moses.html#ga010593249434f0bb667af2f2c950951">mos_build_curv_coeff</a>(global, maskslits, slits);
-<a name="l01364"></a>01364     <span class="keywordflow">if</span> (polytraces == NULL)
-<a name="l01365"></a>01365         fors_extract_exit(<span class="stringliteral">"Cannot create spectral curvature table"</span>);
-<a name="l01366"></a>01366 
-<a name="l01367"></a>01367     cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l01368"></a>01368 
-<a name="l01369"></a>01369     cpl_msg_indent_less();
-<a name="l01370"></a>01370     cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific spectra..."</span>);
-<a name="l01371"></a>01371     cpl_msg_indent_more();
-<a name="l01372"></a>01372 
-<a name="l01373"></a>01373     <span class="comment">/*</span>
-<a name="l01374"></a>01374 <span class="comment">     * This one will also generate the spatial map from the spectral </span>
-<a name="l01375"></a>01375 <span class="comment">     * curvature table (in the case of multislit data)</span>
-<a name="l01376"></a>01376 <span class="comment">     */</span>
-<a name="l01377"></a>01377 
-<a name="l01378"></a>01378     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01379"></a>01379 
-<a name="l01380"></a>01380     smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, reference,
-<a name="l01381"></a>01381                                       startwavelength, endwavelength,
-<a name="l01382"></a>01382                                       dispersion, flux, coordinate);
-<a name="l01383"></a>01383 
-<a name="l01384"></a>01384 
-<a name="l01385"></a>01385     <span class="comment">/*</span>
-<a name="l01386"></a>01386 <span class="comment">     * Load the wavelength calibration table</span>
-<a name="l01387"></a>01387 <span class="comment">     */</span>
-<a name="l01388"></a>01388 
-<a name="l01389"></a>01389     idscoeff = <a class="code" href="group__moses.html#gc4a3f1981baef15668137f04c04cf710">mos_build_disp_coeff</a>(global, slits);
-<a name="l01390"></a>01390     <span class="keywordflow">if</span> (idscoeff == NULL)
-<a name="l01391"></a>01391         fors_extract_exit(<span class="stringliteral">"Cannot create wavelength calibration table"</span>);
-<a name="l01392"></a>01392 
-<a name="l01393"></a>01393     cpl_table_delete(global); global = NULL;
-<a name="l01394"></a>01394 
-<a name="l01395"></a>01395 
-<a name="l01396"></a>01396     <span class="comment">/*</span>
-<a name="l01397"></a>01397 <span class="comment">     * Generate a rectified wavelength map from the wavelength calibration </span>
-<a name="l01398"></a>01398 <span class="comment">     * table</span>
-<a name="l01399"></a>01399 <span class="comment">     */</span>
-<a name="l01400"></a>01400 
-<a name="l01401"></a>01401     rainbow = <a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength, 
-<a name="l01402"></a>01402                                endwavelength);
-<a name="l01403"></a>01403 
-<a name="l01404"></a>01404     <span class="keywordflow">if</span> (dispersion > 1.0)
-<a name="l01405"></a>01405         highres = 0;
-<a name="l01406"></a>01406     <span class="keywordflow">else</span>
-<a name="l01407"></a>01407         highres = 1;
-<a name="l01408"></a>01408 
-<a name="l01409"></a>01409     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01410"></a>01410         <span class="keywordflow">if</span> (skyalign) {
-<a name="l01411"></a>01411             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l01412"></a>01412             <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);
-<a name="l01413"></a>01413         }
-<a name="l01414"></a>01414         <span class="keywordflow">else</span> {
-<a name="l01415"></a>01415             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l01416"></a>01416             <span class="stringliteral">"skylines applying median offset..."</span>);
-<a name="l01417"></a>01417         }
-<a name="l01418"></a>01418 
-<a name="l01419"></a>01419         <span class="keywordflow">if</span> (lss) {
-<a name="l01420"></a>01420             offsets = <a class="code" href="group__moses.html#g2523d130beaf8538187729f767c38805">mos_wavelength_align_lss</a>(smapped, reference, 
-<a name="l01421"></a>01421                                                startwavelength, endwavelength, 
-<a name="l01422"></a>01422                                                idscoeff, lines, highres, 
-<a name="l01423"></a>01423                                                skyalign, rainbow, 4);
-<a name="l01424"></a>01424         }
-<a name="l01425"></a>01425         <span class="keywordflow">else</span> {
-<a name="l01426"></a>01426             offsets = <a class="code" href="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3">mos_wavelength_align</a>(smapped, slits, reference, 
-<a name="l01427"></a>01427                                            startwavelength, endwavelength, 
-<a name="l01428"></a>01428                                            idscoeff, lines, highres, skyalign, 
-<a name="l01429"></a>01429                                            rainbow, 4);
-<a name="l01430"></a>01430         }
-<a name="l01431"></a>01431 
-<a name="l01432"></a>01432         cpl_vector_delete(lines); lines = NULL;
-<a name="l01433"></a>01433 
-<a name="l01434"></a>01434         <span class="keywordflow">if</span> (offsets) {
-<a name="l01435"></a>01435             <span class="keywordflow">if</span> (standard)
-<a name="l01436"></a>01436                 cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span>
-<a name="l01437"></a>01437                                 <span class="stringliteral">"to reference sky lines may be unreliable in "</span>
-<a name="l01438"></a>01438                                 <span class="stringliteral">"this case!"</span>);
-<a name="l01439"></a>01439 
-<a name="l01440"></a>01440             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, offsets, skylines_offsets_tag, NULL, 
-<a name="l01441"></a>01441                                parlist, recipe, version))
-<a name="l01442"></a>01442                 fors_extract_exit(NULL);
-<a name="l01443"></a>01443 
-<a name="l01444"></a>01444             cpl_table_delete(offsets); offsets = NULL;
-<a name="l01445"></a>01445         }
-<a name="l01446"></a>01446         <span class="keywordflow">else</span> {
-<a name="l01447"></a>01447             cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span>
-<a name="l01448"></a>01448                             <span class="stringliteral">"to reference sky lines could not be done!"</span>);
-<a name="l01449"></a>01449             skyalign = -1;
-<a name="l01450"></a>01450         }
-<a name="l01451"></a>01451 
-<a name="l01452"></a>01452     }
-<a name="l01453"></a>01453 
-<a name="l01454"></a>01454     wavemap = <a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(coordinate, rainbow, slits, 
-<a name="l01455"></a>01455                                   polytraces, reference, 
-<a name="l01456"></a>01456                                   startwavelength, endwavelength,
-<a name="l01457"></a>01457                                   dispersion);
-<a name="l01458"></a>01458 
-<a name="l01459"></a>01459     cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l01460"></a>01460     cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l01461"></a>01461 
-<a name="l01462"></a>01462     <span class="comment">/*</span>
-<a name="l01463"></a>01463 <span class="comment">     * Here the wavelength calibrated slit spectra are created. This frame</span>
-<a name="l01464"></a>01464 <span class="comment">     * contains sky_science.</span>
-<a name="l01465"></a>01465 <span class="comment">     */</span>
-<a name="l01466"></a>01466 
-<a name="l01467"></a>01467     mapped_sky = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, reference,
-<a name="l01468"></a>01468                                             startwavelength, endwavelength,
-<a name="l01469"></a>01469                                             dispersion, idscoeff, flux);
-<a name="l01470"></a>01470 
-<a name="l01471"></a>01471     cpl_msg_indent_less();
-<a name="l01472"></a>01472     cpl_msg_info(recipe, <span class="stringliteral">"Check applied wavelength against skylines..."</span>);
-<a name="l01473"></a>01473     cpl_msg_indent_more();
-<a name="l01474"></a>01474 
-<a name="l01475"></a>01475     mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(mapped_sky, NULL, startwavelength,
-<a name="l01476"></a>01476                                    dispersion, 6, highres);
-<a name="l01477"></a>01477 
-<a name="l01478"></a>01478     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f"</span>, mean_rms);
-<a name="l01479"></a>01479 
-<a name="l01480"></a>01480     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l01481"></a>01481 
-<a name="l01482"></a>01482     header = cpl_propertylist_new();
-<a name="l01483"></a>01483     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01484"></a>01484     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01485"></a>01485     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01486"></a>01486                                    startwavelength + dispersion/2);
-<a name="l01487"></a>01487     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01488"></a>01488     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01489"></a>01489 <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01490"></a>01490     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01491"></a>01491     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01492"></a>01492     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01493"></a>01493     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01494"></a>01494     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01495"></a>01495     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01496"></a>01496 
-<a name="l01497"></a>01497     <span class="keywordflow">if</span> (time_normalise) {
-<a name="l01498"></a>01498         dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);
-<a name="l01499"></a>01499         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, dummy, mapped_science_sky_tag, header, 
-<a name="l01500"></a>01500                            parlist, recipe, version))
-<a name="l01501"></a>01501             fors_extract_exit(NULL);
-<a name="l01502"></a>01502         cpl_image_delete(dummy); dummy = NULL;
-<a name="l01503"></a>01503     }
-<a name="l01504"></a>01504     <span class="keywordflow">else</span> {
-<a name="l01505"></a>01505         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped_sky, mapped_science_sky_tag, 
-<a name="l01506"></a>01506                            header, parlist, recipe, version))
-<a name="l01507"></a>01507             fors_extract_exit(NULL);
-<a name="l01508"></a>01508     }
-<a name="l01509"></a>01509 
-<a name="l01510"></a>01510 <span class="comment">/*    if (skyglobal == 0 && skymedian < 0) {    NSS */</span>
-<a name="l01511"></a>01511     <span class="keywordflow">if</span> (skyglobal == 0 && skymedian == 0 && skylocal == 0) {
-<a name="l01512"></a>01512         cpl_image_delete(mapped_sky); mapped_sky = NULL;
-<a name="l01513"></a>01513     }
-<a name="l01514"></a>01514 
-<a name="l01515"></a>01515     <span class="keywordflow">if</span> (skyglobal || skylocal) {
-<a name="l01516"></a>01516 
-<a name="l01517"></a>01517         cpl_msg_indent_less();
-<a name="l01518"></a>01518 
-<a name="l01519"></a>01519         <span class="keywordflow">if</span> (skyglobal) {
-<a name="l01520"></a>01520             cpl_msg_info(recipe, <span class="stringliteral">"Global sky determination..."</span>);
-<a name="l01521"></a>01521             cpl_msg_indent_more();
-<a name="l01522"></a>01522             skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01523"></a>01523             sky = <a class="code" href="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1">mos_sky_map_super</a>(spectra, wavemap, dispersion, 
-<a name="l01524"></a>01524                                     2.0, 50, skymap);
-<a name="l01525"></a>01525             <span class="keywordflow">if</span> (sky)
-<a name="l01526"></a>01526                 cpl_image_subtract(spectra, skymap);
-<a name="l01527"></a>01527             <span class="keywordflow">else</span>
-<a name="l01528"></a>01528                 cpl_image_delete(skymap); skymap = NULL;
-<a name="l01529"></a>01529         }
-<a name="l01530"></a>01530         <span class="keywordflow">else</span> {
-<a name="l01531"></a>01531             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l01532"></a>01532             cpl_msg_indent_more();
-<a name="l01533"></a>01533             skymap = <a class="code" href="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f">mos_subtract_sky</a>(spectra, slits, polytraces, reference,
-<a name="l01534"></a>01534                            startwavelength, endwavelength, dispersion);
-<a name="l01535"></a>01535         }
-<a name="l01536"></a>01536 
-<a name="l01537"></a>01537         <span class="keywordflow">if</span> (skymap) {
-<a name="l01538"></a>01538             <span class="keywordflow">if</span> (skyglobal) {
-<a name="l01539"></a>01539                 <span class="keywordflow">if</span> (time_normalise)
-<a name="l01540"></a>01540                     cpl_table_divide_scalar(sky, <span class="stringliteral">"sky"</span>, alltime);
-<a name="l01541"></a>01541                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, sky, global_sky_spectrum_tag, 
-<a name="l01542"></a>01542                                    NULL, parlist, recipe, version))
-<a name="l01543"></a>01543                     fors_extract_exit(NULL);
-<a name="l01544"></a>01544     
-<a name="l01545"></a>01545                 cpl_table_delete(sky); sky = NULL;
-<a name="l01546"></a>01546             }
-<a name="l01547"></a>01547 
-<a name="l01548"></a>01548             save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01549"></a>01549 
-<a name="l01550"></a>01550             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01551"></a>01551                 cpl_image_divide_scalar(skymap, alltime);
-<a name="l01552"></a>01552             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, skymap, unmapped_sky_tag,
-<a name="l01553"></a>01553                                save_header, parlist, recipe, version))
-<a name="l01554"></a>01554                 fors_extract_exit(NULL);
-<a name="l01555"></a>01555 
-<a name="l01556"></a>01556             cpl_image_delete(skymap); skymap = NULL;
-<a name="l01557"></a>01557 
-<a name="l01558"></a>01558             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, spectra, unmapped_science_tag,
-<a name="l01559"></a>01559                                save_header, parlist, recipe, version))
-<a name="l01560"></a>01560                 fors_extract_exit(NULL);
-<a name="l01561"></a>01561 
-<a name="l01562"></a>01562             cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01563"></a>01563 
-<a name="l01564"></a>01564             <span class="keywordflow">if</span> (cosmics) {
-<a name="l01565"></a>01565                 cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);
-<a name="l01566"></a>01566                 <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(spectra, gain, -1., -1.);
-<a name="l01567"></a>01567             }
-<a name="l01568"></a>01568 
-<a name="l01569"></a>01569             <span class="comment">/*</span>
-<a name="l01570"></a>01570 <span class="comment">             * The spatially rectified image, that contained the sky,</span>
-<a name="l01571"></a>01571 <span class="comment">             * is replaced by a sky-subtracted spatially rectified image:</span>
-<a name="l01572"></a>01572 <span class="comment">             */</span>
-<a name="l01573"></a>01573 
-<a name="l01574"></a>01574             cpl_image_delete(smapped); smapped = NULL;
-<a name="l01575"></a>01575 
-<a name="l01576"></a>01576             <span class="keywordflow">if</span> (lss) {
-<a name="l01577"></a>01577                 smapped = cpl_image_duplicate(spectra);
-<a name="l01578"></a>01578             }
-<a name="l01579"></a>01579             <span class="keywordflow">else</span> {
-<a name="l01580"></a>01580                 smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, 
-<a name="l01581"></a>01581                                                   reference, startwavelength, 
-<a name="l01582"></a>01582                                                   endwavelength, dispersion, 
-<a name="l01583"></a>01583                                                   flux, NULL);
-<a name="l01584"></a>01584             }
-<a name="l01585"></a>01585         }
-<a name="l01586"></a>01586         <span class="keywordflow">else</span> {
-<a name="l01587"></a>01587             cpl_msg_warning(recipe, <span class="stringliteral">"Sky subtraction failure"</span>);
-<a name="l01588"></a>01588             <span class="keywordflow">if</span> (cosmics)
-<a name="l01589"></a>01589                 cpl_msg_warning(recipe, <span class="stringliteral">"Cosmic rays removal not performed!"</span>);
-<a name="l01590"></a>01590             cosmics = skylocal = skyglobal = 0;
-<a name="l01591"></a>01591         }
-<a name="l01592"></a>01592     }
-<a name="l01593"></a>01593 
-<a name="l01594"></a>01594     cpl_image_delete(spectra); spectra = NULL;
-<a name="l01595"></a>01595     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l01596"></a>01596 
-<a name="l01597"></a>01597     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01598"></a>01598         save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01599"></a>01599         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, wavemap, wavelength_map_sky_tag,
-<a name="l01600"></a>01600                            save_header, parlist, recipe, version))
-<a name="l01601"></a>01601             fors_extract_exit(NULL);
-<a name="l01602"></a>01602         cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01603"></a>01603     }
-<a name="l01604"></a>01604 
-<a name="l01605"></a>01605     cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l01606"></a>01606 
-<a name="l01607"></a>01607     mapped = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, reference,
-<a name="l01608"></a>01608                                         startwavelength, endwavelength,
-<a name="l01609"></a>01609                                         dispersion, idscoeff, flux);
-<a name="l01610"></a>01610 
-<a name="l01611"></a>01611     cpl_image_delete(smapped); smapped = NULL;
-<a name="l01612"></a>01612 
-<a name="l01613"></a>01613 <span class="comment">/*    if (skymedian >= 0) {    NSS */</span>
-<a name="l01614"></a>01614     <span class="keywordflow">if</span> (skymedian) {
-<a name="l01615"></a>01615             cpl_msg_indent_less();
-<a name="l01616"></a>01616             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l01617"></a>01617             cpl_msg_indent_more();
-<a name="l01618"></a>01618        
-<a name="l01619"></a>01619 <span class="comment">/*   NSS      skylocalmap = mos_sky_local(mapped, slits, skymedian); */</span>
-<a name="l01620"></a>01620 <span class="comment">/*            skylocalmap = mos_sky_local(mapped, slits, 0);        */</span>
-<a name="l01621"></a>01621             skylocalmap = <a class="code" href="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a">mos_sky_local_old</a>(mapped, slits);       
-<a name="l01622"></a>01622             cpl_image_subtract(mapped, skylocalmap);
-<a name="l01623"></a>01623 <span class="comment">/*</span>
-<a name="l01624"></a>01624 <span class="comment">            if (dfs_save_image(frameset, skylocalmap, mapped_sky_tag, header, </span>
-<a name="l01625"></a>01625 <span class="comment">                               parlist, recipe, version))</span>
-<a name="l01626"></a>01626 <span class="comment">                fors_extract_exit(NULL);</span>
-<a name="l01627"></a>01627 <span class="comment">*/</span>
-<a name="l01628"></a>01628             cpl_image_delete(skylocalmap); skylocalmap = NULL;
-<a name="l01629"></a>01629     }
-<a name="l01630"></a>01630 
-<a name="l01631"></a>01631 <span class="comment">/*    if (skyglobal || skymedian >= 0 || skylocal) {   NSS */</span>
-<a name="l01632"></a>01632     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {
-<a name="l01633"></a>01633 
-<a name="l01634"></a>01634         skylocalmap = cpl_image_subtract_create(mapped_sky, mapped);
-<a name="l01635"></a>01635 
-<a name="l01636"></a>01636         cpl_image_delete(mapped_sky); mapped_sky = NULL;
-<a name="l01637"></a>01637 
-<a name="l01638"></a>01638         <span class="keywordflow">if</span> (time_normalise) {
-<a name="l01639"></a>01639             dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);
-<a name="l01640"></a>01640             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, dummy, mapped_sky_tag, header,
-<a name="l01641"></a>01641                                parlist, recipe, version))
-<a name="l01642"></a>01642                 fors_extract_exit(NULL);
-<a name="l01643"></a>01643             cpl_image_delete(dummy); dummy = NULL;
-<a name="l01644"></a>01644         }
-<a name="l01645"></a>01645         <span class="keywordflow">else</span> {
-<a name="l01646"></a>01646             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, skylocalmap, mapped_sky_tag, header,
-<a name="l01647"></a>01647                                parlist, recipe, version))
-<a name="l01648"></a>01648                 fors_extract_exit(NULL);
-<a name="l01649"></a>01649         }
-<a name="l01650"></a>01650 
-<a name="l01651"></a>01651         cpl_msg_indent_less();
-<a name="l01652"></a>01652         cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);
-<a name="l01653"></a>01653         cpl_msg_indent_more();
-<a name="l01654"></a>01654 
-<a name="l01655"></a>01655         <span class="keywordflow">if</span> (cosmics || nscience > 1) {
-<a name="l01656"></a>01656             dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped, slits, slit_margin, ext_radius, 
-<a name="l01657"></a>01657                                        cont_radius);
-<a name="l01658"></a>01658         }
-<a name="l01659"></a>01659         <span class="keywordflow">else</span> {
-<a name="l01660"></a>01660             mapped_cleaned = cpl_image_duplicate(mapped);
-<a name="l01661"></a>01661             <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);
-<a name="l01662"></a>01662             dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin, 
-<a name="l01663"></a>01663                                        ext_radius, cont_radius);
-<a name="l01664"></a>01664 
-<a name="l01665"></a>01665             cpl_image_delete(mapped_cleaned); mapped_cleaned = NULL;
-<a name="l01666"></a>01666         }
-<a name="l01667"></a>01667 
-<a name="l01668"></a>01668         cpl_image_delete(dummy); dummy = NULL;
-<a name="l01669"></a>01669 
-<a name="l01670"></a>01670         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, object_table_tag, NULL, parlist, 
-<a name="l01671"></a>01671                            recipe, version))
-<a name="l01672"></a>01672             fors_extract_exit(NULL);
-<a name="l01673"></a>01673 
-<a name="l01674"></a>01674         cpl_msg_indent_less();
-<a name="l01675"></a>01675         cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);
-<a name="l01676"></a>01676         cpl_msg_indent_more();
-<a name="l01677"></a>01677 
-<a name="l01678"></a>01678         images = <a class="code" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">mos_extract_objects</a>(mapped, skylocalmap, slits, 
-<a name="l01679"></a>01679                                      ext_mode, ron, gain, 1);
-<a name="l01680"></a>01680 
-<a name="l01681"></a>01681         cpl_image_delete(skylocalmap); skylocalmap = NULL;
-<a name="l01682"></a>01682 
-<a name="l01683"></a>01683         <span class="keywordflow">if</span> (images) {
-<a name="l01684"></a>01684             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01685"></a>01685                 cpl_image_divide_scalar(images[0], alltime);
-<a name="l01686"></a>01686             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[0], reduced_science_tag, header,
-<a name="l01687"></a>01687                                parlist, recipe, version))
-<a name="l01688"></a>01688                 fors_extract_exit(NULL);
-<a name="l01689"></a>01689             cpl_image_delete(images[0]);
-<a name="l01690"></a>01690     
-<a name="l01691"></a>01691             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01692"></a>01692                 cpl_image_divide_scalar(images[1], alltime);
-<a name="l01693"></a>01693             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[1], reduced_sky_tag, header,
-<a name="l01694"></a>01694                                parlist, recipe, version))
-<a name="l01695"></a>01695                 fors_extract_exit(NULL);
-<a name="l01696"></a>01696             cpl_image_delete(images[1]);
-<a name="l01697"></a>01697     
-<a name="l01698"></a>01698             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01699"></a>01699                 cpl_image_divide_scalar(images[2], alltime);
-<a name="l01700"></a>01700             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[2], reduced_error_tag, header,
-<a name="l01701"></a>01701                                parlist, recipe, version))
-<a name="l01702"></a>01702                 fors_extract_exit(NULL);
-<a name="l01703"></a>01703             cpl_image_delete(images[2]);
-<a name="l01704"></a>01704     
-<a name="l01705"></a>01705             cpl_free(images);
-<a name="l01706"></a>01706         }
-<a name="l01707"></a>01707         <span class="keywordflow">else</span> {
-<a name="l01708"></a>01708             cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span>
-<a name="l01709"></a>01709                             <span class="stringliteral">"%s, %s, and %s are not created"</span>, 
-<a name="l01710"></a>01710                             reduced_science_tag, reduced_sky_tag, 
-<a name="l01711"></a>01711                             reduced_error_tag);
-<a name="l01712"></a>01712         }
-<a name="l01713"></a>01713 
-<a name="l01714"></a>01714     }
-<a name="l01715"></a>01715 
-<a name="l01716"></a>01716     cpl_table_delete(slits); slits = NULL;
-<a name="l01717"></a>01717 
-<a name="l01718"></a>01718     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01719"></a>01719         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_coeff_sky_tag, NULL, 
-<a name="l01720"></a>01720                            parlist, recipe, version))
-<a name="l01721"></a>01721             fors_extract_exit(NULL);
-<a name="l01722"></a>01722     }
-<a name="l01723"></a>01723 
-<a name="l01724"></a>01724     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l01725"></a>01725 
-<a name="l01726"></a>01726 <span class="comment">/*    if (skyglobal || skymedian >= 0) {   NSS */</span>
-<a name="l01727"></a>01727     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {
-<a name="l01728"></a>01728         <span class="keywordflow">if</span> (time_normalise)
-<a name="l01729"></a>01729             cpl_image_divide_scalar(mapped, alltime);
-<a name="l01730"></a>01730         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped, mapped_science_tag, header, 
-<a name="l01731"></a>01731                            parlist, recipe, version))
-<a name="l01732"></a>01732             fors_extract_exit(NULL);
-<a name="l01733"></a>01733     }
-<a name="l01734"></a>01734 
-<a name="l01735"></a>01735     cpl_image_delete(mapped); mapped = NULL;
-<a name="l01736"></a>01736     cpl_propertylist_delete(header); header = NULL;
-<a name="l01737"></a>01737 
-<a name="l01738"></a>01738     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01739"></a>01739         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01740"></a>01740         fors_extract_exit(NULL);
-<a name="l01741"></a>01741     }
-<a name="l01742"></a>01742 
-<a name="l01743"></a>01743     <span class="keywordflow">return</span> 0;
-<a name="l01744"></a>01744 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:04 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/recipes_2fors__extract_8c_source.html b/html/recipes_2fors__extract_8c_source.html
new file mode 100644
index 0000000..68f6b23
--- /dev/null
+++ b/html/recipes_2fors__extract_8c_source.html
@@ -0,0 +1,1759 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: fors_extract.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">recipes/fors_extract.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: fors_extract.c,v 1.12 2013-10-09 15:59:38 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-10-09 15:59:38 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.12 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_create(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05" title="Extract sources.">fors_extract</a>(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">static</span> <span class="keywordtype">char</span> fors_extract_description[] =</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"This recipe is used to reduce scientific spectra using the global\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"distortion table created by the recipe fors_calib. The spectra are\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"bias subtracted, flat fielded (if a normalised flat field is specified)\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"and remapped eliminating the optical distortions. The wavelength calibration\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"can be optionally upgraded using a number of sky lines: if no sky lines\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"catalog of wavelengths is specified, an internal one is used instead.\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"If the alignment to the sky lines is performed, the applied dispersion\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"coefficient table is upgraded and saved to disk, and a new CCD wavelengths\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"map is created.\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"This recipe accepts both FORS1 and FORS2 frames. A grism table (typically\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"depending on the instrument mode, and in particular on the grism used)\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"may also be specified: this table contains a default recipe parameter\n"</span> </div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"setting to control the way spectra are extracted for a specific instrument\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"mode, as it is used for automatic run of the pipeline on Paranal and in\n"</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"Garching. If this table is specified, it will modify the default recipe\n"</span> </div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"parameter setting, with the exception of those parameters which have been\n"</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"explicitly modifyed on the command line. If a grism table is not specified,\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"the input recipe parameters values will always be read from the command\n"</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"line, or from an esorex configuration file if present, or from their\n"</span> </div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"generic default values (that are rarely meaningful).\n"</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"In the table below the MXU acronym can be read alternatively as MOS\n"</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"and LSS, depending on the instrument mode of the input data. Either a\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"scientific or a standard star exposure can be specified in input (not\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"both).\n\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"  SCIENCE_MXU                Raw         Scientific exposure     Y\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"  or STANDARD_MXU            Raw         Standard star exposure  Y\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"  MASTER_BIAS                Calib       Master bias             Y\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"  MASTER_SKYLINECAT          Calib       Sky lines catalog       .\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"  MASTER_NORM_FLAT_MXU       Calib       Normalised flat field   .\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"  MASTER_DISTORTION_TABLE    Calib       Global distortion model .\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="stringliteral">"  or, in case of LSS-like MOS/MXU data,\n"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"  MASTER_NORM_FLAT_LONG_MXU  Calib       Normalised flat field   .\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="stringliteral">"  REDUCED_SCI_MXU            FITS image  Extracted scientific spectra\n"</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="stringliteral">"  REDUCED_SKY_SCI_MXU        FITS image  Extracted sky spectra\n"</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="stringliteral">"  REDUCED_ERROR_SCI_MXU      FITS image  Errors on extracted spectra\n"</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="stringliteral">"  UNMAPPED_SCI_MXU           FITS image  Sky subtracted scientific spectra\n"</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="stringliteral">"  MAPPED_SCI_MXU             FITS image  Rectified scientific spectra\n"</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="stringliteral">"  MAPPED_ALL_SCI_MXU         FITS image  Rectified science spectra with sky\n"</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="stringliteral">"  MAPPED_SKY_SCI_MXU         FITS image  Rectified sky spectra\n"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="stringliteral">"  UNMAPPED_SKY_SCI_MXU           FITS image  Sky on CCD\n"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="stringliteral">"  GLOBAL_SKY_SPECTRUM_MXU    FITS table  Global sky spectrum\n"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="stringliteral">"  OBJECT_TABLE_SCI_MXU       FITS table  Positions of detected objects\n"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"  Only if the sky-alignment of the wavelength solution is requested:\n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"  SKY_SHIFTS_LONG_SCI_MXU    FITS table  Sky lines offsets (LSS-like data)\n"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="stringliteral">"  or SKY_SHIFTS_SLIT_SCI_MXU FITS table  Sky lines offsets (MOS-like data)\n"</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="stringliteral">"  DISP_COEFF_SCI_MXU         FITS table  Upgraded dispersion coefficients\n"</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="stringliteral">"  WAVELENGTH_MAP_SCI_MXU     FITS image  Upgraded wavelength map\n\n"</span>;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">#define fors_extract_exit(message)            \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">cpl_free(exptime);                            \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">cpl_free(instrume);                           \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">cpl_image_delete(dummy);                      \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">cpl_image_delete(mapped);                     \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">cpl_image_delete(skylocalmap);                \</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">cpl_image_delete(smapped);                    \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">cpl_table_delete(offsets);                    \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">cpl_table_delete(global);                     \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">cpl_table_delete(sky);                        \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">cpl_image_delete(bias);                       \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> </div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="preprocessor">#define fors_extract_exit_memcheck(message)            \</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="preprocessor">{                                                      \</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);            \</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="preprocessor">printf("free exptime (%p)\n", exptime);                \</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="preprocessor">cpl_free(exptime);                                     \</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="preprocessor">printf("free instrume (%p)\n", instrume);              \</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="preprocessor">cpl_free(instrume);                                    \</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="preprocessor">printf("free dummy (%p)\n", dummy);                    \</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="preprocessor">cpl_image_delete(dummy);                               \</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor">printf("free mapped (%p)\n", mapped);                  \</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="preprocessor">cpl_image_delete(mapped);                              \</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="preprocessor">printf("free mapped_cleaned (%p)\n", mapped_cleaned);  \</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="preprocessor">cpl_image_delete(mapped_cleaned);                      \</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="preprocessor">printf("free mapped_sky (%p)\n", mapped_sky);          \</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="preprocessor">cpl_image_delete(mapped_sky);                          \</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="preprocessor">printf("free skylocalmap (%p)\n", skylocalmap);        \</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="preprocessor">cpl_image_delete(skylocalmap);                         \</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="preprocessor">printf("free skymap (%p)\n", skymap);                  \</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="preprocessor">cpl_image_delete(skymap);                              \</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="preprocessor">printf("free smapped (%p)\n", smapped);                \</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="preprocessor">cpl_image_delete(smapped);                             \</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="preprocessor">printf("free offsets (%p)\n", offsets);                \</span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="preprocessor">cpl_table_delete(offsets);                             \</span></div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> <span class="preprocessor">printf("free global (%p)\n", global);                  \</span></div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span> <span class="preprocessor">cpl_table_delete(global);                              \</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="preprocessor">printf("free sky (%p)\n", sky);                        \</span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="preprocessor">cpl_table_delete(sky);                                 \</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="preprocessor">printf("free bias (%p)\n", bias);                      \</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor">cpl_image_delete(bias);                                \</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="preprocessor">printf("free spectra (%p)\n", spectra);                \</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="preprocessor">cpl_image_delete(spectra);                             \</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);          \</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> <span class="preprocessor">cpl_image_delete(coordinate);                          \</span></div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span> <span class="preprocessor">printf("free norm_flat (%p)\n", norm_flat);            \</span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="preprocessor">cpl_image_delete(norm_flat);                           \</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);                \</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="preprocessor">cpl_image_delete(rainbow);                             \</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor">printf("free rectified (%p)\n", rectified);            \</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="preprocessor">cpl_image_delete(rectified);                           \</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);                \</span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> <span class="preprocessor">cpl_image_delete(wavemap);                             \</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="preprocessor">printf("free header (%p)\n", header);                  \</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="preprocessor">cpl_propertylist_delete(header);                       \</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="preprocessor">printf("free save_header (%p)\n", save_header);        \</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="preprocessor">cpl_propertylist_delete(save_header);                  \</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table);        \</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="preprocessor">cpl_table_delete(grism_table);                         \</span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);              \</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="preprocessor">cpl_table_delete(idscoeff);                            \</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);            \</span></div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> <span class="preprocessor">cpl_table_delete(maskslits);                           \</span></div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="preprocessor">printf("free overscans (%p)\n", overscans);            \</span></div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="preprocessor">cpl_table_delete(overscans);                           \</span></div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);          \</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="preprocessor">cpl_table_delete(polytraces);                          \</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="preprocessor">printf("free slits (%p)\n", slits);                    \</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="preprocessor">cpl_table_delete(slits);                               \</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths);        \</span></div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span> <span class="preprocessor">cpl_table_delete(wavelengths);                         \</span></div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="preprocessor">printf("free lines (%p)\n", lines);                    \</span></div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <span class="preprocessor">cpl_vector_delete(lines);                              \</span></div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> <span class="preprocessor">cpl_msg_indent_less();                                 \</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="preprocessor">return 0;                                              \</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> {</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                     <span class="stringliteral">"fors_extract"</span>,</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                     <span class="stringliteral">"Extraction of scientific spectra"</span>,</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>                     fors_extract_description,</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>                     fors_extract_create,</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>                     fors_extract_exec,</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                     fors_extract_destroy);</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span> </div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> }</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> {</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.dispersion"</span>,</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                                 <span class="stringliteral">"Resampling step (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                                 0.0);</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> <span class="comment">     * Sky lines alignment</span></div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span> </div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.skyalign"</span>,</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>                                 <span class="stringliteral">"Polynomial order for sky lines alignment, "</span></div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>                                 <span class="stringliteral">"or -1 to avoid alignment"</span>,</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>                                 0);</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.wcolumn"</span>,</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>                                 <span class="stringliteral">"Name of sky line catalog table column "</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> </div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> </div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.startwavelength"</span>,</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>                                 0.0);</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span> </div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.endwavelength"</span>,</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>                                 0.0);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span> </div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span> <span class="comment">     * Flux conservation</span></div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span> </div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.flux"</span>,</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>                                 <span class="stringliteral">"Apply flux conservation"</span>,</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>                                 TRUE);</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span> </div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> <span class="comment">     * Apply flat field</span></div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> </div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.flatfield"</span>,</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>                                 <span class="stringliteral">"Apply flat field"</span>,</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>                                 FALSE);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flatfield"</span>);</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> </div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span> <span class="comment">     * Global sky subtraction</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> </div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.skyglobal"</span>,</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>                                 <span class="stringliteral">"Subtract global sky spectrum from CCD"</span>,</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>                                 FALSE);</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyglobal"</span>);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> <span class="comment">     * Local sky subtraction on extracted spectra</span></div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span> </div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span> <span class="comment">/*** New sky subtraction (search NSS)</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> <span class="comment">    p = cpl_parameter_new_value("fors.fors_extract.skymedian",</span></div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> <span class="comment">                                CPL_TYPE_INT,</span></div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> <span class="comment">                                "Degree of sky fitting polynomial for "</span></div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> <span class="comment">                                "sky subtraction from extracted "</span></div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span> <span class="comment">                                "slit spectra (MOS/MXU only, -1 to disable it)",</span></div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> <span class="comment">                                "fors.fors_extract",</span></div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> <span class="comment">                                0);</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> <span class="comment">    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "skymedian");</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> <span class="comment">    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="comment">    cpl_parameterlist_append(recipe->parameters, p);</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> <span class="comment">***/</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.skymedian"</span>,</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>                                 <span class="stringliteral">"Sky subtraction from extracted slit spectra"</span>,</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>                                 FALSE);</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skymedian"</span>);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> </div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> <span class="comment">     * Local sky subtraction on CCD spectra</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.skylocal"</span>,</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>                                 <span class="stringliteral">"Sky subtraction from CCD slit spectra"</span>,</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>                                 TRUE);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skylocal"</span>);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span> </div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> <span class="comment">     * Cosmic rays removal</span></div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.cosmics"</span>,</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                                 <span class="stringliteral">"Eliminate cosmic rays hits (only if global "</span></div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                                 <span class="stringliteral">"sky subtraction is also requested)"</span>,</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                                 FALSE);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="comment">     * Slit margin</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> </div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.slit_margin"</span>,</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span></div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>                                 <span class="stringliteral">"in object detection and extraction"</span>,</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>                                 3);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span> <span class="comment">     * Extraction radius</span></div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span> </div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.ext_radius"</span>,</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>                                 <span class="stringliteral">"Maximum extraction radius for detected "</span></div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>                                 <span class="stringliteral">"objects (pixel)"</span>,</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>                                 6);</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span> </div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> <span class="comment">     * Contamination radius</span></div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.cont_radius"</span>,</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>                                 <span class="stringliteral">"Minimum distance at which two objects "</span></div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span></div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>                                 <span class="stringliteral">"each other (pixel)"</span>,</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>                                 0);</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span> </div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span> <span class="comment">     * Object extraction method</span></div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> </div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.ext_mode"</span>,</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span></div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>                                 1);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> </div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span> <span class="comment">     * Normalise output by exposure time</span></div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span> </div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.fors_extract.time_normalise"</span>,</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>                                 <span class="stringliteral">"Normalise output spectra by the exposure time"</span>,</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>                                 <span class="stringliteral">"fors.fors_extract"</span>,</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>                                 TRUE);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"time_normalise"</span>);</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span> </div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span> }</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> </div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span> {</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     </div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> </div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     <span class="keywordflow">return</span> <a class="code" href="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05" title="Extract sources.">fors_extract</a>(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> }</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> </div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> </div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span> <span class="keyword">static</span> <span class="keywordtype">int</span> fors_extract_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span> {</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span> </div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span> }</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> </div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span> </div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__extract.html#ga7b1fcb810d3b1a5f3077a404c7a01a05" title="Extract sources.">fors_extract</a>(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span> {</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span> </div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"fors_extract"</span>;</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span> </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span> </div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     <span class="keywordtype">int</span>         skyalign;</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>     <span class="keywordtype">int</span>         flux;</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     <span class="keywordtype">int</span>         flatfield;</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     <span class="keywordtype">int</span>         skyglobal;</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <span class="keywordtype">int</span>         skylocal;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>     <span class="keywordtype">int</span>         skymedian;</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     <span class="keywordtype">int</span>         cosmics;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     <span class="keywordtype">int</span>         slit_margin;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>     <span class="keywordtype">int</span>         ext_radius;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     <span class="keywordtype">int</span>         cont_radius;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>     <span class="keywordtype">int</span>         ext_mode;</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>     <span class="keywordtype">int</span>         time_normalise;</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span> </div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span> </div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> </div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     cpl_imagelist    *all_science;</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>     cpl_image       **images;</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span> </div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     cpl_image        *bias           = NULL;</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     cpl_image        *norm_flat      = NULL;</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     cpl_image        *spectra        = NULL;</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     cpl_image        *rectified      = NULL;</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>     cpl_image        *coordinate     = NULL;</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     cpl_image        *rainbow        = NULL;</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>     cpl_image        *mapped         = NULL;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     cpl_image        *mapped_sky     = NULL;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>     cpl_image        *mapped_cleaned = NULL;</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     cpl_image        *smapped        = NULL;</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>     cpl_image        *wavemap        = NULL;</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>     cpl_image        *skymap         = NULL;</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     cpl_image        *skylocalmap    = NULL;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     cpl_image        *dummy          = NULL;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span> </div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     cpl_table        *grism_table    = NULL;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     cpl_table        *overscans      = NULL;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     cpl_table        *wavelengths    = NULL;</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>     cpl_table        *idscoeff       = NULL;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>     cpl_table        *slits          = NULL;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>     cpl_table        *maskslits      = NULL;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     cpl_table        *polytraces     = NULL;</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     cpl_table        *offsets        = NULL;</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>     cpl_table        *sky            = NULL;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     cpl_table        *global         = NULL;</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span> </div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>     cpl_vector       *lines          = NULL;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span> </div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>     cpl_propertylist *header         = NULL;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     cpl_propertylist *save_header    = NULL;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> </div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span>     <span class="keywordtype">char</span>         version[80];</div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="keywordtype">char</span>        *instrume = NULL;</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span>     <span class="keywordtype">char</span>        *wheel4 = NULL;</div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *science_tag;</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *master_norm_flat_tag;</div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *disp_coeff_sky_tag;</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *wavelength_map_sky_tag;</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *reduced_science_tag;</div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *reduced_sky_tag;</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *reduced_error_tag;</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *mapped_science_tag;</div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *unmapped_science_tag;</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *mapped_science_sky_tag;</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *mapped_sky_tag;</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *unmapped_sky_tag;</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *global_sky_spectrum_tag;</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *object_table_tag;</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *skylines_offsets_tag;</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>     <span class="keyword">const</span> <span class="keywordtype">char</span>  *global_distortion_tag = <span class="stringliteral">"MASTER_DISTORTION_TABLE"</span>;</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span>     <span class="keywordtype">char</span>        *coll;</div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>     <span class="keywordtype">int</span>         mxu, mos, lss;</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     <span class="keywordtype">int</span>         nscience;</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>     <span class="keywordtype">double</span>     *exptime = NULL;</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>     <span class="keywordtype">double</span>      alltime;</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>     <span class="keywordtype">double</span>      mean_rms;</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>     <span class="keywordtype">int</span>         nlines;</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     <span class="keywordtype">int</span>         rebin;</div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>     <span class="keywordtype">double</span>     *line;</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>     <span class="keywordtype">double</span>      gain;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>     <span class="keywordtype">double</span>      ron;</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>     <span class="keywordtype">int</span>         standard;</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>     <span class="keywordtype">int</span>         highres;</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     <span class="keywordtype">int</span>         narrow = 0;</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> </div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> </div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span> </div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> </div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> </div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span> </div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>         fors_extract_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span> </div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span> </div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>                     <span class="stringliteral">"fors.fors_extract.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> </div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>         fors_extract_exit(<span class="stringliteral">"Invalid resampling step"</span>);</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     skyalign = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>                     <span class="stringliteral">"fors.fors_extract.skyalign"</span>, NULL);</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span> </div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>     <span class="keywordflow">if</span> (skyalign > 2)</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>         fors_extract_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span> </div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>                     <span class="stringliteral">"fors.fors_extract.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> </div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>                     <span class="stringliteral">"fors.fors_extract.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>     <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>         fors_extract_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> </div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>                     <span class="stringliteral">"fors.fors_extract.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>     <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>         fors_extract_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span> </div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>         fors_extract_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> </div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>     flux = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_extract.flux"</span>, NULL);</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span> </div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     flatfield = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_extract.flatfield"</span>, </div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>                                        NULL);</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span> </div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span>     skyglobal = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_extract.skyglobal"</span>, </div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>                                        NULL);</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>     skylocal  = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_extract.skylocal"</span>, </div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>                                        NULL);</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>     skymedian = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.fors_extract.skymedian"</span>, </div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span>                                        NULL);</div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span> <span class="comment">/* NSS</span></div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span> <span class="comment">    skymedian = dfs_get_parameter_int(parlist, "fors.fors_extract.skymedian", </span></div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> <span class="comment">                                       NULL);</span></div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> </div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     <span class="keywordflow">if</span> (skylocal && skyglobal)</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>         fors_extract_exit(<span class="stringliteral">"Cannot apply both local and global sky subtraction"</span>);</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span> </div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>     <span class="keywordflow">if</span> (skylocal && skymedian)</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>         fors_extract_exit(<span class="stringliteral">"Cannot apply sky subtraction both on extracted "</span></div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>                           <span class="stringliteral">"and non-extracted spectra"</span>);</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span> </div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     cosmics = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>                                      <span class="stringliteral">"fors.fors_extract.cosmics"</span>, NULL);</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>     <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>         <span class="keywordflow">if</span> (!(skyglobal || skylocal))</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>             fors_extract_exit(<span class="stringliteral">"Cosmic rays correction requires "</span></div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>                               <span class="stringliteral">"either skylocal=true or skyglobal=true"</span>);</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span> </div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     slit_margin = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>                                         <span class="stringliteral">"fors.fors_extract.slit_margin"</span>,</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>                                         NULL);</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span>     <span class="keywordflow">if</span> (slit_margin < 0)</div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>         fors_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span> </div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     ext_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>                                        <span class="stringliteral">"fors.fors_extract.ext_radius"</span>,</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>                                        NULL);</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>     <span class="keywordflow">if</span> (ext_radius < 0)</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>         fors_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span> </div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>     cont_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>                                         <span class="stringliteral">"fors.fors_extract.cont_radius"</span>,</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>                                        NULL);</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>     <span class="keywordflow">if</span> (cont_radius < 0)</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>         fors_extract_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span> </div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>     ext_mode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.fors_extract.ext_mode"</span>,</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>                                        NULL);</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>         fors_extract_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span> </div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     time_normalise = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>                              <span class="stringliteral">"fors.fors_extract.time_normalise"</span>, NULL);</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span> </div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> </div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>         fors_extract_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span> </div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     </div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> <span class="comment">     * Check input set-of-frames</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span> </div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> </div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS GRIS1 ID"</span>))</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>         fors_extract_exit(<span class="stringliteral">"Input frames are not from the same grism"</span>);</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> </div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO INS FILT1 ID"</span>))</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>         fors_extract_exit(<span class="stringliteral">"Input frames are not from the same filter"</span>);</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span> </div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO DET CHIP1 ID"</span>))</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>         fors_extract_exit(<span class="stringliteral">"Input frames are not from the same chip"</span>);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> </div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MXU"</span>);</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_MOS"</span>);</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"SCIENCE_LSS"</span>);</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>     standard = 0;</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span> </div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>     <span class="keywordflow">if</span> (mxu + mos + lss == 0) {</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>         mxu = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MXU"</span>);</div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>         mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_MOS"</span>);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>         lss = cpl_frameset_count_tags(frameset, <span class="stringliteral">"STANDARD_LSS"</span>);</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>         standard = 1;</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     }</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span> </div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>     <span class="keywordflow">if</span> (mxu + mos + lss == 0)</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>         fors_extract_exit(<span class="stringliteral">"Missing input scientific frame"</span>);</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span> </div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>     nscience = mxu + mos + lss;</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span> </div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>     <span class="keywordflow">if</span> (mxu && mxu < nscience)</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>         fors_extract_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); </div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span> </div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>     <span class="keywordflow">if</span> (mos && mos < nscience)</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>         fors_extract_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); </div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span> </div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>     <span class="keywordflow">if</span> (lss && lss < nscience)</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>         fors_extract_exit(<span class="stringliteral">"Input scientific frames must be of the same type"</span>); </div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span> </div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span>     <span class="keywordflow">if</span> (mxu) {</div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>             cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>             science_tag            = <span class="stringliteral">"STANDARD_MXU"</span>;</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>             reduced_science_tag    = <span class="stringliteral">"REDUCED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>             unmapped_science_tag   = <span class="stringliteral">"UNMAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span>             mapped_science_tag     = <span class="stringliteral">"MAPPED_STD_MXU"</span>;</div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>             mapped_science_sky_tag = <span class="stringliteral">"MAPPED_ALL_STD_MXU"</span>;</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>             skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MXU"</span>;</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>             wavelength_map_sky_tag = <span class="stringliteral">"WAVELENGTH_MAP_STD_MXU"</span>;</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>             disp_coeff_sky_tag     = <span class="stringliteral">"DISP_COEFF_STD_MXU"</span>;</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>             mapped_sky_tag         = <span class="stringliteral">"MAPPED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>             unmapped_sky_tag       = <span class="stringliteral">"UNMAPPED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>             object_table_tag       = <span class="stringliteral">"OBJECT_TABLE_STD_MXU"</span>;</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>             reduced_sky_tag        = <span class="stringliteral">"REDUCED_SKY_STD_MXU"</span>;</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>             reduced_error_tag      = <span class="stringliteral">"REDUCED_ERROR_STD_MXU"</span>;</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>         }</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>             cpl_msg_info(recipe, <span class="stringliteral">"MXU data found"</span>);</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>             science_tag            = <span class="stringliteral">"SCIENCE_MXU"</span>;</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>             reduced_science_tag    = <span class="stringliteral">"REDUCED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>             unmapped_science_tag   = <span class="stringliteral">"UNMAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>             mapped_science_tag     = <span class="stringliteral">"MAPPED_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>             mapped_science_sky_tag = <span class="stringliteral">"MAPPED_ALL_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>             skylines_offsets_tag   = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>             wavelength_map_sky_tag = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>             disp_coeff_sky_tag     = <span class="stringliteral">"DISP_COEFF_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>             mapped_sky_tag         = <span class="stringliteral">"MAPPED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>             unmapped_sky_tag       = <span class="stringliteral">"UNMAPPED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>             object_table_tag       = <span class="stringliteral">"OBJECT_TABLE_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>             reduced_sky_tag        = <span class="stringliteral">"REDUCED_SKY_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>             reduced_error_tag      = <span class="stringliteral">"REDUCED_ERROR_SCI_MXU"</span>;</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>         }</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span> </div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_MXU"</span>;</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_MXU"</span>;</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span> </div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>             master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_MXU"</span>;</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span>         }</div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>     }</div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span> </div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>     <span class="keywordflow">if</span> (lss) {</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span> </div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>         <span class="keywordflow">if</span> (cosmics && !skyglobal)</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>             fors_extract_exit(<span class="stringliteral">"Cosmic rays correction for LSS "</span></div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>                               <span class="stringliteral">"data requires --skyglobal=true"</span>);</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span> </div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>         cpl_msg_info(recipe, <span class="stringliteral">"LSS data found"</span>);</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span> </div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>             science_tag             = <span class="stringliteral">"STANDARD_LSS"</span>;</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>             reduced_science_tag     = <span class="stringliteral">"REDUCED_STD_LSS"</span>;</div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_STD_LSS"</span>;</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_LSS"</span>;</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_LSS"</span>;</div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_STD_LSS"</span>;</div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_STD_LSS"</span>;</div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_STD_LSS"</span>;</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_LSS"</span>;</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_STD_LSS"</span>;</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_STD_LSS"</span>;</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_STD_LSS"</span>;</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_STD_LSS"</span>;</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>         }</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>             science_tag             = <span class="stringliteral">"SCIENCE_LSS"</span>;</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>             reduced_science_tag     = <span class="stringliteral">"REDUCED_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_LONG_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_SCI_LSS"</span>;</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>         }</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span> </div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LSS"</span>;</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_LSS"</span>;</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>     }</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span> </div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>     <span class="keywordflow">if</span> (mos) {</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>         cpl_msg_info(recipe, <span class="stringliteral">"MOS data found"</span>);</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>             science_tag             = <span class="stringliteral">"STANDARD_MOS"</span>;</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>             reduced_science_tag     = <span class="stringliteral">"REDUCED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_STD_MOS"</span>;</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_STD_MOS"</span>;</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_STD_MOS"</span>;</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_STD_MOS"</span>;</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_STD_MOS"</span>;</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_STD_MOS"</span>;</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_STD_MOS"</span>;</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_STD_MOS"</span>;</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>         }</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>             science_tag             = <span class="stringliteral">"SCIENCE_MOS"</span>;</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>             reduced_science_tag     = <span class="stringliteral">"REDUCED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>             unmapped_science_tag    = <span class="stringliteral">"UNMAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>             mapped_science_tag      = <span class="stringliteral">"MAPPED_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>             mapped_science_sky_tag  = <span class="stringliteral">"MAPPED_ALL_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>             skylines_offsets_tag    = <span class="stringliteral">"SKY_SHIFTS_SLIT_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>             wavelength_map_sky_tag  = <span class="stringliteral">"WAVELENGTH_MAP_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>             disp_coeff_sky_tag      = <span class="stringliteral">"DISP_COEFF_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>             mapped_sky_tag          = <span class="stringliteral">"MAPPED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>             unmapped_sky_tag        = <span class="stringliteral">"UNMAPPED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>             object_table_tag        = <span class="stringliteral">"OBJECT_TABLE_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>             reduced_sky_tag         = <span class="stringliteral">"REDUCED_SKY_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>             reduced_error_tag       = <span class="stringliteral">"REDUCED_ERROR_SCI_MOS"</span>;</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span>         }</div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span> </div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>         master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_MOS"</span>;</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>         global_sky_spectrum_tag = <span class="stringliteral">"GLOBAL_SKY_SPECTRUM_MOS"</span>;</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span> </div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>         <span class="keywordflow">if</span> (!cpl_frameset_count_tags(frameset, master_norm_flat_tag)) {</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>             master_norm_flat_tag    = <span class="stringliteral">"MASTER_NORM_FLAT_LONG_MOS"</span>;</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>         }</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>     }</div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span> </div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0)</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>         fors_extract_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span> </div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)</div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>         fors_extract_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span> </div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>     <span class="keywordflow">if</span> (skyalign >= 0)</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>) > 1)</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>             fors_extract_exit(<span class="stringliteral">"Too many in input: MASTER_SKYLINECAT"</span>);</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span> </div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, global_distortion_tag) == 0)</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>         fors_extract_exit(<span class="stringliteral">"Missing required input: MASTER_DISTORTION_TABLE"</span>);</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span> </div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, global_distortion_tag) > 1)</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>         fors_extract_exit(<span class="stringliteral">"Too many in input: MASTER_DISTORTION_TABLE"</span>);</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span> </div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) > 1) {</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, </div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>                           master_norm_flat_tag);</div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>             fors_extract_exit(NULL);</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>         }</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input are ignored, "</span></div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>                             <span class="stringliteral">"since flat field correction was not requested"</span>, </div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>                             master_norm_flat_tag);</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>         }</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>     }</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span> </div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 1) {</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>         <span class="keywordflow">if</span> (!flatfield) {</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input is ignored, "</span></div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>                             <span class="stringliteral">"since flat field correction was not requested"</span>, </div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>                             master_norm_flat_tag);</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>         }</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>     }</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span> </div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 0) {</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>             cpl_msg_error(recipe, <span class="stringliteral">"Flat field correction was requested, "</span></div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>                           <span class="stringliteral">"but no %s are found in input"</span>,</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>                           master_norm_flat_tag);</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>             fors_extract_exit(NULL);</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>         }</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>     }</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span> </div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span> </div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span> </div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span> <span class="comment">     * Loading input data</span></div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span> </div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>     exptime = cpl_calloc(nscience, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span> </div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>     <span class="keywordflow">if</span> (nscience > 1) {</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span> </div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load %d scientific frames and median them..."</span>,</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>                      nscience);</div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span> </div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>         all_science = cpl_imagelist_new();</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span> </div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span> </div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>             fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span> </div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span> </div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>             fors_extract_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>                               <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span> </div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span> </div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame 1 exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>                      exptime[0]);</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span> </div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span> </div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span> </div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>             <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>                 fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>     </div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>             exptime[i] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span> </div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>             alltime += exptime[i];</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>     </div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>                 fors_extract_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>                                   <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>     </div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>             cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span> </div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>             cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame %d exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>                          i+1, exptime[i]);</div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>         }</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span> </div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>         spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span> </div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>         <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>             fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span> </div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>         cpl_image_divide_scalar(spectra, exptime[0]);</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>         cpl_imagelist_set(all_science, spectra, 0); spectra = NULL;</div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span> </div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span> </div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>             spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span> </div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>             <span class="keywordflow">if</span> (spectra) {</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>                 cpl_image_divide_scalar(spectra, exptime[i]);</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>                 cpl_imagelist_set(all_science, spectra, i); spectra = NULL;</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>             }</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>                 fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span> </div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>         }</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span> </div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>         spectra = cpl_imagelist_collapse_median_create(all_science);</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>         cpl_image_multiply_scalar(spectra, alltime);</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span> </div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>         cpl_imagelist_delete(all_science);</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>     }</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load scientific exposure..."</span>);</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span> </div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span> </div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>             fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span> </div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span> </div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span> <span class="comment">         * Insert here a check on supported filters:</span></div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span> </div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>         wheel4 = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header,</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>                                                      <span class="stringliteral">"ESO INS OPTI9 TYPE"</span>);</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>             fors_extract_exit(<span class="stringliteral">"Missing ESO INS OPTI9 TYPE in flat header"</span>);</div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>         }</div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span> </div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>         <span class="keywordflow">if</span> (strcmp(<span class="stringliteral">"FILT"</span>, wheel4) == 0) {</div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>             wheel4 = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header,</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>                                                          <span class="stringliteral">"ESO INS OPTI9 NAME"</span>);</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>             cpl_msg_error(recipe, <span class="stringliteral">"Unsupported filter: %s"</span>, wheel4);</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>             fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>         }</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span> </div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span> </div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span> </div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>             fors_extract_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>                               <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span> </div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span> </div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>                      exptime[0]);</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span> </div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>         spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>     }</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span> </div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>         fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span> </div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>     cpl_free(exptime); exptime = NULL;</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span> </div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span> </div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span> </div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span> <span class="comment">     * Get the reference wavelength and the rebin factor along the</span></div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span> <span class="comment">     * dispersion direction from a scientific exposure</span></div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span> </div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span> </div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>         fors_extract_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span> </div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>         fors_extract_exit(<span class="stringliteral">"Missing keyword INSTRUME in sientific header"</span>);</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>     instrume = cpl_strdup(instrume);</div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span> </div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'1'</span>)</div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors1"</span>, VERSION);</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>     <span class="keywordflow">if</span> (instrume[4] == <span class="charliteral">'2'</span>)</div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>         snprintf(version, 80, <span class="stringliteral">"%s/%s"</span>, <span class="stringliteral">"fors2"</span>, VERSION);</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span> </div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>     cpl_free(instrume); instrume = NULL;</div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span> </div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>     reference = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO INS GRIS1 WLEN"</span>);</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span> </div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>         fors_extract_exit(<span class="stringliteral">"Missing keyword ESO INS GRIS1 WLEN in scientific "</span></div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span> </div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>     <span class="keywordflow">if</span> (reference < 3000.0)   <span class="comment">/* Perhaps in nanometers... */</span></div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>         reference *= 10;</div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span> </div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>     <span class="keywordflow">if</span> (reference < 3000.0 || reference > 13000.0) {</div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>         cpl_msg_error(recipe, <span class="stringliteral">"Invalid central wavelength %.2f read from "</span></div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>                       <span class="stringliteral">"keyword ESO INS GRIS1 WLEN in scientific frame header"</span>,</div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>                       reference);</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>         fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>     }</div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span> </div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>     cpl_msg_info(recipe, <span class="stringliteral">"The central wavelength is: %.2f"</span>, reference);</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span> </div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>     rebin = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO DET WIN1 BINX"</span>);</div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span> </div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>         fors_extract_exit(<span class="stringliteral">"Missing keyword ESO DET WIN1 BINX in scientific "</span></div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span> </div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>     <span class="keywordflow">if</span> (rebin != 1) {</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>         dispersion *= rebin;</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>         cpl_msg_warning(recipe, <span class="stringliteral">"The rebin factor is %d, and therefore the "</span></div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>                         <span class="stringliteral">"resampling step used is %f A/pixel"</span>, rebin, </div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>                         dispersion);</div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>     }</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span> </div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span> </div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>         fors_extract_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in scientific "</span></div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span> </div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span> </div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span> </div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>         fors_extract_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in scientific "</span></div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span> </div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span></div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span> </div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span> </div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>     coll = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"ESO INS COLL NAME"</span>);</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span> </div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>         fors_extract_exit(<span class="stringliteral">"Missing keyword ESO INS COLL NAME in scientific "</span></div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span> </div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>     cpl_msg_info(recipe, <span class="stringliteral">"The collimator is : %s"</span>, coll);</div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span> </div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>     <span class="keywordflow">if</span> (strcmp(coll, <span class="stringliteral">"COLL_HR"</span>) == 0)</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>         fors_extract_exit(<span class="stringliteral">"HR collimator is not yet supported by this recipe"</span>);</div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>     </div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span> </div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>     <span class="keywordflow">if</span> (mos)</div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>     {   </div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>         <span class="keywordtype">int</span> nslits_out_det;</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>         maskslits = <a class="code" href="group__moses.html#gae0112d43e53bdf0d3ba6d628473e17b8" title="Create slit location table from FITS header of FORS1/2 MOS data.">mos_load_slits_fors_mos</a>(header, &nslits_out_det);</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>     }</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lss)</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>         maskslits = <a class="code" href="group__moses.html#ga43072c6a57d094a5d7d341934a096e80" title="Create slit location table from FITS header of FORS1/2 LSS data.">mos_load_slits_fors_lss</a>(header);</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>         maskslits = <a class="code" href="group__moses.html#ga2c9ae818bb4b07cf99dc5ae8e9e78d9c" title="Create slit location table from FITS header of FORS2-MXU data.">mos_load_slits_fors_mxu</a>(header);</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span> </div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>     <span class="keywordflow">if</span> (lss) {</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>         <span class="keywordflow">if</span> (skylocal) {</div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>             <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>                 fors_extract_exit(<span class="stringliteral">"Cosmic rays correction for LSS "</span></div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>                                   <span class="stringliteral">"data requires --skyglobal=true"</span>);</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>             skymedian = skylocal;</div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>             skylocal = 0;</div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>         }</div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>     }</div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span> </div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>     global = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, global_distortion_tag, 1);</div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>     <span class="keywordflow">if</span> (global == NULL)</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>         fors_extract_exit(<span class="stringliteral">"Cannot load global distortion table"</span>);</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span> </div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>     <span class="comment">/* Leave the header on for the next step... */</span></div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span> </div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span> </div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span> <span class="comment">     * Remove the master bias</span></div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span> </div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);</div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span> </div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>     bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span> </div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>     <span class="keywordflow">if</span> (bias == NULL)</div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>         fors_extract_exit(<span class="stringliteral">"Cannot load master bias"</span>);</div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span> </div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>     overscans = <a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(header, 1);</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>     dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(spectra, bias, overscans);</div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>     cpl_image_delete(spectra); spectra = dummy; dummy = NULL;</div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>     cpl_image_delete(bias); bias = NULL;</div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>     cpl_table_delete(overscans); overscans = NULL;</div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span> </div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>         fors_extract_exit(<span class="stringliteral">"Cannot remove bias from scientific frame"</span>);</div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span> </div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span> </div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>     <span class="keywordflow">if</span> (ny == 400 && nx == 2048)</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>         narrow = 1;</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span> </div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>     <span class="keywordflow">if</span> (narrow) {</div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>         ny = 2048;</div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>         dummy = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>         cpl_image_copy(dummy, spectra, 1, 825);     <span class="comment">/* (2048 - 400)/2 + 1 */</span></div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>         <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>             fors_extract_exit(<span class="stringliteral">"Problems expanding scientific image"</span>);</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>         cpl_image_delete(spectra); spectra = dummy; dummy = NULL;</div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>     }</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span> </div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load normalised flat field (if present)..."</span>);</div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span> </div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>     <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span> </div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>         norm_flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, master_norm_flat_tag, </div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>                                    CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span> </div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>         <span class="keywordflow">if</span> (norm_flat) {</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>             <span class="keywordflow">if</span> (narrow) {</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>                 dummy = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>                 cpl_image_copy(dummy, norm_flat, 1, 825);</div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>                 <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>                     fors_extract_exit(<span class="stringliteral">"Problems expanding flat image"</span>);</div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>                 cpl_image_delete(norm_flat); norm_flat = dummy; dummy = NULL;</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>             }</div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>             cpl_msg_info(recipe, <span class="stringliteral">"Apply flat field correction..."</span>);</div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>             <span class="keywordflow">if</span> (cpl_image_divide(spectra, norm_flat) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>                 cpl_msg_error(recipe, <span class="stringliteral">"Failure of flat field correction: %s"</span>,</div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>                               cpl_error_get_message());</div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>                 fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>             }</div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>             cpl_image_delete(norm_flat); norm_flat = NULL;</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>         }</div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>             cpl_msg_error(recipe, <span class="stringliteral">"Cannot load input %s for flat field "</span></div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>                           <span class="stringliteral">"correction"</span>, master_norm_flat_tag);</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>             fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>         }</div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span> </div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>     }</div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span> </div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span> </div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load input sky line catalog..."</span>);</div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span> </div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>         wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"MASTER_SKYLINECAT"</span>, 1);</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span> </div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>         <span class="keywordflow">if</span> (wavelengths) {</div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span> </div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span> <span class="comment">             * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span> </div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>             nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span> </div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>             <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>                 fors_extract_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);</div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span> </div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>             <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>                 cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span></div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>                               <span class="stringliteral">"catalog table"</span>, wcolumn);</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>                 fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>             }</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span> </div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>             line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>     </div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>             <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>                 line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span> </div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>             cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span> </div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>             lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>         }</div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>             cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);</div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>         }</div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>     }</div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span> </div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span> </div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span> <span class="comment">     * Load the slit location table, or provide a dummy one in case</span></div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span> <span class="comment">     * of LSS data (single slit spanning whole image)</span></div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span> </div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>     slits = <a class="code" href="group__moses.html#gad9b2789388ba6564011d832d276b2ae6" title="Build the slit location table from a global distortions table.">mos_build_slit_location</a>(global, maskslits, ny);</div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>     <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>         fors_extract_exit(<span class="stringliteral">"Cannot create slits location table"</span>);</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span> </div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span> </div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span> <span class="comment">     * Load the spectral curvature table in case of MOS or MXU data</span></div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span> </div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>     polytraces = <a class="code" href="group__moses.html#gacff89218baba1abf3641c083a1125861" title="Build the curvature coefficients table from a global distortions table.">mos_build_curv_coeff</a>(global, maskslits, slits);</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>     <span class="keywordflow">if</span> (polytraces == NULL)</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>         fors_extract_exit(<span class="stringliteral">"Cannot create spectral curvature table"</span>);</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span> </div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>     cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span> </div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>     cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific spectra..."</span>);</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span> </div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span> <span class="comment">     * This one will also generate the spatial map from the spectral </span></div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span> <span class="comment">     * curvature table (in the case of multislit data)</span></div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span> </div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span> </div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>     smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>                                       startwavelength, endwavelength,</div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>                                       dispersion, flux, coordinate);</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span> </div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span> </div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span> <span class="comment">     * Load the wavelength calibration table</span></div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span> </div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>     idscoeff = <a class="code" href="group__moses.html#ga4e4da9890ad8d0229f187b4d7eda17be" title="Build the IDS coefficients table from a global distortions table.">mos_build_disp_coeff</a>(global, slits);</div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>     <span class="keywordflow">if</span> (idscoeff == NULL)</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>         fors_extract_exit(<span class="stringliteral">"Cannot create wavelength calibration table"</span>);</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span> </div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>     cpl_table_delete(global); global = NULL;</div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span> </div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span> </div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span> <span class="comment">     * Generate a rectified wavelength map from the wavelength calibration </span></div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span> <span class="comment">     * table</span></div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span> </div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>     rainbow = <a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength, </div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>                                endwavelength);</div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span> </div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>     <span class="keywordflow">if</span> (dispersion > 1.0)</div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>         highres = 0;</div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>         highres = 1;</div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span> </div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>         <span class="keywordflow">if</span> (skyalign) {</div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>             <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>         }</div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>             <span class="stringliteral">"skylines applying median offset..."</span>);</div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>         }</div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span> </div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>         <span class="keywordflow">if</span> (lss) {</div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>             offsets = <a class="code" href="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1" title="Modify the input wavelength solution to match reference sky lines (LSS).">mos_wavelength_align_lss</a>(smapped, reference, </div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>                                                startwavelength, endwavelength, </div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>                                                idscoeff, lines, highres, </div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>                                                skyalign, rainbow, 4);</div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>         }</div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>             offsets = <a class="code" href="group__moses.html#ga634eb7408671a139e7015185776f4513" title="Modify the input wavelength solution to match reference sky lines.">mos_wavelength_align</a>(smapped, slits, reference, </div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>                                            startwavelength, endwavelength, </div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>                                            idscoeff, lines, highres, skyalign, </div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>                                            rainbow, 4);</div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>         }</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span> </div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>         cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span> </div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>         <span class="keywordflow">if</span> (offsets) {</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>             <span class="keywordflow">if</span> (standard)</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>                 cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span></div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>                                 <span class="stringliteral">"to reference sky lines may be unreliable in "</span></div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>                                 <span class="stringliteral">"this case!"</span>);</div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span> </div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, offsets, skylines_offsets_tag, NULL, </div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>                 fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span> </div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>             cpl_table_delete(offsets); offsets = NULL;</div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>         }</div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span></div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>                             <span class="stringliteral">"to reference sky lines could not be done!"</span>);</div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>             skyalign = -1;</div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>         }</div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span> </div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>     }</div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span> </div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>     wavemap = <a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(coordinate, rainbow, slits, </div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>                                   polytraces, reference, </div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>                                   startwavelength, endwavelength,</div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>                                   dispersion);</div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span> </div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>     cpl_image_delete(rainbow); rainbow = NULL;</div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>     cpl_image_delete(coordinate); coordinate = NULL;</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span> </div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span> <span class="comment">     * Here the wavelength calibrated slit spectra are created. This frame</span></div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span> <span class="comment">     * contains sky_science.</span></div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span> </div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>     mapped_sky = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, reference,</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>                                             startwavelength, endwavelength,</div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>                                             dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span> </div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check applied wavelength against skylines..."</span>);</div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span> </div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>     mean_rms = <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(mapped_sky, NULL, startwavelength,</div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>                                    dispersion, 6, highres);</div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span> </div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f"</span>, mean_rms);</div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span> </div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span> </div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>     header = cpl_propertylist_new();</div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>                                    startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span> <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span> </div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>     <span class="keywordflow">if</span> (time_normalise) {</div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>         dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);</div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, dummy, mapped_science_sky_tag, header, </div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>             fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>         cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>     }</div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, mapped_sky, mapped_science_sky_tag, </div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>                            header, parlist, recipe, version))</div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>             fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>     }</div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span> </div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span> <span class="comment">/*    if (skyglobal == 0 && skymedian < 0) {    NSS */</span></div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>     <span class="keywordflow">if</span> (skyglobal == 0 && skymedian == 0 && skylocal == 0) {</div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>         cpl_image_delete(mapped_sky); mapped_sky = NULL;</div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>     }</div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span> </div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>     <span class="keywordflow">if</span> (skyglobal || skylocal) {</div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span> </div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span> </div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>         <span class="keywordflow">if</span> (skyglobal) {</div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>             cpl_msg_info(recipe, <span class="stringliteral">"Global sky determination..."</span>);</div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>             skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>             sky = <a class="code" href="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d" title="Create a CCD median sky map.">mos_sky_map_super</a>(spectra, wavemap, dispersion, </div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>                                     2.0, 50, skymap);</div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>             <span class="keywordflow">if</span> (sky)</div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>                 cpl_image_subtract(spectra, skymap);</div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>                 cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>         }</div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>             skymap = <a class="code" href="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2" title="Subtract the sky from the scientific CCD exposure.">mos_subtract_sky</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>                            startwavelength, endwavelength, dispersion);</div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>         }</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span> </div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>         <span class="keywordflow">if</span> (skymap) {</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>             <span class="keywordflow">if</span> (skyglobal) {</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>                 <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>                     cpl_table_divide_scalar(sky, <span class="stringliteral">"sky"</span>, alltime);</div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, sky, global_sky_spectrum_tag, </div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>                                    NULL, parlist, recipe, version))</div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>                     fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>     </div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>                 cpl_table_delete(sky); sky = NULL;</div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>             }</div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span> </div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>             save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span> </div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>             <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>                 cpl_image_divide_scalar(skymap, alltime);</div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, skymap, unmapped_sky_tag,</div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>                                save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>                 fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span> </div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>             cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span> </div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, spectra, unmapped_science_tag,</div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>                                save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>                 fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span> </div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>             cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span> </div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>             <span class="keywordflow">if</span> (cosmics) {</div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>                 cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);</div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>                 <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(spectra, gain, -1., -1.);</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>             }</div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span> </div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span> <span class="comment">             * The spatially rectified image, that contained the sky,</span></div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span> <span class="comment">             * is replaced by a sky-subtracted spatially rectified image:</span></div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span> </div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>             cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span> </div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>             <span class="keywordflow">if</span> (lss) {</div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>                 smapped = cpl_image_duplicate(spectra);</div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>             }</div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>                 smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, </div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>                                                   reference, startwavelength, </div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>                                                   endwavelength, dispersion, </div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>                                                   flux, NULL);</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>             }</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>         }</div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Sky subtraction failure"</span>);</div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>             <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>                 cpl_msg_warning(recipe, <span class="stringliteral">"Cosmic rays removal not performed!"</span>);</div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>             cosmics = skylocal = skyglobal = 0;</div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>         }</div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>     }</div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span> </div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span> </div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>         save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, wavemap, wavelength_map_sky_tag,</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>                            save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>             fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>         cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>     }</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span> </div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>     cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span> </div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>     mapped = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, reference,</div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>                                         startwavelength, endwavelength,</div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>                                         dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span> </div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>     cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span> </div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span> <span class="comment">/*    if (skymedian >= 0) {    NSS */</span></div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>     <span class="keywordflow">if</span> (skymedian) {</div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>             cpl_msg_indent_less();</div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>        </div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span> <span class="comment">/*   NSS      skylocalmap = mos_sky_local(mapped, slits, skymedian); */</span></div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span> <span class="comment">/*            skylocalmap = mos_sky_local(mapped, slits, 0);        */</span></div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>             skylocalmap = <a class="code" href="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8" title="Local determination of sky.">mos_sky_local_old</a>(mapped, slits);       </div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>             cpl_image_subtract(mapped, skylocalmap);</div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span> <span class="comment">            if (dfs_save_image(frameset, skylocalmap, mapped_sky_tag, header, </span></div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span> <span class="comment">                               parlist, recipe, version))</span></div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span> <span class="comment">                fors_extract_exit(NULL);</span></div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>             cpl_image_delete(skylocalmap); skylocalmap = NULL;</div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>     }</div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span> </div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span> <span class="comment">/*    if (skyglobal || skymedian >= 0 || skylocal) {   NSS */</span></div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {</div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span> </div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>         skylocalmap = cpl_image_subtract_create(mapped_sky, mapped);</div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span> </div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>         cpl_image_delete(mapped_sky); mapped_sky = NULL;</div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span> </div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>         <span class="keywordflow">if</span> (time_normalise) {</div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>             dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);</div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, dummy, mapped_sky_tag, header,</div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>                 fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>             cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>         }</div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, skylocalmap, mapped_sky_tag, header,</div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>                 fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>         }</div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span> </div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>         cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);</div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span> </div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>         <span class="keywordflow">if</span> (cosmics || nscience > 1) {</div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>             dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped, slits, slit_margin, ext_radius, </div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>                                        cont_radius);</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>         }</div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>             mapped_cleaned = cpl_image_duplicate(mapped);</div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>             <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>             dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin, </div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>                                        ext_radius, cont_radius);</div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span> </div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>             cpl_image_delete(mapped_cleaned); mapped_cleaned = NULL;</div>
+<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>         }</div>
+<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span> </div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>         cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span> </div>
+<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, slits, object_table_tag, NULL, parlist, </div>
+<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>                            recipe, version))</div>
+<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>             fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span> </div>
+<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>         cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);</div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span> </div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>         images = <a class="code" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522" title="Extract detected objects from rectified scientific frame.">mos_extract_objects</a>(mapped, skylocalmap, slits, </div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>                                      ext_mode, ron, gain, 1);</div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span> </div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>         cpl_image_delete(skylocalmap); skylocalmap = NULL;</div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span> </div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>         <span class="keywordflow">if</span> (images) {</div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>             <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>                 cpl_image_divide_scalar(images[0], alltime);</div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[0], reduced_science_tag, header,</div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>                 fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span>             cpl_image_delete(images[0]);</div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>     </div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>             <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>                 cpl_image_divide_scalar(images[1], alltime);</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[1], reduced_sky_tag, header,</div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>                 fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>             cpl_image_delete(images[1]);</div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>     </div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>             <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>                 cpl_image_divide_scalar(images[2], alltime);</div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[2], reduced_error_tag, header,</div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>                 fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>             cpl_image_delete(images[2]);</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>     </div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>             cpl_free(images);</div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>         }</div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>             cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span></div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>                             <span class="stringliteral">"%s, %s, and %s are not created"</span>, </div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>                             reduced_science_tag, reduced_sky_tag, </div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>                             reduced_error_tag);</div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>         }</div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span> </div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>     }</div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span> </div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span> </div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, idscoeff, disp_coeff_sky_tag, NULL, </div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>             fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>     }</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span> </div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span> </div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span> <span class="comment">/*    if (skyglobal || skymedian >= 0) {   NSS */</span></div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {</div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>         <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>             cpl_image_divide_scalar(mapped, alltime);</div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, mapped, mapped_science_tag, header, </div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>             fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>     }</div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span> </div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>     cpl_image_delete(mapped); mapped = NULL;</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span> </div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>         cpl_msg_error(cpl_error_get_where(), <span class="stringliteral">"%s"</span>, cpl_error_get_message());</div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>         fors_extract_exit(NULL);</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>     }</div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span> </div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/struct__FORS__PAF__.html b/html/struct__FORS__PAF__.html
index 50a483a..7c7e2d6 100644
--- a/html/struct__FORS__PAF__.html
+++ b/html/struct__FORS__PAF__.html
@@ -1,55 +1,85 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _FORS_PAF_ Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_FORS_PAF_ Struct Reference<br>
-<small>
-[<a class="el" href="group__forsPaf.html">PAF File Utilities</a>]</small>
-</h1><!-- doxytag: class="_FORS_PAF_" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="34a869607ecd20de7f2452c808b64de6"></a><!-- doxytag: member="_FORS_PAF_::name" ref="34a869607ecd20de7f2452c808b64de6" args="" -->
-char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__.html#34a869607ecd20de7f2452c808b64de6">name</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8bf1f1454a4b17f7672624a3b8c2bd2c"></a><!-- doxytag: member="_FORS_PAF_::nh" ref="8bf1f1454a4b17f7672624a3b8c2bd2c" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__.html#8bf1f1454a4b17f7672624a3b8c2bd2c">nh</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="66bfa139519297af4654c5193246d6b9"></a><!-- doxytag: member="_FORS_PAF_::nr" ref="66bfa139519297af4654c5193246d6b9" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__.html#66bfa139519297af4654c5193246d6b9">nr</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cdc2007f38750ed7ef260e8409d4eb1f"></a><!-- doxytag: member="_FORS_PAF_::header" ref="cdc2007f38750ed7ef260e8409d4eb1f" args="" -->
-<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> ** </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__.html#cdc2007f38750ed7ef260e8409d4eb1f">header</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="636a3e406d979877c1a39a4df39719a6"></a><!-- doxytag: member="_FORS_PAF_::records" ref="636a3e406d979877c1a39a4df39719a6" args="" -->
-<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> ** </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__.html#636a3e406d979877c1a39a4df39719a6">records</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00105">105</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__paf_8c-source.html">fors_paf.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_FORS_PAF_ Struct Reference<div class="ingroups"><a class="el" href="group__forsPaf.html">PAF File Utilities</a></div></div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a8277746dbb0ef7626fbc103f763ebcf1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8277746dbb0ef7626fbc103f763ebcf1"></a>
+char * </td><td class="memItemRight" valign="bottom"><b>name</b></td></tr>
+<tr class="separator:a8277746dbb0ef7626fbc103f763ebcf1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ae6e4dfc62b72ede7cc3eb94f9442567d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae6e4dfc62b72ede7cc3eb94f9442567d"></a>
+int </td><td class="memItemRight" valign="bottom"><b>nh</b></td></tr>
+<tr class="separator:ae6e4dfc62b72ede7cc3eb94f9442567d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a819813f81b4540eff32231e77d9c52e9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a819813f81b4540eff32231e77d9c52e9"></a>
+int </td><td class="memItemRight" valign="bottom"><b>nr</b></td></tr>
+<tr class="separator:a819813f81b4540eff32231e77d9c52e9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a7f44550c15b50560e761a07c8b78024d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7f44550c15b50560e761a07c8b78024d"></a>
+<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> ** </td><td class="memItemRight" valign="bottom"><b>header</b></td></tr>
+<tr class="separator:a7f44550c15b50560e761a07c8b78024d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:af406fb3edb547a0608a76c93b8b6f6c8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af406fb3edb547a0608a76c93b8b6f6c8"></a>
+<a class="el" href="struct__FORS__PAF__RECORD__.html">ForsPAFRecord</a> ** </td><td class="memItemRight" valign="bottom"><b>records</b></td></tr>
+<tr class="separator:af406fb3edb547a0608a76c93b8b6f6c8"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00105">105</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__paf_8c_source.html">fors_paf.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__FORS__PAF__RECORD__.html b/html/struct__FORS__PAF__RECORD__.html
index afd0737..a3c1a9b 100644
--- a/html/struct__FORS__PAF__RECORD__.html
+++ b/html/struct__FORS__PAF__RECORD__.html
@@ -1,62 +1,91 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _FORS_PAF_RECORD_ Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_FORS_PAF_RECORD_ Struct Reference<br>
-<small>
-[<a class="el" href="group__forsPaf.html">PAF File Utilities</a>]</small>
-</h1><!-- doxytag: class="_FORS_PAF_RECORD_" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9c0a1cd7e519ed0d9aa34c67701097df"></a><!-- doxytag: member="_FORS_PAF_RECORD_::name" ref="9c0a1cd7e519ed0d9aa34c67701097df" args="" -->
-char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__RECORD__.html#9c0a1cd7e519ed0d9aa34c67701097df">name</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="21c362fbcb9b3d29a1914af816580690"></a><!-- doxytag: member="_FORS_PAF_RECORD_::comment" ref="21c362fbcb9b3d29a1914af816580690" args="" -->
-char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__RECORD__.html#21c362fbcb9b3d29a1914af816580690">comment</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="13b54564388819d2d248117bcb421ab3"></a><!-- doxytag: member="_FORS_PAF_RECORD_::type" ref="13b54564388819d2d248117bcb421ab3" args="" -->
-ForsPAFType </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__FORS__PAF__RECORD__.html#13b54564388819d2d248117bcb421ab3">type</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap><a class="anchor" name="af503bdde0ec76ccfa978ec693f61d40"></a><!-- doxytag: member="_FORS_PAF_RECORD_::data" ref="af503bdde0ec76ccfa978ec693f61d40" args="" -->
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_FORS_PAF_RECORD_ Struct Reference<div class="ingroups"><a class="el" href="group__forsPaf.html">PAF File Utilities</a></div></div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a6d69378eba6870b6fa93c3a3cf63910d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6d69378eba6870b6fa93c3a3cf63910d"></a>
+char * </td><td class="memItemRight" valign="bottom"><b>name</b></td></tr>
+<tr class="separator:a6d69378eba6870b6fa93c3a3cf63910d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:af69bb301a9df55477add23c6a2ad6240"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af69bb301a9df55477add23c6a2ad6240"></a>
+char * </td><td class="memItemRight" valign="bottom"><b>comment</b></td></tr>
+<tr class="separator:af69bb301a9df55477add23c6a2ad6240"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a3b157d712d46492bc176a06500980115"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3b157d712d46492bc176a06500980115"></a>
+ForsPAFType </td><td class="memItemRight" valign="bottom"><b>type</b></td></tr>
+<tr class="separator:a3b157d712d46492bc176a06500980115"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a85d0294d00b7c5b4205fadac85526328"><td class="memItemLeft" ><a class="anchor" id="a85d0294d00b7c5b4205fadac85526328"></a>
 union {</td></tr>
-
-<tr><td class="memItemLeft" nowrap>   int *   <a class="el" href="struct__FORS__PAF__RECORD__.html#633c615d76af4c00b82b50bf75cb4b84">bval</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap>   int *   <a class="el" href="struct__FORS__PAF__RECORD__.html#880a737b5fffa6baaeaa97653bdb341e">ival</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap>   double *   <a class="el" href="struct__FORS__PAF__RECORD__.html#34d5c881a9bc312b95bc3d644d6fb522">dval</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap>   char *   <a class="el" href="struct__FORS__PAF__RECORD__.html#ee05c6571fefff310dee1ffb5e3430b3">sval</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap valign="top">} </td><td class="memItemRight" valign="bottom"><b>data</b></td></tr>
-
+<tr class="memitem:abca4eadb4a65922b8665fc28d60d486b"><td class="memItemLeft" >   int *   <b>bval</b></td></tr>
+<tr class="separator:abca4eadb4a65922b8665fc28d60d486b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a79316a0d58db9b47f27d0389cf39374e"><td class="memItemLeft" >   int *   <b>ival</b></td></tr>
+<tr class="separator:a79316a0d58db9b47f27d0389cf39374e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ab4f6f22850660482c2a4f9fcd9c992b4"><td class="memItemLeft" >   double *   <b>dval</b></td></tr>
+<tr class="separator:ab4f6f22850660482c2a4f9fcd9c992b4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:af034c02918a4f84f7b689f0b39ece0f0"><td class="memItemLeft" >   char *   <b>sval</b></td></tr>
+<tr class="separator:af034c02918a4f84f7b689f0b39ece0f0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a85d0294d00b7c5b4205fadac85526328"><td class="memItemLeft" valign="top">} </td><td class="memItemRight" valign="bottom"><b>data</b></td></tr>
+<tr class="separator:a85d0294d00b7c5b4205fadac85526328"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__paf_8c-source.html#l00085">85</a> of file <a class="el" href="fors__paf_8c-source.html">fors_paf.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__paf_8c-source.html">fors_paf.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__paf_8c_source.html#l00085">85</a> of file <a class="el" href="fors__paf_8c_source.html">fors_paf.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__paf_8c_source.html">fors_paf.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__extract__method.html b/html/struct__extract__method.html
index ec43dfb..d249b3e 100644
--- a/html/struct__extract__method.html
+++ b/html/struct__extract__method.html
@@ -1,69 +1,96 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _extract_method Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_extract_method Struct Reference<br>
-<small>
-[<a class="el" href="group__fors__extract.html">Image source extraction</a>]</small>
-</h1><!-- doxytag: class="_extract_method" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a158a4c2668b0b00dbbb11cd02803d6a730077e09f97fc0ba10eeb4dfbe86247"></a><!-- doxytag: member="_extract_method::SEX" ref="a158a4c2668b0b00dbbb11cd02803d6a730077e09f97fc0ba10eeb4dfbe86247" args="" -->
- </td><td class="memItemRight" valign="bottom"><b>SEX</b></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a158a4c2668b0b00dbbb11cd02803d6ad81f7cc37a564db02eb2c05bdbfe60e5"></a><!-- doxytag: member="_extract_method::TEST" ref="a158a4c2668b0b00dbbb11cd02803d6ad81f7cc37a564db02eb2c05bdbfe60e5" args="" -->
- </td><td class="memItemRight" valign="bottom"><b>TEST</b></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom">{ <b>SEX</b>, 
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-types">Public Types</a> |
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_extract_method Struct Reference<div class="ingroups"><a class="el" href="group__fors__extract.html">Image source extraction</a></div></div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
+Public Types</h2></td></tr>
+<tr class="memitem:a0c08efabb16395acf6dc57359ce2efdc"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom">{ <b>SEX</b>, 
 <b>TEST</b>
  }</td></tr>
-
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="70ea3963e689922ccf1e9b55191367f1"></a><!-- doxytag: member="_extract_method::method" ref="70ea3963e689922ccf1e9b55191367f1" args="" -->
-enum _extract_method:: { ... }  </td><td class="memItemRight" valign="bottom"><b>method</b></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="96e7cec5f46b8c296ed4d2d20e884b4a"></a><!-- doxytag: member="_extract_method::sex_exe" ref="96e7cec5f46b8c296ed4d2d20e884b4a" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__extract__method.html#96e7cec5f46b8c296ed4d2d20e884b4a">sex_exe</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e76dd739b557c30e57acc0b8f69440b0"></a><!-- doxytag: member="_extract_method::sex_config" ref="e76dd739b557c30e57acc0b8f69440b0" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__extract__method.html#e76dd739b557c30e57acc0b8f69440b0">sex_config</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1fee7344ac0997d0b446d6339a7760ad"></a><!-- doxytag: member="_extract_method::sex_mag" ref="1fee7344ac0997d0b446d6339a7760ad" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__extract__method.html#1fee7344ac0997d0b446d6339a7760ad">sex_mag</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9e966f3de33443a13329d9a4d602513e"></a><!-- doxytag: member="_extract_method::sex_magerr" ref="9e966f3de33443a13329d9a4d602513e" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__extract__method.html#9e966f3de33443a13329d9a4d602513e">sex_magerr</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b690a500e917441e8e043ec876bf40c8"></a><!-- doxytag: member="_extract_method::sex_radius" ref="b690a500e917441e8e043ec876bf40c8" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__extract__method.html#b690a500e917441e8e043ec876bf40c8">sex_radius</a></td></tr>
-
+<tr class="separator:a0c08efabb16395acf6dc57359ce2efdc"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a6d3808d8f76ccba38a0b04b348f55071"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6d3808d8f76ccba38a0b04b348f55071"></a>
+enum _extract_method:: { ... }  </td><td class="memItemRight" valign="bottom"><b>method</b></td></tr>
+<tr class="separator:a6d3808d8f76ccba38a0b04b348f55071"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:aa51edfe17fbf90e81405a4d343d6211f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa51edfe17fbf90e81405a4d343d6211f"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>sex_exe</b></td></tr>
+<tr class="separator:aa51edfe17fbf90e81405a4d343d6211f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a4b963442d71be80738b5994e97c75b36"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4b963442d71be80738b5994e97c75b36"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>sex_config</b></td></tr>
+<tr class="separator:a4b963442d71be80738b5994e97c75b36"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a0cb0c99c37ef47b7569955e8f42adbf6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0cb0c99c37ef47b7569955e8f42adbf6"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>sex_mag</b></td></tr>
+<tr class="separator:a0cb0c99c37ef47b7569955e8f42adbf6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a4ddadecb69b1867762accb298da7e7d7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4ddadecb69b1867762accb298da7e7d7"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>sex_magerr</b></td></tr>
+<tr class="separator:a4ddadecb69b1867762accb298da7e7d7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a94aa696ea0cf75d5a40545f6ada13e43"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a94aa696ea0cf75d5a40545f6ada13e43"></a>
+int </td><td class="memItemRight" valign="bottom"><b>sex_radius</b></td></tr>
+<tr class="separator:a94aa696ea0cf75d5a40545f6ada13e43"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors_2fors__extract_8c-source.html#l00056">56</a> of file <a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors_2fors__extract_8c-source.html">fors/fors_extract.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors_2fors__extract_8c_source.html#l00056">56</a> of file <a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors_2fors__extract_8c_source.html">fors/fors_extract.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__fors__cpl__wcs__.html b/html/struct__fors__cpl__wcs__.html
index 155c74b..1c9a169 100644
--- a/html/struct__fors__cpl__wcs__.html
+++ b/html/struct__fors__cpl__wcs__.html
@@ -1,49 +1,79 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _fors_cpl_wcs_ Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_fors_cpl_wcs_ Struct Reference<br>
-<small>
-[<a class="el" href="group__fors__cpl__wcs.html">World_Coordinate_Systems</a>]</small>
-</h1><!-- doxytag: class="_fors_cpl_wcs_" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6b619700f366c75e8c2cbb8f1af053a7"></a><!-- doxytag: member="_fors_cpl_wcs_::wcsptr" ref="6b619700f366c75e8c2cbb8f1af053a7" args="" -->
-wcsprm * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__cpl__wcs__.html#6b619700f366c75e8c2cbb8f1af053a7">wcsptr</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="58e9d47541c1a76953952613a21832dc"></a><!-- doxytag: member="_fors_cpl_wcs_::naxis" ref="58e9d47541c1a76953952613a21832dc" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__cpl__wcs__.html#58e9d47541c1a76953952613a21832dc">naxis</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="947b7dc1ce3651b19825dee6fe385666"></a><!-- doxytag: member="_fors_cpl_wcs_::dims" ref="947b7dc1ce3651b19825dee6fe385666" args="" -->
-int * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__cpl__wcs__.html#947b7dc1ce3651b19825dee6fe385666">dims</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__cpl__wcs_8c-source.html#l00089">89</a> of file <a class="el" href="fors__cpl__wcs_8c-source.html">fors_cpl_wcs.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__cpl__wcs_8c-source.html">fors_cpl_wcs.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_fors_cpl_wcs_ Struct Reference<div class="ingroups"><a class="el" href="group__fors__cpl__wcs.html">World_Coordinate_Systems</a></div></div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a76ffd1e0af7f1d000078931be71a845e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a76ffd1e0af7f1d000078931be71a845e"></a>
+struct wcsprm * </td><td class="memItemRight" valign="bottom"><b>wcsptr</b></td></tr>
+<tr class="separator:a76ffd1e0af7f1d000078931be71a845e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:aa75d49f978e1ff975e9cb68f09c16c18"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa75d49f978e1ff975e9cb68f09c16c18"></a>
+int </td><td class="memItemRight" valign="bottom"><b>naxis</b></td></tr>
+<tr class="separator:aa75d49f978e1ff975e9cb68f09c16c18"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:aec01adf7519d22a1fb59c61076057595"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aec01adf7519d22a1fb59c61076057595"></a>
+int * </td><td class="memItemRight" valign="bottom"><b>dims</b></td></tr>
+<tr class="separator:aec01adf7519d22a1fb59c61076057595"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__cpl__wcs_8c_source.html#l00089">89</a> of file <a class="el" href="fors__cpl__wcs_8c_source.html">fors_cpl_wcs.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__cpl__wcs_8c_source.html">fors_cpl_wcs.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__fors__image.html b/html/struct__fors__image.html
index 124de5f..6bd7232 100644
--- a/html/struct__fors__image.html
+++ b/html/struct__fors__image.html
@@ -1,46 +1,76 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _fors_image Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_fors_image Struct Reference<br>
-<small>
-[<a class="el" href="group__fors__image.html">Image with error bars</a>]</small>
-</h1><!-- doxytag: class="_fors_image" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7ebd046a249c7f414e7a75fae06bed11"></a><!-- doxytag: member="_fors_image::data" ref="7ebd046a249c7f414e7a75fae06bed11" args="" -->
-cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__image.html#7ebd046a249c7f414e7a75fae06bed11">data</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="01a88109ce6cb2a84adb6372484e5e4a"></a><!-- doxytag: member="_fors_image::variance" ref="01a88109ce6cb2a84adb6372484e5e4a" args="" -->
-cpl_image * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__image.html#01a88109ce6cb2a84adb6372484e5e4a">variance</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__image_8c-source.html#l00062">62</a> of file <a class="el" href="fors__image_8c-source.html">fors_image.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__image_8c-source.html">fors_image.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_fors_image Struct Reference<div class="ingroups"><a class="el" href="group__fors__image.html">Image with error bars</a></div></div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a08eca6a1c5d5cfeb4af73b15c7985b3b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a08eca6a1c5d5cfeb4af73b15c7985b3b"></a>
+cpl_image * </td><td class="memItemRight" valign="bottom"><b>data</b></td></tr>
+<tr class="separator:a08eca6a1c5d5cfeb4af73b15c7985b3b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a88979de9862cd29d904a4f1e616509a4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a88979de9862cd29d904a4f1e616509a4"></a>
+cpl_image * </td><td class="memItemRight" valign="bottom"><b>variance</b></td></tr>
+<tr class="separator:a88979de9862cd29d904a4f1e616509a4"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__image_8c_source.html#l00062">62</a> of file <a class="el" href="fors__image_8c_source.html">fors_image.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__image_8c_source.html">fors_image.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__fors__pattern.html b/html/struct__fors__pattern.html
index 7fbe4f1..9afc9e1 100644
--- a/html/struct__fors__pattern.html
+++ b/html/struct__fors__pattern.html
@@ -1,58 +1,91 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _fors_pattern Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_fors_pattern Struct Reference</h1><!-- doxytag: class="_fors_pattern" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9053c96d81e220054dab66f48643fe6b"></a><!-- doxytag: member="_fors_pattern::ratsq" ref="9053c96d81e220054dab66f48643fe6b" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__pattern.html#9053c96d81e220054dab66f48643fe6b">ratsq</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b30a8282c5be5dcb81396a14232c6d97"></a><!-- doxytag: member="_fors_pattern::dratsq" ref="b30a8282c5be5dcb81396a14232c6d97" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__pattern.html#b30a8282c5be5dcb81396a14232c6d97">dratsq</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="20db6b3ec619997b2e5389c6a5ff00e6"></a><!-- doxytag: member="_fors_pattern::theta" ref="20db6b3ec619997b2e5389c6a5ff00e6" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__pattern.html#20db6b3ec619997b2e5389c6a5ff00e6">theta</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="41f94fda5bd41b1e72ef9c679ac73c2b"></a><!-- doxytag: member="_fors_pattern::dtheta" ref="41f94fda5bd41b1e72ef9c679ac73c2b" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__pattern.html#41f94fda5bd41b1e72ef9c679ac73c2b">dtheta</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="925bfb79eab3aefaa8276da769cbe41e"></a><!-- doxytag: member="_fors_pattern::ref" ref="925bfb79eab3aefaa8276da769cbe41e" args="" -->
-const fors_point * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__pattern.html#925bfb79eab3aefaa8276da769cbe41e">ref</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5a91baccbe20c7f8b25bddaa043a1773"></a><!-- doxytag: member="_fors_pattern::min" ref="5a91baccbe20c7f8b25bddaa043a1773" args="" -->
-const fors_point * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__pattern.html#5a91baccbe20c7f8b25bddaa043a1773">min</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bec8b3d42dee603bd4c07eed85d87665"></a><!-- doxytag: member="_fors_pattern::max" ref="bec8b3d42dee603bd4c07eed85d87665" args="" -->
-const fors_point * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__pattern.html#bec8b3d42dee603bd4c07eed85d87665">max</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__pattern_8c-source.html#l00041">41</a> of file <a class="el" href="fors__pattern_8c-source.html">fors_pattern.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__pattern_8c-source.html">fors_pattern.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_fors_pattern Struct Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:aabea542697d213367713130b5e97aa9e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aabea542697d213367713130b5e97aa9e"></a>
+double </td><td class="memItemRight" valign="bottom"><b>ratsq</b></td></tr>
+<tr class="separator:aabea542697d213367713130b5e97aa9e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a56e70f56aab145b915ebed443003b823"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a56e70f56aab145b915ebed443003b823"></a>
+double </td><td class="memItemRight" valign="bottom"><b>dratsq</b></td></tr>
+<tr class="separator:a56e70f56aab145b915ebed443003b823"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a0f355468abe462670457dc5f2dbfd63b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0f355468abe462670457dc5f2dbfd63b"></a>
+double </td><td class="memItemRight" valign="bottom"><b>theta</b></td></tr>
+<tr class="separator:a0f355468abe462670457dc5f2dbfd63b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a26b52abfcc19a9488dee27e2921fd3cf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a26b52abfcc19a9488dee27e2921fd3cf"></a>
+double </td><td class="memItemRight" valign="bottom"><b>dtheta</b></td></tr>
+<tr class="separator:a26b52abfcc19a9488dee27e2921fd3cf"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a45a7832dd782c60047ff9c16446882fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a45a7832dd782c60047ff9c16446882fe"></a>
+const fors_point * </td><td class="memItemRight" valign="bottom"><b>ref</b></td></tr>
+<tr class="separator:a45a7832dd782c60047ff9c16446882fe"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a2686acc25aa9720d0f18bd87371cf7de"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2686acc25aa9720d0f18bd87371cf7de"></a>
+const fors_point * </td><td class="memItemRight" valign="bottom"><b>min</b></td></tr>
+<tr class="separator:a2686acc25aa9720d0f18bd87371cf7de"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ad4c92aab333c6e87be1323ceaf3c03d8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad4c92aab333c6e87be1323ceaf3c03d8"></a>
+const fors_point * </td><td class="memItemRight" valign="bottom"><b>max</b></td></tr>
+<tr class="separator:ad4c92aab333c6e87be1323ceaf3c03d8"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__pattern_8c_source.html#l00041">41</a> of file <a class="el" href="fors__pattern_8c_source.html">fors_pattern.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__pattern_8c_source.html">fors_pattern.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__fors__point.html b/html/struct__fors__point.html
index 348852f..03df6ee 100644
--- a/html/struct__fors__point.html
+++ b/html/struct__fors__point.html
@@ -1,43 +1,76 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _fors_point Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_fors_point Struct Reference</h1><!-- doxytag: class="_fors_point" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="001799342df066a6b324fa53862476cd"></a><!-- doxytag: member="_fors_point::x" ref="001799342df066a6b324fa53862476cd" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__point.html#001799342df066a6b324fa53862476cd">x</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0c7d2a164217d83715d8170573798fbc"></a><!-- doxytag: member="_fors_point::y" ref="0c7d2a164217d83715d8170573798fbc" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__point.html#0c7d2a164217d83715d8170573798fbc">y</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__point_8h-source.html#l00035">35</a> of file <a class="el" href="fors__point_8h-source.html">fors_point.h</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__point_8h-source.html">fors_point.h</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_fors_point Struct Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a7d087815e7403a962b86bb10ada4421d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7d087815e7403a962b86bb10ada4421d"></a>
+double </td><td class="memItemRight" valign="bottom"><b>x</b></td></tr>
+<tr class="separator:a7d087815e7403a962b86bb10ada4421d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a33a8f245d63d8ae71d43239315076350"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a33a8f245d63d8ae71d43239315076350"></a>
+double </td><td class="memItemRight" valign="bottom"><b>y</b></td></tr>
+<tr class="separator:a33a8f245d63d8ae71d43239315076350"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__point_8h_source.html#l00035">35</a> of file <a class="el" href="fors__point_8h_source.html">fors_point.h</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__point_8h_source.html">fors_point.h</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__fors__setting.html b/html/struct__fors__setting.html
index 133d7a7..6403a27 100644
--- a/html/struct__fors__setting.html
+++ b/html/struct__fors__setting.html
@@ -1,79 +1,112 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _fors_setting Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_fors_setting Struct Reference</h1><!-- doxytag: class="_fors_setting" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0254d802b88507502cde0819c08080a3"></a><!-- doxytag: member="_fors_setting::binx" ref="0254d802b88507502cde0819c08080a3" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#0254d802b88507502cde0819c08080a3">binx</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7baead4dde541f43dc37292d95b7b9b5"></a><!-- doxytag: member="_fors_setting::biny" ref="7baead4dde541f43dc37292d95b7b9b5" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#7baead4dde541f43dc37292d95b7b9b5">biny</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="73c8992df1265002a5ad94acbb1f36c9"></a><!-- doxytag: member="_fors_setting::prescan_x" ref="73c8992df1265002a5ad94acbb1f36c9" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#73c8992df1265002a5ad94acbb1f36c9">prescan_x</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="21a646d60ba3e80ce7ced6c1af9ca03b"></a><!-- doxytag: member="_fors_setting::prescan_y" ref="21a646d60ba3e80ce7ced6c1af9ca03b" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#21a646d60ba3e80ce7ced6c1af9ca03b">prescan_y</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1bc4ab059bf8d162814b5c2cb231142c"></a><!-- doxytag: member="_fors_setting::filterband" ref="1bc4ab059bf8d162814b5c2cb231142c" args="" -->
-char </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#1bc4ab059bf8d162814b5c2cb231142c">filterband</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1"></a><!-- doxytag: member="_fors_setting::filter_name" ref="b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#b18bc6bc6a8ba1ad0f5f2b47c0a5a7d1">filter_name</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4a0fb5463b7fcdb097d0bbdb1bb64bd5"></a><!-- doxytag: member="_fors_setting::exposure_time" ref="4a0fb5463b7fcdb097d0bbdb1bb64bd5" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#4a0fb5463b7fcdb097d0bbdb1bb64bd5">exposure_time</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0ca6b8a16b7194786a049dbe7c0f954a"></a><!-- doxytag: member="_fors_setting::average_gain" ref="0ca6b8a16b7194786a049dbe7c0f954a" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#0ca6b8a16b7194786a049dbe7c0f954a">average_gain</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="48f0cc62cf1f307bc27e2b763fde2ff9"></a><!-- doxytag: member="_fors_setting::ron" ref="48f0cc62cf1f307bc27e2b763fde2ff9" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#48f0cc62cf1f307bc27e2b763fde2ff9">ron</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c428e840229505860fe05635e655d3e8"></a><!-- doxytag: member="_fors_setting::pixel_scale" ref="c428e840229505860fe05635e655d3e8" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#c428e840229505860fe05635e655d3e8">pixel_scale</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="aa40f494f6270154210834327570d1d9"></a><!-- doxytag: member="_fors_setting::read_clock" ref="aa40f494f6270154210834327570d1d9" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#aa40f494f6270154210834327570d1d9">read_clock</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="63615ac294098f035cb785ecde914764"></a><!-- doxytag: member="_fors_setting::chip_id" ref="63615ac294098f035cb785ecde914764" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#63615ac294098f035cb785ecde914764">chip_id</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="71e5a08f6555f8dc795c0596940e8e1e"></a><!-- doxytag: member="_fors_setting::instrument" ref="71e5a08f6555f8dc795c0596940e8e1e" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#71e5a08f6555f8dc795c0596940e8e1e">instrument</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3faf704fd94641cd71fd637672b8dbed"></a><!-- doxytag: member="_fors_setting::version" ref="3faf704fd94641cd71fd637672b8dbed" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__setting.html#3faf704fd94641cd71fd637672b8dbed">version</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__setting_8h-source.html#l00047">47</a> of file <a class="el" href="fors__setting_8h-source.html">fors_setting.h</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__setting_8h-source.html">fors_setting.h</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_fors_setting Struct Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a04188f2c5738d1f6092a7a578f8229f5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a04188f2c5738d1f6092a7a578f8229f5"></a>
+int </td><td class="memItemRight" valign="bottom"><b>binx</b></td></tr>
+<tr class="separator:a04188f2c5738d1f6092a7a578f8229f5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a19b3bfb18d923d08670897a7112ae7d0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a19b3bfb18d923d08670897a7112ae7d0"></a>
+int </td><td class="memItemRight" valign="bottom"><b>biny</b></td></tr>
+<tr class="separator:a19b3bfb18d923d08670897a7112ae7d0"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:afa4b9f6616d7219b907a39644c30d86e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afa4b9f6616d7219b907a39644c30d86e"></a>
+int </td><td class="memItemRight" valign="bottom"><b>prescan_x</b></td></tr>
+<tr class="separator:afa4b9f6616d7219b907a39644c30d86e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a460677f3aa1cb2bbccbaf5508a29fad5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a460677f3aa1cb2bbccbaf5508a29fad5"></a>
+int </td><td class="memItemRight" valign="bottom"><b>prescan_y</b></td></tr>
+<tr class="separator:a460677f3aa1cb2bbccbaf5508a29fad5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a6019c0c5914b4a9f6c620f98a84c5dc3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6019c0c5914b4a9f6c620f98a84c5dc3"></a>
+char </td><td class="memItemRight" valign="bottom"><b>filterband</b></td></tr>
+<tr class="separator:a6019c0c5914b4a9f6c620f98a84c5dc3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a864b35bebb983c86c7c81581601638e2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a864b35bebb983c86c7c81581601638e2"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>filter_name</b></td></tr>
+<tr class="separator:a864b35bebb983c86c7c81581601638e2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ab1ad3713ba9b86216cea5aa225500c69"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab1ad3713ba9b86216cea5aa225500c69"></a>
+double </td><td class="memItemRight" valign="bottom"><b>exposure_time</b></td></tr>
+<tr class="separator:ab1ad3713ba9b86216cea5aa225500c69"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ab3110a9852713777090e0031eb4cf057"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab3110a9852713777090e0031eb4cf057"></a>
+double </td><td class="memItemRight" valign="bottom"><b>average_gain</b></td></tr>
+<tr class="separator:ab3110a9852713777090e0031eb4cf057"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ae9590b2375ae5ca7ae94801da9ad76fd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae9590b2375ae5ca7ae94801da9ad76fd"></a>
+double </td><td class="memItemRight" valign="bottom"><b>ron</b></td></tr>
+<tr class="separator:ae9590b2375ae5ca7ae94801da9ad76fd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ae59b404fa0dba639061578c018d065c3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae59b404fa0dba639061578c018d065c3"></a>
+double </td><td class="memItemRight" valign="bottom"><b>pixel_scale</b></td></tr>
+<tr class="separator:ae59b404fa0dba639061578c018d065c3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a34aa5b8ca5d983d3331a702eb2252540"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a34aa5b8ca5d983d3331a702eb2252540"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>read_clock</b></td></tr>
+<tr class="separator:a34aa5b8ca5d983d3331a702eb2252540"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a15ba32ac8b198b9dd15338891d855349"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a15ba32ac8b198b9dd15338891d855349"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>chip_id</b></td></tr>
+<tr class="separator:a15ba32ac8b198b9dd15338891d855349"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ab38c5f7885683ddd1d1a7dc27fb2ba2b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab38c5f7885683ddd1d1a7dc27fb2ba2b"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>instrument</b></td></tr>
+<tr class="separator:ab38c5f7885683ddd1d1a7dc27fb2ba2b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a2c3c730074609891796a3fb28138f425"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2c3c730074609891796a3fb28138f425"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>version</b></td></tr>
+<tr class="separator:a2c3c730074609891796a3fb28138f425"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__setting_8h_source.html#l00047">47</a> of file <a class="el" href="fors__setting_8h_source.html">fors_setting.h</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__setting_8h_source.html">fors_setting.h</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__fors__star.html b/html/struct__fors__star.html
index 156740e..f8941b2 100644
--- a/html/struct__fors__star.html
+++ b/html/struct__fors__star.html
@@ -1,73 +1,106 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _fors_star Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_fors_star Struct Reference</h1><!-- doxytag: class="_fors_star" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8eb7acd75fc4f6b4b2dc215e46e699f0"></a><!-- doxytag: member="_fors_star::pixel" ref="8eb7acd75fc4f6b4b2dc215e46e699f0" args="" -->
-fors_point * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#8eb7acd75fc4f6b4b2dc215e46e699f0">pixel</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b5357dc5aaf3b7b6edc89d700d563a2c"></a><!-- doxytag: member="_fors_star::semi_major" ref="b5357dc5aaf3b7b6edc89d700d563a2c" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#b5357dc5aaf3b7b6edc89d700d563a2c">semi_major</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="532b4911a7308d705f01ba1da7bc35a1"></a><!-- doxytag: member="_fors_star::semi_minor" ref="532b4911a7308d705f01ba1da7bc35a1" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#532b4911a7308d705f01ba1da7bc35a1">semi_minor</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4bb929a1553cd3239fcf18112c699200"></a><!-- doxytag: member="_fors_star::fwhm" ref="4bb929a1553cd3239fcf18112c699200" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#4bb929a1553cd3239fcf18112c699200">fwhm</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cd353ab887426dc767a89db51164271a"></a><!-- doxytag: member="_fors_star::stellarity_index" ref="cd353ab887426dc767a89db51164271a" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#cd353ab887426dc767a89db51164271a">stellarity_index</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="25c48bcbeb48ed5d535e715866f06810"></a><!-- doxytag: member="_fors_star::orientation" ref="25c48bcbeb48ed5d535e715866f06810" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#25c48bcbeb48ed5d535e715866f06810">orientation</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5c02410e97fad56da6c11439ebaacc35"></a><!-- doxytag: member="_fors_star::magnitude" ref="5c02410e97fad56da6c11439ebaacc35" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#5c02410e97fad56da6c11439ebaacc35">magnitude</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3a3fa291c950c20795bae330685e7bfa"></a><!-- doxytag: member="_fors_star::dmagnitude" ref="3a3fa291c950c20795bae330685e7bfa" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#3a3fa291c950c20795bae330685e7bfa">dmagnitude</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="20a78115ec557bc3cf1e723619516eb6"></a><!-- doxytag: member="_fors_star::magnitude_corr" ref="20a78115ec557bc3cf1e723619516eb6" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#20a78115ec557bc3cf1e723619516eb6">magnitude_corr</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ee281335ef4e49be1cfb5caf7f96d7c3"></a><!-- doxytag: member="_fors_star::dmagnitude_corr" ref="ee281335ef4e49be1cfb5caf7f96d7c3" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#ee281335ef4e49be1cfb5caf7f96d7c3">dmagnitude_corr</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="82910b82de5851e8f59e40b205b6f829"></a><!-- doxytag: member="_fors_star::weight" ref="82910b82de5851e8f59e40b205b6f829" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#82910b82de5851e8f59e40b205b6f829">weight</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9f8fa22dea9a756f1d5f791d697a0135"></a><!-- doxytag: member="_fors_star::id" ref="9f8fa22dea9a756f1d5f791d697a0135" args="" -->
-const fors_std_star * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__star.html#9f8fa22dea9a756f1d5f791d697a0135">id</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__star_8h-source.html#l00035">35</a> of file <a class="el" href="fors__star_8h-source.html">fors_star.h</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__star_8h-source.html">fors_star.h</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_fors_star Struct Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:ae3f5db0d44371b78ea7b9a48d3959d59"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae3f5db0d44371b78ea7b9a48d3959d59"></a>
+fors_point * </td><td class="memItemRight" valign="bottom"><b>pixel</b></td></tr>
+<tr class="separator:ae3f5db0d44371b78ea7b9a48d3959d59"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a197ac0fb50916f94924f82b189a03ee3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a197ac0fb50916f94924f82b189a03ee3"></a>
+double </td><td class="memItemRight" valign="bottom"><b>semi_major</b></td></tr>
+<tr class="separator:a197ac0fb50916f94924f82b189a03ee3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a4897b86d4c154c0764b80c1ddcab20e1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4897b86d4c154c0764b80c1ddcab20e1"></a>
+double </td><td class="memItemRight" valign="bottom"><b>semi_minor</b></td></tr>
+<tr class="separator:a4897b86d4c154c0764b80c1ddcab20e1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ab863d4543dc50ff8fd46622ded9c7200"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab863d4543dc50ff8fd46622ded9c7200"></a>
+double </td><td class="memItemRight" valign="bottom"><b>fwhm</b></td></tr>
+<tr class="separator:ab863d4543dc50ff8fd46622ded9c7200"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a8dd06110ea67874e1272756d9f4d819c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8dd06110ea67874e1272756d9f4d819c"></a>
+double </td><td class="memItemRight" valign="bottom"><b>stellarity_index</b></td></tr>
+<tr class="separator:a8dd06110ea67874e1272756d9f4d819c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a92513c57462f561ade748dc83b98a126"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a92513c57462f561ade748dc83b98a126"></a>
+double </td><td class="memItemRight" valign="bottom"><b>orientation</b></td></tr>
+<tr class="separator:a92513c57462f561ade748dc83b98a126"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ab84e2da9886ebd2a68c33fa69a7b55da"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab84e2da9886ebd2a68c33fa69a7b55da"></a>
+double </td><td class="memItemRight" valign="bottom"><b>magnitude</b></td></tr>
+<tr class="separator:ab84e2da9886ebd2a68c33fa69a7b55da"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a15ddd137fee3e1925e9722057366b29b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a15ddd137fee3e1925e9722057366b29b"></a>
+double </td><td class="memItemRight" valign="bottom"><b>dmagnitude</b></td></tr>
+<tr class="separator:a15ddd137fee3e1925e9722057366b29b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a67fbc8534a37685e633bf46d315a25cd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a67fbc8534a37685e633bf46d315a25cd"></a>
+double </td><td class="memItemRight" valign="bottom"><b>magnitude_corr</b></td></tr>
+<tr class="separator:a67fbc8534a37685e633bf46d315a25cd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ad591125b3daa76904f0def386a7b361b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad591125b3daa76904f0def386a7b361b"></a>
+double </td><td class="memItemRight" valign="bottom"><b>dmagnitude_corr</b></td></tr>
+<tr class="separator:ad591125b3daa76904f0def386a7b361b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a45e679977d24d14f293e0d881dada47a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a45e679977d24d14f293e0d881dada47a"></a>
+double </td><td class="memItemRight" valign="bottom"><b>weight</b></td></tr>
+<tr class="separator:a45e679977d24d14f293e0d881dada47a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a8ea1d278cd06279fe37bf56238a9f6d8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8ea1d278cd06279fe37bf56238a9f6d8"></a>
+const fors_std_star * </td><td class="memItemRight" valign="bottom"><b>id</b></td></tr>
+<tr class="separator:a8ea1d278cd06279fe37bf56238a9f6d8"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__star_8h_source.html#l00035">35</a> of file <a class="el" href="fors__star_8h_source.html">fors_star.h</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__star_8h_source.html">fors_star.h</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__fors__std__star.html b/html/struct__fors__std__star.html
index c8fa521..f3f53a9 100644
--- a/html/struct__fors__std__star.html
+++ b/html/struct__fors__std__star.html
@@ -1,73 +1,106 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _fors_std_star Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_fors_std_star Struct Reference</h1><!-- doxytag: class="_fors_std_star" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="839aff9010bc6a6e44b5b23df543aa35"></a><!-- doxytag: member="_fors_std_star::pixel" ref="839aff9010bc6a6e44b5b23df543aa35" args="" -->
-fors_point * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#839aff9010bc6a6e44b5b23df543aa35">pixel</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="691cac5c703384c5f731f37a264943fd"></a><!-- doxytag: member="_fors_std_star::ra" ref="691cac5c703384c5f731f37a264943fd" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#691cac5c703384c5f731f37a264943fd">ra</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="af20d4b52c06758c47ca0847f77ea03e"></a><!-- doxytag: member="_fors_std_star::dec" ref="af20d4b52c06758c47ca0847f77ea03e" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#af20d4b52c06758c47ca0847f77ea03e">dec</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2d3e959920d6aecfb5c6ae7ade4e8242"></a><!-- doxytag: member="_fors_std_star::magnitude" ref="2d3e959920d6aecfb5c6ae7ade4e8242" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#2d3e959920d6aecfb5c6ae7ade4e8242">magnitude</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0daa0413ccc6df832707e97c52cbe8f7"></a><!-- doxytag: member="_fors_std_star::dmagnitude" ref="0daa0413ccc6df832707e97c52cbe8f7" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#0daa0413ccc6df832707e97c52cbe8f7">dmagnitude</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="572834d8779cf03a23be21e86c58dd7f"></a><!-- doxytag: member="_fors_std_star::cat_magnitude" ref="572834d8779cf03a23be21e86c58dd7f" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#572834d8779cf03a23be21e86c58dd7f">cat_magnitude</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4d258c07f6a7bb5b17f4bd0c7faf75a8"></a><!-- doxytag: member="_fors_std_star::dcat_magnitude" ref="4d258c07f6a7bb5b17f4bd0c7faf75a8" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#4d258c07f6a7bb5b17f4bd0c7faf75a8">dcat_magnitude</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a8620d2a99065a638abe790fd240f5d2"></a><!-- doxytag: member="_fors_std_star::color" ref="a8620d2a99065a638abe790fd240f5d2" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#a8620d2a99065a638abe790fd240f5d2">color</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4dbabb1e3ade361a611e54f51aeb2781"></a><!-- doxytag: member="_fors_std_star::dcolor" ref="4dbabb1e3ade361a611e54f51aeb2781" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#4dbabb1e3ade361a611e54f51aeb2781">dcolor</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7f673b38b2ce3af3959eab9ccf97a356"></a><!-- doxytag: member="_fors_std_star::cov_catm_color" ref="7f673b38b2ce3af3959eab9ccf97a356" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#7f673b38b2ce3af3959eab9ccf97a356">cov_catm_color</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5507a5a98a7739b0c1f9c2a97eb75c42"></a><!-- doxytag: member="_fors_std_star::name" ref="5507a5a98a7739b0c1f9c2a97eb75c42" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#5507a5a98a7739b0c1f9c2a97eb75c42">name</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1d7de44e88c02bc012ef3d75a9e43eed"></a><!-- doxytag: member="_fors_std_star::trusted" ref="1d7de44e88c02bc012ef3d75a9e43eed" args="" -->
-bool </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__fors__std__star.html#1d7de44e88c02bc012ef3d75a9e43eed">trusted</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__std__star_8h-source.html#l00039">39</a> of file <a class="el" href="fors__std__star_8h-source.html">fors_std_star.h</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__std__star_8h-source.html">fors_std_star.h</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_fors_std_star Struct Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:aea102ea39ac9dabba780b1987f482a16"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aea102ea39ac9dabba780b1987f482a16"></a>
+fors_point * </td><td class="memItemRight" valign="bottom"><b>pixel</b></td></tr>
+<tr class="separator:aea102ea39ac9dabba780b1987f482a16"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:adbe20f51d01cd493bc9509c4a771f0aa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adbe20f51d01cd493bc9509c4a771f0aa"></a>
+double </td><td class="memItemRight" valign="bottom"><b>ra</b></td></tr>
+<tr class="separator:adbe20f51d01cd493bc9509c4a771f0aa"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a850580aa41a7d879eb83fd60d848feeb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a850580aa41a7d879eb83fd60d848feeb"></a>
+double </td><td class="memItemRight" valign="bottom"><b>dec</b></td></tr>
+<tr class="separator:a850580aa41a7d879eb83fd60d848feeb"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:afcf8a50010ad0c894c17b6fc6d0bd227"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afcf8a50010ad0c894c17b6fc6d0bd227"></a>
+double </td><td class="memItemRight" valign="bottom"><b>magnitude</b></td></tr>
+<tr class="separator:afcf8a50010ad0c894c17b6fc6d0bd227"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a953ef25f539347013280e7c21d2920cd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a953ef25f539347013280e7c21d2920cd"></a>
+double </td><td class="memItemRight" valign="bottom"><b>dmagnitude</b></td></tr>
+<tr class="separator:a953ef25f539347013280e7c21d2920cd"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ae67a7a23ee09dd01326802d33bf65b08"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae67a7a23ee09dd01326802d33bf65b08"></a>
+double </td><td class="memItemRight" valign="bottom"><b>cat_magnitude</b></td></tr>
+<tr class="separator:ae67a7a23ee09dd01326802d33bf65b08"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a44c1966a4b6b9e850e25ae7a361af35b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a44c1966a4b6b9e850e25ae7a361af35b"></a>
+double </td><td class="memItemRight" valign="bottom"><b>dcat_magnitude</b></td></tr>
+<tr class="separator:a44c1966a4b6b9e850e25ae7a361af35b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ae731ce7c8647ca73dce568c935ca8470"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae731ce7c8647ca73dce568c935ca8470"></a>
+double </td><td class="memItemRight" valign="bottom"><b>color</b></td></tr>
+<tr class="separator:ae731ce7c8647ca73dce568c935ca8470"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a76d13f45de0ac772c7d4fe1fda4cdf6c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a76d13f45de0ac772c7d4fe1fda4cdf6c"></a>
+double </td><td class="memItemRight" valign="bottom"><b>dcolor</b></td></tr>
+<tr class="separator:a76d13f45de0ac772c7d4fe1fda4cdf6c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a579256e995dc04bd914d39d5aca89bc3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a579256e995dc04bd914d39d5aca89bc3"></a>
+double </td><td class="memItemRight" valign="bottom"><b>cov_catm_color</b></td></tr>
+<tr class="separator:a579256e995dc04bd914d39d5aca89bc3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ac5b93743c2acada36da7bc7a1813d49a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac5b93743c2acada36da7bc7a1813d49a"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>name</b></td></tr>
+<tr class="separator:ac5b93743c2acada36da7bc7a1813d49a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:aa289151fdd925b93c934f8435fd6311f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa289151fdd925b93c934f8435fd6311f"></a>
+bool </td><td class="memItemRight" valign="bottom"><b>trusted</b></td></tr>
+<tr class="separator:aa289151fdd925b93c934f8435fd6311f"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__std__star_8h_source.html#l00039">39</a> of file <a class="el" href="fors__std__star_8h_source.html">fors_std_star.h</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__std__star_8h_source.html">fors_std_star.h</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__identify__method.html b/html/struct__identify__method.html
index 77a1bac..e809db8 100644
--- a/html/struct__identify__method.html
+++ b/html/struct__identify__method.html
@@ -1,58 +1,88 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _identify_method Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_identify_method Struct Reference<br>
-<small>
-[<a class="el" href="group__fors__identify.html">Source identification</a>]</small>
-</h1><!-- doxytag: class="_identify_method" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ad3758417318402dd98eb910e55d35e8"></a><!-- doxytag: member="_identify_method::ncat" ref="ad3758417318402dd98eb910e55d35e8" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__identify__method.html#ad3758417318402dd98eb910e55d35e8">ncat</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6a2f70f5e0e5a3f34bd0a2ee5d001b8e"></a><!-- doxytag: member="_identify_method::nsource" ref="6a2f70f5e0e5a3f34bd0a2ee5d001b8e" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__identify__method.html#6a2f70f5e0e5a3f34bd0a2ee5d001b8e">nsource</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1aae6e461fafcb0388b343e5d94adbe6"></a><!-- doxytag: member="_identify_method::kappa" ref="1aae6e461fafcb0388b343e5d94adbe6" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__identify__method.html#1aae6e461fafcb0388b343e5d94adbe6">kappa</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8fc2dc70bc04cb6ff4404d394febc4b8"></a><!-- doxytag: member="_identify_method::search" ref="8fc2dc70bc04cb6ff4404d394febc4b8" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__identify__method.html#8fc2dc70bc04cb6ff4404d394febc4b8">search</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6dc2396ebd18713f47a577e819f02583"></a><!-- doxytag: member="_identify_method::max_search" ref="6dc2396ebd18713f47a577e819f02583" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__identify__method.html#6dc2396ebd18713f47a577e819f02583">max_search</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d938db4c3b29c4365da3b57bec477970"></a><!-- doxytag: member="_identify_method::max_offset" ref="d938db4c3b29c4365da3b57bec477970" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__identify__method.html#d938db4c3b29c4365da3b57bec477970">max_offset</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__identify_8c-source.html#l00052">52</a> of file <a class="el" href="fors__identify_8c-source.html">fors_identify.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__identify_8c-source.html">fors_identify.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_identify_method Struct Reference<div class="ingroups"><a class="el" href="group__fors__identify.html">Source identification</a></div></div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a98ec6209ab8334189fdeb0ba9ad6db62"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a98ec6209ab8334189fdeb0ba9ad6db62"></a>
+int </td><td class="memItemRight" valign="bottom"><b>ncat</b></td></tr>
+<tr class="separator:a98ec6209ab8334189fdeb0ba9ad6db62"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a42bd374120c9b0d6c6798af05c91551a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a42bd374120c9b0d6c6798af05c91551a"></a>
+double </td><td class="memItemRight" valign="bottom"><b>nsource</b></td></tr>
+<tr class="separator:a42bd374120c9b0d6c6798af05c91551a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a7c4345b693fd891d4f343eaddc34979e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7c4345b693fd891d4f343eaddc34979e"></a>
+double </td><td class="memItemRight" valign="bottom"><b>kappa</b></td></tr>
+<tr class="separator:a7c4345b693fd891d4f343eaddc34979e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a751e9793a2bf184209201ec0403db027"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a751e9793a2bf184209201ec0403db027"></a>
+double </td><td class="memItemRight" valign="bottom"><b>search</b></td></tr>
+<tr class="separator:a751e9793a2bf184209201ec0403db027"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a9b637dbee7a14e588182802a46a33fc9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9b637dbee7a14e588182802a46a33fc9"></a>
+double </td><td class="memItemRight" valign="bottom"><b>max_search</b></td></tr>
+<tr class="separator:a9b637dbee7a14e588182802a46a33fc9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a54fd4d467ce3b51859fb581b23d384b4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a54fd4d467ce3b51859fb581b23d384b4"></a>
+double </td><td class="memItemRight" valign="bottom"><b>max_offset</b></td></tr>
+<tr class="separator:a54fd4d467ce3b51859fb581b23d384b4"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__identify_8c_source.html#l00052">52</a> of file <a class="el" href="fors__identify_8c_source.html">fors_identify.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__identify_8c_source.html">fors_identify.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/struct__stack__method.html b/html/struct__stack__method.html
index ad9028c..11f067c 100644
--- a/html/struct__stack__method.html
+++ b/html/struct__stack__method.html
@@ -1,85 +1,106 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: _stack_method Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>_stack_method Struct Reference</h1><!-- doxytag: class="_stack_method" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="07e81b74bb830636f1a7fb0876f6e30ce0fbf49545fae912cc72e904e11c61bc"></a><!-- doxytag: member="_stack_method::AVERAGE" ref="07e81b74bb830636f1a7fb0876f6e30ce0fbf49545fae912cc72e904e11c61bc" args="" -->
- </td><td class="memItemRight" valign="bottom"><b>AVERAGE</b></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="07e81b74bb830636f1a7fb0876f6e30c1a20460e7e0cdb04a7e88ecef3d91296"></a><!-- doxytag: member="_stack_method::MEDIAN" ref="07e81b74bb830636f1a7fb0876f6e30c1a20460e7e0cdb04a7e88ecef3d91296" args="" -->
- </td><td class="memItemRight" valign="bottom"><b>MEDIAN</b></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="07e81b74bb830636f1a7fb0876f6e30c6d85c5253250a230c7b3cadf5a694abb"></a><!-- doxytag: member="_stack_method::MINMAX" ref="07e81b74bb830636f1a7fb0876f6e30c6d85c5253250a230c7b3cadf5a694abb" args="" -->
- </td><td class="memItemRight" valign="bottom"><b>MINMAX</b></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="07e81b74bb830636f1a7fb0876f6e30c3d5578100831b50415edbc0db7835805"></a><!-- doxytag: member="_stack_method::KSIGMA" ref="07e81b74bb830636f1a7fb0876f6e30c3d5578100831b50415edbc0db7835805" args="" -->
- </td><td class="memItemRight" valign="bottom"><b>KSIGMA</b></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom">{ <b>AVERAGE</b>, 
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-types">Public Types</a> |
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">_stack_method Struct Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
+Public Types</h2></td></tr>
+<tr class="memitem:aa4ea86d6dbea5b71f1706a87fcfc0044"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom">{ <b>AVERAGE</b>, 
 <b>MEDIAN</b>, 
 <b>MINMAX</b>, 
 <b>KSIGMA</b>
  }</td></tr>
-
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8f15c3d7dcf260093faaa4b726e3ac2f"></a><!-- doxytag: member="_stack_method::method" ref="8f15c3d7dcf260093faaa4b726e3ac2f" args="" -->
-enum _stack_method:: { ... }  </td><td class="memItemRight" valign="bottom"><b>method</b></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6f98f0a2b57c86e519dc8bdf9885ab7b"></a><!-- doxytag: member="_stack_method::method_name" ref="6f98f0a2b57c86e519dc8bdf9885ab7b" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__stack__method.html#6f98f0a2b57c86e519dc8bdf9885ab7b">method_name</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap><a class="anchor" name="735b27b10eeb7d3a545c7cc1d14c143a"></a><!-- doxytag: member="_stack_method::pars" ref="735b27b10eeb7d3a545c7cc1d14c143a" args="" -->
+<tr class="separator:aa4ea86d6dbea5b71f1706a87fcfc0044"><td class="memSeparator" colspan="2"> </td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a1ef465157d5630ba9517e8ef2b41a9fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1ef465157d5630ba9517e8ef2b41a9fe"></a>
+enum _stack_method:: { ... }  </td><td class="memItemRight" valign="bottom"><b>method</b></td></tr>
+<tr class="separator:a1ef465157d5630ba9517e8ef2b41a9fe"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a1e2b6c25ab659ca91223e1553c9952b4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1e2b6c25ab659ca91223e1553c9952b4"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>method_name</b></td></tr>
+<tr class="separator:a1e2b6c25ab659ca91223e1553c9952b4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ae9a565dbc8376609af43fe07ed0f0213"><td class="memItemLeft" ><a class="anchor" id="ae9a565dbc8376609af43fe07ed0f0213"></a>
 union {</td></tr>
-
-<tr><td class="memItemLeft" nowrap>   struct {</td></tr>
-
-<tr><td class="memItemLeft" nowrap>      int   <a class="el" href="struct__stack__method.html#32a13b1823d0d86b5c26ff14f8be9eb0">min_reject</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap>      int   <a class="el" href="struct__stack__method.html#dd4b2d1c1a6e255b16a122464c489ac3">max_reject</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap valign="top">   }   <b>minmax</b></td></tr>
-
-<tr><td class="memItemLeft" nowrap>   struct {</td></tr>
-
-<tr><td class="memItemLeft" nowrap>      double   <a class="el" href="struct__stack__method.html#41f6ab3a4ca6f07365f32d63bbe20de3">klow</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap>      double   <a class="el" href="struct__stack__method.html#236ce050034e112bb1d000de525a7895">khigh</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap>      int   <a class="el" href="struct__stack__method.html#b98c63a3bb7288969c818ee3653a482b">kiter</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap valign="top">   }   <b>ksigma</b></td></tr>
-
-<tr><td class="memItemLeft" nowrap valign="top">} </td><td class="memItemRight" valign="bottom"><b>pars</b></td></tr>
-
+<tr class="memitem:a572f3c43929923f9732fe00b3e57c080"><td class="memItemLeft" >   struct {</td></tr>
+<tr class="memitem:a066b22746d5f733b67f1767f6d79d37e"><td class="memItemLeft" >      int   <b>min_reject</b></td></tr>
+<tr class="separator:a066b22746d5f733b67f1767f6d79d37e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a17b15a6f45e60380f03d296bb5b1cbee"><td class="memItemLeft" >      int   <b>max_reject</b></td></tr>
+<tr class="separator:a17b15a6f45e60380f03d296bb5b1cbee"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a572f3c43929923f9732fe00b3e57c080"><td class="memItemLeft" valign="top">   }   <b>minmax</b></td></tr>
+<tr class="separator:a572f3c43929923f9732fe00b3e57c080"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a24bae3cb72e8f2679954b49c00e24168"><td class="memItemLeft" >   struct {</td></tr>
+<tr class="memitem:aa2e10ceb07fa293de6617686f742615b"><td class="memItemLeft" >      double   <b>klow</b></td></tr>
+<tr class="separator:aa2e10ceb07fa293de6617686f742615b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a7d9221a7c5867b2ebf2b41b531572a5b"><td class="memItemLeft" >      double   <b>khigh</b></td></tr>
+<tr class="separator:a7d9221a7c5867b2ebf2b41b531572a5b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a4436e3a6bd81e2c6e289349fac76787c"><td class="memItemLeft" >      int   <b>kiter</b></td></tr>
+<tr class="separator:a4436e3a6bd81e2c6e289349fac76787c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a24bae3cb72e8f2679954b49c00e24168"><td class="memItemLeft" valign="top">   }   <b>ksigma</b></td></tr>
+<tr class="separator:a24bae3cb72e8f2679954b49c00e24168"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ae9a565dbc8376609af43fe07ed0f0213"><td class="memItemLeft" valign="top">} </td><td class="memItemRight" valign="bottom"><b>pars</b></td></tr>
+<tr class="separator:ae9a565dbc8376609af43fe07ed0f0213"><td class="memSeparator" colspan="2"> </td></tr>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__stack_8h-source.html#l00036">36</a> of file <a class="el" href="fors__stack_8h-source.html">fors_stack.h</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__stack_8h-source.html">fors_stack.h</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__stack_8h_source.html#l00036">36</a> of file <a class="el" href="fors__stack_8h_source.html">fors_stack.h</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__stack_8h_source.html">fors_stack.h</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/structband__jacobian.html b/html/structband__jacobian.html
index 5a1bf73..68f0b4c 100644
--- a/html/structband__jacobian.html
+++ b/html/structband__jacobian.html
@@ -1,46 +1,79 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: band_jacobian Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>band_jacobian Struct Reference</h1><!-- doxytag: class="band_jacobian" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b448380c1a9359906b9d6739074ee4b4"></a><!-- doxytag: member="band_jacobian::band" ref="b448380c1a9359906b9d6739074ee4b4" args="" -->
-char </td><td class="memItemRight" valign="bottom"><a class="el" href="structband__jacobian.html#b448380c1a9359906b9d6739074ee4b4">band</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a55c1f441e0583da81dc8e736a890beb"></a><!-- doxytag: member="band_jacobian::mag" ref="a55c1f441e0583da81dc8e736a890beb" args="[6]" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="structband__jacobian.html#a55c1f441e0583da81dc8e736a890beb">mag</a> [6]</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="81d02268a4a5d5366b43d30714ed4f7f"></a><!-- doxytag: member="band_jacobian::col" ref="81d02268a4a5d5366b43d30714ed4f7f" args="[6]" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="structband__jacobian.html#81d02268a4a5d5366b43d30714ed4f7f">col</a> [6]</td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__std__cat_8c-source.html#l00044">44</a> of file <a class="el" href="fors__std__cat_8c-source.html">fors_std_cat.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__std__cat_8c-source.html">fors_std_cat.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">band_jacobian Struct Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:ac3721fe3669edde3ff7375c79edb60b9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac3721fe3669edde3ff7375c79edb60b9"></a>
+char </td><td class="memItemRight" valign="bottom"><b>band</b></td></tr>
+<tr class="separator:ac3721fe3669edde3ff7375c79edb60b9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a5a22b2fe8df6300f3d1a2a596a019e70"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5a22b2fe8df6300f3d1a2a596a019e70"></a>
+double </td><td class="memItemRight" valign="bottom"><b>mag</b> [6]</td></tr>
+<tr class="separator:a5a22b2fe8df6300f3d1a2a596a019e70"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a459ddad4e01b8e99a0486f9b03d236ed"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a459ddad4e01b8e99a0486f9b03d236ed"></a>
+double </td><td class="memItemRight" valign="bottom"><b>col</b> [6]</td></tr>
+<tr class="separator:a459ddad4e01b8e99a0486f9b03d236ed"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__std__cat_8c_source.html#l00044">44</a> of file <a class="el" href="fors__std__cat_8c_source.html">fors_std_cat.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__std__cat_8c_source.html">fors_std_cat.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/structentry.html b/html/structentry.html
index d8ca451..7fcf081 100644
--- a/html/structentry.html
+++ b/html/structentry.html
@@ -1,64 +1,94 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: entry Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>entry Struct Reference<br>
-<small>
-[<a class="el" href="group__fors__photometry.html">fors_recipe Recipe</a>]</small>
-</h1><!-- doxytag: class="entry" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a5ff98ece2ee0ea23eef6c528d900511"></a><!-- doxytag: member="entry::frame_index" ref="a5ff98ece2ee0ea23eef6c528d900511" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="structentry.html#a5ff98ece2ee0ea23eef6c528d900511">frame_index</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="93ac7b32d1aa3fd048fbcaead85dc5f2"></a><!-- doxytag: member="entry::star_index" ref="93ac7b32d1aa3fd048fbcaead85dc5f2" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="structentry.html#93ac7b32d1aa3fd048fbcaead85dc5f2">star_index</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8a6caa99104ae8158e71eff2e92e8fba"></a><!-- doxytag: member="entry::atm_ext_index" ref="8a6caa99104ae8158e71eff2e92e8fba" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="structentry.html#8a6caa99104ae8158e71eff2e92e8fba">atm_ext_index</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c85d7b45722824c52fdaa4754c8d64ee"></a><!-- doxytag: member="entry::atm_ext_identifier" ref="c85d7b45722824c52fdaa4754c8d64ee" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="structentry.html#c85d7b45722824c52fdaa4754c8d64ee">atm_ext_identifier</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6f585239f5d6905b0cff05055d77bf9c"></a><!-- doxytag: member="entry::airmass" ref="6f585239f5d6905b0cff05055d77bf9c" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="structentry.html#6f585239f5d6905b0cff05055d77bf9c">airmass</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9094c40ac744faa1135a2773f85ba1ff"></a><!-- doxytag: member="entry::gain" ref="9094c40ac744faa1135a2773f85ba1ff" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="structentry.html#9094c40ac744faa1135a2773f85ba1ff">gain</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3e422ef6bc06e1e9c3d2dad3ec2f972b"></a><!-- doxytag: member="entry::exptime" ref="3e422ef6bc06e1e9c3d2dad3ec2f972b" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="structentry.html#3e422ef6bc06e1e9c3d2dad3ec2f972b">exptime</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b26c29f16a6c2e5baa1b2c642d8df685"></a><!-- doxytag: member="entry::star" ref="b26c29f16a6c2e5baa1b2c642d8df685" args="" -->
-<a class="el" href="struct__fors__star.html">fors_star</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="structentry.html#b26c29f16a6c2e5baa1b2c642d8df685">star</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00091">91</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">entry Struct Reference<div class="ingroups"><a class="el" href="group__fors__photometry.html">fors_recipe Recipe</a></div></div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a1172414515f8a0f0c911c6b3836ddc8d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1172414515f8a0f0c911c6b3836ddc8d"></a>
+int </td><td class="memItemRight" valign="bottom"><b>frame_index</b></td></tr>
+<tr class="separator:a1172414515f8a0f0c911c6b3836ddc8d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a7cd70b41d3e63bdce7316482b08ed1e3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7cd70b41d3e63bdce7316482b08ed1e3"></a>
+int </td><td class="memItemRight" valign="bottom"><b>star_index</b></td></tr>
+<tr class="separator:a7cd70b41d3e63bdce7316482b08ed1e3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a8cfc890cee6e0694b1983d7f295352a8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8cfc890cee6e0694b1983d7f295352a8"></a>
+int </td><td class="memItemRight" valign="bottom"><b>atm_ext_index</b></td></tr>
+<tr class="separator:a8cfc890cee6e0694b1983d7f295352a8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a3de1b684b7ee37db4e7a31928b63996b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3de1b684b7ee37db4e7a31928b63996b"></a>
+int </td><td class="memItemRight" valign="bottom"><b>atm_ext_identifier</b></td></tr>
+<tr class="separator:a3de1b684b7ee37db4e7a31928b63996b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ac96f2f0efc7888f88c739a2f5827f601"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac96f2f0efc7888f88c739a2f5827f601"></a>
+double </td><td class="memItemRight" valign="bottom"><b>airmass</b></td></tr>
+<tr class="separator:ac96f2f0efc7888f88c739a2f5827f601"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a7b1797bb488330f2904878e6256956d7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7b1797bb488330f2904878e6256956d7"></a>
+double </td><td class="memItemRight" valign="bottom"><b>gain</b></td></tr>
+<tr class="separator:a7b1797bb488330f2904878e6256956d7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ab2ba20da0e2b07f5ad756ecbfa4f68a5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab2ba20da0e2b07f5ad756ecbfa4f68a5"></a>
+double </td><td class="memItemRight" valign="bottom"><b>exptime</b></td></tr>
+<tr class="separator:ab2ba20da0e2b07f5ad756ecbfa4f68a5"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a7160e3b4c104ece8465a3bc53055b79f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7160e3b4c104ece8465a3bc53055b79f"></a>
+<a class="el" href="struct__fors__star.html">fors_star</a> * </td><td class="memItemRight" valign="bottom"><b>star</b></td></tr>
+<tr class="separator:a7160e3b4c104ece8465a3bc53055b79f"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00091">91</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/structfors__extract__sky__stats.html b/html/structfors__extract__sky__stats.html
index 5031afd..fa4a6f3 100644
--- a/html/structfors__extract__sky__stats.html
+++ b/html/structfors__extract__sky__stats.html
@@ -1,46 +1,79 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_extract_sky_stats Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>fors_extract_sky_stats Struct Reference</h1><!-- doxytag: class="fors_extract_sky_stats" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b7ca852023d946aa752ef2d3f4f871b9"></a><!-- doxytag: member="fors_extract_sky_stats::mean" ref="b7ca852023d946aa752ef2d3f4f871b9" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__extract__sky__stats.html#b7ca852023d946aa752ef2d3f4f871b9">mean</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2740d8542bb645cc057b43f5016dc174"></a><!-- doxytag: member="fors_extract_sky_stats::median" ref="2740d8542bb645cc057b43f5016dc174" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__extract__sky__stats.html#2740d8542bb645cc057b43f5016dc174">median</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="69ed6753cee271b73c8b7e73a016fdeb"></a><!-- doxytag: member="fors_extract_sky_stats::rms" ref="69ed6753cee271b73c8b7e73a016fdeb" args="" -->
-double </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__extract__sky__stats.html#69ed6753cee271b73c8b7e73a016fdeb">rms</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__extract_8h-source.html#l00040">40</a> of file <a class="el" href="fors__extract_8h-source.html">fors_extract.h</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__extract_8h-source.html">fors_extract.h</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_extract_sky_stats Struct Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a34ef7014753f20e3313c0adc61970b9b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a34ef7014753f20e3313c0adc61970b9b"></a>
+double </td><td class="memItemRight" valign="bottom"><b>mean</b></td></tr>
+<tr class="separator:a34ef7014753f20e3313c0adc61970b9b"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a4b573f007e8305120e3e204a2f0210da"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4b573f007e8305120e3e204a2f0210da"></a>
+double </td><td class="memItemRight" valign="bottom"><b>median</b></td></tr>
+<tr class="separator:a4b573f007e8305120e3e204a2f0210da"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a89ab5c0e95ab5b986fb9fcf872479e2f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a89ab5c0e95ab5b986fb9fcf872479e2f"></a>
+double </td><td class="memItemRight" valign="bottom"><b>rms</b></td></tr>
+<tr class="separator:a89ab5c0e95ab5b986fb9fcf872479e2f"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__extract_8h_source.html#l00040">40</a> of file <a class="el" href="fors__extract_8h_source.html">fors_extract.h</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__extract_8h_source.html">fors_extract.h</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/structfors__filterlist.html b/html/structfors__filterlist.html
index aa79fc5..4b55071 100644
--- a/html/structfors__filterlist.html
+++ b/html/structfors__filterlist.html
@@ -1,43 +1,76 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_filterlist Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>fors_filterlist Struct Reference</h1><!-- doxytag: class="fors_filterlist" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="35bb80c76e8fa9b4526ba6a03fea5520"></a><!-- doxytag: member="fors_filterlist::name" ref="35bb80c76e8fa9b4526ba6a03fea5520" args="[10]" -->
-const char </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__filterlist.html#35bb80c76e8fa9b4526ba6a03fea5520">name</a> [10]</td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="98f2d94bcd86b7376568e913140371ac"></a><!-- doxytag: member="fors_filterlist::band" ref="98f2d94bcd86b7376568e913140371ac" args="" -->
-const char </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__filterlist.html#98f2d94bcd86b7376568e913140371ac">band</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__instrument_8c-source.html#l00035">35</a> of file <a class="el" href="fors__instrument_8c-source.html">fors_instrument.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__instrument_8c-source.html">fors_instrument.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_filterlist Struct Reference</div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:a8e52775ad3bdf1e32a80fc71b5f2d766"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8e52775ad3bdf1e32a80fc71b5f2d766"></a>
+const char </td><td class="memItemRight" valign="bottom"><b>name</b> [10]</td></tr>
+<tr class="separator:a8e52775ad3bdf1e32a80fc71b5f2d766"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a213a35009db999a6c4eb7c5b76f95ae7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a213a35009db999a6c4eb7c5b76f95ae7"></a>
+const char </td><td class="memItemRight" valign="bottom"><b>band</b></td></tr>
+<tr class="separator:a213a35009db999a6c4eb7c5b76f95ae7"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__instrument_8c_source.html#l00035">35</a> of file <a class="el" href="fors__instrument_8c_source.html">fors_instrument.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__instrument_8c_source.html">fors_instrument.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/structfors__fit__ncoeff__paropts.html b/html/structfors__fit__ncoeff__paropts.html
index 70a2525..adee527 100644
--- a/html/structfors__fit__ncoeff__paropts.html
+++ b/html/structfors__fit__ncoeff__paropts.html
@@ -1,52 +1,82 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: fors_fit_ncoeff_paropts Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>fors_fit_ncoeff_paropts Struct Reference<br>
-<small>
-[<a class="el" href="group__fors__photometry.html">fors_recipe Recipe</a>]</small>
-</h1><!-- doxytag: class="fors_fit_ncoeff_paropts" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6fec4d8800eab2df5c1ba89004dc39f1"></a><!-- doxytag: member="fors_fit_ncoeff_paropts::no" ref="6fec4d8800eab2df5c1ba89004dc39f1" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__fit__ncoeff__paropts.html#6fec4d8800eab2df5c1ba89004dc39f1">no</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7bd4d2efd9c7633b9e865404c93f1d90"></a><!-- doxytag: member="fors_fit_ncoeff_paropts::one" ref="7bd4d2efd9c7633b9e865404c93f1d90" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__fit__ncoeff__paropts.html#7bd4d2efd9c7633b9e865404c93f1d90">one</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="08db6598924e76f81aeb0fb4ecf6873d"></a><!-- doxytag: member="fors_fit_ncoeff_paropts::perframe" ref="08db6598924e76f81aeb0fb4ecf6873d" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__fit__ncoeff__paropts.html#08db6598924e76f81aeb0fb4ecf6873d">perframe</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4e5247458b71d9717197e5a15240f029"></a><!-- doxytag: member="fors_fit_ncoeff_paropts::pernight" ref="4e5247458b71d9717197e5a15240f029" args="" -->
-const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="structfors__fit__ncoeff__paropts.html#4e5247458b71d9717197e5a15240f029">pernight</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="fors__photometry__impl_8c-source.html#l00081">81</a> of file <a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="fors__photometry__impl_8c-source.html">fors_photometry_impl.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">fors_fit_ncoeff_paropts Struct Reference<div class="ingroups"><a class="el" href="group__fors__photometry.html">fors_recipe Recipe</a></div></div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:ab76b332d6365e313b87b982ddd8d7e82"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab76b332d6365e313b87b982ddd8d7e82"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>no</b></td></tr>
+<tr class="separator:ab76b332d6365e313b87b982ddd8d7e82"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a08987910ff3a46771ef8be900227a160"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a08987910ff3a46771ef8be900227a160"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>one</b></td></tr>
+<tr class="separator:a08987910ff3a46771ef8be900227a160"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:aaff216c4aa211359f1ea111bd01914f8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaff216c4aa211359f1ea111bd01914f8"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>perframe</b></td></tr>
+<tr class="separator:aaff216c4aa211359f1ea111bd01914f8"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:afdf29f5482d381fad567846d0ecb1d23"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afdf29f5482d381fad567846d0ecb1d23"></a>
+const char * </td><td class="memItemRight" valign="bottom"><b>pernight</b></td></tr>
+<tr class="separator:afdf29f5482d381fad567846d0ecb1d23"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="fors__photometry__impl_8c_source.html#l00081">81</a> of file <a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="fors__photometry__impl_8c_source.html">fors_photometry_impl.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/structlist.html b/html/structlist.html
index 8c14348..8997c96 100644
--- a/html/structlist.html
+++ b/html/structlist.html
@@ -1,58 +1,88 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
 <title>FORS Pipeline Reference Manual: list Struct Reference</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li id="current"><a href="classes.html"><span>Data Structures</span></a></li>
-    <li><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="tabs">
-  <ul>
-    <li><a href="classes.html"><span>Alphabetical List</span></a></li>
-    <li><a href="annotated.html"><span>Data Structures</span></a></li>
-    <li><a href="functions.html"><span>Data Fields</span></a></li>
-  </ul></div>
-<h1>list Struct Reference<br>
-<small>
-[<a class="el" href="group__multiset.html">container type</a>]</small>
-</h1><!-- doxytag: class="list" --><table border="0" cellpadding="0" cellspacing="0">
-<tr><td></td></tr>
-<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8b7019e4a6d5c5134cff43c2629f0547"></a><!-- doxytag: member="list::elements" ref="8b7019e4a6d5c5134cff43c2629f0547" args="" -->
-void ** </td><td class="memItemRight" valign="bottom"><a class="el" href="structlist.html#8b7019e4a6d5c5134cff43c2629f0547">elements</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3b98d0062ec7ef7f69418c7dddbda42d"></a><!-- doxytag: member="list::size" ref="3b98d0062ec7ef7f69418c7dddbda42d" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="structlist.html#3b98d0062ec7ef7f69418c7dddbda42d">size</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="08398e899d83978b0fb79e448b685b32"></a><!-- doxytag: member="list::back" ref="08398e899d83978b0fb79e448b685b32" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="structlist.html#08398e899d83978b0fb79e448b685b32">back</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="87b04e0bab57e6949272df159ee19baf"></a><!-- doxytag: member="list::current" ref="87b04e0bab57e6949272df159ee19baf" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="structlist.html#87b04e0bab57e6949272df159ee19baf">current</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="38d7fad1310a6005cefaa130cce4597a"></a><!-- doxytag: member="list::current_p1" ref="38d7fad1310a6005cefaa130cce4597a" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="structlist.html#38d7fad1310a6005cefaa130cce4597a">current_p1</a></td></tr>
-
-<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4c7d69f3799fe050f143d37a6acd4ff6"></a><!-- doxytag: member="list::current_p2" ref="4c7d69f3799fe050f143d37a6acd4ff6" args="" -->
-int </td><td class="memItemRight" valign="bottom"><a class="el" href="structlist.html#4c7d69f3799fe050f143d37a6acd4ff6">current_p2</a></td></tr>
-
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
 </table>
-<hr><a name="_details"></a><h2>Detailed Description</h2>
-
-<p>
-
-<p>
-Definition at line <a class="el" href="list_8c-source.html#l00074">74</a> of file <a class="el" href="list_8c-source.html">list.c</a>.<hr>The documentation for this struct was generated from the following file:<ul>
-<li><a class="el" href="list_8c-source.html">list.c</a></ul>
-<hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:06 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li><a href="classes.html"><span>Data Structure Index</span></a></li>
+    </ul>
+  </div>
+</div><!-- top -->
+<div class="header">
+  <div class="summary">
+<a href="#pub-attribs">Data Fields</a>  </div>
+  <div class="headertitle">
+<div class="title">list Struct Reference<div class="ingroups"><a class="el" href="group__multiset.html">container type</a></div></div>  </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:aed325b1d7a1acd893dac35006a10ab2c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aed325b1d7a1acd893dac35006a10ab2c"></a>
+void ** </td><td class="memItemRight" valign="bottom"><b>elements</b></td></tr>
+<tr class="separator:aed325b1d7a1acd893dac35006a10ab2c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a3b03adad0c0429bae9493667ff366dc2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3b03adad0c0429bae9493667ff366dc2"></a>
+int </td><td class="memItemRight" valign="bottom"><b>size</b></td></tr>
+<tr class="separator:a3b03adad0c0429bae9493667ff366dc2"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a66cb2432b3119e08ea9d4e8894888e78"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a66cb2432b3119e08ea9d4e8894888e78"></a>
+int </td><td class="memItemRight" valign="bottom"><b>back</b></td></tr>
+<tr class="separator:a66cb2432b3119e08ea9d4e8894888e78"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a1a1cb0ab62efe6895ec181d4ad9ca047"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1a1cb0ab62efe6895ec181d4ad9ca047"></a>
+int </td><td class="memItemRight" valign="bottom"><b>current</b></td></tr>
+<tr class="separator:a1a1cb0ab62efe6895ec181d4ad9ca047"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:abd7376537b236a2681c22a6628a6d704"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd7376537b236a2681c22a6628a6d704"></a>
+int </td><td class="memItemRight" valign="bottom"><b>current_p1</b></td></tr>
+<tr class="separator:abd7376537b236a2681c22a6628a6d704"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a72f124431873b5f1f0b7fad24aa788c6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a72f124431873b5f1f0b7fad24aa788c6"></a>
+int </td><td class="memItemRight" valign="bottom"><b>current_p2</b></td></tr>
+<tr class="separator:a72f124431873b5f1f0b7fad24aa788c6"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock">
+<p>Definition at line <a class="el" href="list_8c_source.html#l00074">74</a> of file <a class="el" href="list_8c_source.html">list.c</a>.</p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="list_8c_source.html">list.c</a></li>
+</ul>
+</div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
 </body>
 </html>
diff --git a/html/sync_off.png b/html/sync_off.png
new file mode 100644
index 0000000..3b443fc
Binary files /dev/null and b/html/sync_off.png differ
diff --git a/html/sync_on.png b/html/sync_on.png
new file mode 100644
index 0000000..e08320f
Binary files /dev/null and b/html/sync_on.png differ
diff --git a/html/tab_a.png b/html/tab_a.png
new file mode 100644
index 0000000..3b725c4
Binary files /dev/null and b/html/tab_a.png differ
diff --git a/html/tab_b.gif b/html/tab_b.gif
deleted file mode 100644
index 0d62348..0000000
Binary files a/html/tab_b.gif and /dev/null differ
diff --git a/html/tab_b.png b/html/tab_b.png
new file mode 100644
index 0000000..e2b4a86
Binary files /dev/null and b/html/tab_b.png differ
diff --git a/html/tab_h.png b/html/tab_h.png
new file mode 100644
index 0000000..fd5cb70
Binary files /dev/null and b/html/tab_h.png differ
diff --git a/html/tab_l.gif b/html/tab_l.gif
deleted file mode 100644
index 9b1e633..0000000
Binary files a/html/tab_l.gif and /dev/null differ
diff --git a/html/tab_r.gif b/html/tab_r.gif
deleted file mode 100644
index ce9dd9f..0000000
Binary files a/html/tab_r.gif and /dev/null differ
diff --git a/html/tab_s.png b/html/tab_s.png
new file mode 100644
index 0000000..ab478c9
Binary files /dev/null and b/html/tab_s.png differ
diff --git a/html/tabs.css b/html/tabs.css
index a61552a..9cf578f 100644
--- a/html/tabs.css
+++ b/html/tabs.css
@@ -1,102 +1,60 @@
-/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */
-
-DIV.tabs
-{
-   float            : left;
-   width            : 100%;
-   background       : url("tab_b.gif") repeat-x bottom;
-   margin-bottom    : 4px;
-}
-
-DIV.tabs UL
-{
-   margin           : 0px;
-   padding-left     : 10px;
-   list-style       : none;
-}
-
-DIV.tabs LI, DIV.tabs FORM
-{
-   display          : inline;
-   margin           : 0px;
-   padding          : 0px;
-}
-
-DIV.tabs FORM
-{
-   float            : right;
+.tabs, .tabs2, .tabs3 {
+    background-image: url('tab_b.png');
+    width: 100%;
+    z-index: 101;
+    font-size: 13px;
+    font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
 }
 
-DIV.tabs A
-{
-   float            : left;
-   background       : url("tab_r.gif") no-repeat right top;
-   border-bottom    : 1px solid #84B0C7;
-   font-size        : x-small;
-   font-weight      : bold;
-   text-decoration  : none;
+.tabs2 {
+    font-size: 10px;
 }
-
-DIV.tabs A:hover
-{
-   background-position: 100% -150px;
+.tabs3 {
+    font-size: 9px;
 }
 
-DIV.tabs A:link, DIV.tabs A:visited,
-DIV.tabs A:active, DIV.tabs A:hover
-{
-       color: #1A419D;
+.tablist {
+    margin: 0;
+    padding: 0;
+    display: table;
 }
 
-DIV.tabs SPAN
-{
-   float            : left;
-   display          : block;
-   background       : url("tab_l.gif") no-repeat left top;
-   padding          : 5px 9px;
-   white-space      : nowrap;
+.tablist li {
+    float: left;
+    display: table-cell;
+    background-image: url('tab_b.png');
+    line-height: 36px;
+    list-style: none;
 }
 
-DIV.tabs INPUT
-{
-   float            : right;
-   display          : inline;
-   font-size        : 1em;
-}
-
-DIV.tabs TD
-{
-   font-size        : x-small;
-   font-weight      : bold;
-   text-decoration  : none;
-}
-
-
-
-/* Commented Backslash Hack hides rule from IE5-Mac \*/
-DIV.tabs SPAN {float : none;}
-/* End IE5-Mac hack */
-
-DIV.tabs A:hover SPAN
-{
-   background-position: 0% -150px;
+.tablist a {
+    display: block;
+    padding: 0 20px;
+    font-weight: bold;
+    background-image:url('tab_s.png');
+    background-repeat:no-repeat;
+    background-position:right;
+    color: #283A5D;
+    text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+    text-decoration: none;
+    outline: none;
 }
 
-DIV.tabs LI#current A
-{
-   background-position: 100% -150px;
-   border-width     : 0px;
+.tabs3 .tablist a {
+    padding: 0 10px;
 }
 
-DIV.tabs LI#current SPAN
-{
-   background-position: 0% -150px;
-   padding-bottom   : 6px;
+.tablist a:hover {
+    background-image: url('tab_h.png');
+    background-repeat:repeat-x;
+    color: #fff;
+    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
+    text-decoration: none;
 }
 
-DIV.nav
-{
-   background       : none;
-   border           : none;
-   border-bottom    : 1px solid #84B0C7;
+.tablist li.current a {
+    background-image: url('tab_a.png');
+    background-repeat:repeat-x;
+    color: #fff;
+    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
 }
diff --git a/html/test_8c-source.html b/html/test_8c-source.html
deleted file mode 100644
index 023d51f..0000000
--- a/html/test_8c-source.html
+++ /dev/null
@@ -1,406 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: test.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>test.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*                                                                              *</span>
-<a name="l00002"></a>00002 <span class="comment"> *   This file is part of the ESO FORS   package                                *</span>
-<a name="l00003"></a>00003 <span class="comment"> *   Copyright (C) 2004,2005 European Southern Observatory                      *</span>
-<a name="l00004"></a>00004 <span class="comment"> *                                                                              *</span>
-<a name="l00005"></a>00005 <span class="comment"> *   This library is free software; you can redistribute it and/or modify       *</span>
-<a name="l00006"></a>00006 <span class="comment"> *   it under the terms of the GNU General Public License as published by       *</span>
-<a name="l00007"></a>00007 <span class="comment"> *   the Free Software Foundation; either version 2 of the License, or          *</span>
-<a name="l00008"></a>00008 <span class="comment"> *   (at your option) any later version.                                        *</span>
-<a name="l00009"></a>00009 <span class="comment"> *                                                                              *</span>
-<a name="l00010"></a>00010 <span class="comment"> *   This program is distributed in the hope that it will be useful,            *</span>
-<a name="l00011"></a>00011 <span class="comment"> *   but WITHOUT ANY WARRANTY; without even the implied warranty of             *</span>
-<a name="l00012"></a>00012 <span class="comment"> *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *</span>
-<a name="l00013"></a>00013 <span class="comment"> *   GNU General Public License for more details.                               *</span>
-<a name="l00014"></a>00014 <span class="comment"> *                                                                              *</span>
-<a name="l00015"></a>00015 <span class="comment"> *   You should have received a copy of the GNU General Public License          *</span>
-<a name="l00016"></a>00016 <span class="comment"> *   along with this program; if not, write to the Free Software                *</span>
-<a name="l00017"></a>00017 <span class="comment"> *   Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA       *</span>
-<a name="l00018"></a>00018 <span class="comment"> *                                                                              */</span>
-<a name="l00019"></a>00019  
-<a name="l00020"></a>00020 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#  include <config.h></span>
-<a name="l00022"></a>00022 <span class="preprocessor">#endif</span>
-<a name="l00023"></a>00023 <span class="preprocessor"></span>
-<a name="l00024"></a>00024 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00025"></a>00025 <span class="comment">                                Includes</span>
-<a name="l00026"></a>00026 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#include <test.h></span>
-<a name="l00029"></a>00029 
-<a name="l00030"></a>00030 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00031"></a>00031 
-<a name="l00032"></a>00032 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <math.h></span>  <span class="comment">/* fabs() */</span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <string.h></span> <span class="comment">/* strlen() */</span>
-<a name="l00035"></a>00035 
-<a name="l00036"></a>00036 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00040"></a>00040 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00043"></a>00043 <span class="comment">                                Implementation</span>
-<a name="l00044"></a>00044 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00045"></a>00045 
-<a name="l00049"></a><a class="code" href="group__test.html#g8bf3870fd210f34561f4f3f6010370a4">00049</a> <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="group__test.html#g8bf3870fd210f34561f4f3f6010370a4">test_nfail</a> = 0; 
-<a name="l00050"></a><a class="code" href="group__test.html#gf18fa33a097747a6e4bb8c4f49bf0ed7">00050</a> <span class="keyword">static</span> cpl_errorstate <a class="code" href="group__test.html#gf18fa33a097747a6e4bb8c4f49bf0ed7">error_init</a>;
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00061"></a>00061 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00062"></a>00062 <span class="keyword">static</span> <span class="keywordtype">void</span>
-<a name="l00063"></a><a class="code" href="group__test.html#gf80c8e8f1596284c4a41600a7d381e92">00063</a> <a class="code" href="group__test.html#gf80c8e8f1596284c4a41600a7d381e92">_test</a>(<span class="keywordtype">int</span> expression, <span class="keyword">const</span> <span class="keywordtype">char</span> *message,
-<a name="l00064"></a>00064      <span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)
-<a name="l00065"></a>00065 {
-<a name="l00066"></a>00066     <span class="keyword">const</span> <span class="keywordtype">char</span> *error_state = (cpl_error_get_code() != CPL_ERROR_NONE) ?
-<a name="l00067"></a>00067         cpl_sprintf(<span class="stringliteral">" (CPL-error state: '%s' at %s)"</span>,
-<a name="l00068"></a>00068                        cpl_error_get_message(), cpl_error_get_where()) :
-<a name="l00069"></a>00069         NULL;
-<a name="l00070"></a>00070     
-<a name="l00071"></a>00071     <span class="keywordflow">if</span> (expression) {
-<a name="l00072"></a>00072         cpl_msg_debug(function,
-<a name="l00073"></a>00073                       <span class="stringliteral">"OK at %s:%u%s: %s"</span>,
-<a name="l00074"></a>00074                       file, line, error_state != NULL ? error_state : <span class="stringliteral">""</span>,
-<a name="l00075"></a>00075                       message);
-<a name="l00076"></a>00076     } <span class="keywordflow">else</span> {
-<a name="l00077"></a>00077         <span class="keywordflow">if</span> (<a class="code" href="group__test.html#g8bf3870fd210f34561f4f3f6010370a4">test_nfail</a> + 1 > <a class="code" href="group__test.html#g8bf3870fd210f34561f4f3f6010370a4">test_nfail</a>) {
-<a name="l00078"></a>00078             <a class="code" href="group__test.html#g8bf3870fd210f34561f4f3f6010370a4">test_nfail</a>++;
-<a name="l00079"></a>00079         }
-<a name="l00080"></a>00080         <span class="keywordflow">else</span> {
-<a name="l00081"></a>00081             cpl_msg_error(function, <span class="stringliteral">"Number of errors (%lu) overflow!"</span>,
-<a name="l00082"></a>00082                           <a class="code" href="group__test.html#g8bf3870fd210f34561f4f3f6010370a4">test_nfail</a>);
-<a name="l00083"></a>00083         }
-<a name="l00084"></a>00084         
-<a name="l00085"></a>00085         cpl_msg_error(function,
-<a name="l00086"></a>00086                       <span class="stringliteral">"Failure at %s:%u%s: %s"</span>,
-<a name="l00087"></a>00087                       file, line, error_state != NULL ? error_state : <span class="stringliteral">""</span>,
-<a name="l00088"></a>00088                       message);
-<a name="l00089"></a>00089     }
-<a name="l00090"></a>00090 
-<a name="l00091"></a>00091     <span class="keywordflow">if</span> (error_state != NULL)
-<a name="l00092"></a>00092         {
-<a name="l00093"></a>00093             cpl_free((<span class="keywordtype">char</span> *)error_state);
-<a name="l00094"></a>00094         }
-<a name="l00095"></a>00095 
-<a name="l00096"></a>00096     <span class="keywordflow">return</span>;
-<a name="l00097"></a>00097 }
-<a name="l00098"></a>00098 
-<a name="l00099"></a>00099 
-<a name="l00100"></a>00100 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00110"></a>00110 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00111"></a>00111 <span class="keywordtype">void</span> 
-<a name="l00112"></a><a class="code" href="group__test.html#gab4f8f05aaa5e3f196c6353866f94981">00112</a> <a class="code" href="group__test.html#gab4f8f05aaa5e3f196c6353866f94981">test_macro</a>(<span class="keywordtype">int</span> expression, <span class="keyword">const</span> <span class="keywordtype">char</span> *expr_string,
-<a name="l00113"></a>00113                   <span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)
-<a name="l00114"></a>00114 {
-<a name="l00115"></a>00115     <span class="keyword">const</span> <span class="keywordtype">char</span> *message = cpl_sprintf(<span class="stringliteral">"(%s) = %d"</span>, expr_string, expression);
-<a name="l00116"></a>00116 
-<a name="l00117"></a>00117     <a class="code" href="group__test.html#gf80c8e8f1596284c4a41600a7d381e92">_test</a>(expression, message,
-<a name="l00118"></a>00118          function, file, line);
-<a name="l00119"></a>00119 
-<a name="l00120"></a>00120     cpl_free((<span class="keywordtype">char</span> *)message);
-<a name="l00121"></a>00121 
-<a name="l00122"></a>00122     <span class="keywordflow">return</span>;
-<a name="l00123"></a>00123 }
-<a name="l00124"></a>00124 
-<a name="l00125"></a>00125 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00137"></a>00137 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00138"></a>00138 <span class="keywordtype">void</span> 
-<a name="l00139"></a><a class="code" href="group__test.html#g1da2e46a3658d3b80d1060ab04747507">00139</a> <a class="code" href="group__test.html#g1da2e46a3658d3b80d1060ab04747507">test_eq_macro</a>(<span class="keywordtype">int</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,
-<a name="l00140"></a>00140                      <span class="keywordtype">int</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,
-<a name="l00141"></a>00141                      <span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)
-<a name="l00142"></a>00142 {
-<a name="l00143"></a>00143     <span class="keyword">const</span> <span class="keywordtype">char</span> *message =
-<a name="l00144"></a>00144         cpl_sprintf(<span class="stringliteral">"(%s) = %d; (%s) = %d"</span>,
-<a name="l00145"></a>00145                        first_string, first,
-<a name="l00146"></a>00146                        second_string, second);
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     <a class="code" href="group__test.html#gf80c8e8f1596284c4a41600a7d381e92">_test</a>(first == second, message,
-<a name="l00149"></a>00149          function, file, line);
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     cpl_free((<span class="keywordtype">char</span> *)message);
-<a name="l00152"></a>00152 
-<a name="l00153"></a>00153     <span class="keywordflow">return</span>;
-<a name="l00154"></a>00154 }
-<a name="l00155"></a>00155 
-<a name="l00156"></a>00156 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00168"></a>00168 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00169"></a>00169 <span class="keywordtype">void</span> 
-<a name="l00170"></a><a class="code" href="group__test.html#g9c58a98a4f063f11ac233b3e11228485">00170</a> <a class="code" href="group__test.html#g9c58a98a4f063f11ac233b3e11228485">test_eq_string_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,
-<a name="l00171"></a>00171                 <span class="keyword">const</span> <span class="keywordtype">char</span> *second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,
-<a name="l00172"></a>00172                 <span class="keyword">const</span> <span class="keywordtype">char</span> *function, 
-<a name="l00173"></a>00173                 <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)
-<a name="l00174"></a>00174 {
-<a name="l00175"></a>00175     <span class="keyword">const</span> <span class="keywordtype">char</span> *message;
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177     message = cpl_sprintf(<span class="stringliteral">"%s = '%s'; %s = '%s'"</span>,
-<a name="l00178"></a>00178                              first_string, first != NULL ? first : <span class="stringliteral">"NULL"</span>,
-<a name="l00179"></a>00179                              second_string, second != NULL ? second : <span class="stringliteral">"NULL"</span>);
-<a name="l00180"></a>00180 
-<a name="l00181"></a>00181     <a class="code" href="group__test.html#gf80c8e8f1596284c4a41600a7d381e92">_test</a>(first != NULL && second != NULL && strcmp(first, second) == 0, 
-<a name="l00182"></a>00182          message,
-<a name="l00183"></a>00183          function, file, line);
-<a name="l00184"></a>00184 
-<a name="l00185"></a>00185     cpl_free((<span class="keywordtype">char</span> *)message);
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187     <span class="keywordflow">return</span>;
-<a name="l00188"></a>00188 }
-<a name="l00189"></a>00189 
-<a name="l00190"></a>00190 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00206"></a>00206 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00207"></a>00207 <span class="keywordtype">void</span> 
-<a name="l00208"></a><a class="code" href="group__test.html#gfdcc2d4527a4292dffdb89df2e25e3a5">00208</a> <a class="code" href="group__test.html#gfdcc2d4527a4292dffdb89df2e25e3a5">test_abs_macro</a>(<span class="keywordtype">double</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,
-<a name="l00209"></a>00209                       <span class="keywordtype">double</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,
-<a name="l00210"></a>00210                       <span class="keywordtype">double</span> tolerance, <span class="keyword">const</span> <span class="keywordtype">char</span> *tolerance_string,
-<a name="l00211"></a>00211                       <span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)
-<a name="l00212"></a>00212 {
-<a name="l00213"></a>00213     <span class="keyword">const</span> <span class="keywordtype">char</span> *message =
-<a name="l00214"></a>00214         cpl_sprintf(<span class="stringliteral">"|%s - (%s)| = |%g - (%g)| <= %g = %s"</span>,
-<a name="l00215"></a>00215                        first_string, second_string, first, second,
-<a name="l00216"></a>00216                        tolerance, tolerance_string);
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     <a class="code" href="group__test.html#gf80c8e8f1596284c4a41600a7d381e92">_test</a>(fabs(first - second) <= tolerance, message,
-<a name="l00219"></a>00219          function, file, line);
-<a name="l00220"></a>00220     <span class="comment">/* Note: fails if tolerance is negative */</span>
-<a name="l00221"></a>00221 
-<a name="l00222"></a>00222     cpl_free((<span class="keywordtype">char</span> *)message);
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224     <span class="keywordflow">return</span>;
-<a name="l00225"></a>00225 }
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00243"></a>00243 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00244"></a>00244 <span class="keywordtype">void</span> 
-<a name="l00245"></a><a class="code" href="group__test.html#g179ca9b6adab6c5e9c1b4259f08c16d7">00245</a> <a class="code" href="group__test.html#g179ca9b6adab6c5e9c1b4259f08c16d7">test_rel_macro</a>(<span class="keywordtype">double</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,
-<a name="l00246"></a>00246                       <span class="keywordtype">double</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,
-<a name="l00247"></a>00247                       <span class="keywordtype">double</span> tolerance, <span class="keyword">const</span> <span class="keywordtype">char</span> *tolerance_string,
-<a name="l00248"></a>00248                       <span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)
-<a name="l00249"></a>00249 {
-<a name="l00250"></a>00250     <span class="keyword">const</span> <span class="keywordtype">char</span> *message;
-<a name="l00251"></a>00251     
-<a name="l00252"></a>00252     <span class="keywordflow">if</span> (first == 0 || second == 0) {
-<a name="l00253"></a>00253         <span class="comment">/* Division by zero -> fail */</span>
-<a name="l00254"></a>00254         message = cpl_sprintf(<span class="stringliteral">"%s = %g; %s = %g (division by zero)"</span>,
-<a name="l00255"></a>00255                                  first_string, first,
-<a name="l00256"></a>00256                                  second_string, second);
-<a name="l00257"></a>00257         <a class="code" href="group__test.html#gf80c8e8f1596284c4a41600a7d381e92">_test</a>(0, message,
-<a name="l00258"></a>00258              function, file, line);
-<a name="l00259"></a>00259     }
-<a name="l00260"></a>00260     <span class="keywordflow">else</span> {
-<a name="l00261"></a>00261         message = 
-<a name="l00262"></a>00262             cpl_sprintf(<span class="stringliteral">"|%s - (%s)|/|%s| = |%g - (%g)|/|%g| <= %g = %s and "</span>
-<a name="l00263"></a>00263                            <span class="stringliteral">"|%s - (%s)|/|%s| = |%g - (%g)|/|%g| <= %g = %s"</span>,
-<a name="l00264"></a>00264                            first_string, second_string, first_string,
-<a name="l00265"></a>00265                            first, second, first, tolerance, tolerance_string,
-<a name="l00266"></a>00266                            first_string, second_string, second_string,
-<a name="l00267"></a>00267                            first, second, second, tolerance, tolerance_string);            
-<a name="l00268"></a>00268         
-<a name="l00269"></a>00269         <a class="code" href="group__test.html#gf80c8e8f1596284c4a41600a7d381e92">_test</a>(fabs((first - second)/first ) <= tolerance &&
-<a name="l00270"></a>00270              fabs((first - second)/second) <= tolerance, message,
-<a name="l00271"></a>00271              function, file, line);
-<a name="l00272"></a>00272         <span class="comment">/* Note: fails if tolerance is negative */</span>
-<a name="l00273"></a>00273     }
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275     cpl_free((<span class="keywordtype">char</span> *)message);
-<a name="l00276"></a>00276 
-<a name="l00277"></a>00277     <span class="keywordflow">return</span>;
-<a name="l00278"></a>00278 }
-<a name="l00279"></a>00279 
-<a name="l00280"></a>00280 
-<a name="l00281"></a>00281 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00288"></a>00288 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00289"></a>00289 <span class="keywordtype">void</span>
-<a name="l00290"></a><a class="code" href="group__test.html#gdf5b021e357a2554f044454d0b886ec6">00290</a> <a class="code" href="group__test.html#gdf5b021e357a2554f044454d0b886ec6">test_init_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *file)
-<a name="l00291"></a>00291 {
-<a name="l00292"></a>00292     <span class="comment">/* Build message domain + log filename</span>
-<a name="l00293"></a>00293 <span class="comment">       from source file name */</span>
-<a name="l00294"></a>00294     
-<a name="l00295"></a>00295     <span class="keywordtype">unsigned</span> len = strlen(file);
-<a name="l00296"></a>00296     <span class="keywordtype">int</span> able_to_parse_filename;
-<a name="l00297"></a>00297 
-<a name="l00298"></a>00298     cpl_init(CPL_INIT_DEFAULT);
-<a name="l00299"></a>00299     <a class="code" href="group__test.html#gf18fa33a097747a6e4bb8c4f49bf0ed7">error_init</a> = cpl_errorstate_get();
-<a name="l00300"></a>00300     srand(0);
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302     <span class="keywordflow">if</span> (len < strlen(<span class="stringliteral">"s.c"</span>) || strcmp(file + len - strlen(<span class="stringliteral">".c"</span>), <span class="stringliteral">".c"</span>) != 0)
-<a name="l00303"></a>00303         {
-<a name="l00304"></a>00304             able_to_parse_filename = 0;
-<a name="l00305"></a>00305             <span class="comment">/* Here, we should issue a warning but we need to</span>
-<a name="l00306"></a>00306 <span class="comment">               initialize the CPL message system first */</span>
-<a name="l00307"></a>00307         }
-<a name="l00308"></a>00308     <span class="keywordflow">else</span>
-<a name="l00309"></a>00309         {
-<a name="l00310"></a>00310             <span class="comment">/* Form domain from filename by removing ".c" suffix</span>
-<a name="l00311"></a>00311 <span class="comment">               and stripping any path prefix */</span>
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313             <span class="keyword">const</span> <span class="keywordtype">char</span> dir_delimiter = <span class="charliteral">'/'</span>; <span class="comment">/* UNIX only! */</span>
-<a name="l00314"></a>00314             <span class="keywordtype">unsigned</span> path_length = 0;       <span class="comment">/* Length of path prefix </span>
-<a name="l00315"></a>00315 <span class="comment">                                               including final '/' */</span>
-<a name="l00316"></a>00316             <span class="keywordtype">int</span> i;
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318             <span class="keywordflow">for</span> (i = len - strlen(<span class="stringliteral">".c"</span>) - 1; i >= 0; i--)
-<a name="l00319"></a>00319                 {
-<a name="l00320"></a>00320                     <span class="keywordflow">if</span> (file[i] == dir_delimiter && path_length == 0)
-<a name="l00321"></a>00321                         {
-<a name="l00322"></a>00322                             path_length = i + 1;
-<a name="l00323"></a>00323                         }
-<a name="l00324"></a>00324                 }
-<a name="l00325"></a>00325             
-<a name="l00326"></a>00326             able_to_parse_filename = (len - path_length - strlen(<span class="stringliteral">".c"</span>) >= 1);
-<a name="l00327"></a>00327             <span class="keywordflow">if</span> (able_to_parse_filename)
-<a name="l00328"></a>00328                 {
-<a name="l00329"></a>00329                     <span class="keyword">const</span> <span class="keywordtype">char</span> *logfile;
-<a name="l00330"></a>00330                     <span class="keywordtype">char</span> *domain;
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332                     domain = cpl_strdup(file + path_length);
-<a name="l00333"></a>00333                     domain[len - path_length - strlen(<span class="stringliteral">".c"</span>)] = <span class="charliteral">'\0'</span>;
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335                     cpl_msg_set_domain(domain);
-<a name="l00336"></a>00336                     
-<a name="l00337"></a>00337                     logfile = cpl_sprintf(<span class="stringliteral">"%s.log"</span>, domain);
-<a name="l00338"></a>00338                     cpl_msg_set_log_name(logfile);
-<a name="l00339"></a>00339                     
-<a name="l00340"></a>00340                     cpl_free((<span class="keywordtype">char</span> *)logfile);
-<a name="l00341"></a>00341                     cpl_free(domain);
-<a name="l00342"></a>00342                 }
-<a name="l00343"></a>00343             <span class="comment">/* else: Use default domain + logfilename */</span>
-<a name="l00344"></a>00344         }
-<a name="l00345"></a>00345 
-<a name="l00346"></a>00346     <span class="comment">/* Adopt the policy that the unit test is quiet</span>
-<a name="l00347"></a>00347 <span class="comment">       unless something is wrong.</span>
-<a name="l00348"></a>00348 <span class="comment">       Dump debugging info to the log file */</span>
-<a name="l00349"></a>00349     cpl_msg_set_level(CPL_MSG_WARNING); 
-<a name="l00350"></a>00350     cpl_msg_set_log_level(CPL_MSG_DEBUG);
-<a name="l00351"></a>00351     
-<a name="l00352"></a>00352     <span class="keywordflow">if</span> (!able_to_parse_filename)
-<a name="l00353"></a>00353         {
-<a name="l00354"></a>00354             cpl_msg_warning(cpl_func,
-<a name="l00355"></a>00355                             <span class="stringliteral">"Source file name '%s' does not match [base].c. "</span>,
-<a name="l00356"></a>00356                             file);
-<a name="l00357"></a>00357         }
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00360"></a>00360         {
-<a name="l00361"></a>00361             cpl_msg_error(cpl_func,
-<a name="l00362"></a>00362                           <span class="stringliteral">"Failure during initialization: %s at %s"</span>,
-<a name="l00363"></a>00363                           cpl_error_get_message(), cpl_error_get_where());
-<a name="l00364"></a>00364         }
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     <span class="keywordflow">return</span>;
-<a name="l00367"></a>00367 }
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00379"></a>00379 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00380"></a>00380 <span class="keywordtype">unsigned</span>
-<a name="l00381"></a><a class="code" href="group__test.html#ga03e8561e85f5310576a5bf2ca4ffd63">00381</a> <a class="code" href="group__test.html#ga03e8561e85f5310576a5bf2ca4ffd63">test_end_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)
-<a name="l00382"></a>00382 {
-<a name="l00383"></a>00383     <span class="keyword">const</span> <span class="keywordtype">int</span> memory_is_empty = cpl_memory_is_empty();
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385     <a class="code" href="group__test.html#g1da2e46a3658d3b80d1060ab04747507">test_eq_macro</a>(cpl_error_get_code(), <span class="stringliteral">"cpl_error_get_code()"</span>,
-<a name="l00386"></a>00386                   CPL_ERROR_NONE, <span class="stringliteral">"CPL_ERROR_NONE"</span>,
-<a name="l00387"></a>00387                   function, file, line);
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00390"></a>00390         cpl_errorstate_dump(<a class="code" href="group__test.html#gf18fa33a097747a6e4bb8c4f49bf0ed7">error_init</a>, CPL_FALSE, NULL);
-<a name="l00391"></a>00391     }
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393     <a class="code" href="group__test.html#gab4f8f05aaa5e3f196c6353866f94981">test_macro</a>(memory_is_empty,
-<a name="l00394"></a>00394                <span class="stringliteral">"memory_is_empty"</span>,
-<a name="l00395"></a>00395                function, file, line);
-<a name="l00396"></a>00396     
-<a name="l00397"></a>00397     <span class="keywordflow">if</span> (!memory_is_empty) {
-<a name="l00398"></a>00398         cpl_msg_error(function, <span class="stringliteral">"Memory leak detected:"</span>);
-<a name="l00399"></a>00399         cpl_memory_dump(); 
-<a name="l00400"></a>00400     }
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     cpl_end();
-<a name="l00403"></a>00403 
-<a name="l00404"></a>00404     <span class="keywordflow">return</span> <a class="code" href="group__test.html#g8bf3870fd210f34561f4f3f6010370a4">test_nfail</a>;
-<a name="l00405"></a>00405 }
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407 
-<a name="l00408"></a>00408 
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410 
-<a name="l00411"></a>00411 <span class="preprocessor">#undef cleanup</span>
-<a name="l00412"></a><a class="code" href="group__test.html#g57cf6e6e2826eb178fd2d9c3e5695343">00412</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00413"></a>00413 <span class="preprocessor">do { \</span>
-<a name="l00414"></a>00414 <span class="preprocessor">    cpl_propertylist_delete(product_header); \</span>
-<a name="l00415"></a>00415 <span class="preprocessor">} while(0)</span>
-<a name="l00416"></a>00416 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00426"></a>00426 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00427"></a>00427 <span class="keywordtype">void</span> 
-<a name="l00428"></a><a class="code" href="group__test.html#ge4730f9510e545e738aef9c8b7459b8b">00428</a> <a class="code" href="group__test.html#ge4730f9510e545e738aef9c8b7459b8b">test_recipe_output</a>(<span class="keyword">const</span> cpl_frameset *frames,
-<a name="l00429"></a>00429                    <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[], <span class="keywordtype">int</span> n_prod,
-<a name="l00430"></a>00430            <span class="keyword">const</span> <span class="keywordtype">char</span> *main_product,
-<a name="l00431"></a>00431            <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[], <span class="keywordtype">int</span> n_qc)
-<a name="l00432"></a>00432 {
-<a name="l00433"></a>00433     cpl_propertylist *product_header = NULL;
-<a name="l00434"></a>00434     
-<a name="l00435"></a>00435     <span class="keywordtype">int</span> i;
-<a name="l00436"></a>00436     <span class="keywordflow">for</span> (i = 0; i < n_prod; i++) {
-<a name="l00437"></a>00437         <span class="keyword">const</span> cpl_frame *product = cpl_frameset_find_const(frames, product_tags[i]);
-<a name="l00438"></a>00438         test( product != NULL );
-<a name="l00439"></a>00439         test_eq( cpl_frame_get_group(product), CPL_FRAME_GROUP_PRODUCT );
-<a name="l00440"></a>00440         
-<a name="l00441"></a>00441         cpl_propertylist_delete(product_header);
-<a name="l00442"></a>00442         product_header = cpl_propertylist_load(cpl_frame_get_filename(product), 0);
-<a name="l00443"></a>00443         
-<a name="l00444"></a>00444         <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, 
-<a name="l00445"></a>00445                 <span class="stringliteral">"Failed to load product header"</span> );
-<a name="l00446"></a>00446         
-<a name="l00447"></a>00447         
-<a name="l00448"></a>00448     <span class="keywordflow">if</span> (strcmp(product_tags[i], main_product) == 0) {
-<a name="l00449"></a>00449         <span class="comment">/* Must always be present */</span>
-<a name="l00450"></a>00450         test( cpl_propertylist_has(product_header,
-<a name="l00451"></a>00451                        <span class="stringliteral">"ESO QC DID"</span>) );
-<a name="l00452"></a>00452     }
-<a name="l00453"></a>00453     <span class="keywordflow">else</span> {
-<a name="l00454"></a>00454         test( !cpl_propertylist_has(product_header,
-<a name="l00455"></a>00455                     <span class="stringliteral">"ESO QC DID"</span>) );
-<a name="l00456"></a>00456     }
-<a name="l00457"></a>00457         
-<a name="l00458"></a>00458         <span class="keywordtype">int</span> j;
-<a name="l00459"></a>00459         <span class="keywordflow">for</span> (j = 0; j < n_qc; j++) {
-<a name="l00460"></a>00460         
-<a name="l00461"></a>00461             <span class="keyword">const</span> <span class="keywordtype">char</span> *full_qc_name = cpl_sprintf(<span class="stringliteral">"ESO %s"</span>, qc[j]);
-<a name="l00462"></a>00462         
-<a name="l00463"></a>00463         cpl_msg_debug(cpl_func, 
-<a name="l00464"></a>00464               <span class="stringliteral">"Looking for '%s' in '%s'"</span>,
-<a name="l00465"></a>00465               qc[j], product_tags[i]);
-<a name="l00466"></a>00466         
-<a name="l00467"></a>00467         <span class="keywordflow">if</span> (strcmp(product_tags[i], main_product) == 0) {
-<a name="l00468"></a>00468         test( cpl_propertylist_has(product_header,
-<a name="l00469"></a>00469                        full_qc_name) );
-<a name="l00470"></a>00470         }
-<a name="l00471"></a>00471         <span class="keywordflow">else</span> {
-<a name="l00472"></a>00472         test( !cpl_propertylist_has(product_header,
-<a name="l00473"></a>00473                        full_qc_name) );
-<a name="l00474"></a>00474         }
-<a name="l00475"></a>00475         
-<a name="l00476"></a>00476         cpl_free((<span class="keywordtype">void</span> *)full_qc_name);
-<a name="l00477"></a>00477         }
-<a name="l00478"></a>00478     }
-<a name="l00479"></a>00479     
-<a name="l00480"></a>00480     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00481"></a>00481     <span class="keywordflow">return</span>;
-<a name="l00482"></a>00482 }
-<a name="l00483"></a>00483 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/test_8c_source.html b/html/test_8c_source.html
new file mode 100644
index 0000000..4b4cb34
--- /dev/null
+++ b/html/test_8c_source.html
@@ -0,0 +1,445 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: test.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">test.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/*                                                                              *</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *   This file is part of the ESO FORS   package                                *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> *   Copyright (C) 2004,2005 European Southern Observatory                      *</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> *                                                                              *</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *   This library is free software; you can redistribute it and/or modify       *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> *   it under the terms of the GNU General Public License as published by       *</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> *   the Free Software Foundation; either version 2 of the License, or          *</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> *   (at your option) any later version.                                        *</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> *                                                                              *</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *   This program is distributed in the hope that it will be useful,            *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> *   but WITHOUT ANY WARRANTY; without even the implied warranty of             *</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> *   GNU General Public License for more details.                               *</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> *                                                                              *</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *   You should have received a copy of the GNU General Public License          *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> *   along with this program; if not, write to the Free Software                *</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> *   Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA       *</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> *                                                                              */</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span>  </div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="preprocessor"></span><span class="preprocessor">#  include <config.h></span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment">                                Includes</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#include <test.h></span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> </div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> </div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <math.h></span>  <span class="comment">/* fabs() */</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <string.h></span> <span class="comment">/* strlen() */</span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> </div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="comment">                                Implementation</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> </div>
+<div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8">   49</a></span> <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8">test_nfail</a> = 0; </div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="keyword">static</span> cpl_errorstate error_init;</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="keyword">static</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd">   63</a></span> <a class="code" href="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd" title="Evaluate an expression and update an internal counter if it fails.">_test</a>(<span class="keywordtype">int</span> expression, <span class="keyword">const</span> <span class="keywordtype">char</span> *message,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>      <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)</div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> {</div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *error_state = (cpl_error_get_code() != CPL_ERROR_NONE) ?</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>         cpl_sprintf(<span class="stringliteral">" (CPL-error state: '%s' at %s)"</span>,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>                        cpl_error_get_message(), cpl_error_get_where()) :</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>         NULL;</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>     </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>     <span class="keywordflow">if</span> (expression) {</div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>         cpl_msg_debug(<span class="keyword">function</span>,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>                       <span class="stringliteral">"OK at %s:%u%s: %s"</span>,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>                       file, line, error_state != NULL ? error_state : <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>                       message);</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>     } <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>         <span class="keywordflow">if</span> (<a class="code" href="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8">test_nfail</a> + 1 > <a class="code" href="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8">test_nfail</a>) {</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>             <a class="code" href="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8">test_nfail</a>++;</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span>         }</div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span>             cpl_msg_error(<span class="keyword">function</span>, <span class="stringliteral">"Number of errors (%lu) overflow!"</span>,</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span>                           <a class="code" href="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8">test_nfail</a>);</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>         }</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>         </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>         cpl_msg_error(<span class="keyword">function</span>,</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>                       <span class="stringliteral">"Failure at %s:%u%s: %s"</span>,</div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>                       file, line, error_state != NULL ? error_state : <span class="stringliteral">""</span>,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                       message);</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>     }</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> </div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     <span class="keywordflow">if</span> (error_state != NULL)</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>         {</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>             cpl_free((<span class="keywordtype">char</span> *)error_state);</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>         }</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> </div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> }</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> </div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> </div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="group__test.html#ga69c8e2113cda1f0384f518415c224aeb">  112</a></span> <a class="code" href="group__test.html#ga69c8e2113cda1f0384f518415c224aeb" title="Test a given expression.">test_macro</a>(<span class="keywordtype">int</span> expression, <span class="keyword">const</span> <span class="keywordtype">char</span> *expr_string,</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>                   <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> {</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *message = cpl_sprintf(<span class="stringliteral">"(%s) = %d"</span>, expr_string, expression);</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> </div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     <a class="code" href="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd" title="Evaluate an expression and update an internal counter if it fails.">_test</a>(expression, message,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>          <span class="keyword">function</span>, file, line);</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> </div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     cpl_free((<span class="keywordtype">char</span> *)message);</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> </div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> }</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> </div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno"><a class="code" href="group__test.html#ga0b29bcb36a03d68f05034d446b93b060">  139</a></span> <a class="code" href="group__test.html#ga0b29bcb36a03d68f05034d446b93b060" title="Test if two integer expressions are equal.">test_eq_macro</a>(<span class="keywordtype">int</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                      <span class="keywordtype">int</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                      <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> {</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *message =</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>         cpl_sprintf(<span class="stringliteral">"(%s) = %d; (%s) = %d"</span>,</div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>                        first_string, first,</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>                        second_string, second);</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <a class="code" href="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd" title="Evaluate an expression and update an internal counter if it fails.">_test</a>(first == second, message,</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>          <span class="keyword">function</span>, file, line);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     cpl_free((<span class="keywordtype">char</span> *)message);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> }</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00170"></a><span class="lineno"><a class="code" href="group__test.html#ga393dca2c7f94fd2f47722083cda8d369">  170</a></span> <a class="code" href="group__test.html#ga393dca2c7f94fd2f47722083cda8d369" title="Test if two strings are equal.">test_eq_string_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, </div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *message;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     message = cpl_sprintf(<span class="stringliteral">"%s = '%s'; %s = '%s'"</span>,</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>                              first_string, first != NULL ? first : <span class="stringliteral">"NULL"</span>,</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>                              second_string, second != NULL ? second : <span class="stringliteral">"NULL"</span>);</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> </div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     <a class="code" href="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd" title="Evaluate an expression and update an internal counter if it fails.">_test</a>(first != NULL && second != NULL && strcmp(first, second) == 0, </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>          message,</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>          <span class="keyword">function</span>, file, line);</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> </div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     cpl_free((<span class="keywordtype">char</span> *)message);</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> }</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno"><a class="code" href="group__test.html#gae93f165e1b26c1b98e4ec9457a06714b">  208</a></span> <a class="code" href="group__test.html#gae93f165e1b26c1b98e4ec9457a06714b" title="Test if two numerical expressions are within a given (absolute) tolerance.">test_abs_macro</a>(<span class="keywordtype">double</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                       <span class="keywordtype">double</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                       <span class="keywordtype">double</span> tolerance, <span class="keyword">const</span> <span class="keywordtype">char</span> *tolerance_string,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                       <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> {</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *message =</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>         cpl_sprintf(<span class="stringliteral">"|%s - (%s)| = |%g - (%g)| <= %g = %s"</span>,</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>                        first_string, second_string, first, second,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                        tolerance, tolerance_string);</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     <a class="code" href="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd" title="Evaluate an expression and update an internal counter if it fails.">_test</a>(fabs(first - second) <= tolerance, message,</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>          <span class="keyword">function</span>, file, line);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     <span class="comment">/* Note: fails if tolerance is negative */</span></div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span> </div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_free((<span class="keywordtype">char</span> *)message);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> }</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00245"></a><span class="lineno"><a class="code" href="group__test.html#ga9cdeb6a0e44a5e2197eedce28865f000">  245</a></span> <a class="code" href="group__test.html#ga9cdeb6a0e44a5e2197eedce28865f000" title="Test if two numerical expressions are within a given relative tolerance.">test_rel_macro</a>(<span class="keywordtype">double</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                       <span class="keywordtype">double</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                       <span class="keywordtype">double</span> tolerance, <span class="keyword">const</span> <span class="keywordtype">char</span> *tolerance_string,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                       <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line)</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> {</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *message;</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="keywordflow">if</span> (first == 0 || second == 0) {</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>         <span class="comment">/* Division by zero -> fail */</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>         message = cpl_sprintf(<span class="stringliteral">"%s = %g; %s = %g (division by zero)"</span>,</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>                                  first_string, first,</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>                                  second_string, second);</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>         <a class="code" href="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd" title="Evaluate an expression and update an internal counter if it fails.">_test</a>(0, message,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>              <span class="keyword">function</span>, file, line);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     }</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>         message = </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>             cpl_sprintf(<span class="stringliteral">"|%s - (%s)|/|%s| = |%g - (%g)|/|%g| <= %g = %s and "</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                            <span class="stringliteral">"|%s - (%s)|/|%s| = |%g - (%g)|/|%g| <= %g = %s"</span>,</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>                            first_string, second_string, first_string,</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                            first, second, first, tolerance, tolerance_string,</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>                            first_string, second_string, second_string,</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>                            first, second, second, tolerance, tolerance_string);            </div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>         </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>         <a class="code" href="group__test.html#ga95184b7220504cc982ef1741b9cfe8bd" title="Evaluate an expression and update an internal counter if it fails.">_test</a>(fabs((first - second)/first ) <= tolerance &&</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>              fabs((first - second)/second) <= tolerance, message,</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>              <span class="keyword">function</span>, file, line);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>         <span class="comment">/* Note: fails if tolerance is negative */</span></div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     }</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     cpl_free((<span class="keywordtype">char</span> *)message);</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> }</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> </div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> </div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno"><a class="code" href="group__test.html#gab73f634dbde2ec1403f0508d5c1d987b">  290</a></span> <a class="code" href="group__test.html#gab73f634dbde2ec1403f0508d5c1d987b" title="Initialize CPL + messaging.">test_init_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *file)</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> {</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     <span class="comment">/* Build message domain + log filename</span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> <span class="comment">       from source file name */</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     </div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     <span class="keywordtype">unsigned</span> len = strlen(file);</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="keywordtype">int</span> able_to_parse_filename;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span> </div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     cpl_init(CPL_INIT_DEFAULT);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     error_init = cpl_errorstate_get();</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     srand(0);</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     <span class="keywordflow">if</span> (len < strlen(<span class="stringliteral">"s.c"</span>) || strcmp(file + len - strlen(<span class="stringliteral">".c"</span>), <span class="stringliteral">".c"</span>) != 0)</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>         {</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>             able_to_parse_filename = 0;</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>             <span class="comment">/* Here, we should issue a warning but we need to</span></div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> <span class="comment">               initialize the CPL message system first */</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         }</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>         {</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>             <span class="comment">/* Form domain from filename by removing ".c" suffix</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="comment">               and stripping any path prefix */</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>             <span class="keyword">const</span> <span class="keywordtype">char</span> dir_delimiter = <span class="charliteral">'/'</span>; <span class="comment">/* UNIX only! */</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>             <span class="keywordtype">unsigned</span> path_length = 0;       <span class="comment">/* Length of path prefix </span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="comment">                                               including final '/' */</span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>             <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> </div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>             <span class="keywordflow">for</span> (i = len - strlen(<span class="stringliteral">".c"</span>) - 1; i >= 0; i--)</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>                 {</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>                     <span class="keywordflow">if</span> (file[i] == dir_delimiter && path_length == 0)</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>                         {</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                             path_length = i + 1;</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                         }</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                 }</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>             </div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>             able_to_parse_filename = (len - path_length - strlen(<span class="stringliteral">".c"</span>) >= 1);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>             <span class="keywordflow">if</span> (able_to_parse_filename)</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>                 {</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>                     <span class="keyword">const</span> <span class="keywordtype">char</span> *logfile;</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>                     <span class="keywordtype">char</span> *domain;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>                     domain = cpl_strdup(file + path_length);</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>                     domain[len - path_length - strlen(<span class="stringliteral">".c"</span>)] = <span class="charliteral">'\0'</span>;</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>                     cpl_msg_set_domain(domain);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                     </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>                     logfile = cpl_sprintf(<span class="stringliteral">"%s.log"</span>, domain);</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>                     cpl_msg_set_log_name(logfile);</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>                     </div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>                     cpl_free((<span class="keywordtype">char</span> *)logfile);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>                     cpl_free(domain);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>                 }</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>             <span class="comment">/* else: Use default domain + logfilename */</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         }</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     <span class="comment">/* Adopt the policy that the unit test is quiet</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> <span class="comment">       unless something is wrong.</span></div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> <span class="comment">       Dump debugging info to the log file */</span></div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     cpl_msg_set_level(CPL_MSG_WARNING); </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     cpl_msg_set_log_level(CPL_MSG_DEBUG);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>     </div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     <span class="keywordflow">if</span> (!able_to_parse_filename)</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>         {</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>             cpl_msg_warning(cpl_func,</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>                             <span class="stringliteral">"Source file name '%s' does not match [base].c. "</span>,</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>                             file);</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>         }</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>         {</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>             cpl_msg_error(cpl_func,</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>                           <span class="stringliteral">"Failure during initialization: %s at %s"</span>,</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                           cpl_error_get_message(), cpl_error_get_where());</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>         }</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> }</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span> <span class="keywordtype">unsigned</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno"><a class="code" href="group__test.html#ga27e574128e77cc503295df8191f583e5">  381</a></span> <a class="code" href="group__test.html#ga27e574128e77cc503295df8191f583e5" title="Perform the final checks and return the number of errors.">test_end_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">c [...]
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> {</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keyword">const</span> <span class="keywordtype">int</span> memory_is_empty = cpl_memory_is_empty();</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span> </div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     <a class="code" href="group__test.html#ga0b29bcb36a03d68f05034d446b93b060" title="Test if two integer expressions are equal.">test_eq_macro</a>(cpl_error_get_code(), <span class="stringliteral">"cpl_error_get_code()"</span>,</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>                   CPL_ERROR_NONE, <span class="stringliteral">"CPL_ERROR_NONE"</span>,</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>                   <span class="keyword">function</span>, file, line);</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>         cpl_errorstate_dump(error_init, CPL_FALSE, NULL);</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     }</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <a class="code" href="group__test.html#ga69c8e2113cda1f0384f518415c224aeb" title="Test a given expression.">test_macro</a>(memory_is_empty,</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                <span class="stringliteral">"memory_is_empty"</span>,</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>                <span class="keyword">function</span>, file, line);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     <span class="keywordflow">if</span> (!memory_is_empty) {</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>         cpl_msg_error(<span class="keyword">function</span>, <span class="stringliteral">"Memory leak detected:"</span>);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         cpl_memory_dump(); </div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     }</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     cpl_end();</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> </div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     <span class="keywordflow">return</span> <a class="code" href="group__test.html#gafc4fd42e311ceffbc41f1e33da745af8">test_nfail</a>;</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> }</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span> </div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span> </div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> </div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span> </div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> <span class="preprocessor">    cpl_propertylist_delete(product_header); \</span></div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00428"></a><span class="lineno"><a class="code" href="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c">  428</a></span> <a class="code" href="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c" title="Test existence of recipe products.">test_recipe_output</a>(<span class="keyword">const</span> cpl_frameset *frames,</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[], <span class="keywordtype">int</span> n_prod,</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>            <span class="keyword">const</span> <span class="keywordtype">char</span> *main_product,</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>            <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[], <span class="keywordtype">int</span> n_qc)</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> {</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     cpl_propertylist *product_header = NULL;</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     </div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">for</span> (i = 0; i < n_prod; i++) {</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>         <span class="keyword">const</span> cpl_frame *product = cpl_frameset_find_const(frames, product_tags[i]);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>         test( product != NULL );</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         test_eq( cpl_frame_get_group(product), CPL_FRAME_GROUP_PRODUCT );</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>         </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         cpl_propertylist_delete(product_header);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>         product_header = cpl_propertylist_load(cpl_frame_get_filename(product), 0);</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>         </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>         <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span>, </div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>                 <span class="stringliteral">"Failed to load product header"</span> );</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>         </div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>         </div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     <span class="keywordflow">if</span> (strcmp(product_tags[i], main_product) == 0) {</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>         <span class="comment">/* Must always be present */</span></div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         test( cpl_propertylist_has(product_header,</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>                        <span class="stringliteral">"ESO QC DID"</span>) );</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     }</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>         test( !cpl_propertylist_has(product_header,</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>                     <span class="stringliteral">"ESO QC DID"</span>) );</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     }</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>         </div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>         <span class="keywordtype">int</span> j;</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         <span class="keywordflow">for</span> (j = 0; j < n_qc; j++) {</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>         </div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>             <span class="keyword">const</span> <span class="keywordtype">char</span> *full_qc_name = cpl_sprintf(<span class="stringliteral">"ESO %s"</span>, qc[j]);</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>         </div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>         cpl_msg_debug(cpl_func, </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>               <span class="stringliteral">"Looking for '%s' in '%s'"</span>,</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>               qc[j], product_tags[i]);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         </div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         <span class="keywordflow">if</span> (strcmp(product_tags[i], main_product) == 0) {</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         test( cpl_propertylist_has(product_header,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>                        full_qc_name) );</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         }</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         test( !cpl_propertylist_has(product_header,</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                        full_qc_name) );</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>         }</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>         </div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         cpl_free((<span class="keywordtype">void</span> *)full_qc_name);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         }</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     }</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     cleanup;</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> }</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span> </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/test_8h-source.html b/html/test_8h-source.html
deleted file mode 100644
index abacdb6..0000000
--- a/html/test_8h-source.html
+++ /dev/null
@@ -1,141 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: test.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>test.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*                                                                              *</span>
-<a name="l00002"></a>00002 <span class="comment"> *   This file is part of the ESO IRPLIB package                                *</span>
-<a name="l00003"></a>00003 <span class="comment"> *   Copyright (C) 2004,2005 European Southern Observatory                      *</span>
-<a name="l00004"></a>00004 <span class="comment"> *                                                                              *</span>
-<a name="l00005"></a>00005 <span class="comment"> *   This library is free software; you can redistribute it and/or modify       *</span>
-<a name="l00006"></a>00006 <span class="comment"> *   it under the terms of the GNU General Public License as published by       *</span>
-<a name="l00007"></a>00007 <span class="comment"> *   the Free Software Foundation; either version 2 of the License, or          *</span>
-<a name="l00008"></a>00008 <span class="comment"> *   (at your option) any later version.                                        *</span>
-<a name="l00009"></a>00009 <span class="comment"> *                                                                              *</span>
-<a name="l00010"></a>00010 <span class="comment"> *   This program is distributed in the hope that it will be useful,            *</span>
-<a name="l00011"></a>00011 <span class="comment"> *   but WITHOUT ANY WARRANTY; without even the implied warranty of             *</span>
-<a name="l00012"></a>00012 <span class="comment"> *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *</span>
-<a name="l00013"></a>00013 <span class="comment"> *   GNU General Public License for more details.                               *</span>
-<a name="l00014"></a>00014 <span class="comment"> *                                                                              *</span>
-<a name="l00015"></a>00015 <span class="comment"> *   You should have received a copy of the GNU General Public License          *</span>
-<a name="l00016"></a>00016 <span class="comment"> *   along with this program; if not, write to the Free Software                *</span>
-<a name="l00017"></a>00017 <span class="comment"> *   Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA       *</span>
-<a name="l00018"></a>00018 <span class="comment"> *                                                                              */</span>
-<a name="l00019"></a>00019  
-<a name="l00020"></a>00020 <span class="preprocessor">#ifndef TEST_H</span>
-<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define TEST_H</span>
-<a name="l00022"></a>00022 <span class="preprocessor"></span>
-<a name="l00023"></a>00023 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#  include <config.h></span>
-<a name="l00025"></a>00025 <span class="preprocessor">#endif</span>
-<a name="l00026"></a>00026 <span class="preprocessor"></span>
-<a name="l00027"></a>00027 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00028"></a>00028 <span class="comment">                                Includes</span>
-<a name="l00029"></a>00029 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00030"></a>00030 
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00034"></a>00034 <span class="comment">                                Defines</span>
-<a name="l00035"></a>00035 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00036"></a>00036 
-<a name="l00039"></a>00039 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00055"></a>00055 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00056"></a>00056 <span class="preprocessor">#define test(expr) \</span>
-<a name="l00057"></a>00057 <span class="preprocessor">        test_macro(expr, #expr, cpl_func, __FILE__, __LINE__)</span>
-<a name="l00058"></a>00058 <span class="preprocessor"></span>
-<a name="l00059"></a>00059 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00079"></a>00079 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00080"></a>00080 <span class="preprocessor">#define test_eq(first, second)                                          \</span>
-<a name="l00081"></a>00081 <span class="preprocessor">        test_eq_macro(first, #first, second, #second,                   \</span>
-<a name="l00082"></a>00082 <span class="preprocessor">                              cpl_func, __FILE__, __LINE__)</span>
-<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00099"></a>00099 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00100"></a>00100 <span class="preprocessor">#define test_eq_string(first, second)                                   \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">        test_eq_string_macro(first, #first, second, #second,            \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">                              cpl_func, __FILE__, __LINE__)</span>
-<a name="l00103"></a>00103 <span class="preprocessor"></span>
-<a name="l00104"></a>00104 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00123"></a>00123 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00124"></a>00124 <span class="preprocessor">#define test_abs(first, second, tolerance)                              \</span>
-<a name="l00125"></a>00125 <span class="preprocessor">        test_abs_macro(first, #first, second, #second,                  \</span>
-<a name="l00126"></a>00126 <span class="preprocessor">                              tolerance, #tolerance,                           \</span>
-<a name="l00127"></a>00127 <span class="preprocessor">                              cpl_func, __FILE__, __LINE__)</span>
-<a name="l00128"></a>00128 <span class="preprocessor"></span>
-<a name="l00129"></a>00129 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00154"></a>00154 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00155"></a>00155 <span class="preprocessor">#define test_rel(first, second, tolerance)                              \</span>
-<a name="l00156"></a>00156 <span class="preprocessor">        test_rel_macro(first, #first, second, #second,                  \</span>
-<a name="l00157"></a>00157 <span class="preprocessor">                              tolerance, #tolerance,                           \</span>
-<a name="l00158"></a>00158 <span class="preprocessor">                              cpl_func, __FILE__, __LINE__)</span>
-<a name="l00159"></a>00159 <span class="preprocessor"></span>
-<a name="l00160"></a>00160 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00165"></a>00165 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00166"></a>00166 <span class="preprocessor">#define TEST_INIT test_init_macro(__FILE__)</span>
-<a name="l00167"></a>00167 <span class="preprocessor"></span>
-<a name="l00168"></a>00168 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00173"></a>00173 <span class="comment">/*----------------------------------------------------------------------------*/</span>
-<a name="l00174"></a>00174 <span class="preprocessor">#define TEST_END \</span>
-<a name="l00175"></a>00175 <span class="preprocessor">    return(test_end_macro(cpl_func, __FILE__, __LINE__) ? \</span>
-<a name="l00176"></a>00176 <span class="preprocessor">    EXIT_FAILURE : EXIT_SUCCESS)</span>
-<a name="l00177"></a>00177 <span class="preprocessor"></span>
-<a name="l00178"></a>00178 
-<a name="l00179"></a>00179 <span class="comment">/*-----------------------------------------------------------------------------</span>
-<a name="l00180"></a>00180 <span class="comment">                               Functions prototypes</span>
-<a name="l00181"></a>00181 <span class="comment"> -----------------------------------------------------------------------------*/</span>
-<a name="l00182"></a>00182 <span class="comment">/* None of these functions should be called directly */</span>
-<a name="l00183"></a>00183 <span class="keywordtype">void</span>
-<a name="l00184"></a>00184 <a class="code" href="group__test.html#gdf5b021e357a2554f044454d0b886ec6">test_init_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *file);
-<a name="l00185"></a>00185 
-<a name="l00186"></a>00186 <span class="keywordtype">unsigned</span>
-<a name="l00187"></a>00187 <a class="code" href="group__test.html#ga03e8561e85f5310576a5bf2ca4ffd63">test_end_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);
-<a name="l00188"></a>00188 
-<a name="l00189"></a>00189 <span class="keywordtype">void</span> 
-<a name="l00190"></a>00190 <a class="code" href="group__test.html#gab4f8f05aaa5e3f196c6353866f94981">test_macro</a>(<span class="keywordtype">int</span> expression, <span class="keyword">const</span> <span class="keywordtype">char</span> *expr_string,
-<a name="l00191"></a>00191                   <span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);
-<a name="l00192"></a>00192 
-<a name="l00193"></a>00193 <span class="keywordtype">void</span> 
-<a name="l00194"></a>00194 <a class="code" href="group__test.html#g1da2e46a3658d3b80d1060ab04747507">test_eq_macro</a>(<span class="keywordtype">int</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,
-<a name="l00195"></a>00195                      <span class="keywordtype">int</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,
-<a name="l00196"></a>00196                      <span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);
-<a name="l00197"></a>00197 <span class="keywordtype">void</span> 
-<a name="l00198"></a>00198 <a class="code" href="group__test.html#g9c58a98a4f063f11ac233b3e11228485">test_eq_string_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,
-<a name="l00199"></a>00199                 <span class="keyword">const</span> <span class="keywordtype">char</span> *second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,
-<a name="l00200"></a>00200                 <span class="keyword">const</span> <span class="keywordtype">char</span> *function, 
-<a name="l00201"></a>00201                 <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);
-<a name="l00202"></a>00202 <span class="keywordtype">void</span> 
-<a name="l00203"></a>00203 <a class="code" href="group__test.html#gfdcc2d4527a4292dffdb89df2e25e3a5">test_abs_macro</a>(<span class="keywordtype">double</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,
-<a name="l00204"></a>00204                       <span class="keywordtype">double</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,
-<a name="l00205"></a>00205                       <span class="keywordtype">double</span> tolerance, <span class="keyword">const</span> <span class="keywordtype">char</span> *tolerance_string,
-<a name="l00206"></a>00206                       <span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208 <span class="keywordtype">void</span> 
-<a name="l00209"></a>00209 <a class="code" href="group__test.html#g179ca9b6adab6c5e9c1b4259f08c16d7">test_rel_macro</a>(<span class="keywordtype">double</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,
-<a name="l00210"></a>00210                       <span class="keywordtype">double</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,
-<a name="l00211"></a>00211                       <span class="keywordtype">double</span> tolerance, <span class="keyword">const</span> <span class="keywordtype">char</span> *tolerance_string,
-<a name="l00212"></a>00212                       <span class="keyword">const</span> <span class="keywordtype">char</span> *function, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);
-<a name="l00213"></a>00213 
-<a name="l00214"></a>00214 <span class="keywordtype">void</span> 
-<a name="l00215"></a>00215 <a class="code" href="group__test.html#ge4730f9510e545e738aef9c8b7459b8b">test_recipe_output</a>(<span class="keyword">const</span> cpl_frameset *frames,
-<a name="l00216"></a>00216                    <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[], <span class="keywordtype">int</span> n_prod,
-<a name="l00217"></a>00217            <span class="keyword">const</span> <span class="keywordtype">char</span> *main_product,
-<a name="l00218"></a>00218            <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[], <span class="keywordtype">int</span> n_qc);
-<a name="l00219"></a>00219 
-<a name="l00222"></a>00222 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/test_8h_source.html b/html/test_8h_source.html
new file mode 100644
index 0000000..be32125
--- /dev/null
+++ b/html/test_8h_source.html
@@ -0,0 +1,180 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: test.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">test.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/*                                                                              *</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *   This file is part of the ESO IRPLIB package                                *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> *   Copyright (C) 2004,2005 European Southern Observatory                      *</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> *                                                                              *</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *   This library is free software; you can redistribute it and/or modify       *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> *   it under the terms of the GNU General Public License as published by       *</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> *   the Free Software Foundation; either version 2 of the License, or          *</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> *   (at your option) any later version.                                        *</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> *                                                                              *</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *   This program is distributed in the hope that it will be useful,            *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> *   but WITHOUT ANY WARRANTY; without even the implied warranty of             *</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> *   GNU General Public License for more details.                               *</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> *                                                                              *</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *   You should have received a copy of the GNU General Public License          *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> *   along with this program; if not, write to the Free Software                *</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> *   Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA       *</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> *                                                                              */</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span>  </div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> <span class="preprocessor">#ifndef TEST_H</span></div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="preprocessor"></span><span class="preprocessor">#define TEST_H</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="preprocessor"></span><span class="preprocessor">#  include <config.h></span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="comment">                                Includes</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> </div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="comment">                                Defines</span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">#define test(expr) \</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">        test_macro(expr, #expr, cpl_func, __FILE__, __LINE__)</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">#define test_eq(first, second)                                          \</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor">        test_eq_macro(first, #first, second, #second,                   \</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">                              cpl_func, __FILE__, __LINE__)</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor"></span><span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">#define test_eq_string(first, second)                                   \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">        test_eq_string_macro(first, #first, second, #second,            \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">                              cpl_func, __FILE__, __LINE__)</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor">#define test_abs(first, second, tolerance)                              \</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor">        test_abs_macro(first, #first, second, #second,                  \</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor">                              tolerance, #tolerance,                           \</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor">                              cpl_func, __FILE__, __LINE__)</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="preprocessor">#define test_rel(first, second, tolerance)                              \</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="preprocessor">        test_rel_macro(first, #first, second, #second,                  \</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="preprocessor">                              tolerance, #tolerance,                           \</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="preprocessor">                              cpl_func, __FILE__, __LINE__)</span></div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="preprocessor">#define TEST_INIT test_init_macro(__FILE__)</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="comment">/*----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> <span class="preprocessor">#define TEST_END \</span></div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> <span class="preprocessor">    return(test_end_macro(cpl_func, __FILE__, __LINE__) ? \</span></div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> <span class="preprocessor">    EXIT_FAILURE : EXIT_SUCCESS)</span></div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="comment">/*-----------------------------------------------------------------------------</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="comment">                               Functions prototypes</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="comment"> -----------------------------------------------------------------------------*/</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="comment">/* None of these functions should be called directly */</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <a class="code" href="group__test.html#gab73f634dbde2ec1403f0508d5c1d987b" title="Initialize CPL + messaging.">test_init_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *file);</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> <span class="keywordtype">unsigned</span></div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span> <a class="code" href="group__test.html#ga27e574128e77cc503295df8191f583e5" title="Perform the final checks and return the number of errors.">test_end_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span> </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> <a class="code" href="group__test.html#ga69c8e2113cda1f0384f518415c224aeb" title="Test a given expression.">test_macro</a>(<span class="keywordtype">int</span> expression, <span class="keyword">const</span> <span class="keywordtype">char</span> *expr_string,</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>                   <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <a class="code" href="group__test.html#ga0b29bcb36a03d68f05034d446b93b060" title="Test if two integer expressions are equal.">test_eq_macro</a>(<span class="keywordtype">int</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>                      <span class="keywordtype">int</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                      <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> <a class="code" href="group__test.html#ga393dca2c7f94fd2f47722083cda8d369" title="Test if two strings are equal.">test_eq_string_macro</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>                 <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> <a class="code" href="group__test.html#gae93f165e1b26c1b98e4ec9457a06714b" title="Test if two numerical expressions are within a given (absolute) tolerance.">test_abs_macro</a>(<span class="keywordtype">double</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                       <span class="keywordtype">double</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                       <span class="keywordtype">double</span> tolerance, <span class="keyword">const</span> <span class="keywordtype">char</span> *tolerance_string,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                       <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <a class="code" href="group__test.html#ga9cdeb6a0e44a5e2197eedce28865f000" title="Test if two numerical expressions are within a given relative tolerance.">test_rel_macro</a>(<span class="keywordtype">double</span> first,  <span class="keyword">const</span> <span class="keywordtype">char</span> *first_string,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                       <span class="keywordtype">double</span> second, <span class="keyword">const</span> <span class="keywordtype">char</span> *second_string,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                       <span class="keywordtype">double</span> tolerance, <span class="keyword">const</span> <span class="keywordtype">char</span> *tolerance_string,</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>                       <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">function</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> line);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="keywordtype">void</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> <a class="code" href="group__test.html#gae130ff5a0f20a6e926dc7d57c5d4906c" title="Test existence of recipe products.">test_recipe_output</a>(<span class="keyword">const</span> cpl_frameset *frames,</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>                    <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> product_tags[], <span class="keywordtype">int</span> n_prod,</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>            <span class="keyword">const</span> <span class="keywordtype">char</span> *main_product,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>            <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> qc[], <span class="keywordtype">int</span> n_qc);</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> </div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/test__hough_8c-source.html b/html/test__hough_8c-source.html
deleted file mode 100644
index fe5346a..0000000
--- a/html/test__hough_8c-source.html
+++ /dev/null
@@ -1,289 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: test_hough.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>test_hough.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: test_hough.c,v 1.5 2013/04/24 14:14:13 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:14:13 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.5 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <moses.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_create(cpl_plugin *);
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_exec(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_destroy(cpl_plugin *);
-<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough(cpl_parameterlist *, cpl_frameset *);
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">char</span> test_hough_description[] =
-<a name="l00044"></a>00044 <span class="stringliteral">"This recipe is used to test the Hough transformation on any table.\n\n"</span>
-<a name="l00045"></a>00045 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"  DO category:      Type:       Explanation:\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"  TABLE             Raw         Table with at least 2 numerical columns.\n\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"  DO category:      Data type:  Explanation:\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"  TRANSFORMED       FITS table  Table with estimates.\n\n"</span>;
-<a name="l00051"></a>00051 
-<a name="l00052"></a>00052 <span class="preprocessor">#define test_hough_exit(message)              \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">{                                             \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">cpl_table_delete(table);                      \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">cpl_table_delete(output);                     \</span>
-<a name="l00057"></a>00057 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00058"></a>00058 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00059"></a>00059 <span class="preprocessor">}</span>
-<a name="l00060"></a>00060 <span class="preprocessor"></span>
-<a name="l00061"></a>00061 <span class="preprocessor">#define test_hough_exit_memcheck(message)     \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">{                                             \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">cpl_table_delete(table);                      \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">cpl_table_delete(output);                     \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00067"></a>00067 <span class="preprocessor">return 0;                                     \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">}</span>
-<a name="l00069"></a>00069 <span class="preprocessor"></span>
-<a name="l00070"></a>00070 
-<a name="l00082"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00082</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00083"></a>00083 {
-<a name="l00084"></a>00084     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00085"></a>00085     cpl_plugin *plugin = &recipe->interface;
-<a name="l00086"></a>00086 
-<a name="l00087"></a>00087     cpl_plugin_init(plugin,
-<a name="l00088"></a>00088                     CPL_PLUGIN_API,
-<a name="l00089"></a>00089                     FORS_BINARY_VERSION,
-<a name="l00090"></a>00090                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00091"></a>00091                     <span class="stringliteral">"test_hough"</span>,
-<a name="l00092"></a>00092                     <span class="stringliteral">"Test Hough transform on any table of points"</span>,
-<a name="l00093"></a>00093                     test_hough_description,
-<a name="l00094"></a>00094                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00095"></a>00095                     PACKAGE_BUGREPORT,
-<a name="l00096"></a>00096     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00097"></a>00097     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00098"></a>00098     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00099"></a>00099     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00100"></a>00100     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00101"></a>00101     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00102"></a>00102     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00103"></a>00103     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00104"></a>00104     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00105"></a>00105     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00106"></a>00106     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00107"></a>00107     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00108"></a>00108     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00109"></a>00109                     test_hough_create,
-<a name="l00110"></a>00110                     test_hough_exec,
-<a name="l00111"></a>00111                     test_hough_destroy);
-<a name="l00112"></a>00112 
-<a name="l00113"></a>00113     cpl_pluginlist_append(list, plugin);
-<a name="l00114"></a>00114     
-<a name="l00115"></a>00115     <span class="keywordflow">return</span> 0;
-<a name="l00116"></a>00116 }
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118 
-<a name="l00129"></a>00129 <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_create(cpl_plugin *plugin)
-<a name="l00130"></a>00130 {
-<a name="l00131"></a>00131     cpl_recipe    *recipe;
-<a name="l00132"></a>00132     cpl_parameter *p;
-<a name="l00133"></a>00133 
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     <span class="comment">/* </span>
-<a name="l00136"></a>00136 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00137"></a>00137 <span class="comment">     */</span>
-<a name="l00138"></a>00138 
-<a name="l00139"></a>00139     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00140"></a>00140         recipe = (cpl_recipe *)plugin;
-<a name="l00141"></a>00141     <span class="keywordflow">else</span> 
-<a name="l00142"></a>00142         <span class="keywordflow">return</span> -1;
-<a name="l00143"></a>00143 
-<a name="l00144"></a>00144     <span class="comment">/* </span>
-<a name="l00145"></a>00145 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00146"></a>00146 <span class="comment">     */</span>
-<a name="l00147"></a>00147 
-<a name="l00148"></a>00148     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00149"></a>00149 
-<a name="l00150"></a>00150 
-<a name="l00151"></a>00151     <span class="comment">/*</span>
-<a name="l00152"></a>00152 <span class="comment">     * Table column with x coordinate</span>
-<a name="l00153"></a>00153 <span class="comment">     */</span>
-<a name="l00154"></a>00154 
-<a name="l00155"></a>00155     p = cpl_parameter_new_value(<span class="stringliteral">"fors.test_hough.xcolumn"</span>,
-<a name="l00156"></a>00156                                 CPL_TYPE_STRING,
-<a name="l00157"></a>00157                                 <span class="stringliteral">"Table column with x coordinate"</span>,
-<a name="l00158"></a>00158                                 <span class="stringliteral">"fors.test_hough"</span>,
-<a name="l00159"></a>00159                                 <span class="stringliteral">"0"</span>);
-<a name="l00160"></a>00160     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xcolumn"</span>);
-<a name="l00161"></a>00161     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00162"></a>00162     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00163"></a>00163 
-<a name="l00164"></a>00164     <span class="comment">/*</span>
-<a name="l00165"></a>00165 <span class="comment">     * Table column with y coordinate</span>
-<a name="l00166"></a>00166 <span class="comment">     */</span>
-<a name="l00167"></a>00167 
-<a name="l00168"></a>00168     p = cpl_parameter_new_value(<span class="stringliteral">"fors.test_hough.ycolumn"</span>,
-<a name="l00169"></a>00169                                 CPL_TYPE_STRING,
-<a name="l00170"></a>00170                                 <span class="stringliteral">"Table column with y coordinate"</span>,
-<a name="l00171"></a>00171                                 <span class="stringliteral">"fors.test_hough"</span>,
-<a name="l00172"></a>00172                                 <span class="stringliteral">"0"</span>);
-<a name="l00173"></a>00173     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ycolumn"</span>);
-<a name="l00174"></a>00174     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00175"></a>00175     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177     <span class="keywordflow">return</span> 0;
-<a name="l00178"></a>00178 }
-<a name="l00179"></a>00179 
-<a name="l00180"></a>00180 
-<a name="l00189"></a>00189 <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_exec(cpl_plugin *plugin)
-<a name="l00190"></a>00190 {
-<a name="l00191"></a>00191     cpl_recipe *recipe;
-<a name="l00192"></a>00192     
-<a name="l00193"></a>00193     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00194"></a>00194         recipe = (cpl_recipe *)plugin;
-<a name="l00195"></a>00195     <span class="keywordflow">else</span> 
-<a name="l00196"></a>00196         <span class="keywordflow">return</span> -1;
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198     <span class="keywordflow">return</span> test_hough(recipe->parameters, recipe->frames);
-<a name="l00199"></a>00199 }
-<a name="l00200"></a>00200 
-<a name="l00201"></a>00201 
-<a name="l00210"></a>00210 <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_destroy(cpl_plugin *plugin)
-<a name="l00211"></a>00211 {
-<a name="l00212"></a>00212     cpl_recipe *recipe;
-<a name="l00213"></a>00213     
-<a name="l00214"></a>00214     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00215"></a>00215         recipe = (cpl_recipe *)plugin;
-<a name="l00216"></a>00216     <span class="keywordflow">else</span> 
-<a name="l00217"></a>00217         <span class="keywordflow">return</span> -1;
-<a name="l00218"></a>00218 
-<a name="l00219"></a>00219     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     <span class="keywordflow">return</span> 0;
-<a name="l00222"></a>00222 }
-<a name="l00223"></a>00223 
-<a name="l00224"></a>00224 
-<a name="l00234"></a>00234 <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00235"></a>00235 {
-<a name="l00236"></a>00236 
-<a name="l00237"></a>00237     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"test_hough"</span>;
-<a name="l00238"></a>00238 
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240     <span class="comment">/*</span>
-<a name="l00241"></a>00241 <span class="comment">     * Input parameters</span>
-<a name="l00242"></a>00242 <span class="comment">     */</span>
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     <span class="keyword">const</span> <span class="keywordtype">char</span> *xcolumn;
-<a name="l00245"></a>00245     <span class="keyword">const</span> <span class="keywordtype">char</span> *ycolumn;
-<a name="l00246"></a>00246 
-<a name="l00247"></a>00247     <span class="comment">/*</span>
-<a name="l00248"></a>00248 <span class="comment">     * CPL objects</span>
-<a name="l00249"></a>00249 <span class="comment">     */</span>
-<a name="l00250"></a>00250 
-<a name="l00251"></a>00251     cpl_table *table = NULL;
-<a name="l00252"></a>00252     cpl_table *output = NULL;
-<a name="l00253"></a>00253 
-<a name="l00254"></a>00254     <span class="comment">/*</span>
-<a name="l00255"></a>00255 <span class="comment">     * Auxiliary variables</span>
-<a name="l00256"></a>00256 <span class="comment">     */</span>
-<a name="l00257"></a>00257 
-<a name="l00258"></a>00258     <span class="keywordtype">int</span>  nframes;
-<a name="l00259"></a>00259 
-<a name="l00260"></a>00260     cpl_msg_set_indentation(2);
-<a name="l00261"></a>00261 
-<a name="l00262"></a>00262 
-<a name="l00263"></a>00263     <span class="comment">/* </span>
-<a name="l00264"></a>00264 <span class="comment">     * Get configuration parameters</span>
-<a name="l00265"></a>00265 <span class="comment">     */</span>
-<a name="l00266"></a>00266 
-<a name="l00267"></a>00267     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00268"></a>00268     cpl_msg_indent_more();
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     xcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00271"></a>00271                                        <span class="stringliteral">"fors.test_hough.xcolumn"</span>, NULL);
-<a name="l00272"></a>00272     ycolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00273"></a>00273                                        <span class="stringliteral">"fors.test_hough.ycolumn"</span>, NULL);
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00276"></a>00276         test_hough_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00277"></a>00277 
-<a name="l00278"></a>00278     <span class="comment">/* </span>
-<a name="l00279"></a>00279 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00280"></a>00280 <span class="comment">     */</span>
-<a name="l00281"></a>00281 
-<a name="l00282"></a>00282     cpl_msg_indent_less();
-<a name="l00283"></a>00283     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00284"></a>00284     cpl_msg_indent_more();
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286     nframes = cpl_frameset_count_tags(frameset, <span class="stringliteral">"TABLE"</span>);
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     <span class="keywordflow">if</span> (nframes == 0)
-<a name="l00289"></a>00289         test_hough_exit(<span class="stringliteral">"Missing input table"</span>);
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291     <span class="keywordflow">if</span> (nframes > 1) {
-<a name="l00292"></a>00292         cpl_msg_error(recipe, <span class="stringliteral">"Too many input tables found (%d). "</span>
-<a name="l00293"></a>00293                       <span class="stringliteral">"Just one is required."</span>, nframes);
-<a name="l00294"></a>00294         test_hough_exit(NULL);
-<a name="l00295"></a>00295     }
-<a name="l00296"></a>00296 
-<a name="l00297"></a>00297     cpl_msg_info(recipe, <span class="stringliteral">"Load %s frame..."</span>, <span class="stringliteral">"TABLE"</span>);
-<a name="l00298"></a>00298     cpl_msg_indent_more();
-<a name="l00299"></a>00299 
-<a name="l00300"></a>00300     table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"TABLE"</span>, 1);
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302     output = <a class="code" href="group__moses.html#g68b5196b98878f3f3b702d58f1477150">mos_hough_table</a>(table, xcolumn, ycolumn);
-<a name="l00303"></a>00303     cpl_table_delete(table); table = NULL;
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, output, <span class="stringliteral">"TRANSFORMED"</span>, NULL,
-<a name="l00306"></a>00306                        parlist, recipe, <span class="stringliteral">"test_version"</span>))
-<a name="l00307"></a>00307         test_hough_exit(NULL);
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309     cpl_table_delete(output); output = NULL;
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311     <span class="keywordflow">return</span> 0;
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313 } 
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/test__hough_8c_source.html b/html/test__hough_8c_source.html
new file mode 100644
index 0000000..afed107
--- /dev/null
+++ b/html/test__hough_8c_source.html
@@ -0,0 +1,328 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: test_hough.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">test_hough.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: test_hough.c,v 1.5 2013-04-24 14:14:13 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-04-24 14:14:13 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.5 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_create(cpl_plugin *);</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">static</span> <span class="keywordtype">char</span> test_hough_description[] =</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="stringliteral">"This recipe is used to test the Hough transformation on any table.\n\n"</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"  DO category:      Type:       Explanation:\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"  TABLE             Raw         Table with at least 2 numerical columns.\n\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"  DO category:      Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"  TRANSFORMED       FITS table  Table with estimates.\n\n"</span>;</div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> </div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">#define test_hough_exit(message)              \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">cpl_table_delete(table);                      \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">cpl_table_delete(output);                     \</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">#define test_hough_exit_memcheck(message)     \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">if (message) cpl_msg_info(recipe, message);   \</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">cpl_table_delete(table);                      \</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">cpl_table_delete(output);                     \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">return 0;                                     \</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> {</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> </div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>                     <span class="stringliteral">"test_hough"</span>,</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>                     <span class="stringliteral">"Test Hough transform on any table of points"</span>,</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>                     test_hough_description,</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>                     test_hough_create,</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span>                     test_hough_exec,</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>                     test_hough_destroy);</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> </div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> }</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> {</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> </div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> </div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> </div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> </div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> </div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="comment">     * Table column with x coordinate</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> </div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.test_hough.xcolumn"</span>,</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                                 <span class="stringliteral">"Table column with x coordinate"</span>,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                                 <span class="stringliteral">"fors.test_hough"</span>,</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                                 <span class="stringliteral">"0"</span>);</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"xcolumn"</span>);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> </div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> <span class="comment">     * Table column with y coordinate</span></div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span> </div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.test_hough.ycolumn"</span>,</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>                                 <span class="stringliteral">"Table column with y coordinate"</span>,</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>                                 <span class="stringliteral">"fors.test_hough"</span>,</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>                                 <span class="stringliteral">"0"</span>);</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ycolumn"</span>);</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> }</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> </div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> </div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span> <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> {</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     </div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <span class="keywordflow">return</span> test_hough(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span> }</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> </div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> {</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     </div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> </div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> }</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span> </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span> </div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> <span class="keyword">static</span> <span class="keywordtype">int</span> test_hough(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span> {</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span> </div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"test_hough"</span>;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span> </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *xcolumn;</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *ycolumn;</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> </div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_table *table = NULL;</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     cpl_table *output = NULL;</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> </div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     <span class="keywordtype">int</span>  nframes;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span> </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     xcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>                                        <span class="stringliteral">"fors.test_hough.xcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     ycolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                                        <span class="stringliteral">"fors.test_hough.ycolumn"</span>, NULL);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>         test_hough_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> </div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span> <span class="comment">     * Check input set-of-frames</span></div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> </div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     nframes = cpl_frameset_count_tags(frameset, <span class="stringliteral">"TABLE"</span>);</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keywordflow">if</span> (nframes == 0)</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>         test_hough_exit(<span class="stringliteral">"Missing input table"</span>);</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     <span class="keywordflow">if</span> (nframes > 1) {</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many input tables found (%d). "</span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                       <span class="stringliteral">"Just one is required."</span>, nframes);</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>         test_hough_exit(NULL);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     }</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span> </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load %s frame..."</span>, <span class="stringliteral">"TABLE"</span>);</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span> </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"TABLE"</span>, 1);</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     output = mos_hough_table(table, xcolumn, ycolumn);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     cpl_table_delete(table); table = NULL;</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, output, <span class="stringliteral">"TRANSFORMED"</span>, NULL,</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>                        parlist, recipe, <span class="stringliteral">"test_version"</span>))</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>         test_hough_exit(NULL);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     cpl_table_delete(output); output = NULL;</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> } </div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/test__simulate_8c-source.html b/html/test__simulate_8c-source.html
deleted file mode 100644
index 34013ac..0000000
--- a/html/test__simulate_8c-source.html
+++ /dev/null
@@ -1,530 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: test_simulate.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>test_simulate.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: test_simulate.c,v 1.34 2009/02/25 15:34:48 hlorch Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: hlorch $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2009/02/25 15:34:48 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.34 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <test_simulate.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <fors_instrument.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_data.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_pfits.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_utils.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00042"></a>00042 
-<a name="l00043"></a>00043 <span class="preprocessor">#include <math.h></span>
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 <span class="comment">/* FIXME:   - remove FORS_DATA_STD_* !!!</span>
-<a name="l00046"></a>00046 <span class="comment"> *          - replace below in create_std_cat()</span>
-<a name="l00047"></a>00047 <span class="comment"> *              1.) by creation of a standard star list, and</span>
-<a name="l00048"></a>00048 <span class="comment"> *              2.) and a new function fors_std_cat_test_create_stetson()</span>
-<a name="l00049"></a>00049 <span class="comment"> *                  in fors_std_cat.c</span>
-<a name="l00050"></a>00050 <span class="comment"> */</span>
-<a name="l00051"></a>00051 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_MAG[FORS_NUM_FILTER] =
-<a name="l00052"></a>00052 {<span class="stringliteral">"U"</span>,
-<a name="l00053"></a>00053  <span class="stringliteral">"B"</span>,
-<a name="l00054"></a>00054  <span class="comment">//"G",</span>
-<a name="l00055"></a>00055  <span class="stringliteral">"V"</span>,  <span class="comment">/* G uses V */</span>
-<a name="l00056"></a>00056  <span class="stringliteral">"V"</span>,
-<a name="l00057"></a>00057  <span class="stringliteral">"R"</span>,
-<a name="l00058"></a>00058  <span class="stringliteral">"I"</span>,
-<a name="l00059"></a>00059  <span class="stringliteral">"Z"</span>};
-<a name="l00060"></a>00060 
-<a name="l00061"></a>00061 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_DMAG[FORS_NUM_FILTER] =
-<a name="l00062"></a>00062 {<span class="stringliteral">"ERR_U"</span>,
-<a name="l00063"></a>00063  <span class="stringliteral">"ERR_B"</span>,
-<a name="l00064"></a>00064  <span class="comment">//"ERR_G",</span>
-<a name="l00065"></a>00065  <span class="stringliteral">"ERR_V"</span>, <span class="comment">/* G uses V */</span>
-<a name="l00066"></a>00066  <span class="stringliteral">"ERR_V"</span>,
-<a name="l00067"></a>00067  <span class="stringliteral">"ERR_R"</span>,
-<a name="l00068"></a>00068  <span class="stringliteral">"ERR_I"</span>,
-<a name="l00069"></a>00069  <span class="stringliteral">"ERR_Z"</span>};
-<a name="l00070"></a>00070 
-<a name="l00071"></a>00071 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_COL[FORS_NUM_FILTER] = 
-<a name="l00072"></a>00072 {<span class="stringliteral">"U_B"</span>,
-<a name="l00073"></a>00073  <span class="stringliteral">"B_V"</span>,
-<a name="l00074"></a>00074  <span class="stringliteral">"B_V"</span>,
-<a name="l00075"></a>00075  <span class="stringliteral">"B_V"</span>,
-<a name="l00076"></a>00076  <span class="stringliteral">"V_R"</span>,
-<a name="l00077"></a>00077  <span class="stringliteral">"V_R"</span>,
-<a name="l00078"></a>00078  <span class="stringliteral">"?Z?"</span>};
-<a name="l00079"></a>00079 
-<a name="l00080"></a>00080 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_RA   = <span class="stringliteral">"RA"</span>;
-<a name="l00081"></a>00081 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_DEC  = <span class="stringliteral">"DEC"</span>;
-<a name="l00082"></a>00082 <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_NAME = <span class="stringliteral">"OBJECT"</span>;
-<a name="l00083"></a>00083 
-<a name="l00094"></a><a class="code" href="group__test__simulate.html#g97ac5cde48d3ca9bdeae2a8fb53d3207">00094</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="group__test__simulate.html#g97ac5cde48d3ca9bdeae2a8fb53d3207">det_nx</a> = 400;        <span class="comment">/* Unbinned detector pixels */</span>
-<a name="l00095"></a><a class="code" href="group__test__simulate.html#g90b0fe857eac7b0228e6eaebc6a879e6">00095</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="group__test__simulate.html#g90b0fe857eac7b0228e6eaebc6a879e6">det_ny</a> = 400;
-<a name="l00096"></a><a class="code" href="group__test__simulate.html#gd61bdee2299fb9a98deab7beb8093286">00096</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="group__test__simulate.html#gd61bdee2299fb9a98deab7beb8093286">binx</a> = 2;
-<a name="l00097"></a><a class="code" href="group__test__simulate.html#g0e7ec816bf2ae617d9116fc3e269f18d">00097</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="group__test__simulate.html#g0e7ec816bf2ae617d9116fc3e269f18d">biny</a> = 2;
-<a name="l00098"></a><a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">00098</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>   = 4.0;       <span class="comment">/* ADU */</span>
-<a name="l00099"></a><a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">00099</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a> = 0.78;   <span class="comment">/* e- / ADU */</span>
-<a name="l00100"></a>00100 
-<a name="l00101"></a><a class="code" href="group__test__simulate.html#g6cf924040f9af8a76b40f050c6291059">00101</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g6cf924040f9af8a76b40f050c6291059">bias_avg</a> = 200; <span class="comment">/* ADU */</span>
-<a name="l00102"></a><a class="code" href="group__test__simulate.html#g61af7be698d059568dcd5fff61aa606f">00102</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="group__test__simulate.html#g61af7be698d059568dcd5fff61aa606f">dark_avg</a> = 50;  <span class="comment">/* ADU */</span>
-<a name="l00103"></a><a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">00103</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = <span class="stringliteral">"fors2"</span>;
-<a name="l00104"></a><a class="code" href="group__test__simulate.html#g8a365694ad27ccccf1a8c2b57d763e35">00104</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__test__simulate.html#g8a365694ad27ccccf1a8c2b57d763e35">chip_id</a> = <span class="stringliteral">"Test chip 234"</span>;
-<a name="l00105"></a><a class="code" href="group__test__simulate.html#gbd15ae642503439f227fb714812437dc">00105</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> <a class="code" href="group__test__simulate.html#gbd15ae642503439f227fb714812437dc">read_clock</a> = <span class="stringliteral">"200Kps/2ports/low_gain"</span>;
-<a name="l00106"></a>00106 
-<a name="l00114"></a>00114 <span class="keyword">static</span> cpl_frame *
-<a name="l00115"></a><a class="code" href="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a">00115</a> <a class="code" href="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a">frame_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)
-<a name="l00116"></a>00116 {
-<a name="l00117"></a>00117     cpl_frame *f = cpl_frame_new();
-<a name="l00118"></a>00118 
-<a name="l00119"></a>00119     cpl_frame_set_filename(f, filename);
-<a name="l00120"></a>00120     cpl_frame_set_tag     (f, tag);
-<a name="l00121"></a>00121     cpl_frame_set_group   (f, group);
-<a name="l00122"></a>00122 
-<a name="l00123"></a>00123     <span class="keywordflow">return</span> f;
-<a name="l00124"></a>00124 }
-<a name="l00125"></a>00125 
-<a name="l00131"></a>00131 <span class="keywordtype">void</span>
-<a name="l00132"></a><a class="code" href="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2">00132</a> <a class="code" href="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2">create_standard_keys</a>(cpl_propertylist *header, <span class="keywordtype">double</span> exptime)
-<a name="l00133"></a>00133 {
-<a name="l00134"></a>00134     <span class="keywordtype">int</span> nx = <a class="code" href="group__test__simulate.html#g97ac5cde48d3ca9bdeae2a8fb53d3207">det_nx</a> / <a class="code" href="group__test__simulate.html#gd61bdee2299fb9a98deab7beb8093286">binx</a>;
-<a name="l00135"></a>00135     <span class="keywordtype">int</span> ny = <a class="code" href="group__test__simulate.html#g90b0fe857eac7b0228e6eaebc6a879e6">det_ny</a> / <a class="code" href="group__test__simulate.html#g0e7ec816bf2ae617d9116fc3e269f18d">biny</a>;
-<a name="l00136"></a>00136 
-<a name="l00137"></a>00137     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO DPR TYPE"</span>, <span class="stringliteral">"some"</span>);
-<a name="l00138"></a>00138     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO TPL ID"</span>, <span class="stringliteral">"tpl id."</span>);
-<a name="l00139"></a>00139     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO INS COLL NAME"</span>, <span class="stringliteral">"collimator name"</span>);
-<a name="l00140"></a>00140     cpl_propertylist_update_string(header, <span class="stringliteral">"ARCFILE"</span>, <span class="stringliteral">"archive filename"</span>);
-<a name="l00141"></a>00141     
-<a name="l00142"></a>00142     cpl_propertylist_update_string(header, <a class="code" href="group__fors__pfits.html#g783bff15136576398917fe349d55aab1">FORS_PFITS_INSTRUME</a>, <a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a>);
-<a name="l00143"></a>00143     cpl_propertylist_update_string(header, <a class="code" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">FORS_PFITS_FILTER_NAME</a>, <span class="stringliteral">"R_SPECIAL"</span>);
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145     cpl_propertylist_update_double(header, <a class="code" href="group__fors__pfits.html#g4a9f2c688a6202767e8c004478488994">FORS_PFITS_AIRMASS_START</a>, 1.156);    
-<a name="l00146"></a>00146     cpl_propertylist_update_double(header, <a class="code" href="group__fors__pfits.html#gc3c14efc5b8bb4954172110153ed1965">FORS_PFITS_AIRMASS_END</a>  , 1.619);    
-<a name="l00147"></a>00147     
-<a name="l00148"></a>00148     cpl_propertylist_update_int   (header, <a class="code" href="group__fors__pfits.html#g186fc8a1532d8bf60c670ca0071d9047">FORS_PFITS_DET_NX</a>, nx);
-<a name="l00149"></a>00149     cpl_propertylist_update_int   (header, <a class="code" href="group__fors__pfits.html#g3c7312a701e7edde8da903a85e83ff3f">FORS_PFITS_DET_NY</a>, ny);
-<a name="l00150"></a>00150     cpl_propertylist_update_int   (header, <a class="code" href="group__fors__pfits.html#ge144a58d19a4028977a4993eb37211b6">FORS_PFITS_BINX</a>, <a class="code" href="group__test__simulate.html#gd61bdee2299fb9a98deab7beb8093286">binx</a>);
-<a name="l00151"></a>00151     cpl_propertylist_update_int   (header, <a class="code" href="group__fors__pfits.html#gac44799b56c43a52fd8846bb493c4444">FORS_PFITS_BINY</a>, <a class="code" href="group__test__simulate.html#g0e7ec816bf2ae617d9116fc3e269f18d">biny</a>);
-<a name="l00152"></a>00152     cpl_propertylist_update_int   (header, <a class="code" href="group__fors__pfits.html#ge9a36044b50b5432f2c9018c58a3b98c">FORS_PFITS_OVERSCANX</a>, 0);
-<a name="l00153"></a>00153     cpl_propertylist_update_int   (header, <a class="code" href="group__fors__pfits.html#g7aee125e2c5769eb4927a296a47a63c0">FORS_PFITS_OVERSCANY</a>, 0);
-<a name="l00154"></a>00154     cpl_propertylist_update_int   (header, <a class="code" href="group__fors__pfits.html#g06cb15f701f99b2615b057941aa115ae">FORS_PFITS_PRESCANX</a>, 0);
-<a name="l00155"></a>00155     cpl_propertylist_update_int   (header, <a class="code" href="group__fors__pfits.html#g2701275da3ccfdcbf3ceaf2b3dcc02fc">FORS_PFITS_PRESCANY</a>, 0);
-<a name="l00156"></a>00156 
-<a name="l00157"></a>00157     cpl_propertylist_update_double(header, <a class="code" href="group__fors__pfits.html#g4eb732430cac676ad4e2bf1f68a3f5f0">FORS_PFITS_PIXSCALE</a>, 0.126);
-<a name="l00158"></a>00158     
-<a name="l00159"></a>00159     cpl_propertylist_update_int(header, <a class="code" href="group__fors__pfits.html#gfaec82e5fe2051be0f32d0e8e01a7060">FORS_PFITS_OUTPUTS</a>, 1);
-<a name="l00160"></a>00160     cpl_propertylist_update_double(header, <a class="code" href="group__fors__pfits.html#ge8b3e3bbfe186850a3fa063e98ddcc1f">FORS_PFITS_CONAD</a>[0], <a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>);
-<a name="l00161"></a>00161     
-<a name="l00162"></a>00162     <span class="comment">/* Convert RON to e- units */</span>
-<a name="l00163"></a>00163     cpl_propertylist_update_double(header, <a class="code" href="group__fors__pfits.html#gff6c938b87cb95065c7503d2718d7fd1">FORS_PFITS_RON</a>[0], <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>*<a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>);
-<a name="l00164"></a>00164     cpl_propertylist_update_double(header, <a class="code" href="group__fors__pfits.html#g5dc9cfd94e4e891afb13c237ca28b031">FORS_PFITS_EXPOSURE_TIME</a>, exptime);
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166     cpl_propertylist_update_string(header, <a class="code" href="group__fors__pfits.html#g0eb4a071376ffab7bd7fb36186e16dda">FORS_PFITS_CHIP_ID</a>, <a class="code" href="group__test__simulate.html#g8a365694ad27ccccf1a8c2b57d763e35">chip_id</a>);
-<a name="l00167"></a>00167     cpl_propertylist_update_string(header, <a class="code" href="group__fors__pfits.html#g43f0b7ed1c32b140f3da959293f924eb">FORS_PFITS_READ_CLOCK</a>, <a class="code" href="group__test__simulate.html#gbd15ae642503439f227fb714812437dc">read_clock</a>);
-<a name="l00168"></a>00168     
-<a name="l00169"></a>00169     <span class="comment">/* WCS info, fine tuned to match simulated catalogue */</span>
-<a name="l00170"></a>00170     {
-<a name="l00171"></a>00171         <span class="keyword">struct </span>{
-<a name="l00172"></a>00172             <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
-<a name="l00173"></a>00173             <span class="keywordtype">double</span> value;
-<a name="l00174"></a>00174         } data[] = {
-<a name="l00175"></a>00175             {<span class="stringliteral">"CRVAL1"</span>, 8.1368333333},
-<a name="l00176"></a>00176             {<span class="stringliteral">"CRVAL2"</span>, -46.9576388889},
-<a name="l00177"></a>00177             {<span class="stringliteral">"CRPIX1"</span>, 1},
-<a name="l00178"></a>00178             {<span class="stringliteral">"CRPIX2"</span>, 1},
-<a name="l00179"></a>00179 <span class="comment">//            {"CD1_1", 5.81347849634012E-21}, </span>
-<a name="l00180"></a>00180 <span class="comment">//            {"CD1_2", 9.49444444444444E-05},</span>
-<a name="l00181"></a>00181 <span class="comment">//            {"CD2_1",-9.49444444444444E-05}, </span>
-<a name="l00182"></a>00182 <span class="comment">//            {"CD2_2",-5.81347849634012E-21},</span>
-<a name="l00183"></a>00183             {<span class="stringliteral">"CD1_1"</span>, 5.81347849634012E-20}, 
-<a name="l00184"></a>00184             {<span class="stringliteral">"CD1_2"</span>, 9.49444444444444E-04},
-<a name="l00185"></a>00185             {<span class="stringliteral">"CD2_1"</span>,-9.49444444444444E-04}, 
-<a name="l00186"></a>00186             {<span class="stringliteral">"CD2_2"</span>,-5.81347849634012E-20},
-<a name="l00187"></a>00187             {<span class="stringliteral">"PV2_1"</span>, 1.0},
-<a name="l00188"></a>00188             {<span class="stringliteral">"PV2_2"</span>, 0.0},
-<a name="l00189"></a>00189             {<span class="stringliteral">"PV2_3"</span>, 42.0},
-<a name="l00190"></a>00190             {<span class="stringliteral">"PV2_4"</span>, 0.0}, 
-<a name="l00191"></a>00191             {<span class="stringliteral">"PV2_5"</span>, 0.0}
-<a name="l00192"></a>00192         };
-<a name="l00193"></a>00193         
-<a name="l00194"></a>00194         <span class="keywordtype">unsigned</span> i;
-<a name="l00195"></a>00195         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(data) / <span class="keyword">sizeof</span>(*data); i++) {
-<a name="l00196"></a>00196             cpl_propertylist_append_double(header, data[i].name, data[i].value);
-<a name="l00197"></a>00197         }
-<a name="l00198"></a>00198     }
-<a name="l00199"></a>00199     
-<a name="l00200"></a>00200     <span class="keywordflow">return</span>;
-<a name="l00201"></a>00201 }
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204 <span class="preprocessor">#undef cleanup</span>
-<a name="l00205"></a>00205 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00206"></a>00206 <span class="preprocessor">do { \</span>
-<a name="l00207"></a>00207 <span class="preprocessor">    fors_image_delete(&bias); \</span>
-<a name="l00208"></a>00208 <span class="preprocessor">    cpl_propertylist_delete(header); \</span>
-<a name="l00209"></a>00209 <span class="preprocessor">} while(0)</span>
-<a name="l00210"></a>00210 <span class="preprocessor"></span>
-<a name="l00220"></a>00220 cpl_frame *
-<a name="l00221"></a><a class="code" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">00221</a> <a class="code" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">create_bias</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)
-<a name="l00222"></a>00222 {
-<a name="l00223"></a>00223     <span class="keywordtype">int</span> nx = <a class="code" href="group__test__simulate.html#g97ac5cde48d3ca9bdeae2a8fb53d3207">det_nx</a> / <a class="code" href="group__test__simulate.html#gd61bdee2299fb9a98deab7beb8093286">binx</a>;
-<a name="l00224"></a>00224     <span class="keywordtype">int</span> ny = <a class="code" href="group__test__simulate.html#g90b0fe857eac7b0228e6eaebc6a879e6">det_ny</a> / <a class="code" href="group__test__simulate.html#g0e7ec816bf2ae617d9116fc3e269f18d">biny</a>;
-<a name="l00225"></a>00225     <span class="keywordtype">double</span> exptime = 0.0;
-<a name="l00226"></a>00226     
-<a name="l00227"></a>00227     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00228"></a>00228     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00229"></a>00229     <a class="code" href="struct__fors__image.html">fors_image</a> *bias = NULL;
-<a name="l00230"></a>00230     cpl_propertylist *header = cpl_propertylist_new();
-<a name="l00231"></a>00231     
-<a name="l00232"></a>00232     <a class="code" href="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2">create_standard_keys</a>(header, exptime);
-<a name="l00233"></a>00233     cpl_propertylist_erase(header, <a class="code" href="group__fors__pfits.html#g787b1866f752fde2b8ffffc413c1bc4b">FORS_PFITS_FILTER_NAME</a>); <span class="comment">/* No filter */</span>
-<a name="l00234"></a>00234 
-<a name="l00235"></a>00235     {
-<a name="l00236"></a>00236         <span class="keywordtype">int</span> x, y;
-<a name="l00237"></a>00237         <span class="keywordflow">for</span> (y = 1; y <= ny; y++)
-<a name="l00238"></a>00238             <span class="keywordflow">for</span> (x = 1; x <= nx; x++) {
-<a name="l00239"></a>00239                 cpl_image_set(data   , x, y, 
-<a name="l00240"></a>00240                               (<span class="keywordtype">int</span>)(<a class="code" href="group__test__simulate.html#g6cf924040f9af8a76b40f050c6291059">bias_avg</a> + <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>*<a class="code" href="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044">fors_rand_gauss</a>() + 0.5));
-<a name="l00241"></a>00241                 cpl_image_set(variance, x, y, <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>*<a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>);
-<a name="l00242"></a>00242             }
-<a name="l00243"></a>00243     }
-<a name="l00244"></a>00244     
-<a name="l00245"></a>00245     bias = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l00246"></a>00246     <a class="code" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save</a>(bias, header, filename);
-<a name="l00247"></a>00247 
-<a name="l00248"></a>00248     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,
-<a name="l00249"></a>00249             <span class="stringliteral">"Saving bias to %s failed"</span>, filename );
-<a name="l00250"></a>00250 
-<a name="l00251"></a>00251     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00252"></a>00252     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a">frame_new</a>(filename, tag, group);
-<a name="l00253"></a>00253 }
-<a name="l00254"></a>00254 
-<a name="l00255"></a>00255 <span class="preprocessor">#undef cleanup</span>
-<a name="l00256"></a>00256 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00257"></a>00257 <span class="preprocessor">do { \</span>
-<a name="l00258"></a>00258 <span class="preprocessor">    fors_image_delete(&dark); \</span>
-<a name="l00259"></a>00259 <span class="preprocessor">    cpl_propertylist_delete(header); \</span>
-<a name="l00260"></a>00260 <span class="preprocessor">} while(0)</span>
-<a name="l00261"></a>00261 <span class="preprocessor"></span>
-<a name="l00272"></a>00272 cpl_frame *
-<a name="l00273"></a><a class="code" href="group__test__simulate.html#gb54d8ef52e4f8e0407e522565b8919f6">00273</a> <a class="code" href="group__test__simulate.html#gb54d8ef52e4f8e0407e522565b8919f6">create_dark</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)
-<a name="l00274"></a>00274 {
-<a name="l00275"></a>00275     <span class="keywordtype">int</span> nx = <a class="code" href="group__test__simulate.html#g97ac5cde48d3ca9bdeae2a8fb53d3207">det_nx</a> / <a class="code" href="group__test__simulate.html#gd61bdee2299fb9a98deab7beb8093286">binx</a>;
-<a name="l00276"></a>00276     <span class="keywordtype">int</span> ny = <a class="code" href="group__test__simulate.html#g90b0fe857eac7b0228e6eaebc6a879e6">det_ny</a> / <a class="code" href="group__test__simulate.html#g0e7ec816bf2ae617d9116fc3e269f18d">biny</a>;
-<a name="l00277"></a>00277     <span class="keywordtype">double</span> exptime = 3.0;
-<a name="l00278"></a>00278     
-<a name="l00279"></a>00279     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00280"></a>00280     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00281"></a>00281     <a class="code" href="struct__fors__image.html">fors_image</a> *dark = NULL;
-<a name="l00282"></a>00282     cpl_propertylist *header = cpl_propertylist_new();
-<a name="l00283"></a>00283     
-<a name="l00284"></a>00284     <a class="code" href="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2">create_standard_keys</a>(header, exptime);
-<a name="l00285"></a>00285 
-<a name="l00286"></a>00286     {
-<a name="l00287"></a>00287         <span class="keywordtype">int</span> x, y;
-<a name="l00288"></a>00288         <span class="keywordflow">for</span> (y = 1; y <= ny; y++)
-<a name="l00289"></a>00289             <span class="keywordflow">for</span> (x = 1; x <= nx; x++) {
-<a name="l00290"></a>00290                 <span class="keywordtype">double</span> var = <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>*<a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a> + <a class="code" href="group__test__simulate.html#g61af7be698d059568dcd5fff61aa606f">dark_avg</a>/<a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>;
-<a name="l00291"></a>00291                 
-<a name="l00292"></a>00292                 cpl_image_set(data   , x, y, 
-<a name="l00293"></a>00293                               (<span class="keywordtype">int</span>)(<a class="code" href="group__test__simulate.html#g6cf924040f9af8a76b40f050c6291059">bias_avg</a> + <a class="code" href="group__test__simulate.html#g61af7be698d059568dcd5fff61aa606f">dark_avg</a> + 
-<a name="l00294"></a>00294                                     sqrt(var)*<a class="code" href="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044">fors_rand_gauss</a>() 
-<a name="l00295"></a>00295                                     + 0.5));
-<a name="l00296"></a>00296                 cpl_image_set(variance, x, y, var);
-<a name="l00297"></a>00297             }
-<a name="l00298"></a>00298     }
-<a name="l00299"></a>00299     
-<a name="l00300"></a>00300     dark = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l00301"></a>00301     <a class="code" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save</a>(dark, header, filename);
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, 
-<a name="l00304"></a>00304             <span class="stringliteral">"Saving dark to %s failed"</span>, filename );
-<a name="l00305"></a>00305     
-<a name="l00306"></a>00306     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00307"></a>00307     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a">frame_new</a>(filename, tag, group);
-<a name="l00308"></a>00308 }
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310 
-<a name="l00311"></a>00311 <span class="preprocessor">#undef cleanup</span>
-<a name="l00312"></a>00312 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00313"></a>00313 <span class="preprocessor">do { \</span>
-<a name="l00314"></a>00314 <span class="preprocessor">    fors_image_delete(&sflat); \</span>
-<a name="l00315"></a>00315 <span class="preprocessor">    cpl_propertylist_delete(header); \</span>
-<a name="l00316"></a>00316 <span class="preprocessor">} while(0)</span>
-<a name="l00317"></a>00317 <span class="preprocessor"></span>
-<a name="l00327"></a>00327 cpl_frame *
-<a name="l00328"></a><a class="code" href="group__test__simulate.html#g474967528c2d1de8ce4dadd24da817ce">00328</a> <a class="code" href="group__test__simulate.html#g474967528c2d1de8ce4dadd24da817ce">create_screen_flat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)
-<a name="l00329"></a>00329 {
-<a name="l00330"></a>00330     <span class="keywordtype">int</span> nx = <a class="code" href="group__test__simulate.html#g97ac5cde48d3ca9bdeae2a8fb53d3207">det_nx</a> / <a class="code" href="group__test__simulate.html#gd61bdee2299fb9a98deab7beb8093286">binx</a>;
-<a name="l00331"></a>00331     <span class="keywordtype">int</span> ny = <a class="code" href="group__test__simulate.html#g90b0fe857eac7b0228e6eaebc6a879e6">det_ny</a> / <a class="code" href="group__test__simulate.html#g0e7ec816bf2ae617d9116fc3e269f18d">biny</a>;
-<a name="l00332"></a>00332     <span class="keywordtype">double</span> exptime = 3.0;
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00335"></a>00335     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00336"></a>00336     <a class="code" href="struct__fors__image.html">fors_image</a> *sflat = NULL;
-<a name="l00337"></a>00337     cpl_propertylist *header = cpl_propertylist_new();
-<a name="l00338"></a>00338     
-<a name="l00339"></a>00339     <a class="code" href="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2">create_standard_keys</a>(header, exptime);
-<a name="l00340"></a>00340 
-<a name="l00341"></a>00341     {
-<a name="l00342"></a>00342         <span class="keywordtype">int</span> x, y;
-<a name="l00343"></a>00343         <span class="keywordflow">for</span> (y = 1; y <= ny; y++)
-<a name="l00344"></a>00344             <span class="keywordflow">for</span> (x = 1; x <= nx; x++) {
-<a name="l00345"></a>00345                 <span class="keywordtype">double</span> medium_scale_structure = 1000*(2 + sin(x*30.0/nx + y*30.0/ny));
-<a name="l00346"></a>00346                 <span class="keywordtype">double</span>  large_scale_structure = 1000*(1 + sin(x*4.0/nx));
-<a name="l00347"></a>00347                 <span class="keywordtype">double</span> flat = 5000 + medium_scale_structure + large_scale_structure;
-<a name="l00348"></a>00348                 <span class="keywordtype">double</span> var = <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>*<a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a> + flat/<a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>;
-<a name="l00349"></a>00349                 
-<a name="l00350"></a>00350                 cpl_image_set(data   , x, y, 
-<a name="l00351"></a>00351                               (<span class="keywordtype">int</span>)(<a class="code" href="group__test__simulate.html#g6cf924040f9af8a76b40f050c6291059">bias_avg</a> + flat + sqrt(var)*<a class="code" href="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044">fors_rand_gauss</a>() + 0.5));
-<a name="l00352"></a>00352                 cpl_image_set(variance, x, y, var);
-<a name="l00353"></a>00353             }
-<a name="l00354"></a>00354     }
-<a name="l00355"></a>00355     
-<a name="l00356"></a>00356     sflat = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l00357"></a>00357     <a class="code" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save</a>(sflat, header, filename);
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, 
-<a name="l00360"></a>00360             <span class="stringliteral">"Saving screen flat to %s failed"</span>, filename );
-<a name="l00361"></a>00361     
-<a name="l00362"></a>00362     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00363"></a>00363     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a">frame_new</a>(filename, tag, group);
-<a name="l00364"></a>00364 }
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366 <span class="preprocessor">#undef cleanup</span>
-<a name="l00367"></a>00367 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00368"></a>00368 <span class="preprocessor">do { \</span>
-<a name="l00369"></a>00369 <span class="preprocessor">    fors_image_delete(&sflat); \</span>
-<a name="l00370"></a>00370 <span class="preprocessor">    cpl_propertylist_delete(header); \</span>
-<a name="l00371"></a>00371 <span class="preprocessor">} while(0)</span>
-<a name="l00372"></a>00372 <span class="preprocessor"></span>
-<a name="l00383"></a>00383 cpl_frame *
-<a name="l00384"></a><a class="code" href="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669">00384</a> <a class="code" href="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669">create_sky_flat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group,
-<a name="l00385"></a>00385                 <span class="keywordtype">double</span> exptime)
-<a name="l00386"></a>00386 {
-<a name="l00387"></a>00387     <span class="keywordtype">int</span> nx = <a class="code" href="group__test__simulate.html#g97ac5cde48d3ca9bdeae2a8fb53d3207">det_nx</a> / <a class="code" href="group__test__simulate.html#gd61bdee2299fb9a98deab7beb8093286">binx</a>;
-<a name="l00388"></a>00388     <span class="keywordtype">int</span> ny = <a class="code" href="group__test__simulate.html#g90b0fe857eac7b0228e6eaebc6a879e6">det_ny</a> / <a class="code" href="group__test__simulate.html#g0e7ec816bf2ae617d9116fc3e269f18d">biny</a>;
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00391"></a>00391     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga0147d042c3e054d9e3d2402f4ebe084">FORS_IMAGE_TYPE</a>);
-<a name="l00392"></a>00392     <a class="code" href="struct__fors__image.html">fors_image</a> *sflat = NULL;
-<a name="l00393"></a>00393     cpl_propertylist *header = cpl_propertylist_new();
-<a name="l00394"></a>00394     
-<a name="l00395"></a>00395     <a class="code" href="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2">create_standard_keys</a>(header, exptime);
-<a name="l00396"></a>00396 
-<a name="l00397"></a>00397     {
-<a name="l00398"></a>00398         <span class="keywordtype">int</span> x, y;
-<a name="l00399"></a>00399         <span class="keywordflow">for</span> (y = 1; y <= ny; y++)
-<a name="l00400"></a>00400             <span class="keywordflow">for</span> (x = 1; x <= nx; x++) {
-<a name="l00401"></a>00401                 <span class="keywordtype">double</span> medium_scale_structure = 1000*(2 + sin(x*30.0/nx - y*10.0/ny));
-<a name="l00402"></a>00402                 <span class="keywordtype">double</span>  large_scale_structure = 1000*(1 + sin(x*4.0/nx));
-<a name="l00403"></a>00403                 <span class="keywordtype">double</span> flat = exptime*(5000 + 
-<a name="l00404"></a>00404                                        medium_scale_structure + 
-<a name="l00405"></a>00405                                        large_scale_structure);
-<a name="l00406"></a>00406                 <span class="keywordtype">double</span> var = <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>*<a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a> + flat/<a class="code" href="group__test__simulate.html#g7df19c80af6c089b9838fa49031972c5">conad</a>;
-<a name="l00407"></a>00407                 
-<a name="l00408"></a>00408                 cpl_image_set(data   , x, y, 
-<a name="l00409"></a>00409                               (<span class="keywordtype">int</span>)(<a class="code" href="group__test__simulate.html#g6cf924040f9af8a76b40f050c6291059">bias_avg</a> + flat + sqrt(var)*<a class="code" href="group__fors__utils.html#ga5ff2321d51f9a87b445ccc9392e8044">fors_rand_gauss</a>() + 0.5));
-<a name="l00410"></a>00410                 cpl_image_set(variance, x, y, var);
-<a name="l00411"></a>00411             }
-<a name="l00412"></a>00412     }
-<a name="l00413"></a>00413     
-<a name="l00414"></a>00414     sflat = <a class="code" href="group__fors__image.html#g1ea76d7c8217ae2f06ad42434a89ca65">fors_image_new</a>(data, variance);
-<a name="l00415"></a>00415     <a class="code" href="group__fors__image.html#gba23ac19606c94a04e9de87bdfe74b42">fors_image_save</a>(sflat, header, filename);
-<a name="l00416"></a>00416 
-<a name="l00417"></a>00417     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, 
-<a name="l00418"></a>00418             <span class="stringliteral">"Saving sky flat to %s failed"</span>, filename );
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00421"></a>00421     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a">frame_new</a>(filename, tag, group);
-<a name="l00422"></a>00422 }
-<a name="l00423"></a>00423 
-<a name="l00431"></a>00431 cpl_frame *
-<a name="l00432"></a><a class="code" href="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b">00432</a> <a class="code" href="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b">create_standard</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)
-<a name="l00433"></a>00433 {
-<a name="l00434"></a>00434     <span class="comment">// fixme: add stars</span>
-<a name="l00435"></a>00435     <span class="keywordtype">double</span> exptime = 1.0;
-<a name="l00436"></a>00436     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669">create_sky_flat</a>(filename, tag, group, exptime);
-<a name="l00437"></a>00437 }
-<a name="l00438"></a>00438 
-<a name="l00439"></a>00439 
-<a name="l00440"></a>00440 <span class="preprocessor">#undef cleanup</span>
-<a name="l00441"></a>00441 <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00442"></a>00442 <span class="preprocessor">do { \</span>
-<a name="l00443"></a>00443 <span class="preprocessor">    cpl_table_delete(t); \</span>
-<a name="l00444"></a>00444 <span class="preprocessor">} while(0)</span>
-<a name="l00445"></a>00445 <span class="preprocessor"></span>
-<a name="l00453"></a>00453 cpl_frame *
-<a name="l00454"></a><a class="code" href="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410">00454</a> <a class="code" href="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410">create_std_cat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)
-<a name="l00455"></a>00455 {
-<a name="l00456"></a>00456     cpl_table *t;
-<a name="l00457"></a>00457     <span class="keyword">struct </span>{
-<a name="l00458"></a>00458         <span class="keywordtype">double</span> ra, dec;
-<a name="l00459"></a>00459         <span class="keywordtype">double</span> magnitude, dmagnitude;
-<a name="l00460"></a>00460         <span class="keywordtype">double</span> col;
-<a name="l00461"></a>00461         <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
-<a name="l00462"></a>00462     } 
-<a name="l00463"></a>00463     data[] =  {
-<a name="l00464"></a>00464         {8.15958, -47.0347, 15.824000, 0.001, 0.8, <span class="stringliteral">"object 1"</span>},
-<a name="l00465"></a>00465         {8.14792, -46.9664, 12.895000, 0.002, -0.2, <span class="stringliteral">""</span>},
-<a name="l00466"></a>00466         {8.15083, -47.0092, 12.861000, 0.003, -0.3, <span class="stringliteral">" dff bject 1"</span>},
-<a name="l00467"></a>00467         {8.15583, -47.0222, 16.540001, 0.001, 0.7, <span class="stringliteral">"-9"</span>},
-<a name="l00468"></a>00468         {8.17167, -47.10  , 11.970000, 0.005, 0.12, NULL},
-<a name="l00469"></a>00469         {8.14833, -47.0567, 13.861000, 0.003, -0.2, <span class="stringliteral">""</span>},
-<a name="l00470"></a>00470         {8.1475 , -47.0411, 13.903000, 0.001, -0.8, <span class="stringliteral">"dddddddobject 1"</span>},
-<a name="l00471"></a>00471         {7.92542,  2.62917, 15.446000, 0.002, -0.2, <span class="stringliteral">"start 1"</span>},
-<a name="l00472"></a>00472     };
-<a name="l00473"></a>00473 
-<a name="l00474"></a>00474     <span class="keywordtype">int</span> N = <span class="keyword">sizeof</span>(data) / <span class="keyword">sizeof</span>(*data);
-<a name="l00475"></a>00475     <span class="keywordtype">int</span> i;
-<a name="l00476"></a>00476 
-<a name="l00477"></a>00477     t = cpl_table_new(N);
-<a name="l00478"></a>00478     cpl_table_new_column(t, FORS_DATA_STD_RA , CPL_TYPE_DOUBLE);
-<a name="l00479"></a>00479     cpl_table_new_column(t, FORS_DATA_STD_DEC, CPL_TYPE_DOUBLE);
-<a name="l00480"></a>00480     cpl_table_new_column(t, FORS_DATA_STD_NAME, CPL_TYPE_STRING);
-<a name="l00481"></a>00481     
-<a name="l00482"></a>00482     <span class="keywordflow">for</span> (i = 0; i < FORS_NUM_FILTER; i++) {
-<a name="l00483"></a>00483         <span class="keywordflow">if</span> (!cpl_table_has_column(t, FORS_DATA_STD_MAG[i])) {
-<a name="l00484"></a>00484         cpl_table_new_column(t, FORS_DATA_STD_MAG[i], CPL_TYPE_FLOAT);
-<a name="l00485"></a>00485     }
-<a name="l00486"></a>00486         <span class="keywordflow">if</span> (!cpl_table_has_column(t, FORS_DATA_STD_DMAG[i])) {
-<a name="l00487"></a>00487         cpl_table_new_column(t, FORS_DATA_STD_DMAG[i], CPL_TYPE_FLOAT);
-<a name="l00488"></a>00488     }
-<a name="l00489"></a>00489         <span class="keywordflow">if</span> (!cpl_table_has_column(t, FORS_DATA_STD_COL[i])) {
-<a name="l00490"></a>00490             cpl_table_new_column(t, FORS_DATA_STD_COL[i], CPL_TYPE_FLOAT);
-<a name="l00491"></a>00491         }
-<a name="l00492"></a>00492     }
-<a name="l00493"></a>00493 
-<a name="l00494"></a>00494     <span class="keywordflow">for</span> (i = 0; i < N; i++) {
-<a name="l00495"></a>00495         <span class="keywordtype">int</span> j;
-<a name="l00496"></a>00496         
-<a name="l00497"></a>00497         cpl_table_set_double(t, FORS_DATA_STD_RA  , i, data[i].ra);
-<a name="l00498"></a>00498         cpl_table_set_double(t, FORS_DATA_STD_DEC , i, data[i].dec);
-<a name="l00499"></a>00499         cpl_table_set_string(t, FORS_DATA_STD_NAME, i, data[i].name);
-<a name="l00500"></a>00500         
-<a name="l00501"></a>00501         <span class="keywordflow">for</span> (j = 0; j < FORS_NUM_FILTER; j++) {
-<a name="l00502"></a>00502             cpl_table_set_float (t, FORS_DATA_STD_MAG[j], i, data[i].magnitude);
-<a name="l00503"></a>00503             cpl_table_set_float (t, FORS_DATA_STD_DMAG[j], i, data[i].dmagnitude);
-<a name="l00504"></a>00504             cpl_table_set_float (t, FORS_DATA_STD_COL[j], i, data[i].col);
-<a name="l00505"></a>00505         }
-<a name="l00506"></a>00506     }
-<a name="l00507"></a>00507 
-<a name="l00508"></a>00508     cpl_table_save(t, NULL, NULL, filename, CPL_IO_DEFAULT);
-<a name="l00509"></a>00509     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, 
-<a name="l00510"></a>00510             <span class="stringliteral">"Failed to save standard catalogue to %s"</span>, filename );
-<a name="l00511"></a>00511     
-<a name="l00512"></a>00512     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00513"></a>00513     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a">frame_new</a>(filename, tag, group);
-<a name="l00514"></a>00514 }
-<a name="l00515"></a>00515 
-<a name="l00516"></a>00516 
-<a name="l00517"></a>00517 
-<a name="l00518"></a>00518 <span class="preprocessor">#undef cleanup</span>
-<a name="l00519"></a><a class="code" href="group__test__simulate.html#g57cf6e6e2826eb178fd2d9c3e5695343">00519</a> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span>
-<a name="l00520"></a>00520 <span class="preprocessor">do { \</span>
-<a name="l00521"></a>00521 <span class="preprocessor">    cpl_table_delete(t); \</span>
-<a name="l00522"></a>00522 <span class="preprocessor">} while(0)</span>
-<a name="l00523"></a>00523 <span class="preprocessor"></span>
-<a name="l00531"></a>00531 cpl_frame *
-<a name="l00532"></a><a class="code" href="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5">00532</a> <a class="code" href="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5">create_phot_table</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)
-<a name="l00533"></a>00533 {
-<a name="l00534"></a>00534     cpl_table *t;
-<a name="l00535"></a>00535     <span class="keyword">struct </span>{
-<a name="l00536"></a>00536         <span class="keywordtype">char</span>    band;
-<a name="l00537"></a>00537         <span class="keywordtype">double</span> ext_coeff, dext_coeff;
-<a name="l00538"></a>00538         <span class="keywordtype">double</span> color_term, dcolor_term;
-<a name="l00539"></a>00539         <span class="keywordtype">double</span> expected_zeropoint, dexpected_zeropoint;
-<a name="l00540"></a>00540     } 
-<a name="l00541"></a>00541     data[FORS_NUM_FILTER] = {
-<a name="l00542"></a>00542         {<span class="charliteral">'U'</span>, 0.4  , 0.01, -0.076, 0.001, 20, 0.2},
-<a name="l00543"></a>00543         {<span class="charliteral">'B'</span>, 0.05 , 0.01,  0.033, 0.001, 21.123456, 0.2},
-<a name="l00544"></a>00544         {<span class="charliteral">'G'</span>, 0.1  , 0.01,  0.01 , 0.001, 22, 0.2},
-<a name="l00545"></a>00545         {<span class="charliteral">'V'</span>, 0.09 , 0.01, -0.02 , 0.001, -18, 0.2},
-<a name="l00546"></a>00546         {<span class="charliteral">'R'</span>, 0.2  , 0.01,  0.03 , 0.001, 0, 0.2},
-<a name="l00547"></a>00547         {<span class="charliteral">'I'</span>, 0.000, 0.01, -0.04 , 0.001, 1.0, 0.2},
-<a name="l00548"></a>00548     };
-<a name="l00549"></a>00549     
-<a name="l00550"></a>00550     <span class="keywordtype">int</span> N = fors_instrument_known_filters_get_number();
-<a name="l00551"></a>00551     <span class="keywordtype">int</span> i;
-<a name="l00552"></a>00552     
-<a name="l00553"></a>00553     t = cpl_table_new(N);
-<a name="l00554"></a>00554     cpl_table_new_column(t, FORS_DATA_PHOT_FILTER   , CPL_TYPE_STRING);
-<a name="l00555"></a>00555     cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);
-<a name="l00556"></a>00556     cpl_table_new_column(t, FORS_DATA_PHOT_DEXTCOEFF , CPL_TYPE_DOUBLE);
-<a name="l00557"></a>00557     cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);
-<a name="l00558"></a>00558     cpl_table_new_column(t, FORS_DATA_PHOT_DCOLORTERM, CPL_TYPE_DOUBLE);
-<a name="l00559"></a>00559     cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);
-<a name="l00560"></a>00560     cpl_table_new_column(t, FORS_DATA_PHOT_DZEROPOINT, CPL_TYPE_DOUBLE);
-<a name="l00561"></a>00561 
-<a name="l00562"></a>00562     <span class="comment">/* For each filtername (e.g. "U_BESS") find the matching filter (e.g. FILTER_U) */</span>
-<a name="l00563"></a>00563     <span class="keywordflow">for</span> (i = 0; i < N; i++) {
-<a name="l00564"></a>00564         cpl_table_set_string(       t,
-<a name="l00565"></a>00565                                     FORS_DATA_PHOT_FILTER,
-<a name="l00566"></a>00566                                     i,
-<a name="l00567"></a>00567                                     fors_instrument_known_filters_get_name(i));
-<a name="l00568"></a>00568 
-<a name="l00569"></a>00569         <span class="keywordtype">unsigned</span> j;
-<a name="l00570"></a>00570         <span class="keywordflow">for</span> (j = 0; j < FORS_NUM_FILTER; j++) {
-<a name="l00571"></a>00571             <span class="keywordflow">if</span> (fors_instrument_known_filters_get_band(i) == data[j].band)
-<a name="l00572"></a>00572             {
-<a name="l00573"></a>00573                 cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF , i, data[j].ext_coeff);
-<a name="l00574"></a>00574                 cpl_table_set_double(t, FORS_DATA_PHOT_DEXTCOEFF , i, data[j].dext_coeff);
-<a name="l00575"></a>00575                 cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, i, data[j].color_term);
-<a name="l00576"></a>00576                 cpl_table_set_double(t, FORS_DATA_PHOT_DCOLORTERM, i, data[j].dcolor_term);
-<a name="l00577"></a>00577                 cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, i, data[j].expected_zeropoint);
-<a name="l00578"></a>00578                 cpl_table_set_double(t, FORS_DATA_PHOT_DZEROPOINT, i, data[j].dexpected_zeropoint);
-<a name="l00579"></a>00579             }
-<a name="l00580"></a>00580         }
-<a name="l00581"></a>00581     }
-<a name="l00582"></a>00582 
-<a name="l00583"></a>00583     cpl_table_save(t, NULL, NULL, filename, CPL_IO_DEFAULT);
-<a name="l00584"></a>00584     <a class="code" href="group__multiset.html#g867790f186ab6cc04c00a80f80983991">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, 
-<a name="l00585"></a>00585             <span class="stringliteral">"Failed to save photometry table to %s"</span>, filename );
-<a name="l00586"></a>00586     
-<a name="l00587"></a>00587     <a class="code" href="group__fors__bias.html#g57cf6e6e2826eb178fd2d9c3e5695343">cleanup</a>;
-<a name="l00588"></a>00588     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#gc654dec250d09a86c73232ad4644b22a">frame_new</a>(filename, tag, group);
-<a name="l00589"></a>00589 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/test__simulate_8c_source.html b/html/test__simulate_8c_source.html
new file mode 100644
index 0000000..30f3e98
--- /dev/null
+++ b/html/test__simulate_8c_source.html
@@ -0,0 +1,569 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: test_simulate.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">test_simulate.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: test_simulate.c,v 1.34 2009-02-25 15:34:48 hlorch Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: hlorch $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2009-02-25 15:34:48 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.34 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <test_simulate.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <fors_instrument.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_data.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_pfits.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_utils.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> </div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="comment">/* FIXME:   - remove FORS_DATA_STD_* !!!</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="comment"> *          - replace below in create_std_cat()</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="comment"> *              1.) by creation of a standard star list, and</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="comment"> *              2.) and a new function fors_std_cat_test_create_stetson()</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="comment"> *                  in fors_std_cat.c</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_MAG[FORS_NUM_FILTER] =</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> {<span class="stringliteral">"U"</span>,</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>  <span class="stringliteral">"B"</span>,</div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span>  <span class="comment">//"G",</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>  <span class="stringliteral">"V"</span>,  <span class="comment">/* G uses V */</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>  <span class="stringliteral">"V"</span>,</div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>  <span class="stringliteral">"R"</span>,</div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span>  <span class="stringliteral">"I"</span>,</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>  <span class="stringliteral">"Z"</span>};</div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_DMAG[FORS_NUM_FILTER] =</div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> {<span class="stringliteral">"ERR_U"</span>,</div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>  <span class="stringliteral">"ERR_B"</span>,</div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>  <span class="comment">//"ERR_G",</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>  <span class="stringliteral">"ERR_V"</span>, <span class="comment">/* G uses V */</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>  <span class="stringliteral">"ERR_V"</span>,</div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span>  <span class="stringliteral">"ERR_R"</span>,</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>  <span class="stringliteral">"ERR_I"</span>,</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>  <span class="stringliteral">"ERR_Z"</span>};</div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> </div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_COL[FORS_NUM_FILTER] = </div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> {<span class="stringliteral">"U_B"</span>,</div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>  <span class="stringliteral">"B_V"</span>,</div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>  <span class="stringliteral">"B_V"</span>,</div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>  <span class="stringliteral">"B_V"</span>,</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>  <span class="stringliteral">"V_R"</span>,</div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>  <span class="stringliteral">"V_R"</span>,</div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span>  <span class="stringliteral">"?Z?"</span>};</div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> </div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_RA   = <span class="stringliteral">"RA"</span>;</div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_DEC  = <span class="stringliteral">"DEC"</span>;</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> FORS_DATA_STD_NAME = <span class="stringliteral">"OBJECT"</span>;</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> </div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> det_nx = 400;        <span class="comment">/* Unbinned detector pixels */</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> det_ny = 400;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> binx = 2;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> biny = 2;</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> ron   = 4.0;       <span class="comment">/* ADU */</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> conad = 0.78;   <span class="comment">/* e- / ADU */</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> </div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> bias_avg = 200; <span class="comment">/* ADU */</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> dark_avg = 50;  <span class="comment">/* ADU */</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> instrume = <span class="stringliteral">"fors2"</span>;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> chip_id = <span class="stringliteral">"Test chip 234"</span>;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> read_clock = <span class="stringliteral">"200Kps/2ports/low_gain"</span>;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="keyword">static</span> cpl_frame *</div>
+<div class="line"><a name="l00115"></a><span class="lineno"><a class="code" href="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c">  115</a></span> <a class="code" href="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c" title="Frame constructor.">frame_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> {</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>     cpl_frame *f = cpl_frame_new();</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     cpl_frame_set_filename(f, filename);</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     cpl_frame_set_tag     (f, tag);</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     cpl_frame_set_group   (f, group);</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> </div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="keywordflow">return</span> f;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> }</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> </div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5">  132</a></span> <a class="code" href="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5" title="Write FORS standard keywords to simulated header.">create_standard_keys</a>(cpl_propertylist *header, <span class="keywordtype">double</span> exptime)</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> {</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <span class="keywordtype">int</span> nx = det_nx / binx;</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="keywordtype">int</span> ny = det_ny / biny;</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> </div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO DPR TYPE"</span>, <span class="stringliteral">"some"</span>);</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO TPL ID"</span>, <span class="stringliteral">"tpl id."</span>);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"ESO INS COLL NAME"</span>, <span class="stringliteral">"collimator name"</span>);</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"ARCFILE"</span>, <span class="stringliteral">"archive filename"</span>);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     cpl_propertylist_update_string(header, FORS_PFITS_INSTRUME, instrume);</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     cpl_propertylist_update_string(header, FORS_PFITS_FILTER_NAME, <span class="stringliteral">"R_SPECIAL"</span>);</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     cpl_propertylist_update_double(header, FORS_PFITS_AIRMASS_START, 1.156);    </div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     cpl_propertylist_update_double(header, FORS_PFITS_AIRMASS_END  , 1.619);    </div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     </div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     cpl_propertylist_update_int   (header, FORS_PFITS_DET_NX, nx);</div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     cpl_propertylist_update_int   (header, FORS_PFITS_DET_NY, ny);</div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     cpl_propertylist_update_int   (header, FORS_PFITS_BINX, binx);</div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     cpl_propertylist_update_int   (header, FORS_PFITS_BINY, biny);</div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     cpl_propertylist_update_int   (header, FORS_PFITS_OVERSCANX, 0);</div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     cpl_propertylist_update_int   (header, FORS_PFITS_OVERSCANY, 0);</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     cpl_propertylist_update_int   (header, FORS_PFITS_PRESCANX, 0);</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     cpl_propertylist_update_int   (header, FORS_PFITS_PRESCANY, 0);</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> </div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     cpl_propertylist_update_double(header, FORS_PFITS_PIXSCALE, 0.126);</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     </div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     cpl_propertylist_update_int(header, FORS_PFITS_OUTPUTS, 1);</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     cpl_propertylist_update_double(header, FORS_PFITS_CONAD[0], conad);</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="comment">/* Convert RON to e- units */</span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     cpl_propertylist_update_double(header, FORS_PFITS_RON[0], ron*conad);</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     cpl_propertylist_update_double(header, FORS_PFITS_EXPOSURE_TIME, exptime);</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     cpl_propertylist_update_string(header, FORS_PFITS_CHIP_ID, chip_id);</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     cpl_propertylist_update_string(header, FORS_PFITS_READ_CLOCK, read_clock);</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     </div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="comment">/* WCS info, fine tuned to match simulated catalogue */</span></div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     {</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>         <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>             <span class="keyword">const</span> <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>             <span class="keywordtype">double</span> value;</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>         } data[] = {</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>             {<span class="stringliteral">"CRVAL1"</span>, 8.1368333333},</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>             {<span class="stringliteral">"CRVAL2"</span>, -46.9576388889},</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>             {<span class="stringliteral">"CRPIX1"</span>, 1},</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>             {<span class="stringliteral">"CRPIX2"</span>, 1},</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="comment">//            {"CD1_1", 5.81347849634012E-21}, </span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="comment">//            {"CD1_2", 9.49444444444444E-05},</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="comment">//            {"CD2_1",-9.49444444444444E-05}, </span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> <span class="comment">//            {"CD2_2",-5.81347849634012E-21},</span></div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>             {<span class="stringliteral">"CD1_1"</span>, 5.81347849634012E-20}, </div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>             {<span class="stringliteral">"CD1_2"</span>, 9.49444444444444E-04},</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>             {<span class="stringliteral">"CD2_1"</span>,-9.49444444444444E-04}, </div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>             {<span class="stringliteral">"CD2_2"</span>,-5.81347849634012E-20},</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>             {<span class="stringliteral">"PV2_1"</span>, 1.0},</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>             {<span class="stringliteral">"PV2_2"</span>, 0.0},</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>             {<span class="stringliteral">"PV2_3"</span>, 42.0},</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>             {<span class="stringliteral">"PV2_4"</span>, 0.0}, </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>             {<span class="stringliteral">"PV2_5"</span>, 0.0}</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>         };</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>         </div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>         <span class="keywordtype">unsigned</span> i;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>         <span class="keywordflow">for</span> (i = 0; i < <span class="keyword">sizeof</span>(data) / <span class="keyword">sizeof</span>(*data); i++) {</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>             cpl_propertylist_append_double(header, data[i].name, data[i].value);</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>         }</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     }</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     </div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     <span class="keywordflow">return</span>;</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> }</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> <span class="preprocessor">    fors_image_delete(&bias); \</span></div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span> <span class="preprocessor">    cpl_propertylist_delete(header); \</span></div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> cpl_frame *</div>
+<div class="line"><a name="l00221"></a><span class="lineno"><a class="code" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e">  221</a></span> <a class="code" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e" title="Simulate bias image.">create_bias</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> {</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     <span class="keywordtype">int</span> nx = det_nx / binx;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     <span class="keywordtype">int</span> ny = det_ny / biny;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     <span class="keywordtype">double</span> exptime = 0.0;</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *bias = NULL;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     cpl_propertylist *header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     </div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <a class="code" href="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5" title="Write FORS standard keywords to simulated header.">create_standard_keys</a>(header, exptime);</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     cpl_propertylist_erase(header, FORS_PFITS_FILTER_NAME); <span class="comment">/* No filter */</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     {</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>         <span class="keywordtype">int</span> x, y;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>         <span class="keywordflow">for</span> (y = 1; y <= ny; y++)</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>             <span class="keywordflow">for</span> (x = 1; x <= nx; x++) {</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>                 cpl_image_set(data   , x, y, </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>                               (<span class="keywordtype">int</span>)(bias_avg + ron*<a class="code" href="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56" title="Pseudo-random gaussian distributed number.">fors_rand_gauss</a>() + 0.5));</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>                 cpl_image_set(variance, x, y, ron*ron);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>             }</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     }</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     bias = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     <a class="code" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save</a>(bias, header, filename);</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL,</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>             <span class="stringliteral">"Saving bias to %s failed"</span>, filename );</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cleanup;</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c" title="Frame constructor.">frame_new</a>(filename, tag, group);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> }</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> </div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> <span class="preprocessor">    fors_image_delete(&dark); \</span></div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span> <span class="preprocessor">    cpl_propertylist_delete(header); \</span></div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span> cpl_frame *</div>
+<div class="line"><a name="l00273"></a><span class="lineno"><a class="code" href="group__test__simulate.html#gaebd36d5457a83612601155994a242dda">  273</a></span> <a class="code" href="group__test__simulate.html#gaebd36d5457a83612601155994a242dda" title="Simulate dark image.">create_dark</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> {</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="keywordtype">int</span> nx = det_nx / binx;</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     <span class="keywordtype">int</span> ny = det_ny / biny;</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordtype">double</span> exptime = 3.0;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *dark = NULL;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     cpl_propertylist *header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <a class="code" href="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5" title="Write FORS standard keywords to simulated header.">create_standard_keys</a>(header, exptime);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span> </div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     {</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>         <span class="keywordtype">int</span> x, y;</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>         <span class="keywordflow">for</span> (y = 1; y <= ny; y++)</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>             <span class="keywordflow">for</span> (x = 1; x <= nx; x++) {</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>                 <span class="keywordtype">double</span> var = ron*ron + dark_avg/conad;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                 </div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                 cpl_image_set(data   , x, y, </div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                               (<span class="keywordtype">int</span>)(bias_avg + dark_avg + </div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                                     sqrt(var)*<a class="code" href="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56" title="Pseudo-random gaussian distributed number.">fors_rand_gauss</a>() </div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                                     + 0.5));</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                 cpl_image_set(variance, x, y, var);</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>             }</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>     }</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     </div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     dark = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <a class="code" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save</a>(dark, header, filename);</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>             <span class="stringliteral">"Saving dark to %s failed"</span>, filename );</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cleanup;</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c" title="Frame constructor.">frame_new</a>(filename, tag, group);</div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> }</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> </div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> <span class="preprocessor">    fors_image_delete(&sflat); \</span></div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> <span class="preprocessor">    cpl_propertylist_delete(header); \</span></div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> cpl_frame *</div>
+<div class="line"><a name="l00328"></a><span class="lineno"><a class="code" href="group__test__simulate.html#ga5e5e21165c992a2062b3ca661e35fe9d">  328</a></span> <a class="code" href="group__test__simulate.html#ga5e5e21165c992a2062b3ca661e35fe9d" title="Simulate screen flat image.">create_screen_flat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group gr [...]
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> {</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="keywordtype">int</span> nx = det_nx / binx;</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <span class="keywordtype">int</span> ny = det_ny / biny;</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     <span class="keywordtype">double</span> exptime = 3.0;</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *sflat = NULL;</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     cpl_propertylist *header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     </div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     <a class="code" href="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5" title="Write FORS standard keywords to simulated header.">create_standard_keys</a>(header, exptime);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> </div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     {</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         <span class="keywordtype">int</span> x, y;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>         <span class="keywordflow">for</span> (y = 1; y <= ny; y++)</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>             <span class="keywordflow">for</span> (x = 1; x <= nx; x++) {</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>                 <span class="keywordtype">double</span> medium_scale_structure = 1000*(2 + sin(x*30.0/nx + y*30.0/ny));</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>                 <span class="keywordtype">double</span>  large_scale_structure = 1000*(1 + sin(x*4.0/nx));</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>                 <span class="keywordtype">double</span> flat = 5000 + medium_scale_structure + large_scale_structure;</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>                 <span class="keywordtype">double</span> var = ron*ron + flat/conad;</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>                 </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>                 cpl_image_set(data   , x, y, </div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>                               (<span class="keywordtype">int</span>)(bias_avg + flat + sqrt(var)*<a class="code" href="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56" title="Pseudo-random gaussian distributed number.">fors_rand_gauss</a>() + 0.5));</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>                 cpl_image_set(variance, x, y, var);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>             }</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     }</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     </div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     sflat = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     <a class="code" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save</a>(sflat, header, filename);</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>             <span class="stringliteral">"Saving screen flat to %s failed"</span>, filename );</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     cleanup;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c" title="Frame constructor.">frame_new</a>(filename, tag, group);</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span> }</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span> <span class="preprocessor">    fors_image_delete(&sflat); \</span></div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> <span class="preprocessor">    cpl_propertylist_delete(header); \</span></div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span> cpl_frame *</div>
+<div class="line"><a name="l00384"></a><span class="lineno"><a class="code" href="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103">  384</a></span> <a class="code" href="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103" title="Simulate sky flat image.">create_sky_flat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group,</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>                 <span class="keywordtype">double</span> exptime)</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span> {</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     <span class="keywordtype">int</span> nx = det_nx / binx;</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="keywordtype">int</span> ny = det_ny / biny;</div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     cpl_image *data     = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>     cpl_image *variance = cpl_image_new(nx, ny, <a class="code" href="group__fors__image.html#ga1ef4cba4bce1cc6fdde9730bfe6f13a8" title="Image data type.">FORS_IMAGE_TYPE</a>);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     <a class="code" href="struct__fors__image.html">fors_image</a> *sflat = NULL;</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     cpl_propertylist *header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>     </div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>     <a class="code" href="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5" title="Write FORS standard keywords to simulated header.">create_standard_keys</a>(header, exptime);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span> </div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     {</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>         <span class="keywordtype">int</span> x, y;</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         <span class="keywordflow">for</span> (y = 1; y <= ny; y++)</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>             <span class="keywordflow">for</span> (x = 1; x <= nx; x++) {</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>                 <span class="keywordtype">double</span> medium_scale_structure = 1000*(2 + sin(x*30.0/nx - y*10.0/ny));</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>                 <span class="keywordtype">double</span>  large_scale_structure = 1000*(1 + sin(x*4.0/nx));</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>                 <span class="keywordtype">double</span> flat = exptime*(5000 + </div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>                                        medium_scale_structure + </div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>                                        large_scale_structure);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>                 <span class="keywordtype">double</span> var = ron*ron + flat/conad;</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>                 </div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                 cpl_image_set(data   , x, y, </div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>                               (<span class="keywordtype">int</span>)(bias_avg + flat + sqrt(var)*<a class="code" href="group__fors__utils.html#gae3bf120c3732afdf5f126cdee1ed8e56" title="Pseudo-random gaussian distributed number.">fors_rand_gauss</a>() + 0.5));</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                 cpl_image_set(variance, x, y, var);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>             }</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     }</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     </div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     sflat = <a class="code" href="group__fors__image.html#ga29ad1e2da7d1495b2f0a870ee0549363" title="Create image.">fors_image_new</a>(data, variance);</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <a class="code" href="group__fors__image.html#ga03726eb0240d1c7711ab32b8479147a1" title="Save image.">fors_image_save</a>(sflat, header, filename);</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>             <span class="stringliteral">"Saving sky flat to %s failed"</span>, filename );</div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     cleanup;</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c" title="Frame constructor.">frame_new</a>(filename, tag, group);</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> }</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> cpl_frame *</div>
+<div class="line"><a name="l00432"></a><span class="lineno"><a class="code" href="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164">  432</a></span> <a class="code" href="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164" title="Create standard star image.">create_standard</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> {</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     <span class="comment">// fixme: add stars</span></div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>     <span class="keywordtype">double</span> exptime = 1.0;</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103" title="Simulate sky flat image.">create_sky_flat</a>(filename, tag, group, exptime);</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span> }</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span> </div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> <span class="preprocessor">    cpl_table_delete(t); \</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span> cpl_frame *</div>
+<div class="line"><a name="l00454"></a><span class="lineno"><a class="code" href="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3">  454</a></span> <a class="code" href="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3" title="Create standard star catalogue.">create_std_cat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group gr [...]
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> {</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>     cpl_table *t;</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>         <span class="keywordtype">double</span> ra, dec;</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         <span class="keywordtype">double</span> magnitude, dmagnitude;</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>         <span class="keywordtype">double</span> col;</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *name;</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     } </div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>     data[] =  {</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>         {8.15958, -47.0347, 15.824000, 0.001, 0.8, <span class="stringliteral">"object 1"</span>},</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         {8.14792, -46.9664, 12.895000, 0.002, -0.2, <span class="stringliteral">""</span>},</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>         {8.15083, -47.0092, 12.861000, 0.003, -0.3, <span class="stringliteral">" dff bject 1"</span>},</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>         {8.15583, -47.0222, 16.540001, 0.001, 0.7, <span class="stringliteral">"-9"</span>},</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         {8.17167, -47.10  , 11.970000, 0.005, 0.12, NULL},</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>         {8.14833, -47.0567, 13.861000, 0.003, -0.2, <span class="stringliteral">""</span>},</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>         {8.1475 , -47.0411, 13.903000, 0.001, -0.8, <span class="stringliteral">"dddddddobject 1"</span>},</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         {7.92542,  2.62917, 15.446000, 0.002, -0.2, <span class="stringliteral">"start 1"</span>},</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     };</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> </div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>     <span class="keywordtype">int</span> N = <span class="keyword">sizeof</span>(data) / <span class="keyword">sizeof</span>(*data);</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> </div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>     t = cpl_table_new(N);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     cpl_table_new_column(t, FORS_DATA_STD_RA , CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     cpl_table_new_column(t, FORS_DATA_STD_DEC, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     cpl_table_new_column(t, FORS_DATA_STD_NAME, CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>     </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     <span class="keywordflow">for</span> (i = 0; i < FORS_NUM_FILTER; i++) {</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         <span class="keywordflow">if</span> (!cpl_table_has_column(t, FORS_DATA_STD_MAG[i])) {</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>         cpl_table_new_column(t, FORS_DATA_STD_MAG[i], CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     }</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         <span class="keywordflow">if</span> (!cpl_table_has_column(t, FORS_DATA_STD_DMAG[i])) {</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>         cpl_table_new_column(t, FORS_DATA_STD_DMAG[i], CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     }</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>         <span class="keywordflow">if</span> (!cpl_table_has_column(t, FORS_DATA_STD_COL[i])) {</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>             cpl_table_new_column(t, FORS_DATA_STD_COL[i], CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>         }</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     }</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span> </div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     <span class="keywordflow">for</span> (i = 0; i < N; i++) {</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>         <span class="keywordtype">int</span> j;</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>         </div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>         cpl_table_set_double(t, FORS_DATA_STD_RA  , i, data[i].ra);</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         cpl_table_set_double(t, FORS_DATA_STD_DEC , i, data[i].dec);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>         cpl_table_set_string(t, FORS_DATA_STD_NAME, i, data[i].name);</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>         </div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>         <span class="keywordflow">for</span> (j = 0; j < FORS_NUM_FILTER; j++) {</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>             cpl_table_set_float (t, FORS_DATA_STD_MAG[j], i, data[i].magnitude);</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>             cpl_table_set_float (t, FORS_DATA_STD_DMAG[j], i, data[i].dmagnitude);</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>             cpl_table_set_float (t, FORS_DATA_STD_COL[j], i, data[i].col);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>         }</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>     }</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> </div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     cpl_table_save(t, NULL, NULL, filename, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>             <span class="stringliteral">"Failed to save standard catalogue to %s"</span>, filename );</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>     </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     cleanup;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c" title="Frame constructor.">frame_new</a>(filename, tag, group);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span> }</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> </div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> </div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> </div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> <span class="preprocessor">#undef cleanup</span></div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span> <span class="preprocessor"></span><span class="preprocessor">#define cleanup \</span></div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> <span class="preprocessor">do { \</span></div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span> <span class="preprocessor">    cpl_table_delete(t); \</span></div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span> <span class="preprocessor">} while(0)</span></div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> cpl_frame *</div>
+<div class="line"><a name="l00532"></a><span class="lineno"><a class="code" href="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b">  532</a></span> <a class="code" href="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b" title="Create photometry table.">create_phot_table</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group)</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> {</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span>     cpl_table *t;</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="keyword">struct </span>{</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>         <span class="keywordtype">char</span>    band;</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>         <span class="keywordtype">double</span> ext_coeff, dext_coeff;</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>         <span class="keywordtype">double</span> color_term, dcolor_term;</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>         <span class="keywordtype">double</span> expected_zeropoint, dexpected_zeropoint;</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     } </div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     data[FORS_NUM_FILTER] = {</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         {<span class="charliteral">'U'</span>, 0.4  , 0.01, -0.076, 0.001, 20, 0.2},</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>         {<span class="charliteral">'B'</span>, 0.05 , 0.01,  0.033, 0.001, 21.123456, 0.2},</div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>         {<span class="charliteral">'G'</span>, 0.1  , 0.01,  0.01 , 0.001, 22, 0.2},</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>         {<span class="charliteral">'V'</span>, 0.09 , 0.01, -0.02 , 0.001, -18, 0.2},</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>         {<span class="charliteral">'R'</span>, 0.2  , 0.01,  0.03 , 0.001, 0, 0.2},</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>         {<span class="charliteral">'I'</span>, 0.000, 0.01, -0.04 , 0.001, 1.0, 0.2},</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     };</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>     <span class="keywordtype">int</span> N = fors_instrument_known_filters_get_number();</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     <span class="keywordtype">int</span> i;</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     </div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     t = cpl_table_new(N);</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     cpl_table_new_column(t, FORS_DATA_PHOT_FILTER   , CPL_TYPE_STRING);</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>     cpl_table_new_column(t, FORS_DATA_PHOT_EXTCOEFF , CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     cpl_table_new_column(t, FORS_DATA_PHOT_DEXTCOEFF , CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>     cpl_table_new_column(t, FORS_DATA_PHOT_COLORTERM, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>     cpl_table_new_column(t, FORS_DATA_PHOT_DCOLORTERM, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>     cpl_table_new_column(t, FORS_DATA_PHOT_ZEROPOINT, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>     cpl_table_new_column(t, FORS_DATA_PHOT_DZEROPOINT, CPL_TYPE_DOUBLE);</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> </div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>     <span class="comment">/* For each filtername (e.g. "U_BESS") find the matching filter (e.g. FILTER_U) */</span></div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>     <span class="keywordflow">for</span> (i = 0; i < N; i++) {</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         cpl_table_set_string(       t,</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>                                     FORS_DATA_PHOT_FILTER,</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>                                     i,</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>                                     fors_instrument_known_filters_get_name(i));</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span> </div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>         <span class="keywordtype">unsigned</span> j;</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         <span class="keywordflow">for</span> (j = 0; j < FORS_NUM_FILTER; j++) {</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>             <span class="keywordflow">if</span> (fors_instrument_known_filters_get_band(i) == data[j].band)</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>             {</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_EXTCOEFF , i, data[j].ext_coeff);</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_DEXTCOEFF , i, data[j].dext_coeff);</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_COLORTERM, i, data[j].color_term);</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_DCOLORTERM, i, data[j].dcolor_term);</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_ZEROPOINT, i, data[j].expected_zeropoint);</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>                 cpl_table_set_double(t, FORS_DATA_PHOT_DZEROPOINT, i, data[j].dexpected_zeropoint);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>             }</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>         }</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>     }</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span> </div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>     cpl_table_save(t, NULL, NULL, filename, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     <a class="code" href="group__multiset.html#ga7170ba2dc8c539aee2d29c8a8edd4d5a">assure</a>( !cpl_error_get_code(), <span class="keywordflow">return</span> NULL, </div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>             <span class="stringliteral">"Failed to save photometry table to %s"</span>, filename );</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     </div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>     cleanup;</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <span class="keywordflow">return</span> <a class="code" href="group__test__simulate.html#ga058fead85edeab17908cfe9c9d4bf53c" title="Frame constructor.">frame_new</a>(filename, tag, group);</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/test__simulate_8h-source.html b/html/test__simulate_8h-source.html
deleted file mode 100644
index 079a1fa..0000000
--- a/html/test__simulate_8h-source.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: test_simulate.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a> &raquo <a class="el" href="dir_59b02a80e553296e42791d17a261b792.html">tests</a></div>
-<h1>test_simulate.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: test_simulate.h,v 1.9 2007/10/18 12:48:12 jmlarsen Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: jmlarsen $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2007/10/18 12:48:12 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.9 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef TEST_SIMULATE_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define TEST_SIMULATE_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <fors_image.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 cpl_frame *
-<a name="l00036"></a>00036 <a class="code" href="group__test__simulate.html#g55fb50722bc813f909960cff99bf3d0a">create_bias</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 cpl_frame *
-<a name="l00039"></a>00039 <a class="code" href="group__test__simulate.html#g474967528c2d1de8ce4dadd24da817ce">create_screen_flat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 cpl_frame *
-<a name="l00042"></a>00042 <a class="code" href="group__test__simulate.html#g34d07ddc903c3b99789b4a4499a01669">create_sky_flat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group,
-<a name="l00043"></a>00043                 <span class="keywordtype">double</span> exptime);
-<a name="l00044"></a>00044 
-<a name="l00045"></a>00045 cpl_frame *
-<a name="l00046"></a>00046 <a class="code" href="group__test__simulate.html#g7d32a52476925e61a30a10d78e4ad16b">create_standard</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);
-<a name="l00047"></a>00047 
-<a name="l00048"></a>00048 cpl_frame *
-<a name="l00049"></a>00049 <a class="code" href="group__test__simulate.html#gb54d8ef52e4f8e0407e522565b8919f6">create_dark</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);
-<a name="l00050"></a>00050 
-<a name="l00051"></a>00051 cpl_frame *
-<a name="l00052"></a>00052 <a class="code" href="group__test__simulate.html#g385bcf492fd8851be43fad7ec71c7410">create_std_cat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);
-<a name="l00053"></a>00053 
-<a name="l00054"></a>00054 cpl_frame *
-<a name="l00055"></a>00055 <a class="code" href="group__test__simulate.html#g8f676f49cfb4e2066d15d240480450c5">create_phot_table</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);
-<a name="l00056"></a>00056 
-<a name="l00057"></a>00057 <span class="keywordtype">void</span>
-<a name="l00058"></a>00058 <a class="code" href="group__test__simulate.html#g8ad58588c66a4e04b69580f5152ccff2">create_standard_keys</a>(cpl_propertylist *header, <span class="keywordtype">double</span> exptime);
-<a name="l00059"></a>00059 
-<a name="l00060"></a>00060 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/test__simulate_8h_source.html b/html/test__simulate_8h_source.html
new file mode 100644
index 0000000..588dc15
--- /dev/null
+++ b/html/test__simulate_8h_source.html
@@ -0,0 +1,121 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: test_simulate.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li><li class="navelem"><a class="el" href="dir_aab54b8ed0ffe13455bea30ab0dd47dc.html">tests</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">test_simulate.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: test_simulate.h,v 1.9 2007-10-18 12:48:12 jmlarsen Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2006 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: jmlarsen $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2007-10-18 12:48:12 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.9 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef TEST_SIMULATE_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define TEST_SIMULATE_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <fors_image.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> cpl_frame *</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <a class="code" href="group__test__simulate.html#ga3e86fd58a29b3530210cb4f52b91dc9e" title="Simulate bias image.">create_bias</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> </div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> cpl_frame *</div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <a class="code" href="group__test__simulate.html#ga5e5e21165c992a2062b3ca661e35fe9d" title="Simulate screen flat image.">create_screen_flat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> cpl_frame *</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <a class="code" href="group__test__simulate.html#ga574cce7cd888bfd5d3f06a4830df5103" title="Simulate sky flat image.">create_sky_flat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group,</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>                 <span class="keywordtype">double</span> exptime);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> </div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> cpl_frame *</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <a class="code" href="group__test__simulate.html#ga7b36d87ede4ad7e7e12a408587ab8164" title="Create standard star image.">create_standard</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);</div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> </div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> cpl_frame *</div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <a class="code" href="group__test__simulate.html#gaebd36d5457a83612601155994a242dda" title="Simulate dark image.">create_dark</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);</div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> cpl_frame *</div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <a class="code" href="group__test__simulate.html#ga474a5b51d8eba26e437cb9be2719aab3" title="Create standard star catalogue.">create_std_cat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);</div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> </div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> cpl_frame *</div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <a class="code" href="group__test__simulate.html#gaafef1f08f42e1f9bef0000c27e46169b" title="Create photometry table.">create_phot_table</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keyword">const</span> <span class="keywordtype">char</span> *tag, cpl_frame_group group);</div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> </div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="keywordtype">void</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <a class="code" href="group__test__simulate.html#gae70284f55411d4a1fdbc3fc9fbd10bf5" title="Write FORS standard keywords to simulated header.">create_standard_keys</a>(cpl_propertylist *header, <span class="keywordtype">double</span> exptime);</div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/vimos__calib_8c-source.html b/html/vimos__calib_8c-source.html
deleted file mode 100644
index 9eb1c86..0000000
--- a/html/vimos__calib_8c-source.html
+++ /dev/null
@@ -1,517 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: vimos_calib.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>vimos_calib.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: vimos_calib.c,v 1.21 2010/09/14 07:38:16 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:38:16 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.21 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <vimos_calib_impl.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <moses.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_create(cpl_plugin *);
-<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_exec(cpl_plugin *);
-<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_destroy(cpl_plugin *);
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib(cpl_parameterlist *, cpl_frameset *);
-<a name="l00043"></a>00043 
-<a name="l00044"></a>00044 <span class="keyword">static</span> <span class="keywordtype">char</span> vimos_calib_description[] =
-<a name="l00045"></a>00045 <span class="stringliteral">"This recipe is used to identify reference lines on MOS arc lamp\n"</span>
-<a name="l00046"></a>00046 <span class="stringliteral">"exposures, and trace the spectral edges on the corresponding flat field\n"</span>
-<a name="l00047"></a>00047 <span class="stringliteral">"exposures. This information is used to determine the spectral extraction\n"</span>
-<a name="l00048"></a>00048 <span class="stringliteral">"mask to be applied in the scientific data reduction, performed with the\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"recipe vimos_science. The input arc lamp and flat field exposures are\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"assumed to be obtained quasi-simultaneously, so that they would be\n"</span> 
-<a name="l00051"></a>00051 <span class="stringliteral">"described by exactly the same instrument distortions.\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"A line catalog must be specified, containing the wavelengths of the\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"reference arc lamp lines used for the wavelength calibration. A grism\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"table (typically depending on the instrument mode, and in particular on\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"the grism used) may also be specified: this table contains a default\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"recipe parameter setting to control the way spectra are extracted for\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"a specific instrument mode, as it is used for automatic run of the\n"</span>
-<a name="l00058"></a>00058 <span class="stringliteral">"pipeline on Paranal and in Garching. If this table is specified, it\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"will modify the default recipe parameter setting, with the exception of\n"</span>
-<a name="l00060"></a>00060 <span class="stringliteral">"those parameters which have been explicitly modifyed on the command line.\n"</span>
-<a name="l00061"></a>00061 <span class="stringliteral">"If a grism table is not specified, the input recipe parameters values\n"</span>
-<a name="l00062"></a>00062 <span class="stringliteral">"will always be read from the command line, or from an esorex configuration\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"file if present, or from their generic default values (that are rarely\n"</span>
-<a name="l00064"></a>00064 <span class="stringliteral">"meaningful). Finally a master bias frame must be input to this recipe.\n"</span> 
-<a name="l00065"></a>00065 <span class="stringliteral">"In the table below the MOS_CURV_COEFF, MOS_CURV_TRACES, MOS_SPATIAL_MAP\n"</span>
-<a name="l00066"></a>00066 <span class="stringliteral">"MOS_ARC_SPECTRUM_EXTRACTED, MOS_SPECTRA_DETECTION, MOS_SLIT_MAP, and\n"</span> 
-<a name="l00067"></a>00067 <span class="stringliteral">"MOS_SLIT_LOCATION, are never created in case of long-slit-like data.\n"</span> 
-<a name="l00068"></a>00068 <span class="stringliteral">"The products MOS_SPECTRA_DETECTION, MOS_SLIT_MAP, and MOS_DISP_RESIDUALS,\n"</span> 
-<a name="l00069"></a>00069 <span class="stringliteral">"are just created if the --check parameter is set to true. The product\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"GLOBAL_DISTORTION_TABLE is just created if more than 12 separate spectra\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"are found in the CCD.\n\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"  MOS_SCREEN_FLAT            Raw         Flat field exposures    Y\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"  MOS_ARC_SPECTRUM           Raw         Arc lamp exposure       Y\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"  MASTER_BIAS or BIAS        Calib       Bias frame              Y\n"</span>
-<a name="l00077"></a>00077 <span class="stringliteral">"  LINE_CATALOG               Calib       Line catalog            Y\n"</span>
-<a name="l00078"></a>00078 <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span>
-<a name="l00079"></a>00079 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00080"></a>00080 <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span>
-<a name="l00081"></a>00081 <span class="stringliteral">"  MOS_COMBINED_SCREEN_FLAT   FITS image  Combined (sum) flat field\n"</span>
-<a name="l00082"></a>00082 <span class="stringliteral">"  MOS_MASTER_SCREEN_FLAT     FITS image  Normalised flat field\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"  MOS_ARC_SPECTRUM_EXTRACTED FITS image  Wavelength calibrated arc spectrum\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"  MOS_DISP_COEFF             FITS table  Inverse dispersion coefficients\n"</span>
-<a name="l00085"></a>00085 <span class="stringliteral">"  MOS_DISP_RESIDUALS         FITS image  Residuals in wavelength calibration\n"</span>
-<a name="l00086"></a>00086 <span class="stringliteral">"  MOS_DISP_RESIDUALS_TABLE   FITS table  Residuals in wavelength calibration\n"</span>
-<a name="l00087"></a>00087 <span class="stringliteral">"  MOS_DELTA_IMAGE            FITS image  Offset vs linear wavelength calib\n"</span>
-<a name="l00088"></a>00088 <span class="stringliteral">"  MOS_WAVELENGTH_MAP         FITS image  Wavelength for each pixel on CCD\n"</span>
-<a name="l00089"></a>00089 <span class="stringliteral">"  MOS_SPECTRA_DETECTION      FITS image  Check for preliminary detection\n"</span>
-<a name="l00090"></a>00090 <span class="stringliteral">"  MOS_SLIT_MAP               FITS image  Map of central wavelength on CCD\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"  MOS_CURV_TRACES            FITS table  Spectral curvature traces\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"  MOS_CURV_COEFF             FITS table  Spectral curvature coefficients\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"  MOS_SPATIAL_MAP            FITS image  Spatial position along slit on CCD\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"  MOS_SPECTRAL_RESOLUTION    FITS table  Resolution at reference arc lines\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"  MOS_SLIT_LOCATION          FITS table  Slits on product frames and CCD\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"  GLOBAL_DISTORTION_TABLE    FITS table  Global distortions table\n\n"</span>;
-<a name="l00097"></a>00097 
-<a name="l00109"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00109</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00110"></a>00110 {
-<a name="l00111"></a>00111     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00112"></a>00112     cpl_plugin *plugin = &recipe->interface;
-<a name="l00113"></a>00113 
-<a name="l00114"></a>00114     cpl_plugin_init(plugin,
-<a name="l00115"></a>00115                     CPL_PLUGIN_API,
-<a name="l00116"></a>00116                     FORS_BINARY_VERSION,
-<a name="l00117"></a>00117                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00118"></a>00118                     <span class="stringliteral">"vimos_calib"</span>,
-<a name="l00119"></a>00119                     <span class="stringliteral">"Determination of the extraction mask"</span>,
-<a name="l00120"></a>00120                     vimos_calib_description,
-<a name="l00121"></a>00121                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00122"></a>00122                     PACKAGE_BUGREPORT,
-<a name="l00123"></a>00123     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00124"></a>00124     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00125"></a>00125     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00126"></a>00126     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00127"></a>00127     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00128"></a>00128     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00129"></a>00129     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00130"></a>00130     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00131"></a>00131     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00132"></a>00132     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00133"></a>00133     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00134"></a>00134     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00135"></a>00135     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00136"></a>00136                     vimos_calib_create,
-<a name="l00137"></a>00137                     vimos_calib_exec,
-<a name="l00138"></a>00138                     vimos_calib_destroy);
-<a name="l00139"></a>00139 
-<a name="l00140"></a>00140     cpl_pluginlist_append(list, plugin);
-<a name="l00141"></a>00141     
-<a name="l00142"></a>00142     <span class="keywordflow">return</span> 0;
-<a name="l00143"></a>00143 }
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145 
-<a name="l00156"></a>00156 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_create(cpl_plugin *plugin)
-<a name="l00157"></a>00157 {
-<a name="l00158"></a>00158     cpl_recipe    *recipe;
-<a name="l00159"></a>00159     cpl_parameter *p;
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161 
-<a name="l00162"></a>00162     <span class="comment">/* </span>
-<a name="l00163"></a>00163 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00164"></a>00164 <span class="comment">     */</span>
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00167"></a>00167         recipe = (cpl_recipe *)plugin;
-<a name="l00168"></a>00168     <span class="keywordflow">else</span> 
-<a name="l00169"></a>00169         <span class="keywordflow">return</span> -1;
-<a name="l00170"></a>00170 
-<a name="l00171"></a>00171     <span class="comment">/* </span>
-<a name="l00172"></a>00172 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00173"></a>00173 <span class="comment">     */</span>
-<a name="l00174"></a>00174 
-<a name="l00175"></a>00175     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177 
-<a name="l00178"></a>00178     <span class="comment">/*</span>
-<a name="l00179"></a>00179 <span class="comment">     * Dispersion</span>
-<a name="l00180"></a>00180 <span class="comment">     */</span>
-<a name="l00181"></a>00181 
-<a name="l00182"></a>00182     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.dispersion"</span>,
-<a name="l00183"></a>00183                                 CPL_TYPE_DOUBLE,
-<a name="l00184"></a>00184                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,
-<a name="l00185"></a>00185                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00186"></a>00186                                 0.0);
-<a name="l00187"></a>00187     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00188"></a>00188     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00189"></a>00189     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00190"></a>00190 
-<a name="l00191"></a>00191     <span class="comment">/*</span>
-<a name="l00192"></a>00192 <span class="comment">     * Peak detection level</span>
-<a name="l00193"></a>00193 <span class="comment">     */</span>
-<a name="l00194"></a>00194 
-<a name="l00195"></a>00195     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.peakdetection"</span>,
-<a name="l00196"></a>00196                                 CPL_TYPE_DOUBLE,
-<a name="l00197"></a>00197                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,
-<a name="l00198"></a>00198                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00199"></a>00199                                 0.0);
-<a name="l00200"></a>00200     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);
-<a name="l00201"></a>00201     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00202"></a>00202     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00203"></a>00203 
-<a name="l00204"></a>00204     <span class="comment">/* </span>
-<a name="l00205"></a>00205 <span class="comment">     * Degree of wavelength calibration polynomial</span>
-<a name="l00206"></a>00206 <span class="comment">     */</span>
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.wdegree"</span>,
-<a name="l00209"></a>00209                                 CPL_TYPE_INT,
-<a name="l00210"></a>00210                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,
-<a name="l00211"></a>00211                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00212"></a>00212                                 0);
-<a name="l00213"></a>00213     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);
-<a name="l00214"></a>00214     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00215"></a>00215     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00216"></a>00216 
-<a name="l00217"></a>00217     <span class="comment">/*</span>
-<a name="l00218"></a>00218 <span class="comment">     * Reference lines search radius</span>
-<a name="l00219"></a>00219 <span class="comment">     */</span>
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.wradius"</span>,
-<a name="l00222"></a>00222                                 CPL_TYPE_INT,
-<a name="l00223"></a>00223                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span>
-<a name="l00224"></a>00224                                 <span class="stringliteral">"with first-guess method"</span>,
-<a name="l00225"></a>00225                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00226"></a>00226                                 4);
-<a name="l00227"></a>00227     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);
-<a name="l00228"></a>00228     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00229"></a>00229     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00230"></a>00230 
-<a name="l00231"></a>00231     <span class="comment">/*</span>
-<a name="l00232"></a>00232 <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span>
-<a name="l00233"></a>00233 <span class="comment">     */</span>
-<a name="l00234"></a>00234 
-<a name="l00235"></a>00235     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.wreject"</span>,
-<a name="l00236"></a>00236                                 CPL_TYPE_DOUBLE,
-<a name="l00237"></a>00237                                 <span class="stringliteral">"Rejection threshold in dispersion "</span>
-<a name="l00238"></a>00238                                 <span class="stringliteral">"relation fit (pixel)"</span>,
-<a name="l00239"></a>00239                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00240"></a>00240                                 0.7);
-<a name="l00241"></a>00241     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);
-<a name="l00242"></a>00242     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00243"></a>00243     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00244"></a>00244 
-<a name="l00245"></a>00245     <span class="comment">/*</span>
-<a name="l00246"></a>00246 <span class="comment">     * Wavelength solution interpolation (for LSS data)</span>
-<a name="l00247"></a>00247 <span class="comment">     */</span>
-<a name="l00248"></a>00248 
-<a name="l00249"></a>00249     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.wmode"</span>,
-<a name="l00250"></a>00250                                 CPL_TYPE_INT,
-<a name="l00251"></a>00251                                 <span class="stringliteral">"Interpolation mode of wavelength solution "</span>
-<a name="l00252"></a>00252                                 <span class="stringliteral">"applicable to LSS-like data (0 = no "</span>
-<a name="l00253"></a>00253                                 <span class="stringliteral">"interpolation, 1 = fill gaps, 2 = global "</span>
-<a name="l00254"></a>00254                                 <span class="stringliteral">"model)"</span>,
-<a name="l00255"></a>00255                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00256"></a>00256                                 2);
-<a name="l00257"></a>00257     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wmode"</span>);
-<a name="l00258"></a>00258     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00259"></a>00259     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00260"></a>00260 
-<a name="l00261"></a>00261     <span class="comment">/*</span>
-<a name="l00262"></a>00262 <span class="comment">     * Line catalog table column containing the reference wavelengths</span>
-<a name="l00263"></a>00263 <span class="comment">     */</span>
-<a name="l00264"></a>00264 
-<a name="l00265"></a>00265     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.wcolumn"</span>,
-<a name="l00266"></a>00266                                 CPL_TYPE_STRING,
-<a name="l00267"></a>00267                                 <span class="stringliteral">"Name of line catalog table column "</span>
-<a name="l00268"></a>00268                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00269"></a>00269                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00270"></a>00270                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00271"></a>00271     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00272"></a>00272     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00273"></a>00273     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00274"></a>00274 
-<a name="l00275"></a>00275     <span class="comment">/*</span>
-<a name="l00276"></a>00276 <span class="comment">     * Degree of spectral curvature polynomial</span>
-<a name="l00277"></a>00277 <span class="comment">     */</span>
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.cdegree"</span>,
-<a name="l00280"></a>00280                                 CPL_TYPE_INT,
-<a name="l00281"></a>00281                                 <span class="stringliteral">"Degree of spectral curvature polynomial"</span>,
-<a name="l00282"></a>00282                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00283"></a>00283                                 0);
-<a name="l00284"></a>00284     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cdegree"</span>);
-<a name="l00285"></a>00285     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00286"></a>00286     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00287"></a>00287 
-<a name="l00288"></a>00288     <span class="comment">/*</span>
-<a name="l00289"></a>00289 <span class="comment">     * Curvature solution interpolation (for MOS-like data)</span>
-<a name="l00290"></a>00290 <span class="comment">     */</span>
-<a name="l00291"></a>00291  
-<a name="l00292"></a>00292     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.cmode"</span>,
-<a name="l00293"></a>00293                                 CPL_TYPE_INT,
-<a name="l00294"></a>00294                                 <span class="stringliteral">"Interpolation mode of curvature solution "</span>
-<a name="l00295"></a>00295                                 <span class="stringliteral">"applicable to MOS-like data (0 = no "</span>
-<a name="l00296"></a>00296                                 <span class="stringliteral">"interpolation, 1 = fill gaps, 2 = global "</span>
-<a name="l00297"></a>00297                                 <span class="stringliteral">"model)"</span>,
-<a name="l00298"></a>00298                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00299"></a>00299                                 1);
-<a name="l00300"></a>00300     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cmode"</span>);
-<a name="l00301"></a>00301     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00302"></a>00302     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304     <span class="comment">/*</span>
-<a name="l00305"></a>00305 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00306"></a>00306 <span class="comment">     */</span>
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.startwavelength"</span>,
-<a name="l00309"></a>00309                                 CPL_TYPE_DOUBLE,
-<a name="l00310"></a>00310                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00311"></a>00311                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00312"></a>00312                                 0.0);
-<a name="l00313"></a>00313     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00314"></a>00314     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00315"></a>00315     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00316"></a>00316 
-<a name="l00317"></a>00317     <span class="comment">/*</span>
-<a name="l00318"></a>00318 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00319"></a>00319 <span class="comment">     */</span>
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.endwavelength"</span>,
-<a name="l00322"></a>00322                                 CPL_TYPE_DOUBLE,
-<a name="l00323"></a>00323                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00324"></a>00324                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00325"></a>00325                                 0.0);
-<a name="l00326"></a>00326     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00327"></a>00327     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00328"></a>00328     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00329"></a>00329 
-<a name="l00330"></a>00330     <span class="comment">/*</span>
-<a name="l00331"></a>00331 <span class="comment">     * Reference wavelength for wavelength calibration</span>
-<a name="l00332"></a>00332 <span class="comment">     */</span>
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.reference"</span>,
-<a name="l00335"></a>00335                                 CPL_TYPE_DOUBLE,
-<a name="l00336"></a>00336                                 <span class="stringliteral">"Reference wavelength for calibration"</span>,
-<a name="l00337"></a>00337                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00338"></a>00338                                 0.0);
-<a name="l00339"></a>00339     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"reference"</span>);
-<a name="l00340"></a>00340     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00341"></a>00341     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343     <span class="comment">/*</span>
-<a name="l00344"></a>00344 <span class="comment">     * Try slit identification</span>
-<a name="l00345"></a>00345 <span class="comment">     */</span>
-<a name="l00346"></a>00346 
-<a name="l00347"></a>00347     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.slit_ident"</span>,
-<a name="l00348"></a>00348                                 CPL_TYPE_BOOL,
-<a name="l00349"></a>00349                                 <span class="stringliteral">"Attempt slit identification"</span>,
-<a name="l00350"></a>00350                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00351"></a>00351                                 TRUE);
-<a name="l00352"></a>00352     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_ident"</span>);
-<a name="l00353"></a>00353     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00354"></a>00354     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00355"></a>00355 
-<a name="l00356"></a>00356     <span class="comment">/*</span>
-<a name="l00357"></a>00357 <span class="comment">     * Degree of flat field fitting polynomial along spatial direction </span>
-<a name="l00358"></a>00358 <span class="comment">     * (used for LSS data)</span>
-<a name="l00359"></a>00359 <span class="comment">     */</span>
-<a name="l00360"></a>00360 
-<a name="l00361"></a>00361     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.sdegree"</span>,
-<a name="l00362"></a>00362                                 CPL_TYPE_INT,
-<a name="l00363"></a>00363                                 <span class="stringliteral">"Degree of flat field fitting polynomial "</span>
-<a name="l00364"></a>00364                                 <span class="stringliteral">"along spatial direction (used for LSS-like "</span>
-<a name="l00365"></a>00365                                 <span class="stringliteral">"data only)"</span>,
-<a name="l00366"></a>00366                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00367"></a>00367                                 -1);
-<a name="l00368"></a>00368     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sdegree"</span>);
-<a name="l00369"></a>00369     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00370"></a>00370     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00371"></a>00371 
-<a name="l00372"></a>00372     <span class="comment">/*</span>
-<a name="l00373"></a>00373 <span class="comment">     * Degree of flat field fitting polynomial along dispersion direction</span>
-<a name="l00374"></a>00374 <span class="comment">     * (used for MOS data)</span>
-<a name="l00375"></a>00375 <span class="comment">     */</span>
-<a name="l00376"></a>00376 
-<a name="l00377"></a>00377     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.ddegree"</span>,
-<a name="l00378"></a>00378                                 CPL_TYPE_INT,
-<a name="l00379"></a>00379                                 <span class="stringliteral">"Degree of flat field fitting polynomial "</span>
-<a name="l00380"></a>00380                                 <span class="stringliteral">"along dispersion direction (not used for "</span>
-<a name="l00381"></a>00381                                 <span class="stringliteral">"long-slit-like data)"</span>,
-<a name="l00382"></a>00382                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00383"></a>00383                                 -1);
-<a name="l00384"></a>00384     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ddegree"</span>);
-<a name="l00385"></a>00385     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00386"></a>00386     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00387"></a>00387 
-<a name="l00388"></a>00388     <span class="comment">/*</span>
-<a name="l00389"></a>00389 <span class="comment">     * Smooth box radius for flat field along dispersion direction</span>
-<a name="l00390"></a>00390 <span class="comment">     */</span>
-<a name="l00391"></a>00391 
-<a name="l00392"></a>00392     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.dradius"</span>,
-<a name="l00393"></a>00393                                 CPL_TYPE_INT,
-<a name="l00394"></a>00394                                 <span class="stringliteral">"Smooth box radius for flat field along "</span>
-<a name="l00395"></a>00395                                 <span class="stringliteral">"dispersion direction"</span>,
-<a name="l00396"></a>00396                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00397"></a>00397                                 10);
-<a name="l00398"></a>00398     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dradius"</span>);
-<a name="l00399"></a>00399     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00400"></a>00400     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     <span class="comment">/*</span>
-<a name="l00403"></a>00403 <span class="comment">     * Smooth box radius for flat field along spatial direction</span>
-<a name="l00404"></a>00404 <span class="comment">     * (used for LSS data only)</span>
-<a name="l00405"></a>00405 <span class="comment">     */</span>
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.sradius"</span>,
-<a name="l00408"></a>00408                                 CPL_TYPE_INT,
-<a name="l00409"></a>00409                                 <span class="stringliteral">"Smooth box radius for flat field along "</span>
-<a name="l00410"></a>00410                                 <span class="stringliteral">"spatial direction"</span>,
-<a name="l00411"></a>00411                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00412"></a>00412                                 10);
-<a name="l00413"></a>00413     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sradius"</span>);
-<a name="l00414"></a>00414     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00415"></a>00415     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00416"></a>00416 
-<a name="l00417"></a>00417     <span class="comment">/*</span>
-<a name="l00418"></a>00418 <span class="comment">     * Computation of QC1 parameters</span>
-<a name="l00419"></a>00419 <span class="comment">     */</span>
-<a name="l00420"></a>00420 
-<a name="l00421"></a>00421     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.qc"</span>,
-<a name="l00422"></a>00422                                 CPL_TYPE_BOOL,
-<a name="l00423"></a>00423                                 <span class="stringliteral">"Compute QC1 parameters"</span>,
-<a name="l00424"></a>00424                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00425"></a>00425                                 TRUE);
-<a name="l00426"></a>00426     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"qc"</span>);
-<a name="l00427"></a>00427     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00428"></a>00428     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00429"></a>00429 
-<a name="l00430"></a>00430     <span class="comment">/*</span>
-<a name="l00431"></a>00431 <span class="comment">     * Create check products</span>
-<a name="l00432"></a>00432 <span class="comment">     */</span>
-<a name="l00433"></a>00433 
-<a name="l00434"></a>00434     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.check"</span>,
-<a name="l00435"></a>00435                                 CPL_TYPE_BOOL,
-<a name="l00436"></a>00436                                 <span class="stringliteral">"Create intermediate products"</span>,
-<a name="l00437"></a>00437                                 <span class="stringliteral">"fors.vimos_calib"</span>,
-<a name="l00438"></a>00438                                 FALSE);
-<a name="l00439"></a>00439     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"check"</span>);
-<a name="l00440"></a>00440     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00441"></a>00441     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443     <span class="keywordflow">return</span> 0;
-<a name="l00444"></a>00444 }
-<a name="l00445"></a>00445 
-<a name="l00446"></a>00446 
-<a name="l00455"></a>00455 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_exec(cpl_plugin *plugin)
-<a name="l00456"></a>00456 {
-<a name="l00457"></a>00457     cpl_recipe *recipe;
-<a name="l00458"></a>00458     
-<a name="l00459"></a>00459     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00460"></a>00460         recipe = (cpl_recipe *)plugin;
-<a name="l00461"></a>00461     <span class="keywordflow">else</span> 
-<a name="l00462"></a>00462         <span class="keywordflow">return</span> -1;
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     <span class="keywordflow">return</span> vimos_calib(recipe->parameters, recipe->frames);
-<a name="l00465"></a>00465 }
-<a name="l00466"></a>00466 
-<a name="l00467"></a>00467 
-<a name="l00476"></a>00476 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_destroy(cpl_plugin *plugin)
-<a name="l00477"></a>00477 {
-<a name="l00478"></a>00478     cpl_recipe *recipe;
-<a name="l00479"></a>00479     
-<a name="l00480"></a>00480     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00481"></a>00481         recipe = (cpl_recipe *)plugin;
-<a name="l00482"></a>00482     <span class="keywordflow">else</span> 
-<a name="l00483"></a>00483         <span class="keywordflow">return</span> -1;
-<a name="l00484"></a>00484 
-<a name="l00485"></a>00485     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00486"></a>00486 
-<a name="l00487"></a>00487     <span class="keywordflow">return</span> 0;
-<a name="l00488"></a>00488 }
-<a name="l00489"></a>00489 
-<a name="l00490"></a>00490 
-<a name="l00500"></a>00500 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00501"></a>00501 {
-<a name="l00502"></a>00502     cpl_table        *maskslits;
-<a name="l00503"></a>00503     cpl_propertylist *header;
-<a name="l00504"></a>00504     <span class="keywordtype">int</span>               mos;
-<a name="l00505"></a>00505     <span class="keywordtype">int</span>               multiplex;
-<a name="l00506"></a>00506 
-<a name="l00507"></a>00507     <span class="comment">/*</span>
-<a name="l00508"></a>00508 <span class="comment">     * Check whether there is spectral multiplexing here</span>
-<a name="l00509"></a>00509 <span class="comment">     */</span>
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MOS_ARC_SPECTRUM"</span>);
-<a name="l00512"></a>00512 
-<a name="l00513"></a>00513     <span class="keywordflow">if</span> (mos == 0) {
-<a name="l00514"></a>00514         cpl_msg_error(<span class="stringliteral">"vimos_calib"</span>, <span class="stringliteral">"Missing input arc lamp frame"</span>);
-<a name="l00515"></a>00515         <span class="keywordflow">return</span> -1;
-<a name="l00516"></a>00516     }
-<a name="l00517"></a>00517 
-<a name="l00518"></a>00518     <span class="keywordflow">if</span> (mos > 1) {
-<a name="l00519"></a>00519         cpl_msg_error(<span class="stringliteral">"vimos_calib"</span>, 
-<a name="l00520"></a>00520                       <span class="stringliteral">"Just one input arc lamp frame is allowed"</span>);
-<a name="l00521"></a>00521         <span class="keywordflow">return</span> -1;
-<a name="l00522"></a>00522     }
-<a name="l00523"></a>00523 
-<a name="l00524"></a>00524     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, <span class="stringliteral">"MOS_ARC_SPECTRUM"</span>, 0);
-<a name="l00525"></a>00525 
-<a name="l00526"></a>00526     <span class="keywordflow">if</span> (header == NULL) {
-<a name="l00527"></a>00527         cpl_msg_error(<span class="stringliteral">"vimos_calib"</span>, <span class="stringliteral">"Cannot load arc lamp header"</span>);
-<a name="l00528"></a>00528         <span class="keywordflow">return</span> -1;
-<a name="l00529"></a>00529     }
-<a name="l00530"></a>00530 
-<a name="l00531"></a>00531     maskslits = <a class="code" href="group__moses.html#g3431a4557418ee0f8cd9beefd7153a98">mos_load_slits_vimos</a>(header);
-<a name="l00532"></a>00532     cpl_propertylist_delete(header);
-<a name="l00533"></a>00533     multiplex = <a class="code" href="group__moses.html#gf2c5b165c7c2c4be802c03ae59d1b8a9">mos_check_multiplex</a>(maskslits);
-<a name="l00534"></a>00534 
-<a name="l00535"></a>00535     <span class="keywordflow">if</span> (multiplex == 1)
-<a name="l00536"></a>00536         <span class="keywordflow">return</span> <a class="code" href="group__vimos__calib__impl.html#gf710e60eea27cfed978ef2989d9b2a33">vimos_calib_impl</a>(frameset, parlist);
-<a name="l00537"></a>00537 
-<a name="l00538"></a>00538     cpl_msg_info(<span class="stringliteral">"vimos_calib"</span>, <span class="stringliteral">"Spectral multiplexing: %d"</span>, multiplex);
-<a name="l00539"></a>00539     cpl_msg_error(<span class="stringliteral">"vimos_calib"</span>, <span class="stringliteral">"Cannot handle such data"</span>);
-<a name="l00540"></a>00540     <span class="keywordflow">return</span> -1;
-<a name="l00541"></a>00541 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/vimos__calib_8c_source.html b/html/vimos__calib_8c_source.html
new file mode 100644
index 0000000..781c979
--- /dev/null
+++ b/html/vimos__calib_8c_source.html
@@ -0,0 +1,556 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: vimos_calib.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">vimos_calib.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: vimos_calib.c,v 1.21 2010-09-14 07:38:16 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:38:16 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.21 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <vimos_calib_impl.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_create(cpl_plugin *);</div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> </div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">static</span> <span class="keywordtype">char</span> vimos_calib_description[] =</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="stringliteral">"This recipe is used to identify reference lines on MOS arc lamp\n"</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="stringliteral">"exposures, and trace the spectral edges on the corresponding flat field\n"</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="stringliteral">"exposures. This information is used to determine the spectral extraction\n"</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"mask to be applied in the scientific data reduction, performed with the\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"recipe vimos_science. The input arc lamp and flat field exposures are\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"assumed to be obtained quasi-simultaneously, so that they would be\n"</span> </div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"described by exactly the same instrument distortions.\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"A line catalog must be specified, containing the wavelengths of the\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"reference arc lamp lines used for the wavelength calibration. A grism\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"table (typically depending on the instrument mode, and in particular on\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"the grism used) may also be specified: this table contains a default\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"recipe parameter setting to control the way spectra are extracted for\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"a specific instrument mode, as it is used for automatic run of the\n"</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"pipeline on Paranal and in Garching. If this table is specified, it\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"will modify the default recipe parameter setting, with the exception of\n"</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"those parameters which have been explicitly modifyed on the command line.\n"</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"If a grism table is not specified, the input recipe parameters values\n"</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"will always be read from the command line, or from an esorex configuration\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"file if present, or from their generic default values (that are rarely\n"</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"meaningful). Finally a master bias frame must be input to this recipe.\n"</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"In the table below the MOS_CURV_COEFF, MOS_CURV_TRACES, MOS_SPATIAL_MAP\n"</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"MOS_ARC_SPECTRUM_EXTRACTED, MOS_SPECTRA_DETECTION, MOS_SLIT_MAP, and\n"</span> </div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"MOS_SLIT_LOCATION, are never created in case of long-slit-like data.\n"</span> </div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"The products MOS_SPECTRA_DETECTION, MOS_SLIT_MAP, and MOS_DISP_RESIDUALS,\n"</span> </div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"are just created if the --check parameter is set to true. The product\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"GLOBAL_DISTORTION_TABLE is just created if more than 12 separate spectra\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"are found in the CCD.\n\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"  DO category:               Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"  MOS_SCREEN_FLAT            Raw         Flat field exposures    Y\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"  MOS_ARC_SPECTRUM           Raw         Arc lamp exposure       Y\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"  MASTER_BIAS or BIAS        Calib       Bias frame              Y\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"  LINE_CATALOG               Calib       Line catalog            Y\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="stringliteral">"  GRISM_TABLE                Calib       Grism table             .\n\n"</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="stringliteral">"  DO category:               Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"  MOS_COMBINED_SCREEN_FLAT   FITS image  Combined (sum) flat field\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"  MOS_MASTER_SCREEN_FLAT     FITS image  Normalised flat field\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="stringliteral">"  MOS_ARC_SPECTRUM_EXTRACTED FITS image  Wavelength calibrated arc spectrum\n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="stringliteral">"  MOS_DISP_COEFF             FITS table  Inverse dispersion coefficients\n"</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="stringliteral">"  MOS_DISP_RESIDUALS         FITS image  Residuals in wavelength calibration\n"</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="stringliteral">"  MOS_DISP_RESIDUALS_TABLE   FITS table  Residuals in wavelength calibration\n"</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="stringliteral">"  MOS_DELTA_IMAGE            FITS image  Offset vs linear wavelength calib\n"</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="stringliteral">"  MOS_WAVELENGTH_MAP         FITS image  Wavelength for each pixel on CCD\n"</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="stringliteral">"  MOS_SPECTRA_DETECTION      FITS image  Check for preliminary detection\n"</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="stringliteral">"  MOS_SLIT_MAP               FITS image  Map of central wavelength on CCD\n"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="stringliteral">"  MOS_CURV_TRACES            FITS table  Spectral curvature traces\n"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="stringliteral">"  MOS_CURV_COEFF             FITS table  Spectral curvature coefficients\n"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="stringliteral">"  MOS_SPATIAL_MAP            FITS image  Spatial position along slit on CCD\n"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="stringliteral">"  MOS_SPECTRAL_RESOLUTION    FITS table  Resolution at reference arc lines\n"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"  MOS_SLIT_LOCATION          FITS table  Slits on product frames and CCD\n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"  GLOBAL_DISTORTION_TABLE    FITS table  Global distortions table\n\n"</span>;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> </div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> {</div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> </div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>                     <span class="stringliteral">"vimos_calib"</span>,</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>                     <span class="stringliteral">"Determination of the extraction mask"</span>,</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>                     vimos_calib_description,</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                     vimos_calib_create,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                     vimos_calib_exec,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                     vimos_calib_destroy);</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> </div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     </div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> }</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> </div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> {</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span> </div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span> </div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span> </div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> </div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.dispersion"</span>,</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>                                 <span class="stringliteral">"Expected spectral dispersion (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>                                 0.0);</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span> </div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span> <span class="comment">     * Peak detection level</span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> </div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.peakdetection"</span>,</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>                                 <span class="stringliteral">"Initial peak detection threshold (ADU)"</span>,</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>                                 0.0);</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"peakdetection"</span>);</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span> </div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment">     * Degree of wavelength calibration polynomial</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.wdegree"</span>,</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>                                 <span class="stringliteral">"Degree of wavelength calibration polynomial"</span>,</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>                                 0);</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wdegree"</span>);</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span> </div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span> <span class="comment">     * Reference lines search radius</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.wradius"</span>,</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>                                 <span class="stringliteral">"Search radius if iterating pattern-matching "</span></div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                                 <span class="stringliteral">"with first-guess method"</span>,</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>                                 4);</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wradius"</span>);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span> </div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span> <span class="comment">     * Rejection threshold in dispersion relation polynomial fitting</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.wreject"</span>,</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>                                 <span class="stringliteral">"Rejection threshold in dispersion "</span></div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>                                 <span class="stringliteral">"relation fit (pixel)"</span>,</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>                                 0.7);</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wreject"</span>);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span> </div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span> <span class="comment">     * Wavelength solution interpolation (for LSS data)</span></div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span> </div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.wmode"</span>,</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>                                 <span class="stringliteral">"Interpolation mode of wavelength solution "</span></div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>                                 <span class="stringliteral">"applicable to LSS-like data (0 = no "</span></div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>                                 <span class="stringliteral">"interpolation, 1 = fill gaps, 2 = global "</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>                                 <span class="stringliteral">"model)"</span>,</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>                                 2);</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wmode"</span>);</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span> </div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span> <span class="comment">     * Line catalog table column containing the reference wavelengths</span></div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span> </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.wcolumn"</span>,</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>                                 <span class="stringliteral">"Name of line catalog table column "</span></div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span> </div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span> <span class="comment">     * Degree of spectral curvature polynomial</span></div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.cdegree"</span>,</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>                                 <span class="stringliteral">"Degree of spectral curvature polynomial"</span>,</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>                                 0);</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cdegree"</span>);</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span> </div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> <span class="comment">     * Curvature solution interpolation (for MOS-like data)</span></div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>  </div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.cmode"</span>,</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>                                 <span class="stringliteral">"Interpolation mode of curvature solution "</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>                                 <span class="stringliteral">"applicable to MOS-like data (0 = no "</span></div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>                                 <span class="stringliteral">"interpolation, 1 = fill gaps, 2 = global "</span></div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                                 <span class="stringliteral">"model)"</span>,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                                 1);</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cmode"</span>);</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.startwavelength"</span>,</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>                                 0.0);</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span> </div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.endwavelength"</span>,</div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>                                 0.0);</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> <span class="comment">     * Reference wavelength for wavelength calibration</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.reference"</span>,</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                                 <span class="stringliteral">"Reference wavelength for calibration"</span>,</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>                                 0.0);</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"reference"</span>);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> <span class="comment">     * Try slit identification</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.slit_ident"</span>,</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>                                 <span class="stringliteral">"Attempt slit identification"</span>,</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>                                 TRUE);</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_ident"</span>);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span> </div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> <span class="comment">     * Degree of flat field fitting polynomial along spatial direction </span></div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> <span class="comment">     * (used for LSS data)</span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.sdegree"</span>,</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                                 <span class="stringliteral">"Degree of flat field fitting polynomial "</span></div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>                                 <span class="stringliteral">"along spatial direction (used for LSS-like "</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                                 <span class="stringliteral">"data only)"</span>,</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                                 -1);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sdegree"</span>);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> </div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> <span class="comment">     * Degree of flat field fitting polynomial along dispersion direction</span></div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> <span class="comment">     * (used for MOS data)</span></div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span> </div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.ddegree"</span>,</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>                                 <span class="stringliteral">"Degree of flat field fitting polynomial "</span></div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>                                 <span class="stringliteral">"along dispersion direction (not used for "</span></div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>                                 <span class="stringliteral">"long-slit-like data)"</span>,</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>                                 -1);</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ddegree"</span>);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> </div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> <span class="comment">     * Smooth box radius for flat field along dispersion direction</span></div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span> </div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.dradius"</span>,</div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                                 <span class="stringliteral">"Smooth box radius for flat field along "</span></div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>                                 <span class="stringliteral">"dispersion direction"</span>,</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>                                 10);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dradius"</span>);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> <span class="comment">     * Smooth box radius for flat field along spatial direction</span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> <span class="comment">     * (used for LSS data only)</span></div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.sradius"</span>,</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>                                 <span class="stringliteral">"Smooth box radius for flat field along "</span></div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                                 <span class="stringliteral">"spatial direction"</span>,</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>                                 10);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"sradius"</span>);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> </div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> <span class="comment">     * Computation of QC1 parameters</span></div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span> </div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.qc"</span>,</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                                 <span class="stringliteral">"Compute QC1 parameters"</span>,</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>                                 TRUE);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"qc"</span>);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> </div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> <span class="comment">     * Create check products</span></div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span> </div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_calib.check"</span>,</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                                 <span class="stringliteral">"Create intermediate products"</span>,</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                                 <span class="stringliteral">"fors.vimos_calib"</span>,</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>                                 FALSE);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"check"</span>);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> }</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> </div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> </div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> {</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     </div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="keywordflow">return</span> vimos_calib(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> }</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> </div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> </div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> {</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> </div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> </div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span> }</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> </div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span> </div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span> {</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     cpl_table        *maskslits;</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>     cpl_propertylist *header;</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>     <span class="keywordtype">int</span>               mos;</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>     <span class="keywordtype">int</span>               multiplex;</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span> </div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> <span class="comment">     * Check whether there is spectral multiplexing here</span></div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span> </div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MOS_ARC_SPECTRUM"</span>);</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span> </div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>     <span class="keywordflow">if</span> (mos == 0) {</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span>         cpl_msg_error(<span class="stringliteral">"vimos_calib"</span>, <span class="stringliteral">"Missing input arc lamp frame"</span>);</div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     }</div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span> </div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>     <span class="keywordflow">if</span> (mos > 1) {</div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>         cpl_msg_error(<span class="stringliteral">"vimos_calib"</span>, </div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>                       <span class="stringliteral">"Just one input arc lamp frame is allowed"</span>);</div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>     }</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> </div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, <span class="stringliteral">"MOS_ARC_SPECTRUM"</span>, 0);</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> </div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     <span class="keywordflow">if</span> (header == NULL) {</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>         cpl_msg_error(<span class="stringliteral">"vimos_calib"</span>, <span class="stringliteral">"Cannot load arc lamp header"</span>);</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>     }</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span> </div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>     maskslits = <a class="code" href="group__moses.html#ga3946bc30280b3b041a20ae9c9326f827" title="Create slit location table from FITS header of VIMOS data.">mos_load_slits_vimos</a>(header);</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     multiplex = <a class="code" href="group__moses.html#ga332b9bfd8e704446ad24d9fa448f9df2" title="Determining whether a VIMOS mask has spectral multplexing or not.">mos_check_multiplex</a>(maskslits);</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="keywordflow">if</span> (multiplex == 1)</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span>         <span class="keywordflow">return</span> <a class="code" href="group__vimos__calib__impl.html#gaff1b7bb1f87357c0ae0d3bd62c12b096" title="Interpret the command line options and execute the data processing.">vimos_calib_impl</a>(frameset, parlist);</div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> </div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span>     cpl_msg_info(<span class="stringliteral">"vimos_calib"</span>, <span class="stringliteral">"Spectral multiplexing: %d"</span>, multiplex);</div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     cpl_msg_error(<span class="stringliteral">"vimos_calib"</span>, <span class="stringliteral">"Cannot handle such data"</span>);</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>     <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/vimos__calib__impl_8c-source.html b/html/vimos__calib__impl_8c-source.html
deleted file mode 100644
index 1596839..0000000
--- a/html/vimos__calib__impl_8c-source.html
+++ /dev/null
@@ -1,2156 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: vimos_calib_impl.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>vimos_calib_impl.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: vimos_calib_impl.c,v 1.4 2013/04/24 14:17:05 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:17:05 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <vimos_calib_impl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <math.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <moses.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 <span class="preprocessor">#define vimos_calib_exit(message)                     \</span>
-<a name="l00041"></a>00041 <span class="preprocessor">{                                                     \</span>
-<a name="l00042"></a>00042 <span class="preprocessor">if (message !=NULL ) cpl_msg_error(recipe, message);  \</span>
-<a name="l00043"></a>00043 <span class="preprocessor">cpl_free(instrume);                                   \</span>
-<a name="l00044"></a>00044 <span class="preprocessor">cpl_free(pipefile);                                   \</span>
-<a name="l00045"></a>00045 <span class="preprocessor">cpl_free(fiterror);                                   \</span>
-<a name="l00046"></a>00046 <span class="preprocessor">cpl_free(fitlines);                                   \</span>
-<a name="l00047"></a>00047 <span class="preprocessor">cpl_image_delete(bias);                               \</span>
-<a name="l00048"></a>00048 <span class="preprocessor">cpl_image_delete(master_bias);                        \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">cpl_image_delete(coordinate);                         \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">cpl_image_delete(checkwave);                          \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">cpl_image_delete(flat);                               \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">cpl_image_delete(master_flat);                        \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">cpl_image_delete(norm_flat);                          \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">cpl_image_delete(rainbow);                            \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">cpl_image_delete(rectified);                          \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">cpl_image_delete(residual);                           \</span>
-<a name="l00057"></a>00057 <span class="preprocessor">cpl_image_delete(smo_flat);                           \</span>
-<a name="l00058"></a>00058 <span class="preprocessor">cpl_image_delete(spatial);                            \</span>
-<a name="l00059"></a>00059 <span class="preprocessor">cpl_image_delete(spectra);                            \</span>
-<a name="l00060"></a>00060 <span class="preprocessor">cpl_image_delete(wavemap);                            \</span>
-<a name="l00061"></a>00061 <span class="preprocessor">cpl_image_delete(delta);                              \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">cpl_mask_delete(refmask);                             \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">cpl_propertylist_delete(header);                      \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">cpl_propertylist_delete(save_header);                 \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">cpl_propertylist_delete(qclist);                      \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">cpl_table_delete(grism_table);                        \</span>
-<a name="l00067"></a>00067 <span class="preprocessor">cpl_table_delete(idscoeff);                           \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">cpl_table_delete(restable);                           \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">cpl_table_delete(maskslits);                          \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">cpl_table_delete(overscans);                          \</span>
-<a name="l00071"></a>00071 <span class="preprocessor">cpl_table_delete(traces);                             \</span>
-<a name="l00072"></a>00072 <span class="preprocessor">cpl_table_delete(polytraces);                         \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">cpl_table_delete(slits);                              \</span>
-<a name="l00074"></a>00074 <span class="preprocessor">cpl_table_delete(restab);                             \</span>
-<a name="l00075"></a>00075 <span class="preprocessor">cpl_table_delete(global);                             \</span>
-<a name="l00076"></a>00076 <span class="preprocessor">cpl_table_delete(wavelengths);                        \</span>
-<a name="l00077"></a>00077 <span class="preprocessor">cpl_vector_delete(lines);                             \</span>
-<a name="l00078"></a>00078 <span class="preprocessor">cpl_msg_indent_less();                                \</span>
-<a name="l00079"></a>00079 <span class="preprocessor">return -1;                                            \</span>
-<a name="l00080"></a>00080 <span class="preprocessor">}</span>
-<a name="l00081"></a>00081 <span class="preprocessor"></span>
-<a name="l00082"></a>00082 <span class="preprocessor">#define vimos_calib_exit_memcheck(message)          \</span>
-<a name="l00083"></a>00083 <span class="preprocessor">{                                                   \</span>
-<a name="l00084"></a>00084 <span class="preprocessor">if (message !=NULL ) cpl_msg_info(recipe, message); \</span>
-<a name="l00085"></a>00085 <span class="preprocessor">printf("free instrume (%p)\n", instrume);           \</span>
-<a name="l00086"></a>00086 <span class="preprocessor">cpl_free(instrume);                                 \</span>
-<a name="l00087"></a>00087 <span class="preprocessor">printf("free pipefile (%p)\n", pipefile);           \</span>
-<a name="l00088"></a>00088 <span class="preprocessor">cpl_free(pipefile);                                 \</span>
-<a name="l00089"></a>00089 <span class="preprocessor">printf("free fiterror (%p)\n", fiterror);           \</span>
-<a name="l00090"></a>00090 <span class="preprocessor">cpl_free(fiterror);                                 \</span>
-<a name="l00091"></a>00091 <span class="preprocessor">printf("free fitlines (%p)\n", fitlines);           \</span>
-<a name="l00092"></a>00092 <span class="preprocessor">cpl_free(fitlines);                                 \</span>
-<a name="l00093"></a>00093 <span class="preprocessor">printf("free bias (%p)\n", bias);                   \</span>
-<a name="l00094"></a>00094 <span class="preprocessor">cpl_image_delete(bias);                             \</span>
-<a name="l00095"></a>00095 <span class="preprocessor">printf("free master_bias (%p)\n", master_bias);     \</span>
-<a name="l00096"></a>00096 <span class="preprocessor">cpl_image_delete(master_bias);                      \</span>
-<a name="l00097"></a>00097 <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);       \</span>
-<a name="l00098"></a>00098 <span class="preprocessor">cpl_image_delete(coordinate);                       \</span>
-<a name="l00099"></a>00099 <span class="preprocessor">printf("free checkwave (%p)\n", checkwave);         \</span>
-<a name="l00100"></a>00100 <span class="preprocessor">cpl_image_delete(checkwave);                        \</span>
-<a name="l00101"></a>00101 <span class="preprocessor">printf("free flat (%p)\n", flat);                   \</span>
-<a name="l00102"></a>00102 <span class="preprocessor">cpl_image_delete(flat);                             \</span>
-<a name="l00103"></a>00103 <span class="preprocessor">printf("free master_flat (%p)\n", master_flat);     \</span>
-<a name="l00104"></a>00104 <span class="preprocessor">cpl_image_delete(master_flat);                      \</span>
-<a name="l00105"></a>00105 <span class="preprocessor">printf("free norm_flat (%p)\n", norm_flat);         \</span>
-<a name="l00106"></a>00106 <span class="preprocessor">cpl_image_delete(norm_flat);                        \</span>
-<a name="l00107"></a>00107 <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);             \</span>
-<a name="l00108"></a>00108 <span class="preprocessor">cpl_image_delete(rainbow);                          \</span>
-<a name="l00109"></a>00109 <span class="preprocessor">printf("free rectified (%p)\n", rectified);         \</span>
-<a name="l00110"></a>00110 <span class="preprocessor">cpl_image_delete(rectified);                        \</span>
-<a name="l00111"></a>00111 <span class="preprocessor">printf("free residual (%p)\n", residual);           \</span>
-<a name="l00112"></a>00112 <span class="preprocessor">cpl_image_delete(residual);                         \</span>
-<a name="l00113"></a>00113 <span class="preprocessor">printf("free smo_flat (%p)\n", smo_flat);           \</span>
-<a name="l00114"></a>00114 <span class="preprocessor">cpl_image_delete(smo_flat);                         \</span>
-<a name="l00115"></a>00115 <span class="preprocessor">printf("free spatial (%p)\n", spatial);             \</span>
-<a name="l00116"></a>00116 <span class="preprocessor">cpl_image_delete(spatial);                          \</span>
-<a name="l00117"></a>00117 <span class="preprocessor">printf("free spectra (%p)\n", spectra);             \</span>
-<a name="l00118"></a>00118 <span class="preprocessor">cpl_image_delete(spectra);                          \</span>
-<a name="l00119"></a>00119 <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);             \</span>
-<a name="l00120"></a>00120 <span class="preprocessor">cpl_image_delete(wavemap);                          \</span>
-<a name="l00121"></a>00121 <span class="preprocessor">printf("free delta (%p)\n", delta);                 \</span>
-<a name="l00122"></a>00122 <span class="preprocessor">cpl_image_delete(delta);                            \</span>
-<a name="l00123"></a>00123 <span class="preprocessor">printf("free refmask (%p)\n", refmask);             \</span>
-<a name="l00124"></a>00124 <span class="preprocessor">cpl_mask_delete(refmask);                           \</span>
-<a name="l00125"></a>00125 <span class="preprocessor">printf("free header (%p)\n", header);               \</span>
-<a name="l00126"></a>00126 <span class="preprocessor">cpl_propertylist_delete(header);                    \</span>
-<a name="l00127"></a>00127 <span class="preprocessor">printf("free save_header (%p)\n", save_header);     \</span>
-<a name="l00128"></a>00128 <span class="preprocessor">cpl_propertylist_delete(save_header);               \</span>
-<a name="l00129"></a>00129 <span class="preprocessor">printf("free qclist (%p)\n", qclist);               \</span>
-<a name="l00130"></a>00130 <span class="preprocessor">cpl_propertylist_delete(qclist);                    \</span>
-<a name="l00131"></a>00131 <span class="preprocessor">printf("free grism_table (%p)\n", grism_table);     \</span>
-<a name="l00132"></a>00132 <span class="preprocessor">cpl_table_delete(grism_table);                      \</span>
-<a name="l00133"></a>00133 <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);           \</span>
-<a name="l00134"></a>00134 <span class="preprocessor">cpl_table_delete(idscoeff);                         \</span>
-<a name="l00135"></a>00135 <span class="preprocessor">printf("free restable (%p)\n", restable);           \</span>
-<a name="l00136"></a>00136 <span class="preprocessor">cpl_table_delete(restable);                         \</span>
-<a name="l00137"></a>00137 <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);         \</span>
-<a name="l00138"></a>00138 <span class="preprocessor">cpl_table_delete(maskslits);                        \</span>
-<a name="l00139"></a>00139 <span class="preprocessor">printf("free overscans (%p)\n", overscans);         \</span>
-<a name="l00140"></a>00140 <span class="preprocessor">cpl_table_delete(overscans);                        \</span>
-<a name="l00141"></a>00141 <span class="preprocessor">printf("free traces (%p)\n", traces);               \</span>
-<a name="l00142"></a>00142 <span class="preprocessor">cpl_table_delete(traces);                           \</span>
-<a name="l00143"></a>00143 <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);       \</span>
-<a name="l00144"></a>00144 <span class="preprocessor">cpl_table_delete(polytraces);                       \</span>
-<a name="l00145"></a>00145 <span class="preprocessor">printf("free slits (%p)\n", slits);                 \</span>
-<a name="l00146"></a>00146 <span class="preprocessor">cpl_table_delete(slits);                            \</span>
-<a name="l00147"></a>00147 <span class="preprocessor">printf("free restab (%p)\n", restab);               \</span>
-<a name="l00148"></a>00148 <span class="preprocessor">cpl_table_delete(restab);                           \</span>
-<a name="l00149"></a>00149 <span class="preprocessor">printf("free global (%p)\n", global);               \</span>
-<a name="l00150"></a>00150 <span class="preprocessor">cpl_table_delete(global);                           \</span>
-<a name="l00151"></a>00151 <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths);     \</span>
-<a name="l00152"></a>00152 <span class="preprocessor">cpl_table_delete(wavelengths);                      \</span>
-<a name="l00153"></a>00153 <span class="preprocessor">printf("free lines (%p)\n", lines);                 \</span>
-<a name="l00154"></a>00154 <span class="preprocessor">cpl_vector_delete(lines);                           \</span>
-<a name="l00155"></a>00155 <span class="preprocessor">cpl_msg_indent_less();                              \</span>
-<a name="l00156"></a>00156 <span class="preprocessor">return 0;                                           \</span>
-<a name="l00157"></a>00157 <span class="preprocessor">}</span>
-<a name="l00158"></a>00158 <span class="preprocessor"></span>
-<a name="l00174"></a><a class="code" href="group__vimos__calib__impl.html#gf710e60eea27cfed978ef2989d9b2a33">00174</a> <span class="keywordtype">int</span> <a class="code" href="group__vimos__calib__impl.html#gf710e60eea27cfed978ef2989d9b2a33">vimos_calib_impl</a>(cpl_frameset *frameset, cpl_parameterlist *parlist)
-<a name="l00175"></a>00175 {
-<a name="l00176"></a>00176 
-<a name="l00177"></a>00177     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"vimos_calib"</span>;
-<a name="l00178"></a>00178 
-<a name="l00179"></a>00179     <span class="comment">/*</span>
-<a name="l00180"></a>00180 <span class="comment">     * Input parameters</span>
-<a name="l00181"></a>00181 <span class="comment">     */</span>
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183     <span class="keywordtype">double</span>      dispersion;
-<a name="l00184"></a>00184     <span class="keywordtype">double</span>      peakdetection;
-<a name="l00185"></a>00185     <span class="keywordtype">int</span>         wdegree;
-<a name="l00186"></a>00186     <span class="keywordtype">int</span>         wradius;
-<a name="l00187"></a>00187     <span class="keywordtype">double</span>      wreject;
-<a name="l00188"></a>00188     <span class="keywordtype">int</span>         wmode;
-<a name="l00189"></a>00189     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00190"></a>00190     <span class="keywordtype">int</span>         cdegree;
-<a name="l00191"></a>00191     <span class="keywordtype">int</span>         cmode;
-<a name="l00192"></a>00192     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00193"></a>00193     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00194"></a>00194     <span class="keywordtype">double</span>      reference;
-<a name="l00195"></a>00195     <span class="keywordtype">int</span>         slit_ident;
-<a name="l00196"></a>00196     <span class="keywordtype">int</span>         sdegree;
-<a name="l00197"></a>00197     <span class="keywordtype">int</span>         ddegree;
-<a name="l00198"></a>00198     <span class="keywordtype">int</span>         sradius;
-<a name="l00199"></a>00199     <span class="keywordtype">int</span>         dradius;
-<a name="l00200"></a>00200     <span class="keywordtype">int</span>         qc;
-<a name="l00201"></a>00201     <span class="keywordtype">int</span>         check;
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203     <span class="comment">/*</span>
-<a name="l00204"></a>00204 <span class="comment">     * CPL objects</span>
-<a name="l00205"></a>00205 <span class="comment">     */</span>
-<a name="l00206"></a>00206 
-<a name="l00207"></a>00207     cpl_imagelist    *biases      = NULL;
-<a name="l00208"></a>00208     cpl_image        *bias        = NULL;
-<a name="l00209"></a>00209     cpl_image        *master_bias = NULL;
-<a name="l00210"></a>00210     cpl_image        *multi_bias  = NULL;
-<a name="l00211"></a>00211     cpl_image        *flat        = NULL;
-<a name="l00212"></a>00212     cpl_image        *master_flat = NULL;
-<a name="l00213"></a>00213     cpl_image        *smo_flat    = NULL;
-<a name="l00214"></a>00214     cpl_image        *norm_flat   = NULL;
-<a name="l00215"></a>00215     cpl_image        *spectra     = NULL;
-<a name="l00216"></a>00216     cpl_image        *wavemap     = NULL;
-<a name="l00217"></a>00217     cpl_image        *delta       = NULL;
-<a name="l00218"></a>00218     cpl_image        *residual    = NULL;
-<a name="l00219"></a>00219     cpl_image        *checkwave   = NULL;
-<a name="l00220"></a>00220     cpl_image        *rectified   = NULL;
-<a name="l00221"></a>00221     cpl_image        *dummy       = NULL;
-<a name="l00222"></a>00222     cpl_image        *refimage    = NULL;
-<a name="l00223"></a>00223     cpl_image        *coordinate  = NULL;
-<a name="l00224"></a>00224     cpl_image        *rainbow     = NULL;
-<a name="l00225"></a>00225     cpl_image        *spatial     = NULL;
-<a name="l00226"></a>00226 
-<a name="l00227"></a>00227     cpl_mask         *refmask     = NULL;
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229     cpl_table        *grism_table = NULL;
-<a name="l00230"></a>00230     cpl_table        *overscans   = NULL;
-<a name="l00231"></a>00231     cpl_table        *wavelengths = NULL;
-<a name="l00232"></a>00232     cpl_table        *idscoeff    = NULL;
-<a name="l00233"></a>00233     cpl_table        *restable    = NULL;
-<a name="l00234"></a>00234     cpl_table        *slits       = NULL;
-<a name="l00235"></a>00235     cpl_table        *positions   = NULL;
-<a name="l00236"></a>00236     cpl_table        *maskslits   = NULL;
-<a name="l00237"></a>00237     cpl_table        *traces      = NULL;
-<a name="l00238"></a>00238     cpl_table        *polytraces  = NULL;
-<a name="l00239"></a>00239     cpl_table        *restab      = NULL;
-<a name="l00240"></a>00240     cpl_table        *global      = NULL;
-<a name="l00241"></a>00241 
-<a name="l00242"></a>00242     cpl_vector       *lines       = NULL;
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     cpl_propertylist *header      = NULL;
-<a name="l00245"></a>00245     cpl_propertylist *save_header = NULL;
-<a name="l00246"></a>00246     cpl_propertylist *qclist      = NULL;
-<a name="l00247"></a>00247 
-<a name="l00248"></a>00248     <span class="comment">/*</span>
-<a name="l00249"></a>00249 <span class="comment">     * Auxiliary variables</span>
-<a name="l00250"></a>00250 <span class="comment">     */</span>
-<a name="l00251"></a>00251 
-<a name="l00252"></a>00252     cpl_table  *idscoeff_lss = NULL;
-<a name="l00253"></a>00253     <span class="keywordtype">char</span>        version[80];
-<a name="l00254"></a>00254     <span class="keyword">const</span> <span class="keywordtype">char</span> *arc_tag;
-<a name="l00255"></a>00255     <span class="keyword">const</span> <span class="keywordtype">char</span> *flat_tag;
-<a name="l00256"></a>00256     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_screen_flat_tag;
-<a name="l00257"></a>00257     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_norm_flat_tag;
-<a name="l00258"></a>00258     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_lamp_tag;
-<a name="l00259"></a>00259     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_residuals_tag;
-<a name="l00260"></a>00260     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;
-<a name="l00261"></a>00261     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_tag;
-<a name="l00262"></a>00262     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectra_detection_tag;
-<a name="l00263"></a>00263     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectral_resolution_tag;
-<a name="l00264"></a>00264     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_map_tag;
-<a name="l00265"></a>00265     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_traces_tag;
-<a name="l00266"></a>00266     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;
-<a name="l00267"></a>00267     <span class="keyword">const</span> <span class="keywordtype">char</span> *spatial_map_tag;
-<a name="l00268"></a>00268     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00269"></a>00269     <span class="keyword">const</span> <span class="keywordtype">char</span> *global_distortion_tag = <span class="stringliteral">"GLOBAL_DISTORTION_TABLE"</span>;
-<a name="l00270"></a>00270     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_residuals_table_tag;
-<a name="l00271"></a>00271     <span class="keyword">const</span> <span class="keywordtype">char</span> *delta_image_tag;
-<a name="l00272"></a>00272     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_gris_name;
-<a name="l00273"></a>00273     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_gris_id;
-<a name="l00274"></a>00274     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_filt_name;
-<a name="l00275"></a>00275     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_filt_id;
-<a name="l00276"></a>00276     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_mask_id;
-<a name="l00277"></a>00277     <span class="keywordtype">char</span>       *keyname;
-<a name="l00278"></a>00278     <span class="keywordtype">int</span>         quadrant;
-<a name="l00279"></a>00279     <span class="keywordtype">int</span>         mos;
-<a name="l00280"></a>00280     <span class="keywordtype">int</span>         treat_as_lss = 0;
-<a name="l00281"></a>00281     <span class="keywordtype">int</span>         nslits;
-<a name="l00282"></a>00282     <span class="keywordtype">double</span>     *xpos;
-<a name="l00283"></a>00283     <span class="keywordtype">double</span>      mxpos;
-<a name="l00284"></a>00284     <span class="keywordtype">double</span>      mean_rms;
-<a name="l00285"></a>00285     <span class="keywordtype">double</span>      alltime, arctime;
-<a name="l00286"></a>00286     <span class="keywordtype">int</span>         nflats;
-<a name="l00287"></a>00287     <span class="keywordtype">int</span>         nbias;
-<a name="l00288"></a>00288     <span class="keywordtype">int</span>         nlines;
-<a name="l00289"></a>00289     <span class="keywordtype">double</span>     *line;
-<a name="l00290"></a>00290     <span class="keywordtype">double</span>     *fiterror = NULL;
-<a name="l00291"></a>00291     <span class="keywordtype">int</span>        *fitlines = NULL;
-<a name="l00292"></a>00292     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00293"></a>00293     <span class="keywordtype">double</span>      gain;
-<a name="l00294"></a>00294     <span class="keywordtype">int</span>         ccd_xsize, ccd_ysize;
-<a name="l00295"></a>00295     <span class="keywordtype">int</span>         rotate = 1;
-<a name="l00296"></a>00296     <span class="keywordtype">int</span>         rotate_back = -1;
-<a name="l00297"></a>00297     <span class="keywordtype">int</span>         i;
-<a name="l00298"></a>00298 
-<a name="l00299"></a>00299     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00300"></a>00300     <span class="keywordtype">char</span>       *pipefile = NULL;
-<a name="l00301"></a>00301     <span class="keywordtype">char</span>       *grism;
-<a name="l00302"></a>00302 
-<a name="l00303"></a>00303 
-<a name="l00304"></a>00304     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00305"></a>00305 
-<a name="l00306"></a>00306     cpl_msg_set_indentation(2);
-<a name="l00307"></a>00307 
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309     <span class="comment">/* </span>
-<a name="l00310"></a>00310 <span class="comment">     * Get configuration parameters</span>
-<a name="l00311"></a>00311 <span class="comment">     */</span>
-<a name="l00312"></a>00312 
-<a name="l00313"></a>00313     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00314"></a>00314     cpl_msg_indent_more();
-<a name="l00315"></a>00315 
-<a name="l00316"></a>00316     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00317"></a>00317         vimos_calib_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);
-<a name="l00318"></a>00318 
-<a name="l00319"></a>00319     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00320"></a>00320 
-<a name="l00321"></a>00321     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00322"></a>00322                     <span class="stringliteral">"fors.vimos_calib.dispersion"</span>, grism_table);
-<a name="l00323"></a>00323 
-<a name="l00324"></a>00324     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00325"></a>00325         vimos_calib_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);
-<a name="l00326"></a>00326 
-<a name="l00327"></a>00327     peakdetection = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00328"></a>00328                     <span class="stringliteral">"fors.vimos_calib.peakdetection"</span>, grism_table);
-<a name="l00329"></a>00329     <span class="keywordflow">if</span> (peakdetection <= 0.0)
-<a name="l00330"></a>00330         vimos_calib_exit(<span class="stringliteral">"Invalid peak detection level"</span>);
-<a name="l00331"></a>00331 
-<a name="l00332"></a>00332     wdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00333"></a>00333                     <span class="stringliteral">"fors.vimos_calib.wdegree"</span>, grism_table);
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335     <span class="keywordflow">if</span> (wdegree < 1)
-<a name="l00336"></a>00336         vimos_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00337"></a>00337 
-<a name="l00338"></a>00338     <span class="keywordflow">if</span> (wdegree > 5)
-<a name="l00339"></a>00339         vimos_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00340"></a>00340 
-<a name="l00341"></a>00341     wradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.wradius"</span>, NULL);
-<a name="l00342"></a>00342 
-<a name="l00343"></a>00343     <span class="keywordflow">if</span> (wradius < 0)
-<a name="l00344"></a>00344         vimos_calib_exit(<span class="stringliteral">"Invalid search radius"</span>);
-<a name="l00345"></a>00345 
-<a name="l00346"></a>00346     wreject = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00347"></a>00347                                        <span class="stringliteral">"fors.vimos_calib.wreject"</span>, NULL);
-<a name="l00348"></a>00348 
-<a name="l00349"></a>00349     <span class="keywordflow">if</span> (wreject <= 0.0)
-<a name="l00350"></a>00350         vimos_calib_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);
-<a name="l00351"></a>00351 
-<a name="l00352"></a>00352     wmode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.wmode"</span>, NULL);
-<a name="l00353"></a>00353 
-<a name="l00354"></a>00354     <span class="keywordflow">if</span> (wmode < 0 || wmode > 2)
-<a name="l00355"></a>00355         vimos_calib_exit(<span class="stringliteral">"Invalid wavelength solution interpolation mode"</span>);
-<a name="l00356"></a>00356 
-<a name="l00357"></a>00357     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00358"></a>00358                                        <span class="stringliteral">"fors.vimos_calib.wcolumn"</span>, NULL);
-<a name="l00359"></a>00359 
-<a name="l00360"></a>00360     cdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00361"></a>00361                     <span class="stringliteral">"fors.vimos_calib.cdegree"</span>, grism_table);
-<a name="l00362"></a>00362 
-<a name="l00363"></a>00363     <span class="keywordflow">if</span> (cdegree < 1)
-<a name="l00364"></a>00364         vimos_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);
-<a name="l00365"></a>00365 
-<a name="l00366"></a>00366     <span class="keywordflow">if</span> (cdegree > 5)
-<a name="l00367"></a>00367         vimos_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369     cmode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.cmode"</span>, NULL);
-<a name="l00370"></a>00370 
-<a name="l00371"></a>00371     <span class="keywordflow">if</span> (cmode < 0 || cmode > 2)
-<a name="l00372"></a>00372         vimos_calib_exit(<span class="stringliteral">"Invalid curvature solution interpolation mode"</span>);
-<a name="l00373"></a>00373 
-<a name="l00374"></a>00374     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00375"></a>00375                     <span class="stringliteral">"fors.vimos_calib.startwavelength"</span>, grism_table);
-<a name="l00376"></a>00376     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00377"></a>00377         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00378"></a>00378             vimos_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00379"></a>00379 
-<a name="l00380"></a>00380     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00381"></a>00381                     <span class="stringliteral">"fors.vimos_calib.endwavelength"</span>, grism_table);
-<a name="l00382"></a>00382     <span class="keywordflow">if</span> (endwavelength > 1.0) {
-<a name="l00383"></a>00383         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00384"></a>00384             vimos_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00385"></a>00385         <span class="keywordflow">if</span> (startwavelength < 1.0)
-<a name="l00386"></a>00386             vimos_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00387"></a>00387     }
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389     <span class="keywordflow">if</span> (startwavelength > 1.0)
-<a name="l00390"></a>00390         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00391"></a>00391             vimos_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393     reference = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00394"></a>00394                 <span class="stringliteral">"fors.vimos_calib.reference"</span>, grism_table);
-<a name="l00395"></a>00395 
-<a name="l00396"></a>00396     <span class="keywordflow">if</span> (reference < startwavelength || reference > endwavelength)
-<a name="l00397"></a>00397         vimos_calib_exit(<span class="stringliteral">"Invalid reference wavelength"</span>);
-<a name="l00398"></a>00398 
-<a name="l00399"></a>00399     slit_ident = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00400"></a>00400                     <span class="stringliteral">"fors.vimos_calib.slit_ident"</span>, NULL);
-<a name="l00401"></a>00401 
-<a name="l00402"></a>00402     sdegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.sdegree"</span>, NULL);
-<a name="l00403"></a>00403     ddegree = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.ddegree"</span>, NULL);
-<a name="l00404"></a>00404     sradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.sradius"</span>, NULL);
-<a name="l00405"></a>00405     dradius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.dradius"</span>, NULL);
-<a name="l00406"></a>00406 
-<a name="l00407"></a>00407     <span class="keywordflow">if</span> (sradius < 1 || dradius < 1)
-<a name="l00408"></a>00408         vimos_calib_exit(<span class="stringliteral">"Invalid smoothing box radius"</span>);
-<a name="l00409"></a>00409 
-<a name="l00410"></a>00410     qc = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_calib.qc"</span>, NULL);
-<a name="l00411"></a>00411 
-<a name="l00412"></a>00412     check = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_calib.check"</span>, NULL);
-<a name="l00413"></a>00413 
-<a name="l00414"></a>00414     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00415"></a>00415 
-<a name="l00416"></a>00416     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00417"></a>00417         vimos_calib_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00418"></a>00418 
-<a name="l00419"></a>00419 
-<a name="l00420"></a>00420     <span class="comment">/* </span>
-<a name="l00421"></a>00421 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00422"></a>00422 <span class="comment">     */</span>
-<a name="l00423"></a>00423 
-<a name="l00424"></a>00424     cpl_msg_indent_less();
-<a name="l00425"></a>00425     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00426"></a>00426     cpl_msg_indent_more();
-<a name="l00427"></a>00427 
-<a name="l00428"></a>00428     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO OCS CON QUAD"</span>)) 
-<a name="l00429"></a>00429         vimos_calib_exit(<span class="stringliteral">"Input frames are not from the same quadrant"</span>);
-<a name="l00430"></a>00430 
-<a name="l00431"></a>00431     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MOS_ARC_SPECTRUM"</span>);
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433     <span class="keywordflow">if</span> (mos == 0)
-<a name="l00434"></a>00434         vimos_calib_exit(<span class="stringliteral">"Missing input arc lamp frame"</span>);
-<a name="l00435"></a>00435 
-<a name="l00436"></a>00436     <span class="keywordflow">if</span> (mos > 1)
-<a name="l00437"></a>00437         vimos_calib_exit(<span class="stringliteral">"Just one input arc lamp frame is allowed"</span>); 
-<a name="l00438"></a>00438 
-<a name="l00439"></a>00439     arc_tag                  = <span class="stringliteral">"MOS_ARC_SPECTRUM"</span>;
-<a name="l00440"></a>00440     flat_tag                 = <span class="stringliteral">"MOS_SCREEN_FLAT"</span>;
-<a name="l00441"></a>00441     master_screen_flat_tag   = <span class="stringliteral">"MOS_COMBINED_SCREEN_FLAT"</span>;
-<a name="l00442"></a>00442     master_norm_flat_tag     = <span class="stringliteral">"MOS_MASTER_SCREEN_FLAT"</span>;
-<a name="l00443"></a>00443     reduced_lamp_tag         = <span class="stringliteral">"MOS_ARC_SPECTRUM_EXTRACTED"</span>;
-<a name="l00444"></a>00444     disp_residuals_tag       = <span class="stringliteral">"MOS_DISP_RESIDUALS"</span>;
-<a name="l00445"></a>00445     disp_coeff_tag           = <span class="stringliteral">"MOS_DISP_COEFF"</span>;
-<a name="l00446"></a>00446     wavelength_map_tag       = <span class="stringliteral">"MOS_WAVELENGTH_MAP"</span>;
-<a name="l00447"></a>00447     spectra_detection_tag    = <span class="stringliteral">"MOS_SPECTRA_DETECTION"</span>;
-<a name="l00448"></a>00448     spectral_resolution_tag  = <span class="stringliteral">"MOS_SPECTRAL_RESOLUTION"</span>;
-<a name="l00449"></a>00449     slit_map_tag             = <span class="stringliteral">"MOS_SLIT_MAP"</span>;
-<a name="l00450"></a>00450     curv_traces_tag          = <span class="stringliteral">"MOS_CURV_TRACES"</span>;
-<a name="l00451"></a>00451     curv_coeff_tag           = <span class="stringliteral">"MOS_CURV_COEFF"</span>;
-<a name="l00452"></a>00452     spatial_map_tag          = <span class="stringliteral">"MOS_SPATIAL_MAP"</span>;
-<a name="l00453"></a>00453     slit_location_tag        = <span class="stringliteral">"MOS_SLIT_LOCATION"</span>;
-<a name="l00454"></a>00454     disp_residuals_table_tag = <span class="stringliteral">"MOS_DISP_RESIDUALS_TABLE"</span>;
-<a name="l00455"></a>00455     delta_image_tag          = <span class="stringliteral">"MOS_DELTA_IMAGE"</span>;
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457     nbias = 0;
-<a name="l00458"></a>00458     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0) {
-<a name="l00459"></a>00459         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"BIAS"</span>) == 0)
-<a name="l00460"></a>00460             vimos_calib_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS or BIAS"</span>);
-<a name="l00461"></a>00461         nbias = cpl_frameset_count_tags(frameset, <span class="stringliteral">"BIAS"</span>);
-<a name="l00462"></a>00462     }
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)
-<a name="l00465"></a>00465         vimos_calib_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);
-<a name="l00466"></a>00466 
-<a name="l00467"></a>00467     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"LINE_CATALOG"</span>) == 0)
-<a name="l00468"></a>00468         vimos_calib_exit(<span class="stringliteral">"Missing required input: LINE_CATALOG"</span>);
-<a name="l00469"></a>00469 
-<a name="l00470"></a>00470     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"LINE_CATALOG"</span>) > 1)
-<a name="l00471"></a>00471         vimos_calib_exit(<span class="stringliteral">"Too many in input: LINE_CATALOG"</span>);
-<a name="l00472"></a>00472 
-<a name="l00473"></a>00473     nflats = cpl_frameset_count_tags(frameset, flat_tag);
-<a name="l00474"></a>00474 
-<a name="l00475"></a>00475     <span class="keywordflow">if</span> (nflats < 1) {
-<a name="l00476"></a>00476         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, flat_tag);
-<a name="l00477"></a>00477         vimos_calib_exit(NULL);
-<a name="l00478"></a>00478     }
-<a name="l00479"></a>00479 
-<a name="l00480"></a>00480     cpl_msg_indent_less();
-<a name="l00481"></a>00481 
-<a name="l00482"></a>00482     <span class="keywordflow">if</span> (nflats > 1)
-<a name="l00483"></a>00483         cpl_msg_info(recipe, <span class="stringliteral">"Load %d flat field frames and sum them..."</span>,
-<a name="l00484"></a>00484                      nflats);
-<a name="l00485"></a>00485     <span class="keywordflow">else</span>
-<a name="l00486"></a>00486         cpl_msg_info(recipe, <span class="stringliteral">"Load flat field exposure..."</span>);
-<a name="l00487"></a>00487 
-<a name="l00488"></a>00488     cpl_msg_indent_more();
-<a name="l00489"></a>00489 
-<a name="l00490"></a>00490     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, flat_tag, 0);
-<a name="l00491"></a>00491 
-<a name="l00492"></a>00492     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00493"></a>00493         vimos_calib_exit(<span class="stringliteral">"Cannot load flat field frame header"</span>);
-<a name="l00494"></a>00494 
-<a name="l00495"></a>00495     alltime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l00496"></a>00496 
-<a name="l00497"></a>00497     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00498"></a>00498         vimos_calib_exit(<span class="stringliteral">"Missing keyword EXPTIME in flat field frame header"</span>);
-<a name="l00499"></a>00499 
-<a name="l00500"></a>00500     cpl_propertylist_delete(header);
-<a name="l00501"></a>00501 
-<a name="l00502"></a>00502     <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {
-<a name="l00503"></a>00503 
-<a name="l00504"></a>00504         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l00505"></a>00505 
-<a name="l00506"></a>00506         <span class="keywordflow">if</span> (header == NULL)
-<a name="l00507"></a>00507             vimos_calib_exit(<span class="stringliteral">"Cannot load flat field frame header"</span>);
-<a name="l00508"></a>00508 
-<a name="l00509"></a>00509         alltime += cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00512"></a>00512             vimos_calib_exit(<span class="stringliteral">"Missing keyword EXPTIME in flat field "</span>
-<a name="l00513"></a>00513                             <span class="stringliteral">"frame header"</span>);
-<a name="l00514"></a>00514 
-<a name="l00515"></a>00515         cpl_propertylist_delete(header);
-<a name="l00516"></a>00516 
-<a name="l00517"></a>00517     }
-<a name="l00518"></a>00518 
-<a name="l00519"></a>00519     master_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, flat_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00520"></a>00520 
-<a name="l00521"></a>00521     <span class="keywordflow">if</span> (master_flat == NULL)
-<a name="l00522"></a>00522         vimos_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);
-<a name="l00523"></a>00523 
-<a name="l00524"></a>00524     <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {
-<a name="l00525"></a>00525         flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00526"></a>00526         <span class="keywordflow">if</span> (flat) {
-<a name="l00527"></a>00527             cpl_image_add(master_flat, flat);
-<a name="l00528"></a>00528             cpl_image_delete(flat); flat = NULL;
-<a name="l00529"></a>00529         }
-<a name="l00530"></a>00530         <span class="keywordflow">else</span>
-<a name="l00531"></a>00531             vimos_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);
-<a name="l00532"></a>00532     }
-<a name="l00533"></a>00533 
-<a name="l00534"></a>00534 
-<a name="l00535"></a>00535     <span class="comment">/*</span>
-<a name="l00536"></a>00536 <span class="comment">     * Get some info from arc lamp header</span>
-<a name="l00537"></a>00537 <span class="comment">     */</span>
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l00540"></a>00540 
-<a name="l00541"></a>00541     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00542"></a>00542         vimos_calib_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);
-<a name="l00543"></a>00543 
-<a name="l00544"></a>00544     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00545"></a>00545     <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00546"></a>00546         vimos_calib_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);
-<a name="l00547"></a>00547     instrume = cpl_strdup(instrume);
-<a name="l00548"></a>00548 
-<a name="l00549"></a>00549     arctime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l00550"></a>00550 
-<a name="l00551"></a>00551     quadrant = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO OCS CON QUAD"</span>);
-<a name="l00552"></a>00552 
-<a name="l00553"></a>00553     <span class="keywordflow">switch</span> (quadrant) {
-<a name="l00554"></a>00554     <span class="keywordflow">case</span> 1:
-<a name="l00555"></a>00555         key_gris_name = <span class="stringliteral">"ESO INS GRIS1 NAME"</span>;
-<a name="l00556"></a>00556         key_gris_id = <span class="stringliteral">"ESO INS GRIS1 ID"</span>;
-<a name="l00557"></a>00557         key_filt_name = <span class="stringliteral">"ESO INS FILT1 NAME"</span>;
-<a name="l00558"></a>00558         key_filt_id = <span class="stringliteral">"ESO INS FILT1 ID"</span>;
-<a name="l00559"></a>00559         key_mask_id = <span class="stringliteral">"ESO INS MASK1 ID"</span>;
-<a name="l00560"></a>00560         <span class="keywordflow">break</span>;
-<a name="l00561"></a>00561     <span class="keywordflow">case</span> 2:
-<a name="l00562"></a>00562         key_gris_name = <span class="stringliteral">"ESO INS GRIS2 NAME"</span>;
-<a name="l00563"></a>00563         key_gris_id = <span class="stringliteral">"ESO INS GRIS2 ID"</span>;
-<a name="l00564"></a>00564         key_filt_name = <span class="stringliteral">"ESO INS FILT2 NAME"</span>;
-<a name="l00565"></a>00565         key_filt_id = <span class="stringliteral">"ESO INS FILT2 ID"</span>;
-<a name="l00566"></a>00566         key_mask_id = <span class="stringliteral">"ESO INS MASK2 ID"</span>;
-<a name="l00567"></a>00567         <span class="keywordflow">break</span>;
-<a name="l00568"></a>00568     <span class="keywordflow">case</span> 3:
-<a name="l00569"></a>00569         key_gris_name = <span class="stringliteral">"ESO INS GRIS3 NAME"</span>;
-<a name="l00570"></a>00570         key_gris_id = <span class="stringliteral">"ESO INS GRIS3 ID"</span>;
-<a name="l00571"></a>00571         key_filt_name = <span class="stringliteral">"ESO INS FILT3 NAME"</span>;
-<a name="l00572"></a>00572         key_filt_id = <span class="stringliteral">"ESO INS FILT3 ID"</span>;
-<a name="l00573"></a>00573         key_mask_id = <span class="stringliteral">"ESO INS MASK3 ID"</span>;
-<a name="l00574"></a>00574         <span class="keywordflow">break</span>;
-<a name="l00575"></a>00575     <span class="keywordflow">case</span> 4:
-<a name="l00576"></a>00576         key_gris_name = <span class="stringliteral">"ESO INS GRIS4 NAME"</span>;
-<a name="l00577"></a>00577         key_gris_id = <span class="stringliteral">"ESO INS GRIS4 ID"</span>;
-<a name="l00578"></a>00578         key_filt_name = <span class="stringliteral">"ESO INS FILT4 NAME"</span>;
-<a name="l00579"></a>00579         key_filt_id = <span class="stringliteral">"ESO INS FILT4 ID"</span>;
-<a name="l00580"></a>00580         key_mask_id = <span class="stringliteral">"ESO INS MASK4 ID"</span>;
-<a name="l00581"></a>00581         <span class="keywordflow">break</span>;
-<a name="l00582"></a>00582     }
-<a name="l00583"></a>00583 
-<a name="l00584"></a>00584     grism = cpl_strdup(cpl_propertylist_get_string(header, key_gris_name));
-<a name="l00585"></a>00585 
-<a name="l00586"></a>00586     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00587"></a>00587         vimos_calib_exit(<span class="stringliteral">"Missing keyword ESO INS GRISn NAME in arc lamp "</span>
-<a name="l00588"></a>00588                          <span class="stringliteral">"frame header"</span>);
-<a name="l00589"></a>00589 
-<a name="l00590"></a>00590     cpl_msg_info(recipe, <span class="stringliteral">"The grism is: %s"</span>, grism);
-<a name="l00591"></a>00591 
-<a name="l00592"></a>00592 <span class="comment">/*</span>
-<a name="l00593"></a>00593 <span class="comment">    if (!dfs_equal_keyword(frameset, key_gris_id))</span>
-<a name="l00594"></a>00594 <span class="comment">        vimos_calib_exit("Input frames are not from the same grism");</span>
-<a name="l00595"></a>00595 <span class="comment"></span>
-<a name="l00596"></a>00596 <span class="comment">    if (!dfs_equal_keyword(frameset, key_filt_id))</span>
-<a name="l00597"></a>00597 <span class="comment">        vimos_calib_exit("Input frames are not from the same filter");</span>
-<a name="l00598"></a>00598 <span class="comment">*/</span>
-<a name="l00599"></a>00599 
-<a name="l00600"></a>00600     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l00601"></a>00601 
-<a name="l00602"></a>00602     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00603"></a>00603         vimos_calib_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in arc lamp "</span>
-<a name="l00604"></a>00604                         <span class="stringliteral">"frame header"</span>);
-<a name="l00605"></a>00605 
-<a name="l00606"></a>00606     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l00607"></a>00607 
-<a name="l00608"></a>00608     cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);
-<a name="l00609"></a>00609 
-<a name="l00610"></a>00610     maskslits = <a class="code" href="group__moses.html#g3431a4557418ee0f8cd9beefd7153a98">mos_load_slits_vimos</a>(header);
-<a name="l00611"></a>00611 
-<a name="l00612"></a>00612     <span class="comment">/*</span>
-<a name="l00613"></a>00613 <span class="comment">     * Check if all slits have the same X offset: in such case, </span>
-<a name="l00614"></a>00614 <span class="comment">     * treat the observation as a long-slit one!</span>
-<a name="l00615"></a>00615 <span class="comment">     */</span>
-<a name="l00616"></a>00616 
-<a name="l00617"></a>00617     mxpos = cpl_table_get_column_median(maskslits, <span class="stringliteral">"ytop"</span>);
-<a name="l00618"></a>00618     xpos = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);
-<a name="l00619"></a>00619     nslits = cpl_table_get_nrow(maskslits);
-<a name="l00620"></a>00620 
-<a name="l00621"></a>00621     treat_as_lss = 1;
-<a name="l00622"></a>00622     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {
-<a name="l00623"></a>00623         <span class="keywordflow">if</span> (fabs(mxpos-xpos[i]) > 0.01) {
-<a name="l00624"></a>00624             treat_as_lss = 0;
-<a name="l00625"></a>00625             <span class="keywordflow">break</span>;
-<a name="l00626"></a>00626         }
-<a name="l00627"></a>00627     }
-<a name="l00628"></a>00628 
-<a name="l00629"></a>00629     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00630"></a>00630         cpl_msg_warning(recipe, <span class="stringliteral">"All MOS slits have the same offset: %.2f\n"</span>
-<a name="l00631"></a>00631                         <span class="stringliteral">"The long-slit data reduction strategy is applied!"</span>, 
-<a name="l00632"></a>00632                         mxpos);
-<a name="l00633"></a>00633         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00634"></a>00634     }
-<a name="l00635"></a>00635 
-<a name="l00636"></a>00636     <span class="keywordflow">if</span> (slit_ident == 0) {
-<a name="l00637"></a>00637         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l00638"></a>00638     }
-<a name="l00639"></a>00639 
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641     <span class="comment">/* Leave the header on for the next step... */</span>
-<a name="l00642"></a>00642 
-<a name="l00643"></a>00643 
-<a name="l00644"></a>00644     <span class="comment">/*</span>
-<a name="l00645"></a>00645 <span class="comment">     * Remove the master bias</span>
-<a name="l00646"></a>00646 <span class="comment">     */</span>
-<a name="l00647"></a>00647 
-<a name="l00648"></a>00648     <span class="keywordflow">if</span> (nbias) {
-<a name="l00649"></a>00649 
-<a name="l00650"></a>00650         <span class="comment">/*</span>
-<a name="l00651"></a>00651 <span class="comment">         * Set of raw BIASes in input, need to create master bias!</span>
-<a name="l00652"></a>00652 <span class="comment">         */</span>
-<a name="l00653"></a>00653 
-<a name="l00654"></a>00654         cpl_msg_info(recipe, <span class="stringliteral">"Generate the master from input raw biases..."</span>);
-<a name="l00655"></a>00655 
-<a name="l00656"></a>00656         <span class="keywordflow">if</span> (nbias > 1) {
-<a name="l00657"></a>00657 
-<a name="l00658"></a>00658             biases = cpl_imagelist_new();
-<a name="l00659"></a>00659 
-<a name="l00660"></a>00660             bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"BIAS"</span>, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00661"></a>00661     
-<a name="l00662"></a>00662             <span class="keywordflow">if</span> (bias == NULL)
-<a name="l00663"></a>00663                 vimos_calib_exit(<span class="stringliteral">"Cannot load bias frame"</span>);
-<a name="l00664"></a>00664 
-<a name="l00665"></a>00665             cpl_imagelist_set(biases, bias, 0); bias = NULL;
-<a name="l00666"></a>00666     
-<a name="l00667"></a>00667             <span class="keywordflow">for</span> (i = 1; i < nbias; i++) {
-<a name="l00668"></a>00668                 bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00669"></a>00669                 <span class="keywordflow">if</span> (bias) {
-<a name="l00670"></a>00670                     cpl_imagelist_set(biases, bias, i); bias = NULL;
-<a name="l00671"></a>00671                 }
-<a name="l00672"></a>00672                 <span class="keywordflow">else</span>
-<a name="l00673"></a>00673                     vimos_calib_exit(<span class="stringliteral">"Cannot load bias frame"</span>);
-<a name="l00674"></a>00674             }
-<a name="l00675"></a>00675     
-<a name="l00676"></a>00676             master_bias = cpl_imagelist_collapse_median_create(biases);
-<a name="l00677"></a>00677 
-<a name="l00678"></a>00678             cpl_imagelist_delete(biases);
-<a name="l00679"></a>00679         }
-<a name="l00680"></a>00680         <span class="keywordflow">else</span>
-<a name="l00681"></a>00681             master_bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"BIAS"</span>, 
-<a name="l00682"></a>00682                                          CPL_TYPE_FLOAT, 0, 1);
-<a name="l00683"></a>00683 
-<a name="l00684"></a>00684     }
-<a name="l00685"></a>00685     <span class="keywordflow">else</span> {
-<a name="l00686"></a>00686         master_bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, 
-<a name="l00687"></a>00687                                      CPL_TYPE_FLOAT, 0, 1);
-<a name="l00688"></a>00688         <span class="keywordflow">if</span> (master_bias == NULL)
-<a name="l00689"></a>00689             vimos_calib_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l00690"></a>00690     }
-<a name="l00691"></a>00691 
-<a name="l00692"></a>00692     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l00693"></a>00693 
-<a name="l00694"></a>00694     overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 1);
-<a name="l00695"></a>00695     cpl_propertylist_delete(header); header = NULL;
-<a name="l00696"></a>00696 
-<a name="l00697"></a>00697     <span class="keywordflow">if</span> (nbias) {
-<a name="l00698"></a>00698         <span class="keywordtype">int</span> xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, 0, NULL);
-<a name="l00699"></a>00699         <span class="keywordtype">int</span> ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, 0, NULL);
-<a name="l00700"></a>00700         <span class="keywordtype">int</span> xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, 0, NULL);
-<a name="l00701"></a>00701         <span class="keywordtype">int</span> yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, 0, NULL);
-<a name="l00702"></a>00702         dummy = cpl_image_extract(master_bias, xlow+1, ylow+1, xhig, yhig);
-<a name="l00703"></a>00703         cpl_image_delete(master_bias); master_bias = dummy;
-<a name="l00704"></a>00704 
-<a name="l00705"></a>00705         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, master_bias, <span class="stringliteral">"MASTER_BIAS"</span>,
-<a name="l00706"></a>00706                            NULL, parlist, recipe, version))
-<a name="l00707"></a>00707             vimos_calib_exit(NULL);
-<a name="l00708"></a>00708     }
-<a name="l00709"></a>00709 
-<a name="l00710"></a>00710     <span class="keywordflow">if</span> (nflats > 1) {
-<a name="l00711"></a>00711         multi_bias = cpl_image_multiply_scalar_create(master_bias, nflats);
-<a name="l00712"></a>00712         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(master_flat, multi_bias, overscans);
-<a name="l00713"></a>00713         cpl_image_delete(multi_bias);
-<a name="l00714"></a>00714     }
-<a name="l00715"></a>00715     <span class="keywordflow">else</span> {
-<a name="l00716"></a>00716         dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(master_flat, master_bias, overscans);
-<a name="l00717"></a>00717     }
-<a name="l00718"></a>00718     cpl_image_delete(master_flat);
-<a name="l00719"></a>00719     master_flat = dummy;
-<a name="l00720"></a>00720 
-<a name="l00721"></a>00721     <span class="keywordflow">if</span> (master_flat == NULL)
-<a name="l00722"></a>00722         vimos_calib_exit(<span class="stringliteral">"Cannot remove bias from flat field"</span>);
-<a name="l00723"></a>00723 
-<a name="l00724"></a>00724     cpl_msg_indent_less();
-<a name="l00725"></a>00725     cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);
-<a name="l00726"></a>00726     cpl_msg_indent_more();
-<a name="l00727"></a>00727 
-<a name="l00728"></a>00728     spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00729"></a>00729 
-<a name="l00730"></a>00730     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00731"></a>00731         vimos_calib_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);
-<a name="l00732"></a>00732 
-<a name="l00733"></a>00733     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l00734"></a>00734 
-<a name="l00735"></a>00735     dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(spectra, master_bias, overscans);
-<a name="l00736"></a>00736     cpl_table_delete(overscans); overscans = NULL;
-<a name="l00737"></a>00737     cpl_image_delete(master_bias); master_bias = NULL;
-<a name="l00738"></a>00738     cpl_image_delete(spectra); spectra = dummy;
-<a name="l00739"></a>00739 
-<a name="l00740"></a>00740     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00741"></a>00741         vimos_calib_exit(<span class="stringliteral">"Cannot remove bias from arc lamp exposure"</span>);
-<a name="l00742"></a>00742 
-<a name="l00743"></a>00743     cpl_msg_indent_less();
-<a name="l00744"></a>00744     cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);
-<a name="l00745"></a>00745     cpl_msg_indent_more();
-<a name="l00746"></a>00746 
-<a name="l00747"></a>00747     wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"LINE_CATALOG"</span>, 1);
-<a name="l00748"></a>00748 
-<a name="l00749"></a>00749     <span class="keywordflow">if</span> (wavelengths == NULL)
-<a name="l00750"></a>00750         vimos_calib_exit(<span class="stringliteral">"Cannot load line catalog"</span>);
-<a name="l00751"></a>00751 
-<a name="l00752"></a>00752 
-<a name="l00753"></a>00753     <span class="comment">/*</span>
-<a name="l00754"></a>00754 <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l00755"></a>00755 <span class="comment">     */</span>
-<a name="l00756"></a>00756 
-<a name="l00757"></a>00757     nlines = cpl_table_get_nrow(wavelengths);
-<a name="l00758"></a>00758 
-<a name="l00759"></a>00759     <span class="keywordflow">if</span> (nlines == 0)
-<a name="l00760"></a>00760         vimos_calib_exit(<span class="stringliteral">"Empty input line catalog"</span>);
-<a name="l00761"></a>00761 
-<a name="l00762"></a>00762     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l00763"></a>00763         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,
-<a name="l00764"></a>00764                       wcolumn);
-<a name="l00765"></a>00765         vimos_calib_exit(NULL);
-<a name="l00766"></a>00766     }
-<a name="l00767"></a>00767 
-<a name="l00768"></a>00768     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00769"></a>00769     
-<a name="l00770"></a>00770     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l00771"></a>00771         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l00772"></a>00772 
-<a name="l00773"></a>00773     cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l00774"></a>00774 
-<a name="l00775"></a>00775     lines = cpl_vector_wrap(nlines, line);
-<a name="l00776"></a>00776 
-<a name="l00777"></a>00777 
-<a name="l00778"></a>00778     <span class="comment">/*</span>
-<a name="l00779"></a>00779 <span class="comment">     * Rotate frames horizontally with red to the right</span>
-<a name="l00780"></a>00780 <span class="comment">     */</span>
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782     cpl_image_turn(spectra, rotate);
-<a name="l00783"></a>00783     cpl_image_turn(master_flat, rotate);
-<a name="l00784"></a>00784 
-<a name="l00785"></a>00785     ccd_xsize = nx = cpl_image_get_size_x(spectra);      <span class="comment">// added...</span>
-<a name="l00786"></a>00786     ccd_ysize = ny = cpl_image_get_size_y(spectra);
-<a name="l00787"></a>00787 
-<a name="l00788"></a>00788     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00789"></a>00789 
-<a name="l00790"></a>00790         <span class="comment">/*</span>
-<a name="l00791"></a>00791 <span class="comment">         * In the case of LSS data, find first a "one slit"</span>
-<a name="l00792"></a>00792 <span class="comment">         * solution. This will be later on split into many-slits</span>
-<a name="l00793"></a>00793 <span class="comment">         * solutions. This is done for greater accuracy.</span>
-<a name="l00794"></a>00794 <span class="comment">         */</span>
-<a name="l00795"></a>00795 
-<a name="l00796"></a>00796         cpl_msg_indent_less();
-<a name="l00797"></a>00797         cpl_msg_info(recipe, <span class="stringliteral">"Perform wavelength calibration..."</span>);
-<a name="l00798"></a>00798         cpl_msg_indent_more();
-<a name="l00799"></a>00799 
-<a name="l00800"></a>00800         wavemap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l00801"></a>00801         <span class="keywordflow">if</span> (check)
-<a name="l00802"></a>00802             residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l00803"></a>00803 
-<a name="l00804"></a>00804         fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00805"></a>00805         fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l00806"></a>00806         idscoeff = cpl_table_new(ny);
-<a name="l00807"></a>00807         refmask  = cpl_mask_new(nx, ny);
-<a name="l00808"></a>00808 
-<a name="l00809"></a>00809     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(spectra))
-<a name="l00810"></a>00810         vimos_calib_exit(<span class="stringliteral">"Cannot process saturation"</span>);
-<a name="l00811"></a>00811 
-<a name="l00812"></a>00812     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(spectra))
-<a name="l00813"></a>00813         vimos_calib_exit(<span class="stringliteral">"Cannot subtract the background"</span>);
-<a name="l00814"></a>00814 
-<a name="l00815"></a>00815         rectified = <a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion,
-<a name="l00816"></a>00816                                                    peakdetection, wradius,
-<a name="l00817"></a>00817                                                    wdegree, wreject, reference,
-<a name="l00818"></a>00818                                                    &startwavelength, 
-<a name="l00819"></a>00819                                                    &endwavelength, fitlines, 
-<a name="l00820"></a>00820                                                    fiterror, idscoeff, wavemap,
-<a name="l00821"></a>00821                                                    residual, NULL, refmask);
-<a name="l00822"></a>00822 
-<a name="l00823"></a>00823         <span class="keywordflow">if</span> (rectified == NULL)
-<a name="l00824"></a>00824             vimos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l00825"></a>00825 
-<a name="l00826"></a>00826         <span class="keywordflow">if</span> (!cpl_table_has_valid(idscoeff, <span class="stringliteral">"c0"</span>))
-<a name="l00827"></a>00827             vimos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l00828"></a>00828 
-<a name="l00829"></a>00829         <span class="comment">/*</span>
-<a name="l00830"></a>00830 <span class="comment">         * This is necessary to move on to a many-slits solution</span>
-<a name="l00831"></a>00831 <span class="comment">         */</span>
-<a name="l00832"></a>00832 
-<a name="l00833"></a>00833         <a class="code" href="group__moses.html#gaabac93f2fab16b6c268e5ab494a7238">mos_refmask_find_gaps</a>(refmask, master_flat, 1000.);
-<a name="l00834"></a>00834 
-<a name="l00835"></a>00835         <span class="keywordflow">if</span> (wmode) {
-<a name="l00836"></a>00836             cpl_image_delete(rectified); rectified = NULL;
-<a name="l00837"></a>00837             cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l00838"></a>00838             <a class="code" href="group__moses.html#gd9bee279f3122532986a3bc453e1c6b3">mos_interpolate_wavecalib</a>(idscoeff, wavemap, wmode);
-<a name="l00839"></a>00839             wavemap = <a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(idscoeff, nx, reference,
-<a name="l00840"></a>00840                                        startwavelength, endwavelength);
-<a name="l00841"></a>00841             rectified = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(spectra, reference,
-<a name="l00842"></a>00842                                                    startwavelength, 
-<a name="l00843"></a>00843                                                    endwavelength, dispersion, 
-<a name="l00844"></a>00844                                                    idscoeff, 0);
-<a name="l00845"></a>00845         }
-<a name="l00846"></a>00846 
-<a name="l00847"></a>00847         cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;
-<a name="l00848"></a>00848         cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l00849"></a>00849         cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851         <span class="keywordflow">for</span> (i = 0; i < ny; i++)
-<a name="l00852"></a>00852             <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))
-<a name="l00853"></a>00853                 cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);
-<a name="l00854"></a>00854 
-<a name="l00855"></a>00855         slit_ident = 0;
-<a name="l00856"></a>00856         idscoeff_lss = idscoeff;
-<a name="l00857"></a>00857 
-<a name="l00858"></a>00858     }
-<a name="l00859"></a>00859     <span class="keywordflow">else</span> {
-<a name="l00860"></a>00860 
-<a name="l00861"></a>00861         <span class="comment">/*</span>
-<a name="l00862"></a>00862 <span class="comment">         * Here the generic MOS calibration is carried out.</span>
-<a name="l00863"></a>00863 <span class="comment">         */</span>
-<a name="l00864"></a>00864 
-<a name="l00865"></a>00865         <span class="comment">/*</span>
-<a name="l00866"></a>00866 <span class="comment">         * Detecting spectra on the CCD</span>
-<a name="l00867"></a>00867 <span class="comment">         */</span>
-<a name="l00868"></a>00868 
-<a name="l00869"></a>00869         cpl_msg_indent_less();
-<a name="l00870"></a>00870         cpl_msg_info(recipe, <span class="stringliteral">"Detecting spectra on CCD..."</span>);
-<a name="l00871"></a>00871         cpl_msg_indent_more();
-<a name="l00872"></a>00872 
-<a name="l00873"></a>00873         ccd_xsize = nx = cpl_image_get_size_x(spectra);
-<a name="l00874"></a>00874         ccd_ysize = ny = cpl_image_get_size_y(spectra);
-<a name="l00875"></a>00875 
-<a name="l00876"></a>00876         refmask = cpl_mask_new(nx, ny);
-<a name="l00877"></a>00877 
-<a name="l00878"></a>00878         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g4d2eac0de6bdead5ccdd45c5ca2ae69a">mos_saturation_process</a>(spectra))
-<a name="l00879"></a>00879         vimos_calib_exit(<span class="stringliteral">"Cannot process saturation"</span>);
-<a name="l00880"></a>00880 
-<a name="l00881"></a>00881         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g7f9a03e1229af2423d82b5f08e674de8">mos_subtract_background</a>(spectra))
-<a name="l00882"></a>00882         vimos_calib_exit(<span class="stringliteral">"Cannot subtract the background"</span>);
-<a name="l00883"></a>00883 
-<a name="l00884"></a>00884         checkwave = <a class="code" href="group__moses.html#gb996d19c52ec78faa69d1b48127e3e0c">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion, 
-<a name="l00885"></a>00885                                                    peakdetection, wradius, 
-<a name="l00886"></a>00886                                                    wdegree, wreject, reference,
-<a name="l00887"></a>00887                                                    &startwavelength, 
-<a name="l00888"></a>00888                                                    &endwavelength,
-<a name="l00889"></a>00889                                                    NULL, NULL, NULL, NULL, 
-<a name="l00890"></a>00890                                                    NULL, NULL, refmask);
-<a name="l00891"></a>00891 
-<a name="l00892"></a>00892         <span class="keywordflow">if</span> (checkwave == NULL)
-<a name="l00893"></a>00893             vimos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l00894"></a>00894 
-<a name="l00895"></a>00895         <span class="comment">/*</span>
-<a name="l00896"></a>00896 <span class="comment">         * Save check image to disk</span>
-<a name="l00897"></a>00897 <span class="comment">         */</span>
-<a name="l00898"></a>00898 
-<a name="l00899"></a>00899         header = cpl_propertylist_new();
-<a name="l00900"></a>00900         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l00901"></a>00901         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l00902"></a>00902         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l00903"></a>00903                                        startwavelength + dispersion/2);
-<a name="l00904"></a>00904         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l00905"></a>00905         <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l00906"></a>00906 <span class="comment">        cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l00907"></a>00907         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l00908"></a>00908         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l00909"></a>00909         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l00910"></a>00910         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l00911"></a>00911         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l00912"></a>00912         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l00913"></a>00913 
-<a name="l00914"></a>00914         <span class="keywordflow">if</span> (check) {
-<a name="l00915"></a>00915             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, checkwave, spectra_detection_tag, 
-<a name="l00916"></a>00916                                header, parlist, recipe, version))
-<a name="l00917"></a>00917                 vimos_calib_exit(NULL);
-<a name="l00918"></a>00918         }
-<a name="l00919"></a>00919 
-<a name="l00920"></a>00920         cpl_image_delete(checkwave); checkwave = NULL;
-<a name="l00921"></a>00921         cpl_propertylist_delete(header); header = NULL;
-<a name="l00922"></a>00922 
-<a name="l00923"></a>00923     }
-<a name="l00924"></a>00924 
-<a name="l00925"></a>00925     cpl_msg_info(recipe, <span class="stringliteral">"Locate slits at reference wavelength on CCD..."</span>);
-<a name="l00926"></a>00926     slits = <a class="code" href="group__moses.html#g884857a604857727d2fc0d293b678209">mos_locate_spectra</a>(refmask);
-<a name="l00927"></a>00927 
-<a name="l00928"></a>00928     <span class="keywordflow">if</span> (!slits) {
-<a name="l00929"></a>00929         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l00930"></a>00930         vimos_calib_exit(<span class="stringliteral">"No slits could be detected!"</span>);
-<a name="l00931"></a>00931     }
-<a name="l00932"></a>00932 
-<a name="l00933"></a>00933     refimage = cpl_image_new_from_mask(refmask);
-<a name="l00934"></a>00934     cpl_mask_delete(refmask); refmask = NULL;
-<a name="l00935"></a>00935 
-<a name="l00936"></a>00936     <span class="keywordflow">if</span> (check) {
-<a name="l00937"></a>00937         save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l00938"></a>00938         cpl_image_turn(refimage, rotate_back);
-<a name="l00939"></a>00939         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, refimage, slit_map_tag, NULL,
-<a name="l00940"></a>00940                            parlist, recipe, version))
-<a name="l00941"></a>00941             vimos_calib_exit(NULL);
-<a name="l00942"></a>00942         cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l00943"></a>00943     }
-<a name="l00944"></a>00944 
-<a name="l00945"></a>00945     cpl_image_delete(refimage); refimage = NULL;
-<a name="l00946"></a>00946 
-<a name="l00947"></a>00947     <span class="keywordflow">if</span> (slit_ident) {
-<a name="l00948"></a>00948 
-<a name="l00949"></a>00949         <span class="comment">/*</span>
-<a name="l00950"></a>00950 <span class="comment">         * Attempt slit identification: this recipe may continue even</span>
-<a name="l00951"></a>00951 <span class="comment">         * in case of failed identification (i.e., the position table is </span>
-<a name="l00952"></a>00952 <span class="comment">         * not produced, but an error is not set). In case of failure,</span>
-<a name="l00953"></a>00953 <span class="comment">         * the spectra would be still extracted, even if they would not</span>
-<a name="l00954"></a>00954 <span class="comment">         * be associated to slits on the mask.</span>
-<a name="l00955"></a>00955 <span class="comment">         * </span>
-<a name="l00956"></a>00956 <span class="comment">         * The reason for making the slit identification an user option </span>
-<a name="l00957"></a>00957 <span class="comment">         * (via the parameter slit_ident) is to offer the possibility </span>
-<a name="l00958"></a>00958 <span class="comment">         * to avoid identifications that are only apparently successful, </span>
-<a name="l00959"></a>00959 <span class="comment">         * as it would happen in the case of an incorrect slit description </span>
-<a name="l00960"></a>00960 <span class="comment">         * in the data header.</span>
-<a name="l00961"></a>00961 <span class="comment">         */</span>
-<a name="l00962"></a>00962 
-<a name="l00963"></a>00963         cpl_msg_indent_less();
-<a name="l00964"></a>00964         cpl_msg_info(recipe, <span class="stringliteral">"Attempt slit identification (optional)..."</span>);
-<a name="l00965"></a>00965         cpl_msg_indent_more();
-<a name="l00966"></a>00966 
-<a name="l00967"></a>00967         <a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a>(maskslits, -rotate, 0, 0);
-<a name="l00968"></a>00968         positions = <a class="code" href="group__moses.html#g8c6d40d45c078e8bb32dc97f4bda9f98">mos_identify_slits</a>(slits, maskslits, NULL);
-<a name="l00969"></a>00969 
-<a name="l00970"></a>00970         <span class="keywordflow">if</span> (positions) {
-<a name="l00971"></a>00971             cpl_table_delete(slits);
-<a name="l00972"></a>00972             slits = positions;
-<a name="l00973"></a>00973 
-<a name="l00974"></a>00974             <span class="comment">/*</span>
-<a name="l00975"></a>00975 <span class="comment">             * Eliminate slits which are _entirely_ outside the CCD</span>
-<a name="l00976"></a>00976 <span class="comment">             */</span>
-<a name="l00977"></a>00977 
-<a name="l00978"></a>00978             cpl_table_and_selected_double(slits, 
-<a name="l00979"></a>00979                                           <span class="stringliteral">"ybottom"</span>, CPL_GREATER_THAN, ny-1);
-<a name="l00980"></a>00980             cpl_table_or_selected_double(slits, 
-<a name="l00981"></a>00981                                           <span class="stringliteral">"ytop"</span>, CPL_LESS_THAN, 0);
-<a name="l00982"></a>00982             cpl_table_erase_selected(slits);
-<a name="l00983"></a>00983 
-<a name="l00984"></a>00984             nslits = cpl_table_get_nrow(slits);
-<a name="l00985"></a>00985 
-<a name="l00986"></a>00986             <span class="keywordflow">if</span> (nslits == 0)
-<a name="l00987"></a>00987                 vimos_calib_exit(<span class="stringliteral">"No slits found on the CCD"</span>);
-<a name="l00988"></a>00988 
-<a name="l00989"></a>00989             cpl_msg_info(recipe, <span class="stringliteral">"%d slits are entirely or partially "</span>
-<a name="l00990"></a>00990                          <span class="stringliteral">"contained in CCD"</span>, nslits);
-<a name="l00991"></a>00991 
-<a name="l00992"></a>00992         }
-<a name="l00993"></a>00993         <span class="keywordflow">else</span> {
-<a name="l00994"></a>00994             slit_ident = 0;
-<a name="l00995"></a>00995             cpl_msg_info(recipe, <span class="stringliteral">"Global distortion model cannot be computed"</span>);
-<a name="l00996"></a>00996             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {
-<a name="l00997"></a>00997                 vimos_calib_exit(NULL);
-<a name="l00998"></a>00998             }
-<a name="l00999"></a>00999         }
-<a name="l01000"></a>01000     }
-<a name="l01001"></a>01001 
-<a name="l01002"></a>01002 
-<a name="l01003"></a>01003     <span class="comment">/*</span>
-<a name="l01004"></a>01004 <span class="comment">     * Determination of spectral curvature</span>
-<a name="l01005"></a>01005 <span class="comment">     */</span>
-<a name="l01006"></a>01006 
-<a name="l01007"></a>01007     cpl_msg_indent_less();
-<a name="l01008"></a>01008     cpl_msg_info(recipe, <span class="stringliteral">"Determining spectral curvature..."</span>);
-<a name="l01009"></a>01009     cpl_msg_indent_more();
-<a name="l01010"></a>01010 
-<a name="l01011"></a>01011     cpl_msg_info(recipe, <span class="stringliteral">"Tracing master flat field spectra edges..."</span>);
-<a name="l01012"></a>01012     traces = <a class="code" href="group__moses.html#g168f6aecd869c24634fa9f6690da0b02">mos_trace_flat</a>(master_flat, slits, reference, 
-<a name="l01013"></a>01013                             startwavelength, endwavelength, dispersion);
-<a name="l01014"></a>01014 
-<a name="l01015"></a>01015     <span class="keywordflow">if</span> (!traces)
-<a name="l01016"></a>01016         vimos_calib_exit(<span class="stringliteral">"Tracing failure"</span>);
-<a name="l01017"></a>01017 
-<a name="l01018"></a>01018     cpl_msg_info(recipe, <span class="stringliteral">"Fitting flat field spectra edges..."</span>);
-<a name="l01019"></a>01019     polytraces = <a class="code" href="group__moses.html#gacdfcf9b570d851cc9935b56f6e86414">mos_poly_trace</a>(slits, traces, cdegree);
-<a name="l01020"></a>01020 
-<a name="l01021"></a>01021     <span class="keywordflow">if</span> (!polytraces)
-<a name="l01022"></a>01022         vimos_calib_exit(<span class="stringliteral">"Trace fitting failure"</span>);
-<a name="l01023"></a>01023 
-<a name="l01024"></a>01024     <span class="keywordflow">if</span> (cmode) {
-<a name="l01025"></a>01025         cpl_msg_info(recipe, <span class="stringliteral">"Computing global spectral curvature model..."</span>);
-<a name="l01026"></a>01026         <a class="code" href="group__moses.html#g7f34d564b07538f21cba7ccddc9738c5">mos_global_trace</a>(slits, polytraces, cmode);
-<a name="l01027"></a>01027     }
-<a name="l01028"></a>01028 
-<a name="l01029"></a>01029     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, traces, curv_traces_tag, NULL, parlist,
-<a name="l01030"></a>01030                        recipe, version))
-<a name="l01031"></a>01031         vimos_calib_exit(NULL);
-<a name="l01032"></a>01032 
-<a name="l01033"></a>01033     cpl_table_delete(traces); traces = NULL;
-<a name="l01034"></a>01034 
-<a name="l01035"></a>01035     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01036"></a>01036     spatial = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, reference, 
-<a name="l01037"></a>01037                                       startwavelength, endwavelength, 
-<a name="l01038"></a>01038                                       dispersion, 0, coordinate);
-<a name="l01039"></a>01039 
-<a name="l01040"></a>01040 <span class="comment">//    if (!slit_ident) {</span>
-<a name="l01041"></a>01041 <span class="comment">//        cpl_image_delete(spectra); spectra = NULL;</span>
-<a name="l01042"></a>01042 <span class="comment">//    }</span>
-<a name="l01043"></a>01043 
-<a name="l01044"></a>01044     <span class="comment">/*</span>
-<a name="l01045"></a>01045 <span class="comment">     * Flat field normalisation is done directly on the master flat</span>
-<a name="l01046"></a>01046 <span class="comment">     * field (without spatial rectification first). The spectral</span>
-<a name="l01047"></a>01047 <span class="comment">     * curvature model may be provided in input, in future releases.</span>
-<a name="l01048"></a>01048 <span class="comment">     */</span>
-<a name="l01049"></a>01049 
-<a name="l01050"></a>01050     cpl_msg_indent_less();
-<a name="l01051"></a>01051     cpl_msg_info(recipe, <span class="stringliteral">"Perform flat field normalisation..."</span>);
-<a name="l01052"></a>01052     cpl_msg_indent_more();
-<a name="l01053"></a>01053 
-<a name="l01054"></a>01054     norm_flat = cpl_image_duplicate(master_flat);
-<a name="l01055"></a>01055 
-<a name="l01056"></a>01056     smo_flat = <a class="code" href="group__moses.html#g5df3afdc0936c59274ef96866e7c05ff">mos_normalise_flat</a>(norm_flat, coordinate, slits, polytraces, 
-<a name="l01057"></a>01057                                   reference, startwavelength, endwavelength,
-<a name="l01058"></a>01058                                   dispersion, dradius, ddegree);
-<a name="l01059"></a>01059 
-<a name="l01060"></a>01060     cpl_image_delete(smo_flat); smo_flat = NULL;  <span class="comment">/* It may be a product */</span>
-<a name="l01061"></a>01061  
-<a name="l01062"></a>01062     save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, flat_tag, 0);
-<a name="l01063"></a>01063     cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, nflats);
-<a name="l01064"></a>01064 
-<a name="l01065"></a>01065     cpl_image_turn(norm_flat, rotate_back);
-<a name="l01066"></a>01066 
-<a name="l01067"></a>01067     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, norm_flat, master_norm_flat_tag,
-<a name="l01068"></a>01068                        save_header, parlist, recipe, version))
-<a name="l01069"></a>01069         vimos_calib_exit(NULL);
-<a name="l01070"></a>01070 
-<a name="l01071"></a>01071     cpl_image_delete(norm_flat); norm_flat = NULL;
-<a name="l01072"></a>01072 
-<a name="l01073"></a>01073 
-<a name="l01074"></a>01074     <span class="comment">/*</span>
-<a name="l01075"></a>01075 <span class="comment">     * QC parameters for flat</span>
-<a name="l01076"></a>01076 <span class="comment">     */</span>
-<a name="l01077"></a>01077 
-<a name="l01078"></a>01078     <span class="keywordflow">if</span> (qc) {
-<a name="l01079"></a>01079         <span class="keywordtype">double</span>     scale;
-<a name="l01080"></a>01080         <span class="keywordtype">double</span>     slit_width;
-<a name="l01081"></a>01081         <span class="keywordtype">double</span>     flux, flux_err;
-<a name="l01082"></a>01082         <span class="keywordtype">int</span>        cslit = <a class="code" href="group__moses.html#gc32b3fba956da20bd20530372b1b28d1">mos_slit_closest_to_center</a>(slits, nx, ny);
-<a name="l01083"></a>01083 
-<a name="l01084"></a>01084 
-<a name="l01085"></a>01085         <span class="comment">/*</span>
-<a name="l01086"></a>01086 <span class="comment">         * Refresh base property list, because previous saving </span>
-<a name="l01087"></a>01087 <span class="comment">         * modified it - e.g., the keyword ARCFILE is missing</span>
-<a name="l01088"></a>01088 <span class="comment">         */</span>
-<a name="l01089"></a>01089 
-<a name="l01090"></a>01090         cpl_propertylist_delete(save_header);
-<a name="l01091"></a>01091         save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, flat_tag, 0);
-<a name="l01092"></a>01092         cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, nflats);
-<a name="l01093"></a>01093 
-<a name="l01094"></a>01094 
-<a name="l01095"></a>01095         <span class="comment">/*</span>
-<a name="l01096"></a>01096 <span class="comment">         * QC1 group header</span>
-<a name="l01097"></a>01097 <span class="comment">         */</span>
-<a name="l01098"></a>01098 
-<a name="l01099"></a>01099         <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(save_header, <span class="stringliteral">"1.1"</span>, instrume);
-<a name="l01100"></a>01100 
-<a name="l01101"></a>01101         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, master_norm_flat_tag,
-<a name="l01102"></a>01102                                  <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l01103"></a>01103             vimos_calib_exit(<span class="stringliteral">"Cannot write product category to QC log file"</span>);
-<a name="l01104"></a>01104 
-<a name="l01105"></a>01105         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(save_header, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l01106"></a>01106                                    <span class="stringliteral">"Archive File Name"</span>, instrume))
-<a name="l01107"></a>01107             vimos_calib_exit(<span class="stringliteral">"Missing keyword ARCFILE in flatfield frame"</span>);
-<a name="l01108"></a>01108 
-<a name="l01109"></a>01109         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(save_header, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l01110"></a>01110                                    <span class="stringliteral">"Template signature ID"</span>, instrume))
-<a name="l01111"></a>01111             vimos_calib_exit(<span class="stringliteral">"Missing keyword TPL ID in flatfield frame"</span>);
-<a name="l01112"></a>01112 
-<a name="l01113"></a>01113         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(save_header, <span class="stringliteral">"ESO OCS CON QUAD"</span>, NULL,
-<a name="l01114"></a>01114                                    <span class="stringliteral">"Quadrant"</span>, instrume))
-<a name="l01115"></a>01115             vimos_calib_exit(<span class="stringliteral">"Missing keyword OCS CON QUAD in flatfield frame"</span>);
-<a name="l01116"></a>01116 
-<a name="l01117"></a>01117         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(save_header, key_filt_name, NULL,
-<a name="l01118"></a>01118                                    <span class="stringliteral">"Filter"</span>, instrume)) {
-<a name="l01119"></a>01119             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in flatfield frame"</span>, 
-<a name="l01120"></a>01120                           key_filt_name);
-<a name="l01121"></a>01121             vimos_calib_exit(NULL);
-<a name="l01122"></a>01122         }
-<a name="l01123"></a>01123 
-<a name="l01124"></a>01124         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(save_header, key_gris_name, NULL,
-<a name="l01125"></a>01125                                    <span class="stringliteral">"Grism"</span>, instrume)) {
-<a name="l01126"></a>01126             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in flatfield frame"</span>, 
-<a name="l01127"></a>01127                           key_gris_name);
-<a name="l01128"></a>01128             vimos_calib_exit(NULL);
-<a name="l01129"></a>01129         }
-<a name="l01130"></a>01130 
-<a name="l01131"></a>01131         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(save_header, key_mask_id, NULL,
-<a name="l01132"></a>01132                                    <span class="stringliteral">"Mask"</span>, instrume)) {
-<a name="l01133"></a>01133             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in flatfield frame"</span>, 
-<a name="l01134"></a>01134                           key_mask_id);
-<a name="l01135"></a>01135             vimos_calib_exit(NULL);
-<a name="l01136"></a>01136         }
-<a name="l01137"></a>01137 
-<a name="l01138"></a>01138         cpl_propertylist_update_double(save_header, 
-<a name="l01139"></a>01139                                        <span class="stringliteral">"ESO PRO WLEN CEN"</span>, reference);
-<a name="l01140"></a>01140 
-<a name="l01141"></a>01141         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(save_header, <span class="stringliteral">"ESO PRO WLEN CEN"</span>, <span class="stringliteral">"Angstrom"</span>,
-<a name="l01142"></a>01142                                    <span class="stringliteral">"Reference wavelength"</span>, instrume))
-<a name="l01143"></a>01143             vimos_calib_exit(<span class="stringliteral">"Missing keyword PRO WLEN CEN in flatfield frame"</span>);
-<a name="l01144"></a>01144 
-<a name="l01145"></a>01145 <span class="comment">/* Unused in the old VIMOS pipeline:</span>
-<a name="l01146"></a>01146 <span class="comment"></span>
-<a name="l01147"></a>01147 <span class="comment">        if (fors_qc_keyword_to_paf(save_header, "ESO DPR TYPE", NULL,</span>
-<a name="l01148"></a>01148 <span class="comment">                                   "DPR type", instrume))</span>
-<a name="l01149"></a>01149 <span class="comment">            vimos_calib_exit("Missing keyword DPR TYPE in flat field frame");</span>
-<a name="l01150"></a>01150 <span class="comment"></span>
-<a name="l01151"></a>01151 <span class="comment">        if (fors_qc_keyword_to_paf(save_header, key_gris_id, NULL,</span>
-<a name="l01152"></a>01152 <span class="comment">                                  "Grism identifier", instrume)) {</span>
-<a name="l01153"></a>01153 <span class="comment">            cpl_msg_error(recipe, "Missing keyword %s in arc "</span>
-<a name="l01154"></a>01154 <span class="comment">                            "lamp header", key_gris_id);</span>
-<a name="l01155"></a>01155 <span class="comment">            vimos_calib_exit(NULL);</span>
-<a name="l01156"></a>01156 <span class="comment">        }</span>
-<a name="l01157"></a>01157 <span class="comment"></span>
-<a name="l01158"></a>01158 <span class="comment">        if (cpl_propertylist_has(save_header, key_filt_name))</span>
-<a name="l01159"></a>01159 <span class="comment">            fors_qc_keyword_to_paf(save_header, key_filt_name, NULL,</span>
-<a name="l01160"></a>01160 <span class="comment">                                  "Filter name", instrume);</span>
-<a name="l01161"></a>01161 <span class="comment"></span>
-<a name="l01162"></a>01162 <span class="comment">        if (fors_qc_keyword_to_paf(save_header, "ESO DET CHIP1 ID", NULL,</span>
-<a name="l01163"></a>01163 <span class="comment">                                  "Chip identifier", instrume))</span>
-<a name="l01164"></a>01164 <span class="comment">            vimos_calib_exit("Missing keyword DET CHIP1 ID in arc "</span>
-<a name="l01165"></a>01165 <span class="comment">                            "lamp header");</span>
-<a name="l01166"></a>01166 <span class="comment">*/</span>
-<a name="l01167"></a>01167 
-<a name="l01168"></a>01168         pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(master_norm_flat_tag);
-<a name="l01169"></a>01169         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l01170"></a>01170                                 <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l01171"></a>01171             vimos_calib_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);
-<a name="l01172"></a>01172         cpl_free(pipefile); pipefile = NULL;
-<a name="l01173"></a>01173 
-<a name="l01174"></a>01174         scale = cpl_propertylist_get_double(save_header, <span class="stringliteral">"ESO TEL FOCU SCALE"</span>);
-<a name="l01175"></a>01175 
-<a name="l01176"></a>01176         <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01177"></a>01177             cpl_error_reset();
-<a name="l01178"></a>01178             scale = 1.718;
-<a name="l01179"></a>01179             cpl_msg_warning(recipe, <span class="stringliteral">"Cannot read keyword TEL FOCU SCALE "</span>
-<a name="l01180"></a>01180                             <span class="stringliteral">"(defaulted to %f arcsec/mm)"</span>, scale);
-<a name="l01181"></a>01181         }
-<a name="l01182"></a>01182 
-<a name="l01183"></a>01183         <span class="comment">/*</span>
-<a name="l01184"></a>01184 <span class="comment">         * QC1 parameters</span>
-<a name="l01185"></a>01185 <span class="comment">         */</span>
-<a name="l01186"></a>01186 
-<a name="l01187"></a>01187         keyname = <span class="stringliteral">"QC.MOS.SLIT.WIDTH"</span>;
-<a name="l01188"></a>01188 
-<a name="l01189"></a>01189         slit_width = scale * cpl_table_get(slits, <span class="stringliteral">"ywidth"</span>, cslit, NULL);
-<a name="l01190"></a>01190 
-<a name="l01191"></a>01191         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(save_header, slit_width, keyname, <span class="stringliteral">"arcsec"</span>,
-<a name="l01192"></a>01192                                     <span class="stringliteral">"Width of slit closest to center"</span>,
-<a name="l01193"></a>01193                                     instrume)) {
-<a name="l01194"></a>01194             vimos_calib_exit(<span class="stringliteral">"Cannot write slit width to QC log file"</span>);
-<a name="l01195"></a>01195         }
-<a name="l01196"></a>01196 
-<a name="l01197"></a>01197         <a class="code" href="group__moses.html#gbff2b46bad7584f819ae28fdd8c85343">mos_extract_flux</a>(master_flat, slits, 2, gain, &flux, &flux_err);
-<a name="l01198"></a>01198 
-<a name="l01199"></a>01199         flux_err /= alltime; <span class="comment">// The master is simply the sum of all flats</span>
-<a name="l01200"></a>01200         flux     /= alltime;
-<a name="l01201"></a>01201 
-<a name="l01202"></a>01202         cpl_msg_info(recipe, 
-<a name="l01203"></a>01203                      <span class="stringliteral">"Flux at wavelength %.2f: %.2f +/- %.2f ADU/mm^2/s\n"</span>,
-<a name="l01204"></a>01204                      reference, flux, flux_err);
-<a name="l01205"></a>01205 
-<a name="l01206"></a>01206         keyname = <span class="stringliteral">"QC.MOS.FLAT.FLUX"</span>;
-<a name="l01207"></a>01207 
-<a name="l01208"></a>01208         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(save_header, flux, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,
-<a name="l01209"></a>01209                                     <span class="stringliteral">"Flux at reference wavelength"</span>,
-<a name="l01210"></a>01210                                     instrume)) {
-<a name="l01211"></a>01211             vimos_calib_exit(<span class="stringliteral">"Cannot write QC.MOS.FLAT.FLUX to QC log file"</span>);
-<a name="l01212"></a>01212         }
-<a name="l01213"></a>01213 
-<a name="l01214"></a>01214         keyname = <span class="stringliteral">"QC.MOS.FLAT.FLUXERR"</span>;
-<a name="l01215"></a>01215 
-<a name="l01216"></a>01216         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(save_header, flux_err, keyname, 
-<a name="l01217"></a>01217                                     <span class="stringliteral">"ADU/mm^2/s"</span>,
-<a name="l01218"></a>01218                                     <span class="stringliteral">"Error on flux at reference wavelength"</span>,
-<a name="l01219"></a>01219                                     instrume)) {
-<a name="l01220"></a>01220             vimos_calib_exit(<span class="stringliteral">"Cannot write QC.MOS.FLAT.FLUXERR to QC log file"</span>);
-<a name="l01221"></a>01221         }
-<a name="l01222"></a>01222 
-<a name="l01223"></a>01223         <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l01224"></a>01224 
-<a name="l01225"></a>01225     }
-<a name="l01226"></a>01226 
-<a name="l01227"></a>01227     cpl_image_turn(master_flat, rotate_back);
-<a name="l01228"></a>01228     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, master_flat, master_screen_flat_tag,
-<a name="l01229"></a>01229                        save_header, parlist, recipe, version))
-<a name="l01230"></a>01230         vimos_calib_exit(NULL);
-<a name="l01231"></a>01231 
-<a name="l01232"></a>01232     cpl_image_delete(master_flat); master_flat = NULL;
-<a name="l01233"></a>01233 
-<a name="l01234"></a>01234     cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01235"></a>01235 
-<a name="l01236"></a>01236 
-<a name="l01237"></a>01237     <span class="comment">/*</span>
-<a name="l01238"></a>01238 <span class="comment">     * Final wavelength calibration of spectra having their curvature</span>
-<a name="l01239"></a>01239 <span class="comment">     * removed</span>
-<a name="l01240"></a>01240 <span class="comment">     */</span>
-<a name="l01241"></a>01241 
-<a name="l01242"></a>01242     cpl_msg_indent_less();
-<a name="l01243"></a>01243     cpl_msg_info(recipe, <span class="stringliteral">"Perform final wavelength calibration..."</span>);
-<a name="l01244"></a>01244     cpl_msg_indent_more();
-<a name="l01245"></a>01245 
-<a name="l01246"></a>01246     nx = cpl_image_get_size_x(spatial);
-<a name="l01247"></a>01247     ny = cpl_image_get_size_y(spatial);
-<a name="l01248"></a>01248 
-<a name="l01249"></a>01249     idscoeff = cpl_table_new(ny);
-<a name="l01250"></a>01250     restable = cpl_table_new(nlines);
-<a name="l01251"></a>01251     rainbow = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01252"></a>01252     <span class="keywordflow">if</span> (check)
-<a name="l01253"></a>01253         residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01254"></a>01254     fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l01255"></a>01255     fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
-<a name="l01256"></a>01256 
-<a name="l01257"></a>01257     rectified = <a class="code" href="group__moses.html#gf01eea33659a6250ad14f7f0fecd86c2">mos_wavelength_calibration_final</a>(spatial, slits, lines, 
-<a name="l01258"></a>01258                                                  dispersion, peakdetection, 
-<a name="l01259"></a>01259                                                  wradius, wdegree, wreject,
-<a name="l01260"></a>01260                                                  reference, &startwavelength, 
-<a name="l01261"></a>01261                                                  &endwavelength, fitlines, 
-<a name="l01262"></a>01262                                                  fiterror, idscoeff, rainbow, 
-<a name="l01263"></a>01263                                                  residual, restable);
-<a name="l01264"></a>01264 
-<a name="l01265"></a>01265     <span class="keywordflow">if</span> (rectified == NULL)
-<a name="l01266"></a>01266         vimos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);
-<a name="l01267"></a>01267 
-<a name="l01268"></a>01268     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, restable, disp_residuals_table_tag, NULL,
-<a name="l01269"></a>01269                        parlist, recipe, version))
-<a name="l01270"></a>01270         vimos_calib_exit(NULL);
-<a name="l01271"></a>01271 
-<a name="l01272"></a>01272     cpl_table_delete(restable); restable = NULL;
-<a name="l01273"></a>01273 
-<a name="l01274"></a>01274     cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;
-<a name="l01275"></a>01275     cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);
-<a name="l01276"></a>01276     cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;
-<a name="l01277"></a>01277 
-<a name="l01278"></a>01278     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l01279"></a>01279 
-<a name="l01280"></a>01280         <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};
-<a name="l01281"></a>01281 
-<a name="l01282"></a>01282         <span class="keywordtype">int</span>    *position = cpl_table_get_data_int   (slits, <span class="stringliteral">"position"</span>);
-<a name="l01283"></a>01283         <span class="keywordtype">int</span>    *length   = cpl_table_get_data_int   (slits, <span class="stringliteral">"length"</span>);
-<a name="l01284"></a>01284         <span class="keywordtype">double</span> *ytop     = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);
-<a name="l01285"></a>01285         <span class="keywordtype">double</span> *ybottom  = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);
-<a name="l01286"></a>01286 
-<a name="l01287"></a>01287         <span class="keywordtype">int</span>     j, k, dr, irow;
-<a name="l01288"></a>01288 
-<a name="l01289"></a>01289         <span class="comment">/*</span>
-<a name="l01290"></a>01290 <span class="comment">         * Replace the LSS solutions to the poorer MOS solutions</span>
-<a name="l01291"></a>01291 <span class="comment">         */</span>
-<a name="l01292"></a>01292 
-<a name="l01293"></a>01293         <span class="keywordflow">for</span> (j = 0, i = ny - 1; i >= 0; i--) {
-<a name="l01294"></a>01294             <span class="keywordflow">if</span> (i < position[j]) {
-<a name="l01295"></a>01295                 ++j;
-<a name="l01296"></a>01296             }
-<a name="l01297"></a>01297             dr = position[j] + length[j] - i - 1;
-<a name="l01298"></a>01298             irow = floor(ytop[j] - dr*(ytop[j] - ybottom[j])/length[j] + 0.5);
-<a name="l01299"></a>01299             <span class="keywordflow">for</span> (k = 0; k <= wdegree; k++) {
-<a name="l01300"></a>01300                 cpl_table_set_double(idscoeff, clab[k], i, 
-<a name="l01301"></a>01301                 cpl_table_get_double(idscoeff_lss, clab[k], irow, NULL));
-<a name="l01302"></a>01302             }
-<a name="l01303"></a>01303             cpl_table_set_double(idscoeff, <span class="stringliteral">"error"</span>, i,
-<a name="l01304"></a>01304             cpl_table_get_double(idscoeff_lss, <span class="stringliteral">"error"</span>, irow, NULL));
-<a name="l01305"></a>01305             cpl_table_set_int(idscoeff, <span class="stringliteral">"nlines"</span>, i,
-<a name="l01306"></a>01306             cpl_table_get_int(idscoeff_lss, <span class="stringliteral">"nlines"</span>, irow, NULL));
-<a name="l01307"></a>01307         }
-<a name="l01308"></a>01308 
-<a name="l01309"></a>01309         cpl_table_delete(idscoeff_lss);
-<a name="l01310"></a>01310 
-<a name="l01311"></a>01311         cpl_image_delete(rectified);
-<a name="l01312"></a>01312 
-<a name="l01313"></a>01313         rectified = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(spatial, reference,
-<a name="l01314"></a>01314                                                startwavelength, endwavelength,
-<a name="l01315"></a>01315                                                dispersion, idscoeff, 0);
-<a name="l01316"></a>01316     }
-<a name="l01317"></a>01317     <span class="keywordflow">else</span> {
-<a name="l01318"></a>01318         <span class="keywordflow">for</span> (i = 0; i < ny; i++)
-<a name="l01319"></a>01319             <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))
-<a name="l01320"></a>01320                 cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);
-<a name="l01321"></a>01321     }
-<a name="l01322"></a>01322 
-<a name="l01323"></a>01323     cpl_image_delete(spatial); spatial = NULL;
-<a name="l01324"></a>01324 
-<a name="l01325"></a>01325     delta = <a class="code" href="group__moses.html#g76e55c10fdcb7d46b17fcea7c2f990a1">mos_map_pixel</a>(idscoeff, reference, startwavelength,
-<a name="l01326"></a>01326                           endwavelength, dispersion, 2);
-<a name="l01327"></a>01327 
-<a name="l01328"></a>01328     header = cpl_propertylist_new();
-<a name="l01329"></a>01329     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01330"></a>01330     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01331"></a>01331     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l01332"></a>01332                                    startwavelength + dispersion/2);
-<a name="l01333"></a>01333     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01334"></a>01334     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01335"></a>01335 <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01336"></a>01336     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01337"></a>01337     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01338"></a>01338     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01339"></a>01339     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01340"></a>01340     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01341"></a>01341     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01342"></a>01342 
-<a name="l01343"></a>01343     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, delta, delta_image_tag,
-<a name="l01344"></a>01344                        header, parlist, recipe, version))
-<a name="l01345"></a>01345         vimos_calib_exit(NULL);
-<a name="l01346"></a>01346 
-<a name="l01347"></a>01347     cpl_image_delete(delta); delta = NULL;
-<a name="l01348"></a>01348     cpl_propertylist_delete(header); header = NULL;
-<a name="l01349"></a>01349 
-<a name="l01350"></a>01350     mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(rectified, lines, startwavelength, 
-<a name="l01351"></a>01351                                    dispersion, 6, 0);
-<a name="l01352"></a>01352 
-<a name="l01353"></a>01353     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f pixel"</span>, mean_rms);
-<a name="l01354"></a>01354 
-<a name="l01355"></a>01355     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l01356"></a>01356 
-<a name="l01357"></a>01357     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>, 
-<a name="l01358"></a>01358                  mean_rms, mean_rms * dispersion);
-<a name="l01359"></a>01359 
-<a name="l01360"></a>01360     restab = <a class="code" href="group__moses.html#gb3eb0708cf40541643d8169f3f6d3b55">mos_resolution_table</a>(rectified, startwavelength, dispersion, 
-<a name="l01361"></a>01361                                   60000, lines);
-<a name="l01362"></a>01362 
-<a name="l01363"></a>01363     <span class="keywordflow">if</span> (restab) {
-<a name="l01364"></a>01364         cpl_msg_info(recipe, <span class="stringliteral">"Mean spectral resolution: %.2f"</span>, 
-<a name="l01365"></a>01365                    cpl_table_get_column_mean(restab, <span class="stringliteral">"resolution"</span>));
-<a name="l01366"></a>01366         cpl_msg_info(recipe, <span class="stringliteral">"Mean reference lines FWHM: %.2f +/- %.2f pixel"</span>,
-<a name="l01367"></a>01367                    cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm"</span>) / dispersion,
-<a name="l01368"></a>01368                    cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm_rms"</span>) / dispersion);
-<a name="l01369"></a>01369 
-<a name="l01370"></a>01370         <span class="keywordflow">if</span> (qc) {
-<a name="l01371"></a>01371 
-<a name="l01372"></a>01372             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01373"></a>01373 
-<a name="l01374"></a>01374             <span class="keywordflow">if</span> (header == NULL)
-<a name="l01375"></a>01375                 vimos_calib_exit(<span class="stringliteral">"Cannot reload arc lamp header"</span>);
-<a name="l01376"></a>01376 
-<a name="l01377"></a>01377             qclist = cpl_propertylist_new();
-<a name="l01378"></a>01378 
-<a name="l01379"></a>01379             <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qclist, <span class="stringliteral">"1.1"</span>, instrume);
-<a name="l01380"></a>01380 
-<a name="l01381"></a>01381 
-<a name="l01382"></a>01382             <span class="comment">/*</span>
-<a name="l01383"></a>01383 <span class="comment">             * QC1 group header</span>
-<a name="l01384"></a>01384 <span class="comment">             */</span>
-<a name="l01385"></a>01385 
-<a name="l01386"></a>01386             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, spectral_resolution_tag,
-<a name="l01387"></a>01387                                     <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l01388"></a>01388                 vimos_calib_exit(<span class="stringliteral">"Cannot write product category to "</span>
-<a name="l01389"></a>01389                                 <span class="stringliteral">"QC log file"</span>);
-<a name="l01390"></a>01390 
-<a name="l01391"></a>01391             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l01392"></a>01392                                       <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l01393"></a>01393                 vimos_calib_exit(<span class="stringliteral">"Missing keyword DPR TYPE in arc "</span>
-<a name="l01394"></a>01394                                 <span class="stringliteral">"lamp header"</span>);
-<a name="l01395"></a>01395 
-<a name="l01396"></a>01396             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l01397"></a>01397                                       <span class="stringliteral">"Template"</span>, instrume))
-<a name="l01398"></a>01398                 vimos_calib_exit(<span class="stringliteral">"Missing keyword TPL ID in arc "</span>
-<a name="l01399"></a>01399                                 <span class="stringliteral">"lamp header"</span>);
-<a name="l01400"></a>01400 
-<a name="l01401"></a>01401             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, key_gris_name, NULL,
-<a name="l01402"></a>01402                                       <span class="stringliteral">"Grism name"</span>, instrume)) {
-<a name="l01403"></a>01403                 cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in arc "</span>
-<a name="l01404"></a>01404                                 <span class="stringliteral">"lamp header"</span>, key_gris_name);
-<a name="l01405"></a>01405                 vimos_calib_exit(NULL);
-<a name="l01406"></a>01406             }
-<a name="l01407"></a>01407 
-<a name="l01408"></a>01408             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, key_gris_id, NULL,
-<a name="l01409"></a>01409                                       <span class="stringliteral">"Grism identifier"</span>, instrume)) {
-<a name="l01410"></a>01410                 cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in arc "</span>
-<a name="l01411"></a>01411                                 <span class="stringliteral">"lamp header"</span>, key_gris_id);
-<a name="l01412"></a>01412                 vimos_calib_exit(NULL);
-<a name="l01413"></a>01413             }
-<a name="l01414"></a>01414 
-<a name="l01415"></a>01415             <span class="keywordflow">if</span> (cpl_propertylist_has(header, key_filt_name))
-<a name="l01416"></a>01416                 <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, key_filt_name, NULL,
-<a name="l01417"></a>01417                                       <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l01418"></a>01418 
-<a name="l01419"></a>01419             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l01420"></a>01420                                       <span class="stringliteral">"Chip identifier"</span>, instrume))
-<a name="l01421"></a>01421                 vimos_calib_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in arc "</span>
-<a name="l01422"></a>01422                                 <span class="stringliteral">"lamp header"</span>);
-<a name="l01423"></a>01423 
-<a name="l01424"></a>01424             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l01425"></a>01425                                       <span class="stringliteral">"Archive name of input data"</span>, 
-<a name="l01426"></a>01426                                       instrume))
-<a name="l01427"></a>01427                 vimos_calib_exit(<span class="stringliteral">"Missing keyword ARCFILE in arc "</span>
-<a name="l01428"></a>01428                                 <span class="stringliteral">"lamp header"</span>);
-<a name="l01429"></a>01429 
-<a name="l01430"></a>01430             cpl_propertylist_delete(header); header = NULL;
-<a name="l01431"></a>01431 
-<a name="l01432"></a>01432             pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(spectral_resolution_tag);
-<a name="l01433"></a>01433             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l01434"></a>01434                                     <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l01435"></a>01435                 vimos_calib_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);
-<a name="l01436"></a>01436             cpl_free(pipefile); pipefile = NULL;
-<a name="l01437"></a>01437 
-<a name="l01438"></a>01438 
-<a name="l01439"></a>01439             <span class="comment">/*</span>
-<a name="l01440"></a>01440 <span class="comment">             * QC1 parameters</span>
-<a name="l01441"></a>01441 <span class="comment">             */</span>
-<a name="l01442"></a>01442 
-<a name="l01443"></a>01443             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION"</span>;
-<a name="l01444"></a>01444 
-<a name="l01445"></a>01445             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qclist, 
-<a name="l01446"></a>01446                                        cpl_table_get_column_mean(restab,
-<a name="l01447"></a>01447                                                                  <span class="stringliteral">"resolution"</span>),
-<a name="l01448"></a>01448                                        keyname,
-<a name="l01449"></a>01449                                        <span class="stringliteral">"Angstrom"</span>,
-<a name="l01450"></a>01450                                        <span class="stringliteral">"Mean spectral resolution"</span>,
-<a name="l01451"></a>01451                                        instrume)) {
-<a name="l01452"></a>01452                 vimos_calib_exit(<span class="stringliteral">"Cannot write mean spectral resolution to QC "</span>
-<a name="l01453"></a>01453                                 <span class="stringliteral">"log file"</span>);
-<a name="l01454"></a>01454             }
-<a name="l01455"></a>01455 
-<a name="l01456"></a>01456             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.RMS"</span>;
-<a name="l01457"></a>01457 
-<a name="l01458"></a>01458             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qclist, 
-<a name="l01459"></a>01459                                        cpl_table_get_column_stdev(restab, 
-<a name="l01460"></a>01460                                                                   <span class="stringliteral">"resolution"</span>),
-<a name="l01461"></a>01461                                        <span class="stringliteral">"QC.MOS.RESOLUTION.RMS"</span>,
-<a name="l01462"></a>01462                                        <span class="stringliteral">"Angstrom"</span>, 
-<a name="l01463"></a>01463                                        <span class="stringliteral">"Scatter of spectral resolution"</span>,
-<a name="l01464"></a>01464                                        instrume)) {
-<a name="l01465"></a>01465                 vimos_calib_exit(<span class="stringliteral">"Cannot write spectral resolution scatter "</span>
-<a name="l01466"></a>01466                                 <span class="stringliteral">"to QC log file"</span>);
-<a name="l01467"></a>01467             }
-<a name="l01468"></a>01468 
-<a name="l01469"></a>01469             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.NLINES"</span>;
-<a name="l01470"></a>01470 
-<a name="l01471"></a>01471             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g661730c28a076df446641c371342bf5b">fors_qc_write_qc_int</a>(qclist, cpl_table_get_nrow(restab) -
-<a name="l01472"></a>01472                                     cpl_table_count_invalid(restab, 
-<a name="l01473"></a>01473                                                             <span class="stringliteral">"resolution"</span>),
-<a name="l01474"></a>01474                                     <span class="stringliteral">"QC.MOS.RESOLUTION.NLINES"</span>,
-<a name="l01475"></a>01475                                     NULL,
-<a name="l01476"></a>01476                                     <span class="stringliteral">"Number of lines for spectral resolution "</span>
-<a name="l01477"></a>01477                                     <span class="stringliteral">"computation"</span>,
-<a name="l01478"></a>01478                                     instrume)) {
-<a name="l01479"></a>01479                 vimos_calib_exit(<span class="stringliteral">"Cannot write number of lines used in "</span>
-<a name="l01480"></a>01480                                 <span class="stringliteral">"spectral resolution computation "</span>
-<a name="l01481"></a>01481                                 <span class="stringliteral">"to QC log file"</span>);
-<a name="l01482"></a>01482             }
-<a name="l01483"></a>01483 
-<a name="l01484"></a>01484             <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l01485"></a>01485 
-<a name="l01486"></a>01486         }
-<a name="l01487"></a>01487 
-<a name="l01488"></a>01488         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, restab, spectral_resolution_tag, qclist,
-<a name="l01489"></a>01489                            parlist, recipe, version))
-<a name="l01490"></a>01490             vimos_calib_exit(NULL);
-<a name="l01491"></a>01491 
-<a name="l01492"></a>01492         cpl_propertylist_delete(qclist); qclist = NULL;
-<a name="l01493"></a>01493 
-<a name="l01494"></a>01494     }
-<a name="l01495"></a>01495     <span class="keywordflow">else</span>
-<a name="l01496"></a>01496         vimos_calib_exit(<span class="stringliteral">"Cannot compute the spectral resolution table"</span>);
-<a name="l01497"></a>01497 
-<a name="l01498"></a>01498     cpl_vector_delete(lines); lines = NULL;
-<a name="l01499"></a>01499 
-<a name="l01500"></a>01500     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_coeff_tag, NULL,
-<a name="l01501"></a>01501                        parlist, recipe, version))
-<a name="l01502"></a>01502         vimos_calib_exit(NULL);
-<a name="l01503"></a>01503 
-<a name="l01504"></a>01504     <span class="comment">/*</span>
-<a name="l01505"></a>01505 <span class="comment">     * Global distortion models</span>
-<a name="l01506"></a>01506 <span class="comment">     */</span>
-<a name="l01507"></a>01507 
-<a name="l01508"></a>01508     <span class="keywordflow">if</span> (slit_ident) {
-<a name="l01509"></a>01509 
-<a name="l01510"></a>01510         cpl_msg_info(recipe, <span class="stringliteral">"Computing global distortions model"</span>);
-<a name="l01511"></a>01511         global = <a class="code" href="group__moses.html#gdf9210c07ebddae07a3e5e99d88d2f5c">mos_global_distortion</a>(slits, maskslits, idscoeff, 
-<a name="l01512"></a>01512                                        polytraces, reference);
-<a name="l01513"></a>01513 
-<a name="l01514"></a>01514         <span class="keywordflow">if</span> (global && 0) {
-<a name="l01515"></a>01515             cpl_table *stest;
-<a name="l01516"></a>01516             cpl_table *ctest;
-<a name="l01517"></a>01517             cpl_table *dtest;
-<a name="l01518"></a>01518             cpl_image *itest;
-<a name="l01519"></a>01519 
-<a name="l01520"></a>01520             stest = <a class="code" href="group__moses.html#g39dd696d6572e52031e12b1a53e505c2">mos_build_slit_location</a>(global, maskslits, ccd_ysize);
-<a name="l01521"></a>01521 
-<a name="l01522"></a>01522             ctest = <a class="code" href="group__moses.html#ga010593249434f0bb667af2f2c950951">mos_build_curv_coeff</a>(global, maskslits, stest);
-<a name="l01523"></a>01523             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, ctest, <span class="stringliteral">"CURVS"</span>, NULL,
-<a name="l01524"></a>01524                                parlist, recipe, version))
-<a name="l01525"></a>01525                 vimos_calib_exit(NULL);
-<a name="l01526"></a>01526 
-<a name="l01527"></a>01527             itest = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, stest, ctest, 
-<a name="l01528"></a>01528                                             reference, startwavelength, 
-<a name="l01529"></a>01529                                             endwavelength, dispersion, 
-<a name="l01530"></a>01530                                             0, NULL);
-<a name="l01531"></a>01531             cpl_table_delete(ctest); ctest = NULL;
-<a name="l01532"></a>01532             cpl_image_delete(itest); itest = NULL;
-<a name="l01533"></a>01533             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, stest, <span class="stringliteral">"SLITS"</span>, NULL,
-<a name="l01534"></a>01534                                parlist, recipe, version))
-<a name="l01535"></a>01535                 vimos_calib_exit(NULL);
-<a name="l01536"></a>01536 
-<a name="l01537"></a>01537             dtest = <a class="code" href="group__moses.html#gc4a3f1981baef15668137f04c04cf710">mos_build_disp_coeff</a>(global, stest);
-<a name="l01538"></a>01538             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, dtest, <span class="stringliteral">"DISPS"</span>, NULL,
-<a name="l01539"></a>01539                                parlist, recipe, version))
-<a name="l01540"></a>01540                 vimos_calib_exit(NULL);
-<a name="l01541"></a>01541 
-<a name="l01542"></a>01542             cpl_table_delete(dtest); dtest = NULL;
-<a name="l01543"></a>01543             cpl_table_delete(stest); stest = NULL;
-<a name="l01544"></a>01544         }
-<a name="l01545"></a>01545 
-<a name="l01546"></a>01546         <span class="keywordflow">if</span> (global) {
-<a name="l01547"></a>01547             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, global, global_distortion_tag, NULL,
-<a name="l01548"></a>01548                                parlist, recipe, version))
-<a name="l01549"></a>01549                 vimos_calib_exit(NULL);
-<a name="l01550"></a>01550             cpl_table_delete(global); global = NULL;
-<a name="l01551"></a>01551         }
-<a name="l01552"></a>01552 
-<a name="l01553"></a>01553 <span class="comment">//        cpl_image_delete(spectra); spectra = NULL;</span>
-<a name="l01554"></a>01554         cpl_table_delete(maskslits); maskslits = NULL;
-<a name="l01555"></a>01555     }
-<a name="l01556"></a>01556 
-<a name="l01557"></a>01557     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l01558"></a>01558     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01559"></a>01559     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01560"></a>01560     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01561"></a>01561                                    startwavelength + dispersion/2);
-<a name="l01562"></a>01562     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01563"></a>01563     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01564"></a>01564 <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01565"></a>01565     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01566"></a>01566     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01567"></a>01567     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01568"></a>01568     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01569"></a>01569     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01570"></a>01570     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01571"></a>01571     cpl_propertylist_update_int(header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, 1);
-<a name="l01572"></a>01572 
-<a name="l01573"></a>01573     <span class="keywordflow">if</span> (qc) {
-<a name="l01574"></a>01574 
-<a name="l01575"></a>01575         <span class="keywordtype">double</span> scale;
-<a name="l01576"></a>01576         <span class="keywordtype">double</span> slit_width;
-<a name="l01577"></a>01577         <span class="keywordtype">float</span>  lambdaHe;
-<a name="l01578"></a>01578         <span class="keywordtype">float</span>  lambdaNe;
-<a name="l01579"></a>01579         <span class="keywordtype">float</span>  lambdaAr;
-<a name="l01580"></a>01580         <span class="keywordtype">float</span>  lambdaRed;
-<a name="l01581"></a>01581         <span class="keywordtype">float</span>  lambdaYel;
-<a name="l01582"></a>01582         <span class="keywordtype">float</span>  lambdaBlu;
-<a name="l01583"></a>01583         <span class="keywordtype">double</span> flux, flux_err, resol, resol_err;
-<a name="l01584"></a>01584         <span class="keywordtype">int</span>    selected;
-<a name="l01585"></a>01585         <span class="keywordtype">int</span>    cslit = <a class="code" href="group__moses.html#gc32b3fba956da20bd20530372b1b28d1">mos_slit_closest_to_center</a>(slits, nx, ny);
-<a name="l01586"></a>01586 
-<a name="l01587"></a>01587 
-<a name="l01588"></a>01588         <span class="comment">/*</span>
-<a name="l01589"></a>01589 <span class="comment">         * QC1 group header</span>
-<a name="l01590"></a>01590 <span class="comment">         */</span>
-<a name="l01591"></a>01591 
-<a name="l01592"></a>01592         <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(header, <span class="stringliteral">"1.1"</span>, instrume);
-<a name="l01593"></a>01593 
-<a name="l01594"></a>01594         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, master_norm_flat_tag,
-<a name="l01595"></a>01595                                  <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l01596"></a>01596             vimos_calib_exit(<span class="stringliteral">"Cannot write product category to QC log file"</span>);
-<a name="l01597"></a>01597 
-<a name="l01598"></a>01598         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l01599"></a>01599                                    <span class="stringliteral">"Archive File Name"</span>, instrume))
-<a name="l01600"></a>01600             vimos_calib_exit(<span class="stringliteral">"Missing keyword ARCFILE in arc lamp frame"</span>);
-<a name="l01601"></a>01601 
-<a name="l01602"></a>01602         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l01603"></a>01603                                    <span class="stringliteral">"Template signature ID"</span>, instrume))
-<a name="l01604"></a>01604             vimos_calib_exit(<span class="stringliteral">"Missing keyword TPL ID in arc lamp frame"</span>);
-<a name="l01605"></a>01605 
-<a name="l01606"></a>01606         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO OCS CON QUAD"</span>, NULL,
-<a name="l01607"></a>01607                                    <span class="stringliteral">"Quadrant"</span>, instrume))
-<a name="l01608"></a>01608             vimos_calib_exit(<span class="stringliteral">"Missing keyword OCS CON QUAD in arc lamp frame"</span>);
-<a name="l01609"></a>01609 
-<a name="l01610"></a>01610         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, key_filt_name, NULL,
-<a name="l01611"></a>01611                                    <span class="stringliteral">"Filter"</span>, instrume)) {
-<a name="l01612"></a>01612             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in arc lamp frame"</span>,
-<a name="l01613"></a>01613                           key_filt_name);
-<a name="l01614"></a>01614             vimos_calib_exit(NULL);
-<a name="l01615"></a>01615         }
-<a name="l01616"></a>01616 
-<a name="l01617"></a>01617         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, key_gris_name, NULL,
-<a name="l01618"></a>01618                                    <span class="stringliteral">"Grism"</span>, instrume)) {
-<a name="l01619"></a>01619             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in arc lamp frame"</span>,
-<a name="l01620"></a>01620                           key_gris_name);
-<a name="l01621"></a>01621             vimos_calib_exit(NULL);
-<a name="l01622"></a>01622         }
-<a name="l01623"></a>01623 
-<a name="l01624"></a>01624         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, key_mask_id, NULL,
-<a name="l01625"></a>01625                                    <span class="stringliteral">"Mask"</span>, instrume)) {
-<a name="l01626"></a>01626             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in arc lamp frame"</span>,
-<a name="l01627"></a>01627                           key_mask_id);
-<a name="l01628"></a>01628             vimos_calib_exit(NULL);
-<a name="l01629"></a>01629         }
-<a name="l01630"></a>01630 
-<a name="l01631"></a>01631         cpl_propertylist_update_double(header,
-<a name="l01632"></a>01632                                        <span class="stringliteral">"ESO PRO WLEN CEN"</span>, reference);
-<a name="l01633"></a>01633 
-<a name="l01634"></a>01634         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO PRO WLEN CEN"</span>, <span class="stringliteral">"Angstrom"</span>,
-<a name="l01635"></a>01635                                    <span class="stringliteral">"Reference wavelength"</span>, instrume))
-<a name="l01636"></a>01636             vimos_calib_exit(<span class="stringliteral">"Missing keyword PRO WLEN CEN in arc lamp frame"</span>);
-<a name="l01637"></a>01637 
-<a name="l01638"></a>01638         pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(master_norm_flat_tag);
-<a name="l01639"></a>01639         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l01640"></a>01640                                 <span class="stringliteral">"Pipeline product name"</span>, instrume))
-<a name="l01641"></a>01641             vimos_calib_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);
-<a name="l01642"></a>01642         cpl_free(pipefile); pipefile = NULL;
-<a name="l01643"></a>01643 
-<a name="l01644"></a>01644         scale = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO TEL FOCU SCALE"</span>);
-<a name="l01645"></a>01645 
-<a name="l01646"></a>01646         <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01647"></a>01647             cpl_error_reset();
-<a name="l01648"></a>01648             scale = 1.718;
-<a name="l01649"></a>01649             cpl_msg_warning(recipe, <span class="stringliteral">"Cannot read keyword TEL FOCU SCALE "</span>
-<a name="l01650"></a>01650                             <span class="stringliteral">"(defaulted to %f arcsec/mm)"</span>, scale);
-<a name="l01651"></a>01651         }
-<a name="l01652"></a>01652 
-<a name="l01653"></a>01653         <span class="comment">/*</span>
-<a name="l01654"></a>01654 <span class="comment">         * QC1 parameters</span>
-<a name="l01655"></a>01655 <span class="comment">         */</span>
-<a name="l01656"></a>01656 
-<a name="l01657"></a>01657         keyname = <span class="stringliteral">"QC.MOS.SLIT.WIDTH"</span>;
-<a name="l01658"></a>01658 
-<a name="l01659"></a>01659         slit_width = scale * cpl_table_get(slits, <span class="stringliteral">"ywidth"</span>, cslit, NULL);
-<a name="l01660"></a>01660 
-<a name="l01661"></a>01661         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, slit_width, keyname, <span class="stringliteral">"arcsec"</span>,
-<a name="l01662"></a>01662                                     <span class="stringliteral">"Width of slit closest to center"</span>,
-<a name="l01663"></a>01663                                     instrume)) {
-<a name="l01664"></a>01664             vimos_calib_exit(<span class="stringliteral">"Cannot write slit width to QC log file"</span>);
-<a name="l01665"></a>01665         }
-<a name="l01666"></a>01666 
-<a name="l01667"></a>01667         <span class="keywordflow">if</span> (grism[0] == <span class="charliteral">'L'</span>) {
-<a name="l01668"></a>01668             <span class="keywordflow">if</span> (grism[3] == <span class="charliteral">'r'</span>) {      <span class="comment">/* LR_red    */</span>
-<a name="l01669"></a>01669                 lambdaHe  = 7065.19;
-<a name="l01670"></a>01670                 lambdaNe  = 0.0;
-<a name="l01671"></a>01671                 lambdaAr  = 7723.80;
-<a name="l01672"></a>01672                 lambdaRed = 9122.97;
-<a name="l01673"></a>01673                 lambdaYel = 7635.11;
-<a name="l01674"></a>01674                 lambdaBlu = 5875.62;
-<a name="l01675"></a>01675             }
-<a name="l01676"></a>01676             <span class="keywordflow">if</span> (grism[3] == <span class="charliteral">'b'</span>) {      <span class="comment">/* LR_blue   */</span>
-<a name="l01677"></a>01677                 lambdaHe  = 5015.68;
-<a name="l01678"></a>01678                 lambdaNe  = 6598.96;
-<a name="l01679"></a>01679                 lambdaAr  = 0.0;
-<a name="l01680"></a>01680                 lambdaRed = 6598.95;
-<a name="l01681"></a>01681                 lambdaYel = 5015.68;
-<a name="l01682"></a>01682                 lambdaBlu = 3888.65;
-<a name="l01683"></a>01683             }
-<a name="l01684"></a>01684         }
-<a name="l01685"></a>01685 
-<a name="l01686"></a>01686         <span class="keywordflow">if</span> (grism[0] == <span class="charliteral">'M'</span>) {          <span class="comment">/* MR        */</span>
-<a name="l01687"></a>01687             lambdaHe  = 7065.19;
-<a name="l01688"></a>01688             lambdaNe  = 7032.41;
-<a name="l01689"></a>01689             lambdaAr  = 7723.80;
-<a name="l01690"></a>01690             lambdaRed = 8264.521;
-<a name="l01691"></a>01691             lambdaYel = 6678.200;
-<a name="l01692"></a>01692             lambdaBlu = 5015.675;
-<a name="l01693"></a>01693         }
-<a name="l01694"></a>01694 
-<a name="l01695"></a>01695         <span class="keywordflow">if</span> (grism[0] == <span class="charliteral">'H'</span>) {
-<a name="l01696"></a>01696             <span class="keywordflow">if</span> (grism[3] == <span class="charliteral">'r'</span>) {      <span class="comment">/* HR_red    */</span>
-<a name="l01697"></a>01697                 lambdaHe  = 7065.19;
-<a name="l01698"></a>01698                 lambdaNe  = 7032.41;
-<a name="l01699"></a>01699                 lambdaAr  = 7723.80;
-<a name="l01700"></a>01700                 lambdaRed = 9122.966;
-<a name="l01701"></a>01701                 lambdaYel = 7948.175;
-<a name="l01702"></a>01702                 lambdaBlu = 6929.468;
-<a name="l01703"></a>01703             }
-<a name="l01704"></a>01704             <span class="keywordflow">if</span> (grism[3] == <span class="charliteral">'o'</span>) {      <span class="comment">/* HR_orange */</span>
-<a name="l01705"></a>01705                 lambdaHe  = 7065.19;
-<a name="l01706"></a>01706                 lambdaNe  = 7032.41;
-<a name="l01707"></a>01707                 lambdaAr  = 7723.80;
-<a name="l01708"></a>01708                 lambdaRed = 7948.175;
-<a name="l01709"></a>01709                 lambdaYel = 6929.468;
-<a name="l01710"></a>01710                 lambdaBlu = 5875.618;
-<a name="l01711"></a>01711             }
-<a name="l01712"></a>01712             <span class="keywordflow">if</span> (grism[3] == <span class="charliteral">'b'</span>) {      <span class="comment">/* HR_blue   */</span>
-<a name="l01713"></a>01713                 lambdaHe  = 5015.68;
-<a name="l01714"></a>01714                 lambdaNe  = 5944.83;
-<a name="l01715"></a>01715                 lambdaAr  = 0.0;
-<a name="l01716"></a>01716                 lambdaRed = 6598.953;
-<a name="l01717"></a>01717                 lambdaYel = 5875.618;
-<a name="l01718"></a>01718                 lambdaBlu = 5015.675;
-<a name="l01719"></a>01719             }
-<a name="l01720"></a>01720         }
-<a name="l01721"></a>01721 
-<a name="l01722"></a>01722         <span class="keywordflow">if</span> (lambdaHe > 1.) {
-<a name="l01723"></a>01723             <a class="code" href="group__moses.html#ga8abda7d8ad43a4c3287b7b9071f5094">mos_extract_flux_mapped</a>(rectified, slits, lambdaHe, 
-<a name="l01724"></a>01724                                     startwavelength, dispersion, 
-<a name="l01725"></a>01725                                     4, gain, &flux, &flux_err);
-<a name="l01726"></a>01726 
-<a name="l01727"></a>01727             flux     /= arctime;
-<a name="l01728"></a>01728             flux_err /= arctime;
-<a name="l01729"></a>01729 
-<a name="l01730"></a>01730             cpl_msg_info(recipe, <span class="stringliteral">"Flux of He %.2f: %.2f +/- %.2f ADU/mm^2/s"</span>,
-<a name="l01731"></a>01731                          lambdaHe, flux, flux_err);
-<a name="l01732"></a>01732 
-<a name="l01733"></a>01733             keyname = <span class="stringliteral">"QC.MOS.HE.LAMBDA"</span>;
-<a name="l01734"></a>01734 
-<a name="l01735"></a>01735             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, lambdaHe, keyname, <span class="stringliteral">"Angstrom"</span>,
-<a name="l01736"></a>01736                       <span class="stringliteral">"He arc lamp line for flux determination"</span>, instrume)) {
-<a name="l01737"></a>01737                 vimos_calib_exit(<span class="stringliteral">"Cannot write He arc line to QC log file"</span>);
-<a name="l01738"></a>01738             }
-<a name="l01739"></a>01739 
-<a name="l01740"></a>01740             keyname = <span class="stringliteral">"QC.MOS.HE.FLUX"</span>;
-<a name="l01741"></a>01741 
-<a name="l01742"></a>01742             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, flux, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,
-<a name="l01743"></a>01743                       <span class="stringliteral">"Flux at chosen He wavelength"</span>, instrume)) {
-<a name="l01744"></a>01744                 vimos_calib_exit(<span class="stringliteral">"Cannot write He flux to QC log file"</span>);
-<a name="l01745"></a>01745             }
-<a name="l01746"></a>01746 
-<a name="l01747"></a>01747             keyname = <span class="stringliteral">"QC.MOS.HE.FLUXERR"</span>;
-<a name="l01748"></a>01748 
-<a name="l01749"></a>01749             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, flux_err, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,
-<a name="l01750"></a>01750                       <span class="stringliteral">"Error on flux at chosen He wavelength"</span>, instrume)) {
-<a name="l01751"></a>01751                 vimos_calib_exit(<span class="stringliteral">"Cannot write He flux error to QC log file"</span>);
-<a name="l01752"></a>01752             }
-<a name="l01753"></a>01753         }
-<a name="l01754"></a>01754         <span class="keywordflow">else</span>
-<a name="l01755"></a>01755             cpl_msg_warning(recipe, 
-<a name="l01756"></a>01756                             <span class="stringliteral">"No He lines in %s spectral range: corresponding "</span>
-<a name="l01757"></a>01757                             <span class="stringliteral">"QC1 parameters are not computed."</span>, grism);
-<a name="l01758"></a>01758 
-<a name="l01759"></a>01759         <span class="keywordflow">if</span> (lambdaNe > 1.) {
-<a name="l01760"></a>01760             <a class="code" href="group__moses.html#ga8abda7d8ad43a4c3287b7b9071f5094">mos_extract_flux_mapped</a>(rectified, slits, lambdaNe, 
-<a name="l01761"></a>01761                                     startwavelength, dispersion, 
-<a name="l01762"></a>01762                                     4, gain, &flux, &flux_err);
-<a name="l01763"></a>01763 
-<a name="l01764"></a>01764             flux     /= arctime;
-<a name="l01765"></a>01765             flux_err /= arctime;
-<a name="l01766"></a>01766 
-<a name="l01767"></a>01767             cpl_msg_info(recipe, <span class="stringliteral">"Flux of Ne %.2f: %.2f +/- %.2f ADU/mm^2/s"</span>,
-<a name="l01768"></a>01768                          lambdaNe, flux, flux_err);
-<a name="l01769"></a>01769 
-<a name="l01770"></a>01770             keyname = <span class="stringliteral">"QC.MOS.NE.LAMBDA"</span>;
-<a name="l01771"></a>01771 
-<a name="l01772"></a>01772             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, lambdaNe, keyname, <span class="stringliteral">"Angstrom"</span>,
-<a name="l01773"></a>01773                       <span class="stringliteral">"Ne arc lamp line for flux determination"</span>, instrume)) {
-<a name="l01774"></a>01774                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ne arc line to QC log file"</span>);
-<a name="l01775"></a>01775             }
-<a name="l01776"></a>01776 
-<a name="l01777"></a>01777             keyname = <span class="stringliteral">"QC.MOS.NE.FLUX"</span>;
-<a name="l01778"></a>01778 
-<a name="l01779"></a>01779             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, flux, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,
-<a name="l01780"></a>01780                       <span class="stringliteral">"Flux at chosen Ne wavelength"</span>, instrume)) {
-<a name="l01781"></a>01781                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ne flux to QC log file"</span>);
-<a name="l01782"></a>01782             }
-<a name="l01783"></a>01783 
-<a name="l01784"></a>01784             keyname = <span class="stringliteral">"QC.MOS.NE.FLUXERR"</span>;
-<a name="l01785"></a>01785 
-<a name="l01786"></a>01786             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, flux_err, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,
-<a name="l01787"></a>01787                       <span class="stringliteral">"Error on flux at chosen Ne wavelength"</span>, instrume)) {
-<a name="l01788"></a>01788                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ne flux error to QC log file"</span>);
-<a name="l01789"></a>01789             }
-<a name="l01790"></a>01790         }
-<a name="l01791"></a>01791         <span class="keywordflow">else</span>
-<a name="l01792"></a>01792             cpl_msg_warning(recipe, 
-<a name="l01793"></a>01793                             <span class="stringliteral">"No Ne lines in %s spectral range: corresponding "</span>
-<a name="l01794"></a>01794                             <span class="stringliteral">"QC1 parameters are not computed."</span>, grism);
-<a name="l01795"></a>01795 
-<a name="l01796"></a>01796         <span class="keywordflow">if</span> (lambdaAr > 1.) {
-<a name="l01797"></a>01797             <a class="code" href="group__moses.html#ga8abda7d8ad43a4c3287b7b9071f5094">mos_extract_flux_mapped</a>(rectified, slits, lambdaAr, 
-<a name="l01798"></a>01798                                     startwavelength, dispersion, 
-<a name="l01799"></a>01799                                     4, gain, &flux, &flux_err);
-<a name="l01800"></a>01800 <span class="comment">//            mos_extract_flux(spectra, slits, 3, gain, &flux, &flux_err);</span>
-<a name="l01801"></a>01801 
-<a name="l01802"></a>01802             flux     /= arctime;
-<a name="l01803"></a>01803             flux_err /= arctime;
-<a name="l01804"></a>01804 
-<a name="l01805"></a>01805             cpl_msg_info(recipe, <span class="stringliteral">"Flux of Ar %.2f: %.2f +/- %.2f ADU/mm^2/s"</span>,
-<a name="l01806"></a>01806                          lambdaAr, flux, flux_err);
-<a name="l01807"></a>01807 
-<a name="l01808"></a>01808             keyname = <span class="stringliteral">"QC.MOS.AR.LAMBDA"</span>;
-<a name="l01809"></a>01809 
-<a name="l01810"></a>01810             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, lambdaAr, keyname, <span class="stringliteral">"Angstrom"</span>,
-<a name="l01811"></a>01811                       <span class="stringliteral">"Ar arc lamp line for flux determination"</span>, instrume)) {
-<a name="l01812"></a>01812                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ar arc line to QC log file"</span>);
-<a name="l01813"></a>01813             }
-<a name="l01814"></a>01814 
-<a name="l01815"></a>01815             keyname = <span class="stringliteral">"QC.MOS.AR.FLUX"</span>;
-<a name="l01816"></a>01816 
-<a name="l01817"></a>01817             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, flux, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,
-<a name="l01818"></a>01818                       <span class="stringliteral">"Flux at chosen Ar wavelength"</span>, instrume)) {
-<a name="l01819"></a>01819                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ar flux to QC log file"</span>);
-<a name="l01820"></a>01820             }
-<a name="l01821"></a>01821 
-<a name="l01822"></a>01822             keyname = <span class="stringliteral">"QC.MOS.AR.FLUXERR"</span>;
-<a name="l01823"></a>01823 
-<a name="l01824"></a>01824             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, flux_err, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,
-<a name="l01825"></a>01825                       <span class="stringliteral">"Error on flux at chosen Ar wavelength"</span>, instrume)) {
-<a name="l01826"></a>01826                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ar flux error to QC log file"</span>);
-<a name="l01827"></a>01827             }
-<a name="l01828"></a>01828         }
-<a name="l01829"></a>01829         <span class="keywordflow">else</span>
-<a name="l01830"></a>01830             cpl_msg_warning(recipe, 
-<a name="l01831"></a>01831                             <span class="stringliteral">"No Ar lines in %s spectral range: corresponding "</span>
-<a name="l01832"></a>01832                             <span class="stringliteral">"QC1 parameters are not computed."</span>, grism);
-<a name="l01833"></a>01833 
-<a name="l01834"></a>01834         <span class="comment">/*</span>
-<a name="l01835"></a>01835 <span class="comment">         * IDS coefficients</span>
-<a name="l01836"></a>01836 <span class="comment">         */</span>
-<a name="l01837"></a>01837 
-<a name="l01838"></a>01838         <span class="keywordflow">for</span> (i = 0; i <= wdegree; i++) {
-<a name="l01839"></a>01839             <span class="keywordtype">char</span>  *label = cpl_sprintf(<span class="stringliteral">"c%d"</span>, i);
-<a name="l01840"></a>01840             <span class="keywordtype">char</span>  *unit;
-<a name="l01841"></a>01841             <span class="keywordtype">char</span>  *comment;
-<a name="l01842"></a>01842             <span class="keywordtype">double</span> mcoeff;
-<a name="l01843"></a>01843 
-<a name="l01844"></a>01844 
-<a name="l01845"></a>01845             mcoeff = 0.0;    <span class="comment">// Zero by definition when i == 0</span>
-<a name="l01846"></a>01846             <span class="keywordflow">if</span> (i) {
-<a name="l01847"></a>01847                 <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#g8395eca2d64406c969f48220024e999b">mos_median_in_slit</a>(idscoeff, slits, 
-<a name="l01848"></a>01848                                        cslit, label, &mcoeff)) {
-<a name="l01849"></a>01849                     cpl_free(label);
-<a name="l01850"></a>01850                     <span class="keywordflow">break</span>;
-<a name="l01851"></a>01851                 }
-<a name="l01852"></a>01852             }
-<a name="l01853"></a>01853 
-<a name="l01854"></a>01854             keyname = cpl_sprintf(<span class="stringliteral">"QC.MOS.WAVECAL.COEFF%d"</span>, i);
-<a name="l01855"></a>01855 
-<a name="l01856"></a>01856             <span class="keywordflow">switch</span> (i) {
-<a name="l01857"></a>01857             <span class="keywordflow">case</span> 0:
-<a name="l01858"></a>01858                 unit = cpl_strdup(<span class="stringliteral">"pixel"</span>);
-<a name="l01859"></a>01859                 <span class="keywordflow">break</span>;
-<a name="l01860"></a>01860             <span class="keywordflow">case</span> 1:
-<a name="l01861"></a>01861                 unit = cpl_strdup(<span class="stringliteral">"pixel/Angstrom"</span>);
-<a name="l01862"></a>01862                 <span class="keywordflow">break</span>;
-<a name="l01863"></a>01863             <span class="keywordflow">default</span>:
-<a name="l01864"></a>01864                 unit = cpl_sprintf(<span class="stringliteral">"pixel/Angstrom^%d"</span>, i);
-<a name="l01865"></a>01865                 <span class="keywordflow">break</span>;
-<a name="l01866"></a>01866             }
-<a name="l01867"></a>01867 
-<a name="l01868"></a>01868             comment = cpl_sprintf(<span class="stringliteral">"Median coefficient %d of IDS"</span>, i);
-<a name="l01869"></a>01869 
-<a name="l01870"></a>01870             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, mcoeff, keyname, 
-<a name="l01871"></a>01871                                         unit, comment, instrume)) {
-<a name="l01872"></a>01872                 vimos_calib_exit(<span class="stringliteral">"Cannot write IDS coefficient to QC logfile"</span>);
-<a name="l01873"></a>01873             }
-<a name="l01874"></a>01874 
-<a name="l01875"></a>01875             cpl_free(keyname);
-<a name="l01876"></a>01876             cpl_free(comment);
-<a name="l01877"></a>01877             cpl_free(unit);
-<a name="l01878"></a>01878             cpl_free(label);
-<a name="l01879"></a>01879         }
-<a name="l01880"></a>01880 
-<a name="l01881"></a>01881         <span class="comment">/*</span>
-<a name="l01882"></a>01882 <span class="comment">         * These parameters are now useless, I set them to zero.</span>
-<a name="l01883"></a>01883 <span class="comment">         */</span>
-<a name="l01884"></a>01884 
-<a name="l01885"></a>01885         keyname = <span class="stringliteral">"QC.MOS.REFWAVE.MEAN"</span>;
-<a name="l01886"></a>01886 
-<a name="l01887"></a>01887         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, 0.0, keyname, <span class="stringliteral">"pixel"</span>, 
-<a name="l01888"></a>01888                 <span class="stringliteral">"MEAN of CCD positions of reference wavelength"</span>, instrume)) {
-<a name="l01889"></a>01889             vimos_calib_exit(<span class="stringliteral">"Cannot write QC.MOS.REFWAVE.MEAN to QC logfile"</span>);
-<a name="l01890"></a>01890         }
-<a name="l01891"></a>01891 
-<a name="l01892"></a>01892         keyname = <span class="stringliteral">"QC.MOS.REFWAVE.RMS"</span>;
-<a name="l01893"></a>01893 
-<a name="l01894"></a>01894         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, 0.0, keyname, <span class="stringliteral">"pixel"</span>, 
-<a name="l01895"></a>01895                 <span class="stringliteral">"RMS of CCD positions of reference wavelength"</span>, instrume)) {
-<a name="l01896"></a>01896             vimos_calib_exit(<span class="stringliteral">"Cannot write QC.MOS.REFWAVE.RMS to QC logfile"</span>);
-<a name="l01897"></a>01897         }
-<a name="l01898"></a>01898 
-<a name="l01899"></a>01899         <span class="keywordflow">if</span> (restab) {
-<a name="l01900"></a>01900 
-<a name="l01901"></a>01901             <span class="comment">/*</span>
-<a name="l01902"></a>01902 <span class="comment">             * About spectral resolution:</span>
-<a name="l01903"></a>01903 <span class="comment">             */</span>
-<a name="l01904"></a>01904 
-<a name="l01905"></a>01905             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION1.LAMBDA"</span>;
-<a name="l01906"></a>01906 
-<a name="l01907"></a>01907             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, lambdaRed, keyname, <span class="stringliteral">"Angstrom"</span>,
-<a name="l01908"></a>01908                 <span class="stringliteral">"Line used in spectral resolution determination"</span>, instrume)) {
-<a name="l01909"></a>01909                 vimos_calib_exit(<span class="stringliteral">"Cannot write arc line to QC log file"</span>);
-<a name="l01910"></a>01910             }
-<a name="l01911"></a>01911 
-<a name="l01912"></a>01912             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION1"</span>;
-<a name="l01913"></a>01913 
-<a name="l01914"></a>01914             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>, 
-<a name="l01915"></a>01915                                           CPL_GREATER_THAN, lambdaRed - 1.0);
-<a name="l01916"></a>01916             selected =
-<a name="l01917"></a>01917             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>, 
-<a name="l01918"></a>01918                                           CPL_LESS_THAN, lambdaRed + 1.0);
-<a name="l01919"></a>01919 
-<a name="l01920"></a>01920             <span class="keywordflow">if</span> (selected == 1) {
-<a name="l01921"></a>01921                 cpl_table *one_line = cpl_table_extract_selected(restab);
-<a name="l01922"></a>01922 
-<a name="l01923"></a>01923                 resol = cpl_table_get_double(one_line, 
-<a name="l01924"></a>01924                                              <span class="stringliteral">"resolution"</span>, 0, NULL);
-<a name="l01925"></a>01925                 resol_err = cpl_table_get_double(one_line, 
-<a name="l01926"></a>01926                                              <span class="stringliteral">"resolution_rms"</span>, 0, NULL);
-<a name="l01927"></a>01927 
-<a name="l01928"></a>01928                 cpl_table_delete(one_line);
-<a name="l01929"></a>01929             }
-<a name="l01930"></a>01930             <span class="keywordflow">else</span> {
-<a name="l01931"></a>01931                 resol = 0.0;
-<a name="l01932"></a>01932                 resol_err = 0.0;
-<a name="l01933"></a>01933             }
-<a name="l01934"></a>01934     
-<a name="l01935"></a>01935             cpl_table_select_all(restab);
-<a name="l01936"></a>01936     
-<a name="l01937"></a>01937             cpl_msg_info(recipe, <span class="stringliteral">"Spectral resolution at %.2f: %.2f +/- %.2f"</span>,
-<a name="l01938"></a>01938                          lambdaRed, resol, resol_err);
-<a name="l01939"></a>01939     
-<a name="l01940"></a>01940             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, resol, keyname, NULL,
-<a name="l01941"></a>01941                 <span class="stringliteral">"Mean spectral resolution at red end of spectrum"</span>, instrume)) {
-<a name="l01942"></a>01942                 vimos_calib_exit(<span class="stringliteral">"Cannot write spectral resolution "</span>
-<a name="l01943"></a>01943                                  <span class="stringliteral">"to QC log file"</span>);
-<a name="l01944"></a>01944             }
-<a name="l01945"></a>01945     
-<a name="l01946"></a>01946             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION1.RMS"</span>;
-<a name="l01947"></a>01947 
-<a name="l01948"></a>01948             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, resol_err, keyname, NULL,
-<a name="l01949"></a>01949                 <span class="stringliteral">"Error on mean spectral resolution"</span>, instrume)) {
-<a name="l01950"></a>01950                 vimos_calib_exit(<span class="stringliteral">"Cannot write error on resolution "</span>
-<a name="l01951"></a>01951                                  <span class="stringliteral">"to QC log file"</span>);
-<a name="l01952"></a>01952             }
-<a name="l01953"></a>01953 
-<a name="l01954"></a>01954             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION2.LAMBDA"</span>;
-<a name="l01955"></a>01955 
-<a name="l01956"></a>01956             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, lambdaYel, keyname, <span class="stringliteral">"Angstrom"</span>,
-<a name="l01957"></a>01957                 <span class="stringliteral">"Line used in spectral resolution determination"</span>, instrume)) {
-<a name="l01958"></a>01958                 vimos_calib_exit(<span class="stringliteral">"Cannot write arc line to QC log file"</span>);
-<a name="l01959"></a>01959             }
-<a name="l01960"></a>01960 
-<a name="l01961"></a>01961             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION2"</span>;
-<a name="l01962"></a>01962 
-<a name="l01963"></a>01963             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>,
-<a name="l01964"></a>01964                                           CPL_GREATER_THAN, lambdaYel - 1.0);
-<a name="l01965"></a>01965             selected =
-<a name="l01966"></a>01966             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>,
-<a name="l01967"></a>01967                                           CPL_LESS_THAN, lambdaYel + 1.0);
-<a name="l01968"></a>01968 
-<a name="l01969"></a>01969             <span class="keywordflow">if</span> (selected == 1) {
-<a name="l01970"></a>01970                 cpl_table *one_line = cpl_table_extract_selected(restab);
-<a name="l01971"></a>01971     
-<a name="l01972"></a>01972                 resol = cpl_table_get_double(one_line, 
-<a name="l01973"></a>01973                                              <span class="stringliteral">"resolution"</span>, 0, NULL);
-<a name="l01974"></a>01974                 resol_err = cpl_table_get_double(one_line, 
-<a name="l01975"></a>01975                                              <span class="stringliteral">"resolution_rms"</span>, 0, NULL);
-<a name="l01976"></a>01976 
-<a name="l01977"></a>01977                 cpl_table_delete(one_line);
-<a name="l01978"></a>01978             }
-<a name="l01979"></a>01979             <span class="keywordflow">else</span> {
-<a name="l01980"></a>01980                 resol = 0.0;
-<a name="l01981"></a>01981                 resol_err = 0.0;
-<a name="l01982"></a>01982             }
-<a name="l01983"></a>01983 
-<a name="l01984"></a>01984             cpl_table_select_all(restab);
-<a name="l01985"></a>01985     
-<a name="l01986"></a>01986             cpl_msg_info(recipe, <span class="stringliteral">"Spectral resolution at %.2f: %.2f +/- %.2f"</span>,
-<a name="l01987"></a>01987                          lambdaYel, resol, resol_err);
-<a name="l01988"></a>01988 
-<a name="l01989"></a>01989             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, resol, keyname, NULL,
-<a name="l01990"></a>01990                 <span class="stringliteral">"Mean spectral resolution at center of spectrum"</span>, instrume)) {
-<a name="l01991"></a>01991                 vimos_calib_exit(<span class="stringliteral">"Cannot write spectral resolution "</span>
-<a name="l01992"></a>01992                                  <span class="stringliteral">"to QC log file"</span>);
-<a name="l01993"></a>01993             }
-<a name="l01994"></a>01994 
-<a name="l01995"></a>01995             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION2.RMS"</span>;
-<a name="l01996"></a>01996 
-<a name="l01997"></a>01997             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, resol_err, keyname, NULL,
-<a name="l01998"></a>01998                 <span class="stringliteral">"Error on mean spectral resolution"</span>, instrume)) {
-<a name="l01999"></a>01999                 vimos_calib_exit(<span class="stringliteral">"Cannot write error on resolution "</span>
-<a name="l02000"></a>02000                                      <span class="stringliteral">"to QC log file"</span>);
-<a name="l02001"></a>02001             }
-<a name="l02002"></a>02002 
-<a name="l02003"></a>02003             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION3.LAMBDA"</span>;
-<a name="l02004"></a>02004 
-<a name="l02005"></a>02005             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, lambdaBlu, keyname, <span class="stringliteral">"Angstrom"</span>,
-<a name="l02006"></a>02006                 <span class="stringliteral">"Line used in spectral resolution determination"</span>, instrume)) {
-<a name="l02007"></a>02007                 vimos_calib_exit(<span class="stringliteral">"Cannot write arc line to QC log file"</span>);
-<a name="l02008"></a>02008             }
-<a name="l02009"></a>02009 
-<a name="l02010"></a>02010             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION3"</span>;
-<a name="l02011"></a>02011 
-<a name="l02012"></a>02012             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>,
-<a name="l02013"></a>02013                                           CPL_GREATER_THAN, lambdaBlu - 1.0);
-<a name="l02014"></a>02014             selected =
-<a name="l02015"></a>02015             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>,
-<a name="l02016"></a>02016                                           CPL_LESS_THAN, lambdaBlu + 1.0);
-<a name="l02017"></a>02017 
-<a name="l02018"></a>02018             <span class="keywordflow">if</span> (selected == 1) {
-<a name="l02019"></a>02019                 cpl_table *one_line = cpl_table_extract_selected(restab);
-<a name="l02020"></a>02020     
-<a name="l02021"></a>02021                 resol = cpl_table_get_double(one_line, 
-<a name="l02022"></a>02022                                              <span class="stringliteral">"resolution"</span>, 0, NULL);
-<a name="l02023"></a>02023                 resol_err = cpl_table_get_double(one_line, 
-<a name="l02024"></a>02024                                              <span class="stringliteral">"resolution_rms"</span>, 0, NULL);
-<a name="l02025"></a>02025     
-<a name="l02026"></a>02026                 cpl_table_delete(one_line);
-<a name="l02027"></a>02027             }
-<a name="l02028"></a>02028             <span class="keywordflow">else</span> {
-<a name="l02029"></a>02029                 resol = 0.0;
-<a name="l02030"></a>02030                 resol_err = 0.0;
-<a name="l02031"></a>02031             }
-<a name="l02032"></a>02032 
-<a name="l02033"></a>02033             cpl_table_select_all(restab);
-<a name="l02034"></a>02034 
-<a name="l02035"></a>02035             cpl_msg_info(recipe, <span class="stringliteral">"Spectral resolution at %.2f: %.2f +/- %.2f"</span>,
-<a name="l02036"></a>02036                          lambdaBlu, resol, resol_err);
-<a name="l02037"></a>02037 
-<a name="l02038"></a>02038             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, resol, keyname, NULL,
-<a name="l02039"></a>02039                 <span class="stringliteral">"Mean spectral resolution at blue end of spectrum"</span>, instrume)) {
-<a name="l02040"></a>02040                 vimos_calib_exit(<span class="stringliteral">"Cannot write spectral resolution "</span>
-<a name="l02041"></a>02041                                  <span class="stringliteral">"to QC log file"</span>);
-<a name="l02042"></a>02042             }
-<a name="l02043"></a>02043 
-<a name="l02044"></a>02044             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION3.RMS"</span>;
-<a name="l02045"></a>02045 
-<a name="l02046"></a>02046             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, resol_err, keyname, NULL,
-<a name="l02047"></a>02047                 <span class="stringliteral">"Error on mean spectral resolution"</span>, instrume)) {
-<a name="l02048"></a>02048                 vimos_calib_exit(<span class="stringliteral">"Cannot write error on resolution "</span>
-<a name="l02049"></a>02049                                  <span class="stringliteral">"to QC log file"</span>);
-<a name="l02050"></a>02050             }
-<a name="l02051"></a>02051 
-<a name="l02052"></a>02052             keyname = <span class="stringliteral">"QC.MOS.IDS.RMS"</span>;
-<a name="l02053"></a>02053 
-<a name="l02054"></a>02054             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(header, mean_rms, keyname, <span class="stringliteral">"pixel"</span>,
-<a name="l02055"></a>02055                 <span class="stringliteral">"Mean accuracy of dispersion solution"</span>, instrume)) {
-<a name="l02056"></a>02056                 vimos_calib_exit(<span class="stringliteral">"Cannot write mean accuracy of "</span>
-<a name="l02057"></a>02057                                  <span class="stringliteral">"dispersion solution to QC log file"</span>);
-<a name="l02058"></a>02058             }
-<a name="l02059"></a>02059         }
-<a name="l02060"></a>02060 
-<a name="l02061"></a>02061         <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l02062"></a>02062 
-<a name="l02063"></a>02063     }
-<a name="l02064"></a>02064 
-<a name="l02065"></a>02065     cpl_free(grism); grism = NULL;
-<a name="l02066"></a>02066     cpl_free(instrume); instrume = NULL;
-<a name="l02067"></a>02067     cpl_table_delete(restab); restab = NULL;
-<a name="l02068"></a>02068     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l02069"></a>02069     cpl_image_delete(spectra); spectra = NULL;
-<a name="l02070"></a>02070 
-<a name="l02071"></a>02071     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, rectified, reduced_lamp_tag, header,
-<a name="l02072"></a>02072                        parlist, recipe, version))
-<a name="l02073"></a>02073         vimos_calib_exit(NULL);
-<a name="l02074"></a>02074 
-<a name="l02075"></a>02075     cpl_image_delete(rectified); rectified = NULL;
-<a name="l02076"></a>02076     cpl_propertylist_delete(header); header = NULL;
-<a name="l02077"></a>02077 
-<a name="l02078"></a>02078     <span class="keywordflow">if</span> (check) {
-<a name="l02079"></a>02079         save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l02080"></a>02080 
-<a name="l02081"></a>02081         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l02082"></a>02082         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l02083"></a>02083         <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span>
-<a name="l02084"></a>02084         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, 1.0);
-<a name="l02085"></a>02085         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l02086"></a>02086         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l02087"></a>02087         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l02088"></a>02088         cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l02089"></a>02089         cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l02090"></a>02090 
-<a name="l02091"></a>02091         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, residual, disp_residuals_tag, save_header,
-<a name="l02092"></a>02092                            parlist, recipe, version))
-<a name="l02093"></a>02093             vimos_calib_exit(NULL);
-<a name="l02094"></a>02094 
-<a name="l02095"></a>02095         cpl_image_delete(residual); residual = NULL;
-<a name="l02096"></a>02096         cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l02097"></a>02097     }
-<a name="l02098"></a>02098 
-<a name="l02099"></a>02099     <span class="keywordflow">if</span> (!treat_as_lss) {
-<a name="l02100"></a>02100 
-<a name="l02101"></a>02101         <span class="comment">/*</span>
-<a name="l02102"></a>02102 <span class="comment">         * Wavemap was already produced if treat_as_lss = true</span>
-<a name="l02103"></a>02103 <span class="comment">         */</span>
-<a name="l02104"></a>02104 
-<a name="l02105"></a>02105         wavemap = <a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(coordinate, rainbow, slits, 
-<a name="l02106"></a>02106                                       polytraces, reference, 
-<a name="l02107"></a>02107                                       startwavelength, endwavelength, 
-<a name="l02108"></a>02108                                       dispersion);
-<a name="l02109"></a>02109 
-<a name="l02110"></a>02110         cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l02111"></a>02111     }
-<a name="l02112"></a>02112 
-<a name="l02113"></a>02113     save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, arc_tag, 0);
-<a name="l02114"></a>02114 
-<a name="l02115"></a>02115     cpl_image_turn(wavemap, rotate_back);
-<a name="l02116"></a>02116     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, wavemap, wavelength_map_tag, save_header,
-<a name="l02117"></a>02117                        parlist, recipe, version))
-<a name="l02118"></a>02118         vimos_calib_exit(NULL);
-<a name="l02119"></a>02119 
-<a name="l02120"></a>02120     cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l02121"></a>02121 
-<a name="l02122"></a>02122     cpl_image_turn(coordinate, rotate_back);
-<a name="l02123"></a>02123     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, coordinate, spatial_map_tag, save_header,
-<a name="l02124"></a>02124                        parlist, recipe, version))
-<a name="l02125"></a>02125         vimos_calib_exit(NULL);
-<a name="l02126"></a>02126 
-<a name="l02127"></a>02127     cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l02128"></a>02128     cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l02129"></a>02129 
-<a name="l02130"></a>02130     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, polytraces, curv_coeff_tag, NULL,
-<a name="l02131"></a>02131                        parlist, recipe, version))
-<a name="l02132"></a>02132         vimos_calib_exit(NULL);
-<a name="l02133"></a>02133 
-<a name="l02134"></a>02134     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l02135"></a>02135 
-<a name="l02136"></a>02136     <a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a>(slits, rotate, ccd_ysize, ccd_xsize);
-<a name="l02137"></a>02137     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,
-<a name="l02138"></a>02138                        parlist, recipe, version))
-<a name="l02139"></a>02139         vimos_calib_exit(NULL);
-<a name="l02140"></a>02140 
-<a name="l02141"></a>02141     cpl_table_delete(slits); slits = NULL;
-<a name="l02142"></a>02142 
-<a name="l02143"></a>02143     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l02144"></a>02144         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l02145"></a>02145         vimos_calib_exit(NULL);
-<a name="l02146"></a>02146     }
-<a name="l02147"></a>02147 
-<a name="l02148"></a>02148     <span class="keywordflow">return</span> 0;
-<a name="l02149"></a>02149 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/vimos__calib__impl_8c_source.html b/html/vimos__calib__impl_8c_source.html
new file mode 100644
index 0000000..564ae8e
--- /dev/null
+++ b/html/vimos__calib__impl_8c_source.html
@@ -0,0 +1,2195 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: vimos_calib_impl.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">vimos_calib_impl.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: vimos_calib_impl.c,v 1.5 2013-08-19 17:05:47 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-08-19 17:05:47 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.5 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <vimos_calib_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> </div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#define vimos_calib_exit(message)                     \</span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">{                                                     \</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">if (message !=NULL ) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">cpl_free(instrume);                                   \</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">cpl_free(pipefile);                                   \</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">cpl_free(fiterror);                                   \</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">cpl_free(fitlines);                                   \</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">cpl_image_delete(bias);                               \</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">cpl_image_delete(master_bias);                        \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">cpl_image_delete(coordinate);                         \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">cpl_image_delete(checkwave);                          \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">cpl_image_delete(flat);                               \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">cpl_image_delete(master_flat);                        \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">cpl_image_delete(norm_flat);                          \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">cpl_image_delete(rainbow);                            \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">cpl_image_delete(rectified);                          \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">cpl_image_delete(residual);                           \</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">cpl_image_delete(smo_flat);                           \</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">cpl_image_delete(spatial);                            \</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">cpl_image_delete(spectra);                            \</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">cpl_image_delete(wavemap);                            \</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">cpl_image_delete(delta);                              \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">cpl_mask_delete(refmask);                             \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">cpl_propertylist_delete(header);                      \</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">cpl_propertylist_delete(save_header);                 \</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">cpl_propertylist_delete(qclist);                      \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">cpl_table_delete(grism_table);                        \</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">cpl_table_delete(idscoeff);                           \</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">cpl_table_delete(restable);                           \</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">cpl_table_delete(maskslits);                          \</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">cpl_table_delete(overscans);                          \</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor">cpl_table_delete(traces);                             \</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">cpl_table_delete(polytraces);                         \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">cpl_table_delete(slits);                              \</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor">cpl_table_delete(restab);                             \</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="preprocessor">cpl_table_delete(global);                             \</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="preprocessor">cpl_table_delete(wavelengths);                        \</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="preprocessor">cpl_vector_delete(lines);                             \</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="preprocessor">cpl_msg_indent_less();                                \</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="preprocessor">return -1;                                            \</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="preprocessor">#define vimos_calib_exit_memcheck(message)          \</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="preprocessor">{                                                   \</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="preprocessor">if (message !=NULL ) cpl_msg_info(recipe, message); \</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="preprocessor">printf("free instrume (%p)\n", instrume);           \</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="preprocessor">cpl_free(instrume);                                 \</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="preprocessor">printf("free pipefile (%p)\n", pipefile);           \</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="preprocessor">cpl_free(pipefile);                                 \</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="preprocessor">printf("free fiterror (%p)\n", fiterror);           \</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="preprocessor">cpl_free(fiterror);                                 \</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="preprocessor">printf("free fitlines (%p)\n", fitlines);           \</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="preprocessor">cpl_free(fitlines);                                 \</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="preprocessor">printf("free bias (%p)\n", bias);                   \</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="preprocessor">cpl_image_delete(bias);                             \</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="preprocessor">printf("free master_bias (%p)\n", master_bias);     \</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="preprocessor">cpl_image_delete(master_bias);                      \</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="preprocessor">printf("free coordinate (%p)\n", coordinate);       \</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="preprocessor">cpl_image_delete(coordinate);                       \</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="preprocessor">printf("free checkwave (%p)\n", checkwave);         \</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="preprocessor">cpl_image_delete(checkwave);                        \</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="preprocessor">printf("free flat (%p)\n", flat);                   \</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="preprocessor">cpl_image_delete(flat);                             \</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="preprocessor">printf("free master_flat (%p)\n", master_flat);     \</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="preprocessor">cpl_image_delete(master_flat);                      \</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="preprocessor">printf("free norm_flat (%p)\n", norm_flat);         \</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="preprocessor">cpl_image_delete(norm_flat);                        \</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="preprocessor">printf("free rainbow (%p)\n", rainbow);             \</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="preprocessor">cpl_image_delete(rainbow);                          \</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="preprocessor">printf("free rectified (%p)\n", rectified);         \</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="preprocessor">cpl_image_delete(rectified);                        \</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="preprocessor">printf("free residual (%p)\n", residual);           \</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="preprocessor">cpl_image_delete(residual);                         \</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="preprocessor">printf("free smo_flat (%p)\n", smo_flat);           \</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="preprocessor">cpl_image_delete(smo_flat);                         \</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="preprocessor">printf("free spatial (%p)\n", spatial);             \</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="preprocessor">cpl_image_delete(spatial);                          \</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="preprocessor">printf("free spectra (%p)\n", spectra);             \</span></div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> <span class="preprocessor">cpl_image_delete(spectra);                          \</span></div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span> <span class="preprocessor">printf("free wavemap (%p)\n", wavemap);             \</span></div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span> <span class="preprocessor">cpl_image_delete(wavemap);                          \</span></div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span> <span class="preprocessor">printf("free delta (%p)\n", delta);                 \</span></div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span> <span class="preprocessor">cpl_image_delete(delta);                            \</span></div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span> <span class="preprocessor">printf("free refmask (%p)\n", refmask);             \</span></div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span> <span class="preprocessor">cpl_mask_delete(refmask);                           \</span></div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span> <span class="preprocessor">printf("free header (%p)\n", header);               \</span></div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span> <span class="preprocessor">cpl_propertylist_delete(header);                    \</span></div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span> <span class="preprocessor">printf("free save_header (%p)\n", save_header);     \</span></div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span> <span class="preprocessor">cpl_propertylist_delete(save_header);               \</span></div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span> <span class="preprocessor">printf("free qclist (%p)\n", qclist);               \</span></div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="preprocessor">cpl_propertylist_delete(qclist);                    \</span></div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> <span class="preprocessor">printf("free grism_table (%p)\n", grism_table);     \</span></div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> <span class="preprocessor">cpl_table_delete(grism_table);                      \</span></div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span> <span class="preprocessor">printf("free idscoeff (%p)\n", idscoeff);           \</span></div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> <span class="preprocessor">cpl_table_delete(idscoeff);                         \</span></div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span> <span class="preprocessor">printf("free restable (%p)\n", restable);           \</span></div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span> <span class="preprocessor">cpl_table_delete(restable);                         \</span></div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span> <span class="preprocessor">printf("free maskslits (%p)\n", maskslits);         \</span></div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span> <span class="preprocessor">cpl_table_delete(maskslits);                        \</span></div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span> <span class="preprocessor">printf("free overscans (%p)\n", overscans);         \</span></div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span> <span class="preprocessor">cpl_table_delete(overscans);                        \</span></div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span> <span class="preprocessor">printf("free traces (%p)\n", traces);               \</span></div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> <span class="preprocessor">cpl_table_delete(traces);                           \</span></div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span> <span class="preprocessor">printf("free polytraces (%p)\n", polytraces);       \</span></div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> <span class="preprocessor">cpl_table_delete(polytraces);                       \</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span> <span class="preprocessor">printf("free slits (%p)\n", slits);                 \</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span> <span class="preprocessor">cpl_table_delete(slits);                            \</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span> <span class="preprocessor">printf("free restab (%p)\n", restab);               \</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> <span class="preprocessor">cpl_table_delete(restab);                           \</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span> <span class="preprocessor">printf("free global (%p)\n", global);               \</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="preprocessor">cpl_table_delete(global);                           \</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="preprocessor">printf("free wavelengths (%p)\n", wavelengths);     \</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> <span class="preprocessor">cpl_table_delete(wavelengths);                      \</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span> <span class="preprocessor">printf("free lines (%p)\n", lines);                 \</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span> <span class="preprocessor">cpl_vector_delete(lines);                           \</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span> <span class="preprocessor">cpl_msg_indent_less();                              \</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span> <span class="preprocessor">return 0;                                           \</span></div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00174"></a><span class="lineno"><a class="code" href="group__vimos__calib__impl.html#gaff1b7bb1f87357c0ae0d3bd62c12b096">  174</a></span> <span class="keywordtype">int</span> <a class="code" href="group__vimos__calib__impl.html#gaff1b7bb1f87357c0ae0d3bd62c12b096" title="Interpret the command line options and execute the data processing.">vimos_calib_impl</a>(cpl_frameset *frameset, cpl_parameterlist *parlist)</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span> {</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"vimos_calib"</span>;</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> </div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordtype">double</span>      peakdetection;</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     <span class="keywordtype">int</span>         wdegree;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <span class="keywordtype">int</span>         wradius;</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="keywordtype">double</span>      wreject;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="keywordtype">int</span>         wmode;</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="keywordtype">int</span>         cdegree;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     <span class="keywordtype">int</span>         cmode;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordtype">int</span>         slit_ident;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     <span class="keywordtype">int</span>         sdegree;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="keywordtype">int</span>         ddegree;</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <span class="keywordtype">int</span>         sradius;</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <span class="keywordtype">int</span>         dradius;</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     <span class="keywordtype">int</span>         qc;</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="keywordtype">int</span>         check;</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span> </div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>     cpl_imagelist    *biases      = NULL;</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_image        *bias        = NULL;</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_image        *master_bias = NULL;</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     cpl_image        *multi_bias  = NULL;</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     cpl_image        *flat        = NULL;</div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     cpl_image        *master_flat = NULL;</div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span>     cpl_image        *smo_flat    = NULL;</div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span>     cpl_image        *norm_flat   = NULL;</div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     cpl_image        *spectra     = NULL;</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     cpl_image        *wavemap     = NULL;</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>     cpl_image        *delta       = NULL;</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     cpl_image        *residual    = NULL;</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>     cpl_image        *checkwave   = NULL;</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>     cpl_image        *rectified   = NULL;</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     cpl_image        *dummy       = NULL;</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_image        *refimage    = NULL;</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_image        *coordinate  = NULL;</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     cpl_image        *rainbow     = NULL;</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span>     cpl_image        *spatial     = NULL;</div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span> </div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>     cpl_mask         *refmask     = NULL;</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     cpl_table        *overscans   = NULL;</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>     cpl_table        *wavelengths = NULL;</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     cpl_table        *idscoeff    = NULL;</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>     cpl_table        *restable    = NULL;</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>     cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     cpl_table        *positions   = NULL;</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_table        *maskslits   = NULL;</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_table        *traces      = NULL;</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_table        *polytraces  = NULL;</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>     cpl_table        *restab      = NULL;</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     cpl_table        *global      = NULL;</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> </div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span>     cpl_vector       *lines       = NULL;</div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     cpl_propertylist *save_header = NULL;</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>     cpl_propertylist *qclist      = NULL;</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span> </div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>     cpl_table  *idscoeff_lss = NULL;</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *arc_tag;</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *flat_tag;</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_screen_flat_tag;</div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_norm_flat_tag;</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_lamp_tag;</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_residuals_tag;</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_tag;</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectra_detection_tag;</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *spectral_resolution_tag;</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_map_tag;</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_traces_tag;</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;</div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *spatial_map_tag;</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *global_distortion_tag = <span class="stringliteral">"GLOBAL_DISTORTION_TABLE"</span>;</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_residuals_table_tag;</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *delta_image_tag;</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_gris_name;</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_gris_id;</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_filt_name;</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_filt_id;</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_mask_id;</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     <span class="keywordtype">char</span>       *keyname;</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span>     <span class="keywordtype">int</span>         quadrant;</div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="keywordtype">int</span>         mos;</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>     <span class="keywordtype">int</span>         treat_as_lss = 0;</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>     <span class="keywordtype">int</span>         nslits;</div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>     <span class="keywordtype">double</span>     *xpos;</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     <span class="keywordtype">double</span>      mean_rms;</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>     <span class="keywordtype">double</span>      alltime, arctime;</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>     <span class="keywordtype">int</span>         nflats;</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordtype">int</span>         nbias;</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     <span class="keywordtype">int</span>         nlines;</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     <span class="keywordtype">double</span>     *line;</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     <span class="keywordtype">double</span>     *fiterror = NULL;</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>     <span class="keywordtype">int</span>        *fitlines = NULL;</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     <span class="keywordtype">double</span>      gain;</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>     <span class="keywordtype">int</span>         ccd_xsize, ccd_ysize;</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span>     <span class="keywordtype">int</span>         rotate = 1;</div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     <span class="keywordtype">int</span>         rotate_back = -1;</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span> </div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>     <span class="keywordtype">char</span>       *pipefile = NULL;</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     <span class="keywordtype">char</span>       *grism;</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span> </div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span> </div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span> </div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span> </div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span> </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span>         vimos_calib_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);</div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span> </div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> </div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>                     <span class="stringliteral">"fors.vimos_calib.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span> </div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>         vimos_calib_exit(<span class="stringliteral">"Invalid spectral dispersion value"</span>);</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span> </div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     peakdetection = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>                     <span class="stringliteral">"fors.vimos_calib.peakdetection"</span>, grism_table);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     <span class="keywordflow">if</span> (peakdetection <= 0.0)</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>         vimos_calib_exit(<span class="stringliteral">"Invalid peak detection level"</span>);</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span> </div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     wdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span>                     <span class="stringliteral">"fors.vimos_calib.wdegree"</span>, grism_table);</div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     <span class="keywordflow">if</span> (wdegree < 1)</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>         vimos_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span> </div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     <span class="keywordflow">if</span> (wdegree > 5)</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>         vimos_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span> </div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     wradius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.wradius"</span>, NULL);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span> </div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     <span class="keywordflow">if</span> (wradius < 0)</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>         vimos_calib_exit(<span class="stringliteral">"Invalid search radius"</span>);</div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> </div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>     wreject = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span>                                        <span class="stringliteral">"fors.vimos_calib.wreject"</span>, NULL);</div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span> </div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>     <span class="keywordflow">if</span> (wreject <= 0.0)</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>         vimos_calib_exit(<span class="stringliteral">"Invalid rejection threshold"</span>);</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span> </div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>     wmode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.wmode"</span>, NULL);</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span> </div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     <span class="keywordflow">if</span> (wmode < 0 || wmode > 2)</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>         vimos_calib_exit(<span class="stringliteral">"Invalid wavelength solution interpolation mode"</span>);</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span> </div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>                                        <span class="stringliteral">"fors.vimos_calib.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> </div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     cdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>                     <span class="stringliteral">"fors.vimos_calib.cdegree"</span>, grism_table);</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span> </div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>     <span class="keywordflow">if</span> (cdegree < 1)</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>         vimos_calib_exit(<span class="stringliteral">"Invalid polynomial degree"</span>);</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span> </div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>     <span class="keywordflow">if</span> (cdegree > 5)</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>         vimos_calib_exit(<span class="stringliteral">"Max allowed polynomial degree is 5"</span>);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     cmode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.cmode"</span>, NULL);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span> </div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     <span class="keywordflow">if</span> (cmode < 0 || cmode > 2)</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>         vimos_calib_exit(<span class="stringliteral">"Invalid curvature solution interpolation mode"</span>);</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> </div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>                     <span class="stringliteral">"fors.vimos_calib.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>         <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>             vimos_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span> </div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>                     <span class="stringliteral">"fors.vimos_calib.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     <span class="keywordflow">if</span> (endwavelength > 1.0) {</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>         <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>             vimos_calib_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span>         <span class="keywordflow">if</span> (startwavelength < 1.0)</div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>             vimos_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>     }</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     <span class="keywordflow">if</span> (startwavelength > 1.0)</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>         <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>             vimos_calib_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     reference = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                 <span class="stringliteral">"fors.vimos_calib.reference"</span>, grism_table);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span> </div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     <span class="keywordflow">if</span> (reference < startwavelength || reference > endwavelength)</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>         vimos_calib_exit(<span class="stringliteral">"Invalid reference wavelength"</span>);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span> </div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     slit_ident = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>                     <span class="stringliteral">"fors.vimos_calib.slit_ident"</span>, NULL);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span> </div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span>     sdegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.sdegree"</span>, NULL);</div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     ddegree = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.ddegree"</span>, NULL);</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>     sradius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.sradius"</span>, NULL);</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     dradius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_calib.dradius"</span>, NULL);</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span> </div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>     <span class="keywordflow">if</span> (sradius < 1 || dradius < 1)</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         vimos_calib_exit(<span class="stringliteral">"Invalid smoothing box radius"</span>);</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span> </div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>     qc = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_calib.qc"</span>, NULL);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span> </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     check = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_calib.check"</span>, NULL);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span> </div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> </div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>         vimos_calib_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> </div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span> </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span> <span class="comment">     * Check input set-of-frames</span></div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO OCS CON QUAD"</span>)) </div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>         vimos_calib_exit(<span class="stringliteral">"Input frames are not from the same quadrant"</span>);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> </div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MOS_ARC_SPECTRUM"</span>);</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keywordflow">if</span> (mos == 0)</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>         vimos_calib_exit(<span class="stringliteral">"Missing input arc lamp frame"</span>);</div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span> </div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>     <span class="keywordflow">if</span> (mos > 1)</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>         vimos_calib_exit(<span class="stringliteral">"Just one input arc lamp frame is allowed"</span>); </div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span> </div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     arc_tag                  = <span class="stringliteral">"MOS_ARC_SPECTRUM"</span>;</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     flat_tag                 = <span class="stringliteral">"MOS_SCREEN_FLAT"</span>;</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>     master_screen_flat_tag   = <span class="stringliteral">"MOS_COMBINED_SCREEN_FLAT"</span>;</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>     master_norm_flat_tag     = <span class="stringliteral">"MOS_MASTER_SCREEN_FLAT"</span>;</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     reduced_lamp_tag         = <span class="stringliteral">"MOS_ARC_SPECTRUM_EXTRACTED"</span>;</div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>     disp_residuals_tag       = <span class="stringliteral">"MOS_DISP_RESIDUALS"</span>;</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>     disp_coeff_tag           = <span class="stringliteral">"MOS_DISP_COEFF"</span>;</div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>     wavelength_map_tag       = <span class="stringliteral">"MOS_WAVELENGTH_MAP"</span>;</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     spectra_detection_tag    = <span class="stringliteral">"MOS_SPECTRA_DETECTION"</span>;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>     spectral_resolution_tag  = <span class="stringliteral">"MOS_SPECTRAL_RESOLUTION"</span>;</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>     slit_map_tag             = <span class="stringliteral">"MOS_SLIT_MAP"</span>;</div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>     curv_traces_tag          = <span class="stringliteral">"MOS_CURV_TRACES"</span>;</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>     curv_coeff_tag           = <span class="stringliteral">"MOS_CURV_COEFF"</span>;</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>     spatial_map_tag          = <span class="stringliteral">"MOS_SPATIAL_MAP"</span>;</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     slit_location_tag        = <span class="stringliteral">"MOS_SLIT_LOCATION"</span>;</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     disp_residuals_table_tag = <span class="stringliteral">"MOS_DISP_RESIDUALS_TABLE"</span>;</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     delta_image_tag          = <span class="stringliteral">"MOS_DELTA_IMAGE"</span>;</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>     nbias = 0;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0) {</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"BIAS"</span>) == 0)</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span>             vimos_calib_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS or BIAS"</span>);</div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>         nbias = cpl_frameset_count_tags(frameset, <span class="stringliteral">"BIAS"</span>);</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     }</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)</div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>         vimos_calib_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> </div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"LINE_CATALOG"</span>) == 0)</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>         vimos_calib_exit(<span class="stringliteral">"Missing required input: LINE_CATALOG"</span>);</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> </div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"LINE_CATALOG"</span>) > 1)</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>         vimos_calib_exit(<span class="stringliteral">"Too many in input: LINE_CATALOG"</span>);</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span> </div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>     nflats = cpl_frameset_count_tags(frameset, flat_tag);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="keywordflow">if</span> (nflats < 1) {</div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, flat_tag);</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>     }</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span>     <span class="keywordflow">if</span> (nflats > 1)</div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load %d flat field frames and sum them..."</span>,</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span>                      nflats);</div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load flat field exposure..."</span>);</div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span> </div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span> </div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, flat_tag, 0);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span> </div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>         vimos_calib_exit(<span class="stringliteral">"Cannot load flat field frame header"</span>);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span> </div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     alltime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span> </div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>         vimos_calib_exit(<span class="stringliteral">"Missing keyword EXPTIME in flat field frame header"</span>);</div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> </div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span>     cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span> </div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span> </div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> </div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>             vimos_calib_exit(<span class="stringliteral">"Cannot load flat field frame header"</span>);</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span> </div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>         alltime += cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span> </div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>             vimos_calib_exit(<span class="stringliteral">"Missing keyword EXPTIME in flat field "</span></div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>                             <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span> </div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>         cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span> </div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>     }</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span> </div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>     master_flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, flat_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span> </div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>     <span class="keywordflow">if</span> (master_flat == NULL)</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span>         vimos_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);</div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span> </div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>     <span class="keywordflow">for</span> (i = 1; i < nflats; i++) {</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>         flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>         <span class="keywordflow">if</span> (flat) {</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>             cpl_image_add(master_flat, flat);</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>             cpl_image_delete(flat); flat = NULL;</div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>         }</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>             vimos_calib_exit(<span class="stringliteral">"Cannot load flat field"</span>);</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>     }</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span> </div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> <span class="comment">     * Get some info from arc lamp header</span></div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span> </div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>         vimos_calib_exit(<span class="stringliteral">"Cannot load arc lamp header"</span>);</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span> </div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>     instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span>     <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>         vimos_calib_exit(<span class="stringliteral">"Missing keyword INSTRUME in arc lamp header"</span>);</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     instrume = cpl_strdup(instrume);</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span> </div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     arctime = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span> </div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     quadrant = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO OCS CON QUAD"</span>);</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span> </div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     <span class="keywordflow">switch</span> (quadrant) {</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     <span class="keywordflow">case</span> 1:</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>         key_gris_name = <span class="stringliteral">"ESO INS GRIS1 NAME"</span>;</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>         key_gris_id = <span class="stringliteral">"ESO INS GRIS1 ID"</span>;</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>         key_filt_name = <span class="stringliteral">"ESO INS FILT1 NAME"</span>;</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span>         key_filt_id = <span class="stringliteral">"ESO INS FILT1 ID"</span>;</div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         key_mask_id = <span class="stringliteral">"ESO INS MASK1 ID"</span>;</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span>     <span class="keywordflow">case</span> 2:</div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>         key_gris_name = <span class="stringliteral">"ESO INS GRIS2 NAME"</span>;</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span>         key_gris_id = <span class="stringliteral">"ESO INS GRIS2 ID"</span>;</div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         key_filt_name = <span class="stringliteral">"ESO INS FILT2 NAME"</span>;</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>         key_filt_id = <span class="stringliteral">"ESO INS FILT2 ID"</span>;</div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>         key_mask_id = <span class="stringliteral">"ESO INS MASK2 ID"</span>;</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>     <span class="keywordflow">case</span> 3:</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>         key_gris_name = <span class="stringliteral">"ESO INS GRIS3 NAME"</span>;</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>         key_gris_id = <span class="stringliteral">"ESO INS GRIS3 ID"</span>;</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>         key_filt_name = <span class="stringliteral">"ESO INS FILT3 NAME"</span>;</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>         key_filt_id = <span class="stringliteral">"ESO INS FILT3 ID"</span>;</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>         key_mask_id = <span class="stringliteral">"ESO INS MASK3 ID"</span>;</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>     <span class="keywordflow">case</span> 4:</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>         key_gris_name = <span class="stringliteral">"ESO INS GRIS4 NAME"</span>;</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         key_gris_id = <span class="stringliteral">"ESO INS GRIS4 ID"</span>;</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>         key_filt_name = <span class="stringliteral">"ESO INS FILT4 NAME"</span>;</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         key_filt_id = <span class="stringliteral">"ESO INS FILT4 ID"</span>;</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>         key_mask_id = <span class="stringliteral">"ESO INS MASK4 ID"</span>;</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>     }</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span> </div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>     grism = cpl_strdup(cpl_propertylist_get_string(header, key_gris_name));</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span> </div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>         vimos_calib_exit(<span class="stringliteral">"Missing keyword ESO INS GRISn NAME in arc lamp "</span></div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>                          <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span> </div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>     cpl_msg_info(recipe, <span class="stringliteral">"The grism is: %s"</span>, grism);</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span> </div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span> <span class="comment">    if (!dfs_equal_keyword(frameset, key_gris_id))</span></div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> <span class="comment">        vimos_calib_exit("Input frames are not from the same grism");</span></div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> <span class="comment"></span></div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span> <span class="comment">    if (!dfs_equal_keyword(frameset, key_filt_id))</span></div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span> <span class="comment">        vimos_calib_exit("Input frames are not from the same filter");</span></div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> </div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         vimos_calib_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in arc lamp "</span></div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>                         <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span> </div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span> </div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     cpl_msg_info(recipe, <span class="stringliteral">"Produce mask slit position table..."</span>);</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span> </div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>     maskslits = <a class="code" href="group__moses.html#ga3946bc30280b3b041a20ae9c9326f827" title="Create slit location table from FITS header of VIMOS data.">mos_load_slits_vimos</a>(header);</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span> </div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span> <span class="comment">     * Check if all slits have the same X offset: in such case, </span></div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span> <span class="comment">     * treat the observation as a long-slit one!</span></div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span> </div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>     mxpos = cpl_table_get_column_median(maskslits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>     xpos = cpl_table_get_data_double(maskslits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>     nslits = cpl_table_get_nrow(maskslits);</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span> </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>     treat_as_lss = 1;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>     <span class="keywordflow">for</span> (i = 0; i < nslits; i++) {</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         <span class="keywordflow">if</span> (fabs(mxpos-xpos[i]) > 0.01) {</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>             treat_as_lss = 0;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>             <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>         }</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>     }</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span> </div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>         cpl_msg_warning(recipe, <span class="stringliteral">"All MOS slits have the same offset: %.2f\n"</span></div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>                         <span class="stringliteral">"The long-slit data reduction strategy is applied!"</span>, </div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>                         mxpos);</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     }</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span> </div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>     <span class="keywordflow">if</span> (slit_ident == 0) {</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span>     }</div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> </div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>     <span class="comment">/* Leave the header on for the next step... */</span></div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> </div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> </div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span> <span class="comment">     * Remove the master bias</span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> </div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>     <span class="keywordflow">if</span> (nbias) {</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> </div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span> <span class="comment">         * Set of raw BIASes in input, need to create master bias!</span></div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span> </div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>         cpl_msg_info(recipe, <span class="stringliteral">"Generate the master from input raw biases..."</span>);</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span> </div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span>         <span class="keywordflow">if</span> (nbias > 1) {</div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span> </div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>             biases = cpl_imagelist_new();</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span> </div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>             bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"BIAS"</span>, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>     </div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>             <span class="keywordflow">if</span> (bias == NULL)</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot load bias frame"</span>);</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> </div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>             cpl_imagelist_set(biases, bias, 0); bias = NULL;</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>     </div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>             <span class="keywordflow">for</span> (i = 1; i < nbias; i++) {</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>                 bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>                 <span class="keywordflow">if</span> (bias) {</div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>                     cpl_imagelist_set(biases, bias, i); bias = NULL;</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>                 }</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>                 <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>                     vimos_calib_exit(<span class="stringliteral">"Cannot load bias frame"</span>);</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>             }</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>     </div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>             master_bias = cpl_imagelist_collapse_median_create(biases);</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> </div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>             cpl_imagelist_delete(biases);</div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>         }</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span>             master_bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"BIAS"</span>, </div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>                                          CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> </div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     }</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>         master_bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, </div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>                                      CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>         <span class="keywordflow">if</span> (master_bias == NULL)</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>             vimos_calib_exit(<span class="stringliteral">"Cannot load master bias"</span>);</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     }</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span> </div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span> </div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     overscans = <a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(header, 1);</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span> </div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     <span class="keywordflow">if</span> (nbias) {</div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>         <span class="keywordtype">int</span> xlow = cpl_table_get_int(overscans, <span class="stringliteral">"xlow"</span>, 0, NULL);</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>         <span class="keywordtype">int</span> ylow = cpl_table_get_int(overscans, <span class="stringliteral">"ylow"</span>, 0, NULL);</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>         <span class="keywordtype">int</span> xhig = cpl_table_get_int(overscans, <span class="stringliteral">"xhig"</span>, 0, NULL);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>         <span class="keywordtype">int</span> yhig = cpl_table_get_int(overscans, <span class="stringliteral">"yhig"</span>, 0, NULL);</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>         dummy = cpl_image_extract(master_bias, xlow+1, ylow+1, xhig, yhig);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>         cpl_image_delete(master_bias); master_bias = dummy;</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> </div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, master_bias, <span class="stringliteral">"MASTER_BIAS"</span>,</div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>                            NULL, parlist, recipe, version))</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>             vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>     }</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span> </div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>     <span class="keywordflow">if</span> (nflats > 1) {</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>         multi_bias = cpl_image_multiply_scalar_create(master_bias, nflats);</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>         dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(master_flat, multi_bias, overscans);</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>         cpl_image_delete(multi_bias);</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span>     }</div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>         dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(master_flat, master_bias, overscans);</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>     }</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>     cpl_image_delete(master_flat);</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>     master_flat = dummy;</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span> </div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>     <span class="keywordflow">if</span> (master_flat == NULL)</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>         vimos_calib_exit(<span class="stringliteral">"Cannot remove bias from flat field"</span>);</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span> </div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load arc lamp exposure..."</span>);</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> </div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>     spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, arc_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span> </div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>         vimos_calib_exit(<span class="stringliteral">"Cannot load arc lamp exposure"</span>);</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span>     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);</div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span> </div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span>     dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(spectra, master_bias, overscans);</div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span>     cpl_table_delete(overscans); overscans = NULL;</div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     cpl_image_delete(master_bias); master_bias = NULL;</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>     cpl_image_delete(spectra); spectra = dummy;</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span> </div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>         vimos_calib_exit(<span class="stringliteral">"Cannot remove bias from arc lamp exposure"</span>);</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span> </div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load input line catalog..."</span>);</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span> </div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>     wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"LINE_CATALOG"</span>, 1);</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span> </div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>     <span class="keywordflow">if</span> (wavelengths == NULL)</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>         vimos_calib_exit(<span class="stringliteral">"Cannot load line catalog"</span>);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span> </div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span> </div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span> <span class="comment">     * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span> </div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>     nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span> </div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>     <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>         vimos_calib_exit(<span class="stringliteral">"Empty input line catalog"</span>);</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span> </div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>     <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line catalog table"</span>,</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>                       wcolumn);</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>     }</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span> </div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span>     line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     </div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>     <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>         line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span> </div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>     cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> </div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>     lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span> </div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> </div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span> <span class="comment">     * Rotate frames horizontally with red to the right</span></div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> </div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span>     cpl_image_turn(spectra, rotate);</div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     cpl_image_turn(master_flat, rotate);</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> </div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     ccd_xsize = nx = cpl_image_get_size_x(spectra);      <span class="comment">// added...</span></div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>     ccd_ysize = ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span> </div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> </div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span> <span class="comment">         * In the case of LSS data, find first a "one slit"</span></div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> <span class="comment">         * solution. This will be later on split into many-slits</span></div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span> <span class="comment">         * solutions. This is done for greater accuracy.</span></div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> </div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>         cpl_msg_info(recipe, <span class="stringliteral">"Perform wavelength calibration..."</span>);</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span> </div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>         wavemap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>         <span class="keywordflow">if</span> (check)</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>             residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span> </div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>         fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span>         fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         idscoeff = cpl_table_new(ny);</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>         refmask  = cpl_mask_new(nx, ny);</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span> </div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#ga854ead782f62a6929aade44b267353e0" title="Process saturation.">mos_saturation_process</a>(spectra))</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span>         vimos_calib_exit(<span class="stringliteral">"Cannot process saturation"</span>);</div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span> </div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>     <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0" title="Subtract the background.">mos_subtract_background</a>(spectra))</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>         vimos_calib_exit(<span class="stringliteral">"Cannot subtract the background"</span>);</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span> </div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>         rectified = <a class="code" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion,</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>                                                    peakdetection, wradius,</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>                                                    wdegree, wreject, reference,</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>                                                    &startwavelength, </div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>                                                    &endwavelength, fitlines, </div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>                                                    fiterror, idscoeff, wavemap,</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>                                                    residual, NULL, refmask);</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span> </div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>         <span class="keywordflow">if</span> (rectified == NULL)</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>             vimos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span> </div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>         <span class="keywordflow">if</span> (!cpl_table_has_valid(idscoeff, <span class="stringliteral">"c0"</span>))</div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>             vimos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span> </div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span> <span class="comment">         * This is necessary to move on to a many-slits solution</span></div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span> </div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>         <a class="code" href="group__moses.html#gae623b8129e3fd33516f32d866c5106a8" title="Reconstruct the gaps required for slit location.">mos_refmask_find_gaps</a>(refmask, master_flat, 1000.);</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span> </div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>         <span class="keywordflow">if</span> (wmode) {</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>             cpl_image_delete(rectified); rectified = NULL;</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>             cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>             <a class="code" href="group__moses.html#gac1680aed5b6d5ebf32f6aa3e74f18ad4" title="Interpolate LSS wavelength calibration.">mos_interpolate_wavecalib</a>(idscoeff, wavemap, wmode);</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>             wavemap = <a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(idscoeff, nx, reference,</div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>                                        startwavelength, endwavelength);</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>             rectified = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(spectra, reference,</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>                                                    startwavelength, </div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>                                                    endwavelength, dispersion, </div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>                                                    idscoeff, 0);</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>         }</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span> </div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>         cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;</div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>         cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>         cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;</div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> </div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i++)</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>             <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>                 cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span> </div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>         slit_ident = 0;</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>         idscoeff_lss = idscoeff;</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span> </div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>     }</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span> </div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span> <span class="comment">         * Here the generic MOS calibration is carried out.</span></div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span> </div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span> <span class="comment">         * Detecting spectra on the CCD</span></div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span> </div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>         cpl_msg_info(recipe, <span class="stringliteral">"Detecting spectra on CCD..."</span>);</div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span> </div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>         ccd_xsize = nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>         ccd_ysize = ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span> </div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>         refmask = cpl_mask_new(nx, ny);</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span> </div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#ga854ead782f62a6929aade44b267353e0" title="Process saturation.">mos_saturation_process</a>(spectra))</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>         vimos_calib_exit(<span class="stringliteral">"Cannot process saturation"</span>);</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span> </div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>         <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gad122076cab5a9b361c652f5c3321ddf0" title="Subtract the background.">mos_subtract_background</a>(spectra))</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>         vimos_calib_exit(<span class="stringliteral">"Cannot subtract the background"</span>);</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span> </div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>         checkwave = <a class="code" href="group__moses.html#ga5587125256b4586cee2d1280d7d7c10d" title="Derive wavelength calibration from a raw arc lamp or sky exposure.">mos_wavelength_calibration_raw</a>(spectra, lines, dispersion, </div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span>                                                    peakdetection, wradius, </div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>                                                    wdegree, wreject, reference,</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>                                                    &startwavelength, </div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>                                                    &endwavelength,</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>                                                    NULL, NULL, NULL, NULL, </div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>                                                    NULL, NULL, refmask);</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span> </div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>         <span class="keywordflow">if</span> (checkwave == NULL)</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>             vimos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span> </div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span> <span class="comment">         * Save check image to disk</span></div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span> </div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>         header = cpl_propertylist_new();</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>                                        startwavelength + dispersion/2);</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>         <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span> <span class="comment">        cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span> </div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>         <span class="keywordflow">if</span> (check) {</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, checkwave, spectra_detection_tag, </div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>                                header, parlist, recipe, version))</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span>                 vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>         }</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span> </div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>         cpl_image_delete(checkwave); checkwave = NULL;</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span> </div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>     }</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span> </div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span>     cpl_msg_info(recipe, <span class="stringliteral">"Locate slits at reference wavelength on CCD..."</span>);</div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>     slits = <a class="code" href="group__moses.html#ga4e3f1760e6a202108d47c9ef977aa900" title="Find the location of detected spectra on the CCD.">mos_locate_spectra</a>(refmask);</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span> </div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>     <span class="keywordflow">if</span> (!slits) {</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span>         vimos_calib_exit(<span class="stringliteral">"No slits could be detected!"</span>);</div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>     }</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span> </div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>     refimage = cpl_image_new_from_mask(refmask);</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>     cpl_mask_delete(refmask); refmask = NULL;</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span> </div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>     <span class="keywordflow">if</span> (check) {</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>         save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>         cpl_image_turn(refimage, rotate_back);</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, refimage, slit_map_tag, NULL,</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>             vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>         cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>     }</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span> </div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>     cpl_image_delete(refimage); refimage = NULL;</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span> </div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>     <span class="keywordflow">if</span> (slit_ident) {</div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span> </div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span> <span class="comment">         * Attempt slit identification: this recipe may continue even</span></div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span> <span class="comment">         * in case of failed identification (i.e., the position table is </span></div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span> <span class="comment">         * not produced, but an error is not set). In case of failure,</span></div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span> <span class="comment">         * the spectra would be still extracted, even if they would not</span></div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span> <span class="comment">         * be associated to slits on the mask.</span></div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span> <span class="comment">         * </span></div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span> <span class="comment">         * The reason for making the slit identification an user option </span></div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span> <span class="comment">         * (via the parameter slit_ident) is to offer the possibility </span></div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span> <span class="comment">         * to avoid identifications that are only apparently successful, </span></div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span> <span class="comment">         * as it would happen in the case of an incorrect slit description </span></div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span> <span class="comment">         * in the data header.</span></div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span> </div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>         cpl_msg_info(recipe, <span class="stringliteral">"Attempt slit identification (optional)..."</span>);</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span> </div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>         <a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f" title="Rotate a slit location table.">mos_rotate_slits</a>(maskslits, -rotate, 0, 0);</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>         positions = <a class="code" href="group__moses.html#gaa8023ee69b6004f39e3df20e9bd94364" title="Identify slits listed in a slit location table.">mos_identify_slits</a>(slits, maskslits, NULL);</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span> </div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>         <span class="keywordflow">if</span> (positions) {</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>             cpl_table_delete(slits);</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>             slits = positions;</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span> </div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span> <span class="comment">             * Eliminate slits which are _entirely_ outside the CCD</span></div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span> </div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>             cpl_table_and_selected_double(slits, </div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span>                                           <span class="stringliteral">"ybottom"</span>, CPL_GREATER_THAN, ny-1);</div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>             cpl_table_or_selected_double(slits, </div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>                                           <span class="stringliteral">"ytop"</span>, CPL_LESS_THAN, 0);</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>             cpl_table_erase_selected(slits);</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span> </div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>             nslits = cpl_table_get_nrow(slits);</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span> </div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>             <span class="keywordflow">if</span> (nslits == 0)</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span>                 vimos_calib_exit(<span class="stringliteral">"No slits found on the CCD"</span>);</div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span> </div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>             cpl_msg_info(recipe, <span class="stringliteral">"%d slits are entirely or partially "</span></div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>                          <span class="stringliteral">"contained in CCD"</span>, nslits);</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span> </div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>         }</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>             slit_ident = 0;</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>             cpl_msg_info(recipe, <span class="stringliteral">"Global distortion model cannot be computed"</span>);</div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>                 vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>             }</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>         }</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>     }</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span> </div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span> </div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span> <span class="comment">     * Determination of spectral curvature</span></div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span> </div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>     cpl_msg_info(recipe, <span class="stringliteral">"Determining spectral curvature..."</span>);</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span> </div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>     cpl_msg_info(recipe, <span class="stringliteral">"Tracing master flat field spectra edges..."</span>);</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>     traces = <a class="code" href="group__moses.html#gaad02c30291fd30d07156ac8f397f439f" title="Trace flat field spectra.">mos_trace_flat</a>(master_flat, slits, reference, </div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>                             startwavelength, endwavelength, dispersion);</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span> </div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>     <span class="keywordflow">if</span> (!traces)</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>         vimos_calib_exit(<span class="stringliteral">"Tracing failure"</span>);</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span> </div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>     cpl_msg_info(recipe, <span class="stringliteral">"Fitting flat field spectra edges..."</span>);</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>     polytraces = <a class="code" href="group__moses.html#ga7518d66581d93ab64704fcf90996296b" title="Fit spectral traces.">mos_poly_trace</a>(slits, traces, cdegree);</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span> </div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>     <span class="keywordflow">if</span> (!polytraces)</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>         vimos_calib_exit(<span class="stringliteral">"Trace fitting failure"</span>);</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span> </div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>     <span class="keywordflow">if</span> (cmode) {</div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>         cpl_msg_info(recipe, <span class="stringliteral">"Computing global spectral curvature model..."</span>);</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>         <a class="code" href="group__moses.html#ga0eda8a5abf396113ffbe66607fd72fe6" title="Recompute tracing coefficients globally.">mos_global_trace</a>(slits, polytraces, cmode);</div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>     }</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span> </div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, traces, curv_traces_tag, NULL, parlist,</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>                        recipe, version))</div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span> </div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>     cpl_table_delete(traces); traces = NULL;</div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span> </div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>     spatial = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, reference, </div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>                                       startwavelength, endwavelength, </div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>                                       dispersion, 0, coordinate);</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span> </div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span> <span class="comment">//    if (!slit_ident) {</span></div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span> <span class="comment">//        cpl_image_delete(spectra); spectra = NULL;</span></div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span> <span class="comment">//    }</span></div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span> </div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span> <span class="comment">     * Flat field normalisation is done directly on the master flat</span></div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span> <span class="comment">     * field (without spatial rectification first). The spectral</span></div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span> <span class="comment">     * curvature model may be provided in input, in future releases.</span></div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span> </div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>     cpl_msg_info(recipe, <span class="stringliteral">"Perform flat field normalisation..."</span>);</div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span> </div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>     norm_flat = cpl_image_duplicate(master_flat);</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span> </div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>     smo_flat = <a class="code" href="group__moses.html#ga6b94ed200f4b1b8e281417a80b9aa4b5" title="Normalise a flat field exposure.">mos_normalise_flat</a>(norm_flat, coordinate, slits, polytraces, </div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>                                   reference, startwavelength, endwavelength,</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>                                   dispersion, dradius, ddegree);</div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span> </div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>     cpl_image_delete(smo_flat); smo_flat = NULL;  <span class="comment">/* It may be a product */</span></div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>  </div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>     save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, flat_tag, 0);</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>     cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, nflats);</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span> </div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>     cpl_image_turn(norm_flat, rotate_back);</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span> </div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, norm_flat, master_norm_flat_tag,</div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>                        save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span> </div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>     cpl_image_delete(norm_flat); norm_flat = NULL;</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span> </div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span> </div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span> <span class="comment">     * QC parameters for flat</span></div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span> </div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>     <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>         <span class="keywordtype">double</span>     scale;</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>         <span class="keywordtype">double</span>     slit_width;</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>         <span class="keywordtype">double</span>     flux, flux_err;</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>         <span class="keywordtype">int</span>        cslit = <a class="code" href="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31" title="Return slit closest to CCD center.">mos_slit_closest_to_center</a>(slits, nx, ny);</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span> </div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span> </div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span> <span class="comment">         * Refresh base property list, because previous saving </span></div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span> <span class="comment">         * modified it - e.g., the keyword ARCFILE is missing</span></div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span> </div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>         cpl_propertylist_delete(save_header);</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>         save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, flat_tag, 0);</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>         cpl_propertylist_update_int(save_header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, nflats);</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span> </div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span> </div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span> <span class="comment">         * QC1 group header</span></div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span> </div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>         <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(save_header, <span class="stringliteral">"1.1"</span>, instrume);</div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span> </div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, master_norm_flat_tag,</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>                                  <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>             vimos_calib_exit(<span class="stringliteral">"Cannot write product category to QC log file"</span>);</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span> </div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(save_header, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>                                    <span class="stringliteral">"Archive File Name"</span>, instrume))</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>             vimos_calib_exit(<span class="stringliteral">"Missing keyword ARCFILE in flatfield frame"</span>);</div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span> </div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(save_header, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>                                    <span class="stringliteral">"Template signature ID"</span>, instrume))</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>             vimos_calib_exit(<span class="stringliteral">"Missing keyword TPL ID in flatfield frame"</span>);</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span> </div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(save_header, <span class="stringliteral">"ESO OCS CON QUAD"</span>, NULL,</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>                                    <span class="stringliteral">"Quadrant"</span>, instrume))</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>             vimos_calib_exit(<span class="stringliteral">"Missing keyword OCS CON QUAD in flatfield frame"</span>);</div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span> </div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(save_header, key_filt_name, NULL,</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>                                    <span class="stringliteral">"Filter"</span>, instrume)) {</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in flatfield frame"</span>, </div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>                           key_filt_name);</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>             vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>         }</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span> </div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(save_header, key_gris_name, NULL,</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>                                    <span class="stringliteral">"Grism"</span>, instrume)) {</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in flatfield frame"</span>, </div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>                           key_gris_name);</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>             vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>         }</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span> </div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(save_header, key_mask_id, NULL,</div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>                                    <span class="stringliteral">"Mask"</span>, instrume)) {</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in flatfield frame"</span>, </div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>                           key_mask_id);</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>             vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>         }</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span> </div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>         cpl_propertylist_update_double(save_header, </div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>                                        <span class="stringliteral">"ESO PRO WLEN CEN"</span>, reference);</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span> </div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(save_header, <span class="stringliteral">"ESO PRO WLEN CEN"</span>, <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>                                    <span class="stringliteral">"Reference wavelength"</span>, instrume))</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>             vimos_calib_exit(<span class="stringliteral">"Missing keyword PRO WLEN CEN in flatfield frame"</span>);</div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span> </div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span> <span class="comment">/* Unused in the old VIMOS pipeline:</span></div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span> <span class="comment"></span></div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span> <span class="comment">        if (fors_qc_keyword_to_paf(save_header, "ESO DPR TYPE", NULL,</span></div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span> <span class="comment">                                   "DPR type", instrume))</span></div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span> <span class="comment">            vimos_calib_exit("Missing keyword DPR TYPE in flat field frame");</span></div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span> <span class="comment"></span></div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span> <span class="comment">        if (fors_qc_keyword_to_paf(save_header, key_gris_id, NULL,</span></div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span> <span class="comment">                                  "Grism identifier", instrume)) {</span></div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span> <span class="comment">            cpl_msg_error(recipe, "Missing keyword %s in arc "</span></div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span> <span class="comment">                            "lamp header", key_gris_id);</span></div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span> <span class="comment">            vimos_calib_exit(NULL);</span></div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span> <span class="comment">        }</span></div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span> <span class="comment"></span></div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span> <span class="comment">        if (cpl_propertylist_has(save_header, key_filt_name))</span></div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span> <span class="comment">            fors_qc_keyword_to_paf(save_header, key_filt_name, NULL,</span></div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span> <span class="comment">                                  "Filter name", instrume);</span></div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span> <span class="comment"></span></div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span> <span class="comment">        if (fors_qc_keyword_to_paf(save_header, "ESO DET CHIP1 ID", NULL,</span></div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span> <span class="comment">                                  "Chip identifier", instrume))</span></div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span> <span class="comment">            vimos_calib_exit("Missing keyword DET CHIP1 ID in arc "</span></div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span> <span class="comment">                            "lamp header");</span></div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span> </div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>         pipefile = dfs_generate_filename_tfits(master_norm_flat_tag);</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>                                 <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>             vimos_calib_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);</div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>         cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span> </div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>         scale = cpl_propertylist_get_double(save_header, <span class="stringliteral">"ESO TEL FOCU SCALE"</span>);</div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span> </div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>         <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>             cpl_error_reset();</div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>             scale = 1.718;</div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Cannot read keyword TEL FOCU SCALE "</span></div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>                             <span class="stringliteral">"(defaulted to %f arcsec/mm)"</span>, scale);</div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>         }</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span> </div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span> <span class="comment">         * QC1 parameters</span></div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span> </div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>         keyname = <span class="stringliteral">"QC.MOS.SLIT.WIDTH"</span>;</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span> </div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>         slit_width = scale * cpl_table_get(slits, <span class="stringliteral">"ywidth"</span>, cslit, NULL);</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span> </div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(save_header, slit_width, keyname, <span class="stringliteral">"arcsec"</span>,</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>                                     <span class="stringliteral">"Width of slit closest to center"</span>,</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>                                     instrume)) {</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>             vimos_calib_exit(<span class="stringliteral">"Cannot write slit width to QC log file"</span>);</div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>         }</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span> </div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>         <a class="code" href="group__moses.html#ga5291b43599e8dec884137f867fe72bfd" title="Measure flux from spectral interval on CCD.">mos_extract_flux</a>(master_flat, slits, 2, gain, &flux, &flux_err);</div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span> </div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>         flux_err /= alltime; <span class="comment">// The master is simply the sum of all flats</span></div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>         flux     /= alltime;</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span> </div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>         cpl_msg_info(recipe, </div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>                      <span class="stringliteral">"Flux at wavelength %.2f: %.2f +/- %.2f ADU/mm^2/s\n"</span>,</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>                      reference, flux, flux_err);</div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span> </div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>         keyname = <span class="stringliteral">"QC.MOS.FLAT.FLUX"</span>;</div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span> </div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(save_header, flux, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>                                     <span class="stringliteral">"Flux at reference wavelength"</span>,</div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>                                     instrume)) {</div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>             vimos_calib_exit(<span class="stringliteral">"Cannot write QC.MOS.FLAT.FLUX to QC log file"</span>);</div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>         }</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span> </div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>         keyname = <span class="stringliteral">"QC.MOS.FLAT.FLUXERR"</span>;</div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span> </div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(save_header, flux_err, keyname, </div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>                                     <span class="stringliteral">"ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>                                     <span class="stringliteral">"Error on flux at reference wavelength"</span>,</div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>                                     instrume)) {</div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>             vimos_calib_exit(<span class="stringliteral">"Cannot write QC.MOS.FLAT.FLUXERR to QC log file"</span>);</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>         }</div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span> </div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>         <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span> </div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>     }</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span> </div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>     cpl_image_turn(master_flat, rotate_back);</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, master_flat, master_screen_flat_tag,</div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>                        save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span> </div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>     cpl_image_delete(master_flat); master_flat = NULL;</div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span> </div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>     cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span> </div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span> </div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span> <span class="comment">     * Final wavelength calibration of spectra having their curvature</span></div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span> <span class="comment">     * removed</span></div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span> </div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>     cpl_msg_info(recipe, <span class="stringliteral">"Perform final wavelength calibration..."</span>);</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span> </div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>     nx = cpl_image_get_size_x(spatial);</div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>     ny = cpl_image_get_size_y(spatial);</div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span> </div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>     idscoeff = cpl_table_new(ny);</div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>     restable = cpl_table_new(nlines);</div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>     rainbow = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>     <span class="keywordflow">if</span> (check)</div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>         residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>     fiterror = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>     fitlines = cpl_calloc(ny, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));</div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span> </div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>     rectified = <a class="code" href="group__moses.html#ga6eece9155581f329c3a779cd62b8f1cb" title="Derive wavelength calibration from a rectified arc lamp or sky exposure.">mos_wavelength_calibration_final</a>(spatial, slits, lines, </div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>                                                  dispersion, peakdetection, </div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>                                                  wradius, wdegree, wreject,</div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>                                                  reference, &startwavelength, </div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>                                                  &endwavelength, fitlines, </div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>                                                  fiterror, idscoeff, rainbow, </div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>                                                  residual, restable, NULL);</div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span> </div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>     <span class="keywordflow">if</span> (rectified == NULL)</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>         vimos_calib_exit(<span class="stringliteral">"Wavelength calibration failure."</span>);</div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span> </div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, restable, disp_residuals_table_tag, NULL,</div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span> </div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>     cpl_table_delete(restable); restable = NULL;</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span> </div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>     cpl_table_wrap_double(idscoeff, fiterror, <span class="stringliteral">"error"</span>); fiterror = NULL;</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>     cpl_table_set_column_unit(idscoeff, <span class="stringliteral">"error"</span>, <span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>     cpl_table_wrap_int(idscoeff, fitlines, <span class="stringliteral">"nlines"</span>); fitlines = NULL;</div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span> </div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span> </div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>         <span class="keyword">const</span> <span class="keywordtype">char</span> *clab[6] = {<span class="stringliteral">"c0"</span>, <span class="stringliteral">"c1"</span>, <span class="stringliteral">"c2"</span>, <span class="stringliteral">"c3"</span>, <span class="stringliteral">"c4"</span>, <span class="stringliteral">"c5"</span>};</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span> </div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>         <span class="keywordtype">int</span>    *position = cpl_table_get_data_int   (slits, <span class="stringliteral">"position"</span>);</div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>         <span class="keywordtype">int</span>    *length   = cpl_table_get_data_int   (slits, <span class="stringliteral">"length"</span>);</div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>         <span class="keywordtype">double</span> *ytop     = cpl_table_get_data_double(slits, <span class="stringliteral">"ytop"</span>);</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>         <span class="keywordtype">double</span> *ybottom  = cpl_table_get_data_double(slits, <span class="stringliteral">"ybottom"</span>);</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span> </div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>         <span class="keywordtype">int</span>     j, k, dr, irow;</div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span> </div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span> <span class="comment">         * Replace the LSS solutions to the poorer MOS solutions</span></div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span> </div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>         <span class="keywordflow">for</span> (j = 0, i = ny - 1; i >= 0; i--) {</div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>             <span class="keywordflow">if</span> (i < position[j]) {</div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>                 ++j;</div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>             }</div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>             dr = position[j] + length[j] - i - 1;</div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>             irow = floor(ytop[j] - dr*(ytop[j] - ybottom[j])/length[j] + 0.5);</div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>             <span class="keywordflow">for</span> (k = 0; k <= wdegree; k++) {</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>                 cpl_table_set_double(idscoeff, clab[k], i, </div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>                 cpl_table_get_double(idscoeff_lss, clab[k], irow, NULL));</div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>             }</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>             cpl_table_set_double(idscoeff, <span class="stringliteral">"error"</span>, i,</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>             cpl_table_get_double(idscoeff_lss, <span class="stringliteral">"error"</span>, irow, NULL));</div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>             cpl_table_set_int(idscoeff, <span class="stringliteral">"nlines"</span>, i,</div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>             cpl_table_get_int(idscoeff_lss, <span class="stringliteral">"nlines"</span>, irow, NULL));</div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>         }</div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span> </div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>         cpl_table_delete(idscoeff_lss);</div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span> </div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>         cpl_image_delete(rectified);</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span> </div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>         rectified = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(spatial, reference,</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>                                                startwavelength, endwavelength,</div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>                                                dispersion, idscoeff, 0);</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>     }</div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>         <span class="keywordflow">for</span> (i = 0; i < ny; i++)</div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>             <span class="keywordflow">if</span> (!cpl_table_is_valid(idscoeff, <span class="stringliteral">"c0"</span>, i))</div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>                 cpl_table_set_invalid(idscoeff, <span class="stringliteral">"error"</span>, i);</div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>     }</div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span> </div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>     cpl_image_delete(spatial); spatial = NULL;</div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span> </div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>     delta = <a class="code" href="group__moses.html#ga6187454ef3812203ba2d50d1e2d01326" title="Create a pixel map from an IDS coefficients table.">mos_map_pixel</a>(idscoeff, reference, startwavelength,</div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>                           endwavelength, dispersion, 2);</div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span> </div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>     header = cpl_propertylist_new();</div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>                                    startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span> <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span> </div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, delta, delta_image_tag,</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>                        header, parlist, recipe, version))</div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span> </div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>     cpl_image_delete(delta); delta = NULL;</div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span> </div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>     mean_rms = <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(rectified, lines, startwavelength, </div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>                                    dispersion, 6, 0);</div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span> </div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f pixel"</span>, mean_rms);</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span> </div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span> </div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>, </div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>                  mean_rms, mean_rms * dispersion);</div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span> </div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>     restab = <a class="code" href="group__moses.html#gae9f633b64e1880984c084a19f53047fc" title="Compute mean spectral resolution at a given arc lamp line.">mos_resolution_table</a>(rectified, startwavelength, dispersion, </div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>                                   60000, lines);</div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span> </div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>     <span class="keywordflow">if</span> (restab) {</div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>         cpl_msg_info(recipe, <span class="stringliteral">"Mean spectral resolution: %.2f"</span>, </div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>                    cpl_table_get_column_mean(restab, <span class="stringliteral">"resolution"</span>));</div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>         cpl_msg_info(recipe, <span class="stringliteral">"Mean reference lines FWHM: %.2f +/- %.2f pixel"</span>,</div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>                    cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm"</span>) / dispersion,</div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>                    cpl_table_get_column_mean(restab, <span class="stringliteral">"fwhm_rms"</span>) / dispersion);</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span> </div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>         <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span> </div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span> </div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>             <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot reload arc lamp header"</span>);</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span> </div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>             qclist = cpl_propertylist_new();</div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span> </div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>             <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qclist, <span class="stringliteral">"1.1"</span>, instrume);</div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span> </div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span> </div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span> <span class="comment">             * QC1 group header</span></div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span> </div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, spectral_resolution_tag,</div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>                                     <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write product category to "</span></div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>                                 <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span> </div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>                                       <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>                 vimos_calib_exit(<span class="stringliteral">"Missing keyword DPR TYPE in arc "</span></div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>                                 <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span> </div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>                                       <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>                 vimos_calib_exit(<span class="stringliteral">"Missing keyword TPL ID in arc "</span></div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>                                 <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span> </div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, key_gris_name, NULL,</div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>                                       <span class="stringliteral">"Grism name"</span>, instrume)) {</div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>                 cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in arc "</span></div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>                                 <span class="stringliteral">"lamp header"</span>, key_gris_name);</div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>                 vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>             }</div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span> </div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, key_gris_id, NULL,</div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>                                       <span class="stringliteral">"Grism identifier"</span>, instrume)) {</div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>                 cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in arc "</span></div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>                                 <span class="stringliteral">"lamp header"</span>, key_gris_id);</div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>                 vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>             }</div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span> </div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>             <span class="keywordflow">if</span> (cpl_propertylist_has(header, key_filt_name))</div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>                 <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, key_filt_name, NULL,</div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>                                       <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span> </div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>                                       <span class="stringliteral">"Chip identifier"</span>, instrume))</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>                 vimos_calib_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID in arc "</span></div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>                                 <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span> </div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>                                       <span class="stringliteral">"Archive name of input data"</span>, </div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>                                       instrume))</div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>                 vimos_calib_exit(<span class="stringliteral">"Missing keyword ARCFILE in arc "</span></div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>                                 <span class="stringliteral">"lamp header"</span>);</div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span> </div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>             cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span> </div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>             pipefile = dfs_generate_filename_tfits(spectral_resolution_tag);</div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>                                     <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>             cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span> </div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span> </div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span> <span class="comment">             * QC1 parameters</span></div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span> </div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION"</span>;</div>
+<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span> </div>
+<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qclist, </div>
+<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>                                        cpl_table_get_column_mean(restab,</div>
+<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>                                                                  <span class="stringliteral">"resolution"</span>),</div>
+<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>                                        keyname,</div>
+<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>                                        <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>                                        <span class="stringliteral">"Mean spectral resolution"</span>,</div>
+<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>                                        instrume)) {</div>
+<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write mean spectral resolution to QC "</span></div>
+<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>                                 <span class="stringliteral">"log file"</span>);</div>
+<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>             }</div>
+<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span> </div>
+<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.RMS"</span>;</div>
+<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span> </div>
+<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qclist, </div>
+<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>                                        cpl_table_get_column_stdev(restab, </div>
+<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>                                                                   <span class="stringliteral">"resolution"</span>),</div>
+<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>                                        <span class="stringliteral">"QC.MOS.RESOLUTION.RMS"</span>,</div>
+<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>                                        <span class="stringliteral">"Angstrom"</span>, </div>
+<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>                                        <span class="stringliteral">"Scatter of spectral resolution"</span>,</div>
+<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>                                        instrume)) {</div>
+<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write spectral resolution scatter "</span></div>
+<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>                                 <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>             }</div>
+<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span> </div>
+<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION.NLINES"</span>;</div>
+<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span> </div>
+<div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>             <span class="keywordflow">if</span> (fors_qc_write_qc_int(qclist, cpl_table_get_nrow(restab) -</div>
+<div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>                                     cpl_table_count_invalid(restab, </div>
+<div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>                                                             <span class="stringliteral">"resolution"</span>),</div>
+<div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>                                     <span class="stringliteral">"QC.MOS.RESOLUTION.NLINES"</span>,</div>
+<div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>                                     NULL,</div>
+<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>                                     <span class="stringliteral">"Number of lines for spectral resolution "</span></div>
+<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>                                     <span class="stringliteral">"computation"</span>,</div>
+<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>                                     instrume)) {</div>
+<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write number of lines used in "</span></div>
+<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>                                 <span class="stringliteral">"spectral resolution computation "</span></div>
+<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>                                 <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>             }</div>
+<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span> </div>
+<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>             <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span> </div>
+<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>         }</div>
+<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span> </div>
+<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, restab, spectral_resolution_tag, qclist,</div>
+<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>             vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span> </div>
+<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>         cpl_propertylist_delete(qclist); qclist = NULL;</div>
+<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span> </div>
+<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>     }</div>
+<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>         vimos_calib_exit(<span class="stringliteral">"Cannot compute the spectral resolution table"</span>);</div>
+<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span> </div>
+<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>     cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span> </div>
+<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, idscoeff, disp_coeff_tag, NULL,</div>
+<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span> </div>
+<div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01505"></a><span class="lineno"> 1505</span> <span class="comment">     * Global distortion models</span></div>
+<div class="line"><a name="l01506"></a><span class="lineno"> 1506</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01507"></a><span class="lineno"> 1507</span> </div>
+<div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>     <span class="keywordflow">if</span> (slit_ident) {</div>
+<div class="line"><a name="l01509"></a><span class="lineno"> 1509</span> </div>
+<div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>         cpl_msg_info(recipe, <span class="stringliteral">"Computing global distortions model"</span>);</div>
+<div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>         global = <a class="code" href="group__moses.html#gab847fe615b7510fc2d189e80cf5029b5" title="Determine all global distortions models.">mos_global_distortion</a>(slits, maskslits, idscoeff, </div>
+<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>                                        polytraces, reference);</div>
+<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span> </div>
+<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>         <span class="keywordflow">if</span> (global && 0) {</div>
+<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>             cpl_table *stest;</div>
+<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>             cpl_table *ctest;</div>
+<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>             cpl_table *dtest;</div>
+<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>             cpl_image *itest;</div>
+<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span> </div>
+<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>             stest = <a class="code" href="group__moses.html#gad9b2789388ba6564011d832d276b2ae6" title="Build the slit location table from a global distortions table.">mos_build_slit_location</a>(global, maskslits, ccd_ysize);</div>
+<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span> </div>
+<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>             ctest = <a class="code" href="group__moses.html#gacff89218baba1abf3641c083a1125861" title="Build the curvature coefficients table from a global distortions table.">mos_build_curv_coeff</a>(global, maskslits, stest);</div>
+<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, ctest, <span class="stringliteral">"CURVS"</span>, NULL,</div>
+<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>                 vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span> </div>
+<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>             itest = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, stest, ctest, </div>
+<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>                                             reference, startwavelength, </div>
+<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>                                             endwavelength, dispersion, </div>
+<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>                                             0, NULL);</div>
+<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>             cpl_table_delete(ctest); ctest = NULL;</div>
+<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>             cpl_image_delete(itest); itest = NULL;</div>
+<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, stest, <span class="stringliteral">"SLITS"</span>, NULL,</div>
+<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>                 vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span> </div>
+<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>             dtest = <a class="code" href="group__moses.html#ga4e4da9890ad8d0229f187b4d7eda17be" title="Build the IDS coefficients table from a global distortions table.">mos_build_disp_coeff</a>(global, stest);</div>
+<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, dtest, <span class="stringliteral">"DISPS"</span>, NULL,</div>
+<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>                 vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span> </div>
+<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>             cpl_table_delete(dtest); dtest = NULL;</div>
+<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>             cpl_table_delete(stest); stest = NULL;</div>
+<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>         }</div>
+<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span> </div>
+<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>         <span class="keywordflow">if</span> (global) {</div>
+<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, global, global_distortion_tag, NULL,</div>
+<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>                 vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>             cpl_table_delete(global); global = NULL;</div>
+<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>         }</div>
+<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span> </div>
+<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span> <span class="comment">//        cpl_image_delete(spectra); spectra = NULL;</span></div>
+<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>         cpl_table_delete(maskslits); maskslits = NULL;</div>
+<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>     }</div>
+<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span> </div>
+<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>                                    startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span> <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>     cpl_propertylist_update_int(header, <span class="stringliteral">"ESO PRO DATANCOM"</span>, 1);</div>
+<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span> </div>
+<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>     <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span> </div>
+<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>         <span class="keywordtype">double</span> scale;</div>
+<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>         <span class="keywordtype">double</span> slit_width;</div>
+<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>         <span class="keywordtype">float</span>  lambdaHe;</div>
+<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>         <span class="keywordtype">float</span>  lambdaNe;</div>
+<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>         <span class="keywordtype">float</span>  lambdaAr;</div>
+<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>         <span class="keywordtype">float</span>  lambdaRed;</div>
+<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>         <span class="keywordtype">float</span>  lambdaYel;</div>
+<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>         <span class="keywordtype">float</span>  lambdaBlu;</div>
+<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>         <span class="keywordtype">double</span> flux, flux_err, resol, resol_err;</div>
+<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>         <span class="keywordtype">int</span>    selected;</div>
+<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>         <span class="keywordtype">int</span>    cslit = <a class="code" href="group__moses.html#gae575a9875c5e14d7fcb4d74cac44af31" title="Return slit closest to CCD center.">mos_slit_closest_to_center</a>(slits, nx, ny);</div>
+<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span> </div>
+<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span> </div>
+<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span> <span class="comment">         * QC1 group header</span></div>
+<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span> </div>
+<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>         <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(header, <span class="stringliteral">"1.1"</span>, instrume);</div>
+<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span> </div>
+<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, master_norm_flat_tag,</div>
+<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>                                  <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>             vimos_calib_exit(<span class="stringliteral">"Cannot write product category to QC log file"</span>);</div>
+<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span> </div>
+<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>                                    <span class="stringliteral">"Archive File Name"</span>, instrume))</div>
+<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>             vimos_calib_exit(<span class="stringliteral">"Missing keyword ARCFILE in arc lamp frame"</span>);</div>
+<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span> </div>
+<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>                                    <span class="stringliteral">"Template signature ID"</span>, instrume))</div>
+<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>             vimos_calib_exit(<span class="stringliteral">"Missing keyword TPL ID in arc lamp frame"</span>);</div>
+<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span> </div>
+<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO OCS CON QUAD"</span>, NULL,</div>
+<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>                                    <span class="stringliteral">"Quadrant"</span>, instrume))</div>
+<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>             vimos_calib_exit(<span class="stringliteral">"Missing keyword OCS CON QUAD in arc lamp frame"</span>);</div>
+<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span> </div>
+<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, key_filt_name, NULL,</div>
+<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>                                    <span class="stringliteral">"Filter"</span>, instrume)) {</div>
+<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in arc lamp frame"</span>,</div>
+<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>                           key_filt_name);</div>
+<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>             vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>         }</div>
+<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span> </div>
+<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, key_gris_name, NULL,</div>
+<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>                                    <span class="stringliteral">"Grism"</span>, instrume)) {</div>
+<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in arc lamp frame"</span>,</div>
+<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>                           key_gris_name);</div>
+<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>             vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>         }</div>
+<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span> </div>
+<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, key_mask_id, NULL,</div>
+<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>                                    <span class="stringliteral">"Mask"</span>, instrume)) {</div>
+<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in arc lamp frame"</span>,</div>
+<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>                           key_mask_id);</div>
+<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>             vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>         }</div>
+<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span> </div>
+<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>         cpl_propertylist_update_double(header,</div>
+<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>                                        <span class="stringliteral">"ESO PRO WLEN CEN"</span>, reference);</div>
+<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span> </div>
+<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(header, <span class="stringliteral">"ESO PRO WLEN CEN"</span>, <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>                                    <span class="stringliteral">"Reference wavelength"</span>, instrume))</div>
+<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>             vimos_calib_exit(<span class="stringliteral">"Missing keyword PRO WLEN CEN in arc lamp frame"</span>);</div>
+<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span> </div>
+<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>         pipefile = dfs_generate_filename_tfits(master_norm_flat_tag);</div>
+<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>                                 <span class="stringliteral">"Pipeline product name"</span>, instrume))</div>
+<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>             vimos_calib_exit(<span class="stringliteral">"Cannot write PIPEFILE to QC log file"</span>);</div>
+<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>         cpl_free(pipefile); pipefile = NULL;</div>
+<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span> </div>
+<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>         scale = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO TEL FOCU SCALE"</span>);</div>
+<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span> </div>
+<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>         <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>             cpl_error_reset();</div>
+<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>             scale = 1.718;</div>
+<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Cannot read keyword TEL FOCU SCALE "</span></div>
+<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>                             <span class="stringliteral">"(defaulted to %f arcsec/mm)"</span>, scale);</div>
+<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>         }</div>
+<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span> </div>
+<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span> <span class="comment">         * QC1 parameters</span></div>
+<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span> </div>
+<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>         keyname = <span class="stringliteral">"QC.MOS.SLIT.WIDTH"</span>;</div>
+<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span> </div>
+<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>         slit_width = scale * cpl_table_get(slits, <span class="stringliteral">"ywidth"</span>, cslit, NULL);</div>
+<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span> </div>
+<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, slit_width, keyname, <span class="stringliteral">"arcsec"</span>,</div>
+<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>                                     <span class="stringliteral">"Width of slit closest to center"</span>,</div>
+<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>                                     instrume)) {</div>
+<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>             vimos_calib_exit(<span class="stringliteral">"Cannot write slit width to QC log file"</span>);</div>
+<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>         }</div>
+<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span> </div>
+<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>         <span class="keywordflow">if</span> (grism[0] == <span class="charliteral">'L'</span>) {</div>
+<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>             <span class="keywordflow">if</span> (grism[3] == <span class="charliteral">'r'</span>) {      <span class="comment">/* LR_red    */</span></div>
+<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>                 lambdaHe  = 7065.19;</div>
+<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>                 lambdaNe  = 0.0;</div>
+<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>                 lambdaAr  = 7723.80;</div>
+<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>                 lambdaRed = 9122.97;</div>
+<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span>                 lambdaYel = 7635.11;</div>
+<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>                 lambdaBlu = 5875.62;</div>
+<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>             }</div>
+<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>             <span class="keywordflow">if</span> (grism[3] == <span class="charliteral">'b'</span>) {      <span class="comment">/* LR_blue   */</span></div>
+<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>                 lambdaHe  = 5015.68;</div>
+<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>                 lambdaNe  = 6598.96;</div>
+<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>                 lambdaAr  = 0.0;</div>
+<div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>                 lambdaRed = 6598.95;</div>
+<div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>                 lambdaYel = 5015.68;</div>
+<div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>                 lambdaBlu = 3888.65;</div>
+<div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>             }</div>
+<div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>         }</div>
+<div class="line"><a name="l01685"></a><span class="lineno"> 1685</span> </div>
+<div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>         <span class="keywordflow">if</span> (grism[0] == <span class="charliteral">'M'</span>) {          <span class="comment">/* MR        */</span></div>
+<div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>             lambdaHe  = 7065.19;</div>
+<div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>             lambdaNe  = 7032.41;</div>
+<div class="line"><a name="l01689"></a><span class="lineno"> 1689</span>             lambdaAr  = 7723.80;</div>
+<div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>             lambdaRed = 8264.521;</div>
+<div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>             lambdaYel = 6678.200;</div>
+<div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>             lambdaBlu = 5015.675;</div>
+<div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>         }</div>
+<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span> </div>
+<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>         <span class="keywordflow">if</span> (grism[0] == <span class="charliteral">'H'</span>) {</div>
+<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>             <span class="keywordflow">if</span> (grism[3] == <span class="charliteral">'r'</span>) {      <span class="comment">/* HR_red    */</span></div>
+<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>                 lambdaHe  = 7065.19;</div>
+<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>                 lambdaNe  = 7032.41;</div>
+<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>                 lambdaAr  = 7723.80;</div>
+<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>                 lambdaRed = 9122.966;</div>
+<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>                 lambdaYel = 7948.175;</div>
+<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>                 lambdaBlu = 6929.468;</div>
+<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>             }</div>
+<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>             <span class="keywordflow">if</span> (grism[3] == <span class="charliteral">'o'</span>) {      <span class="comment">/* HR_orange */</span></div>
+<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>                 lambdaHe  = 7065.19;</div>
+<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>                 lambdaNe  = 7032.41;</div>
+<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>                 lambdaAr  = 7723.80;</div>
+<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>                 lambdaRed = 7948.175;</div>
+<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>                 lambdaYel = 6929.468;</div>
+<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>                 lambdaBlu = 5875.618;</div>
+<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>             }</div>
+<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>             <span class="keywordflow">if</span> (grism[3] == <span class="charliteral">'b'</span>) {      <span class="comment">/* HR_blue   */</span></div>
+<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>                 lambdaHe  = 5015.68;</div>
+<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>                 lambdaNe  = 5944.83;</div>
+<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>                 lambdaAr  = 0.0;</div>
+<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>                 lambdaRed = 6598.953;</div>
+<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>                 lambdaYel = 5875.618;</div>
+<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>                 lambdaBlu = 5015.675;</div>
+<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>             }</div>
+<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>         }</div>
+<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span> </div>
+<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>         <span class="keywordflow">if</span> (lambdaHe > 1.) {</div>
+<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>             <a class="code" href="group__moses.html#gaf91a99846ae06aa780b59deced1fa215" title="Measure flux from spectral interval on remapped frame.">mos_extract_flux_mapped</a>(rectified, slits, lambdaHe, </div>
+<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>                                     startwavelength, dispersion, </div>
+<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>                                     4, gain, &flux, &flux_err);</div>
+<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span> </div>
+<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>             flux     /= arctime;</div>
+<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>             flux_err /= arctime;</div>
+<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span> </div>
+<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>             cpl_msg_info(recipe, <span class="stringliteral">"Flux of He %.2f: %.2f +/- %.2f ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>                          lambdaHe, flux, flux_err);</div>
+<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span> </div>
+<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>             keyname = <span class="stringliteral">"QC.MOS.HE.LAMBDA"</span>;</div>
+<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span> </div>
+<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, lambdaHe, keyname, <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>                       <span class="stringliteral">"He arc lamp line for flux determination"</span>, instrume)) {</div>
+<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write He arc line to QC log file"</span>);</div>
+<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>             }</div>
+<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span> </div>
+<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>             keyname = <span class="stringliteral">"QC.MOS.HE.FLUX"</span>;</div>
+<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span> </div>
+<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, flux, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>                       <span class="stringliteral">"Flux at chosen He wavelength"</span>, instrume)) {</div>
+<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write He flux to QC log file"</span>);</div>
+<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>             }</div>
+<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span> </div>
+<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>             keyname = <span class="stringliteral">"QC.MOS.HE.FLUXERR"</span>;</div>
+<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span> </div>
+<div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, flux_err, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>                       <span class="stringliteral">"Error on flux at chosen He wavelength"</span>, instrume)) {</div>
+<div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write He flux error to QC log file"</span>);</div>
+<div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>             }</div>
+<div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>         }</div>
+<div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>             cpl_msg_warning(recipe, </div>
+<div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>                             <span class="stringliteral">"No He lines in %s spectral range: corresponding "</span></div>
+<div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>                             <span class="stringliteral">"QC1 parameters are not computed."</span>, grism);</div>
+<div class="line"><a name="l01758"></a><span class="lineno"> 1758</span> </div>
+<div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>         <span class="keywordflow">if</span> (lambdaNe > 1.) {</div>
+<div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>             <a class="code" href="group__moses.html#gaf91a99846ae06aa780b59deced1fa215" title="Measure flux from spectral interval on remapped frame.">mos_extract_flux_mapped</a>(rectified, slits, lambdaNe, </div>
+<div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>                                     startwavelength, dispersion, </div>
+<div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>                                     4, gain, &flux, &flux_err);</div>
+<div class="line"><a name="l01763"></a><span class="lineno"> 1763</span> </div>
+<div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>             flux     /= arctime;</div>
+<div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>             flux_err /= arctime;</div>
+<div class="line"><a name="l01766"></a><span class="lineno"> 1766</span> </div>
+<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>             cpl_msg_info(recipe, <span class="stringliteral">"Flux of Ne %.2f: %.2f +/- %.2f ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>                          lambdaNe, flux, flux_err);</div>
+<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span> </div>
+<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>             keyname = <span class="stringliteral">"QC.MOS.NE.LAMBDA"</span>;</div>
+<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span> </div>
+<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, lambdaNe, keyname, <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>                       <span class="stringliteral">"Ne arc lamp line for flux determination"</span>, instrume)) {</div>
+<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ne arc line to QC log file"</span>);</div>
+<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>             }</div>
+<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span> </div>
+<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>             keyname = <span class="stringliteral">"QC.MOS.NE.FLUX"</span>;</div>
+<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span> </div>
+<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, flux, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>                       <span class="stringliteral">"Flux at chosen Ne wavelength"</span>, instrume)) {</div>
+<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ne flux to QC log file"</span>);</div>
+<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>             }</div>
+<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span> </div>
+<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>             keyname = <span class="stringliteral">"QC.MOS.NE.FLUXERR"</span>;</div>
+<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span> </div>
+<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, flux_err, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>                       <span class="stringliteral">"Error on flux at chosen Ne wavelength"</span>, instrume)) {</div>
+<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ne flux error to QC log file"</span>);</div>
+<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>             }</div>
+<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>         }</div>
+<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>             cpl_msg_warning(recipe, </div>
+<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span>                             <span class="stringliteral">"No Ne lines in %s spectral range: corresponding "</span></div>
+<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>                             <span class="stringliteral">"QC1 parameters are not computed."</span>, grism);</div>
+<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span> </div>
+<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>         <span class="keywordflow">if</span> (lambdaAr > 1.) {</div>
+<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>             <a class="code" href="group__moses.html#gaf91a99846ae06aa780b59deced1fa215" title="Measure flux from spectral interval on remapped frame.">mos_extract_flux_mapped</a>(rectified, slits, lambdaAr, </div>
+<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>                                     startwavelength, dispersion, </div>
+<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>                                     4, gain, &flux, &flux_err);</div>
+<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span> <span class="comment">//            mos_extract_flux(spectra, slits, 3, gain, &flux, &flux_err);</span></div>
+<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span> </div>
+<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>             flux     /= arctime;</div>
+<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>             flux_err /= arctime;</div>
+<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span> </div>
+<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>             cpl_msg_info(recipe, <span class="stringliteral">"Flux of Ar %.2f: %.2f +/- %.2f ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>                          lambdaAr, flux, flux_err);</div>
+<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span> </div>
+<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>             keyname = <span class="stringliteral">"QC.MOS.AR.LAMBDA"</span>;</div>
+<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span> </div>
+<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, lambdaAr, keyname, <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>                       <span class="stringliteral">"Ar arc lamp line for flux determination"</span>, instrume)) {</div>
+<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ar arc line to QC log file"</span>);</div>
+<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>             }</div>
+<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span> </div>
+<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>             keyname = <span class="stringliteral">"QC.MOS.AR.FLUX"</span>;</div>
+<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span> </div>
+<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, flux, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>                       <span class="stringliteral">"Flux at chosen Ar wavelength"</span>, instrume)) {</div>
+<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ar flux to QC log file"</span>);</div>
+<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>             }</div>
+<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span> </div>
+<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>             keyname = <span class="stringliteral">"QC.MOS.AR.FLUXERR"</span>;</div>
+<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span> </div>
+<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, flux_err, keyname, <span class="stringliteral">"ADU/mm^2/s"</span>,</div>
+<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>                       <span class="stringliteral">"Error on flux at chosen Ar wavelength"</span>, instrume)) {</div>
+<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write Ar flux error to QC log file"</span>);</div>
+<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>             }</div>
+<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>         }</div>
+<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>         <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>             cpl_msg_warning(recipe, </div>
+<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>                             <span class="stringliteral">"No Ar lines in %s spectral range: corresponding "</span></div>
+<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>                             <span class="stringliteral">"QC1 parameters are not computed."</span>, grism);</div>
+<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span> </div>
+<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span> <span class="comment">         * IDS coefficients</span></div>
+<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span> </div>
+<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>         <span class="keywordflow">for</span> (i = 0; i <= wdegree; i++) {</div>
+<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>             <span class="keywordtype">char</span>  *label = cpl_sprintf(<span class="stringliteral">"c%d"</span>, i);</div>
+<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>             <span class="keywordtype">char</span>  *unit;</div>
+<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>             <span class="keywordtype">char</span>  *comment;</div>
+<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>             <span class="keywordtype">double</span> mcoeff;</div>
+<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span> </div>
+<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span> </div>
+<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>             mcoeff = 0.0;    <span class="comment">// Zero by definition when i == 0</span></div>
+<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>             <span class="keywordflow">if</span> (i) {</div>
+<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gac6224c743943d88920b1e93f7394d009" title="Compute median from a table column section corresponding to a slit.">mos_median_in_slit</a>(idscoeff, slits, </div>
+<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>                                        cslit, label, &mcoeff)) {</div>
+<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>                     cpl_free(label);</div>
+<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>                     <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>                 }</div>
+<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>             }</div>
+<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span> </div>
+<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>             keyname = cpl_sprintf(<span class="stringliteral">"QC.MOS.WAVECAL.COEFF%d"</span>, i);</div>
+<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span> </div>
+<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>             <span class="keywordflow">switch</span> (i) {</div>
+<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>             <span class="keywordflow">case</span> 0:</div>
+<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>                 unit = cpl_strdup(<span class="stringliteral">"pixel"</span>);</div>
+<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>             <span class="keywordflow">case</span> 1:</div>
+<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>                 unit = cpl_strdup(<span class="stringliteral">"pixel/Angstrom"</span>);</div>
+<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>             <span class="keywordflow">default</span>:</div>
+<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>                 unit = cpl_sprintf(<span class="stringliteral">"pixel/Angstrom^%d"</span>, i);</div>
+<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>                 <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>             }</div>
+<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span> </div>
+<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>             comment = cpl_sprintf(<span class="stringliteral">"Median coefficient %d of IDS"</span>, i);</div>
+<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span> </div>
+<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, mcoeff, keyname, </div>
+<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>                                         unit, comment, instrume)) {</div>
+<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write IDS coefficient to QC logfile"</span>);</div>
+<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>             }</div>
+<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span> </div>
+<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>             cpl_free(keyname);</div>
+<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>             cpl_free(comment);</div>
+<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>             cpl_free(unit);</div>
+<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>             cpl_free(label);</div>
+<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>         }</div>
+<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span> </div>
+<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span> <span class="comment">         * These parameters are now useless, I set them to zero.</span></div>
+<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span> </div>
+<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>         keyname = <span class="stringliteral">"QC.MOS.REFWAVE.MEAN"</span>;</div>
+<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span> </div>
+<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, 0.0, keyname, <span class="stringliteral">"pixel"</span>, </div>
+<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>                 <span class="stringliteral">"MEAN of CCD positions of reference wavelength"</span>, instrume)) {</div>
+<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span>             vimos_calib_exit(<span class="stringliteral">"Cannot write QC.MOS.REFWAVE.MEAN to QC logfile"</span>);</div>
+<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>         }</div>
+<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span> </div>
+<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>         keyname = <span class="stringliteral">"QC.MOS.REFWAVE.RMS"</span>;</div>
+<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span> </div>
+<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, 0.0, keyname, <span class="stringliteral">"pixel"</span>, </div>
+<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>                 <span class="stringliteral">"RMS of CCD positions of reference wavelength"</span>, instrume)) {</div>
+<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>             vimos_calib_exit(<span class="stringliteral">"Cannot write QC.MOS.REFWAVE.RMS to QC logfile"</span>);</div>
+<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>         }</div>
+<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span> </div>
+<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>         <span class="keywordflow">if</span> (restab) {</div>
+<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span> </div>
+<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span> <span class="comment">             * About spectral resolution:</span></div>
+<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span> </div>
+<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION1.LAMBDA"</span>;</div>
+<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span> </div>
+<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, lambdaRed, keyname, <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>                 <span class="stringliteral">"Line used in spectral resolution determination"</span>, instrume)) {</div>
+<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write arc line to QC log file"</span>);</div>
+<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>             }</div>
+<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span> </div>
+<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION1"</span>;</div>
+<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span> </div>
+<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>, </div>
+<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>                                           CPL_GREATER_THAN, lambdaRed - 1.0);</div>
+<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>             selected =</div>
+<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>, </div>
+<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>                                           CPL_LESS_THAN, lambdaRed + 1.0);</div>
+<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span> </div>
+<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>             <span class="keywordflow">if</span> (selected == 1) {</div>
+<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>                 cpl_table *one_line = cpl_table_extract_selected(restab);</div>
+<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span> </div>
+<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>                 resol = cpl_table_get_double(one_line, </div>
+<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>                                              <span class="stringliteral">"resolution"</span>, 0, NULL);</div>
+<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>                 resol_err = cpl_table_get_double(one_line, </div>
+<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>                                              <span class="stringliteral">"resolution_rms"</span>, 0, NULL);</div>
+<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span> </div>
+<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>                 cpl_table_delete(one_line);</div>
+<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>             }</div>
+<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>                 resol = 0.0;</div>
+<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>                 resol_err = 0.0;</div>
+<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>             }</div>
+<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>     </div>
+<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>             cpl_table_select_all(restab);</div>
+<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>     </div>
+<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>             cpl_msg_info(recipe, <span class="stringliteral">"Spectral resolution at %.2f: %.2f +/- %.2f"</span>,</div>
+<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>                          lambdaRed, resol, resol_err);</div>
+<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>     </div>
+<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, resol, keyname, NULL,</div>
+<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>                 <span class="stringliteral">"Mean spectral resolution at red end of spectrum"</span>, instrume)) {</div>
+<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write spectral resolution "</span></div>
+<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>                                  <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>             }</div>
+<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>     </div>
+<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION1.RMS"</span>;</div>
+<div class="line"><a name="l01947"></a><span class="lineno"> 1947</span> </div>
+<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, resol_err, keyname, NULL,</div>
+<div class="line"><a name="l01949"></a><span class="lineno"> 1949</span>                 <span class="stringliteral">"Error on mean spectral resolution"</span>, instrume)) {</div>
+<div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write error on resolution "</span></div>
+<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>                                  <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l01952"></a><span class="lineno"> 1952</span>             }</div>
+<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span> </div>
+<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION2.LAMBDA"</span>;</div>
+<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span> </div>
+<div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, lambdaYel, keyname, <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>                 <span class="stringliteral">"Line used in spectral resolution determination"</span>, instrume)) {</div>
+<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write arc line to QC log file"</span>);</div>
+<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>             }</div>
+<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span> </div>
+<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION2"</span>;</div>
+<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span> </div>
+<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>,</div>
+<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>                                           CPL_GREATER_THAN, lambdaYel - 1.0);</div>
+<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>             selected =</div>
+<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>,</div>
+<div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>                                           CPL_LESS_THAN, lambdaYel + 1.0);</div>
+<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span> </div>
+<div class="line"><a name="l01969"></a><span class="lineno"> 1969</span>             <span class="keywordflow">if</span> (selected == 1) {</div>
+<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>                 cpl_table *one_line = cpl_table_extract_selected(restab);</div>
+<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>     </div>
+<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>                 resol = cpl_table_get_double(one_line, </div>
+<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>                                              <span class="stringliteral">"resolution"</span>, 0, NULL);</div>
+<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>                 resol_err = cpl_table_get_double(one_line, </div>
+<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>                                              <span class="stringliteral">"resolution_rms"</span>, 0, NULL);</div>
+<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span> </div>
+<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>                 cpl_table_delete(one_line);</div>
+<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>             }</div>
+<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>                 resol = 0.0;</div>
+<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>                 resol_err = 0.0;</div>
+<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>             }</div>
+<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span> </div>
+<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>             cpl_table_select_all(restab);</div>
+<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>     </div>
+<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>             cpl_msg_info(recipe, <span class="stringliteral">"Spectral resolution at %.2f: %.2f +/- %.2f"</span>,</div>
+<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>                          lambdaYel, resol, resol_err);</div>
+<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span> </div>
+<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, resol, keyname, NULL,</div>
+<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>                 <span class="stringliteral">"Mean spectral resolution at center of spectrum"</span>, instrume)) {</div>
+<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write spectral resolution "</span></div>
+<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>                                  <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>             }</div>
+<div class="line"><a name="l01994"></a><span class="lineno"> 1994</span> </div>
+<div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION2.RMS"</span>;</div>
+<div class="line"><a name="l01996"></a><span class="lineno"> 1996</span> </div>
+<div class="line"><a name="l01997"></a><span class="lineno"> 1997</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, resol_err, keyname, NULL,</div>
+<div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>                 <span class="stringliteral">"Error on mean spectral resolution"</span>, instrume)) {</div>
+<div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write error on resolution "</span></div>
+<div class="line"><a name="l02000"></a><span class="lineno"> 2000</span>                                      <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>             }</div>
+<div class="line"><a name="l02002"></a><span class="lineno"> 2002</span> </div>
+<div class="line"><a name="l02003"></a><span class="lineno"> 2003</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION3.LAMBDA"</span>;</div>
+<div class="line"><a name="l02004"></a><span class="lineno"> 2004</span> </div>
+<div class="line"><a name="l02005"></a><span class="lineno"> 2005</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, lambdaBlu, keyname, <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>                 <span class="stringliteral">"Line used in spectral resolution determination"</span>, instrume)) {</div>
+<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write arc line to QC log file"</span>);</div>
+<div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>             }</div>
+<div class="line"><a name="l02009"></a><span class="lineno"> 2009</span> </div>
+<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION3"</span>;</div>
+<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span> </div>
+<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>,</div>
+<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>                                           CPL_GREATER_THAN, lambdaBlu - 1.0);</div>
+<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>             selected =</div>
+<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>             cpl_table_and_selected_double(restab, <span class="stringliteral">"wavelength"</span>,</div>
+<div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>                                           CPL_LESS_THAN, lambdaBlu + 1.0);</div>
+<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span> </div>
+<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>             <span class="keywordflow">if</span> (selected == 1) {</div>
+<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>                 cpl_table *one_line = cpl_table_extract_selected(restab);</div>
+<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>     </div>
+<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>                 resol = cpl_table_get_double(one_line, </div>
+<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>                                              <span class="stringliteral">"resolution"</span>, 0, NULL);</div>
+<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>                 resol_err = cpl_table_get_double(one_line, </div>
+<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>                                              <span class="stringliteral">"resolution_rms"</span>, 0, NULL);</div>
+<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>     </div>
+<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>                 cpl_table_delete(one_line);</div>
+<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>             }</div>
+<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>                 resol = 0.0;</div>
+<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>                 resol_err = 0.0;</div>
+<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>             }</div>
+<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span> </div>
+<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>             cpl_table_select_all(restab);</div>
+<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span> </div>
+<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span>             cpl_msg_info(recipe, <span class="stringliteral">"Spectral resolution at %.2f: %.2f +/- %.2f"</span>,</div>
+<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>                          lambdaBlu, resol, resol_err);</div>
+<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span> </div>
+<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, resol, keyname, NULL,</div>
+<div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>                 <span class="stringliteral">"Mean spectral resolution at blue end of spectrum"</span>, instrume)) {</div>
+<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write spectral resolution "</span></div>
+<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>                                  <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>             }</div>
+<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span> </div>
+<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>             keyname = <span class="stringliteral">"QC.MOS.RESOLUTION3.RMS"</span>;</div>
+<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span> </div>
+<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, resol_err, keyname, NULL,</div>
+<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>                 <span class="stringliteral">"Error on mean spectral resolution"</span>, instrume)) {</div>
+<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write error on resolution "</span></div>
+<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>                                  <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span>             }</div>
+<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span> </div>
+<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>             keyname = <span class="stringliteral">"QC.MOS.IDS.RMS"</span>;</div>
+<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span> </div>
+<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(header, mean_rms, keyname, <span class="stringliteral">"pixel"</span>,</div>
+<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>                 <span class="stringliteral">"Mean accuracy of dispersion solution"</span>, instrume)) {</div>
+<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span>                 vimos_calib_exit(<span class="stringliteral">"Cannot write mean accuracy of "</span></div>
+<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>                                  <span class="stringliteral">"dispersion solution to QC log file"</span>);</div>
+<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>             }</div>
+<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>         }</div>
+<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span> </div>
+<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>         <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span> </div>
+<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>     }</div>
+<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span> </div>
+<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>     cpl_free(grism); grism = NULL;</div>
+<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>     cpl_free(instrume); instrume = NULL;</div>
+<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span>     cpl_table_delete(restab); restab = NULL;</div>
+<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span> </div>
+<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, rectified, reduced_lamp_tag, header,</div>
+<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span> </div>
+<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>     cpl_image_delete(rectified); rectified = NULL;</div>
+<div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l02077"></a><span class="lineno"> 2077</span> </div>
+<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>     <span class="keywordflow">if</span> (check) {</div>
+<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>         save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span> </div>
+<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>         <span class="comment">/* cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_1"</span>, 1.0);</div>
+<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>         cpl_propertylist_update_double(save_header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>         cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>         cpl_propertylist_update_string(save_header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span> </div>
+<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, residual, disp_residuals_tag, save_header,</div>
+<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>             vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span> </div>
+<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>         cpl_image_delete(residual); residual = NULL;</div>
+<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>         cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>     }</div>
+<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span> </div>
+<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>     <span class="keywordflow">if</span> (!treat_as_lss) {</div>
+<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span> </div>
+<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span> <span class="comment">         * Wavemap was already produced if treat_as_lss = true</span></div>
+<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span> </div>
+<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>         wavemap = <a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(coordinate, rainbow, slits, </div>
+<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>                                       polytraces, reference, </div>
+<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>                                       startwavelength, endwavelength, </div>
+<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>                                       dispersion);</div>
+<div class="line"><a name="l02109"></a><span class="lineno"> 2109</span> </div>
+<div class="line"><a name="l02110"></a><span class="lineno"> 2110</span>         cpl_image_delete(rainbow); rainbow = NULL;</div>
+<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>     }</div>
+<div class="line"><a name="l02112"></a><span class="lineno"> 2112</span> </div>
+<div class="line"><a name="l02113"></a><span class="lineno"> 2113</span>     save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, arc_tag, 0);</div>
+<div class="line"><a name="l02114"></a><span class="lineno"> 2114</span> </div>
+<div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>     cpl_image_turn(wavemap, rotate_back);</div>
+<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, wavemap, wavelength_map_tag, save_header,</div>
+<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span> </div>
+<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>     cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l02121"></a><span class="lineno"> 2121</span> </div>
+<div class="line"><a name="l02122"></a><span class="lineno"> 2122</span>     cpl_image_turn(coordinate, rotate_back);</div>
+<div class="line"><a name="l02123"></a><span class="lineno"> 2123</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, coordinate, spatial_map_tag, save_header,</div>
+<div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l02126"></a><span class="lineno"> 2126</span> </div>
+<div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>     cpl_image_delete(coordinate); coordinate = NULL;</div>
+<div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>     cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l02129"></a><span class="lineno"> 2129</span> </div>
+<div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, polytraces, curv_coeff_tag, NULL,</div>
+<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l02133"></a><span class="lineno"> 2133</span> </div>
+<div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span> </div>
+<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>     <a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f" title="Rotate a slit location table.">mos_rotate_slits</a>(slits, rotate, ccd_ysize, ccd_xsize);</div>
+<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, slits, slit_location_tag, NULL,</div>
+<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>                        parlist, recipe, version))</div>
+<div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l02140"></a><span class="lineno"> 2140</span> </div>
+<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span> </div>
+<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>         vimos_calib_exit(NULL);</div>
+<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>     }</div>
+<div class="line"><a name="l02147"></a><span class="lineno"> 2147</span> </div>
+<div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/vimos__calib__impl_8h-source.html b/html/vimos__calib__impl_8h-source.html
deleted file mode 100644
index 385e3fc..0000000
--- a/html/vimos__calib__impl_8h-source.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: vimos_calib_impl.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>vimos_calib_impl.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: vimos_calib_impl.h,v 1.1 2010/06/15 13:58:29 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/06/15 13:58:29 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.1 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef VIMOS_CALIB_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define VIMOS_CALIB_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keywordtype">int</span> <a class="code" href="group__vimos__calib__impl.html#gf710e60eea27cfed978ef2989d9b2a33">vimos_calib_impl</a>(cpl_frameset *frames, cpl_parameterlist *parameters);
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 CPL_END_DECLS
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/vimos__calib__impl_8h_source.html b/html/vimos__calib__impl_8h_source.html
new file mode 100644
index 0000000..cc016ee
--- /dev/null
+++ b/html/vimos__calib__impl_8h_source.html
@@ -0,0 +1,100 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: vimos_calib_impl.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">vimos_calib_impl.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: vimos_calib_impl.h,v 1.1 2010-06-15 13:58:29 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-06-15 13:58:29 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.1 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef VIMOS_CALIB_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define VIMOS_CALIB_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keywordtype">int</span> <a class="code" href="group__vimos__calib__impl.html#gaff1b7bb1f87357c0ae0d3bd62c12b096" title="Interpret the command line options and execute the data processing.">vimos_calib_impl</a>(cpl_frameset *frames, cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/vimos__science_8c-source.html b/html/vimos__science_8c-source.html
deleted file mode 100644
index 732cd94..0000000
--- a/html/vimos__science_8c-source.html
+++ /dev/null
@@ -1,1128 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: vimos_science.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_9af262a93c54576b7a2b4cc0cd21cc4f.html">recipes</a></div>
-<h1>vimos_science.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: vimos_science.c,v 1.22 2010/09/14 07:38:16 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/09/14 07:38:16 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.22 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <math.h></span>
-<a name="l00033"></a>00033 <span class="preprocessor">#include <string.h></span>
-<a name="l00034"></a>00034 <span class="preprocessor">#include <vimos_science_impl.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <moses.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_stack.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_tools.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00040"></a>00040 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00041"></a>00041 
-<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_create(cpl_plugin *);
-<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_exec(cpl_plugin *);
-<a name="l00044"></a>00044 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_destroy(cpl_plugin *);
-<a name="l00045"></a>00045 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science(cpl_parameterlist *, cpl_frameset *);
-<a name="l00046"></a>00046 
-<a name="l00047"></a>00047 <span class="keyword">static</span> <span class="keywordtype">char</span> vimos_science_description[] =
-<a name="l00048"></a>00048 <span class="stringliteral">"This recipe is used to reduce scientific spectra using the extraction\n"</span>
-<a name="l00049"></a>00049 <span class="stringliteral">"mask and the products created by the recipe vimos_calib. The spectra are\n"</span>
-<a name="l00050"></a>00050 <span class="stringliteral">"bias subtracted, flat fielded (if a normalised flat field is specified)\n"</span>
-<a name="l00051"></a>00051 <span class="stringliteral">"and remapped eliminating the optical distortions. The wavelength calibration\n"</span>
-<a name="l00052"></a>00052 <span class="stringliteral">"can be optionally upgraded using a number of sky lines: if no sky lines\n"</span>
-<a name="l00053"></a>00053 <span class="stringliteral">"catalog of wavelengths is specified, an internal one is used instead.\n"</span>
-<a name="l00054"></a>00054 <span class="stringliteral">"If the alignment to the sky lines is performed, the input dispersion\n"</span>
-<a name="l00055"></a>00055 <span class="stringliteral">"coefficients table is upgraded and saved to disk, and a new CCD wavelengths\n"</span>
-<a name="l00056"></a>00056 <span class="stringliteral">"map is created. A grism table (typically depending on the grism used)\n"</span>
-<a name="l00057"></a>00057 <span class="stringliteral">"may also be specified: this table contains a default recipe parameter\n"</span> 
-<a name="l00058"></a>00058 <span class="stringliteral">"setting to control the way spectra are extracted for a specific instrument\n"</span>
-<a name="l00059"></a>00059 <span class="stringliteral">"mode, as it is used for automatic run of the pipeline on Paranal and in\n"</span> 
-<a name="l00060"></a>00060 <span class="stringliteral">"Garching. If this table is specified, it will modify the default recipe\n"</span> 
-<a name="l00061"></a>00061 <span class="stringliteral">"parameter setting, with the exception of those parameters which have been\n"</span> 
-<a name="l00062"></a>00062 <span class="stringliteral">"explicitly modifyed on the command line. If a grism table is not specified,\n"</span>
-<a name="l00063"></a>00063 <span class="stringliteral">"the input recipe parameters values will always be read from the command\n"</span> 
-<a name="l00064"></a>00064 <span class="stringliteral">"line, or from an esorex configuration file if present, or from their\n"</span> 
-<a name="l00065"></a>00065 <span class="stringliteral">"generic default values (that are rarely meaningful).\n"</span> 
-<a name="l00066"></a>00066 <span class="stringliteral">"MOS_SLIT_LOCATION and MOS_CURV_COEFF tables are not (yet) expected for\n"</span>
-<a name="l00067"></a>00067 <span class="stringliteral">"long-slit-like data.\n"</span>
-<a name="l00068"></a>00068 <span class="stringliteral">"Only in case of a standard star exposure input, the atmospheric extinction\n"</span>
-<a name="l00069"></a>00069 <span class="stringliteral">"table and a table with the physical fluxes of the observed standard star\n"</span>
-<a name="l00070"></a>00070 <span class="stringliteral">"must be specified in input.\n\n"</span>
-<a name="l00071"></a>00071 <span class="stringliteral">"Input files:\n\n"</span>
-<a name="l00072"></a>00072 <span class="stringliteral">"  DO category:                Type:       Explanation:         Required:\n"</span>
-<a name="l00073"></a>00073 <span class="stringliteral">"  MOS_SCIENCE                 Raw         Scientific exposure     Y\n"</span>
-<a name="l00074"></a>00074 <span class="stringliteral">"  or MOS_STANDARD             Raw         Standard star exposure  Y\n"</span>
-<a name="l00075"></a>00075 <span class="stringliteral">"\n"</span>
-<a name="l00076"></a>00076 <span class="stringliteral">"  MASTER_BIAS                 Calib       Master bias             Y\n"</span>
-<a name="l00077"></a>00077 <span class="stringliteral">"  SKY_LINE_CATALOG            Calib       Sky lines catalog       .\n"</span>
-<a name="l00078"></a>00078 <span class="stringliteral">"  MOS_MASTER_SCREEN_FLAT      Calib       Normalised flat field   .\n"</span>
-<a name="l00079"></a>00079 <span class="stringliteral">"  MOS_DISP_COEFF              Calib       Inverse dispersion      Y\n"</span>
-<a name="l00080"></a>00080 <span class="stringliteral">"  MOS_CURV_COEFF              Calib       Spectral curvature      Y\n"</span>
-<a name="l00081"></a>00081 <span class="stringliteral">"  MOS_SLIT_LOCATION           Calib       Slits positions table   Y\n"</span>
-<a name="l00082"></a>00082 <span class="stringliteral">"  GRISM_TABLE                 Calib       Grism table             .\n"</span>
-<a name="l00083"></a>00083 <span class="stringliteral">"\n"</span>
-<a name="l00084"></a>00084 <span class="stringliteral">"  In case MOS_STANDARD is specified in input,\n"</span>
-<a name="l00085"></a>00085 <span class="stringliteral">"\n"</span>
-<a name="l00086"></a>00086 <span class="stringliteral">"  EXTINCT_TABLE               Calib       Atmospheric extinction  Y\n"</span>
-<a name="l00087"></a>00087 <span class="stringliteral">"  STD_FLUX_TABLE              Calib       Standard star flux      Y\n"</span>
-<a name="l00088"></a>00088 <span class="stringliteral">"\n"</span>
-<a name="l00089"></a>00089 <span class="stringliteral">"Output files:\n\n"</span>
-<a name="l00090"></a>00090 <span class="stringliteral">"  DO category:                Data type:  Explanation:\n"</span>
-<a name="l00091"></a>00091 <span class="stringliteral">"  MOS_SCIENCE_REDUCED         FITS image  Extracted scientific spectra\n"</span>
-<a name="l00092"></a>00092 <span class="stringliteral">"  or MOS_STANDARD_REDUCED     FITS image  Extracted standard star spectrum\n"</span>
-<a name="l00093"></a>00093 <span class="stringliteral">"  MOS_SKY_REDUCED             FITS image  Extracted sky spectra\n"</span>
-<a name="l00094"></a>00094 <span class="stringliteral">"  MOS_ERROR_REDUCED           FITS image  Errors on extracted spectra\n"</span>
-<a name="l00095"></a>00095 <span class="stringliteral">"\n"</span>
-<a name="l00096"></a>00096 <span class="stringliteral">"  MOS_UNMAPPED_SCIENCE        FITS image  Sky subtracted scientific spectra\n"</span>
-<a name="l00097"></a>00097 <span class="stringliteral">"  or MOS_UNMAPPED_STANDARD    FITS image  Sky subtracted standard spectrum\n"</span>
-<a name="l00098"></a>00098 <span class="stringliteral">"\n"</span>
-<a name="l00099"></a>00099 <span class="stringliteral">"  MOS_SCIENCE_EXTRACTED       FITS image  Rectified scientific spectra\n"</span>
-<a name="l00100"></a>00100 <span class="stringliteral">"  or MOS_STANDARD_EXTRACTED   FITS image  Rectified standard star spectrum\n"</span>
-<a name="l00101"></a>00101 <span class="stringliteral">"\n"</span>
-<a name="l00102"></a>00102 <span class="stringliteral">"  MOS_SCIENCE_SKY_EXTRACTED   FITS image  Rectified science spectra with sky\n"</span>
-<a name="l00103"></a>00103 <span class="stringliteral">"or MOS_STANDARD_SKY_EXTRACTED FITS image  Rectified std spectrum with sky\n"</span>
-<a name="l00104"></a>00104 <span class="stringliteral">"\n"</span>
-<a name="l00105"></a>00105 <span class="stringliteral">"  MOS_SCIENCE_SKY             FITS image  Rectified sky spectra\n"</span>
-<a name="l00106"></a>00106 <span class="stringliteral">"  MOS_UNMAPPED_SKY            FITS image  Sky on CCD\n"</span>
-<a name="l00107"></a>00107 <span class="stringliteral">"  MOS_GLOBAL_SKY_SPECTRUM     FITS table  Global sky spectrum\n"</span>
-<a name="l00108"></a>00108 <span class="stringliteral">"  OBJECT_TABLE                FITS table  Positions of detected objects\n"</span>
-<a name="l00109"></a>00109 <span class="stringliteral">"\n"</span>
-<a name="l00110"></a>00110 <span class="stringliteral">"  Only if the sky-alignment of the wavelength solution is requested:\n"</span>
-<a name="l00111"></a>00111 <span class="stringliteral">"  MOS_SKYLINES_OFFSETS_LONG   FITS table  Sky lines offsets (LSS-like data)\n"</span>
-<a name="l00112"></a>00112 <span class="stringliteral">"or MOS_SKYLINES_OFFSETS_SLIT  FITS table  Sky lines offsets (MOS-like data)\n"</span>
-<a name="l00113"></a>00113 <span class="stringliteral">"  MOS_DISP_COEFF_SKY          FITS table  Upgraded dispersion coefficients\n"</span>
-<a name="l00114"></a>00114 <span class="stringliteral">"  MOS_WAVELENGTH_MAP_SKY      FITS image  Upgraded wavelength map\n"</span>
-<a name="l00115"></a>00115 <span class="stringliteral">"\n"</span>
-<a name="l00116"></a>00116 <span class="stringliteral">"  Only if a MOS_STANDARD is specified in input:\n"</span>
-<a name="l00117"></a>00117 <span class="stringliteral">"  MOS_SPECPHOT_TABLE          FITS table  Efficiency and response curves\n\n"</span>;
-<a name="l00118"></a>00118 
-<a name="l00130"></a><a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">00130</a> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#g4abb403976fc3ddcaa614c59a44590c9">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)
-<a name="l00131"></a>00131 {
-<a name="l00132"></a>00132     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );
-<a name="l00133"></a>00133     cpl_plugin *plugin = &recipe->interface;
-<a name="l00134"></a>00134 
-<a name="l00135"></a>00135     cpl_plugin_init(plugin,
-<a name="l00136"></a>00136                     CPL_PLUGIN_API,
-<a name="l00137"></a>00137                     FORS_BINARY_VERSION,
-<a name="l00138"></a>00138                     CPL_PLUGIN_TYPE_RECIPE,
-<a name="l00139"></a>00139                     <span class="stringliteral">"vimos_science"</span>,
-<a name="l00140"></a>00140                     <span class="stringliteral">"Extraction of scientific spectra"</span>,
-<a name="l00141"></a>00141                     vimos_science_description,
-<a name="l00142"></a>00142                     <span class="stringliteral">"Carlo Izzo"</span>,
-<a name="l00143"></a>00143                     PACKAGE_BUGREPORT,
-<a name="l00144"></a>00144     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span>
-<a name="l00145"></a>00145     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span>
-<a name="l00146"></a>00146     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span>
-<a name="l00147"></a>00147     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span>
-<a name="l00148"></a>00148     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span>
-<a name="l00149"></a>00149     <span class="stringliteral">"(at your option) any later version.\n\n"</span>
-<a name="l00150"></a>00150     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span>
-<a name="l00151"></a>00151     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span>
-<a name="l00152"></a>00152     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span>
-<a name="l00153"></a>00153     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span>
-<a name="l00154"></a>00154     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span>
-<a name="l00155"></a>00155     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span>
-<a name="l00156"></a>00156     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,
-<a name="l00157"></a>00157                     vimos_science_create,
-<a name="l00158"></a>00158                     vimos_science_exec,
-<a name="l00159"></a>00159                     vimos_science_destroy);
-<a name="l00160"></a>00160 
-<a name="l00161"></a>00161     cpl_pluginlist_append(list, plugin);
-<a name="l00162"></a>00162     
-<a name="l00163"></a>00163     <span class="keywordflow">return</span> 0;
-<a name="l00164"></a>00164 }
-<a name="l00165"></a>00165 
-<a name="l00166"></a>00166 
-<a name="l00177"></a>00177 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_create(cpl_plugin *plugin)
-<a name="l00178"></a>00178 {
-<a name="l00179"></a>00179     cpl_recipe    *recipe;
-<a name="l00180"></a>00180     cpl_parameter *p;
-<a name="l00181"></a>00181 
-<a name="l00182"></a>00182 
-<a name="l00183"></a>00183     <span class="comment">/* </span>
-<a name="l00184"></a>00184 <span class="comment">     * Check that the plugin is part of a valid recipe </span>
-<a name="l00185"></a>00185 <span class="comment">     */</span>
-<a name="l00186"></a>00186 
-<a name="l00187"></a>00187     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00188"></a>00188         recipe = (cpl_recipe *)plugin;
-<a name="l00189"></a>00189     <span class="keywordflow">else</span> 
-<a name="l00190"></a>00190         <span class="keywordflow">return</span> -1;
-<a name="l00191"></a>00191 
-<a name="l00192"></a>00192     <span class="comment">/* </span>
-<a name="l00193"></a>00193 <span class="comment">     * Create the parameters list in the cpl_recipe object </span>
-<a name="l00194"></a>00194 <span class="comment">     */</span>
-<a name="l00195"></a>00195 
-<a name="l00196"></a>00196     recipe->parameters = cpl_parameterlist_new(); 
-<a name="l00197"></a>00197 
-<a name="l00198"></a>00198 
-<a name="l00199"></a>00199     <span class="comment">/*</span>
-<a name="l00200"></a>00200 <span class="comment">     * Dispersion</span>
-<a name="l00201"></a>00201 <span class="comment">     */</span>
-<a name="l00202"></a>00202 
-<a name="l00203"></a>00203     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.dispersion"</span>,
-<a name="l00204"></a>00204                                 CPL_TYPE_DOUBLE,
-<a name="l00205"></a>00205                                 <span class="stringliteral">"Resampling step (Angstrom/pixel)"</span>,
-<a name="l00206"></a>00206                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00207"></a>00207                                 0.0);
-<a name="l00208"></a>00208     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);
-<a name="l00209"></a>00209     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00210"></a>00210     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00211"></a>00211 
-<a name="l00212"></a>00212     <span class="comment">/*</span>
-<a name="l00213"></a>00213 <span class="comment">     * Sky lines alignment</span>
-<a name="l00214"></a>00214 <span class="comment">     */</span>
-<a name="l00215"></a>00215 
-<a name="l00216"></a>00216     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.skyalign"</span>,
-<a name="l00217"></a>00217                                 CPL_TYPE_INT,
-<a name="l00218"></a>00218                                 <span class="stringliteral">"Polynomial order for sky lines alignment, "</span>
-<a name="l00219"></a>00219                                 <span class="stringliteral">"or -1 to avoid alignment"</span>,
-<a name="l00220"></a>00220                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00221"></a>00221                                 0);
-<a name="l00222"></a>00222     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);
-<a name="l00223"></a>00223     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00224"></a>00224     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <span class="comment">/*</span>
-<a name="l00227"></a>00227 <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span>
-<a name="l00228"></a>00228 <span class="comment">     */</span>
-<a name="l00229"></a>00229 
-<a name="l00230"></a>00230     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.wcolumn"</span>,
-<a name="l00231"></a>00231                                 CPL_TYPE_STRING,
-<a name="l00232"></a>00232                                 <span class="stringliteral">"Name of sky line catalog table column "</span>
-<a name="l00233"></a>00233                                 <span class="stringliteral">"with wavelengths"</span>,
-<a name="l00234"></a>00234                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00235"></a>00235                                 <span class="stringliteral">"WLEN"</span>);
-<a name="l00236"></a>00236     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);
-<a name="l00237"></a>00237     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00238"></a>00238     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00239"></a>00239 
-<a name="l00240"></a>00240     <span class="comment">/*</span>
-<a name="l00241"></a>00241 <span class="comment">     * Start wavelength for spectral extraction</span>
-<a name="l00242"></a>00242 <span class="comment">     */</span>
-<a name="l00243"></a>00243 
-<a name="l00244"></a>00244     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.startwavelength"</span>,
-<a name="l00245"></a>00245                                 CPL_TYPE_DOUBLE,
-<a name="l00246"></a>00246                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,
-<a name="l00247"></a>00247                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00248"></a>00248                                 0.0);
-<a name="l00249"></a>00249     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);
-<a name="l00250"></a>00250     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00251"></a>00251     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00252"></a>00252 
-<a name="l00253"></a>00253     <span class="comment">/*</span>
-<a name="l00254"></a>00254 <span class="comment">     * End wavelength for spectral extraction</span>
-<a name="l00255"></a>00255 <span class="comment">     */</span>
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.endwavelength"</span>,
-<a name="l00258"></a>00258                                 CPL_TYPE_DOUBLE,
-<a name="l00259"></a>00259                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,
-<a name="l00260"></a>00260                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00261"></a>00261                                 0.0);
-<a name="l00262"></a>00262     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);
-<a name="l00263"></a>00263     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00264"></a>00264     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00265"></a>00265 
-<a name="l00266"></a>00266     <span class="comment">/*</span>
-<a name="l00267"></a>00267 <span class="comment">     * Reference wavelength for wavelength calibration</span>
-<a name="l00268"></a>00268 <span class="comment">     */</span>
-<a name="l00269"></a>00269 
-<a name="l00270"></a>00270     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.reference"</span>,
-<a name="l00271"></a>00271                                 CPL_TYPE_DOUBLE,
-<a name="l00272"></a>00272                                 <span class="stringliteral">"Reference wavelength for calibration"</span>,
-<a name="l00273"></a>00273                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00274"></a>00274                                 0.0);
-<a name="l00275"></a>00275     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"reference"</span>);
-<a name="l00276"></a>00276     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00277"></a>00277     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     <span class="comment">/*</span>
-<a name="l00280"></a>00280 <span class="comment">     * Flux conservation</span>
-<a name="l00281"></a>00281 <span class="comment">     */</span>
-<a name="l00282"></a>00282 
-<a name="l00283"></a>00283     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.flux"</span>,
-<a name="l00284"></a>00284                                 CPL_TYPE_BOOL,
-<a name="l00285"></a>00285                                 <span class="stringliteral">"Apply flux conservation"</span>,
-<a name="l00286"></a>00286                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00287"></a>00287                                 TRUE);
-<a name="l00288"></a>00288     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);
-<a name="l00289"></a>00289     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00290"></a>00290     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00291"></a>00291 
-<a name="l00292"></a>00292     <span class="comment">/*</span>
-<a name="l00293"></a>00293 <span class="comment">     * Apply flat field</span>
-<a name="l00294"></a>00294 <span class="comment">     */</span>
-<a name="l00295"></a>00295 
-<a name="l00296"></a>00296     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.flatfield"</span>,
-<a name="l00297"></a>00297                                 CPL_TYPE_BOOL,
-<a name="l00298"></a>00298                                 <span class="stringliteral">"Apply flat field"</span>,
-<a name="l00299"></a>00299                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00300"></a>00300                                 TRUE);
-<a name="l00301"></a>00301     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flatfield"</span>);
-<a name="l00302"></a>00302     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00303"></a>00303     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00304"></a>00304 
-<a name="l00305"></a>00305     <span class="comment">/*</span>
-<a name="l00306"></a>00306 <span class="comment">     * Global sky subtraction</span>
-<a name="l00307"></a>00307 <span class="comment">     */</span>
-<a name="l00308"></a>00308 
-<a name="l00309"></a>00309     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.skyglobal"</span>,
-<a name="l00310"></a>00310                                 CPL_TYPE_BOOL,
-<a name="l00311"></a>00311                                 <span class="stringliteral">"Subtract global sky spectrum from CCD"</span>,
-<a name="l00312"></a>00312                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00313"></a>00313                                 FALSE);
-<a name="l00314"></a>00314     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyglobal"</span>);
-<a name="l00315"></a>00315     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00316"></a>00316     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318     <span class="comment">/*</span>
-<a name="l00319"></a>00319 <span class="comment">     * Local sky subtraction on extracted spectra</span>
-<a name="l00320"></a>00320 <span class="comment">     */</span>
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.skymedian"</span>,
-<a name="l00323"></a>00323                                 CPL_TYPE_BOOL,
-<a name="l00324"></a>00324                                 <span class="stringliteral">"Sky subtraction from extracted slit spectra"</span>,
-<a name="l00325"></a>00325                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00326"></a>00326                                 FALSE);
-<a name="l00327"></a>00327     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skymedian"</span>);
-<a name="l00328"></a>00328     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00329"></a>00329     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00330"></a>00330 
-<a name="l00331"></a>00331     <span class="comment">/*</span>
-<a name="l00332"></a>00332 <span class="comment">     * Local sky subtraction on CCD spectra</span>
-<a name="l00333"></a>00333 <span class="comment">     */</span>
-<a name="l00334"></a>00334 
-<a name="l00335"></a>00335     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.skylocal"</span>,
-<a name="l00336"></a>00336                                 CPL_TYPE_BOOL,
-<a name="l00337"></a>00337                                 <span class="stringliteral">"Sky subtraction from CCD slit spectra"</span>,
-<a name="l00338"></a>00338                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00339"></a>00339                                 TRUE);
-<a name="l00340"></a>00340     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skylocal"</span>);
-<a name="l00341"></a>00341     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00342"></a>00342     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00343"></a>00343 
-<a name="l00344"></a>00344     <span class="comment">/*</span>
-<a name="l00345"></a>00345 <span class="comment">     * Cosmic rays removal</span>
-<a name="l00346"></a>00346 <span class="comment">     */</span>
-<a name="l00347"></a>00347 
-<a name="l00348"></a>00348     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.cosmics"</span>,
-<a name="l00349"></a>00349                                 CPL_TYPE_BOOL,
-<a name="l00350"></a>00350                                 <span class="stringliteral">"Eliminate cosmic rays hits (only if global "</span>
-<a name="l00351"></a>00351                                 <span class="stringliteral">"or local sky subtraction is also requested)"</span>,
-<a name="l00352"></a>00352                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00353"></a>00353                                 TRUE);
-<a name="l00354"></a>00354     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);
-<a name="l00355"></a>00355     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00356"></a>00356     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00357"></a>00357 
-<a name="l00358"></a>00358     <span class="comment">/*</span>
-<a name="l00359"></a>00359 <span class="comment">     * Slit margin</span>
-<a name="l00360"></a>00360 <span class="comment">     */</span>
-<a name="l00361"></a>00361 
-<a name="l00362"></a>00362     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.slit_margin"</span>,
-<a name="l00363"></a>00363                                 CPL_TYPE_INT,
-<a name="l00364"></a>00364                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span>
-<a name="l00365"></a>00365                                 <span class="stringliteral">"in object detection and extraction"</span>,
-<a name="l00366"></a>00366                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00367"></a>00367                                 3);
-<a name="l00368"></a>00368     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);
-<a name="l00369"></a>00369     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00370"></a>00370     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00371"></a>00371 
-<a name="l00372"></a>00372     <span class="comment">/*</span>
-<a name="l00373"></a>00373 <span class="comment">     * Extraction radius</span>
-<a name="l00374"></a>00374 <span class="comment">     */</span>
-<a name="l00375"></a>00375 
-<a name="l00376"></a>00376     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.ext_radius"</span>,
-<a name="l00377"></a>00377                                 CPL_TYPE_INT,
-<a name="l00378"></a>00378                                 <span class="stringliteral">"Maximum extraction radius for detected "</span>
-<a name="l00379"></a>00379                                 <span class="stringliteral">"objects (pixel)"</span>,
-<a name="l00380"></a>00380                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00381"></a>00381                                 6);
-<a name="l00382"></a>00382     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);
-<a name="l00383"></a>00383     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00384"></a>00384     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386     <span class="comment">/*</span>
-<a name="l00387"></a>00387 <span class="comment">     * Contamination radius</span>
-<a name="l00388"></a>00388 <span class="comment">     */</span>
-<a name="l00389"></a>00389 
-<a name="l00390"></a>00390     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.cont_radius"</span>,
-<a name="l00391"></a>00391                                 CPL_TYPE_INT,
-<a name="l00392"></a>00392                                 <span class="stringliteral">"Minimum distance at which two objects "</span>
-<a name="l00393"></a>00393                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span>
-<a name="l00394"></a>00394                                 <span class="stringliteral">"each other (pixel)"</span>,
-<a name="l00395"></a>00395                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00396"></a>00396                                 0);
-<a name="l00397"></a>00397     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);
-<a name="l00398"></a>00398     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00399"></a>00399     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00400"></a>00400 
-<a name="l00401"></a>00401     <span class="comment">/*</span>
-<a name="l00402"></a>00402 <span class="comment">     * Object extraction method</span>
-<a name="l00403"></a>00403 <span class="comment">     */</span>
-<a name="l00404"></a>00404 
-<a name="l00405"></a>00405     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.ext_mode"</span>,
-<a name="l00406"></a>00406                                 CPL_TYPE_INT,
-<a name="l00407"></a>00407                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span>
-<a name="l00408"></a>00408                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,
-<a name="l00409"></a>00409                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00410"></a>00410                                 1);
-<a name="l00411"></a>00411     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);
-<a name="l00412"></a>00412     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00413"></a>00413     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00414"></a>00414 
-<a name="l00415"></a>00415     <span class="comment">/*</span>
-<a name="l00416"></a>00416 <span class="comment">     * Normalise output by exposure time</span>
-<a name="l00417"></a>00417 <span class="comment">     */</span>
-<a name="l00418"></a>00418 
-<a name="l00419"></a>00419     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.time_normalise"</span>,
-<a name="l00420"></a>00420                                 CPL_TYPE_BOOL,
-<a name="l00421"></a>00421                                 <span class="stringliteral">"Normalise output spectra by the exposure time"</span>,
-<a name="l00422"></a>00422                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00423"></a>00423                                 TRUE);
-<a name="l00424"></a>00424     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"time_normalise"</span>);
-<a name="l00425"></a>00425     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00426"></a>00426     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00427"></a>00427 
-<a name="l00428"></a>00428     <span class="comment">/*</span>
-<a name="l00429"></a>00429 <span class="comment">     * Look for a standard star in any frame classified as MOS_STANDARD</span>
-<a name="l00430"></a>00430 <span class="comment">     */</span>
-<a name="l00431"></a>00431 
-<a name="l00432"></a>00432     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.anyframe"</span>,
-<a name="l00433"></a>00433                                 CPL_TYPE_BOOL,
-<a name="l00434"></a>00434                                 <span class="stringliteral">"Look for a standard star in any frame "</span>
-<a name="l00435"></a>00435                                 <span class="stringliteral">"classified as MOS_STANDARD"</span>,
-<a name="l00436"></a>00436                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00437"></a>00437                                 FALSE);
-<a name="l00438"></a>00438     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"anyframe"</span>);
-<a name="l00439"></a>00439     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00440"></a>00440     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00441"></a>00441 
-<a name="l00442"></a>00442 
-<a name="l00443"></a>00443     <span class="comment">/*</span>
-<a name="l00444"></a>00444 <span class="comment">     * Order of polynomial modeling the instrument response.</span>
-<a name="l00445"></a>00445 <span class="comment">     */</span>
-<a name="l00446"></a>00446 
-<a name="l00447"></a>00447     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.response"</span>,
-<a name="l00448"></a>00448                                 CPL_TYPE_INT,
-<a name="l00449"></a>00449                                 <span class="stringliteral">"Order of polynomial modeling the "</span>
-<a name="l00450"></a>00450                                 <span class="stringliteral">"instrument response"</span>,
-<a name="l00451"></a>00451                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00452"></a>00452                                 5);
-<a name="l00453"></a>00453     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"response"</span>);
-<a name="l00454"></a>00454     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00455"></a>00455     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00456"></a>00456 
-<a name="l00457"></a>00457 
-<a name="l00458"></a>00458     <span class="comment">/*</span>
-<a name="l00459"></a>00459 <span class="comment">     * Type of alignment of dithered frames</span>
-<a name="l00460"></a>00460 <span class="comment">     */</span>
-<a name="l00461"></a>00461 
-<a name="l00462"></a>00462     p = cpl_parameter_new_enum(<span class="stringliteral">"fors.vimos_science.alignment"</span>,
-<a name="l00463"></a>00463                                CPL_TYPE_STRING,
-<a name="l00464"></a>00464                                <span class="stringliteral">"Type of alignment of dithered frames, "</span>
-<a name="l00465"></a>00465                                <span class="stringliteral">"either to the nearest neighbour pixel "</span>
-<a name="l00466"></a>00466                                <span class="stringliteral">"or to fractions of pixel"</span>,
-<a name="l00467"></a>00467                                <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00468"></a>00468                                <span class="stringliteral">"integer"</span>, 2,
-<a name="l00469"></a>00469                                <span class="stringliteral">"integer"</span>, <span class="stringliteral">"float"</span>);
-<a name="l00470"></a>00470     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"alignment"</span>);
-<a name="l00471"></a>00471     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00472"></a>00472     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00473"></a>00473 
-<a name="l00474"></a>00474 
-<a name="l00475"></a>00475     <span class="comment">/*</span>
-<a name="l00476"></a>00476 <span class="comment">     * Stacking method of dithered frames</span>
-<a name="l00477"></a>00477 <span class="comment">     */</span>
-<a name="l00478"></a>00478 
-<a name="l00479"></a>00479     <a class="code" href="group__fors__stack.html#g0f1453e93c9e8d66e79fb5f8efcda989">fors_stack_define_parameters</a>(recipe->parameters, 
-<a name="l00480"></a>00480                                  <span class="stringliteral">"fors.vimos_science"</span>, <span class="stringliteral">"average"</span>);
-<a name="l00481"></a>00481 
-<a name="l00482"></a>00482 
-<a name="l00483"></a>00483     <span class="comment">/*</span>
-<a name="l00484"></a>00484 <span class="comment">     * Fringing correction</span>
-<a name="l00485"></a>00485 <span class="comment">     */</span>
-<a name="l00486"></a>00486 
-<a name="l00487"></a>00487     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.fringing"</span>,
-<a name="l00488"></a>00488                                 CPL_TYPE_BOOL,
-<a name="l00489"></a>00489                                 <span class="stringliteral">"Apply fringing correction "</span>
-<a name="l00490"></a>00490                                 <span class="stringliteral">"(only for dithered observations)"</span>,
-<a name="l00491"></a>00491                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00492"></a>00492                                 TRUE);
-<a name="l00493"></a>00493     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"fringing"</span>);
-<a name="l00494"></a>00494     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00495"></a>00495     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00496"></a>00496 
-<a name="l00497"></a>00497 
-<a name="l00498"></a>00498     <span class="comment">/*</span>
-<a name="l00499"></a>00499 <span class="comment">     * Computation of QC1 parameters</span>
-<a name="l00500"></a>00500 <span class="comment">     */</span>
-<a name="l00501"></a>00501 
-<a name="l00502"></a>00502     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.qc"</span>,
-<a name="l00503"></a>00503                                 CPL_TYPE_BOOL,
-<a name="l00504"></a>00504                                 <span class="stringliteral">"Compute QC1 parameters"</span>,
-<a name="l00505"></a>00505                                 <span class="stringliteral">"fors.vimos_science"</span>,
-<a name="l00506"></a>00506                                 TRUE);
-<a name="l00507"></a>00507     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"qc"</span>);
-<a name="l00508"></a>00508     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-<a name="l00509"></a>00509     cpl_parameterlist_append(recipe->parameters, p);
-<a name="l00510"></a>00510 
-<a name="l00511"></a>00511 
-<a name="l00512"></a>00512     <span class="keywordflow">return</span> 0;
-<a name="l00513"></a>00513 }
-<a name="l00514"></a>00514 
-<a name="l00515"></a>00515 
-<a name="l00524"></a>00524 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_exec(cpl_plugin *plugin)
-<a name="l00525"></a>00525 {
-<a name="l00526"></a>00526     cpl_recipe *recipe;
-<a name="l00527"></a>00527     
-<a name="l00528"></a>00528     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00529"></a>00529         recipe = (cpl_recipe *)plugin;
-<a name="l00530"></a>00530     <span class="keywordflow">else</span> 
-<a name="l00531"></a>00531         <span class="keywordflow">return</span> -1;
-<a name="l00532"></a>00532 
-<a name="l00533"></a>00533     <span class="keywordflow">return</span> vimos_science(recipe->parameters, recipe->frames);
-<a name="l00534"></a>00534 }
-<a name="l00535"></a>00535 
-<a name="l00536"></a>00536 
-<a name="l00545"></a>00545 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_destroy(cpl_plugin *plugin)
-<a name="l00546"></a>00546 {
-<a name="l00547"></a>00547     cpl_recipe *recipe;
-<a name="l00548"></a>00548     
-<a name="l00549"></a>00549     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-<a name="l00550"></a>00550         recipe = (cpl_recipe *)plugin;
-<a name="l00551"></a>00551     <span class="keywordflow">else</span> 
-<a name="l00552"></a>00552         <span class="keywordflow">return</span> -1;
-<a name="l00553"></a>00553 
-<a name="l00554"></a>00554     cpl_parameterlist_delete(recipe->parameters); 
-<a name="l00555"></a>00555 
-<a name="l00556"></a>00556     <span class="keywordflow">return</span> 0;
-<a name="l00557"></a>00557 }
-<a name="l00558"></a>00558 
-<a name="l00559"></a>00559 
-<a name="l00569"></a>00569 <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
-<a name="l00570"></a>00570 {
-<a name="l00571"></a>00571     <span class="keyword">const</span> <span class="keywordtype">char</span> *science_tag = <span class="stringliteral">"MOS_SCIENCE"</span>;
-<a name="l00572"></a>00572     <span class="keywordtype">int</span>         mos         = cpl_frameset_count_tags(frameset, science_tag);
-<a name="l00573"></a>00573 
-<a name="l00574"></a>00574     <span class="keywordflow">if</span> (mos > 1) {
-<a name="l00575"></a>00575         <span class="keywordtype">char</span>              version[80];
-<a name="l00576"></a>00576         <span class="keyword">const</span> <span class="keywordtype">char</span>       *curv_coeff_tag       = <span class="stringliteral">"MOS_CURV_COEFF"</span>;
-<a name="l00577"></a>00577         <span class="keyword">const</span> <span class="keywordtype">char</span>       *slit_location_tag    = <span class="stringliteral">"MOS_SLIT_LOCATION"</span>;
-<a name="l00578"></a>00578         <span class="keyword">const</span> <span class="keywordtype">char</span>       *disp_coeff_tag       = <span class="stringliteral">"MOS_DISP_COEFF"</span>;
-<a name="l00579"></a>00579         <span class="keyword">const</span> <span class="keywordtype">char</span>       *unmapped_science_tag = <span class="stringliteral">"MOS_UNMAPPED_SCIENCE"</span>;
-<a name="l00580"></a>00580         <span class="keyword">const</span> <span class="keywordtype">char</span>       *mapped_science_tag   = <span class="stringliteral">"MOS_SCIENCE_EXTRACTED"</span>;
-<a name="l00581"></a>00581         <span class="keyword">const</span> <span class="keywordtype">char</span>       *object_table_tag     = <span class="stringliteral">"OBJECT_TABLE"</span>;
-<a name="l00582"></a>00582         <span class="keyword">const</span> <span class="keywordtype">char</span>       *unmapped_sky_tag     = <span class="stringliteral">"MOS_UNMAPPED_SKY"</span>;
-<a name="l00583"></a>00583         <span class="keyword">const</span> <span class="keywordtype">char</span>       *mapped_sky_tag       = <span class="stringliteral">"MOS_SCIENCE_SKY"</span>;
-<a name="l00584"></a>00584         <span class="keyword">const</span> <span class="keywordtype">char</span>       *reduced_science_tag  = <span class="stringliteral">"MOS_SCIENCE_REDUCED"</span>;
-<a name="l00585"></a>00585         <span class="keyword">const</span> <span class="keywordtype">char</span>       *reduced_sky_tag      = <span class="stringliteral">"MOS_SKY_REDUCED"</span>;
-<a name="l00586"></a>00586         <span class="keyword">const</span> <span class="keywordtype">char</span>       *reduced_error_tag    = <span class="stringliteral">"MOS_ERROR_REDUCED"</span>;
-<a name="l00587"></a>00587         <span class="keyword">const</span> <span class="keywordtype">char</span>       *stack_method;
-<a name="l00588"></a>00588         <span class="keyword">const</span> <span class="keywordtype">char</span>       *alignment;
-<a name="l00589"></a>00589         <span class="keywordtype">double</span>            refwave;
-<a name="l00590"></a>00590         <span class="keywordtype">double</span>            startwavelength;
-<a name="l00591"></a>00591         <span class="keywordtype">double</span>            endwavelength;
-<a name="l00592"></a>00592         <span class="keywordtype">double</span>            dispersion;
-<a name="l00593"></a>00593         <span class="keywordtype">int</span>               flux;
-<a name="l00594"></a>00594         <span class="keywordtype">int</span>               fringing;
-<a name="l00595"></a>00595         <span class="keywordtype">int</span>               cosmics;
-<a name="l00596"></a>00596         <span class="keywordtype">int</span>               slit_margin;
-<a name="l00597"></a>00597         <span class="keywordtype">int</span>               ext_radius;
-<a name="l00598"></a>00598         <span class="keywordtype">int</span>               cont_radius;
-<a name="l00599"></a>00599         <span class="keywordtype">int</span>               ext_mode;
-<a name="l00600"></a>00600         <span class="keywordtype">int</span>               rotate      = 1;
-<a name="l00601"></a>00601         <span class="keywordtype">int</span>               rotate_back = -1;
-<a name="l00602"></a>00602         cpl_frameset     *work        = cpl_frameset_duplicate(frameset);
-<a name="l00603"></a>00603         cpl_frame       **mos_science = cpl_calloc(mos, <span class="keyword">sizeof</span>(cpl_frame*));
-<a name="l00604"></a>00604         cpl_parameter    *param;
-<a name="l00605"></a>00605         cpl_table        *reference   = NULL;
-<a name="l00606"></a>00606         cpl_table        *objects     = NULL;
-<a name="l00607"></a>00607         cpl_image       **images      = NULL;
-<a name="l00608"></a>00608         cpl_image        *image       = NULL;
-<a name="l00609"></a>00609         cpl_image        *sky_image   = NULL;
-<a name="l00610"></a>00610         cpl_imagelist    *imagelist   = NULL;
-<a name="l00611"></a>00611         cpl_image        *fringes     = NULL;
-<a name="l00612"></a>00612         cpl_image        *stacked     = NULL;
-<a name="l00613"></a>00613         cpl_image        *mapped      = NULL;
-<a name="l00614"></a>00614         cpl_image        *smapped     = NULL;
-<a name="l00615"></a>00615         cpl_image        *sky_stacked = NULL;
-<a name="l00616"></a>00616         cpl_image        *sky_mapped  = NULL;
-<a name="l00617"></a>00617         cpl_image        *sky_smapped = NULL;
-<a name="l00618"></a>00618         cpl_table        *polytraces  = NULL;
-<a name="l00619"></a>00619         cpl_table        *idscoeff    = NULL;
-<a name="l00620"></a>00620         cpl_table        *slits       = NULL;
-<a name="l00621"></a>00621         cpl_table        *grism_table = NULL;
-<a name="l00622"></a>00622         cpl_propertylist *header      = NULL;
-<a name="l00623"></a>00623         <span class="keywordtype">char</span>             *name;
-<a name="l00624"></a>00624         <span class="keywordtype">double</span>            offset;
-<a name="l00625"></a>00625         <span class="keywordtype">double</span>            gain;
-<a name="l00626"></a>00626         <span class="keywordtype">double</span>            <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>;
-<a name="l00627"></a>00627         <span class="keywordtype">int</span>               time_normal;
-<a name="l00628"></a>00628         <span class="keywordtype">int</span>               min_reject;
-<a name="l00629"></a>00629         <span class="keywordtype">int</span>               max_reject;
-<a name="l00630"></a>00630         <span class="keywordtype">double</span>            klow;
-<a name="l00631"></a>00631         <span class="keywordtype">double</span>            khigh;
-<a name="l00632"></a>00632         <span class="keywordtype">int</span>               kiter;
-<a name="l00633"></a>00633         <span class="keywordtype">int</span>               int_alignment = 0;
-<a name="l00634"></a>00634         <span class="keywordtype">int</span>               status;
-<a name="l00635"></a>00635         <span class="keywordtype">int</span>               nx, ny;
-<a name="l00636"></a>00636         <span class="keywordtype">int</span>               i;
-<a name="l00637"></a>00637 
-<a name="l00638"></a>00638 
-<a name="l00639"></a>00639         snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00640"></a>00640 
-<a name="l00641"></a>00641         grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00642"></a>00642 
-<a name="l00643"></a>00643         flux = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.flux"</span>, NULL);
-<a name="l00644"></a>00644 
-<a name="l00645"></a>00645         cosmics = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist,
-<a name="l00646"></a>00646                                          <span class="stringliteral">"fors.vimos_science.cosmics"</span>, NULL);
-<a name="l00647"></a>00647 
-<a name="l00648"></a>00648         dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00649"></a>00649                      <span class="stringliteral">"fors.vimos_science.dispersion"</span>, grism_table);
-<a name="l00650"></a>00650 
-<a name="l00651"></a>00651         refwave = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00652"></a>00652                     <span class="stringliteral">"fors.vimos_science.reference"</span>, grism_table);
-<a name="l00653"></a>00653 
-<a name="l00654"></a>00654         startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00655"></a>00655                           <span class="stringliteral">"fors.vimos_science.startwavelength"</span>, grism_table);
-<a name="l00656"></a>00656 
-<a name="l00657"></a>00657         endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00658"></a>00658                         <span class="stringliteral">"fors.vimos_science.endwavelength"</span>, grism_table);
-<a name="l00659"></a>00659 
-<a name="l00660"></a>00660         alignment = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist,
-<a name="l00661"></a>00661                     <span class="stringliteral">"fors.vimos_science.alignment"</span>, NULL);
-<a name="l00662"></a>00662 
-<a name="l00663"></a>00663         <span class="keywordflow">if</span> (strcmp(alignment, <span class="stringliteral">"integer"</span>) == 0) {
-<a name="l00664"></a>00664             int_alignment = 1;
-<a name="l00665"></a>00665         }
-<a name="l00666"></a>00666 
-<a name="l00667"></a>00667         stack_method = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist,
-<a name="l00668"></a>00668                        <span class="stringliteral">"fors.vimos_science.stack_method"</span>, NULL);
-<a name="l00669"></a>00669 
-<a name="l00670"></a>00670         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"minmax"</span>) == 0) {
-<a name="l00671"></a>00671             min_reject = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00672"></a>00672                          <span class="stringliteral">"fors.vimos_science.minrejection"</span>, NULL);
-<a name="l00673"></a>00673             <span class="keywordflow">if</span> (min_reject < 0) {
-<a name="l00674"></a>00674                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>, 
-<a name="l00675"></a>00675                               <span class="stringliteral">"Invalid number of lower rejections"</span>);
-<a name="l00676"></a>00676                 <span class="keywordflow">return</span> -1;
-<a name="l00677"></a>00677             }
-<a name="l00678"></a>00678     
-<a name="l00679"></a>00679             max_reject = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00680"></a>00680                          <span class="stringliteral">"fors.vimos_science.maxrejection"</span>, NULL);
-<a name="l00681"></a>00681 
-<a name="l00682"></a>00682             <span class="keywordflow">if</span> (max_reject < 0) {
-<a name="l00683"></a>00683                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>,
-<a name="l00684"></a>00684                               <span class="stringliteral">"Invalid number of upper rejections"</span>);
-<a name="l00685"></a>00685                 <span class="keywordflow">return</span> -1;
-<a name="l00686"></a>00686             }
-<a name="l00687"></a>00687         }
-<a name="l00688"></a>00688     
-<a name="l00689"></a>00689         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"ksigma"</span>) == 0) {
-<a name="l00690"></a>00690             klow  = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00691"></a>00691                                              <span class="stringliteral">"fors.vimos_science.klow"</span>, NULL);
-<a name="l00692"></a>00692             <span class="keywordflow">if</span> (klow < 0.1) {
-<a name="l00693"></a>00693                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>,
-<a name="l00694"></a>00694                               <span class="stringliteral">"Invalid lower K-sigma"</span>);
-<a name="l00695"></a>00695                 <span class="keywordflow">return</span> -1;
-<a name="l00696"></a>00696             }
-<a name="l00697"></a>00697     
-<a name="l00698"></a>00698             khigh = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00699"></a>00699                                              <span class="stringliteral">"fors.vimos_science.khigh"</span>, NULL);
-<a name="l00700"></a>00700             <span class="keywordflow">if</span> (khigh < 0.1) {
-<a name="l00701"></a>00701                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>,
-<a name="l00702"></a>00702                               <span class="stringliteral">"Invalid lower K-sigma"</span>);
-<a name="l00703"></a>00703                 <span class="keywordflow">return</span> -1;
-<a name="l00704"></a>00704             }
-<a name="l00705"></a>00705     
-<a name="l00706"></a>00706             kiter = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00707"></a>00707                                           <span class="stringliteral">"fors.vimos_science.kiter"</span>, NULL);
-<a name="l00708"></a>00708             <span class="keywordflow">if</span> (kiter < 1) {
-<a name="l00709"></a>00709                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>,
-<a name="l00710"></a>00710                               <span class="stringliteral">"Invalid number of iterations"</span>);
-<a name="l00711"></a>00711                 <span class="keywordflow">return</span> -1;
-<a name="l00712"></a>00712             }
-<a name="l00713"></a>00713         }
-<a name="l00714"></a>00714 
-<a name="l00715"></a>00715         slit_margin = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00716"></a>00716                                             <span class="stringliteral">"fors.vimos_science.slit_margin"</span>,
-<a name="l00717"></a>00717                                             NULL);
-<a name="l00718"></a>00718         ext_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00719"></a>00719                                            <span class="stringliteral">"fors.vimos_science.ext_radius"</span>,
-<a name="l00720"></a>00720                                            NULL);
-<a name="l00721"></a>00721         cont_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00722"></a>00722                                             <span class="stringliteral">"fors.vimos_science.cont_radius"</span>,
-<a name="l00723"></a>00723                                             NULL);
-<a name="l00724"></a>00724         ext_mode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist,
-<a name="l00725"></a>00725                                          <span class="stringliteral">"fors.vimos_science.ext_mode"</span>,
-<a name="l00726"></a>00726                                          NULL);
-<a name="l00727"></a>00727 
-<a name="l00728"></a>00728         fringing = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00729"></a>00729                                           <span class="stringliteral">"fors.vimos_science.fringing"</span>, NULL);
-<a name="l00730"></a>00730 
-<a name="l00731"></a>00731         cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00732"></a>00732 
-<a name="l00733"></a>00733 
-<a name="l00734"></a>00734         <span class="comment">/*</span>
-<a name="l00735"></a>00735 <span class="comment">         * Disable time normalisation for single runs</span>
-<a name="l00736"></a>00736 <span class="comment">         */</span>
-<a name="l00737"></a>00737 
-<a name="l00738"></a>00738         param = cpl_parameterlist_find(parlist, 
-<a name="l00739"></a>00739                                        <span class="stringliteral">"fors.vimos_science.time_normalise"</span>);
-<a name="l00740"></a>00740         time_normal = cpl_parameter_get_bool(param);
-<a name="l00741"></a>00741         cpl_parameter_set_bool(param, 0);
-<a name="l00742"></a>00742 
-<a name="l00743"></a>00743 
-<a name="l00744"></a>00744         <span class="comment">/*</span>
-<a name="l00745"></a>00745 <span class="comment">         * Collect all scientific frames from input SOF</span>
-<a name="l00746"></a>00746 <span class="comment">         */</span>
-<a name="l00747"></a>00747 
-<a name="l00748"></a>00748         mos_science[0] = cpl_frameset_find(frameset, science_tag);
-<a name="l00749"></a>00749         <span class="keywordflow">for</span> (i = 1; i < mos; i++) {
-<a name="l00750"></a>00750             mos_science[i] = cpl_frameset_find(frameset, NULL);
-<a name="l00751"></a>00751         }
-<a name="l00752"></a>00752 
-<a name="l00753"></a>00753 
-<a name="l00754"></a>00754         <span class="comment">/*</span>
-<a name="l00755"></a>00755 <span class="comment">         * Process scientific frames one at a time</span>
-<a name="l00756"></a>00756 <span class="comment">         */</span>
-<a name="l00757"></a>00757 
-<a name="l00758"></a>00758         <span class="keywordflow">for</span> (i = 0; i < mos; i++) {
-<a name="l00759"></a>00759             cpl_frameset_erase(work, science_tag);
-<a name="l00760"></a>00760             cpl_frameset_insert(work, cpl_frame_duplicate(mos_science[i]));
-<a name="l00761"></a>00761             <a class="code" href="group__vimos__science__impl.html#g79a502c79f4843218e3d0d4adec9c907">vimos_science_impl</a>(work, parlist);
-<a name="l00762"></a>00762 
-<a name="l00763"></a>00763 
-<a name="l00764"></a>00764             <span class="comment">/*</span>
-<a name="l00765"></a>00765 <span class="comment">             * Cleanup work SOF from products </span>
-<a name="l00766"></a>00766 <span class="comment">             * (not really necessary, but clean)</span>
-<a name="l00767"></a>00767 <span class="comment">             */</span>
-<a name="l00768"></a>00768 
-<a name="l00769"></a>00769             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SKYLINES_OFFSETS_SLIT"</span>);
-<a name="l00770"></a>00770             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SCIENCE_SKY_EXTRACTED"</span>);
-<a name="l00771"></a>00771             cpl_frameset_erase(work, <span class="stringliteral">"MOS_UNMAPPED_SKY"</span>);
-<a name="l00772"></a>00772             cpl_frameset_erase(work, <span class="stringliteral">"MOS_UNMAPPED_SCIENCE"</span>);
-<a name="l00773"></a>00773             cpl_frameset_erase(work, <span class="stringliteral">"MOS_WAVELENGTH_MAP_SKY"</span>);
-<a name="l00774"></a>00774             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SCIENCE_SKY"</span>);
-<a name="l00775"></a>00775             cpl_frameset_erase(work, <span class="stringliteral">"OBJECT_TABLE"</span>);
-<a name="l00776"></a>00776             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SCIENCE_REDUCED"</span>);
-<a name="l00777"></a>00777             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SKY_REDUCED"</span>);
-<a name="l00778"></a>00778             cpl_frameset_erase(work, <span class="stringliteral">"MOS_ERROR_REDUCED"</span>);
-<a name="l00779"></a>00779             cpl_frameset_erase(work, <span class="stringliteral">"MOS_DISP_COEFF_SKY"</span>);
-<a name="l00780"></a>00780             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SCIENCE_EXTRACTED"</span>);
-<a name="l00781"></a>00781 
-<a name="l00782"></a>00782 
-<a name="l00783"></a>00783             <span class="comment">/*</span>
-<a name="l00784"></a>00784 <span class="comment">             * Of all products, only keep the object tables, the</span>
-<a name="l00785"></a>00785 <span class="comment">             * unmapped sky, and the unmapped science.</span>
-<a name="l00786"></a>00786 <span class="comment">             */</span>
-<a name="l00787"></a>00787 
-<a name="l00788"></a>00788             name = cpl_sprintf(<span class="stringliteral">"object_table_%d.fits"</span>, i);
-<a name="l00789"></a>00789             status = rename(<span class="stringliteral">"object_table.fits"</span>, name);
-<a name="l00790"></a>00790             cpl_free(name);
-<a name="l00791"></a>00791             name = cpl_sprintf(<span class="stringliteral">"mos_unmapped_sky_%d.fits"</span>, i);
-<a name="l00792"></a>00792             status |= rename(<span class="stringliteral">"mos_unmapped_sky.fits"</span>, name);
-<a name="l00793"></a>00793             cpl_free(name);
-<a name="l00794"></a>00794             name = cpl_sprintf(<span class="stringliteral">"mos_unmapped_science_%d.fits"</span>, i);
-<a name="l00795"></a>00795             status |= rename(<span class="stringliteral">"mos_unmapped_science.fits"</span>, name);
-<a name="l00796"></a>00796             cpl_free(name);
-<a name="l00797"></a>00797 
-<a name="l00798"></a>00798             <span class="keywordflow">if</span> (status) {
-<a name="l00799"></a>00799                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>, <span class="stringliteral">"Cannot rename product."</span>);
-<a name="l00800"></a>00800                 cpl_free(mos_science);
-<a name="l00801"></a>00801                 cpl_frameset_delete(work);
-<a name="l00802"></a>00802                 <span class="keywordflow">return</span> -1;
-<a name="l00803"></a>00803             }
-<a name="l00804"></a>00804         }
-<a name="l00805"></a>00805 
-<a name="l00806"></a>00806         cpl_free(mos_science);
-<a name="l00807"></a>00807         cpl_frameset_delete(work);
-<a name="l00808"></a>00808 
-<a name="l00809"></a>00809         <span class="keywordflow">if</span> (fringing) {
-<a name="l00810"></a>00810 
-<a name="l00811"></a>00811             <span class="comment">/*</span>
-<a name="l00812"></a>00812 <span class="comment">             * Produce fringing map by median stacking</span>
-<a name="l00813"></a>00813 <span class="comment">             */</span>
-<a name="l00814"></a>00814 
-<a name="l00815"></a>00815             imagelist = cpl_imagelist_new();
-<a name="l00816"></a>00816 
-<a name="l00817"></a>00817             <span class="keywordflow">for</span> (i = 0; i < mos; i++) {
-<a name="l00818"></a>00818                 name = cpl_sprintf(<span class="stringliteral">"mos_unmapped_science_%d.fits"</span>, i);
-<a name="l00819"></a>00819                 image = cpl_image_load(name, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00820"></a>00820                 cpl_imagelist_set(imagelist, image,
-<a name="l00821"></a>00821                                   cpl_imagelist_get_size(imagelist));
-<a name="l00822"></a>00822             }
-<a name="l00823"></a>00823 
-<a name="l00824"></a>00824             fringes = cpl_imagelist_collapse_median_create(imagelist);
-<a name="l00825"></a>00825             cpl_imagelist_delete(imagelist);
-<a name="l00826"></a>00826             cpl_image_save(fringes, <span class="stringliteral">"fringes.fits"</span>, 
-<a name="l00827"></a>00827                            CPL_BPP_IEEE_FLOAT, NULL, CPL_IO_DEFAULT);
-<a name="l00828"></a>00828 
-<a name="l00829"></a>00829         }
-<a name="l00830"></a>00830 
-<a name="l00831"></a>00831 
-<a name="l00832"></a>00832         <span class="comment">/*</span>
-<a name="l00833"></a>00833 <span class="comment">         * Now stack all frames and extract final objects</span>
-<a name="l00834"></a>00834 <span class="comment">         */</span>
-<a name="l00835"></a>00835 
-<a name="l00836"></a>00836         reference = cpl_table_load(<span class="stringliteral">"object_table_0.fits"</span>, 1, 1);
-<a name="l00837"></a>00837         stacked = cpl_image_load(<span class="stringliteral">"mos_unmapped_science_0.fits"</span>, 
-<a name="l00838"></a>00838                                  CPL_TYPE_FLOAT, 0, 0);
-<a name="l00839"></a>00839         sky_stacked = cpl_image_load(<span class="stringliteral">"mos_unmapped_sky_0.fits"</span>, 
-<a name="l00840"></a>00840                                      CPL_TYPE_FLOAT, 0, 0);
-<a name="l00841"></a>00841         <span class="keywordflow">if</span> (fringing) {
-<a name="l00842"></a>00842             cpl_image_subtract(stacked, fringes);
-<a name="l00843"></a>00843             cpl_image_add(sky_stacked, fringes);
-<a name="l00844"></a>00844         }
-<a name="l00845"></a>00845 
-<a name="l00846"></a>00846 <span class="comment">// Added just for eliminating wcs like in other images</span>
-<a name="l00847"></a>00847         cpl_image_save(stacked, <span class="stringliteral">"mos_unmapped_science_0.fits"</span>, 
-<a name="l00848"></a>00848                        CPL_BPP_IEEE_FLOAT, NULL, CPL_IO_DEFAULT);
-<a name="l00849"></a>00849 <span class="comment">// end of debug line</span>
-<a name="l00850"></a>00850 
-<a name="l00851"></a>00851         <span class="keywordflow">for</span> (i = 1; i < mos; i++) {
-<a name="l00852"></a>00852             name = cpl_sprintf(<span class="stringliteral">"object_table_%d.fits"</span>, i);
-<a name="l00853"></a>00853             objects = cpl_table_load(name, 1, 1);
-<a name="l00854"></a>00854             cpl_free(name);
-<a name="l00855"></a>00855             <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#ge59e20e2bea761316fa1395d5d406965">mos_compute_offset</a>(reference, objects, &offset)) {
-<a name="l00856"></a>00856                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>, <span class="stringliteral">"Cannot compute offset."</span>);
-<a name="l00857"></a>00857                 cpl_table_delete(objects);
-<a name="l00858"></a>00858                 <span class="keywordflow">return</span> -1;
-<a name="l00859"></a>00859             }
-<a name="l00860"></a>00860             cpl_table_delete(objects);
-<a name="l00861"></a>00861             name = cpl_sprintf(<span class="stringliteral">"mos_unmapped_science_%d.fits"</span>, i);
-<a name="l00862"></a>00862             image = cpl_image_load(name, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00863"></a>00863 
-<a name="l00864"></a>00864             <span class="keywordflow">if</span> (fringing) {
-<a name="l00865"></a>00865                 cpl_image_subtract(image, fringes);
-<a name="l00866"></a>00866             }
-<a name="l00867"></a>00867 
-<a name="l00868"></a>00868             cpl_msg_info(<span class="stringliteral">"vimos_science"</span>, 
-<a name="l00869"></a>00869                          <span class="stringliteral">"Frame %d offset relative "</span>
-<a name="l00870"></a>00870                          <span class="stringliteral">"to frame 1: %.2f pix\n"</span>, i + 1, offset); 
-<a name="l00871"></a>00871 
-<a name="l00872"></a>00872             <span class="keywordflow">if</span> (int_alignment) {
-<a name="l00873"></a>00873                 offset = floor(offset + 0.5);
-<a name="l00874"></a>00874                 cpl_msg_info(<span class="stringliteral">"vimos_science"</span>, 
-<a name="l00875"></a>00875                              <span class="stringliteral">"Nearest neighbour offset applied is "</span>
-<a name="l00876"></a>00876                              <span class="stringliteral">"%.0f pix\n"</span>, offset); 
-<a name="l00877"></a>00877             }
-<a name="l00878"></a>00878 
-<a name="l00879"></a>00879             <a class="code" href="group__moses.html#gf708c4804f0aa98415025f2f7ed31f11">mos_image_shift</a>(image, offset, 0.0);
-<a name="l00880"></a>00880             cpl_image_save(image, name, CPL_BPP_IEEE_FLOAT, 
-<a name="l00881"></a>00881                            NULL, CPL_IO_DEFAULT);
-<a name="l00882"></a>00882             cpl_free(name);
-<a name="l00883"></a>00883 
-<a name="l00884"></a>00884             <span class="comment">/*</span>
-<a name="l00885"></a>00885 <span class="comment">             * Here stacking sky frames, they are always averaged</span>
-<a name="l00886"></a>00886 <span class="comment">             */</span>
-<a name="l00887"></a>00887 
-<a name="l00888"></a>00888             name = cpl_sprintf(<span class="stringliteral">"mos_unmapped_sky_%d.fits"</span>, i);
-<a name="l00889"></a>00889             sky_image = cpl_image_load(name, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00890"></a>00890 
-<a name="l00891"></a>00891             <span class="keywordflow">if</span> (fringing) {
-<a name="l00892"></a>00892                 cpl_image_add(sky_image, fringes);
-<a name="l00893"></a>00893             }
-<a name="l00894"></a>00894 
-<a name="l00895"></a>00895             <a class="code" href="group__moses.html#gf708c4804f0aa98415025f2f7ed31f11">mos_image_shift</a>(sky_image, offset, 0.0);
-<a name="l00896"></a>00896             cpl_free(name);
-<a name="l00897"></a>00897             cpl_image_add(sky_stacked, sky_image);
-<a name="l00898"></a>00898             cpl_image_delete(sky_image);
-<a name="l00899"></a>00899 
-<a name="l00900"></a>00900             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"average"</span>) == 0) {
-<a name="l00901"></a>00901                 cpl_image_add(stacked, image);
-<a name="l00902"></a>00902                 cpl_image_delete(image);
-<a name="l00903"></a>00903             }
-<a name="l00904"></a>00904             <span class="keywordflow">else</span> {
-<a name="l00905"></a>00905                 <span class="keywordflow">if</span> (i == 1) {
-<a name="l00906"></a>00906                     imagelist = cpl_imagelist_new();
-<a name="l00907"></a>00907                     cpl_imagelist_set(imagelist, stacked,
-<a name="l00908"></a>00908                                       cpl_imagelist_get_size(imagelist));
-<a name="l00909"></a>00909                 }
-<a name="l00910"></a>00910                 cpl_imagelist_set(imagelist, image,
-<a name="l00911"></a>00911                                   cpl_imagelist_get_size(imagelist));
-<a name="l00912"></a>00912             }
-<a name="l00913"></a>00913         }
-<a name="l00914"></a>00914         cpl_table_delete(reference);
-<a name="l00915"></a>00915 
-<a name="l00916"></a>00916         cpl_image_divide_scalar(sky_stacked, mos);
-<a name="l00917"></a>00917 
-<a name="l00918"></a>00918         <span class="keywordflow">if</span> (fringing) {
-<a name="l00919"></a>00919             cpl_image_delete(fringes);
-<a name="l00920"></a>00920         }
-<a name="l00921"></a>00921 
-<a name="l00922"></a>00922         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"average"</span>) == 0) {
-<a name="l00923"></a>00923             cpl_image_divide_scalar(stacked, mos);
-<a name="l00924"></a>00924         }
-<a name="l00925"></a>00925 
-<a name="l00926"></a>00926         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"median"</span>) == 0) {
-<a name="l00927"></a>00927             stacked = cpl_imagelist_collapse_median_create(imagelist);
-<a name="l00928"></a>00928             cpl_imagelist_delete(imagelist);
-<a name="l00929"></a>00929         }
-<a name="l00930"></a>00930 
-<a name="l00931"></a>00931         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"minmax"</span>) == 0) {
-<a name="l00932"></a>00932             stacked = cpl_imagelist_collapse_minmax_create(imagelist,
-<a name="l00933"></a>00933                                                            min_reject,
-<a name="l00934"></a>00934                                                            max_reject);
-<a name="l00935"></a>00935             cpl_imagelist_delete(imagelist);
-<a name="l00936"></a>00936         }
-<a name="l00937"></a>00937 
-<a name="l00938"></a>00938         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"ksigma"</span>) == 0) {
-<a name="l00939"></a>00939             stacked = <a class="code" href="group__moses.html#g8fabeef3808c1cb7e888699cd4f4d660">mos_ksigma_stack</a>(imagelist, klow, khigh, kiter, NULL);
-<a name="l00940"></a>00940             cpl_imagelist_delete(imagelist);
-<a name="l00941"></a>00941         }
-<a name="l00942"></a>00942 
-<a name="l00943"></a>00943         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l00944"></a>00944 
-<a name="l00945"></a>00945         gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l00946"></a>00946         ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);
-<a name="l00947"></a>00947         ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span>
-<a name="l00948"></a>00948 
-<a name="l00949"></a>00949         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, stacked, unmapped_science_tag,
-<a name="l00950"></a>00950                            header, parlist, <span class="stringliteral">"vimos_science"</span>, version)) {
-<a name="l00951"></a>00951             cpl_image_delete(stacked);
-<a name="l00952"></a>00952             cpl_image_delete(sky_stacked);
-<a name="l00953"></a>00953             cpl_propertylist_delete(header);
-<a name="l00954"></a>00954             cpl_table_delete(slits);
-<a name="l00955"></a>00955             <span class="keywordflow">return</span> -1;
-<a name="l00956"></a>00956         }
-<a name="l00957"></a>00957 
-<a name="l00958"></a>00958         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, sky_stacked, unmapped_sky_tag,
-<a name="l00959"></a>00959                            header, parlist, <span class="stringliteral">"vimos_science"</span>, version)) {
-<a name="l00960"></a>00960             cpl_image_delete(stacked);
-<a name="l00961"></a>00961             cpl_image_delete(sky_stacked);
-<a name="l00962"></a>00962             cpl_propertylist_delete(header);
-<a name="l00963"></a>00963             cpl_table_delete(slits);
-<a name="l00964"></a>00964             <span class="keywordflow">return</span> -1;
-<a name="l00965"></a>00965         }
-<a name="l00966"></a>00966 
-<a name="l00967"></a>00967         cpl_parameter_set_bool(param, time_normal);
-<a name="l00968"></a>00968 
-<a name="l00969"></a>00969         cpl_image_turn(stacked, rotate);
-<a name="l00970"></a>00970         cpl_image_turn(sky_stacked, rotate);
-<a name="l00971"></a>00971 
-<a name="l00972"></a>00972         nx = cpl_image_get_size_x(stacked);
-<a name="l00973"></a>00973         ny = cpl_image_get_size_y(stacked);
-<a name="l00974"></a>00974 
-<a name="l00975"></a>00975         polytraces = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, curv_coeff_tag, 1);
-<a name="l00976"></a>00976 
-<a name="l00977"></a>00977         slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l00978"></a>00978         <a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a>(slits, -rotate, nx, ny);
-<a name="l00979"></a>00979 
-<a name="l00980"></a>00980 <span class="comment">// FIXME: Qui potremmo tirare su una tabella allineata al cielo, se esiste.</span>
-<a name="l00981"></a>00981         idscoeff = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, disp_coeff_tag, 1);
-<a name="l00982"></a>00982 
-<a name="l00983"></a>00983         cpl_msg_indent_less();
-<a name="l00984"></a>00984         cpl_msg_info(<span class="stringliteral">"vimos_science"</span>, 
-<a name="l00985"></a>00985                      <span class="stringliteral">"Processing stacked scientific spectra..."</span>);
-<a name="l00986"></a>00986         cpl_msg_indent_more();
-<a name="l00987"></a>00987 
-<a name="l00988"></a>00988         smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(stacked, slits, polytraces, refwave,
-<a name="l00989"></a>00989                                           startwavelength, endwavelength,
-<a name="l00990"></a>00990                                           dispersion, flux, NULL);
-<a name="l00991"></a>00991 
-<a name="l00992"></a>00992         cpl_image_delete(stacked);
-<a name="l00993"></a>00993 
-<a name="l00994"></a>00994         sky_smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(sky_stacked, slits, polytraces, 
-<a name="l00995"></a>00995                                               refwave, startwavelength, 
-<a name="l00996"></a>00996                                               endwavelength, dispersion, 
-<a name="l00997"></a>00997                                               flux, NULL);
-<a name="l00998"></a>00998 
-<a name="l00999"></a>00999         cpl_image_delete(sky_stacked);
-<a name="l01000"></a>01000         cpl_table_delete(polytraces);
-<a name="l01001"></a>01001 
-<a name="l01002"></a>01002         mapped = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, refwave,
-<a name="l01003"></a>01003                                             startwavelength, endwavelength,
-<a name="l01004"></a>01004                                             dispersion, idscoeff, flux);
-<a name="l01005"></a>01005 
-<a name="l01006"></a>01006         cpl_image_delete(smapped);
-<a name="l01007"></a>01007 
-<a name="l01008"></a>01008         sky_mapped = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(sky_smapped, refwave,
-<a name="l01009"></a>01009                                                 startwavelength, endwavelength,
-<a name="l01010"></a>01010                                                 dispersion, idscoeff, flux);
-<a name="l01011"></a>01011         cpl_table_delete(idscoeff);
-<a name="l01012"></a>01012 
-<a name="l01013"></a>01013         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01014"></a>01014         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01015"></a>01015         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,
-<a name="l01016"></a>01016                                        startwavelength + dispersion/2);
-<a name="l01017"></a>01017         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01018"></a>01018         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01019"></a>01019         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01020"></a>01020         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01021"></a>01021         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01022"></a>01022         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01023"></a>01023         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01024"></a>01024 
-<a name="l01025"></a>01025 <span class="comment">//  Later, when you have alltime</span>
-<a name="l01026"></a>01026 <span class="comment">//      if (time_normal) {</span>
-<a name="l01027"></a>01027 <span class="comment">//          image = cpl_image_divide_scalar_create(mapped, alltime);</span>
-<a name="l01028"></a>01028 <span class="comment">//          if (dfs_save_image(frameset, image, mapped_science_sky_tag, header,</span>
-<a name="l01029"></a>01029 <span class="comment">//                             parlist, recipe, version))</span>
-<a name="l01030"></a>01030 <span class="comment">//              vimos_science_exit(NULL);</span>
-<a name="l01031"></a>01031 <span class="comment">//          cpl_image_delete(image); image = NULL;</span>
-<a name="l01032"></a>01032 <span class="comment">//      }</span>
-<a name="l01033"></a>01033 <span class="comment">//      else {</span>
-<a name="l01034"></a>01034 
-<a name="l01035"></a>01035             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped, mapped_science_tag,
-<a name="l01036"></a>01036                                header, parlist, <span class="stringliteral">"vimos_science"</span>, version)) {
-<a name="l01037"></a>01037                 cpl_propertylist_delete(header);
-<a name="l01038"></a>01038                 cpl_image_delete(mapped);
-<a name="l01039"></a>01039                 cpl_image_delete(sky_mapped);
-<a name="l01040"></a>01040                 cpl_table_delete(slits);
-<a name="l01041"></a>01041                 <span class="keywordflow">return</span> -1;
-<a name="l01042"></a>01042             }
-<a name="l01043"></a>01043 
-<a name="l01044"></a>01044             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, sky_mapped, mapped_sky_tag,
-<a name="l01045"></a>01045                                header, parlist, <span class="stringliteral">"vimos_science"</span>, version)) {
-<a name="l01046"></a>01046                 cpl_propertylist_delete(header);
-<a name="l01047"></a>01047                 cpl_image_delete(mapped);
-<a name="l01048"></a>01048                 cpl_image_delete(sky_mapped);
-<a name="l01049"></a>01049                 cpl_table_delete(slits);
-<a name="l01050"></a>01050                 <span class="keywordflow">return</span> -1;
-<a name="l01051"></a>01051             }
-<a name="l01052"></a>01052 <span class="comment">//      }</span>
-<a name="l01053"></a>01053 
-<a name="l01054"></a>01054         cpl_msg_indent_less();
-<a name="l01055"></a>01055         cpl_msg_info(<span class="stringliteral">"vimos_science"</span>, <span class="stringliteral">"Final object detection..."</span>);
-<a name="l01056"></a>01056         cpl_msg_indent_more();
-<a name="l01057"></a>01057 
-<a name="l01058"></a>01058         <span class="keywordflow">if</span> (cosmics || strcmp(stack_method, <span class="stringliteral">"average"</span>)) {
-<a name="l01059"></a>01059             image = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped, slits, slit_margin, ext_radius,
-<a name="l01060"></a>01060                                        cont_radius);
-<a name="l01061"></a>01061         }
-<a name="l01062"></a>01062         <span class="keywordflow">else</span> {
-<a name="l01063"></a>01063             cpl_image *mapped_cleaned = cpl_image_duplicate(mapped);
-<a name="l01064"></a>01064             <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);
-<a name="l01065"></a>01065             image = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin,
-<a name="l01066"></a>01066                                        ext_radius, cont_radius);
-<a name="l01067"></a>01067 
-<a name="l01068"></a>01068             cpl_image_delete(mapped_cleaned);
-<a name="l01069"></a>01069         }
-<a name="l01070"></a>01070 
-<a name="l01071"></a>01071         cpl_image_delete(image);
-<a name="l01072"></a>01072 
-<a name="l01073"></a>01073         <a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a>(slits, rotate, ny, nx);
-<a name="l01074"></a>01074         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, object_table_tag, NULL, parlist,
-<a name="l01075"></a>01075                            <span class="stringliteral">"vimos_science"</span>, version)) {
-<a name="l01076"></a>01076             cpl_propertylist_delete(header);
-<a name="l01077"></a>01077             cpl_image_delete(mapped);
-<a name="l01078"></a>01078             cpl_image_delete(sky_mapped);
-<a name="l01079"></a>01079             cpl_table_delete(slits);
-<a name="l01080"></a>01080             <span class="keywordflow">return</span> -1;
-<a name="l01081"></a>01081         }
-<a name="l01082"></a>01082 
-<a name="l01083"></a>01083         cpl_msg_indent_less();
-<a name="l01084"></a>01084         cpl_msg_info(<span class="stringliteral">"vimos_science"</span>, <span class="stringliteral">"Final object extraction..."</span>);
-<a name="l01085"></a>01085         cpl_msg_indent_more();
-<a name="l01086"></a>01086 
-<a name="l01087"></a>01087         images = <a class="code" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">mos_extract_objects</a>(mapped, sky_mapped, slits,
-<a name="l01088"></a>01088                                      ext_mode, ron, gain, mos);
-<a name="l01089"></a>01089 
-<a name="l01090"></a>01090         cpl_image_delete(mapped);
-<a name="l01091"></a>01091         cpl_image_delete(sky_mapped);
-<a name="l01092"></a>01092         cpl_table_delete(slits);
-<a name="l01093"></a>01093 
-<a name="l01094"></a>01094         <span class="keywordflow">if</span> (images) {
-<a name="l01095"></a>01095 <span class="comment">//            if (time_normalise)</span>
-<a name="l01096"></a>01096 <span class="comment">//                cpl_image_divide_scalar(images[0], alltime);</span>
-<a name="l01097"></a>01097 
-<a name="l01098"></a>01098             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[0], reduced_science_tag, 
-<a name="l01099"></a>01099                                header, parlist, <span class="stringliteral">"vimos_science"</span>, version)) {
-<a name="l01100"></a>01100                 cpl_image_delete(images[0]);
-<a name="l01101"></a>01101                 cpl_image_delete(images[1]);
-<a name="l01102"></a>01102                 cpl_image_delete(images[2]);
-<a name="l01103"></a>01103                 cpl_free(images);
-<a name="l01104"></a>01104                 cpl_propertylist_delete(header);
-<a name="l01105"></a>01105                 <span class="keywordflow">return</span> -1;
-<a name="l01106"></a>01106             }
-<a name="l01107"></a>01107 
-<a name="l01108"></a>01108             cpl_image_delete(images[0]);
-<a name="l01109"></a>01109 
-<a name="l01110"></a>01110 <span class="comment">//            if (time_normalise)</span>
-<a name="l01111"></a>01111 <span class="comment">//                cpl_image_divide_scalar(images[1], alltime);</span>
-<a name="l01112"></a>01112 
-<a name="l01113"></a>01113             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[1], reduced_sky_tag, header,
-<a name="l01114"></a>01114                                parlist, <span class="stringliteral">"vimos_science"</span>, version)) {
-<a name="l01115"></a>01115                 cpl_image_delete(images[1]);
-<a name="l01116"></a>01116                 cpl_image_delete(images[2]);
-<a name="l01117"></a>01117                 cpl_free(images);
-<a name="l01118"></a>01118                 cpl_propertylist_delete(header);
-<a name="l01119"></a>01119                 <span class="keywordflow">return</span> -1;
-<a name="l01120"></a>01120             }
-<a name="l01121"></a>01121 
-<a name="l01122"></a>01122             cpl_image_delete(images[1]);
-<a name="l01123"></a>01123 
-<a name="l01124"></a>01124 <span class="comment">//            if (time_normalise)</span>
-<a name="l01125"></a>01125 <span class="comment">//                cpl_image_divide_scalar(images[2], alltime);</span>
-<a name="l01126"></a>01126 
-<a name="l01127"></a>01127             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[2], reduced_error_tag, header,
-<a name="l01128"></a>01128                                parlist, <span class="stringliteral">"vimos_science"</span>, version)) {
-<a name="l01129"></a>01129                 cpl_image_delete(images[2]);
-<a name="l01130"></a>01130                 cpl_free(images);
-<a name="l01131"></a>01131                 cpl_propertylist_delete(header);
-<a name="l01132"></a>01132                 <span class="keywordflow">return</span> -1;
-<a name="l01133"></a>01133             }
-<a name="l01134"></a>01134 
-<a name="l01135"></a>01135             cpl_image_delete(images[2]);
-<a name="l01136"></a>01136 
-<a name="l01137"></a>01137             cpl_free(images);
-<a name="l01138"></a>01138         }
-<a name="l01139"></a>01139         <span class="keywordflow">else</span> {
-<a name="l01140"></a>01140             cpl_msg_warning(<span class="stringliteral">"vimos_science"</span>, <span class="stringliteral">"No objects found: the products "</span>
-<a name="l01141"></a>01141                             <span class="stringliteral">"%s, %s, and %s are not created"</span>,
-<a name="l01142"></a>01142                             reduced_science_tag, reduced_sky_tag,
-<a name="l01143"></a>01143                             reduced_error_tag);
-<a name="l01144"></a>01144         }
-<a name="l01145"></a>01145 
-<a name="l01146"></a>01146         cpl_propertylist_delete(header);
-<a name="l01147"></a>01147 
-<a name="l01148"></a>01148         <span class="keywordflow">return</span> 0;
-<a name="l01149"></a>01149     }
-<a name="l01150"></a>01150 
-<a name="l01151"></a>01151     <span class="keywordflow">return</span> <a class="code" href="group__vimos__science__impl.html#g79a502c79f4843218e3d0d4adec9c907">vimos_science_impl</a>(frameset, parlist);
-<a name="l01152"></a>01152 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/vimos__science_8c_source.html b/html/vimos__science_8c_source.html
new file mode 100644
index 0000000..e9a10a6
--- /dev/null
+++ b/html/vimos__science_8c_source.html
@@ -0,0 +1,1167 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: vimos_science.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_b351cdfeb4656d7d168dc72b273024e7.html">recipes</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">vimos_science.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: vimos_science.c,v 1.22 2010-09-14 07:38:16 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-09-14 07:38:16 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.22 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> <span class="preprocessor">#include <string.h></span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <vimos_science_impl.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_stack.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_tools.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> </div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_create(cpl_plugin *);</div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_exec(cpl_plugin *);</div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_destroy(cpl_plugin *);</div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science(cpl_parameterlist *, cpl_frameset *);</div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> </div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="keyword">static</span> <span class="keywordtype">char</span> vimos_science_description[] =</div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="stringliteral">"This recipe is used to reduce scientific spectra using the extraction\n"</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="stringliteral">"mask and the products created by the recipe vimos_calib. The spectra are\n"</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="stringliteral">"bias subtracted, flat fielded (if a normalised flat field is specified)\n"</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="stringliteral">"and remapped eliminating the optical distortions. The wavelength calibration\n"</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="stringliteral">"can be optionally upgraded using a number of sky lines: if no sky lines\n"</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="stringliteral">"catalog of wavelengths is specified, an internal one is used instead.\n"</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="stringliteral">"If the alignment to the sky lines is performed, the input dispersion\n"</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="stringliteral">"coefficients table is upgraded and saved to disk, and a new CCD wavelengths\n"</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="stringliteral">"map is created. A grism table (typically depending on the grism used)\n"</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="stringliteral">"may also be specified: this table contains a default recipe parameter\n"</span> </div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="stringliteral">"setting to control the way spectra are extracted for a specific instrument\n"</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="stringliteral">"mode, as it is used for automatic run of the pipeline on Paranal and in\n"</span> </div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="stringliteral">"Garching. If this table is specified, it will modify the default recipe\n"</span> </div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="stringliteral">"parameter setting, with the exception of those parameters which have been\n"</span> </div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="stringliteral">"explicitly modifyed on the command line. If a grism table is not specified,\n"</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="stringliteral">"the input recipe parameters values will always be read from the command\n"</span> </div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="stringliteral">"line, or from an esorex configuration file if present, or from their\n"</span> </div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="stringliteral">"generic default values (that are rarely meaningful).\n"</span> </div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="stringliteral">"MOS_SLIT_LOCATION and MOS_CURV_COEFF tables are not (yet) expected for\n"</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="stringliteral">"long-slit-like data.\n"</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="stringliteral">"Only in case of a standard star exposure input, the atmospheric extinction\n"</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="stringliteral">"table and a table with the physical fluxes of the observed standard star\n"</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="stringliteral">"must be specified in input.\n\n"</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="stringliteral">"Input files:\n\n"</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="stringliteral">"  DO category:                Type:       Explanation:         Required:\n"</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="stringliteral">"  MOS_SCIENCE                 Raw         Scientific exposure     Y\n"</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="stringliteral">"  or MOS_STANDARD             Raw         Standard star exposure  Y\n"</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span> <span class="stringliteral">"  MASTER_BIAS                 Calib       Master bias             Y\n"</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span> <span class="stringliteral">"  SKY_LINE_CATALOG            Calib       Sky lines catalog       .\n"</span></div>
+<div class="line"><a name="l00078"></a><span class="lineno">   78</span> <span class="stringliteral">"  MOS_MASTER_SCREEN_FLAT      Calib       Normalised flat field   .\n"</span></div>
+<div class="line"><a name="l00079"></a><span class="lineno">   79</span> <span class="stringliteral">"  MOS_DISP_COEFF              Calib       Inverse dispersion      Y\n"</span></div>
+<div class="line"><a name="l00080"></a><span class="lineno">   80</span> <span class="stringliteral">"  MOS_CURV_COEFF              Calib       Spectral curvature      Y\n"</span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="stringliteral">"  MOS_SLIT_LOCATION           Calib       Slits positions table   Y\n"</span></div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> <span class="stringliteral">"  GRISM_TABLE                 Calib       Grism table             .\n"</span></div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> <span class="stringliteral">"  In case MOS_STANDARD is specified in input,\n"</span></div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span> <span class="stringliteral">"  EXTINCT_TABLE               Calib       Atmospheric extinction  Y\n"</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="stringliteral">"  STD_FLUX_TABLE              Calib       Standard star flux      Y\n"</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> <span class="stringliteral">"Output files:\n\n"</span></div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span> <span class="stringliteral">"  DO category:                Data type:  Explanation:\n"</span></div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span> <span class="stringliteral">"  MOS_SCIENCE_REDUCED         FITS image  Extracted scientific spectra\n"</span></div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span> <span class="stringliteral">"  or MOS_STANDARD_REDUCED     FITS image  Extracted standard star spectrum\n"</span></div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span> <span class="stringliteral">"  MOS_SKY_REDUCED             FITS image  Extracted sky spectra\n"</span></div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span> <span class="stringliteral">"  MOS_ERROR_REDUCED           FITS image  Errors on extracted spectra\n"</span></div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span> <span class="stringliteral">"  MOS_UNMAPPED_SCIENCE        FITS image  Sky subtracted scientific spectra\n"</span></div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span> <span class="stringliteral">"  or MOS_UNMAPPED_STANDARD    FITS image  Sky subtracted standard spectrum\n"</span></div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span> <span class="stringliteral">"  MOS_SCIENCE_EXTRACTED       FITS image  Rectified scientific spectra\n"</span></div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span> <span class="stringliteral">"  or MOS_STANDARD_EXTRACTED   FITS image  Rectified standard star spectrum\n"</span></div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span> <span class="stringliteral">"  MOS_SCIENCE_SKY_EXTRACTED   FITS image  Rectified science spectra with sky\n"</span></div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span> <span class="stringliteral">"or MOS_STANDARD_SKY_EXTRACTED FITS image  Rectified std spectrum with sky\n"</span></div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span> <span class="stringliteral">"  MOS_SCIENCE_SKY             FITS image  Rectified sky spectra\n"</span></div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span> <span class="stringliteral">"  MOS_UNMAPPED_SKY            FITS image  Sky on CCD\n"</span></div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span> <span class="stringliteral">"  MOS_GLOBAL_SKY_SPECTRUM     FITS table  Global sky spectrum\n"</span></div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span> <span class="stringliteral">"  OBJECT_TABLE                FITS table  Positions of detected objects\n"</span></div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> <span class="stringliteral">"  Only if the sky-alignment of the wavelength solution is requested:\n"</span></div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span> <span class="stringliteral">"  MOS_SKYLINES_OFFSETS_LONG   FITS table  Sky lines offsets (LSS-like data)\n"</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="stringliteral">"or MOS_SKYLINES_OFFSETS_SLIT  FITS table  Sky lines offsets (MOS-like data)\n"</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="stringliteral">"  MOS_DISP_COEFF_SKY          FITS table  Upgraded dispersion coefficients\n"</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> <span class="stringliteral">"  MOS_WAVELENGTH_MAP_SKY      FITS image  Upgraded wavelength map\n"</span></div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span> <span class="stringliteral">"\n"</span></div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span> <span class="stringliteral">"  Only if a MOS_STANDARD is specified in input:\n"</span></div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> <span class="stringliteral">"  MOS_SPECPHOT_TABLE          FITS table  Efficiency and response curves\n\n"</span>;</div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span> </div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span> <span class="keywordtype">int</span> <a class="code" href="group__fors__bias.html#ga31d1fccd4cd15b1c1f3c5edc8cb18693" title="Build the list of available plugins, for this module.">cpl_plugin_get_info</a>(cpl_pluginlist *<a class="code" href="structlist.html">list</a>)</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span> {</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span>     cpl_recipe *recipe = cpl_calloc(1, <span class="keyword">sizeof</span> *recipe );</div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     cpl_plugin *plugin = &recipe->interface;</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span> </div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     cpl_plugin_init(plugin,</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>                     CPL_PLUGIN_API,</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>                     FORS_BINARY_VERSION,</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>                     CPL_PLUGIN_TYPE_RECIPE,</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>                     <span class="stringliteral">"vimos_science"</span>,</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>                     <span class="stringliteral">"Extraction of scientific spectra"</span>,</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>                     vimos_science_description,</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span>                     <span class="stringliteral">"Carlo Izzo"</span>,</div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>                     PACKAGE_BUGREPORT,</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span>     <span class="stringliteral">"This file is currently part of the FORS Instrument Pipeline\n"</span></div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     <span class="stringliteral">"Copyright (C) 2002-2010 European Southern Observatory\n\n"</span></div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     <span class="stringliteral">"This program is free software; you can redistribute it and/or modify\n"</span></div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     <span class="stringliteral">"it under the terms of the GNU General Public License as published by\n"</span></div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span>     <span class="stringliteral">"the Free Software Foundation; either version 2 of the License, or\n"</span></div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="stringliteral">"(at your option) any later version.\n\n"</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span>     <span class="stringliteral">"This program is distributed in the hope that it will be useful,\n"</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span>     <span class="stringliteral">"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span>     <span class="stringliteral">"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"</span></div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="stringliteral">"GNU General Public License for more details.\n\n"</span></div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="stringliteral">"You should have received a copy of the GNU General Public License\n"</span></div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="stringliteral">"along with this program; if not, write to the Free Software Foundation,\n"</span></div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="stringliteral">"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"</span>,</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>                     vimos_science_create,</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>                     vimos_science_exec,</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>                     vimos_science_destroy);</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span> </div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     cpl_pluginlist_append(list, plugin);</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     </div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span> }</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span> </div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span> </div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_create(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span> {</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     cpl_recipe    *recipe;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     cpl_parameter *p;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span> </div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span> </div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span> <span class="comment">     * Check that the plugin is part of a valid recipe </span></div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span> </div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span> </div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span> <span class="comment">     * Create the parameters list in the cpl_recipe object </span></div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span> </div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     recipe->parameters = cpl_parameterlist_new(); </div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span> </div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span> </div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span> <span class="comment">     * Dispersion</span></div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span> </div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.dispersion"</span>,</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span>                                 <span class="stringliteral">"Resampling step (Angstrom/pixel)"</span>,</div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span>                                 0.0);</div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"dispersion"</span>);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span> </div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="comment">     * Sky lines alignment</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span> </div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.skyalign"</span>,</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>                                 <span class="stringliteral">"Polynomial order for sky lines alignment, "</span></div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>                                 <span class="stringliteral">"or -1 to avoid alignment"</span>,</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>                                 0);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyalign"</span>);</div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span> <span class="comment">     * Line catalog table column containing the sky reference wavelengths</span></div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span> </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.wcolumn"</span>,</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span>                                 CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>                                 <span class="stringliteral">"Name of sky line catalog table column "</span></div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>                                 <span class="stringliteral">"with wavelengths"</span>,</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>                                 <span class="stringliteral">"WLEN"</span>);</div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"wcolumn"</span>);</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span> </div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span> <span class="comment">     * Start wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span> </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.startwavelength"</span>,</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>                                 <span class="stringliteral">"Start wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>                                 0.0);</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"startwavelength"</span>);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span> </div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span> <span class="comment">     * End wavelength for spectral extraction</span></div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.endwavelength"</span>,</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>                                 <span class="stringliteral">"End wavelength in spectral extraction"</span>,</div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span>                                 0.0);</div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"endwavelength"</span>);</div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span> </div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span> <span class="comment">     * Reference wavelength for wavelength calibration</span></div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span> </div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.reference"</span>,</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span>                                 CPL_TYPE_DOUBLE,</div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>                                 <span class="stringliteral">"Reference wavelength for calibration"</span>,</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>                                 0.0);</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"reference"</span>);</div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span> <span class="comment">     * Flux conservation</span></div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span> </div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.flux"</span>,</div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>                                 <span class="stringliteral">"Apply flux conservation"</span>,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>                                 TRUE);</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flux"</span>);</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span> </div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span> <span class="comment">     * Apply flat field</span></div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> </div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.flatfield"</span>,</div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                                 <span class="stringliteral">"Apply flat field"</span>,</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>                                 TRUE);</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"flatfield"</span>);</div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span> </div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> <span class="comment">     * Global sky subtraction</span></div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span> </div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.skyglobal"</span>,</div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>                                 <span class="stringliteral">"Subtract global sky spectrum from CCD"</span>,</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>                                 FALSE);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skyglobal"</span>);</div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> </div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> <span class="comment">     * Local sky subtraction on extracted spectra</span></div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.skymedian"</span>,</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span>                                 <span class="stringliteral">"Sky subtraction from extracted slit spectra"</span>,</div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>                                 FALSE);</div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skymedian"</span>);</div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span> </div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span> <span class="comment">     * Local sky subtraction on CCD spectra</span></div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span> </div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.skylocal"</span>,</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>                                 <span class="stringliteral">"Sky subtraction from CCD slit spectra"</span>,</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span>                                 TRUE);</div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"skylocal"</span>);</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span> </div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span> <span class="comment">     * Cosmic rays removal</span></div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.cosmics"</span>,</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>                                 <span class="stringliteral">"Eliminate cosmic rays hits (only if global "</span></div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>                                 <span class="stringliteral">"or local sky subtraction is also requested)"</span>,</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>                                 TRUE);</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cosmics"</span>);</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span> </div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span> <span class="comment">     * Slit margin</span></div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span> </div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.slit_margin"</span>,</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>                                 <span class="stringliteral">"Number of pixels to exclude at each slit "</span></div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>                                 <span class="stringliteral">"in object detection and extraction"</span>,</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>                                 3);</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"slit_margin"</span>);</div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span> </div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span> <span class="comment">     * Extraction radius</span></div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span> </div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.ext_radius"</span>,</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>                                 <span class="stringliteral">"Maximum extraction radius for detected "</span></div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>                                 <span class="stringliteral">"objects (pixel)"</span>,</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>                                 6);</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_radius"</span>);</div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span> <span class="comment">     * Contamination radius</span></div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span> </div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.cont_radius"</span>,</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span>                                 <span class="stringliteral">"Minimum distance at which two objects "</span></div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>                                 <span class="stringliteral">"of equal luminosity do not contaminate "</span></div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>                                 <span class="stringliteral">"each other (pixel)"</span>,</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>                                 0);</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"cont_radius"</span>);</div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span> </div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> <span class="comment">     * Object extraction method</span></div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span> </div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.ext_mode"</span>,</div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>                                 <span class="stringliteral">"Object extraction method: 0 = aperture, "</span></div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>                                 <span class="stringliteral">"1 = Horne optimal extraction"</span>,</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>                                 1);</div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"ext_mode"</span>);</div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span> </div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span> <span class="comment">     * Normalise output by exposure time</span></div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span> </div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.time_normalise"</span>,</div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>                                 <span class="stringliteral">"Normalise output spectra by the exposure time"</span>,</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span>                                 TRUE);</div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"time_normalise"</span>);</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span> </div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span> <span class="comment">     * Look for a standard star in any frame classified as MOS_STANDARD</span></div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span> </div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.anyframe"</span>,</div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span>                                 <span class="stringliteral">"Look for a standard star in any frame "</span></div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>                                 <span class="stringliteral">"classified as MOS_STANDARD"</span>,</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                                 FALSE);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"anyframe"</span>);</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span> </div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span> </div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span> <span class="comment">     * Order of polynomial modeling the instrument response.</span></div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span> </div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.response"</span>,</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>                                 CPL_TYPE_INT,</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span>                                 <span class="stringliteral">"Order of polynomial modeling the "</span></div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>                                 <span class="stringliteral">"instrument response"</span>,</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span>                                 5);</div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"response"</span>);</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span> </div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span> </div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span> <span class="comment">     * Type of alignment of dithered frames</span></div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span> </div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span>     p = cpl_parameter_new_enum(<span class="stringliteral">"fors.vimos_science.alignment"</span>,</div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span>                                CPL_TYPE_STRING,</div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>                                <span class="stringliteral">"Type of alignment of dithered frames, "</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span>                                <span class="stringliteral">"either to the nearest neighbour pixel "</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span>                                <span class="stringliteral">"or to fractions of pixel"</span>,</div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span>                                <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>                                <span class="stringliteral">"integer"</span>, 2,</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span>                                <span class="stringliteral">"integer"</span>, <span class="stringliteral">"float"</span>);</div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"alignment"</span>);</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span> </div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span> </div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span> <span class="comment">     * Stacking method of dithered frames</span></div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span> </div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span>     <a class="code" href="group__fors__stack.html#gaffedf6eb66366c19b2d7ac5443000d15" title="Define recipe parameters.">fors_stack_define_parameters</a>(recipe->parameters, </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>                                  <span class="stringliteral">"fors.vimos_science"</span>, <span class="stringliteral">"average"</span>);</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span> </div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> <span class="comment">     * Fringing correction</span></div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span> </div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.fringing"</span>,</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>                                 <span class="stringliteral">"Apply fringing correction "</span></div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>                                 <span class="stringliteral">"(only for dithered observations)"</span>,</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>                                 TRUE);</div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"fringing"</span>);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span> </div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span> </div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span> <span class="comment">     * Computation of QC1 parameters</span></div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span> </div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span>     p = cpl_parameter_new_value(<span class="stringliteral">"fors.vimos_science.qc"</span>,</div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>                                 CPL_TYPE_BOOL,</div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                                 <span class="stringliteral">"Compute QC1 parameters"</span>,</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span>                                 <span class="stringliteral">"fors.vimos_science"</span>,</div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>                                 TRUE);</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span>     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, <span class="stringliteral">"qc"</span>);</div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span>     cpl_parameterlist_append(recipe->parameters, p);</div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span> </div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span> </div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span> }</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span> </div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span> </div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_exec(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span> {</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>     </div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span> </div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>     <span class="keywordflow">return</span> vimos_science(recipe->parameters, recipe->frames);</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> }</div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span> </div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> </div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science_destroy(cpl_plugin *plugin)</div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span> {</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span>     cpl_recipe *recipe;</div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>     </div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>     <span class="keywordflow">if</span> (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) </div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span>         recipe = (cpl_recipe *)plugin;</div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>         <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span> </div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>     cpl_parameterlist_delete(recipe->parameters); </div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span> </div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span>     <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span> }</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span> </div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span> </div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span> <span class="keyword">static</span> <span class="keywordtype">int</span> vimos_science(cpl_parameterlist *parlist, cpl_frameset *frameset)</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span> {</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *science_tag = <span class="stringliteral">"MOS_SCIENCE"</span>;</div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>     <span class="keywordtype">int</span>         mos         = cpl_frameset_count_tags(frameset, science_tag);</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span> </div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span>     <span class="keywordflow">if</span> (mos > 1) {</div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         <span class="keywordtype">char</span>              version[80];</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *curv_coeff_tag       = <span class="stringliteral">"MOS_CURV_COEFF"</span>;</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *slit_location_tag    = <span class="stringliteral">"MOS_SLIT_LOCATION"</span>;</div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *disp_coeff_tag       = <span class="stringliteral">"MOS_DISP_COEFF"</span>;</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *unmapped_science_tag = <span class="stringliteral">"MOS_UNMAPPED_SCIENCE"</span>;</div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *mapped_science_tag   = <span class="stringliteral">"MOS_SCIENCE_EXTRACTED"</span>;</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *object_table_tag     = <span class="stringliteral">"OBJECT_TABLE"</span>;</div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *unmapped_sky_tag     = <span class="stringliteral">"MOS_UNMAPPED_SKY"</span>;</div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *mapped_sky_tag       = <span class="stringliteral">"MOS_SCIENCE_SKY"</span>;</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *reduced_science_tag  = <span class="stringliteral">"MOS_SCIENCE_REDUCED"</span>;</div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *reduced_sky_tag      = <span class="stringliteral">"MOS_SKY_REDUCED"</span>;</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *reduced_error_tag    = <span class="stringliteral">"MOS_ERROR_REDUCED"</span>;</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *stack_method;</div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>         <span class="keyword">const</span> <span class="keywordtype">char</span>       *alignment;</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>         <span class="keywordtype">double</span>            refwave;</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span>         <span class="keywordtype">double</span>            startwavelength;</div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>         <span class="keywordtype">double</span>            endwavelength;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span>         <span class="keywordtype">double</span>            dispersion;</div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>         <span class="keywordtype">int</span>               flux;</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span>         <span class="keywordtype">int</span>               fringing;</div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span>         <span class="keywordtype">int</span>               cosmics;</div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>         <span class="keywordtype">int</span>               slit_margin;</div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span>         <span class="keywordtype">int</span>               ext_radius;</div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span>         <span class="keywordtype">int</span>               cont_radius;</div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span>         <span class="keywordtype">int</span>               ext_mode;</div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>         <span class="keywordtype">int</span>               rotate      = 1;</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span>         <span class="keywordtype">int</span>               rotate_back = -1;</div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>         cpl_frameset     *work        = cpl_frameset_duplicate(frameset);</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         cpl_frame       **mos_science = cpl_calloc(mos, <span class="keyword">sizeof</span>(cpl_frame*));</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span>         cpl_parameter    *param;</div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>         cpl_table        *reference   = NULL;</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span>         cpl_table        *objects     = NULL;</div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>         cpl_image       **images      = NULL;</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>         cpl_image        *image       = NULL;</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>         cpl_image        *sky_image   = NULL;</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         cpl_imagelist    *imagelist   = NULL;</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>         cpl_image        *fringes     = NULL;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>         cpl_image        *stacked     = NULL;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>         cpl_image        *mapped      = NULL;</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>         cpl_image        *smapped     = NULL;</div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         cpl_image        *sky_stacked = NULL;</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         cpl_image        *sky_mapped  = NULL;</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         cpl_image        *sky_smapped = NULL;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>         cpl_table        *polytraces  = NULL;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>         cpl_table        *idscoeff    = NULL;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>         cpl_table        *slits       = NULL;</div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>         cpl_table        *grism_table = NULL;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>         cpl_propertylist *header      = NULL;</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         <span class="keywordtype">char</span>             *name;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>         <span class="keywordtype">double</span>            offset;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>         <span class="keywordtype">double</span>            gain;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>         <span class="keywordtype">double</span>            ron;</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>         <span class="keywordtype">int</span>               time_normal;</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         <span class="keywordtype">int</span>               min_reject;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>         <span class="keywordtype">int</span>               max_reject;</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>         <span class="keywordtype">double</span>            klow;</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>         <span class="keywordtype">double</span>            khigh;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>         <span class="keywordtype">int</span>               kiter;</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span>         <span class="keywordtype">int</span>               int_alignment = 0;</div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>         <span class="keywordtype">int</span>               status;</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>         <span class="keywordtype">int</span>               nx, ny;</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span>         <span class="keywordtype">int</span>               i;</div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span> </div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> </div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span>         snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);</div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> </div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span>         grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> </div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span>         flux = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.flux"</span>, NULL);</div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> </div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span>         cosmics = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist,</div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span>                                          <span class="stringliteral">"fors.vimos_science.cosmics"</span>, NULL);</div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> </div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span>         dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span>                      <span class="stringliteral">"fors.vimos_science.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span> </div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>         refwave = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span>                     <span class="stringliteral">"fors.vimos_science.reference"</span>, grism_table);</div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span> </div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>         startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>                           <span class="stringliteral">"fors.vimos_science.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>         endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>                         <span class="stringliteral">"fors.vimos_science.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span> </div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>         alignment = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist,</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>                     <span class="stringliteral">"fors.vimos_science.alignment"</span>, NULL);</div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span> </div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>         <span class="keywordflow">if</span> (strcmp(alignment, <span class="stringliteral">"integer"</span>) == 0) {</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span>             int_alignment = 1;</div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>         }</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span> </div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>         stack_method = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist,</div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>                        <span class="stringliteral">"fors.vimos_science.stack_method"</span>, NULL);</div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span> </div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"minmax"</span>) == 0) {</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>             min_reject = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>                          <span class="stringliteral">"fors.vimos_science.minrejection"</span>, NULL);</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>             <span class="keywordflow">if</span> (min_reject < 0) {</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>, </div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span>                               <span class="stringliteral">"Invalid number of lower rejections"</span>);</div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span>             }</div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span>     </div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span>             max_reject = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span>                          <span class="stringliteral">"fors.vimos_science.maxrejection"</span>, NULL);</div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> </div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span>             <span class="keywordflow">if</span> (max_reject < 0) {</div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span>                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>,</div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>                               <span class="stringliteral">"Invalid number of upper rejections"</span>);</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>             }</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>         }</div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>     </div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span>         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"ksigma"</span>) == 0) {</div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>             klow  = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span>                                              <span class="stringliteral">"fors.vimos_science.klow"</span>, NULL);</div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>             <span class="keywordflow">if</span> (klow < 0.1) {</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span>                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>,</div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>                               <span class="stringliteral">"Invalid lower K-sigma"</span>);</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>             }</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span>     </div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>             khigh = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span>                                              <span class="stringliteral">"fors.vimos_science.khigh"</span>, NULL);</div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>             <span class="keywordflow">if</span> (khigh < 0.1) {</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span>                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>,</div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>                               <span class="stringliteral">"Invalid lower K-sigma"</span>);</div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span>             }</div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span>     </div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span>             kiter = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span>                                           <span class="stringliteral">"fors.vimos_science.kiter"</span>, NULL);</div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span>             <span class="keywordflow">if</span> (kiter < 1) {</div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span>                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>,</div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span>                               <span class="stringliteral">"Invalid number of iterations"</span>);</div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span>             }</div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span>         }</div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> </div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span>         slit_margin = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span>                                             <span class="stringliteral">"fors.vimos_science.slit_margin"</span>,</div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span>                                             NULL);</div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span>         ext_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span>                                            <span class="stringliteral">"fors.vimos_science.ext_radius"</span>,</div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span>                                            NULL);</div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span>         cont_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span>                                             <span class="stringliteral">"fors.vimos_science.cont_radius"</span>,</div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span>                                             NULL);</div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span>         ext_mode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist,</div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span>                                          <span class="stringliteral">"fors.vimos_science.ext_mode"</span>,</div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span>                                          NULL);</div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> </div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span>         fringing = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span>                                           <span class="stringliteral">"fors.vimos_science.fringing"</span>, NULL);</div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span> </div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span>         cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> </div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span> </div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> <span class="comment">         * Disable time normalisation for single runs</span></div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span> </div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>         param = cpl_parameterlist_find(parlist, </div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>                                        <span class="stringliteral">"fors.vimos_science.time_normalise"</span>);</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>         time_normal = cpl_parameter_get_bool(param);</div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>         cpl_parameter_set_bool(param, 0);</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span> </div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span> </div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span> <span class="comment">         * Collect all scientific frames from input SOF</span></div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span> </div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>         mos_science[0] = cpl_frameset_find(frameset, science_tag);</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>         <span class="keywordflow">for</span> (i = 1; i < mos; i++) {</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>             mos_science[i] = cpl_frameset_find(frameset, NULL);</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span>         }</div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span> </div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span> </div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span> <span class="comment">         * Process scientific frames one at a time</span></div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span> </div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>         <span class="keywordflow">for</span> (i = 0; i < mos; i++) {</div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>             cpl_frameset_erase(work, science_tag);</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>             cpl_frameset_insert(work, cpl_frame_duplicate(mos_science[i]));</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>             vimos_science_impl(work, parlist);</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span> </div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span> </div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span> <span class="comment">             * Cleanup work SOF from products </span></div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span> <span class="comment">             * (not really necessary, but clean)</span></div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span> </div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SKYLINES_OFFSETS_SLIT"</span>);</div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SCIENCE_SKY_EXTRACTED"</span>);</div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_UNMAPPED_SKY"</span>);</div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_UNMAPPED_SCIENCE"</span>);</div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_WAVELENGTH_MAP_SKY"</span>);</div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SCIENCE_SKY"</span>);</div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span>             cpl_frameset_erase(work, <span class="stringliteral">"OBJECT_TABLE"</span>);</div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SCIENCE_REDUCED"</span>);</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SKY_REDUCED"</span>);</div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_ERROR_REDUCED"</span>);</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_DISP_COEFF_SKY"</span>);</div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>             cpl_frameset_erase(work, <span class="stringliteral">"MOS_SCIENCE_EXTRACTED"</span>);</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span> </div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> </div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span> <span class="comment">             * Of all products, only keep the object tables, the</span></div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span> <span class="comment">             * unmapped sky, and the unmapped science.</span></div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span> </div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>             name = cpl_sprintf(<span class="stringliteral">"object_table_%d.fits"</span>, i);</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span>             status = rename(<span class="stringliteral">"object_table.fits"</span>, name);</div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>             cpl_free(name);</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>             name = cpl_sprintf(<span class="stringliteral">"mos_unmapped_sky_%d.fits"</span>, i);</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span>             status |= rename(<span class="stringliteral">"mos_unmapped_sky.fits"</span>, name);</div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>             cpl_free(name);</div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span>             name = cpl_sprintf(<span class="stringliteral">"mos_unmapped_science_%d.fits"</span>, i);</div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span>             status |= rename(<span class="stringliteral">"mos_unmapped_science.fits"</span>, name);</div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span>             cpl_free(name);</div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span> </div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span>             <span class="keywordflow">if</span> (status) {</div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>, <span class="stringliteral">"Cannot rename product."</span>);</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>                 cpl_free(mos_science);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span>                 cpl_frameset_delete(work);</div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>             }</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>         }</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span> </div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>         cpl_free(mos_science);</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span>         cpl_frameset_delete(work);</div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span> </div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>         <span class="keywordflow">if</span> (fringing) {</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span> </div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span> <span class="comment">             * Produce fringing map by median stacking</span></div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span> </div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>             imagelist = cpl_imagelist_new();</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span> </div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>             <span class="keywordflow">for</span> (i = 0; i < mos; i++) {</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>                 name = cpl_sprintf(<span class="stringliteral">"mos_unmapped_science_%d.fits"</span>, i);</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>                 image = cpl_image_load(name, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>                 cpl_imagelist_set(imagelist, image,</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>                                   cpl_imagelist_get_size(imagelist));</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>             }</div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span> </div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>             fringes = cpl_imagelist_collapse_median_create(imagelist);</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>             cpl_imagelist_delete(imagelist);</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span>             cpl_image_save(fringes, <span class="stringliteral">"fringes.fits"</span>, </div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>                            CPL_BPP_IEEE_FLOAT, NULL, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span> </div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span>         }</div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span> </div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span> </div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>         <span class="comment">/*</span></div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span> <span class="comment">         * Now stack all frames and extract final objects</span></div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span> <span class="comment">         */</span></div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span> </div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span>         reference = cpl_table_load(<span class="stringliteral">"object_table_0.fits"</span>, 1, 1);</div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>         stacked = cpl_image_load(<span class="stringliteral">"mos_unmapped_science_0.fits"</span>, </div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span>                                  CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>         sky_stacked = cpl_image_load(<span class="stringliteral">"mos_unmapped_sky_0.fits"</span>, </div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span>                                      CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span>         <span class="keywordflow">if</span> (fringing) {</div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span>             cpl_image_subtract(stacked, fringes);</div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>             cpl_image_add(sky_stacked, fringes);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span>         }</div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span> </div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span> <span class="comment">// Added just for eliminating wcs like in other images</span></div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span>         cpl_image_save(stacked, <span class="stringliteral">"mos_unmapped_science_0.fits"</span>, </div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>                        CPL_BPP_IEEE_FLOAT, NULL, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span> <span class="comment">// end of debug line</span></div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span> </div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>         <span class="keywordflow">for</span> (i = 1; i < mos; i++) {</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>             name = cpl_sprintf(<span class="stringliteral">"object_table_%d.fits"</span>, i);</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span>             objects = cpl_table_load(name, 1, 1);</div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>             cpl_free(name);</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>             <span class="keywordflow">if</span> (<a class="code" href="group__moses.html#gac442710556a5013dedd29befac482c9d" title="Estimate offset between two object tables.">mos_compute_offset</a>(reference, objects, &offset)) {</div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>                 cpl_msg_error(<span class="stringliteral">"vimos_science"</span>, <span class="stringliteral">"Cannot compute offset."</span>);</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>                 cpl_table_delete(objects);</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>             }</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span>             cpl_table_delete(objects);</div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>             name = cpl_sprintf(<span class="stringliteral">"mos_unmapped_science_%d.fits"</span>, i);</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>             image = cpl_image_load(name, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span> </div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>             <span class="keywordflow">if</span> (fringing) {</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>                 cpl_image_subtract(image, fringes);</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>             }</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span> </div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span>             cpl_msg_info(<span class="stringliteral">"vimos_science"</span>, </div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>                          <span class="stringliteral">"Frame %d offset relative "</span></div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span>                          <span class="stringliteral">"to frame 1: %.2f pix\n"</span>, i + 1, offset); </div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span> </div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span>             <span class="keywordflow">if</span> (int_alignment) {</div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span>                 offset = floor(offset + 0.5);</div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>                 cpl_msg_info(<span class="stringliteral">"vimos_science"</span>, </div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>                              <span class="stringliteral">"Nearest neighbour offset applied is "</span></div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>                              <span class="stringliteral">"%.0f pix\n"</span>, offset); </div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>             }</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span> </div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span>             <a class="code" href="group__moses.html#ga82c7c158316d8aba35ffa271b44510c6" title="Shift values in an image.">mos_image_shift</a>(image, offset, 0.0);</div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span>             cpl_image_save(image, name, CPL_BPP_IEEE_FLOAT, </div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>                            NULL, CPL_IO_DEFAULT);</div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span>             cpl_free(name);</div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span> </div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span> <span class="comment">             * Here stacking sky frames, they are always averaged</span></div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span> </div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>             name = cpl_sprintf(<span class="stringliteral">"mos_unmapped_sky_%d.fits"</span>, i);</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>             sky_image = cpl_image_load(name, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span> </div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>             <span class="keywordflow">if</span> (fringing) {</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>                 cpl_image_add(sky_image, fringes);</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>             }</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span> </div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>             <a class="code" href="group__moses.html#ga82c7c158316d8aba35ffa271b44510c6" title="Shift values in an image.">mos_image_shift</a>(sky_image, offset, 0.0);</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>             cpl_free(name);</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>             cpl_image_add(sky_stacked, sky_image);</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>             cpl_image_delete(sky_image);</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span> </div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>             <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"average"</span>) == 0) {</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span>                 cpl_image_add(stacked, image);</div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span>                 cpl_image_delete(image);</div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>             }</div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span>                 <span class="keywordflow">if</span> (i == 1) {</div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span>                     imagelist = cpl_imagelist_new();</div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>                     cpl_imagelist_set(imagelist, stacked,</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>                                       cpl_imagelist_get_size(imagelist));</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>                 }</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span>                 cpl_imagelist_set(imagelist, image,</div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>                                   cpl_imagelist_get_size(imagelist));</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>             }</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>         }</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span>         cpl_table_delete(reference);</div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span> </div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span>         cpl_image_divide_scalar(sky_stacked, mos);</div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span> </div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span>         <span class="keywordflow">if</span> (fringing) {</div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span>             cpl_image_delete(fringes);</div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>         }</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span> </div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"average"</span>) == 0) {</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>             cpl_image_divide_scalar(stacked, mos);</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>         }</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span> </div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"median"</span>) == 0) {</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>             stacked = cpl_imagelist_collapse_median_create(imagelist);</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>             cpl_imagelist_delete(imagelist);</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>         }</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span> </div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span>         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"minmax"</span>) == 0) {</div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>             stacked = cpl_imagelist_collapse_minmax_create(imagelist,</div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span>                                                            min_reject,</div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span>                                                            max_reject);</div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span>             cpl_imagelist_delete(imagelist);</div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span>         }</div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span> </div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>         <span class="keywordflow">if</span> (strcmp(stack_method, <span class="stringliteral">"ksigma"</span>) == 0) {</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span>             stacked = <a class="code" href="group__moses.html#ga663cfcd4584b6a3e63e7593cba926688" title="Stack images using k-sigma clipping.">mos_ksigma_stack</a>(imagelist, klow, khigh, kiter, NULL);</div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>             cpl_imagelist_delete(imagelist);</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>         }</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span> </div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span> </div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>         gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>         ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>         ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span></div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span> </div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, stacked, unmapped_science_tag,</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>                            header, parlist, <span class="stringliteral">"vimos_science"</span>, version)) {</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>             cpl_image_delete(stacked);</div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>             cpl_image_delete(sky_stacked);</div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>             cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span>             cpl_table_delete(slits);</div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>             <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>         }</div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span> </div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, sky_stacked, unmapped_sky_tag,</div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>                            header, parlist, <span class="stringliteral">"vimos_science"</span>, version)) {</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>             cpl_image_delete(stacked);</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>             cpl_image_delete(sky_stacked);</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>             cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>             cpl_table_delete(slits);</div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>             <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>         }</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span> </div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span>         cpl_parameter_set_bool(param, time_normal);</div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span> </div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span>         cpl_image_turn(stacked, rotate);</div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>         cpl_image_turn(sky_stacked, rotate);</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span> </div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>         nx = cpl_image_get_size_x(stacked);</div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>         ny = cpl_image_get_size_y(stacked);</div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span> </div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span>         polytraces = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, curv_coeff_tag, 1);</div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span> </div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>         slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>         <a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f" title="Rotate a slit location table.">mos_rotate_slits</a>(slits, -rotate, nx, ny);</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span> </div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span> <span class="comment">// FIXME: Qui potremmo tirare su una tabella allineata al cielo, se esiste.</span></div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>         idscoeff = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, disp_coeff_tag, 1);</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span> </div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>         cpl_msg_info(<span class="stringliteral">"vimos_science"</span>, </div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>                      <span class="stringliteral">"Processing stacked scientific spectra..."</span>);</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span> </div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>         smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(stacked, slits, polytraces, refwave,</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span>                                           startwavelength, endwavelength,</div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>                                           dispersion, flux, NULL);</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span> </div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>         cpl_image_delete(stacked);</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span> </div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>         sky_smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(sky_stacked, slits, polytraces, </div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>                                               refwave, startwavelength, </div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>                                               endwavelength, dispersion, </div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>                                               flux, NULL);</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span> </div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>         cpl_image_delete(sky_stacked);</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>         cpl_table_delete(polytraces);</div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span> </div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>         mapped = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, refwave,</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>                                             startwavelength, endwavelength,</div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>                                             dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span> </div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>         cpl_image_delete(smapped);</div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span> </div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>         sky_mapped = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(sky_smapped, refwave,</div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>                                                 startwavelength, endwavelength,</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>                                                 dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>         cpl_table_delete(idscoeff);</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span> </div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>,</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>                                        startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>         cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>         cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span> </div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span> <span class="comment">//  Later, when you have alltime</span></div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span> <span class="comment">//      if (time_normal) {</span></div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span> <span class="comment">//          image = cpl_image_divide_scalar_create(mapped, alltime);</span></div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span> <span class="comment">//          if (dfs_save_image(frameset, image, mapped_science_sky_tag, header,</span></div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span> <span class="comment">//                             parlist, recipe, version))</span></div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span> <span class="comment">//              vimos_science_exit(NULL);</span></div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span> <span class="comment">//          cpl_image_delete(image); image = NULL;</span></div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span> <span class="comment">//      }</span></div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span> <span class="comment">//      else {</span></div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span> </div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, mapped, mapped_science_tag,</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>                                header, parlist, <span class="stringliteral">"vimos_science"</span>, version)) {</div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>                 cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>                 cpl_image_delete(mapped);</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>                 cpl_image_delete(sky_mapped);</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>                 cpl_table_delete(slits);</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>             }</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span> </div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, sky_mapped, mapped_sky_tag,</div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>                                header, parlist, <span class="stringliteral">"vimos_science"</span>, version)) {</div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>                 cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>                 cpl_image_delete(mapped);</div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>                 cpl_image_delete(sky_mapped);</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>                 cpl_table_delete(slits);</div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>             }</div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span> <span class="comment">//      }</span></div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span> </div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>         cpl_msg_info(<span class="stringliteral">"vimos_science"</span>, <span class="stringliteral">"Final object detection..."</span>);</div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span> </div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>         <span class="keywordflow">if</span> (cosmics || strcmp(stack_method, <span class="stringliteral">"average"</span>)) {</div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>             image = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped, slits, slit_margin, ext_radius,</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>                                        cont_radius);</div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>         }</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>             cpl_image *mapped_cleaned = cpl_image_duplicate(mapped);</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>             <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>             image = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin,</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>                                        ext_radius, cont_radius);</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span> </div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>             cpl_image_delete(mapped_cleaned);</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>         }</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span> </div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>         cpl_image_delete(image);</div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span> </div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>         <a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f" title="Rotate a slit location table.">mos_rotate_slits</a>(slits, rotate, ny, nx);</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, slits, object_table_tag, NULL, parlist,</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>                            <span class="stringliteral">"vimos_science"</span>, version)) {</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>             cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>             cpl_image_delete(mapped);</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>             cpl_image_delete(sky_mapped);</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>             cpl_table_delete(slits);</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>             <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>         }</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span> </div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>         cpl_msg_info(<span class="stringliteral">"vimos_science"</span>, <span class="stringliteral">"Final object extraction..."</span>);</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span> </div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>         images = <a class="code" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522" title="Extract detected objects from rectified scientific frame.">mos_extract_objects</a>(mapped, sky_mapped, slits,</div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>                                      ext_mode, ron, gain, mos);</div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span> </div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>         cpl_image_delete(mapped);</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>         cpl_image_delete(sky_mapped);</div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>         cpl_table_delete(slits);</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span> </div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>         <span class="keywordflow">if</span> (images) {</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span> <span class="comment">//            if (time_normalise)</span></div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span> <span class="comment">//                cpl_image_divide_scalar(images[0], alltime);</span></div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span> </div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[0], reduced_science_tag, </div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>                                header, parlist, <span class="stringliteral">"vimos_science"</span>, version)) {</div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>                 cpl_image_delete(images[0]);</div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>                 cpl_image_delete(images[1]);</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>                 cpl_image_delete(images[2]);</div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>                 cpl_free(images);</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>                 cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>             }</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span> </div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>             cpl_image_delete(images[0]);</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span> </div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span> <span class="comment">//            if (time_normalise)</span></div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span> <span class="comment">//                cpl_image_divide_scalar(images[1], alltime);</span></div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span> </div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[1], reduced_sky_tag, header,</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>                                parlist, <span class="stringliteral">"vimos_science"</span>, version)) {</div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>                 cpl_image_delete(images[1]);</div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>                 cpl_image_delete(images[2]);</div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>                 cpl_free(images);</div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>                 cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>             }</div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span> </div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>             cpl_image_delete(images[1]);</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span> </div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span> <span class="comment">//            if (time_normalise)</span></div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span> <span class="comment">//                cpl_image_divide_scalar(images[2], alltime);</span></div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span> </div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[2], reduced_error_tag, header,</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>                                parlist, <span class="stringliteral">"vimos_science"</span>, version)) {</div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>                 cpl_image_delete(images[2]);</div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>                 cpl_free(images);</div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>                 cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>                 <span class="keywordflow">return</span> -1;</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>             }</div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span> </div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>             cpl_image_delete(images[2]);</div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span> </div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>             cpl_free(images);</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>         }</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>             cpl_msg_warning(<span class="stringliteral">"vimos_science"</span>, <span class="stringliteral">"No objects found: the products "</span></div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>                             <span class="stringliteral">"%s, %s, and %s are not created"</span>,</div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>                             reduced_science_tag, reduced_sky_tag,</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>                             reduced_error_tag);</div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>         }</div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span> </div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>         cpl_propertylist_delete(header);</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span> </div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>     }</div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span> </div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>     <span class="keywordflow">return</span> vimos_science_impl(frameset, parlist);</div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/vimos__science__impl_8c-source.html b/html/vimos__science__impl_8c-source.html
deleted file mode 100644
index 300e6d8..0000000
--- a/html/vimos__science__impl_8c-source.html
+++ /dev/null
@@ -1,1459 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: vimos_science_impl.c Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>vimos_science_impl.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: vimos_science_impl.c,v 1.4 2013/04/24 14:17:05 cgarcia Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cgarcia $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2013/04/24 14:17:05 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.4 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span>
-<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
-<a name="l00031"></a>00031 <span class="preprocessor"></span>
-<a name="l00032"></a>00032 <span class="preprocessor">#include <vimos_science_impl.h></span>
-<a name="l00033"></a>00033 
-<a name="l00034"></a>00034 <span class="preprocessor">#include <math.h></span>
-<a name="l00035"></a>00035 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00036"></a>00036 <span class="preprocessor">#include <moses.h></span>
-<a name="l00037"></a>00037 <span class="preprocessor">#include <fors_tools.h></span>
-<a name="l00038"></a>00038 <span class="preprocessor">#include <fors_dfs.h></span>
-<a name="l00039"></a>00039 <span class="preprocessor">#include <fors_qc.h></span>
-<a name="l00040"></a>00040 
-<a name="l00041"></a>00041 <span class="preprocessor">#define vimos_science_exit(message)           \</span>
-<a name="l00042"></a>00042 <span class="preprocessor">{                                             \</span>
-<a name="l00043"></a>00043 <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span>
-<a name="l00044"></a>00044 <span class="preprocessor">cpl_free(exptime);                            \</span>
-<a name="l00045"></a>00045 <span class="preprocessor">cpl_image_delete(dummy);                      \</span>
-<a name="l00046"></a>00046 <span class="preprocessor">cpl_image_delete(mapped);                     \</span>
-<a name="l00047"></a>00047 <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span>
-<a name="l00048"></a>00048 <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span>
-<a name="l00049"></a>00049 <span class="preprocessor">cpl_image_delete(skylocalmap);                \</span>
-<a name="l00050"></a>00050 <span class="preprocessor">cpl_image_delete(skymap);                     \</span>
-<a name="l00051"></a>00051 <span class="preprocessor">cpl_image_delete(smapped);                    \</span>
-<a name="l00052"></a>00052 <span class="preprocessor">cpl_table_delete(offsets);                    \</span>
-<a name="l00053"></a>00053 <span class="preprocessor">cpl_table_delete(sky);                        \</span>
-<a name="l00054"></a>00054 <span class="preprocessor">cpl_image_delete(bias);                       \</span>
-<a name="l00055"></a>00055 <span class="preprocessor">cpl_image_delete(spectra);                    \</span>
-<a name="l00056"></a>00056 <span class="preprocessor">cpl_image_delete(coordinate);                 \</span>
-<a name="l00057"></a>00057 <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span>
-<a name="l00058"></a>00058 <span class="preprocessor">cpl_image_delete(rainbow);                    \</span>
-<a name="l00059"></a>00059 <span class="preprocessor">cpl_image_delete(rectified);                  \</span>
-<a name="l00060"></a>00060 <span class="preprocessor">cpl_image_delete(wavemap);                    \</span>
-<a name="l00061"></a>00061 <span class="preprocessor">cpl_propertylist_delete(header);              \</span>
-<a name="l00062"></a>00062 <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span>
-<a name="l00063"></a>00063 <span class="preprocessor">cpl_table_delete(grism_table);                \</span>
-<a name="l00064"></a>00064 <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span>
-<a name="l00065"></a>00065 <span class="preprocessor">cpl_table_delete(maskslits);                  \</span>
-<a name="l00066"></a>00066 <span class="preprocessor">cpl_table_delete(overscans);                  \</span>
-<a name="l00067"></a>00067 <span class="preprocessor">cpl_table_delete(polytraces);                 \</span>
-<a name="l00068"></a>00068 <span class="preprocessor">cpl_table_delete(slits);                      \</span>
-<a name="l00069"></a>00069 <span class="preprocessor">cpl_table_delete(wavelengths);                \</span>
-<a name="l00070"></a>00070 <span class="preprocessor">cpl_vector_delete(lines);                     \</span>
-<a name="l00071"></a>00071 <span class="preprocessor">cpl_msg_indent_less();                        \</span>
-<a name="l00072"></a>00072 <span class="preprocessor">return -1;                                    \</span>
-<a name="l00073"></a>00073 <span class="preprocessor">}</span>
-<a name="l00074"></a>00074 <span class="preprocessor"></span>
-<a name="l00081"></a><a class="code" href="group__vimos__science__impl.html#g79a502c79f4843218e3d0d4adec9c907">00081</a> <span class="keywordtype">int</span> <a class="code" href="group__vimos__science__impl.html#g79a502c79f4843218e3d0d4adec9c907">vimos_science_impl</a>(cpl_frameset *frameset, cpl_parameterlist *parlist)
-<a name="l00082"></a>00082 {
-<a name="l00083"></a>00083     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"vimos_science"</span>;
-<a name="l00084"></a>00084 
-<a name="l00085"></a>00085 
-<a name="l00086"></a>00086     <span class="comment">/*</span>
-<a name="l00087"></a>00087 <span class="comment">     * Input parameters</span>
-<a name="l00088"></a>00088 <span class="comment">     */</span>
-<a name="l00089"></a>00089 
-<a name="l00090"></a>00090     <span class="keywordtype">double</span>      dispersion;
-<a name="l00091"></a>00091     <span class="keywordtype">int</span>         skyalign;
-<a name="l00092"></a>00092     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;
-<a name="l00093"></a>00093     <span class="keywordtype">double</span>      startwavelength;
-<a name="l00094"></a>00094     <span class="keywordtype">double</span>      endwavelength;
-<a name="l00095"></a>00095     <span class="keywordtype">double</span>      reference;
-<a name="l00096"></a>00096     <span class="keywordtype">int</span>         flux;
-<a name="l00097"></a>00097     <span class="keywordtype">int</span>         flatfield;
-<a name="l00098"></a>00098     <span class="keywordtype">int</span>         skyglobal;
-<a name="l00099"></a>00099     <span class="keywordtype">int</span>         skylocal;
-<a name="l00100"></a>00100     <span class="keywordtype">int</span>         skymedian;
-<a name="l00101"></a>00101     <span class="keywordtype">int</span>         cosmics;
-<a name="l00102"></a>00102     <span class="keywordtype">int</span>         slit_margin;
-<a name="l00103"></a>00103     <span class="keywordtype">int</span>         ext_radius;
-<a name="l00104"></a>00104     <span class="keywordtype">int</span>         cont_radius;
-<a name="l00105"></a>00105     <span class="keywordtype">int</span>         ext_mode;
-<a name="l00106"></a>00106     <span class="keywordtype">int</span>         time_normalise;
-<a name="l00107"></a>00107     <span class="keywordtype">int</span>         anyframe;
-<a name="l00108"></a>00108     <span class="keywordtype">int</span>         res_order;
-<a name="l00109"></a>00109     <span class="keywordtype">int</span>         qc;
-<a name="l00110"></a>00110 
-<a name="l00111"></a>00111     <span class="comment">/*</span>
-<a name="l00112"></a>00112 <span class="comment">     * CPL objects</span>
-<a name="l00113"></a>00113 <span class="comment">     */</span>
-<a name="l00114"></a>00114 
-<a name="l00115"></a>00115     cpl_imagelist    *all_science;
-<a name="l00116"></a>00116     cpl_image       **images;
-<a name="l00117"></a>00117 
-<a name="l00118"></a>00118     cpl_image        *bias           = NULL;
-<a name="l00119"></a>00119     cpl_image        *norm_flat      = NULL;
-<a name="l00120"></a>00120     cpl_image        *spectra        = NULL;
-<a name="l00121"></a>00121     cpl_image        *rectified      = NULL;
-<a name="l00122"></a>00122     cpl_image        *coordinate     = NULL;
-<a name="l00123"></a>00123     cpl_image        *rainbow        = NULL;
-<a name="l00124"></a>00124     cpl_image        *mapped         = NULL;
-<a name="l00125"></a>00125     cpl_image        *mapped_sky     = NULL;
-<a name="l00126"></a>00126     cpl_image        *mapped_cleaned = NULL;
-<a name="l00127"></a>00127     cpl_image        *smapped        = NULL;
-<a name="l00128"></a>00128     cpl_image        *wavemap        = NULL;
-<a name="l00129"></a>00129     cpl_image        *skymap         = NULL;
-<a name="l00130"></a>00130     cpl_image        *skylocalmap    = NULL;
-<a name="l00131"></a>00131     cpl_image        *dummy          = NULL;
-<a name="l00132"></a>00132 
-<a name="l00133"></a>00133     cpl_table        *grism_table    = NULL;
-<a name="l00134"></a>00134     cpl_table        *overscans      = NULL;
-<a name="l00135"></a>00135     cpl_table        *wavelengths    = NULL;
-<a name="l00136"></a>00136     cpl_table        *idscoeff       = NULL;
-<a name="l00137"></a>00137     cpl_table        *slits          = NULL;
-<a name="l00138"></a>00138     cpl_table        *maskslits      = NULL;
-<a name="l00139"></a>00139     cpl_table        *polytraces     = NULL;
-<a name="l00140"></a>00140     cpl_table        *offsets        = NULL;
-<a name="l00141"></a>00141     cpl_table        *sky            = NULL;
-<a name="l00142"></a>00142 
-<a name="l00143"></a>00143     cpl_vector       *lines          = NULL;
-<a name="l00144"></a>00144 
-<a name="l00145"></a>00145     cpl_propertylist *header         = NULL;
-<a name="l00146"></a>00146     cpl_propertylist *save_header    = NULL;
-<a name="l00147"></a>00147     cpl_propertylist *qclist         = NULL;
-<a name="l00148"></a>00148 
-<a name="l00149"></a>00149     <span class="comment">/*</span>
-<a name="l00150"></a>00150 <span class="comment">     * Auxiliary variables</span>
-<a name="l00151"></a>00151 <span class="comment">     */</span>
-<a name="l00152"></a>00152 
-<a name="l00153"></a>00153     <span class="keywordtype">char</span>        version[80];
-<a name="l00154"></a>00154     <span class="keywordtype">char</span>       *<a class="code" href="group__test__simulate.html#gb517f8305d0a56f05b3221ba47b0d8f1">instrume</a> = NULL;
-<a name="l00155"></a>00155     <span class="keyword">const</span> <span class="keywordtype">char</span> *science_tag;
-<a name="l00156"></a>00156     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_norm_flat_tag;
-<a name="l00157"></a>00157     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;
-<a name="l00158"></a>00158     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_sky_tag;
-<a name="l00159"></a>00159     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_tag;
-<a name="l00160"></a>00160     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_sky_tag;
-<a name="l00161"></a>00161     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;
-<a name="l00162"></a>00162     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;
-<a name="l00163"></a>00163     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_science_tag;
-<a name="l00164"></a>00164     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_sky_tag;
-<a name="l00165"></a>00165     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_error_tag;
-<a name="l00166"></a>00166     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_tag;
-<a name="l00167"></a>00167     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_science_tag;
-<a name="l00168"></a>00168     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_sky_tag;
-<a name="l00169"></a>00169     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_sky_tag;
-<a name="l00170"></a>00170     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_sky_tag;
-<a name="l00171"></a>00171     <span class="keyword">const</span> <span class="keywordtype">char</span> *global_sky_spectrum_tag;
-<a name="l00172"></a>00172     <span class="keyword">const</span> <span class="keywordtype">char</span> *object_table_tag;
-<a name="l00173"></a>00173     <span class="keyword">const</span> <span class="keywordtype">char</span> *skylines_offsets_tag;
-<a name="l00174"></a>00174     <span class="keyword">const</span> <span class="keywordtype">char</span> *specphot_tag;
-<a name="l00175"></a>00175     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_gris_name;
-<a name="l00176"></a>00176     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_gris_id;
-<a name="l00177"></a>00177     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_filt_name;
-<a name="l00178"></a>00178     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_filt_id;
-<a name="l00179"></a>00179     <span class="keywordtype">int</span>         mos;
-<a name="l00180"></a>00180     <span class="keywordtype">int</span>         nexp, expno;
-<a name="l00181"></a>00181     <span class="keywordtype">int</span>         treat_as_lss = 0;
-<a name="l00182"></a>00182     <span class="keywordtype">int</span>         nslits;
-<a name="l00183"></a>00183     <span class="keywordtype">int</span>         nscience;
-<a name="l00184"></a>00184     <span class="keywordtype">int</span>         quadrant;
-<a name="l00185"></a>00185     <span class="keywordtype">double</span>     *xpos;
-<a name="l00186"></a>00186     <span class="keywordtype">double</span>     *exptime = NULL;
-<a name="l00187"></a>00187     <span class="keywordtype">double</span>      airmass;
-<a name="l00188"></a>00188     <span class="keywordtype">double</span>      alltime;
-<a name="l00189"></a>00189     <span class="keywordtype">double</span>      mxpos;
-<a name="l00190"></a>00190     <span class="keywordtype">double</span>      mean_rms;
-<a name="l00191"></a>00191     <span class="keywordtype">int</span>         nlines;
-<a name="l00192"></a>00192     <span class="keywordtype">double</span>     *line;
-<a name="l00193"></a>00193     <span class="keywordtype">int</span>         nx, ny;
-<a name="l00194"></a>00194     <span class="keywordtype">double</span>      gain;
-<a name="l00195"></a>00195     <span class="keywordtype">double</span>      <a class="code" href="group__test__simulate.html#g969eb0a34faef89b37e50045944c7dc8">ron</a>;
-<a name="l00196"></a>00196     <span class="keywordtype">int</span>         standard;
-<a name="l00197"></a>00197     <span class="keywordtype">int</span>         highres;
-<a name="l00198"></a>00198     <span class="keywordtype">int</span>         rotate = 1;
-<a name="l00199"></a>00199     <span class="keywordtype">int</span>         rotate_back = -1;
-<a name="l00200"></a>00200     <span class="keywordtype">int</span>         i;
-<a name="l00201"></a>00201     <span class="keywordtype">double</span>      wstart;
-<a name="l00202"></a>00202     <span class="keywordtype">double</span>      wstep;
-<a name="l00203"></a>00203     <span class="keywordtype">int</span>         wcount;
-<a name="l00204"></a>00204 
-<a name="l00205"></a>00205 
-<a name="l00206"></a>00206     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);
-<a name="l00207"></a>00207 
-<a name="l00208"></a>00208     cpl_msg_set_indentation(2);
-<a name="l00209"></a>00209 
-<a name="l00210"></a>00210 
-<a name="l00211"></a>00211     <span class="comment">/* </span>
-<a name="l00212"></a>00212 <span class="comment">     * Get configuration parameters</span>
-<a name="l00213"></a>00213 <span class="comment">     */</span>
-<a name="l00214"></a>00214 
-<a name="l00215"></a>00215     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);
-<a name="l00216"></a>00216     cpl_msg_indent_more();
-<a name="l00217"></a>00217 
-<a name="l00218"></a>00218     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)
-<a name="l00219"></a>00219         vimos_science_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);
-<a name="l00220"></a>00220 
-<a name="l00221"></a>00221     grism_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);
-<a name="l00222"></a>00222 
-<a name="l00223"></a>00223     dispersion = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00224"></a>00224                     <span class="stringliteral">"fors.vimos_science.dispersion"</span>, grism_table);
-<a name="l00225"></a>00225 
-<a name="l00226"></a>00226     <span class="keywordflow">if</span> (dispersion <= 0.0)
-<a name="l00227"></a>00227         vimos_science_exit(<span class="stringliteral">"Invalid resampling step"</span>);
-<a name="l00228"></a>00228 
-<a name="l00229"></a>00229     skyalign = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00230"></a>00230                     <span class="stringliteral">"fors.vimos_science.skyalign"</span>, NULL);
-<a name="l00231"></a>00231 
-<a name="l00232"></a>00232     <span class="keywordflow">if</span> (skyalign > 2)
-<a name="l00233"></a>00233         vimos_science_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);
-<a name="l00234"></a>00234 
-<a name="l00235"></a>00235     wcolumn = <a class="code" href="group__forsdfs.html#gd263350688e3580b7bf20706a795a0cd">dfs_get_parameter_string</a>(parlist, 
-<a name="l00236"></a>00236                     <span class="stringliteral">"fors.vimos_science.wcolumn"</span>, NULL);
-<a name="l00237"></a>00237 
-<a name="l00238"></a>00238     startwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00239"></a>00239                     <span class="stringliteral">"fors.vimos_science.startwavelength"</span>, grism_table);
-<a name="l00240"></a>00240     <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)
-<a name="l00241"></a>00241         vimos_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243     endwavelength = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist, 
-<a name="l00244"></a>00244                     <span class="stringliteral">"fors.vimos_science.endwavelength"</span>, grism_table);
-<a name="l00245"></a>00245     <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)
-<a name="l00246"></a>00246         vimos_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);
-<a name="l00247"></a>00247 
-<a name="l00248"></a>00248     <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)
-<a name="l00249"></a>00249         vimos_science_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);
-<a name="l00250"></a>00250 
-<a name="l00251"></a>00251     reference = <a class="code" href="group__forsdfs.html#gff26e2b3063dfeb117ef73030e81894e">dfs_get_parameter_double</a>(parlist,
-<a name="l00252"></a>00252                 <span class="stringliteral">"fors.vimos_science.reference"</span>, grism_table);
-<a name="l00253"></a>00253 
-<a name="l00254"></a>00254     <span class="keywordflow">if</span> (reference < startwavelength || reference > endwavelength)
-<a name="l00255"></a>00255         vimos_science_exit(<span class="stringliteral">"Invalid reference wavelength"</span>);
-<a name="l00256"></a>00256 
-<a name="l00257"></a>00257     flux = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.flux"</span>, NULL);
-<a name="l00258"></a>00258 
-<a name="l00259"></a>00259     flatfield = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.flatfield"</span>, 
-<a name="l00260"></a>00260                                        NULL);
-<a name="l00261"></a>00261 
-<a name="l00262"></a>00262     skyglobal = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.skyglobal"</span>, 
-<a name="l00263"></a>00263                                        NULL);
-<a name="l00264"></a>00264     skylocal  = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.skylocal"</span>, 
-<a name="l00265"></a>00265                                        NULL);
-<a name="l00266"></a>00266     skymedian = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.skymedian"</span>, 
-<a name="l00267"></a>00267                                        NULL);
-<a name="l00268"></a>00268 
-<a name="l00269"></a>00269     <span class="keywordflow">if</span> (skylocal && skyglobal)
-<a name="l00270"></a>00270         vimos_science_exit(<span class="stringliteral">"Cannot do both local and global sky subtraction"</span>);
-<a name="l00271"></a>00271 
-<a name="l00272"></a>00272     <span class="keywordflow">if</span> (skylocal && skymedian)
-<a name="l00273"></a>00273         vimos_science_exit(<span class="stringliteral">"Cannot do sky subtraction both on extracted "</span>
-<a name="l00274"></a>00274                            <span class="stringliteral">"and non-extracted spectra"</span>);
-<a name="l00275"></a>00275 
-<a name="l00276"></a>00276     cosmics = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00277"></a>00277                                      <span class="stringliteral">"fors.vimos_science.cosmics"</span>, NULL);
-<a name="l00278"></a>00278 
-<a name="l00279"></a>00279     <span class="keywordflow">if</span> (cosmics)
-<a name="l00280"></a>00280         <span class="keywordflow">if</span> (!(skyglobal || skylocal))
-<a name="l00281"></a>00281             vimos_science_exit(<span class="stringliteral">"Cosmic rays correction requires "</span>
-<a name="l00282"></a>00282                               <span class="stringliteral">"either skylocal=true or skyglobal=true"</span>);
-<a name="l00283"></a>00283 
-<a name="l00284"></a>00284     slit_margin = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00285"></a>00285                                         <span class="stringliteral">"fors.vimos_science.slit_margin"</span>,
-<a name="l00286"></a>00286                                         NULL);
-<a name="l00287"></a>00287     <span class="keywordflow">if</span> (slit_margin < 0)
-<a name="l00288"></a>00288         vimos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00289"></a>00289 
-<a name="l00290"></a>00290     ext_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00291"></a>00291                                        <span class="stringliteral">"fors.vimos_science.ext_radius"</span>,
-<a name="l00292"></a>00292                                        NULL);
-<a name="l00293"></a>00293     <span class="keywordflow">if</span> (ext_radius < 0)
-<a name="l00294"></a>00294         vimos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00295"></a>00295 
-<a name="l00296"></a>00296     cont_radius = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, 
-<a name="l00297"></a>00297                                         <span class="stringliteral">"fors.vimos_science.cont_radius"</span>,
-<a name="l00298"></a>00298                                         NULL);
-<a name="l00299"></a>00299     <span class="keywordflow">if</span> (cont_radius < 0)
-<a name="l00300"></a>00300         vimos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);
-<a name="l00301"></a>00301 
-<a name="l00302"></a>00302     ext_mode = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_science.ext_mode"</span>,
-<a name="l00303"></a>00303                                        NULL);
-<a name="l00304"></a>00304     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)
-<a name="l00305"></a>00305         vimos_science_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);
-<a name="l00306"></a>00306 
-<a name="l00307"></a>00307     time_normalise = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, 
-<a name="l00308"></a>00308                              <span class="stringliteral">"fors.vimos_science.time_normalise"</span>, NULL);
-<a name="l00309"></a>00309 
-<a name="l00310"></a>00310     res_order = <a class="code" href="group__forsdfs.html#gb0f351141cdcd36711062d98ca80bd59">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_science.response"</span>,
-<a name="l00311"></a>00311                                       NULL);
-<a name="l00312"></a>00312     <span class="keywordflow">if</span> (res_order < 2 || res_order > 10)
-<a name="l00313"></a>00313         vimos_science_exit(<span class="stringliteral">"Invalid instrument response modeling polynomial"</span>);
-<a name="l00314"></a>00314 
-<a name="l00315"></a>00315     anyframe = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.anyframe"</span>, 
-<a name="l00316"></a>00316                                       NULL);
-<a name="l00317"></a>00317 
-<a name="l00318"></a>00318     qc = <a class="code" href="group__forsdfs.html#g29d32919bff2808b25d85dacd496e834">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.qc"</span>, NULL);
-<a name="l00319"></a>00319 
-<a name="l00320"></a>00320     cpl_table_delete(grism_table); grism_table = NULL;
-<a name="l00321"></a>00321 
-<a name="l00322"></a>00322     <span class="keywordflow">if</span> (cpl_error_get_code())
-<a name="l00323"></a>00323         vimos_science_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);
-<a name="l00324"></a>00324 
-<a name="l00325"></a>00325     
-<a name="l00326"></a>00326     <span class="comment">/* </span>
-<a name="l00327"></a>00327 <span class="comment">     * Check input set-of-frames</span>
-<a name="l00328"></a>00328 <span class="comment">     */</span>
-<a name="l00329"></a>00329 
-<a name="l00330"></a>00330     cpl_msg_indent_less();
-<a name="l00331"></a>00331     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);
-<a name="l00332"></a>00332     cpl_msg_indent_more();
-<a name="l00333"></a>00333 
-<a name="l00334"></a>00334     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO OCS CON QUAD"</span>))
-<a name="l00335"></a>00335         vimos_science_exit(<span class="stringliteral">"Input frames are not from the same quadrant"</span>);
-<a name="l00336"></a>00336 
-<a name="l00337"></a>00337     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MOS_SCIENCE"</span>);
-<a name="l00338"></a>00338     standard = 0;
-<a name="l00339"></a>00339 
-<a name="l00340"></a>00340     <span class="keywordflow">if</span> (mos == 0) {
-<a name="l00341"></a>00341         mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MOS_STANDARD"</span>);
-<a name="l00342"></a>00342         standard = 1;
-<a name="l00343"></a>00343     }
-<a name="l00344"></a>00344 
-<a name="l00345"></a>00345     <span class="keywordflow">if</span> (mos == 0)
-<a name="l00346"></a>00346         vimos_science_exit(<span class="stringliteral">"Missing input scientific frame"</span>);
-<a name="l00347"></a>00347 
-<a name="l00348"></a>00348     nscience = mos;
-<a name="l00349"></a>00349 
-<a name="l00350"></a>00350     <span class="keywordflow">if</span> (standard) {
-<a name="l00351"></a>00351         science_tag            = <span class="stringliteral">"MOS_STANDARD"</span>;
-<a name="l00352"></a>00352         reduced_science_tag    = <span class="stringliteral">"MOS_STANDARD_REDUCED"</span>;
-<a name="l00353"></a>00353         unmapped_science_tag   = <span class="stringliteral">"MOS_UNMAPPED_STANDARD"</span>;
-<a name="l00354"></a>00354         mapped_science_tag     = <span class="stringliteral">"MOS_STANDARD_EXTRACTED"</span>;
-<a name="l00355"></a>00355         mapped_science_sky_tag = <span class="stringliteral">"MOS_STANDARD_SKY_EXTRACTED"</span>;
-<a name="l00356"></a>00356         mapped_sky_tag         = <span class="stringliteral">"MOS_STANDARD_SKY"</span>;
-<a name="l00357"></a>00357         specphot_tag           = <span class="stringliteral">"MOS_SPECPHOT_TABLE"</span>;
-<a name="l00358"></a>00358 
-<a name="l00359"></a>00359     }
-<a name="l00360"></a>00360     <span class="keywordflow">else</span> {
-<a name="l00361"></a>00361         science_tag            = <span class="stringliteral">"MOS_SCIENCE"</span>;
-<a name="l00362"></a>00362         reduced_science_tag    = <span class="stringliteral">"MOS_SCIENCE_REDUCED"</span>;
-<a name="l00363"></a>00363         unmapped_science_tag   = <span class="stringliteral">"MOS_UNMAPPED_SCIENCE"</span>;
-<a name="l00364"></a>00364         mapped_science_tag     = <span class="stringliteral">"MOS_SCIENCE_EXTRACTED"</span>;
-<a name="l00365"></a>00365         mapped_science_sky_tag = <span class="stringliteral">"MOS_SCIENCE_SKY_EXTRACTED"</span>;
-<a name="l00366"></a>00366         mapped_sky_tag         = <span class="stringliteral">"MOS_SCIENCE_SKY"</span>;
-<a name="l00367"></a>00367     }
-<a name="l00368"></a>00368 
-<a name="l00369"></a>00369     reduced_sky_tag         = <span class="stringliteral">"MOS_SKY_REDUCED"</span>;
-<a name="l00370"></a>00370     reduced_error_tag       = <span class="stringliteral">"MOS_ERROR_REDUCED"</span>;
-<a name="l00371"></a>00371     master_norm_flat_tag    = <span class="stringliteral">"MOS_MASTER_SCREEN_FLAT"</span>;
-<a name="l00372"></a>00372     disp_coeff_sky_tag      = <span class="stringliteral">"MOS_DISP_COEFF_SKY"</span>;
-<a name="l00373"></a>00373     wavelength_map_sky_tag  = <span class="stringliteral">"MOS_WAVELENGTH_MAP_SKY"</span>;
-<a name="l00374"></a>00374     disp_coeff_tag          = <span class="stringliteral">"MOS_DISP_COEFF"</span>;
-<a name="l00375"></a>00375     wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_MXU"</span>;
-<a name="l00376"></a>00376     curv_coeff_tag          = <span class="stringliteral">"MOS_CURV_COEFF"</span>;
-<a name="l00377"></a>00377     slit_location_tag       = <span class="stringliteral">"MOS_SLIT_LOCATION"</span>;
-<a name="l00378"></a>00378     skylines_offsets_tag    = <span class="stringliteral">"MOS_SKYLINES_OFFSETS_SLIT"</span>;
-<a name="l00379"></a>00379     unmapped_sky_tag        = <span class="stringliteral">"MOS_UNMAPPED_SKY"</span>;
-<a name="l00380"></a>00380     global_sky_spectrum_tag = <span class="stringliteral">"MOS_GLOBAL_SKY_SPECTRUM"</span>;
-<a name="l00381"></a>00381     object_table_tag        = <span class="stringliteral">"OBJECT_TABLE"</span>;
-<a name="l00382"></a>00382 
-<a name="l00383"></a>00383     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0)
-<a name="l00384"></a>00384         vimos_science_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS"</span>);
-<a name="l00385"></a>00385 
-<a name="l00386"></a>00386     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)
-<a name="l00387"></a>00387         vimos_science_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);
-<a name="l00388"></a>00388 
-<a name="l00389"></a>00389     <span class="keywordflow">if</span> (skyalign >= 0)
-<a name="l00390"></a>00390         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"SKY_LINE_CATALOG"</span>) > 1)
-<a name="l00391"></a>00391             vimos_science_exit(<span class="stringliteral">"Too many in input: SKY_LINE_CATALOG"</span>);
-<a name="l00392"></a>00392 
-<a name="l00393"></a>00393     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) == 0) {
-<a name="l00394"></a>00394         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, disp_coeff_tag);
-<a name="l00395"></a>00395         vimos_science_exit(NULL);
-<a name="l00396"></a>00396     }
-<a name="l00397"></a>00397 
-<a name="l00398"></a>00398     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) > 1) {
-<a name="l00399"></a>00399         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, disp_coeff_tag);
-<a name="l00400"></a>00400         vimos_science_exit(NULL);
-<a name="l00401"></a>00401     }
-<a name="l00402"></a>00402 
-<a name="l00403"></a>00403     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) > 1) {
-<a name="l00404"></a>00404         <span class="keywordflow">if</span> (flatfield) {
-<a name="l00405"></a>00405             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, 
-<a name="l00406"></a>00406                           master_norm_flat_tag);
-<a name="l00407"></a>00407             vimos_science_exit(NULL);
-<a name="l00408"></a>00408         }
-<a name="l00409"></a>00409         <span class="keywordflow">else</span> {
-<a name="l00410"></a>00410             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input are ignored, "</span>
-<a name="l00411"></a>00411                             <span class="stringliteral">"since flat field correction was not requested"</span>, 
-<a name="l00412"></a>00412                             master_norm_flat_tag);
-<a name="l00413"></a>00413         }
-<a name="l00414"></a>00414     }
-<a name="l00415"></a>00415 
-<a name="l00416"></a>00416     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 1) {
-<a name="l00417"></a>00417         <span class="keywordflow">if</span> (!flatfield) {
-<a name="l00418"></a>00418             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input is ignored, "</span>
-<a name="l00419"></a>00419                             <span class="stringliteral">"since flat field correction was not requested"</span>, 
-<a name="l00420"></a>00420                             master_norm_flat_tag);
-<a name="l00421"></a>00421         }
-<a name="l00422"></a>00422     }
-<a name="l00423"></a>00423 
-<a name="l00424"></a>00424     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 0) {
-<a name="l00425"></a>00425         <span class="keywordflow">if</span> (flatfield) {
-<a name="l00426"></a>00426             cpl_msg_error(recipe, <span class="stringliteral">"Flat field correction was requested, "</span>
-<a name="l00427"></a>00427                           <span class="stringliteral">"but no %s are found in input"</span>,
-<a name="l00428"></a>00428                           master_norm_flat_tag);
-<a name="l00429"></a>00429             vimos_science_exit(NULL);
-<a name="l00430"></a>00430         }
-<a name="l00431"></a>00431     }
-<a name="l00432"></a>00432 
-<a name="l00433"></a>00433     <span class="keywordflow">if</span> (standard) {
-<a name="l00434"></a>00434 
-<a name="l00435"></a>00435         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) == 0) {
-<a name="l00436"></a>00436             cpl_msg_warning(recipe, <span class="stringliteral">"An EXTINCT_TABLE was not found in input: "</span>
-<a name="l00437"></a>00437                             <span class="stringliteral">"instrument response curve will not be produced."</span>);
-<a name="l00438"></a>00438             standard = 0;
-<a name="l00439"></a>00439         }
-<a name="l00440"></a>00440 
-<a name="l00441"></a>00441         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) > 1)
-<a name="l00442"></a>00442             vimos_science_exit(<span class="stringliteral">"Too many in input: EXTINCT_TABLE"</span>);
-<a name="l00443"></a>00443 
-<a name="l00444"></a>00444         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>) == 0) {
-<a name="l00445"></a>00445             cpl_msg_warning(recipe, <span class="stringliteral">"A STD_FLUX_TABLE was not found in input: "</span>
-<a name="l00446"></a>00446                             <span class="stringliteral">"instrument response curve will not be produced."</span>);
-<a name="l00447"></a>00447             standard = 0;
-<a name="l00448"></a>00448         }
-<a name="l00449"></a>00449 
-<a name="l00450"></a>00450         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>) > 1)
-<a name="l00451"></a>00451             vimos_science_exit(<span class="stringliteral">"Too many in input: STD_FLUX_TABLE"</span>);
-<a name="l00452"></a>00452 
-<a name="l00453"></a>00453         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#g318f71668fea717baced57478bd282c8">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO OBS TARG NAME"</span>)) {
-<a name="l00454"></a>00454             cpl_msg_warning(recipe, <span class="stringliteral">"The target name of observation does not "</span>
-<a name="l00455"></a>00455                             <span class="stringliteral">"match the standard star catalog: "</span>
-<a name="l00456"></a>00456                             <span class="stringliteral">"instrument response curve will not be produced."</span>);
-<a name="l00457"></a>00457             standard = 0;
-<a name="l00458"></a>00458         }
-<a name="l00459"></a>00459     }
-<a name="l00460"></a>00460 
-<a name="l00461"></a>00461     cpl_msg_indent_less();
-<a name="l00462"></a>00462 
-<a name="l00463"></a>00463 
-<a name="l00464"></a>00464     <span class="comment">/*</span>
-<a name="l00465"></a>00465 <span class="comment">     * Loading input data</span>
-<a name="l00466"></a>00466 <span class="comment">     */</span>
-<a name="l00467"></a>00467 
-<a name="l00468"></a>00468     exptime = cpl_calloc(nscience, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00469"></a>00469 
-<a name="l00470"></a>00470     <span class="keywordflow">if</span> (nscience > 1) {
-<a name="l00471"></a>00471 
-<a name="l00472"></a>00472         cpl_msg_info(recipe, <span class="stringliteral">"Load %d scientific frames and median them..."</span>,
-<a name="l00473"></a>00473                      nscience);
-<a name="l00474"></a>00474         cpl_msg_indent_more();
-<a name="l00475"></a>00475 
-<a name="l00476"></a>00476         all_science = cpl_imagelist_new();
-<a name="l00477"></a>00477 
-<a name="l00478"></a>00478         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l00479"></a>00479 
-<a name="l00480"></a>00480         <span class="keywordflow">if</span> (header == NULL)
-<a name="l00481"></a>00481             vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l00482"></a>00482 
-<a name="l00483"></a>00483         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l00484"></a>00484 
-<a name="l00485"></a>00485         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00486"></a>00486             vimos_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l00487"></a>00487                               <span class="stringliteral">"frame header"</span>);
-<a name="l00488"></a>00488 
-<a name="l00489"></a>00489         <span class="keywordflow">if</span> (standard) {
-<a name="l00490"></a>00490             airmass = <a class="code" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">fors_get_airmass</a>(header);
-<a name="l00491"></a>00491             <span class="keywordflow">if</span> (airmass < 0.0)
-<a name="l00492"></a>00492                 vimos_science_exit(<span class="stringliteral">"Missing airmass information in "</span>
-<a name="l00493"></a>00493                                    <span class="stringliteral">"scientific frame header"</span>);
-<a name="l00494"></a>00494         }
-<a name="l00495"></a>00495 
-<a name="l00496"></a>00496         instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00497"></a>00497         <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00498"></a>00498             vimos_science_exit(<span class="stringliteral">"Missing keyword INSTRUME "</span>
-<a name="l00499"></a>00499                                <span class="stringliteral">"in scientific frame header"</span>);
-<a name="l00500"></a>00500 
-<a name="l00501"></a>00501         cpl_propertylist_delete(header); header = NULL;
-<a name="l00502"></a>00502 
-<a name="l00503"></a>00503         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame 1 exposure time: %.2f s"</span>, 
-<a name="l00504"></a>00504                      exptime[0]);
-<a name="l00505"></a>00505 
-<a name="l00506"></a>00506         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {
-<a name="l00507"></a>00507 
-<a name="l00508"></a>00508             header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, NULL, 0);
-<a name="l00509"></a>00509 
-<a name="l00510"></a>00510             <span class="keywordflow">if</span> (header == NULL)
-<a name="l00511"></a>00511                 vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l00512"></a>00512     
-<a name="l00513"></a>00513             exptime[i] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l00514"></a>00514 
-<a name="l00515"></a>00515             alltime += exptime[i];
-<a name="l00516"></a>00516     
-<a name="l00517"></a>00517             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00518"></a>00518                 vimos_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l00519"></a>00519                                   <span class="stringliteral">"frame header"</span>);
-<a name="l00520"></a>00520     
-<a name="l00521"></a>00521             cpl_propertylist_delete(header); header = NULL;
-<a name="l00522"></a>00522 
-<a name="l00523"></a>00523             cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame %d exposure time: %.2f s"</span>, 
-<a name="l00524"></a>00524                          i+1, exptime[i]);
-<a name="l00525"></a>00525         }
-<a name="l00526"></a>00526 
-<a name="l00527"></a>00527         spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00528"></a>00528 
-<a name="l00529"></a>00529         <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00530"></a>00530             vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l00531"></a>00531 
-<a name="l00532"></a>00532         cpl_image_divide_scalar(spectra, exptime[0]);
-<a name="l00533"></a>00533         cpl_imagelist_set(all_science, spectra, 0);
-<a name="l00534"></a>00534 
-<a name="l00535"></a>00535         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {
-<a name="l00536"></a>00536 
-<a name="l00537"></a>00537             spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00538"></a>00538 
-<a name="l00539"></a>00539             <span class="keywordflow">if</span> (spectra) {
-<a name="l00540"></a>00540                 cpl_image_divide_scalar(spectra, exptime[i]);
-<a name="l00541"></a>00541                 cpl_imagelist_set(all_science, spectra, i);
-<a name="l00542"></a>00542             }
-<a name="l00543"></a>00543             <span class="keywordflow">else</span>
-<a name="l00544"></a>00544                 vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l00545"></a>00545 
-<a name="l00546"></a>00546         }
-<a name="l00547"></a>00547 
-<a name="l00548"></a>00548         spectra = cpl_imagelist_collapse_median_create(all_science);
-<a name="l00549"></a>00549         cpl_image_multiply_scalar(spectra, alltime);
-<a name="l00550"></a>00550 
-<a name="l00551"></a>00551         cpl_imagelist_delete(all_science);
-<a name="l00552"></a>00552     }
-<a name="l00553"></a>00553     <span class="keywordflow">else</span> {
-<a name="l00554"></a>00554         cpl_msg_info(recipe, <span class="stringliteral">"Load scientific exposure..."</span>);
-<a name="l00555"></a>00555         cpl_msg_indent_more();
-<a name="l00556"></a>00556 
-<a name="l00557"></a>00557         header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l00558"></a>00558 
-<a name="l00559"></a>00559         <span class="keywordflow">if</span> (header == NULL)
-<a name="l00560"></a>00560             vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l00561"></a>00561 
-<a name="l00562"></a>00562         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);
-<a name="l00563"></a>00563 
-<a name="l00564"></a>00564         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00565"></a>00565             vimos_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span>
-<a name="l00566"></a>00566                               <span class="stringliteral">"frame header"</span>);
-<a name="l00567"></a>00567 
-<a name="l00568"></a>00568         <span class="keywordflow">if</span> (standard) {
-<a name="l00569"></a>00569             airmass = <a class="code" href="group__fors__tools.html#g5598e5ffadb4b4949d8c17df0674f437">fors_get_airmass</a>(header);
-<a name="l00570"></a>00570             <span class="keywordflow">if</span> (airmass < 0.0)
-<a name="l00571"></a>00571                 vimos_science_exit(<span class="stringliteral">"Missing airmass information in "</span>
-<a name="l00572"></a>00572                                    <span class="stringliteral">"scientific frame header"</span>);
-<a name="l00573"></a>00573         }
-<a name="l00574"></a>00574 
-<a name="l00575"></a>00575         instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);
-<a name="l00576"></a>00576         <span class="keywordflow">if</span> (instrume == NULL)
-<a name="l00577"></a>00577             vimos_science_exit(<span class="stringliteral">"Missing keyword INSTRUME "</span>
-<a name="l00578"></a>00578                                <span class="stringliteral">"in scientific frame header"</span>);
-<a name="l00579"></a>00579 
-<a name="l00580"></a>00580         cpl_propertylist_delete(header); header = NULL;
-<a name="l00581"></a>00581 
-<a name="l00582"></a>00582         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame exposure time: %.2f s"</span>, 
-<a name="l00583"></a>00583                      exptime[0]);
-<a name="l00584"></a>00584 
-<a name="l00585"></a>00585         spectra = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);
-<a name="l00586"></a>00586     }
-<a name="l00587"></a>00587 
-<a name="l00588"></a>00588     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00589"></a>00589         vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);
-<a name="l00590"></a>00590 
-<a name="l00591"></a>00591     cpl_free(exptime); exptime = NULL;
-<a name="l00592"></a>00592 
-<a name="l00593"></a>00593     cpl_msg_indent_less();
-<a name="l00594"></a>00594 
-<a name="l00595"></a>00595 
-<a name="l00596"></a>00596     <span class="comment">/*</span>
-<a name="l00597"></a>00597 <span class="comment">     * Get some info from header</span>
-<a name="l00598"></a>00598 <span class="comment">     */</span>
-<a name="l00599"></a>00599 
-<a name="l00600"></a>00600     header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l00601"></a>00601 
-<a name="l00602"></a>00602     <span class="keywordflow">if</span> (header == NULL)
-<a name="l00603"></a>00603         vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);
-<a name="l00604"></a>00604 
-<a name="l00605"></a>00605     quadrant = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO OCS CON QUAD"</span>);
-<a name="l00606"></a>00606 
-<a name="l00607"></a>00607     <span class="keywordflow">switch</span> (quadrant) {
-<a name="l00608"></a>00608     <span class="keywordflow">case</span> 1:
-<a name="l00609"></a>00609         key_gris_name = <span class="stringliteral">"ESO INS GRIS1 NAME"</span>;
-<a name="l00610"></a>00610         key_gris_id = <span class="stringliteral">"ESO INS GRIS1 ID"</span>;
-<a name="l00611"></a>00611         key_filt_name = <span class="stringliteral">"ESO INS FILT1 NAME"</span>;
-<a name="l00612"></a>00612         key_filt_id = <span class="stringliteral">"ESO INS FILT1 ID"</span>;
-<a name="l00613"></a>00613         <span class="keywordflow">break</span>;
-<a name="l00614"></a>00614     <span class="keywordflow">case</span> 2: 
-<a name="l00615"></a>00615         key_gris_name = <span class="stringliteral">"ESO INS GRIS2 NAME"</span>;
-<a name="l00616"></a>00616         key_gris_id = <span class="stringliteral">"ESO INS GRIS2 ID"</span>;
-<a name="l00617"></a>00617         key_filt_name = <span class="stringliteral">"ESO INS FILT2 NAME"</span>;
-<a name="l00618"></a>00618         key_filt_id = <span class="stringliteral">"ESO INS FILT2 ID"</span>;
-<a name="l00619"></a>00619         <span class="keywordflow">break</span>;
-<a name="l00620"></a>00620     <span class="keywordflow">case</span> 3: 
-<a name="l00621"></a>00621         key_gris_name = <span class="stringliteral">"ESO INS GRIS3 NAME"</span>;
-<a name="l00622"></a>00622         key_gris_id = <span class="stringliteral">"ESO INS GRIS3 ID"</span>;
-<a name="l00623"></a>00623         key_filt_name = <span class="stringliteral">"ESO INS FILT3 NAME"</span>;
-<a name="l00624"></a>00624         key_filt_id = <span class="stringliteral">"ESO INS FILT3 ID"</span>;
-<a name="l00625"></a>00625         <span class="keywordflow">break</span>;
-<a name="l00626"></a>00626     <span class="keywordflow">case</span> 4:
-<a name="l00627"></a>00627         key_gris_name = <span class="stringliteral">"ESO INS GRIS4 NAME"</span>;
-<a name="l00628"></a>00628         key_gris_id = <span class="stringliteral">"ESO INS GRIS4 ID"</span>;
-<a name="l00629"></a>00629         key_filt_name = <span class="stringliteral">"ESO INS FILT4 NAME"</span>;
-<a name="l00630"></a>00630         key_filt_id = <span class="stringliteral">"ESO INS FILT4 ID"</span>;
-<a name="l00631"></a>00631         <span class="keywordflow">break</span>;
-<a name="l00632"></a>00632     }
-<a name="l00633"></a>00633 
-<a name="l00634"></a>00634     <span class="keywordflow">if</span> (standard) {
-<a name="l00635"></a>00635         <span class="keywordflow">if</span> (!anyframe) {
-<a name="l00636"></a>00636 
-<a name="l00637"></a>00637            <span class="comment">/*</span>
-<a name="l00638"></a>00638 <span class="comment">            *  As a default this recipe wouldn't reduce a frame belonging </span>
-<a name="l00639"></a>00639 <span class="comment">            *  to a quadrant that is not expected to contain a standard </span>
-<a name="l00640"></a>00640 <span class="comment">            *  star. The current template for getting data for photometric </span>
-<a name="l00641"></a>00641 <span class="comment">            *  calibration consists of a sequence of 4 exposures, where </span>
-<a name="l00642"></a>00642 <span class="comment">            *  the same standard star is moved through all quadrants. </span>
-<a name="l00643"></a>00643 <span class="comment">            *  The first exposure has the standard star in quadrant 1, </span>
-<a name="l00644"></a>00644 <span class="comment">            *  the second exposure in quadrant 2, and so on. So a standard </span>
-<a name="l00645"></a>00645 <span class="comment">            *  star will be reduced only if it is part of a template of </span>
-<a name="l00646"></a>00646 <span class="comment">            *  4 exposures (i.e., TPL NEXP == 4), and if its sequence </span>
-<a name="l00647"></a>00647 <span class="comment">            *  number in the template is equal to its quadrant number </span>
-<a name="l00648"></a>00648 <span class="comment">            *  (i.e., TPL EXPNO == OCS CON QUAD).</span>
-<a name="l00649"></a>00649 <span class="comment">            */</span>
-<a name="l00650"></a>00650 
-<a name="l00651"></a>00651             nexp = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO TPL NEXP"</span>);
-<a name="l00652"></a>00652 
-<a name="l00653"></a>00653             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00654"></a>00654                 vimos_science_exit(<span class="stringliteral">"Missing keyword ESO TPL NEXP in "</span>
-<a name="l00655"></a>00655                                     <span class="stringliteral">"scientific frame header"</span>);
-<a name="l00656"></a>00656 
-<a name="l00657"></a>00657             <span class="keywordflow">if</span> (nexp == 4) {
-<a name="l00658"></a>00658                 expno = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO TPL EXPNO"</span>);
-<a name="l00659"></a>00659 
-<a name="l00660"></a>00660             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00661"></a>00661                 vimos_science_exit(<span class="stringliteral">"Missing keyword ESO TPL EXPNO in "</span>
-<a name="l00662"></a>00662                                    <span class="stringliteral">"scientific frame header"</span>);
-<a name="l00663"></a>00663             }
-<a name="l00664"></a>00664 
-<a name="l00665"></a>00665             <span class="keywordflow">if</span> (quadrant != expno) {
-<a name="l00666"></a>00666                 cpl_msg_warning(recipe, <span class="stringliteral">"The MOS_STANDARD frame is not "</span>
-<a name="l00667"></a>00667                                 <span class="stringliteral">"expected to contain a standard star: "</span>
-<a name="l00668"></a>00668                                 <span class="stringliteral">"instrument response curve will not be "</span>
-<a name="l00669"></a>00669                                 <span class="stringliteral">"produced. Set --anyframe=true to skip "</span>
-<a name="l00670"></a>00670                                 <span class="stringliteral">"this check."</span>);
-<a name="l00671"></a>00671                 standard = 0;
-<a name="l00672"></a>00672             }
-<a name="l00673"></a>00673         }
-<a name="l00674"></a>00674     }
-<a name="l00675"></a>00675 
-<a name="l00676"></a>00676 <span class="comment">/*</span>
-<a name="l00677"></a>00677 <span class="comment">    if (!dfs_equal_keyword(frameset, key_gris_id))</span>
-<a name="l00678"></a>00678 <span class="comment">        vimos_science_exit("Input frames are not from the same grism");</span>
-<a name="l00679"></a>00679 <span class="comment"></span>
-<a name="l00680"></a>00680 <span class="comment">    if (!dfs_equal_keyword(frameset, key_filt_id))</span>
-<a name="l00681"></a>00681 <span class="comment">        vimos_science_exit("Input frames are not from the same filter");</span>
-<a name="l00682"></a>00682 <span class="comment">*/</span>
-<a name="l00683"></a>00683 
-<a name="l00684"></a>00684     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);
-<a name="l00685"></a>00685 
-<a name="l00686"></a>00686     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00687"></a>00687         vimos_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in scientific "</span>
-<a name="l00688"></a>00688                           <span class="stringliteral">"frame header"</span>);
-<a name="l00689"></a>00689 
-<a name="l00690"></a>00690     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);
-<a name="l00691"></a>00691 
-<a name="l00692"></a>00692     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);
-<a name="l00693"></a>00693 
-<a name="l00694"></a>00694     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)
-<a name="l00695"></a>00695         vimos_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in scientific "</span>
-<a name="l00696"></a>00696                           <span class="stringliteral">"frame header"</span>);
-<a name="l00697"></a>00697 
-<a name="l00698"></a>00698     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span>
-<a name="l00699"></a>00699 
-<a name="l00700"></a>00700     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);
-<a name="l00701"></a>00701 
-<a name="l00702"></a>00702     <span class="comment">/* </span>
-<a name="l00703"></a>00703 <span class="comment">     * In VIMOS data are "never" LSS. This is why this part is</span>
-<a name="l00704"></a>00704 <span class="comment">     * commented out.</span>
-<a name="l00705"></a>00705 <span class="comment">     */</span>
-<a name="l00706"></a>00706 
-<a name="l00707"></a>00707 <span class="comment">//    maskslits = mos_load_slits_vimos(header);</span>
-<a name="l00708"></a>00708 <span class="comment">//</span>
-<a name="l00709"></a>00709 <span class="comment">//    /*</span>
-<a name="l00710"></a>00710 <span class="comment">//     * Check if all slits have the same X offset: in such case,</span>
-<a name="l00711"></a>00711 <span class="comment">//     * treat the observation as a long-slit one!</span>
-<a name="l00712"></a>00712 <span class="comment">//     */</span>
-<a name="l00713"></a>00713 <span class="comment">//</span>
-<a name="l00714"></a>00714 <span class="comment">//    mxpos = cpl_table_get_column_median(maskslits, "ytop");</span>
-<a name="l00715"></a>00715 <span class="comment">//    xpos = cpl_table_get_data_double(maskslits, "ytop");</span>
-<a name="l00716"></a>00716 <span class="comment">//    nslits = cpl_table_get_nrow(maskslits);</span>
-<a name="l00717"></a>00717 <span class="comment">//     </span>
-<a name="l00718"></a>00718 <span class="comment">//    treat_as_lss = 1;</span>
-<a name="l00719"></a>00719 <span class="comment">//    for (i = 0; i < nslits; i++) { </span>
-<a name="l00720"></a>00720 <span class="comment">//        if (fabs(mxpos-xpos[i]) > 0.01) {</span>
-<a name="l00721"></a>00721 <span class="comment">//            treat_as_lss = 0;</span>
-<a name="l00722"></a>00722 <span class="comment">//            break;</span>
-<a name="l00723"></a>00723 <span class="comment">//        }</span>
-<a name="l00724"></a>00724 <span class="comment">//    }</span>
-<a name="l00725"></a>00725 <span class="comment">//</span>
-<a name="l00726"></a>00726 <span class="comment">//    treat_as_lss = 0;  // FIXME Prevent LSS treatment for the moment!!!</span>
-<a name="l00727"></a>00727 <span class="comment">//</span>
-<a name="l00728"></a>00728 <span class="comment">//    cpl_table_delete(maskslits); maskslits = NULL;</span>
-<a name="l00729"></a>00729 <span class="comment">//</span>
-<a name="l00730"></a>00730 <span class="comment">//    if (treat_as_lss) {</span>
-<a name="l00731"></a>00731 <span class="comment">//        cpl_msg_warning(recipe, "All MOS slits have the same offset: %.2f\n"</span>
-<a name="l00732"></a>00732 <span class="comment">//                        "The LSS data reduction strategy is applied!",</span>
-<a name="l00733"></a>00733 <span class="comment">//                        mxpos);</span>
-<a name="l00734"></a>00734 <span class="comment">//        skylines_offsets_tag   = "MOS_SKYLINES_OFFSETS_LONG";</span>
-<a name="l00735"></a>00735 <span class="comment">//    }</span>
-<a name="l00736"></a>00736 
-<a name="l00737"></a>00737     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00738"></a>00738         <span class="keywordflow">if</span> (skylocal) {
-<a name="l00739"></a>00739             <span class="keywordflow">if</span> (cosmics)
-<a name="l00740"></a>00740                 vimos_science_exit(<span class="stringliteral">"Cosmic rays correction for long-slit-like "</span>
-<a name="l00741"></a>00741                                   <span class="stringliteral">"data requires --skyglobal=true"</span>);
-<a name="l00742"></a>00742             skymedian = skylocal;
-<a name="l00743"></a>00743             skylocal = 0;
-<a name="l00744"></a>00744         }
-<a name="l00745"></a>00745     }
-<a name="l00746"></a>00746     <span class="keywordflow">else</span> {
-<a name="l00747"></a>00747         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) == 0) {
-<a name="l00748"></a>00748             cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, curv_coeff_tag);
-<a name="l00749"></a>00749             vimos_science_exit(NULL);
-<a name="l00750"></a>00750         }
-<a name="l00751"></a>00751 
-<a name="l00752"></a>00752         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) > 1) {
-<a name="l00753"></a>00753             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, curv_coeff_tag);
-<a name="l00754"></a>00754             vimos_science_exit(NULL);
-<a name="l00755"></a>00755         }
-<a name="l00756"></a>00756 
-<a name="l00757"></a>00757         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) == 0) {
-<a name="l00758"></a>00758             cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, 
-<a name="l00759"></a>00759                           slit_location_tag);
-<a name="l00760"></a>00760             vimos_science_exit(NULL);
-<a name="l00761"></a>00761         }
-<a name="l00762"></a>00762         
-<a name="l00763"></a>00763         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) > 1) {
-<a name="l00764"></a>00764             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, slit_location_tag);
-<a name="l00765"></a>00765             vimos_science_exit(NULL);
-<a name="l00766"></a>00766         }
-<a name="l00767"></a>00767     }
-<a name="l00768"></a>00768 
-<a name="l00769"></a>00769     <span class="comment">/* Leave the header on for the next step... */</span>
-<a name="l00770"></a>00770 
-<a name="l00771"></a>00771 
-<a name="l00772"></a>00772     <span class="comment">/*</span>
-<a name="l00773"></a>00773 <span class="comment">     * Remove the master bias</span>
-<a name="l00774"></a>00774 <span class="comment">     */</span>
-<a name="l00775"></a>00775 
-<a name="l00776"></a>00776     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);
-<a name="l00777"></a>00777 
-<a name="l00778"></a>00778     bias = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, CPL_TYPE_FLOAT, 0, 1);
-<a name="l00779"></a>00779 
-<a name="l00780"></a>00780     <span class="keywordflow">if</span> (bias == NULL)
-<a name="l00781"></a>00781         vimos_science_exit(<span class="stringliteral">"Cannot load master bias"</span>);
-<a name="l00782"></a>00782 
-<a name="l00783"></a>00783     overscans = <a class="code" href="group__moses.html#gde22c6582532e051c045baf0ee969e79">mos_load_overscans_vimos</a>(header, 1);
-<a name="l00784"></a>00784     cpl_propertylist_delete(header); header = NULL;
-<a name="l00785"></a>00785     dummy = <a class="code" href="group__moses.html#g35fbde09e98e8c5b0d615ed02e1c7e90">mos_remove_bias</a>(spectra, bias, overscans);
-<a name="l00786"></a>00786     cpl_image_delete(spectra); spectra = dummy; dummy = NULL;
-<a name="l00787"></a>00787     cpl_image_delete(bias); bias = NULL;
-<a name="l00788"></a>00788     cpl_table_delete(overscans); overscans = NULL;
-<a name="l00789"></a>00789 
-<a name="l00790"></a>00790     <span class="keywordflow">if</span> (spectra == NULL)
-<a name="l00791"></a>00791         vimos_science_exit(<span class="stringliteral">"Cannot remove bias from scientific frame"</span>);
-<a name="l00792"></a>00792 
-<a name="l00793"></a>00793     <span class="comment">/*</span>
-<a name="l00794"></a>00794 <span class="comment">     * Rotate frames horizontally with red to the right</span>
-<a name="l00795"></a>00795 <span class="comment">     */</span>
-<a name="l00796"></a>00796 
-<a name="l00797"></a>00797     cpl_image_turn(spectra, rotate);
-<a name="l00798"></a>00798 
-<a name="l00799"></a>00799     nx = cpl_image_get_size_x(spectra);
-<a name="l00800"></a>00800     ny = cpl_image_get_size_y(spectra);
-<a name="l00801"></a>00801 
-<a name="l00802"></a>00802     cpl_msg_indent_less();
-<a name="l00803"></a>00803     cpl_msg_info(recipe, <span class="stringliteral">"Load normalised flat field (if present)..."</span>);
-<a name="l00804"></a>00804     cpl_msg_indent_more();
-<a name="l00805"></a>00805 
-<a name="l00806"></a>00806     <span class="keywordflow">if</span> (flatfield) {
-<a name="l00807"></a>00807 
-<a name="l00808"></a>00808         norm_flat = <a class="code" href="group__forsdfs.html#g29a45e1e84aa9d87c1a23773e82c796f">dfs_load_image</a>(frameset, master_norm_flat_tag, 
-<a name="l00809"></a>00809                                    CPL_TYPE_FLOAT, 0, 1);
-<a name="l00810"></a>00810 
-<a name="l00811"></a>00811         <span class="keywordflow">if</span> (norm_flat) {
-<a name="l00812"></a>00812             cpl_image_turn(norm_flat, rotate);
-<a name="l00813"></a>00813             cpl_msg_info(recipe, <span class="stringliteral">"Apply flat field correction..."</span>);
-<a name="l00814"></a>00814             <span class="keywordflow">if</span> (cpl_image_divide(spectra, norm_flat) != CPL_ERROR_NONE) {
-<a name="l00815"></a>00815                 cpl_msg_error(recipe, <span class="stringliteral">"Failure of flat field correction: %s"</span>,
-<a name="l00816"></a>00816                               cpl_error_get_message());
-<a name="l00817"></a>00817                 vimos_science_exit(NULL);
-<a name="l00818"></a>00818             }
-<a name="l00819"></a>00819             cpl_image_delete(norm_flat); norm_flat = NULL;
-<a name="l00820"></a>00820         }
-<a name="l00821"></a>00821         <span class="keywordflow">else</span> {
-<a name="l00822"></a>00822             cpl_msg_error(recipe, <span class="stringliteral">"Cannot load input %s for flat field "</span>
-<a name="l00823"></a>00823                           <span class="stringliteral">"correction"</span>, master_norm_flat_tag);
-<a name="l00824"></a>00824             vimos_science_exit(NULL);
-<a name="l00825"></a>00825         }
-<a name="l00826"></a>00826 
-<a name="l00827"></a>00827     }
-<a name="l00828"></a>00828 
-<a name="l00829"></a>00829 
-<a name="l00830"></a>00830     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l00831"></a>00831         cpl_msg_indent_less();
-<a name="l00832"></a>00832         cpl_msg_info(recipe, <span class="stringliteral">"Load input sky line catalog..."</span>);
-<a name="l00833"></a>00833         cpl_msg_indent_more();
-<a name="l00834"></a>00834 
-<a name="l00835"></a>00835         wavelengths = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"SKY_LINE_CATALOG"</span>, 1);
-<a name="l00836"></a>00836 
-<a name="l00837"></a>00837         <span class="keywordflow">if</span> (wavelengths) {
-<a name="l00838"></a>00838 
-<a name="l00839"></a>00839             <span class="comment">/*</span>
-<a name="l00840"></a>00840 <span class="comment">             * Cast the wavelengths into a (double precision) CPL vector</span>
-<a name="l00841"></a>00841 <span class="comment">             */</span>
-<a name="l00842"></a>00842 
-<a name="l00843"></a>00843             nlines = cpl_table_get_nrow(wavelengths);
-<a name="l00844"></a>00844 
-<a name="l00845"></a>00845             <span class="keywordflow">if</span> (nlines == 0)
-<a name="l00846"></a>00846                 vimos_science_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);
-<a name="l00847"></a>00847 
-<a name="l00848"></a>00848             <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-<a name="l00849"></a>00849                 cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span>
-<a name="l00850"></a>00850                               <span class="stringliteral">"catalog table"</span>, wcolumn);
-<a name="l00851"></a>00851                 vimos_science_exit(NULL);
-<a name="l00852"></a>00852             }
-<a name="l00853"></a>00853 
-<a name="l00854"></a>00854             line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));
-<a name="l00855"></a>00855     
-<a name="l00856"></a>00856             <span class="keywordflow">for</span> (i = 0; i < nlines; i++)
-<a name="l00857"></a>00857                 line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-<a name="l00858"></a>00858 
-<a name="l00859"></a>00859             cpl_table_delete(wavelengths); wavelengths = NULL;
-<a name="l00860"></a>00860 
-<a name="l00861"></a>00861             lines = cpl_vector_wrap(nlines, line);
-<a name="l00862"></a>00862         }
-<a name="l00863"></a>00863         <span class="keywordflow">else</span> {
-<a name="l00864"></a>00864             cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);
-<a name="l00865"></a>00865         }
-<a name="l00866"></a>00866     }
-<a name="l00867"></a>00867 
-<a name="l00868"></a>00868 
-<a name="l00869"></a>00869     <span class="comment">/*</span>
-<a name="l00870"></a>00870 <span class="comment">     * Load the spectral curvature table, or provide a dummy one</span>
-<a name="l00871"></a>00871 <span class="comment">     * in case of LSS-like data (single slit with flat curvature)</span>
-<a name="l00872"></a>00872 <span class="comment">     */</span>
-<a name="l00873"></a>00873 
-<a name="l00874"></a>00874     <span class="keywordflow">if</span> (!treat_as_lss) {
-<a name="l00875"></a>00875         polytraces = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, curv_coeff_tag, 1);
-<a name="l00876"></a>00876         <span class="keywordflow">if</span> (polytraces == NULL)
-<a name="l00877"></a>00877             vimos_science_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);
-<a name="l00878"></a>00878     }
-<a name="l00879"></a>00879 
-<a name="l00880"></a>00880 
-<a name="l00881"></a>00881     <span class="comment">/*</span>
-<a name="l00882"></a>00882 <span class="comment">     * Load the slit location table, or provide a dummy one in case</span>
-<a name="l00883"></a>00883 <span class="comment">     * of LSS-like data (single slit spanning whole image)</span>
-<a name="l00884"></a>00884 <span class="comment">     */</span>
-<a name="l00885"></a>00885 
-<a name="l00886"></a>00886     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00887"></a>00887         slits = cpl_table_new(1);
-<a name="l00888"></a>00888         cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);
-<a name="l00889"></a>00889         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 1);
-<a name="l00890"></a>00890         cpl_table_new_column(slits, <span class="stringliteral">"position"</span>, CPL_TYPE_INT);
-<a name="l00891"></a>00891         cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, 0, 0);
-<a name="l00892"></a>00892         cpl_table_new_column(slits, <span class="stringliteral">"length"</span>, CPL_TYPE_INT);
-<a name="l00893"></a>00893         cpl_table_set_int(slits, <span class="stringliteral">"length"</span>, 0, ny);
-<a name="l00894"></a>00894     }
-<a name="l00895"></a>00895     <span class="keywordflow">else</span> {
-<a name="l00896"></a>00896         slits = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, slit_location_tag, 1);
-<a name="l00897"></a>00897         <span class="keywordflow">if</span> (slits == NULL)
-<a name="l00898"></a>00898             vimos_science_exit(<span class="stringliteral">"Cannot load slits location table"</span>);
-<a name="l00899"></a>00899         <a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a>(slits, -rotate, nx, ny);
-<a name="l00900"></a>00900     }
-<a name="l00901"></a>00901 
-<a name="l00902"></a>00902 
-<a name="l00903"></a>00903     <span class="comment">/*</span>
-<a name="l00904"></a>00904 <span class="comment">     * Load the wavelength calibration table</span>
-<a name="l00905"></a>00905 <span class="comment">     */</span>
-<a name="l00906"></a>00906 
-<a name="l00907"></a>00907     idscoeff = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, disp_coeff_tag, 1);
-<a name="l00908"></a>00908     <span class="keywordflow">if</span> (idscoeff == NULL)
-<a name="l00909"></a>00909         vimos_science_exit(<span class="stringliteral">"Cannot load wavelength calibration table"</span>);
-<a name="l00910"></a>00910 
-<a name="l00911"></a>00911     cpl_msg_indent_less();
-<a name="l00912"></a>00912     cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific spectra..."</span>);
-<a name="l00913"></a>00913     cpl_msg_indent_more();
-<a name="l00914"></a>00914 
-<a name="l00915"></a>00915     <span class="comment">/*</span>
-<a name="l00916"></a>00916 <span class="comment">     * This one will also generate the spatial map from the spectral </span>
-<a name="l00917"></a>00917 <span class="comment">     * curvature table (in the case of multislit data)</span>
-<a name="l00918"></a>00918 <span class="comment">     */</span>
-<a name="l00919"></a>00919 
-<a name="l00920"></a>00920     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00921"></a>00921         smapped = cpl_image_duplicate(spectra);
-<a name="l00922"></a>00922     }
-<a name="l00923"></a>00923     <span class="keywordflow">else</span> {
-<a name="l00924"></a>00924         coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l00925"></a>00925 
-<a name="l00926"></a>00926         smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, reference,
-<a name="l00927"></a>00927                                           startwavelength, endwavelength,
-<a name="l00928"></a>00928                                           dispersion, flux, coordinate);
-<a name="l00929"></a>00929     }
-<a name="l00930"></a>00930 
-<a name="l00931"></a>00931 
-<a name="l00932"></a>00932     <span class="comment">/*</span>
-<a name="l00933"></a>00933 <span class="comment">     * Generate a rectified wavelength map from the wavelength calibration </span>
-<a name="l00934"></a>00934 <span class="comment">     * table</span>
-<a name="l00935"></a>00935 <span class="comment">     */</span>
-<a name="l00936"></a>00936 
-<a name="l00937"></a>00937     rainbow = <a class="code" href="group__moses.html#g81b72d37c4c9090df07a8dd9a21b36ec">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength, 
-<a name="l00938"></a>00938                                endwavelength);
-<a name="l00939"></a>00939 
-<a name="l00940"></a>00940     <span class="keywordflow">if</span> (dispersion > 1.0)
-<a name="l00941"></a>00941         highres = 0;
-<a name="l00942"></a>00942     <span class="keywordflow">else</span>
-<a name="l00943"></a>00943         highres = 1;
-<a name="l00944"></a>00944 
-<a name="l00945"></a>00945     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l00946"></a>00946         <span class="keywordflow">if</span> (skyalign) {
-<a name="l00947"></a>00947             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l00948"></a>00948             <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);
-<a name="l00949"></a>00949         }
-<a name="l00950"></a>00950         <span class="keywordflow">else</span> {
-<a name="l00951"></a>00951             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span>
-<a name="l00952"></a>00952             <span class="stringliteral">"skylines applying median offset..."</span>);
-<a name="l00953"></a>00953         }
-<a name="l00954"></a>00954 
-<a name="l00955"></a>00955         <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00956"></a>00956             offsets = <a class="code" href="group__moses.html#g2523d130beaf8538187729f767c38805">mos_wavelength_align_lss</a>(smapped, reference, 
-<a name="l00957"></a>00957                                                startwavelength, endwavelength, 
-<a name="l00958"></a>00958                                                idscoeff, lines, highres, 
-<a name="l00959"></a>00959                                                skyalign, rainbow, 4);
-<a name="l00960"></a>00960         }
-<a name="l00961"></a>00961         <span class="keywordflow">else</span> {
-<a name="l00962"></a>00962             offsets = <a class="code" href="group__moses.html#gc4557c40d2f1ff46784fdb61c8ee67e3">mos_wavelength_align</a>(smapped, slits, reference, 
-<a name="l00963"></a>00963                                            startwavelength, endwavelength, 
-<a name="l00964"></a>00964                                            idscoeff, lines, highres, skyalign, 
-<a name="l00965"></a>00965                                            rainbow, 4);
-<a name="l00966"></a>00966         }
-<a name="l00967"></a>00967 
-<a name="l00968"></a>00968         cpl_vector_delete(lines); lines = NULL;
-<a name="l00969"></a>00969 
-<a name="l00970"></a>00970         <span class="keywordflow">if</span> (offsets) {
-<a name="l00971"></a>00971             <span class="keywordflow">if</span> (standard)
-<a name="l00972"></a>00972                 cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span>
-<a name="l00973"></a>00973                                 <span class="stringliteral">"to reference sky lines may be unreliable in "</span>
-<a name="l00974"></a>00974                                 <span class="stringliteral">"this case!"</span>);
-<a name="l00975"></a>00975 
-<a name="l00976"></a>00976             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, offsets, skylines_offsets_tag, NULL, 
-<a name="l00977"></a>00977                                parlist, recipe, version))
-<a name="l00978"></a>00978                 vimos_science_exit(NULL);
-<a name="l00979"></a>00979 
-<a name="l00980"></a>00980             cpl_table_delete(offsets); offsets = NULL;
-<a name="l00981"></a>00981         }
-<a name="l00982"></a>00982         <span class="keywordflow">else</span> {
-<a name="l00983"></a>00983             cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span>
-<a name="l00984"></a>00984                             <span class="stringliteral">"to reference sky lines could not be done!"</span>);
-<a name="l00985"></a>00985             skyalign = -1;
-<a name="l00986"></a>00986         }
-<a name="l00987"></a>00987 
-<a name="l00988"></a>00988     }
-<a name="l00989"></a>00989 
-<a name="l00990"></a>00990     <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l00991"></a>00991         wavemap = rainbow;
-<a name="l00992"></a>00992         rainbow = NULL;
-<a name="l00993"></a>00993     }
-<a name="l00994"></a>00994     <span class="keywordflow">else</span> {
-<a name="l00995"></a>00995         wavemap = <a class="code" href="group__moses.html#g7d8ae7b25a9d34a5af7255835e95ab90">mos_map_wavelengths</a>(coordinate, rainbow, slits, 
-<a name="l00996"></a>00996                                       polytraces, reference, 
-<a name="l00997"></a>00997                                       startwavelength, endwavelength,
-<a name="l00998"></a>00998                                       dispersion);
-<a name="l00999"></a>00999     }
-<a name="l01000"></a>01000 
-<a name="l01001"></a>01001     cpl_image_delete(rainbow); rainbow = NULL;
-<a name="l01002"></a>01002     cpl_image_delete(coordinate); coordinate = NULL;
-<a name="l01003"></a>01003 
-<a name="l01004"></a>01004     <span class="comment">/*</span>
-<a name="l01005"></a>01005 <span class="comment">     * Here the wavelength calibrated slit spectra are created. This frame</span>
-<a name="l01006"></a>01006 <span class="comment">     * contains sky_science.</span>
-<a name="l01007"></a>01007 <span class="comment">     */</span>
-<a name="l01008"></a>01008 
-<a name="l01009"></a>01009     mapped_sky = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, reference,
-<a name="l01010"></a>01010                                             startwavelength, endwavelength,
-<a name="l01011"></a>01011                                             dispersion, idscoeff, flux);
-<a name="l01012"></a>01012 
-<a name="l01013"></a>01013     cpl_msg_indent_less();
-<a name="l01014"></a>01014     cpl_msg_info(recipe, <span class="stringliteral">"Check applied wavelength against skylines..."</span>);
-<a name="l01015"></a>01015     cpl_msg_indent_more();
-<a name="l01016"></a>01016 
-<a name="l01017"></a>01017     mean_rms = <a class="code" href="group__moses.html#g8b5755fb4323c36b5aea3b4039e3d987">mos_distortions_rms</a>(mapped_sky, NULL, startwavelength,
-<a name="l01018"></a>01018                                    dispersion, 6, highres);
-<a name="l01019"></a>01019 
-<a name="l01020"></a>01020     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f"</span>, mean_rms);
-<a name="l01021"></a>01021 
-<a name="l01022"></a>01022     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);
-<a name="l01023"></a>01023 
-<a name="l01024"></a>01024     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,
-<a name="l01025"></a>01025                  mean_rms, mean_rms * dispersion);
-<a name="l01026"></a>01026 
-<a name="l01027"></a>01027     header = cpl_propertylist_new();
-<a name="l01028"></a>01028     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);
-<a name="l01029"></a>01029     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);
-<a name="l01030"></a>01030     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, 
-<a name="l01031"></a>01031                                    startwavelength + dispersion/2);
-<a name="l01032"></a>01032     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);
-<a name="l01033"></a>01033     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span>
-<a name="l01034"></a>01034 <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span>
-<a name="l01035"></a>01035     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);
-<a name="l01036"></a>01036     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);
-<a name="l01037"></a>01037     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);
-<a name="l01038"></a>01038     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);
-<a name="l01039"></a>01039     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);
-<a name="l01040"></a>01040     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);
-<a name="l01041"></a>01041 
-<a name="l01042"></a>01042     <span class="keywordflow">if</span> (time_normalise) {
-<a name="l01043"></a>01043         dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);
-<a name="l01044"></a>01044         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, dummy, mapped_science_sky_tag, header, 
-<a name="l01045"></a>01045                            parlist, recipe, version))
-<a name="l01046"></a>01046             vimos_science_exit(NULL);
-<a name="l01047"></a>01047         cpl_image_delete(dummy); dummy = NULL;
-<a name="l01048"></a>01048     }
-<a name="l01049"></a>01049     <span class="keywordflow">else</span> {
-<a name="l01050"></a>01050         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped_sky, mapped_science_sky_tag, 
-<a name="l01051"></a>01051                            header, parlist, recipe, version))
-<a name="l01052"></a>01052             vimos_science_exit(NULL);
-<a name="l01053"></a>01053     }
-<a name="l01054"></a>01054 
-<a name="l01055"></a>01055     <span class="keywordflow">if</span> (skyglobal == 0 && skymedian == 0 && skylocal == 0) {
-<a name="l01056"></a>01056         cpl_image_delete(mapped_sky); mapped_sky = NULL;
-<a name="l01057"></a>01057     }
-<a name="l01058"></a>01058 
-<a name="l01059"></a>01059     <span class="keywordflow">if</span> (skyglobal || skylocal) {
-<a name="l01060"></a>01060 
-<a name="l01061"></a>01061         cpl_msg_indent_less();
-<a name="l01062"></a>01062 
-<a name="l01063"></a>01063         <span class="keywordflow">if</span> (skyglobal) {
-<a name="l01064"></a>01064             cpl_msg_info(recipe, <span class="stringliteral">"Global sky determination..."</span>);
-<a name="l01065"></a>01065             cpl_msg_indent_more();
-<a name="l01066"></a>01066             skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-<a name="l01067"></a>01067             sky = <a class="code" href="group__moses.html#gdc24afa605f14e0bbd66884de984a1f1">mos_sky_map_super</a>(spectra, wavemap, dispersion, 
-<a name="l01068"></a>01068                                     2.0, 50, skymap);
-<a name="l01069"></a>01069             <span class="keywordflow">if</span> (sky)
-<a name="l01070"></a>01070                 cpl_image_subtract(spectra, skymap);
-<a name="l01071"></a>01071             <span class="keywordflow">else</span>
-<a name="l01072"></a>01072                 cpl_image_delete(skymap); skymap = NULL;
-<a name="l01073"></a>01073         }
-<a name="l01074"></a>01074         <span class="keywordflow">else</span> {
-<a name="l01075"></a>01075             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l01076"></a>01076             cpl_msg_indent_more();
-<a name="l01077"></a>01077             skymap = <a class="code" href="group__moses.html#ga2fbacfe291c17a66ab6a299afc9265f">mos_subtract_sky</a>(spectra, slits, polytraces, reference,
-<a name="l01078"></a>01078                            startwavelength, endwavelength, dispersion);
-<a name="l01079"></a>01079         }
-<a name="l01080"></a>01080 
-<a name="l01081"></a>01081         <span class="keywordflow">if</span> (skymap) {
-<a name="l01082"></a>01082             <span class="keywordflow">if</span> (skyglobal) {
-<a name="l01083"></a>01083                 <span class="keywordflow">if</span> (time_normalise)
-<a name="l01084"></a>01084                     cpl_table_divide_scalar(sky, <span class="stringliteral">"sky"</span>, alltime);
-<a name="l01085"></a>01085                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, sky, global_sky_spectrum_tag, 
-<a name="l01086"></a>01086                                    NULL, parlist, recipe, version))
-<a name="l01087"></a>01087                     vimos_science_exit(NULL);
-<a name="l01088"></a>01088     
-<a name="l01089"></a>01089                 cpl_table_delete(sky); sky = NULL;
-<a name="l01090"></a>01090             }
-<a name="l01091"></a>01091 
-<a name="l01092"></a>01092             save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01093"></a>01093 
-<a name="l01094"></a>01094             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01095"></a>01095                 cpl_image_divide_scalar(skymap, alltime);
-<a name="l01096"></a>01096             cpl_image_turn(skymap, rotate_back);
-<a name="l01097"></a>01097             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, skymap, unmapped_sky_tag,
-<a name="l01098"></a>01098                                save_header, parlist, recipe, version))
-<a name="l01099"></a>01099                 vimos_science_exit(NULL);
-<a name="l01100"></a>01100 
-<a name="l01101"></a>01101             cpl_image_delete(skymap); skymap = NULL;
-<a name="l01102"></a>01102 
-<a name="l01103"></a>01103             cpl_image_turn(spectra, rotate_back);
-<a name="l01104"></a>01104 
-<a name="l01105"></a>01105             <span class="keywordflow">if</span> (cosmics) {
-<a name="l01106"></a>01106                 cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);
-<a name="l01107"></a>01107                 <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(spectra, gain, -1., -1.);
-<a name="l01108"></a>01108             }
-<a name="l01109"></a>01109 
-<a name="l01110"></a>01110             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, spectra, unmapped_science_tag,
-<a name="l01111"></a>01111                                save_header, parlist, recipe, version))
-<a name="l01112"></a>01112                 vimos_science_exit(NULL);
-<a name="l01113"></a>01113             cpl_image_turn(spectra, rotate);
-<a name="l01114"></a>01114 
-<a name="l01115"></a>01115             cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01116"></a>01116 <span class="comment">/* Cosmics was here */</span>
-<a name="l01117"></a>01117             <span class="comment">/*</span>
-<a name="l01118"></a>01118 <span class="comment">             * The spatially rectified image, that contained the sky,</span>
-<a name="l01119"></a>01119 <span class="comment">             * is replaced by a sky-subtracted spatially rectified image:</span>
-<a name="l01120"></a>01120 <span class="comment">             */</span>
-<a name="l01121"></a>01121 
-<a name="l01122"></a>01122             cpl_image_delete(smapped); smapped = NULL;
-<a name="l01123"></a>01123 
-<a name="l01124"></a>01124             <span class="keywordflow">if</span> (treat_as_lss) {
-<a name="l01125"></a>01125                 smapped = cpl_image_duplicate(spectra);
-<a name="l01126"></a>01126             }
-<a name="l01127"></a>01127             <span class="keywordflow">else</span> {
-<a name="l01128"></a>01128                 smapped = <a class="code" href="group__moses.html#g97cde563aea50318b61faf6c9355bdbe">mos_spatial_calibration</a>(spectra, slits, polytraces, 
-<a name="l01129"></a>01129                                                   reference, startwavelength, 
-<a name="l01130"></a>01130                                                   endwavelength, dispersion, 
-<a name="l01131"></a>01131                                                   flux, NULL);
-<a name="l01132"></a>01132             }
-<a name="l01133"></a>01133         }
-<a name="l01134"></a>01134         <span class="keywordflow">else</span> {
-<a name="l01135"></a>01135             cpl_msg_warning(recipe, <span class="stringliteral">"Sky subtraction failure"</span>);
-<a name="l01136"></a>01136             <span class="keywordflow">if</span> (cosmics)
-<a name="l01137"></a>01137                 cpl_msg_warning(recipe, <span class="stringliteral">"Cosmic rays removal not performed!"</span>);
-<a name="l01138"></a>01138             cosmics = skylocal = skyglobal = 0;
-<a name="l01139"></a>01139         }
-<a name="l01140"></a>01140     }
-<a name="l01141"></a>01141 
-<a name="l01142"></a>01142     cpl_image_delete(spectra); spectra = NULL;
-<a name="l01143"></a>01143     cpl_table_delete(polytraces); polytraces = NULL;
-<a name="l01144"></a>01144 
-<a name="l01145"></a>01145     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01146"></a>01146         save_header = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01147"></a>01147         cpl_image_turn(wavemap, rotate_back);
-<a name="l01148"></a>01148         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, wavemap, wavelength_map_sky_tag,
-<a name="l01149"></a>01149                            save_header, parlist, recipe, version))
-<a name="l01150"></a>01150             vimos_science_exit(NULL);
-<a name="l01151"></a>01151         cpl_propertylist_delete(save_header); save_header = NULL;
-<a name="l01152"></a>01152     }
-<a name="l01153"></a>01153 
-<a name="l01154"></a>01154     cpl_image_delete(wavemap); wavemap = NULL;
-<a name="l01155"></a>01155 
-<a name="l01156"></a>01156     mapped = <a class="code" href="group__moses.html#gb2cc63c200bab0a922efde3d20192443">mos_wavelength_calibration</a>(smapped, reference,
-<a name="l01157"></a>01157                                         startwavelength, endwavelength,
-<a name="l01158"></a>01158                                         dispersion, idscoeff, flux);
-<a name="l01159"></a>01159 
-<a name="l01160"></a>01160     cpl_image_delete(smapped); smapped = NULL;
-<a name="l01161"></a>01161 
-<a name="l01162"></a>01162     <span class="keywordflow">if</span> (skymedian) {
-<a name="l01163"></a>01163         cpl_msg_indent_less();
-<a name="l01164"></a>01164         cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);
-<a name="l01165"></a>01165         cpl_msg_indent_more();
-<a name="l01166"></a>01166     
-<a name="l01167"></a>01167         skylocalmap = <a class="code" href="group__moses.html#gd9e2f1aa21dd9dc492c74052ea0a560a">mos_sky_local_old</a>(mapped, slits);       
-<a name="l01168"></a>01168         cpl_image_subtract(mapped, skylocalmap);
-<a name="l01169"></a>01169         cpl_image_delete(skylocalmap); skylocalmap = NULL;
-<a name="l01170"></a>01170     }
-<a name="l01171"></a>01171 
-<a name="l01172"></a>01172     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {
-<a name="l01173"></a>01173 
-<a name="l01174"></a>01174         skylocalmap = cpl_image_subtract_create(mapped_sky, mapped);
-<a name="l01175"></a>01175 
-<a name="l01176"></a>01176         cpl_image_delete(mapped_sky); mapped_sky = NULL;
-<a name="l01177"></a>01177 
-<a name="l01178"></a>01178         <span class="keywordflow">if</span> (time_normalise) {
-<a name="l01179"></a>01179             dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);
-<a name="l01180"></a>01180             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, dummy, mapped_sky_tag, header,
-<a name="l01181"></a>01181                                parlist, recipe, version))
-<a name="l01182"></a>01182                 vimos_science_exit(NULL);
-<a name="l01183"></a>01183             cpl_image_delete(dummy); dummy = NULL;
-<a name="l01184"></a>01184         }
-<a name="l01185"></a>01185         <span class="keywordflow">else</span> {
-<a name="l01186"></a>01186             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, skylocalmap, mapped_sky_tag, header,
-<a name="l01187"></a>01187                                parlist, recipe, version))
-<a name="l01188"></a>01188                 vimos_science_exit(NULL);
-<a name="l01189"></a>01189         }
-<a name="l01190"></a>01190 
-<a name="l01191"></a>01191         cpl_msg_indent_less();
-<a name="l01192"></a>01192         cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);
-<a name="l01193"></a>01193         cpl_msg_indent_more();
-<a name="l01194"></a>01194 
-<a name="l01195"></a>01195         <span class="keywordflow">if</span> (cosmics || nscience > 1) {
-<a name="l01196"></a>01196             dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped, slits, slit_margin, ext_radius, 
-<a name="l01197"></a>01197                                        cont_radius);
-<a name="l01198"></a>01198         }
-<a name="l01199"></a>01199         <span class="keywordflow">else</span> {
-<a name="l01200"></a>01200             mapped_cleaned = cpl_image_duplicate(mapped);
-<a name="l01201"></a>01201             <a class="code" href="group__moses.html#g274cdc673e0d1684d9a730773a526115">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);
-<a name="l01202"></a>01202             dummy = <a class="code" href="group__moses.html#gb188299284e0b06070798cd2e80427af">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin, 
-<a name="l01203"></a>01203                                        ext_radius, cont_radius);
-<a name="l01204"></a>01204 
-<a name="l01205"></a>01205             cpl_image_delete(mapped_cleaned); mapped_cleaned = NULL;
-<a name="l01206"></a>01206         }
-<a name="l01207"></a>01207 
-<a name="l01208"></a>01208         cpl_image_delete(dummy); dummy = NULL;
-<a name="l01209"></a>01209 
-<a name="l01210"></a>01210         <a class="code" href="group__moses.html#ge119e728dd0161fc46fea905861425c1">mos_rotate_slits</a>(slits, rotate, ny, nx);
-<a name="l01211"></a>01211         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, slits, object_table_tag, NULL, parlist, 
-<a name="l01212"></a>01212                            recipe, version))
-<a name="l01213"></a>01213             vimos_science_exit(NULL);
-<a name="l01214"></a>01214 
-<a name="l01215"></a>01215         cpl_msg_indent_less();
-<a name="l01216"></a>01216         cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);
-<a name="l01217"></a>01217         cpl_msg_indent_more();
-<a name="l01218"></a>01218 
-<a name="l01219"></a>01219         images = <a class="code" href="group__moses.html#geecf611c458a0b9645edad66538ad6e2">mos_extract_objects</a>(mapped, skylocalmap, slits, 
-<a name="l01220"></a>01220                                      ext_mode, ron, gain, 1);
-<a name="l01221"></a>01221 
-<a name="l01222"></a>01222         cpl_image_delete(skylocalmap); skylocalmap = NULL;
-<a name="l01223"></a>01223 
-<a name="l01224"></a>01224         <span class="keywordflow">if</span> (images) {
-<a name="l01225"></a>01225             <span class="keywordflow">if</span> (standard) {
-<a name="l01226"></a>01226                 cpl_table *photcal    = NULL;
-<a name="l01227"></a>01227                 cpl_table *ext_table  = NULL;
-<a name="l01228"></a>01228                 cpl_table *flux_table = NULL;
-<a name="l01229"></a>01229 
-<a name="l01230"></a>01230                 ext_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>, 1);
-<a name="l01231"></a>01231                 flux_table = <a class="code" href="group__forsdfs.html#g1c15a2052dc4b7f916eff93271aeb27a">dfs_load_table</a>(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>, 1);
-<a name="l01232"></a>01232 
-<a name="l01233"></a>01233                 photcal = <a class="code" href="group__moses.html#gf3dd5a20a5f31b853c53ca419a8171e3">mos_photometric_calibration</a>(images[0],
-<a name="l01234"></a>01234                                                       startwavelength,
-<a name="l01235"></a>01235                                                       dispersion, gain,
-<a name="l01236"></a>01236                                                       alltime, ext_table,
-<a name="l01237"></a>01237                                                       airmass, flux_table,
-<a name="l01238"></a>01238                                                       res_order);
-<a name="l01239"></a>01239 
-<a name="l01240"></a>01240                 cpl_table_delete(ext_table);
-<a name="l01241"></a>01241                 cpl_table_delete(flux_table);
-<a name="l01242"></a>01242 
-<a name="l01243"></a>01243                 <span class="keywordflow">if</span> (photcal) {
-<a name="l01244"></a>01244 
-<a name="l01245"></a>01245                     <span class="keywordflow">if</span> (qc) {
-<a name="l01246"></a>01246 
-<a name="l01247"></a>01247                         <span class="keywordtype">float</span> *data;
-<a name="l01248"></a>01248                         <span class="keywordtype">char</span>  *pipefile = NULL;
-<a name="l01249"></a>01249                         <span class="keywordtype">char</span>   keyname[30];
-<a name="l01250"></a>01250 
-<a name="l01251"></a>01251                         qclist = <a class="code" href="group__forsdfs.html#g9774126e0acba5d1bf25bda41a4fb794">dfs_load_header</a>(frameset, science_tag, 0);
-<a name="l01252"></a>01252 
-<a name="l01253"></a>01253                         <span class="keywordflow">if</span> (qclist == NULL)
-<a name="l01254"></a>01254                             vimos_science_exit(<span class="stringliteral">"Cannot reload scientific "</span>
-<a name="l01255"></a>01255                                                <span class="stringliteral">"frame header"</span>);
-<a name="l01256"></a>01256 
-<a name="l01257"></a>01257                         <a class="code" href="group__forsqc.html#g09a7618d5c3bb5bac853d56e30c2dc8b">fors_qc_start_group</a>(qclist, <span class="stringliteral">"2.0"</span>, instrume);
-<a name="l01258"></a>01258 
-<a name="l01259"></a>01259 
-<a name="l01260"></a>01260                         <span class="comment">/*</span>
-<a name="l01261"></a>01261 <span class="comment">                         * QC1 group header</span>
-<a name="l01262"></a>01262 <span class="comment">                         */</span>
-<a name="l01263"></a>01263 
-<a name="l01264"></a>01264                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, specphot_tag,
-<a name="l01265"></a>01265                                                  <span class="stringliteral">"Product category"</span>, instrume))
-<a name="l01266"></a>01266                             vimos_science_exit(<span class="stringliteral">"Cannot write product category "</span>
-<a name="l01267"></a>01267                                                <span class="stringliteral">"to QC log file"</span>);
-<a name="l01268"></a>01268 
-<a name="l01269"></a>01269                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,
-<a name="l01270"></a>01270                                                    <span class="stringliteral">"DPR type"</span>, instrume))
-<a name="l01271"></a>01271                             vimos_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span>
-<a name="l01272"></a>01272                                                <span class="stringliteral">"scientific frame header"</span>);
-<a name="l01273"></a>01273 
-<a name="l01274"></a>01274                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ESO TPL ID"</span>, NULL,
-<a name="l01275"></a>01275                                                    <span class="stringliteral">"Template"</span>, instrume))
-<a name="l01276"></a>01276                             vimos_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span>
-<a name="l01277"></a>01277                                                <span class="stringliteral">"scientific frame header"</span>);
-<a name="l01278"></a>01278 
-<a name="l01279"></a>01279                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist,
-<a name="l01280"></a>01280                                                    key_gris_name, NULL,
-<a name="l01281"></a>01281                                                    <span class="stringliteral">"Grism name"</span>, instrume)) {
-<a name="l01282"></a>01282                             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in "</span>
-<a name="l01283"></a>01283                                           <span class="stringliteral">"scientific frame header"</span>, 
-<a name="l01284"></a>01284                                           key_gris_name);
-<a name="l01285"></a>01285                             vimos_science_exit(NULL);
-<a name="l01286"></a>01286                         }
-<a name="l01287"></a>01287 
-<a name="l01288"></a>01288                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist,
-<a name="l01289"></a>01289                                                    <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,
-<a name="l01290"></a>01290                                                    <span class="stringliteral">"Grism identifier"</span>,
-<a name="l01291"></a>01291                                                    instrume)) {
-<a name="l01292"></a>01292                             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in "</span>
-<a name="l01293"></a>01293                                           <span class="stringliteral">"scientific frame header"</span>, 
-<a name="l01294"></a>01294                                           key_gris_id);
-<a name="l01295"></a>01295                             vimos_science_exit(NULL);
-<a name="l01296"></a>01296                         }
-<a name="l01297"></a>01297 
-<a name="l01298"></a>01298                         <span class="keywordflow">if</span> (cpl_propertylist_has(qclist, key_filt_name))
-<a name="l01299"></a>01299                             <a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, key_filt_name, NULL,
-<a name="l01300"></a>01300                                                    <span class="stringliteral">"Filter name"</span>, instrume);
-<a name="l01301"></a>01301 
-<a name="l01302"></a>01302                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist,
-<a name="l01303"></a>01303                                                    <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,
-<a name="l01304"></a>01304                                                    <span class="stringliteral">"Chip identifier"</span>,
-<a name="l01305"></a>01305                                                    instrume))
-<a name="l01306"></a>01306                             vimos_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID "</span>
-<a name="l01307"></a>01307                                                <span class="stringliteral">"in scientific frame header"</span>);
-<a name="l01308"></a>01308 
-<a name="l01309"></a>01309                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g44d5359f81302747fff155c168c88200">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ARCFILE"</span>, NULL,
-<a name="l01310"></a>01310                                                    <span class="stringliteral">"Archive name of input data"</span>,
-<a name="l01311"></a>01311                                                    instrume))
-<a name="l01312"></a>01312                             vimos_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span>
-<a name="l01313"></a>01313                                                <span class="stringliteral">"scientific frame header"</span>);
-<a name="l01314"></a>01314 
-<a name="l01315"></a>01315                         pipefile = <a class="code" href="group__forsdfs.html#gac5e297d5e45e2ae86075dee586cf8d9">dfs_generate_filename_tfits</a>(specphot_tag);
-<a name="l01316"></a>01316 
-<a name="l01317"></a>01317                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#gbf9d98b1564188b3aeaf0ea64c60bfb4">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,
-<a name="l01318"></a>01318                                                  <span class="stringliteral">"Pipeline product name"</span>,
-<a name="l01319"></a>01319                                                  instrume))
-<a name="l01320"></a>01320                             vimos_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span>
-<a name="l01321"></a>01321                                                <span class="stringliteral">"QC log file"</span>);
-<a name="l01322"></a>01322                         cpl_free(pipefile);
-<a name="l01323"></a>01323 
-<a name="l01324"></a>01324 
-<a name="l01325"></a>01325                         <span class="comment">/*</span>
-<a name="l01326"></a>01326 <span class="comment">                         * QC1 parameters</span>
-<a name="l01327"></a>01327 <span class="comment">                         */</span>
-<a name="l01328"></a>01328 
-<a name="l01329"></a>01329                         wstart = 3700.;
-<a name="l01330"></a>01330                         wstep  = 400.;
-<a name="l01331"></a>01331                         wcount = 15;
-<a name="l01332"></a>01332 
-<a name="l01333"></a>01333                         dummy = cpl_image_new(wcount, 1, CPL_TYPE_FLOAT);
-<a name="l01334"></a>01334                         data = cpl_image_get_data_float(dummy);
-<a name="l01335"></a>01335                         <a class="code" href="group__moses.html#gc4e4cf26f6fc9b4800eaa7cd9cc0508e">map_table</a>(dummy, wstart, wstep, photcal,
-<a name="l01336"></a>01336                                   <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"EFFICIENCY"</span>);
-<a name="l01337"></a>01337 
-<a name="l01338"></a>01338                         <span class="keywordflow">for</span> (i = 0; i < wcount; i++) {
-<a name="l01339"></a>01339                             sprintf(keyname, <span class="stringliteral">"QC.MOS.EFFICIENCY%d.LAMBDA"</span>,
-<a name="l01340"></a>01340                                     i + 1);
-<a name="l01341"></a>01341                             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qclist,
-<a name="l01342"></a>01342                                                         wstart + wstep * i,
-<a name="l01343"></a>01343                                                         keyname, <span class="stringliteral">"Angstrom"</span>,
-<a name="l01344"></a>01344                                                         <span class="stringliteral">"Wavelength of "</span>
-<a name="l01345"></a>01345                                                         <span class="stringliteral">"efficiency evaluation"</span>,
-<a name="l01346"></a>01346                                                         instrume)) {
-<a name="l01347"></a>01347                                 vimos_science_exit(<span class="stringliteral">"Cannot write wavelength of "</span>
-<a name="l01348"></a>01348                                                    <span class="stringliteral">"efficiency evaluation"</span>);
-<a name="l01349"></a>01349                             }
-<a name="l01350"></a>01350 
-<a name="l01351"></a>01351                             sprintf(keyname, <span class="stringliteral">"QC.MOS.EFFICIENCY%d"</span>, i + 1);
-<a name="l01352"></a>01352                             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#g11cc764a5c68308a0a85432d5bb30b38">fors_qc_write_qc_double</a>(qclist,
-<a name="l01353"></a>01353                                                         data[i],
-<a name="l01354"></a>01354                                                         keyname, <span class="stringliteral">"e-/photon"</span>,
-<a name="l01355"></a>01355                                                         <span class="stringliteral">"Efficiency"</span>,
-<a name="l01356"></a>01356                                                         instrume)) {
-<a name="l01357"></a>01357                                 vimos_science_exit(<span class="stringliteral">"Cannot write wavelength of "</span>
-<a name="l01358"></a>01358                                                    <span class="stringliteral">"efficiency evaluation"</span>);
-<a name="l01359"></a>01359                             }
-<a name="l01360"></a>01360                         }
-<a name="l01361"></a>01361 
-<a name="l01362"></a>01362                         cpl_image_delete(dummy); dummy = NULL;
-<a name="l01363"></a>01363 
-<a name="l01364"></a>01364                         <a class="code" href="group__forsqc.html#g09e2a2672daa14e29aaa138cb4ca8f03">fors_qc_end_group</a>();
-<a name="l01365"></a>01365 
-<a name="l01366"></a>01366                     }  <span class="comment">/* End of QC1 computation */</span>
-<a name="l01367"></a>01367 
-<a name="l01368"></a>01368                     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, photcal, specphot_tag, qclist,
-<a name="l01369"></a>01369                                        parlist, recipe, version)) {
-<a name="l01370"></a>01370                         cpl_table_delete(photcal);
-<a name="l01371"></a>01371                         vimos_science_exit(NULL);
-<a name="l01372"></a>01372                     }
-<a name="l01373"></a>01373                     cpl_propertylist_delete(qclist); qclist = NULL;
-<a name="l01374"></a>01374                     cpl_table_delete(photcal);
-<a name="l01375"></a>01375                 }
-<a name="l01376"></a>01376             }
-<a name="l01377"></a>01377 
-<a name="l01378"></a>01378             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01379"></a>01379                 cpl_image_divide_scalar(images[0], alltime);
-<a name="l01380"></a>01380 
-<a name="l01381"></a>01381             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[0], reduced_science_tag, header,
-<a name="l01382"></a>01382                                parlist, recipe, version))
-<a name="l01383"></a>01383                 vimos_science_exit(NULL);
-<a name="l01384"></a>01384 
-<a name="l01385"></a>01385             cpl_image_delete(images[0]);
-<a name="l01386"></a>01386     
-<a name="l01387"></a>01387             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01388"></a>01388                 cpl_image_divide_scalar(images[1], alltime);
-<a name="l01389"></a>01389 
-<a name="l01390"></a>01390             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[1], reduced_sky_tag, header,
-<a name="l01391"></a>01391                                parlist, recipe, version))
-<a name="l01392"></a>01392                 vimos_science_exit(NULL);
-<a name="l01393"></a>01393 
-<a name="l01394"></a>01394             cpl_image_delete(images[1]);
-<a name="l01395"></a>01395     
-<a name="l01396"></a>01396             <span class="keywordflow">if</span> (time_normalise)
-<a name="l01397"></a>01397                 cpl_image_divide_scalar(images[2], alltime);
-<a name="l01398"></a>01398 
-<a name="l01399"></a>01399             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, images[2], reduced_error_tag, header,
-<a name="l01400"></a>01400                                parlist, recipe, version))
-<a name="l01401"></a>01401                 vimos_science_exit(NULL);
-<a name="l01402"></a>01402 
-<a name="l01403"></a>01403             cpl_image_delete(images[2]);
-<a name="l01404"></a>01404 
-<a name="l01405"></a>01405             cpl_free(images);
-<a name="l01406"></a>01406         }
-<a name="l01407"></a>01407         <span class="keywordflow">else</span> {
-<a name="l01408"></a>01408             cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span>
-<a name="l01409"></a>01409                             <span class="stringliteral">"%s, %s, and %s are not created"</span>, 
-<a name="l01410"></a>01410                             reduced_science_tag, reduced_sky_tag, 
-<a name="l01411"></a>01411                             reduced_error_tag);
-<a name="l01412"></a>01412         }
-<a name="l01413"></a>01413 
-<a name="l01414"></a>01414     }
-<a name="l01415"></a>01415 
-<a name="l01416"></a>01416     cpl_table_delete(slits); slits = NULL;
-<a name="l01417"></a>01417 
-<a name="l01418"></a>01418     <span class="keywordflow">if</span> (skyalign >= 0) {
-<a name="l01419"></a>01419         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gd3653f59add0d28a7f53ac0ccffb2616">dfs_save_table</a>(frameset, idscoeff, disp_coeff_sky_tag, NULL, 
-<a name="l01420"></a>01420                            parlist, recipe, version))
-<a name="l01421"></a>01421             vimos_science_exit(NULL);
-<a name="l01422"></a>01422     }
-<a name="l01423"></a>01423 
-<a name="l01424"></a>01424     cpl_table_delete(idscoeff); idscoeff = NULL;
-<a name="l01425"></a>01425 
-<a name="l01426"></a>01426     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {
-<a name="l01427"></a>01427         <span class="keywordflow">if</span> (time_normalise)
-<a name="l01428"></a>01428             cpl_image_divide_scalar(mapped, alltime);
-<a name="l01429"></a>01429         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#g670873281aac860fb32cce7ef99d3465">dfs_save_image</a>(frameset, mapped, mapped_science_tag, header, 
-<a name="l01430"></a>01430                            parlist, recipe, version))
-<a name="l01431"></a>01431             vimos_science_exit(NULL);
-<a name="l01432"></a>01432     }
-<a name="l01433"></a>01433 
-<a name="l01434"></a>01434     cpl_image_delete(mapped); mapped = NULL;
-<a name="l01435"></a>01435     cpl_propertylist_delete(header); header = NULL;
-<a name="l01436"></a>01436 
-<a name="l01437"></a>01437     <span class="keywordflow">if</span> (cpl_error_get_code()) {
-<a name="l01438"></a>01438         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
-<a name="l01439"></a>01439         vimos_science_exit(NULL);
-<a name="l01440"></a>01440     }
-<a name="l01441"></a>01441     <span class="keywordflow">else</span> 
-<a name="l01442"></a>01442         <span class="keywordflow">return</span> 0;
-<a name="l01443"></a>01443 }
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/vimos__science__impl_8c_source.html b/html/vimos__science__impl_8c_source.html
new file mode 100644
index 0000000..792df53
--- /dev/null
+++ b/html/vimos__science__impl_8c_source.html
@@ -0,0 +1,1498 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: vimos_science_impl.c Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">vimos_science_impl.c</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: vimos_science_impl.c,v 1.4 2013-04-24 14:17:05 cgarcia Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Data Reduction Pipeline</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cgarcia $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2013-04-24 14:17:05 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.4 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#include <config.h></span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> <span class="preprocessor">#include <vimos_science_impl.h></span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> </div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> <span class="preprocessor">#include <math.h></span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> <span class="preprocessor">#include <moses.h></span></div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> <span class="preprocessor">#include <fors_tools.h></span></div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> <span class="preprocessor">#include <fors_dfs.h></span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#include <fors_qc.h></span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span> </div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span> <span class="preprocessor">#define vimos_science_exit(message)           \</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno">   42</span> <span class="preprocessor">{                                             \</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span> <span class="preprocessor">if (message) cpl_msg_error(recipe, message);  \</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span> <span class="preprocessor">cpl_free(exptime);                            \</span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span> <span class="preprocessor">cpl_image_delete(dummy);                      \</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno">   46</span> <span class="preprocessor">cpl_image_delete(mapped);                     \</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span> <span class="preprocessor">cpl_image_delete(mapped_sky);                 \</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span> <span class="preprocessor">cpl_image_delete(mapped_cleaned);             \</span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span> <span class="preprocessor">cpl_image_delete(skylocalmap);                \</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno">   50</span> <span class="preprocessor">cpl_image_delete(skymap);                     \</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span> <span class="preprocessor">cpl_image_delete(smapped);                    \</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span> <span class="preprocessor">cpl_table_delete(offsets);                    \</span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span> <span class="preprocessor">cpl_table_delete(sky);                        \</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno">   54</span> <span class="preprocessor">cpl_image_delete(bias);                       \</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span> <span class="preprocessor">cpl_image_delete(spectra);                    \</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span> <span class="preprocessor">cpl_image_delete(coordinate);                 \</span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span> <span class="preprocessor">cpl_image_delete(norm_flat);                  \</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno">   58</span> <span class="preprocessor">cpl_image_delete(rainbow);                    \</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span> <span class="preprocessor">cpl_image_delete(rectified);                  \</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span> <span class="preprocessor">cpl_image_delete(wavemap);                    \</span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span> <span class="preprocessor">cpl_propertylist_delete(header);              \</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno">   62</span> <span class="preprocessor">cpl_propertylist_delete(save_header);         \</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span> <span class="preprocessor">cpl_table_delete(grism_table);                \</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span> <span class="preprocessor">cpl_table_delete(idscoeff);                   \</span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span> <span class="preprocessor">cpl_table_delete(maskslits);                  \</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span> <span class="preprocessor">cpl_table_delete(overscans);                  \</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno">   67</span> <span class="preprocessor">cpl_table_delete(polytraces);                 \</span></div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span> <span class="preprocessor">cpl_table_delete(slits);                      \</span></div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span> <span class="preprocessor">cpl_table_delete(wavelengths);                \</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span> <span class="preprocessor">cpl_vector_delete(lines);                     \</span></div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span> <span class="preprocessor">cpl_msg_indent_less();                        \</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span> <span class="preprocessor">return -1;                                    \</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span> <span class="preprocessor">}</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00081"></a><span class="lineno">   81</span> <span class="keywordtype">int</span> vimos_science_impl(cpl_frameset *frameset, cpl_parameterlist *parlist)</div>
+<div class="line"><a name="l00082"></a><span class="lineno">   82</span> {</div>
+<div class="line"><a name="l00083"></a><span class="lineno">   83</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *recipe = <span class="stringliteral">"vimos_science"</span>;</div>
+<div class="line"><a name="l00084"></a><span class="lineno">   84</span> </div>
+<div class="line"><a name="l00085"></a><span class="lineno">   85</span> </div>
+<div class="line"><a name="l00086"></a><span class="lineno">   86</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00087"></a><span class="lineno">   87</span> <span class="comment">     * Input parameters</span></div>
+<div class="line"><a name="l00088"></a><span class="lineno">   88</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00089"></a><span class="lineno">   89</span> </div>
+<div class="line"><a name="l00090"></a><span class="lineno">   90</span>     <span class="keywordtype">double</span>      dispersion;</div>
+<div class="line"><a name="l00091"></a><span class="lineno">   91</span>     <span class="keywordtype">int</span>         skyalign;</div>
+<div class="line"><a name="l00092"></a><span class="lineno">   92</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wcolumn;</div>
+<div class="line"><a name="l00093"></a><span class="lineno">   93</span>     <span class="keywordtype">double</span>      startwavelength;</div>
+<div class="line"><a name="l00094"></a><span class="lineno">   94</span>     <span class="keywordtype">double</span>      endwavelength;</div>
+<div class="line"><a name="l00095"></a><span class="lineno">   95</span>     <span class="keywordtype">double</span>      reference;</div>
+<div class="line"><a name="l00096"></a><span class="lineno">   96</span>     <span class="keywordtype">int</span>         flux;</div>
+<div class="line"><a name="l00097"></a><span class="lineno">   97</span>     <span class="keywordtype">int</span>         flatfield;</div>
+<div class="line"><a name="l00098"></a><span class="lineno">   98</span>     <span class="keywordtype">int</span>         skyglobal;</div>
+<div class="line"><a name="l00099"></a><span class="lineno">   99</span>     <span class="keywordtype">int</span>         skylocal;</div>
+<div class="line"><a name="l00100"></a><span class="lineno">  100</span>     <span class="keywordtype">int</span>         skymedian;</div>
+<div class="line"><a name="l00101"></a><span class="lineno">  101</span>     <span class="keywordtype">int</span>         cosmics;</div>
+<div class="line"><a name="l00102"></a><span class="lineno">  102</span>     <span class="keywordtype">int</span>         slit_margin;</div>
+<div class="line"><a name="l00103"></a><span class="lineno">  103</span>     <span class="keywordtype">int</span>         ext_radius;</div>
+<div class="line"><a name="l00104"></a><span class="lineno">  104</span>     <span class="keywordtype">int</span>         cont_radius;</div>
+<div class="line"><a name="l00105"></a><span class="lineno">  105</span>     <span class="keywordtype">int</span>         ext_mode;</div>
+<div class="line"><a name="l00106"></a><span class="lineno">  106</span>     <span class="keywordtype">int</span>         time_normalise;</div>
+<div class="line"><a name="l00107"></a><span class="lineno">  107</span>     <span class="keywordtype">int</span>         anyframe;</div>
+<div class="line"><a name="l00108"></a><span class="lineno">  108</span>     <span class="keywordtype">int</span>         res_order;</div>
+<div class="line"><a name="l00109"></a><span class="lineno">  109</span>     <span class="keywordtype">int</span>         qc;</div>
+<div class="line"><a name="l00110"></a><span class="lineno">  110</span> </div>
+<div class="line"><a name="l00111"></a><span class="lineno">  111</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00112"></a><span class="lineno">  112</span> <span class="comment">     * CPL objects</span></div>
+<div class="line"><a name="l00113"></a><span class="lineno">  113</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00114"></a><span class="lineno">  114</span> </div>
+<div class="line"><a name="l00115"></a><span class="lineno">  115</span>     cpl_imagelist    *all_science;</div>
+<div class="line"><a name="l00116"></a><span class="lineno">  116</span>     cpl_image       **images;</div>
+<div class="line"><a name="l00117"></a><span class="lineno">  117</span> </div>
+<div class="line"><a name="l00118"></a><span class="lineno">  118</span>     cpl_image        *bias           = NULL;</div>
+<div class="line"><a name="l00119"></a><span class="lineno">  119</span>     cpl_image        *norm_flat      = NULL;</div>
+<div class="line"><a name="l00120"></a><span class="lineno">  120</span>     cpl_image        *spectra        = NULL;</div>
+<div class="line"><a name="l00121"></a><span class="lineno">  121</span>     cpl_image        *rectified      = NULL;</div>
+<div class="line"><a name="l00122"></a><span class="lineno">  122</span>     cpl_image        *coordinate     = NULL;</div>
+<div class="line"><a name="l00123"></a><span class="lineno">  123</span>     cpl_image        *rainbow        = NULL;</div>
+<div class="line"><a name="l00124"></a><span class="lineno">  124</span>     cpl_image        *mapped         = NULL;</div>
+<div class="line"><a name="l00125"></a><span class="lineno">  125</span>     cpl_image        *mapped_sky     = NULL;</div>
+<div class="line"><a name="l00126"></a><span class="lineno">  126</span>     cpl_image        *mapped_cleaned = NULL;</div>
+<div class="line"><a name="l00127"></a><span class="lineno">  127</span>     cpl_image        *smapped        = NULL;</div>
+<div class="line"><a name="l00128"></a><span class="lineno">  128</span>     cpl_image        *wavemap        = NULL;</div>
+<div class="line"><a name="l00129"></a><span class="lineno">  129</span>     cpl_image        *skymap         = NULL;</div>
+<div class="line"><a name="l00130"></a><span class="lineno">  130</span>     cpl_image        *skylocalmap    = NULL;</div>
+<div class="line"><a name="l00131"></a><span class="lineno">  131</span>     cpl_image        *dummy          = NULL;</div>
+<div class="line"><a name="l00132"></a><span class="lineno">  132</span> </div>
+<div class="line"><a name="l00133"></a><span class="lineno">  133</span>     cpl_table        *grism_table    = NULL;</div>
+<div class="line"><a name="l00134"></a><span class="lineno">  134</span>     cpl_table        *overscans      = NULL;</div>
+<div class="line"><a name="l00135"></a><span class="lineno">  135</span>     cpl_table        *wavelengths    = NULL;</div>
+<div class="line"><a name="l00136"></a><span class="lineno">  136</span>     cpl_table        *idscoeff       = NULL;</div>
+<div class="line"><a name="l00137"></a><span class="lineno">  137</span>     cpl_table        *slits          = NULL;</div>
+<div class="line"><a name="l00138"></a><span class="lineno">  138</span>     cpl_table        *maskslits      = NULL;</div>
+<div class="line"><a name="l00139"></a><span class="lineno">  139</span>     cpl_table        *polytraces     = NULL;</div>
+<div class="line"><a name="l00140"></a><span class="lineno">  140</span>     cpl_table        *offsets        = NULL;</div>
+<div class="line"><a name="l00141"></a><span class="lineno">  141</span>     cpl_table        *sky            = NULL;</div>
+<div class="line"><a name="l00142"></a><span class="lineno">  142</span> </div>
+<div class="line"><a name="l00143"></a><span class="lineno">  143</span>     cpl_vector       *lines          = NULL;</div>
+<div class="line"><a name="l00144"></a><span class="lineno">  144</span> </div>
+<div class="line"><a name="l00145"></a><span class="lineno">  145</span>     cpl_propertylist *header         = NULL;</div>
+<div class="line"><a name="l00146"></a><span class="lineno">  146</span>     cpl_propertylist *save_header    = NULL;</div>
+<div class="line"><a name="l00147"></a><span class="lineno">  147</span>     cpl_propertylist *qclist         = NULL;</div>
+<div class="line"><a name="l00148"></a><span class="lineno">  148</span> </div>
+<div class="line"><a name="l00149"></a><span class="lineno">  149</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00150"></a><span class="lineno">  150</span> <span class="comment">     * Auxiliary variables</span></div>
+<div class="line"><a name="l00151"></a><span class="lineno">  151</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00152"></a><span class="lineno">  152</span> </div>
+<div class="line"><a name="l00153"></a><span class="lineno">  153</span>     <span class="keywordtype">char</span>        version[80];</div>
+<div class="line"><a name="l00154"></a><span class="lineno">  154</span>     <span class="keywordtype">char</span>       *instrume = NULL;</div>
+<div class="line"><a name="l00155"></a><span class="lineno">  155</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *science_tag;</div>
+<div class="line"><a name="l00156"></a><span class="lineno">  156</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *master_norm_flat_tag;</div>
+<div class="line"><a name="l00157"></a><span class="lineno">  157</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_tag;</div>
+<div class="line"><a name="l00158"></a><span class="lineno">  158</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *disp_coeff_sky_tag;</div>
+<div class="line"><a name="l00159"></a><span class="lineno">  159</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_tag;</div>
+<div class="line"><a name="l00160"></a><span class="lineno">  160</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *wavelength_map_sky_tag;</div>
+<div class="line"><a name="l00161"></a><span class="lineno">  161</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *curv_coeff_tag;</div>
+<div class="line"><a name="l00162"></a><span class="lineno">  162</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *slit_location_tag;</div>
+<div class="line"><a name="l00163"></a><span class="lineno">  163</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_science_tag;</div>
+<div class="line"><a name="l00164"></a><span class="lineno">  164</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_sky_tag;</div>
+<div class="line"><a name="l00165"></a><span class="lineno">  165</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *reduced_error_tag;</div>
+<div class="line"><a name="l00166"></a><span class="lineno">  166</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_tag;</div>
+<div class="line"><a name="l00167"></a><span class="lineno">  167</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_science_tag;</div>
+<div class="line"><a name="l00168"></a><span class="lineno">  168</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_science_sky_tag;</div>
+<div class="line"><a name="l00169"></a><span class="lineno">  169</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *mapped_sky_tag;</div>
+<div class="line"><a name="l00170"></a><span class="lineno">  170</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *unmapped_sky_tag;</div>
+<div class="line"><a name="l00171"></a><span class="lineno">  171</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *global_sky_spectrum_tag;</div>
+<div class="line"><a name="l00172"></a><span class="lineno">  172</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *object_table_tag;</div>
+<div class="line"><a name="l00173"></a><span class="lineno">  173</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *skylines_offsets_tag;</div>
+<div class="line"><a name="l00174"></a><span class="lineno">  174</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *specphot_tag;</div>
+<div class="line"><a name="l00175"></a><span class="lineno">  175</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_gris_name;</div>
+<div class="line"><a name="l00176"></a><span class="lineno">  176</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_gris_id;</div>
+<div class="line"><a name="l00177"></a><span class="lineno">  177</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_filt_name;</div>
+<div class="line"><a name="l00178"></a><span class="lineno">  178</span>     <span class="keyword">const</span> <span class="keywordtype">char</span> *key_filt_id;</div>
+<div class="line"><a name="l00179"></a><span class="lineno">  179</span>     <span class="keywordtype">int</span>         mos;</div>
+<div class="line"><a name="l00180"></a><span class="lineno">  180</span>     <span class="keywordtype">int</span>         nexp, expno;</div>
+<div class="line"><a name="l00181"></a><span class="lineno">  181</span>     <span class="keywordtype">int</span>         treat_as_lss = 0;</div>
+<div class="line"><a name="l00182"></a><span class="lineno">  182</span>     <span class="keywordtype">int</span>         nslits;</div>
+<div class="line"><a name="l00183"></a><span class="lineno">  183</span>     <span class="keywordtype">int</span>         nscience;</div>
+<div class="line"><a name="l00184"></a><span class="lineno">  184</span>     <span class="keywordtype">int</span>         quadrant;</div>
+<div class="line"><a name="l00185"></a><span class="lineno">  185</span>     <span class="keywordtype">double</span>     *xpos;</div>
+<div class="line"><a name="l00186"></a><span class="lineno">  186</span>     <span class="keywordtype">double</span>     *exptime = NULL;</div>
+<div class="line"><a name="l00187"></a><span class="lineno">  187</span>     <span class="keywordtype">double</span>      airmass;</div>
+<div class="line"><a name="l00188"></a><span class="lineno">  188</span>     <span class="keywordtype">double</span>      alltime;</div>
+<div class="line"><a name="l00189"></a><span class="lineno">  189</span>     <span class="keywordtype">double</span>      mxpos;</div>
+<div class="line"><a name="l00190"></a><span class="lineno">  190</span>     <span class="keywordtype">double</span>      mean_rms;</div>
+<div class="line"><a name="l00191"></a><span class="lineno">  191</span>     <span class="keywordtype">int</span>         nlines;</div>
+<div class="line"><a name="l00192"></a><span class="lineno">  192</span>     <span class="keywordtype">double</span>     *line;</div>
+<div class="line"><a name="l00193"></a><span class="lineno">  193</span>     <span class="keywordtype">int</span>         nx, ny;</div>
+<div class="line"><a name="l00194"></a><span class="lineno">  194</span>     <span class="keywordtype">double</span>      gain;</div>
+<div class="line"><a name="l00195"></a><span class="lineno">  195</span>     <span class="keywordtype">double</span>      ron;</div>
+<div class="line"><a name="l00196"></a><span class="lineno">  196</span>     <span class="keywordtype">int</span>         standard;</div>
+<div class="line"><a name="l00197"></a><span class="lineno">  197</span>     <span class="keywordtype">int</span>         highres;</div>
+<div class="line"><a name="l00198"></a><span class="lineno">  198</span>     <span class="keywordtype">int</span>         rotate = 1;</div>
+<div class="line"><a name="l00199"></a><span class="lineno">  199</span>     <span class="keywordtype">int</span>         rotate_back = -1;</div>
+<div class="line"><a name="l00200"></a><span class="lineno">  200</span>     <span class="keywordtype">int</span>         i;</div>
+<div class="line"><a name="l00201"></a><span class="lineno">  201</span>     <span class="keywordtype">double</span>      wstart;</div>
+<div class="line"><a name="l00202"></a><span class="lineno">  202</span>     <span class="keywordtype">double</span>      wstep;</div>
+<div class="line"><a name="l00203"></a><span class="lineno">  203</span>     <span class="keywordtype">int</span>         wcount;</div>
+<div class="line"><a name="l00204"></a><span class="lineno">  204</span> </div>
+<div class="line"><a name="l00205"></a><span class="lineno">  205</span> </div>
+<div class="line"><a name="l00206"></a><span class="lineno">  206</span>     snprintf(version, 80, <span class="stringliteral">"%s-%s"</span>, PACKAGE, PACKAGE_VERSION);</div>
+<div class="line"><a name="l00207"></a><span class="lineno">  207</span> </div>
+<div class="line"><a name="l00208"></a><span class="lineno">  208</span>     cpl_msg_set_indentation(2);</div>
+<div class="line"><a name="l00209"></a><span class="lineno">  209</span> </div>
+<div class="line"><a name="l00210"></a><span class="lineno">  210</span> </div>
+<div class="line"><a name="l00211"></a><span class="lineno">  211</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00212"></a><span class="lineno">  212</span> <span class="comment">     * Get configuration parameters</span></div>
+<div class="line"><a name="l00213"></a><span class="lineno">  213</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00214"></a><span class="lineno">  214</span> </div>
+<div class="line"><a name="l00215"></a><span class="lineno">  215</span>     cpl_msg_info(recipe, <span class="stringliteral">"Recipe %s configuration parameters:"</span>, recipe);</div>
+<div class="line"><a name="l00216"></a><span class="lineno">  216</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00217"></a><span class="lineno">  217</span> </div>
+<div class="line"><a name="l00218"></a><span class="lineno">  218</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"GRISM_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00219"></a><span class="lineno">  219</span>         vimos_science_exit(<span class="stringliteral">"Too many in input: GRISM_TABLE"</span>);</div>
+<div class="line"><a name="l00220"></a><span class="lineno">  220</span> </div>
+<div class="line"><a name="l00221"></a><span class="lineno">  221</span>     grism_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"GRISM_TABLE"</span>, 1);</div>
+<div class="line"><a name="l00222"></a><span class="lineno">  222</span> </div>
+<div class="line"><a name="l00223"></a><span class="lineno">  223</span>     dispersion = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00224"></a><span class="lineno">  224</span>                     <span class="stringliteral">"fors.vimos_science.dispersion"</span>, grism_table);</div>
+<div class="line"><a name="l00225"></a><span class="lineno">  225</span> </div>
+<div class="line"><a name="l00226"></a><span class="lineno">  226</span>     <span class="keywordflow">if</span> (dispersion <= 0.0)</div>
+<div class="line"><a name="l00227"></a><span class="lineno">  227</span>         vimos_science_exit(<span class="stringliteral">"Invalid resampling step"</span>);</div>
+<div class="line"><a name="l00228"></a><span class="lineno">  228</span> </div>
+<div class="line"><a name="l00229"></a><span class="lineno">  229</span>     skyalign = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00230"></a><span class="lineno">  230</span>                     <span class="stringliteral">"fors.vimos_science.skyalign"</span>, NULL);</div>
+<div class="line"><a name="l00231"></a><span class="lineno">  231</span> </div>
+<div class="line"><a name="l00232"></a><span class="lineno">  232</span>     <span class="keywordflow">if</span> (skyalign > 2)</div>
+<div class="line"><a name="l00233"></a><span class="lineno">  233</span>         vimos_science_exit(<span class="stringliteral">"Max polynomial degree for sky alignment is 2"</span>);</div>
+<div class="line"><a name="l00234"></a><span class="lineno">  234</span> </div>
+<div class="line"><a name="l00235"></a><span class="lineno">  235</span>     wcolumn = <a class="code" href="group__forsdfs.html#ga57c7568085340fc81eeafec1a1092197" title="Reading a recipe string parameter value.">dfs_get_parameter_string</a>(parlist, </div>
+<div class="line"><a name="l00236"></a><span class="lineno">  236</span>                     <span class="stringliteral">"fors.vimos_science.wcolumn"</span>, NULL);</div>
+<div class="line"><a name="l00237"></a><span class="lineno">  237</span> </div>
+<div class="line"><a name="l00238"></a><span class="lineno">  238</span>     startwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00239"></a><span class="lineno">  239</span>                     <span class="stringliteral">"fors.vimos_science.startwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00240"></a><span class="lineno">  240</span>     <span class="keywordflow">if</span> (startwavelength < 3000.0 || startwavelength > 13000.0)</div>
+<div class="line"><a name="l00241"></a><span class="lineno">  241</span>         vimos_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00242"></a><span class="lineno">  242</span> </div>
+<div class="line"><a name="l00243"></a><span class="lineno">  243</span>     endwavelength = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist, </div>
+<div class="line"><a name="l00244"></a><span class="lineno">  244</span>                     <span class="stringliteral">"fors.vimos_science.endwavelength"</span>, grism_table);</div>
+<div class="line"><a name="l00245"></a><span class="lineno">  245</span>     <span class="keywordflow">if</span> (endwavelength < 3000.0 || endwavelength > 13000.0)</div>
+<div class="line"><a name="l00246"></a><span class="lineno">  246</span>         vimos_science_exit(<span class="stringliteral">"Invalid wavelength"</span>);</div>
+<div class="line"><a name="l00247"></a><span class="lineno">  247</span> </div>
+<div class="line"><a name="l00248"></a><span class="lineno">  248</span>     <span class="keywordflow">if</span> (endwavelength - startwavelength <= 0.0)</div>
+<div class="line"><a name="l00249"></a><span class="lineno">  249</span>         vimos_science_exit(<span class="stringliteral">"Invalid wavelength interval"</span>);</div>
+<div class="line"><a name="l00250"></a><span class="lineno">  250</span> </div>
+<div class="line"><a name="l00251"></a><span class="lineno">  251</span>     reference = <a class="code" href="group__forsdfs.html#gab02dcd2b3ed62a805caca41d11705b96" title="Reading a recipe double parameter value.">dfs_get_parameter_double</a>(parlist,</div>
+<div class="line"><a name="l00252"></a><span class="lineno">  252</span>                 <span class="stringliteral">"fors.vimos_science.reference"</span>, grism_table);</div>
+<div class="line"><a name="l00253"></a><span class="lineno">  253</span> </div>
+<div class="line"><a name="l00254"></a><span class="lineno">  254</span>     <span class="keywordflow">if</span> (reference < startwavelength || reference > endwavelength)</div>
+<div class="line"><a name="l00255"></a><span class="lineno">  255</span>         vimos_science_exit(<span class="stringliteral">"Invalid reference wavelength"</span>);</div>
+<div class="line"><a name="l00256"></a><span class="lineno">  256</span> </div>
+<div class="line"><a name="l00257"></a><span class="lineno">  257</span>     flux = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.flux"</span>, NULL);</div>
+<div class="line"><a name="l00258"></a><span class="lineno">  258</span> </div>
+<div class="line"><a name="l00259"></a><span class="lineno">  259</span>     flatfield = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.flatfield"</span>, </div>
+<div class="line"><a name="l00260"></a><span class="lineno">  260</span>                                        NULL);</div>
+<div class="line"><a name="l00261"></a><span class="lineno">  261</span> </div>
+<div class="line"><a name="l00262"></a><span class="lineno">  262</span>     skyglobal = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.skyglobal"</span>, </div>
+<div class="line"><a name="l00263"></a><span class="lineno">  263</span>                                        NULL);</div>
+<div class="line"><a name="l00264"></a><span class="lineno">  264</span>     skylocal  = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.skylocal"</span>, </div>
+<div class="line"><a name="l00265"></a><span class="lineno">  265</span>                                        NULL);</div>
+<div class="line"><a name="l00266"></a><span class="lineno">  266</span>     skymedian = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.skymedian"</span>, </div>
+<div class="line"><a name="l00267"></a><span class="lineno">  267</span>                                        NULL);</div>
+<div class="line"><a name="l00268"></a><span class="lineno">  268</span> </div>
+<div class="line"><a name="l00269"></a><span class="lineno">  269</span>     <span class="keywordflow">if</span> (skylocal && skyglobal)</div>
+<div class="line"><a name="l00270"></a><span class="lineno">  270</span>         vimos_science_exit(<span class="stringliteral">"Cannot do both local and global sky subtraction"</span>);</div>
+<div class="line"><a name="l00271"></a><span class="lineno">  271</span> </div>
+<div class="line"><a name="l00272"></a><span class="lineno">  272</span>     <span class="keywordflow">if</span> (skylocal && skymedian)</div>
+<div class="line"><a name="l00273"></a><span class="lineno">  273</span>         vimos_science_exit(<span class="stringliteral">"Cannot do sky subtraction both on extracted "</span></div>
+<div class="line"><a name="l00274"></a><span class="lineno">  274</span>                            <span class="stringliteral">"and non-extracted spectra"</span>);</div>
+<div class="line"><a name="l00275"></a><span class="lineno">  275</span> </div>
+<div class="line"><a name="l00276"></a><span class="lineno">  276</span>     cosmics = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00277"></a><span class="lineno">  277</span>                                      <span class="stringliteral">"fors.vimos_science.cosmics"</span>, NULL);</div>
+<div class="line"><a name="l00278"></a><span class="lineno">  278</span> </div>
+<div class="line"><a name="l00279"></a><span class="lineno">  279</span>     <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l00280"></a><span class="lineno">  280</span>         <span class="keywordflow">if</span> (!(skyglobal || skylocal))</div>
+<div class="line"><a name="l00281"></a><span class="lineno">  281</span>             vimos_science_exit(<span class="stringliteral">"Cosmic rays correction requires "</span></div>
+<div class="line"><a name="l00282"></a><span class="lineno">  282</span>                               <span class="stringliteral">"either skylocal=true or skyglobal=true"</span>);</div>
+<div class="line"><a name="l00283"></a><span class="lineno">  283</span> </div>
+<div class="line"><a name="l00284"></a><span class="lineno">  284</span>     slit_margin = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00285"></a><span class="lineno">  285</span>                                         <span class="stringliteral">"fors.vimos_science.slit_margin"</span>,</div>
+<div class="line"><a name="l00286"></a><span class="lineno">  286</span>                                         NULL);</div>
+<div class="line"><a name="l00287"></a><span class="lineno">  287</span>     <span class="keywordflow">if</span> (slit_margin < 0)</div>
+<div class="line"><a name="l00288"></a><span class="lineno">  288</span>         vimos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00289"></a><span class="lineno">  289</span> </div>
+<div class="line"><a name="l00290"></a><span class="lineno">  290</span>     ext_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00291"></a><span class="lineno">  291</span>                                        <span class="stringliteral">"fors.vimos_science.ext_radius"</span>,</div>
+<div class="line"><a name="l00292"></a><span class="lineno">  292</span>                                        NULL);</div>
+<div class="line"><a name="l00293"></a><span class="lineno">  293</span>     <span class="keywordflow">if</span> (ext_radius < 0)</div>
+<div class="line"><a name="l00294"></a><span class="lineno">  294</span>         vimos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00295"></a><span class="lineno">  295</span> </div>
+<div class="line"><a name="l00296"></a><span class="lineno">  296</span>     cont_radius = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, </div>
+<div class="line"><a name="l00297"></a><span class="lineno">  297</span>                                         <span class="stringliteral">"fors.vimos_science.cont_radius"</span>,</div>
+<div class="line"><a name="l00298"></a><span class="lineno">  298</span>                                         NULL);</div>
+<div class="line"><a name="l00299"></a><span class="lineno">  299</span>     <span class="keywordflow">if</span> (cont_radius < 0)</div>
+<div class="line"><a name="l00300"></a><span class="lineno">  300</span>         vimos_science_exit(<span class="stringliteral">"Value must be zero or positive"</span>);</div>
+<div class="line"><a name="l00301"></a><span class="lineno">  301</span> </div>
+<div class="line"><a name="l00302"></a><span class="lineno">  302</span>     ext_mode = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_science.ext_mode"</span>,</div>
+<div class="line"><a name="l00303"></a><span class="lineno">  303</span>                                        NULL);</div>
+<div class="line"><a name="l00304"></a><span class="lineno">  304</span>     <span class="keywordflow">if</span> (ext_mode < 0 || ext_mode > 1)</div>
+<div class="line"><a name="l00305"></a><span class="lineno">  305</span>         vimos_science_exit(<span class="stringliteral">"Invalid object extraction mode"</span>);</div>
+<div class="line"><a name="l00306"></a><span class="lineno">  306</span> </div>
+<div class="line"><a name="l00307"></a><span class="lineno">  307</span>     time_normalise = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, </div>
+<div class="line"><a name="l00308"></a><span class="lineno">  308</span>                              <span class="stringliteral">"fors.vimos_science.time_normalise"</span>, NULL);</div>
+<div class="line"><a name="l00309"></a><span class="lineno">  309</span> </div>
+<div class="line"><a name="l00310"></a><span class="lineno">  310</span>     res_order = <a class="code" href="group__forsdfs.html#ga09890733c10deff040e30c6920f26b22" title="Reading a recipe integer parameter value.">dfs_get_parameter_int</a>(parlist, <span class="stringliteral">"fors.vimos_science.response"</span>,</div>
+<div class="line"><a name="l00311"></a><span class="lineno">  311</span>                                       NULL);</div>
+<div class="line"><a name="l00312"></a><span class="lineno">  312</span>     <span class="keywordflow">if</span> (res_order < 2 || res_order > 10)</div>
+<div class="line"><a name="l00313"></a><span class="lineno">  313</span>         vimos_science_exit(<span class="stringliteral">"Invalid instrument response modeling polynomial"</span>);</div>
+<div class="line"><a name="l00314"></a><span class="lineno">  314</span> </div>
+<div class="line"><a name="l00315"></a><span class="lineno">  315</span>     anyframe = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.anyframe"</span>, </div>
+<div class="line"><a name="l00316"></a><span class="lineno">  316</span>                                       NULL);</div>
+<div class="line"><a name="l00317"></a><span class="lineno">  317</span> </div>
+<div class="line"><a name="l00318"></a><span class="lineno">  318</span>     qc = <a class="code" href="group__forsdfs.html#ga48768c59ba1e2bf1776ad4770ab09fbb" title="Reading a recipe boolean parameter value.">dfs_get_parameter_bool</a>(parlist, <span class="stringliteral">"fors.vimos_science.qc"</span>, NULL);</div>
+<div class="line"><a name="l00319"></a><span class="lineno">  319</span> </div>
+<div class="line"><a name="l00320"></a><span class="lineno">  320</span>     cpl_table_delete(grism_table); grism_table = NULL;</div>
+<div class="line"><a name="l00321"></a><span class="lineno">  321</span> </div>
+<div class="line"><a name="l00322"></a><span class="lineno">  322</span>     <span class="keywordflow">if</span> (cpl_error_get_code())</div>
+<div class="line"><a name="l00323"></a><span class="lineno">  323</span>         vimos_science_exit(<span class="stringliteral">"Failure getting the configuration parameters"</span>);</div>
+<div class="line"><a name="l00324"></a><span class="lineno">  324</span> </div>
+<div class="line"><a name="l00325"></a><span class="lineno">  325</span>     </div>
+<div class="line"><a name="l00326"></a><span class="lineno">  326</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00327"></a><span class="lineno">  327</span> <span class="comment">     * Check input set-of-frames</span></div>
+<div class="line"><a name="l00328"></a><span class="lineno">  328</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00329"></a><span class="lineno">  329</span> </div>
+<div class="line"><a name="l00330"></a><span class="lineno">  330</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00331"></a><span class="lineno">  331</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check input set-of-frames:"</span>);</div>
+<div class="line"><a name="l00332"></a><span class="lineno">  332</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00333"></a><span class="lineno">  333</span> </div>
+<div class="line"><a name="l00334"></a><span class="lineno">  334</span>     <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO OCS CON QUAD"</span>))</div>
+<div class="line"><a name="l00335"></a><span class="lineno">  335</span>         vimos_science_exit(<span class="stringliteral">"Input frames are not from the same quadrant"</span>);</div>
+<div class="line"><a name="l00336"></a><span class="lineno">  336</span> </div>
+<div class="line"><a name="l00337"></a><span class="lineno">  337</span>     mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MOS_SCIENCE"</span>);</div>
+<div class="line"><a name="l00338"></a><span class="lineno">  338</span>     standard = 0;</div>
+<div class="line"><a name="l00339"></a><span class="lineno">  339</span> </div>
+<div class="line"><a name="l00340"></a><span class="lineno">  340</span>     <span class="keywordflow">if</span> (mos == 0) {</div>
+<div class="line"><a name="l00341"></a><span class="lineno">  341</span>         mos = cpl_frameset_count_tags(frameset, <span class="stringliteral">"MOS_STANDARD"</span>);</div>
+<div class="line"><a name="l00342"></a><span class="lineno">  342</span>         standard = 1;</div>
+<div class="line"><a name="l00343"></a><span class="lineno">  343</span>     }</div>
+<div class="line"><a name="l00344"></a><span class="lineno">  344</span> </div>
+<div class="line"><a name="l00345"></a><span class="lineno">  345</span>     <span class="keywordflow">if</span> (mos == 0)</div>
+<div class="line"><a name="l00346"></a><span class="lineno">  346</span>         vimos_science_exit(<span class="stringliteral">"Missing input scientific frame"</span>);</div>
+<div class="line"><a name="l00347"></a><span class="lineno">  347</span> </div>
+<div class="line"><a name="l00348"></a><span class="lineno">  348</span>     nscience = mos;</div>
+<div class="line"><a name="l00349"></a><span class="lineno">  349</span> </div>
+<div class="line"><a name="l00350"></a><span class="lineno">  350</span>     <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00351"></a><span class="lineno">  351</span>         science_tag            = <span class="stringliteral">"MOS_STANDARD"</span>;</div>
+<div class="line"><a name="l00352"></a><span class="lineno">  352</span>         reduced_science_tag    = <span class="stringliteral">"MOS_STANDARD_REDUCED"</span>;</div>
+<div class="line"><a name="l00353"></a><span class="lineno">  353</span>         unmapped_science_tag   = <span class="stringliteral">"MOS_UNMAPPED_STANDARD"</span>;</div>
+<div class="line"><a name="l00354"></a><span class="lineno">  354</span>         mapped_science_tag     = <span class="stringliteral">"MOS_STANDARD_EXTRACTED"</span>;</div>
+<div class="line"><a name="l00355"></a><span class="lineno">  355</span>         mapped_science_sky_tag = <span class="stringliteral">"MOS_STANDARD_SKY_EXTRACTED"</span>;</div>
+<div class="line"><a name="l00356"></a><span class="lineno">  356</span>         mapped_sky_tag         = <span class="stringliteral">"MOS_STANDARD_SKY"</span>;</div>
+<div class="line"><a name="l00357"></a><span class="lineno">  357</span>         specphot_tag           = <span class="stringliteral">"MOS_SPECPHOT_TABLE"</span>;</div>
+<div class="line"><a name="l00358"></a><span class="lineno">  358</span> </div>
+<div class="line"><a name="l00359"></a><span class="lineno">  359</span>     }</div>
+<div class="line"><a name="l00360"></a><span class="lineno">  360</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00361"></a><span class="lineno">  361</span>         science_tag            = <span class="stringliteral">"MOS_SCIENCE"</span>;</div>
+<div class="line"><a name="l00362"></a><span class="lineno">  362</span>         reduced_science_tag    = <span class="stringliteral">"MOS_SCIENCE_REDUCED"</span>;</div>
+<div class="line"><a name="l00363"></a><span class="lineno">  363</span>         unmapped_science_tag   = <span class="stringliteral">"MOS_UNMAPPED_SCIENCE"</span>;</div>
+<div class="line"><a name="l00364"></a><span class="lineno">  364</span>         mapped_science_tag     = <span class="stringliteral">"MOS_SCIENCE_EXTRACTED"</span>;</div>
+<div class="line"><a name="l00365"></a><span class="lineno">  365</span>         mapped_science_sky_tag = <span class="stringliteral">"MOS_SCIENCE_SKY_EXTRACTED"</span>;</div>
+<div class="line"><a name="l00366"></a><span class="lineno">  366</span>         mapped_sky_tag         = <span class="stringliteral">"MOS_SCIENCE_SKY"</span>;</div>
+<div class="line"><a name="l00367"></a><span class="lineno">  367</span>     }</div>
+<div class="line"><a name="l00368"></a><span class="lineno">  368</span> </div>
+<div class="line"><a name="l00369"></a><span class="lineno">  369</span>     reduced_sky_tag         = <span class="stringliteral">"MOS_SKY_REDUCED"</span>;</div>
+<div class="line"><a name="l00370"></a><span class="lineno">  370</span>     reduced_error_tag       = <span class="stringliteral">"MOS_ERROR_REDUCED"</span>;</div>
+<div class="line"><a name="l00371"></a><span class="lineno">  371</span>     master_norm_flat_tag    = <span class="stringliteral">"MOS_MASTER_SCREEN_FLAT"</span>;</div>
+<div class="line"><a name="l00372"></a><span class="lineno">  372</span>     disp_coeff_sky_tag      = <span class="stringliteral">"MOS_DISP_COEFF_SKY"</span>;</div>
+<div class="line"><a name="l00373"></a><span class="lineno">  373</span>     wavelength_map_sky_tag  = <span class="stringliteral">"MOS_WAVELENGTH_MAP_SKY"</span>;</div>
+<div class="line"><a name="l00374"></a><span class="lineno">  374</span>     disp_coeff_tag          = <span class="stringliteral">"MOS_DISP_COEFF"</span>;</div>
+<div class="line"><a name="l00375"></a><span class="lineno">  375</span>     wavelength_map_tag      = <span class="stringliteral">"WAVELENGTH_MAP_MXU"</span>;</div>
+<div class="line"><a name="l00376"></a><span class="lineno">  376</span>     curv_coeff_tag          = <span class="stringliteral">"MOS_CURV_COEFF"</span>;</div>
+<div class="line"><a name="l00377"></a><span class="lineno">  377</span>     slit_location_tag       = <span class="stringliteral">"MOS_SLIT_LOCATION"</span>;</div>
+<div class="line"><a name="l00378"></a><span class="lineno">  378</span>     skylines_offsets_tag    = <span class="stringliteral">"MOS_SKYLINES_OFFSETS_SLIT"</span>;</div>
+<div class="line"><a name="l00379"></a><span class="lineno">  379</span>     unmapped_sky_tag        = <span class="stringliteral">"MOS_UNMAPPED_SKY"</span>;</div>
+<div class="line"><a name="l00380"></a><span class="lineno">  380</span>     global_sky_spectrum_tag = <span class="stringliteral">"MOS_GLOBAL_SKY_SPECTRUM"</span>;</div>
+<div class="line"><a name="l00381"></a><span class="lineno">  381</span>     object_table_tag        = <span class="stringliteral">"OBJECT_TABLE"</span>;</div>
+<div class="line"><a name="l00382"></a><span class="lineno">  382</span> </div>
+<div class="line"><a name="l00383"></a><span class="lineno">  383</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) == 0)</div>
+<div class="line"><a name="l00384"></a><span class="lineno">  384</span>         vimos_science_exit(<span class="stringliteral">"Missing required input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l00385"></a><span class="lineno">  385</span> </div>
+<div class="line"><a name="l00386"></a><span class="lineno">  386</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"MASTER_BIAS"</span>) > 1)</div>
+<div class="line"><a name="l00387"></a><span class="lineno">  387</span>         vimos_science_exit(<span class="stringliteral">"Too many in input: MASTER_BIAS"</span>);</div>
+<div class="line"><a name="l00388"></a><span class="lineno">  388</span> </div>
+<div class="line"><a name="l00389"></a><span class="lineno">  389</span>     <span class="keywordflow">if</span> (skyalign >= 0)</div>
+<div class="line"><a name="l00390"></a><span class="lineno">  390</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"SKY_LINE_CATALOG"</span>) > 1)</div>
+<div class="line"><a name="l00391"></a><span class="lineno">  391</span>             vimos_science_exit(<span class="stringliteral">"Too many in input: SKY_LINE_CATALOG"</span>);</div>
+<div class="line"><a name="l00392"></a><span class="lineno">  392</span> </div>
+<div class="line"><a name="l00393"></a><span class="lineno">  393</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) == 0) {</div>
+<div class="line"><a name="l00394"></a><span class="lineno">  394</span>         cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, disp_coeff_tag);</div>
+<div class="line"><a name="l00395"></a><span class="lineno">  395</span>         vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00396"></a><span class="lineno">  396</span>     }</div>
+<div class="line"><a name="l00397"></a><span class="lineno">  397</span> </div>
+<div class="line"><a name="l00398"></a><span class="lineno">  398</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, disp_coeff_tag) > 1) {</div>
+<div class="line"><a name="l00399"></a><span class="lineno">  399</span>         cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, disp_coeff_tag);</div>
+<div class="line"><a name="l00400"></a><span class="lineno">  400</span>         vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00401"></a><span class="lineno">  401</span>     }</div>
+<div class="line"><a name="l00402"></a><span class="lineno">  402</span> </div>
+<div class="line"><a name="l00403"></a><span class="lineno">  403</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) > 1) {</div>
+<div class="line"><a name="l00404"></a><span class="lineno">  404</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l00405"></a><span class="lineno">  405</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, </div>
+<div class="line"><a name="l00406"></a><span class="lineno">  406</span>                           master_norm_flat_tag);</div>
+<div class="line"><a name="l00407"></a><span class="lineno">  407</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00408"></a><span class="lineno">  408</span>         }</div>
+<div class="line"><a name="l00409"></a><span class="lineno">  409</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00410"></a><span class="lineno">  410</span>             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input are ignored, "</span></div>
+<div class="line"><a name="l00411"></a><span class="lineno">  411</span>                             <span class="stringliteral">"since flat field correction was not requested"</span>, </div>
+<div class="line"><a name="l00412"></a><span class="lineno">  412</span>                             master_norm_flat_tag);</div>
+<div class="line"><a name="l00413"></a><span class="lineno">  413</span>         }</div>
+<div class="line"><a name="l00414"></a><span class="lineno">  414</span>     }</div>
+<div class="line"><a name="l00415"></a><span class="lineno">  415</span> </div>
+<div class="line"><a name="l00416"></a><span class="lineno">  416</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 1) {</div>
+<div class="line"><a name="l00417"></a><span class="lineno">  417</span>         <span class="keywordflow">if</span> (!flatfield) {</div>
+<div class="line"><a name="l00418"></a><span class="lineno">  418</span>             cpl_msg_warning(recipe, <span class="stringliteral">"%s in input is ignored, "</span></div>
+<div class="line"><a name="l00419"></a><span class="lineno">  419</span>                             <span class="stringliteral">"since flat field correction was not requested"</span>, </div>
+<div class="line"><a name="l00420"></a><span class="lineno">  420</span>                             master_norm_flat_tag);</div>
+<div class="line"><a name="l00421"></a><span class="lineno">  421</span>         }</div>
+<div class="line"><a name="l00422"></a><span class="lineno">  422</span>     }</div>
+<div class="line"><a name="l00423"></a><span class="lineno">  423</span> </div>
+<div class="line"><a name="l00424"></a><span class="lineno">  424</span>     <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, master_norm_flat_tag) == 0) {</div>
+<div class="line"><a name="l00425"></a><span class="lineno">  425</span>         <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l00426"></a><span class="lineno">  426</span>             cpl_msg_error(recipe, <span class="stringliteral">"Flat field correction was requested, "</span></div>
+<div class="line"><a name="l00427"></a><span class="lineno">  427</span>                           <span class="stringliteral">"but no %s are found in input"</span>,</div>
+<div class="line"><a name="l00428"></a><span class="lineno">  428</span>                           master_norm_flat_tag);</div>
+<div class="line"><a name="l00429"></a><span class="lineno">  429</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00430"></a><span class="lineno">  430</span>         }</div>
+<div class="line"><a name="l00431"></a><span class="lineno">  431</span>     }</div>
+<div class="line"><a name="l00432"></a><span class="lineno">  432</span> </div>
+<div class="line"><a name="l00433"></a><span class="lineno">  433</span>     <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00434"></a><span class="lineno">  434</span> </div>
+<div class="line"><a name="l00435"></a><span class="lineno">  435</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) == 0) {</div>
+<div class="line"><a name="l00436"></a><span class="lineno">  436</span>             cpl_msg_warning(recipe, <span class="stringliteral">"An EXTINCT_TABLE was not found in input: "</span></div>
+<div class="line"><a name="l00437"></a><span class="lineno">  437</span>                             <span class="stringliteral">"instrument response curve will not be produced."</span>);</div>
+<div class="line"><a name="l00438"></a><span class="lineno">  438</span>             standard = 0;</div>
+<div class="line"><a name="l00439"></a><span class="lineno">  439</span>         }</div>
+<div class="line"><a name="l00440"></a><span class="lineno">  440</span> </div>
+<div class="line"><a name="l00441"></a><span class="lineno">  441</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00442"></a><span class="lineno">  442</span>             vimos_science_exit(<span class="stringliteral">"Too many in input: EXTINCT_TABLE"</span>);</div>
+<div class="line"><a name="l00443"></a><span class="lineno">  443</span> </div>
+<div class="line"><a name="l00444"></a><span class="lineno">  444</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>) == 0) {</div>
+<div class="line"><a name="l00445"></a><span class="lineno">  445</span>             cpl_msg_warning(recipe, <span class="stringliteral">"A STD_FLUX_TABLE was not found in input: "</span></div>
+<div class="line"><a name="l00446"></a><span class="lineno">  446</span>                             <span class="stringliteral">"instrument response curve will not be produced."</span>);</div>
+<div class="line"><a name="l00447"></a><span class="lineno">  447</span>             standard = 0;</div>
+<div class="line"><a name="l00448"></a><span class="lineno">  448</span>         }</div>
+<div class="line"><a name="l00449"></a><span class="lineno">  449</span> </div>
+<div class="line"><a name="l00450"></a><span class="lineno">  450</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>) > 1)</div>
+<div class="line"><a name="l00451"></a><span class="lineno">  451</span>             vimos_science_exit(<span class="stringliteral">"Too many in input: STD_FLUX_TABLE"</span>);</div>
+<div class="line"><a name="l00452"></a><span class="lineno">  452</span> </div>
+<div class="line"><a name="l00453"></a><span class="lineno">  453</span>         <span class="keywordflow">if</span> (!<a class="code" href="group__forsdfs.html#gae17908f224eaaa5696f0dc084a964435" title="Saving table data of given category.">dfs_equal_keyword</a>(frameset, <span class="stringliteral">"ESO OBS TARG NAME"</span>)) {</div>
+<div class="line"><a name="l00454"></a><span class="lineno">  454</span>             cpl_msg_warning(recipe, <span class="stringliteral">"The target name of observation does not "</span></div>
+<div class="line"><a name="l00455"></a><span class="lineno">  455</span>                             <span class="stringliteral">"match the standard star catalog: "</span></div>
+<div class="line"><a name="l00456"></a><span class="lineno">  456</span>                             <span class="stringliteral">"instrument response curve will not be produced."</span>);</div>
+<div class="line"><a name="l00457"></a><span class="lineno">  457</span>             standard = 0;</div>
+<div class="line"><a name="l00458"></a><span class="lineno">  458</span>         }</div>
+<div class="line"><a name="l00459"></a><span class="lineno">  459</span>     }</div>
+<div class="line"><a name="l00460"></a><span class="lineno">  460</span> </div>
+<div class="line"><a name="l00461"></a><span class="lineno">  461</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00462"></a><span class="lineno">  462</span> </div>
+<div class="line"><a name="l00463"></a><span class="lineno">  463</span> </div>
+<div class="line"><a name="l00464"></a><span class="lineno">  464</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00465"></a><span class="lineno">  465</span> <span class="comment">     * Loading input data</span></div>
+<div class="line"><a name="l00466"></a><span class="lineno">  466</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00467"></a><span class="lineno">  467</span> </div>
+<div class="line"><a name="l00468"></a><span class="lineno">  468</span>     exptime = cpl_calloc(nscience, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00469"></a><span class="lineno">  469</span> </div>
+<div class="line"><a name="l00470"></a><span class="lineno">  470</span>     <span class="keywordflow">if</span> (nscience > 1) {</div>
+<div class="line"><a name="l00471"></a><span class="lineno">  471</span> </div>
+<div class="line"><a name="l00472"></a><span class="lineno">  472</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load %d scientific frames and median them..."</span>,</div>
+<div class="line"><a name="l00473"></a><span class="lineno">  473</span>                      nscience);</div>
+<div class="line"><a name="l00474"></a><span class="lineno">  474</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00475"></a><span class="lineno">  475</span> </div>
+<div class="line"><a name="l00476"></a><span class="lineno">  476</span>         all_science = cpl_imagelist_new();</div>
+<div class="line"><a name="l00477"></a><span class="lineno">  477</span> </div>
+<div class="line"><a name="l00478"></a><span class="lineno">  478</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l00479"></a><span class="lineno">  479</span> </div>
+<div class="line"><a name="l00480"></a><span class="lineno">  480</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00481"></a><span class="lineno">  481</span>             vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l00482"></a><span class="lineno">  482</span> </div>
+<div class="line"><a name="l00483"></a><span class="lineno">  483</span>         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l00484"></a><span class="lineno">  484</span> </div>
+<div class="line"><a name="l00485"></a><span class="lineno">  485</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00486"></a><span class="lineno">  486</span>             vimos_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l00487"></a><span class="lineno">  487</span>                               <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00488"></a><span class="lineno">  488</span> </div>
+<div class="line"><a name="l00489"></a><span class="lineno">  489</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00490"></a><span class="lineno">  490</span>             airmass = <a class="code" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b" title="Compute average airmass.">fors_get_airmass</a>(header);</div>
+<div class="line"><a name="l00491"></a><span class="lineno">  491</span>             <span class="keywordflow">if</span> (airmass < 0.0)</div>
+<div class="line"><a name="l00492"></a><span class="lineno">  492</span>                 vimos_science_exit(<span class="stringliteral">"Missing airmass information in "</span></div>
+<div class="line"><a name="l00493"></a><span class="lineno">  493</span>                                    <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l00494"></a><span class="lineno">  494</span>         }</div>
+<div class="line"><a name="l00495"></a><span class="lineno">  495</span> </div>
+<div class="line"><a name="l00496"></a><span class="lineno">  496</span>         instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00497"></a><span class="lineno">  497</span>         <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00498"></a><span class="lineno">  498</span>             vimos_science_exit(<span class="stringliteral">"Missing keyword INSTRUME "</span></div>
+<div class="line"><a name="l00499"></a><span class="lineno">  499</span>                                <span class="stringliteral">"in scientific frame header"</span>);</div>
+<div class="line"><a name="l00500"></a><span class="lineno">  500</span> </div>
+<div class="line"><a name="l00501"></a><span class="lineno">  501</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00502"></a><span class="lineno">  502</span> </div>
+<div class="line"><a name="l00503"></a><span class="lineno">  503</span>         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame 1 exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l00504"></a><span class="lineno">  504</span>                      exptime[0]);</div>
+<div class="line"><a name="l00505"></a><span class="lineno">  505</span> </div>
+<div class="line"><a name="l00506"></a><span class="lineno">  506</span>         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {</div>
+<div class="line"><a name="l00507"></a><span class="lineno">  507</span> </div>
+<div class="line"><a name="l00508"></a><span class="lineno">  508</span>             header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, NULL, 0);</div>
+<div class="line"><a name="l00509"></a><span class="lineno">  509</span> </div>
+<div class="line"><a name="l00510"></a><span class="lineno">  510</span>             <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00511"></a><span class="lineno">  511</span>                 vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l00512"></a><span class="lineno">  512</span>     </div>
+<div class="line"><a name="l00513"></a><span class="lineno">  513</span>             exptime[i] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l00514"></a><span class="lineno">  514</span> </div>
+<div class="line"><a name="l00515"></a><span class="lineno">  515</span>             alltime += exptime[i];</div>
+<div class="line"><a name="l00516"></a><span class="lineno">  516</span>     </div>
+<div class="line"><a name="l00517"></a><span class="lineno">  517</span>             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00518"></a><span class="lineno">  518</span>                 vimos_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l00519"></a><span class="lineno">  519</span>                                   <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00520"></a><span class="lineno">  520</span>     </div>
+<div class="line"><a name="l00521"></a><span class="lineno">  521</span>             cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00522"></a><span class="lineno">  522</span> </div>
+<div class="line"><a name="l00523"></a><span class="lineno">  523</span>             cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame %d exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l00524"></a><span class="lineno">  524</span>                          i+1, exptime[i]);</div>
+<div class="line"><a name="l00525"></a><span class="lineno">  525</span>         }</div>
+<div class="line"><a name="l00526"></a><span class="lineno">  526</span> </div>
+<div class="line"><a name="l00527"></a><span class="lineno">  527</span>         spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00528"></a><span class="lineno">  528</span> </div>
+<div class="line"><a name="l00529"></a><span class="lineno">  529</span>         <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00530"></a><span class="lineno">  530</span>             vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l00531"></a><span class="lineno">  531</span> </div>
+<div class="line"><a name="l00532"></a><span class="lineno">  532</span>         cpl_image_divide_scalar(spectra, exptime[0]);</div>
+<div class="line"><a name="l00533"></a><span class="lineno">  533</span>         cpl_imagelist_set(all_science, spectra, 0);</div>
+<div class="line"><a name="l00534"></a><span class="lineno">  534</span> </div>
+<div class="line"><a name="l00535"></a><span class="lineno">  535</span>         <span class="keywordflow">for</span> (i = 1; i < nscience; i++) {</div>
+<div class="line"><a name="l00536"></a><span class="lineno">  536</span> </div>
+<div class="line"><a name="l00537"></a><span class="lineno">  537</span>             spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00538"></a><span class="lineno">  538</span> </div>
+<div class="line"><a name="l00539"></a><span class="lineno">  539</span>             <span class="keywordflow">if</span> (spectra) {</div>
+<div class="line"><a name="l00540"></a><span class="lineno">  540</span>                 cpl_image_divide_scalar(spectra, exptime[i]);</div>
+<div class="line"><a name="l00541"></a><span class="lineno">  541</span>                 cpl_imagelist_set(all_science, spectra, i);</div>
+<div class="line"><a name="l00542"></a><span class="lineno">  542</span>             }</div>
+<div class="line"><a name="l00543"></a><span class="lineno">  543</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00544"></a><span class="lineno">  544</span>                 vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l00545"></a><span class="lineno">  545</span> </div>
+<div class="line"><a name="l00546"></a><span class="lineno">  546</span>         }</div>
+<div class="line"><a name="l00547"></a><span class="lineno">  547</span> </div>
+<div class="line"><a name="l00548"></a><span class="lineno">  548</span>         spectra = cpl_imagelist_collapse_median_create(all_science);</div>
+<div class="line"><a name="l00549"></a><span class="lineno">  549</span>         cpl_image_multiply_scalar(spectra, alltime);</div>
+<div class="line"><a name="l00550"></a><span class="lineno">  550</span> </div>
+<div class="line"><a name="l00551"></a><span class="lineno">  551</span>         cpl_imagelist_delete(all_science);</div>
+<div class="line"><a name="l00552"></a><span class="lineno">  552</span>     }</div>
+<div class="line"><a name="l00553"></a><span class="lineno">  553</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00554"></a><span class="lineno">  554</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load scientific exposure..."</span>);</div>
+<div class="line"><a name="l00555"></a><span class="lineno">  555</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00556"></a><span class="lineno">  556</span> </div>
+<div class="line"><a name="l00557"></a><span class="lineno">  557</span>         header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l00558"></a><span class="lineno">  558</span> </div>
+<div class="line"><a name="l00559"></a><span class="lineno">  559</span>         <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00560"></a><span class="lineno">  560</span>             vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l00561"></a><span class="lineno">  561</span> </div>
+<div class="line"><a name="l00562"></a><span class="lineno">  562</span>         alltime = exptime[0] = cpl_propertylist_get_double(header, <span class="stringliteral">"EXPTIME"</span>);</div>
+<div class="line"><a name="l00563"></a><span class="lineno">  563</span> </div>
+<div class="line"><a name="l00564"></a><span class="lineno">  564</span>         <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00565"></a><span class="lineno">  565</span>             vimos_science_exit(<span class="stringliteral">"Missing keyword EXPTIME in scientific "</span></div>
+<div class="line"><a name="l00566"></a><span class="lineno">  566</span>                               <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00567"></a><span class="lineno">  567</span> </div>
+<div class="line"><a name="l00568"></a><span class="lineno">  568</span>         <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00569"></a><span class="lineno">  569</span>             airmass = <a class="code" href="group__fors__tools.html#ga0a6d06a61e61510f9bcf629f00fa160b" title="Compute average airmass.">fors_get_airmass</a>(header);</div>
+<div class="line"><a name="l00570"></a><span class="lineno">  570</span>             <span class="keywordflow">if</span> (airmass < 0.0)</div>
+<div class="line"><a name="l00571"></a><span class="lineno">  571</span>                 vimos_science_exit(<span class="stringliteral">"Missing airmass information in "</span></div>
+<div class="line"><a name="l00572"></a><span class="lineno">  572</span>                                    <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l00573"></a><span class="lineno">  573</span>         }</div>
+<div class="line"><a name="l00574"></a><span class="lineno">  574</span> </div>
+<div class="line"><a name="l00575"></a><span class="lineno">  575</span>         instrume = (<span class="keywordtype">char</span> *)cpl_propertylist_get_string(header, <span class="stringliteral">"INSTRUME"</span>);</div>
+<div class="line"><a name="l00576"></a><span class="lineno">  576</span>         <span class="keywordflow">if</span> (instrume == NULL)</div>
+<div class="line"><a name="l00577"></a><span class="lineno">  577</span>             vimos_science_exit(<span class="stringliteral">"Missing keyword INSTRUME "</span></div>
+<div class="line"><a name="l00578"></a><span class="lineno">  578</span>                                <span class="stringliteral">"in scientific frame header"</span>);</div>
+<div class="line"><a name="l00579"></a><span class="lineno">  579</span> </div>
+<div class="line"><a name="l00580"></a><span class="lineno">  580</span>         cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00581"></a><span class="lineno">  581</span> </div>
+<div class="line"><a name="l00582"></a><span class="lineno">  582</span>         cpl_msg_info(recipe, <span class="stringliteral">"Scientific frame exposure time: %.2f s"</span>, </div>
+<div class="line"><a name="l00583"></a><span class="lineno">  583</span>                      exptime[0]);</div>
+<div class="line"><a name="l00584"></a><span class="lineno">  584</span> </div>
+<div class="line"><a name="l00585"></a><span class="lineno">  585</span>         spectra = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, science_tag, CPL_TYPE_FLOAT, 0, 0);</div>
+<div class="line"><a name="l00586"></a><span class="lineno">  586</span>     }</div>
+<div class="line"><a name="l00587"></a><span class="lineno">  587</span> </div>
+<div class="line"><a name="l00588"></a><span class="lineno">  588</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00589"></a><span class="lineno">  589</span>         vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame"</span>);</div>
+<div class="line"><a name="l00590"></a><span class="lineno">  590</span> </div>
+<div class="line"><a name="l00591"></a><span class="lineno">  591</span>     cpl_free(exptime); exptime = NULL;</div>
+<div class="line"><a name="l00592"></a><span class="lineno">  592</span> </div>
+<div class="line"><a name="l00593"></a><span class="lineno">  593</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00594"></a><span class="lineno">  594</span> </div>
+<div class="line"><a name="l00595"></a><span class="lineno">  595</span> </div>
+<div class="line"><a name="l00596"></a><span class="lineno">  596</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00597"></a><span class="lineno">  597</span> <span class="comment">     * Get some info from header</span></div>
+<div class="line"><a name="l00598"></a><span class="lineno">  598</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00599"></a><span class="lineno">  599</span> </div>
+<div class="line"><a name="l00600"></a><span class="lineno">  600</span>     header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l00601"></a><span class="lineno">  601</span> </div>
+<div class="line"><a name="l00602"></a><span class="lineno">  602</span>     <span class="keywordflow">if</span> (header == NULL)</div>
+<div class="line"><a name="l00603"></a><span class="lineno">  603</span>         vimos_science_exit(<span class="stringliteral">"Cannot load scientific frame header"</span>);</div>
+<div class="line"><a name="l00604"></a><span class="lineno">  604</span> </div>
+<div class="line"><a name="l00605"></a><span class="lineno">  605</span>     quadrant = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO OCS CON QUAD"</span>);</div>
+<div class="line"><a name="l00606"></a><span class="lineno">  606</span> </div>
+<div class="line"><a name="l00607"></a><span class="lineno">  607</span>     <span class="keywordflow">switch</span> (quadrant) {</div>
+<div class="line"><a name="l00608"></a><span class="lineno">  608</span>     <span class="keywordflow">case</span> 1:</div>
+<div class="line"><a name="l00609"></a><span class="lineno">  609</span>         key_gris_name = <span class="stringliteral">"ESO INS GRIS1 NAME"</span>;</div>
+<div class="line"><a name="l00610"></a><span class="lineno">  610</span>         key_gris_id = <span class="stringliteral">"ESO INS GRIS1 ID"</span>;</div>
+<div class="line"><a name="l00611"></a><span class="lineno">  611</span>         key_filt_name = <span class="stringliteral">"ESO INS FILT1 NAME"</span>;</div>
+<div class="line"><a name="l00612"></a><span class="lineno">  612</span>         key_filt_id = <span class="stringliteral">"ESO INS FILT1 ID"</span>;</div>
+<div class="line"><a name="l00613"></a><span class="lineno">  613</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00614"></a><span class="lineno">  614</span>     <span class="keywordflow">case</span> 2: </div>
+<div class="line"><a name="l00615"></a><span class="lineno">  615</span>         key_gris_name = <span class="stringliteral">"ESO INS GRIS2 NAME"</span>;</div>
+<div class="line"><a name="l00616"></a><span class="lineno">  616</span>         key_gris_id = <span class="stringliteral">"ESO INS GRIS2 ID"</span>;</div>
+<div class="line"><a name="l00617"></a><span class="lineno">  617</span>         key_filt_name = <span class="stringliteral">"ESO INS FILT2 NAME"</span>;</div>
+<div class="line"><a name="l00618"></a><span class="lineno">  618</span>         key_filt_id = <span class="stringliteral">"ESO INS FILT2 ID"</span>;</div>
+<div class="line"><a name="l00619"></a><span class="lineno">  619</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00620"></a><span class="lineno">  620</span>     <span class="keywordflow">case</span> 3: </div>
+<div class="line"><a name="l00621"></a><span class="lineno">  621</span>         key_gris_name = <span class="stringliteral">"ESO INS GRIS3 NAME"</span>;</div>
+<div class="line"><a name="l00622"></a><span class="lineno">  622</span>         key_gris_id = <span class="stringliteral">"ESO INS GRIS3 ID"</span>;</div>
+<div class="line"><a name="l00623"></a><span class="lineno">  623</span>         key_filt_name = <span class="stringliteral">"ESO INS FILT3 NAME"</span>;</div>
+<div class="line"><a name="l00624"></a><span class="lineno">  624</span>         key_filt_id = <span class="stringliteral">"ESO INS FILT3 ID"</span>;</div>
+<div class="line"><a name="l00625"></a><span class="lineno">  625</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00626"></a><span class="lineno">  626</span>     <span class="keywordflow">case</span> 4:</div>
+<div class="line"><a name="l00627"></a><span class="lineno">  627</span>         key_gris_name = <span class="stringliteral">"ESO INS GRIS4 NAME"</span>;</div>
+<div class="line"><a name="l00628"></a><span class="lineno">  628</span>         key_gris_id = <span class="stringliteral">"ESO INS GRIS4 ID"</span>;</div>
+<div class="line"><a name="l00629"></a><span class="lineno">  629</span>         key_filt_name = <span class="stringliteral">"ESO INS FILT4 NAME"</span>;</div>
+<div class="line"><a name="l00630"></a><span class="lineno">  630</span>         key_filt_id = <span class="stringliteral">"ESO INS FILT4 ID"</span>;</div>
+<div class="line"><a name="l00631"></a><span class="lineno">  631</span>         <span class="keywordflow">break</span>;</div>
+<div class="line"><a name="l00632"></a><span class="lineno">  632</span>     }</div>
+<div class="line"><a name="l00633"></a><span class="lineno">  633</span> </div>
+<div class="line"><a name="l00634"></a><span class="lineno">  634</span>     <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l00635"></a><span class="lineno">  635</span>         <span class="keywordflow">if</span> (!anyframe) {</div>
+<div class="line"><a name="l00636"></a><span class="lineno">  636</span> </div>
+<div class="line"><a name="l00637"></a><span class="lineno">  637</span>            <span class="comment">/*</span></div>
+<div class="line"><a name="l00638"></a><span class="lineno">  638</span> <span class="comment">            *  As a default this recipe wouldn't reduce a frame belonging </span></div>
+<div class="line"><a name="l00639"></a><span class="lineno">  639</span> <span class="comment">            *  to a quadrant that is not expected to contain a standard </span></div>
+<div class="line"><a name="l00640"></a><span class="lineno">  640</span> <span class="comment">            *  star. The current template for getting data for photometric </span></div>
+<div class="line"><a name="l00641"></a><span class="lineno">  641</span> <span class="comment">            *  calibration consists of a sequence of 4 exposures, where </span></div>
+<div class="line"><a name="l00642"></a><span class="lineno">  642</span> <span class="comment">            *  the same standard star is moved through all quadrants. </span></div>
+<div class="line"><a name="l00643"></a><span class="lineno">  643</span> <span class="comment">            *  The first exposure has the standard star in quadrant 1, </span></div>
+<div class="line"><a name="l00644"></a><span class="lineno">  644</span> <span class="comment">            *  the second exposure in quadrant 2, and so on. So a standard </span></div>
+<div class="line"><a name="l00645"></a><span class="lineno">  645</span> <span class="comment">            *  star will be reduced only if it is part of a template of </span></div>
+<div class="line"><a name="l00646"></a><span class="lineno">  646</span> <span class="comment">            *  4 exposures (i.e., TPL NEXP == 4), and if its sequence </span></div>
+<div class="line"><a name="l00647"></a><span class="lineno">  647</span> <span class="comment">            *  number in the template is equal to its quadrant number </span></div>
+<div class="line"><a name="l00648"></a><span class="lineno">  648</span> <span class="comment">            *  (i.e., TPL EXPNO == OCS CON QUAD).</span></div>
+<div class="line"><a name="l00649"></a><span class="lineno">  649</span> <span class="comment">            */</span></div>
+<div class="line"><a name="l00650"></a><span class="lineno">  650</span> </div>
+<div class="line"><a name="l00651"></a><span class="lineno">  651</span>             nexp = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO TPL NEXP"</span>);</div>
+<div class="line"><a name="l00652"></a><span class="lineno">  652</span> </div>
+<div class="line"><a name="l00653"></a><span class="lineno">  653</span>             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00654"></a><span class="lineno">  654</span>                 vimos_science_exit(<span class="stringliteral">"Missing keyword ESO TPL NEXP in "</span></div>
+<div class="line"><a name="l00655"></a><span class="lineno">  655</span>                                     <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l00656"></a><span class="lineno">  656</span> </div>
+<div class="line"><a name="l00657"></a><span class="lineno">  657</span>             <span class="keywordflow">if</span> (nexp == 4) {</div>
+<div class="line"><a name="l00658"></a><span class="lineno">  658</span>                 expno = cpl_propertylist_get_int(header, <span class="stringliteral">"ESO TPL EXPNO"</span>);</div>
+<div class="line"><a name="l00659"></a><span class="lineno">  659</span> </div>
+<div class="line"><a name="l00660"></a><span class="lineno">  660</span>             <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00661"></a><span class="lineno">  661</span>                 vimos_science_exit(<span class="stringliteral">"Missing keyword ESO TPL EXPNO in "</span></div>
+<div class="line"><a name="l00662"></a><span class="lineno">  662</span>                                    <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l00663"></a><span class="lineno">  663</span>             }</div>
+<div class="line"><a name="l00664"></a><span class="lineno">  664</span> </div>
+<div class="line"><a name="l00665"></a><span class="lineno">  665</span>             <span class="keywordflow">if</span> (quadrant != expno) {</div>
+<div class="line"><a name="l00666"></a><span class="lineno">  666</span>                 cpl_msg_warning(recipe, <span class="stringliteral">"The MOS_STANDARD frame is not "</span></div>
+<div class="line"><a name="l00667"></a><span class="lineno">  667</span>                                 <span class="stringliteral">"expected to contain a standard star: "</span></div>
+<div class="line"><a name="l00668"></a><span class="lineno">  668</span>                                 <span class="stringliteral">"instrument response curve will not be "</span></div>
+<div class="line"><a name="l00669"></a><span class="lineno">  669</span>                                 <span class="stringliteral">"produced. Set --anyframe=true to skip "</span></div>
+<div class="line"><a name="l00670"></a><span class="lineno">  670</span>                                 <span class="stringliteral">"this check."</span>);</div>
+<div class="line"><a name="l00671"></a><span class="lineno">  671</span>                 standard = 0;</div>
+<div class="line"><a name="l00672"></a><span class="lineno">  672</span>             }</div>
+<div class="line"><a name="l00673"></a><span class="lineno">  673</span>         }</div>
+<div class="line"><a name="l00674"></a><span class="lineno">  674</span>     }</div>
+<div class="line"><a name="l00675"></a><span class="lineno">  675</span> </div>
+<div class="line"><a name="l00676"></a><span class="lineno">  676</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00677"></a><span class="lineno">  677</span> <span class="comment">    if (!dfs_equal_keyword(frameset, key_gris_id))</span></div>
+<div class="line"><a name="l00678"></a><span class="lineno">  678</span> <span class="comment">        vimos_science_exit("Input frames are not from the same grism");</span></div>
+<div class="line"><a name="l00679"></a><span class="lineno">  679</span> <span class="comment"></span></div>
+<div class="line"><a name="l00680"></a><span class="lineno">  680</span> <span class="comment">    if (!dfs_equal_keyword(frameset, key_filt_id))</span></div>
+<div class="line"><a name="l00681"></a><span class="lineno">  681</span> <span class="comment">        vimos_science_exit("Input frames are not from the same filter");</span></div>
+<div class="line"><a name="l00682"></a><span class="lineno">  682</span> <span class="comment">*/</span></div>
+<div class="line"><a name="l00683"></a><span class="lineno">  683</span> </div>
+<div class="line"><a name="l00684"></a><span class="lineno">  684</span>     gain = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 CONAD"</span>);</div>
+<div class="line"><a name="l00685"></a><span class="lineno">  685</span> </div>
+<div class="line"><a name="l00686"></a><span class="lineno">  686</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00687"></a><span class="lineno">  687</span>         vimos_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 CONAD in scientific "</span></div>
+<div class="line"><a name="l00688"></a><span class="lineno">  688</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00689"></a><span class="lineno">  689</span> </div>
+<div class="line"><a name="l00690"></a><span class="lineno">  690</span>     cpl_msg_info(recipe, <span class="stringliteral">"The gain factor is: %.2f e-/ADU"</span>, gain);</div>
+<div class="line"><a name="l00691"></a><span class="lineno">  691</span> </div>
+<div class="line"><a name="l00692"></a><span class="lineno">  692</span>     ron = cpl_propertylist_get_double(header, <span class="stringliteral">"ESO DET OUT1 RON"</span>);</div>
+<div class="line"><a name="l00693"></a><span class="lineno">  693</span> </div>
+<div class="line"><a name="l00694"></a><span class="lineno">  694</span>     <span class="keywordflow">if</span> (cpl_error_get_code() != CPL_ERROR_NONE)</div>
+<div class="line"><a name="l00695"></a><span class="lineno">  695</span>         vimos_science_exit(<span class="stringliteral">"Missing keyword ESO DET OUT1 RON in scientific "</span></div>
+<div class="line"><a name="l00696"></a><span class="lineno">  696</span>                           <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l00697"></a><span class="lineno">  697</span> </div>
+<div class="line"><a name="l00698"></a><span class="lineno">  698</span>     ron /= gain;     <span class="comment">/* Convert from electrons to ADU */</span></div>
+<div class="line"><a name="l00699"></a><span class="lineno">  699</span> </div>
+<div class="line"><a name="l00700"></a><span class="lineno">  700</span>     cpl_msg_info(recipe, <span class="stringliteral">"The read-out-noise is: %.2f ADU"</span>, ron);</div>
+<div class="line"><a name="l00701"></a><span class="lineno">  701</span> </div>
+<div class="line"><a name="l00702"></a><span class="lineno">  702</span>     <span class="comment">/* </span></div>
+<div class="line"><a name="l00703"></a><span class="lineno">  703</span> <span class="comment">     * In VIMOS data are "never" LSS. This is why this part is</span></div>
+<div class="line"><a name="l00704"></a><span class="lineno">  704</span> <span class="comment">     * commented out.</span></div>
+<div class="line"><a name="l00705"></a><span class="lineno">  705</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00706"></a><span class="lineno">  706</span> </div>
+<div class="line"><a name="l00707"></a><span class="lineno">  707</span> <span class="comment">//    maskslits = mos_load_slits_vimos(header);</span></div>
+<div class="line"><a name="l00708"></a><span class="lineno">  708</span> <span class="comment">//</span></div>
+<div class="line"><a name="l00709"></a><span class="lineno">  709</span> <span class="comment">//    /*</span></div>
+<div class="line"><a name="l00710"></a><span class="lineno">  710</span> <span class="comment">//     * Check if all slits have the same X offset: in such case,</span></div>
+<div class="line"><a name="l00711"></a><span class="lineno">  711</span> <span class="comment">//     * treat the observation as a long-slit one!</span></div>
+<div class="line"><a name="l00712"></a><span class="lineno">  712</span> <span class="comment">//     */</span></div>
+<div class="line"><a name="l00713"></a><span class="lineno">  713</span> <span class="comment">//</span></div>
+<div class="line"><a name="l00714"></a><span class="lineno">  714</span> <span class="comment">//    mxpos = cpl_table_get_column_median(maskslits, "ytop");</span></div>
+<div class="line"><a name="l00715"></a><span class="lineno">  715</span> <span class="comment">//    xpos = cpl_table_get_data_double(maskslits, "ytop");</span></div>
+<div class="line"><a name="l00716"></a><span class="lineno">  716</span> <span class="comment">//    nslits = cpl_table_get_nrow(maskslits);</span></div>
+<div class="line"><a name="l00717"></a><span class="lineno">  717</span> <span class="comment">//     </span></div>
+<div class="line"><a name="l00718"></a><span class="lineno">  718</span> <span class="comment">//    treat_as_lss = 1;</span></div>
+<div class="line"><a name="l00719"></a><span class="lineno">  719</span> <span class="comment">//    for (i = 0; i < nslits; i++) { </span></div>
+<div class="line"><a name="l00720"></a><span class="lineno">  720</span> <span class="comment">//        if (fabs(mxpos-xpos[i]) > 0.01) {</span></div>
+<div class="line"><a name="l00721"></a><span class="lineno">  721</span> <span class="comment">//            treat_as_lss = 0;</span></div>
+<div class="line"><a name="l00722"></a><span class="lineno">  722</span> <span class="comment">//            break;</span></div>
+<div class="line"><a name="l00723"></a><span class="lineno">  723</span> <span class="comment">//        }</span></div>
+<div class="line"><a name="l00724"></a><span class="lineno">  724</span> <span class="comment">//    }</span></div>
+<div class="line"><a name="l00725"></a><span class="lineno">  725</span> <span class="comment">//</span></div>
+<div class="line"><a name="l00726"></a><span class="lineno">  726</span> <span class="comment">//    treat_as_lss = 0;  // FIXME Prevent LSS treatment for the moment!!!</span></div>
+<div class="line"><a name="l00727"></a><span class="lineno">  727</span> <span class="comment">//</span></div>
+<div class="line"><a name="l00728"></a><span class="lineno">  728</span> <span class="comment">//    cpl_table_delete(maskslits); maskslits = NULL;</span></div>
+<div class="line"><a name="l00729"></a><span class="lineno">  729</span> <span class="comment">//</span></div>
+<div class="line"><a name="l00730"></a><span class="lineno">  730</span> <span class="comment">//    if (treat_as_lss) {</span></div>
+<div class="line"><a name="l00731"></a><span class="lineno">  731</span> <span class="comment">//        cpl_msg_warning(recipe, "All MOS slits have the same offset: %.2f\n"</span></div>
+<div class="line"><a name="l00732"></a><span class="lineno">  732</span> <span class="comment">//                        "The LSS data reduction strategy is applied!",</span></div>
+<div class="line"><a name="l00733"></a><span class="lineno">  733</span> <span class="comment">//                        mxpos);</span></div>
+<div class="line"><a name="l00734"></a><span class="lineno">  734</span> <span class="comment">//        skylines_offsets_tag   = "MOS_SKYLINES_OFFSETS_LONG";</span></div>
+<div class="line"><a name="l00735"></a><span class="lineno">  735</span> <span class="comment">//    }</span></div>
+<div class="line"><a name="l00736"></a><span class="lineno">  736</span> </div>
+<div class="line"><a name="l00737"></a><span class="lineno">  737</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00738"></a><span class="lineno">  738</span>         <span class="keywordflow">if</span> (skylocal) {</div>
+<div class="line"><a name="l00739"></a><span class="lineno">  739</span>             <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l00740"></a><span class="lineno">  740</span>                 vimos_science_exit(<span class="stringliteral">"Cosmic rays correction for long-slit-like "</span></div>
+<div class="line"><a name="l00741"></a><span class="lineno">  741</span>                                   <span class="stringliteral">"data requires --skyglobal=true"</span>);</div>
+<div class="line"><a name="l00742"></a><span class="lineno">  742</span>             skymedian = skylocal;</div>
+<div class="line"><a name="l00743"></a><span class="lineno">  743</span>             skylocal = 0;</div>
+<div class="line"><a name="l00744"></a><span class="lineno">  744</span>         }</div>
+<div class="line"><a name="l00745"></a><span class="lineno">  745</span>     }</div>
+<div class="line"><a name="l00746"></a><span class="lineno">  746</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00747"></a><span class="lineno">  747</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) == 0) {</div>
+<div class="line"><a name="l00748"></a><span class="lineno">  748</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, curv_coeff_tag);</div>
+<div class="line"><a name="l00749"></a><span class="lineno">  749</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00750"></a><span class="lineno">  750</span>         }</div>
+<div class="line"><a name="l00751"></a><span class="lineno">  751</span> </div>
+<div class="line"><a name="l00752"></a><span class="lineno">  752</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, curv_coeff_tag) > 1) {</div>
+<div class="line"><a name="l00753"></a><span class="lineno">  753</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, curv_coeff_tag);</div>
+<div class="line"><a name="l00754"></a><span class="lineno">  754</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00755"></a><span class="lineno">  755</span>         }</div>
+<div class="line"><a name="l00756"></a><span class="lineno">  756</span> </div>
+<div class="line"><a name="l00757"></a><span class="lineno">  757</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) == 0) {</div>
+<div class="line"><a name="l00758"></a><span class="lineno">  758</span>             cpl_msg_error(recipe, <span class="stringliteral">"Missing required input: %s"</span>, </div>
+<div class="line"><a name="l00759"></a><span class="lineno">  759</span>                           slit_location_tag);</div>
+<div class="line"><a name="l00760"></a><span class="lineno">  760</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00761"></a><span class="lineno">  761</span>         }</div>
+<div class="line"><a name="l00762"></a><span class="lineno">  762</span>         </div>
+<div class="line"><a name="l00763"></a><span class="lineno">  763</span>         <span class="keywordflow">if</span> (cpl_frameset_count_tags(frameset, slit_location_tag) > 1) {</div>
+<div class="line"><a name="l00764"></a><span class="lineno">  764</span>             cpl_msg_error(recipe, <span class="stringliteral">"Too many in input: %s"</span>, slit_location_tag);</div>
+<div class="line"><a name="l00765"></a><span class="lineno">  765</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00766"></a><span class="lineno">  766</span>         }</div>
+<div class="line"><a name="l00767"></a><span class="lineno">  767</span>     }</div>
+<div class="line"><a name="l00768"></a><span class="lineno">  768</span> </div>
+<div class="line"><a name="l00769"></a><span class="lineno">  769</span>     <span class="comment">/* Leave the header on for the next step... */</span></div>
+<div class="line"><a name="l00770"></a><span class="lineno">  770</span> </div>
+<div class="line"><a name="l00771"></a><span class="lineno">  771</span> </div>
+<div class="line"><a name="l00772"></a><span class="lineno">  772</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00773"></a><span class="lineno">  773</span> <span class="comment">     * Remove the master bias</span></div>
+<div class="line"><a name="l00774"></a><span class="lineno">  774</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00775"></a><span class="lineno">  775</span> </div>
+<div class="line"><a name="l00776"></a><span class="lineno">  776</span>     cpl_msg_info(recipe, <span class="stringliteral">"Remove the master bias..."</span>);</div>
+<div class="line"><a name="l00777"></a><span class="lineno">  777</span> </div>
+<div class="line"><a name="l00778"></a><span class="lineno">  778</span>     bias = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, <span class="stringliteral">"MASTER_BIAS"</span>, CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l00779"></a><span class="lineno">  779</span> </div>
+<div class="line"><a name="l00780"></a><span class="lineno">  780</span>     <span class="keywordflow">if</span> (bias == NULL)</div>
+<div class="line"><a name="l00781"></a><span class="lineno">  781</span>         vimos_science_exit(<span class="stringliteral">"Cannot load master bias"</span>);</div>
+<div class="line"><a name="l00782"></a><span class="lineno">  782</span> </div>
+<div class="line"><a name="l00783"></a><span class="lineno">  783</span>     overscans = <a class="code" href="group__moses.html#gaf4872d8e8654dd8733369c071843e464" title="Get the overscan positions from FITS header of VIMOS data.">mos_load_overscans_vimos</a>(header, 1);</div>
+<div class="line"><a name="l00784"></a><span class="lineno">  784</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l00785"></a><span class="lineno">  785</span>     dummy = <a class="code" href="group__moses.html#ga0516bbdd85d665b796da6c362e4aab36" title="Subtract the bias from a CCD exposure.">mos_remove_bias</a>(spectra, bias, overscans);</div>
+<div class="line"><a name="l00786"></a><span class="lineno">  786</span>     cpl_image_delete(spectra); spectra = dummy; dummy = NULL;</div>
+<div class="line"><a name="l00787"></a><span class="lineno">  787</span>     cpl_image_delete(bias); bias = NULL;</div>
+<div class="line"><a name="l00788"></a><span class="lineno">  788</span>     cpl_table_delete(overscans); overscans = NULL;</div>
+<div class="line"><a name="l00789"></a><span class="lineno">  789</span> </div>
+<div class="line"><a name="l00790"></a><span class="lineno">  790</span>     <span class="keywordflow">if</span> (spectra == NULL)</div>
+<div class="line"><a name="l00791"></a><span class="lineno">  791</span>         vimos_science_exit(<span class="stringliteral">"Cannot remove bias from scientific frame"</span>);</div>
+<div class="line"><a name="l00792"></a><span class="lineno">  792</span> </div>
+<div class="line"><a name="l00793"></a><span class="lineno">  793</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00794"></a><span class="lineno">  794</span> <span class="comment">     * Rotate frames horizontally with red to the right</span></div>
+<div class="line"><a name="l00795"></a><span class="lineno">  795</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00796"></a><span class="lineno">  796</span> </div>
+<div class="line"><a name="l00797"></a><span class="lineno">  797</span>     cpl_image_turn(spectra, rotate);</div>
+<div class="line"><a name="l00798"></a><span class="lineno">  798</span> </div>
+<div class="line"><a name="l00799"></a><span class="lineno">  799</span>     nx = cpl_image_get_size_x(spectra);</div>
+<div class="line"><a name="l00800"></a><span class="lineno">  800</span>     ny = cpl_image_get_size_y(spectra);</div>
+<div class="line"><a name="l00801"></a><span class="lineno">  801</span> </div>
+<div class="line"><a name="l00802"></a><span class="lineno">  802</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00803"></a><span class="lineno">  803</span>     cpl_msg_info(recipe, <span class="stringliteral">"Load normalised flat field (if present)..."</span>);</div>
+<div class="line"><a name="l00804"></a><span class="lineno">  804</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00805"></a><span class="lineno">  805</span> </div>
+<div class="line"><a name="l00806"></a><span class="lineno">  806</span>     <span class="keywordflow">if</span> (flatfield) {</div>
+<div class="line"><a name="l00807"></a><span class="lineno">  807</span> </div>
+<div class="line"><a name="l00808"></a><span class="lineno">  808</span>         norm_flat = <a class="code" href="group__forsdfs.html#ga326130afab421ef30992def2a444d660" title="Loading image data of given category.">dfs_load_image</a>(frameset, master_norm_flat_tag, </div>
+<div class="line"><a name="l00809"></a><span class="lineno">  809</span>                                    CPL_TYPE_FLOAT, 0, 1);</div>
+<div class="line"><a name="l00810"></a><span class="lineno">  810</span> </div>
+<div class="line"><a name="l00811"></a><span class="lineno">  811</span>         <span class="keywordflow">if</span> (norm_flat) {</div>
+<div class="line"><a name="l00812"></a><span class="lineno">  812</span>             cpl_image_turn(norm_flat, rotate);</div>
+<div class="line"><a name="l00813"></a><span class="lineno">  813</span>             cpl_msg_info(recipe, <span class="stringliteral">"Apply flat field correction..."</span>);</div>
+<div class="line"><a name="l00814"></a><span class="lineno">  814</span>             <span class="keywordflow">if</span> (cpl_image_divide(spectra, norm_flat) != CPL_ERROR_NONE) {</div>
+<div class="line"><a name="l00815"></a><span class="lineno">  815</span>                 cpl_msg_error(recipe, <span class="stringliteral">"Failure of flat field correction: %s"</span>,</div>
+<div class="line"><a name="l00816"></a><span class="lineno">  816</span>                               cpl_error_get_message());</div>
+<div class="line"><a name="l00817"></a><span class="lineno">  817</span>                 vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00818"></a><span class="lineno">  818</span>             }</div>
+<div class="line"><a name="l00819"></a><span class="lineno">  819</span>             cpl_image_delete(norm_flat); norm_flat = NULL;</div>
+<div class="line"><a name="l00820"></a><span class="lineno">  820</span>         }</div>
+<div class="line"><a name="l00821"></a><span class="lineno">  821</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00822"></a><span class="lineno">  822</span>             cpl_msg_error(recipe, <span class="stringliteral">"Cannot load input %s for flat field "</span></div>
+<div class="line"><a name="l00823"></a><span class="lineno">  823</span>                           <span class="stringliteral">"correction"</span>, master_norm_flat_tag);</div>
+<div class="line"><a name="l00824"></a><span class="lineno">  824</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00825"></a><span class="lineno">  825</span>         }</div>
+<div class="line"><a name="l00826"></a><span class="lineno">  826</span> </div>
+<div class="line"><a name="l00827"></a><span class="lineno">  827</span>     }</div>
+<div class="line"><a name="l00828"></a><span class="lineno">  828</span> </div>
+<div class="line"><a name="l00829"></a><span class="lineno">  829</span> </div>
+<div class="line"><a name="l00830"></a><span class="lineno">  830</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l00831"></a><span class="lineno">  831</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l00832"></a><span class="lineno">  832</span>         cpl_msg_info(recipe, <span class="stringliteral">"Load input sky line catalog..."</span>);</div>
+<div class="line"><a name="l00833"></a><span class="lineno">  833</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l00834"></a><span class="lineno">  834</span> </div>
+<div class="line"><a name="l00835"></a><span class="lineno">  835</span>         wavelengths = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"SKY_LINE_CATALOG"</span>, 1);</div>
+<div class="line"><a name="l00836"></a><span class="lineno">  836</span> </div>
+<div class="line"><a name="l00837"></a><span class="lineno">  837</span>         <span class="keywordflow">if</span> (wavelengths) {</div>
+<div class="line"><a name="l00838"></a><span class="lineno">  838</span> </div>
+<div class="line"><a name="l00839"></a><span class="lineno">  839</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l00840"></a><span class="lineno">  840</span> <span class="comment">             * Cast the wavelengths into a (double precision) CPL vector</span></div>
+<div class="line"><a name="l00841"></a><span class="lineno">  841</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l00842"></a><span class="lineno">  842</span> </div>
+<div class="line"><a name="l00843"></a><span class="lineno">  843</span>             nlines = cpl_table_get_nrow(wavelengths);</div>
+<div class="line"><a name="l00844"></a><span class="lineno">  844</span> </div>
+<div class="line"><a name="l00845"></a><span class="lineno">  845</span>             <span class="keywordflow">if</span> (nlines == 0)</div>
+<div class="line"><a name="l00846"></a><span class="lineno">  846</span>                 vimos_science_exit(<span class="stringliteral">"Empty input sky line catalog"</span>);</div>
+<div class="line"><a name="l00847"></a><span class="lineno">  847</span> </div>
+<div class="line"><a name="l00848"></a><span class="lineno">  848</span>             <span class="keywordflow">if</span> (cpl_table_has_column(wavelengths, wcolumn) != 1) {</div>
+<div class="line"><a name="l00849"></a><span class="lineno">  849</span>                 cpl_msg_error(recipe, <span class="stringliteral">"Missing column %s in input line "</span></div>
+<div class="line"><a name="l00850"></a><span class="lineno">  850</span>                               <span class="stringliteral">"catalog table"</span>, wcolumn);</div>
+<div class="line"><a name="l00851"></a><span class="lineno">  851</span>                 vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00852"></a><span class="lineno">  852</span>             }</div>
+<div class="line"><a name="l00853"></a><span class="lineno">  853</span> </div>
+<div class="line"><a name="l00854"></a><span class="lineno">  854</span>             line = cpl_malloc(nlines * <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>));</div>
+<div class="line"><a name="l00855"></a><span class="lineno">  855</span>     </div>
+<div class="line"><a name="l00856"></a><span class="lineno">  856</span>             <span class="keywordflow">for</span> (i = 0; i < nlines; i++)</div>
+<div class="line"><a name="l00857"></a><span class="lineno">  857</span>                 line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);</div>
+<div class="line"><a name="l00858"></a><span class="lineno">  858</span> </div>
+<div class="line"><a name="l00859"></a><span class="lineno">  859</span>             cpl_table_delete(wavelengths); wavelengths = NULL;</div>
+<div class="line"><a name="l00860"></a><span class="lineno">  860</span> </div>
+<div class="line"><a name="l00861"></a><span class="lineno">  861</span>             lines = cpl_vector_wrap(nlines, line);</div>
+<div class="line"><a name="l00862"></a><span class="lineno">  862</span>         }</div>
+<div class="line"><a name="l00863"></a><span class="lineno">  863</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00864"></a><span class="lineno">  864</span>             cpl_msg_info(recipe, <span class="stringliteral">"No sky line catalog found in input - fine!"</span>);</div>
+<div class="line"><a name="l00865"></a><span class="lineno">  865</span>         }</div>
+<div class="line"><a name="l00866"></a><span class="lineno">  866</span>     }</div>
+<div class="line"><a name="l00867"></a><span class="lineno">  867</span> </div>
+<div class="line"><a name="l00868"></a><span class="lineno">  868</span> </div>
+<div class="line"><a name="l00869"></a><span class="lineno">  869</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00870"></a><span class="lineno">  870</span> <span class="comment">     * Load the spectral curvature table, or provide a dummy one</span></div>
+<div class="line"><a name="l00871"></a><span class="lineno">  871</span> <span class="comment">     * in case of LSS-like data (single slit with flat curvature)</span></div>
+<div class="line"><a name="l00872"></a><span class="lineno">  872</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00873"></a><span class="lineno">  873</span> </div>
+<div class="line"><a name="l00874"></a><span class="lineno">  874</span>     <span class="keywordflow">if</span> (!treat_as_lss) {</div>
+<div class="line"><a name="l00875"></a><span class="lineno">  875</span>         polytraces = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, curv_coeff_tag, 1);</div>
+<div class="line"><a name="l00876"></a><span class="lineno">  876</span>         <span class="keywordflow">if</span> (polytraces == NULL)</div>
+<div class="line"><a name="l00877"></a><span class="lineno">  877</span>             vimos_science_exit(<span class="stringliteral">"Cannot load spectral curvature table"</span>);</div>
+<div class="line"><a name="l00878"></a><span class="lineno">  878</span>     }</div>
+<div class="line"><a name="l00879"></a><span class="lineno">  879</span> </div>
+<div class="line"><a name="l00880"></a><span class="lineno">  880</span> </div>
+<div class="line"><a name="l00881"></a><span class="lineno">  881</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00882"></a><span class="lineno">  882</span> <span class="comment">     * Load the slit location table, or provide a dummy one in case</span></div>
+<div class="line"><a name="l00883"></a><span class="lineno">  883</span> <span class="comment">     * of LSS-like data (single slit spanning whole image)</span></div>
+<div class="line"><a name="l00884"></a><span class="lineno">  884</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00885"></a><span class="lineno">  885</span> </div>
+<div class="line"><a name="l00886"></a><span class="lineno">  886</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00887"></a><span class="lineno">  887</span>         slits = cpl_table_new(1);</div>
+<div class="line"><a name="l00888"></a><span class="lineno">  888</span>         cpl_table_new_column(slits, <span class="stringliteral">"slit_id"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00889"></a><span class="lineno">  889</span>         cpl_table_set_int(slits, <span class="stringliteral">"slit_id"</span>, 0, 1);</div>
+<div class="line"><a name="l00890"></a><span class="lineno">  890</span>         cpl_table_new_column(slits, <span class="stringliteral">"position"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00891"></a><span class="lineno">  891</span>         cpl_table_set_int(slits, <span class="stringliteral">"position"</span>, 0, 0);</div>
+<div class="line"><a name="l00892"></a><span class="lineno">  892</span>         cpl_table_new_column(slits, <span class="stringliteral">"length"</span>, CPL_TYPE_INT);</div>
+<div class="line"><a name="l00893"></a><span class="lineno">  893</span>         cpl_table_set_int(slits, <span class="stringliteral">"length"</span>, 0, ny);</div>
+<div class="line"><a name="l00894"></a><span class="lineno">  894</span>     }</div>
+<div class="line"><a name="l00895"></a><span class="lineno">  895</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00896"></a><span class="lineno">  896</span>         slits = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, slit_location_tag, 1);</div>
+<div class="line"><a name="l00897"></a><span class="lineno">  897</span>         <span class="keywordflow">if</span> (slits == NULL)</div>
+<div class="line"><a name="l00898"></a><span class="lineno">  898</span>             vimos_science_exit(<span class="stringliteral">"Cannot load slits location table"</span>);</div>
+<div class="line"><a name="l00899"></a><span class="lineno">  899</span>         <a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f" title="Rotate a slit location table.">mos_rotate_slits</a>(slits, -rotate, nx, ny);</div>
+<div class="line"><a name="l00900"></a><span class="lineno">  900</span>     }</div>
+<div class="line"><a name="l00901"></a><span class="lineno">  901</span> </div>
+<div class="line"><a name="l00902"></a><span class="lineno">  902</span> </div>
+<div class="line"><a name="l00903"></a><span class="lineno">  903</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00904"></a><span class="lineno">  904</span> <span class="comment">     * Load the wavelength calibration table</span></div>
+<div class="line"><a name="l00905"></a><span class="lineno">  905</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00906"></a><span class="lineno">  906</span> </div>
+<div class="line"><a name="l00907"></a><span class="lineno">  907</span>     idscoeff = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, disp_coeff_tag, 1);</div>
+<div class="line"><a name="l00908"></a><span class="lineno">  908</span>     <span class="keywordflow">if</span> (idscoeff == NULL)</div>
+<div class="line"><a name="l00909"></a><span class="lineno">  909</span>         vimos_science_exit(<span class="stringliteral">"Cannot load wavelength calibration table"</span>);</div>
+<div class="line"><a name="l00910"></a><span class="lineno">  910</span> </div>
+<div class="line"><a name="l00911"></a><span class="lineno">  911</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l00912"></a><span class="lineno">  912</span>     cpl_msg_info(recipe, <span class="stringliteral">"Processing scientific spectra..."</span>);</div>
+<div class="line"><a name="l00913"></a><span class="lineno">  913</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l00914"></a><span class="lineno">  914</span> </div>
+<div class="line"><a name="l00915"></a><span class="lineno">  915</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00916"></a><span class="lineno">  916</span> <span class="comment">     * This one will also generate the spatial map from the spectral </span></div>
+<div class="line"><a name="l00917"></a><span class="lineno">  917</span> <span class="comment">     * curvature table (in the case of multislit data)</span></div>
+<div class="line"><a name="l00918"></a><span class="lineno">  918</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00919"></a><span class="lineno">  919</span> </div>
+<div class="line"><a name="l00920"></a><span class="lineno">  920</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00921"></a><span class="lineno">  921</span>         smapped = cpl_image_duplicate(spectra);</div>
+<div class="line"><a name="l00922"></a><span class="lineno">  922</span>     }</div>
+<div class="line"><a name="l00923"></a><span class="lineno">  923</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00924"></a><span class="lineno">  924</span>         coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l00925"></a><span class="lineno">  925</span> </div>
+<div class="line"><a name="l00926"></a><span class="lineno">  926</span>         smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l00927"></a><span class="lineno">  927</span>                                           startwavelength, endwavelength,</div>
+<div class="line"><a name="l00928"></a><span class="lineno">  928</span>                                           dispersion, flux, coordinate);</div>
+<div class="line"><a name="l00929"></a><span class="lineno">  929</span>     }</div>
+<div class="line"><a name="l00930"></a><span class="lineno">  930</span> </div>
+<div class="line"><a name="l00931"></a><span class="lineno">  931</span> </div>
+<div class="line"><a name="l00932"></a><span class="lineno">  932</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l00933"></a><span class="lineno">  933</span> <span class="comment">     * Generate a rectified wavelength map from the wavelength calibration </span></div>
+<div class="line"><a name="l00934"></a><span class="lineno">  934</span> <span class="comment">     * table</span></div>
+<div class="line"><a name="l00935"></a><span class="lineno">  935</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l00936"></a><span class="lineno">  936</span> </div>
+<div class="line"><a name="l00937"></a><span class="lineno">  937</span>     rainbow = <a class="code" href="group__moses.html#gacec86a61ea4c2b653a551eb067fbcfb5" title="Create a wavelengths map from an IDS coefficients table.">mos_map_idscoeff</a>(idscoeff, nx, reference, startwavelength, </div>
+<div class="line"><a name="l00938"></a><span class="lineno">  938</span>                                endwavelength);</div>
+<div class="line"><a name="l00939"></a><span class="lineno">  939</span> </div>
+<div class="line"><a name="l00940"></a><span class="lineno">  940</span>     <span class="keywordflow">if</span> (dispersion > 1.0)</div>
+<div class="line"><a name="l00941"></a><span class="lineno">  941</span>         highres = 0;</div>
+<div class="line"><a name="l00942"></a><span class="lineno">  942</span>     <span class="keywordflow">else</span></div>
+<div class="line"><a name="l00943"></a><span class="lineno">  943</span>         highres = 1;</div>
+<div class="line"><a name="l00944"></a><span class="lineno">  944</span> </div>
+<div class="line"><a name="l00945"></a><span class="lineno">  945</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l00946"></a><span class="lineno">  946</span>         <span class="keywordflow">if</span> (skyalign) {</div>
+<div class="line"><a name="l00947"></a><span class="lineno">  947</span>             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l00948"></a><span class="lineno">  948</span>             <span class="stringliteral">"skylines applying %d order residual fit..."</span>, skyalign);</div>
+<div class="line"><a name="l00949"></a><span class="lineno">  949</span>         }</div>
+<div class="line"><a name="l00950"></a><span class="lineno">  950</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00951"></a><span class="lineno">  951</span>             cpl_msg_info(recipe, <span class="stringliteral">"Align wavelength solution to reference "</span></div>
+<div class="line"><a name="l00952"></a><span class="lineno">  952</span>             <span class="stringliteral">"skylines applying median offset..."</span>);</div>
+<div class="line"><a name="l00953"></a><span class="lineno">  953</span>         }</div>
+<div class="line"><a name="l00954"></a><span class="lineno">  954</span> </div>
+<div class="line"><a name="l00955"></a><span class="lineno">  955</span>         <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00956"></a><span class="lineno">  956</span>             offsets = <a class="code" href="group__moses.html#ga2a7590eb0c36a08b61e08e180d7277d1" title="Modify the input wavelength solution to match reference sky lines (LSS).">mos_wavelength_align_lss</a>(smapped, reference, </div>
+<div class="line"><a name="l00957"></a><span class="lineno">  957</span>                                                startwavelength, endwavelength, </div>
+<div class="line"><a name="l00958"></a><span class="lineno">  958</span>                                                idscoeff, lines, highres, </div>
+<div class="line"><a name="l00959"></a><span class="lineno">  959</span>                                                skyalign, rainbow, 4);</div>
+<div class="line"><a name="l00960"></a><span class="lineno">  960</span>         }</div>
+<div class="line"><a name="l00961"></a><span class="lineno">  961</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00962"></a><span class="lineno">  962</span>             offsets = <a class="code" href="group__moses.html#ga634eb7408671a139e7015185776f4513" title="Modify the input wavelength solution to match reference sky lines.">mos_wavelength_align</a>(smapped, slits, reference, </div>
+<div class="line"><a name="l00963"></a><span class="lineno">  963</span>                                            startwavelength, endwavelength, </div>
+<div class="line"><a name="l00964"></a><span class="lineno">  964</span>                                            idscoeff, lines, highres, skyalign, </div>
+<div class="line"><a name="l00965"></a><span class="lineno">  965</span>                                            rainbow, 4);</div>
+<div class="line"><a name="l00966"></a><span class="lineno">  966</span>         }</div>
+<div class="line"><a name="l00967"></a><span class="lineno">  967</span> </div>
+<div class="line"><a name="l00968"></a><span class="lineno">  968</span>         cpl_vector_delete(lines); lines = NULL;</div>
+<div class="line"><a name="l00969"></a><span class="lineno">  969</span> </div>
+<div class="line"><a name="l00970"></a><span class="lineno">  970</span>         <span class="keywordflow">if</span> (offsets) {</div>
+<div class="line"><a name="l00971"></a><span class="lineno">  971</span>             <span class="keywordflow">if</span> (standard)</div>
+<div class="line"><a name="l00972"></a><span class="lineno">  972</span>                 cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span></div>
+<div class="line"><a name="l00973"></a><span class="lineno">  973</span>                                 <span class="stringliteral">"to reference sky lines may be unreliable in "</span></div>
+<div class="line"><a name="l00974"></a><span class="lineno">  974</span>                                 <span class="stringliteral">"this case!"</span>);</div>
+<div class="line"><a name="l00975"></a><span class="lineno">  975</span> </div>
+<div class="line"><a name="l00976"></a><span class="lineno">  976</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, offsets, skylines_offsets_tag, NULL, </div>
+<div class="line"><a name="l00977"></a><span class="lineno">  977</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l00978"></a><span class="lineno">  978</span>                 vimos_science_exit(NULL);</div>
+<div class="line"><a name="l00979"></a><span class="lineno">  979</span> </div>
+<div class="line"><a name="l00980"></a><span class="lineno">  980</span>             cpl_table_delete(offsets); offsets = NULL;</div>
+<div class="line"><a name="l00981"></a><span class="lineno">  981</span>         }</div>
+<div class="line"><a name="l00982"></a><span class="lineno">  982</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00983"></a><span class="lineno">  983</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Alignment of the wavelength solution "</span></div>
+<div class="line"><a name="l00984"></a><span class="lineno">  984</span>                             <span class="stringliteral">"to reference sky lines could not be done!"</span>);</div>
+<div class="line"><a name="l00985"></a><span class="lineno">  985</span>             skyalign = -1;</div>
+<div class="line"><a name="l00986"></a><span class="lineno">  986</span>         }</div>
+<div class="line"><a name="l00987"></a><span class="lineno">  987</span> </div>
+<div class="line"><a name="l00988"></a><span class="lineno">  988</span>     }</div>
+<div class="line"><a name="l00989"></a><span class="lineno">  989</span> </div>
+<div class="line"><a name="l00990"></a><span class="lineno">  990</span>     <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l00991"></a><span class="lineno">  991</span>         wavemap = rainbow;</div>
+<div class="line"><a name="l00992"></a><span class="lineno">  992</span>         rainbow = NULL;</div>
+<div class="line"><a name="l00993"></a><span class="lineno">  993</span>     }</div>
+<div class="line"><a name="l00994"></a><span class="lineno">  994</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l00995"></a><span class="lineno">  995</span>         wavemap = <a class="code" href="group__moses.html#ga2255ec2a344cd3c6f579179c538669b7" title="Remapping of spatially rectified wavelengths to original CCD pixels.">mos_map_wavelengths</a>(coordinate, rainbow, slits, </div>
+<div class="line"><a name="l00996"></a><span class="lineno">  996</span>                                       polytraces, reference, </div>
+<div class="line"><a name="l00997"></a><span class="lineno">  997</span>                                       startwavelength, endwavelength,</div>
+<div class="line"><a name="l00998"></a><span class="lineno">  998</span>                                       dispersion);</div>
+<div class="line"><a name="l00999"></a><span class="lineno">  999</span>     }</div>
+<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span> </div>
+<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>     cpl_image_delete(rainbow); rainbow = NULL;</div>
+<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>     cpl_image_delete(coordinate); coordinate = NULL;</div>
+<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span> </div>
+<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>     <span class="comment">/*</span></div>
+<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span> <span class="comment">     * Here the wavelength calibrated slit spectra are created. This frame</span></div>
+<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span> <span class="comment">     * contains sky_science.</span></div>
+<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span> <span class="comment">     */</span></div>
+<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span> </div>
+<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>     mapped_sky = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, reference,</div>
+<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>                                             startwavelength, endwavelength,</div>
+<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>                                             dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span> </div>
+<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>     cpl_msg_indent_less();</div>
+<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>     cpl_msg_info(recipe, <span class="stringliteral">"Check applied wavelength against skylines..."</span>);</div>
+<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>     cpl_msg_indent_more();</div>
+<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span> </div>
+<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>     mean_rms = <a class="code" href="group__moses.html#gae1dbf0de952775b1619a3c636221e2a2" title="Estimate the spectral distortion modeling goodness.">mos_distortions_rms</a>(mapped_sky, NULL, startwavelength,</div>
+<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>                                    dispersion, 6, highres);</div>
+<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span> </div>
+<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean residual: %f"</span>, mean_rms);</div>
+<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span> </div>
+<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>     mean_rms = cpl_table_get_column_mean(idscoeff, <span class="stringliteral">"error"</span>);</div>
+<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span> </div>
+<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>     cpl_msg_info(recipe, <span class="stringliteral">"Mean model accuracy: %f pixel (%f A)"</span>,</div>
+<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>                  mean_rms, mean_rms * dispersion);</div>
+<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span> </div>
+<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>     header = cpl_propertylist_new();</div>
+<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX1"</span>, 1.0);</div>
+<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRPIX2"</span>, 1.0);</div>
+<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL1"</span>, </div>
+<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>                                    startwavelength + dispersion/2);</div>
+<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CRVAL2"</span>, 1.0);</div>
+<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>     <span class="comment">/* cpl_propertylist_update_double(header, "CDELT1", dispersion);</span></div>
+<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span> <span class="comment">    cpl_propertylist_update_double(header, "CDELT2", 1.0); */</span></div>
+<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_1"</span>, dispersion);</div>
+<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD1_2"</span>, 0.0);</div>
+<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_1"</span>, 0.0);</div>
+<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>     cpl_propertylist_update_double(header, <span class="stringliteral">"CD2_2"</span>, 1.0);</div>
+<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE1"</span>, <span class="stringliteral">"LINEAR"</span>);</div>
+<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>     cpl_propertylist_update_string(header, <span class="stringliteral">"CTYPE2"</span>, <span class="stringliteral">"PIXEL"</span>);</div>
+<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span> </div>
+<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>     <span class="keywordflow">if</span> (time_normalise) {</div>
+<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>         dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);</div>
+<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, dummy, mapped_science_sky_tag, header, </div>
+<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>         cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>     }</div>
+<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>     <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, mapped_sky, mapped_science_sky_tag, </div>
+<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>                            header, parlist, recipe, version))</div>
+<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>     }</div>
+<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span> </div>
+<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>     <span class="keywordflow">if</span> (skyglobal == 0 && skymedian == 0 && skylocal == 0) {</div>
+<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>         cpl_image_delete(mapped_sky); mapped_sky = NULL;</div>
+<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>     }</div>
+<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span> </div>
+<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>     <span class="keywordflow">if</span> (skyglobal || skylocal) {</div>
+<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span> </div>
+<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span> </div>
+<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>         <span class="keywordflow">if</span> (skyglobal) {</div>
+<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>             cpl_msg_info(recipe, <span class="stringliteral">"Global sky determination..."</span>);</div>
+<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>             skymap = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>             sky = <a class="code" href="group__moses.html#ga80b4941dee0d34102ac3d4f5fb15674d" title="Create a CCD median sky map.">mos_sky_map_super</a>(spectra, wavemap, dispersion, </div>
+<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>                                     2.0, 50, skymap);</div>
+<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>             <span class="keywordflow">if</span> (sky)</div>
+<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>                 cpl_image_subtract(spectra, skymap);</div>
+<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>             <span class="keywordflow">else</span></div>
+<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>                 cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>         }</div>
+<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>             cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>             cpl_msg_indent_more();</div>
+<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>             skymap = <a class="code" href="group__moses.html#ga0b6cf7b940f617da9ec3f9ce7a9610e2" title="Subtract the sky from the scientific CCD exposure.">mos_subtract_sky</a>(spectra, slits, polytraces, reference,</div>
+<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>                            startwavelength, endwavelength, dispersion);</div>
+<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>         }</div>
+<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span> </div>
+<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>         <span class="keywordflow">if</span> (skymap) {</div>
+<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>             <span class="keywordflow">if</span> (skyglobal) {</div>
+<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>                 <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>                     cpl_table_divide_scalar(sky, <span class="stringliteral">"sky"</span>, alltime);</div>
+<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>                 <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, sky, global_sky_spectrum_tag, </div>
+<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>                                    NULL, parlist, recipe, version))</div>
+<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>                     vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>     </div>
+<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>                 cpl_table_delete(sky); sky = NULL;</div>
+<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>             }</div>
+<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span> </div>
+<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>             save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span> </div>
+<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>             <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>                 cpl_image_divide_scalar(skymap, alltime);</div>
+<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>             cpl_image_turn(skymap, rotate_back);</div>
+<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, skymap, unmapped_sky_tag,</div>
+<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>                                save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>                 vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span> </div>
+<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>             cpl_image_delete(skymap); skymap = NULL;</div>
+<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span> </div>
+<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>             cpl_image_turn(spectra, rotate_back);</div>
+<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span> </div>
+<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>             <span class="keywordflow">if</span> (cosmics) {</div>
+<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>                 cpl_msg_info(recipe, <span class="stringliteral">"Removing cosmic rays..."</span>);</div>
+<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>                 <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(spectra, gain, -1., -1.);</div>
+<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>             }</div>
+<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span> </div>
+<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, spectra, unmapped_science_tag,</div>
+<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>                                save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>                 vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>             cpl_image_turn(spectra, rotate);</div>
+<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span> </div>
+<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>             cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span> <span class="comment">/* Cosmics was here */</span></div>
+<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>             <span class="comment">/*</span></div>
+<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span> <span class="comment">             * The spatially rectified image, that contained the sky,</span></div>
+<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span> <span class="comment">             * is replaced by a sky-subtracted spatially rectified image:</span></div>
+<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span> <span class="comment">             */</span></div>
+<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span> </div>
+<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>             cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span> </div>
+<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>             <span class="keywordflow">if</span> (treat_as_lss) {</div>
+<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>                 smapped = cpl_image_duplicate(spectra);</div>
+<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>             }</div>
+<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>             <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>                 smapped = <a class="code" href="group__moses.html#ga6910eeaa28338a6d447e74130666fe13" title="Spatial remapping of CCD spectra eliminating the spectral curvature.">mos_spatial_calibration</a>(spectra, slits, polytraces, </div>
+<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>                                                   reference, startwavelength, </div>
+<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>                                                   endwavelength, dispersion, </div>
+<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>                                                   flux, NULL);</div>
+<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>             }</div>
+<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>         }</div>
+<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>             cpl_msg_warning(recipe, <span class="stringliteral">"Sky subtraction failure"</span>);</div>
+<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>             <span class="keywordflow">if</span> (cosmics)</div>
+<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>                 cpl_msg_warning(recipe, <span class="stringliteral">"Cosmic rays removal not performed!"</span>);</div>
+<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>             cosmics = skylocal = skyglobal = 0;</div>
+<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>         }</div>
+<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>     }</div>
+<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span> </div>
+<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>     cpl_image_delete(spectra); spectra = NULL;</div>
+<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>     cpl_table_delete(polytraces); polytraces = NULL;</div>
+<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span> </div>
+<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>         save_header = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>         cpl_image_turn(wavemap, rotate_back);</div>
+<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, wavemap, wavelength_map_sky_tag,</div>
+<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>                            save_header, parlist, recipe, version))</div>
+<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>         cpl_propertylist_delete(save_header); save_header = NULL;</div>
+<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>     }</div>
+<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span> </div>
+<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>     cpl_image_delete(wavemap); wavemap = NULL;</div>
+<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span> </div>
+<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>     mapped = <a class="code" href="group__moses.html#ga5c5f54b99d64a52b9d90d65bf7421b6b" title="Remap at constant wavelength step an image of rectified scientific spectra.">mos_wavelength_calibration</a>(smapped, reference,</div>
+<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>                                         startwavelength, endwavelength,</div>
+<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>                                         dispersion, idscoeff, flux);</div>
+<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span> </div>
+<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>     cpl_image_delete(smapped); smapped = NULL;</div>
+<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span> </div>
+<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>     <span class="keywordflow">if</span> (skymedian) {</div>
+<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>         cpl_msg_info(recipe, <span class="stringliteral">"Local sky determination..."</span>);</div>
+<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>     </div>
+<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>         skylocalmap = <a class="code" href="group__moses.html#ga0185eec52be96d5aa325e8fd045406c8" title="Local determination of sky.">mos_sky_local_old</a>(mapped, slits);       </div>
+<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>         cpl_image_subtract(mapped, skylocalmap);</div>
+<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>         cpl_image_delete(skylocalmap); skylocalmap = NULL;</div>
+<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>     }</div>
+<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span> </div>
+<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {</div>
+<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span> </div>
+<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>         skylocalmap = cpl_image_subtract_create(mapped_sky, mapped);</div>
+<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span> </div>
+<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>         cpl_image_delete(mapped_sky); mapped_sky = NULL;</div>
+<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span> </div>
+<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>         <span class="keywordflow">if</span> (time_normalise) {</div>
+<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>             dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);</div>
+<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, dummy, mapped_sky_tag, header,</div>
+<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>                 vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>             cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>         }</div>
+<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, skylocalmap, mapped_sky_tag, header,</div>
+<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>                 vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>         }</div>
+<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span> </div>
+<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>         cpl_msg_info(recipe, <span class="stringliteral">"Object detection..."</span>);</div>
+<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span> </div>
+<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>         <span class="keywordflow">if</span> (cosmics || nscience > 1) {</div>
+<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>             dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped, slits, slit_margin, ext_radius, </div>
+<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>                                        cont_radius);</div>
+<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>         }</div>
+<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>             mapped_cleaned = cpl_image_duplicate(mapped);</div>
+<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>             <a class="code" href="group__moses.html#ga1063de1ae8b4d345ea9ccf584e3a5f1a" title="Remove cosmic rays from sky-subtracted CCD spectral exposure.">mos_clean_cosmics</a>(mapped_cleaned, gain, -1., -1.);</div>
+<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>             dummy = <a class="code" href="group__moses.html#ga8615d071f23f2cd00eeebea1062163c7" title="Detect objects in rectified scientific frame.">mos_detect_objects</a>(mapped_cleaned, slits, slit_margin, </div>
+<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>                                        ext_radius, cont_radius);</div>
+<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span> </div>
+<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>             cpl_image_delete(mapped_cleaned); mapped_cleaned = NULL;</div>
+<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>         }</div>
+<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span> </div>
+<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>         cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span> </div>
+<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>         <a class="code" href="group__moses.html#ga9880f7b09371ca6babb8b2aa7c9e094f" title="Rotate a slit location table.">mos_rotate_slits</a>(slits, rotate, ny, nx);</div>
+<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, slits, object_table_tag, NULL, parlist, </div>
+<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>                            recipe, version))</div>
+<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span> </div>
+<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>         cpl_msg_indent_less();</div>
+<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>         cpl_msg_info(recipe, <span class="stringliteral">"Object extraction..."</span>);</div>
+<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>         cpl_msg_indent_more();</div>
+<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span> </div>
+<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>         images = <a class="code" href="group__moses.html#ga28ce64beccf31d6c0274db1dd4c8b522" title="Extract detected objects from rectified scientific frame.">mos_extract_objects</a>(mapped, skylocalmap, slits, </div>
+<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>                                      ext_mode, ron, gain, 1);</div>
+<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span> </div>
+<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>         cpl_image_delete(skylocalmap); skylocalmap = NULL;</div>
+<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span> </div>
+<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>         <span class="keywordflow">if</span> (images) {</div>
+<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>             <span class="keywordflow">if</span> (standard) {</div>
+<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>                 cpl_table *photcal    = NULL;</div>
+<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>                 cpl_table *ext_table  = NULL;</div>
+<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>                 cpl_table *flux_table = NULL;</div>
+<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span> </div>
+<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>                 ext_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"EXTINCT_TABLE"</span>, 1);</div>
+<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>                 flux_table = <a class="code" href="group__forsdfs.html#ga010c17942448386415d6e51adebae649" title="Loading table data of given category.">dfs_load_table</a>(frameset, <span class="stringliteral">"STD_FLUX_TABLE"</span>, 1);</div>
+<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span> </div>
+<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>                 photcal = <a class="code" href="group__moses.html#gaad62d9ba866b8abafb2da02053584bf2" title="Produce instrument response curve, with some ancillary information.">mos_photometric_calibration</a>(images[0],</div>
+<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>                                                       startwavelength,</div>
+<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>                                                       dispersion, gain,</div>
+<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>                                                       alltime, ext_table,</div>
+<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>                                                       airmass, flux_table,</div>
+<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>                                                       res_order);</div>
+<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span> </div>
+<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>                 cpl_table_delete(ext_table);</div>
+<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>                 cpl_table_delete(flux_table);</div>
+<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span> </div>
+<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>                 <span class="keywordflow">if</span> (photcal) {</div>
+<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span> </div>
+<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>                     <span class="keywordflow">if</span> (qc) {</div>
+<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span> </div>
+<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>                         <span class="keywordtype">float</span> *data;</div>
+<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>                         <span class="keywordtype">char</span>  *pipefile = NULL;</div>
+<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>                         <span class="keywordtype">char</span>   keyname[30];</div>
+<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span> </div>
+<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>                         qclist = <a class="code" href="group__forsdfs.html#gadc48c0a3a86ef31943bf2da28ab136cf" title="Loading header associated to data of given category.">dfs_load_header</a>(frameset, science_tag, 0);</div>
+<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span> </div>
+<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>                         <span class="keywordflow">if</span> (qclist == NULL)</div>
+<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>                             vimos_science_exit(<span class="stringliteral">"Cannot reload scientific "</span></div>
+<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>                                                <span class="stringliteral">"frame header"</span>);</div>
+<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span> </div>
+<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>                         <a class="code" href="group__forsqc.html#ga5535c92a2c4ee1ae47ae1dff60e8d451" title="Initiate a new QC1 group.">fors_qc_start_group</a>(qclist, <span class="stringliteral">"2.0"</span>, instrume);</div>
+<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span> </div>
+<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span> </div>
+<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>                         <span class="comment">/*</span></div>
+<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span> <span class="comment">                         * QC1 group header</span></div>
+<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span> <span class="comment">                         */</span></div>
+<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span> </div>
+<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PRO.CATG"</span>, specphot_tag,</div>
+<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>                                                  <span class="stringliteral">"Product category"</span>, instrume))</div>
+<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>                             vimos_science_exit(<span class="stringliteral">"Cannot write product category "</span></div>
+<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>                                                <span class="stringliteral">"to QC log file"</span>);</div>
+<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span> </div>
+<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ESO DPR TYPE"</span>, NULL,</div>
+<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>                                                    <span class="stringliteral">"DPR type"</span>, instrume))</div>
+<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>                             vimos_science_exit(<span class="stringliteral">"Missing keyword DPR TYPE in "</span></div>
+<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>                                                <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span> </div>
+<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ESO TPL ID"</span>, NULL,</div>
+<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>                                                    <span class="stringliteral">"Template"</span>, instrume))</div>
+<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>                             vimos_science_exit(<span class="stringliteral">"Missing keyword TPL ID in "</span></div>
+<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>                                                <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span> </div>
+<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist,</div>
+<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>                                                    key_gris_name, NULL,</div>
+<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>                                                    <span class="stringliteral">"Grism name"</span>, instrume)) {</div>
+<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>                             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in "</span></div>
+<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>                                           <span class="stringliteral">"scientific frame header"</span>, </div>
+<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>                                           key_gris_name);</div>
+<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>                             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>                         }</div>
+<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span> </div>
+<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist,</div>
+<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>                                                    <span class="stringliteral">"ESO INS GRIS1 ID"</span>, NULL,</div>
+<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>                                                    <span class="stringliteral">"Grism identifier"</span>,</div>
+<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>                                                    instrume)) {</div>
+<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>                             cpl_msg_error(recipe, <span class="stringliteral">"Missing keyword %s in "</span></div>
+<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>                                           <span class="stringliteral">"scientific frame header"</span>, </div>
+<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>                                           key_gris_id);</div>
+<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>                             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>                         }</div>
+<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span> </div>
+<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>                         <span class="keywordflow">if</span> (cpl_propertylist_has(qclist, key_filt_name))</div>
+<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>                             <a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, key_filt_name, NULL,</div>
+<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>                                                    <span class="stringliteral">"Filter name"</span>, instrume);</div>
+<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span> </div>
+<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist,</div>
+<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>                                                    <span class="stringliteral">"ESO DET CHIP1 ID"</span>, NULL,</div>
+<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>                                                    <span class="stringliteral">"Chip identifier"</span>,</div>
+<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>                                                    instrume))</div>
+<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>                             vimos_science_exit(<span class="stringliteral">"Missing keyword DET CHIP1 ID "</span></div>
+<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>                                                <span class="stringliteral">"in scientific frame header"</span>);</div>
+<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span> </div>
+<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga0361cf5642de51ebf8e3412fffe70a56" title="Copy a keyword value to the currently active QC1 PAF object.">fors_qc_keyword_to_paf</a>(qclist, <span class="stringliteral">"ARCFILE"</span>, NULL,</div>
+<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>                                                    <span class="stringliteral">"Archive name of input data"</span>,</div>
+<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>                                                    instrume))</div>
+<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>                             vimos_science_exit(<span class="stringliteral">"Missing keyword ARCFILE in "</span></div>
+<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>                                                <span class="stringliteral">"scientific frame header"</span>);</div>
+<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span> </div>
+<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>                         pipefile = dfs_generate_filename_tfits(specphot_tag);</div>
+<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span> </div>
+<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>                         <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga59a8c8fece17908fd39670a23b15d6f4" title="Add string parameter to current QC1 group.">fors_qc_write_string</a>(<span class="stringliteral">"PIPEFILE"</span>, pipefile,</div>
+<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>                                                  <span class="stringliteral">"Pipeline product name"</span>,</div>
+<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>                                                  instrume))</div>
+<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>                             vimos_science_exit(<span class="stringliteral">"Cannot write PIPEFILE to "</span></div>
+<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>                                                <span class="stringliteral">"QC log file"</span>);</div>
+<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>                         cpl_free(pipefile);</div>
+<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span> </div>
+<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span> </div>
+<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>                         <span class="comment">/*</span></div>
+<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span> <span class="comment">                         * QC1 parameters</span></div>
+<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span> <span class="comment">                         */</span></div>
+<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span> </div>
+<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>                         wstart = 3700.;</div>
+<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>                         wstep  = 400.;</div>
+<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>                         wcount = 15;</div>
+<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span> </div>
+<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>                         dummy = cpl_image_new(wcount, 1, CPL_TYPE_FLOAT);</div>
+<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>                         data = cpl_image_get_data_float(dummy);</div>
+<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>                         map_table(dummy, wstart, wstep, photcal,</div>
+<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>                                   <span class="stringliteral">"WAVE"</span>, <span class="stringliteral">"EFFICIENCY"</span>);</div>
+<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span> </div>
+<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>                         <span class="keywordflow">for</span> (i = 0; i < wcount; i++) {</div>
+<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>                             sprintf(keyname, <span class="stringliteral">"QC.MOS.EFFICIENCY%d.LAMBDA"</span>,</div>
+<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>                                     i + 1);</div>
+<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>                             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qclist,</div>
+<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>                                                         wstart + wstep * i,</div>
+<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>                                                         keyname, <span class="stringliteral">"Angstrom"</span>,</div>
+<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>                                                         <span class="stringliteral">"Wavelength of "</span></div>
+<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>                                                         <span class="stringliteral">"efficiency evaluation"</span>,</div>
+<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>                                                         instrume)) {</div>
+<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>                                 vimos_science_exit(<span class="stringliteral">"Cannot write wavelength of "</span></div>
+<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>                                                    <span class="stringliteral">"efficiency evaluation"</span>);</div>
+<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>                             }</div>
+<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span> </div>
+<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>                             sprintf(keyname, <span class="stringliteral">"QC.MOS.EFFICIENCY%d"</span>, i + 1);</div>
+<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>                             <span class="keywordflow">if</span> (<a class="code" href="group__forsqc.html#ga4df6371ce29055b043f72f0417ecdf0f" title="Write an integer value to the active QC1 PAF object and to a header.">fors_qc_write_qc_double</a>(qclist,</div>
+<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>                                                         data[i],</div>
+<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>                                                         keyname, <span class="stringliteral">"e-/photon"</span>,</div>
+<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>                                                         <span class="stringliteral">"Efficiency"</span>,</div>
+<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>                                                         instrume)) {</div>
+<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>                                 vimos_science_exit(<span class="stringliteral">"Cannot write wavelength of "</span></div>
+<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>                                                    <span class="stringliteral">"efficiency evaluation"</span>);</div>
+<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>                             }</div>
+<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>                         }</div>
+<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span> </div>
+<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>                         cpl_image_delete(dummy); dummy = NULL;</div>
+<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span> </div>
+<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>                         <a class="code" href="group__forsqc.html#ga0e0fb873edd66f0e42a50c229c650fda" title="Close current QC1 PAF file.">fors_qc_end_group</a>();</div>
+<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span> </div>
+<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>                     }  <span class="comment">/* End of QC1 computation */</span></div>
+<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span> </div>
+<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>                     <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, photcal, specphot_tag, qclist,</div>
+<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>                                        parlist, recipe, version)) {</div>
+<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>                         cpl_table_delete(photcal);</div>
+<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>                         vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>                     }</div>
+<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>                     cpl_propertylist_delete(qclist); qclist = NULL;</div>
+<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>                     cpl_table_delete(photcal);</div>
+<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>                 }</div>
+<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>             }</div>
+<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span> </div>
+<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>             <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>                 cpl_image_divide_scalar(images[0], alltime);</div>
+<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span> </div>
+<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[0], reduced_science_tag, header,</div>
+<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>                 vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span> </div>
+<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>             cpl_image_delete(images[0]);</div>
+<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>     </div>
+<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>             <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>                 cpl_image_divide_scalar(images[1], alltime);</div>
+<div class="line"><a name="l01389"></a><span class="lineno"> 1389</span> </div>
+<div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[1], reduced_sky_tag, header,</div>
+<div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>                 vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01393"></a><span class="lineno"> 1393</span> </div>
+<div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>             cpl_image_delete(images[1]);</div>
+<div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>     </div>
+<div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>             <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>                 cpl_image_divide_scalar(images[2], alltime);</div>
+<div class="line"><a name="l01398"></a><span class="lineno"> 1398</span> </div>
+<div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>             <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, images[2], reduced_error_tag, header,</div>
+<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>                                parlist, recipe, version))</div>
+<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>                 vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span> </div>
+<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>             cpl_image_delete(images[2]);</div>
+<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span> </div>
+<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>             cpl_free(images);</div>
+<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>         }</div>
+<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>         <span class="keywordflow">else</span> {</div>
+<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>             cpl_msg_warning(recipe, <span class="stringliteral">"No objects found: the products "</span></div>
+<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>                             <span class="stringliteral">"%s, %s, and %s are not created"</span>, </div>
+<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>                             reduced_science_tag, reduced_sky_tag, </div>
+<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>                             reduced_error_tag);</div>
+<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>         }</div>
+<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span> </div>
+<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>     }</div>
+<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span> </div>
+<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>     cpl_table_delete(slits); slits = NULL;</div>
+<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span> </div>
+<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>     <span class="keywordflow">if</span> (skyalign >= 0) {</div>
+<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#gaf327994c9f97caba177eef18692b1824" title="Saving table data of given category.">dfs_save_table</a>(frameset, idscoeff, disp_coeff_sky_tag, NULL, </div>
+<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>     }</div>
+<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span> </div>
+<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>     cpl_table_delete(idscoeff); idscoeff = NULL;</div>
+<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span> </div>
+<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>     <span class="keywordflow">if</span> (skyglobal || skymedian || skylocal) {</div>
+<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>         <span class="keywordflow">if</span> (time_normalise)</div>
+<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>             cpl_image_divide_scalar(mapped, alltime);</div>
+<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>         <span class="keywordflow">if</span> (<a class="code" href="group__forsdfs.html#ga6ad37d6af14278e58f72e820427158c5" title="Saving image data of given category.">dfs_save_image</a>(frameset, mapped, mapped_science_tag, header, </div>
+<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>                            parlist, recipe, version))</div>
+<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>             vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>     }</div>
+<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span> </div>
+<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>     cpl_image_delete(mapped); mapped = NULL;</div>
+<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>     cpl_propertylist_delete(header); header = NULL;</div>
+<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span> </div>
+<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>     <span class="keywordflow">if</span> (cpl_error_get_code()) {</div>
+<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>         cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());</div>
+<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>         vimos_science_exit(NULL);</div>
+<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>     }</div>
+<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>     <span class="keywordflow">else</span> </div>
+<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>         <span class="keywordflow">return</span> 0;</div>
+<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span> }</div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/html/vimos__science__impl_8h-source.html b/html/vimos__science__impl_8h-source.html
deleted file mode 100644
index 3ac2bdc..0000000
--- a/html/vimos__science__impl_8h-source.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>FORS Pipeline Reference Manual: vimos_science_impl.h Source File</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head><body>
-<!-- Generated by Doxygen 1.4.7 -->
-<div class="tabs">
-  <ul>
-    <li><a href="index.html"><span>Main Page</span></a></li>
-    <li><a href="modules.html"><span>Modules</span></a></li>
-    <li><a href="classes.html"><span>Data Structures</span></a></li>
-    <li id="current"><a href="files.html"><span>Files</span></a></li>
-    <li><a href="dirs.html"><span>Directories</span></a></li>
-  </ul></div>
-<div class="nav">
-<a class="el" href="dir_83e1530f94cacc9068c540ba3fc838a8.html">fors</a></div>
-<h1>vimos_science_impl.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: vimos_science_impl.h,v 1.2 2010/05/18 13:14:21 cizzo Exp $</span>
-<a name="l00002"></a>00002 <span class="comment"> *</span>
-<a name="l00003"></a>00003 <span class="comment"> * This file is part of the FORS Library</span>
-<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span>
-<a name="l00005"></a>00005 <span class="comment"> *</span>
-<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
-<a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
-<a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
-<a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span>
-<a name="l00010"></a>00010 <span class="comment"> *</span>
-<a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
-<a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
-<a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
-<a name="l00015"></a>00015 <span class="comment"> *</span>
-<a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
-<a name="l00017"></a>00017 <span class="comment"> * along with this program; if not, write to the Free Software</span>
-<a name="l00018"></a>00018 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span>
-<a name="l00019"></a>00019 <span class="comment"> */</span>
-<a name="l00020"></a>00020 
-<a name="l00021"></a>00021 <span class="comment">/*</span>
-<a name="l00022"></a>00022 <span class="comment"> * $Author: cizzo $</span>
-<a name="l00023"></a>00023 <span class="comment"> * $Date: 2010/05/18 13:14:21 $</span>
-<a name="l00024"></a>00024 <span class="comment"> * $Revision: 1.2 $</span>
-<a name="l00025"></a>00025 <span class="comment"> * $Name: fors-4_9_23 $</span>
-<a name="l00026"></a>00026 <span class="comment"> */</span>
-<a name="l00027"></a>00027 
-<a name="l00028"></a>00028 <span class="preprocessor">#ifndef VIMOS_SCIENCE_IMPL_H</span>
-<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define VIMOS_SCIENCE_IMPL_H</span>
-<a name="l00030"></a>00030 <span class="preprocessor"></span>
-<a name="l00031"></a>00031 <span class="preprocessor">#include <cpl.h></span>
-<a name="l00032"></a>00032 
-<a name="l00033"></a>00033 CPL_BEGIN_DECLS
-<a name="l00034"></a>00034 
-<a name="l00035"></a>00035 <span class="keywordtype">int</span> <a class="code" href="group__vimos__science__impl.html#g79a502c79f4843218e3d0d4adec9c907">vimos_science_impl</a>(cpl_frameset *frames, cpl_parameterlist *parameters);
-<a name="l00036"></a>00036 
-<a name="l00037"></a>00037 CPL_END_DECLS
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 <span class="preprocessor">#endif</span>
-</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu May 2 18:34:05 2013 for FORS Pipeline Reference Manual by 
-<a href="http://www.doxygen.org/index.html">
-<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
-</body>
-</html>
diff --git a/html/vimos__science__impl_8h_source.html b/html/vimos__science__impl_8h_source.html
new file mode 100644
index 0000000..86cb7bb
--- /dev/null
+++ b/html/vimos__science__impl_8h_source.html
@@ -0,0 +1,100 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.3.1"/>
+<title>FORS Pipeline Reference Manual: vimos_science_impl.h Source File</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+  <td style="padding-left: 0.5em;">
+   <div id="projectname">FORS Pipeline Reference Manual
+    <span id="projectnumber">4.11.12</span>
+   </div>
+  </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.3.1 -->
+  <div id="navrow1" class="tabs">
+    <ul class="tablist">
+      <li><a href="index.html"><span>Main Page</span></a></li>
+      <li><a href="modules.html"><span>Modules</span></a></li>
+      <li><a href="annotated.html"><span>Data Structures</span></a></li>
+      <li class="current"><a href="files.html"><span>Files</span></a></li>
+    </ul>
+  </div>
+  <div id="navrow2" class="tabs2">
+    <ul class="tablist">
+      <li><a href="files.html"><span>File List</span></a></li>
+    </ul>
+  </div>
+<div id="nav-path" class="navpath">
+  <ul>
+<li class="navelem"><a class="el" href="dir_95ba833b8cc26b837be271dc0b58e122.html">fors</a></li>  </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+  <div class="headertitle">
+<div class="title">vimos_science_impl.h</div>  </div>
+</div><!--header-->
+<div class="contents">
+<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span> <span class="comment">/* $Id: vimos_science_impl.h,v 1.2 2010-05-18 13:14:21 cizzo Exp $</span></div>
+<div class="line"><a name="l00002"></a><span class="lineno">    2</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00003"></a><span class="lineno">    3</span> <span class="comment"> * This file is part of the FORS Library</span></div>
+<div class="line"><a name="l00004"></a><span class="lineno">    4</span> <span class="comment"> * Copyright (C) 2002-2010 European Southern Observatory</span></div>
+<div class="line"><a name="l00005"></a><span class="lineno">    5</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00006"></a><span class="lineno">    6</span> <span class="comment"> * This program is free software; you can redistribute it and/or modify</span></div>
+<div class="line"><a name="l00007"></a><span class="lineno">    7</span> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
+<div class="line"><a name="l00008"></a><span class="lineno">    8</span> <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span></div>
+<div class="line"><a name="l00009"></a><span class="lineno">    9</span> <span class="comment"> * (at your option) any later version.</span></div>
+<div class="line"><a name="l00010"></a><span class="lineno">   10</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00011"></a><span class="lineno">   11</span> <span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
+<div class="line"><a name="l00012"></a><span class="lineno">   12</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
+<div class="line"><a name="l00013"></a><span class="lineno">   13</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
+<div class="line"><a name="l00014"></a><span class="lineno">   14</span> <span class="comment"> * GNU General Public License for more details.</span></div>
+<div class="line"><a name="l00015"></a><span class="lineno">   15</span> <span class="comment"> *</span></div>
+<div class="line"><a name="l00016"></a><span class="lineno">   16</span> <span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
+<div class="line"><a name="l00017"></a><span class="lineno">   17</span> <span class="comment"> * along with this program; if not, write to the Free Software</span></div>
+<div class="line"><a name="l00018"></a><span class="lineno">   18</span> <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span></div>
+<div class="line"><a name="l00019"></a><span class="lineno">   19</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00020"></a><span class="lineno">   20</span> </div>
+<div class="line"><a name="l00021"></a><span class="lineno">   21</span> <span class="comment">/*</span></div>
+<div class="line"><a name="l00022"></a><span class="lineno">   22</span> <span class="comment"> * $Author: cizzo $</span></div>
+<div class="line"><a name="l00023"></a><span class="lineno">   23</span> <span class="comment"> * $Date: 2010-05-18 13:14:21 $</span></div>
+<div class="line"><a name="l00024"></a><span class="lineno">   24</span> <span class="comment"> * $Revision: 1.2 $</span></div>
+<div class="line"><a name="l00025"></a><span class="lineno">   25</span> <span class="comment"> * $Name: not supported by cvs2svn $</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span> <span class="comment"> */</span></div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span> </div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span> <span class="preprocessor">#ifndef VIMOS_SCIENCE_IMPL_H</span></div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span> <span class="preprocessor"></span><span class="preprocessor">#define VIMOS_SCIENCE_IMPL_H</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span> <span class="preprocessor"></span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span> <span class="preprocessor">#include <cpl.h></span></div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span> </div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span> CPL_BEGIN_DECLS</div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span> </div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span> <span class="keywordtype">int</span> vimos_science_impl(cpl_frameset *frames, cpl_parameterlist *parameters);</div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span> </div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span> CPL_END_DECLS</div>
+<div class="line"><a name="l00038"></a><span class="lineno">   38</span> </div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span> <span class="preprocessor">#endif</span></div>
+</div><!-- fragment --></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.3.1
+</small></address>
+</body>
+</html>
diff --git a/irplib/Makefile.am b/irplib/Makefile.am
index 9e08d31..d4172e4 100644
--- a/irplib/Makefile.am
+++ b/irplib/Makefile.am
@@ -30,7 +30,7 @@ MAINTAINERCLEANFILES = Makefile.in
 
 endif
 
-AM_CPPFLAGS = $(all_includes)
+AM_CPPFLAGS = $(all_includes) $(GSL_INCLUDES)
 
 noinst_HEADERS =    irplib_flat.h \
                     irplib_calib.h \
@@ -82,6 +82,6 @@ libirplib_la_SOURCES =  irplib_flat.c \
                         irplib_mkmaster.c \
                         irplib_ksigma_clip.c 
 
-libirplib_la_LDFLAGS = $(CPL_LDFLAGS)
-libirplib_la_LIBADD = $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLDRS) $(LIBCPLCORE) 
+libirplib_la_LDFLAGS = $(CPL_LDFLAGS) $(GSL_LDFLAGS)
+libirplib_la_LIBADD = $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLDRS) $(LIBCPLCORE) $(GSL_LIBS)
 libirplib_la_DEPENDENCIES =
diff --git a/irplib/Makefile.in b/irplib/Makefile.in
index f720841..8e94d0f 100644
--- a/irplib/Makefile.in
+++ b/irplib/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,15 +15,29 @@
 @SET_MAKE@
 
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,16 +54,24 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = irplib
 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/admin/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
-	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/purify.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 am_libirplib_la_OBJECTS = irplib_flat.lo irplib_calib.lo irplib_cat.lo \
@@ -60,41 +82,100 @@ am_libirplib_la_OBJECTS = irplib_flat.lo irplib_calib.lo irplib_cat.lo \
 	irplib_hist.lo irplib_wavecal.lo irplib_wcs.lo \
 	irplib_wlxcorr.lo irplib_mkmaster.lo irplib_ksigma_clip.lo
 libirplib_la_OBJECTS = $(am_libirplib_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+libirplib_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(libirplib_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 SOURCES = $(libirplib_la_SOURCES)
 DIST_SOURCES = $(libirplib_la_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
-	install-exec-recursive install-info-recursive \
-	install-recursive installcheck-recursive installdirs-recursive \
-	pdf-recursive ps-recursive uninstall-info-recursive \
-	uninstall-recursive
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkgincludedir)"
-pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
 HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
@@ -119,16 +200,17 @@ CX_LDFLAGS = @CX_LDFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOXYGEN = @DOXYGEN@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 FORS_BINARY_AGE = @FORS_BINARY_AGE@
 FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
 FORS_INCLUDES = @FORS_INCLUDES@
@@ -138,12 +220,17 @@ FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
 FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
 FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
 FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
 LATEX = @LATEX@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBCEXT = @LIBCEXT@
 LIBCFITSIO = @LIBCFITSIO@
@@ -159,48 +246,52 @@ LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 LT_AGE = @LT_AGE@
 LT_CURRENT = @LT_CURRENT@
 LT_REVISION = @LT_REVISION@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
 MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
-ONLINE_MODE_FALSE = @ONLINE_MODE_FALSE@
-ONLINE_MODE_TRUE = @ONLINE_MODE_TRUE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PURIFY_CMD = @PURIFY_CMD@
-PURIFY_FALSE = @PURIFY_FALSE@
-PURIFY_TRUE = @PURIFY_TRUE@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 all_includes = @all_includes@
 all_ldflags = @all_ldflags@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -212,8 +303,12 @@ build_alias = @build_alias@
 build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
+builddir = @builddir@
 configdir = @configdir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -226,17 +321,21 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 pipedocsdir = @pipedocsdir@
 plugindir = @plugindir@
 prefix = @prefix@
 privatelibdir = @privatelibdir@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target = @target@
@@ -244,13 +343,16 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 wkfcopydir = @wkfcopydir@
 wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.8 foreign
 DISTCLEANFILES = *~
 SUBDIRS = . tests
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = $(all_includes)
+AM_CPPFLAGS = $(all_includes) $(GSL_INCLUDES)
 noinst_HEADERS = irplib_flat.h \
                     irplib_calib.h \
                     irplib_cat.h \
@@ -299,8 +401,8 @@ libirplib_la_SOURCES = irplib_flat.c \
                         irplib_mkmaster.c \
                         irplib_ksigma_clip.c 
 
-libirplib_la_LDFLAGS = $(CPL_LDFLAGS)
-libirplib_la_LIBADD = $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLDRS) $(LIBCPLCORE) 
+libirplib_la_LDFLAGS = $(CPL_LDFLAGS) $(GSL_LDFLAGS)
+libirplib_la_LIBADD = $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLDRS) $(LIBCPLCORE) $(GSL_LIBS)
 libirplib_la_DEPENDENCIES = 
 all: all-recursive
 
@@ -310,14 +412,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  irplib/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  irplib/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign irplib/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign irplib/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -335,17 +437,20 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 clean-noinstLTLIBRARIES:
 	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libirplib.la: $(libirplib_la_OBJECTS) $(libirplib_la_DEPENDENCIES) 
-	$(LINK)  $(libirplib_la_LDFLAGS) $(libirplib_la_OBJECTS) $(libirplib_la_LIBADD) $(LIBS)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libirplib.la: $(libirplib_la_OBJECTS) $(libirplib_la_DEPENDENCIES) $(EXTRA_libirplib_la_DEPENDENCIES) 
+	$(libirplib_la_LINK)  $(libirplib_la_OBJECTS) $(libirplib_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -376,22 +481,22 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/irplib_wlxcorr.Plo at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
@@ -401,36 +506,36 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-
-distclean-libtool:
-	-rm -f libtool
-uninstall-info-am:
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
-	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
-	  $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
 	done
 
 uninstall-pkgincludeHEADERS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
-	done
+	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@failcom='exit 1'; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
 	  case $$f in \
 	    *=* | --[!k]*);; \
@@ -439,7 +544,11 @@ $(RECURSIVE_TARGETS):
 	done; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -447,51 +556,23 @@ $(RECURSIVE_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-	@failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
 	done
 ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -499,14 +580,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
@@ -518,81 +599,112 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test ! -f $$subdir/TAGS || \
-	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(mkdir_p) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	    distdir=`$(am__cd) $(distdir) && pwd`; \
-	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
-	    (cd $$subdir && \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
 	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$top_distdir" \
-	        distdir="$$distdir/$$subdir" \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
 	        distdir) \
 	      || exit 1; \
 	  fi; \
@@ -603,7 +715,7 @@ all-am: Makefile $(LTLIBRARIES) $(HEADERS)
 installdirs: installdirs-recursive
 installdirs-am:
 	for dir in "$(DESTDIR)$(pkgincludedir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-recursive
 install-exec: install-exec-recursive
@@ -615,16 +727,22 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
@@ -640,7 +758,7 @@ distclean: distclean-recursive
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-libtool distclean-tags
+	distclean-tags
 
 dvi: dvi-recursive
 
@@ -648,18 +766,38 @@ dvi-am:
 
 html: html-recursive
 
+html-am:
+
 info: info-recursive
 
 info-am:
 
 install-data-am: install-pkgincludeHEADERS
 
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-recursive
+
+install-html-am:
+
 install-info: install-info-recursive
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -680,24 +818,28 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
+uninstall-am: uninstall-pkgincludeHEADERS
 
-uninstall-info: uninstall-info-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
-	clean clean-generic clean-libtool clean-noinstLTLIBRARIES \
-	clean-recursive ctags ctags-recursive distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-recursive distclean-tags distdir dvi dvi-am html \
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	clean-noinstLTLIBRARIES cscopelist cscopelist-recursive ctags \
+	ctags-recursive distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-pkgincludeHEADERS \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkgincludeHEADERS install-ps install-ps-am \
 	install-strip installcheck installcheck-am installdirs \
 	installdirs-am maintainer-clean maintainer-clean-generic \
-	maintainer-clean-recursive mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
-	pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
-	uninstall-info-am uninstall-pkgincludeHEADERS
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-pkgincludeHEADERS
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/irplib/irplib_calib.c b/irplib/irplib_calib.c
index ceeb218..00ade1d 100644
--- a/irplib/irplib_calib.c
+++ b/irplib/irplib_calib.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_calib.c,v 1.17 2009/02/17 08:05:25 amodigli Exp $
+/* $Id: irplib_calib.c,v 1.19 2013-03-01 10:26:22 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: amodigli $
- * $Date: 2009/02/17 08:05:25 $
- * $Revision: 1.17 $
- * $Name: fors-4_9_23 $
+ * $Author: llundin $
+ * $Date: 2013-03-01 10:26:22 $
+ * $Revision: 1.19 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -48,6 +48,18 @@ irplib_get_clean_mean_window(cpl_image* img,
                              double* clean_mean, 
                              double* clean_stdev);
 
+/*-----------------------------------------------------------------------------
+                                   Defines
+ -----------------------------------------------------------------------------*/
+
+#if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(6, 3, 0)
+#define IRPLIB_FRAMESET_GET       cpl_frameset_get_position
+#else
+/* Remove this branch once CPL versions less than 6.3 are no longer supported */
+#define IRPLIB_FRAMESET_GET       cpl_frameset_get_frame
+#endif
+
+
 static double irplib_pfits_get_dit(const cpl_propertylist * plist);
 static double irplib_pfits_get_exp_time(const cpl_propertylist* plist);
 /*----------------------------------------------------------------------------*/
@@ -219,7 +231,7 @@ irplib_compute_gain(
 
   double sig_on_dif=0;
   double sig_of_dif=0;
-  char* name=NULL;
+  const char* name=NULL;
   int i=0;
   int m=0;
 
@@ -241,8 +253,8 @@ irplib_compute_gain(
 
   for(i=0;i<nfr;i++) {
 
-    frm=cpl_frameset_get_frame(son,i);
-    name=(char*)cpl_frame_get_filename(frm);
+    frm=IRPLIB_FRAMESET_GET(son,i);
+    name=cpl_frame_get_filename(frm);
     plist=cpl_propertylist_load(name,0);
     dit_ref=irplib_pfits_get_dit(plist);
     exptime_ref=(double)irplib_pfits_get_exp_time(plist);
@@ -250,8 +262,8 @@ irplib_compute_gain(
     cpl_vector_set(dit_on,i,dit_ref);
     cpl_vector_set(exptime_on,i,exptime_ref);
 
-    frm=cpl_frameset_get_frame(sof,i);
-    name=(char*)cpl_frame_get_filename(frm);
+    frm=IRPLIB_FRAMESET_GET(sof,i);
+    name=cpl_frame_get_filename(frm);
     plist=cpl_propertylist_load(name,0);
     dit_ref=irplib_pfits_get_dit(plist);
     exptime_ref=(double)irplib_pfits_get_exp_time(plist);
@@ -274,12 +286,12 @@ irplib_compute_gain(
   cpl_table_new_column(res_tbl,"gain", CPL_TYPE_DOUBLE);
  
   for(i=0;i<nfr;i++) {
-    frm=cpl_frameset_get_frame(son,i);
-    name=(char*)cpl_frame_get_filename(frm);
+    frm=IRPLIB_FRAMESET_GET(son,i);
+    name=cpl_frame_get_filename(frm);
     img_on1=cpl_image_load(name,CPL_TYPE_FLOAT,0,0);
 
-    frm=cpl_frameset_get_frame(sof,i);
-    name=(char*)cpl_frame_get_filename(frm);
+    frm=IRPLIB_FRAMESET_GET(sof,i);
+    name=cpl_frame_get_filename(frm);
     img_of1=cpl_image_load(name,CPL_TYPE_FLOAT,0,0);
 
 
@@ -289,14 +301,14 @@ irplib_compute_gain(
    
     for(m=0;m<nfr; m++) {
       if(m != i) {
-	frm=cpl_frameset_get_frame(son,m);
-	name=(char*)cpl_frame_get_filename(frm);
+	frm=IRPLIB_FRAMESET_GET(son,m);
+	name=cpl_frame_get_filename(frm);
 	dit_tmp=cpl_vector_get(dit_on,m);
 	exptime_tmp=cpl_vector_get(exptime_on,m);
 	if(dit_tmp == dit_ref && exptime_tmp == exptime_ref) {
 	  img_on2=cpl_image_load(name,CPL_TYPE_FLOAT,0,0);
-	  frm=cpl_frameset_get_frame(sof,m);
-	  name=(char*)cpl_frame_get_filename(frm);
+	  frm=IRPLIB_FRAMESET_GET(sof,m);
+	  name=cpl_frame_get_filename(frm);
 	  img_of2=cpl_image_load(name,CPL_TYPE_FLOAT,0,0);
 
 	  img_on_dif=cpl_image_subtract_create(img_on1,img_on2);
@@ -378,7 +390,7 @@ cpl_table* irplib_compute_linearity(cpl_frameset* son, cpl_frameset* sof)
   double med=0;
   double avg=0;
 
-  char* name=NULL;
+  const char* name=NULL;
   cpl_image* img=NULL;
   cpl_vector* vec_adl=NULL;
   cpl_vector* vec_dit=NULL;
@@ -409,15 +421,15 @@ cpl_table* irplib_compute_linearity(cpl_frameset* son, cpl_frameset* sof)
   vec_dit=cpl_vector_new(nfr);
   vec_adl=cpl_vector_new(nfr);
   for(i=0;i<nfr;i++) {
-    frm=cpl_frameset_get_frame(son,i);
-    name=(char*)cpl_frame_get_filename(frm);
+    frm=IRPLIB_FRAMESET_GET(son,i);
+    name=cpl_frame_get_filename(frm);
     img=cpl_image_load(name,CPL_TYPE_FLOAT,0,0);
     med_on=cpl_image_get_median(img);
     avg_on=cpl_image_get_mean(img);
     cpl_image_delete(img);
 
-    frm=cpl_frameset_get_frame(sof,i);
-    name=(char*)cpl_frame_get_filename(frm);
+    frm=IRPLIB_FRAMESET_GET(sof,i);
+    name=cpl_frame_get_filename(frm);
     img=cpl_image_load(name,CPL_TYPE_FLOAT,0,0);
     med_of=cpl_image_get_median(img);
     avg_of=cpl_image_get_mean(img);
diff --git a/irplib/irplib_calib.h b/irplib/irplib_calib.h
index 50a84b9..e889751 100644
--- a/irplib/irplib_calib.h
+++ b/irplib/irplib_calib.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_calib.h,v 1.8 2007/02/12 10:34:51 amodigli Exp $
+/* $Id: irplib_calib.h,v 1.8 2007-02-12 10:34:51 amodigli Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: amodigli $
- * $Date: 2007/02/12 10:34:51 $
+ * $Date: 2007-02-12 10:34:51 $
  * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_CALIB_H
diff --git a/irplib/irplib_cat.c b/irplib/irplib_cat.c
index 879544d..16e6a32 100644
--- a/irplib/irplib_cat.c
+++ b/irplib/irplib_cat.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_cat.c,v 1.10 2009/12/01 12:34:25 cgarcia Exp $
+/* $Id: irplib_cat.c,v 1.10 2009-12-01 12:34:25 cgarcia Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2009/12/01 12:34:25 $
+ * $Date: 2009-12-01 12:34:25 $
  * $Revision: 1.10 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_cat.h b/irplib/irplib_cat.h
index b48ff9f..314aef6 100644
--- a/irplib/irplib_cat.h
+++ b/irplib/irplib_cat.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_cat.h,v 1.5 2009/12/16 14:49:52 cgarcia Exp $
+/* $Id: irplib_cat.h,v 1.5 2009-12-16 14:49:52 cgarcia Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2009/12/16 14:49:52 $
+ * $Date: 2009-12-16 14:49:52 $
  * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_CAT_H
diff --git a/irplib/irplib_distortion.c b/irplib/irplib_distortion.c
index d144402..02a53dc 100644
--- a/irplib/irplib_distortion.c
+++ b/irplib/irplib_distortion.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_distortion.c,v 1.51 2012/02/03 15:08:14 llundin Exp $
+/* $Id: irplib_distortion.c,v 1.52 2013-01-29 08:43:33 jtaylor Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
  */
 
 /*
- * $Author: llundin $
- * $Date: 2012/02/03 15:08:14 $
- * $Revision: 1.51 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-01-29 08:43:33 $
+ * $Revision: 1.52 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_distortion.h b/irplib/irplib_distortion.h
index 14bfbe8..69076dd 100644
--- a/irplib/irplib_distortion.h
+++ b/irplib/irplib_distortion.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_distortion.h,v 1.5 2006/07/26 14:47:34 yjung Exp $
+/* $Id: irplib_distortion.h,v 1.6 2013-01-29 08:43:33 jtaylor Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
  */
 
 /*
- * $Author: yjung $
- * $Date: 2006/07/26 14:47:34 $
- * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-01-29 08:43:33 $
+ * $Revision: 1.6 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_DISTORTION_H
diff --git a/irplib/irplib_flat.c b/irplib/irplib_flat.c
index 9dc4921..4b83bc8 100644
--- a/irplib/irplib_flat.c
+++ b/irplib/irplib_flat.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_flat.c,v 1.15 2007/08/07 12:15:41 llundin Exp $
+/* $Id: irplib_flat.c,v 1.15 2007-08-07 12:15:41 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2007/08/07 12:15:41 $
+ * $Date: 2007-08-07 12:15:41 $
  * $Revision: 1.15 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_flat.h b/irplib/irplib_flat.h
index a363a16..bc8c450 100644
--- a/irplib/irplib_flat.h
+++ b/irplib/irplib_flat.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_flat.h,v 1.4 2005/09/15 11:47:16 llundin Exp $
+/* $Id: irplib_flat.h,v 1.4 2005-09-15 11:47:16 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2005/09/15 11:47:16 $
+ * $Date: 2005-09-15 11:47:16 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_FLAT_H
diff --git a/irplib/irplib_framelist.c b/irplib/irplib_framelist.c
index 3d7d023..fb0c2b4 100644
--- a/irplib/irplib_framelist.c
+++ b/irplib/irplib_framelist.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_framelist.c,v 1.29 2012/02/03 13:55:14 llundin Exp $
+/* $Id: irplib_framelist.c,v 1.30 2013-02-27 16:05:13 jtaylor Exp $
  *
  * This file is part of the irplib package 
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: llundin $
- * $Date: 2012/02/03 13:55:14 $
- * $Revision: 1.29 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-02-27 16:05:13 $
+ * $Revision: 1.30 $
+ * $Name: not supported by cvs2svn $
  */
 
 
@@ -35,6 +35,10 @@
                                  Includes
  -----------------------------------------------------------------------------*/
 
+#include "irplib_framelist.h"
+#include "irplib_utils.h"
+#include <cpl.h>
+
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
@@ -42,10 +46,6 @@
 #include <math.h>
 #include <assert.h>
 
-#include <cpl.h>
-
-#include "irplib_framelist.h"
-
 
 /*-----------------------------------------------------------------------------
                                  New types
@@ -455,8 +455,9 @@ int irplib_framelist_get_size(const irplib_framelist * self)
 /*----------------------------------------------------------------------------*/
 cpl_frame * irplib_framelist_get(irplib_framelist * self, int pos)
 {
+    IRPLIB_DIAG_PRAGMA_PUSH_IGN(-Wcast-qual);
     return (cpl_frame *)irplib_framelist_get_const(self, pos);
-
+    IRPLIB_DIAG_PRAGMA_POP;
 }
 
 
@@ -529,9 +530,10 @@ cpl_propertylist * irplib_framelist_get_propertylist(irplib_framelist * self,
                                                      int pos)
 {
 
+    IRPLIB_DIAG_PRAGMA_PUSH_IGN(-Wcast-qual);
     return (cpl_propertylist *)irplib_framelist_get_propertylist_const(self,
                                                                        pos);
-
+    IRPLIB_DIAG_PRAGMA_POP;
 }
 
 
diff --git a/irplib/irplib_framelist.h b/irplib/irplib_framelist.h
index 3c30391..b61ad0b 100644
--- a/irplib/irplib_framelist.h
+++ b/irplib/irplib_framelist.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_framelist.h,v 1.8 2008/11/20 10:24:47 llundin Exp $
+/* $Id: irplib_framelist.h,v 1.8 2008-11-20 10:24:47 llundin Exp $
  *
  * This file is part of the irplib package 
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2008/11/20 10:24:47 $
+ * $Date: 2008-11-20 10:24:47 $
  * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_FRAMELIST_H
diff --git a/irplib/irplib_hist.c b/irplib/irplib_hist.c
index 922592f..1f480df 100644
--- a/irplib/irplib_hist.c
+++ b/irplib/irplib_hist.c
@@ -20,11 +20,11 @@
  */
 
 /*
- * $Author: kmirny $
- * $Id: irplib_hist.c,v 1.7 2009/10/15 14:02:18 kmirny Exp $
- * $Date: 2009/10/15 14:02:18 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Id: irplib_hist.c,v 1.8 2013-07-04 12:10:12 jtaylor Exp $
+ * $Date: 2013-07-04 12:10:12 $
+ * $Revision: 1.8 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -218,7 +218,7 @@ irplib_hist_fill(irplib_hist     * hist,
     for (i = 0; i < nsamples; i++)
     {
     	int pos = 0;
-    	if(bpm_data && bpm_data[i] == CPL_BINARY_1)
+        if(bpm_data && bpm_data[i] != CPL_BINARY_0)
     	{
     		continue;
     	}
diff --git a/irplib/irplib_hist.h b/irplib/irplib_hist.h
index 4cc5340..08c7d00 100644
--- a/irplib/irplib_hist.h
+++ b/irplib/irplib_hist.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_hist.h,v 1.3 2007/09/07 14:23:50 lbilbao Exp $
+/* $Id: irplib_hist.h,v 1.3 2007-09-07 14:23:50 lbilbao Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002, 2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: lbilbao $
- * $Date: 2007/09/07 14:23:50 $
+ * $Date: 2007-09-07 14:23:50 $
  * $Revision: 1.3 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_HIST_H
diff --git a/irplib/irplib_ksigma_clip.c b/irplib/irplib_ksigma_clip.c
index 333bcdf..8fd696d 100644
--- a/irplib/irplib_ksigma_clip.c
+++ b/irplib/irplib_ksigma_clip.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_ksigma_clip.c,v 1.1 2011/11/02 13:18:28 amodigli Exp $
+/* $Id: irplib_ksigma_clip.c,v 1.1 2011-11-02 13:18:28 amodigli Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002, 2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: amodigli $
- * $Date: 2011/11/02 13:18:28 $
+ * $Date: 2011-11-02 13:18:28 $
  * $Revision: 1.1 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_ksigma_clip.h b/irplib/irplib_ksigma_clip.h
index 83e1c74..c7e8107 100644
--- a/irplib/irplib_ksigma_clip.h
+++ b/irplib/irplib_ksigma_clip.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_ksigma_clip.h,v 1.1 2011/11/02 13:18:28 amodigli Exp $
+/* $Id: irplib_ksigma_clip.h,v 1.1 2011-11-02 13:18:28 amodigli Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002, 2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: amodigli $
- * $Date: 2011/11/02 13:18:28 $
+ * $Date: 2011-11-02 13:18:28 $
  * $Revision: 1.1 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_KSIGMA_CLIP_H
diff --git a/irplib/irplib_ksigma_clip_body.h b/irplib/irplib_ksigma_clip_body.h
index 2a68151..f196fb9 100644
--- a/irplib/irplib_ksigma_clip_body.h
+++ b/irplib/irplib_ksigma_clip_body.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_ksigma_clip_body.h,v 1.1 2011/11/02 13:18:28 amodigli Exp $
+/* $Id: irplib_ksigma_clip_body.h,v 1.1 2011-11-02 13:18:28 amodigli Exp $
  *
  * This file is part of the irplib package 
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: amodigli $
- * $Date: 2011/11/02 13:18:28 $
+ * $Date: 2011-11-02 13:18:28 $
  * $Revision: 1.1 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #define TYPE_ADD(a) CONCAT2X(a, CPL_TYPE)
diff --git a/irplib/irplib_match_cats.c b/irplib/irplib_match_cats.c
index a658c97..da84b9e 100644
--- a/irplib/irplib_match_cats.c
+++ b/irplib/irplib_match_cats.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_match_cats.c,v 1.10 2009/12/18 10:44:48 cgarcia Exp $
+/* $Id: irplib_match_cats.c,v 1.10 2009-12-18 10:44:48 cgarcia Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2009/12/18 10:44:48 $
+ * $Date: 2009-12-18 10:44:48 $
  * $Revision: 1.10 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_match_cats.h b/irplib/irplib_match_cats.h
index eafc514..40f587d 100644
--- a/irplib/irplib_match_cats.h
+++ b/irplib/irplib_match_cats.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_match_cats.h,v 1.5 2009/12/18 10:44:48 cgarcia Exp $
+/* $Id: irplib_match_cats.h,v 1.5 2009-12-18 10:44:48 cgarcia Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2009/12/18 10:44:48 $
+ * $Date: 2009-12-18 10:44:48 $
  * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_MATCH_CATS_H
diff --git a/irplib/irplib_mkmaster.c b/irplib/irplib_mkmaster.c
index 0c435ac..237bb46 100644
--- a/irplib/irplib_mkmaster.c
+++ b/irplib/irplib_mkmaster.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_mkmaster.c,v 1.5 2012/01/12 14:29:41 amodigli Exp $
+/* $Id: irplib_mkmaster.c,v 1.6 2013-02-27 16:00:51 jtaylor Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: amodigli $
- * $Date: 2012/01/12 14:29:41 $
- * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-02-27 16:00:51 $
+ * $Revision: 1.6 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -401,6 +401,8 @@ irplib_mkmaster_dark_qc(const cpl_imagelist* raw_images,
        /* UVES specific stuff: may be this function should not be put in irplib
       irplib_mdark_region_qc(current_dark, parameters, raw_images, recipe_id,qclog);
        */    
+      /* FIXME: still safe if irplib_mdark_region_qc is commented in? */
+      cpl_image_delete(current_dark);
     }
   }
   return cpl_error_get_code();
diff --git a/irplib/irplib_mkmaster.h b/irplib/irplib_mkmaster.h
index 7f4f1f0..edc8743 100644
--- a/irplib/irplib_mkmaster.h
+++ b/irplib/irplib_mkmaster.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_mkmaster.h,v 1.3 2011/11/02 13:17:25 amodigli Exp $
+/* $Id: irplib_mkmaster.h,v 1.3 2011-11-02 13:17:25 amodigli Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: amodigli $
- * $Date: 2011/11/02 13:17:25 $
+ * $Date: 2011-11-02 13:17:25 $
  * $Revision: 1.3 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_MKMASTER_H
diff --git a/irplib/irplib_oddeven.c b/irplib/irplib_oddeven.c
index 29af57d..82933d2 100644
--- a/irplib/irplib_oddeven.c
+++ b/irplib/irplib_oddeven.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_oddeven.c,v 1.9 2012/01/12 11:50:41 llundin Exp $
+/* $Id: irplib_oddeven.c,v 1.9 2012-01-12 11:50:41 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2012/01/12 11:50:41 $
+ * $Date: 2012-01-12 11:50:41 $
  * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_oddeven.h b/irplib/irplib_oddeven.h
index d702795..4dc1b51 100644
--- a/irplib/irplib_oddeven.h
+++ b/irplib/irplib_oddeven.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_oddeven.h,v 1.4 2006/10/06 20:46:04 yjung Exp $
+/* $Id: irplib_oddeven.h,v 1.4 2006-10-06 20:46:04 yjung Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: yjung $
- * $Date: 2006/10/06 20:46:04 $
+ * $Date: 2006-10-06 20:46:04 $
  * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_ODDEVEN_H
diff --git a/irplib/irplib_plugin.c b/irplib/irplib_plugin.c
index f810aa2..023b932 100644
--- a/irplib/irplib_plugin.c
+++ b/irplib/irplib_plugin.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_plugin.c,v 1.39 2012/02/03 14:19:06 llundin Exp $
+/* $Id: irplib_plugin.c,v 1.40 2013-08-22 17:44:56 cgarcia Exp $
  *
  * This file is part of the irplib package 
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: llundin $
- * $Date: 2012/02/03 14:19:06 $
- * $Revision: 1.39 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-08-22 17:44:56 $
+ * $Revision: 1.40 $
+ * $Name: not supported by cvs2svn $
  */
 
 /*-----------------------------------------------------------------------------
@@ -765,7 +765,9 @@ static void recipe_sof_test_image_empty(cpl_plugin * plugin, size_t nstr,
 
     for (i = 0; i < nstr; i++) {
         cpl_frame * f = cpl_frame_new();
-        char * rawname = cpl_sprintf("raw%05u.fits", (unsigned)(i+1));
+        char * rawname = cpl_sprintf("%s-raw%05u.fits",
+                                     cpl_plugin_get_name(plugin),
+                                     (unsigned)(i+1));
 
         error = cpl_image_save(iempty, rawname,CPL_BPP_IEEE_FLOAT, NULL,
                                CPL_IO_DEFAULT);
@@ -1023,13 +1025,16 @@ static void recipe_frameset_load(cpl_frameset * set, const char *name)
     /* Loop over all the lines in the set-of-frames file */
     for (line_number = 0; fgets(line, LINE_LEN_MAX - 1, fp); line_number++) {
 
+        char scan_fmt[50];
         cpl_frame_group grp;
         cpl_frame * frame;
         int n;
 
         if (line[0] == '#') continue;
 
-        n = sscanf(line, "%s %s %s", path, tag, group);
+        snprintf(scan_fmt, 49, "%%%ds %%%ds %%%ds", LINE_LEN_MAX - 1,
+                 LINE_LEN_MAX - 1, LINE_LEN_MAX - 1); 
+        n = sscanf(line, scan_fmt, path, tag, group);
 
         if (n < 1) {
             cpl_msg_warning(cpl_func, "Spurious line no. %d in %s: %s",
diff --git a/irplib/irplib_plugin.h b/irplib/irplib_plugin.h
index 2684c27..f99cc01 100644
--- a/irplib/irplib_plugin.h
+++ b/irplib/irplib_plugin.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_plugin.h,v 1.23 2012/01/11 08:03:37 llundin Exp $
+/* $Id: irplib_plugin.h,v 1.23 2012-01-11 08:03:37 llundin Exp $
  *
  * This file is part of the irplib package 
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2012/01/11 08:03:37 $
+ * $Date: 2012-01-11 08:03:37 $
  * $Revision: 1.23 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_PLUGIN_H
diff --git a/irplib/irplib_polynomial.c b/irplib/irplib_polynomial.c
index fe344df..1bd1ace 100644
--- a/irplib/irplib_polynomial.c
+++ b/irplib/irplib_polynomial.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_polynomial.c,v 1.34 2012/02/03 14:54:06 llundin Exp $
+/* $Id: irplib_polynomial.c,v 1.35 2013-01-29 08:43:33 jtaylor Exp $
  *
  * This file is part of the ESO Common Pipeline Library
  * Copyright (C) 2001-2004 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
  */
 
 /*
- * $Author: llundin $
- * $Date: 2012/02/03 14:54:06 $
- * $Revision: 1.34 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-01-29 08:43:33 $
+ * $Revision: 1.35 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_polynomial.h b/irplib/irplib_polynomial.h
index 4648115..fa0c16d 100644
--- a/irplib/irplib_polynomial.h
+++ b/irplib/irplib_polynomial.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_polynomial.h,v 1.9 2012/01/12 10:40:21 llundin Exp $
+/* $Id: irplib_polynomial.h,v 1.10 2013-01-29 08:43:33 jtaylor Exp $
  *
  * This file is part of the ESO Common Pipeline Library
  * Copyright (C) 2007 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
  */
 
 /*
- * $Author: llundin $
- * $Date: 2012/01/12 10:40:21 $
- * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-01-29 08:43:33 $
+ * $Revision: 1.10 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_POLYNOMIAL_H
diff --git a/irplib/irplib_ppm.c b/irplib/irplib_ppm.c
index 55e754b..74e9fd6 100644
--- a/irplib/irplib_ppm.c
+++ b/irplib/irplib_ppm.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_ppm.c,v 1.31 2012/06/11 07:24:09 llundin Exp $
+/* $Id: irplib_ppm.c,v 1.31 2012-06-11 07:24:09 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2012/06/11 07:24:09 $
+ * $Date: 2012-06-11 07:24:09 $
  * $Revision: 1.31 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_ppm.h b/irplib/irplib_ppm.h
index d27c021..5639665 100644
--- a/irplib/irplib_ppm.h
+++ b/irplib/irplib_ppm.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_ppm.h,v 1.5 2007/07/23 09:27:07 yjung Exp $
+/* $Id: irplib_ppm.h,v 1.5 2007-07-23 09:27:07 yjung Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: yjung $
- * $Date: 2007/07/23 09:27:07 $
+ * $Date: 2007-07-23 09:27:07 $
  * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_PPM_H
diff --git a/irplib/irplib_slitpos.c b/irplib/irplib_slitpos.c
index 5bcc797..346a02a 100644
--- a/irplib/irplib_slitpos.c
+++ b/irplib/irplib_slitpos.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_slitpos.c,v 1.30 2011/11/23 13:58:45 yjung Exp $
+/* $Id: irplib_slitpos.c,v 1.31 2013-07-04 12:10:12 jtaylor Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: yjung $
- * $Date: 2011/11/23 13:58:45 $
- * $Revision: 1.30 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-07-04 12:10:12 $
+ * $Revision: 1.31 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -456,7 +456,7 @@ cpl_error_code irplib_slitpos_find_vert_slit_ends(const cpl_image * self,
 #else
 
     itop = npix - 1;
-    while (itop > ibot && pbinary[itop] != CPL_BINARY_1) itop--;
+    while (itop > ibot && pbinary[itop] == CPL_BINARY_0) itop--;
 
 #endif
 
diff --git a/irplib/irplib_slitpos.h b/irplib/irplib_slitpos.h
index 7f666c8..5b124fe 100644
--- a/irplib/irplib_slitpos.h
+++ b/irplib/irplib_slitpos.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_slitpos.h,v 1.6 2006/11/29 13:22:59 yjung Exp $
+/* $Id: irplib_slitpos.h,v 1.6 2006-11-29 13:22:59 yjung Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: yjung $
- * $Date: 2006/11/29 13:22:59 $
+ * $Date: 2006-11-29 13:22:59 $
  * $Revision: 1.6 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_SLITPOS_H
diff --git a/irplib/irplib_spectrum.c b/irplib/irplib_spectrum.c
index 9210387..1174ddd 100644
--- a/irplib/irplib_spectrum.c
+++ b/irplib/irplib_spectrum.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_spectrum.c,v 1.29 2012/01/12 11:50:41 llundin Exp $
+/* $Id: irplib_spectrum.c,v 1.29 2012-01-12 11:50:41 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2012/01/12 11:50:41 $
+ * $Date: 2012-01-12 11:50:41 $
  * $Revision: 1.29 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_spectrum.h b/irplib/irplib_spectrum.h
index 9b289b2..00fca96 100644
--- a/irplib/irplib_spectrum.h
+++ b/irplib/irplib_spectrum.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_spectrum.h,v 1.7 2009/07/30 12:38:37 yjung Exp $
+/* $Id: irplib_spectrum.h,v 1.7 2009-07-30 12:38:37 yjung Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: yjung $
- * $Date: 2009/07/30 12:38:37 $
+ * $Date: 2009-07-30 12:38:37 $
  * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_SPECTRUM_H
diff --git a/irplib/irplib_stdstar.c b/irplib/irplib_stdstar.c
index c55af06..71b1fa9 100644
--- a/irplib/irplib_stdstar.c
+++ b/irplib/irplib_stdstar.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_stdstar.c,v 1.41 2012/05/04 13:58:12 cgarcia Exp $
+/* $Id: irplib_stdstar.c,v 1.45 2013-03-01 10:27:07 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cgarcia $
- * $Date: 2012/05/04 13:58:12 $
- * $Revision: 1.41 $
- * $Name: fors-4_9_23 $
+ * $Author: llundin $
+ * $Date: 2013-03-01 10:27:07 $
+ * $Revision: 1.45 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -33,15 +33,25 @@
                                    Includes
  -----------------------------------------------------------------------------*/
 
+#include "irplib_stdstar.h"
+#include "irplib_utils.h"
+#include "irplib_wcs.h"
+#include <cpl.h>
+
 #include <string.h>
 #include <math.h>
 #include <float.h>
 
-#include <cpl.h>
+/*-----------------------------------------------------------------------------
+                                   Defines
+ -----------------------------------------------------------------------------*/
 
-#include "irplib_stdstar.h"
-#include "irplib_utils.h"
-#include "irplib_wcs.h"
+#if defined CPL_VERSION_CODE && CPL_VERSION_CODE >= CPL_VERSION(6, 3, 0)
+#define IRPLIB_FRAMESET_GET_CONST cpl_frameset_get_position_const
+#else
+/* Remove this branch once CPL versions less than 6.3 are no longer supported */
+#define IRPLIB_FRAMESET_GET_CONST cpl_frameset_get_frame_const
+#endif
 
 
 /*----------------------------------------------------------------------------*/
@@ -58,7 +68,7 @@
 /*----------------------------------------------------------------------------*/
 /**
   @brief    Write the ASCII catalogs as FITS files
-  @param    set_in          Input frameset wher the product is registered
+  @param    set_in          Input frameset where the product is registered
   @param    set_raw         Set of ASCII catalogs
   @param    recipe_name     Recipe name
   @param    pro_cat         PRO.CATG
@@ -66,7 +76,7 @@
   @param    package_name    Usually PACKAGE "/" PACKAGE_VERSION
   @param    ins_name        Instrument name
   @param    convert_ascii_table Conversion function
-  @return   0 if ok, -1 in error case
+  @return   CPL_ERROR_NONE if ok or else the relevant CPL error code
 
   Every catalog will be written in a different extension, where EXTNAME
   is the name of the catalog ASCII file name.
@@ -75,98 +85,97 @@
   should be defined in each instrument
  */
 /*----------------------------------------------------------------------------*/
-int irplib_stdstar_write_catalogs(
-        cpl_frameset        *   set_in,
-        const cpl_frameset  *   set_raw,
-        const char          *   recipe_name,
-        const char          *   pro_cat,
-        const char          *   pro_type,
-        const char          *   package_name,
-        const char          *   ins_name,
-        cpl_table * (*convert_ascii_table)(const char *))
+cpl_error_code
+irplib_stdstar_write_catalogs(cpl_frameset        *   set_in,
+                              const cpl_frameset  *   set_raw,
+                              const char          *   recipe_name,
+                              const char          *   pro_cat,
+                              const char          *   pro_type,
+                              const char          *   package_name,
+                              const char          *   ins_name,
+                              cpl_table * (*convert_ascii_table)(const char *))
 {
-    cpl_table           *   out ;
-    cpl_propertylist    *   plist ;
-    cpl_propertylist    *   plist_ext ;
-    cpl_parameterlist   *   parlist ;
-    const char          *   cat_name ;
-    char                *   out_name ;
-    int                     nb_catalogs ;
-    const cpl_frame     *   cur_frame ;
-    int                     i ;
+    /* Number of catalogs */
+    const cpl_size     nb_catalogs = cpl_frameset_get_size(set_raw);
+    cpl_propertylist * plist_ext;
+    char             * out_name;
+    cpl_error_code     error = CPL_ERROR_NONE;
+    cpl_size           i;
 
     /* Check entries */
-    if (set_in == NULL) return CPL_ERROR_NULL_INPUT;
-    if (set_raw == NULL) return CPL_ERROR_NULL_INPUT;
-    if (recipe_name == NULL) return CPL_ERROR_NULL_INPUT;
-    if (pro_cat == NULL) return CPL_ERROR_NULL_INPUT;
-    if (ins_name == NULL) return CPL_ERROR_NULL_INPUT;
+    if (set_in == NULL) return cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+    if (set_raw == NULL) return cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+    if (recipe_name == NULL) return cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+    if (pro_cat == NULL) return cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+    if (ins_name == NULL) return cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+    if (convert_ascii_table == NULL) return
+        cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
 
     /* Define the file name */
-    out_name = cpl_sprintf("%s.fits", recipe_name) ;
+    out_name = cpl_sprintf("%s" CPL_DFS_FITS, recipe_name);
     
-    /* Number of catalogs */
-    nb_catalogs = cpl_frameset_get_size(set_raw) ;
-
-    /* Get the catalog name */
-    cur_frame = cpl_frameset_get_frame_const(set_raw, 0) ;
-    cat_name = cpl_frame_get_filename(cur_frame) ;
-    
-    /* Create the output table */
-    if ((out = convert_ascii_table(cat_name)) == NULL) {
-        cpl_free(out_name) ;
-        return CPL_ERROR_UNSPECIFIED;
-    }
-
-    /* Some keywords  */
-    plist = cpl_propertylist_new() ;
-    cpl_propertylist_append_string(plist, "INSTRUME", ins_name) ;
-    cpl_propertylist_append_string(plist, CPL_DFS_PRO_CATG, pro_cat) ;
-    if (pro_type != NULL) {
-        cpl_propertylist_append_string(plist, CPL_DFS_PRO_TYPE, pro_type) ;
-    }
-    plist_ext = cpl_propertylist_new() ;
-    cpl_propertylist_append_string(plist_ext, "EXTNAME", cat_name) ;
-
-    /* Write the table */
-    parlist = cpl_parameterlist_new() ;
-    cpl_dfs_save_table(set_in, 
-            NULL,
-            parlist,
-            set_raw,
-            NULL,
-            out,
-            plist_ext,
-            recipe_name,
-            plist,
-            NULL,
-            package_name,
-            out_name) ;
-    cpl_parameterlist_delete(parlist) ;
-    cpl_propertylist_delete(plist) ;
-    cpl_propertylist_delete(plist_ext) ;
-    cpl_table_delete(out) ;
+    plist_ext = cpl_propertylist_new();
     
-    /* Append the next catalogs */
-    for (i=1 ; i<nb_catalogs ; i++) {
+    /* Process the catalogs */
+    for (i = 0; i < nb_catalogs; i++) {
         /* Get the catalog name */
-        cur_frame = cpl_frameset_get_frame_const(set_raw, i) ;
-        cat_name = cpl_frame_get_filename(cur_frame) ;
+        const cpl_frame * cur_frame = IRPLIB_FRAMESET_GET_CONST(set_raw, i);
+        const char      * cat_name = cpl_frame_get_filename(cur_frame);
+
+        cpl_table       * out = convert_ascii_table(cat_name);
      
         /* Create the output table */
-        if ((out = convert_ascii_table(cat_name)) == NULL) {
-            cpl_free(out_name) ;
-            return CPL_ERROR_UNSPECIFIED;
+        if (out == NULL) {
+            error = cpl_error_get_code() ? cpl_error_set_where(cpl_func)
+                : cpl_error_set(cpl_func, CPL_ERROR_UNSPECIFIED);
+            break;
         }
 
-        plist_ext = cpl_propertylist_new() ;
-        cpl_propertylist_append_string(plist_ext, "EXTNAME", cat_name) ;
-        cpl_table_save(out, NULL, plist_ext, out_name, CPL_IO_EXTEND) ;
-        cpl_table_delete(out) ;
-        cpl_propertylist_delete(plist_ext) ;
+        if (cpl_table_get_nrow(out) == 0) {
+            cpl_table_delete(out);
+            error = cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND,
+                                          "Empty catalogue %d in '%s'",
+                                          (int)i+1, cat_name);
+            break;
+        }
+
+        cpl_propertylist_update_string(plist_ext, "EXTNAME", cat_name);
+
+        /* Write the table */
+        if (i == 0) {
+            cpl_parameterlist * parlist = cpl_parameterlist_new();
+            cpl_propertylist  * plist   = cpl_propertylist_new();
+
+            /* Mandatory keywords */
+            cpl_propertylist_append_string(plist, "INSTRUME", ins_name);
+            cpl_propertylist_append_string(plist, CPL_DFS_PRO_CATG, pro_cat);
+            if (pro_type != NULL) {
+                cpl_propertylist_append_string(plist, CPL_DFS_PRO_TYPE,
+                                               pro_type);
+            }
+
+            error = cpl_dfs_save_table(set_in, NULL, parlist, set_raw, NULL,
+                                       out, plist_ext, recipe_name, plist,
+                                       NULL, package_name, out_name);
+            cpl_parameterlist_delete(parlist);
+            cpl_propertylist_delete(plist);
+        } else {
+            error = cpl_table_save(out, NULL, plist_ext, out_name,
+                                   CPL_IO_EXTEND);
+        }
+
+        cpl_table_delete(out);
+
+        if (error) {
+            (void)cpl_error_set_where(cpl_func);
+            break;
+        }
     }
-    cpl_free(out_name) ;
-    return 0 ;
+
+    cpl_propertylist_delete(plist_ext);
+    cpl_free(out_name);
+
+    return error;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -187,75 +196,75 @@ cpl_table * irplib_stdstar_load_catalog(
         const char  *   filename, 
         const char  *   ext_name)
 {
-    int                     next ;
-    cpl_propertylist    *   plist ;
-    const char          *   cur_name ;
-    cpl_table           *   out ;
-    cpl_table           *   out_cur ;
-    cpl_frame           *   cur_frame ;
-    int                     i ;
+    int                     next;
+    cpl_propertylist    *   plist;
+    const char          *   cur_name;
+    cpl_table           *   out;
+    cpl_table           *   out_cur;
+    cpl_frame           *   cur_frame;
+    int                     i;
 
     /* Check entries */
-    if (filename == NULL) return NULL ;
-    if (ext_name == NULL) return NULL ;
+    if (filename == NULL) return NULL;
+    if (ext_name == NULL) return NULL;
     
     /* Initialise */
-    out = NULL ;
+    out = NULL;
     
     /* Get the number of extensions in the catalog */
-    cur_frame = cpl_frame_new() ;
-    cpl_frame_set_filename(cur_frame, filename) ;
-    next = cpl_frame_get_nextensions(cur_frame) ;
-    cpl_frame_delete(cur_frame) ;
+    cur_frame = cpl_frame_new();
+    cpl_frame_set_filename(cur_frame, filename);
+    next = cpl_frame_get_nextensions(cur_frame);
+    cpl_frame_delete(cur_frame);
 
     /* Loop on the extentions */
-    for (i=0 ; i<next ; i++) {
+    for (i=0; i<next; i++) {
         /* Check the name of the current extension */
         if ((plist = cpl_propertylist_load_regexp(filename, i+1, "EXTNAME", 
                         0)) == NULL) {
             cpl_msg_error(cpl_func, "Cannot load header of %d th extension",
                     i+1);
-            return NULL ;
+            return NULL;
         }
-        cur_name = cpl_propertylist_get_string(plist, "EXTNAME") ;
+        cur_name = cpl_propertylist_get_string(plist, "EXTNAME");
         
         /* Check the current extension */
         if (!strcmp(cur_name, ext_name)) {
             /* Load the table */
             if (out == NULL) {
-                out = cpl_table_load(filename, i+1, 1) ;
+                out = cpl_table_load(filename, i+1, 1);
                 cpl_table_new_column(out, IRPLIB_STDSTAR_CAT_COL, CPL_TYPE_STRING);
                 cpl_table_fill_column_window_string(out, IRPLIB_STDSTAR_CAT_COL,
                                                     0, cpl_table_get_nrow(out),
                                                     cur_name);
                 if (out == NULL) {
-                    cpl_msg_error(cpl_func, "Cannot load extension %d", i+1) ;
-                    cpl_propertylist_delete(plist) ;
-                    return NULL ;
+                    cpl_msg_error(cpl_func, "Cannot load extension %d", i+1);
+                    cpl_propertylist_delete(plist);
+                    return NULL;
                 }
             }
         } else if (!strcmp(ext_name, "all")) {
             /* Load the table and append it */
             if (i==0) {
                 /* Load the first table */
-                out = cpl_table_load(filename, i+1, 1) ;
+                out = cpl_table_load(filename, i+1, 1);
                 cpl_table_new_column(out, IRPLIB_STDSTAR_CAT_COL, CPL_TYPE_STRING);
                 cpl_table_fill_column_window_string(out, IRPLIB_STDSTAR_CAT_COL,
                                                     0, cpl_table_get_nrow(out),
                                                     cur_name);
                 if (out == NULL) {
-                    cpl_msg_error(cpl_func, "Cannot load extension %d", i+1) ;
-                    cpl_propertylist_delete(plist) ; 
-                    return NULL ;
+                    cpl_msg_error(cpl_func, "Cannot load extension %d", i+1);
+                    cpl_propertylist_delete(plist); 
+                    return NULL;
                 }
             } else {
                 /* Load the current table */
-                out_cur = cpl_table_load(filename, i+1, 1) ;
+                out_cur = cpl_table_load(filename, i+1, 1);
                 if (out_cur == NULL) {
-                    cpl_msg_error(cpl_func, "Cannot load extension %d", i+1) ;
-                    cpl_table_delete(out) ;
-                    cpl_propertylist_delete(plist) ; 
-                    return NULL ;
+                    cpl_msg_error(cpl_func, "Cannot load extension %d", i+1);
+                    cpl_table_delete(out);
+                    cpl_propertylist_delete(plist); 
+                    return NULL;
                 }
                 cpl_table_new_column(out_cur, IRPLIB_STDSTAR_CAT_COL, CPL_TYPE_STRING);
                 cpl_table_fill_column_window_string(out_cur, IRPLIB_STDSTAR_CAT_COL,
@@ -264,18 +273,18 @@ cpl_table * irplib_stdstar_load_catalog(
                 /* Append the table */
                 if (cpl_table_insert(out, out_cur, 
                             cpl_table_get_nrow(out)) != CPL_ERROR_NONE) {
-                    cpl_msg_error(cpl_func, "Cannot merge table %d", i+1) ;
-                    cpl_table_delete(out) ;
-                    cpl_table_delete(out_cur) ;
-                    cpl_propertylist_delete(plist) ; 
-                    return NULL ;
+                    cpl_msg_error(cpl_func, "Cannot merge table %d", i+1);
+                    cpl_table_delete(out);
+                    cpl_table_delete(out_cur);
+                    cpl_propertylist_delete(plist); 
+                    return NULL;
                 }
-                cpl_table_delete(out_cur) ;
+                cpl_table_delete(out_cur);
             }
         }
-        cpl_propertylist_delete(plist) ;
+        cpl_propertylist_delete(plist);
     }
-    return out ;
+    return out;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -342,34 +351,34 @@ int irplib_stdstar_select_stars_dist(
         double          dec, 
         double          dist)
 {
-    double              distance ;
-    int                 nrows ;
-    int                 i ;
+    double              distance;
+    int                 nrows;
+    int                 i;
     
     /* Check entries */
     if (cat == NULL) return -1;
 
     /* Get the number of selected rows */
-    nrows = cpl_table_get_nrow(cat) ;
+    nrows = cpl_table_get_nrow(cat);
     
     /* Check if the columns are there */
     if (!cpl_table_has_column(cat, IRPLIB_STDSTAR_RA_COL)) {
-        cpl_msg_error(cpl_func, "Missing %s column", IRPLIB_STDSTAR_RA_COL) ;
-        return -1 ;
+        cpl_msg_error(cpl_func, "Missing %s column", IRPLIB_STDSTAR_RA_COL);
+        return -1;
     }
     if (!cpl_table_has_column(cat, IRPLIB_STDSTAR_DEC_COL)) {
-        cpl_msg_error(cpl_func, "Missing %s column", IRPLIB_STDSTAR_DEC_COL) ;
-        return -1 ;
+        cpl_msg_error(cpl_func, "Missing %s column", IRPLIB_STDSTAR_DEC_COL);
+        return -1;
     }
     
     /* Compute distances of the selected rows */
-    for (i=0 ; i<nrows ; i++) {
+    for (i=0; i<nrows; i++) {
         if (cpl_table_is_selected(cat, i)) {
             /* The row is selected - compute the distance */
             distance = irplib_wcs_great_circle_dist(ra, dec, 
                     cpl_table_get_double(cat, IRPLIB_STDSTAR_RA_COL, i, NULL),
                     cpl_table_get_double(cat, IRPLIB_STDSTAR_DEC_COL, i, NULL));            
-            if (distance > dist) cpl_table_unselect_row(cat, i) ;
+            if (distance > dist) cpl_table_unselect_row(cat, i);
         }
     }
     return 0;
@@ -390,24 +399,24 @@ int irplib_stdstar_select_stars_mag(
         const char  *   mag_colname)
 {
     /* Check entries */
-    if (cat == NULL) return -1 ;
-    if (mag_colname == NULL) return -1 ;
+    if (cat == NULL) return -1;
+    if (mag_colname == NULL) return -1;
 
     /* Check that the table has the mag column */
     if (!cpl_table_has_column(cat, mag_colname)) {
         cpl_msg_error(cpl_func, "Column %s does not exist in the catalog",
-                mag_colname) ;
-        return -1 ;
+                mag_colname);
+        return -1;
     }
 
     /* Apply the selection */
     if (cpl_table_and_selected_double(cat, mag_colname, CPL_NOT_GREATER_THAN, 
                 98.0) <= 0) {
         cpl_msg_error(cpl_func, "Column %s does not exist in the catalog",
-                mag_colname) ;
-        return -1 ;
+                mag_colname);
+        return -1;
     }
-    return 0 ;
+    return 0;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -426,45 +435,45 @@ int irplib_stdstar_find_closest(
         double                  ra, 
         double                  dec)
 {
-    double              min_dist, distance ;
-    int                 nrows ;
-    int                 ind ;
-    int                 i ;
+    double              min_dist, distance;
+    int                 nrows;
+    int                 ind;
+    int                 i;
 
     /* Check entries */
-    if (cat == NULL) return -1 ;
+    if (cat == NULL) return -1;
 
     /* Initialize */
-    min_dist = 1000.0 ;
-    ind = -1 ;
+    min_dist = 1000.0;
+    ind = -1;
 
     /* Get the number of selected rows */
-    nrows = cpl_table_get_nrow(cat) ;
+    nrows = cpl_table_get_nrow(cat);
 
     /* Check if the columns are there */
     if (!cpl_table_has_column(cat, IRPLIB_STDSTAR_RA_COL)) {
-        cpl_msg_error(cpl_func, "Missing %s column", IRPLIB_STDSTAR_RA_COL) ;
-        return -1 ;
+        cpl_msg_error(cpl_func, "Missing %s column", IRPLIB_STDSTAR_RA_COL);
+        return -1;
     }
     if (!cpl_table_has_column(cat, IRPLIB_STDSTAR_DEC_COL)) {
-        cpl_msg_error(cpl_func, "Missing %s column", IRPLIB_STDSTAR_DEC_COL) ;
-        return -1 ;
+        cpl_msg_error(cpl_func, "Missing %s column", IRPLIB_STDSTAR_DEC_COL);
+        return -1;
     }
     
     /* Compute distances of the selected rows */
-    for (i=0 ; i<nrows ; i++) {
+    for (i=0; i<nrows; i++) {
         if (cpl_table_is_selected(cat, i)) {
             /* The row is selected - compute the distance */
             distance = irplib_wcs_great_circle_dist(ra, dec,
                     cpl_table_get_double(cat, IRPLIB_STDSTAR_RA_COL, i, NULL),
                     cpl_table_get_double(cat, IRPLIB_STDSTAR_DEC_COL, i, NULL));
             if (distance <= min_dist) {
-                min_dist = distance ;
-                ind = i ;
+                min_dist = distance;
+                ind = i;
             }
         }
     }
-    return ind ;
+    return ind;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -481,7 +490,7 @@ int irplib_stdstar_find_closest(
   @param    star_ra  the star RA from the catalog (output)
   @param    star_dec the star DEC from the catalog (output)
   @param    dist_am  the distance in arc minutes
-  @return   CPL_ERROR_NONE if ok, or an appropiate error case otherwise
+  @return   CPL_ERROR_NONE if ok or else the relevant CPL error code
 
   The closest star to ra, dec with defined magnitude is search in all the 
   catalogues included in catfile.
@@ -504,9 +513,9 @@ cpl_error_code irplib_stdstar_find_star(
         double                  dist_am)
 {
     cpl_errorstate prestate = cpl_errorstate_get();
-    cpl_table   *   catal ;
-    const double    dist = dist_am / 60.0 ;
-    int             ind ;
+    cpl_table   *   catal;
+    const double    dist = dist_am / 60.0;
+    int             ind;
 
     /* Check entries */
     if (catfile == NULL) return cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
@@ -528,28 +537,28 @@ cpl_error_code irplib_stdstar_find_star(
     
     /* Select stars with known magnitude */
     if (irplib_stdstar_select_stars_mag(catal, band) == -1) {
-        cpl_table_delete(catal) ;
+        cpl_table_delete(catal);
         return cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
                                            "Cannot select stars in that band");
     }
 
     /* Select stars within a given distance */
     if (irplib_stdstar_select_stars_dist(catal, ra, dec, dist) == -1) {
-        cpl_table_delete(catal) ;
+        cpl_table_delete(catal);
         return cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
                                            "Cannot select close stars");
     }
 
     /* Take the closest */
     if ((ind=irplib_stdstar_find_closest(catal, ra, dec)) < 0) {
-        cpl_table_delete(catal) ;
+        cpl_table_delete(catal);
         return cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
                                            "Cannot get the closest star with "
                                            "known %s magnitude",band);
     }
 
     if(mag != NULL)
-        *mag = cpl_table_get_double(catal, band, ind, NULL) ;
+        *mag = cpl_table_get_double(catal, band, ind, NULL);
 
     if(name != NULL)
     {
@@ -604,47 +613,47 @@ cpl_vector * irplib_stdstar_get_conversion(
         double                  gain,
         double                  mag)
 {
-    double                      h = 6.62e-27 ;
-    double                      c = 3e18 ;
-    const cpl_vector    *       wave ;
-    const cpl_vector    *       extr ;
-    cpl_vector          *       out ;
-    double                      factor ;
+    double                      h = 6.62e-27;
+    double                      c = 3e18;
+    const cpl_vector    *       wave;
+    const cpl_vector    *       extr;
+    cpl_vector          *       out;
+    double                      factor;
 
     /* Test entries */
-    if (spec == NULL) return NULL ;
-    if (dit <= 0.0) return NULL ;
+    if (spec == NULL) return NULL;
+    if (dit <= 0.0) return NULL;
 
     /* Get the extracted spectrum */
-    wave = cpl_bivector_get_x_const(spec) ;
-    extr = cpl_bivector_get_y_const(spec) ;
+    wave = cpl_bivector_get_x_const(spec);
+    extr = cpl_bivector_get_y_const(spec);
 
     /* Get the spectrum */
-    out = cpl_vector_duplicate(extr) ;
+    out = cpl_vector_duplicate(extr);
 
     /* Divide by DIT */
-    cpl_vector_divide_scalar(out, dit) ;
+    cpl_vector_divide_scalar(out, dit);
 
     /* Divide by the surface */
-    cpl_vector_divide_scalar(out, surface) ;
+    cpl_vector_divide_scalar(out, surface);
 
     /* Multiply by the gain */
-    cpl_vector_multiply_scalar(out, gain) ;
+    cpl_vector_multiply_scalar(out, gain);
 
     /* Multiply by the difference magnitude */
-    factor = pow(10, mag/2.5) ;
-    cpl_vector_multiply_scalar(out, factor) ;
+    factor = pow(10, mag/2.5);
+    cpl_vector_multiply_scalar(out, factor);
 
     /* Divide by the dispersion */
     factor = (cpl_vector_get(wave, cpl_vector_get_size(wave)-1) -
-            cpl_vector_get(wave, 0)) / cpl_vector_get_size(wave) ;
-    cpl_vector_divide_scalar(out, factor) ;
+            cpl_vector_get(wave, 0)) / cpl_vector_get_size(wave);
+    cpl_vector_divide_scalar(out, factor);
 
     /* Multiply by the energy of the photon */
-    cpl_vector_multiply_scalar(out, h*c) ;
-    cpl_vector_divide(out, wave) ;
+    cpl_vector_multiply_scalar(out, h*c);
+    cpl_vector_divide(out, wave);
 
-    return out ;
+    return out;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -661,91 +670,93 @@ cpl_vector * irplib_stdstar_get_mag_zero(
         const cpl_vector    *   waves,
         double                  cent_wl)
 {
-    double              wmin, wmax, wstep ;
-    int                 nb_sed ;
-    const double    *   sed_x ;
-    const double    *   sed_y ;
-    cpl_bivector    *   sed_loc ;
-    double          *   sed_loc_x ;
-    double          *   sed_loc_y ;
-    cpl_vector      *   out ;
-    cpl_bivector    *   out_biv ;
-    double              f0_jan, f0_erg, cent_val ;
-    int                 i ;
+    double              wmin, wmax, wstep;
+    int                 nb_sed;
+    const double    *   sed_x;
+    const double    *   sed_y;
+    cpl_bivector    *   sed_loc;
+    double          *   sed_loc_x;
+    double          *   sed_loc_y;
+    cpl_vector      *   out;
+    cpl_bivector    *   out_biv;
+    double              f0_jan, f0_erg, cent_val;
+    int                 i;
 
     /* Test entries */
-    if (sed == NULL) return NULL ;
-    if (waves == NULL) return NULL ;
+    if (sed == NULL) return NULL;
+    if (waves == NULL) return NULL;
 
     /* Initialise */
-    nb_sed = cpl_bivector_get_size(sed) ;
-    sed_x = cpl_bivector_get_x_data_const(sed) ;
-    sed_y = cpl_bivector_get_y_data_const(sed) ;
-    wstep = sed_x[1] - sed_x[0] ;
-    wmin = cpl_vector_get(waves, 0) ;
-    wmax = cpl_vector_get(waves, cpl_vector_get_size(waves)-1) ;
+    nb_sed = cpl_bivector_get_size(sed);
+    sed_x = cpl_bivector_get_x_data_const(sed);
+    sed_y = cpl_bivector_get_y_data_const(sed);
+    wstep = sed_x[1] - sed_x[0];
+    wmin = cpl_vector_get(waves, 0);
+    wmax = cpl_vector_get(waves, cpl_vector_get_size(waves)-1);
 
     /* Expand sed with 0 to have it bigger than the required wavelengths */
-    sed_loc = cpl_bivector_new(nb_sed + 4) ;
-    sed_loc_x = cpl_bivector_get_x_data(sed_loc) ;
-    sed_loc_y = cpl_bivector_get_y_data(sed_loc) ;
-    for (i=0 ; i<nb_sed ; i++) {
-        sed_loc_x[i+2] = sed_x[i] ;
-        sed_loc_y[i+2] = sed_y[i] ;
+    sed_loc = cpl_bivector_new(nb_sed + 4);
+    sed_loc_x = cpl_bivector_get_x_data(sed_loc);
+    sed_loc_y = cpl_bivector_get_y_data(sed_loc);
+    for (i=0; i<nb_sed; i++) {
+        sed_loc_x[i+2] = sed_x[i];
+        sed_loc_y[i+2] = sed_y[i];
     }
 
     /* Low bound */
-    sed_loc_x[1] = sed_loc_x[2] - wstep ;
+    sed_loc_x[1] = sed_loc_x[2] - wstep;
     if (sed_loc_x[2] < wmin) {
-        sed_loc_x[0] = sed_loc_x[1] - wstep ;
+        sed_loc_x[0] = sed_loc_x[1] - wstep;
     } else {
-        sed_loc_x[0] = wmin - wstep ;
+        sed_loc_x[0] = wmin - wstep;
     }
-    sed_loc_y[0] = 1e-20 ;
-    sed_loc_y[1] = 1e-20 ;
+    sed_loc_y[0] = 1e-20;
+    sed_loc_y[1] = 1e-20;
 
     /* High bound */
-    sed_loc_x[nb_sed+2] = sed_loc_x[nb_sed+1] + wstep ;
+    sed_loc_x[nb_sed+2] = sed_loc_x[nb_sed+1] + wstep;
     if (sed_loc_x[nb_sed+1] > wmax) {
-        sed_loc_x[nb_sed+3] = sed_loc_x[nb_sed+2] + wstep ;
+        sed_loc_x[nb_sed+3] = sed_loc_x[nb_sed+2] + wstep;
     } else {
-        sed_loc_x[nb_sed+3] = wmax + wstep ;
+        sed_loc_x[nb_sed+3] = wmax + wstep;
     }
-    sed_loc_y[nb_sed+2] = 1e-20 ;
-    sed_loc_y[nb_sed+3] = 1e-20 ;
+    sed_loc_y[nb_sed+2] = 1e-20;
+    sed_loc_y[nb_sed+3] = 1e-20;
 
     /* Create the output bivector */
-    out = cpl_vector_duplicate(waves) ;
-    out_biv = cpl_bivector_wrap_vectors((cpl_vector*)waves, out) ;
-
+    out = cpl_vector_duplicate(waves);
+    IRPLIB_DIAG_PRAGMA_PUSH_IGN(-Wcast-qual);
+    /* the X entry (waves) is not modified by cpl_bivector_interpolate_linear */
+    out_biv = cpl_bivector_wrap_vectors((cpl_vector*)waves, out);
+    IRPLIB_DIAG_PRAGMA_POP;
     /* Interpolate */
     if (cpl_bivector_interpolate_linear(out_biv, sed_loc) != CPL_ERROR_NONE) {
-        cpl_msg_error(cpl_func, "Cannot interpolate the wavelength") ;
-        cpl_bivector_unwrap_vectors(out_biv) ;
-        cpl_vector_delete(out) ;
-        cpl_bivector_delete(sed_loc) ;
-        return NULL ;
+        cpl_msg_error(cpl_func, "Cannot interpolate the wavelength");
+        cpl_bivector_unwrap_vectors(out_biv);
+        cpl_vector_delete(out);
+        cpl_bivector_delete(sed_loc);
+        return NULL;
     }
-    cpl_bivector_unwrap_vectors(out_biv) ;
-    cpl_bivector_delete(sed_loc) ;
+    cpl_bivector_unwrap_vectors(out_biv);
+    cpl_bivector_delete(sed_loc);
 
     /* Compute f0_jan */
-    f0_jan = 5513.15 / ( pow(cent_wl,3) * (exp(1.2848/cent_wl)-1) ) ;
+    f0_jan = 5513.15 / ( pow(cent_wl,3) * (exp(1.2848/cent_wl)-1) );
 
     /* Convert f0 Jansky -> ergs/s/cm^2/Angstrom */
-    f0_erg = f0_jan * 1e-26 * 1e7 * 3e18 / (1e4 * cent_wl*cent_wl*1e4*1e4) ;
+    f0_erg = f0_jan * 1e-26 * 1e7 * 3e18 / (1e4 * cent_wl*cent_wl*1e4*1e4);
 
     /* Scale out so that the central value is f0 */
-    cent_val = cpl_vector_get(out, cpl_vector_get_size(out)/2) ;
+    cent_val = cpl_vector_get(out, cpl_vector_get_size(out)/2);
     if (cent_val <= 0.0) {
-        cpl_msg_error(cpl_func, "Negative or 0 central value") ;
-        cpl_vector_delete(out) ;
-        return NULL ;
+        cpl_msg_error(cpl_func, "Negative or 0 central value");
+        cpl_vector_delete(out);
+        return NULL;
     }
-    cpl_vector_multiply_scalar(out, f0_erg/cent_val) ;
+    cpl_vector_multiply_scalar(out, f0_erg/cent_val);
 
     /* Return */
-    return out ;
+    return out;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -763,61 +774,61 @@ cpl_bivector * irplib_stdstar_get_sed(
         const char  *   seds_file,
         const char  *   sptype)
 {
-    cpl_table           *   seds ;
-    cpl_bivector        *   out ;
-    cpl_vector          *   wave ;
-    cpl_vector          *   sed ;
-    cpl_bivector        *   tmp ;
-    int                     nlines ;
+    cpl_table           *   seds;
+    cpl_bivector        *   out;
+    cpl_vector          *   wave;
+    cpl_vector          *   sed;
+    cpl_bivector        *   tmp;
+    int                     nlines;
 
     /* Test entries */
-    if (seds_file == NULL) return NULL ;
-    if (sptype == NULL) return NULL ;
+    if (seds_file == NULL) return NULL;
+    if (sptype == NULL) return NULL;
 
     /* Load the table */
     if ((seds = cpl_table_load(seds_file, 1, 0)) == NULL) {
-        cpl_msg_error(cpl_func, "Cannot load the table") ;
-        return NULL ;
+        cpl_msg_error(cpl_func, "Cannot load the table");
+        return NULL;
     }
 
     /* Check if the column is there */
     if (!cpl_table_has_column(seds, sptype)) {
-        cpl_msg_error(cpl_func, "SED of the requested star not available") ;
-        cpl_table_delete(seds) ;
-        return NULL ;
+        cpl_msg_error(cpl_func, "SED of the requested star not available");
+        cpl_table_delete(seds);
+        return NULL;
     }
 
     /* Get the nb lines */
-    nlines = cpl_table_get_nrow(seds) ;
+    nlines = cpl_table_get_nrow(seds);
 
     /* Get the wavelength as a vector */
     if ((wave = cpl_vector_wrap(nlines,
             cpl_table_get_data_double(seds, "Wavelength"))) == NULL) {
-        cpl_msg_error(cpl_func, "Cannot get the Wavelength column") ;
-        cpl_table_delete(seds) ;
-        return NULL ;
+        cpl_msg_error(cpl_func, "Cannot get the Wavelength column");
+        cpl_table_delete(seds);
+        return NULL;
     }
 
     /* Get the SED as a vector */
     if ((sed = cpl_vector_wrap(nlines,
             cpl_table_get_data_double(seds, sptype))) == NULL) {
-        cpl_msg_error(cpl_func, "Cannot get the SED column") ;
-        cpl_table_delete(seds) ;
-        cpl_vector_unwrap(wave) ;
-        return NULL ;
+        cpl_msg_error(cpl_func, "Cannot get the SED column");
+        cpl_table_delete(seds);
+        cpl_vector_unwrap(wave);
+        return NULL;
     }
-    tmp = cpl_bivector_wrap_vectors(wave, sed) ;
+    tmp = cpl_bivector_wrap_vectors(wave, sed);
 
     /* Create the output bivector */
-    out = cpl_bivector_duplicate(tmp) ;
+    out = cpl_bivector_duplicate(tmp);
 
     /* Free */
-    cpl_bivector_unwrap_vectors(tmp) ;
-    cpl_vector_unwrap(wave) ;
-    cpl_vector_unwrap(sed) ;
-    cpl_table_delete(seds) ;
+    cpl_bivector_unwrap_vectors(tmp);
+    cpl_vector_unwrap(wave);
+    cpl_vector_unwrap(sed);
+    cpl_table_delete(seds);
 
     /* Return  */
-    return out ;
+    return out;
 }
 /**@}*/
diff --git a/irplib/irplib_stdstar.h b/irplib/irplib_stdstar.h
index 3b2d1dd..9657d34 100644
--- a/irplib/irplib_stdstar.h
+++ b/irplib/irplib_stdstar.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_stdstar.h,v 1.15 2011/12/14 08:53:04 cgarcia Exp $
+/* $Id: irplib_stdstar.h,v 1.16 2013-02-27 10:37:52 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cgarcia $
- * $Date: 2011/12/14 08:53:04 $
- * $Revision: 1.15 $
- * $Name: fors-4_9_23 $
+ * $Author: llundin $
+ * $Date: 2013-02-27 10:37:52 $
+ * $Revision: 1.16 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_STDSTAR_H
@@ -58,14 +58,16 @@
                                    Function prototypes
  -----------------------------------------------------------------------------*/
 
-int irplib_stdstar_write_catalogs(cpl_frameset *, const cpl_frameset *, 
-        const char *, const char *, const char *, const char *,
-        const char *, cpl_table * (*convert_ascii_table)(const char *)) ;
-cpl_table * irplib_stdstar_load_catalog(const char *, const char *) ;
+cpl_error_code
+irplib_stdstar_write_catalogs(cpl_frameset *, const cpl_frameset *,
+                              const char *, const char *, const char *,
+                              const char *, const char *,
+                              cpl_table * (*)(const char *));
+cpl_table * irplib_stdstar_load_catalog(const char *, const char *);
 cpl_error_code irplib_stdstar_check_columns_exist(const cpl_table  *);
-int irplib_stdstar_select_stars_dist(cpl_table *, double, double, double) ;
-int irplib_stdstar_select_stars_mag(cpl_table *, const char *) ;
-int irplib_stdstar_find_closest(const cpl_table *, double, double) ;
+int irplib_stdstar_select_stars_dist(cpl_table *, double, double, double);
+int irplib_stdstar_select_stars_mag(cpl_table *, const char *);
+int irplib_stdstar_find_closest(const cpl_table *, double, double);
 cpl_error_code irplib_stdstar_find_star(const char *, double, double, const char *, 
         const char *, double *, char **, char **, char **, 
         double *, double  * , double);
diff --git a/irplib/irplib_strehl.c b/irplib/irplib_strehl.c
index 96ae5fd..4e58397 100644
--- a/irplib/irplib_strehl.c
+++ b/irplib/irplib_strehl.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_strehl.c,v 1.43 2009/11/18 21:37:48 llundin Exp $
+/* $Id: irplib_strehl.c,v 1.43 2009-11-18 21:37:48 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2009/11/18 21:37:48 $
+ * $Date: 2009-11-18 21:37:48 $
  * $Revision: 1.43 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_strehl.h b/irplib/irplib_strehl.h
index 8007b07..4acce38 100644
--- a/irplib/irplib_strehl.h
+++ b/irplib/irplib_strehl.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_strehl.h,v 1.12 2009/06/29 14:32:53 kmirny Exp $
+/* $Id: irplib_strehl.h,v 1.12 2009-06-29 14:32:53 kmirny Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: kmirny $
- * $Date: 2009/06/29 14:32:53 $
+ * $Date: 2009-06-29 14:32:53 $
  * $Revision: 1.12 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_STREHL_H
diff --git a/irplib/irplib_utils.c b/irplib/irplib_utils.c
index bf51d13..2b13ab7 100644
--- a/irplib/irplib_utils.c
+++ b/irplib/irplib_utils.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_utils.c,v 1.79 2012/08/06 06:14:18 llundin Exp $
+/* $Id: irplib_utils.c,v 1.85 2013-07-04 12:10:55 jtaylor Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: llundin $
- * $Date: 2012/08/06 06:14:18 $
- * $Revision: 1.79 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-07-04 12:10:55 $
+ * $Revision: 1.85 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -32,15 +32,17 @@
 /*-----------------------------------------------------------------------------
                                    Includes
  -----------------------------------------------------------------------------*/
+#include "irplib_utils.h"
 
+#include <cpl.h>
 #include <math.h>
 
 #include <string.h>
 #include <assert.h>
+#include <stdlib.h>
+#include <errno.h>
 
-#include <cpl.h>
 
-#include "irplib_utils.h"
 
 /*-----------------------------------------------------------------------------
                            Defines
@@ -61,14 +63,6 @@
                            Missing Function Prototypes
  -----------------------------------------------------------------------------*/
 
-#if defined HAVE_ISNAN && HAVE_ISNAN != 0
-#if !defined isnan && defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 0
-/* HP-UX and Solaris may have isnan() available at link-time
-   without the prototype */
-int isnan(double);
-#endif
-#endif
-
 /*-----------------------------------------------------------------------------
                            Private Function Prototypes
  -----------------------------------------------------------------------------*/
@@ -891,6 +885,7 @@ irplib_dfs_table_convert(cpl_table               * self,
     cpl_propertylist * applist    = NULL;
     cpl_errorstate     prestate   = cpl_errorstate_get();
     cpl_error_code     error;
+    char             * fallback_filename = NULL;
 
     cpl_ensure_code(self         != NULL, CPL_ERROR_NULL_INPUT);
     cpl_ensure_code(allframes    != NULL, CPL_ERROR_NULL_INPUT);
@@ -914,8 +909,8 @@ irplib_dfs_table_convert(cpl_table               * self,
                                      "Consistency check of table failed");
     }
 
-    filename = product_name != NULL
-        ? product_name : cpl_sprintf("%s" CPL_DFS_FITS, recipe_name);
+    fallback_filename = cpl_sprintf("%s" CPL_DFS_FITS, recipe_name);
+    filename = product_name != NULL ? product_name : fallback_filename;
 
     applist = mainlist == NULL
         ? cpl_propertylist_new() : cpl_propertylist_duplicate(mainlist);
@@ -928,7 +923,7 @@ irplib_dfs_table_convert(cpl_table               * self,
                                       remregexp, pipe_id, filename);
 
     cpl_propertylist_delete(applist);
-    if (filename != product_name) cpl_free((char*)filename);
+    cpl_free(fallback_filename);
 
     /* Propagate the error, if any */
     cpl_ensure_code(!error, error);
@@ -1153,15 +1148,15 @@ int irplib_compare_tags(
         cpl_frame   *   frame1,
         cpl_frame   *   frame2)
 {
-    char            *   v1 ;
-    char            *   v2 ;
+    const char            *   v1 ;
+    const char            *   v2 ;
 
     /* Test entries */
     if (frame1==NULL || frame2==NULL) return -1 ;
 
     /* Get the tags */
-    if ((v1 = (char*)cpl_frame_get_tag(frame1)) == NULL) return -1 ;
-    if ((v2 = (char*)cpl_frame_get_tag(frame2)) == NULL) return -1 ;
+    if ((v1 = cpl_frame_get_tag(frame1)) == NULL) return -1 ;
+    if ((v2 = cpl_frame_get_tag(frame2)) == NULL) return -1 ;
 
     /* Compare the tags */
     if (strcmp(v1, v2)) return 0 ;
@@ -1289,34 +1284,6 @@ cpl_error_code irplib_apertures_find_max_flux(const cpl_apertures * self,
 
 }
 
-/*----------------------------------------------------------------------------*/
-/**
-   @brief   portable isinf
- */
-/*----------------------------------------------------------------------------*/
-int irplib_isinf(double value)
-{
-#if defined HAVE_ISINF && HAVE_ISINF
-    return isinf(value);
-#else
-    return value != 0 && value == 2 * value;
-#endif
-}
-
-/*----------------------------------------------------------------------------*/
-/**
-   @brief   portable isnan
- */
-/*----------------------------------------------------------------------------*/
-int irplib_isnan(double value)
-{
-#if defined HAVE_ISNAN && HAVE_ISNAN
-    return isnan(value);
-#else
-    return value != value;
-#endif
-}
-
 /**@}*/
 
 
@@ -1501,27 +1468,27 @@ static cpl_polynomial * irplib_polynomial_fit_1d_create_common(
     x_size = cpl_vector_get_size(x_pos);    
     if(fit1d != NULL && x_size > 1)
     {
-      cpl_matrix     * samppos = NULL;
-      cpl_vector     * fitresidual = NULL;
-		cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
-		samppos = cpl_matrix_wrap(1, x_size,
-												   (double*)cpl_vector_get_data_const(x_pos));
-		cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
-		fitresidual = cpl_vector_new(x_size);
-		cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
-		cpl_polynomial_fit(fit1d, samppos, NULL, values, NULL,
-						   CPL_FALSE, NULL, &loc_degree);
-		cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
-		cpl_vector_fill_polynomial_fit_residual(fitresidual, values, NULL, fit1d,
-												samppos, rechisq);
-		cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
-		if (mse)
-		{
-			*mse = cpl_vector_product(fitresidual, fitresidual)
-				/ cpl_vector_get_size(fitresidual);
-		}
-		cpl_matrix_unwrap(samppos);
-		cpl_vector_delete(fitresidual);
+        cpl_matrix     * samppos = NULL;
+        cpl_vector     * fitresidual = NULL;
+        cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
+        samppos = cpl_matrix_wrap(1, x_size,
+                                  (double*)cpl_vector_get_data_const(x_pos));
+        cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
+        fitresidual = cpl_vector_new(x_size);
+        cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
+        cpl_polynomial_fit(fit1d, samppos, NULL, values, NULL,
+                           CPL_FALSE, NULL, &loc_degree);
+        cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
+        cpl_vector_fill_polynomial_fit_residual(fitresidual, values, NULL,
+                                                fit1d, samppos, rechisq);
+        cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
+        if (mse)
+        {
+            *mse = cpl_vector_product(fitresidual, fitresidual)
+                / cpl_vector_get_size(fitresidual);
+        }
+        cpl_matrix_unwrap(samppos);
+        cpl_vector_delete(fitresidual);
     }
     return fit1d;
 }
@@ -1586,21 +1553,128 @@ cpl_error_code irplib_frameset_sort(const cpl_frameset *  self, int* iindex, dou
 
 static double frame_get_exptime(const cpl_frame * pframe)
 {
-    cpl_propertylist       *plist = 0;
-    double                  dval = 0;
+    double dval = 0;
+    cpl_propertylist * plist =
+        cpl_propertylist_load_regexp(cpl_frame_get_filename(pframe), 0,
+                                     "EXPTIME", CPL_FALSE);
+    if(plist) {
+        dval = cpl_propertylist_get_double(plist, "EXPTIME");
+        if (cpl_error_get_code() != CPL_ERROR_NONE) {
+            cpl_msg_error(cpl_func, "error during reading EXPTIME key from "
+                          "the frame [%s]", cpl_frame_get_filename(pframe));
+        }
+    }
+    /* Free and return */
+    cpl_propertylist_delete(plist);
+    return dval;
+}
 
-    plist = cpl_propertylist_load(cpl_frame_get_filename(pframe),0);
-	if(plist)
-	{
-      cpl_error_code err = CPL_ERROR_NONE;  
-	    dval = cpl_propertylist_get_double(plist, "EXPTIME");
-       err = cpl_error_get_code();
-       if (err != CPL_ERROR_NONE)
-       {
-         cpl_msg_error(cpl_func, "error during reading EXPTIME key from the frame [%s]", cpl_frame_get_filename(pframe));
-       }
-	}
-	/* Free and return */
-	cpl_propertylist_delete(plist);
-	return dval;
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    allocate uninitialized aligned memory
+  @param    alignment alignment of the data, must be a power of two
+  @param    size      size of the memory block to be allocated in bytes
+  @return   pointer to aligned memory or on failure returns NULL and sets errno
+  @see irplib_aligned_free
+  @note memory MUST be free'd with irplib_aligned_free and cannot be realloc'd
+        memory leaks will not be detected by cpl
+        It is recommended to build with posix 2001 to get posix_memalign and add
+        AC_CHECK_FUNCS([posix_memalign]) and AC_CHECK_DECLS([posix_memalign]) to
+        configure.ac
+
+ */
+/*----------------------------------------------------------------------------*/
+void * irplib_aligned_malloc(size_t alignment, size_t size)
+{
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L
+    return aligned_alloc(alignment, size);
+#elif defined HAVE_POSIX_MEMALIGN && defined HAVE_DECL_POSIX_MEMALIGN
+    void *ptr;
+    if (alignment == 1)
+        return malloc (size);
+    if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
+        alignment = sizeof (void *);
+    if (posix_memalign (&ptr, alignment, size) == 0)
+        return ptr;
+    else
+        return NULL;
+#else
+    /* copied from gmm_malloc.h in gcc-4.8 */
+    void * malloc_ptr;
+    void * aligned_ptr;
+
+    /* Error if align is not a power of two.  */
+    if (alignment & (alignment - 1)) {
+        errno = EINVAL;
+        return NULL;
+    }
+
+    if (size == 0)
+        return NULL;
+
+    /* Assume malloc'd pointer is aligned at least to sizeof (void*).
+       If necessary, add another sizeof (void*) to store the value
+       returned by malloc. Effectively this enforces a minimum alignment
+       of sizeof double. */
+    if (alignment < 2 * sizeof (void *))
+        alignment = 2 * sizeof (void *);
+
+    malloc_ptr = malloc (size + alignment);
+    if (!malloc_ptr)
+        return NULL;
+
+    /* Align  We have at least sizeof (void *) space below malloc'd ptr. */
+    aligned_ptr = (void *) (((size_t) malloc_ptr + alignment)
+                            & ~((size_t) (alignment) - 1));
+
+    /* Store the original pointer just before p.  */
+    *(((void **) aligned_ptr) - 1) = malloc_ptr;
+
+    return aligned_ptr;
+#endif
+}
+
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    allocate aligned memory initialized to zero
+  @param    alignment alignment of the data, must be a power of two
+  @param    nelem     number of elements in buffer
+  @param    nbytes    size of single element in bytes
+  @return   pointer to aligned memory or on failure returns NULL and sets errno
+  @see irplib_aligned_malloc
+
+ */
+/*----------------------------------------------------------------------------*/
+void * irplib_aligned_calloc(size_t alignment, size_t nelem, size_t nbytes)
+{
+    void * buffer = irplib_aligned_malloc(alignment, nelem * nbytes);
+    if (buffer == NULL)
+        return NULL;
+    /* cast to aligned pointer helps compilers to emit better (builtin) code */
+    memset((size_t *)buffer, 0, nelem * nbytes);
+    return buffer;
+}
+
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    free aligned memory
+  @param    aligned_ptr    pointer to memory to be free'd
+  @see irplib_aligned_malloc
+  @note memory MUST be allocated with irplib_aligned_[cm]alloc
+
+ */
+/*----------------------------------------------------------------------------*/
+void irplib_aligned_free (void * aligned_ptr)
+{
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L
+  free(aligned_ptr);
+#elif defined HAVE_POSIX_MEMALIGN && defined HAVE_DECL_POSIX_MEMALIGN
+  free(aligned_ptr);
+#else
+  if (aligned_ptr)
+      free (*(((void **) aligned_ptr) - 1));
+#endif
 }
diff --git a/irplib/irplib_utils.h b/irplib/irplib_utils.h
index be17274..7f7caa8 100644
--- a/irplib/irplib_utils.h
+++ b/irplib/irplib_utils.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_utils.h,v 1.56 2012/08/06 06:14:18 llundin Exp $
+/* $Id: irplib_utils.h,v 1.60 2013-08-21 14:55:14 cgarcia Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -19,11 +19,22 @@
  */
 
 /*
- * $Author: llundin $
- * $Date: 2012/08/06 06:14:18 $
- * $Revision: 1.56 $
- * $Name: fors-4_9_23 $
- * $Log: irplib_utils.h,v $
+ * $Author: cgarcia $
+ * $Date: 2013-08-21 14:55:14 $
+ * $Revision: 1.60 $
+ * $Name: not supported by cvs2svn $
+ * $Log: not supported by cvs2svn $
+ * Revision 1.59  2013/03/15 09:06:06  jtaylor
+ * add irplib_aligned_{[mc]alloc,free}
+ *
+ * allow portable allocation of aligned memory for vectorization
+ *
+ * Revision 1.58  2013/03/15 09:05:28  jtaylor
+ * move isnan and isinf to header so it is inlineable and use gcc builtin for better performance
+ *
+ * Revision 1.57  2013/02/27 16:02:02  jtaylor
+ * add diagnostic pragma macros
+ *
  * Revision 1.56  2012/08/06 06:14:18  llundin
  * irplib_errorstate_warning(): Replaced by cpl_errorstate_dump_one_warning() from CPL 6.X
  *
@@ -56,7 +67,7 @@
  -----------------------------------------------------------------------------*/
 
 #include <cpl.h>
-
+#include <math.h>
 #include <stdarg.h>
 
 /*-----------------------------------------------------------------------------
@@ -66,6 +77,30 @@
 #define IRPLIB_XSTRINGIFY(TOSTRING) #TOSTRING
 #define IRPLIB_STRINGIFY(TOSTRING) IRPLIB_XSTRINGIFY(TOSTRING)
 
+#if !defined __GNUC__ && !defined __inline__
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#define __inline__ inline
+#else
+#define __inline__
+#endif
+#endif
+
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#define IRPLIB_DIAG_PRAGMA_PUSH_IGN(x)        \
+    _Pragma("GCC diagnostic push") \
+    _Pragma(IRPLIB_STRINGIFY(GCC diagnostic ignored #x))
+#define IRPLIB_DIAG_PRAGMA_PUSH_ERR(x)        \
+    _Pragma("GCC diagnostic push") \
+    _Pragma(IRPLIB_STRINGIFY(GCC diagnostic error #x))
+#define IRPLIB_DIAG_PRAGMA_POP \
+    _Pragma("GCC diagnostic pop")
+#else
+#define IRPLIB_DIAG_PRAGMA_PUSH_IGN(x)
+#define IRPLIB_DIAG_PRAGMA_PUSH_ERR(x)
+#define IRPLIB_DIAG_PRAGMA_POP
+#endif
+
+
 /* FIXME: Remove when no longer used by any irplib-based pipelines */
 /* Useful for debugging */
 #define irplib_trace()  do if (cpl_error_get_code()) { \
@@ -401,8 +436,13 @@ const cpl_frame * irplib_frameset_get_first_from_group(const cpl_frameset *,
 cpl_error_code irplib_apertures_find_max_flux(const cpl_apertures *, int *,
                                               int);
 
-int irplib_isinf(double value);
-int irplib_isnan(double value);
+#if defined HAVE_ISNAN && HAVE_ISNAN != 0
+#if !defined isnan && defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 0
+/* HP-UX and Solaris may have isnan() available at link-time
+   without the prototype */
+int isnan(double);
+#endif
+#endif
 
 cpl_error_code
 irplib_dfs_table_convert(cpl_table *, cpl_frameset *, const cpl_frameset *,
@@ -463,4 +503,52 @@ cpl_error_code irplib_frameset_sort(
         int* iindex,
         double* exptime);
 
+
+/* FIXME: add alloc_size(2) */
+void * irplib_aligned_malloc(size_t alignment, size_t size) CPL_ATTR_ALLOC;
+void * irplib_aligned_calloc(size_t alignment,
+                             size_t nelem, size_t nbytes) CPL_ATTR_ALLOC;
+void irplib_aligned_free (void * aligned_ptr);
+
+
+/*-----------------------------------------------------------------------------
+                                   Function inlines
+ -----------------------------------------------------------------------------*/
+
+
+/*----------------------------------------------------------------------------*/
+/**
+   @brief   portable isinf
+ */
+/*----------------------------------------------------------------------------*/
+static __inline__ int irplib_isinf(double value)
+{
+/* documented only on 4.4, but available in at least 4.2 */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
+    return __builtin_isinf(value);
+#elif defined HAVE_ISINF && HAVE_ISINF
+    return isinf(value);
+#else
+    return value != 0 && value == 2 * value;
+#endif
+}
+
+
+/*----------------------------------------------------------------------------*/
+/**
+   @brief   portable isnan
+ */
+/*----------------------------------------------------------------------------*/
+static __inline__ int irplib_isnan(double value)
+{
+/* documented only on 4.4, but available in at least 4.2 */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
+    return __builtin_isnan(value);
+#elif defined HAVE_ISNAN && HAVE_ISNAN
+    return isnan(value);
+#else
+    return value != value;
+#endif
+}
+
 #endif
diff --git a/irplib/irplib_wavecal.c b/irplib/irplib_wavecal.c
index e4bc4fd..fe4b5b6 100644
--- a/irplib/irplib_wavecal.c
+++ b/irplib/irplib_wavecal.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_wavecal.c,v 1.52 2012/08/03 21:05:32 llundin Exp $
+/* $Id: irplib_wavecal.c,v 1.52 2012-08-03 21:05:32 llundin Exp $
  *
  * This file is part of the IRPLIB Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2012/08/03 21:05:32 $
+ * $Date: 2012-08-03 21:05:32 $
  * $Revision: 1.52 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_wavecal.h b/irplib/irplib_wavecal.h
index 35874ea..9ec1ed5 100644
--- a/irplib/irplib_wavecal.h
+++ b/irplib/irplib_wavecal.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_wavecal.h,v 1.18 2012/08/03 21:05:33 llundin Exp $
+/* $Id: irplib_wavecal.h,v 1.18 2012-08-03 21:05:33 llundin Exp $
  *
  * This file is part of the IRPLIB Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2012/08/03 21:05:33 $
+ * $Date: 2012-08-03 21:05:33 $
  * $Revision: 1.18 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_WAVECAL_H
diff --git a/irplib/irplib_wavecal_impl.h b/irplib/irplib_wavecal_impl.h
index bff2b63..ee99093 100644
--- a/irplib/irplib_wavecal_impl.h
+++ b/irplib/irplib_wavecal_impl.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_wavecal_impl.h,v 1.7 2012/08/03 21:05:34 llundin Exp $
+/* $Id: irplib_wavecal_impl.h,v 1.7 2012-08-03 21:05:34 llundin Exp $
  *
  * This file is part of the IRPLIB Pipeline
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2012/08/03 21:05:34 $
+ * $Date: 2012-08-03 21:05:34 $
  * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_WAVECAL_IMPL_H
diff --git a/irplib/irplib_wcs.c b/irplib/irplib_wcs.c
index 306cdc7..51ae836 100644
--- a/irplib/irplib_wcs.c
+++ b/irplib/irplib_wcs.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_wcs.c,v 1.8 2010/10/07 14:10:55 llundin Exp $
+/* $Id: irplib_wcs.c,v 1.8 2010-10-07 14:10:55 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2010/10/07 14:10:55 $
+ * $Date: 2010-10-07 14:10:55 $
  * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_wcs.h b/irplib/irplib_wcs.h
index f859d45..cc5c45c 100644
--- a/irplib/irplib_wcs.h
+++ b/irplib/irplib_wcs.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_wcs.h,v 1.7 2010/10/07 14:10:55 llundin Exp $
+/* $Id: irplib_wcs.h,v 1.7 2010-10-07 14:10:55 llundin Exp $
  *
  * This file is part of the irplib package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: llundin $
- * $Date: 2010/10/07 14:10:55 $
+ * $Date: 2010-10-07 14:10:55 $
  * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_WCS_H
diff --git a/irplib/irplib_wlxcorr.c b/irplib/irplib_wlxcorr.c
index ec3cfb0..eeb5ea1 100644
--- a/irplib/irplib_wlxcorr.c
+++ b/irplib/irplib_wlxcorr.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_wlxcorr.c,v 1.57 2012/09/04 09:58:44 yjung Exp $
+/* $Id: irplib_wlxcorr.c,v 1.58 2013-01-29 08:43:33 jtaylor Exp $
  *
  * This file is part of the IRPLIB package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
  */
 
 /*
- * $Author: yjung $
- * $Date: 2012/09/04 09:58:44 $
- * $Revision: 1.57 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-01-29 08:43:33 $
+ * $Revision: 1.58 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/irplib/irplib_wlxcorr.h b/irplib/irplib_wlxcorr.h
index 17b76da..467f599 100644
--- a/irplib/irplib_wlxcorr.h
+++ b/irplib/irplib_wlxcorr.h
@@ -1,4 +1,4 @@
-/* $Id: irplib_wlxcorr.h,v 1.21 2012/06/28 09:03:02 yjung Exp $
+/* $Id: irplib_wlxcorr.h,v 1.22 2013-01-29 08:43:33 jtaylor Exp $
  *
  * This file is part of the IRPLIB package
  * Copyright (C) 2002,2003 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
  */
 
 /*
- * $Author: yjung $
- * $Date: 2012/06/28 09:03:02 $
- * $Revision: 1.21 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-01-29 08:43:33 $
+ * $Revision: 1.22 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef IRPLIB_WLXCORR_H
diff --git a/irplib/tests/Makefile.am b/irplib/tests/Makefile.am
index 291c542..d9a33d8 100644
--- a/irplib/tests/Makefile.am
+++ b/irplib/tests/Makefile.am
@@ -28,7 +28,7 @@ MAINTAINERCLEANFILES = Makefile.in
 
 endif
 
-AM_CPPFLAGS = $(all_includes)
+AM_CPPFLAGS = $(all_includes) -I../../irplib/
 
 LDADD = $(LIBIRPLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
 
@@ -45,33 +45,37 @@ check_PROGRAMS = irplib_wlxcorr-test \
                  irplib_wcs-test \
                  irplib_cat-test
 
-irplib_framelist_test_SOURCES = irplib_framelist-test.c
-irplib_framelist_test_DEPENDENCIES = $(LIBIRPLIB)
-
-irplib_utils_test_SOURCES = irplib_utils-test.c
-irplib_utils_test_DEPENDENCIES = $(LIBIRPLIB)
+irplib_wlxcorr_test_SOURCES = irplib_wlxcorr-test.c
+irplib_wlxcorr_test_LDFLAGS = $(CPL_LDFLAGS)
+irplib_wlxcorr_test_LDADD = $(LDADD)
 
 irplib_hist_test_SOURCES = irplib_hist-test.c
-irplib_hist_test_DEPENDENCIES = $(LIBIRPLIB)
+irplib_hist_test_LDFLAGS = $(CPL_LDFLAGS)
+irplib_hist_test_LDADD = $(LDADD)
 
 irplib_polynomial_test_SOURCES = irplib_polynomial-test.c
-irplib_polynomial_test_DEPENDENCIES = $(LIBIRPLIB)
+irplib_polynomial_test_LDFLAGS = $(CPL_LDFLAGS)
+irplib_polynomial_test_LDADD = $(LDADD)
 
 irplib_plugin_test_SOURCES = irplib_plugin-test.c
-irplib_plugin_test_DEPENDENCIES = $(LIBIRPLIB)
+irplib_plugin_test_LDFLAGS = $(CPL_LDFLAGS)
+irplib_plugin_test_LDADD = $(LDADD)
 
-irplib_wlxcorr_test_SOURCES = irplib_wlxcorr-test.c
-irplib_wlxcorr_test_DEPENDENCIES = $(LIBIRPLIB)
+irplib_utils_test_SOURCES = irplib_utils-test.c
+irplib_utils_test_LDFLAGS = $(CPL_LDFLAGS)
+irplib_utils_test_LDADD = $(LDADD)
+
+irplib_framelist_test_SOURCES = irplib_framelist-test.c
+irplib_framelist_test_LDFLAGS = $(CPL_LDFLAGS) 
+irplib_framelist_test_LDADD = $(LDADD)
 
 irplib_wcs_test_SOURCES = irplib_wcs-test.c
-irplib_wcs_test_DEPENDENCIES = $(LIBIRPLIB)
-irplib_wcs_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
-irplib_wcs_test_LDFLAGS = $(WCSLIB_LDFLAGS)
+irplib_wcs_test_LDFLAGS = $(CPL_LDFLAGS) $(WCSLIB_LDFLAGS)
+irplib_wcs_test_LDADD = $(LDADD) $(LIBWCSLIB)
 
 irplib_cat_test_SOURCES = irplib_cat-test.c
-irplib_cat_test_DEPENDENCIES = $(LIBIRPLIB)
-irplib_cat_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
-irplib_cat_test_LDFLAGS = $(WCSLIB_LDFLAGS)
+irplib_cat_test_LDFLAGS = $(CPL_LDFLAGS) $(WCSLIB_LDFLAGS)
+irplib_cat_test_LDADD = $(LDADD) $(LIBWCSLIB)
 
 TESTS          = $(check_PROGRAMS)
 
diff --git a/irplib/tests/Makefile.in b/irplib/tests/Makefile.in
index e6585c0..c9c10f6 100644
--- a/irplib/tests/Makefile.in
+++ b/irplib/tests/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,29 @@
 
 @SET_MAKE@
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -44,50 +58,89 @@ check_PROGRAMS = irplib_wlxcorr-test$(EXEEXT) \
 	irplib_cat-test$(EXEEXT)
 subdir = irplib/tests
 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/admin/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
-	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/purify.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am_irplib_cat_test_OBJECTS = irplib_cat-test.$(OBJEXT)
 irplib_cat_test_OBJECTS = $(am_irplib_cat_test_OBJECTS)
 am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+irplib_cat_test_DEPENDENCIES = $(am__DEPENDENCIES_2)
+irplib_cat_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(irplib_cat_test_LDFLAGS) $(LDFLAGS) -o $@
 am_irplib_framelist_test_OBJECTS = irplib_framelist-test.$(OBJEXT)
 irplib_framelist_test_OBJECTS = $(am_irplib_framelist_test_OBJECTS)
-irplib_framelist_test_LDADD = $(LDADD)
+irplib_framelist_test_DEPENDENCIES = $(am__DEPENDENCIES_2)
+irplib_framelist_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(irplib_framelist_test_LDFLAGS) $(LDFLAGS) -o $@
 am_irplib_hist_test_OBJECTS = irplib_hist-test.$(OBJEXT)
 irplib_hist_test_OBJECTS = $(am_irplib_hist_test_OBJECTS)
-irplib_hist_test_LDADD = $(LDADD)
+irplib_hist_test_DEPENDENCIES = $(am__DEPENDENCIES_2)
+irplib_hist_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(irplib_hist_test_LDFLAGS) $(LDFLAGS) -o $@
 am_irplib_plugin_test_OBJECTS = irplib_plugin-test.$(OBJEXT)
 irplib_plugin_test_OBJECTS = $(am_irplib_plugin_test_OBJECTS)
-irplib_plugin_test_LDADD = $(LDADD)
+irplib_plugin_test_DEPENDENCIES = $(am__DEPENDENCIES_2)
+irplib_plugin_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(irplib_plugin_test_LDFLAGS) $(LDFLAGS) -o $@
 am_irplib_polynomial_test_OBJECTS = irplib_polynomial-test.$(OBJEXT)
 irplib_polynomial_test_OBJECTS = $(am_irplib_polynomial_test_OBJECTS)
-irplib_polynomial_test_LDADD = $(LDADD)
+irplib_polynomial_test_DEPENDENCIES = $(am__DEPENDENCIES_2)
+irplib_polynomial_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(irplib_polynomial_test_LDFLAGS) $(LDFLAGS) -o $@
 am_irplib_utils_test_OBJECTS = irplib_utils-test.$(OBJEXT)
 irplib_utils_test_OBJECTS = $(am_irplib_utils_test_OBJECTS)
-irplib_utils_test_LDADD = $(LDADD)
+irplib_utils_test_DEPENDENCIES = $(am__DEPENDENCIES_2)
+irplib_utils_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(irplib_utils_test_LDFLAGS) $(LDFLAGS) -o $@
 am_irplib_wcs_test_OBJECTS = irplib_wcs-test.$(OBJEXT)
 irplib_wcs_test_OBJECTS = $(am_irplib_wcs_test_OBJECTS)
+irplib_wcs_test_DEPENDENCIES = $(am__DEPENDENCIES_2)
+irplib_wcs_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(irplib_wcs_test_LDFLAGS) $(LDFLAGS) -o $@
 am_irplib_wlxcorr_test_OBJECTS = irplib_wlxcorr-test.$(OBJEXT)
 irplib_wlxcorr_test_OBJECTS = $(am_irplib_wlxcorr_test_OBJECTS)
-irplib_wlxcorr_test_LDADD = $(LDADD)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+irplib_wlxcorr_test_DEPENDENCIES = $(am__DEPENDENCIES_2)
+irplib_wlxcorr_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(irplib_wlxcorr_test_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 SOURCES = $(irplib_cat_test_SOURCES) $(irplib_framelist_test_SOURCES) \
 	$(irplib_hist_test_SOURCES) $(irplib_plugin_test_SOURCES) \
 	$(irplib_polynomial_test_SOURCES) $(irplib_utils_test_SOURCES) \
@@ -97,21 +150,48 @@ DIST_SOURCES = $(irplib_cat_test_SOURCES) \
 	$(irplib_plugin_test_SOURCES) \
 	$(irplib_polynomial_test_SOURCES) $(irplib_utils_test_SOURCES) \
 	$(irplib_wcs_test_SOURCES) $(irplib_wlxcorr_test_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkgincludedir)"
-pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
 HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS)
 ETAGS = etags
 CTAGS = ctags
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = $(am__tty_colors_dummy)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
@@ -136,16 +216,17 @@ CX_LDFLAGS = @CX_LDFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOXYGEN = @DOXYGEN@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 FORS_BINARY_AGE = @FORS_BINARY_AGE@
 FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
 FORS_INCLUDES = @FORS_INCLUDES@
@@ -155,12 +236,17 @@ FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
 FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
 FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
 FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
 LATEX = @LATEX@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBCEXT = @LIBCEXT@
 LIBCFITSIO = @LIBCFITSIO@
@@ -176,48 +262,52 @@ LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 LT_AGE = @LT_AGE@
 LT_CURRENT = @LT_CURRENT@
 LT_REVISION = @LT_REVISION@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
 MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
-ONLINE_MODE_FALSE = @ONLINE_MODE_FALSE@
-ONLINE_MODE_TRUE = @ONLINE_MODE_TRUE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PURIFY_CMD = @PURIFY_CMD@
-PURIFY_FALSE = @PURIFY_FALSE@
-PURIFY_TRUE = @PURIFY_TRUE@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 all_includes = @all_includes@
 all_ldflags = @all_ldflags@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -229,8 +319,12 @@ build_alias = @build_alias@
 build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
+builddir = @builddir@
 configdir = @configdir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -243,17 +337,21 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 pipedocsdir = @pipedocsdir@
 plugindir = @plugindir@
 prefix = @prefix@
 privatelibdir = @privatelibdir@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target = @target@
@@ -261,35 +359,42 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 wkfcopydir = @wkfcopydir@
 wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.8 foreign
 DISTCLEANFILES = *~
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS = $(all_includes)
+AM_CPPFLAGS = $(all_includes) -I../../irplib/
 LDADD = $(LIBIRPLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
 pkginclude_HEADERS = 
 noinst_HEADERS = 
-irplib_framelist_test_SOURCES = irplib_framelist-test.c
-irplib_framelist_test_DEPENDENCIES = $(LIBIRPLIB)
-irplib_utils_test_SOURCES = irplib_utils-test.c
-irplib_utils_test_DEPENDENCIES = $(LIBIRPLIB)
+irplib_wlxcorr_test_SOURCES = irplib_wlxcorr-test.c
+irplib_wlxcorr_test_LDFLAGS = $(CPL_LDFLAGS)
+irplib_wlxcorr_test_LDADD = $(LDADD)
 irplib_hist_test_SOURCES = irplib_hist-test.c
-irplib_hist_test_DEPENDENCIES = $(LIBIRPLIB)
+irplib_hist_test_LDFLAGS = $(CPL_LDFLAGS)
+irplib_hist_test_LDADD = $(LDADD)
 irplib_polynomial_test_SOURCES = irplib_polynomial-test.c
-irplib_polynomial_test_DEPENDENCIES = $(LIBIRPLIB)
+irplib_polynomial_test_LDFLAGS = $(CPL_LDFLAGS)
+irplib_polynomial_test_LDADD = $(LDADD)
 irplib_plugin_test_SOURCES = irplib_plugin-test.c
-irplib_plugin_test_DEPENDENCIES = $(LIBIRPLIB)
-irplib_wlxcorr_test_SOURCES = irplib_wlxcorr-test.c
-irplib_wlxcorr_test_DEPENDENCIES = $(LIBIRPLIB)
+irplib_plugin_test_LDFLAGS = $(CPL_LDFLAGS)
+irplib_plugin_test_LDADD = $(LDADD)
+irplib_utils_test_SOURCES = irplib_utils-test.c
+irplib_utils_test_LDFLAGS = $(CPL_LDFLAGS)
+irplib_utils_test_LDADD = $(LDADD)
+irplib_framelist_test_SOURCES = irplib_framelist-test.c
+irplib_framelist_test_LDFLAGS = $(CPL_LDFLAGS) 
+irplib_framelist_test_LDADD = $(LDADD)
 irplib_wcs_test_SOURCES = irplib_wcs-test.c
-irplib_wcs_test_DEPENDENCIES = $(LIBIRPLIB)
-irplib_wcs_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
-irplib_wcs_test_LDFLAGS = $(WCSLIB_LDFLAGS)
+irplib_wcs_test_LDFLAGS = $(CPL_LDFLAGS) $(WCSLIB_LDFLAGS)
+irplib_wcs_test_LDADD = $(LDADD) $(LIBWCSLIB)
 irplib_cat_test_SOURCES = irplib_cat-test.c
-irplib_cat_test_DEPENDENCIES = $(LIBIRPLIB)
-irplib_cat_test_LDADD = $(LIBIRPLIB) $(LIBWCSLIB) $(LIBCPLCORE) $(LIBCPLUI) $(LIBCPLDFS) $(LIBCPLDRS)
-irplib_cat_test_LDFLAGS = $(WCSLIB_LDFLAGS)
+irplib_cat_test_LDFLAGS = $(CPL_LDFLAGS) $(WCSLIB_LDFLAGS)
+irplib_cat_test_LDADD = $(LDADD) $(LIBWCSLIB)
 TESTS = $(check_PROGRAMS)
 
 # Be sure to reexport important environment variables.
@@ -307,14 +412,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  irplib/tests/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  irplib/tests/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign irplib/tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign irplib/tests/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -332,37 +437,40 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 clean-checkPROGRAMS:
-	@list='$(check_PROGRAMS)'; for p in $$list; do \
-	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  echo " rm -f $$p $$f"; \
-	  rm -f $$p $$f ; \
-	done
-irplib_cat-test$(EXEEXT): $(irplib_cat_test_OBJECTS) $(irplib_cat_test_DEPENDENCIES) 
+	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+irplib_cat-test$(EXEEXT): $(irplib_cat_test_OBJECTS) $(irplib_cat_test_DEPENDENCIES) $(EXTRA_irplib_cat_test_DEPENDENCIES) 
 	@rm -f irplib_cat-test$(EXEEXT)
-	$(LINK) $(irplib_cat_test_LDFLAGS) $(irplib_cat_test_OBJECTS) $(irplib_cat_test_LDADD) $(LIBS)
-irplib_framelist-test$(EXEEXT): $(irplib_framelist_test_OBJECTS) $(irplib_framelist_test_DEPENDENCIES) 
+	$(irplib_cat_test_LINK) $(irplib_cat_test_OBJECTS) $(irplib_cat_test_LDADD) $(LIBS)
+irplib_framelist-test$(EXEEXT): $(irplib_framelist_test_OBJECTS) $(irplib_framelist_test_DEPENDENCIES) $(EXTRA_irplib_framelist_test_DEPENDENCIES) 
 	@rm -f irplib_framelist-test$(EXEEXT)
-	$(LINK) $(irplib_framelist_test_LDFLAGS) $(irplib_framelist_test_OBJECTS) $(irplib_framelist_test_LDADD) $(LIBS)
-irplib_hist-test$(EXEEXT): $(irplib_hist_test_OBJECTS) $(irplib_hist_test_DEPENDENCIES) 
+	$(irplib_framelist_test_LINK) $(irplib_framelist_test_OBJECTS) $(irplib_framelist_test_LDADD) $(LIBS)
+irplib_hist-test$(EXEEXT): $(irplib_hist_test_OBJECTS) $(irplib_hist_test_DEPENDENCIES) $(EXTRA_irplib_hist_test_DEPENDENCIES) 
 	@rm -f irplib_hist-test$(EXEEXT)
-	$(LINK) $(irplib_hist_test_LDFLAGS) $(irplib_hist_test_OBJECTS) $(irplib_hist_test_LDADD) $(LIBS)
-irplib_plugin-test$(EXEEXT): $(irplib_plugin_test_OBJECTS) $(irplib_plugin_test_DEPENDENCIES) 
+	$(irplib_hist_test_LINK) $(irplib_hist_test_OBJECTS) $(irplib_hist_test_LDADD) $(LIBS)
+irplib_plugin-test$(EXEEXT): $(irplib_plugin_test_OBJECTS) $(irplib_plugin_test_DEPENDENCIES) $(EXTRA_irplib_plugin_test_DEPENDENCIES) 
 	@rm -f irplib_plugin-test$(EXEEXT)
-	$(LINK) $(irplib_plugin_test_LDFLAGS) $(irplib_plugin_test_OBJECTS) $(irplib_plugin_test_LDADD) $(LIBS)
-irplib_polynomial-test$(EXEEXT): $(irplib_polynomial_test_OBJECTS) $(irplib_polynomial_test_DEPENDENCIES) 
+	$(irplib_plugin_test_LINK) $(irplib_plugin_test_OBJECTS) $(irplib_plugin_test_LDADD) $(LIBS)
+irplib_polynomial-test$(EXEEXT): $(irplib_polynomial_test_OBJECTS) $(irplib_polynomial_test_DEPENDENCIES) $(EXTRA_irplib_polynomial_test_DEPENDENCIES) 
 	@rm -f irplib_polynomial-test$(EXEEXT)
-	$(LINK) $(irplib_polynomial_test_LDFLAGS) $(irplib_polynomial_test_OBJECTS) $(irplib_polynomial_test_LDADD) $(LIBS)
-irplib_utils-test$(EXEEXT): $(irplib_utils_test_OBJECTS) $(irplib_utils_test_DEPENDENCIES) 
+	$(irplib_polynomial_test_LINK) $(irplib_polynomial_test_OBJECTS) $(irplib_polynomial_test_LDADD) $(LIBS)
+irplib_utils-test$(EXEEXT): $(irplib_utils_test_OBJECTS) $(irplib_utils_test_DEPENDENCIES) $(EXTRA_irplib_utils_test_DEPENDENCIES) 
 	@rm -f irplib_utils-test$(EXEEXT)
-	$(LINK) $(irplib_utils_test_LDFLAGS) $(irplib_utils_test_OBJECTS) $(irplib_utils_test_LDADD) $(LIBS)
-irplib_wcs-test$(EXEEXT): $(irplib_wcs_test_OBJECTS) $(irplib_wcs_test_DEPENDENCIES) 
+	$(irplib_utils_test_LINK) $(irplib_utils_test_OBJECTS) $(irplib_utils_test_LDADD) $(LIBS)
+irplib_wcs-test$(EXEEXT): $(irplib_wcs_test_OBJECTS) $(irplib_wcs_test_DEPENDENCIES) $(EXTRA_irplib_wcs_test_DEPENDENCIES) 
 	@rm -f irplib_wcs-test$(EXEEXT)
-	$(LINK) $(irplib_wcs_test_LDFLAGS) $(irplib_wcs_test_OBJECTS) $(irplib_wcs_test_LDADD) $(LIBS)
-irplib_wlxcorr-test$(EXEEXT): $(irplib_wlxcorr_test_OBJECTS) $(irplib_wlxcorr_test_DEPENDENCIES) 
+	$(irplib_wcs_test_LINK) $(irplib_wcs_test_OBJECTS) $(irplib_wcs_test_LDADD) $(LIBS)
+irplib_wlxcorr-test$(EXEEXT): $(irplib_wlxcorr_test_OBJECTS) $(irplib_wlxcorr_test_DEPENDENCIES) $(EXTRA_irplib_wlxcorr_test_DEPENDENCIES) 
 	@rm -f irplib_wlxcorr-test$(EXEEXT)
-	$(LINK) $(irplib_wlxcorr_test_LDFLAGS) $(irplib_wlxcorr_test_OBJECTS) $(irplib_wlxcorr_test_LDADD) $(LIBS)
+	$(irplib_wlxcorr_test_LINK) $(irplib_wlxcorr_test_OBJECTS) $(irplib_wlxcorr_test_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -380,22 +488,22 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/irplib_wlxcorr-test.Po at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
@@ -405,72 +513,90 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-
-distclean-libtool:
-	-rm -f libtool
-uninstall-info-am:
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
-	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
-	  $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
 	done
 
 uninstall-pkgincludeHEADERS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
-	done
+	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -478,58 +604,73 @@ distclean-tags:
 check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
-	list='$(TESTS)'; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
 	    elif test -f $$tst; then dir=; \
 	    else dir="$(srcdir)/"; fi; \
-	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
 	      all=`expr $$all + 1`; \
 	      case " $(XFAIL_TESTS) " in \
-	      *" $$tst "*) \
+	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
 	      all=`expr $$all + 1`; \
 	      case " $(XFAIL_TESTS) " in \
-	      *" $$tst "*) \
+	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
 	  if test "$$failed" -eq 0; then \
 	    if test "$$xfail" -eq 0; then \
-	      banner="All $$all tests passed"; \
+	      banner="$$All$$all $$tests passed"; \
 	    else \
-	      banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
 	    fi; \
 	  else \
 	    if test "$$xpass" -eq 0; then \
-	      banner="$$failed of $$all tests failed"; \
+	      banner="$$failed of $$all $$tests failed"; \
 	    else \
-	      banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
 	    fi; \
 	  fi; \
 	  dashes="$$banner"; \
 	  skipped=""; \
 	  if test "$$skip" -ne 0; then \
-	    skipped="($$skip tests were not run)"; \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
 	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
 	      dashes="$$skipped"; \
 	  fi; \
@@ -540,38 +681,46 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
-	  echo "$$banner"; \
-	  test -z "$$skipped" || echo "$$skipped"; \
-	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -582,7 +731,7 @@ check: check-am
 all-am: Makefile $(HEADERS)
 installdirs:
 	for dir in "$(DESTDIR)$(pkgincludedir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
 install-exec: install-exec-am
@@ -594,16 +743,22 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
@@ -619,7 +774,7 @@ distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-libtool distclean-tags
+	distclean-tags
 
 dvi: dvi-am
 
@@ -627,18 +782,38 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
 
 install-data-am: install-pkgincludeHEADERS
 
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-am
+
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -659,20 +834,24 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
+uninstall-am: uninstall-pkgincludeHEADERS
+
+.MAKE: check-am install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
 	clean-checkPROGRAMS clean-generic clean-libtool clean-local \
-	ctags distclean distclean-compile distclean-generic \
+	cscopelist ctags distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-pkgincludeHEADERS \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkgincludeHEADERS install-ps install-ps-am \
 	install-strip installcheck installcheck-am installdirs \
 	maintainer-clean maintainer-clean-generic mostlyclean \
 	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
 	pdf pdf-am ps ps-am tags uninstall uninstall-am \
-	uninstall-info-am uninstall-pkgincludeHEADERS
+	uninstall-pkgincludeHEADERS
 
 
 # We need to remove any files that the above tests created.
@@ -682,6 +861,7 @@ clean-local:
 #if PURIFY
 #include $(top_builddir)/Makefile.purify
 #endif
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/irplib/tests/irplib_cat-test.c b/irplib/tests/irplib_cat-test.c
index a400302..dba945b 100644
--- a/irplib/tests/irplib_cat-test.c
+++ b/irplib/tests/irplib_cat-test.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_cat-test.c,v 1.9 2009/08/12 14:26:44 cgarcia Exp $
+/* $Id: irplib_cat-test.c,v 1.10 2013-01-29 08:43:33 jtaylor Exp $
  *
  * This file is part of the ESO Common Pipeline Library
  * Copyright (C) 2001-2008 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
  */
 
 /*
- * $Author: cgarcia $
- * $Date: 2009/08/12 14:26:44 $
- * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-01-29 08:43:33 $
+ * $Revision: 1.10 $
+ * $Name: not supported by cvs2svn $
  */
 
 /*-----------------------------------------------------------------------------
diff --git a/irplib/tests/irplib_polynomial-test.c b/irplib/tests/irplib_polynomial-test.c
index 4ce9898..33a50c9 100644
--- a/irplib/tests/irplib_polynomial-test.c
+++ b/irplib/tests/irplib_polynomial-test.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_polynomial-test.c,v 1.36 2013/01/15 13:24:50 llundin Exp $
+/* $Id: irplib_polynomial-test.c,v 1.37 2013-01-29 08:43:33 jtaylor Exp $
  *
  * This file is part of the ESO Common Pipeline Library
  * Copyright (C) 2001-2004 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
  */
 
 /*
- * $Author: llundin $
- * $Date: 2013/01/15 13:24:50 $
- * $Revision: 1.36 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-01-29 08:43:33 $
+ * $Revision: 1.37 $
+ * $Name: not supported by cvs2svn $
  */
 
 /*-----------------------------------------------------------------------------
diff --git a/irplib/tests/irplib_utils-test.c b/irplib/tests/irplib_utils-test.c
index 66f8696..f31815b 100644
--- a/irplib/tests/irplib_utils-test.c
+++ b/irplib/tests/irplib_utils-test.c
@@ -28,6 +28,7 @@
 #include <irplib_utils.h>
 #include <string.h>
 #include <float.h>
+#include <stdint.h>
 
 /*-----------------------------------------------------------------------------
                                    Function prototypes
@@ -41,6 +42,7 @@ static void test_irplib_dfs_table_convert(void);
 static void test_irplib_isnaninf(void);
 static void bench_irplib_image_split(int, int);
 static void frameset_sort_test(int sz);
+static void test_irplib_aligned_alloc(void);
 
 /*----------------------------------------------------------------------------*/
 /**
@@ -69,6 +71,8 @@ int main(void)
     frameset_sort_test(122); /* test even */
     frameset_sort_test(127); /* test odd  */
 
+    test_irplib_aligned_alloc();
+
     if (cpl_msg_get_level() <= CPL_MSG_INFO) {
         bench_irplib_image_split(1024, 100);
     } else {
@@ -115,6 +119,42 @@ static void test_irplib_isnaninf(void)
 }
 
 
+static void test_irplib_aligned_alloc(void)
+{
+    void * ptr = NULL;
+    size_t alignment[] = {2, 4, 8, 16, 32, 64, 128, 4096};
+    char zero[100] = {0};
+    size_t i;
+
+    for (i = 0; i < sizeof(alignment)/sizeof(alignment[0]); i++) {
+        ptr = irplib_aligned_malloc(alignment[i], 100);
+        cpl_test_nonnull(ptr);
+        cpl_test_error(CPL_ERROR_NONE);
+        cpl_test_eq(((intptr_t)ptr % alignment[i]), 0);
+        irplib_aligned_free(ptr);
+        cpl_test_error(CPL_ERROR_NONE);
+    }
+    /* invalid alignment */
+    ptr = irplib_aligned_malloc(5, 100);
+    cpl_test_null(ptr);
+    irplib_aligned_free(NULL);
+
+    for (i = 0; i < sizeof(alignment)/sizeof(alignment[0]); i++) {
+        ptr = irplib_aligned_calloc(alignment[i], 100, 1);
+        cpl_test_nonnull(ptr);
+        cpl_test_error(CPL_ERROR_NONE);
+        cpl_test_eq(((intptr_t)ptr % alignment[i]), 0);
+        cpl_test_eq(memcmp(ptr, zero, 100), 0);
+        irplib_aligned_free(ptr);
+        cpl_test_error(CPL_ERROR_NONE);
+    }
+    /* invalid alignment */
+    ptr = irplib_aligned_calloc(5, 100, 1);
+    cpl_test_null(ptr);
+    irplib_aligned_free(NULL);
+}
+
+
 static cpl_boolean my_table_set_row(cpl_table * self,
                                     const char * line,
                                     int irow,
diff --git a/irplib/tests/irplib_wcs-test.c b/irplib/tests/irplib_wcs-test.c
index 42a6ea0..2b6e19b 100644
--- a/irplib/tests/irplib_wcs-test.c
+++ b/irplib/tests/irplib_wcs-test.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_wcs-test.c,v 1.8 2010/10/07 14:10:55 llundin Exp $
+/* $Id: irplib_wcs-test.c,v 1.9 2013-01-29 08:43:33 jtaylor Exp $
  *
  * This file is part of the ESO Common Pipeline Library
  * Copyright (C) 2001-2008 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
  */
 
 /*
- * $Author: llundin $
- * $Date: 2010/10/07 14:10:55 $
- * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-01-29 08:43:33 $
+ * $Revision: 1.9 $
+ * $Name: not supported by cvs2svn $
  */
 
 /*-----------------------------------------------------------------------------
diff --git a/irplib/tests/irplib_wlxcorr-test.c b/irplib/tests/irplib_wlxcorr-test.c
index 70bdf53..767121a 100644
--- a/irplib/tests/irplib_wlxcorr-test.c
+++ b/irplib/tests/irplib_wlxcorr-test.c
@@ -1,4 +1,4 @@
-/* $Id: irplib_wlxcorr-test.c,v 1.15 2012/01/12 12:38:38 llundin Exp $
+/* $Id: irplib_wlxcorr-test.c,v 1.16 2013-01-29 08:43:33 jtaylor Exp $
  *
  * This file is part of the ESO Common Pipeline Library
  * Copyright (C) 2001-2004 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
  */
 
 /*
- * $Author: llundin $
- * $Date: 2012/01/12 12:38:38 $
- * $Revision: 1.15 $
- * $Name: fors-4_9_23 $
+ * $Author: jtaylor $
+ * $Date: 2013-01-29 08:43:33 $
+ * $Revision: 1.16 $
+ * $Name: not supported by cvs2svn $
  */
 
 /*-----------------------------------------------------------------------------
diff --git a/m4macros/gsl.m4 b/m4macros/gsl.m4
new file mode 100644
index 0000000..d297e26
--- /dev/null
+++ b/m4macros/gsl.m4
@@ -0,0 +1,23 @@
+# LIB_CHECK_GSL
+#------------------
+# Checks for the gsl library and header files.
+AC_DEFUN([CPL_CHECK_GSL],
+[
+
+    AC_MSG_CHECKING([for gsl])
+
+    AC_ARG_WITH(gsl,
+                AC_HELP_STRING([--with-gsl],
+                               [location where gsl is installed]),
+                [
+                    cpl_gsl_dir=$withval
+                ])
+
+    export PKG_CONFIG_PATH="$cpl_gsl_dir/lib/pkgconfig:$GSLDIR/lib/pkgconfig/:$PKG_CONFIG_PATH"
+
+    AC_SUBST(PKG_CONFIG_PATH)
+    PKG_CHECK_MODULES([GSL], [gsl], 
+                      AC_DEFINE([HAVE_LIBGSL], [1], [1 if GSL present]),
+                      AC_MSG_ERROR([No GSL available]))
+
+])
diff --git a/m4macros/libtool.m4 b/m4macros/libtool.m4
new file mode 100644
index 0000000..56666f0
--- /dev/null
+++ b/m4macros/libtool.m4
@@ -0,0 +1,7986 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+		   [m4_fatal([Libtool version $1 or higher is required],
+		             63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\	*)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+	[m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+	[tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+	   m4_quote(lt_decl_varnames),
+	m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+					   [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+	dnl If the libtool generation code has been placed in $CONFIG_LT,
+	dnl instead of duplicating it all over again into config.status,
+	dnl then we will have config.status run $CONFIG_LT later, so it
+	dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_REPLACE_SHELLFNS
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],			[_LT_LANG(C)],
+  [C++],		[_LT_LANG(CXX)],
+  [Go],			[_LT_LANG(GO)],
+  [Java],		[_LT_LANG(GCJ)],
+  [Fortran 77],		[_LT_LANG(F77)],
+  [Fortran],		[_LT_LANG(FC)],
+  [Windows Resource],	[_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC],     [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+  fi
+fi
+if test -z "$GOC"; then
+  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+  [LT_LANG(GO)],
+  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	# If there is a non-empty error log, and "single_module"
+	# appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	# Otherwise, if the output was created with a 0 exit code from
+	# the compiler, it worked.
+	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi])
+
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+	[lt_cv_ld_exported_symbols_list=yes],
+	[lt_cv_ld_exported_symbols_list=no])
+	LDFLAGS="$save_LDFLAGS"
+    ])
+
+    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+      [lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+	cat conftest.err >&AS_MESSAGE_LOG_FD
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&AS_MESSAGE_LOG_FD
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+  else
+    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  fi
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+  lt_aix_libpath_sed='[
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }]'
+  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi],[])
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+  fi
+  ])
+  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*" 
+}
+
+case "$ECHO" in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[  --with-sysroot[=DIR] Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted.  We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_ERROR([The sysroot must be an absolute path.])
+   ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+  [lt_cv_ar_at_file=no
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+     [echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([lt_ar_try])
+      if test "$ac_status" -eq 0; then
+	# Ensure the archiver fails upon bogus file names.
+	rm -f conftest.$ac_objext libconftest.a
+	AC_TRY_EVAL([lt_ar_try])
+	if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+     ])
+  ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+  [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+	  [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen="dlopen"],
+	  [AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+	    [AC_CHECK_LIB([svld], [dlopen],
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+	      [AC_CHECK_LIB([dld], [dld_link],
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+	  lt_cv_dlopen_self_static, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+	 [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+	 [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+	 [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+	[Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+	[], [
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[23]].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[[3-9]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux # correct to gnu/linux during the next big refactor
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+	 [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Add ABI-specific directories to the system library path.
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+    [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+    [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+  [lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+	[Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT@&t at _DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT@&t at _DLSYM_CONST
+#else
+# define LT@&t at _DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT@&t at _DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_globsym_save_LIBS=$LIBS
+	  lt_globsym_save_CFLAGS=$CFLAGS
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS=$lt_globsym_save_LIBS
+	  CFLAGS=$lt_globsym_save_CFLAGS
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+    [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	m4_if([$1], [GCJ], [],
+	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+	;;
+      nagfor*)
+	# NAG Fortran compiler
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  ;;
+	*Sun\ F* | *Sun*Fortran*)
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  ;;
+        *Intel*\ [[CF]]*Compiler*)
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	  ;;
+	*Portland\ Group*)
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+	[Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+	[How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+	[Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    cl*)
+      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
+    *)
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+      ;;
+    esac
+    ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    ;;
+  esac
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=' $pic_flag'
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+	  tmp_sharedflag='--shared' ;;
+	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 _LT_SYS_MODULE_PATH_AIX([$1])
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  fi
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	_LT_TAGVAR(always_export_symbols, $1)=yes
+	_LT_TAGVAR(file_list_spec, $1)='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	# FIXME: Should let the user specify the lib program.
+	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	m4_if($1, [], [
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  _LT_LINKER_OPTION([if $CC understands -b],
+	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	*)
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+	# This should be the same for all languages, so no per-tag cache variable.
+	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+	  [lt_cv_irix_exported_symbol],
+	  [save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	   AC_LINK_IFELSE(
+	     [AC_LANG_SOURCE(
+	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+			      [C++], [[int foo (void) { return 0; }]],
+			      [Fortran 77], [[
+      subroutine foo
+      end]],
+			      [Fortran], [[
+      subroutine foo
+      end]])])],
+	      [lt_cv_irix_exported_symbol=yes],
+	      [lt_cv_irix_exported_symbol=no])
+           LDFLAGS="$save_LDFLAGS"])
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	fi
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	     ;;
+	   *)
+	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+	[$RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+	  _LT_TAGVAR(allow_undefined_flag, $1)=
+	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+	  then
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	  else
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  fi
+	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+	])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX([$1])
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    _LT_SYS_MODULE_PATH_AIX([$1])
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	    if test "$with_gnu_ld" = yes; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    fi
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+	case $GXX,$cc_basename in
+	,cl* | no,cl*)
+	  # Native MSVC
+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+	  # no search path for DLLs.
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  _LT_TAGVAR(always_export_symbols, $1)=yes
+	  _LT_TAGVAR(file_list_spec, $1)='@'
+	  # Tell ltmain to make .lib files, not .a files.
+	  libext=lib
+	  # Tell ltmain to make .dll files, not .so files.
+	  shrext_cmds=".dll"
+	  # FIXME: Setting linknames here is a bad hack.
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	    else
+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	    fi~
+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	    linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	  # Don't use ranlib
+	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
+	    case $lt_outputfile in
+	      *.exe|*.EXE) ;;
+	      *)
+		lt_outputfile="$lt_outputfile.exe"
+		lt_tool_outputfile="$lt_tool_outputfile.exe"
+		;;
+	    esac~
+	    func_to_tool_file "$lt_outputfile"~
+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	      $RM "$lt_outputfile.manifest";
+	    fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  _LT_TAGVAR(always_export_symbols, $1)=no
+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file (1st line
+	    # is EXPORTS), use it as is; otherwise, prepend...
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      cp $export_symbols $output_objdir/$soname.def;
+	    else
+	      echo EXPORTS > $output_objdir/$soname.def;
+	      cat $export_symbols >> $output_objdir/$soname.def;
+	    fi~
+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	  ;;
+	esac
+	;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      freebsd2.*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	      fi
+	    fi
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+	    ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+		$RANLIB $oldlib'
+	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 and above use weak symbols
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    ;;
+	  xl* | mpixl* | bgxl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='func_echo_all'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+	;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=func_echo_all
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+		;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	    case $host_os in
+	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+	    output_verbose_link_cmd='func_echo_all'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      fi
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+		*)
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+	_LT_TAGVAR(link_all_deplibs, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
+	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+	      '"$_LT_TAGVAR(reload_cmds, $1)"
+	    ;;
+	  *)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case ${prev}${p} in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test "$pre_test_object_deps_done" = no; then
+	 case ${prev} in
+	 -L | -R)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	 fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+	   _LT_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+  CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary parameter first.
+    func_stripname_result=${3}
+    func_stripname_result=${func_stripname_result#"${1}"}
+    func_stripname_result=${func_stripname_result%"${2}"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+    func_split_long_opt_name=${1%%=*}
+    func_split_long_opt_arg=${1#*=}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+    func_split_short_opt_arg=${1#??}
+    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+    case ${1} in
+      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+      *)    func_lo2o_result=${1} ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+
+  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+
+  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+    func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+         [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+         [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4macros/ltoptions.m4 b/m4macros/ltoptions.m4
new file mode 100644
index 0000000..5d9acd8
--- /dev/null
+++ b/m4macros/ltoptions.m4
@@ -0,0 +1,384 @@
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+#   Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+		      [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+  		   [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+	[Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+	[Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+	 [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+	IFS="$lt_save_ifs"
+	if test "X$lt_pkg" = "X$lt_p"; then
+	  pic_mode=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+		 [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+		 [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+		 [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+		 [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+		 [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4macros/ltsugar.m4 b/m4macros/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/m4macros/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+	     [m4_foreach([_Lt_suffix],
+		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+		 [lt_append([$1], [$2], [$3])$4],
+		 [$5])],
+	  [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+	[$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/m4macros/ltversion.m4 b/m4macros/ltversion.m4
new file mode 100644
index 0000000..07a8602
--- /dev/null
+++ b/m4macros/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers			-*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.2'
+macro_revision='1.3337'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/m4macros/lt~obsolete.m4 b/m4macros/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/m4macros/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
diff --git a/mosca/Makefile.am b/mosca/Makefile.am
index 3cfe814..bdd415a 100644
--- a/mosca/Makefile.am
+++ b/mosca/Makefile.am
@@ -15,7 +15,7 @@
 
 ##   You should have received a copy of the GNU General Public License
 ##   along with this program; if not, write to the Free Software
-##   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+##   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 
 AUTOMAKE_OPTIONS = 1.8 foreign
diff --git a/mosca/Makefile.in b/mosca/Makefile.in
index ec64d02..398bed3 100644
--- a/mosca/Makefile.in
+++ b/mosca/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -13,15 +13,29 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,28 +54,69 @@ subdir = mosca
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
-	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/purify.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
-	install-exec-recursive install-info-recursive \
-	install-recursive installcheck-recursive installdirs-recursive \
-	pdf-recursive ps-recursive uninstall-info-recursive \
-	uninstall-recursive
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
@@ -86,16 +141,17 @@ CX_LDFLAGS = @CX_LDFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOXYGEN = @DOXYGEN@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 FORS_BINARY_AGE = @FORS_BINARY_AGE@
 FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
 FORS_INCLUDES = @FORS_INCLUDES@
@@ -105,12 +161,17 @@ FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
 FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
 FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
 FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
 LATEX = @LATEX@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBCEXT = @LIBCEXT@
 LIBCFITSIO = @LIBCFITSIO@
@@ -126,48 +187,52 @@ LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 LT_AGE = @LT_AGE@
 LT_CURRENT = @LT_CURRENT@
 LT_REVISION = @LT_REVISION@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
 MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
-ONLINE_MODE_FALSE = @ONLINE_MODE_FALSE@
-ONLINE_MODE_TRUE = @ONLINE_MODE_TRUE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PURIFY_CMD = @PURIFY_CMD@
-PURIFY_FALSE = @PURIFY_FALSE@
-PURIFY_TRUE = @PURIFY_TRUE@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 all_includes = @all_includes@
 all_ldflags = @all_ldflags@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -179,8 +244,12 @@ build_alias = @build_alias@
 build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
+builddir = @builddir@
 configdir = @configdir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -193,17 +262,21 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 pipedocsdir = @pipedocsdir@
 plugindir = @plugindir@
 prefix = @prefix@
 privatelibdir = @privatelibdir@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target = @target@
@@ -211,6 +284,9 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 wkfcopydir = @wkfcopydir@
 wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.8 foreign
@@ -224,14 +300,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  mosca/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  mosca/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mosca/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign mosca/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -249,6 +325,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -256,18 +333,14 @@ mostlyclean-libtool:
 clean-libtool:
 	-rm -rf .libs _libs
 
-distclean-libtool:
-	-rm -f libtool
-uninstall-info-am:
-
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@failcom='exit 1'; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
 	  case $$f in \
 	    *=* | --[!k]*);; \
@@ -276,7 +349,11 @@ $(RECURSIVE_TARGETS):
 	done; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -284,51 +361,23 @@ $(RECURSIVE_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-	@failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
 	done
 ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -336,14 +385,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
@@ -355,81 +404,112 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test ! -f $$subdir/TAGS || \
-	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(mkdir_p) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	    distdir=`$(am__cd) $(distdir) && pwd`; \
-	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
-	    (cd $$subdir && \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
 	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$top_distdir" \
-	        distdir="$$distdir/$$subdir" \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
 	        distdir) \
 	      || exit 1; \
 	  fi; \
@@ -449,16 +529,22 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
@@ -470,8 +556,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-recursive
 	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool \
-	distclean-tags
+distclean-am: clean-am distclean-generic distclean-tags
 
 dvi: dvi-recursive
 
@@ -479,18 +564,38 @@ dvi-am:
 
 html: html-recursive
 
+html-am:
+
 info: info-recursive
 
 info-am:
 
 install-data-am:
 
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-recursive
+
+install-html-am:
+
 install-info: install-info-recursive
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -509,26 +614,30 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-info-am
+uninstall-am:
 
-uninstall-info: uninstall-info-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
-	clean clean-generic clean-libtool clean-recursive ctags \
-	ctags-recursive distclean distclean-generic distclean-libtool \
-	distclean-recursive distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic maintainer-clean-recursive \
-	mostlyclean mostlyclean-generic mostlyclean-libtool \
-	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am uninstall-info-am
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist cscopelist-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-libtool distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 #pkgconfigdir = $(libdir)/pkgconfig
 #pkgconfig_DATA = mosca.pc
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/mosca/libmosca/Makefile.am b/mosca/libmosca/Makefile.am
index 25e8279..89baa98 100644
--- a/mosca/libmosca/Makefile.am
+++ b/mosca/libmosca/Makefile.am
@@ -15,30 +15,82 @@
 
 ##   You should have received a copy of the GNU General Public License
 ##   along with this program; if not, write to the Free Software
-##   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+##   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 
 AUTOMAKE_OPTIONS = 1.8 foreign
 
 DISTCLEANFILES = *~
 
+SUBDIRS = tests
+
 if MAINTAINER_MODE
 
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
 
 endif
 
-#AM_CXXFLAGS = -Wall -Wextra -pedantic
+#AM_CXXFLAGS = -Wall -Wextra -pedantic -std=c++0x
 AM_CXXFLAGS = -Wall -Wextra 
-
-AM_CPPFLAGS = $(CPL_INCLUDES)
-
-include_HEADERS = mosca_image.h mosca_image.tcc image_smooth.h type_traits.h
-
+AM_CFLAGS = -Wall -Wextra -std=c99
+
+
+AM_CPPFLAGS = $(CPL_INCLUDES)  -DHDRL_USE_PRIVATE
+
+include_HEADERS = detected_slits.h detected_slit.h \
+                  mosca_image.h mosca_image.tcc \
+                  flat_combine.h flat_combine.tcc image_utils.h \
+                  image_utils.tcc image_smooth.h image_smooth.cpp \
+                  image_spline_fit.h image_spline_fit.tcc \
+                  reduce_method.h \
+                  type_traits.h vector_utils.h vector_utils.tcc \
+                  wavelength_calibration.h \
+                  hdrl_overscan.h \
+                  hdrl_sigclip.h \
+                  hdrl_utils.h \
+                  hdrl_combine.h \
+                  hdrl_bpm.h \
+                  hdrl_iter.h \
+                  hdrl_collapse.h \
+                  hdrl_elemop.h \
+                  hdrl_flat.h \
+                  hdrl_prototyping.h \
+                  hdrl_image.h \
+                  hdrl_image_defs.h \
+                  hdrl_image_math.h \
+                  hdrl_imagelist.h \
+                  hdrl_imagelist_io.h \
+                  hdrl_imagelist_defs.h \
+                  hdrl_imagelist_basic.h \
+                  hdrl_imagelist_basic_body.h \
+                  hdrl_imagelist_view.h \
+                  hdrl_parameter.h \
+                  hdrl_types.h
+ 
 noinst_HEADERS =  
 
 lib_LTLIBRARIES = libmosca.la
 
-libmosca_la_SOURCES = image_smooth.cpp  mosca_image.cpp 
-libmosca_la_LDFLAGS = -version-info 0:1:0
+libmosca_la_SOURCES = detected_slits.cpp detected_slit.cpp \
+                      mosca_image.cpp \
+                      reduce_method.cpp wavelength_calibration.cpp \
+                      hdrl_overscan.c \
+                      hdrl_sigclip.c \
+                      hdrl_utils.c \
+                      hdrl_combine.c \
+                      hdrl_bpm.c \
+                      hdrl_iter.c \
+                      hdrl_collapse.c \
+                      hdrl_elemop.c \
+                      hdrl_flat.c \
+                      hdrl_prototyping.c \
+                      hdrl_image.c \
+                      hdrl_image_math.c \
+                      hdrl_imagelist_io.c \
+                      hdrl_imagelist_basic.c \
+                      hdrl_imagelist_view.c \
+                      hdrl_parameter.c
+
+#The -static is needed because in VLT machines, with LD_LIBRARY_PATH=/usrlib:/vlt..., the /usr/lib/libstdc++.so is chosen at runtime, which is the wrong version (it was compiled with /vlt/VLT2010/....). This will compile everything static for this library. Once DFS machines are VLT-free this can be removed.
+libmosca_la_LDFLAGS = -version-info 0:1:0 -static 
 libmosca_la_LIBADD =  -lm 
diff --git a/mosca/libmosca/Makefile.in b/mosca/libmosca/Makefile.in
index 053110f..7f2792d 100644
--- a/mosca/libmosca/Makefile.in
+++ b/mosca/libmosca/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,15 +15,29 @@
 @SET_MAKE@
 
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,49 +54,138 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = mosca/libmosca
 DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/admin/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
-	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/purify.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libmosca_la_DEPENDENCIES =
-am_libmosca_la_OBJECTS = image_smooth.lo mosca_image.lo
+am_libmosca_la_OBJECTS = detected_slits.lo detected_slit.lo \
+	mosca_image.lo reduce_method.lo wavelength_calibration.lo \
+	hdrl_overscan.lo hdrl_sigclip.lo hdrl_utils.lo hdrl_combine.lo \
+	hdrl_bpm.lo hdrl_iter.lo hdrl_collapse.lo hdrl_elemop.lo \
+	hdrl_flat.lo hdrl_prototyping.lo hdrl_image.lo \
+	hdrl_image_math.lo hdrl_imagelist_io.lo \
+	hdrl_imagelist_basic.lo hdrl_imagelist_view.lo \
+	hdrl_parameter.lo
 libmosca_la_OBJECTS = $(am_libmosca_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+libmosca_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(libmosca_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
 CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
-	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 SOURCES = $(libmosca_la_SOURCES)
 DIST_SOURCES = $(libmosca_la_SOURCES)
-includeHEADERS_INSTALL = $(INSTALL_HEADER)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 HEADERS = $(include_HEADERS) $(noinst_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
 ETAGS = etags
 CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
@@ -107,16 +210,17 @@ CX_LDFLAGS = @CX_LDFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOXYGEN = @DOXYGEN@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 FORS_BINARY_AGE = @FORS_BINARY_AGE@
 FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
 FORS_INCLUDES = @FORS_INCLUDES@
@@ -126,12 +230,17 @@ FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
 FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
 FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
 FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
 LATEX = @LATEX@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBCEXT = @LIBCEXT@
 LIBCFITSIO = @LIBCFITSIO@
@@ -147,48 +256,52 @@ LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 LT_AGE = @LT_AGE@
 LT_CURRENT = @LT_CURRENT@
 LT_REVISION = @LT_REVISION@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
 MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
-ONLINE_MODE_FALSE = @ONLINE_MODE_FALSE@
-ONLINE_MODE_TRUE = @ONLINE_MODE_TRUE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PURIFY_CMD = @PURIFY_CMD@
-PURIFY_FALSE = @PURIFY_FALSE@
-PURIFY_TRUE = @PURIFY_TRUE@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 all_includes = @all_includes@
 all_ldflags = @all_ldflags@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -200,8 +313,12 @@ build_alias = @build_alias@
 build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
+builddir = @builddir@
 configdir = @configdir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -214,17 +331,21 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 pipedocsdir = @pipedocsdir@
 plugindir = @plugindir@
 prefix = @prefix@
 privatelibdir = @privatelibdir@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target = @target@
@@ -232,37 +353,92 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 wkfcopydir = @wkfcopydir@
 wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.8 foreign
 DISTCLEANFILES = *~
+SUBDIRS = tests
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
 
-#AM_CXXFLAGS = -Wall -Wextra -pedantic
+#AM_CXXFLAGS = -Wall -Wextra -pedantic -std=c++0x
 AM_CXXFLAGS = -Wall -Wextra 
-AM_CPPFLAGS = $(CPL_INCLUDES)
-include_HEADERS = mosca_image.h mosca_image.tcc image_smooth.h type_traits.h
+AM_CFLAGS = -Wall -Wextra -std=c99
+AM_CPPFLAGS = $(CPL_INCLUDES)  -DHDRL_USE_PRIVATE
+include_HEADERS = detected_slits.h detected_slit.h \
+                  mosca_image.h mosca_image.tcc \
+                  flat_combine.h flat_combine.tcc image_utils.h \
+                  image_utils.tcc image_smooth.h image_smooth.cpp \
+                  image_spline_fit.h image_spline_fit.tcc \
+                  reduce_method.h \
+                  type_traits.h vector_utils.h vector_utils.tcc \
+                  wavelength_calibration.h \
+                  hdrl_overscan.h \
+                  hdrl_sigclip.h \
+                  hdrl_utils.h \
+                  hdrl_combine.h \
+                  hdrl_bpm.h \
+                  hdrl_iter.h \
+                  hdrl_collapse.h \
+                  hdrl_elemop.h \
+                  hdrl_flat.h \
+                  hdrl_prototyping.h \
+                  hdrl_image.h \
+                  hdrl_image_defs.h \
+                  hdrl_image_math.h \
+                  hdrl_imagelist.h \
+                  hdrl_imagelist_io.h \
+                  hdrl_imagelist_defs.h \
+                  hdrl_imagelist_basic.h \
+                  hdrl_imagelist_basic_body.h \
+                  hdrl_imagelist_view.h \
+                  hdrl_parameter.h \
+                  hdrl_types.h
+
 noinst_HEADERS = 
 lib_LTLIBRARIES = libmosca.la
-libmosca_la_SOURCES = image_smooth.cpp  mosca_image.cpp 
-libmosca_la_LDFLAGS = -version-info 0:1:0
+libmosca_la_SOURCES = detected_slits.cpp detected_slit.cpp \
+                      mosca_image.cpp \
+                      reduce_method.cpp wavelength_calibration.cpp \
+                      hdrl_overscan.c \
+                      hdrl_sigclip.c \
+                      hdrl_utils.c \
+                      hdrl_combine.c \
+                      hdrl_bpm.c \
+                      hdrl_iter.c \
+                      hdrl_collapse.c \
+                      hdrl_elemop.c \
+                      hdrl_flat.c \
+                      hdrl_prototyping.c \
+                      hdrl_image.c \
+                      hdrl_image_math.c \
+                      hdrl_imagelist_io.c \
+                      hdrl_imagelist_basic.c \
+                      hdrl_imagelist_view.c \
+                      hdrl_parameter.c
+
+
+#The -static is needed because in VLT machines, with LD_LIBRARY_PATH=/usrlib:/vlt..., the /usr/lib/libstdc++.so is chosen at runtime, which is the wrong version (it was compiled with /vlt/VLT2010/....). This will compile everything static for this library. Once DFS machines are VLT-free this can be removed.
+libmosca_la_LDFLAGS = -version-info 0:1:0 -static 
 libmosca_la_LIBADD = -lm 
-all: all-am
+all: all-recursive
 
 .SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
+.SUFFIXES: .c .cpp .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  mosca/libmosca/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  mosca/libmosca/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mosca/libmosca/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign mosca/libmosca/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -280,35 +456,43 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
 	  if test -f $$p; then \
-	    f=$(am__strip_dir) \
-	    echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
-	    $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+	    list2="$$list2 $$p"; \
 	  else :; fi; \
-	done
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
 
 uninstall-libLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  p=$(am__strip_dir) \
-	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
-	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
 	done
 
 clean-libLTLIBRARIES:
 	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libmosca.la: $(libmosca_la_OBJECTS) $(libmosca_la_DEPENDENCIES) 
-	$(CXXLINK) -rpath $(libdir) $(libmosca_la_LDFLAGS) $(libmosca_la_OBJECTS) $(libmosca_la_LIBADD) $(LIBS)
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+libmosca.la: $(libmosca_la_OBJECTS) $(libmosca_la_DEPENDENCIES) $(EXTRA_libmosca_la_DEPENDENCIES) 
+	$(libmosca_la_LINK) -rpath $(libdir) $(libmosca_la_OBJECTS) $(libmosca_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -316,26 +500,66 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/image_smooth.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/detected_slit.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/detected_slits.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_bpm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_collapse.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_combine.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_elemop.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_flat.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_image.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_image_math.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_imagelist_basic.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_imagelist_io.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_imagelist_view.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_iter.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_overscan.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_parameter.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_prototyping.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_sigclip.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hdrl_utils.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mosca_image.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/reduce_method.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wavelength_calibration.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
 .cpp.o:
- at am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
 
 .cpp.obj:
- at am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- at am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .cpp.lo:
- at am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
@@ -345,26 +569,73 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-
-distclean-libtool:
-	-rm -f libtool
-uninstall-info-am:
 install-includeHEADERS: $(include_HEADERS)
 	@$(NORMAL_INSTALL)
-	test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
-	@list='$(include_HEADERS)'; for p in $$list; do \
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
-	  $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
 	done
 
 uninstall-includeHEADERS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(includedir)/$$f"; \
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -372,174 +643,267 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
 check-am: all-am
-check: check-am
+check: check-recursive
 all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs:
+installdirs: installdirs-recursive
+installdirs-am:
 	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
 
 install-am: all-am
 	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
-installcheck: installcheck-am
+installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
 	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-am
+clean: clean-recursive
 
 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
 	mostlyclean-am
 
-distclean: distclean-am
+distclean: distclean-recursive
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-libtool distclean-tags
+	distclean-tags
 
-dvi: dvi-am
+dvi: dvi-recursive
 
 dvi-am:
 
-html: html-am
+html: html-recursive
 
-info: info-am
+html-am:
+
+info: info-recursive
 
 info-am:
 
 install-data-am: install-includeHEADERS
 
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
 install-exec-am: install-libLTLIBRARIES
 
-install-info: install-info-am
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
 
 install-man:
 
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
 installcheck-am:
 
-maintainer-clean: maintainer-clean-am
+maintainer-clean: maintainer-clean-recursive
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
-mostlyclean: mostlyclean-am
+mostlyclean: mostlyclean-recursive
 
 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
 	mostlyclean-libtool
 
-pdf: pdf-am
+pdf: pdf-recursive
 
 pdf-am:
 
-ps: ps-am
+ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-includeHEADERS uninstall-info-am \
-	uninstall-libLTLIBRARIES
+uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool ctags distclean \
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool cscopelist \
+	cscopelist-recursive ctags ctags-recursive distclean \
 	distclean-compile distclean-generic distclean-libtool \
 	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-exec \
-	install-exec-am install-includeHEADERS install-info \
-	install-info-am install-libLTLIBRARIES install-man \
-	install-strip installcheck installcheck-am installdirs \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-includeHEADERS install-info \
+	install-info-am install-libLTLIBRARIES install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs installdirs-am \
 	maintainer-clean maintainer-clean-generic mostlyclean \
 	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags uninstall uninstall-am \
-	uninstall-includeHEADERS uninstall-info-am \
-	uninstall-libLTLIBRARIES
+	pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+	uninstall-includeHEADERS uninstall-libLTLIBRARIES
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/mosca/libmosca/detected_slit.cpp b/mosca/libmosca/detected_slit.cpp
new file mode 100644
index 0000000..da46a89
--- /dev/null
+++ b/mosca/libmosca/detected_slit.cpp
@@ -0,0 +1,172 @@
+/* $Id: detected_slit.cpp,v 1.5 2013-08-21 15:13:55 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-08-21 15:13:55 $
+ * $Revision: 1.5 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#include <stdexcept>
+#include <iostream>
+#include <cmath>
+#include "detected_slit.h"
+
+mosca::detected_slit::detected_slit(int slit_id, 
+                                    double disp_bottom, double spa_bottom, 
+                                    double disp_top,    double spa_top,
+                                    int position_spatial_corrected,
+                                    int length_spatial_corrected,
+                                    const std::vector<double>& trace_bottom_pol_coeffs,                  
+                                    const std::vector<double>& trace_top_pol_coeffs) :
+ m_slit_id(slit_id), m_disp_bottom(disp_bottom),
+ m_spa_bottom(spa_bottom), m_disp_top(disp_top), m_spa_top(spa_top),
+ m_position_spatial_corrected(position_spatial_corrected),
+ m_length_spatial_corrected(length_spatial_corrected),
+ m_trace_bottom_pol_coeffs(trace_bottom_pol_coeffs),
+ m_trace_top_pol_coeffs(trace_top_pol_coeffs)
+{
+    
+    m_trace_bottom_pol = cpl_polynomial_new(1);
+    m_trace_top_pol =  cpl_polynomial_new(1);
+    cpl_size idx;
+    idx = 0;
+    std::vector<double>::reverse_iterator coeff;
+    for(idx = trace_bottom_pol_coeffs.size() - 1, coeff = m_trace_bottom_pol_coeffs.rbegin();
+            coeff != m_trace_bottom_pol_coeffs.rend(); ++coeff, --idx)
+        cpl_polynomial_set_coeff(m_trace_bottom_pol, &idx, *coeff);
+
+    for(idx = trace_top_pol_coeffs.size() -1, coeff = m_trace_top_pol_coeffs.rbegin();
+            coeff != m_trace_top_pol_coeffs.rend(); ++coeff, --idx)
+        cpl_polynomial_set_coeff(m_trace_top_pol, &idx, *coeff);
+}
+
+mosca::detected_slit::detected_slit()
+{
+    m_slit_id     = 0;
+    m_disp_bottom = 0;
+    m_spa_bottom  = 0;
+    m_disp_top    = 0;
+    m_spa_top     = 0;
+    m_position_spatial_corrected = 0;
+    m_length_spatial_corrected   = 0;
+    m_trace_bottom_pol = NULL;
+    m_trace_top_pol = NULL;
+
+}
+
+mosca::detected_slit::detected_slit(const detected_slit& rhs)
+{
+    m_slit_id     = rhs.m_slit_id;
+    m_disp_bottom = rhs.m_disp_bottom;
+    m_spa_bottom  = rhs.m_spa_bottom;
+    m_disp_top    = rhs.m_disp_top;
+    m_spa_top     = rhs.m_spa_top;
+    m_position_spatial_corrected = rhs.m_position_spatial_corrected;
+    m_length_spatial_corrected = rhs.m_length_spatial_corrected;
+    m_trace_bottom_pol = cpl_polynomial_duplicate(rhs.m_trace_bottom_pol);
+    m_trace_top_pol = cpl_polynomial_duplicate(rhs.m_trace_top_pol);
+
+}
+
+mosca::detected_slit::~detected_slit()
+{
+    if(m_trace_bottom_pol != NULL)
+        cpl_polynomial_delete(m_trace_bottom_pol);
+    if(m_trace_top_pol != NULL)
+        cpl_polynomial_delete(m_trace_top_pol);
+}
+
+void mosca::detected_slit::get_extent(double & disp_bottom, double & spa_bottom, 
+                                      double & disp_top,    double & spa_top)
+{
+    disp_bottom = m_disp_bottom;
+    spa_bottom  = m_spa_bottom;
+    disp_top    = m_disp_top;
+    spa_top     = m_spa_top;
+}
+
+void mosca::detected_slit::get_extent_pix(int& disp_bottom, int& spa_bottom, 
+                                          int& disp_top,    int& spa_top)
+{
+    disp_bottom = (int)std::floor(m_disp_bottom);
+    spa_bottom  = (int)std::floor(m_spa_bottom);
+    disp_top    = (int)std::ceil(m_disp_top);
+    spa_top     = (int)std::ceil(m_spa_top);
+}
+
+
+bool mosca::detected_slit::within_trace(double dispersion_pos,
+                                        double spatial_pos)
+{
+    
+    double trace_bottom = cpl_polynomial_eval_1d(m_trace_bottom_pol, 
+                                                 dispersion_pos, NULL);
+    double trace_top    = cpl_polynomial_eval_1d(m_trace_top_pol, 
+                                                 dispersion_pos, NULL);
+    
+    if(spatial_pos >= trace_bottom && spatial_pos <= trace_top)
+        return true;
+
+    return false;
+}
+
+double mosca::detected_slit::spatial_correct(double dispersion_pos,
+                                             double spatial_pos)
+{
+
+    double refpix = m_disp_top;
+    
+    double refpix_bottom = cpl_polynomial_eval_1d(m_trace_bottom_pol, refpix, NULL);
+    double refpix_top    = cpl_polynomial_eval_1d(m_trace_top_pol, refpix, NULL);
+
+    int npseudo = (int)(std::ceil(refpix_top - refpix_bottom) + 1);
+    
+    double trace_bottom = cpl_polynomial_eval_1d(m_trace_bottom_pol, 
+                                                 dispersion_pos, NULL);
+    double trace_top    = cpl_polynomial_eval_1d(m_trace_top_pol, 
+                                                 dispersion_pos, NULL);
+    double factor = (trace_top-trace_bottom)/npseudo;
+    
+    double spa_corrected_from_top = (spatial_pos - trace_top) / factor;
+    
+    double spa_corrected = m_position_spatial_corrected + 
+            m_length_spatial_corrected + spa_corrected_from_top;
+    
+    
+    return spa_corrected;
+}
+
+
+int mosca::detected_slit::slit_id() const
+{
+    return m_slit_id;
+}
+
+int mosca::detected_slit::get_position_spatial_corrected()
+{
+    return m_position_spatial_corrected;
+}
+
+int mosca::detected_slit::get_length_spatial_corrected()
+{
+    return m_length_spatial_corrected;
+}
diff --git a/mosca/libmosca/detected_slit.h b/mosca/libmosca/detected_slit.h
new file mode 100644
index 0000000..92423af
--- /dev/null
+++ b/mosca/libmosca/detected_slit.h
@@ -0,0 +1,128 @@
+/* $Id: detected_slit.h,v 1.4 2013-10-24 08:52:49 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-24 08:52:49 $
+ * $Revision: 1.4 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef DETECTED_SLIT_H
+#define DETECTED_SLIT_H
+
+#include <vector>
+#include "cpl_polynomial.h"
+
+namespace mosca
+{
+
+/**
+ * This class represents a detected slit in a spectroscopic image.
+ */
+class detected_slit
+{
+public:
+    /* 
+     * Constructor from the extents
+     * @param slit_id          The identification of the slit
+     * @param disp_bottom      The coordinate of the bottom of the slit in the 
+     *                         spectral axis
+     * @param spa_bottom       The coordinate of the bottom of the slit in the 
+     *                         spatial axis
+     * @param disp_top         The coordinate of the top of the slit in the 
+     *                         spectral axis
+     * @param spa_top          The coordinate of the top of the slit in the 
+     *                         spatial axis
+     * @param trace_bottom_pol_coeffs The coefficients of the polynomail fitted to the
+     *                                bottom of the slit trace
+     * @param trace_top_pol_coeffs    The coefficients of the polynomail fitted to the
+     *                                top of the slit trace
+     * 
+     */
+    detected_slit(int slit_id, double disp_bottom, double spa_bottom, 
+                  double disp_top, double spa_top,
+                  int position_spatial_corrected,
+                  int length_spatial_corrected,
+                  const std::vector<double>& trace_bottom_pol_coeffs,                  
+                  const std::vector<double>& trace_top_pol_coeffs);
+    
+    detected_slit();
+
+    detected_slit(const detected_slit& rhs);
+
+    virtual ~detected_slit();
+    
+    void get_extent(double& disp_bottom, double& spa_bottom, 
+                    double& disp_top,    double& spa_top);
+    
+    void get_extent_pix(int& disp_bottom, int& spa_bottom, 
+                        int& disp_top,    int& spa_top);
+    
+    int get_position_spatial_corrected();
+
+    int get_length_spatial_corrected();
+    
+    bool within_trace(double dispersion_pos, double spatial_pos);
+    
+    double spatial_correct(double dispersion_pos,
+                           double spatial_pos);
+    
+    int slit_id() const;
+
+private:
+    
+    //The identification of the slit
+    int m_slit_id;
+    
+    //The coordinate of the bottom of the slit in the spectral axis
+    double m_disp_bottom;
+    
+    //The coordinate of the bottom of the slit in the spatial axis
+    double m_spa_bottom;
+    
+    //The coordinate of the top of the slit in the spectral axis
+    double m_disp_top;
+    
+    //The coordinate of the top of the slit in the spatial axis
+    double m_spa_top;
+  
+    //Position of the bottom of the slit in an image already corrected from spatial distortion
+    int m_position_spatial_corrected;
+    
+    //Length of the slit in an image already corrected from spatial distortion
+    int m_length_spatial_corrected;
+    
+    //The coefficients of the polynomial fit to the bottom of the trace 
+    std::vector<double> m_trace_bottom_pol_coeffs;
+    
+    //The coefficients of the polynomial fit to the top of the trace 
+    std::vector<double> m_trace_top_pol_coeffs;
+
+    //The polynomial with the fit to the bottom of the trace
+    cpl_polynomial * m_trace_bottom_pol;
+
+    //The polynomial with the fit to the top of the trace
+    cpl_polynomial * m_trace_top_pol;
+};
+
+}
+
+#endif
diff --git a/mosca/libmosca/detected_slits.cpp b/mosca/libmosca/detected_slits.cpp
new file mode 100644
index 0000000..48820aa
--- /dev/null
+++ b/mosca/libmosca/detected_slits.cpp
@@ -0,0 +1,102 @@
+/* $Id: detected_slits.cpp,v 1.5 2013-07-24 14:58:34 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-07-24 14:58:34 $
+ * $Revision: 1.5 $
+ * $Name: not supported by cvs2svn $
+ */
+
+
+#include <iostream>
+#include <stdexcept>
+#include <sstream>
+#include <cpl_table.h>
+#include "detected_slits.h"
+
+std::vector<mosca::detected_slit>  
+mosca::detected_slits_load_fits(const std::string& fitsfile_slit_loc,
+                                const std::string& fitsfile_curv_coeff,
+                                int image_disp_size)
+{
+    std::vector<detected_slit> slits;
+    
+    /* We read from extension 1 of slit location table */
+    cpl_table* slit_table = cpl_table_load(fitsfile_slit_loc.c_str(), 1, 0);
+    
+    /* We read from extension 1 of curvature coefficients table */
+    cpl_table* curv_coeff = cpl_table_load(fitsfile_curv_coeff.c_str(), 1, 0);
+
+    if(2*cpl_table_get_nrow(slit_table) != cpl_table_get_nrow(curv_coeff))
+        throw std::invalid_argument("FITS Tables do not match");
+    
+    for(cpl_size irow = 0 ; irow < cpl_table_get_nrow(slit_table); irow++)
+    {
+        int null;
+        int slit_id = cpl_table_get_int(slit_table, 
+                                        "slit_id", irow, &null); 
+        double disp_bottom = cpl_table_get_double(slit_table,
+                                               "xbottom", irow, &null); 
+        disp_bottom = 1;
+        double disp_top    = cpl_table_get_double(slit_table,
+                                               "xtop", irow, &null);
+        disp_top = image_disp_size;
+        double spa_bottom  = cpl_table_get_double(slit_table, 
+                                               "ybottom", irow, &null); 
+        double spa_top     = cpl_table_get_double(slit_table, 
+                                               "ytop", irow, &null);
+        
+        int slit_id_check = cpl_table_get_int(curv_coeff, 
+                                              "slit_id", 2*irow, &null);
+        
+        int position_spatial_corrected  = cpl_table_get_int(slit_table, 
+                                               "position", irow, &null); 
+        int length_spatial_corrected     = cpl_table_get_int(slit_table, 
+                                               "length", irow, &null);
+        
+        if(slit_id != slit_id_check)
+            throw std::runtime_error("Slit identification doesn't match");
+
+        cpl_size ndegree = cpl_table_get_ncol(curv_coeff) - 1;
+
+        std::vector<double> bottom_trace_coeff;
+        std::vector<double> top_trace_coeff;
+        for(cpl_size idx_coeff = 0; idx_coeff < ndegree; idx_coeff++)
+        {
+            std::ostringstream colname;
+            colname<<std::left<<"c"<<idx_coeff;
+            top_trace_coeff.push_back(cpl_table_get_double
+                    (curv_coeff, colname.str().c_str(), 2*irow, NULL));
+            bottom_trace_coeff.push_back(cpl_table_get_double
+                    (curv_coeff, colname.str().c_str(), 2*irow + 1, NULL));
+        }
+        
+        
+        slits.push_back(mosca::detected_slit(slit_id, disp_bottom, spa_bottom,
+                                              disp_top, spa_top,
+                                              position_spatial_corrected,
+                                              length_spatial_corrected,
+                                              bottom_trace_coeff, 
+                                              top_trace_coeff));
+    }
+    
+    return slits;
+}
diff --git a/mosca/libmosca/image_smooth.h b/mosca/libmosca/detected_slits.h
similarity index 55%
copy from mosca/libmosca/image_smooth.h
copy to mosca/libmosca/detected_slits.h
index 609d843..0574bbe 100644
--- a/mosca/libmosca/image_smooth.h
+++ b/mosca/libmosca/detected_slits.h
@@ -1,4 +1,4 @@
-/* $Id: image_smooth.h,v 1.2 2013/01/24 18:01:23 cgarcia Exp $
+/* $Id: detected_slits.h,v 1.3 2013-07-24 11:20:19 cgarcia Exp $
  *
  * This file is part of the MOSCA library
  * Copyright (C) 2013 European Southern Observatory
@@ -15,20 +15,32 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/24 18:01:23 $
- * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-07-24 11:20:19 $
+ * $Revision: 1.3 $
+ * $Name: not supported by cvs2svn $
  */
 
-#include "mosca_image.h"
+#ifndef DETECTED_SLITS_H
+#define DETECTED_SLITS_H
+
+#include <vector>
+#include <string>
+#include "detected_slit.h"
 
 namespace mosca
 {
-void image_smooth_1d_median(mosca::image& image, 
-                            double half_width, mosca::axis smooth_axis);
+
+typedef std::vector<detected_slit> detected_slits;
+
+detected_slits detected_slits_load_fits(const std::string& fitsfile_slit_loc,
+                                        const std::string& fitsfile_curv_coeff,
+                                        int image_disp_size);
+
 }
+
+#endif
diff --git a/mosca/libmosca/flat_combine.h b/mosca/libmosca/flat_combine.h
new file mode 100644
index 0000000..e5f3daf
--- /dev/null
+++ b/mosca/libmosca/flat_combine.h
@@ -0,0 +1,59 @@
+/* $Id: flat_combine.h,v 1.10 2013-08-13 13:12:32 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-08-13 13:12:32 $
+ * $Revision: 1.10 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef FLAT_COMBINE_H
+#define FLAT_COMBINE_H
+
+#include <memory>
+#include "detected_slit.h"
+#include "wavelength_calibration.h"
+#include "mosca_image.h"
+#include "reduce_method.h"
+
+namespace mosca
+{
+template<typename T, typename Iter, typename CombineMethod>
+std::auto_ptr<mosca::image> 
+flat_combine_it(Iter image_start, Iter image_end, 
+                std::vector<mosca::detected_slit>& slits,
+                mosca::wavelength_calibration& wave_cal,
+                size_t smooth_size,
+                CombineMethod comb_method= mosca::reduce_mean());
+
+template<typename T, typename CombineMethod>
+std::auto_ptr<mosca::image> 
+flat_combine(std::vector<mosca::image>& image_list, 
+             std::vector<mosca::detected_slit>& slits,
+             mosca::wavelength_calibration& wave_cal,
+             size_t smooth_size, CombineMethod com_method);
+    
+}
+
+
+#include "flat_combine.tcc"
+
+#endif
diff --git a/mosca/libmosca/flat_combine.tcc b/mosca/libmosca/flat_combine.tcc
new file mode 100644
index 0000000..923b06e
--- /dev/null
+++ b/mosca/libmosca/flat_combine.tcc
@@ -0,0 +1,277 @@
+/* $Id: flat_combine.tcc,v 1.11 2013-08-13 13:16:27 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-08-13 13:16:27 $
+ * $Revision: 1.11 $
+ * $Name: not supported by cvs2svn $
+ */
+
+
+#ifndef FLAT_COMBINE_CPP
+#define FLAT_COMBINE_CPP
+
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <numeric>
+#include <stdexcept>
+#include "flat_combine.h"
+#include "mosca_image.h"
+#include "reduce_method.h"
+#include "image_utils.h"
+#include "vector_utils.h"
+
+
+/**
+ * @brief
+ *   Get a master spectroscopy flat 
+ *
+ * @param image_start An iterator with the first flat image
+ * @param image_end   An iterator with the end of the list of flat images.
+ *
+ * @tparam T    The type of data of the images: float, double, etc...
+ * @tparam Iter The type of iterator. If dereferenced it should return a 
+ *              mosca::image object
+ * TODO: Better interpolation of each value in the SED image
+ */
+template<typename T, typename Iter, typename CombineMethod>
+std::auto_ptr<mosca::image> 
+mosca::flat_combine_it(Iter flat_start, Iter flat_end, 
+                       std::vector<mosca::detected_slit>& slits,
+                       mosca::wavelength_calibration& wave_cal,
+                       size_t smooth_size, CombineMethod comb_method)
+{
+
+    size_t n_pix_sed = flat_start->size_dispersion();
+    /* TODO: Shouldn't be hard-coded DOUBLE */
+    cpl_image * master_flat_im = cpl_image_new(flat_start->size_dispersion(), flat_start->size_spatial(), CPL_TYPE_DOUBLE); 
+    cpl_image * master_flat_err = cpl_image_new(flat_start->size_dispersion(), flat_start->size_spatial(), CPL_TYPE_DOUBLE); 
+    
+    /* We work on a slit per slit basis */
+    for(std::vector<mosca::detected_slit>::iterator slit_it = slits.begin();
+        slit_it != slits.end() ; slit_it++)
+    {
+
+        int disp_bottom, spa_bottom, disp_top, spa_top;
+        slit_it->get_extent_pix(disp_bottom, spa_bottom,
+                                disp_top,    spa_top);
+
+        double min_wave, max_wave;
+        wave_cal.min_max_wave(min_wave, max_wave, flat_start->size_dispersion(),
+                slit_it->get_position_spatial_corrected(), 
+                slit_it->get_position_spatial_corrected() + slit_it->get_length_spatial_corrected());
+        double mean_dispersion = wave_cal.mean_dispersion(flat_start->size_dispersion(),
+                slit_it->get_position_spatial_corrected(), 
+                slit_it->get_position_spatial_corrected() + slit_it->get_length_spatial_corrected());
+
+        std::vector<mosca::image> slit_flats;
+        
+        for(Iter flat_it = flat_start; flat_it != flat_end ; flat_it++)
+        {
+            /* Trim the image to the slit area only */
+            mosca::image slit_flat = flat_it->trim(disp_bottom, spa_bottom,
+                                                   disp_top, spa_top);
+            slit_flats.push_back(slit_flat);
+        }
+        
+        /* Get the average flat. We don't care so much if areas 
+         * which don't belong to this slit are present */
+        mosca::image average_slit_flat = 
+                mosca::imagelist_reduce(slit_flats.begin(), 
+                                        slit_flats.end(), 
+                                        mosca::reduce_mean());
+        
+        /* Divide each individual flat by the average flat. 
+         * This removes the pixel to pixel variation, therefore only differences
+         * in large scale variations in wavelength are retained */
+        std::vector<mosca::image> pix2pix_slit_flats = 
+                slit_flats / average_slit_flat;
+
+        /* All the seds of all the flats */
+        std::vector<std::vector<double> > seds;
+        
+        /* Get the spectral energy distribution for each individual flat */ 
+        for(std::vector<mosca::image>::iterator flat_it =  pix2pix_slit_flats.begin(); 
+            flat_it != pix2pix_slit_flats.end(); flat_it++)
+        {
+            mosca::image& slit_flat = *flat_it;
+            double * flat_data = slit_flat.get_data<double>();
+            double * flat_err = slit_flat.get_data_err<double>();
+
+            /* Compute the SED for this flat */
+            std::vector<double> sed(n_pix_sed, 0.);
+            std::vector<double> sed_err(n_pix_sed, 0.);
+            std::vector<int> nsum(n_pix_sed, 0);
+            for(cpl_size j = 0; j< flat_it->size_dispersion(); j++)
+            {
+                /* When a pixel in column j is corrected from slit distortion, 
+                 * it can happen that it corresponds to a column below or beyond
+                 * the spectrum limits in the image. This margin_distor will
+                 * ensure that +- that margin will be taken into account.
+                 */
+                for(cpl_size i = 0; i< flat_it->size_spatial(); i++)
+                {
+                    if(slit_it->within_trace((double)(j + disp_bottom),
+                                             (double)(i + spa_bottom)))
+                    {
+
+                        double spatial_corrected = slit_it->spatial_correct
+                                ((double)(j + disp_bottom),
+                                 (double)(i + spa_bottom));
+                        double wavelength = wave_cal.get_wave
+                                (spatial_corrected, (double)(j + disp_bottom));
+                        if(wavelength > min_wave && wavelength < max_wave)
+                        {
+                            /* TODO: j, i depends on the spectral axis */
+                            size_t idx_sed = (wavelength - min_wave) / mean_dispersion - 0.5;
+                            sed[idx_sed] += flat_data[j + slit_flat.size_dispersion() * i];
+                            sed_err[idx_sed] += flat_err[j + slit_flat.size_dispersion() * i];
+                            nsum[idx_sed] += 1;
+                        }
+                    }
+                }
+            }
+            mosca::vector_divide(sed, sed_err, nsum);
+
+            /* Smooth the SED */
+            if(smooth_size > 1)
+                mosca::vector_smooth(sed, sed_err, smooth_size);
+            
+            /* Add this SED to the list of SEDs */
+            seds.push_back(sed);
+        }
+
+        /* Divide the original flats by its SED */
+        std::vector<mosca::image>::iterator flat_it;
+        std::vector<std::vector<double> >::iterator sed_it;
+        for(sed_it = seds.begin(), flat_it =  slit_flats.begin(); 
+                flat_it != slit_flats.end(); flat_it++, sed_it++)
+        {
+            mosca::image& slit_flat = *flat_it;
+            double * flat_data = slit_flat.get_data<double>();
+            double * flat_err = slit_flat.get_data_err<double>();
+            for(cpl_size j = 0; j< flat_it->size_dispersion(); j++)
+            {
+                for(cpl_size i = 0; i< flat_it->size_spatial(); i++)
+                {
+                    if(slit_it->within_trace((double)(j + disp_bottom),
+                            (double)(i + spa_bottom)))
+                    {
+                        double spatial_corrected = slit_it->spatial_correct
+                                ((double)(j + disp_bottom),
+                                        (double)(i + spa_bottom));
+                        double wavelength = wave_cal.get_wave
+                                (spatial_corrected, (double)(j + disp_bottom));
+                        if(wavelength > min_wave && wavelength < max_wave)
+                        {
+                            size_t idx_sed = (wavelength - min_wave) / mean_dispersion - 0.5;
+                            flat_data[j + slit_flat.size_dispersion() * i] /= (*sed_it)[idx_sed];
+                            /* TODO: Use the error in sed_err */
+                            flat_err[j + slit_flat.size_dispersion() * i] /= (*sed_it)[idx_sed];
+                        }
+                    }
+                }
+            }
+        }
+
+        /* Now we can stack the flats in the "usual" way. */
+        mosca::image stacked_slit_flat_no_sed = 
+                mosca::imagelist_reduce(slit_flats.begin(), 
+                                        slit_flats.end(), comb_method);
+
+        /* We compute the average SED */
+        std::vector<double> avg_sed(n_pix_sed, 0.);
+        for(size_t ipix = 0; ipix < n_pix_sed; ++ipix)
+        {
+            double sum = 0;
+            for(size_t ised = 0; ised < seds.size(); ++ised)
+                sum += seds[ised][ipix];
+            avg_sed[ipix] = sum / seds.size();
+        }
+        
+        /* Now we multiply the master slit flat by the average SED */
+        double * average_slit_flat_no_sed_im = stacked_slit_flat_no_sed.get_data<double>();
+        double * average_slit_flat_no_sed_err = stacked_slit_flat_no_sed.get_data_err<double>();
+        for(cpl_size j = 0; j< stacked_slit_flat_no_sed.size_dispersion(); j++)
+        {
+            for(cpl_size i = 0; i< stacked_slit_flat_no_sed.size_spatial(); i++)
+            {
+                if(slit_it->within_trace((double)(j + disp_bottom),
+                                         (double)(i + spa_bottom)))
+                {
+                    double spatial_corrected = slit_it->spatial_correct
+                            ((double)(j + disp_bottom),
+                             (double)(i + spa_bottom));
+                    double wavelength = wave_cal.get_wave
+                            (spatial_corrected, (double)(j + disp_bottom));
+                    if(wavelength > min_wave && wavelength < max_wave)
+                    {
+                         size_t idx_sed = (wavelength - min_wave) / mean_dispersion - 0.5;
+                         average_slit_flat_no_sed_im[j + stacked_slit_flat_no_sed.size_dispersion() * i] *= avg_sed[idx_sed];
+                     /* TODO: Use the error in sed_err */
+                         average_slit_flat_no_sed_err[j + stacked_slit_flat_no_sed.size_dispersion() * i] *= avg_sed[idx_sed];
+                    }
+                }
+            }
+        }
+        
+        
+        /* The master slit flat is placed in the master flat */
+        cpl_image_copy(master_flat_im, stacked_slit_flat_no_sed.get_cpl_image(),
+                       1, spa_bottom);
+        cpl_image_copy(master_flat_err, stacked_slit_flat_no_sed.get_cpl_image_err(),
+                       1, spa_bottom);
+    }
+    
+    std::auto_ptr<mosca::image> 
+        master_flat(new mosca::image(master_flat_im, master_flat_err));
+    
+    return master_flat;
+}
+
+/**
+ * @brief
+ *   Get a master spectroscopy flat 
+ *
+ * @param image_list A vector with all the flats.
+ * @param image_end   An iterator with the end of the list of flat images.
+ *
+ * @tparam T    The type of data of the images: float, double, etc...
+ * @tparam Iter The type of iterator. If dereferenced it should return a 
+ *              mosca::image object
+ *
+ */
+template<typename T, typename CombineMethod>
+std::auto_ptr<mosca::image> mosca::flat_combine
+(std::vector<mosca::image>& image_list, 
+ std::vector<mosca::detected_slit>& slits,
+ mosca::wavelength_calibration& wave_cal,
+ size_t smooth_size, CombineMethod comb_method)
+{
+    typedef std::vector<mosca::image>::iterator iter_type;
+    return mosca::flat_combine_it<T, iter_type, CombineMethod >
+        (image_list.begin(), image_list.end(), 
+                slits, wave_cal, smooth_size, comb_method);
+}
+
+
+#endif
diff --git a/mosca/libmosca/hdrl_bpm.c b/mosca/libmosca/hdrl_bpm.c
new file mode 100644
index 0000000..cea3c4a
--- /dev/null
+++ b/mosca/libmosca/hdrl_bpm.c
@@ -0,0 +1,198 @@
+/* $Id: hdrl_bpm.c,v 1.1 2013-10-16 11:31:01 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:01 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+-----------------------------------------------------------------------------*/
+
+#include "hdrl_bpm.h"
+#include <cpl.h>
+
+/*-----------------------------------------------------------------------------
+                                   Static
+ -----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @defgroup hdrl_bpm   BPM Module
+ */
+/*----------------------------------------------------------------------------*/
+
+/**@{*/
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief convert bad pixel information mask to a cpl_mask
+ *
+ * @param bpm        integer image containing the bad pixel information
+ * @param selection  bitmask selecting which values to set to bad
+ *
+ * @return cpl_mask
+ * @note as cpl only supports 32 bit integer images the top 32 bit of the
+ *       selection mask must be zero
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_mask * hdrl_bpm_to_mask(const cpl_image * bpm, uint64_t selection)
+{
+    cpl_ensure(bpm, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_ensure(cpl_image_get_type(bpm) == CPL_TYPE_INT,
+               CPL_ERROR_ILLEGAL_INPUT, NULL);
+    /* cpl currently only has int images, but use 64 for forward compat */
+    cpl_ensure(selection <= CX_MAXUINT, CPL_ERROR_UNSUPPORTED_MODE, NULL);
+    unsigned int iselection = (unsigned int)selection;
+    const unsigned int * data = (unsigned int *)cpl_image_get_data_int_const(bpm);
+    const size_t nx = cpl_image_get_size_x(bpm);
+    const size_t ny = cpl_image_get_size_y(bpm);
+    cpl_mask * msk = cpl_mask_new(nx, ny);
+    cpl_binary * dmsk = cpl_mask_get_data(msk);
+
+    for (size_t i = 0; i < ny * nx; i++) {
+        dmsk[i] = (data[i] & iselection) ? 1 : 0;
+    }
+
+    return msk;
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief convert cpl_mask to bad pixel information mask
+ *
+ * @param mask       cpl_mask to be converted
+ * @param selection  bitmask selecting which values to set the bad pixels to
+ *
+ * @return integer cpl_image
+ * @note as cpl only supports 32 bit integer images the top 32 bit of the
+ *       selection mask must be zero
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_image * hdrl_mask_to_bpm(const cpl_mask * mask, uint64_t flag)
+{
+    cpl_ensure(mask, CPL_ERROR_NULL_INPUT, NULL);
+    /* cpl currently only has int images, but use 64 for forward compat */
+    cpl_ensure(flag <= CX_MAXUINT, CPL_ERROR_UNSUPPORTED_MODE, NULL);
+    unsigned int iflag = (unsigned int)flag;
+    const size_t nx = cpl_mask_get_size_x(mask);
+    const size_t ny = cpl_mask_get_size_y(mask);
+    cpl_image * bpm = cpl_image_new(nx, ny, CPL_TYPE_INT);
+    const cpl_binary * dmsk = cpl_mask_get_data_const(mask);
+    unsigned int * data = (unsigned int *)cpl_image_get_data_int(bpm);
+
+    for (size_t i = 0; i < ny * nx; i++) {
+        data[i] = dmsk[i] ? iflag : 0;
+    }
+
+    return bpm;
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief apply array of masks to an imagelist
+ *
+ * @param list  imagelist where the masks shoudl be applied
+ * @param masks array of masks, must have same length as imagelist
+ *
+ * already existing masks will be overwritten
+ * can be used to reapply the original mask array returned by
+ * hdrl_join_mask_on_imagelist
+ *
+ * example:
+ * cpl_mask ** orig_masks;
+ * // change mask to get partial statistics from the list
+ * hdrl_join_mask_on_imagelist(list, echelle_mask, &orig_masks);
+ * stats = get_stats_from_echelle_orders()
+ * // restore original mask
+ * hdrl_set_masks_on_imagelist(list, orig_masks);
+ * // free memory
+ * for (i = 0; i < cpl_imagelist_get_size(list); i++) {
+ *   cpl_mask_free(orig_masks[i]);
+ * }
+ * cpl_free(orig_masks);
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_set_masks_on_imagelist(cpl_imagelist * list, cpl_mask ** masks)
+{
+    cpl_ensure_code(list, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(masks, CPL_ERROR_NULL_INPUT);
+
+    for (size_t i = 0; i < (size_t)cpl_imagelist_get_size(list); i++) {
+        cpl_image * img = cpl_imagelist_get(list, i);
+        cpl_mask * img_mask = cpl_image_get_bpm(img);
+        /* zero mask */
+        cpl_mask_xor(img_mask, img_mask);
+        /* add new mask */
+        cpl_mask_or(img_mask, masks[i]);
+    }
+
+    return cpl_error_get_code();
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief join mask with existing masks in an imagelist
+ *
+ * @param list      imagelist where the new mask should be joined on
+ * @param new_mask  new mask joined with the masks in the images
+ * @param pold_mask pointer to array pointer to store a copy of the original
+ *                  masks, array and masks contained in it must be deleted by
+ *                  the user, may be NULL in which case no copy is stored
+ * @see hdrl_set_masks_on_imagelist
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_join_mask_on_imagelist(cpl_imagelist * list, cpl_mask * new_mask,
+                            cpl_mask *** pold_mask)
+{
+    cpl_ensure_code(list, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(new_mask, CPL_ERROR_NULL_INPUT);
+
+    if (pold_mask) {
+        *pold_mask = cpl_malloc(sizeof(*pold_mask) *
+                                cpl_imagelist_get_size(list));
+    }
+
+    for (size_t i = 0; i < (size_t)cpl_imagelist_get_size(list); i++) {
+        cpl_image * img = cpl_imagelist_get(list, i);
+        cpl_mask * img_mask = cpl_image_get_bpm(img);
+        if (pold_mask) {
+            (*pold_mask)[i] = cpl_mask_duplicate(img_mask);
+        }
+
+        cpl_mask_or(img_mask, new_mask);
+    }
+
+    return cpl_error_get_code();
+}
+
+/**@}*/
diff --git a/irplib/irplib_spectrum.h b/mosca/libmosca/hdrl_bpm.h
similarity index 53%
copy from irplib/irplib_spectrum.h
copy to mosca/libmosca/hdrl_bpm.h
index 9b289b2..181ae24 100644
--- a/irplib/irplib_spectrum.h
+++ b/mosca/libmosca/hdrl_bpm.h
@@ -1,7 +1,7 @@
-/* $Id: irplib_spectrum.h,v 1.7 2009/07/30 12:38:37 yjung Exp $
+/* $Id: hdrl_bpm.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
  *
- * This file is part of the irplib package
- * Copyright (C) 2002,2003 European Southern Observatory
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,45 +15,48 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 /*
- * $Author: yjung $
- * $Date: 2009/07/30 12:38:37 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
  */
 
-#ifndef IRPLIB_SPECTRUM_H
-#define IRPLIB_SPECTRUM_H
+#ifndef HDRL_BPM_H
+#define HDRL_BPM_H
 
 /*-----------------------------------------------------------------------------
-                                   Includes
+                                Includes
  -----------------------------------------------------------------------------*/
 
 #include <cpl.h>
+#include <stdint.h>
 
 /*-----------------------------------------------------------------------------
-                                New types
+                                Define
  -----------------------------------------------------------------------------*/
 
-typedef enum SPEC_SHADOWS {
-    /* 2 shadows above and below true spectrum */
-    TWO_SHADOWS,
-    /* 1 shadow at specified distance from spectrum */
-    ONE_SHADOW,
-    /* Do not search for shadow */
-    NO_SHADOW
-} spec_shadows ;
-
 /*-----------------------------------------------------------------------------
-                                Prototypes
+                            Functions prototypes
+ -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+cpl_mask * hdrl_bpm_to_mask(const cpl_image *, uint64_t);
+cpl_image * hdrl_mask_to_bpm(const cpl_mask *, uint64_t);
+cpl_error_code
+hdrl_set_masks_on_imagelist(cpl_imagelist * list, cpl_mask ** masks);
+cpl_error_code
+hdrl_join_mask_on_imagelist(cpl_imagelist * list, cpl_mask * new_mask,
+                            cpl_mask *** pold_mask);
+CPL_END_DECLS
+/*-----------------------------------------------------------------------------
+             Private declarations - must not be used outside of hdrl
  -----------------------------------------------------------------------------*/
 
-int irplib_spectrum_find_brightest(const cpl_image *, int, spec_shadows, 
-        double, int, double *) ;
-cpl_vector * irplib_spectrum_detect_peaks(const cpl_vector *, int,
-        double, int, cpl_vector **, cpl_vector **) ;
+#ifdef HDRL_USE_PRIVATE
+
+#endif
 
 #endif
diff --git a/mosca/libmosca/hdrl_collapse.c b/mosca/libmosca/hdrl_collapse.c
new file mode 100644
index 0000000..091f852
--- /dev/null
+++ b/mosca/libmosca/hdrl_collapse.c
@@ -0,0 +1,1229 @@
+/* $Id: hdrl_collapse.c,v 1.1 2013-10-16 11:31:01 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:01 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+-----------------------------------------------------------------------------*/
+
+#include "hdrl_collapse.h"
+#include "hdrl_parameter.h"
+#include "hdrl_sigclip.h"
+#include "hdrl_utils.h"
+#include "hdrl_types.h"
+#include <cpl.h>
+
+#include <string.h>
+#include <math.h>
+/*-----------------------------------------------------------------------------
+                                   Types
+-----------------------------------------------------------------------------*/
+
+/* function performing imglist -> image reduction */
+typedef cpl_error_code (hdrl_collapse_imagelist_to_image_f)(
+    const cpl_imagelist * data,
+    const cpl_imagelist * errors,
+    cpl_image ** out,
+    cpl_image ** err,
+    cpl_image ** contrib,
+    void * parameters,
+    void * extra_out);
+
+struct hdrl_collapse_imagelist_to_image_s {
+    /* function performing imglist -> image reduction */
+    hdrl_collapse_imagelist_to_image_f * func;
+    /* parameters the reduction function requires */
+    hdrl_parameter * parameters;
+    /* extra output beyond data, errors, contrib it might produce */
+    void * extra_out;
+    /* destructor for the extra data */
+    hdrl_free * extra_out_delete;
+};
+
+/* function performing imglist -> image reduction */
+typedef cpl_error_code (hdrl_collapse_imagelist_to_vector_f)(
+    const cpl_imagelist * data,
+    const cpl_imagelist * errors,
+    cpl_vector ** out,
+    cpl_vector ** err,
+    cpl_array ** contrib,
+    void * parameters,
+    void * extra_out);
+
+struct hdrl_collapse_imagelist_to_vector_s {
+    /* function performing imglist -> vector reduction */
+    hdrl_collapse_imagelist_to_vector_f * func;
+    /* parameters the reduction function requires */
+    hdrl_parameter * parameters;
+    /* extra output beyond data, errors, contrib it might produce */
+    void * extra_out;
+    /* destructor for the extra data */
+    hdrl_free * extra_out_delete;
+};
+
+static cpl_error_code
+hdrl_collapse_mean(const cpl_imagelist * data,
+                   const cpl_imagelist * errors,
+                   cpl_image ** out, cpl_image ** err,
+                   cpl_image ** contrib, void * parameters,
+                   void * extra_out);
+static cpl_error_code
+hdrl_collapse_median(const cpl_imagelist * data,
+                     const cpl_imagelist * errors,
+                     cpl_image ** out, cpl_image ** err,
+                     cpl_image ** contrib, void * parameters,
+                     void * extra_out);
+static cpl_error_code
+hdrl_collapse_sigclip(const cpl_imagelist * data,
+                      const cpl_imagelist * errors,
+                      cpl_image ** out, cpl_image ** err,
+                      cpl_image ** contrib,void * parameters,
+                      void * extra_out);
+
+static cpl_error_code
+hdrl_collapse_weighted_mean(const cpl_imagelist * data_,
+                            const cpl_imagelist * errors_,
+                            cpl_image ** out, cpl_image ** err,
+                            cpl_image ** contrib, void * parameters,
+                            void * extra_out);
+
+/*-----------------------------------------------------------------------------
+                                   Static
+ -----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @defgroup hdrl_collapse_imagelist_to_image REDUCTION imagelist to image
+ */
+/*----------------------------------------------------------------------------*/
+
+/**@{*/
+
+/*-----------------------------------------------------------------------------
+                            Collapse Parameters
+ -----------------------------------------------------------------------------*/
+
+/* Mean COLLAPSE */
+typedef hdrl_parameter_empty hdrl_collapse_mean_parameter;
+static hdrl_parameter_typeobj hdrl_collapse_mean_parameter_type = {
+    (hdrl_alloc *)&cpl_malloc,              /* fp_alloc */
+    (hdrl_free *)&cpl_free,                 /* fp_free */
+    NULL,                                   /* fp_destroy */
+    sizeof(hdrl_collapse_mean_parameter),   /* obj_size */
+};
+
+/* Median COLLAPSE */
+typedef hdrl_parameter_empty hdrl_collapse_median_parameter;
+static hdrl_parameter_typeobj hdrl_collapse_median_parameter_type = {
+    (hdrl_alloc *)&cpl_malloc,              /* fp_alloc */
+    (hdrl_free *)&cpl_free,                 /* fp_free */
+    NULL,                                   /* fp_destroy */
+    sizeof(hdrl_collapse_median_parameter), /* obj_size */
+};
+
+/* Weighted Mean COLLAPSE */
+typedef hdrl_parameter_empty hdrl_collapse_weighted_mean_parameter;
+static hdrl_parameter_typeobj hdrl_collapse_weighted_mean_parameter_type = {
+    (hdrl_alloc *)&cpl_malloc,                      /* fp_alloc */
+    (hdrl_free *)&cpl_free,                         /* fp_free */
+    NULL,                                           /* fp_destroy */
+    sizeof(hdrl_collapse_weighted_mean_parameter),  /* obj_size */
+};
+
+/* Sigma-Clipping COLLAPSE */
+typedef struct {
+    HDRL_PARAMETER_HEAD;
+    double kappa_low;
+    double kappa_high;
+    int niter;
+} hdrl_collapse_sigclip_parameter;
+static hdrl_parameter_typeobj hdrl_collapse_sigclip_parameter_type = {
+    (hdrl_alloc *)&cpl_malloc,                  /* fp_alloc */
+    (hdrl_free *)&cpl_free,                     /* fp_free */
+    NULL,                                       /* fp_destroy */
+    sizeof(hdrl_collapse_sigclip_parameter),    /* obj_size */
+};
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief create a parameter object for mean
+ * @return hdrl_parameter
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_parameter * hdrl_collapse_mean_parameter_create(void)
+{
+    hdrl_parameter_empty * p = (hdrl_parameter_empty *)
+       hdrl_parameter_new(&hdrl_collapse_mean_parameter_type);
+    return (hdrl_parameter *)p;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief check if parameter is a mean parameter
+ * @return boolean
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_boolean hdrl_collapse_parameter_is_mean(const hdrl_parameter * self)
+{
+    return hdrl_parameter_check_type(self, &hdrl_collapse_mean_parameter_type);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief create a parameter object for median
+ * @return hdrl_parameter
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_parameter * hdrl_collapse_median_parameter_create(void)
+{
+    hdrl_parameter_empty * p = (hdrl_parameter_empty *)
+       hdrl_parameter_new(&hdrl_collapse_median_parameter_type);
+    return (hdrl_parameter *)p;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief check if parameter is a median parameter
+ * @return boolean
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_boolean hdrl_collapse_parameter_is_median(const hdrl_parameter * self)
+{
+    return hdrl_parameter_check_type(self, &hdrl_collapse_median_parameter_type);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief create a parameter object for weighted mean
+ * @return hdrl_parameter
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_parameter * hdrl_collapse_weighted_mean_parameter_create(void)
+{
+    hdrl_parameter_empty * p = (hdrl_parameter_empty *)
+       hdrl_parameter_new(&hdrl_collapse_weighted_mean_parameter_type);
+    return (hdrl_parameter *)p;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief check if parameter is a weighted mean parameter
+ * @return boolean
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_boolean hdrl_collapse_parameter_is_weighted_mean(
+        const hdrl_parameter * self)
+{
+    return hdrl_parameter_check_type(self, 
+            &hdrl_collapse_weighted_mean_parameter_type);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief create a parameter object for weighted mean
+ *
+ * @param kappa_low   low kappa multiplier
+ * @param kappa_high  high kappa multiplier
+ * @param niter       maximum number of clipping iterations
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_parameter *
+hdrl_collapse_sigclip_parameter_create(double kappa_low, double kappa_high, int niter)
+{
+    hdrl_collapse_sigclip_parameter * p = (hdrl_collapse_sigclip_parameter *)
+       hdrl_parameter_new(&hdrl_collapse_sigclip_parameter_type);
+    p->kappa_low = kappa_low;
+    p->kappa_high = kappa_high;
+    p->niter = niter;
+    return (hdrl_parameter *)p;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief check if parameter is a sigclip mean parameter
+ * @return boolean
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_boolean hdrl_collapse_parameter_is_sigclip(const hdrl_parameter * self)
+{
+    return hdrl_parameter_check_type(self, 
+            &hdrl_collapse_sigclip_parameter_type);
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Verify basic correctness of the parameters
+  @param    param   Collapse siglip parameters
+  @return   CPL_ERROR_NONE if everything is ok, an error code otherwise
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_collapse_sigclip_parameter_verify(
+        const hdrl_parameter    *   param) 
+{
+    const hdrl_collapse_sigclip_parameter * param_loc =
+            (hdrl_collapse_sigclip_parameter *)param ;
+
+    cpl_error_ensure(param != NULL, CPL_ERROR_NULL_INPUT,
+            return CPL_ERROR_NULL_INPUT,
+            "NULL Collapse Sigclip Parameters");
+
+    cpl_error_ensure(param_loc->niter >= 0, CPL_ERROR_ILLEGAL_INPUT,
+            return CPL_ERROR_ILLEGAL_INPUT,
+            "sigma-clipping iter (%d) value must be >= 0", 
+            param_loc->niter);
+
+    return CPL_ERROR_NONE ;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief get low kappa
+ * @param p  parameter
+ * @return kappa_low if p is of sigclip type
+ */
+/* ---------------------------------------------------------------------------*/
+double hdrl_collapse_sigclip_parameter_get_kappa_high(const hdrl_parameter * p)
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, -1);
+    cpl_ensure(hdrl_collapse_parameter_is_sigclip(p), 
+            CPL_ERROR_INCOMPATIBLE_INPUT, -1);
+
+    return ((hdrl_collapse_sigclip_parameter *)p)->kappa_high;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief get high kappa
+ * @param p  parameter
+ * @return kappa_high if p is of sigclip type
+ */
+/* ---------------------------------------------------------------------------*/
+double hdrl_collapse_sigclip_parameter_get_kappa_low(const hdrl_parameter * p)
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, -1);
+    cpl_ensure(hdrl_collapse_parameter_is_sigclip(p), 
+            CPL_ERROR_INCOMPATIBLE_INPUT, -1);
+
+    return ((hdrl_collapse_sigclip_parameter *)p)->kappa_low;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief get maximum number of clipping iterations
+ * @param p  parameter
+ * @return n if p is of sigclip type
+ */
+/* ---------------------------------------------------------------------------*/
+int hdrl_collapse_sigclip_parameter_get_niter(const hdrl_parameter * p)
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, -1);
+    cpl_ensure(hdrl_collapse_parameter_is_sigclip(p), 
+            CPL_ERROR_INCOMPATIBLE_INPUT, -1);
+
+    return ((hdrl_collapse_sigclip_parameter *)p)->niter;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+  @brief Create parameters for the collapse
+  @param full_prefix    prefix for parameter name
+  @param alias_prefix   prefix for cli alias 
+  @param context        context of parameter
+  @param method_def     Default method string
+  @param ѕigclip_def    Default sigclip parameters
+  @return The created Parameter List
+  Creates a parameterlist containing
+      full_prefix.method
+      full_prefix.sigclip.*
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_parameterlist * hdrl_collapse_parameter_create_parlist(
+        const char      *   full_prefix,
+        const char      *   alias_prefix,
+        const char      *   context,
+        const char      *   method_def,
+        hdrl_parameter  *   sigclip_def)
+{
+    cpl_ensure(full_prefix && alias_prefix && context, 
+            CPL_ERROR_NULL_INPUT, NULL);
+    const char          *   full_sep = strlen(full_prefix) > 0 ? "." : "";
+    const char          *   alias_sep = strlen(alias_prefix) > 0 ?  "." : "";
+    char                *   name ;
+    char                *   alias_name ;
+    cpl_parameterlist   *   parlist = cpl_parameterlist_new();
+    cpl_parameter       *   p ;
+
+    /* --prefix.method */
+    name = cpl_sprintf("%s%smethod", full_prefix, full_sep);
+    p = cpl_parameter_new_enum(name, CPL_TYPE_STRING, 
+            "Method used for collapsing the data", context,
+            method_def, 4, "MEAN", "WEIGHTED_MEAN", "MEDIAN", "SIGCLIP");
+    cpl_free(name) ;
+    name = cpl_sprintf("%s%smethod", alias_prefix, alias_sep);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
+    cpl_free(name) ;
+    cpl_parameterlist_append(parlist, p);
+
+    /* --prefix.sigclip.xxx */
+    name = cpl_sprintf("%s%ssigclip", full_prefix, full_sep);
+    alias_name = cpl_sprintf("%s%ssigclip", alias_prefix, alias_sep);
+    cpl_parameterlist * psigclip = hdrl_sigclip_parameter_create_parlist(
+            name, alias_name, context, sigclip_def);
+    cpl_free(name) ;
+    cpl_free(alias_name) ;
+
+    for (cpl_parameter * par = cpl_parameterlist_get_first(psigclip);
+         par != NULL;
+         par = cpl_parameterlist_get_next(psigclip)) {
+        cpl_parameterlist_append(parlist, cpl_parameter_duplicate(par));
+    }
+    cpl_parameterlist_delete(psigclip);
+
+    if (cpl_error_get_code()) {
+        cpl_parameterlist_delete(parlist);
+        return NULL;
+    }
+
+    return parlist;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+  @brief parse parameterlist for imagelist reduction method
+  @param parlist    parameter list to parse
+  @param prefix     prefix of parameter name
+  @return hdrl_parameter 
+  Reads a Parameterlist in order to create collapse parameters.
+  Expects a parameterlist conaining
+      full_prefix.method
+      full_prefix.sigclip.*
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_parameter * hdrl_collapse_parameter_parse_parlist(
+        const cpl_parameterlist     *   parlist,
+        const char                  *   prefix)
+{
+    cpl_ensure(prefix && parlist, CPL_ERROR_NULL_INPUT, NULL);
+    const char          * sep = strlen(prefix) > 0 ? "." : "";
+    hdrl_parameter * p = NULL;
+
+    /* Get the Method parameter */
+    char * name = cpl_sprintf("%s%smethod", prefix, sep);
+    const cpl_parameter * par = cpl_parameterlist_find_const(parlist, name);
+    const char          * value = cpl_parameter_get_string(par);
+    
+    /* Switch on the methods */
+    if(!strcmp(value, "MEDIAN")) {
+        p = hdrl_collapse_median_parameter_create();
+    } else if (!strcmp(value, "WEIGHTED_MEAN")) {
+        p = hdrl_collapse_weighted_mean_parameter_create();
+    } else if (!strcmp(value, "MEAN")) {
+        p = hdrl_collapse_mean_parameter_create();
+    } else if (!strcmp(value, "SIGCLIP")) {
+        double kappa_low, kappa_high;
+        int niter;
+        hdrl_sigclip_parameter_parse_parlist(parlist, prefix, &kappa_low, 
+                &kappa_high, &niter);
+        p = hdrl_collapse_sigclip_parameter_create(kappa_low,kappa_high,niter);
+    } else {
+        cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
+                "%s not a valid method for %s", value, name);
+        cpl_free(name);
+        return NULL;
+    }
+    cpl_free(name);
+    return p;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+  @brief calculate sum of squares of an imagelist
+  @param data     imagelist
+  @param contrib_ contribution map of reduction, may be NULL in which case it
+                 is calculated with cpl_image_new_from_accepted
+  @return image containing the sum of squares along the imagelist axis
+  equivalent to:
+    cpl_imagelist_power(data, 2.)
+    sqlist = cpl_imagelist_collapse_create(data)
+    cpl_image_multiply(sqlist, contrib);
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_image * imagelist_sqsum(
+        const cpl_imagelist     *   data, 
+        const cpl_image         *   contrib_)
+{
+    const cpl_image * contrib =
+        contrib_ ? contrib_ : cpl_image_new_from_accepted(data);
+    cpl_image * res = NULL;
+
+    for (cpl_size i = 0; i < cpl_imagelist_get_size(data); i++) {
+        const cpl_image * img = cpl_imagelist_get_const(data, i);
+        cpl_image * sqerr = cpl_image_power_create(img, 2.);
+        if (cpl_image_get_bpm_const(sqerr)) {
+            cpl_image_fill_rejected(sqerr, 0.0);
+            cpl_image_accept_all(sqerr);
+        }
+
+        if (i == 0) {
+            res = sqerr;
+        } else {
+            cpl_image_add(res, sqerr);
+            cpl_image_delete(sqerr);
+        }
+    }
+    cpl_mask * allbad = cpl_mask_threshold_image_create(contrib, 0, 0);
+    cpl_image_reject_from_mask(res, allbad);
+    cpl_mask_delete(allbad);
+
+    if (contrib != contrib_)
+        cpl_image_delete((cpl_image *)contrib);
+
+    return res;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief implements mean combination on input image list
+ *
+ * @param data    input data images
+ * @param errors  input errors images
+ * @param out     output combined images
+ * @param err     output combined errors
+ * @param contrib output contribution mask
+ * @param parameters parameters to control, not used
+ * @param extra_out  optional extra output, not used
+ *
+ *
+ * @return cpl_error_code
+ *
+ * @doc
+ * Mean and associated error are computed with standard formulae
+ *
+ * \f$
+ *   x_{mean}=\frac{(\sum_{i}^{n} x_{i})} { n }
+ * \f$
+ *
+ * \f$
+ *   \sigma_{x}=\sqrt{ \frac{ \sum_{i}^{n} x_{i}^{2} }{ n } }
+ * \f$
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code
+hdrl_collapse_mean(const cpl_imagelist * data,
+                             const cpl_imagelist * errors,
+                             cpl_image ** out, cpl_image ** err,
+                             cpl_image ** contrib, void * parameters,
+                             void * extra_out)
+{
+    /* (\Sum_i^n x_i) / n */
+    /* \sqrt(\Sum_i^n x_i^2) / n */
+    *contrib = cpl_image_new_from_accepted(data);
+    *out = cpl_imagelist_collapse_create(data);
+    *err = imagelist_sqsum(errors, *contrib);
+    cpl_image_power(*err, 0.5);
+    cpl_image_divide(*err, *contrib);
+
+    return cpl_error_get_code();
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief implements weighted mean combination on input image list
+ *
+ * @param data    input data images
+ * @param errors_ input errors images
+ * @param out     output combined images
+ * @param err     output combined errors
+ * @param contrib output contribution mask
+ * @param parameters parameters to control, not used
+ * @param extra_out  optional extra output, not used
+ *
+ * @return cpl_error_code
+ *
+ * @doc
+ * weighted mean and associated error are computed with standard formulae
+ *
+ * \f$
+ *   x_{mean}=\frac{(\sum_{i}^{n} w_{i} \cdot x_{i})} { \sum_{i}^{n} w_{i} }
+ * \f$
+ *
+ * \f$
+ *   \sigma_{x}=\frac{ 1 } { \sqrt{  \sum_{i}^{n} w_{i}^{2} } }
+ * \f$
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code
+hdrl_collapse_weighted_mean(const cpl_imagelist * data_,
+                                      const cpl_imagelist * errors_,
+                                      cpl_image ** out, cpl_image ** err,
+                                      cpl_image ** contrib, void * parameters,
+                                      void * extra_out)
+{
+    /* (\Sum_i^n w_i * x_i) / (\Sum_i^n w_i) */
+    /* 1 / \sqrt(\Sum_i^n w_i^2) */
+    cpl_imagelist * data = cpl_imagelist_duplicate(data_);
+    cpl_imagelist * errors = cpl_imagelist_duplicate(errors_);
+    *contrib = cpl_image_new_from_accepted(data);
+    cpl_imagelist_power(errors, -2);
+    cpl_imagelist_multiply(data, errors);
+    *out = cpl_imagelist_collapse_create(data);
+    *err = cpl_imagelist_collapse_create(errors);
+    cpl_imagelist_delete(data);
+    cpl_imagelist_delete(errors);
+    cpl_image_multiply(*out, *contrib);
+    cpl_image_multiply(*err, *contrib);
+    cpl_image_divide(*out, *err);
+    cpl_image_power(*err, -0.5);
+
+    return cpl_error_get_code();
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief implements median combination on input image list
+ *
+ * @param data    input data images
+ * @param errors  input errors images
+ * @param out     output combined images
+ * @param err     output combined errors
+ * @param contrib output contribution mask
+ * @param parameters parameters to control, not used
+ * @param extra_out  optional extra output, not used
+ *
+ * @return cpl_error_code
+ *
+ * @doc
+ * Median and associated error are computed similarly as for mean but
+ * scaling by \f$ \sqrt{ \frac{ \pi } { 2 } } \f$
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code
+hdrl_collapse_median(const cpl_imagelist * data,
+                               const cpl_imagelist * errors,
+                               cpl_image ** out, cpl_image ** err,
+                               cpl_image ** contrib, void * parameters,
+                               void * extra_out)
+{
+    /* same as mean with scaling by \sqrt(\pi / 2) */
+    *contrib = cpl_image_new_from_accepted(data);
+    *out = cpl_imagelist_collapse_median_create(data);
+    *err = imagelist_sqsum(errors, *contrib);
+    cpl_image_power(*err, 0.5);
+    cpl_image_divide(*err, *contrib);
+    /* scale error so it estimates stdev of normal distribution */
+    cpl_image_multiply_scalar(*err, sqrt(CPL_MATH_PI_2));
+    /* revert scaling for contrib <= 2 as median == mean in this case */
+    cpl_image * tmp = cpl_image_cast(*contrib, CPL_TYPE_DOUBLE);
+    cpl_image_threshold(tmp, 2.1, 2.1,  1. / sqrt(CPL_MATH_PI_2), 1.);
+    cpl_image_multiply(*err, tmp);
+    cpl_image_delete(tmp);
+
+    return cpl_error_get_code();
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief implements sigma-clipped combination on input image list
+ *
+ * @param data    input data images
+ * @param errors  input errors images
+ * @param out     output combined images
+ * @param err     output combined errors
+ * @param contrib output contribution mask
+ * @param parameters parameters to control, not used
+ * @param extra_out  optional extra output, not used
+ *
+ * @return cpl_error_code
+ *
+ * @doc
+ * sigma-clipped mean and associated error, computed similarly as for mean but
+ * scaling by \f$ \sqrt{ \frac{ \pi } { 2 } } \f$
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code
+hdrl_collapse_sigclip(const cpl_imagelist * data,
+                      const cpl_imagelist * errors,
+                      cpl_image ** out, cpl_image ** err,
+                      cpl_image ** contrib, void * parameters,
+                      void * extra_out)
+{
+    /* same as mean with scaling by \sqrt(\pi / 2) */
+    hdrl_collapse_sigclip_parameter * par = parameters;
+    hdrl_sigclip_image_output_t * eout =
+        (hdrl_sigclip_image_output_t *)extra_out;
+    cpl_ensure_code(par, CPL_ERROR_NULL_INPUT);
+    const cpl_image * img = cpl_imagelist_get_const(data, 0);
+    size_t nx = cpl_image_get_size_x(img);
+    size_t ny = cpl_image_get_size_y(img);
+    *out = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
+    *err = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
+    *contrib = cpl_image_new(nx, ny, CPL_TYPE_INT);
+
+    /* may be null, e.g. when used iteratively */
+    if (eout) {
+        eout->reject_low = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
+        eout->reject_high = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
+    }
+    /* sigmaclip along imagelist axis */
+    for (size_t x = 1; x < nx + 1; x++) {
+        for (size_t y = 1; y < ny + 1; y++) {
+            cpl_vector * vd = hdrl_imagelist_to_vector(data, x, y);
+            cpl_vector * ve = hdrl_imagelist_to_vector(errors, x, y);
+            if (vd && ve) {
+                double m, e, rej_low, rej_high;
+                cpl_size naccepted;
+                hdrl_kappa_sigma_clip(vd, ve,
+                                     par->kappa_low, par->kappa_high,
+                                     par->niter,
+                                     &m, &e, &naccepted,
+                                     &rej_low, &rej_high);
+                cpl_image_set(*out, x, y, m);
+                cpl_image_set(*err, x, y, e);
+                cpl_image_set(*contrib, x, y, naccepted);
+                if (eout) {
+                    cpl_image_set(eout->reject_low, x, y, rej_low);
+                    cpl_image_set(eout->reject_high, x, y, rej_high);
+                }
+            }
+            else {
+                cpl_image_reject(*out, x, y);
+                cpl_image_reject(*err, x, y);
+                cpl_image_set(*contrib, x, y, 0);
+                if (eout) {
+                    cpl_image_set(eout->reject_low, x, y, 0.);
+                    cpl_image_set(eout->reject_high, x, y, 0.);
+                }
+            }
+            cpl_vector_delete(vd);
+            cpl_vector_delete(ve);
+        }
+    }
+
+    return cpl_error_get_code();
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief reduction object to reduce imagelist via mean
+ * @return mean reduction object
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_collapse_imagelist_to_image_t * hdrl_collapse_imagelist_to_image_mean()
+{
+    hdrl_collapse_imagelist_to_image_t * s = cpl_calloc(1, sizeof(*s));
+    s->func = &hdrl_collapse_mean;
+    return s;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief reduction object to reduce imagelist via weighted mean
+ * @return weighted mean reduction object
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_collapse_imagelist_to_image_t * hdrl_collapse_imagelist_to_image_weighted_mean()
+{
+    hdrl_collapse_imagelist_to_image_t * s = cpl_calloc(1, sizeof(*s));
+    s->func = &hdrl_collapse_weighted_mean;
+    return s;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief reduction object to reduce imagelist via median
+ * @return median reduction object
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_collapse_imagelist_to_image_t * hdrl_collapse_imagelist_to_image_median()
+{
+    hdrl_collapse_imagelist_to_image_t * s = cpl_calloc(1, sizeof(*s));
+    s->func = &hdrl_collapse_median;
+    return s;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief deallocate memory associated to input parameter object
+ *
+ * @param out object to deallocate
+ *
+ * @return void
+ */
+/* ---------------------------------------------------------------------------*/
+static void
+hdrl_sigclip_image_output_delete(hdrl_sigclip_image_output_t * out)
+{
+    if (!out)
+        return;
+
+    cpl_image_delete(out->reject_low);
+    cpl_image_delete(out->reject_high);
+    cpl_free(out);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief reduction object to reduce imagelist via kappa sigma clipped mean
+ *
+ * @param kappa_low  low sigma bound
+ * @param kappa_high high sigma bound
+ * @param niter      number of clipping iterators
+ *
+ * @return sigma clip reduction object
+ * @see  hdrl_kappa_sigma_clip()
+ *
+ * the high and low reject values are stored in extra_out if applicable
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_collapse_imagelist_to_image_t *
+hdrl_collapse_imagelist_to_image_sigclip(double kappa_low,
+                                       double kappa_high,
+                                       int niter)
+{
+    hdrl_collapse_imagelist_to_image_t * s = cpl_calloc(1, sizeof(*s));
+    hdrl_parameter * sp =
+        hdrl_collapse_sigclip_parameter_create(kappa_low, kappa_high, niter);
+    hdrl_sigclip_image_output_t * out = cpl_calloc(1, sizeof(*out));
+    s->func = &hdrl_collapse_sigclip;
+    s->parameters = sp;
+    s->extra_out = out;
+    s->extra_out_delete = (hdrl_free *)&hdrl_sigclip_image_output_delete;
+    return s;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief Call the associated reduction function
+ *
+ * @param f       reduction function object
+ * @param data    data to apply function on, may be modified
+ * @param errors  errors to use for propagation, may be modified
+ * @param out     pointer which will contain reduced data image, type double
+ * @param err     pointer which will contain reduced error image, type double
+ * @param contrib pointer which will contain contribution map, type integer
+ *
+ * @return cpl_error_code
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_collapse_imagelist_to_image_call(hdrl_collapse_imagelist_to_image_t * f,
+                                    const cpl_imagelist * data,
+                                    const cpl_imagelist * errors,
+                                    cpl_image ** out,
+                                    cpl_image ** err,
+                                    cpl_image ** contrib)
+{
+    cpl_ensure_code(f, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(data, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(errors, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(out, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(err, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(contrib, CPL_ERROR_NULL_INPUT);
+
+    return f->func(data, errors, out, err, contrib,
+                   f->parameters, f->extra_out);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief deallocate memory associated to input parameter object
+ *
+ * @param f       reduction function object
+ *
+ * @return cpl_error_code
+ */
+/* ---------------------------------------------------------------------------*/
+void hdrl_collapse_imagelist_to_image_disable_extra_out(
+    hdrl_collapse_imagelist_to_image_t * f)
+{
+    if (f->extra_out_delete) {
+        f->extra_out_delete(f->extra_out);
+        f->extra_out = NULL;
+    }
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief delete imagelist reduction object
+ *
+ * @param p  imagelist reduction object or NULL
+ */
+/* ---------------------------------------------------------------------------*/
+void hdrl_collapse_imagelist_to_image_delete(hdrl_collapse_imagelist_to_image_t * p)
+{
+    if (p) {
+        hdrl_parameter_delete(p->parameters);
+        if (p->extra_out_delete)
+            p->extra_out_delete(p->extra_out);
+    }
+    cpl_free(p);
+}
+
+/**@}*/
+
+
+/*----------------------------------------------------------------------------*/
+/**
+  @defgroup hdrl_collapse_imagelist_to_vector REDUCTION imagelist to vector
+ */
+/*----------------------------------------------------------------------------*/
+
+/**@{*/
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief implements mean reduction on each image of an imagelist
+ *
+ * @param data    input data images
+ * @param errors  input errors images
+ * @param out     vector of median of each image
+ * @param err     vector of errors of median of each image
+ * @param contrib array of contributions
+ * @param parameters parameters to control, not used
+ * @param extra_out  optional extra output, not used
+ *
+ * @return cpl_error_code
+ *
+ * @doc
+ * The mean value on all good pixels of each image of an imagelist, the
+ * associated error and the number of good pixels are stored as elements
+ * of the corresponding output vectors.
+ * If all pixels of an image in the list are bad the contribution is 0 and the
+ * out and err are set to NAN.
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code
+reduce_imagelist_to_vector_mean(const cpl_imagelist * data,
+                                const cpl_imagelist * errors,
+                                cpl_vector ** out, cpl_vector ** err,
+                                cpl_array ** contrib, void * parameters,
+                                void * extra_out)
+{
+    size_t nz = cpl_imagelist_get_size(data);
+    *out = cpl_vector_new(nz);
+    *err = cpl_vector_new(nz);
+    *contrib = cpl_array_new(nz, CPL_TYPE_INT);
+
+    for (size_t i = 0; i < nz; i++) {
+        const cpl_image * img = cpl_imagelist_get_const(data, i);
+        const cpl_image * ierr = cpl_imagelist_get_const(errors, i);
+        size_t naccepted = hdrl_get_image_good_npix(img);
+
+        if (naccepted != 0) {
+            double error = sqrt(cpl_image_get_sqflux(ierr)) / naccepted;
+
+            cpl_vector_set(*out, i, cpl_image_get_mean(img));
+            cpl_vector_set(*err, i, error);
+        }
+        else {
+            cpl_vector_set(*out, i, NAN);
+            cpl_vector_set(*err, i, NAN);
+        }
+        cpl_array_set_int(*contrib, i, naccepted);
+    }
+
+    return cpl_error_get_code();
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief reduction object to reduce imagelist via mean
+ * @return mean reduction object
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_collapse_imagelist_to_vector_t * hdrl_collapse_imagelist_to_vector_mean()
+{
+    hdrl_collapse_imagelist_to_vector_t * s = cpl_calloc(1, sizeof(*s));
+    s->func = &reduce_imagelist_to_vector_mean;
+    return s;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief implements median reduction on each image of an imagelist
+ *
+ * @param data    input data images
+ * @param errors  input errors images
+ * @param out     vector of median of each image
+ * @param err     vector of errors of median of each image
+ * @param contrib array of contributions
+ * @param parameters parameters to control, not used
+ * @param extra_out  optional extra output, not used
+ *
+ * The errors are scaled by the sqrt of the statistical efficiency of the
+ * median on normal distributed data which is $\f \frac{ \pi } / { 2 } \f$
+ *
+ * @return cpl_error_code
+ *
+ * @doc
+ * The median value on all good pixels of each image of an imagelist, the
+ * associated error and the number of good pixels are stored as elements
+ * of the corresponding output vectors.
+ * If all pixels of an image in the list are bad the contribution is 0 and the
+ * out and err are set to NAN.
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code
+reduce_imagelist_to_vector_median(const cpl_imagelist * data,
+                                  const cpl_imagelist * errors,
+                                  cpl_vector ** out, cpl_vector ** err,
+                                  cpl_array ** contrib, void * parameters,
+                                  void * extra_out)
+{
+    size_t nz = cpl_imagelist_get_size(data);
+    *out = cpl_vector_new(nz);
+    *err = cpl_vector_new(nz);
+    *contrib = cpl_array_new(nz, CPL_TYPE_INT);
+
+    for (size_t i = 0; i < nz; i++) {
+        const cpl_image * img = cpl_imagelist_get_const(data, i);
+        const cpl_image * ierr = cpl_imagelist_get_const(errors, i);
+        size_t naccepted = hdrl_get_image_good_npix(img);
+
+        if (naccepted != 0) {
+            double error = sqrt(cpl_image_get_sqflux(ierr)) / naccepted;
+            /* sqrt(statistical efficiency on normal data)*/
+            if (naccepted > 2) {
+                error *= sqrt(CPL_MATH_PI_2);
+            }
+
+            cpl_vector_set(*out, i, cpl_image_get_median(img));
+            cpl_vector_set(*err, i, error);
+        }
+        else {
+            cpl_vector_set(*out, i, NAN);
+            cpl_vector_set(*err, i, NAN);
+        }
+        cpl_array_set_int(*contrib, i, naccepted);
+    }
+
+    return cpl_error_get_code();
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief reduction object to reduce imagelist via median
+ * @return median reduction object
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_collapse_imagelist_to_vector_t * hdrl_collapse_imagelist_to_vector_median()
+{
+    hdrl_collapse_imagelist_to_vector_t * s = cpl_calloc(1, sizeof(*s));
+    s->func = &reduce_imagelist_to_vector_median;
+    return s;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @internal
+ * @brief implements sigma-clipped combination on input image list into a vector
+ *
+ * @param data    input data imagelist
+ * @param errors  input errors imagelist
+ * @param out     output vector
+ * @param err     output vector errors
+ * @param contrib output contribution vector
+ *
+ * @return cpl_error_code
+ *
+ * If all pixels of an image in the list are rejected the contribution is 0 and
+ * the out and err are set to NAN.
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code
+reduce_imagelist_to_vector_sigclip(const cpl_imagelist * data,
+                                   const cpl_imagelist * errors,
+                                   cpl_vector ** out, cpl_vector ** err,
+                                   cpl_array ** contrib, void * parameters,
+                                   void * extra_out)
+{
+    hdrl_collapse_sigclip_parameter * par = parameters;
+    hdrl_sigclip_vector_output_t * eout =
+        (hdrl_sigclip_vector_output_t *)extra_out;
+
+    cpl_size nz = cpl_imagelist_get_size(data);
+    *out = cpl_vector_new(nz);
+    *err = cpl_vector_new(nz);
+    *contrib = cpl_array_new(nz, CPL_TYPE_INT);
+
+    /* may be null, e.g. when used iteratively */
+    if (eout) {
+         eout->reject_low = cpl_vector_new(nz);
+         eout->reject_high = cpl_vector_new(nz);
+    }
+
+    /* sigmaclip on each image of the imagelist */
+    for (cpl_size z = 0; z < nz ; z++) {
+        double corr, error, low, high;
+        cpl_size contribution;
+        if (hdrl_kappa_sigma_clip_image(cpl_imagelist_get_const(data, z),
+                                        cpl_imagelist_get_const(errors, z),
+                                        par->kappa_low,
+                                        par->kappa_high,
+                                        par->niter,
+                                        &corr,
+                                        &error,
+                                        &contribution,
+                                        &low,
+                                        &high) != CPL_ERROR_NONE) {
+            break;
+        }
+        cpl_vector_set(*out, z, corr);
+        cpl_vector_set(*err, z, error);
+        cpl_array_set_int(*contrib, z, contribution);
+
+        if (eout) {
+            cpl_vector_set(eout->reject_low, z, low);
+            cpl_vector_set(eout->reject_high, z, high);
+        }
+    }
+
+    return cpl_error_get_code();
+}
+
+hdrl_sigclip_vector_output_t *
+hdrl_collapse_imagelist_to_vector_sigclip_get_extra_out(
+    hdrl_collapse_imagelist_to_vector_t * self)
+{
+    return self->extra_out;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @internal
+ * @brief deallocate memory associated to input parameter object
+ *
+ * @param out  object to deallocate
+ *
+ * @return void
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+static void
+hdrl_sigclip_vector_output_delete(hdrl_sigclip_vector_output_t * out)
+{
+    if (!out)
+        return;
+
+    cpl_vector_delete(out->reject_low);
+    cpl_vector_delete(out->reject_high);
+    cpl_free(out);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief reduction object to reduce imagelist to a vector via kappa sigma
+ * clipped mean
+ *
+ * @param kappa_low  low sigma bound
+ * @param kappa_high high sigma bound
+ * @param niter      maximum number of clipping iterations
+ *
+ * @return sigma clip reduction object
+ * @see  hdrl_kappa_sigma_clip()
+ *
+ * the high and low reject values are stored in extra_out if applicable
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_collapse_imagelist_to_vector_t *
+hdrl_collapse_imagelist_to_vector_sigclip(double kappa_low, double kappa_high,
+                                        int niter)
+{
+    hdrl_collapse_imagelist_to_vector_t * s = cpl_calloc(1, sizeof(*s));
+    hdrl_parameter * sp =
+        hdrl_collapse_sigclip_parameter_create(kappa_low, kappa_high, niter);
+    hdrl_sigclip_vector_output_t * out = cpl_calloc(1, sizeof(*out));
+    s->func = &reduce_imagelist_to_vector_sigclip;
+    s->parameters = sp;
+    s->extra_out = out;
+    s->extra_out_delete = (hdrl_free *)&hdrl_sigclip_vector_output_delete;
+    return s;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief Call the associated reduction function
+ *
+ * @param f       reduction function object
+ * @param data    data to apply function on, may be modified
+ * @param errors  errors to use for propagation, may be modified
+ * @param out     pointer which will contain reduced data image, type double
+ * @param err     pointer which will contain reduced error image, type double
+ * @param contrib pointer which will contain contribution map, type integer
+ *
+ * @return cpl_error_code
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_collapse_imagelist_to_vector_call(hdrl_collapse_imagelist_to_vector_t * f,
+                                     const cpl_imagelist * data,
+                                     const cpl_imagelist * errors,
+                                     cpl_vector ** out,
+                                     cpl_vector ** err,
+                                     cpl_array ** contrib)
+{
+    cpl_ensure_code(f, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(data, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(errors, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(out, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(err, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(contrib, CPL_ERROR_NULL_INPUT);
+
+    return f->func(data, errors, out, err, contrib,
+                   f->parameters, f->extra_out);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief delete imagelist reduction object
+ *
+ * @param p  imagelist reduction object or NULL
+ */
+/* ---------------------------------------------------------------------------*/
+void
+hdrl_collapse_imagelist_to_vector_delete(hdrl_collapse_imagelist_to_vector_t * p)
+{
+    if (p) {
+        cpl_free(p->parameters);
+        if (p->extra_out_delete)
+            p->extra_out_delete(p->extra_out);
+    }
+    cpl_free(p);
+}
+
+
+/**@}*/
+
diff --git a/mosca/libmosca/hdrl_collapse.h b/mosca/libmosca/hdrl_collapse.h
new file mode 100644
index 0000000..5f0cf6e
--- /dev/null
+++ b/mosca/libmosca/hdrl_collapse.h
@@ -0,0 +1,131 @@
+/* $Id: hdrl_collapse.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_COLLAPSE_H
+#define HDRL_COLLAPSE_H
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include <hdrl_parameter.h>
+
+#include <cpl.h>
+
+/*-----------------------------------------------------------------------------
+                                Define
+ -----------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------
+                            Functions prototypes
+ -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+typedef struct hdrl_collapse_imagelist_to_image_s
+    hdrl_collapse_imagelist_to_image_t;
+typedef struct hdrl_collapse_imagelist_to_vector_s
+    hdrl_collapse_imagelist_to_vector_t;
+
+typedef struct {
+    cpl_image * reject_low;
+    cpl_image * reject_high;
+} hdrl_sigclip_image_output_t;
+
+typedef struct {
+    cpl_vector * reject_low;
+    cpl_vector * reject_high;
+} hdrl_sigclip_vector_output_t;
+
+hdrl_collapse_imagelist_to_image_t * hdrl_collapse_imagelist_to_image_mean();
+hdrl_collapse_imagelist_to_image_t *
+hdrl_collapse_imagelist_to_image_weighted_mean();
+hdrl_collapse_imagelist_to_image_t * hdrl_collapse_imagelist_to_image_median();
+hdrl_collapse_imagelist_to_image_t *
+hdrl_collapse_imagelist_to_image_sigclip(double kappa_low,
+                                       double kappa_high,
+                                       int iter);
+cpl_error_code hdrl_collapse_imagelist_to_image_call(
+    hdrl_collapse_imagelist_to_image_t * f,
+    const cpl_imagelist * data,
+    const cpl_imagelist * errors,
+    cpl_image ** out,
+    cpl_image ** err,
+    cpl_image ** contrib);
+void hdrl_collapse_imagelist_to_image_disable_extra_out(
+    hdrl_collapse_imagelist_to_image_t *);
+void hdrl_collapse_imagelist_to_image_delete(hdrl_collapse_imagelist_to_image_t *);
+
+
+hdrl_collapse_imagelist_to_vector_t * hdrl_collapse_imagelist_to_vector_mean();
+hdrl_collapse_imagelist_to_vector_t * hdrl_collapse_imagelist_to_vector_median();
+hdrl_collapse_imagelist_to_vector_t *
+hdrl_collapse_imagelist_to_vector_sigclip(double kappa_low,
+                                       double kappa_high,
+                                       int iter);
+hdrl_sigclip_vector_output_t *
+hdrl_collapse_imagelist_to_vector_sigclip_get_extra_out(
+    hdrl_collapse_imagelist_to_vector_t *);
+
+cpl_error_code hdrl_collapse_imagelist_to_vector_call(
+    hdrl_collapse_imagelist_to_vector_t * f,
+    const cpl_imagelist * data,
+    const cpl_imagelist * errors,
+    cpl_vector ** out,
+    cpl_vector ** err,
+    cpl_array ** contrib);
+void hdrl_collapse_imagelist_to_vector_disable_extra_out(
+    hdrl_collapse_imagelist_to_vector_t *);
+void hdrl_collapse_imagelist_to_vector_delete(
+    hdrl_collapse_imagelist_to_vector_t *);
+
+hdrl_parameter * hdrl_collapse_mean_parameter_create(void);
+cpl_boolean hdrl_collapse_parameter_is_mean(const hdrl_parameter *);
+hdrl_parameter * hdrl_collapse_median_parameter_create(void);
+cpl_boolean hdrl_collapse_parameter_is_median(const hdrl_parameter *);
+hdrl_parameter * hdrl_collapse_weighted_mean_parameter_create(void);
+cpl_boolean hdrl_collapse_parameter_is_weighted_mean(const hdrl_parameter *);
+hdrl_parameter * hdrl_collapse_sigclip_parameter_create(double, double, int);
+cpl_error_code hdrl_collapse_sigclip_parameter_verify(const hdrl_parameter *);
+cpl_boolean hdrl_collapse_parameter_is_sigclip(const hdrl_parameter *);
+double hdrl_collapse_sigclip_parameter_get_kappa_high(const hdrl_parameter *);
+double hdrl_collapse_sigclip_parameter_get_kappa_low(const hdrl_parameter *);
+int hdrl_collapse_sigclip_parameter_get_niter(const hdrl_parameter *);
+
+hdrl_parameter * hdrl_collapse_parameter_parse_parlist(
+        const cpl_parameterlist *, const char *);
+cpl_parameterlist * hdrl_collapse_parameter_create_parlist(const char *, 
+        const char *, const char *, const char *, hdrl_parameter *) ;
+CPL_END_DECLS
+
+/*-----------------------------------------------------------------------------
+             Private declarations - must not be used outside of hdrl
+ -----------------------------------------------------------------------------*/
+
+#ifdef HDRL_USE_PRIVATE
+
+#endif
+
+#endif
diff --git a/mosca/libmosca/hdrl_combine.c b/mosca/libmosca/hdrl_combine.c
new file mode 100644
index 0000000..f910321
--- /dev/null
+++ b/mosca/libmosca/hdrl_combine.c
@@ -0,0 +1,189 @@
+/* $Id: hdrl_combine.c,v 1.3 2013-10-16 11:31:02 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:02 $
+ * $Revision: 1.3 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+-----------------------------------------------------------------------------*/
+
+#include "hdrl_combine.h"
+#include "hdrl_iter.h"
+#include "hdrl_utils.h"
+#include "hdrl_sigclip.h"
+#include <cpl.h>
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+/*-----------------------------------------------------------------------------
+                                   Static
+ -----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @defgroup hdrl_combine   COMBINE Module
+
+  This module allows the combination of imagelists with error propagation.
+  If input images size is large the user should use hdrl_imagelist_combine_it()
+  for efficient RAM usage. Else can be used hdrl_imagelist_combine()
+ */
+/*----------------------------------------------------------------------------*/
+
+/**@{*/
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief combine imagelist with error propagation
+ *
+ * @param data     input data imagelist
+ * @param errors   input imagelist containing errors of data
+ * @param method   reduction method applied to the imagelists
+ * @param out      pointer to storage for a pointer to the allocated
+ *                 combined data image
+ * @param out      pointer to storage for a pointer to the allocated
+ *                 combined error image
+ * @param contrib  pointer to storage for a pointer to the allocated
+ *                 contribution map
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_imagelist_combine(const cpl_imagelist * data,
+                       const cpl_imagelist * errors,
+                       hdrl_collapse_imagelist_to_image_t * method,
+                       cpl_image ** out,
+                       cpl_image ** err,
+                       cpl_image ** contrib)
+{
+    cpl_ensure_code(data && errors, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(out && err && contrib, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(cpl_imagelist_get_size(data) > 0, CPL_ERROR_ILLEGAL_INPUT);
+    cpl_ensure_code(cpl_imagelist_get_size(data) ==
+                    cpl_imagelist_get_size(errors), CPL_ERROR_ILLEGAL_INPUT);
+
+    hdrl_collapse_imagelist_to_image_call(method, data, errors,
+                                        out, err, contrib);
+
+    return cpl_error_get_code();
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief combine imagelist provided by iterators with error propagation
+ *
+ * @param imgit   input iterator providing the images in an imagelist,
+ *                the images may be slices of the full dataset
+ * @param errit   input iterator providing the errorimages in an imagelist,
+ *                the images may be slices of the full dataset
+ * @param method  reduction method applied to the imagelist slices
+ * @param oimgit  output iterator providing buffers to store the combined
+ *                double image, buffers must have the same size as the images
+ *                in the input imagelist iterator
+ * @param oerrit  output iterator providing buffers to store the combined double
+ *                error image, buffers must have the same size as images in the
+ *                input imagelist iterator
+ * @param ocontribit  output iterator providing buffers to store the combined
+ *                    integer contribution maps, buffers must have the same
+ *                    size as the images in the input imagelist
+ *
+ * @return cpl_error_code
+ * @see hdrl_imagelist_combine
+ *
+ * This function should only be used if the input is already provided in form
+ * of a suiteable drl iterator or the input data does not fit into memory. If
+ * this is not the case hdrl_imagelist_combine should be used.
+ *
+ * The input iterators must have following properties:
+ * HDRL_ITER_INPUT | HDRL_ITER_IMAGELIST
+ *
+ * The output iterators must have the following properties:
+ * HDRL_ITER_OUTPUT | HDRL_ITER_IMAGE
+ *
+ * This combination variant cannot provide extra output the reduction method
+ * may provide, if it is needed loop on the iterators manually and call
+ * hdrl_imagelist_combine
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_imagelist_combine_it(hdrl_iter_t * imgit,
+                         hdrl_iter_t * errit,
+                         hdrl_collapse_imagelist_to_image_t * method,
+                         hdrl_iter_t * oimgit,
+                         hdrl_iter_t * oerrit,
+                         hdrl_iter_t * ocontribit)
+{
+    cpl_ensure_code(hdrl_iter_check(imgit, HDRL_ITER_INPUT | HDRL_ITER_IMAGELIST),
+                    CPL_ERROR_ILLEGAL_INPUT);
+    cpl_ensure_code(hdrl_iter_check(errit, HDRL_ITER_INPUT | HDRL_ITER_IMAGELIST),
+                    CPL_ERROR_ILLEGAL_INPUT);
+    cpl_ensure_code(hdrl_iter_check(oimgit, HDRL_ITER_OUTPUT | HDRL_ITER_IMAGE),
+                    CPL_ERROR_ILLEGAL_OUTPUT);
+    cpl_ensure_code(hdrl_iter_check(oerrit, HDRL_ITER_OUTPUT | HDRL_ITER_IMAGE),
+                    CPL_ERROR_ILLEGAL_OUTPUT);
+    cpl_ensure_code(hdrl_iter_check(ocontribit, HDRL_ITER_OUTPUT |
+                                   HDRL_ITER_IMAGE), CPL_ERROR_ILLEGAL_OUTPUT);
+
+    /* iteration cannot provide this information */
+    hdrl_collapse_imagelist_to_image_disable_extra_out(method);
+    for (cpl_imagelist * imgsl = hdrl_iter_next(imgit),
+         * errsl = hdrl_iter_next(errit);
+         imgsl != NULL && errsl != NULL;
+         imgsl = hdrl_iter_next(imgit),
+         errsl = hdrl_iter_next(errit)) {
+
+        cpl_image * out, * err, * contrib;
+        cpl_image * rout = hdrl_iter_next(oimgit);
+        cpl_image * rerr = hdrl_iter_next(oerrit);
+        cpl_image * rcontrib = hdrl_iter_next(ocontribit);
+        hdrl_collapse_imagelist_to_image_call(method, imgsl, errsl,
+                                            &out, &err, &contrib);
+        if (cpl_image_get_size_x(out) != cpl_image_get_size_x(rout) ||
+            cpl_image_get_size_y(out) != cpl_image_get_size_y(rout)) {
+            cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
+                                  "Output iterator buffer does not have "
+                                  "expected size");
+        }
+        cpl_image_copy(rout, out, 1, 1);
+        cpl_image_copy(rerr, err, 1, 1);
+        cpl_image_copy(rcontrib, contrib, 1, 1);
+
+        cpl_image_delete(out);
+        cpl_image_delete(err);
+        cpl_image_delete(contrib);
+        cpl_imagelist_delete(imgsl);
+        cpl_imagelist_delete(errsl);
+        if (cpl_error_get_code())
+            break;
+    }
+
+    return cpl_error_get_code();
+}
+
+/**@}*/
diff --git a/mosca/libmosca/hdrl_combine.h b/mosca/libmosca/hdrl_combine.h
new file mode 100644
index 0000000..d09c39f
--- /dev/null
+++ b/mosca/libmosca/hdrl_combine.h
@@ -0,0 +1,69 @@
+/* $Id: hdrl_combine.h,v 1.3 2013-10-16 16:52:20 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.3 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_COMBINE_H
+#define HDRL_COMBINE_H
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_iter.h"
+#include "hdrl_collapse.h"
+#include <cpl.h>
+
+/*-----------------------------------------------------------------------------
+                                Define
+ -----------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------
+                            Functions prototypes
+ -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+cpl_error_code
+hdrl_imagelist_combine(const cpl_imagelist * data, const cpl_imagelist * errors,
+                      hdrl_collapse_imagelist_to_image_t * method,
+                      cpl_image ** out, cpl_image ** err, cpl_image ** contrib);
+
+cpl_error_code
+hdrl_imagelist_combine_it(hdrl_iter_t * imgit,
+                         hdrl_iter_t * errit,
+                         hdrl_collapse_imagelist_to_image_t * method,
+                         hdrl_iter_t * oimgit,
+                         hdrl_iter_t * oerrit,
+                         hdrl_iter_t * ocontribit);
+CPL_END_DECLS
+
+/*-----------------------------------------------------------------------------
+             Private declarations - must not be used outside of hdrl
+ -----------------------------------------------------------------------------*/
+
+#ifdef HDRL_USE_PRIVATE
+
+#endif
+
+#endif
diff --git a/mosca/libmosca/hdrl_elemop.c b/mosca/libmosca/hdrl_elemop.c
new file mode 100644
index 0000000..f84cbe6
--- /dev/null
+++ b/mosca/libmosca/hdrl_elemop.c
@@ -0,0 +1,671 @@
+/* $Id: hdrl_elemop.c,v 1.1 2013-10-16 11:31:02 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:02 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_utils.h"
+
+#include <cpl.h>
+#include <math.h>
+
+#ifndef SQR
+#define SQR(a) ((a) * (a))
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Functions
+ -----------------------------------------------------------------------------*/
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief add two arrays of with error propagation in place
+ *
+ * @param a   array of values of size na
+ * @param ea  array of errors of a
+ * @param na  size of a arrays
+ * @param b   array of values of size nb
+ * @param eb  array of errors of b
+ * @param nb  size of b array, must be equal to na or 1
+ * @param mask  bad pixel mask, positions where it is true are not modified
+ *
+ * a = a + b
+ * e = hypot(ea, eb)
+ * error propagation of first order, correlations not considered
+ * except for the a === b case (correlation = 1)
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_elemop_add(double * a, double * ea, size_t na,
+                               const double * b, const double * eb, size_t nb,
+                               const cpl_binary * mask)
+{
+    if (a == b && ea == eb) {
+        for (size_t i = 0; i < na; i++) {
+            if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                a[i] += a[i];
+                ea[i] *= 2;
+            }
+        }
+    }
+    else {
+        cpl_ensure_code(na == nb || nb == 1, CPL_ERROR_ILLEGAL_INPUT);
+
+        if (nb == 1) {
+            for (size_t i = 0; i < na; i++) {
+                if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                    a[i] += b[0];
+                    ea[i] = hypot(ea[i], eb[0]);
+                }
+            }
+        }
+        else {
+            for (size_t i = 0; i < na; i++) {
+                if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                    a[i] += b[i];
+                    ea[i] = hypot(ea[i], eb[i]);
+                }
+            }
+        }
+    }
+
+    return CPL_ERROR_NONE;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief subtract two arrays of with error propagation in place
+ *
+ * @param a   array of values of size na
+ * @param ea  array of errors of a
+ * @param na  size of a arrays
+ * @param b   array of values of size nb
+ * @param eb  array of errors of b
+ * @param nb  size of b array, must be equal to na or 1
+ * @param mask  bad pixel mask, positions where it is true are not modified
+ *
+ * a = a - b
+ * e = hypot(ea, eb)
+ * error propagation of first order, correlations not considered
+ * except for the a === b case (correlation = 1)
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_elemop_sub(double * a, double * ea, size_t na,
+                               const double * b, const double * eb, size_t nb,
+                               const cpl_binary * mask)
+{
+    if (a == b && ea == eb) {
+        for (size_t i = 0; i < na; i++) {
+            if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                a[i] = 0.;
+                ea[i] = 0.;
+            }
+        }
+    }
+    else {
+        cpl_ensure_code(na == nb || nb == 1, CPL_ERROR_ILLEGAL_INPUT);
+
+        if (nb == 1) {
+            for (size_t i = 0; i < na; i++) {
+                if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                    a[i] -= b[0];
+                    ea[i] = hypot(ea[i], eb[0]);
+                }
+            }
+        }
+        else {
+            for (size_t i = 0; i < na; i++) {
+                if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                    a[i] -= b[i];
+                    ea[i] = hypot(ea[i], eb[i]);
+                }
+            }
+        }
+    }
+
+    return CPL_ERROR_NONE;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief multiply two arrays of with error propagation in place
+ *
+ * @param a   array of values of size na
+ * @param ea  array of errors of a
+ * @param na  size of a arrays
+ * @param b   array of values of size nb
+ * @param eb  array of errors of b
+ * @param nb  size of b array, must be equal to na or 1
+ * @param mask  bad pixel mask, positions where it is true are not modified
+ *
+ * a = a * b
+ * e = hypot(a * eb, b * ea)
+ * error propagation of first order, correlations not considered
+ * except for the a === b case (correlation = 1)
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_elemop_mul(double * a, double * ea, size_t na,
+                               const double * b, const double * eb, size_t nb,
+                               const cpl_binary * mask)
+{
+    if (a == b && ea == eb) {
+        for (size_t i = 0; i < na; i++) {
+            if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                const double a_ = a[i] * a[i];
+                ea[i] = 2* a[i] * ea[i];
+                a[i] = a_;
+            }
+        }
+    }
+    else {
+        cpl_ensure_code(na == nb || nb == 1, CPL_ERROR_ILLEGAL_INPUT);
+
+        if (nb == 1) {
+            const double b0 = b[0];
+            const double eb0 = eb[0];
+            for (size_t i = 0; i < na; i++) {
+                if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                    const double a_ = a[i] * b0;
+                    ea[i] = hypot(eb0 * a[i], ea[i] * b0);
+                    a[i] = a_;
+                }
+            }
+        }
+        else {
+            for (size_t i = 0; i < na; i++) {
+                if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                    const double a_ = a[i] * b[i];
+                    ea[i] = hypot(eb[i] * a[i], ea[i] * b[i]);
+                    a[i] = a_;
+                }
+            }
+        }
+    }
+
+    return CPL_ERROR_NONE;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief divide two arrays of with error propagation in place
+ *
+ * @param a   array of values of size na
+ * @param ea  array of errors of a
+ * @param na  size of a arrays
+ * @param b   array of values of size nb
+ * @param eb  array of errors of b
+ * @param nb  size of b array, must be equal to na or 1
+ * @param mask  bad pixel mask, positions where it is true are not modified
+ *
+ * a = a / b
+ * e = hypot(ea / b, eb * a / (b * b))
+ * error propagation of first order, correlations not considered
+ * except for the a === b case (correlation = 1)
+ *
+ * unlike cpl_image_divide pixels which are divided by zero are set to NAN and
+ * not marked as bad.
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_elemop_div(double * a, double * ea, size_t na,
+                               const double * b, const double * eb, size_t nb,
+                               const cpl_binary * mask)
+{
+    if (a == b && ea == eb) {
+        for (size_t i = 0; i < na; i++) {
+            if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                ea[i] = 0.;
+                a[i] = 1.;
+            }
+        }
+    }
+    else {
+        cpl_ensure_code(na == nb || nb == 1, CPL_ERROR_ILLEGAL_INPUT);
+
+        if (nb == 1) {
+            const double rb0 = 1. / b[0];
+            const double eb0 = eb[0];
+            for (size_t i = 0; i < na; i++) {
+                if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                    const double a_ = a[i] * rb0;
+                    /* sqrt((ea / b)^2 + (eb * a / b^2)^2) */
+                    ea[i] = sqrt(SQR(ea[i] * rb0) +
+                                 SQR(eb0 * a_ * rb0));
+                    a[i] = a_;
+                }
+            }
+        }
+        else {
+            for (size_t i = 0; i < na; i++) {
+                if (mask == NULL || mask[i] == CPL_BINARY_0) {
+                    const double rb = 1. / b[i];
+                    const double a_ = a[i] * rb;
+                    /* sqrt((ea / b)^2 + (eb * a / b^2)^2) */
+                    ea[i] = sqrt(SQR(ea[i] * rb) +
+                                 SQR(eb[i] * a_ * rb));
+                    a[i] = a_;
+                }
+            }
+        }
+    }
+
+    return CPL_ERROR_NONE;
+}
+
+
+typedef cpl_error_code (hdrl_math_op_f)(
+                                        double * a, double * ea, size_t na,
+                                        const double * b, const double * eb, size_t nb,
+                                        const cpl_binary * mask);
+
+typedef cpl_error_code (hdrl_math_op_image_f)(
+                                              cpl_image * a, cpl_image * ae,
+                                              const cpl_image * b, const cpl_image * be);
+
+typedef cpl_error_code (hdrl_math_op_image_scalar_f)(
+                                                     cpl_image * a, cpl_image * ae,
+                                                     const double b, const double be);
+
+static cpl_error_code
+check_input(cpl_image * a, cpl_image * ae,
+            const cpl_image * b, const cpl_image * be)
+{
+    cpl_ensure_code(a, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(ae, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(b, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(be, CPL_ERROR_NULL_INPUT);
+
+    cpl_ensure_code(cpl_image_get_size_x(a) == cpl_image_get_size_x(ae),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_size_y(a) == cpl_image_get_size_y(ae),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_size_x(b) == cpl_image_get_size_x(be),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_size_y(b) == cpl_image_get_size_y(be),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_size_x(a) == cpl_image_get_size_x(b),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_size_y(a) == cpl_image_get_size_y(b),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_type(a) == CPL_TYPE_DOUBLE,
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_type(ae) == CPL_TYPE_DOUBLE,
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_type(b) == CPL_TYPE_DOUBLE,
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_type(be) == CPL_TYPE_DOUBLE,
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+
+    return CPL_ERROR_NONE;
+}
+
+
+static cpl_error_code
+hdrl_elemop_image_scalar(cpl_image * a, cpl_image * ae,
+                         const double b, const double be,
+                         hdrl_math_op_f * f)
+{
+    const cpl_binary * dmask = NULL;
+    cpl_ensure_code(a, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(ae, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(cpl_image_get_type(a) == CPL_TYPE_DOUBLE,
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_type(ae) == CPL_TYPE_DOUBLE,
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    const cpl_mask * bpm = cpl_image_get_bpm_const(a);
+
+    if (bpm != NULL) {
+        dmask = cpl_mask_get_data_const(bpm);
+    }
+
+    if (f == hdrl_elemop_div && b == 0.) {
+        cpl_msg_warning(cpl_func, "dividing image by scalar zero");
+        cpl_image_add_scalar(a, NAN);
+        cpl_image_add_scalar(ae, NAN);
+        cpl_image_reject_value(a, CPL_VALUE_NAN);
+        cpl_image_reject_value(ae, CPL_VALUE_NAN);
+        return cpl_error_get_code();
+    }
+    else {
+        return f(cpl_image_get_data_double(a),
+                 cpl_image_get_data_double(ae),
+                 hdrl_get_image_npix(a),
+                 &b, &be, 1,
+                 dmask);
+    }
+}
+
+/* doxygen in header */
+cpl_error_code
+hdrl_elemop_image_add_scalar(cpl_image * a, cpl_image * ae,
+                             const double b, const double be)
+{
+    return hdrl_elemop_image_scalar(a, ae, b, be, hdrl_elemop_add);
+}
+
+cpl_error_code
+hdrl_elemop_image_sub_scalar(cpl_image * a, cpl_image * ae,
+                             const double b, const double be)
+{
+    return hdrl_elemop_image_scalar(a, ae, b, be, hdrl_elemop_sub);
+}
+
+cpl_error_code
+hdrl_elemop_image_mul_scalar(cpl_image * a, cpl_image * ae,
+                             const double b, const double be)
+{
+    return hdrl_elemop_image_scalar(a, ae, b, be, hdrl_elemop_mul);
+}
+
+cpl_error_code
+hdrl_elemop_image_div_scalar(cpl_image * a, cpl_image * ae,
+                             const double b, const double be)
+{
+    return hdrl_elemop_image_scalar(a, ae, b, be, hdrl_elemop_div);
+}
+
+static cpl_error_code
+hdrl_elemop_image(cpl_image * a, cpl_image * ae,
+                  const cpl_image * b, const cpl_image * be,
+                  hdrl_math_op_f * f)
+{
+    cpl_error_code r = check_input(a, ae, b, be);
+    const cpl_binary * dmask = NULL;
+    cpl_ensure_code(r == CPL_ERROR_NONE, r);
+    const cpl_mask * bbpm = cpl_image_get_bpm_const(b);
+
+    if (bbpm != NULL) {
+        if (cpl_image_get_bpm_const(a)) {
+            /* a and b have bpm, merge them */
+            cpl_mask * abpm = cpl_image_get_bpm(a);
+            cpl_mask_or(abpm, bbpm);
+            dmask = cpl_mask_get_data_const(abpm);
+        }
+        else {
+            /* a has no bpm, copy from b */
+            cpl_image_reject_from_mask(a, bbpm);
+            dmask = cpl_mask_get_data_const(bbpm);
+        }
+    }
+    else {
+        const cpl_mask * abpm = cpl_image_get_bpm_const(a);
+        if (abpm) {
+            dmask = cpl_mask_get_data_const(abpm);
+        }
+    }
+
+    r = f(cpl_image_get_data_double(a),
+          cpl_image_get_data_double(ae),
+          hdrl_get_image_npix(a),
+          cpl_image_get_data_double_const(b),
+          cpl_image_get_data_double_const(be),
+          hdrl_get_image_npix(a),
+          dmask);
+
+    if (f == hdrl_elemop_div) {
+        cpl_image_reject_value(a, CPL_VALUE_NAN);
+        cpl_image_reject_from_mask(ae, cpl_image_get_bpm(a));
+    }
+
+    return r;
+}
+
+cpl_error_code
+hdrl_elemop_image_add_image(cpl_image * a, cpl_image * ae,
+                      const cpl_image * b, const cpl_image * be)
+{
+    return hdrl_elemop_image(a, ae, b, be, hdrl_elemop_add);
+}
+
+cpl_error_code
+hdrl_elemop_image_sub_image(cpl_image * a, cpl_image * ae,
+                      const cpl_image * b, const cpl_image * be)
+{
+    return hdrl_elemop_image(a, ae, b, be, hdrl_elemop_sub);
+}
+
+cpl_error_code
+hdrl_elemop_image_mul_image(cpl_image * a, cpl_image * ae,
+                      const cpl_image * b, const cpl_image * be)
+{
+    return hdrl_elemop_image(a, ae, b, be, hdrl_elemop_mul);
+}
+
+cpl_error_code
+hdrl_elemop_image_div_image(cpl_image * a, cpl_image * ae,
+                      const cpl_image * b, const cpl_image * be)
+{
+    return hdrl_elemop_image(a, ae, b, be, hdrl_elemop_div);
+}
+
+static cpl_error_code
+hdrl_elemop_imagelist_vector(cpl_imagelist * self_d,
+                             cpl_imagelist * self_e,
+                             const cpl_vector * other_d,
+                             const cpl_vector * other_e,
+                             hdrl_math_op_image_scalar_f * f)
+{
+    cpl_ensure_code(self_d, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(self_e, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other_d, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other_e, CPL_ERROR_NULL_INPUT);
+    const size_t nz = cpl_imagelist_get_size(self_d);
+    cpl_ensure_code(nz == (size_t)cpl_imagelist_get_size(self_e),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(nz == (size_t)cpl_vector_get_size(other_d),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(nz == (size_t)cpl_vector_get_size(other_e),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+
+    for (size_t i = 0; i < nz; i++) {
+        cpl_image * ad = cpl_imagelist_get(self_d, i);
+        cpl_image * ae = cpl_imagelist_get(self_e, i);
+        const double bd = cpl_vector_get(other_d, i);
+        const double be = cpl_vector_get(other_e, i);
+        f(ad, ae, bd, be);
+    }
+
+    return cpl_error_get_code();
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_add_vector(cpl_imagelist * self_d,
+                                 cpl_imagelist * self_e,
+                                 const cpl_vector * other_d,
+                                 const cpl_vector * other_e)
+{
+    return hdrl_elemop_imagelist_vector(self_d, self_e, other_d, other_e,
+                                        hdrl_elemop_image_add_scalar);
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_sub_vector(cpl_imagelist * self_d,
+                                 cpl_imagelist * self_e,
+                                 const cpl_vector * other_d,
+                                 const cpl_vector * other_e)
+{
+    return hdrl_elemop_imagelist_vector(self_d, self_e, other_d, other_e,
+                                        hdrl_elemop_image_sub_scalar);
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_mul_vector(cpl_imagelist * self_d,
+                                 cpl_imagelist * self_e,
+                                 const cpl_vector * other_d,
+                                 const cpl_vector * other_e)
+{
+    return hdrl_elemop_imagelist_vector(self_d, self_e, other_d, other_e,
+                                        hdrl_elemop_image_mul_scalar);
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_div_vector(cpl_imagelist * self_d,
+                                 cpl_imagelist * self_e,
+                                 const cpl_vector * other_d,
+                                 const cpl_vector * other_e)
+{
+    return hdrl_elemop_imagelist_vector(self_d, self_e, other_d, other_e,
+                                        hdrl_elemop_image_div_scalar);
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_image(cpl_imagelist * self_d,
+                            cpl_imagelist * self_e,
+                            const cpl_image * other_d,
+                            const cpl_image * other_e,
+                            hdrl_math_op_image_f * f)
+{
+    cpl_ensure_code(self_d, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(self_e, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other_d, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other_e, CPL_ERROR_NULL_INPUT);
+    const size_t nz = cpl_imagelist_get_size(self_d);
+    cpl_ensure_code(nz == (size_t)cpl_imagelist_get_size(self_e),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+
+    for (size_t i = 0; i < nz; i++) {
+        cpl_image * ad = cpl_imagelist_get(self_d, i);
+        cpl_image * ae = cpl_imagelist_get(self_e, i);
+        f(ad, ae, other_d, other_e);
+    }
+
+    return cpl_error_get_code();
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_add_image(cpl_imagelist * self_d,
+                                cpl_imagelist * self_e,
+                                const cpl_image * other_d,
+                                const cpl_image * other_e)
+{
+    return hdrl_elemop_imagelist_image(self_d, self_e, other_d, other_e,
+                                       hdrl_elemop_image_add_image);
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_sub_image(cpl_imagelist * self_d,
+                                cpl_imagelist * self_e,
+                                const cpl_image * other_d,
+                                const cpl_image * other_e)
+{
+    return hdrl_elemop_imagelist_image(self_d, self_e, other_d, other_e,
+                                       hdrl_elemop_image_sub_image);
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_mul_image(cpl_imagelist * self_d,
+                                cpl_imagelist * self_e,
+                                const cpl_image * other_d,
+                                const cpl_image * other_e)
+{
+    return hdrl_elemop_imagelist_image(self_d, self_e, other_d, other_e,
+                                       hdrl_elemop_image_mul_image);
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_div_image(cpl_imagelist * self_d,
+                                cpl_imagelist * self_e,
+                                const cpl_image * other_d,
+                                const cpl_image * other_e)
+{
+    return hdrl_elemop_imagelist_image(self_d, self_e, other_d, other_e,
+                                       hdrl_elemop_image_div_image);
+}
+
+static cpl_error_code
+hdrl_elemop_imagelist(cpl_imagelist * self_d,
+                      cpl_imagelist * self_e,
+                      const cpl_imagelist * other_d,
+                      const cpl_imagelist * other_e,
+                      hdrl_math_op_image_f * f)
+{
+    cpl_ensure_code(self_d, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other_d, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(self_e, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other_e, CPL_ERROR_NULL_INPUT);
+    const size_t nz = cpl_imagelist_get_size(self_d);
+    cpl_ensure_code(nz == (size_t)cpl_imagelist_get_size(self_e),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(nz == (size_t)cpl_imagelist_get_size(other_d),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(nz == (size_t)cpl_imagelist_get_size(other_e),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+
+    for (size_t i = 0; i < nz; i++) {
+        cpl_image * ad = cpl_imagelist_get(self_d, i);
+        cpl_image * ae = cpl_imagelist_get(self_e, i);
+        const cpl_image * bd = cpl_imagelist_get_const(other_d, i);
+        const cpl_image * be = cpl_imagelist_get_const(other_e, i);
+        f(ad, ae, bd, be);
+    }
+
+    return cpl_error_get_code();
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_add_imagelist(cpl_imagelist * self_d,
+                                    cpl_imagelist * self_e,
+                                    const cpl_imagelist * other_d,
+                                    const cpl_imagelist * other_e)
+{
+    return hdrl_elemop_imagelist(self_d, self_e, other_d, other_e,
+                                 hdrl_elemop_image_add_image);
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_sub_imagelist(cpl_imagelist * self_d,
+                                    cpl_imagelist * self_e,
+                                    const cpl_imagelist * other_d,
+                                    const cpl_imagelist * other_e)
+{
+    return hdrl_elemop_imagelist(self_d, self_e, other_d, other_e,
+                                 hdrl_elemop_image_sub_image);
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_mul_imagelist(cpl_imagelist * self_d,
+                                    cpl_imagelist * self_e,
+                                    const cpl_imagelist * other_d,
+                                    const cpl_imagelist * other_e)
+{
+    return hdrl_elemop_imagelist(self_d, self_e, other_d, other_e,
+                                 hdrl_elemop_image_mul_image);
+}
+
+cpl_error_code
+hdrl_elemop_imagelist_div_imagelist(cpl_imagelist * self_d,
+                                    cpl_imagelist * self_e,
+                                    const cpl_imagelist * other_d,
+                                    const cpl_imagelist * other_e)
+{
+    return hdrl_elemop_imagelist(self_d, self_e, other_d, other_e,
+                                 hdrl_elemop_image_div_image);
+}
diff --git a/mosca/libmosca/hdrl_elemop.h b/mosca/libmosca/hdrl_elemop.h
new file mode 100644
index 0000000..5cf50bd
--- /dev/null
+++ b/mosca/libmosca/hdrl_elemop.h
@@ -0,0 +1,207 @@
+/* $Id: hdrl_elemop.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_ELEMOP_H
+#define HDRL_ELEMOP_H
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include <cpl.h>
+
+/*-----------------------------------------------------------------------------
+                                Define
+ -----------------------------------------------------------------------------*/
+
+
+/*-----------------------------------------------------------------------------
+                            Functions prototypes
+ -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief add/subtract/multiply/divide two images with error propagation
+ *
+ * @param a   image, modified in place
+ * @param ae  errors of image a, modified in place
+ * @param b   image
+ * @param be  errors of image b
+ *
+ * Gaussian error propagation of first order, no accounting correlation
+ * besides a == b.
+ * Divisions by zero will be marked as bad pixels and set to NAN
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_elemop_image_add_image(cpl_image * a, cpl_image * ae,
+                            const cpl_image * b, const cpl_image * be);
+cpl_error_code
+hdrl_elemop_image_sub_image(cpl_image * a, cpl_image * ae,
+                            const cpl_image * b, const cpl_image * be);
+cpl_error_code
+hdrl_elemop_image_mul_image(cpl_image * a, cpl_image * ae,
+                            const cpl_image * b, const cpl_image * be);
+cpl_error_code
+hdrl_elemop_image_div_image(cpl_image * a, cpl_image * ae,
+                            const cpl_image * b, const cpl_image * be);
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief add/subtract/multiply/divide image and scalar with error propagation
+ *
+ * @param a   image, modified in place
+ * @param ae  errors of image a, modified in place
+ * @param b   scalar
+ * @param be  error of scalar b
+ *
+ * Gaussian error propagation of first order, no accounting correlation
+ * besides a == b.
+ * Divisions by zero will be marked as bad pixels and set to NAN
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_elemop_image_add_scalar(cpl_image * a, cpl_image * ae,
+                          const double b, const double be);
+cpl_error_code
+hdrl_elemop_image_sub_scalar(cpl_image * a, cpl_image * ae,
+                          const double b, const double be);
+cpl_error_code
+hdrl_elemop_image_mul_scalar(cpl_image * a, cpl_image * ae,
+                          const double b, const double be);
+cpl_error_code
+hdrl_elemop_image_div_scalar(cpl_image * a, cpl_image * ae,
+                          const double b, const double be);
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief add/subtract/multiply/divide two imagelists and scalar with error
+ *        propagation
+ *
+ * @param a   imagelist, modified in place
+ * @param ae  errors of imagelist a, modified in place
+ * @param b   imagelist
+ * @param be  error of imagelist b
+ *
+ * Gaussian error propagation of first order, no accounting correlation
+ * besides a == b.
+ * Divisions by zero will be marked as bad pixels and set to NAN
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_elemop_imagelist_add_imagelist(cpl_imagelist * a, cpl_imagelist * ae,
+                   const cpl_imagelist * b, const cpl_imagelist * be);
+cpl_error_code
+hdrl_elemop_imagelist_sub_imagelist(cpl_imagelist * a, cpl_imagelist * ae,
+                   const cpl_imagelist * b, const cpl_imagelist * be);
+cpl_error_code
+hdrl_elemop_imagelist_mul_imagelist(cpl_imagelist * a, cpl_imagelist * ae,
+                   const cpl_imagelist * b, const cpl_imagelist * be);
+cpl_error_code
+hdrl_elemop_imagelist_div_imagelist(cpl_imagelist * a, cpl_imagelist * ae,
+                   const cpl_imagelist * b, const cpl_imagelist * be);
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief add/subtract/multiply/divide each image of an imagelist and a
+ *        scalar from a vector with error propagation
+ *
+ * @param a   imagelist, modified in place
+ * @param ae  errors of imagelist a, modified in place
+ * @param b   vector
+ * @param be  error of vector b
+ *
+ * Gaussian error propagation of first order, no accounting correlation
+ * besides a == b.
+ * Divisions by zero will be marked as bad pixels and set to NAN
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_elemop_imagelist_add_vector(cpl_imagelist * a, cpl_imagelist * ae,
+                              const cpl_vector * b, const cpl_vector * be);
+cpl_error_code
+hdrl_elemop_imagelist_sub_vector(cpl_imagelist * a, cpl_imagelist * ae,
+                              const cpl_vector * b, const cpl_vector * be);
+cpl_error_code
+hdrl_elemop_imagelist_mul_vector(cpl_imagelist * a, cpl_imagelist * ae,
+                              const cpl_vector * b, const cpl_vector * be);
+cpl_error_code
+hdrl_elemop_imagelist_div_vector(cpl_imagelist * a, cpl_imagelist * ae,
+                              const cpl_vector * b, const cpl_vector * be);
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief add/subtract/multiply/divide each image of an imagelist and an image
+ *        with error propagation
+ *
+ * @param a   imagelist, modified in place
+ * @param ae  errors of imagelist a, modified in place
+ * @param b   image
+ * @param be  error of image b
+ *
+ * Gaussian error propagation of first order, no accounting correlation
+ * besides a == b.
+ * Divisions by zero will be marked as bad pixels and set to NAN
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_elemop_imagelist_add_image(cpl_imagelist * a, cpl_imagelist * ae,
+                             const cpl_image * b, const cpl_image * be);
+cpl_error_code
+hdrl_elemop_imagelist_sub_image(cpl_imagelist * a, cpl_imagelist * ae,
+                             const cpl_image * b, const cpl_image * be);
+cpl_error_code
+hdrl_elemop_imagelist_mul_image(cpl_imagelist * a, cpl_imagelist * ae,
+                             const cpl_image * b, const cpl_image * be);
+cpl_error_code
+hdrl_elemop_imagelist_div_image(cpl_imagelist * a, cpl_imagelist * ae,
+                             const cpl_image * b, const cpl_image * be);
+
+/* see hdrl_elemop.c for doc strings */
+cpl_error_code hdrl_elemop_add(double * a, double * ea, size_t na,
+                            const double * b, const double * eb, size_t nb,
+                            const cpl_binary * mask);
+cpl_error_code hdrl_elemop_sub(double * a, double * ea, size_t na,
+                            const double * b, const double * eb, size_t nb,
+                            const cpl_binary * mask);
+cpl_error_code hdrl_elemop_mul(double * a, double * ea, size_t na,
+                            const double * b, const double * eb, size_t nb,
+                            const cpl_binary * mask);
+cpl_error_code hdrl_elemop_div(double * a, double * ea, size_t na,
+                            const double * b, const double * eb, size_t nb,
+                            const cpl_binary * mask);
+/*-----------------------------------------------------------------------------
+             Private declarations - must not be used outside of hdrl
+ -----------------------------------------------------------------------------*/
+CPL_END_DECLS
+
+#ifdef HDRL_USE_PRIVATE
+
+#endif
+
+#endif
diff --git a/mosca/libmosca/hdrl_flat.c b/mosca/libmosca/hdrl_flat.c
new file mode 100644
index 0000000..b1b2de2
--- /dev/null
+++ b/mosca/libmosca/hdrl_flat.c
@@ -0,0 +1,735 @@
+/* $Id: hdrl_flat.c,v 1.1 2013-10-16 11:31:03 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:03 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+-----------------------------------------------------------------------------*/
+
+#include "hdrl_flat.h"
+
+#include "hdrl_collapse.h"
+#include "hdrl_combine.h"
+#include "hdrl_elemop.h"
+#include "hdrl_prototyping.h"
+
+#include <cpl.h>
+
+#include <assert.h>
+
+/*-----------------------------------------------------------------------------
+                                   Static
+ -----------------------------------------------------------------------------*/
+
+typedef enum {
+    _HDRL_MEDIAN_SMOOTH,
+    _HDRL_GAUSS_SMOOTH,
+    _HDRL_MEDIAN_STEP_FIT
+} _hdrl_internal_method;
+
+static cpl_error_code hdrl_compute_flat(const cpl_imagelist *, 
+        const cpl_imagelist *, hdrl_collapse_imagelist_to_image_t *,
+        cpl_image *, cpl_image *, cpl_image **, cpl_image **, cpl_image **, 
+        _hdrl_internal_method, void *);
+static cpl_image * hdrl_medianclean_image(cpl_image *, cpl_size, cpl_size, 
+        cpl_size, cpl_size);
+static cpl_image * hdrldemo_smooth_image_median(const cpl_image *, int);
+static cpl_matrix * hdrl_matrix_linspace(cpl_size, cpl_size, cpl_size);
+static cpl_matrix * hdrl_fit_legendre(cpl_image *, int, int, cpl_matrix *,
+        cpl_matrix *, cpl_size, cpl_size) ;
+static cpl_image * hdrl_legendre_to_image(cpl_matrix *, int, int,
+        cpl_size, cpl_size);
+static cpl_image * hdrl_medianfilter_image_grid(cpl_image *, cpl_matrix *,
+        cpl_matrix *, cpl_size, cpl_size);
+
+/*----------------------------------------------------------------------------*/
+/**
+  @defgroup hdrl_flat   Flat Module
+  This module provides functionality to compute a master flat frame out of
+  several inputs. Several methods are available to deal with different flat
+  characteristics
+
+ */
+/*----------------------------------------------------------------------------*/
+
+/**@{*/
+
+typedef struct {
+    cpl_size filter_size;
+} _hdrl_median_smooth_par;
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief compute master flat with median filtering on exposure map
+ *
+ * @param data               input flats
+ * @param errs               input flats errors
+ * @param collapse_mode      method to collapse to master flat
+ * @param filter_size        size of median filter
+ * @param master_shape       optional initial master shape
+ * @param master_shape_err   optional initial master shape error
+ * @param flat_img           output flat
+ * @param flat_err           output flat error
+ * @param flat_ctr           output flat contribution map
+ *
+ * TODO describe algorithm (refer to called lower level function)
+ * iterative + median filter on exposure map (= flat / masterflat)
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_compute_flat_median_smooth(
+        const cpl_imagelist                 *   data,
+        const cpl_imagelist                 *   errs,
+        hdrl_collapse_imagelist_to_image_t  *   collapse_mode,
+        cpl_size                                filter_size,
+        cpl_image                           *   master_shape,
+        cpl_image                           *   master_shape_err,
+        cpl_image                           **  flat_img, 
+        cpl_image                           **  flat_err,
+        cpl_image                           **  flat_ctr)
+{
+    _hdrl_median_smooth_par par;
+    par.filter_size = filter_size;
+    return hdrl_compute_flat(data, errs, collapse_mode, master_shape,
+                             master_shape_err, flat_img, flat_err, flat_ctr,
+                             _HDRL_MEDIAN_SMOOTH, &par);
+}
+
+typedef struct {
+    cpl_size filter_size;
+    cpl_size mirror_x;
+    cpl_size mirror_y;
+} _hdrl_gauss_smooth_par;
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief compute master flat with Gauss smoothing on exposure map
+ *
+ * @param data               input flats
+ * @param errs               input flats errors
+ * @param collapse_mode      method to collapse to master flat
+ * @param filter_size        size of median filter
+ * @param mirror_x           implemented as FFT with mirroring
+ * @param mirror_y           implemented as FFT with mirroring
+ * @param master_shape       optional initial master shape
+ * @param master_shape_err   optional initial master shape error
+ * @param flat_img           output flat
+ * @param flat_err           output flat error
+ * @param flat_ctr           output flat contribution map
+ *
+ * TODO describe algorithm (refer to called lower level function)
+ * iterative + Gauss filter on exposure map (= flat / masterflat)
+ * implemented as FFT thus needs mirroring values
+ * should probably be implemented in normal space with decomposed Gauss instead
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_compute_flat_gauss_smooth(
+        const cpl_imagelist                 *   data,
+        const cpl_imagelist                 *   errs,
+        hdrl_collapse_imagelist_to_image_t  *   collapse_mode,
+        cpl_size                                filter_size,
+        cpl_size                                mirror_x,
+        cpl_size                                mirror_y,
+        cpl_image                           *   master_shape,
+        cpl_image                           *   master_shape_err,
+        cpl_image                           **  flat_img, 
+        cpl_image                           **  flat_err,
+        cpl_image                           **  flat_ctr)
+{
+    _hdrl_gauss_smooth_par par;
+    par.filter_size = filter_size;
+    par.mirror_x = mirror_x;
+    par.mirror_y = mirror_y;
+    return hdrl_compute_flat(data, errs, collapse_mode, master_shape,
+                             master_shape_err, flat_img, flat_err, flat_ctr,
+                             _HDRL_GAUSS_SMOOTH, &par);
+}
+
+typedef struct {
+    cpl_size    filter_size_x;
+    cpl_size    filter_size_y;
+    cpl_size    steps_x;
+    cpl_size    steps_y;
+    int         order_x;
+    int         order_y;
+} _hdrl_step_fit_par;
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief compute master flat with polynomial fit to exposure map
+ *
+ * @param data               input flats
+ * @param errs               input flats errors
+ * @param collapse_mode      method to collapse to master flat
+ * @param filter_size_x      size of median filter in x
+ * @param filter_size_y      size of median filter in y
+ * @param steps_x            number of steps in x to evaluate median on
+ * @param steps_y            number of steps in y to evaluate median on
+ * @param order_x            order of the polynomial in x
+ * @param order_y            order of the polynomial in y
+ * @param master_shape       optional initial master shape
+ * @param master_shape_err   optional initial master shape error
+ * @param flat_img           output flat
+ * @param flat_err           output flat error
+ * @param flat_ctr           output flat contribution map
+ *
+ * TODO describe algorithm (refer to called lower level function)
+ * iterative + strided median filter on exposure map (= flat / masterflat) +
+ * polyfit to filtered image
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_compute_flat_median_step_fit(
+        const cpl_imagelist                 *   data,
+        const cpl_imagelist                 *   errs,
+        hdrl_collapse_imagelist_to_image_t  *   collapse_mode,
+        cpl_size                                filter_size_x,
+        cpl_size                                filter_size_y,
+        cpl_size                                steps_x,
+        cpl_size                                steps_y,
+        int                                     order_x,
+        int                                     order_y,
+        cpl_image                           *   master_shape,
+        cpl_image                           *   master_shape_err,
+        cpl_image                           **  flat_img,
+        cpl_image                           **  flat_err,
+        cpl_image                           **  flat_ctr)
+{
+    _hdrl_step_fit_par par;
+    /* TODO: should we check that input have proper input values ? */
+    /* TODO: add proper comment, for example
+     * init par structure parameters
+     */
+    par.filter_size_x = filter_size_x;
+    par.filter_size_y = filter_size_y;
+    par.steps_x = steps_x;
+    par.steps_y = steps_y;
+    par.order_x = order_x;
+    par.order_y = order_y;
+    return hdrl_compute_flat(data, errs, collapse_mode, master_shape, 
+            master_shape_err, flat_img, flat_err, flat_ctr, 
+            _HDRL_MEDIAN_STEP_FIT, &par);
+}
+
+/**@}*/
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @internal
+ * @brief compute master flat
+ * @param data             bias and dark corrected image data
+ * @param errs             errors of data
+ * @param collapse_mode    method to collapse data to flag
+ * @param master_shape     shape where the single flats are bend towards
+ * @param master_shape_err error of the shape where each flat is bend towards
+ * @param flat_img         resulting flat
+ * @param flat_err         error of flat
+ * @param flat_ctr         contribution map of flat
+ * @param method           method switch to choose image smoothing algorithm
+ * @param par              image smoothing algorithm parameters
+ * 
+ * DONE (AMO): describe algorithm
+ *
+ * -check input frames are proper
+ *
+ * -before the final master frame is generate make sure each flat component
+ * has the same level and shape. In order to compute properly each flat level
+ * its shape need to be removed. As the shape information is contained in the
+ * master flat that is also a product of this data reduction step we need to
+ * perform iterations. The user may decide to provide an input shape (if
+ * available) or let the function to find one. In this last case a master flat
+ * is computed by simple mean-stack of each input frame (without error
+ * propagation, as the error information is actually needed only from the last
+ * iteration).
+ *
+ * For each iteration:
+ *
+ * -we divide each flat frame for the current master flat to remove the shape of
+ * the flat (at last iteration the division is performed with error propagation)
+ *
+ * -we compute the flat estimator (a single number) using one of the possible
+ * criteria (median-smooth over a rectangular box with interpolation of rejected
+ * pixels, median-step over a rectangular box with fit of a Legendre polynomial
+ * in each box, Gaussian smooth over rectangular box)
+ *
+ * Finally we divide each imagelist by the final master with variance
+ * propagation and combine them into the final master flat using any of the
+ * available methods(mean, weighted mean, median, sigma-clip)
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code hdrl_compute_flat(
+        const cpl_imagelist                 *   data, 
+        const cpl_imagelist                 *   errs,
+        hdrl_collapse_imagelist_to_image_t  *   collapse_mode,
+        cpl_image                           *   master_shape, 
+        cpl_image                           *   master_shape_err,
+        cpl_image                           **  flat_img, 
+        cpl_image                           **  flat_err,
+        cpl_image                           **  flat_ctr, 
+        _hdrl_internal_method                   method,
+        void                                *   par)
+{
+    cpl_image * comb_img = NULL;
+    cpl_image * comb_err = NULL;
+    cpl_image * comb_ctr = NULL;
+    /* TODO: should we check that input have proper input values ? */
+    /* TODO: quite long function implementation. Should we re-factor it */
+    /* TODO should the following niter_max a hard-coded variable?
+     * better a const or a define if not an algorithm parameter
+     */
+    size_t niter_max = 3;
+
+    /* TODO: check that the size of the master_shape and master_shape_err
+     * is the same as the size of the image in the imagelists*/
+
+    /* cannot be used when iterating */
+    /* TODO: why do we need to disable the extra out?
+     * Clarify this as it is not obvious
+     * */
+    hdrl_collapse_imagelist_to_image_disable_extra_out(collapse_mode);
+
+    cpl_msg_info(cpl_func, "Creating first Master Flat");
+    cpl_msg_indent_more();
+
+    /*If we pass a master-shape image to the function use this as
+     * first master flat*/
+    if (master_shape != NULL) {
+        comb_img = cpl_image_duplicate(master_shape);
+        /*If we pass a master-shape image to the function do only one
+         * iteration*/
+        niter_max = 1;
+        /* optional error of the shape */
+        if (master_shape_err != NULL) {
+            comb_err = cpl_image_duplicate(master_shape_err);
+        }
+    } else {
+        /* Generate 1st master flat */
+        /*No error propagation needed in the first iteration*/
+        cpl_imagelist * data_loc = cpl_imagelist_duplicate(data);
+        cpl_msg_info(cpl_func, "Scale all flats to unity by the mean");
+        cpl_imagelist_normalise(data_loc, CPL_NORM_MEAN);
+        cpl_msg_info(cpl_func, "Combining all scaled flats by the median");
+        comb_img = cpl_imagelist_collapse_median_create(data_loc);
+        cpl_imagelist_delete(data_loc);
+        comb_err = cpl_image_duplicate(comb_img);
+        cpl_image_multiply_scalar(comb_err, 0);
+    }
+    cpl_msg_indent_less();
+
+    cpl_msg_info(cpl_func, "Start iterative process");
+    cpl_msg_indent_more();
+    /* TODO: should we factor-out the following long loop ? May be not as it is
+     * de facto the full job of this function */
+    /* Here we perform several iterations to optimize the master flat shape */
+    for (size_t i = 0; i < niter_max; i++) {
+        cpl_msg_indent_less();
+        cpl_msg_info(cpl_func, "Iteration %zu out of %zu", i + 1, niter_max);
+        cpl_msg_indent_more();
+
+        /*Restore original flat-fields but use the new master-flat*/
+        cpl_msg_info(cpl_func, "Restore the original flatfields");
+        cpl_imagelist * imglist = cpl_imagelist_duplicate(data);
+        cpl_imagelist * errlist = cpl_imagelist_duplicate(errs);
+
+        /*Divide flat-fields through the masterflat -> esposure-time map*/
+        cpl_msg_info(cpl_func, "Divide single flatfields through the (new) "
+                        "masterflat to get an exposure-time map for each "
+                        "flatfield");
+        /* only propagate error of master flat in last iteration */
+        if (i == niter_max - 1) {
+            /* TODO: function name. Here we perform division of two imagelists
+             * with proper error (and bad pixel) propagation. This is done via
+             * auxilliary arrays. If we follow cpl naming convention may be
+             * better (clear but long) name is:
+             * hdrl_imagelist_divide_errorpropagate ?
+             */
+            hdrl_elemop_imagelist_div_image(imglist, errlist, comb_img, comb_err);
+        } else {
+            cpl_imagelist_divide_image(imglist, comb_img);
+        }
+
+        /*  delete old masterframe and compute the new master frame */
+        cpl_image_delete(comb_img);
+        cpl_image_delete(comb_err);
+        cpl_image_delete(comb_ctr);
+
+        /* smooth residuals  */
+        cpl_msg_info(cpl_func, "Smooth the exposure-time maps");
+
+        for(cpl_size j = 0; j < cpl_imagelist_get_size(imglist); j++){
+            cpl_msg_info(cpl_func, "working on image %d", (int)j+1);
+            cpl_image * imgtmp = cpl_imagelist_get(imglist, j);
+            cpl_image * r;
+            if (method == _HDRL_MEDIAN_SMOOTH) {
+                /* Method 1*/
+                /* removing bad pixels allows use of a much faster algorithm */
+                cpl_size fsize = ((_hdrl_median_smooth_par *)par)->filter_size;
+                cpl_detector_interpolate_rejected(imgtmp);
+                /* TODO: naming conventions. Should we name functions as
+                 * hdrl_object_operation_specifier or
+                 * hdrl_operation_object_specifier?
+                 */
+                r = hdrldemo_smooth_image_median(imgtmp, fsize);
+            } else if (method == _HDRL_GAUSS_SMOOTH) {
+                _hdrl_gauss_smooth_par * p = (_hdrl_gauss_smooth_par *)par;
+                /* TODO: naming convention should the function name contain the
+                 * object it operates on==>hdrl_image_get_spatial_freq()
+                 */
+                r = hdrl_get_spatial_freq(imgtmp, p->filter_size,
+                                          p->mirror_x, p->mirror_y);
+            } else if (method == _HDRL_MEDIAN_STEP_FIT) {
+                _hdrl_step_fit_par * p = (_hdrl_step_fit_par *)par;
+                cpl_size nx = cpl_image_get_size_x(imgtmp);
+                cpl_size ny = cpl_image_get_size_y(imgtmp);
+                cpl_size sx = CX_MAX(nx / p->steps_x, 1);
+                cpl_size sy = CX_MAX(ny / p->steps_y, 1);
+
+                /* fit to stepped grid */
+                cpl_matrix * x = hdrl_matrix_linspace(sx / 2, nx, sx);
+                cpl_matrix * y = hdrl_matrix_linspace(sy / 2, ny, sy);
+                cpl_image * imgtmp_mod =
+                    hdrl_medianfilter_image_grid(imgtmp, x, y,
+                                                 p->filter_size_x,
+                                                 p->filter_size_y);
+                cpl_matrix * coeffs = hdrl_fit_legendre(imgtmp_mod,
+                                                        p->order_x, p->order_y,
+                                                        x, y, nx, ny);
+                /* TODO: naming conventions: hdrl_matrix_legendre_to_image() */
+                r = hdrl_legendre_to_image(coeffs,
+                                           p->order_x, p->order_y,
+                                           nx, ny);
+
+                if (cpl_msg_get_level() == CPL_MSG_DEBUG)
+                    cpl_matrix_dump(coeffs, stdout);
+
+                cpl_matrix_delete(coeffs);
+                cpl_matrix_delete(x);
+                cpl_matrix_delete(y);
+                cpl_image_delete(imgtmp_mod);
+            } else {
+                abort();
+            }
+            cpl_imagelist_set(imglist, r, j);
+        }
+
+        cpl_msg_info(cpl_func, "Divide the original flatfields by the smoothed "
+                        "exposure-time map");
+
+        /* Divide flatfields through the smoothed exposure-time map*/
+        cpl_imagelist * div_imglist = cpl_imagelist_duplicate(data);
+        cpl_imagelist * div_errlist = cpl_imagelist_duplicate(errs);
+        hdrl_elemop_imagelist_div_imagelist(div_imglist, div_errlist,
+                                            imglist, errlist);
+        cpl_imagelist_delete(imglist);
+        cpl_imagelist_delete(errlist);
+
+        cpl_msg_info(cpl_func, "Combine the resulting normalized flatfields by "
+                        "your preferred algorithm and generate a new(!)"
+                        " masterflat");
+
+        hdrl_imagelist_combine(div_imglist, div_errlist, collapse_mode,
+                               &comb_img, &comb_err, &comb_ctr);
+
+        cpl_imagelist_delete(div_imglist);
+        cpl_imagelist_delete(div_errlist);
+
+        if (cpl_error_get_code()) break;
+    }
+
+    if (cpl_error_get_code()) {
+        cpl_image_delete(comb_img);
+        cpl_image_delete(comb_err);
+        cpl_image_delete(comb_ctr);
+    } else {
+        *flat_img = comb_img;
+        *flat_err = comb_err;
+        *flat_ctr = comb_ctr;
+    }
+
+    cpl_msg_indent_less();
+    return cpl_error_get_code();
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief computes the median in predefined regions
+ *
+ * @param ima           image with the data
+ * @param steps_x       number of steps in x where the median is calculated
+ * @param steps_y       number of steps in y where the median is calculated
+ * @param filtersize_x  half-size median-box in x where the median is calculated
+ * @param filtersize_y  half-size median-box in y where the median is calculated
+ *
+ * @return  median filtered image
+ *
+ * DONE (AMo): describe algorithm
+ * This function computes an image where each pixel value is obtained by a median
+ * every x and y steps in an image of half-box size filtersize_x, filtersize_y.
+ * It is assumed that the resulting bad pixel is good.
+ * TODO: what happens if some of the full boxes over which the median is
+ * computed is full of bad pixels?
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_image * hdrl_medianclean_image(
+        cpl_image   *   ima, 
+        cpl_size        steps_x, 
+        cpl_size        steps_y,
+        cpl_size        filtersize_x, 
+        cpl_size        filtersize_y) 
+{
+    cpl_error_ensure(ima != NULL, CPL_ERROR_NULL_INPUT,
+            return NULL, "NULL input image");
+    cpl_error_ensure(steps_x > 0 && steps_y > 0 && filtersize_x > 0 &&
+            filtersize_y > 0 , CPL_ERROR_INCOMPATIBLE_INPUT,
+            return NULL, "All function parameters must be greater then Zero");
+
+    const cpl_size nx = cpl_image_get_size_x(ima);
+    const cpl_size ny = cpl_image_get_size_y(ima);
+    const cpl_size stepsize_x = (cpl_size)(nx / steps_x);
+    cpl_size stepsize_y = (cpl_size)(ny / steps_y);
+    cpl_image * ima_local = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
+    cpl_mask_not(cpl_image_get_bpm(ima_local));
+
+    for (cpl_size iy = 0; iy < steps_y; iy++) {
+        for (cpl_size ix = 0; ix < steps_x; ix++) {
+            cpl_size middlep_x = (cpl_size)(stepsize_x * ix + stepsize_x / 2.);
+            cpl_size middlep_y = (cpl_size)(stepsize_y * iy + stepsize_y / 2.);
+
+            cpl_size lowerlimit_x = CX_MAX(middlep_x - filtersize_x, 1);
+            cpl_size lowerlimit_y = CX_MAX(middlep_y - filtersize_y, 1);
+            cpl_size upperlimit_x = CX_MIN(middlep_x + filtersize_x, nx);
+            cpl_size upperlimit_y = CX_MIN(middlep_y + filtersize_y, ny);
+
+            double median = cpl_image_get_median_window(ima, lowerlimit_x,
+                            lowerlimit_y, upperlimit_x, upperlimit_y);
+
+            cpl_image_set(ima_local, middlep_x, middlep_y, median);
+            cpl_image_accept(ima_local, middlep_x, middlep_y);
+
+            cpl_msg_debug(cpl_func, "middlep_x: %lld, middlep_y: %lld, median: "
+                          "%g", middlep_x, middlep_y, median);
+        }
+    }
+    return ima_local;
+}
+
+/*---------------------------------------------------------------------------*/
+/**
+  @brief    Smooth an image using a median filter
+  @param    in      image to be smoothed
+  @param    size    size of kernel matrix to use in filtering
+  @return   out     smoothed image
+ */
+/*---------------------------------------------------------------------------*/
+static cpl_image * hdrldemo_smooth_image_median(
+        const cpl_image     *   in, 
+        int                     size)
+{
+    cpl_image * out = cpl_image_duplicate(in);
+    cpl_mask * kernel = cpl_mask_new(size, size); 
+    cpl_mask_not(kernel);
+
+    if(cpl_image_filter_mask(out, in, kernel, CPL_FILTER_MEDIAN,
+                             CPL_BORDER_FILTER) != CPL_ERROR_NONE) {
+        cpl_image_delete(out);
+        cpl_mask_delete(kernel);
+        return NULL;
+    }
+
+    cpl_mask_delete(kernel);
+    return (out);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief create linear space row vector
+ * @param start  starting point
+ * @param stop   end point, exclusive
+ * @param step   step size
+ *
+ * @returns matrix with one row filled equally spaced points from start to end
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_matrix * hdrl_matrix_linspace(
+        cpl_size    start, 
+        cpl_size    stop, 
+        cpl_size    step)
+{
+    cpl_matrix * x = cpl_matrix_new(stop / step, 1);
+    for (size_t i = 0; start + i * step < stop && i < stop / step; i++) {
+        cpl_matrix_set(x, i, 0, start + i * step);
+    }
+    return x;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief fit 2D legendre polynomials to img
+ *
+ * @param img      image to be fitted
+ * @param order_x  order of x polynomial
+ * @param order_y  order of y polynomial
+ * @param grid_x   x grid to evaluate on
+ * @param grid_y   y grid to evaluate on
+ * @param orig_nx  upper limit in x, exclusive
+ * @param orig_ny  upper limit in y, exclusive
+ *
+ * @return coefficient matrix of the fitted 2-D polynomial
+ * @see hdrl_mime_linalg_pairwise_column_tensor_products_create,
+ *      hdrl_legendre_to_image
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_matrix * hdrl_fit_legendre(
+        cpl_image   *   img, 
+        int             order_x, 
+        int             order_y,
+        cpl_matrix  *   grid_x, 
+        cpl_matrix  *   grid_y,
+        cpl_size        orig_nx, 
+        cpl_size        orig_ny)
+{
+    cpl_size nx2 = cpl_matrix_get_nrow(grid_x);
+    cpl_size ny2 = cpl_matrix_get_nrow(grid_y);
+    cpl_matrix * xpolys =
+        hdrl_mime_legendre_polynomials_create(order_x + 1, 0, orig_nx - 1, grid_x);
+    cpl_matrix * ypolys =
+        hdrl_mime_legendre_polynomials_create(order_y + 1, 0, orig_ny - 1, grid_y);
+    cpl_matrix * tensors =
+        hdrl_mime_linalg_pairwise_column_tensor_products_create(ypolys,
+                                                                xpolys);
+    cpl_matrix * mimage = cpl_matrix_wrap(nx2 * ny2, 1, cpl_image_get_data(img));
+    cpl_matrix * coeffs = cpl_matrix_solve_normal(tensors, mimage);
+    cpl_msg_info(cpl_func, "%lld", cpl_matrix_get_nrow(coeffs));
+    cpl_matrix_unwrap(mimage);
+    cpl_matrix_delete(xpolys);
+    cpl_matrix_delete(ypolys);
+    cpl_matrix_delete(tensors);
+
+    return coeffs;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief evaluate 2D legendre polynomials on image
+ *
+ * @param coeffs   legendre coefficients
+ * @param order_x  order of x polynomial
+ * @param order_y  order of y polynomial
+ * @param nx       x size of image
+ * @param ny       y size of image
+ * @return legendre polynomial evaluated on an image
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_image * hdrl_legendre_to_image(
+        cpl_matrix  *   coeffs, 
+        int             order_x, 
+        int             order_y,
+        cpl_size        nx, 
+        cpl_size        ny)
+{
+    /* evaluate on full image */
+    /* TODO need grid of original fit here? */
+    cpl_matrix * x = hdrl_matrix_linspace(0, nx, 1);
+    cpl_matrix * y = hdrl_matrix_linspace(0, ny, 1);
+    cpl_matrix * xpolys =
+        hdrl_mime_legendre_polynomials_create(order_x + 1, 0, nx - 1, x);
+    cpl_matrix  * ypolys =
+        hdrl_mime_legendre_polynomials_create(order_y + 1, 0, ny - 1, y);
+    cpl_matrix * tensors =
+        hdrl_mime_linalg_pairwise_column_tensor_products_create(ypolys,
+                                                                xpolys);
+    cpl_matrix * result = cpl_matrix_product_create(tensors, coeffs);
+    cpl_image * iresult = cpl_image_wrap(nx, ny, CPL_TYPE_DOUBLE,
+                                         cpl_matrix_get_data(result));
+    cpl_matrix_delete(x);
+    cpl_matrix_delete(y);
+    cpl_matrix_delete(xpolys);
+    cpl_matrix_delete(ypolys);
+    cpl_matrix_delete(tensors);
+    cpl_matrix_unwrap(result);
+
+    return iresult;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief filter image on a grid
+ *
+ * @param ima           image to filter
+ * @param x             row vector of coordinates to filter on
+ * @param y             row vector of coordinates to filter on
+ * @param filtersize_x  size of the median filter
+ * @param filtersize_y  size of the median filter
+ * @return filtered image of size of the grid
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_image * hdrl_medianfilter_image_grid(
+        cpl_image   *   ima, 
+        cpl_matrix  *   x, 
+        cpl_matrix  *   y,
+        cpl_size        filtersize_x, 
+        cpl_size        filtersize_y)
+{
+    cpl_error_ensure(ima != NULL, CPL_ERROR_NULL_INPUT, return NULL, 
+            "NULL input image");
+    cpl_error_ensure(filtersize_x > 0 && filtersize_y > 0 , 
+            CPL_ERROR_INCOMPATIBLE_INPUT, return NULL,
+            "All function parameters must be greater then Zero");
+
+    const cpl_size nx = cpl_image_get_size_x(ima);
+    const cpl_size ny = cpl_image_get_size_y(ima);
+    const cpl_size steps_x = cpl_matrix_get_nrow(x);
+    const cpl_size steps_y = cpl_matrix_get_nrow(y);
+
+    cpl_image * ima_local = cpl_image_new(steps_x, steps_y, CPL_TYPE_DOUBLE);
+
+    for (cpl_size iy = 0; iy < steps_y; iy++) {
+        cpl_size middlep_y = cpl_matrix_get(y, iy, 0);
+        for (cpl_size ix = 0; ix < steps_x; ix++) {
+            cpl_size middlep_x = cpl_matrix_get(x, ix, 0);
+
+            cpl_size lowerlimit_x = CX_MAX(middlep_x - filtersize_x, 1);
+            cpl_size lowerlimit_y = CX_MAX(middlep_y - filtersize_y, 1);
+            cpl_size upperlimit_x = CX_MIN(middlep_x + filtersize_x, nx);
+            cpl_size upperlimit_y = CX_MIN(middlep_y + filtersize_y, ny);
+
+            double median = cpl_image_get_median_window(ima, lowerlimit_x,
+                            lowerlimit_y, upperlimit_x, upperlimit_y);
+
+            cpl_image_set(ima_local, ix + 1, iy + 1, median);
+
+            cpl_msg_debug(cpl_func, "middlep_x: %lld, middlep_y: %lld, median: "
+                          "%g", middlep_x, middlep_y, median);
+        }
+    }
+    return ima_local;
+}
+
diff --git a/mosca/libmosca/hdrl_flat.h b/mosca/libmosca/hdrl_flat.h
new file mode 100644
index 0000000..33014c3
--- /dev/null
+++ b/mosca/libmosca/hdrl_flat.h
@@ -0,0 +1,71 @@
+/* $Id: hdrl_flat.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_FLAT_H
+#define HDRL_FLAT_H
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_collapse.h"
+#include <cpl.h>
+
+/*-----------------------------------------------------------------------------
+                                Define
+ -----------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------
+                            Functions prototypes
+ -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+
+cpl_error_code hdrl_compute_flat_median_smooth(const cpl_imagelist *, 
+        const cpl_imagelist *, hdrl_collapse_imagelist_to_image_t *, cpl_size, 
+        cpl_image *, cpl_image *, cpl_image **, cpl_image **, cpl_image **);
+
+cpl_error_code hdrl_compute_flat_gauss_smooth(const cpl_imagelist *, 
+        const cpl_imagelist *, hdrl_collapse_imagelist_to_image_t *, cpl_size, 
+        cpl_size, cpl_size, cpl_image *, cpl_image *, cpl_image **, 
+        cpl_image **, cpl_image **);
+
+cpl_error_code hdrl_compute_flat_median_step_fit(const cpl_imagelist *, 
+        const cpl_imagelist *, hdrl_collapse_imagelist_to_image_t *, cpl_size, 
+        cpl_size, cpl_size, cpl_size, int, int, cpl_image *, cpl_image *, 
+        cpl_image **, cpl_image **, cpl_image **);
+CPL_END_DECLS
+
+/*-----------------------------------------------------------------------------
+             Private declarations - must not be used outside of hdrl
+ -----------------------------------------------------------------------------*/
+
+#ifdef HDRL_USE_PRIVATE
+
+#endif
+
+#endif
+
diff --git a/mosca/libmosca/hdrl_image.c b/mosca/libmosca/hdrl_image.c
new file mode 100644
index 0000000..bfbccc7
--- /dev/null
+++ b/mosca/libmosca/hdrl_image.c
@@ -0,0 +1,421 @@
+/* $Id: hdrl_image.c,v 1.1 2013-10-16 11:31:03 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:03 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_elemop.h"
+#include "hdrl_image.h"
+#include "hdrl_image_defs.h"
+#include "hdrl_utils.h"
+
+#include <cpl.h>
+#include <string.h>
+
+/*-----------------------------------------------------------------------------
+                                   Functions
+ -----------------------------------------------------------------------------*/
+
+static void _hdrl_image_delete(hdrl_image * himg);
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief check data and its errors for consistency
+ *
+ * will warn if error has a different bpm than image
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code
+hdrl_image_check_consistent(const cpl_image * image,
+                            const cpl_image * error)
+{
+    cpl_ensure_code(image, CPL_ERROR_NULL_INPUT);
+    if (error) {
+        cpl_size inx = cpl_image_get_size_x(image);
+        cpl_size iny = cpl_image_get_size_y(image);
+        cpl_size enx = cpl_image_get_size_x(error);
+        cpl_size eny = cpl_image_get_size_y(error);
+        const cpl_mask * ibpm = cpl_image_get_bpm_const(image);
+        const cpl_mask * ebpm = cpl_image_get_bpm_const(error);
+        cpl_ensure_code(inx == enx, CPL_ERROR_INCOMPATIBLE_INPUT);
+        cpl_ensure_code(iny == eny, CPL_ERROR_INCOMPATIBLE_INPUT);
+
+        if (ibpm && ebpm) {
+            const cpl_binary * dibpm = cpl_mask_get_data_const(ibpm);
+            const cpl_binary * debpm = cpl_mask_get_data_const(ebpm);
+            if (memcmp(dibpm, debpm, inx * iny) != 0) {
+                cpl_msg_warning(cpl_func, "Image and error bad pixel mask "
+                                "not equal, ignoring mask of error image");
+            }
+        }
+        else if (ibpm == NULL && ebpm) {
+            cpl_msg_warning(cpl_func, "Image and error bad pixel mask "
+                            "not equal, ignoring mask of error image");
+        }
+    }
+
+    return CPL_ERROR_NONE;
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @internal
+ * @brief create hdrl image by wrapping two cpl images without any copies
+ * @note no consistency checks the two images
+ * @see hdrl_image_check_consistent
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_image * hdrl_image_wrap(cpl_image * img, cpl_image * err)
+{
+    hdrl_image * himg = cpl_malloc(sizeof(*himg));
+    himg->image = img;
+    himg->error = err;
+    himg->fp_free = (hdrl_free*)&_hdrl_image_delete;
+
+    return himg;
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @internal
+ * @brief unwrap hdrl image, will not delete wrapped cpl images
+ */
+/* ---------------------------------------------------------------------------*/
+void hdrl_image_unwrap(hdrl_image * himg)
+{
+    cpl_free(himg);
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief create a new hdrl_image from to existing images by copying them
+ *
+ * @param image  data to copy
+ * @param error  errors to copy
+ *
+ * @return hdrl_image
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_image * hdrl_image_create(const cpl_image * image,
+                               const cpl_image * error)
+{
+    cpl_image * himage = NULL, * herror = NULL;
+
+    if (hdrl_image_check_consistent(image, error)) {
+        return NULL;
+    }
+
+    himage = cpl_image_cast(image, CPL_TYPE_DOUBLE);
+    if (error) {
+        herror = cpl_image_cast(error, CPL_TYPE_DOUBLE);
+    }
+    else {
+        /* set error to zero */
+        herror = cpl_image_duplicate(image);
+        cpl_image_multiply_scalar(herror, 0.);
+    }
+
+    /* sync image and error bpm ignoring what is in error before */
+    if (cpl_image_get_bpm_const(image)) {
+        cpl_image_reject_from_mask(herror,
+                                   cpl_image_get_bpm_const(image));
+    }
+    else {
+        cpl_image_accept_all(herror);
+    }
+
+    return hdrl_image_wrap(himage, herror);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief create new zero filled hdrl image
+ *
+ * @param nx  size in x
+ * @param ny  size in y
+ *
+ * @return hdrl_image or NULL on error
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_image * hdrl_image_new(cpl_size nx, cpl_size ny)
+{
+    cpl_image * himage = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
+    cpl_image * herror = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
+
+    if (cpl_error_get_code()) {
+        cpl_image_delete(himage);
+        cpl_image_delete(herror);
+        return NULL;
+    }
+
+    return hdrl_image_wrap(himage, herror);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief delete hdrl_image
+ */
+/* ---------------------------------------------------------------------------*/
+static void _hdrl_image_delete(hdrl_image * himg)
+{
+    if (himg) {
+        cpl_image_delete(himg->image);
+        cpl_image_delete(himg->error);
+        cpl_free(himg);
+    }
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief delete hdrl_image
+ * @note may be used on views in which case the original memory is kept
+ */
+/* ---------------------------------------------------------------------------*/
+void hdrl_image_delete(hdrl_image * himg)
+{
+    if (himg) {
+        himg->fp_free(himg);
+    }
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief copy hdrl_image
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_image * hdrl_image_duplicate(const hdrl_image * himg)
+{
+    return hdrl_image_create(himg->image, himg->error);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief set bpm of hdrl_image
+ *
+ * @param self  image on which to set bpm
+ * @param map   bpm to set
+ * @see cpl_image_reject_from_mask
+ *
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_image_reject_from_mask(hdrl_image * self,
+                                           const cpl_mask * map)
+{
+    return cpl_image_reject_from_mask(self->image, map);
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief mark pixel as bad
+ *
+ * @param self          image
+ * @param xpos          x coordinate (FITS CONVENTION)
+ * @param ypos          y coordinate (FITS CONVENTION)
+ * @see cpl_image_reject
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_image_reject(hdrl_image * self,
+                                 cpl_size xpos, cpl_size ypos)
+{
+    return cpl_image_reject(self->image, xpos, ypos);
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief    Reject pixels with the specified special value(s)
+ *
+ * @param self   Input image to modify
+ * @param mode   Bit field specifying which special value(s) to reject
+ * @see cpl_image_reject_value
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_image_reject_value(hdrl_image * self, cpl_value mode)
+{
+    return cpl_image_reject_value(self->image, mode);
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief return size of X dimension of image
+ *
+ * @param self  image
+ * @return size of X dimension of image
+ * @see cpl_image_get_size_x
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_size hdrl_image_get_size_x(const hdrl_image * self)
+{
+    return cpl_image_get_size_x(self->image);
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief return size of Y dimension of image
+ *
+ * @param self  image
+ * @return size of Y dimension of image
+ * @see cpl_image_get_size_y
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_size hdrl_image_get_size_y(const hdrl_image * self)
+{
+    return cpl_image_get_size_y(self->image);
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief get pixel values of hdrl_image
+ *
+ * @param self          image
+ * @param xpos          x coordinate (FITS CONVENTION)
+ * @param ypos          y coordinate (FITS CONVENTION)
+ * @param error         double pointer to store error in, may be NULL
+ * @param pis_rejected  int pointer to store if pixel is bad, may be NULL
+ *
+ * @return data value of the pixel
+ * @see cpl_image_get
+ */
+/* ---------------------------------------------------------------------------*/
+double hdrl_image_get_pixel(const hdrl_image * self,
+                            cpl_size xpos, cpl_size ypos,
+                            double * error, int * pis_rejected)
+{
+    int d;
+    double v = cpl_image_get(self->image, xpos, ypos, &d);
+
+    /* NULL allowed, different than CPL */
+    if (pis_rejected) {
+        *pis_rejected = d;
+    }
+
+    if (error) {
+        *error = cpl_image_get(self->error, xpos, ypos, &d);
+    }
+
+    return v;
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief set pixel values of hdrl_image
+ *
+ * @param self          image
+ * @param xpos          x coordinate (FITS CONVENTION)
+ * @param ypos          y coordinate (FITS CONVENTION)
+ * @param value         data value to set
+ * @param error         error of value (>= 0)
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_image_set_pixel(hdrl_image * self,
+                                    cpl_size xpos, cpl_size ypos,
+                                    double value, double error) 
+{
+    cpl_ensure_code(error >= 0, CPL_ERROR_ILLEGAL_INPUT);
+
+    if (cpl_image_set(self->image, xpos, ypos, value)) {
+        return cpl_error_get_code();
+    }
+
+    return cpl_image_set(self->error, xpos, ypos, error);
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ @brief extract copy of window from image
+ @param self  image to extract from
+ @param rect  rectangular region defining what to extract
+ 
+ @return newly allocated hdrl_image containing the window
+ @see cpl_image_extract
+ @see hdrl_rect_region_parameter_create
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_image * hdrl_image_extract(
+        const hdrl_image        *   self,
+        const hdrl_parameter    *   rect)
+{
+    cpl_ensure(rect, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_ensure(hdrl_rect_region_parameter_verify(rect, -1, -1)==CPL_ERROR_NONE, 
+            CPL_ERROR_ILLEGAL_INPUT, NULL);
+
+    const cpl_size llx = hdrl_rect_region_get_llx(rect);
+    const cpl_size lly = hdrl_rect_region_get_lly(rect);
+    const cpl_size urx = hdrl_rect_region_get_urx(rect);
+    const cpl_size ury = hdrl_rect_region_get_ury(rect);
+
+    cpl_image * img = cpl_image_extract(self->image, llx, lly, urx, ury);
+    cpl_image * err = cpl_image_extract(self->error, llx, lly, urx, ury);
+
+    if (cpl_error_get_code()) {
+        cpl_image_delete(img);
+        cpl_image_delete(err);
+        return NULL;
+    }
+
+    return hdrl_image_wrap(img, err);
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+  @brief    Copy one image into another
+  @param    im1     the image in which im2 is inserted
+  @param    im2     the inserted image
+  @param    xpos    the x pixel position in im1 where the lower left pixel of
+                    im2 should go (from 1 to the x size of im1)
+  @param    ypos    the y pixel position in im1 where the lower left pixel of
+                    im2 should go (from 1 to the y size of im1)
+  @return   CPL_ERROR_NONE or the relevant #_cpl_error_code_ on error.
+  @see cpl_image_copy
+  @note The two pixel buffers may not overlap
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_image_copy(hdrl_image * other, const hdrl_image * self,
+                               cpl_size xpos, cpl_size ypos)
+{
+    cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other, CPL_ERROR_NULL_INPUT);
+    cpl_image_copy(other->image, self->image, xpos, ypos);
+    cpl_image_copy(other->error, self->error, xpos, ypos);
+
+    return cpl_error_get_code();
+}
diff --git a/mosca/libmosca/hdrl_image.h b/mosca/libmosca/hdrl_image.h
new file mode 100644
index 0000000..743b784
--- /dev/null
+++ b/mosca/libmosca/hdrl_image.h
@@ -0,0 +1,100 @@
+/* $Id: hdrl_image.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_IMAGE_H
+#define HDRL_IMAGE_H
+
+/*-----------------------------------------------------------------------------
+                                   New types
+ -----------------------------------------------------------------------------*/
+
+typedef struct _hdrl_image_ hdrl_image;
+
+/*----------------------------------------------------------------------------*/
+/**
+ * @defgroup hdrl_image HDRL Image
+ *
+ * This module provides functions to create, use, and destroy an
+ *   @em hdrl_image.
+ * 
+ * @par Synopsis:
+ * @code
+ *   #include "hdrl_imagelh"
+ * @endcode
+ */
+/*----------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_image_math.h"
+#include "hdrl_utils.h"
+
+#include <cpl.h>
+
+/*-----------------------------------------------------------------------------
+                                   Functions
+ -----------------------------------------------------------------------------*/
+
+CPL_BEGIN_DECLS
+hdrl_image * hdrl_image_new(cpl_size nx, cpl_size ny);
+
+hdrl_image * hdrl_image_create(const cpl_image * image,
+                               const cpl_image * error);
+
+hdrl_image * hdrl_image_duplicate(const hdrl_image * himg);
+
+void hdrl_image_delete(hdrl_image * himg);
+
+double hdrl_image_get_pixel(const hdrl_image * self,
+                            cpl_size xpos, cpl_size ypos,
+                            double * error, int * pis_rejected);
+
+cpl_error_code hdrl_image_set_pixel(hdrl_image * self,
+                                    cpl_size xpos, cpl_size ypos,
+                                    double value, double error);
+
+cpl_size hdrl_image_get_size_x(const hdrl_image * self) ;
+cpl_size hdrl_image_get_size_y(const hdrl_image * self) ;
+
+hdrl_image * hdrl_image_extract(const hdrl_image *, const hdrl_parameter *) ;
+
+cpl_error_code hdrl_image_reject(hdrl_image * self,
+                                 cpl_size xpos, cpl_size ypos);
+cpl_error_code hdrl_image_reject_value(hdrl_image * self, cpl_value mode);
+
+cpl_error_code hdrl_image_copy(hdrl_image * other, const hdrl_image * self,
+                               cpl_size xpos, cpl_size ypos);
+CPL_END_DECLS
+
+#ifdef HDRL_USE_PRIVATE
+hdrl_image * hdrl_image_wrap(cpl_image * img, cpl_image * err);
+void hdrl_image_unwrap(hdrl_image * himg);
+#endif
+
+#endif 
diff --git a/mosca/libmosca/image_smooth.h b/mosca/libmosca/hdrl_image_defs.h
similarity index 57%
copy from mosca/libmosca/image_smooth.h
copy to mosca/libmosca/hdrl_image_defs.h
index 609d843..e3b5ab5 100644
--- a/mosca/libmosca/image_smooth.h
+++ b/mosca/libmosca/hdrl_image_defs.h
@@ -1,6 +1,6 @@
-/* $Id: image_smooth.h,v 1.2 2013/01/24 18:01:23 cgarcia Exp $
+/* $Id: hdrl_image_defs.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
  *
- * This file is part of the MOSCA library
+ * This file is part of the HDRL
  * Copyright (C) 2013 European Southern Observatory
  *
  * This program is free software; you can redistribute it and/or modify
@@ -15,20 +15,31 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/24 18:01:23 $
+ * $Date: 2013-10-16 16:52:20 $
  * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
-#include "mosca_image.h"
+#ifndef HDRL_IMAGE_DEFS_H
+#define HDRL_IMAGE_DEFS_H
 
-namespace mosca
-{
-void image_smooth_1d_median(mosca::image& image, 
-                            double half_width, mosca::axis smooth_axis);
-}
+#ifndef HDRL_USE_PRIVATE
+#error This file is not allowed to be included outside of hdrl
+#endif
+
+#include "hdrl_types.h"
+CPL_BEGIN_DECLS
+
+struct _hdrl_image_ {
+    cpl_image * image;
+    cpl_image * error;
+    hdrl_free * fp_free;
+};
+CPL_END_DECLS
+
+#endif
diff --git a/mosca/libmosca/hdrl_image_math.c b/mosca/libmosca/hdrl_image_math.c
new file mode 100644
index 0000000..9ad575f
--- /dev/null
+++ b/mosca/libmosca/hdrl_image_math.c
@@ -0,0 +1,323 @@
+/* $Id: hdrl_image_math.c,v 1.1 2013-10-16 11:31:05 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:05 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_elemop.h"
+#include "hdrl_image.h"
+#include "hdrl_collapse.h"
+#include "hdrl_image_defs.h"
+
+#include <cpl.h>
+#include <math.h>
+
+/*-----------------------------------------------------------------------------
+                                   Functions
+ -----------------------------------------------------------------------------*/
+
+
+cpl_error_code
+hdrl_image_add_image(hdrl_image * self, const hdrl_image * other)
+{
+    cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other, CPL_ERROR_NULL_INPUT);
+    /* size check included in elemop */
+    return hdrl_elemop_image_add_image(self->image, self->error,
+                                        other->image, other->error);
+}
+
+
+hdrl_image *
+hdrl_image_add_image_create(const hdrl_image * self, const hdrl_image * other)
+{
+    hdrl_image * n = hdrl_image_duplicate(self);
+
+    if (hdrl_image_add_image(n, other)) {
+        hdrl_image_delete(n);
+        return NULL;
+    }
+
+    return n;
+}
+
+
+cpl_error_code
+hdrl_image_add_scalar(hdrl_image * self,
+                       double value, double error)
+{
+    cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
+    /* size check included in elemop */
+    return hdrl_elemop_image_add_scalar(self->image, self->error,
+                                          value, error);
+}
+
+
+cpl_error_code
+hdrl_image_sub_image(hdrl_image * self, const hdrl_image * other)
+{
+    cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other, CPL_ERROR_NULL_INPUT);
+    /* size check included in elemop */
+    return hdrl_elemop_image_sub_image(self->image, self->error,
+                                        other->image, other->error);
+}
+
+
+hdrl_image *
+hdrl_image_sub_image_create(const hdrl_image * self, const hdrl_image * other)
+{
+    hdrl_image * n = hdrl_image_duplicate(self);
+
+    if (hdrl_image_sub_image(n, other)) {
+        hdrl_image_delete(n);
+        return NULL;
+    }
+
+    return n;
+}
+
+
+cpl_error_code
+hdrl_image_sub_scalar(hdrl_image * self,
+                       double value, double error)
+{
+    cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
+    /* size check included in elemop */
+    return hdrl_elemop_image_sub_scalar(self->image, self->error,
+                                          value, error);
+}
+
+
+cpl_error_code
+hdrl_image_mul_image(hdrl_image * self, const hdrl_image * other)
+{
+    cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other, CPL_ERROR_NULL_INPUT);
+    /* size check included in elemop */
+    return hdrl_elemop_image_mul_image(self->image, self->error,
+                                        other->image, other->error);
+}
+
+
+hdrl_image *
+hdrl_image_mul_image_create(const hdrl_image * self, const hdrl_image * other)
+{
+    hdrl_image * n = hdrl_image_duplicate(self);
+
+    if (hdrl_image_mul_image(n, other)) {
+        hdrl_image_delete(n);
+        return NULL;
+    }
+
+    return n;
+}
+
+
+cpl_error_code
+hdrl_image_mul_scalar(hdrl_image * self,
+                       double value, double error)
+{
+    cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
+    /* size check included in elemop */
+    return hdrl_elemop_image_mul_scalar(self->image, self->error,
+                                          value, error);
+}
+
+
+cpl_error_code
+hdrl_image_div_image(hdrl_image * self, const hdrl_image * other)
+{
+    cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(other, CPL_ERROR_NULL_INPUT);
+    /* size check included in elemop */
+    return hdrl_elemop_image_div_image(self->image, self->error,
+                                        other->image, other->error);
+}
+
+
+hdrl_image *
+hdrl_image_div_image_create(const hdrl_image * self, const hdrl_image * other)
+{
+    hdrl_image * n = hdrl_image_duplicate(self);
+
+    if (hdrl_image_div_image(n, other)) {
+        hdrl_image_delete(n);
+        return NULL;
+    }
+
+    return n;
+}
+
+
+cpl_error_code
+hdrl_image_div_scalar(hdrl_image * self,
+                       double value, double error)
+{
+    cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
+    /* size check included in elemop */
+    return hdrl_elemop_image_div_scalar(self->image, self->error,
+                                          value, error);
+}
+
+
+/* TODO copy from overscan */
+static cpl_error_code
+hdrl_image_collapse(hdrl_collapse_imagelist_to_vector_t * red,
+                    const hdrl_image * self, double * result, double * error)
+{
+    cpl_imagelist * ld = cpl_imagelist_new();
+    cpl_imagelist * le = cpl_imagelist_new();
+    cpl_vector * od, * oe;
+    cpl_array * oc;
+    cpl_error_code fail;
+    cpl_imagelist_set(ld, self->image, 0);
+    cpl_imagelist_set(le, self->error, 0);
+
+
+    fail = hdrl_collapse_imagelist_to_vector_call(red, ld, le, &od, &oe, &oc);
+    cpl_imagelist_unwrap(ld);
+    cpl_imagelist_unwrap(le);
+
+    if (fail == CPL_ERROR_NONE) {
+         *result = cpl_vector_get(od, 0);
+         *error = cpl_vector_get(oe, 0);
+    }
+
+    cpl_vector_delete(od);
+    cpl_vector_delete(oe);
+    cpl_array_delete(oc);
+
+    return fail;
+}
+
+
+cpl_error_code
+hdrl_image_get_mean(const hdrl_image * self, double * result, double * error)
+{
+    hdrl_collapse_imagelist_to_vector_t * red =
+        hdrl_collapse_imagelist_to_vector_mean();
+    cpl_error_code err = hdrl_image_collapse(red, self, result, error);
+    hdrl_collapse_imagelist_to_vector_delete(red);
+    return err;
+}
+
+
+cpl_error_code
+hdrl_image_get_median(const hdrl_image * self, double * result, double * error)
+{
+    hdrl_collapse_imagelist_to_vector_t * red =
+        hdrl_collapse_imagelist_to_vector_median();
+    cpl_error_code err = hdrl_image_collapse(red, self, result, error);
+    hdrl_collapse_imagelist_to_vector_delete(red);
+    return err;
+}
+
+
+double
+hdrl_image_get_stdev(const hdrl_image * self)
+{
+    return cpl_image_get_stdev(self->image);
+}
+
+cpl_error_code
+hdrl_image_get_sum(const hdrl_image * self, double * result, double * error)
+{
+    /* TODO should be collapse object */
+    cpl_ensure_code(result, CPL_ERROR_NULL_INPUT);
+    *result = cpl_image_get_flux(self->image);
+    if (error) {
+        return cpl_error_set_message(cpl_func, CPL_ERROR_UNSUPPORTED_MODE,
+                                     "Error of sum not supported yet");
+    }
+    return cpl_error_get_code();
+}
+
+cpl_error_code
+hdrl_image_get_sqsum(const hdrl_image * self, double * result, double * error)
+{
+    /* TODO should be collapse object */
+    cpl_ensure_code(result, CPL_ERROR_NULL_INPUT);
+    *result = cpl_image_get_sqflux(self->image);
+    if (error) {
+        return cpl_error_set_message(cpl_func, CPL_ERROR_UNSUPPORTED_MODE,
+                                     "Error of square sum not supported yet");
+    }
+    return cpl_error_get_code();
+}
+
+cpl_error_code
+hdrl_image_power(hdrl_image * self, const double exponent)
+{
+    long iexp = (long)exponent;
+    if (ceil(exponent) != iexp) {
+        return cpl_error_set_message(cpl_func, CPL_ERROR_UNSUPPORTED_MODE,
+                                     "Non integer powers not supported yet");
+    }
+    /* TODO should be moved to elemop */
+
+    if (iexp == 0) {
+        hdrl_image_mul_scalar(self, 0, 0);
+        hdrl_image_add_scalar(self, 1, 0);
+    }
+    else {
+        for (long i = 0; i < abs(iexp) - 1; i++) {
+            /* inefficient but works as due to self correlation in elemop */
+            hdrl_image_mul_image(self, self);
+        }
+    }
+
+    if (iexp < 0) {
+        hdrl_image * cpy = hdrl_image_duplicate(self);
+        hdrl_image_mul_scalar(self, 0, 0);
+        hdrl_image_add_scalar(self, 1, 0);
+        hdrl_image_div_image(self, cpy);
+        hdrl_image_delete(cpy);
+    }
+
+    return cpl_error_get_code();
+}
+
+
+hdrl_image *
+hdrl_image_power_create(const hdrl_image * self, const double exponent)
+{
+    hdrl_image * n = hdrl_image_duplicate(self);
+
+    if (hdrl_image_power(n, exponent)) {
+        hdrl_image_delete(n);
+        return NULL;
+    }
+
+    return n;
+}
+
diff --git a/mosca/libmosca/hdrl_image_math.h b/mosca/libmosca/hdrl_image_math.h
new file mode 100644
index 0000000..5a6d678
--- /dev/null
+++ b/mosca/libmosca/hdrl_image_math.h
@@ -0,0 +1,56 @@
+/* $Id: hdrl_image_math.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_IMAGE_MATH_H
+#define HDRL_IMAGE_MATH_H
+#include "hdrl_image.h"
+#include <cpl.h>
+
+CPL_BEGIN_DECLS
+
+hdrl_image *hdrl_image_power_create(const hdrl_image *self,const double exponent);
+cpl_error_code hdrl_image_power(hdrl_image *self,const double exponent);
+cpl_error_code hdrl_image_get_sqsum(const hdrl_image *self,double *result,double *error);
+cpl_error_code hdrl_image_get_sum(const hdrl_image *self,double *result,double *error);
+double hdrl_image_get_stdev(const hdrl_image *self);
+cpl_error_code hdrl_image_get_median(const hdrl_image *self,double *result,double *error);
+cpl_error_code hdrl_image_get_mean(const hdrl_image *self,double *result,double *error);
+cpl_error_code hdrl_image_div_scalar(hdrl_image *self,double value,double error);
+hdrl_image *hdrl_image_div_image_create(const hdrl_image *self,const hdrl_image *other);
+cpl_error_code hdrl_image_div_image(hdrl_image *self,const hdrl_image *other);
+cpl_error_code hdrl_image_mul_scalar(hdrl_image *self,double value,double error);
+hdrl_image *hdrl_image_mul_image_create(const hdrl_image *self,const hdrl_image *other);
+cpl_error_code hdrl_image_mul_image(hdrl_image *self,const hdrl_image *other);
+cpl_error_code hdrl_image_sub_scalar(hdrl_image *self,double value,double error);
+hdrl_image *hdrl_image_sub_image_create(const hdrl_image *self,const hdrl_image *other);
+cpl_error_code hdrl_image_sub_image(hdrl_image *self,const hdrl_image *other);
+cpl_error_code hdrl_image_add_scalar(hdrl_image *self,double value,double error);
+hdrl_image *hdrl_image_add_image_create(const hdrl_image *self,const hdrl_image *other);
+cpl_error_code hdrl_image_add_image(hdrl_image *self,const hdrl_image *other);
+CPL_END_DECLS
+
+#endif
diff --git a/irplib/irplib_spectrum.h b/mosca/libmosca/hdrl_imagelist.h
similarity index 54%
copy from irplib/irplib_spectrum.h
copy to mosca/libmosca/hdrl_imagelist.h
index 9b289b2..60071ab 100644
--- a/irplib/irplib_spectrum.h
+++ b/mosca/libmosca/hdrl_imagelist.h
@@ -1,7 +1,7 @@
-/* $Id: irplib_spectrum.h,v 1.7 2009/07/30 12:38:37 yjung Exp $
+/* $Id: hdrl_imagelist.h,v 1.1 2013-10-16 11:31:14 cgarcia Exp $
  *
- * This file is part of the irplib package
- * Copyright (C) 2002,2003 European Southern Observatory
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,45 +15,46 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 /*
- * $Author: yjung $
- * $Date: 2009/07/30 12:38:37 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:14 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
  */
 
-#ifndef IRPLIB_SPECTRUM_H
-#define IRPLIB_SPECTRUM_H
+#ifndef HDRL_IMAGELIST_H
+#define HDRL_IMAGELIST_H
 
 /*-----------------------------------------------------------------------------
-                                   Includes
+                                   New types
  -----------------------------------------------------------------------------*/
 
-#include <cpl.h>
+typedef struct _hdrl_imagelist_ hdrl_imagelist;
 
 /*-----------------------------------------------------------------------------
-                                New types
+                                   Includes
  -----------------------------------------------------------------------------*/
 
-typedef enum SPEC_SHADOWS {
-    /* 2 shadows above and below true spectrum */
-    TWO_SHADOWS,
-    /* 1 shadow at specified distance from spectrum */
-    ONE_SHADOW,
-    /* Do not search for shadow */
-    NO_SHADOW
-} spec_shadows ;
+#include "hdrl_imagelist_io.h"
+#include "hdrl_imagelist_basic.h"
+#include "hdrl_imagelist_view.h"
 
-/*-----------------------------------------------------------------------------
-                                Prototypes
- -----------------------------------------------------------------------------*/
-
-int irplib_spectrum_find_brightest(const cpl_image *, int, spec_shadows, 
-        double, int, double *) ;
-cpl_vector * irplib_spectrum_detect_peaks(const cpl_vector *, int,
-        double, int, cpl_vector **, cpl_vector **) ;
+/*----------------------------------------------------------------------------*/
+/**
+ * @defgroup hdrl_imagelist HDRL Image List
+ *
+ * This module provides functions to create, use, and destroy an
+ *   @em hdrl_imagelist.
+ * An @em hdrl_imagelist is an ordered list of hdrl_images.
+ * 
+ * @par Synopsis:
+ * @code
+ *   #include "hdrl_imagelist.h"
+ * @endcode
+ */
+/*----------------------------------------------------------------------------*/
 
-#endif
+#endif 
diff --git a/mosca/libmosca/hdrl_imagelist_basic.c b/mosca/libmosca/hdrl_imagelist_basic.c
new file mode 100644
index 0000000..981e060
--- /dev/null
+++ b/mosca/libmosca/hdrl_imagelist_basic.c
@@ -0,0 +1,562 @@
+/* $Id: hdrl_imagelist_basic.c,v 1.1 2013-10-16 11:31:03 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:03 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_imagelist.h"
+#include "hdrl_imagelist_view.h"
+#include "hdrl_imagelist_defs.h"
+#include "hdrl_image.h"
+#include "hdrl_image_defs.h"
+#include "hdrl_collapse.h"
+
+#include <cpl.h>
+#include <assert.h>
+
+/*-----------------------------------------------------------------------------
+                                   Define
+ -----------------------------------------------------------------------------*/
+
+#define HDRL_IMLIST_BASIC_IMLIST    0
+#define HDRL_IMLIST_BASIC_IMAGE     1
+#define HDRL_IMLIST_BASIC_SCALAR    2
+
+/*-----------------------------------------------------------------------------
+                            Static Prototypes
+ -----------------------------------------------------------------------------*/
+static cpl_error_code hdrl_imagelist_collapse_interface(const
+        hdrl_imagelist *, hdrl_collapse_imagelist_to_image_t *,
+        hdrl_image **, cpl_image **) ;
+
+/**@{*/
+
+/*-----------------------------------------------------------------------------
+                            Function codes
+ -----------------------------------------------------------------------------*/
+
+#define HDRL_OPERATION HDRL_IMLIST_BASIC_IMLIST
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Add two image lists, the first one is replaced by the result.
+  @param    himlist1   first input image list (modified)
+  @param    himlist2   image list to add
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_add_image()
+
+  The two input lists must have the same size, the image number n in the
+  list himlist2 is added to the image number n in the list himlist1.
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+  - CPL_ERROR_ILLEGAL_INPUT if the input images have different sizes
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_add_imagelist(
+        hdrl_imagelist        *    himlist1,
+        const hdrl_imagelist  *    himlist2)
+{
+#define HDRL_OPERATOR hdrl_image_add_image
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Subtract two image lists, the first one is replaced by the result.
+  @param    himlist1  first input image list (modified)
+  @param    himlist2  image list to subtract
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_sub_image()
+  @see      hdrl_imagelist_add_imagelist
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_sub_imagelist(
+        hdrl_imagelist        *    himlist1,
+        const hdrl_imagelist  *    himlist2)
+{
+#define HDRL_OPERATOR hdrl_image_sub_image
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Multiply two image lists, the first one is replaced by the result.
+  @param    himlist1  first input image list (modified)
+  @param    himlist2  image list to multiply
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_mul_image()
+  @see      hdrl_imagelist_add_imagelist
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_mul_imagelist(
+        hdrl_imagelist        *    himlist1,
+        const hdrl_imagelist  *    himlist2)
+{
+#define HDRL_OPERATOR hdrl_image_mul_image
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Divide two image lists, the first one is replaced by the result.
+  @param    himlist1  first input image list (modified)
+  @param    himlist2  image list to divide
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_div_image()
+  @see      hdrl_imagelist_add_imagelist
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_div_imagelist(
+        hdrl_imagelist        *    himlist1,
+        const hdrl_imagelist  *    himlist2)
+{
+#define HDRL_OPERATOR hdrl_image_div_image
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+#undef HDRL_OPERATION
+
+#define HDRL_OPERATION HDRL_IMLIST_BASIC_IMAGE
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Add an image to an image list.
+  @param    himlist input image list (modified)
+  @param    himg    image to add
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_add_image()
+
+  The passed image is added to each image of the passed image list.
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_add_image(
+        hdrl_imagelist      *    himlist,
+        const hdrl_image    *    himg)
+{
+#define HDRL_OPERATOR hdrl_image_add_image
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Subtract an image from an image list.
+  @param    himlist input image list (modified)
+  @param    himg    image to subtract
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_sub_image()
+  @see      hdrl_imagelist_add_image()
+
+  The passed image is subtracted from each image of the passed image list.
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_sub_image(
+        hdrl_imagelist      *    himlist,
+        const hdrl_image    *    himg)
+{
+#define HDRL_OPERATOR hdrl_image_sub_image
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Multiply an image by an image list.
+  @param    himlist input image list (modified)
+  @param    himg    image to multiply
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_mul_image()
+  @see      hdrl_imagelist_add_image()
+
+  The passed image is multiplied by each image of the passed image list.
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_mul_image(
+        hdrl_imagelist      *    himlist,
+        const hdrl_image    *    himg)
+{
+#define HDRL_OPERATOR hdrl_image_mul_image
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Divide an image from an image list.
+  @param    himlist input image list (modified)
+  @param    himg    image to divide
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_div_image()
+  @see      hdrl_imagelist_add_image()
+
+  The passed image is used to divide each image of the passed image list.
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_div_image(
+        hdrl_imagelist      *    himlist,
+        const hdrl_image    *    himg)
+{
+#define HDRL_OPERATOR hdrl_image_div_image
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+#undef HDRL_OPERATION
+
+#define HDRL_OPERATION HDRL_IMLIST_BASIC_SCALAR
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Elementwise addition of a scalar to each image in the himlist
+  @param    himlist Imagelist to be modified in place.
+  @param    value   Value to add to the images
+  @param    error   Value to add to the error images
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_add_scalar()
+ 
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_add_scalar(
+        hdrl_imagelist  *   himlist,
+        double              value,
+        double              error)
+{
+#define HDRL_OPERATOR hdrl_image_add_scalar
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Elementwise subtraction of a scalar to each image in the himlist
+  @param    himlist Imagelist to be modified in place.
+  @param    value   Value to subtract to the images
+  @param    error   Value to subtract to the error images
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_sub_scalar()
+  @see      hdrl_imagelist_add_scalar()
+ 
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_sub_scalar(
+        hdrl_imagelist  *   himlist,
+        double              value,
+        double              error)
+{
+#define HDRL_OPERATOR hdrl_image_sub_scalar
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Elementwise multiplication of a scalar to each image in the himlist
+  @param    himlist Imagelist to be modified in place.
+  @param    value   Value to multiply to the images
+  @param    error   Value to multiply to the error images
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_mul_scalar()
+  @see      hdrl_imagelist_add_scalar()
+ 
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_mul_scalar(
+        hdrl_imagelist  *   himlist,
+        double              value,
+        double              error)
+{
+#define HDRL_OPERATOR hdrl_image_mul_scalar
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Elementwise division by a scalar to each image in the himlist
+  @param    himlist Imagelist to be modified in place.
+  @param    value   Value to divide to the images
+  @param    error   Value to divide to the error images
+  @return   the #_cpl_error_code_ or CPL_ERROR_NONE
+  @see      hdrl_image_div_scalar()
+  @see      hdrl_imagelist_add_scalar()
+ 
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_div_scalar(
+        hdrl_imagelist  *   himlist,
+        double              value,
+        double              error)
+{
+#define HDRL_OPERATOR hdrl_image_div_scalar
+#include "hdrl_imagelist_basic_body.h"
+#undef HDRL_OPERATOR
+}
+#undef HDRL_OPERATION
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Compute the elementwise power of each image in the himlist
+  @param    himlist     Imagelist to be modified in place.
+  @param    exponent    Scalar exponent
+  @return   CPL_ERROR_NONE or the relevant the #_cpl_error_code_ on error
+  @see      hdrl_image_power()
+ 
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_power(
+        hdrl_imagelist  *   himlist,
+        double              exponent)
+{
+    cpl_size    nima ;
+    cpl_size    i ;
+
+    /* Check inputs */
+    cpl_ensure_code(himlist != NULL, CPL_ERROR_NULL_INPUT);
+
+    nima = hdrl_imagelist_get_size(himlist) ;
+
+    for (i=0 ; i<nima ; i++) {
+        hdrl_image  *   himg = hdrl_imagelist_get(himlist, i) ;
+        cpl_ensure_code(!hdrl_image_power(himg, exponent), 
+                cpl_error_get_code());
+    }
+    return CPL_ERROR_NONE;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief Mean collapsing of image list
+  @param himlist    input image list
+  @param hout       output combined image
+  @param contrib    output contribution mask
+  @return   CPL_ERROR_NONE or the relevant the #_cpl_error_code_ on error
+ 
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_collapse_mean(
+        const hdrl_imagelist    *   himlist,
+        hdrl_image              **  out,
+        cpl_image               **  contrib) 
+{
+    hdrl_collapse_imagelist_to_image_t * method =
+        hdrl_collapse_imagelist_to_image_mean();
+    hdrl_imagelist_collapse_interface(himlist, method, out, contrib) ;
+    hdrl_collapse_imagelist_to_image_delete(method) ;
+    return cpl_error_get_code();
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief Weighted Mean collapsing of image list
+  @param himlist    input image list
+  @param hout       output combined image
+  @param contrib    output contribution mask
+  @return   CPL_ERROR_NONE or the relevant the #_cpl_error_code_ on error
+ 
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_collapse_weighted_mean(
+        const hdrl_imagelist    *   himlist,
+        hdrl_image              **  out,
+        cpl_image               **  contrib) 
+{
+    hdrl_collapse_imagelist_to_image_t * method =
+        hdrl_collapse_imagelist_to_image_weighted_mean();
+    hdrl_imagelist_collapse_interface(himlist, method, out, contrib) ;
+    hdrl_collapse_imagelist_to_image_delete(method) ;
+    return cpl_error_get_code();
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief Median collapsing of image list
+  @param himlist    input image list
+  @param hout       output combined image
+  @param contrib    output contribution mask
+  @return   CPL_ERROR_NONE or the relevant the #_cpl_error_code_ on error
+ 
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_collapse_median(
+        const hdrl_imagelist    *   himlist,
+        hdrl_image              **  out,
+        cpl_image               **  contrib) 
+{
+    hdrl_collapse_imagelist_to_image_t * method =
+        hdrl_collapse_imagelist_to_image_median();
+    hdrl_imagelist_collapse_interface(himlist, method, out, contrib) ;
+    hdrl_collapse_imagelist_to_image_delete(method) ;
+    return cpl_error_get_code();
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief Sigma-clipped collapsing of image list
+  @param himlist    input image list
+  @param kappa_low  low sigma bound
+  @param kappa_high high sigma bound
+  @param niter      number of clipping iterators
+  @param hout       output combined image
+  @param contrib    output contribution mask
+  @return   CPL_ERROR_NONE or the relevant the #_cpl_error_code_ on error
+ 
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_collapse_sigclip(
+        const hdrl_imagelist    *   himlist,
+        double                      kappa_low,
+        double                      kappa_high,
+        int                         niter,
+        hdrl_image              **  out,
+        cpl_image               **  contrib) 
+{
+    hdrl_collapse_imagelist_to_image_t * method =
+        hdrl_collapse_imagelist_to_image_sigclip(kappa_low, kappa_high, niter);
+    hdrl_imagelist_collapse_interface(himlist, method, out, contrib) ;
+    hdrl_collapse_imagelist_to_image_delete(method) ;
+    return cpl_error_get_code();
+}
+
+/**@}*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief Generic hdrl_imagelist_collapse іnterface to hdrl_collapse
+  @param himlist    input image list
+  @param niter      number of clipping iterators
+  @param hout       output combined image
+  @param contrib    output contribution mask
+  @return   CPL_ERROR_NONE or the relevant the #_cpl_error_code_ on error
+ 
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code hdrl_imagelist_collapse_interface(
+        const hdrl_imagelist                *   himlist,
+        hdrl_collapse_imagelist_to_image_t  *   collapse_method,
+        hdrl_image                          **  out,
+        cpl_image                           **  contrib) 
+{
+    cpl_imagelist       *   data ;
+    cpl_imagelist       *   errors ;
+    const hdrl_image    *   hima ;
+    cpl_size                nima ;
+    cpl_size                y = 1;
+
+    /* Check inputs */
+    cpl_ensure_code(himlist != NULL, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(out != NULL, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(contrib != NULL, CPL_ERROR_NULL_INPUT);
+
+    cpl_size nz = hdrl_imagelist_get_size(himlist);
+    cpl_size nx = hdrl_image_get_size_x(hdrl_imagelist_get_const(himlist, 0));
+    cpl_size ny = hdrl_image_get_size_y(hdrl_imagelist_get_const(himlist, 0));
+    /* process in 2MB blocks (O(L2 cache)) */
+    cpl_size blocksize = 2 * (1<<20) / (nz * nx * sizeof(double));
+    *out = hdrl_image_new(nx, ny);
+    *contrib = cpl_image_new(nx, ny, CPL_TYPE_INT);
+
+    hdrl_collapse_imagelist_to_image_disable_extra_out(collapse_method);
+    hdrl_iter_t * it = hdrl_imagelist_get_iter_row_slices(himlist, blocksize, 0);
+    for (hdrl_imagelist * v = hdrl_iter_next(it);
+         v != NULL;
+         v = hdrl_iter_next(it)) {
+        cpl_image * out_data ;
+        cpl_image * out_errors ;
+        cpl_image * out_contrib ;
+
+        /* Build the Inputs Interface */
+        nima = hdrl_imagelist_get_size(v);
+        data = cpl_imagelist_new();
+        errors = cpl_imagelist_new() ;
+        for (cpl_size i=0 ; i<nima ; i++) {
+            hima = hdrl_imagelist_get_const(v, i) ;
+            cpl_imagelist_set(data, hima->image, i) ;
+            cpl_imagelist_set(errors, hima->error, i) ;
+        }
+        /* Call the actual collapsing */
+        hdrl_collapse_imagelist_to_image_call(collapse_method, data, errors,
+                                              &out_data, &out_errors,
+                                              &out_contrib);
+
+        /* TODO make use of output image views to avoid copying */
+        cpl_image_copy((*out)->image, out_data, 1, y);
+        cpl_image_copy((*out)->error, out_errors, 1, y);
+        cpl_image_copy(*contrib, out_contrib, 1, y);
+        y += cpl_image_get_size_y(out_data);
+
+        /* Destroy the Inputs Interface */
+        cpl_image_delete(out_data);
+        cpl_image_delete(out_errors);
+        cpl_image_delete(out_contrib);
+        cpl_imagelist_unwrap(data) ;
+        cpl_imagelist_unwrap(errors) ;
+        hdrl_imagelist_delete(v);
+    }
+
+    hdrl_imagelist_iter_delete(it);
+
+    return cpl_error_get_code();
+}
+
+/**@}*/
diff --git a/mosca/libmosca/hdrl_imagelist_basic.h b/mosca/libmosca/hdrl_imagelist_basic.h
new file mode 100644
index 0000000..a494433
--- /dev/null
+++ b/mosca/libmosca/hdrl_imagelist_basic.h
@@ -0,0 +1,83 @@
+/* $Id: hdrl_imagelist_basic.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_IMAGELIST_BASIC_H
+#define HDRL_IMAGELIST_BASIC_H
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_imagelist.h"
+
+/*-----------------------------------------------------------------------------
+                            Function prototypes
+ -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+
+/* Imagelist Basic Operations */
+cpl_error_code hdrl_imagelist_add_imagelist(hdrl_imagelist *, 
+        const hdrl_imagelist *);
+cpl_error_code hdrl_imagelist_subtract_imagelist(hdrl_imagelist *, 
+        const hdrl_imagelist *);
+cpl_error_code hdrl_imagelist_multiply_imagelist(hdrl_imagelist *, 
+        const hdrl_imagelist *);
+cpl_error_code hdrl_imagelist_divide_imagelist(hdrl_imagelist *, 
+        const hdrl_imagelist *);
+
+cpl_error_code hdrl_imagelist_add_image(hdrl_imagelist *, 
+        const hdrl_image *);
+cpl_error_code hdrl_imagelist_subtract_image(hdrl_imagelist *, 
+        const hdrl_image *);
+cpl_error_code hdrl_imagelist_multiply_image(hdrl_imagelist *, 
+        const hdrl_image *);
+cpl_error_code hdrl_imagelist_divide_image(hdrl_imagelist *, 
+        const hdrl_image *);
+
+cpl_error_code hdrl_imagelist_add_scalar(hdrl_imagelist *, double,
+        double);
+cpl_error_code hdrl_imagelist_subtract_scalar(hdrl_imagelist *, double,
+        double);
+cpl_error_code hdrl_imagelist_multiply_scalar(hdrl_imagelist *, double,
+        double);
+cpl_error_code hdrl_imagelist_divide_scalar(hdrl_imagelist *, double,
+        double);
+
+cpl_error_code hdrl_imagelist_power(hdrl_imagelist *, double) ;
+
+/* Collapsing functions */
+cpl_error_code hdrl_imagelist_collapse_mean(const hdrl_imagelist *, 
+        hdrl_image **, cpl_image **) ;
+cpl_error_code hdrl_imagelist_collapse_weighted_mean(const hdrl_imagelist *, 
+        hdrl_image **, cpl_image **) ;
+cpl_error_code hdrl_imagelist_collapse_median(const hdrl_imagelist *, 
+        hdrl_image **, cpl_image **) ;
+cpl_error_code hdrl_imagelist_collapse_sigclip(const hdrl_imagelist *, 
+        double, double, int, hdrl_image **, cpl_image **) ;
+CPL_END_DECLS
+
+#endif 
diff --git a/mosca/libmosca/hdrl_imagelist_basic_body.h b/mosca/libmosca/hdrl_imagelist_basic_body.h
new file mode 100644
index 0000000..730a72b
--- /dev/null
+++ b/mosca/libmosca/hdrl_imagelist_basic_body.h
@@ -0,0 +1,83 @@
+/* $Id: hdrl_imagelist_basic_body.h,v 1.1 2013-10-16 11:31:13 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:13 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#if HDRL_OPERATION == HDRL_IMLIST_BASIC_IMLIST
+
+    cpl_size i;
+
+    /* Check input */
+    cpl_ensure_code(himlist1, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(himlist2, CPL_ERROR_NULL_INPUT);
+
+    /* Check image sets compatibility     */
+    cpl_ensure_code( himlist1->ni == himlist2->ni, CPL_ERROR_ILLEGAL_INPUT);
+
+    /* Loop on the planes and apply the operation */
+    for (i=0; i<himlist1->ni; i++) {
+        const cpl_error_code error_code = 
+            HDRL_OPERATOR(himlist1->images[i], himlist2->images[i]);
+        cpl_ensure_code(!error_code, error_code);
+    }
+
+    return CPL_ERROR_NONE;
+
+#elif HDRL_OPERATION == HDRL_IMLIST_BASIC_IMAGE
+
+    cpl_size i;
+
+    /* Check input */
+    cpl_ensure_code(himlist, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(himg, CPL_ERROR_NULL_INPUT);
+
+    /* Loop on the planes and apply the operation */
+    for (i=0; i<himlist->ni; i++) {
+        const cpl_error_code error_code = HDRL_OPERATOR(himlist->images[i], 
+                himg);
+        cpl_ensure_code(!error_code, error_code);
+    }
+
+    return CPL_ERROR_NONE;
+
+#elif HDRL_OPERATION == HDRL_IMLIST_BASIC_SCALAR
+
+    cpl_size i;
+
+    /* Check input */
+    cpl_ensure_code(himlist, CPL_ERROR_NULL_INPUT);
+
+    /* Loop on the planes and apply the operation */
+    for (i=0; i<himlist->ni; i++) {
+        const cpl_error_code error_code = HDRL_OPERATOR(himlist->images[i],
+                value, error);
+        cpl_ensure_code(!error_code, error_code);
+    }
+
+    return CPL_ERROR_NONE;
+
+
+#endif
+
diff --git a/irplib/irplib_distortion.h b/mosca/libmosca/hdrl_imagelist_defs.h
similarity index 57%
copy from irplib/irplib_distortion.h
copy to mosca/libmosca/hdrl_imagelist_defs.h
index 14bfbe8..9b1cb08 100644
--- a/irplib/irplib_distortion.h
+++ b/mosca/libmosca/hdrl_imagelist_defs.h
@@ -1,7 +1,7 @@
-/* $Id: irplib_distortion.h,v 1.5 2006/07/26 14:47:34 yjung Exp $
+/* $Id: hdrl_imagelist_defs.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
  *
- * This file is part of the irplib package
- * Copyright (C) 2002,2003 European Southern Observatory
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,30 +15,41 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 /*
- * $Author: yjung $
- * $Date: 2006/07/26 14:47:34 $
- * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
  */
 
-#ifndef IRPLIB_DISTORTION_H
-#define IRPLIB_DISTORTION_H
+#ifndef HDRL_IMAGELIST_DEFS_H
+#define HDRL_IMAGELIST_DEFS_H
+
+#ifndef HDRL_USE_PRIVATE
+#error This file is not allowed to be included outside of hdrl
+#endif
 
 /*-----------------------------------------------------------------------------
-   								Includes
+                                   Includes
  -----------------------------------------------------------------------------*/
 
+#include "hdrl_imagelist.h"
+#include "hdrl_image.h"
+
 #include <cpl.h>
 
 /*-----------------------------------------------------------------------------
-   							        Prototypes
+                                   New types
  -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
 
-cpl_polynomial * irplib_distortion_estimate(const cpl_image *, int, int, int, 
-        int, int, int, int, double, int, cpl_apertures **) ;
+struct _hdrl_imagelist_ {
+    cpl_size        ni;
+    hdrl_image  **  images;
+};
+CPL_END_DECLS
 
-#endif
+#endif 
diff --git a/mosca/libmosca/hdrl_imagelist_io.c b/mosca/libmosca/hdrl_imagelist_io.c
new file mode 100644
index 0000000..f39376f
--- /dev/null
+++ b/mosca/libmosca/hdrl_imagelist_io.c
@@ -0,0 +1,567 @@
+/* $Id: hdrl_imagelist_io.c,v 1.1 2013-10-16 11:31:04 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:04 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_image.h"
+#include "hdrl_imagelist.h"
+#include "hdrl_imagelist_defs.h"
+#include "hdrl_imagelist_view.h"
+#include "hdrl_iter.h"
+
+#include <cpl.h>
+#include <assert.h>
+#include <string.h>
+
+/*-----------------------------------------------------------------------------
+                            Static Prototypes
+ -----------------------------------------------------------------------------*/
+
+/* TMP */
+static cpl_error_code hdrl_image_dump_structure(const hdrl_image *, FILE *) ;
+static cpl_error_code hdrl_image_dump_window(const hdrl_image *,
+        cpl_size, cpl_size, cpl_size, cpl_size, FILE *) ;
+/* END TMP */
+/**@{*/
+
+/*-----------------------------------------------------------------------------
+                            Function codes
+ -----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Create an empty imagelist
+  @return   1 newly allocated hdrl_imagelist
+  @see      hdrl_imagelist_set()
+  The returned hdrl_imagelist must be deallocated using hdrl_imagelist_delete()
+ */
+/*----------------------------------------------------------------------------*/
+hdrl_imagelist * hdrl_imagelist_new(void)
+{
+    hdrl_imagelist * h = cpl_calloc(1, sizeof(hdrl_imagelist));
+    return h;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Create an hdrl_imagelist out of 2 cpl_imagelist 
+  @param    imlist    the list of image
+  @param    errlist   the list of errorѕ
+  @return   The new hdrl_imagelist
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+hdrl_imagelist * hdrl_imagelist_create(
+        cpl_imagelist   *   imlist,
+        cpl_imagelist   *   errlist)
+{
+    cpl_ensure(imlist != NULL, CPL_ERROR_NULL_INPUT, NULL);
+    
+    // TODO
+    return hdrl_imagelist_new() ;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Get the number of images in the imagelist
+  @param    himlist     the list of images
+  @return   The number of images or -1 on error
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+cpl_size hdrl_imagelist_get_size(const hdrl_imagelist * himlist)
+{
+    cpl_ensure(himlist != NULL, CPL_ERROR_NULL_INPUT, -1);
+    assert( himlist->ni >= 0 );
+    return himlist->ni;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Get an image from a list of images
+  @param    himlist the image list
+  @param    inum    the image id (from 0 to number of images-1)
+  @return   A pointer to the image or NULL in error case.
+
+  The returned pointer refers to already allocated data.
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+  - CPL_ERROR_ACCESS_OUT_OF_RANGE if inum is bigger thant the list size
+  - CPL_ERROR_ILLEGAL_INPUT if inum is negative
+ */
+/*----------------------------------------------------------------------------*/
+hdrl_image * hdrl_imagelist_get(
+        const hdrl_imagelist  *   himlist,
+        cpl_size                  inum)
+{
+    cpl_ensure(himlist != NULL, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_ensure(inum >= 0, CPL_ERROR_ILLEGAL_INPUT, NULL);
+    cpl_ensure(inum < himlist->ni, CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
+    return himlist->images[inum];
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Get an image from a list of images
+  @param    himlist the image list
+  @param    inum    the image id (from 0 to number of images-1)
+  @return   A pointer to the image or NULL in error case.
+  @see hdrl_imagelist_get
+ */
+/*----------------------------------------------------------------------------*/
+const hdrl_image * hdrl_imagelist_get_const(
+        const hdrl_imagelist    *   himlist,
+        cpl_size                    inum)
+{
+    cpl_ensure(himlist != NULL, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_ensure(inum >= 0, CPL_ERROR_ILLEGAL_INPUT, NULL);
+    cpl_ensure(inum < himlist->ni, CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
+    return himlist->images[inum];
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Insert an image into an imagelist
+  @param    himlist  The imagelist
+  @param    himg     The image to insert
+  @param    pos      The list position (from 0 to number of images)
+  @return   CPL_ERROR_NONE or the relevant #_cpl_error_code_ on error
+
+  It is allowed to specify the position equal to the number of images in the
+  list. This will increment the size of the imagelist.
+
+  No action occurs if an image is inserted more than once into the same
+  position. It is allowed to insert the same image into two different
+  positions in a list.
+
+  The image is inserted at the position pos in the image list. If the image
+  already there is only present in that one location in the list, then the
+  image is deallocated.
+
+  It is not allowed to insert images of different size into a list.
+
+  The added image is owned by the imagelist object, which deallocates it
+  hdrl_imagelist_delete is called. Other option is to use 
+  hdrl_imagelist_unset to recover ownership of the image, in which case 
+  the hdrl_imagelist object is not longer responsible for deallocating it.
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+  - CPL_ERROR_ILLEGAL_INPUT if pos is negative
+  - CPL_ERROR_TYPE_MISMATCH if himg and himlist are of different types
+  - CPL_ERROR_INCOMPATIBLE_INPUT if himg and himlist have different sizes
+  - CPL_ERROR_ACCESS_OUT_OF_RANGE if pos is bigger than the number of
+    images in himlist
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_set(
+        hdrl_imagelist  *   himlist,
+        hdrl_image      *   himg,
+        cpl_size            pos)
+{
+    cpl_ensure_code(himlist,            CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(himg,                CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(pos >= 0,          CPL_ERROR_ILLEGAL_INPUT);
+    cpl_ensure_code(pos <= himlist->ni, CPL_ERROR_ACCESS_OUT_OF_RANGE);
+
+    /* Do nothing if the image is already there */
+    if (pos < himlist->ni && himg == himlist->images[pos]) 
+        return CPL_ERROR_NONE;
+
+    if (pos > 0 || himlist->ni > 1) {
+        /* Require images to have the same size and type */
+        cpl_ensure_code(hdrl_image_get_size_x(himg) ==
+                        hdrl_image_get_size_x(himlist->images[0]),
+                        CPL_ERROR_INCOMPATIBLE_INPUT);
+        cpl_ensure_code(hdrl_image_get_size_y(himg) ==
+                        hdrl_image_get_size_y(himlist->images[0]),
+                        CPL_ERROR_INCOMPATIBLE_INPUT);
+        // TODO : type of hdrl_image ??
+        //cpl_ensure_code(hdrl_image_get_type(himg) ==
+        //                hdrl_image_get_type(himlist->images[0]),
+        //                CPL_ERROR_TYPE_MISMATCH);
+    }
+
+    if (pos == himlist->ni) {
+        himlist->ni++;
+        himlist->images = cpl_realloc(himlist->images,
+                                     (size_t)himlist->ni * sizeof(hdrl_image*));
+    } else {
+        /* Check if the image at the position to be overwritten
+           is present in only one position */
+        int i;
+
+        for (i = 0; i < himlist->ni; i++) {
+            if (i != pos && himlist->images[i] == himlist->images[pos]) break;
+        }
+        if (i == himlist->ni) {
+            /* The image at the position to be overwritten
+               is present in only one position, so delete it */
+            hdrl_image_delete(himlist->images[pos]);
+        }
+    }
+
+    himlist->images[pos] = himg;
+
+    return CPL_ERROR_NONE;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Remove an image from an imagelist
+  @param    himlist The imagelist
+  @param    pos     The list position (from 0 to number of images-1)
+  @return   The pointer to the removed image or NULL in error case
+
+  The specified image is not deallocated, it is simply removed from the
+  list. The pointer to the image is returned to let the user decide to
+  deallocate it or not.
+  Eventually, the image will have to be deallocated with hdrl_image_delete().
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+  - CPL_ERROR_ILLEGAL_INPUT if pos is negative
+  - CPL_ERROR_ACCESS_OUT_OF_RANGE if pos is bigger than the number of
+    images in himlist
+ */
+/*----------------------------------------------------------------------------*/
+hdrl_image * hdrl_imagelist_unset(
+        hdrl_imagelist  *   himlist,
+        cpl_size            pos)
+{
+    hdrl_image  *   out;
+    cpl_size        i;
+
+    cpl_ensure(himlist, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_ensure(pos >= 0, CPL_ERROR_ILLEGAL_INPUT, NULL);
+    cpl_ensure(pos < himlist->ni, CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
+
+    /* Get pointer to image to be removed */
+    out = himlist->images[pos];
+
+    /* Move the following images one position towards zero */
+    for (i=pos + 1; i < himlist->ni; i++) {
+        himlist->images[i-1] = himlist->images[i];
+    }
+
+    /* Decrement of the size */
+    himlist->ni--;
+
+    return out;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Free all memory used by a hdrl_imagelist object including the images
+  @param    himlist    The image list or NULL
+  @return   Nothing
+  @see      hdrl_imagelist_empty(), hdrl_imagelist_unwrap()
+ */
+/*----------------------------------------------------------------------------*/
+void hdrl_imagelist_delete(hdrl_imagelist * himlist)
+{
+    if (himlist != NULL) {
+        hdrl_imagelist_empty(himlist);
+        hdrl_imagelist_unwrap(himlist);
+    }
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Empty an imagelist and deallocate all its images
+  @param    himlist  The image list or NULL
+  @return   Nothing
+  @see  hdrl_imagelist_empty(), hdrl_imagelist_delete()
+  @note If @em himlist is @c NULL nothing is done and no error is set.
+
+  After the call the image list can be populated again. It must eventually
+  be deallocated with a call to hdrl_imagelist_delete().
+ */
+/*----------------------------------------------------------------------------*/
+void hdrl_imagelist_empty(hdrl_imagelist * himlist)
+{
+    if (himlist != NULL) {
+        while (himlist->ni > 0) { /* An iteration may unset more than 1 image */
+            cpl_size i = himlist->ni - 1;
+            hdrl_image * del = hdrl_imagelist_unset(himlist, i);
+            hdrl_image_delete(del);
+
+            /* If this image was inserted more than once into the list,
+               the other insertions must be unset without a delete. */
+            while (--i >= 0) {
+                if (himlist->images[i] == del) {
+                    /* This image was inserted more than once in the list */
+                    (void)hdrl_imagelist_unset(himlist, i);
+                }
+            }
+        }
+    }
+    return;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Duplicate an image list
+  @param    himlist Source image list.
+  @return   1 newly allocated image list, or NULL on error.
+
+  Copy an image list into a new image list object.
+  The returned image list must be deallocated using hdrl_imagelist_delete().
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+hdrl_imagelist * hdrl_imagelist_duplicate(const hdrl_imagelist * himlist)
+{
+    hdrl_imagelist *   out;
+    cpl_size          i;
+
+    cpl_ensure(himlist != NULL, CPL_ERROR_NULL_INPUT, NULL);
+
+    /* Create the new imagelist */
+    out = hdrl_imagelist_new();
+
+    /* Duplicate the images */
+    for (i=0; i<himlist->ni; i++) {
+        hdrl_imagelist_set(out, hdrl_image_duplicate(himlist->images[i]), i);
+    }
+
+    return out;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Determine if an imagelist contains images of equal size and type
+  @param    himlist The imagelist to check
+  @return   Zero if ok, positive if not consistent and negative on error.
+
+  The function returns 1 if the list is empty.
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+ */
+/*----------------------------------------------------------------------------*/
+int hdrl_imagelist_is_consistent(const hdrl_imagelist * himlist)
+{
+    cpl_ensure(himlist != NULL, CPL_ERROR_NULL_INPUT, -1);
+    if (himlist->ni == 0) return 1;
+
+    /* Check the images */
+    // TODO
+    return 0;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Dump structural information of images in an imagelist
+  @param    himlist Imagelist to dump
+  @param    stream  Output stream, accepts @c stdout or @c stderr
+  @return   CPL_ERROR_NONE or the relevant #_cpl_error_code_ on error
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+  - CPL_ERROR_FILE_IO if a write operation fails
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_dump_structure(
+        const hdrl_imagelist    *   himlist,
+        FILE                    *   stream)
+{
+    const char * msg    = "Imagelist with %d image(s)\n";
+    const int    msgmin = (int)strlen(msg) - 5;
+
+    int i;
+
+    cpl_ensure_code(himlist   != NULL, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(stream != NULL, CPL_ERROR_NULL_INPUT);
+
+    cpl_ensure_code( fprintf(stream,  msg, himlist->ni) >= msgmin,
+             CPL_ERROR_FILE_IO );
+
+    for (i = 0; i < himlist -> ni; i++) {
+    const hdrl_image    *   image   = hdrl_imagelist_get_const(himlist, i);
+    const char          *   imsg    = "Image nb %d of %d in imagelist\n";
+    const int               imsgmin = (int)strlen(imsg) - 5;
+
+    cpl_ensure_code( fprintf(stream,  imsg, i, himlist->ni) >= imsgmin,
+             CPL_ERROR_FILE_IO );
+
+    cpl_ensure_code( !hdrl_image_dump_structure(image, stream),
+             cpl_error_get_code() );
+    }
+
+    return CPL_ERROR_NONE;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Dump pixel values of images in a imagelist
+  @param    himlist    Imagelist to dump
+  @param    llx     Specifies the window position
+  @param    lly     Specifies the window position
+  @param    urx     Specifies the window position
+  @param    ury     Specifies the window position
+  @param    stream  Output stream, accepts @c stdout or @c stderr
+  @return   CPL_ERROR_NONE or the relevant #_cpl_error_code_ on error
+
+  Possible #_cpl_error_code_ set in this function:
+  - CPL_ERROR_NULL_INPUT if an input pointer is NULL
+  - CPL_ERROR_FILE_IO if a write operation fails
+  - CPL_ERROR_ACCESS_OUT_OF_RANGE if the defined window is not in the image
+  - CPL_ERROR_ILLEGAL_INPUT if the window definition is wrong (e.g llx > urx)
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_imagelist_dump_window(
+        const hdrl_imagelist    *   himlist,
+        cpl_size                    llx,
+        cpl_size                    lly,
+        cpl_size                    urx, 
+        cpl_size                    ury,
+        FILE *                      stream)
+{
+    cpl_size i;
+
+    cpl_ensure_code(himlist   != NULL, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(stream != NULL, CPL_ERROR_NULL_INPUT);
+
+    for (i = 0; i < himlist -> ni; i++) {
+    const hdrl_image    *   image   = hdrl_imagelist_get_const(himlist, i);
+    const char          *   imsg    = "Image nb %d of %d in imagelist\n";
+    const int               imsgmin = (int)strlen(imsg) - 5;
+
+    cpl_ensure_code( fprintf(stream,  imsg, i, himlist->ni) >= imsgmin,
+             CPL_ERROR_FILE_IO );
+
+    cpl_ensure_code( !hdrl_image_dump_window(image, llx, lly, urx, ury,
+                           stream),
+             cpl_error_get_code() );
+    }
+    return CPL_ERROR_NONE;
+}
+
+/**@}*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @internal
+  @brief    Free memory used by a hdrl_imagelist object, except the images
+  @param    himlist    The image list or NULL
+  @return   Nothing
+  @see hdrl_imagelist_empty()
+  @note The caller must have pointers to all images in the list and is
+        reponsible for their deallocation. If @em himlist is @c NULL nothing is
+        done and no error is set.
+ */
+/*----------------------------------------------------------------------------*/
+void hdrl_imagelist_unwrap(hdrl_imagelist * himlist)
+{
+    if (himlist != NULL) {
+        cpl_free(himlist->images);
+        cpl_free(himlist);
+    }
+    return;
+}
+
+typedef struct {
+    const hdrl_imagelist * hlist;
+    cpl_size ny;
+    cpl_size pos;
+    cpl_size nrows;
+} hdrl_imagelist_row_slices_iter;
+
+static void * hdrl_imagelist_row_slices_next(hdrl_iter_t * it)
+{
+    hdrl_imagelist_row_slices_iter * s = hdrl_iter_state(it);
+    if (s->pos > s->ny) {
+        return NULL;
+    }
+    cpl_size upper = CX_MIN(s->pos + s->nrows - 1, s->ny);
+    hdrl_imagelist * view = hdrl_imagelist_row_view(s->hlist, s->pos, upper);
+    s->pos = upper + 1;
+    return view;
+}
+
+/* TODO, add offset and stride?
+ * make returned view part of iterator state so user does not have to delete it? */
+hdrl_iter_t * hdrl_imagelist_get_iter_row_slices(const hdrl_imagelist * hlist,
+                                                 cpl_size nrows,
+                                                 int flags)
+{
+    cpl_ensure(hlist, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_ensure(hdrl_imagelist_get_size(hlist) > 0,
+               CPL_ERROR_ILLEGAL_INPUT, NULL);
+
+    hdrl_imagelist_row_slices_iter * state = cpl_malloc(sizeof(*state));
+    state->hlist = hlist;
+    state->ny = hdrl_image_get_size_y(hdrl_imagelist_get_const(hlist, 0));
+    state->pos = 1;
+    state->nrows = CX_MAX(nrows, 1);
+
+    return hdrl_iter_init(hdrl_imagelist_row_slices_next, NULL, NULL,
+                          HDRL_ITER_INPUT | HDRL_ITER_IMAGELIST, state);
+}
+
+/* TODO: add destroctor to iterator and don't expose this */
+void hdrl_imagelist_iter_delete(hdrl_iter_t * it)
+{
+    if (!it)
+        return;
+    cpl_free(hdrl_iter_state(it));
+    hdrl_iter_delete(it);
+}
+
+/* TMP */
+static cpl_error_code hdrl_image_dump_structure(
+        const hdrl_image    *   himg,
+        FILE                *   stream)
+{
+    return CPL_ERROR_NONE;
+}
+static cpl_error_code hdrl_image_dump_window(
+        const hdrl_image    *   himg,
+        cpl_size                llx,
+        cpl_size                lly,
+        cpl_size                urx,
+        cpl_size                ury,
+        FILE *                  stream)
+{
+    return CPL_ERROR_NONE;
+}
+/* END TMP */
+
diff --git a/mosca/libmosca/hdrl_imagelist_io.h b/mosca/libmosca/hdrl_imagelist_io.h
new file mode 100644
index 0000000..6b18a5b
--- /dev/null
+++ b/mosca/libmosca/hdrl_imagelist_io.h
@@ -0,0 +1,79 @@
+/* $Id: hdrl_imagelist_io.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_IMAGELIST_IO_H
+#define HDRL_IMAGELIST_IO_H
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_image.h"
+#include "hdrl_imagelist.h"
+#include "hdrl_iter.h"
+
+/*-----------------------------------------------------------------------------
+                            Function prototypes
+ -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+
+/* Imagelist constructors */
+hdrl_imagelist * hdrl_imagelist_new(void) CPL_ATTR_ALLOC;
+hdrl_imagelist * hdrl_imagelist_create(cpl_imagelist *, 
+        cpl_imagelist *) CPL_ATTR_ALLOC;
+
+/* Imagelist accessors */
+cpl_size hdrl_imagelist_get_size(const hdrl_imagelist *);
+hdrl_image * hdrl_imagelist_get(const hdrl_imagelist *, cpl_size);
+const hdrl_image * hdrl_imagelist_get_const(const hdrl_imagelist *, cpl_size);
+cpl_error_code hdrl_imagelist_set(hdrl_imagelist *, hdrl_image *, cpl_size);
+hdrl_image * hdrl_imagelist_unset(hdrl_imagelist *, cpl_size);
+
+/* Imagelist destructor */
+void hdrl_imagelist_delete(hdrl_imagelist *);
+void hdrl_imagelist_empty(hdrl_imagelist *);
+
+/* Others */
+hdrl_imagelist * hdrl_imagelist_duplicate(
+        const hdrl_imagelist *) CPL_ATTR_ALLOC;
+int hdrl_imagelist_is_consistent(const hdrl_imagelist *) ;
+
+cpl_error_code hdrl_imagelist_dump_structure(const hdrl_imagelist *, FILE *);
+cpl_error_code hdrl_imagelist_dump_window(const hdrl_imagelist *,
+                     cpl_size, cpl_size, cpl_size, cpl_size, FILE *);
+
+hdrl_iter_t * hdrl_imagelist_get_iter_row_slices(const hdrl_imagelist * hlist,
+                                                 cpl_size nrows,
+                                                 int flags);
+void hdrl_imagelist_iter_delete(hdrl_iter_t * it); /* TODO remove */
+CPL_END_DECLS
+
+#ifdef HDRL_USE_PRIVATE
+void hdrl_imagelist_unwrap(hdrl_imagelist * himlist);
+#endif
+
+#endif 
diff --git a/mosca/libmosca/hdrl_imagelist_view.c b/mosca/libmosca/hdrl_imagelist_view.c
new file mode 100644
index 0000000..6c9dbcb
--- /dev/null
+++ b/mosca/libmosca/hdrl_imagelist_view.c
@@ -0,0 +1,137 @@
+/* $Id: hdrl_imagelist_view.c,v 1.1 2013-10-16 11:31:04 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:04 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_imagelist.h"
+#include "hdrl_imagelist_defs.h"
+#include "hdrl_imagelist_view.h"
+#include "hdrl_image.h"
+#include "hdrl_image_defs.h"
+
+#include <cpl.h>
+#include <assert.h>
+
+/*-----------------------------------------------------------------------------
+                                   Define
+ -----------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------
+                            Static Prototypes
+ -----------------------------------------------------------------------------*/
+
+static void hdrl_image_view_delete(hdrl_image * view);
+
+/* TODO: internal representation of cpl_image in 6.3 required for mask views,
+   can be removed in 6.4 which has cpl_image_set_bpm */
+struct _cpl_image_ {
+    /* Size of the image in x and y */
+    cpl_size            nx, ny;
+    /* Type of the pixels used for the cpl_image */
+    cpl_type            type;
+    /* Pointer to pixel buffer as a 1d buffer */
+    void            *   pixels;
+    /* Bad Pixels mask */
+    cpl_mask        *   bpm;
+};
+
+
+/**@{*/
+
+/*-----------------------------------------------------------------------------
+                            Function codes
+ -----------------------------------------------------------------------------*/
+
+static hdrl_image *
+hdrl_image_row_view_create(hdrl_image * himg,
+                           cpl_size lly,
+                           cpl_size ury)
+{
+    const cpl_type type = CPL_TYPE_DOUBLE; // TODO cpl_image_get_type(img);
+    const size_t sz = cpl_type_get_sizeof(type);
+    const cpl_size nx = hdrl_image_get_size_x(himg);
+    char * d = cpl_image_get_data(himg->image);
+    char * e = cpl_image_get_data(himg->error);
+    size_t offset = (lly - 1) * nx;
+    cpl_size nny = ury - lly + 1;
+    cpl_image * img = cpl_image_wrap(nx, nny, type,
+                                     d + offset * sz);
+    cpl_image * err = cpl_image_wrap(nx, nny, type,
+                                     e + offset * sz);
+
+    /* we must create a mask in the original in order for views to work */
+    cpl_mask * omask = cpl_image_get_bpm(himg->image);
+    cpl_mask * mask = cpl_mask_wrap(nx, nny, cpl_mask_get_data(omask) + offset);
+    /* TODO replace with 6.4 cpl_image_set_bpm */
+    ((struct _cpl_image_ *)img)->bpm = mask;
+
+    hdrl_image * h = hdrl_image_wrap(img, err);
+    h->fp_free = (hdrl_free*)&hdrl_image_view_delete;
+
+    return h;
+}
+
+static void hdrl_image_view_delete(hdrl_image * view)
+{
+    if (view) {
+        hdrl_image * himg = (hdrl_image*)view;
+        cpl_mask_unwrap(cpl_image_unset_bpm(himg->image));
+        cpl_image_unwrap(himg->image);
+        cpl_image_unwrap(himg->error);
+        hdrl_image_unwrap(himg);
+    }
+}
+
+hdrl_imagelist * hdrl_imagelist_row_view(
+    const hdrl_imagelist * hl,
+    cpl_size lly,
+    cpl_size ury)
+{
+    cpl_ensure(hl, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_ensure(lly > 0, CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
+    size_t n = hdrl_imagelist_get_size(hl);
+    cpl_ensure(n > 0, CPL_ERROR_ILLEGAL_INPUT, NULL);
+    cpl_ensure(ury <= hdrl_image_get_size_y(hdrl_imagelist_get_const(hl, 0)),
+               CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
+    cpl_ensure(ury >= lly, CPL_ERROR_ILLEGAL_INPUT, NULL);
+
+    hdrl_imagelist * viewlist = hdrl_imagelist_new();
+    for (size_t i = 0; i < n; i++) {
+        hdrl_image * img = hdrl_imagelist_get(hl, i);
+        hdrl_image * view = hdrl_image_row_view_create(img, lly, ury);
+        hdrl_imagelist_set(viewlist, view, i);
+    }
+
+    return (hdrl_imagelist*)viewlist;
+}
+/**@}*/
diff --git a/irplib/irplib_distortion.h b/mosca/libmosca/hdrl_imagelist_view.h
similarity index 59%
copy from irplib/irplib_distortion.h
copy to mosca/libmosca/hdrl_imagelist_view.h
index 14bfbe8..a323307 100644
--- a/irplib/irplib_distortion.h
+++ b/mosca/libmosca/hdrl_imagelist_view.h
@@ -1,7 +1,7 @@
-/* $Id: irplib_distortion.h,v 1.5 2006/07/26 14:47:34 yjung Exp $
+/* $Id: hdrl_imagelist_view.h,v 1.2 2013-10-16 16:52:20 cgarcia Exp $
  *
- * This file is part of the irplib package
- * Copyright (C) 2002,2003 European Southern Observatory
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,30 +15,34 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 /*
- * $Author: yjung $
- * $Date: 2006/07/26 14:47:34 $
- * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
  */
 
-#ifndef IRPLIB_DISTORTION_H
-#define IRPLIB_DISTORTION_H
+#ifndef HDRL_IMAGELIST_VIEW_H
+#define HDRL_IMAGELIST_VIEW_H
 
 /*-----------------------------------------------------------------------------
-   								Includes
+                                   Includes
  -----------------------------------------------------------------------------*/
 
-#include <cpl.h>
+#include "hdrl_imagelist.h"
 
 /*-----------------------------------------------------------------------------
-   							        Prototypes
+                            Function prototypes
  -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
 
-cpl_polynomial * irplib_distortion_estimate(const cpl_image *, int, int, int, 
-        int, int, int, int, double, int, cpl_apertures **) ;
+hdrl_imagelist * hdrl_imagelist_row_view(
+    const hdrl_imagelist * hlist,
+    cpl_size lly,
+    cpl_size ury);
+CPL_END_DECLS
 
-#endif
+#endif 
diff --git a/mosca/libmosca/hdrl_iter.c b/mosca/libmosca/hdrl_iter.c
new file mode 100644
index 0000000..c3cf174
--- /dev/null
+++ b/mosca/libmosca/hdrl_iter.c
@@ -0,0 +1,211 @@
+/* $Id: hdrl_iter.c,v 1.2 2013-10-16 11:31:05 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:05 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+-----------------------------------------------------------------------------*/
+
+#include "hdrl_iter.h"
+#include <cpl.h>
+
+/*-----------------------------------------------------------------------------
+                                   Static
+ -----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @defgroup hdrl_iter   ITER Module
+ */
+/*----------------------------------------------------------------------------*/
+
+/**@{*/
+
+
+/* main iterator structure */
+struct hdrl_iter_s {
+    /* returns next value in sequence iterated on (e.g. image, imagelist) */
+    hdrl_iter_next_f * next;
+    /* optional, resets the iteration to the first element */
+    hdrl_iter_reset_f * reset;
+    /* optional, returns length of the iterator */
+    hdrl_iter_length_f * length;
+    /* iterator type */
+    hdrl_iter_type_t type;
+    /* state structure of iterator */
+    void * state;
+};
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief initialize an iterator
+ *
+ * @param next   function pointer returning next value in sequence iterated on
+ * @param reset  function pointer or NULL, reseting iteration to first element
+ * @param length function pointer or NULL, returning length of sequence
+ * @param type   type of iterator
+ * @param state  state structure of iterator
+ *
+ * An iterator iterates on a sequence of data (e.g. imagelist, files on
+ * disk, ...) and returns an element of that sequence on each call to the
+ * next function. When the sequence is exhausted it returns NULL.
+ *
+ * Each member function is called with the iterator as first argument, from
+ * this the state can be received with hdrl_iter_state(it), the state is a
+ * user defined structure typically containing the current position in the
+ * sequence.
+ *
+ * The iterator type defines what kind of data is returned by each next call.
+ * The options are:
+ * HDRL_ITER_INPUT: data provided is input data to be processed, it will be
+                   freed by the caller of next. (FIXME: add flag to not free?)
+ * HDRL_ITER_OUTPUT: data is an empty output buffer for the caller of next
+ *                  to place its results into. Its memory is managed by the
+ *                  iterator.
+ * HDRL_ITER_IMAGE: the return of next is a cpl_image
+ * HDRL_ITER_IMAGELIST: the return of next is a cpl_imagelist
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_iter_t *
+hdrl_iter_init(hdrl_iter_next_f * next,
+                  hdrl_iter_reset_f * reset,
+                  hdrl_iter_length_f * length,
+                  hdrl_iter_type_t type,
+                  void * state)
+{
+    /* exactly one each set */
+    hdrl_iter_type_t inout = (HDRL_ITER_INPUT | HDRL_ITER_OUTPUT);
+    hdrl_iter_type_t rettype = (HDRL_ITER_IMAGE | HDRL_ITER_IMAGELIST);
+    cpl_ensure(((type & inout) == HDRL_ITER_INPUT) ||
+               ((type & inout) == HDRL_ITER_OUTPUT),
+               CPL_ERROR_ILLEGAL_INPUT, NULL);
+    cpl_ensure(((type & rettype) == HDRL_ITER_IMAGE) ||
+               ((type & rettype) == HDRL_ITER_IMAGELIST),
+               CPL_ERROR_ILLEGAL_INPUT, NULL);
+    cpl_ensure(state, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_ensure(next, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_ensure(type != 0, CPL_ERROR_NULL_INPUT, NULL);
+    hdrl_iter_t * it = cpl_malloc(sizeof(*it));
+    it->next = next;
+    it->length = length;
+    it->reset = reset;
+    it->type = type;
+    it->state = state;
+    return it;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief return next element in sequence or NULL if done
+ * @param it iterator
+ * @return object or NULL, type of object depends on iterator type
+ */
+/* ---------------------------------------------------------------------------*/
+void * hdrl_iter_next(hdrl_iter_t * it)
+{
+    return it->next(it);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief reset iterator to beginning of sequence
+ * @param it iterator
+ */
+/* ---------------------------------------------------------------------------*/
+void hdrl_iter_reset(hdrl_iter_t * it)
+{
+    if (it->reset == NULL) {
+        cpl_error_set_message(cpl_func, CPL_ERROR_UNSUPPORTED_MODE,
+                              "Iterator has no reset method");
+        return;
+    }
+    return it->reset(it);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief return length of sequence
+ * @param it iterator
+ * @return length of sequence
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_size hdrl_iter_length(hdrl_iter_t * it)
+{
+    if (it->length == NULL) {
+        cpl_error_set_message(cpl_func, CPL_ERROR_UNSUPPORTED_MODE,
+                              "Iterator has no length method");
+        return -1;
+    }
+    return it->length(it);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief return the state structure of the iterator
+ * @param it iterator
+ * @return state structure
+ */
+/* ---------------------------------------------------------------------------*/
+void * hdrl_iter_state(hdrl_iter_t * it)
+{
+    return it->state;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief delete iterator structure
+ * @param it iterator
+ * @note will not delete the state structure, typically this is called in the
+ *       user iterator destructor
+ */
+/* ---------------------------------------------------------------------------*/
+void hdrl_iter_delete(hdrl_iter_t * it)
+{
+    if (it) {
+        cpl_free(it);
+    }
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief check if iterator has a certain flag
+ * @param it iterator
+ * @param type flag to check
+ * @return true or false depending wheter iterator has flags set
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_boolean hdrl_iter_check(hdrl_iter_t * it, hdrl_iter_type_t type)
+{
+    return (it->type & type) == type;
+}
+
+
+/**@}*/
diff --git a/mosca/libmosca/hdrl_iter.h b/mosca/libmosca/hdrl_iter.h
new file mode 100644
index 0000000..38cec12
--- /dev/null
+++ b/mosca/libmosca/hdrl_iter.h
@@ -0,0 +1,91 @@
+/* $Id: hdrl_iter.h,v 1.3 2013-10-16 16:52:20 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.3 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_ITER_H
+#define HDRL_ITER_H
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include <cpl.h>
+
+
+/*-----------------------------------------------------------------------------
+                                Define
+ -----------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------
+                            Functions prototypes
+ -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+
+typedef enum {
+    /* next returns a imagelist */
+    HDRL_ITER_IMAGELIST = 1<<0,
+    /* next returns a image */
+    HDRL_ITER_IMAGE = 1<<1,
+    /* next returns an initialized input buffer */
+    HDRL_ITER_INPUT = 1<<2,
+    /* next returns an uninitialized output buffer */
+    HDRL_ITER_OUTPUT = 1<<3
+} hdrl_iter_type_t;
+
+typedef struct hdrl_iter_s hdrl_iter_t;
+typedef void * (hdrl_iter_next_f)(hdrl_iter_t * it);
+typedef void (hdrl_iter_reset_f)(hdrl_iter_t * it);
+typedef cpl_size (hdrl_iter_length_f)(hdrl_iter_t * it);
+
+hdrl_iter_t *
+hdrl_iter_init(hdrl_iter_next_f * next,
+                  hdrl_iter_reset_f * reset,
+                  hdrl_iter_length_f * length,
+                  hdrl_iter_type_t type,
+                  void * state);
+void * hdrl_iter_next(hdrl_iter_t * it);
+
+cpl_size hdrl_iter_length(hdrl_iter_t * it);
+
+void hdrl_iter_reset(hdrl_iter_t * it);
+
+void * hdrl_iter_state(hdrl_iter_t * it);
+
+cpl_boolean hdrl_iter_check(hdrl_iter_t * it, hdrl_iter_type_t type);
+
+void hdrl_iter_delete(hdrl_iter_t * it);
+
+/*-----------------------------------------------------------------------------
+             Private declarations - must not be used outside of hdrl
+ -----------------------------------------------------------------------------*/
+
+#ifdef HDRL_USE_PRIVATE
+
+#endif
+
+CPL_END_DECLS
+
+#endif
diff --git a/mosca/libmosca/hdrl_overscan.c b/mosca/libmosca/hdrl_overscan.c
new file mode 100644
index 0000000..f6d5022
--- /dev/null
+++ b/mosca/libmosca/hdrl_overscan.c
@@ -0,0 +1,1282 @@
+/* $Id: hdrl_overscan.c,v 1.1 2013-10-16 11:31:05 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2012,2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:05 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_overscan.h"
+#include "hdrl_sigclip.h"
+#include "hdrl_utils.h"
+#include "hdrl_collapse.h"
+#include <assert.h>
+
+#include <cpl.h>
+#include <math.h>
+#include <string.h>
+
+/*-----------------------------------------------------------------------------
+                                   Static
+ -----------------------------------------------------------------------------*/
+
+static hdrl_overscan_compute_result_t * hdrl_overscan_compute_result_create(
+        void);
+static cpl_error_code hdrl_overscan_compute_result_verify(
+        const hdrl_overscan_compute_result_t *);
+static hdrl_overscan_correct_result_t * hdrl_overscan_correct_result_create(
+        void);
+static cpl_error_code  hdrl_overscan_compute_chi_square(const cpl_image *,
+        const cpl_image *, const double, double *, double *);
+static cpl_error_code hdrl_overscan_reduce_image_to_scalar(
+        hdrl_collapse_imagelist_to_vector_t *, cpl_image *, cpl_image *, 
+        double *, double *, cpl_size *) ;
+
+/*----------------------------------------------------------------------------*/
+/**
+  @defgroup hdrl_overscan   OVERSCAN Module
+  
+  This module allows the computation of the Overscan correction for an 
+  image from a predefined Overscan region in the image. 
+  Several computation methods are available. It also provides the function 
+  that can apply the Overscan correction to the image, using the result of 
+  the Overscan computation.
+ */
+/*----------------------------------------------------------------------------*/
+
+/**@{*/
+
+/*-----------------------------------------------------------------------------
+                        Overscan Parameters Definition
+ -----------------------------------------------------------------------------*/
+typedef struct {
+    HDRL_PARAMETER_HEAD;
+    hdrl_direction              correction_direction; 
+    double                      ccd_ron;
+    int                         box_hsize;
+    hdrl_parameter          *   collapse;
+    hdrl_parameter          *   rect_region;
+} hdrl_overscan_parameter;
+
+/* Parameter type */
+static hdrl_parameter_typeobj hdrl_overscan_parameter_type = {
+    (hdrl_alloc *)&cpl_malloc,                      /* fp_alloc */
+    (hdrl_free *)&cpl_free,                         /* fp_free */
+    (hdrl_free *)&hdrl_overscan_parameter_destroy,  /* fp_destroy */
+    sizeof(hdrl_overscan_parameter),                /* obj_size */
+};
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Creates Overscan Parameters object
+  @param    correction_direction    
+  @param    method
+  @param    ccd_ron
+  @param    box_hsize
+  @param    collapse   
+  @param    rect_region
+  @return   the overscan parameters
+ */
+/*----------------------------------------------------------------------------*/
+hdrl_parameter * hdrl_overscan_parameter_create(
+        hdrl_direction      correction_direction,
+        double              ccd_ron,
+        int                 box_hsize,
+        hdrl_parameter  *   collapse,
+        hdrl_parameter  *   rect_region)
+{
+    hdrl_overscan_parameter * p = (hdrl_overscan_parameter *)
+               hdrl_parameter_new(&hdrl_overscan_parameter_type);
+    p->correction_direction = correction_direction ;
+    p->ccd_ron = ccd_ron ;
+    p->box_hsize = box_hsize ;
+    p->collapse = collapse ;
+    p->rect_region = rect_region ;
+    return (hdrl_parameter *)p;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Destroys Overscan Parameters objects
+  @param    param   The parameter to destroy
+ */
+/*----------------------------------------------------------------------------*/
+void hdrl_overscan_parameter_destroy(void * param) 
+{
+    hdrl_overscan_parameter * p = (hdrl_overscan_parameter *)param ;
+    hdrl_parameter_destroy(p->collapse) ;
+    hdrl_parameter_destroy(p->rect_region) ;
+    hdrl_parameter_delete(p) ;
+    return ;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Update Overscan Parameters object
+  @param    overscan    the overscan parameters to update
+  @param    correction_direction    
+  @param    ccd_ron
+  @param    box_hsize
+  @return   the error code in case of error or CPL_ERROR_NONE
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_overscan_parameter_update(
+        hdrl_parameter  *   overscan,
+        hdrl_direction      correction_direction,
+        double              ccd_ron,
+        int                 box_hsize)
+{
+    hdrl_overscan_parameter * p = (hdrl_overscan_parameter *)overscan ;
+    p->correction_direction = correction_direction ;
+    p->ccd_ron = ccd_ron ;
+    p->box_hsize = box_hsize ;
+    return hdrl_overscan_parameter_verify(overscan, -1, -1);
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Check that the parameter is hdrl_overscan parameter
+  @return   the parameter to check
+ */
+/*----------------------------------------------------------------------------*/
+cpl_boolean hdrl_overscan_parameter_check(const hdrl_parameter * self)
+{
+    return hdrl_parameter_check_type(self, &hdrl_overscan_parameter_type);
+}
+
+/*-----------------------------------------------------------------------------
+                        Overscan Parameters Accessors
+ -----------------------------------------------------------------------------*/
+hdrl_direction hdrl_overscan_parameter_get_correction_direction(
+        const hdrl_parameter * p)
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, HDRL_UNDEFINED_AXIS);
+    return ((hdrl_overscan_parameter *)p)->correction_direction;
+}
+double hdrl_overscan_parameter_get_ccd_ron(
+        const hdrl_parameter * p)
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, -1.0) ;
+    return ((hdrl_overscan_parameter *)p)->ccd_ron ;
+}
+int hdrl_overscan_parameter_get_box_hsize(
+        const hdrl_parameter * p)
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, -1.0) ;
+    return ((hdrl_overscan_parameter *)p)->box_hsize ;
+}
+hdrl_parameter * hdrl_overscan_parameter_get_collapse(
+        const hdrl_parameter * p)
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, NULL) ;
+    return ((hdrl_overscan_parameter *)p)->collapse;
+}
+hdrl_parameter * hdrl_overscan_parameter_get_rect_region(
+        const hdrl_parameter * p)
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, NULL) ;
+    return ((hdrl_overscan_parameter *)p)->rect_region;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Verify basic correctness of the parameters
+  @param    param   Overscan parameters
+  @param    nx      required X region size, set to < 0 to skip check
+  @param    ny      required Y region size, set to < 0 to skip check
+  @return   CPL_ERROR_NONE if everything is ok, an error code otherwise
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_overscan_parameter_verify(
+        const hdrl_parameter    *   param,
+        cpl_size                    nx,
+        cpl_size                    ny) 
+{
+    cpl_size    region_llx, region_lly, region_urx, region_ury ;
+    const hdrl_overscan_parameter * param_loc = 
+        (hdrl_overscan_parameter *)param ;
+
+    cpl_error_ensure(param != NULL, CPL_ERROR_NULL_INPUT,
+            return CPL_ERROR_NULL_INPUT, "NULL Input Parameters");
+    cpl_error_ensure(hdrl_overscan_parameter_check(param),
+            CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+            "Expected Overscan parameter") ;
+    
+    cpl_error_ensure(param_loc->ccd_ron >= 0, CPL_ERROR_ILLEGAL_INPUT,
+            return CPL_ERROR_ILLEGAL_INPUT,
+            "CCD read out noise (%g) must be >= 0", param_loc->ccd_ron);
+    cpl_error_ensure(param_loc->box_hsize >= 0 ||
+                     param_loc->box_hsize == HDRL_OVERSCAN_FULL_BOX,
+                     CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                     "half box size (%d) must be >= 0 or -1", 
+                     param_loc->box_hsize);
+    cpl_error_ensure(param_loc->correction_direction == HDRL_X_AXIS ||
+                     param_loc->correction_direction == HDRL_Y_AXIS,
+                     CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                     "correction_direction must be HDRL_X_AXIS or HDRL_Y_AXIS");
+    
+    if (hdrl_collapse_parameter_is_sigclip(param_loc->collapse)) {
+        cpl_error_ensure(
+                hdrl_collapse_sigclip_parameter_verify(param_loc->collapse)
+                == CPL_ERROR_NONE, CPL_ERROR_ILLEGAL_INPUT,
+                return CPL_ERROR_ILLEGAL_INPUT,
+                "Illegal Collapse Sigclip parameters");
+    } 
+    cpl_error_ensure(
+            hdrl_rect_region_parameter_verify(param_loc->rect_region, -1, -1)
+            == CPL_ERROR_NONE, CPL_ERROR_ILLEGAL_INPUT,
+            return CPL_ERROR_ILLEGAL_INPUT,
+            "Illegal Rect Region parameters");
+
+    cpl_error_ensure(hdrl_collapse_parameter_is_mean(param_loc->collapse) ||
+            hdrl_collapse_parameter_is_median(param_loc->collapse) ||
+            hdrl_collapse_parameter_is_sigclip(param_loc->collapse),
+            CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+            "Only supported methods are MEAN, MEDIAN and SIGCLIP");
+
+    /* The region size must match the source image size in the direction  */
+    /* orthogonal to param_loc->correction_direction */
+    if (param_loc->correction_direction == HDRL_X_AXIS && ny > 0) {
+        region_lly = hdrl_rect_region_get_lly(param_loc->rect_region) ;
+        region_ury = hdrl_rect_region_get_ury(param_loc->rect_region) ;
+        cpl_error_ensure(
+                region_lly==1 && region_ury == ny,
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT, 
+                "Region (%d) and source (%d) sizes must match in the Y dir.",
+                (int)region_ury, (int)ny);
+    }
+    if (param_loc->correction_direction == HDRL_Y_AXIS && nx > 0) {
+        region_llx = hdrl_rect_region_get_llx(param_loc->rect_region) ;
+        region_urx = hdrl_rect_region_get_urx(param_loc->rect_region) ;
+        cpl_error_ensure(
+                region_llx==1 && region_urx == nx,
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT, 
+                "Region (%d) and source (%d) sizes must match in the X dir.",
+                (int)region_urx, (int)nx);
+    }
+    return CPL_ERROR_NONE;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+  @brief Create parameter list for Overscan Computation
+  @param full_prefix    prefix for parameter name
+  @param alias_prefix   prefix for cli alias 
+  @param context        context of parameter
+
+  @see hdrl_rect_region_parameter_create_parlist()
+  @see hdrl_collapse_parameter_create_parlist()
+  Creates a parameterlist with the Overscan Computation parameters
+    full_prefix.correction-direction
+    full_prefix.box-hsize
+    full_prefix.ccd-ron
+    full_prefix.calc-*
+    full_prefix.collpase.*
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_parameterlist * hdrl_overscan_parameter_create_parlist(
+        const char      *   full_prefix,
+        const char      *   alias_prefix,
+        const char      *   context,
+        const char      *   corr_dirr_def,
+        int                 box_hsize_def,
+        double              ccd_ron_def,
+        hdrl_parameter  *   rect_region_def,
+        const char      *   method_def,
+        hdrl_parameter  *   sigclip_def)
+{
+    cpl_ensure(full_prefix && alias_prefix && context, 
+            CPL_ERROR_NULL_INPUT, NULL);
+    const char          *   full_sep = strlen(full_prefix) > 0 ? "." : "";
+    const char          *   alias_sep = strlen(alias_prefix) > 0 ?  "." : "";
+    char                *   name ;
+    char                *   alias_name ;
+    cpl_parameterlist   *   parlist = cpl_parameterlist_new();
+    cpl_parameter       *   p ;
+
+    /* --prefix.correction_direction */
+    name = cpl_sprintf("%s%scorrection-direction", full_prefix, full_sep);
+    p = cpl_parameter_new_enum(name, CPL_TYPE_STRING, "Correction Direction", 
+            context, corr_dirr_def, 2, "alongX", "alongY");
+    cpl_free(name);
+    name = cpl_sprintf("%s%scorrection-direction", alias_prefix, alias_sep);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name);
+    cpl_free(name);
+    cpl_parameterlist_append(parlist, p);
+ 
+    /* --prefix.box-hsize */
+    hdrl_setup_vparameter(parlist, full_prefix, full_sep, "",
+            alias_prefix, alias_sep, "box-hsize", context,
+            "Half size of running box in pixel, -1 for full overscan region", 
+            CPL_TYPE_INT, box_hsize_def) ;
+
+    /* --prefix.ccd-ron */
+    hdrl_setup_vparameter(parlist, full_prefix, full_sep, "",
+            alias_prefix, alias_sep, "ccd-ron", context,
+            "Readout noise in ADU", CPL_TYPE_DOUBLE, ccd_ron_def) ;
+
+    /* Create Overscan Computation Region parameters */
+    /* --prefix.overscan.calc-xxx */
+    cpl_parameterlist * os_comp_reg = hdrl_rect_region_parameter_create_parlist(
+                full_prefix, alias_prefix, "calc-", context, rect_region_def);
+    for (cpl_parameter * p = cpl_parameterlist_get_first(os_comp_reg) ;       
+            p != NULL; p = cpl_parameterlist_get_next(os_comp_reg)) 
+        cpl_parameterlist_append(parlist,cpl_parameter_duplicate(p));
+    cpl_parameterlist_delete(os_comp_reg);
+    
+    /* Overscan Collapsing related parameters */
+    /* --prefix.collapse.xxx */
+    name = cpl_sprintf("%s%scollapse", full_prefix, full_sep);
+    alias_name = cpl_sprintf("%s%scollapse", alias_prefix, alias_sep);
+    cpl_parameterlist * pcollapse = hdrl_collapse_parameter_create_parlist(
+            name, alias_name, context, method_def, sigclip_def) ;
+    cpl_free(name);
+    cpl_free(alias_name);
+    for (cpl_parameter * p = cpl_parameterlist_get_first(pcollapse) ;
+            p != NULL; p = cpl_parameterlist_get_next(pcollapse))
+        cpl_parameterlist_append(parlist,cpl_parameter_duplicate(p));
+    cpl_parameterlist_delete(pcollapse);
+
+    if (cpl_error_get_code()) {
+        cpl_parameterlist_delete(parlist);
+        return NULL;
+    }
+
+    return parlist;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+  @brief Parse parameterlist for Overscan method
+  @param parlist    parameter list to parse
+  @param prefix     prefix of parameter name
+  @return hdrl_parameter 
+  Reads a Parameterlist in order to create overscan parameters.
+  Expects a parameterlist conaining
+    full_prefix.
+
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_parameter * hdrl_overscan_parameter_parse_parlist(
+        cpl_parameterlist   *   parlist,
+        const char          *   prefix)
+{
+    cpl_ensure(prefix && parlist, CPL_ERROR_NULL_INPUT, NULL);
+    const char          *   sep = strlen(prefix) > 0 ? "." : "";
+    cpl_parameter       *   par = NULL;
+    hdrl_direction          corr_dir_param = HDRL_UNDEFINED_AXIS ;
+    const char          *   correction_direction = NULL;
+    int                     box_hsize = 0 ;
+    double                  ccd_ron = 0. ;
+    hdrl_parameter      *   os_collapse_params = NULL;
+    hdrl_parameter      *   os_region_params = NULL;
+    char                *   name ;
+
+    /* --correction-direction */
+    name = cpl_sprintf("%s%scorrection-direction", prefix, sep);
+    par = cpl_parameterlist_find(parlist, name) ;
+    correction_direction = cpl_parameter_get_string(par);
+    if(!strcmp(correction_direction, "alongX")) {
+        corr_dir_param = HDRL_X_AXIS;
+    } else if(!strcmp(correction_direction, "alongY")) {
+        corr_dir_param = HDRL_Y_AXIS;
+    }
+    cpl_free(name) ;
+ 
+    /* --calc-* */
+    os_region_params = hdrl_rect_region_parameter_parse_parlist(parlist,
+            prefix, "calc-");
+
+    /* --box-hsize */
+    name = cpl_sprintf("%s%sbox-hsize", prefix, sep);
+    par=cpl_parameterlist_find(parlist, name);
+    box_hsize = cpl_parameter_get_int(par);
+    cpl_free(name) ;
+
+    /* --ccd-ron */
+    name = cpl_sprintf("%s%sccd-ron", prefix, sep);
+    par=cpl_parameterlist_find(parlist, name);
+    ccd_ron = cpl_parameter_get_double(par);
+    cpl_free(name) ;
+
+    /* --collapse.* */
+    name = cpl_sprintf("%s%scollapse", prefix, sep);
+    os_collapse_params = hdrl_collapse_parameter_parse_parlist(parlist, name) ;
+    cpl_free(name) ;
+
+    return hdrl_overscan_parameter_create(corr_dir_param, ccd_ron,
+            box_hsize, os_collapse_params, os_region_params) ;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Overscan correction computation
+  @param    source  input image containing the overscan region
+  @param    params  structure to control the overscan computation
+  @return  hdrl_overscan_compute_result_t structure containing the result
+  of the computation. It must be de-allocated by the caller using 
+  hdrl_overscan_compute_result_destroy().
+  In case of error, NULL is returned and an error code is set.
+
+  The source image may contain more than the overscan region that is
+  actually needed by the computation.
+
+  params->rect_region defines the overscan region in the source image. The 
+  bad pixels that might be present in the image are taken into account (i.e.
+  excluded from the computations). The size of the region must match the
+  source image size in the direction orthogonal to the direction defined
+  by params->correction_direction
+  
+  params->correction_direction is HDRL_X_AXIS (resp. HDRL_Y_AXIS) if the
+  overscan region has to be collapsed along the X (resp. Y) axis in
+  order to create the 1D resulting images (correction, error, contribution, the
+  \f$\chi^{2}\f$ (chi2) and
+  the reduced \f$\chi^{2}\f$ (red_chi2), additionally sigclip_reject_low and 
+  _high if the sigma-clipping collapsing is used).
+
+  Each pixel of the resulting 1D images are computed from a running
+  sub-window of the overscan region. params->box_hsize defines the half size
+  of the sub-window used for the computation (in the direction orthogonal to 
+  params->correction_direction). If params->box_hsize value is i
+  HDRL_OVERSCAN_FULL_BOX, the calculation is done on the whole overscan 
+  region instead of a running sub-window. In this case, all pixels of the 
+  resulting 1D images will be identical.
+
+  params->collapse methods can be mean, median or sigclip, i.e. the
+  collapse parameter can be created with
+  hdrl_collapse_mean_parameter_create(),
+  hdrl_collapse_median_parameter_create() or 
+  hdrl_collapse_sigclip_parameter_create().
+
+  params->ccd_ron is the CCD read-out noise. The parameter is mandatory,
+  must be strictly non-negative. It is used for the error, the chi2 and the
+  red_chi2 computation.
+
+  In case the sgma-clipping collapsing method is used, a sigma clipping
+  iterative rejection is applied in the overscan sub-window before the 
+  computation of the results.
+
+  The output hdrl_overscan_compute_result_t structure (in the following
+  named 'out') contains the following members:
+
+  out.correction is a 1D CPL image of type double.
+  It contains the overscan correction values computed from the good
+  pixels of the running sub-window (mean, median or mean after rejection, 
+  depending on the used collapsing method)
+
+  out.contribution is a 1D CPL image of type double.
+  It contains the number of good pixels of the input running sub-window
+  for the mean and median methods, and the remaining good pixels after the 
+  rejection for the sigma-clipping method.
+
+  out.error is a 1D CPL image of type double.
+  It contains \f$\frac{ccd\_ron}{\sqrt{contribution}}\f$ for the 
+  mean and sigma-cliping methods.
+  
+  In case the method is the median one, it would contain 
+  \f$\sqrt{\frac{\pi}{2}}\times\frac{ccd\_ron}{\sqrt{contribution}}\f$
+  if contribution is strictly greater than 2 pixels and 
+  \f$\frac{ccd\_ron}{\sqrt{contribution}}\f$ when the contribution is 1 or 
+  2 pixels. 
+  
+  out.chi2 and out.red_chi2 is a 1D CPL image of type double.
+
+  It contains the sum over the good pixels of the region to correct, i.e.
+  of \f$\frac{source - out.correction}{ccd\_ron}^2\f$
+
+  out.sigclip_reject_low and _high are 1D CPL images of type double.
+  They are only returned for the sigma-clipping method. They
+  indicate the final thresholds of the sigma-clipping rejection.
+
+  \image html overscan_computation_algorithm.png
+
+  @see hdrl_kappa_sigma_clip
+  @see hdrl_overscan_correct
+ */
+/*----------------------------------------------------------------------------*/
+hdrl_overscan_compute_result_t * hdrl_overscan_compute(
+        const cpl_image         *   source,
+        const hdrl_parameter    *   params)
+{
+    cpl_image   *   correction_img = NULL;
+    cpl_image   *   correction_err_img = NULL;
+    cpl_image   *   contribution_img = NULL;
+    cpl_image   *   chi2_img = NULL;
+    cpl_image   *   red_chi2_img = NULL;
+    cpl_image   *   sigclip_reject_low = NULL;
+    cpl_image   *   sigclip_reject_high = NULL;
+    hdrl_overscan_compute_result_t * result = NULL;
+    cpl_size        llx = 0;
+    cpl_size        lly = 0;
+    cpl_size        urx = 0;
+    cpl_size        ury = 0;
+    cpl_image   *   overscan_sub_ima = NULL;
+    cpl_image   *   ccd_ron_ima = NULL;
+    cpl_image   *   overscan_ima = NULL;
+    hdrl_collapse_imagelist_to_vector_t * reduce = NULL;
+
+    /* Check Entries */
+    cpl_error_ensure(source != NULL, CPL_ERROR_NULL_INPUT, 
+            return NULL, "NULL input image");
+    cpl_error_ensure(params != NULL, CPL_ERROR_NULL_INPUT, 
+            return NULL, "NULL input parameters");
+    if (hdrl_overscan_parameter_verify(
+                params,
+                cpl_image_get_size_x(source),
+                cpl_image_get_size_y(source)) != CPL_ERROR_NONE)
+        return NULL;
+
+    /* Local Usage Parameters */
+    const hdrl_overscan_parameter * p_loc = 
+        (hdrl_overscan_parameter *)params ;
+    const hdrl_parameter * cpse = p_loc->collapse ;
+    const hdrl_parameter * rr = p_loc->rect_region ;
+
+    /* Switch on the different methods */
+    if (hdrl_collapse_parameter_is_mean(cpse)) {
+        reduce = hdrl_collapse_imagelist_to_vector_mean();
+    } else if (hdrl_collapse_parameter_is_median(cpse)) {
+        reduce = hdrl_collapse_imagelist_to_vector_median();
+    } else if (hdrl_collapse_parameter_is_sigclip(cpse)) {
+        reduce = hdrl_collapse_imagelist_to_vector_sigclip(
+                hdrl_collapse_sigclip_parameter_get_kappa_low(cpse),
+                hdrl_collapse_sigclip_parameter_get_kappa_high(cpse),
+                hdrl_collapse_sigclip_parameter_get_niter(cpse));
+    } else {
+        abort(); /* checked earlier */
+    }
+
+    /* Extract Overscan region */
+    overscan_ima = cpl_image_extract(source, 
+            hdrl_rect_region_get_llx(rr),
+            hdrl_rect_region_get_lly(rr),
+            hdrl_rect_region_get_urx(rr),
+            hdrl_rect_region_get_ury(rr)) ;
+
+    /* Handle Orientation */
+    if(p_loc->correction_direction == HDRL_Y_AXIS) {
+        /* rotate the image 90 degree counter-clockwise */
+        cpl_image_turn(overscan_ima, -1);
+    }
+
+    /* Redefine the boundaries to extracted image */
+    llx = 1;
+    lly = 1;
+    urx = cpl_image_get_size_x(overscan_ima);
+    ury = cpl_image_get_size_y(overscan_ima);
+
+    /* Create output images  */
+    correction_img = cpl_image_new(1, ury, CPL_TYPE_DOUBLE);
+    correction_err_img = cpl_image_new(1, ury, CPL_TYPE_DOUBLE);
+    contribution_img = cpl_image_new(1, ury, CPL_TYPE_DOUBLE);
+    chi2_img = cpl_image_new(1, ury, CPL_TYPE_DOUBLE);
+    red_chi2_img = cpl_image_new(1, ury, CPL_TYPE_DOUBLE);
+
+    if (hdrl_collapse_parameter_is_sigclip(cpse)) {
+        sigclip_reject_low = cpl_image_new(1, ury, CPL_TYPE_DOUBLE);
+        sigclip_reject_high = cpl_image_new(1, ury, CPL_TYPE_DOUBLE);
+    }
+
+    /* Loop along Y direction */
+    /* only 1 iteration if hbox == HDRL_OVERSCAN_FULL_BOX */
+    for (long ipixel = 1;
+         ipixel <= (p_loc->box_hsize == HDRL_OVERSCAN_FULL_BOX ? 1 : ury);
+         ipixel++) {
+        cpl_size contribution;
+        double corr, error, chi2, red_chi2;
+        const int box_hsize = p_loc->box_hsize;
+        const double ccd_ron = p_loc->ccd_ron;
+        cpl_size upperlimit;
+        cpl_size lowerlimit;
+
+        /* define proper extraction limits */
+        if (box_hsize == HDRL_OVERSCAN_FULL_BOX) {
+            /* take full region as box */
+            lowerlimit = lly;
+            upperlimit = ury;
+        }
+        else if (ipixel + box_hsize > ury) {
+            /* Shrink the window if you are approaching the image boundaries */
+            upperlimit = CX_MIN(ipixel + box_hsize, ury);
+            lowerlimit = 2 * ipixel - upperlimit;
+        }
+        else {
+            /* Shrink the window if you are approaching the image boundaries */
+            lowerlimit = CX_MAX(ipixel - box_hsize, 1);
+            upperlimit = 2 * ipixel - lowerlimit;
+        }
+
+        /* Extract the current running sub-window */
+        overscan_sub_ima = cpl_image_extract(overscan_ima, llx, lowerlimit, 
+                urx, upperlimit);
+
+        /* Fill an image with the ccd_ron constant */
+        ccd_ron_ima = cpl_image_duplicate(overscan_sub_ima);
+        cpl_image_multiply_scalar(ccd_ron_ima, 0.0);
+        cpl_image_add_scalar(ccd_ron_ima, ccd_ron);
+
+        /*  due to the extra output we need a new object for each
+         *  sigclip iteration */
+        if (hdrl_collapse_parameter_is_sigclip(cpse)) {
+            hdrl_collapse_imagelist_to_vector_delete(reduce);
+            double kappa = sqrt(
+                log(CX_MAX(hdrl_get_image_good_npix(overscan_sub_ima), 1)));
+            double kappa_low = 
+                hdrl_collapse_sigclip_parameter_get_kappa_low(cpse);
+            double kappa_high =
+                hdrl_collapse_sigclip_parameter_get_kappa_high(cpse);
+            if (kappa_low <= 0)     kappa_low = kappa;
+            if (kappa_high <= 0)    kappa_high = kappa;
+            reduce = hdrl_collapse_imagelist_to_vector_sigclip( 
+                    kappa_low, kappa_high,
+                    hdrl_collapse_sigclip_parameter_get_niter(cpse));
+        }
+        /* Compute the over-scan correction, error, and contribution  */
+        hdrl_overscan_reduce_image_to_scalar(reduce, overscan_sub_ima, 
+                ccd_ron_ima, &corr, &error, &contribution);
+        if (hdrl_collapse_parameter_is_sigclip(cpse)) {
+            hdrl_sigclip_vector_output_t * eout =
+                hdrl_collapse_imagelist_to_vector_sigclip_get_extra_out(reduce);
+            double low = cpl_vector_get(eout->reject_low, 0);
+            double high = cpl_vector_get(eout->reject_high, 0);
+            cpl_image_set(sigclip_reject_low, 1, ipixel, low);
+            cpl_image_set(sigclip_reject_high, 1, ipixel, high);
+        }
+
+        /* Compute the chi2 - Independent of the method */
+        if (contribution == 0){
+            chi2 = NAN;
+            red_chi2 = NAN;
+        }
+        else if (p_loc->box_hsize == HDRL_OVERSCAN_FULL_BOX) {
+            hdrl_overscan_compute_chi_square(overscan_sub_ima,
+                            ccd_ron_ima, corr, &chi2, &red_chi2);
+        }
+        else {
+            /*Calculate the chi2 only in the central slice of the image
+             * TODO very inefficient - restructure */
+            cpl_size nx = cpl_image_get_size_x(overscan_sub_ima);
+            cpl_size ny = cpl_image_get_size_y(overscan_sub_ima);
+
+            cpl_image * overscan_sub_ima_slice =
+                            cpl_image_extract(overscan_sub_ima, 1,
+                                            (cpl_size)((ny+1)/2), nx,
+                                            (cpl_size)((ny+1)/2));
+            cpl_image * ccd_ron_ima_slice =
+                            cpl_image_extract(ccd_ron_ima, 1,
+                                            (cpl_size)((ny+1)/2), nx,
+                                            (cpl_size)((ny+1)/2));
+
+            hdrl_overscan_compute_chi_square(overscan_sub_ima_slice,
+                            ccd_ron_ima_slice, corr, &chi2, &red_chi2);
+
+            cpl_image_delete(overscan_sub_ima_slice);
+            cpl_image_delete(ccd_ron_ima_slice);
+        }
+
+        /* Fill the result images with the current result */
+        cpl_image_set(correction_img,     1, ipixel, corr);
+        cpl_image_set(correction_err_img, 1, ipixel, error);
+        cpl_image_set(contribution_img, 1, ipixel, contribution);
+        cpl_image_set(chi2_img, 1, ipixel, chi2);
+        cpl_image_set(red_chi2_img, 1, ipixel, red_chi2);
+
+        cpl_image_delete(overscan_sub_ima);
+        cpl_image_delete(ccd_ron_ima);
+    }
+
+    hdrl_collapse_imagelist_to_vector_delete(reduce);
+
+    /* broadcast the full box result to the full result row/col */
+    if (p_loc->box_hsize == HDRL_OVERSCAN_FULL_BOX) {
+        double chi2, red_chi2;
+        int rej;
+        const double ccd_ron = p_loc->ccd_ron;
+        const double correction_value =
+                        cpl_image_get(correction_img, 1, 1, &rej);
+        const double correction_err_value =
+                        cpl_image_get(correction_err_img, 1, 1, &rej);
+        const cpl_size contribution_value =
+                        cpl_image_get(contribution_img, 1, 1, &rej);
+
+        cpl_size loopmax = cpl_image_get_size_y(correction_img);
+        for (cpl_size i = 1; i <= loopmax; i++) {
+
+            if(i<loopmax){
+                /*Here we broadcast*/
+                cpl_image_set(correction_img, 1, i + 1, correction_value);
+                cpl_image_set(correction_err_img, 1, i + 1, 
+                        correction_err_value);
+                cpl_image_set(contribution_img, 1, i + 1,contribution_value);
+                if (hdrl_collapse_parameter_is_sigclip(cpse)) {
+                    cpl_image_set(sigclip_reject_low, 1, i + 1,
+                            cpl_image_get(sigclip_reject_low, 1, 1, &rej));
+                    cpl_image_set(sigclip_reject_high, 1, i + 1,
+                            cpl_image_get(sigclip_reject_high, 1, 1, &rej));
+                }
+            }
+            /* Here we do additional chi2 calculation */
+
+            /* Extract the current running sub-window */
+            overscan_sub_ima = cpl_image_extract(overscan_ima, llx, i, urx, i);
+
+            /* Fill an image with the ccd_ron constant */
+            ccd_ron_ima = cpl_image_duplicate(overscan_sub_ima);
+            cpl_image_multiply_scalar(ccd_ron_ima, 0.0);
+            cpl_image_add_scalar(ccd_ron_ima, ccd_ron);
+
+            hdrl_overscan_compute_chi_square(overscan_sub_ima,
+                                             ccd_ron_ima, correction_value,
+                                             &chi2, &red_chi2);
+
+            cpl_image_set(chi2_img, 1, i, chi2);
+            cpl_image_set(red_chi2_img, 1, i, red_chi2);
+            cpl_image_delete(overscan_sub_ima);
+            cpl_image_delete(ccd_ron_ima);
+
+        }
+    }
+
+    cpl_image_delete(overscan_ima);
+    /* flag bad pixels */
+    cpl_image_reject_value(correction_img, CPL_VALUE_NAN);
+    cpl_image_reject_value(correction_err_img, CPL_VALUE_NAN);
+    cpl_image_reject_value(chi2_img, CPL_VALUE_NAN);
+    cpl_image_reject_value(red_chi2_img, CPL_VALUE_NAN);
+    if (hdrl_collapse_parameter_is_sigclip(cpse)) {
+        cpl_image_reject_value(sigclip_reject_low, CPL_VALUE_NAN);
+        cpl_image_reject_value(sigclip_reject_high, CPL_VALUE_NAN);
+    }
+
+    /* Handle Orientation */
+    if(p_loc->correction_direction == HDRL_Y_AXIS) {
+        cpl_image_turn(correction_img, +1);
+        cpl_image_turn(correction_err_img, +1);
+        cpl_image_turn(contribution_img, +1);
+        cpl_image_turn(chi2_img, +1);
+        cpl_image_turn(red_chi2_img, +1);
+        if (hdrl_collapse_parameter_is_sigclip(cpse)) {
+            cpl_image_turn(sigclip_reject_low, +1);
+            cpl_image_turn(sigclip_reject_high, +1);
+        }
+    }
+    
+    /* Create the Overscan resulting structure */
+    result = hdrl_overscan_compute_result_create();
+    result->correction_direction = p_loc->correction_direction;
+    result->correction = correction_img;
+    result->error = correction_err_img;
+    result->contribution = contribution_img;
+    result->chi2 = chi2_img;
+    result->red_chi2 = red_chi2_img;
+    result->sigclip_reject_low = sigclip_reject_low;
+    result->sigclip_reject_high = sigclip_reject_high;
+    return result;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Destroys the Overscan Computation Result Structure
+  @param    result  The computation result structure to destroy
+ */
+/*----------------------------------------------------------------------------*/
+void hdrl_overscan_compute_result_destroy(
+        hdrl_overscan_compute_result_t   *   result)
+{
+    if (result == NULL) return;
+    cpl_image_delete(result->correction);
+    cpl_image_delete(result->error);
+    cpl_image_delete(result->contribution);
+    cpl_image_delete(result->chi2);
+    cpl_image_delete(result->red_chi2);
+    cpl_image_delete(result->sigclip_reject_low);
+    cpl_image_delete(result->sigclip_reject_high);
+    cpl_free(result);
+    return;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Overscan correction 
+  @param    source          Input image that needs to be corrected
+  @param    source_error    Input error image
+  @param    region          Region from source that needs correction
+  @param    os_computation Results of the Overscan computation
+  @return  hdrl_overscan_correct_result_t structure containing the
+  result of the correction. It must be freed with 
+  hdrl_overscan_correct_result_destroy()
+  On error, NULL is returned and an error code is set.
+
+  source is the input CPL image that needs to be corrected. It is a required
+  input.
+  Usually the
+  same image is passed to hdrl_overscan_compute() to compute the overscan
+  correction parameters. In any case, the size of the image must fit
+  with the contents of os_computation.
+
+  source_error is the error used for error propagation. It is a required input.
+
+  region specifies which region of the source image must be corrected.
+  If NULL or invalid, the whole image is corrected.
+
+  os_computation contains all the parameters for the overscan
+  correction. It has been produced by hdrl_overscan_compute().
+
+  The output hdrl_overscan_correct_result_t structure (in the following
+  named 'out') contains the following members:
+
+  out.ima_corrected is a CPL image of type double of the same size as
+  source where all the pixels within the specified region were
+  subtracted using the proper correction obtained in
+  os_computation.correction.
+  The pixels outside the specified region remain unchanged.
+  Pixels for which a overscan value could not be determined (e.g. because all
+  pixels in the overscan region are bad) are set to zero.
+
+  out.error is a CPL image of type double of the same size as
+  source_error where all the pixels within the specified region are set
+  to: sqrt(os_computation.error^2 *  + source_error^2), which is
+  the standard Gaussian error propagation.
+  The pixels outside the specified region remain unchanged.
+  Pixels for which a overscan value could not be determined (e.g. because all
+  pixels in the overscan region are bad) are set to zero.
+ */
+/*----------------------------------------------------------------------------*/
+hdrl_overscan_correct_result_t * hdrl_overscan_correct(
+        const cpl_image                         *   source,
+        const cpl_image                         *   source_error,
+        const hdrl_parameter                    *   region,
+        const hdrl_bitmask_t                        reject_code,
+        const hdrl_overscan_compute_result_t    *   os_computation)
+{
+    const cpl_image *   overscan = os_computation->correction;
+    const cpl_image *   overscan_error = os_computation->error;
+    cpl_size            llx = 0, lly = 0, urx = 0, ury = 0;
+    /* local pointers to source image and its error */
+    cpl_image       *   source_loc = NULL;
+    cpl_image       *   source_error_loc = NULL;
+    long                xsize_overscan = 0;
+    long                ysize_overscan = 0;
+    size_t              nx;
+    cpl_mask        *   orig_mask = NULL;
+
+    /* Check Entries */
+    cpl_error_ensure(source != NULL, CPL_ERROR_NULL_INPUT, 
+            return NULL, "NULL input source image");
+    cpl_error_ensure(source_error != NULL, CPL_ERROR_NULL_INPUT, 
+            return NULL, "NULL input error image");
+
+    cpl_error_ensure(cpl_image_get_size_x(source_error) ==
+                     cpl_image_get_size_x(source),
+                     CPL_ERROR_ILLEGAL_INPUT, return NULL,
+                     "Source image and error do not have the same size");
+    cpl_error_ensure(cpl_image_get_size_y(source_error) ==
+                     cpl_image_get_size_y(source),
+                     CPL_ERROR_ILLEGAL_INPUT, return NULL,
+                     "Source image and error do not have the same size");
+
+    cpl_error_ensure(hdrl_int_is_power_of_two(reject_code),
+                     CPL_ERROR_ILLEGAL_INPUT, return NULL,
+                     "reject_code must be a power of two");
+
+    if (hdrl_overscan_compute_result_verify(os_computation) !=
+            CPL_ERROR_NONE) return NULL;
+
+    /* Initialise Region parameters */
+    if (region != NULL) {
+        if (hdrl_rect_region_parameter_verify(region, 
+                    cpl_image_get_size_x(source),
+                    cpl_image_get_size_y(source)) != CPL_ERROR_NONE)
+            return NULL;
+        llx = hdrl_rect_region_get_llx(region);
+        lly = hdrl_rect_region_get_lly(region);
+        urx = hdrl_rect_region_get_urx(region);
+        ury = hdrl_rect_region_get_ury(region);
+    } else {
+        llx = lly = 1;
+        urx = cpl_image_get_size_x(source);
+        ury = cpl_image_get_size_y(source);
+    }
+
+    source_loc = cpl_image_cast(source, CPL_TYPE_DOUBLE);
+    source_error_loc = cpl_image_cast(source_error, CPL_TYPE_DOUBLE);
+    nx = cpl_image_get_size_x(source_loc);
+    /* store original mask to later separate it from newly created bpms */
+    orig_mask = hdrl_copy_image_mask(source_loc);
+
+    xsize_overscan = cpl_image_get_size_x(overscan);
+    ysize_overscan = cpl_image_get_size_y(overscan);
+    
+    /* Check if the overscan image has an appropriate size */
+    if (os_computation->correction_direction == HDRL_X_AXIS &&
+            cpl_image_get_size_y(source) != ysize_overscan) {
+        cpl_image_delete(source_loc);
+        cpl_image_delete(source_error_loc);
+        cpl_error_set_message(cpl_func,CPL_ERROR_ILLEGAL_INPUT,
+                "Overscan X_AXIS: Y image size does not match overscan Y size");
+        return NULL;
+    }
+    if (os_computation->correction_direction == HDRL_Y_AXIS &&
+            cpl_image_get_size_x(source) != xsize_overscan) {
+        cpl_image_delete(source_loc);
+        cpl_image_delete(source_error_loc);
+        cpl_error_set_message(cpl_func,CPL_ERROR_ILLEGAL_INPUT,
+                "Overscan Y_AXIS: X image size does not match overscan X size");
+        return NULL;
+    }
+
+    {
+        double * psource_loc = cpl_image_get_data_double(source_loc);
+        double * psource_err_loc = cpl_image_get_data_double(source_error_loc);
+        const cpl_mask * bpm = cpl_image_get_bpm_const(overscan);
+        /* os image is one dimensional, so just get the data */
+        const cpl_binary * rej = bpm ?  cpl_mask_get_data_const(bpm) : NULL;
+        const double * pos_val = cpl_image_get_data_double_const(overscan);
+        const double * pos_e = cpl_image_get_data_double_const(overscan_error);
+        cpl_ensure(cpl_image_get_size_x(overscan) == 1 ||
+                   cpl_image_get_size_y(overscan) == 1,
+                   CPL_ERROR_INCOMPATIBLE_INPUT, NULL);
+
+        /* corrects extracted image for over-scan value, compute associated
+         * error, flag bad pixels */
+        for (long j = lly - 1; j < ury; j++) {
+            for (long i = llx - 1; i < urx; i++) {
+                const size_t idx =
+                    os_computation->correction_direction == HDRL_X_AXIS ? j : i;
+                double ima_e = psource_err_loc[j * nx + i];
+
+                if (rej && rej[idx]) {
+                    /* set to zero as per requirements */
+                    cpl_image_reject(source_loc, i + 1, j + 1);
+                    psource_loc[j * nx + i] = 0;
+                    psource_err_loc[j * nx + i] = 0;
+                }
+                else {
+                    psource_loc[j * nx + i] -= pos_val[idx];
+                    psource_err_loc[j * nx + i] =
+                        sqrt(pos_e[idx] * pos_e[idx] + ima_e * ima_e);
+                }
+
+            }
+        }
+    }
+
+    {
+        hdrl_overscan_correct_result_t * res;
+        cpl_mask * new_mask = hdrl_copy_image_mask(source_loc);
+        cpl_image * badmask = cpl_image_new(cpl_image_get_size_x(source_loc),
+                                            cpl_image_get_size_y(source_loc),
+                                            CPL_TYPE_INT);
+        /* get the new bad pixels */
+        cpl_mask_xor(new_mask, orig_mask);
+        /* fill them with the code */
+        cpl_image_reject_from_mask(badmask, new_mask);
+        cpl_image_fill_rejected(badmask, reject_code);
+
+        cpl_mask_delete(new_mask);
+        cpl_mask_delete(orig_mask);
+
+        /* Create, fill and return the returned structure */
+        res = hdrl_overscan_correct_result_create();
+        res->ima_corrected = source_loc;
+        res->error = source_error_loc;
+        res->badmask = badmask;
+        return res;
+    }
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Destroys the Overscan Correction Result Structure
+  @param    result  The correction result structure to destroy
+ */
+/*----------------------------------------------------------------------------*/
+void hdrl_overscan_correct_result_destroy(
+        hdrl_overscan_correct_result_t   *   result)
+{
+    if (result == NULL) return; 
+    cpl_image_delete(result->ima_corrected);
+    cpl_image_delete(result->error);
+    cpl_image_delete(result->badmask);
+    cpl_free(result);
+    return;
+}
+
+/**@}*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Creates Overscan Computation Result Structure 
+  @return   A structure that needs to be de-allocated with
+  hdrl_overscan_compute_result_destroy()
+  @see hdrl_overscan_compute_result_destroy()
+ */
+/*----------------------------------------------------------------------------*/
+static hdrl_overscan_compute_result_t * hdrl_overscan_compute_result_create(
+        void)
+{
+    hdrl_overscan_compute_result_t * self = 
+        cpl_malloc(sizeof(hdrl_overscan_compute_result_t));
+
+    self->correction_direction = HDRL_UNDEFINED_AXIS;
+    self->correction = NULL;
+    self->error = NULL;
+    self->contribution = NULL;
+    self->chi2 = NULL;
+    self->red_chi2 = NULL;
+    self->sigclip_reject_low = NULL;
+    self->sigclip_reject_high = NULL;
+    return self;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Verify basic correctness of the result structure
+  @param    result      Overscan result structure
+  @return   CPL_ERROR_NONE if eveything is ok, an error code otherwise
+ */
+/*----------------------------------------------------------------------------*/
+static cpl_error_code hdrl_overscan_compute_result_verify(
+        const hdrl_overscan_compute_result_t * result)
+{
+    cpl_error_ensure(result != NULL, CPL_ERROR_NULL_INPUT,
+            return CPL_ERROR_NULL_INPUT,
+            "NULL input overscan result structure");
+    cpl_error_ensure(result->correction_direction == HDRL_X_AXIS ||
+            result->correction_direction == HDRL_Y_AXIS, 
+            CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+            "The specified collapse direction is unknown");
+
+    if (result->correction_direction == HDRL_X_AXIS) {
+        cpl_error_ensure(cpl_image_get_size_x(result->correction) == 1, 
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                "The Correction image X size should be 1");
+        cpl_error_ensure(cpl_image_get_size_x(result->error) == 1, 
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                "The Error image X size should be 1");
+        cpl_error_ensure(cpl_image_get_size_x(result->contribution) == 1, 
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                "The Contribution image X size should be 1");
+        cpl_error_ensure(cpl_image_get_size_x(result->chi2) == 1,
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                "The Chi Square image X size should be 1");
+        cpl_error_ensure(cpl_image_get_size_x(result->red_chi2) == 1, 
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                "The reduced Chi Square image X size should be 1");
+        if (result->sigclip_reject_low != NULL) {
+            cpl_error_ensure(cpl_image_get_size_x(result->sigclip_reject_low) 
+                    == 1, 
+                    CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                    "The SIGCLIP low rejection image X size should be 1");
+
+        }
+        if (result->sigclip_reject_high != NULL) {
+            cpl_error_ensure(cpl_image_get_size_x(result->sigclip_reject_high) 
+                    == 1, 
+                    CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                    "The SIGCLIP high rejection image X size should be 1");
+        }
+    }
+    else if (result->correction_direction == HDRL_Y_AXIS) {
+        cpl_error_ensure(cpl_image_get_size_y(result->correction) == 1, 
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                "The Correction image Y size should be 1");
+        cpl_error_ensure(cpl_image_get_size_y(result->error) == 1, 
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                "The Error image Y size should be 1");
+        cpl_error_ensure(cpl_image_get_size_y(result->contribution) == 1, 
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                "The Contribution image Y size should be 1");
+        cpl_error_ensure(cpl_image_get_size_y(result->chi2) == 1,
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                "The Chi Square image Y size should be 1");
+        cpl_error_ensure(cpl_image_get_size_y(result->red_chi2) == 1, 
+                CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                "The reduced Chi Square image Y size should be 1");
+        if (result->sigclip_reject_low != NULL) {
+            cpl_error_ensure(cpl_image_get_size_y(result->sigclip_reject_low) 
+                    == 1, 
+                    CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                    "The SIGCLIP low rejection image Y size should be 1");
+
+        }
+        if (result->sigclip_reject_high != NULL) {
+            cpl_error_ensure(cpl_image_get_size_y(result->sigclip_reject_high) 
+                    == 1, 
+                    CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+                    "The SIGCLIP high rejection image Y size should be 1");
+        }
+    }
+    else return cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
+            "correction_direction must be HDRL_X_AXIS or HDRL_Y_AXIS");
+    return CPL_ERROR_NONE;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Creates Overscan Correction result structure
+  @return   A structure holding the Overscan Correction Results, that
+  needs to be de-allocated with hdrl_overscan_correct_result_destroy()
+  @see hdrl_overscan_correct_result_destroy() 
+ */
+/*----------------------------------------------------------------------------*/
+static hdrl_overscan_correct_result_t * hdrl_overscan_correct_result_create(
+        void)
+{
+    hdrl_overscan_correct_result_t * self = 
+        cpl_malloc(sizeof(hdrl_overscan_correct_result_t));
+    self->ima_corrected = NULL;
+    self->error = NULL;
+    self->badmask = NULL;
+    return self;
+}
+/*----------------------------------------------------------------------------*/
+/**
+  @brief Calculate chi square as well as the reduced chi square
+  @param data          Measured data image
+  @param error         Error of measured data image
+  @param expect        Expected value of data
+  @param[out] chi2     Weighted sum of squared deviations
+  @param[out] red_chi2 Reduced weighted sum of squared deviations
+  @return CPL_ERROR_NONE if everything is ok, an error code otherwise
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code  hdrl_overscan_compute_chi_square(
+        const cpl_image *   data,
+        const cpl_image *   error,
+        const double        expect,
+        double          *   chi2,
+        double          *   red_chi2)
+{
+    cpl_image * s;
+    cpl_size nrej, nerej;
+    cpl_image * e = NULL;
+    cpl_size nepix = 0;
+    cpl_size npix = 0;
+
+    nrej = cpl_image_count_rejected(data);
+    npix = cpl_image_get_size_x(data) * cpl_image_get_size_y(data);
+
+    if (nrej == npix) {
+        *chi2 = NAN;
+        *red_chi2 = NAN;
+        return CPL_ERROR_NONE;
+    }
+
+    e = cpl_image_duplicate(error);
+    nepix = cpl_image_get_size_x(e) * cpl_image_get_size_y(e);
+
+    /*TODO handle pre-existing Zero's marked as bad */
+    /* check if error image contains zeros */
+    cpl_image_accept_all(e);
+    cpl_image_reject_value(e, CPL_VALUE_ZERO);
+    nerej = cpl_image_count_rejected(e);
+    /* all errors zero allowed */
+    if (nerej == nepix) {
+        cpl_image_delete(e);
+        *chi2 = NAN;
+        *red_chi2 = NAN;
+        return CPL_ERROR_NONE;
+    }
+    /* partial zero errors make no sense */
+    else if (nerej != 0) {
+        cpl_image_delete(e);
+        cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
+                              "Error image can't contain zeros");
+        *chi2 = NAN;
+        *red_chi2 = NAN;
+        return CPL_ERROR_ILLEGAL_INPUT;
+    }
+
+    s = cpl_image_duplicate(data);
+    /* computes chi squared defined as:
+     * \Sum_i[ (x_i - expect)^2 / sigma_i^2 ] */
+    cpl_image_subtract_scalar(s, expect);
+    cpl_image_divide(s, e);
+    *chi2 = cpl_image_get_sqflux(s); /* = squared sum */
+    *red_chi2 = *chi2 / npix; /* reduced chi2 */
+    cpl_image_delete(s);
+    cpl_image_delete(e);
+    return CPL_ERROR_NONE;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @internal
+  @brief reduce image to scalar
+  @param red          imagelist to vector reduction method
+  @param data         image to reduce
+  @param data_error   error of image
+  @param result       data reduction result
+  @param error        propagated error
+  @param contribution number of pixels that contributed
+  @return A CPL error code
+
+  this is just a single image wrapper over hdrl_collapse_imagelist_to_vector
+ */
+/* ---------------------------------------------------------------------------*/
+static cpl_error_code hdrl_overscan_reduce_image_to_scalar(
+        hdrl_collapse_imagelist_to_vector_t *   red,
+        cpl_image                           *   data,
+        cpl_image                           *   data_error,
+        double                              *   result, 
+        double                              *   error,
+        cpl_size                            *   contribution)
+{
+    cpl_imagelist * ld = cpl_imagelist_new();
+    cpl_imagelist * le = cpl_imagelist_new();
+    cpl_vector * od, * oe;
+    cpl_array * oc;
+    cpl_error_code fail;
+    cpl_imagelist_set(ld, data, 0);
+    cpl_imagelist_set(le, data_error, 0);
+
+
+    fail = hdrl_collapse_imagelist_to_vector_call(red, ld, le, &od, &oe, &oc);
+    cpl_imagelist_unwrap(ld);
+    cpl_imagelist_unwrap(le);
+
+    if (fail == CPL_ERROR_NONE) {
+        *result = cpl_vector_get(od, 0);
+        *error = cpl_vector_get(oe, 0);
+        *contribution = cpl_array_get_int(oc, 0, NULL);
+    }
+    else {
+        *result = NAN;
+        *error = NAN;
+        *contribution = 0;
+    }
+
+    cpl_vector_delete(od);
+    cpl_vector_delete(oe);
+    cpl_array_delete(oc);
+
+    return fail;
+}
diff --git a/mosca/libmosca/hdrl_overscan.h b/mosca/libmosca/hdrl_overscan.h
new file mode 100644
index 0000000..508db69
--- /dev/null
+++ b/mosca/libmosca/hdrl_overscan.h
@@ -0,0 +1,145 @@
+/* $Id: hdrl_overscan.h,v 1.3 2013-10-16 17:48:58 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2012,2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 17:48:58 $
+ * $Revision: 1.3 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_OVERSCAN_H
+#define HDRL_OVERSCAN_H
+
+/*-----------------------------------------------------------------------------
+                                Include
+ -----------------------------------------------------------------------------*/
+
+#include <hdrl_utils.h>
+
+#include <cpl.h>
+
+/*-----------------------------------------------------------------------------
+                                Define
+ -----------------------------------------------------------------------------*/
+
+#define HDRL_OVERSCAN_FULL_BOX -1
+
+/*----------------------------------------------------------------------------*/
+/**
+  @struct hdrl_overscan_compute_result_s
+  @brief Contains the Overscan Computation results
+ */
+/*----------------------------------------------------------------------------*/
+struct hdrl_overscan_compute_result_s
+{
+    /** The direction in which the image were collapsed in the computation */
+    hdrl_direction      correction_direction;     
+    /** The overscan correction as a 1D double image */
+    cpl_image       *   correction;
+    /** The error as a 1D double image */
+    cpl_image       *   error;
+    /** The number of good pixels that contributed as a 1D double image */
+    cpl_image       *   contribution;
+    /** The \f$\chi^{2}\f$ as a 1D double image */
+    cpl_image       *   chi2;
+    /** The reduced \f$\chi^{2}\f$ as a 1D double image */
+    cpl_image       *   red_chi2;
+    /** The low threshold below which the pixels are rejected 
+        as a 1D double image. Only for sigma-clipping collapsing method */
+    cpl_image       *   sigclip_reject_low;
+    /** The high threshold above which the pixels are rejected 
+        as a 1D double image. Only for sigma-clipping collapsing method */
+    cpl_image       *   sigclip_reject_high;
+};
+typedef struct hdrl_overscan_compute_result_s hdrl_overscan_compute_result_t;
+
+/*----------------------------------------------------------------------------*/
+/**
+  @struct hdrl_overscan_correct_result_s
+  @brief Contains the Overscan Correction results
+ */
+/*----------------------------------------------------------------------------*/
+struct hdrl_overscan_correct_result_s
+{
+    /** The Overscan corrected image */
+    cpl_image   *   ima_corrected;
+    /** The propagated error */
+    cpl_image   *   error;
+    /** Pixels marked as bad by algorithm, encoded by user choice */
+    cpl_image   *   badmask;
+};
+typedef struct hdrl_overscan_correct_result_s hdrl_overscan_correct_result_t;
+
+/*-----------------------------------------------------------------------------
+                            Functions prototypes
+ -----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------
+                           Overscan Parameters
+  ----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+
+hdrl_parameter * hdrl_overscan_parameter_create(hdrl_direction, double, int, 
+        hdrl_parameter *, hdrl_parameter *) ;
+void hdrl_overscan_parameter_destroy(void *) ;
+cpl_error_code hdrl_overscan_parameter_update(hdrl_parameter *, hdrl_direction,
+        double, int) ;
+cpl_boolean hdrl_overscan_parameter_check(const hdrl_parameter *) ;
+hdrl_direction hdrl_overscan_parameter_get_correction_direction(
+        const hdrl_parameter *) ;
+double hdrl_overscan_parameter_get_ccd_ron(
+        const hdrl_parameter *) ;
+int hdrl_overscan_parameter_get_box_hsize(
+        const hdrl_parameter *) ;
+hdrl_parameter * hdrl_overscan_parameter_get_collapse(
+        const hdrl_parameter *) ;
+hdrl_parameter * hdrl_overscan_parameter_get_rect_region(
+        const hdrl_parameter *) ;
+cpl_error_code hdrl_overscan_parameter_verify(const hdrl_parameter *,
+        cpl_size, cpl_size) ;
+
+hdrl_parameter * hdrl_overscan_parameter_parse_parlist(
+        cpl_parameterlist *, const char *) ;
+cpl_parameterlist * hdrl_overscan_parameter_create_parlist(const char *, 
+        const char *, const char *, const char *, int, double,
+        hdrl_parameter *, const char *, hdrl_parameter *) ;
+
+/*----------------------------------------------------------------------------
+                           Overscan Computation
+  ----------------------------------------------------------------------------*/
+hdrl_overscan_compute_result_t * hdrl_overscan_compute(
+        const cpl_image         *   source,
+        const hdrl_parameter    *   params) ;
+void hdrl_overscan_compute_result_destroy(hdrl_overscan_compute_result_t *) ;
+
+/*----------------------------------------------------------------------------
+                           Overscan Correction
+  ----------------------------------------------------------------------------*/
+hdrl_overscan_correct_result_t * hdrl_overscan_correct(
+        const cpl_image                         *   source,
+        const cpl_image                         *   source_error,
+        const hdrl_parameter                    *   region,
+        const hdrl_bitmask_t                        reject_code,
+        const hdrl_overscan_compute_result_t    *   os_computation) ;
+void hdrl_overscan_correct_result_destroy(hdrl_overscan_correct_result_t *) ;
+CPL_END_DECLS
+
+#endif
diff --git a/mosca/libmosca/hdrl_parameter.c b/mosca/libmosca/hdrl_parameter.c
new file mode 100644
index 0000000..ef4d1ab
--- /dev/null
+++ b/mosca/libmosca/hdrl_parameter.c
@@ -0,0 +1,161 @@
+/* $Id: hdrl_parameter.c,v 1.1 2013-10-16 11:31:06 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:06 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_parameter.h"
+#include <cpl.h>
+
+#include <stddef.h>
+#include <assert.h>
+
+/*----------------------------------------------------------------------------*/
+/**
+ * @defgroup hdrl_parameter   hdrl parameter object
+ *
+ * see hdrl_parameter-test.c for an example usage
+ */
+/*----------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------
+                                   Functions
+ -----------------------------------------------------------------------------*/
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @internal
+ * @brief base class of hdrl_parameter
+ *
+ * needs to be the first element of each child class structure, e.g:
+ *   struct {
+ *     HDRL_PARAMETER_HEAD;
+ *     int val;
+ *   } child_class;
+ */
+/* ---------------------------------------------------------------------------*/
+struct _hdrl_parameter_  {
+    hdrl_parameter_typeobj * base;
+};
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @internal
+ * @brief create new parameter of certain type
+ *
+ * @param type  type object which defines the type of the parameter
+ *
+ * @return hdrl_parameter of type 'typeobj'
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_parameter * hdrl_parameter_new(hdrl_parameter_typeobj * typeobj)
+{
+    hdrl_parameter * p = typeobj->fp_alloc(typeobj->obj_size);
+    p->base = typeobj;
+    return p;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief shallow delete of a parameter
+ *
+ * @param obj parameter to delete, may be NULL
+ *
+ * will not delete sub parameters
+ * @see hdrl_parameter_destroy
+ */
+/* ---------------------------------------------------------------------------*/
+void hdrl_parameter_delete(hdrl_parameter * obj)
+{
+    if (obj) {
+        obj->base->fp_free(obj);
+    }
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief deep delete of a parameter
+ *
+ * @param obj parameter to delete, may be NULL
+ *
+ * deletes all sub parameters via the registered deep destructor
+ */
+/* ---------------------------------------------------------------------------*/
+void hdrl_parameter_destroy(hdrl_parameter * obj)
+{
+    if (obj == NULL) {
+        return;
+    }
+
+    if (obj->base->fp_destroy) {
+        obj->base->fp_destroy(obj);
+    }
+    else {
+        obj->base->fp_free(obj);
+    }
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @internal
+ * @brief check if a parameter is of a certain type
+ *
+ * @param self  parameter to check
+ * @param type  type required
+ *
+ * @return true iff parameter is of type "type"
+ */
+/* ---------------------------------------------------------------------------*/
+int hdrl_parameter_check_type(const hdrl_parameter * self,
+                              const hdrl_parameter_typeobj * type)
+{
+    return self ? self->base == type : 0 ;
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @internal
+ * @brief check if a parameter is of a certain type
+ *
+ * @param self  parameter to check
+ * @param type  type required
+ *
+ * @return true iff parameter is of type "type"
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_parameter_typeobj * hdrl_parameter_get_type(const hdrl_parameter * self)
+{
+    return self->base;
+}
diff --git a/mosca/libmosca/hdrl_parameter.h b/mosca/libmosca/hdrl_parameter.h
new file mode 100644
index 0000000..4b5e367
--- /dev/null
+++ b/mosca/libmosca/hdrl_parameter.h
@@ -0,0 +1,110 @@
+/* $Id: hdrl_parameter.h,v 1.1 2013-10-16 11:31:14 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:14 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_PARAMETER_H
+#define HDRL_PARAMETER_H
+
+/*-----------------------------------------------------------------------------
+                                   New types
+ -----------------------------------------------------------------------------*/
+
+typedef struct _hdrl_parameter_ hdrl_parameter;
+
+/*----------------------------------------------------------------------------*/
+/**
+ * @defgroup hdrl_parameter   hdrl parameter object
+ *
+ * see hdrl_parameter-test.c for an example usage
+ */
+/*----------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+ -----------------------------------------------------------------------------*/
+
+#include "hdrl_types.h"
+
+/*-----------------------------------------------------------------------------
+                                   Functions
+ -----------------------------------------------------------------------------*/
+
+void hdrl_parameter_delete(hdrl_parameter * obj);
+void hdrl_parameter_destroy(hdrl_parameter * obj);
+
+/* all following functions are private and not to be used in pipelines */
+#ifdef HDRL_USE_PRIVATE
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief required first member of each parameter object
+ *
+ *   struct {
+ *     HDRL_PARAMETER_HEAD;
+ *     int val;
+ *   } my_parameter;
+ */
+/* ---------------------------------------------------------------------------*/
+#define HDRL_PARAMETER_HEAD void * base
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @internal
+ * @brief Base type object / object metadata
+ *
+ * Defines required object meta data of the parameter.
+ * Each object contains a reference to one of these so it can determine which
+ * functions to call on certain operations.
+ * Usually a single statically allocated type object shared between multiple
+ * hdrl_parameter objects of the same type.
+ * @see hdrl_parameter_new
+ */
+/* ---------------------------------------------------------------------------*/
+typedef struct {
+    /* base parameter structure allocation, e.g. cpl_malloc */
+    hdrl_alloc * fp_alloc;
+    /* shallow destructor of the parameter */
+    hdrl_free  * fp_free;
+    /* deep destructor of the parameter, deletes all childs
+     * may be NULL in which case fp_free is used */
+    hdrl_free  * fp_destroy;
+    /* size of the base parameter structure, argument to fp_alloc */
+    size_t obj_size;
+} hdrl_parameter_typeobj;
+
+
+/* empty parameter, e.g. for collapse_mean */
+typedef struct {
+    HDRL_PARAMETER_HEAD;
+} hdrl_parameter_empty;
+
+hdrl_parameter * hdrl_parameter_new(hdrl_parameter_typeobj * typeobj);
+hdrl_parameter_typeobj * hdrl_parameter_get_type(const hdrl_parameter * self);
+int hdrl_parameter_check_type(const hdrl_parameter * self,
+                              const hdrl_parameter_typeobj * type);
+
+#endif
+
+#endif
diff --git a/mosca/libmosca/hdrl_prototyping.c b/mosca/libmosca/hdrl_prototyping.c
new file mode 100644
index 0000000..28c2405
--- /dev/null
+++ b/mosca/libmosca/hdrl_prototyping.c
@@ -0,0 +1,1287 @@
+/*
+ * hdrl_prototyping.c
+ *
+ *  Created on: Aug 29, 2013
+ *      Author: agabasch
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <errno.h>
+#include <complex.h>
+#include <hdrl_prototyping.h>
+
+/*-----------------------------------------------------------------------------
+                                Defines
+ -----------------------------------------------------------------------------*/
+#define freeimage(_p) if (_p != NULL) {cpl_image_delete(_p); _p = NULL;}
+
+
+/*-----------------------------------------------------------------------------
+                                   Static
+ -----------------------------------------------------------------------------*/
+
+
+static cpl_image *hdrl_mirror_edges(cpl_image *image, int dx, int dy);
+static cpl_image *hdrl_gen_lowpass(int xs, int ys, double sigma_x,
+                                   double sigma_y);
+
+
+
+/**      Function to calculate the low spatial frequency
+*
+* @brief      Get low spatial frequency componenets from an image using the FFTW
+* @param    ima         image
+* @param    gausfilt   Gaussian Fourier filter size
+* @param    mirrorx    for mirroring edges (ocfft continuity)
+* @param    mirrory    for mirroring edges (ocfft continuity)
+*
+* @return       1 newly allocated image.
+*/
+cpl_image * hdrl_get_spatial_freq(cpl_image *ima, double gausfilt, int mirrorx,
+                                  int mirrory){
+
+    int xsize=0, ysize=0;
+
+    double sigma_x = 0.;
+    double sigma_y = 0.;
+
+    cpl_image *clean_flat=NULL;
+    cpl_image *eflat=NULL;
+    cpl_image *eflat_complex=NULL;
+    cpl_image *eflat_real=NULL;
+
+    cpl_image *filter_image=NULL;
+    cpl_image *filter_image_complex=NULL;
+    cpl_image *flat_real;
+
+
+    /*Clean flat from bad pixels if bpm exists*/
+    //clean_flat = cpl_image_duplicate(flat);
+
+    /*The algorithm uses float, so we have to cast here or change the algo...*/
+    cpl_type ima_type = cpl_image_get_type(ima);
+
+    clean_flat = cpl_image_cast(ima, CPL_TYPE_FLOAT);
+        cpl_detector_interpolate_rejected(clean_flat);
+
+
+    /* Expand the flat image using the mirror edges function */
+    eflat = hdrl_mirror_edges(clean_flat, mirrorx, mirrory);
+    if(eflat == NULL){
+        freeimage(clean_flat);
+        cpl_msg_error(cpl_func,"Filter image is NULL");
+        return NULL;
+    }
+
+    freeimage(clean_flat);
+
+    xsize = cpl_image_get_size_x(eflat);
+    ysize = cpl_image_get_size_y(eflat);
+
+    sigma_x = gausfilt;
+    sigma_y = (double)(sigma_x * ysize) / xsize;
+
+
+    /* Generate a lowpass filter to be used in the FFT convolution */
+    filter_image = hdrl_gen_lowpass(xsize, ysize, sigma_x, sigma_y);
+    if(filter_image == NULL){
+        cpl_msg_error(cpl_func,"Filter image is NULL");
+        return NULL;
+    }
+
+    eflat_complex = cpl_image_new(xsize,ysize, CPL_TYPE_FLOAT_COMPLEX);
+    eflat_real = cpl_image_new(xsize,ysize, CPL_TYPE_FLOAT);
+    filter_image_complex =cpl_image_cast(filter_image,CPL_TYPE_FLOAT_COMPLEX);
+
+    /*Free memory*/
+    cpl_image_delete(filter_image);
+
+
+    /* Apply a forward FFT on the images  */
+    cpl_fft_image(eflat_complex, eflat, CPL_FFT_FORWARD);
+    /*Free memory*/
+    cpl_image_delete(eflat);
+
+    /*Multiply the filter with the the FFT image */
+    cpl_image_multiply(eflat_complex,filter_image_complex);
+
+
+    /* Apply a backward FFT on the images  */
+    cpl_fft_image(eflat_real, eflat_complex,CPL_FFT_BACKWARD);
+    /*Free memory*/
+    cpl_image_delete(eflat_complex);
+    cpl_image_delete(filter_image_complex);
+
+    /*  Extract original image from the expanded image.  */
+    flat_real = cpl_image_extract(eflat_real, mirrorx+1, mirrory+1,
+            xsize-mirrorx, ysize-mirrory);
+
+    if (flat_real == NULL) {
+        cpl_msg_error (cpl_func,"Real extracted image is NULL. <%s>", cpl_error_get_message());
+        return NULL;
+    }
+    cpl_image_delete(eflat_real);
+
+    cpl_image * out_double = cpl_image_cast(flat_real, ima_type);
+    cpl_image_delete(flat_real);
+    return out_double;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ at brief	Generate a low pass filter for FFT convolution .
+ at param	xs	x size of the generated image.
+ at param	ys	y size of the generated image.
+ at param	sigma_x	Sigma for the gaussian distribution.
+ at param	sigma_y      Sigma for the gaussian distribution.
+ at return	1 newly allocated image.
+
+This function generates an image of a 2d gaussian, modified in such
+a way that the different quadrants have a quadrants of the gaussian
+in the corner. This image is suitable for FFT convolution.
+Copied from eclipse, src/iproc/generate.c
+
+The returned image must be deallocated.
+*/
+/*--------------------------------------------------------------------------*/
+static cpl_image * hdrl_gen_lowpass(int xs, int ys, double sigma_x,
+                                    double sigma_y)
+{
+
+	int i= 0.0;
+	int j= 0.0;
+	int hlx= 0.0;
+	int hly = 0.0;
+	double x= 0.0;
+	double y= 0.0;
+	double gaussval= 0.0;
+	float *data;
+
+	cpl_image 	*lowpass_image;
+
+
+	lowpass_image = cpl_image_new (xs, ys, CPL_TYPE_FLOAT);
+	if (lowpass_image == NULL) {
+		cpl_msg_error (cpl_func, "Cannot generate lowpass filter <%s>",cpl_error_get_message());
+		return NULL;
+	}
+
+	hlx = xs/2;
+	hly = ys/2;
+
+	data = cpl_image_get_data_float(lowpass_image);
+
+	/* Given an image with pixels 0<=i<N, 0<=j<M then the convolution image
+   has the following properties:
+
+   ima[0][0] = 1
+   ima[i][0] = ima[N-i][0] = exp (-0.5 * (i/sig_i)^2)   1<=i<N/2
+   ima[0][j] = ima[0][M-j] = exp (-0.5 * (j/sig_j)^2)   1<=j<M/2
+   ima[i][j] = ima[N-i][j] = ima[i][M-j] = ima[N-i][M-j]
+             = exp (-0.5 * ((i/sig_i)^2 + (j/sig_j)^2))
+	 */
+
+	data[0] = (float)1.0;
+
+	/* first row */
+	for (i=1 ; i<=hlx ; i++) {
+		x = (double)i / sigma_x;
+		gaussval = (double)exp(-0.5*x*x);
+		data[i] = gaussval;
+		data[xs-i] = gaussval;
+	}
+
+	for (j=1; j<=hly ; j++) {
+		y = (double)j / sigma_y;
+		/* first column */
+		data[j*xs] = (double)exp(-0.5*y*y);
+		data[(ys-j)*xs] = (double)exp(-0.5*y*y);
+
+		for (i=1 ; i<=hlx ; i++) {
+			/* Use internal symetries */
+			x = (double) i / sigma_x;
+			gaussval = (double)exp (-0.5*(x*x+y*y));
+			data[j*xs+i] = gaussval;
+			data[(j+1)*xs-i] = gaussval;
+			data[(ys-j)*xs+i] = gaussval;
+			data[(ys+1-j)*xs-i] = gaussval;
+
+		}
+	}
+
+	/* FIXME: for the moment, reset errno which is coming from exp()
+            in first for-loop at i=348. This is causing cfitsio to
+            fail when loading an extension image (bug in cfitsio too).
+	 */
+	if(errno != 0)
+		errno = 0;
+
+	return lowpass_image;
+}
+
+
+
+/**
+ at brief    expand image by mirroring edges
+ at param    image_in      Image.
+ at param    x_size        the number of pixels in x to expand
+ at param    y_size        the number of pixels in y to expand
+
+*/
+/*--------------------------------------------------------------------------*/
+cpl_image *hdrl_mirror_edges(cpl_image *image, int dx, int dy)
+{
+
+	int xx = 0;
+	int yy = 0;
+	int xs = 0;
+	int ys = 0;
+	int inrow = 1;
+	int outrow = 1;
+	int i =0;
+	int j = 0;
+
+	float *data;
+	float *out_data;
+
+
+	cpl_image 	*big_image;
+
+
+
+	xs = cpl_image_get_size_x(image);
+	ys = cpl_image_get_size_y(image);
+
+	xx = xs+(2*dx);
+	yy = ys+(2*dy);
+
+	data = cpl_image_get_data_float(image);
+
+	big_image = cpl_image_new(xx, yy, CPL_TYPE_FLOAT);
+	out_data = cpl_image_get_data_float(big_image);
+
+	for (j=0; j<ys ; j++){
+		inrow = j*xs;
+		outrow = (j+dy)*xx;
+
+		for (i=0; i<xs ; i++){
+			out_data[outrow+dx+i] = data[inrow+i];
+		}
+
+		for (i=0; i<dx; i++){
+			out_data[outrow+i] = data[inrow+dx-i-1];
+			out_data[outrow+xs+dx+i] = data[inrow+xs-i-1];
+
+		}
+	}
+
+	for (j=0; j<dy ; j++) {
+
+		for (i=0; i<xx; i++) {
+			out_data[j*xx+i] = out_data[(2*dy-j-1)*xx+i];
+			out_data[(yy-j-1)*xx+i] = out_data[(yy-2*dy+j)*xx+i];
+		}
+	}
+
+	return big_image;
+}
+
+
+
+cpl_image * hdrl_mime_image_polynomial_bkg(cpl_image * image,
+                                             int dim_X, int dim_Y,
+                                             cpl_matrix ** coeffs){
+    cpl_imagelist * imlist;
+    cpl_imagelist * bkg_imlist;
+    cpl_image * bkg_image;
+    cpl_image * bkg_image_origtype;
+
+    cpl_type ima_type;
+    if (image == NULL){
+        cpl_error_set_message(cpl_func,
+                              CPL_ERROR_NULL_INPUT,
+                              "Null input image provided");
+        return NULL;
+    }
+
+    ima_type = cpl_image_get_type(image);
+
+    imlist = cpl_imagelist_new();
+    bkg_imlist = cpl_imagelist_new();
+    cpl_imagelist_set(imlist, image, 0);
+
+    hdrl_mime_compute_polynomial_bkg(imlist, bkg_imlist, dim_X, dim_Y, coeffs);
+
+    cpl_imagelist_unwrap(imlist);
+    bkg_image = cpl_imagelist_unset(bkg_imlist, 0);
+    cpl_imagelist_delete(bkg_imlist);
+
+    bkg_image_origtype=cpl_image_cast(bkg_image, ima_type);
+    cpl_image_delete(bkg_image);
+
+    return bkg_image_origtype;
+
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+ * @brief    Fit smooth background for a list of images.
+ *
+ * @param      images      List of images.
+ * @param[out] bkg_images  Smooth background images.
+ * @param      dim_X,dim_Y dimensions of polynomials in @f$x at f$ and @f$y at f$.
+ * @param[out] coeffs      Polynomial coefficients.
+ *
+ * @return   @c CPL_ERROR_NONE or the appropriate error code.
+ *
+ * This function computes smooth background images by fitting
+ * polynomial surfaces to the input images. Bad-pixel masks for the
+ * images are taken into account.
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_mime_compute_polynomial_bkg(
+    const cpl_imagelist       * images,
+          cpl_imagelist       * bkg_images,
+          int                   dim_X,
+          int                   dim_Y,
+          cpl_matrix         ** coeffs
+    )
+{
+
+    int         n_images;
+    int         n_x;
+    int         n_y;
+    cpl_matrix * poly_tensors;
+    int          n_tensor;
+    int             im;
+    cpl_matrix    * weights;
+
+    cpl_msg_debug(cpl_func, "Polynomial with X, Y dimensions %2d, %2d.",
+                  dim_X, dim_Y);
+
+    /* Sanity Check of input data, and parameters */
+
+    if (images == NULL) {
+        cpl_msg_error(cpl_func, "list of dithered images is empty") ;
+        return cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);
+    }
+
+    if (cpl_imagelist_is_uniform(images) != 0) {
+        cpl_msg_error(cpl_func, "input image list have non uniform data") ;
+        return cpl_error_set(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT);
+    }
+
+
+    /*
+       Compute Dimensions
+    */
+    n_images = cpl_imagelist_get_size(images);
+    n_x      = cpl_image_get_size_x(cpl_imagelist_get_const(images, 0));
+    n_y      = cpl_image_get_size_y(cpl_imagelist_get_const(images, 0));
+
+    /*
+      Create tensor products of polynomials
+    */
+    poly_tensors  = hdrl_mime_legendre_tensors_create(n_x, n_y, dim_X, dim_Y);
+    n_tensor      = cpl_matrix_get_ncol(poly_tensors);
+    *coeffs        = cpl_matrix_new(n_tensor, n_images);
+
+    weights = hdrl_mime_tensor_weights_create(n_x, n_y);
+
+    /*
+       Loop over each image to find the corresponding
+       sky background
+    */
+
+    for (im = 0; im < n_images; im++){
+        cpl_matrix    * image_data;
+        cpl_matrix    * bkg_image_data;
+        cpl_matrix    * masked_tensors;
+        cpl_matrix    * masked_image;
+        cpl_matrix    * image_double_wrap;
+        cpl_matrix    * coeff;
+        cpl_image     * image;
+        cpl_image     * bkg_image;
+        cpl_image     * image_double;
+        cpl_image     * bkg_image_float;
+        cpl_mask      * mask_bin;
+        double          alpha = 1.0e-10;
+
+        image_data     = cpl_matrix_new(n_x*n_y, 1);
+        bkg_image_data = cpl_matrix_new(n_x*n_y, 1);
+        masked_image   = cpl_matrix_new(n_x * n_y, 1);
+        masked_tensors = cpl_matrix_new(n_x * n_y, n_tensor);
+
+
+        /*
+          Load image, and mask
+        */
+
+        image      = cpl_image_duplicate(cpl_imagelist_get_const(images, im));
+        mask_bin   = cpl_image_get_bpm(image);
+        if (mask_bin == NULL) {
+            cpl_msg_info(cpl_func, "mask not available");
+            cpl_matrix_delete(poly_tensors);
+            cpl_matrix_delete(image_data);
+            cpl_matrix_delete(bkg_image_data);
+            cpl_matrix_delete(masked_image);
+            cpl_matrix_delete(masked_tensors);
+            cpl_image_delete(image);
+            cpl_error_set(cpl_func, CPL_ERROR_DATA_NOT_FOUND);
+        }
+
+        image_double = cpl_image_cast(image, CPL_TYPE_DOUBLE);
+        image_double_wrap = cpl_matrix_wrap(n_x*n_y, 1,
+                             cpl_image_get_data_double(image_double));
+        cpl_matrix_copy(image_data, image_double_wrap, 0, 0);
+
+        /*
+          Loop over all pixels, to reject from mask.
+        */
+        cpl_matrix_copy(masked_tensors, poly_tensors, 0, 0);
+        hdrl_mime_matrix_mask_rows(masked_tensors, mask_bin);
+        hdrl_mime_matrix_rescale_rows(masked_tensors, weights, masked_tensors);
+
+        cpl_matrix_copy(masked_image, image_data, 0, 0);
+        hdrl_mime_matrix_mask_rows(masked_image, mask_bin);
+        hdrl_mime_matrix_rescale_rows(masked_image, weights, masked_image);
+
+        /*
+          Find coefficients, agument the matrix of coefficients
+        */
+        coeff = hdrl_mime_linalg_solve_tikhonov(masked_tensors, masked_image,
+                                              alpha);
+        cpl_matrix_copy(*coeffs, coeff, 0, im);
+
+
+        /* hdrl_mime_matrix_formatted_dump(coeff, NULL); */
+
+        /*
+          Synthesize background, copy to image, and then to return imagelist
+        */
+        hdrl_mime_matrix_product(poly_tensors, coeff, bkg_image_data);
+        bkg_image = cpl_image_wrap_double(n_x, n_y,
+                    cpl_matrix_get_data(bkg_image_data));
+        bkg_image_float = cpl_image_cast(bkg_image, CPL_TYPE_FLOAT);
+        cpl_imagelist_set(bkg_images, bkg_image_float, im);
+
+        cpl_matrix_delete(image_data);
+        cpl_matrix_delete(bkg_image_data);
+        cpl_matrix_delete(masked_image);
+        cpl_matrix_delete(masked_tensors);
+        cpl_matrix_delete(coeff);
+        cpl_image_delete(image);
+        cpl_image_delete(image_double);
+        cpl_matrix_unwrap(image_double_wrap);
+        cpl_image_unwrap(bkg_image);
+
+    }
+
+    /* save results, destroy whatever is not necessary, return */
+
+    cpl_matrix_delete(weights);
+    cpl_matrix_delete(poly_tensors);
+    return CPL_ERROR_NONE;
+}
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief Create tensor products of Legendre polynomials.
+ *
+ * @param nx    Number of nodes in the x-direction.
+ * @param ny    Number of x nodes in the y-direction.
+ * @param npx   Number of tensor products of functions of x.
+ * @param npy   Number of tensor products of functions of y.
+ *
+ * @return The tensor products of Legendre polynomials.
+ *
+ * The returned matrix must be deallocated using cpl_matrix_delete().
+ */
+/*---------------------------------------------------------------------------*/
+cpl_matrix *hdrl_mime_legendre_tensors_create(int nx, int ny, int npx, int npy)
+{
+    cpl_matrix *x;
+    cpl_matrix *y;
+    cpl_matrix *xpolys;
+    cpl_matrix *ypolys;
+    cpl_matrix *tensors;
+
+    double    ax, ay, bx, by;
+
+/* testing input */
+    if (nx < 2 || ny < 2 || npx < 1 || npy < 1)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+
+/* setting parameters:
+   nx, ny          numbers of the nodes in the x- and y-direction
+   ax, ay, bx, by  endpoints of the intervals with nodes
+ */
+    ax = 0.0;
+    bx = nx - 1.0;
+
+    ay = 0.0;
+    by = ny - 1.0;
+
+/* creating equally spaced nodes */
+    x = hdrl_mime_matrix_linspace_create(nx, ax, bx);
+    y = hdrl_mime_matrix_linspace_create(ny, ay, by);
+
+/* creating the tensor products */
+    xpolys = hdrl_mime_legendre_polynomials_create(npx, ax, bx, x);
+    ypolys = hdrl_mime_legendre_polynomials_create(npy, ay, by, y);
+    tensors = hdrl_mime_linalg_pairwise_column_tensor_products_create(ypolys,
+              xpolys);
+
+/* cleaning up */
+    cpl_matrix_delete(x);
+    cpl_matrix_delete(y);
+    cpl_matrix_delete(xpolys);
+    cpl_matrix_delete(ypolys);
+
+    return tensors;
+}
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief Create equally spaced nodes.
+ *
+ * @param n   The number of nodes,
+ * @param a   The leftmost node,
+ * @param b   The rightmost node.
+ *
+ * @return A column matrix with the equally spaced nodes.
+ *
+ * The number of nodes @a n must be at least 2.
+ */
+/*---------------------------------------------------------------------------*/
+cpl_matrix *hdrl_mime_matrix_linspace_create(int n, double a, double b)
+{
+    cpl_matrix *nodes;
+    double   *data;
+    double    h;
+    int       i;
+
+/* testing input */
+    if (n < 2)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+
+/* allocating memory */
+    nodes = cpl_matrix_new(n, 1);
+    data = cpl_matrix_get_data(nodes);
+
+/* creating the nodes */
+    h = (b - a) / (n - 1);
+    for (i = 0; i < n; i++)
+        data[i] = a + i * h;
+    data[n - 1] = b;
+
+    return nodes;
+}
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief    Create the Legendre polynomial basis on the interval (@a a, at a b).
+ *
+ * @param    npoly Number of polynomials.
+ * @param    a     Left endpoint of the interval.
+ * @param    b     Right endpoint of the interval.
+ * @param    x     Nodes, at which the polynomials are evaluated.
+ *
+ * @return   A matrix with the values of the polynomials at @a x.
+ *
+ * The i-th column contains the values of the i-th polynomial at the
+ * given nodes.  The polynomials have degrees 0, 1, ..., npoly-1.  The
+ * nodes must lie on the interval [@a a, @a b].  The specific dimensions of
+ * the matrix @a x are not used, only its size.
+ *
+ * The returned matrix must be deallocated using cpl_matrix_delete().
+ */
+/*---------------------------------------------------------------------------*/
+cpl_matrix *hdrl_mime_legendre_polynomials_create(int npoly, double a, double b,
+          const cpl_matrix * x)
+{
+    cpl_matrix *polys;
+    double   *m;
+    const double *mx;
+    double    midpoint, scale;
+    int       i, j, nr;
+
+/* testing input */
+    if (x == NULL)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+        return NULL;
+    }
+
+    if (npoly < 1 || a == b)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+
+/* The specific dimensions of the matrix x are not used, only its size. */
+    nr = cpl_matrix_get_nrow(x) * cpl_matrix_get_ncol(x);
+
+/* allocating memory */
+    polys = cpl_matrix_new(nr, npoly);
+
+/* initializing */
+    midpoint = 0.5 * (a + b);
+    scale = 2.0 / (b - a);
+
+/* filling the first column */
+    m = cpl_matrix_get_data(polys);
+    for (i = 0; i < nr; i++, m += npoly)
+        m[0] = 1.0;
+
+/* filling the second column */
+    m = cpl_matrix_get_data(polys);
+    mx = cpl_matrix_get_data_const(x);
+    if (npoly >= 2)
+        for (i = 0; i < nr; i++, m += npoly)
+            m[1] = scale * (mx[i] - midpoint);
+
+/* filling the remaining columns by recursion */
+    m = cpl_matrix_get_data(polys);
+    for (i = 0; i < nr; i++, m += npoly)
+    {
+        double xi = scale * (mx[i] - midpoint);
+        for (j = 2; j < npoly; j++)
+        {
+            double alpha = (2.0 * j - 1.0) / j;
+            double beta = (j - 1.0) / j;
+            m[j] = alpha * xi * m[j - 1] - beta * m[j - 2];
+        }
+    }
+
+    return polys;
+}
+/*---------------------------------------------------------------------------*/
+ /**
+  * @brief    Create selected pairwise tensor products of the columns of two
+  *           matrices.
+  *
+  * @param    mat1        A matrix,
+  * @param    mat2        A matrix.
+  *
+  * @return   The tensor product of pairs the columns of the two matrices.
+  *
+  * The tensor product of the j1-th and j2-th columns is created iff
+  * j1*(nc2-1) + j2*(nc1-1) <= (nc1-1)*(nc2-1).  The two matrices may
+  * have different dimensions.
+  */
+/*---------------------------------------------------------------------------*/
+cpl_matrix *hdrl_mime_linalg_pairwise_column_tensor_products_create(const
+          cpl_matrix * mat1, const cpl_matrix * mat2)
+{
+    cpl_matrix *tensor;
+    cpl_matrix *repl1;
+    cpl_matrix *repl2;
+
+    int       nc1, nc2;
+    int       j1, j2, nc, col_count;
+
+/* testing input */
+    if (mat1 == NULL || mat2 == NULL)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+        return NULL;
+    }
+
+/* initializing */
+    nc1 = cpl_matrix_get_ncol(mat1);
+    nc2 = cpl_matrix_get_ncol(mat2);
+
+/* counting the admissible pairs */
+    nc = 0;
+    for (j1 = 0; j1 < nc1; j1++)
+    {
+        for (j2 = 0; j2 < nc2; j2++)
+            nc += (j1 * (nc2 - 1) + j2 * (nc1 - 1) <=
+                      (nc1 - 1) * (nc2 - 1) ? 1 : 0);
+    }
+
+/* replicating the columns */
+    repl1 = cpl_matrix_new(cpl_matrix_get_nrow(mat1), nc);
+    repl2 = cpl_matrix_new(cpl_matrix_get_nrow(mat2), nc);
+    col_count = 0;
+
+    for (j1 = 0; j1 < nc1; j1++)
+    {
+        for (j2 = 0; j2 < nc2; j2++)
+        {
+            if (j1 * (nc2 - 1) + j2 * (nc1 - 1) <= (nc1 - 1) * (nc2 - 1))
+            {
+                hdrl_mime_matrix_copy_column(mat1, j1, repl1, col_count);
+                hdrl_mime_matrix_copy_column(mat2, j2, repl2, col_count);
+                col_count++;
+            }
+        }
+    }
+
+/* filling the matrix with the tensor products */
+    tensor = hdrl_mime_linalg_tensor_products_columns_create(repl1, repl2);
+    cpl_matrix_delete(repl1);
+    cpl_matrix_delete(repl2);
+
+    return tensor;
+}
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief    Copy a column from one matrix to another matrix.
+ *
+ * @param    mat1        The matrix whose column is copied,
+ * @param    j_1         The index of the column to be copied,
+ * @param[in,out]  mat2        The matrix whose column is overwritten,
+ * @param[in,out]  j_2         The index of the column to be overwritten.
+ *
+ * @return   @c CPL_ERROR_NONE or the appropriate error code.
+ *
+ * Both matrices must have the same number of rows.
+ */
+/*---------------------------------------------------------------------------*/
+cpl_error_code hdrl_mime_matrix_copy_column(const cpl_matrix * mat1, int j_1,
+          cpl_matrix * mat2, int j_2)
+{
+    const double *m1;
+    double   *m2;
+    int       i, nr, nc1, nc2;
+
+/* testing input */
+    if (mat1 == NULL || mat2 == NULL)
+        return cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+
+    if (cpl_matrix_get_nrow(mat1) != cpl_matrix_get_nrow(mat2))
+        return cpl_error_set(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT);
+
+    if (j_1 < 0 || j_1 >= cpl_matrix_get_ncol(mat1) || j_2 < 0 ||
+              j_2 >= cpl_matrix_get_ncol(mat2))
+        return cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
+
+/* initializing */
+    nr = cpl_matrix_get_nrow(mat1);
+    nc1 = cpl_matrix_get_ncol(mat1);
+    nc2 = cpl_matrix_get_ncol(mat2);
+    m1 = cpl_matrix_get_data_const(mat1) + j_1;
+    m2 = cpl_matrix_get_data(mat2) + j_2;
+
+/* filling the column */
+    for (i = 0; i < nr; i++, m1 += nc1, m2 += nc2)
+        *m2 = *m1;
+
+    return CPL_ERROR_NONE;
+}
+/*---------------------------------------------------------------------------*/
+ /**
+  * @brief    Create the tensor products of the columns of two matrices.
+  *
+  * @param    mat1        A matrix,
+  * @param    mat2        A matrix.
+  *
+  * @return   The tensor product of the columns of the two matrices.
+  *
+  * The two matrices must have the same number of columns.  The result
+  * has dimensions (nr1*nr2) x nc.
+  */
+/*---------------------------------------------------------------------------*/
+cpl_matrix *hdrl_mime_linalg_tensor_products_columns_create(const cpl_matrix *
+          mat1, const cpl_matrix * mat2)
+{
+    cpl_matrix *tensor;
+
+    const double *m1;
+    double   *t;
+    int       nr1, nr2, nc;
+    int       i1;
+
+/* testing input */
+    if (mat1 == NULL || mat2 == NULL)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+        return NULL;
+    }
+
+    if (cpl_matrix_get_ncol(mat1) != cpl_matrix_get_ncol(mat2))
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT);
+        return NULL;
+    }
+
+/* initializing */
+    nr1 = cpl_matrix_get_nrow(mat1);
+    nr2 = cpl_matrix_get_nrow(mat2);
+    nc = cpl_matrix_get_ncol(mat1);     /* nc = cpl_matrix_get_ncol(mat2); */
+
+/* allocating memory */
+    tensor = cpl_matrix_new(nr1 * nr2, nc);
+
+/* filling the matrix with the tensor products */
+    m1 = cpl_matrix_get_data_const(mat1);
+    t = cpl_matrix_get_data(tensor);
+    for (i1 = 0; i1 < nr1; i1++, m1 += nc)
+    {
+        int           i2;
+        const double *m2;
+        m2 = cpl_matrix_get_data_const(mat2);
+        for (i2 = 0; i2 < nr2; i2++, m2 += nc, t += nc)
+        {
+            int j;
+            for (j = 0; j < nc; j++)
+                t[j] = m1[j] * m2[j];
+        }
+    }
+
+    return tensor;
+}
+
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief Create tensor product weights.
+ *
+ * @param nx    Number of nodes in the x-direction,
+ * @param ny    Number of x nodes in the y-direction,
+ *
+ * @return The tensor weights
+ *
+ * The returned matrix must be deallocated using cpl_matrix_delete().
+ */
+/*---------------------------------------------------------------------------*/
+cpl_matrix *hdrl_mime_tensor_weights_create(int nx, int ny)
+{
+    cpl_matrix *x;
+    cpl_matrix *y;
+    cpl_matrix *weights;
+
+    double   *m;
+    double    ax, ay, bx, by, v;
+    int       i;
+
+/* testing input */
+    if (nx < 2 || ny < 2)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+
+/* setting parameters:
+   nx, ny          numbers of the nodes in the x- and y-direction
+ */
+    bx = 1.0 - 1.0 / nx;
+    ax = -bx;
+
+    by = 1.0 - 1.0 / ny;
+    ay = -by;
+
+/* creating equally spaced nodes */
+    x = hdrl_mime_matrix_linspace_create(nx, ax, bx);
+    y = hdrl_mime_matrix_linspace_create(ny, ay, by);
+
+/* creating the weights as the tensor product */
+    m = cpl_matrix_get_data(x);
+    for (i = 0; i < nx; i++)
+    {
+        v = m[i];
+        v = 1.0 / sqrt(1.0 - v * v);
+        m[i] = sqrt(v);
+    }
+
+    m = cpl_matrix_get_data(y);
+    for (i = 0; i < ny; i++)
+    {
+        v = m[i];
+        v = 1.0 / sqrt(1.0 - v * v);
+        m[i] = sqrt(v);
+    }
+
+/* switch
+     no weights: 1
+     with weights: 0  */
+    if (1)
+    {
+        cpl_matrix_fill(x, 1.0);
+        cpl_matrix_fill(y, 1.0);
+    }
+
+    weights = hdrl_mime_linalg_pairwise_column_tensor_products_create(y, x);
+
+/* cleaning up */
+    cpl_matrix_delete(x);
+    cpl_matrix_delete(y);
+
+    return weights;
+}
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief    Fill matrix rows with zeros as indicated by a mask.
+ *
+ * @param    mat        A matrix,
+ * @param    mask        A mask flagging rows to be filled with 0.0s,
+ *
+ * @return   @c CPL_ERROR_NONE or the appropriate error code.
+ *
+ * The size of @a mask must be equal to the number of rows of @a
+ * mat.  The rows corresponding to @c CPL_BINARY_1 are set to 0.0.
+ */
+/*---------------------------------------------------------------------------*/
+cpl_error_code hdrl_mime_matrix_mask_rows(cpl_matrix * mat, const cpl_mask * mask)
+{
+    double   *m;
+    const cpl_binary *mk;
+    int       i, j, nr, nc;
+
+/* testing input */
+    if (mat == NULL || mask == NULL)
+        return cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+
+    if (cpl_matrix_get_nrow(mat) !=
+              cpl_mask_get_size_x(mask) * cpl_mask_get_size_y(mask))
+        return cpl_error_set(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT);
+
+/* initializing */
+    nr = cpl_matrix_get_nrow(mat);
+    nc = cpl_matrix_get_ncol(mat);
+    m = cpl_matrix_get_data(mat);
+    mk = cpl_mask_get_data_const(mask);
+
+/* updating the rows */
+    for (i = 0; i < nr; i++, mk++, m += nc)
+    {
+        if (*mk == CPL_BINARY_1)
+        {
+            for (j = 0; j < nc; j++)
+                m[j] = 0.0;
+        }
+    }
+
+    return CPL_ERROR_NONE;
+}
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief    Multiply the rows of a matrix by given factors.
+ *
+ * @param    mat        A matrix,
+ * @param    d          The factors.
+ * @param[out]   dmat   The  matrix with rescaled rows.
+ *
+ * @return @c CPL_ERROR_NONE or the appropriate error code.
+ *
+ * The number of rows must be equal to the size of @a d. The matrix
+ * @a dmat must be allocated before calling this function.
+ */
+/*---------------------------------------------------------------------------*/
+cpl_error_code hdrl_mime_matrix_rescale_rows(const cpl_matrix * mat,
+          const cpl_matrix * d, cpl_matrix * dmat)
+{
+    const double *m;
+    const double *di;
+    double *dm;
+    int       i, j, nr, nc;
+
+/* testing input */
+    if (mat == NULL || d == NULL || dmat == NULL)
+    {
+        return cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+    }
+
+    if (cpl_matrix_get_nrow(mat) !=
+              cpl_matrix_get_nrow(d) * cpl_matrix_get_ncol(d))
+    {
+        return cpl_error_set(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT);
+    }
+
+    if (cpl_matrix_get_ncol(mat) != cpl_matrix_get_ncol(dmat) ||
+              cpl_matrix_get_nrow(mat) != cpl_matrix_get_nrow(dmat))
+    {
+        return cpl_error_set(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT);
+    }
+
+/* initializing */
+    nr = cpl_matrix_get_nrow(mat);
+    nc = cpl_matrix_get_ncol(mat);
+
+    m = cpl_matrix_get_data_const(mat);
+    di = cpl_matrix_get_data_const(d);
+    dm = cpl_matrix_get_data(dmat);
+
+/* multiplying the rows by the d[i]'s */
+    for (i = 0; i < nr; i++, m += nc, dm += nc)
+    {
+        for (j = 0; j < nc; j++)
+            dm[j] = di[i] * m[j];
+    }
+
+    return CPL_ERROR_NONE;
+}
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief Solve an overdetermined linear system in the least-squares sense.
+ *
+ * @param mat   A matrix.
+ * @param rhs   A matrix containing right-hand-side vectors.
+ * @param alpha The regularization parameter of the Tikhonov method.
+ *
+ * @return A matrix with solutions of the least-squares problem.
+ *
+ * Typically, this method is used for overdetermined systems, where
+ * the matrix has more rows than columns, but it can also be used for
+ * square and underdetermined systems.  Several right-hand-sides can
+ * be provided.  The regularization parameter increases with the noise
+ * level.
+ */
+/*---------------------------------------------------------------------------*/
+cpl_matrix *hdrl_mime_linalg_solve_tikhonov(const cpl_matrix * mat,
+          const cpl_matrix * rhs, double alpha)
+{
+    cpl_matrix *normal;
+    cpl_matrix *solution;
+    cpl_error_code error;
+
+/* testing input */
+    if (mat == NULL || rhs == NULL)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+        return NULL;
+    }
+
+    if (cpl_matrix_get_nrow(mat) != cpl_matrix_get_nrow(rhs))
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT);
+        return NULL;
+    }
+
+/* creating the normal equations and computing the Cholesky decomposition */
+    normal = hdrl_mime_linalg_normal_equations_create(mat, alpha);
+    error = cpl_matrix_decomp_chol(normal);
+
+    if (error != CPL_ERROR_NONE)
+    {
+        cpl_matrix_delete(normal);
+        return NULL;
+    }
+
+/* solving the normal equations and cleaning up */
+    solution = hdrl_mime_matrix_product_left_transpose_create(mat, rhs);
+    error = cpl_matrix_solve_chol(normal, solution);
+    cpl_matrix_delete(normal);
+
+    if (error != CPL_ERROR_NONE)
+    {
+        cpl_matrix_delete(solution);
+        return NULL;
+    }
+
+    return solution;
+}
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief Create the matrix transpose(A) * A  + alpha for given A and alpha.
+ *
+ * @param mat     Matrix,
+ * @param alpha   The regularization parameter.
+ *
+ * @return The matrix transpose(@a mat) * @a mat  + @a alpha.
+ *
+ * @note Only the upper triangle is computed, since cpl_matrix_decomp_chol()
+ *  only requires the upper triangle.
+ */
+/*---------------------------------------------------------------------------*/
+cpl_matrix *hdrl_mime_linalg_normal_equations_create(const cpl_matrix * mat,
+          double alpha)
+{
+    cpl_matrix *normal;
+    const double *m;
+    double   *p;
+    double    sum;
+    int       nr, nc;
+    int       i, j, k;
+
+/* testing input */
+    if (mat == NULL)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+        return NULL;
+    }
+
+    if (alpha < 0.0)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_ILLEGAL_INPUT);
+        return NULL;
+    }
+
+/* initializing */
+    nr = cpl_matrix_get_nrow(mat);
+    nc = cpl_matrix_get_ncol(mat);
+
+/* allocating memory */
+    normal = cpl_matrix_new(nc, nc);
+
+/* filling the normal matrix */
+    p = cpl_matrix_get_data(normal);
+    for (i = 0; i < nc; i++, p += nc)
+    {
+        for (j = i; j < nc; j++)
+        {
+            m = cpl_matrix_get_data_const(mat);
+            sum = 0.0;
+            for (k = 0; k < nr; k++, m += nc)
+                sum += m[i] * m[j];
+            p[j] = sum;
+        }
+    }
+
+/* updating the diagonal */
+    p = cpl_matrix_get_data(normal);
+    for (i = 0; i < nc; i++)
+        p[nc * i + i] += alpha;
+
+    return normal;
+}
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief    Create the product of the transpose of a matrix with
+ * another matrix.
+ *
+ * @param    mat1       A matrix,
+ * @param    mat2       A matrix.
+ *
+ * @return   The product of the transpose of the first matrix with the second
+ *           matrix.
+ *
+ * The two matrices must have the same number of rows. The product
+ * matrix must be deallocated with cpl_matrix_delete().
+ */
+/*---------------------------------------------------------------------------*/
+cpl_matrix *hdrl_mime_matrix_product_left_transpose_create(const cpl_matrix *
+          mat1, const cpl_matrix * mat2)
+{
+    cpl_matrix *product;
+
+    const double *m1;
+    const double *m2;
+    double   *p;
+    double    sum;
+
+    int       nr, nc, common;
+    int       i, j, k;
+
+/* testing input */
+    if (mat1 == NULL || mat2 == NULL)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+        return NULL;
+    }
+
+    if (cpl_matrix_get_nrow(mat1) != cpl_matrix_get_nrow(mat2))
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT);
+        return NULL;
+    }
+
+/* initializing */
+    nr = cpl_matrix_get_ncol(mat1);
+    nc = cpl_matrix_get_ncol(mat2);
+    common = cpl_matrix_get_nrow(mat1);
+    /* common = cpl_matrix_get_nrow(mat2); */
+
+/* allocating memory */
+    product = cpl_matrix_new(nr, nc);
+    p = cpl_matrix_get_data(product);
+
+/* filling the product matrix */
+    for (i = 0; i < nr; i++, p += nc)
+    {
+        for (j = 0; j < nc; j++)
+        {
+            m1 = cpl_matrix_get_data_const(mat1);
+            m2 = cpl_matrix_get_data_const(mat2);
+            sum = 0.0;
+            for (k = 0; k < common; k++, m1 += nr, m2 += nc)
+                sum += m1[i] * m2[j];
+            p[j] = sum;
+        }
+    }
+
+    return product;
+}
+/*---------------------------------------------------------------------------*/
+/**
+ * @brief    Fill a matrix with the product of two given matrices.
+ *
+ * @param    mat1        A matrix,
+ * @param    mat2        A matrix,
+ * @param[out]    product    The product of the matrices.
+ *
+ * @return   @c CPL_ERROR_NONE or the appropriate error code.
+ *
+ * The number of rows of @a mat1 must be equal to the number of rows
+ * of @a product.  The number of columns of @a mat2 must be equal to
+ * the number of columns of @a product.  The number of columns of @a
+ * mat1 must be equal to the number of rows of @a mat2.
+ */
+/*---------------------------------------------------------------------------*/
+cpl_error_code hdrl_mime_matrix_product(const cpl_matrix * mat1,
+          const cpl_matrix * mat2, cpl_matrix * product)
+{
+    const double *m1;
+    const double *m2;
+    double   *p;
+    double    sum;
+
+    int       nr, nc, common;
+    int       i, j, k;
+
+/* testing input */
+    if (mat1 == NULL || mat2 == NULL || product == NULL)
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_NULL_INPUT);
+        return CPL_ERROR_NONE;
+    }
+
+    if (cpl_matrix_get_ncol(mat1) != cpl_matrix_get_nrow(mat2) ||
+              cpl_matrix_get_nrow(mat1) != cpl_matrix_get_nrow(product) ||
+              cpl_matrix_get_ncol(mat2) != cpl_matrix_get_ncol(product))
+    {
+        cpl_error_set(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT);
+        return CPL_ERROR_NONE;
+    }
+
+/* initializing */
+    nr = cpl_matrix_get_nrow(mat1);
+    nc = cpl_matrix_get_ncol(mat2);
+    common = cpl_matrix_get_ncol(mat1); /* common = cpl_matrix_get_nrow(mat2); */
+
+/* filling the product matrix */
+    m1 = cpl_matrix_get_data_const(mat1);
+    p = cpl_matrix_get_data(product);
+    for (i = 0; i < nr; i++, m1 += cpl_matrix_get_ncol(mat1), p += nc)
+    {
+        for (j = 0; j < nc; j++)
+        {
+            m2 = cpl_matrix_get_data_const(mat2);
+            sum = 0.0;
+            for (k = 0; k < common; k++, m2 += cpl_matrix_get_ncol(mat2))
+                sum += m1[k] * m2[j];
+            p[j] = sum;
+        }
+    }
+
+    return CPL_ERROR_NONE;
+}
+
+
+
+/**@}*/
diff --git a/mosca/libmosca/hdrl_prototyping.h b/mosca/libmosca/hdrl_prototyping.h
new file mode 100644
index 0000000..5be0cf5
--- /dev/null
+++ b/mosca/libmosca/hdrl_prototyping.h
@@ -0,0 +1,68 @@
+/*
+ * hdrl_prototyping.h
+ *
+ *  Created on: Aug 29, 2013
+ *      Author: agabasch
+ */
+
+#ifndef HDRL_PROTOTYPING_H_
+#define HDRL_PROTOTYPING_H_
+
+#include <cpl.h>
+
+CPL_BEGIN_DECLS
+
+cpl_image * hdrl_get_spatial_freq(cpl_image *ima, double gausfilt, int mirrorx,
+                                  int mirrory);
+
+cpl_image * hdrl_mime_image_polynomial_bkg(cpl_image * image,
+                                            int dim_X, int dim_Y,
+                                            cpl_matrix ** coeffs);
+
+
+cpl_error_code hdrl_mime_compute_polynomial_bkg(
+    const cpl_imagelist       * images,
+          cpl_imagelist       * bkg_images,
+          int                   dim_X,
+          int                   dim_Y,
+          cpl_matrix         ** coeffs
+   );
+cpl_matrix *hdrl_mime_legendre_tensors_create(int nx, int ny, int npx, int npy);
+
+cpl_matrix *hdrl_mime_matrix_linspace_create(int n, double a, double b);
+
+cpl_matrix *hdrl_mime_legendre_polynomials_create(int npoly, double a, double b,
+                                             const cpl_matrix * x);
+
+cpl_matrix *hdrl_mime_linalg_pairwise_column_tensor_products_create(const
+          cpl_matrix * mat1, const cpl_matrix * mat2);
+
+cpl_error_code hdrl_mime_matrix_copy_column(const cpl_matrix * mat1, int j_1,
+          cpl_matrix * mat2, int j_2);
+
+cpl_matrix *hdrl_mime_linalg_tensor_products_columns_create(const cpl_matrix *
+                                                       mat1, const cpl_matrix * mat2);
+cpl_matrix *hdrl_mime_tensor_weights_create(int nx, int ny);
+
+cpl_error_code hdrl_mime_matrix_rescale_rows(const cpl_matrix * mat,
+          const cpl_matrix * d, cpl_matrix * dmat);
+
+cpl_error_code hdrl_mime_matrix_mask_rows(cpl_matrix * mat, const cpl_mask * mask);
+
+cpl_matrix *hdrl_mime_linalg_solve_tikhonov(const cpl_matrix * mat,
+          const cpl_matrix * rhs, double alpha);
+
+cpl_matrix *hdrl_mime_linalg_normal_equations_create(const cpl_matrix * mat,
+          double alpha);
+cpl_matrix *hdrl_mime_matrix_product_left_transpose_create(const cpl_matrix *
+          mat1, const cpl_matrix * mat2);
+
+cpl_error_code hdrl_mime_matrix_product(const cpl_matrix * mat1,
+          const cpl_matrix * mat2, cpl_matrix * product);
+
+CPL_END_DECLS
+
+#endif /* HDRL_PROTOTYPING_H_ */
+
+
+
diff --git a/mosca/libmosca/hdrl_sigclip.c b/mosca/libmosca/hdrl_sigclip.c
new file mode 100644
index 0000000..8e610cb
--- /dev/null
+++ b/mosca/libmosca/hdrl_sigclip.c
@@ -0,0 +1,576 @@
+/* $Id: hdrl_sigclip.c,v 1.2 2013-10-16 11:31:07 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2012,2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:07 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+-----------------------------------------------------------------------------*/
+
+#include "hdrl_sigclip.h"
+#include "hdrl_utils.h"
+#include "hdrl_collapse.h"
+
+#include <cpl.h>
+#include <string.h>
+#include <math.h>
+
+
+/*-----------------------------------------------------------------------------
+                                   Static
+ -----------------------------------------------------------------------------*/
+
+static double hdrl_iqr(const cpl_vector *) ;
+static cpl_error_code hdrl_sort_double_pairs(double *, double *, cpl_size) ;
+
+/*----------------------------------------------------------------------------*/
+/**
+  @defgroup hdrl_sigclip   SIGMA-CLIPPING Module
+ 
+  This module provides an iterative sigma-clipping functionality. 
+ */
+/*----------------------------------------------------------------------------*/
+
+/**@{*/
+
+/* ---------------------------------------------------------------------------*/
+/**
+  @brief Create parameter list for sigma-clip parameters
+  @param full_prefix    prefix for parameter name
+  @param alias_prefix   prefix for cli alias 
+  @param context        context of parameter
+  @param defaults       default parameters values
+  @return cpl_parameterlist
+ 
+  Creates a parameterlist out of all parameters of the sigma-clip algorithm.
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_parameterlist * hdrl_sigclip_parameter_create_parlist(
+        const char              *   full_prefix,
+        const char              *   alias_prefix,
+        const char              *   context,
+        const hdrl_parameter    *   defaults)
+{
+    cpl_ensure(full_prefix && context && alias_prefix && defaults,
+            CPL_ERROR_NULL_INPUT, NULL);
+    const char          *   full_sep = strlen(full_prefix) > 0 ? "." : "";
+    const char          *   alias_sep = strlen(alias_prefix) > 0 ? "." : "";
+    cpl_parameterlist   *   parlist = cpl_parameterlist_new();
+
+    /* --prefix.kappa-low */
+    hdrl_setup_vparameter(parlist, full_prefix, full_sep, "",
+            alias_prefix, alias_sep, "kappa-low", context,
+            "Low kappa factor for kappa-sigma clipping algorithm",
+            CPL_TYPE_DOUBLE,
+            hdrl_collapse_sigclip_parameter_get_kappa_low(defaults));
+    
+     /* --prefix.kappa-high */
+    hdrl_setup_vparameter(parlist, full_prefix, full_sep, "",
+            alias_prefix, alias_sep, "kappa-high", context,
+            "High kappa factor for kappa-sigma clipping algorithm",
+            CPL_TYPE_DOUBLE,
+            hdrl_collapse_sigclip_parameter_get_kappa_high(defaults));
+ 
+    /* --prefix.niter */
+    hdrl_setup_vparameter(parlist, full_prefix, full_sep, "",
+            alias_prefix, alias_sep, "niter", context,
+            "Maximum number of clipping iterations for kappa-sigma clipping",
+            CPL_TYPE_INT,
+            hdrl_collapse_sigclip_parameter_get_niter(defaults));
+    
+    if (cpl_error_get_code()) {
+        cpl_parameterlist_delete(parlist);
+        return NULL;
+    }
+
+    return parlist;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief parse parameterlist for sigclip parameters to init corresponding hdrl
+ * structure parameters
+ *
+ * @param parlist    parameter list to parse
+ * @param prefix     prefix of parameter name
+ * @param kappa_low  pointer to storage to save kappa_low or NULL
+ * @param kappa_high pointer to storage to save kappa_high or NULL
+ * @param niter      pointer to storage to save niter or NULL
+ * @see   hdrl_kappa_sigma_clip_get_parlist()
+ * @return cpl_error_code
+ *
+ * parameterlist should have been created with
+ * hdrl_kappa_sigma_clip_get_parlist or have the same name hierachy
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code hdrl_sigclip_parameter_parse_parlist(
+        const cpl_parameterlist *   parlist,
+        const char              *   prefix,
+        double                  *   kappa_low,
+        double                  *   kappa_high,
+        int                     *   niter)
+{
+    cpl_ensure_code(prefix && parlist, CPL_ERROR_NULL_INPUT);
+    const char * sep = strlen(prefix) > 0 ? "." : "";
+    char * name;
+
+    if (kappa_low) {
+        name = cpl_sprintf("%s%ssigclip.kappa-low", prefix, sep);
+        const cpl_parameter * par = cpl_parameterlist_find_const(parlist, name);
+        *kappa_low = cpl_parameter_get_double(par);
+        cpl_free(name);
+    }
+
+    if (kappa_high) {
+        name = cpl_sprintf("%s%ssigclip.kappa-high", prefix, sep);
+        const cpl_parameter * par = cpl_parameterlist_find_const(parlist, name);
+        *kappa_high = cpl_parameter_get_double(par);
+        cpl_free(name);
+    }
+
+    if (niter) {
+        name = cpl_sprintf("%s%ssigclip.niter", prefix, sep);
+        const cpl_parameter * par = cpl_parameterlist_find_const(parlist, name);
+        *niter = cpl_parameter_get_int(par);
+        cpl_free(name);
+    }
+    return cpl_error_get_code();
+}
+ 
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Compute mean image value using kappa-sigma clipping method
+  @param source         Input image 
+  @param error          Input error image
+  @param kappa_low      Number of sigmas for lower threshold
+  @param kappa_high     Number of sigmas for upper threshold        
+  @param iter           Number of iterations
+  @param mean_ks        The kappa-sigma clipped mean
+  @param mean_ks_err    The propagated error of the kappa-sigma clipped mean
+  @param naccepted      Number of accepted values
+  @param reject_low     Values lower than this have been rejected
+  @param reject_high    Values higher than this have been rejected
+  @return   @c CPL_ERROR_NONE or the appropriate error code.
+  @see hdrl_kappa_sigma_clip()
+  
+  This function converts the image inputs into the proper data types in
+  order to call the hdrl_kappa_sigma_clip() function.
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_kappa_sigma_clip_image(
+        const cpl_image   * source,
+        const cpl_image   * error,
+        const double        kappa_low,
+        const double        kappa_high,
+        const int           iter,
+        double            * mean_ks,
+        double            * mean_ks_err,
+        cpl_size          * naccepted,
+        double            * reject_low,
+        double            * reject_high)
+{
+    cpl_vector * vec_source = NULL;
+    cpl_vector * vec_error = NULL;
+
+    /* Check Entries */
+    cpl_error_ensure(source != NULL, CPL_ERROR_NULL_INPUT,
+            return CPL_ERROR_NULL_INPUT, "Null input source image!");
+    cpl_error_ensure(error != NULL, CPL_ERROR_NULL_INPUT,
+            return CPL_ERROR_NULL_INPUT, "Null input error image!");
+    cpl_error_ensure(cpl_image_get_size_x(source)==cpl_image_get_size_x(error),
+            CPL_ERROR_INCOMPATIBLE_INPUT, return CPL_ERROR_INCOMPATIBLE_INPUT,
+            "source and error image musty have same X size");
+    cpl_error_ensure(cpl_image_get_size_y(source)==cpl_image_get_size_y(error),
+            CPL_ERROR_INCOMPATIBLE_INPUT, return CPL_ERROR_INCOMPATIBLE_INPUT,
+            "source and error image musty have same Y size");
+
+    /* compress images to vectors excluding the bad pixels */
+    vec_source = hdrl_image_to_vector(source, NULL);
+    vec_error = hdrl_image_to_vector(error, cpl_image_get_bpm_const(source));
+
+    if (vec_source != NULL && vec_error != NULL) {
+        /* Call here the real sigma-clipping function */
+        hdrl_kappa_sigma_clip(vec_source, vec_error, kappa_low, kappa_high,
+                             iter, mean_ks, mean_ks_err, naccepted, reject_low,
+                             reject_high);
+    }
+    /* no good pixels */
+    else {
+        *mean_ks = NAN;
+        *mean_ks_err = NAN;
+        *naccepted = 0;
+        *reject_low = NAN;
+        *reject_high = NAN;
+    }
+
+    cpl_msg_debug(cpl_func, "mean_ks, mean_ks_err, naccepted:  %g, %g, %ld",
+                  *mean_ks, *mean_ks_err, (long)*naccepted);
+
+    cpl_vector_delete(vec_source);
+    cpl_vector_delete(vec_error);
+    return cpl_error_get_code();
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief get first index that compares greater than value
+ * @param vec vector to check
+ * @param val upper bound to check
+ */
+/* ---------------------------------------------------------------------------*/
+static long get_upper_bound(cpl_vector * vec, double val)
+{
+    double * d = cpl_vector_get_data(vec);
+    long count = cpl_vector_get_size(vec);
+    long first = 0;
+    while (count > 0)
+    {
+        long step = count / 2;
+        long it = first + step;
+        if (!(val < d[it])) {
+            first = it + 1;
+            count -= step + 1;
+        }
+        else
+            count = step;
+    }
+    return first;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief get index that compares does not compare less than value
+ * @param vec vector to check
+ * @param val upper bound to check
+ */
+/* ---------------------------------------------------------------------------*/
+static long get_lower_bound(cpl_vector * vec, double val)
+{
+    double * d = cpl_vector_get_data(vec);
+    long count = cpl_vector_get_size(vec);
+    long first = 0;
+    while (count > 0)
+    {
+        long step = count / 2;
+        long it = first + step;
+        if (d[it] < val) {
+            first = it + 1;
+            count -= step + 1;
+        }
+        else
+            count = step;
+    }
+    return first;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief   Compute mean using kappa-sigma clipping.
+  @param   vec         The vector for which mean is to be computed.
+  @param   vec_err     The error of vec. 
+  @param   kappa_low   Number of sigmas for lower threshold.
+  @param   kappa_high  Number of sigmas for upper threshold.
+  @param   iter        Number of iterations.
+  @param   mean_ks     The kappa-sigma clipped mean.
+  @param   mean_ks_err The propagated error of the kappa-sigma clipped mean.
+  @param   naccepted   Number of accepted values.
+  @param   reject_low  Values lower than this have been rejected.
+  @param   reject_high Values higher than this have been rejected
+  @return   @c CPL_ERROR_NONE or the appropriate error code.
+
+  The function computes the arithmetic mean of a vector after rejecting 
+  outliers using kappa-sigma clipping. Robust estimates of the mean and 
+  standard deviation are used to derive the interval within which values in 
+  the vector are considered good.
+
+  The sigma-clipping is applied on the vec vector data. The vec_err vector 
+  is used for the error computation.
+
+  An iterative process of rejection of the outlier elements of vec is
+  applied. iter specifies the maximum number of iterations.
+
+  At each iteration, the median and sigma values of the vector are computed and
+  used to derive low and high thresholds (\f$median-kappa\_low \times sigma\f$
+  and \f$median+kappa\_low \times sigma\f$). The values of vec outside those
+  bounds are rejected and the remaining values are passed to the next
+  iteration.
+
+  The mean value of the remaining elements is stored into mean_ks.
+  mean_ks_err contains \f$\frac{\sum_i{val_i^{2}}}{N}\f$ where \f$val_i\f$
+  are the remaining elements of vec_err and N the number of those elements. 
+  The N value is stored in naccepted.
+
+  reject_low and reject_high are the final thresholds differenciating the 
+  rejected pixels from the others.
+
+  The iterative process is illustrated here:
+  \image html sigclip_algorithm.png
+
+  Note that the \f$\sigma\f$ used for the thresholding in the different
+  iterations is not the standard deviation but the scaled interquartile range
+  (IQR) of the distribution. The scaling is \f$\sigma = \frac{IQR}{1.349}\f$.
+
+  As illustrated below, the IQR is the distance between the upper and
+  the lower quartiles of a distribution.
+  \image html iqr.svg
+
+  The IQR is a more robust estimate of the scale of the distribution than the
+  standard deviation but only has 61% of the asymptotic statistical efficiency
+  for normal distributed data. This higher error in scale parameter only has
+  limited influence on the result as it is only used determination of clipping
+  thresholds.
+
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_kappa_sigma_clip(
+        const cpl_vector  * vec,
+        const cpl_vector  * vec_err,
+        const double        kappa_low,
+        const double        kappa_high,
+        const int           iter,
+        double            * mean_ks,
+        double            * mean_ks_err,
+        cpl_size          * naccepted,
+        double            * reject_low,
+        double            * reject_high)
+{
+    /*    VARIABLES ON THE FUNCTION SCOPE:
+
+          vec_image       a deep copy of the input vector vec.
+          mean_ks         kappa-sigma clip mean (return variable).
+          mean_ks         kappa-sigma clip mean (return variable).
+    */
+
+    cpl_vector   * vec_image = NULL;
+    cpl_vector   * vec_image_err = NULL;
+
+    cpl_size       vec_size;
+    double lower_bound;
+    double upper_bound;
+
+    cpl_error_ensure(vec != NULL, CPL_ERROR_NULL_INPUT,
+                     return CPL_ERROR_NULL_INPUT, "Null input vector data");
+    cpl_error_ensure(vec_err != NULL, CPL_ERROR_NULL_INPUT,
+                     return CPL_ERROR_NULL_INPUT, "Null input vector errors");
+    cpl_error_ensure(cpl_vector_get_size(vec) == cpl_vector_get_size(vec_err),
+                     CPL_ERROR_INCOMPATIBLE_INPUT,
+                     return CPL_ERROR_INCOMPATIBLE_INPUT,
+                     "input data and error vectors must have same sizes");
+    cpl_error_ensure(mean_ks != NULL, CPL_ERROR_NULL_INPUT,
+                     return CPL_ERROR_NULL_INPUT, "Null input mean storage");
+    cpl_error_ensure(iter > 0, CPL_ERROR_ILLEGAL_INPUT,
+                     return CPL_ERROR_ILLEGAL_INPUT,
+                     "iter must be larger than 0");
+
+    vec_image = cpl_vector_duplicate(vec);
+    vec_image_err = cpl_vector_duplicate(vec_err);
+    vec_size = cpl_vector_get_size(vec_image);
+
+    /*    BEGIN ITERATION OF KAPPA-SIGMA CLIP */
+    /*    VARIABLES ON ITERATION SCOPE
+          median          median of the vector.
+          sigma           standard deviation of the vector.
+          lower_bound     lower bound after kappa-sigma clip.
+          upper_bound     upper bound after kappa-sigma clip.
+          lower_index     approx. index of vec corresponding to lower_bound.
+          upper_index     approx. index of vec corresponding to upper_bound.
+          vec_temp        temporary vector used to swap.
+          vec_temp_err    temporary error vector used to swap.
+    */
+    hdrl_sort_double_pairs(cpl_vector_get_data(vec_image),
+                          cpl_vector_get_data(vec_image_err), vec_size);
+
+    for(int it = 0; it < iter; it++) {
+        double median, sigma;
+        cpl_size lower_index, upper_index;
+        cpl_vector * vec_temp, * vec_temp_err;
+
+        /* Nothing to do if only one data point */
+        vec_size = cpl_vector_get_size(vec_image);
+        if(vec_size == 1) {
+            lower_bound = cpl_vector_get(vec_image, 0);
+            upper_bound = lower_bound;
+            break;
+        }
+
+        /*  STEPS OF KAPPA SIGMA CLIP
+            1. Sort the vector.
+            2. Find mean, and standard deviation (sigma).
+            3. Find lower, and upper bound after kappa-sigma clip.
+            4. Find index which corresponds to lower and upper bound
+            5. Extract the vector within the index bound.
+        */
+
+        /* Use median as a robust estimator of the mean */
+        median = cpl_vector_get_median_const(vec_image);
+
+        /* standard deviation from inter-quartile range as appropriate
+           for a Gaussian distribution */
+        sigma = hdrl_iqr(vec_image) / 1.349;
+
+        lower_bound = median - kappa_low * sigma;
+        upper_bound = median + kappa_high * sigma;
+
+        lower_index = get_lower_bound(vec_image, lower_bound);
+        upper_index = get_upper_bound(vec_image, upper_bound);
+        upper_index = CX_MAX(upper_index - 1, 0);
+
+        /* Stop if no outliers were found */
+        if ((lower_index == 0) && (upper_index == vec_size - 1))
+            break;
+
+        vec_temp = cpl_vector_extract(vec_image, lower_index, upper_index, 1);
+        vec_temp_err = cpl_vector_extract(vec_image_err, 
+                                          lower_index, upper_index, 1);
+
+        cpl_vector_set_size(vec_image, cpl_vector_get_size(vec_temp));
+        cpl_vector_set_size(vec_image_err, cpl_vector_get_size(vec_temp_err));
+
+        cpl_vector_copy(vec_image, vec_temp);
+        cpl_vector_copy(vec_image_err, vec_temp_err);
+        cpl_vector_delete(vec_temp);
+        cpl_vector_delete(vec_temp_err);
+    }
+
+    /*    COMPUTE THE KAPPA-SIGMA CLIP MEAN */
+    *mean_ks  = cpl_vector_get_mean(vec_image);
+
+    if (naccepted) *naccepted = cpl_vector_get_size(vec_image);
+
+    if (mean_ks_err) {
+        /*Propagate the errors (cpl_vector_power is very slow PIPE-4330) */
+        cpl_vector_multiply(vec_image_err, vec_image_err);
+        /*workaround for missing function cpl_vector_get_sum() */
+        *mean_ks_err = sqrt(cpl_vector_get_mean(vec_image_err) /
+                            (int)cpl_vector_get_size(vec_image_err));
+    }
+
+    if (reject_low) *reject_low = lower_bound;
+    if (reject_high) *reject_high = upper_bound;
+
+    /* CLEAN, AND RETURN */
+    cpl_vector_delete(vec_image);
+    cpl_vector_delete(vec_image_err);
+    return cpl_error_get_code();
+}
+
+/**@}*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @internal
+  @brief   Compute inter-quartile range (iqr) of a vector. 
+  @param   vec a sorted vector for which the iqr is to be computed.
+  @return  The iqr
+
+  The function computes the iqr of a vector. In case of an error,
+  @f$-1.0 at f$ is returned.
+  For efficiency reasons the vector is required to be sorted before being
+  passed into this function. If this is the case is not verified.
+
+  As an estimate for the scale the IQR / 1.349 has an asymptotic statistical
+  efficiency of 61% for normal distributed (or thin tailed) data. The
+  efficiency is higher than the standard deviation for thick tailed data (e.g.
+  outliers).
+ */
+/*----------------------------------------------------------------------------*/
+static double hdrl_iqr(const cpl_vector * sort_vec)
+{
+    double       iqr = -1.0;
+    long         N, N25;
+
+    N = cpl_vector_get_size(sort_vec);
+
+    /* 4 cases depending on the number of elements */
+    if (N % 4 == 0) {
+        N25 = N / 4;
+        iqr =   0.75 * cpl_vector_get(sort_vec, 3 * N25 - 1)
+              + 0.25 * cpl_vector_get(sort_vec, 3 * N25)
+              - 0.25 * cpl_vector_get(sort_vec, N25 - 1)
+              - 0.75 * cpl_vector_get(sort_vec, N25);
+        return fabs(iqr);
+    }
+    else if (N % 4 == 1) {
+        N25 = (N - 1) / 4;
+        iqr =   cpl_vector_get(sort_vec, 3 * N25)
+              - cpl_vector_get(sort_vec, N25);
+        return fabs(iqr);
+    }
+    else if (N % 4 == 2) {
+        N25 = (N - 2) / 4;
+        iqr =   0.25 * cpl_vector_get(sort_vec, 3 * N25)
+              + 0.75 * cpl_vector_get(sort_vec, 3 * N25 + 1)
+              - 0.75 * cpl_vector_get(sort_vec, N25)
+              - 0.25 * cpl_vector_get(sort_vec, N25 + 1);
+        return fabs(iqr);
+    }
+    else {
+        N25 = (N - 3) / 4;
+        iqr =   0.50 * cpl_vector_get(sort_vec, 3 * N25 + 1)
+              + 0.50 * cpl_vector_get(sort_vec, 3 * N25 + 2)
+              - 0.50 * cpl_vector_get(sort_vec, N25)
+              - 0.50 * cpl_vector_get(sort_vec, N25 + 1);
+        return fabs(iqr);
+    }
+}
+
+/*---------------------------------------------------------------------------*/
+/**
+  @brief   Sort an array @a u1 of doubles, and permute an array @a u2
+           in the same way as @a u1 is permuted.
+  @param   u1   Pointer to the first array.
+  @param   u2   Pointer to the second array.
+  @param   n    The common length of both arrays.
+  @return   @c CPL_ERROR_NONE or the appropriate error code.
+ */
+/*---------------------------------------------------------------------------*/
+static cpl_error_code hdrl_sort_double_pairs(double *u1, double *u2, cpl_size n)
+{
+    cpl_vector * biu1 = NULL;
+    cpl_vector * biu2 = NULL;
+    cpl_bivector * bi_all = NULL;
+
+    cpl_ensure_code(n >= 1, CPL_ERROR_ILLEGAL_INPUT);
+    cpl_error_ensure(u1 != NULL, CPL_ERROR_NULL_INPUT,
+                     return CPL_ERROR_NULL_INPUT, "NULL pointer to 1st array");
+    cpl_error_ensure(u2 != NULL, CPL_ERROR_NULL_INPUT,
+                     return CPL_ERROR_NULL_INPUT, "NULL pointer to 2nd array");
+
+    biu1 = cpl_vector_wrap(n, u1);
+    biu2 = cpl_vector_wrap(n, u2);
+    bi_all = cpl_bivector_wrap_vectors(biu1, biu2);
+    cpl_bivector_sort(bi_all, bi_all, CPL_SORT_ASCENDING, CPL_SORT_BY_X);
+
+    /* cleaning up */
+    cpl_bivector_unwrap_vectors(bi_all);
+    cpl_vector_unwrap(biu1);
+    cpl_vector_unwrap(biu2);
+
+    return CPL_ERROR_NONE;
+}
diff --git a/mosca/libmosca/hdrl_sigclip.h b/mosca/libmosca/hdrl_sigclip.h
new file mode 100644
index 0000000..7331d1b
--- /dev/null
+++ b/mosca/libmosca/hdrl_sigclip.h
@@ -0,0 +1,81 @@
+/* $Id: hdrl_sigclip.h,v 1.3 2013-10-16 16:52:20 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2012,2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 16:52:20 $
+ * $Revision: 1.3 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_SIGCLIP_H_
+#define HDRL_SIGCLIP_H_
+
+/*-----------------------------------------------------------------------------
+                                Include
+ -----------------------------------------------------------------------------*/
+
+#include <cpl.h>
+#include "hdrl_parameter.h" 
+
+/*-----------------------------------------------------------------------------
+                            Functions prototypes
+ -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+
+cpl_parameterlist * hdrl_sigclip_parameter_create_parlist(
+        const char              *   full_prefix,
+        const char              *   alias_prefix,
+        const char              *   context,
+        const hdrl_parameter    *   defaults) ;
+cpl_error_code hdrl_sigclip_parameter_parse_parlist(
+        const cpl_parameterlist *   parlist,
+        const char              *   prefix,
+        double                  *   kappa_low,
+        double                  *   kappa_high,
+        int                     *   nclip) ;
+
+cpl_error_code hdrl_kappa_sigma_clip_image(
+        const cpl_image   * source,
+        const cpl_image   * error,
+        const double        kappa_low,
+        const double        kappa_high,
+        const int           iter,
+        double            * mean_ks,
+        double            * mean_ks_err,
+        cpl_size          * naccepted,
+        double            * reject_low,
+        double            * reject_high) ;
+
+cpl_error_code hdrl_kappa_sigma_clip(
+        const cpl_vector  * vec,
+        const cpl_vector  * vec_err,
+        const double        kappa_low,
+        const double        kappa_high,
+        const int           iter,
+        double            * mean_ks,
+        double            * mean_ks_err,
+        cpl_size          * naccepted,
+        double            * reject_low,
+        double            * reject_high) ;
+
+CPL_END_DECLS
+
+#endif /* HDRL_SIGCLIP_H_ */
diff --git a/irplib/irplib_flat.h b/mosca/libmosca/hdrl_types.h
similarity index 60%
copy from irplib/irplib_flat.h
copy to mosca/libmosca/hdrl_types.h
index a363a16..e38abc9 100644
--- a/irplib/irplib_flat.h
+++ b/mosca/libmosca/hdrl_types.h
@@ -1,7 +1,7 @@
-/* $Id: irplib_flat.h,v 1.4 2005/09/15 11:47:16 llundin Exp $
+/* $Id: hdrl_types.h,v 1.1 2013-10-16 11:31:14 cgarcia Exp $
  *
- * This file is part of the irplib package
- * Copyright (C) 2002,2003 European Southern Observatory
+ * This file is part of the HDRL
+ * Copyright (C) 2013 European Southern Observatory
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,26 +15,29 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 /*
- * $Author: llundin $
- * $Date: 2005/09/15 11:47:16 $
- * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:14 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
  */
 
-#ifndef IRPLIB_FLAT_H
-#define IRPLIB_FLAT_H
+#ifndef HDRL_TYPES_H
+#define HDRL_TYPES_H
+
+#include <stddef.h> /* for size_t */
 
 /*-----------------------------------------------------------------------------
-                                   Includes
+                                   Generic types
  -----------------------------------------------------------------------------*/
 
-#include <cpl.h>
+typedef void * (hdrl_alloc)(size_t);
+typedef void (hdrl_free)(void *);
 
-cpl_imagelist * irplib_flat_fit_set(cpl_imagelist *, int) ;
-double * irplib_flat_fit_slope_robust(double *, double *, int) ;
+/* basic type for bit mask values, e.g. bad pixel classifications */
+typedef unsigned int hdrl_bitmask_t;
 
-#endif
+#endif 
diff --git a/mosca/libmosca/hdrl_utils.c b/mosca/libmosca/hdrl_utils.c
new file mode 100644
index 0000000..dfd522b
--- /dev/null
+++ b/mosca/libmosca/hdrl_utils.c
@@ -0,0 +1,1043 @@
+/* $Id: hdrl_utils.c,v 1.2 2013-10-16 11:31:07 cgarcia Exp $
+ *
+ * This file is part of the HDRL 
+ * Copyright (C) 2012,2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:31:07 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/*-----------------------------------------------------------------------------
+                                   Includes
+-----------------------------------------------------------------------------*/
+
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 500 /* posix 2001, mkstemp */
+#endif
+
+#include "hdrl_utils.h"
+#include "hdrl_elemop.h"
+#include <string.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <math.h>
+
+/*-----------------------------------------------------------------------------
+                                   Static
+ -----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @defgroup hdrl_utils   UTILITIES Module
+  
+  This module contain various utilities functions that might be used in several
+  of the HDRL modules
+ */
+/*----------------------------------------------------------------------------*/
+
+/**@{*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief	Get the pipeline copyright and license
+  @return   The copyright and license string
+
+  The function returns a pointer to the statically allocated license string.
+  This string should not be modified using the returned pointer.
+ */
+/*----------------------------------------------------------------------------*/
+const char * hdrl_get_license(void)
+{
+    const char  *   hdrl_license =
+        "This file is part of the HDRL Instrument Pipeline\n"
+        "Copyright (C) 2012,2013 European Southern Observatory\n"
+        "\n"
+        "This program is free software; you can redistribute it and/or modify\n"
+        "it under the terms of the GNU General Public License as published by\n"
+        "the Free Software Foundation; either version 2 of the License, or\n"
+        "(at your option) any later version.\n"
+        "\n"
+        "This program is distributed in the hope that it will be useful,\n"
+        "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+        "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
+        "GNU General Public License for more details.\n"
+        "\n"
+        "You should have received a copy of the GNU General Public License\n"
+        "along with this program; if not, write to the Free Software\n"
+        "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, \n"
+        "MA  02110-1301  USA";
+
+    return hdrl_license;
+}
+
+/*-----------------------------------------------------------------------------
+                Rectangular Region Parameters Definition
+ -----------------------------------------------------------------------------*/
+typedef struct {
+    HDRL_PARAMETER_HEAD;
+    cpl_size    llx ;
+    cpl_size    lly ;
+    cpl_size    urx ;
+    cpl_size    ury ;
+} hdrl_rect_region_parameter;
+/* Parameter type */
+static hdrl_parameter_typeobj hdrl_rect_region_parameter_type = {
+    (hdrl_alloc *)&cpl_malloc,      /* fp_alloc */
+    (hdrl_free *)&cpl_free,         /* fp_free */
+    NULL,                           /* fp_destroy */
+    sizeof(hdrl_rect_region_parameter), /* obj_size */
+};
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Creates Rect Region Parameters object
+  @param    llx
+  @param    lly
+  @param    urx
+  @param    ury
+  @return   the Rect Region parameters
+ */
+/*----------------------------------------------------------------------------*/
+hdrl_parameter * hdrl_rect_region_parameter_create(
+        cpl_size    llx,
+        cpl_size    lly,
+        cpl_size    urx,
+        cpl_size    ury)
+{
+    hdrl_rect_region_parameter * p = (hdrl_rect_region_parameter *)
+               hdrl_parameter_new(&hdrl_rect_region_parameter_type);
+    p->llx = llx ;
+    p->lly = lly ;
+    p->urx = urx ;
+    p->ury = ury ;
+    return (hdrl_parameter *)p;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Update Rect Region Parameters object
+  @param    rect_region     The region to update
+  @param    llx
+  @param    lly
+  @param    urx
+  @param    ury
+  @return   the error code in case of error or CPL_ERROR_NONE
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_rect_region_parameter_update(
+        hdrl_parameter  *   rect_region,
+        cpl_size            llx,
+        cpl_size            lly,
+        cpl_size            urx,
+        cpl_size            ury)
+{
+    hdrl_rect_region_parameter * p = (hdrl_rect_region_parameter *)rect_region ;
+    p->llx = llx ;
+    p->lly = lly ;
+    p->urx = urx ;
+    p->ury = ury ;
+    return hdrl_rect_region_parameter_verify(rect_region, -1, -1);
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Check that the parameter is hdrl_rect_region parameter
+  @return   the parameter to check
+ */
+/*----------------------------------------------------------------------------*/
+cpl_boolean hdrl_rect_region_parameter_check(const hdrl_parameter * self)
+{
+    return hdrl_parameter_check_type(self, &hdrl_rect_region_parameter_type);
+}
+
+/*-----------------------------------------------------------------------------
+                        Rect Region Parameters Accessors
+ -----------------------------------------------------------------------------*/
+cpl_size hdrl_rect_region_get_llx(const hdrl_parameter * p) 
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, -1) ;
+    return ((hdrl_rect_region_parameter *)p)->llx;
+}
+cpl_size hdrl_rect_region_get_lly(const hdrl_parameter * p) 
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, -1) ;
+    return ((hdrl_rect_region_parameter *)p)->lly;
+}
+cpl_size hdrl_rect_region_get_urx(const hdrl_parameter * p) 
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, -1) ;
+    return ((hdrl_rect_region_parameter *)p)->urx;
+}
+cpl_size hdrl_rect_region_get_ury(const hdrl_parameter * p) 
+{
+    cpl_ensure(p, CPL_ERROR_NULL_INPUT, -1) ;
+    return ((hdrl_rect_region_parameter *)p)->ury;
+}
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    Verify basic correctness of the parameters
+  @param    param   rect region parameters
+  @param    max_x   max value for upper x bound, set to < 0 to skip check
+  @param    max_y   max value for upper y bound, set to < 0 to skip check
+  @return   CPL_ERROR_NONE if everything is ok, an error code otherwise
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_rect_region_parameter_verify(
+        const hdrl_parameter    *   param,
+        const cpl_size              max_x,
+        const cpl_size              max_y)
+{
+    const hdrl_rect_region_parameter * param_loc =
+        (hdrl_rect_region_parameter *)param ;
+
+    cpl_error_ensure(param != NULL, CPL_ERROR_NULL_INPUT,
+            return CPL_ERROR_NULL_INPUT, "NULL Input Parameters");
+    cpl_error_ensure(hdrl_rect_region_parameter_check(param),
+            CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT, 
+            "Expected Rect Region parameter") ;
+    cpl_error_ensure(param_loc->llx >= 1 && param_loc->lly >= 1 &&
+            param_loc->urx >= 1 && param_loc->ury >= 1, CPL_ERROR_ILLEGAL_INPUT,
+            return CPL_ERROR_ILLEGAL_INPUT,
+            "Coordinates must be strictly positive");
+
+    cpl_error_ensure(param_loc->urx >= param_loc->llx, CPL_ERROR_ILLEGAL_INPUT,
+                     return CPL_ERROR_ILLEGAL_INPUT,
+                     "urx (%ld) must be larger equal than llx (%ld)",
+                     (long)param_loc->urx, (long)param_loc->llx);
+    cpl_error_ensure(param_loc->ury >= param_loc->lly, CPL_ERROR_ILLEGAL_INPUT,
+                     return CPL_ERROR_ILLEGAL_INPUT,
+                     "ury (%ld) must be larger equal than lly (%ld)",
+                     (long)param_loc->ury, (long)param_loc->lly);
+    if (max_x > 0)
+        cpl_error_ensure(param_loc->urx <= max_x, CPL_ERROR_ILLEGAL_INPUT,
+                         return CPL_ERROR_ILLEGAL_INPUT,
+                         "urx %zu larger than maximum %zu",
+                         (size_t)param_loc->urx, (size_t)max_x);
+    if (max_y > 0)
+        cpl_error_ensure(param_loc->urx <= max_x, CPL_ERROR_ILLEGAL_INPUT,
+                         return CPL_ERROR_ILLEGAL_INPUT,
+                         "ury %zu larger than maximum %zu",
+                         (size_t)param_loc->ury, (size_t)max_y);
+    return CPL_ERROR_NONE;
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief    wrap negative or zero entries around full image size
+  @param    region  rect region to wrap
+  @param    nx   image size in x, nx is added to negative or zero entries
+  @param    ny   image size in y, ny is added to negative or zero entries
+  @return  cpl_error_code
+
+  allows reverse indexing: 0 would be nx, -2 would be nx - 2 etc
+  Wrapping is based in FITS convention: 1 first pixel, nx last pixel inclusive
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code hdrl_rect_region_wrap(
+        hdrl_parameter    *     rect_region,
+        const cpl_size          nx,
+        const cpl_size          ny)
+{
+    hdrl_rect_region_parameter * rr_loc =
+        (hdrl_rect_region_parameter *)rect_region ;
+
+    cpl_error_ensure(rect_region != 0, CPL_ERROR_NULL_INPUT,
+            return CPL_ERROR_NULL_INPUT, "region input must not be NULL");
+    cpl_error_ensure(hdrl_rect_region_parameter_check(rect_region),
+            CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
+            "Expected Rect Region parameter") ;
+
+    if (nx > 0 && rr_loc->llx < 1) rr_loc->llx += nx;
+    if (ny > 0 && rr_loc->lly < 1) rr_loc->lly += ny;
+    if (nx > 0 && rr_loc->urx < 1) rr_loc->urx += nx;
+    if (ny > 0 && rr_loc->ury < 1) rr_loc->ury += ny;
+
+    return hdrl_rect_region_parameter_verify(rect_region, nx, ny);
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+  @brief Create parameter list for hdrl_rect_region
+  @param full_prefix    prefix for parameter name
+  @param alias_prefix   prefix for cli alias 
+  @param name_prefix    prefix for the parameter names (can be "")
+  @param context        context of parameter
+  @param defaults       default parameters values
+  @return cpl_parameterlist
+ 
+  Creates a parameterlist with one parameter per point in a rectangle
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_parameterlist * hdrl_rect_region_parameter_create_parlist(
+        const char              *   full_prefix,
+        const char              *   alias_prefix,
+        const char              *   name_prefix,
+        const char              *   context,
+        const hdrl_parameter    *   defaults)
+{
+    cpl_ensure(full_prefix && context && alias_prefix && name_prefix &&defaults,
+            CPL_ERROR_NULL_INPUT, NULL);
+    const char          *   full_sep = strlen(full_prefix) > 0 ? "." : "";
+    const char          *   alias_sep = strlen(alias_prefix) > 0 ? "." : "";
+    cpl_parameterlist   *   parlist = cpl_parameterlist_new();
+
+    /* --prefix.llx */
+    hdrl_setup_vparameter(parlist, full_prefix, full_sep, name_prefix,
+                         alias_prefix, alias_sep, "llx", context,
+                         "Lower left x pos. (FITS) defining the region",
+                         CPL_TYPE_INT, hdrl_rect_region_get_llx(defaults));
+    /* --prefix.lly */
+    hdrl_setup_vparameter(parlist, full_prefix, full_sep, name_prefix,
+                         alias_prefix, alias_sep, "lly", context,
+                         "Lower left y pos. (FITS) defining the region",
+                         CPL_TYPE_INT, hdrl_rect_region_get_lly(defaults));
+
+    /* --prefix.urx */
+    hdrl_setup_vparameter(parlist, full_prefix, full_sep, name_prefix,
+                         alias_prefix, alias_sep, "urx", context,
+                         "Upper right x pos. (FITS) defining the region",
+                         CPL_TYPE_INT, hdrl_rect_region_get_urx(defaults));
+
+    /* --prefix.ury */
+    hdrl_setup_vparameter(parlist, full_prefix, full_sep, name_prefix,
+                         alias_prefix, alias_sep, "ury", context,
+                         "Upper right y pos. (FITS) defining the region",
+                         CPL_TYPE_INT, hdrl_rect_region_get_ury(defaults));
+
+    if (cpl_error_get_code()) {
+        cpl_parameterlist_delete(parlist);
+        return NULL;
+    }
+
+    return parlist;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ @brief parse parameterlist for rectangle parameters
+ @param parlist    parameter list to parse
+ @param prefix     prefix of parameter name
+ @see   hdrl_rect_get_parlist()
+ @return A newly allocated hdrl_rect_region parameter or NULL in error case
+    
+ The returned object must be deallocated with hdrl_parameter_delete()
+ parameterlist should have been created with hdrl_rect_get_parlist or have the 
+ same name hierachy
+ */
+/* ---------------------------------------------------------------------------*/
+hdrl_parameter * hdrl_rect_region_parameter_parse_parlist(
+        const cpl_parameterlist *   parlist,
+        const char              *   prefix,
+        const char              *   name_prefix)
+{
+    cpl_size llx, lly, urx, ury ;
+    cpl_error_ensure(prefix && parlist, CPL_ERROR_NULL_INPUT,
+            return NULL, "NULL Input Parameters");
+    char * name;
+    const char * sep = strlen(prefix) > 0 ? "." : "";
+    const char * points[] = {"llx", "lly", "urx", "ury"};
+    cpl_size * dest[] = {&llx, &lly, &urx, &ury};
+    for (size_t i = 0; i < 4; i++) {
+        name = cpl_sprintf("%s%s%s%s", prefix, sep, name_prefix, points[i]);
+        const cpl_parameter * par = cpl_parameterlist_find_const(parlist, name);
+        *(dest[i]) = cpl_parameter_get_int(par);
+        cpl_free(name);
+    }
+    return hdrl_rect_region_parameter_create(llx, lly, urx, ury) ;
+}
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief return file descriptor of a temporary file
+ * @param dir     directory prefix to place the file in, may be NULL
+ * @param unlink  unlink the file from the filesystem immediately
+ * @return file descriptor or -1 on error
+ * @note if dir is NULL or not writable it tries to create a file in following
+ *       directories in decreasing order of preference:
+ *       $TMPDIR, /var/tmp, /tmp, $PWD
+ */
+/* ---------------------------------------------------------------------------*/
+int hdrl_get_tempfile(const char * dir, cpl_boolean unlink)
+{
+    /* options in decreasing preference */
+    const char * tmpdirs[] = {
+        /* user override */
+        getenv("TMPDIR"),
+        /* large file temp */
+        "/var/tmp/",
+        /* small file temp, may be tmpfs */
+        "/tmp/"
+    };
+    const size_t ndirs = sizeof(tmpdirs) / sizeof(tmpdirs[0]);
+    const char * tmpdir = NULL;
+
+    if (dir && access(dir, W_OK) == 0) {
+        tmpdir = dir;
+    }
+    else {
+        for (size_t i = 0; i < ndirs; i++) {
+            if (tmpdirs[i] && access(tmpdirs[i], W_OK) == 0) {
+                tmpdir = tmpdirs[i];
+                break;
+            }
+        }
+    }
+
+    {
+        /* try $PWD if no tmpdir found */
+        char * template = tmpdir ? cpl_sprintf("%s/hdrl_tmp_XXXXXX", tmpdir) :
+                                   cpl_strdup("hdrl_tmp_XXXXXX");
+        int fd = mkstemp(template);
+        if (fd == -1) {
+            cpl_error_set_message(cpl_func, CPL_ERROR_FILE_IO,
+                                  "Temporary file creation failed: %s",
+                                  strerror(errno));
+            cpl_free(template);
+            return -1;
+        }
+
+        cpl_msg_debug(cpl_func, "Created tempfile %s", template);
+
+        if (unlink) {
+            remove(template);
+        }
+        cpl_free(template);
+
+        return fd;
+    }
+}
+/*----------------------------------------------------------------------------*/
+/**
+  @internal
+  @brief    compress an image to a vector removing bad pixels
+  @param    source     image to compress
+  @param    bpm        optional bpm to use instead of the one in the image
+  @return  cpl_vector or NULL if no good pixels or error
+  @note    vector can't have size 0 so NULL is returned if all pixels are bad
+ */
+/*----------------------------------------------------------------------------*/
+cpl_vector * hdrl_image_to_vector(
+        const cpl_image     *   source, 
+        const cpl_mask      *   bpm)
+{
+    cpl_ensure(source != NULL, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_vector * vec_source = NULL;
+    /* only cast if required, extra copying of non double data is still
+     * faster than a loop with cpl_image_get */
+    cpl_image * d_img = cpl_image_get_type(source) == CPL_TYPE_DOUBLE ?
+        (cpl_image *)source : cpl_image_cast(source, CPL_TYPE_DOUBLE);
+
+    const cpl_size naxis1 = cpl_image_get_size_x(source);
+    const cpl_size naxis2 = cpl_image_get_size_y(source);
+
+    /* get raw data */
+    const double * restrict sdata = cpl_image_get_data_double_const(d_img);
+    const cpl_binary * restrict bpmd = NULL;
+
+    /* allocate output buffer */
+    double * restrict ddata = cpl_malloc(naxis1 * naxis2 *
+                                         sizeof(ddata[0]));
+    long j = 0;
+
+    if (bpm)
+        bpmd = cpl_mask_get_data_const(bpm);
+    else if (cpl_image_get_bpm_const(source) != NULL)
+        bpmd = cpl_mask_get_data_const(cpl_image_get_bpm_const(source));
+
+    if (bpmd == NULL) {
+        memcpy(ddata, sdata, naxis1 * naxis2 * sizeof(ddata[0]));
+        j = naxis1 * naxis2;
+    }
+    else {
+        /* copy only good pixels */
+        for (long i = 0; i < naxis1 * naxis2; i++) {
+            if (bpmd[i] == CPL_BINARY_0) {
+                ddata[j] = sdata[i];
+                j++;
+            }
+        }
+    }
+
+    assert(j == naxis1 * naxis2 -
+           (bpm ? cpl_mask_count(bpm) : cpl_image_count_rejected(source)));
+
+    if (j > 0) {
+        vec_source = cpl_vector_wrap(j, ddata);
+    }
+    else {
+        cpl_free(ddata);
+    }
+
+    if (d_img != source) cpl_image_delete(d_img);
+
+    return vec_source;
+}
+
+
+/*----------------------------------------------------------------------------*/
+/**
+  @internal
+  @brief    compress an imagelist to a vector via z axis, removing bad pixels
+  @param    list     imagelist to compress
+  @param    x        x coordinate to compress over (FITS convention)
+  @param    y        y coordinate to compress over (FITS convention)
+  @return  cpl_vector or NULL if no good pixels or error
+  @note    vector can't have size 0 so NULL is returned if all pixels are bad
+ */
+/*----------------------------------------------------------------------------*/
+cpl_vector * hdrl_imagelist_to_vector(const cpl_imagelist * list,
+                                     const cpl_size x,
+                                     const cpl_size y)
+{
+    const long nz  = list ? cpl_imagelist_get_size(list) : -1;
+    cpl_vector * vec = NULL;
+    double * restrict ddata = NULL;
+    long j = 0;
+
+    cpl_ensure(list != NULL, CPL_ERROR_NULL_INPUT, NULL);
+    cpl_ensure(nz > 0, CPL_ERROR_ILLEGAL_INPUT, NULL);
+    cpl_ensure(x > 0, CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
+    cpl_ensure(y > 0, CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
+
+    {
+        const cpl_image  * img = cpl_imagelist_get_const(list, 0);
+        const cpl_size nx = cpl_image_get_size_x(img);
+        const cpl_size ny = cpl_image_get_size_y(img);
+        cpl_ensure(x <= nx, CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
+        cpl_ensure(y <= ny, CPL_ERROR_ACCESS_OUT_OF_RANGE, NULL);
+    }
+
+    ddata = cpl_malloc(nz * sizeof(ddata[0]));
+
+    for (long k = 0; k < nz; k++) {
+        int rej;
+        const cpl_image * img = cpl_imagelist_get_const(list, k);
+        cpl_image * d_img = cpl_image_get_type(img) == CPL_TYPE_DOUBLE ?
+            (cpl_image *)img : cpl_image_cast(img, CPL_TYPE_DOUBLE);
+
+        double v = cpl_image_get(img, x, y, &rej);
+        if (!rej) {
+            ddata[j] = v;
+            j++;
+        }
+
+        if (d_img != img) cpl_image_delete(d_img);
+    }
+
+    if (j > 0) {
+        vec = cpl_vector_wrap(j, ddata);
+    }
+    else {
+        cpl_free(ddata);
+    }
+
+    return vec;
+}
+
+/**
+ * @brief
+ *   Computes the mean of an image and propagates the associated error
+ *
+ * @internal
+ * @param  ima      The image where to calculate the mean
+ * @param  err      The associated error image (optional, can also be NULL)
+ * @param  location function pointer to calculate location (mean)
+ * @param  error    function pointer to calculate error of location
+ * @param  mean     The calculated mean
+ * @param  meanerr  The propagated error (if no error is passed it is set to NAN)
+ *
+ * @return A CPL error code
+ *
+ */
+static cpl_error_code
+hdrl_calc_location_image_(
+    const cpl_image * ima,
+    const cpl_image * err,
+    double(*location)(const cpl_image * img),
+    double(*error)(const cpl_image * err, const cpl_size contrib),
+    double * mean,
+    double * meanerr)
+{
+    const cpl_size contribution = hdrl_get_image_good_npix(ima);
+
+    if (contribution == 0) {
+        *mean = NAN;
+        *meanerr = NAN;
+        return cpl_error_get_code();
+    }
+
+    *mean = location(ima);
+
+    if (!err) {
+        /* No error propagation done */
+        *meanerr = NAN;
+    }
+    else {
+        const cpl_mask  * loc_mask = cpl_image_get_bpm_const(ima);
+        cpl_image * loc_error = NULL;
+        cpl_ensure_code(cpl_image_get_size_x(ima) == cpl_image_get_size_x(err),
+                        CPL_ERROR_INCOMPATIBLE_INPUT);
+        cpl_ensure_code(cpl_image_get_size_y(ima) == cpl_image_get_size_y(err),
+                        CPL_ERROR_INCOMPATIBLE_INPUT);
+
+        loc_error = cpl_image_cast(err, CPL_TYPE_DOUBLE);
+
+        if (loc_mask) {
+            cpl_image_reject_from_mask(loc_error, loc_mask);
+        }
+
+        *meanerr = error(loc_error, contribution);
+
+        cpl_image_delete(loc_error);
+    }
+
+    return cpl_error_get_code();
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief propagation error of mean of image with errors
+ *
+ * @internal
+ * @param err            input errors
+ * @param contribution   number of good pixels
+ *
+ * @return error
+ */
+/* ---------------------------------------------------------------------------*/
+static double calc_error_mean(const cpl_image * err,
+                              const cpl_size contribution)
+{
+    return sqrt(cpl_image_get_sqflux(err)) / contribution;
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief propagation error of median of image with errors
+ *
+ * @param err            input errors
+ * @param contribution   number of good pixels
+ *
+ * @return error
+ *
+ *  The error is the error of a mean scaled by the sqrt of the statistical
+ *  efficiency (pi / 2) of the median for normal distributed data
+ */
+/* ---------------------------------------------------------------------------*/
+static double calc_error_median(const cpl_image * err,
+                                const cpl_size contribution)
+{
+    if (contribution <= 2) {
+        return calc_error_mean(err, contribution);
+    }
+    else {
+        return sqrt(CPL_MATH_PI / 2.) * calc_error_mean(err, contribution);
+    }
+}
+
+
+/**
+ * @brief
+ *   Computes the mean of an image and propagates the associated error
+ *
+ * @param  ima     The image where to calculate the mean
+ * @param  err     The associated error image (optional, can also be NULL)
+ * @param  mean    The calculated mean
+ * @param  meanerr The propagated error (if no error is passed it is set to NAN)
+ *
+ * @return A CPL error code
+ *
+ */
+cpl_error_code hdrl_calc_mean_image(const cpl_image * ima,
+                                    const cpl_image * err, double * mean,
+                                    double * meanerr)
+{
+    return hdrl_calc_location_image_(ima, err,
+                                     cpl_image_get_mean, calc_error_mean,
+                                     mean, meanerr);
+}
+
+
+/**
+ * @brief
+ *   Computes the median of an image and propagates the associated error
+ *
+ * @param  ima       The image where to calculate the median
+ * @param  err       The associated error image (optional, can also be NULL)
+ * @param  median    The calculated median
+ * @param  medianerr The propagated error (if no error is passed it is set to NAN)
+ *
+ * @return A CPL error code
+ *
+ */
+cpl_error_code hdrl_calc_median_image( const cpl_image * ima,
+                                       const cpl_image * err, double * median,
+                                       double * medianerr)
+{
+    return hdrl_calc_location_image_(ima, err,
+                                     cpl_image_get_median, calc_error_median,
+                                     median, medianerr);
+}
+
+/**
+ * @brief
+ *   Computes the weighted mean of an image and propagates the associated error
+ *
+ * @param  ima      The image where to calculate the weighted mean
+ * @param  err    The associated error image (mandatory)
+ * @param  wmean    The calculated weighted mean
+ * @param  wmeanerr The propagated error
+ *
+ * @return A CPL error code
+ *
+ * @doc
+ * weighted mean and associated error are computed with standard formulae
+ *
+ * \f$
+ *   x_{mean}=\frac{(\sum_{i}^{n} w_{i} \cdot x_{i})} { \sum_{i}^{n} w_{i} }
+ * \f$
+ *
+ * \f$
+ *   \sigma_{x}=\frac{ 1 } { \sqrt{  \sum_{i}^{n} w_{i}^{2} } }
+ * \f$
+ */
+cpl_error_code hdrl_calc_weighted_mean_image( const cpl_image * ima,
+                                      const cpl_image * err, double * wmean,
+                                      double * wmeanerr)
+{
+
+    cpl_ensure_code(cpl_image_get_size_x(ima) == cpl_image_get_size_x(err),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+    cpl_ensure_code(cpl_image_get_size_y(ima) == cpl_image_get_size_y(err),
+                    CPL_ERROR_INCOMPATIBLE_INPUT);
+
+
+    const cpl_size contribution = hdrl_get_image_good_npix(ima);
+
+    if (contribution == 0) {
+        *wmean = NAN;
+        *wmeanerr = NAN;
+        return cpl_error_set_message(cpl_func, CPL_ERROR_NULL_INPUT,
+                        "All pixels are flagged as bad");
+    }
+
+    /* (\Sum_i^n w_i * x_i) / (\Sum_i^n w_i) */
+    /* 1 / \sqrt(\Sum_i^n w_i^2) */
+
+    cpl_image * ima_loc = cpl_image_cast(ima, CPL_TYPE_DOUBLE);
+    cpl_image * err_loc = cpl_image_cast(err, CPL_TYPE_DOUBLE);
+
+    const cpl_mask * mask=cpl_image_get_bpm_const(ima);
+    if(mask != NULL){
+        cpl_image_reject_from_mask(err_loc, mask);
+    }
+
+    cpl_image_power(err_loc, -2);
+    cpl_image_multiply(ima_loc, err_loc);
+    double sum_weights = cpl_image_get_flux(err_loc);
+    double sum_ima_weights = cpl_image_get_flux(ima_loc);
+    cpl_image_delete(ima_loc);
+    cpl_image_delete(err_loc);
+
+    *wmean = sum_ima_weights / sum_weights;
+    *wmeanerr = 1 / sqrt(sum_weights);
+    return cpl_error_get_code();
+
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief scale a imagelist using scaling factors in a vector
+ *
+ * @param scale      vector containing scaling factors, the first element
+ *                   defines the value to scale to
+ * @param scale_e    errors of the scaling factors
+ * @param scale_type scale type, additive or multiplicative
+ * @param data       imagelist to be scaled
+ * @param errors     errors of imagelist to be scaled
+ *
+ * If scale_type is HDRL_SCALE_ADDITIVE the difference of each value in the
+ * scaling vector is subtracted from the first element of the vector and added
+ * to each image in the imagelist.
+ *
+ * for i in vector.size:
+ *   data[i] += vector[0] - vector[i]
+ *
+ * If scale_type is HDRL_SCALE_MULTIPLICATIVE the quotient of each value in
+ * the scaling vector to the first element of the vector is multiplied
+ * to each image in the imagelist.
+ * If an element of the scaling vector is zero the image will have all its
+ * pixels marked as bad in its bad pixel map.
+ *
+ * for i in vector.size:
+ *   data[i] *= vector[0] / vector[i]
+ *
+ * The errors are propagated using error propagation of first order
+ * and assuming no correlations between the values.
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_normalize_imagelist_by_vector(const cpl_vector * scale,
+                                   const cpl_vector * scale_e,
+                                   const hdrl_scale_type scale_type,
+                                   cpl_imagelist * data,
+                                   cpl_imagelist * errors)
+{
+    cpl_ensure_code(scale, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(scale_e, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(data, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(errors, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(cpl_vector_get_size(scale) == cpl_imagelist_get_size(data),
+                    CPL_ERROR_ILLEGAL_INPUT);
+    cpl_ensure_code(cpl_vector_get_size(scale_e) == cpl_vector_get_size(scale),
+                    CPL_ERROR_ILLEGAL_INPUT);
+    cpl_ensure_code(cpl_imagelist_get_size(errors) ==
+                    cpl_imagelist_get_size(data), CPL_ERROR_ILLEGAL_INPUT);
+
+    for (size_t i = 1; i < (size_t)cpl_imagelist_get_size(data); i++) {
+        const double dfirst = cpl_vector_get(scale, 0);
+        const double efirst = cpl_vector_get(scale_e, 0);
+        cpl_image * dimg = cpl_imagelist_get(data, i);
+        cpl_image * eimg = cpl_imagelist_get(errors, i);
+        if (scale_type == HDRL_SCALE_ADDITIVE) {
+            double dscale_o = cpl_vector_get(scale, i);
+            double escale_o =  cpl_vector_get(scale_e, i);
+
+            /* dscale = dfirst - dscale_o */
+            double dscale = dfirst;
+            double escale = efirst;
+            hdrl_elemop_sub(&dscale, &escale, 1, &dscale_o, &escale_o, 1, NULL);
+
+            /* dimg = dimg + dscale */
+            hdrl_elemop_image_add_scalar(dimg, eimg, dscale, escale);
+        }
+        else if (scale_type == HDRL_SCALE_MULTIPLICATIVE) {
+            double dscale_o = cpl_vector_get(scale, i);
+            double escale_o = cpl_vector_get(scale_e, i);
+
+            if (dscale_o == 0.) {
+                cpl_msg_warning(cpl_func, "scale factor of image %zu is "
+                                "not a number", i);
+                cpl_image_add_scalar(dimg, NAN);
+                cpl_image_add_scalar(eimg, NAN);
+                cpl_image_reject_value(dimg, CPL_VALUE_NAN);
+                cpl_image_reject_value(eimg, CPL_VALUE_NAN);
+                continue;
+            }
+
+            /* dscale = dfirst / dscale_o */
+            double dscale = dfirst;
+            double escale = efirst;
+            hdrl_elemop_div(&dscale, &escale, 1, &dscale_o, &escale_o, 1, NULL);
+
+            /* dimg = dimg * dscale */
+            hdrl_elemop_image_mul_scalar(dimg, eimg, dscale, escale);
+        }
+        else {
+            return cpl_error_set_message(cpl_func, CPL_ERROR_UNSUPPORTED_MODE,
+                                         "Unsupported scale type");
+        }
+
+        if (cpl_error_get_code())
+            break;
+    }
+
+    return cpl_error_get_code();
+}
+
+
+/* ---------------------------------------------------------------------------*/
+/**
+ * @brief scale a imagelist using scaling images
+ *
+ * @param scale      imagelist containing scaling factors, the first element
+ *                   defines the value to scale to
+ * @param scale_e    errors of the scaling factors
+ * @param scale_type scale type, additive or multiplicative
+ * @param data       imagelist to be scaled
+ * @param errors     errors of imagelist to be scaled
+ *
+ * If scale_type is HDRL_SCALE_ADDITIVE the difference of each value in the
+ * scaling imagelist is subtracted from the first element of the vector and
+ * added to each image in the imagelist.
+ *
+ * for i in vector.size:
+ *   data[i] += scale[0] - scale[i]
+ *
+ * If scale_type is HDRL_SCALE_MULTIPLICATIVE the quotient of each value in
+ * the scaling vector to the first element of the imagelist is multiplied
+ * to each image in the imagelist.
+ * If an element of the scaling vector is zero the image will have all its
+ * pixels marked as bad in its bad pixel map.
+ *
+ * for i in vector.size:
+ *   data[i] *= scale[0] / scale[i]
+ *
+ * The errors are propagated using error propagation of first order
+ * and assuming no correlations between the values.
+ */
+/* ---------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_normalize_imagelist_by_imagelist(const cpl_imagelist * scale,
+                                      const cpl_imagelist * scale_e,
+                                      const hdrl_scale_type scale_type,
+                                      cpl_imagelist * data,
+                                      cpl_imagelist * errors)
+{
+    cpl_ensure_code(scale, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(scale_e, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(data, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(errors, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(cpl_imagelist_get_size(scale) ==
+                    cpl_imagelist_get_size(data), CPL_ERROR_ILLEGAL_INPUT);
+    cpl_ensure_code(cpl_imagelist_get_size(scale_e) ==
+                    cpl_imagelist_get_size(scale), CPL_ERROR_ILLEGAL_INPUT);
+    cpl_ensure_code(cpl_imagelist_get_size(errors) ==
+                    cpl_imagelist_get_size(data), CPL_ERROR_ILLEGAL_INPUT);
+
+    for (size_t i = 1; i < (size_t)cpl_imagelist_get_size(data); i++) {
+        cpl_image * dscale =
+            cpl_image_duplicate(cpl_imagelist_get_const(scale, 0));
+        cpl_image * escale =
+            cpl_image_duplicate(cpl_imagelist_get_const(scale_e, 0));
+        cpl_image * dimg = cpl_imagelist_get(data, i);
+        cpl_image * eimg = cpl_imagelist_get(errors, i);
+        const cpl_image * dscale_o = cpl_imagelist_get_const(scale, i);
+        const cpl_image * escale_o = cpl_imagelist_get_const(scale_e, i);
+
+        if (scale_type == HDRL_SCALE_ADDITIVE) {
+            /* dscale = dfirst - dscale_o */
+            hdrl_elemop_image_sub_image(dscale, escale, dscale_o, escale_o);
+
+            /* dimg = dimg + dscale */
+            hdrl_elemop_image_add_image(dimg, eimg, dscale, escale);
+        }
+        else if (scale_type == HDRL_SCALE_MULTIPLICATIVE) {
+            /* dscale = dfirst / dscale_o */
+            hdrl_elemop_image_div_image(dscale, escale, dscale_o, escale_o);
+
+            /* dimg = dimg * dscale */
+            hdrl_elemop_image_mul_image(dimg, eimg, dscale, escale);
+        }
+        else {
+            cpl_image_delete(dscale);
+            cpl_image_delete(escale);
+            return cpl_error_set_message(cpl_func, CPL_ERROR_UNSUPPORTED_MODE,
+                                         "Unsupported scale type");
+        }
+
+        cpl_image_delete(dscale);
+        cpl_image_delete(escale);
+
+        if (cpl_error_get_code())
+            break;
+    }
+
+    return cpl_error_get_code();
+}
+
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief   compute photon count error in [ADU]
+  @param   ima_data in [ADU]
+  @param   gain detector's gain in [e- / ADU]
+  @param   ron  detector's read out noise in [ADU]
+  @param   ima_errs output error image in [ADU]
+  @return  cpl_error_code
+  @note ima_errs need to be deallocated
+        ima_data must contain the photon counts with no offsets
+        this usually means the image must be overscan and bias corrected
+        Then the shot noise can be calculated from the poissonian distribution
+        as sqrt(electron-counts). To this (transformed back into ADUs) the
+        readout noise is added in quadrature.
+  @doc
+  error is computed with standard formula
+
+  \f$ err_{ADU} = \sqrt{ \frac{ counts }{ gain } + ron^{ 2 } } \f$
+
+  If an image value is negative the associated error is set to RON
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_detector_shotnoise_model(const cpl_image* ima_data, const double gain,
+                                  const double ron, cpl_image ** ima_errs)
+{
+    cpl_ensure_code(ima_data, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(ima_errs, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(gain > 0., CPL_ERROR_ILLEGAL_INPUT);
+    cpl_ensure_code(ron > 0., CPL_ERROR_ILLEGAL_INPUT);
+
+    *ima_errs = cpl_image_duplicate(ima_data);
+    /* set negative values (= zero measurable electrons) to read out noise */
+    cpl_image_threshold(*ima_errs, 0., INFINITY, ron, ron);
+
+    /* err_ADU = sqrt(counts/gain + ron * ron)*/
+
+    cpl_image_divide_scalar(*ima_errs, gain);
+    cpl_image_add_scalar(*ima_errs, ron * ron);
+    cpl_image_power(*ima_errs, 0.5);
+
+    return cpl_error_get_code();
+}
+
+/*----------------------------------------------------------------------------*/
+/**
+  @brief   compute error in [ADU]
+  @param   ima_data in [ADU]
+  @param   ron  detector's read out noise in [ADU]
+  @param   ima_errs output error image in [ADU]
+  @return  cpl_error_code
+  @note ima_errs need to be deallocated
+        The returned error image is filled by the RON in ADUs
+ */
+/*----------------------------------------------------------------------------*/
+cpl_error_code
+hdrl_detector_shotnoise_model_bias(const cpl_image* ima_data, const double ron,
+                                   cpl_image ** ima_errs)
+{
+    cpl_ensure_code(ima_data, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(ima_errs, CPL_ERROR_NULL_INPUT);
+    cpl_ensure_code(ron > 0., CPL_ERROR_ILLEGAL_INPUT);
+
+    /* Create new image initialised to 0 */
+    *ima_errs = cpl_image_new(cpl_image_get_size_x(ima_data),
+                              cpl_image_get_size_y(ima_data), CPL_TYPE_DOUBLE);
+
+    if (cpl_image_get_bpm_const(ima_data))
+        cpl_image_reject_from_mask(*ima_errs,
+                                   cpl_image_get_bpm_const(ima_data));
+
+    cpl_image_add_scalar(*ima_errs, ron);
+
+    return cpl_error_get_code();
+}
+
+/**@}*/
diff --git a/mosca/libmosca/hdrl_utils.h b/mosca/libmosca/hdrl_utils.h
new file mode 100644
index 0000000..494ec73
--- /dev/null
+++ b/mosca/libmosca/hdrl_utils.h
@@ -0,0 +1,197 @@
+/* $Id: hdrl_utils.h,v 1.4 2013-10-16 18:00:33 cgarcia Exp $
+ *
+ * This file is part of the HDRL
+ * Copyright (C) 2012,2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 18:00:33 $
+ * $Revision: 1.4 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef HDRL_UTILS_H
+#define HDRL_UTILS_H
+
+/*-----------------------------------------------------------------------------
+                                Includes
+ -----------------------------------------------------------------------------*/
+
+#include <cpl.h>
+#include "hdrl_parameter.h"
+#include <stdlib.h>
+
+/*-----------------------------------------------------------------------------
+                                Define
+ -----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------*/
+/**
+  @enum hdrl_direction
+  @brief Define an image direction e.g along X or Y
+ */
+/*----------------------------------------------------------------------------*/
+typedef enum {
+
+    /** X axis, equivalent to NAXIS1 in FITS convention */ 
+    HDRL_X_AXIS,
+    /** Y axis, equivalent to NAXIS2 in FITS convention */ 
+    HDRL_Y_AXIS,
+    /** Reserved value for undefined direction */ 
+    HDRL_UNDEFINED_AXIS
+} hdrl_direction;
+
+typedef enum {
+    HDRL_SCALE_ADDITIVE,
+    HDRL_SCALE_MULTIPLICATIVE
+} hdrl_scale_type;
+
+/*-----------------------------------------------------------------------------
+                            Functions prototypes
+ -----------------------------------------------------------------------------*/
+CPL_BEGIN_DECLS
+
+const char * hdrl_get_license(void);
+
+/*----------------------------------------------------------------------------
+                           Rect region Parameters
+  ----------------------------------------------------------------------------*/
+hdrl_parameter * hdrl_rect_region_parameter_create(cpl_size, cpl_size,
+        cpl_size, cpl_size) ;
+cpl_error_code hdrl_rect_region_parameter_update(hdrl_parameter *, cpl_size, 
+        cpl_size, cpl_size, cpl_size) ;
+cpl_boolean hdrl_rect_region_parameter_check(const hdrl_parameter *) ;
+cpl_size hdrl_rect_region_get_llx(const hdrl_parameter *) ;
+cpl_size hdrl_rect_region_get_lly(const hdrl_parameter *) ;
+cpl_size hdrl_rect_region_get_urx(const hdrl_parameter *) ;
+cpl_size hdrl_rect_region_get_ury(const hdrl_parameter *) ;
+cpl_error_code hdrl_rect_region_parameter_verify(const hdrl_parameter *,
+        const cpl_size, const cpl_size) ;
+cpl_error_code hdrl_rect_region_wrap(hdrl_parameter *, const cpl_size,
+        const cpl_size) ;
+cpl_parameterlist * hdrl_rect_region_parameter_create_parlist(const char *, 
+        const char *, const char *, const char *, const hdrl_parameter *) ;
+hdrl_parameter * hdrl_rect_region_parameter_parse_parlist(
+        const cpl_parameterlist *, const char *, const char *) ;
+/*----------------------------------------------------------------------------*/
+
+int hdrl_get_tempfile(const char * dir, cpl_boolean unlink);
+
+cpl_error_code hdrl_calc_mean_image(const cpl_image * ima,
+                                    const cpl_image * err, double * mean,
+                                    double * meanerr);
+
+cpl_error_code hdrl_calc_weighted_mean_image( const cpl_image * ima,
+                                      const cpl_image * err, double * wmean,
+                                      double * wmeanerr);
+
+cpl_error_code hdrl_calc_median_image(const cpl_image * ima,
+                                      const cpl_image * err, double * median,
+                                      double * medianerr);
+
+cpl_error_code
+hdrl_normalize_imagelist_by_vector(const cpl_vector * vector,
+                                   const cpl_vector * evector,
+                                   hdrl_scale_type scale_type,
+                                   cpl_imagelist * data,
+                                   cpl_imagelist * errors);
+
+cpl_error_code
+hdrl_normalize_imagelist_by_imagelist(const cpl_imagelist * scale,
+                                      const cpl_imagelist * scale_e,
+                                      const hdrl_scale_type scale_type,
+                                      cpl_imagelist * data,
+                                      cpl_imagelist * errors);
+
+cpl_error_code
+hdrl_detector_shotnoise_model(const cpl_image* ima_data, const double conad,
+                                  const double ron, cpl_image ** ima_errs);
+cpl_error_code
+hdrl_detector_shotnoise_model_bias(const cpl_image* ima_data, const double ron,
+                                   cpl_image ** ima_errs);
+CPL_END_DECLS
+
+/*-----------------------------------------------------------------------------
+             Private declarations - must not be used outside of hdrl
+ -----------------------------------------------------------------------------*/
+
+#ifdef HDRL_USE_PRIVATE
+
+/* setup a value parameter and append it into parlist */
+#define hdrl_setup_vparameter(parlist, \
+                              full_prefix, \
+                              full_sep, \
+                              name_prefix, \
+                              alias_prefix, \
+                              alias_sep, \
+                              pname, \
+                              context, \
+                              descr, \
+                              type, \
+                              pdefault) \
+do { \
+        char * name = cpl_sprintf("%s%s%s%s", full_prefix, full_sep, \
+                                  name_prefix, pname); \
+        cpl_parameter * p = cpl_parameter_new_value(name, type, \
+                descr, context, pdefault) ; \
+        cpl_free(name); \
+        name = cpl_sprintf("%s%s%s%s", alias_prefix, alias_sep, \
+                           name_prefix, pname); \
+        cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, name); \
+        cpl_free(name); \
+        cpl_parameterlist_append(parlist, p); \
+    } while (0)
+
+cpl_vector * hdrl_image_to_vector(const cpl_image * source, const
+        cpl_mask * bpm);
+cpl_vector * hdrl_imagelist_to_vector(const cpl_imagelist * source, 
+        const cpl_size x, const cpl_size y);
+
+static inline int hdrl_int_is_power_of_two(unsigned long long x)
+{
+    return (x & (x - 1)) == 0;
+}
+
+static inline size_t hdrl_get_image_npix(const cpl_image * img)
+{
+    return cpl_image_get_size_x(img) * cpl_image_get_size_y(img);
+}
+
+static inline size_t hdrl_get_image_good_npix(const cpl_image * img)
+{
+    return (cpl_image_get_size_x(img) * cpl_image_get_size_y(img)) -
+        cpl_image_count_rejected(img);
+}
+
+static inline cpl_mask * hdrl_copy_image_mask(const cpl_image * img)
+{
+    /* always returns a mask even it image has none */
+    const cpl_mask * bpm = cpl_image_get_bpm_const(img);
+
+    if (bpm) {
+        return cpl_mask_duplicate(bpm);
+    }
+    else {
+        return cpl_mask_new(cpl_image_get_size_x(img),
+                            cpl_image_get_size_y(img));
+    }
+}
+
+#endif
+
+#endif
diff --git a/mosca/libmosca/image_smooth.cpp b/mosca/libmosca/image_smooth.cpp
index 9fe5b4f..b82929f 100644
--- a/mosca/libmosca/image_smooth.cpp
+++ b/mosca/libmosca/image_smooth.cpp
@@ -1,4 +1,4 @@
-/* $Id: image_smooth.cpp,v 1.3 2013/01/25 20:34:53 cgarcia Exp $
+/* $Id: image_smooth.cpp,v 1.7 2013-09-06 13:11:02 cgarcia Exp $
  *
  * This file is part of the MOSCA library
  * Copyright (C) 2013 European Southern Observatory
@@ -15,17 +15,20 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/25 20:34:53 $
- * $Revision: 1.3 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-06 13:11:02 $
+ * $Revision: 1.7 $
+ * $Name: not supported by cvs2svn $
  */
 
 
+#ifndef IMAGE_SMOOTH_CPP
+#define IMAGE_SMOOTH_CPP
+
 #include <iostream>
 #include <vector>
 #include <algorithm>
@@ -45,8 +48,9 @@
  * @return List of peaks candidates positions
  *
  */
+template<typename T>
 void mosca::image_smooth_1d_median(mosca::image& image,
-                                   double half_width, mosca::axis smooth_axis)
+                                   int half_width, mosca::axis smooth_axis)
 {
     cpl_size ny = image.size_y();
     cpl_size nx = image.size_x();
@@ -57,13 +61,8 @@ void mosca::image_smooth_1d_median(mosca::image& image,
     mosca::axis image_axis;
 
     /* If the smooth direction is given in terms of dispersion or spatial
-       axis, then decide whether it is X or Y. If not, it is already X or Y */ 
-    if(smooth_axis == mosca::DISPERSION_AXIS)
-        image_axis = image.dispersion_axis();
-    else if(smooth_axis == mosca::SPATIAL_AXIS)
-        image_axis = image.spatial_axis();
-    else
-        image_axis = smooth_axis;
+       axis, then decide whether it is X or Y. If not, it is already X or Y */
+    image_axis = image.axis_to_image(smooth_axis);
     
     /* Lines are contiguos pixels along the smoothing direction.
        i.e., if image_axis == mosca::X_AXIS the lines are rows and there are
@@ -85,16 +84,16 @@ void mosca::image_smooth_1d_median(mosca::image& image,
         stride_line = 1;
     }
         
-    if(2*half_width > nlines)
+    if(2*half_width > nsmooth)
         throw std::out_of_range("2*half_width is larger than the image size");
     
     cpl_vector * line    = cpl_vector_new(nsmooth);
     double  * line_begin = cpl_vector_get_data(line);
-    double  * im_data    = image.get_data<double>();
+    T       * im_data    = image.get_data<T>();
     for (cpl_size iline = 0; iline < nlines; ++iline)
     {
         cpl_vector * smooth_line;
-        double     * im_data_line;
+        T          * im_data_line;
         double     * line_p;
         double     * smooth_line_p;
         double     * smooth_line_begin;
@@ -118,7 +117,7 @@ void mosca::image_smooth_1d_median(mosca::image& image,
         }
         cpl_vector_delete(smooth_line);
     }
-    cpl_vector_delete(line);
-    
+    cpl_vector_delete(line);    
 }
         
+#endif
diff --git a/mosca/libmosca/image_smooth.h b/mosca/libmosca/image_smooth.h
index 609d843..5152e66 100644
--- a/mosca/libmosca/image_smooth.h
+++ b/mosca/libmosca/image_smooth.h
@@ -1,4 +1,4 @@
-/* $Id: image_smooth.h,v 1.2 2013/01/24 18:01:23 cgarcia Exp $
+/* $Id: image_smooth.h,v 1.6 2013-05-17 10:05:16 cgarcia Exp $
  *
  * This file is part of the MOSCA library
  * Copyright (C) 2013 European Southern Observatory
@@ -15,20 +15,29 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/24 18:01:23 $
- * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-05-17 10:05:16 $
+ * $Revision: 1.6 $
+ * $Name: not supported by cvs2svn $
  */
 
+#ifndef IMAGE_SMOOTH_H
+#define IMAGE_SMOOTH_H
+
 #include "mosca_image.h"
 
 namespace mosca
 {
+template<typename T>
 void image_smooth_1d_median(mosca::image& image, 
-                            double half_width, mosca::axis smooth_axis);
+                            int half_width, mosca::axis smooth_axis);
 }
+
+
+#include "image_smooth.cpp"
+
+#endif
diff --git a/mosca/libmosca/image_smooth.h b/mosca/libmosca/image_spline_fit.h
similarity index 60%
copy from mosca/libmosca/image_smooth.h
copy to mosca/libmosca/image_spline_fit.h
index 609d843..482ab37 100644
--- a/mosca/libmosca/image_smooth.h
+++ b/mosca/libmosca/image_spline_fit.h
@@ -1,4 +1,4 @@
-/* $Id: image_smooth.h,v 1.2 2013/01/24 18:01:23 cgarcia Exp $
+/* $Id: image_spline_fit.h,v 1.5 2013-09-06 17:23:47 cgarcia Exp $
  *
  * This file is part of the MOSCA library
  * Copyright (C) 2013 European Southern Observatory
@@ -15,20 +15,30 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/24 18:01:23 $
- * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-06 17:23:47 $
+ * $Revision: 1.5 $
+ * $Name: not supported by cvs2svn $
  */
 
+#ifndef IMAGE_SPLINE_FIT_H
+#define IMAGE_SPLINE_FIT_H
+
 #include "mosca_image.h"
 
 namespace mosca
 {
-void image_smooth_1d_median(mosca::image& image, 
-                            double half_width, mosca::axis smooth_axis);
+template<typename T>
+void image_cubicspline_1d_fit(mosca::image& image, 
+                              int nknots, double flux_threshold,
+                              mosca::axis fitting_axis);
 }
+
+
+#include "image_spline_fit.tcc"
+
+#endif
diff --git a/mosca/libmosca/image_spline_fit.tcc b/mosca/libmosca/image_spline_fit.tcc
new file mode 100644
index 0000000..db00a53
--- /dev/null
+++ b/mosca/libmosca/image_spline_fit.tcc
@@ -0,0 +1,219 @@
+/* $Id: image_spline_fit.tcc,v 1.7 2013-09-09 13:14:32 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-09-09 13:14:32 $
+ * $Revision: 1.7 $
+ * $Name: not supported by cvs2svn $
+ */
+
+
+#ifndef IMAGE_SPLINE_FIT_TCC
+#define IMAGE_SPLINE_FIT_TCC
+
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <stdexcept>
+#include <gsl/gsl_bspline.h>
+#include <gsl/gsl_multifit.h>
+#include "mosca_image.h"
+#include "image_spline_fit.h"
+
+cpl_vector * fit_cubic_bspline(cpl_vector * values, int nknots, double threshold);
+
+
+/**
+ * @brief
+ *   TODO 
+ *
+ * @param TODO
+ * @return TODO
+ *
+ */
+template<typename T>
+void mosca::image_cubicspline_1d_fit(mosca::image& image, 
+                                     int nknots, double flux_threshold,
+                                     mosca::axis fitting_axis)
+{
+    cpl_size ny = image.size_y();
+    cpl_size nx = image.size_x();
+    cpl_size nlines;
+    cpl_size nfit;
+    cpl_size stride_line;
+    cpl_size stride_pixel;
+    mosca::axis image_axis;
+    int collapse_dir;
+
+    /* If the fitting direction is given in terms of dispersion or spatial
+       axis, then decide whether it is X or Y. If not, it is already X or Y */
+    image_axis = image.axis_to_image(fitting_axis);
+    
+    /* Lines are contiguous pixels along the fitting direction.
+       i.e., if image_axis == mosca::X_AXIS the lines are rows and there are
+       ny lines.
+       Each line contains nfit pixels. For image_axis == mosca::X_AXIS this
+       means nfit = nx. */
+    if(image_axis == mosca::X_AXIS)
+    {
+        nlines = ny;
+        nfit   = nx;
+        stride_pixel = 1;
+        stride_line = nx;
+        collapse_dir = 0;
+    }
+    else
+    {
+        nlines = nx;
+        nfit   = ny;
+        stride_pixel = nx;
+        stride_line = 1;
+        collapse_dir = 1;
+    }
+        
+    
+    //We collapse in the oposite direction of the fitting
+    cpl_image * collapse_median = 
+          cpl_image_collapse_median_create(image.get_cpl_image(),
+                                           collapse_dir, 0, 0);
+    
+    //We fit a spline to the line-image
+    cpl_vector * collapse_line;
+    if(image_axis == mosca::X_AXIS)
+        collapse_line = cpl_vector_new_from_image_row(collapse_median, 1);
+    else
+        collapse_line = cpl_vector_new_from_image_column(collapse_median, 1);
+
+    cpl_vector * spline_fit = fit_cubic_bspline(collapse_line, nknots, flux_threshold);
+
+    //Place in each column or row the spline fit
+    T *      p_image      = image.get_data<T>();
+    double * p_spline_fit = cpl_vector_get_data(spline_fit);
+    for (cpl_size j = 0; j< ny; ++j)
+    {
+        for (cpl_size i = 0; i< nx; ++i, ++p_image)
+        {
+            if(image_axis == mosca::X_AXIS)
+                *p_image = p_spline_fit[i];
+            else
+                *p_image =  p_spline_fit[j];
+        }
+    }
+
+    cpl_image_delete(collapse_median);    
+    cpl_vector_delete(collapse_line);    
+}
+        
+cpl_vector * fit_cubic_bspline(cpl_vector * values, int nknots, double threshold)
+{
+    //Allocate result
+    cpl_vector * result;
+    cpl_size     npix = cpl_vector_get_size(values);
+    result = cpl_vector_new(npix);
+
+    //This is valid for cubic splines, if not nbreak = ncoeffs + 2 - k, 
+    //where k is the degree of the spline
+    int ncoeffs = nknots + 2;
+    
+    /* Get the threshold in terms of the maximum */
+    double max_value = cpl_vector_get_max(values);
+    double thres_value = threshold * max_value;
+    
+    /* Create a "mask" of pixels not to use */
+    cpl_array * values_mask = cpl_array_new(npix, CPL_TYPE_INT);
+    int nfit = 0;
+    for (cpl_size i = 0; i < npix; ++i)
+        if(cpl_vector_get(values, i) < thres_value)
+            cpl_array_set_int(values_mask, i, 0);
+        else
+        {
+            cpl_array_set_int(values_mask, i, 1);
+            nfit++;
+        }
+
+    /* allocate a cubic bspline workspace (k = 4) */
+    gsl_bspline_workspace *bspl_wspc;
+    gsl_vector *B;
+    gsl_matrix * X;
+    bspl_wspc = gsl_bspline_alloc(4, nknots);
+    B = gsl_vector_alloc(ncoeffs);
+    X = gsl_matrix_alloc(nfit, ncoeffs);
+    
+    /* allocate objects for the fitting */
+    gsl_matrix *cov;
+    gsl_vector * y_fit;
+    gsl_vector * weigth;
+    gsl_multifit_linear_workspace * mfit_wspc;
+    gsl_vector *spl_coeffs;
+    double chisq;
+    y_fit = gsl_vector_alloc(nfit);
+    weigth = gsl_vector_alloc(nfit);
+    mfit_wspc = gsl_multifit_linear_alloc(nfit, ncoeffs);
+    spl_coeffs = gsl_vector_alloc(ncoeffs);
+    cov = gsl_matrix_alloc(ncoeffs, ncoeffs);
+    
+    /* use uniform breakpoints on [0, npix], which is the range of fitting */
+    gsl_bspline_knots_uniform(0.0, (double)npix, bspl_wspc);
+    
+
+    /* construct the fit matrix X */
+    for (int i = 0, ifit = 0; i < npix; ++i)
+    {
+        int null;
+        if(cpl_array_get(values_mask, (cpl_size)i, &null) == 1)
+        {
+            double xi = i;
+            double yi = cpl_vector_get(values, i);
+
+            /* Fill the vector to fit */
+            gsl_vector_set(y_fit, ifit, yi);
+            gsl_vector_set(weigth, ifit, 1.);
+
+            /* compute B_j(xi) for all j */
+            gsl_bspline_eval(xi, B, bspl_wspc);
+
+            /* fill in row i of X */
+            for (int j = 0; j < ncoeffs; ++j)
+            {
+                double Bj = gsl_vector_get(B, j);
+                gsl_matrix_set(X, ifit, j, Bj);
+            }
+            ifit++;
+        }
+    } 
+    
+    /* do the fit */
+    gsl_multifit_wlinear(X, weigth, y_fit, spl_coeffs, cov, &chisq, mfit_wspc);
+    
+    /* output the fit */
+
+    for(int i = 0; i < npix; i ++)
+    {
+        double yi, yerr;
+        gsl_bspline_eval((double)i, B, bspl_wspc);
+        gsl_multifit_linear_est(B, spl_coeffs, cov, &yi, &yerr);
+        cpl_vector_set(result, i, yi);
+    }
+    
+    return result;
+}
+
+#endif
diff --git a/mosca/libmosca/image_smooth.h b/mosca/libmosca/image_utils.h
similarity index 57%
copy from mosca/libmosca/image_smooth.h
copy to mosca/libmosca/image_utils.h
index 609d843..1620776 100644
--- a/mosca/libmosca/image_smooth.h
+++ b/mosca/libmosca/image_utils.h
@@ -1,4 +1,4 @@
-/* $Id: image_smooth.h,v 1.2 2013/01/24 18:01:23 cgarcia Exp $
+/* $Id: image_utils.h,v 1.4 2013-08-13 12:55:26 cgarcia Exp $
  *
  * This file is part of the MOSCA library
  * Copyright (C) 2013 European Southern Observatory
@@ -15,20 +15,34 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/24 18:01:23 $
- * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-08-13 12:55:26 $
+ * $Revision: 1.4 $
+ * $Name: not supported by cvs2svn $
  */
 
+#ifndef IMAGE_UTILS_H
+#define IMAGE_UTILS_H
+
 #include "mosca_image.h"
 
 namespace mosca
 {
-void image_smooth_1d_median(mosca::image& image, 
-                            double half_width, mosca::axis smooth_axis);
+template<typename Iter, typename ReduceMethod>
+mosca::image imagelist_reduce
+(Iter image_start, Iter image_end, 
+ ReduceMethod reduce_method = mosca::reduce_mean());
 }
+
+template<typename Container>
+Container operator/ (Container& image_list, 
+                     mosca::image& dividend);
+
+
+#include "image_utils.tcc"
+
+#endif
diff --git a/mosca/libmosca/image_utils.tcc b/mosca/libmosca/image_utils.tcc
new file mode 100644
index 0000000..cbe1c70
--- /dev/null
+++ b/mosca/libmosca/image_utils.tcc
@@ -0,0 +1,157 @@
+/* $Id: image_utils.tcc,v 1.8 2013-10-16 11:30:00 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:30:00 $
+ * $Revision: 1.8 $
+ * $Name: not supported by cvs2svn $
+ */
+
+
+#ifndef IMAGE_UTILS_TCC
+#define IMAGE_UTILS_TCC
+
+#include <iterator>
+#include <iostream>
+#include <algorithm>
+#include <stdexcept>
+#include "mosca_image.h"
+#include "image_utils.h"
+#include "reduce_method.h"
+#include "hdrl_combine.h"
+
+
+/**
+ * @brief
+ *   Collapse a list of images in a container with a reduction method
+ *   (mean, median, etc...) 
+ *
+ * @return The mean image
+ *
+ */
+template<typename Iter, typename ReduceMethod>
+mosca::image mosca::imagelist_reduce
+(Iter image_start, Iter image_end, ReduceMethod reduce_method)
+{
+
+    //cpl_errorstate      error_prevstate = cpl_errorstate_get();
+
+    /* Maybe all this can be done with iterators in hdrl */
+    cpl_imagelist * im_list = cpl_imagelist_new();
+    cpl_imagelist * im_err_list = cpl_imagelist_new();
+    mosca::axis disp_axis = image_start->dispersion_axis();
+    cpl_size idx;
+    Iter it;
+
+    for(idx = 0, it = image_start; it != image_end; ++it, ++idx)
+    {
+        mosca::image& im = *it;
+        if(im.dispersion_axis() != disp_axis)
+            throw std::invalid_argument("Dispersion axes are not the same");
+        cpl_image * tmp = cpl_image_duplicate(im.get_cpl_image());
+        cpl_image * tmp_err = cpl_image_duplicate(im.get_cpl_image_err());
+        
+        cpl_imagelist_set(im_list, tmp, idx);
+        cpl_imagelist_set(im_err_list, tmp_err, idx);
+    }
+
+
+    cpl_image * mean = cpl_image_new((*image_start).size_dispersion(),(*image_start).size_spatial(), CPL_TYPE_DOUBLE);
+    cpl_image * mean_err = cpl_image_new((*image_start).size_dispersion(),(*image_start).size_spatial(), CPL_TYPE_DOUBLE);
+    cpl_image * contrib;
+    hdrl_collapse_imagelist_to_image_t * reduce_method_hdrl = reduce_method.hdrl_reduce();
+    if(hdrl_imagelist_combine(im_list, im_err_list, reduce_method_hdrl, 
+                              &mean, &mean_err, &contrib) != CPL_ERROR_NONE)
+    {
+        cpl_msg_error(cpl_func,"%s", cpl_error_get_message());
+        cpl_msg_error(__func__,"Could not collapse the images");
+    }
+
+    cpl_imagelist_delete(im_list);
+    cpl_imagelist_delete(im_err_list);
+    
+    return mosca::image(mean, mean_err, true, disp_axis);
+}
+
+template<typename Container>
+Container operator/ (Container& image_list, 
+                     mosca::image& dividend)
+{
+    cpl_errorstate      error_prevstate = cpl_errorstate_get();
+
+    Container out_list;
+    mosca::axis disp_axis = image_list.begin()->dispersion_axis();
+    
+    cpl_image * dividend_im = dividend.get_cpl_image();
+    cpl_image * dividend_err = dividend.get_cpl_image_err();
+    
+    cpl_image * dividend_sq = cpl_image_power_create(dividend_im, 2);
+    cpl_image * dividend_sq_sq = cpl_image_power_create(dividend_sq, 2);
+    cpl_image * dividend_err_sq = cpl_image_power_create(dividend_err, 2);
+    
+    for(typename Container::iterator it = image_list.begin(); 
+            it != image_list.end(); ++it)
+    {
+        mosca::image& target = *it;
+        if(target.dispersion_axis() != disp_axis)
+            throw std::invalid_argument("Dispersion axes are not the same");
+
+        cpl_image * target_im = target.get_cpl_image();
+        cpl_image * target_err = target.get_cpl_image_err();
+        
+        cpl_image * target_sq = cpl_image_power_create(target_im, 2);
+        cpl_image * target_err_sq = cpl_image_power_create(target_err, 2);
+
+        cpl_image * out = cpl_image_divide_create(target_im, dividend_im);
+        
+        /* Error propagation: z = y/x, 
+         * err_z = sqrt(err_x^2/y^2 + x^2 * err_y^2/y^4)
+         */
+        cpl_image * out_err = cpl_image_divide_create(target_err_sq, dividend_sq);
+        cpl_image * tmp2 = cpl_image_divide_create(target_sq, dividend_sq_sq);
+        cpl_image * tmp3 = cpl_image_multiply_create(tmp2, dividend_err_sq);
+        cpl_image_add(out_err, tmp3);
+        cpl_image_power(out_err, 0.5);
+        
+        mosca::image image_divided(out, out_err, true, disp_axis);
+        
+        (*std::inserter(out_list, out_list.end())) = image_divided;
+
+        /* Book keeping */
+        cpl_image_delete(target_sq);
+        cpl_image_delete(target_err_sq);
+        cpl_image_delete(tmp2);
+        cpl_image_delete(tmp3);
+    }
+    cpl_image_delete(dividend_sq);
+    cpl_image_delete(dividend_sq_sq);
+    cpl_image_delete(dividend_err_sq);
+    
+    if(!cpl_errorstate_is_equal(error_prevstate))
+    {
+        cpl_msg_error(cpl_func,"%s", cpl_error_get_message());
+        cpl_msg_error(__func__,"Could not divide images");
+    }
+
+    return out_list;
+}
+
+#endif
diff --git a/mosca/libmosca/mosca_image.cpp b/mosca/libmosca/mosca_image.cpp
index 70e31e5..c6542aa 100644
--- a/mosca/libmosca/mosca_image.cpp
+++ b/mosca/libmosca/mosca_image.cpp
@@ -1,4 +1,4 @@
-/* $Id: mosca_image.cpp,v 1.7 2013/01/28 12:46:40 cgarcia Exp $
+/* $Id: mosca_image.cpp,v 1.17 2013-09-06 13:10:23 cgarcia Exp $
  *
  * This file is part of the MOSCA library
  * Copyright (C) 2013 European Southern Observatory
@@ -15,23 +15,25 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/28 12:46:40 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-06 13:10:23 $
+ * $Revision: 1.17 $
+ * $Name: not supported by cvs2svn $
  */
 
 #include <stdexcept>
+#include <iostream>
 #include "mosca_image.h"
 
 mosca::image::image(cpl_size nx, cpl_size ny, cpl_type type, 
                     mosca::axis dispersion_axis)
 {
-    m_image = cpl_image_new(nx, ny, type);
+    m_image       = cpl_image_new(nx, ny, type);
+    m_image_err = cpl_image_new(nx, ny, type);
     m_take_over = true;
     set_axis(dispersion_axis);
 }
@@ -39,21 +41,49 @@ mosca::image::image(cpl_size nx, cpl_size ny, cpl_type type,
 mosca::image::image()
 {
     m_image = NULL;
+    m_image_err = NULL;
     m_take_over = false;
+    m_spatial_axis = mosca::X_AXIS;
+    m_dispersion_axis = mosca::Y_AXIS;
 }
     
 mosca::image::image(cpl_image * image, bool take_over, 
                     mosca::axis dispersion_axis)
 {
     m_image = image;
+    m_image_err = NULL;
     m_take_over = take_over;
     set_axis(dispersion_axis);
 }
 
+mosca::image::image(cpl_image * image, cpl_image * image_err, 
+                    bool take_over, mosca::axis dispersion_axis)
+{
+    if((cpl_image_get_size_x(image) != cpl_image_get_size_x(image_err)) ||
+       (cpl_image_get_size_y(image) != cpl_image_get_size_y(image_err)))
+        throw std::invalid_argument("Data and error should have the same size");
+    m_image = image;
+    m_image_err = image_err;
+    m_take_over = take_over;
+    set_axis(dispersion_axis);
+}
+
+mosca::image::image(const image& other)
+{
+    m_image = cpl_image_duplicate(other.m_image);
+    m_image_err = cpl_image_duplicate(other.m_image_err);
+    m_take_over = true;
+    set_axis(other.m_dispersion_axis);    
+}
+
 mosca::image::~image()
 {
-    if(m_take_over)
+    if(m_take_over) 
+    {
         cpl_image_delete(m_image);
+        if(m_image_err != NULL)
+            cpl_image_delete(m_image_err);
+    }
 }
 
 void mosca::image::set_axis(mosca::axis dispersion_axis)
@@ -68,3 +98,54 @@ void mosca::image::set_axis(mosca::axis dispersion_axis)
                                     "Use X_AXIS or Y_AXIS");
 }
 
+mosca::image mosca::image::trim(cpl_size disp_bottom, cpl_size spa_bottom,
+                                cpl_size disp_top,    cpl_size spa_top)
+{
+    cpl_image * trimmed_image = NULL;
+    cpl_image * trimmed_image_err = NULL;
+    if(m_dispersion_axis == mosca::X_AXIS)
+    {
+        trimmed_image = cpl_image_extract
+            (m_image, disp_bottom, spa_bottom, disp_top, spa_top);
+        if(m_image_err != NULL)
+            trimmed_image_err = cpl_image_extract
+                (m_image_err, disp_bottom, spa_bottom, disp_top, spa_top);
+    }
+    else
+    {
+        trimmed_image = cpl_image_extract
+            (m_image, spa_bottom, disp_bottom, spa_top, disp_top);
+        if(m_image_err != NULL)
+            trimmed_image_err = cpl_image_extract
+                (m_image_err, spa_bottom, disp_bottom, spa_top, disp_top);
+    }   
+    mosca::image result(trimmed_image, trimmed_image_err, 
+                        true, m_dispersion_axis); 
+    return result;
+}
+
+mosca::axis mosca::image::axis_to_image(mosca::axis an_axis) const
+{
+    mosca::axis image_axis;
+    /* If an axis is given in terms of dispersion or spatial
+       axis, then decide whether it is X or Y. If not, it is already X or Y */ 
+    if(an_axis == mosca::DISPERSION_AXIS)
+        image_axis = dispersion_axis();
+    else if(an_axis == mosca::SPATIAL_AXIS)
+        image_axis = spatial_axis();
+    else
+        image_axis = an_axis;
+    
+    return image_axis;
+}
+
+
+cpl_image* mosca::image::get_cpl_image()
+{
+    return m_image;
+}
+
+cpl_image* mosca::image::get_cpl_image_err()
+{
+    return m_image_err;
+}
diff --git a/mosca/libmosca/mosca_image.h b/mosca/libmosca/mosca_image.h
index b30abc1..8ce9209 100644
--- a/mosca/libmosca/mosca_image.h
+++ b/mosca/libmosca/mosca_image.h
@@ -1,4 +1,4 @@
-/* $Id: mosca_image.h,v 1.5 2013/01/24 18:00:36 cgarcia Exp $
+/* $Id: mosca_image.h,v 1.13 2013-09-06 13:10:41 cgarcia Exp $
  *
  * This file is part of the MOSCA library
  * Copyright (C) 2013 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/24 18:00:36 $
- * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-06 13:10:41 $
+ * $Revision: 1.13 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef MOSCA_IMAGE_H
@@ -55,7 +55,12 @@ public:
     image(cpl_image * image, bool take_over = false, 
           axis dispersion_axis = X_AXIS);
     
+    image(cpl_image * image, cpl_image * image_err, bool take_over = false, 
+          axis dispersion_axis = X_AXIS);
+    
     image();
+
+    image(const image& other);
     
     virtual ~image();
     
@@ -63,13 +68,36 @@ public:
 
     inline cpl_size size_y() const;
 
+    inline cpl_size size_spatial() const;
+
+    inline cpl_size size_dispersion() const;
+
     inline axis dispersion_axis() const;
     
     inline axis spatial_axis() const;
 
+    //Return an axis in terms of image axis (X or Y)
+    axis axis_to_image(axis an_axis) const;
+    
     template<typename T>
     inline T* get_data();
 
+    template<typename T>
+    inline const T* get_data() const;
+
+    template<typename T>
+    inline T* get_data_err();
+
+    template<typename T>
+    inline const T* get_data_err() const;
+
+    image trim(cpl_size disp_bottom, cpl_size spa_bottom,
+               cpl_size disp_top,    cpl_size spa_top);
+
+    cpl_image * get_cpl_image();
+
+    cpl_image * get_cpl_image_err();
+
 private:
     
     void set_axis(axis dispersion_axis);
@@ -81,6 +109,8 @@ private:
     bool m_take_over;
     
     cpl_image *  m_image;
+    
+    cpl_image *  m_image_err;
 };
 
 }
diff --git a/mosca/libmosca/mosca_image.tcc b/mosca/libmosca/mosca_image.tcc
index 6bb80a4..d269aa0 100644
--- a/mosca/libmosca/mosca_image.tcc
+++ b/mosca/libmosca/mosca_image.tcc
@@ -1,4 +1,4 @@
-/* $Id: mosca_image.tcc,v 1.2 2013/01/25 20:35:35 cgarcia Exp $
+/* $Id: mosca_image.tcc,v 1.6 2013-07-24 07:40:54 cgarcia Exp $
  *
  * This file is part of the MOSCA library
  * Copyright (C) 2013 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/25 20:35:35 $
- * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-07-24 07:40:54 $
+ * $Revision: 1.6 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef MOSCA_IMAGE_TCC
@@ -42,6 +42,22 @@ cpl_size mosca::image::size_y() const
     return cpl_image_get_size_y(m_image);
 }
 
+cpl_size mosca::image::size_spatial() const
+{
+    if(m_spatial_axis == mosca::X_AXIS)
+        return cpl_image_get_size_x(m_image);
+    else
+        return cpl_image_get_size_y(m_image);
+}
+
+cpl_size mosca::image::size_dispersion() const
+{
+    if(m_dispersion_axis == mosca::Y_AXIS)
+        return cpl_image_get_size_y(m_image);
+    else
+        return cpl_image_get_size_x(m_image);
+}
+
 mosca::axis mosca::image::dispersion_axis() const
 {
     return m_dispersion_axis;
@@ -61,5 +77,35 @@ T* mosca::image::get_data()
     data = static_cast<T*>(cpl_image_get_data(m_image));
     return data;
 }
-    
+
+template<typename T>
+const T* mosca::image::get_data() const
+{
+    if(mosca::type_trait<T>::cpl_eq_type != cpl_image_get_type(m_image))
+        throw std::invalid_argument("type requested does not match image data type");
+    const T* data;
+    data = static_cast<const T*>(cpl_image_get_data_const(m_image));
+    return data;
+}
+
+template<typename T>
+T* mosca::image::get_data_err()
+{
+    if(mosca::type_trait<T>::cpl_eq_type != cpl_image_get_type(m_image_err))
+        throw std::invalid_argument("type requested does not match image data type");
+    T* data;
+    data = static_cast<T*>(cpl_image_get_data(m_image_err));
+    return data;
+}
+
+template<typename T>
+const T* mosca::image::get_data_err() const
+{
+    if(mosca::type_trait<T>::cpl_eq_type != cpl_image_get_type(m_image_err))
+        throw std::invalid_argument("type requested does not match image data type");
+    const T* data;
+    data = static_cast<const T*>(cpl_image_get_data_const(m_image_err));
+    return data;
+}
+
 #endif
diff --git a/mosca/libmosca/reduce_method.cpp b/mosca/libmosca/reduce_method.cpp
new file mode 100644
index 0000000..bd59ee9
--- /dev/null
+++ b/mosca/libmosca/reduce_method.cpp
@@ -0,0 +1,68 @@
+/* $Id: reduce_method.cpp,v 1.2 2013-10-16 11:30:33 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:30:33 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+
+#include "reduce_method.h"
+
+mosca::reduce_mean::reduce_mean()
+{
+}
+
+hdrl_collapse_imagelist_to_image_t * mosca::reduce_mean::hdrl_reduce()
+{
+    return hdrl_collapse_imagelist_to_image_mean();
+}
+
+mosca::reduce_median::reduce_median()
+{
+}
+
+hdrl_collapse_imagelist_to_image_t * mosca::reduce_median::hdrl_reduce()
+{
+    return hdrl_collapse_imagelist_to_image_median();
+}
+
+mosca::reduce_weighted_mean::reduce_weighted_mean()
+{
+}
+
+hdrl_collapse_imagelist_to_image_t * mosca::reduce_weighted_mean::hdrl_reduce()
+{
+    return hdrl_collapse_imagelist_to_image_weighted_mean();
+}
+
+mosca::reduce_sigma_clipping::reduce_sigma_clipping
+(double kappa_low, double kappa_high, int iter) :
+m_kappa_high(kappa_high), m_kappa_low(kappa_low), m_iter(iter)
+{
+}
+
+hdrl_collapse_imagelist_to_image_t * mosca::reduce_sigma_clipping::hdrl_reduce()
+{
+    return hdrl_collapse_imagelist_to_image_sigclip
+               (m_kappa_low, m_kappa_high, m_iter);
+}
diff --git a/mosca/libmosca/reduce_method.h b/mosca/libmosca/reduce_method.h
new file mode 100644
index 0000000..e2c9198
--- /dev/null
+++ b/mosca/libmosca/reduce_method.h
@@ -0,0 +1,104 @@
+/* $Id: reduce_method.h,v 1.2 2013-10-16 11:30:33 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-10-16 11:30:33 $
+ * $Revision: 1.2 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#ifndef REDUCE_METHODS_H
+#define REDUCE_METHODS_H
+
+#include "hdrl_combine.h"
+
+namespace mosca
+{
+
+    /**
+     * This reduce method will simply compute the mean over a list of values  
+     */
+    class reduce_mean
+    {
+    public:
+        reduce_mean();
+        
+        /**
+         * Gets the HDRL reduce function
+         * @return
+         */
+        hdrl_collapse_imagelist_to_image_t * hdrl_reduce();
+    };
+
+    /**
+     * This reduce method will simply compute the median over a list of values  
+     */
+    class reduce_median
+    {
+    public:
+        reduce_median();
+        
+        /**
+         * Gets the HDRL reduce function
+         * @return
+         */
+        hdrl_collapse_imagelist_to_image_t * hdrl_reduce();
+    };
+
+    /**
+     * This reduce method will compute a kappa-sigma clipping algorithm
+     * over a list of values.  
+     */
+    class reduce_sigma_clipping
+    {
+    public:
+        reduce_sigma_clipping(double kappa_low, double kappa_high, int iter);
+        
+        /**
+         * Gets the HDRL reduce function
+         * @return
+         */
+        hdrl_collapse_imagelist_to_image_t * hdrl_reduce();
+        
+    private:
+        double m_kappa_high;
+        double m_kappa_low;
+        int m_iter;
+    };
+
+    /**
+     * This reduce method will compute a weighted mean algorithm
+     * over a list of values.  
+     */
+    class reduce_weighted_mean
+    {
+    public:
+        reduce_weighted_mean();
+        
+        /**
+         * Gets the HDRL reduce function
+         * @return
+         */
+        hdrl_collapse_imagelist_to_image_t * hdrl_reduce();
+    };
+}
+
+#endif
diff --git a/mosca/libmosca/tests/Makefile.am b/mosca/libmosca/tests/Makefile.am
new file mode 100644
index 0000000..ef9064d
--- /dev/null
+++ b/mosca/libmosca/tests/Makefile.am
@@ -0,0 +1,47 @@
+## This file is part of the Refran Library
+## Copyright (C) 2009 César Enrique García
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+#AUTOMAKE_OPTIONS = 1.8 foreign color-tests
+AUTOMAKE_OPTIONS = 1.8 foreign 
+
+DISTCLEANFILES = *~ *.testlog *.stdout test-reports/*
+
+EXTRA_DIST = test_driver
+
+AM_CXXFLAGS = -Wall -Wextra -pedantic \
+	$(MOSCA_INCLUDES) $(CPL_INCLUDES)
+
+if MAINTAINER_MODE
+
+MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
+
+endif
+
+LDFLAGS = $(CPL_LDFLAGS)
+LDADD = $(LIBMOSCA) $(LIBCPLCORE) $(LIBCPLUI) \
+	$(BOOST_UNIT_TEST_FRAMEWORK_LIB)
+
+check_PROGRAMS = image_smooth-test flat_combine-test
+
+
+image_smooth_test_SOURCES = image_smooth-test.cpp
+
+flat_combine_test_SOURCES = flat_combine-test.cpp
+
+TESTS_ENVIRONMENT = $(srcdir)/test_driver
+TESTS = $(check_PROGRAMS)
diff --git a/mosca/libmosca/tests/Makefile.in b/mosca/libmosca/tests/Makefile.in
new file mode 100644
index 0000000..092b3e5
--- /dev/null
+++ b/mosca/libmosca/tests/Makefile.in
@@ -0,0 +1,704 @@
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+check_PROGRAMS = image_smooth-test$(EXEEXT) flat_combine-test$(EXEEXT)
+subdir = mosca/libmosca/tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/admin/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am_flat_combine_test_OBJECTS = flat_combine-test.$(OBJEXT)
+flat_combine_test_OBJECTS = $(am_flat_combine_test_OBJECTS)
+flat_combine_test_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+flat_combine_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_image_smooth_test_OBJECTS = image_smooth-test.$(OBJEXT)
+image_smooth_test_OBJECTS = $(am_image_smooth_test_OBJECTS)
+image_smooth_test_LDADD = $(LDADD)
+image_smooth_test_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(flat_combine_test_SOURCES) $(image_smooth_test_SOURCES)
+DIST_SOURCES = $(flat_combine_test_SOURCES) \
+	$(image_smooth_test_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = $(am__tty_colors_dummy)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFITSIO_INCLUDES = @CFITSIO_INCLUDES@
+CFITSIO_LDFLAGS = @CFITSIO_LDFLAGS@
+CFLAGS = @CFLAGS@
+CPL_INCLUDES = @CPL_INCLUDES@
+CPL_LDFLAGS = @CPL_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CX_INCLUDES = @CX_INCLUDES@
+CX_LDFLAGS = @CX_LDFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FORS_BINARY_AGE = @FORS_BINARY_AGE@
+FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
+FORS_INCLUDES = @FORS_INCLUDES@
+FORS_INTERFACE_AGE = @FORS_INTERFACE_AGE@
+FORS_LDFLAGS = @FORS_LDFLAGS@
+FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
+FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
+FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
+FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
+LATEX = @LATEX@
+LD = @LD@
+LDFLAGS = $(CPL_LDFLAGS)
+LIBCEXT = @LIBCEXT@
+LIBCFITSIO = @LIBCFITSIO@
+LIBCPLCORE = @LIBCPLCORE@
+LIBCPLDFS = @LIBCPLDFS@
+LIBCPLDRS = @LIBCPLDRS@
+LIBCPLUI = @LIBCPLUI@
+LIBFORS = @LIBFORS@
+LIBIRPLIB = @LIBIRPLIB@
+LIBMOSCA = @LIBMOSCA@
+LIBOBJS = @LIBOBJS@
+LIBPTHREAD = @LIBPTHREAD@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PURIFY_CMD = @PURIFY_CMD@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+all_includes = @all_includes@
+all_ldflags = @all_ldflags@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+configdir = @configdir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pipedocsdir = @pipedocsdir@
+plugindir = @plugindir@
+prefix = @prefix@
+privatelibdir = @privatelibdir@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+wkfcopydir = @wkfcopydir@
+wkfextradir = @wkfextradir@
+
+#AUTOMAKE_OPTIONS = 1.8 foreign color-tests
+AUTOMAKE_OPTIONS = 1.8 foreign 
+DISTCLEANFILES = *~ *.testlog *.stdout test-reports/*
+EXTRA_DIST = test_driver
+AM_CXXFLAGS = -Wall -Wextra -pedantic \
+	$(MOSCA_INCLUDES) $(CPL_INCLUDES)
+
+ at MAINTAINER_MODE_TRUE@MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
+LDADD = $(LIBMOSCA) $(LIBCPLCORE) $(LIBCPLUI) \
+	$(BOOST_UNIT_TEST_FRAMEWORK_LIB)
+
+image_smooth_test_SOURCES = image_smooth-test.cpp
+flat_combine_test_SOURCES = flat_combine-test.cpp
+TESTS_ENVIRONMENT = $(srcdir)/test_driver
+TESTS = $(check_PROGRAMS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mosca/libmosca/tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign mosca/libmosca/tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-checkPROGRAMS:
+	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+flat_combine-test$(EXEEXT): $(flat_combine_test_OBJECTS) $(flat_combine_test_DEPENDENCIES) $(EXTRA_flat_combine_test_DEPENDENCIES) 
+	@rm -f flat_combine-test$(EXEEXT)
+	$(CXXLINK) $(flat_combine_test_OBJECTS) $(flat_combine_test_LDADD) $(LIBS)
+image_smooth-test$(EXEEXT): $(image_smooth_test_OBJECTS) $(image_smooth_test_DEPENDENCIES) $(EXTRA_image_smooth_test_DEPENDENCIES) 
+	@rm -f image_smooth-test$(EXEEXT)
+	$(CXXLINK) $(image_smooth_test_OBJECTS) $(image_smooth_test_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flat_combine-test.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/image_smooth-test.Po at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+	clean-checkPROGRAMS clean-generic clean-libtool cscopelist \
+	ctags distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/mosca/libmosca/tests/flat_combine-test.cpp b/mosca/libmosca/tests/flat_combine-test.cpp
new file mode 100644
index 0000000..a361ce7
--- /dev/null
+++ b/mosca/libmosca/tests/flat_combine-test.cpp
@@ -0,0 +1,89 @@
+/* $Id: flat_combine-test.cpp,v 1.5 2013-08-14 13:36:49 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-08-14 13:36:49 $
+ * $Revision: 1.5 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#include "config.h"
+
+#if defined HAVE_BOOST_UNIT_TEST_FRAMEWORK && HAVE_CXX11
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE flat_combine-test
+#define _GLIBCXX_USE_NANOSLEEP
+#include <memory>
+#include <random>
+#include <functional>
+#include <algorithm>
+#include <functional>
+#include <boost/test/unit_test.hpp>
+#include <boost/test/test_case_template.hpp>
+#include <boost/mpl/list.hpp>
+#include <cpl.h>
+#include "flat_combine.h"
+#include "reduce_method.h"
+#include "type_traits.h"
+
+BOOST_AUTO_TEST_SUITE(flat_combine_types)
+
+typedef boost::mpl::list<float, double> test_types;
+typedef std::default_random_engine rnd_generator;
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(flat_combine_types, T, test_types)
+{
+    cpl_init(CPL_INIT_DEFAULT);
+    cpl_errorstate prestate =  cpl_errorstate_get();
+    //cpl_type type = mosca::type_trait<T>::cpl_eq_type;
+    cpl_size   nx = 1000;
+    cpl_size   ny = 500;
+    
+    
+    std::vector<mosca::image> flats;
+    flats.push_back(mosca::image(nx, ny));
+    flats.push_back(mosca::image(nx, ny));
+    std::vector<mosca::detected_slit> slits;
+    mosca::wavelength_calibration wave_cal;
+    double smooth_size =5;
+    mosca::reduce_median reduce_method;
+    std::auto_ptr<mosca::image> master_flat = 
+        mosca::flat_combine<T, mosca::reduce_median>
+            (flats, slits, wave_cal, smooth_size, reduce_method);
+    
+    BOOST_REQUIRE_EQUAL(prestate, cpl_errorstate_get() );
+    cpl_end();
+}
+
+typedef boost::mpl::list<float> test_default_type;
+
+
+BOOST_AUTO_TEST_SUITE_END()
+
+#else
+
+int main(void)
+{
+    return 0;
+}
+
+#endif
diff --git a/mosca/libmosca/tests/image_smooth-test.cpp b/mosca/libmosca/tests/image_smooth-test.cpp
new file mode 100644
index 0000000..7859af9
--- /dev/null
+++ b/mosca/libmosca/tests/image_smooth-test.cpp
@@ -0,0 +1,372 @@
+/* $Id: image_smooth-test.cpp,v 1.15 2013-08-08 19:37:40 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-08-08 19:37:40 $
+ * $Revision: 1.15 $
+ * $Name: not supported by cvs2svn $
+ */
+
+#include "config.h"
+
+#if defined HAVE_BOOST_UNIT_TEST_FRAMEWORK && HAVE_CXX11
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE image_smooth-test
+#define _GLIBCXX_USE_NANOSLEEP
+#include <memory>
+#include <random>
+#include <functional>
+#include <algorithm>
+#include <functional>
+#include <boost/test/unit_test.hpp>
+#include <boost/test/test_case_template.hpp>
+#include <boost/mpl/list.hpp>
+#include <cpl.h>
+#include "image_smooth.h"
+#include "type_traits.h"
+
+BOOST_AUTO_TEST_SUITE(image_smooth_types)
+
+typedef boost::mpl::list<float, double> test_types;
+typedef std::minstd_rand0 rnd_generator; //std::default_random_engine with a modern C++11 (not available in psdlin1) 
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(image_smooth_types, T, test_types)
+{
+    cpl_init(CPL_INIT_DEFAULT);
+    cpl_errorstate prestate =  cpl_errorstate_get();
+    cpl_type type = mosca::type_trait<T>::cpl_eq_type;
+    cpl_size   nx = 100;
+    cpl_size   ny = 100;
+    
+    rnd_generator rnd; 
+    std::normal_distribution<T> gauss(5.0,2.0);
+
+    for(cpl_size half_width = 1; half_width < nx / 2 - 1; half_width += 5)
+    {
+
+        mosca::image image(nx, ny, type);
+        
+        //Fill the image with random data
+        std::generate(image.get_data<T>(), image.get_data<T>() + nx*ny,
+                      std::bind(gauss, rnd));
+        mosca::image_smooth_1d_median<T>(image, half_width, 
+                                      mosca::DISPERSION_AXIS);
+    }
+    BOOST_REQUIRE_EQUAL(prestate, cpl_errorstate_get() );
+    cpl_end();
+}
+
+typedef boost::mpl::list<float> test_default_type;
+
+BOOST_AUTO_TEST_CASE_TEMPLATE(image_smooth_default_type, T, test_default_type)
+{
+    cpl_init(CPL_INIT_DEFAULT);
+    cpl_errorstate prestate =  cpl_errorstate_get();
+    cpl_type type = mosca::type_trait<T>::cpl_eq_type;
+    cpl_size   nx = 100;
+    cpl_size   ny = 100;
+    
+    rnd_generator rnd;
+    std::normal_distribution<T> gauss(5.0,2.0);
+
+    for(cpl_size half_width = 1; half_width < nx / 2 - 1; half_width += 5)
+    {
+
+        mosca::image image(nx, ny, type);
+        
+        //Fill the image with random data
+        std::generate(image.get_data<T>(), image.get_data<T>() + nx*ny,
+                      std::bind(gauss,rnd));
+        mosca::image_smooth_1d_median<T>(image, half_width, 
+                                      mosca::DISPERSION_AXIS);
+    }
+    BOOST_REQUIRE_EQUAL(prestate, cpl_errorstate_get() );
+    cpl_end();
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+BOOST_AUTO_TEST_SUITE(image_smooth_errors)
+
+BOOST_AUTO_TEST_CASE(wrong_half_width_size_disp)
+{
+    cpl_init(CPL_INIT_DEFAULT);
+    cpl_size   nx = 100;
+    cpl_size   ny = 1000;
+    
+    mosca::image image(nx, ny, CPL_TYPE_FLOAT);
+    BOOST_REQUIRE_THROW(mosca::image_smooth_1d_median<float>(
+            image, 60, mosca::DISPERSION_AXIS), std::out_of_range);
+    cpl_end();
+}
+
+BOOST_AUTO_TEST_CASE(wrong_half_width_size_spa)
+{
+    cpl_init(CPL_INIT_DEFAULT);
+    cpl_size   nx = 1000;
+    cpl_size   ny = 100;
+    
+    mosca::image image(nx, ny, CPL_TYPE_FLOAT);
+    BOOST_REQUIRE_THROW(mosca::image_smooth_1d_median<float>(
+            image, 60, mosca::SPATIAL_AXIS), std::out_of_range);
+    cpl_end();
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+BOOST_AUTO_TEST_SUITE(image_smooth_axes)
+
+typedef std::minstd_rand0 rnd_generator; //std::default_random_engine with a modern C++11 (not available in psdlin1) 
+
+BOOST_AUTO_TEST_CASE(smooth_disp_spat_x_y)
+{
+    cpl_init(CPL_INIT_DEFAULT);
+    cpl_errorstate prestate =  cpl_errorstate_get();
+    cpl_size   nx = 100;
+    cpl_size   ny = 100;
+    mosca::axis axes[] = {mosca::DISPERSION_AXIS, mosca::SPATIAL_AXIS, 
+            mosca::X_AXIS, mosca::Y_AXIS};
+    
+    rnd_generator rnd;
+    std::normal_distribution<double> gauss(50.0,2.0);
+
+    for(mosca::axis axis : axes)
+    {
+        for(cpl_size kernel_size = 1; kernel_size*2  < nx; kernel_size+=5)
+        {
+            mosca::image image(nx, ny, CPL_TYPE_FLOAT);
+            //Fill the image with random data
+            std::generate(image.get_data<float>(), image.get_data<float>() + nx*ny,
+                          std::bind(gauss,rnd));
+            mosca::image_smooth_1d_median<float>(image, kernel_size, axis);
+        }
+    }
+    BOOST_REQUIRE_EQUAL(prestate, cpl_errorstate_get() );
+    cpl_end();
+}
+
+BOOST_AUTO_TEST_CASE(smooth_xy)
+{
+    cpl_init(CPL_INIT_DEFAULT);
+    cpl_errorstate prestate =  cpl_errorstate_get();
+    cpl_size   nx = 100;
+    cpl_size   ny = 100;
+    
+
+    for(cpl_size kernel_size = 1; kernel_size*2 < nx; kernel_size+=5)
+    {
+        mosca::image image(nx, ny, CPL_TYPE_FLOAT);
+        //Fill the image with random data
+        mosca::image_smooth_1d_median<float>(image, kernel_size, 
+                                      mosca::X_AXIS);
+        mosca::image_smooth_1d_median<float>(image, kernel_size, 
+                                      mosca::Y_AXIS);
+    }
+    BOOST_REQUIRE_EQUAL(prestate, cpl_errorstate_get() );
+    cpl_end();
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+struct random_image_fixture
+{
+    typedef std::minstd_rand0 rnd_generator; //std::default_random_engine with a modern C++11 (not available in psdlin1) 
+
+    random_image_fixture()
+    {
+        BOOST_TEST_MESSAGE( "setup fixture" ); 
+        cpl_init(CPL_INIT_DEFAULT);
+        half_width = 5;
+        nx = 1000;
+        ny = 1000;
+        image.reset(new mosca::image(nx, ny, CPL_TYPE_FLOAT));
+        rnd_generator rnd;
+        std::normal_distribution<double> gauss(5.0,2.0);
+        std::generate(image->get_data<float>(), image->get_data<float>() + nx*ny,
+                      std::bind(gauss,rnd));
+        cpl_image * image_tmp =
+                cpl_image_wrap_float(nx, ny, image->get_data<float>());
+        image_cpl = cpl_image_duplicate(image_tmp);
+        cpl_image_unwrap(image_tmp);
+    }
+    
+    ~random_image_fixture()
+    {
+        BOOST_TEST_MESSAGE( "teardown fixture" );
+        cpl_image_delete(image_cpl);
+        cpl_end();
+    }
+    
+    cpl_image *                   image_cpl;
+    std::unique_ptr<mosca::image> image;
+    cpl_size                      half_width;
+    cpl_size                      nx;
+    cpl_size                      ny;
+};
+
+BOOST_FIXTURE_TEST_SUITE(image_smooth_benchmark, random_image_fixture)
+
+
+BOOST_AUTO_TEST_CASE(benchmark_mosca_smooth_x)
+{    
+    mosca::image_smooth_1d_median<float>(*image, half_width,mosca::X_AXIS);
+}
+
+BOOST_AUTO_TEST_CASE(benchmark_legacy_smooth_x)
+{
+    float      *data = cpl_image_get_data_float(image_cpl);
+    float       *p;
+    double     *fdata;
+    cpl_vector *flux;
+    cpl_vector *smo_flux;
+
+    for (cpl_size j = 0; j < ny; j++)
+    {
+        flux = cpl_vector_new(nx);
+        fdata = cpl_vector_get_data(flux);
+        p = data;
+        for (cpl_size k = 0; k < nx; k++)
+            *fdata++ = *p++;
+        smo_flux = cpl_vector_filter_median_create(flux, half_width);
+        fdata = cpl_vector_get_data(smo_flux);
+        p = data;
+        for (cpl_size k = 0; k < nx; k++)
+            *p++ = *fdata++;
+        cpl_vector_delete(smo_flux);
+        data += nx;
+        cpl_vector_delete(flux);
+    }
+}
+
+BOOST_AUTO_TEST_CASE(benchmark_mosca_smooth_y)
+{
+    
+    mosca::image_smooth_1d_median<float>(*image, half_width,mosca::Y_AXIS);
+}
+
+BOOST_AUTO_TEST_CASE(benchmark_legacy_smooth_y)
+{
+    float      *data = cpl_image_get_data_float(image_cpl);
+    float      *p;
+    double     *fdata;
+    cpl_vector *flux;
+    cpl_vector *smo_flux;
+
+    cpl_image_turn(image_cpl, 1);
+    for (cpl_size j = 0; j < ny; j++)
+    {
+        flux = cpl_vector_new(nx);
+        fdata = cpl_vector_get_data(flux);
+        p = data;
+        for (cpl_size k = 0; k < nx; k++)
+            *fdata++ = *p++;
+        smo_flux = cpl_vector_filter_median_create(flux, half_width);
+        fdata = cpl_vector_get_data(smo_flux);
+        p = data;
+        for (cpl_size k = 0; k < nx; k++)
+            *p++ = *fdata++;
+        cpl_vector_delete(smo_flux);
+        data += nx;
+        cpl_vector_delete(flux);
+    }
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+BOOST_FIXTURE_TEST_SUITE(image_smooth_compare_legacy, random_image_fixture)
+
+BOOST_AUTO_TEST_CASE(compare_legacy_x)
+{
+    float      *data = cpl_image_get_data_float(image_cpl);
+    float      *p;
+    double     *fdata;
+    cpl_vector *flux;
+    cpl_vector *smo_flux;
+
+    for (cpl_size j = 0; j < ny; j++)
+    {
+        flux = cpl_vector_new(nx);
+        fdata = cpl_vector_get_data(flux);
+        p = data;
+        for (cpl_size k = 0; k < nx; k++)
+            *fdata++ = *p++;
+        smo_flux = cpl_vector_filter_median_create(flux, half_width);
+        fdata = cpl_vector_get_data(smo_flux);
+        p = data;
+        for (cpl_size k = 0; k < nx; k++)
+            *p++ = *fdata++;
+        cpl_vector_delete(smo_flux);
+        data += nx;
+        cpl_vector_delete(flux);
+    }
+    
+    mosca::image_smooth_1d_median<float>(*image, half_width,mosca::X_AXIS);
+    
+    BOOST_REQUIRE_EQUAL_COLLECTIONS
+    (image->get_data<float>(), image->get_data<float>() + nx*ny,
+     cpl_image_get_data_float(image_cpl), cpl_image_get_data_float(image_cpl) +nx*ny);
+}
+
+BOOST_AUTO_TEST_CASE(compare_legacy_y)
+{
+    float      *data = cpl_image_get_data_float(image_cpl);
+    float      *p;
+    double     *fdata;
+    cpl_vector *flux;
+    cpl_vector *smo_flux;
+
+    cpl_image_turn(image_cpl, 1);
+    for (cpl_size j = 0; j < ny; j++)
+    {
+        flux = cpl_vector_new(nx);
+        fdata = cpl_vector_get_data(flux);
+        p = data;
+        for (cpl_size k = 0; k < nx; k++)
+            *fdata++ = *p++;
+        smo_flux = cpl_vector_filter_median_create(flux, half_width);
+        fdata = cpl_vector_get_data(smo_flux);
+        p = data;
+        for (cpl_size k = 0; k < nx; k++)
+            *p++ = *fdata++;
+        cpl_vector_delete(smo_flux);
+        data += nx;
+        cpl_vector_delete(flux);
+    }
+    cpl_image_turn(image_cpl, -1);
+    
+    mosca::image_smooth_1d_median<float>(*image, half_width,mosca::Y_AXIS);
+    
+    BOOST_REQUIRE_EQUAL_COLLECTIONS
+    (image->get_data<float>(), image->get_data<float>() + nx*ny,
+     cpl_image_get_data_float(image_cpl), cpl_image_get_data_float(image_cpl) +nx*ny);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+#else
+
+int main(void)
+{
+    return 0;
+}
+
+#endif
diff --git a/mosca/libmosca/tests/test_driver b/mosca/libmosca/tests/test_driver
new file mode 100755
index 0000000..baaab97
--- /dev/null
+++ b/mosca/libmosca/tests/test_driver
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ ! -d test-reports ] ; then
+	mkdir -p test-reports
+fi
+
+MALLOC_PERTURB_=231 MALLOC_CHECK_=2 BOOST_TEST_CATCH_SYSTEM_ERROR=yes BOOST_TEST_REPORT_LEVEL=detailed BOOST_TEST_LOG_SINK=test-reports/$1.xml BOOST_TEST_LOG_LEVEL=all BOOST_TEST_LOG_FORMAT=XML exec ./$1 > $1.stdout
diff --git a/mosca/libmosca/type_traits.h b/mosca/libmosca/type_traits.h
index e2daffc..9318dd6 100644
--- a/mosca/libmosca/type_traits.h
+++ b/mosca/libmosca/type_traits.h
@@ -1,4 +1,4 @@
-/* $Id: type_traits.h,v 1.2 2013/01/29 09:54:37 cgarcia Exp $
+/* $Id: type_traits.h,v 1.4 2013-03-25 14:23:56 cgarcia Exp $
  *
  * This file is part of the MOSCA library
  * Copyright (C) 2013 European Southern Observatory
@@ -15,14 +15,14 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/29 09:54:37 $
- * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-03-25 14:23:56 $
+ * $Revision: 1.4 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifndef TYPE_TRAITS_H
diff --git a/mosca/libmosca/image_smooth.h b/mosca/libmosca/vector_utils.h
similarity index 54%
copy from mosca/libmosca/image_smooth.h
copy to mosca/libmosca/vector_utils.h
index 609d843..0d71a48 100644
--- a/mosca/libmosca/image_smooth.h
+++ b/mosca/libmosca/vector_utils.h
@@ -1,4 +1,4 @@
-/* $Id: image_smooth.h,v 1.2 2013/01/24 18:01:23 cgarcia Exp $
+/* $Id: vector_utils.h,v 1.1 2013-07-24 07:44:56 cgarcia Exp $
  *
  * This file is part of the MOSCA library
  * Copyright (C) 2013 European Southern Observatory
@@ -15,20 +15,35 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/01/24 18:01:23 $
- * $Revision: 1.2 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-07-24 07:44:56 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
  */
 
-#include "mosca_image.h"
+#ifndef VECTOR_UTILS_H
+#define VECTOR_UTILS_H
+
+#include <vector>
 
 namespace mosca
 {
-void image_smooth_1d_median(mosca::image& image, 
-                            double half_width, mosca::axis smooth_axis);
+template<typename T>
+void vector_divide(std::vector<T>& input, 
+                   std::vector<T>& input_err,
+                   const std::vector<int>& dividend);
+
+template<typename T>
+void vector_smooth(std::vector<T>& input, 
+                   std::vector<T>& input_err,
+                   size_t smooth_size);
 }
+
+
+#include "vector_utils.tcc"
+
+#endif
diff --git a/mosca/libmosca/vector_utils.tcc b/mosca/libmosca/vector_utils.tcc
new file mode 100644
index 0000000..a493e48
--- /dev/null
+++ b/mosca/libmosca/vector_utils.tcc
@@ -0,0 +1,90 @@
+/* $Id: vector_utils.tcc,v 1.1 2013-07-24 07:44:56 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013-07-24 07:44:56 $
+ * $Revision: 1.1 $
+ * $Name: not supported by cvs2svn $
+ */
+
+
+#ifndef VECTOR_UTILS_TCC
+#define VECTOR_UTILS_TCC
+
+#include <exception>
+#include "vector_utils.h"
+
+
+/**
+ * @brief
+ *   Collapse a list of images in a container with median 
+ *
+ * @return The mean image
+ *
+ */
+template<typename T>
+void mosca::vector_divide(std::vector<T>& input,
+                          std::vector<T>& input_err,
+                          const std::vector<int>& dividend)
+{
+    if((input.size() != input_err.size()) || (input.size() != dividend.size()))
+        throw std::invalid_argument("Vector sizes do not match");
+
+    for(size_t i = 0 ; i < input.size(); ++i)
+    {
+        input[i] = input[i] / dividend[i];
+        input_err[i] = input_err[i] / dividend[i];
+    }    
+
+}
+
+
+/* TODO: It is wrong, it uses only the forward elements.
+ * Use some cpl stuff here 
+ */
+template<typename T>
+void mosca::vector_smooth(std::vector<T>& input,
+                          std::vector<T>& input_err,
+                          size_t smooth_size)
+{
+    if(input.size() != input_err.size())
+        throw std::invalid_argument("Vector sizes do not match");
+    if(smooth_size > input.size())
+        throw std::invalid_argument("Smooth size too large");
+
+    for(size_t i = 0; i<input.size() - smooth_size; i++)
+    {
+        double smoothed_value = 0;
+        double smoothed_value_err = 0;
+
+        for(size_t j = 0; j < smooth_size; ++j)
+        {
+            smoothed_value += input[i+j];
+            smoothed_value_err += input_err[i+j];
+        }
+        smoothed_value /= smooth_size;
+        smoothed_value_err /= smooth_size;
+        input[i] = smoothed_value;
+        input_err[i] = smoothed_value_err;
+    }
+}
+
+#endif
diff --git a/mosca/libmosca/wavelength_calibration.cpp b/mosca/libmosca/wavelength_calibration.cpp
new file mode 100644
index 0000000..aa770d5
--- /dev/null
+++ b/mosca/libmosca/wavelength_calibration.cpp
@@ -0,0 +1,178 @@
+/* $Id: wavelength_calibration.cpp,v 1.5 2013/08/07 15:47:01 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013/08/07 15:47:01 $
+ * $Revision: 1.5 $
+ * $Name:  $
+ */
+
+#include <iostream>
+#include <stdexcept>
+#include <algorithm>
+#include <sstream>
+#include <cpl_table.h>
+#include <cpl_msg.h>
+#include <cpl_polynomial.h>
+#include "wavelength_calibration.h"
+
+mosca::wavelength_calibration::wavelength_calibration()
+{   
+}
+
+mosca::wavelength_calibration::wavelength_calibration
+(const std::string& fits_disp_coeff)
+{
+    /* We read from extension 1 of slit location table */
+    cpl_table* idscoeff = cpl_table_load(fits_disp_coeff.c_str(), 1, 1);
+
+    
+    cpl_size ndegree = cpl_table_get_ncol(idscoeff) - 2;
+
+    for(cpl_size irow = 0 ; irow < cpl_table_get_nrow(idscoeff); irow++)
+    {
+        std::vector<double> pol_coeff;
+        int null = 0;
+        for(cpl_size idx_coeff = 0; idx_coeff < ndegree; idx_coeff++)
+        {
+            std::ostringstream colname;
+            colname<<std::left<<"c"<<idx_coeff;
+            pol_coeff.push_back(cpl_table_get_double
+                    (idscoeff, colname.str().c_str(), irow, &null));
+            if(null)
+                break;
+        }
+        cpl_polynomial * poly = NULL;
+        if(!null)
+        {
+            poly = cpl_polynomial_new(1);
+            cpl_size idx;
+            std::vector<double>::reverse_iterator coeff;
+            for( idx = pol_coeff.size() - 1, coeff = pol_coeff.rbegin(); coeff != pol_coeff.rend();
+                    ++coeff, --idx)
+                cpl_polynomial_set_coeff(poly, &idx, *coeff);
+        }
+        m_wave_coeff.push_back(poly);
+    }
+}
+
+mosca::wavelength_calibration::wavelength_calibration
+(const cpl_table * idscoeff)
+{
+    from_idscoeff(idscoeff);
+}
+
+void mosca::wavelength_calibration::from_idscoeff(const cpl_table * idscoeff)
+{
+    cpl_size ndegree = cpl_table_get_ncol(idscoeff) - 2;
+
+    for(cpl_size irow = 0 ; irow < cpl_table_get_nrow(idscoeff); irow++)
+    {
+        std::vector<double> pol_coeff;
+        int null = 0;
+        for(cpl_size idx_coeff = 0; idx_coeff < ndegree; idx_coeff++)
+        {
+            std::ostringstream colname;
+            colname<<std::left<<"c"<<idx_coeff;
+            pol_coeff.push_back(cpl_table_get_double
+                    (idscoeff, colname.str().c_str(), irow, &null));
+            if(null)
+                break;
+        }
+        cpl_polynomial * poly = NULL;
+        if(!null)
+        {
+            poly = cpl_polynomial_new(1);
+            cpl_size idx;
+            std::vector<double>::reverse_iterator coeff;
+            for( idx = pol_coeff.size() - 1, coeff = pol_coeff.rbegin(); coeff != pol_coeff.rend();
+                    ++coeff, --idx)
+                cpl_polynomial_set_coeff(poly, &idx, *coeff);
+        }
+        m_wave_coeff.push_back(poly);
+    }
+}
+
+mosca::wavelength_calibration::~wavelength_calibration()
+{
+    std::vector<cpl_polynomial *>::iterator poly;
+    for(poly = m_wave_coeff.begin(); poly != m_wave_coeff.end(); poly++)
+    {
+        if(*poly != NULL)
+            cpl_polynomial_delete(*poly);
+    }
+}
+
+double mosca::wavelength_calibration::get_wave(double spatial_corrected_pos,
+                                               double dispersion_pos) const
+{
+    double wavelength = -1; //Denotes and error. TODO
+    /* TODO: I think this is wrong, the reference wavelength probably has to be added */
+    size_t row = (size_t)(spatial_corrected_pos);
+    if(row >= m_wave_coeff.size())
+        return wavelength;
+    
+    cpl_polynomial * poly = m_wave_coeff[row];
+    
+    if(poly != NULL)
+        wavelength = cpl_polynomial_eval_1d(poly, dispersion_pos, NULL);
+    
+    return wavelength;
+}
+
+
+void mosca::wavelength_calibration::min_max_wave(double& min_wave,
+                                                 double& max_wave,
+                                                 int size_dispersion,
+                                                 int min_spa_row,
+                                                 int max_spa_row) const
+{
+     
+    std::vector<double> wave_pix_0;
+    std::vector<double> wave_pix_size;
+    /* TODO: Check this limits */
+    for(int irow = min_spa_row ; irow < max_spa_row; ++irow)
+    {
+        cpl_polynomial * poly = m_wave_coeff[irow];
+        if(poly != NULL)
+        {
+            double wave_0 = cpl_polynomial_eval_1d(poly, 0., NULL);
+            double wave_size = cpl_polynomial_eval_1d(poly, (double)size_dispersion, NULL);
+            wave_pix_0.push_back(wave_0);
+            wave_pix_size.push_back(wave_size);
+        }
+    }
+    min_wave = *std::min_element(wave_pix_0.begin(), wave_pix_0.end());
+    max_wave = *std::max_element(wave_pix_size.begin(), wave_pix_size.end());
+}
+
+double mosca::wavelength_calibration::mean_dispersion(int size_dispersion,
+                                                      int min_spa_row,
+                                                      int max_spa_row) const
+{
+    double min_wave, max_wave;
+    
+    min_max_wave(min_wave, max_wave, size_dispersion, min_spa_row, max_spa_row);
+    
+    double mean_dispersion = (max_wave - min_wave) / size_dispersion;
+    
+    return mean_dispersion;
+}
diff --git a/mosca/libmosca/wavelength_calibration.h b/mosca/libmosca/wavelength_calibration.h
new file mode 100644
index 0000000..d6e2071
--- /dev/null
+++ b/mosca/libmosca/wavelength_calibration.h
@@ -0,0 +1,71 @@
+/* $Id: wavelength_calibration.h,v 1.2 2013/07/24 14:53:01 cgarcia Exp $
+ *
+ * This file is part of the MOSCA library
+ * Copyright (C) 2013 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013/07/24 14:53:01 $
+ * $Revision: 1.2 $
+ * $Name:  $
+ */
+
+#ifndef WAVELENGTH_CALIBRATION_H
+#define WAVELENGTH_CALIBRATION_H
+
+#include <vector>
+#include "cpl_polynomial.h"
+
+namespace mosca
+{
+
+
+/**
+ * This class the wavelength calibration for all the rows in a rectified
+ * image (so the rows correspond to rectified spatial values). 
+ */
+class wavelength_calibration
+{
+public:
+    wavelength_calibration();
+    
+    wavelength_calibration(const std::string& fits_disp_coeff);
+
+    wavelength_calibration(const cpl_table * idscoeff);
+
+    ~wavelength_calibration();
+  
+    void from_idscoeff(const cpl_table * idscoeff);
+    
+    double get_wave(double spatial_corrected_pos, double dispersion_pos) const;
+    
+    void min_max_wave(double& min_wave, double &max_wave, int size_dispersion,
+                      int min_spa_row,
+                      int max_spa_row) const;
+
+    double mean_dispersion(int size_dispersion,
+                           int min_spa_row,
+                           int max_spa_row) const;
+    
+private:
+    
+    std::vector<cpl_polynomial *> m_wave_coeff;
+};
+
+}
+#endif
diff --git a/recipes/Makefile.am b/recipes/Makefile.am
index a0abb14..81b978d 100644
--- a/recipes/Makefile.am
+++ b/recipes/Makefile.am
@@ -33,6 +33,11 @@ endif
 
 AM_CPPFLAGS = $(all_includes)
 
+#-Wl,-z,defs issues an error if they are undefined symbols
+#However the OS X linker doesn't understand this. It seems 
+#there is no portable way to get this
+#AM_LDFLAGS =  -Wl,-z,defs
+
 
 noinst_HEADERS = 
 
@@ -69,169 +74,169 @@ plugin_LTLIBRARIES = fors_calib.la fors_science.la fors_config.la \
                      fors_pmos_calib.la fors_pmos_science.la \
                      fors_pmos_extract.la
 endif
-
-fors_calib_la_SOURCES = fors_calib.c
-fors_calib_la_LIBADD = $(LIBFORS)
-fors_calib_la_LDFLAGS = -module -avoid-version
+#The -static is needed because in VLT machines, with LD_LIBRARY_PATH=/usrlib:/vlt..., the /usr/lib/libstdc++.so is chosen at runtime, which is the wrong version (it was compiled with /vlt/VLT2010/....). This will compile everything static for this library. Once DFS machines are VLT-free this can be removed.
+fors_calib_la_SOURCES = fors_calib.cc
+fors_calib_la_LIBADD = $(LIBMOSCA) $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_calib_la_LDFLAGS = -module -avoid-version 
 fors_calib_la_DEPENDENCIES = $(LIBFORS)
 
 fors_science_la_SOURCES = fors_science.c
-fors_science_la_LIBADD = $(LIBFORS)
-fors_science_la_LDFLAGS = -module -avoid-version
+fors_science_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_science_la_LDFLAGS = -module -avoid-version 
 fors_science_la_DEPENDENCIES = $(LIBFORS)
 
 fors_config_la_SOURCES = fors_config.c
-fors_config_la_LIBADD = $(LIBFORS)
-fors_config_la_LDFLAGS = -module -avoid-version
+fors_config_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_config_la_LDFLAGS = -module -avoid-version 
 fors_config_la_DEPENDENCIES = $(LIBFORS)
 
 fors_sumflux_la_SOURCES = fors_sumflux.c
-fors_sumflux_la_LIBADD = $(LIBFORS)
-fors_sumflux_la_LDFLAGS = -module -avoid-version
+fors_sumflux_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_sumflux_la_LDFLAGS = -module -avoid-version 
 fors_sumflux_la_DEPENDENCIES = $(LIBFORS)
 
 fors_extract_la_SOURCES = fors_extract.c
-fors_extract_la_LIBADD = $(LIBFORS)
-fors_extract_la_LDFLAGS = -module -avoid-version
+fors_extract_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_extract_la_LDFLAGS = -module -avoid-version 
 fors_extract_la_DEPENDENCIES = $(LIBFORS)
 
 test_hough_la_SOURCES = test_hough.c
 
-test_hough_la_LIBADD = $(LIBFORS)
-test_hough_la_LDFLAGS = -module -avoid-version
+test_hough_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+test_hough_la_LDFLAGS = -module -avoid-version 
 test_hough_la_DEPENDENCIES = $(LIBFORS)
 
 fors_bias_la_SOURCES = fors_bias.c
-fors_bias_la_LIBADD = $(LIBFORS)
-fors_bias_la_LDFLAGS = -module -avoid-version
+fors_bias_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_bias_la_LDFLAGS = -module -avoid-version 
 fors_bias_la_DEPENDENCIES = $(LIBFORS)
 
 fors_remove_bias_la_SOURCES = fors_remove_bias.c
-fors_remove_bias_la_LIBADD = $(LIBFORS)
-fors_remove_bias_la_LDFLAGS = -module -avoid-version
+fors_remove_bias_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_remove_bias_la_LDFLAGS = -module -avoid-version 
 fors_remove_bias_la_DEPENDENCIES = $(LIBFORS)
 
-fors_flat_la_SOURCES = fors_flat.c
-fors_flat_la_LIBADD = $(LIBFORS)
-fors_flat_la_LDFLAGS = -module -avoid-version
+fors_flat_la_SOURCES = fors_flat.cc
+fors_flat_la_LIBADD = $(LIBMOSCA) $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_flat_la_LDFLAGS = -module -avoid-version 
 fors_flat_la_DEPENDENCIES = $(LIBFORS)
 
 fors_detect_spectra_la_SOURCES = fors_detect_spectra.c
-fors_detect_spectra_la_LIBADD = $(LIBFORS)
-fors_detect_spectra_la_LDFLAGS = -module -avoid-version
+fors_detect_spectra_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_detect_spectra_la_LDFLAGS = -module -avoid-version 
 fors_detect_spectra_la_DEPENDENCIES = $(LIBFORS)
 
 fors_trace_flat_la_SOURCES = fors_trace_flat.c
-fors_trace_flat_la_LIBADD = $(LIBFORS)
-fors_trace_flat_la_LDFLAGS = -module -avoid-version
+fors_trace_flat_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_trace_flat_la_LDFLAGS = -module -avoid-version 
 fors_trace_flat_la_DEPENDENCIES = $(LIBFORS)
 
 fors_normalise_flat_la_SOURCES = fors_normalise_flat.c
-fors_normalise_flat_la_LIBADD = $(LIBFORS)
-fors_normalise_flat_la_LDFLAGS = -module -avoid-version
+fors_normalise_flat_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_normalise_flat_la_LDFLAGS = -module -avoid-version 
 fors_normalise_flat_la_DEPENDENCIES = $(LIBFORS)
 
 fors_flatfield_la_SOURCES = fors_flatfield.c
-fors_flatfield_la_LIBADD = $(LIBFORS)
-fors_flatfield_la_LDFLAGS = -module -avoid-version
+fors_flatfield_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_flatfield_la_LDFLAGS = -module -avoid-version 
 fors_flatfield_la_DEPENDENCIES = $(LIBFORS)
 
 fors_extract_slits_la_SOURCES = fors_extract_slits.c
-fors_extract_slits_la_LIBADD = $(LIBFORS)
-fors_extract_slits_la_LDFLAGS = -module -avoid-version
+fors_extract_slits_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_extract_slits_la_LDFLAGS = -module -avoid-version 
 fors_extract_slits_la_DEPENDENCIES = $(LIBFORS)
 
 fors_wave_calib_la_SOURCES = fors_wave_calib.c
-fors_wave_calib_la_LIBADD = $(LIBFORS)
-fors_wave_calib_la_LDFLAGS = -module -avoid-version
+fors_wave_calib_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_wave_calib_la_LDFLAGS = -module -avoid-version 
 fors_wave_calib_la_DEPENDENCIES = $(LIBFORS)
 
 fors_wave_calib_lss_la_SOURCES = fors_wave_calib_lss.c
-fors_wave_calib_lss_la_LIBADD = $(LIBFORS)
-fors_wave_calib_lss_la_LDFLAGS = -module -avoid-version
+fors_wave_calib_lss_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_wave_calib_lss_la_LDFLAGS = -module -avoid-version 
 fors_wave_calib_lss_la_DEPENDENCIES = $(LIBFORS)
 
 fors_align_sky_la_SOURCES = fors_align_sky.c
-fors_align_sky_la_LIBADD = $(LIBFORS)
-fors_align_sky_la_LDFLAGS = -module -avoid-version
+fors_align_sky_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_align_sky_la_LDFLAGS = -module -avoid-version 
 fors_align_sky_la_DEPENDENCIES = $(LIBFORS)
 
 fors_align_sky_lss_la_SOURCES = fors_align_sky_lss.c
-fors_align_sky_lss_la_LIBADD = $(LIBFORS)
-fors_align_sky_lss_la_LDFLAGS = -module -avoid-version
+fors_align_sky_lss_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_align_sky_lss_la_LDFLAGS = -module -avoid-version 
 fors_align_sky_lss_la_DEPENDENCIES = $(LIBFORS)
 
 fors_subtract_sky_la_SOURCES = fors_subtract_sky.c
-fors_subtract_sky_la_LIBADD = $(LIBFORS)
-fors_subtract_sky_la_LDFLAGS = -module -avoid-version
+fors_subtract_sky_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_subtract_sky_la_LDFLAGS = -module -avoid-version 
 fors_subtract_sky_la_DEPENDENCIES = $(LIBFORS)
 
 fors_subtract_sky_lss_la_SOURCES = fors_subtract_sky_lss.c
-fors_subtract_sky_lss_la_LIBADD = $(LIBFORS)
-fors_subtract_sky_lss_la_LDFLAGS = -module -avoid-version
+fors_subtract_sky_lss_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_subtract_sky_lss_la_LDFLAGS = -module -avoid-version 
 fors_subtract_sky_lss_la_DEPENDENCIES = $(LIBFORS)
 
 fors_resample_la_SOURCES = fors_resample.c
-fors_resample_la_LIBADD = $(LIBFORS)
-fors_resample_la_LDFLAGS = -module -avoid-version
+fors_resample_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_resample_la_LDFLAGS = -module -avoid-version 
 fors_resample_la_DEPENDENCIES = $(LIBFORS)
 
 fors_detect_objects_la_SOURCES = fors_detect_objects.c
-fors_detect_objects_la_LIBADD = $(LIBFORS)
-fors_detect_objects_la_LDFLAGS = -module -avoid-version
+fors_detect_objects_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_detect_objects_la_LDFLAGS = -module -avoid-version 
 fors_detect_objects_la_DEPENDENCIES = $(LIBFORS)
 
 fors_extract_objects_la_SOURCES = fors_extract_objects.c
-fors_extract_objects_la_LIBADD = $(LIBFORS)
-fors_extract_objects_la_LDFLAGS = -module -avoid-version
+fors_extract_objects_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_extract_objects_la_LDFLAGS = -module -avoid-version 
 fors_extract_objects_la_DEPENDENCIES = $(LIBFORS)
 
 montecarlo_la_SOURCES = montecarlo.c
-montecarlo_la_LIBADD = $(LIBFORS)
-montecarlo_la_LDFLAGS = -module -avoid-version
+montecarlo_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+montecarlo_la_LDFLAGS = -module -avoid-version 
 montecarlo_la_DEPENDENCIES = $(LIBFORS)
 
 fors_dark_la_SOURCES = fors_dark.c
-fors_dark_la_LIBADD = $(LIBFORS)
-fors_dark_la_LDFLAGS = -module -avoid-version
+fors_dark_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_dark_la_LDFLAGS = -module -avoid-version 
 fors_dark_la_DEPENDENCIES = $(LIBFORS)
 
 fors_img_screen_flat_la_SOURCES = fors_img_screen_flat.c
-fors_img_screen_flat_la_LIBADD = $(LIBFORS)
-fors_img_screen_flat_la_LDFLAGS = -module -avoid-version
+fors_img_screen_flat_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_img_screen_flat_la_LDFLAGS = -module -avoid-version 
 fors_img_screen_flat_la_DEPENDENCIES = $(LIBFORS)
 
 fors_img_sky_flat_la_SOURCES = fors_img_sky_flat.c
-fors_img_sky_flat_la_LIBADD = $(LIBFORS)
-fors_img_sky_flat_la_LDFLAGS = -module -avoid-version
+fors_img_sky_flat_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_img_sky_flat_la_LDFLAGS = -module -avoid-version 
 fors_img_sky_flat_la_DEPENDENCIES = $(LIBFORS)
 
 fors_zeropoint_la_SOURCES = fors_zeropoint.c
-fors_zeropoint_la_LIBADD = $(LIBFORS)
-fors_zeropoint_la_LDFLAGS = -module -avoid-version
+fors_zeropoint_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_zeropoint_la_LDFLAGS = -module -avoid-version 
 fors_zeropoint_la_DEPENDENCIES = $(LIBFORS)
 
 fors_photometry_la_SOURCES = fors_photometry.c
-fors_photometry_la_LIBADD = $(LIBFORS)
-fors_photometry_la_LDFLAGS = -module -avoid-version
+fors_photometry_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_photometry_la_LDFLAGS = -module -avoid-version 
 fors_photometry_la_DEPENDENCIES = $(LIBFORS)
 
 fors_img_science_la_SOURCES = fors_img_science.c
-fors_img_science_la_LIBADD = $(LIBFORS)
-fors_img_science_la_LDFLAGS = -module -avoid-version
+fors_img_science_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_img_science_la_LDFLAGS = -module -avoid-version 
 fors_img_science_la_DEPENDENCIES = $(LIBFORS)
 
 fors_pmos_calib_la_SOURCES = fors_pmos_calib.c
-fors_pmos_calib_la_LIBADD = $(LIBFORS)
-fors_pmos_calib_la_LDFLAGS = -module -avoid-version
+fors_pmos_calib_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_pmos_calib_la_LDFLAGS = -module -avoid-version 
 fors_pmos_calib_la_DEPENDENCIES = $(LIBFORS)
 
 fors_pmos_science_la_SOURCES = fors_pmos_science.c
-fors_pmos_science_la_LIBADD = $(LIBFORS)
-fors_pmos_science_la_LDFLAGS = -module -avoid-version
+fors_pmos_science_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_pmos_science_la_LDFLAGS = -module -avoid-version 
 fors_pmos_science_la_DEPENDENCIES = $(LIBFORS)
 
 fors_pmos_extract_la_SOURCES = fors_pmos_extract.c
-fors_pmos_extract_la_LIBADD = $(LIBFORS)
-fors_pmos_extract_la_LDFLAGS = -module -avoid-version
+fors_pmos_extract_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_pmos_extract_la_LDFLAGS = -module -avoid-version 
 fors_pmos_extract_la_DEPENDENCIES = $(LIBFORS)
diff --git a/recipes/Makefile.in b/recipes/Makefile.in
index 51e8ee9..5977789 100644
--- a/recipes/Makefile.in
+++ b/recipes/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,15 +15,29 @@
 @SET_MAKE@
 
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,186 +54,323 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = recipes
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in
+	$(srcdir)/Makefile.in $(top_srcdir)/admin/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
-	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/purify.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(plugindir)"
-pluginLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(plugin_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 am_fors_align_sky_la_OBJECTS = fors_align_sky.lo
 fors_align_sky_la_OBJECTS = $(am_fors_align_sky_la_OBJECTS)
+fors_align_sky_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_align_sky_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_align_sky_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_align_sky_la_rpath = -rpath $(plugindir)
 am_fors_align_sky_lss_la_OBJECTS = fors_align_sky_lss.lo
 fors_align_sky_lss_la_OBJECTS = $(am_fors_align_sky_lss_la_OBJECTS)
+fors_align_sky_lss_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_align_sky_lss_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_align_sky_lss_la_rpath = -rpath \
 @ONLINE_MODE_FALSE@	$(plugindir)
 @ONLINE_MODE_TRUE at am_fors_align_sky_lss_la_rpath = -rpath $(plugindir)
 am_fors_bias_la_OBJECTS = fors_bias.lo
 fors_bias_la_OBJECTS = $(am_fors_bias_la_OBJECTS)
+fors_bias_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_bias_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_bias_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_bias_la_rpath = -rpath $(plugindir)
 am_fors_calib_la_OBJECTS = fors_calib.lo
 fors_calib_la_OBJECTS = $(am_fors_calib_la_OBJECTS)
+fors_calib_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(fors_calib_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_calib_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_calib_la_rpath = -rpath $(plugindir)
 am_fors_config_la_OBJECTS = fors_config.lo
 fors_config_la_OBJECTS = $(am_fors_config_la_OBJECTS)
+fors_config_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_config_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_config_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_config_la_rpath = -rpath $(plugindir)
 am_fors_dark_la_OBJECTS = fors_dark.lo
 fors_dark_la_OBJECTS = $(am_fors_dark_la_OBJECTS)
+fors_dark_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_dark_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_dark_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_dark_la_rpath = -rpath $(plugindir)
 am_fors_detect_objects_la_OBJECTS = fors_detect_objects.lo
 fors_detect_objects_la_OBJECTS = $(am_fors_detect_objects_la_OBJECTS)
+fors_detect_objects_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_detect_objects_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_detect_objects_la_rpath = -rpath \
 @ONLINE_MODE_FALSE@	$(plugindir)
 @ONLINE_MODE_TRUE at am_fors_detect_objects_la_rpath = -rpath \
 @ONLINE_MODE_TRUE@	$(plugindir)
 am_fors_detect_spectra_la_OBJECTS = fors_detect_spectra.lo
 fors_detect_spectra_la_OBJECTS = $(am_fors_detect_spectra_la_OBJECTS)
+fors_detect_spectra_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_detect_spectra_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_detect_spectra_la_rpath = -rpath \
 @ONLINE_MODE_FALSE@	$(plugindir)
 @ONLINE_MODE_TRUE at am_fors_detect_spectra_la_rpath = -rpath \
 @ONLINE_MODE_TRUE@	$(plugindir)
 am_fors_extract_la_OBJECTS = fors_extract.lo
 fors_extract_la_OBJECTS = $(am_fors_extract_la_OBJECTS)
+fors_extract_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_extract_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_extract_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_extract_la_rpath = -rpath $(plugindir)
 am_fors_extract_objects_la_OBJECTS = fors_extract_objects.lo
 fors_extract_objects_la_OBJECTS =  \
 	$(am_fors_extract_objects_la_OBJECTS)
+fors_extract_objects_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_extract_objects_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_extract_objects_la_rpath = -rpath \
 @ONLINE_MODE_FALSE@	$(plugindir)
 @ONLINE_MODE_TRUE at am_fors_extract_objects_la_rpath = -rpath \
 @ONLINE_MODE_TRUE@	$(plugindir)
 am_fors_extract_slits_la_OBJECTS = fors_extract_slits.lo
 fors_extract_slits_la_OBJECTS = $(am_fors_extract_slits_la_OBJECTS)
+fors_extract_slits_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_extract_slits_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_extract_slits_la_rpath = -rpath \
 @ONLINE_MODE_FALSE@	$(plugindir)
 @ONLINE_MODE_TRUE at am_fors_extract_slits_la_rpath = -rpath $(plugindir)
 am_fors_flat_la_OBJECTS = fors_flat.lo
 fors_flat_la_OBJECTS = $(am_fors_flat_la_OBJECTS)
+fors_flat_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(fors_flat_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_flat_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_flat_la_rpath = -rpath $(plugindir)
 am_fors_flatfield_la_OBJECTS = fors_flatfield.lo
 fors_flatfield_la_OBJECTS = $(am_fors_flatfield_la_OBJECTS)
+fors_flatfield_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_flatfield_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_flatfield_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_flatfield_la_rpath = -rpath $(plugindir)
 am_fors_img_science_la_OBJECTS = fors_img_science.lo
 fors_img_science_la_OBJECTS = $(am_fors_img_science_la_OBJECTS)
+fors_img_science_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_img_science_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_img_science_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_img_science_la_rpath = -rpath $(plugindir)
 am_fors_img_screen_flat_la_OBJECTS = fors_img_screen_flat.lo
 fors_img_screen_flat_la_OBJECTS =  \
 	$(am_fors_img_screen_flat_la_OBJECTS)
+fors_img_screen_flat_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_img_screen_flat_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_img_screen_flat_la_rpath = -rpath \
 @ONLINE_MODE_FALSE@	$(plugindir)
 @ONLINE_MODE_TRUE at am_fors_img_screen_flat_la_rpath = -rpath \
 @ONLINE_MODE_TRUE@	$(plugindir)
 am_fors_img_sky_flat_la_OBJECTS = fors_img_sky_flat.lo
 fors_img_sky_flat_la_OBJECTS = $(am_fors_img_sky_flat_la_OBJECTS)
+fors_img_sky_flat_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_img_sky_flat_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_img_sky_flat_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_img_sky_flat_la_rpath = -rpath $(plugindir)
 am_fors_normalise_flat_la_OBJECTS = fors_normalise_flat.lo
 fors_normalise_flat_la_OBJECTS = $(am_fors_normalise_flat_la_OBJECTS)
+fors_normalise_flat_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_normalise_flat_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_normalise_flat_la_rpath = -rpath \
 @ONLINE_MODE_FALSE@	$(plugindir)
 @ONLINE_MODE_TRUE at am_fors_normalise_flat_la_rpath = -rpath \
 @ONLINE_MODE_TRUE@	$(plugindir)
 am_fors_photometry_la_OBJECTS = fors_photometry.lo
 fors_photometry_la_OBJECTS = $(am_fors_photometry_la_OBJECTS)
+fors_photometry_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_photometry_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_photometry_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_photometry_la_rpath = -rpath $(plugindir)
 am_fors_pmos_calib_la_OBJECTS = fors_pmos_calib.lo
 fors_pmos_calib_la_OBJECTS = $(am_fors_pmos_calib_la_OBJECTS)
+fors_pmos_calib_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_pmos_calib_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_pmos_calib_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_pmos_calib_la_rpath = -rpath $(plugindir)
 am_fors_pmos_extract_la_OBJECTS = fors_pmos_extract.lo
 fors_pmos_extract_la_OBJECTS = $(am_fors_pmos_extract_la_OBJECTS)
+fors_pmos_extract_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_pmos_extract_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_pmos_extract_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_pmos_extract_la_rpath = -rpath $(plugindir)
 am_fors_pmos_science_la_OBJECTS = fors_pmos_science.lo
 fors_pmos_science_la_OBJECTS = $(am_fors_pmos_science_la_OBJECTS)
+fors_pmos_science_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_pmos_science_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_pmos_science_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_pmos_science_la_rpath = -rpath $(plugindir)
 am_fors_remove_bias_la_OBJECTS = fors_remove_bias.lo
 fors_remove_bias_la_OBJECTS = $(am_fors_remove_bias_la_OBJECTS)
+fors_remove_bias_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_remove_bias_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_remove_bias_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_remove_bias_la_rpath = -rpath $(plugindir)
 am_fors_resample_la_OBJECTS = fors_resample.lo
 fors_resample_la_OBJECTS = $(am_fors_resample_la_OBJECTS)
+fors_resample_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_resample_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_resample_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_resample_la_rpath = -rpath $(plugindir)
 am_fors_science_la_OBJECTS = fors_science.lo
 fors_science_la_OBJECTS = $(am_fors_science_la_OBJECTS)
+fors_science_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_science_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_science_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_science_la_rpath = -rpath $(plugindir)
 am_fors_subtract_sky_la_OBJECTS = fors_subtract_sky.lo
 fors_subtract_sky_la_OBJECTS = $(am_fors_subtract_sky_la_OBJECTS)
+fors_subtract_sky_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_subtract_sky_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_subtract_sky_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_subtract_sky_la_rpath = -rpath $(plugindir)
 am_fors_subtract_sky_lss_la_OBJECTS = fors_subtract_sky_lss.lo
 fors_subtract_sky_lss_la_OBJECTS =  \
 	$(am_fors_subtract_sky_lss_la_OBJECTS)
+fors_subtract_sky_lss_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_subtract_sky_lss_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_subtract_sky_lss_la_rpath = -rpath \
 @ONLINE_MODE_FALSE@	$(plugindir)
 @ONLINE_MODE_TRUE at am_fors_subtract_sky_lss_la_rpath = -rpath \
 @ONLINE_MODE_TRUE@	$(plugindir)
 am_fors_sumflux_la_OBJECTS = fors_sumflux.lo
 fors_sumflux_la_OBJECTS = $(am_fors_sumflux_la_OBJECTS)
+fors_sumflux_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_sumflux_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_sumflux_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_sumflux_la_rpath = -rpath $(plugindir)
 am_fors_trace_flat_la_OBJECTS = fors_trace_flat.lo
 fors_trace_flat_la_OBJECTS = $(am_fors_trace_flat_la_OBJECTS)
+fors_trace_flat_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_trace_flat_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_trace_flat_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_trace_flat_la_rpath = -rpath $(plugindir)
 am_fors_wave_calib_la_OBJECTS = fors_wave_calib.lo
 fors_wave_calib_la_OBJECTS = $(am_fors_wave_calib_la_OBJECTS)
+fors_wave_calib_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_wave_calib_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_wave_calib_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_wave_calib_la_rpath = -rpath $(plugindir)
 am_fors_wave_calib_lss_la_OBJECTS = fors_wave_calib_lss.lo
 fors_wave_calib_lss_la_OBJECTS = $(am_fors_wave_calib_lss_la_OBJECTS)
+fors_wave_calib_lss_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_wave_calib_lss_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_wave_calib_lss_la_rpath = -rpath \
 @ONLINE_MODE_FALSE@	$(plugindir)
 @ONLINE_MODE_TRUE at am_fors_wave_calib_lss_la_rpath = -rpath \
 @ONLINE_MODE_TRUE@	$(plugindir)
 am_fors_zeropoint_la_OBJECTS = fors_zeropoint.lo
 fors_zeropoint_la_OBJECTS = $(am_fors_zeropoint_la_OBJECTS)
+fors_zeropoint_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(fors_zeropoint_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_FALSE at am_fors_zeropoint_la_rpath = -rpath $(plugindir)
 @ONLINE_MODE_TRUE at am_fors_zeropoint_la_rpath = -rpath $(plugindir)
 am_montecarlo_la_OBJECTS = montecarlo.lo
 montecarlo_la_OBJECTS = $(am_montecarlo_la_OBJECTS)
+montecarlo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(montecarlo_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_TRUE at am_montecarlo_la_rpath = -rpath $(plugindir)
 am_test_hough_la_OBJECTS = test_hough.lo
 test_hough_la_OBJECTS = $(am_test_hough_la_OBJECTS)
+test_hough_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(test_hough_la_LDFLAGS) $(LDFLAGS) -o $@
 @ONLINE_MODE_TRUE at am_test_hough_la_rpath = -rpath $(plugindir)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 SOURCES = $(fors_align_sky_la_SOURCES) \
 	$(fors_align_sky_lss_la_SOURCES) $(fors_bias_la_SOURCES) \
 	$(fors_calib_la_SOURCES) $(fors_config_la_SOURCES) \
@@ -262,18 +413,52 @@ DIST_SOURCES = $(fors_align_sky_la_SOURCES) \
 	$(montecarlo_la_SOURCES) $(test_hough_la_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
-	install-exec-recursive install-info-recursive \
-	install-recursive installcheck-recursive installdirs-recursive \
-	pdf-recursive ps-recursive uninstall-info-recursive \
-	uninstall-recursive
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 HEADERS = $(noinst_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
@@ -298,16 +483,17 @@ CX_LDFLAGS = @CX_LDFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOXYGEN = @DOXYGEN@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 FORS_BINARY_AGE = @FORS_BINARY_AGE@
 FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
 FORS_INCLUDES = @FORS_INCLUDES@
@@ -317,12 +503,17 @@ FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
 FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
 FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
 FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
 LATEX = @LATEX@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBCEXT = @LIBCEXT@
 LIBCFITSIO = @LIBCFITSIO@
@@ -338,48 +529,52 @@ LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 LT_AGE = @LT_AGE@
 LT_CURRENT = @LT_CURRENT@
 LT_REVISION = @LT_REVISION@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
 MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
-ONLINE_MODE_FALSE = @ONLINE_MODE_FALSE@
-ONLINE_MODE_TRUE = @ONLINE_MODE_TRUE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PURIFY_CMD = @PURIFY_CMD@
-PURIFY_FALSE = @PURIFY_FALSE@
-PURIFY_TRUE = @PURIFY_TRUE@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 all_includes = @all_includes@
 all_ldflags = @all_ldflags@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -391,8 +586,12 @@ build_alias = @build_alias@
 build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
+builddir = @builddir@
 configdir = @configdir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -405,17 +604,21 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 pipedocsdir = @pipedocsdir@
 plugindir = @plugindir@
 prefix = @prefix@
 privatelibdir = @privatelibdir@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target = @target@
@@ -423,6 +626,9 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 wkfcopydir = @wkfcopydir@
 wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.8 foreign
@@ -430,6 +636,11 @@ DISTCLEANFILES = *~
 SUBDIRS = . tests
 @MAINTAINER_MODE_TRUE at MAINTAINERCLEANFILES = Makefile.in
 AM_CPPFLAGS = $(all_includes)
+
+#-Wl,-z,defs issues an error if they are undefined symbols
+#However the OS X linker doesn't understand this. It seems 
+#there is no portable way to get this
+#AM_LDFLAGS =  -Wl,-z,defs
 noinst_HEADERS = 
 @ONLINE_MODE_FALSE at plugin_LTLIBRARIES = fors_calib.la fors_science.la fors_config.la \
 @ONLINE_MODE_FALSE@                     fors_sumflux.la fors_extract.la \
@@ -463,154 +674,155 @@ noinst_HEADERS =
 @ONLINE_MODE_TRUE@                     fors_pmos_calib.la fors_pmos_science.la \
 @ONLINE_MODE_TRUE@                     fors_pmos_extract.la
 
-fors_calib_la_SOURCES = fors_calib.c
-fors_calib_la_LIBADD = $(LIBFORS)
-fors_calib_la_LDFLAGS = -module -avoid-version
+#The -static is needed because in VLT machines, with LD_LIBRARY_PATH=/usrlib:/vlt..., the /usr/lib/libstdc++.so is chosen at runtime, which is the wrong version (it was compiled with /vlt/VLT2010/....). This will compile everything static for this library. Once DFS machines are VLT-free this can be removed.
+fors_calib_la_SOURCES = fors_calib.cc
+fors_calib_la_LIBADD = $(LIBMOSCA) $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_calib_la_LDFLAGS = -module -avoid-version 
 fors_calib_la_DEPENDENCIES = $(LIBFORS)
 fors_science_la_SOURCES = fors_science.c
-fors_science_la_LIBADD = $(LIBFORS)
-fors_science_la_LDFLAGS = -module -avoid-version
+fors_science_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_science_la_LDFLAGS = -module -avoid-version 
 fors_science_la_DEPENDENCIES = $(LIBFORS)
 fors_config_la_SOURCES = fors_config.c
-fors_config_la_LIBADD = $(LIBFORS)
-fors_config_la_LDFLAGS = -module -avoid-version
+fors_config_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_config_la_LDFLAGS = -module -avoid-version 
 fors_config_la_DEPENDENCIES = $(LIBFORS)
 fors_sumflux_la_SOURCES = fors_sumflux.c
-fors_sumflux_la_LIBADD = $(LIBFORS)
-fors_sumflux_la_LDFLAGS = -module -avoid-version
+fors_sumflux_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_sumflux_la_LDFLAGS = -module -avoid-version 
 fors_sumflux_la_DEPENDENCIES = $(LIBFORS)
 fors_extract_la_SOURCES = fors_extract.c
-fors_extract_la_LIBADD = $(LIBFORS)
-fors_extract_la_LDFLAGS = -module -avoid-version
+fors_extract_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_extract_la_LDFLAGS = -module -avoid-version 
 fors_extract_la_DEPENDENCIES = $(LIBFORS)
 test_hough_la_SOURCES = test_hough.c
-test_hough_la_LIBADD = $(LIBFORS)
-test_hough_la_LDFLAGS = -module -avoid-version
+test_hough_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+test_hough_la_LDFLAGS = -module -avoid-version 
 test_hough_la_DEPENDENCIES = $(LIBFORS)
 fors_bias_la_SOURCES = fors_bias.c
-fors_bias_la_LIBADD = $(LIBFORS)
-fors_bias_la_LDFLAGS = -module -avoid-version
+fors_bias_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_bias_la_LDFLAGS = -module -avoid-version 
 fors_bias_la_DEPENDENCIES = $(LIBFORS)
 fors_remove_bias_la_SOURCES = fors_remove_bias.c
-fors_remove_bias_la_LIBADD = $(LIBFORS)
-fors_remove_bias_la_LDFLAGS = -module -avoid-version
+fors_remove_bias_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_remove_bias_la_LDFLAGS = -module -avoid-version 
 fors_remove_bias_la_DEPENDENCIES = $(LIBFORS)
-fors_flat_la_SOURCES = fors_flat.c
-fors_flat_la_LIBADD = $(LIBFORS)
-fors_flat_la_LDFLAGS = -module -avoid-version
+fors_flat_la_SOURCES = fors_flat.cc
+fors_flat_la_LIBADD = $(LIBMOSCA) $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_flat_la_LDFLAGS = -module -avoid-version 
 fors_flat_la_DEPENDENCIES = $(LIBFORS)
 fors_detect_spectra_la_SOURCES = fors_detect_spectra.c
-fors_detect_spectra_la_LIBADD = $(LIBFORS)
-fors_detect_spectra_la_LDFLAGS = -module -avoid-version
+fors_detect_spectra_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_detect_spectra_la_LDFLAGS = -module -avoid-version 
 fors_detect_spectra_la_DEPENDENCIES = $(LIBFORS)
 fors_trace_flat_la_SOURCES = fors_trace_flat.c
-fors_trace_flat_la_LIBADD = $(LIBFORS)
-fors_trace_flat_la_LDFLAGS = -module -avoid-version
+fors_trace_flat_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_trace_flat_la_LDFLAGS = -module -avoid-version 
 fors_trace_flat_la_DEPENDENCIES = $(LIBFORS)
 fors_normalise_flat_la_SOURCES = fors_normalise_flat.c
-fors_normalise_flat_la_LIBADD = $(LIBFORS)
-fors_normalise_flat_la_LDFLAGS = -module -avoid-version
+fors_normalise_flat_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_normalise_flat_la_LDFLAGS = -module -avoid-version 
 fors_normalise_flat_la_DEPENDENCIES = $(LIBFORS)
 fors_flatfield_la_SOURCES = fors_flatfield.c
-fors_flatfield_la_LIBADD = $(LIBFORS)
-fors_flatfield_la_LDFLAGS = -module -avoid-version
+fors_flatfield_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_flatfield_la_LDFLAGS = -module -avoid-version 
 fors_flatfield_la_DEPENDENCIES = $(LIBFORS)
 fors_extract_slits_la_SOURCES = fors_extract_slits.c
-fors_extract_slits_la_LIBADD = $(LIBFORS)
-fors_extract_slits_la_LDFLAGS = -module -avoid-version
+fors_extract_slits_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_extract_slits_la_LDFLAGS = -module -avoid-version 
 fors_extract_slits_la_DEPENDENCIES = $(LIBFORS)
 fors_wave_calib_la_SOURCES = fors_wave_calib.c
-fors_wave_calib_la_LIBADD = $(LIBFORS)
-fors_wave_calib_la_LDFLAGS = -module -avoid-version
+fors_wave_calib_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_wave_calib_la_LDFLAGS = -module -avoid-version 
 fors_wave_calib_la_DEPENDENCIES = $(LIBFORS)
 fors_wave_calib_lss_la_SOURCES = fors_wave_calib_lss.c
-fors_wave_calib_lss_la_LIBADD = $(LIBFORS)
-fors_wave_calib_lss_la_LDFLAGS = -module -avoid-version
+fors_wave_calib_lss_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_wave_calib_lss_la_LDFLAGS = -module -avoid-version 
 fors_wave_calib_lss_la_DEPENDENCIES = $(LIBFORS)
 fors_align_sky_la_SOURCES = fors_align_sky.c
-fors_align_sky_la_LIBADD = $(LIBFORS)
-fors_align_sky_la_LDFLAGS = -module -avoid-version
+fors_align_sky_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_align_sky_la_LDFLAGS = -module -avoid-version 
 fors_align_sky_la_DEPENDENCIES = $(LIBFORS)
 fors_align_sky_lss_la_SOURCES = fors_align_sky_lss.c
-fors_align_sky_lss_la_LIBADD = $(LIBFORS)
-fors_align_sky_lss_la_LDFLAGS = -module -avoid-version
+fors_align_sky_lss_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_align_sky_lss_la_LDFLAGS = -module -avoid-version 
 fors_align_sky_lss_la_DEPENDENCIES = $(LIBFORS)
 fors_subtract_sky_la_SOURCES = fors_subtract_sky.c
-fors_subtract_sky_la_LIBADD = $(LIBFORS)
-fors_subtract_sky_la_LDFLAGS = -module -avoid-version
+fors_subtract_sky_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_subtract_sky_la_LDFLAGS = -module -avoid-version 
 fors_subtract_sky_la_DEPENDENCIES = $(LIBFORS)
 fors_subtract_sky_lss_la_SOURCES = fors_subtract_sky_lss.c
-fors_subtract_sky_lss_la_LIBADD = $(LIBFORS)
-fors_subtract_sky_lss_la_LDFLAGS = -module -avoid-version
+fors_subtract_sky_lss_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_subtract_sky_lss_la_LDFLAGS = -module -avoid-version 
 fors_subtract_sky_lss_la_DEPENDENCIES = $(LIBFORS)
 fors_resample_la_SOURCES = fors_resample.c
-fors_resample_la_LIBADD = $(LIBFORS)
-fors_resample_la_LDFLAGS = -module -avoid-version
+fors_resample_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_resample_la_LDFLAGS = -module -avoid-version 
 fors_resample_la_DEPENDENCIES = $(LIBFORS)
 fors_detect_objects_la_SOURCES = fors_detect_objects.c
-fors_detect_objects_la_LIBADD = $(LIBFORS)
-fors_detect_objects_la_LDFLAGS = -module -avoid-version
+fors_detect_objects_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_detect_objects_la_LDFLAGS = -module -avoid-version 
 fors_detect_objects_la_DEPENDENCIES = $(LIBFORS)
 fors_extract_objects_la_SOURCES = fors_extract_objects.c
-fors_extract_objects_la_LIBADD = $(LIBFORS)
-fors_extract_objects_la_LDFLAGS = -module -avoid-version
+fors_extract_objects_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_extract_objects_la_LDFLAGS = -module -avoid-version 
 fors_extract_objects_la_DEPENDENCIES = $(LIBFORS)
 montecarlo_la_SOURCES = montecarlo.c
-montecarlo_la_LIBADD = $(LIBFORS)
-montecarlo_la_LDFLAGS = -module -avoid-version
+montecarlo_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+montecarlo_la_LDFLAGS = -module -avoid-version 
 montecarlo_la_DEPENDENCIES = $(LIBFORS)
 fors_dark_la_SOURCES = fors_dark.c
-fors_dark_la_LIBADD = $(LIBFORS)
-fors_dark_la_LDFLAGS = -module -avoid-version
+fors_dark_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_dark_la_LDFLAGS = -module -avoid-version 
 fors_dark_la_DEPENDENCIES = $(LIBFORS)
 fors_img_screen_flat_la_SOURCES = fors_img_screen_flat.c
-fors_img_screen_flat_la_LIBADD = $(LIBFORS)
-fors_img_screen_flat_la_LDFLAGS = -module -avoid-version
+fors_img_screen_flat_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_img_screen_flat_la_LDFLAGS = -module -avoid-version 
 fors_img_screen_flat_la_DEPENDENCIES = $(LIBFORS)
 fors_img_sky_flat_la_SOURCES = fors_img_sky_flat.c
-fors_img_sky_flat_la_LIBADD = $(LIBFORS)
-fors_img_sky_flat_la_LDFLAGS = -module -avoid-version
+fors_img_sky_flat_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_img_sky_flat_la_LDFLAGS = -module -avoid-version 
 fors_img_sky_flat_la_DEPENDENCIES = $(LIBFORS)
 fors_zeropoint_la_SOURCES = fors_zeropoint.c
-fors_zeropoint_la_LIBADD = $(LIBFORS)
-fors_zeropoint_la_LDFLAGS = -module -avoid-version
+fors_zeropoint_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_zeropoint_la_LDFLAGS = -module -avoid-version 
 fors_zeropoint_la_DEPENDENCIES = $(LIBFORS)
 fors_photometry_la_SOURCES = fors_photometry.c
-fors_photometry_la_LIBADD = $(LIBFORS)
-fors_photometry_la_LDFLAGS = -module -avoid-version
+fors_photometry_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_photometry_la_LDFLAGS = -module -avoid-version 
 fors_photometry_la_DEPENDENCIES = $(LIBFORS)
 fors_img_science_la_SOURCES = fors_img_science.c
-fors_img_science_la_LIBADD = $(LIBFORS)
-fors_img_science_la_LDFLAGS = -module -avoid-version
+fors_img_science_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_img_science_la_LDFLAGS = -module -avoid-version 
 fors_img_science_la_DEPENDENCIES = $(LIBFORS)
 fors_pmos_calib_la_SOURCES = fors_pmos_calib.c
-fors_pmos_calib_la_LIBADD = $(LIBFORS)
-fors_pmos_calib_la_LDFLAGS = -module -avoid-version
+fors_pmos_calib_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_pmos_calib_la_LDFLAGS = -module -avoid-version 
 fors_pmos_calib_la_DEPENDENCIES = $(LIBFORS)
 fors_pmos_science_la_SOURCES = fors_pmos_science.c
-fors_pmos_science_la_LIBADD = $(LIBFORS)
-fors_pmos_science_la_LDFLAGS = -module -avoid-version
+fors_pmos_science_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_pmos_science_la_LDFLAGS = -module -avoid-version 
 fors_pmos_science_la_DEPENDENCIES = $(LIBFORS)
 fors_pmos_extract_la_SOURCES = fors_pmos_extract.c
-fors_pmos_extract_la_LIBADD = $(LIBFORS)
-fors_pmos_extract_la_LDFLAGS = -module -avoid-version
+fors_pmos_extract_la_LIBADD = $(LIBFORS) $(LIBCPLCORE) $(LIBCPLDFS) $(LIBCPLDRS) $(LIBCPLUI)
+fors_pmos_extract_la_LDFLAGS = -module -avoid-version 
 fors_pmos_extract_la_DEPENDENCIES = $(LIBFORS)
 all: all-recursive
 
 .SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
+.SUFFIXES: .c .cc .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  recipes/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  recipes/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign recipes/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign recipes/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -628,99 +840,107 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(plugindir)" || $(mkdir_p) "$(DESTDIR)$(plugindir)"
-	@list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
+	@list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
+	list2=; for p in $$list; do \
 	  if test -f $$p; then \
-	    f=$(am__strip_dir) \
-	    echo " $(LIBTOOL) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(plugindir)/$$f'"; \
-	    $(LIBTOOL) --mode=install $(pluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(plugindir)/$$f"; \
+	    list2="$$list2 $$p"; \
 	  else :; fi; \
-	done
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \
+	}
 
 uninstall-pluginLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@set -x; list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
-	  p=$(am__strip_dir) \
-	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$p'"; \
-	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$p"; \
+	@list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \
 	done
 
 clean-pluginLTLIBRARIES:
 	-test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES)
-	@list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-fors_align_sky.la: $(fors_align_sky_la_OBJECTS) $(fors_align_sky_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_align_sky_la_rpath) $(fors_align_sky_la_LDFLAGS) $(fors_align_sky_la_OBJECTS) $(fors_align_sky_la_LIBADD) $(LIBS)
-fors_align_sky_lss.la: $(fors_align_sky_lss_la_OBJECTS) $(fors_align_sky_lss_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_align_sky_lss_la_rpath) $(fors_align_sky_lss_la_LDFLAGS) $(fors_align_sky_lss_la_OBJECTS) $(fors_align_sky_lss_la_LIBADD) $(LIBS)
-fors_bias.la: $(fors_bias_la_OBJECTS) $(fors_bias_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_bias_la_rpath) $(fors_bias_la_LDFLAGS) $(fors_bias_la_OBJECTS) $(fors_bias_la_LIBADD) $(LIBS)
-fors_calib.la: $(fors_calib_la_OBJECTS) $(fors_calib_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_calib_la_rpath) $(fors_calib_la_LDFLAGS) $(fors_calib_la_OBJECTS) $(fors_calib_la_LIBADD) $(LIBS)
-fors_config.la: $(fors_config_la_OBJECTS) $(fors_config_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_config_la_rpath) $(fors_config_la_LDFLAGS) $(fors_config_la_OBJECTS) $(fors_config_la_LIBADD) $(LIBS)
-fors_dark.la: $(fors_dark_la_OBJECTS) $(fors_dark_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_dark_la_rpath) $(fors_dark_la_LDFLAGS) $(fors_dark_la_OBJECTS) $(fors_dark_la_LIBADD) $(LIBS)
-fors_detect_objects.la: $(fors_detect_objects_la_OBJECTS) $(fors_detect_objects_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_detect_objects_la_rpath) $(fors_detect_objects_la_LDFLAGS) $(fors_detect_objects_la_OBJECTS) $(fors_detect_objects_la_LIBADD) $(LIBS)
-fors_detect_spectra.la: $(fors_detect_spectra_la_OBJECTS) $(fors_detect_spectra_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_detect_spectra_la_rpath) $(fors_detect_spectra_la_LDFLAGS) $(fors_detect_spectra_la_OBJECTS) $(fors_detect_spectra_la_LIBADD) $(LIBS)
-fors_extract.la: $(fors_extract_la_OBJECTS) $(fors_extract_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_extract_la_rpath) $(fors_extract_la_LDFLAGS) $(fors_extract_la_OBJECTS) $(fors_extract_la_LIBADD) $(LIBS)
-fors_extract_objects.la: $(fors_extract_objects_la_OBJECTS) $(fors_extract_objects_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_extract_objects_la_rpath) $(fors_extract_objects_la_LDFLAGS) $(fors_extract_objects_la_OBJECTS) $(fors_extract_objects_la_LIBADD) $(LIBS)
-fors_extract_slits.la: $(fors_extract_slits_la_OBJECTS) $(fors_extract_slits_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_extract_slits_la_rpath) $(fors_extract_slits_la_LDFLAGS) $(fors_extract_slits_la_OBJECTS) $(fors_extract_slits_la_LIBADD) $(LIBS)
-fors_flat.la: $(fors_flat_la_OBJECTS) $(fors_flat_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_flat_la_rpath) $(fors_flat_la_LDFLAGS) $(fors_flat_la_OBJECTS) $(fors_flat_la_LIBADD) $(LIBS)
-fors_flatfield.la: $(fors_flatfield_la_OBJECTS) $(fors_flatfield_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_flatfield_la_rpath) $(fors_flatfield_la_LDFLAGS) $(fors_flatfield_la_OBJECTS) $(fors_flatfield_la_LIBADD) $(LIBS)
-fors_img_science.la: $(fors_img_science_la_OBJECTS) $(fors_img_science_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_img_science_la_rpath) $(fors_img_science_la_LDFLAGS) $(fors_img_science_la_OBJECTS) $(fors_img_science_la_LIBADD) $(LIBS)
-fors_img_screen_flat.la: $(fors_img_screen_flat_la_OBJECTS) $(fors_img_screen_flat_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_img_screen_flat_la_rpath) $(fors_img_screen_flat_la_LDFLAGS) $(fors_img_screen_flat_la_OBJECTS) $(fors_img_screen_flat_la_LIBADD) $(LIBS)
-fors_img_sky_flat.la: $(fors_img_sky_flat_la_OBJECTS) $(fors_img_sky_flat_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_img_sky_flat_la_rpath) $(fors_img_sky_flat_la_LDFLAGS) $(fors_img_sky_flat_la_OBJECTS) $(fors_img_sky_flat_la_LIBADD) $(LIBS)
-fors_normalise_flat.la: $(fors_normalise_flat_la_OBJECTS) $(fors_normalise_flat_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_normalise_flat_la_rpath) $(fors_normalise_flat_la_LDFLAGS) $(fors_normalise_flat_la_OBJECTS) $(fors_normalise_flat_la_LIBADD) $(LIBS)
-fors_photometry.la: $(fors_photometry_la_OBJECTS) $(fors_photometry_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_photometry_la_rpath) $(fors_photometry_la_LDFLAGS) $(fors_photometry_la_OBJECTS) $(fors_photometry_la_LIBADD) $(LIBS)
-fors_pmos_calib.la: $(fors_pmos_calib_la_OBJECTS) $(fors_pmos_calib_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_pmos_calib_la_rpath) $(fors_pmos_calib_la_LDFLAGS) $(fors_pmos_calib_la_OBJECTS) $(fors_pmos_calib_la_LIBADD) $(LIBS)
-fors_pmos_extract.la: $(fors_pmos_extract_la_OBJECTS) $(fors_pmos_extract_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_pmos_extract_la_rpath) $(fors_pmos_extract_la_LDFLAGS) $(fors_pmos_extract_la_OBJECTS) $(fors_pmos_extract_la_LIBADD) $(LIBS)
-fors_pmos_science.la: $(fors_pmos_science_la_OBJECTS) $(fors_pmos_science_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_pmos_science_la_rpath) $(fors_pmos_science_la_LDFLAGS) $(fors_pmos_science_la_OBJECTS) $(fors_pmos_science_la_LIBADD) $(LIBS)
-fors_remove_bias.la: $(fors_remove_bias_la_OBJECTS) $(fors_remove_bias_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_remove_bias_la_rpath) $(fors_remove_bias_la_LDFLAGS) $(fors_remove_bias_la_OBJECTS) $(fors_remove_bias_la_LIBADD) $(LIBS)
-fors_resample.la: $(fors_resample_la_OBJECTS) $(fors_resample_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_resample_la_rpath) $(fors_resample_la_LDFLAGS) $(fors_resample_la_OBJECTS) $(fors_resample_la_LIBADD) $(LIBS)
-fors_science.la: $(fors_science_la_OBJECTS) $(fors_science_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_science_la_rpath) $(fors_science_la_LDFLAGS) $(fors_science_la_OBJECTS) $(fors_science_la_LIBADD) $(LIBS)
-fors_subtract_sky.la: $(fors_subtract_sky_la_OBJECTS) $(fors_subtract_sky_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_subtract_sky_la_rpath) $(fors_subtract_sky_la_LDFLAGS) $(fors_subtract_sky_la_OBJECTS) $(fors_subtract_sky_la_LIBADD) $(LIBS)
-fors_subtract_sky_lss.la: $(fors_subtract_sky_lss_la_OBJECTS) $(fors_subtract_sky_lss_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_subtract_sky_lss_la_rpath) $(fors_subtract_sky_lss_la_LDFLAGS) $(fors_subtract_sky_lss_la_OBJECTS) $(fors_subtract_sky_lss_la_LIBADD) $(LIBS)
-fors_sumflux.la: $(fors_sumflux_la_OBJECTS) $(fors_sumflux_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_sumflux_la_rpath) $(fors_sumflux_la_LDFLAGS) $(fors_sumflux_la_OBJECTS) $(fors_sumflux_la_LIBADD) $(LIBS)
-fors_trace_flat.la: $(fors_trace_flat_la_OBJECTS) $(fors_trace_flat_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_trace_flat_la_rpath) $(fors_trace_flat_la_LDFLAGS) $(fors_trace_flat_la_OBJECTS) $(fors_trace_flat_la_LIBADD) $(LIBS)
-fors_wave_calib.la: $(fors_wave_calib_la_OBJECTS) $(fors_wave_calib_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_wave_calib_la_rpath) $(fors_wave_calib_la_LDFLAGS) $(fors_wave_calib_la_OBJECTS) $(fors_wave_calib_la_LIBADD) $(LIBS)
-fors_wave_calib_lss.la: $(fors_wave_calib_lss_la_OBJECTS) $(fors_wave_calib_lss_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_wave_calib_lss_la_rpath) $(fors_wave_calib_lss_la_LDFLAGS) $(fors_wave_calib_lss_la_OBJECTS) $(fors_wave_calib_lss_la_LIBADD) $(LIBS)
-fors_zeropoint.la: $(fors_zeropoint_la_OBJECTS) $(fors_zeropoint_la_DEPENDENCIES) 
-	$(LINK) $(am_fors_zeropoint_la_rpath) $(fors_zeropoint_la_LDFLAGS) $(fors_zeropoint_la_OBJECTS) $(fors_zeropoint_la_LIBADD) $(LIBS)
-montecarlo.la: $(montecarlo_la_OBJECTS) $(montecarlo_la_DEPENDENCIES) 
-	$(LINK) $(am_montecarlo_la_rpath) $(montecarlo_la_LDFLAGS) $(montecarlo_la_OBJECTS) $(montecarlo_la_LIBADD) $(LIBS)
-test_hough.la: $(test_hough_la_OBJECTS) $(test_hough_la_DEPENDENCIES) 
-	$(LINK) $(am_test_hough_la_rpath) $(test_hough_la_LDFLAGS) $(test_hough_la_OBJECTS) $(test_hough_la_LIBADD) $(LIBS)
+	@list='$(plugin_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+fors_align_sky.la: $(fors_align_sky_la_OBJECTS) $(fors_align_sky_la_DEPENDENCIES) $(EXTRA_fors_align_sky_la_DEPENDENCIES) 
+	$(fors_align_sky_la_LINK) $(am_fors_align_sky_la_rpath) $(fors_align_sky_la_OBJECTS) $(fors_align_sky_la_LIBADD) $(LIBS)
+fors_align_sky_lss.la: $(fors_align_sky_lss_la_OBJECTS) $(fors_align_sky_lss_la_DEPENDENCIES) $(EXTRA_fors_align_sky_lss_la_DEPENDENCIES) 
+	$(fors_align_sky_lss_la_LINK) $(am_fors_align_sky_lss_la_rpath) $(fors_align_sky_lss_la_OBJECTS) $(fors_align_sky_lss_la_LIBADD) $(LIBS)
+fors_bias.la: $(fors_bias_la_OBJECTS) $(fors_bias_la_DEPENDENCIES) $(EXTRA_fors_bias_la_DEPENDENCIES) 
+	$(fors_bias_la_LINK) $(am_fors_bias_la_rpath) $(fors_bias_la_OBJECTS) $(fors_bias_la_LIBADD) $(LIBS)
+fors_calib.la: $(fors_calib_la_OBJECTS) $(fors_calib_la_DEPENDENCIES) $(EXTRA_fors_calib_la_DEPENDENCIES) 
+	$(fors_calib_la_LINK) $(am_fors_calib_la_rpath) $(fors_calib_la_OBJECTS) $(fors_calib_la_LIBADD) $(LIBS)
+fors_config.la: $(fors_config_la_OBJECTS) $(fors_config_la_DEPENDENCIES) $(EXTRA_fors_config_la_DEPENDENCIES) 
+	$(fors_config_la_LINK) $(am_fors_config_la_rpath) $(fors_config_la_OBJECTS) $(fors_config_la_LIBADD) $(LIBS)
+fors_dark.la: $(fors_dark_la_OBJECTS) $(fors_dark_la_DEPENDENCIES) $(EXTRA_fors_dark_la_DEPENDENCIES) 
+	$(fors_dark_la_LINK) $(am_fors_dark_la_rpath) $(fors_dark_la_OBJECTS) $(fors_dark_la_LIBADD) $(LIBS)
+fors_detect_objects.la: $(fors_detect_objects_la_OBJECTS) $(fors_detect_objects_la_DEPENDENCIES) $(EXTRA_fors_detect_objects_la_DEPENDENCIES) 
+	$(fors_detect_objects_la_LINK) $(am_fors_detect_objects_la_rpath) $(fors_detect_objects_la_OBJECTS) $(fors_detect_objects_la_LIBADD) $(LIBS)
+fors_detect_spectra.la: $(fors_detect_spectra_la_OBJECTS) $(fors_detect_spectra_la_DEPENDENCIES) $(EXTRA_fors_detect_spectra_la_DEPENDENCIES) 
+	$(fors_detect_spectra_la_LINK) $(am_fors_detect_spectra_la_rpath) $(fors_detect_spectra_la_OBJECTS) $(fors_detect_spectra_la_LIBADD) $(LIBS)
+fors_extract.la: $(fors_extract_la_OBJECTS) $(fors_extract_la_DEPENDENCIES) $(EXTRA_fors_extract_la_DEPENDENCIES) 
+	$(fors_extract_la_LINK) $(am_fors_extract_la_rpath) $(fors_extract_la_OBJECTS) $(fors_extract_la_LIBADD) $(LIBS)
+fors_extract_objects.la: $(fors_extract_objects_la_OBJECTS) $(fors_extract_objects_la_DEPENDENCIES) $(EXTRA_fors_extract_objects_la_DEPENDENCIES) 
+	$(fors_extract_objects_la_LINK) $(am_fors_extract_objects_la_rpath) $(fors_extract_objects_la_OBJECTS) $(fors_extract_objects_la_LIBADD) $(LIBS)
+fors_extract_slits.la: $(fors_extract_slits_la_OBJECTS) $(fors_extract_slits_la_DEPENDENCIES) $(EXTRA_fors_extract_slits_la_DEPENDENCIES) 
+	$(fors_extract_slits_la_LINK) $(am_fors_extract_slits_la_rpath) $(fors_extract_slits_la_OBJECTS) $(fors_extract_slits_la_LIBADD) $(LIBS)
+fors_flat.la: $(fors_flat_la_OBJECTS) $(fors_flat_la_DEPENDENCIES) $(EXTRA_fors_flat_la_DEPENDENCIES) 
+	$(fors_flat_la_LINK) $(am_fors_flat_la_rpath) $(fors_flat_la_OBJECTS) $(fors_flat_la_LIBADD) $(LIBS)
+fors_flatfield.la: $(fors_flatfield_la_OBJECTS) $(fors_flatfield_la_DEPENDENCIES) $(EXTRA_fors_flatfield_la_DEPENDENCIES) 
+	$(fors_flatfield_la_LINK) $(am_fors_flatfield_la_rpath) $(fors_flatfield_la_OBJECTS) $(fors_flatfield_la_LIBADD) $(LIBS)
+fors_img_science.la: $(fors_img_science_la_OBJECTS) $(fors_img_science_la_DEPENDENCIES) $(EXTRA_fors_img_science_la_DEPENDENCIES) 
+	$(fors_img_science_la_LINK) $(am_fors_img_science_la_rpath) $(fors_img_science_la_OBJECTS) $(fors_img_science_la_LIBADD) $(LIBS)
+fors_img_screen_flat.la: $(fors_img_screen_flat_la_OBJECTS) $(fors_img_screen_flat_la_DEPENDENCIES) $(EXTRA_fors_img_screen_flat_la_DEPENDENCIES) 
+	$(fors_img_screen_flat_la_LINK) $(am_fors_img_screen_flat_la_rpath) $(fors_img_screen_flat_la_OBJECTS) $(fors_img_screen_flat_la_LIBADD) $(LIBS)
+fors_img_sky_flat.la: $(fors_img_sky_flat_la_OBJECTS) $(fors_img_sky_flat_la_DEPENDENCIES) $(EXTRA_fors_img_sky_flat_la_DEPENDENCIES) 
+	$(fors_img_sky_flat_la_LINK) $(am_fors_img_sky_flat_la_rpath) $(fors_img_sky_flat_la_OBJECTS) $(fors_img_sky_flat_la_LIBADD) $(LIBS)
+fors_normalise_flat.la: $(fors_normalise_flat_la_OBJECTS) $(fors_normalise_flat_la_DEPENDENCIES) $(EXTRA_fors_normalise_flat_la_DEPENDENCIES) 
+	$(fors_normalise_flat_la_LINK) $(am_fors_normalise_flat_la_rpath) $(fors_normalise_flat_la_OBJECTS) $(fors_normalise_flat_la_LIBADD) $(LIBS)
+fors_photometry.la: $(fors_photometry_la_OBJECTS) $(fors_photometry_la_DEPENDENCIES) $(EXTRA_fors_photometry_la_DEPENDENCIES) 
+	$(fors_photometry_la_LINK) $(am_fors_photometry_la_rpath) $(fors_photometry_la_OBJECTS) $(fors_photometry_la_LIBADD) $(LIBS)
+fors_pmos_calib.la: $(fors_pmos_calib_la_OBJECTS) $(fors_pmos_calib_la_DEPENDENCIES) $(EXTRA_fors_pmos_calib_la_DEPENDENCIES) 
+	$(fors_pmos_calib_la_LINK) $(am_fors_pmos_calib_la_rpath) $(fors_pmos_calib_la_OBJECTS) $(fors_pmos_calib_la_LIBADD) $(LIBS)
+fors_pmos_extract.la: $(fors_pmos_extract_la_OBJECTS) $(fors_pmos_extract_la_DEPENDENCIES) $(EXTRA_fors_pmos_extract_la_DEPENDENCIES) 
+	$(fors_pmos_extract_la_LINK) $(am_fors_pmos_extract_la_rpath) $(fors_pmos_extract_la_OBJECTS) $(fors_pmos_extract_la_LIBADD) $(LIBS)
+fors_pmos_science.la: $(fors_pmos_science_la_OBJECTS) $(fors_pmos_science_la_DEPENDENCIES) $(EXTRA_fors_pmos_science_la_DEPENDENCIES) 
+	$(fors_pmos_science_la_LINK) $(am_fors_pmos_science_la_rpath) $(fors_pmos_science_la_OBJECTS) $(fors_pmos_science_la_LIBADD) $(LIBS)
+fors_remove_bias.la: $(fors_remove_bias_la_OBJECTS) $(fors_remove_bias_la_DEPENDENCIES) $(EXTRA_fors_remove_bias_la_DEPENDENCIES) 
+	$(fors_remove_bias_la_LINK) $(am_fors_remove_bias_la_rpath) $(fors_remove_bias_la_OBJECTS) $(fors_remove_bias_la_LIBADD) $(LIBS)
+fors_resample.la: $(fors_resample_la_OBJECTS) $(fors_resample_la_DEPENDENCIES) $(EXTRA_fors_resample_la_DEPENDENCIES) 
+	$(fors_resample_la_LINK) $(am_fors_resample_la_rpath) $(fors_resample_la_OBJECTS) $(fors_resample_la_LIBADD) $(LIBS)
+fors_science.la: $(fors_science_la_OBJECTS) $(fors_science_la_DEPENDENCIES) $(EXTRA_fors_science_la_DEPENDENCIES) 
+	$(fors_science_la_LINK) $(am_fors_science_la_rpath) $(fors_science_la_OBJECTS) $(fors_science_la_LIBADD) $(LIBS)
+fors_subtract_sky.la: $(fors_subtract_sky_la_OBJECTS) $(fors_subtract_sky_la_DEPENDENCIES) $(EXTRA_fors_subtract_sky_la_DEPENDENCIES) 
+	$(fors_subtract_sky_la_LINK) $(am_fors_subtract_sky_la_rpath) $(fors_subtract_sky_la_OBJECTS) $(fors_subtract_sky_la_LIBADD) $(LIBS)
+fors_subtract_sky_lss.la: $(fors_subtract_sky_lss_la_OBJECTS) $(fors_subtract_sky_lss_la_DEPENDENCIES) $(EXTRA_fors_subtract_sky_lss_la_DEPENDENCIES) 
+	$(fors_subtract_sky_lss_la_LINK) $(am_fors_subtract_sky_lss_la_rpath) $(fors_subtract_sky_lss_la_OBJECTS) $(fors_subtract_sky_lss_la_LIBADD) $(LIBS)
+fors_sumflux.la: $(fors_sumflux_la_OBJECTS) $(fors_sumflux_la_DEPENDENCIES) $(EXTRA_fors_sumflux_la_DEPENDENCIES) 
+	$(fors_sumflux_la_LINK) $(am_fors_sumflux_la_rpath) $(fors_sumflux_la_OBJECTS) $(fors_sumflux_la_LIBADD) $(LIBS)
+fors_trace_flat.la: $(fors_trace_flat_la_OBJECTS) $(fors_trace_flat_la_DEPENDENCIES) $(EXTRA_fors_trace_flat_la_DEPENDENCIES) 
+	$(fors_trace_flat_la_LINK) $(am_fors_trace_flat_la_rpath) $(fors_trace_flat_la_OBJECTS) $(fors_trace_flat_la_LIBADD) $(LIBS)
+fors_wave_calib.la: $(fors_wave_calib_la_OBJECTS) $(fors_wave_calib_la_DEPENDENCIES) $(EXTRA_fors_wave_calib_la_DEPENDENCIES) 
+	$(fors_wave_calib_la_LINK) $(am_fors_wave_calib_la_rpath) $(fors_wave_calib_la_OBJECTS) $(fors_wave_calib_la_LIBADD) $(LIBS)
+fors_wave_calib_lss.la: $(fors_wave_calib_lss_la_OBJECTS) $(fors_wave_calib_lss_la_DEPENDENCIES) $(EXTRA_fors_wave_calib_lss_la_DEPENDENCIES) 
+	$(fors_wave_calib_lss_la_LINK) $(am_fors_wave_calib_lss_la_rpath) $(fors_wave_calib_lss_la_OBJECTS) $(fors_wave_calib_lss_la_LIBADD) $(LIBS)
+fors_zeropoint.la: $(fors_zeropoint_la_OBJECTS) $(fors_zeropoint_la_DEPENDENCIES) $(EXTRA_fors_zeropoint_la_DEPENDENCIES) 
+	$(fors_zeropoint_la_LINK) $(am_fors_zeropoint_la_rpath) $(fors_zeropoint_la_OBJECTS) $(fors_zeropoint_la_LIBADD) $(LIBS)
+montecarlo.la: $(montecarlo_la_OBJECTS) $(montecarlo_la_DEPENDENCIES) $(EXTRA_montecarlo_la_DEPENDENCIES) 
+	$(montecarlo_la_LINK) $(am_montecarlo_la_rpath) $(montecarlo_la_OBJECTS) $(montecarlo_la_LIBADD) $(LIBS)
+test_hough.la: $(test_hough_la_OBJECTS) $(test_hough_la_DEPENDENCIES) $(EXTRA_test_hough_la_DEPENDENCIES) 
+	$(test_hough_la_LINK) $(am_test_hough_la_rpath) $(test_hough_la_OBJECTS) $(test_hough_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -763,44 +983,61 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_hough.Plo at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
+.cc.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cc.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
 mostlyclean-libtool:
 	-rm -f *.lo
 
 clean-libtool:
 	-rm -rf .libs _libs
 
-distclean-libtool:
-	-rm -f libtool
-uninstall-info-am:
-
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@failcom='exit 1'; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
 	  case $$f in \
 	    *=* | --[!k]*);; \
@@ -809,7 +1046,11 @@ $(RECURSIVE_TARGETS):
 	done; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -817,51 +1058,23 @@ $(RECURSIVE_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-	@failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
 	done
 ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -869,14 +1082,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
@@ -888,81 +1101,112 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test ! -f $$subdir/TAGS || \
-	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(mkdir_p) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	    distdir=`$(am__cd) $(distdir) && pwd`; \
-	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
-	    (cd $$subdir && \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
 	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$top_distdir" \
-	        distdir="$$distdir/$$subdir" \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
 	        distdir) \
 	      || exit 1; \
 	  fi; \
@@ -973,7 +1217,7 @@ all-am: Makefile $(LTLIBRARIES) $(HEADERS)
 installdirs: installdirs-recursive
 installdirs-am:
 	for dir in "$(DESTDIR)$(plugindir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-recursive
 install-exec: install-exec-recursive
@@ -985,16 +1229,22 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
@@ -1010,7 +1260,7 @@ distclean: distclean-recursive
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-libtool distclean-tags
+	distclean-tags
 
 dvi: dvi-recursive
 
@@ -1018,18 +1268,38 @@ dvi-am:
 
 html: html-recursive
 
+html-am:
+
 info: info-recursive
 
 info-am:
 
 install-data-am: install-pluginLTLIBRARIES
 
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-recursive
+
+install-html-am:
+
 install-info: install-info-recursive
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -1050,24 +1320,28 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-pluginLTLIBRARIES
+uninstall-am: uninstall-pluginLTLIBRARIES
 
-uninstall-info: uninstall-info-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
-	clean clean-generic clean-libtool clean-pluginLTLIBRARIES \
-	clean-recursive ctags ctags-recursive distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-recursive distclean-tags distdir dvi dvi-am html \
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-generic clean-libtool \
+	clean-pluginLTLIBRARIES cscopelist cscopelist-recursive ctags \
+	ctags-recursive distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-pluginLTLIBRARIES \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pluginLTLIBRARIES install-ps install-ps-am \
 	install-strip installcheck installcheck-am installdirs \
 	installdirs-am maintainer-clean maintainer-clean-generic \
-	maintainer-clean-recursive mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
-	pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
-	uninstall-info-am uninstall-pluginLTLIBRARIES
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-pluginLTLIBRARIES
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/recipes/fors_align_sky.c b/recipes/fors_align_sky.c
index 947e6a2..ee527d9 100644
--- a/recipes/fors_align_sky.c
+++ b/recipes/fors_align_sky.c
@@ -1,4 +1,4 @@
-/* $Id: fors_align_sky.c,v 1.7 2013/04/24 14:15:36 cgarcia Exp $
+/* $Id: fors_align_sky.c,v 1.8 2013-08-14 16:07:47 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:15:36 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-08-14 16:07:47 $
+ * $Revision: 1.8 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -374,14 +374,12 @@ static int fors_align_sky(cpl_parameterlist *parlist,
     const char *spatial_map_tag;
     int         nframes;
     int         rebin;
-    int         nslits;
     int         nlines;
     int         nx;
     int         highres;
     int         treat_as_lss;
     int         i;
     double      reference;
-    double     *xpos;
     double      mxpos;
     double     *line;
     int         mxu, mos;
diff --git a/recipes/fors_align_sky_lss.c b/recipes/fors_align_sky_lss.c
index 81d352b..63ce755 100644
--- a/recipes/fors_align_sky_lss.c
+++ b/recipes/fors_align_sky_lss.c
@@ -1,4 +1,4 @@
-/* $Id: fors_align_sky_lss.c,v 1.7 2013/04/24 14:15:36 cgarcia Exp $
+/* $Id: fors_align_sky_lss.c,v 1.9 2013-08-21 14:49:09 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:15:36 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-08-21 14:49:09 $
+ * $Revision: 1.9 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -365,9 +365,8 @@ static int fors_align_sky_lss(cpl_parameterlist *parlist,
     const char *disp_coeff_tag;
     int         nframes;
     int         rebin;
-    int         nslits;
     int         nlines;
-    int         nx, ny;
+    int         nx;
     int         ccd_xsize, ccd_ysize;
     int         first_row, last_row;
     int         ylow, yhig;
@@ -375,8 +374,6 @@ static int fors_align_sky_lss(cpl_parameterlist *parlist,
     int         treat_as_lss;
     int         i;
     double      reference;
-    double     *xpos;
-    double      mxpos;
     double     *line;
     int         mxu, mos, lss;
     int         rec_scib;
@@ -721,7 +718,6 @@ static int fors_align_sky_lss(cpl_parameterlist *parlist,
     dummy = cpl_image_extract(smapped, 1, ylow, ccd_xsize, yhig);
     cpl_image_delete(smapped); smapped = dummy;
     nx = ccd_xsize;
-    ny = cpl_image_get_size_y(smapped);
 
     cpl_table_delete(slits); slits = NULL;
 
diff --git a/recipes/fors_bias.c b/recipes/fors_bias.c
index 03c56c7..d4743e9 100644
--- a/recipes/fors_bias.c
+++ b/recipes/fors_bias.c
@@ -1,4 +1,4 @@
-/* $Id: fors_bias.c,v 1.9 2011/10/12 14:59:57 cgarcia Exp $
+/* $Id: fors_bias.c,v 1.9 2011-10-12 14:59:57 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/12 14:59:57 $
+ * $Date: 2011-10-12 14:59:57 $
  * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_calib.c b/recipes/fors_calib.cc
similarity index 59%
rename from recipes/fors_calib.c
rename to recipes/fors_calib.cc
index 2357588..d20de90 100644
--- a/recipes/fors_calib.c
+++ b/recipes/fors_calib.cc
@@ -1,4 +1,4 @@
-/* $Id: fors_calib.c,v 1.29 2013/04/24 14:15:36 cgarcia Exp $
+/* $Id: fors_calib.cc,v 1.14 2013/10/24 16:46:53 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,32 +20,91 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:15:36 $
- * $Revision: 1.29 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013/10/24 16:46:53 $
+ * $Revision: 1.14 $
+ * $Name:  $
  */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
+#include <cmath>
+#include <string>
+#include <sstream>
+#include <exception>
 #include <math.h>
 #include <string.h>
 #include <cpl.h>
 #include <moses.h>
+#include <fors_flat_normalise.h>
+#include <fors_detected_slits.h>
 #include <fors_stack.h>
 #include <fors_dfs.h>
 #include <fors_header.h>
+#include <fors_utils.h>
+#include "flat_combine.h"
+
 
 #ifdef __cplusplus
 extern "C"
 #endif
 int cpl_plugin_get_info(cpl_pluginlist * list);
 
+struct fors_calib_config 
+{
+    /* Input parameters */
+    double        dispersion;
+    double        peakdetection;
+    int           wdegree;
+    int           wradius;
+    double        wreject;
+    int           wmode;
+    int           wmosmode;
+    const char   *wcolumn;
+    int           cdegree;
+    int           cmode;
+    double        startwavelength;
+    double        endwavelength;
+    int           slit_ident;
+    int           spa_nknots;
+    int           disp_nknots;
+    int           sradius;
+    int           dradius;
+    float         splfit_threshold;
+    const char   *stack_method;
+    int           min_reject;
+    int           max_reject;
+    double        klow;
+    double        khigh;
+    int           kiter;
+    const char   *ignore_lines;
+};
+
 static int fors_calib_create(cpl_plugin *);
 static int fors_calib_exec(cpl_plugin *);
 static int fors_calib_destroy(cpl_plugin *);
 static int fors_calib(cpl_parameterlist *, cpl_frameset *);
+int fors_calib_retrieve_input_param(cpl_parameterlist * parlist, 
+                                     cpl_frameset * frameset,
+                                     fors_calib_config * config);
+cpl_vector * fors_calib_get_reference_lines(cpl_frameset * frameset, 
+                                            const char * wcolumn,
+                                            const char * ignore_lines);
+int fors_calib_flat_mos_normalise_rect_mapped_save
+(cpl_image * master_flat, cpl_table * slits, cpl_table *idscoeff,
+ cpl_table * polytraces,
+ cpl_image * coordinate, double reference, struct fors_calib_config& config,
+ int nflats, cpl_frameset * frameset, const char * flat_tag,
+ const char * master_screen_flat_tag, const char * master_norm_flat_tag,
+ const char * mapped_screen_flat_tag, const char * mapped_norm_flat_tag,
+ cpl_parameterlist * parlist, const cpl_frame * ref_flat_frame);
+cpl_image * fors_calib_flat_mos_create_master_flat
+(cpl_table * slits, cpl_table * polytraces, cpl_table *idscoeff, 
+ cpl_image *master_bias, 
+ struct fors_calib_config& config, int nflats, cpl_frameset * frameset,
+ const char * flat_tag);
+
 
 static char fors_calib_description[] =
 "This recipe is used to identify reference lines on LSS, MOS and MXU arc lamp\n"
@@ -80,7 +139,7 @@ static char fors_calib_description[] =
 "  DO category:             Type:       Explanation:         Required:\n"
 "  SCREEN_FLAT_MXU          Raw         Flat field exposures    Y\n"
 "  LAMP_MXU                 Raw         Arc lamp exposure       Y\n"
-"  MASTER_BIAS or BIAS      Calib       Bias frame              Y\n"
+"  MASTER_BIAS              Calib       Master Bias frame       Y\n"
 "  MASTER_LINECAT           Calib       Line catalog            Y\n"
 "  GRISM_TABLE              Calib       Grism table             .\n\n"
 "Output files:\n\n"
@@ -101,13 +160,14 @@ static char fors_calib_description[] =
 "  CURV_COEFF_MXU           FITS table  Spectral curvature coefficients\n"
 "  SPATIAL_MAP_MXU          FITS image  Spatial position along slit on CCD\n"
 "  SPECTRAL_RESOLUTION_MXU  FITS table  Resolution at reference arc lines\n"
+"  DETECTED_LINES_MXU       FITS table  All the lines detected in the arc\n"
+"  ARC_RECTIFIED_MXU        FITS iamge  The spatial rectified arc\n"
 "  SLIT_LOCATION_MXU        FITS table  Slits on product frames and CCD\n"
 "  GLOBAL_DISTORTION_TABLE  FITS table  Global distortions table\n\n";
 
 #define fors_calib_exit(message)                      \
 {                                                     \
-if (message != NULL ) cpl_msg_error(recipe, message);  \
-cpl_free(instrume);                                   \
+if ((const char *)message != NULL ) cpl_msg_error(recipe, message);  \
 cpl_free(pipefile);                                   \
 cpl_free(fiterror);                                   \
 cpl_free(fitlines);                                   \
@@ -135,7 +195,6 @@ cpl_mask_delete(refmask);                             \
 cpl_propertylist_delete(header);                      \
 cpl_propertylist_delete(save_header);                 \
 cpl_propertylist_delete(qclist);                      \
-cpl_table_delete(grism_table);                        \
 cpl_table_delete(idscoeff);                           \
 cpl_table_delete(idscoeff_all);                       \
 cpl_table_delete(restable);                           \
@@ -154,9 +213,7 @@ return -1;                                            \
 
 #define fors_calib_exit_memcheck(message)              \
 {                                                      \
-if (message !=NULL ) cpl_msg_info(recipe, message);    \
-printf("free instrume (%p)\n", instrume);              \
-cpl_free(instrume);                                    \
+if ((const char *)message !=NULL ) cpl_msg_info(recipe, message);    \
 printf("free pipefile (%p)\n", pipefile);              \
 cpl_free(pipefile);                                    \
 printf("free fiterror (%p)\n", fiterror);              \
@@ -235,7 +292,6 @@ printf("free wavelengths (%p)\n", wavelengths);        \
 cpl_table_delete(wavelengths);                         \
 printf("free lines (%p)\n", lines);                    \
 cpl_vector_delete(lines);                              \
-cpl_msg_indent_less();                                 \
 return 0;                                              \
 }
 
@@ -253,7 +309,7 @@ return 0;                                              \
 
 int cpl_plugin_get_info(cpl_pluginlist *list)
 {
-    cpl_recipe *recipe = cpl_calloc(1, sizeof *recipe );
+    cpl_recipe *recipe = static_cast<cpl_recipe *>(cpl_calloc(1, sizeof *recipe ));
     cpl_plugin *plugin = &recipe->interface;
 
     cpl_plugin_init(plugin,
@@ -433,6 +489,20 @@ static int fors_calib_create(cpl_plugin *plugin)
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
+     * Catalog lines to ignore in wavelength calibration
+     */
+
+    p = cpl_parameter_new_value("fors.fors_calib.ignore_lines",
+                                CPL_TYPE_STRING,
+                                "Catalog lines nearest to wavelengths in this "
+                                "list will be ignored for wavelength calibration",
+                                "fors.fors_calib",
+                                "");
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "ignore_lines");
+    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
+    cpl_parameterlist_append(recipe->parameters, p);
+
+    /*
      * Degree of spectral curvature polynomial
      */
 
@@ -501,96 +571,122 @@ static int fors_calib_create(cpl_plugin *plugin)
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Flat field frames stack parameters
+     * Stacking method
      */
+    p = cpl_parameter_new_enum("fors.fors_calib.stack_method",
+                                CPL_TYPE_STRING,
+                                "Frames combination method",
+                                "fors.fors_calib",
+                                "sum", 4,
+                                "sum", "mean", "median", "ksigma");
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "stack_method");
+    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
+    cpl_parameterlist_append(recipe->parameters, p);
 
-    fors_stack_define_parameters(recipe->parameters, "fors.fors_calib", 
-                                 "average");
+    /* 
+     * Low threshold for the sigma clipping algorithm 
+     */
+    p = cpl_parameter_new_value("fors.fors_calib.klow",
+                                CPL_TYPE_DOUBLE,
+                                "Low threshold in ksigma method",
+                                "fors.fors_calib",
+                                3.0);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "klow");
+    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
+    cpl_parameterlist_append(recipe->parameters, p);
 
-    /*
-     * Degree of flat field fitting polynomial along spatial direction 
-     * (used for LSS data)
+    /* 
+     * High threshold for the sigma clipping algorithm 
      */
+    p = cpl_parameter_new_value("fors.fors_calib.khigh",
+                                CPL_TYPE_DOUBLE,
+                                "High threshold in ksigma method",
+                                "fors.fors_calib",
+                                3.0);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "khigh");
+    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
+    cpl_parameterlist_append(recipe->parameters, p);
 
-    p = cpl_parameter_new_value("fors.fors_calib.sdegree",
+    /* 
+     * Number of iterations for the sigma clipping algorithm 
+     */
+    p = cpl_parameter_new_value("fors.fors_calib.kiter",
                                 CPL_TYPE_INT,
-                                "Degree of flat field fitting polynomial "
-                                "along spatial direction (used for LSS "
-                                "data only)",
+                                "Max number of iterations in ksigma method",
                                 "fors.fors_calib",
-                                4);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "sdegree");
+                                999);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "kiter");
     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Degree of flat field fitting polynomial along dispersion direction
-     * (used for MOS and MXU data)
+     * Number of knots in flat field fitting splines along spatial direction 
      */
 
-    p = cpl_parameter_new_value("fors.fors_calib.ddegree",
+    p = cpl_parameter_new_value("fors.fors_calib.s_nknots",
                                 CPL_TYPE_INT,
-                                "Degree of flat field fitting polynomial "
-                                "along dispersion direction (used for MOS "
-                                "and MXU data only)",
+                                "Number of knots in flat field fitting "
+                                "splines along spatial direction",
                                 "fors.fors_calib",
                                 -1);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "ddegree");
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "s_nknots");
     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Smooth box radius for flat field along dispersion direction
+     * Smooth box radius for flat field along spatial direction
+     * (if s_knots < 0)
      */
 
-    p = cpl_parameter_new_value("fors.fors_calib.dradius",
+    p = cpl_parameter_new_value("fors.fors_calib.sradius",
                                 CPL_TYPE_INT,
                                 "Smooth box radius for flat field along "
-                                "dispersion direction",
+                                "spatial direction (used if s_knots < 0)",
                                 "fors.fors_calib",
                                 10);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "dradius");
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "sradius");
     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Smooth box radius for flat field along spatial direction
-     * (used for LSS data only)
+     * Number of knots in flat field fitting splines along dispersion direction 
      */
 
-    p = cpl_parameter_new_value("fors.fors_calib.sradius",
+    p = cpl_parameter_new_value("fors.fors_calib.d_nknots",
                                 CPL_TYPE_INT,
-                                "Smooth box radius for flat field along "
-                                "spatial direction",
+                                "Number of knots in flat field fitting "
+                                "splines along dispersion direction",
                                 "fors.fors_calib",
-                                10);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "sradius");
+                                -1);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "d_nknots");
     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Computation of QC1 parameters
+     * Smooth box radius for flat field along dispersion direction
      */
 
-    p = cpl_parameter_new_value("fors.fors_calib.qc",
-                                CPL_TYPE_BOOL,
-                                "Compute QC1 parameters",
+    p = cpl_parameter_new_value("fors.fors_calib.dradius",
+                                CPL_TYPE_INT,
+                                "Smooth box radius for flat field along "
+                                "dispersion direction (if d_knots < 0)",
                                 "fors.fors_calib",
-                                TRUE);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "qc");
+                                10);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "dradius");
     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Create check products
+     * Threshold percentage for flat spline fitting with respect to the maximum
      */
 
-    p = cpl_parameter_new_value("fors.fors_calib.check",
-                                CPL_TYPE_BOOL,
-                                "Create intermediate products",
+    p = cpl_parameter_new_value("fors.fors_calib.splfit_threshold",
+                                CPL_TYPE_DOUBLE,
+                                "Threshold percentage for flat spline fitting"
+                                "with respect to the maximum",
                                 "fors.fors_calib",
-                                FALSE);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "check");
+                                0.01);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "splfit_threshold");
     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
     cpl_parameterlist_append(recipe->parameters, p);
 
@@ -608,14 +704,31 @@ static int fors_calib_create(cpl_plugin *plugin)
 
 static int fors_calib_exec(cpl_plugin *plugin)
 {
-    cpl_recipe *recipe;
-    
-    if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-        recipe = (cpl_recipe *)plugin;
-    else 
-        return -1;
+    cpl_recipe  *   recipe ;
+    int             status = 1;
 
-    return fors_calib(recipe->parameters, recipe->frames);
+    /* Get the recipe out of the plugin */
+    if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
+        recipe = (cpl_recipe *)plugin ;
+    else return -1 ;
+
+    /* Issue a banner */
+    //fors_print_banner();
+
+    try
+    {
+        status = fors_calib(recipe->parameters, recipe->frames);
+    }
+    catch(std::exception& ex)
+    {
+        cpl_msg_error(cpl_func, "Exception: %s", ex.what());
+    }
+    catch(...)
+    {
+        cpl_msg_error(cpl_func, "An uncaught error during recipe execution");
+    }
+
+    return status;
 }
 
 
@@ -656,42 +769,15 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
     const char *recipe = "fors_calib";
 
-
     /*
      * Input parameters
      */
-
-    double        dispersion;
-    double        peakdetection;
-    int           wdegree;
-    int           wradius;
-    double        wreject;
-    int           wmode;
-    int           wmosmode;
-    const char   *wcolumn;
-    int           cdegree;
-    int           cmode;
-    double        startwavelength;
-    double        endwavelength;
-    int           slit_ident;
-    int           sdegree;
-    int           ddegree;
-    int           sradius;
-    int           dradius;
-    int           qc;
-    int           check;
-    const char   *stack_method;
-    int           min_reject;
-    int           max_reject;
-    double        klow;
-    double        khigh;
-    int           kiter;
+    struct fors_calib_config config;
 
     /*
      * CPL objects
      */
 
-    cpl_imagelist    *biases       = NULL;
     cpl_image        *bias         = NULL;
     cpl_image        *master_bias  = NULL;
     cpl_image        *multi_bias   = NULL;
@@ -720,7 +806,6 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
     cpl_mask         *refmask      = NULL;
 
-    cpl_table        *grism_table  = NULL;
     cpl_table        *overscans    = NULL;
     cpl_table        *wavelengths  = NULL;
     cpl_table        *idscoeff     = NULL;
@@ -740,11 +825,13 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     cpl_propertylist *save_header  = NULL;
     cpl_propertylist *qclist       = NULL;
 
+    const cpl_frame  *ref_flat_frame = NULL;
+    const cpl_frame  *ref_arc_frame  = NULL;
+    
     /*
      * Auxiliary variables
      */
 
-    char        version[80];
     const char *arc_tag;
     const char *flat_tag;
     const char *master_screen_flat_tag;
@@ -762,6 +849,8 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     const char *slit_location_tag;
     const char *global_distortion_tag = "GLOBAL_DISTORTION_TABLE";
     const char *disp_residuals_table_tag;
+    const char *detected_lines_tag;
+    const char *arc_rectified_tag;
     const char *delta_image_tag;
     const char *mapped_screen_flat_tag;
     const char *mapped_norm_flat_tag;
@@ -775,7 +864,6 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     double      mean_rms_err;
     double      alltime;
     int         nflats;
-    int         nbias;
     int         nlines;
     int         rebin;
     double     *line;
@@ -788,154 +876,98 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     int         ccd_xsize, ccd_ysize;
     int         i;
 
-    char       *instrume = NULL;
     char       *pipefile = NULL;
     char       *wheel4;
 
 
-    snprintf(version, 80, "%s-%s", PACKAGE, PACKAGE_VERSION);
-
     cpl_msg_set_indentation(2);
 
     /* 
      * Get configuration parameters
      */
-
-    cpl_msg_info(recipe, "Recipe %s configuration parameters:", recipe);
-    cpl_msg_indent_more();
-
     if (cpl_frameset_count_tags(frameset, "GRISM_TABLE") > 1)
         fors_calib_exit("Too many in input: GRISM_TABLE");
 
-    grism_table = dfs_load_table(frameset, "GRISM_TABLE", 1);
-
-    dispersion = dfs_get_parameter_double(parlist, 
-                    "fors.fors_calib.dispersion", grism_table);
+    if(fors_calib_retrieve_input_param(parlist, frameset, &config) != 0)
+        fors_calib_exit("Failed to read input parameters");;
+    
+    /* Check input parameters */
 
-    if (dispersion <= 0.0)
+    if (config.dispersion <= 0.0)
         fors_calib_exit("Invalid spectral dispersion value");
 
-    peakdetection = dfs_get_parameter_double(parlist, 
-                    "fors.fors_calib.peakdetection", grism_table);
-    if (peakdetection <= 0.0)
+    if (config.peakdetection <= 0.0)
         fors_calib_exit("Invalid peak detection level");
-
-    wdegree = dfs_get_parameter_int(parlist, 
-                    "fors.fors_calib.wdegree", grism_table);
-
-    if (wdegree < 1)
+    
+    if (config.wdegree < 1)
         fors_calib_exit("Invalid polynomial degree");
 
-    if (wdegree > 5)
+    if (config.wdegree > 5)
         fors_calib_exit("Max allowed polynomial degree is 5");
+    
 
-    wradius = dfs_get_parameter_int(parlist, "fors.fors_calib.wradius", NULL);
-
-    if (wradius < 0)
+    if (config.wradius < 0)
         fors_calib_exit("Invalid search radius");
 
-    wreject = dfs_get_parameter_double(parlist, 
-                                       "fors.fors_calib.wreject", NULL);
-
-    if (wreject <= 0.0)
+    if (config.wradius <= 0.0)
         fors_calib_exit("Invalid rejection threshold");
 
-    wmode = dfs_get_parameter_int(parlist, "fors.fors_calib.wmode", NULL);
-
-    if (wmode < 0 || wmode > 2)
+    if (config.wmode < 0 || config.wmode > 2)
         fors_calib_exit("Invalid wavelength solution interpolation mode");
 
-    wmosmode = dfs_get_parameter_int(parlist,
-                                     "fors.fors_calib.wmosmode", NULL);
-
-    if (wmosmode < 0 || wmosmode > 2)
+    if (config.wmosmode < 0 || config.wmosmode > 2)
         fors_calib_exit("Invalid wavelength solution interpolation mode");
 
-    wcolumn = dfs_get_parameter_string(parlist, "fors.fors_calib.wcolumn", 
-                                       NULL);
-
-    cdegree = dfs_get_parameter_int(parlist, "fors.fors_calib.cdegree", 
-                                    grism_table);
-
-    if (cdegree < 1)
+    if (config.cdegree < 1)
         fors_calib_exit("Invalid polynomial degree");
 
-    if (cdegree > 5)
+    if (config.cdegree > 5)
         fors_calib_exit("Max allowed polynomial degree is 5");
 
-    cmode = dfs_get_parameter_int(parlist, "fors.fors_calib.cmode", NULL);
-
-    if (cmode < 0 || cmode > 2)
+    if (config.cmode < 0 || config.cmode > 2)
         fors_calib_exit("Invalid curvature solution interpolation mode");
 
-    startwavelength = dfs_get_parameter_double(parlist, 
-                    "fors.fors_calib.startwavelength", grism_table);
-    if (startwavelength > 1.0)
-        if (startwavelength < 3000.0 || startwavelength > 13000.0)
+    if (config.startwavelength > 1.0)
+        if (config.startwavelength < 3000.0 || config.startwavelength > 13000.0)
             fors_calib_exit("Invalid wavelength");
 
-    endwavelength = dfs_get_parameter_double(parlist, 
-                    "fors.fors_calib.endwavelength", grism_table);
-    if (endwavelength > 1.0) {
-        if (endwavelength < 3000.0 || endwavelength > 13000.0)
+    if (config.endwavelength > 1.0) {
+        if (config.endwavelength < 3000.0 || config.endwavelength > 13000.0)
             fors_calib_exit("Invalid wavelength");
-        if (startwavelength < 1.0)
+        if (config.startwavelength < 1.0)
             fors_calib_exit("Invalid wavelength interval");
     }
 
-    if (startwavelength > 1.0)
-        if (endwavelength - startwavelength <= 0.0)
+    if (config.startwavelength > 1.0)
+        if (config.endwavelength - config.startwavelength <= 0.0)
             fors_calib_exit("Invalid wavelength interval");
 
-    slit_ident = dfs_get_parameter_bool(parlist, 
-                    "fors.fors_calib.slit_ident", NULL);
-
-    stack_method = dfs_get_parameter_string(parlist, 
-                                            "fors.fors_calib.stack_method", 
-                                            NULL);
+    std::string stack_method_str = config.stack_method; 
+    if(stack_method_str != "mean" && stack_method_str != "median" && 
+       stack_method_str != "ksigma" && stack_method_str != "sum")
+        throw std::invalid_argument(stack_method_str+" stacking algorithm invalid");
 
-    if (strcmp(stack_method, "minmax") == 0) {
-        min_reject = dfs_get_parameter_int(parlist, 
-                                       "fors.fors_calib.minrejection", NULL);
-        if (min_reject < 0)
+    if (strcmp(config.stack_method, "minmax") == 0) {
+        if (config.min_reject < 0)
             fors_calib_exit("Invalid number of lower rejections");
-
-        max_reject = dfs_get_parameter_int(parlist, 
-                                       "fors.fors_calib.maxrejection", NULL);
-        if (max_reject < 0)
+        if (config.max_reject < 0)
             fors_calib_exit("Invalid number of upper rejections");
     }
 
-    if (strcmp(stack_method, "ksigma") == 0) {
-        klow  = dfs_get_parameter_double(parlist, 
-                                         "fors.fors_calib.klow", NULL);
-        if (klow < 0.1)
+    if (strcmp(config.stack_method, "ksigma") == 0) {
+        if (config.klow < 0.1)
             fors_calib_exit("Invalid lower K-sigma");
-
-        khigh = dfs_get_parameter_double(parlist, 
-                                         "fors.fors_calib.khigh", NULL);
-        if (khigh < 0.1)
+        if (config.khigh < 0.1)
             fors_calib_exit("Invalid lower K-sigma");
-
-        kiter = dfs_get_parameter_int(parlist, 
-                                      "fors.fors_calib.kiter", NULL);
-        if (kiter < 1)
+        if (config.kiter < 1)
             fors_calib_exit("Invalid number of iterations");
     }
 
-    sdegree = dfs_get_parameter_int(parlist, "fors.fors_calib.sdegree", NULL);
-    ddegree = dfs_get_parameter_int(parlist, "fors.fors_calib.ddegree", NULL);
-    sradius = dfs_get_parameter_int(parlist, "fors.fors_calib.sradius", NULL);
-    dradius = dfs_get_parameter_int(parlist, "fors.fors_calib.dradius", NULL);
-
-    if (sradius < 1 || dradius < 1)
-        fors_calib_exit("Invalid smoothing box radius");
-
-    qc = dfs_get_parameter_bool(parlist, "fors.fors_calib.qc", NULL);
-
-    check = dfs_get_parameter_bool(parlist, "fors.fors_calib.check", NULL);
+    if (config.spa_nknots < 1 && config.sradius < 1)
+        fors_calib_exit("Invalid smoothing box radius along spatial");
 
-    cpl_table_delete(grism_table); grism_table = NULL;
+    if (config.disp_nknots < 1 && config.dradius < 1)
+        fors_calib_exit("Invalid smoothing box radius along dispersion");
 
     if (cpl_error_get_code())
         fors_calib_exit("Failure getting the configuration parameters");
@@ -986,6 +1018,8 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
         spatial_map_tag          = "SPATIAL_MAP_MXU";
         slit_location_tag        = "SLIT_LOCATION_MXU";
         disp_residuals_table_tag = "DISP_RESIDUALS_TABLE_MXU";
+        detected_lines_tag       = "DETECTED_LINES_MXU";
+        arc_rectified_tag        = "ARC_RECTIFIED_MXU";
         delta_image_tag          = "DELTA_IMAGE_MXU";
         mapped_screen_flat_tag   = "MAPPED_SCREEN_FLAT_MXU";
         mapped_norm_flat_tag     = "MAPPED_NORM_FLAT_MXU";
@@ -1005,6 +1039,8 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
         wavelength_map_tag       = "WAVELENGTH_MAP_LSS";
         slit_map_tag             = "SLIT_MAP_LSS";
         disp_residuals_table_tag = "DISP_RESIDUALS_TABLE_LSS";
+        detected_lines_tag       = "DETECTED_LINES_LSS";
+        arc_rectified_tag        = "ARC_RECTIFIED_LSS";
         delta_image_tag          = "DELTA_IMAGE_LSS";
         mapped_screen_flat_tag   = "MAPPED_SCREEN_FLAT_LSS";
         mapped_norm_flat_tag     = "MAPPED_NORM_FLAT_LSS";
@@ -1028,17 +1064,15 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
         spatial_map_tag          = "SPATIAL_MAP_MOS";
         slit_location_tag        = "SLIT_LOCATION_MOS";
         disp_residuals_table_tag = "DISP_RESIDUALS_TABLE_MOS";
+        detected_lines_tag       = "DETECTED_LINES_MOS";
+        arc_rectified_tag        = "ARC_RECTIFIED_MOS";
         delta_image_tag          = "DELTA_IMAGE_MOS";
         mapped_screen_flat_tag   = "MAPPED_SCREEN_FLAT_MOS";
         mapped_norm_flat_tag     = "MAPPED_NORM_FLAT_MOS";
     }
 
-    nbias = 0;
-    if (cpl_frameset_count_tags(frameset, "MASTER_BIAS") == 0) {
-        if (cpl_frameset_count_tags(frameset, "BIAS") == 0)
-            fors_calib_exit("Missing required input: MASTER_BIAS or BIAS");
-        nbias = cpl_frameset_count_tags(frameset, "BIAS");
-    }
+    if (cpl_frameset_count_tags(frameset, "MASTER_BIAS") == 0)
+            fors_calib_exit("Missing required input: MASTER_BIAS");
 
     if (cpl_frameset_count_tags(frameset, "MASTER_BIAS") > 1)
         fors_calib_exit("Too many in input: MASTER_BIAS");
@@ -1056,11 +1090,18 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
         fors_calib_exit(NULL);
     }
 
+    /* 
+     * Get the reference frames used to inherit all the saved products 
+     */
+    ref_flat_frame = cpl_frameset_find_const(frameset, flat_tag); 
+    ref_arc_frame = cpl_frameset_find_const(frameset, arc_tag); 
+
+    
     cpl_msg_indent_less();
 
     if (nflats > 1)
         cpl_msg_info(recipe, "Load %d flat field frames and stack them "
-                     "with method \"%s\"", nflats, stack_method);
+                     "with method \"%s\"", nflats, config.stack_method);
     else
         cpl_msg_info(recipe, "Load flat field exposure...");
 
@@ -1111,13 +1152,16 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
     }
 
+    /* 
+     * Creating master flat
+     */ 
     master_flat = dfs_load_image(frameset, flat_tag, CPL_TYPE_FLOAT, 0, 0);
 
     if (master_flat == NULL)
         fors_calib_exit("Cannot load flat field");
 
     if (nflats > 1) {
-        if (strcmp(stack_method, "average") == 0) {
+        if (strcmp(config.stack_method, "sum") == 0) {
             for (i = 1; i < nflats; i++) {
                 flat = dfs_load_image(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
                 if (flat) {
@@ -1176,19 +1220,19 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
                 }
             }
 
-            if (strcmp(stack_method, "median") == 0) {
+            if (strcmp(config.stack_method, "median") == 0) {
                 master_flat = cpl_imagelist_collapse_median_create(flatlist);
             }
 
-            if (strcmp(stack_method, "minmax") == 0) {
+            if (strcmp(config.stack_method, "minmax") == 0) {
                 master_flat = cpl_imagelist_collapse_minmax_create(flatlist, 
-                                                                   min_reject,
-                                                                   max_reject);
+                                                                   config.min_reject,
+                                                                   config.max_reject);
             }
 
-            if (strcmp(stack_method, "ksigma") == 0) {
+            if (strcmp(config.stack_method, "ksigma") == 0) {
                 master_flat = mos_ksigma_stack(flatlist, 
-                                               klow, khigh, kiter, NULL);
+                                               config.klow, config.khigh, config.kiter, NULL);
             }
 
             cpl_imagelist_delete(flatlist);
@@ -1205,16 +1249,6 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     if (header == NULL)
         fors_calib_exit("Cannot load arc lamp header");
 
-    instrume = (char *)cpl_propertylist_get_string(header, "INSTRUME");
-    if (instrume == NULL)
-        fors_calib_exit("Missing keyword INSTRUME in arc lamp header");
-    instrume = cpl_strdup(instrume);
-
-    if (instrume[4] == '1')
-        snprintf(version, 80, "%s/%s", "fors1", VERSION);
-    if (instrume[4] == '2')
-        snprintf(version, 80, "%s/%s", "fors2", VERSION);
-
     reference = cpl_propertylist_get_double(header, "ESO INS GRIS1 WLEN");
 
     if (cpl_error_get_code() != CPL_ERROR_NONE)
@@ -1240,10 +1274,10 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
                         "frame header");
 
     if (rebin != 1) {
-        dispersion *= rebin;
+        config.dispersion *= rebin;
         cpl_msg_warning(recipe, "The rebin factor is %d, and therefore the "
                         "working dispersion used is %f A/pixel", rebin, 
-                        dispersion);
+                        config.dispersion);
     }
 
     gain = cpl_propertylist_get_double(header, "ESO DET OUT1 CONAD");
@@ -1255,9 +1289,9 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     cpl_msg_info(recipe, "The gain factor is: %.2f e-/ADU", gain);
 
     if (mos || mxu) {
-
         int nslits_out_det = 0;
 
+
         cpl_msg_info(recipe, "Produce mask slit position table...");
         if (mos)
             maskslits = mos_load_slits_fors_mos(header, &nslits_out_det);
@@ -1272,7 +1306,6 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
         mxpos = cpl_table_get_column_median(maskslits, "xtop");
         nslits = cpl_table_get_nrow(maskslits);
 
-        
         treat_as_lss = fors_mos_is_lss_like(maskslits,  nslits_out_det);
 
         if (treat_as_lss) {
@@ -1288,6 +1321,7 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
                 spectral_resolution_tag  = "SPECTRAL_RESOLUTION_LONG_MOS";
                 reduced_lamp_tag         = "REDUCED_LAMP_LONG_MOS";
                 disp_coeff_tag           = "DISP_COEFF_LONG_MOS";
+                detected_lines_tag       = "DETECTED_LINES_LONG_MOS";
                 wavelength_map_tag       = "WAVELENGTH_MAP_LONG_MOS";
                 slit_location_tag        = "SLIT_LOCATION_LONG_MOS";
                 mapped_screen_flat_tag   = "MAPPED_SCREEN_FLAT_LONG_MOS";
@@ -1301,6 +1335,7 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
                 spectral_resolution_tag  = "SPECTRAL_RESOLUTION_LONG_MXU";
                 reduced_lamp_tag         = "REDUCED_LAMP_LONG_MXU";
                 disp_coeff_tag           = "DISP_COEFF_LONG_MXU";
+                detected_lines_tag       = "DETECTED_LINES_LONG_MXU";
                 wavelength_map_tag       = "WAVELENGTH_MAP_LONG_MXU";
                 slit_location_tag        = "SLIT_LOCATION_LONG_MXU";
                 mapped_screen_flat_tag   = "MAPPED_SCREEN_FLAT_LONG_MXU";
@@ -1309,7 +1344,7 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
         }
     }
 
-    if (slit_ident == 0) {
+    if (config.slit_ident == 0) {
         cpl_table_delete(maskslits); maskslits = NULL;
     }
 
@@ -1321,71 +1356,16 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
      * Remove the master bias
      */
 
-    if (nbias) {
-
-        /*
-         * Set of raw BIASes in input, need to create master bias!
-         */
-
-        cpl_msg_info(recipe, "Generate the master from input raw biases...");
-
-        if (nbias > 1) {
-
-            biases = cpl_imagelist_new();
-
-            bias = dfs_load_image(frameset, "BIAS", CPL_TYPE_FLOAT, 0, 0);
-    
-            if (bias == NULL)
-                fors_calib_exit("Cannot load bias frame");
-
-            cpl_imagelist_set(biases, bias, 0); bias = NULL;
-    
-            for (i = 1; i < nbias; i++) {
-                bias = dfs_load_image(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-                if (bias) {
-                    cpl_imagelist_set(biases, bias, i); bias = NULL;
-                }
-                else
-                    fors_calib_exit("Cannot load bias frame");
-            }
-    
-            master_bias = cpl_imagelist_collapse_median_create(biases);
-
-            cpl_imagelist_delete(biases);
-        }
-        else {
-            master_bias = dfs_load_image(frameset, "BIAS", 
-                                         CPL_TYPE_FLOAT, 0, 1);
-            if (master_bias == NULL)
-                fors_calib_exit("Cannot load bias");
-        }
-
-    }
-    else {
-        master_bias = dfs_load_image(frameset, "MASTER_BIAS", 
-                                     CPL_TYPE_FLOAT, 0, 1);
-        if (master_bias == NULL)
-            fors_calib_exit("Cannot load master bias");
-    }
+    master_bias = dfs_load_image(frameset, "MASTER_BIAS", 
+            CPL_TYPE_FLOAT, 0, 1);
+    if (master_bias == NULL)
+        fors_calib_exit("Cannot load master bias");
 
     cpl_msg_info(recipe, "Remove the master bias...");
 
     overscans = mos_load_overscans_vimos(header, 1);
     cpl_propertylist_delete(header); header = NULL;
 
-    if (nbias) {
-        int xlow = cpl_table_get_int(overscans, "xlow", 0, NULL);
-        int ylow = cpl_table_get_int(overscans, "ylow", 0, NULL);
-        int xhig = cpl_table_get_int(overscans, "xhig", 0, NULL);
-        int yhig = cpl_table_get_int(overscans, "yhig", 0, NULL);
-        dummy = cpl_image_extract(master_bias, xlow+1, ylow+1, xhig, yhig);
-        cpl_image_delete(master_bias); master_bias = dummy;
-
-        if (dfs_save_image(frameset, master_bias, "MASTER_BIAS",
-                           NULL, parlist, recipe, version))
-            fors_calib_exit(NULL);
-    }
-
     if (nflats > 1) {
         multi_bias = cpl_image_multiply_scalar_create(master_bias, nflats);
         dummy = mos_remove_bias(master_flat, multi_bias, overscans);
@@ -1427,7 +1407,6 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
     dummy = mos_remove_bias(spectra, master_bias, overscans);
     cpl_table_delete(overscans); overscans = NULL;
-    cpl_image_delete(master_bias); master_bias = NULL;
     cpl_image_delete(spectra); spectra = dummy;
 
     if (spectra == NULL)
@@ -1437,41 +1416,25 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     cpl_msg_info(recipe, "Load input line catalog...");
     cpl_msg_indent_more();
 
-    wavelengths = dfs_load_table(frameset, "MASTER_LINECAT", 1);
-
-    if (wavelengths == NULL)
-        fors_calib_exit("Cannot load line catalog");
-
-
     /*
-     * Cast the wavelengths into a (double precision) CPL vector
+     * Get the reference lines
      */
-
-    nlines = cpl_table_get_nrow(wavelengths);
-
-    if (nlines == 0)
-        fors_calib_exit("Empty input line catalog");
-
-    if (cpl_table_has_column(wavelengths, wcolumn) != 1) {
-        cpl_msg_error(recipe, "Missing column %s in input line catalog table",
-                      wcolumn);
-        fors_calib_exit(NULL);
-    }
-
-    line = cpl_malloc(nlines * sizeof(double));
     
-    for (i = 0; i < nlines; i++)
-        line[i] = cpl_table_get(wavelengths, wcolumn, i, NULL);
-
-    cpl_table_delete(wavelengths); wavelengths = NULL;
-
-    lines = cpl_vector_wrap(nlines, line);
-
+    lines = fors_calib_get_reference_lines(frameset, config.wcolumn, 
+                                           config.ignore_lines);
+    if(lines == NULL)
+        fors_calib_exit("Cannot get reference lines");
+    
 
+    /*
+     * Start actual calibration
+     */
+    
     if (lss || treat_as_lss) {
 
         cpl_size first_row, last_row;
         cpl_size ylow, yhig;
+        cpl_propertylist * wcs_header; 
 
         /* FIXME:
          * The LSS data calibration is still dirty: it doesn't apply
@@ -1481,41 +1444,6 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
          * the preliminary wavelength calibration.
          */
 
-        /*
-         * Flat field normalisation is done directly on the master flat
-         * field (without spatial rectification first). The spectral
-         * curvature model may be provided in input, in future releases.
-         */
-
-        cpl_msg_indent_less();
-        cpl_msg_info(recipe, "Perform LSS flat field normalisation...");
-        cpl_msg_indent_more();
-
-        norm_flat = cpl_image_duplicate(master_flat);
-
-        smo_flat = mos_normalise_longflat(norm_flat, sradius, dradius,
-                                          sdegree);
-
-        cpl_image_delete(smo_flat); smo_flat = NULL; /* It may be a product */
-
-        if (1) {
-            save_header = dfs_load_header(frameset, flat_tag, 0);
-            cpl_propertylist_update_int(save_header, 
-                                        "ESO PRO DATANCOM", nflats);
-
-            if (dfs_save_image(frameset, master_flat, master_screen_flat_tag,
-                               save_header, parlist, recipe, version))
-                fors_calib_exit(NULL);
-//%%%%%            cpl_image_delete(master_flat); master_flat = NULL;
-        }
-
-        if (dfs_save_image(frameset, norm_flat, master_norm_flat_tag,
-                           save_header, parlist, recipe, version))
-            fors_calib_exit(NULL);
-
-        cpl_propertylist_delete(save_header); save_header = NULL;
-//%%%%%        cpl_image_delete(norm_flat); norm_flat = NULL;
-
 
         /*
          * In the case of LSS data, extract the spectra directly
@@ -1539,13 +1467,13 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
 	if (mos_subtract_background(spectra))
 	    fors_calib_exit("Cannot subtract the background");
 
-        rectified = mos_wavelength_calibration_raw(spectra, lines, dispersion,
-                                                   peakdetection, wradius,
-                                                   wdegree, wreject, reference,
-                                                   &startwavelength,
-                                                   &endwavelength, NULL,
+        rectified = mos_wavelength_calibration_raw(spectra, lines, config.dispersion,
+                                                   config.peakdetection, config.wradius,
+                                                   config.wdegree, config.wreject, reference,
+                                                   &config.startwavelength,
+                                                   &config.endwavelength, NULL,
                                                    NULL, idscoeff_all, wavemap,
-                                                   NULL, NULL, NULL);
+                                                   NULL, NULL, NULL, NULL);
 
         if (rectified == NULL)
             fors_calib_exit("Wavelength calibration failure.");
@@ -1582,11 +1510,10 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
         ccd_ysize = (int)ny;
         ny = cpl_image_get_size_y(spectra);
 
-        if (check)
-            residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
+        residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
 
-        fiterror = cpl_calloc(ny, sizeof(double));
-        fitlines = cpl_calloc(ny, sizeof(int));
+        fiterror = static_cast<double *>(cpl_calloc(ny, sizeof(double)));
+        fitlines = static_cast<int *>(cpl_calloc(ny, sizeof(int)));
         idscoeff = cpl_table_new(ny);
         restable = cpl_table_new(nlines);
 
@@ -1596,13 +1523,22 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
 	if (mos_subtract_background(spectra))
 	    fors_calib_exit("Cannot subtract the background");
 
-        rectified = mos_wavelength_calibration_raw(spectra, lines, dispersion,
-                                                   peakdetection, wradius,
-                                                   wdegree, wreject, reference,
-                                                   &startwavelength, 
-                                                   &endwavelength, fitlines, 
+       //Table with positions of the detected lines used for wavelength calibration
+       cpl_table * detected_lines = cpl_table_new(1);
+
+       rectified = mos_wavelength_calibration_raw(spectra, lines, config.dispersion,
+                                                   config.peakdetection, config.wradius,
+                                                   config.wdegree, config.wradius, reference,
+                                                   &config.startwavelength, 
+                                                   &config.endwavelength, fitlines, 
                                                    fiterror, idscoeff, NULL,
-                                                   residual, restable, NULL);
+                                                   residual, restable, NULL,
+                                                   detected_lines);
+
+       fors_dfs_save_table(frameset, detected_lines, detected_lines_tag, NULL,
+                           parlist, recipe, ref_arc_frame);
+       if(cpl_error_get_code() != CPL_ERROR_NONE)
+           fors_calib_exit(NULL);
 
         if (rectified == NULL)
             fors_calib_exit("Wavelength calibration failure.");
@@ -1636,28 +1572,30 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
         cpl_table_set_int(slits, "position", 0, 0);
         cpl_table_set_int(slits, "length", 0, (int)ny);
 
-        if (dfs_save_table(frameset, slits, slit_location_tag, NULL,
-                           parlist, recipe, version))
+        fors_dfs_save_table(frameset, slits, slit_location_tag, NULL,
+                            parlist, recipe, ref_flat_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
             fors_calib_exit(NULL);
 
         cpl_table_delete(slits); slits = NULL;
 
-        if (dfs_save_table(frameset, restable, disp_residuals_table_tag, NULL,
-                           parlist, recipe, version))
+        fors_dfs_save_table(frameset, restable, disp_residuals_table_tag, NULL,
+                            parlist, recipe, ref_arc_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
             fors_calib_exit(NULL);
 
         cpl_table_delete(restable); restable = NULL;
 
-        if (wmode) {
+        if (config.wmode) {
             cpl_image_delete(rectified); rectified = NULL;
             cpl_image_delete(wavemap); wavemap = NULL;
-            mos_interpolate_wavecalib(idscoeff, wavemap, wmode, 2);
-            mos_interpolate_wavecalib(idscoeff_all, wavemap, wmode, 2);
+            mos_interpolate_wavecalib(idscoeff, wavemap, config.wmode, 2);
+            mos_interpolate_wavecalib(idscoeff_all, wavemap, config.wmode, 2);
             wavemap = mos_map_idscoeff(idscoeff_all, nx, reference,
-                                       startwavelength, endwavelength);
+                                       config.startwavelength, config.endwavelength);
             rectified = mos_wavelength_calibration(spectra, reference,
-                                                   startwavelength, 
-                                                   endwavelength, dispersion, 
+                                                   config.startwavelength, 
+                                                   config.endwavelength, config.dispersion, 
                                                    idscoeff, 0);
         }
 
@@ -1671,80 +1609,50 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
             if (!cpl_table_is_valid(idscoeff, "c0", i))
                 cpl_table_set_invalid(idscoeff, "error", i);
 
-        delta = mos_map_pixel(idscoeff, reference, startwavelength,
-                              endwavelength, dispersion, 2);
+        delta = mos_map_pixel(idscoeff, reference, config.startwavelength,
+                              config.endwavelength, config.dispersion, 2);
 
 //%%%%%
-        dummy = cpl_image_extract(master_flat, 1, ylow, nx, yhig);
-        cpl_image_delete(master_flat); master_flat = dummy;
+        wcs_header = cpl_propertylist_new();
+        cpl_propertylist_update_double(wcs_header, "CRPIX1", 1.0);
+        cpl_propertylist_update_double(wcs_header, "CRPIX2", 1.0);
+        cpl_propertylist_update_double(wcs_header, "CRVAL1",
+                                       config.startwavelength + config.dispersion/2);
+        cpl_propertylist_update_double(wcs_header, "CRVAL2", 1.0);
+        /* cpl_propertylist_update_double(header, "CDELT1", config.dispersion);
+        cpl_propertylist_update_double(header, "CDELT2", 1.0); */
+        cpl_propertylist_update_double(wcs_header, "CD1_1", config.dispersion);
+        cpl_propertylist_update_double(wcs_header, "CD1_2", 0.0);
+        cpl_propertylist_update_double(wcs_header, "CD2_1", 0.0);
+        cpl_propertylist_update_double(wcs_header, "CD2_2", 1.0);
+        cpl_propertylist_update_string(wcs_header, "CTYPE1", "LINEAR");
+        cpl_propertylist_update_string(wcs_header, "CTYPE2", "PIXEL");
+
+        fors_dfs_save_image(frameset, delta, delta_image_tag,
+                            wcs_header, parlist, recipe, ref_arc_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
+            fors_calib_exit(NULL);
 
-        mapped_flat = mos_wavelength_calibration(master_flat, reference,
-                                      startwavelength, endwavelength,
-                                      dispersion, idscoeff, 0);
+        cpl_image_delete(delta); delta = NULL;
 
-        cpl_image_delete(master_flat); master_flat = NULL;
+        cpl_msg_info(recipe, "Valid solutions found: %"CPL_SIZE_FORMAT
+                     " out of %"CPL_SIZE_FORMAT" rows", 
+                     ny - cpl_table_count_invalid(idscoeff, "c0"), ny);
 
-        dummy = cpl_image_extract(norm_flat, 1, ylow, nx, yhig);
-        cpl_image_delete(norm_flat); norm_flat = dummy;
+        cpl_image_delete(spectra); spectra = NULL;
 
-        mapped_nflat = mos_wavelength_calibration(norm_flat, reference,
-                                      startwavelength, endwavelength,
-                                      dispersion, idscoeff, 0);
+        mean_rms = mos_distortions_rms(rectified, lines, config.startwavelength,
+                                       config.dispersion, 6, 0);
 
-        cpl_image_delete(norm_flat); norm_flat = NULL;
-
-        header = cpl_propertylist_new();
-        cpl_propertylist_update_double(header, "CRPIX1", 1.0);
-        cpl_propertylist_update_double(header, "CRPIX2", 1.0);
-        cpl_propertylist_update_double(header, "CRVAL1",
-                                       startwavelength + dispersion/2);
-        cpl_propertylist_update_double(header, "CRVAL2", 1.0);
-        /* cpl_propertylist_update_double(header, "CDELT1", dispersion);
-        cpl_propertylist_update_double(header, "CDELT2", 1.0); */
-        cpl_propertylist_update_double(header, "CD1_1", dispersion);
-        cpl_propertylist_update_double(header, "CD1_2", 0.0);
-        cpl_propertylist_update_double(header, "CD2_1", 0.0);
-        cpl_propertylist_update_double(header, "CD2_2", 1.0);
-        cpl_propertylist_update_string(header, "CTYPE1", "LINEAR");
-        cpl_propertylist_update_string(header, "CTYPE2", "PIXEL");
-
-        if (dfs_save_image(frameset, delta, delta_image_tag,
-                           header, parlist, recipe, version))
-            fors_calib_exit(NULL);
-
-        cpl_image_delete(delta); delta = NULL;
-
-        if (dfs_save_image(frameset, mapped_flat, mapped_screen_flat_tag,
-                           header, parlist, recipe, version))
-            fors_calib_exit(NULL);
-
-        cpl_image_delete(mapped_flat); mapped_flat = NULL;
-
-        if (dfs_save_image(frameset, mapped_nflat, mapped_norm_flat_tag,
-                           header, parlist, recipe, version))
-            fors_calib_exit(NULL);
-
-        cpl_image_delete(mapped_nflat); mapped_nflat = NULL;
-
-        cpl_propertylist_delete(header); header = NULL;
-
-        cpl_msg_info(recipe, "Valid solutions found: %"CPL_SIZE_FORMAT" out of %"CPL_SIZE_FORMAT" rows", 
-                     ny - cpl_table_count_invalid(idscoeff, "c0"), ny);
-
-        cpl_image_delete(spectra); spectra = NULL;
-
-        mean_rms = mos_distortions_rms(rectified, lines, startwavelength,
-                                       dispersion, 6, 0);
-
-        cpl_msg_info(recipe, "Mean residual: %f pixel", mean_rms);
+        cpl_msg_info(recipe, "Mean residual: %f pixel", mean_rms);
 
         mean_rms = cpl_table_get_column_mean(idscoeff, "error");
         mean_rms_err = cpl_table_get_column_stdev(idscoeff, "error");
 
         cpl_msg_info(recipe, "Mean model accuracy: %f pixel (%f A)",
-                     mean_rms, mean_rms * dispersion);
+                     mean_rms, mean_rms * config.dispersion);
 
-        restab = mos_resolution_table(rectified, startwavelength, dispersion,
+        restab = mos_resolution_table(rectified, config.startwavelength, config.dispersion,
                                       60000, lines);
 
         if (restab) {
@@ -1752,114 +1660,109 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
                   cpl_table_get_column_mean(restab, "resolution"));
             cpl_msg_info(recipe, 
                   "Mean reference lines FWHM: %.2f +/- %.2f pixel",
-                  cpl_table_get_column_mean(restab, "fwhm") / dispersion,
-                  cpl_table_get_column_mean(restab, "fwhm_rms") / dispersion);
+                  cpl_table_get_column_mean(restab, "fwhm") / config.dispersion,
+                  cpl_table_get_column_mean(restab, "fwhm_rms") / config.dispersion);
+
+            header = dfs_load_header(frameset, arc_tag, 0);
 
-            if (qc) {
+            if (header == NULL)
+                fors_calib_exit("Cannot reload arc lamp header");
 
-                header = dfs_load_header(frameset, arc_tag, 0);
+            qclist = cpl_propertylist_new();
 
-                if (header == NULL)
-                    fors_calib_exit("Cannot reload arc lamp header");
 
-                qclist = cpl_propertylist_new();
+            /*
+             * QC1 parameters
+             */
+            keyname = "QC.DID";
 
+            if (fors_header_write_string(qclist,
+                    keyname,
+                    "2.0",
+                    "QC1 dictionary")) {
+                fors_calib_exit("Cannot write dictionary version "
+                        "to QC log file");
+            }
 
-                /*
-                 * QC1 parameters
-                 */
-                keyname = "QC.DID";
+            if (mos)
+                keyname = "QC.MOS.RESOLUTION";
+            else
+                keyname = "QC.LSS.RESOLUTION";
 
-                if (fors_header_write_string(qclist,
-                                             keyname,
-                                             "2.0",
-                                             "QC1 dictionary")) {
-                    fors_calib_exit("Cannot write dictionary version "
-                                    "to QC log file");
-                }
-   
-                if (mos)
-                    keyname = "QC.MOS.RESOLUTION";
-                else
-                    keyname = "QC.LSS.RESOLUTION";
-
-                if (fors_header_write_double(qclist, 
-                                           cpl_table_get_column_mean(restab,
-                                                                 "resolution"),
-                                           keyname, NULL, 
-                                           "Mean spectral resolution")) {
-                    fors_calib_exit("Cannot write mean spectral resolution to "
-                                    "QC log file");
-                }
+            if (fors_header_write_double(qclist, 
+                    cpl_table_get_column_mean(restab,
+                            "resolution"),
+                            keyname, NULL, 
+                            "Mean spectral resolution")) {
+                fors_calib_exit("Cannot write mean spectral resolution to "
+                        "QC log file");
+            }
 
-                if (mos)
-                    keyname = "QC.MOS.RESOLUTION.RMS"; 
-                else
-                    keyname = "QC.LSS.RESOLUTION.RMS";
-
-                if (fors_header_write_double(qclist,
-                                           cpl_table_get_column_stdev(restab,
-                                                                "resolution"),
-                                           keyname, NULL, 
-                                           "Scatter of spectral resolution")) {
-                    fors_calib_exit("Cannot write spectral resolution scatter "
-                                    "to QC log file");
-                }
+            if (mos)
+                keyname = "QC.MOS.RESOLUTION.RMS"; 
+            else
+                keyname = "QC.LSS.RESOLUTION.RMS";
 
-                if (mos)
-                    keyname = "QC.MOS.RESOLUTION.NWAVE";
-                else
-                    keyname = "QC.LSS.RESOLUTION.NWAVE";
-
-                if (fors_header_write_int(qclist, cpl_table_get_nrow(restab) -
-                                        cpl_table_count_invalid(restab,
-                                                                "resolution"),
-                                        keyname, NULL,
-                                        "Number of examined wavelengths "
-                                        "for resolution computation")) {
-                    fors_calib_exit("Cannot write number of lines used in "
-                                    "spectral resolution computation "
-                                    "to QC log file");
-                }
+            if (fors_header_write_double(qclist,
+                    cpl_table_get_column_stdev(restab,
+                            "resolution"),
+                            keyname, NULL, 
+                            "Scatter of spectral resolution")) {
+                fors_calib_exit("Cannot write spectral resolution scatter "
+                        "to QC log file");
+            }
 
-                if (mos)
-                    keyname = "QC.MOS.RESOLUTION.MEANRMS";
-                else
-                    keyname = "QC.LSS.RESOLUTION.MEANRMS";
-
-                if (fors_header_write_double(qclist, 
-                                           cpl_table_get_column_mean(restab,
-                                                         "resolution_rms"),
-                                        keyname, NULL,
-                                        "Mean error on spectral "
-                                        "resolution computation")) {
-                    fors_calib_exit("Cannot write mean error in "
-                                    "spectral resolution computation "
-                                    "to QC log file");
-                }
+            if (mos)
+                keyname = "QC.MOS.RESOLUTION.NWAVE";
+            else
+                keyname = "QC.LSS.RESOLUTION.NWAVE";
 
-                if (mos)
-                    keyname = "QC.MOS.RESOLUTION.NLINES";
-                else
-                    keyname = "QC.LSS.RESOLUTION.NLINES";
-
-                if (fors_header_write_int(qclist, 
-                         cpl_table_get_column_mean(restab, "nlines") *
-                                           cpl_table_get_nrow(restab),
-                                        keyname, NULL,
-                                        "Number of lines for spectral "
-                                        "resolution computation")) {
-                    fors_calib_exit("Cannot write number of examined "
-                         "wavelengths in spectral resolution computation "
-                         "to QC log file");
-                }
+            if (fors_header_write_int(qclist, cpl_table_get_nrow(restab) -
+                    cpl_table_count_invalid(restab,
+                            "resolution"),
+                            keyname, NULL,
+                            "Number of examined wavelengths "
+                            "for resolution computation")) {
+                fors_calib_exit("Cannot write number of lines used in "
+                        "spectral resolution computation "
+                        "to QC log file");
+            }
+
+            if (mos)
+                keyname = "QC.MOS.RESOLUTION.MEANRMS";
+            else
+                keyname = "QC.LSS.RESOLUTION.MEANRMS";
 
-//                fors_qc_end_group();
+            if (fors_header_write_double(qclist, 
+                    cpl_table_get_column_mean(restab,
+                            "resolution_rms"),
+                            keyname, NULL,
+                            "Mean error on spectral "
+                            "resolution computation")) {
+                fors_calib_exit("Cannot write mean error in "
+                        "spectral resolution computation "
+                        "to QC log file");
+            }
 
-            }  /* End of QC1 computation */
+            if (mos)
+                keyname = "QC.MOS.RESOLUTION.NLINES";
+            else
+                keyname = "QC.LSS.RESOLUTION.NLINES";
+
+            if (fors_header_write_int(qclist, 
+                    cpl_table_get_column_mean(restab, "nlines") *
+                    cpl_table_get_nrow(restab),
+                    keyname, NULL,
+                    "Number of lines for spectral "
+                    "resolution computation")) {
+                fors_calib_exit("Cannot write number of examined "
+                        "wavelengths in spectral resolution computation "
+                        "to QC log file");
+            }
 
-            if (dfs_save_table(frameset, restab, spectral_resolution_tag, 
-                               qclist, parlist, recipe, version))
+            fors_dfs_save_table(frameset, restab, spectral_resolution_tag, 
+                                qclist, parlist, recipe, ref_arc_frame);
+            if(cpl_error_get_code() != CPL_ERROR_NONE)
                 fors_calib_exit(NULL);
 
             cpl_table_delete(restab); restab = NULL;
@@ -1880,11 +1783,11 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
         cpl_propertylist_update_double(header, "CRPIX1", 1.0);
         cpl_propertylist_update_double(header, "CRPIX2", 1.0);
         cpl_propertylist_update_double(header, "CRVAL1", 
-                                       startwavelength + dispersion/2);
+                                       config.startwavelength + config.dispersion/2);
         cpl_propertylist_update_double(header, "CRVAL2", 1.0);
-        /* cpl_propertylist_update_double(header, "CDELT1", dispersion);
+        /* cpl_propertylist_update_double(header, "CDELT1", config.dispersion);
         cpl_propertylist_update_double(header, "CDELT2", 1.0); */
-        cpl_propertylist_update_double(header, "CD1_1", dispersion);
+        cpl_propertylist_update_double(header, "CD1_1", config.dispersion);
         cpl_propertylist_update_double(header, "CD1_2", 0.0);
         cpl_propertylist_update_double(header, "CD2_1", 0.0);
         cpl_propertylist_update_double(header, "CD2_2", 1.0);
@@ -1892,125 +1795,198 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
         cpl_propertylist_update_string(header, "CTYPE2", "PIXEL");
         cpl_propertylist_update_int(header, "ESO PRO DATANCOM", 1);
 
-        if (dfs_save_image(frameset, rectified, reduced_lamp_tag, header, 
-                           parlist, recipe, version))
+        fors_dfs_save_image(frameset, rectified, reduced_lamp_tag, header, 
+                            parlist, recipe, ref_arc_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
             fors_calib_exit(NULL);
 
         cpl_image_delete(rectified); rectified = NULL;
         cpl_propertylist_delete(header); header = NULL;
 
-        if (dfs_save_table(frameset, idscoeff, disp_coeff_tag, NULL, 
-                           parlist, recipe, version))
+        fors_dfs_save_table(frameset, idscoeff, disp_coeff_tag, NULL, 
+                            parlist, recipe, ref_arc_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
             fors_calib_exit(NULL);
 
-        cpl_table_delete(idscoeff); idscoeff = NULL;
-
         header = dfs_load_header(frameset, arc_tag, 0);
 
         if (header == NULL)
             fors_calib_exit("Cannot reload arc lamp header");
 
-        if (qc) {
-
-            compute_central_wave = 0;
-            if (lss) {
-/***
+        compute_central_wave = 0;
+        if (lss) {
+            /***
                 if (fabs(1.0 - cpl_propertylist_get_double(header,
                                              "ESO INS SLIT WID")) < 0.05)
- ***/
+             ***/
+            compute_central_wave = 1;
+        }
+        else {
+            if (fabs(mxpos) < 0.05)
                 compute_central_wave = 1;
-            }
-            else {
-                if (fabs(mxpos) < 0.05)
-                    compute_central_wave = 1;
-            }
+        }
 
-            /*
-             * QC1 parameters
-             */
-            keyname = "QC.DID";
+        /*
+         * QC1 parameters
+         */
+        keyname = "QC.DID";
 
-            if (fors_header_write_string(header,
-                                         keyname,
-                                         "2.0",
-                                         "QC1 dictionary")) {
-                fors_calib_exit("Cannot write dictionary version "
-                                "to QC log file");
-            }
+        if (fors_header_write_string(header,
+                keyname,
+                "2.0",
+                "QC1 dictionary")) {
+            fors_calib_exit("Cannot write dictionary version "
+                    "to QC log file");
+        }
 
-            if (fors_header_write_double(header,
-                                       mean_rms,
-                                       "QC.WAVE.ACCURACY",
-                                       "pixel",
-                                       "Mean accuracy of wavecalib model")) {
-                fors_calib_exit("Cannot write mean wavelength calibration "
-                                "accuracy to QC log file");
-            }
+        if (fors_header_write_double(header,
+                mean_rms,
+                "QC.WAVE.ACCURACY",
+                "pixel",
+                "Mean accuracy of wavecalib model")) {
+            fors_calib_exit("Cannot write mean wavelength calibration "
+                    "accuracy to QC log file");
+        }
 
-            if (fors_header_write_double(header,
-                                       mean_rms_err,
-                                       "QC.WAVE.ACCURACY.ERROR",
-                                       "pixel",
-                                       "Error on accuracy of wavecalib model")) {
-                fors_calib_exit("Cannot write error on wavelength calibration "
-                                "accuracy to QC log file");
-            }
+        if (fors_header_write_double(header,
+                mean_rms_err,
+                "QC.WAVE.ACCURACY.ERROR",
+                "pixel",
+                "Error on accuracy of wavecalib model")) {
+            fors_calib_exit("Cannot write error on wavelength calibration "
+                    "accuracy to QC log file");
+        }
 
-            if (compute_central_wave) {
+        if (compute_central_wave) {
 
-                data = cpl_image_get_data(wavemap);
-    
-                if (lss) {
-                    if (fors_header_write_double(header, 
-                                               data[nx/2 + ccd_ysize*nx/2],
-                                               "QC.LSS.CENTRAL.WAVELENGTH",
-                                               "Angstrom", 
-                                               "Wavelength at CCD center")) {
-                        fors_calib_exit("Cannot write central wavelength to QC "
-                                        "log file");
-                    }
+            data = cpl_image_get_data_float(wavemap);
+
+            if (lss) {
+                if (fors_header_write_double(header, 
+                        data[nx/2 + ccd_ysize*nx/2],
+                        "QC.LSS.CENTRAL.WAVELENGTH",
+                        "Angstrom", 
+                        "Wavelength at CCD center")) {
+                    fors_calib_exit("Cannot write central wavelength to QC "
+                            "log file");
                 }
-                else {
-                    if (fors_header_write_double(header, 
-                                               data[nx/2 + ccd_ysize*nx/2],
-                                               "QC.MOS.CENTRAL.WAVELENGTH",
-                                               "Angstrom", 
-                                               "Wavelength at CCD center")) {
-                        fors_calib_exit("Cannot write central wavelength to QC "
-                                        "log file");
-                    }
+            }
+            else {
+                if (fors_header_write_double(header, 
+                        data[nx/2 + ccd_ysize*nx/2],
+                        "QC.MOS.CENTRAL.WAVELENGTH",
+                        "Angstrom", 
+                        "Wavelength at CCD center")) {
+                    fors_calib_exit("Cannot write central wavelength to QC "
+                            "log file");
                 }
             }
         }
 
-        if (dfs_save_image(frameset, wavemap, wavelength_map_tag, header,
-                           parlist, recipe, version))
+        fors_dfs_save_image(frameset, wavemap, wavelength_map_tag, header,
+                            parlist, recipe, ref_arc_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
             fors_calib_exit(NULL);
 
         cpl_image_delete(wavemap); wavemap = NULL;
 
         cpl_propertylist_erase_regexp(header, "^ESO QC ", 0);
 
-        if (check) {
-            cpl_propertylist_update_double(header, "CRPIX2", 1.0);
-            cpl_propertylist_update_double(header, "CRVAL2", 1.0);
-            /* cpl_propertylist_update_double(header, "CDELT2", 1.0); */
-            cpl_propertylist_update_double(header, "CD1_1", 1.0);
-            cpl_propertylist_update_double(header, "CD1_2", 0.0);
-            cpl_propertylist_update_double(header, "CD2_1", 0.0);
-            cpl_propertylist_update_double(header, "CD2_2", 1.0);
-            cpl_propertylist_update_string(header, "CTYPE1", "LINEAR");
-            cpl_propertylist_update_string(header, "CTYPE2", "PIXEL");
-
-            if (dfs_save_image(frameset, residual, disp_residuals_tag, header,
-                               parlist, recipe, version))
-                fors_calib_exit(NULL);
+        cpl_propertylist_update_double(header, "CRPIX2", 1.0);
+        cpl_propertylist_update_double(header, "CRVAL2", 1.0);
+        /* cpl_propertylist_update_double(header, "CDELT2", 1.0); */
+        cpl_propertylist_update_double(header, "CD1_1", 1.0);
+        cpl_propertylist_update_double(header, "CD1_2", 0.0);
+        cpl_propertylist_update_double(header, "CD2_1", 0.0);
+        cpl_propertylist_update_double(header, "CD2_2", 1.0);
+        cpl_propertylist_update_string(header, "CTYPE1", "LINEAR");
+        cpl_propertylist_update_string(header, "CTYPE2", "PIXEL");
 
-            cpl_image_delete(residual); residual = NULL;
-        }
+        fors_dfs_save_image(frameset, residual, disp_residuals_tag, header,
+                            parlist, recipe, ref_arc_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
+            fors_calib_exit(NULL);
+
+        cpl_image_delete(residual); residual = NULL;
 
         cpl_propertylist_delete(header); header = NULL;
-        cpl_free(instrume); instrume = NULL;
+        
+        /*
+         * Flat field normalisation is done directly on the master flat
+         * field (without spatial rectification first). The spectral
+         * curvature model may be provided in input, in future releases.
+         */
+
+        cpl_msg_indent_less();
+        cpl_msg_info(recipe, "Perform LSS flat field normalisation...");
+        cpl_msg_indent_more();
+
+        norm_flat = cpl_image_duplicate(master_flat);
+
+        smo_flat = mos_lssflat_normalise(norm_flat, 
+                                         config.sradius, config.dradius, 
+                                         config.spa_nknots, config.disp_nknots,
+                                         config.splfit_threshold);
+
+        cpl_image_delete(smo_flat); smo_flat = NULL; /* It may be a product */
+
+        if (1) {
+            save_header = dfs_load_header(frameset, flat_tag, 0);
+            cpl_propertylist_update_int(save_header, 
+                                        "ESO PRO DATANCOM", nflats);
+
+            fors_dfs_save_image(frameset, master_flat, master_screen_flat_tag,
+                               save_header, parlist, recipe, ref_flat_frame);
+            if(cpl_error_get_code() != CPL_ERROR_NONE)
+                fors_calib_exit(NULL);
+        }
+
+        fors_dfs_save_image(frameset, norm_flat, master_norm_flat_tag,
+                            save_header, parlist, recipe, ref_flat_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
+            fors_calib_exit(NULL);
+
+        dummy = cpl_image_extract(master_flat, 1, ylow, nx, yhig);
+        cpl_image_delete(master_flat); master_flat = dummy;
+
+        mapped_flat = mos_wavelength_calibration(master_flat, reference,
+                                      config.startwavelength, config.endwavelength,
+                                      config.dispersion, idscoeff, 0);
+
+
+        dummy = cpl_image_extract(norm_flat, 1, ylow, nx, yhig);
+        cpl_image_delete(norm_flat); norm_flat = dummy;
+
+        mapped_nflat = mos_wavelength_calibration(norm_flat, reference,
+                                      config.startwavelength, config.endwavelength,
+                                      config.dispersion, idscoeff, 0);
+
+
+        fors_dfs_save_image(frameset, mapped_flat, mapped_screen_flat_tag,
+                            wcs_header, parlist, recipe, ref_flat_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
+            fors_calib_exit(NULL);
+
+        cpl_image_delete(mapped_flat); mapped_flat = NULL;
+
+        fors_dfs_save_image(frameset, mapped_nflat, mapped_norm_flat_tag,
+                            wcs_header, parlist, recipe, ref_flat_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
+            fors_calib_exit(NULL);
+
+        cpl_image_delete(mapped_nflat); mapped_nflat = NULL;
+
+        cpl_propertylist_delete(wcs_header); header = NULL;
+
+        cpl_image_delete(norm_flat); norm_flat = NULL;
+        cpl_image_delete(master_flat); master_flat = NULL;
+
+        cpl_table_delete(idscoeff); idscoeff = NULL;
+        
+        cpl_propertylist_delete(save_header); save_header = NULL;
+//%%%%%        cpl_image_delete(norm_flat); norm_flat = NULL;
+
+
 
         return 0;         /* Successful LSS data reduction */
 
@@ -2040,12 +2016,12 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     if (mos_subtract_background(spectra))
 	fors_calib_exit("Cannot subtract the background");
  
-    checkwave = mos_wavelength_calibration_raw(spectra, lines, dispersion, 
-                                               peakdetection, wradius, 
-                                               wdegree, wreject, reference,
-                                               &startwavelength, &endwavelength,
+    checkwave = mos_wavelength_calibration_raw(spectra, lines, config.dispersion, 
+                                               config.peakdetection, config.wradius, 
+                                               config.wdegree, config.wradius, reference,
+                                               &config.startwavelength, &config.endwavelength,
                                                NULL, NULL, NULL, NULL, NULL, 
-                                               NULL, refmask);
+                                               NULL, refmask, NULL);
 
     if (checkwave == NULL)
         fors_calib_exit("Wavelength calibration failure.");
@@ -2058,22 +2034,21 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     cpl_propertylist_update_double(header, "CRPIX1", 1.0);
     cpl_propertylist_update_double(header, "CRPIX2", 1.0);
     cpl_propertylist_update_double(header, "CRVAL1", 
-                                   startwavelength + dispersion/2);
+                                   config.startwavelength + config.dispersion/2);
     cpl_propertylist_update_double(header, "CRVAL2", 1.0);
-    /* cpl_propertylist_update_double(header, "CDELT1", dispersion);
+    /* cpl_propertylist_update_double(header, "CDELT1", config.dispersion);
     cpl_propertylist_update_double(header, "CDELT2", 1.0); */
-    cpl_propertylist_update_double(header, "CD1_1", dispersion);
+    cpl_propertylist_update_double(header, "CD1_1", config.dispersion);
     cpl_propertylist_update_double(header, "CD1_2", 0.0);
     cpl_propertylist_update_double(header, "CD2_1", 0.0);
     cpl_propertylist_update_double(header, "CD2_2", 1.0);
     cpl_propertylist_update_string(header, "CTYPE1", "LINEAR");
     cpl_propertylist_update_string(header, "CTYPE2", "PIXEL");
 
-    if (check) {
-        if (dfs_save_image(frameset, checkwave, spectra_detection_tag, header, 
-                           parlist, recipe, version))
-            fors_calib_exit(NULL);
-    }
+    fors_dfs_save_image(frameset, checkwave, spectra_detection_tag, header, 
+                        parlist, recipe, ref_flat_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
+        fors_calib_exit(NULL);
 
     cpl_image_delete(checkwave); checkwave = NULL;
     cpl_propertylist_delete(header); header = NULL;
@@ -2082,24 +2057,25 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     slits = mos_locate_spectra(refmask);
 
     if (!slits) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         fors_calib_exit("No slits could be detected!");
     }
 
     refimage = cpl_image_new_from_mask(refmask);
     cpl_mask_delete(refmask); refmask = NULL;
 
-    if (check) {
-        save_header = dfs_load_header(frameset, arc_tag, 0);
-        if (dfs_save_image(frameset, refimage, slit_map_tag, save_header,
-                           parlist, recipe, version))
-            fors_calib_exit(NULL);
-        cpl_propertylist_delete(save_header); save_header = NULL;
-    }
+    save_header = dfs_load_header(frameset, arc_tag, 0);
+    fors_dfs_save_image(frameset, refimage, slit_map_tag, save_header,
+                        parlist, recipe, ref_flat_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
+        fors_calib_exit(NULL);
+
+    cpl_propertylist_delete(save_header); save_header = NULL;
 
     cpl_image_delete(refimage); refimage = NULL;
 
-    if (slit_ident) {
+    if (config.slit_ident) {
 
         /*
          * Attempt slit identification: this recipe may continue even
@@ -2145,7 +2121,7 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
         }
         else {
-            slit_ident = 0;
+            config.slit_ident = 0;
             cpl_msg_info(recipe, "Global distortion model cannot be computed");
             if (cpl_error_get_code() != CPL_ERROR_NONE) {
                 fors_calib_exit(NULL);
@@ -2164,7 +2140,7 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
     cpl_msg_info(recipe, "Tracing master flat field spectra edges...");
     traces = mos_trace_flat(trace_flat, slits, reference, 
-                            startwavelength, endwavelength, dispersion);
+                            config.startwavelength, config.endwavelength, config.dispersion);
 
     if (!traces)
         fors_calib_exit("Tracing failure");
@@ -2172,74 +2148,32 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     cpl_image_delete(added_flat); added_flat = NULL;
 
     cpl_msg_info(recipe, "Fitting flat field spectra edges...");
-    polytraces = mos_poly_trace(slits, traces, cdegree);
+    polytraces = mos_poly_trace(slits, traces, config.cdegree);
 
     if (!polytraces)
         fors_calib_exit("Trace fitting failure");
 
-    if (cmode) {
+    if (config.cmode) {
         cpl_msg_info(recipe, "Computing global spectral curvature model...");
-        mos_global_trace(slits, polytraces, cmode);
+        mos_global_trace(slits, polytraces, config.cmode);
     }
 
-    if (dfs_save_table(frameset, traces, curv_traces_tag, NULL, parlist,
-                       recipe, version))
+    fors_dfs_save_table(frameset, traces, curv_traces_tag, NULL, parlist,
+                        recipe, ref_flat_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
         fors_calib_exit(NULL);
 
     cpl_table_delete(traces); traces = NULL;
 
     coordinate = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
     spatial = mos_spatial_calibration(spectra, slits, polytraces, reference, 
-                                      startwavelength, endwavelength, 
-                                      dispersion, 0, coordinate);
+                                      config.startwavelength, config.endwavelength, 
+                                      config.dispersion, 0, coordinate);
 
-    if (!slit_ident) {
+    if (!config.slit_ident) {
         cpl_image_delete(spectra); spectra = NULL;
     }
 
-    /*
-     * Flat field normalisation is done directly on the master flat
-     * field (without spatial rectification first). The spectral
-     * curvature model may be provided in input, in future releases.
-     */
-
-    cpl_msg_indent_less();
-    cpl_msg_info(recipe, "Perform flat field normalisation...");
-    cpl_msg_indent_more();
-
-    norm_flat = cpl_image_duplicate(master_flat);
-
-    smo_flat = mos_normalise_flat(norm_flat, coordinate, slits, polytraces, 
-                                  reference, startwavelength, endwavelength,
-                                  dispersion, dradius, ddegree);
-
-    cpl_image_delete(smo_flat); smo_flat = NULL;  /* It may be a product */
-
- 
-    save_header = dfs_load_header(frameset, flat_tag, 0);
-    cpl_propertylist_update_int(save_header, "ESO PRO DATANCOM", nflats);
-//%%%
-    rect_flat = mos_spatial_calibration(master_flat, slits, polytraces, 
-                                        reference, startwavelength, 
-                                        endwavelength, dispersion, 0, NULL);
-    rect_nflat = mos_spatial_calibration(norm_flat, slits, polytraces, 
-                                        reference, startwavelength, 
-                                        endwavelength, dispersion, 0, NULL);
-//%%%
-
-    if (dfs_save_image(frameset, master_flat, master_screen_flat_tag,
-                       save_header, parlist, recipe, version))
-        fors_calib_exit(NULL);
-
-    cpl_image_delete(master_flat); master_flat = NULL;
-
-    if (dfs_save_image(frameset, norm_flat, master_norm_flat_tag,
-                       save_header, parlist, recipe, version))
-        fors_calib_exit(NULL);
-
-    cpl_image_delete(norm_flat); norm_flat = NULL;
-    cpl_propertylist_delete(save_header); save_header = NULL;
-
 
     /*
      * Final wavelength calibration of spectra having their curvature
@@ -2256,28 +2190,42 @@ static int fors_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     idscoeff = cpl_table_new(ny);
     restable = cpl_table_new(nlines);
     rainbow = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-    if (check)
-        residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
-    fiterror = cpl_calloc(ny, sizeof(double));
-    fitlines = cpl_calloc(ny, sizeof(int));
+    residual = cpl_image_new(nx, ny, CPL_TYPE_FLOAT);
+    fiterror = static_cast<double*>(cpl_calloc(ny, sizeof(double)));
+    fitlines = static_cast<int*>(cpl_calloc(ny, sizeof(int)));
 
+    //Table with positions of the detected lines used for wavelength calibration
+    cpl_table * detected_lines = cpl_table_new(1);
+    
     rectified = mos_wavelength_calibration_final(spatial, slits, lines, 
-                                                 dispersion, peakdetection, 
-                                                 wradius, wdegree, wreject,
-                                                 reference, &startwavelength, 
-                                                 &endwavelength, fitlines, 
+                                                 config.dispersion, config.peakdetection, 
+                                                 config.wradius, config.wdegree, config.wradius,
+                                                 reference, &config.startwavelength, 
+                                                 &config.endwavelength, fitlines, 
                                                  fiterror, idscoeff, rainbow, 
-                                                 residual, restable);
+                                                 residual, restable, 
+                                                 detected_lines);
+
+    fors_dfs_save_image(frameset, spatial, arc_rectified_tag, header,
+                        parlist, recipe, ref_arc_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
+        fors_calib_exit(NULL);
 
 /*
-dfs_save_image(frameset, rainbow, "rainbow_calib", NULL, parlist, recipe, version);
+fors_dfs_save_image(frameset, rainbow, "rainbow_calib", NULL, parlist, recipe, version);
 */
 
     if (rectified == NULL)
         fors_calib_exit("Wavelength calibration failure.");
 
-    if (dfs_save_table(frameset, restable, disp_residuals_table_tag, NULL,
-                       parlist, recipe, version))
+    fors_dfs_save_table(frameset, restable, disp_residuals_table_tag, NULL,
+                        parlist, recipe, ref_arc_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
+        fors_calib_exit(NULL);
+
+    fors_dfs_save_table(frameset, detected_lines, detected_lines_tag, NULL,
+                        parlist, recipe, ref_arc_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
         fors_calib_exit(NULL);
 
     cpl_table_delete(restable); restable = NULL;
@@ -2290,45 +2238,46 @@ dfs_save_image(frameset, rainbow, "rainbow_calib", NULL, parlist, recipe, versio
         if (!cpl_table_is_valid(idscoeff, "c0", i))
             cpl_table_set_invalid(idscoeff, "error", i);
 
-    if (wmosmode > 0) {
-        mos_interpolate_wavecalib_slit(idscoeff, slits, 1, wmosmode - 1);
+    if (config.wmosmode > 0) {
+        mos_interpolate_wavecalib_slit(idscoeff, slits, 1, config.wmosmode - 1);
 
         cpl_image_delete(rectified);
 
         rectified = mos_wavelength_calibration(spatial, reference,
-                                           startwavelength, endwavelength,
-                                           dispersion, idscoeff, 0);
+                                           config.startwavelength, config.endwavelength,
+                                           config.dispersion, idscoeff, 0);
     }
 
     cpl_image_delete(spatial); spatial = NULL;
 
-    delta = mos_map_pixel(idscoeff, reference, startwavelength,
-                          endwavelength, dispersion, 2);
+    delta = mos_map_pixel(idscoeff, reference, config.startwavelength,
+                          config.endwavelength, config.dispersion, 2);
 
     header = cpl_propertylist_new();
     cpl_propertylist_update_double(header, "CRPIX1", 1.0);
     cpl_propertylist_update_double(header, "CRPIX2", 1.0);
     cpl_propertylist_update_double(header, "CRVAL1",
-                                   startwavelength + dispersion/2);
+                                   config.startwavelength + config.dispersion/2);
     cpl_propertylist_update_double(header, "CRVAL2", 1.0);
-    /* cpl_propertylist_update_double(header, "CDELT1", dispersion);
+    /* cpl_propertylist_update_double(header, "CDELT1", config.dispersion);
     cpl_propertylist_update_double(header, "CDELT2", 1.0); */
-    cpl_propertylist_update_double(header, "CD1_1", dispersion);
+    cpl_propertylist_update_double(header, "CD1_1", config.dispersion);
     cpl_propertylist_update_double(header, "CD1_2", 0.0);
     cpl_propertylist_update_double(header, "CD2_1", 0.0);
     cpl_propertylist_update_double(header, "CD2_2", 1.0);
     cpl_propertylist_update_string(header, "CTYPE1", "LINEAR");
     cpl_propertylist_update_string(header, "CTYPE2", "PIXEL");
 
-    if (dfs_save_image(frameset, delta, delta_image_tag,
-                       header, parlist, recipe, version))
+    fors_dfs_save_image(frameset, delta, delta_image_tag,
+                        header, parlist, recipe, ref_arc_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
         fors_calib_exit(NULL);
 
     cpl_image_delete(delta); delta = NULL;
     cpl_propertylist_delete(header); header = NULL;
 
-    mean_rms = mos_distortions_rms(rectified, lines, startwavelength, 
-                                   dispersion, 6, 0);
+    mean_rms = mos_distortions_rms(rectified, lines, config.startwavelength, 
+                                   config.dispersion, 6, 0);
 
     cpl_msg_info(recipe, "Mean residual: %f pixel", mean_rms);
 
@@ -2336,117 +2285,115 @@ dfs_save_image(frameset, rainbow, "rainbow_calib", NULL, parlist, recipe, versio
     mean_rms_err = cpl_table_get_column_stdev(idscoeff, "error");
 
     cpl_msg_info(recipe, "Mean model accuracy: %f pixel (%f A)", 
-                 mean_rms, mean_rms * dispersion);
+                 mean_rms, mean_rms * config.dispersion);
 
-    restab = mos_resolution_table(rectified, startwavelength, dispersion, 
+    restab = mos_resolution_table(rectified, config.startwavelength, config.dispersion, 
                                   60000, lines);
 
     if (restab) {
         cpl_msg_info(recipe, "Mean spectral resolution: %.2f", 
                    cpl_table_get_column_mean(restab, "resolution"));
         cpl_msg_info(recipe, "Mean reference lines FWHM: %.2f +/- %.2f pixel",
-                   cpl_table_get_column_mean(restab, "fwhm") / dispersion,
-                   cpl_table_get_column_mean(restab, "fwhm_rms") / dispersion);
+                   cpl_table_get_column_mean(restab, "fwhm") / config.dispersion,
+                   cpl_table_get_column_mean(restab, "fwhm_rms") / config.dispersion);
 
-        if (qc) {
-
-            qclist = cpl_propertylist_new();
+        qclist = cpl_propertylist_new();
 
-            /*
-             * QC1 parameters
-             */
-            keyname = "QC.DID";
+        /*
+         * QC1 parameters
+         */
+        keyname = "QC.DID";
 
-            if (fors_header_write_string(qclist,
-                                         keyname,
-                                         "2.0",
-                                         "QC1 dictionary")) {
-                fors_calib_exit("Cannot write dictionary version "
-                                "to QC log file");
-            }
+        if (fors_header_write_string(qclist,
+                keyname,
+                "2.0",
+                "QC1 dictionary")) {
+            fors_calib_exit("Cannot write dictionary version "
+                    "to QC log file");
+        }
 
-            if (mos)
-                keyname = "QC.MOS.RESOLUTION";
-            else
-                keyname = "QC.MXU.RESOLUTION";
+        if (mos)
+            keyname = "QC.MOS.RESOLUTION";
+        else
+            keyname = "QC.MXU.RESOLUTION";
+
+        if (fors_header_write_double(qclist, 
+                cpl_table_get_column_mean(restab,
+                        "resolution"),
+                        keyname,
+                        "Angstrom",
+                        "Mean spectral resolution")) {
+            fors_calib_exit("Cannot write mean spectral resolution to QC "
+                    "log file");
+        }
 
-            if (fors_header_write_double(qclist, 
-                                       cpl_table_get_column_mean(restab,
-                                                                 "resolution"),
-                                       keyname,
-                                       "Angstrom",
-                                       "Mean spectral resolution")) {
-                fors_calib_exit("Cannot write mean spectral resolution to QC "
-                                "log file");
-            }
+        if (mos)
+            keyname = "QC.MOS.RESOLUTION.RMS";
+        else
+            keyname = "QC.MXU.RESOLUTION.RMS";
+
+        if (fors_header_write_double(qclist, 
+                cpl_table_get_column_stdev(restab, 
+                        "resolution"),
+                        keyname,
+                        "Angstrom", 
+                        "Scatter of spectral resolution")) {
+            fors_calib_exit("Cannot write spectral resolution scatter "
+                    "to QC log file");
+        }
 
-            if (mos)
-                keyname = "QC.MOS.RESOLUTION.RMS";
-            else
-                keyname = "QC.MXU.RESOLUTION.RMS";
-
-            if (fors_header_write_double(qclist, 
-                                       cpl_table_get_column_stdev(restab, 
-                                                                  "resolution"),
-                                       keyname,
-                                       "Angstrom", 
-                                       "Scatter of spectral resolution")) {
-                fors_calib_exit("Cannot write spectral resolution scatter "
-                                "to QC log file");
-            }
-
-            if (mos)
-                keyname = "QC.MOS.RESOLUTION.NWAVE";
-            else
-                keyname = "QC.MXU.RESOLUTION.NWAVE";
-
-            if (fors_header_write_int(qclist, cpl_table_get_nrow(restab) -
-                                    cpl_table_count_invalid(restab, 
-                                                            "resolution"),
-                                    keyname,
-                                    NULL,
-                                    "Number of examined wavelengths "
-                                    "for resolution computation")) {
-                fors_calib_exit("Cannot write number of lines used in "
-                                "spectral resolution computation "
-                                "to QC log file");
-            }
-
-            if (mos)
-                keyname = "QC.MOS.RESOLUTION.MEANRMS";
-            else
-                keyname = "QC.MXU.RESOLUTION.MEANRMS";
+        if (mos)
+            keyname = "QC.MOS.RESOLUTION.NWAVE";
+        else
+            keyname = "QC.MXU.RESOLUTION.NWAVE";
+
+        if (fors_header_write_int(qclist, cpl_table_get_nrow(restab) -
+                cpl_table_count_invalid(restab, 
+                        "resolution"),
+                        keyname,
+                        NULL,
+                        "Number of examined wavelengths "
+                        "for resolution computation")) {
+            fors_calib_exit("Cannot write number of lines used in "
+                    "spectral resolution computation "
+                    "to QC log file");
+        }
 
-            if (fors_header_write_double(qclist,
-                                       cpl_table_get_column_mean(restab,
-                                                     "resolution_rms"),
-                                    keyname, NULL,
-                                    "Mean error on spectral "
-                                    "resolution computation")) {
-                fors_calib_exit("Cannot write mean error in "
-                                "spectral resolution computation "
-                                "to QC log file");
-            }
+        if (mos)
+            keyname = "QC.MOS.RESOLUTION.MEANRMS";
+        else
+            keyname = "QC.MXU.RESOLUTION.MEANRMS";
+
+        if (fors_header_write_double(qclist,
+                cpl_table_get_column_mean(restab,
+                        "resolution_rms"),
+                        keyname, NULL,
+                        "Mean error on spectral "
+                        "resolution computation")) {
+            fors_calib_exit("Cannot write mean error in "
+                    "spectral resolution computation "
+                    "to QC log file");
+        }
 
-            if (mos)
-                keyname = "QC.MOS.RESOLUTION.NLINES";
-            else
-                keyname = "QC.MXU.RESOLUTION.NLINES";
-
-            if (fors_header_write_int(qclist,
-                     cpl_table_get_column_mean(restab, "nlines") *
-                                       cpl_table_get_nrow(restab),
-                                    keyname, NULL,
-                                    "Number of lines for spectral "
-                                    "resolution computation")) {
-                fors_calib_exit("Cannot write number of examined "
-                     "wavelengths in spectral resolution computation "
-                     "to QC log file");
-            }
+        if (mos)
+            keyname = "QC.MOS.RESOLUTION.NLINES";
+        else
+            keyname = "QC.MXU.RESOLUTION.NLINES";
+
+        if (fors_header_write_int(qclist,
+                cpl_table_get_column_mean(restab, "nlines") *
+                cpl_table_get_nrow(restab),
+                keyname, NULL,
+                "Number of lines for spectral "
+                "resolution computation")) {
+            fors_calib_exit("Cannot write number of examined "
+                    "wavelengths in spectral resolution computation "
+                    "to QC log file");
         }
 
-        if (dfs_save_table(frameset, restab, spectral_resolution_tag, qclist,
-                           parlist, recipe, version))
+        fors_dfs_save_table(frameset, restab, spectral_resolution_tag, qclist,
+                            parlist, recipe, ref_arc_frame);
+        if(cpl_error_get_code() != CPL_ERROR_NONE)
             fors_calib_exit(NULL);
 
         cpl_table_delete(restab); restab = NULL;
@@ -2458,28 +2405,19 @@ dfs_save_image(frameset, rainbow, "rainbow_calib", NULL, parlist, recipe, versio
 
     cpl_vector_delete(lines); lines = NULL;
 
-    if (dfs_save_table(frameset, idscoeff, disp_coeff_tag, NULL,
-                       parlist, recipe, version))
+    fors_dfs_save_table(frameset, idscoeff, disp_coeff_tag, NULL,
+                        parlist, recipe, ref_arc_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
         fors_calib_exit(NULL);
 //%%%
 
-    mapped_flat = mos_wavelength_calibration(rect_flat, reference,
-                                      startwavelength, endwavelength,
-                                      dispersion, idscoeff, 0);
-
-    mapped_nflat = mos_wavelength_calibration(rect_nflat, reference,
-                                      startwavelength, endwavelength,
-                                      dispersion, idscoeff, 0);
-
-    cpl_image_delete(rect_flat); rect_flat = NULL;
-    cpl_image_delete(rect_nflat); rect_nflat = NULL;
 //%%%
 
     /*
      * Global distortion models
      */
 
-    if (slit_ident) {
+    if (config.slit_ident) {
 
         cpl_msg_info(recipe, "Computing global distortions model");
         global = mos_global_distortion(slits, maskslits, idscoeff, 
@@ -2494,23 +2432,26 @@ dfs_save_image(frameset, rainbow, "rainbow_calib", NULL, parlist, recipe, versio
             stest = mos_build_slit_location(global, maskslits, ccd_ysize);
 
             ctest = mos_build_curv_coeff(global, maskslits, stest);
-            if (dfs_save_table(frameset, ctest, "CURVS", NULL,
-                               parlist, recipe, version))
+            fors_dfs_save_table(frameset, ctest, "CURVS", NULL,
+                                parlist, recipe, ref_flat_frame);
+            if(cpl_error_get_code() != CPL_ERROR_NONE)
                 fors_calib_exit(NULL);
 
             itest = mos_spatial_calibration(spectra, stest, ctest, 
-                                            reference, startwavelength, 
-                                            endwavelength, dispersion, 
+                                            reference, config.startwavelength, 
+                                            config.endwavelength, config.dispersion, 
                                             0, NULL);
             cpl_table_delete(ctest); ctest = NULL;
             cpl_image_delete(itest); itest = NULL;
-            if (dfs_save_table(frameset, stest, "SLITS", NULL,
-                               parlist, recipe, version))
+            fors_dfs_save_table(frameset, stest, "SLITS", NULL,
+                                parlist, recipe, ref_flat_frame);
+            if(cpl_error_get_code() != CPL_ERROR_NONE)
                 fors_calib_exit(NULL);
 
             dtest = mos_build_disp_coeff(global, stest);
-            if (dfs_save_table(frameset, dtest, "DISPS", NULL,
-                               parlist, recipe, version))
+            fors_dfs_save_table(frameset, dtest, "DISPS", NULL,
+                                parlist, recipe, ref_flat_frame);
+            if(cpl_error_get_code() != CPL_ERROR_NONE)
                 fors_calib_exit(NULL);
 
             cpl_table_delete(dtest); dtest = NULL;
@@ -2518,9 +2459,11 @@ dfs_save_image(frameset, rainbow, "rainbow_calib", NULL, parlist, recipe, versio
         }
 
         if (global) {
-            if (dfs_save_table(frameset, global, global_distortion_tag, NULL,
-                               parlist, recipe, version))
+            fors_dfs_save_table(frameset, global, global_distortion_tag, NULL,
+                    parlist, recipe, ref_arc_frame);
+            if(cpl_error_get_code() != CPL_ERROR_NONE)
                 fors_calib_exit(NULL);
+
             cpl_table_delete(global); global = NULL;
         }
 
@@ -2528,17 +2471,16 @@ dfs_save_image(frameset, rainbow, "rainbow_calib", NULL, parlist, recipe, versio
         cpl_table_delete(maskslits); maskslits = NULL;
     }
 
-    cpl_table_delete(idscoeff); idscoeff = NULL;
-
+    /* Create header for wavelength calibrated images */
     header = cpl_propertylist_new();
     cpl_propertylist_update_double(header, "CRPIX1", 1.0);
     cpl_propertylist_update_double(header, "CRPIX2", 1.0);
     cpl_propertylist_update_double(header, "CRVAL1", 
-                                   startwavelength + dispersion/2);
+                                   config.startwavelength + config.dispersion/2);
     cpl_propertylist_update_double(header, "CRVAL2", 1.0);
-    /* cpl_propertylist_update_double(header, "CDELT1", dispersion);
+    /* cpl_propertylist_update_double(header, "CDELT1", config.dispersion);
     cpl_propertylist_update_double(header, "CDELT2", 1.0); */
-    cpl_propertylist_update_double(header, "CD1_1", dispersion);
+    cpl_propertylist_update_double(header, "CD1_1", config.dispersion);
     cpl_propertylist_update_double(header, "CD1_2", 0.0);
     cpl_propertylist_update_double(header, "CD2_1", 0.0);
     cpl_propertylist_update_double(header, "CD2_2", 1.0);
@@ -2546,176 +2488,650 @@ dfs_save_image(frameset, rainbow, "rainbow_calib", NULL, parlist, recipe, versio
     cpl_propertylist_update_string(header, "CTYPE2", "PIXEL");
     cpl_propertylist_update_int(header, "ESO PRO DATANCOM", 1);
 
-    if (dfs_save_image(frameset, rectified, reduced_lamp_tag, header,
-                       parlist, recipe, version))
+    fors_dfs_save_image(frameset, rectified, reduced_lamp_tag, header,
+                        parlist, recipe, ref_arc_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
         fors_calib_exit(NULL);
 
     cpl_image_delete(rectified); rectified = NULL;
-//%%%
-    cpl_propertylist_update_int(header, "ESO PRO DATANCOM", nflats);
-
-    if (dfs_save_image(frameset, mapped_flat, mapped_screen_flat_tag, header,
-                       parlist, recipe, version))
-        fors_calib_exit(NULL);
-
-    cpl_image_delete(mapped_flat); mapped_flat = NULL;
-
-    if (dfs_save_image(frameset, mapped_nflat, mapped_norm_flat_tag, header,
-                       parlist, recipe, version))
-        fors_calib_exit(NULL);
-
-    cpl_image_delete(mapped_nflat); mapped_nflat = NULL;
-
     cpl_propertylist_delete(header); header = NULL;
+    
+    save_header = dfs_load_header(frameset, arc_tag, 0);
 
-    if (check) {
-        save_header = dfs_load_header(frameset, arc_tag, 0);
-
-        cpl_propertylist_update_double(save_header, "CRPIX2", 1.0);
-        cpl_propertylist_update_double(save_header, "CRVAL2", 1.0);
-        /* cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */
-        cpl_propertylist_update_double(save_header, "CD1_1", 1.0);
-        cpl_propertylist_update_double(save_header, "CD1_2", 0.0);
-        cpl_propertylist_update_double(save_header, "CD2_1", 0.0);
-        cpl_propertylist_update_double(save_header, "CD2_2", 1.0);
-        cpl_propertylist_update_string(save_header, "CTYPE1", "LINEAR");
-        cpl_propertylist_update_string(save_header, "CTYPE2", "PIXEL");
-
-        if (dfs_save_image(frameset, residual, disp_residuals_tag, save_header,
-                           parlist, recipe, version))
-            fors_calib_exit(NULL);
+    cpl_propertylist_update_double(save_header, "CRPIX2", 1.0);
+    cpl_propertylist_update_double(save_header, "CRVAL2", 1.0);
+    /* cpl_propertylist_update_double(save_header, "CDELT2", 1.0); */
+    cpl_propertylist_update_double(save_header, "CD1_1", 1.0);
+    cpl_propertylist_update_double(save_header, "CD1_2", 0.0);
+    cpl_propertylist_update_double(save_header, "CD2_1", 0.0);
+    cpl_propertylist_update_double(save_header, "CD2_2", 1.0);
+    cpl_propertylist_update_string(save_header, "CTYPE1", "LINEAR");
+    cpl_propertylist_update_string(save_header, "CTYPE2", "PIXEL");
+
+    fors_dfs_save_image(frameset, residual, disp_residuals_tag, save_header,
+                        parlist, recipe, ref_arc_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
+        fors_calib_exit(NULL);
 
-        cpl_image_delete(residual); residual = NULL;
-        cpl_propertylist_delete(save_header); save_header = NULL;
-    }
+    cpl_image_delete(residual); residual = NULL;
+    cpl_propertylist_delete(save_header); save_header = NULL;
 
     wavemap = mos_map_wavelengths(coordinate, rainbow, slits, polytraces, 
-                                  reference, startwavelength, endwavelength, 
-                                  dispersion);
+                                  reference, config.startwavelength, config.endwavelength, 
+                                  config.dispersion);
 
     cpl_image_delete(rainbow); rainbow = NULL;
 
     save_header = dfs_load_header(frameset, arc_tag, 0);
 
-    if (qc) {
-
-        /*
-         * QC1 parameters
-         */
-        keyname = "QC.DID";
-
-        if (fors_header_write_string(save_header,
-                                     keyname,
-                                     "2.0",
-                                     "QC1 dictionary")) {
-            fors_calib_exit("Cannot write dictionary version "
-                            "to QC log file");
-        }
+    /*
+     * QC1 parameters
+     */
+    keyname = "QC.DID";
+
+    if (fors_header_write_string(save_header,
+            keyname,
+            "2.0",
+            "QC1 dictionary")) {
+        fors_calib_exit("Cannot write dictionary version "
+                "to QC log file");
+    }
 
-        if (fors_header_write_double(save_header,
-                                   mean_rms,
-                                   "QC.WAVE.ACCURACY",
-                                   "pixel",
-                                   "Mean accuracy of wavecalib model")) {
-            fors_calib_exit("Cannot write mean wavelength calibration "
-                            "accuracy to QC log file");
-        }
+    if (fors_header_write_double(save_header,
+            mean_rms,
+            "QC.WAVE.ACCURACY",
+            "pixel",
+            "Mean accuracy of wavecalib model")) {
+        fors_calib_exit("Cannot write mean wavelength calibration "
+                "accuracy to QC log file");
+    }
 
 
-        if (fors_header_write_double(save_header,
-                                   mean_rms_err,
-                                   "QC.WAVE.ACCURACY.ERROR",
-                                   "pixel",
-                                   "Error on accuracy of wavecalib model")) {
-            fors_calib_exit("Cannot write error on wavelength calibration "
-                            "accuracy to QC log file");
-        }
+    if (fors_header_write_double(save_header,
+            mean_rms_err,
+            "QC.WAVE.ACCURACY.ERROR",
+            "pixel",
+            "Error on accuracy of wavecalib model")) {
+        fors_calib_exit("Cannot write error on wavelength calibration "
+                "accuracy to QC log file");
     }
 
-    if (dfs_save_image(frameset, wavemap, wavelength_map_tag, save_header,
-                       parlist, recipe, version))
+    fors_dfs_save_image(frameset, wavemap, wavelength_map_tag, save_header,
+            parlist, recipe, ref_arc_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
         fors_calib_exit(NULL);
 
     cpl_image_delete(wavemap); wavemap = NULL;
 
     cpl_propertylist_erase_regexp(save_header, "^ESO QC ", 0);
 
-    if (dfs_save_image(frameset, coordinate, spatial_map_tag, save_header,
-                       parlist, recipe, version))
+    fors_dfs_save_image(frameset, coordinate, spatial_map_tag, save_header,
+                        parlist, recipe, ref_flat_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
         fors_calib_exit(NULL);
 
-    cpl_image_delete(coordinate); coordinate = NULL;
     cpl_propertylist_delete(save_header); save_header = NULL;
 
     header = NULL;    /* To be really, really, REALLY sure... */
 
-    if (qc) {
+    /*
+     * QC1 parameters
+     */
+    double maxpos, maxneg, maxcurve, maxslope;
 
-        double maxpos, maxneg, maxcurve, maxslope;
+    header = dfs_load_header(frameset, arc_tag, 0);
 
-        header = dfs_load_header(frameset, arc_tag, 0);
+    keyname = "QC.DID";
 
-        /*
-         * QC1 parameters
-         */
-        keyname = "QC.DID";
+    if (fors_header_write_string(header,
+            keyname,
+            "2.0",
+            "QC1 dictionary")) {
+        fors_calib_exit("Cannot write dictionary version "
+                "to QC log file");
+    }
 
-        if (fors_header_write_string(header,
-                                     keyname,
-                                     "2.0",
-                                     "QC1 dictionary")) {
-            fors_calib_exit("Cannot write dictionary version "
-                            "to QC log file");
-        }
+    maxpos = fabs(cpl_table_get_column_max(polytraces, "c2"));
+    maxneg = fabs(cpl_table_get_column_min(polytraces, "c2"));
+    maxcurve = maxpos > maxneg ? maxpos : maxneg;
+    if (fors_header_write_double(header,
+            maxcurve,
+            "QC.TRACE.MAX.CURVATURE",
+            "Y pixel / X pixel ^2",
+            "Max observed curvature in "
+            "spectral tracing")) {
+        fors_calib_exit("Cannot write max observed curvature in spectral "
+                "tracing to QC log file");
+    }
 
-        maxpos = fabs(cpl_table_get_column_max(polytraces, "c2"));
-        maxneg = fabs(cpl_table_get_column_min(polytraces, "c2"));
-        maxcurve = maxpos > maxneg ? maxpos : maxneg;
-        if (fors_header_write_double(header,
-                                   maxcurve,
-                                   "QC.TRACE.MAX.CURVATURE",
-                                   "Y pixel / X pixel ^2",
-                                   "Max observed curvature in "
-                                   "spectral tracing")) {
-            fors_calib_exit("Cannot write max observed curvature in spectral "
-                            "tracing to QC log file");
-        }
+    maxpos = fabs(cpl_table_get_column_max(polytraces, "c1"));
+    maxneg = fabs(cpl_table_get_column_min(polytraces, "c1"));
+    maxslope = maxpos > maxneg ? maxpos : maxneg;
+    if (fors_header_write_double(header,
+            maxslope,
+            "QC.TRACE.MAX.SLOPE",
+            "Y pixel / X pixel",
+            "Max observed slope in spectral tracing")) {
+        fors_calib_exit("Cannot write max observed slope in spectral "
+                "tracing to QC log file");
+    }
 
-        maxpos = fabs(cpl_table_get_column_max(polytraces, "c1"));
-        maxneg = fabs(cpl_table_get_column_min(polytraces, "c1"));
-        maxslope = maxpos > maxneg ? maxpos : maxneg;
-        if (fors_header_write_double(header,
-                                   maxslope,
-                                   "QC.TRACE.MAX.SLOPE",
-                                   "Y pixel / X pixel",
-                                   "Max observed slope in spectral tracing")) {
-            fors_calib_exit("Cannot write max observed slope in spectral "
-                            "tracing to QC log file");
-        }
+    /* Compute master flat.
+     * TODO: master flat has already been computed above using the old method
+     * Here we use the new method and is the one saved. The other is not yet
+     * deleted in case it is used for something else.
+     */
+    cpl_msg_indent_less();
+    cpl_msg_info(recipe, "Perform flat field combination...");
+    
+    cpl_image_delete(master_flat);
+    cpl_image * master_flat_d;
+    master_flat_d = fors_calib_flat_mos_create_master_flat(slits, polytraces,
+            idscoeff, master_bias, config, nflats, frameset, flat_tag);
+    if(master_flat_d == NULL)
+        fors_calib_exit("Cannot combine flat frames");
+    /* mos_spatial-calibration cannot accept doubles 
+     * At the end I changed the master flat calibration for float, but the 
+     * output is still double (see TODO comment on flat_combine) */
+    cpl_msg_error(cpl_func, "type 1 %d",cpl_image_get_type(master_flat_d));
+    cpl_msg_error(cpl_func, "type 2 %d",cpl_image_get_type(master_flat));
+    master_flat = cpl_image_cast(master_flat_d, CPL_TYPE_FLOAT);
+    cpl_image_delete(master_flat_d);
 
-//        fors_qc_end_group();
-    }
+    
+    /*
+     * Flat field normalisation is done directly on the master flat
+     * field (without spatial rectification first). The spectral
+     * curvature model may be provided in input, in future releases.
+     */
 
-    cpl_free(instrume); instrume = NULL;
+    cpl_msg_info(recipe, "Perform flat field normalisation and distortion correction...");
+    
+    if(fors_calib_flat_mos_normalise_rect_mapped_save(master_flat, slits, 
+            idscoeff, polytraces,  coordinate, reference, config, nflats, 
+            frameset, flat_tag, master_screen_flat_tag, master_norm_flat_tag,
+            mapped_screen_flat_tag, mapped_norm_flat_tag,
+            parlist, ref_flat_frame) != 0)
+        fors_calib_exit("Cannot normalise flat or correct form distortion");
 
-    if (dfs_save_table(frameset, polytraces, curv_coeff_tag, header,
-                       parlist, recipe, version))
+    
+    /* Saving slits and polytraces */
+    
+    fors_dfs_save_table(frameset, polytraces, curv_coeff_tag, header,
+                        parlist, recipe, ref_flat_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
         fors_calib_exit(NULL);
 
     cpl_propertylist_delete(header); header = NULL;
     cpl_table_delete(polytraces); polytraces = NULL;
 
-    if (dfs_save_table(frameset, slits, slit_location_tag, NULL,
-                       parlist, recipe, version))
+    fors_dfs_save_table(frameset, slits, slit_location_tag, NULL,
+                        parlist, recipe, ref_flat_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
         fors_calib_exit(NULL);
 
     cpl_table_delete(slits); slits = NULL;
+    
+    cpl_table_delete(idscoeff); idscoeff = NULL;
+    
+    cpl_image_delete(coordinate); coordinate = NULL;
+
+    cpl_image_delete(master_bias); master_bias = NULL;
 
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         fors_calib_exit(NULL);
     }
 
     return 0;
 }
 
+int fors_calib_retrieve_input_param(cpl_parameterlist * parlist, 
+                                     cpl_frameset * frameset,
+                                     fors_calib_config * config)
+{
+    const char *recipe = "fors_calib";
+
+    cpl_table        *grism_table  = NULL;
+
+    cpl_msg_info(recipe, "Recipe %s configuration parameters:", recipe);
+    cpl_msg_indent_more();
+    
+    grism_table = dfs_load_table(frameset, "GRISM_TABLE", 1);
+
+    config->dispersion = dfs_get_parameter_double(parlist, 
+                    "fors.fors_calib.dispersion", grism_table);
+
+
+    config->peakdetection = dfs_get_parameter_double(parlist, 
+                    "fors.fors_calib.peakdetection", grism_table);
+
+    config->wdegree = dfs_get_parameter_int(parlist, 
+                    "fors.fors_calib.wdegree", grism_table);
+
+    config->wradius = dfs_get_parameter_int(parlist, "fors.fors_calib.wradius", NULL);
+
+    config->wreject = dfs_get_parameter_double(parlist, 
+                                       "fors.fors_calib.wreject", NULL);
+
+    config->wmode = dfs_get_parameter_int(parlist, "fors.fors_calib.wmode", NULL);
+
+    config->wmosmode = dfs_get_parameter_int(parlist,
+                                     "fors.fors_calib.wmosmode", NULL);
+
+    config->wcolumn = dfs_get_parameter_string(parlist, "fors.fors_calib.wcolumn", 
+                                       NULL);
+
+    config->cdegree = dfs_get_parameter_int(parlist, "fors.fors_calib.cdegree", 
+                                    grism_table);
+
+    config->cmode = dfs_get_parameter_int(parlist, "fors.fors_calib.cmode", NULL);
+
+    config->startwavelength = dfs_get_parameter_double(parlist, 
+                    "fors.fors_calib.startwavelength", grism_table);
+
+    config->endwavelength = dfs_get_parameter_double(parlist, 
+                    "fors.fors_calib.endwavelength", grism_table);
+
+    config->slit_ident = dfs_get_parameter_bool(parlist, 
+                    "fors.fors_calib.slit_ident", NULL);
+
+    config->stack_method = dfs_get_parameter_string(parlist, 
+                                            "fors.fors_calib.stack_method", 
+                                            NULL);
+
+    if (strcmp(config->stack_method, "ksigma") == 0) {
+        config->klow  = dfs_get_parameter_double(parlist, 
+                                         "fors.fors_calib.klow", NULL);
+        config->khigh = dfs_get_parameter_double(parlist, 
+                                         "fors.fors_calib.khigh", NULL);
+        config->kiter = dfs_get_parameter_int(parlist, 
+                                      "fors.fors_calib.kiter", NULL);
+    }
+
+    config->spa_nknots = dfs_get_parameter_int(parlist, "fors.fors_calib.s_nknots", NULL);
+
+    config->disp_nknots = dfs_get_parameter_int(parlist, "fors.fors_calib.d_nknots", NULL);
+
+    config->sradius = dfs_get_parameter_int(parlist, "fors.fors_calib.sradius", NULL);
+
+    config->dradius = dfs_get_parameter_int(parlist, "fors.fors_calib.dradius", NULL);
+
+    config->splfit_threshold = dfs_get_parameter_double(parlist, 
+            "fors.fors_calib.splfit_threshold", NULL);
+    
+    config->ignore_lines= dfs_get_parameter_string(parlist, 
+            "fors.fors_calib.ignore_lines", NULL);
+
+    
+    cpl_table_delete(grism_table); grism_table = NULL;
+
+    return 0; 
+}
+
+cpl_vector * fors_calib_get_reference_lines(cpl_frameset * frameset, 
+                                            const char * wcolumn,
+                                            const char * ignore_lines)
+{
+    cpl_table        *wavelengths  = NULL;
+    cpl_size          nlines_all;
+    cpl_size          n_selected = 0;
+    cpl_size          i;
+    cpl_vector       *lines;
+    double            lambda;
+    int               null;
+
+    /*
+     * Read the wavelengths table 
+     */
+    wavelengths = dfs_load_table(frameset, "MASTER_LINECAT", 1);
+
+    if (wavelengths == NULL)
+    {
+        cpl_msg_error(cpl_func, "Cannot load line catalog");
+        return NULL;
+    }
+
+
+    nlines_all = cpl_table_get_nrow(wavelengths);
+
+    if (nlines_all == 0)
+    {
+        cpl_msg_error(cpl_func, "Empty input line catalog");
+        cpl_table_delete(wavelengths);
+        return NULL;
+    }
+
+    if (cpl_table_has_column(wavelengths, wcolumn) != 1) 
+    {
+        cpl_msg_error(cpl_func, "Missing column %s in input line catalog table",
+                      wcolumn);
+        cpl_table_delete(wavelengths);
+        return NULL;
+    }
+
+    /*
+     * Select only lines which are not present in ignore_lines 
+     */
+    std::string ignore_lines_str(ignore_lines);
+
+    while(ignore_lines_str.length() > 0)
+    {
+        //Parsing ignore_lines (values are separated by comma)
+        int found = ignore_lines_str.find(',');
+        std::string lambda_str;
+        if(found != std::string::npos)
+        {
+            lambda_str = ignore_lines_str.substr(0, found);
+            ignore_lines_str = ignore_lines_str.substr(found+1);
+        }
+        else
+        {
+            lambda_str = ignore_lines_str;
+            ignore_lines_str = "";
+        }
+        std::istringstream iss(lambda_str);
+        if ( !(iss >> lambda) || !(iss >> std::ws && iss.eof()) )
+        {
+            cpl_msg_error(cpl_func, "Cannot interpret number in ignored_lines");
+            cpl_table_delete(wavelengths);
+            return NULL;
+        }
+
+        //Search for closest line in catalog. The line is unselected but
+        //it will be checked again against the next ignored line. In this way,
+        //if a value appears many times in the ignored_lines, only one line
+        //will be removed
+        cpl_size i_ignore = 0;
+        double min_lambda_dif = 
+             std::fabs(lambda - cpl_table_get(wavelengths, wcolumn, 0, &null));
+        for (i = 1; i < nlines_all; i++)
+        {
+            double lambda_dif = 
+              std::fabs(lambda - cpl_table_get(wavelengths, wcolumn, i, &null));
+            if(lambda_dif < min_lambda_dif)
+            {
+                min_lambda_dif = lambda_dif;
+                i_ignore = i;
+            }
+         }
+        cpl_table_unselect_row(wavelengths, i_ignore);
+    } 
+    
+    n_selected = cpl_table_count_selected(wavelengths);
+    lines = cpl_vector_new(n_selected);
+    
+    cpl_size i_line = 0;
+    for (i = 0; i < nlines_all; i++)
+    {
+        lambda = cpl_table_get(wavelengths, wcolumn, i, &null);
+        if(cpl_table_is_selected(wavelengths, i))
+        {
+            cpl_vector_set(lines, i_line, lambda);
+            i_line++;
+        }
+    }
+
+    cpl_table_delete(wavelengths);
+
+    return lines;
+}
+
+int fors_calib_flat_mos_normalise_rect_mapped_save
+(cpl_image * master_flat, cpl_table * slits, cpl_table *idscoeff,
+ cpl_table * polytraces, cpl_image * coordinate, double reference,
+ struct fors_calib_config& config, int nflats, cpl_frameset * frameset,
+ const char * flat_tag, const char * master_screen_flat_tag,
+ const char * master_norm_flat_tag, const char * mapped_screen_flat_tag,
+ const char * mapped_norm_flat_tag, cpl_parameterlist * parlist,
+ const cpl_frame * ref_flat_frame)
+{
+    cpl_image * norm_flat;
+    cpl_image * smo_flat;
+    cpl_image * rect_flat;
+    cpl_image * rect_nflat;
+    cpl_image * mapped_flat;
+    cpl_image * mapped_nflat;
+    cpl_propertylist * save_header;
+    cpl_propertylist * wave_header;
+    const char *recipe_name = "fors_calib";
+    
+    cpl_msg_indent_more();
+    
+    norm_flat = cpl_image_duplicate(master_flat);
+
+    /* Flat normalisation */
+    smo_flat = mos_mosflat_normalise(norm_flat, coordinate, slits, polytraces,
+                                     reference, config.startwavelength, config.endwavelength,
+                                     config.dispersion, config.sradius, config.dradius,
+                                     config.spa_nknots, config.disp_nknots, config.splfit_threshold);
+
+    cpl_image_delete(smo_flat); smo_flat = NULL;  /* It may be a product */
+
+ 
+    save_header = dfs_load_header(frameset, flat_tag, 0);
+    cpl_propertylist_update_int(save_header, "ESO PRO DATANCOM", nflats);
+
+    
+    /* Flat spatial distortion correction */ 
+    rect_flat = mos_spatial_calibration(master_flat, slits, polytraces, 
+                                        reference, config.startwavelength, 
+                                        config.endwavelength, config.dispersion, 0, NULL);
+    rect_nflat = mos_spatial_calibration(norm_flat, slits, polytraces, 
+                                        reference, config.startwavelength, 
+                                        config.endwavelength, config.dispersion, 0, NULL);
+
+    /* Flat wavelength calibration */
+    mapped_flat = mos_wavelength_calibration(rect_flat, reference,
+                                      config.startwavelength, config.endwavelength,
+                                      config.dispersion, idscoeff, 0);
+
+    mapped_nflat = mos_wavelength_calibration(rect_nflat, reference,
+                                      config.startwavelength, config.endwavelength,
+                                      config.dispersion, idscoeff, 0);
+
+
+    /* Saving of all flats */
+    fors_dfs_save_image(frameset, master_flat, master_screen_flat_tag,
+                        save_header, parlist, recipe_name, ref_flat_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
+    {
+        cpl_image_delete(norm_flat);
+        cpl_image_delete(smo_flat);
+        cpl_image_delete(rect_flat);
+        cpl_image_delete(rect_nflat);
+        cpl_image_delete(mapped_flat);
+        cpl_image_delete(mapped_nflat);
+        return -1;
+    }
+
+    cpl_image_delete(master_flat); master_flat = NULL;
+
+    fors_dfs_save_image(frameset, norm_flat, master_norm_flat_tag,
+                        save_header, parlist, recipe_name, ref_flat_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
+    {
+        cpl_image_delete(norm_flat);
+        cpl_image_delete(smo_flat);
+        cpl_image_delete(rect_flat);
+        cpl_image_delete(rect_nflat);
+        cpl_image_delete(mapped_flat);
+        cpl_image_delete(mapped_nflat);
+        return -1;
+    }
+
+    /* Create header for wavelength calibrated images */
+    wave_header = cpl_propertylist_new();
+    cpl_propertylist_update_double(wave_header, "CRPIX1", 1.0);
+    cpl_propertylist_update_double(wave_header, "CRPIX2", 1.0);
+    cpl_propertylist_update_double(wave_header, "CRVAL1", 
+                                   config.startwavelength + config.dispersion/2);
+    cpl_propertylist_update_double(wave_header, "CRVAL2", 1.0);
+    /* cpl_propertylist_update_double(header, "CDELT1", config.dispersion);
+    cpl_propertylist_update_double(header, "CDELT2", 1.0); */
+    cpl_propertylist_update_double(wave_header, "CD1_1", config.dispersion);
+    cpl_propertylist_update_double(wave_header, "CD1_2", 0.0);
+    cpl_propertylist_update_double(wave_header, "CD2_1", 0.0);
+    cpl_propertylist_update_double(wave_header, "CD2_2", 1.0);
+    cpl_propertylist_update_string(wave_header, "CTYPE1", "LINEAR");
+    cpl_propertylist_update_string(wave_header, "CTYPE2", "PIXEL");
+
+    cpl_propertylist_update_int(wave_header, "ESO PRO DATANCOM", nflats);
+
+    fors_dfs_save_image(frameset, mapped_flat, mapped_screen_flat_tag,
+                        wave_header, parlist, recipe_name, ref_flat_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
+    {
+        cpl_image_delete(norm_flat);
+        cpl_image_delete(smo_flat);
+        cpl_image_delete(rect_flat);
+        cpl_image_delete(rect_nflat);
+        cpl_image_delete(mapped_flat);
+        cpl_image_delete(mapped_nflat);
+        return -1;
+    }
+
+    cpl_image_delete(mapped_flat); mapped_flat = NULL;
+
+    fors_dfs_save_image(frameset, mapped_nflat, mapped_norm_flat_tag, 
+                        wave_header, parlist, recipe_name, ref_flat_frame);
+    if(cpl_error_get_code() != CPL_ERROR_NONE)
+    {
+        cpl_image_delete(norm_flat);
+        cpl_image_delete(smo_flat);
+        cpl_image_delete(rect_flat);
+        cpl_image_delete(rect_nflat);
+        cpl_image_delete(mapped_flat);
+        cpl_image_delete(mapped_nflat);
+        return -1;
+    }
+
+    cpl_image_delete(mapped_nflat); mapped_nflat = NULL;
+
+    cpl_propertylist_delete(wave_header); wave_header = NULL;
+
+    cpl_image_delete(norm_flat);
+    cpl_image_delete(smo_flat);
+    cpl_image_delete(rect_flat);
+    cpl_image_delete(rect_nflat);
+    cpl_image_delete(mapped_flat);
+    cpl_image_delete(mapped_nflat);
+    cpl_propertylist_delete(save_header);
+
+    cpl_msg_indent_less();
+
+    return 0;
+}
+
+cpl_image * fors_calib_flat_mos_create_master_flat
+(cpl_table * slits, cpl_table * polytraces, cpl_table *idscoeff, 
+ cpl_image *master_bias, 
+ struct fors_calib_config& config, int nflats, cpl_frameset * frameset,
+ const char * flat_tag)
+{
+    const char     * recipe_name = "fors_calib";
+    cpl_table      * flat_overscans;
+    cpl_errorstate   error_prevstate = cpl_errorstate_get();
+
+    cpl_msg_indent_more();
+
+    /* Getting overscan regions */ 
+    cpl_propertylist *header      = NULL;
+    header = dfs_load_header(frameset, flat_tag, 0);
+    if (header == NULL) {
+        cpl_msg_error(recipe_name, "Cannot load header of %s frame", flat_tag);
+        return NULL;
+    }
+    flat_overscans = mos_load_overscans_vimos(header, 1);
+    cpl_propertylist_delete(header);
+
+    
+    /* Reading individual raw flats */
+    std::vector<mosca::image> raw_flats;
+    cpl_frameset * flatframes = hawki_extract_frameset(frameset, flat_tag);
+    for (int i = 0; i < nflats; i++)
+    {
+        cpl_image * flat;
+        cpl_frame * flatframe = cpl_frameset_get_position(flatframes, i);
+        const char * filename = cpl_frame_get_filename(flatframe);
+        flat = cpl_image_load(filename, CPL_TYPE_DOUBLE, 0, 0);
+        cpl_propertylist * plist = cpl_propertylist_load(filename, 0) ;
+
+        if (!flat)
+            return NULL;
+        
+        /* Reading gain */
+        double gain = cpl_propertylist_get_double(plist, "ESO DET OUT1 GAIN");
+
+        cpl_image * flat_corr_bias = mos_remove_bias(flat, master_bias, 
+                                                     flat_overscans);
+        
+        
+        cpl_image * flat_err = cpl_image_duplicate(flat_corr_bias);
+        cpl_image_divide_scalar(flat_err, gain); //TODO: CHECK
+        cpl_image_power(flat_err, 0.5); //TODO: CHECK
+        mosca::image new_flat(flat_corr_bias, flat_err, true, mosca::X_AXIS);
+        raw_flats.push_back(new_flat);
+        cpl_image_delete(flat);
+    }
+
+    if(!cpl_errorstate_is_equal(error_prevstate))
+    {
+        cpl_msg_error(recipe_name, "Could not read the flats");
+        return NULL;
+    }
+    
+
+    /* Get the detected slit locations */
+    fors::detected_slits det_slits = 
+            fors::detected_slits_from_tables(slits, polytraces, 
+                                             raw_flats[0].size_dispersion());
+
+    /* Get the wave calib */
+    mosca::wavelength_calibration wave_cal(idscoeff);
+
+
+    /* Computing master flat */
+    cpl_msg_info(cpl_func, " Computing master flat");
+    std::auto_ptr<mosca::image> master_flat;
+    std::string stack_method(config.stack_method);
+    if(stack_method == "mean" || stack_method == "sum")
+    {
+        //TODO: Hardcoded value!! 
+        int smooth_sed = 10; 
+        mosca::reduce_mean reduce_method;
+        master_flat = mosca::flat_combine<double, mosca::reduce_mean>
+            (raw_flats, det_slits, wave_cal, smooth_sed, reduce_method);
+        if(stack_method == "sum")
+        {
+            cpl_image_multiply_scalar(master_flat->get_cpl_image(), nflats);
+            cpl_image_multiply_scalar(master_flat->get_cpl_image_err(), nflats);
+        }
+    }
+    else if(stack_method == "median")
+    {
+        //TODO: Hardcoded value!! 
+        int smooth_sed = 10; 
+        mosca::reduce_median reduce_method;
+        master_flat = mosca::flat_combine<double, mosca::reduce_median>
+            (raw_flats, det_slits, wave_cal, smooth_sed, reduce_method);        
+    }
+    else if(stack_method == "ksigma")
+    {
+        //TODO: Hardcoded value!! 
+        int smooth_sed = 10; 
+        mosca::reduce_sigma_clipping reduce_method(config.khigh, config.klow, config.kiter);
+        master_flat = mosca::flat_combine<double, mosca::reduce_sigma_clipping>
+            (raw_flats, det_slits, wave_cal, smooth_sed, reduce_method);        
+    }
+        
+    cpl_table_delete(flat_overscans); flat_overscans = NULL;
+    //cpl_image_delete(master_bias); master_bias = NULL;
+        
+    cpl_image * master_flat_img = 
+            cpl_image_duplicate(master_flat->get_cpl_image());
+    
+    cpl_msg_indent_less();
+    return master_flat_img;
+}
diff --git a/recipes/fors_config.c b/recipes/fors_config.c
index 3b4bf8c..a8cd7ad 100644
--- a/recipes/fors_config.c
+++ b/recipes/fors_config.c
@@ -1,4 +1,4 @@
-/* $Id: fors_config.c,v 1.4 2010/09/14 07:38:16 cizzo Exp $
+/* $Id: fors_config.c,v 1.5 2013-10-09 15:59:38 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -19,10 +19,10 @@
  */
 
 /*
- * $Author: cizzo $
- * $Date: 2010/09/14 07:38:16 $
- * $Revision: 1.4 $
- * $Name: fors-4_9_23 $
+ * $Author: cgarcia $
+ * $Date: 2013-10-09 15:59:38 $
+ * $Revision: 1.5 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -754,7 +754,7 @@ static int fors_config(cpl_parameterlist *parlist, cpl_frameset *frameset)
     cpl_free(filename); filename = NULL;
 
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
         fors_config_exit(NULL);
     }
     else 
diff --git a/recipes/fors_dark.c b/recipes/fors_dark.c
index d3389f0..1ddfe5b 100644
--- a/recipes/fors_dark.c
+++ b/recipes/fors_dark.c
@@ -1,4 +1,4 @@
-/* $Id: fors_dark.c,v 1.9 2011/10/12 15:00:03 cgarcia Exp $
+/* $Id: fors_dark.c,v 1.9 2011-10-12 15:00:03 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/12 15:00:03 $
+ * $Date: 2011-10-12 15:00:03 $
  * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_detect_objects.c b/recipes/fors_detect_objects.c
index a7eeb26..0c96b22 100644
--- a/recipes/fors_detect_objects.c
+++ b/recipes/fors_detect_objects.c
@@ -1,4 +1,4 @@
-/* $Id: fors_detect_objects.c,v 1.6 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_detect_objects.c,v 1.6 2013-04-24 14:14:13 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
+ * $Date: 2013-04-24 14:14:13 $
  * $Revision: 1.6 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_detect_spectra.c b/recipes/fors_detect_spectra.c
index 5c9284d..0db81b8 100644
--- a/recipes/fors_detect_spectra.c
+++ b/recipes/fors_detect_spectra.c
@@ -1,4 +1,4 @@
-/* $Id: fors_detect_spectra.c,v 1.8 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_detect_spectra.c,v 1.11 2013-10-09 15:59:38 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-10-09 15:59:38 $
+ * $Revision: 1.11 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -425,10 +425,9 @@ static int fors_detect_spectra(cpl_parameterlist *parlist,
     int         lamp_mxu;
     int         lamp_mos;
     int         lamp_lss;
-    int         mxu, mos;
+    int         mos;
     int         treat_as_lss = 0;
     int         nslits;
-    double     *xpos;
     double      mxpos;
     int         narc;
     int         nlines;
@@ -536,10 +535,9 @@ static int fors_detect_spectra(cpl_parameterlist *parlist,
         fors_detect_spectra_exit(NULL);
     }
 
-    mxu = mos = 0;
+    mos = 0;
 
     if (lamp_mxu) {
-        mxu = 1;
         arc_tag               = "LAMP_UNBIAS_MXU";
         spectra_detection_tag = "SPECTRA_DETECTION_MXU";
         slit_map_tag          = "SLIT_MAP_MXU";
@@ -719,7 +717,7 @@ static int fors_detect_spectra(cpl_parameterlist *parlist,
                                                wdegree, wreject, reference,
                                                &startwavelength, &endwavelength,
                                                NULL, NULL, NULL, NULL, NULL,
-                                               NULL, refmask);
+                                               NULL, refmask, NULL);
 
     cpl_image_delete(spectra); spectra = NULL;
     cpl_vector_delete(lines); lines = NULL;
@@ -759,7 +757,7 @@ static int fors_detect_spectra(cpl_parameterlist *parlist,
     slits = mos_locate_spectra(refmask);
 
     if (!slits) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
         fors_detect_spectra_exit("No slits could be detected!");
     }
 
diff --git a/recipes/fors_extract.c b/recipes/fors_extract.c
index df5bcb5..9ace463 100644
--- a/recipes/fors_extract.c
+++ b/recipes/fors_extract.c
@@ -1,4 +1,4 @@
-/* $Id: fors_extract.c,v 1.11 2013/04/24 14:15:36 cgarcia Exp $
+/* $Id: fors_extract.c,v 1.12 2013-10-09 15:59:38 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:15:36 $
- * $Revision: 1.11 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-10-09 15:59:38 $
+ * $Revision: 1.12 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -1736,7 +1736,7 @@ static int fors_extract(cpl_parameterlist *parlist, cpl_frameset *frameset)
     cpl_propertylist_delete(header); header = NULL;
 
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
         fors_extract_exit(NULL);
     }
 
diff --git a/recipes/fors_extract_objects.c b/recipes/fors_extract_objects.c
index 0c6f9eb..6ee5cce 100644
--- a/recipes/fors_extract_objects.c
+++ b/recipes/fors_extract_objects.c
@@ -1,4 +1,4 @@
-/* $Id: fors_extract_objects.c,v 1.6 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_extract_objects.c,v 1.6 2013-04-24 14:14:13 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
+ * $Date: 2013-04-24 14:14:13 $
  * $Revision: 1.6 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_extract_slits.c b/recipes/fors_extract_slits.c
index b432197..9a809c3 100644
--- a/recipes/fors_extract_slits.c
+++ b/recipes/fors_extract_slits.c
@@ -1,4 +1,4 @@
-/* $Id: fors_extract_slits.c,v 1.7 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_extract_slits.c,v 1.8 2013-08-20 17:02:58 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-08-20 17:02:58 $
+ * $Revision: 1.8 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -336,11 +336,8 @@ static int fors_extract_slits(cpl_parameterlist *parlist,
     const char *curv_coeff_tag;
     int         nframes;
     int         rebin;
-    int         nslits;
     int         treat_as_lss;
-    int         i;
     double      reference;
-    double     *xpos;
     double      mxpos;
     int         mxu, mos, lss;
     int         slit_l, slit_d;
diff --git a/recipes/fors_flat.c b/recipes/fors_flat.c
deleted file mode 100644
index 10e9e10..0000000
--- a/recipes/fors_flat.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/* $Id: fors_flat.c,v 1.8 2013/04/24 14:14:14 cgarcia Exp $
- *
- * This file is part of the FORS Data Reduction Pipeline
- * Copyright (C) 2002-2010 European Southern Observatory
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-/*
- * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:14 $
- * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include <math.h>
-#include <cpl.h>
-#include <moses.h>
-#include <fors_dfs.h>
-
-static int fors_flat_create(cpl_plugin *);
-static int fors_flat_exec(cpl_plugin *);
-static int fors_flat_destroy(cpl_plugin *);
-static int fors_flat(cpl_parameterlist *, cpl_frameset *);
-
-static char fors_flat_description[] =
-"This recipe is used to subtract the master bias, produced by the recipe\n"
-"fors_bias, from a set of raw flat field frames. The input raw frames are\n"
-"summed, the master bias frame is rescaled accordingly, and subtracted\n"
-"from the result. The overscan regions, if present, are used to compensate\n"
-"for variations of the bias level between master bias and input raw frames.\n"
-"The overscan regions are then trimmed from the result.\n"
-"In the table below the MXU acronym can be alternatively read as MOS and\n"
-"LSS.\n\n"
-"Input files:\n\n"
-"  DO category:               Type:       Explanation:         Required:\n"
-"  SCREEN_FLAT_MXU            Raw         Raw data frame          Y\n"
-"  MASTER_BIAS                Calib       Master bias frame       Y\n\n"
-"Output files:\n\n"
-"  DO category:               Data type:  Explanation:\n"
-"  MASTER_SCREEN_FLAT_MXU     FITS image  Bias subtracted sum frame\n\n";
-
-#define fors_flat_exit(message)               \
-{                                             \
-if (message) cpl_msg_error(recipe, message);  \
-cpl_image_delete(flat);                       \
-cpl_image_delete(master_flat);                \
-cpl_image_delete(master_bias);                \
-cpl_propertylist_delete(header);              \
-cpl_table_delete(overscans);                  \
-cpl_msg_indent_less();                        \
-return -1;                                    \
-}
-
-#define fors_flat_exit_memcheck(message)        \
-{                                               \
-if (message) cpl_msg_info(recipe, message);     \
-printf("free flat (%p)\n", flat);               \
-cpl_image_delete(flat);                         \
-printf("free master_flat (%p)\n", master_flat); \
-cpl_image_delete(master_flat);                  \
-printf("free master_bias (%p)\n", master_bias); \
-cpl_image_delete(master_bias);                  \
-printf("free header (%p)\n", header);           \
-cpl_propertylist_delete(header);                \
-printf("free overscans (%p)\n", overscans);     \
-cpl_table_delete(overscans);                    \
-cpl_msg_indent_less();                          \
-return 0;                                       \
-}
-
-
-/**
- * @brief    Build the list of available plugins, for this module. 
- *
- * @param    list    The plugin list
- *
- * @return   0 if everything is ok, -1 otherwise
- *
- * Create the recipe instance and make it available to the application 
- * using the interface. This function is exported.
- */
-
-int cpl_plugin_get_info(cpl_pluginlist *list)
-{
-    cpl_recipe *recipe = cpl_calloc(1, sizeof *recipe );
-    cpl_plugin *plugin = &recipe->interface;
-
-    cpl_plugin_init(plugin,
-                    CPL_PLUGIN_API,
-                    FORS_BINARY_VERSION,
-                    CPL_PLUGIN_TYPE_RECIPE,
-                    "fors_flat",
-                    "Sum input flat field frames and remove bias",
-                    fors_flat_description,
-                    "Carlo Izzo",
-                    PACKAGE_BUGREPORT,
-    "This file is currently part of the FORS Instrument Pipeline\n"
-    "Copyright (C) 2002-2010 European Southern Observatory\n\n"
-    "This program is free software; you can redistribute it and/or modify\n"
-    "it under the terms of the GNU General Public License as published by\n"
-    "the Free Software Foundation; either version 2 of the License, or\n"
-    "(at your option) any later version.\n\n"
-    "This program is distributed in the hope that it will be useful,\n"
-    "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-    "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
-    "GNU General Public License for more details.\n\n"
-    "You should have received a copy of the GNU General Public License\n"
-    "along with this program; if not, write to the Free Software Foundation,\n"
-    "Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n",
-                    fors_flat_create,
-                    fors_flat_exec,
-                    fors_flat_destroy);
-
-    cpl_pluginlist_append(list, plugin);
-    
-    return 0;
-}
-
-
-/**
- * @brief    Setup the recipe options    
- *
- * @param    plugin  The plugin
- *
- * @return   0 if everything is ok
- *
- * Defining the command-line/configuration parameters for the recipe.
- */
-
-static int fors_flat_create(cpl_plugin *plugin)
-{
-    cpl_recipe    *recipe;
-/* Uncomment in case parameters are defined
-    cpl_parameter *p;
-*/
-
-    /* 
-     * Check that the plugin is part of a valid recipe 
-     */
-
-    if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-        recipe = (cpl_recipe *)plugin;
-    else 
-        return -1;
-
-    /* 
-     * Create the (empty) parameters list in the cpl_recipe object 
-     */
-
-    recipe->parameters = cpl_parameterlist_new(); 
-
-    return 0;
-}
-
-
-/**
- * @brief    Execute the plugin instance given by the interface
- *
- * @param    plugin  the plugin
- *
- * @return   0 if everything is ok
- */
-
-static int fors_flat_exec(cpl_plugin *plugin)
-{
-    cpl_recipe *recipe;
-    
-    if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-        recipe = (cpl_recipe *)plugin;
-    else 
-        return -1;
-
-    return fors_flat(recipe->parameters, recipe->frames);
-}
-
-
-/**
- * @brief    Destroy what has been created by the 'create' function
- *
- * @param    plugin  The plugin
- *
- * @return   0 if everything is ok
- */
-
-static int fors_flat_destroy(cpl_plugin *plugin)
-{
-    cpl_recipe *recipe;
-    
-    if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
-        recipe = (cpl_recipe *)plugin;
-    else 
-        return -1;
-
-    cpl_parameterlist_delete(recipe->parameters); 
-
-    return 0;
-}
-
-
-/**
- * @brief    Interpret the command line options and execute the data processing
- *
- * @param    parlist     The parameters list
- * @param    frameset    The set-of-frames
- *
- * @return   0 if everything is ok
- */
-
-static int fors_flat(cpl_parameterlist *parlist, cpl_frameset *frameset)
-{
-
-    const char *recipe = "fors_flat";
-
-
-    /*
-     * CPL objects
-     */
-
-    cpl_image        *flat        = NULL;
-    cpl_image        *master_flat = NULL;
-    cpl_image        *master_bias = NULL;
-    cpl_image        *multi_bias  = NULL;
-    cpl_image        *dummy       = NULL;
-    cpl_table        *overscans   = NULL;
-    cpl_propertylist *header      = NULL;
-
-    /*
-     * Auxiliary variables
-     */
-
-    char        version[80];
-    const char *master_bias_tag = "MASTER_BIAS";
-    const char *flat_tag;
-    const char *pro_tag;
-    char       *instrume = NULL;
-    int         flat_mxu;
-    int         flat_mos;
-    int         flat_lss;
-    int         nbias, nflat;
-    int         i;
-
-
-    cpl_msg_set_indentation(2);
-
-
-    cpl_msg_info(recipe, "Check input set-of-frames:");
-    cpl_msg_indent_more();
-
-    nbias = cpl_frameset_count_tags(frameset, master_bias_tag);
-    if (nbias == 0) {
-        cpl_msg_error(recipe, "Missing required input: %s", master_bias_tag);
-        fors_flat_exit(NULL);
-    }
-    if (nbias > 1) {
-        cpl_msg_error(recipe, "Too many in input (%d > 1): %s", 
-                      nbias, master_bias_tag);
-        fors_flat_exit(NULL);
-    }
-
-    nflat  = flat_mxu = cpl_frameset_count_tags(frameset, "SCREEN_FLAT_MXU");
-    nflat += flat_mos = cpl_frameset_count_tags(frameset, "SCREEN_FLAT_MOS");
-    nflat += flat_lss = cpl_frameset_count_tags(frameset, "SCREEN_FLAT_LSS");
-
-    if (nflat == 0) {
-        fors_flat_exit("Missing required input raw frames");
-    }
-
-    if (flat_mxu) {
-        flat_tag = "SCREEN_FLAT_MXU";
-        pro_tag = "MASTER_SCREEN_FLAT_MXU";
-    }
-    else if (flat_mos) {
-        flat_tag = "SCREEN_FLAT_MOS";
-        pro_tag = "MASTER_SCREEN_FLAT_MOS";
-    }
-    else if (flat_lss) {
-        flat_tag = "SCREEN_FLAT_LSS";
-        pro_tag = "MASTER_SCREEN_FLAT_LSS";
-    }
-
-    if (!dfs_equal_keyword(frameset, "ESO INS GRIS1 ID"))
-        fors_flat_exit("Input frames are not from the same grism");
-
-    if (!dfs_equal_keyword(frameset, "ESO INS FILT1 ID"))
-        fors_flat_exit("Input frames are not from the same filter");
-
-    if (!dfs_equal_keyword(frameset, "ESO DET CHIP1 ID")) 
-        fors_flat_exit("Input frames are not from the same chip");
-
-    header = dfs_load_header(frameset, flat_tag, 0);
-
-    if (header == NULL) {
-        cpl_msg_error(recipe, "Cannot load header of %s frame", flat_tag);
-        fors_flat_exit(NULL);
-    }
-
-    instrume = (char *)cpl_propertylist_get_string(header, "INSTRUME");
-    if (instrume == NULL) {
-        cpl_msg_error(recipe, "Missing keyword INSTRUME in %s header", 
-                      flat_tag);
-        fors_flat_exit(NULL);
-    }
-
-    if (instrume[4] == '1')
-        snprintf(version, 80, "%s/%s", "fors1", VERSION);
-    if (instrume[4] == '2')
-        snprintf(version, 80, "%s/%s", "fors2", VERSION);
-
-
-    cpl_msg_indent_less();
-    cpl_msg_info(recipe, "Load input frames:");
-    cpl_msg_indent_more();
-
-    master_flat = dfs_load_image(frameset, flat_tag, CPL_TYPE_FLOAT, 0, 0);
-
-    if (master_flat == NULL)
-        fors_flat_exit("Cannot load flat field");
-
-    for (i = 1; i < nflat; i++) {
-        flat = dfs_load_image(frameset, NULL, CPL_TYPE_FLOAT, 0, 0);
-        if (flat) {
-            cpl_image_add(master_flat, flat);
-            cpl_image_delete(flat); flat = NULL;
-        }
-        else
-            fors_flat_exit("Cannot load flat field");
-    }
-
-    master_bias = dfs_load_image(frameset, 
-                                 master_bias_tag, CPL_TYPE_FLOAT, 0, 1);
-    if (master_bias == NULL)
-        fors_flat_exit("Cannot load master bias");
-
-    cpl_msg_indent_less();
-    cpl_msg_info(recipe, "Subtract the master bias from sum flat frame...");
-    cpl_msg_indent_more();
-
-    overscans = mos_load_overscans_vimos(header, 1);
-
-    if (nflat > 1) {
-        multi_bias = cpl_image_multiply_scalar_create(master_bias, nflat);
-        dummy = mos_remove_bias(master_flat, multi_bias, overscans);
-        cpl_image_delete(multi_bias);
-    }
-    else {
-        dummy = mos_remove_bias(master_flat, master_bias, overscans);
-    }
-
-    cpl_table_delete(overscans); overscans = NULL;
-    cpl_image_delete(master_bias); master_bias = NULL;
-    cpl_image_delete(master_flat); master_flat = dummy;
-
-    if (master_flat == NULL) {
-        cpl_msg_error(recipe, "Cannot remove bias from sum flat frame");
-        fors_flat_exit(NULL);
-    }
-
-    cpl_msg_indent_less();
-
-    cpl_propertylist_update_int(header, "ESO PRO DATANCOM", nflat);
-
-    if (dfs_save_image(frameset, master_flat, pro_tag,
-                       header, parlist, recipe, version))
-        fors_flat_exit(NULL);
-
-    cpl_image_delete(master_flat); master_flat = NULL;
-    cpl_propertylist_delete(header); header = NULL;
-
-    return 0;
-}
diff --git a/recipes/fors_flat.cc b/recipes/fors_flat.cc
new file mode 100644
index 0000000..e923a8e
--- /dev/null
+++ b/recipes/fors_flat.cc
@@ -0,0 +1,586 @@
+/* $Id: fors_flat.cc,v 1.9 2013/09/10 19:25:32 cgarcia Exp $
+ *
+ * This file is part of the FORS Data Reduction Pipeline
+ * Copyright (C) 2002-2010 European Southern Observatory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * $Author: cgarcia $
+ * $Date: 2013/09/10 19:25:32 $
+ * $Revision: 1.9 $
+ * $Name:  $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <vector>
+#include <exception>
+#include <math.h>
+#include <cpl.h>
+#include <moses.h>
+#include <fors_dfs.h>
+#include <fors_utils.h>
+#include <fors_image.h>
+#include "detected_slits.h"
+#include "wavelength_calibration.h"
+#include "flat_combine.h"
+
+static int fors_flat_create(cpl_plugin *);
+static int fors_flat_exec(cpl_plugin *);
+static int fors_flat_destroy(cpl_plugin *);
+static int fors_flat(cpl_parameterlist *, cpl_frameset *);
+
+static char fors_flat_description[] =
+"This recipe is used to subtract the master bias, produced by the recipe\n"
+"fors_bias, from a set of raw flat field frames. The input raw frames are\n"
+"summed, the master bias frame is rescaled accordingly, and subtracted\n"
+"from the result. The overscan regions, if present, are used to compensate\n"
+"for variations of the bias level between master bias and input raw frames.\n"
+"The overscan regions are then trimmed from the result.\n"
+"In the table below the MXU acronym can be alternatively read as MOS and\n"
+"LSS.\n\n"
+"Input files:\n\n"
+"  DO category:               Type:       Explanation:         Required:\n"
+"  SCREEN_FLAT_MXU            Raw         Raw data frame          Y\n"
+"  SLIT_LOCATION_MXU          Calib       Slits positions on CCD  Y\n"
+"  CURV_COEFF_MXU             Calib       Slits tracing fits      Y\n"
+"  DISP_COEFF_MXU             Calib       Wavelength calibration  Y\n"
+"  MASTER_BIAS                Calib       Master bias frame       Y\n\n"
+"Output files:\n\n"
+"  DO category:               Data type:  Explanation:\n"
+"  MASTER_SCREEN_FLAT_MXU     FITS image  Bias subtracted sum frame\n\n";
+
+#define fors_flat_exit(message)               \
+{                                             \
+if (message) cpl_msg_error(recipe, message);  \
+cpl_image_delete(flat);                       \
+cpl_image_delete(master_bias);                \
+cpl_propertylist_delete(header);              \
+cpl_table_delete(flat_overscans);                  \
+cpl_msg_indent_less();                        \
+return -1;                                    \
+}
+
+#define fors_flat_exit_memcheck(message)        \
+{                                               \
+if (message) cpl_msg_info(recipe, message);     \
+printf("free flat (%p)\n", flat);               \
+cpl_image_delete(flat);                         \
+printf("free master_flat (%p)\n", master_flat); \
+cpl_image_delete(master_flat);                  \
+printf("free master_bias (%p)\n", master_bias); \
+cpl_image_delete(master_bias);                  \
+printf("free header (%p)\n", header);           \
+cpl_propertylist_delete(header);                \
+printf("free overscans (%p)\n", overscans);     \
+cpl_table_delete(overscans);                    \
+cpl_msg_indent_less();                          \
+return 0;                                       \
+}
+
+
+/**
+ * @brief    Build the list of available plugins, for this module. 
+ *
+ * @param    list    The plugin list
+ *
+ * @return   0 if everything is ok, -1 otherwise
+ *
+ * Create the recipe instance and make it available to the application 
+ * using the interface. This function is exported.
+ */
+
+int cpl_plugin_get_info(cpl_pluginlist *list)
+{
+    cpl_recipe *recipe = static_cast<cpl_recipe *>(cpl_calloc(1, sizeof *recipe ));
+    cpl_plugin *plugin = &recipe->interface;
+
+    cpl_plugin_init(plugin,
+                    CPL_PLUGIN_API,
+                    FORS_BINARY_VERSION,
+                    CPL_PLUGIN_TYPE_RECIPE,
+                    "fors_spec_mflat",
+                    "Computes master spectroscopic flat, removing bias first",
+                    fors_flat_description,
+                    "Carlo Izzo",
+                    PACKAGE_BUGREPORT,
+                    fors_get_license(),
+                    fors_flat_create,
+                    fors_flat_exec,
+                    fors_flat_destroy);
+
+    cpl_pluginlist_append(list, plugin);
+    
+    return 0;
+}
+
+
+/**
+ * @brief    Setup the recipe options    
+ *
+ * @param    plugin  The plugin
+ *
+ * @return   0 if everything is ok
+ *
+ * Defining the command-line/configuration parameters for the recipe.
+ */
+
+static int fors_flat_create(cpl_plugin *plugin)
+{
+    cpl_recipe    *recipe;
+    cpl_parameter *p;
+
+    /* 
+     * Check that the plugin is part of a valid recipe 
+     */
+
+    if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
+        recipe = (cpl_recipe *)plugin;
+    else 
+        return -1;
+
+    /* 
+     * Create the parameters list in the cpl_recipe object 
+     */
+
+    recipe->parameters = cpl_parameterlist_new(); 
+
+
+    /*
+     * Number of iterations
+     */
+    p = cpl_parameter_new_value("fors.fors_spec_mflat.smooth_sed",
+                                CPL_TYPE_DOUBLE,
+                                "Smoothing size for each flat sed",
+                                "fors.fors_spec_mflat",
+                                0.0);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "smooth_sed");
+    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
+    cpl_parameterlist_append(recipe->parameters, p);
+
+    /*
+     * Stacking method
+     */
+    p = cpl_parameter_new_enum("fors.fors_spec_mflat.stack_method",
+                                CPL_TYPE_STRING,
+                                "Frames combination method",
+                                "fors.fors_spec_mflat",
+                                "sum", 4,
+                                "sum", "mean", "median", "ksigma");
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "stack_method");
+    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
+    cpl_parameterlist_append(recipe->parameters, p);
+
+    /* 
+     * Low threshold for the sigma clipping algorithm 
+     */
+    p = cpl_parameter_new_value("fors.fors_spec_mflat.klow",
+                                CPL_TYPE_DOUBLE,
+                                "Low threshold in ksigma method",
+                                "fors.fors_spec_mflat",
+                                3.0);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "klow");
+    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
+    cpl_parameterlist_append(recipe->parameters, p);
+
+    /* 
+     * High threshold for the sigma clipping algorithm 
+     */
+    p = cpl_parameter_new_value("fors.fors_spec_mflat.khigh",
+                                CPL_TYPE_DOUBLE,
+                                "High threshold in ksigma method",
+                                "fors.fors_spec_mflat",
+                                3.0);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "khigh");
+    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
+    cpl_parameterlist_append(recipe->parameters, p);
+
+    /* 
+     * Number of iterations for the sigma clipping algorithm 
+     */
+    p = cpl_parameter_new_value("fors.fors_spec_mflat.kiter",
+                                CPL_TYPE_INT,
+                                "Max number of iterations in ksigma method",
+                                "fors.fors_spec_mflat",
+                                999);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "kiter");
+    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
+    cpl_parameterlist_append(recipe->parameters, p);
+
+    return 0;
+}
+
+
+/**
+ * @brief    Execute the plugin instance given by the interface
+ *
+ * @param    plugin  the plugin
+ *
+ * @return   0 if everything is ok
+ */
+
+static int fors_flat_exec(cpl_plugin *plugin)
+{
+    cpl_recipe  *   recipe ;
+    int             status = 1;
+
+    /* Get the recipe out of the plugin */
+    if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
+        recipe = (cpl_recipe *)plugin ;
+    else return -1 ;
+
+    /* Issue a banner */
+    //fors_print_banner();
+
+    try
+    {
+        status = fors_flat(recipe->parameters, recipe->frames);
+    }
+    catch(std::exception& ex)
+    {
+        cpl_msg_error(cpl_func, "Exception: %s", ex.what());
+    }
+    catch(...)
+    {
+        cpl_msg_error(cpl_func, "An uncaught error during recipe execution");
+    }
+
+    return status;
+
+}
+
+
+/**
+ * @brief    Destroy what has been created by the 'create' function
+ *
+ * @param    plugin  The plugin
+ *
+ * @return   0 if everything is ok
+ */
+
+static int fors_flat_destroy(cpl_plugin *plugin)
+{
+    cpl_recipe *recipe;
+    
+    if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE) 
+        recipe = (cpl_recipe *)plugin;
+    else 
+        return -1;
+
+    cpl_parameterlist_delete(recipe->parameters); 
+
+    return 0;
+}
+
+
+/**
+ * @brief    Interpret the command line options and execute the data processing
+ *
+ * @param    parlist     The parameters list
+ * @param    frameset    The set-of-frames
+ *
+ * @return   0 if everything is ok
+ */
+
+static int fors_flat(cpl_parameterlist *parlist, cpl_frameset *frameset)
+{
+
+    const char *recipe = "fors_spec_mflat";
+
+
+    /*
+     * CPL objects
+     */
+
+    cpl_image        *master_bias = NULL;
+    cpl_image        *multi_bias  = NULL;
+    cpl_table        *flat_overscans   = NULL;
+    cpl_propertylist *header      = NULL;
+    cpl_parameter    *par         = NULL;
+    cpl_image        *flat = NULL;
+
+    /*
+     * Auxiliary variables
+     */
+
+    char        version[80];
+    const char *master_bias_tag = "MASTER_BIAS";
+    const char *slit_location_tag;
+    const char *curv_coeff_tag;
+    const char *disp_coeff_tag;
+    const char *flat_tag;
+    const char *pro_tag;
+    char       *instrume = NULL;
+    int         flat_mxu;
+    int         flat_mos;
+    int         flat_lss;
+    int         nbias, nflat;
+    int         i;
+    double      smooth_sed;
+    std::string stack_method;
+    double      khigh, klow;
+    int         kiter;
+    
+    
+    cpl_errorstate      error_prevstate = cpl_errorstate_get();
+
+
+    cpl_msg_set_indentation(2);
+
+
+    /* 
+     * Get configuration parameters
+     */
+
+    cpl_msg_info(recipe, "Recipe %s configuration parameters:", recipe);
+    cpl_msg_indent_more();
+
+    par = cpl_parameterlist_find(parlist, "fors.fors_spec_mflat.smooth_sed");
+    smooth_sed = cpl_parameter_get_double(par) ;
+
+    cpl_msg_info(cpl_func, "fors.fors_spec_mflat.smooth_sed = %f", smooth_sed);
+
+    par = cpl_parameterlist_find(parlist, "fors.fors_spec_mflat.stack_method");
+    stack_method = cpl_parameter_get_string(par) ;
+
+    cpl_msg_info(cpl_func, "fors.fors_spec_mflat.stack_method = %s", stack_method.c_str());
+
+    par = cpl_parameterlist_find(parlist, "fors.fors_spec_mflat.khigh");
+    khigh = cpl_parameter_get_double(par);
+
+    cpl_msg_info(cpl_func, "fors.fors_spec_mflat.khigh = %f", khigh);
+    
+    par = cpl_parameterlist_find(parlist, "fors.fors_spec_mflat.klow");
+    klow = cpl_parameter_get_double(par) ;
+
+    cpl_msg_info(cpl_func, "fors.fors_spec_mflat.klow = %f", klow);
+    
+    par = cpl_parameterlist_find(parlist, "fors.fors_spec_mflat.kiter");
+    kiter = cpl_parameter_get_int(par) ;
+
+    cpl_msg_info(cpl_func, "fors.fors_spec_mflat.kiter = %d", kiter);
+    
+    /* 
+     * Check validity of parameters
+     */
+    if(stack_method != "mean" && stack_method != "median" && 
+       stack_method != "ksigma" && stack_method != "sum")
+        throw std::invalid_argument(stack_method+" stacking algorithm invalid");
+    
+    /*
+     * Check input frames
+     */
+    cpl_msg_info(recipe, "Check input set-of-frames:");
+    cpl_msg_indent_more();
+
+    nbias = cpl_frameset_count_tags(frameset, master_bias_tag);
+    if (nbias == 0) {
+        cpl_msg_error(recipe, "Missing required input: %s", master_bias_tag);
+        fors_flat_exit(NULL);
+    }
+    if (nbias > 1) {
+        cpl_msg_error(recipe, "Too many in input (%d > 1): %s", 
+                      nbias, master_bias_tag);
+        fors_flat_exit(NULL);
+    }
+
+    nflat  = flat_mxu = cpl_frameset_count_tags(frameset, "SCREEN_FLAT_MXU");
+    nflat += flat_mos = cpl_frameset_count_tags(frameset, "SCREEN_FLAT_MOS");
+    nflat += flat_lss = cpl_frameset_count_tags(frameset, "SCREEN_FLAT_LSS");
+
+    if (nflat == 0) {
+        fors_flat_exit("Missing required input raw frames");
+    }
+
+    if (flat_mxu) {
+        flat_tag = "SCREEN_FLAT_MXU";
+        pro_tag = "MASTER_SCREEN_FLAT_MXU";
+        slit_location_tag = "SLIT_LOCATION_MXU";
+        curv_coeff_tag = "CURV_COEFF_MXU";
+        disp_coeff_tag = "DISP_COEFF_MXU";
+    }
+    else if (flat_mos) {
+        flat_tag = "SCREEN_FLAT_MOS";
+        pro_tag = "MASTER_SCREEN_FLAT_MOS";
+        slit_location_tag = "SLIT_LOCATION_MOS";
+        curv_coeff_tag = "CURV_COEFF_MOS";
+        disp_coeff_tag = "DISP_COEFF_MOS";
+    }
+    else if (flat_lss) {
+        flat_tag = "SCREEN_FLAT_LSS";
+        pro_tag = "MASTER_SCREEN_FLAT_LSS";
+        slit_location_tag = "SLIT_LOCATION_LSS";
+        curv_coeff_tag = "CURV_COEFF_LSS";
+        disp_coeff_tag = "DISP_COEFF_LSS";
+    }
+
+    if (!dfs_equal_keyword(frameset, "ESO INS GRIS1 ID"))
+        fors_flat_exit("Input frames are not from the same grism");
+
+    if (!dfs_equal_keyword(frameset, "ESO INS FILT1 ID"))
+        fors_flat_exit("Input frames are not from the same filter");
+
+    if (!dfs_equal_keyword(frameset, "ESO DET CHIP1 ID")) 
+        fors_flat_exit("Input frames are not from the same chip");
+
+    header = dfs_load_header(frameset, flat_tag, 0);
+
+    if (header == NULL) {
+        cpl_msg_error(recipe, "Cannot load header of %s frame", flat_tag);
+        fors_flat_exit(NULL);
+    }
+
+    instrume = (char *)cpl_propertylist_get_string(header, "INSTRUME");
+    if (instrume == NULL) {
+        cpl_msg_error(recipe, "Missing keyword INSTRUME in %s header", 
+                      flat_tag);
+        fors_flat_exit(NULL);
+    }
+
+    if (instrume[4] == '1')
+        snprintf(version, 80, "%s/%s", "fors1", VERSION);
+    if (instrume[4] == '2')
+        snprintf(version, 80, "%s/%s", "fors2", VERSION);
+
+
+    cpl_msg_indent_less();
+    cpl_msg_info(recipe, "Load input frames:");
+    cpl_msg_indent_more();
+
+    /* Reading  master  bias */
+    master_bias = dfs_load_image(frameset, 
+                                 master_bias_tag, CPL_TYPE_FLOAT, 0, 1);
+    if (master_bias == NULL)
+        fors_flat_exit("Cannot load master bias");
+
+
+    flat_overscans = mos_load_overscans_vimos(header, 1);
+
+    /* Reading individual raw flats */
+    std::vector<mosca::image> raw_flats;
+    cpl_frameset * flatframes = hawki_extract_frameset(frameset, flat_tag);
+    for (i = 0; i < nflat; i++)
+    {
+        cpl_frame * flatframe = cpl_frameset_get_position(flatframes, i);
+        const char * filename = cpl_frame_get_filename(flatframe);
+        flat = cpl_image_load(filename, CPL_TYPE_DOUBLE, 0, 0);
+        cpl_propertylist * plist = cpl_propertylist_load(filename, 0) ;
+
+        if (!flat)
+            fors_flat_exit("Cannot load flat field");
+        
+        /* Reading gain */
+        double gain = cpl_propertylist_get_double(plist, "ESO DET OUT1 GAIN");
+
+        cpl_image * flat_corr_bias = mos_remove_bias(flat, master_bias, 
+                                                     flat_overscans);
+        
+        
+        cpl_image * flat_err = cpl_image_duplicate(flat_corr_bias);
+        cpl_image_divide_scalar(flat_err, gain); //TODO: CHECK
+        cpl_image_power(flat_err, 0.5); //TODO: CHECK
+        mosca::image new_flat(flat_corr_bias, flat_err, true, mosca::X_AXIS);
+        raw_flats.push_back(new_flat);
+        cpl_image_delete(flat);
+    }
+
+    if(!cpl_errorstate_is_equal(error_prevstate))
+        fors_flat_exit("Could not read the flats");
+    
+
+    /* Read the slit locations */
+    cpl_msg_info(cpl_func, " Reading slit information");
+    cpl_frameset * slit_frames = hawki_extract_frameset(frameset, slit_location_tag);
+    cpl_frameset * curv_frames = hawki_extract_frameset(frameset, curv_coeff_tag);
+    if(cpl_frameset_get_size(slit_frames) != 1)
+        fors_flat_exit("One slit position frame is needed");
+    if(cpl_frameset_get_size(curv_frames) != 1)
+        fors_flat_exit("One curvature coefficients frame is needed");
+
+    const char * slit_filename = cpl_frame_get_filename(cpl_frameset_get_position(slit_frames, 0));
+    const char * curv_filename = cpl_frame_get_filename(cpl_frameset_get_position(curv_frames, 0));
+    
+    mosca::detected_slits det_slits = 
+            mosca::detected_slits_load_fits(slit_filename, curv_filename,
+                                            raw_flats[0].size_dispersion());
+    
+    if(!cpl_errorstate_is_equal(error_prevstate))
+        fors_flat_exit("Could not read the slits");
+
+    /* Read wave calib */
+    cpl_msg_info(cpl_func, " Reading wavelength calibration");
+    cpl_frameset * wave_frames = hawki_extract_frameset(frameset, disp_coeff_tag);
+    if(cpl_frameset_get_size(wave_frames) != 1)
+        fors_flat_exit("One dispersion coefficients frame is needed");
+    const char * wave_filename = cpl_frame_get_filename(cpl_frameset_get_position(wave_frames, 0));
+    mosca::wavelength_calibration wave_cal(wave_filename);
+
+    if(!cpl_errorstate_is_equal(error_prevstate))
+        fors_flat_exit("Could not read the wavelength calibration");
+
+    /* Computing master flat */
+    cpl_msg_info(cpl_func, " Computing master flat");
+    std::auto_ptr<mosca::image> master_flat;
+    if(stack_method == "mean" || stack_method == "sum")
+    {
+        mosca::reduce_mean reduce_method;
+        master_flat = mosca::flat_combine<double, mosca::reduce_mean>
+            (raw_flats, det_slits, wave_cal, smooth_sed, reduce_method);
+        if(stack_method == "sum")
+        {
+            cpl_image_multiply_scalar(master_flat->get_cpl_image(), nflat);
+            cpl_image_multiply_scalar(master_flat->get_cpl_image_err(), nflat);
+        }
+    }
+    else if(stack_method == "median")
+    {
+        mosca::reduce_median reduce_method;
+        master_flat = mosca::flat_combine<double, mosca::reduce_median>
+            (raw_flats, det_slits, wave_cal, smooth_sed, reduce_method);        
+    }
+    else if(stack_method == "ksigma")
+    {
+        mosca::reduce_sigma_clipping reduce_method(khigh, klow, kiter);
+        master_flat = mosca::flat_combine<double, mosca::reduce_sigma_clipping>
+            (raw_flats, det_slits, wave_cal, smooth_sed, reduce_method);        
+    }
+        
+    cpl_table_delete(flat_overscans); flat_overscans = NULL;
+    cpl_image_delete(master_bias); master_bias = NULL;
+
+
+    cpl_msg_indent_less();
+
+
+    /* Save product */
+    fors_image * fors_master_flat = fors_image_new(master_flat->get_cpl_image(),
+            cpl_image_power_create(master_flat->get_cpl_image_err(), 2.));
+
+    cpl_propertylist *save_header  = cpl_propertylist_new();
+    cpl_propertylist_update_int(save_header, "ESO PRO DATANCOM", nflat);    
+
+    fors_dfs_save_image_err(frameset, fors_master_flat, pro_tag,
+                            save_header, parlist, recipe,
+                            cpl_frameset_get_position_const(flatframes, 0));
+
+    cpl_propertylist_delete(header); header = NULL;
+
+    return 0;
+}
diff --git a/recipes/fors_flatfield.c b/recipes/fors_flatfield.c
index 3d13a98..f1b9560 100644
--- a/recipes/fors_flatfield.c
+++ b/recipes/fors_flatfield.c
@@ -1,4 +1,4 @@
-/* $Id: fors_flatfield.c,v 1.6 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_flatfield.c,v 1.6 2013-04-24 14:14:13 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
+ * $Date: 2013-04-24 14:14:13 $
  * $Revision: 1.6 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_img_science.c b/recipes/fors_img_science.c
index 2097e13..d12de87 100644
--- a/recipes/fors_img_science.c
+++ b/recipes/fors_img_science.c
@@ -1,4 +1,4 @@
-/* $Id: fors_img_science.c,v 1.8 2011/10/12 15:00:14 cgarcia Exp $
+/* $Id: fors_img_science.c,v 1.8 2011-10-12 15:00:14 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/12 15:00:14 $
+ * $Date: 2011-10-12 15:00:14 $
  * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_img_screen_flat.c b/recipes/fors_img_screen_flat.c
index ba88921..5bf84d3 100644
--- a/recipes/fors_img_screen_flat.c
+++ b/recipes/fors_img_screen_flat.c
@@ -1,4 +1,4 @@
-/* $Id: fors_img_screen_flat.c,v 1.8 2011/10/12 15:00:51 cgarcia Exp $
+/* $Id: fors_img_screen_flat.c,v 1.8 2011-10-12 15:00:51 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/12 15:00:51 $
+ * $Date: 2011-10-12 15:00:51 $
  * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_img_sky_flat.c b/recipes/fors_img_sky_flat.c
index 2871c40..a3d9aab 100644
--- a/recipes/fors_img_sky_flat.c
+++ b/recipes/fors_img_sky_flat.c
@@ -1,4 +1,4 @@
-/* $Id: fors_img_sky_flat.c,v 1.8 2011/10/12 15:00:51 cgarcia Exp $
+/* $Id: fors_img_sky_flat.c,v 1.8 2011-10-12 15:00:51 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/12 15:00:51 $
+ * $Date: 2011-10-12 15:00:51 $
  * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_normalise_flat.c b/recipes/fors_normalise_flat.c
index c8f196d..ffcc026 100644
--- a/recipes/fors_normalise_flat.c
+++ b/recipes/fors_normalise_flat.c
@@ -1,4 +1,4 @@
-/* $Id: fors_normalise_flat.c,v 1.7 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_normalise_flat.c,v 1.10 2013/09/09 12:24:55 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013/09/09 12:24:55 $
+ * $Revision: 1.10 $
+ * $Name:  $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -33,6 +33,7 @@
 #include <cpl.h>
 #include <moses.h>
 #include <fors_dfs.h>
+#include <fors_flat_normalise.h>
 
 static int fors_normalise_flat_create(cpl_plugin *);
 static int fors_normalise_flat_exec(cpl_plugin *);
@@ -67,6 +68,7 @@ static char fors_normalise_flat_description[] =
 "  DO category:               Type:       Explanation:         Required:\n"
 "  MASTER_SCREEN_FLAT_MXU     Calib       Master flat frame       Y\n"
 "  CURV_COEFF_MXU             Calib       Spectral curvature      .\n"
+"  SLIT_LOCATION_MXU          Calib       Spectral curvature      .\n"        
 "  GRISM_TABLE                Calib       Grism table             .\n\n"
 "Output files:\n\n"
 "  DO category:               Data type:  Explanation:\n"
@@ -232,34 +234,45 @@ static int fors_normalise_flat_create(cpl_plugin *plugin)
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Degree of flat field fitting polynomial along spatial direction
-     * (used for LSS data)
+     * Number of knots in flat field fitting splines along spatial direction 
      */
 
-    p = cpl_parameter_new_value("fors.fors_normalise_flat.sdegree",
+    p = cpl_parameter_new_value("fors.fors_normalise_flat.spa_nknots",
                                 CPL_TYPE_INT,
-                                "Degree of flat field fitting polynomial "
-                                "along spatial direction (used for LSS "
-                                "data only)",
+                                "Number of knots in flat field fitting "
+                                "splines along spatial direction",
                                 "fors.fors_normalise_flat",
-                                4);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "sdegree");
+                                -1);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "spa_nknots");
     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Degree of flat field fitting polynomial along dispersion direction
-     * (used for MOS and MXU data)
+     * Smooth box radius for flat field along spatial direction
+     * (if spa_knots < 0)
      */
 
-    p = cpl_parameter_new_value("fors.fors_normalise_flat.ddegree",
+    p = cpl_parameter_new_value("fors.fors_normalise_flat.sradius",
                                 CPL_TYPE_INT,
-                                "Degree of flat field fitting polynomial "
-                                "along dispersion direction (used for MOS "
-                                "and MXU data only)",
+                                "Smooth box radius for flat field along "
+                                "spatial direction (used if spa_knots < 0)",
+                                "fors.fors_normalise_flat",
+                                10);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "sradius");
+    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
+    cpl_parameterlist_append(recipe->parameters, p);
+
+    /*
+     * Number of knots in flat field fitting splines along dispersion direction 
+     */
+
+    p = cpl_parameter_new_value("fors.fors_normalise_flat.disp_nknots",
+                                CPL_TYPE_INT,
+                                "Number of knots in flat field fitting "
+                                "splines along dispersion direction",
                                 "fors.fors_normalise_flat",
                                 -1);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "ddegree");
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "disp_nknots");
     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
     cpl_parameterlist_append(recipe->parameters, p);
 
@@ -270,7 +283,7 @@ static int fors_normalise_flat_create(cpl_plugin *plugin)
     p = cpl_parameter_new_value("fors.fors_normalise_flat.dradius",
                                 CPL_TYPE_INT,
                                 "Smooth box radius for flat field along "
-                                "dispersion direction",
+                                "dispersion direction (if disp_knots < 0)",
                                 "fors.fors_normalise_flat",
                                 10);
     cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "dradius");
@@ -278,17 +291,16 @@ static int fors_normalise_flat_create(cpl_plugin *plugin)
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Smooth box radius for flat field along spatial direction
-     * (used for LSS data only)
+     * Threshold percentage for flat spline fitting with respect to the maximum
      */
 
-    p = cpl_parameter_new_value("fors.fors_normalise_flat.sradius",
-                                CPL_TYPE_INT,
-                                "Smooth box radius for flat field along "
-                                "spatial direction",
+    p = cpl_parameter_new_value("fors.fors_normalise_flat.splfit_threshold",
+                                CPL_TYPE_DOUBLE,
+                                "Threshold percentage for flat spline fitting"
+                                "with respect to the maximum",
                                 "fors.fors_normalise_flat",
-                                10);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "sradius");
+                                0.01);
+    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "splfit_threshold");
     cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
     cpl_parameterlist_append(recipe->parameters, p);
 
@@ -363,10 +375,11 @@ static int fors_normalise_flat(cpl_parameterlist *parlist,
     double      dispersion;
     double      startwavelength;
     double      endwavelength;
-    int         sdegree;
-    int         ddegree;
+    int         spa_nknots;
+    int         disp_nknots;
     int         sradius;
     int         dradius;
+    float       splfit_threshold;
 
     /*
      * CPL objects
@@ -395,11 +408,8 @@ static int fors_normalise_flat(cpl_parameterlist *parlist,
     int         nflat;
     int         rebin;
     int         nx, ny;
-    int         nslits;
     int         treat_as_lss;
-    int         i;
     double      reference;
-    double     *xpos;
     double      mxpos;
 
     char       *instrume = NULL;
@@ -445,14 +455,16 @@ static int fors_normalise_flat(cpl_parameterlist *parlist,
         if (endwavelength - startwavelength <= 0.0)
             fors_normalise_flat_exit("Invalid wavelength interval");
 
-    sdegree = dfs_get_parameter_int(parlist, 
-                                    "fors.fors_normalise_flat.sdegree", NULL);
-    ddegree = dfs_get_parameter_int(parlist, 
-                                    "fors.fors_normalise_flat.ddegree", NULL);
-    sradius = dfs_get_parameter_int(parlist, 
-                                    "fors.fors_normalise_flat.sradius", NULL);
+    spa_nknots = dfs_get_parameter_int(parlist,
+            "fors.fors_normalise_flat.spa_nknots", NULL);
+    disp_nknots = dfs_get_parameter_int(parlist,
+            "fors.fors_normalise_flat.disp_nknots", NULL);
+    sradius = dfs_get_parameter_int(parlist,
+            "fors.fors_normalise_flat.sradius", NULL);
     dradius = dfs_get_parameter_int(parlist, 
-                                    "fors.fors_normalise_flat.dradius", NULL);
+            "fors.fors_normalise_flat.dradius", NULL);
+    splfit_threshold = dfs_get_parameter_double(parlist, 
+            "fors.fors_normalise_flat.splfit_threshold", NULL);
 
     if (sradius < 1 || dradius < 1)
         fors_normalise_flat_exit("Invalid smoothing box radius");
@@ -633,8 +645,10 @@ static int fors_normalise_flat(cpl_parameterlist *parlist,
          * curvature model may be provided in input, in future releases.
          */
 
-        smo_flat = mos_normalise_longflat(master_flat, 
-                                          sradius, dradius, sdegree);
+        smo_flat = mos_lssflat_normalise(master_flat, 
+                                         sradius, dradius, 
+                                         spa_nknots, disp_nknots,
+                                         splfit_threshold);
 
         cpl_image_delete(smo_flat); smo_flat = NULL; /* It may be a product */
 
@@ -672,9 +686,10 @@ static int fors_normalise_flat(cpl_parameterlist *parlist,
 
     cpl_image_delete(spatial); spatial = NULL;
 
-    smo_flat = mos_normalise_flat(master_flat, coordinate, slits, polytraces,
-                                  reference, startwavelength, endwavelength,
-                                  dispersion, dradius, ddegree);
+    smo_flat = mos_mosflat_normalise(master_flat, coordinate, slits, polytraces,
+                                     reference, startwavelength, endwavelength,
+                                     dispersion, sradius, dradius,
+                                     spa_nknots, disp_nknots, splfit_threshold);
 
     cpl_image_delete(smo_flat); smo_flat = NULL;  /* It may be a product */
     cpl_image_delete(coordinate); coordinate = NULL;
diff --git a/recipes/fors_photometry.c b/recipes/fors_photometry.c
index e084195..a48abdb 100644
--- a/recipes/fors_photometry.c
+++ b/recipes/fors_photometry.c
@@ -1,4 +1,4 @@
-/* $Id: fors_photometry.c,v 1.8 2011/10/12 15:00:52 cgarcia Exp $
+/* $Id: fors_photometry.c,v 1.8 2011-10-12 15:00:52 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/12 15:00:52 $
+ * $Date: 2011-10-12 15:00:52 $
  * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_pmos_calib.c b/recipes/fors_pmos_calib.c
index 41e55e7..431483a 100644
--- a/recipes/fors_pmos_calib.c
+++ b/recipes/fors_pmos_calib.c
@@ -1,4 +1,4 @@
-/* $Id: fors_pmos_calib.c,v 1.38 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_pmos_calib.c,v 1.42 2013-10-09 15:59:38 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.38 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-10-09 15:59:38 $
+ * $Revision: 1.42 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -703,7 +703,7 @@ static int fors_pmos_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     int     nx, ny;
     double  reference;
     double  gain;
-    int     ccd_xsize, ccd_ysize;
+    int     ccd_ysize;
     int     i, j;
 
     char   *instrume = NULL;
@@ -1403,7 +1403,7 @@ static int fors_pmos_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
             cpl_msg_info(recipe, "Detecting spectra on CCD...");
             cpl_msg_indent_more();
 
-            ccd_xsize = nx = cpl_image_get_size_x(spectra);
+            nx = cpl_image_get_size_x(spectra);
             ccd_ysize = ny = cpl_image_get_size_y(spectra);
 
             refmask = cpl_mask_new(nx, ny);
@@ -1414,7 +1414,7 @@ static int fors_pmos_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
                                                wdegree, wreject, reference,
                                                &startwavelength, &endwavelength,
                                                NULL, NULL, NULL, NULL, NULL, 
-                                               NULL, refmask);
+                                               NULL, refmask, NULL);
 
             if (checkwave == NULL)
                 fors_pmos_calib_exit("Wavelength calibration failure.");
@@ -1467,7 +1467,8 @@ static int fors_pmos_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
             slits = mos_locate_spectra(refmask);
 
             if (!slits) {
-                cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+                cpl_msg_error(cpl_error_get_where(), "%s", 
+                              cpl_error_get_message());
                 fors_pmos_calib_exit("No slits could be detected!");
             }
 
@@ -1754,7 +1755,7 @@ static int fors_pmos_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
                                                      &endwavelength, fitlines, 
                                                      fiterror, idscoeff,
                                                      rainbow, 
-                                                     residual, restable);
+                                                     residual, restable, NULL);
 
         if (rectified == NULL)
             fors_pmos_calib_exit("Wavelength calibration failure.");
@@ -2332,7 +2333,7 @@ static int fors_pmos_calib(cpl_parameterlist *parlist, cpl_frameset *frameset)
     cpl_vector_delete(lines); lines = NULL;
 
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
         fors_pmos_calib_exit(NULL);
     }
 
diff --git a/recipes/fors_pmos_extract.c b/recipes/fors_pmos_extract.c
index 0329e92..c969812 100644
--- a/recipes/fors_pmos_extract.c
+++ b/recipes/fors_pmos_extract.c
@@ -1,4 +1,4 @@
-/* $Id: fors_pmos_extract.c,v 1.8 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_pmos_extract.c,v 1.10 2013-10-09 15:59:38 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-10-09 15:59:38 $
+ * $Revision: 1.10 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -670,7 +670,7 @@ static int fors_pmos_extract(cpl_parameterlist *parlist, cpl_frameset *frameset)
     int     rebin;
     double *line;
     int     nx = 0, ny;
-    int     ccd_xsize, ccd_ysize;
+    int     ccd_xsize;
     double  reference;
     double  gain;
     double  ron;
@@ -1175,7 +1175,7 @@ static int fors_pmos_extract(cpl_parameterlist *parlist, cpl_frameset *frameset)
 	    fors_pmos_extract_exit("Cannot remove bias from scientific frame");
 
 	ccd_xsize = nx = cpl_image_get_size_x(spectra);
-	ccd_ysize = ny = cpl_image_get_size_y(spectra);
+	ny = cpl_image_get_size_y(spectra);
 
 	if (flatfield) {
 
@@ -2759,7 +2759,7 @@ End old saving */
     cpl_free(nobjs_per_slit);
 
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
         fors_pmos_extract_exit(NULL);
     }
     else 
diff --git a/recipes/fors_pmos_science.c b/recipes/fors_pmos_science.c
index 77af177..0cc6a1b 100644
--- a/recipes/fors_pmos_science.c
+++ b/recipes/fors_pmos_science.c
@@ -1,4 +1,4 @@
-/* $Id: fors_pmos_science.c,v 1.64 2013/04/24 14:14:14 cgarcia Exp $
+/* $Id: fors_pmos_science.c,v 1.65 2013-10-09 15:59:38 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:14 $
- * $Revision: 1.64 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-10-09 15:59:38 $
+ * $Revision: 1.65 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -3358,7 +3358,7 @@ skip:
     cpl_free(nobjs_per_slit);
 
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
         fors_pmos_science_exit(NULL);
     }
     else 
diff --git a/recipes/fors_remove_bias.c b/recipes/fors_remove_bias.c
index effb3a1..dac6f80 100644
--- a/recipes/fors_remove_bias.c
+++ b/recipes/fors_remove_bias.c
@@ -1,4 +1,4 @@
-/* $Id: fors_remove_bias.c,v 1.7 2013/04/24 14:14:14 cgarcia Exp $
+/* $Id: fors_remove_bias.c,v 1.7 2013-04-24 14:14:14 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:14 $
+ * $Date: 2013-04-24 14:14:14 $
  * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_resample.c b/recipes/fors_resample.c
index b6c9e14..08c99d7 100644
--- a/recipes/fors_resample.c
+++ b/recipes/fors_resample.c
@@ -1,4 +1,4 @@
-/* $Id: fors_resample.c,v 1.10 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_resample.c,v 1.11 2013-08-14 16:11:42 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.10 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-08-14 16:11:42 $
+ * $Revision: 1.11 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -330,10 +330,7 @@ static int fors_resample(cpl_parameterlist *parlist,
     int         nframes;
     int         rebin;
     double      reference;
-    double     *xpos;
-    double      mxpos;
     int         treat_as_lss = 0;
-    int         nslits, i;
     int         mxu, mos, lss;
     int         disp;
     int         dispsci;
diff --git a/recipes/fors_science.c b/recipes/fors_science.c
index 90bbfd2..bb90514 100644
--- a/recipes/fors_science.c
+++ b/recipes/fors_science.c
@@ -1,4 +1,4 @@
-/* $Id: fors_science.c,v 1.39 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_science.c,v 1.42 2013-08-14 15:04:57 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.39 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-08-14 15:04:57 $
+ * $Revision: 1.42 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H 
@@ -354,19 +354,6 @@ static int fors_science_create(cpl_plugin *plugin)
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Flux conservation
-     */
-
-    p = cpl_parameter_new_value("fors.fors_science.flux",
-                                CPL_TYPE_BOOL,
-                                "Apply flux conservation",
-                                "fors.fors_science",
-                                TRUE);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "flux");
-    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-    cpl_parameterlist_append(recipe->parameters, p);
-
-    /*
      * Apply flat field
      */
 
@@ -503,19 +490,6 @@ static int fors_science_create(cpl_plugin *plugin)
     cpl_parameterlist_append(recipe->parameters, p);
 
     /*
-     * Normalise output by exposure time
-     */
-
-    p = cpl_parameter_new_value("fors.fors_science.time_normalise",
-                                CPL_TYPE_BOOL,
-                                "Normalise output spectra by the exposure time",
-                                "fors.fors_science",
-                                TRUE);
-    cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "time_normalise");
-    cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
-    cpl_parameterlist_append(recipe->parameters, p);
-
-    /*
      * Order of polynomial modeling the instrument response.
      */
 
@@ -614,7 +588,6 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
     const char *wcolumn;
     double      startwavelength;
     double      endwavelength;
-    int         flux;
     int         flatfield;
     int         skyglobal;
     int         skylocal;
@@ -624,7 +597,6 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
     int         ext_radius;
     int         cont_radius;
     int         ext_mode;
-    int         time_normalise;
     int         res_order;
     int         photometry;
 
@@ -770,8 +742,6 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
     if (endwavelength - startwavelength <= 0.0)
         fors_science_exit("Invalid wavelength interval");
 
-    flux = dfs_get_parameter_bool(parlist, "fors.fors_science.flux", NULL);
-
     flatfield = dfs_get_parameter_bool(parlist, "fors.fors_science.flatfield", 
                                        NULL);
 
@@ -823,9 +793,6 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
     if (ext_mode < 0 || ext_mode > 1)
         fors_science_exit("Invalid object extraction mode");
 
-    time_normalise = dfs_get_parameter_bool(parlist, 
-                             "fors.fors_science.time_normalise", NULL);
-
     res_order = dfs_get_parameter_int(parlist, "fors.fors_science.response",
                                       NULL);
     if (res_order < 2 || res_order > 10)
@@ -1610,7 +1577,7 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
         smapped = mos_spatial_calibration(spectra, slits, polytraces, reference,
                                           startwavelength, endwavelength,
-                                          dispersion, flux, coordinate);
+                                          dispersion, 1, coordinate);
     }
 
 
@@ -1668,7 +1635,8 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
                     cpl_msg_error(recipe, "The IDS coeff table is "
                     "incompatible with the input slit position table.");
                 }
-                cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+                cpl_msg_error(cpl_func, "Error found in %s: %s",
+                              cpl_error_get_where(), cpl_error_get_message());
                 fors_science_exit(NULL);
             }
             cpl_msg_warning(recipe, "Alignment of the wavelength solution "
@@ -1708,7 +1676,7 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
     mapped_sky = mos_wavelength_calibration(smapped, reference,
                                             startwavelength, endwavelength,
-                                            dispersion, idscoeff, flux);
+                                            dispersion, idscoeff, 1);
 
     cpl_msg_indent_less();
     cpl_msg_info(recipe, "Check applied wavelength against skylines...");
@@ -1741,20 +1709,13 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
     cpl_propertylist_update_string(header, "CTYPE1", "LINEAR");
     cpl_propertylist_update_string(header, "CTYPE2", "PIXEL");
 
-    if (time_normalise) {
-        cpl_propertylist_update_string(header, "BUNIT", "ADU/s");
-        dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);
-        if (dfs_save_image(frameset, dummy, mapped_science_sky_tag, header, 
-                           parlist, recipe, version))
-            fors_science_exit(NULL);
-        cpl_image_delete(dummy); dummy = NULL;
-    }
-    else {
-        cpl_propertylist_update_string(header, "BUNIT", "ADU");
-        if (dfs_save_image(frameset, mapped_sky, mapped_science_sky_tag, 
-                           header, parlist, recipe, version))
-            fors_science_exit(NULL);
-    }
+    /* Perform time normalisation */
+    cpl_propertylist_update_string(header, "BUNIT", "ADU/s");
+    dummy = cpl_image_divide_scalar_create(mapped_sky, alltime);
+    if (dfs_save_image(frameset, dummy, mapped_science_sky_tag, header, 
+            parlist, recipe, version))
+        fors_science_exit(NULL);
+    cpl_image_delete(dummy); dummy = NULL;
 
 /*    if (skyglobal == 0 && skymedian < 0) {    NSS */
     if (skyglobal == 0 && skymedian == 0 && skylocal == 0) {
@@ -1793,8 +1754,9 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
         if (skymap) {
             if (skyglobal) {
-                if (time_normalise)
-                    cpl_table_divide_scalar(sky, "sky", alltime);
+                /* Perform time normalisation */
+                cpl_table_divide_scalar(sky, "sky", alltime);
+
                 if (dfs_save_table(frameset, sky, global_sky_spectrum_tag, 
                                    NULL, parlist, recipe, version))
                     fors_science_exit(NULL);
@@ -1804,8 +1766,9 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
             save_header = dfs_load_header(frameset, science_tag, 0);
 
-            if (time_normalise)
-                cpl_image_divide_scalar(skymap, alltime);
+            /* Perform time normalisation */
+            cpl_image_divide_scalar(skymap, alltime);
+            
             if (dfs_save_image(frameset, skymap, unmapped_sky_tag,
                                save_header, parlist, recipe, version))
                 fors_science_exit(NULL);
@@ -1837,7 +1800,7 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
                 smapped = mos_spatial_calibration(spectra, slits, polytraces, 
                                                   reference, startwavelength, 
                                                   endwavelength, dispersion, 
-                                                  flux, NULL);
+                                                  1, NULL);
             }
         }
         else {
@@ -1866,7 +1829,7 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
     mapped = mos_wavelength_calibration(smapped, reference,
                                         startwavelength, endwavelength,
-                                        dispersion, idscoeff, flux);
+                                        dispersion, idscoeff, 1);
 
     cpl_image_delete(smapped); smapped = NULL;
 
@@ -1888,6 +1851,19 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
             cpl_image_delete(skylocalmap); skylocalmap = NULL;
     }
 
+    if (photometry) {
+        if (have_phot && !standard) {
+            if (cpl_frameset_count_tags(frameset, specphot_tag) == 0) {
+                photcal = dfs_load_table(frameset, 
+                                         master_specphot_tag, 1);
+            }
+            else {
+                photcal = dfs_load_table(frameset, specphot_tag, 1);
+            }
+        }
+    }    
+    
+    
 /*    if (skyglobal || skymedian >= 0 || skylocal) {   NSS */
     if (skyglobal || skymedian || skylocal) {
 
@@ -1895,20 +1871,13 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
 
         cpl_image_delete(mapped_sky); mapped_sky = NULL;
 
-        if (time_normalise) {
-            cpl_propertylist_update_string(header, "BUNIT", "ADU/s");
-            dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);
-            if (dfs_save_image(frameset, dummy, mapped_sky_tag, header,
-                               parlist, recipe, version))
-                fors_science_exit(NULL);
-            cpl_image_delete(dummy); dummy = NULL;
-        }
-        else {
-            cpl_propertylist_update_string(header, "BUNIT", "ADU");
-            if (dfs_save_image(frameset, skylocalmap, mapped_sky_tag, header,
-                               parlist, recipe, version))
-                fors_science_exit(NULL);
-        }
+        /* Perform time normalisation */
+        cpl_propertylist_update_string(header, "BUNIT", "ADU/s");
+        dummy = cpl_image_divide_scalar_create(skylocalmap, alltime);
+        if (dfs_save_image(frameset, dummy, mapped_sky_tag, header,
+                parlist, recipe, version))
+            fors_science_exit(NULL);
+        cpl_image_delete(dummy); dummy = NULL;
 
         cpl_msg_indent_less();
         cpl_msg_info(recipe, "Object detection...");
@@ -2187,20 +2156,16 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
                 cpl_image_delete(calibrated);
             }
 
-            if (time_normalise) {
-                cpl_propertylist_update_string(header, "BUNIT", "ADU/s");
-                cpl_image_divide_scalar(images[0], alltime);
-            }
-            else {
-                cpl_propertylist_update_string(header, "BUNIT", "ADU");
-            }
+            /* Perform time normalisation */
+            cpl_propertylist_update_string(header, "BUNIT", "ADU/s");
+            cpl_image_divide_scalar(images[0], alltime);
 
             if (dfs_save_image(frameset, images[0], reduced_science_tag, header,
                                parlist, recipe, version))
                 fors_science_exit(NULL);
 
-            if (time_normalise)
-                cpl_image_divide_scalar(images[1], alltime);
+            /* Perform time normalisation */
+            cpl_image_divide_scalar(images[1], alltime);
 
             if (dfs_save_image(frameset, images[1], reduced_sky_tag, header,
                                parlist, recipe, version))
@@ -2235,13 +2200,9 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
             }
 
     
-            if (time_normalise) {
-                cpl_propertylist_update_string(header, "BUNIT", "ADU/s");
-                cpl_image_divide_scalar(images[2], alltime);
-            }
-            else {
-                cpl_propertylist_update_string(header, "BUNIT", "ADU");
-            }
+            /* Perform time normalisation */
+            cpl_propertylist_update_string(header, "BUNIT", "ADU/s");
+            cpl_image_divide_scalar(images[2], alltime);
 
             if (dfs_save_image(frameset, images[2], reduced_error_tag, header,
                                parlist, recipe, version))
@@ -2276,6 +2237,7 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
         cpl_image *calibrated;
         cpl_table *ext_table; 
 
+
         ext_table = dfs_load_table(frameset, "EXTINCT_TABLE", 1);
 
         calibrated = mos_apply_photometry(mapped, photcal,
@@ -2297,13 +2259,9 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
         cpl_image_delete(calibrated);
     }
 
-    if (time_normalise) {
-        cpl_propertylist_update_string(header, "BUNIT", "ADU/s");
-        cpl_image_divide_scalar(mapped, alltime);
-    }
-    else {
-        cpl_propertylist_update_string(header, "BUNIT", "ADU");
-    }
+    /* Perform time normalisation */
+    cpl_propertylist_update_string(header, "BUNIT", "ADU/s");
+    cpl_image_divide_scalar(mapped, alltime);
 
     if (dfs_save_image(frameset, mapped, mapped_science_tag, header, 
             parlist, recipe, version))
@@ -2314,7 +2272,8 @@ static int fors_science(cpl_parameterlist *parlist, cpl_frameset *frameset)
     cpl_propertylist_delete(header); header = NULL;
 
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_func, "Error found in %s: %s",
+                      cpl_error_get_where(), cpl_error_get_message());
         fors_science_exit(NULL);
     }
     else 
diff --git a/recipes/fors_subtract_sky.c b/recipes/fors_subtract_sky.c
index a52cbca..48e0f43 100644
--- a/recipes/fors_subtract_sky.c
+++ b/recipes/fors_subtract_sky.c
@@ -1,4 +1,4 @@
-/* $Id: fors_subtract_sky.c,v 1.8 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_subtract_sky.c,v 1.8 2013-04-24 14:14:13 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
+ * $Date: 2013-04-24 14:14:13 $
  * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_subtract_sky_lss.c b/recipes/fors_subtract_sky_lss.c
index 4db3251..0de31f4 100644
--- a/recipes/fors_subtract_sky_lss.c
+++ b/recipes/fors_subtract_sky_lss.c
@@ -1,4 +1,4 @@
-/* $Id: fors_subtract_sky_lss.c,v 1.5 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_subtract_sky_lss.c,v 1.6 2013-10-09 15:59:38 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-10-09 15:59:38 $
+ * $Revision: 1.6 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -434,7 +434,7 @@ static int fors_subtract_sky_lss(cpl_parameterlist *parlist,
     cpl_propertylist_delete(header); header = NULL;
 
     if (cpl_error_get_code()) {
-        cpl_msg_error(cpl_error_get_where(), cpl_error_get_message());
+        cpl_msg_error(cpl_error_get_where(), "%s", cpl_error_get_message());
         fors_subtract_sky_lss_exit(NULL);
     }
     else 
diff --git a/recipes/fors_sumflux.c b/recipes/fors_sumflux.c
index 8b143a3..e40a88e 100644
--- a/recipes/fors_sumflux.c
+++ b/recipes/fors_sumflux.c
@@ -1,4 +1,4 @@
-/* $Id: fors_sumflux.c,v 1.11 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_sumflux.c,v 1.11 2013-04-24 14:14:13 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
+ * $Date: 2013-04-24 14:14:13 $
  * $Revision: 1.11 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/fors_trace_flat.c b/recipes/fors_trace_flat.c
index 6db54f9..3eeb12a 100644
--- a/recipes/fors_trace_flat.c
+++ b/recipes/fors_trace_flat.c
@@ -1,4 +1,4 @@
-/* $Id: fors_trace_flat.c,v 1.7 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_trace_flat.c,v 1.8 2013-08-20 16:58:25 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-08-20 16:58:25 $
+ * $Revision: 1.8 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -370,15 +370,12 @@ static int fors_trace_flat(cpl_parameterlist *parlist,
     int         flat_mxu;
     int         flat_mos;
     int         flat_lss;
-    int         mxu, mos;
+    int         mos;
     int         nflat;
-    int         nslits;
     int         rebin;
     int         nx, ny;
     int         treat_as_lss;
-    int         i;
     double      reference;
-    double     *xpos;
     double      mxpos;
     int         nslits_out_det = 0;
 
@@ -463,10 +460,9 @@ static int fors_trace_flat(cpl_parameterlist *parlist,
         fors_trace_flat_exit(NULL);
     }
 
-    mxu = mos = 0;
+    mos = 0;
 
     if (flat_mxu) {
-        mxu = 1;
         master_flat_tag   = "MASTER_SCREEN_FLAT_MXU";
         slit_detect_tag   = "SLIT_LOCATION_DETECT_MXU";
         slit_location_tag = "SLIT_LOCATION_MXU";
diff --git a/recipes/fors_wave_calib.c b/recipes/fors_wave_calib.c
index e44600b..405dc1e 100644
--- a/recipes/fors_wave_calib.c
+++ b/recipes/fors_wave_calib.c
@@ -1,4 +1,4 @@
-/* $Id: fors_wave_calib.c,v 1.7 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_wave_calib.c,v 1.9 2013-08-20 17:02:58 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.7 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-08-20 17:02:58 $
+ * $Revision: 1.9 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -432,11 +432,9 @@ static int fors_wave_calib(cpl_parameterlist *parlist,
     const char *spectral_resolution_tag;
     int         lamp_mxu;
     int         lamp_mos;
-    int         mxu, mos;
+    int         mos;
     int         treat_as_lss = 0;
-    int         nslits;
     double      mean_rms;
-    double     *xpos;
     double      mxpos;
     int         narc, nref;
     int         nlines;
@@ -551,10 +549,9 @@ static int fors_wave_calib(cpl_parameterlist *parlist,
         fors_wave_calib_exit(NULL);
     }
 
-    mxu = mos = 0;
+    mos = 0;
 
     if (lamp_mxu) {
-        mxu = 1;
         arc_tag                 = "RECTIFIED_LAMP_MXU";
         slit_location_tag       = "SLIT_LOCATION_MXU";
         spatial_map_tag         = "SPATIAL_MAP_MXU";
@@ -781,7 +778,7 @@ static int fors_wave_calib(cpl_parameterlist *parlist,
                                                  reference, &startwavelength,
                                                  &endwavelength, fitlines,
                                                  fiterror, idscoeff, rainbow,
-                                                 residual, NULL);
+                                                 residual, NULL, NULL);
 
     cpl_image_delete(spectra); spectra = NULL;
 
diff --git a/recipes/fors_wave_calib_lss.c b/recipes/fors_wave_calib_lss.c
index d3743fe..869ad01 100644
--- a/recipes/fors_wave_calib_lss.c
+++ b/recipes/fors_wave_calib_lss.c
@@ -1,4 +1,4 @@
-/* $Id: fors_wave_calib_lss.c,v 1.9 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: fors_wave_calib_lss.c,v 1.10 2013-09-09 12:25:33 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
- * $Revision: 1.9 $
- * $Name: fors-4_9_23 $
+ * $Date: 2013-09-09 12:25:33 $
+ * $Revision: 1.10 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -740,7 +740,7 @@ static int fors_wave_calib_lss(cpl_parameterlist *parlist,
                                                &startwavelength,
                                                &endwavelength, NULL,
                                                NULL, idscoeff_all, wavemap,
-                                               NULL, NULL, NULL);
+                                               NULL, NULL, NULL, NULL);
 
     if (rectified == NULL)
         fors_wave_calib_lss_exit("Wavelength calibration failure.");
@@ -781,7 +781,7 @@ static int fors_wave_calib_lss(cpl_parameterlist *parlist,
                                                &startwavelength,
                                                &endwavelength, fitlines,
                                                fiterror, idscoeff, NULL,
-                                               residual, NULL, NULL);
+                                               residual, NULL, NULL, NULL);
 
     if (rectified == NULL)
         fors_wave_calib_lss_exit("Wavelength calibration failure.");
diff --git a/recipes/fors_zeropoint.c b/recipes/fors_zeropoint.c
index d61cb81..b75b2e9 100644
--- a/recipes/fors_zeropoint.c
+++ b/recipes/fors_zeropoint.c
@@ -1,4 +1,4 @@
-/* $Id: fors_zeropoint.c,v 1.8 2011/10/12 15:01:16 cgarcia Exp $
+/* $Id: fors_zeropoint.c,v 1.8 2011-10-12 15:01:16 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2011/10/12 15:01:16 $
+ * $Date: 2011-10-12 15:01:16 $
  * $Revision: 1.8 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/montecarlo.c b/recipes/montecarlo.c
index 6a6ae78..41b9fc2 100644
--- a/recipes/montecarlo.c
+++ b/recipes/montecarlo.c
@@ -1,4 +1,4 @@
-/* $Id: montecarlo.c,v 1.5 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: montecarlo.c,v 1.5 2013-04-24 14:14:13 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
+ * $Date: 2013-04-24 14:14:13 $
  * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/test_hough.c b/recipes/test_hough.c
index fe5202f..0128340 100644
--- a/recipes/test_hough.c
+++ b/recipes/test_hough.c
@@ -1,4 +1,4 @@
-/* $Id: test_hough.c,v 1.5 2013/04/24 14:14:13 cgarcia Exp $
+/* $Id: test_hough.c,v 1.5 2013-04-24 14:14:13 cgarcia Exp $
  *
  * This file is part of the FORS Data Reduction Pipeline
  * Copyright (C) 2002-2010 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: cgarcia $
- * $Date: 2013/04/24 14:14:13 $
+ * $Date: 2013-04-24 14:14:13 $
  * $Revision: 1.5 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/recipes/tests/Makefile.in b/recipes/tests/Makefile.in
index 2b0c10d..af7fc3a 100644
--- a/recipes/tests/Makefile.in
+++ b/recipes/tests/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,29 @@
 
 @SET_MAKE@
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,47 +54,84 @@ target_triplet = @target@
 check_PROGRAMS = recipes-test$(EXEEXT)
 subdir = recipes/tests
 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/admin/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
-	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/purify.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am_recipes_test_OBJECTS = recipes-test.$(OBJEXT)
 recipes_test_OBJECTS = $(am_recipes_test_OBJECTS)
 recipes_test_LDADD = $(LDADD)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
 SOURCES = $(recipes_test_SOURCES)
 DIST_SOURCES = $(recipes_test_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkgincludedir)"
-pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
 HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS)
 ETAGS = etags
 CTAGS = ctags
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = $(am__tty_colors_dummy)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
@@ -105,16 +156,17 @@ CX_LDFLAGS = @CX_LDFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOXYGEN = @DOXYGEN@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 FORS_BINARY_AGE = @FORS_BINARY_AGE@
 FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
 FORS_INCLUDES = @FORS_INCLUDES@
@@ -124,12 +176,17 @@ FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
 FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
 FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
 FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
 LATEX = @LATEX@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBCEXT = @LIBCEXT@
 LIBCFITSIO = @LIBCFITSIO@
@@ -145,48 +202,52 @@ LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 LT_AGE = @LT_AGE@
 LT_CURRENT = @LT_CURRENT@
 LT_REVISION = @LT_REVISION@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
 MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
-ONLINE_MODE_FALSE = @ONLINE_MODE_FALSE@
-ONLINE_MODE_TRUE = @ONLINE_MODE_TRUE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PURIFY_CMD = @PURIFY_CMD@
-PURIFY_FALSE = @PURIFY_FALSE@
-PURIFY_TRUE = @PURIFY_TRUE@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 all_includes = @all_includes@
 all_ldflags = @all_ldflags@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -198,8 +259,12 @@ build_alias = @build_alias@
 build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
+builddir = @builddir@
 configdir = @configdir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -212,17 +277,21 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 pipedocsdir = @pipedocsdir@
 plugindir = @plugindir@
 prefix = @prefix@
 privatelibdir = @privatelibdir@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target = @target@
@@ -230,6 +299,9 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 wkfcopydir = @wkfcopydir@
 wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = 1.6 foreign
@@ -263,14 +335,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  recipes/tests/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  recipes/tests/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign recipes/tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign recipes/tests/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -288,16 +360,19 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 clean-checkPROGRAMS:
-	@list='$(check_PROGRAMS)'; for p in $$list; do \
-	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  echo " rm -f $$p $$f"; \
-	  rm -f $$p $$f ; \
-	done
-recipes-test$(EXEEXT): $(recipes_test_OBJECTS) $(recipes_test_DEPENDENCIES) 
+	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+recipes-test$(EXEEXT): $(recipes_test_OBJECTS) $(recipes_test_DEPENDENCIES) $(EXTRA_recipes_test_DEPENDENCIES) 
 	@rm -f recipes-test$(EXEEXT)
-	$(LINK) $(recipes_test_LDFLAGS) $(recipes_test_OBJECTS) $(recipes_test_LDADD) $(LIBS)
+	$(LINK) $(recipes_test_OBJECTS) $(recipes_test_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -308,22 +383,22 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/recipes-test.Po at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
@@ -333,72 +408,90 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-
-distclean-libtool:
-	-rm -f libtool
-uninstall-info-am:
 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
-	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
+	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
-	  $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
 	done
 
 uninstall-pkgincludeHEADERS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(pkginclude_HEADERS)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
-	done
+	@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -406,58 +499,73 @@ distclean-tags:
 check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
-	list='$(TESTS)'; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
 	    elif test -f $$tst; then dir=; \
 	    else dir="$(srcdir)/"; fi; \
-	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
 	      all=`expr $$all + 1`; \
 	      case " $(XFAIL_TESTS) " in \
-	      *" $$tst "*) \
+	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
 	      all=`expr $$all + 1`; \
 	      case " $(XFAIL_TESTS) " in \
-	      *" $$tst "*) \
+	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
 	  if test "$$failed" -eq 0; then \
 	    if test "$$xfail" -eq 0; then \
-	      banner="All $$all tests passed"; \
+	      banner="$$All$$all $$tests passed"; \
 	    else \
-	      banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
 	    fi; \
 	  else \
 	    if test "$$xpass" -eq 0; then \
-	      banner="$$failed of $$all tests failed"; \
+	      banner="$$failed of $$all $$tests failed"; \
 	    else \
-	      banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
 	    fi; \
 	  fi; \
 	  dashes="$$banner"; \
 	  skipped=""; \
 	  if test "$$skip" -ne 0; then \
-	    skipped="($$skip tests were not run)"; \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
 	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
 	      dashes="$$skipped"; \
 	  fi; \
@@ -468,38 +576,46 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
-	  echo "$$banner"; \
-	  test -z "$$skipped" || echo "$$skipped"; \
-	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -510,7 +626,7 @@ check: check-am
 all-am: Makefile $(HEADERS)
 installdirs:
 	for dir in "$(DESTDIR)$(pkgincludedir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
 install-exec: install-exec-am
@@ -522,16 +638,22 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
@@ -547,7 +669,7 @@ distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-libtool distclean-tags
+	distclean-tags
 
 dvi: dvi-am
 
@@ -555,18 +677,38 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
 
 install-data-am: install-pkgincludeHEADERS
 
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-am
+
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -587,20 +729,24 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
+uninstall-am: uninstall-pkgincludeHEADERS
+
+.MAKE: check-am install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
 	clean-checkPROGRAMS clean-generic clean-libtool clean-local \
-	ctags distclean distclean-compile distclean-generic \
+	cscopelist ctags distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-pkgincludeHEADERS \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkgincludeHEADERS install-ps install-ps-am \
 	install-strip installcheck installcheck-am installdirs \
 	maintainer-clean maintainer-clean-generic mostlyclean \
 	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
 	pdf pdf-am ps ps-am tags uninstall uninstall-am \
-	uninstall-info-am uninstall-pkgincludeHEADERS
+	uninstall-pkgincludeHEADERS
 
 
 # We need to remove any files that the above tests created.
@@ -608,6 +754,7 @@ clean-local:
 	 $(RM) *.log
 
 @PURIFY_TRUE at include $(top_builddir)/Makefile.purify
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/recipes/tests/recipes-test.c b/recipes/tests/recipes-test.c
index e868c9e..827f5ce 100644
--- a/recipes/tests/recipes-test.c
+++ b/recipes/tests/recipes-test.c
@@ -1,4 +1,4 @@
-/* $Id: recipes-test.c,v 1.6 2007/10/26 14:02:15 jmlarsen Exp $
+/* $Id: recipes-test.c,v 1.6 2007-10-26 14:02:15 jmlarsen Exp $
  *
  * This file is part of the FORS Library
  * Copyright (C) 2002-2006 European Southern Observatory
@@ -20,9 +20,9 @@
 
 /*
  * $Author: jmlarsen $
- * $Date: 2007/10/26 14:02:15 $
+ * $Date: 2007-10-26 14:02:15 $
  * $Revision: 1.6 $
- * $Name: fors-4_9_23 $
+ * $Name: not supported by cvs2svn $
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/reflex/ForsSpec.xml.in b/reflex/ForsSpec.xml.in
index 8817e44..d1585f3 100644
--- a/reflex/ForsSpec.xml.in
+++ b/reflex/ForsSpec.xml.in
@@ -28,11 +28,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
-<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -77,11 +77,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
 <property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
-<property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
 <property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -126,11 +126,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
-<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -149,7 +149,7 @@
         <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:434:1">
         </property>
     </property>
-    <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.1.devel">
+    <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="9.1.devel">
     </property>
     <property name="ROOT_DATA_DIR" class="ptolemy.data.expr.FileParameter" value="ROOT_DATA_PATH_TO_REPLACE/">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
@@ -200,7 +200,7 @@
             </property>
         </property>
     </property>
-    <property name="BOOKKEEPING_DIR" class="ptolemy.data.expr.FileParameter" value="$ROOT_DATA_DIR/reflex_book_keeping/Fors">
+    <property name="BOOKKEEPING_DIR" class="ptolemy.data.expr.FileParameter" value="$ROOT_DATA_DIR/reflex_book_keeping/fors">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>none</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>yang zhao, edward lee</configure></property>
@@ -247,7 +247,7 @@
         <property name="allowDirectories" class="ptolemy.data.expr.Parameter" value="true">
         </property>
     </property>
-    <property name="LOGS_DIR" class="ptolemy.data.expr.FileParameter" value="$ROOT_DATA_DIR/reflex_logs/Fors">
+    <property name="LOGS_DIR" class="ptolemy.data.expr.FileParameter" value="$ROOT_DATA_DIR/reflex_logs/fors">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>none</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>yang zhao, edward lee</configure></property>
@@ -294,7 +294,7 @@
         <property name="allowDirectories" class="ptolemy.data.expr.Parameter" value="true">
         </property>
     </property>
-    <property name="TMP_PRODUCTS_DIR" class="ptolemy.data.expr.FileParameter" value="$ROOT_DATA_DIR/reflex_tmp_products/Fors">
+    <property name="TMP_PRODUCTS_DIR" class="ptolemy.data.expr.FileParameter" value="$ROOT_DATA_DIR/reflex_tmp_products/fors">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>none</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>yang zhao, edward lee</configure></property>
@@ -388,13 +388,13 @@
         <property name="allowDirectories" class="ptolemy.data.expr.Parameter" value="true">
         </property>
     </property>
-    <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={124, 37, 1682, 1112}, maximized=false}">
+    <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={117, 67, 1682, 1112}, maximized=false}">
     </property>
     <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[1366, 959]">
     </property>
-    <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="0.7446170618697">
+    <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="0.7391659852820932">
     </property>
-    <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{345.2499999999998, 614.9551610541727}">
+    <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{346.01438053097354, 611.704092920354}">
     </property>
     <property name="Annotation13" class="ptolemy.vergil.kernel.attributes.TextAttribute">
         <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
@@ -487,11 +487,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
 <property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
-<property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
 <property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -601,11 +601,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
-<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -919,7 +919,7 @@
         <property name="_location" class="ptolemy.kernel.util.Location" value="[635.0, 290.0]">
         </property>
     </property>
-    <property name="END_PRODUCTS_SUBDIR" class="ptolemy.data.expr.StringParameter" value="2013-02-28T17:53:34/FORS2.2010-05-03T03:36:35.486">
+    <property name="END_PRODUCTS_SUBDIR" class="ptolemy.data.expr.StringParameter" value="2013-10-25T18:57:47/FORS2.2010-05-03T03:36:35.486">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
@@ -953,7 +953,7 @@
         <property name="_location" class="ptolemy.kernel.util.Location" value="[445.0, 1230.0]">
         </property>
     </property>
-    <property name="GLOBAL_TIMESTAMP" class="ptolemy.data.expr.StringParameter" value="2013-02-28T17:53:34">
+    <property name="GLOBAL_TIMESTAMP" class="ptolemy.data.expr.StringParameter" value="2013-10-25T18:57:47">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
@@ -1013,11 +1013,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
-<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -1107,11 +1107,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
-<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -1203,11 +1203,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
-<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -1281,8 +1281,8 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Gang Zhou</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>
            <p> The dynamic dataflow (DDF) domain is a superset of the synchronous
            dataflow(SDF) and Boolean dataflow(BDF) domains. In the SDF domain,
            an actor consumes and produces a fixed number of tokens per firing.
            This static information makes possible compile-time scheduling. In the
            DDF domain, there are few  [...]
-<property name="prop:iterations" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify the number of times a workflow is iterated. By default, this parameter is set to "0". Note that "0" does not mean "no iterations." Rather, "0" means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. </configure></property>
 <property name="prop:maximumReceiverCapacity" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A Parameter representing the maximum capacity of each receiver controlled by this director. This is an integer that defaults to 0, which means the queue in each receiver is unbounded. To specify bounded queues, set this to a positive integer. </configure></property>
+<property name="prop:iterations" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify the number of times a workflow is iterated. By default, this parameter is set to "0". Note that "0" does not mean "no iterations." Rather, "0" means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. </configure></property>
 <property name="prop:runUntilDeadlockInOneIteration" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A parameter indicating whether one iteration consists of repeated basic iterations until deadlock. If this parameter is true, the model will be executed until deadlock in one iteration. The default value is a BooleanToken with the value false. It cannot be set to true if this director is at the top level.</configure></property>
 </property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:director:5:1">
         </property>
@@ -1297,7 +1297,7 @@
         <property name="_location" class="ptolemy.kernel.util.Location" value="[-530.0, -20.0]">
         </property>
     </property>
-    <property name="RAWDATA_DIR" class="ptolemy.data.expr.FileParameter" value="$ROOT_DATA_DIR/reflex_input/Fors">
+    <property name="RAWDATA_DIR" class="ptolemy.data.expr.FileParameter" value="$ROOT_DATA_DIR/reflex_input/fors">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>none</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>yang zhao, edward lee</configure></property>
@@ -1393,9 +1393,9 @@
         <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1:urn:lsid:kepler-project.org/ns/:19529:28:1">
         </property>
     </property>
-    <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1:urn:lsid:kepler-project.org/ns/:12776:4:415:urn:lsid:kepler-project.org/ns/:12776:55:75:urn:lsid:kepler-project.org/ns/:12776:59:142:urn:lsid:kepler-project.org/ns/:12776:68:228:urn:lsid:kepler-project.org/ns/:12776:84:51:urn:lsid:kepler-project.org/ns/:2745:31:9:urn:lsid:kepler-project.org/ns/:2745:32:214:urn:lsid:kepler-project.org/ns/:2745:45:122:urn:lsid:kepl [...]
+    <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1:urn:lsid:kepler-project.org/ns/:12776:4:415:urn:lsid:kepler-project.org/ns/:12776:55:75:urn:lsid:kepler-project.org/ns/:12776:59:142:urn:lsid:kepler-project.org/ns/:12776:68:228:urn:lsid:kepler-project.org/ns/:12776:84:51:urn:lsid:kepler-project.org/ns/:2745:31:9:urn:lsid:kepler-project.org/ns/:2745:32:214:urn:lsid:kepler-project.org/ns/:2745:45:122:urn:lsid:kepl [...]
     </property>
-    <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:37891:4:2">
+    <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:46821:7:9">
     </property>
     <property name="Annotation53" class="ptolemy.vergil.kernel.attributes.TextAttribute">
         <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
@@ -1539,7 +1539,7 @@
         </property>
         <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
         </property>
-        <property name="_location" class="ptolemy.kernel.util.Location" value="[-185.0, -15.0]">
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[-200.0, -10.0]">
         </property>
         <property name="" class="ptolemy.vergil.basic.DocAttribute">
             <property name="description" class="ptolemy.kernel.util.StringAttribute" value="Use the Annotation attribute to annotate a workflow. Double-click the attribute to customize the content, font size, color, and basic formatting (bold and italics).">
@@ -1626,11 +1626,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
 <property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
-<property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
 <property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -2121,456 +2121,2678 @@
         <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
         </property>
     </property>
-    <entity name="FitsRouter" class="org.eso.FitsRouter">
+    <property name="DataSelectionMethod" class="ptolemy.data.expr.StringParameter" value="Interactive">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
-<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>1.0</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The FitsRouter routes files base on their category: by default, all the files are routed to the rejected directory, but the user can add additional port and configure the actor to route particular files there.</p>
<p>Basic Mode: create an output port named as a category (e.g.: FLAT), all files belonging to that category will be routed to that port.</p>
& [...]
-<property name="port:in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input data</configure></property>
-<property name="port:sof rejected" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The rejected SoF</configure></property>
-<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:25158:48:11">
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:43955:86:1">
         </property>
-        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.FitsRouter">
-            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
             </property>
         </property>
-        <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
         </property>
-        <property name="_location" class="ptolemy.kernel.util.Location" value="[-345.0, 1000.0]">
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
         </property>
-        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:903:1:urn:lsid:kepler-project.org/ns/:15314:175:101">
+        <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
         </property>
-        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+            <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+            </property>
         </property>
-        <property name="bias_config" class="ptolemy.data.expr.Parameter" value=""BIAS"">
+        <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+            <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
         </property>
-        <property name="sci_config" class="ptolemy.data.expr.Parameter" value=""SCIENCE_MXU,SCIENCE_MOS,SCIENCE_LSS"">
+        <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
         </property>
-        <property name="std_config" class="ptolemy.data.expr.Parameter" value=""STANDARD_MOS,STD_FLUX_TABLE"">
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[635.0, 430.0]">
         </property>
-        <property name="static_config" class="ptolemy.data.expr.Parameter" value=""MASTER_LINECAT,GRISM_TABLE,EXTINCT_TABLE"">
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
         </property>
-        <property name="calib_config" class="ptolemy.data.expr.Parameter" value=""SCREEN_FLAT_MXU,LAMP_MXU,SCREEN_FLAT_MOS,LAMP_MOS,SCREEN_FLAT_LSS,LAMP_LSS"">
+    </property>
+    <property name="Annotation9" class="ptolemy.vergil.kernel.attributes.TextAttribute">
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
         </property>
-        <property name="CALIB_AUX_config" class="ptolemy.data.expr.Parameter" value=""MASTER_LINECAT,GRISM_TABLE"">
+        <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
         </property>
-        <property name="SCI_AUX_config" class="ptolemy.data.expr.Parameter" value=""MASTER_LINECAT,GRISM_TABLE,EXTINCT_TABLE"">
+        <property name="textSize" class="ptolemy.data.expr.Parameter" value="14">
         </property>
-        <port name="in" class="ptolemy.actor.TypedIOPort">
-            <property name="input"/>
-            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
-            </property>
-            <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
-            </property>
-        </port>
-        <port name="sof rejected" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="multiport"/>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
-            </property>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
-            </property>
-        </port>
-        <port name="sci" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
-            </property>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+        <property name="textColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.4,0.4,0.0,1.0}">
+        </property>
+        <property name="fontFamily" class="ptolemy.data.expr.StringParameter" value="SansSerif">
+        </property>
+        <property name="bold" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="italic" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Selection method for the Data Set Chooser">
+            <property name="_style" class="ptolemy.actor.gui.style.TextStyle">
+                <property name="height" class="ptolemy.data.expr.Parameter" value="20">
+                </property>
+                <property name="width" class="ptolemy.data.expr.Parameter" value="80">
+                </property>
             </property>
-        </port>
-        <port name="std" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Use the Annotation attribute to annotate a workflow. Double-click the attribute to customize the content, font size, color, and basic formatting (bold and italics).</configure></property>
+<property name="prop:fontFamily" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font face. Select a font from the drop-down menu. The default is "SansSerif".</configure></property>
+<property name="prop:italic" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be italics. By default, type will not be italicized.</configure></property>
+<property name="prop:bold" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be bold. By default, type will not be bold.</configure></property>
+<property name="prop:textColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
+<property name="prop:textSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.</configure></property>
+<property name="prop:text" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The text of the annotation.</configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:43955:85:3">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.TextAttribute">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1199:1">
             </property>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DocumentationActor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[880.0, 420.0]">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1">
+        </property>
+    </property>
+    <property name="Annotation10" class="ptolemy.vergil.kernel.attributes.TextAttribute">
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
+        </property>
+        <property name="textSize" class="ptolemy.data.expr.Parameter" value="14">
+        </property>
+        <property name="textColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.4,0.4,0.0,1.0}">
+        </property>
+        <property name="fontFamily" class="ptolemy.data.expr.StringParameter" value="SansSerif">
+        </property>
+        <property name="bold" class="ptolemy.data.expr.Parameter" value="true">
+        </property>
+        <property name="italic" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="text" class="ptolemy.kernel.util.StringAttribute" value="= actor with 
   interactive option

">
+            <property name="_style" class="ptolemy.actor.gui.style.TextStyle">
+                <property name="height" class="ptolemy.data.expr.Parameter" value="20">
+                </property>
+                <property name="width" class="ptolemy.data.expr.Parameter" value="80">
+                </property>
             </property>
-        </port>
-        <port name="static" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Use the Annotation attribute to annotate a workflow. Double-click the attribute to customize the content, font size, color, and basic formatting (bold and italics).</configure></property>
+<property name="prop:fontFamily" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font face. Select a font from the drop-down menu. The default is "SansSerif".</configure></property>
+<property name="prop:italic" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be italics. By default, type will not be italicized.</configure></property>
+<property name="prop:bold" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be bold. By default, type will not be bold.</configure></property>
+<property name="prop:textColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
+<property name="prop:textSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.</configure></property>
+<property name="prop:text" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The text of the annotation.</configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:436:1">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.TextAttribute">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1199:1">
             </property>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DocumentationActor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[1055.0, 90.0]">
+        </property>
+        <property name="" class="ptolemy.vergil.basic.DocAttribute">
+            <property name="author" class="ptolemy.kernel.util.StringAttribute" value="Edward A. Lee">
             </property>
-        </port>
-        <port name="bias" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
             </property>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+            <property name="textSize (parameter)" class="ptolemy.data.expr.StringParameter" value="The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.">
             </property>
-        </port>
-        <port name="calib" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            <property name="textColor (parameter)" class="ptolemy.data.expr.StringParameter" value="The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}">
             </property>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="EAST">
+            <property name="fontFamily (parameter)" class="ptolemy.data.expr.StringParameter" value="The font face. Select a font from the drop-down menu. The default is "SansSerif".">
             </property>
-        </port>
-        <port name="CALIB_AUX" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            <property name="bold (parameter)" class="ptolemy.data.expr.StringParameter" value="Select to indicate that the type should be bold. By default, type will not be bold.">
             </property>
-        </port>
-        <port name="SCI_AUX" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            <property name="italic (parameter)" class="ptolemy.data.expr.StringParameter" value="Select to indicate that the type should be italics. By default, type will not be italicized.">
             </property>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+            <property name="text (parameter)" class="ptolemy.data.expr.StringParameter" value="The text of the annotation.">
             </property>
-        </port>
-    </entity>
-    <entity name="MasterBias" class="ptolemy.actor.TypedCompositeActor">
-        <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.1.devel">
         </property>
-        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:186:21">
+    </property>
+    <property name="Rectangle3" class="ptolemy.vergil.kernel.attributes.RectangleAttribute">
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
         </property>
-        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
-            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
-            </property>
+        <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
         </property>
-        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[990.0, 85.0]">
         </property>
-        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
+        <property name="lineWidth" class="ptolemy.data.expr.Parameter" value="5">
         </property>
-        <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
+        <property name="lineColor" class="ptolemy.actor.gui.ColorAttribute" value="{1.0,0.5,0.0,1.0}">
         </property>
-<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
-<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
+        <property name="width" class="ptolemy.data.expr.Parameter" value="62.0">
+        </property>
+        <property name="height" class="ptolemy.data.expr.Parameter" value="39.0">
+        </property>
+        <property name="centered" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="fillColor" class="ptolemy.actor.gui.ColorAttribute" value="{1.0,0.5,0.0,1.0}">
+        </property>
+        <property name="rounding" class="ptolemy.data.expr.Parameter" value="0.0">
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
+<property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
+<property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
+<property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:16989:11:3">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.RectangleAttribute">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1197:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DecorativeActor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:434:1:urn:lsid:kepler-project.org/ns/:13961:219:11">
+        </property>
+        <property name="_renderFirst" class="ptolemy.kernel.util.SingletonAttribute">
+        </property>
+    </property>
+    <property name="Rectangle7" class="ptolemy.vergil.kernel.attributes.RectangleAttribute">
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[740.0, 800.0]">
+        </property>
+        <property name="lineWidth" class="ptolemy.data.expr.Parameter" value="5">
+        </property>
+        <property name="lineColor" class="ptolemy.actor.gui.ColorAttribute" value="{1.0,0.5,0.0,1.0}">
+        </property>
+        <property name="width" class="ptolemy.data.expr.Parameter" value="114.0">
+        </property>
+        <property name="height" class="ptolemy.data.expr.Parameter" value="72.0">
+        </property>
+        <property name="centered" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="fillColor" class="ptolemy.actor.gui.ColorAttribute" value="{1.0,0.5,0.0,1.0}">
+        </property>
+        <property name="rounding" class="ptolemy.data.expr.Parameter" value="0.0">
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
+<property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
+<property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
+<property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
+<property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
+<property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:13961:219:11">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.RectangleAttribute">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1197:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DecorativeActor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:434:1">
+        </property>
+        <property name="_renderFirst" class="ptolemy.kernel.util.SingletonAttribute">
+        </property>
+    </property>
+    <property name="Rectangle8" class="ptolemy.vergil.kernel.attributes.RectangleAttribute">
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[100.0, 990.0]">
+        </property>
+        <property name="lineWidth" class="ptolemy.data.expr.Parameter" value="5">
+        </property>
+        <property name="lineColor" class="ptolemy.actor.gui.ColorAttribute" value="{1.0,0.5,0.0,1.0}">
+        </property>
+        <property name="width" class="ptolemy.data.expr.Parameter" value="114.0">
+        </property>
+        <property name="height" class="ptolemy.data.expr.Parameter" value="72.0">
+        </property>
+        <property name="centered" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="fillColor" class="ptolemy.actor.gui.ColorAttribute" value="{1.0,0.5,0.0,1.0}">
+        </property>
+        <property name="rounding" class="ptolemy.data.expr.Parameter" value="0.0">
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
+<property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
+<property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
+<property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
+<property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
+<property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:13961:219:11">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.RectangleAttribute">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1197:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DecorativeActor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:434:1">
+        </property>
+        <property name="_renderFirst" class="ptolemy.kernel.util.SingletonAttribute">
+        </property>
+    </property>
+    <property name="GlobalPlotInteractivity" class="ptolemy.data.expr.StringParameter" value="true">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:56:1">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+        </property>
+        <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+        </property>
+        <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+            <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+            </property>
+        </property>
+        <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+            <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+        </property>
+        <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[635.0, 465.0]">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1:urn:lsid:kepler-project.org/ns/:38254:6:1">
+        </property>
+    </property>
+    <property name="Annotation11" class="ptolemy.vergil.kernel.attributes.TextAttribute">
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
+        </property>
+        <property name="textSize" class="ptolemy.data.expr.Parameter" value="14">
+        </property>
+        <property name="textColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.4,0.4,0.0,1.0}">
+        </property>
+        <property name="fontFamily" class="ptolemy.data.expr.StringParameter" value="SansSerif">
+        </property>
+        <property name="bold" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="italic" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Disable interactive GUIs for the whole workflow
Overrides in subworkflows have precedence.">
+            <property name="_style" class="ptolemy.actor.gui.style.TextStyle">
+                <property name="height" class="ptolemy.data.expr.Parameter" value="20">
+                </property>
+                <property name="width" class="ptolemy.data.expr.Parameter" value="80">
+                </property>
+            </property>
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Use the Annotation attribute to annotate a workflow. Double-click the attribute to customize the content, font size, color, and basic formatting (bold and italics).</configure></property>
+<property name="prop:fontFamily" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font face. Select a font from the drop-down menu. The default is "SansSerif".</configure></property>
+<property name="prop:italic" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be italics. By default, type will not be italicized.</configure></property>
+<property name="prop:bold" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be bold. By default, type will not be bold.</configure></property>
+<property name="prop:textColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
+<property name="prop:textSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.</configure></property>
+<property name="prop:text" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The text of the annotation.</configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:38254:7:3">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.TextAttribute">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1199:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DocumentationActor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[880.0, 445.0]">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1">
+        </property>
+    </property>
+    <property name="ProvenanceExplorerEnabled" class="ptolemy.data.expr.StringParameter" value="true">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:60:1">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+        </property>
+        <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+        </property>
+        <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+            <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+            </property>
+        </property>
+        <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+            <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+        </property>
+        <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[635.0, 500.0]">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1:urn:lsid:kepler-project.org/ns/:43955:86:1">
+        </property>
+    </property>
+    <property name="Annotation12" class="ptolemy.vergil.kernel.attributes.TextAttribute">
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
+        </property>
+        <property name="textSize" class="ptolemy.data.expr.Parameter" value="14">
+        </property>
+        <property name="textColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.4,0.4,0.0,1.0}">
+        </property>
+        <property name="fontFamily" class="ptolemy.data.expr.StringParameter" value="SansSerif">
+        </property>
+        <property name="bold" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="italic" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Show Provenance Explorer window">
+            <property name="_style" class="ptolemy.actor.gui.style.TextStyle">
+                <property name="height" class="ptolemy.data.expr.Parameter" value="20">
+                </property>
+                <property name="width" class="ptolemy.data.expr.Parameter" value="80">
+                </property>
+            </property>
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Use the Annotation attribute to annotate a workflow. Double-click the attribute to customize the content, font size, color, and basic formatting (bold and italics).</configure></property>
+<property name="prop:fontFamily" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font face. Select a font from the drop-down menu. The default is "SansSerif".</configure></property>
+<property name="prop:italic" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be italics. By default, type will not be italicized.</configure></property>
+<property name="prop:bold" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be bold. By default, type will not be bold.</configure></property>
+<property name="prop:textColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
+<property name="prop:textSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.</configure></property>
+<property name="prop:text" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The text of the annotation.</configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:61:1">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.TextAttribute">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1199:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DocumentationActor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[880.0, 490.0]">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1:urn:lsid:kepler-project.org/ns/:43955:85:3">
+        </property>
+    </property>
+    <property name="Annotation14" class="ptolemy.vergil.kernel.attributes.TextAttribute">
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
+        </property>
+        <property name="textSize" class="ptolemy.data.expr.Parameter" value="14">
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+        </property>
+        <property name="textColor" class="ptolemy.actor.gui.ColorAttribute" value="{1.0,0.0,0.0,1.0}">
+        </property>
+        <property name="fontFamily" class="ptolemy.data.expr.StringParameter" value="SansSerif">
+        </property>
+        <property name="bold" class="ptolemy.data.expr.Parameter" value="true">
+        </property>
+        <property name="italic" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="text" class="ptolemy.kernel.util.StringAttribute" value="This is a basic workflow to help with data 
organisation and execution of the pipeline. 
The workflow was generated without a 
review of the quality of the science products.">
+            <property name="_style" class="ptolemy.actor.gui.style.TextStyle">
+                <property name="height" class="ptolemy.data.expr.Parameter" value="20">
+                </property>
+                <property name="width" class="ptolemy.data.expr.Parameter" value="80">
+                </property>
+            </property>
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Use the Annotation attribute to annotate a workflow. Double-click the attribute to customize the content, font size, color, and basic formatting (bold and italics).</configure></property>
+<property name="prop:fontFamily" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font face. Select a font from the drop-down menu. The default is "SansSerif".</configure></property>
+<property name="prop:italic" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be italics. By default, type will not be italicized.</configure></property>
+<property name="prop:bold" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Select to indicate that the type should be bold. By default, type will not be bold.</configure></property>
+<property name="prop:textColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
+<property name="prop:textSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.</configure></property>
+<property name="prop:text" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The text of the annotation.</configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:31617:223:8">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.TextAttribute">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1199:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DocumentationActor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[850.0, -15.0]">
+        </property>
+        <property name="" class="ptolemy.vergil.basic.DocAttribute">
+            <property name="author" class="ptolemy.kernel.util.StringAttribute" value="Edward A. Lee">
+            </property>
+            <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
+            </property>
+            <property name="textSize (parameter)" class="ptolemy.data.expr.StringParameter" value="The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.">
+            </property>
+            <property name="textColor (parameter)" class="ptolemy.data.expr.StringParameter" value="The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}">
+            </property>
+            <property name="fontFamily (parameter)" class="ptolemy.data.expr.StringParameter" value="The font face. Select a font from the drop-down menu. The default is "SansSerif".">
+            </property>
+            <property name="bold (parameter)" class="ptolemy.data.expr.StringParameter" value="Select to indicate that the type should be bold. By default, type will not be bold.">
+            </property>
+            <property name="italic (parameter)" class="ptolemy.data.expr.StringParameter" value="Select to indicate that the type should be italics. By default, type will not be italicized.">
+            </property>
+            <property name="text (parameter)" class="ptolemy.data.expr.StringParameter" value="The text of the annotation.">
+            </property>
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1">
+        </property>
+        <property name="_renderLast" class="ptolemy.kernel.util.SingletonAttribute">
+        </property>
+    </property>
+    <property name="Setup Directory5" class="ptolemy.vergil.kernel.attributes.RectangleAttribute">
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="_hideAllParameters" class="ptolemy.data.expr.Parameter" value="true">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[845.0, -20.0]">
+        </property>
+        <property name="lineWidth" class="ptolemy.data.expr.Parameter" value="5">
+        </property>
+        <property name="lineColor" class="ptolemy.actor.gui.ColorAttribute" value="{1.0,0.0,0.0,1.0}">
+        </property>
+        <property name="width" class="ptolemy.data.expr.Parameter" value="375.0">
+        </property>
+        <property name="height" class="ptolemy.data.expr.Parameter" value="80.0">
+        </property>
+        <property name="centered" class="ptolemy.data.expr.Parameter" value="false">
+        </property>
+        <property name="fillColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.99607843,0.9490196,0.7254902,1.0}">
+        </property>
+        <property name="rounding" class="ptolemy.data.expr.Parameter" value="20">
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
+<property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
+<property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
+<property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
+<property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
+<property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:62:1">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.RectangleAttribute">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1197:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#DecorativeActor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:434:1:urn:lsid:kepler-project.org/ns/:25158:26:1:urn:lsid:kepler-project.org/ns/:31617:222:11">
+        </property>
+    </property>
+    <entity name="FitsRouter" class="org.eso.FitsRouter">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>1.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The FitsRouter routes files base on their category: by default, all the files are routed to the rejected directory, but the user can add additional port and configure the actor to route particular files there.</p>
<p>Basic Mode: create an output port named as a category (e.g.: FLAT), all files belonging to that category will be routed to that port.</p>
& [...]
+<property name="port:in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input data</configure></property>
+<property name="port:sof rejected" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The rejected SoF</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:25158:48:11">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.FitsRouter">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+            </property>
+        </property>
+        <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[-345.0, 1000.0]">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:903:1:urn:lsid:kepler-project.org/ns/:15314:175:101">
+        </property>
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="bias_config" class="ptolemy.data.expr.Parameter" value=""BIAS"">
+        </property>
+        <property name="sci_config" class="ptolemy.data.expr.Parameter" value=""SCIENCE_MXU,SCIENCE_MOS,SCIENCE_LSS"">
+        </property>
+        <property name="std_config" class="ptolemy.data.expr.Parameter" value=""STANDARD_MOS,STD_FLUX_TABLE"">
+        </property>
+        <property name="static_config" class="ptolemy.data.expr.Parameter" value=""MASTER_LINECAT,GRISM_TABLE,EXTINCT_TABLE"">
+        </property>
+        <property name="calib_config" class="ptolemy.data.expr.Parameter" value=""SCREEN_FLAT_MXU,LAMP_MXU,SCREEN_FLAT_MOS,LAMP_MOS,SCREEN_FLAT_LSS,LAMP_LSS"">
+        </property>
+        <property name="CALIB_AUX_config" class="ptolemy.data.expr.Parameter" value=""MASTER_LINECAT,GRISM_TABLE"">
+        </property>
+        <property name="SCI_AUX_config" class="ptolemy.data.expr.Parameter" value=""MASTER_LINECAT,GRISM_TABLE,EXTINCT_TABLE"">
+        </property>
+        <port name="in" class="ptolemy.actor.TypedIOPort">
+            <property name="input"/>
+            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+            <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+            </property>
+        </port>
+        <port name="sof rejected" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="multiport"/>
+            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+            </property>
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+            </property>
+        </port>
+        <port name="sci" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+            </property>
+        </port>
+        <port name="std" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+            </property>
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+        </port>
+        <port name="static" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+            </property>
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+        </port>
+        <port name="bias" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+            </property>
+        </port>
+        <port name="calib" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="EAST">
+            </property>
+        </port>
+        <port name="CALIB_AUX" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+        </port>
+        <port name="SCI_AUX" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+            </property>
+        </port>
+    </entity>
+    <entity name="MasterBias" class="ptolemy.actor.TypedCompositeActor">
+        <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.1.devel">
+        </property>
+        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:186:21">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
+        </property>
+        <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director "inherit" the director from the containing workflow and are called non-opaque.</ [...]
+</property>        <property name="_location" class="ptolemy.kernel.util.Location" value="[-140.0, 825.0]">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1">
+        </property>
+        <port name="sof_in" class="ptolemy.actor.TypedIOPort">
+            <property name="input"/>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[20.0, 200.0]">
+            </property>
+        </port>
+        <port name="sof_out" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[525.0, 200.0]">
+            </property>
+        </port>
+        <entity name="fors_bias_1" class="org.eso.RecipeExecuter">
+            <property name="Recipe Failure Mode" class="ptolemy.data.expr.StringParameter" value="$RecipeFailureMode">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[250.0, 190.0]">
+            </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="sop in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+        </entity>
+        <entity name="SofSplitter" class="org.eso.SofSplitter">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofSplitter takes a set of files as input and split it into smaller sets based on the purpose. This smaller sets can then be sent to e.g. a RecipeExecuter</configure></property>
+<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sof</configure></property>
+<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups generated</configure></property>
+<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sofs</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:187:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofSplitter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                </property>
+            </property>
+            <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[105.0, 180.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:5:1">
+            </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+            <port name="sof out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+            <port name="#groups" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
+            </port>
+        </entity>
+        <entity name="SofAccumulator" class="org.eso.SofAccumulator">
+            <property name="same dataset" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofAccumulator is meant to be used together with the SofSplitter: it puts back together in a single set of files the tokens generated by the PurposeSerializer (and usually processed by the RecipeExecuter)</configure></property>
+<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sofs</configure></property>
+<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups to collect</configure></property>
+<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sof</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:same dataset" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If true the SofAccumulator throws an error if the input tokens do not belong all to the same dataset</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:188:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofAccumulator">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                </property>
+            </property>
+            <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[405.0, 180.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:7:1">
+            </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
+            <port name="#groups" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
+            </port>
+            <port name="sof out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+        </entity>
+        <relation name="relation" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation3" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation4" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation5" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <link port="sof_in" relation="relation4"/>
+        <link port="sof_out" relation="relation5"/>
+        <link port="fors_bias_1.sof in" relation="relation"/>
+        <link port="fors_bias_1.sof out" relation="relation3"/>
+        <link port="SofSplitter.sof in" relation="relation4"/>
+        <link port="SofSplitter.sof out" relation="relation"/>
+        <link port="SofSplitter.#groups" relation="relation2"/>
+        <link port="SofAccumulator.sof in" relation="relation3"/>
+        <link port="SofAccumulator.#groups" relation="relation2"/>
+        <link port="SofAccumulator.sof out" relation="relation5"/>
+    </entity>
+    <entity name="SofCombiner" class="org.eso.SofCombiner">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofCombiner takes as input a number of set of files and combines them into one set of files that contains only the files whose purposes are present in all the input tokens. With this respect empty tokens are ignored and files with universal purpose are always collected</configure></property>
+<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sofs</configure></property>
+<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The combined sof</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:189:1">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofCombiner">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+            </property>
+        </property>
+        <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[25.0, 1010.0]">
+        </property>
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:908:1">
+        </property>
+        <port name="sof in" class="ptolemy.actor.TypedIOPort">
+            <property name="input"/>
+            <property name="multiport"/>
+            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+        </port>
+        <port name="sof in opt" class="ptolemy.actor.TypedIOPort">
+            <property name="input"/>
+            <property name="multiport"/>
+            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+        </port>
+        <port name="sof out" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="multiport"/>
+            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+        </port>
+    </entity>
+    <entity name="SofCombiner2" class="org.eso.SofCombiner">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofCombiner takes as input a number of set of files and combines them into one set of files that contains only the files whose purposes are present in all the input tokens. With this respect empty tokens are ignored and files with universal purpose are always collected</configure></property>
+<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sofs</configure></property>
+<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The combined sof</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:31989:66:1">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofCombiner">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+            </property>
+        </property>
+        <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[535.0, 950.0]">
+        </property>
+        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:908:1:urn:lsid:kepler-project.org/ns/:15314:190:1">
+        </property>
+        <port name="sof in" class="ptolemy.actor.TypedIOPort">
+            <property name="input"/>
+            <property name="multiport"/>
+            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+        </port>
+        <port name="sof in opt" class="ptolemy.actor.TypedIOPort">
+            <property name="input"/>
+            <property name="multiport"/>
+            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+            </property>
+        </port>
+        <port name="sof out" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="multiport"/>
+            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+        </port>
+    </entity>
+    <entity name="ForsCalib" class="ptolemy.actor.TypedCompositeActor">
+        <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.1.devel">
+        </property>
+        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:45907:4:10">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
+        </property>
+        <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director "inherit" the director from the containing workflow and are called non-opaque.</ [...]
+</property>        <property name="_location" class="ptolemy.kernel.util.Location" value="[120.0, 1010.0]">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1:urn:lsid:kepler-project.org/ns/:15314:197:23:urn:lsid:kepler-project.org/ns/:44497:41:70:urn:lsid:kepler-project.org/ns/:44576:16:263">
+        </property>
+        <property name="EnableInteractivity" class="ptolemy.data.expr.StringParameter" value="$GlobalPlotInteractivity">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[30.0, 705.0]">
+            </property>
+        </property>
+        <property name="INIT_SRADIUS" class="ptolemy.data.expr.StringParameter" value="10.0">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[815.0, 465.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_DRADIUS" class="ptolemy.data.expr.StringParameter" value="10.0">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:2">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[815.0, 485.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_S_NKNOTS" class="ptolemy.data.expr.StringParameter" value="-1">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:3">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[815.0, 510.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_D_NKNOTS" class="ptolemy.data.expr.StringParameter" value="-1">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:4">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[818.0061105207226, 530.8106568809777]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_SPLFIT_THRESHOLD" class="ptolemy.data.expr.StringParameter" value="0.01">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:5">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[818.0061105207226, 555.8106568809777]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_STACK_METHOD" class="ptolemy.data.expr.StringParameter" value="sum">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:6">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[820.0, 580.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_MINREJECTION" class="ptolemy.data.expr.StringParameter" value="1">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:7">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[820.0, 605.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_MAXREJECTION" class="ptolemy.data.expr.StringParameter" value="1">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:8">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[820.0, 630.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_KITER" class="ptolemy.data.expr.StringParameter" value="999">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:9">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[820.0, 655.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_KLOW" class="ptolemy.data.expr.StringParameter" value="3.0">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:10">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[820.0, 680.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_KHIGH" class="ptolemy.data.expr.StringParameter" value="3.0">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:11">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[820.0, 705.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_WREJECT" class="ptolemy.data.expr.StringParameter" value="0.7">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:12">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[820.0, 730.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_WMODE" class="ptolemy.data.expr.StringParameter" value="2">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:13">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[820.0, 755.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_WMOSMODE" class="ptolemy.data.expr.StringParameter" value="0">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:14">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[820.0, 780.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_WRADIUS" class="ptolemy.data.expr.StringParameter" value="4">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:25:21">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[820.0, 805.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <port name="sof_in" class="ptolemy.actor.TypedIOPort">
+            <property name="input"/>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[-65.0, 630.0]">
+            </property>
+        </port>
+        <port name="sof_out" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[815.0, 350.0]">
+            </property>
+        </port>
+        <entity name="fors_calib_1" class="org.eso.RecipeExecuter">
+            <property name="Recipe Failure Mode" class="ptolemy.data.expr.StringParameter" value="$RecipeFailureMode">
+            </property>
+            <property name="Output Files Category" class="ptolemy.data.expr.StringParameter" value="CURV_COEFF_MXU,CURV_COEFF_MOS,CURV_COEFF_LSS,DISP_COEFF_MXU,DISP_COEFF_MOS,DISP_COEFF_LSS,MASTER_SCREEN_FLAT_MXU,MASTER_SCREEN_FLAT_MOS,MASTER_SCREEN_FLAT_LSS,MASTER_SCREEN_FLAT_LONG_MOS,MASTER_SCREEN_FLAT_LONG_MXU,MASTER_NORM_FLAT_MXU,MASTER_NORM_FLAT_MOS,MASTER_NORM_FLAT_LSS,SLIT_LOCATION_MXU,SLIT_LOCATION_MOS,SLIT_LOCATION_LONG_MXU,SLIT_LOCATION_LONG_MOS,SLIT_LOCATION_LSS,MASTER_NORM_FL [...]
+            </property>
+            <property name="recipe_param_1" class="ptolemy.data.expr.Parameter" value="dispersion=PORT">
+            </property>
+            <property name="recipe_param_2" class="ptolemy.data.expr.Parameter" value="peakdetection=PORT">
+            </property>
+            <property name="recipe_param_3" class="ptolemy.data.expr.Parameter" value="wdegree=PORT">
+            </property>
+            <property name="recipe_param_4" class="ptolemy.data.expr.Parameter" value="wradius=PORT">
+            </property>
+            <property name="recipe_param_5" class="ptolemy.data.expr.Parameter" value="wreject=PORT">
+            </property>
+            <property name="recipe_param_6" class="ptolemy.data.expr.Parameter" value="wmode=PORT">
+            </property>
+            <property name="recipe_param_7" class="ptolemy.data.expr.Parameter" value="wmosmode=PORT">
+            </property>
+            <property name="recipe_param_10" class="ptolemy.data.expr.Parameter" value="cdegree=PORT">
+            </property>
+            <property name="recipe_param_12" class="ptolemy.data.expr.Parameter" value="startwavelength=PORT">
+            </property>
+            <property name="recipe_param_13" class="ptolemy.data.expr.Parameter" value="endwavelength=PORT">
+            </property>
+            <property name="recipe_param_15" class="ptolemy.data.expr.Parameter" value="stack_method=PORT">
+            </property>
+            <property name="recipe_param_16" class="ptolemy.data.expr.Parameter" value="klow=PORT">
+            </property>
+            <property name="recipe_param_17" class="ptolemy.data.expr.Parameter" value="khigh=PORT">
+            </property>
+            <property name="recipe_param_18" class="ptolemy.data.expr.Parameter" value="kiter=PORT">
+            </property>
+            <property name="recipe_param_19" class="ptolemy.data.expr.Parameter" value="s_nknots=PORT">
+            </property>
+            <property name="recipe_param_20" class="ptolemy.data.expr.Parameter" value="sradius=PORT">
+            </property>
+            <property name="recipe_param_21" class="ptolemy.data.expr.Parameter" value="d_nknots=PORT">
+            </property>
+            <property name="recipe_param_22" class="ptolemy.data.expr.Parameter" value="dradius=PORT">
+            </property>
+            <property name="recipe_param_23" class="ptolemy.data.expr.Parameter" value="splfit_threshold=PORT">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[536.0, 467.25]">
+            </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="sop in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="sof out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="multiport"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                </property>
+            </port>
+            <port name="sop out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                </property>
+            </port>
+        </entity>
+        <entity name="SofSplitter" class="org.eso.SofSplitter">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofSplitter takes a set of files as input and split it into smaller sets based on the purpose. This smaller sets can then be sent to e.g. a RecipeExecuter</configure></property>
+<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sof</configure></property>
+<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sofs</configure></property>
+<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups generated</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:198:2">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofSplitter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                </property>
+            </property>
+            <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[-50.0, 540.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:5:1">
+            </property>
+            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+            <port name="sof out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+            <port name="#groups" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
+                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+                </property>
+            </port>
+        </entity>
+        <entity name="SofAccumulator" class="org.eso.SofAccumulator">
+            <property name="same dataset" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofAccumulator is meant to be used together with the SofSplitter: it puts back together in a single set of files the tokens generated by the PurposeSerializer (and usually processed by the RecipeExecuter)</configure></property>
+<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sofs</configure></property>
+<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sof</configure></property>
+<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups to collect</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:same dataset" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If true the SofAccumulator throws an error if the input tokens do not belong all to the same dataset</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:199:2">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofAccumulator">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                </property>
+            </property>
+            <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[720.0, 275.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:7:1">
+            </property>
+            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
+            <port name="#groups" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
+                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+                </property>
+            </port>
+            <port name="sof out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+        </entity>
+        <entity name="RecipeLooper" class="org.eso.RecipeLooper">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The RecipeLooper is an actor designed to allow multiple execution of the same recipe on the same data with different parameters in order to optimize the data reduction.
At the begininning of an iteration it accepts input tokens from the sof in and sop in ports and sends them to the output ports, then it reads tokens from the sof loop and sop loop ports until the token on the iteration [...]
+<property name="port:sof loop" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The loop input sof</configure></property>
+<property name="port:iteration complete" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The signal to terminate the current iteration</configure></property>
+<property name="port:sop in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sop</configure></property>
+<property name="port:sop loop" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The loop input sop</configure></property>
+<property name="port:sop out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The output sop</configure></property>
+<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sof</configure></property>
+<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The output sof</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44497:42:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.RecipeLooper">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                </property>
+            </property>
+            <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[185.0, 470.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:905:1">
+            </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="sop in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="sof loop" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
+            <port name="iteration complete" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
+            <port name="sop loop" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
+        </entity>
+        <entity name="ForsCalibInteractivity" class="org.eso.PythonActor">
+            <property name="Python script" class="ptolemy.data.expr.FileParameter" value="@prefix@/share/esopipes/fors- at VERSION@/reflex/fors_calib_interact.py">
+            </property>
+            <property name="Run in terminal" class="ptolemy.data.expr.Parameter" value="false">
+            </property>
+            <property name="Lazy Mode" class="ptolemy.data.expr.Parameter" value="false">
+            </property>
+            <property name="Recipe Failure Mode" class="ptolemy.data.expr.StringParameter" value="Stop">
+            </property>
+            <property name="Disable logging" class="ptolemy.data.expr.Parameter" value="false">
+            </property>
+            <property name="Clean Temporary Directories" class="ptolemy.data.expr.Parameter" value="false">
+            </property>
+            <property name="Products Dir" class="ptolemy.data.expr.FileParameter" value="$TMP_PRODUCTS_DIR">
+                <property name="allowFiles" class="ptolemy.data.expr.Parameter" value="false">
+                </property>
+                <property name="allowDirectories" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </property>
+            <property name="Logs Dir" class="ptolemy.data.expr.FileParameter" value="$LOGS_DIR">
+                <property name="allowFiles" class="ptolemy.data.expr.Parameter" value="false">
+                </property>
+                <property name="allowDirectories" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </property>
+            <property name="Bookkeeping Dir" class="ptolemy.data.expr.FileParameter" value="$BOOKKEEPING_DIR">
+                <property name="allowFiles" class="ptolemy.data.expr.Parameter" value="false">
+                </property>
+                <property name="allowDirectories" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>This actor executes a Python script</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The PythonActor executes custom python scripts: in order to use a script with this actor you must include the module reflex.py and add a couple of statements to define inputs and outputs (see example.py in the Reflex distribution).
Upon selecting a script, input and output ports are automatically created. If applicable, output tokens are automatically converted to Reflex objects. If t [...]
+<property name="port:stdout" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>This port emits a token containing the standard output generated by the script execution</configure></property>
+<property name="prop:author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:Run in terminal" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If true, the script is invoked through an external xterm, this is needed for scripts that write on the standard output or require standard input (e.g. some pyraf tasks)</configure></property>
+<property name="prop:Python script" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The filename of the script to be executed (full path)</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:15:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.PythonActor">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                </property>
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[515.0, 285.0]">
+            </property>
+            <property name="prop:Disable logging" class="ptolemy.kernel.util.ConfigurableAttribute">
+                <configure>If true, the script does not save the standard output and the standard error of the script execution in the logging directory. This feature is useful if you are using Pyraf and you experience occasional crashes.</configure>
+            </property>
+            <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute">
+                <configure>ESO</configure>
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:904:1:urn:lsid:kepler-project.org/ns/:44497:46:5">
+            </property>
+            <port name="stdout" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_hide" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+            <port name="out_sop_loop" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
+                </property>
+            </port>
+            <port name="out_sof" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+            <port name="set_enable" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+                </property>
+            </port>
+            <port name="in_sof" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
+            </port>
+            <port name="enable" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
+                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+                </property>
+            </port>
+            <port name="iteration_complete" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
+                </property>
+                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+                </property>
+            </port>
+            <port name="in_sof_rec_orig" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
+            </port>
+            <port name="out_sof_loop" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
+                </property>
+            </port>
+            <port name="out_sop" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+                </property>
+            </port>
+            <port name="in_sop" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
+            </port>
+        </entity>
+        <entity name="String Constant" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$EnableInteractivity">
+            </property>
+            <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
+            </property>
+            <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The StringConstant actor outputs a string specified via the actor's value parameter.</p>

<p>Specifying strings with the StringConstant actor is convenient, as the actor does not require that strings be surrounded by quotes. The actor is often used to specify file paths, which can be selected using the Browse button available in the actor's parameters.</p&g [...]
+<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a string constant specified by the value parameter.  </configure></property>
+<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time. </configure></property>
+<property name="prop:firingCountLimit" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.</configure></property>
+<property name="prop:value" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The value produced by the actor. Specified strings do not require enclosing quotes. (To include a '$' sign in the string, enter '$$'.)</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44497:47:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.StringConst">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1052:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#StringFunctionActor">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Constant">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
+                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
+                </property>
+                <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
+                </property>
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[375.0, 390.0]">
+            </property>
+            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1">
+            </property>
+        </entity>
+        <entity name="SetInteractivity" class="ptolemy.actor.lib.SetVariable">
+            <property name="variableName" class="ptolemy.kernel.util.StringAttribute" value="EnableInteractivity">
+            </property>
+            <property name="delayed" class="ptolemy.data.expr.Parameter" value="false">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee, Steve Neuendorffer, Jerome Blanc</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>
Set the value of a variable. The result may occur at two different times, depending on the value of the delayed parameter. 
If delayed is true, then the change to the value of the variable is implemented in a change request, and consequently will not take hold until the end of the current toplevel iteration. This helps ensure that users of value of the variable will see changes t [...]
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:10733:23:4">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.SetVariable">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:886:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Variable">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#LocalInput">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[635.0, 365.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:10:1">
+            </property>
+            <property name="" class="ptolemy.vergil.basic.DocAttribute">
+                <property name="description" class="ptolemy.kernel.util.StringAttribute" value="
Set the value of a variable. The result may occur at two different times, depending on the value of the delayed parameter. 
If delayed is true, then the change to the value of the variable is implemented in a change request, and consequently will not take hold until the end of the current toplevel iteration. This helps ensure that users of value of the variable will see changes to the [...]
+                </property>
+                <property name="author" class="ptolemy.kernel.util.StringAttribute" value="Edward Lee, Steve Neuendorffer, Jerome Blanc">
+                </property>
+                <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
+                </property>
+            </property>
+        </entity>
+        <entity name="CreateInitialSOP" class="ptolemy.actor.TypedCompositeActor">
+            <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="9.1.devel">
+            </property>
+            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:45907:3:5">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
+            </property>
+            <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director "inherit" the director from the containing workflow and are called non-opaque.</ [...]
+</property>            <property name="_location" class="ptolemy.kernel.util.Location" value="[95.0, 530.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1:urn:lsid:kepler-project.org/ns/:44497:49:8:urn:lsid:kepler-project.org/ns/:44576:20:187">
+            </property>
+            <port name="trigger" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_location" class="ptolemy.kernel.util.Location" value="{20.0, 235.0}">
+                </property>
+            </port>
+            <port name="sop_out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_location" class="ptolemy.kernel.util.Location" value="[585.0, 190.0]">
+                </property>
+            </port>
+            <entity name="InitCalibParam" class="ptolemy.actor.lib.StringConst">
+                <property name="value" class="ptolemy.data.expr.Parameter" value="fors_calib:sradius=$INIT_SRADIUS
fors_calib:dradius=$INIT_DRADIUS
fors_calib:s_nknots=$INIT_S_NKNOTS
fors_calib:d_nknots=$INIT_D_NKNOTS
fors_calib:splfit_threshold=$INIT_SPLFIT_THRESHOLD
fors_calib:stack_method=$INIT_STACK_METHOD
fors_calib:minrejection=$INIT_MINREJECTION
fors_calib:maxrejection=$INIT_MAXREJECTION
fors_calib:kiter=$INIT_KITER
fors_calib:klow=$INIT_KLOW&#1 [...]
+                    <property name="style" class="ptolemy.actor.gui.style.TextStyle">
+                        <property name="height" class="ptolemy.data.expr.Parameter" value="10">
+                        </property>
+                        <property name="width" class="ptolemy.data.expr.Parameter" value="30">
+                        </property>
+                    </property>
+                </property>
+                <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
+                </property>
+                <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The StringConstant actor outputs a string specified via the actor's value parameter.</p>

<p>Specifying strings with the StringConstant actor is convenient, as the actor does not require that strings be surrounded by quotes. The actor is often used to specify file paths, which can be selected using the Browse button available in the actor's parameters.</p&g [...]
+<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a string constant specified by the value parameter.  </configure></property>
+<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time. </configure></property>
+<property name="prop:firingCountLimit" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.</configure></property>
+<property name="prop:value" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The value produced by the actor. Specified strings do not require enclosing quotes. (To include a '$' sign in the string, enter '$$'.)</configure></property>
+</property>                <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:27:7">
+                </property>
+                <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.StringConst">
+                    <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1052:1">
+                    </property>
+                </property>
+                <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#StringFunctionActor">
+                </property>
+                <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Constant">
+                </property>
+                <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
+                    <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
+                    </property>
+                    <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
+                    </property>
+                </property>
+                <property name="_location" class="ptolemy.kernel.util.Location" value="[205.0, 295.0]">
+                </property>
+                <property name="" class="ptolemy.vergil.basic.DocAttribute">
+                    <property name="description" class="ptolemy.kernel.util.StringAttribute" value="<p>The StringConstant actor outputs a string specified via the actor's value parameter.</p>

<p>Specifying strings with the StringConstant actor is convenient, as the actor does not require that strings be surrounded by quotes. The actor is often used to specify file paths, which can be selected using the Browse button available in the actor's parameters.</p&gt [...]
+                    </property>
+                    <property name="author" class="ptolemy.kernel.util.StringAttribute" value="Edward Lee">
+                    </property>
+                    <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
+                    </property>
+                    <property name="value (parameter)" class="ptolemy.data.expr.StringParameter" value="The value produced by the actor. Specified strings do not require enclosing quotes. (To include a '$' sign in the string, enter '$$'.)">
+                    </property>
+                    <property name="firingCountLimit (parameter)" class="ptolemy.data.expr.StringParameter" value="The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.">
+                    </property>
+                    <property name="output (port)" class="ptolemy.kernel.util.StringAttribute" value="An output port that broadcasts a string constant specified by the value parameter.  ">
+                    </property>
+                    <property name="trigger (port)" class="ptolemy.kernel.util.StringAttribute" value="A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time. ">
+                    </property>
+                </property>
+                <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1:urn:lsid:kepler-project.org/ns/:12555:14:3:urn:lsid:kepler-project.org/ns/:14170:19:1">
+                </property>
+            </entity>
+            <entity name="SopCreator" class="org.eso.SopCreator">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>It reads a formatted string and converts it to an SoP.</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SoPCreator reads a formatted string and converts it into an SoP.
The input string must be a list of tokens in the following format: recipe_name:par_name=value separated by either a comma or a newline</configure></property>
+<property name="port:sop out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The output sop</configure></property>
+<property name="port:param in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input string</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+</property>                <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:909:1">
+                </property>
+                <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SopCreator">
+                    <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                    </property>
+                </property>
+                <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+                </property>
+                <property name="_location" class="ptolemy.kernel.util.Location" value="[485.0, 165.0]">
+                </property>
+                <port name="param in" class="ptolemy.actor.TypedIOPort">
+                    <property name="input"/>
+                    <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                    </property>
+                </port>
+                <port name="sop out" class="ptolemy.actor.TypedIOPort">
+                    <property name="output"/>
+                    <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                    </property>
+                </port>
+            </entity>
+            <entity name="GetParamsFromGrismTable" class="ptolemy.actor.lib.python.PythonScript">
+                <property name="jythonClassName" class="ptolemy.kernel.util.StringAttribute" value="Main">
+                </property>
+                <property name="script" class="ptolemy.kernel.util.StringAttribute" value="# This is a simple actor that copies the input to the output.
# You can remove the ports, add new ports, and modify the script.

from ptolemy.data import StringToken
from org.eso.util import JSONTools
from nom.tam.fits import Fits
from nom.tam.fits import FitsFactory

class Main :
  "Get the parameters from the config table"
  def fire(self) :
  [...]
+                </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Xiaojun Liu</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>

This actor executes a Python script. The default script has an
input port and an output port. To view or edit the script, double-click
on the actor.
<p>

As an example, a simplified version of the Scale actor can be
implemented by the following script:
</p>
<pre>
1.  class Main :
2. "scale"
3.    def fire(se [...]
+</property>                <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:45907:2:1">
+                </property>
+                <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.python.PythonScript">
+                    <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:545:1">
+                    </property>
+                </property>
+                <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
+                </property>
+                <property name="_editorFactory" class="ptolemy.vergil.toolbox.TextEditorConfigureFactory">
+                    <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="script">
+                    </property>
+                </property>
+                <property name="_location" class="ptolemy.kernel.util.Location" value="[135.0, 55.0]">
+                </property>
+                <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:545:1:urn:lsid:kepler-project.org/ns/:41644:8:16:urn:lsid:kepler-project.org/ns/:43955:93:22:urn:lsid:kepler-project.org/ns/:44576:23:82">
+                </property>
+                <port name="input" class="ptolemy.actor.TypedIOPort">
+                    <property name="input"/>
+                </port>
+                <port name="output" class="ptolemy.actor.TypedIOPort">
+                    <property name="output"/>
+                </port>
+            </entity>
+            <entity name="String Accumulator" class="org.resurgence.actor.StringAccumulator">
+                <property name="Substring separator" class="ptolemy.data.expr.Parameter" value="""">
+                </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Wibke Sudholt</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>
The StringAccumulator actor reads multiple strings via its input port and outputs a string containing all of the input values. The characters separating the substrings in the output string can be specified with the substringSeparator parameter.</p></configure></property>
+<property name="port:whole" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the full string.</configure></property>
+<property name="port:parts" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts substrings.</configure></property>
+<property name="prop:Substring separator" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The characters used to separate the elements in the output string. By default, the value is "".</configure></property>
+</property>                <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:292:1">
+                </property>
+                <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.resurgence.actor.StringAccumulator">
+                    <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1117:1">
+                    </property>
+                </property>
+                <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#StringFunctionActor">
+                </property>
+                <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#IterativeOperation">
+                </property>
+                <property name="_location" class="ptolemy.kernel.util.Location" value="[345.0, 175.0]">
+                </property>
+                <property name="" class="ptolemy.vergil.basic.DocAttribute">
+                    <property name="description" class="ptolemy.kernel.util.StringAttribute" value="<p>
The StringAccumulator actor reads multiple strings via its input port and outputs a string containing all of the input values. The characters separating the substrings in the output string can be specified with the substringSeparator parameter.</p>">
+                    </property>
+                    <property name="author" class="ptolemy.kernel.util.StringAttribute" value="Wibke Sudholt">
+                    </property>
+                    <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
+                    </property>
+                    <property name="Substring separator (parameter)" class="ptolemy.data.expr.StringParameter" value="The characters used to separate the elements in the output string. By default, the value is "".">
+                    </property>
+                    <property name="parts (port)" class="ptolemy.kernel.util.StringAttribute" value="A multiport that accepts substrings.">
+                    </property>
+                    <property name="whole (port)" class="ptolemy.kernel.util.StringAttribute" value="An output port that broadcasts the full string.">
+                    </property>
+                </property>
+            </entity>
+            <relation name="relation4" class="ptolemy.actor.TypedIORelation">
+                <property name="width" class="ptolemy.data.expr.Parameter" value="-1">
+                </property>
+                <vertex name="vertex1" value="[65.0, 235.0]">
+                </vertex>
+            </relation>
+            <relation name="relation3" class="ptolemy.actor.TypedIORelation">
+            </relation>
+            <relation name="relation" class="ptolemy.actor.TypedIORelation">
+            </relation>
+            <relation name="relation2" class="ptolemy.actor.TypedIORelation">
+            </relation>
+            <relation name="relation5" class="ptolemy.actor.TypedIORelation">
+            </relation>
+            <link port="trigger" relation="relation4"/>
+            <link port="sop_out" relation="relation5"/>
+            <link port="InitCalibParam.output" relation="relation2"/>
+            <link port="InitCalibParam.trigger" relation="relation4"/>
+            <link port="SopCreator.param in" relation="relation3"/>
+            <link port="SopCreator.sop out" relation="relation5"/>
+            <link port="GetParamsFromGrismTable.input" relation="relation4"/>
+            <link port="GetParamsFromGrismTable.output" relation="relation"/>
+            <link port="String Accumulator.parts" relation="relation"/>
+            <link port="String Accumulator.parts" relation="relation2"/>
+            <link port="String Accumulator.whole" relation="relation3"/>
+        </entity>
+        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation4" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation5" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation3" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation9" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation10" class="ptolemy.actor.TypedIORelation">
+            <property name="width" class="ptolemy.data.expr.Parameter" value="-1">
+            </property>
+            <vertex name="vertex1" value="[295.0, 465.0]">
+            </vertex>
+        </relation>
+        <relation name="relation" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation11" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation8" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation12" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation14" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation15" class="ptolemy.actor.TypedIORelation">
+            <property name="width" class="ptolemy.data.expr.Parameter" value="-1">
+            </property>
+            <vertex name="vertex1" value="[80.0, 495.0]">
+            </vertex>
+        </relation>
+        <relation name="relation6" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation16" class="ptolemy.actor.TypedIORelation">
+            <property name="width" class="ptolemy.data.expr.Parameter" value="-1">
+            </property>
+            <vertex name="vertex1" value="[355.0, 500.0]">
+            </vertex>
+        </relation>
+        <relation name="relation7" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <link port="sof_in" relation="relation4"/>
+        <link port="sof_out" relation="relation5"/>
+        <link port="fors_calib_1.sof in" relation="relation10"/>
+        <link port="fors_calib_1.sop in" relation="relation16"/>
+        <link port="fors_calib_1.sof out" relation="relation3"/>
+        <link port="fors_calib_1.sop out" relation="relation9"/>
+        <link port="SofSplitter.sof in" relation="relation4"/>
+        <link port="SofSplitter.sof out" relation="relation15"/>
+        <link port="SofSplitter.#groups" relation="relation2"/>
+        <link port="SofAccumulator.sof in" relation="relation11"/>
+        <link port="SofAccumulator.#groups" relation="relation2"/>
+        <link port="SofAccumulator.sof out" relation="relation5"/>
+        <link port="RecipeLooper.sof in" relation="relation15"/>
+        <link port="RecipeLooper.sop in" relation="relation6"/>
+        <link port="RecipeLooper.sof loop" relation="relation14"/>
+        <link port="RecipeLooper.iteration complete" relation="relation12"/>
+        <link port="RecipeLooper.sop loop" relation="relation7"/>
+        <link port="RecipeLooper.sof out" relation="relation10"/>
+        <link port="RecipeLooper.sop out" relation="relation16"/>
+        <link port="ForsCalibInteractivity.out_sop_loop" relation="relation7"/>
+        <link port="ForsCalibInteractivity.out_sof" relation="relation11"/>
+        <link port="ForsCalibInteractivity.set_enable" relation="relation8"/>
+        <link port="ForsCalibInteractivity.in_sof" relation="relation3"/>
+        <link port="ForsCalibInteractivity.enable" relation="relation"/>
+        <link port="ForsCalibInteractivity.iteration_complete" relation="relation12"/>
+        <link port="ForsCalibInteractivity.in_sof_rec_orig" relation="relation10"/>
+        <link port="ForsCalibInteractivity.out_sof_loop" relation="relation14"/>
+        <link port="ForsCalibInteractivity.in_sop" relation="relation9"/>
+        <link port="String Constant.output" relation="relation"/>
+        <link port="String Constant.trigger" relation="relation10"/>
+        <link port="SetInteractivity.input" relation="relation8"/>
+        <link port="CreateInitialSOP.trigger" relation="relation15"/>
+        <link port="CreateInitialSOP.sop_out" relation="relation6"/>
+    </entity>
+    <entity name="ForsScience" class="ptolemy.actor.TypedCompositeActor">
+        <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.1.devel">
+        </property>
+        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:46821:6:3">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
+            </property>
+        </property>
+        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
+        </property>
+        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
+        </property>
+        <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director "inherit" the director from the containing workflow and are called non-opaque.</ [...]
-</property>        <property name="_location" class="ptolemy.kernel.util.Location" value="[-140.0, 825.0]">
+</property>        <property name="_location" class="ptolemy.kernel.util.Location" value="[755.0, 820.0]">
         </property>
-        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1">
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1:urn:lsid:kepler-project.org/ns/:15314:200:84:urn:lsid:kepler-project.org/ns/:19529:10:9:urn:lsid:kepler-project.org/ns/:25158:73:1:urn:lsid:kepler-project.org/ns/:37571:5:6:urn:lsid:kepler-project.org/ns/:44576:17:91">
         </property>
-        <port name="sof_in" class="ptolemy.actor.TypedIOPort">
-            <property name="input"/>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[20.0, 200.0]">
+        <property name="EnableInteractivity" class="ptolemy.data.expr.StringParameter" value="false">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:421:1">
             </property>
-        </port>
-        <port name="sof_out" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[525.0, 200.0]">
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
             </property>
-        </port>
-        <entity name="fors_bias_1" class="org.eso.RecipeExecuter">
-            <property name="Recipe Failure Mode" class="ptolemy.data.expr.StringParameter" value="$RecipeFailureMode">
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[250.0, 190.0]">
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
             </property>
-        </entity>
-        <entity name="SofSplitter" class="org.eso.SofSplitter">
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[-10.0, 325.0]">
+            </property>
+        </property>
+        <property name="INIT_SKYGLOBAL" class="ptolemy.data.expr.StringParameter" value="FALSE">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
-<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofSplitter takes a set of files as input and split it into smaller sets based on the purpose. This smaller sets can then be sent to e.g. a RecipeExecuter</configure></property>
-<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sof</configure></property>
-<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sofs</configure></property>
-<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups generated</configure></property>
-<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:187:1">
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:43:1">
             </property>
-            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofSplitter">
-                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
                 </property>
             </property>
-            <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[105.0, 180.0]">
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
             </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:5:1">
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
             </property>
-            <port name="sof in" class="ptolemy.actor.TypedIOPort">
-                <property name="input"/>
-                <property name="multiport"/>
-                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
                 </property>
-            </port>
-            <port name="sof out" class="ptolemy.actor.TypedIOPort">
-                <property name="output"/>
-                <property name="multiport"/>
-                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[740.0, 390.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_SKYMEDIAN" class="ptolemy.data.expr.StringParameter" value="FALSE">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:43:2">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
                 </property>
-            </port>
-            <port name="#groups" class="ptolemy.actor.TypedIOPort">
-                <property name="output"/>
-                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
                 </property>
-                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[740.0, 410.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_SKYLOCAL" class="ptolemy.data.expr.StringParameter" value="TRUE">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:43:3">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
                 </property>
-            </port>
-        </entity>
-        <entity name="SofAccumulator" class="org.eso.SofAccumulator">
-            <property name="same dataset" class="ptolemy.data.expr.Parameter" value="true">
             </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[740.0, 430.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_COSMICS" class="ptolemy.data.expr.StringParameter" value="FALSE">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
-<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofAccumulator is meant to be used together with the SofSplitter: it puts back together in a single set of files the tokens generated by the PurposeSerializer (and usually processed by the RecipeExecuter)</configure></property>
-<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sofs</configure></property>
-<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sof</configure></property>
-<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups to collect</configure></property>
-<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:same dataset" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If true the SofAccumulator throws an error if the input tokens do not belong all to the same dataset</configure></property>
-</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:188:1">
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:43:4">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[740.0, 450.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
+        </property>
+        <property name="INIT_SLIT_MARGIN" class="ptolemy.data.expr.StringParameter" value="3">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:43:5">
             </property>
-            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofAccumulator">
-                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
                 </property>
             </property>
-            <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[405.0, 180.0]">
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
             </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:7:1">
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
             </property>
-            <port name="sof in" class="ptolemy.actor.TypedIOPort">
-                <property name="input"/>
-                <property name="multiport"/>
-                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
-                </property>
-            </port>
-            <port name="#groups" class="ptolemy.actor.TypedIOPort">
-                <property name="input"/>
-                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
-                </property>
-                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
-                </property>
-            </port>
-            <port name="sof out" class="ptolemy.actor.TypedIOPort">
-                <property name="output"/>
-                <property name="multiport"/>
-                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
                 </property>
-            </port>
-        </entity>
-        <relation name="relation" class="ptolemy.actor.TypedIORelation">
-        </relation>
-        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
-        </relation>
-        <relation name="relation3" class="ptolemy.actor.TypedIORelation">
-        </relation>
-        <relation name="relation4" class="ptolemy.actor.TypedIORelation">
-        </relation>
-        <relation name="relation5" class="ptolemy.actor.TypedIORelation">
-        </relation>
-        <link port="sof_in" relation="relation4"/>
-        <link port="sof_out" relation="relation5"/>
-        <link port="fors_bias_1.sof in" relation="relation"/>
-        <link port="fors_bias_1.sof out" relation="relation3"/>
-        <link port="SofSplitter.sof in" relation="relation4"/>
-        <link port="SofSplitter.sof out" relation="relation"/>
-        <link port="SofSplitter.#groups" relation="relation2"/>
-        <link port="SofAccumulator.sof in" relation="relation3"/>
-        <link port="SofAccumulator.#groups" relation="relation2"/>
-        <link port="SofAccumulator.sof out" relation="relation5"/>
-    </entity>
-    <entity name="SofCombiner" class="org.eso.SofCombiner">
-<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
-<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
-<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofCombiner takes as input a number of set of files and combines them into one set of files that contains only the files whose purposes are present in all the input tokens. With this respect empty tokens are ignored and files with universal purpose are always collected</configure></property>
-<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sofs</configure></property>
-<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The combined sof</configure></property>
-<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:189:1">
-        </property>
-        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofCombiner">
-            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
             </property>
-        </property>
-        <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
-        </property>
-        <property name="_location" class="ptolemy.kernel.util.Location" value="[25.0, 1010.0]">
-        </property>
-        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
-        </property>
-        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:908:1">
-        </property>
-        <port name="sof in" class="ptolemy.actor.TypedIOPort">
-            <property name="input"/>
-            <property name="multiport"/>
-            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
             </property>
-        </port>
-        <port name="sof in opt" class="ptolemy.actor.TypedIOPort">
-            <property name="input"/>
-            <property name="multiport"/>
-            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
             </property>
-        </port>
-        <port name="sof out" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="multiport"/>
-            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[740.0, 470.0]">
             </property>
-        </port>
-    </entity>
-    <entity name="SofCombiner2" class="org.eso.SofCombiner">
-<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
-<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
-<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofCombiner takes as input a number of set of files and combines them into one set of files that contains only the files whose purposes are present in all the input tokens. With this respect empty tokens are ignored and files with universal purpose are always collected</configure></property>
-<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sofs</configure></property>
-<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The combined sof</configure></property>
-<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:31989:66:1">
-        </property>
-        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofCombiner">
-            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
             </property>
         </property>
-        <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
-        </property>
-        <property name="_location" class="ptolemy.kernel.util.Location" value="[535.0, 950.0]">
-        </property>
-        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
-        </property>
-        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:908:1:urn:lsid:kepler-project.org/ns/:15314:190:1">
-        </property>
-        <port name="sof in" class="ptolemy.actor.TypedIOPort">
-            <property name="input"/>
-            <property name="multiport"/>
-            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+        <property name="INIT_EXT_RADIUS" class="ptolemy.data.expr.StringParameter" value="12">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:43:6">
             </property>
-        </port>
-        <port name="sof in opt" class="ptolemy.actor.TypedIOPort">
-            <property name="input"/>
-            <property name="multiport"/>
-            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
             </property>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
             </property>
-        </port>
-        <port name="sof out" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="multiport"/>
-            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
             </property>
-        </port>
-    </entity>
-    <entity name="Data Filter" class="org.eso.DataFilter">
-        <property name="Mode" class="ptolemy.data.expr.StringParameter" value="Skip">
-        </property>
-        <property name="FITS Viewer" class="ptolemy.data.expr.StringParameter" value="$FITS_VIEWER">
-        </property>
-        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:31989:111:2">
-        </property>
-        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.DataFilter">
-            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[740.0, 490.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
             </property>
         </property>
-        <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
-        </property>
-        <property name="" class="ptolemy.vergil.basic.DocAttribute">
-            <property name="author" class="ptolemy.kernel.util.StringAttribute" value="ESO">
+        <property name="INIT_CONT_RADIUS" class="ptolemy.data.expr.StringParameter" value="0">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:43:7">
             </property>
-            <property name="version" class="ptolemy.kernel.util.StringAttribute" value="1.0">
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
             </property>
-            <property name="Mode (parameter)" class="ptolemy.data.expr.StringParameter" value="<p>Skip: automatically select all files and don't show any window;</p><p>Display: select all the files and allow the user only to view them;</p><p>Select: standard mode.</p>">
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
             </property>
-            <property name="FITS Viewer (parameter)" class="ptolemy.data.expr.StringParameter" value="The application used to inspect FITS files">
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
             </property>
-            <property name="class (parameter)" class="ptolemy.data.expr.StringParameter" value="">
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
             </property>
-            <property name="semanticType41 (parameter)" class="ptolemy.data.expr.StringParameter" value="">
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
             </property>
-            <property name="in (port)" class="ptolemy.kernel.util.StringAttribute" value="The input SoF">
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
             </property>
-            <property name="out (port)" class="ptolemy.kernel.util.StringAttribute" value="The selected SoF">
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
             </property>
-            <property name="rejected (port)" class="ptolemy.kernel.util.StringAttribute" value="The rejected SoF">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[740.0, 510.0]">
             </property>
-            <property name="entityId (parameter)" class="ptolemy.data.expr.StringParameter" value="">
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
             </property>
         </property>
-        <property name="_location" class="ptolemy.kernel.util.Location" value="[1015.0, 775.0]">
-        </property>
-        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:workflow:4:1:urn:lsid:kepler-project.org/ns/:14094:86:2:urn:lsid:kepler-project.org/ns/:15314:213:6">
-        </property>
-        <port name="sof in" class="ptolemy.actor.TypedIOPort">
-            <property name="input"/>
-            <property name="multiport"/>
-            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+        <property name="INIT_EXT_MODE" class="ptolemy.data.expr.StringParameter" value="1">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:43:8">
             </property>
-            <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
             </property>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
             </property>
-        </port>
-        <port name="sof out" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="multiport"/>
-            <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
             </property>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
             </property>
-        </port>
-        <port name="sof rejected" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="multiport"/>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
             </property>
-        </port>
-    </entity>
-    <entity name="ForsCalib" class="ptolemy.actor.TypedCompositeActor">
-        <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.1.devel">
-        </property>
-        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:197:23">
-        </property>
-        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
-            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[740.0, 530.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
             </property>
         </property>
-        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
-        </property>
-        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
-        </property>
-        <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
-        </property>
+        <property name="INIT_SKYALIGN" class="ptolemy.data.expr.StringParameter" value="0">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director "inherit" the director from the containing workflow and are called non-opaque.</ [...]
-</property>        <property name="_location" class="ptolemy.kernel.util.Location" value="[120.0, 1010.0]">
-        </property>
-        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1">
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>StringParameter specifies a persistent string. </p>

<p>Change the name of the StringParameter to better identify the specified value (right-click the parameter and select "Customize Name" from the menu). Other actors may refer to the StringParameter using the $NAME syntax (e.g. $Parameter).
</p></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:43:9">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.data.expr.StringParameter">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1185:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Parameter">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Parameter">
+            </property>
+            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
+                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{1.0, 0.0, 0.0, 1.0}">
+                </property>
+            </property>
+            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
+                <configure>
+        <svg>
+          <text x="20" style="font-size:14; font-family:SansSerif; fill:red" y="20">-S-</text>
+        </svg>
+      </configure>
+            </property>
+            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[740.0, 550.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:421:1">
+            </property>
         </property>
         <port name="sof_in" class="ptolemy.actor.TypedIOPort">
             <property name="input"/>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[30.0, 210.0]">
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[-65.0, 570.0]">
             </property>
         </port>
         <port name="sof_out" class="ptolemy.actor.TypedIOPort">
             <property name="output"/>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[560.0, 215.0]">
-            </property>
-        </port>
-        <entity name="fors_calib_1" class="org.eso.RecipeExecuter">
-            <property name="Recipe Failure Mode" class="ptolemy.data.expr.StringParameter" value="$RecipeFailureMode">
-            </property>
-            <property name="Output Files Category" class="ptolemy.data.expr.StringParameter" value="CURV_COEFF_MXU,CURV_COEFF_MOS,CURV_COEFF_LSS,DISP_COEFF_MXU,DISP_COEFF_MOS,DISP_COEFF_LSS,MASTER_NORM_FLAT_MXU,MASTER_NORM_FLAT_MOS,MASTER_NORM_FLAT_LSS,SLIT_LOCATION_MXU,SLIT_LOCATION_MOS,SLIT_LOCATION_LONG_MXU,SLIT_LOCATION_LONG_MOS,SLIT_LOCATION_LSS,MASTER_NORM_FLAT_LONG_MXU,MASTER_NORM_FLAT_LONG_MOS,DISP_COEFF_LONG_MXU,DISP_COEFF_LONG_MOS">
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[275.0, 200.0]">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[770.0, 325.0]">
             </property>
-        </entity>
+        </port>
         <entity name="SofSplitter" class="org.eso.SofSplitter">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
@@ -2578,12 +4800,12 @@
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofSplitter takes a set of files as input and split it into smaller sets based on the purpose. This smaller sets can then be sent to e.g. a RecipeExecuter</configure></property>
 <property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sof</configure></property>
-<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups generated</configure></property>
 <property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sofs</configure></property>
+<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups generated</configure></property>
 <property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
 <property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
 <property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:198:2">
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:201:2">
             </property>
             <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofSplitter">
                 <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
@@ -2591,12 +4813,12 @@
             </property>
             <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[120.0, 190.0]">
-            </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:5:1">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[-10.0, 545.0]">
             </property>
             <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
             </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:5:1">
+            </property>
             <port name="sof in" class="ptolemy.actor.TypedIOPort">
                 <property name="input"/>
                 <property name="multiport"/>
@@ -2617,6 +4839,56 @@
                 </property>
             </port>
         </entity>
+        <entity name="fors_science_1" class="org.eso.RecipeExecuter">
+            <property name="Recipe Failure Mode" class="ptolemy.data.expr.StringParameter" value="$RecipeFailureMode">
+            </property>
+            <property name="recipe_param_1" class="ptolemy.data.expr.Parameter" value="dispersion=0">
+            </property>
+            <property name="recipe_param_2" class="ptolemy.data.expr.Parameter" value="skyalign=PORT">
+            </property>
+            <property name="recipe_param_7" class="ptolemy.data.expr.Parameter" value="skyglobal=PORT">
+            </property>
+            <property name="recipe_param_8" class="ptolemy.data.expr.Parameter" value="skymedian=PORT">
+            </property>
+            <property name="recipe_param_9" class="ptolemy.data.expr.Parameter" value="skylocal=PORT">
+            </property>
+            <property name="recipe_param_10" class="ptolemy.data.expr.Parameter" value="cosmics=PORT">
+            </property>
+            <property name="recipe_param_11" class="ptolemy.data.expr.Parameter" value="slit_margin=PORT">
+            </property>
+            <property name="recipe_param_12" class="ptolemy.data.expr.Parameter" value="ext_radius=PORT">
+            </property>
+            <property name="recipe_param_13" class="ptolemy.data.expr.Parameter" value="cont_radius=PORT">
+            </property>
+            <property name="recipe_param_14" class="ptolemy.data.expr.Parameter" value="ext_mode=PORT">
+            </property>
+            <property name="recipe_param_16" class="ptolemy.data.expr.Parameter" value="photometry=TRUE">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[490.0, 445.0]">
+            </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="sop in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="sof out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="multiport"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                </property>
+            </port>
+            <port name="sop out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                </property>
+            </port>
+        </entity>
         <entity name="SofAccumulator" class="org.eso.SofAccumulator">
             <property name="same dataset" class="ptolemy.data.expr.Parameter" value="true">
             </property>
@@ -2624,230 +4896,524 @@
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofAccumulator is meant to be used together with the SofSplitter: it puts back together in a single set of files the tokens generated by the PurposeSerializer (and usually processed by the RecipeExecuter)</configure></property>
-<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sofs</configure></property>
-<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups to collect</configure></property>
-<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sof</configure></property>
-<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:same dataset" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If true the SofAccumulator throws an error if the input tokens do not belong all to the same dataset</configure></property>
-</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:199:2">
-            </property>
-            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofAccumulator">
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofAccumulator is meant to be used together with the SofSplitter: it puts back together in a single set of files the tokens generated by the PurposeSerializer (and usually processed by the RecipeExecuter)</configure></property>
+<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sofs</configure></property>
+<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sof</configure></property>
+<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups to collect</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:same dataset" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If true the SofAccumulator throws an error if the input tokens do not belong all to the same dataset</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:202:2">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofAccumulator">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                </property>
+            </property>
+            <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[700.0, 255.0]">
+            </property>
+            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:7:1">
+            </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
+            <port name="#groups" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
+                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+                </property>
+            </port>
+            <port name="sof out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+        </entity>
+        <entity name="RecipeLooper" class="org.eso.RecipeLooper">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The RecipeLooper is an actor designed to allow multiple execution of the same recipe on the same data with different parameters in order to optimize the data reduction.
At the begininning of an iteration it accepts input tokens from the sof in and sop in ports and sends them to the output ports, then it reads tokens from the sof loop and sop loop ports until the token on the iteration [...]
+<property name="port:iteration complete" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The signal to terminate the current iteration</configure></property>
+<property name="port:sof loop" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The loop input sof</configure></property>
+<property name="port:sop loop" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The loop input sop</configure></property>
+<property name="port:sop in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sop</configure></property>
+<property name="port:sop out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The output sop</configure></property>
+<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sof</configure></property>
+<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The output sof</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44497:42:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.RecipeLooper">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                </property>
+            </property>
+            <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[200.0, 445.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:905:1">
+            </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="sop in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="sof loop" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
+            <port name="iteration complete" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
+            <port name="sop loop" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
+        </entity>
+        <entity name="CreateInitialSOP" class="ptolemy.actor.TypedCompositeActor">
+            <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="9.1.devel">
+            </property>
+            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:46821:8:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
+            </property>
+            <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director "inherit" the director from the containing workflow and are called non-opaque.</ [...]
+</property>            <property name="_location" class="ptolemy.kernel.util.Location" value="[115.0, 525.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1:urn:lsid:kepler-project.org/ns/:44497:49:8:urn:lsid:kepler-project.org/ns/:44576:42:31">
+            </property>
+            <port name="trigger" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_location" class="ptolemy.kernel.util.Location" value="{20.0, 235.0}">
+                </property>
+            </port>
+            <port name="sop_out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_location" class="ptolemy.kernel.util.Location" value="[550.0, 110.0]">
+                </property>
+            </port>
+            <entity name="SopCreator" class="org.eso.SopCreator">
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>1.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SopCreator converts a string to a SoP</configure></property>
+<property name="port:in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>a string in the format described in Appendix A</configure></property>
+<property name="port:out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>a SoP</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+</property>                <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:16989:31:1">
+                </property>
+                <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SopCreator">
+                    <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                    </property>
+                </property>
+                <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+                </property>
+                <property name="_location" class="ptolemy.kernel.util.Location" value="[425.0, 80.0]">
+                </property>
+                <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:workflow:17:1:urn:lsid:kepler-project.org/ns/:14170:22:1">
+                </property>
+                <port name="param in" class="ptolemy.actor.TypedIOPort">
+                    <property name="input"/>
+                    <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                    </property>
+                    <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                    </property>
+                </port>
+                <port name="sop out" class="ptolemy.actor.TypedIOPort">
+                    <property name="output"/>
+                    <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                    </property>
+                </port>
+            </entity>
+            <entity name="InitPredictParam" class="ptolemy.actor.lib.StringConst">
+                <property name="value" class="ptolemy.data.expr.Parameter" value="fors_science:skyglobal=$INIT_SKYGLOBAL
fors_science:skymedian=$INIT_SKYMEDIAN
fors_science:skylocal=$INIT_SKYLOCAL
fors_science:cosmics=$INIT_COSMICS
fors_science:slit_margin=$INIT_SLIT_MARGIN
fors_science:ext_radius=$INIT_EXT_RADIUS
fors_science:cont_radius=$INIT_CONT_RADIUS
fors_science:ext_mode=$INIT_EXT_MODE
fors_science:skyalign=$INIT_SKYALIGN">
+                    <property name="style" class="ptolemy.actor.gui.style.TextStyle">
+                        <property name="height" class="ptolemy.data.expr.Parameter" value="10">
+                        </property>
+                        <property name="width" class="ptolemy.data.expr.Parameter" value="30">
+                        </property>
+                    </property>
+                </property>
+                <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
+                </property>
+                <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The StringConstant actor outputs a string specified via the actor's value parameter.</p>

<p>Specifying strings with the StringConstant actor is convenient, as the actor does not require that strings be surrounded by quotes. The actor is often used to specify file paths, which can be selected using the Browse button available in the actor's parameters.</p&g [...]
+<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a string constant specified by the value parameter.  </configure></property>
+<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time. </configure></property>
+<property name="prop:firingCountLimit" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.</configure></property>
+<property name="prop:value" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The value produced by the actor. Specified strings do not require enclosing quotes. (To include a '$' sign in the string, enter '$$'.)</configure></property>
+</property>                <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:41:4">
+                </property>
+                <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.StringConst">
+                    <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1052:1">
+                    </property>
+                </property>
+                <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#StringFunctionActor">
+                </property>
+                <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Constant">
+                </property>
+                <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
+                    <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
+                    </property>
+                    <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
+                    </property>
+                </property>
+                <property name="_location" class="ptolemy.kernel.util.Location" value="[265.0, 235.0]">
+                </property>
+                <property name="" class="ptolemy.vergil.basic.DocAttribute">
+                    <property name="author" class="ptolemy.kernel.util.StringAttribute" value="Edward Lee">
+                    </property>
+                    <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
+                    </property>
+                    <property name="value (parameter)" class="ptolemy.data.expr.StringParameter" value="The value produced by the actor. Specified strings do not require enclosing quotes. (To include a '$' sign in the string, enter '$$'.)">
+                    </property>
+                    <property name="firingCountLimit (parameter)" class="ptolemy.data.expr.StringParameter" value="The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.">
+                    </property>
+                    <property name="output (port)" class="ptolemy.kernel.util.StringAttribute" value="An output port that broadcasts a string constant specified by the value parameter.  ">
+                    </property>
+                    <property name="trigger (port)" class="ptolemy.kernel.util.StringAttribute" value="A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time. ">
+                    </property>
+                </property>
+                <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1:urn:lsid:kepler-project.org/ns/:14170:12:5:urn:lsid:kepler-project.org/ns/:44497:48:1">
+                </property>
+            </entity>
+            <relation name="relation" class="ptolemy.actor.TypedIORelation">
+                <property name="width" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </relation>
+            <relation name="relation2" class="ptolemy.actor.TypedIORelation">
+            </relation>
+            <relation name="relation3" class="ptolemy.actor.TypedIORelation">
+            </relation>
+            <link port="trigger" relation="relation2"/>
+            <link port="sop_out" relation="relation3"/>
+            <link port="SopCreator.param in" relation="relation"/>
+            <link port="SopCreator.sop out" relation="relation3"/>
+            <link port="InitPredictParam.output" relation="relation"/>
+            <link port="InitPredictParam.trigger" relation="relation2"/>
+        </entity>
+        <entity name="ForsScienceInteractivity" class="org.eso.PythonActor">
+            <property name="Python script" class="ptolemy.data.expr.FileParameter" value="/home/cgarcia/SDD/local/ga014699/share/esopipes/fors-4.11.6/reflex/fors_science_interact.py">
+            </property>
+            <property name="Run in terminal" class="ptolemy.data.expr.Parameter" value="false">
+            </property>
+            <property name="Lazy Mode" class="ptolemy.data.expr.Parameter" value="false">
+            </property>
+            <property name="Recipe Failure Mode" class="ptolemy.data.expr.StringParameter" value="Stop">
+            </property>
+            <property name="Disable logging" class="ptolemy.data.expr.Parameter" value="false">
+            </property>
+            <property name="Clean Temporary Directories" class="ptolemy.data.expr.Parameter" value="false">
+            </property>
+            <property name="Products Dir" class="ptolemy.data.expr.FileParameter" value="$TMP_PRODUCTS_DIR">
+                <property name="allowFiles" class="ptolemy.data.expr.Parameter" value="false">
+                </property>
+                <property name="allowDirectories" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </property>
+            <property name="Logs Dir" class="ptolemy.data.expr.FileParameter" value="$LOGS_DIR">
+                <property name="allowFiles" class="ptolemy.data.expr.Parameter" value="false">
+                </property>
+                <property name="allowDirectories" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </property>
+            <property name="Bookkeeping Dir" class="ptolemy.data.expr.FileParameter" value="$BOOKKEEPING_DIR">
+                <property name="allowFiles" class="ptolemy.data.expr.Parameter" value="false">
+                </property>
+                <property name="allowDirectories" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>This actor executes a Python script</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The PythonActor executes custom python scripts: in order to use a script with this actor you must include the module reflex.py and add a couple of statements to define inputs and outputs (see example.py in the Reflex distribution).
Upon selecting a script, input and output ports are automatically created. If applicable, output tokens are automatically converted to Reflex objects. If t [...]
+<property name="port:stdout" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>This port emits a token containing the standard output generated by the script execution</configure></property>
+<property name="prop:author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:Run in terminal" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If true, the script is invoked through an external xterm, this is needed for scripts that write on the standard output or require standard input (e.g. some pyraf tasks)</configure></property>
+<property name="prop:Python script" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The filename of the script to be executed (full path)</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:18:5">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.PythonActor">
                 <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
                 </property>
             </property>
-            <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[500.0, 270.0]">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[450.0, 190.0]">
+            <property name="prop:Disable logging" class="ptolemy.kernel.util.ConfigurableAttribute">
+                <configure>If true, the script does not save the standard output and the standard error of the script execution in the logging directory. This feature is useful if you are using Pyraf and you experience occasional crashes.</configure>
             </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:7:1">
+            <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute">
+                <configure>ESO</configure>
             </property>
-            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:904:1">
             </property>
-            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+            <port name="stdout" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_hide" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+            <port name="out_sop_loop" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
+                </property>
+            </port>
+            <port name="out_sof" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+            <port name="set_enable" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+            <port name="in_sof" class="ptolemy.actor.TypedIOPort">
                 <property name="input"/>
-                <property name="multiport"/>
                 <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
                 </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
             </port>
-            <port name="#groups" class="ptolemy.actor.TypedIOPort">
+            <port name="enable" class="ptolemy.actor.TypedIOPort">
                 <property name="input"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
                 <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
                 </property>
-                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+            </port>
+            <port name="iteration_complete" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
                 </property>
             </port>
-            <port name="sof out" class="ptolemy.actor.TypedIOPort">
+            <port name="in_sof_rec_orig" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
+            </port>
+            <port name="out_sof_loop" class="ptolemy.actor.TypedIOPort">
                 <property name="output"/>
-                <property name="multiport"/>
                 <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
                 </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
+                </property>
+            </port>
+            <port name="out_sop" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+            </port>
+            <port name="in_sop" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                </property>
             </port>
         </entity>
-        <relation name="relation" class="ptolemy.actor.TypedIORelation">
-        </relation>
-        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
-        </relation>
-        <relation name="relation3" class="ptolemy.actor.TypedIORelation">
-        </relation>
-        <relation name="relation4" class="ptolemy.actor.TypedIORelation">
-        </relation>
-        <relation name="relation5" class="ptolemy.actor.TypedIORelation">
-        </relation>
-        <link port="sof_in" relation="relation4"/>
-        <link port="sof_out" relation="relation5"/>
-        <link port="fors_calib_1.sof in" relation="relation"/>
-        <link port="fors_calib_1.sof out" relation="relation3"/>
-        <link port="SofSplitter.sof in" relation="relation4"/>
-        <link port="SofSplitter.sof out" relation="relation"/>
-        <link port="SofSplitter.#groups" relation="relation2"/>
-        <link port="SofAccumulator.sof in" relation="relation3"/>
-        <link port="SofAccumulator.#groups" relation="relation2"/>
-        <link port="SofAccumulator.sof out" relation="relation5"/>
-    </entity>
-    <entity name="ForsScience" class="ptolemy.actor.TypedCompositeActor">
-        <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.1.devel">
-        </property>
-        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:37571:5:6">
-        </property>
-        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
-            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
-            </property>
-        </property>
-        <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Actor">
-        </property>
-        <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#GeneralPurpose">
-        </property>
-        <property name="semanticType22" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Workflow">
-        </property>
-<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
-<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Yuhong Xiong</configure></property>
-<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director "inherit" the director from the containing workflow and are called non-opaque.</ [...]
-</property>        <property name="_location" class="ptolemy.kernel.util.Location" value="[755.0, 820.0]">
-        </property>
-        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1:urn:lsid:kepler-project.org/ns/:15314:200:84:urn:lsid:kepler-project.org/ns/:19529:10:9:urn:lsid:kepler-project.org/ns/:25158:73:1">
-        </property>
-        <port name="sof_in" class="ptolemy.actor.TypedIOPort">
-            <property name="input"/>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
-            </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[30.0, 205.0]">
+        <entity name="String Constant" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$EnableInteractivity">
             </property>
-        </port>
-        <port name="sof_out" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[535.0, 215.0]">
+            <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-        </port>
-        <entity name="SofSplitter" class="org.eso.SofSplitter">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
-<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofSplitter takes a set of files as input and split it into smaller sets based on the purpose. This smaller sets can then be sent to e.g. a RecipeExecuter</configure></property>
-<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sof</configure></property>
-<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups generated</configure></property>
-<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sofs</configure></property>
-<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:201:2">
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The StringConstant actor outputs a string specified via the actor's value parameter.</p>

<p>Specifying strings with the StringConstant actor is convenient, as the actor does not require that strings be surrounded by quotes. The actor is often used to specify file paths, which can be selected using the Browse button available in the actor's parameters.</p&g [...]
+<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a string constant specified by the value parameter.  </configure></property>
+<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time. </configure></property>
+<property name="prop:firingCountLimit" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.</configure></property>
+<property name="prop:value" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The value produced by the actor. Specified strings do not require enclosing quotes. (To include a '$' sign in the string, enter '$$'.)</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44497:47:1">
             </property>
-            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofSplitter">
-                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.StringConst">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1052:1">
                 </property>
             </property>
-            <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
-            </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{85, 185}">
-            </property>
-            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#StringFunctionActor">
             </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:5:1">
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Constant">
             </property>
-            <port name="sof in" class="ptolemy.actor.TypedIOPort">
-                <property name="input"/>
-                <property name="multiport"/>
-                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
-                </property>
-            </port>
-            <port name="sof out" class="ptolemy.actor.TypedIOPort">
-                <property name="output"/>
-                <property name="multiport"/>
-                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
-                </property>
-            </port>
-            <port name="#groups" class="ptolemy.actor.TypedIOPort">
-                <property name="output"/>
-                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+            <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
+                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
                 </property>
-                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+                <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
                 </property>
-            </port>
-        </entity>
-        <entity name="fors_science_1" class="org.eso.RecipeExecuter">
-            <property name="Recipe Failure Mode" class="ptolemy.data.expr.StringParameter" value="$RecipeFailureMode">
             </property>
-            <property name="recipe_param_18" class="ptolemy.data.expr.Parameter" value="photometry=TRUE">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[425.0, 345.0]">
+            </property>
+            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[225.0, 195.0]">
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1">
             </property>
         </entity>
-        <entity name="SofAccumulator" class="org.eso.SofAccumulator">
-            <property name="same dataset" class="ptolemy.data.expr.Parameter" value="true">
+        <entity name="SetInteractivity" class="ptolemy.actor.lib.SetVariable">
+            <property name="variableName" class="ptolemy.kernel.util.StringAttribute" value="EnableInteractivity">
+            </property>
+            <property name="delayed" class="ptolemy.data.expr.Parameter" value="false">
             </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
-<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The SofAccumulator is meant to be used together with the SofSplitter: it puts back together in a single set of files the tokens generated by the PurposeSerializer (and usually processed by the RecipeExecuter)</configure></property>
-<property name="port:sof in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input sofs</configure></property>
-<property name="port:#groups" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The number of groups to collect</configure></property>
-<property name="port:sof out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The grouped sof</configure></property>
-<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:same dataset" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If true the SofAccumulator throws an error if the input tokens do not belong all to the same dataset</configure></property>
-</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:202:2">
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee, Steve Neuendorffer, Jerome Blanc</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>
Set the value of a variable. The result may occur at two different times, depending on the value of the delayed parameter. 
If delayed is true, then the change to the value of the variable is implemented in a change request, and consequently will not take hold until the end of the current toplevel iteration. This helps ensure that users of value of the variable will see changes t [...]
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:10733:23:4">
             </property>
-            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.SofAccumulator">
-                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.SetVariable">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:886:1">
                 </property>
             </property>
-            <property name="semanticType" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Variable">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="[385.0, 190.0]">
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#LocalInput">
             </property>
-            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[615.0, 325.0]">
             </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org/ns/:12925:7:1">
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:10:1">
             </property>
-            <port name="sof in" class="ptolemy.actor.TypedIOPort">
-                <property name="input"/>
-                <property name="multiport"/>
-                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
-                </property>
-            </port>
-            <port name="#groups" class="ptolemy.actor.TypedIOPort">
-                <property name="input"/>
-                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+            <property name="" class="ptolemy.vergil.basic.DocAttribute">
+                <property name="description" class="ptolemy.kernel.util.StringAttribute" value="
Set the value of a variable. The result may occur at two different times, depending on the value of the delayed parameter. 
If delayed is true, then the change to the value of the variable is implemented in a change request, and consequently will not take hold until the end of the current toplevel iteration. This helps ensure that users of value of the variable will see changes to the [...]
                 </property>
-                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+                <property name="author" class="ptolemy.kernel.util.StringAttribute" value="Edward Lee, Steve Neuendorffer, Jerome Blanc">
                 </property>
-            </port>
-            <port name="sof out" class="ptolemy.actor.TypedIOPort">
-                <property name="output"/>
-                <property name="multiport"/>
-                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
                 </property>
-            </port>
+            </property>
         </entity>
         <relation name="relation" class="ptolemy.actor.TypedIORelation">
         </relation>
-        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
+        <relation name="relation4" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation5" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation6" class="ptolemy.actor.TypedIORelation">
+            <property name="width" class="ptolemy.data.expr.Parameter" value="-1">
+            </property>
+            <vertex name="vertex1" value="[75.0, 490.0]">
+            </vertex>
+        </relation>
+        <relation name="relation7" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation8" class="ptolemy.actor.TypedIORelation">
         </relation>
         <relation name="relation3" class="ptolemy.actor.TypedIORelation">
         </relation>
-        <relation name="relation4" class="ptolemy.actor.TypedIORelation">
+        <relation name="relation9" class="ptolemy.actor.TypedIORelation">
         </relation>
-        <relation name="relation5" class="ptolemy.actor.TypedIORelation">
+        <relation name="relation10" class="ptolemy.actor.TypedIORelation">
+            <property name="width" class="ptolemy.data.expr.Parameter" value="-1">
+            </property>
+            <vertex name="vertex1" value="[350.0, 440.0]">
+            </vertex>
+        </relation>
+        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation11" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation12" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation13" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation14" class="ptolemy.actor.TypedIORelation">
+        </relation>
+        <relation name="relation15" class="ptolemy.actor.TypedIORelation">
         </relation>
         <link port="sof_in" relation="relation"/>
         <link port="sof_out" relation="relation5"/>
         <link port="SofSplitter.sof in" relation="relation"/>
-        <link port="SofSplitter.sof out" relation="relation2"/>
+        <link port="SofSplitter.sof out" relation="relation6"/>
         <link port="SofSplitter.#groups" relation="relation4"/>
-        <link port="fors_science_1.sof in" relation="relation2"/>
-        <link port="fors_science_1.sof out" relation="relation3"/>
-        <link port="SofAccumulator.sof in" relation="relation3"/>
+        <link port="fors_science_1.sof in" relation="relation10"/>
+        <link port="fors_science_1.sop in" relation="relation9"/>
+        <link port="fors_science_1.sof out" relation="relation8"/>
+        <link port="fors_science_1.sop out" relation="relation3"/>
+        <link port="SofAccumulator.sof in" relation="relation14"/>
         <link port="SofAccumulator.#groups" relation="relation4"/>
         <link port="SofAccumulator.sof out" relation="relation5"/>
+        <link port="RecipeLooper.sof in" relation="relation6"/>
+        <link port="RecipeLooper.sop in" relation="relation7"/>
+        <link port="RecipeLooper.sof loop" relation="relation11"/>
+        <link port="RecipeLooper.iteration complete" relation="relation12"/>
+        <link port="RecipeLooper.sop loop" relation="relation13"/>
+        <link port="RecipeLooper.sof out" relation="relation10"/>
+        <link port="RecipeLooper.sop out" relation="relation9"/>
+        <link port="CreateInitialSOP.trigger" relation="relation6"/>
+        <link port="CreateInitialSOP.sop_out" relation="relation7"/>
+        <link port="ForsScienceInteractivity.out_sop_loop" relation="relation13"/>
+        <link port="ForsScienceInteractivity.out_sof" relation="relation14"/>
+        <link port="ForsScienceInteractivity.set_enable" relation="relation15"/>
+        <link port="ForsScienceInteractivity.in_sof" relation="relation8"/>
+        <link port="ForsScienceInteractivity.enable" relation="relation2"/>
+        <link port="ForsScienceInteractivity.iteration_complete" relation="relation12"/>
+        <link port="ForsScienceInteractivity.in_sof_rec_orig" relation="relation10"/>
+        <link port="ForsScienceInteractivity.out_sof_loop" relation="relation11"/>
+        <link port="ForsScienceInteractivity.in_sop" relation="relation3"/>
+        <link port="String Constant.output" relation="relation2"/>
+        <link port="String Constant.trigger" relation="relation10"/>
+        <link port="SetInteractivity.input" relation="relation15"/>
     </entity>
     <entity name="SofCombiner3" class="org.eso.SofCombiner">
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
@@ -2976,8 +5542,6 @@
         <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1:urn:lsid:kepler-project.org/ns/:14094:70:17:urn:lsid:kepler-project.org/ns/:15314:48:9:urn:lsid:kepler-project.org/ns/:25158:29:4">
         </property>
         <property name="DDF Director" class="ptolemy.domains.ddf.kernel.DDFDirector">
-            <property name="timeResolution" class="ptolemy.actor.parameters.SharedParameter" value="1E-10">
-            </property>
             <property name="iterations" class="ptolemy.data.expr.Parameter" value="0">
             </property>
             <property name="maximumReceiverCapacity" class="ptolemy.data.expr.Parameter" value="0">
@@ -2989,8 +5553,8 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Gang Zhou</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>
            <p> The dynamic dataflow (DDF) domain is a superset of the synchronous
            dataflow(SDF) and Boolean dataflow(BDF) domains. In the SDF domain,
            an actor consumes and produces a fixed number of tokens per firing.
            This static information makes possible compile-time scheduling. In the
            DDF domain, there are few  [...]
-<property name="prop:maximumReceiverCapacity" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A Parameter representing the maximum capacity of each receiver controlled by this director. This is an integer that defaults to 0, which means the queue in each receiver is unbounded. To specify bounded queues, set this to a positive integer. </configure></property>
 <property name="prop:iterations" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify the number of times a workflow is iterated. By default, this parameter is set to "0". Note that "0" does not mean "no iterations." Rather, "0" means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. </configure></property>
+<property name="prop:maximumReceiverCapacity" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A Parameter representing the maximum capacity of each receiver controlled by this director. This is an integer that defaults to 0, which means the queue in each receiver is unbounded. To specify bounded queues, set this to a positive integer. </configure></property>
 <property name="prop:runUntilDeadlockInOneIteration" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A parameter indicating whether one iteration consists of repeated basic iterations until deadlock. If this parameter is true, the model will be executed until deadlock in one iteration. The default value is a BooleanToken with the value false. It cannot be set to true if this director is at the top level.</configure></property>
 </property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:31989:107:1">
             </property>
@@ -3015,12 +5579,12 @@
             </property>
         </port>
         <entity name="String Constant" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="if [ "x$EraseDirs" = "xtrue" ]; then  echo "Deleting files"; rm -rf $BOOKKEEPING_DIR/*;  rm -rf $LOGS_DIR/*; rm -rf $TMP_PRODUCTS_DIR/* ;  else echo "Will not delete files"; fi">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="1">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="if [ "x$EraseDirs" = "xtrue" ]; then  echo "Deleting files"; rm -rf $BOOKKEEPING_DIR/*;  rm -rf $LOGS_DIR/*; rm -rf $TMP_PRODUCTS_DIR/* ;  else echo "Will not delete files"; fi">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -3050,12 +5614,12 @@
             </property>
         </entity>
         <entity name="String Constant2" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$CALIB_DATA_DIR">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="1">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="$CALIB_DATA_DIR">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -3157,8 +5721,6 @@
             </port>
         </entity>
         <entity name="DirectoryEraser" class="ptolemy.actor.lib.Exec">
-            <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="1">
-            </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
             <property name="command" class="ptolemy.actor.parameters.PortParameter" value="sh">
@@ -3173,15 +5735,17 @@
             </property>
             <property name="waitForProcess" class="ptolemy.data.expr.Parameter" value="true">
             </property>
+            <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="1">
+            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Xiaojun Liu, Edward A. Lee, Steve Neuendorffer</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>
<p>The External Execution actor executes a system command from a workflow. The actor accepts a command, a directory and environment in which to execute the command, and a command input string. Once the command has finished executing, the actor will output the execution results along with any errors. If no results are generated, the actor will output an empty string.</p>&# [...]
-<property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An input port that accepts strings to pass to the standard input of the subprocess. Note that a newline is not appended to the string. If you require a newline, add one using the AddSubtract actor. This port is an input port of type String.</configure></property>
 <property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts data generated by the executed command, output as a string after the command has finished executing. If the command generates no data on standard out, then the empty string (a string of length zero) is generated. </configure></property>
-<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If connected, a token must be available on this port before actor will execute.</configure></property>
+<property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An input port that accepts strings to pass to the standard input of the subprocess. Note that a newline is not appended to the string. If you require a newline, add one using the AddSubtract actor. This port is an input port of type String.</configure></property>
 <property name="port:error" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts any errors generated by the command execution. Errors are output as a string after the command has finished executing. If the execution generates no errors, an empty string is output. </configure></property>
+<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If connected, a token must be available on this port before actor will execute.</configure></property>
 <property name="port:exitCode" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the command's exit code. A non-zero value signifies an error.</configure></property>
 <property name="prop:environment" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An array of records that name an environment variable and a value:
 
  {{name = "NAME1", value = "value1"}...}
  
Where NAME1 is the name of the environment variable, and value1 is the value. 
For example, {{name = "PTII", value = "c:/ptII"}} would set the value of the PTII to c:/ptII. 
If the parameter is set to {{name="&quot [...]
 <property name="prop:directory" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The directory in which to execute the command. The default value of this parameter $CWD, which represents the user's current working or home directory. </configure></property>
@@ -3207,8 +5771,6 @@
                 </property>
                 <property name="version" class="ptolemy.kernel.util.StringAttribute" value="null">
                 </property>
-                <property name="firingCountLimit (parameter)" class="ptolemy.data.expr.StringParameter" value="If a positive integer, then it is the maximum number of times to execute the actor.">
-                </property>
                 <property name="directory (parameter)" class="ptolemy.data.expr.StringParameter" value="The directory in which to execute the command. The default value of this parameter $CWD, which represents the user's current working or home directory. ">
                 </property>
                 <property name="environment (parameter)" class="ptolemy.data.expr.StringParameter" value="An array of records that name an environment variable and a value:
 
  {{name = "NAME1", value = "value1"}...}
  
Where NAME1 is the name of the environment variable, and value1 is the value. 
For example, {{name = "PTII", value = "c:/ptII"}} would set the value of the PTII to c:/ptII. 
If the parameter is set to {{name= [...]
@@ -3219,6 +5781,8 @@
                 </property>
                 <property name="waitForProcess (parameter)" class="ptolemy.data.expr.StringParameter" value="If true, then actor will wait until subprocess completes.">
                 </property>
+                <property name="firingCountLimit (parameter)" class="ptolemy.data.expr.StringParameter" value="If a positive integer, then it is the maximum number of times to execute the actor.">
+                </property>
                 <property name="output (port)" class="ptolemy.kernel.util.StringAttribute" value="An output port that broadcasts data generated by the executed command, output as a string after the command has finished executing. If the command generates no data on standard out, then the empty string (a string of length zero) is generated. ">
                 </property>
                 <property name="trigger (port)" class="ptolemy.kernel.util.StringAttribute" value="If connected, a token must be available on this port before actor will execute.">
@@ -3259,12 +5823,12 @@
             </port>
         </entity>
         <entity name="String Constant4" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$RAWDATA_DIR">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="1">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="$RAWDATA_DIR">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -3299,8 +5863,8 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>
<p>The ElementsToArray actor reads individual elements via its input port and outputs an array consisting of those elements.</p>

<p>The actor accepts input elements of any one type (int, double, etc.). The type must be consistent. Each time the actor fires, it reads one token from each channel of the input port and outputs a corresponding array.</p>&# [...]
-<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts an assembled array. The type of the array elements matches that of the input.</configure></property>
 <property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts tokens of any one type. The type must be consistent.</configure></property>
+<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts an assembled array. The type of the array elements matches that of the input.</configure></property>
 </property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:32:1">
             </property>
             <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.ElementsToArray">
@@ -3479,11 +6043,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
-<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -3526,11 +6090,11 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward A. Lee</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Rectangle attribute renders a rectangle on the Workflow canvas. Single-click the rectangle to drag the resize handles and adjust the shape's size, or double-click the rectangle to customize its height, width, line width, color, and fill color.</p></configure></property>
-<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineWidth" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line width. The value is a double that defaults to 1.0.</configure></property>
-<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
-<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:height" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:dashArray" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify a dash-pattern for dashed or dotted lines. The value consists of an array of doubles that specify the length of the alternating solid and transparent segments. An empty value indicates that the line should not be dashed (the default).</configure></property>
+<property name="prop:centered" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Indicate whether the shape should be centered on its origin. By default, the location is the upper-left corner.</configure></property>
+<property name="prop:rounding" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The amount of rounding of the corners. The value is a double that defaults to 0.0, which indicates no rounding.</configure></property>
 <property name="prop:width" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal extent. The value is a double that defaults to 100.0.</configure></property>
 <property name="prop:lineColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The line color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:fillColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The fill color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. By default, the value is "none."</configure></property>
@@ -3548,8 +6112,6 @@
             </property>
         </property>
         <property name="DDF Director" class="ptolemy.domains.ddf.kernel.DDFDirector">
-            <property name="timeResolution" class="ptolemy.actor.parameters.SharedParameter" value="1E-10">
-            </property>
             <property name="iterations" class="ptolemy.data.expr.Parameter" value="0">
             </property>
             <property name="maximumReceiverCapacity" class="ptolemy.data.expr.Parameter" value="0">
@@ -3561,8 +6123,8 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Gang Zhou</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>
            <p> The dynamic dataflow (DDF) domain is a superset of the synchronous
            dataflow(SDF) and Boolean dataflow(BDF) domains. In the SDF domain,
            an actor consumes and produces a fixed number of tokens per firing.
            This static information makes possible compile-time scheduling. In the
            DDF domain, there are few  [...]
-<property name="prop:maximumReceiverCapacity" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A Parameter representing the maximum capacity of each receiver controlled by this director. This is an integer that defaults to 0, which means the queue in each receiver is unbounded. To specify bounded queues, set this to a positive integer. </configure></property>
 <property name="prop:iterations" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify the number of times a workflow is iterated. By default, this parameter is set to "0". Note that "0" does not mean "no iterations." Rather, "0" means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. </configure></property>
+<property name="prop:maximumReceiverCapacity" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A Parameter representing the maximum capacity of each receiver controlled by this director. This is an integer that defaults to 0, which means the queue in each receiver is unbounded. To specify bounded queues, set this to a positive integer. </configure></property>
 <property name="prop:runUntilDeadlockInOneIteration" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A parameter indicating whether one iteration consists of repeated basic iterations until deadlock. If this parameter is true, the model will be executed until deadlock in one iteration. The default value is a BooleanToken with the value false. It cannot be set to true if this director is at the top level.</configure></property>
 </property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:31617:88:4">
             </property>
@@ -3676,12 +6238,12 @@
             </port>
         </entity>
         <entity name="String Constant" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="processing dataset ">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="processing dataset ">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -3745,7 +6307,7 @@
             </property>
         </entity>
         <entity name="Display" class="ptolemy.actor.lib.gui.Display">
-            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={1367, 140, 510, 393}, maximized=false}">
+            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={1390, 72, 516, 395}, maximized=false}">
             </property>
             <property name="_paneSize" class="ptolemy.actor.gui.SizeAttribute" value="[508, 346]">
             </property>
@@ -3828,12 +6390,12 @@
             </port>
         </entity>
         <entity name="String Constant2" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$GLOBAL_TIMESTAMP">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="$GLOBAL_TIMESTAMP">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -3905,7 +6467,7 @@
             </port>
         </entity>
         <entity name="Directory Maker" class="org.resurgence.actor.DirectoryMaker">
-            <property name="Directory name" class="ptolemy.actor.parameters.PortParameter" value="">
+            <property name="Directory name" class="ptolemy.actor.parameters.PortParameter" value="/diskb/cgarcia/reflex_data//reflex_end_products/2013-10-25T18:57:47/FORS2.2010-05-03T03:36:35.486">
             </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
@@ -3949,12 +6511,12 @@
             </port>
         </entity>
         <entity name="String Constant3" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$N_SELECTED_DATASETS: ">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="$N_SELECTED_DATASETS: ">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -4025,12 +6587,12 @@
             </property>
         </entity>
         <entity name="String Constant4" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value=" out of ">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value=" out of ">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -4094,12 +6656,12 @@
             </property>
         </entity>
         <entity name="String Constant5" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$END_PRODUCTS_DIR">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="$END_PRODUCTS_DIR">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -4224,7 +6786,7 @@
     <entity name="Close DataSet" class="ptolemy.actor.TypedCompositeActor">
         <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="7.0.2">
         </property>
-        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:25158:63:2">
+        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:7:36">
         </property>
         <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
             <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
@@ -4243,7 +6805,7 @@
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director "inherit" the director from the containing workflow and are called non-opaque.</ [...]
 </property>        <property name="_location" class="ptolemy.kernel.util.Location" value="[1010.0, 1135.0]">
         </property>
-        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={0, 29, 1298, 809}, maximized=false}">
+        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={616, 37, 1304, 811}, maximized=false}">
         </property>
         <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[988, 658]">
         </property>
@@ -4251,7 +6813,7 @@
         </property>
         <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{1315.1506933890578, 786.5234375}">
         </property>
-        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1:urn:lsid:kepler-project.org/ns/:15314:107:61">
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1:urn:lsid:kepler-project.org/ns/:15314:107:61:urn:lsid:kepler-project.org/ns/:25158:63:2:urn:lsid:kepler-project.org/ns/:43955:67:62:urn:lsid:kepler-project.org/ns/:44497:5:4">
         </property>
         <property name="Annotation" class="ptolemy.vergil.kernel.attributes.TextAttribute">
             <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
@@ -4268,7 +6830,7 @@
             </property>
             <property name="italic" class="ptolemy.data.expr.Parameter" value="false">
             </property>
-            <property name="text" class="ptolemy.kernel.util.StringAttribute" value="This subworkflow modifies the END_PRODUCTS_SUBDIR variable, 
increasing one number each a data set is run">
+            <property name="text" class="ptolemy.kernel.util.StringAttribute" value="This subworkflow modifies takes care of the final tasks:
-Creating a README file with the list of files
-Displaying a window with the finished datasets
-Creating input for ProvenanceExplorer">
                 <property name="_style" class="ptolemy.actor.gui.style.TextStyle">
                     <property name="height" class="ptolemy.data.expr.Parameter" value="20">
                     </property>
@@ -4287,7 +6849,7 @@
 <property name="prop:textColor" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font color. Specify a string representing an array of four elements: red, green, blue, and alpha, where alpha is transparency. The default is an opaque black, {0.0, 0.0, 0.0, 1.0}</configure></property>
 <property name="prop:textSize" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The font size. Select an integer from the drop-down menu or specify a new size by typing it directly into the value field.  The default is 14.</configure></property>
 <property name="prop:text" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The text of the annotation.</configure></property>
-</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:436:1">
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:52:1">
             </property>
             <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.vergil.kernel.attributes.TextAttribute">
                 <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1199:1">
@@ -4297,12 +6859,14 @@
             </property>
             <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#WorkflowDocumentation">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{145.0, 570.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[560.0, 650.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:436:1">
             </property>
         </property>
         <port name="current_dataset" class="ptolemy.actor.TypedIOPort">
             <property name="input"/>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{175.0, 195.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[415.0, 170.0]">
             </property>
             <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
             </property>
@@ -4314,13 +6878,23 @@
             <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
             </property>
         </port>
+        <port name="bookkeeping_db" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[496.71875, 622.8125]">
+            </property>
+        </port>
+        <port name="global_timestamp" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[420.0, 705.0]">
+            </property>
+        </port>
         <entity name="String Constant" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="README">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="README">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -4346,7 +6920,7 @@
                 <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
                 </property>
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{720.0, 525.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[715.0, 480.0]">
             </property>
             <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
             </property>
@@ -4359,10 +6933,10 @@
                 </property>
             </port>
         </entity>
-        <entity name="Display Current Dataset" class="ptolemy.actor.lib.gui.Display">
-            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={33, 949, 1325, 200}, maximized=false}">
+        <entity name="Finished Datasets" class="ptolemy.actor.lib.gui.Display">
+            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={0, 539, 1331, 202}, maximized=false}">
             </property>
-            <property name="_paneSize" class="ptolemy.actor.gui.SizeAttribute">
+            <property name="_paneSize" class="ptolemy.actor.gui.SizeAttribute" value="[1323, 153]">
             </property>
             <property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" value="10">
             </property>
@@ -4382,7 +6956,7 @@
 <property name="prop:rowsDisplayed" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The vertical size of the display, in rows. The value is an integer that defaults to 10.</configure></property>
 <property name="prop:columnsDisplayed" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The horizontal size of the display, in columns. The value is an integer that defaults to 40.</configure></property>
 <property name="prop:title" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The title of the text display window. If specified, the value will appear in the title bar of the text display window.</configure></property>
-</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:17547:3:12">
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:54:1">
             </property>
             <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.gui.Display">
                 <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:883:1">
@@ -4394,7 +6968,7 @@
             </property>
             <property name="_location" class="ptolemy.kernel.util.Location" value="{785.0, 160.0}">
             </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:7:1:urn:lsid:kepler-project.org/ns/:13643:22:2">
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:7:1:urn:lsid:kepler-project.org/ns/:13643:22:2:urn:lsid:kepler-project.org/ns/:17547:3:12">
             </property>
             <property name="" class="ptolemy.vergil.basic.DocAttribute">
                 <property name="description" class="ptolemy.kernel.util.StringAttribute" value="<p>The Display actor reads tokens of any type via its input multiport, and displays each token on a separate line in a text display window.</p>

<p>Specify the size of the text display window with the rowsDisplayed and columnsDisplayed parameters. Simply resizing the window onscreen does not persistently change the size when the workflow is saved, closed, and then re- [...]
@@ -4416,12 +6990,12 @@
             </property>
         </entity>
         <entity name="String Constant2" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$END_PRODUCTS_DIR">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="$END_PRODUCTS_DIR">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -4447,7 +7021,7 @@
                 <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
                 </property>
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{715.0, 425.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[715.0, 405.0]">
             </property>
             <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1">
             </property>
@@ -4461,12 +7035,12 @@
             </port>
         </entity>
         <entity name="String Constant3" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value=" Dataset has been reduced and saved in ">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value=" Dataset has been reduced and saved in ">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -4492,7 +7066,7 @@
                 <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
                 </property>
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{245.0, 345.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[250.0, 235.0]">
             </property>
             <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
             </property>
@@ -4526,13 +7100,13 @@
             </property>
             <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#IterativeOperation">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{360.0, 435.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[325.0, 355.0]">
             </property>
             <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:292:1">
             </property>
         </entity>
         <entity name="Write README" class="org.geon.FileWrite">
-            <property name="fileName" class="ptolemy.actor.parameters.FilePortParameter" value="System.out">
+            <property name="fileName" class="ptolemy.actor.parameters.FilePortParameter" value="/diskb/cgarcia/reflex_data//reflex_end_products/2013-10-25T18:57:47/README">
             </property>
             <property name="append" class="ptolemy.data.expr.Parameter" value="true">
             </property>
@@ -4550,7 +7124,7 @@
 <property name="prop:append" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether to append the input string to an existing, specified file. By default, the actor will overwrite any preexisting file.</configure></property>
 <property name="prop:confirmOverwrite" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify whether the actor should confirm before overwriting an existing file. By default, the actor will not ask for confirmation.</configure></property>
 <property name="prop:fileName" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The name of the file to which to write. See FileParameter for more information about specifying file names. </configure></property>
-</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:118:5">
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:43955:73:1">
             </property>
             <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.geon.FileWrite">
                 <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1003:1">
@@ -4560,9 +7134,9 @@
             </property>
             <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#LocalOutput">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{870.0, 370.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[750.0, 560.0]">
             </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:144:1">
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:144:1:urn:lsid:kepler-project.org/ns/:15314:118:5">
             </property>
             <property name="" class="ptolemy.vergil.basic.DocAttribute">
                 <property name="description" class="ptolemy.kernel.util.StringAttribute" value="<p>The FileWriter actor reads a string and writes it to a file. The actor outputs the file path of the generated file.</p>

<p>Specify a destination file path with the fileName parameter. If the specified file does not exist, then the actor will create it.  If the file already exists, then the actor will ask for permission to overwrite it (unless the append parameter  [...]
@@ -4584,7 +7158,7 @@
             </property>
             <port name="fileName" class="ptolemy.actor.parameters.ParameterPort">
                 <property name="input"/>
-                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
                 </property>
             </port>
             <port name="url" class="ptolemy.actor.TypedIOPort">
@@ -4594,12 +7168,12 @@
             </port>
         </entity>
         <entity name="String Constant4" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$END_PRODUCTS_SUBDIR">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="$END_PRODUCTS_SUBDIR">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -4625,7 +7199,7 @@
                 <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
                 </property>
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{255.0, 520.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[215.0, 405.0]">
             </property>
             <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1">
             </property>
@@ -4637,12 +7211,12 @@
             </port>
         </entity>
         <entity name="String Constant5" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$GLOBAL_TIMESTAMP">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="$GLOBAL_TIMESTAMP">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -4668,7 +7242,7 @@
                 <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
                 </property>
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{710.0, 490.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[725.0, 445.0]">
             </property>
             <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1">
             </property>
@@ -4716,12 +7290,12 @@
             </property>
         </entity>
         <entity name="String Constant6" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$END_PRODUCTS_DIR">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="$END_PRODUCTS_DIR">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -4747,7 +7321,7 @@
                 <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
                 </property>
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{255.0, 395.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[220.0, 345.0]">
             </property>
             <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1">
             </property>
@@ -4769,7 +7343,7 @@
 <property name="port:whole" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the full string.</configure></property>
 <property name="port:parts" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts substrings.</configure></property>
 <property name="prop:Substring separator" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The characters used to separate the elements in the output string. By default, the value is "".</configure></property>
-</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:15314:124:4">
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:43955:72:1">
             </property>
             <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.resurgence.actor.StringAccumulator">
                 <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1117:1">
@@ -4779,15 +7353,15 @@
             </property>
             <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#IterativeOperation">
             </property>
-            <property name="_location" class="ptolemy.kernel.util.Location" value="{860.0, 475.0}">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[860.0, 430.0]">
             </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:292:1">
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:292:1:urn:lsid:kepler-project.org/ns/:15314:124:4">
             </property>
             <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="false">
             </property>
             <port name="whole" class="ptolemy.actor.TypedIOPort">
                 <property name="output"/>
-                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
+                <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
                 </property>
             </port>
         </entity>
@@ -4825,16 +7399,216 @@
                 </property>
                 <property name="parts (port)" class="ptolemy.kernel.util.StringAttribute" value="A multiport that accepts substrings.">
                 </property>
-                <property name="whole (port)" class="ptolemy.kernel.util.StringAttribute" value="An output port that broadcasts the full string.">
+                <property name="whole (port)" class="ptolemy.kernel.util.StringAttribute" value="An output port that broadcasts the full string.">
+                </property>
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:292:1">
+            </property>
+        </entity>
+        <entity name="String Constant7" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value=" with files: ">
+            </property>
+            <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
+            </property>
+            <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The StringConstant actor outputs a string specified via the actor's value parameter.</p>

<p>Specifying strings with the StringConstant actor is convenient, as the actor does not require that strings be surrounded by quotes. The actor is often used to specify file paths, which can be selected using the Browse button available in the actor's parameters.</p&g [...]
+<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a string constant specified by the value parameter.  </configure></property>
+<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time. </configure></property>
+<property name="prop:firingCountLimit" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.</configure></property>
+<property name="prop:value" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The value produced by the actor. Specified strings do not require enclosing quotes. (To include a '$' sign in the string, enter '$$'.)</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:43955:68:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.StringConst">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1052:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#StringFunctionActor">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Constant">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
+                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
+                </property>
+                <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
+                </property>
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[215.0, 445.0]">
+            </property>
+            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1:urn:lsid:kepler-project.org/ns/:13643:21:2:urn:lsid:kepler-project.org/ns/:17547:19:3">
+            </property>
+            <port name="trigger" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+                </property>
+            </port>
+        </entity>
+        <entity name="README message" class="org.resurgence.actor.StringAccumulator">
+            <property name="Substring separator" class="ptolemy.data.expr.Parameter" value="""">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Wibke Sudholt</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>
The StringAccumulator actor reads multiple strings via its input port and outputs a string containing all of the input values. The characters separating the substrings in the output string can be specified with the substringSeparator parameter.</p></configure></property>
+<property name="port:whole" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts the full string.</configure></property>
+<property name="port:parts" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts substrings.</configure></property>
+<property name="prop:Substring separator" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The characters used to separate the elements in the output string. By default, the value is "".</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:43955:69:4">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.resurgence.actor.StringAccumulator">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1117:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#StringFunctionActor">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#IterativeOperation">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[435.0, 465.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:292:1:urn:lsid:kepler-project.org/ns/:17547:25:2">
+            </property>
+        </entity>
+        <entity name="ObjectToText" class="org.eso.ObjectToText">
+            <property name="Include Header and Footer" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Converts Reflex JSON objects into a human-readable form</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The ObjectToString converts the JSON objects used by ESO actors (i.e. datasets, sof and sop) into a human-readable form.</configure></property>
+<property name="port:text out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A nicely formatted string</configure></property>
+<property name="port:json in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The input JSON object</configure></property>
+<property name="prop:semanticType41" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:Include Header and Footer" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>if true the output text will contain a descriptive header and footer</configure></property>
+<property name="prop:entityId" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:class" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:907:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.ObjectToText">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+                </property>
+            </property>
+            <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="{250, 500}">
+            </property>
+            <port name="json in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="text out" class="ptolemy.actor.TypedIOPort">
+                <property name="output"/>
+                <property name="_showName" class="ptolemy.data.expr.Parameter" value="true">
+                </property>
+                <property name="tokenProductionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+        </entity>
+        <entity name="String Constant8" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$GLOBAL_TIMESTAMP">
+            </property>
+            <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
+            </property>
+            <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The StringConstant actor outputs a string specified via the actor's value parameter.</p>

<p>Specifying strings with the StringConstant actor is convenient, as the actor does not require that strings be surrounded by quotes. The actor is often used to specify file paths, which can be selected using the Browse button available in the actor's parameters.</p&g [...]
+<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a string constant specified by the value parameter.  </configure></property>
+<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time. </configure></property>
+<property name="prop:firingCountLimit" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.</configure></property>
+<property name="prop:value" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The value produced by the actor. Specified strings do not require enclosing quotes. (To include a '$' sign in the string, enter '$$'.)</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:9:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.StringConst">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1052:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#StringFunctionActor">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Constant">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
+                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
+                </property>
+                <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
+                </property>
+            </property>
+            <property name="_location" class="ptolemy.kernel.util.Location" value="{235.92917625255623, 706.25915452454}">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1:urn:lsid:kepler-project.org/ns/:17547:23:2:urn:lsid:kepler-project.org/ns/:38241:63:1">
+            </property>
+            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
+            </property>
+            <port name="trigger" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+                </property>
+            </port>
+        </entity>
+        <entity name="String Constant9" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$BOOKKEEPING_DIR/bookkeeping.db">
+            </property>
+            <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
+            </property>
+            <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
+            </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The StringConstant actor outputs a string specified via the actor's value parameter.</p>

<p>Specifying strings with the StringConstant actor is convenient, as the actor does not require that strings be surrounded by quotes. The actor is often used to specify file paths, which can be selected using the Browse button available in the actor's parameters.</p&g [...]
+<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts a string constant specified by the value parameter.  </configure></property>
+<property name="port:trigger" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that has no declared type (in other words, the port can accept any data type: double, int, array, etc.) If the port is connected, the actor will not fire until the trigger port receives an input token. Connecting the port is optional, but useful when scheduling the actor to perform at a certain time. </configure></property>
+<property name="prop:firingCountLimit" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The limit on the number of times the actor will fire. The default value is 'NONE', meaning there is no limit on the number of time the constant will be provided to the output port. Any integer can be provided as a value for this parameter.</configure></property>
+<property name="prop:value" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The value produced by the actor. Specified strings do not require enclosing quotes. (To include a '$' sign in the string, enter '$$'.)</configure></property>
+</property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:8:1">
+            </property>
+            <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.StringConst">
+                <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1052:1">
+                </property>
+            </property>
+            <property name="semanticType00" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#StringFunctionActor">
+            </property>
+            <property name="semanticType11" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:2:1#Constant">
+            </property>
+            <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
+                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
+                </property>
+                <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
                 </property>
             </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:292:1">
+            <property name="_location" class="ptolemy.kernel.util.Location" value="[270.0, 620.0]">
+            </property>
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:204:1:urn:lsid:kepler-project.org/ns/:17547:23:2:urn:lsid:kepler-project.org/ns/:38241:62:1">
+            </property>
+            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
             </property>
+            <port name="trigger" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="true">
+                </property>
+            </port>
         </entity>
         <relation name="relation" class="ptolemy.actor.TypedIORelation">
             <property name="width" class="ptolemy.data.expr.Parameter" value="1">
             </property>
-            <vertex name="vertex1" value="[570.0, 355.0]">
+            <vertex name="vertex1" value="[560.0, 500.0]">
             </vertex>
         </relation>
         <relation name="relation2" class="ptolemy.actor.TypedIORelation">
@@ -4872,18 +7646,42 @@
         <relation name="relation10" class="ptolemy.actor.TypedIORelation">
             <property name="width" class="ptolemy.data.expr.Parameter" value="1">
             </property>
-            <vertex name="vertex1" value="[85.0, 405.0]">
+            <vertex name="vertex1" value="[85.0, 485.0]">
             </vertex>
         </relation>
         <relation name="relation11" class="ptolemy.actor.TypedIORelation">
             <property name="width" class="ptolemy.data.expr.Parameter" value="1">
             </property>
         </relation>
+        <relation name="relation12" class="ptolemy.actor.TypedIORelation">
+            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
+            </property>
+            <vertex name="vertex1" value="[555.0, 330.0]">
+            </vertex>
+        </relation>
+        <relation name="relation14" class="ptolemy.actor.TypedIORelation">
+            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
+            </property>
+        </relation>
+        <relation name="relation13" class="ptolemy.actor.TypedIORelation">
+            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
+            </property>
+        </relation>
+        <relation name="relation15" class="ptolemy.actor.TypedIORelation">
+            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
+            </property>
+        </relation>
+        <relation name="relation16" class="ptolemy.actor.TypedIORelation">
+            <property name="width" class="ptolemy.data.expr.Parameter" value="1">
+            </property>
+        </relation>
         <link port="current_dataset" relation="relation7"/>
         <link port="final_files" relation="relation10"/>
+        <link port="bookkeeping_db" relation="relation15"/>
+        <link port="global_timestamp" relation="relation16"/>
         <link port="String Constant.output" relation="relation9"/>
         <link port="String Constant.trigger" relation="relation"/>
-        <link port="Display Current Dataset.input" relation="relation"/>
+        <link port="Finished Datasets.input" relation="relation12"/>
         <link port="String Constant2.output" relation="relation2"/>
         <link port="String Constant2.trigger" relation="relation"/>
         <link port="String Constant3.output" relation="relation11"/>
@@ -4897,7 +7695,7 @@
         <link port="String Constant4.trigger" relation="relation10"/>
         <link port="String Constant5.output" relation="relation8"/>
         <link port="String Constant5.trigger" relation="relation"/>
-        <link port="Write to stdout.input" relation="relation"/>
+        <link port="Write to stdout.input" relation="relation12"/>
         <link port="String Constant6.output" relation="relation5"/>
         <link port="String Constant6.trigger" relation="relation10"/>
         <link port="Path to README.parts" relation="relation2"/>
@@ -4907,7 +7705,19 @@
         <link port="Final message.parts" relation="relation7"/>
         <link port="Final message.parts" relation="relation11"/>
         <link port="Final message.parts" relation="relation4"/>
-        <link port="Final message.whole" relation="relation"/>
+        <link port="Final message.whole" relation="relation12"/>
+        <link port="String Constant7.output" relation="relation14"/>
+        <link port="String Constant7.trigger" relation="relation10"/>
+        <link port="README message.parts" relation="relation12"/>
+        <link port="README message.parts" relation="relation14"/>
+        <link port="README message.parts" relation="relation13"/>
+        <link port="README message.whole" relation="relation"/>
+        <link port="ObjectToText.json in" relation="relation10"/>
+        <link port="ObjectToText.text out" relation="relation13"/>
+        <link port="String Constant8.output" relation="relation16"/>
+        <link port="String Constant8.trigger" relation="relation10"/>
+        <link port="String Constant9.output" relation="relation15"/>
+        <link port="String Constant9.trigger" relation="relation10"/>
     </entity>
     <entity name="Response Curve" class="ptolemy.actor.TypedCompositeActor">
         <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="7.0.2">
@@ -5107,19 +7917,31 @@
             </property>
             <property name="_location" class="ptolemy.kernel.util.Location" value="{720.0, 460.0}">
             </property>
+            <port name="trueInput" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
+            <port name="falseInput" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
+            </port>
             <port name="control" class="ptolemy.actor.TypedIOPort">
                 <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
                 <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
                 </property>
             </port>
         </entity>
         <entity name="Empty SOF" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -5161,8 +7983,8 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Paul Whitaker</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Logic Function actor reads Boolean tokens, performs a specified logical operation (e.g., "and" or  "xnor"), and outputs the evaluated result as a Boolean token.</p>

<p>Specify a logic function with the function parameter. The following logic functions may be performed:</p>

<table>
<tr><th>Logic Func [...]
-<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts Boolean tokens representing the evaluated input.</configure></property>
 <property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts Boolean tokens.</configure></property>
+<property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts Boolean tokens representing the evaluated input.</configure></property>
 <property name="prop:function" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The logical operation to perform: and, or, xor, nand, nor, xnor. For more information about these functions, see http://whatis.techtarget.com/definition/0,,sid9_gci213512,00.html.</configure></property>
 </property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:67:1">
             </property>
@@ -5182,12 +8004,12 @@
             </property>
         </entity>
         <entity name="String Constant4" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="$EnableProcessing">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="$EnableProcessing">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -5223,9 +8045,9 @@
             </property>
             <property name="ignoreCase" class="ptolemy.data.expr.Parameter" value="true">
             </property>
-            <property name="firstString" class="ptolemy.actor.parameters.PortParameter" value="">
+            <property name="firstString" class="ptolemy.actor.parameters.PortParameter" value="true">
             </property>
-            <property name="secondString" class="ptolemy.actor.parameters.PortParameter" value="">
+            <property name="secondString" class="ptolemy.actor.parameters.PortParameter" value="true">
             </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
@@ -5257,12 +8079,12 @@
             </property>
         </entity>
         <entity name="String Constant2" class="ptolemy.actor.lib.StringConst">
+            <property name="value" class="ptolemy.data.expr.Parameter" value="true">
+            </property>
             <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="NONE">
             </property>
             <property name="NONE" class="ptolemy.data.expr.Parameter" value="0">
             </property>
-            <property name="value" class="ptolemy.data.expr.Parameter" value="true">
-            </property>
 <property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
 <property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Edward Lee</configure></property>
@@ -5302,8 +8124,8 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Paul Whitaker</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>The Logic Function actor reads Boolean tokens, performs a specified logical operation (e.g., "and" or  "xnor"), and outputs the evaluated result as a Boolean token.</p>

<p>Specify a logic function with the function parameter. The following logic functions may be performed:</p>

<table>
<tr><th>Logic Func [...]
-<property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts Boolean tokens.</configure></property>
 <property name="port:output" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>An output port that broadcasts Boolean tokens representing the evaluated input.</configure></property>
+<property name="port:input" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A multiport that accepts Boolean tokens.</configure></property>
 <property name="prop:function" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The logical operation to perform: and, or, xor, nand, nor, xnor. For more information about these functions, see http://whatis.techtarget.com/definition/0,,sid9_gci213512,00.html.</configure></property>
 </property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:67:1">
             </property>
@@ -5359,11 +8181,15 @@
             <port name="sof in" class="ptolemy.actor.TypedIOPort">
                 <property name="input"/>
                 <property name="multiport"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="0">
+                </property>
                 <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
                 </property>
             </port>
             <port name="#groups" class="ptolemy.actor.TypedIOPort">
                 <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
                 <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
                 </property>
             </port>
@@ -5419,6 +8245,17 @@
             </property>
             <property name="_location" class="ptolemy.kernel.util.Location" value="[470.0, 320.0]">
             </property>
+            <port name="sof in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="multiport"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
+            <port name="sop in" class="ptolemy.actor.TypedIOPort">
+                <property name="input"/>
+                <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+                </property>
+            </port>
         </entity>
         <relation name="relation7" class="ptolemy.actor.TypedIORelation">
             <property name="width" class="ptolemy.data.expr.Parameter" value="1">
@@ -5537,90 +8374,10 @@
         <link port="fors_science_2.sof in" relation="relation11"/>
         <link port="fors_science_2.sof out" relation="relation6"/>
     </entity>
-    <entity name="ProductRenamer" class="ptolemy.actor.lib.python.PythonScript">
-        <property name="script" class="ptolemy.kernel.util.StringAttribute" value="import os
import shutil

from ptolemy.data import StringToken, IntToken
from ptolemy.data.expr import Parameter
from org.eso.util import JSONTools
from nom.tam.fits import Fits
from java.beans  import  XMLEncoder
import java.io.BufferedOutputStream
import java.io.BufferedOutputStream
from java.io import BufferedOutputStream
from java.io import ByteArrayOutputStre [...]
-        </property>
-<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
-<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Renames recipe products based on FITS keywords</configure></property>
-<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
-<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
-<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure> This actor moves (or copies or links) its input sof to a final product directory based on some FITS keywords.
 Usually, it should be connected to the output of the recipes that produce final products. If the recipe produces more products that are not relevant to rename, an output filter can be put in the recipe.</configure></property>
-<property name="port:sof_out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The final list of files produced</configure></property>
-<property name="port:sof_in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The files to be copied/moved or linked</configure></property>
-<property name="prop:RenameKeywords" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The list of keywords used to create the new name</configure></property>
-<property name="prop:OutputExistsMode" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>This parameter defines the behaviour in case the output files already exists: it can be "append_version" (create a new file with a running index suffix), "overwrite" (replace the existing file), "stop" (stop the workflow)</configure></property>
-<property name="prop:script" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
-<property name="prop:FinalProductDirectory" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The directory where the files are going to be copied/linked or renamed. It is usually set to END_PRODUCTS_DIR</configure></property>
-<property name="prop:SubDir" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If it is not empty, a subdirectory will be created with this string. The value can contain backslashes (and intermediate directories will be created). It will usually be END_PROD_SUBDIR, created somewhere in the workflow</configure></property>
-<property name="prop:CopyMode" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>There are several options: "copy", "move" or "link".</configure></property>
-</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:25158:50:1">
-        </property>
-        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.python.PythonScript">
-            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
-            </property>
-        </property>
-        <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
-        </property>
-        <property name="_editorFactory" class="ptolemy.vergil.toolbox.TextEditorConfigureFactory">
-            <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="script">
-            </property>
-        </property>
-        <property name="_location" class="ptolemy.kernel.util.Location" value="[1015.0, 945.0]">
-        </property>
-        <property name="RenameKeywords" class="ptolemy.data.expr.StringParameter" value="HIERARCH.ESO.OBS.NAME,'_',HIERARCH.ESO.PRO.CATG">
-        </property>
-        <property name="FinalProductDirectory" class="ptolemy.data.expr.StringParameter" value="$END_PRODUCTS_DIR">
-        </property>
-        <property name="SubDir" class="ptolemy.data.expr.StringParameter" value="$END_PRODUCTS_SUBDIR">
-        </property>
-        <property name="CopyMode" class="ptolemy.data.expr.StringParameter" value="copy">
-        </property>
-        <property name="OutputExistsMode" class="ptolemy.data.expr.StringParameter" value="append_version">
-        </property>
-        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:910:1:urn:lsid:kepler-project.org/ns/:24723:4:5:urn:lsid:kepler-project.org/ns/:25047:16:2">
-        </property>
-        <property name="" class="ptolemy.vergil.basic.DocAttribute">
-            <property name="description" class="ptolemy.kernel.util.StringAttribute" value=" This actor moves (or copies or links) its input sof to a final product directory based on some FITS keywords.
 Usually, it should be connected to the output of the recipes that produce final products. If the recipe produces more products that are not relevant to rename, an output filter can be put in the recipe.">
-            </property>
-            <property name="author" class="ptolemy.kernel.util.StringAttribute" value="ESO">
-            </property>
-            <property name="version" class="ptolemy.kernel.util.StringAttribute" value="2.0">
-            </property>
-            <property name="RenameKeywords (parameter)" class="ptolemy.data.expr.StringParameter" value="The list of keywords used to create the new name">
-            </property>
-            <property name="FinalProductDirectory (parameter)" class="ptolemy.data.expr.StringParameter" value="The directory where the files are going to be copied/linked or renamed. It is usually set to END_PRODUCTS_DIR">
-            </property>
-            <property name="SubDir (parameter)" class="ptolemy.data.expr.StringParameter" value="If it is not empty, a subdirectory will be created with this string. The value can contain backslashes (and intermediate directories will be created). It will usually be END_PROD_SUBDIR, created somewhere in the workflow">
-            </property>
-            <property name="CopyMode (parameter)" class="ptolemy.data.expr.StringParameter" value="There are several options: "copy", "move" or "link".">
-            </property>
-            <property name="OutputExistsMode (parameter)" class="ptolemy.data.expr.StringParameter" value="This parameter defines the behaviour in case the output files already exists: it can be "append_version" (create a new file with a running index suffix), "overwrite" (replace the existing file), "stop" (stop the workflow)">
-            </property>
-            <property name="sof_out (port)" class="ptolemy.kernel.util.StringAttribute" value="The final list of files produced">
-            </property>
-            <property name="sof_in (port)" class="ptolemy.kernel.util.StringAttribute" value="The files to be copied/moved or linked">
-            </property>
-            <property name="script (parameter)" class="ptolemy.data.expr.StringParameter" value="">
-            </property>
-        </property>
-        <port name="sof_in" class="ptolemy.actor.TypedIOPort">
-            <property name="input"/>
-            <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
-            </property>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
-            </property>
-        </port>
-        <port name="sof_out" class="ptolemy.actor.TypedIOPort">
-            <property name="output"/>
-            <property name="multiport"/>
-            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
-            </property>
-        </port>
-    </entity>
     <entity name="Data Set Selection" class="ptolemy.actor.TypedCompositeActor">
         <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.1.devel">
         </property>
-        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:31989:59:5">
+        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:43955:89:2">
         </property>
         <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.TypedCompositeActor">
             <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:449:1">
@@ -5639,11 +8396,9 @@
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p>A Composite actor is an aggregation of actors. It may have a local director that is responsible for executing the contained actors. A Composite actor with a local director is called an opaque actor. Composite actors do not require a local director. Composite actors with no local director "inherit" the director from the containing workflow and are called non-opaque.</ [...]
 </property>        <property name="_location" class="ptolemy.kernel.util.Location" value="[-515.0, 895.0]">
         </property>
-        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1">
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:449:1:urn:lsid:kepler-project.org/ns/:31989:59:5">
         </property>
         <property name="DDF Director" class="ptolemy.domains.ddf.kernel.DDFDirector">
-            <property name="timeResolution" class="ptolemy.actor.parameters.SharedParameter" value="1E-10">
-            </property>
             <property name="iterations" class="ptolemy.data.expr.Parameter" value="0">
             </property>
             <property name="maximumReceiverCapacity" class="ptolemy.data.expr.Parameter" value="0">
@@ -5655,8 +8410,8 @@
 <property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Gang Zhou</configure></property>
 <property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>null</configure></property>
 <property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>
            <p> The dynamic dataflow (DDF) domain is a superset of the synchronous
            dataflow(SDF) and Boolean dataflow(BDF) domains. In the SDF domain,
            an actor consumes and produces a fixed number of tokens per firing.
            This static information makes possible compile-time scheduling. In the
            DDF domain, there are few  [...]
-<property name="prop:iterations" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify the number of times a workflow is iterated. By default, this parameter is set to "0". Note that "0" does not mean "no iterations." Rather, "0" means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. </configure></property>
 <property name="prop:maximumReceiverCapacity" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A Parameter representing the maximum capacity of each receiver controlled by this director. This is an integer that defaults to 0, which means the queue in each receiver is unbounded. To specify bounded queues, set this to a positive integer. </configure></property>
+<property name="prop:iterations" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Specify the number of times a workflow is iterated. By default, this parameter is set to "0". Note that "0" does not mean "no iterations." Rather, "0" means that the workflow will iterate forever. Values greater than zero specify the actual number of times the director should execute the entire workflow. </configure></property>
 <property name="prop:runUntilDeadlockInOneIteration" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>A parameter indicating whether one iteration consists of repeated basic iterations until deadlock. If this parameter is true, the model will be executed until deadlock in one iteration. The default value is a BooleanToken with the value false. It cannot be set to true if this director is at the top level.</configure></property>
 </property>            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:31617:99:1">
             </property>
@@ -5695,11 +8450,13 @@
         </port>
         <entity name="DataSetChooser" class="org.eso.DataSetChooser">
             <display name="Data Set Chooser"/>
-            <property name="Mode" class="ptolemy.data.expr.StringParameter" value="Select">
+            <property name="Selection mode" class="ptolemy.data.expr.StringParameter" value="$DataSelectionMethod">
             </property>
             <property name="FITS Viewer" class="ptolemy.data.expr.StringParameter" value="$FITS_VIEWER">
             </property>
-            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:31617:78:3">
+            <property name="Mode" class="ptolemy.data.expr.StringParameter" value="Select">
+            </property>
+            <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:43955:88:1">
             </property>
             <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.eso.DataSetChooser">
                 <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
@@ -5712,10 +8469,10 @@
                 </property>
                 <property name="version" class="ptolemy.kernel.util.StringAttribute" value="1.0">
                 </property>
-                <property name="Mode (parameter)" class="ptolemy.data.expr.StringParameter" value="<p>Skip: automatically select all files and don't show any window;</p><p>Display: select all the files and allow the user only to view them;</p><p>Select: standard mode.</p>">
-                </property>
                 <property name="FITS Viewer (parameter)" class="ptolemy.data.expr.StringParameter" value="The application used to inspect FITS files">
                 </property>
+                <property name="Mode (parameter)" class="ptolemy.data.expr.StringParameter" value="<p>Skip: automatically select all files and don't show any window;</p><p>Display: select all the files and allow the user only to view them;</p><p>Select: standard mode.</p>">
+                </property>
                 <property name="class (parameter)" class="ptolemy.data.expr.StringParameter" value="">
                 </property>
                 <property name="semanticType41 (parameter)" class="ptolemy.data.expr.StringParameter" value="">
@@ -5731,7 +8488,7 @@
             </property>
             <property name="_location" class="ptolemy.kernel.util.Location" value="{65.0, 385.0}">
             </property>
-            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:workflow:5:1:urn:lsid:kepler-project.org/ns/:12776:6:1:urn:lsid:kepler-project.org/ns/:13961:210:1">
+            <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:workflow:5:1:urn:lsid:kepler-project.org/ns/:12776:6:1:urn:lsid:kepler-project.org/ns/:13961:210:1:urn:lsid:kepler-project.org/ns/:31617:78:3">
             </property>
             <port name="datasets in" class="ptolemy.actor.TypedIOPort">
                 <property name="input"/>
@@ -5817,6 +8574,106 @@
         <link port="DataSetChooser.#selected" relation="relation3"/>
         <link port="Variable Setter.input" relation="relation3"/>
     </entity>
+    <entity name="ProductRenamer" class="ptolemy.actor.lib.python.PythonScript">
+        <property name="jythonClassName" class="ptolemy.kernel.util.StringAttribute" value="Main">
+        </property>
+        <property name="script" class="ptolemy.kernel.util.StringAttribute" value="import os
import shutil

from ptolemy.data import StringToken, IntToken
from ptolemy.data.expr import Parameter
from org.eso.util import JSONTools
from nom.tam.fits import Fits
from ptolemy.kernel.util import IllegalActionException
from org.eso.service import ExecutionServiceDB
import org.apache.log4j
from java.util import HashMap

class Main :
  "Pr [...]
+        </property>
+<property name="KeplerDocumentation" class="ptolemy.vergil.basic.KeplerDocumentationAttribute">
+<property name="description" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>Renames recipe products based on FITS keywords</configure></property>
+<property name="author" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>ESO</configure></property>
+<property name="version" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>2.0</configure></property>
+<property name="userLevelDocumentation" class="ptolemy.kernel.util.ConfigurableAttribute"><configure> This actor moves (or copies or links) its input sof to a final product directory based on some FITS keywords.
 Usually, it should be connected to the output of the recipes that produce final products. If the recipe produces more products that are not relevant to rename, an output filter can be put in the recipe.</configure></property>
+<property name="port:sof_out" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The final list of files produced</configure></property>
+<property name="port:sof_in" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The files to be copied/moved or linked</configure></property>
+<property name="prop:RenameKeywords" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The list of keywords used to create the new name</configure></property>
+<property name="prop:OutputExistsMode" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>This parameter defines the behaviour in case the output files already exists: it can be "append_version" (create a new file with a running index suffix), "overwrite" (replace the existing file), "stop" (stop the workflow)</configure></property>
+<property name="prop:script" class="ptolemy.kernel.util.ConfigurableAttribute"><configure></configure></property>
+<property name="prop:FinalProductDirectory" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The directory where the files are going to be copied/linked or renamed. It is usually set to END_PRODUCTS_DIR</configure></property>
+<property name="prop:SubDir" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>If it is not empty, a subdirectory will be created with this string. The value can contain backslashes (and intermediate directories will be created). It will usually be END_PROD_SUBDIR, created somewhere in the workflow</configure></property>
+<property name="prop:CopyMode" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>There are several options: "copy", "move" or "link".</configure></property>
+</property>        <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org/ns/:44576:83:1">
+        </property>
+        <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.python.PythonScript">
+            <property name="id" class="ptolemy.kernel.util.StringAttribute" value="null">
+            </property>
+        </property>
+        <property name="semanticType41" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:4:1#ESO">
+        </property>
+        <property name="_editorFactory" class="ptolemy.vergil.toolbox.TextEditorConfigureFactory">
+            <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="script">
+            </property>
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[1015.0, 825.0]">
+        </property>
+        <property name="RenameKeywords" class="ptolemy.data.expr.StringParameter" value="HIERARCH.ESO.OBS.NAME,'_',HIERARCH.ESO.PRO.CATG">
+        </property>
+        <property name="FinalProductDirectory" class="ptolemy.data.expr.StringParameter" value="$END_PRODUCTS_DIR">
+        </property>
+        <property name="SubDir" class="ptolemy.data.expr.StringParameter" value="$END_PRODUCTS_SUBDIR">
+        </property>
+        <property name="CopyMode" class="ptolemy.data.expr.StringParameter" value="copy">
+        </property>
+        <property name="OutputExistsMode" class="ptolemy.data.expr.StringParameter" value="append_version">
+        </property>
+        <property name="derivedFrom" class="org.kepler.moml.NamedObjIdReferralList" value="urn:lsid:kepler-project.org:actor:910:1:urn:lsid:kepler-project.org/ns/:24723:4:5:urn:lsid:kepler-project.org/ns/:25047:16:2:urn:lsid:kepler-project.org/ns/:25158:50:1:urn:lsid:kepler-project.org/ns/:38241:57:8">
+        </property>
+        <property name="" class="ptolemy.vergil.basic.DocAttribute">
+            <property name="description" class="ptolemy.kernel.util.StringAttribute" value=" This actor moves (or copies or links) its input sof to a final product directory based on some FITS keywords.
 Usually, it should be connected to the output of the recipes that produce final products. If the recipe produces more products that are not relevant to rename, an output filter can be put in the recipe.">
+            </property>
+            <property name="author" class="ptolemy.kernel.util.StringAttribute" value="ESO">
+            </property>
+            <property name="version" class="ptolemy.kernel.util.StringAttribute" value="2.0">
+            </property>
+            <property name="RenameKeywords (parameter)" class="ptolemy.data.expr.StringParameter" value="The list of keywords used to create the new name">
+            </property>
+            <property name="FinalProductDirectory (parameter)" class="ptolemy.data.expr.StringParameter" value="The directory where the files are going to be copied/linked or renamed. It is usually set to END_PRODUCTS_DIR">
+            </property>
+            <property name="SubDir (parameter)" class="ptolemy.data.expr.StringParameter" value="If it is not empty, a subdirectory will be created with this string. The value can contain backslashes (and intermediate directories will be created). It will usually be END_PROD_SUBDIR, created somewhere in the workflow">
+            </property>
+            <property name="CopyMode (parameter)" class="ptolemy.data.expr.StringParameter" value="There are several options: "copy", "move" or "link".">
+            </property>
+            <property name="OutputExistsMode (parameter)" class="ptolemy.data.expr.StringParameter" value="This parameter defines the behaviour in case the output files already exists: it can be "append_version" (create a new file with a running index suffix), "overwrite" (replace the existing file), "stop" (stop the workflow)">
+            </property>
+            <property name="script (parameter)" class="ptolemy.data.expr.StringParameter" value="">
+            </property>
+            <property name="sof_out (port)" class="ptolemy.kernel.util.StringAttribute" value="The final list of files produced">
+            </property>
+            <property name="sof_in (port)" class="ptolemy.kernel.util.StringAttribute" value="The files to be copied/moved or linked">
+            </property>
+        </property>
+        <property name="BookkeepingDir" class="ptolemy.data.expr.StringParameter" value="$BOOKKEEPING_DIR">
+        </property>
+        <port name="sof_in" class="ptolemy.actor.TypedIOPort">
+            <property name="input"/>
+            <property name="tokenConsumptionRate" class="ptolemy.data.expr.Parameter" value="1">
+            </property>
+            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="WEST">
+            </property>
+        </port>
+        <port name="sof_out" class="ptolemy.actor.TypedIOPort">
+            <property name="output"/>
+            <property name="multiport"/>
+            <property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="SOUTH">
+            </property>
+        </port>
+    </entity>
+    <entity name="ProvenanceExplorer" class="org.eso.ProvenanceExplorer">
+        <property name="Enabled" class="ptolemy.data.expr.StringParameter" value="$ProvenanceExplorerEnabled">
+        </property>
+        <property name="_location" class="ptolemy.kernel.util.Location" value="[1140.0, 1140.0]">
+        </property>
+        <port name="bookkeeping db" class="ptolemy.actor.TypedIOPort">
+            <property name="input"/>
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+            </property>
+        </port>
+        <port name="start date" class="ptolemy.actor.TypedIOPort">
+            <property name="input"/>
+            <property name="_showName" class="ptolemy.data.expr.SingletonParameter" value="false">
+            </property>
+        </port>
+    </entity>
     <relation name="relation2" class="ptolemy.actor.TypedIORelation">
         <property name="width" class="ptolemy.data.expr.Parameter" value="1">
         </property>
@@ -5865,14 +8722,6 @@
         <property name="width" class="ptolemy.data.expr.Parameter" value="1">
         </property>
     </relation>
-    <relation name="relation18" class="ptolemy.actor.TypedIORelation">
-        <property name="width" class="ptolemy.data.expr.Parameter" value="1">
-        </property>
-    </relation>
-    <relation name="relation13" class="ptolemy.actor.TypedIORelation">
-        <property name="width" class="ptolemy.data.expr.Parameter" value="1">
-        </property>
-    </relation>
     <relation name="relation20" class="ptolemy.actor.TypedIORelation">
         <property name="width" class="ptolemy.data.expr.Parameter" value="1">
         </property>
@@ -5897,6 +8746,12 @@
     </relation>
     <relation name="relation10" class="ptolemy.actor.TypedIORelation">
     </relation>
+    <relation name="relation16" class="ptolemy.actor.TypedIORelation">
+    </relation>
+    <relation name="relation18" class="ptolemy.actor.TypedIORelation">
+    </relation>
+    <relation name="relation23" class="ptolemy.actor.TypedIORelation">
+    </relation>
     <relation name="relation9" class="ptolemy.actor.TypedIORelation">
     </relation>
     <link port="FitsRouter.in" relation="relation14"/>
@@ -5919,8 +8774,6 @@
     <link port="SofCombiner2.sof in" relation="relation20"/>
     <link port="SofCombiner2.sof in" relation="relation8"/>
     <link port="SofCombiner2.sof out" relation="relation7"/>
-    <link port="Data Filter.sof in" relation="relation9"/>
-    <link port="Data Filter.sof out" relation="relation18"/>
     <link port="ForsCalib.sof_in" relation="relation3"/>
     <link port="ForsCalib.sof_out" relation="relation17"/>
     <link port="ForsScience.sof_in" relation="relation7"/>
@@ -5936,12 +8789,16 @@
     <link port="Initialise Current Dataset.dataset_in" relation="relation5"/>
     <link port="Initialise Current Dataset.current_dataset" relation="relation22"/>
     <link port="Close DataSet.current_dataset" relation="relation22"/>
-    <link port="Close DataSet.final_files" relation="relation13"/>
+    <link port="Close DataSet.final_files" relation="relation16"/>
+    <link port="Close DataSet.bookkeeping_db" relation="relation18"/>
+    <link port="Close DataSet.global_timestamp" relation="relation23"/>
     <link port="Response Curve.sof in" relation="relation6"/>
     <link port="Response Curve.sof out" relation="relation10"/>
     <link port="Response Curve.sof opt" relation="relation4"/>
-    <link port="ProductRenamer.sof_in" relation="relation18"/>
-    <link port="ProductRenamer.sof_out" relation="relation13"/>
     <link port="Data Set Selection.datasets_in" relation="relation11"/>
     <link port="Data Set Selection.dataset_out" relation="relation5"/>
+    <link port="ProductRenamer.sof_in" relation="relation9"/>
+    <link port="ProductRenamer.sof_out" relation="relation16"/>
+    <link port="ProvenanceExplorer.bookkeeping db" relation="relation18"/>
+    <link port="ProvenanceExplorer.start date" relation="relation23"/>
 </entity>
diff --git a/reflex/Makefile.am b/reflex/Makefile.am
index 5f1058f..3e2a0be 100644
--- a/reflex/Makefile.am
+++ b/reflex/Makefile.am
@@ -8,7 +8,7 @@ WORKFLOWS = ForsSpec.xml
 #Put here the OCA rules used by the workflow
 OCAWKF =  fors_spec_wkf.oca
 #Put Python scripts used by the workflows
-PYTHONWKF = 
+PYTHONWKF = fors_calib_interact.py fors_science_interact.py fors_plot_common.py
 
 #This installs the workflow and the OCA rules in reflexaux directory
 wkfextra_DATA = $(WORKFLOWS) $(OCAWKF) $(PYTHONWKF)
diff --git a/reflex/Makefile.in b/reflex/Makefile.in
index 0a6acb1..a0ac93b 100644
--- a/reflex/Makefile.in
+++ b/reflex/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,29 @@
 
 @SET_MAKE@
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -42,29 +56,58 @@ DIST_COMMON = $(srcdir)/ForsSpec.xml.in $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4macros/cpl.m4 \
-	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/purify.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4macros/eso.m4 $(top_srcdir)/m4macros/gsl.m4 \
+	$(top_srcdir)/m4macros/libtool.m4 \
+	$(top_srcdir)/m4macros/ltoptions.m4 \
+	$(top_srcdir)/m4macros/ltsugar.m4 \
+	$(top_srcdir)/m4macros/ltversion.m4 \
+	$(top_srcdir)/m4macros/lt~obsolete.m4 \
+	$(top_srcdir)/m4macros/purify.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = ForsSpec.xml
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(wkfcopydir)" "$(DESTDIR)$(wkfextradir)"
-wkfcopyDATA_INSTALL = $(INSTALL_DATA)
-wkfextraDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(wkfcopy_DATA) $(wkfextra_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
@@ -89,16 +132,17 @@ CX_LDFLAGS = @CX_LDFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOXYGEN = @DOXYGEN@
-ECHO = @ECHO@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 ESO_DEBUG_FLAGS = @ESO_DEBUG_FLAGS@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 FORS_BINARY_AGE = @FORS_BINARY_AGE@
 FORS_BINARY_VERSION = @FORS_BINARY_VERSION@
 FORS_INCLUDES = @FORS_INCLUDES@
@@ -108,12 +152,17 @@ FORS_MAJOR_VERSION = @FORS_MAJOR_VERSION@
 FORS_MICRO_VERSION = @FORS_MICRO_VERSION@
 FORS_MINOR_VERSION = @FORS_MINOR_VERSION@
 FORS_VERSION = @FORS_VERSION@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_LIBS = @GSL_LIBS@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 IRPLIB_INCLUDES = @IRPLIB_INCLUDES@
 LATEX = @LATEX@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBCEXT = @LIBCEXT@
 LIBCFITSIO = @LIBCFITSIO@
@@ -129,48 +178,52 @@ LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 LT_AGE = @LT_AGE@
 LT_CURRENT = @LT_CURRENT@
 LT_REVISION = @LT_REVISION@
 MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
 MOSCA_INCLUDES = @MOSCA_INCLUDES@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
-ONLINE_MODE_FALSE = @ONLINE_MODE_FALSE@
-ONLINE_MODE_TRUE = @ONLINE_MODE_TRUE@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PURIFY_CMD = @PURIFY_CMD@
-PURIFY_FALSE = @PURIFY_FALSE@
-PURIFY_TRUE = @PURIFY_TRUE@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 all_includes = @all_includes@
 all_ldflags = @all_ldflags@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -182,8 +235,12 @@ build_alias = @build_alias@
 build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
+builddir = @builddir@
 configdir = @configdir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
@@ -196,17 +253,21 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 pipedocsdir = @pipedocsdir@
 plugindir = @plugindir@
 prefix = @prefix@
 privatelibdir = @privatelibdir@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target = @target@
@@ -214,6 +275,9 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 wkfcopydir = @wkfcopydir@
 wkfextradir = @wkfextradir@
 AUTOMAKE_OPTIONS = foreign
@@ -225,7 +289,7 @@ WORKFLOWS = ForsSpec.xml
 #Put here the OCA rules used by the workflow
 OCAWKF = fors_spec_wkf.oca
 #Put Python scripts used by the workflows
-PYTHONWKF = 
+PYTHONWKF = fors_calib_interact.py fors_science_interact.py fors_plot_common.py
 
 #This installs the workflow and the OCA rules in reflexaux directory
 wkfextra_DATA = $(WORKFLOWS) $(OCAWKF) $(PYTHONWKF)
@@ -242,14 +306,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  reflex/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  reflex/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign reflex/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign reflex/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -267,6 +331,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 ForsSpec.xml: $(top_builddir)/config.status $(srcdir)/ForsSpec.xml.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
@@ -275,75 +340,84 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-
-distclean-libtool:
-	-rm -f libtool
-uninstall-info-am:
 install-wkfcopyDATA: $(wkfcopy_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(wkfcopydir)" || $(mkdir_p) "$(DESTDIR)$(wkfcopydir)"
-	@list='$(wkfcopy_DATA)'; for p in $$list; do \
+	@list='$(wkfcopy_DATA)'; test -n "$(wkfcopydir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(wkfcopydir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(wkfcopydir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(wkfcopyDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(wkfcopydir)/$$f'"; \
-	  $(wkfcopyDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(wkfcopydir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(wkfcopydir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(wkfcopydir)" || exit $$?; \
 	done
 
 uninstall-wkfcopyDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(wkfcopy_DATA)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(wkfcopydir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(wkfcopydir)/$$f"; \
-	done
+	@list='$(wkfcopy_DATA)'; test -n "$(wkfcopydir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(wkfcopydir)'; $(am__uninstall_files_from_dir)
 install-wkfextraDATA: $(wkfextra_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(wkfextradir)" || $(mkdir_p) "$(DESTDIR)$(wkfextradir)"
-	@list='$(wkfextra_DATA)'; for p in $$list; do \
+	@list='$(wkfextra_DATA)'; test -n "$(wkfextradir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(wkfextradir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(wkfextradir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(wkfextraDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(wkfextradir)/$$f'"; \
-	  $(wkfextraDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(wkfextradir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(wkfextradir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(wkfextradir)" || exit $$?; \
 	done
 
 uninstall-wkfextraDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(wkfextra_DATA)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(wkfextradir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(wkfextradir)/$$f"; \
-	done
+	@list='$(wkfextra_DATA)'; test -n "$(wkfextradir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(wkfextradir)'; $(am__uninstall_files_from_dir)
 tags: TAGS
 TAGS:
 
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -352,7 +426,7 @@ check: check-am
 all-am: Makefile $(DATA)
 installdirs:
 	for dir in "$(DESTDIR)$(wkfcopydir)" "$(DESTDIR)$(wkfextradir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
 install-exec: install-exec-am
@@ -364,16 +438,22 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -384,7 +464,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
 	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool
+distclean-am: clean-am distclean-generic
 
 dvi: dvi-am
 
@@ -392,18 +472,38 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
 
 install-data-am: install-wkfcopyDATA install-wkfextraDATA
 
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-am
+
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -422,19 +522,23 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-wkfcopyDATA \
-	uninstall-wkfextraDATA
+uninstall-am: uninstall-wkfcopyDATA uninstall-wkfextraDATA
+
+.MAKE: install-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
 	distclean distclean-generic distclean-libtool distdir dvi \
 	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-exec install-exec-am \
-	install-info install-info-am install-man install-strip \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
 	install-wkfcopyDATA install-wkfextraDATA installcheck \
 	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-generic \
 	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
-	uninstall-info-am uninstall-wkfcopyDATA uninstall-wkfextraDATA
+	uninstall-wkfcopyDATA uninstall-wkfextraDATA
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/reflex/fors_calib_interact.py b/reflex/fors_calib_interact.py
new file mode 100755
index 0000000..3b5e548
--- /dev/null
+++ b/reflex/fors_calib_interact.py
@@ -0,0 +1,233 @@
+# import the needed modules
+try:
+  import reflex
+  import_sucess = True
+
+#NOTE for developers: 
+# -If you want to modify the current script to cope
+#  with different parameters, this is the function to modify:
+#  setInteractiveParameters()
+# -If you want to modify the current script to read different data from
+#  the input FITS, this is the function to modify:
+#  readFitsData()                  (from class DataPlotterManager) 
+# -If you want to modify the current script to modify the plots (using the same
+#  data),  this is the function to modify:
+#  plotProductsGraphics()          (from class DataPlotterManager)
+# -If you want to modify the text that appears in the "Help" button,
+#  this is the function to modify:
+#  setWindowHelp()
+# -If you want to modify the title of the window, modify this function:
+#  setWindowTitle()
+
+
+  #This class deals with the specific details of data reading and final plotting.
+  class DataPlotterManager:
+    # This function will read all the columns, images and whatever is needed
+    # from the products. The variables , self.plot_x, self.plot_y, etc...
+    # are used later in function plotProductsGraphics().
+    # Add/delete these variables as you need (only that plotProductsGraphics()
+    # has to use the same names).
+    # You can also create some additional variables (like statistics) after
+    # reading the files.
+    # If you use a control variable (self.xxx_found), you can modify 
+    # later on the layout of the plotting window based on the presence of 
+    # given input files. 
+    # sof contains all the set of frames
+    def readFitsData(self, fitsFiles):
+      #Initialise the objects to read/display
+      self.lamp_reduced    = None
+      self.slit_map        = None
+      self.flat_norm       = None
+      self.flat_mscreen    = None
+      self.disp_residuals  = None
+      self.detected_lines  = None
+
+      #Read all the products
+      frames = dict()
+      for frame in fitsFiles:
+        if frame == '' :
+          continue
+        category = frame.category
+        frames[category] = frame
+
+
+      for inst_mode in ('MXU', 'MOS', 'LSS', 'LONG_MOS', 'LONG_MXU') :
+        if frames.has_key('REDUCED_LAMP_'+inst_mode):
+          self.lamp_reduced   = PlotableReducedArc(frames["REDUCED_LAMP_"+inst_mode])
+
+      for inst_mode in ('MXU', 'MOS', 'LSS', 'LONG_MOS', 'LONG_MXU') :
+        if frames.has_key('SPATIAL_MAP_'+inst_mode):
+          self.slit_map   = PlotableSpatialMap(frames["SPATIAL_MAP_"+inst_mode])
+
+      for inst_mode in ('MXU', 'MOS', 'LSS', 'LONG_MOS', 'LONG_MXU') :
+        if frames.has_key('DISP_RESIDUALS_TABLE_'+inst_mode):
+          self.disp_residuals = PlotableDispResiduals(frames["DISP_RESIDUALS_TABLE_"+inst_mode])
+
+      for inst_mode in ('MXU', 'MOS', 'LSS', 'LONG_MOS', 'LONG_MXU') :
+        if frames.has_key('DETECTED_LINES_'+inst_mode):
+          self.detected_lines = PlotableDetectedLines(frames["DETECTED_LINES_"+inst_mode])
+
+      curv_frame = None
+      for inst_mode in ('MXU', 'MOS', 'LSS', 'LONG_MOS', 'LONG_MXU') :
+        if frames.has_key('CURV_COEFF_'+inst_mode) :
+          curv_frame = frames['CURV_COEFF_'+inst_mode]
+                  
+      for inst_mode in ('MXU', 'MOS', 'LSS', 'LONG_MOS', 'LONG_MXU') :
+        if frames.has_key('MASTER_NORM_FLAT_'+inst_mode) :
+          self.flat_norm  = PlotableNormFlat(frames['MASTER_NORM_FLAT_'+inst_mode],
+                                            curv_frame)
+                  
+      for inst_mode in ('MXU', 'MOS', 'LSS', 'LONG_MOS', 'LONG_MXU') :
+        if frames.has_key('MASTER_SCREEN_FLAT_'+inst_mode) :
+          self.flat_mscreen  = PlotableFlat(frames['MASTER_SCREEN_FLAT_'+inst_mode],
+                                          curv_frame)
+                  
+    # This function creates all the subplots. It is responsible for the plotting 
+    # layouts. 
+    # There can different layouts, depending on the availability of data
+    # Note that subplot(I,J,K) means the Kth plot in a IxJ grid 
+    # Note also that the last one is actually a box with text, no graphs.
+    def addSubplots(self, figure):
+      if self.flat_norm is not None and self.lamp_reduced is not None \
+         and self.disp_residuals is not None and self.flat_mscreen is not None \
+         and self.detected_lines is not None:
+        if self.slit_map is not None:
+          self.subplot_slit_map       = figure.add_subplot(3,2,2)
+          self.subplot_lamp_reduced   = figure.add_subplot(3,2,1)
+        else:
+          self.subplot_lamp_reduced   = figure.add_subplot(3,1,1)
+        self.subplot_line_x_y       = figure.add_subplot(3,2,3)
+        self.subplot_flat_mscreen   = figure.add_subplot(3,2,4)
+        self.subplot_line_res_wave  = figure.add_subplot(3,2,5)
+        self.subplot_flat_norm      = figure.add_subplot(3,2,6)
+      else : 
+        self.subtext_nodata      = figure.add_subplot(1,1,1)
+          
+    # This is the function that makes the plots.
+    # Add new plots or delete them using the given scheme.
+    # The data has been already stored in self.plot_x, self.plot_xdif, etc ...
+    # It is mandatory to add a tooltip variable to each subplot.
+    # One might be tempted to merge addSubplots() and plotProductsGraphics().
+    # There is a reason not to do it: addSubplots() is called only once at
+    # startup, while plotProductsGraphics() is called always there is a resize.
+    def plotProductsGraphics(self, figure, canvas):
+      if self.flat_norm is not None and self.lamp_reduced is not None \
+         and self.disp_residuals is not None and self.flat_mscreen is not None \
+         and self.detected_lines is not None :
+
+        #Reduced lamp
+        title_lamp_reduced   = 'Reduced arc lamp frame' 
+        tooltip_lamp_reduced ="""Reduced arc lamp frame."""
+        self.lamp_reduced.plot(self.subplot_lamp_reduced, title_lamp_reduced, 
+                               tooltip_lamp_reduced)
+
+        #Spatial map
+        if self.slit_map is not None:
+          title_slit_map   = 'Slit spatial map' 
+          tooltip_slit_map ="""Reduced arc lamp frame."""
+          self.slit_map.plot(self.subplot_slit_map, title_slit_map, 
+                             tooltip_slit_map)
+
+        #Master screen flat 
+        title_flat_mscreen   = 'Reduced master screen flat frame' 
+        tooltip_flat_mscreen ="""Reduced master screen flat frame."""
+        self.flat_mscreen.plot(self.subplot_flat_mscreen, title_flat_mscreen,
+                           tooltip_flat_mscreen)
+
+        #Master flat normalise
+        title_flat_norm   = 'Reduced and normalised flat frame' 
+        tooltip_flat_norm ="""Reduced and normalised flat frame."""
+        self.flat_norm.plot(self.subplot_flat_norm, title_flat_norm,
+                           tooltip_flat_norm)
+        
+        #Dispersion residuals vs wave
+        title_line_res_wave   = 'Residuals of wavelength calibration' 
+        tooltip_line_res_wave ="""Residuals of wavelength calibration."""
+        self.detected_lines.plotResVsWave(self.subplot_line_res_wave, 
+                                          title_line_res_wave, tooltip_line_res_wave)
+        #Line positions X vs Y
+        title_line_x_y   = 'Detected / Identified lines' 
+        tooltip_line_x_y ="""Detected / Identified lines."""
+        self.detected_lines.plotXVsY(self.subplot_line_x_y, 
+                                     title_line_x_y, tooltip_line_x_y)
+        
+      else :
+        #Data not found info
+        self.subtext_nodata.set_axis_off()
+        self.text_nodata = 'Calibrations not found in the products (PRO.CATG=)' 
+        self.subtext_nodata.text(0.1, 0.6, self.text_nodata, color='#11557c', fontsize=18,
+                                 ha='left', va='center', alpha=1.0)
+        self.subtext_nodata.tooltip='Calibrations  not found in the products'
+ 
+  
+    # This function specifies which are the parameters that should be presented
+    # in the window to be edited.
+    # Note that the parameter has to be also in the in_sop port (otherwise it 
+    # won't appear in the window) 
+    # The descriptions are used to show a tooltip. They should match one to one
+    # with the parameter list 
+    # Note also that parameters have to be prefixed by the 'recipe name:'
+    def setInteractiveParameters(self):
+      paramList = list()
+      paramList.append(reflex.RecipeParameter('fors_calib','sradius',group='flat field norm',description='Smooth box radius for flat field along spatial direction (used if s_knots < 0)'))
+      paramList.append(reflex.RecipeParameter('fors_calib','dradius',group='flat field norm',description='Smooth box radius for flat field along dispersion direction (if d_knots < 0)'))
+      paramList.append(reflex.RecipeParameter('fors_calib','s_nknots',group='flat field norm',description='Number of knots in flat field fitting splines along spatial direction'))
+      paramList.append(reflex.RecipeParameter('fors_calib','d_nknots',group='flat field norm',description='Number of knots in flat field fitting splines along dispersion direction'))
+      paramList.append(reflex.RecipeParameter('fors_calib','splfit_threshold',group='flat field norm',description='Threshold percentage for flat spline fittingwith respect to the maximum'))
+      paramList.append(reflex.RecipeParameter('fors_calib','stack_method',group='master flat',description='Frames combination method. <sum | mean | median | ksigma>'))
+      paramList.append(reflex.RecipeParameter('fors_calib','kiter',group='master flat',description='Max number of iterations in ksigma method'))
+      paramList.append(reflex.RecipeParameter('fors_calib','klow',group='master flat',description='Low threshold in ksigma method'))
+      paramList.append(reflex.RecipeParameter('fors_calib','khigh',group='master flat',description='High threshold in ksigma method'))
+      paramList.append(reflex.RecipeParameter('fors_calib','wdegree',group='wave calib / distorsions',description='Degree of wave calib polynomial'))
+      paramList.append(reflex.RecipeParameter('fors_calib','wradius',group='wave calib / distorsions',description='Search radius if iterating pattern-matching with first-guess method'))
+      paramList.append(reflex.RecipeParameter('fors_calib','wreject',group='wave calib / distorsions',description='Rejection threshold in dispersion relation fit (pixel)'))
+      paramList.append(reflex.RecipeParameter('fors_calib','wmode',group='wave calib / distorsions',description='Interpolation mode of wavelength solution applicable to LSS-like data (0 = no interpolation, 1 = fill gaps, 2 = global model)'))
+      paramList.append(reflex.RecipeParameter('fors_calib','wmosmode',group='wave calib / distorsions',description='Interpolation mode of wavelength solution (0 = no interpolation, 1 = local (slit) solution, 2 = global model)'))
+      paramList.append(reflex.RecipeParameter('fors_calib','dispersion',group='wave calib / distorsions',description='Expected spectral dispersion (Angstrom/pixel)'))
+      paramList.append(reflex.RecipeParameter('fors_calib','peakdetection',group='wave calib / distorsions',description='Initial peak detection threshold (ADU)'))
+
+      return paramList
+
+    def setWindowHelp(self):
+      help_text = """
+In this window, the user ..."""
+      return help_text
+
+    def setWindowTitle(self):
+      title = 'Fors Interactive Calibration'
+      return title
+
+except ImportError:
+  import_sucess = 'false'
+  print "Error importing modules pyfits, wx, matplotlib, numpy"
+
+#This is the 'main' function
+if __name__ == '__main__':
+
+  # import reflex modules
+  import reflex_interactive_app
+  import sys
+
+  # import UVES reflex modules
+  from fors_plot_common import *
+
+  # Create interactive application
+  interactive_app = reflex_interactive_app.PipelineInteractiveApp()
+
+  #Check if import failed or not
+  if import_sucess == 'false' :
+    interactive_app.setEnableGUI('false')
+
+  #Open the interactive window if enabled
+  if interactive_app.isGUIEnabled() :
+    #Get the specific functions for this window
+    dataPlotManager = DataPlotterManager()
+    interactive_app.setPlotManager(dataPlotManager)
+    interactive_app.showGUI()
+  else :
+    interactive_app.passProductsThrough()
+
+  # print outputs
+  interactive_app.print_outputs()
+
+  sys.exit()
diff --git a/reflex/fors_plot_common.py b/reflex/fors_plot_common.py
new file mode 100755
index 0000000..0391ba2
--- /dev/null
+++ b/reflex/fors_plot_common.py
@@ -0,0 +1,210 @@
+try:
+  import numpy
+  from pipeline_display import *
+  from pipeline_product import *
+  from numpy.polynomial import Polynomial
+except ImportError:
+  donothing=1
+
+
+class PlotableReducedArc :
+  def __init__(self, fits):
+    self.arc     = PipelineProduct(fits)
+    self.arcdisp = ImageDisplay()
+    self.loadFromFits()
+
+  def loadFromFits(self) :
+    self.arc.readImage()
+
+  def plot(self, subplot, title, tooltip):
+    self.arcdisp.setLabels('X [pix]', 'Y [pix]')
+    self.arcdisp.setZLimits((-100., 1000.))
+    self.arcdisp.display(subplot, title, tooltip, self.arc.image)
+    
+class PlotableFlat(object) :
+  def __init__(self, fits_flat, fits_slittrace):
+    self.flat      = PipelineProduct(fits_flat)
+    self.slittrace = None
+    if fits_slittrace is not None:
+      self.slittrace = PipelineProduct(fits_slittrace)
+    self.flatdisp  = ImageDisplay()
+    self.loadFromFits()
+
+  def loadFromFits(self) :
+    #Reading the flat image
+    self.flat.readImage()
+    
+    #Reading the polinomial traces
+    if self.slittrace is not None:
+      ndegree = self.slittrace.getTableNcols(1) - 1
+      self.nslits  = self.slittrace.getTableNrows(1) / 2
+      degreecols = []
+      for deg in range(ndegree):
+        colname = 'c%d'%deg
+        self.slittrace.readTableColumn(1, colname)
+        degreecols.append(self.slittrace.column)
+    
+      top_trace_polynomials = []
+      bottom_trace_polynomials = []
+      for slit in range(self.nslits) :
+        top_trace_coeff = []
+        bottom_trace_coeff = []
+        for deg in range(ndegree) :
+          top_trace_coeff.append(degreecols[deg][2*slit])
+          bottom_trace_coeff.append(degreecols[deg][2*slit + 1])
+        
+        top_trace_pol = Polynomial(top_trace_coeff)  
+        bottom_trace_pol = Polynomial(bottom_trace_coeff)
+        top_trace_polynomials.append(top_trace_pol) 
+        bottom_trace_polynomials.append(bottom_trace_pol) 
+
+      #Creating the points to plot based on the polynomail traces
+      self.xpos_traces = []
+      self.ypos_top_traces = []
+      self.ypos_bottom_traces = []
+      for slit in range(self.nslits) :
+        ypos_top = []
+        ypos_bottom = []
+        xpos = []
+        for xpix in range(self.flat.image.shape[1]) :
+          xpos.append(xpix+1) 
+          ypos_top.append(top_trace_polynomials[slit](xpix)+1) 
+          ypos_bottom.append(bottom_trace_polynomials[slit](xpix)+1)
+        self.xpos_traces.append(xpos)
+        self.ypos_top_traces.append(ypos_top) 
+        self.ypos_bottom_traces.append(ypos_bottom)
+
+  def plot(self, subplot, title, tooltip):
+    self.flatdisp.setLabels('X [pix]', 'Y [pix]')
+    self.flatdisp.display(subplot, title, tooltip, self.flat.image)
+    
+    if self.slittrace is not None:
+      subplot.autoscale(enable=False)
+      for slit in range(self.nslits) :
+        subplot.plot(self.xpos_traces[slit], self.ypos_top_traces[slit],
+                     linestyle='solid',color='red')
+        subplot.plot(self.xpos_traces[slit], self.ypos_bottom_traces[slit],
+                     linestyle='solid',color='darkred')
+
+class PlotableNormFlat (PlotableFlat) :
+  def __init__(self, fits_flat, fits_slittrace):
+    super(PlotableNormFlat, self).__init__(fits_flat, fits_slittrace)
+
+  def plot(self, subplot, title, tooltip):
+    self.flatdisp.setZLimits((0.9, 1.1))
+    self.flat.image[self.flat.image > 5.] = 0
+    super(PlotableNormFlat, self).plot(subplot, title, tooltip)
+
+class PlotableSpatialMap :
+  def __init__(self, fits_spatialmap):
+    self.spatialmap      = PipelineProduct(fits_spatialmap)
+    self.spatialmapdisp  = ImageDisplay()
+    self.loadFromFits()
+
+  def loadFromFits(self) :
+    #Reading the flat image
+    self.spatialmap.readImage()
+
+  def plot(self, subplot, title, tooltip):
+    self.spatialmapdisp.setLabels('X', 'Y')
+    self.spatialmapdisp.setZLimits((0., 100))
+    self.spatialmapdisp.display(subplot, title, tooltip, self.spatialmap.image)
+
+class PlotableMappedScience :
+  def __init__(self, fits_mappedscience):
+    self.mappedscience      = PipelineProduct(fits_mappedscience)
+    self.mappedsciencedisp  = ImageDisplay()
+    self.loadFromFits()
+
+  def loadFromFits(self) :
+    #Reading the flat image
+    self.mappedscience.readImage()
+
+  def plot(self, subplot, title, tooltip):
+    self.mappedsciencedisp.setLabels('X', 'Y')
+    self.mappedsciencedisp.setZLimits((0., 0.9))
+    self.mappedsciencedisp.display(subplot, title, tooltip, self.mappedscience.image)
+
+class PlotableDispResiduals :
+  def __init__(self, fits_dispresiduals):
+    self.dispresiduals = PipelineProduct(fits_dispresiduals)
+    self.resdisplay  = ScatterDisplay()
+    self.loadFromFits()
+
+  def loadFromFits(self) :
+    #Reading the residuals table
+    self.dispresiduals.readTableColumn(1, 'wavelength')
+    self.wave = self.dispresiduals.column
+    nwave    = self.dispresiduals.getTableNrows(1)
+    ncolumns = self.dispresiduals.getTableNcols(1)
+    nselectedrows = (ncolumns - 1) // 3
+    self.residuals = []
+    self.allwave = []
+    self.allypos = []
+    self.allresiduals = []
+    for i in range(nselectedrows) :
+      #TODO: Currently the residuals are computed every 10 rows. 
+      #This is hard-coded in the pipeline. It would be better just to detect the
+      #columns whose name start with 'r' 
+      colname = 'r%d'%(i*10) 
+      self.dispresiduals.readTableColumn(1, colname)
+      row_residuals = self.dispresiduals.column
+      self.residuals.append(row_residuals)
+      self.allwave.extend(self.wave)
+      self.allresiduals.extend(row_residuals)
+      ypos = i*10.
+      self.allypos.extend([ypos] * nwave)
+
+  def plotResVsWave(self, subplot, title, tooltip):
+    self.resdisplay.setLabels('Wavelength [Ang]','Residual [pix]')
+    self.resdisplay.display(subplot, title, tooltip, self.allwave,
+                            self.allresiduals)
+
+  def plotResVsY(self, subplot, title, tooltip):
+    self.resdisplay.setLabels('Ypos [pix]','Residual [pix]')
+    self.resdisplay.display(subplot, title, tooltip, self.allypos,
+                            self.allresiduals)
+
+class PlotableDetectedLines :
+  def __init__(self, fits_detectedlines):
+    self.detectedlines = PipelineProduct(fits_detectedlines)
+    self.xydisplay     = ScatterDisplay()
+    self.resdisplay    = ScatterDisplay()
+    self.loadFromFits()
+
+  def loadFromFits(self) :
+    #Reading the residuals table
+    try :
+      self.detectedlines.readTableColumn(1, 'xpos_rectified')
+      self.x_pix = self.detectedlines.column
+      self.detectedlines.readTableColumn(1, 'ypos_rectified')
+      self.y_pix = self.detectedlines.column
+    except KeyError:
+      self.detectedlines.readTableColumn(1, 'xpos')
+      self.x_pix = self.detectedlines.column
+      self.detectedlines.readTableColumn(1, 'ypos')
+      self.y_pix = self.detectedlines.column
+      
+    self.detectedlines.readTableColumn(1, 'wave_ident')
+    self.wave  = self.detectedlines.column
+    self.detectedlines.readTableColumn(1, 'res_xpos')
+    self.res_xpos  = self.detectedlines.column
+
+  def plotXVsY(self, subplot, title, tooltip):
+    self.xydisplay.setLabels('Xpos [pix]','Ypos [pix]')
+    self.xydisplay.setColor('black')
+    self.xydisplay.display(subplot, title, tooltip, self.x_pix,
+                           self.y_pix)
+    self.xydisplay.setColor('green')
+    self.xydisplay.display(subplot, title, tooltip, 
+                           self.x_pix[numpy.isfinite(self.wave)],
+                           self.y_pix[numpy.isfinite(self.wave)])
+
+  def plotResVsWave(self, subplot, title, tooltip):
+    self.resdisplay.setLabels('Wavelength [Ang]','Residual [pix]')
+    self.resdisplay.setColor('black')
+    self.resdisplay.display(subplot, title, tooltip, 
+                            self.wave[numpy.isfinite(self.res_xpos)],
+                            self.res_xpos[numpy.isfinite(self.res_xpos)])
+
+
diff --git a/reflex/fors_science_interact.py b/reflex/fors_science_interact.py
new file mode 100755
index 0000000..ebca13b
--- /dev/null
+++ b/reflex/fors_science_interact.py
@@ -0,0 +1,155 @@
+# import the needed modules
+try:
+  import reflex
+  import_sucess = True
+
+#NOTE for developers: 
+# -If you want to modify the current script to cope
+#  with different parameters, this is the function to modify:
+#  setInteractiveParameters()
+# -If you want to modify the current script to read different data from
+#  the input FITS, this is the function to modify:
+#  readFitsData()                  (from class DataPlotterManager) 
+# -If you want to modify the current script to modify the plots (using the same
+#  data),  this is the function to modify:
+#  plotProductsGraphics()          (from class DataPlotterManager)
+# -If you want to modify the text that appears in the "Help" button,
+#  this is the function to modify:
+#  setWindowHelp()
+# -If you want to modify the title of the window, modify this function:
+#  setWindowTitle()
+
+
+  #This class deals with the specific details of data reading and final plotting.
+  class DataPlotterManager:
+    # This function will read all the columns, images and whatever is needed
+    # from the products. The variables , self.plot_x, self.plot_y, etc...
+    # are used later in function plotProductsGraphics().
+    # Add/delete these variables as you need (only that plotProductsGraphics()
+    # has to use the same names).
+    # You can also create some additional variables (like statistics) after
+    # reading the files.
+    # If you use a control variable (self.xxx_found), you can modify 
+    # later on the layout of the plotting window based on the presence of 
+    # given input files. 
+    # sof contains all the set of frames
+    def readFitsData(self, fitsFiles):
+      #Initialise the objects to read/display
+      self.sci_reduced    = None
+
+      #Read all the products
+      frames = dict()
+      for frame in fitsFiles:
+        if frame == '' :
+          continue
+        category = frame.category
+        frames[category] = frame
+
+
+      for inst_mode in {'MXU', 'MOS', 'LSS', 'LONG_MOS', 'LONG_MXU'} :
+        if frames.has_key('MAPPED_SCI_'+inst_mode):
+          self.sci_reduced   = PlotableMappedScience(frames["MAPPED_SCI_"+inst_mode])
+
+                  
+    # This function creates all the subplots. It is responsible for the plotting 
+    # layouts. 
+    # There can different layouts, depending on the availability of data
+    # Note that subplot(I,J,K) means the Kth plot in a IxJ grid 
+    # Note also that the last one is actually a box with text, no graphs.
+    def addSubplots(self, figure):
+      if self.sci_reduced is not None :
+        self.subplot_sci_reduced    = figure.add_subplot(1,1,1)
+      else : 
+        self.subtext_nodata      = figure.add_subplot(1,1,1)
+          
+    # This is the function that makes the plots.
+    # Add new plots or delete them using the given scheme.
+    # The data has been already stored in self.plot_x, self.plot_xdif, etc ...
+    # It is mandatory to add a tooltip variable to each subplot.
+    # One might be tempted to merge addSubplots() and plotProductsGraphics().
+    # There is a reason not to do it: addSubplots() is called only once at
+    # startup, while plotProductsGraphics() is called always there is a resize.
+    def plotProductsGraphics(self, figure, canvas):
+      if self.sci_reduced is not None :
+
+        #Reduced science
+        title_sci_reduced   = 'Reduced mapped science' 
+        tooltip_sci_reduced ="""Reduced mapped science."""
+        self.sci_reduced.plot(self.subplot_sci_reduced, title_sci_reduced, 
+                               tooltip_sci_reduced)
+
+        
+      else :
+        #Data not found info
+        self.subtext_nodata.set_axis_off()
+        self.text_nodata = 'Science data not found in the products (PRO.CATG=)' 
+        self.subtext_nodata.text(0.1, 0.6, self.text_nodata, color='#11557c', fontsize=18,
+                                 ha='left', va='center', alpha=1.0)
+        self.subtext_nodata.tooltip='Science data not found in the products'
+ 
+  
+    # This function specifies which are the parameters that should be presented
+    # in the window to be edited.
+    # Note that the parameter has to be also in the in_sop port (otherwise it 
+    # won't appear in the window) 
+    # The descriptions are used to show a tooltip. They should match one to one
+    # with the parameter list 
+    # Note also that parameters have to be prefixed by the 'recipe name:'
+    def setInteractiveParameters(self):
+      paramList = list()
+      paramList.append(reflex.RecipeParameter('fors_science','skyglobal',group='Sky subtraction',description='Subtract global sky spectrum from CCD'))
+      paramList.append(reflex.RecipeParameter('fors_science','skymedian',group='Sky subtraction',description='Sky subtraction from extracted slit spectra'))
+      paramList.append(reflex.RecipeParameter('fors_science','skylocal',group='Sky subtraction',description='Sky subtraction from CCD slit spectra'))
+      paramList.append(reflex.RecipeParameter('fors_science','cosmics',group='Sky subtraction',description='Eliminate cosmic rays hits (only if global sky subtraction is also requested)'))
+      paramList.append(reflex.RecipeParameter('fors_science','slit_margin',group='Spectra extraction',description='Number of pixels to exclude at each slit in object detection and extraction.'))
+      paramList.append(reflex.RecipeParameter('fors_science','ext_radius',group='Spectra extraction',description='Maximum extraction radius for detected objects (pixel)'))
+      paramList.append(reflex.RecipeParameter('fors_science','cont_radius',group='Spectra extraction',description='Minimum distance at which two objects of equal luminosity do not contaminate each other (pixel)'))
+      paramList.append(reflex.RecipeParameter('fors_science','ext_mode',group='Spectra extraction',description='Object extraction method: 0 = aperture, 1 = Horne optimal extraction'))
+      paramList.append(reflex.RecipeParameter('fors_science','skyalign',group='Wave calib',description='Polynomial order for sky lines alignment, or -1 to avoid alignment'))
+
+
+      return paramList
+
+    def setWindowHelp(self):
+      help_text = """
+In this window, the user ..."""
+      return help_text
+
+    def setWindowTitle(self):
+      title = 'Fors Interactive Science Reduction'
+      return title
+
+except ImportError:
+  import_sucess = 'false'
+  print "Error importing modules pyfits, wx, matplotlib, numpy"
+
+#This is the 'main' function
+if __name__ == '__main__':
+
+  # import reflex modules
+  import reflex_interactive_app
+  import sys
+
+  # import UVES reflex modules
+  from fors_plot_common import *
+
+  # Create interactive application
+  interactive_app = reflex_interactive_app.PipelineInteractiveApp()
+
+  #Check if import failed or not
+  if import_sucess == 'false' :
+    interactive_app.setEnableGUI('false')
+
+  #Open the interactive window if enabled
+  if interactive_app.isGUIEnabled() :
+    #Get the specific functions for this window
+    dataPlotManager = DataPlotterManager()
+    interactive_app.setPlotManager(dataPlotManager)
+    interactive_app.showGUI()
+  else :
+    interactive_app.passProductsThrough()
+
+  # print outputs
+  interactive_app.print_outputs()
+
+  sys.exit()
diff --git a/setup b/setup
index de9f8d6..a280775 100755
--- a/setup
+++ b/setup
@@ -17,9 +17,9 @@
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 # $Author: cizzo $
-# $Date: 2007/07/03 13:38:31 $
+# $Date: 2007-07-03 13:38:31 $
 # $Revision: 1.1.1.1 $
-# $Name: fors-4_9_23 $
+# $Name: not supported by cvs2svn $
 
 
 #   This script is the autoinstaller for the VLT instrument pipeline
diff --git a/sextractor/Makefile.in b/sextractor/Makefile.in
index da16f31..8555e9a 100644
--- a/sextractor/Makefile.in
+++ b/sextractor/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -13,15 +13,29 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -37,45 +51,89 @@ subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
 	$(srcdir)/sextractor-tpx.spec.in $(srcdir)/sextractor.spec.in \
-	$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL \
-	THANKS autoconf/depcomp autoconf/install-sh autoconf/missing
+	$(top_srcdir)/autoconf/install-sh \
+	$(top_srcdir)/autoconf/missing $(top_srcdir)/configure AUTHORS \
+	COPYING ChangeLog INSTALL THANKS autoconf/install-sh \
+	autoconf/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acx_prog_cc_optim.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
+ configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES = sextractor.spec sextractor-tpx.spec
+CONFIG_CLEAN_VPATH_FILES =
 depcomp =
 am__depfiles_maybe =
 SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
-	install-exec-recursive install-info-recursive \
-	install-recursive installcheck-recursive installdirs-recursive \
-	pdf-recursive ps-recursive uninstall-info-recursive \
-	uninstall-recursive
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	cscope distdir dist dist-all distcheck
 ETAGS = etags
 CTAGS = ctags
+CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d $(distdir) \
-    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr $(distdir); }; }
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -96,6 +154,8 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -105,6 +165,7 @@ LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGER = @PACKAGER@
@@ -112,6 +173,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
@@ -119,11 +181,11 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -131,24 +193,36 @@ am__tar = @am__tar@
 am__untar = @am__untar@
 bindir = @bindir@
 build_alias = @build_alias@
+builddir = @builddir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host_alias = @host_alias@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 
 # Main Makefile for SExtractor
 # Copyright (C) 2002-2005 Emmanuel Bertin.
@@ -164,21 +238,21 @@ all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-am--refresh:
+am--refresh: Makefile
 	@:
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
-	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
 		&& exit 0; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -194,21 +268,20 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC
 	$(SHELL) ./config.status --recheck
 
 $(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(srcdir) && $(AUTOCONF)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then \
-	  rm -f stamp-h1; \
-	  $(MAKE) stamp-h1; \
-	else :; fi
+	@if test ! -f $@; then rm -f stamp-h1; else :; fi
+	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
 	cd $(top_builddir) && $(SHELL) ./config.status config.h
 $(srcdir)/config.h.in:  $(am__configure_deps) 
-	cd $(top_srcdir) && $(AUTOHEADER)
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
 	rm -f stamp-h1
 	touch $@
 
@@ -218,16 +291,15 @@ sextractor.spec: $(top_builddir)/config.status $(srcdir)/sextractor.spec.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 sextractor-tpx.spec: $(top_builddir)/config.status $(srcdir)/sextractor-tpx.spec.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
-uninstall-info-am:
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@failcom='exit 1'; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
 	  case $$f in \
 	    *=* | --[!k]*);; \
@@ -236,7 +308,11 @@ $(RECURSIVE_TARGETS):
 	done; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -244,51 +320,23 @@ $(RECURSIVE_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-	@failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
 	done
 ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -296,14 +344,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
@@ -315,117 +363,167 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test ! -f $$subdir/TAGS || \
-	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscope: cscope.files
+	test ! -s cscope.files \
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+
+clean-cscope:
+	-rm -f cscope.files
+
+cscope.files: clean-cscope cscopelist-recursive cscopelist
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
-	mkdir $(distdir)
-	$(mkdir_p) $(distdir)/. $(distdir)/autoconf $(distdir)/man
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	test -d "$(distdir)" || mkdir "$(distdir)"
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(mkdir_p) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	    distdir=`$(am__cd) $(distdir) && pwd`; \
-	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
-	    (cd $$subdir && \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
 	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$top_distdir" \
-	        distdir="$$distdir/$$subdir" \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
 	        distdir) \
 	      || exit 1; \
 	  fi; \
 	done
-	-find $(distdir) -type d ! -perm -755 -exec chmod a+rwx,go+rx {} \; -o \
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -755 \
+		-exec chmod u+rwx,go+rx {} \; -o \
 	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
 	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
-	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
-	|| chmod -R a+r $(distdir)
+	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
-	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
-	$(am__remove_distdir)
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__post_remove_distdir)
+
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	$(am__post_remove_distdir)
+
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-shar: distdir
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-zip: distdir
 	-rm -f $(distdir).zip
 	zip -rq $(distdir).zip $(distdir)
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
-dist dist-all: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+dist dist-all:
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+	$(am__post_remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
@@ -433,24 +531,31 @@ dist dist-all: distdir
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
-	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	chmod -R a-w $(distdir); chmod u+w $(distdir)
 	mkdir $(distdir)/_build
 	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-	  && cd $(distdir)/_build \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -471,14 +576,24 @@ distcheck: dist
 	  && rm -rf "$$dc_destdir" \
 	  && $(MAKE) $(AM_MAKEFLAGS) dist \
 	  && rm -rf $(DIST_ARCHIVES) \
-	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
-	$(am__remove_distdir)
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
+	$(am__post_remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
-	  sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@cd $(distuninstallcheck_dir) \
-	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
 	          echo "  (check DESTDIR support)"; \
@@ -509,16 +624,22 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -538,18 +659,38 @@ dvi-am:
 
 html: html-recursive
 
+html-am:
+
 info: info-recursive
 
 info-am:
 
 install-data-am:
 
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-recursive
+
+install-html-am:
+
 install-info: install-info-recursive
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -570,24 +711,27 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-info-am
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
-	check-am clean clean-generic clean-recursive ctags \
-	ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
-	dist-tarZ dist-zip distcheck distclean distclean-generic \
-	distclean-hdr distclean-recursive distclean-tags \
-	distcleancheck distdir distuninstallcheck dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic maintainer-clean-recursive \
-	mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
-	pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
-	uninstall-info-am
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-cscope \
+	clean-generic cscope cscopelist cscopelist-recursive ctags \
+	ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzip \
+	dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
+	distclean-generic distclean-hdr distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+	pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
 
 rpm:	dist
 	cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
@@ -607,6 +751,7 @@ rpm-athlon:	dist
 
 debug:
 	$(MAKE) CFLAGS="-O3 -funroll-loops -fomit-frame-pointer -Wall -m32 -g"
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/sextractor/aclocal.m4 b/sextractor/aclocal.m4
index cd8ff8a..4cefd89 100644
--- a/sextractor/aclocal.m4
+++ b/sextractor/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
+
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -11,36 +11,65 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 8
+
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
 # generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.12'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.12.2], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
 
 # AM_SET_CURRENT_AUTOMAKE_VERSION
 # -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-	 [AM_AUTOMAKE_VERSION([1.9.6])])
+[AM_AUTOMAKE_VERSION([1.12.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 2
+
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
 #
 # Of course, Automake must honor this variable whenever it calls a
 # tool from the auxiliary directory.  The problem is that $srcdir (and
@@ -59,7 +88,7 @@ AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
 #
 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
 # are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
+# harmless because $srcdir is '.', but things will broke when you
 # start a VPATH build or use an absolute $srcdir.
 #
 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -83,49 +112,28 @@ AC_PREREQ([2.50])dnl
 am_aux_dir=`cd $ac_aux_dir && pwd`
 ])
 
-
-# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# This was merged into AC_PROG_CC in Autoconf.
-
-AU_DEFUN([AM_PROG_CC_STDC],
-[AC_PROG_CC
-AC_DIAGNOSE([obsolete], [$0:
-	your code should no longer depend upon `am_cv_prog_cc_stdc', but upon
-	`ac_cv_prog_cc_stdc'.  Remove this warning and the assignment when
-	you adjust the code.  You can also remove the above call to
-	AC_PROG_CC if you already called it elsewhere.])
-am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
-])
-AU_DEFUN([fp_PROG_CC_STDC])
-
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
+# serial 10
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
 AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
 if $2; then
   $1_TRUE=
   $1_FALSE='#'
@@ -139,17 +147,15 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
+# serial 17
 
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
 # will think it sees a *use*, and therefore will trigger all it's
 # C support machinery.  Also note that it means that autoscan, seeing
@@ -159,7 +165,7 @@ fi])])
 # _AM_DEPENDENCIES(NAME)
 # ----------------------
 # See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
 # We try a few techniques and use that to set a single cache variable.
 #
 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -172,11 +178,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 AC_REQUIRE([AM_DEP_TRACK])dnl
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
 
 AC_CACHE_CHECK([dependency style of $depcc],
                [am_cv_$1_dependencies_compiler_type],
@@ -184,8 +192,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -203,6 +212,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
   fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -214,34 +233,49 @@ AC_CACHE_CHECK([dependency style of $depcc],
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -274,7 +308,7 @@ AM_CONDITIONAL([am__fastdep$1], [
 # AM_SET_DEPDIR
 # -------------
 # Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
 AC_DEFUN([AM_SET_DEPDIR],
 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -284,69 +318,86 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 # AM_DEP_TRACK
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 3
+# serial 6
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
 
@@ -355,7 +406,7 @@ done
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
 # This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
+# is enabled.  FIXME.  This creates each '.P' file that we will
 # need in order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
@@ -365,14 +416,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 12
+# serial 19
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
@@ -389,16 +439,20 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
+[AC_PREREQ([2.62])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
 AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
 fi
 
 # test whether we have cygpath
@@ -414,48 +468,85 @@ AC_SUBST([CYGPATH_W])
 # Define the identity of the package.
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+[AC_DIAGNOSE([obsolete],
+[$0: two- and three-arguments forms are deprecated.  For more info, see:
+http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
 [_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
 _AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
 
 # Some tools Automake needs.
 AC_REQUIRE([AM_SANITY_CHECK])dnl
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-	      		     [_AM_PROG_TAR([v7])])])
+	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+			     [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-                  [_AM_DEPENDENCIES(CC)],
-                  [define([AC_PROG_CC],
-                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+		  [_AM_DEPENDENCIES([CC])],
+		  [m4_define([AC_PROG_CC],
+			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                  [_AM_DEPENDENCIES(CXX)],
-                  [define([AC_PROG_CXX],
-                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+		  [_AM_DEPENDENCIES([CXX])],
+		  [m4_define([AC_PROG_CXX],
+			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+		  [_AM_DEPENDENCIES([OBJC])],
+		  [m4_define([AC_PROG_OBJC],
+			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+dnl Support for Objective C++ was only introduced in Autoconf 2.65,
+dnl but we still cater to Autoconf 2.62.
+m4_ifdef([AC_PROG_OBJCXX],
+[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+		  [_AM_DEPENDENCIES([OBJCXX])],
+		  [m4_define([AC_PROG_OBJCXX],
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
 ])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
 
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
@@ -466,32 +557,42 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
 # our stamp files there.
 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
 [# Compute $1's index in $config_headers.
+_am_arg=$1
 _am_stamp_count=1
 for _am_header in $config_headers :; do
   case $_am_header in
-    $1 | $1:* )
+    $_am_arg | $_am_arg:* )
       break ;;
     * )
       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
   esac
 done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 8
+
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST([install_sh])])
 
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -514,13 +615,13 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
+# serial 5
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -529,7 +630,7 @@ AC_DEFUN([AM_MAKE_INCLUDE],
 [am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
@@ -539,24 +640,24 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 AC_SUBST([am__include])
 AC_SUBST([am__quote])
@@ -566,14 +667,13 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 7
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -589,88 +689,33 @@ AC_SUBST($1)])
 # If it does, set am_missing_run to use it, otherwise, to nothing.
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+  AC_MSG_WARN(['missing' script is too old or missing])
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake.  There are at least two reasons why we must not
-# use `-m 0755':
-#   - it causes special bits like SGID to be ignored,
-#   - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out.  Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
-AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However this is wrong
-  # for two reasons:
-  #  1. if the package is installed by a user who cannot write `.'
-  #     make install will fail,
-  #  2. the above comment should most certainly read
-  #     $(mkdir_p) $(DESTDIR)$(somedir)
-  #     so it does not work when $(somedir) is undefined and
-  #     $(DESTDIR) is not.
-  #  To support the latter case, we have to write
-  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
-  #  so the `.' trick is pointless.
-  mkdir_p='mkdir -p --'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
-  else
-    mkdir_p='$(install_sh) -d'
-  fi
-fi
-AC_SUBST([mkdir_p])])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
+# serial 6
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -678,16 +723,16 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
 # -------------------------------------------
@@ -697,45 +742,62 @@ AC_DEFUN([_AM_IF_OPTION],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 9
 
 # AM_SANITY_CHECK
 # ---------------
 AC_DEFUN([AM_SANITY_CHECK],
 [AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$[*]" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
+	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment])
+     fi
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$[2]" = conftest.file
    )
 then
@@ -745,50 +807,87 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 2
+
 # AM_PROG_INSTALL_STRIP
 # ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# One issue with vendor 'install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
 # is unlikely to handle the host's binaries.
 # Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
+# always use install-sh in "make install-strip", and initialize
 # STRIPPROG with the value of the STRIP variable (set by the user).
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
 if test "$cross_compiling" != no; then
   AC_CHECK_TOOL([STRIP], [strip], :)
 fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
+# Copyright (C) 2006-2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
+# serial 3
 
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
 #
 # Substitute a variable $(am__tar) that is a command
 # writing to stdout a FORMAT-tarball containing the directory
@@ -799,10 +898,11 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
 m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
      [m4_case([$1], [ustar],, [pax],,
               [m4_fatal([Unknown tar format])])
 AC_MSG_CHECKING([how to create a $1 tar archive])
@@ -810,7 +910,7 @@ AC_MSG_CHECKING([how to create a $1 tar archive])
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
 # Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
+# Solaris sh will not grok spaces in the rhs of '-'.
 for _am_tool in $_am_tools
 do
   case $_am_tool in
diff --git a/sextractor/autoconf/depcomp b/sextractor/autoconf/depcomp
index 04701da..debb6ff 100755
--- a/sextractor/autoconf/depcomp
+++ b/sextractor/autoconf/depcomp
@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2005-07-09.11
+scriptversion=2012-03-27.16; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,9 +16,7 @@ scriptversion=2005-07-09.11
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -29,7 +27,7 @@ scriptversion=2005-07-09.11
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
@@ -41,11 +39,11 @@ as side-effects.
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake at gnu.org>.
@@ -58,6 +56,12 @@ EOF
     ;;
 esac
 
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -86,12 +90,48 @@ if test "$depmode" = dashXmstdout; then
    depmode=dashmstdout
 fi
 
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u='sed s,\\\\,/,g'
+   depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+   # This is just like msvc7 but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u='sed s,\\\\,/,g'
+   depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
+   gccflag=-qmakedep=gcc,-MF
+   depmode=gcc
+fi
+
 case "$depmode" in
 gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
 ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
 ## it if -MD -MP comes after the -MF stuff.  Hmm.
-  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
   stat=$?
   if test $stat -eq 0; then :
   else
@@ -127,20 +167,21 @@ gcc)
 ## The second -e expression handles DOS-style file names with drive letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+  tr ' ' "$nl" < "$tmpdepfile" |
+## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+      | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -172,20 +213,17 @@ sgi)
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> $depfile
-    echo >> $depfile
+    tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
 
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> $depfile
+   >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -195,40 +233,51 @@ sgi)
   rm -f "$tmpdepfile"
   ;;
 
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
-  tmpdepfile="$stripped.u"
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
   if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
     "$@" -Wc,-M
   else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
     "$@" -M
   fi
   stat=$?
 
-  if test -f "$tmpdepfile"; then :
-  else
-    stripped=`echo "$stripped" | sed 's,^.*/,,'`
-    tmpdepfile="$stripped.u"
-  fi
-
   if test $stat -eq 0; then :
   else
-    rm -f "$tmpdepfile"
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
 
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
   if test -f "$tmpdepfile"; then
-    outname="$stripped.o"
-    # Each line is of the form `foo.o: dependent.h'.
+    # Each line is of the form 'foo.o: dependent.h'.
     # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
-    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+    # '$object: dependent.h' and one to simply 'dependent.h:'.
+    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -239,23 +288,26 @@ aix)
   ;;
 
 icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
+  # However on
+  #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
   # ICC 7.0 will fill foo.d with something like
   #    foo.o: sub/foo.c
   #    foo.o: sub/foo.h
-  # which is wrong.  We want:
+  # which is wrong.  We want
   #    sub/foo.o: sub/foo.c
   #    sub/foo.o: sub/foo.h
   #    sub/foo.c:
   #    sub/foo.h:
   # ICC 7.1 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using \ :
+  # and will wrap long lines using '\':
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
-
+  # tcc 0.9.26 (FIXME still under development at the moment of writing)
+  # will emit a similar output, but also prepend the continuation lines
+  # with horizontal tabulation characters.
   "$@" -MD -MF "$tmpdepfile"
   stat=$?
   if test $stat -eq 0; then :
@@ -264,23 +316,74 @@ icc)
     exit $stat
   fi
   rm -f "$depfile"
-  # Each line is of the form `foo.o: dependent.h',
-  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Each line is of the form 'foo.o: dependent.h',
+  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
   # Do two passes, one to just change these to
-  # `$object: dependent.h' and one to simply `dependent.h:'.
-  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
-  # Some versions of the HPUX 10.20 sed can't process this invocation
-  # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  # '$object: dependent.h' and one to simply 'dependent.h:'.
+  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
+    < "$tmpdepfile" > "$depfile"
+  sed '
+    s/[ '"$tab"'][ '"$tab"']*/ /g
+    s/^ *//
+    s/ *\\*$//
+    s/^[^:]*: *//
+    /^$/d
+    /:$/d
+    s/$/ :/
+  ' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
+    sed -ne '2,${
+	       s/^ *//
+	       s/ \\*$//
+	       s/$/:/
+	       p
+	     }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
 tru64)
    # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
    # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
+   # dependencies in 'foo.d' instead, so we check for that too.
    # Subdirectories are respected.
    dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    test "x$dir" = "x$object" && dir=
@@ -288,13 +391,13 @@ tru64)
 
    if test "$libtool" = yes; then
       # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mecanism is used in libtool 1.4 series to
+      # static library.  This mechanism is used in libtool 1.4 series to
       # handle both shared and static libraries in a single compilation.
       # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
       #
       # With libtool 1.5 this exception was removed, and libtool now
       # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # compilations output dependencies in $dir.libs/$base.o.d and
       # in $dir$base.o.d.  We have to check for both files, because
       # one of the two compilations can be disabled.  We should prefer
       # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
@@ -326,14 +429,59 @@ tru64)
    done
    if test -f "$tmpdepfile"; then
       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    else
       echo "#dummy" > "$depfile"
    fi
    rm -f "$tmpdepfile"
    ;;
 
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test "$stat" = 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
   # dependency tracking mechanisms from slower ones.
@@ -345,13 +493,13 @@ dashmstdout)
 
   # Remove the call to Libtool.
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -371,15 +519,14 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
+  tr ' ' "$nl" < "$tmpdepfile" | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -396,38 +543,46 @@ makedepend)
   "$@" || exit $?
   # Remove any Libtool call
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
   fi
   # X makedepend
   shift
-  cleared=no
-  for arg in "$@"; do
+  cleared=no eat=no
+  for arg
+  do
     case $cleared in
     no)
       set ""; shift
       cleared=yes ;;
     esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
     case "$arg" in
     -D*|-I*)
       set fnord "$@" "$arg"; shift ;;
     # Strip any option that makedepend may not understand.  Remove
     # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
     -*|$object)
       ;;
     *)
       set fnord "$@" "$arg"; shift ;;
     esac
   done
-  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -441,13 +596,13 @@ cpp)
 
   # Remove the call to Libtool.
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -479,13 +634,27 @@ cpp)
 
 msvisualcpp)
   # Important note: in order to support this mode, a compiler *must*
-  # always write the preprocessed file to stdout, regardless of -o,
-  # because we must use -o when running libtool.
+  # always write the preprocessed file to stdout.
   "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
   IFS=" "
   for arg
   do
     case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
 	set fnord "$@"
 	shift
@@ -498,16 +667,23 @@ msvisualcpp)
 	;;
     esac
   done
-  "$@" -E |
-  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
-  echo "	" >> "$depfile"
-  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
+msvcmsys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 none)
   exec "$@"
   ;;
@@ -526,5 +702,6 @@ exit 0
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/sextractor/autoconf/install-sh b/sextractor/autoconf/install-sh
index 4d4a951..377bb86 100755
--- a/sextractor/autoconf/install-sh
+++ b/sextractor/autoconf/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2005-05-14.22
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,42 +35,72 @@ scriptversion=2005-05-14.22
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
 
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
 
-# put in absolute paths if you don't have them in your path; or use env. vars.
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
 
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
 
-chmodcmd="$chmodprog 0755"
-chowncmd=
 chgrpcmd=
-stripcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
 rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
 src=
 dst=
 dir_arg=
-dstarg=
+dst_arg=
+
+copy_on_change=false
 no_target_directory=
 
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
    or: $0 [OPTION]... -t DIRECTORY SRCFILES...
    or: $0 [OPTION]... -d DIRECTORIES...
@@ -80,108 +110,148 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
 In the 4th, create DIRECTORIES.
 
 Options:
--c         (ignored)
--d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
---help     display this help and exit.
---version  display version info and exit.
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
 
 Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
 "
 
-while test -n "$1"; do
+while test $# -ne 0; do
   case $1 in
-    -c) shift
-        continue;;
+    -c) ;;
+
+    -C) copy_on_change=true;;
 
-    -d) dir_arg=true
-        shift
-        continue;;
+    -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
     --help) echo "$usage"; exit $?;;
 
-    -m) chmodcmd="$chmodprog $2"
-        shift
-        shift
-        continue;;
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
 
     -o) chowncmd="$chownprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
-    -s) stripcmd=$stripprog
-        shift
-        continue;;
+    -s) stripcmd=$stripprog;;
 
-    -t) dstarg=$2
-	shift
-	shift
-	continue;;
+    -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
+	shift;;
 
-    -T) no_target_directory=true
-	shift
-	continue;;
+    -T) no_target_directory=true;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    *)  # When -d is used, all remaining arguments are directories to create.
-	# When -t is used, the destination is already specified.
-	test -n "$dir_arg$dstarg" && break
-        # Otherwise, the last argument is the destination.  Remove it from $@.
-	for arg
-	do
-          if test -n "$dstarg"; then
-	    # $@ is not empty: it contains at least $arg.
-	    set fnord "$@" "$dstarg"
-	    shift # fnord
-	  fi
-	  shift # arg
-	  dstarg=$arg
-	done
+    --)	shift
 	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
   esac
+  shift
 done
 
-if test -z "$1"; then
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  done
+fi
+
+if test $# -eq 0; then
   if test -z "$dir_arg"; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src ;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
     dst=$src
-    src=
-
-    if test -d "$dst"; then
-      mkdircmd=:
-      chmodcmd=
-    else
-      mkdircmd=$mkdirprog
-    fi
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
   else
+
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
     # might cause directories to be created, which would be especially bad
     # if $src (and thus $dsttmp) contains '*'.
@@ -190,71 +260,194 @@ do
       exit 1
     fi
 
-    if test -z "$dstarg"; then
+    if test -z "$dst_arg"; then
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
-    dst=$dstarg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst ;;
-    esac
+    dst=$dst_arg
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
       if test -n "$no_target_directory"; then
-	echo "$0: $dstarg: Is a directory" >&2
+	echo "$0: $dst_arg: Is a directory" >&2
 	exit 1
       fi
-      dst=$dst/`basename "$src"`
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
     fi
   fi
 
-  # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
 
-  # Make sure that the destination directory exists.
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
 
-  # Skip lots of stat calls in the usual case.
-  if test ! -d "$dstdir"; then
-    defaultIFS='
-	 '
-    IFS="${IFS-$defaultIFS}"
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
 
-    oIFS=$IFS
-    # Some sh's can't handle IFS=/ for some reason.
-    IFS='%'
-    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-    shift
-    IFS=$oIFS
+      case $dstdir in
+	/*) prefix='/';;
+	[-=\(\)!]*) prefix='./';;
+	*)  prefix='';;
+      esac
 
-    pathcomp=
+      eval "$initialize_posix_glob"
 
-    while test $# -ne 0 ; do
-      pathcomp=$pathcomp$1
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
       shift
-      if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp"
-	# mkdir can fail with a `File exist' error in case several
-	# install-sh are creating the directory concurrently.  This
-	# is OK.
-	test -d "$pathcomp" || exit
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test X"$d" = X && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
       fi
-      pathcomp=$pathcomp/
-    done
+    fi
   fi
 
   if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
-      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
   else
-    dstfile=`basename "$dst"`
 
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
@@ -262,10 +455,9 @@ do
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-    trap '(exit $?); exit' 1 2 13 15
 
     # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -273,51 +465,63 @@ do
     # ignore errors from any of these, just make sure not to ignore
     # errors from the above "$doit $cpprog $src $dsttmp" command.
     #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
-    # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
-      || {
-	   # The rename failed, perhaps because mv can't rename something else
-	   # to itself, or perhaps because mv is so ancient that it does not
-	   # support -f.
-
-	   # Now remove or move aside any old file at destination location.
-	   # We try this two ways since rm can't unlink itself on some
-	   # systems and the destination file might be busy for other
-	   # reasons.  In this case, the final cleanup might fail but the new
-	   # file should still install successfully.
-	   {
-	     if test -f "$dstdir/$dstfile"; then
-	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
-	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
-	       || {
-		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-		 (exit 1); exit 1
-	       }
-	     else
-	       :
-	     fi
-	   } &&
-
-	   # Now rename the file to the real destination.
-	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-	 }
-    }
-  fi || { (exit 1); exit 1; }
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
 done
 
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
-  (exit 0); exit 0
-}
-
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/sextractor/autoconf/missing b/sextractor/autoconf/missing
index 894e786..9a55648 100755
--- a/sextractor/autoconf/missing
+++ b/sextractor/autoconf/missing
@@ -1,10 +1,9 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2005-06-08.21
+scriptversion=2012-01-06.18; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
-#   Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -18,9 +17,7 @@ scriptversion=2005-06-08.21
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -28,13 +25,15 @@ scriptversion=2005-06-08.21
 # the same distribution terms that you use for the rest of that program.
 
 if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
+  echo 1>&2 "Try '$0 --help' for more information"
   exit 1
 fi
 
 run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
 
-# In the cases where this matters, `missing' is being run in the
+# In the cases where this matters, 'missing' is being run in the
 # srcdir already.
 if test -f configure.ac; then
   configure_ac=configure.ac
@@ -44,7 +43,7 @@ fi
 
 msg="missing on your system"
 
-case "$1" in
+case $1 in
 --run)
   # Try to run requested program, and just exit if it succeeds.
   run=
@@ -65,7 +64,7 @@ case "$1" in
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
 
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
 error status if there is no known handling for PROGRAM.
 
 Options:
@@ -74,17 +73,20 @@ Options:
   --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
+  aclocal      touch file 'aclocal.m4'
+  autoconf     touch file 'configure'
+  autoheader   touch file 'config.h.in'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all 'Makefile.in' files
+  bison        create 'y.tab.[ch]', if possible, from existing .[ch]
+  flex         create 'lex.yy.c', if possible, from existing .c
   help2man     touch the output file
-  lex          create \`lex.yy.c', if possible, from existing .c
+  lex          create 'lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+  yacc         create 'y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
 
 Send bug reports to <bug-automake at gnu.org>."
     exit $?
@@ -96,37 +98,35 @@ Send bug reports to <bug-automake at gnu.org>."
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
+    echo 1>&2 "$0: Unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
 esac
 
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
 # Now exit if we have it, but it failed.  Also exit now if we
 # don't have it and --version was passed (most likely to detect
-# the program).
-case "$1" in
-  lex|yacc)
+# the program).  This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+  lex*|yacc*)
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
   *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
        exit 1
     elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
        # Could not run --version or --help.  This is probably someone
-       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # running '$TOOL --version' or '$TOOL --help' to check whether
        # $TOOL exists and not knowing $TOOL uses missing.
        exit 1
     fi
@@ -135,36 +135,36 @@ esac
 
 # If it does not exist, or fails to run (possibly an outdated version),
 # try to emulate it.
-case "$1" in
+case $program in
   aclocal*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'acinclude.m4' or '${configure_ac}'.  You might want
+         to install the Automake and Perl packages.  Grab them from
          any GNU archive site."
     touch aclocal.m4
     ;;
 
-  autoconf)
+  autoconf*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`${configure_ac}'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+WARNING: '$1' is $msg.  You should only need it if
+         you modified '${configure_ac}'.  You might want to install the
+         Autoconf and GNU m4 packages.  Grab them from any GNU
          archive site."
     touch configure
     ;;
 
-  autoheader)
+  autoheader*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'acconfig.h' or '${configure_ac}'.  You might want
+         to install the Autoconf and GNU m4 packages.  Grab them
          from any GNU archive site."
     files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
     test -z "$files" && files="config.h"
     touch_files=
     for f in $files; do
-      case "$f" in
+      case $f in
       *:*) touch_files="$touch_files "`echo "$f" |
 				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
       *) touch_files="$touch_files $f.in";;
@@ -175,25 +175,25 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   automake*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
-         You might want to install the \`Automake' and \`Perl' packages.
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
+         You might want to install the Automake and Perl packages.
          Grab them from any GNU archive site."
     find . -type f -name Makefile.am -print |
 	   sed 's/\.am$/.in/' |
 	   while read f; do touch "$f"; done
     ;;
 
-  autom4te)
+  autom4te*)
     echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
+WARNING: '$1' is needed, but is $msg.
          You might have modified some files without having the
          proper tools for further handling them.
-         You can get \`$1' as part of \`Autoconf' from any GNU
+         You can get '$1' as part of Autoconf from any GNU
          archive site."
 
-    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
-    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
     if test -f "$file"; then
 	touch $file
     else
@@ -207,93 +207,97 @@ WARNING: \`$1' is needed, but is $msg.
     fi
     ;;
 
-  bison|yacc)
+  bison*|yacc*)
     echo 1>&2 "\
-WARNING: \`$1' $msg.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
+WARNING: '$1' $msg.  You should only need it if
+         you modified a '.y' file.  You may need the Bison package
          in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
+         Bison from any GNU archive site."
     rm -f y.tab.c y.tab.h
-    if [ $# -ne 1 ]; then
-        eval LASTARG="\${$#}"
-	case "$LASTARG" in
+    if test $# -ne 1; then
+        eval LASTARG=\${$#}
+	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" y.tab.c
 	    fi
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" y.tab.h
 	    fi
 	  ;;
 	esac
     fi
-    if [ ! -f y.tab.h ]; then
+    if test ! -f y.tab.h; then
 	echo >y.tab.h
     fi
-    if [ ! -f y.tab.c ]; then
+    if test ! -f y.tab.c; then
 	echo 'main() { return 0; }' >y.tab.c
     fi
     ;;
 
-  lex|flex)
+  lex*|flex*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
+WARNING: '$1' is $msg.  You should only need it if
+         you modified a '.l' file.  You may need the Flex package
          in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
+         Flex from any GNU archive site."
     rm -f lex.yy.c
-    if [ $# -ne 1 ]; then
-        eval LASTARG="\${$#}"
-	case "$LASTARG" in
+    if test $# -ne 1; then
+        eval LASTARG=\${$#}
+	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" lex.yy.c
 	    fi
 	  ;;
 	esac
     fi
-    if [ ! -f lex.yy.c ]; then
+    if test ! -f lex.yy.c; then
 	echo 'main() { return 0; }' >lex.yy.c
     fi
     ;;
 
-  help2man)
+  help2man*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
+WARNING: '$1' is $msg.  You should only need it if
 	 you modified a dependency of a manual page.  You may need the
-	 \`Help2man' package in order for those modifications to take
-	 effect.  You can get \`Help2man' from any GNU archive site."
+	 Help2man package in order for those modifications to take
+	 effect.  You can get Help2man from any GNU archive site."
 
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
-    if test -z "$file"; then
-	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
-    fi
-    if [ -f "$file" ]; then
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
 	touch $file
     else
 	test -z "$file" || exec >$file
 	echo ".ab help2man is required to generate this page"
-	exit 1
+	exit $?
     fi
     ;;
 
-  makeinfo)
+  makeinfo*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
+WARNING: '$1' is $msg.  You should only need it if
+         you modified a '.texi' or '.texinfo' file, or any other file
          indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
+         call might also be the consequence of using a buggy 'make' (AIX,
+         DU, IRIX).  You might want to install the Texinfo package or
+         the GNU make package.  Grab either from any GNU archive site."
     # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
     if test -z "$file"; then
       # ... or it is the one specified with @setfilename ...
       infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      file=`sed -n '
+	/^@setfilename/{
+	  s/.* \([^ ]*\) *$/\1/
+	  p
+	  q
+	}' $infile`
       # ... or it is derived from the source name (dir/f.texi becomes f.info)
       test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
     fi
@@ -303,49 +307,14 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch $file
     ;;
 
-  tar)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case "$firstarg" in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case "$firstarg" in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
   *)
     echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
+WARNING: '$1' is needed, and is $msg.
          You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
+         proper tools for further handling them.  Check the 'README' file,
          it often tells you about the needed prerequisites for installing
          this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
+         some other package would contain this missing '$1' program."
     exit 1
     ;;
 esac
@@ -356,5 +325,6 @@ exit 0
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/sextractor/config.h.in b/sextractor/config.h.in
index 7395a9b..a169377 100644
--- a/sextractor/config.h.in
+++ b/sextractor/config.h.in
@@ -80,6 +80,9 @@
 /* Define to 1 if you have the <sys/mman.h> header file. */
 #undef HAVE_SYS_MMAN_H
 
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
@@ -108,6 +111,9 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
@@ -126,6 +132,11 @@
 /* Version number of package */
 #undef VERSION
 
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 
@@ -144,10 +155,10 @@
 /* Define to rpl_malloc if the replacement function should be used. */
 #undef malloc
 
-/* Define to `long' if <sys/types.h> does not define. */
+/* Define to `long int' if <sys/types.h> does not define. */
 #undef off_t
 
-/* Define to `unsigned' if <sys/types.h> does not define. */
+/* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
 
 /* Define to `int' if <sys/types.h> doesn't define. */
diff --git a/sextractor/configure b/sextractor/configure
index 3bab1ba..732cf76 100755
--- a/sextractor/configure
+++ b/sextractor/configure
@@ -1,83 +1,462 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for sextractor 2.5.0.
+# Generated by GNU Autoconf 2.69 for sextractor 2.5.0.
 #
 # Report bugs to <bertin at iap.fr>.
 #
-# Copyright (C) 2003 Free Software Foundation, Inc.
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
   else
-    $as_unset $as_var
+    $as_echo "$0: Please tell bug-autoconf at gnu.org and bertin at iap.fr
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
   fi
-done
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
 
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
 fi
 
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
-# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
-
-# PATH needs CR, and LINENO needs CR and PATH.
 # Avoid depending upon Character Ranges.
 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -85,146 +464,91 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
 
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
 else
-  as_expr=false
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
 fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
     as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
   fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -233,38 +557,25 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
 
 # Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
-exec 6>&1
-
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_clean_files=
 ac_config_libobj_dir=.
+LIBOBJS=
 cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
 
 # Identity of this package.
 PACKAGE_NAME='sextractor'
@@ -272,51 +583,160 @@ PACKAGE_TARNAME='sextractor'
 PACKAGE_VERSION='2.5.0'
 PACKAGE_STRING='sextractor 2.5.0'
 PACKAGE_BUGREPORT='bertin at iap.fr'
+PACKAGE_URL=''
 
 ac_unique_file="src/makeit.c"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
 # include <stdlib.h>
 # include <stddef.h>
 #else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
 #  include <stdlib.h>
 # endif
 #endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
 #  include <memory.h>
 # endif
 # include <string.h>
 #endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
 # include <strings.h>
 #endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
 #endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INS [...]
+ac_header_list=
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+EGREP
+GREP
+CPP
+RANLIB
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+DATE3
+DATE2
+PACKAGER
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_icc
+enable_gprof
+enable_static
+enable_dependency_tracking
+enable_largefile
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
 
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 cache_file=/dev/null
@@ -339,34 +759,49 @@ x_libraries=NONE
 # and all the variables that are supposed to be based on exec_prefix
 # by default will actually change.
 # Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
 
 ac_prev=
+ac_dashdash=
 for ac_option
 do
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
+    eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_option in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -388,33 +823,59 @@ do
   --config-cache | -C)
     cache_file=config.cache ;;
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+  -datadir | --datadir | --datadi | --datad)
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
     datadir=$ac_optarg ;;
 
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
   -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
     esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
+    eval enable_$ac_useropt=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -441,6 +902,12 @@ do
   -host=* | --host=* | --hos=* | --ho=*)
     host_alias=$ac_optarg ;;
 
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
@@ -465,13 +932,16 @@ do
   | --libexe=* | --libex=* | --libe=*)
     libexecdir=$ac_optarg ;;
 
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
   -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
+  | --localstate | --localstat | --localsta | --localst | --locals)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
     localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -536,6 +1006,16 @@ do
   | --progr-tra=* | --program-tr=* | --program-t=*)
     program_transform_name=$ac_optarg ;;
 
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
@@ -586,26 +1066,36 @@ do
     ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
     esac
-    eval "with_$ac_package='$ac_optarg'" ;;
+    eval with_$ac_useropt=\$ac_optarg ;;
 
   -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -625,27 +1115,26 @@ do
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -653,31 +1142,36 @@ done
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
-done
+fi
 
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-	      localstatedir libdir includedir oldincludedir infodir mandir
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
 do
-  eval ac_val=$`echo $ac_var`
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
   case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -691,8 +1185,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -704,74 +1196,72 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
 test "$silent" = yes && exec 6>/dev/null
 
 
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$0" : 'X\(//\)[^/]' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
-   { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
-  fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
-   { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
 
 #
 # Report the --help message.
@@ -794,20 +1284,17 @@ Configuration:
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-_ACEOF
-
-  cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-			  [$ac_default_prefix]
+                          [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-			  [PREFIX]
+                          [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -817,18 +1304,25 @@ for instance \`--prefix=\$HOME'.
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/sextractor]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -847,6 +1341,7 @@ if test -n "$ac_init_help"; then
   cat <<\_ACEOF
 
 Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-icc            Enable special mode for compilation with the Intel
@@ -854,8 +1349,10 @@ Optional Features:
   --enable-gprof          Enable special mode for compilation with the gprof
                           profiler (off by default)
   --enable-static         Enable static linking (off by default)
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
   --disable-largefile     omit support for large files
 
 Some influential environment variables:
@@ -863,8 +1360,9 @@ Some influential environment variables:
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-              headers in a nonstandard directory <include dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
 
 Use these variables to override the choices made by `configure' or to help
@@ -872,159 +1370,537 @@ it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <bertin at iap.fr>.
 _ACEOF
+ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
     ac_builddir=.
 
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-	   test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
     else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd $ac_popdir
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
   done
 fi
 
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 sextractor configure 2.5.0
-generated by GNU Autoconf 2.59
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
-  exit 0
+  exit
 fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
 
-It was created by sextractor $as_me 2.5.0, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
-
-  $ $0 $@
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
 
-_ACEOF
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
 {
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-_ASUNAME
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
 
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
-done
+} # ac_fn_c_try_compile
 
-} >&5
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >&5 <<_ACEOF
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
 
+} # ac_fn_c_try_link
 
-## ----------- ##
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ---------------------------- ##
+## Report this to bertin at iap.fr ##
+## ---------------------------- ##"
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by sextractor $as_me 2.5.0, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
 ## Core tests. ##
 ## ----------- ##
 
@@ -1039,7 +1915,6 @@ _ACEOF
 ac_configure_args=
 ac_configure_args0=
 ac_configure_args1=
-ac_sep=
 ac_must_keep_next=false
 for ac_pass in 1 2
 do
@@ -1050,13 +1925,13 @@ do
     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
     2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      as_fn_append ac_configure_args1 " '$ac_arg'"
       if test $ac_must_keep_next = true; then
 	ac_must_keep_next=false # Got value, back to normal.
       else
@@ -1072,104 +1947,115 @@ do
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
+      as_fn_append ac_configure_args " '$ac_arg'"
       ;;
     esac
   done
 done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
   (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       sed -n \
-	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
     *)
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-}
+    esac |
+    sort
+)
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
-	eval ac_val=$`echo $ac_var`
-	echo "$ac_var='"'"'$ac_val'"'"'"
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
-      sed "/^$/d" confdefs.h | sort
+      cat confdefs.h
       echo
     fi
     test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
-     ' 0
+' 0
 for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
 
 # Predefined preprocessor variables.
 
@@ -1177,96 +2063,124 @@ cat >>confdefs.h <<_ACEOF
 #define PACKAGE_NAME "$PACKAGE_NAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
 
 # Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
 fi
-for ac_site_file in $CONFIG_SITE; do
-  if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
 
+as_fn_append ac_header_list " stdlib.h"
+as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_header_list " sys/param.h"
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-	ac_cache_corrupted=:
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
     esac
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -1276,59 +2190,39 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 ac_aux_dir=
-for ac_dir in autoconf $srcdir/autoconf; do
-  if test -f $ac_dir/install-sh; then
+for ac_dir in autoconf "$srcdir"/autoconf; do
+  if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
     break
-  elif test -f $ac_dir/install.sh; then
+  elif test -f "$ac_dir/install.sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
-  elif test -f $ac_dir/shtool; then
+  elif test -f "$ac_dir/shtool"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/shtool install -c"
     break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in autoconf \"$srcdir\"/autoconf" "$LINENO" 5
 fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
-          ac_config_headers="$ac_config_headers config.h"
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+am__api_version='1.12'
 
-am__api_version="1.9"
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
@@ -1342,22 +2236,23 @@ am__api_version="1.9"
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -1365,7 +2260,7 @@ case $as_dir/ in
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -1375,30 +2270,43 @@ case $as_dir/ in
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
 	  else
-	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	    break 3
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
 	  fi
 	fi
       done
     done
     ;;
 esac
-done
 
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
     INSTALL=$ac_cv_path_install
   else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
+    # removed, or if the value is a relative name.
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -1408,176 +2316,324 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" >&2;}
-   { (exit 1); exit 1; }; }
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+	&& test "$*" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$2" = conftest.file
    )
 then
    # Ok.
    :
 else
-   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
-   { (exit 1); exit 1; }; }
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
-  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
 test "$program_suffix" != NONE &&
-  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
-# Double any \ or $.  echo might interpret backslashes.
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
 # By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
 
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However this is wrong
-  # for two reasons:
-  #  1. if the package is installed by a user who cannot write `.'
-  #     make install will fail,
-  #  2. the above comment should most certainly read
-  #     $(mkdir_p) $(DESTDIR)$(somedir)
-  #     so it does not work when $(somedir) is undefined and
-  #     $(DESTDIR) is not.
-  #  To support the latter case, we have to write
-  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
-  #  so the `.' trick is pointless.
-  mkdir_p='mkdir -p --'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
-  else
-    mkdir_p='$(install_sh) -d'
-  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
-for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   test -n "$AWK" && break
 done
 
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
 all:
-	@echo 'ac_maketemp="$(MAKE)"'
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
 rm -f conftest.make
 fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
   SET_MAKE=
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
@@ -1590,12 +2646,14 @@ else
 fi
 rmdir .tst 2>/dev/null
 
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
-   { (exit 1); exit 1; }; }
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
 fi
 
 # test whether we have cygpath
@@ -1638,103 +2696,19 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  STRIP=$ac_ct_STRIP
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
 
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
@@ -1759,8 +2733,8 @@ DATE3="$date3"
 
 
 # Display pakage and version number
-echo "$as_me:$LINENO: result: *********** Configuring:  $PACKAGE $VERSION ($date) **********" >&5
-echo "${ECHO_T}*********** Configuring:  $PACKAGE $VERSION ($date) **********" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: *********** Configuring:  $PACKAGE $VERSION ($date) **********" >&5
+$as_echo "*********** Configuring:  $PACKAGE $VERSION ($date) **********" >&6; }
 
 # Initialize the list of compilers to consider
 cclist="cc gcc"
@@ -1772,50 +2746,50 @@ myldflags="$LDFLAGS"
 LDFLAGS=""
 
 # Provide special option for the Linux Intel C compiler
-echo "$as_me:$LINENO: checking for Linux Intel C compiler mode" >&5
-echo $ECHO_N "checking for Linux Intel C compiler mode... $ECHO_C" >&6
-# Check whether --enable-icc or --disable-icc was given.
-if test "${enable_icc+set}" = set; then
-  enableval="$enable_icc"
-  use_icc="yes"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux Intel C compiler mode" >&5
+$as_echo_n "checking for Linux Intel C compiler mode... " >&6; }
+# Check whether --enable-icc was given.
+if test "${enable_icc+set}" = set; then :
+  enableval=$enable_icc; use_icc="yes"
         cclist="icc $cclist"
-	echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 else
   use_icc="no"
-	echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi;
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
 
 # Provide special option for gprof profiling
-echo "$as_me:$LINENO: checking for gprof profiler mode" >&5
-echo $ECHO_N "checking for gprof profiler mode... $ECHO_C" >&6
-# Check whether --enable-gprof or --disable-gprof was given.
-if test "${enable_gprof+set}" = set; then
-  enableval="$enable_gprof"
-  use_gprof="yes"
-	echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gprof profiler mode" >&5
+$as_echo_n "checking for gprof profiler mode... " >&6; }
+# Check whether --enable-gprof was given.
+if test "${enable_gprof+set}" = set; then :
+  enableval=$enable_gprof; use_gprof="yes"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 else
   use_gprof="no"
-	echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi;
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
 
 # Enable static linking
-echo "$as_me:$LINENO: checking static linking" >&5
-echo $ECHO_N "checking static linking... $ECHO_C" >&6
-# Check whether --enable-static or --disable-static was given.
-if test "${enable_static+set}" = set; then
-  enableval="$enable_static"
-  use_static="yes"
-	echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking static linking" >&5
+$as_echo_n "checking static linking... " >&6; }
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; use_static="yes"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 else
   use_static="no"
-	echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi;
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
 
 # Checks for programs.
 # GCC is chosen last because it is likely to yield less optimized code
@@ -1829,10 +2803,10 @@ if test -n "$ac_tool_prefix"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1842,26 +2816,28 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
     test -n "$CC" && break
   done
 fi
@@ -1871,10 +2847,10 @@ if test -z "$CC"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -1884,64 +2860,76 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   test -n "$ac_ct_CC" && break
 done
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -1953,112 +2941,108 @@ main ()
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
-	;;
-    conftest.$ac_ext )
-	# This is the source file.
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
 	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
 	# certainly right.
 	break;;
     *.* )
-	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	# FIXME: I believe we export ac_cv_exeext for Libtool,
-	# but it would be cool to find out if it's true.  Does anybody
-	# maintain Libtool? --akim.
-	export ac_cv_exeext
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
 	break;;
     * )
 	break;;
   esac
 done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
 else
-  echo "$as_me: failed program was:" >&5
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-  fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
 
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -2066,38 +3050,90 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  export ac_cv_exeext
 	  break;;
     * ) break;;
   esac
 done
 else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2109,45 +3145,46 @@ main ()
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2161,55 +3198,34 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
+  ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2220,39 +3236,49 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
 
-ac_cv_prog_cc_g=no
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -2268,23 +3294,18 @@ else
     CFLAGS=
   fi
 fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_prog_cc_stdc=no
+  ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -2307,12 +3328,17 @@ static char *f (char * (*g) (char **, int), char **p, ...)
 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    function prototypes and stuff, but not '\xHH' hex character constants.
    These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std1 is added to get
+   as 'x'.  The following induces an error, until -std is added to get
    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std1.  */
+   that's true only with -std.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -2327,205 +3353,37 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   return 0;
 }
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
 fi
-rm -f conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
 CC=$ac_save_CC
 
 fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
   *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
 
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
 fi
 
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2533,60 +3391,59 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 DEPDIR="${am__leading_dot}deps"
 
-          ac_config_commands="$ac_config_commands depfiles"
+ac_config_commands="$ac_config_commands depfiles"
 
 
 am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 
 
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
 rm -f confinc confmf
 
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
-  enableval="$enable_dependency_tracking"
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
 
-fi;
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
+ if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
   AMDEP_FALSE='#'
 else
@@ -2596,20 +3453,20 @@ fi
 
 
 
-
 depcc="$CC"   am_compiler_list=
 
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -2627,6 +3484,11 @@ else
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -2638,34 +3500,49 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -2689,13 +3566,11 @@ else
 fi
 
 fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
-
-
-if
+ if
   test "x$enable_dependency_tracking" != xno \
   && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
   am__fastdepCC_TRUE=
@@ -2706,1269 +3581,262 @@ else
 fi
 
 
-# C Compiler: Check that it is ANSI C
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+# C Compiler: Check that it is POSIX-compliant
 
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
+$as_echo_n "checking for library containing strerror... " >&6; }
+if ${ac_cv_search_strerror+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char strerror ();
+int
+main ()
+{
+return strerror ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' cposix; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_strerror=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_strerror+:} false; then :
+  break
+fi
 done
-done
+if ${ac_cv_search_strerror+:} false; then :
 
+else
+  ac_cv_search_strerror=no
 fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
 fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
+$as_echo "$ac_cv_search_strerror" >&6; }
+ac_res=$ac_cv_search_strerror
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
 fi
 
-  CC=$ac_ct_CC
+
+  msg="for C compiler optimization flags"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking $msg" >&5
+$as_echo_n "checking $msg... " >&6; }
+if ${prog_cc_optim_flags+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  CC="$ac_cv_prog_CC"
+
+    if test -n "$CC"; then
+      cat > conftest.c <<EOF
+int main(int argc, char **argv) { return 0; }
+EOF
+
+            if test "$GCC" = "yes"; then
+        prog_cc_optim_flags="-O -funroll-loops -fomit-frame-pointer -Wall -g"
+
+
+            elif $CC -V 2>&1 | grep -i "WorkShop" > /dev/null 2>&1 &&
+           $CC -c -O conftest.c > /dev/null 2>&1 &&
+           test -f conftest.o; then
+        prog_cc_optim_flags="-O"
+
+            elif ($CC -V 2>&1 | grep -i "Digital UNIX Compiler"> /dev/null 2>&1 ||
+	   $CC -V 2>&1 | grep -i "Compaq C"> /dev/null 2>&1) &&
+           $CC -c -fast conftest.c > /dev/null 2>&1 &&
+           test -f conftest.o; then
+         prog_cc_optim_flags="-fast -tune host"
+
+            elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 &&
+           $CC -c -qinfo=all -O2 conftest.c > /dev/null 2>&1 &&
+           test -f conftest.o; then
+        prog_cc_optim_flags="-O2"
+
+            elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 &&
+           $CC -c -fullwarn -O3 conftest.c > /dev/null 2>&1 &&
+           test -f conftest.o; then
+        prog_cc_optim_flags="-O3"
+
+            elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 &&
+           $CC -c -Aa +O3 conftest.c > /dev/null 2>&1 &&
+           test -f conftest.o; then
+        prog_cc_optim_flags="+O3"
+
+            elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 &&
+           $CC -c -Xc -O conftest.c > /dev/null 2>&1 &&
+           test -f conftest.o; then
+        prog_cc_optim_flags="-O"
+
+            elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 &&
+           $CC -c -h conform -O3 conftest.c > /dev/null 2>&1 &&
+           test -f conftest.o; then
+        prog_cc_optim_flags="-O3"
+
+      fi
+      rm -f conftest.*
+    fi
+    if test -n "$prog_cc_optim_flags"; then
+      CFLAGS="$CFLAGS $prog_cc_optim_flags"
+    else
+      prog_cc_optim_flags="unknown"
+    fi
+
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $prog_cc_optim_flags" >&5
+$as_echo "$prog_cc_optim_flags" >&6; }
 
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$ac_ct_CC" && break
-done
-
-  CC=$ac_ct_CC
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_compiler_gnu=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std1 is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std1.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
-  *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
-fi
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-depcc="$CC"   am_compiler_list=
-
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    case $depmode in
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    none) break ;;
-    esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
-
-if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
-else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
-fi
-
-
-
-am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
-
-# C Compiler: Check that it is POSIX-compliant
-
-echo "$as_me:$LINENO: checking for library containing strerror" >&5
-echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
-if test "${ac_cv_search_strerror+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_strerror=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char strerror ();
-int
-main ()
-{
-strerror ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_strerror="none required"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_strerror" = no; then
-  for ac_lib in cposix; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char strerror ();
-int
-main ()
-{
-strerror ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_strerror="-l$ac_lib"
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
-echo "${ECHO_T}$ac_cv_search_strerror" >&6
-if test "$ac_cv_search_strerror" != no; then
-  test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
-
-fi
-
-
-  msg="for C compiler optimization flags"
-  echo "$as_me:$LINENO: checking $msg" >&5
-echo $ECHO_N "checking $msg... $ECHO_C" >&6
-if test "${prog_cc_optim_flags+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-    if test -n "$CC"; then
-      cat > conftest.c <<EOF
-int main(int argc, char **argv) { return 0; }
-EOF
-
-            if test "$GCC" = "yes"; then
-        prog_cc_optim_flags="-O -funroll-loops -fomit-frame-pointer -Wall -g"
-
-
-            elif $CC -V 2>&1 | grep -i "WorkShop" > /dev/null 2>&1 &&
-           $CC -c -O conftest.c > /dev/null 2>&1 &&
-           test -f conftest.o; then
-        prog_cc_optim_flags="-O"
-
-            elif ($CC -V 2>&1 | grep -i "Digital UNIX Compiler"> /dev/null 2>&1 ||
-	   $CC -V 2>&1 | grep -i "Compaq C"> /dev/null 2>&1) &&
-           $CC -c -fast conftest.c > /dev/null 2>&1 &&
-           test -f conftest.o; then
-         prog_cc_optim_flags="-fast -tune host"
-
-            elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 &&
-           $CC -c -qinfo=all -O2 conftest.c > /dev/null 2>&1 &&
-           test -f conftest.o; then
-        prog_cc_optim_flags="-O2"
-
-            elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 &&
-           $CC -c -fullwarn -O3 conftest.c > /dev/null 2>&1 &&
-           test -f conftest.o; then
-        prog_cc_optim_flags="-O3"
-
-            elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 &&
-           $CC -c -Aa +O3 conftest.c > /dev/null 2>&1 &&
-           test -f conftest.o; then
-        prog_cc_optim_flags="+O3"
-
-            elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 &&
-           $CC -c -Xc -O conftest.c > /dev/null 2>&1 &&
-           test -f conftest.o; then
-        prog_cc_optim_flags="-O"
-
-            elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 &&
-           $CC -c -h conform -O3 conftest.c > /dev/null 2>&1 &&
-           test -f conftest.o; then
-        prog_cc_optim_flags="-O3"
-
-      fi
-      rm -f conftest.*
-    fi
-    if test -n "$prog_cc_optim_flags"; then
-      CFLAGS="$CFLAGS $prog_cc_optim_flags"
-    else
-      prog_cc_optim_flags="unknown"
-    fi
-
-fi
-echo "$as_me:$LINENO: result: $prog_cc_optim_flags" >&5
-echo "${ECHO_T}$prog_cc_optim_flags" >&6
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
   fi
-done
-done
-
-  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  RANLIB=$ac_ct_RANLIB
 else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
 
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-	  if test $ac_prog = install &&
-	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # AIX install.  It has an incompatible calling convention.
-	    :
-	  elif test $ac_prog = install &&
-	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # program-specific install script used by HP pwplus--don't use.
-	    :
-	  else
-	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	    break 3
-	  fi
-	fi
-      done
-    done
-    ;;
-esac
-done
-
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
-    INSTALL=$ac_install_sh
-  fi
-fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 # Checks for libraries.
-
-echo "$as_me:$LINENO: checking for sin in -lm" >&5
-echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6
-if test "${ac_cv_lib_m_sin+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5
+$as_echo_n "checking for sin in -lm... " >&6; }
+if ${ac_cv_lib_m_sin+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char sin ();
 int
 main ()
 {
-sin ();
+return sin ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_m_sin=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_m_sin=no
+  ac_cv_lib_m_sin=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_m_sin" >&5
-echo "${ECHO_T}$ac_cv_lib_m_sin" >&6
-if test $ac_cv_lib_m_sin = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5
+$as_echo "$ac_cv_lib_m_sin" >&6; }
+if test "x$ac_cv_lib_m_sin" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBM 1
 _ACEOF
@@ -3984,15 +3852,15 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -4006,11 +3874,7 @@ do
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -4019,78 +3883,34 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
   break
 fi
 
@@ -4102,8 +3922,8 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -4113,11 +3933,7 @@ do
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -4126,119 +3942,185 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
-  ac_cpp_err=yes
+  ac_cv_path_GREP=$GREP
 fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
 
 
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
     fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
 
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4253,51 +4135,23 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_header_stdc=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_stdc=no
+  ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <string.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -4307,18 +4161,14 @@ fi
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
+  $EGREP "free" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -4328,16 +4178,13 @@ fi
 
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then :
   :
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -4357,109 +4204,39 @@ main ()
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
 	|| toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_run "$LINENO"; then :
 
-( exit $ac_status )
-ac_cv_header_stdc=no
+else
+  ac_cv_header_stdc=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
 
 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
 		  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -4467,157 +4244,13 @@ fi
 done
 
 
-
-
-
-
-
-
-
-
 for ac_header in fcntl.h limits.h malloc.h stdlib.h string.h sys/mman.h sys/types.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ---------------------------- ##
-## Report this to bertin at iap.fr ##
-## ---------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -4626,29 +4259,25 @@ done
 
 
 # Checks for typedefs, structures, and compiler characteristics.
-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
-if test "${ac_cv_c_const+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
-/* FIXME: Include the comments suggested by Paul. */
+
 #ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
+  /* Ultrix mips cc rejects this sort of thing.  */
   typedef int charset[2];
-  const charset x;
+  const charset cs = { 0, 0 };
   /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *ccp;
-  char **p;
+  char const *const *pcpcc;
+  char **ppc;
   /* NEC SVR4.0.2 mips cc rejects this.  */
   struct point {int x, y;};
   static struct point const zero = {0,0};
@@ -4657,16 +4286,18 @@ main ()
      an arm of an if-expression whose if-part is not a constant
      expression */
   const char *g = "string";
-  ccp = &g + (g ? g-g : 0);
+  pcpcc = &g + (g ? g-g : 0);
   /* HPUX 7.0 cc rejects these. */
-  ++ccp;
-  p = (char**) ccp;
-  ccp = (char const *const *) p;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
     char const *s = 0 ? (char *) 0 : (char const *) 0;
 
     *t++ = 0;
+    if (s) return 0;
   }
   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
     int x[] = {25, 17};
@@ -4678,203 +4309,65 @@ main ()
     iptr p = 0;
     ++p;
   }
-  { /* AIX XL C 1.02.0.0 rejects this saying
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
   }
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
     const int foo = 10;
+    if (!foo) return 0;
   }
+  return !cs[0] && !zero.x;
 #endif
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_c_const=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_c_const=no
+  ac_cv_c_const=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
 if test $ac_cv_c_const = no; then
 
-cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
+$as_echo "#define const /**/" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for off_t" >&5
-echo $ECHO_N "checking for off_t... $ECHO_C" >&6
-if test "${ac_cv_type_off_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((off_t *) 0)
-  return 0;
-if (sizeof (off_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_off_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = xyes; then :
 
-ac_cv_type_off_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
-echo "${ECHO_T}$ac_cv_type_off_t" >&6
-if test $ac_cv_type_off_t = yes; then
-  :
 else
 
 cat >>confdefs.h <<_ACEOF
-#define off_t long
+#define off_t long int
 _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
-if test "${ac_cv_type_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((size_t *) 0)
-  return 0;
-if (sizeof (size_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_size_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
 
-ac_cv_type_size_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6
-if test $ac_cv_type_size_t = yes; then
-  :
 else
 
 cat >>confdefs.h <<_ACEOF
-#define size_t unsigned
+#define size_t unsigned int
 _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
-echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
-if test "${ac_cv_struct_tm+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if ${ac_cv_struct_tm+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
 #include <time.h>
@@ -4882,68 +4375,40 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-struct tm *tp; tp->tm_sec;
+struct tm tm;
+				     int *p = &tm.tm_sec;
+				     return !p;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_struct_tm=time.h
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_struct_tm=sys/time.h
+  ac_cv_struct_tm=sys/time.h
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
-echo "${ECHO_T}$ac_cv_struct_tm" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
 if test $ac_cv_struct_tm = sys/time.h; then
 
-cat >>confdefs.h <<\_ACEOF
-#define TM_IN_SYS_TIME 1
-_ACEOF
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
-echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
-if test "${ac_cv_type_uid_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
+$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
+if ${ac_cv_type_uid_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "uid_t" >/dev/null 2>&1; then
+  $EGREP "uid_t" >/dev/null 2>&1; then :
   ac_cv_type_uid_t=yes
 else
   ac_cv_type_uid_t=no
@@ -4951,253 +4416,77 @@ fi
 rm -f conftest*
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
-echo "${ECHO_T}$ac_cv_type_uid_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
+$as_echo "$ac_cv_type_uid_t" >&6; }
 if test $ac_cv_type_uid_t = no; then
 
-cat >>confdefs.h <<\_ACEOF
-#define uid_t int
-_ACEOF
+$as_echo "#define uid_t int" >>confdefs.h
 
 
-cat >>confdefs.h <<\_ACEOF
-#define gid_t int
-_ACEOF
+$as_echo "#define gid_t int" >>confdefs.h
 
 fi
 
 
 # Checks for library functions.
-echo "$as_me:$LINENO: checking for error_at_line" >&5
-echo $ECHO_N "checking for error_at_line... $ECHO_C" >&6
-if test "${ac_cv_lib_error_at_line+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
+$as_echo_n "checking for error_at_line... " >&6; }
+if ${ac_cv_lib_error_at_line+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+#include <error.h>
 int
 main ()
 {
-error_at_line (0, 0, "", 0, "");
+error_at_line (0, 0, "", 0, "an error occurred");
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_error_at_line=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_error_at_line=no
+  ac_cv_lib_error_at_line=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5
-echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
+$as_echo "$ac_cv_lib_error_at_line" >&6; }
 if test $ac_cv_lib_error_at_line = no; then
-  case $LIBOBJS in
-    "error.$ac_objext"   | \
-  *" error.$ac_objext"   | \
-    "error.$ac_objext "* | \
+  case " $LIBOBJS " in
   *" error.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS error.$ac_objext" ;;
-esac
-
-fi
-
-
-for ac_header in stdlib.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ---------------------------- ##
-## Report this to bertin at iap.fr ##
-## ---------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+  *) LIBOBJS="$LIBOBJS error.$ac_objext"
+ ;;
+esac
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+
+for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_STDLIB_H 1
 _ACEOF
 
 fi
 
 done
 
-echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
-echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6
-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then :
   ac_cv_func_malloc_0_nonnull=no
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#if STDC_HEADERS || HAVE_STDLIB_H
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
 # include <stdlib.h>
 #else
 char *malloc ();
@@ -5206,209 +4495,53 @@ char *malloc ();
 int
 main ()
 {
-exit (malloc (0) ? 0 : 1);
+return ! malloc (0);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_func_malloc_0_nonnull=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_malloc_0_nonnull=no
+  ac_cv_func_malloc_0_nonnull=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
-echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6
-if test $ac_cv_func_malloc_0_nonnull = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then :
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 1
-_ACEOF
+$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
 
 else
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 0
-_ACEOF
+  $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
 
-   case $LIBOBJS in
-    "malloc.$ac_objext"   | \
-  *" malloc.$ac_objext"   | \
-    "malloc.$ac_objext "* | \
+   case " $LIBOBJS " in
   *" malloc.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;;
+  *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
 esac
 
 
-cat >>confdefs.h <<\_ACEOF
-#define malloc rpl_malloc
-_ACEOF
-
-fi
-
-
-
-
+$as_echo "#define malloc rpl_malloc" >>confdefs.h
 
-for ac_header in stdlib.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ---------------------------- ##
-## Report this to bertin at iap.fr ##
-## ---------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  for ac_header in $ac_header_list
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -5416,120 +4549,32 @@ fi
 done
 
 
-for ac_func in getpagesize
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+for ac_func in getpagesize
+do :
+  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
+if test "x$ac_cv_func_getpagesize" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GETPAGESIZE 1
 _ACEOF
 
 fi
 done
 
-echo "$as_me:$LINENO: checking for working mmap" >&5
-echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
+$as_echo_n "checking for working mmap... " >&6; }
+if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then :
   ac_cv_func_mmap_fixed_mapped=no
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 /* malloc might have been renamed as rpl_malloc. */
@@ -5560,21 +4605,16 @@ $ac_includes_default
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#if !STDC_HEADERS && !HAVE_STDLIB_H
+#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
 char *malloc ();
 #endif
 
 /* This mess was copied from the GNU getpagesize.h.  */
-#if !HAVE_GETPAGESIZE
-/* Assume that all systems that can run configure have sys/param.h.  */
-# if !HAVE_SYS_PARAM_H
-#  define HAVE_SYS_PARAM_H 1
-# endif
-
+#ifndef HAVE_GETPAGESIZE
 # ifdef _SC_PAGESIZE
 #  define getpagesize() sysconf(_SC_PAGESIZE)
 # else /* no _SC_PAGESIZE */
-#  if HAVE_SYS_PARAM_H
+#  ifdef HAVE_SYS_PARAM_H
 #   include <sys/param.h>
 #   ifdef EXEC_PAGESIZE
 #    define getpagesize() EXEC_PAGESIZE
@@ -5605,41 +4645,56 @@ int
 main ()
 {
   char *data, *data2, *data3;
+  const char *cdata2;
   int i, pagesize;
-  int fd;
+  int fd, fd2;
 
   pagesize = getpagesize ();
 
   /* First, make a file with some known garbage in it. */
   data = (char *) malloc (pagesize);
   if (!data)
-    exit (1);
+    return 1;
   for (i = 0; i < pagesize; ++i)
     *(data + i) = rand ();
   umask (0);
   fd = creat ("conftest.mmap", 0600);
   if (fd < 0)
-    exit (1);
+    return 2;
   if (write (fd, data, pagesize) != pagesize)
-    exit (1);
+    return 3;
   close (fd);
 
+  /* Next, check that the tail of a page is zero-filled.  File must have
+     non-zero length, otherwise we risk SIGBUS for entire page.  */
+  fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
+  if (fd2 < 0)
+    return 4;
+  cdata2 = "";
+  if (write (fd2, cdata2, 1) != 1)
+    return 5;
+  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
+  if (data2 == MAP_FAILED)
+    return 6;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data2 + i))
+      return 7;
+  close (fd2);
+  if (munmap (data2, pagesize))
+    return 8;
+
   /* Next, try to mmap the file at a fixed address which already has
      something else allocated at it.  If we can, also make sure that
      we see the same garbage.  */
   fd = open ("conftest.mmap", O_RDWR);
   if (fd < 0)
-    exit (1);
-  data2 = (char *) malloc (2 * pagesize);
-  if (!data2)
-    exit (1);
-  data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
+    return 9;
   if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
 		     MAP_PRIVATE | MAP_FIXED, fd, 0L))
-    exit (1);
+    return 10;
   for (i = 0; i < pagesize; ++i)
     if (*(data + i) != *(data2 + i))
-      exit (1);
+      return 11;
 
   /* Finally, make sure that changes to the mapped area do not
      percolate back to the file as seen by read().  (This is a bug on
@@ -5648,171 +4703,103 @@ main ()
     *(data2 + i) = *(data2 + i) + 1;
   data3 = (char *) malloc (pagesize);
   if (!data3)
-    exit (1);
+    return 12;
   if (read (fd, data3, pagesize) != pagesize)
-    exit (1);
+    return 13;
   for (i = 0; i < pagesize; ++i)
     if (*(data + i) != *(data3 + i))
-      exit (1);
+      return 14;
   close (fd);
-  exit (0);
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_func_mmap_fixed_mapped=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_mmap_fixed_mapped=no
+  ac_cv_func_mmap_fixed_mapped=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
+$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
 if test $ac_cv_func_mmap_fixed_mapped = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
+$as_echo "#define HAVE_MMAP 1" >>confdefs.h
 
 fi
-rm -f conftest.mmap
+rm -f conftest.mmap conftest.txt
 
-echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
-if test "${ac_cv_type_signal+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
+if ${ac_cv_type_signal+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
 #include <signal.h>
-#ifdef signal
-# undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
 
 int
 main ()
 {
-int i;
+return *(signal (0, 0)) (0) == 1;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_signal=void
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_type_signal=int
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_signal=int
+  ac_cv_type_signal=void
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define RETSIGTYPE $ac_cv_type_signal
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
-echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6
-if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
+$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
+if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   rm -f conftest.sym conftest.file
 echo >conftest.file
 if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
-  if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then :
   ac_cv_func_lstat_dereferences_slashed_symlink=no
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 int
 main ()
 {
 struct stat sbuf;
-     /* Linux will dereference the symlink and fail.
+     /* Linux will dereference the symlink and fail, as required by POSIX.
 	That is better in the sense that it means we will not
 	have to compile and use the lstat wrapper.  */
-     exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1);
+     return lstat ("conftest.sym/", &sbuf) == 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_func_lstat_dereferences_slashed_symlink=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_lstat_dereferences_slashed_symlink=no
+  ac_cv_func_lstat_dereferences_slashed_symlink=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+
 else
   # If the `ln -s' command failed, then we probably don't even
   # have an lstat function.
@@ -5821,8 +4808,8 @@ fi
 rm -f conftest.sym conftest.file
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
+$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
 
 test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
 
@@ -5831,73 +4818,52 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
-  case $LIBOBJS in
-    "lstat.$ac_objext"   | \
-  *" lstat.$ac_objext"   | \
-    "lstat.$ac_objext "* | \
+if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
+  case " $LIBOBJS " in
   *" lstat.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;;
+  *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
+ ;;
 esac
 
 fi
 
-echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5
-echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6
-if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5
+$as_echo_n "checking whether stat accepts an empty string... " >&6; }
+if ${ac_cv_func_stat_empty_string_bug+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then :
   ac_cv_func_stat_empty_string_bug=yes
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 int
 main ()
 {
 struct stat sbuf;
-  exit (stat ("", &sbuf) ? 1 : 0);
+  return stat ("", &sbuf) == 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_stat_empty_string_bug=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_stat_empty_string_bug=no
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_stat_empty_string_bug=no
+  ac_cv_func_stat_empty_string_bug=yes
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5
-echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5
+$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; }
 if test $ac_cv_func_stat_empty_string_bug = yes; then
-  case $LIBOBJS in
-    "stat.$ac_objext"   | \
-  *" stat.$ac_objext"   | \
-    "stat.$ac_objext "* | \
+  case " $LIBOBJS " in
   *" stat.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;;
+  *) LIBOBJS="$LIBOBJS stat.$ac_objext"
+ ;;
 esac
 
 
@@ -5907,286 +4873,68 @@ _ACEOF
 
 fi
 
-
 for ac_func in strftime
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
+if test "x$ac_cv_func_strftime" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_STRFTIME 1
 _ACEOF
 
 else
   # strftime is in -lintl on SCO UNIX.
-echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
-echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
-if test "${ac_cv_lib_intl_strftime+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
+$as_echo_n "checking for strftime in -lintl... " >&6; }
+if ${ac_cv_lib_intl_strftime+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char strftime ();
-int
-main ()
-{
-strftime ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_intl_strftime=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_intl_strftime=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
-if test $ac_cv_lib_intl_strftime = yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
-
-LIBS="-lintl $LIBS"
-fi
-
-fi
-done
-
-
-
-
-
-
-
-
-
-for ac_func in atexit getenv memcpy memmove memset mkdir munmap strstr
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
+LIBS="-lintl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
 #ifdef __cplusplus
-}
+extern "C"
 #endif
-
+char strftime ();
 int
 main ()
 {
-return f != $ac_func;
+return strftime ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_intl_strftime=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ac_cv_lib_intl_strftime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
+$as_echo "$ac_cv_lib_intl_strftime" >&6; }
+if test "x$ac_cv_lib_intl_strftime" = xyes; then :
+  $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
 
-eval "$as_ac_var=no"
+LIBS="-lintl $LIBS"
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+done
+
+for ac_func in atexit getenv memcpy memmove memset mkdir munmap strstr
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -6194,29 +4942,25 @@ done
 
 
 # Check support for large files
-# Check whether --enable-largefile or --disable-largefile was given.
-if test "${enable_largefile+set}" = set; then
-  enableval="$enable_largefile"
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+  enableval=$enable_largefile;
+fi
 
-fi;
 if test "$enable_largefile" != no; then
 
-  echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
-echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_largefile_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_sys_largefile_CC=no
      if test "$GCC" != yes; then
        ac_save_CC=$CC
        while :; do
-     	 # IRIX 6.2 and later do not support large files by default,
-     	 # so use the C compiler's -n32 option if that helps.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	 # IRIX 6.2 and later do not support large files by default,
+	 # so use the C compiler's -n32 option if that helps.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -6235,89 +4979,34 @@ main ()
   return 0;
 }
 _ACEOF
-     	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+	 if ac_fn_c_try_compile "$LINENO"; then :
   break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
 fi
-rm -f conftest.err conftest.$ac_objext
-     	 CC="$CC -n32"
-     	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+rm -f core conftest.err conftest.$ac_objext
+	 CC="$CC -n32"
+	 if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_sys_largefile_CC=' -n32'; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
 fi
-rm -f conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext
 	 break
        done
        CC=$ac_save_CC
        rm -f conftest.$ac_ext
     fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
   if test "$ac_cv_sys_largefile_CC" != no; then
     CC=$CC$ac_cv_sys_largefile_CC
   fi
 
-  echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   while :; do
-  ac_cv_sys_file_offset_bits=no
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -6336,40 +5025,11 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=no; break
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #define _FILE_OFFSET_BITS 64
 #include <sys/types.h>
@@ -6389,60 +5049,33 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_sys_file_offset_bits=64; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
   break
 done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
-echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
-if test "$ac_cv_sys_file_offset_bits" != no; then
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
 cat >>confdefs.h <<_ACEOF
 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
 _ACEOF
-
-fi
-rm -f conftest*
-  echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
-echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_large_files+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+;;
+esac
+rm -rf conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   while :; do
-  ac_cv_sys_large_files=no
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -6461,40 +5094,11 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=no; break
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #define _LARGE_FILES 1
 #include <sys/types.h>
@@ -6514,222 +5118,95 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_sys_large_files=1; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
   break
 done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
-echo "${ECHO_T}$ac_cv_sys_large_files" >&6
-if test "$ac_cv_sys_large_files" != no; then
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
 cat >>confdefs.h <<_ACEOF
 #define _LARGE_FILES $ac_cv_sys_large_files
 _ACEOF
+;;
+esac
+rm -rf conftest*
+  fi
+
 
-fi
-rm -f conftest*
 fi
 
-echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5
-echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_largefile_source+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_source+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   while :; do
-  ac_cv_sys_largefile_source=no
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdio.h>
+#include <sys/types.h> /* for off_t */
+     #include <stdio.h>
 int
 main ()
 {
-return !fseeko;
+int (*fp) (FILE *, off_t, int) = fseeko;
+     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_sys_largefile_source=no; break
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #define _LARGEFILE_SOURCE 1
-#include <stdio.h>
+#include <sys/types.h> /* for off_t */
+     #include <stdio.h>
 int
 main ()
 {
-return !fseeko;
+int (*fp) (FILE *, off_t, int) = fseeko;
+     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_sys_largefile_source=1; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  ac_cv_sys_largefile_source=unknown
   break
 done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
-if test "$ac_cv_sys_largefile_source" != no; then
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
+$as_echo "$ac_cv_sys_largefile_source" >&6; }
+case $ac_cv_sys_largefile_source in #(
+  no | unknown) ;;
+  *)
 cat >>confdefs.h <<_ACEOF
 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
 _ACEOF
-
-fi
-rm -f conftest*
+;;
+esac
+rm -rf conftest*
 
 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
 # in glibc 2.1.3, but that breaks too many other things.
 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
-echo "$as_me:$LINENO: checking for fseeko" >&5
-echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
-if test "${ac_cv_func_fseeko+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-return fseeko && fseeko (stdin, 0, 0);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_fseeko=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_fseeko=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_fseeko" >&5
-echo "${ECHO_T}$ac_cv_func_fseeko" >&6
-if test $ac_cv_func_fseeko = yes; then
+if test $ac_cv_sys_largefile_source != unknown; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FSEEKO 1
-_ACEOF
+$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
 
 fi
 
@@ -6773,12 +5250,12 @@ LDFLAGS="$myldflags"
 fi
 
 # Display compiler and linker flags
-echo "$as_me:$LINENO: result: I will compile using:  $CC $CFLAGS" >&5
-echo "${ECHO_T}I will compile using:  $CC $CFLAGS" >&6
-echo "$as_me:$LINENO: result: I will link using:     $CC $LDFLAGS $LIBS" >&5
-echo "${ECHO_T}I will link using:     $CC $LDFLAGS $LIBS" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: I will compile using:  $CC $CFLAGS" >&5
+$as_echo "I will compile using:  $CC $CFLAGS" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: I will link using:     $CC $LDFLAGS $LIBS" >&5
+$as_echo "I will link using:     $CC $LDFLAGS $LIBS" >&6; }
 
-                                                                                ac_config_files="$ac_config_files Makefile man/Makefile src/Makefile src/fits/Makefile src/wcs/Makefile sextractor.spec sextractor-tpx.spec man/sex.1"
+ac_config_files="$ac_config_files Makefile man/Makefile src/Makefile src/fits/Makefile src/wcs/Makefile sextractor.spec sextractor-tpx.spec man/sex.1"
 
 
 
@@ -6786,66 +5263,58 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[	 ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[	 ]*$//;
-}'
-fi
-
 DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
 LTLIBOBJS=$ac_ltlibobjs
 
 
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
 fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -6855,81 +5324,253 @@ cat >$CONFIG_STATUS <<_ACEOF
 debug=false
 ac_cs_recheck=false
 ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-done
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
 
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
 fi
 
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
-# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
-# PATH needs CR, and LINENO needs CR and PATH.
 # Avoid depending upon Character Ranges.
 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -6937,148 +5578,111 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
-    sed '
-      N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
-      t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
-  # Exit status is that of the last command.
-  exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
 else
-  as_expr=false
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
 fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
     as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
   fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
 
+} # as_fn_mkdir_p
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -7087,31 +5691,20 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
 exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
+# values after options handling.
+ac_log="
 This file was extended by sextractor $as_me 2.5.0, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -7119,45 +5712,47 @@ generated by GNU Autoconf 2.59.  Invocation command line was
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $0 $@
 
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
 _ACEOF
 
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
 
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
 
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
 
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+_ACEOF
 
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
 
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [TAG]...
 
   -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
-  -q, --quiet      do not print progress messages
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-		   instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
-		   instantiate the configuration header FILE
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
 
 Configuration files:
 $config_files
@@ -7168,84 +5763,92 @@ $config_headers
 Configuration commands:
 $config_commands
 
-Report bugs to <bug-autoconf at gnu.org>."
-_ACEOF
+Report bugs to <bertin at iap.fr>."
 
-cat >>$CONFIG_STATUS <<_ACEOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 sextractor config.status 2.5.0
-configured by $0, generated by GNU Autoconf 2.59,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
 ac_need_defaults=:
 while test $# != 0
 do
   case $1 in
-  --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  -*)
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
     ac_option=$1
     ac_optarg=$2
     ac_shift=shift
     ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
   esac
 
   case $ac_option in
   # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
     $ac_shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
     ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; } ;;
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
 
-  *) ac_config_targets="$ac_config_targets $1" ;;
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
 
   esac
   shift
@@ -7259,46 +5862,58 @@ if $ac_cs_silent; then
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
 fi
 
 _ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
 
-cat >>$CONFIG_STATUS <<_ACEOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
-# INIT-COMMANDS section.
+# INIT-COMMANDS
 #
-
 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
 
 _ACEOF
 
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 
-
-cat >>$CONFIG_STATUS <<\_ACEOF
+# Handling of arguments.
 for ac_config_target in $ac_config_targets
 do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-  "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
-  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
-  "src/fits/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/fits/Makefile" ;;
-  "src/wcs/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/wcs/Makefile" ;;
-  "sextractor.spec" ) CONFIG_FILES="$CONFIG_FILES sextractor.spec" ;;
-  "sextractor-tpx.spec" ) CONFIG_FILES="$CONFIG_FILES sextractor-tpx.spec" ;;
-  "man/sex.1" ) CONFIG_FILES="$CONFIG_FILES man/sex.1" ;;
-  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
-  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
-  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "src/fits/Makefile") CONFIG_FILES="$CONFIG_FILES src/fits/Makefile" ;;
+    "src/wcs/Makefile") CONFIG_FILES="$CONFIG_FILES src/wcs/Makefile" ;;
+    "sextractor.spec") CONFIG_FILES="$CONFIG_FILES sextractor.spec" ;;
+    "sextractor-tpx.spec") CONFIG_FILES="$CONFIG_FILES sextractor-tpx.spec" ;;
+    "man/sex.1") CONFIG_FILES="$CONFIG_FILES man/sex.1" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
+
 # If the user did not use the arguments to specify the items to instantiate,
 # then the envvar interface is used.  Set only those that are not.
 # We use the long form for the default assignment because of an extremely
@@ -7310,814 +5925,689 @@ if $ac_need_defaults; then
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
 }
-
 # Create a (secure) tmp directory for tmp files.
 
 {
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
 }  ||
 {
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
-} ||
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
 {
-   echo "$me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
 }
 
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[	 ]*$//
+}'
+fi
 
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s, at SHELL@,$SHELL,;t t
-s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s, at exec_prefix@,$exec_prefix,;t t
-s, at prefix@,$prefix,;t t
-s, at program_transform_name@,$program_transform_name,;t t
-s, at bindir@,$bindir,;t t
-s, at sbindir@,$sbindir,;t t
-s, at libexecdir@,$libexecdir,;t t
-s, at datadir@,$datadir,;t t
-s, at sysconfdir@,$sysconfdir,;t t
-s, at sharedstatedir@,$sharedstatedir,;t t
-s, at localstatedir@,$localstatedir,;t t
-s, at libdir@,$libdir,;t t
-s, at includedir@,$includedir,;t t
-s, at oldincludedir@,$oldincludedir,;t t
-s, at infodir@,$infodir,;t t
-s, at mandir@,$mandir,;t t
-s, at build_alias@,$build_alias,;t t
-s, at host_alias@,$host_alias,;t t
-s, at target_alias@,$target_alias,;t t
-s, at DEFS@,$DEFS,;t t
-s, at ECHO_C@,$ECHO_C,;t t
-s, at ECHO_N@,$ECHO_N,;t t
-s, at ECHO_T@,$ECHO_T,;t t
-s, at LIBS@,$LIBS,;t t
-s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s, at INSTALL_DATA@,$INSTALL_DATA,;t t
-s, at CYGPATH_W@,$CYGPATH_W,;t t
-s, at PACKAGE@,$PACKAGE,;t t
-s, at VERSION@,$VERSION,;t t
-s, at ACLOCAL@,$ACLOCAL,;t t
-s, at AUTOCONF@,$AUTOCONF,;t t
-s, at AUTOMAKE@,$AUTOMAKE,;t t
-s, at AUTOHEADER@,$AUTOHEADER,;t t
-s, at MAKEINFO@,$MAKEINFO,;t t
-s, at install_sh@,$install_sh,;t t
-s, at STRIP@,$STRIP,;t t
-s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s, at INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s, at mkdir_p@,$mkdir_p,;t t
-s, at AWK@,$AWK,;t t
-s, at SET_MAKE@,$SET_MAKE,;t t
-s, at am__leading_dot@,$am__leading_dot,;t t
-s, at AMTAR@,$AMTAR,;t t
-s, at am__tar@,$am__tar,;t t
-s, at am__untar@,$am__untar,;t t
-s, at PACKAGER@,$PACKAGER,;t t
-s, at DATE2@,$DATE2,;t t
-s, at DATE3@,$DATE3,;t t
-s, at CC@,$CC,;t t
-s, at CFLAGS@,$CFLAGS,;t t
-s, at LDFLAGS@,$LDFLAGS,;t t
-s, at CPPFLAGS@,$CPPFLAGS,;t t
-s, at ac_ct_CC@,$ac_ct_CC,;t t
-s, at EXEEXT@,$EXEEXT,;t t
-s, at OBJEXT@,$OBJEXT,;t t
-s, at DEPDIR@,$DEPDIR,;t t
-s, at am__include@,$am__include,;t t
-s, at am__quote@,$am__quote,;t t
-s, at AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s, at AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s, at AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s, at CCDEPMODE@,$CCDEPMODE,;t t
-s, at am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s, at am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s, at RANLIB@,$RANLIB,;t t
-s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s, at CPP@,$CPP,;t t
-s, at EGREP@,$EGREP,;t t
-s, at LIBOBJS@,$LIBOBJS,;t t
-s, at LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
 
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
 _ACEOF
 
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
-fi # test -n "$CONFIG_FILES"
+done
 
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
   esac
 
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+  ac_dir=`$as_dirname -- "$ac_file" ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
   ac_builddir=.
 
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
 
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
 
   case $INSTALL in
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
   esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-				     sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-  sed "$ac_vpsub
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
 $extrasub
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s, at configure_input@,$configure_input,;t t
-s, at srcdir@,$ac_srcdir,;t t
-s, at abs_srcdir@,$ac_abs_srcdir,;t t
-s, at top_srcdir@,$ac_top_srcdir,;t t
-s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s, at builddir@,$ac_builddir,;t t
-s, at abs_builddir@,$ac_abs_builddir,;t t
-s, at top_builddir@,$ac_top_builddir,;t t
-s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
-s, at INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
-ac_dB='[	 ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
-
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 # Do quote $f, to prevent DOS paths from being IFS'd.
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
-
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h.  The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status.  Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless.  Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments.  This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
-
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo '  :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
-do
-  # Write a limited-size here document to $tmp/defines.sed.
-  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#define' lines.
-  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
-  rm -f conftest.defines
-  mv conftest.tail conftest.defines
-done
-rm -f conftest.defines
-echo '  fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
-  # Write a limited-size here document to $tmp/undefs.sed.
-  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#undef'
-  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
-  rm -f conftest.undefs
-  mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
   if test x"$ac_file" != x-; then
-    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
-      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-      rm -f $ac_file
-      mv $tmp/config.h $ac_file
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
-# Compute $ac_file's index in $config_headers.
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
 _am_stamp_count=1
 for _am_header in $config_headers :; do
   case $_am_header in
-    $ac_file | $ac_file:* )
+    $_am_arg | $_am_arg:* )
       break ;;
     * )
       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
   esac
 done
-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X$ac_file : 'X\(//\)[^/]' \| \
-	 X$ac_file : 'X\(//\)$' \| \
-	 X$ac_file : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X$ac_file |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`/stamp-h$_am_stamp_count
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
-  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
-  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
-  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_dest" : 'X\(//\)[^/]' \| \
-	 X"$ac_dest" : 'X\(//\)$' \| \
-	 X"$ac_dest" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-  ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
 
 
-  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
-  case $ac_dest in
-    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`(dirname "$mf") 2>/dev/null ||
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$mf" : 'X\(//\)[^/]' \| \
 	 X"$mf" : 'X\(//\)$' \| \
-	 X"$mf" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$mf" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`(dirname "$file") 2>/dev/null ||
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$file" : 'X\(//\)[^/]' \| \
 	 X"$file" : 'X\(//\)$' \| \
-	 X"$file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    { if $as_mkdir_p; then
-    mkdir -p $dirpart/$fdir
-  else
-    as_dir=$dirpart/$fdir
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
     done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
   done
-done
+}
  ;;
+
   esac
-done
-_ACEOF
+done # for ac_tag
 
-cat >>$CONFIG_STATUS <<\_ACEOF
 
-{ (exit 0); exit 0; }
+as_fn_exit 0
 _ACEOF
-chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
 
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
@@ -8137,6 +6627,10 @@ if test "$no_create" != yes; then
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
+  $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
diff --git a/sextractor/configure.ac b/sextractor/configure.ac
index c649a75..a5914ab 100644
--- a/sextractor/configure.ac
+++ b/sextractor/configure.ac
@@ -71,8 +71,6 @@ AC_ARG_ENABLE(static,
 # Checks for programs.
 # GCC is chosen last because it is likely to yield less optimized code
 AC_PROG_CC([$cclist])
-# C Compiler: Check that it is ANSI C
-AM_PROG_CC_STDC
 # C Compiler: Check that it is POSIX-compliant
 AC_ISC_POSIX
 ACX_PROG_CC_OPTIM
diff --git a/sextractor/man/Makefile.in b/sextractor/man/Makefile.in
index ce1ac17..052e46d 100644
--- a/sextractor/man/Makefile.in
+++ b/sextractor/man/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -13,15 +13,29 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -44,12 +58,16 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = sex.1
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -70,6 +88,8 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -79,6 +99,7 @@ LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGER = @PACKAGER@
@@ -86,6 +107,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
@@ -93,11 +115,11 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -105,24 +127,36 @@ am__tar = @am__tar@
 am__untar = @am__untar@
 bindir = @bindir@
 build_alias = @build_alias@
+builddir = @builddir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host_alias = @host_alias@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 all: all-am
 
 .SUFFIXES:
@@ -130,14 +164,14 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  man/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  man/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu man/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -155,40 +189,45 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 sex.1: $(top_builddir)/config.status $(srcdir)/sex.1.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-uninstall-info-am:
 tags: TAGS
 TAGS:
 
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -206,16 +245,22 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -234,18 +279,38 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
 
 install-data-am:
 
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-am
+
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -264,21 +329,25 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic distclean \
 	distclean-generic distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-exec \
-	install-exec-am install-info install-info-am install-man \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
 	install-strip installcheck installcheck-am installdirs \
 	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
-	uninstall-info-am
+	mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
 
 
 # Manpage Makefile for SExtractor
 # Copyright (C) 2002 Emmanuel Bertin.
 #dist_man_MANS = sex.1 sex.x
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/sextractor/src/Makefile.in b/sextractor/src/Makefile.in
index 8635f68..a8988bd 100644
--- a/sextractor/src/Makefile.in
+++ b/sextractor/src/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,29 @@
 
 @SET_MAKE@
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -36,7 +50,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = sex$(EXEEXT)
 subdir = src
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/autoconf/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acx_prog_cc_optim.m4 \
 	$(top_srcdir)/configure.ac
@@ -45,8 +60,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
 am_sex_OBJECTS = analyse.$(OBJEXT) assoc.$(OBJEXT) astrom.$(OBJEXT) \
 	back.$(OBJEXT) bpro.$(OBJEXT) catout.$(OBJEXT) check.$(OBJEXT) \
@@ -62,9 +77,10 @@ am_sex_OBJECTS = analyse.$(OBJEXT) assoc.$(OBJEXT) astrom.$(OBJEXT) \
 sex_OBJECTS = $(am_sex_OBJECTS)
 sex_DEPENDENCIES = $(top_builddir)/src/fits/libfits.a \
 	$(top_builddir)/src/wcs/libwcs_c.a
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
@@ -73,17 +89,51 @@ SOURCES = $(sex_SOURCES)
 DIST_SOURCES = $(sex_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
-	install-exec-recursive install-info-recursive \
-	install-recursive installcheck-recursive installdirs-recursive \
-	pdf-recursive ps-recursive uninstall-info-recursive \
-	uninstall-recursive
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -104,6 +154,8 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -113,6 +165,7 @@ LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGER = @PACKAGER@
@@ -120,6 +173,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
@@ -127,11 +181,11 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -139,24 +193,36 @@ am__tar = @am__tar@
 am__untar = @am__untar@
 bindir = @bindir@
 build_alias = @build_alias@
+builddir = @builddir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host_alias = @host_alias@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 
 # Program Makefile for SEx
 # Copyright (C) 2004-2006 Emmanuel Bertin.
@@ -185,14 +251,14 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -210,32 +276,50 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
-	@list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  if test -f $$p \
-	  ; then \
-	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
-	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
-	  else :; fi; \
-	done
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	      echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	      $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
 
 uninstall-binPROGRAMS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
-	done
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
 	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-sex$(EXEEXT): $(sex_OBJECTS) $(sex_DEPENDENCIES) 
+sex$(EXEEXT): $(sex_OBJECTS) $(sex_DEPENDENCIES) $(EXTRA_sex_DEPENDENCIES) 
 	@rm -f sex$(EXEEXT)
-	$(LINK) $(sex_LDFLAGS) $(sex_OBJECTS) $(sex_LDADD) $(LIBS)
+	$(LINK) $(sex_OBJECTS) $(sex_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -280,28 +364,27 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xml.Po at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@failcom='exit 1'; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
 	  case $$f in \
 	    *=* | --[!k]*);; \
@@ -310,7 +393,11 @@ $(RECURSIVE_TARGETS):
 	done; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -318,51 +405,23 @@ $(RECURSIVE_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
-	@failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
 	done
 ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -370,14 +429,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
@@ -389,81 +448,112 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test ! -f $$subdir/TAGS || \
-	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(mkdir_p) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	    distdir=`$(am__cd) $(distdir) && pwd`; \
-	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
-	    (cd $$subdir && \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
 	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$top_distdir" \
-	        distdir="$$distdir/$$subdir" \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
 	        distdir) \
 	      || exit 1; \
 	  fi; \
@@ -474,7 +564,7 @@ all-am: Makefile $(PROGRAMS)
 installdirs: installdirs-recursive
 installdirs-am:
 	for dir in "$(DESTDIR)$(bindir)"; do \
-	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-recursive
 install-exec: install-exec-recursive
@@ -486,16 +576,22 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -516,18 +612,38 @@ dvi-am:
 
 html: html-recursive
 
+html-am:
+
 info: info-recursive
 
 info-am:
 
 install-data-am:
 
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
 install-exec-am: install-binPROGRAMS
 
+install-html: install-html-recursive
+
+install-html-am:
+
 install-info: install-info-recursive
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -547,23 +663,27 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+uninstall-am: uninstall-binPROGRAMS
 
-uninstall-info: uninstall-info-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
-	clean clean-binPROGRAMS clean-generic clean-recursive ctags \
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic cscopelist cscopelist-recursive ctags \
 	ctags-recursive distclean distclean-compile distclean-generic \
-	distclean-recursive distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-exec install-exec-am \
-	install-info install-info-am install-man install-strip \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-generic \
-	maintainer-clean-recursive mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \
-	tags tags-recursive uninstall uninstall-am \
-	uninstall-binPROGRAMS uninstall-info-am
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-binPROGRAMS install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-binPROGRAMS
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/sextractor/src/fits/Makefile.in b/sextractor/src/fits/Makefile.in
index 05d43e7..46a6c83 100644
--- a/sextractor/src/fits/Makefile.in
+++ b/sextractor/src/fits/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,29 @@
 
 @SET_MAKE@
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -35,7 +49,8 @@ NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 subdir = src/fits
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/autoconf/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acx_prog_cc_optim.m4 \
 	$(top_srcdir)/configure.ac
@@ -44,6 +59,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
 AR = ar
 ARFLAGS = cru
@@ -55,21 +71,25 @@ am_libfits_a_OBJECTS = fitsbody.$(OBJEXT) fitscat.$(OBJEXT) \
 	fitsread.$(OBJEXT) fitstab.$(OBJEXT) fitsutil.$(OBJEXT) \
 	fitswrite.$(OBJEXT)
 libfits_a_OBJECTS = $(am_libfits_a_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(libfits_a_SOURCES)
 DIST_SOURCES = $(libfits_a_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -90,6 +110,8 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -99,6 +121,7 @@ LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGER = @PACKAGER@
@@ -106,6 +129,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
@@ -113,11 +137,11 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -125,24 +149,36 @@ am__tar = @am__tar@
 am__untar = @am__untar@
 bindir = @bindir@
 build_alias = @build_alias@
+builddir = @builddir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host_alias = @host_alias@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 
 # Program Makefile for the FITScat library
 # Copyright (C) 2002 Emmanuel Bertin.
@@ -160,14 +196,14 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/fits/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/fits/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/fits/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/fits/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -185,10 +221,11 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libfits.a: $(libfits_a_OBJECTS) $(libfits_a_DEPENDENCIES) 
+libfits.a: $(libfits_a_OBJECTS) $(libfits_a_DEPENDENCIES) $(EXTRA_libfits_a_DEPENDENCIES) 
 	-rm -f libfits.a
 	$(libfits_a_AR) libfits.a $(libfits_a_OBJECTS) $(libfits_a_LIBADD)
 	$(RANLIB) libfits.a
@@ -213,92 +250,112 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitswrite.Po at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -316,16 +373,22 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -346,18 +409,38 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
 
 install-data-am:
 
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-am
+
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -377,18 +460,23 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-noinstLIBRARIES ctags distclean distclean-compile \
-	distclean-generic distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
+	clean-noinstLIBRARIES cscopelist ctags distclean \
+	distclean-compile distclean-generic distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am uninstall-info-am
+	uninstall-am
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/sextractor/src/wcs/Makefile.in b/sextractor/src/wcs/Makefile.in
index f72bcf4..44372dc 100644
--- a/sextractor/src/wcs/Makefile.in
+++ b/sextractor/src/wcs/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,29 @@
 
 @SET_MAKE@
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -35,7 +49,8 @@ NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 subdir = src/wcs
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/autoconf/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acx_prog_cc_optim.m4 \
 	$(top_srcdir)/configure.ac
@@ -44,6 +59,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
 AR = ar
 ARFLAGS = cru
@@ -53,21 +69,25 @@ am_libwcs_c_a_OBJECTS = cel.$(OBJEXT) lin.$(OBJEXT) poly.$(OBJEXT) \
 	proj.$(OBJEXT) sph.$(OBJEXT) tnx.$(OBJEXT) wcs.$(OBJEXT) \
 	wcstrig.$(OBJEXT)
 libwcs_c_a_OBJECTS = $(am_libwcs_c_a_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(libwcs_c_a_SOURCES)
 DIST_SOURCES = $(libwcs_c_a_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -88,6 +108,8 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -97,6 +119,7 @@ LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGER = @PACKAGER@
@@ -104,6 +127,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
@@ -111,11 +135,11 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -123,24 +147,36 @@ am__tar = @am__tar@
 am__untar = @am__untar@
 bindir = @bindir@
 build_alias = @build_alias@
+builddir = @builddir@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host_alias = @host_alias@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 
 # Program Makefile for the WCS library
 # Copyright (C) 2002 Emmanuel Bertin.
@@ -158,14 +194,14 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/wcs/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/wcs/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/wcs/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/wcs/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -183,10 +219,11 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libwcs_c.a: $(libwcs_c_a_OBJECTS) $(libwcs_c_a_DEPENDENCIES) 
+libwcs_c.a: $(libwcs_c_a_OBJECTS) $(libwcs_c_a_DEPENDENCIES) $(EXTRA_libwcs_c_a_DEPENDENCIES) 
 	-rm -f libwcs_c.a
 	$(libwcs_c_a_AR) libwcs_c.a $(libwcs_c_a_OBJECTS) $(libwcs_c_a_LIBADD)
 	$(RANLIB) libwcs_c.a
@@ -207,92 +244,112 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wcstrig.Po at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
- at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-	list='$(DISTFILES)'; for file in $$list; do \
-	  case $$file in \
-	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-	  esac; \
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-	    dir="/$$dir"; \
-	    $(mkdir_p) "$(distdir)$$dir"; \
-	  else \
-	    dir=''; \
-	  fi; \
 	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -310,16 +367,22 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -340,18 +403,38 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
 
 install-data-am:
 
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
 install-exec-am:
 
+install-html: install-html-am
+
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -371,18 +454,23 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-noinstLIBRARIES ctags distclean distclean-compile \
-	distclean-generic distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
+	clean-noinstLIBRARIES cscopelist ctags distclean \
+	distclean-compile distclean-generic distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am uninstall-info-am
+	uninstall-am
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/sextractor/src/wcs/cel.c b/sextractor/src/wcs/cel.c
index 747fb7a..91c95ec 100644
--- a/sextractor/src/wcs/cel.c
+++ b/sextractor/src/wcs/cel.c
@@ -234,7 +234,7 @@
 *   Author: Mark Calabretta, Australia Telescope National Facility
 *   IRAF's TNX added by E.Bertin 2000/03/28
 *   Filtering of abs(phi)>180 and abs(theta)>90 added by E.Bertin 2000/11/11
-*   $Id: cel.c,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: cel.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 
 #ifdef HAVE_CONFIG_H
diff --git a/sextractor/src/wcs/cel.h b/sextractor/src/wcs/cel.h
index bb96bbb..1b12a9a 100644
--- a/sextractor/src/wcs/cel.h
+++ b/sextractor/src/wcs/cel.h
@@ -26,7 +26,7 @@
 *                      AUSTRALIA
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
-*   $Id: cel.h,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: cel.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
  
 #ifndef WCSLIB_CEL
diff --git a/sextractor/src/wcs/lin.c b/sextractor/src/wcs/lin.c
index c111e17..9c50640 100644
--- a/sextractor/src/wcs/lin.c
+++ b/sextractor/src/wcs/lin.c
@@ -138,7 +138,7 @@
 *   leak will result.
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
-*   $Id: lin.c,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: lin.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 
 #ifdef HAVE_CONFIG_H
diff --git a/sextractor/src/wcs/lin.h b/sextractor/src/wcs/lin.h
index f65f08b..50e9db6 100644
--- a/sextractor/src/wcs/lin.h
+++ b/sextractor/src/wcs/lin.h
@@ -26,7 +26,7 @@
 *                      AUSTRALIA
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
-*   $Id: lin.h,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: lin.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 
 #ifndef WCSLIB_LIN
diff --git a/sextractor/src/wcs/proj.c b/sextractor/src/wcs/proj.c
index 6b23dc8..bca39a2 100644
--- a/sextractor/src/wcs/proj.c
+++ b/sextractor/src/wcs/proj.c
@@ -191,7 +191,7 @@
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
 *   IRAF's TNX added by E.Bertin 2000/08/23
-*   $Id: proj.c,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: proj.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 
 #ifdef HAVE_CONFIG_H
diff --git a/sextractor/src/wcs/proj.h b/sextractor/src/wcs/proj.h
index b15711c..8a41375 100644
--- a/sextractor/src/wcs/proj.h
+++ b/sextractor/src/wcs/proj.h
@@ -27,7 +27,7 @@
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
 *   IRAF's TNX added by E.Bertin 2000/03/28
-*   $Id: proj.h,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: proj.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 
 #ifndef WCSLIB_PROJ
diff --git a/sextractor/src/wcs/sph.c b/sextractor/src/wcs/sph.c
index 78a0c89..972ea52 100644
--- a/sextractor/src/wcs/sph.c
+++ b/sextractor/src/wcs/sph.c
@@ -86,7 +86,7 @@
 *                           0: Success.
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
-*   $Id: sph.c,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: sph.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 
 #ifdef HAVE_CONFIG_H
diff --git a/sextractor/src/wcs/sph.h b/sextractor/src/wcs/sph.h
index 1873e75..eb097fb 100644
--- a/sextractor/src/wcs/sph.h
+++ b/sextractor/src/wcs/sph.h
@@ -26,7 +26,7 @@
 *                      AUSTRALIA
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
-*   $Id: sph.h,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: sph.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 
 #ifndef WCSLIB_SPH
diff --git a/sextractor/src/wcs/wcs.c b/sextractor/src/wcs/wcs.c
index ed79c7e..1217d0c 100644
--- a/sextractor/src/wcs/wcs.c
+++ b/sextractor/src/wcs/wcs.c
@@ -375,7 +375,7 @@
 *      projections.
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
-*   $Id: wcs.c,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: wcs.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 
 #ifdef HAVE_CONFIG_H
diff --git a/sextractor/src/wcs/wcs.h b/sextractor/src/wcs/wcs.h
index 92ff659..0755249 100644
--- a/sextractor/src/wcs/wcs.h
+++ b/sextractor/src/wcs/wcs.h
@@ -26,7 +26,7 @@
 *                      AUSTRALIA
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
-*   $Id: wcs.h,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: wcs.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 
 #ifndef WCSLIB_WCS
diff --git a/sextractor/src/wcs/wcsmath.h b/sextractor/src/wcs/wcsmath.h
index ecb3962..ea21936 100644
--- a/sextractor/src/wcs/wcsmath.h
+++ b/sextractor/src/wcs/wcsmath.h
@@ -26,7 +26,7 @@
 *                      AUSTRALIA
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
-*   $Id: wcsmath.h,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: wcsmath.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 
 #ifndef WCSLIB_MATH
diff --git a/sextractor/src/wcs/wcstrig.c b/sextractor/src/wcs/wcstrig.c
index 957f874..6fc179d 100644
--- a/sextractor/src/wcs/wcstrig.c
+++ b/sextractor/src/wcs/wcstrig.c
@@ -30,7 +30,7 @@
 *   The functions defined herein are trigonometric or inverse trigonometric
 *   functions which take or return angular arguments in decimal degrees.
 *
-*   $Id: wcstrig.c,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: wcstrig.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *---------------------------------------------------------------------------*/
 
 #ifdef HAVE_CONFIG_H
diff --git a/sextractor/src/wcs/wcstrig.h b/sextractor/src/wcs/wcstrig.h
index 1713d3f..69cb9f9 100644
--- a/sextractor/src/wcs/wcstrig.h
+++ b/sextractor/src/wcs/wcstrig.h
@@ -26,7 +26,7 @@
 *                      AUSTRALIA
 *
 *   Author: Mark Calabretta, Australia Telescope National Facility
-*   $Id: wcstrig.h,v 1.1 2007/09/11 09:45:24 jmlarsen Exp $
+*   $Id: wcstrig.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
 *===========================================================================*/
 #ifndef WCSLIB_TRIG
 #define WCSLIB_TRIG

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cpl-plugin-fors.git



More information about the debian-science-commits mailing list